aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@google.com>2023-12-05 17:11:42 -0800
committerGurchetan Singh <gurchetansingh@google.com>2024-03-05 18:20:47 -0800
commit1d68bf525640afcb7123fa84ef8673b705817784 (patch)
tree13b317aad906dd0fe22f0d3311895cfb104b66d8
parent4c68bbc3ea99997df44bbe098b7ab5c733506931 (diff)
downloadmesa3d-1d68bf525640afcb7123fa84ef8673b705817784.tar.gz
ANDROID: mesa: import gfxstream
Mega-change to support gfxstream. We should really figure out a history preserving method... Common question: Why do we need to import gfxstream into Mesa, and not have a transition period where we build parts of Mesa in Soong, and have gfxstream depend on those built parts. Answer: That may work right now for Android, but there are other consumers of gfxstream (b:282968393) that have their own versions of Mesa and gfxstream respectively. We would break them if we deleted version of Mesa in gfxstream immediately. In addition, GfxstreamEnd2EndTests depends on a certain version of vk.xml, but upstream Mesa uses a newer version. But we can't migrate to the newer version since upstream Vulkan.hpp (the vk.xml dependent part of the code) hasn't migrated to the newer version. In addition, this is exactly the upstream merge request here: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246 The goal AOSP Mesa is to test these MRs in production-like environment. Bug: 327408955 Test: compile Change-Id: I7baa0474ce2b7b256e687784d5d324ee7cba7e0d
-rw-r--r--LICENSE858
-rw-r--r--src/gfxstream/.clang-format15
-rw-r--r--src/gfxstream/.gitignore295
-rw-r--r--src/gfxstream/CMakeLists.txt165
-rw-r--r--src/gfxstream/LICENSE855
-rw-r--r--src/gfxstream/MODULE_LICENSE_APACHE20
-rw-r--r--src/gfxstream/OWNERS7
-rw-r--r--src/gfxstream/README.md110
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/README.adoc83
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/checkLinks.py353
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/extensionStubSource.py327
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/findBalance.py162
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/fixupRef.py202
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/insertTags.py102
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/realign.py48
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/refDesc.py356
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/__init__.py.docs37
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/antora-prep.py586
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/apiconventions.py21
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/LICENSE21
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/README.md123
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/asciidoctor-chunker.js4
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/__init__.py20
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/api_log_decoder.py338
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/__init__.py2
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/codegen.py1074
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/vulkantypes.py1324
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/counting.py696
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/decoder.py945
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/decodersnapshot.py267
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/deepcopy.py383
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/dispatch.py501
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/encoder.py723
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/extensionstructs.py137
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/frontend.py102
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/functable.py628
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/handlemap.py264
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/marshaling.py1035
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/marshalingdefs.py528
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/reservedmarshaling.py1061
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/subdecode.py405
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/testing.py399
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/transform.py348
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/unbox.py81
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/vkextensionstructuretype.py46
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/wrapperdefs.py108
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cerealgenerator.py865
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cgenerator.py513
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/checkXrefs26
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/check_html_xrefs.py96
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/check_spec_links.py182
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/ci/check_undefined22
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/comment_convert.py203
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/compImages.sh127
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/deperiodize_vuids.py40
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/docgenerator.py510
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/doctransformer.py449
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/extdependency.py205
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/extensionmetadocgenerator.py737
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/formatsgenerator.py224
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genRef.py1113
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genRelease257
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/generator.py1394
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genspec.py164
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genvk.py1240
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/globalizeIncludes22
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/hostsyncgenerator.py145
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/htmldiff/htmldiff135
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/htmldiff/htmldiff.pl581
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/indexExt.py94
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/interfacedocgenerator.py124
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/jsgenerator.py100
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_c_generator.py659
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_generator.py982
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_h_generator.py196
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_parser.py1020
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_validate.py85
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/linkcheck.py84
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/makemanaliases.py64
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/map_html_anchors.py210
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/parse_dependency.py424
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/promote.py173
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/pygenerator.py94
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflib.py664
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/.gitignore5
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/README.adoc22
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-default.adoc44
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-noreflow-novuid.adoc32
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-noreflow.adoc37
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-novuid.adoc39
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-default.adoc35
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-noreflow-novuid.adoc35
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-noreflow.adoc35
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-novuid.adoc35
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-default.adoc24
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-noreflow-novuid.adoc22
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-noreflow.adoc23
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-novuid.adoc23
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-default.adoc43
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-noreflow-novuid.adoc37
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-noreflow.adoc38
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-novuid.adoc42
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-default.adoc87
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-noreflow-novuid.adoc47
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-noreflow.adoc63
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-novuid.adoc71
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-default.adoc95
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-noreflow-novuid.adoc72
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-noreflow.adoc78
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-novuid.adoc89
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-default.adoc33
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-noreflow-novuid.adoc30
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-noreflow.adoc30
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-novuid.adoc33
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-default.adoc53
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-noreflow-novuid.adoc24
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-noreflow.adoc24
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-novuid.adoc53
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-default.adoc123
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-noreflow-novuid.adoc101
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-noreflow.adoc101
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-novuid.adoc123
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-default.adoc58
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-noreflow-novuid.adoc47
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-noreflow.adoc47
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-novuid.adoc58
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-common-validity.adoc32
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-ifdef-in-vu.adoc35
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-math-block-in-vu.adoc22
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-nested-lists-in-vu.adoc37
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-new-vuid-attribute.adoc47
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-new-vuid.adoc72
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-table.adoc30
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-text.adoc24
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-vu.adoc101
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-vuid-repeat.adoc47
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/update-expectations16
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow.py664
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reg.py1779
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/rubygenerator.py120
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/runDocker31
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/schema_generator.py294
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/scriptgenerator.py386
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/__init__.py7
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/algo.py145
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/attributes.py134
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/base_printer.py213
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/consistency_tools.py824
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/console_printer.py274
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/conventions.py454
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/data_structures.py58
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/entity_db.py666
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/file_process.py119
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/html_printer.py436
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/macro_checker.py220
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/macro_checker_file.py1682
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/main.py244
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/shared.py257
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/util.py58
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/validity.py225
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spirvcapgenerator.py238
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/stripAPI.py42
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/syncgenerator.py241
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/testSpecVersion.py75
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_check_spec_links.py643
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_check_spec_links_api_specific.py122
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_entity_db.py32
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_reflow.py384
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/translate_math.js33
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/validitygenerator.py1591
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/vkconventions.py298
-rwxr-xr-xsrc/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/xml_consistency.py810
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/Makefile246
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/README.adoc207
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/generate-core-block.rb125
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/profiles/VP_KHR_roadmap_2022.json381
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/registry.rnc738
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/video.xml1218
-rw-r--r--src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.xml330
-rw-r--r--src/gfxstream/common/etc/etc.cpp1031
-rw-r--r--src/gfxstream/common/etc/etc_unittest.cpp229
-rw-r--r--src/gfxstream/common/etc/include/gfxstream/etc.h130
-rw-r--r--src/gfxstream/common/etc/meson.build14
-rw-r--r--src/gfxstream/common/meson.build4
-rw-r--r--src/gfxstream/common/vulkan/CMakeLists.txt4
-rw-r--r--src/gfxstream/common/vulkan/include/vulkan/vk_enum_string_helper.h8854
-rw-r--r--src/gfxstream/docs/deqp.md54
-rw-r--r--src/gfxstream/guest/BUILD.gn242
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/AddressSpaceStream.cpp620
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/GoldfishAddressSpaceStream.cpp131
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/VirtioGpuAddressSpaceStream.cpp149
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/goldfish_address_space.cpp30
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/include/AddressSpaceStream.h108
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/include/GoldfishAddressSpaceStream.h19
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/include/VirtioGpuAddressSpaceStream.h20
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/include/address_space.h79
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/include/address_space_graphics_types.h362
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space.h139
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space_android.impl538
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space_fuchsia.impl489
-rw-r--r--src/gfxstream/guest/GoldfishAddressSpace/meson.build26
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/ChecksumCalculator.cpp161
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/EncoderDebug.cpp72
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/EncoderDebug.h30
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/ErrorLog.h37
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/GLClientState.cpp3075
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/GLESTextureUtils.cpp657
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/GLESTextureUtils.h92
-rwxr-xr-xsrc/gfxstream/guest/OpenglCodecCommon/GLSharedGroup.cpp939
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/IndexRangeCache.cpp79
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/IndexRangeCache.h99
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/KeyedVectorUtils.h38
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/Makefile13
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/StateTrackingSupport.h254
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/TextureSharedData.h62
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/astc-codec.h47
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/codec_defs.h27
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/glUtils.cpp1209
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/glUtils.h174
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/gl_base_types.h65
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/ChecksumCalculator.h193
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/GLClientState.h1072
-rwxr-xr-xsrc/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/GLSharedGroup.h267
-rw-r--r--src/gfxstream/guest/OpenglCodecCommon/meson.build4
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/ANativeWindow.h56
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/ANativeWindowAndroid.cpp221
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/ANativeWindowAndroid.h57
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/EGLClientIface.h42
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/EGLImage.h43
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/EmulatorFeatureInfo.h222
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/FormatConversions.cpp373
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/FormatConversions.h48
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/Gralloc.h68
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/GrallocGoldfish.cpp84
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/GrallocGoldfish.h48
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/GrallocMinigbm.cpp238
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/GrallocMinigbm.h53
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/HostConnection.cpp375
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/HostConnection.h169
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/HostConnectionGles.cpp377
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/HostConnectionGles.h70
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/ProcessPipe.cpp202
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/ProcessPipe.h46
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/QemuPipeStream.cpp252
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/QemuPipeStream.h59
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/TestingAndroidWsi.cpp346
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/TestingAndroidWsi.h147
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/ThreadInfo.cpp34
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/ThreadInfo.h44
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/TraceProviderFuchsia.cpp63
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/TraceProviderFuchsia.h41
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/VirtioGpuPipeStream.cpp346
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/VirtioGpuPipeStream.h70
-rw-r--r--src/gfxstream/guest/OpenglSystemCommon/meson.build25
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/AlignedBuf.cpp45
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/AlignedBuf.h154
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Allocator.h68
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitor.cpp282
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitor.h281
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumer.h81
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.cpp57
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.h30
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/AndroidSubAllocator.cpp238
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/AndroidSubAllocator.h94
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/BumpPool.h78
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Compiler.h42
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/EnumFlags.h120
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Optional.h547
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Path.cpp29
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Path.h27
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Pool.cpp440
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Pool.h64
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Process.cpp44
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Process.h26
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/StringFormat.cpp84
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/StringFormat.h81
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Tracing.cpp66
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/Tracing.h48
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/TypeTraits.h173
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/address_space.h394
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/containers/EntityManager.h618
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/containers/HybridComponentManager.h132
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/containers/Lookup.h168
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/containers/SmallVector.h406
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/files/MemStream.cpp66
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/files/MemStream.h58
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/files/Stream.cpp267
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/files/Stream.h118
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/files/StreamSerializing.cpp56
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/files/StreamSerializing.h117
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/fit/Defer.h157
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/fit/Function.h513
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/fit/FunctionInternal.h456
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/fit/Nullable.h265
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/fit/README150
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/fit/ThreadChecker.h87
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/fit/ThreadSafety.h81
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/fit/UtilityInternal.h146
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/meson.build29
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/ring_buffer.c610
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/ring_buffer.h230
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidConditionVariable.h232
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidLock.h332
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidMessageChannel.cpp120
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidMessageChannel.h208
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/threads/AndroidFunctorThread.cpp33
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/threads/AndroidFunctorThread.h58
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThread.h148
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadStore.cpp246
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadStore.h154
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadTypes.h39
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThread_pthread.cpp214
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/threads/AndroidWorkPool.cpp467
-rw-r--r--src/gfxstream/guest/android-emu/aemu/base/threads/AndroidWorkPool.h49
-rw-r--r--src/gfxstream/guest/android-emu/android/utils/compiler.h32
-rw-r--r--src/gfxstream/guest/android-emu/android/utils/debug.c165
-rw-r--r--src/gfxstream/guest/android-emu/android/utils/debug.h174
-rw-r--r--src/gfxstream/guest/android-emu/android/utils/log_severity.h42
-rw-r--r--src/gfxstream/guest/fuchsia/fuchsia_stdio.cc89
-rw-r--r--src/gfxstream/guest/fuchsia/include/android/hardware_buffer.h535
-rw-r--r--src/gfxstream/guest/fuchsia/include/android/rect.h65
-rw-r--r--src/gfxstream/guest/fuchsia/include/cros_gralloc_handle.h51
-rw-r--r--src/gfxstream/guest/fuchsia/include/cutils/log.h62
-rw-r--r--src/gfxstream/guest/fuchsia/include/cutils/native_handle.h10
-rw-r--r--src/gfxstream/guest/fuchsia/include/cutils/properties.h12
-rw-r--r--src/gfxstream/guest/fuchsia/include/hardware/gralloc.h8
-rw-r--r--src/gfxstream/guest/fuchsia/include/hardware/hardware.h40
-rw-r--r--src/gfxstream/guest/fuchsia/include/hardware/hwvulkan.h32
-rw-r--r--src/gfxstream/guest/fuchsia/include/log/log.h6
-rw-r--r--src/gfxstream/guest/fuchsia/include/services/service_connector.h29
-rw-r--r--src/gfxstream/guest/fuchsia/include/sync/sync.h10
-rw-r--r--src/gfxstream/guest/fuchsia/include/vndk/hardware_buffer.h6
-rw-r--r--src/gfxstream/guest/fuchsia/meson.build15
-rw-r--r--src/gfxstream/guest/fuchsia/port.cc103
-rw-r--r--src/gfxstream/guest/fuchsia/releasepackage.py153
-rw-r--r--src/gfxstream/guest/fuchsia/service_connector.cc28
-rw-r--r--src/gfxstream/guest/include/MODULE_LICENSE_MIT0
-rw-r--r--src/gfxstream/guest/include/virtgpu_drm.h246
-rw-r--r--src/gfxstream/guest/iostream/include/gfxstream/guest/IOStream.h151
-rw-r--r--src/gfxstream/guest/iostream/meson.build11
-rw-r--r--src/gfxstream/guest/meson.build49
-rw-r--r--src/gfxstream/guest/platform/VirtGpu.cpp51
-rw-r--r--src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpu.h61
-rw-r--r--src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuBlob.cpp56
-rw-r--r--src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuBlobMapping.cpp24
-rw-r--r--src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuDevice.cpp61
-rw-r--r--src/gfxstream/guest/platform/include/Sync.h36
-rw-r--r--src/gfxstream/guest/platform/include/VirtGpu.h196
-rw-r--r--src/gfxstream/guest/platform/include/util.h21
-rw-r--r--src/gfxstream/guest/platform/include/virtgpu_drm.h250
-rw-r--r--src/gfxstream/guest/platform/include/virtgpu_gfxstream_protocol.h128
-rw-r--r--src/gfxstream/guest/platform/linux/LinuxSync.cpp44
-rw-r--r--src/gfxstream/guest/platform/linux/LinuxSync.h32
-rw-r--r--src/gfxstream/guest/platform/linux/LinuxVirtGpu.h78
-rw-r--r--src/gfxstream/guest/platform/linux/LinuxVirtGpuBlob.cpp150
-rw-r--r--src/gfxstream/guest/platform/linux/LinuxVirtGpuBlobMapping.cpp26
-rw-r--r--src/gfxstream/guest/platform/linux/LinuxVirtGpuDevice.cpp274
-rw-r--r--src/gfxstream/guest/platform/linux/meson.build18
-rw-r--r--src/gfxstream/guest/platform/meson.build6
-rw-r--r--src/gfxstream/guest/platform/rutabaga/RutabagaLayer.cpp1035
-rw-r--r--src/gfxstream/guest/platform/rutabaga/RutabagaLayer.h80
-rw-r--r--src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpu.h99
-rw-r--r--src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuBlob.cpp79
-rw-r--r--src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuBlobMapping.cpp31
-rw-r--r--src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuDevice.cpp81
-rw-r--r--src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuSyncHelper.cpp38
-rw-r--r--src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuSyncHelper.h34
-rw-r--r--src/gfxstream/guest/platform/rutabaga/include/gfxstream/RutabagaLayerTestUtils.h23
-rw-r--r--src/gfxstream/guest/platform/stub/StubSync.cpp39
-rw-r--r--src/gfxstream/guest/platform/stub/StubSync.h32
-rw-r--r--src/gfxstream/guest/platform/stub/StubVirtGpu.h81
-rw-r--r--src/gfxstream/guest/platform/stub/StubVirtGpuBlob.cpp46
-rw-r--r--src/gfxstream/guest/platform/stub/StubVirtGpuBlobMapping.cpp31
-rw-r--r--src/gfxstream/guest/platform/stub/StubVirtGpuDevice.cpp60
-rw-r--r--src/gfxstream/guest/platform/stub/meson.build18
-rw-r--r--src/gfxstream/guest/qemupipe/include-types/qemu_pipe_types_bp.h26
-rw-r--r--src/gfxstream/guest/qemupipe/include/qemu_pipe_bp.h45
-rw-r--r--src/gfxstream/guest/qemupipe/meson.build17
-rw-r--r--src/gfxstream/guest/qemupipe/qemu_pipe_common.cpp43
-rw-r--r--src/gfxstream/guest/qemupipe/qemu_pipe_guest.cpp217
-rw-r--r--src/gfxstream/guest/qemupipe/qemu_pipe_stub.cpp43
-rw-r--r--src/gfxstream/guest/vulkan/gfxstream_icd.json7
-rw-r--r--src/gfxstream/guest/vulkan/gfxstream_vk_android.cpp68
-rw-r--r--src/gfxstream/guest/vulkan/gfxstream_vk_cmd.cpp188
-rw-r--r--src/gfxstream/guest/vulkan/gfxstream_vk_device.cpp944
-rw-r--r--src/gfxstream/guest/vulkan/gfxstream_vk_fuchsia.cpp116
-rw-r--r--src/gfxstream/guest/vulkan/gfxstream_vk_wsi.cpp47
-rw-r--r--src/gfxstream/guest/vulkan/meson.build43
-rw-r--r--src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.cpp298
-rw-r--r--src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.h53
-rw-r--r--src/gfxstream/guest/vulkan_enc/CommandBufferStagingStream.cpp249
-rw-r--r--src/gfxstream/guest/vulkan_enc/CommandBufferStagingStream.h119
-rw-r--r--src/gfxstream/guest/vulkan_enc/DescriptorSetVirtualization.cpp521
-rw-r--r--src/gfxstream/guest/vulkan_enc/DescriptorSetVirtualization.h153
-rw-r--r--src/gfxstream/guest/vulkan_enc/HostVisibleMemoryVirtualization.cpp74
-rw-r--r--src/gfxstream/guest/vulkan_enc/HostVisibleMemoryVirtualization.h74
-rw-r--r--src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp7344
-rw-r--r--src/gfxstream/guest/vulkan_enc/ResourceTracker.h904
-rw-r--r--src/gfxstream/guest/vulkan_enc/Resources.cpp278
-rw-r--r--src/gfxstream/guest/vulkan_enc/Resources.h158
-rw-r--r--src/gfxstream/guest/vulkan_enc/Validation.cpp51
-rw-r--r--src/gfxstream/guest/vulkan_enc/Validation.h32
-rw-r--r--src/gfxstream/guest/vulkan_enc/VkEncoder.cpp.inl91
-rw-r--r--src/gfxstream/guest/vulkan_enc/VkEncoder.h.inl10
-rw-r--r--src/gfxstream/guest/vulkan_enc/VulkanHandleMapping.cpp40
-rw-r--r--src/gfxstream/guest/vulkan_enc/VulkanHandleMapping.h53
-rw-r--r--src/gfxstream/guest/vulkan_enc/VulkanHandles.h171
-rw-r--r--src/gfxstream/guest/vulkan_enc/VulkanStreamGuest.cpp160
-rw-r--r--src/gfxstream/guest/vulkan_enc/VulkanStreamGuest.h103
-rw-r--r--src/gfxstream/guest/vulkan_enc/func_table.h222
-rw-r--r--src/gfxstream/guest/vulkan_enc/gfxstream_vk_private.cpp53
-rw-r--r--src/gfxstream/guest/vulkan_enc/gfxstream_vk_private.h246
-rw-r--r--src/gfxstream/guest/vulkan_enc/goldfish_vk_private_defs.h38
-rw-r--r--src/gfxstream/guest/vulkan_enc/meson.build57
-rw-r--r--src/gfxstream/guest/vulkan_enc/vkQueueFlushCommandsGOOGLE_encode_impl.cpp.inl67
-rw-r--r--src/gfxstream/guest/vulkan_enc/vk_android_native_buffer_gfxstream.h251
-rw-r--r--src/gfxstream/guest/vulkan_enc/vk_format_info.h206
-rw-r--r--src/gfxstream/guest/vulkan_enc/vk_platform_compat.h30
-rw-r--r--src/gfxstream/guest/vulkan_enc/vk_struct_id.h125
-rw-r--r--src/gfxstream/guest/vulkan_enc/vk_util.h281
-rw-r--r--src/gfxstream/guest/vulkan_enc/vulkan_gfxstream.h234
-rw-r--r--src/gfxstream/guest/vulkan_enc/vulkan_gfxstream_structure_type.h39
-rw-r--r--src/gfxstream/host/BlobManager.cpp83
-rw-r--r--src/gfxstream/host/BlobManager.h114
-rw-r--r--src/gfxstream/host/BorrowedImage.h30
-rw-r--r--src/gfxstream/host/Buffer.cpp141
-rw-r--r--src/gfxstream/host/Buffer.h78
-rw-r--r--src/gfxstream/host/CMakeLists.txt357
-rw-r--r--src/gfxstream/host/ChannelStream.cpp130
-rw-r--r--src/gfxstream/host/ChannelStream.h51
-rw-r--r--src/gfxstream/host/ColorBuffer.cpp573
-rw-r--r--src/gfxstream/host/ColorBuffer.h154
-rw-r--r--src/gfxstream/host/Compositor.h48
-rw-r--r--src/gfxstream/host/ContextHelper.h70
-rw-r--r--src/gfxstream/host/Display.h33
-rw-r--r--src/gfxstream/host/DisplaySurface.cpp71
-rw-r--r--src/gfxstream/host/DisplaySurface.h68
-rw-r--r--src/gfxstream/host/DisplaySurfaceUser.cpp56
-rw-r--r--src/gfxstream/host/DisplaySurfaceUser.h52
-rw-r--r--src/gfxstream/host/FrameBuffer.cpp3836
-rw-r--r--src/gfxstream/host/FrameBuffer.h926
-rw-r--r--src/gfxstream/host/FrameworkFormats.h25
-rw-r--r--src/gfxstream/host/GfxStreamAgents.cpp479
-rw-r--r--src/gfxstream/host/GfxStreamAgents.h40
-rw-r--r--src/gfxstream/host/GfxStreamBackendInitOverride.cpp17
-rw-r--r--src/gfxstream/host/GlesCompat.h38
-rw-r--r--src/gfxstream/host/Handle.h26
-rw-r--r--src/gfxstream/host/Hwc2.cpp41
-rw-r--r--src/gfxstream/host/Hwc2.h127
-rw-r--r--src/gfxstream/host/NativeSubWindow.h76
-rw-r--r--src/gfxstream/host/NativeSubWindow_android.cpp47
-rw-r--r--src/gfxstream/host/NativeSubWindow_cocoa.m138
-rw-r--r--src/gfxstream/host/NativeSubWindow_qnx.cpp129
-rw-r--r--src/gfxstream/host/NativeSubWindow_stub.cpp32
-rw-r--r--src/gfxstream/host/NativeSubWindow_win32.cpp91
-rw-r--r--src/gfxstream/host/NativeSubWindow_x11.cpp130
-rw-r--r--src/gfxstream/host/PostCommands.h62
-rw-r--r--src/gfxstream/host/PostWorker.cpp208
-rw-r--r--src/gfxstream/host/PostWorker.h103
-rw-r--r--src/gfxstream/host/PostWorkerGl.cpp321
-rw-r--r--src/gfxstream/host/PostWorkerGl.h71
-rw-r--r--src/gfxstream/host/ProcessResources.h42
-rw-r--r--src/gfxstream/host/ReadBuffer.cpp138
-rw-r--r--src/gfxstream/host/ReadBuffer.h47
-rw-r--r--src/gfxstream/host/ReadbackWorker.h79
-rw-r--r--src/gfxstream/host/RenderChannelImpl.cpp234
-rw-r--r--src/gfxstream/host/RenderChannelImpl.h123
-rw-r--r--src/gfxstream/host/RenderControl.cpp1639
-rw-r--r--src/gfxstream/host/RenderControl.h28
-rw-r--r--src/gfxstream/host/RenderLibImpl.cpp149
-rw-r--r--src/gfxstream/host/RenderLibImpl.h73
-rw-r--r--src/gfxstream/host/RenderThread.cpp612
-rw-r--r--src/gfxstream/host/RenderThread.h111
-rw-r--r--src/gfxstream/host/RenderThreadInfo.cpp101
-rw-r--r--src/gfxstream/host/RenderThreadInfo.h88
-rw-r--r--src/gfxstream/host/RenderThreadInfoGl.cpp137
-rw-r--r--src/gfxstream/host/RenderThreadInfoGl.h78
-rw-r--r--src/gfxstream/host/RenderThreadInfoMagma.cpp36
-rw-r--r--src/gfxstream/host/RenderThreadInfoMagma.h34
-rw-r--r--src/gfxstream/host/RenderWindow.cpp698
-rw-r--r--src/gfxstream/host/RenderWindow.h174
-rw-r--r--src/gfxstream/host/RendererImpl.cpp742
-rw-r--r--src/gfxstream/host/RendererImpl.h156
-rw-r--r--src/gfxstream/host/RingStream.cpp367
-rw-r--r--src/gfxstream/host/RingStream.h94
-rw-r--r--src/gfxstream/host/StalePtrRegistry.h146
-rw-r--r--src/gfxstream/host/SyncThread.cpp476
-rw-r--r--src/gfxstream/host/SyncThread.h164
-rw-r--r--src/gfxstream/host/VirtioGpuTimelines.cpp121
-rw-r--r--src/gfxstream/host/VirtioGpuTimelines.h119
-rw-r--r--src/gfxstream/host/VsyncThread.cpp82
-rw-r--r--src/gfxstream/host/VsyncThread.h79
-rw-r--r--src/gfxstream/host/apigen-codec-common/ChecksumCalculator.cpp172
-rw-r--r--src/gfxstream/host/apigen-codec-common/ChecksumCalculator.h200
-rw-r--r--src/gfxstream/host/apigen-codec-common/ChecksumCalculatorThreadInfo.cpp84
-rw-r--r--src/gfxstream/host/apigen-codec-common/ChecksumCalculatorThreadInfo.h60
-rw-r--r--src/gfxstream/host/apigen-codec-common/GL/dri_interface.h1144
-rw-r--r--src/gfxstream/host/apigen-codec-common/GL/gl.h2235
-rw-r--r--src/gfxstream/host/apigen-codec-common/GL/gl_mangle.h2311
-rw-r--r--src/gfxstream/host/apigen-codec-common/GL/glext.h12742
-rw-r--r--src/gfxstream/host/apigen-codec-common/GL/glx.h513
-rw-r--r--src/gfxstream/host/apigen-codec-common/GL/glx_mangle.h82
-rw-r--r--src/gfxstream/host/apigen-codec-common/GL/glxext.h1001
-rw-r--r--src/gfxstream/host/apigen-codec-common/GL/internal/dri_interface.h1144
-rw-r--r--src/gfxstream/host/apigen-codec-common/GLDecoderContextData.h72
-rw-r--r--src/gfxstream/host/apigen-codec-common/Makefile13
-rw-r--r--src/gfxstream/host/apigen-codec-common/ProtocolUtils.h181
-rw-r--r--src/gfxstream/host/apigen-codec-common/glUtils.cpp467
-rw-r--r--src/gfxstream/host/apigen-codec-common/glUtils.h41
-rw-r--r--src/gfxstream/host/apigen-codec-common/gl_base_types.h65
-rw-r--r--src/gfxstream/host/apigen-codec-common/meson.build18
-rw-r--r--src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressor.h57
-rw-r--r--src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressorImpl.cpp282
-rw-r--r--src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressorNoOp.cpp44
-rw-r--r--src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressor_unittest.cpp78
-rw-r--r--src/gfxstream/host/compressedTextureFormats/meson.build14
-rw-r--r--src/gfxstream/host/drm_fourcc.h411
-rw-r--r--src/gfxstream/host/gfxstream_unittest.cpp207
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/EmuglBackendList.h72
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/GLProcessPipe.h29
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/GpuFrameBridge.h77
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/NativeGpuInfo.h21
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/OpenglEsPipe.h22
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/emugl_config.h155
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/gpuinfo.h135
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/logger.h45
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/macTouchOpenGL.h23
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/misc.h60
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengles-pipe.h34
-rw-r--r--src/gfxstream/host/gl/gl-host-common/include/host-common/opengles.h170
-rw-r--r--src/gfxstream/host/gl/gl-host-common/meson.build52
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/EmuglBackendList.cpp91
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/EmuglBackendList_unittest.cpp135
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/GLProcessPipe.cpp188
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/GpuFrameBridge.cpp242
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/GpuFrameBridge_unittest.cpp50
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_darwin.cpp120
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_linux.cpp118
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_qnx.cpp25
-rwxr-xr-xsrc/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_windows.cpp416
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/OpenglEsPipe.cpp596
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/emugl_config.cpp473
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/emugl_config_unittest.cpp549
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/gpuinfo.cpp425
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/gpuinfo_unittest.cpp592
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/logger.cpp254
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/macTouchOpenGL.m37
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengl/misc.cpp84
-rw-r--r--src/gfxstream/host/gl/gl-host-common/opengles.cpp531
-rw-r--r--src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer-goldfish.h36
-rw-r--r--src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer-unstable.h109
-rw-r--r--src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer.h258
-rw-r--r--src/gfxstream/host/meson.build285
-rw-r--r--src/gfxstream/host/render_api.cpp29
-rw-r--r--src/gfxstream/host/virgl_hw.h370
-rw-r--r--src/gfxstream/host/virtgpu_gfxstream_protocol.h132
-rw-r--r--src/gfxstream/host/virtio-gpu-gfxstream-renderer-goldfish.cpp48
-rw-r--r--src/gfxstream/host/virtio-gpu-gfxstream-renderer.cpp2509
-rw-r--r--src/gfxstream/host/vulkan/BorrowedImageVk.cpp119
-rw-r--r--src/gfxstream/host/vulkan/BorrowedImageVk.h66
-rw-r--r--src/gfxstream/host/vulkan/BufferVk.cpp49
-rw-r--r--src/gfxstream/host/vulkan/BufferVk.h38
-rw-r--r--src/gfxstream/host/vulkan/CMakeLists.txt64
-rw-r--r--src/gfxstream/host/vulkan/ColorBufferVk.cpp71
-rw-r--r--src/gfxstream/host/vulkan/ColorBufferVk.h48
-rw-r--r--src/gfxstream/host/vulkan/Compositor.frag25
-rw-r--r--src/gfxstream/host/vulkan/Compositor.vert20
-rw-r--r--src/gfxstream/host/vulkan/CompositorFragmentShader.h136
-rw-r--r--src/gfxstream/host/vulkan/CompositorVertexShader.h142
-rw-r--r--src/gfxstream/host/vulkan/CompositorVk.cpp1349
-rw-r--r--src/gfxstream/host/vulkan/CompositorVk.h250
-rw-r--r--src/gfxstream/host/vulkan/DebugUtilsHelper.cpp96
-rw-r--r--src/gfxstream/host/vulkan/DebugUtilsHelper.h78
-rw-r--r--src/gfxstream/host/vulkan/DisplaySurfaceVk.cpp63
-rw-r--r--src/gfxstream/host/vulkan/DisplaySurfaceVk.h45
-rw-r--r--src/gfxstream/host/vulkan/DisplayVk.cpp765
-rw-r--r--src/gfxstream/host/vulkan/DisplayVk.h121
-rw-r--r--src/gfxstream/host/vulkan/GrallocDefs.h279
-rw-r--r--src/gfxstream/host/vulkan/PostWorkerVk.cpp71
-rw-r--r--src/gfxstream/host/vulkan/PostWorkerVk.h52
-rw-r--r--src/gfxstream/host/vulkan/RenderThreadInfoVk.cpp37
-rw-r--r--src/gfxstream/host/vulkan/RenderThreadInfoVk.h42
-rw-r--r--src/gfxstream/host/vulkan/SwapChainStateVk.cpp309
-rw-r--r--src/gfxstream/host/vulkan/SwapChainStateVk.h78
-rw-r--r--src/gfxstream/host/vulkan/VkAndroidNativeBuffer.cpp829
-rw-r--r--src/gfxstream/host/vulkan/VkAndroidNativeBuffer.h172
-rw-r--r--src/gfxstream/host/vulkan/VkCommonOperations.cpp3554
-rw-r--r--src/gfxstream/host/vulkan/VkCommonOperations.h523
-rw-r--r--src/gfxstream/host/vulkan/VkDecoderContext.h35
-rw-r--r--src/gfxstream/host/vulkan/VkDecoderGlobalState.cpp8196
-rw-r--r--src/gfxstream/host/vulkan/VkDecoderGlobalState.h995
-rw-r--r--src/gfxstream/host/vulkan/VkDecoderGlobalState_unittest.cpp148
-rw-r--r--src/gfxstream/host/vulkan/VkFormatUtils.cpp201
-rw-r--r--src/gfxstream/host/vulkan/VkFormatUtils.h377
-rw-r--r--src/gfxstream/host/vulkan/VkFormatUtils_unittest.cpp264
-rw-r--r--src/gfxstream/host/vulkan/VkQsriTimeline.h69
-rw-r--r--src/gfxstream/host/vulkan/VkQsriTimeline_unittest.cpp44
-rw-r--r--src/gfxstream/host/vulkan/VkReconstruction.cpp483
-rw-r--r--src/gfxstream/host/vulkan/VkReconstruction.h101
-rw-r--r--src/gfxstream/host/vulkan/VulkanDispatch.cpp376
-rw-r--r--src/gfxstream/host/vulkan/VulkanDispatch.h25
-rw-r--r--src/gfxstream/host/vulkan/VulkanHandleMapping.cpp40
-rw-r--r--src/gfxstream/host/vulkan/VulkanHandleMapping.h79
-rw-r--r--src/gfxstream/host/vulkan/VulkanHandles.h110
-rw-r--r--src/gfxstream/host/vulkan/VulkanStream.cpp224
-rw-r--r--src/gfxstream/host/vulkan/VulkanStream.h116
-rw-r--r--src/gfxstream/host/vulkan/cereal/CMakeLists.txt28
-rw-r--r--src/gfxstream/host/vulkan/cereal/common/meson.build64
-rw-r--r--src/gfxstream/host/vulkan/cereal/goldfish_vk_private_defs.h51
-rw-r--r--src/gfxstream/host/vulkan/cereal/meson.build4
-rw-r--r--src/gfxstream/host/vulkan/cereal/vk_struct_id.h74
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/AstcTexture.cpp291
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/AstcTexture.h74
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/CMakeLists.txt20
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/CompressedImageInfo.cpp814
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/CompressedImageInfo.h189
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/GpuDecompressionPipeline.cpp336
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/GpuDecompressionPipeline.h130
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/README.md6
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/meson.build23
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/Astc.comp902
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/AstcDecompressor.glsl643
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/AstcLookupTables.glsl128
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/AstcNew.comp643
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/AstcToBc3.comp260
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/AstcToRgb.comp29
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/AstcUnquantMap.comp94
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/Common.comp46
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/DecompressionShaders.h108
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/EacR11Snorm.comp43
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/EacR11Unorm.comp43
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/EacRG11Snorm.comp45
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/EacRG11Unorm.comp46
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2RGB8.comp47
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2RGBA8.comp46
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2ShaderLib.comp367
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/build_shaders.py72
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_1D.inl3574
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_2D.inl3571
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_3D.inl3571
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_1D.inl4249
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_2D.inl4246
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_3D.inl4246
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_1D.inl3597
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_2D.inl3594
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_3D.inl3594
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_1D.inl5037
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_2D.inl5038
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_3D.inl5037
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_1D.inl640
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_2D.inl638
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_3D.inl637
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_1D.inl640
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_2D.inl638
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_3D.inl637
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_1D.inl673
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_2D.inl671
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_3D.inl671
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_1D.inl673
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_2D.inl671
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_3D.inl671
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_1D.inl1882
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_2D.inl1878
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_3D.inl1878
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_1D.inl2073
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_2D.inl2070
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_3D.inl2070
-rw-r--r--src/gfxstream/host/vulkan/emulated_textures/testing/ComputePipelineRestoration_integrationtest.cpp215
-rw-r--r--src/gfxstream/host/vulkan/meson.build60
-rw-r--r--src/gfxstream/host/vulkan/testing/VkDecoderTestDispatch.h295
-rw-r--r--src/gfxstream/host/vulkan/testing/VulkanTestHelper.cpp347
-rw-r--r--src/gfxstream/host/vulkan/testing/VulkanTestHelper.h122
-rw-r--r--src/gfxstream/host/vulkan/vk_android_native_buffer_gfxstream.h251
-rw-r--r--src/gfxstream/host/vulkan/vk_android_native_buffer_structure_type.h41
-rw-r--r--src/gfxstream/host/vulkan/vk_fn_info.h51
-rw-r--r--src/gfxstream/host/vulkan/vk_format_info.h144
-rw-r--r--src/gfxstream/host/vulkan/vk_util.cpp51
-rw-r--r--src/gfxstream/host/vulkan/vk_util.h517
-rw-r--r--src/gfxstream/host/vulkan/vk_util_unittest.cpp267
-rw-r--r--src/gfxstream/host/vulkan/vulkan_gfxstream.h234
-rw-r--r--src/gfxstream/host/vulkan/vulkan_gfxstream_structure_type.h39
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/DispatchTables.h28
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/EGLDispatch.h70
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/GLESv1Dispatch.h60
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/GLESv2Dispatch.h74
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/OpenGLDispatchLoader.h64
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/RenderEGL_extensions_functions.h38
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/RenderEGL_extensions_static_translator_namespaced_header.h31
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/RenderEGL_functions.h35
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/RenderEGL_snapshot_functions.h34
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/RenderEGL_snapshot_static_translator_namespaced_header.h21
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/RenderEGL_static_translator_namespaced_header.h34
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/StaticDispatch.h27
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gldefs.h45
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles12tr.h17
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles12tr_internal.h331
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles1_extensions_functions.h64
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles1_extensions_static_translator_namespaced_header.h63
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles1_only_functions.h113
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles1_only_static_translator_namespaced_header.h112
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles2_extensions_functions.h29
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles2_extensions_static_translator_namespaced_header.h28
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles2_only_functions.h88
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles2_only_static_translator_namespaced_header.h87
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles31_only_functions.h79
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles31_only_static_translator_namespaced_header.h78
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles32_only_functions.h19
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles32_only_static_translator_namespaced_header.h18
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles3_extensions_functions.h24
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles3_extensions_static_translator_namespaced_header.h23
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles3_only_functions.h115
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles3_only_static_translator_namespaced_header.h114
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles_common_for_gles1_static_translator_namespaced_header.h83
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles_common_for_gles2_static_translator_namespaced_header.h83
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles_common_functions.h84
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles_extensions_for_gles1_static_translator_namespaced_header.h59
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles_extensions_for_gles2_static_translator_namespaced_header.h59
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles_extensions_functions.h60
-rw-r--r--src/gfxstream/include/OpenGLESDispatch/gles_functions.h62
-rw-r--r--src/gfxstream/include/render-utils/IOStream.h116
-rw-r--r--src/gfxstream/include/render-utils/MediaNative.h40
-rw-r--r--src/gfxstream/include/render-utils/RenderChannel.h126
-rw-r--r--src/gfxstream/include/render-utils/RenderLib.h116
-rw-r--r--src/gfxstream/include/render-utils/Renderer.h328
-rw-r--r--src/gfxstream/include/render-utils/render_api.h50
-rw-r--r--src/gfxstream/include/render-utils/render_api_functions.h11
-rw-r--r--src/gfxstream/include/render-utils/render_api_platform_types.h46
-rw-r--r--src/gfxstream/include/render-utils/render_api_types.h31
-rw-r--r--src/gfxstream/include/render-utils/virtio_gpu_ops.h183
-rw-r--r--src/gfxstream/meson.build36
-rw-r--r--src/gfxstream/meson_options.txt736
-rw-r--r--src/gfxstream/qnx/Makefile8
-rw-r--r--src/gfxstream/qnx/README.md30
-rw-r--r--src/gfxstream/qnx/common.mk48
-rw-r--r--src/gfxstream/qnx/host/platform_qnx.cpp26
-rw-r--r--src/gfxstream/qnx/nto/Makefile8
-rw-r--r--src/gfxstream/qnx/nto/aarch64-le/Makefile3
-rw-r--r--src/gfxstream/qnx/nto/aarch64-le/meson.cross.ini17
-rwxr-xr-xsrc/gfxstream/qnx/nto/build-aemu.sh20
-rwxr-xr-xsrc/gfxstream/qnx/nto/build-gfxstream.sh22
-rw-r--r--src/gfxstream/qnx/nto/qnx.nto.toolchain.cmake42
-rw-r--r--src/gfxstream/qnx/pinfo.mk17
-rw-r--r--src/gfxstream/qnx/pkgconfig/screen.pc9
-rwxr-xr-xsrc/gfxstream/scripts/build-nested-vulkan-loader.sh75
-rwxr-xr-xsrc/gfxstream/scripts/gen-entries.py663
-rwxr-xr-xsrc/gfxstream/scripts/generate-apigen-sources.sh26
-rw-r--r--src/gfxstream/scripts/generate-compositor-shader-headers.sh2
-rwxr-xr-xsrc/gfxstream/scripts/generate-dispatch-headers.sh94
-rwxr-xr-xsrc/gfxstream/scripts/generate-gfxstream-vulkan.sh45
-rw-r--r--src/gfxstream/scripts/gles3translatorgen/__init__.py17
-rw-r--r--src/gfxstream/scripts/gles3translatorgen/gles30_custom.py211
-rw-r--r--src/gfxstream/scripts/gles3translatorgen/gles31_custom.py38
-rwxr-xr-xsrc/gfxstream/scripts/glsl-shader-to-spv-c-array.py72
-rw-r--r--src/gfxstream/scripts/print_gfx_logs/__init__.py14
-rw-r--r--src/gfxstream/scripts/print_gfx_logs/command_printer.py243
-rw-r--r--src/gfxstream/scripts/print_gfx_logs/command_printer_test.py799
-rw-r--r--src/gfxstream/scripts/print_gfx_logs/opcodes.py1301
-rw-r--r--src/gfxstream/scripts/print_gfx_logs/print_gfx_logs.py245
-rw-r--r--src/gfxstream/scripts/print_gfx_logs/print_gfx_logs_test.py137
-rw-r--r--src/gfxstream/scripts/print_gfx_logs/vulkan_printer.py2709
-rw-r--r--src/gfxstream/third-party/.clang-format2
-rw-r--r--src/gfxstream/third-party/renderdoc/LICENSE21
-rw-r--r--src/gfxstream/third-party/renderdoc/include/renderdoc_app.h694
-rw-r--r--src/gfxstream/utils/GfxApiLogger.cpp17
-rw-r--r--src/gfxstream/utils/GfxApiLogger_unittest.cpp15
-rw-r--r--src/gfxstream/utils/RenderDoc_unittest.cpp178
-rw-r--r--src/gfxstream/utils/include/utils/GfxApiLogger.h29
-rw-r--r--src/gfxstream/utils/include/utils/RenderDoc.h125
768 files changed, 267305 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
index 56a04fb191a..807e9149b74 100644
--- a/LICENSE
+++ b/LICENSE
@@ -23,3 +23,861 @@ SOFTWARE.
The above is the version of the MIT "Expat" License used by Mesa:
https://www.mesa3d.org/license.html
+
+---
+
+Full license text of these licenses is available at:
+
+ * Apache-2.0: https://opensource.org/licenses/Apache-2.0
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ * MIT: https://opensource.org/licenses/MIT
+
+MIT License
+
+Copyright (c) 2020-2021 The Khronos Group 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 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.
+
+ * CC-BY-4.0: https://creativecommons.org/licenses/by/4.0/legalcode
+
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+ Considerations for licensors: Our public licenses are
+ intended for use by those authorized to give the public
+ permission to use material in ways otherwise restricted by
+ copyright and certain other rights. Our licenses are
+ irrevocable. Licensors should read and understand the terms
+ and conditions of the license they choose before applying it.
+ Licensors should also secure all rights necessary before
+ applying our licenses so that the public can reuse the
+ material as expected. Licensors should clearly mark any
+ material not subject to the license. This includes other CC-
+ licensed material, or material used under an exception or
+ limitation to copyright. More considerations for licensors:
+ wiki.creativecommons.org/Considerations_for_licensors
+
+ Considerations for the public: By using one of our public
+ licenses, a licensor grants the public permission to use the
+ licensed material under specified terms and conditions. If
+ the licensor's permission is not necessary for any reason--for
+ example, because of any applicable exception or limitation to
+ copyright--then that use is not regulated by the license. Our
+ licenses grant only permissions under copyright and certain
+ other rights that a licensor has authority to grant. Use of
+ the licensed material may still be restricted for other
+ reasons, including because others have copyright or other
+ rights in the material. A licensor may make special requests,
+ such as asking that all changes be marked or described.
+ Although not required by our licenses, you are encouraged to
+ respect those requests where reasonable. More considerations
+ for the public:
+ wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+ a. Adapted Material means material subject to Copyright and Similar
+ Rights that is derived from or based upon the Licensed Material
+ and in which the Licensed Material is translated, altered,
+ arranged, transformed, or otherwise modified in a manner requiring
+ permission under the Copyright and Similar Rights held by the
+ Licensor. For purposes of this Public License, where the Licensed
+ Material is a musical work, performance, or sound recording,
+ Adapted Material is always produced where the Licensed Material is
+ synched in timed relation with a moving image.
+
+ b. Adapter's License means the license You apply to Your Copyright
+ and Similar Rights in Your contributions to Adapted Material in
+ accordance with the terms and conditions of this Public License.
+
+ c. Copyright and Similar Rights means copyright and/or similar rights
+ closely related to copyright including, without limitation,
+ performance, broadcast, sound recording, and Sui Generis Database
+ Rights, without regard to how the rights are labeled or
+ categorized. For purposes of this Public License, the rights
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
+ Rights.
+
+ d. Effective Technological Measures means those measures that, in the
+ absence of proper authority, may not be circumvented under laws
+ fulfilling obligations under Article 11 of the WIPO Copyright
+ Treaty adopted on December 20, 1996, and/or similar international
+ agreements.
+
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
+ any other exception or limitation to Copyright and Similar Rights
+ that applies to Your use of the Licensed Material.
+
+ f. Licensed Material means the artistic or literary work, database,
+ or other material to which the Licensor applied this Public
+ License.
+
+ g. Licensed Rights means the rights granted to You subject to the
+ terms and conditions of this Public License, which are limited to
+ all Copyright and Similar Rights that apply to Your use of the
+ Licensed Material and that the Licensor has authority to license.
+
+ h. Licensor means the individual(s) or entity(ies) granting rights
+ under this Public License.
+
+ i. Share means to provide material to the public by any means or
+ process that requires permission under the Licensed Rights, such
+ as reproduction, public display, public performance, distribution,
+ dissemination, communication, or importation, and to make material
+ available to the public including in ways that members of the
+ public may access the material from a place and at a time
+ individually chosen by them.
+
+ j. Sui Generis Database Rights means rights other than copyright
+ resulting from Directive 96/9/EC of the European Parliament and of
+ the Council of 11 March 1996 on the legal protection of databases,
+ as amended and/or succeeded, as well as other essentially
+ equivalent rights anywhere in the world.
+
+ k. You means the individual or entity exercising the Licensed Rights
+ under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+ a. License grant.
+
+ 1. Subject to the terms and conditions of this Public License,
+ the Licensor hereby grants You a worldwide, royalty-free,
+ non-sublicensable, non-exclusive, irrevocable license to
+ exercise the Licensed Rights in the Licensed Material to:
+
+ a. reproduce and Share the Licensed Material, in whole or
+ in part; and
+
+ b. produce, reproduce, and Share Adapted Material.
+
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
+ Exceptions and Limitations apply to Your use, this Public
+ License does not apply, and You do not need to comply with
+ its terms and conditions.
+
+ 3. Term. The term of this Public License is specified in Section
+ 6(a).
+
+ 4. Media and formats; technical modifications allowed. The
+ Licensor authorizes You to exercise the Licensed Rights in
+ all media and formats whether now known or hereafter created,
+ and to make technical modifications necessary to do so. The
+ Licensor waives and/or agrees not to assert any right or
+ authority to forbid You from making technical modifications
+ necessary to exercise the Licensed Rights, including
+ technical modifications necessary to circumvent Effective
+ Technological Measures. For purposes of this Public License,
+ simply making modifications authorized by this Section 2(a)
+ (4) never produces Adapted Material.
+
+ 5. Downstream recipients.
+
+ a. Offer from the Licensor -- Licensed Material. Every
+ recipient of the Licensed Material automatically
+ receives an offer from the Licensor to exercise the
+ Licensed Rights under the terms and conditions of this
+ Public License.
+
+ b. No downstream restrictions. You may not offer or impose
+ any additional or different terms or conditions on, or
+ apply any Effective Technological Measures to, the
+ Licensed Material if doing so restricts exercise of the
+ Licensed Rights by any recipient of the Licensed
+ Material.
+
+ 6. No endorsement. Nothing in this Public License constitutes or
+ may be construed as permission to assert or imply that You
+ are, or that Your use of the Licensed Material is, connected
+ with, or sponsored, endorsed, or granted official status by,
+ the Licensor or others designated to receive attribution as
+ provided in Section 3(a)(1)(A)(i).
+
+ b. Other rights.
+
+ 1. Moral rights, such as the right of integrity, are not
+ licensed under this Public License, nor are publicity,
+ privacy, and/or other similar personality rights; however, to
+ the extent possible, the Licensor waives and/or agrees not to
+ assert any such rights held by the Licensor to the limited
+ extent necessary to allow You to exercise the Licensed
+ Rights, but not otherwise.
+
+ 2. Patent and trademark rights are not licensed under this
+ Public License.
+
+ 3. To the extent possible, the Licensor waives any right to
+ collect royalties from You for the exercise of the Licensed
+ Rights, whether directly or through a collecting society
+ under any voluntary or waivable statutory or compulsory
+ licensing scheme. In all other cases the Licensor expressly
+ reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+ a. Attribution.
+
+ 1. If You Share the Licensed Material (including in modified
+ form), You must:
+
+ a. retain the following if it is supplied by the Licensor
+ with the Licensed Material:
+
+ i. identification of the creator(s) of the Licensed
+ Material and any others designated to receive
+ attribution, in any reasonable manner requested by
+ the Licensor (including by pseudonym if
+ designated);
+
+ ii. a copyright notice;
+
+ iii. a notice that refers to this Public License;
+
+ iv. a notice that refers to the disclaimer of
+ warranties;
+
+ v. a URI or hyperlink to the Licensed Material to the
+ extent reasonably practicable;
+
+ b. indicate if You modified the Licensed Material and
+ retain an indication of any previous modifications; and
+
+ c. indicate the Licensed Material is licensed under this
+ Public License, and include the text of, or the URI or
+ hyperlink to, this Public License.
+
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
+ reasonable manner based on the medium, means, and context in
+ which You Share the Licensed Material. For example, it may be
+ reasonable to satisfy the conditions by providing a URI or
+ hyperlink to a resource that includes the required
+ information.
+
+ 3. If requested by the Licensor, You must remove any of the
+ information required by Section 3(a)(1)(A) to the extent
+ reasonably practicable.
+
+ 4. If You Share Adapted Material You produce, the Adapter's
+ License You apply must not prevent recipients of the Adapted
+ Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+ to extract, reuse, reproduce, and Share all or a substantial
+ portion of the contents of the database;
+
+ b. if You include all or a substantial portion of the database
+ contents in a database in which You have Sui Generis Database
+ Rights, then the database in which You have Sui Generis Database
+ Rights (but not its individual contents) is Adapted Material; and
+
+ c. You must comply with the conditions in Section 3(a) if You Share
+ all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+ c. The disclaimer of warranties and limitation of liability provided
+ above shall be interpreted in a manner that, to the extent
+ possible, most closely approximates an absolute disclaimer and
+ waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+ a. This Public License applies for the term of the Copyright and
+ Similar Rights licensed here. However, if You fail to comply with
+ this Public License, then Your rights under this Public License
+ terminate automatically.
+
+ b. Where Your right to use the Licensed Material has terminated under
+ Section 6(a), it reinstates:
+
+ 1. automatically as of the date the violation is cured, provided
+ it is cured within 30 days of Your discovery of the
+ violation; or
+
+ 2. upon express reinstatement by the Licensor.
+
+ For the avoidance of doubt, this Section 6(b) does not affect any
+ right the Licensor may have to seek remedies for Your violations
+ of this Public License.
+
+ c. For the avoidance of doubt, the Licensor may also offer the
+ Licensed Material under separate terms or conditions or stop
+ distributing the Licensed Material at any time; however, doing so
+ will not terminate this Public License.
+
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+ License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+ a. The Licensor shall not be bound by any additional or different
+ terms or conditions communicated by You unless expressly agreed.
+
+ b. Any arrangements, understandings, or agreements regarding the
+ Licensed Material not stated herein are separate from and
+ independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+ a. For the avoidance of doubt, this Public License does not, and
+ shall not be interpreted to, reduce, limit, restrict, or impose
+ conditions on any use of the Licensed Material that could lawfully
+ be made without permission under this Public License.
+
+ b. To the extent possible, if any provision of this Public License is
+ deemed unenforceable, it shall be automatically reformed to the
+ minimum extent necessary to make it enforceable. If the provision
+ cannot be reformed, it shall be severed from this Public License
+ without affecting the enforceability of the remaining terms and
+ conditions.
+
+ c. No term or condition of this Public License will be waived and no
+ failure to comply consented to unless expressly agreed to by the
+ Licensor.
+
+ d. Nothing in this Public License constitutes or may be interpreted
+ as a limitation upon, or waiver of, any privileges and immunities
+ that apply to the Licensor or You, including from the legal
+ processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public
+licenses. Notwithstanding, Creative Commons may elect to apply one of
+its public licenses to material it publishes and in those instances
+will be considered the “Licensor.” The text of the Creative Commons
+public licenses is dedicated to the public domain under the CC0 Public
+Domain Dedication. Except for the limited purpose of indicating that
+material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the
+public licenses.
+
+Creative Commons may be contacted at creativecommons.org.
+
+
+ * LicenseRef-MPLUS: https://osdn.net/softwaremap/trove_list.php?form_cat=370
+
+M+ Font License
+
+These fonts are free softwares.
+Unlimited permission is granted to use, copy, and distribute it,
+with or without modification, either commercially and noncommercially.
+THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY.
+
+*********************************************************************************
+
+Copyright (c) 2014-2016 OpenDevise Inc. and the Asciidoctor Project
+
+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 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.
+
+*********************************************************************************
+
+Copyright (c) 1998-2006 MACS, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2007 SiSco, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2014-2015 Red Hat 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2011, 2016-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 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.
+
+*********************************************************************************
+
+Copyright (c) 2019 The Android Open Source Project
+
+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 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.
+
+*********************************************************************************
+
+Copyright (c) 2016, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 1999-2006 Brian Paul
+
+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 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.
+
+*********************************************************************************
+
+Copyright (c) 2009 VMware, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2007-2018 The Khronos Group 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 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.
+
+*********************************************************************************
+
+Copyright (c) 1998-1999 Precision Insight 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2007-2008 Red Hat, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2015-2016 Valve 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2015-2016 LunarG, 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 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.
+
+*********************************************************************************
+
+Copyright 2008 The Android Open Source Project
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*********************************************************************************
+
+Copyright (c) 2000 The NetBSD Foundation, Inc.
+
+This code is derived from software contributed to The NetBSD Foundation by Dieter Baron and Thomas Klausner
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*********************************************************************************
+
+Copyright 2002 Todd C. Miller <Todd.Miller@courtesan.com>
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+*********************************************************************************
+
+Copyright 2013-2014 Red Hat, Inc.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*********************************************************************************
+
+// Copyright 2020-2021 The Khronos Group Inc.
+// SPDX-License-Identifier: CC-BY-4.0
+
+= LICENSE file for the KhronosGroup/Vulkan-Docs project
+
+Files in codegen/vulkan subdirectory fall under one of these licenses:
+
+ * SPDX license identifier: "`Apache-2.0 OR MIT`"
+ ** Apache License 2.0 OR MIT License
+ ** For scripts and XML which need to be usable in GPL-licensed projects.
+
+ * SPDX license identifier: "`Apache-2.0`"
+ ** Apache License 2.0
+ ** For other scripts
+
+ * SPDX license identifier: "`CC-BY-4.0`"
+ ** Creative Commons Attribution 4.0 International
+ ** For specification source documents
+
+ * SPDX license identifier: "`MIT`"
+ ** MIT License
+ ** For files copied from other MIT-licensed projects
+
+ * SPDX license identifier: "`LicenseRef-MPLUS`"
+ ** M+ Font License
+ ** For fonts derived from the M+ Font Project
+ ** This license is open source, but not OSI approved
diff --git a/src/gfxstream/.clang-format b/src/gfxstream/.clang-format
new file mode 100644
index 00000000000..7aba9d5c898
--- /dev/null
+++ b/src/gfxstream/.clang-format
@@ -0,0 +1,15 @@
+# There is a copy of this file at http://google3/play/games/battlestar/build/gfxstream/.clang-format
+# for the AyeAye presubmit check. If you change this file, please also change the location above.
+
+BasedOnStyle: Google
+IndentWidth: 4
+ColumnLimit: 100
+IncludeCategories:
+ - Regex: '^(<(gtest|gmock))'
+ Priority: -1
+FixNamespaceComments: true
+PointerAlignment: Left
+DerivePointerAlignment: false
+
+# Ensure proper formatting of macros such as GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES
+StatementMacros: ["f"]
diff --git a/src/gfxstream/.gitignore b/src/gfxstream/.gitignore
new file mode 100644
index 00000000000..e31099ec126
--- /dev/null
+++ b/src/gfxstream/.gitignore
@@ -0,0 +1,295 @@
+/build*/
+/.vscode/*
+/objs/*
+/config-devices.*
+/config-all-devices.*
+/config-all-disas.*
+/config-host.*
+/config-target.*
+/config.status
+/config-temp
+/trace-events-all
+/trace/generated-events.h
+/trace/generated-events.c
+/trace/generated-helpers-wrappers.h
+/trace/generated-helpers.h
+/trace/generated-helpers.c
+/trace/generated-tcg-tracers.h
+/ui/shader/texture-blit-frag.h
+/ui/shader/texture-blit-vert.h
+/ui/shader/texture-blit-flip-vert.h
+/ui/input-keymap-*.c
+*-timestamp
+/*-softmmu
+/*-darwin-user
+/*-linux-user
+/*-bsd-user
+/ivshmem-client
+/ivshmem-server
+/libdis*
+/libuser
+/linux-headers/asm
+/qga/qapi-generated
+/qapi-gen-timestamp
+/qapi/qapi-builtin-types.[ch]
+/qapi/qapi-builtin-visit.[ch]
+/qapi/qapi-commands-block-core.[ch]
+/qapi/qapi-commands-block.[ch]
+/qapi/qapi-commands-char.[ch]
+/qapi/qapi-commands-common.[ch]
+/qapi/qapi-commands-crypto.[ch]
+/qapi/qapi-commands-introspect.[ch]
+/qapi/qapi-commands-migration.[ch]
+/qapi/qapi-commands-misc.[ch]
+/qapi/qapi-commands-net.[ch]
+/qapi/qapi-commands-rocker.[ch]
+/qapi/qapi-commands-run-state.[ch]
+/qapi/qapi-commands-sockets.[ch]
+/qapi/qapi-commands-tpm.[ch]
+/qapi/qapi-commands-trace.[ch]
+/qapi/qapi-commands-transaction.[ch]
+/qapi/qapi-commands-ui.[ch]
+/qapi/qapi-commands.[ch]
+/qapi/qapi-events-block-core.[ch]
+/qapi/qapi-events-block.[ch]
+/qapi/qapi-events-char.[ch]
+/qapi/qapi-events-common.[ch]
+/qapi/qapi-events-crypto.[ch]
+/qapi/qapi-events-introspect.[ch]
+/qapi/qapi-events-migration.[ch]
+/qapi/qapi-events-misc.[ch]
+/qapi/qapi-events-net.[ch]
+/qapi/qapi-events-rocker.[ch]
+/qapi/qapi-events-run-state.[ch]
+/qapi/qapi-events-sockets.[ch]
+/qapi/qapi-events-tpm.[ch]
+/qapi/qapi-events-trace.[ch]
+/qapi/qapi-events-transaction.[ch]
+/qapi/qapi-events-ui.[ch]
+/qapi/qapi-events.[ch]
+/qapi/qapi-introspect.[ch]
+/qapi/qapi-types-block-core.[ch]
+/qapi/qapi-types-block.[ch]
+/qapi/qapi-types-char.[ch]
+/qapi/qapi-types-common.[ch]
+/qapi/qapi-types-crypto.[ch]
+/qapi/qapi-types-introspect.[ch]
+/qapi/qapi-types-migration.[ch]
+/qapi/qapi-types-misc.[ch]
+/qapi/qapi-types-net.[ch]
+/qapi/qapi-types-rocker.[ch]
+/qapi/qapi-types-run-state.[ch]
+/qapi/qapi-types-sockets.[ch]
+/qapi/qapi-types-tpm.[ch]
+/qapi/qapi-types-trace.[ch]
+/qapi/qapi-types-transaction.[ch]
+/qapi/qapi-types-ui.[ch]
+/qapi/qapi-types.[ch]
+/qapi/qapi-visit-block-core.[ch]
+/qapi/qapi-visit-block.[ch]
+/qapi/qapi-visit-char.[ch]
+/qapi/qapi-visit-common.[ch]
+/qapi/qapi-visit-crypto.[ch]
+/qapi/qapi-visit-introspect.[ch]
+/qapi/qapi-visit-migration.[ch]
+/qapi/qapi-visit-misc.[ch]
+/qapi/qapi-visit-net.[ch]
+/qapi/qapi-visit-rocker.[ch]
+/qapi/qapi-visit-run-state.[ch]
+/qapi/qapi-visit-sockets.[ch]
+/qapi/qapi-visit-tpm.[ch]
+/qapi/qapi-visit-trace.[ch]
+/qapi/qapi-visit-transaction.[ch]
+/qapi/qapi-visit-ui.[ch]
+/qapi/qapi-visit.[ch]
+/qapi/qapi-doc.texi
+/qemu-doc.html
+/qemu-doc.info
+/qemu-doc.txt
+/qemu-img
+/qemu-nbd
+/qemu-options.def
+/qemu-options.texi
+/qemu-img-cmds.texi
+/qemu-img-cmds.h
+/qemu-io
+/qemu-ga
+/qemu-bridge-helper
+/qemu-keymap
+/qemu-monitor.texi
+/qemu-monitor-info.texi
+/qemu-version.h
+/qemu-version.h.tmp
+/qemu2-auto-generated/asm
+/module_block.h
+/scsi/qemu-pr-helper
+/vhost-user-scsi
+/vhost-user-blk
+/fsdev/virtfs-proxy-helper
+*.tmp
+*.[1-9]
+*.a
+*.aux
+*.cp
+*.exe
+*.msi
+*.dll
+*.so
+*.mo
+*.fn
+*.ky
+*.log
+*.pdf
+*.pod
+*.cps
+*.fns
+*.kys
+*.pg
+*.pyc
+*.toc
+*.tp
+*.vr
+*.d
+!/scripts/qemu-guest-agent/fsfreeze-hook.d
+*.o
+.sdk
+*.gcda
+*.gcno
+/pc-bios/bios-pq/status
+/pc-bios/vgabios-pq/status
+/pc-bios/optionrom/linuxboot.asm
+/pc-bios/optionrom/linuxboot.bin
+/pc-bios/optionrom/linuxboot.raw
+/pc-bios/optionrom/linuxboot.img
+/pc-bios/optionrom/linuxboot_dma.asm
+/pc-bios/optionrom/linuxboot_dma.bin
+/pc-bios/optionrom/linuxboot_dma.raw
+/pc-bios/optionrom/linuxboot_dma.img
+/pc-bios/optionrom/multiboot.asm
+/pc-bios/optionrom/multiboot.bin
+/pc-bios/optionrom/multiboot.raw
+/pc-bios/optionrom/multiboot.img
+/pc-bios/optionrom/kvmvapic.asm
+/pc-bios/optionrom/kvmvapic.bin
+/pc-bios/optionrom/kvmvapic.raw
+/pc-bios/optionrom/kvmvapic.img
+/pc-bios/s390-ccw/s390-ccw.elf
+/pc-bios/s390-ccw/s390-ccw.img
+/docs/interop/qemu-ga-qapi.texi
+/docs/interop/qemu-ga-ref.html
+/docs/interop/qemu-ga-ref.info*
+/docs/interop/qemu-ga-ref.txt
+/docs/interop/qemu-qmp-qapi.texi
+/docs/interop/qemu-qmp-ref.html
+/docs/interop/qemu-qmp-ref.info*
+/docs/interop/qemu-qmp-ref.txt
+/docs/version.texi
+*.tps
+.stgit-*
+.git-submodule-status
+cscope.*
+tags
+TAGS
+docker-src.*
+*~
+*.DS_Store
+/default.profraw
+/build
+.vscode/cquery_cached_index
+*.ast_raw
+*.depend_raw
+.vs/
+/.gradle
+/.settings
+/.project
+.vs
+.vscode
+*.Makefile
+*.ncb
+*.nvuser
+*.opensdf
+*.orig
+*.psess
+*.pyc
+*.rej
+*.sdf
+*.sln
+*.suo
+*.target.mk
+*.TMP
+*.VC.db
+*.VC.opendb
+*.vcproj
+*.vcxproj
+*.vcxproj.filters
+*.vcxproj.user
+*.vsp
+*~
+.*.sw*
+.sw*
+.cipd
+.gclient
+.gclient_entries
+.git_cl_description_backup
+/src/tests/third_party/gles_conformance_tests
+/testing
+/third_party/android_ndk
+/third_party/catapult
+/third_party/cherry
+/third_party/fuchsia-sdk
+/third_party/gles1_conform
+/third_party/glmark2/src
+/third_party/glslang/src
+/third_party/googletest
+/third_party/jsoncpp
+/third_party/libjpeg_turbo
+/third_party/libpng/src
+/third_party/llvm-build
+/third_party/nasm
+/third_party/Python-Markdown
+/third_party/qemu-linux-x64
+/third_party/qemu-mac-x64
+/third_party/rapidjson/src
+/third_party/spirv-cross/src
+/third_party/spirv-headers/src
+/third_party/spirv-tools/src
+/third_party/SwiftShader
+/third_party/VK-GL-CTS/src
+/third_party/vulkan-headers/src
+/third_party/vulkan-loader/src
+/third_party/vulkan-tools/src
+/third_party/vulkan-validation-layers/src
+/third_party/vulkan_memory_allocator
+/third_party/zlib
+/tools/clang
+/tools/flex-bison/linux/bison
+/tools/flex-bison/linux/flex
+/tools/flex-bison/windows/bison.exe
+/tools/flex-bison/windows/flex.exe
+/tools/flex-bison/windows/m4.exe
+/tools/flex-bison/windows/msys*.dll
+/tools/glslang/glslang_validator
+/tools/glslang/glslang_validator.exe
+/tools/md_browser
+/tools/memory
+angle_debug.txt
+build
+buildtools/
+debug.txt
+Debug/
+Debug_ARM/
+Debug_Win32/
+Debug_x64/
+diag.txt
+ipch
+lib/*
+out
+patches-*
+Release/
+Release_ARM/
+Release_Win32/
+Release_x64/
+TestResults.qpa
+.idea/
+.cache/
+compile_commands.json
diff --git a/src/gfxstream/CMakeLists.txt b/src/gfxstream/CMakeLists.txt
new file mode 100644
index 00000000000..6a29a17c387
--- /dev/null
+++ b/src/gfxstream/CMakeLists.txt
@@ -0,0 +1,165 @@
+cmake_policy(SET CMP0048 NEW)
+# Set this policy to allow gfxstream to modify the passed in targets like
+# ${GFXSTREAM_HOST_COMMON_LIB}.
+cmake_policy(SET CMP0079 NEW)
+get_directory_property(hasParent PARENT_DIRECTORY)
+if(NOT hasParent)
+ project(gfx-streaming-kit)
+endif()
+cmake_minimum_required(VERSION 3.18)
+
+option(ENABLE_VKCEREAL_TESTS "Enable building vulkan-cereal unittests" OFF)
+option(BUILD_ASAN_WIN32 "Build with ASAN on Windows platform" OFF)
+
+set(VALID_DEPENDENCY_RESOLUTION AOSP SYSTEM DOWNLOAD)
+set(DEPENDENCY_RESOLUTION "AOSP" CACHE STRING "\
+How to resolve the dependencies. Currently there are 3 options: AOSP, SYSTEM and DOWNLOAD. AOSP \
+will assume the repo is checked out in an Android tree, and find the dependencies through \
+relative paths. SYSTEM will use the cmake find_package to identify the package. DOWNLOAD will use \
+CMake FetchContent to download the dependencies from the AOSP tree.\
+")
+set_property(CACHE DEPENDENCY_RESOLUTION PROPERTY STRINGS ${VALID_DEPENDENCY_RESOLUTION})
+if(NOT DEPENDENCY_RESOLUTION IN_LIST VALID_DEPENDENCY_RESOLUTION)
+ message(FATAL_ERROR "DEPENDENCY_RESOLUTION must be one of ${VALID_DEPENDENCY_RESOLUTION}.")
+endif()
+
+option(BUILD_STANDALONE "Build with standalone implementations of base/host-common libraries" ON)
+if (BUILD_STANDALONE)
+ # These libraries may be changed in non-standalone builds to inject another implementation of
+ # these APIs.
+ set(GFXSTREAM_BASE_LIB aemu-base)
+ set(GFXSTREAM_HOST_COMMON_LIB aemu-host-common)
+endif()
+
+option(BUILD_GRAPHICS_DETECTOR "Build the graphics detector utility" OFF)
+
+if (WIN32)
+ add_definitions("-DUNICODE -D_UNICODE -DNOMINMAX -DEMUGL_BUILD -DVK_USE_PLATFORM_WIN32_KHR -DBUILDING_EMUGL_COMMON_SHARED")
+endif()
+
+option(VIRGL_RENDERER_UNSTABLE_APIS "Use unstable virglrenderer APIs" ON)
+if(VIRGL_RENDERER_UNSTABLE_APIS)
+ add_definitions(-DVIRGL_RENDERER_UNSTABLE_APIS)
+endif()
+
+add_definitions(-DGFXSTREAM_ENABLE_HOST_GLES=1)
+
+option(ASTC_CPU_DECODING "Enable decoding ASTC textures on the CPU" OFF)
+
+# For now the caller of the cmake script is responsible to create the angle_shader_translator
+# target.
+option(USE_ANGLE_SHADER_PARSER "Build with ANGLE shader parser." OFF)
+
+option(WITH_BENCHMARK "Builds benchmarking code" OFF)
+
+if(UNIX AND NOT APPLE AND NOT QNX)
+ set(LINUX TRUE)
+endif()
+
+find_package(Threads)
+include(ExternalProject)
+include(FetchContent)
+set(FETCHCONTENT_QUIET FALSE)
+
+include(GoogleTest)
+enable_testing()
+# Disable test discovery after build.
+# By default, `gtest_discover_tests()` adds a post-build step to run the test executables in order to discover the test
+# targets. This is problematic in some build environments. (for example: if cross-compiling)
+set(CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE "PRE_TEST")
+
+# set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/distribution)
+if (WIN32)
+ SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
+else()
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -O3")
+endif()
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_C_STANDARD 11)
+
+if (APPLE)
+ add_compile_definitions(VK_USE_PLATFORM_MACOS_MVK)
+elseif(QNX)
+ # TODO(jsimonot): fix build error
+ # add_compile_definitions(VK_USE_PLATFORM_SCREEN_QNX)
+elseif(UNIX)
+ # TODO(kaiyili, b/179477624): Add Linux specific Vulkan platform macro definitions
+ # Use X11 version of EGL platform specific definitions.
+ add_compile_definitions(USE_X11)
+elseif(WIN32)
+ add_compile_definitions(VK_USE_PLATFORM_WIN32_KHR)
+endif()
+
+add_compile_definitions(GLM_FORCE_RADIANS)
+add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
+add_compile_definitions(VK_GFXSTREAM_STRUCTURE_TYPE_EXT)
+
+if (MSVC)
+ # ask msvc not to warn not secure C ISO functions
+ add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
+ # ask msvc not to warn non C ISO POSIX functions
+ add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE)
+endif()
+
+if(MSVC OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
+ # generate PDB files
+ add_link_options("/DEBUG")
+endif()
+
+# Uncomment for ASAN support
+# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
+# set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
+
+if (WIN32)
+ if (BUILD_ASAN_WIN32)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
+ # ASAN does not work with flag /MDd, replace it with /MD
+ string(REPLACE "/MDd" "/MD" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
+ set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+
+ # ASAN linker
+ # User needs to use -D ASAN_LIB_DIR:STRING=/path/to/asan_libs to add library directory
+ if (NOT DEFINED ASAN_LIB_DIR)
+ message(FATAL_ERROR "Please input ASAN library path with -D ASAN_LIB_DIR:STRING=/path/to/asan_lib_dir")
+ endif()
+ link_libraries(clang_rt.asan_dynamic-x86_64.lib clang_rt.asan_dynamic_runtime_thunk-x86_64.lib)
+ message("Linking ASAN libraries from: ${ASAN_LIB_DIR}")
+ link_directories(${ASAN_LIB_DIR})
+ endif()
+endif()
+
+set(GFXSTREAM_REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
+
+if(USE_ANGLE_SHADER_PARSER)
+ add_compile_definitions(USE_ANGLE_SHADER_PARSER)
+endif()
+
+if(CONFIG_AEMU)
+ include(android.cmake)
+endif()
+
+set(EXTRA_SUBDIR_TEST_INCLUDE_FILES)
+
+add_subdirectory(common)
+
+# Third party dependencies
+add_subdirectory(third-party)
+
+# Backends######################################################################
+
+add_subdirectory(utils)
+add_subdirectory(host)
+
+# Protocols and associated code generators######################################
+
+add_subdirectory(codegen)
+
+if (ENABLE_VKCEREAL_TESTS)
+ list(APPEND EXTRA_SUBDIR_TEST_INCLUDE_FILES ${CMAKE_SOURCE_DIR}/cmake/test_properties.cmake)
+endif()
+
+include(cmake/SetSubdirectorProperties.cmake)
diff --git a/src/gfxstream/LICENSE b/src/gfxstream/LICENSE
new file mode 100644
index 00000000000..85ae1c80257
--- /dev/null
+++ b/src/gfxstream/LICENSE
@@ -0,0 +1,855 @@
+Full license text of these licenses is available at:
+
+ * Apache-2.0: https://opensource.org/licenses/Apache-2.0
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ * MIT: https://opensource.org/licenses/MIT
+
+MIT License
+
+Copyright (c) 2020-2021 The Khronos Group 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 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.
+
+ * CC-BY-4.0: https://creativecommons.org/licenses/by/4.0/legalcode
+
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+ Considerations for licensors: Our public licenses are
+ intended for use by those authorized to give the public
+ permission to use material in ways otherwise restricted by
+ copyright and certain other rights. Our licenses are
+ irrevocable. Licensors should read and understand the terms
+ and conditions of the license they choose before applying it.
+ Licensors should also secure all rights necessary before
+ applying our licenses so that the public can reuse the
+ material as expected. Licensors should clearly mark any
+ material not subject to the license. This includes other CC-
+ licensed material, or material used under an exception or
+ limitation to copyright. More considerations for licensors:
+ wiki.creativecommons.org/Considerations_for_licensors
+
+ Considerations for the public: By using one of our public
+ licenses, a licensor grants the public permission to use the
+ licensed material under specified terms and conditions. If
+ the licensor's permission is not necessary for any reason--for
+ example, because of any applicable exception or limitation to
+ copyright--then that use is not regulated by the license. Our
+ licenses grant only permissions under copyright and certain
+ other rights that a licensor has authority to grant. Use of
+ the licensed material may still be restricted for other
+ reasons, including because others have copyright or other
+ rights in the material. A licensor may make special requests,
+ such as asking that all changes be marked or described.
+ Although not required by our licenses, you are encouraged to
+ respect those requests where reasonable. More considerations
+ for the public:
+ wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+ a. Adapted Material means material subject to Copyright and Similar
+ Rights that is derived from or based upon the Licensed Material
+ and in which the Licensed Material is translated, altered,
+ arranged, transformed, or otherwise modified in a manner requiring
+ permission under the Copyright and Similar Rights held by the
+ Licensor. For purposes of this Public License, where the Licensed
+ Material is a musical work, performance, or sound recording,
+ Adapted Material is always produced where the Licensed Material is
+ synched in timed relation with a moving image.
+
+ b. Adapter's License means the license You apply to Your Copyright
+ and Similar Rights in Your contributions to Adapted Material in
+ accordance with the terms and conditions of this Public License.
+
+ c. Copyright and Similar Rights means copyright and/or similar rights
+ closely related to copyright including, without limitation,
+ performance, broadcast, sound recording, and Sui Generis Database
+ Rights, without regard to how the rights are labeled or
+ categorized. For purposes of this Public License, the rights
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
+ Rights.
+
+ d. Effective Technological Measures means those measures that, in the
+ absence of proper authority, may not be circumvented under laws
+ fulfilling obligations under Article 11 of the WIPO Copyright
+ Treaty adopted on December 20, 1996, and/or similar international
+ agreements.
+
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
+ any other exception or limitation to Copyright and Similar Rights
+ that applies to Your use of the Licensed Material.
+
+ f. Licensed Material means the artistic or literary work, database,
+ or other material to which the Licensor applied this Public
+ License.
+
+ g. Licensed Rights means the rights granted to You subject to the
+ terms and conditions of this Public License, which are limited to
+ all Copyright and Similar Rights that apply to Your use of the
+ Licensed Material and that the Licensor has authority to license.
+
+ h. Licensor means the individual(s) or entity(ies) granting rights
+ under this Public License.
+
+ i. Share means to provide material to the public by any means or
+ process that requires permission under the Licensed Rights, such
+ as reproduction, public display, public performance, distribution,
+ dissemination, communication, or importation, and to make material
+ available to the public including in ways that members of the
+ public may access the material from a place and at a time
+ individually chosen by them.
+
+ j. Sui Generis Database Rights means rights other than copyright
+ resulting from Directive 96/9/EC of the European Parliament and of
+ the Council of 11 March 1996 on the legal protection of databases,
+ as amended and/or succeeded, as well as other essentially
+ equivalent rights anywhere in the world.
+
+ k. You means the individual or entity exercising the Licensed Rights
+ under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+ a. License grant.
+
+ 1. Subject to the terms and conditions of this Public License,
+ the Licensor hereby grants You a worldwide, royalty-free,
+ non-sublicensable, non-exclusive, irrevocable license to
+ exercise the Licensed Rights in the Licensed Material to:
+
+ a. reproduce and Share the Licensed Material, in whole or
+ in part; and
+
+ b. produce, reproduce, and Share Adapted Material.
+
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
+ Exceptions and Limitations apply to Your use, this Public
+ License does not apply, and You do not need to comply with
+ its terms and conditions.
+
+ 3. Term. The term of this Public License is specified in Section
+ 6(a).
+
+ 4. Media and formats; technical modifications allowed. The
+ Licensor authorizes You to exercise the Licensed Rights in
+ all media and formats whether now known or hereafter created,
+ and to make technical modifications necessary to do so. The
+ Licensor waives and/or agrees not to assert any right or
+ authority to forbid You from making technical modifications
+ necessary to exercise the Licensed Rights, including
+ technical modifications necessary to circumvent Effective
+ Technological Measures. For purposes of this Public License,
+ simply making modifications authorized by this Section 2(a)
+ (4) never produces Adapted Material.
+
+ 5. Downstream recipients.
+
+ a. Offer from the Licensor -- Licensed Material. Every
+ recipient of the Licensed Material automatically
+ receives an offer from the Licensor to exercise the
+ Licensed Rights under the terms and conditions of this
+ Public License.
+
+ b. No downstream restrictions. You may not offer or impose
+ any additional or different terms or conditions on, or
+ apply any Effective Technological Measures to, the
+ Licensed Material if doing so restricts exercise of the
+ Licensed Rights by any recipient of the Licensed
+ Material.
+
+ 6. No endorsement. Nothing in this Public License constitutes or
+ may be construed as permission to assert or imply that You
+ are, or that Your use of the Licensed Material is, connected
+ with, or sponsored, endorsed, or granted official status by,
+ the Licensor or others designated to receive attribution as
+ provided in Section 3(a)(1)(A)(i).
+
+ b. Other rights.
+
+ 1. Moral rights, such as the right of integrity, are not
+ licensed under this Public License, nor are publicity,
+ privacy, and/or other similar personality rights; however, to
+ the extent possible, the Licensor waives and/or agrees not to
+ assert any such rights held by the Licensor to the limited
+ extent necessary to allow You to exercise the Licensed
+ Rights, but not otherwise.
+
+ 2. Patent and trademark rights are not licensed under this
+ Public License.
+
+ 3. To the extent possible, the Licensor waives any right to
+ collect royalties from You for the exercise of the Licensed
+ Rights, whether directly or through a collecting society
+ under any voluntary or waivable statutory or compulsory
+ licensing scheme. In all other cases the Licensor expressly
+ reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+ a. Attribution.
+
+ 1. If You Share the Licensed Material (including in modified
+ form), You must:
+
+ a. retain the following if it is supplied by the Licensor
+ with the Licensed Material:
+
+ i. identification of the creator(s) of the Licensed
+ Material and any others designated to receive
+ attribution, in any reasonable manner requested by
+ the Licensor (including by pseudonym if
+ designated);
+
+ ii. a copyright notice;
+
+ iii. a notice that refers to this Public License;
+
+ iv. a notice that refers to the disclaimer of
+ warranties;
+
+ v. a URI or hyperlink to the Licensed Material to the
+ extent reasonably practicable;
+
+ b. indicate if You modified the Licensed Material and
+ retain an indication of any previous modifications; and
+
+ c. indicate the Licensed Material is licensed under this
+ Public License, and include the text of, or the URI or
+ hyperlink to, this Public License.
+
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
+ reasonable manner based on the medium, means, and context in
+ which You Share the Licensed Material. For example, it may be
+ reasonable to satisfy the conditions by providing a URI or
+ hyperlink to a resource that includes the required
+ information.
+
+ 3. If requested by the Licensor, You must remove any of the
+ information required by Section 3(a)(1)(A) to the extent
+ reasonably practicable.
+
+ 4. If You Share Adapted Material You produce, the Adapter's
+ License You apply must not prevent recipients of the Adapted
+ Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+ to extract, reuse, reproduce, and Share all or a substantial
+ portion of the contents of the database;
+
+ b. if You include all or a substantial portion of the database
+ contents in a database in which You have Sui Generis Database
+ Rights, then the database in which You have Sui Generis Database
+ Rights (but not its individual contents) is Adapted Material; and
+
+ c. You must comply with the conditions in Section 3(a) if You Share
+ all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+ c. The disclaimer of warranties and limitation of liability provided
+ above shall be interpreted in a manner that, to the extent
+ possible, most closely approximates an absolute disclaimer and
+ waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+ a. This Public License applies for the term of the Copyright and
+ Similar Rights licensed here. However, if You fail to comply with
+ this Public License, then Your rights under this Public License
+ terminate automatically.
+
+ b. Where Your right to use the Licensed Material has terminated under
+ Section 6(a), it reinstates:
+
+ 1. automatically as of the date the violation is cured, provided
+ it is cured within 30 days of Your discovery of the
+ violation; or
+
+ 2. upon express reinstatement by the Licensor.
+
+ For the avoidance of doubt, this Section 6(b) does not affect any
+ right the Licensor may have to seek remedies for Your violations
+ of this Public License.
+
+ c. For the avoidance of doubt, the Licensor may also offer the
+ Licensed Material under separate terms or conditions or stop
+ distributing the Licensed Material at any time; however, doing so
+ will not terminate this Public License.
+
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+ License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+ a. The Licensor shall not be bound by any additional or different
+ terms or conditions communicated by You unless expressly agreed.
+
+ b. Any arrangements, understandings, or agreements regarding the
+ Licensed Material not stated herein are separate from and
+ independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+ a. For the avoidance of doubt, this Public License does not, and
+ shall not be interpreted to, reduce, limit, restrict, or impose
+ conditions on any use of the Licensed Material that could lawfully
+ be made without permission under this Public License.
+
+ b. To the extent possible, if any provision of this Public License is
+ deemed unenforceable, it shall be automatically reformed to the
+ minimum extent necessary to make it enforceable. If the provision
+ cannot be reformed, it shall be severed from this Public License
+ without affecting the enforceability of the remaining terms and
+ conditions.
+
+ c. No term or condition of this Public License will be waived and no
+ failure to comply consented to unless expressly agreed to by the
+ Licensor.
+
+ d. Nothing in this Public License constitutes or may be interpreted
+ as a limitation upon, or waiver of, any privileges and immunities
+ that apply to the Licensor or You, including from the legal
+ processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public
+licenses. Notwithstanding, Creative Commons may elect to apply one of
+its public licenses to material it publishes and in those instances
+will be considered the “Licensor.” The text of the Creative Commons
+public licenses is dedicated to the public domain under the CC0 Public
+Domain Dedication. Except for the limited purpose of indicating that
+material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the
+public licenses.
+
+Creative Commons may be contacted at creativecommons.org.
+
+
+ * LicenseRef-MPLUS: https://osdn.net/softwaremap/trove_list.php?form_cat=370
+
+M+ Font License
+
+These fonts are free softwares.
+Unlimited permission is granted to use, copy, and distribute it,
+with or without modification, either commercially and noncommercially.
+THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY.
+
+*********************************************************************************
+
+Copyright (c) 2014-2016 OpenDevise Inc. and the Asciidoctor Project
+
+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 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.
+
+*********************************************************************************
+
+Copyright (c) 1998-2006 MACS, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2007 SiSco, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2014-2015 Red Hat 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2011, 2016-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 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.
+
+*********************************************************************************
+
+Copyright (c) 2019 The Android Open Source Project
+
+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 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.
+
+*********************************************************************************
+
+Copyright (c) 2016, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 1999-2006 Brian Paul
+
+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 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.
+
+*********************************************************************************
+
+Copyright (c) 2009 VMware, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2007-2018 The Khronos Group 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 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.
+
+*********************************************************************************
+
+Copyright (c) 1998-1999 Precision Insight 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2007-2008 Red Hat, 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2015-2016 Valve 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 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.
+
+*********************************************************************************
+
+Copyright (c) 2015-2016 LunarG, 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 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.
+
+*********************************************************************************
+
+Copyright 2008 The Android Open Source Project
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*********************************************************************************
+
+Copyright (c) 2000 The NetBSD Foundation, Inc.
+
+This code is derived from software contributed to The NetBSD Foundation by Dieter Baron and Thomas Klausner
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*********************************************************************************
+
+Copyright 2002 Todd C. Miller <Todd.Miller@courtesan.com>
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+*********************************************************************************
+
+Copyright 2013-2014 Red Hat, Inc.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*********************************************************************************
+
+// Copyright 2020-2021 The Khronos Group Inc.
+// SPDX-License-Identifier: CC-BY-4.0
+
+= LICENSE file for the KhronosGroup/Vulkan-Docs project
+
+Files in codegen/vulkan subdirectory fall under one of these licenses:
+
+ * SPDX license identifier: "`Apache-2.0 OR MIT`"
+ ** Apache License 2.0 OR MIT License
+ ** For scripts and XML which need to be usable in GPL-licensed projects.
+
+ * SPDX license identifier: "`Apache-2.0`"
+ ** Apache License 2.0
+ ** For other scripts
+
+ * SPDX license identifier: "`CC-BY-4.0`"
+ ** Creative Commons Attribution 4.0 International
+ ** For specification source documents
+
+ * SPDX license identifier: "`MIT`"
+ ** MIT License
+ ** For files copied from other MIT-licensed projects
+
+ * SPDX license identifier: "`LicenseRef-MPLUS`"
+ ** M+ Font License
+ ** For fonts derived from the M+ Font Project
+ ** This license is open source, but not OSI approved \ No newline at end of file
diff --git a/src/gfxstream/MODULE_LICENSE_APACHE2 b/src/gfxstream/MODULE_LICENSE_APACHE2
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/src/gfxstream/MODULE_LICENSE_APACHE2
diff --git a/src/gfxstream/OWNERS b/src/gfxstream/OWNERS
new file mode 100644
index 00000000000..71e0408ba38
--- /dev/null
+++ b/src/gfxstream/OWNERS
@@ -0,0 +1,7 @@
+gurchetansingh@google.com
+joshuaduong@google.com
+kaiyili@google.com
+mprzybyl@google.com
+msandy@google.com
+natsu@google.com
+yahan@google.com
diff --git a/src/gfxstream/README.md b/src/gfxstream/README.md
new file mode 100644
index 00000000000..b356997447a
--- /dev/null
+++ b/src/gfxstream/README.md
@@ -0,0 +1,110 @@
+# Graphics Streaming Kit (formerly: Vulkan Cereal)
+
+Graphics Streaming Kit is a code generator that makes it easier to serialize
+and forward graphics API calls from one place to another:
+
+- From a virtual machine guest to host for virtualized graphics
+- From one process to another for IPC graphics
+- From one computer to another via network sockets
+
+# Build: Linux
+
+The latest directions for the standalone Linux build are provided
+[here](https://crosvm.dev/book/appendix/rutabaga_gfx.html).
+
+# Build: Windows
+
+Make sure the latest CMake is installed. Make sure Visual Studio 2019 is
+installed on your system along with all the Clang C++ toolchain components.
+Then:
+
+ mkdir build
+ cd build
+ cmake . ../ -A x64 -T ClangCL
+
+A solution file should be generated. Then open the solution file in Visual
+studio and build the `gfxstream_backend` target.
+
+# Build: Android for host
+
+Be in the Android build system. Then:
+
+ m libgfxstream_backend
+
+It then ends up in `out/host`
+
+This also builds for Android on-device.
+
+# Output artifacts
+
+ libgfxstream_backend.(dll|so|dylib)
+
+# Regenerating Vulkan code
+
+To re-generate both guest and Vulkan code, please run:
+
+ scripts/generate-gfxstream-vulkan.sh
+
+# Regenerating GLES/RenderControl code
+
+First, build `build/gfxstream-generic-apigen`. Then run:
+
+ scripts/generate-apigen-source.sh
+
+# Tests
+
+## Windows Tests
+
+There are a bunch of test executables generated. They require `libEGL.dll` and `libGLESv2.dll` and `vulkan-1.dll` to be available, possibly from your GPU vendor or ANGLE, in the `%PATH%`.
+
+## Android Host Tests
+
+There are Android mock testa available, runnable on Linux. To build these tests, run:
+
+ m GfxstreamEnd2EndTests
+
+# Structure
+
+- `CMakeLists.txt`: specifies all host-side build targets. This includes all
+ backends along with client/server setups that live only on the host. Some
+ - Backend implementations
+ - Implementations of the host side of various transports
+ - Frontends used for host-side testing with a mock implementation of guest
+ graphics stack (mainly Android)
+ - Frontends that result in actual Linux/macOS/Windows gles/vk libraries
+ (isolation / fault tolerance use case)
+- `Android.bp`: specifies all guest-side build targets for Android:
+ - Implementations of the guest side of various transports (above the kernel)
+ - Frontends
+- `BUILD.gn`: specifies all guest-side build targets for Fuchsia
+ - Implementations of the guest side of various transports (above the kernel)
+ - Frontends
+- `base/`: common libraries that are built for both the guest and host.
+ Contains utility code related to synchronization, threading, and suballocation.
+- `protocols/`: implementations of protocols for various graphics APIs. May contain
+code generators to make it easy to regen the protocol based on certain things.
+- `host-common/`: implementations of host-side support code that makes it
+ easier to run the server in a variety of virtual device environments.
+ Contains concrete implementations of auxiliary virtual devices such as
+ Address Space Device and Goldfish Pipe.
+- `stream-servers/`: implementations of various backends for various graphics
+ APIs that consume protocol. `gfxstream-virtio-gpu-renderer.cpp` contains a
+ virtio-gpu backend implementation.
+
+# Guest Vulkan design
+
+gfxstream vulkan is the most actively developed component. Some key commponents of
+the current design include:
+
+- 1:1 threading model - each guest Vulkan encoder thread gets host side decoding thread
+- Support for both virtio-gpu, goldish and testing transports.
+- Support for Android, Fuchsia, and Linux guests.
+- Ring Buffer to stream commands, in the style of io_uring.
+- Mesa embedded to provide [dispatch](https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/docs/vulkan/dispatch.rst)
+ and [objects](https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/docs/vulkan/base-objs.rst).
+- Currently, there are a set of Mesa objects and gfxstream objects. For example,
+ `struct gfxstream_vk_device` and the gfxstream object `goldfish_device` both are internal
+ representations of Vulkan opaque handle `VkDevice`. The Mesa object is used first, since Mesa
+ provides dispatch. The Mesa object contains a key to the hash table to get a gfxstream
+ internal object (for example, `gfxstream_vk_device::internal_object`). Eventually, gfxstream
+ objects will be phased out and Mesa objects used exclusively.
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/README.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/README.adoc
new file mode 100644
index 00000000000..e9b2558182e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/README.adoc
@@ -0,0 +1,83 @@
+// Copyright 2014-2023 The Khronos Group Inc.
+// SPDX-License-Identifier: CC-BY-4.0
+
+= Vulkan^(R)^ Specification Repository Scripts
+
+This directory contains scripts used in building the Vulkan API
+specification and related artifacts. For the most part, these scripts are
+invoked from the top-level directory or from the API Registry in
+../xml to build generated components of the specification.
+
+Scripts in this directory include:
+
+ * `genvk.py` - Python script to generate Vulkan headers and some other
+ targets, using the generators described below.
+ * `reg.py` - Python tools to read a registry XML file and call into
+ generators to create headers and other types of output.
+ * `conventions.py`, `vkconventions.py`, `apiconventions.py` - API-specific
+ parameters and formatting / style conventions used by generators.
+ * `generator.py` - output generator base class.
+ ** `cgenerator.py` - C header output generator.
+ ** `docgenerator.py` - Asciidoc interface language include generator.
+ ** `extensionmetadocgenerator.py` - Generator for Asciidoc extension
+ descriptions in spec appendices.
+ ** `hostsyncgenerator.py` - Asciidoc host sync table generator.
+ ** `interfacedocgenerator.py` - Asciidoc extension appendix interface
+ generator.
+ ** `pygenerator.py, `rubygenerator.py`, `scriptgenerator.py` - generate
+ Python and Ruby encodings of parts of the API description for use in
+ other scripts and asciidoctor extensions.
+ ** `spirvcapgenerator.py` - Asciidoc generator for SPIR-V capability
+ tables.
+ ** `validitygenerator.py` - Asciidoc validity language generator.
+
+ * `check_spec_links.py` - validates a variety of markup and content in the
+ Asciidoctor specification source.
+ * `conventions.py`, `vkconventions.py` - API-specific options used by
+ scripts shared with OpenXR and other APIs.
+ * `extdependency.py` - generate extension dependencies for use when
+ building the specification.
+ * `genRelease`, `genspec.py` - build HTML and PDF Specifications with a
+ variety of options to control target directories, extensions included
+ while building, etc.
+ * `genRef.py`, `reflib.py`, `makemanaliases.py` - extract API reference
+ pages from specification source into single-page source documents, and
+ create symbolic links in the generated refpage HTML for API aliases.
+ * `indexExt.py` - generate HTML index of all extensions for inclusion into
+ the Vulkan registry index page.
+ * `reflow.py`, `reflow_count.py` - reflow specification source text to
+ follow style guidelines, and insert Valid Usage statements where they
+ are needed.
+ * `test_check_spec_links.py`, `test_check_spec_links_api_specific.py`,
+ `test_entity_db.py` - these are from another Khronos WG repository and
+ are unused by Vulkan at present.
+ * `xml_consistency.py` - perform some internal consistency checks on
+ `vk.xml`.
+
+ * `compImages.sh` - compare images in two branches.
+ * `htmldiff/htmldiff` - HTML diff script (see below).
+ * `Retired/` - contains obsolete, unused, or single-purpose scripts. Not
+ maintained.
+
+== HTML Diff Script for Vulkan
+
+This is a first cut at a script to compare Vulkan HTML specifications. Usage
+is simply 'htmldiff file1.html file2.html > diff.html'. The script does not
+copy CSS and images required by the input specs, so it is best to generate
+the output in the same directory as one of the inputs. However, the script
+must be invoked from the directory it is located within.
+
+The scripts used require Python and Perl. Additionally, the python
+'utidylib' module and the underlying libtidy C library are required.
+On Debian Linux, it may be necessary to install the 'python-utidylib' and
+'libtidy' packages if they are not already present.
+
+The scripts are taken from the code backing the
+
+ http://services.w3.org/htmldiff
+
+website. `htmldiff` is the Python driver script. `htmldiff.pl` is the
+Perl script which generates the diff after preprocessing of the input
+HTML by `htmldiff`. `htmldiff.orig` is the original Python script from
+the website, modified to run at the command line instead of as a CGI
+script.
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/checkLinks.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/checkLinks.py
new file mode 100755
index 00000000000..8d0b071409a
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/checkLinks.py
@@ -0,0 +1,353 @@
+#!/usr/bin/python3
+#
+# Copyright 2015-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# checkLinks.py - validate link/reference API constructs in files
+#
+# Usage: checkLinks.py [options] files > logfile
+#
+# Options:
+# -follow attempt to follow include:: directives. This script is not an
+# Asciidoctor processor, so only literal relative paths can be followed.
+# -info print some internal diagnostics.
+# -paramcheck attempt to validate param: names against the surrounding
+# context (the current structure/function being validated, for example).
+# This generates many false positives, so is not enabled by default.
+# -fatal unvalidatable links cause immediate error exit from the script.
+# Otherwise, errors are accumulated and summarized at the end.
+#
+# Depends on vkapi.py, which is a Python representation of relevant parts
+# of the Vulkan API. Only works when vkapi.py is generated for the full
+# API, e.g. 'makeAllExts checklinks'; otherwise many false-flagged errors
+# will occur.
+
+import copy, os, pdb, re, string, sys
+from vkapi import *
+
+global curFile, curLine, sectionDepth
+global errCount, warnCount, emittedPrefix, printInfo
+
+curFile = '???'
+curLine = -1
+sectionDepth = 0
+emittedPrefix = {}
+printInfo = False
+
+# Called before printing a warning or error. Only prints once prior
+# to output for a given file.
+def emitPrefix():
+ global curFile, curLine, emittedPrefix
+ if (curFile not in emittedPrefix.keys()):
+ emittedPrefix[curFile] = None
+ print('Checking file:', curFile)
+ print('-------------------------------')
+
+def info(*args, **kwargs):
+ global curFile, curLine, printInfo
+ if (printInfo):
+
+ emitPrefix()
+ print('INFO: %s line %d:' % (curFile, curLine),
+ ' '.join([str(arg) for arg in args]))
+
+# Print a validation warning found in a file
+def warning(*args, **kwargs):
+ global curFile, curLine, warnCount
+
+ warnCount = warnCount + 1
+ emitPrefix()
+ print('WARNING: %s line %d:' % (curFile, curLine),
+ ' '.join([str(arg) for arg in args]))
+
+# Print a validation error found in a file
+def error(*args, **kwargs):
+ global curFile, curLine, errCount
+
+ errCount = errCount + 1
+ emitPrefix()
+ print('ERROR: %s line %d:' % (curFile, curLine),
+ ' '.join([str(arg) for arg in args]))
+
+# See if a tag value exists in the specified dictionary and
+# suggest it as an alternative if so.
+def checkTag(tag, value, dict, dictName, tagName):
+ if (value in dict.keys()):
+ warning(value, 'exists in the API but not as a',
+ tag + ': .', 'Try using the', tagName + ': tag.')
+
+# Report an error due to an asciidoc tag which does not match
+# a corresponding API entity.
+def foundError(errType, tag, value, fatal):
+ global curFile, curLine
+ error('no such', errType, tag + ':' + value)
+ # Try some heuristics to detect likely problems such as missing vk
+ # prefixes or the wrong tag.
+
+ # Look in all the dictionaries in vkapi.py to see if the tag
+ # is just wrong but the API entity actually exists.
+ checkTag(tag, value, flags, 'flags', 'tlink/tname')
+ checkTag(tag, value, enums, 'enums', 'elink')
+ checkTag(tag, value, structs, 'structs', 'slink/sname')
+ checkTag(tag, value, handles, 'handles', 'slink/sname')
+ checkTag(tag, value, defines, 'defines', 'slink/sname')
+ checkTag(tag, value, consts, 'consts', 'ename')
+ checkTag(tag, value, protos, 'protos', 'flink/fname')
+ checkTag(tag, value, funcpointers, 'funcpointers', 'tlink/tname')
+
+ # Look for missing vk prefixes (quirky since it is case-dependent)
+ # NOT DONE YET
+
+ if fatal:
+ print('ERROR: %s line %d:' % (curFile, curLine),
+ ' '.join(['no such', errType, tag + ':' + value]), file=sys.stderr)
+ sys.exit(1)
+
+# Look for param in the list of all parameters of the specified functions
+# Returns True if found, False otherwise
+def findParam(param, funclist):
+ for f in funclist:
+ if (param in protos[f]):
+ info('parameter:', param, 'found in function:', f)
+ return True
+ return False
+
+# Initialize tracking state for checking links/includes
+def initChecks():
+ global curFile, curLine, curFuncs, curStruct, accumFunc, sectionDepth
+ global errCount, warnCount
+ global incPat, linkPat, pathPat, sectionPat
+
+ # Matches asciidoc single-line section tags
+ sectionPat = re.compile('^(=+) ')
+
+ # Matches any asciidoc include:: directive
+ pathPat = re.compile('^include::([\w./_]+)\[\]')
+
+ # Matches asciidoc include:: directives used in spec/ref pages (and also
+ # others such as validity). This is specific to the layout of the api/
+ # includes and allows any path preceding 'api/' followed by the category
+ # (protos, structs, enums, etc.) followed by the name of the proto,
+ # struct, etc. file.
+ incPat = re.compile('^.*api/(\w+)/(\w+)\.adoc')
+
+ # Lists of current /protos/ (functions) and /structs/ includes. There
+ # can be several protos contiguously for different forms of a command
+ curFuncs = []
+ curStruct = None
+
+ # Tag if we should accumulate funcs or start a new list. Any intervening
+ # pname: tags or struct includes will restart the list.
+ accumFunc = False
+
+ # Matches all link names in the current spec/man pages. Assumes these
+ # macro names are not trailing subsets of other macros. Used to
+ # precede the regexp with [^A-Za-z], but this did not catch macros
+ # at start of line.
+ linkPat = re.compile('([efpst](name|link)):(\w*)')
+
+ # Total error/warning counters
+ errCount = 0
+ warnCount = 0
+
+# Validate asciidoc internal links in specified file.
+# infile - filename to validate
+# follow - if True, recursively follow include:: directives
+# paramCheck - if True, try to verify pname: refers to valid
+# parameter/member names. This generates many false flags currently
+# included - if True, function was called recursively
+# fatalExit - if True, validation errors cause an error exit immediately
+# Links checked are:
+# fname:vkBlah - Vulkan command name (generates internal link)
+# flink:vkBlah - Vulkan command name
+# sname:VkBlah - Vulkan struct name (generates internal link)
+# slink:VkBlah - Vulkan struct name
+# elink:VkEnumName - Vulkan enumeration ('enum') type name (generates internal link)
+# ename:VK_BLAH - Vulkan enumerant token name
+# pname:name - parameter name to a command or a struct member
+# tlink:name - Other Vulkan type name (generates internal link)
+# tname:name - Other Vulkan type name
+def checkLinks(infile, follow = False, paramCheck = True, included = False, fatalExit = False):
+ global curFile, curLine, curFuncs, curStruct, accumFunc, sectionDepth
+ global errCount, warnCount
+ global incPat, linkPat, pathPat, sectionPat
+
+ # Global state which gets saved and restored by this function
+ oldCurFile = curFile
+ oldCurLine = curLine
+ curFile = infile
+ curLine = 0
+
+ # N.b. dirname() returns an empty string for a path with no directories,
+ # unlike the shell dirname(1).
+ if (not os.path.exists(curFile)):
+ error('No such file', curFile, '- skipping check')
+ # Restore global state before exiting the function
+ curFile = oldCurFile
+ curLine = oldCurLine
+ return
+
+ inPath = os.path.dirname(curFile)
+ fp = open(curFile, 'r', encoding='utf-8')
+
+ for line in fp:
+ curLine = curLine + 1
+
+ # Track changes up and down section headers, and forget
+ # the current functions/structure when popping up a level
+ match = sectionPat.search(line)
+ if (match):
+ info('Match sectionPat for line:', line)
+ depth = len(match.group(1))
+ if (depth < sectionDepth):
+ info('Resetting current function/structure for section:', line)
+ curFuncs = []
+ curStruct = None
+ sectionDepth = depth
+
+ match = pathPat.search(line)
+ if (match):
+ incpath = match.group(1)
+ info('Match pathPat for line:', line)
+ info(' incpath =', incpath)
+ # An include:: directive. First check if it looks like a
+ # function or struct include file, and modify the corresponding
+ # current function or struct state accordingly.
+ match = incPat.search(incpath)
+ if (match):
+ info('Match incPat for line:', line)
+ # For prototypes, if it is preceded by
+ # another include:: directive with no intervening link: tags,
+ # add to the current function list. Otherwise start a new list.
+ # There is only one current structure.
+ category = match.group(1)
+ tag = match.group(2)
+ # @ Validate tag!
+ # @ Arguably, any intervening text should shift to accumFuncs = False,
+ # e.g. only back-to-back includes separated by blank lines would be
+ # accumulated.
+ if (category == 'protos'):
+ if (tag in protos.keys()):
+ if (accumFunc):
+ curFuncs.append(tag)
+ else:
+ curFuncs = [ tag ]
+ # Restart accumulating functions
+ accumFunc = True
+ info('curFuncs =', curFuncs, 'accumFunc =', accumFunc)
+ else:
+ error('include of nonexistent function', tag)
+ elif (category == 'structs'):
+ if (tag in structs.keys()):
+ curStruct = tag
+ # Any /structs/ include means to stop accumulating /protos/
+ accumFunc = False
+ info('curStruct =', curStruct)
+ else:
+ error('include of nonexistent struct', tag)
+ if (follow):
+ # Actually process the included file now, recursively
+ newpath = os.path.normpath(os.path.join(inPath, incpath))
+ info(curFile, ': including file:', newpath)
+ checkLinks(newpath, follow, paramCheck, included = True, fatalExit = fatalExit)
+
+ matches = linkPat.findall(line)
+ for match in matches:
+ # Start actual validation work. Depending on what the
+ # asciidoc tag name is, look up the value in the corresponding
+ # dictionary.
+ tag = match[0]
+ value = match[2]
+ if (tag == 'fname' or tag == 'flink'):
+ if (value not in protos.keys()):
+ foundError('function', tag, value, False)
+ elif (tag == 'sname' or tag == 'slink'):
+ if (value not in structs.keys() and
+ value not in handles.keys()):
+ foundError('aggregate/scalar/handle/define type', tag, value, False)
+ elif (tag == 'ename'):
+ if (value not in consts.keys() and value not in defines.keys()):
+ foundError('enumerant/constant', tag, value, False)
+ elif (tag == 'elink'):
+ if (value not in enums.keys() and value not in flags.keys()):
+ foundError('enum/bitflag type', tag, value, fatalExit)
+ # tname and tlink are the same except if the errors are treated as fatal
+ # They can be recombined once both are error-clean
+ elif (tag == 'tname'):
+ if (value not in funcpointers.keys() and value not in flags.keys()):
+ foundError('function pointer/other type', tag, value, fatalExit)
+ elif (tag == 'tlink'):
+ if (value not in funcpointers.keys() and value not in flags.keys()):
+ foundError('function pointer/other type', tag, value, False)
+ elif (tag == 'pname'):
+ # Any pname: tag means to stop accumulating /protos/
+ accumFunc = False
+ # See if this parameter is in the current proto(s) and struct
+ foundParam = False
+ if (curStruct and value in structs[curStruct]):
+ info('parameter', value, 'found in struct', curStruct)
+ elif (curFuncs and findParam(value, curFuncs)):
+ True
+ else:
+ if paramCheck:
+ warning('parameter', value, 'not found. curStruct =',
+ curStruct, 'curFuncs =', curFuncs)
+ else:
+ # This is a logic error
+ error('unknown tag', tag + ':' + value)
+ fp.close()
+
+ if (errCount > 0 or warnCount > 0):
+ if (not included):
+ print('Errors found:', errCount, 'Warnings found:', warnCount)
+ print('')
+
+ if (included):
+ info('----- returning from:', infile, 'to parent file', '-----')
+
+ # Do not generate any output for files without errors
+ # else:
+ # print(curFile + ': No errors found')
+
+ # Restore global state before exiting the function
+ curFile = oldCurFile
+ curLine = oldCurLine
+
+if __name__ == '__main__':
+ follow = False
+ paramCheck = False
+ included = False
+ fatalExit = False
+
+ totalErrCount = 0
+ totalWarnCount = 0
+
+ if (len(sys.argv) > 1):
+ for file in sys.argv[1:]:
+ if (file == '-follow'):
+ follow = True
+ elif (file == '-info'):
+ printInfo = True
+ elif file == '-paramcheck':
+ paramCheck = True
+ elif (file == '-fatal'):
+ fatalExit = True
+ else:
+ initChecks()
+ checkLinks(file,
+ follow,
+ paramCheck = paramCheck,
+ included = included,
+ fatalExit = fatalExit)
+ totalErrCount = totalErrCount + errCount
+ totalWarnCount = totalWarnCount + warnCount
+ else:
+ print('Need arguments: [-follow] [-info] [-paramcheck] [-fatal] infile [infile...]', file=sys.stderr)
+
+ if (totalErrCount > 0 or totalWarnCount > 0):
+ if (not included):
+ print('TOTAL Errors found:', totalErrCount, 'Warnings found:',
+ totalWarnCount)
+ if totalErrCount > 0:
+ sys.exit(1)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/extensionStubSource.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/extensionStubSource.py
new file mode 100644
index 00000000000..eac3a3e5ac4
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/extensionStubSource.py
@@ -0,0 +1,327 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import os,re,sys
+from generator import *
+
+doc = """
+/*
+** This target is no longer maintained and supported.
+** See README.adoc for discussion.
+**
+** This is a simple extension loader which provides the implementations for the
+** extension prototypes declared in vulkan header. It supports loading extensions either
+** for a single instance or a single device. Multiple instances are not yet supported.
+**
+** To use the loader add vulkan_ext.c to your solution and include <vulkan/vulkan_ext.h>.
+**
+** If your application is using a single instance, but multiple devices callParam
+**
+** vkExtInitInstance(instance);
+**
+** after initializing the instance. This way the extension loader will use the loaders
+** trampoline functions to call the correct driver for each call. This method is safe
+** if your application might use more than one device at the cost of one additional
+** indirection, the dispatch table of each dispatchable object.
+**
+** If your application uses only a single device it is better to use
+**
+** vkExtInitDevice(device);
+**
+** once the device has been initialized. This will resolve the function pointers
+** upfront and thus removes one indirection for each call into the driver. This *can*
+** result in slightly more performance for calling overhead limited cases.
+*/
+"""
+
+# StubExtGeneratorOptions - subclass of GeneratorOptions.
+#
+# Adds options used by COutputGenerator objects during C language header
+# generation.
+#
+# Additional members
+# prefixText - list of strings to prefix generated header with
+# (usually a copyright statement + calling convention macros).
+# alignFuncParam - if nonzero and parameters are being put on a
+# separate line, align parameter names at the specified column
+class StubExtGeneratorOptions(GeneratorOptions):
+ """Represents options during C interface generation for headers"""
+ def __init__(self,
+ filename = None,
+ directory = '.',
+ apiname = None,
+ profile = None,
+ versions = '.*',
+ emitversions = '.*',
+ defaultExtensions = None,
+ addExtensions = None,
+ removeExtensions = None,
+ emitExtensions = None,
+ sortProcedure = regSortFeatures,
+ prefixText = "",
+ alignFuncParam = 0):
+ GeneratorOptions.__init__(self, filename, directory, apiname, profile,
+ versions, emitversions, defaultExtensions,
+ addExtensions, removeExtensions,
+ emitExtensions, sortProcedure)
+ self.prefixText = prefixText
+ self.alignFuncParam = alignFuncParam
+
+# ExtensionStubSourceOutputGenerator - subclass of OutputGenerator.
+# Generates C-language extension wrapper interface sources.
+#
+# ---- methods ----
+# ExtensionStubSourceOutputGenerator(errFile, warnFile, diagFile) - args as for
+# OutputGenerator. Defines additional internal state.
+# ---- methods overriding base class ----
+# beginFile(genOpts)
+# endFile()
+# beginFeature(interface, emit)
+# endFeature()
+# genType(typeinfo,name)
+# genStruct(typeinfo,name)
+# genGroup(groupinfo,name)
+# genEnum(enuminfo, name)
+# genCmd(cmdinfo)
+class ExtensionStubSourceOutputGenerator(OutputGenerator):
+ """Generate specified API interfaces in a specific style, such as a C header"""
+ # This is an ordered list of sections in the header file.
+ TYPE_SECTIONS = ['include', 'define', 'basetype', 'handle', 'enum',
+ 'group', 'bitmask', 'funcpointer', 'struct']
+ ALL_SECTIONS = TYPE_SECTIONS + ['commandPointer', 'command']
+ def __init__(self,
+ errFile = sys.stderr,
+ warnFile = sys.stderr,
+ diagFile = sys.stdout):
+ OutputGenerator.__init__(self, errFile, warnFile, diagFile)
+ #
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+ # C-specific
+ #
+ # Multiple inclusion protection & C++ wrappers.
+
+ # Internal state - accumulators for function pointers and function
+ # pointer initializatoin
+ self.pointers = [];
+ self.pointerInitializersInstance = [];
+ self.pointerInitializersDevice = [];
+
+ #
+ # Write header protection
+ filename = self.genOpts.directory + '/' + 'vulkan_ext.h'
+ self.outFileHeader = open(filename, 'w', encoding='utf-8')
+
+ write('#ifndef VULKAN_EXT_H', file=self.outFileHeader)
+ write('#define VULKAN_EXT_H', file=self.outFileHeader)
+ write('', file=self.outFileHeader)
+ write('#ifdef __cplusplus', file=self.outFileHeader)
+ write('extern "C" {', file=self.outFileHeader)
+ write('#endif', file=self.outFileHeader)
+
+ #
+ # User-supplied prefix text, if any (list of strings)
+ if (genOpts.prefixText):
+ for s in genOpts.prefixText:
+ write(s, file=self.outFile)
+ write(s, file=self.outFileHeader)
+
+ write(doc, file=self.outFileHeader)
+
+ write('#include <vulkan/vulkan.h>', file=self.outFile)
+ self.newline()
+
+ write('#include <vulkan/vulkan_core.h>', file=self.outFileHeader)
+ write('', file=self.outFileHeader)
+
+ write('void vkExtInitInstance(VkInstance instance);', file=self.outFileHeader)
+ write('void vkExtInitDevice(VkDevice device);', file=self.outFileHeader)
+ write('', file=self.outFileHeader)
+
+ def endFile(self):
+ for pointer in self.pointers:
+ write(pointer, file=self.outFile)
+
+ self.newline()
+
+ write('void vkExtInitInstance(VkInstance instance)\n{', file=self.outFile)
+ for pointerInitializer in self.pointerInitializersInstance:
+ write(pointerInitializer, file=self.outFile)
+ write('}', file=self.outFile)
+
+ self.newline()
+
+ write('void vkExtInitDevice(VkDevice device)\n{', file=self.outFile)
+ for pointerInitializer in self.pointerInitializersDevice:
+ write(pointerInitializer, file=self.outFile)
+ write('}', file=self.outFile)
+
+ self.newline()
+
+ #Finish header file
+ write('#ifdef __cplusplus', file=self.outFileHeader)
+ write('}', file=self.outFileHeader)
+ write('#endif', file=self.outFileHeader)
+ write('', file=self.outFileHeader)
+ write('#endif', file=self.outFileHeader)
+ self.outFileHeader.close()
+
+ # Finish processing in superclass
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ # Start processing in superclass
+ OutputGenerator.beginFeature(self, interface, emit)
+
+ # Accumulate function pointers and function pointer initialization
+ self.featurePointers = []
+ self.featurePointerInitializersInstance = []
+ self.featurePointerInitializersDevice = []
+
+ def endFeature(self):
+ # Add feature to global list with protectFeature
+ if (self.emit and self.featurePointers):
+ if (self.genOpts.protectFeature):
+ self.pointers.append('#ifdef ' + self.featureName)
+ self.pointerInitializersInstance.append('#ifdef ' + self.featureName)
+ self.pointerInitializersDevice.append('#ifdef ' + self.featureName)
+
+ if (self.featureExtraProtect != None):
+ self.pointers.append('#ifdef ' + self.featureExtraProtect)
+ self.pointerInitializersInstance.append('#ifndef ' + self.featureName)
+ self.pointerInitializersDevice.append('#ifndef ' + self.featureName)
+
+ self.pointers += self.featurePointers;
+ self.pointerInitializersInstance += self.featurePointerInitializersInstance;
+ self.pointerInitializersDevice += self.featurePointerInitializersDevice;
+
+ if (self.featureExtraProtect != None):
+ self.pointers.append('#endif /* ' + self.featureExtraProtect + ' */')
+ self.pointerInitializersInstance.append('#endif /* ' + self.featureExtraProtect + ' */')
+ self.pointerInitializersDevice.append('#endif /* ' + self.featureExtraProtect + ' */')
+ if (self.genOpts.protectFeature):
+ self.pointers.append('#endif /* ' + self.featureName + ' */')
+ self.pointerInitializersInstance.append('#endif /* ' + self.featureName + ' */')
+ self.pointerInitializersDevice.append('#endif /* ' + self.featureName + ' */')
+
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+ #
+ # Type generation
+ def genType(self, typeinfo, name, alias):
+ pass
+
+ def genStruct(self, typeinfo, typeName, alias):
+ pass
+
+ def genGroup(self, groupinfo, groupName, alias):
+ pass
+
+ def genEnum(self, enuminfo, name, alias):
+ pass
+
+ #
+ # Command generation
+ def genCmd(self, cmdinfo, name, alias):
+ OutputGenerator.genCmd(self, cmdinfo, name, alias)
+
+ #
+ decls = self.makeStub(cmdinfo.elem)
+ self.featurePointerInitializersInstance.append(decls[0])
+ self.featurePointerInitializersDevice.append(decls[1])
+ self.featurePointers.append(decls[2])
+
+ #
+ # makeStub - return static declaration for function pointer and initialization of function pointer
+ # as a two-element list of strings.
+ # cmd - Element containing a <command> tag
+ def makeStub(self, cmd):
+ """Generate a stub function pointer <command> Element"""
+ proto = cmd.find('proto')
+ params = cmd.findall('param')
+ name = cmd.find('name')
+
+ # Begin accumulating prototype and typedef strings
+ pfnDecl = 'static '
+ pfnDecl += noneStr(proto.text)
+
+ # Find the name tag and generate the function pointer and function pointer initialization code
+ nameTag = proto.find('name')
+ tail = noneStr(nameTag.tail)
+ returnType = noneStr(proto.find('type').text)
+
+ type = self.makeFunctionPointerType(nameTag.text, tail)
+
+ # For each child element, if it is a <name> wrap in appropriate
+ # declaration. Otherwise append its contents and tail con#tents.
+ stubDecl = ''
+ for elem in proto:
+ text = noneStr(elem.text)
+ tail = noneStr(elem.tail)
+ if (elem.tag == 'name'):
+ name = self.makeProtoName(text, tail)
+ stubDecl += name
+ else:
+ stubDecl += text + tail
+
+ pfnName = self.makeFunctionPointerName(nameTag.text, noneStr(tail));
+ pfnDecl += type + ' ' + pfnName + ';'
+
+ # Now generate the stub function
+ pfnDecl += '\n'
+
+ # Now add the parameter declaration list, which is identical
+ # for prototypes and typedefs. Concatenate all the text from
+ # a <param> node without the tags. No tree walking required
+ # since all tags are ignored.
+ n = len(params)
+ paramdecl = '(\n'
+
+ pfnCall = '\n{\n ' + ('return ', '')[returnType == 'void'] + pfnName + '(\n'
+ # Indented parameters
+ if n > 0:
+ indentCallParam = '(\n'
+ indentdecl = '(\n'
+ for i in range(0,n):
+ callParam = ''
+
+ paramdecl += self.makeCParamDecl(params[i], self.genOpts.alignFuncParam)
+ pfnCall += self.makeCCallParam(params[i], self.genOpts.alignFuncParam)
+ if (i < n - 1):
+ paramdecl += ',\n'
+ pfnCall += ',\n'
+ else:
+ paramdecl += ')'
+ pfnCall += '\n );\n'
+ indentdecl += paramdecl
+ indentCallParam += pfnCall
+ else:
+ indentdecl = '(void);'
+
+ pfnCall += '}\n'
+
+ featureInstance = ' ' + pfnName + ' = ('+type+')vkGetInstanceProcAddr(instance, "' + name + '");'
+ featureDevice = ' ' + pfnName + ' = ('+type+')vkGetDeviceProcAddr(device, "' + name + '");'
+ return [featureInstance, featureDevice , pfnDecl + stubDecl + paramdecl + pfnCall]
+
+ # Return function pointer type for given function
+ def makeFunctionPointerType(self, name, tail):
+ return 'PFN_' + name + tail
+
+ # Return name of static variable which stores the function pointer for the given function
+ def makeFunctionPointerName(self, name, tail):
+ return 'pfn_' + name + tail
+
+ #
+ # makeCParamDecl - return a string which is an indented, formatted
+ # declaration for a <param> or <member> block (e.g. function parameter
+ # or structure/union member).
+ # param - Element (<param> or <member>) to format
+ # aligncol - if non-zero, attempt to align the nested <name> element
+ # at this column
+ def makeCCallParam(self, param, aligncol):
+ return ' ' + param.find('name').text
+
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/findBalance.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/findBalance.py
new file mode 100755
index 00000000000..06738519c41
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/findBalance.py
@@ -0,0 +1,162 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# fixupRef.py - replace old // refBegin .. // refEnd syntax with new
+# open block syntax
+#
+# Usage: fixupRef.py [-outdir path] [-overwrite] files
+
+from reflib import *
+import argparse, copy, io, os, pdb, re, string, sys
+
+def prefix(depth):
+ return ' ' * depth
+
+openPat = re.compile('^\[open,(?P<attribs>refpage=.*)\]')
+ifdefPat = re.compile('^if(n|)def::(?P<condition>.*)\[(?P<text>.*)\]')
+endifPat = re.compile('^endif::(?P<condition>.*)\[\]')
+
+# Look for imbalanced block delimiters and conditionals
+# specFile - filename to examine
+def findBalance(specFile):
+ file = loadFile(specFile)
+ if file == None:
+ return
+
+ # blocks[] is a stack of nesting constructs, each of which is
+ # [ '--', line, None ] for a -- delimiter on line
+ # [ 'ifdef', line, condition] for an ifdef or ifndef on line
+ blocks = []
+
+ line = 1
+
+ for str in file:
+ blockDepth = len(blocks)
+ if blockDepth > 0:
+ thisBlock = blocks[blockDepth-1]
+ blockType = thisBlock[0]
+ blockLine = thisBlock[1]
+ blockCondition = thisBlock[2]
+ else:
+ thisBlock = None
+ blockType = None
+ blockLine = None
+ blockCondition = None
+
+ if str.rstrip() == '--':
+ if (blockDepth > 0 and blockType == '--'):
+ print(prefix(blockDepth - 1) +
+ 'Closing -- block opened @', blockLine,
+ '-> new block depth =', blockDepth - 1)
+ blocks.pop()
+ else:
+ print(prefix(blockDepth) +
+ 'Opening -- block @', line,
+ '-> new block depth:', blockDepth + 1)
+ blocks.append([ '--', line, None ])
+ line = line + 1
+ continue
+
+ matches = beginPat.search(str)
+ if matches != None:
+ # print('Matched [open pattern @', line, ':', str.rstrip())
+ line = line + 1
+ continue
+
+ matches = ifdefPat.search(str)
+ if matches != None:
+ condition = matches.group('condition')
+ text = matches.group('text')
+
+ if text != '':
+ print('Matched self-closing if(n)def pattern @', line,
+ 'condition:', condition, 'text:', text)
+ else:
+ print(prefix(blockDepth) +
+ 'Opening if(n)def block @', line,
+ '-> new block depth =', blockDepth + 1,
+ 'condition:', condition)
+ blocks.append([ 'ifdef', line, condition ])
+
+ line = line + 1
+ continue
+
+ matches = endifPat.search(str)
+ if matches != None:
+ condition = matches.group('condition')
+
+ if (blockDepth > 0):
+ if blockType == 'ifdef':
+ # Try closing an ifdef/ifndef block
+ if blockCondition != condition:
+ print('** WARNING:', specFile,
+ 'endif @', blockLine,
+ 'block depth:', blockDepth,
+ 'condition', condition,
+ 'does not match ifdef/ifndef @',
+ blockLine, 'condition', blockCondition)
+
+ print(prefix(blockDepth - 1) +
+ 'Closing endif block @', line,
+ '-> new block depth =', blockDepth - 1)
+ blocks.pop()
+ elif blockType == '--':
+ # An overlap!
+ print('** ERROR:', specFile, 'endif @', line,
+ 'block depth:', blockDepth,
+ 'overlaps -- block start @', blockLine)
+ else:
+ # Should never get here
+ print('** ERROR:', specFile,
+ 'block depth:', blockDepth,
+ 'unknown open block type:', blockType)
+ else:
+ # Unlikely error condition from bad markup
+ print('** ERROR:', specFile,
+ 'block depth:', blockDepth,
+ 'endif @', line, 'with no matching open block')
+
+ line = line + 1
+ continue
+
+ line = line + 1
+
+ blockDepth = len(blocks)
+ if blockDepth > 0:
+ print('** ERROR:', specFile, 'still in open block at EOF:',
+ 'block depth =', blockDepth,
+ 'block type:', blocks[blockDepth-1][0])
+
+if __name__ == '__main__':
+ global genDict
+ genDict = {}
+
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-diag', action='store', dest='diagFile',
+ help='Set the diagnostic file')
+ parser.add_argument('-warn', action='store', dest='warnFile',
+ help='Set the warning file')
+ parser.add_argument('-log', action='store', dest='logFile',
+ help='Set the log file for both diagnostics and warnings')
+ parser.add_argument('files', metavar='filename', nargs='*',
+ help='a filename to extract ref pages from')
+ parser.add_argument('--version', action='version', version='%(prog)s 1.0')
+
+ results = parser.parse_args()
+
+ setLogFile(True, True, results.logFile)
+ setLogFile(True, False, results.diagFile)
+ setLogFile(False, True, results.warnFile)
+
+ skipped = set()
+ for file in results.files:
+ findBalance(file)
+
+ if len(skipped) > 0:
+ print('Files containing skipped feature blocks:')
+ for file in sorted(skipped):
+ print('\t' + file)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/fixupRef.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/fixupRef.py
new file mode 100755
index 00000000000..140fff02df0
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/fixupRef.py
@@ -0,0 +1,202 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# fixupRef.py - replace old // refBegin .. // refEnd syntax with new
+# open block syntax
+#
+# Usage: fixupRef.py [-outdir path] [-overwrite] files
+
+from reflib import *
+from vkapi import *
+import argparse, copy, io, os, pdb, re, string, sys
+
+# Return 'None' for None, the string otherwise
+def noneStr(str):
+ if str == None:
+ return '(None)'
+ else:
+ return str
+
+# Escape single quotes in a string for asciidoc
+def escapeQuote(str):
+ return str.replace("'", "\'")
+
+# Start a refpage open block
+def openBlock(pi, fp):
+ if pi.refs != '':
+ print("[open,refpage='" + pi.name +
+ "',desc='" + pi.desc +
+ "',type='" + pi.type +
+ "',xrefs='" + pi.refs + "']",
+ file=fp)
+ else:
+ print("[open,refpage='" + pi.name +
+ "',desc='" + pi.desc +
+ "',type='" + pi.type + "']",
+ file=fp)
+ print('--', file=fp)
+
+# End a refpage open block
+def closeBlock(pi, fp):
+ print('--', file=fp)
+ # Just for finding block ends while debugging
+ # print("// end [open,refpage='" + pi.name + "']", file=fp)
+
+# Replace old // refBegin .. // refEnd references in an asciidoc
+# file with open blocks, per # ??? .
+# specFile - filename to extract from
+# outDir - output directory to write updated file to, if not overwritten
+# overwrite - True if the file should be overwritten in place
+# skipped - set of filenames containing commands which were not
+# rewritten with open blocks (e.g. enums). Updated in place.
+def replaceRef(specFile, outDir, overwrite = False, skipped = set()):
+ file = loadFile(specFile)
+ if file == None:
+ return
+
+ # Save the path to this file for later use in rewriting relative includes
+ specDir = os.path.dirname(os.path.abspath(specFile))
+
+ pageMap = findRefs(file)
+ logDiag(specFile + ': found', len(pageMap.keys()), 'potential pages')
+
+ sys.stderr.flush()
+
+ # Fix up references in pageMap
+ fixupRefs(pageMap, specFile, file)
+
+ # Map the page info dictionary into a dictionary of actions
+ # keyed by line number they are performed on/after:
+ # 'action' : 'begin' or 'end'. What to do on a refBegin or refEnd line
+ # 'replace': True if this line needs to be replaced
+ # 'name' : Name of the ref page being defined
+ # 'desc' : One-line description of the ref page being defined
+ # 'type' : Type of the ref page being defined, 'structs', 'protos', etc.
+ # 'refs' : Space-separated string of cross-referenced pages
+
+ actions = { }
+
+ for name in pageMap.keys():
+ pi = pageMap[name]
+
+ # Cleanup parameters for output
+ pi.name = noneStr(pi.name)
+ pi.desc = escapeQuote(noneStr(pi.desc))
+
+ if pi.extractPage:
+ if (file[pi.begin][0:11] == '// refBegin'):
+ # Replace line
+ actions[pi.begin] = {
+ 'action' : 'begin',
+ 'replace' : True,
+ 'pageinfo' : pi
+ }
+ else:
+ # Insert line
+ actions[pi.begin] = {
+ 'action' : 'begin',
+ 'replace' : False,
+ 'pageinfo' : pi
+ }
+
+ if (file[pi.end][0:9] == '// refEnd'):
+ # Replace line
+ actions[pi.end] = {
+ 'action' : 'end',
+ 'replace' : True,
+ 'pageinfo' : pi
+ }
+ else:
+ # Insert line
+ actions[pi.end] = {
+ 'action' : 'end',
+ 'replace' : False,
+ 'pageinfo' : pi
+ }
+ else:
+ logWarn('Skipping replacement for', pi.name, 'at', specFile,
+ 'line', pi.begin)
+ print('Skipping replacement for', pi.name, 'at', specFile,
+ 'line', pi.begin)
+ printPageInfo(pi, file)
+ skipped.add(specFile)
+
+ if overwrite:
+ pageName = specFile
+ else:
+ pageName = outDir + '/' + os.path.basename(specFile)
+
+ fp = open(pageName, 'w', encoding='utf-8')
+
+ line = 0
+ for text in file:
+ if line in actions.keys():
+ action = actions[line]['action']
+ replace = actions[line]['replace']
+ pi = actions[line]['pageinfo']
+
+ logDiag('ACTION:', action, 'REPLACE:', replace, 'at line', line)
+ logDiag('PageInfo of action:')
+ printPageInfo(pi, file)
+
+ if action == 'begin':
+ openBlock(pi, fp)
+ if not replace:
+ print(text, file=fp, end='')
+ elif action == 'end':
+ if not replace:
+ print(text, file=fp, end='')
+ closeBlock(pi, fp)
+ else:
+ print('ERROR: unrecognized action:', action, 'in',
+ specFile, 'at line', line)
+ print(text, file=fp, end='')
+ else:
+ print(text, file=fp, end='')
+ line = line + 1
+
+ fp.close()
+
+ #for line in sorted(actions.keys()):
+ # action = actions[line]
+ # print('action at line', line, '\t',
+ # action[0], action[1], action[2])
+
+if __name__ == '__main__':
+ global genDict
+ genDict = {}
+
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-diag', action='store', dest='diagFile',
+ help='Set the diagnostic file')
+ parser.add_argument('-warn', action='store', dest='warnFile',
+ help='Set the warning file')
+ parser.add_argument('-log', action='store', dest='logFile',
+ help='Set the log file for both diagnostics and warnings')
+ parser.add_argument('-outdir', action='store', dest='outDir',
+ default='out',
+ help='Set the base directory in which pages are generated')
+ parser.add_argument('-overwrite', action='store_true',
+ help='Overwrite input filenames instead of writing different output filenames')
+ parser.add_argument('files', metavar='filename', nargs='*',
+ help='a filename to extract ref pages from')
+ parser.add_argument('--version', action='version', version='%(prog)s 1.0')
+
+ results = parser.parse_args()
+
+ setLogFile(True, True, results.logFile)
+ setLogFile(True, False, results.diagFile)
+ setLogFile(False, True, results.warnFile)
+
+ skipped = set()
+ for file in results.files:
+ replaceRef(file, results.outDir, results.overwrite, skipped)
+
+ if len(skipped) > 0:
+ print('Files containing skipped feature blocks:')
+ for file in sorted(skipped):
+ print('\t' + file)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/insertTags.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/insertTags.py
new file mode 100755
index 00000000000..62bf7dbe6b3
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/insertTags.py
@@ -0,0 +1,102 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# insertTags.py - insert // refBegin and // refEnd tags in Vulkan
+# spec source files.
+#
+# Usage: insertTags.py output-dir files
+
+# Short descriptions of ref pages, if not found
+from refDesc import *
+
+# Utility functions
+from reflib import *
+import copy, os, pdb, re, string, sys
+
+# Insert informative tags in a spec asciidoc source file
+# specFile - filename to add tags to
+# baseDir - output directory to generate page in
+def insertTags(specFile, baseDir):
+ file = loadFile(specFile)
+ if (file == None):
+ return
+ pageMap = findRefs(file)
+ logDiag(specFile + ': found', len(pageMap.keys()), 'potential pages')
+
+ # Fix up references in pageMap
+ fixupRefs(pageMap, specFile, file)
+
+ # Proceed backwards through the file, inserting
+ # // refBegin name desc
+ # lines where they are meaningful
+
+ logDiag('Table of pages found:')
+ logDiag('---------------------')
+ for name in pageMap.keys():
+ printPageInfo(pageMap[name], file)
+
+ line = len(file) - 1
+ while (line >= 0):
+ # If this is a valid begin line without a description, and a
+ # description exists in refDesc, add it.
+ for name in pageMap.keys():
+ pi = pageMap[name]
+ if (pi.begin == line):
+ if (not name in refDesc.keys()):
+ if (pi.desc != None):
+ logDiag('Description already exists, but no refDesc found for', name, 'at', specFile + ':' + str(line))
+ else:
+ if (pi.embed):
+ logDiag('No refDesc found (this is OK) for embedded', name, 'at', specFile + ':' + str(line))
+ else:
+ logWarn('No refDesc found for', name, 'at', specFile + ':' + str(line))
+ continue
+
+ # New or replacement refBegin line, with short description
+ newLine = '// refBegin ' + name + ' - ' + refDesc[name] + '\n'
+
+ if (pi.desc == None):
+ logDiag('Adding description for', name, 'at', specFile + ':' + str(line))
+
+ # If there is already a refBegin on this line, replace it.
+ # Otherwise, insert one.
+ if (file[line].find('// refBegin') == 0):
+ logDiag('Replacing existing refBegin without description for', name, 'at', specFile + ':' + str(line))
+ file[line] = newLine
+ else:
+ logDiag('Inserting new refBegin at', specFile + ':' + str(line))
+ # Add a blank line after the comment if it is new
+ file.insert(line, newLine)
+ file.insert(line, '\n')
+ else:
+ if (pi.desc[-1] == '.'):
+ pi.desc = pi.desc[0:-1]
+ if (pi.desc == refDesc[name]):
+ logDiag('Not replacing description for', name, 'at', specFile + ':' + str(line), '- MATCHES existing one')
+ else:
+ logWarn('Replacing existing refBegin WITH description for', name, 'at', specFile + ':' + str(line))
+ file[line] = newLine
+ # logWarn('\t refDesc: ', refDesc[name])
+ # logWarn('\tfile desc: ', pi.desc)
+
+ line = line - 1
+
+ pageName = baseDir + '/' + os.path.basename(specFile)
+ logDiag('Creating output file', pageName)
+ fp = open(pageName, 'w', encoding='utf-8')
+ fp.writelines(file)
+ fp.close()
+
+
+if __name__ == '__main__':
+ logDiag('In main!')
+
+ baseDir = 'man'
+ follow = False
+ if (len(sys.argv) > 2):
+ baseDir = sys.argv[1]
+ for file in sys.argv[2:]:
+ insertTags(file, baseDir)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/realign.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/realign.py
new file mode 100755
index 00000000000..17368980b8a
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/realign.py
@@ -0,0 +1,48 @@
+#!/usr/bin/python3
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Usage: realign [infile] > outfile
+# Used to realign XML tags in the Vulkan registry after it is operated on by
+# some other filter, since whitespace inside a tag is not part of the
+# internal representation.
+
+import copy, sys, string, re
+
+def realignXML(fp):
+ patterns = [
+ [ r'(^ *\<type .*)(category=[\'"]bitmask[\'"].*)', 58 ],
+ [ r'(^ *\<enum [bv].*)(name=.*)', 28 ],
+ [ r'(^ *\<enum [bv].*)(comment=.*)', 85 ]
+ ]
+
+ # Assemble compiled expressions to match and alignment columns
+ numpat = len(patterns)
+ regexp = [ re.compile(patterns[i][0]) for i in range(0,numpat)]
+ column = [ patterns[i][1] for i in range(0,numpat)]
+
+ lines = fp.readlines()
+ for line in lines:
+ emitted = False
+ for i in range(0,len(patterns)):
+ match = regexp[i].match(line)
+ if (match):
+ if (not emitted):
+ #print('# While processing line: ' + line, end='')
+ emitted = True
+ #print('# matched expression: ' + patterns[i][0])
+ #print('# clause 1 = ' + match.group(1))
+ #print('# clause 2 = ' + match.group(2))
+ line = match.group(1).ljust(column[i]) + match.group(2)
+ if (emitted):
+ print(line)
+ else:
+ print(line, end='')
+
+if __name__ == '__main__':
+ if (len(sys.argv) > 1):
+ realignXML(open(sys.argv[1], 'r', encoding='utf-8'))
+ else:
+ realignXML(sys.stdin)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/refDesc.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/refDesc.py
new file mode 100644
index 00000000000..9f7bb37080d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/Retired/refDesc.py
@@ -0,0 +1,356 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+refDesc = {}
+
+# These are extracted from the original handwritten ref pages
+# This is a one-time measure to inject // refBegin markup into the spec.
+
+refDesc['vkAcquireNextImageKHR'] = 'Retrieve the index of the next available presentable image'
+refDesc['vkAllocateCommandBuffers'] = 'Allocate command buffers from an existing command pool'
+refDesc['vkAllocateDescriptorSets'] = 'Allocate one or more descriptor sets'
+refDesc['vkAllocateMemory'] = 'Allocate GPU memory'
+refDesc['VkAllocationCallbacks'] = 'Structure containing callback function pointers for memory allocation'
+refDesc['vkBeginCommandBuffer'] = 'Start recording a command buffer'
+refDesc['vkBindBufferMemory'] = 'Bind device memory to a buffer object'
+refDesc['vkBindImageMemory'] = 'Bind device memory to an image object'
+refDesc['VkBufferCreateFlags'] = 'Buffer object creation flags'
+refDesc['VkBufferCreateInfo'] = 'Structure specifying the parameters of a newly created buffer object'
+refDesc['VkBufferMemoryBarrier'] = 'Structure specifying the parameters of a buffer memory barrier'
+refDesc['VkBufferUsageFlags'] = 'Buffer object usage flags'
+refDesc['vkCmdBeginQuery'] = 'Begin a query'
+refDesc['vkCmdBeginRenderPass'] = 'Begin a new render pass'
+refDesc['vkCmdBindDescriptorSets'] = 'Binds descriptor sets to a command buffer'
+refDesc['vkCmdBindIndexBuffer'] = 'Bind an index buffer to a command buffer'
+refDesc['vkCmdBindPipeline'] = 'Bind a pipeline object to a command buffer'
+refDesc['vkCmdBindVertexBuffers'] = 'Bind vertex buffers to a command buffer'
+refDesc['vkCmdBlitImage'] = 'Copy regions of an image, potentially performing format conversion,'
+refDesc['vkCmdClearAttachments'] = 'Clear regions within currently bound framebuffer attachments'
+refDesc['vkCmdClearColorImage'] = 'Clear regions of a color image'
+refDesc['vkCmdClearDepthStencilImage'] = 'Fill regions of a combined depth-stencil image'
+refDesc['vkCmdCopyBufferToImage'] = 'Copy data from a buffer into an image'
+refDesc['vkCmdCopyBuffer'] = 'Copy data between buffer regions'
+refDesc['vkCmdCopyImageToBuffer'] = 'Copy image data into a buffer'
+refDesc['vkCmdCopyImage'] = 'Copy data between images'
+refDesc['vkCmdCopyQueryPoolResults'] = 'Copy the results of queries in a query pool to a buffer object'
+refDesc['vkCmdDispatchIndirect'] = 'Dispatch compute work items using indirect parameters'
+refDesc['vkCmdDispatch'] = 'Dispatch compute work items'
+refDesc['vkCmdDrawIndexedIndirect'] = 'Perform an indexed indirect draw'
+refDesc['vkCmdDrawIndexed'] = 'Issue an indexed draw into a command buffer'
+refDesc['vkCmdDrawIndirect'] = 'Issue an indirect draw into a command buffer'
+refDesc['vkCmdDraw'] = 'Draw primitives'
+refDesc['vkCmdEndQuery'] = 'Ends a query'
+refDesc['vkCmdEndRenderPass'] = 'End the current render pass'
+refDesc['vkCmdExecuteCommands'] = 'Execute a secondary command buffer from a primary command buffer'
+refDesc['vkCmdFillBuffer'] = 'Fill a region of a buffer with a fixed value'
+refDesc['vkCmdNextSubpass'] = 'Transition to the next subpass of a render pass'
+refDesc['vkCmdPipelineBarrier'] = 'Insert a set of execution and memory barriers'
+refDesc['vkCmdPushConstants'] = 'Update the values of push constants'
+refDesc['vkCmdResetEvent'] = 'Reset an event object to non-signaled state'
+refDesc['vkCmdResetQueryPool'] = 'Reset queries in a query pool'
+refDesc['vkCmdResolveImage'] = 'Resolve regions of an image'
+refDesc['vkCmdSetBlendConstants'] = 'Set the values of blend constants'
+refDesc['vkCmdSetDepthBias'] = 'Set the depth bias dynamic state'
+refDesc['vkCmdSetDepthBounds'] = 'Set the depth bounds test values for a command buffer'
+refDesc['vkCmdSetEvent'] = 'Set an event object to signaled state'
+refDesc['vkCmdSetLineWidth'] = 'Set the dynamic line width state'
+refDesc['vkCmdSetScissor'] = 'Set the dynamic scissor rectangles on a command buffer'
+refDesc['vkCmdSetStencilCompareMask'] = 'Set the stencil compare mask dynamic state'
+refDesc['vkCmdSetStencilReference'] = 'Set the stencil reference dynamic state'
+refDesc['vkCmdSetStencilWriteMask'] = 'Set the stencil write mask dynamic state'
+refDesc['vkCmdSetViewport'] = 'Set the viewport on a command buffer'
+refDesc['vkCmdUpdateBuffer'] = 'Update a buffer\'s contents from host memory'
+refDesc['vkCmdWaitEvents'] = 'Wait for one or more events and insert a set of memory'
+refDesc['vkCmdWriteTimestamp'] = 'Write a device timestamp into a query object'
+refDesc['VkCommandBufferAllocateInfo'] = 'Structure specifying the allocation parameters for command buffer object'
+refDesc['vkCreateAndroidSurfaceKHR'] = 'Create a slink:VkSurfaceKHR object for an Android native window'
+refDesc['vkCreateBuffer'] = 'Create a new buffer object'
+refDesc['vkCreateBufferView'] = 'Create a new buffer view object'
+refDesc['vkCreateCommandPool'] = 'Create a new command pool object'
+refDesc['vkCreateComputePipelines'] = 'Creates a new compute pipeline object'
+refDesc['vkCreateDescriptorPool'] = 'Creates a descriptor pool object'
+refDesc['vkCreateDescriptorSetLayout'] = 'Create a new descriptor set layout'
+refDesc['vkCreateDevice'] = 'Create a new device instance'
+refDesc['vkCreateDisplayModeKHR'] = 'Create a display mode'
+refDesc['vkCreateDisplayPlaneSurfaceKHR'] = 'Create a slink:VkSurfaceKHR structure representing a display plane and mode'
+refDesc['vkCreateEvent'] = 'Create a new event object'
+refDesc['vkCreateFence'] = 'Create a new fence object'
+refDesc['vkCreateFramebuffer'] = 'Create a new framebuffer object'
+refDesc['vkCreateGraphicsPipelines'] = 'Create graphics pipelines'
+refDesc['vkCreateImage'] = 'Create a new image object'
+refDesc['vkCreateImageView'] = 'Create an image view from an existing image'
+refDesc['vkCreateInstance'] = 'Create a new Vulkan instance'
+refDesc['vkCreateMirSurfaceKHR'] = 'Create a slink:VkSurfaceKHR object for a Mir window'
+refDesc['vkCreatePipelineCache'] = 'Creates a new pipeline cache'
+refDesc['vkCreatePipelineLayout'] = 'Creates a new pipeline layout object'
+refDesc['vkCreateQueryPool'] = 'Create a new query pool object'
+refDesc['vkCreateRenderPass'] = 'Create a new render pass object'
+refDesc['vkCreateSampler'] = 'Create a new sampler object'
+refDesc['vkCreateSemaphore'] = 'Create a new queue semaphore object'
+refDesc['vkCreateShaderModule'] = 'Creates a new shader module object'
+refDesc['vkCreateSharedSwapchainsKHR'] = 'Create multiple swapchains that share presentable images'
+refDesc['vkCreateSwapchainKHR'] = 'Create a swapchain'
+refDesc['vkCreateWaylandSurfaceKHR'] = 'Create a slink:VkSurfaceKHR object for a Wayland window'
+refDesc['vkCreateXcbSurfaceKHR'] = 'Create a slink:VkSurfaceKHR object for a X11 window, using the XCB client-side library'
+refDesc['vkCreateXlibSurfaceKHR'] = 'Create a slink:VkSurfaceKHR object for an X11 window, using the Xlib client-side library'
+refDesc['VkDescriptorSetAllocateInfo'] = 'Structure specifying the allocation parameters for descriptor sets'
+refDesc['VkDescriptorType'] = 'Specifies the type of a descriptor in a descriptor set'
+refDesc['vkDestroyBuffer'] = 'Destroy a buffer object'
+refDesc['vkDestroyBufferView'] = 'Destroy a buffer view object'
+refDesc['vkDestroyCommandPool'] = 'Destroy a command pool object'
+refDesc['vkDestroyDescriptorPool'] = 'Destroy a descriptor pool object'
+refDesc['vkDestroyDescriptorSetLayout'] = 'Destroy a descriptor set layout object'
+refDesc['vkDestroyDevice'] = 'Destroy a logical device'
+refDesc['vkDestroyEvent'] = 'Destroy an event object'
+refDesc['vkDestroyFence'] = 'Destroy a fence object'
+refDesc['vkDestroyFramebuffer'] = 'Destroy a framebuffer object'
+refDesc['vkDestroyImage'] = 'Destroy an image object'
+refDesc['vkDestroyImageView'] = 'Destroy an image view object'
+refDesc['vkDestroyInstance'] = 'Destroy an instance of Vulkan'
+refDesc['vkDestroyPipelineCache'] = 'Destroy a pipeline cache object'
+refDesc['vkDestroyPipelineLayout'] = 'Destroy a pipeline layout object'
+refDesc['vkDestroyPipeline'] = 'Destroy a pipeline object'
+refDesc['vkDestroyQueryPool'] = 'Destroy a query pool object'
+refDesc['vkDestroyRenderPass'] = 'Destroy a render pass object'
+refDesc['vkDestroySampler'] = 'Destroy a sampler object'
+refDesc['vkDestroySemaphore'] = 'Destroy a semaphore object'
+refDesc['vkDestroyShaderModule'] = 'Destroy a shader module'
+refDesc['vkDestroySurfaceKHR'] = 'Destroy a VkSurfaceKHR object'
+refDesc['vkDestroySwapchainKHR'] = 'Destroy a swapchain object'
+refDesc['vkDeviceWaitIdle'] = 'Wait for a device to become idle'
+refDesc['vkEndCommandBuffer'] = 'Finish recording a command buffer'
+refDesc['vkEnumerateDeviceExtensionProperties'] = 'Returns properties of available physical device extensions'
+refDesc['vkEnumerateDeviceLayerProperties'] = 'Returns properties of available physical device layers'
+refDesc['vkEnumerateInstanceExtensionProperties'] = 'Returns up to requested number of global extension properties'
+refDesc['vkEnumerateInstanceLayerProperties'] = 'Returns up to requested number of global layer properties'
+refDesc['vkEnumeratePhysicalDevices'] = 'Enumerates the physical devices accessible to a Vulkan instance'
+refDesc['vkFlushMappedMemoryRanges'] = 'Flush mapped memory ranges'
+refDesc['VkFormatFeatureFlags'] = 'Capability flags of a particular format'
+refDesc['vkFreeCommandBuffers'] = 'Free command buffers'
+refDesc['vkFreeDescriptorSets'] = 'Free one or more descriptor sets'
+refDesc['vkFreeMemory'] = 'Free GPU memory'
+refDesc['vkGetBufferMemoryRequirements'] = 'Returns the memory requirements for specified Vulkan object'
+refDesc['vkGetDeviceMemoryCommitment'] = 'Query the current commitment for a VkDeviceMemory'
+refDesc['vkGetDeviceProcAddr'] = 'Return a function pointer for a command'
+refDesc['vkGetDeviceQueue'] = 'Get a queue handle from a device'
+refDesc['vkGetDisplayModePropertiesKHR'] = 'Query the set of mode properties supported by the display'
+refDesc['vkGetDisplayPlaneCapabilitiesKHR'] = 'Query capabilities of a mode and plane combination'
+refDesc['vkGetDisplayPlaneSupportedDisplaysKHR'] = 'Query the list of displays a plane supports'
+refDesc['vkGetEventStatus'] = 'Retrieve the status of an event object'
+refDesc['vkGetFenceStatus'] = 'Return the status of a fence'
+refDesc['vkGetImageMemoryRequirements'] = 'Returns the memory requirements for specified Vulkan object'
+refDesc['vkGetImageSparseMemoryRequirements'] = 'Query the memory requirements for a sparse image'
+refDesc['vkGetImageSubresourceLayout'] = 'Retrieve information about an image subresource'
+refDesc['vkGetInstanceProcAddr'] = 'Return a function pointer for a command'
+refDesc['vkGetPhysicalDeviceDisplayPlanePropertiesKHR'] = 'Query the plane properties'
+refDesc['vkGetPhysicalDeviceDisplayPropertiesKHR'] = 'Query information about the available displays'
+refDesc['vkGetPhysicalDeviceFeatures'] = 'Reports capabilities of a physical device'
+refDesc['vkGetPhysicalDeviceFormatProperties'] = 'Lists physical device\'s format capabilities'
+refDesc['vkGetPhysicalDeviceImageFormatProperties'] = 'Lists physical device\'s image format capabilities'
+refDesc['vkGetPhysicalDeviceMemoryProperties'] = 'Reports memory information for the specified physical device'
+refDesc['vkGetPhysicalDeviceMirPresentationSupportKHR'] = 'Query physical device for presentation to Mir'
+refDesc['vkGetPhysicalDeviceProperties'] = 'Returns properties of a physical device'
+refDesc['vkGetPhysicalDeviceQueueFamilyProperties'] = 'Reports properties of the queues of the specified physical device'
+refDesc['vkGetPhysicalDeviceSparseImageFormatProperties'] = 'Retrieve properties of an image format applied to sparse images'
+refDesc['vkGetPhysicalDeviceSurfaceCapabilitiesKHR'] = 'Query surface capabilities'
+refDesc['vkGetPhysicalDeviceSurfaceFormatsKHR'] = 'Query color formats supported by surface'
+refDesc['vkGetPhysicalDeviceSurfacePresentModesKHR'] = 'Query supported presentation modes'
+refDesc['vkGetPhysicalDeviceSurfaceSupportKHR'] = 'Query if presentation is supported'
+refDesc['vkGetPhysicalDeviceWaylandPresentationSupportKHR'] = 'Query physical device for presentation to Wayland'
+refDesc['vkGetPhysicalDeviceXcbPresentationSupportKHR'] = 'Query physical device for presentation to X11 server using XCB'
+refDesc['vkGetPhysicalDeviceXlibPresentationSupportKHR'] = 'Query physical device for presentation to X11 server using Xlib'
+refDesc['vkGetPipelineCacheData'] = 'Get the data store from a pipeline cache'
+refDesc['vkGetQueryPoolResults'] = 'Copy results of queries in a query pool to a host memory region'
+refDesc['vkGetRenderAreaGranularity'] = 'Returns the granularity for optimal render area'
+refDesc['vkGetSwapchainImagesKHR'] = 'Obtain the array of presentable images associated with a swapchain'
+refDesc['VkImageCreateFlags'] = 'Image object creation flags'
+refDesc['VkImageCreateInfo'] = 'Structure specifying the parameters of a newly created image object'
+refDesc['VkImageLayout'] = 'Layout of image and image subresources'
+refDesc['VkImageMemoryBarrier'] = 'Structure specifying the parameters of an image memory barrier'
+refDesc['VkImageType'] = 'Specifies the type of an image object'
+refDesc['VkImageUsageFlags'] = 'Image object usage flags'
+refDesc['VkImageViewType'] = 'Image view types'
+refDesc['vkInvalidateMappedMemoryRanges'] = 'Invalidate ranges of mapped memory objects'
+refDesc['vkMapMemory'] = 'Map a memory object into application address space'
+refDesc['VkMemoryAllocateInfo'] = 'Structure containing parameters of a memory allocation'
+refDesc['VkMemoryPropertyFlags'] = 'Memory pool properties'
+refDesc['vkMergePipelineCaches'] = 'Combine the data stores of pipeline caches'
+refDesc['VkPhysicalDeviceFeatures'] = 'Structure describing the fine-grained features that can be supported by an implementation'
+refDesc['VkPhysicalDeviceLimits'] = 'Structure'
+refDesc['VkPipelineLayoutCreateInfo'] = 'Structure specifying the parameters of a newly created pipeline layout object'
+refDesc['VkPipelineStageFlags'] = 'Pipeline stage identifiers'
+refDesc['VkQueryControlFlags'] = 'Query control flags'
+refDesc['VkQueryResultFlags'] = 'Query result flags'
+refDesc['vkQueueBindSparse'] = 'Bind device memory to a sparse resource object'
+refDesc['VkQueueFamilyProperties'] = 'Structure providing information about a queue family'
+refDesc['VkQueueFlags'] = 'Queue capability flags'
+refDesc['vkQueuePresentKHR'] = 'Queue an image for presentation'
+refDesc['vkQueueSubmit'] = 'Submits a sequence of semaphores or command buffers to a queue'
+refDesc['vkQueueWaitIdle'] = 'Wait for a queue to become idle'
+refDesc['vkResetCommandBuffer'] = 'Reset a command buffer'
+refDesc['vkResetCommandPool'] = 'Reset a command pool'
+refDesc['vkResetDescriptorPool'] = 'Resets a descriptor pool object'
+refDesc['vkResetEvent'] = 'Reset an event to non-signaled state'
+refDesc['vkResetFences'] = 'Resets one or more fence objects'
+refDesc['vkSetEvent'] = 'Set an event to signaled state'
+refDesc['VkSharingMode'] = 'Buffer and image sharing modes'
+refDesc['vkUnmapMemory'] = 'Unmap a previously mapped memory object'
+refDesc['vkUpdateDescriptorSets'] = 'Update the contents of a descriptor set object'
+refDesc['vkWaitForFences'] = 'Wait for one or more fences to become signaled'
+refDesc['VkWriteDescriptorSet'] = 'Structure specifying the parameters of a descriptor set write operation'
+refDesc['VkAndroidSurfaceCreateInfoKHR'] = 'Structure specifying parameters of a newly created Android surface object'
+refDesc['VkDebugReportCallbackCreateInfoEXT'] = 'Structure specifying parameters of a newly created debug report object'
+refDesc['VkDisplayModeCreateInfoKHR'] = 'Structure specifying parameters of a newly created display mode object'
+refDesc['VkDisplayModeParametersKHR'] = 'Structure describing display parameters associated with a display mode'
+refDesc['VkDisplayModePropertiesKHR'] = 'Structure describing display mode properties'
+refDesc['VkDisplayPlaneCapabilitiesKHR'] = 'Structure describing capabilities of a mode and plane combination'
+refDesc['VkDisplayPlanePropertiesKHR'] = 'Structure describing display plane properties'
+refDesc['VkDisplayPresentInfoKHR'] = 'Structure describing parameters of a queue presentation to a swapchain'
+refDesc['VkDisplayPropertiesKHR'] = 'Structure describing an available display device'
+refDesc['VkDisplaySurfaceCreateInfoKHR'] = 'Structure specifying parameters of a newly created display plane surface object'
+refDesc['VkMirSurfaceCreateInfoKHR'] = 'Structure specifying parameters of a newly created Mir surface object'
+refDesc['VkPresentInfoKHR'] = 'Structure describing parameters of a queue presentation'
+refDesc['VkSurfaceCapabilitiesKHR'] = 'Structure describing capabilities of a surface'
+refDesc['VkSurfaceFormatKHR'] = 'Structure describing a supported swapchain format-colorspace pair'
+refDesc['VkSwapchainCreateInfoKHR'] = 'Structure specifying parameters of a newly created swapchain object'
+refDesc['VkWaylandSurfaceCreateInfoKHR'] = 'Structure specifying parameters of a newly created Wayland surface object'
+refDesc['VkWin32SurfaceCreateInfoKHR'] = 'Structure specifying parameters of a newly created Win32 surface object'
+refDesc['VkXcbSurfaceCreateInfoKHR'] = 'Structure specifying parameters of a newly created Xcb surface object'
+refDesc['VkXlibSurfaceCreateInfoKHR'] = 'Structure specifying parameters of a newly created Xlib surface object'
+
+# These are generated based on the structure name
+
+refDesc['VkBufferViewCreateInfo'] = 'Structure specifying parameters of a newly created buffer view'
+refDesc['VkCommandPoolCreateInfo'] = 'Structure specifying parameters of a newly created command pool'
+refDesc['VkComputePipelineCreateInfo'] = 'Structure specifying parameters of a newly created compute pipeline'
+refDesc['VkDescriptorPoolCreateInfo'] = 'Structure specifying parameters of a newly created descriptor pool'
+refDesc['VkDescriptorSetLayoutCreateInfo'] = 'Structure specifying parameters of a newly created descriptor set layout'
+refDesc['VkDeviceCreateInfo'] = 'Structure specifying parameters of a newly created device'
+refDesc['VkDeviceQueueCreateInfo'] = 'Structure specifying parameters of a newly created device queue'
+refDesc['VkEventCreateInfo'] = 'Structure specifying parameters of a newly created event'
+refDesc['VkExtent2D'] = 'Structure specifying a two-dimensional extent'
+refDesc['VkExtent3D'] = 'Structure specifying a three-dimensional extent'
+refDesc['VkFenceCreateInfo'] = 'Structure specifying parameters of a newly created fence'
+refDesc['VkFramebufferCreateInfo'] = 'Structure specifying parameters of a newly created framebuffer'
+refDesc['VkGraphicsPipelineCreateInfo'] = 'Structure specifying parameters of a newly created graphics pipeline'
+refDesc['VkImageViewCreateInfo'] = 'Structure specifying parameters of a newly created image view'
+refDesc['VkInstanceCreateInfo'] = 'Structure specifying parameters of a newly created instance'
+refDesc['VkOffset2D'] = 'Structure specifying a two-dimensional offset'
+refDesc['VkOffset3D'] = 'Structure specifying a three-dimensional offset'
+refDesc['VkPipelineCacheCreateInfo'] = 'Structure specifying parameters of a newly created pipeline cache'
+refDesc['VkPipelineColorBlendStateCreateInfo'] = 'Structure specifying parameters of a newly created pipeline color blend state'
+refDesc['VkPipelineDepthStencilStateCreateInfo'] = 'Structure specifying parameters of a newly created pipeline depth stencil state'
+refDesc['VkPipelineDynamicStateCreateInfo'] = 'Structure specifying parameters of a newly created pipeline dynamic state'
+refDesc['VkPipelineInputAssemblyStateCreateInfo'] = 'Structure specifying parameters of a newly created pipeline input assembly state'
+refDesc['VkPipelineMultisampleStateCreateInfo'] = 'Structure specifying parameters of a newly created pipeline multisample state'
+refDesc['VkPipelineRasterizationStateCreateInfo'] = 'Structure specifying parameters of a newly created pipeline rasterization state'
+refDesc['VkPipelineShaderStageCreateInfo'] = 'Structure specifying parameters of a newly created pipeline shader stage'
+refDesc['VkPipelineTessellationStateCreateInfo'] = 'Structure specifying parameters of a newly created pipeline tessellation state'
+refDesc['VkPipelineVertexInputStateCreateInfo'] = 'Structure specifying parameters of a newly created pipeline vertex input state'
+refDesc['VkPipelineViewportStateCreateInfo'] = 'Structure specifying parameters of a newly created pipeline viewport state'
+refDesc['VkQueryPoolCreateInfo'] = 'Structure specifying parameters of a newly created query pool'
+refDesc['VkRect2D'] = 'Structure specifying a two-dimensional subregion'
+refDesc['VkRenderPassCreateInfo'] = 'Structure specifying parameters of a newly created render pass'
+refDesc['VkSamplerCreateInfo'] = 'Structure specifying parameters of a newly created sampler'
+refDesc['VkSemaphoreCreateInfo'] = 'Structure specifying parameters of a newly created semaphore'
+refDesc['VkShaderModuleCreateInfo'] = 'Structure specifying parameters of a newly created shader module'
+
+# These are TBD
+
+refDesc['VkApplicationInfo'] = 'Structure specifying application info'
+refDesc['VkAttachmentDescription'] = 'Structure specifying an attachment description'
+refDesc['VkAttachmentReference'] = 'Structure specifying an attachment reference'
+refDesc['VkBindSparseInfo'] = 'Structure specifying a sparse binding operation'
+refDesc['VkBufferCopy'] = 'Structure specifying a buffer copy operation'
+refDesc['VkBufferImageCopy'] = 'Structure specifying a buffer image copy operation'
+refDesc['VkClearAttachment'] = 'Structure specifying a clear attachment'
+refDesc['VkClearColorValue'] = 'Structure specifying a clear color value'
+refDesc['VkClearDepthStencilValue'] = 'Structure specifying a clear depth stencil value'
+refDesc['VkClearRect'] = 'Structure specifying a clear rectangle'
+refDesc['VkClearValue'] = 'Structure specifying a clear value'
+refDesc['VkCommandBufferBeginInfo'] = 'Structure specifying a command buffer begin operation'
+refDesc['VkCommandBufferInheritanceInfo'] = 'Structure specifying command buffer inheritance info'
+refDesc['VkCommandBufferLevel'] = 'Structure specifying a command buffer level'
+refDesc['VkComponentMapping'] = 'Structure specifying a color component mapping'
+refDesc['VkCopyDescriptorSet'] = 'Structure specifying a copy descriptor set operation'
+refDesc['VkDescriptorBufferInfo'] = 'Structure specifying descriptor buffer info'
+refDesc['VkDescriptorImageInfo'] = 'Structure specifying descriptor image info'
+refDesc['VkDescriptorPoolSize'] = 'Structure specifying descriptor pool size'
+refDesc['VkDescriptorSetLayoutBinding'] = 'Structure specifying a descriptor set layout binding'
+refDesc['VkDispatchIndirectCommand'] = 'Structure specifying a dispatch indirect command'
+refDesc['VkDrawIndexedIndirectCommand'] = 'Structure specifying a draw indexed indirect command'
+refDesc['VkDrawIndirectCommand'] = 'Structure specifying a draw indirect command'
+refDesc['VkExtensionProperties'] = 'Structure specifying a extension properties'
+refDesc['VkFormatProperties'] = 'Structure specifying image format properties'
+refDesc['VkImageBlit'] = 'Structure specifying an image blit operation'
+refDesc['VkImageCopy'] = 'Structure specifying an image copy operation'
+refDesc['VkImageFormatProperties'] = 'Structure specifying a image format properties'
+refDesc['VkImageResolve'] = 'Structure specifying an image resolve operation'
+refDesc['VkImageSubresource'] = 'Structure specifying a image subresource'
+refDesc['VkImageSubresourceLayers'] = 'Structure specifying a image subresource layers'
+refDesc['VkImageSubresourceRange'] = 'Structure specifying a image subresource range'
+refDesc['VkLayerProperties'] = 'Structure specifying layer properties'
+refDesc['VkMappedMemoryRange'] = 'Structure specifying a mapped memory range'
+refDesc['VkMemoryBarrier'] = 'Structure specifying a memory barrier'
+refDesc['VkMemoryHeap'] = 'Structure specifying a memory heap'
+refDesc['VkMemoryRequirements'] = 'Structure specifying memory requirements'
+refDesc['VkMemoryType'] = 'Structure specifying memory type'
+refDesc['VkPhysicalDeviceMemoryProperties'] = 'Structure specifying physical device memory properties'
+refDesc['VkPhysicalDeviceProperties'] = 'Structure specifying physical device properties'
+refDesc['VkPhysicalDeviceSparseProperties'] = 'Structure specifying physical device sparse memory properties'
+refDesc['VkPipelineColorBlendAttachmentState'] = 'Structure specifying a pipeline color blend attachment state'
+refDesc['VkPushConstantRange'] = 'Structure specifying a push constant range'
+refDesc['VkRenderPassBeginInfo'] = 'Structure specifying render pass begin info'
+refDesc['VkSparseBufferMemoryBindInfo'] = 'Structure specifying a sparse buffer memory bind operation'
+refDesc['VkSparseImageFormatProperties'] = 'Structure specifying sparse image format properties'
+refDesc['VkSparseImageMemoryBind'] = 'Structure specifying sparse image memory bind'
+refDesc['VkSparseImageMemoryBindInfo'] = 'Structure specifying sparse image memory bind info'
+refDesc['VkSparseImageMemoryRequirements'] = 'Structure specifying sparse image memory requirements'
+refDesc['VkSparseImageOpaqueMemoryBindInfo'] = 'Structure specifying sparse image opaque memory bind info'
+refDesc['VkSparseMemoryBind'] = 'Structure specifying a sparse memory bind operation'
+refDesc['VkSpecializationInfo'] = 'Structure specifying specialization info'
+refDesc['VkSpecializationMapEntry'] = 'Structure specifying a specialization map entry'
+refDesc['VkStencilOpState'] = 'Structure specifying stencil operation state'
+refDesc['VkSubmitInfo'] = 'Structure specifying a queue submit operation'
+refDesc['VkSubpassDependency'] = 'Structure specifying a subpass dependency'
+refDesc['VkSubpassDescription'] = 'Structure specifying a subpass description'
+refDesc['VkSubresourceLayout'] = 'Structure specifying subresource layout'
+refDesc['VkVertexInputAttributeDescription'] = 'Structure specifying vertex input attribute description'
+refDesc['VkVertexInputBindingDescription'] = 'Structure specifying vertex input binding description'
+refDesc['VkViewport'] = 'Structure specifying a viewport'
+
+# These are constructed from spec text
+
+refDesc['VkAccessFlagBits'] = 'Bitmask specifying classes of memory access the will participate in a memory barrier dependency'
+refDesc['VkAttachmentDescriptionFlagBits'] = 'Bitmask specifying additional properties of an attachment'
+refDesc['VkBufferCreateFlagBits'] = 'Bitmask specifying additional parameters of a buffer'
+refDesc['VkBufferUsageFlagBits'] = 'Bitmask specifying allowed usage of a buffer'
+refDesc['VkColorComponentFlagBits'] = 'Bitmask controlling which components are written to the framebuffer'
+refDesc['VkCommandBufferResetFlagBits'] = 'Bitmask controlling behavior of a command buffer reset'
+refDesc['VkCommandBufferUsageFlagBits'] = 'Bitmask specifying usage behavior for command buffer'
+refDesc['VkCommandPoolCreateFlagBits'] = 'Bitmask specifying usage behavior for a command pool'
+refDesc['VkCommandPoolResetFlagBits'] = 'Bitmask controlling behavior of a command pool reset'
+refDesc['VkCullModeFlagBits'] = 'Bitmask controlling triangle culling'
+refDesc['VkDependencyFlagBits'] = 'Bitmask specifying dependencies between subpasses'
+refDesc['VkDescriptorPoolCreateFlagBits'] = 'Bitmask specifying certain supported operations on a descriptor pool'
+refDesc['VkFenceCreateFlagBits'] = 'Bitmask specifying initial state and behavior of a fence'
+refDesc['VkFormatFeatureFlagBits'] = 'Bitmask specifying features supported by a buffer'
+refDesc['VkImageAspectFlagBits'] = 'Bitmask specifying which aspects of an image are included in a view'
+refDesc['VkImageCreateFlagBits'] = 'Bitmask specifying additional parameters of an image'
+refDesc['VkImageUsageFlagBits'] = 'Bitmask specifying intended usage of an image'
+refDesc['VkMemoryHeapFlagBits'] = 'Bitmask specifying attribute flags for a heap'
+refDesc['VkMemoryPropertyFlagBits'] = 'Bitmask specifying properties for a memory type'
+refDesc['VkPipelineCreateFlagBits'] = 'Bitmask controlling how a pipeline is generated'
+refDesc['VkPipelineStageFlagBits'] = 'Bitmask specifying pipeline stages'
+refDesc['VkQueryControlFlagBits'] = 'Bitmask specifying constraints on a query'
+refDesc['VkQueryPipelineStatisticFlagBits'] = 'Bitmask specifying queried pipeline statistics'
+refDesc['VkQueryResultFlagBits'] = 'Bitmask specifying how and when query results are returned'
+refDesc['VkQueueFlagBits'] = 'Bitmask specifying capabilities of queues in a queue family'
+refDesc['VkSampleCountFlagBits'] = 'Bitmask specifying sample counts supported for an image used for storage operations'
+refDesc['VkShaderStageFlagBits'] = 'Bitmask specifying a pipeline stage'
+refDesc['VkSparseImageFormatFlagBits'] = 'Bitmask specifying additional information about a sparse image resource'
+refDesc['VkSparseMemoryBindFlagBits'] = 'Bitmask specifying usage of a sparse memory binding operation'
+refDesc['VkStencilFaceFlagBits'] = 'Bitmask specifying sets of stencil state for which to update the compare mask'
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/__init__.py.docs b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/__init__.py.docs
new file mode 100644
index 00000000000..1058ab04555
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/__init__.py.docs
@@ -0,0 +1,37 @@
+# Copyright 2019-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+"""Scripts for building the Vulkan specification and artifacts."""
+
+# This is only used during doc builds, hence the weird file extension.
+# It messes up scripts at other times.
+
+# __all__ = [
+# "cgenerator",
+# "check_spec_links",
+# "comment_convert",
+# "conventions",
+# "docgenerator",
+# "extdependency",
+# "extensionmetadocgenerator",
+# "generator",
+# "genRef",
+# "genspec",
+# "genvk",
+# "hostsyncgenerator",
+# "interfacedocgenerator",
+# "pygenerator",
+# "reflib",
+# "reflow",
+# "reg",
+# "spirvcapgenerator",
+# "test_check_spec_links_api_specific",
+# "test_check_spec_links",
+# "test_entity_db",
+# "validitygenerator",
+# "vkconventions",
+# "vuidCounts",
+# "xml_consistency",
+# "spec_tools",
+# ]
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/antora-prep.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/antora-prep.py
new file mode 100755
index 00000000000..f08c8210669
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/antora-prep.py
@@ -0,0 +1,586 @@
+#!/usr/bin/python3
+#
+# Copyright 2022-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+"""Used to convert files from the asciidoctor spec tree to Antora module
+format. Success is highly dependent on strict adherence to Vulkan spec
+authoring conventions.
+
+Usage: `antora-prep.py [-root path] -component path files`
+
+- `-root` is the root path (repository root, usually) relative to which spec
+ files are processed. Defaults to current directory if not specified.
+- `-component` is the path to the module and component in which converted
+ files are written (e.g. the component directory under which pages/,
+ partials/, images/, etc. are located).
+- `files` are asciidoc source files from the spec to convert.
+
+Image files are linked from the component 'images' directory
+
+Asciidoc markup files (.adoc) are scanned for the first title markup and
+classified as partials or pages depending on whether it is a top-level title
+or not. All .adoc files are rewritten to the component 'partials' directory, to
+allow transclusion of pages to work (otherwise the transclusions would also
+have to be rewritten).
+
+pages then have additional markup injected immediately following the page
+title to set custom attributes needed for the build. pages are then
+symbolically linked from the component 'pages' directory to the actual
+rewritten file in the 'partials' directory to follow Antora conventions.
+"""
+
+# For error and file-loading interfaces only
+import argparse
+import importlib
+import os
+import re
+import sys
+from generator import enquote
+from reflib import loadFile, logDiag, logWarn, logErr, setLogFile, getBranch
+from pathlib import Path
+
+titleAnchorPat = re.compile(r'^\[\[(?P<anchor>[^,]+).*\]\]$')
+titlePat = re.compile(r'^[=#] (?P<title>[A-Z].*)')
+subtitlePat = re.compile(r'^[=#]{2,} (?P<title>[A-Z].*)')
+
+Pages = 'pages'
+Partials = 'partials'
+Images = 'images'
+
+def undefquote(s):
+ """Quote a string for JavaScript, or return the JavaScript undefined
+ value."""
+
+ if s is not None:
+ return enquote(s)
+ else:
+ return 'undefined'
+
+
+def mapAnchor(anchor, title, pageMap, xrefMap, closeAnchor):
+ """Rewrite a <<anchor{, title}>> xref -> xref:pagemap#anchor[{title}]
+ - anchor - anchor name
+ - title - xref description or '' if not specified, in which case the
+ anchor text from the xrefMap is used if available
+ - closeAnchor - True if closing >> is on this line, False otherwise
+ - pageMap, xrefMap - per rewriteXrefs below
+ """
+
+ #@if anchor == 'features-shaderStorageImageReadWithoutFormat':
+ #@ import pdb
+ #@ pdb.set_trace()
+
+ # Determine which page anchor this anchor comes from
+ # If it cannot be determined, use the unmapped anchor
+ #@ Simplify the page anchor if pageName == current page
+ try:
+ if title != '' or not closeAnchor:
+ # Either a (possibly up to a line break) title is supplied, or
+ # title is on the next line
+ (pageAnchor, _) = xrefMap[anchor]
+ else:
+ # No explicit title. Infer one from anchor and xrefMap.
+ (pageAnchor, title) = xrefMap[anchor]
+
+ # If the title is *still* empty, make a note of it and just use
+ # the anchor name
+ if title == '':
+ print(f'No title found for anchor {anchor}', file=sys.stderr)
+ title = anchor
+
+ # Page the page anchor comes from
+ pageName = pageMap[pageAnchor]
+ print(f'mapAnchor: anchor {anchor} pageAnchor {pageAnchor} -> pageName = {pageName}')
+
+ xref = f'{pageName}#{anchor}'
+ except:
+ print(f'Cannot determine which page {anchor} comes from, passing through to Antora intact', file=sys.stderr)
+ xref = f'{anchor}'
+
+ # Remove extraneous whitespace
+ title = ' '.join(title.split())
+
+ if closeAnchor:
+ return f'xref:{xref}[{title}]'
+ else:
+ return f'xref:{xref}[{title}'
+
+def replaceAnchorText(match, pageMap, xrefMap):
+ """Rewrite <<anchor,text>> to xref:newanchor[text]
+ - match - match object, \1 = anchor, \2 = text
+ - pageMap, xrefMap - per rewriteXrefs below
+ """
+
+ anchor = match.group(1)
+ text = match.group(2)
+
+ return mapAnchor(anchor, text, pageMap, xrefMap, closeAnchor=True)
+
+def replaceAnchorOnly(match, pageMap, xrefMap):
+ """Rewrite <<anchor>> to xref:newanchor[]
+ - match - match object, \1 = anchor
+ - pageMap, xrefMap - per rewriteXrefs below
+ """
+
+ anchor = match.group(1)
+
+ return mapAnchor(anchor, '', pageMap, xrefMap, closeAnchor=True)
+
+def replaceAnchorTrailingText(match, pageMap, xrefMap):
+ """Rewrite <<anchor, to xref:newanchor[
+ - match - match object, \1 = anchor, \2 = text (may be empty)
+ - pageMap, xrefMap - per rewriteXrefs below
+ """
+
+ anchor = match.group(1)
+ text = match.group(2)
+
+ return mapAnchor(anchor, text, pageMap, xrefMap, closeAnchor=False)
+
+class DocFile:
+ """Information about a markup file being converted"""
+
+ def __init__(self):
+ """Constructor
+ - lines - text of file as list of strings
+ - root - common base directory for src files
+ - component - path to component directory for outputs
+ - srcpath - absolute path to file source
+ - relpath - path to file source relative to root
+ - dstpath - path to output file destination
+ - dstlink - path to a an alias (symlink to) dstpath, used for
+ files that need to be in both partials and pages directories.
+ - category - file type - Pages, Partials, or Images. These are
+ string variables containing the corresponding component
+ subdirectory name.
+ - title - page title for Pages, else ''
+ - titleAnchor - page title anchor for Pages, else ''
+ - anchors - asciidoc anchors found in the file
+ - includes - asciidoc includes found in the file
+ - pageMap - dictionary mapping a page anchor to a source file
+ relpath
+ - xrefMap - dictionary mapping an anchor within a page to a page
+ anchor
+ """
+
+ self.lines = None
+ self.root = None
+ self.component = None
+ self.srcpath = None
+ self.relpath = None
+ self.dstpath = None
+ self.dstlink = None
+ self.category = None
+ self.title = ''
+ self.titleAnchor = ''
+ self.anchors = set()
+ self.includes = set()
+
+ self.pageMap = {}
+ self.xrefMap = {}
+
+ def findTitle(self):
+ """Find category (Pages or Partials) and title, for Pages, in a
+ .adoc markup file.
+
+ Heuristic is to search the beginning of the file for a top-level
+ asciidoc title, preceded immediately by an anchor for the page.
+
+ Returns (category, title, titleLine, titleAnchor) with '' for a
+ Partials title and '' if no title anchor is found."""
+
+ """Chapter title block must be within this many lines of start of file"""
+ maxLines = min(30, len(self.lines))
+
+ """Default, if page title and/or page anchor not found"""
+ titleAnchor = ''
+ title = ''
+
+ for lineno in range(0, maxLines):
+ line = self.lines[lineno]
+
+ # Look for the first anchor, which must precede the title to
+ # apply to it (really, must precede it by exactly one line).
+ match = titleAnchorPat.match(line)
+ if match is not None:
+ titleAnchor = match.group('anchor')
+ continue
+
+ # If we find a top-level title, it is a page.
+ match = titlePat.match(line)
+ if match is not None:
+ return (Pages, match.group('title'), lineno, titleAnchor)
+
+ # If we find a second-level or above title, it is a partial
+ match = subtitlePat.match(line)
+ if match is not None:
+ return (Partials, match.group('title'), lineno, titleAnchor)
+
+ # If we do not find a match in the first maxLines lines, assume it
+ # is a partial.
+ return(Partials, 'NO TITLE FOUND', -1, titleAnchor)
+
+ def populate(self,
+ filename,
+ root,
+ component):
+ """Populate data structures given file content and location.
+
+ - filename - file to scan
+ - root - absolute path to root under which all source files are
+ read
+ - component - absolute path to module / component directory under
+ which all destination files are written
+ """
+
+ # Load file content
+ self.srcpath = os.path.abspath(filename)
+ self.lines, _ = loadFile(self.srcpath)
+ if self.lines is None:
+ raise RuntimeError(f'No such file {self.srcpath}')
+
+ # Miscellaneous relevant paths
+ self.root = root
+ self.relpath = os.path.relpath(self.srcpath, root)
+ self.component = component
+
+ # Determine file category.
+ # Only .adoc files are candidates for pages, which is verified by
+ # looking at the file header for a top-level title.
+ # .svg .jpg .png are always images
+ # Anything else is a partial
+ (_, fileext) = os.path.splitext(filename)
+
+ # Defaults
+ self.title = ''
+ self.titleLine = 0
+ self.titleAnchor = None
+
+ if fileext in (('.svg', '.jpg', '.png')):
+ self.category = Images
+ elif fileext == '.adoc':
+ (self.category,
+ self.title,
+ self.titleLine,
+ self.titleAnchor) = self.findTitle()
+ else:
+ self.category = Partials
+
+ # Determine destination path based on category
+ # images/ are treated specially since there is only a single
+ # directory and the component directory is already named Images.
+ if self.category == Partials:
+ self.dstpath = Path(self.component) / Partials / self.relpath
+ elif self.category == Pages:
+ # Save the page in partials/, link from pages/
+ self.dstpath = Path(self.component) / Partials / self.relpath
+ self.dstlink = Path(self.component) / Pages / self.relpath
+ else:
+ # Images go under images/, not under images/images/
+ # This could fail if there were ever top-level images but as all
+ # images used in the spec are required to be specified relative
+ # to {images}, it is OK.
+ self.dstpath = Path(self.component) / self.relpath
+
+
+ def rewriteXrefs(self, pageMap = {}, xrefMap = {}):
+ """Rewrite asciidoc <<>> xrefs into Antora xref: xrefs, including
+ altering the xref target.
+
+ - pageMap - map from page anchors to page names
+ - xrefMap - map from anchors within a page to the page anchor"""
+
+ # pageMap and xrefMap are used in functions called by re.subn, so
+ # save them in members.
+ self.pageMap = pageMap
+ self.xrefMap = xrefMap
+
+ # Xref markup may be broken across lines, and may or may not include
+ # anchor text. Track whether the closing >> is being looked for at
+ # start of line, or not.
+ withinXref = False
+
+ for lineno in range(0, len(self.lines)):
+ line = self.lines[lineno]
+
+ if withinXref:
+ # Could use line.replace, but that does not return a match
+ # count, so we cannot tell if the '>>' is missing.
+ (line, count) = re.subn(r'>>', r']', line, count=1)
+ if count == 0:
+ print(f'WARNING: No closing >> found on line {lineno} of {self.relpath}', file=sys.stderr)
+ elif line[0] != ' ' and self.lines[lineno-1][-1] not in '[ ':
+ # Add whitespace corresponding to crushed-out newline on
+ # previous line, so title words do not run together.
+ self.lines[lineno-1] += ' '
+ withinXref = False
+
+ # Now look for all xrefs starting on this line and remap them,
+ # including remapping the anchor.
+
+ # First, complete xrefs with alt-text (<<anchor, text>>)
+ (line, count) = re.subn(r'<<([^,>]*),([^>]+)>>',
+ lambda match: replaceAnchorText(match, pageMap, xrefMap),
+ line)
+
+ # Next, complete xrefs without alt-text (<<anchor>>)
+ (line, count) = re.subn(r'<<([^,>]*)>>',
+ lambda match: replaceAnchorOnly(match, pageMap, xrefMap),
+ line)
+
+ # Finally, if there is a trailing '<<anchor,' at EOL, remap it
+ # and set the flag so the terminating '>>' on the next line will
+ # be mapped into an xref closing ']'.
+ (line, count) = re.subn(r'<<([^,>]*),([^>]*)$',
+ lambda match: replaceAnchorTrailingText(match, pageMap, xrefMap),
+ line)
+ if count > 0:
+ withinXref = True
+
+ self.lines[lineno] = line
+
+ def __str__(self):
+ lines = [
+ f'Input file {filename}: {len(self.lines)} lines',
+ f'root = {self.root} component = {self.component} relpath = {self.relpath}',
+ f'category = {self.category} dstpath = {self.dstpath}',
+ f'title = {self.title}',
+ f'titleAnchor = {self.titleAnchor}',
+ ]
+ return '\n'.join(lines)
+
+ def removeDestination(self, path, text, overwrite):
+ """Remove a destination file, if it exists and overwrite is true.
+ Ensure the destination directory exists.
+
+ path - file pathname
+ text - descriptive text for errors
+ overwrite - if True, replace existing output file
+ """
+
+ if os.path.exists(path):
+ if overwrite:
+ # print(f'Removing {text}: {path}')
+ os.remove(path)
+ else:
+ raise RuntimeError(f'Will not overwrite {text}: {path}')
+
+ dir = os.path.dirname(path)
+ if not os.path.exists(dir):
+ # print(f'Creating {text} directory {dir}')
+ os.makedirs(dir)
+
+ def rewriteFile(self, overwrite = True, pageHeaders = None):
+ """Write source file to component directory. Images are just symlinked
+ to the external file. Pages are rewritten to Partials, then
+ symlinked to Pages.
+
+ - overwrite - if True, replace existing output files
+ - pageHeaders - if not None, a list of strings to inject
+ following the chapter heading in each page
+
+ <<>>-style xrefs are assumed to be rewritten prior to calling
+ rewriteFile.
+
+ May still need to rewrite custom macros.
+ """
+
+ self.removeDestination(self.dstpath, 'destination file', overwrite)
+
+ if self.category == Images:
+ # Just symlink destination image to source
+ # print(f'Symlinking {self.dstpath} -> {self.srcpath}')
+ os.symlink(self.srcpath, self.dstpath)
+ elif self.category == Partials:
+ self.writeFile(self.dstpath)
+ elif self.category == Pages:
+ if pageHeaders is not None:
+ # Add blank lines before and after the pageHeaders to avoid
+ # coalescing with file content.
+ lines = self.lines[0:self.titleLine+1]
+ lines += ['\n'] + pageHeaders + ['\n']
+ lines = lines + self.lines[self.titleLine+1:]
+ self.lines = lines
+
+ # Inject page headers immediately following page title
+
+ self.writeFile(self.dstpath)
+
+ if self.dstlink is None:
+ RuntimeError(f'Wrote Page {self.dstpath} to Partials, but no Pages link supplied')
+ else:
+ self.removeDestination(self.dstlink, 'destination link', overwrite)
+ os.symlink(self.dstpath, self.dstlink)
+
+ def writeFile(self, path):
+ """Write self.lines[] to file at specified path"""
+
+ try:
+ fp = open(path, 'w', encoding='utf8')
+ except:
+ raise RuntimeError(f'Cannot open output file {path}')
+
+ for line in self.lines:
+ print(line, file=fp, end='')
+
+ fp.close()
+
+def testHarness():
+ def printFile(label, lines):
+ print(label)
+ print('------------------')
+ for line in lines:
+ print(line)
+
+ # Test harness
+ docFile = DocFile()
+ docFile.lines = [
+ '<<ext,ext chapter>> <<ext-label,',
+ 'ext chapter/label>>',
+ '<<core>>, <<core-label, core chapter/label',
+ '>>'
+ ]
+
+ pageMap = {
+ 'ext' : 'file/ext.adoc',
+ 'core' : 'file/core.adoc',
+ }
+ xrefMap = {
+ 'ext' : [ 'ext', '' ],
+ 'ext-label' : [ 'ext', 'LABELLED ext-label' ],
+ 'core' : [ 'core', 'Core Title' ],
+ 'core-label': [ 'core', 'Core Label Title' ],
+ }
+
+ printFile('Original File', docFile.lines)
+
+ docFile.rewriteXrefs(pageMap, xrefMap)
+
+ printFile('Edited File', docFile.lines)
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-root', action='store', dest='root',
+ default=os.getcwd(),
+ help='Specify root directory under which files are located (default current directory)')
+ parser.add_argument('-pageHeaders', action='store', dest='pageHeaders',
+ default=None,
+ help='Specify file whose contents are injected after title of each converted page')
+ parser.add_argument('-component', action='store', dest='component',
+ required=True,
+ help='Specify module / component directory in which converted files are written')
+ #parser.add_argument('-htmlspec', action='store', dest='htmlspec',
+ # default=None, required=False,
+ # help='Specify HTML of generated spec to extract anchor mapping from')
+ parser.add_argument('-xrefpath', action='store', dest='xrefpath',
+ default=None, required=False,
+ help='Specify path to xrefMap.py containing map of anchors to chapter anchors')
+ parser.add_argument('-pagemappath', action='store', dest='pagemappath',
+ default=None, required=False,
+ help='Specify path to output pageMap.cjs containing map of anchors to chapter anchors')
+ parser.add_argument('-filelist', action='store',
+ default=None, required=False,
+ help='Specify file containing a list of filenames to convert, one/line')
+ parser.add_argument('files', metavar='filename', nargs='*',
+ help='Specify name of a single file to convert')
+
+ args = parser.parse_args()
+
+ args.root = os.path.abspath(args.root)
+ args.component = os.path.abspath(args.component)
+
+ if args.pageHeaders is not None:
+ args.pageHeaders, _ = loadFile(args.pageHeaders)
+
+ if False:
+ testHarness()
+ sys.exit(0)
+
+ # Initialize dictionaries
+ pageInfo = {}
+ pageMap = {}
+
+ # The xrefmap is imported from the 'xrefMap' module, if it exists
+ try:
+ if args.xrefpath is not None:
+ sys.path.append(args.xrefpath)
+ from xrefMap import xrefMap
+ except:
+ print('WARNING: No module xrefMap containing xrefMap dictionary', file=sys.stderr)
+ xrefMap = {}
+
+ # If a file containing a list of files was specified, add each one.
+ # Could try using os.walk() instead, but that is very slow.
+ if args.filelist is not None:
+ count = 0
+ lines, _ = loadFile(args.filelist)
+ if lines is None:
+ raise RuntimeError(f'Error reading filelist {args.filelist}')
+ for line in lines:
+ path = line.rstrip()
+ if path[0].isalpha() and path.endswith('.adoc'):
+ args.files.append(path)
+ count = count + 1
+ print(f'Read {count} paths from {args.filelist}')
+
+ for filename in args.files:
+ # Create data structure representing the file.
+ docFile = DocFile()
+ docFile.populate(filename = filename,
+ root = args.root,
+ component = args.component)
+ # print(docFile, '\n')
+
+ # Save information about the file under its relpath
+ pageInfo[docFile.relpath] = docFile
+
+ # Save mapping from page anchor to its relpath
+ if docFile.titleAnchor is not None:
+ pageMap[docFile.titleAnchor] = docFile.relpath
+
+ # All files have been read and classified.
+ # Rewrite them in memory.
+
+ for key in pageInfo:
+ # Look for <<>>-style anchors and rewrite them to Antora xref-style
+ # anchors using the pageMap (of top-level anchors to page names) and
+ # xrefmap (of anchors to top-level anchors).
+ docFile = pageInfo[key]
+
+ ## print(f'*** Rewriting {key}')
+ ## print(docFile, '\n')
+
+ docFile.rewriteXrefs(pageMap, xrefMap)
+ docFile.rewriteFile(overwrite = True, pageHeaders = args.pageHeaders)
+
+ # Write the pageMap to a .cjs file for use in the Antora build's
+ # specmacros extensions. The xrefMap is already written in JS form.
+ if args.pagemappath is not None:
+ try:
+ fp = open(args.pagemappath, 'w', encoding='utf8')
+ except:
+ raise RuntimeError(f'Cannot open output pageMap.cjs file {args.pagemappath}')
+
+ print('exports.pageMap = {', file=fp)
+ for pageAnchor in sorted(pageMap):
+ pageName = pageMap[pageAnchor]
+ print(f' {undefquote(pageAnchor)} : {undefquote(pageName)},', file=fp)
+ print('}', file=fp)
+
+ fp.close()
+
+## if not os.path.exists(args.xrefmap):
+## raise UserWarning(f'Specified xrefmap {args.xrefmap} does not exist')
+## if args.xrefmap[-3:] != '.py':
+## raise UserWarning(f'Specified xrefmap {args.xrefmap} is not a .py file')
+##
+## abspath = os.path.abspath(args.xrefmap)
+## xrefdir = os.path.dirname(os.path.abspath(args.xrefmap))
+## sys.path.append(dir)
+##
+## xrefbase = os.path.split(args.xrefmap)[1]
+## xrefbase = os.path.splitext(xrefbase)[0]
+##
+## raise UserWarning(f'Specified xrefmap {args.xrefmap} does not exist')
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/apiconventions.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/apiconventions.py
new file mode 100644
index 00000000000..d170dd40b8c
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/apiconventions.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2021-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# Generic alias for working group-specific API conventions interface.
+
+# This import should be changed at the repository / working group level to
+# specify the correct API's conventions.
+
+
+import os
+
+defaultAPI = 'vulkan'
+
+VulkanAPI = os.getenv('VULKAN_API', default=defaultAPI)
+
+if VulkanAPI == 'vulkansc':
+ from vkconventions import VulkanSCConventions as APIConventions
+else:
+ from vkconventions import VulkanConventions as APIConventions
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/LICENSE b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/LICENSE
new file mode 100644
index 00000000000..ab602974d20
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018
+
+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 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.
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/README.md b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/README.md
new file mode 100644
index 00000000000..0ae6131711e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/README.md
@@ -0,0 +1,123 @@
+# asciidoctor-chunker
+
+[![npm version](https://badge.fury.io/js/asciidoctor-chunker.svg)](https://badge.fury.io/js/asciidoctor-chunker)
+[![Node.js CI](https://github.com/wshito/asciidoctor-chunker/actions/workflows/node.js.yml/badge.svg)](https://github.com/wshito/asciidoctor-chunker/actions/workflows/node.js.yml)
+[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
+
+Generates chunked (multi-page) HTML from Asciidoctor's single HTML file with the support of fine-tuned splits by chapters, sections, or any depth of subsections. Here is [the sample output.](http://www.seinan-gu.ac.jp/~shito/asciidoctor/html_chunk/index.html) Each chapter can have different levels of extraction depth. See [What it does](#what-it-does) for details.
+
+## News
+
+- 2021/8/3 [Ver 1.0.4](https://github.com/wshito/asciidoctor-chunker/releases) Added the keyboard shortcuts for the page navigation with arrow keys. Added the accessibility labels on the page navigation for screen readers.
+- 2021/6/25 [Ver 1.0.3](https://github.com/wshito/asciidoctor-chunker/releases) Fixed the security vulnerabilities in the dependencies.
+- 2021/5/9 [Ver 1.0.2](https://github.com/wshito/asciidoctor-chunker/releases) The toc item for the titlepage can be configured with `--titlePage` option (thanks to [@johnthad](https://github.com/johnthad)).
+- 2021/3/17 [Ver 1.0.1](https://github.com/wshito/asciidoctor-chunker/releases) The script contains shebang and can be invoked directly. Published on [npm](https://www.npmjs.com/package/asciidoctor-chunker). You can install via npm. See [Installation](#installation).
+- 2021/2/27 [Ver 1.0.0 Released!](https://github.com/wshito/asciidoctor-chunker/releases)
+ - Non opinionated page navigation at the bottom of each page is available.
+ - You can insert custom css from the command line with `--css` option.
+ - If you have any custom elements inserted in the source html, they are handled in non-strict mode by setting `--no-strictMode` option.
+ - Gives warning if no relative links are available in tocs.
+ - The current page toc is highlighted and scrolled into view.
+- 2021/2/20 Ver 0.9 is released! This is a complete re-write from the previous Lisp version. **It is re-implemented in JavaScript!** So it is super easy to setup with NodeJS! The fine tuned split options are available. Oh, and it runs a lot faster than the previous version!😊
+- 2021/2/10 Started work on the more enhanced version in `javascript` branch. Please wait a couple of weeks. The new version can control any depth of sections to split. And even more, each chapter can have a different depth extraction level. The new version is written in JavaScript so it will be a lot easier to install!
+- 2018/7/11 Locally linked files with `link` and `script` tags with relative paths are copied to the destination directory keeping the structure of the relative path. So the custom CSS and script files should be properly copied by `asciidoctor-chunker`.
+
+## What it does
+
+Asciidoctor-Chunker generates chunked HTML from a single HTML generated by Asciidoctor.
+
+1. Splits part preambles and chapters (or any depth of section level) into separate files. Each chapter can be configured to have a different depth for extractions.
+1. Extracts css inside the style element into a separate file so the browser can cache and share it among all the pages.
+1. Places footnotes in the file they belong to. This also means that the multiply referred footnotes are placed in every referrer's files and sets the link back to the referrer's id within the page.
+1. Re-writes the relative links in order to point to the appropriate chunked files.
+1. Copies the local images and linked files (with `link`, `script` and `img` tags) whose paths are relative, to the directory relative to the chunked html output. Files are only copied if they are new or modified compared to the previously copied one.
+1. Adds a titlepage link in the toc and page navigation at the bottom of each page.
+1. Adds non-opinionated page navigation.
+1. Highlights the current page toc items and they get scrolled into the viewport.
+
+Here is [the sample output](http://www.seinan-gu.ac.jp/~shito/asciidoctor/html_chunk/index.html) created from the [Asciidoctor User Manual](https://asciidoctor.org/docs/user-manual/). The footer on the sample page is added by setting the asciidoctor attribute and is not added by asciidoctor-chunker.
+
+
+## Installation
+
+Asciidoctor-Chunker is written in JavaScript and runs with NodeJS.
+
+1. Install [Node.js](https://nodejs.org/), the JavaScript runtime. This will install `npm`, the package manager CLI for Node.js.
+1. If you want to install globally, invoke the following;
+ ```
+ npm install -g asciidoctor-chunker
+ ```
+ You can install locally under the current directory as;
+ ```
+ npm install asciidoctor-chunker
+ ```
+1. Or alternatively you can download the pre-built program from the [release](https://github.com/wshito/asciidoctor-chunker/releases).
+
+## Usage
+
+If you installed globally:
+ ```
+ asiidoctor-chunker [single-html-file] -o [output-directory]
+ ```
+If you installed locally invoke the following under the directory you installed:
+ ```
+ npx asciidoctor-chunker [single-html-file] -o [output-directory]
+ ```
+If you installed the prebuild program simply run the script as:
+ ```
+ ./asciidoctor-chunker.js [single-html-file] -o [output-directory]
+ ```
+`[single-html-file]` is the single HTML file generated by [Asciidoctor](https://asciidoctor.org) from the book doctype. If the output directory is not specified, the default is `html_chunks` under the current directory.
+
+More description of usage is available with `--help` option.
+
+## How to Configure the Depth of Extraction
+
+You can list the multiple settings by connecting each specifier with a comma. Each specifier is consisted of either a single number or a collon separated with two numbers.
+
+The single number sets the default level of extraction. Number 1 is the application's default and it extracts the chapter level. Number 2 for section extraction, 3 for subsection, and so on to 6 which is the maximum section level of Asciidoctor.
+
+The list of collon separated numbers, `chap:level`, can change the extraction depth for specific chapters, so `3:2` means chapter 3 is extracted down to 2 levels (ie. section level). You can use a hyphen to specify the range of chapters to set as `chapFrom-chapTo:level`, so `1-3:5` means chapter 1 through 5 should be extracted with the depth level 5.
+
+Example:
+```
+ --depth 2 The default level 2, all the chapters and
+ sections will be extracted.
+ --depth 3,1:2,8:5 The default level 3, level 2 for Chap 1,
+ level 5 for Chap 8.
+ --depth 1,3-8:2 The default level 1, level 2 for Chap 3 to 8.
+ --depth 3-8:3 No default is set so default level is 1, and
+ level 3 for chap3 to 8.`
+```
+
+## Custom CSS
+
+By default `asciidoctor-chunker.css` is included in the output directory. It provides the non-opinionated page navigation at the bottom of every chunked page. You can override this by giving a comma separated list of paths to your custom css files. They are copied into the output directory so the paths must be accessible by `asciidoctor-chunker`.
+
+## About Strict Mode
+
+If you have any custom elements inserted under `<div id=#content></div>` in the source single html, `asciidoctor-chunker` ignores it by default. If you want them to be included into the chunked html, set the option `--no-strictMode`.
+The element will be copied to every chunked page.
+
+## Customizing Titlepage
+
+The `index.html` created by `asciidoctor-chunker` is selected by clicking the word **Titlepage** in the table of contents. To change the default value, use the option `--titlePage [string]` where `[string]` is the desired text.
+
+## Example
+
+The project contains the `example` directory where you can generate the chunked html for the [Asciidoctor User Manual](https://asciidoctor.org/docs/user-manual/) by invoking `make`. Simply go into the `example` directory and invoke `make`. This will clone the asciidoctor project from the github for the first time, then the chunked html will be generated under `test/output-chunk/html_chunk/` directory. The `index.html` is the first page.
+
+```
+$ cd example
+$ make
+```
+
+## License
+
+MIT
+
+## Developer's Memo
+
+- Unit test uses `test/resources/output/single/sample.html` generated from `test/resources/sample.adoc`.
+- `npm install cheerio commander`
+- `npm install --save-dev ava webpack webpack-cli webpack-shebang-plugin`
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/asciidoctor-chunker.js b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/asciidoctor-chunker.js
new file mode 100644
index 00000000000..afdf9478b3c
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/asciidoctor-chunker/asciidoctor-chunker.js
@@ -0,0 +1,4 @@
+#!/usr/bin/env node
+
+/*! For license information please see asciidoctor-chunker.js.LICENSE.txt */
+(()=>{var e,t,n={1073:e=>{e.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}},9125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupSelectors=t.getDocumentRoot=void 0;var r=n(2515);t.getDocumentRoot=function(e){for(;e.parent;)e=e.parent;return e},t.groupSelectors=function(e){for(var t=[],n=[],i=0,s=e;i<s.length;i++){var o=s[i];o.some(r.isFilter)?t.push(o):n.push(o)}return[n,t]}},7248:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t},a=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.select=t.filter=t.some=t.is=t.aliases=t.pseudos=t.filters=void 0;var c=n(9751),l=n(5366),u=o(n(9432)),h=n(9125),p=n(2515),d=n(5366);Object.defineProperty(t,"filters",{enumerable:!0,get:function(){return d.filters}}),Object.defineProperty(t,"pseudos",{enumerable:!0,get:function(){return d.pseudos}}),Object.defineProperty(t,"aliases",{enumerable:!0,get:function(){return d.aliases}});var f={type:"pseudo",name:"scope",data:null},m=r({},f),T={type:"universal",namespace:null};function _(e,t,n){if(void 0===n&&(n={}),"function"==typeof t)return e.some(t);var r=h.groupSelectors(c.parse(t,n)),i=r[0],s=r[1];return i.length>0&&e.some(l._compileToken(i,n))||s.some((function(t){return g(t,e,n).length>0}))}function E(e,t,n){if(0===t.length)return[];var r,i=h.groupSelectors(e),s=i[0],o=i[1];if(s.length){var a=S(t,s,n);if(0===o.length)return a;a.length&&(r=new Set(a))}for(var c=0;c<o.length&&(null==r?void 0:r.size)!==t.length;c++){var l=o[c];if(0===(r?t.filter((function(e){return u.isTag(e)&&!r.has(e)})):t).length)break;if((a=g(l,t,n)).length)if(r)a.forEach((function(e){return r.add(e)}));else{if(c===o.length-1)return a;r=new Set(a)}}return void 0!==r?r.size===t.length?t:t.filter((function(e){return r.has(e)})):[]}function g(e,t,n){var r;return e.some(c.isTraversal)?O(null!==(r=n.root)&&void 0!==r?r:h.getDocumentRoot(t[0]),a(a([],e),[m]),n,!0,t):O(t,e,n,!1)}t.is=function(e,t,n){return void 0===n&&(n={}),_([e],t,n)},t.some=_,t.filter=function(e,t,n){return void 0===n&&(n={}),E(c.parse(e,n),t,n)},t.select=function(e,t,n){if(void 0===n&&(n={}),"function"==typeof e)return b(t,e);var r=h.groupSelectors(c.parse(e,n)),i=r[0],s=r[1].map((function(e){return O(t,e,n,!0)}));return i.length&&s.push(v(t,i,n,1/0)),1===s.length?s[0]:u.uniqueSort(s.reduce((function(e,t){return a(a([],e),t)})))};var A=new Set(["descendant","adjacent"]);function C(e){return e!==f&&"pseudo"===e.type&&("scope"===e.name||Array.isArray(e.data)&&e.data.some((function(e){return e.some(C)})))}function N(e,t,n){return n&&e.some(C)?r(r({},t),{context:n}):t}function O(e,t,n,r,i){var s=t.findIndex(p.isFilter),o=t.slice(0,s),a=t[s],l=p.getLimit(a.name,a.data);if(0===l)return[];var h=N(o,n,i),d=(0!==o.length||Array.isArray(e)?0===o.length||1===o.length&&o[0]===f?(Array.isArray(e)?e:[e]).filter(u.isTag):r||o.some(c.isTraversal)?v(e,[o],h,l):S(e,[o],h):u.getChildren(e).filter(u.isTag)).slice(0,l),m=function(e,t,n,r){var i="string"==typeof n?parseInt(n,10):NaN;switch(e){case"first":case"lt":return t;case"last":return t.length>0?[t[t.length-1]]:t;case"nth":case"eq":return isFinite(i)&&Math.abs(i)<t.length?[i<0?t[t.length+i]:t[i]]:[];case"gt":return isFinite(i)?t.slice(i+1):[];case"even":return t.filter((function(e,t){return t%2==0}));case"odd":return t.filter((function(e,t){return t%2==1}));case"not":var s=new Set(E(n,t,r));return t.filter((function(e){return!s.has(e)}))}}(a.name,d,a.data,n);if(0===m.length||t.length===s+1)return m;var _=t.slice(s+1),g=_.some(c.isTraversal),C=N(_,n,i);return g&&(A.has(_[0].type)&&_.unshift(T),_.unshift(f)),_.some(p.isFilter)?O(m,_,n,!1,i):g?v(m,[_],C,1/0):S(m,[_],C)}function v(e,t,n,r){return 0===r?[]:b(e,l._compileToken(t,n,e),r)}function b(e,t,n){void 0===n&&(n=1/0);var r=l.prepareContext(e,u,t.shouldTestNextSiblings);return u.find((function(e){return u.isTag(e)&&t(e)}),r,!0,n)}function S(e,t,n){var r=(Array.isArray(e)?e:[e]).filter(u.isTag);if(0===r.length)return r;var i=l._compileToken(t,n);return r.filter(i)}},2515:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLimit=t.isFilter=t.filterNames=void 0,t.filterNames=new Set(["first","last","eq","gt","nth","lt","even","odd"]),t.isFilter=function e(n){return"pseudo"===n.type&&(!!t.filterNames.has(n.name)||!("not"!==n.name||!Array.isArray(n.data))&&n.data.some((function(t){return t.some(e)})))},t.getLimit=function(e,t){var n=null!=t?parseInt(t,10):NaN;switch(e){case"first":return 1;case"nth":case"eq":return isFinite(n)?n>=0?n+1:1/0:0;case"lt":return isFinite(n)?n>=0?n:1/0:0;case"gt":return isFinite(n)?1/0:0;default:return 1/0}}},6451:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toggleClass=t.removeClass=t.addClass=t.hasClass=t.removeAttr=t.val=t.data=t.prop=t.attr=void 0;var r=n(6634),i=n(5633),s=Object.prototype.hasOwnProperty,o=/\s+/,a="data-",c={null:null,true:!0,false:!1},l=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/^{[^]*}$|^\[[^]*]$/;function h(e,t,n){var o;if(e&&i.isTag(e))return null!==(o=e.attribs)&&void 0!==o||(e.attribs={}),t?s.call(e.attribs,t)?!n&&l.test(t)?t:e.attribs[t]:"option"===e.name&&"value"===t?r.text(e.children):"input"!==e.name||"radio"!==e.attribs.type&&"checkbox"!==e.attribs.type||"value"!==t?void 0:"on":e.attribs}function p(e,t,n){null===n?_(e,t):e.attribs[t]=""+n}function d(e,t,n){if(e&&i.isTag(e))return t in e?e[t]:!n&&l.test(t)?void 0!==h(e,t,!1):h(e,t,n)}function f(e,t,n,r){t in e?e[t]=n:p(e,t,!r&&l.test(t)?n?"":null:""+n)}function m(e,t,n){var r,i=e;null!==(r=i.data)&&void 0!==r||(i.data={}),"object"==typeof t?Object.assign(i.data,t):"string"==typeof t&&void 0!==n&&(i.data[t]=n)}function T(e,t){var n,r,o;null==t?r=(n=Object.keys(e.attribs).filter((function(e){return e.startsWith(a)}))).map((function(e){return i.camelCase(e.slice(a.length))})):(n=[a+i.cssCase(t)],r=[t]);for(var l=0;l<n.length;++l){var h=n[l],p=r[l];if(s.call(e.attribs,h)&&!s.call(e.data,p)){if(o=e.attribs[h],s.call(c,o))o=c[o];else if(o===String(Number(o)))o=Number(o);else if(u.test(o))try{o=JSON.parse(o)}catch(e){}e.data[p]=o}}return null==t?e.data:o}function _(e,t){e.attribs&&s.call(e.attribs,t)&&delete e.attribs[t]}function E(e){return e?e.trim().split(o):[]}t.attr=function(e,t){if("object"==typeof e||void 0!==t){if("function"==typeof t){if("string"!=typeof e)throw new Error("Bad combination of arguments.");return i.domEach(this,(function(n,r){i.isTag(n)&&p(n,e,t.call(n,r,n.attribs[e]))}))}return i.domEach(this,(function(n){i.isTag(n)&&("object"==typeof e?Object.keys(e).forEach((function(t){var r=e[t];p(n,t,r)})):p(n,e,t))}))}return arguments.length>1?this:h(this[0],e,this.options.xmlMode)},t.prop=function(e,t){var n=this;if("string"==typeof e&&void 0===t)switch(e){case"style":var r=this.css(),s=Object.keys(r);return s.forEach((function(e,t){r[t]=e})),r.length=s.length,r;case"tagName":case"nodeName":var o=this[0];return i.isTag(o)?o.name.toUpperCase():void 0;case"outerHTML":return this.clone().wrap("<container />").parent().html();case"innerHTML":return this.html();default:return d(this[0],e,this.options.xmlMode)}if("object"==typeof e||void 0!==t){if("function"==typeof t){if("object"==typeof e)throw new Error("Bad combination of arguments.");return i.domEach(this,(function(r,s){i.isTag(r)&&f(r,e,t.call(r,s,d(r,e,n.options.xmlMode)),n.options.xmlMode)}))}return i.domEach(this,(function(r){i.isTag(r)&&("object"==typeof e?Object.keys(e).forEach((function(t){var i=e[t];f(r,t,i,n.options.xmlMode)})):f(r,e,t,n.options.xmlMode))}))}},t.data=function(e,t){var n,r=this[0];if(r&&i.isTag(r)){var o=r;return null!==(n=o.data)&&void 0!==n||(o.data={}),e?"object"==typeof e||void 0!==t?(i.domEach(this,(function(n){i.isTag(n)&&("object"==typeof e?m(n,e):m(n,e,t))})),this):s.call(o.data,e)?o.data[e]:T(o,e):T(o)}},t.val=function(e){var t=0===arguments.length,n=this[0];if(!n||!i.isTag(n))return t?void 0:this;switch(n.name){case"textarea":return this.text(e);case"select":var s=this.find("option:selected");if(!t){if(null==this.attr("multiple")&&"object"==typeof e)return this;this.find("option").removeAttr("selected");for(var o="object"!=typeof e?[e]:e,a=0;a<o.length;a++)this.find('option[value="'+o[a]+'"]').attr("selected","");return this}return this.attr("multiple")?s.toArray().map((function(e){return r.text(e.children)})):s.attr("value");case"input":case"option":return t?this.attr("value"):this.attr("value",e)}},t.removeAttr=function(e){for(var t=E(e),n=function(e){i.domEach(r,(function(n){i.isTag(n)&&_(n,t[e])}))},r=this,s=0;s<t.length;s++)n(s);return this},t.hasClass=function(e){return this.toArray().some((function(t){var n=i.isTag(t)&&t.attribs.class,r=-1;if(n&&e.length)for(;(r=n.indexOf(e,r+1))>-1;){var s=r+e.length;if((0===r||o.test(n[r-1]))&&(s===n.length||o.test(n[s])))return!0}return!1}))},t.addClass=function e(t){if("function"==typeof t)return i.domEach(this,(function(n,r){if(i.isTag(n)){var s=n.attribs.class||"";e.call([n],t.call(n,r,s))}}));if(!t||"string"!=typeof t)return this;for(var n=t.split(o),r=this.length,s=0;s<r;s++){var a=this[s];if(i.isTag(a)){var c=h(a,"class",!1);if(c){for(var l=" "+c+" ",u=0;u<n.length;u++){var d=n[u]+" ";l.includes(" "+d)||(l+=d)}p(a,"class",l.trim())}else p(a,"class",n.join(" ").trim())}}return this},t.removeClass=function e(t){if("function"==typeof t)return i.domEach(this,(function(n,r){i.isTag(n)&&e.call([n],t.call(n,r,n.attribs.class||""))}));var n=E(t),r=n.length,s=0===arguments.length;return i.domEach(this,(function(e){if(i.isTag(e))if(s)e.attribs.class="";else{for(var t=E(e.attribs.class),o=!1,a=0;a<r;a++){var c=t.indexOf(n[a]);c>=0&&(t.splice(c,1),o=!0,a--)}o&&(e.attribs.class=t.join(" "))}}))},t.toggleClass=function e(t,n){if("function"==typeof t)return i.domEach(this,(function(r,s){i.isTag(r)&&e.call([r],t.call(r,s,r.attribs.class||"",n),n)}));if(!t||"string"!=typeof t)return this;for(var r=t.split(o),s=r.length,a="boolean"==typeof n?n?1:-1:0,c=this.length,l=0;l<c;l++){var u=this[l];if(i.isTag(u)){for(var h=E(u.attribs.class),p=0;p<s;p++){var d=h.indexOf(r[p]);a>=0&&d<0?h.push(r[p]):a<=0&&d>=0&&h.splice(d,1)}u.attribs.class=h.join(" ")}}return this}},9806:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.css=void 0;var r=n(5633);function i(e,t,n,r){if("string"==typeof t){var o=s(e),a="function"==typeof n?n.call(e,r,o[t]):n;""===a?delete o[t]:null!=a&&(o[t]=a),e.attribs.style=(c=o,Object.keys(c).reduce((function(e,t){return e+(e?" ":"")+t+": "+c[t]+";"}),""))}else"object"==typeof t&&Object.keys(t).forEach((function(n,r){i(e,n,t[n],r)}));var c}function s(e,t){if(e&&r.isTag(e)){var n=function(e){return(e=(e||"").trim())?e.split(";").reduce((function(e,t){var n=t.indexOf(":");return n<1||n===t.length-1||(e[t.slice(0,n).trim()]=t.slice(n+1).trim()),e}),{}):{}}(e.attribs.style);if("string"==typeof t)return n[t];if(Array.isArray(t)){var i={};return t.forEach((function(e){null!=n[e]&&(i[e]=n[e])})),i}return n}}t.css=function(e,t){return null!=e&&null!=t||"object"==typeof e&&!Array.isArray(e)?r.domEach(this,(function(n,s){r.isTag(n)&&i(n,e,t,s)})):s(this[0],e)}},3432:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeArray=t.serialize=void 0;var r=n(5633),i="input,select,textarea,keygen",s=/%20/g,o=/\r?\n/g;t.serialize=function(){return this.serializeArray().map((function(e){return encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)})).join("&").replace(s,"+")},t.serializeArray=function(){var e=this;return this.map((function(t,n){var s=e._make(n);return r.isTag(n)&&"form"===n.name?s.find(i).toArray():s.filter(i).toArray()})).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map((function(t,n){var r,i=e._make(n),s=i.attr("name"),a=null!==(r=i.val())&&void 0!==r?r:"";return Array.isArray(a)?a.map((function(e){return{name:s,value:e.replace(o,"\r\n")}})):{name:s,value:a.replace(o,"\r\n")}})).toArray()}},848:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=t.text=t.toString=t.html=t.empty=t.replaceWith=t.remove=t.insertBefore=t.before=t.insertAfter=t.after=t.wrapAll=t.unwrap=t.wrapInner=t.wrap=t.prepend=t.append=t.prependTo=t.appendTo=t._makeDomArray=void 0;var r=n(9698),i=n(7915),s=n(7915),o=r.__importStar(n(5012)),a=n(6634),c=n(5633),l=n(3719);function u(e){return function(){for(var t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var s=this.length-1;return c.domEach(this,(function(r,o){if(i.hasChildren(r)){var c="function"==typeof n[0]?n[0].call(r,o,a.html(r.children)):n,l=t._makeDomArray(c,o<s);e(l,r.children,r)}}))}}function h(e,t,n,i,s){for(var o,a,c=r.__spreadArray([t,n],i),l=e[t-1]||null,u=e[t+n]||null,h=0;h<i.length;++h){var p=i[h],d=p.parent;if(d){var f=d.children.indexOf(i[h]);f>-1&&(d.children.splice(f,1),s===d&&t>f&&c[0]--)}p.parent=s,p.prev&&(p.prev.next=null!==(o=p.next)&&void 0!==o?o:null),p.next&&(p.next.prev=null!==(a=p.prev)&&void 0!==a?a:null),p.prev=i[h-1]||l,p.next=i[h+1]||u}return l&&(l.next=i[0]),u&&(u.prev=i[i.length-1]),e.splice.apply(e,c)}function p(e){return function(t){for(var n=this.length-1,r=this.parents().last(),i=0;i<this.length;i++){var s=this[i],o="function"==typeof t?t.call(s,i,s):"string"!=typeof t||c.isHtml(t)?t:r.find(t).clone(),a=this._makeDomArray(o,i<n)[0];if(a&&l.DomUtils.hasChildren(a)){for(var u=a,h=0;h<u.children.length;){var p=u.children[h];c.isTag(p)?(u=p,h=0):h++}e(s,u,[a])}}return this}}t._makeDomArray=function(e,t){var n=this;return null==e?[]:c.isCheerio(e)?t?c.cloneDom(e.get()):e.get():Array.isArray(e)?e.reduce((function(e,r){return e.concat(n._makeDomArray(r,t))}),[]):"string"==typeof e?o.default(e,this.options,!1).children:t?c.cloneDom([e]):[e]},t.appendTo=function(e){return(c.isCheerio(e)?e:this._make(e)).append(this),this},t.prependTo=function(e){return(c.isCheerio(e)?e:this._make(e)).prepend(this),this},t.append=u((function(e,t,n){h(t,t.length,0,e,n)})),t.prepend=u((function(e,t,n){h(t,0,0,e,n)})),t.wrap=p((function(e,t,n){var r=e.parent;if(r){var i=r.children,s=i.indexOf(e);o.update([e],t),h(i,s,0,n,r)}})),t.wrapInner=p((function(e,t,n){i.hasChildren(e)&&(o.update(e.children,t),o.update(n,e))})),t.unwrap=function(e){var t=this;return this.parent(e).not("body").each((function(e,n){t._make(n).replaceWith(n.children)})),this},t.wrapAll=function(e){var t=this[0];if(t){for(var n=this._make("function"==typeof e?e.call(t,0,t):e).insertBefore(t),r=void 0,i=0;i<n.length;i++)"tag"===n[i].type&&(r=n[i]);for(var s=0;r&&s<r.children.length;){var o=r.children[s];"tag"===o.type?(r=o,s=0):s++}r&&this._make(r).append(this)}return this},t.after=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this.length-1;return c.domEach(this,(function(n,i){var s=n.parent;if(l.DomUtils.hasChildren(n)&&s){var o=s.children,c=o.indexOf(n);if(!(c<0)){var u="function"==typeof t[0]?t[0].call(n,i,a.html(n.children)):t;h(o,c+1,0,e._makeDomArray(u,i<r),s)}}}))},t.insertAfter=function(e){var t=this;"string"==typeof e&&(e=this._make(e)),this.remove();var n=[];return this._makeDomArray(e).forEach((function(e){var r=t.clone().toArray(),i=e.parent;if(i){var s=i.children,o=s.indexOf(e);o<0||(h(s,o+1,0,r,i),n.push.apply(n,r))}})),this._make(n)},t.before=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this.length-1;return c.domEach(this,(function(n,i){var s=n.parent;if(l.DomUtils.hasChildren(n)&&s){var o=s.children,c=o.indexOf(n);if(!(c<0)){var u="function"==typeof t[0]?t[0].call(n,i,a.html(n.children)):t;h(o,c,0,e._makeDomArray(u,i<r),s)}}}))},t.insertBefore=function(e){var t=this,n=this._make(e);this.remove();var r=[];return c.domEach(n,(function(e){var n=t.clone().toArray(),i=e.parent;if(i){var s=i.children,o=s.indexOf(e);o<0||(h(s,o,0,n,i),r.push.apply(r,n))}})),this._make(r)},t.remove=function(e){var t=e?this.filter(e):this;return c.domEach(t,(function(e){l.DomUtils.removeElement(e),e.prev=e.next=e.parent=null})),this},t.replaceWith=function(e){var t=this;return c.domEach(this,(function(n,r){var i=n.parent;if(i){var s=i.children,a="function"==typeof e?e.call(n,r,n):e,c=t._makeDomArray(a);o.update(c,null);var l=s.indexOf(n);h(s,l,1,c,i),c.includes(n)||(n.parent=n.prev=n.next=null)}}))},t.empty=function(){return c.domEach(this,(function(e){l.DomUtils.hasChildren(e)&&(e.children.forEach((function(e){e.next=e.prev=e.parent=null})),e.children.length=0)}))},t.html=function(e){if(void 0===e){var t=this[0];return t&&l.DomUtils.hasChildren(t)?a.html(t.children,this.options):null}var n=r.__assign(r.__assign({},this.options),{context:null});return c.domEach(this,(function(t){if(l.DomUtils.hasChildren(t)){t.children.forEach((function(e){e.next=e.prev=e.parent=null})),n.context=t;var r=c.isCheerio(e)?e.toArray():o.default(""+e,n,!1).children;o.update(r,t)}}))},t.toString=function(){return a.html(this,this.options)},t.text=function e(t){var n=this;return void 0===t?a.text(this):"function"==typeof t?c.domEach(this,(function(r,i){e.call(n._make(r),t.call(r,i,a.text([r])))})):c.domEach(this,(function(e){if(l.DomUtils.hasChildren(e)){e.children.forEach((function(e){e.next=e.prev=e.parent=null}));var n=new s.Text(t);o.update(n,e)}}))},t.clone=function(){return this._make(c.cloneDom(this.get()))}},1042:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addBack=t.add=t.end=t.slice=t.index=t.toArray=t.get=t.eq=t.last=t.first=t.has=t.not=t.is=t.filterArray=t.filter=t.map=t.each=t.contents=t.children=t.siblings=t.prevUntil=t.prevAll=t.prev=t.nextUntil=t.nextAll=t.next=t.closest=t.parentsUntil=t.parents=t.parent=t.find=void 0;var r=n(9698),i=n(7915),s=r.__importStar(n(7248)),o=n(5633),a=n(6634),c=n(3719),l=c.DomUtils.uniqueSort,u=/^\s*[~+]/;function h(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return function(r){var i,s=e(t,this);return r&&(s=_(s,r,this.options.xmlMode,null===(i=this._root)||void 0===i?void 0:i[0])),this._make(this.length>1&&s.length>1?n.reduce((function(e,t){return t(e)}),s):s)}}}t.find=function(e){var t;if(!e)return this._make([]);var n=this.toArray();if("string"!=typeof e){var r=o.isCheerio(e)?e.toArray():[e];return this._make(r.filter((function(e){return n.some((function(t){return a.contains(t,e)}))})))}var i=u.test(e)?n:this.children().toArray(),c={context:n,root:null===(t=this._root)||void 0===t?void 0:t[0],xmlMode:this.options.xmlMode};return this._make(s.select(e,i,c))};var p=h((function(e,t){for(var n,r=[],i=0;i<t.length;i++){var s=e(t[i]);r.push(s)}return(n=new Array).concat.apply(n,r)})),d=h((function(e,t){for(var n=[],r=0;r<t.length;r++){var i=e(t[r]);null!==i&&n.push(i)}return n}));function f(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=null,a=h((function(e,t){var n=[];return o.domEach(t,(function(t){for(var r;(r=e(t))&&!(null==i?void 0:i(r,n.length));t=r)n.push(r)})),n})).apply(void 0,r.__spreadArray([e],t));return function(e,t){var n=this;i="string"==typeof e?function(t){return s.is(t,e,n.options)}:e?T(e):null;var r=a.call(this,t);return i=null,r}}function m(e){return Array.from(new Set(e))}function T(e){return"function"==typeof e?function(t,n){return e.call(t,n,t)}:o.isCheerio(e)?function(t){return Array.prototype.includes.call(e,t)}:function(t){return e===t}}function _(e,t,n,r){return"string"==typeof t?s.filter(t,e,{xmlMode:n,root:r}):e.filter(T(t))}t.parent=d((function(e){var t=e.parent;return t&&!i.isDocument(t)?t:null}),m),t.parents=p((function(e){for(var t=[];e.parent&&!i.isDocument(e.parent);)t.push(e.parent),e=e.parent;return t}),l,(function(e){return e.reverse()})),t.parentsUntil=f((function(e){var t=e.parent;return t&&!i.isDocument(t)?t:null}),l,(function(e){return e.reverse()})),t.closest=function(e){var t=this,n=[];return e?(o.domEach(this,(function(r){for(var i;r&&"root"!==r.type;){if(!e||_([r],e,t.options.xmlMode,null===(i=t._root)||void 0===i?void 0:i[0]).length){r&&!n.includes(r)&&n.push(r);break}r=r.parent}})),this._make(n)):this._make(n)},t.next=d((function(e){return c.DomUtils.nextElementSibling(e)})),t.nextAll=p((function(e){for(var t=[];e.next;)e=e.next,o.isTag(e)&&t.push(e);return t}),m),t.nextUntil=f((function(e){return c.DomUtils.nextElementSibling(e)}),m),t.prev=d((function(e){return c.DomUtils.prevElementSibling(e)})),t.prevAll=p((function(e){for(var t=[];e.prev;)e=e.prev,o.isTag(e)&&t.push(e);return t}),m),t.prevUntil=f((function(e){return c.DomUtils.prevElementSibling(e)}),m),t.siblings=p((function(e){return c.DomUtils.getSiblings(e).filter((function(t){return o.isTag(t)&&t!==e}))}),l),t.children=p((function(e){return c.DomUtils.getChildren(e).filter(o.isTag)}),m),t.contents=function(){var e=this.toArray().reduce((function(e,t){return i.hasChildren(t)?e.concat(t.children):e}),[]);return this._make(e)},t.each=function(e){for(var t=0,n=this.length;t<n&&!1!==e.call(this[t],t,this[t]);)++t;return this},t.map=function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n],i=e.call(r,n,r);null!=i&&(t=t.concat(i))}return this._make(t)},t.filter=function(e){var t;return this._make(_(this.toArray(),e,this.options.xmlMode,null===(t=this._root)||void 0===t?void 0:t[0]))},t.filterArray=_,t.is=function(e){var t=this.toArray();return"string"==typeof e?s.some(t.filter(o.isTag),e,this.options):!!e&&t.some(T(e))},t.not=function(e){var t=this.toArray();if("string"==typeof e){var n=new Set(s.filter(e,t,this.options));t=t.filter((function(e){return!n.has(e)}))}else{var r=T(e);t=t.filter((function(e,t){return!r(e,t)}))}return this._make(t)},t.has=function(e){var t=this;return this.filter("string"==typeof e?":has("+e+")":function(n,r){return t._make(r).find(e).length>0})},t.first=function(){return this.length>1?this._make(this[0]):this},t.last=function(){return this.length>0?this._make(this[this.length-1]):this},t.eq=function(e){var t;return 0==(e=+e)&&this.length<=1?this:(e<0&&(e=this.length+e),this._make(null!==(t=this[e])&&void 0!==t?t:[]))},t.get=function(e){return null==e?this.toArray():this[e<0?this.length+e:e]},t.toArray=function(){return Array.prototype.slice.call(this)},t.index=function(e){var t,n;return null==e?(t=this.parent().children(),n=this[0]):"string"==typeof e?(t=this._make(e),n=this[0]):(t=this,n=o.isCheerio(e)?e[0]:e),Array.prototype.indexOf.call(t,n)},t.slice=function(e,t){return this._make(Array.prototype.slice.call(this,e,t))},t.end=function(){var e;return null!==(e=this.prevObject)&&void 0!==e?e:this._make([])},t.add=function(e,t){var n=this._make(e,t),i=l(r.__spreadArray(r.__spreadArray([],this.get()),n.get()));return this._make(i)},t.addBack=function(e){return this.prevObject?this.add(e?this.prevObject.filter(e):this.prevObject):this}},7911:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cheerio=void 0;var r=n(9698),i=r.__importDefault(n(5012)),s=r.__importDefault(n(2754)),o=n(5633),a=r.__importStar(n(6451)),c=r.__importStar(n(1042)),l=r.__importStar(n(848)),u=r.__importStar(n(9806)),h=r.__importStar(n(3432)),p=function(){function e(e,t,n,r){var a=this;if(void 0===r&&(r=s.default),this.length=0,this.options=r,!e)return this;if(n&&("string"==typeof n&&(n=i.default(n,this.options,!1)),this._root=new this.constructor(n,null,null,this.options),this._root._root=this._root),o.isCheerio(e))return e;var c,l="string"==typeof e&&o.isHtml(e)?i.default(e,this.options,!1).children:(c=e).name||"root"===c.type||"text"===c.type||"comment"===c.type?[e]:Array.isArray(e)?e:null;if(l)return l.forEach((function(e,t){a[t]=e})),this.length=l.length,this;var u=e,h=t?"string"==typeof t?o.isHtml(t)?this._make(i.default(t,this.options,!1)):(u=t+" "+u,this._root):o.isCheerio(t)?t:this._make(t):this._root;return h?h.find(u):this}return e.prototype._make=function(e,t){var n=new this.constructor(e,t,this._root,this.options);return n.prevObject=this,n},e}();t.Cheerio=p,p.prototype.cheerio="[cheerio object]",p.prototype.splice=Array.prototype.splice,p.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(p.prototype,a,c,l,u,h)},7503:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.root=t.parseHTML=t.merge=t.contains=void 0;var r=n(9698);r.__exportStar(n(8701),t),r.__exportStar(n(3434),t);var i=n(3434);t.default=i.load([]);var s=r.__importStar(n(6634));t.contains=s.contains,t.merge=s.merge,t.parseHTML=s.parseHTML,t.root=s.root},3434:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.load=void 0;var r=n(9698),i=r.__importStar(n(2754)),s=r.__importStar(n(6634)),o=n(7911),a=r.__importDefault(n(5012));t.load=function e(t,n,c){if(void 0===c&&(c=!0),null==t)throw new Error("cheerio.load() expects a string");var l=r.__assign(r.__assign({},i.default),i.flatten(n)),u=a.default(t,l,c),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(o.Cheerio);function p(e,t,n,s){return void 0===n&&(n=u),new h(e,t,n,r.__assign(r.__assign({},l),i.flatten(s)))}return Object.assign(p,s,{load:e,_root:u,_options:l,fn:h.prototype,prototype:h.prototype}),p}},2754:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatten=void 0;var r=n(9698);t.default={xml:!1,decodeEntities:!0};var i={_useHtmlParser2:!0,xmlMode:!0};t.flatten=function(e){return(null==e?void 0:e.xml)?"boolean"==typeof e.xml?i:r.__assign(r.__assign({},i),e.xml):null!=e?e:void 0}},5012:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.update=void 0;var r=n(3719),i=n(8585),s=n(7957),o=n(7915);function a(e,t){var n=Array.isArray(e)?e:[e];t?t.children=n:t=null;for(var i=0;i<n.length;i++){var s=n[i];s.parent&&s.parent.children!==n&&r.DomUtils.removeElement(s),t?(s.prev=n[i-1]||null,s.next=n[i+1]||null):s.prev=s.next=null,s.parent=t}return t}t.default=function(e,t,n){if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)&&(e=e.toString()),"string"==typeof e)return t.xmlMode||t._useHtmlParser2?i.parse(e,t):s.parse(e,t,n);var r=e;if(!Array.isArray(r)&&o.isDocument(r))return r;var c=new o.Document([]);return a(r,c),c},t.update=a},8585:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.render=t.parse=void 0;var i=n(3719);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return i.parseDocument}});var s=n(7220);Object.defineProperty(t,"render",{enumerable:!0,get:function(){return r(s).default}})},7957:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.render=t.parse=void 0;var r=n(9698),i=n(7915),s=n(2394),o=r.__importDefault(n(1906));t.parse=function(e,t,n){var r={scriptingEnabled:"boolean"!=typeof t.scriptingEnabled||t.scriptingEnabled,treeAdapter:o.default,sourceCodeLocationInfo:t.sourceCodeLocationInfo},i=t.context;return n?s.parse(e,r):s.parseFragment(i,e,r)},t.render=function(e){for(var t,n=("length"in e?e:[e]),a=0;a<n.length;a+=1){var c=n[a];i.isDocument(c)&&(t=Array.prototype.splice).call.apply(t,r.__spreadArray([n,a,1],c.children))}return s.serialize({children:n},{treeAdapter:o.default})}},6634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=t.contains=t.root=t.parseHTML=t.text=t.xml=t.html=void 0;var r=n(9698),i=r.__importStar(n(2754)),s=n(7248),o=n(3719),a=n(7957),c=n(8585);function l(e,t,n){var r,i=t?"string"==typeof t?s.select(t,null!==(r=null==e?void 0:e._root)&&void 0!==r?r:[],n):t:null==e?void 0:e._root.children;return i?n.xmlMode||n._useHtmlParser2?c.render(i,n):a.render(i):""}function u(e){if(Array.isArray(e))return!0;if("object"!=typeof e||!Object.prototype.hasOwnProperty.call(e,"length")||"number"!=typeof e.length||e.length<0)return!1;for(var t=0;t<e.length;t++)if(!(t in e))return!1;return!0}t.html=function(e,t){return!t&&function(e){return"object"==typeof e&&null!=e&&!("length"in e)&&!("type"in e)}(e)&&(t=e,e=void 0),l(this||void 0,e,r.__assign(r.__assign(r.__assign({},i.default),this?this._options:{}),i.flatten(null!=t?t:{})))},t.xml=function(e){return l(this,e,r.__assign(r.__assign({},this._options),{xmlMode:!0}))},t.text=function e(t){for(var n=t||(this?this.root():[]),r="",i=0;i<n.length;i++){var s=n[i];o.DomUtils.isText(s)?r+=s.data:o.DomUtils.hasChildren(s)&&s.type!==o.ElementType.Comment&&s.type!==o.ElementType.Script&&s.type!==o.ElementType.Style&&(r+=e(s.children))}return r},t.parseHTML=function(e,t,n){if(void 0===n&&(n="boolean"==typeof t&&t),!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t);var r=this.load(e,i.default,!1);return n||r("script").remove(),r.root()[0].children.slice()},t.root=function(){return this(this._root)},t.contains=function(e,t){if(t===e)return!1;for(var n=t;n&&n!==n.parent;)if((n=n.parent)===e)return!0;return!1},t.merge=function(e,t){if(u(e)&&u(t)){for(var n=e.length,r=+t.length,i=0;i<r;i++)e[n++]=t[i];return e.length=n,e}}},8701:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5633:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHtml=t.cloneDom=t.domEach=t.cssCase=t.camelCase=t.isCheerio=t.isTag=void 0;var r=n(3719),i=n(7915);t.isTag=r.DomUtils.isTag,t.isCheerio=function(e){return null!=e.cheerio},t.camelCase=function(e){return e.replace(/[_.-](\w|$)/g,(function(e,t){return t.toUpperCase()}))},t.cssCase=function(e){return e.replace(/[A-Z]/g,"-$&").toLowerCase()},t.domEach=function(e,t){for(var n=e.length,r=0;r<n;r++)t(e[r],r);return e},t.cloneDom=function(e){var t="length"in e?Array.prototype.map.call(e,(function(e){return i.cloneNode(e,!0)})):[i.cloneNode(e,!0)],n=new i.Document(t);return t.forEach((function(e){e.parent=n})),t};var s=/<[a-zA-Z][^]*>/;t.isHtml=function(e){return s.test(e)}},9698:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__extends:()=>i,__assign:()=>s,__rest:()=>o,__decorate:()=>a,__param:()=>c,__metadata:()=>l,__awaiter:()=>u,__generator:()=>h,__createBinding:()=>p,__exportStar:()=>d,__values:()=>f,__read:()=>m,__spread:()=>T,__spreadArrays:()=>_,__spreadArray:()=>E,__await:()=>g,__asyncGenerator:()=>A,__asyncDelegator:()=>C,__asyncValues:()=>N,__makeTemplateObject:()=>O,__importStar:()=>b,__importDefault:()=>S,__classPrivateFieldGet:()=>y,__classPrivateFieldSet:()=>I});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function c(e,t){return function(n,r){t(n,r,e)}}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))}function h(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}var p=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function d(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||p(t,e,n)}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function T(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function _(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function E(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||t)}function g(e){return this instanceof g?(this.v=e,this):new g(e)}function A(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof g?Promise.resolve(n.value.v).then(c,l):u(s[0][2],n)}catch(e){u(s[0][3],e)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function C(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:g(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function N(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var v=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function b(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&p(t,e,n);return v(t,e),t}function S(e){return e&&e.__esModule?e:{default:e}}function y(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function I(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}},996:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attributeRules=void 0;var r=n(1073),i=/[-[\]{}()*+?.,\\^$|#\s]/g;function s(e){return e.replace(i,"\\$&")}t.attributeRules={equals:function(e,t,n){var r=n.adapter,i=t.name,s=t.value;return t.ignoreCase?(s=s.toLowerCase(),function(t){var n=r.getAttributeValue(t,i);return null!=n&&n.length===s.length&&n.toLowerCase()===s&&e(t)}):function(t){return r.getAttributeValue(t,i)===s&&e(t)}},hyphen:function(e,t,n){var r=n.adapter,i=t.name,s=t.value,o=s.length;return t.ignoreCase?(s=s.toLowerCase(),function(t){var n=r.getAttributeValue(t,i);return null!=n&&(n.length===o||"-"===n.charAt(o))&&n.substr(0,o).toLowerCase()===s&&e(t)}):function(t){var n=r.getAttributeValue(t,i);return null!=n&&(n.length===o||"-"===n.charAt(o))&&n.substr(0,o)===s&&e(t)}},element:function(e,t,n){var i=t.name,o=t.value,a=t.ignoreCase,c=n.adapter;if(/\s/.test(o))return r.falseFunc;var l=new RegExp("(?:^|\\s)"+s(o)+"(?:$|\\s)",a?"i":"");return function(t){var n=c.getAttributeValue(t,i);return null!=n&&n.length>=o.length&&l.test(n)&&e(t)}},exists:function(e,t,n){var r=t.name,i=n.adapter;return function(t){return i.hasAttrib(t,r)&&e(t)}},start:function(e,t,n){var i=n.adapter,s=t.name,o=t.value,a=o.length;return 0===a?r.falseFunc:t.ignoreCase?(o=o.toLowerCase(),function(t){var n=i.getAttributeValue(t,s);return null!=n&&n.length>=a&&n.substr(0,a).toLowerCase()===o&&e(t)}):function(t){var n;return!!(null===(n=i.getAttributeValue(t,s))||void 0===n?void 0:n.startsWith(o))&&e(t)}},end:function(e,t,n){var i=n.adapter,s=t.name,o=t.value,a=-o.length;return 0===a?r.falseFunc:t.ignoreCase?(o=o.toLowerCase(),function(t){var n;return(null===(n=i.getAttributeValue(t,s))||void 0===n?void 0:n.substr(a).toLowerCase())===o&&e(t)}):function(t){var n;return!!(null===(n=i.getAttributeValue(t,s))||void 0===n?void 0:n.endsWith(o))&&e(t)}},any:function(e,t,n){var i=n.adapter,o=t.name,a=t.value;if(""===a)return r.falseFunc;if(t.ignoreCase){var c=new RegExp(s(a),"i");return function(t){var n=i.getAttributeValue(t,o);return null!=n&&n.length>=a.length&&c.test(n)&&e(t)}}return function(t){var n;return!!(null===(n=i.getAttributeValue(t,o))||void 0===n?void 0:n.includes(a))&&e(t)}},not:function(e,t,n){var r=n.adapter,i=t.name,s=t.value;return""===s?function(t){return!!r.getAttributeValue(t,i)&&e(t)}:t.ignoreCase?(s=s.toLowerCase(),function(t){var n=r.getAttributeValue(t,i);return(null==n||n.length!==s.length||n.toLowerCase()!==s)&&e(t)}):function(t){return r.getAttributeValue(t,i)!==s&&e(t)}}}},8866:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.compileToken=t.compileUnsafe=t.compile=void 0;var i=n(9751),s=n(1073),o=r(n(7353)),a=n(7177),c=n(3621),l=n(1768);function u(e,t,n){return m("string"==typeof e?i.parse(e,t):e,t,n)}function h(e){return"pseudo"===e.type&&("scope"===e.name||Array.isArray(e.data)&&e.data.some((function(e){return e.some(h)})))}t.compile=function(e,t,n){var r=u(e,t,n);return l.ensureIsTag(r,t.adapter)},t.compileUnsafe=u;var p={type:"descendant"},d={type:"_flexibleDescendant"},f={type:"pseudo",name:"scope",data:null};function m(e,t,n){var r;(e=e.filter((function(e){return e.length>0}))).forEach(o.default),n=null!==(r=t.context)&&void 0!==r?r:n;var i=Array.isArray(n),u=n&&(Array.isArray(n)?n:[n]);!function(e,t,n){for(var r=t.adapter,i=!!(null==n?void 0:n.every((function(e){var t=r.isTag(e)&&r.getParent(e);return e===l.PLACEHOLDER_ELEMENT||t&&r.isTag(t)}))),s=0,o=e;s<o.length;s++){var c=o[s];if(c.length>0&&a.isTraversal(c[0])&&"descendant"!==c[0].type);else{if(!i||c.some(h))continue;c.unshift(p)}c.unshift(f)}}(e,t,u);var _=!1,E=e.map((function(e){if(e.length>=2){var n=e[0],r=e[1];"pseudo"!==n.type||"scope"!==n.name||(i&&"descendant"===r.type?e[1]=d:"adjacent"!==r.type&&"sibling"!==r.type||(_=!0))}return function(e,t,n){var r;return e.reduce((function(e,r){return e===s.falseFunc?s.falseFunc:c.compileGeneralSelector(e,r,t,n,m)}),null!==(r=t.rootFunc)&&void 0!==r?r:s.trueFunc)}(e,t,u)})).reduce(T,s.falseFunc);return E.shouldTestNextSiblings=_,E}function T(e,t){return t===s.falseFunc||e===s.trueFunc?e:e===s.falseFunc||t===s.trueFunc?t:function(n){return e(n)||t(n)}}t.compileToken=m},3621:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compileGeneralSelector=void 0;var r=n(996),i=n(8677);t.compileGeneralSelector=function(e,t,n,s,o){var a=n.adapter,c=n.equals;switch(t.type){case"pseudo-element":throw new Error("Pseudo-elements are not supported by css-select");case"attribute":return r.attributeRules[t.action](e,t,n);case"pseudo":return i.compilePseudoSelector(e,t,n,s,o);case"tag":return function(n){return a.getName(n)===t.name&&e(n)};case"descendant":if(!1===n.cacheResults||"undefined"==typeof WeakSet)return function(t){for(var n=t;n=a.getParent(n);)if(a.isTag(n)&&e(n))return!0;return!1};var l=new WeakSet;return function(t){for(var n=t;n=a.getParent(n);)if(!l.has(n)){if(a.isTag(n)&&e(n))return!0;l.add(n)}return!1};case"_flexibleDescendant":return function(t){var n=t;do{if(a.isTag(n)&&e(n))return!0}while(n=a.getParent(n));return!1};case"parent":return function(t){return a.getChildren(t).some((function(t){return a.isTag(t)&&e(t)}))};case"child":return function(t){var n=a.getParent(t);return null!=n&&a.isTag(n)&&e(n)};case"sibling":return function(t){for(var n=a.getSiblings(t),r=0;r<n.length;r++){var i=n[r];if(c(t,i))break;if(a.isTag(i)&&e(i))return!0}return!1};case"adjacent":return function(t){for(var n,r=a.getSiblings(t),i=0;i<r.length;i++){var s=r[i];if(c(t,s))break;a.isTag(s)&&(n=s)}return!!n&&e(n)};case"universal":return e}}},5366:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.aliases=t.pseudos=t.filters=t.is=t.selectOne=t.selectAll=t.prepareContext=t._compileToken=t._compileUnsafe=t.compile=void 0;var o=s(n(9432)),a=n(1073),c=n(8866),l=n(1768),u=function(e,t){return e===t},h={adapter:o,equals:u};function p(e){var t,n,r,i,s=null!=e?e:h;return null!==(t=s.adapter)&&void 0!==t||(s.adapter=o),null!==(n=s.equals)&&void 0!==n||(s.equals=null!==(i=null===(r=s.adapter)||void 0===r?void 0:r.equals)&&void 0!==i?i:u),s}function d(e){return function(t,n,r){var i=p(n);return e(t,i,r)}}function f(e){return function(t,n,r){var i=p(r);"function"!=typeof t&&(t=c.compileUnsafe(t,i,n));var s=m(n,i.adapter,t.shouldTestNextSiblings);return e(t,s,i)}}function m(e,t,n){return void 0===n&&(n=!1),n&&(e=function(e,t){for(var n=Array.isArray(e)?e.slice(0):[e],r=0;r<n.length;r++){var i=l.getNextSiblings(n[r],t);n.push.apply(n,i)}return n}(e,t)),Array.isArray(e)?t.removeSubsets(e):t.getChildren(e)}t.compile=d(c.compile),t._compileUnsafe=d(c.compileUnsafe),t._compileToken=d(c.compileToken),t.prepareContext=m,t.selectAll=f((function(e,t,n){return e!==a.falseFunc&&t&&0!==t.length?n.adapter.findAll(e,t):[]})),t.selectOne=f((function(e,t,n){return e!==a.falseFunc&&t&&0!==t.length?n.adapter.findOne(e,t):null})),t.is=function(e,t,n){var r=p(n);return("function"==typeof t?t:c.compile(t,r))(e)},t.default=t.selectAll;var T=n(8677);Object.defineProperty(t,"filters",{enumerable:!0,get:function(){return T.filters}}),Object.defineProperty(t,"pseudos",{enumerable:!0,get:function(){return T.pseudos}}),Object.defineProperty(t,"aliases",{enumerable:!0,get:function(){return T.aliases}})},7177:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isTraversal=t.procedure=void 0,t.procedure={universal:50,tag:30,attribute:1,pseudo:0,"pseudo-element":0,descendant:-1,child:-1,parent:-1,sibling:-1,adjacent:-1,_flexibleDescendant:-1},t.isTraversal=function(e){return t.procedure[e.type]<0}},2968:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.aliases=void 0,t.aliases={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}},7689:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.filters=void 0;var i=r(n(7540)),s=n(1073);function o(e,t){return function(n){var r=t.getParent(n);return null!=r&&t.isTag(r)&&e(n)}}function a(e){return function(t,n,r){var i=r.adapter[e];return"function"!=typeof i?s.falseFunc:function(e){return i(e)&&t(e)}}}t.filters={contains:function(e,t,n){var r=n.adapter;return function(n){return e(n)&&r.getText(n).includes(t)}},icontains:function(e,t,n){var r=n.adapter,i=t.toLowerCase();return function(t){return e(t)&&r.getText(t).toLowerCase().includes(i)}},"nth-child":function(e,t,n){var r=n.adapter,a=n.equals,c=i.default(t);return c===s.falseFunc?s.falseFunc:c===s.trueFunc?o(e,r):function(t){for(var n=r.getSiblings(t),i=0,s=0;s<n.length&&!a(t,n[s]);s++)r.isTag(n[s])&&i++;return c(i)&&e(t)}},"nth-last-child":function(e,t,n){var r=n.adapter,a=n.equals,c=i.default(t);return c===s.falseFunc?s.falseFunc:c===s.trueFunc?o(e,r):function(t){for(var n=r.getSiblings(t),i=0,s=n.length-1;s>=0&&!a(t,n[s]);s--)r.isTag(n[s])&&i++;return c(i)&&e(t)}},"nth-of-type":function(e,t,n){var r=n.adapter,a=n.equals,c=i.default(t);return c===s.falseFunc?s.falseFunc:c===s.trueFunc?o(e,r):function(t){for(var n=r.getSiblings(t),i=0,s=0;s<n.length;s++){var o=n[s];if(a(t,o))break;r.isTag(o)&&r.getName(o)===r.getName(t)&&i++}return c(i)&&e(t)}},"nth-last-of-type":function(e,t,n){var r=n.adapter,a=n.equals,c=i.default(t);return c===s.falseFunc?s.falseFunc:c===s.trueFunc?o(e,r):function(t){for(var n=r.getSiblings(t),i=0,s=n.length-1;s>=0;s--){var o=n[s];if(a(t,o))break;r.isTag(o)&&r.getName(o)===r.getName(t)&&i++}return c(i)&&e(t)}},root:function(e,t,n){var r=n.adapter;return function(t){var n=r.getParent(t);return(null==n||!r.isTag(n))&&e(t)}},scope:function(e,n,r,i){var s=r.equals;return i&&0!==i.length?1===i.length?function(t){return s(i[0],t)&&e(t)}:function(t){return i.includes(t)&&e(t)}:t.filters.root(e,n,r)},hover:a("isHovered"),visited:a("isVisited"),active:a("isActive")}},8677:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compilePseudoSelector=t.aliases=t.pseudos=t.filters=void 0;var r=n(1073),i=n(9751),s=n(7689);Object.defineProperty(t,"filters",{enumerable:!0,get:function(){return s.filters}});var o=n(7221);Object.defineProperty(t,"pseudos",{enumerable:!0,get:function(){return o.pseudos}});var a=n(2968);Object.defineProperty(t,"aliases",{enumerable:!0,get:function(){return a.aliases}});var c=n(1768);t.compilePseudoSelector=function(e,t,n,l,u){var h=t.name,p=t.data;if(Array.isArray(p))return c.subselects[h](e,p,n,l,u);if(h in a.aliases){if(null!=p)throw new Error("Pseudo "+h+" doesn't have any arguments");var d=i.parse(a.aliases[h],n);return c.subselects.is(e,d,n,l,u)}if(h in s.filters)return s.filters[h](e,p,n,l);if(h in o.pseudos){var f=o.pseudos[h];return o.verifyPseudoArgs(f,h,p),f===r.falseFunc?r.falseFunc:e===r.trueFunc?function(e){return f(e,n,p)}:function(t){return f(t,n,p)&&e(t)}}throw new Error("unmatched pseudo-class :"+h)}},7221:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyPseudoArgs=t.pseudos=void 0,t.pseudos={empty:function(e,t){var n=t.adapter;return!n.getChildren(e).some((function(e){return n.isTag(e)||""!==n.getText(e)}))},"first-child":function(e,t){var n=t.adapter,r=t.equals,i=n.getSiblings(e).find((function(e){return n.isTag(e)}));return null!=i&&r(e,i)},"last-child":function(e,t){for(var n=t.adapter,r=t.equals,i=n.getSiblings(e),s=i.length-1;s>=0;s--){if(r(e,i[s]))return!0;if(n.isTag(i[s]))break}return!1},"first-of-type":function(e,t){for(var n=t.adapter,r=t.equals,i=n.getSiblings(e),s=n.getName(e),o=0;o<i.length;o++){var a=i[o];if(r(e,a))return!0;if(n.isTag(a)&&n.getName(a)===s)break}return!1},"last-of-type":function(e,t){for(var n=t.adapter,r=t.equals,i=n.getSiblings(e),s=n.getName(e),o=i.length-1;o>=0;o--){var a=i[o];if(r(e,a))return!0;if(n.isTag(a)&&n.getName(a)===s)break}return!1},"only-of-type":function(e,t){var n=t.adapter,r=t.equals,i=n.getName(e);return n.getSiblings(e).every((function(t){return r(e,t)||!n.isTag(t)||n.getName(t)!==i}))},"only-child":function(e,t){var n=t.adapter,r=t.equals;return n.getSiblings(e).every((function(t){return r(e,t)||!n.isTag(t)}))}},t.verifyPseudoArgs=function(e,t,n){if(null===n){if(e.length>2)throw new Error("pseudo-selector :"+t+" requires an argument")}else if(2===e.length)throw new Error("pseudo-selector :"+t+" doesn't have any arguments")}},1768:function(e,t,n){"use strict";var r=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.subselects=t.getNextSiblings=t.ensureIsTag=t.PLACEHOLDER_ELEMENT=void 0;var i=n(1073),s=n(7177);function o(e,t){return e===i.falseFunc?i.falseFunc:function(n){return t.isTag(n)&&e(n)}}function a(e,t){var n=t.getSiblings(e);if(n.length<=1)return[];var r=n.indexOf(e);return r<0||r===n.length-1?[]:n.slice(r+1).filter(t.isTag)}t.PLACEHOLDER_ELEMENT={},t.ensureIsTag=o,t.getNextSiblings=a;var c=function(e,t,n,r,i){var s=i(t,{xmlMode:!!n.xmlMode,adapter:n.adapter,equals:n.equals},r);return function(t){return s(t)&&e(t)}};t.subselects={is:c,matches:c,not:function(e,t,n,r,s){var o=s(t,{xmlMode:!!n.xmlMode,adapter:n.adapter,equals:n.equals},r);return o===i.falseFunc?e:o===i.trueFunc?i.falseFunc:function(t){return!o(t)&&e(t)}},has:function(e,n,c,l,u){var h=c.adapter,p={xmlMode:!!c.xmlMode,adapter:h,equals:c.equals},d=n.some((function(e){return e.some(s.isTraversal)}))?[t.PLACEHOLDER_ELEMENT]:void 0,f=u(n,p,d);if(f===i.falseFunc)return i.falseFunc;if(f===i.trueFunc)return function(t){return h.getChildren(t).some(h.isTag)&&e(t)};var m=o(f,h),T=f.shouldTestNextSiblings,_=void 0!==T&&T;return d?function(t){d[0]=t;var n=h.getChildren(t),i=_?r(r([],n),a(t,h)):n;return e(t)&&h.existsOne(m,i)}:function(t){return e(t)&&h.existsOne(m,h.getChildren(t))}}}},7353:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7177),i={exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function s(e){var t=r.procedure[e.type];if("attribute"===e.type)(t=i[e.action])===i.equals&&"id"===e.name&&(t=9),e.ignoreCase&&(t>>=1);else if("pseudo"===e.type)if(e.data)if("has"===e.name||"contains"===e.name)t=0;else if(Array.isArray(e.data)){t=0;for(var n=0;n<e.data.length;n++)if(1===e.data[n].length){var o=s(e.data[n][0]);if(0===o){t=0;break}o>t&&(t=o)}e.data.length>1&&t>0&&(t-=1)}else t=1;else t=3;return t}t.default=function(e){for(var t=e.map(s),n=1;n<e.length;n++){var r=t[n];if(!(r<0))for(var i=n-1;i>=0&&r<t[i];i--){var o=e[i+1];e[i+1]=e[i],e[i]=o,t[i+1]=t[i],t[i]=r}}}},9751:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=t.parse=void 0,i(n(675),t);var o=n(675);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return s(o).default}});var a=n(6868);Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s(a).default}})},675:function(e,t){"use strict";var n=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isTraversal=void 0;var r=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,i=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,s=new Map([["~","element"],["^","start"],["$","end"],["*","any"],["!","not"],["|","hyphen"]]),o={">":"child","<":"parent","~":"sibling","+":"adjacent"},a={"#":["id","equals"],".":["class","element"]},c=new Set(["has","not","matches","is","host","host-context"]),l=new Set(n(["descendant"],Object.keys(o).map((function(e){return o[e]})))),u=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function h(e){return l.has(e.type)}t.isTraversal=h;var p=new Set(["contains","icontains"]),d=new Set(['"',"'"]);function f(e,t,n){var r=parseInt(t,16)-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)}function m(e){return e.replace(i,f)}function T(e){return" "===e||"\n"===e||"\t"===e||"\f"===e||"\r"===e}function _(e,t,n,i){var l,f;void 0===n&&(n={});var g=[],A=!1;function C(e){var n=t.slice(i+e).match(r);if(!n)throw new Error("Expected name, found "+t.slice(i));var s=n[0];return i+=e+s.length,m(s)}function N(e){for(;T(t.charAt(i+e));)e++;i+=e}function O(e){for(var n=0;"\\"===t.charAt(--e);)n++;return 1==(1&n)}function v(){if(g.length>0&&h(g[g.length-1]))throw new Error("Did not expect successive traversals.")}for(N(0);""!==t;){var b=t.charAt(i);if(T(b))A=!0,N(1);else if(b in o)v(),g.push({type:o[b]}),A=!1,N(1);else if(","===b){if(0===g.length)throw new Error("Empty sub-selector");e.push(g),g=[],A=!1,N(1)}else if(t.startsWith("/*",i)){var S=t.indexOf("*/",i+2);if(S<0)throw new Error("Comment was not terminated");i=S+2}else if(A&&(v(),g.push({type:"descendant"}),A=!1),b in a){var y=a[b],I=y[0],k=y[1];g.push({type:"attribute",name:I,action:k,value:C(1),namespace:null,ignoreCase:!!n.xmlMode&&null})}else if("["===b){N(1);var R=void 0,L=null;"|"===t.charAt(i)&&(L="",i+=1),t.startsWith("*|",i)&&(L="*",i+=2),R=C(0),null===L&&"|"===t.charAt(i)&&"="!==t.charAt(i+1)&&(L=R,R=C(1)),(null!==(l=n.lowerCaseAttributeNames)&&void 0!==l?l:!n.xmlMode)&&(R=R.toLowerCase()),N(0),k="exists";var M=s.get(t.charAt(i));if(M){if(k=M,"="!==t.charAt(i+1))throw new Error("Expected `=`");N(2)}else"="===t.charAt(i)&&(k="equals",N(1));var x="",P=null;if("exists"!==k){if(d.has(t.charAt(i))){for(var D=t.charAt(i),w=i+1;w<t.length&&(t.charAt(w)!==D||O(w));)w+=1;if(t.charAt(w)!==D)throw new Error("Attribute value didn't end");x=m(t.slice(i+1,w)),i=w+1}else{for(var H=i;i<t.length&&(!T(t.charAt(i))&&"]"!==t.charAt(i)||O(i));)i+=1;x=m(t.slice(H,i))}N(0);var F=t.charAt(i);"s"===F||"S"===F?(P=!1,N(1)):"i"!==F&&"I"!==F||(P=!0,N(1))}if(n.xmlMode||null!=P||(P=u.has(R)),"]"!==t.charAt(i))throw new Error("Attribute selector didn't terminate");i+=1;var U={type:"attribute",name:R,action:k,value:x,namespace:L,ignoreCase:P};g.push(U)}else if(":"===b){if(":"===t.charAt(i+1)){g.push({type:"pseudo-element",name:C(2).toLowerCase()});continue}var B=C(1).toLowerCase(),G=null;if("("===t.charAt(i))if(c.has(B)){if(d.has(t.charAt(i+1)))throw new Error("Pseudo-selector "+B+" cannot be quoted");if(i=_(G=[],t,n,i+1),")"!==t.charAt(i))throw new Error("Missing closing parenthesis in :"+B+" ("+t+")");i+=1}else{for(var j=i+=1,q=1;q>0&&i<t.length;i++)"("!==t.charAt(i)||O(i)?")"!==t.charAt(i)||O(i)||q--:q++;if(q)throw new Error("Parenthesis not matched");if(G=t.slice(j,i-1),p.has(B)){var K=G.charAt(0);K===G.slice(-1)&&d.has(K)&&(G=G.slice(1,-1)),G=m(G)}}g.push({type:"pseudo",name:B,data:G})}else{L=null;var V=void 0;if("*"===b)i+=1,V="*";else{if(!r.test(t.slice(i)))return g.length&&"descendant"===g[g.length-1].type&&g.pop(),E(e,g),i;"|"===t.charAt(i)&&(L="",i+=1),V=C(0)}"|"===t.charAt(i)&&(L=V,"*"===t.charAt(i+1)?(V="*",i+=2):V=C(1)),"*"===V?g.push({type:"universal",namespace:L}):((null!==(f=n.lowerCaseTags)&&void 0!==f?f:!n.xmlMode)&&(V=V.toLowerCase()),g.push({type:"tag",name:V,namespace:L}))}}return E(e,g),i}function E(e,t){if(e.length>0&&0===t.length)throw new Error("Empty sub-selector");e.push(t)}t.default=function(e,t){var n=[],r=_(n,""+e,t,0);if(r<e.length)throw new Error("Unmatched selector: "+e.slice(r));return n}},6868:function(e,t){"use strict";var n=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0});var r={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"},i=new Set(n(n([],Object.keys(r).map((function(e){return r[e]})).filter(Boolean)),[":","[","]"," ","\\","(",")","'"]));function s(e){return e.map(o).join(", ")}function o(e){return e.map(a).join("")}function a(e){switch(e.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return l(e.namespace)+"*";case"tag":return c(e);case"pseudo-element":return"::"+u(e.name);case"pseudo":return null===e.data?":"+u(e.name):"string"==typeof e.data?":"+u(e.name)+"("+u(e.data)+")":":"+u(e.name)+"("+s(e.data)+")";case"attribute":if("id"===e.name&&"equals"===e.action&&!e.ignoreCase&&!e.namespace)return"#"+u(e.value);if("class"===e.name&&"element"===e.action&&!e.ignoreCase&&!e.namespace)return"."+u(e.value);var t=c(e);return"exists"===e.action?"["+t+"]":"["+t+r[e.action]+"='"+u(e.value)+"'"+(e.ignoreCase?"i":!1===e.ignoreCase?"s":"")+"]"}}function c(e){return""+l(e.namespace)+u(e.name)}function l(e){return null!==e?("*"===e?"*":u(e))+"|":""}function u(e){return e.split("").map((function(e){return i.has(e)?"\\"+e:e})).join("")}t.default=s},7837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attributeNames=t.elementNames=void 0,t.elementNames=new Map([["altglyph","altGlyph"],["altglyphdef","altGlyphDef"],["altglyphitem","altGlyphItem"],["animatecolor","animateColor"],["animatemotion","animateMotion"],["animatetransform","animateTransform"],["clippath","clipPath"],["feblend","feBlend"],["fecolormatrix","feColorMatrix"],["fecomponenttransfer","feComponentTransfer"],["fecomposite","feComposite"],["feconvolvematrix","feConvolveMatrix"],["fediffuselighting","feDiffuseLighting"],["fedisplacementmap","feDisplacementMap"],["fedistantlight","feDistantLight"],["fedropshadow","feDropShadow"],["feflood","feFlood"],["fefunca","feFuncA"],["fefuncb","feFuncB"],["fefuncg","feFuncG"],["fefuncr","feFuncR"],["fegaussianblur","feGaussianBlur"],["feimage","feImage"],["femerge","feMerge"],["femergenode","feMergeNode"],["femorphology","feMorphology"],["feoffset","feOffset"],["fepointlight","fePointLight"],["fespecularlighting","feSpecularLighting"],["fespotlight","feSpotLight"],["fetile","feTile"],["feturbulence","feTurbulence"],["foreignobject","foreignObject"],["glyphref","glyphRef"],["lineargradient","linearGradient"],["radialgradient","radialGradient"],["textpath","textPath"]]),t.attributeNames=new Map([["definitionurl","definitionURL"],["attributename","attributeName"],["attributetype","attributeType"],["basefrequency","baseFrequency"],["baseprofile","baseProfile"],["calcmode","calcMode"],["clippathunits","clipPathUnits"],["diffuseconstant","diffuseConstant"],["edgemode","edgeMode"],["filterunits","filterUnits"],["glyphref","glyphRef"],["gradienttransform","gradientTransform"],["gradientunits","gradientUnits"],["kernelmatrix","kernelMatrix"],["kernelunitlength","kernelUnitLength"],["keypoints","keyPoints"],["keysplines","keySplines"],["keytimes","keyTimes"],["lengthadjust","lengthAdjust"],["limitingconeangle","limitingConeAngle"],["markerheight","markerHeight"],["markerunits","markerUnits"],["markerwidth","markerWidth"],["maskcontentunits","maskContentUnits"],["maskunits","maskUnits"],["numoctaves","numOctaves"],["pathlength","pathLength"],["patterncontentunits","patternContentUnits"],["patterntransform","patternTransform"],["patternunits","patternUnits"],["pointsatx","pointsAtX"],["pointsaty","pointsAtY"],["pointsatz","pointsAtZ"],["preservealpha","preserveAlpha"],["preserveaspectratio","preserveAspectRatio"],["primitiveunits","primitiveUnits"],["refx","refX"],["refy","refY"],["repeatcount","repeatCount"],["repeatdur","repeatDur"],["requiredextensions","requiredExtensions"],["requiredfeatures","requiredFeatures"],["specularconstant","specularConstant"],["specularexponent","specularExponent"],["spreadmethod","spreadMethod"],["startoffset","startOffset"],["stddeviation","stdDeviation"],["stitchtiles","stitchTiles"],["surfacescale","surfaceScale"],["systemlanguage","systemLanguage"],["tablevalues","tableValues"],["targetx","targetX"],["targety","targetY"],["textlength","textLength"],["viewbox","viewBox"],["viewtarget","viewTarget"],["xchannelselector","xChannelSelector"],["ychannelselector","yChannelSelector"],["zoomandpan","zoomAndPan"]])},7220:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(9960)),c=n(5863),l=n(7837),u=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]),h=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function p(e,t){void 0===t&&(t={});for(var n=("length"in e?e:[e]),r="",i=0;i<n.length;i++)r+=d(n[i],t);return r}function d(e,t){switch(e.type){case a.Root:return p(e.children,t);case a.Directive:case a.Doctype:return"<"+e.data+">";case a.Comment:return"\x3c!--"+e.data+"--\x3e";case a.CDATA:return function(e){return"<![CDATA["+e.children[0].data+"]]>"}(e);case a.Script:case a.Style:case a.Tag:return function(e,t){var n;"foreign"===t.xmlMode&&(e.name=null!==(n=l.elementNames.get(e.name))&&void 0!==n?n:e.name,e.parent&&f.has(e.parent.name)&&(t=r(r({},t),{xmlMode:!1}))),!t.xmlMode&&m.has(e.name)&&(t=r(r({},t),{xmlMode:"foreign"}));var i="<"+e.name,s=function(e,t){if(e)return Object.keys(e).map((function(n){var r,i,s=null!==(r=e[n])&&void 0!==r?r:"";return"foreign"===t.xmlMode&&(n=null!==(i=l.attributeNames.get(n))&&void 0!==i?i:n),t.emptyAttrs||t.xmlMode||""!==s?n+'="'+(!1!==t.decodeEntities?c.encodeXML(s):s.replace(/"/g,"&quot;"))+'"':n})).join(" ")}(e.attribs,t);return s&&(i+=" "+s),0===e.children.length&&(t.xmlMode?!1!==t.selfClosingTags:t.selfClosingTags&&h.has(e.name))?(t.xmlMode||(i+=" "),i+="/>"):(i+=">",e.children.length>0&&(i+=p(e.children,t)),!t.xmlMode&&h.has(e.name)||(i+="</"+e.name+">")),i}(e,t);case a.Text:return function(e,t){var n=e.data||"";return!1===t.decodeEntities||!t.xmlMode&&e.parent&&u.has(e.parent.name)||(n=c.encodeXML(n)),n}(e,t)}}t.default=p;var f=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),m=new Set(["svg","math"])},9960:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},7915:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var s=n(9960),o=n(7790);i(n(7790),t);var a=/\s+/g,c={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=c),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:c,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){var e;this.dom=[],this.root=new o.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null!==(e=this.parser)&&void 0!==e?e:null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?s.ElementType.Tag:void 0,r=new o.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.options.normalizeWhitespace,n=this.lastNode;if(n&&n.type===s.ElementType.Text)t?n.data=(n.data+e).replace(a," "):n.data+=e;else{t&&(e=e.replace(a," "));var r=new o.Text(e);this.addNode(r),this.lastNode=r}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===s.ElementType.Comment)this.lastNode.data+=e;else{var t=new o.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new o.Text(""),t=new o.NodeWithChildren(s.ElementType.CDATA,[e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new o.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},7790:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__assign||function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=t.hasChildren=t.isDocument=t.isDirective=t.isComment=t.isText=t.isCDATA=t.isTag=t.Element=t.Document=t.NodeWithChildren=t.ProcessingInstruction=t.Comment=t.Text=t.DataNode=t.Node=void 0;var o=n(9960),a=new Map([[o.ElementType.Tag,1],[o.ElementType.Script,1],[o.ElementType.Style,1],[o.ElementType.Directive,1],[o.ElementType.Text,3],[o.ElementType.CDATA,4],[o.ElementType.Comment,8],[o.ElementType.Root,9]]),c=function(){function e(e){this.type=e,this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"nodeType",{get:function(){var e;return null!==(e=a.get(this.type))&&void 0!==e?e:1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),N(this,e)},e}();t.Node=c;var l=function(e){function t(t,n){var r=e.call(this,t)||this;return r.data=n,r}return i(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(c);t.DataNode=l;var u=function(e){function t(t){return e.call(this,o.ElementType.Text,t)||this}return i(t,e),t}(l);t.Text=u;var h=function(e){function t(t){return e.call(this,o.ElementType.Comment,t)||this}return i(t,e),t}(l);t.Comment=h;var p=function(e){function t(t,n){var r=e.call(this,o.ElementType.Directive,n)||this;return r.name=t,r}return i(t,e),t}(l);t.ProcessingInstruction=p;var d=function(e){function t(t,n){var r=e.call(this,t)||this;return r.children=n,r}return i(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(c);t.NodeWithChildren=d;var f=function(e){function t(t){return e.call(this,o.ElementType.Root,t)||this}return i(t,e),t}(d);t.Document=f;var m=function(e){function t(t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i="script"===t?o.ElementType.Script:"style"===t?o.ElementType.Style:o.ElementType.Tag);var s=e.call(this,i,r)||this;return s.name=t,s.attribs=n,s}return i(t,e),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(d);function T(e){return o.isTag(e)}function _(e){return e.type===o.ElementType.CDATA}function E(e){return e.type===o.ElementType.Text}function g(e){return e.type===o.ElementType.Comment}function A(e){return e.type===o.ElementType.Directive}function C(e){return e.type===o.ElementType.Root}function N(e,t){var n;if(void 0===t&&(t=!1),E(e))n=new u(e.data);else if(g(e))n=new h(e.data);else if(T(e)){var r=t?O(e.children):[],i=new m(e.name,s({},e.attribs),r);r.forEach((function(e){return e.parent=i})),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=s({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=s({},e["x-attribsPrefix"])),n=i}else if(_(e)){r=t?O(e.children):[];var a=new d(o.ElementType.CDATA,r);r.forEach((function(e){return e.parent=a})),n=a}else if(C(e)){r=t?O(e.children):[];var c=new f(r);r.forEach((function(e){return e.parent=c})),e["x-mode"]&&(c["x-mode"]=e["x-mode"]),n=c}else{if(!A(e))throw new Error("Not implemented yet: "+e.type);var l=new p(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,n}function O(e){for(var t=e.map((function(e){return N(e,!0)})),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=m,t.isTag=T,t.isCDATA=_,t.isText=E,t.isComment=g,t.isDirective=A,t.isDocument=C,t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},t.cloneNode=N},4975:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uniqueSort=t.compareDocumentPosition=t.removeSubsets=void 0;var r=n(7915);function i(e,t){var n=[],i=[];if(e===t)return 0;for(var s=r.hasChildren(e)?e:e.parent;s;)n.unshift(s),s=s.parent;for(s=r.hasChildren(t)?t:t.parent;s;)i.unshift(s),s=s.parent;for(var o=Math.min(n.length,i.length),a=0;a<o&&n[a]===i[a];)a++;if(0===a)return 1;var c=n[a-1],l=c.children,u=n[a],h=i[a];return l.indexOf(u)>l.indexOf(h)?c===t?20:4:c===e?10:2}t.removeSubsets=function(e){for(var t=e.length;--t>=0;){var n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0)e.splice(t,1);else for(var r=n.parent;r;r=r.parent)if(e.includes(r)){e.splice(t,1);break}}return e},t.compareDocumentPosition=i,t.uniqueSort=function(e){return(e=e.filter((function(e,t,n){return!n.includes(e,t+1)}))).sort((function(e,t){var n=i(e,t);return 2&n?-1:4&n?1:0})),e}},9432:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isDocument=t.isComment=t.isText=t.isCDATA=t.isTag=void 0,i(n(3346),t),i(n(5010),t),i(n(6765),t),i(n(8043),t),i(n(3905),t),i(n(4975),t);var s=n(7915);Object.defineProperty(t,"isTag",{enumerable:!0,get:function(){return s.isTag}}),Object.defineProperty(t,"isCDATA",{enumerable:!0,get:function(){return s.isCDATA}}),Object.defineProperty(t,"isText",{enumerable:!0,get:function(){return s.isText}}),Object.defineProperty(t,"isComment",{enumerable:!0,get:function(){return s.isComment}}),Object.defineProperty(t,"isDocument",{enumerable:!0,get:function(){return s.isDocument}}),Object.defineProperty(t,"hasChildren",{enumerable:!0,get:function(){return s.hasChildren}})},3905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getElementsByTagType=t.getElementsByTagName=t.getElementById=t.getElements=t.testElement=void 0;var r=n(7915),i=n(8043),s={tag_name:function(e){return"function"==typeof e?function(t){return r.isTag(t)&&e(t.name)}:"*"===e?r.isTag:function(t){return r.isTag(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return r.isText(t)&&e(t.data)}:function(t){return r.isText(t)&&t.data===e}}};function o(e,t){return"function"==typeof t?function(n){return r.isTag(n)&&t(n.attribs[e])}:function(n){return r.isTag(n)&&n.attribs[e]===t}}function a(e,t){return function(n){return e(n)||t(n)}}function c(e){var t=Object.keys(e).map((function(t){var n=e[t];return t in s?s[t](n):o(t,n)}));return 0===t.length?null:t.reduce(a)}t.testElement=function(e,t){var n=c(e);return!n||n(t)},t.getElements=function(e,t,n,r){void 0===r&&(r=1/0);var s=c(e);return s?i.filter(s,t,n,r):[]},t.getElementById=function(e,t,n){return void 0===n&&(n=!0),Array.isArray(t)||(t=[t]),i.findOne(o("id",e),t,n)},t.getElementsByTagName=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=1/0),i.filter(s.tag_name(e),t,n,r)},t.getElementsByTagType=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=1/0),i.filter(s.tag_type(e),t,n,r)}},6765:(e,t)=>{"use strict";function n(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children;t.splice(t.lastIndexOf(e),1)}}Object.defineProperty(t,"__esModule",{value:!0}),t.prepend=t.prependChild=t.append=t.appendChild=t.replaceElement=t.removeElement=void 0,t.removeElement=n,t.replaceElement=function(e,t){var n=t.prev=e.prev;n&&(n.next=t);var r=t.next=e.next;r&&(r.prev=t);var i=t.parent=e.parent;if(i){var s=i.children;s[s.lastIndexOf(e)]=t}},t.appendChild=function(e,t){if(n(t),t.next=null,t.parent=e,e.children.push(t)>1){var r=e.children[e.children.length-2];r.next=t,t.prev=r}else t.prev=null},t.append=function(e,t){n(t);var r=e.parent,i=e.next;if(t.next=i,t.prev=e,e.next=t,t.parent=r,i){if(i.prev=t,r){var s=r.children;s.splice(s.lastIndexOf(i),0,t)}}else r&&r.children.push(t)},t.prependChild=function(e,t){if(n(t),t.parent=e,t.prev=null,1!==e.children.unshift(t)){var r=e.children[1];r.prev=t,t.next=r}else t.next=null},t.prepend=function(e,t){n(t);var r=e.parent;if(r){var i=r.children;i.splice(i.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=r,t.prev=e.prev,t.next=e,e.prev=t}},8043:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAll=t.existsOne=t.findOne=t.findOneChild=t.find=t.filter=void 0;var r=n(7915);function i(e,t,n,s){for(var o=[],a=0,c=t;a<c.length;a++){var l=c[a];if(e(l)&&(o.push(l),--s<=0))break;if(n&&r.hasChildren(l)&&l.children.length>0){var u=i(e,l.children,n,s);if(o.push.apply(o,u),(s-=u.length)<=0)break}}return o}t.filter=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=1/0),Array.isArray(t)||(t=[t]),i(e,t,n,r)},t.find=i,t.findOneChild=function(e,t){return t.find(e)},t.findOne=function e(t,n,i){void 0===i&&(i=!0);for(var s=null,o=0;o<n.length&&!s;o++){var a=n[o];r.isTag(a)&&(t(a)?s=a:i&&a.children.length>0&&(s=e(t,a.children)))}return s},t.existsOne=function e(t,n){return n.some((function(n){return r.isTag(n)&&(t(n)||n.children.length>0&&e(t,n.children))}))},t.findAll=function(e,t){for(var n,i,s=[],o=t.filter(r.isTag);i=o.shift();){var a=null===(n=i.children)||void 0===n?void 0:n.filter(r.isTag);a&&a.length>0&&o.unshift.apply(o,a),e(i)&&s.push(i)}return s}},3346:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.innerText=t.textContent=t.getText=t.getInnerHTML=t.getOuterHTML=void 0;var i=n(7915),s=r(n(7220)),o=n(9960);function a(e,t){return s.default(e,t)}t.getOuterHTML=a,t.getInnerHTML=function(e,t){return i.hasChildren(e)?e.children.map((function(e){return a(e,t)})).join(""):""},t.getText=function e(t){return Array.isArray(t)?t.map(e).join(""):i.isTag(t)?"br"===t.name?"\n":e(t.children):i.isCDATA(t)?e(t.children):i.isText(t)?t.data:""},t.textContent=function e(t){return Array.isArray(t)?t.map(e).join(""):i.isTag(t)||i.isCDATA(t)?e(t.children):i.isText(t)?t.data:""},t.innerText=function e(t){return Array.isArray(t)?t.map(e).join(""):i.hasChildren(t)&&t.type===o.ElementType.Tag||i.isCDATA(t)?e(t.children):i.isText(t)?t.data:""}},5010:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prevElementSibling=t.nextElementSibling=t.getName=t.hasAttrib=t.getAttributeValue=t.getSiblings=t.getParent=t.getChildren=void 0;var r=n(7915),i=[];function s(e){var t;return null!==(t=e.children)&&void 0!==t?t:i}function o(e){return e.parent||null}t.getChildren=s,t.getParent=o,t.getSiblings=function(e){var t=o(e);if(null!=t)return s(t);for(var n=[e],r=e.prev,i=e.next;null!=r;)n.unshift(r),r=r.prev;for(;null!=i;)n.push(i),i=i.next;return n},t.getAttributeValue=function(e,t){var n;return null===(n=e.attribs)||void 0===n?void 0:n[t]},t.hasAttrib=function(e,t){return null!=e.attribs&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&null!=e.attribs[t]},t.getName=function(e){return e.name},t.nextElementSibling=function(e){for(var t=e.next;null!==t&&!r.isTag(t);)t=t.next;return t},t.prevElementSibling=function(e){for(var t=e.prev;null!==t&&!r.isTag(t);)t=t.prev;return t}},4076:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeHTML=t.decodeHTMLStrict=t.decodeXML=void 0;var i=r(n(9323)),s=r(n(9591)),o=r(n(2586)),a=r(n(26)),c=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function l(e){var t=h(e);return function(e){return String(e).replace(c,t)}}t.decodeXML=l(o.default),t.decodeHTMLStrict=l(i.default);var u=function(e,t){return e<t?1:-1};function h(e){return function(t){if("#"===t.charAt(1)){var n=t.charAt(2);return"X"===n||"x"===n?a.default(parseInt(t.substr(3),16)):a.default(parseInt(t.substr(2),10))}return e[t.slice(1,-1)]||t}}t.decodeHTML=function(){for(var e=Object.keys(s.default).sort(u),t=Object.keys(i.default).sort(u),n=0,r=0;n<t.length;n++)e[r]===t[n]?(t[n]+=";?",r++):t[n]+=";";var o=new RegExp("&(?:"+t.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),a=h(i.default);function c(e){return";"!==e.substr(-1)&&(e+=";"),a(e)}return function(e){return String(e).replace(o,c)}}()},26:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3600)),s=String.fromCodePoint||function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+String.fromCharCode(e)};t.default=function(e){return e>=55296&&e<=57343||e>1114111?"�":(e in i.default&&(e=i.default[e]),s(e))}},7322:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.escapeUTF8=t.escape=t.encodeNonAsciiHTML=t.encodeHTML=t.encodeXML=void 0;var i=u(r(n(2586)).default),s=h(i);t.encodeXML=T(i);var o,a,c=u(r(n(9323)).default),l=h(c);function u(e){return Object.keys(e).sort().reduce((function(t,n){return t[e[n]]="&"+n+";",t}),{})}function h(e){for(var t=[],n=[],r=0,i=Object.keys(e);r<i.length;r++){var s=i[r];1===s.length?t.push("\\"+s):n.push(s)}t.sort();for(var o=0;o<t.length-1;o++){for(var a=o;a<t.length-1&&t[a].charCodeAt(1)+1===t[a+1].charCodeAt(1);)a+=1;var c=1+a-o;c<3||t.splice(o,c,t[o]+"-"+t[a])}return n.unshift("["+t.join("")+"]"),new RegExp(n.join("|"),"g")}t.encodeHTML=(o=c,a=l,function(e){return e.replace(a,(function(e){return o[e]})).replace(p,f)}),t.encodeNonAsciiHTML=T(c);var p=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,d=null!=String.prototype.codePointAt?function(e){return e.codePointAt(0)}:function(e){return 1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536};function f(e){return"&#x"+(e.length>1?d(e):e.charCodeAt(0)).toString(16).toUpperCase()+";"}var m=new RegExp(s.source+"|"+p.source,"g");function T(e){return function(t){return t.replace(m,(function(t){return e[t]||f(t)}))}}t.escape=function(e){return e.replace(m,f)},t.escapeUTF8=function(e){return e.replace(s,f)}},5863:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXMLStrict=t.decodeHTML5Strict=t.decodeHTML4Strict=t.decodeHTML5=t.decodeHTML4=t.decodeHTMLStrict=t.decodeHTML=t.decodeXML=t.encodeHTML5=t.encodeHTML4=t.escapeUTF8=t.escape=t.encodeNonAsciiHTML=t.encodeHTML=t.encodeXML=t.encode=t.decodeStrict=t.decode=void 0;var r=n(4076),i=n(7322);t.decode=function(e,t){return(!t||t<=0?r.decodeXML:r.decodeHTML)(e)},t.decodeStrict=function(e,t){return(!t||t<=0?r.decodeXML:r.decodeHTMLStrict)(e)},t.encode=function(e,t){return(!t||t<=0?i.encodeXML:i.encodeHTML)(e)};var s=n(7322);Object.defineProperty(t,"encodeXML",{enumerable:!0,get:function(){return s.encodeXML}}),Object.defineProperty(t,"encodeHTML",{enumerable:!0,get:function(){return s.encodeHTML}}),Object.defineProperty(t,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return s.encodeNonAsciiHTML}}),Object.defineProperty(t,"escape",{enumerable:!0,get:function(){return s.escape}}),Object.defineProperty(t,"escapeUTF8",{enumerable:!0,get:function(){return s.escapeUTF8}}),Object.defineProperty(t,"encodeHTML4",{enumerable:!0,get:function(){return s.encodeHTML}}),Object.defineProperty(t,"encodeHTML5",{enumerable:!0,get:function(){return s.encodeHTML}});var o=n(4076);Object.defineProperty(t,"decodeXML",{enumerable:!0,get:function(){return o.decodeXML}}),Object.defineProperty(t,"decodeHTML",{enumerable:!0,get:function(){return o.decodeHTML}}),Object.defineProperty(t,"decodeHTMLStrict",{enumerable:!0,get:function(){return o.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML4",{enumerable:!0,get:function(){return o.decodeHTML}}),Object.defineProperty(t,"decodeHTML5",{enumerable:!0,get:function(){return o.decodeHTML}}),Object.defineProperty(t,"decodeHTML4Strict",{enumerable:!0,get:function(){return o.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML5Strict",{enumerable:!0,get:function(){return o.decodeHTMLStrict}}),Object.defineProperty(t,"decodeXMLStrict",{enumerable:!0,get:function(){return o.decodeXML}})},3870:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return o(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseFeed=t.FeedHandler=void 0;var l,u,h=c(n(7915)),p=a(n(9432)),d=n(763);!function(e){e[e.image=0]="image",e[e.audio=1]="audio",e[e.video=2]="video",e[e.document=3]="document",e[e.executable=4]="executable"}(l||(l={})),function(e){e[e.sample=0]="sample",e[e.full=1]="full",e[e.nonstop=2]="nonstop"}(u||(u={}));var f=function(e){function t(t,n){return"object"==typeof t&&(n=t=void 0),e.call(this,t,n)||this}return i(t,e),t.prototype.onend=function(){var e,t,n=_(C,this.dom);if(n){var r={};if("feed"===n.name){var i=n.children;r.type="atom",A(r,"id","id",i),A(r,"title","title",i);var s=g("href",_("link",i));s&&(r.link=s),A(r,"description","subtitle",i),(o=E("updated",i))&&(r.updated=new Date(o)),A(r,"author","email",i,!0),r.items=T("entry",i).map((function(e){var t={},n=e.children;A(t,"id","id",n),A(t,"title","title",n);var r=g("href",_("link",n));r&&(t.link=r);var i=E("summary",n)||E("content",n);i&&(t.description=i);var s=E("updated",n);return s&&(t.pubDate=new Date(s)),t.media=m(n),t}))}else{var o;i=null!==(t=null===(e=_("channel",n.children))||void 0===e?void 0:e.children)&&void 0!==t?t:[],r.type=n.name.substr(0,3),r.id="",A(r,"title","title",i),A(r,"link","link",i),A(r,"description","description",i),(o=E("lastBuildDate",i))&&(r.updated=new Date(o)),A(r,"author","managingEditor",i,!0),r.items=T("item",n.children).map((function(e){var t={},n=e.children;A(t,"id","guid",n),A(t,"title","title",n),A(t,"link","link",n),A(t,"description","description",n);var r=E("pubDate",n);return r&&(t.pubDate=new Date(r)),t.media=m(n),t}))}this.feed=r,this.handleCallback(null)}else this.handleCallback(new Error("couldn't find root of feed"))},t}(h.default);function m(e){return T("media:content",e).map((function(e){var t={medium:e.attribs.medium,isDefault:!!e.attribs.isDefault};return e.attribs.url&&(t.url=e.attribs.url),e.attribs.fileSize&&(t.fileSize=parseInt(e.attribs.fileSize,10)),e.attribs.type&&(t.type=e.attribs.type),e.attribs.expression&&(t.expression=e.attribs.expression),e.attribs.bitrate&&(t.bitrate=parseInt(e.attribs.bitrate,10)),e.attribs.framerate&&(t.framerate=parseInt(e.attribs.framerate,10)),e.attribs.samplingrate&&(t.samplingrate=parseInt(e.attribs.samplingrate,10)),e.attribs.channels&&(t.channels=parseInt(e.attribs.channels,10)),e.attribs.duration&&(t.duration=parseInt(e.attribs.duration,10)),e.attribs.height&&(t.height=parseInt(e.attribs.height,10)),e.attribs.width&&(t.width=parseInt(e.attribs.width,10)),e.attribs.lang&&(t.lang=e.attribs.lang),t}))}function T(e,t){return p.getElementsByTagName(e,t,!0)}function _(e,t){return p.getElementsByTagName(e,t,!0,1)[0]}function E(e,t,n){return void 0===n&&(n=!1),p.getText(p.getElementsByTagName(e,t,n,1)).trim()}function g(e,t){return t?t.attribs[e]:null}function A(e,t,n,r,i){void 0===i&&(i=!1);var s=E(n,r,i);s&&(e[t]=s)}function C(e){return"rss"===e||"feed"===e||"rdf:RDF"===e}t.FeedHandler=f,t.parseFeed=function(e,t){void 0===t&&(t={xmlMode:!0});var n=new f(t);return new d.Parser(n,t).end(e),n.feed}},763:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0;var i=r(n(9889)),s=new Set(["input","option","optgroup","select","button","datalist","textarea"]),o=new Set(["p"]),a={tr:new Set(["tr","th","td"]),th:new Set(["th"]),td:new Set(["thead","th","td"]),body:new Set(["head","link","script"]),li:new Set(["li"]),p:o,h1:o,h2:o,h3:o,h4:o,h5:o,h6:o,select:s,input:s,output:s,button:s,datalist:s,textarea:s,option:new Set(["option"]),optgroup:new Set(["optgroup","option"]),dd:new Set(["dt","dd"]),dt:new Set(["dt","dd"]),address:o,article:o,aside:o,blockquote:o,details:o,div:o,dl:o,fieldset:o,figcaption:o,figure:o,footer:o,form:o,header:o,hr:o,main:o,nav:o,ol:o,pre:o,section:o,table:o,ul:o,rt:new Set(["rt","rp"]),rp:new Set(["rt","rp"]),tbody:new Set(["thead","tbody"]),tfoot:new Set(["thead","tbody"])},c=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),l=new Set(["math","svg"]),u=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),h=/\s|\//,p=function(){function e(e,t){var n,r,s,o,a;void 0===t&&(t={}),this.startIndex=0,this.endIndex=null,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.options=t,this.cbs=null!=e?e:{},this.lowerCaseTagNames=null!==(n=t.lowerCaseTags)&&void 0!==n?n:!t.xmlMode,this.lowerCaseAttributeNames=null!==(r=t.lowerCaseAttributeNames)&&void 0!==r?r:!t.xmlMode,this.tokenizer=new(null!==(s=t.Tokenizer)&&void 0!==s?s:i.default)(this.options,this),null===(a=(o=this.cbs).onparserinit)||void 0===a||a.call(o,this)}return e.prototype.updatePosition=function(e){null===this.endIndex?this.tokenizer.sectionStart<=e?this.startIndex=0:this.startIndex=this.tokenizer.sectionStart-e:this.startIndex=this.endIndex+1,this.endIndex=this.tokenizer.getAbsoluteIndex()},e.prototype.ontext=function(e){var t,n;this.updatePosition(1),this.endIndex--,null===(n=(t=this.cbs).ontext)||void 0===n||n.call(t,e)},e.prototype.onopentagname=function(e){var t,n;if(this.lowerCaseTagNames&&(e=e.toLowerCase()),this.tagname=e,!this.options.xmlMode&&Object.prototype.hasOwnProperty.call(a,e))for(var r=void 0;this.stack.length>0&&a[e].has(r=this.stack[this.stack.length-1]);)this.onclosetag(r);!this.options.xmlMode&&c.has(e)||(this.stack.push(e),l.has(e)?this.foreignContext.push(!0):u.has(e)&&this.foreignContext.push(!1)),null===(n=(t=this.cbs).onopentagname)||void 0===n||n.call(t,e),this.cbs.onopentag&&(this.attribs={})},e.prototype.onopentagend=function(){var e,t;this.updatePosition(1),this.attribs&&(null===(t=(e=this.cbs).onopentag)||void 0===t||t.call(e,this.tagname,this.attribs),this.attribs=null),!this.options.xmlMode&&this.cbs.onclosetag&&c.has(this.tagname)&&this.cbs.onclosetag(this.tagname),this.tagname=""},e.prototype.onclosetag=function(e){if(this.updatePosition(1),this.lowerCaseTagNames&&(e=e.toLowerCase()),(l.has(e)||u.has(e))&&this.foreignContext.pop(),!this.stack.length||!this.options.xmlMode&&c.has(e))this.options.xmlMode||"br"!==e&&"p"!==e||(this.onopentagname(e),this.closeCurrentTag());else{var t=this.stack.lastIndexOf(e);if(-1!==t)if(this.cbs.onclosetag)for(t=this.stack.length-t;t--;)this.cbs.onclosetag(this.stack.pop());else this.stack.length=t;else"p"!==e||this.options.xmlMode||(this.onopentagname(e),this.closeCurrentTag())}},e.prototype.onselfclosingtag=function(){this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?this.closeCurrentTag():this.onopentagend()},e.prototype.closeCurrentTag=function(){var e,t,n=this.tagname;this.onopentagend(),this.stack[this.stack.length-1]===n&&(null===(t=(e=this.cbs).onclosetag)||void 0===t||t.call(e,n),this.stack.pop())},e.prototype.onattribname=function(e){this.lowerCaseAttributeNames&&(e=e.toLowerCase()),this.attribname=e},e.prototype.onattribdata=function(e){this.attribvalue+=e},e.prototype.onattribend=function(e){var t,n;null===(n=(t=this.cbs).onattribute)||void 0===n||n.call(t,this.attribname,this.attribvalue,e),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribname="",this.attribvalue=""},e.prototype.getInstructionName=function(e){var t=e.search(h),n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n},e.prototype.ondeclaration=function(e){if(this.cbs.onprocessinginstruction){var t=this.getInstructionName(e);this.cbs.onprocessinginstruction("!"+t,"!"+e)}},e.prototype.onprocessinginstruction=function(e){if(this.cbs.onprocessinginstruction){var t=this.getInstructionName(e);this.cbs.onprocessinginstruction("?"+t,"?"+e)}},e.prototype.oncomment=function(e){var t,n,r,i;this.updatePosition(4),null===(n=(t=this.cbs).oncomment)||void 0===n||n.call(t,e),null===(i=(r=this.cbs).oncommentend)||void 0===i||i.call(r)},e.prototype.oncdata=function(e){var t,n,r,i,s,o;this.updatePosition(1),this.options.xmlMode||this.options.recognizeCDATA?(null===(n=(t=this.cbs).oncdatastart)||void 0===n||n.call(t),null===(i=(r=this.cbs).ontext)||void 0===i||i.call(r,e),null===(o=(s=this.cbs).oncdataend)||void 0===o||o.call(s)):this.oncomment("[CDATA["+e+"]]")},e.prototype.onerror=function(e){var t,n;null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,e)},e.prototype.onend=function(){var e,t;if(this.cbs.onclosetag)for(var n=this.stack.length;n>0;this.cbs.onclosetag(this.stack[--n]));null===(t=(e=this.cbs).onend)||void 0===t||t.call(e)},e.prototype.reset=function(){var e,t,n,r;null===(t=(e=this.cbs).onreset)||void 0===t||t.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack=[],null===(r=(n=this.cbs).onparserinit)||void 0===r||r.call(n,this)},e.prototype.parseComplete=function(e){this.reset(),this.end(e)},e.prototype.write=function(e){this.tokenizer.write(e)},e.prototype.end=function(e){this.tokenizer.end(e)},e.prototype.pause=function(){this.tokenizer.pause()},e.prototype.resume=function(){this.tokenizer.resume()},e.prototype.parseChunk=function(e){this.write(e)},e.prototype.done=function(e){this.end(e)},e}();t.Parser=p},9889:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(26)),s=r(n(9323)),o=r(n(9591)),a=r(n(2586));function c(e){return" "===e||"\n"===e||"\t"===e||"\f"===e||"\r"===e}function l(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}function u(e,t,n){var r=e.toLowerCase();return e===r?function(e,i){i===r?e._state=t:(e._state=n,e._index--)}:function(i,s){s===r||s===e?i._state=t:(i._state=n,i._index--)}}function h(e,t){var n=e.toLowerCase();return function(r,i){i===n||i===e?r._state=t:(r._state=3,r._index--)}}var p=u("C",24,16),d=u("D",25,16),f=u("A",26,16),m=u("T",27,16),T=u("A",28,16),_=h("R",35),E=h("I",36),g=h("P",37),A=h("T",38),C=u("R",40,1),N=u("I",41,1),O=u("P",42,1),v=u("T",43,1),b=h("Y",45),S=h("L",46),y=h("E",47),I=u("Y",49,1),k=u("L",50,1),R=u("E",51,1),L=h("I",54),M=h("T",55),x=h("L",56),P=h("E",57),D=u("I",58,1),w=u("T",59,1),H=u("L",60,1),F=u("E",61,1),U=u("#",63,64),B=u("X",66,65),G=function(){function e(e,t){var n;this._state=1,this.buffer="",this.sectionStart=0,this._index=0,this.bufferOffset=0,this.baseState=1,this.special=1,this.running=!0,this.ended=!1,this.cbs=t,this.xmlMode=!!(null==e?void 0:e.xmlMode),this.decodeEntities=null===(n=null==e?void 0:e.decodeEntities)||void 0===n||n}return e.prototype.reset=function(){this._state=1,this.buffer="",this.sectionStart=0,this._index=0,this.bufferOffset=0,this.baseState=1,this.special=1,this.running=!0,this.ended=!1},e.prototype.write=function(e){this.ended&&this.cbs.onerror(Error(".write() after done!")),this.buffer+=e,this.parse()},e.prototype.end=function(e){this.ended&&this.cbs.onerror(Error(".end() after done!")),e&&this.write(e),this.ended=!0,this.running&&this.finish()},e.prototype.pause=function(){this.running=!1},e.prototype.resume=function(){this.running=!0,this._index<this.buffer.length&&this.parse(),this.ended&&this.finish()},e.prototype.getAbsoluteIndex=function(){return this.bufferOffset+this._index},e.prototype.stateText=function(e){"<"===e?(this._index>this.sectionStart&&this.cbs.ontext(this.getSection()),this._state=2,this.sectionStart=this._index):!this.decodeEntities||"&"!==e||1!==this.special&&4!==this.special||(this._index>this.sectionStart&&this.cbs.ontext(this.getSection()),this.baseState=1,this._state=62,this.sectionStart=this._index)},e.prototype.isTagStartChar=function(e){return l(e)||this.xmlMode&&!c(e)&&"/"!==e&&">"!==e},e.prototype.stateBeforeTagName=function(e){"/"===e?this._state=5:"<"===e?(this.cbs.ontext(this.getSection()),this.sectionStart=this._index):">"===e||1!==this.special||c(e)?this._state=1:"!"===e?(this._state=15,this.sectionStart=this._index+1):"?"===e?(this._state=17,this.sectionStart=this._index+1):this.isTagStartChar(e)?(this._state=this.xmlMode||"s"!==e&&"S"!==e?this.xmlMode||"t"!==e&&"T"!==e?3:52:32,this.sectionStart=this._index):this._state=1},e.prototype.stateInTagName=function(e){("/"===e||">"===e||c(e))&&(this.emitToken("onopentagname"),this._state=8,this._index--)},e.prototype.stateBeforeClosingTagName=function(e){c(e)||(">"===e?this._state=1:1!==this.special?4===this.special||"s"!==e&&"S"!==e?4!==this.special||"t"!==e&&"T"!==e?(this._state=1,this._index--):this._state=53:this._state=33:this.isTagStartChar(e)?(this._state=6,this.sectionStart=this._index):(this._state=20,this.sectionStart=this._index))},e.prototype.stateInClosingTagName=function(e){(">"===e||c(e))&&(this.emitToken("onclosetag"),this._state=7,this._index--)},e.prototype.stateAfterClosingTagName=function(e){">"===e&&(this._state=1,this.sectionStart=this._index+1)},e.prototype.stateBeforeAttributeName=function(e){">"===e?(this.cbs.onopentagend(),this._state=1,this.sectionStart=this._index+1):"/"===e?this._state=4:c(e)||(this._state=9,this.sectionStart=this._index)},e.prototype.stateInSelfClosingTag=function(e){">"===e?(this.cbs.onselfclosingtag(),this._state=1,this.sectionStart=this._index+1,this.special=1):c(e)||(this._state=8,this._index--)},e.prototype.stateInAttributeName=function(e){("="===e||"/"===e||">"===e||c(e))&&(this.cbs.onattribname(this.getSection()),this.sectionStart=-1,this._state=10,this._index--)},e.prototype.stateAfterAttributeName=function(e){"="===e?this._state=11:"/"===e||">"===e?(this.cbs.onattribend(void 0),this._state=8,this._index--):c(e)||(this.cbs.onattribend(void 0),this._state=9,this.sectionStart=this._index)},e.prototype.stateBeforeAttributeValue=function(e){'"'===e?(this._state=12,this.sectionStart=this._index+1):"'"===e?(this._state=13,this.sectionStart=this._index+1):c(e)||(this._state=14,this.sectionStart=this._index,this._index--)},e.prototype.handleInAttributeValue=function(e,t){e===t?(this.emitToken("onattribdata"),this.cbs.onattribend(t),this._state=8):this.decodeEntities&&"&"===e&&(this.emitToken("onattribdata"),this.baseState=this._state,this._state=62,this.sectionStart=this._index)},e.prototype.stateInAttributeValueDoubleQuotes=function(e){this.handleInAttributeValue(e,'"')},e.prototype.stateInAttributeValueSingleQuotes=function(e){this.handleInAttributeValue(e,"'")},e.prototype.stateInAttributeValueNoQuotes=function(e){c(e)||">"===e?(this.emitToken("onattribdata"),this.cbs.onattribend(null),this._state=8,this._index--):this.decodeEntities&&"&"===e&&(this.emitToken("onattribdata"),this.baseState=this._state,this._state=62,this.sectionStart=this._index)},e.prototype.stateBeforeDeclaration=function(e){this._state="["===e?23:"-"===e?18:16},e.prototype.stateInDeclaration=function(e){">"===e&&(this.cbs.ondeclaration(this.getSection()),this._state=1,this.sectionStart=this._index+1)},e.prototype.stateInProcessingInstruction=function(e){">"===e&&(this.cbs.onprocessinginstruction(this.getSection()),this._state=1,this.sectionStart=this._index+1)},e.prototype.stateBeforeComment=function(e){"-"===e?(this._state=19,this.sectionStart=this._index+1):this._state=16},e.prototype.stateInComment=function(e){"-"===e&&(this._state=21)},e.prototype.stateInSpecialComment=function(e){">"===e&&(this.cbs.oncomment(this.buffer.substring(this.sectionStart,this._index)),this._state=1,this.sectionStart=this._index+1)},e.prototype.stateAfterComment1=function(e){this._state="-"===e?22:19},e.prototype.stateAfterComment2=function(e){">"===e?(this.cbs.oncomment(this.buffer.substring(this.sectionStart,this._index-2)),this._state=1,this.sectionStart=this._index+1):"-"!==e&&(this._state=19)},e.prototype.stateBeforeCdata6=function(e){"["===e?(this._state=29,this.sectionStart=this._index+1):(this._state=16,this._index--)},e.prototype.stateInCdata=function(e){"]"===e&&(this._state=30)},e.prototype.stateAfterCdata1=function(e){this._state="]"===e?31:29},e.prototype.stateAfterCdata2=function(e){">"===e?(this.cbs.oncdata(this.buffer.substring(this.sectionStart,this._index-2)),this._state=1,this.sectionStart=this._index+1):"]"!==e&&(this._state=29)},e.prototype.stateBeforeSpecialS=function(e){"c"===e||"C"===e?this._state=34:"t"===e||"T"===e?this._state=44:(this._state=3,this._index--)},e.prototype.stateBeforeSpecialSEnd=function(e){2!==this.special||"c"!==e&&"C"!==e?3!==this.special||"t"!==e&&"T"!==e?this._state=1:this._state=48:this._state=39},e.prototype.stateBeforeSpecialLast=function(e,t){("/"===e||">"===e||c(e))&&(this.special=t),this._state=3,this._index--},e.prototype.stateAfterSpecialLast=function(e,t){">"===e||c(e)?(this.special=1,this._state=6,this.sectionStart=this._index-t,this._index--):this._state=1},e.prototype.parseFixedEntity=function(e){if(void 0===e&&(e=this.xmlMode?a.default:s.default),this.sectionStart+1<this._index){var t=this.buffer.substring(this.sectionStart+1,this._index);Object.prototype.hasOwnProperty.call(e,t)&&(this.emitPartial(e[t]),this.sectionStart=this._index+1)}},e.prototype.parseLegacyEntity=function(){for(var e=this.sectionStart+1,t=Math.min(this._index-e,6);t>=2;){var n=this.buffer.substr(e,t);if(Object.prototype.hasOwnProperty.call(o.default,n))return this.emitPartial(o.default[n]),void(this.sectionStart+=t+1);t--}},e.prototype.stateInNamedEntity=function(e){";"===e?(this.parseFixedEntity(),1===this.baseState&&this.sectionStart+1<this._index&&!this.xmlMode&&this.parseLegacyEntity(),this._state=this.baseState):(e<"0"||e>"9")&&!l(e)&&(this.xmlMode||this.sectionStart+1===this._index||(1!==this.baseState?"="!==e&&this.parseFixedEntity(o.default):this.parseLegacyEntity()),this._state=this.baseState,this._index--)},e.prototype.decodeNumericEntity=function(e,t,n){var r=this.sectionStart+e;if(r!==this._index){var s=this.buffer.substring(r,this._index),o=parseInt(s,t);this.emitPartial(i.default(o)),this.sectionStart=n?this._index+1:this._index}this._state=this.baseState},e.prototype.stateInNumericEntity=function(e){";"===e?this.decodeNumericEntity(2,10,!0):(e<"0"||e>"9")&&(this.xmlMode?this._state=this.baseState:this.decodeNumericEntity(2,10,!1),this._index--)},e.prototype.stateInHexEntity=function(e){";"===e?this.decodeNumericEntity(3,16,!0):(e<"a"||e>"f")&&(e<"A"||e>"F")&&(e<"0"||e>"9")&&(this.xmlMode?this._state=this.baseState:this.decodeNumericEntity(3,16,!1),this._index--)},e.prototype.cleanup=function(){this.sectionStart<0?(this.buffer="",this.bufferOffset+=this._index,this._index=0):this.running&&(1===this._state?(this.sectionStart!==this._index&&this.cbs.ontext(this.buffer.substr(this.sectionStart)),this.buffer="",this.bufferOffset+=this._index,this._index=0):this.sectionStart===this._index?(this.buffer="",this.bufferOffset+=this._index,this._index=0):(this.buffer=this.buffer.substr(this.sectionStart),this._index-=this.sectionStart,this.bufferOffset+=this.sectionStart),this.sectionStart=0)},e.prototype.parse=function(){for(;this._index<this.buffer.length&&this.running;){var e=this.buffer.charAt(this._index);1===this._state?this.stateText(e):12===this._state?this.stateInAttributeValueDoubleQuotes(e):9===this._state?this.stateInAttributeName(e):19===this._state?this.stateInComment(e):20===this._state?this.stateInSpecialComment(e):8===this._state?this.stateBeforeAttributeName(e):3===this._state?this.stateInTagName(e):6===this._state?this.stateInClosingTagName(e):2===this._state?this.stateBeforeTagName(e):10===this._state?this.stateAfterAttributeName(e):13===this._state?this.stateInAttributeValueSingleQuotes(e):11===this._state?this.stateBeforeAttributeValue(e):5===this._state?this.stateBeforeClosingTagName(e):7===this._state?this.stateAfterClosingTagName(e):32===this._state?this.stateBeforeSpecialS(e):21===this._state?this.stateAfterComment1(e):14===this._state?this.stateInAttributeValueNoQuotes(e):4===this._state?this.stateInSelfClosingTag(e):16===this._state?this.stateInDeclaration(e):15===this._state?this.stateBeforeDeclaration(e):22===this._state?this.stateAfterComment2(e):18===this._state?this.stateBeforeComment(e):33===this._state?this.stateBeforeSpecialSEnd(e):53===this._state?D(this,e):39===this._state?C(this,e):40===this._state?N(this,e):41===this._state?O(this,e):34===this._state?_(this,e):35===this._state?E(this,e):36===this._state?g(this,e):37===this._state?A(this,e):38===this._state?this.stateBeforeSpecialLast(e,2):42===this._state?v(this,e):43===this._state?this.stateAfterSpecialLast(e,6):44===this._state?b(this,e):29===this._state?this.stateInCdata(e):45===this._state?S(this,e):46===this._state?y(this,e):47===this._state?this.stateBeforeSpecialLast(e,3):48===this._state?I(this,e):49===this._state?k(this,e):50===this._state?R(this,e):51===this._state?this.stateAfterSpecialLast(e,5):52===this._state?L(this,e):54===this._state?M(this,e):55===this._state?x(this,e):56===this._state?P(this,e):57===this._state?this.stateBeforeSpecialLast(e,4):58===this._state?w(this,e):59===this._state?H(this,e):60===this._state?F(this,e):61===this._state?this.stateAfterSpecialLast(e,5):17===this._state?this.stateInProcessingInstruction(e):64===this._state?this.stateInNamedEntity(e):23===this._state?p(this,e):62===this._state?U(this,e):24===this._state?d(this,e):25===this._state?f(this,e):30===this._state?this.stateAfterCdata1(e):31===this._state?this.stateAfterCdata2(e):26===this._state?m(this,e):27===this._state?T(this,e):28===this._state?this.stateBeforeCdata6(e):66===this._state?this.stateInHexEntity(e):65===this._state?this.stateInNumericEntity(e):63===this._state?B(this,e):this.cbs.onerror(Error("unknown _state"),this._state),this._index++}this.cleanup()},e.prototype.finish=function(){this.sectionStart<this._index&&this.handleTrailingData(),this.cbs.onend()},e.prototype.handleTrailingData=function(){var e=this.buffer.substr(this.sectionStart);29===this._state||30===this._state||31===this._state?this.cbs.oncdata(e):19===this._state||21===this._state||22===this._state?this.cbs.oncomment(e):64!==this._state||this.xmlMode?65!==this._state||this.xmlMode?66!==this._state||this.xmlMode?3!==this._state&&8!==this._state&&11!==this._state&&10!==this._state&&9!==this._state&&13!==this._state&&12!==this._state&&14!==this._state&&6!==this._state&&this.cbs.ontext(e):(this.decodeNumericEntity(3,16,!1),this.sectionStart<this._index&&(this._state=this.baseState,this.handleTrailingData())):(this.decodeNumericEntity(2,10,!1),this.sectionStart<this._index&&(this._state=this.baseState,this.handleTrailingData())):(this.parseLegacyEntity(),this.sectionStart<this._index&&(this._state=this.baseState,this.handleTrailingData()))},e.prototype.getSection=function(){return this.buffer.substring(this.sectionStart,this._index)},e.prototype.emitToken=function(e){this.cbs[e](this.getSection()),this.sectionStart=-1},e.prototype.emitPartial=function(e){1!==this.baseState?this.cbs.onattribdata(e):this.cbs.ontext(e)},e}();t.default=G},3719:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RssHandler=t.DefaultHandler=t.DomUtils=t.ElementType=t.Tokenizer=t.createDomStream=t.parseDOM=t.parseDocument=t.DomHandler=t.Parser=void 0;var c=n(763);Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return c.Parser}});var l=n(7915);function u(e,t){var n=new l.DomHandler(void 0,t);return new c.Parser(n,t).end(e),n.root}Object.defineProperty(t,"DomHandler",{enumerable:!0,get:function(){return l.DomHandler}}),Object.defineProperty(t,"DefaultHandler",{enumerable:!0,get:function(){return l.DomHandler}}),t.parseDocument=u,t.parseDOM=function(e,t){return u(e,t).children},t.createDomStream=function(e,t,n){var r=new l.DomHandler(e,t,n);return new c.Parser(r,t)};var h=n(9889);Object.defineProperty(t,"Tokenizer",{enumerable:!0,get:function(){return a(h).default}});var p=s(n(9960));t.ElementType=p,o(n(3870),t),t.DomUtils=s(n(9432));var d=n(3870);Object.defineProperty(t,"RssHandler",{enumerable:!0,get:function(){return d.FeedHandler}})},9769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compile=void 0;var r=n(1073);t.compile=function(e){var t=e[0],n=e[1]-1;if(n<0&&t<=0)return r.falseFunc;if(-1===t)return function(e){return e<=n};if(0===t)return function(e){return e===n};if(1===t)return n<0?r.trueFunc:function(e){return e>=n};var i=Math.abs(t),s=(n%i+i)%i;return t>1?function(e){return e>=n&&e%i===s}:function(e){return e<=n&&e%i===s}}},7540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compile=t.parse=void 0;var r=n(7766);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return r.parse}});var i=n(9769);Object.defineProperty(t,"compile",{enumerable:!0,get:function(){return i.compile}}),t.default=function(e){return(0,i.compile)((0,r.parse)(e))}},7766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;var n=new Set([9,10,12,13,32]),r="0".charCodeAt(0),i="9".charCodeAt(0);t.parse=function(e){if("even"===(e=e.trim().toLowerCase()))return[2,0];if("odd"===e)return[2,1];var t=0,s=0,o=c(),a=l();if(t<e.length&&"n"===e.charAt(t)&&(t++,s=o*(null!=a?a:1),u(),t<e.length?(o=c(),u(),a=l()):o=a=0),null===a||t<e.length)throw new Error("n-th rule couldn't be parsed ('"+e+"')");return[s,o*a];function c(){return"-"===e.charAt(t)?(t++,-1):("+"===e.charAt(t)&&t++,1)}function l(){for(var n=t,s=0;t<e.length&&e.charCodeAt(t)>=r&&e.charCodeAt(t)<=i;)s=10*s+(e.charCodeAt(t)-r),t++;return t===n?null:s}function u(){for(;t<e.length&&n.has(e.charCodeAt(t));)t++}}},1906:(e,t,n)=>{"use strict";const r=n(1515),{DOCUMENT_MODE:i}=n(6152),s={element:1,text:3,cdata:4,comment:8},o={tagName:"name",childNodes:"children",parentNode:"parent",previousSibling:"prev",nextSibling:"next",nodeValue:"data"};class a{constructor(e){for(const t of Object.keys(e))this[t]=e[t]}get firstChild(){const e=this.children;return e&&e[0]||null}get lastChild(){const e=this.children;return e&&e[e.length-1]||null}get nodeType(){return s[this.type]||s.element}}Object.keys(o).forEach((e=>{const t=o[e];Object.defineProperty(a.prototype,e,{get:function(){return this[t]||null},set:function(e){return this[t]=e,e}})})),t.createDocument=function(){return new a({type:"root",name:"root",parent:null,prev:null,next:null,children:[],"x-mode":i.NO_QUIRKS})},t.createDocumentFragment=function(){return new a({type:"root",name:"root",parent:null,prev:null,next:null,children:[]})},t.createElement=function(e,t,n){const r=Object.create(null),i=Object.create(null),s=Object.create(null);for(let e=0;e<n.length;e++){const t=n[e].name;r[t]=n[e].value,i[t]=n[e].namespace,s[t]=n[e].prefix}return new a({type:"script"===e||"style"===e?e:"tag",name:e,namespace:t,attribs:r,"x-attribsNamespace":i,"x-attribsPrefix":s,children:[],parent:null,prev:null,next:null})},t.createCommentNode=function(e){return new a({type:"comment",data:e,parent:null,prev:null,next:null})};const c=function(e){return new a({type:"text",data:e,parent:null,prev:null,next:null})},l=t.appendChild=function(e,t){const n=e.children[e.children.length-1];n&&(n.next=t,t.prev=n),e.children.push(t),t.parent=e},u=t.insertBefore=function(e,t,n){const r=e.children.indexOf(n),i=n.prev;i&&(i.next=t,t.prev=i),n.prev=t,t.next=n,e.children.splice(r,0,t),t.parent=e};t.setTemplateContent=function(e,t){l(e,t)},t.getTemplateContent=function(e){return e.children[0]},t.setDocumentType=function(e,t,n,i){const s=r.serializeContent(t,n,i);let o=null;for(let t=0;t<e.children.length;t++)if("directive"===e.children[t].type&&"!doctype"===e.children[t].name){o=e.children[t];break}o?(o.data=s,o["x-name"]=t,o["x-publicId"]=n,o["x-systemId"]=i):l(e,new a({type:"directive",name:"!doctype",data:s,"x-name":t,"x-publicId":n,"x-systemId":i}))},t.setDocumentMode=function(e,t){e["x-mode"]=t},t.getDocumentMode=function(e){return e["x-mode"]},t.detachNode=function(e){if(e.parent){const t=e.parent.children.indexOf(e),n=e.prev,r=e.next;e.prev=null,e.next=null,n&&(n.next=r),r&&(r.prev=n),e.parent.children.splice(t,1),e.parent=null}},t.insertText=function(e,t){const n=e.children[e.children.length-1];n&&"text"===n.type?n.data+=t:l(e,c(t))},t.insertTextBefore=function(e,t,n){const r=e.children[e.children.indexOf(n)-1];r&&"text"===r.type?r.data+=t:u(e,c(t),n)},t.adoptAttributes=function(e,t){for(let n=0;n<t.length;n++){const r=t[n].name;void 0===e.attribs[r]&&(e.attribs[r]=t[n].value,e["x-attribsNamespace"][r]=t[n].namespace,e["x-attribsPrefix"][r]=t[n].prefix)}},t.getFirstChild=function(e){return e.children[0]},t.getChildNodes=function(e){return e.children},t.getParentNode=function(e){return e.parent},t.getAttrList=function(e){const t=[];for(const n in e.attribs)t.push({name:n,value:e.attribs[n],namespace:e["x-attribsNamespace"][n],prefix:e["x-attribsPrefix"][n]});return t},t.getTagName=function(e){return e.name},t.getNamespaceURI=function(e){return e.namespace},t.getTextNodeContent=function(e){return e.data},t.getCommentNodeContent=function(e){return e.data},t.getDocumentTypeNodeName=function(e){return e["x-name"]},t.getDocumentTypeNodePublicId=function(e){return e["x-publicId"]},t.getDocumentTypeNodeSystemId=function(e){return e["x-systemId"]},t.isTextNode=function(e){return"text"===e.type},t.isCommentNode=function(e){return"comment"===e.type},t.isDocumentTypeNode=function(e){return"directive"===e.type&&"!doctype"===e.name},t.isElementNode=function(e){return!!e.attribs},t.setNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=t},t.getNodeSourceCodeLocation=function(e){return e.sourceCodeLocation},t.updateNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=Object.assign(e.sourceCodeLocation,t)}},1515:(e,t,n)=>{"use strict";const{DOCUMENT_MODE:r}=n(6152),i="html",s=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],o=s.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]),a=["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"],c=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],l=c.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]);function u(e){const t=-1!==e.indexOf('"')?"'":'"';return t+e+t}function h(e,t){for(let n=0;n<t.length;n++)if(0===e.indexOf(t[n]))return!0;return!1}t.isConforming=function(e){return e.name===i&&null===e.publicId&&(null===e.systemId||"about:legacy-compat"===e.systemId)},t.getDocumentMode=function(e){if(e.name!==i)return r.QUIRKS;const t=e.systemId;if(t&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===t.toLowerCase())return r.QUIRKS;let n=e.publicId;if(null!==n){if(n=n.toLowerCase(),a.indexOf(n)>-1)return r.QUIRKS;let e=null===t?o:s;if(h(n,e))return r.QUIRKS;if(e=null===t?c:l,h(n,e))return r.LIMITED_QUIRKS}return r.NO_QUIRKS},t.serializeContent=function(e,t,n){let r="!DOCTYPE ";return e&&(r+=e),t?r+=" PUBLIC "+u(t):n&&(r+=" SYSTEM"),null!==n&&(r+=" "+u(n)),r}},1734:e=>{"use strict";e.exports={controlCharacterInInputStream:"control-character-in-input-stream",noncharacterInInputStream:"noncharacter-in-input-stream",surrogateInInputStream:"surrogate-in-input-stream",nonVoidHtmlElementStartTagWithTrailingSolidus:"non-void-html-element-start-tag-with-trailing-solidus",endTagWithAttributes:"end-tag-with-attributes",endTagWithTrailingSolidus:"end-tag-with-trailing-solidus",unexpectedSolidusInTag:"unexpected-solidus-in-tag",unexpectedNullCharacter:"unexpected-null-character",unexpectedQuestionMarkInsteadOfTagName:"unexpected-question-mark-instead-of-tag-name",invalidFirstCharacterOfTagName:"invalid-first-character-of-tag-name",unexpectedEqualsSignBeforeAttributeName:"unexpected-equals-sign-before-attribute-name",missingEndTagName:"missing-end-tag-name",unexpectedCharacterInAttributeName:"unexpected-character-in-attribute-name",unknownNamedCharacterReference:"unknown-named-character-reference",missingSemicolonAfterCharacterReference:"missing-semicolon-after-character-reference",unexpectedCharacterAfterDoctypeSystemIdentifier:"unexpected-character-after-doctype-system-identifier",unexpectedCharacterInUnquotedAttributeValue:"unexpected-character-in-unquoted-attribute-value",eofBeforeTagName:"eof-before-tag-name",eofInTag:"eof-in-tag",missingAttributeValue:"missing-attribute-value",missingWhitespaceBetweenAttributes:"missing-whitespace-between-attributes",missingWhitespaceAfterDoctypePublicKeyword:"missing-whitespace-after-doctype-public-keyword",missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:"missing-whitespace-between-doctype-public-and-system-identifiers",missingWhitespaceAfterDoctypeSystemKeyword:"missing-whitespace-after-doctype-system-keyword",missingQuoteBeforeDoctypePublicIdentifier:"missing-quote-before-doctype-public-identifier",missingQuoteBeforeDoctypeSystemIdentifier:"missing-quote-before-doctype-system-identifier",missingDoctypePublicIdentifier:"missing-doctype-public-identifier",missingDoctypeSystemIdentifier:"missing-doctype-system-identifier",abruptDoctypePublicIdentifier:"abrupt-doctype-public-identifier",abruptDoctypeSystemIdentifier:"abrupt-doctype-system-identifier",cdataInHtmlContent:"cdata-in-html-content",incorrectlyOpenedComment:"incorrectly-opened-comment",eofInScriptHtmlCommentLikeText:"eof-in-script-html-comment-like-text",eofInDoctype:"eof-in-doctype",nestedComment:"nested-comment",abruptClosingOfEmptyComment:"abrupt-closing-of-empty-comment",eofInComment:"eof-in-comment",incorrectlyClosedComment:"incorrectly-closed-comment",eofInCdata:"eof-in-cdata",absenceOfDigitsInNumericCharacterReference:"absence-of-digits-in-numeric-character-reference",nullCharacterReference:"null-character-reference",surrogateCharacterReference:"surrogate-character-reference",characterReferenceOutsideUnicodeRange:"character-reference-outside-unicode-range",controlCharacterReference:"control-character-reference",noncharacterCharacterReference:"noncharacter-character-reference",missingWhitespaceBeforeDoctypeName:"missing-whitespace-before-doctype-name",missingDoctypeName:"missing-doctype-name",invalidCharacterSequenceAfterDoctypeName:"invalid-character-sequence-after-doctype-name",duplicateAttribute:"duplicate-attribute",nonConformingDoctype:"non-conforming-doctype",missingDoctype:"missing-doctype",misplacedDoctype:"misplaced-doctype",endTagWithoutMatchingOpenElement:"end-tag-without-matching-open-element",closingOfElementWithOpenChildElements:"closing-of-element-with-open-child-elements",disallowedContentInNoscriptInHead:"disallowed-content-in-noscript-in-head",openElementsLeftAfterEof:"open-elements-left-after-eof",abandonedHeadElementChild:"abandoned-head-element-child",misplacedStartTagForHeadElement:"misplaced-start-tag-for-head-element",nestedNoscriptInHead:"nested-noscript-in-head",eofInElementThatCanContainOnlyText:"eof-in-element-that-can-contain-only-text"}},8779:(e,t,n)=>{"use strict";const r=n(5763),i=n(6152),s=i.TAG_NAMES,o=i.NAMESPACES,a=i.ATTRS,c={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},l={"xlink:actuate":{prefix:"xlink",name:"actuate",namespace:o.XLINK},"xlink:arcrole":{prefix:"xlink",name:"arcrole",namespace:o.XLINK},"xlink:href":{prefix:"xlink",name:"href",namespace:o.XLINK},"xlink:role":{prefix:"xlink",name:"role",namespace:o.XLINK},"xlink:show":{prefix:"xlink",name:"show",namespace:o.XLINK},"xlink:title":{prefix:"xlink",name:"title",namespace:o.XLINK},"xlink:type":{prefix:"xlink",name:"type",namespace:o.XLINK},"xml:base":{prefix:"xml",name:"base",namespace:o.XML},"xml:lang":{prefix:"xml",name:"lang",namespace:o.XML},"xml:space":{prefix:"xml",name:"space",namespace:o.XML},xmlns:{prefix:"",name:"xmlns",namespace:o.XMLNS},"xmlns:xlink":{prefix:"xmlns",name:"xlink",namespace:o.XMLNS}},u=t.SVG_TAG_NAMES_ADJUSTMENT_MAP={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},h={[s.B]:!0,[s.BIG]:!0,[s.BLOCKQUOTE]:!0,[s.BODY]:!0,[s.BR]:!0,[s.CENTER]:!0,[s.CODE]:!0,[s.DD]:!0,[s.DIV]:!0,[s.DL]:!0,[s.DT]:!0,[s.EM]:!0,[s.EMBED]:!0,[s.H1]:!0,[s.H2]:!0,[s.H3]:!0,[s.H4]:!0,[s.H5]:!0,[s.H6]:!0,[s.HEAD]:!0,[s.HR]:!0,[s.I]:!0,[s.IMG]:!0,[s.LI]:!0,[s.LISTING]:!0,[s.MENU]:!0,[s.META]:!0,[s.NOBR]:!0,[s.OL]:!0,[s.P]:!0,[s.PRE]:!0,[s.RUBY]:!0,[s.S]:!0,[s.SMALL]:!0,[s.SPAN]:!0,[s.STRONG]:!0,[s.STRIKE]:!0,[s.SUB]:!0,[s.SUP]:!0,[s.TABLE]:!0,[s.TT]:!0,[s.U]:!0,[s.UL]:!0,[s.VAR]:!0};t.causesExit=function(e){const t=e.tagName;return!(t!==s.FONT||null===r.getTokenAttr(e,a.COLOR)&&null===r.getTokenAttr(e,a.SIZE)&&null===r.getTokenAttr(e,a.FACE))||h[t]},t.adjustTokenMathMLAttrs=function(e){for(let t=0;t<e.attrs.length;t++)if("definitionurl"===e.attrs[t].name){e.attrs[t].name="definitionURL";break}},t.adjustTokenSVGAttrs=function(e){for(let t=0;t<e.attrs.length;t++){const n=c[e.attrs[t].name];n&&(e.attrs[t].name=n)}},t.adjustTokenXMLAttrs=function(e){for(let t=0;t<e.attrs.length;t++){const n=l[e.attrs[t].name];n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}},t.adjustTokenSVGTagName=function(e){const t=u[e.tagName];t&&(e.tagName=t)},t.isIntegrationPoint=function(e,t,n,r){return!(r&&r!==o.HTML||!function(e,t,n){if(t===o.MATHML&&e===s.ANNOTATION_XML)for(let e=0;e<n.length;e++)if(n[e].name===a.ENCODING){const t=n[e].value.toLowerCase();return"text/html"===t||"application/xhtml+xml"===t}return t===o.SVG&&(e===s.FOREIGN_OBJECT||e===s.DESC||e===s.TITLE)}(e,t,n))||!(r&&r!==o.MATHML||!function(e,t){return t===o.MATHML&&(e===s.MI||e===s.MO||e===s.MN||e===s.MS||e===s.MTEXT)}(e,t))}},6152:(e,t)=>{"use strict";const n=t.NAMESPACES={HTML:"http://www.w3.org/1999/xhtml",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"};t.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"},t.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};const r=t.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};t.SPECIAL_ELEMENTS={[n.HTML]:{[r.ADDRESS]:!0,[r.APPLET]:!0,[r.AREA]:!0,[r.ARTICLE]:!0,[r.ASIDE]:!0,[r.BASE]:!0,[r.BASEFONT]:!0,[r.BGSOUND]:!0,[r.BLOCKQUOTE]:!0,[r.BODY]:!0,[r.BR]:!0,[r.BUTTON]:!0,[r.CAPTION]:!0,[r.CENTER]:!0,[r.COL]:!0,[r.COLGROUP]:!0,[r.DD]:!0,[r.DETAILS]:!0,[r.DIR]:!0,[r.DIV]:!0,[r.DL]:!0,[r.DT]:!0,[r.EMBED]:!0,[r.FIELDSET]:!0,[r.FIGCAPTION]:!0,[r.FIGURE]:!0,[r.FOOTER]:!0,[r.FORM]:!0,[r.FRAME]:!0,[r.FRAMESET]:!0,[r.H1]:!0,[r.H2]:!0,[r.H3]:!0,[r.H4]:!0,[r.H5]:!0,[r.H6]:!0,[r.HEAD]:!0,[r.HEADER]:!0,[r.HGROUP]:!0,[r.HR]:!0,[r.HTML]:!0,[r.IFRAME]:!0,[r.IMG]:!0,[r.INPUT]:!0,[r.LI]:!0,[r.LINK]:!0,[r.LISTING]:!0,[r.MAIN]:!0,[r.MARQUEE]:!0,[r.MENU]:!0,[r.META]:!0,[r.NAV]:!0,[r.NOEMBED]:!0,[r.NOFRAMES]:!0,[r.NOSCRIPT]:!0,[r.OBJECT]:!0,[r.OL]:!0,[r.P]:!0,[r.PARAM]:!0,[r.PLAINTEXT]:!0,[r.PRE]:!0,[r.SCRIPT]:!0,[r.SECTION]:!0,[r.SELECT]:!0,[r.SOURCE]:!0,[r.STYLE]:!0,[r.SUMMARY]:!0,[r.TABLE]:!0,[r.TBODY]:!0,[r.TD]:!0,[r.TEMPLATE]:!0,[r.TEXTAREA]:!0,[r.TFOOT]:!0,[r.TH]:!0,[r.THEAD]:!0,[r.TITLE]:!0,[r.TR]:!0,[r.TRACK]:!0,[r.UL]:!0,[r.WBR]:!0,[r.XMP]:!0},[n.MATHML]:{[r.MI]:!0,[r.MO]:!0,[r.MN]:!0,[r.MS]:!0,[r.MTEXT]:!0,[r.ANNOTATION_XML]:!0},[n.SVG]:{[r.TITLE]:!0,[r.FOREIGN_OBJECT]:!0,[r.DESC]:!0}}},4284:(e,t)=>{"use strict";const n=[65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];t.REPLACEMENT_CHARACTER="�",t.CODE_POINTS={EOF:-1,NULL:0,TABULATION:9,CARRIAGE_RETURN:13,LINE_FEED:10,FORM_FEED:12,SPACE:32,EXCLAMATION_MARK:33,QUOTATION_MARK:34,NUMBER_SIGN:35,AMPERSAND:38,APOSTROPHE:39,HYPHEN_MINUS:45,SOLIDUS:47,DIGIT_0:48,DIGIT_9:57,SEMICOLON:59,LESS_THAN_SIGN:60,EQUALS_SIGN:61,GREATER_THAN_SIGN:62,QUESTION_MARK:63,LATIN_CAPITAL_A:65,LATIN_CAPITAL_F:70,LATIN_CAPITAL_X:88,LATIN_CAPITAL_Z:90,RIGHT_SQUARE_BRACKET:93,GRAVE_ACCENT:96,LATIN_SMALL_A:97,LATIN_SMALL_F:102,LATIN_SMALL_X:120,LATIN_SMALL_Z:122,REPLACEMENT_CHARACTER:65533},t.CODE_POINT_SEQUENCES={DASH_DASH_STRING:[45,45],DOCTYPE_STRING:[68,79,67,84,89,80,69],CDATA_START_STRING:[91,67,68,65,84,65,91],SCRIPT_STRING:[115,99,114,105,112,116],PUBLIC_STRING:[80,85,66,76,73,67],SYSTEM_STRING:[83,89,83,84,69,77]},t.isSurrogate=function(e){return e>=55296&&e<=57343},t.isSurrogatePair=function(e){return e>=56320&&e<=57343},t.getSurrogatePairCodePoint=function(e,t){return 1024*(e-55296)+9216+t},t.isControlCodePoint=function(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159},t.isUndefinedCodePoint=function(e){return e>=64976&&e<=65007||n.indexOf(e)>-1}},3843:(e,t,n)=>{"use strict";const r=n(1704);e.exports=class extends r{constructor(e,t){super(e),this.posTracker=null,this.onParseError=t.onParseError}_setErrorLocation(e){e.startLine=e.endLine=this.posTracker.line,e.startCol=e.endCol=this.posTracker.col,e.startOffset=e.endOffset=this.posTracker.offset}_reportError(e){const t={code:e,startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1};this._setErrorLocation(t),this.onParseError(t)}_getOverriddenMethods(e){return{_err(t){e._reportError(t)}}}}},2232:(e,t,n)=>{"use strict";const r=n(3843),i=n(50),s=n(6110),o=n(1704);e.exports=class extends r{constructor(e,t){super(e,t),this.opts=t,this.ctLoc=null,this.locBeforeToken=!1}_setErrorLocation(e){this.ctLoc&&(e.startLine=this.ctLoc.startLine,e.startCol=this.ctLoc.startCol,e.startOffset=this.ctLoc.startOffset,e.endLine=this.locBeforeToken?this.ctLoc.startLine:this.ctLoc.endLine,e.endCol=this.locBeforeToken?this.ctLoc.startCol:this.ctLoc.endCol,e.endOffset=this.locBeforeToken?this.ctLoc.startOffset:this.ctLoc.endOffset)}_getOverriddenMethods(e,t){return{_bootstrap(n,r){t._bootstrap.call(this,n,r),o.install(this.tokenizer,i,e.opts),o.install(this.tokenizer,s)},_processInputToken(n){e.ctLoc=n.location,t._processInputToken.call(this,n)},_err(t,n){e.locBeforeToken=n&&n.beforeToken,e._reportError(t)}}}}},3288:(e,t,n)=>{"use strict";const r=n(3843),i=n(7930),s=n(1704);e.exports=class extends r{constructor(e,t){super(e,t),this.posTracker=s.install(e,i),this.lastErrOffset=-1}_reportError(e){this.lastErrOffset!==this.posTracker.offset&&(this.lastErrOffset=this.posTracker.offset,super._reportError(e))}}},50:(e,t,n)=>{"use strict";const r=n(3843),i=n(3288),s=n(1704);e.exports=class extends r{constructor(e,t){super(e,t);const n=s.install(e.preprocessor,i,t);this.posTracker=n.posTracker}}},1077:(e,t,n)=>{"use strict";const r=n(1704);e.exports=class extends r{constructor(e,t){super(e),this.onItemPop=t.onItemPop}_getOverriddenMethods(e,t){return{pop(){e.onItemPop(this.current),t.pop.call(this)},popAllUpToHtmlElement(){for(let t=this.stackTop;t>0;t--)e.onItemPop(this.items[t]);t.popAllUpToHtmlElement.call(this)},remove(n){e.onItemPop(this.current),t.remove.call(this,n)}}}}},452:(e,t,n)=>{"use strict";const r=n(1704),i=n(5763),s=n(6110),o=n(1077),a=n(6152).TAG_NAMES;e.exports=class extends r{constructor(e){super(e),this.parser=e,this.treeAdapter=this.parser.treeAdapter,this.posTracker=null,this.lastStartTagToken=null,this.lastFosterParentingLocation=null,this.currentToken=null}_setStartLocation(e){let t=null;this.lastStartTagToken&&(t=Object.assign({},this.lastStartTagToken.location),t.startTag=this.lastStartTagToken.location),this.treeAdapter.setNodeSourceCodeLocation(e,t)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,r=this.treeAdapter.getTagName(e),s={};t.type===i.END_TAG_TOKEN&&r===t.tagName?(s.endTag=Object.assign({},n),s.endLine=n.endLine,s.endCol=n.endCol,s.endOffset=n.endOffset):(s.endLine=n.startLine,s.endCol=n.startCol,s.endOffset=n.startOffset),this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}_getOverriddenMethods(e,t){return{_bootstrap(n,i){t._bootstrap.call(this,n,i),e.lastStartTagToken=null,e.lastFosterParentingLocation=null,e.currentToken=null;const a=r.install(this.tokenizer,s);e.posTracker=a.posTracker,r.install(this.openElements,o,{onItemPop:function(t){e._setEndLocation(t,e.currentToken)}})},_runParsingLoop(n){t._runParsingLoop.call(this,n);for(let t=this.openElements.stackTop;t>=0;t--)e._setEndLocation(this.openElements.items[t],e.currentToken)},_processTokenInForeignContent(n){e.currentToken=n,t._processTokenInForeignContent.call(this,n)},_processToken(n){if(e.currentToken=n,t._processToken.call(this,n),n.type===i.END_TAG_TOKEN&&(n.tagName===a.HTML||n.tagName===a.BODY&&this.openElements.hasInScope(a.BODY)))for(let t=this.openElements.stackTop;t>=0;t--){const r=this.openElements.items[t];if(this.treeAdapter.getTagName(r)===n.tagName){e._setEndLocation(r,n);break}}},_setDocumentType(e){t._setDocumentType.call(this,e);const n=this.treeAdapter.getChildNodes(this.document),r=n.length;for(let t=0;t<r;t++){const r=n[t];if(this.treeAdapter.isDocumentTypeNode(r)){this.treeAdapter.setNodeSourceCodeLocation(r,e.location);break}}},_attachElementToTree(n){e._setStartLocation(n),e.lastStartTagToken=null,t._attachElementToTree.call(this,n)},_appendElement(n,r){e.lastStartTagToken=n,t._appendElement.call(this,n,r)},_insertElement(n,r){e.lastStartTagToken=n,t._insertElement.call(this,n,r)},_insertTemplate(n){e.lastStartTagToken=n,t._insertTemplate.call(this,n);const r=this.treeAdapter.getTemplateContent(this.openElements.current);this.treeAdapter.setNodeSourceCodeLocation(r,null)},_insertFakeRootElement(){t._insertFakeRootElement.call(this),this.treeAdapter.setNodeSourceCodeLocation(this.openElements.current,null)},_appendCommentNode(e,n){t._appendCommentNode.call(this,e,n);const r=this.treeAdapter.getChildNodes(n),i=r[r.length-1];this.treeAdapter.setNodeSourceCodeLocation(i,e.location)},_findFosterParentingLocation(){return e.lastFosterParentingLocation=t._findFosterParentingLocation.call(this),e.lastFosterParentingLocation},_insertCharacters(n){t._insertCharacters.call(this,n);const r=this._shouldFosterParentOnInsertion(),i=r&&e.lastFosterParentingLocation.parent||this.openElements.currentTmplContent||this.openElements.current,s=this.treeAdapter.getChildNodes(i),o=r&&e.lastFosterParentingLocation.beforeElement?s.indexOf(e.lastFosterParentingLocation.beforeElement)-1:s.length-1,a=s[o];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:e,endCol:t,endOffset:r}=n.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:e,endCol:t,endOffset:r})}else this.treeAdapter.setNodeSourceCodeLocation(a,n.location)}}}}},6110:(e,t,n)=>{"use strict";const r=n(1704),i=n(5763),s=n(7930);e.exports=class extends r{constructor(e){super(e),this.tokenizer=e,this.posTracker=r.install(e.preprocessor,s),this.currentAttrLocation=null,this.ctLoc=null}_getCurrentLocation(){return{startLine:this.posTracker.line,startCol:this.posTracker.col,startOffset:this.posTracker.offset,endLine:-1,endCol:-1,endOffset:-1}}_attachCurrentAttrLocationInfo(){this.currentAttrLocation.endLine=this.posTracker.line,this.currentAttrLocation.endCol=this.posTracker.col,this.currentAttrLocation.endOffset=this.posTracker.offset;const e=this.tokenizer.currentToken,t=this.tokenizer.currentAttr;e.location.attrs||(e.location.attrs=Object.create(null)),e.location.attrs[t.name]=this.currentAttrLocation}_getOverriddenMethods(e,t){const n={_createStartTagToken(){t._createStartTagToken.call(this),this.currentToken.location=e.ctLoc},_createEndTagToken(){t._createEndTagToken.call(this),this.currentToken.location=e.ctLoc},_createCommentToken(){t._createCommentToken.call(this),this.currentToken.location=e.ctLoc},_createDoctypeToken(n){t._createDoctypeToken.call(this,n),this.currentToken.location=e.ctLoc},_createCharacterToken(n,r){t._createCharacterToken.call(this,n,r),this.currentCharacterToken.location=e.ctLoc},_createEOFToken(){t._createEOFToken.call(this),this.currentToken.location=e._getCurrentLocation()},_createAttr(n){t._createAttr.call(this,n),e.currentAttrLocation=e._getCurrentLocation()},_leaveAttrName(n){t._leaveAttrName.call(this,n),e._attachCurrentAttrLocationInfo()},_leaveAttrValue(n){t._leaveAttrValue.call(this,n),e._attachCurrentAttrLocationInfo()},_emitCurrentToken(){const n=this.currentToken.location;this.currentCharacterToken&&(this.currentCharacterToken.location.endLine=n.startLine,this.currentCharacterToken.location.endCol=n.startCol,this.currentCharacterToken.location.endOffset=n.startOffset),this.currentToken.type===i.EOF_TOKEN?(n.endLine=n.startLine,n.endCol=n.startCol,n.endOffset=n.startOffset):(n.endLine=e.posTracker.line,n.endCol=e.posTracker.col+1,n.endOffset=e.posTracker.offset+1),t._emitCurrentToken.call(this)},_emitCurrentCharacterToken(){const n=this.currentCharacterToken&&this.currentCharacterToken.location;n&&-1===n.endOffset&&(n.endLine=e.posTracker.line,n.endCol=e.posTracker.col,n.endOffset=e.posTracker.offset),t._emitCurrentCharacterToken.call(this)}};return Object.keys(i.MODE).forEach((r=>{const s=i.MODE[r];n[s]=function(n){e.ctLoc=e._getCurrentLocation(),t[s].call(this,n)}})),n}}},7930:(e,t,n)=>{"use strict";const r=n(1704);e.exports=class extends r{constructor(e){super(e),this.preprocessor=e,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.offset=0,this.col=0,this.line=1}_getOverriddenMethods(e,t){return{advance(){const n=this.pos+1,r=this.html[n];return e.isEol&&(e.isEol=!1,e.line++,e.lineStartPos=n),("\n"===r||"\r"===r&&"\n"!==this.html[n+1])&&(e.isEol=!0),e.col=n-e.lineStartPos+1,e.offset=e.droppedBufferSize+n,t.advance.call(this)},retreat(){t.retreat.call(this),e.isEol=!1,e.col=this.pos-e.lineStartPos+1},dropParsedChunk(){const n=this.pos;t.dropParsedChunk.call(this);const r=n-this.pos;e.lineStartPos-=r,e.droppedBufferSize+=r,e.offset=e.droppedBufferSize+this.pos}}}}},2394:(e,t,n)=>{"use strict";const r=n(7045),i=n(3988);t.parse=function(e,t){return new r(t).parse(e)},t.parseFragment=function(e,t,n){return"string"==typeof e&&(n=t,t=e,e=null),new r(n).parseFragment(t,e)},t.serialize=function(e,t){return new i(e,t).serialize()}},2484:e=>{"use strict";class t{constructor(e){this.length=0,this.entries=[],this.treeAdapter=e,this.bookmark=null}_getNoahArkConditionCandidates(e){const n=[];if(this.length>=3){const r=this.treeAdapter.getAttrList(e).length,i=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let e=this.length-1;e>=0;e--){const o=this.entries[e];if(o.type===t.MARKER_ENTRY)break;const a=o.element,c=this.treeAdapter.getAttrList(a);this.treeAdapter.getTagName(a)===i&&this.treeAdapter.getNamespaceURI(a)===s&&c.length===r&&n.push({idx:e,attrs:c})}}return n.length<3?[]:n}_ensureNoahArkCondition(e){const t=this._getNoahArkConditionCandidates(e);let n=t.length;if(n){const r=this.treeAdapter.getAttrList(e),i=r.length,s=Object.create(null);for(let e=0;e<i;e++){const t=r[e];s[t.name]=t.value}for(let e=0;e<i;e++)for(let r=0;r<n;r++){const i=t[r].attrs[e];if(s[i.name]!==i.value&&(t.splice(r,1),n--),t.length<3)return}for(let e=n-1;e>=2;e--)this.entries.splice(t[e].idx,1),this.length--}}insertMarker(){this.entries.push({type:t.MARKER_ENTRY}),this.length++}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.push({type:t.ELEMENT_ENTRY,element:e,token:n}),this.length++}insertElementAfterBookmark(e,n){let r=this.length-1;for(;r>=0&&this.entries[r]!==this.bookmark;r--);this.entries.splice(r+1,0,{type:t.ELEMENT_ENTRY,element:e,token:n}),this.length++}removeEntry(e){for(let t=this.length-1;t>=0;t--)if(this.entries[t]===e){this.entries.splice(t,1),this.length--;break}}clearToLastMarker(){for(;this.length;){const e=this.entries.pop();if(this.length--,e.type===t.MARKER_ENTRY)break}}getElementEntryInScopeWithTagName(e){for(let n=this.length-1;n>=0;n--){const r=this.entries[n];if(r.type===t.MARKER_ENTRY)return null;if(this.treeAdapter.getTagName(r.element)===e)return r}return null}getElementEntry(e){for(let n=this.length-1;n>=0;n--){const r=this.entries[n];if(r.type===t.ELEMENT_ENTRY&&r.element===e)return r}return null}}t.MARKER_ENTRY="MARKER_ENTRY",t.ELEMENT_ENTRY="ELEMENT_ENTRY",e.exports=t},7045:(e,t,n)=>{"use strict";const r=n(5763),i=n(6519),s=n(2484),o=n(452),a=n(2232),c=n(1704),l=n(7296),u=n(8904),h=n(1515),p=n(8779),d=n(1734),f=n(4284),m=n(6152),T=m.TAG_NAMES,_=m.NAMESPACES,E=m.ATTRS,g={scriptingEnabled:!0,sourceCodeLocationInfo:!1,onParseError:null,treeAdapter:l},A="hidden",C="INITIAL_MODE",N="BEFORE_HTML_MODE",O="BEFORE_HEAD_MODE",v="IN_HEAD_MODE",b="IN_HEAD_NO_SCRIPT_MODE",S="AFTER_HEAD_MODE",y="IN_BODY_MODE",I="TEXT_MODE",k="IN_TABLE_MODE",R="IN_TABLE_TEXT_MODE",L="IN_CAPTION_MODE",M="IN_COLUMN_GROUP_MODE",x="IN_TABLE_BODY_MODE",P="IN_ROW_MODE",D="IN_CELL_MODE",w="IN_SELECT_MODE",H="IN_SELECT_IN_TABLE_MODE",F="IN_TEMPLATE_MODE",U="AFTER_BODY_MODE",B="IN_FRAMESET_MODE",G="AFTER_FRAMESET_MODE",j="AFTER_AFTER_BODY_MODE",q="AFTER_AFTER_FRAMESET_MODE",K={[T.TR]:P,[T.TBODY]:x,[T.THEAD]:x,[T.TFOOT]:x,[T.CAPTION]:L,[T.COLGROUP]:M,[T.TABLE]:k,[T.BODY]:y,[T.FRAMESET]:B},V={[T.CAPTION]:k,[T.COLGROUP]:k,[T.TBODY]:k,[T.TFOOT]:k,[T.THEAD]:k,[T.COL]:M,[T.TR]:x,[T.TD]:P,[T.TH]:P},Y={[C]:{[r.CHARACTER_TOKEN]:oe,[r.NULL_CHARACTER_TOKEN]:oe,[r.WHITESPACE_CHARACTER_TOKEN]:ee,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:function(e,t){e._setDocumentType(t);const n=t.forceQuirks?m.DOCUMENT_MODE.QUIRKS:h.getDocumentMode(t);h.isConforming(t)||e._err(d.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=N},[r.START_TAG_TOKEN]:oe,[r.END_TAG_TOKEN]:oe,[r.EOF_TOKEN]:oe},[N]:{[r.CHARACTER_TOKEN]:ae,[r.NULL_CHARACTER_TOKEN]:ae,[r.WHITESPACE_CHARACTER_TOKEN]:ee,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){t.tagName===T.HTML?(e._insertElement(t,_.HTML),e.insertionMode=O):ae(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n!==T.HTML&&n!==T.HEAD&&n!==T.BODY&&n!==T.BR||ae(e,t)},[r.EOF_TOKEN]:ae},[O]:{[r.CHARACTER_TOKEN]:ce,[r.NULL_CHARACTER_TOKEN]:ce,[r.WHITESPACE_CHARACTER_TOKEN]:ee,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:te,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.HTML?Se(e,t):n===T.HEAD?(e._insertElement(t,_.HTML),e.headElement=e.openElements.current,e.insertionMode=v):ce(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.HEAD||n===T.BODY||n===T.HTML||n===T.BR?ce(e,t):e._err(d.endTagWithoutMatchingOpenElement)},[r.EOF_TOKEN]:ce},[v]:{[r.CHARACTER_TOKEN]:he,[r.NULL_CHARACTER_TOKEN]:he,[r.WHITESPACE_CHARACTER_TOKEN]:ie,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:te,[r.START_TAG_TOKEN]:le,[r.END_TAG_TOKEN]:ue,[r.EOF_TOKEN]:he},[b]:{[r.CHARACTER_TOKEN]:pe,[r.NULL_CHARACTER_TOKEN]:pe,[r.WHITESPACE_CHARACTER_TOKEN]:ie,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:te,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.HTML?Se(e,t):n===T.BASEFONT||n===T.BGSOUND||n===T.HEAD||n===T.LINK||n===T.META||n===T.NOFRAMES||n===T.STYLE?le(e,t):n===T.NOSCRIPT?e._err(d.nestedNoscriptInHead):pe(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.NOSCRIPT?(e.openElements.pop(),e.insertionMode=v):n===T.BR?pe(e,t):e._err(d.endTagWithoutMatchingOpenElement)},[r.EOF_TOKEN]:pe},[S]:{[r.CHARACTER_TOKEN]:de,[r.NULL_CHARACTER_TOKEN]:de,[r.WHITESPACE_CHARACTER_TOKEN]:ie,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:te,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.HTML?Se(e,t):n===T.BODY?(e._insertElement(t,_.HTML),e.framesetOk=!1,e.insertionMode=y):n===T.FRAMESET?(e._insertElement(t,_.HTML),e.insertionMode=B):n===T.BASE||n===T.BASEFONT||n===T.BGSOUND||n===T.LINK||n===T.META||n===T.NOFRAMES||n===T.SCRIPT||n===T.STYLE||n===T.TEMPLATE||n===T.TITLE?(e._err(d.abandonedHeadElementChild),e.openElements.push(e.headElement),le(e,t),e.openElements.remove(e.headElement)):n===T.HEAD?e._err(d.misplacedStartTagForHeadElement):de(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.BODY||n===T.HTML||n===T.BR?de(e,t):n===T.TEMPLATE?ue(e,t):e._err(d.endTagWithoutMatchingOpenElement)},[r.EOF_TOKEN]:de},[y]:{[r.CHARACTER_TOKEN]:me,[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:fe,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:Se,[r.END_TAG_TOKEN]:Re,[r.EOF_TOKEN]:Le},[I]:{[r.CHARACTER_TOKEN]:ie,[r.NULL_CHARACTER_TOKEN]:ie,[r.WHITESPACE_CHARACTER_TOKEN]:ie,[r.COMMENT_TOKEN]:ee,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:ee,[r.END_TAG_TOKEN]:function(e,t){t.tagName===T.SCRIPT&&(e.pendingScript=e.openElements.current),e.openElements.pop(),e.insertionMode=e.originalInsertionMode},[r.EOF_TOKEN]:function(e,t){e._err(d.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e._processToken(t)}},[k]:{[r.CHARACTER_TOKEN]:Me,[r.NULL_CHARACTER_TOKEN]:Me,[r.WHITESPACE_CHARACTER_TOKEN]:Me,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:xe,[r.END_TAG_TOKEN]:Pe,[r.EOF_TOKEN]:Le},[R]:{[r.CHARACTER_TOKEN]:function(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0},[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:function(e,t){e.pendingCharacterTokens.push(t)},[r.COMMENT_TOKEN]:we,[r.DOCTYPE_TOKEN]:we,[r.START_TAG_TOKEN]:we,[r.END_TAG_TOKEN]:we,[r.EOF_TOKEN]:we},[L]:{[r.CHARACTER_TOKEN]:me,[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:fe,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.CAPTION||n===T.COL||n===T.COLGROUP||n===T.TBODY||n===T.TD||n===T.TFOOT||n===T.TH||n===T.THEAD||n===T.TR?e.openElements.hasInTableScope(T.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(T.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=k,e._processToken(t)):Se(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.CAPTION||n===T.TABLE?e.openElements.hasInTableScope(T.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(T.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=k,n===T.TABLE&&e._processToken(t)):n!==T.BODY&&n!==T.COL&&n!==T.COLGROUP&&n!==T.HTML&&n!==T.TBODY&&n!==T.TD&&n!==T.TFOOT&&n!==T.TH&&n!==T.THEAD&&n!==T.TR&&Re(e,t)},[r.EOF_TOKEN]:Le},[M]:{[r.CHARACTER_TOKEN]:He,[r.NULL_CHARACTER_TOKEN]:He,[r.WHITESPACE_CHARACTER_TOKEN]:ie,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.HTML?Se(e,t):n===T.COL?(e._appendElement(t,_.HTML),t.ackSelfClosing=!0):n===T.TEMPLATE?le(e,t):He(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.COLGROUP?e.openElements.currentTagName===T.COLGROUP&&(e.openElements.pop(),e.insertionMode=k):n===T.TEMPLATE?ue(e,t):n!==T.COL&&He(e,t)},[r.EOF_TOKEN]:Le},[x]:{[r.CHARACTER_TOKEN]:Me,[r.NULL_CHARACTER_TOKEN]:Me,[r.WHITESPACE_CHARACTER_TOKEN]:Me,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.TR?(e.openElements.clearBackToTableBodyContext(),e._insertElement(t,_.HTML),e.insertionMode=P):n===T.TH||n===T.TD?(e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(T.TR),e.insertionMode=P,e._processToken(t)):n===T.CAPTION||n===T.COL||n===T.COLGROUP||n===T.TBODY||n===T.TFOOT||n===T.THEAD?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=k,e._processToken(t)):xe(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.TBODY||n===T.TFOOT||n===T.THEAD?e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=k):n===T.TABLE?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=k,e._processToken(t)):(n!==T.BODY&&n!==T.CAPTION&&n!==T.COL&&n!==T.COLGROUP||n!==T.HTML&&n!==T.TD&&n!==T.TH&&n!==T.TR)&&Pe(e,t)},[r.EOF_TOKEN]:Le},[P]:{[r.CHARACTER_TOKEN]:Me,[r.NULL_CHARACTER_TOKEN]:Me,[r.WHITESPACE_CHARACTER_TOKEN]:Me,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.TH||n===T.TD?(e.openElements.clearBackToTableRowContext(),e._insertElement(t,_.HTML),e.insertionMode=D,e.activeFormattingElements.insertMarker()):n===T.CAPTION||n===T.COL||n===T.COLGROUP||n===T.TBODY||n===T.TFOOT||n===T.THEAD||n===T.TR?e.openElements.hasInTableScope(T.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=x,e._processToken(t)):xe(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.TR?e.openElements.hasInTableScope(T.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=x):n===T.TABLE?e.openElements.hasInTableScope(T.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=x,e._processToken(t)):n===T.TBODY||n===T.TFOOT||n===T.THEAD?(e.openElements.hasInTableScope(n)||e.openElements.hasInTableScope(T.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=x,e._processToken(t)):(n!==T.BODY&&n!==T.CAPTION&&n!==T.COL&&n!==T.COLGROUP||n!==T.HTML&&n!==T.TD&&n!==T.TH)&&Pe(e,t)},[r.EOF_TOKEN]:Le},[D]:{[r.CHARACTER_TOKEN]:me,[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:fe,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.CAPTION||n===T.COL||n===T.COLGROUP||n===T.TBODY||n===T.TD||n===T.TFOOT||n===T.TH||n===T.THEAD||n===T.TR?(e.openElements.hasInTableScope(T.TD)||e.openElements.hasInTableScope(T.TH))&&(e._closeTableCell(),e._processToken(t)):Se(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.TD||n===T.TH?e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=P):n===T.TABLE||n===T.TBODY||n===T.TFOOT||n===T.THEAD||n===T.TR?e.openElements.hasInTableScope(n)&&(e._closeTableCell(),e._processToken(t)):n!==T.BODY&&n!==T.CAPTION&&n!==T.COL&&n!==T.COLGROUP&&n!==T.HTML&&Re(e,t)},[r.EOF_TOKEN]:Le},[w]:{[r.CHARACTER_TOKEN]:ie,[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:ie,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:Fe,[r.END_TAG_TOKEN]:Ue,[r.EOF_TOKEN]:Le},[H]:{[r.CHARACTER_TOKEN]:ie,[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:ie,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.CAPTION||n===T.TABLE||n===T.TBODY||n===T.TFOOT||n===T.THEAD||n===T.TR||n===T.TD||n===T.TH?(e.openElements.popUntilTagNamePopped(T.SELECT),e._resetInsertionMode(),e._processToken(t)):Fe(e,t)},[r.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.CAPTION||n===T.TABLE||n===T.TBODY||n===T.TFOOT||n===T.THEAD||n===T.TR||n===T.TD||n===T.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(T.SELECT),e._resetInsertionMode(),e._processToken(t)):Ue(e,t)},[r.EOF_TOKEN]:Le},[F]:{[r.CHARACTER_TOKEN]:me,[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:fe,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;if(n===T.BASE||n===T.BASEFONT||n===T.BGSOUND||n===T.LINK||n===T.META||n===T.NOFRAMES||n===T.SCRIPT||n===T.STYLE||n===T.TEMPLATE||n===T.TITLE)le(e,t);else{const r=V[n]||y;e._popTmplInsertionMode(),e._pushTmplInsertionMode(r),e.insertionMode=r,e._processToken(t)}},[r.END_TAG_TOKEN]:function(e,t){t.tagName===T.TEMPLATE&&ue(e,t)},[r.EOF_TOKEN]:Be},[U]:{[r.CHARACTER_TOKEN]:Ge,[r.NULL_CHARACTER_TOKEN]:Ge,[r.WHITESPACE_CHARACTER_TOKEN]:fe,[r.COMMENT_TOKEN]:function(e,t){e._appendCommentNode(t,e.openElements.items[0])},[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){t.tagName===T.HTML?Se(e,t):Ge(e,t)},[r.END_TAG_TOKEN]:function(e,t){t.tagName===T.HTML?e.fragmentContext||(e.insertionMode=j):Ge(e,t)},[r.EOF_TOKEN]:se},[B]:{[r.CHARACTER_TOKEN]:ee,[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:ie,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.HTML?Se(e,t):n===T.FRAMESET?e._insertElement(t,_.HTML):n===T.FRAME?(e._appendElement(t,_.HTML),t.ackSelfClosing=!0):n===T.NOFRAMES&&le(e,t)},[r.END_TAG_TOKEN]:function(e,t){t.tagName!==T.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagName===T.FRAMESET||(e.insertionMode=G))},[r.EOF_TOKEN]:se},[G]:{[r.CHARACTER_TOKEN]:ee,[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:ie,[r.COMMENT_TOKEN]:ne,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.HTML?Se(e,t):n===T.NOFRAMES&&le(e,t)},[r.END_TAG_TOKEN]:function(e,t){t.tagName===T.HTML&&(e.insertionMode=q)},[r.EOF_TOKEN]:se},[j]:{[r.CHARACTER_TOKEN]:je,[r.NULL_CHARACTER_TOKEN]:je,[r.WHITESPACE_CHARACTER_TOKEN]:fe,[r.COMMENT_TOKEN]:re,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){t.tagName===T.HTML?Se(e,t):je(e,t)},[r.END_TAG_TOKEN]:je,[r.EOF_TOKEN]:se},[q]:{[r.CHARACTER_TOKEN]:ee,[r.NULL_CHARACTER_TOKEN]:ee,[r.WHITESPACE_CHARACTER_TOKEN]:fe,[r.COMMENT_TOKEN]:re,[r.DOCTYPE_TOKEN]:ee,[r.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===T.HTML?Se(e,t):n===T.NOFRAMES&&le(e,t)},[r.END_TAG_TOKEN]:ee,[r.EOF_TOKEN]:se}};function W(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagName)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):ke(e,t),n}function Q(e,t){let n=null;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i)&&(n=i)}return n||(e.openElements.popUntilElementPopped(t.element),e.activeFormattingElements.removeEntry(t)),n}function z(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,o=i;o!==n;s++,o=i){i=e.openElements.getCommonAncestor(o);const n=e.activeFormattingElements.getElementEntry(o),a=n&&s>=3;!n||a?(a&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=$(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function $(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function X(e,t,n){if(e._isElementCausesFosterParenting(t))e._fosterParentElement(n);else{const r=e.treeAdapter.getTagName(t),i=e.treeAdapter.getNamespaceURI(t);r===T.TEMPLATE&&i===_.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function J(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),i=n.token,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,n.token),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s)}function Z(e,t){let n;for(let r=0;r<8&&(n=W(e,t),n);r++){const t=Q(e,n);if(!t)break;e.activeFormattingElements.bookmark=n;const r=z(e,t,n.element),i=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(r),X(e,i,r),J(e,t,n)}}function ee(){}function te(e){e._err(d.misplacedDoctype)}function ne(e,t){e._appendCommentNode(t,e.openElements.currentTmplContent||e.openElements.current)}function re(e,t){e._appendCommentNode(t,e.document)}function ie(e,t){e._insertCharacters(t)}function se(e){e.stopped=!0}function oe(e,t){e._err(d.missingDoctype,{beforeToken:!0}),e.treeAdapter.setDocumentMode(e.document,m.DOCUMENT_MODE.QUIRKS),e.insertionMode=N,e._processToken(t)}function ae(e,t){e._insertFakeRootElement(),e.insertionMode=O,e._processToken(t)}function ce(e,t){e._insertFakeElement(T.HEAD),e.headElement=e.openElements.current,e.insertionMode=v,e._processToken(t)}function le(e,t){const n=t.tagName;n===T.HTML?Se(e,t):n===T.BASE||n===T.BASEFONT||n===T.BGSOUND||n===T.LINK||n===T.META?(e._appendElement(t,_.HTML),t.ackSelfClosing=!0):n===T.TITLE?e._switchToTextParsing(t,r.MODE.RCDATA):n===T.NOSCRIPT?e.options.scriptingEnabled?e._switchToTextParsing(t,r.MODE.RAWTEXT):(e._insertElement(t,_.HTML),e.insertionMode=b):n===T.NOFRAMES||n===T.STYLE?e._switchToTextParsing(t,r.MODE.RAWTEXT):n===T.SCRIPT?e._switchToTextParsing(t,r.MODE.SCRIPT_DATA):n===T.TEMPLATE?(e._insertTemplate(t,_.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=F,e._pushTmplInsertionMode(F)):n===T.HEAD?e._err(d.misplacedStartTagForHeadElement):he(e,t)}function ue(e,t){const n=t.tagName;n===T.HEAD?(e.openElements.pop(),e.insertionMode=S):n===T.BODY||n===T.BR||n===T.HTML?he(e,t):n===T.TEMPLATE&&e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagName!==T.TEMPLATE&&e._err(d.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(T.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode()):e._err(d.endTagWithoutMatchingOpenElement)}function he(e,t){e.openElements.pop(),e.insertionMode=S,e._processToken(t)}function pe(e,t){const n=t.type===r.EOF_TOKEN?d.openElementsLeftAfterEof:d.disallowedContentInNoscriptInHead;e._err(n),e.openElements.pop(),e.insertionMode=v,e._processToken(t)}function de(e,t){e._insertFakeElement(T.BODY),e.insertionMode=y,e._processToken(t)}function fe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function me(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Te(e,t){e.openElements.hasInButtonScope(T.P)&&e._closePElement(),e._insertElement(t,_.HTML)}function _e(e,t){e.openElements.hasInButtonScope(T.P)&&e._closePElement(),e._insertElement(t,_.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Ee(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function ge(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Ae(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,_.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ce(e,t){e._appendElement(t,_.HTML),t.ackSelfClosing=!0}function Ne(e,t){e._switchToTextParsing(t,r.MODE.RAWTEXT)}function Oe(e,t){e.openElements.currentTagName===T.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,_.HTML)}function ve(e,t){e.openElements.hasInScope(T.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,_.HTML)}function be(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_.HTML)}function Se(e,t){const n=t.tagName;switch(n.length){case 1:n===T.I||n===T.S||n===T.B||n===T.U?Ee(e,t):n===T.P?Te(e,t):n===T.A?function(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(T.A);n&&(Z(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,_.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t):be(e,t);break;case 2:n===T.DL||n===T.OL||n===T.UL?Te(e,t):n===T.H1||n===T.H2||n===T.H3||n===T.H4||n===T.H5||n===T.H6?function(e,t){e.openElements.hasInButtonScope(T.P)&&e._closePElement();const n=e.openElements.currentTagName;n!==T.H1&&n!==T.H2&&n!==T.H3&&n!==T.H4&&n!==T.H5&&n!==T.H6||e.openElements.pop(),e._insertElement(t,_.HTML)}(e,t):n===T.LI||n===T.DD||n===T.DT?function(e,t){e.framesetOk=!1;const n=t.tagName;for(let t=e.openElements.stackTop;t>=0;t--){const r=e.openElements.items[t],i=e.treeAdapter.getTagName(r);let s=null;if(n===T.LI&&i===T.LI?s=T.LI:n!==T.DD&&n!==T.DT||i!==T.DD&&i!==T.DT||(s=i),s){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(i!==T.ADDRESS&&i!==T.DIV&&i!==T.P&&e._isSpecialElement(r))break}e.openElements.hasInButtonScope(T.P)&&e._closePElement(),e._insertElement(t,_.HTML)}(e,t):n===T.EM||n===T.TT?Ee(e,t):n===T.BR?Ae(e,t):n===T.HR?function(e,t){e.openElements.hasInButtonScope(T.P)&&e._closePElement(),e._appendElement(t,_.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}(e,t):n===T.RB?ve(e,t):n===T.RT||n===T.RP?function(e,t){e.openElements.hasInScope(T.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(T.RTC),e._insertElement(t,_.HTML)}(e,t):n!==T.TH&&n!==T.TD&&n!==T.TR&&be(e,t);break;case 3:n===T.DIV||n===T.DIR||n===T.NAV?Te(e,t):n===T.PRE?_e(e,t):n===T.BIG?Ee(e,t):n===T.IMG||n===T.WBR?Ae(e,t):n===T.XMP?function(e,t){e.openElements.hasInButtonScope(T.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,r.MODE.RAWTEXT)}(e,t):n===T.SVG?function(e,t){e._reconstructActiveFormattingElements(),p.adjustTokenSVGAttrs(t),p.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,_.SVG):e._insertElement(t,_.SVG),t.ackSelfClosing=!0}(e,t):n===T.RTC?ve(e,t):n!==T.COL&&be(e,t);break;case 4:n===T.HTML?function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}(e,t):n===T.BASE||n===T.LINK||n===T.META?le(e,t):n===T.BODY?function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}(e,t):n===T.MAIN||n===T.MENU?Te(e,t):n===T.FORM?function(e,t){const n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(T.P)&&e._closePElement(),e._insertElement(t,_.HTML),n||(e.formElement=e.openElements.current))}(e,t):n===T.CODE||n===T.FONT?Ee(e,t):n===T.NOBR?function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(T.NOBR)&&(Z(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,_.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t):n===T.AREA?Ae(e,t):n===T.MATH?function(e,t){e._reconstructActiveFormattingElements(),p.adjustTokenMathMLAttrs(t),p.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,_.MATHML):e._insertElement(t,_.MATHML),t.ackSelfClosing=!0}(e,t):n===T.MENU?function(e,t){e.openElements.hasInButtonScope(T.P)&&e._closePElement(),e._insertElement(t,_.HTML)}(e,t):n!==T.HEAD&&be(e,t);break;case 5:n===T.STYLE||n===T.TITLE?le(e,t):n===T.ASIDE?Te(e,t):n===T.SMALL?Ee(e,t):n===T.TABLE?function(e,t){e.treeAdapter.getDocumentMode(e.document)!==m.DOCUMENT_MODE.QUIRKS&&e.openElements.hasInButtonScope(T.P)&&e._closePElement(),e._insertElement(t,_.HTML),e.framesetOk=!1,e.insertionMode=k}(e,t):n===T.EMBED?Ae(e,t):n===T.INPUT?function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,_.HTML);const n=r.getTokenAttr(t,E.TYPE);n&&n.toLowerCase()===A||(e.framesetOk=!1),t.ackSelfClosing=!0}(e,t):n===T.PARAM||n===T.TRACK?Ce(e,t):n===T.IMAGE?function(e,t){t.tagName=T.IMG,Ae(e,t)}(e,t):n!==T.FRAME&&n!==T.TBODY&&n!==T.TFOOT&&n!==T.THEAD&&be(e,t);break;case 6:n===T.SCRIPT?le(e,t):n===T.CENTER||n===T.FIGURE||n===T.FOOTER||n===T.HEADER||n===T.HGROUP||n===T.DIALOG?Te(e,t):n===T.BUTTON?function(e,t){e.openElements.hasInScope(T.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(T.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,_.HTML),e.framesetOk=!1}(e,t):n===T.STRIKE||n===T.STRONG?Ee(e,t):n===T.APPLET||n===T.OBJECT?ge(e,t):n===T.KEYGEN?Ae(e,t):n===T.SOURCE?Ce(e,t):n===T.IFRAME?function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,r.MODE.RAWTEXT)}(e,t):n===T.SELECT?function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_.HTML),e.framesetOk=!1,e.insertionMode===k||e.insertionMode===L||e.insertionMode===x||e.insertionMode===P||e.insertionMode===D?e.insertionMode=H:e.insertionMode=w}(e,t):n===T.OPTION?Oe(e,t):be(e,t);break;case 7:n===T.BGSOUND?le(e,t):n===T.DETAILS||n===T.ADDRESS||n===T.ARTICLE||n===T.SECTION||n===T.SUMMARY?Te(e,t):n===T.LISTING?_e(e,t):n===T.MARQUEE?ge(e,t):n===T.NOEMBED?Ne(e,t):n!==T.CAPTION&&be(e,t);break;case 8:n===T.BASEFONT?le(e,t):n===T.FRAMESET?function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,_.HTML),e.insertionMode=B)}(e,t):n===T.FIELDSET?Te(e,t):n===T.TEXTAREA?function(e,t){e._insertElement(t,_.HTML),e.skipNextNewLine=!0,e.tokenizer.state=r.MODE.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=I}(e,t):n===T.TEMPLATE?le(e,t):n===T.NOSCRIPT?e.options.scriptingEnabled?Ne(e,t):be(e,t):n===T.OPTGROUP?Oe(e,t):n!==T.COLGROUP&&be(e,t);break;case 9:n===T.PLAINTEXT?function(e,t){e.openElements.hasInButtonScope(T.P)&&e._closePElement(),e._insertElement(t,_.HTML),e.tokenizer.state=r.MODE.PLAINTEXT}(e,t):be(e,t);break;case 10:n===T.BLOCKQUOTE||n===T.FIGCAPTION?Te(e,t):be(e,t);break;default:be(e,t)}}function ye(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Ie(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function ke(e,t){const n=t.tagName;for(let t=e.openElements.stackTop;t>0;t--){const r=e.openElements.items[t];if(e.treeAdapter.getTagName(r)===n){e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilElementPopped(r);break}if(e._isSpecialElement(r))break}}function Re(e,t){const n=t.tagName;switch(n.length){case 1:n===T.A||n===T.B||n===T.I||n===T.S||n===T.U?Z(e,t):n===T.P?function(e){e.openElements.hasInButtonScope(T.P)||e._insertFakeElement(T.P),e._closePElement()}(e):ke(e,t);break;case 2:n===T.DL||n===T.UL||n===T.OL?ye(e,t):n===T.LI?function(e){e.openElements.hasInListItemScope(T.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(T.LI),e.openElements.popUntilTagNamePopped(T.LI))}(e):n===T.DD||n===T.DT?function(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}(e,t):n===T.H1||n===T.H2||n===T.H3||n===T.H4||n===T.H5||n===T.H6?function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}(e):n===T.BR?function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(T.BR),e.openElements.pop(),e.framesetOk=!1}(e):n===T.EM||n===T.TT?Z(e,t):ke(e,t);break;case 3:n===T.BIG?Z(e,t):n===T.DIR||n===T.DIV||n===T.NAV||n===T.PRE?ye(e,t):ke(e,t);break;case 4:n===T.BODY?function(e){e.openElements.hasInScope(T.BODY)&&(e.insertionMode=U)}(e):n===T.HTML?function(e,t){e.openElements.hasInScope(T.BODY)&&(e.insertionMode=U,e._processToken(t))}(e,t):n===T.FORM?function(e){const t=e.openElements.tmplCount>0,n=e.formElement;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(T.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(T.FORM):e.openElements.remove(n))}(e):n===T.CODE||n===T.FONT||n===T.NOBR?Z(e,t):n===T.MAIN||n===T.MENU?ye(e,t):ke(e,t);break;case 5:n===T.ASIDE?ye(e,t):n===T.SMALL?Z(e,t):ke(e,t);break;case 6:n===T.CENTER||n===T.FIGURE||n===T.FOOTER||n===T.HEADER||n===T.HGROUP||n===T.DIALOG?ye(e,t):n===T.APPLET||n===T.OBJECT?Ie(e,t):n===T.STRIKE||n===T.STRONG?Z(e,t):ke(e,t);break;case 7:n===T.ADDRESS||n===T.ARTICLE||n===T.DETAILS||n===T.SECTION||n===T.SUMMARY||n===T.LISTING?ye(e,t):n===T.MARQUEE?Ie(e,t):ke(e,t);break;case 8:n===T.FIELDSET?ye(e,t):n===T.TEMPLATE?ue(e,t):ke(e,t);break;case 10:n===T.BLOCKQUOTE||n===T.FIGCAPTION?ye(e,t):ke(e,t);break;default:ke(e,t)}}function Le(e,t){e.tmplInsertionModeStackTop>-1?Be(e,t):e.stopped=!0}function Me(e,t){const n=e.openElements.currentTagName;n===T.TABLE||n===T.TBODY||n===T.TFOOT||n===T.THEAD||n===T.TR?(e.pendingCharacterTokens=[],e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=R,e._processToken(t)):De(e,t)}function xe(e,t){const n=t.tagName;switch(n.length){case 2:n===T.TD||n===T.TH||n===T.TR?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(T.TBODY),e.insertionMode=x,e._processToken(t)}(e,t):De(e,t);break;case 3:n===T.COL?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(T.COLGROUP),e.insertionMode=M,e._processToken(t)}(e,t):De(e,t);break;case 4:n===T.FORM?function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,_.HTML),e.formElement=e.openElements.current,e.openElements.pop())}(e,t):De(e,t);break;case 5:n===T.TABLE?function(e,t){e.openElements.hasInTableScope(T.TABLE)&&(e.openElements.popUntilTagNamePopped(T.TABLE),e._resetInsertionMode(),e._processToken(t))}(e,t):n===T.STYLE?le(e,t):n===T.TBODY||n===T.TFOOT||n===T.THEAD?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,_.HTML),e.insertionMode=x}(e,t):n===T.INPUT?function(e,t){const n=r.getTokenAttr(t,E.TYPE);n&&n.toLowerCase()===A?e._appendElement(t,_.HTML):De(e,t),t.ackSelfClosing=!0}(e,t):De(e,t);break;case 6:n===T.SCRIPT?le(e,t):De(e,t);break;case 7:n===T.CAPTION?function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,_.HTML),e.insertionMode=L}(e,t):De(e,t);break;case 8:n===T.COLGROUP?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,_.HTML),e.insertionMode=M}(e,t):n===T.TEMPLATE?le(e,t):De(e,t);break;default:De(e,t)}}function Pe(e,t){const n=t.tagName;n===T.TABLE?e.openElements.hasInTableScope(T.TABLE)&&(e.openElements.popUntilTagNamePopped(T.TABLE),e._resetInsertionMode()):n===T.TEMPLATE?ue(e,t):n!==T.BODY&&n!==T.CAPTION&&n!==T.COL&&n!==T.COLGROUP&&n!==T.HTML&&n!==T.TBODY&&n!==T.TD&&n!==T.TFOOT&&n!==T.TH&&n!==T.THEAD&&n!==T.TR&&De(e,t)}function De(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,e._processTokenInBodyMode(t),e.fosterParentingEnabled=n}function we(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)De(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}function He(e,t){e.openElements.currentTagName===T.COLGROUP&&(e.openElements.pop(),e.insertionMode=k,e._processToken(t))}function Fe(e,t){const n=t.tagName;n===T.HTML?Se(e,t):n===T.OPTION?(e.openElements.currentTagName===T.OPTION&&e.openElements.pop(),e._insertElement(t,_.HTML)):n===T.OPTGROUP?(e.openElements.currentTagName===T.OPTION&&e.openElements.pop(),e.openElements.currentTagName===T.OPTGROUP&&e.openElements.pop(),e._insertElement(t,_.HTML)):n===T.INPUT||n===T.KEYGEN||n===T.TEXTAREA||n===T.SELECT?e.openElements.hasInSelectScope(T.SELECT)&&(e.openElements.popUntilTagNamePopped(T.SELECT),e._resetInsertionMode(),n!==T.SELECT&&e._processToken(t)):n!==T.SCRIPT&&n!==T.TEMPLATE||le(e,t)}function Ue(e,t){const n=t.tagName;if(n===T.OPTGROUP){const t=e.openElements.items[e.openElements.stackTop-1],n=t&&e.treeAdapter.getTagName(t);e.openElements.currentTagName===T.OPTION&&n===T.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagName===T.OPTGROUP&&e.openElements.pop()}else n===T.OPTION?e.openElements.currentTagName===T.OPTION&&e.openElements.pop():n===T.SELECT&&e.openElements.hasInSelectScope(T.SELECT)?(e.openElements.popUntilTagNamePopped(T.SELECT),e._resetInsertionMode()):n===T.TEMPLATE&&ue(e,t)}function Be(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(T.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode(),e._processToken(t)):e.stopped=!0}function Ge(e,t){e.insertionMode=y,e._processToken(t)}function je(e,t){e.insertionMode=y,e._processToken(t)}e.exports=class{constructor(e){this.options=u(g,e),this.treeAdapter=this.options.treeAdapter,this.pendingScript=null,this.options.sourceCodeLocationInfo&&c.install(this,o),this.options.onParseError&&c.install(this,a,{onParseError:this.options.onParseError})}parse(e){const t=this.treeAdapter.createDocument();return this._bootstrap(t,null),this.tokenizer.write(e,!0),this._runParsingLoop(null),t}parseFragment(e,t){t||(t=this.treeAdapter.createElement(T.TEMPLATE,_.HTML,[]));const n=this.treeAdapter.createElement("documentmock",_.HTML,[]);this._bootstrap(n,t),this.treeAdapter.getTagName(t)===T.TEMPLATE&&this._pushTmplInsertionMode(F),this._initTokenizerForFragmentParsing(),this._insertFakeRootElement(),this._resetInsertionMode(),this._findFormInFragmentContext(),this.tokenizer.write(e,!0),this._runParsingLoop(null);const r=this.treeAdapter.getFirstChild(n),i=this.treeAdapter.createDocumentFragment();return this._adoptNodes(r,i),i}_bootstrap(e,t){this.tokenizer=new r(this.options),this.stopped=!1,this.insertionMode=C,this.originalInsertionMode="",this.document=e,this.fragmentContext=t,this.headElement=null,this.formElement=null,this.openElements=new i(this.document,this.treeAdapter),this.activeFormattingElements=new s(this.treeAdapter),this.tmplInsertionModeStack=[],this.tmplInsertionModeStackTop=-1,this.currentTmplInsertionMode=null,this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1}_err(){}_runParsingLoop(e){for(;!this.stopped;){this._setupTokenizerCDATAMode();const t=this.tokenizer.getNextToken();if(t.type===r.HIBERNATION_TOKEN)break;if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.type===r.WHITESPACE_CHARACTER_TOKEN&&"\n"===t.chars[0])){if(1===t.chars.length)continue;t.chars=t.chars.substr(1)}if(this._processInputToken(t),e&&this.pendingScript)break}}runParsingLoopForCurrentChunk(e,t){if(this._runParsingLoop(t),t&&this.pendingScript){const e=this.pendingScript;return this.pendingScript=null,void t(e)}e&&e()}_setupTokenizerCDATAMode(){const e=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=e&&e!==this.document&&this.treeAdapter.getNamespaceURI(e)!==_.HTML&&!this._isIntegrationPoint(e)}_switchToTextParsing(e,t){this._insertElement(e,_.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=I}switchToPlaintextParsing(){this.insertionMode=I,this.originalInsertionMode=y,this.tokenizer.state=r.MODE.PLAINTEXT}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;do{if(this.treeAdapter.getTagName(e)===T.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}while(e)}_initTokenizerForFragmentParsing(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===_.HTML){const e=this.treeAdapter.getTagName(this.fragmentContext);e===T.TITLE||e===T.TEXTAREA?this.tokenizer.state=r.MODE.RCDATA:e===T.STYLE||e===T.XMP||e===T.IFRAME||e===T.NOEMBED||e===T.NOFRAMES||e===T.NOSCRIPT?this.tokenizer.state=r.MODE.RAWTEXT:e===T.SCRIPT?this.tokenizer.state=r.MODE.SCRIPT_DATA:e===T.PLAINTEXT&&(this.tokenizer.state=r.MODE.PLAINTEXT)}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",r=e.systemId||"";this.treeAdapter.setDocumentType(this.document,t,n,r)}_attachElementToTree(e){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(t,e)}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n)}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n),this.openElements.push(n)}_insertFakeElement(e){const t=this.treeAdapter.createElement(e,_.HTML,[]);this._attachElementToTree(t),this.openElements.push(t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,_.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t),this.openElements.push(t)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(T.HTML,_.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e)}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n)}_insertCharacters(e){if(this._shouldFosterParentOnInsertion())this._fosterParentText(e.chars);else{const t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(t,e.chars)}}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_shouldProcessTokenInForeignContent(e){const t=this._getAdjustedCurrentElement();if(!t||t===this.document)return!1;const n=this.treeAdapter.getNamespaceURI(t);if(n===_.HTML)return!1;if(this.treeAdapter.getTagName(t)===T.ANNOTATION_XML&&n===_.MATHML&&e.type===r.START_TAG_TOKEN&&e.tagName===T.SVG)return!1;const i=e.type===r.CHARACTER_TOKEN||e.type===r.NULL_CHARACTER_TOKEN||e.type===r.WHITESPACE_CHARACTER_TOKEN;return!((e.type===r.START_TAG_TOKEN&&e.tagName!==T.MGLYPH&&e.tagName!==T.MALIGNMARK||i)&&this._isIntegrationPoint(t,_.MATHML)||(e.type===r.START_TAG_TOKEN||i)&&this._isIntegrationPoint(t,_.HTML)||e.type===r.EOF_TOKEN)}_processToken(e){Y[this.insertionMode][e.type](this,e)}_processTokenInBodyMode(e){Y.IN_BODY_MODE[e.type](this,e)}_processTokenInForeignContent(e){e.type===r.CHARACTER_TOKEN?function(e,t){e._insertCharacters(t),e.framesetOk=!1}(this,e):e.type===r.NULL_CHARACTER_TOKEN?function(e,t){t.chars=f.REPLACEMENT_CHARACTER,e._insertCharacters(t)}(this,e):e.type===r.WHITESPACE_CHARACTER_TOKEN?ie(this,e):e.type===r.COMMENT_TOKEN?ne(this,e):e.type===r.START_TAG_TOKEN?function(e,t){if(p.causesExit(t)&&!e.fragmentContext){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==_.HTML&&!e._isIntegrationPoint(e.openElements.current);)e.openElements.pop();e._processToken(t)}else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===_.MATHML?p.adjustTokenMathMLAttrs(t):r===_.SVG&&(p.adjustTokenSVGTagName(t),p.adjustTokenSVGAttrs(t)),p.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}(this,e):e.type===r.END_TAG_TOKEN&&function(e,t){for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===_.HTML){e._processToken(t);break}if(e.treeAdapter.getTagName(r).toLowerCase()===t.tagName){e.openElements.popUntilElementPopped(r);break}}}(this,e)}_processInputToken(e){this._shouldProcessTokenInForeignContent(e)?this._processTokenInForeignContent(e):this._processToken(e),e.type===r.START_TAG_TOKEN&&e.selfClosing&&!e.ackSelfClosing&&this._err(d.nonVoidHtmlElementStartTagWithTrailingSolidus)}_isIntegrationPoint(e,t){const n=this.treeAdapter.getTagName(e),r=this.treeAdapter.getNamespaceURI(e),i=this.treeAdapter.getAttrList(e);return p.isIntegrationPoint(n,r,i,t)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.length;if(e){let t=e,n=null;do{if(t--,n=this.activeFormattingElements.entries[t],n.type===s.MARKER_ENTRY||this.openElements.contains(n.element)){t++;break}}while(t>0);for(let r=t;r<e;r++)n=this.activeFormattingElements.entries[r],this._insertElement(n.token,this.treeAdapter.getNamespaceURI(n.element)),n.element=this.openElements.current}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=P}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(T.P),this.openElements.popUntilTagNamePopped(T.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop,t=!1;e>=0;e--){let n=this.openElements.items[e];0===e&&(t=!0,this.fragmentContext&&(n=this.fragmentContext));const r=this.treeAdapter.getTagName(n),i=K[r];if(i){this.insertionMode=i;break}if(!(t||r!==T.TD&&r!==T.TH)){this.insertionMode=D;break}if(!t&&r===T.HEAD){this.insertionMode=v;break}if(r===T.SELECT){this._resetInsertionModeForSelect(e);break}if(r===T.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}if(r===T.HTML){this.insertionMode=this.headElement?S:O;break}if(t){this.insertionMode=y;break}}}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.items[t],n=this.treeAdapter.getTagName(e);if(n===T.TEMPLATE)break;if(n===T.TABLE)return void(this.insertionMode=H)}this.insertionMode=w}_pushTmplInsertionMode(e){this.tmplInsertionModeStack.push(e),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=e}_popTmplInsertionMode(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]}_isElementCausesFosterParenting(e){const t=this.treeAdapter.getTagName(e);return t===T.TABLE||t===T.TBODY||t===T.TFOOT||t===T.THEAD||t===T.TR}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)}_findFosterParentingLocation(){const e={parent:null,beforeElement:null};for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t],r=this.treeAdapter.getTagName(n),i=this.treeAdapter.getNamespaceURI(n);if(r===T.TEMPLATE&&i===_.HTML){e.parent=this.treeAdapter.getTemplateContent(n);break}if(r===T.TABLE){e.parent=this.treeAdapter.getParentNode(n),e.parent?e.beforeElement=n:e.parent=this.openElements.items[t-1];break}}return e.parent||(e.parent=this.openElements.items[0]),e}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_fosterParentText(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertTextBefore(t.parent,e,t.beforeElement):this.treeAdapter.insertText(t.parent,e)}_isSpecialElement(e){const t=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);return m.SPECIAL_ELEMENTS[n][t]}}},6519:(e,t,n)=>{"use strict";const r=n(6152),i=r.TAG_NAMES,s=r.NAMESPACES;function o(e){switch(e.length){case 1:return e===i.P;case 2:return e===i.RB||e===i.RP||e===i.RT||e===i.DD||e===i.DT||e===i.LI;case 3:return e===i.RTC;case 6:return e===i.OPTION;case 8:return e===i.OPTGROUP}return!1}function a(e){switch(e.length){case 1:return e===i.P;case 2:return e===i.RB||e===i.RP||e===i.RT||e===i.DD||e===i.DT||e===i.LI||e===i.TD||e===i.TH||e===i.TR;case 3:return e===i.RTC;case 5:return e===i.TBODY||e===i.TFOOT||e===i.THEAD;case 6:return e===i.OPTION;case 7:return e===i.CAPTION;case 8:return e===i.OPTGROUP||e===i.COLGROUP}return!1}function c(e,t){switch(e.length){case 2:if(e===i.TD||e===i.TH)return t===s.HTML;if(e===i.MI||e===i.MO||e===i.MN||e===i.MS)return t===s.MATHML;break;case 4:if(e===i.HTML)return t===s.HTML;if(e===i.DESC)return t===s.SVG;break;case 5:if(e===i.TABLE)return t===s.HTML;if(e===i.MTEXT)return t===s.MATHML;if(e===i.TITLE)return t===s.SVG;break;case 6:return(e===i.APPLET||e===i.OBJECT)&&t===s.HTML;case 7:return(e===i.CAPTION||e===i.MARQUEE)&&t===s.HTML;case 8:return e===i.TEMPLATE&&t===s.HTML;case 13:return e===i.FOREIGN_OBJECT&&t===s.SVG;case 14:return e===i.ANNOTATION_XML&&t===s.MATHML}return!1}e.exports=class{constructor(e,t){this.stackTop=-1,this.items=[],this.current=e,this.currentTagName=null,this.currentTmplContent=null,this.tmplCount=0,this.treeAdapter=t}_indexOf(e){let t=-1;for(let n=this.stackTop;n>=0;n--)if(this.items[n]===e){t=n;break}return t}_isInTemplate(){return this.currentTagName===i.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===s.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagName=this.current&&this.treeAdapter.getTagName(this.current),this.currentTmplContent=this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):null}push(e){this.items[++this.stackTop]=e,this._updateCurrentElement(),this._isInTemplate()&&this.tmplCount++}pop(){this.stackTop--,this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this._updateCurrentElement()}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&this._updateCurrentElement()}insertAfter(e,t){const n=this._indexOf(e)+1;this.items.splice(n,0,t),n===++this.stackTop&&this._updateCurrentElement()}popUntilTagNamePopped(e){for(;this.stackTop>-1;){const t=this.currentTagName,n=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),t===e&&n===s.HTML)break}}popUntilElementPopped(e){for(;this.stackTop>-1;){const t=this.current;if(this.pop(),t===e)break}}popUntilNumberedHeaderPopped(){for(;this.stackTop>-1;){const e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===i.H1||e===i.H2||e===i.H3||e===i.H4||e===i.H5||e===i.H6&&t===s.HTML)break}}popUntilTableCellPopped(){for(;this.stackTop>-1;){const e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===i.TD||e===i.TH&&t===s.HTML)break}}popAllUpToHtmlElement(){this.stackTop=0,this._updateCurrentElement()}clearBackToTableContext(){for(;this.currentTagName!==i.TABLE&&this.currentTagName!==i.TEMPLATE&&this.currentTagName!==i.HTML||this.treeAdapter.getNamespaceURI(this.current)!==s.HTML;)this.pop()}clearBackToTableBodyContext(){for(;this.currentTagName!==i.TBODY&&this.currentTagName!==i.TFOOT&&this.currentTagName!==i.THEAD&&this.currentTagName!==i.TEMPLATE&&this.currentTagName!==i.HTML||this.treeAdapter.getNamespaceURI(this.current)!==s.HTML;)this.pop()}clearBackToTableRowContext(){for(;this.currentTagName!==i.TR&&this.currentTagName!==i.TEMPLATE&&this.currentTagName!==i.HTML||this.treeAdapter.getNamespaceURI(this.current)!==s.HTML;)this.pop()}remove(e){for(let t=this.stackTop;t>=0;t--)if(this.items[t]===e){this.items.splice(t,1),this.stackTop--,this._updateCurrentElement();break}}tryPeekProperlyNestedBodyElement(){const e=this.items[1];return e&&this.treeAdapter.getTagName(e)===i.BODY?e:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e);return--t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.currentTagName===i.HTML}hasInScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),r=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&r===s.HTML)return!0;if(c(n,r))return!1}return!0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.treeAdapter.getTagName(this.items[e]),n=this.treeAdapter.getNamespaceURI(this.items[e]);if((t===i.H1||t===i.H2||t===i.H3||t===i.H4||t===i.H5||t===i.H6)&&n===s.HTML)return!0;if(c(t,n))return!1}return!0}hasInListItemScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),r=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&r===s.HTML)return!0;if((n===i.UL||n===i.OL)&&r===s.HTML||c(n,r))return!1}return!0}hasInButtonScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),r=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&r===s.HTML)return!0;if(n===i.BUTTON&&r===s.HTML||c(n,r))return!1}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===s.HTML){if(n===e)return!0;if(n===i.TABLE||n===i.TEMPLATE||n===i.HTML)return!1}}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){const t=this.treeAdapter.getTagName(this.items[e]);if(this.treeAdapter.getNamespaceURI(this.items[e])===s.HTML){if(t===i.TBODY||t===i.THEAD||t===i.TFOOT)return!0;if(t===i.TABLE||t===i.HTML)return!1}}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===s.HTML){if(n===e)return!0;if(n!==i.OPTION&&n!==i.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;o(this.currentTagName);)this.pop()}generateImpliedEndTagsThoroughly(){for(;a(this.currentTagName);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;o(this.currentTagName)&&this.currentTagName!==e;)this.pop()}}},3988:(e,t,n)=>{"use strict";const r=n(7296),i=n(8904),s=n(1515),o=n(6152),a=o.TAG_NAMES,c=o.NAMESPACES,l={treeAdapter:r},u=/&/g,h=/\u00a0/g,p=/"/g,d=/</g,f=/>/g;class m{constructor(e,t){this.options=i(l,t),this.treeAdapter=this.options.treeAdapter,this.html="",this.startNode=e}serialize(){return this._serializeChildNodes(this.startNode),this.html}_serializeChildNodes(e){const t=this.treeAdapter.getChildNodes(e);if(t)for(let e=0,n=t.length;e<n;e++){const n=t[e];this.treeAdapter.isElementNode(n)?this._serializeElement(n):this.treeAdapter.isTextNode(n)?this._serializeTextNode(n):this.treeAdapter.isCommentNode(n)?this._serializeCommentNode(n):this.treeAdapter.isDocumentTypeNode(n)&&this._serializeDocumentTypeNode(n)}}_serializeElement(e){const t=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);if(this.html+="<"+t,this._serializeAttributes(e),this.html+=">",t!==a.AREA&&t!==a.BASE&&t!==a.BASEFONT&&t!==a.BGSOUND&&t!==a.BR&&t!==a.COL&&t!==a.EMBED&&t!==a.FRAME&&t!==a.HR&&t!==a.IMG&&t!==a.INPUT&&t!==a.KEYGEN&&t!==a.LINK&&t!==a.META&&t!==a.PARAM&&t!==a.SOURCE&&t!==a.TRACK&&t!==a.WBR){const r=t===a.TEMPLATE&&n===c.HTML?this.treeAdapter.getTemplateContent(e):e;this._serializeChildNodes(r),this.html+="</"+t+">"}}_serializeAttributes(e){const t=this.treeAdapter.getAttrList(e);for(let e=0,n=t.length;e<n;e++){const n=t[e],r=m.escapeString(n.value,!0);this.html+=" ",n.namespace?n.namespace===c.XML?this.html+="xml:"+n.name:n.namespace===c.XMLNS?("xmlns"!==n.name&&(this.html+="xmlns:"),this.html+=n.name):n.namespace===c.XLINK?this.html+="xlink:"+n.name:this.html+=n.prefix+":"+n.name:this.html+=n.name,this.html+='="'+r+'"'}}_serializeTextNode(e){const t=this.treeAdapter.getTextNodeContent(e),n=this.treeAdapter.getParentNode(e);let r;n&&this.treeAdapter.isElementNode(n)&&(r=this.treeAdapter.getTagName(n)),r===a.STYLE||r===a.SCRIPT||r===a.XMP||r===a.IFRAME||r===a.NOEMBED||r===a.NOFRAMES||r===a.PLAINTEXT||r===a.NOSCRIPT?this.html+=t:this.html+=m.escapeString(t,!1)}_serializeCommentNode(e){this.html+="\x3c!--"+this.treeAdapter.getCommentNodeContent(e)+"--\x3e"}_serializeDocumentTypeNode(e){const t=this.treeAdapter.getDocumentTypeNodeName(e);this.html+="<"+s.serializeContent(t,null,null)+">"}}m.escapeString=function(e,t){return e=e.replace(u,"&amp;").replace(h,"&nbsp;"),t?e.replace(p,"&quot;"):e.replace(d,"&lt;").replace(f,"&gt;")},e.exports=m},5763:(e,t,n)=>{"use strict";const r=n(7118),i=n(4284),s=n(5482),o=n(1734),a=i.CODE_POINTS,c=i.CODE_POINT_SEQUENCES,l={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},u="DATA_STATE",h="RCDATA_STATE",p="RAWTEXT_STATE",d="SCRIPT_DATA_STATE",f="PLAINTEXT_STATE",m="TAG_OPEN_STATE",T="END_TAG_OPEN_STATE",_="TAG_NAME_STATE",E="RCDATA_LESS_THAN_SIGN_STATE",g="RCDATA_END_TAG_OPEN_STATE",A="RCDATA_END_TAG_NAME_STATE",C="RAWTEXT_LESS_THAN_SIGN_STATE",N="RAWTEXT_END_TAG_OPEN_STATE",O="RAWTEXT_END_TAG_NAME_STATE",v="SCRIPT_DATA_LESS_THAN_SIGN_STATE",b="SCRIPT_DATA_END_TAG_OPEN_STATE",S="SCRIPT_DATA_END_TAG_NAME_STATE",y="SCRIPT_DATA_ESCAPE_START_STATE",I="SCRIPT_DATA_ESCAPE_START_DASH_STATE",k="SCRIPT_DATA_ESCAPED_STATE",R="SCRIPT_DATA_ESCAPED_DASH_STATE",L="SCRIPT_DATA_ESCAPED_DASH_DASH_STATE",M="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",x="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",P="SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",D="SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",w="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",H="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",F="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",U="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",B="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",G="BEFORE_ATTRIBUTE_NAME_STATE",j="ATTRIBUTE_NAME_STATE",q="AFTER_ATTRIBUTE_NAME_STATE",K="BEFORE_ATTRIBUTE_VALUE_STATE",V="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",Y="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",W="ATTRIBUTE_VALUE_UNQUOTED_STATE",Q="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",z="SELF_CLOSING_START_TAG_STATE",$="BOGUS_COMMENT_STATE",X="MARKUP_DECLARATION_OPEN_STATE",J="COMMENT_START_STATE",Z="COMMENT_START_DASH_STATE",ee="COMMENT_STATE",te="COMMENT_LESS_THAN_SIGN_STATE",ne="COMMENT_LESS_THAN_SIGN_BANG_STATE",re="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE",ie="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE",se="COMMENT_END_DASH_STATE",oe="COMMENT_END_STATE",ae="COMMENT_END_BANG_STATE",ce="DOCTYPE_STATE",le="BEFORE_DOCTYPE_NAME_STATE",ue="DOCTYPE_NAME_STATE",he="AFTER_DOCTYPE_NAME_STATE",pe="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE",de="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",fe="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",me="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",Te="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE",_e="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",Ee="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE",ge="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",Ae="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",Ce="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",Ne="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",Oe="BOGUS_DOCTYPE_STATE",ve="CDATA_SECTION_STATE",be="CDATA_SECTION_BRACKET_STATE",Se="CDATA_SECTION_END_STATE",ye="CHARACTER_REFERENCE_STATE",Ie="NAMED_CHARACTER_REFERENCE_STATE",ke="AMBIGUOS_AMPERSAND_STATE",Re="NUMERIC_CHARACTER_REFERENCE_STATE",Le="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE",Me="DECIMAL_CHARACTER_REFERENCE_START_STATE",xe="HEXADEMICAL_CHARACTER_REFERENCE_STATE",Pe="DECIMAL_CHARACTER_REFERENCE_STATE",De="NUMERIC_CHARACTER_REFERENCE_END_STATE";function we(e){return e===a.SPACE||e===a.LINE_FEED||e===a.TABULATION||e===a.FORM_FEED}function He(e){return e>=a.DIGIT_0&&e<=a.DIGIT_9}function Fe(e){return e>=a.LATIN_CAPITAL_A&&e<=a.LATIN_CAPITAL_Z}function Ue(e){return e>=a.LATIN_SMALL_A&&e<=a.LATIN_SMALL_Z}function Be(e){return Ue(e)||Fe(e)}function Ge(e){return Be(e)||He(e)}function je(e){return e>=a.LATIN_CAPITAL_A&&e<=a.LATIN_CAPITAL_F}function qe(e){return e>=a.LATIN_SMALL_A&&e<=a.LATIN_SMALL_F}function Ke(e){return e+32}function Ve(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function Ye(e){return String.fromCharCode(Ke(e))}function We(e,t){const n=s[++e];let r=++e,i=r+n-1;for(;r<=i;){const e=r+i>>>1,o=s[e];if(o<t)r=e+1;else{if(!(o>t))return s[e+n];i=e-1}}return-1}class Qe{constructor(){this.preprocessor=new r,this.tokenQueue=[],this.allowCDATA=!1,this.state=u,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null}_err(){}_errOnNextCodePoint(e){this._consume(),this._err(e),this._unconsume()}getNextToken(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this[this.state](e)}return this.tokenQueue.shift()}write(e,t){this.active=!0,this.preprocessor.write(e,t)}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e)}_ensureHibernation(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:Qe.HIBERNATION_TOKEN}),!0}return!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(){this.consumedAfterSnapshot--,this.preprocessor.retreat()}_reconsumeInState(e){this.state=e,this._unconsume()}_consumeSequenceIfMatch(e,t,n){let r=0,i=!0;const s=e.length;let o,c=0,l=t;for(;c<s;c++){if(c>0&&(l=this._consume(),r++),l===a.EOF){i=!1;break}if(o=e[c],l!==o&&(n||l!==Ke(o))){i=!1;break}}if(!i)for(;r--;)this._unconsume();return i}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==c.SCRIPT_STRING.length)return!1;for(let e=0;e<this.tempBuff.length;e++)if(this.tempBuff[e]!==c.SCRIPT_STRING[e])return!1;return!0}_createStartTagToken(){this.currentToken={type:Qe.START_TAG_TOKEN,tagName:"",selfClosing:!1,ackSelfClosing:!1,attrs:[]}}_createEndTagToken(){this.currentToken={type:Qe.END_TAG_TOKEN,tagName:"",selfClosing:!1,attrs:[]}}_createCommentToken(){this.currentToken={type:Qe.COMMENT_TOKEN,data:""}}_createDoctypeToken(e){this.currentToken={type:Qe.DOCTYPE_TOKEN,name:e,forceQuirks:!1,publicId:null,systemId:null}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t}}_createEOFToken(){this.currentToken={type:Qe.EOF_TOKEN}}_createAttr(e){this.currentAttr={name:e,value:""}}_leaveAttrName(e){null===Qe.getTokenAttr(this.currentToken,this.currentAttr.name)?this.currentToken.attrs.push(this.currentAttr):this._err(o.duplicateAttribute),this.state=e}_leaveAttrValue(e){this.state=e}_emitCurrentToken(){this._emitCurrentCharacterToken();const e=this.currentToken;this.currentToken=null,e.type===Qe.START_TAG_TOKEN?this.lastStartTagName=e.tagName:e.type===Qe.END_TAG_TOKEN&&(e.attrs.length>0&&this._err(o.endTagWithAttributes),e.selfClosing&&this._err(o.endTagWithTrailingSolidus)),this.tokenQueue.push(e)}_emitCurrentCharacterToken(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null)}_emitEOFToken(){this._createEOFToken(),this._emitCurrentToken()}_appendCharToCurrentCharacterToken(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Qe.CHARACTER_TOKEN;we(e)?t=Qe.WHITESPACE_CHARACTER_TOKEN:e===a.NULL&&(t=Qe.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(t,Ve(e))}_emitSeveralCodePoints(e){for(let t=0;t<e.length;t++)this._emitCodePoint(e[t])}_emitChars(e){this._appendCharToCurrentCharacterToken(Qe.CHARACTER_TOKEN,e)}_matchNamedCharacterReference(e){let t=null,n=1,r=We(0,e);for(this.tempBuff.push(e);r>-1;){const e=s[r],i=e<7;i&&1&e&&(t=2&e?[s[++r],s[++r]]:[s[++r]],n=0);const o=this._consume();if(this.tempBuff.push(o),n++,o===a.EOF)break;r=i?4&e?We(r,o):-1:o===e?++r:-1}for(;n--;)this.tempBuff.pop(),this._unconsume();return t}_isCharacterReferenceInAttribute(){return this.returnState===V||this.returnState===Y||this.returnState===W}_isCharacterReferenceAttributeQuirk(e){if(!e&&this._isCharacterReferenceInAttribute()){const e=this._consume();return this._unconsume(),e===a.EQUALS_SIGN||Ge(e)}return!1}_flushCodePointsConsumedAsCharacterReference(){if(this._isCharacterReferenceInAttribute())for(let e=0;e<this.tempBuff.length;e++)this.currentAttr.value+=Ve(this.tempBuff[e]);else this._emitSeveralCodePoints(this.tempBuff);this.tempBuff=[]}[u](e){this.preprocessor.dropParsedChunk(),e===a.LESS_THAN_SIGN?this.state=m:e===a.AMPERSAND?(this.returnState=u,this.state=ye):e===a.NULL?(this._err(o.unexpectedNullCharacter),this._emitCodePoint(e)):e===a.EOF?this._emitEOFToken():this._emitCodePoint(e)}[h](e){this.preprocessor.dropParsedChunk(),e===a.AMPERSAND?(this.returnState=h,this.state=ye):e===a.LESS_THAN_SIGN?this.state=E:e===a.NULL?(this._err(o.unexpectedNullCharacter),this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?this._emitEOFToken():this._emitCodePoint(e)}[p](e){this.preprocessor.dropParsedChunk(),e===a.LESS_THAN_SIGN?this.state=C:e===a.NULL?(this._err(o.unexpectedNullCharacter),this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?this._emitEOFToken():this._emitCodePoint(e)}[d](e){this.preprocessor.dropParsedChunk(),e===a.LESS_THAN_SIGN?this.state=v:e===a.NULL?(this._err(o.unexpectedNullCharacter),this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?this._emitEOFToken():this._emitCodePoint(e)}[f](e){this.preprocessor.dropParsedChunk(),e===a.NULL?(this._err(o.unexpectedNullCharacter),this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?this._emitEOFToken():this._emitCodePoint(e)}[m](e){e===a.EXCLAMATION_MARK?this.state=X:e===a.SOLIDUS?this.state=T:Be(e)?(this._createStartTagToken(),this._reconsumeInState(_)):e===a.QUESTION_MARK?(this._err(o.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(),this._reconsumeInState($)):e===a.EOF?(this._err(o.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken()):(this._err(o.invalidFirstCharacterOfTagName),this._emitChars("<"),this._reconsumeInState(u))}[T](e){Be(e)?(this._createEndTagToken(),this._reconsumeInState(_)):e===a.GREATER_THAN_SIGN?(this._err(o.missingEndTagName),this.state=u):e===a.EOF?(this._err(o.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken()):(this._err(o.invalidFirstCharacterOfTagName),this._createCommentToken(),this._reconsumeInState($))}[_](e){we(e)?this.state=G:e===a.SOLIDUS?this.state=z:e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):Fe(e)?this.currentToken.tagName+=Ye(e):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentToken.tagName+=i.REPLACEMENT_CHARACTER):e===a.EOF?(this._err(o.eofInTag),this._emitEOFToken()):this.currentToken.tagName+=Ve(e)}[E](e){e===a.SOLIDUS?(this.tempBuff=[],this.state=g):(this._emitChars("<"),this._reconsumeInState(h))}[g](e){Be(e)?(this._createEndTagToken(),this._reconsumeInState(A)):(this._emitChars("</"),this._reconsumeInState(h))}[A](e){if(Fe(e))this.currentToken.tagName+=Ye(e),this.tempBuff.push(e);else if(Ue(e))this.currentToken.tagName+=Ve(e),this.tempBuff.push(e);else{if(this.lastStartTagName===this.currentToken.tagName){if(we(e))return void(this.state=G);if(e===a.SOLIDUS)return void(this.state=z);if(e===a.GREATER_THAN_SIGN)return this.state=u,void this._emitCurrentToken()}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(h)}}[C](e){e===a.SOLIDUS?(this.tempBuff=[],this.state=N):(this._emitChars("<"),this._reconsumeInState(p))}[N](e){Be(e)?(this._createEndTagToken(),this._reconsumeInState(O)):(this._emitChars("</"),this._reconsumeInState(p))}[O](e){if(Fe(e))this.currentToken.tagName+=Ye(e),this.tempBuff.push(e);else if(Ue(e))this.currentToken.tagName+=Ve(e),this.tempBuff.push(e);else{if(this.lastStartTagName===this.currentToken.tagName){if(we(e))return void(this.state=G);if(e===a.SOLIDUS)return void(this.state=z);if(e===a.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=u)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(p)}}[v](e){e===a.SOLIDUS?(this.tempBuff=[],this.state=b):e===a.EXCLAMATION_MARK?(this.state=y,this._emitChars("<!")):(this._emitChars("<"),this._reconsumeInState(d))}[b](e){Be(e)?(this._createEndTagToken(),this._reconsumeInState(S)):(this._emitChars("</"),this._reconsumeInState(d))}[S](e){if(Fe(e))this.currentToken.tagName+=Ye(e),this.tempBuff.push(e);else if(Ue(e))this.currentToken.tagName+=Ve(e),this.tempBuff.push(e);else{if(this.lastStartTagName===this.currentToken.tagName){if(we(e))return void(this.state=G);if(e===a.SOLIDUS)return void(this.state=z);if(e===a.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=u)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(d)}}[y](e){e===a.HYPHEN_MINUS?(this.state=I,this._emitChars("-")):this._reconsumeInState(d)}[I](e){e===a.HYPHEN_MINUS?(this.state=L,this._emitChars("-")):this._reconsumeInState(d)}[k](e){e===a.HYPHEN_MINUS?(this.state=R,this._emitChars("-")):e===a.LESS_THAN_SIGN?this.state=M:e===a.NULL?(this._err(o.unexpectedNullCharacter),this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?(this._err(o.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):this._emitCodePoint(e)}[R](e){e===a.HYPHEN_MINUS?(this.state=L,this._emitChars("-")):e===a.LESS_THAN_SIGN?this.state=M:e===a.NULL?(this._err(o.unexpectedNullCharacter),this.state=k,this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?(this._err(o.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=k,this._emitCodePoint(e))}[L](e){e===a.HYPHEN_MINUS?this._emitChars("-"):e===a.LESS_THAN_SIGN?this.state=M:e===a.GREATER_THAN_SIGN?(this.state=d,this._emitChars(">")):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.state=k,this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?(this._err(o.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=k,this._emitCodePoint(e))}[M](e){e===a.SOLIDUS?(this.tempBuff=[],this.state=x):Be(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState(D)):(this._emitChars("<"),this._reconsumeInState(k))}[x](e){Be(e)?(this._createEndTagToken(),this._reconsumeInState(P)):(this._emitChars("</"),this._reconsumeInState(k))}[P](e){if(Fe(e))this.currentToken.tagName+=Ye(e),this.tempBuff.push(e);else if(Ue(e))this.currentToken.tagName+=Ve(e),this.tempBuff.push(e);else{if(this.lastStartTagName===this.currentToken.tagName){if(we(e))return void(this.state=G);if(e===a.SOLIDUS)return void(this.state=z);if(e===a.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=u)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(k)}}[D](e){we(e)||e===a.SOLIDUS||e===a.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?w:k,this._emitCodePoint(e)):Fe(e)?(this.tempBuff.push(Ke(e)),this._emitCodePoint(e)):Ue(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(k)}[w](e){e===a.HYPHEN_MINUS?(this.state=H,this._emitChars("-")):e===a.LESS_THAN_SIGN?(this.state=U,this._emitChars("<")):e===a.NULL?(this._err(o.unexpectedNullCharacter),this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?(this._err(o.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):this._emitCodePoint(e)}[H](e){e===a.HYPHEN_MINUS?(this.state=F,this._emitChars("-")):e===a.LESS_THAN_SIGN?(this.state=U,this._emitChars("<")):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.state=w,this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?(this._err(o.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=w,this._emitCodePoint(e))}[F](e){e===a.HYPHEN_MINUS?this._emitChars("-"):e===a.LESS_THAN_SIGN?(this.state=U,this._emitChars("<")):e===a.GREATER_THAN_SIGN?(this.state=d,this._emitChars(">")):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.state=w,this._emitChars(i.REPLACEMENT_CHARACTER)):e===a.EOF?(this._err(o.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state=w,this._emitCodePoint(e))}[U](e){e===a.SOLIDUS?(this.tempBuff=[],this.state=B,this._emitChars("/")):this._reconsumeInState(w)}[B](e){we(e)||e===a.SOLIDUS||e===a.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?k:w,this._emitCodePoint(e)):Fe(e)?(this.tempBuff.push(Ke(e)),this._emitCodePoint(e)):Ue(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(w)}[G](e){we(e)||(e===a.SOLIDUS||e===a.GREATER_THAN_SIGN||e===a.EOF?this._reconsumeInState(q):e===a.EQUALS_SIGN?(this._err(o.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=j):(this._createAttr(""),this._reconsumeInState(j)))}[j](e){we(e)||e===a.SOLIDUS||e===a.GREATER_THAN_SIGN||e===a.EOF?(this._leaveAttrName(q),this._unconsume()):e===a.EQUALS_SIGN?this._leaveAttrName(K):Fe(e)?this.currentAttr.name+=Ye(e):e===a.QUOTATION_MARK||e===a.APOSTROPHE||e===a.LESS_THAN_SIGN?(this._err(o.unexpectedCharacterInAttributeName),this.currentAttr.name+=Ve(e)):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentAttr.name+=i.REPLACEMENT_CHARACTER):this.currentAttr.name+=Ve(e)}[q](e){we(e)||(e===a.SOLIDUS?this.state=z:e===a.EQUALS_SIGN?this.state=K:e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInTag),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState(j)))}[K](e){we(e)||(e===a.QUOTATION_MARK?this.state=V:e===a.APOSTROPHE?this.state=Y:e===a.GREATER_THAN_SIGN?(this._err(o.missingAttributeValue),this.state=u,this._emitCurrentToken()):this._reconsumeInState(W))}[V](e){e===a.QUOTATION_MARK?this.state=Q:e===a.AMPERSAND?(this.returnState=V,this.state=ye):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===a.EOF?(this._err(o.eofInTag),this._emitEOFToken()):this.currentAttr.value+=Ve(e)}[Y](e){e===a.APOSTROPHE?this.state=Q:e===a.AMPERSAND?(this.returnState=Y,this.state=ye):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===a.EOF?(this._err(o.eofInTag),this._emitEOFToken()):this.currentAttr.value+=Ve(e)}[W](e){we(e)?this._leaveAttrValue(G):e===a.AMPERSAND?(this.returnState=W,this.state=ye):e===a.GREATER_THAN_SIGN?(this._leaveAttrValue(u),this._emitCurrentToken()):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===a.QUOTATION_MARK||e===a.APOSTROPHE||e===a.LESS_THAN_SIGN||e===a.EQUALS_SIGN||e===a.GRAVE_ACCENT?(this._err(o.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=Ve(e)):e===a.EOF?(this._err(o.eofInTag),this._emitEOFToken()):this.currentAttr.value+=Ve(e)}[Q](e){we(e)?this._leaveAttrValue(G):e===a.SOLIDUS?this._leaveAttrValue(z):e===a.GREATER_THAN_SIGN?(this._leaveAttrValue(u),this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInTag),this._emitEOFToken()):(this._err(o.missingWhitespaceBetweenAttributes),this._reconsumeInState(G))}[z](e){e===a.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInTag),this._emitEOFToken()):(this._err(o.unexpectedSolidusInTag),this._reconsumeInState(G))}[$](e){e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentToken.data+=i.REPLACEMENT_CHARACTER):this.currentToken.data+=Ve(e)}[X](e){this._consumeSequenceIfMatch(c.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state=J):this._consumeSequenceIfMatch(c.DOCTYPE_STRING,e,!1)?this.state=ce:this._consumeSequenceIfMatch(c.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state=ve:(this._err(o.cdataInHtmlContent),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state=$):this._ensureHibernation()||(this._err(o.incorrectlyOpenedComment),this._createCommentToken(),this._reconsumeInState($))}[J](e){e===a.HYPHEN_MINUS?this.state=Z:e===a.GREATER_THAN_SIGN?(this._err(o.abruptClosingOfEmptyComment),this.state=u,this._emitCurrentToken()):this._reconsumeInState(ee)}[Z](e){e===a.HYPHEN_MINUS?this.state=oe:e===a.GREATER_THAN_SIGN?(this._err(o.abruptClosingOfEmptyComment),this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(ee))}[ee](e){e===a.HYPHEN_MINUS?this.state=se:e===a.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state=te):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentToken.data+=i.REPLACEMENT_CHARACTER):e===a.EOF?(this._err(o.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=Ve(e)}[te](e){e===a.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state=ne):e===a.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState(ee)}[ne](e){e===a.HYPHEN_MINUS?this.state=re:this._reconsumeInState(ee)}[re](e){e===a.HYPHEN_MINUS?this.state=ie:this._reconsumeInState(se)}[ie](e){e!==a.GREATER_THAN_SIGN&&e!==a.EOF&&this._err(o.nestedComment),this._reconsumeInState(oe)}[se](e){e===a.HYPHEN_MINUS?this.state=oe:e===a.EOF?(this._err(o.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(ee))}[oe](e){e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.EXCLAMATION_MARK?this.state=ae:e===a.HYPHEN_MINUS?this.currentToken.data+="-":e===a.EOF?(this._err(o.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState(ee))}[ae](e){e===a.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state=se):e===a.GREATER_THAN_SIGN?(this._err(o.incorrectlyClosedComment),this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState(ee))}[ce](e){we(e)?this.state=le:e===a.GREATER_THAN_SIGN?this._reconsumeInState(le):e===a.EOF?(this._err(o.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(o.missingWhitespaceBeforeDoctypeName),this._reconsumeInState(le))}[le](e){we(e)||(Fe(e)?(this._createDoctypeToken(Ye(e)),this.state=ue):e===a.NULL?(this._err(o.unexpectedNullCharacter),this._createDoctypeToken(i.REPLACEMENT_CHARACTER),this.state=ue):e===a.GREATER_THAN_SIGN?(this._err(o.missingDoctypeName),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(o.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(Ve(e)),this.state=ue))}[ue](e){we(e)?this.state=he:e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):Fe(e)?this.currentToken.name+=Ye(e):e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentToken.name+=i.REPLACEMENT_CHARACTER):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=Ve(e)}[he](e){we(e)||(e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(c.PUBLIC_STRING,e,!1)?this.state=pe:this._consumeSequenceIfMatch(c.SYSTEM_STRING,e,!1)?this.state=Ee:this._ensureHibernation()||(this._err(o.invalidCharacterSequenceAfterDoctypeName),this.currentToken.forceQuirks=!0,this._reconsumeInState(Oe)))}[pe](e){we(e)?this.state=de:e===a.QUOTATION_MARK?(this._err(o.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=fe):e===a.APOSTROPHE?(this._err(o.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state=me):e===a.GREATER_THAN_SIGN?(this._err(o.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(o.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(Oe))}[de](e){we(e)||(e===a.QUOTATION_MARK?(this.currentToken.publicId="",this.state=fe):e===a.APOSTROPHE?(this.currentToken.publicId="",this.state=me):e===a.GREATER_THAN_SIGN?(this._err(o.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(o.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(Oe)))}[fe](e){e===a.QUOTATION_MARK?this.state=Te:e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentToken.publicId+=i.REPLACEMENT_CHARACTER):e===a.GREATER_THAN_SIGN?(this._err(o.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=Ve(e)}[me](e){e===a.APOSTROPHE?this.state=Te:e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentToken.publicId+=i.REPLACEMENT_CHARACTER):e===a.GREATER_THAN_SIGN?(this._err(o.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=Ve(e)}[Te](e){we(e)?this.state=_e:e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.QUOTATION_MARK?(this._err(o.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=Ae):e===a.APOSTROPHE?(this._err(o.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state=Ce):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(o.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(Oe))}[_e](e){we(e)||(e===a.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=u):e===a.QUOTATION_MARK?(this.currentToken.systemId="",this.state=Ae):e===a.APOSTROPHE?(this.currentToken.systemId="",this.state=Ce):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(o.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(Oe)))}[Ee](e){we(e)?this.state=ge:e===a.QUOTATION_MARK?(this._err(o.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=Ae):e===a.APOSTROPHE?(this._err(o.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state=Ce):e===a.GREATER_THAN_SIGN?(this._err(o.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(o.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(Oe))}[ge](e){we(e)||(e===a.QUOTATION_MARK?(this.currentToken.systemId="",this.state=Ae):e===a.APOSTROPHE?(this.currentToken.systemId="",this.state=Ce):e===a.GREATER_THAN_SIGN?(this._err(o.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(o.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState(Oe)))}[Ae](e){e===a.QUOTATION_MARK?this.state=Ne:e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentToken.systemId+=i.REPLACEMENT_CHARACTER):e===a.GREATER_THAN_SIGN?(this._err(o.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=Ve(e)}[Ce](e){e===a.APOSTROPHE?this.state=Ne:e===a.NULL?(this._err(o.unexpectedNullCharacter),this.currentToken.systemId+=i.REPLACEMENT_CHARACTER):e===a.GREATER_THAN_SIGN?(this._err(o.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=Ve(e)}[Ne](e){we(e)||(e===a.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(o.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(o.unexpectedCharacterAfterDoctypeSystemIdentifier),this._reconsumeInState(Oe)))}[Oe](e){e===a.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=u):e===a.NULL?this._err(o.unexpectedNullCharacter):e===a.EOF&&(this._emitCurrentToken(),this._emitEOFToken())}[ve](e){e===a.RIGHT_SQUARE_BRACKET?this.state=be:e===a.EOF?(this._err(o.eofInCdata),this._emitEOFToken()):this._emitCodePoint(e)}[be](e){e===a.RIGHT_SQUARE_BRACKET?this.state=Se:(this._emitChars("]"),this._reconsumeInState(ve))}[Se](e){e===a.GREATER_THAN_SIGN?this.state=u:e===a.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState(ve))}[ye](e){this.tempBuff=[a.AMPERSAND],e===a.NUMBER_SIGN?(this.tempBuff.push(e),this.state=Re):Ge(e)?this._reconsumeInState(Ie):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}[Ie](e){const t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[a.AMPERSAND];else if(t){const e=this.tempBuff[this.tempBuff.length-1]===a.SEMICOLON;this._isCharacterReferenceAttributeQuirk(e)||(e||this._errOnNextCodePoint(o.missingSemicolonAfterCharacterReference),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState}else this._flushCodePointsConsumedAsCharacterReference(),this.state=ke}[ke](e){Ge(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=Ve(e):this._emitCodePoint(e):(e===a.SEMICOLON&&this._err(o.unknownNamedCharacterReference),this._reconsumeInState(this.returnState))}[Re](e){this.charRefCode=0,e===a.LATIN_SMALL_X||e===a.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state=Le):this._reconsumeInState(Me)}[Le](e){!function(e){return He(e)||je(e)||qe(e)}(e)?(this._err(o.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState(xe)}[Me](e){He(e)?this._reconsumeInState(Pe):(this._err(o.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}[xe](e){je(e)?this.charRefCode=16*this.charRefCode+e-55:qe(e)?this.charRefCode=16*this.charRefCode+e-87:He(e)?this.charRefCode=16*this.charRefCode+e-48:e===a.SEMICOLON?this.state=De:(this._err(o.missingSemicolonAfterCharacterReference),this._reconsumeInState(De))}[Pe](e){He(e)?this.charRefCode=10*this.charRefCode+e-48:e===a.SEMICOLON?this.state=De:(this._err(o.missingSemicolonAfterCharacterReference),this._reconsumeInState(De))}[De](){if(this.charRefCode===a.NULL)this._err(o.nullCharacterReference),this.charRefCode=a.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(o.characterReferenceOutsideUnicodeRange),this.charRefCode=a.REPLACEMENT_CHARACTER;else if(i.isSurrogate(this.charRefCode))this._err(o.surrogateCharacterReference),this.charRefCode=a.REPLACEMENT_CHARACTER;else if(i.isUndefinedCodePoint(this.charRefCode))this._err(o.noncharacterCharacterReference);else if(i.isControlCodePoint(this.charRefCode)||this.charRefCode===a.CARRIAGE_RETURN){this._err(o.controlCharacterReference);const e=l[this.charRefCode];e&&(this.charRefCode=e)}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)}}Qe.CHARACTER_TOKEN="CHARACTER_TOKEN",Qe.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",Qe.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",Qe.START_TAG_TOKEN="START_TAG_TOKEN",Qe.END_TAG_TOKEN="END_TAG_TOKEN",Qe.COMMENT_TOKEN="COMMENT_TOKEN",Qe.DOCTYPE_TOKEN="DOCTYPE_TOKEN",Qe.EOF_TOKEN="EOF_TOKEN",Qe.HIBERNATION_TOKEN="HIBERNATION_TOKEN",Qe.MODE={DATA:u,RCDATA:h,RAWTEXT:p,SCRIPT_DATA:d,PLAINTEXT:f},Qe.getTokenAttr=function(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null},e.exports=Qe},5482:e=>{"use strict";e.exports=new Uint16Array([4,52,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,106,303,412,810,1432,1701,1796,1987,2114,2360,2420,2484,3170,3251,4140,4393,4575,4610,5106,5512,5728,6117,6274,6315,6345,6427,6516,7002,7910,8733,9323,9870,10170,10631,10893,11318,11386,11467,12773,13092,14474,14922,15448,15542,16419,17666,18166,18611,19004,19095,19298,19397,4,16,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,140,150,158,169,176,194,199,210,216,222,226,242,256,266,283,294,108,105,103,5,198,1,59,148,1,198,80,5,38,1,59,156,1,38,99,117,116,101,5,193,1,59,167,1,193,114,101,118,101,59,1,258,4,2,105,121,182,191,114,99,5,194,1,59,189,1,194,59,1,1040,114,59,3,55349,56580,114,97,118,101,5,192,1,59,208,1,192,112,104,97,59,1,913,97,99,114,59,1,256,100,59,1,10835,4,2,103,112,232,237,111,110,59,1,260,102,59,3,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,1,8289,105,110,103,5,197,1,59,264,1,197,4,2,99,115,272,277,114,59,3,55349,56476,105,103,110,59,1,8788,105,108,100,101,5,195,1,59,292,1,195,109,108,5,196,1,59,301,1,196,4,8,97,99,101,102,111,114,115,117,321,350,354,383,388,394,400,405,4,2,99,114,327,336,107,115,108,97,115,104,59,1,8726,4,2,118,119,342,345,59,1,10983,101,100,59,1,8966,121,59,1,1041,4,3,99,114,116,362,369,379,97,117,115,101,59,1,8757,110,111,117,108,108,105,115,59,1,8492,97,59,1,914,114,59,3,55349,56581,112,102,59,3,55349,56633,101,118,101,59,1,728,99,114,59,1,8492,109,112,101,113,59,1,8782,4,14,72,79,97,99,100,101,102,104,105,108,111,114,115,117,442,447,456,504,542,547,569,573,577,616,678,784,790,796,99,121,59,1,1063,80,89,5,169,1,59,454,1,169,4,3,99,112,121,464,470,497,117,116,101,59,1,262,4,2,59,105,476,478,1,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,1,8517,108,101,121,115,59,1,8493,4,4,97,101,105,111,514,520,530,535,114,111,110,59,1,268,100,105,108,5,199,1,59,528,1,199,114,99,59,1,264,110,105,110,116,59,1,8752,111,116,59,1,266,4,2,100,110,553,560,105,108,108,97,59,1,184,116,101,114,68,111,116,59,1,183,114,59,1,8493,105,59,1,935,114,99,108,101,4,4,68,77,80,84,591,596,603,609,111,116,59,1,8857,105,110,117,115,59,1,8854,108,117,115,59,1,8853,105,109,101,115,59,1,8855,111,4,2,99,115,623,646,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8754,101,67,117,114,108,121,4,2,68,81,658,671,111,117,98,108,101,81,117,111,116,101,59,1,8221,117,111,116,101,59,1,8217,4,4,108,110,112,117,688,701,736,753,111,110,4,2,59,101,696,698,1,8759,59,1,10868,4,3,103,105,116,709,717,722,114,117,101,110,116,59,1,8801,110,116,59,1,8751,111,117,114,73,110,116,101,103,114,97,108,59,1,8750,4,2,102,114,742,745,59,1,8450,111,100,117,99,116,59,1,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8755,111,115,115,59,1,10799,99,114,59,3,55349,56478,112,4,2,59,67,803,805,1,8915,97,112,59,1,8781,4,11,68,74,83,90,97,99,101,102,105,111,115,834,850,855,860,865,888,903,916,921,1011,1415,4,2,59,111,840,842,1,8517,116,114,97,104,100,59,1,10513,99,121,59,1,1026,99,121,59,1,1029,99,121,59,1,1039,4,3,103,114,115,873,879,883,103,101,114,59,1,8225,114,59,1,8609,104,118,59,1,10980,4,2,97,121,894,900,114,111,110,59,1,270,59,1,1044,108,4,2,59,116,910,912,1,8711,97,59,1,916,114,59,3,55349,56583,4,2,97,102,927,998,4,2,99,109,933,992,114,105,116,105,99,97,108,4,4,65,68,71,84,950,957,978,985,99,117,116,101,59,1,180,111,4,2,116,117,964,967,59,1,729,98,108,101,65,99,117,116,101,59,1,733,114,97,118,101,59,1,96,105,108,100,101,59,1,732,111,110,100,59,1,8900,102,101,114,101,110,116,105,97,108,68,59,1,8518,4,4,112,116,117,119,1021,1026,1048,1249,102,59,3,55349,56635,4,3,59,68,69,1034,1036,1041,1,168,111,116,59,1,8412,113,117,97,108,59,1,8784,98,108,101,4,6,67,68,76,82,85,86,1065,1082,1101,1189,1211,1236,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8751,111,4,2,116,119,1089,1092,59,1,168,110,65,114,114,111,119,59,1,8659,4,2,101,111,1107,1141,102,116,4,3,65,82,84,1117,1124,1136,114,114,111,119,59,1,8656,105,103,104,116,65,114,114,111,119,59,1,8660,101,101,59,1,10980,110,103,4,2,76,82,1149,1177,101,102,116,4,2,65,82,1158,1165,114,114,111,119,59,1,10232,105,103,104,116,65,114,114,111,119,59,1,10234,105,103,104,116,65,114,114,111,119,59,1,10233,105,103,104,116,4,2,65,84,1199,1206,114,114,111,119,59,1,8658,101,101,59,1,8872,112,4,2,65,68,1218,1225,114,114,111,119,59,1,8657,111,119,110,65,114,114,111,119,59,1,8661,101,114,116,105,99,97,108,66,97,114,59,1,8741,110,4,6,65,66,76,82,84,97,1264,1292,1299,1352,1391,1408,114,114,111,119,4,3,59,66,85,1276,1278,1283,1,8595,97,114,59,1,10515,112,65,114,114,111,119,59,1,8693,114,101,118,101,59,1,785,101,102,116,4,3,82,84,86,1310,1323,1334,105,103,104,116,86,101,99,116,111,114,59,1,10576,101,101,86,101,99,116,111,114,59,1,10590,101,99,116,111,114,4,2,59,66,1345,1347,1,8637,97,114,59,1,10582,105,103,104,116,4,2,84,86,1362,1373,101,101,86,101,99,116,111,114,59,1,10591,101,99,116,111,114,4,2,59,66,1384,1386,1,8641,97,114,59,1,10583,101,101,4,2,59,65,1399,1401,1,8868,114,114,111,119,59,1,8615,114,114,111,119,59,1,8659,4,2,99,116,1421,1426,114,59,3,55349,56479,114,111,107,59,1,272,4,16,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1466,1470,1478,1489,1515,1520,1525,1536,1544,1593,1609,1617,1650,1664,1668,1677,71,59,1,330,72,5,208,1,59,1476,1,208,99,117,116,101,5,201,1,59,1487,1,201,4,3,97,105,121,1497,1503,1512,114,111,110,59,1,282,114,99,5,202,1,59,1510,1,202,59,1,1069,111,116,59,1,278,114,59,3,55349,56584,114,97,118,101,5,200,1,59,1534,1,200,101,109,101,110,116,59,1,8712,4,2,97,112,1550,1555,99,114,59,1,274,116,121,4,2,83,86,1563,1576,109,97,108,108,83,113,117,97,114,101,59,1,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9643,4,2,103,112,1599,1604,111,110,59,1,280,102,59,3,55349,56636,115,105,108,111,110,59,1,917,117,4,2,97,105,1624,1640,108,4,2,59,84,1631,1633,1,10869,105,108,100,101,59,1,8770,108,105,98,114,105,117,109,59,1,8652,4,2,99,105,1656,1660,114,59,1,8496,109,59,1,10867,97,59,1,919,109,108,5,203,1,59,1675,1,203,4,2,105,112,1683,1689,115,116,115,59,1,8707,111,110,101,110,116,105,97,108,69,59,1,8519,4,5,99,102,105,111,115,1713,1717,1722,1762,1791,121,59,1,1060,114,59,3,55349,56585,108,108,101,100,4,2,83,86,1732,1745,109,97,108,108,83,113,117,97,114,101,59,1,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9642,4,3,112,114,117,1770,1775,1781,102,59,3,55349,56637,65,108,108,59,1,8704,114,105,101,114,116,114,102,59,1,8497,99,114,59,1,8497,4,12,74,84,97,98,99,100,102,103,111,114,115,116,1822,1827,1834,1848,1855,1877,1882,1887,1890,1896,1978,1984,99,121,59,1,1027,5,62,1,59,1832,1,62,109,109,97,4,2,59,100,1843,1845,1,915,59,1,988,114,101,118,101,59,1,286,4,3,101,105,121,1863,1869,1874,100,105,108,59,1,290,114,99,59,1,284,59,1,1043,111,116,59,1,288,114,59,3,55349,56586,59,1,8921,112,102,59,3,55349,56638,101,97,116,101,114,4,6,69,70,71,76,83,84,1915,1933,1944,1953,1959,1971,113,117,97,108,4,2,59,76,1925,1927,1,8805,101,115,115,59,1,8923,117,108,108,69,113,117,97,108,59,1,8807,114,101,97,116,101,114,59,1,10914,101,115,115,59,1,8823,108,97,110,116,69,113,117,97,108,59,1,10878,105,108,100,101,59,1,8819,99,114,59,3,55349,56482,59,1,8811,4,8,65,97,99,102,105,111,115,117,2005,2012,2026,2032,2036,2049,2073,2089,82,68,99,121,59,1,1066,4,2,99,116,2018,2023,101,107,59,1,711,59,1,94,105,114,99,59,1,292,114,59,1,8460,108,98,101,114,116,83,112,97,99,101,59,1,8459,4,2,112,114,2055,2059,102,59,1,8461,105,122,111,110,116,97,108,76,105,110,101,59,1,9472,4,2,99,116,2079,2083,114,59,1,8459,114,111,107,59,1,294,109,112,4,2,68,69,2097,2107,111,119,110,72,117,109,112,59,1,8782,113,117,97,108,59,1,8783,4,14,69,74,79,97,99,100,102,103,109,110,111,115,116,117,2144,2149,2155,2160,2171,2189,2194,2198,2209,2245,2307,2329,2334,2341,99,121,59,1,1045,108,105,103,59,1,306,99,121,59,1,1025,99,117,116,101,5,205,1,59,2169,1,205,4,2,105,121,2177,2186,114,99,5,206,1,59,2184,1,206,59,1,1048,111,116,59,1,304,114,59,1,8465,114,97,118,101,5,204,1,59,2207,1,204,4,3,59,97,112,2217,2219,2238,1,8465,4,2,99,103,2225,2229,114,59,1,298,105,110,97,114,121,73,59,1,8520,108,105,101,115,59,1,8658,4,2,116,118,2251,2281,4,2,59,101,2257,2259,1,8748,4,2,103,114,2265,2271,114,97,108,59,1,8747,115,101,99,116,105,111,110,59,1,8898,105,115,105,98,108,101,4,2,67,84,2293,2300,111,109,109,97,59,1,8291,105,109,101,115,59,1,8290,4,3,103,112,116,2315,2320,2325,111,110,59,1,302,102,59,3,55349,56640,97,59,1,921,99,114,59,1,8464,105,108,100,101,59,1,296,4,2,107,109,2347,2352,99,121,59,1,1030,108,5,207,1,59,2358,1,207,4,5,99,102,111,115,117,2372,2386,2391,2397,2414,4,2,105,121,2378,2383,114,99,59,1,308,59,1,1049,114,59,3,55349,56589,112,102,59,3,55349,56641,4,2,99,101,2403,2408,114,59,3,55349,56485,114,99,121,59,1,1032,107,99,121,59,1,1028,4,7,72,74,97,99,102,111,115,2436,2441,2446,2452,2467,2472,2478,99,121,59,1,1061,99,121,59,1,1036,112,112,97,59,1,922,4,2,101,121,2458,2464,100,105,108,59,1,310,59,1,1050,114,59,3,55349,56590,112,102,59,3,55349,56642,99,114,59,3,55349,56486,4,11,74,84,97,99,101,102,108,109,111,115,116,2508,2513,2520,2562,2585,2981,2986,3004,3011,3146,3167,99,121,59,1,1033,5,60,1,59,2518,1,60,4,5,99,109,110,112,114,2532,2538,2544,2548,2558,117,116,101,59,1,313,98,100,97,59,1,923,103,59,1,10218,108,97,99,101,116,114,102,59,1,8466,114,59,1,8606,4,3,97,101,121,2570,2576,2582,114,111,110,59,1,317,100,105,108,59,1,315,59,1,1051,4,2,102,115,2591,2907,116,4,10,65,67,68,70,82,84,85,86,97,114,2614,2663,2672,2728,2735,2760,2820,2870,2888,2895,4,2,110,114,2620,2633,103,108,101,66,114,97,99,107,101,116,59,1,10216,114,111,119,4,3,59,66,82,2644,2646,2651,1,8592,97,114,59,1,8676,105,103,104,116,65,114,114,111,119,59,1,8646,101,105,108,105,110,103,59,1,8968,111,4,2,117,119,2679,2692,98,108,101,66,114,97,99,107,101,116,59,1,10214,110,4,2,84,86,2699,2710,101,101,86,101,99,116,111,114,59,1,10593,101,99,116,111,114,4,2,59,66,2721,2723,1,8643,97,114,59,1,10585,108,111,111,114,59,1,8970,105,103,104,116,4,2,65,86,2745,2752,114,114,111,119,59,1,8596,101,99,116,111,114,59,1,10574,4,2,101,114,2766,2792,101,4,3,59,65,86,2775,2777,2784,1,8867,114,114,111,119,59,1,8612,101,99,116,111,114,59,1,10586,105,97,110,103,108,101,4,3,59,66,69,2806,2808,2813,1,8882,97,114,59,1,10703,113,117,97,108,59,1,8884,112,4,3,68,84,86,2829,2841,2852,111,119,110,86,101,99,116,111,114,59,1,10577,101,101,86,101,99,116,111,114,59,1,10592,101,99,116,111,114,4,2,59,66,2863,2865,1,8639,97,114,59,1,10584,101,99,116,111,114,4,2,59,66,2881,2883,1,8636,97,114,59,1,10578,114,114,111,119,59,1,8656,105,103,104,116,97,114,114,111,119,59,1,8660,115,4,6,69,70,71,76,83,84,2922,2936,2947,2956,2962,2974,113,117,97,108,71,114,101,97,116,101,114,59,1,8922,117,108,108,69,113,117,97,108,59,1,8806,114,101,97,116,101,114,59,1,8822,101,115,115,59,1,10913,108,97,110,116,69,113,117,97,108,59,1,10877,105,108,100,101,59,1,8818,114,59,3,55349,56591,4,2,59,101,2992,2994,1,8920,102,116,97,114,114,111,119,59,1,8666,105,100,111,116,59,1,319,4,3,110,112,119,3019,3110,3115,103,4,4,76,82,108,114,3030,3058,3070,3098,101,102,116,4,2,65,82,3039,3046,114,114,111,119,59,1,10229,105,103,104,116,65,114,114,111,119,59,1,10231,105,103,104,116,65,114,114,111,119,59,1,10230,101,102,116,4,2,97,114,3079,3086,114,114,111,119,59,1,10232,105,103,104,116,97,114,114,111,119,59,1,10234,105,103,104,116,97,114,114,111,119,59,1,10233,102,59,3,55349,56643,101,114,4,2,76,82,3123,3134,101,102,116,65,114,114,111,119,59,1,8601,105,103,104,116,65,114,114,111,119,59,1,8600,4,3,99,104,116,3154,3158,3161,114,59,1,8466,59,1,8624,114,111,107,59,1,321,59,1,8810,4,8,97,99,101,102,105,111,115,117,3188,3192,3196,3222,3227,3237,3243,3248,112,59,1,10501,121,59,1,1052,4,2,100,108,3202,3213,105,117,109,83,112,97,99,101,59,1,8287,108,105,110,116,114,102,59,1,8499,114,59,3,55349,56592,110,117,115,80,108,117,115,59,1,8723,112,102,59,3,55349,56644,99,114,59,1,8499,59,1,924,4,9,74,97,99,101,102,111,115,116,117,3271,3276,3283,3306,3422,3427,4120,4126,4137,99,121,59,1,1034,99,117,116,101,59,1,323,4,3,97,101,121,3291,3297,3303,114,111,110,59,1,327,100,105,108,59,1,325,59,1,1053,4,3,103,115,119,3314,3380,3415,97,116,105,118,101,4,3,77,84,86,3327,3340,3365,101,100,105,117,109,83,112,97,99,101,59,1,8203,104,105,4,2,99,110,3348,3357,107,83,112,97,99,101,59,1,8203,83,112,97,99,101,59,1,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,1,8203,116,101,100,4,2,71,76,3389,3405,114,101,97,116,101,114,71,114,101,97,116,101,114,59,1,8811,101,115,115,76,101,115,115,59,1,8810,76,105,110,101,59,1,10,114,59,3,55349,56593,4,4,66,110,112,116,3437,3444,3460,3464,114,101,97,107,59,1,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,1,160,102,59,1,8469,4,13,59,67,68,69,71,72,76,78,80,82,83,84,86,3492,3494,3517,3536,3578,3657,3685,3784,3823,3860,3915,4066,4107,1,10988,4,2,111,117,3500,3510,110,103,114,117,101,110,116,59,1,8802,112,67,97,112,59,1,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,1,8742,4,3,108,113,120,3544,3552,3571,101,109,101,110,116,59,1,8713,117,97,108,4,2,59,84,3561,3563,1,8800,105,108,100,101,59,3,8770,824,105,115,116,115,59,1,8708,114,101,97,116,101,114,4,7,59,69,70,71,76,83,84,3600,3602,3609,3621,3631,3637,3650,1,8815,113,117,97,108,59,1,8817,117,108,108,69,113,117,97,108,59,3,8807,824,114,101,97,116,101,114,59,3,8811,824,101,115,115,59,1,8825,108,97,110,116,69,113,117,97,108,59,3,10878,824,105,108,100,101,59,1,8821,117,109,112,4,2,68,69,3666,3677,111,119,110,72,117,109,112,59,3,8782,824,113,117,97,108,59,3,8783,824,101,4,2,102,115,3692,3724,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3709,3711,3717,1,8938,97,114,59,3,10703,824,113,117,97,108,59,1,8940,115,4,6,59,69,71,76,83,84,3739,3741,3748,3757,3764,3777,1,8814,113,117,97,108,59,1,8816,114,101,97,116,101,114,59,1,8824,101,115,115,59,3,8810,824,108,97,110,116,69,113,117,97,108,59,3,10877,824,105,108,100,101,59,1,8820,101,115,116,101,100,4,2,71,76,3795,3812,114,101,97,116,101,114,71,114,101,97,116,101,114,59,3,10914,824,101,115,115,76,101,115,115,59,3,10913,824,114,101,99,101,100,101,115,4,3,59,69,83,3838,3840,3848,1,8832,113,117,97,108,59,3,10927,824,108,97,110,116,69,113,117,97,108,59,1,8928,4,2,101,105,3866,3881,118,101,114,115,101,69,108,101,109,101,110,116,59,1,8716,103,104,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3900,3902,3908,1,8939,97,114,59,3,10704,824,113,117,97,108,59,1,8941,4,2,113,117,3921,3973,117,97,114,101,83,117,4,2,98,112,3933,3952,115,101,116,4,2,59,69,3942,3945,3,8847,824,113,117,97,108,59,1,8930,101,114,115,101,116,4,2,59,69,3963,3966,3,8848,824,113,117,97,108,59,1,8931,4,3,98,99,112,3981,4e3,4045,115,101,116,4,2,59,69,3990,3993,3,8834,8402,113,117,97,108,59,1,8840,99,101,101,100,115,4,4,59,69,83,84,4015,4017,4025,4037,1,8833,113,117,97,108,59,3,10928,824,108,97,110,116,69,113,117,97,108,59,1,8929,105,108,100,101,59,3,8831,824,101,114,115,101,116,4,2,59,69,4056,4059,3,8835,8402,113,117,97,108,59,1,8841,105,108,100,101,4,4,59,69,70,84,4080,4082,4089,4100,1,8769,113,117,97,108,59,1,8772,117,108,108,69,113,117,97,108,59,1,8775,105,108,100,101,59,1,8777,101,114,116,105,99,97,108,66,97,114,59,1,8740,99,114,59,3,55349,56489,105,108,100,101,5,209,1,59,4135,1,209,59,1,925,4,14,69,97,99,100,102,103,109,111,112,114,115,116,117,118,4170,4176,4187,4205,4212,4217,4228,4253,4259,4292,4295,4316,4337,4346,108,105,103,59,1,338,99,117,116,101,5,211,1,59,4185,1,211,4,2,105,121,4193,4202,114,99,5,212,1,59,4200,1,212,59,1,1054,98,108,97,99,59,1,336,114,59,3,55349,56594,114,97,118,101,5,210,1,59,4226,1,210,4,3,97,101,105,4236,4241,4246,99,114,59,1,332,103,97,59,1,937,99,114,111,110,59,1,927,112,102,59,3,55349,56646,101,110,67,117,114,108,121,4,2,68,81,4272,4285,111,117,98,108,101,81,117,111,116,101,59,1,8220,117,111,116,101,59,1,8216,59,1,10836,4,2,99,108,4301,4306,114,59,3,55349,56490,97,115,104,5,216,1,59,4314,1,216,105,4,2,108,109,4323,4332,100,101,5,213,1,59,4330,1,213,101,115,59,1,10807,109,108,5,214,1,59,4344,1,214,101,114,4,2,66,80,4354,4380,4,2,97,114,4360,4364,114,59,1,8254,97,99,4,2,101,107,4372,4375,59,1,9182,101,116,59,1,9140,97,114,101,110,116,104,101,115,105,115,59,1,9180,4,9,97,99,102,104,105,108,111,114,115,4413,4422,4426,4431,4435,4438,4448,4471,4561,114,116,105,97,108,68,59,1,8706,121,59,1,1055,114,59,3,55349,56595,105,59,1,934,59,1,928,117,115,77,105,110,117,115,59,1,177,4,2,105,112,4454,4467,110,99,97,114,101,112,108,97,110,101,59,1,8460,102,59,1,8473,4,4,59,101,105,111,4481,4483,4526,4531,1,10939,99,101,100,101,115,4,4,59,69,83,84,4498,4500,4507,4519,1,8826,113,117,97,108,59,1,10927,108,97,110,116,69,113,117,97,108,59,1,8828,105,108,100,101,59,1,8830,109,101,59,1,8243,4,2,100,112,4537,4543,117,99,116,59,1,8719,111,114,116,105,111,110,4,2,59,97,4555,4557,1,8759,108,59,1,8733,4,2,99,105,4567,4572,114,59,3,55349,56491,59,1,936,4,4,85,102,111,115,4585,4594,4599,4604,79,84,5,34,1,59,4592,1,34,114,59,3,55349,56596,112,102,59,1,8474,99,114,59,3,55349,56492,4,12,66,69,97,99,101,102,104,105,111,114,115,117,4636,4642,4650,4681,4704,4763,4767,4771,5047,5069,5081,5094,97,114,114,59,1,10512,71,5,174,1,59,4648,1,174,4,3,99,110,114,4658,4664,4668,117,116,101,59,1,340,103,59,1,10219,114,4,2,59,116,4675,4677,1,8608,108,59,1,10518,4,3,97,101,121,4689,4695,4701,114,111,110,59,1,344,100,105,108,59,1,342,59,1,1056,4,2,59,118,4710,4712,1,8476,101,114,115,101,4,2,69,85,4722,4748,4,2,108,113,4728,4736,101,109,101,110,116,59,1,8715,117,105,108,105,98,114,105,117,109,59,1,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,1,10607,114,59,1,8476,111,59,1,929,103,104,116,4,8,65,67,68,70,84,85,86,97,4792,4840,4849,4905,4912,4972,5022,5040,4,2,110,114,4798,4811,103,108,101,66,114,97,99,107,101,116,59,1,10217,114,111,119,4,3,59,66,76,4822,4824,4829,1,8594,97,114,59,1,8677,101,102,116,65,114,114,111,119,59,1,8644,101,105,108,105,110,103,59,1,8969,111,4,2,117,119,4856,4869,98,108,101,66,114,97,99,107,101,116,59,1,10215,110,4,2,84,86,4876,4887,101,101,86,101,99,116,111,114,59,1,10589,101,99,116,111,114,4,2,59,66,4898,4900,1,8642,97,114,59,1,10581,108,111,111,114,59,1,8971,4,2,101,114,4918,4944,101,4,3,59,65,86,4927,4929,4936,1,8866,114,114,111,119,59,1,8614,101,99,116,111,114,59,1,10587,105,97,110,103,108,101,4,3,59,66,69,4958,4960,4965,1,8883,97,114,59,1,10704,113,117,97,108,59,1,8885,112,4,3,68,84,86,4981,4993,5004,111,119,110,86,101,99,116,111,114,59,1,10575,101,101,86,101,99,116,111,114,59,1,10588,101,99,116,111,114,4,2,59,66,5015,5017,1,8638,97,114,59,1,10580,101,99,116,111,114,4,2,59,66,5033,5035,1,8640,97,114,59,1,10579,114,114,111,119,59,1,8658,4,2,112,117,5053,5057,102,59,1,8477,110,100,73,109,112,108,105,101,115,59,1,10608,105,103,104,116,97,114,114,111,119,59,1,8667,4,2,99,104,5087,5091,114,59,1,8475,59,1,8625,108,101,68,101,108,97,121,101,100,59,1,10740,4,13,72,79,97,99,102,104,105,109,111,113,115,116,117,5134,5150,5157,5164,5198,5203,5259,5265,5277,5283,5374,5380,5385,4,2,67,99,5140,5146,72,99,121,59,1,1065,121,59,1,1064,70,84,99,121,59,1,1068,99,117,116,101,59,1,346,4,5,59,97,101,105,121,5176,5178,5184,5190,5195,1,10940,114,111,110,59,1,352,100,105,108,59,1,350,114,99,59,1,348,59,1,1057,114,59,3,55349,56598,111,114,116,4,4,68,76,82,85,5216,5227,5238,5250,111,119,110,65,114,114,111,119,59,1,8595,101,102,116,65,114,114,111,119,59,1,8592,105,103,104,116,65,114,114,111,119,59,1,8594,112,65,114,114,111,119,59,1,8593,103,109,97,59,1,931,97,108,108,67,105,114,99,108,101,59,1,8728,112,102,59,3,55349,56650,4,2,114,117,5289,5293,116,59,1,8730,97,114,101,4,4,59,73,83,85,5306,5308,5322,5367,1,9633,110,116,101,114,115,101,99,116,105,111,110,59,1,8851,117,4,2,98,112,5329,5347,115,101,116,4,2,59,69,5338,5340,1,8847,113,117,97,108,59,1,8849,101,114,115,101,116,4,2,59,69,5358,5360,1,8848,113,117,97,108,59,1,8850,110,105,111,110,59,1,8852,99,114,59,3,55349,56494,97,114,59,1,8902,4,4,98,99,109,112,5395,5420,5475,5478,4,2,59,115,5401,5403,1,8912,101,116,4,2,59,69,5411,5413,1,8912,113,117,97,108,59,1,8838,4,2,99,104,5426,5468,101,101,100,115,4,4,59,69,83,84,5440,5442,5449,5461,1,8827,113,117,97,108,59,1,10928,108,97,110,116,69,113,117,97,108,59,1,8829,105,108,100,101,59,1,8831,84,104,97,116,59,1,8715,59,1,8721,4,3,59,101,115,5486,5488,5507,1,8913,114,115,101,116,4,2,59,69,5498,5500,1,8835,113,117,97,108,59,1,8839,101,116,59,1,8913,4,11,72,82,83,97,99,102,104,105,111,114,115,5536,5546,5552,5567,5579,5602,5607,5655,5695,5701,5711,79,82,78,5,222,1,59,5544,1,222,65,68,69,59,1,8482,4,2,72,99,5558,5563,99,121,59,1,1035,121,59,1,1062,4,2,98,117,5573,5576,59,1,9,59,1,932,4,3,97,101,121,5587,5593,5599,114,111,110,59,1,356,100,105,108,59,1,354,59,1,1058,114,59,3,55349,56599,4,2,101,105,5613,5631,4,2,114,116,5619,5627,101,102,111,114,101,59,1,8756,97,59,1,920,4,2,99,110,5637,5647,107,83,112,97,99,101,59,3,8287,8202,83,112,97,99,101,59,1,8201,108,100,101,4,4,59,69,70,84,5668,5670,5677,5688,1,8764,113,117,97,108,59,1,8771,117,108,108,69,113,117,97,108,59,1,8773,105,108,100,101,59,1,8776,112,102,59,3,55349,56651,105,112,108,101,68,111,116,59,1,8411,4,2,99,116,5717,5722,114,59,3,55349,56495,114,111,107,59,1,358,4,14,97,98,99,100,102,103,109,110,111,112,114,115,116,117,5758,5789,5805,5823,5830,5835,5846,5852,5921,5937,6089,6095,6101,6108,4,2,99,114,5764,5774,117,116,101,5,218,1,59,5772,1,218,114,4,2,59,111,5781,5783,1,8607,99,105,114,59,1,10569,114,4,2,99,101,5796,5800,121,59,1,1038,118,101,59,1,364,4,2,105,121,5811,5820,114,99,5,219,1,59,5818,1,219,59,1,1059,98,108,97,99,59,1,368,114,59,3,55349,56600,114,97,118,101,5,217,1,59,5844,1,217,97,99,114,59,1,362,4,2,100,105,5858,5905,101,114,4,2,66,80,5866,5892,4,2,97,114,5872,5876,114,59,1,95,97,99,4,2,101,107,5884,5887,59,1,9183,101,116,59,1,9141,97,114,101,110,116,104,101,115,105,115,59,1,9181,111,110,4,2,59,80,5913,5915,1,8899,108,117,115,59,1,8846,4,2,103,112,5927,5932,111,110,59,1,370,102,59,3,55349,56652,4,8,65,68,69,84,97,100,112,115,5955,5985,5996,6009,6026,6033,6044,6075,114,114,111,119,4,3,59,66,68,5967,5969,5974,1,8593,97,114,59,1,10514,111,119,110,65,114,114,111,119,59,1,8645,111,119,110,65,114,114,111,119,59,1,8597,113,117,105,108,105,98,114,105,117,109,59,1,10606,101,101,4,2,59,65,6017,6019,1,8869,114,114,111,119,59,1,8613,114,114,111,119,59,1,8657,111,119,110,97,114,114,111,119,59,1,8661,101,114,4,2,76,82,6052,6063,101,102,116,65,114,114,111,119,59,1,8598,105,103,104,116,65,114,114,111,119,59,1,8599,105,4,2,59,108,6082,6084,1,978,111,110,59,1,933,105,110,103,59,1,366,99,114,59,3,55349,56496,105,108,100,101,59,1,360,109,108,5,220,1,59,6115,1,220,4,9,68,98,99,100,101,102,111,115,118,6137,6143,6148,6152,6166,6250,6255,6261,6267,97,115,104,59,1,8875,97,114,59,1,10987,121,59,1,1042,97,115,104,4,2,59,108,6161,6163,1,8873,59,1,10982,4,2,101,114,6172,6175,59,1,8897,4,3,98,116,121,6183,6188,6238,97,114,59,1,8214,4,2,59,105,6194,6196,1,8214,99,97,108,4,4,66,76,83,84,6209,6214,6220,6231,97,114,59,1,8739,105,110,101,59,1,124,101,112,97,114,97,116,111,114,59,1,10072,105,108,100,101,59,1,8768,84,104,105,110,83,112,97,99,101,59,1,8202,114,59,3,55349,56601,112,102,59,3,55349,56653,99,114,59,3,55349,56497,100,97,115,104,59,1,8874,4,5,99,101,102,111,115,6286,6292,6298,6303,6309,105,114,99,59,1,372,100,103,101,59,1,8896,114,59,3,55349,56602,112,102,59,3,55349,56654,99,114,59,3,55349,56498,4,4,102,105,111,115,6325,6330,6333,6339,114,59,3,55349,56603,59,1,926,112,102,59,3,55349,56655,99,114,59,3,55349,56499,4,9,65,73,85,97,99,102,111,115,117,6365,6370,6375,6380,6391,6405,6410,6416,6422,99,121,59,1,1071,99,121,59,1,1031,99,121,59,1,1070,99,117,116,101,5,221,1,59,6389,1,221,4,2,105,121,6397,6402,114,99,59,1,374,59,1,1067,114,59,3,55349,56604,112,102,59,3,55349,56656,99,114,59,3,55349,56500,109,108,59,1,376,4,8,72,97,99,100,101,102,111,115,6445,6450,6457,6472,6477,6501,6505,6510,99,121,59,1,1046,99,117,116,101,59,1,377,4,2,97,121,6463,6469,114,111,110,59,1,381,59,1,1047,111,116,59,1,379,4,2,114,116,6483,6497,111,87,105,100,116,104,83,112,97,99,101,59,1,8203,97,59,1,918,114,59,1,8488,112,102,59,1,8484,99,114,59,3,55349,56501,4,16,97,98,99,101,102,103,108,109,110,111,112,114,115,116,117,119,6550,6561,6568,6612,6622,6634,6645,6672,6699,6854,6870,6923,6933,6963,6974,6983,99,117,116,101,5,225,1,59,6559,1,225,114,101,118,101,59,1,259,4,6,59,69,100,105,117,121,6582,6584,6588,6591,6600,6609,1,8766,59,3,8766,819,59,1,8767,114,99,5,226,1,59,6598,1,226,116,101,5,180,1,59,6607,1,180,59,1,1072,108,105,103,5,230,1,59,6620,1,230,4,2,59,114,6628,6630,1,8289,59,3,55349,56606,114,97,118,101,5,224,1,59,6643,1,224,4,2,101,112,6651,6667,4,2,102,112,6657,6663,115,121,109,59,1,8501,104,59,1,8501,104,97,59,1,945,4,2,97,112,6678,6692,4,2,99,108,6684,6688,114,59,1,257,103,59,1,10815,5,38,1,59,6697,1,38,4,2,100,103,6705,6737,4,5,59,97,100,115,118,6717,6719,6724,6727,6734,1,8743,110,100,59,1,10837,59,1,10844,108,111,112,101,59,1,10840,59,1,10842,4,7,59,101,108,109,114,115,122,6753,6755,6758,6762,6814,6835,6848,1,8736,59,1,10660,101,59,1,8736,115,100,4,2,59,97,6770,6772,1,8737,4,8,97,98,99,100,101,102,103,104,6790,6793,6796,6799,6802,6805,6808,6811,59,1,10664,59,1,10665,59,1,10666,59,1,10667,59,1,10668,59,1,10669,59,1,10670,59,1,10671,116,4,2,59,118,6821,6823,1,8735,98,4,2,59,100,6830,6832,1,8894,59,1,10653,4,2,112,116,6841,6845,104,59,1,8738,59,1,197,97,114,114,59,1,9084,4,2,103,112,6860,6865,111,110,59,1,261,102,59,3,55349,56658,4,7,59,69,97,101,105,111,112,6886,6888,6891,6897,6900,6904,6908,1,8776,59,1,10864,99,105,114,59,1,10863,59,1,8778,100,59,1,8779,115,59,1,39,114,111,120,4,2,59,101,6917,6919,1,8776,113,59,1,8778,105,110,103,5,229,1,59,6931,1,229,4,3,99,116,121,6941,6946,6949,114,59,3,55349,56502,59,1,42,109,112,4,2,59,101,6957,6959,1,8776,113,59,1,8781,105,108,100,101,5,227,1,59,6972,1,227,109,108,5,228,1,59,6981,1,228,4,2,99,105,6989,6997,111,110,105,110,116,59,1,8755,110,116,59,1,10769,4,16,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,7036,7041,7119,7135,7149,7155,7219,7224,7347,7354,7463,7489,7786,7793,7814,7866,111,116,59,1,10989,4,2,99,114,7047,7094,107,4,4,99,101,112,115,7058,7064,7073,7080,111,110,103,59,1,8780,112,115,105,108,111,110,59,1,1014,114,105,109,101,59,1,8245,105,109,4,2,59,101,7088,7090,1,8765,113,59,1,8909,4,2,118,119,7100,7105,101,101,59,1,8893,101,100,4,2,59,103,7113,7115,1,8965,101,59,1,8965,114,107,4,2,59,116,7127,7129,1,9141,98,114,107,59,1,9142,4,2,111,121,7141,7146,110,103,59,1,8780,59,1,1073,113,117,111,59,1,8222,4,5,99,109,112,114,116,7167,7181,7188,7193,7199,97,117,115,4,2,59,101,7176,7178,1,8757,59,1,8757,112,116,121,118,59,1,10672,115,105,59,1,1014,110,111,117,59,1,8492,4,3,97,104,119,7207,7210,7213,59,1,946,59,1,8502,101,101,110,59,1,8812,114,59,3,55349,56607,103,4,7,99,111,115,116,117,118,119,7241,7262,7288,7305,7328,7335,7340,4,3,97,105,117,7249,7253,7258,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,4,3,100,112,116,7270,7275,7281,111,116,59,1,10752,108,117,115,59,1,10753,105,109,101,115,59,1,10754,4,2,113,116,7294,7300,99,117,112,59,1,10758,97,114,59,1,9733,114,105,97,110,103,108,101,4,2,100,117,7318,7324,111,119,110,59,1,9661,112,59,1,9651,112,108,117,115,59,1,10756,101,101,59,1,8897,101,100,103,101,59,1,8896,97,114,111,119,59,1,10509,4,3,97,107,111,7362,7436,7458,4,2,99,110,7368,7432,107,4,3,108,115,116,7377,7386,7394,111,122,101,110,103,101,59,1,10731,113,117,97,114,101,59,1,9642,114,105,97,110,103,108,101,4,4,59,100,108,114,7411,7413,7419,7425,1,9652,111,119,110,59,1,9662,101,102,116,59,1,9666,105,103,104,116,59,1,9656,107,59,1,9251,4,2,49,51,7442,7454,4,2,50,52,7448,7451,59,1,9618,59,1,9617,52,59,1,9619,99,107,59,1,9608,4,2,101,111,7469,7485,4,2,59,113,7475,7478,3,61,8421,117,105,118,59,3,8801,8421,116,59,1,8976,4,4,112,116,119,120,7499,7504,7517,7523,102,59,3,55349,56659,4,2,59,116,7510,7512,1,8869,111,109,59,1,8869,116,105,101,59,1,8904,4,12,68,72,85,86,98,100,104,109,112,116,117,118,7549,7571,7597,7619,7655,7660,7682,7708,7715,7721,7728,7750,4,4,76,82,108,114,7559,7562,7565,7568,59,1,9559,59,1,9556,59,1,9558,59,1,9555,4,5,59,68,85,100,117,7583,7585,7588,7591,7594,1,9552,59,1,9574,59,1,9577,59,1,9572,59,1,9575,4,4,76,82,108,114,7607,7610,7613,7616,59,1,9565,59,1,9562,59,1,9564,59,1,9561,4,7,59,72,76,82,104,108,114,7635,7637,7640,7643,7646,7649,7652,1,9553,59,1,9580,59,1,9571,59,1,9568,59,1,9579,59,1,9570,59,1,9567,111,120,59,1,10697,4,4,76,82,108,114,7670,7673,7676,7679,59,1,9557,59,1,9554,59,1,9488,59,1,9484,4,5,59,68,85,100,117,7694,7696,7699,7702,7705,1,9472,59,1,9573,59,1,9576,59,1,9516,59,1,9524,105,110,117,115,59,1,8863,108,117,115,59,1,8862,105,109,101,115,59,1,8864,4,4,76,82,108,114,7738,7741,7744,7747,59,1,9563,59,1,9560,59,1,9496,59,1,9492,4,7,59,72,76,82,104,108,114,7766,7768,7771,7774,7777,7780,7783,1,9474,59,1,9578,59,1,9569,59,1,9566,59,1,9532,59,1,9508,59,1,9500,114,105,109,101,59,1,8245,4,2,101,118,7799,7804,118,101,59,1,728,98,97,114,5,166,1,59,7812,1,166,4,4,99,101,105,111,7824,7829,7834,7846,114,59,3,55349,56503,109,105,59,1,8271,109,4,2,59,101,7841,7843,1,8765,59,1,8909,108,4,3,59,98,104,7855,7857,7860,1,92,59,1,10693,115,117,98,59,1,10184,4,2,108,109,7872,7885,108,4,2,59,101,7879,7881,1,8226,116,59,1,8226,112,4,3,59,69,101,7894,7896,7899,1,8782,59,1,10926,4,2,59,113,7905,7907,1,8783,59,1,8783,4,15,97,99,100,101,102,104,105,108,111,114,115,116,117,119,121,7942,8021,8075,8080,8121,8126,8157,8279,8295,8430,8446,8485,8491,8707,8726,4,3,99,112,114,7950,7956,8007,117,116,101,59,1,263,4,6,59,97,98,99,100,115,7970,7972,7977,7984,7998,8003,1,8745,110,100,59,1,10820,114,99,117,112,59,1,10825,4,2,97,117,7990,7994,112,59,1,10827,112,59,1,10823,111,116,59,1,10816,59,3,8745,65024,4,2,101,111,8013,8017,116,59,1,8257,110,59,1,711,4,4,97,101,105,117,8031,8046,8056,8061,4,2,112,114,8037,8041,115,59,1,10829,111,110,59,1,269,100,105,108,5,231,1,59,8054,1,231,114,99,59,1,265,112,115,4,2,59,115,8069,8071,1,10828,109,59,1,10832,111,116,59,1,267,4,3,100,109,110,8088,8097,8104,105,108,5,184,1,59,8095,1,184,112,116,121,118,59,1,10674,116,5,162,2,59,101,8112,8114,1,162,114,100,111,116,59,1,183,114,59,3,55349,56608,4,3,99,101,105,8134,8138,8154,121,59,1,1095,99,107,4,2,59,109,8146,8148,1,10003,97,114,107,59,1,10003,59,1,967,114,4,7,59,69,99,101,102,109,115,8174,8176,8179,8258,8261,8268,8273,1,9675,59,1,10691,4,3,59,101,108,8187,8189,8193,1,710,113,59,1,8791,101,4,2,97,100,8200,8223,114,114,111,119,4,2,108,114,8210,8216,101,102,116,59,1,8634,105,103,104,116,59,1,8635,4,5,82,83,97,99,100,8235,8238,8241,8246,8252,59,1,174,59,1,9416,115,116,59,1,8859,105,114,99,59,1,8858,97,115,104,59,1,8861,59,1,8791,110,105,110,116,59,1,10768,105,100,59,1,10991,99,105,114,59,1,10690,117,98,115,4,2,59,117,8288,8290,1,9827,105,116,59,1,9827,4,4,108,109,110,112,8305,8326,8376,8400,111,110,4,2,59,101,8313,8315,1,58,4,2,59,113,8321,8323,1,8788,59,1,8788,4,2,109,112,8332,8344,97,4,2,59,116,8339,8341,1,44,59,1,64,4,3,59,102,108,8352,8354,8358,1,8705,110,59,1,8728,101,4,2,109,120,8365,8371,101,110,116,59,1,8705,101,115,59,1,8450,4,2,103,105,8382,8395,4,2,59,100,8388,8390,1,8773,111,116,59,1,10861,110,116,59,1,8750,4,3,102,114,121,8408,8412,8417,59,3,55349,56660,111,100,59,1,8720,5,169,2,59,115,8424,8426,1,169,114,59,1,8471,4,2,97,111,8436,8441,114,114,59,1,8629,115,115,59,1,10007,4,2,99,117,8452,8457,114,59,3,55349,56504,4,2,98,112,8463,8474,4,2,59,101,8469,8471,1,10959,59,1,10961,4,2,59,101,8480,8482,1,10960,59,1,10962,100,111,116,59,1,8943,4,7,100,101,108,112,114,118,119,8507,8522,8536,8550,8600,8697,8702,97,114,114,4,2,108,114,8516,8519,59,1,10552,59,1,10549,4,2,112,115,8528,8532,114,59,1,8926,99,59,1,8927,97,114,114,4,2,59,112,8545,8547,1,8630,59,1,10557,4,6,59,98,99,100,111,115,8564,8566,8573,8587,8592,8596,1,8746,114,99,97,112,59,1,10824,4,2,97,117,8579,8583,112,59,1,10822,112,59,1,10826,111,116,59,1,8845,114,59,1,10821,59,3,8746,65024,4,4,97,108,114,118,8610,8623,8663,8672,114,114,4,2,59,109,8618,8620,1,8631,59,1,10556,121,4,3,101,118,119,8632,8651,8656,113,4,2,112,115,8639,8645,114,101,99,59,1,8926,117,99,99,59,1,8927,101,101,59,1,8910,101,100,103,101,59,1,8911,101,110,5,164,1,59,8670,1,164,101,97,114,114,111,119,4,2,108,114,8684,8690,101,102,116,59,1,8630,105,103,104,116,59,1,8631,101,101,59,1,8910,101,100,59,1,8911,4,2,99,105,8713,8721,111,110,105,110,116,59,1,8754,110,116,59,1,8753,108,99,116,121,59,1,9005,4,19,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8773,8778,8783,8821,8839,8854,8887,8914,8930,8944,9036,9041,9058,9197,9227,9258,9281,9297,9305,114,114,59,1,8659,97,114,59,1,10597,4,4,103,108,114,115,8793,8799,8805,8809,103,101,114,59,1,8224,101,116,104,59,1,8504,114,59,1,8595,104,4,2,59,118,8816,8818,1,8208,59,1,8867,4,2,107,108,8827,8834,97,114,111,119,59,1,10511,97,99,59,1,733,4,2,97,121,8845,8851,114,111,110,59,1,271,59,1,1076,4,3,59,97,111,8862,8864,8880,1,8518,4,2,103,114,8870,8876,103,101,114,59,1,8225,114,59,1,8650,116,115,101,113,59,1,10871,4,3,103,108,109,8895,8902,8907,5,176,1,59,8900,1,176,116,97,59,1,948,112,116,121,118,59,1,10673,4,2,105,114,8920,8926,115,104,116,59,1,10623,59,3,55349,56609,97,114,4,2,108,114,8938,8941,59,1,8643,59,1,8642,4,5,97,101,103,115,118,8956,8986,8989,8996,9001,109,4,3,59,111,115,8965,8967,8983,1,8900,110,100,4,2,59,115,8975,8977,1,8900,117,105,116,59,1,9830,59,1,9830,59,1,168,97,109,109,97,59,1,989,105,110,59,1,8946,4,3,59,105,111,9009,9011,9031,1,247,100,101,5,247,2,59,111,9020,9022,1,247,110,116,105,109,101,115,59,1,8903,110,120,59,1,8903,99,121,59,1,1106,99,4,2,111,114,9048,9053,114,110,59,1,8990,111,112,59,1,8973,4,5,108,112,116,117,119,9070,9076,9081,9130,9144,108,97,114,59,1,36,102,59,3,55349,56661,4,5,59,101,109,112,115,9093,9095,9109,9116,9122,1,729,113,4,2,59,100,9102,9104,1,8784,111,116,59,1,8785,105,110,117,115,59,1,8760,108,117,115,59,1,8724,113,117,97,114,101,59,1,8865,98,108,101,98,97,114,119,101,100,103,101,59,1,8966,110,4,3,97,100,104,9153,9160,9172,114,114,111,119,59,1,8595,111,119,110,97,114,114,111,119,115,59,1,8650,97,114,112,111,111,110,4,2,108,114,9184,9190,101,102,116,59,1,8643,105,103,104,116,59,1,8642,4,2,98,99,9203,9211,107,97,114,111,119,59,1,10512,4,2,111,114,9217,9222,114,110,59,1,8991,111,112,59,1,8972,4,3,99,111,116,9235,9248,9252,4,2,114,121,9241,9245,59,3,55349,56505,59,1,1109,108,59,1,10742,114,111,107,59,1,273,4,2,100,114,9264,9269,111,116,59,1,8945,105,4,2,59,102,9276,9278,1,9663,59,1,9662,4,2,97,104,9287,9292,114,114,59,1,8693,97,114,59,1,10607,97,110,103,108,101,59,1,10662,4,2,99,105,9311,9315,121,59,1,1119,103,114,97,114,114,59,1,10239,4,18,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,9361,9376,9398,9439,9444,9447,9462,9495,9531,9585,9598,9614,9659,9755,9771,9792,9808,9826,4,2,68,111,9367,9372,111,116,59,1,10871,116,59,1,8785,4,2,99,115,9382,9392,117,116,101,5,233,1,59,9390,1,233,116,101,114,59,1,10862,4,4,97,105,111,121,9408,9414,9430,9436,114,111,110,59,1,283,114,4,2,59,99,9421,9423,1,8790,5,234,1,59,9428,1,234,108,111,110,59,1,8789,59,1,1101,111,116,59,1,279,59,1,8519,4,2,68,114,9453,9458,111,116,59,1,8786,59,3,55349,56610,4,3,59,114,115,9470,9472,9482,1,10906,97,118,101,5,232,1,59,9480,1,232,4,2,59,100,9488,9490,1,10902,111,116,59,1,10904,4,4,59,105,108,115,9505,9507,9515,9518,1,10905,110,116,101,114,115,59,1,9191,59,1,8467,4,2,59,100,9524,9526,1,10901,111,116,59,1,10903,4,3,97,112,115,9539,9544,9564,99,114,59,1,275,116,121,4,3,59,115,118,9554,9556,9561,1,8709,101,116,59,1,8709,59,1,8709,112,4,2,49,59,9571,9583,4,2,51,52,9577,9580,59,1,8196,59,1,8197,1,8195,4,2,103,115,9591,9594,59,1,331,112,59,1,8194,4,2,103,112,9604,9609,111,110,59,1,281,102,59,3,55349,56662,4,3,97,108,115,9622,9635,9640,114,4,2,59,115,9629,9631,1,8917,108,59,1,10723,117,115,59,1,10865,105,4,3,59,108,118,9649,9651,9656,1,949,111,110,59,1,949,59,1,1013,4,4,99,115,117,118,9669,9686,9716,9747,4,2,105,111,9675,9680,114,99,59,1,8790,108,111,110,59,1,8789,4,2,105,108,9692,9696,109,59,1,8770,97,110,116,4,2,103,108,9705,9710,116,114,59,1,10902,101,115,115,59,1,10901,4,3,97,101,105,9724,9729,9734,108,115,59,1,61,115,116,59,1,8799,118,4,2,59,68,9741,9743,1,8801,68,59,1,10872,112,97,114,115,108,59,1,10725,4,2,68,97,9761,9766,111,116,59,1,8787,114,114,59,1,10609,4,3,99,100,105,9779,9783,9788,114,59,1,8495,111,116,59,1,8784,109,59,1,8770,4,2,97,104,9798,9801,59,1,951,5,240,1,59,9806,1,240,4,2,109,114,9814,9822,108,5,235,1,59,9820,1,235,111,59,1,8364,4,3,99,105,112,9834,9838,9843,108,59,1,33,115,116,59,1,8707,4,2,101,111,9849,9859,99,116,97,116,105,111,110,59,1,8496,110,101,110,116,105,97,108,101,59,1,8519,4,12,97,99,101,102,105,106,108,110,111,112,114,115,9896,9910,9914,9921,9954,9960,9967,9989,9994,10027,10036,10164,108,108,105,110,103,100,111,116,115,101,113,59,1,8786,121,59,1,1092,109,97,108,101,59,1,9792,4,3,105,108,114,9929,9935,9950,108,105,103,59,1,64259,4,2,105,108,9941,9945,103,59,1,64256,105,103,59,1,64260,59,3,55349,56611,108,105,103,59,1,64257,108,105,103,59,3,102,106,4,3,97,108,116,9975,9979,9984,116,59,1,9837,105,103,59,1,64258,110,115,59,1,9649,111,102,59,1,402,4,2,112,114,1e4,10005,102,59,3,55349,56663,4,2,97,107,10011,10016,108,108,59,1,8704,4,2,59,118,10022,10024,1,8916,59,1,10969,97,114,116,105,110,116,59,1,10765,4,2,97,111,10042,10159,4,2,99,115,10048,10155,4,6,49,50,51,52,53,55,10062,10102,10114,10135,10139,10151,4,6,50,51,52,53,54,56,10076,10083,10086,10093,10096,10099,5,189,1,59,10081,1,189,59,1,8531,5,188,1,59,10091,1,188,59,1,8533,59,1,8537,59,1,8539,4,2,51,53,10108,10111,59,1,8532,59,1,8534,4,3,52,53,56,10122,10129,10132,5,190,1,59,10127,1,190,59,1,8535,59,1,8540,53,59,1,8536,4,2,54,56,10145,10148,59,1,8538,59,1,8541,56,59,1,8542,108,59,1,8260,119,110,59,1,8994,99,114,59,3,55349,56507,4,17,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,10206,10217,10247,10254,10268,10273,10358,10363,10374,10380,10385,10406,10458,10464,10470,10497,10610,4,2,59,108,10212,10214,1,8807,59,1,10892,4,3,99,109,112,10225,10231,10244,117,116,101,59,1,501,109,97,4,2,59,100,10239,10241,1,947,59,1,989,59,1,10886,114,101,118,101,59,1,287,4,2,105,121,10260,10265,114,99,59,1,285,59,1,1075,111,116,59,1,289,4,4,59,108,113,115,10283,10285,10288,10308,1,8805,59,1,8923,4,3,59,113,115,10296,10298,10301,1,8805,59,1,8807,108,97,110,116,59,1,10878,4,4,59,99,100,108,10318,10320,10324,10345,1,10878,99,59,1,10921,111,116,4,2,59,111,10332,10334,1,10880,4,2,59,108,10340,10342,1,10882,59,1,10884,4,2,59,101,10351,10354,3,8923,65024,115,59,1,10900,114,59,3,55349,56612,4,2,59,103,10369,10371,1,8811,59,1,8921,109,101,108,59,1,8503,99,121,59,1,1107,4,4,59,69,97,106,10395,10397,10400,10403,1,8823,59,1,10898,59,1,10917,59,1,10916,4,4,69,97,101,115,10416,10419,10434,10453,59,1,8809,112,4,2,59,112,10426,10428,1,10890,114,111,120,59,1,10890,4,2,59,113,10440,10442,1,10888,4,2,59,113,10448,10450,1,10888,59,1,8809,105,109,59,1,8935,112,102,59,3,55349,56664,97,118,101,59,1,96,4,2,99,105,10476,10480,114,59,1,8458,109,4,3,59,101,108,10489,10491,10494,1,8819,59,1,10894,59,1,10896,5,62,6,59,99,100,108,113,114,10512,10514,10527,10532,10538,10545,1,62,4,2,99,105,10520,10523,59,1,10919,114,59,1,10874,111,116,59,1,8919,80,97,114,59,1,10645,117,101,115,116,59,1,10876,4,5,97,100,101,108,115,10557,10574,10579,10599,10605,4,2,112,114,10563,10570,112,114,111,120,59,1,10886,114,59,1,10616,111,116,59,1,8919,113,4,2,108,113,10586,10592,101,115,115,59,1,8923,108,101,115,115,59,1,10892,101,115,115,59,1,8823,105,109,59,1,8819,4,2,101,110,10616,10626,114,116,110,101,113,113,59,3,8809,65024,69,59,3,8809,65024,4,10,65,97,98,99,101,102,107,111,115,121,10653,10658,10713,10718,10724,10760,10765,10786,10850,10875,114,114,59,1,8660,4,4,105,108,109,114,10668,10674,10678,10684,114,115,112,59,1,8202,102,59,1,189,105,108,116,59,1,8459,4,2,100,114,10690,10695,99,121,59,1,1098,4,3,59,99,119,10703,10705,10710,1,8596,105,114,59,1,10568,59,1,8621,97,114,59,1,8463,105,114,99,59,1,293,4,3,97,108,114,10732,10748,10754,114,116,115,4,2,59,117,10741,10743,1,9829,105,116,59,1,9829,108,105,112,59,1,8230,99,111,110,59,1,8889,114,59,3,55349,56613,115,4,2,101,119,10772,10779,97,114,111,119,59,1,10533,97,114,111,119,59,1,10534,4,5,97,109,111,112,114,10798,10803,10809,10839,10844,114,114,59,1,8703,116,104,116,59,1,8763,107,4,2,108,114,10816,10827,101,102,116,97,114,114,111,119,59,1,8617,105,103,104,116,97,114,114,111,119,59,1,8618,102,59,3,55349,56665,98,97,114,59,1,8213,4,3,99,108,116,10858,10863,10869,114,59,3,55349,56509,97,115,104,59,1,8463,114,111,107,59,1,295,4,2,98,112,10881,10887,117,108,108,59,1,8259,104,101,110,59,1,8208,4,15,97,99,101,102,103,105,106,109,110,111,112,113,115,116,117,10925,10936,10958,10977,10990,11001,11039,11045,11101,11192,11220,11226,11237,11285,11299,99,117,116,101,5,237,1,59,10934,1,237,4,3,59,105,121,10944,10946,10955,1,8291,114,99,5,238,1,59,10953,1,238,59,1,1080,4,2,99,120,10964,10968,121,59,1,1077,99,108,5,161,1,59,10975,1,161,4,2,102,114,10983,10986,59,1,8660,59,3,55349,56614,114,97,118,101,5,236,1,59,10999,1,236,4,4,59,105,110,111,11011,11013,11028,11034,1,8520,4,2,105,110,11019,11024,110,116,59,1,10764,116,59,1,8749,102,105,110,59,1,10716,116,97,59,1,8489,108,105,103,59,1,307,4,3,97,111,112,11053,11092,11096,4,3,99,103,116,11061,11065,11088,114,59,1,299,4,3,101,108,112,11073,11076,11082,59,1,8465,105,110,101,59,1,8464,97,114,116,59,1,8465,104,59,1,305,102,59,1,8887,101,100,59,1,437,4,5,59,99,102,111,116,11113,11115,11121,11136,11142,1,8712,97,114,101,59,1,8453,105,110,4,2,59,116,11129,11131,1,8734,105,101,59,1,10717,100,111,116,59,1,305,4,5,59,99,101,108,112,11154,11156,11161,11179,11186,1,8747,97,108,59,1,8890,4,2,103,114,11167,11173,101,114,115,59,1,8484,99,97,108,59,1,8890,97,114,104,107,59,1,10775,114,111,100,59,1,10812,4,4,99,103,112,116,11202,11206,11211,11216,121,59,1,1105,111,110,59,1,303,102,59,3,55349,56666,97,59,1,953,114,111,100,59,1,10812,117,101,115,116,5,191,1,59,11235,1,191,4,2,99,105,11243,11248,114,59,3,55349,56510,110,4,5,59,69,100,115,118,11261,11263,11266,11271,11282,1,8712,59,1,8953,111,116,59,1,8949,4,2,59,118,11277,11279,1,8948,59,1,8947,59,1,8712,4,2,59,105,11291,11293,1,8290,108,100,101,59,1,297,4,2,107,109,11305,11310,99,121,59,1,1110,108,5,239,1,59,11316,1,239,4,6,99,102,109,111,115,117,11332,11346,11351,11357,11363,11380,4,2,105,121,11338,11343,114,99,59,1,309,59,1,1081,114,59,3,55349,56615,97,116,104,59,1,567,112,102,59,3,55349,56667,4,2,99,101,11369,11374,114,59,3,55349,56511,114,99,121,59,1,1112,107,99,121,59,1,1108,4,8,97,99,102,103,104,106,111,115,11404,11418,11433,11438,11445,11450,11455,11461,112,112,97,4,2,59,118,11413,11415,1,954,59,1,1008,4,2,101,121,11424,11430,100,105,108,59,1,311,59,1,1082,114,59,3,55349,56616,114,101,101,110,59,1,312,99,121,59,1,1093,99,121,59,1,1116,112,102,59,3,55349,56668,99,114,59,3,55349,56512,4,23,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,11515,11538,11544,11555,11560,11721,11780,11818,11868,12136,12160,12171,12203,12208,12246,12275,12327,12509,12523,12569,12641,12732,12752,4,3,97,114,116,11523,11528,11532,114,114,59,1,8666,114,59,1,8656,97,105,108,59,1,10523,97,114,114,59,1,10510,4,2,59,103,11550,11552,1,8806,59,1,10891,97,114,59,1,10594,4,9,99,101,103,109,110,112,113,114,116,11580,11586,11594,11600,11606,11624,11627,11636,11694,117,116,101,59,1,314,109,112,116,121,118,59,1,10676,114,97,110,59,1,8466,98,100,97,59,1,955,103,4,3,59,100,108,11615,11617,11620,1,10216,59,1,10641,101,59,1,10216,59,1,10885,117,111,5,171,1,59,11634,1,171,114,4,8,59,98,102,104,108,112,115,116,11655,11657,11669,11673,11677,11681,11685,11690,1,8592,4,2,59,102,11663,11665,1,8676,115,59,1,10527,115,59,1,10525,107,59,1,8617,112,59,1,8619,108,59,1,10553,105,109,59,1,10611,108,59,1,8610,4,3,59,97,101,11702,11704,11709,1,10923,105,108,59,1,10521,4,2,59,115,11715,11717,1,10925,59,3,10925,65024,4,3,97,98,114,11729,11734,11739,114,114,59,1,10508,114,107,59,1,10098,4,2,97,107,11745,11758,99,4,2,101,107,11752,11755,59,1,123,59,1,91,4,2,101,115,11764,11767,59,1,10635,108,4,2,100,117,11774,11777,59,1,10639,59,1,10637,4,4,97,101,117,121,11790,11796,11811,11815,114,111,110,59,1,318,4,2,100,105,11802,11807,105,108,59,1,316,108,59,1,8968,98,59,1,123,59,1,1083,4,4,99,113,114,115,11828,11832,11845,11864,97,59,1,10550,117,111,4,2,59,114,11840,11842,1,8220,59,1,8222,4,2,100,117,11851,11857,104,97,114,59,1,10599,115,104,97,114,59,1,10571,104,59,1,8626,4,5,59,102,103,113,115,11880,11882,12008,12011,12031,1,8804,116,4,5,97,104,108,114,116,11895,11913,11935,11947,11996,114,114,111,119,4,2,59,116,11905,11907,1,8592,97,105,108,59,1,8610,97,114,112,111,111,110,4,2,100,117,11925,11931,111,119,110,59,1,8637,112,59,1,8636,101,102,116,97,114,114,111,119,115,59,1,8647,105,103,104,116,4,3,97,104,115,11959,11974,11984,114,114,111,119,4,2,59,115,11969,11971,1,8596,59,1,8646,97,114,112,111,111,110,115,59,1,8651,113,117,105,103,97,114,114,111,119,59,1,8621,104,114,101,101,116,105,109,101,115,59,1,8907,59,1,8922,4,3,59,113,115,12019,12021,12024,1,8804,59,1,8806,108,97,110,116,59,1,10877,4,5,59,99,100,103,115,12043,12045,12049,12070,12083,1,10877,99,59,1,10920,111,116,4,2,59,111,12057,12059,1,10879,4,2,59,114,12065,12067,1,10881,59,1,10883,4,2,59,101,12076,12079,3,8922,65024,115,59,1,10899,4,5,97,100,101,103,115,12095,12103,12108,12126,12131,112,112,114,111,120,59,1,10885,111,116,59,1,8918,113,4,2,103,113,12115,12120,116,114,59,1,8922,103,116,114,59,1,10891,116,114,59,1,8822,105,109,59,1,8818,4,3,105,108,114,12144,12150,12156,115,104,116,59,1,10620,111,111,114,59,1,8970,59,3,55349,56617,4,2,59,69,12166,12168,1,8822,59,1,10897,4,2,97,98,12177,12198,114,4,2,100,117,12184,12187,59,1,8637,4,2,59,108,12193,12195,1,8636,59,1,10602,108,107,59,1,9604,99,121,59,1,1113,4,5,59,97,99,104,116,12220,12222,12227,12235,12241,1,8810,114,114,59,1,8647,111,114,110,101,114,59,1,8990,97,114,100,59,1,10603,114,105,59,1,9722,4,2,105,111,12252,12258,100,111,116,59,1,320,117,115,116,4,2,59,97,12267,12269,1,9136,99,104,101,59,1,9136,4,4,69,97,101,115,12285,12288,12303,12322,59,1,8808,112,4,2,59,112,12295,12297,1,10889,114,111,120,59,1,10889,4,2,59,113,12309,12311,1,10887,4,2,59,113,12317,12319,1,10887,59,1,8808,105,109,59,1,8934,4,8,97,98,110,111,112,116,119,122,12345,12359,12364,12421,12446,12467,12474,12490,4,2,110,114,12351,12355,103,59,1,10220,114,59,1,8701,114,107,59,1,10214,103,4,3,108,109,114,12373,12401,12409,101,102,116,4,2,97,114,12382,12389,114,114,111,119,59,1,10229,105,103,104,116,97,114,114,111,119,59,1,10231,97,112,115,116,111,59,1,10236,105,103,104,116,97,114,114,111,119,59,1,10230,112,97,114,114,111,119,4,2,108,114,12433,12439,101,102,116,59,1,8619,105,103,104,116,59,1,8620,4,3,97,102,108,12454,12458,12462,114,59,1,10629,59,3,55349,56669,117,115,59,1,10797,105,109,101,115,59,1,10804,4,2,97,98,12480,12485,115,116,59,1,8727,97,114,59,1,95,4,3,59,101,102,12498,12500,12506,1,9674,110,103,101,59,1,9674,59,1,10731,97,114,4,2,59,108,12517,12519,1,40,116,59,1,10643,4,5,97,99,104,109,116,12535,12540,12548,12561,12564,114,114,59,1,8646,111,114,110,101,114,59,1,8991,97,114,4,2,59,100,12556,12558,1,8651,59,1,10605,59,1,8206,114,105,59,1,8895,4,6,97,99,104,105,113,116,12583,12589,12594,12597,12614,12635,113,117,111,59,1,8249,114,59,3,55349,56513,59,1,8624,109,4,3,59,101,103,12606,12608,12611,1,8818,59,1,10893,59,1,10895,4,2,98,117,12620,12623,59,1,91,111,4,2,59,114,12630,12632,1,8216,59,1,8218,114,111,107,59,1,322,5,60,8,59,99,100,104,105,108,113,114,12660,12662,12675,12680,12686,12692,12698,12705,1,60,4,2,99,105,12668,12671,59,1,10918,114,59,1,10873,111,116,59,1,8918,114,101,101,59,1,8907,109,101,115,59,1,8905,97,114,114,59,1,10614,117,101,115,116,59,1,10875,4,2,80,105,12711,12716,97,114,59,1,10646,4,3,59,101,102,12724,12726,12729,1,9667,59,1,8884,59,1,9666,114,4,2,100,117,12739,12746,115,104,97,114,59,1,10570,104,97,114,59,1,10598,4,2,101,110,12758,12768,114,116,110,101,113,113,59,3,8808,65024,69,59,3,8808,65024,4,14,68,97,99,100,101,102,104,105,108,110,111,112,115,117,12803,12809,12893,12908,12914,12928,12933,12937,13011,13025,13032,13049,13052,13069,68,111,116,59,1,8762,4,4,99,108,112,114,12819,12827,12849,12887,114,5,175,1,59,12825,1,175,4,2,101,116,12833,12836,59,1,9794,4,2,59,101,12842,12844,1,10016,115,101,59,1,10016,4,2,59,115,12855,12857,1,8614,116,111,4,4,59,100,108,117,12869,12871,12877,12883,1,8614,111,119,110,59,1,8615,101,102,116,59,1,8612,112,59,1,8613,107,101,114,59,1,9646,4,2,111,121,12899,12905,109,109,97,59,1,10793,59,1,1084,97,115,104,59,1,8212,97,115,117,114,101,100,97,110,103,108,101,59,1,8737,114,59,3,55349,56618,111,59,1,8487,4,3,99,100,110,12945,12954,12985,114,111,5,181,1,59,12952,1,181,4,4,59,97,99,100,12964,12966,12971,12976,1,8739,115,116,59,1,42,105,114,59,1,10992,111,116,5,183,1,59,12983,1,183,117,115,4,3,59,98,100,12995,12997,13e3,1,8722,59,1,8863,4,2,59,117,13006,13008,1,8760,59,1,10794,4,2,99,100,13017,13021,112,59,1,10971,114,59,1,8230,112,108,117,115,59,1,8723,4,2,100,112,13038,13044,101,108,115,59,1,8871,102,59,3,55349,56670,59,1,8723,4,2,99,116,13058,13063,114,59,3,55349,56514,112,111,115,59,1,8766,4,3,59,108,109,13077,13079,13087,1,956,116,105,109,97,112,59,1,8888,97,112,59,1,8888,4,24,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,13142,13165,13217,13229,13247,13330,13359,13414,13420,13508,13513,13579,13602,13626,13631,13762,13767,13855,13936,13995,14214,14285,14312,14432,4,2,103,116,13148,13152,59,3,8921,824,4,2,59,118,13158,13161,3,8811,8402,59,3,8811,824,4,3,101,108,116,13173,13200,13204,102,116,4,2,97,114,13181,13188,114,114,111,119,59,1,8653,105,103,104,116,97,114,114,111,119,59,1,8654,59,3,8920,824,4,2,59,118,13210,13213,3,8810,8402,59,3,8810,824,105,103,104,116,97,114,114,111,119,59,1,8655,4,2,68,100,13235,13241,97,115,104,59,1,8879,97,115,104,59,1,8878,4,5,98,99,110,112,116,13259,13264,13270,13275,13308,108,97,59,1,8711,117,116,101,59,1,324,103,59,3,8736,8402,4,5,59,69,105,111,112,13287,13289,13293,13298,13302,1,8777,59,3,10864,824,100,59,3,8779,824,115,59,1,329,114,111,120,59,1,8777,117,114,4,2,59,97,13316,13318,1,9838,108,4,2,59,115,13325,13327,1,9838,59,1,8469,4,2,115,117,13336,13344,112,5,160,1,59,13342,1,160,109,112,4,2,59,101,13352,13355,3,8782,824,59,3,8783,824,4,5,97,101,111,117,121,13371,13385,13391,13407,13411,4,2,112,114,13377,13380,59,1,10819,111,110,59,1,328,100,105,108,59,1,326,110,103,4,2,59,100,13399,13401,1,8775,111,116,59,3,10861,824,112,59,1,10818,59,1,1085,97,115,104,59,1,8211,4,7,59,65,97,100,113,115,120,13436,13438,13443,13466,13472,13478,13494,1,8800,114,114,59,1,8663,114,4,2,104,114,13450,13454,107,59,1,10532,4,2,59,111,13460,13462,1,8599,119,59,1,8599,111,116,59,3,8784,824,117,105,118,59,1,8802,4,2,101,105,13484,13489,97,114,59,1,10536,109,59,3,8770,824,105,115,116,4,2,59,115,13503,13505,1,8708,59,1,8708,114,59,3,55349,56619,4,4,69,101,115,116,13523,13527,13563,13568,59,3,8807,824,4,3,59,113,115,13535,13537,13559,1,8817,4,3,59,113,115,13545,13547,13551,1,8817,59,3,8807,824,108,97,110,116,59,3,10878,824,59,3,10878,824,105,109,59,1,8821,4,2,59,114,13574,13576,1,8815,59,1,8815,4,3,65,97,112,13587,13592,13597,114,114,59,1,8654,114,114,59,1,8622,97,114,59,1,10994,4,3,59,115,118,13610,13612,13623,1,8715,4,2,59,100,13618,13620,1,8956,59,1,8954,59,1,8715,99,121,59,1,1114,4,7,65,69,97,100,101,115,116,13647,13652,13656,13661,13665,13737,13742,114,114,59,1,8653,59,3,8806,824,114,114,59,1,8602,114,59,1,8229,4,4,59,102,113,115,13675,13677,13703,13725,1,8816,116,4,2,97,114,13684,13691,114,114,111,119,59,1,8602,105,103,104,116,97,114,114,111,119,59,1,8622,4,3,59,113,115,13711,13713,13717,1,8816,59,3,8806,824,108,97,110,116,59,3,10877,824,4,2,59,115,13731,13734,3,10877,824,59,1,8814,105,109,59,1,8820,4,2,59,114,13748,13750,1,8814,105,4,2,59,101,13757,13759,1,8938,59,1,8940,105,100,59,1,8740,4,2,112,116,13773,13778,102,59,3,55349,56671,5,172,3,59,105,110,13787,13789,13829,1,172,110,4,4,59,69,100,118,13800,13802,13806,13812,1,8713,59,3,8953,824,111,116,59,3,8949,824,4,3,97,98,99,13820,13823,13826,59,1,8713,59,1,8951,59,1,8950,105,4,2,59,118,13836,13838,1,8716,4,3,97,98,99,13846,13849,13852,59,1,8716,59,1,8958,59,1,8957,4,3,97,111,114,13863,13892,13899,114,4,4,59,97,115,116,13874,13876,13883,13888,1,8742,108,108,101,108,59,1,8742,108,59,3,11005,8421,59,3,8706,824,108,105,110,116,59,1,10772,4,3,59,99,101,13907,13909,13914,1,8832,117,101,59,1,8928,4,2,59,99,13920,13923,3,10927,824,4,2,59,101,13929,13931,1,8832,113,59,3,10927,824,4,4,65,97,105,116,13946,13951,13971,13982,114,114,59,1,8655,114,114,4,3,59,99,119,13961,13963,13967,1,8603,59,3,10547,824,59,3,8605,824,103,104,116,97,114,114,111,119,59,1,8603,114,105,4,2,59,101,13990,13992,1,8939,59,1,8941,4,7,99,104,105,109,112,113,117,14011,14036,14060,14080,14085,14090,14106,4,4,59,99,101,114,14021,14023,14028,14032,1,8833,117,101,59,1,8929,59,3,10928,824,59,3,55349,56515,111,114,116,4,2,109,112,14045,14050,105,100,59,1,8740,97,114,97,108,108,101,108,59,1,8742,109,4,2,59,101,14067,14069,1,8769,4,2,59,113,14075,14077,1,8772,59,1,8772,105,100,59,1,8740,97,114,59,1,8742,115,117,4,2,98,112,14098,14102,101,59,1,8930,101,59,1,8931,4,3,98,99,112,14114,14157,14171,4,4,59,69,101,115,14124,14126,14130,14133,1,8836,59,3,10949,824,59,1,8840,101,116,4,2,59,101,14141,14144,3,8834,8402,113,4,2,59,113,14151,14153,1,8840,59,3,10949,824,99,4,2,59,101,14164,14166,1,8833,113,59,3,10928,824,4,4,59,69,101,115,14181,14183,14187,14190,1,8837,59,3,10950,824,59,1,8841,101,116,4,2,59,101,14198,14201,3,8835,8402,113,4,2,59,113,14208,14210,1,8841,59,3,10950,824,4,4,103,105,108,114,14224,14228,14238,14242,108,59,1,8825,108,100,101,5,241,1,59,14236,1,241,103,59,1,8824,105,97,110,103,108,101,4,2,108,114,14254,14269,101,102,116,4,2,59,101,14263,14265,1,8938,113,59,1,8940,105,103,104,116,4,2,59,101,14279,14281,1,8939,113,59,1,8941,4,2,59,109,14291,14293,1,957,4,3,59,101,115,14301,14303,14308,1,35,114,111,59,1,8470,112,59,1,8199,4,9,68,72,97,100,103,105,108,114,115,14332,14338,14344,14349,14355,14369,14376,14408,14426,97,115,104,59,1,8877,97,114,114,59,1,10500,112,59,3,8781,8402,97,115,104,59,1,8876,4,2,101,116,14361,14365,59,3,8805,8402,59,3,62,8402,110,102,105,110,59,1,10718,4,3,65,101,116,14384,14389,14393,114,114,59,1,10498,59,3,8804,8402,4,2,59,114,14399,14402,3,60,8402,105,101,59,3,8884,8402,4,2,65,116,14414,14419,114,114,59,1,10499,114,105,101,59,3,8885,8402,105,109,59,3,8764,8402,4,3,65,97,110,14440,14445,14468,114,114,59,1,8662,114,4,2,104,114,14452,14456,107,59,1,10531,4,2,59,111,14462,14464,1,8598,119,59,1,8598,101,97,114,59,1,10535,4,18,83,97,99,100,101,102,103,104,105,108,109,111,112,114,115,116,117,118,14512,14515,14535,14560,14597,14603,14618,14643,14657,14662,14701,14741,14747,14769,14851,14877,14907,14916,59,1,9416,4,2,99,115,14521,14531,117,116,101,5,243,1,59,14529,1,243,116,59,1,8859,4,2,105,121,14541,14557,114,4,2,59,99,14548,14550,1,8858,5,244,1,59,14555,1,244,59,1,1086,4,5,97,98,105,111,115,14572,14577,14583,14587,14591,115,104,59,1,8861,108,97,99,59,1,337,118,59,1,10808,116,59,1,8857,111,108,100,59,1,10684,108,105,103,59,1,339,4,2,99,114,14609,14614,105,114,59,1,10687,59,3,55349,56620,4,3,111,114,116,14626,14630,14640,110,59,1,731,97,118,101,5,242,1,59,14638,1,242,59,1,10689,4,2,98,109,14649,14654,97,114,59,1,10677,59,1,937,110,116,59,1,8750,4,4,97,99,105,116,14672,14677,14693,14698,114,114,59,1,8634,4,2,105,114,14683,14687,114,59,1,10686,111,115,115,59,1,10683,110,101,59,1,8254,59,1,10688,4,3,97,101,105,14709,14714,14719,99,114,59,1,333,103,97,59,1,969,4,3,99,100,110,14727,14733,14736,114,111,110,59,1,959,59,1,10678,117,115,59,1,8854,112,102,59,3,55349,56672,4,3,97,101,108,14755,14759,14764,114,59,1,10679,114,112,59,1,10681,117,115,59,1,8853,4,7,59,97,100,105,111,115,118,14785,14787,14792,14831,14837,14841,14848,1,8744,114,114,59,1,8635,4,4,59,101,102,109,14802,14804,14817,14824,1,10845,114,4,2,59,111,14811,14813,1,8500,102,59,1,8500,5,170,1,59,14822,1,170,5,186,1,59,14829,1,186,103,111,102,59,1,8886,114,59,1,10838,108,111,112,101,59,1,10839,59,1,10843,4,3,99,108,111,14859,14863,14873,114,59,1,8500,97,115,104,5,248,1,59,14871,1,248,108,59,1,8856,105,4,2,108,109,14884,14893,100,101,5,245,1,59,14891,1,245,101,115,4,2,59,97,14901,14903,1,8855,115,59,1,10806,109,108,5,246,1,59,14914,1,246,98,97,114,59,1,9021,4,12,97,99,101,102,104,105,108,109,111,114,115,117,14948,14992,14996,15033,15038,15068,15090,15189,15192,15222,15427,15441,114,4,4,59,97,115,116,14959,14961,14976,14989,1,8741,5,182,2,59,108,14968,14970,1,182,108,101,108,59,1,8741,4,2,105,108,14982,14986,109,59,1,10995,59,1,11005,59,1,8706,121,59,1,1087,114,4,5,99,105,109,112,116,15009,15014,15019,15024,15027,110,116,59,1,37,111,100,59,1,46,105,108,59,1,8240,59,1,8869,101,110,107,59,1,8241,114,59,3,55349,56621,4,3,105,109,111,15046,15057,15063,4,2,59,118,15052,15054,1,966,59,1,981,109,97,116,59,1,8499,110,101,59,1,9742,4,3,59,116,118,15076,15078,15087,1,960,99,104,102,111,114,107,59,1,8916,59,1,982,4,2,97,117,15096,15119,110,4,2,99,107,15103,15115,107,4,2,59,104,15110,15112,1,8463,59,1,8462,118,59,1,8463,115,4,9,59,97,98,99,100,101,109,115,116,15140,15142,15148,15151,15156,15168,15171,15179,15184,1,43,99,105,114,59,1,10787,59,1,8862,105,114,59,1,10786,4,2,111,117,15162,15165,59,1,8724,59,1,10789,59,1,10866,110,5,177,1,59,15177,1,177,105,109,59,1,10790,119,111,59,1,10791,59,1,177,4,3,105,112,117,15200,15208,15213,110,116,105,110,116,59,1,10773,102,59,3,55349,56673,110,100,5,163,1,59,15220,1,163,4,10,59,69,97,99,101,105,110,111,115,117,15244,15246,15249,15253,15258,15334,15347,15367,15416,15421,1,8826,59,1,10931,112,59,1,10935,117,101,59,1,8828,4,2,59,99,15264,15266,1,10927,4,6,59,97,99,101,110,115,15280,15282,15290,15299,15303,15329,1,8826,112,112,114,111,120,59,1,10935,117,114,108,121,101,113,59,1,8828,113,59,1,10927,4,3,97,101,115,15311,15319,15324,112,112,114,111,120,59,1,10937,113,113,59,1,10933,105,109,59,1,8936,105,109,59,1,8830,109,101,4,2,59,115,15342,15344,1,8242,59,1,8473,4,3,69,97,115,15355,15358,15362,59,1,10933,112,59,1,10937,105,109,59,1,8936,4,3,100,102,112,15375,15378,15404,59,1,8719,4,3,97,108,115,15386,15392,15398,108,97,114,59,1,9006,105,110,101,59,1,8978,117,114,102,59,1,8979,4,2,59,116,15410,15412,1,8733,111,59,1,8733,105,109,59,1,8830,114,101,108,59,1,8880,4,2,99,105,15433,15438,114,59,3,55349,56517,59,1,968,110,99,115,112,59,1,8200,4,6,102,105,111,112,115,117,15462,15467,15472,15478,15485,15491,114,59,3,55349,56622,110,116,59,1,10764,112,102,59,3,55349,56674,114,105,109,101,59,1,8279,99,114,59,3,55349,56518,4,3,97,101,111,15499,15520,15534,116,4,2,101,105,15506,15515,114,110,105,111,110,115,59,1,8461,110,116,59,1,10774,115,116,4,2,59,101,15528,15530,1,63,113,59,1,8799,116,5,34,1,59,15540,1,34,4,21,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,15586,15609,15615,15620,15796,15855,15893,15931,15977,16001,16039,16183,16204,16222,16228,16285,16312,16318,16363,16408,16416,4,3,97,114,116,15594,15599,15603,114,114,59,1,8667,114,59,1,8658,97,105,108,59,1,10524,97,114,114,59,1,10511,97,114,59,1,10596,4,7,99,100,101,110,113,114,116,15636,15651,15656,15664,15687,15696,15770,4,2,101,117,15642,15646,59,3,8765,817,116,101,59,1,341,105,99,59,1,8730,109,112,116,121,118,59,1,10675,103,4,4,59,100,101,108,15675,15677,15680,15683,1,10217,59,1,10642,59,1,10661,101,59,1,10217,117,111,5,187,1,59,15694,1,187,114,4,11,59,97,98,99,102,104,108,112,115,116,119,15721,15723,15727,15739,15742,15746,15750,15754,15758,15763,15767,1,8594,112,59,1,10613,4,2,59,102,15733,15735,1,8677,115,59,1,10528,59,1,10547,115,59,1,10526,107,59,1,8618,112,59,1,8620,108,59,1,10565,105,109,59,1,10612,108,59,1,8611,59,1,8605,4,2,97,105,15776,15781,105,108,59,1,10522,111,4,2,59,110,15788,15790,1,8758,97,108,115,59,1,8474,4,3,97,98,114,15804,15809,15814,114,114,59,1,10509,114,107,59,1,10099,4,2,97,107,15820,15833,99,4,2,101,107,15827,15830,59,1,125,59,1,93,4,2,101,115,15839,15842,59,1,10636,108,4,2,100,117,15849,15852,59,1,10638,59,1,10640,4,4,97,101,117,121,15865,15871,15886,15890,114,111,110,59,1,345,4,2,100,105,15877,15882,105,108,59,1,343,108,59,1,8969,98,59,1,125,59,1,1088,4,4,99,108,113,115,15903,15907,15914,15927,97,59,1,10551,100,104,97,114,59,1,10601,117,111,4,2,59,114,15922,15924,1,8221,59,1,8221,104,59,1,8627,4,3,97,99,103,15939,15966,15970,108,4,4,59,105,112,115,15950,15952,15957,15963,1,8476,110,101,59,1,8475,97,114,116,59,1,8476,59,1,8477,116,59,1,9645,5,174,1,59,15975,1,174,4,3,105,108,114,15985,15991,15997,115,104,116,59,1,10621,111,111,114,59,1,8971,59,3,55349,56623,4,2,97,111,16007,16028,114,4,2,100,117,16014,16017,59,1,8641,4,2,59,108,16023,16025,1,8640,59,1,10604,4,2,59,118,16034,16036,1,961,59,1,1009,4,3,103,110,115,16047,16167,16171,104,116,4,6,97,104,108,114,115,116,16063,16081,16103,16130,16143,16155,114,114,111,119,4,2,59,116,16073,16075,1,8594,97,105,108,59,1,8611,97,114,112,111,111,110,4,2,100,117,16093,16099,111,119,110,59,1,8641,112,59,1,8640,101,102,116,4,2,97,104,16112,16120,114,114,111,119,115,59,1,8644,97,114,112,111,111,110,115,59,1,8652,105,103,104,116,97,114,114,111,119,115,59,1,8649,113,117,105,103,97,114,114,111,119,59,1,8605,104,114,101,101,116,105,109,101,115,59,1,8908,103,59,1,730,105,110,103,100,111,116,115,101,113,59,1,8787,4,3,97,104,109,16191,16196,16201,114,114,59,1,8644,97,114,59,1,8652,59,1,8207,111,117,115,116,4,2,59,97,16214,16216,1,9137,99,104,101,59,1,9137,109,105,100,59,1,10990,4,4,97,98,112,116,16238,16252,16257,16278,4,2,110,114,16244,16248,103,59,1,10221,114,59,1,8702,114,107,59,1,10215,4,3,97,102,108,16265,16269,16273,114,59,1,10630,59,3,55349,56675,117,115,59,1,10798,105,109,101,115,59,1,10805,4,2,97,112,16291,16304,114,4,2,59,103,16298,16300,1,41,116,59,1,10644,111,108,105,110,116,59,1,10770,97,114,114,59,1,8649,4,4,97,99,104,113,16328,16334,16339,16342,113,117,111,59,1,8250,114,59,3,55349,56519,59,1,8625,4,2,98,117,16348,16351,59,1,93,111,4,2,59,114,16358,16360,1,8217,59,1,8217,4,3,104,105,114,16371,16377,16383,114,101,101,59,1,8908,109,101,115,59,1,8906,105,4,4,59,101,102,108,16394,16396,16399,16402,1,9657,59,1,8885,59,1,9656,116,114,105,59,1,10702,108,117,104,97,114,59,1,10600,59,1,8478,4,19,97,98,99,100,101,102,104,105,108,109,111,112,113,114,115,116,117,119,122,16459,16466,16472,16572,16590,16672,16687,16746,16844,16850,16924,16963,16988,17115,17121,17154,17206,17614,17656,99,117,116,101,59,1,347,113,117,111,59,1,8218,4,10,59,69,97,99,101,105,110,112,115,121,16494,16496,16499,16513,16518,16531,16536,16556,16564,16569,1,8827,59,1,10932,4,2,112,114,16505,16508,59,1,10936,111,110,59,1,353,117,101,59,1,8829,4,2,59,100,16524,16526,1,10928,105,108,59,1,351,114,99,59,1,349,4,3,69,97,115,16544,16547,16551,59,1,10934,112,59,1,10938,105,109,59,1,8937,111,108,105,110,116,59,1,10771,105,109,59,1,8831,59,1,1089,111,116,4,3,59,98,101,16582,16584,16587,1,8901,59,1,8865,59,1,10854,4,7,65,97,99,109,115,116,120,16606,16611,16634,16642,16646,16652,16668,114,114,59,1,8664,114,4,2,104,114,16618,16622,107,59,1,10533,4,2,59,111,16628,16630,1,8600,119,59,1,8600,116,5,167,1,59,16640,1,167,105,59,1,59,119,97,114,59,1,10537,109,4,2,105,110,16659,16665,110,117,115,59,1,8726,59,1,8726,116,59,1,10038,114,4,2,59,111,16679,16682,3,55349,56624,119,110,59,1,8994,4,4,97,99,111,121,16697,16702,16716,16739,114,112,59,1,9839,4,2,104,121,16708,16713,99,121,59,1,1097,59,1,1096,114,116,4,2,109,112,16724,16729,105,100,59,1,8739,97,114,97,108,108,101,108,59,1,8741,5,173,1,59,16744,1,173,4,2,103,109,16752,16770,109,97,4,3,59,102,118,16762,16764,16767,1,963,59,1,962,59,1,962,4,8,59,100,101,103,108,110,112,114,16788,16790,16795,16806,16817,16828,16832,16838,1,8764,111,116,59,1,10858,4,2,59,113,16801,16803,1,8771,59,1,8771,4,2,59,69,16812,16814,1,10910,59,1,10912,4,2,59,69,16823,16825,1,10909,59,1,10911,101,59,1,8774,108,117,115,59,1,10788,97,114,114,59,1,10610,97,114,114,59,1,8592,4,4,97,101,105,116,16860,16883,16891,16904,4,2,108,115,16866,16878,108,115,101,116,109,105,110,117,115,59,1,8726,104,112,59,1,10803,112,97,114,115,108,59,1,10724,4,2,100,108,16897,16900,59,1,8739,101,59,1,8995,4,2,59,101,16910,16912,1,10922,4,2,59,115,16918,16920,1,10924,59,3,10924,65024,4,3,102,108,112,16932,16938,16958,116,99,121,59,1,1100,4,2,59,98,16944,16946,1,47,4,2,59,97,16952,16954,1,10692,114,59,1,9023,102,59,3,55349,56676,97,4,2,100,114,16970,16985,101,115,4,2,59,117,16978,16980,1,9824,105,116,59,1,9824,59,1,8741,4,3,99,115,117,16996,17028,17089,4,2,97,117,17002,17015,112,4,2,59,115,17009,17011,1,8851,59,3,8851,65024,112,4,2,59,115,17022,17024,1,8852,59,3,8852,65024,117,4,2,98,112,17035,17062,4,3,59,101,115,17043,17045,17048,1,8847,59,1,8849,101,116,4,2,59,101,17056,17058,1,8847,113,59,1,8849,4,3,59,101,115,17070,17072,17075,1,8848,59,1,8850,101,116,4,2,59,101,17083,17085,1,8848,113,59,1,8850,4,3,59,97,102,17097,17099,17112,1,9633,114,4,2,101,102,17106,17109,59,1,9633,59,1,9642,59,1,9642,97,114,114,59,1,8594,4,4,99,101,109,116,17131,17136,17142,17148,114,59,3,55349,56520,116,109,110,59,1,8726,105,108,101,59,1,8995,97,114,102,59,1,8902,4,2,97,114,17160,17172,114,4,2,59,102,17167,17169,1,9734,59,1,9733,4,2,97,110,17178,17202,105,103,104,116,4,2,101,112,17188,17197,112,115,105,108,111,110,59,1,1013,104,105,59,1,981,115,59,1,175,4,5,98,99,109,110,112,17218,17351,17420,17423,17427,4,9,59,69,100,101,109,110,112,114,115,17238,17240,17243,17248,17261,17267,17279,17285,17291,1,8834,59,1,10949,111,116,59,1,10941,4,2,59,100,17254,17256,1,8838,111,116,59,1,10947,117,108,116,59,1,10945,4,2,69,101,17273,17276,59,1,10955,59,1,8842,108,117,115,59,1,10943,97,114,114,59,1,10617,4,3,101,105,117,17299,17335,17339,116,4,3,59,101,110,17308,17310,17322,1,8834,113,4,2,59,113,17317,17319,1,8838,59,1,10949,101,113,4,2,59,113,17330,17332,1,8842,59,1,10955,109,59,1,10951,4,2,98,112,17345,17348,59,1,10965,59,1,10963,99,4,6,59,97,99,101,110,115,17366,17368,17376,17385,17389,17415,1,8827,112,112,114,111,120,59,1,10936,117,114,108,121,101,113,59,1,8829,113,59,1,10928,4,3,97,101,115,17397,17405,17410,112,112,114,111,120,59,1,10938,113,113,59,1,10934,105,109,59,1,8937,105,109,59,1,8831,59,1,8721,103,59,1,9834,4,13,49,50,51,59,69,100,101,104,108,109,110,112,115,17455,17462,17469,17476,17478,17481,17496,17509,17524,17530,17536,17548,17554,5,185,1,59,17460,1,185,5,178,1,59,17467,1,178,5,179,1,59,17474,1,179,1,8835,59,1,10950,4,2,111,115,17487,17491,116,59,1,10942,117,98,59,1,10968,4,2,59,100,17502,17504,1,8839,111,116,59,1,10948,115,4,2,111,117,17516,17520,108,59,1,10185,98,59,1,10967,97,114,114,59,1,10619,117,108,116,59,1,10946,4,2,69,101,17542,17545,59,1,10956,59,1,8843,108,117,115,59,1,10944,4,3,101,105,117,17562,17598,17602,116,4,3,59,101,110,17571,17573,17585,1,8835,113,4,2,59,113,17580,17582,1,8839,59,1,10950,101,113,4,2,59,113,17593,17595,1,8843,59,1,10956,109,59,1,10952,4,2,98,112,17608,17611,59,1,10964,59,1,10966,4,3,65,97,110,17622,17627,17650,114,114,59,1,8665,114,4,2,104,114,17634,17638,107,59,1,10534,4,2,59,111,17644,17646,1,8601,119,59,1,8601,119,97,114,59,1,10538,108,105,103,5,223,1,59,17664,1,223,4,13,97,98,99,100,101,102,104,105,111,112,114,115,119,17694,17709,17714,17737,17742,17749,17754,17860,17905,17957,17964,18090,18122,4,2,114,117,17700,17706,103,101,116,59,1,8982,59,1,964,114,107,59,1,9140,4,3,97,101,121,17722,17728,17734,114,111,110,59,1,357,100,105,108,59,1,355,59,1,1090,111,116,59,1,8411,108,114,101,99,59,1,8981,114,59,3,55349,56625,4,4,101,105,107,111,17764,17805,17836,17851,4,2,114,116,17770,17786,101,4,2,52,102,17777,17780,59,1,8756,111,114,101,59,1,8756,97,4,3,59,115,118,17795,17797,17802,1,952,121,109,59,1,977,59,1,977,4,2,99,110,17811,17831,107,4,2,97,115,17818,17826,112,112,114,111,120,59,1,8776,105,109,59,1,8764,115,112,59,1,8201,4,2,97,115,17842,17846,112,59,1,8776,105,109,59,1,8764,114,110,5,254,1,59,17858,1,254,4,3,108,109,110,17868,17873,17901,100,101,59,1,732,101,115,5,215,3,59,98,100,17884,17886,17898,1,215,4,2,59,97,17892,17894,1,8864,114,59,1,10801,59,1,10800,116,59,1,8749,4,3,101,112,115,17913,17917,17953,97,59,1,10536,4,4,59,98,99,102,17927,17929,17934,17939,1,8868,111,116,59,1,9014,105,114,59,1,10993,4,2,59,111,17945,17948,3,55349,56677,114,107,59,1,10970,97,59,1,10537,114,105,109,101,59,1,8244,4,3,97,105,112,17972,17977,18082,100,101,59,1,8482,4,7,97,100,101,109,112,115,116,17993,18051,18056,18059,18066,18072,18076,110,103,108,101,4,5,59,100,108,113,114,18009,18011,18017,18032,18035,1,9653,111,119,110,59,1,9663,101,102,116,4,2,59,101,18026,18028,1,9667,113,59,1,8884,59,1,8796,105,103,104,116,4,2,59,101,18045,18047,1,9657,113,59,1,8885,111,116,59,1,9708,59,1,8796,105,110,117,115,59,1,10810,108,117,115,59,1,10809,98,59,1,10701,105,109,101,59,1,10811,101,122,105,117,109,59,1,9186,4,3,99,104,116,18098,18111,18116,4,2,114,121,18104,18108,59,3,55349,56521,59,1,1094,99,121,59,1,1115,114,111,107,59,1,359,4,2,105,111,18128,18133,120,116,59,1,8812,104,101,97,100,4,2,108,114,18143,18154,101,102,116,97,114,114,111,119,59,1,8606,105,103,104,116,97,114,114,111,119,59,1,8608,4,18,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,18204,18209,18214,18234,18250,18268,18292,18308,18319,18343,18379,18397,18413,18504,18547,18553,18584,18603,114,114,59,1,8657,97,114,59,1,10595,4,2,99,114,18220,18230,117,116,101,5,250,1,59,18228,1,250,114,59,1,8593,114,4,2,99,101,18241,18245,121,59,1,1118,118,101,59,1,365,4,2,105,121,18256,18265,114,99,5,251,1,59,18263,1,251,59,1,1091,4,3,97,98,104,18276,18281,18287,114,114,59,1,8645,108,97,99,59,1,369,97,114,59,1,10606,4,2,105,114,18298,18304,115,104,116,59,1,10622,59,3,55349,56626,114,97,118,101,5,249,1,59,18317,1,249,4,2,97,98,18325,18338,114,4,2,108,114,18332,18335,59,1,8639,59,1,8638,108,107,59,1,9600,4,2,99,116,18349,18374,4,2,111,114,18355,18369,114,110,4,2,59,101,18363,18365,1,8988,114,59,1,8988,111,112,59,1,8975,114,105,59,1,9720,4,2,97,108,18385,18390,99,114,59,1,363,5,168,1,59,18395,1,168,4,2,103,112,18403,18408,111,110,59,1,371,102,59,3,55349,56678,4,6,97,100,104,108,115,117,18427,18434,18445,18470,18475,18494,114,114,111,119,59,1,8593,111,119,110,97,114,114,111,119,59,1,8597,97,114,112,111,111,110,4,2,108,114,18457,18463,101,102,116,59,1,8639,105,103,104,116,59,1,8638,117,115,59,1,8846,105,4,3,59,104,108,18484,18486,18489,1,965,59,1,978,111,110,59,1,965,112,97,114,114,111,119,115,59,1,8648,4,3,99,105,116,18512,18537,18542,4,2,111,114,18518,18532,114,110,4,2,59,101,18526,18528,1,8989,114,59,1,8989,111,112,59,1,8974,110,103,59,1,367,114,105,59,1,9721,99,114,59,3,55349,56522,4,3,100,105,114,18561,18566,18572,111,116,59,1,8944,108,100,101,59,1,361,105,4,2,59,102,18579,18581,1,9653,59,1,9652,4,2,97,109,18590,18595,114,114,59,1,8648,108,5,252,1,59,18601,1,252,97,110,103,108,101,59,1,10663,4,15,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,18643,18648,18661,18667,18847,18851,18857,18904,18909,18915,18931,18937,18943,18949,18996,114,114,59,1,8661,97,114,4,2,59,118,18656,18658,1,10984,59,1,10985,97,115,104,59,1,8872,4,2,110,114,18673,18679,103,114,116,59,1,10652,4,7,101,107,110,112,114,115,116,18695,18704,18711,18720,18742,18754,18810,112,115,105,108,111,110,59,1,1013,97,112,112,97,59,1,1008,111,116,104,105,110,103,59,1,8709,4,3,104,105,114,18728,18732,18735,105,59,1,981,59,1,982,111,112,116,111,59,1,8733,4,2,59,104,18748,18750,1,8597,111,59,1,1009,4,2,105,117,18760,18766,103,109,97,59,1,962,4,2,98,112,18772,18791,115,101,116,110,101,113,4,2,59,113,18784,18787,3,8842,65024,59,3,10955,65024,115,101,116,110,101,113,4,2,59,113,18803,18806,3,8843,65024,59,3,10956,65024,4,2,104,114,18816,18822,101,116,97,59,1,977,105,97,110,103,108,101,4,2,108,114,18834,18840,101,102,116,59,1,8882,105,103,104,116,59,1,8883,121,59,1,1074,97,115,104,59,1,8866,4,3,101,108,114,18865,18884,18890,4,3,59,98,101,18873,18875,18880,1,8744,97,114,59,1,8891,113,59,1,8794,108,105,112,59,1,8942,4,2,98,116,18896,18901,97,114,59,1,124,59,1,124,114,59,3,55349,56627,116,114,105,59,1,8882,115,117,4,2,98,112,18923,18927,59,3,8834,8402,59,3,8835,8402,112,102,59,3,55349,56679,114,111,112,59,1,8733,116,114,105,59,1,8883,4,2,99,117,18955,18960,114,59,3,55349,56523,4,2,98,112,18966,18981,110,4,2,69,101,18973,18977,59,3,10955,65024,59,3,8842,65024,110,4,2,69,101,18988,18992,59,3,10956,65024,59,3,8843,65024,105,103,122,97,103,59,1,10650,4,7,99,101,102,111,112,114,115,19020,19026,19061,19066,19072,19075,19089,105,114,99,59,1,373,4,2,100,105,19032,19055,4,2,98,103,19038,19043,97,114,59,1,10847,101,4,2,59,113,19050,19052,1,8743,59,1,8793,101,114,112,59,1,8472,114,59,3,55349,56628,112,102,59,3,55349,56680,59,1,8472,4,2,59,101,19081,19083,1,8768,97,116,104,59,1,8768,99,114,59,3,55349,56524,4,14,99,100,102,104,105,108,109,110,111,114,115,117,118,119,19125,19146,19152,19157,19173,19176,19192,19197,19202,19236,19252,19269,19286,19291,4,3,97,105,117,19133,19137,19142,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,116,114,105,59,1,9661,114,59,3,55349,56629,4,2,65,97,19163,19168,114,114,59,1,10234,114,114,59,1,10231,59,1,958,4,2,65,97,19182,19187,114,114,59,1,10232,114,114,59,1,10229,97,112,59,1,10236,105,115,59,1,8955,4,3,100,112,116,19210,19215,19230,111,116,59,1,10752,4,2,102,108,19221,19225,59,3,55349,56681,117,115,59,1,10753,105,109,101,59,1,10754,4,2,65,97,19242,19247,114,114,59,1,10233,114,114,59,1,10230,4,2,99,113,19258,19263,114,59,3,55349,56525,99,117,112,59,1,10758,4,2,112,116,19275,19281,108,117,115,59,1,10756,114,105,59,1,9651,101,101,59,1,8897,101,100,103,101,59,1,8896,4,8,97,99,101,102,105,111,115,117,19316,19335,19349,19357,19362,19367,19373,19379,99,4,2,117,121,19323,19332,116,101,5,253,1,59,19330,1,253,59,1,1103,4,2,105,121,19341,19346,114,99,59,1,375,59,1,1099,110,5,165,1,59,19355,1,165,114,59,3,55349,56630,99,121,59,1,1111,112,102,59,3,55349,56682,99,114,59,3,55349,56526,4,2,99,109,19385,19389,121,59,1,1102,108,5,255,1,59,19395,1,255,4,10,97,99,100,101,102,104,105,111,115,119,19419,19426,19441,19446,19462,19467,19472,19480,19486,19492,99,117,116,101,59,1,378,4,2,97,121,19432,19438,114,111,110,59,1,382,59,1,1079,111,116,59,1,380,4,2,101,116,19452,19458,116,114,102,59,1,8488,97,59,1,950,114,59,3,55349,56631,99,121,59,1,1078,103,114,97,114,114,59,1,8669,112,102,59,3,55349,56683,99,114,59,3,55349,56527,4,2,106,110,19498,19501,59,1,8205,106,59,1,8204])},7118:(e,t,n)=>{"use strict";const r=n(4284),i=n(1734),s=r.CODE_POINTS;e.exports=class{constructor(){this.html=null,this.pos=-1,this.lastGapPos=-1,this.lastCharPos=-1,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536}_err(){}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.lastCharPos){const t=this.html.charCodeAt(this.pos+1);if(r.isSurrogatePair(t))return this.pos++,this._addGap(),r.getSurrogatePairCodePoint(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,s.EOF;return this._err(i.surrogateInInputStream),e}dropParsedChunk(){this.pos>this.bufferWaterline&&(this.lastCharPos-=this.pos,this.html=this.html.substring(this.pos),this.pos=0,this.lastGapPos=-1,this.gapStack=[])}write(e,t){this.html?this.html+=e:this.html=e,this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1,this.html.length),this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1}advance(){if(this.pos++,this.pos>this.lastCharPos)return this.endOfChunkHit=!this.lastChunkWritten,s.EOF;let e=this.html.charCodeAt(this.pos);return this.skipNextNewLine&&e===s.LINE_FEED?(this.skipNextNewLine=!1,this._addGap(),this.advance()):e===s.CARRIAGE_RETURN?(this.skipNextNewLine=!0,s.LINE_FEED):(this.skipNextNewLine=!1,r.isSurrogate(e)&&(e=this._processSurrogate(e)),e>31&&e<127||e===s.LINE_FEED||e===s.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){r.isControlCodePoint(e)?this._err(i.controlCharacterInInputStream):r.isUndefinedCodePoint(e)&&this._err(i.noncharacterInInputStream)}retreat(){this.pos===this.lastGapPos&&(this.lastGapPos=this.gapStack.pop(),this.pos--),this.pos--}}},7296:(e,t,n)=>{"use strict";const{DOCUMENT_MODE:r}=n(6152);t.createDocument=function(){return{nodeName:"#document",mode:r.NO_QUIRKS,childNodes:[]}},t.createDocumentFragment=function(){return{nodeName:"#document-fragment",childNodes:[]}},t.createElement=function(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},t.createCommentNode=function(e){return{nodeName:"#comment",data:e,parentNode:null}};const i=function(e){return{nodeName:"#text",value:e,parentNode:null}},s=t.appendChild=function(e,t){e.childNodes.push(t),t.parentNode=e},o=t.insertBefore=function(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e};t.setTemplateContent=function(e,t){e.content=t},t.getTemplateContent=function(e){return e.content},t.setDocumentType=function(e,t,n,r){let i=null;for(let t=0;t<e.childNodes.length;t++)if("#documentType"===e.childNodes[t].nodeName){i=e.childNodes[t];break}i?(i.name=t,i.publicId=n,i.systemId=r):s(e,{nodeName:"#documentType",name:t,publicId:n,systemId:r})},t.setDocumentMode=function(e,t){e.mode=t},t.getDocumentMode=function(e){return e.mode},t.detachNode=function(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},t.insertText=function(e,t){if(e.childNodes.length){const n=e.childNodes[e.childNodes.length-1];if("#text"===n.nodeName)return void(n.value+=t)}s(e,i(t))},t.insertTextBefore=function(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&"#text"===r.nodeName?r.value+=t:o(e,i(t),n)},t.adoptAttributes=function(e,t){const n=[];for(let t=0;t<e.attrs.length;t++)n.push(e.attrs[t].name);for(let r=0;r<t.length;r++)-1===n.indexOf(t[r].name)&&e.attrs.push(t[r])},t.getFirstChild=function(e){return e.childNodes[0]},t.getChildNodes=function(e){return e.childNodes},t.getParentNode=function(e){return e.parentNode},t.getAttrList=function(e){return e.attrs},t.getTagName=function(e){return e.tagName},t.getNamespaceURI=function(e){return e.namespaceURI},t.getTextNodeContent=function(e){return e.value},t.getCommentNodeContent=function(e){return e.data},t.getDocumentTypeNodeName=function(e){return e.name},t.getDocumentTypeNodePublicId=function(e){return e.publicId},t.getDocumentTypeNodeSystemId=function(e){return e.systemId},t.isTextNode=function(e){return"#text"===e.nodeName},t.isCommentNode=function(e){return"#comment"===e.nodeName},t.isDocumentTypeNode=function(e){return"#documentType"===e.nodeName},t.isElementNode=function(e){return!!e.tagName},t.setNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=t},t.getNodeSourceCodeLocation=function(e){return e.sourceCodeLocation},t.updateNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=Object.assign(e.sourceCodeLocation,t)}},8904:e=>{"use strict";e.exports=function(e,t){return[e,t=t||Object.create(null)].reduce(((e,t)=>(Object.keys(t).forEach((n=>{e[n]=t[n]})),e)),Object.create(null))}},1704:e=>{"use strict";class t{constructor(e){const t={},n=this._getOverriddenMethods(this,t);for(const r of Object.keys(n))"function"==typeof n[r]&&(t[r]=e[r],e[r]=n[r])}_getOverriddenMethods(){throw new Error("Not implemented")}}t.install=function(e,t,n){e.__mixins||(e.__mixins=[]);for(let n=0;n<e.__mixins.length;n++)if(e.__mixins[n].constructor===t)return e.__mixins[n];const r=new t(e,n);return e.__mixins.push(r),r},e.exports=t},2846:e=>{"use strict";e.exports=".nav {\n margin: 0;\n max-width: 150px;\n min-width: 90px;\n justify-content: center;\n align-content: center;\n font-size: 40px;\n color: #ccc;\n text-align: center;\n text-decoration: none;\n text-rendering: auto;\n -webkit-transition: all 350ms ease;\n -moz-transition: all 350ms ease;\n -o-transition: all 350ms ease;\n transition: all 350ms ease\n}\n\n.nav:hover {\n text-decoration: none;\n color: #444\n}\n\n.nav-next {\n float: right;\n display: block;\n}\n\n.nav-prev {\n float: left;\n display: block;\n}\n\n#toc li {\n padding: 0.07rem;\n}\n\nli.current {\n border-radius: 0.5rem;\n background-color: rgb(226, 231, 235);\n /* rgb(226, 231, 235); */\n /* rgb(255, 247, 229); */\n}\n"},2081:e=>{"use strict";e.exports=require("child_process")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},1017:e=>{"use strict";e.exports=require("path")},7461:(e,t,n)=>{const{Argument:r}=n(8998),{Command:i}=n(5282),{CommanderError:s,InvalidArgumentError:o}=n(8056),{Help:a}=n(8917),{Option:c}=n(5790);(t=e.exports=new i).program=t,t.Argument=r,t.Command=i,t.CommanderError=s,t.Help=a,t.InvalidArgumentError=o,t.InvalidOptionArgumentError=o,t.Option=c},8998:(e,t,n)=>{const{InvalidArgumentError:r}=n(8056);t.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e,this.parseArg=(t,n)=>{if(!e.includes(t))throw new r(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},t.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"}},5282:(e,t,n)=>{const r=n(2361).EventEmitter,i=n(2081),s=n(1017),o=n(7147),{Argument:a,humanReadableArgName:c}=n(8998),{CommanderError:l}=n(8056),{Help:u}=n(8917),{Option:h,splitOptionFlags:p}=n(5790);class d extends r{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._outputConfiguration={writeOut:e=>process.stdout.write(e),writeErr:e=>process.stderr.write(e),getOutHelpWidth:()=>process.stdout.isTTY?process.stdout.columns:void 0,getErrHelpWidth:()=>process.stderr.isTTY?process.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this}command(e,t,n){let r=t,i=n;"object"==typeof r&&null!==r&&(i=r,r=null),i=i||{};const[,s,o]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(s);return r&&(a.description(r),a._executableHandler=!0),i.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!i.noHelp&&!i.hidden),a._executableFile=i.executableFile||null,o&&a.arguments(o),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(e){return new d(e)}createHelp(){return Object.assign(new u,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name");return function e(t){t.forEach((t=>{if(t._executableHandler&&!t._executableFile)throw new Error(`Must specify executableFile for deeply nested executable: ${t.name()}`);e(t.commands)}))}(e.commands),(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new a(e,t)}argument(e,t,n,r){const i=this.createArgument(e,t);return"function"==typeof n?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.split(/ +/).forEach((e=>{this.argument(e)})),this}addArgument(e){const t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const n=["preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new l(e,t,n)),process.exit(e)}action(e){return this._actionHandler=t=>{const n=this._args.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new h(e,t)}addOption(e){const t=e.name(),n=e.attributeName();let r=e.defaultValue;if(e.negate||e.optional||e.required||"boolean"==typeof r){if(e.negate){const t=e.long.replace(/^--no-/,"--");r=!this._findOption(t)||this.getOptionValue(n)}void 0!==r&&this.setOptionValue(n,r)}return this.options.push(e),this.on("option:"+t,(t=>{const i=this.getOptionValue(n);if(null!==t&&e.parseArg)try{t=e.parseArg(t,void 0===i?r:i)}catch(n){if("commander.invalidArgument"===n.code){const r=`error: option '${e.flags}' argument '${t}' is invalid. ${n.message}`;this._displayError(n.exitCode,n.code,r)}throw n}else null!==t&&e.variadic&&(t=e._concatValue(t,i));"boolean"==typeof i||void 0===i?null==t?this.setOptionValue(n,!e.negate&&(r||!0)):this.setOptionValue(n,t):null!==t&&this.setOptionValue(n,!e.negate&&t)})),this}_optionEx(e,t,n,r,i){const s=this.createOption(t,n);if(s.makeOptionMandatory(!!e.mandatory),"function"==typeof r)s.default(i).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},s.default(i).argParser(r)}else s.default(r);return this.addOption(s)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let r;switch(t=t||{},void 0===e&&(e=process.argv,process.versions&&process.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":process.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._scriptPath&&n.c[n.s]&&(this._scriptPath=n.c[n.s].filename),this._name=this._name||this._scriptPath&&s.basename(this._scriptPath,s.extname(this._scriptPath)),r}parse(e,t){const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let r=!1;const a=[".js",".ts",".tsx",".mjs",".cjs"];this._checkForMissingMandatoryOptions();let c,u=this._scriptPath;!u&&n.c[n.s]&&(u=n.c[n.s].filename);try{const e=o.realpathSync(u);c=s.dirname(e)}catch(e){c="."}let h=s.basename(u,s.extname(u))+"-"+e._name;e._executableFile&&(h=e._executableFile);const p=s.join(c,h);let d;o.existsSync(p)?h=p:a.forEach((e=>{o.existsSync(`${p}${e}`)&&(h=`${p}${e}`)})),r=a.includes(s.extname(h)),"win32"!==process.platform?r?(t.unshift(h),t=m(process.execArgv).concat(t),d=i.spawn(process.argv[0],t,{stdio:"inherit"})):d=i.spawn(h,t,{stdio:"inherit"}):(t.unshift(h),t=m(process.execArgv).concat(t),d=i.spawn(process.execPath,t,{stdio:"inherit"})),["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{process.on(e,(()=>{!1===d.killed&&null===d.exitCode&&d.kill(e)}))}));const f=this._exitCallback;f?d.on("close",(()=>{f(new l(process.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):d.on("close",process.exit.bind(process)),d.on("error",(t=>{if("ENOENT"===t.code){const t=`'${h}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name`;throw new Error(t)}if("EACCES"===t.code)throw new Error(`'${h}' not executable`);if(f){const e=new l(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,f(e)}else process.exit(1)})),this.runningCommand=d}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);if(r||this.help({error:!0}),!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))}_checkNumberOfArguments(){this._args.forEach(((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg)try{r=e.parseArg(t,n)}catch(n){if("commander.invalidArgument"===n.code){const r=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${n.message}`;this._displayError(n.exitCode,n.code,r)}throw n}return r};this._checkNumberOfArguments();const t=[];this._args.forEach(((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce(((t,r)=>e(n,r,t)),n.defaultValue))):void 0===i&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i})),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then((()=>t())):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return T(this).reverse().filter((e=>void 0!==e._lifeCycleHooks[t])).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{r.push({hookedCommand:e,callback:t})}))})),"postAction"===t&&r.reverse(),r.forEach((e=>{n=this._chainOrCall(n,(()=>e.callback(e.hookedCommand,this)))})),n}_parseCommand(e,t){const n=this.parseOptions(t);if(e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return f(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),f(this,n.unknown),this._checkForMissingMandatoryOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs))),this.parent&&this.parent.emit(i,e,t),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?this.help({error:!0}):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find((t=>t._name===e||t._aliases.includes(e)))}_findOption(e){return this.options.find((t=>t.is(e)))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach((t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)}))}parseOptions(e){const t=[],n=[];let r=t;const i=e.slice();function s(e){return e.length>1&&"-"===e[0]}let o=null;for(;i.length;){const e=i.shift();if("--"===e){r===n&&r.push(e),r.push(...i);break}if(!o||s(e)){if(o=null,s(e)){const t=this._findOption(e);if(t){if(t.required){const e=i.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;i.length>0&&!s(i[0])&&(e=i.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),i.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(s(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(e)){t.push(e),i.length>0&&n.push(...i);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),i.length>0&&t.push(...i);break}if(this._defaultCommandName){n.push(e),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}else this.emit(`option:${o.name()}`,e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}_displayError(e,t,n){this._outputConfiguration.outputError(`${n}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0})),this._exit(e,t,n)}missingArgument(e){const t=`error: missing required argument '${e}'`;this._displayError(1,"commander.missingArgument",t)}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this._displayError(1,"commander.optionMissingArgument",t)}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this._displayError(1,"commander.missingMandatoryOptionValue",t)}unknownOption(e){if(this._allowUnknownOption)return;const t=`error: unknown option '${e}'`;this._displayError(1,"commander.unknownOption",t)}_excessArguments(e){if(this._allowExcessArguments)return;const t=this._args.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this._displayError(1,"commander.excessArguments",r)}unknownCommand(){const e=`error: unknown command '${this.args[0]}'`;this._displayError(1,"commander.unknownCommand",e)}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)})),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach((e=>this.alias(e))),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this._args.map((e=>c(e)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getHelpContext(e);T(this).reverse().forEach((e=>e.emit("beforeAllHelp",n))),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t&&(r=t(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",n),T(this).forEach((e=>e.emit("afterAllHelp",n)))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const n=p(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let t=process.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${e}Help`;return this.on(r,(e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)})),this}}function f(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function m(e){return e.map((e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",i="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],i=n[4]),t&&"0"!==i?`${t}=${r}:${parseInt(i)+1}`:e}))}function T(e){const t=[];for(let n=e;n;n=n.parent)t.push(n);return t}t.Command=d},8056:(e,t)=>{class n extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}t.CommanderError=n,t.InvalidArgumentError=class extends n{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},8917:(e,t,n)=>{const{humanReadableArgName:r}=n(8998);t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));if(e._hasImplicitHelpCommand()){const[,n,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),i=e.createCommand(n).helpOption(!1);i.description(e._helpCommandDescription),r&&i.arguments(r),t.push(i)}return this.sortSubcommands&&t.sort(((e,t)=>e.name().localeCompare(t.name()))),t}visibleOptions(e){const t=e.options.filter((e=>!e.hidden)),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||r){let i;i=n?r?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(i)}if(this.sortOptions){const e=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");t.sort(((t,n)=>e(t).localeCompare(e(n))))}return t}visibleArguments(e){return e._argsDescription&&e._args.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""})),e._args.find((e=>e.description))?e._args:[]}subcommandTerm(e){const t=e._args.map((e=>r(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce(((e,n)=>Math.max(e,t.subcommandTerm(n).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,n)=>Math.max(e,t.argumentTerm(n).length)),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let t=e.parent;t;t=t.parent)n=t.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.description()}optionDescription(e){if(e.negate)return e.description;const t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth||80;function i(e,i){if(i){const s=`${e.padEnd(n+2)}${i}`;return t.wrap(s,r-2,n+2)}return e}function s(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let o=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);a.length>0&&(o=o.concat([a,""]));const c=t.visibleArguments(e).map((e=>i(t.argumentTerm(e),t.argumentDescription(e))));c.length>0&&(o=o.concat(["Arguments:",s(c),""]));const l=t.visibleOptions(e).map((e=>i(t.optionTerm(e),t.optionDescription(e))));l.length>0&&(o=o.concat(["Options:",s(l),""]));const u=t.visibleCommands(e).map((e=>i(t.subcommandTerm(e),t.subcommandDescription(e))));return u.length>0&&(o=o.concat(["Commands:",s(u),""])),o.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){if(e.match(/[\n]\s+/))return e;const i=t-n;if(i<r)return e;const s=e.substr(0,n),o=e.substr(n),a=" ".repeat(n),c=new RegExp(".{1,"+(i-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");return s+(o.match(c)||[]).map(((e,t)=>("\n"===e.slice(-1)&&(e=e.slice(0,e.length-1)),(t>0?a:"")+e.trimRight()))).join("\n")}}},5790:(e,t,n)=>{const{InvalidArgumentError:r}=n(8056);function i(e){let t,n;const r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0),{shortFlag:t,longFlag:n}}t.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=i(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e,this.parseArg=(t,n)=>{if(!e.includes(t))throw new r(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}is(e){return this.short===e||this.long===e}},t.splitOptionFlags=i},366:(e,t,n)=>{"use strict";var r=n(7147),i=n(1017),s=n(7503),o=n(7911);const a=(...e)=>(...t)=>{let n=t;for(let t=0;t<e.length;t++)n=[e[t].apply(void 0,n)];return n[0]},c=(e,t,n,r,i,s)=>{const a=r.clone();let c=0,l=0,u=!1,h=!1;a.find("#content").children().each(((r,p)=>{const d=new o.Cheerio(p);if(!d.hasClass("partintro"))return d.hasClass("sect1")?(u||h?h=!1:(h=!0,u=!0),n(i,a,d,1,"chap",s,++c,h)):d.hasClass("sect0")?(u||h?h=!1:(h=!0,u=!0),t(i,a,d,++l,h)):"preamble"===d.attr("id")?(h=!0,u=!0,e(i,a,d,h)):void 0}))},l=e=>{const t=(n,r,i,s,a,c,l,u)=>{const h=n.depth[l]||n.depth.default,p=u?"index":c(a,s,l);if(h===s)return void e(n,p,r,i,u);const d=`div.sect${s+1}`;var f;e(n,p,r,(f=d,e=>e.clone().find(f).remove().end())(i),u);const m=i.find(d);return 0!==m.length?m.each(((e,i)=>t(n,r,new o.Cheerio(i),s+1,p,c,e+1,!1))):void 0};return t},u=e=>(0===e.find("#toc a[href^=#]").length&&console.log("INFO: Your TOC has no in-document links.\n"),e),h=e=>e.addClass("current");function p(e,t,n){return 1===t?`${e}${n}`:2===t?`${e}_sec${n}`:`${e}-${n}`}const d=function(){return p},f=require("url"),m=r.promises,T=e=>m.mkdir(e,{recursive:!0}).then((t=>e),(e=>e)),_=e=>async t=>{if(await(e=>t=>Promise.allSettled([m.stat(e),m.stat(t)]).then((([e,t])=>"rejected"===t.status||e.value.atimeMs>t.value.atimeMs)))(e)(t)){const n=i.dirname(t);return await E(n)||await T(n),m.copyFile(e,t).then((e=>t))}return!1},E=e=>m.access(e,r.constants.F_OK).then((e=>!0),(e=>!1)),g=/^#|^https:|^http:|^file:|^data:/,A=(e,t)=>n=>{const r=(e=>t=>{const n=i.dirname(e);return i.join(n,t)})(e);(e=>{const t=[];return e.find("link[href], script[src], img[src]").each(((e,n)=>{const r=new o.Cheerio(n),s=r.attr("href")||r.attr("src");s.match(g)||i.isAbsolute(s)||t.push((e=>{const t=i.basename(e),n=t.indexOf("?");return-1===n?e:i.join(i.dirname(e),t.substring(0,n))})(s))})),t})(n).forEach((e=>{return _(r(e))((n=e,i.join(t,n))).catch((t=>console.log(` Local file linked from the document is missing: ${r(e)}`)));var n}))},C=r.promises,N=e=>{if(0===e.length)return e;const t=new Set;return e.each(((e,n)=>{const r=new o.Cheerio(n);if(r.attr("id"))return;const i=r.attr("href");if(t.has(i))return;t.add(i);const s=O(i);r.attr("id",s)})),e},O=e=>`_footnoteref${e.substring(e.lastIndexOf("_"))}`,v=e=>e.find("a.footnote"),b=r.promises,S=e=>("#content",e=>e.find("#content"))(e),y=(e,t)=>(n,r,i,...s)=>{const o=R(t),c=s.map(o),l=i.clone();var u;return a(S,((...e)=>t=>(e.forEach((e=>t.append(e.clone()))),t.end()))(...c),(e=>t=>(a(S,v,e,N)(t),t))(e(l.find("#footnotes"))),L(r,t.get("navigation")),(u=r,e=>(a((e=>t=>t.find(`#toc a[href^="${e}.html"]`).parent())(u),h)(e),e)),x)(l)},I=d(),k=(e,t,r)=>{const s=((e,t)=>{const n=new Map,r={},i=[];let s=0;const a=(e,t)=>{r[t]=s,i[s]=t,s++,e.find("*[id]").each(((e,r)=>{const i=new o.Cheerio(r).attr("id");i.startsWith("_footnotedef_")||n.set(i,`${t}#${i}`)})),e.attr("id")?n.set(e.attr("id"),t):n.set(e.children().first().attr("id"),t)},u=l(((e,t,n,r,i)=>{a(r,i?"index.html":`${t}.html`)}));return c(((e,t,n,r)=>{a(n,r?"index.html":"preamble.html")}),((e,t,n,r,i)=>{a(n,i?"index.html":`part${r}.html`)}),u,e,t,d()),n.set("navigation",{filename2pageNum:r,filenameList:i}),n})(t.root(),r),h=R(s),p=a((e=>t=>{const{strictMode:n}=e,r=t.root().clone().find("#content > #preamble, #content > .partintro, #content > .sect1, #content > .sect0").remove().end(),i=r.find("#content");return n?(i.children().length>0&&(s=i,console.log("INFO: Non-Asciidoc contents encountered under <div id='#content'>.\nINFO: They are ignored and not included in chunked html by default.\nINFO: If you want them to be included, use the '--no-strictMode' command option."),s.html().trim().split(/\n+/).forEach((e=>console.log(`INFO: Found content => ${e}`))),console.log()),i.empty().end()):r;var s})(r),u,h,(m=r.outdir,e=>(e.find("style").each(((e,t)=>{const n=`style${e}.css`,r=new o.Cheerio(t);C.writeFile(i.join(m,n),new o.Cheerio(t).contents().text()),r.replaceWith(new o.Cheerio(`<link rel='stylesheet' href='${n}' type='text/css' />`))})),e)),(e=>t=>{const{css:r,outdir:s}=e;if(!r||0==r.length)return t;const o=t.find("head");return r.forEach((e=>o.append(((e,t)=>{const r=i.basename(t),s=i.join(e,r);return"asciidoctor-chunker.css"===t?Promise.resolve().then(n.t.bind(n,2846,17)).then((e=>C.writeFile(s,e.default))).catch((e=>{const t=i.dirname((0,f.fileURLToPath)("file:///Users/shito/Documents/git-repositories/javascript/asciidoctor-chunker/src/CSS.mjs")),n=i.resolve(t,"css","asciidoctor-chunker.css");_(n)(s)})):_(t)(s),`<link rel="stylesheet" href="${r}" type="text/css" />`})(s,e)))),t})(r),(e=>t=>(new o.Cheerio(`<li><a href="index.html">${e.titlePage}</a></li>`).insertBefore(t.find("div#toc > ul > li:first-child")),t))(r))(t);var m;const T=(E=(e=>{const t=new Set;return e.find("div.footnote").each(((e,n)=>{t.add(new o.Cheerio(n).attr("id"))})),t})(t("#footnotes")),e=>t=>{if(0===t.length)return e.empty().end(),t;const n=new Set([...E]);return t.each(((e,t)=>{n.delete(new o.Cheerio(t).attr("href").substring(1))})),n.forEach((t=>{e.find(`#${t}`).remove().end()})),t});var E;c(((e,t,n)=>(r,i,s,o)=>{const a=o?"index":"preamble";e(a,n(r,a,t,s))})(e,p,y(T,s)),((e,t,n)=>(r,i,s,o,a)=>{const c=a?"index":`part${o}`;e(c,((e,t,n,r,i)=>i(e,t,n,...r.next().hasClass("partintro")?[r,r.next()]:[r]))(r,c,t,s,n))})(e,p,y(T,s)),((e,t,n,r)=>l(((n,i,s,o,a)=>{e(i,r(n,i,t,o))})))(e,p,0,y(T,s)),t.root(),r,I)},R=e=>t=>(t.find("a[href^=#]").each(((t,n)=>{const r=new o.Cheerio(n),i=r.attr("href");if(!i.startsWith("#_footnotedef_")&&!i.startsWith("#_footnoteref_")){const t=i.substring(1),n=e.get(t);if(n)r.attr("href",n);else{const e=r.attr("class")?`${r.attr("class")} target-missing`:"target-missing";r.attr("href",`#${t}`),r.attr("class",e)}}})),t),L=(e,{filename2pageNum:t,filenameList:n})=>r=>{const i=t[`${e}.html`],s=i>0?n[i-1]:null,a=i<n.length-1?n[i+1]:null,c=M(s,a),l=r.find("body > div:last-of-type");return"footer"===l.attr("id")?new o.Cheerio(c).insertBefore(l):new o.Cheerio(c).insertAfter(l),r},M=(e,t)=>`\n<nav>\n ${e?`<a rel="prev" href="${e}" class="nav nav-prev"\n title="Previous page"\n aria-label="Previous page"\n aria-keyshortcuts="Left">\n <i class="fa fa-angle-left"></i>\n </a>`:""}\n ${t?`<a rel="next" href="${t}" class="nav nav-next"\n title="Next page"\n aria-label="Next page"\n aria-keyshortcuts="Right">\n <i class="fa fa-angle-right"></i>\n </a>`:""}\n <div style="clear: both"></div>\n</nav>\n`,x=e=>(e.find("html").append("\n <script>\n function isInViewport(ele) {\n const rect = ele.getBoundingClientRect();\n return (\n rect.top >= 0 &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n );\n }\n function yPosition (ele) {\n const rect = ele.getBoundingClientRect();\n return (rect.top - 20); // 20px above\n }\n let curr = document.getElementsByClassName('current');\n if (!isInViewport(curr[curr.length - 1])) {\n document.getElementById('toc').scrollTo({\n top: yPosition(curr[0]),\n left: 0,\n behavior: 'smooth'\n });\n }\n\n /* For page navigation */\n function gotoPage(selector) {\n const button = document.querySelector(selector);\n if (button)\n window.location.href = button.href;\n }\n document.addEventListener('keydown', e => {\n switch (e.key) {\n case 'ArrowRight':\n e.preventDefault();\n gotoPage('.nav-next');\n break;\n case 'ArrowLeft':\n e.preventDefault();\n gotoPage('.nav-prev');\n break;\n }\n });\n <\/script>\n "),e);var P=n(7461);const D=(e,t)=>e.split(","),w=(e,t)=>{const[n,r]=e.split("-").map((e=>parseInt(e)));return r?new Array(r-n+1).fill(0).reduce(((e,r,i)=>({...e,[i+n]:+t})),{}):{[n]:+t}},H={depth:1,outdir:"html_chunks",css:["asciidoctor-chunker.css"],strictMode:!0,titlePage:"Titlepage"};console.log();const{singleHTML:F,config:U}=(e=>{const t=P.version("1.0.5").name("node asciidoctor-chunker.js").usage("<single.html> [options]").option("-o, --outdir <directory>","The output directory where the chunked html will be written to.","html_chunks").option("--depth <depth specifier>","See the description above.","1").option("--css <paths>","The comma-separated list of css file paths to include. The paths must be accessible from the current directory.",D).option("--no-strictMode","Disables strict mode.").option("--titlePage <title string>","Sets title page TOC string.","Titlepage").description("Description:\n Splits a single html document generated by Asciidoctor into\n multiple chunked html files.\n The default output directory is 'html_chunks'. You can override\n it via the '-o' option.\n\n The default splits are made by preamble, parts, and chapters.\n You can specify the extraction level with the '--depth' option.\n\n If you have any custom elements inserted under <div d=#content>\n in the single-source html, asciidoctor-chunker ignores them by\n default. If you want them to be included into the chunked html,\n set the '--no-strictMode' option. The elements will be copied\n to every chunked page.\n\n By default 'asciidoctor-chunker.css' is included in the\n output directory. It provides the non-opinionated page\n navigation bar at the bottom of every chunked page.\n You can override this by giving a comma-separated list\n of paths to your custom css files. They will be copied\n into the output directory, so their paths must be accessible\n to asciidoctor-chunker.\n\nThe Depth Specifier:\n You can list multiple settings by separating each specifier\n with a comma. Each specifier consists of either a single\n number or two numbers separated by a colon.\n\n A single number sets the default level of extraction.\n Number 1 is the application default and it extracts the\n chapter level. Number 2 is for section extraction, 3 for\n subsection, and so on, up to 6 which is the maximum section\n level of Asciidoctor.\n\n The list of colon-separated numbers, chap:level, can\n change the extraction depth for specific chapters.\n so 3:2 means chapter 3 is extracted down to 2 levels (i.e.\n section level). You can use a hyphen to specify the range\n of chapters to set as chapFrom-chapTo:level, so 1-3:5 means\n chapter 1 through 5 should be extracted with the depth\n level 5.\n\nExample:\n --depth 2 Sets default level 2, all the chapters and\n sections will be extracted.\n --depth 3,1:2,8:5 Sets default level 3, level 2 for Ch. 1,\n and level 5 for Ch. 8.\n --depth 1,3-8:2 Sets default level 1, and level 2 for Chs. 3 to 8.\n --depth 3-8:3 No default is set so default level is 1, and\n level 3 for Chs. 3 to 8.").parse(e),{depth:n,outdir:r,strictMode:i,titlePage:s,css:o=["asciidoctor-chunker.css"]}=t.opts(),a=t.args;1!==a.length&&t.help();const c=(e=>e.split(",").map((e=>{const[t,n]=e.split(":");return n?w(t,n):{default:+t}})).reduce(((e,t)=>({...e,...t})),{default:1}))(n);return{singleHTML:a[0],config:{depth:c,outdir:r,css:o,strictMode:i,titlePage:s}}})(process.argv);(async(e,t=H)=>{const{outdir:n}=t;await E(n)||await T(n);const o=(a=n,(e,t)=>{const n=i.format({dir:a,base:`${e}.html`});b.writeFile(n,t.html()).catch((e=>console.log("File write error:",n)))});var a;const c=(l=e,s.load(r.readFileSync(l)));var l;A(e,n)(c.root()),k(o,c,t),console.log(`Successfully chunked! => ${i.join(n,"index.html")}\n`)})(F,U)},3600:e=>{"use strict";e.exports=JSON.parse('{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}')},9323:e=>{"use strict";e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},9591:e=>{"use strict";e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},2586:e=>{"use strict";e.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return n[e].call(s.exports,s,s.exports,i),s.exports}i.c=r,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var s=Object.create(null);i.r(s);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>n[e]));return o.default=()=>n,i.d(s,o),s},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(i.s=366)})(); \ No newline at end of file
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/__init__.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/__init__.py
new file mode 100644
index 00000000000..1966572ffc4
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/__init__.py
@@ -0,0 +1,20 @@
+from .common import *
+from .decoder import *
+from .encoder import *
+from .extensionstructs import *
+from .frontend import *
+from .functable import *
+from .marshaling import *
+from .reservedmarshaling import *
+from .counting import *
+from .testing import *
+from .transform import *
+from .deepcopy import *
+from .handlemap import *
+from .dispatch import *
+from .unbox import *
+from .decodersnapshot import *
+from .subdecode import *
+from .api_log_decoder import *
+from .vkextensionstructuretype import VulkanGfxstreamStructureType, \
+ VulkanAndroidNativeBufferStructureType
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/api_log_decoder.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/api_log_decoder.py
new file mode 100644
index 00000000000..97930f5f080
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/api_log_decoder.py
@@ -0,0 +1,338 @@
+import os
+from typing import List, Set, Dict, Optional
+
+from . import VulkanType, VulkanCompoundType
+from .wrapperdefs import VulkanWrapperGenerator
+
+
+class ApiLogDecoder(VulkanWrapperGenerator):
+ """
+ This class generates decoding logic for the graphics API logs captured by
+ [GfxApiLogger](http://source/play-internal/battlestar/aosp/device/generic/vulkan-cereal/base/GfxApiLogger.h)
+
+ This allows developers to see a pretty-printed version of the API log data when using
+ print_gfx_logs.py
+ """
+
+ # List of Vulkan APIs that we will generate decoding logic for
+ generated_apis = [
+ "vkAcquireImageANDROID",
+ "vkAllocateMemory",
+ "vkBeginCommandBufferAsyncGOOGLE",
+ "vkBindBufferMemory",
+ "vkBindImageMemory",
+ "vkCmdBeginRenderPass",
+ "vkCmdBindDescriptorSets",
+ "vkCmdBindIndexBuffer",
+ "vkCmdBindPipeline",
+ "vkCmdBindVertexBuffers",
+ "vkCmdClearAttachments",
+ "vkCmdClearColorImage",
+ "vkCmdCopyBufferToImage",
+ "vkCmdCopyImageToBuffer",
+ "vkCmdDraw",
+ "vkCmdDrawIndexed",
+ "vkCmdEndRenderPass",
+ "vkCmdPipelineBarrier",
+ "vkCmdSetScissor",
+ "vkCmdSetViewport",
+ "vkCollectDescriptorPoolIdsGOOGLE",
+ "vkCreateBufferWithRequirementsGOOGLE",
+ "vkCreateDescriptorPool",
+ "vkCreateDescriptorSetLayout",
+ "vkCreateFence",
+ "vkCreateFramebuffer",
+ "vkCreateGraphicsPipelines",
+ "vkCreateImageView",
+ "vkCreateImageWithRequirementsGOOGLE",
+ "vkCreatePipelineCache",
+ "vkCreateRenderPass",
+ "vkCreateSampler",
+ "vkCreateSemaphore",
+ "vkCreateShaderModule",
+ "vkDestroyBuffer",
+ "vkDestroyCommandPool",
+ "vkDestroyDescriptorPool",
+ "vkDestroyDescriptorSetLayout",
+ "vkDestroyDevice",
+ "vkDestroyFence",
+ "vkDestroyFramebuffer",
+ "vkDestroyImage",
+ "vkDestroyImageView",
+ "vkDestroyInstance",
+ "vkDestroyPipeline",
+ "vkDestroyPipelineCache",
+ "vkDestroyPipelineLayout",
+ "vkDestroyRenderPass",
+ "vkDestroySemaphore",
+ "vkDestroyShaderModule",
+ "vkEndCommandBufferAsyncGOOGLE",
+ "vkFreeCommandBuffers",
+ "vkFreeMemory",
+ "vkFreeMemorySyncGOOGLE",
+ "vkGetFenceStatus",
+ "vkGetMemoryHostAddressInfoGOOGLE",
+ "vkGetBlobGOOGLE",
+ "vkGetPhysicalDeviceFormatProperties",
+ "vkGetPhysicalDeviceProperties2KHR",
+ "vkGetPipelineCacheData",
+ "vkGetSwapchainGrallocUsageANDROID",
+ "vkQueueCommitDescriptorSetUpdatesGOOGLE",
+ "vkQueueFlushCommandsGOOGLE",
+ "vkQueueSignalReleaseImageANDROIDAsyncGOOGLE",
+ "vkQueueSubmitAsyncGOOGLE",
+ "vkQueueWaitIdle",
+ "vkResetFences",
+ "vkWaitForFences",
+ ]
+
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+ self.typeInfo = typeInfo
+
+ # Set of Vulkan structs that we need to write decoding logic for
+ self.structs: Set[str] = set()
+
+ # Maps enum group names to the list of enums in the group, for all enum groups in the spec
+ # E.g.: "VkResult": ["VK_SUCCESS", "VK_NOT_READY", "VK_TIMEOUT", etc...]
+ self.all_enums: Dict[str, List[str]] = {}
+
+ # Set of Vulkan enums that we need to write decoding logic for
+ self.needed_enums: Set[str] = {"VkStructureType"}
+
+ def onBegin(self):
+ self.module.append("""
+#####################################################################################################
+# Pretty-printer functions for Vulkan data structures
+# THIS FILE IS AUTO-GENERATED - DO NOT EDIT
+#
+# To re-generate this file, run generate-vulkan-sources.sh
+#####################################################################################################
+
+""".lstrip())
+
+ def onGenGroup(self, groupinfo, groupName, alias=None):
+ """Called for each enum group in the spec"""
+ for enum in groupinfo.elem.findall("enum"):
+ self.all_enums[groupName] = self.all_enums.get(groupName, []) + [enum.get('name')]
+
+ def onEnd(self):
+ for api_name in sorted(self.generated_apis):
+ self.process_api(api_name)
+ self.process_structs()
+ self.process_enums()
+
+ def process_api(self, api_name):
+ """Main entry point to generate decoding logic for each Vulkan API"""
+ api = self.typeInfo.apis[api_name]
+ self.module.append('def OP_{}(printer, indent: int):\n'.format(api_name))
+
+ # Decode the sequence number. All commands have sequence numbers, except those handled
+ # by VkSubdecoder.cpp. The logic here is a bit of a hack since it's based on the command
+ # name. Ideally, we would detect whether a particular command is part of a subdecode block
+ # in the decoding script.
+ if not api_name.startswith("vkCmd") and api_name != "vkBeginCommandBufferAsyncGOOGLE":
+ self.module.append(' printer.write_int("seqno: ", 4, indent)\n')
+
+ for param in api.parameters:
+ # Add any structs that this API uses to the list of structs to write decoding logic for
+ if self.typeInfo.isCompoundType(param.typeName):
+ self.structs.add(param.typeName)
+
+ # Don't try to print the pData field of vkQueueFlushCommandsGOOGLE, those are the
+ # commands processed as part of the subdecode pass
+ if api.name == "vkQueueFlushCommandsGOOGLE" and param.paramName == "pData":
+ continue
+
+ # Write out decoding logic for that parameter
+ self.process_type(param)
+
+ # Finally, add a return statement. This is needed in case the API has no parameters.
+ self.module.append(' return\n\n')
+
+ def process_structs(self):
+ """Writes decoding logic for all the structs that we use"""
+
+ # self.structs now contains all the structs used directly by the Vulkan APIs we use.
+ # Recursively expand this set to add all the structs used by these structs.
+ copy = self.structs.copy()
+ self.structs.clear()
+ for struct_name in copy:
+ self.expand_needed_structs(struct_name)
+
+ # Now we have the full list of structs that we need to write decoding logic for.
+ # Write a decoder for each of them
+ for struct_name in sorted(self.structs):
+ struct = self.typeInfo.structs[struct_name]
+ self.module.append('def struct_{}(printer, indent: int):\n'.format(struct_name))
+ for member in self.get_members(struct):
+ self.process_type(member)
+ self.module.append('\n')
+
+ def expand_needed_structs(self, struct_name: str):
+ """
+ Recursively adds all the structs used by a given struct to the list of structs to process
+ """
+ if struct_name in self.structs:
+ return
+ self.structs.add(struct_name)
+ struct = self.typeInfo.structs[struct_name]
+ for member in self.get_members(struct):
+ if self.typeInfo.isCompoundType(member.typeName):
+ self.expand_needed_structs(member.typeName)
+
+ def get_members(self, struct: VulkanCompoundType):
+ """
+ Returns the members of a struct/union that we need to process.
+ For structs, returns the list of all members
+ For unions, returns a list with just the first member.
+ """
+ return struct.members[0:1] if struct.isUnion else struct.members
+
+ def process_type(self, type: VulkanType):
+ """
+ Writes decoding logic for a single Vulkan type. This could be the parameter in a Vulkan API,
+ or a struct member.
+ """
+ if type.typeName == "VkStructureType":
+ self.module.append(
+ ' printer.write_stype_and_pnext("{}", indent)\n'.format(
+ type.parent.structEnumExpr))
+ return
+
+ if type.isNextPointer():
+ return
+
+ if type.paramName == "commandBuffer":
+ if type.parent.name != "vkQueueFlushCommandsGOOGLE":
+ return
+
+ # Enums
+ if type.isEnum(self.typeInfo):
+ self.needed_enums.add(type.typeName)
+ self.module.append(
+ ' printer.write_enum("{}", {}, indent)\n'.format(
+ type.paramName, type.typeName))
+ return
+
+ # Bitmasks
+ if type.isBitmask(self.typeInfo):
+ enum_type = self.typeInfo.bitmasks.get(type.typeName)
+ if enum_type:
+ self.needed_enums.add(enum_type)
+ self.module.append(
+ ' printer.write_flags("{}", {}, indent)\n'.format(
+ type.paramName, enum_type))
+ return
+ # else, fall through and let the primitive type logic handle it
+
+ # Structs or unions
+ if self.typeInfo.isCompoundType(type.typeName):
+ self.module.append(
+ ' printer.write_struct("{name}", struct_{type}, {optional}, {count}, indent)\n'
+ .format(name=type.paramName,
+ type=type.typeName,
+ optional=type.isOptionalPointer(),
+ count=self.get_length_expression(type)))
+ return
+
+ # Null-terminated strings
+ if type.isString():
+ self.module.append(' printer.write_string("{}", None, indent)\n'.format(
+ type.paramName))
+ return
+
+ # Arrays of primitive types
+ if type.staticArrExpr and type.primitiveEncodingSize and type.primitiveEncodingSize <= 8:
+ # Array sizes are specified either as a number, or as an enum value
+ array_size = int(type.staticArrExpr) if type.staticArrExpr.isdigit() \
+ else self.typeInfo.enumValues.get(type.staticArrExpr)
+ assert array_size is not None, type.staticArrExpr
+
+ if type.typeName == "char":
+ self.module.append(
+ ' printer.write_string("{}", {}, indent)\n'.format(
+ type.paramName, array_size))
+ elif type.typeName == "float":
+ self.module.append(
+ ' printer.write_float("{}", indent, count={})\n'
+ .format(type.paramName, array_size))
+ else:
+ self.module.append(
+ ' printer.write_int("{name}", {int_size}, indent, signed={signed}, count={array_size})\n'
+ .format(name=type.paramName,
+ array_size=array_size,
+ int_size=type.primitiveEncodingSize,
+ signed=type.isSigned()))
+ return
+
+ # Pointers
+ if type.pointerIndirectionLevels > 0:
+ # Assume that all uint32* are always serialized directly rather than passed by pointers.
+ # This is probably not always true (e.g. out params) - fix this as needed.
+ size = 4 if type.primitiveEncodingSize == 4 else 8
+ self.module.append(
+ ' {name} = printer.write_int("{name}", {size}, indent, optional={opt}, count={count}, big_endian={big_endian})\n'
+ .format(name=type.paramName,
+ size=size,
+ opt=type.isOptionalPointer(),
+ count=self.get_length_expression(type),
+ big_endian=self.using_big_endian(type)))
+ return
+
+ # Primitive types (ints, floats)
+ if type.isSimpleValueType(self.typeInfo) and type.primitiveEncodingSize:
+ if type.typeName == "float":
+ self.module.append(
+ ' printer.write_float("{name}", indent)\n'.format(name=type.paramName))
+ else:
+ self.module.append(
+ ' {name} = printer.write_int("{name}", {size}, indent, signed={signed}, big_endian={big_endian})\n'.format(
+ name=type.paramName,
+ size=type.primitiveEncodingSize,
+ signed=type.isSigned(),
+ big_endian=self.using_big_endian(type))
+ )
+ return
+
+ raise NotImplementedError(
+ "No decoding logic for {} {}".format(type.typeName, type.paramName))
+
+ def using_big_endian(self, type: VulkanType):
+ """For some reason gfxstream serializes some types as big endian"""
+ return type.typeName == "size_t"
+
+ def get_length_expression(self, type: VulkanType) -> Optional[str]:
+ """Returns the length expression for a given type"""
+ if type.lenExpr is None:
+ return None
+
+ if type.lenExpr.isalpha():
+ return type.lenExpr
+
+ # There are a couple of instances in the spec where we use a math expression to express the
+ # length (e.g. VkPipelineMultisampleStateCreateInfo). CodeGen().generalLengthAccess() has
+ # logic o parse these expressions correctly, but for now,we just use a simple lookup table.
+ known_expressions = {
+ r"latexmath:[\lceil{\mathit{rasterizationSamples} \over 32}\rceil]":
+ "int(rasterizationSamples / 32)",
+ r"latexmath:[\textrm{codeSize} \over 4]": "int(codeSize / 4)",
+ r"null-terminated": None
+ }
+ if type.lenExpr in known_expressions:
+ return known_expressions[type.lenExpr]
+
+ raise NotImplementedError("Unknown length expression: " + type.lenExpr)
+
+ def process_enums(self):
+ """
+ For each Vulkan enum that we use, write out a python dictionary mapping the enum values back
+ to the enum name as a string
+ """
+ for enum_name in sorted(self.needed_enums):
+ self.module.append('{} = {{\n'.format(enum_name))
+ for identifier in self.all_enums[enum_name]:
+ value = self.typeInfo.enumValues.get(identifier)
+ if value is not None and isinstance(value, int):
+ self.module.append(' {}: "{}",\n'.format(value, identifier))
+ self.module.append('}\n\n')
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/__init__.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/__init__.py
new file mode 100644
index 00000000000..dd6cdc998a7
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/__init__.py
@@ -0,0 +1,2 @@
+from .vulkantypes import *
+from .codegen import *
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/codegen.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/codegen.py
new file mode 100644
index 00000000000..1f217e3bebb
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/codegen.py
@@ -0,0 +1,1074 @@
+# 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.
+
+from .vulkantypes import VulkanType, VulkanTypeInfo, VulkanCompoundType, VulkanAPI
+from collections import OrderedDict
+from copy import copy
+from pathlib import Path, PurePosixPath
+
+import os
+import sys
+import shutil
+import subprocess
+
+# Class capturing a single file
+
+
+class SingleFileModule(object):
+ def __init__(self, suffix, directory, basename, customAbsDir=None, suppress=False):
+ self.directory = directory
+ self.basename = basename
+ self.customAbsDir = customAbsDir
+ self.suffix = suffix
+ self.file = None
+
+ self.preamble = ""
+ self.postamble = ""
+
+ self.suppress = suppress
+
+ def begin(self, globalDir):
+ if self.suppress:
+ return
+
+ # Create subdirectory, if needed
+ if self.customAbsDir:
+ absDir = self.customAbsDir
+ else:
+ absDir = os.path.join(globalDir, self.directory)
+
+ filename = os.path.join(absDir, self.basename)
+
+ self.file = open(filename + self.suffix, "w", encoding="utf-8")
+ self.file.write(self.preamble)
+
+ def append(self, toAppend):
+ if self.suppress:
+ return
+
+ self.file.write(toAppend)
+
+ def end(self):
+ if self.suppress:
+ return
+
+ self.file.write(self.postamble)
+ self.file.close()
+
+ def getMakefileSrcEntry(self):
+ return ""
+
+ def getCMakeSrcEntry(self):
+ return ""
+
+# Class capturing a .cpp file and a .h file (a "C++ module")
+
+
+class Module(object):
+
+ def __init__(
+ self, directory, basename, customAbsDir=None, suppress=False, implOnly=False,
+ headerOnly=False, suppressFeatureGuards=False):
+ self._headerFileModule = SingleFileModule(
+ ".h", directory, basename, customAbsDir, suppress or implOnly)
+ self._implFileModule = SingleFileModule(
+ ".cpp", directory, basename, customAbsDir, suppress or headerOnly)
+
+ self._headerOnly = headerOnly
+ self._implOnly = implOnly
+
+ self.directory = directory
+ self.basename = basename
+ self._customAbsDir = customAbsDir
+
+ self.suppressFeatureGuards = suppressFeatureGuards
+
+ @property
+ def suppress(self):
+ raise AttributeError("suppress is write only")
+
+ @suppress.setter
+ def suppress(self, value: bool):
+ self._headerFileModule.suppress = self._implOnly or value
+ self._implFileModule.suppress = self._headerOnly or value
+
+ @property
+ def headerPreamble(self) -> str:
+ return self._headerFileModule.preamble
+
+ @headerPreamble.setter
+ def headerPreamble(self, value: str):
+ self._headerFileModule.preamble = value
+
+ @property
+ def headerPostamble(self) -> str:
+ return self._headerFileModule.postamble
+
+ @headerPostamble.setter
+ def headerPostamble(self, value: str):
+ self._headerFileModule.postamble = value
+
+ @property
+ def implPreamble(self) -> str:
+ return self._implFileModule.preamble
+
+ @implPreamble.setter
+ def implPreamble(self, value: str):
+ self._implFileModule.preamble = value
+
+ @property
+ def implPostamble(self) -> str:
+ return self._implFileModule.postamble
+
+ @implPostamble.setter
+ def implPostamble(self, value: str):
+ self._implFileModule.postamble = value
+
+ def getMakefileSrcEntry(self):
+ if self._customAbsDir:
+ return self.basename + ".cpp \\\n"
+ dirName = self.directory
+ baseName = self.basename
+ joined = os.path.join(dirName, baseName)
+ return " " + joined + ".cpp \\\n"
+
+ def getCMakeSrcEntry(self):
+ if self._customAbsDir:
+ return "\n" + self.basename + ".cpp "
+ dirName = Path(self.directory)
+ baseName = Path(self.basename)
+ joined = PurePosixPath(dirName / baseName)
+ return "\n " + str(joined) + ".cpp "
+
+ def begin(self, globalDir):
+ self._headerFileModule.begin(globalDir)
+ self._implFileModule.begin(globalDir)
+
+ def appendHeader(self, toAppend):
+ self._headerFileModule.append(toAppend)
+
+ def appendImpl(self, toAppend):
+ self._implFileModule.append(toAppend)
+
+ def end(self):
+ self._headerFileModule.end()
+ self._implFileModule.end()
+
+ clang_format_command = shutil.which('clang-format')
+ assert (clang_format_command is not None)
+
+ def formatFile(filename: Path):
+ assert (subprocess.call([clang_format_command, "-i",
+ "--style=file", str(filename.resolve())]) == 0)
+
+ if not self._headerFileModule.suppress:
+ formatFile(Path(self._headerFileModule.file.name))
+
+ if not self._implFileModule.suppress:
+ formatFile(Path(self._implFileModule.file.name))
+
+
+class PyScript(SingleFileModule):
+ def __init__(self, directory, basename, customAbsDir=None, suppress=False):
+ super().__init__(".py", directory, basename, customAbsDir, suppress)
+
+
+# Class capturing a .proto protobuf definition file
+class Proto(SingleFileModule):
+
+ def __init__(self, directory, basename, customAbsDir=None, suppress=False):
+ super().__init__(".proto", directory, basename, customAbsDir, suppress)
+
+ def getMakefileSrcEntry(self):
+ super().getMakefileSrcEntry()
+ if self.customAbsDir:
+ return self.basename + ".proto \\\n"
+ dirName = self.directory
+ baseName = self.basename
+ joined = os.path.join(dirName, baseName)
+ return " " + joined + ".proto \\\n"
+
+ def getCMakeSrcEntry(self):
+ super().getCMakeSrcEntry()
+ if self.customAbsDir:
+ return "\n" + self.basename + ".proto "
+
+ dirName = self.directory
+ baseName = self.basename
+ joined = os.path.join(dirName, baseName)
+ return "\n " + joined + ".proto "
+
+class CodeGen(object):
+
+ def __init__(self,):
+ self.code = ""
+ self.indentLevel = 0
+ self.gensymCounter = [-1]
+
+ def var(self, prefix="cgen_var"):
+ self.gensymCounter[-1] += 1
+ res = "%s_%s" % (prefix, '_'.join(str(i) for i in self.gensymCounter if i >= 0))
+ return res
+
+ def swapCode(self,):
+ res = "%s" % self.code
+ self.code = ""
+ return res
+
+ def indent(self,extra=0):
+ return "".join(" " * (self.indentLevel + extra))
+
+ def incrIndent(self,):
+ self.indentLevel += 1
+
+ def decrIndent(self,):
+ if self.indentLevel > 0:
+ self.indentLevel -= 1
+
+ def beginBlock(self, bracketPrint=True):
+ if bracketPrint:
+ self.code += self.indent() + "{\n"
+ self.indentLevel += 1
+ self.gensymCounter.append(-1)
+
+ def endBlock(self,bracketPrint=True):
+ self.indentLevel -= 1
+ if bracketPrint:
+ self.code += self.indent() + "}\n"
+ del self.gensymCounter[-1]
+
+ def beginIf(self, cond):
+ self.code += self.indent() + "if (" + cond + ")\n"
+ self.beginBlock()
+
+ def beginElse(self, cond = None):
+ if cond is not None:
+ self.code += \
+ self.indent() + \
+ "else if (" + cond + ")\n"
+ else:
+ self.code += self.indent() + "else\n"
+ self.beginBlock()
+
+ def endElse(self):
+ self.endBlock()
+
+ def endIf(self):
+ self.endBlock()
+
+ def beginSwitch(self, switchvar):
+ self.code += self.indent() + "switch (" + switchvar + ")\n"
+ self.beginBlock()
+
+ def switchCase(self, switchval, blocked = False):
+ self.code += self.indent() + "case %s:" % switchval
+ self.beginBlock(bracketPrint = blocked)
+
+ def switchCaseBreak(self, switchval, blocked = False):
+ self.code += self.indent() + "case %s:" % switchval
+ self.endBlock(bracketPrint = blocked)
+
+ def switchCaseDefault(self, blocked = False):
+ self.code += self.indent() + "default:" % switchval
+ self.beginBlock(bracketPrint = blocked)
+
+ def endSwitch(self):
+ self.endBlock()
+
+ def beginWhile(self, cond):
+ self.code += self.indent() + "while (" + cond + ")\n"
+ self.beginBlock()
+
+ def endWhile(self):
+ self.endBlock()
+
+ def beginFor(self, initial, condition, increment):
+ self.code += \
+ self.indent() + "for (" + \
+ "; ".join([initial, condition, increment]) + \
+ ")\n"
+ self.beginBlock()
+
+ def endFor(self):
+ self.endBlock()
+
+ def beginLoop(self, loopVarType, loopVar, loopInit, loopBound):
+ self.beginFor(
+ "%s %s = %s" % (loopVarType, loopVar, loopInit),
+ "%s < %s" % (loopVar, loopBound),
+ "++%s" % (loopVar))
+
+ def endLoop(self):
+ self.endBlock()
+
+ def stmt(self, code):
+ self.code += self.indent() + code + ";\n"
+
+ def line(self, code):
+ self.code += self.indent() + code + "\n"
+
+ def leftline(self, code):
+ self.code += code + "\n"
+
+ def makeCallExpr(self, funcName, parameters):
+ return funcName + "(%s)" % (", ".join(parameters))
+
+ def funcCall(self, lhs, funcName, parameters):
+ res = self.indent()
+
+ if lhs is not None:
+ res += lhs + " = "
+
+ res += self.makeCallExpr(funcName, parameters) + ";\n"
+ self.code += res
+
+ def funcCallRet(self, _lhs, funcName, parameters):
+ res = self.indent()
+ res += "return " + self.makeCallExpr(funcName, parameters) + ";\n"
+ self.code += res
+
+ # Given a VulkanType object, generate a C type declaration
+ # with optional parameter name:
+ # [const] [typename][*][const*] [paramName]
+ def makeCTypeDecl(self, vulkanType, useParamName=True):
+ constness = "const " if vulkanType.isConst else ""
+ typeName = vulkanType.typeName
+
+ if vulkanType.pointerIndirectionLevels == 0:
+ ptrSpec = ""
+ elif vulkanType.isPointerToConstPointer:
+ ptrSpec = "* const*" if vulkanType.isConst else "**"
+ if vulkanType.pointerIndirectionLevels > 2:
+ ptrSpec += "*" * (vulkanType.pointerIndirectionLevels - 2)
+ else:
+ ptrSpec = "*" * vulkanType.pointerIndirectionLevels
+
+ if useParamName and (vulkanType.paramName is not None):
+ paramStr = (" " + vulkanType.paramName)
+ else:
+ paramStr = ""
+
+ return "%s%s%s%s" % (constness, typeName, ptrSpec, paramStr)
+
+ def makeRichCTypeDecl(self, vulkanType, useParamName=True):
+ constness = "const " if vulkanType.isConst else ""
+ typeName = vulkanType.typeName
+
+ if vulkanType.pointerIndirectionLevels == 0:
+ ptrSpec = ""
+ elif vulkanType.isPointerToConstPointer:
+ ptrSpec = "* const*" if vulkanType.isConst else "**"
+ if vulkanType.pointerIndirectionLevels > 2:
+ ptrSpec += "*" * (vulkanType.pointerIndirectionLevels - 2)
+ else:
+ ptrSpec = "*" * vulkanType.pointerIndirectionLevels
+
+ if useParamName and (vulkanType.paramName is not None):
+ paramStr = (" " + vulkanType.paramName)
+ else:
+ paramStr = ""
+
+ if vulkanType.staticArrExpr:
+ staticArrInfo = "[%s]" % vulkanType.staticArrExpr
+ else:
+ staticArrInfo = ""
+
+ return "%s%s%s%s%s" % (constness, typeName, ptrSpec, paramStr, staticArrInfo)
+
+ # Given a VulkanAPI object, generate the C function protype:
+ # <returntype> <funcname>(<parameters>)
+ def makeFuncProto(self, vulkanApi, useParamName=True):
+
+ protoBegin = "%s %s" % (self.makeCTypeDecl(
+ vulkanApi.retType, useParamName=False), vulkanApi.name)
+
+ def getFuncArgDecl(param):
+ if param.staticArrExpr:
+ return self.makeCTypeDecl(param, useParamName=useParamName) + ("[%s]" % param.staticArrExpr)
+ else:
+ return self.makeCTypeDecl(param, useParamName=useParamName)
+
+ protoParams = "(\n %s)" % ((",\n%s" % self.indent(1)).join(
+ list(map(
+ getFuncArgDecl,
+ vulkanApi.parameters))))
+
+ return protoBegin + protoParams
+
+ def makeFuncAlias(self, nameDst, nameSrc):
+ return "DEFINE_ALIAS_FUNCTION({}, {})\n\n".format(nameSrc, nameDst)
+
+ def makeFuncDecl(self, vulkanApi):
+ return self.makeFuncProto(vulkanApi) + ";\n\n"
+
+ def makeFuncImpl(self, vulkanApi, codegenFunc):
+ self.swapCode()
+
+ self.line(self.makeFuncProto(vulkanApi))
+ self.beginBlock()
+ codegenFunc(self)
+ self.endBlock()
+
+ return self.swapCode() + "\n"
+
+ def emitFuncImpl(self, vulkanApi, codegenFunc):
+ self.line(self.makeFuncProto(vulkanApi))
+ self.beginBlock()
+ codegenFunc(self)
+ self.endBlock()
+
+ def makeStructAccess(self,
+ vulkanType,
+ structVarName,
+ asPtr=True,
+ structAsPtr=True,
+ accessIndex=None):
+
+ deref = "->" if structAsPtr else "."
+
+ indexExpr = (" + %s" % accessIndex) if accessIndex else ""
+
+ addrOfExpr = "" if vulkanType.accessibleAsPointer() or (
+ not asPtr) else "&"
+
+ return "%s%s%s%s%s" % (addrOfExpr, structVarName, deref,
+ vulkanType.paramName, indexExpr)
+
+ def makeRawLengthAccess(self, vulkanType):
+ lenExpr = vulkanType.getLengthExpression()
+
+ if not lenExpr:
+ return None, None
+
+ if lenExpr == "null-terminated":
+ return "strlen(%s)" % vulkanType.paramName, None
+
+ return lenExpr, None
+
+ def makeLengthAccessFromStruct(self,
+ structInfo,
+ vulkanType,
+ structVarName,
+ asPtr=True):
+ # Handle special cases first
+ # Mostly when latexmath is involved
+ def handleSpecialCases(structInfo, vulkanType, structVarName, asPtr):
+ cases = [
+ {
+ "structName": "VkShaderModuleCreateInfo",
+ "field": "pCode",
+ "lenExprMember": "codeSize",
+ "postprocess": lambda expr: "(%s / 4)" % expr
+ },
+ {
+ "structName": "VkPipelineMultisampleStateCreateInfo",
+ "field": "pSampleMask",
+ "lenExprMember": "rasterizationSamples",
+ "postprocess": lambda expr: "(((%s) + 31) / 32)" % expr
+ },
+ {
+ "structName": "VkAccelerationStructureVersionInfoKHR",
+ "field": "pVersionData",
+ "lenExprMember": "",
+ "postprocess": lambda _: "2*VK_UUID_SIZE"
+ },
+ ]
+
+ for c in cases:
+ if (structInfo.name, vulkanType.paramName) == (c["structName"],
+ c["field"]):
+ deref = "->" if asPtr else "."
+ expr = "%s%s%s" % (structVarName, deref,
+ c["lenExprMember"])
+ lenAccessGuardExpr = "%s" % structVarName
+ return c["postprocess"](expr), lenAccessGuardExpr
+
+ return None, None
+
+ specialCaseAccess = \
+ handleSpecialCases(
+ structInfo, vulkanType, structVarName, asPtr)
+
+ if specialCaseAccess != (None, None):
+ return specialCaseAccess
+
+ lenExpr = vulkanType.getLengthExpression()
+
+ if not lenExpr:
+ return None, None
+
+ deref = "->" if asPtr else "."
+ lenAccessGuardExpr = "%s" % (
+
+ structVarName) if deref else None
+ if lenExpr == "null-terminated":
+ return "strlen(%s%s%s)" % (structVarName, deref,
+ vulkanType.paramName), lenAccessGuardExpr
+
+ if not structInfo.getMember(lenExpr):
+ return self.makeRawLengthAccess(vulkanType)
+
+ return "%s%s%s" % (structVarName, deref, lenExpr), lenAccessGuardExpr
+
+ def makeLengthAccessFromApi(self, api, vulkanType):
+ # Handle special cases first
+ # Mostly when :: is involved
+ def handleSpecialCases(vulkanType):
+ lenExpr = vulkanType.getLengthExpression()
+
+ if lenExpr is None:
+ return None, None
+
+ if "::" in lenExpr:
+ structVarName, memberVarName = lenExpr.split("::")
+ lenAccessGuardExpr = "%s" % (structVarName)
+ return "%s->%s" % (structVarName, memberVarName), lenAccessGuardExpr
+ return None, None
+
+ specialCaseAccess = handleSpecialCases(vulkanType)
+
+ if specialCaseAccess != (None, None):
+ return specialCaseAccess
+
+ lenExpr = vulkanType.getLengthExpression()
+
+ if not lenExpr:
+ return None, None
+
+ lenExprInfo = api.getParameter(lenExpr)
+
+ if not lenExprInfo:
+ return self.makeRawLengthAccess(vulkanType)
+
+ if lenExpr == "null-terminated":
+ return "strlen(%s)" % vulkanType.paramName(), None
+ else:
+ deref = "*" if lenExprInfo.pointerIndirectionLevels > 0 else ""
+ lenAccessGuardExpr = "%s" % lenExpr if deref else None
+ return "(%s(%s))" % (deref, lenExpr), lenAccessGuardExpr
+
+ def accessParameter(self, param, asPtr=True):
+ if asPtr:
+ if param.pointerIndirectionLevels > 0:
+ return param.paramName
+ else:
+ return "&%s" % param.paramName
+ else:
+ return param.paramName
+
+ def sizeofExpr(self, vulkanType):
+ return "sizeof(%s)" % (
+ self.makeCTypeDecl(vulkanType, useParamName=False))
+
+ def generalAccess(self,
+ vulkanType,
+ parentVarName=None,
+ asPtr=True,
+ structAsPtr=True):
+ if vulkanType.parent is None:
+ if parentVarName is None:
+ return self.accessParameter(vulkanType, asPtr=asPtr)
+ else:
+ return self.accessParameter(vulkanType.withModifiedName(parentVarName), asPtr=asPtr)
+
+ if isinstance(vulkanType.parent, VulkanCompoundType):
+ return self.makeStructAccess(
+ vulkanType, parentVarName, asPtr=asPtr, structAsPtr=structAsPtr)
+
+ if isinstance(vulkanType.parent, VulkanAPI):
+ if parentVarName is None:
+ return self.accessParameter(vulkanType, asPtr=asPtr)
+ else:
+ return self.accessParameter(vulkanType.withModifiedName(parentVarName), asPtr=asPtr)
+
+ os.abort("Could not find a way to access Vulkan type %s" %
+ vulkanType.name)
+
+ def makeLengthAccess(self, vulkanType, parentVarName="parent"):
+ if vulkanType.parent is None:
+ return self.makeRawLengthAccess(vulkanType)
+
+ if isinstance(vulkanType.parent, VulkanCompoundType):
+ return self.makeLengthAccessFromStruct(
+ vulkanType.parent, vulkanType, parentVarName, asPtr=True)
+
+ if isinstance(vulkanType.parent, VulkanAPI):
+ return self.makeLengthAccessFromApi(vulkanType.parent, vulkanType)
+
+ os.abort("Could not find a way to access length of Vulkan type %s" %
+ vulkanType.name)
+
+ def generalLengthAccess(self, vulkanType, parentVarName="parent"):
+ return self.makeLengthAccess(vulkanType, parentVarName)[0]
+
+ def generalLengthAccessGuard(self, vulkanType, parentVarName="parent"):
+ return self.makeLengthAccess(vulkanType, parentVarName)[1]
+
+ def vkApiCall(self, api, customPrefix="", globalStatePrefix="", customParameters=None, checkForDeviceLost=False, checkForOutOfMemory=False):
+ callLhs = None
+
+ retTypeName = api.getRetTypeExpr()
+ retVar = None
+
+ if retTypeName != "void":
+ retVar = api.getRetVarExpr()
+ self.stmt("%s %s = (%s)0" % (retTypeName, retVar, retTypeName))
+ callLhs = retVar
+
+ if customParameters is None:
+ self.funcCall(
+ callLhs, customPrefix + api.name, [p.paramName for p in api.parameters])
+ else:
+ self.funcCall(
+ callLhs, customPrefix + api.name, customParameters)
+
+ if retTypeName == "VkResult" and checkForDeviceLost:
+ self.stmt("if ((%s) == VK_ERROR_DEVICE_LOST) %sDeviceLost()" % (callLhs, globalStatePrefix))
+
+ if retTypeName == "VkResult" and checkForOutOfMemory:
+ if api.name == "vkAllocateMemory":
+ self.stmt(
+ "%sCheckOutOfMemory(%s, opcode, context, std::make_optional<uint64_t>(pAllocateInfo->allocationSize))"
+ % (globalStatePrefix, callLhs))
+ else:
+ self.stmt(
+ "%sCheckOutOfMemory(%s, opcode, context)"
+ % (globalStatePrefix, callLhs))
+
+ return (retTypeName, retVar)
+
+ def makeCheckVkSuccess(self, expr):
+ return "((%s) == VK_SUCCESS)" % expr
+
+ def makeReinterpretCast(self, varName, typeName, const=True):
+ return "reinterpret_cast<%s%s*>(%s)" % \
+ ("const " if const else "", typeName, varName)
+
+ def validPrimitive(self, typeInfo, typeName):
+ size = typeInfo.getPrimitiveEncodingSize(typeName)
+ return size != None
+
+ def makePrimitiveStreamMethod(self, typeInfo, typeName, direction="write"):
+ if not self.validPrimitive(typeInfo, typeName):
+ return None
+
+ size = typeInfo.getPrimitiveEncodingSize(typeName)
+ prefix = "put" if direction == "write" else "get"
+ suffix = None
+ if size == 1:
+ suffix = "Byte"
+ elif size == 2:
+ suffix = "Be16"
+ elif size == 4:
+ suffix = "Be32"
+ elif size == 8:
+ suffix = "Be64"
+
+ if suffix:
+ return prefix + suffix
+
+ return None
+
+ def makePrimitiveStreamMethodInPlace(self, typeInfo, typeName, direction="write"):
+ if not self.validPrimitive(typeInfo, typeName):
+ return None
+
+ size = typeInfo.getPrimitiveEncodingSize(typeName)
+ prefix = "to" if direction == "write" else "from"
+ suffix = None
+ if size == 1:
+ suffix = "Byte"
+ elif size == 2:
+ suffix = "Be16"
+ elif size == 4:
+ suffix = "Be32"
+ elif size == 8:
+ suffix = "Be64"
+
+ if suffix:
+ return prefix + suffix
+
+ return None
+
+ def streamPrimitive(self, typeInfo, streamVar, accessExpr, accessType, direction="write"):
+ accessTypeName = accessType.typeName
+
+ if accessType.pointerIndirectionLevels == 0 and not self.validPrimitive(typeInfo, accessTypeName):
+ print("Tried to stream a non-primitive type: %s" % accessTypeName)
+ os.abort()
+
+ needPtrCast = False
+
+ if accessType.pointerIndirectionLevels > 0:
+ streamSize = 8
+ streamStorageVarType = "uint64_t"
+ needPtrCast = True
+ streamMethod = "putBe64" if direction == "write" else "getBe64"
+ else:
+ streamSize = typeInfo.getPrimitiveEncodingSize(accessTypeName)
+ if streamSize == 1:
+ streamStorageVarType = "uint8_t"
+ elif streamSize == 2:
+ streamStorageVarType = "uint16_t"
+ elif streamSize == 4:
+ streamStorageVarType = "uint32_t"
+ elif streamSize == 8:
+ streamStorageVarType = "uint64_t"
+ streamMethod = self.makePrimitiveStreamMethod(
+ typeInfo, accessTypeName, direction=direction)
+
+ streamStorageVar = self.var()
+
+ accessCast = self.makeRichCTypeDecl(accessType, useParamName=False)
+
+ ptrCast = "(uintptr_t)" if needPtrCast else ""
+
+ if direction == "read":
+ self.stmt("%s = (%s)%s%s->%s()" %
+ (accessExpr,
+ accessCast,
+ ptrCast,
+ streamVar,
+ streamMethod))
+ else:
+ self.stmt("%s %s = (%s)%s%s" %
+ (streamStorageVarType, streamStorageVar,
+ streamStorageVarType, ptrCast, accessExpr))
+ self.stmt("%s->%s(%s)" %
+ (streamVar, streamMethod, streamStorageVar))
+
+ def memcpyPrimitive(self, typeInfo, streamVar, accessExpr, accessType, variant, direction="write"):
+ accessTypeName = accessType.typeName
+
+ if accessType.pointerIndirectionLevels == 0 and not self.validPrimitive(typeInfo, accessTypeName):
+ print("Tried to stream a non-primitive type: %s" % accessTypeName)
+ os.abort()
+
+ needPtrCast = False
+
+ streamSize = 8
+
+ if accessType.pointerIndirectionLevels > 0:
+ streamSize = 8
+ streamStorageVarType = "uint64_t"
+ needPtrCast = True
+ streamMethod = "toBe64" if direction == "write" else "fromBe64"
+ else:
+ streamSize = typeInfo.getPrimitiveEncodingSize(accessTypeName)
+ if streamSize == 1:
+ streamStorageVarType = "uint8_t"
+ elif streamSize == 2:
+ streamStorageVarType = "uint16_t"
+ elif streamSize == 4:
+ streamStorageVarType = "uint32_t"
+ elif streamSize == 8:
+ streamStorageVarType = "uint64_t"
+ streamMethod = self.makePrimitiveStreamMethodInPlace(
+ typeInfo, accessTypeName, direction=direction)
+
+ streamStorageVar = self.var()
+
+ accessCast = self.makeRichCTypeDecl(accessType, useParamName=False)
+
+ if direction == "read":
+ accessCast = self.makeRichCTypeDecl(
+ accessType.getForNonConstAccess(), useParamName=False)
+
+ ptrCast = "(uintptr_t)" if needPtrCast else ""
+
+ streamNamespace = "gfxstream::guest" if variant == "guest" else "android::base"
+
+ if direction == "read":
+ self.stmt("memcpy((%s*)&%s, %s, %s)" %
+ (accessCast,
+ accessExpr,
+ streamVar,
+ str(streamSize)))
+ self.stmt("%s::Stream::%s((uint8_t*)&%s)" % (
+ streamNamespace,
+ streamMethod,
+ accessExpr))
+ else:
+ self.stmt("%s %s = (%s)%s%s" %
+ (streamStorageVarType, streamStorageVar,
+ streamStorageVarType, ptrCast, accessExpr))
+ self.stmt("memcpy(%s, &%s, %s)" %
+ (streamVar, streamStorageVar, str(streamSize)))
+ self.stmt("%s::Stream::%s((uint8_t*)%s)" % (
+ streamNamespace,
+ streamMethod,
+ streamVar))
+
+ def countPrimitive(self, typeInfo, accessType):
+ accessTypeName = accessType.typeName
+
+ if accessType.pointerIndirectionLevels == 0 and not self.validPrimitive(typeInfo, accessTypeName):
+ print("Tried to count a non-primitive type: %s" % accessTypeName)
+ os.abort()
+
+ needPtrCast = False
+
+ if accessType.pointerIndirectionLevels > 0:
+ streamSize = 8
+ else:
+ streamSize = typeInfo.getPrimitiveEncodingSize(accessTypeName)
+
+ return streamSize
+
+# Class to wrap a Vulkan API call.
+#
+# The user gives a generic callback, |codegenDef|,
+# that takes a CodeGen object and a VulkanAPI object as arguments.
+# codegenDef uses CodeGen along with the VulkanAPI object
+# to generate the function body.
+class VulkanAPIWrapper(object):
+
+ def __init__(self,
+ customApiPrefix,
+ extraParameters=None,
+ returnTypeOverride=None,
+ codegenDef=None):
+ self.customApiPrefix = customApiPrefix
+ self.extraParameters = extraParameters
+ self.returnTypeOverride = returnTypeOverride
+
+ self.codegen = CodeGen()
+
+ self.definitionFunc = codegenDef
+
+ # Private function
+
+ def makeApiFunc(self, typeInfo, apiName):
+ customApi = copy(typeInfo.apis[apiName])
+ customApi.name = self.customApiPrefix + customApi.name
+ if self.extraParameters is not None:
+ if isinstance(self.extraParameters, list):
+ customApi.parameters = \
+ self.extraParameters + customApi.parameters
+ else:
+ os.abort(
+ "Type of extra parameters to custom API not valid. Expected list, got %s" % type(
+ self.extraParameters))
+
+ if self.returnTypeOverride is not None:
+ customApi.retType = self.returnTypeOverride
+ return customApi
+
+ self.makeApi = makeApiFunc
+
+ def setCodegenDef(self, codegenDefFunc):
+ self.definitionFunc = codegenDefFunc
+
+ def makeDecl(self, typeInfo, apiName):
+ return self.codegen.makeFuncProto(
+ self.makeApi(self, typeInfo, apiName)) + ";\n\n"
+
+ def makeDefinition(self, typeInfo, apiName, isStatic=False):
+ vulkanApi = self.makeApi(self, typeInfo, apiName)
+
+ self.codegen.swapCode()
+ self.codegen.beginBlock()
+
+ if self.definitionFunc is None:
+ print("ERROR: No definition found for (%s, %s)" %
+ (vulkanApi.name, self.customApiPrefix))
+ sys.exit(1)
+
+ self.definitionFunc(self.codegen, vulkanApi)
+
+ self.codegen.endBlock()
+
+ return ("static " if isStatic else "") + self.codegen.makeFuncProto(
+ vulkanApi) + "\n" + self.codegen.swapCode() + "\n"
+
+# Base class for wrapping all Vulkan API objects. These work with Vulkan
+# Registry generators and have gen* triggers. They tend to contain
+# VulkanAPIWrapper objects to make it easier to generate the code.
+class VulkanWrapperGenerator(object):
+
+ def __init__(self, module: Module, typeInfo: VulkanTypeInfo):
+ self.module: Module = module
+ self.typeInfo: VulkanTypeInfo = typeInfo
+ self.extensionStructTypes = OrderedDict()
+
+ def onBegin(self):
+ pass
+
+ def onEnd(self):
+ pass
+
+ def onBeginFeature(self, featureName, featureType):
+ pass
+
+ def onFeatureNewCmd(self, cmdName):
+ pass
+
+ def onEndFeature(self):
+ pass
+
+ def onGenType(self, typeInfo, name, alias):
+ category = self.typeInfo.categoryOf(name)
+ if category in ["struct", "union"] and not alias:
+ structInfo = self.typeInfo.structs[name]
+ if structInfo.structExtendsExpr:
+ self.extensionStructTypes[name] = structInfo
+ pass
+
+ def onGenStruct(self, typeInfo, name, alias):
+ pass
+
+ def onGenGroup(self, groupinfo, groupName, alias=None):
+ pass
+
+ def onGenEnum(self, enuminfo, name, alias):
+ pass
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ pass
+
+ # Below Vulkan structure types may correspond to multiple Vulkan structs
+ # due to a conflict between different Vulkan registries. In order to get
+ # the correct Vulkan struct type, we need to check the type of its "root"
+ # struct as well.
+ ROOT_TYPE_MAPPING = {
+ "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT": {
+ "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2": "VkPhysicalDeviceFragmentDensityMapFeaturesEXT",
+ "VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO": "VkPhysicalDeviceFragmentDensityMapFeaturesEXT",
+ "VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO": "VkImportColorBufferGOOGLE",
+ "default": "VkPhysicalDeviceFragmentDensityMapFeaturesEXT",
+ },
+ "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT": {
+ "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2": "VkPhysicalDeviceFragmentDensityMapPropertiesEXT",
+ "VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO": "VkCreateBlobGOOGLE",
+ "default": "VkPhysicalDeviceFragmentDensityMapPropertiesEXT",
+ },
+ "VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT": {
+ "VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO": "VkRenderPassFragmentDensityMapCreateInfoEXT",
+ "VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2": "VkRenderPassFragmentDensityMapCreateInfoEXT",
+ "VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO": "VkImportBufferGOOGLE",
+ "default": "VkRenderPassFragmentDensityMapCreateInfoEXT",
+ },
+ }
+
+ def emitForEachStructExtension(self, cgen, retType, triggerVar, forEachFunc, autoBreak=True, defaultEmit=None, nullEmit=None, rootTypeVar=None):
+ def readStructType(structTypeName, structVarName, cgen):
+ cgen.stmt("uint32_t %s = (uint32_t)%s(%s)" % \
+ (structTypeName, "goldfish_vk_struct_type", structVarName))
+
+ def castAsStruct(varName, typeName, const=True):
+ return "reinterpret_cast<%s%s*>(%s)" % \
+ ("const " if const else "", typeName, varName)
+
+ def doDefaultReturn(cgen):
+ if retType.typeName == "void":
+ cgen.stmt("return")
+ else:
+ cgen.stmt("return (%s)0" % retType.typeName)
+
+ cgen.beginIf("!%s" % triggerVar.paramName)
+ if nullEmit is None:
+ doDefaultReturn(cgen)
+ else:
+ nullEmit(cgen)
+ cgen.endIf()
+
+ readStructType("structType", triggerVar.paramName, cgen)
+
+ cgen.line("switch(structType)")
+ cgen.beginBlock()
+
+ currFeature = None
+
+ for ext in self.extensionStructTypes.values():
+ if not currFeature:
+ cgen.leftline("#ifdef %s" % ext.feature)
+ currFeature = ext.feature
+
+ if currFeature and ext.feature != currFeature:
+ cgen.leftline("#endif")
+ cgen.leftline("#ifdef %s" % ext.feature)
+ currFeature = ext.feature
+
+ enum = ext.structEnumExpr
+ protect = None
+ if enum in self.typeInfo.enumElem:
+ protect = self.typeInfo.enumElem[enum].get("protect", default=None)
+ if protect is not None:
+ cgen.leftline("#ifdef %s" % protect)
+
+ cgen.line("case %s:" % enum)
+ cgen.beginBlock()
+
+ if rootTypeVar is not None and enum in VulkanWrapperGenerator.ROOT_TYPE_MAPPING:
+ cgen.line("switch(%s)" % rootTypeVar.paramName)
+ cgen.beginBlock()
+ kv = VulkanWrapperGenerator.ROOT_TYPE_MAPPING[enum]
+ for k in kv:
+ v = self.extensionStructTypes[kv[k]]
+ if k == "default":
+ cgen.line("%s:" % k)
+ else:
+ cgen.line("case %s:" % k)
+ cgen.beginBlock()
+ castedAccess = castAsStruct(
+ triggerVar.paramName, v.name, const=triggerVar.isConst)
+ forEachFunc(v, castedAccess, cgen)
+ cgen.line("break;")
+ cgen.endBlock()
+ cgen.endBlock()
+ else:
+ castedAccess = castAsStruct(
+ triggerVar.paramName, ext.name, const=triggerVar.isConst)
+ forEachFunc(ext, castedAccess, cgen)
+
+ if autoBreak:
+ cgen.stmt("break")
+ cgen.endBlock()
+
+ if protect is not None:
+ cgen.leftline("#endif // %s" % protect)
+
+ if currFeature:
+ cgen.leftline("#endif")
+
+ cgen.line("default:")
+ cgen.beginBlock()
+ if defaultEmit is None:
+ doDefaultReturn(cgen)
+ else:
+ defaultEmit(cgen)
+ cgen.endBlock()
+
+ cgen.endBlock()
+
+ def emitForEachStructExtensionGeneral(self, cgen, forEachFunc, doFeatureIfdefs=False):
+ currFeature = None
+
+ for (i, ext) in enumerate(self.extensionStructTypes.values()):
+ if doFeatureIfdefs:
+ if not currFeature:
+ cgen.leftline("#ifdef %s" % ext.feature)
+ currFeature = ext.feature
+
+ if currFeature and ext.feature != currFeature:
+ cgen.leftline("#endif")
+ cgen.leftline("#ifdef %s" % ext.feature)
+ currFeature = ext.feature
+
+ forEachFunc(i, ext, cgen)
+
+ if doFeatureIfdefs:
+ if currFeature:
+ cgen.leftline("#endif")
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/vulkantypes.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/vulkantypes.py
new file mode 100644
index 00000000000..728f23d2b4e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/common/vulkantypes.py
@@ -0,0 +1,1324 @@
+# 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.
+from typing import Dict, Optional, List, Set, Union
+from xml.etree.ElementTree import Element
+
+from generator import noneStr
+
+from copy import copy
+from dataclasses import dataclass
+from string import whitespace
+
+# Holds information about core Vulkan objects
+# and the API calls that are used to create/destroy each one.
+class HandleInfo(object):
+ def __init__(self, name, createApis, destroyApis):
+ self.name = name
+ self.createApis = createApis
+ self.destroyApis = destroyApis
+
+ def isCreateApi(self, apiName):
+ return apiName == self.createApis or (apiName in self.createApis)
+
+ def isDestroyApi(self, apiName):
+ if self.destroyApis is None:
+ return False
+ return apiName == self.destroyApis or (apiName in self.destroyApis)
+
+DISPATCHABLE_HANDLE_TYPES = [
+ "VkInstance",
+ "VkPhysicalDevice",
+ "VkDevice",
+ "VkQueue",
+ "VkCommandBuffer",
+]
+
+NON_DISPATCHABLE_HANDLE_TYPES = [
+ "VkDeviceMemory",
+ "VkBuffer",
+ "VkBufferView",
+ "VkImage",
+ "VkImageView",
+ "VkShaderModule",
+ "VkDescriptorPool",
+ "VkDescriptorSetLayout",
+ "VkDescriptorSet",
+ "VkSampler",
+ "VkPipeline",
+ "VkPipelineLayout",
+ "VkRenderPass",
+ "VkFramebuffer",
+ "VkPipelineCache",
+ "VkCommandPool",
+ "VkFence",
+ "VkSemaphore",
+ "VkEvent",
+ "VkQueryPool",
+ "VkSamplerYcbcrConversion",
+ "VkSamplerYcbcrConversionKHR",
+ "VkDescriptorUpdateTemplate",
+ "VkSurfaceKHR",
+ "VkSwapchainKHR",
+ "VkDisplayKHR",
+ "VkDisplayModeKHR",
+ "VkObjectTableNVX",
+ "VkIndirectCommandsLayoutNVX",
+ "VkValidationCacheEXT",
+ "VkDebugReportCallbackEXT",
+ "VkDebugUtilsMessengerEXT",
+ "VkAccelerationStructureNV",
+ "VkIndirectCommandsLayoutNV",
+ "VkAccelerationStructureKHR",
+]
+
+CUSTOM_HANDLE_CREATE_TYPES = [
+ "VkPhysicalDevice",
+ "VkQueue",
+ "VkPipeline",
+ "VkDeviceMemory",
+ "VkDescriptorSet",
+ "VkCommandBuffer",
+ "VkRenderPass",
+]
+
+HANDLE_TYPES = list(sorted(list(set(DISPATCHABLE_HANDLE_TYPES +
+ NON_DISPATCHABLE_HANDLE_TYPES + CUSTOM_HANDLE_CREATE_TYPES))))
+
+HANDLE_INFO = {}
+
+for h in HANDLE_TYPES:
+ if h in CUSTOM_HANDLE_CREATE_TYPES:
+ if h == "VkPhysicalDevice":
+ HANDLE_INFO[h] = \
+ HandleInfo(
+ "VkPhysicalDevice",
+ "vkEnumeratePhysicalDevices", None)
+ if h == "VkQueue":
+ HANDLE_INFO[h] = \
+ HandleInfo(
+ "VkQueue",
+ ["vkGetDeviceQueue", "vkGetDeviceQueue2"],
+ None)
+ if h == "VkPipeline":
+ HANDLE_INFO[h] = \
+ HandleInfo(
+ "VkPipeline",
+ ["vkCreateGraphicsPipelines", "vkCreateComputePipelines"],
+ "vkDestroyPipeline")
+ if h == "VkDeviceMemory":
+ HANDLE_INFO[h] = \
+ HandleInfo("VkDeviceMemory",
+ "vkAllocateMemory", ["vkFreeMemory", "vkFreeMemorySyncGOOGLE"])
+ if h == "VkDescriptorSet":
+ HANDLE_INFO[h] = \
+ HandleInfo("VkDescriptorSet", "vkAllocateDescriptorSets",
+ "vkFreeDescriptorSets")
+ if h == "VkCommandBuffer":
+ HANDLE_INFO[h] = \
+ HandleInfo("VkCommandBuffer", "vkAllocateCommandBuffers",
+ "vkFreeCommandBuffers")
+ if h == "VkRenderPass":
+ HANDLE_INFO[h] = \
+ HandleInfo(
+ "VkRenderPass",
+ ["vkCreateRenderPass", "vkCreateRenderPass2", "vkCreateRenderPass2KHR"],
+ "vkDestroyRenderPass")
+ else:
+ HANDLE_INFO[h] = \
+ HandleInfo(h, "vkCreate" + h[2:], "vkDestroy" + h[2:])
+
+EXCLUDED_APIS = [
+ "vkEnumeratePhysicalDeviceGroups",
+]
+
+EXPLICITLY_ABI_PORTABLE_TYPES = [
+ "VkResult",
+ "VkBool32",
+ "VkSampleMask",
+ "VkFlags",
+ "VkDeviceSize",
+]
+
+EXPLICITLY_ABI_NON_PORTABLE_TYPES = [
+ "size_t"
+]
+
+NON_ABI_PORTABLE_TYPE_CATEGORIES = [
+ "handle",
+ "funcpointer",
+]
+
+# A class for holding the parameter indices corresponding to various
+# attributes about a VkDeviceMemory, such as the handle, size, offset, etc.
+@dataclass
+class DeviceMemoryInfoParameterIndices:
+ handle: int = -1
+ offset: int = -1
+ size: int = -1
+ typeIndex: int = -1
+ typeBits: int = -1
+
+DEVICE_MEMORY_STRUCTS = {
+ "VkMemoryAllocateInfo": {"1": DeviceMemoryInfoParameterIndices(typeIndex = 3)},
+ "VkMemoryRequirements": {"1": DeviceMemoryInfoParameterIndices(typeBits = 2)},
+ "VkMappedMemoryRange": {"1": DeviceMemoryInfoParameterIndices(handle = 2, offset = 3, size = 4)},
+ "VkSparseMemoryBind": {"1": DeviceMemoryInfoParameterIndices(handle = 2, offset = 3)},
+ "VkSparseImageMemoryBind": {"1": DeviceMemoryInfoParameterIndices(handle = 3, offset = 4)},
+ "VkWin32KeyedMutexAcquireReleaseInfoNV": {"1": DeviceMemoryInfoParameterIndices(handle = 3), "2": DeviceMemoryInfoParameterIndices(handle = 7)},
+ "VkMemoryWin32HandlePropertiesKHR": {"1": DeviceMemoryInfoParameterIndices(typeBits = 2)},
+ "VkMemoryGetWin32HandleInfoKHR": {"1": DeviceMemoryInfoParameterIndices(handle = 2)},
+ "VkMemoryFdPropertiesKHR": {"1": DeviceMemoryInfoParameterIndices(typeBits = 2)},
+ "VkMemoryGetFdInfoKHR": {"1": DeviceMemoryInfoParameterIndices(handle = 2)},
+ "VkWin32KeyedMutexAcquireReleaseInfoKHR": {"1": DeviceMemoryInfoParameterIndices(handle = 3), "2": DeviceMemoryInfoParameterIndices(handle = 7)},
+ "VkBindBufferMemoryInfo": {"1": DeviceMemoryInfoParameterIndices(handle = 3, offset = 4)},
+ "VkBindImageMemoryInfo": {"1": DeviceMemoryInfoParameterIndices(handle = 3, offset = 4)},
+ "VkMemoryHostPointerPropertiesEXT": {"1": DeviceMemoryInfoParameterIndices(typeBits = 2)},
+ "VkAndroidHardwareBufferPropertiesANDROID": {"1": DeviceMemoryInfoParameterIndices(typeBits = 3)},
+ "VkMemoryGetAndroidHardwareBufferInfoANDROID": {"1": DeviceMemoryInfoParameterIndices(handle = 2)},
+ "VkBindAccelerationStructureMemoryInfoNV": {"1": DeviceMemoryInfoParameterIndices(handle = 3, offset = 4)},
+ "VkDeviceMemoryOpaqueCaptureAddressInfo": {"1": DeviceMemoryInfoParameterIndices(handle = 2)},
+}
+
+DEVICE_MEMORY_COMMANDS = {
+ "vkFreeMemory": {"1": DeviceMemoryInfoParameterIndices(handle = 1)},
+ "vkMapMemory": {"1": DeviceMemoryInfoParameterIndices(handle = 1)},
+ "vkUnmapMemory": {"1": DeviceMemoryInfoParameterIndices(handle = 1)},
+ "vkGetDeviceMemoryCommitment": {"1": DeviceMemoryInfoParameterIndices(handle = 1, offset = 2)},
+ "vkBindBufferMemory": {"1": DeviceMemoryInfoParameterIndices(handle = 2, offset = 3)},
+ "vkBindImageMemory": {"1": DeviceMemoryInfoParameterIndices(handle = 2, offset = 3)},
+ "vkGetBlobGOOGLE": {"1": DeviceMemoryInfoParameterIndices(handle = 1)},
+ "vkGetMemoryWin32HandleNV": {"1": DeviceMemoryInfoParameterIndices(handle = 1)},
+ "vkMapMemoryIntoAddressSpaceGOOGLE": {"1": DeviceMemoryInfoParameterIndices(handle = 1)},
+ "vkGetMemoryHostAddressInfoGOOGLE": {"1": DeviceMemoryInfoParameterIndices(handle = 1)},
+ "vkFreeMemorySyncGOOGLE": {"1": DeviceMemoryInfoParameterIndices(handle = 1)},
+}
+
+TRIVIAL_TRANSFORMED_TYPES = [
+ "VkPhysicalDeviceExternalImageFormatInfo",
+ "VkPhysicalDeviceExternalBufferInfo",
+ "VkExternalMemoryImageCreateInfo",
+ "VkExternalMemoryBufferCreateInfo",
+ "VkExportMemoryAllocateInfo",
+ "VkExternalImageFormatProperties",
+ "VkExternalBufferProperties",
+]
+
+NON_TRIVIAL_TRANSFORMED_TYPES = [
+ "VkExternalMemoryProperties",
+ "VkImageCreateInfo",
+]
+
+TRANSFORMED_TYPES = TRIVIAL_TRANSFORMED_TYPES + NON_TRIVIAL_TRANSFORMED_TYPES
+
+STRUCT_STREAM_FEATURE = {
+ "VkPhysicalDeviceShaderFloat16Int8Features": "VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT",
+ "VkPhysicalDeviceShaderFloat16Int8FeaturesKHR": "VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT",
+ "VkPhysicalDeviceFloat16Int8FeaturesKHR": "VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT",
+}
+
+STRUCT_MEMBER_STREAM_FEATURE = {
+ "VkGraphicsPipelineCreateInfo.pVertexInputState": "VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT",
+ "VkGraphicsPipelineCreateInfo.pInputAssemblyState": "VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT",
+ "VkGraphicsPipelineCreateInfo.pRasterizationState": "VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT",
+}
+
+STRUCT_ENV_STR = {
+ "VkGraphicsPipelineCreateInfo": {
+ "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" : "(or (if (eq 0 pRasterizationState) 0 (not (getfield pRasterizationState rasterizerDiscardEnable))) (if (eq 0 pDynamicState) 0 (arrayany (getfield pDynamicState pDynamicStates) 0 (getfield pDynamicState dynamicStateCount) (lambda ((s VkDynamicState)) (eq s VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE)))))"
+ },
+}
+
+STRUCT_MEMBER_FILTER_VAR = {
+ "VkGraphicsPipelineCreateInfo.pTessellationState": "hasTessellation",
+ "VkGraphicsPipelineCreateInfo.pViewportState": "hasRasterization",
+ "VkGraphicsPipelineCreateInfo.pMultisampleState": "hasRasterization",
+ "VkGraphicsPipelineCreateInfo.pDepthStencilState": "hasRasterization",
+ "VkGraphicsPipelineCreateInfo.pColorBlendState": "hasRasterization",
+ "VkWriteDescriptorSet.pImageInfo": "descriptorType",
+ "VkWriteDescriptorSet.pBufferInfo": "descriptorType",
+ "VkWriteDescriptorSet.pTexelBufferView": "descriptorType",
+ "VkFramebufferCreateInfo.pAttachments": "flags",
+}
+
+STRUCT_MEMBER_FILTER_VALS = {
+ "VkWriteDescriptorSet.pImageInfo": [
+ "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"
+ ],
+ "VkWriteDescriptorSet.pBufferInfo": [
+ "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER",
+ "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC",
+ "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER",
+ "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC",
+ ],
+ "VkWriteDescriptorSet.pTexelBufferView": [
+ "VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER",
+ "VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER",
+ ],
+}
+
+STRUCT_MEMBER_FILTER_FUNC = {
+ "VkFramebufferCreateInfo.pAttachments": "(eq (bitwise_and flags VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) 0)",
+}
+
+# vk.xml added optional to some of the existing fields. For backward compatibility
+# we need to ignore those optionals.
+# We might want to add more complex safety checks in future.
+STRUCT_MEMBER_IGNORE_OPTIONAL = {
+ "VkSubmitInfo.pWaitDstStageMask",
+ "VkPipelineLayoutCreateInfo.pSetLayouts",
+ "VkGraphicsPipelineCreateInfo.pStages",
+ "VkPipelineColorBlendStateCreateInfo.pAttachments",
+ "VkFramebufferCreateInfo.attachmentCount",
+ "VkFramebufferCreateInfo.pAttachments",
+ "VkVideoProfileInfoKHR.chromaBitDepth",
+ "VkVideoDecodeInfoKHR.pSetupReferenceSlot",
+ "vkCmdBindDescriptorSets.pDescriptorSets",
+ "vkCmdBindDescriptorSets.local_pDescriptorSets",
+ "vkCmdBindVertexBuffers.pBuffers",
+ "vkCmdBindVertexBuffers.local_pBuffers",
+ "vkCmdClearColorImage.pColor",
+ "vkCmdClearColorImage.local_pColor",
+}
+
+# Holds information about a Vulkan type instance (i.e., not a type definition).
+# Type instances are used as struct field definitions or function parameters,
+# to be later fed to code generation.
+# VulkanType instances can be constructed in two ways:
+# 1. From an XML tag with <type> / <param> tags in vk.xml,
+# using makeVulkanTypeFromXMLTag
+# 2. User-defined instances with makeVulkanTypeSimple.
+class VulkanType(object):
+
+ def __init__(self):
+ self.parent: Optional[VulkanType] = None
+ self.typeName: str = ""
+
+ self.isTransformed = False
+
+ self.paramName: Optional[str] = None
+
+ self.lenExpr: Optional[str] = None # Value of the `len` attribute in the spec
+ self.isOptional: bool = False
+ self.optionalStr: Optional[str] = None # Value of the `optional` attribute in the spec
+
+ self.isConst = False
+
+ # "" means it's not a static array, otherwise this is the total size of
+ # all elements. e.g. staticArrExpr of "x[3][2][8]" will be "((3)*(2)*(8))".
+ self.staticArrExpr = ""
+ # "" means it's not a static array, otherwise it's the raw expression
+ # of static array size, which can be one-dimensional or multi-dimensional.
+ self.rawStaticArrExpr = ""
+
+ self.pointerIndirectionLevels = 0 # 0 means not pointer
+ self.isPointerToConstPointer = False
+
+ self.primitiveEncodingSize = None
+
+ self.deviceMemoryInfoParameterIndices = None
+
+ # Annotations
+ # Environment annotation for binding current
+ # variables to sub-structures
+ self.binds = {}
+
+ # Device memory annotations
+
+ # self.deviceMemoryAttrib/Val stores
+ # device memory info attributes
+ self.deviceMemoryAttrib = None
+ self.deviceMemoryVal = None
+
+ # Filter annotations
+ self.filterVar = None
+ self.filterVals = None
+ self.filterFunc = None
+ self.filterOtherwise = None
+
+ # Stream feature
+ self.streamFeature = None
+
+ # All other annotations
+ self.attribs = {}
+
+ self.nonDispatchableHandleCreate = False
+ self.nonDispatchableHandleDestroy = False
+ self.dispatchHandle = False
+ self.dispatchableHandleCreate = False
+ self.dispatchableHandleDestroy = False
+
+
+ def __str__(self,):
+ return ("(vulkantype %s %s paramName %s len %s optional? %s "
+ "staticArrExpr %s)") % (
+ self.typeName + ("*" * self.pointerIndirectionLevels) +
+ ("ptr2constptr" if self.isPointerToConstPointer else ""), "const"
+ if self.isConst else "nonconst", self.paramName, self.lenExpr,
+ self.isOptional, self.staticArrExpr)
+
+ def isString(self):
+ return self.pointerIndirectionLevels == 1 and (self.typeName == "char")
+
+ def isArrayOfStrings(self):
+ return self.isPointerToConstPointer and (self.typeName == "char")
+
+ def primEncodingSize(self):
+ return self.primitiveEncodingSize
+
+ # Utility functions to make codegen life easier.
+ # This method derives the correct "count" expression if possible.
+ # Otherwise, returns None or "null-terminated" if a string.
+ def getLengthExpression(self):
+ if self.staticArrExpr != "":
+ return self.staticArrExpr
+ if self.lenExpr:
+ # Use a simple lookup table for latexmath.
+ known_expressions = {
+ r"latexmath:[\lceil{\mathit{samples} \over 32}\rceil]":
+ "int(samples / 32)",
+ r"latexmath:[2 \times \mathtt{VK\_UUID\_SIZE}]": "2 * VK_UUID_SIZE",
+ }
+ if self.lenExpr in known_expressions:
+ return known_expressions[self.lenExpr]
+ return self.lenExpr
+ return None
+
+ # Can we just pass this to functions expecting T*
+ def accessibleAsPointer(self):
+ if self.staticArrExpr != "":
+ return True
+ if self.pointerIndirectionLevels > 0:
+ return True
+ return False
+
+ # Rough attempt to infer where a type could be an output.
+ # Good for inferring which things need to be marshaled in
+ # versus marshaled out for Vulkan API calls
+ def possiblyOutput(self,):
+ return self.pointerIndirectionLevels > 0 and (not self.isConst)
+
+ def isVoidWithNoSize(self,):
+ return self.typeName == "void" and self.pointerIndirectionLevels == 0
+
+ def getCopy(self,):
+ return copy(self)
+
+ def getTransformed(self, isConstChoice=None, ptrIndirectionChoice=None):
+ res = self.getCopy()
+
+ if isConstChoice is not None:
+ res.isConst = isConstChoice
+ if ptrIndirectionChoice is not None:
+ res.pointerIndirectionLevels = ptrIndirectionChoice
+
+ return res
+
+ def getWithCustomName(self):
+ return self.getTransformed(
+ ptrIndirectionChoice=self.pointerIndirectionLevels + 1)
+
+ def getForAddressAccess(self):
+ return self.getTransformed(
+ ptrIndirectionChoice=self.pointerIndirectionLevels + 1)
+
+ def getForValueAccess(self):
+ if self.typeName == "void" and self.pointerIndirectionLevels == 1:
+ asUint8Type = self.getCopy()
+ asUint8Type.typeName = "uint8_t"
+ return asUint8Type.getForValueAccess()
+ return self.getTransformed(
+ ptrIndirectionChoice=self.pointerIndirectionLevels - 1)
+
+ def getForNonConstAccess(self):
+ return self.getTransformed(isConstChoice=False)
+
+ def withModifiedName(self, newName):
+ res = self.getCopy()
+ res.paramName = newName
+ return res
+
+ def isNextPointer(self):
+ return self.paramName == "pNext"
+
+ def isSigned(self):
+ return self.typeName in ["int", "int8_t", "int16_t", "int32_t", "int64_t"]
+
+ def isEnum(self, typeInfo):
+ return typeInfo.categoryOf(self.typeName) == "enum"
+
+ def isBitmask(self, typeInfo):
+ return typeInfo.categoryOf(self.typeName) == "enum"
+
+ # Only deals with 'core' handle types here.
+ def isDispatchableHandleType(self):
+ return self.typeName in DISPATCHABLE_HANDLE_TYPES
+
+ def isNonDispatchableHandleType(self):
+ return self.typeName in NON_DISPATCHABLE_HANDLE_TYPES
+
+ def isHandleType(self):
+ return self.isDispatchableHandleType() or \
+ self.isNonDispatchableHandleType()
+
+ def isCreatedBy(self, api):
+ if self.shouldSkip():
+ return False
+ if self.typeName in HANDLE_INFO.keys():
+ nonKhrRes = HANDLE_INFO[self.typeName].isCreateApi(api.name)
+ if nonKhrRes:
+ return True
+ if len(api.name) > 3 and "KHR" == api.name[-3:]:
+ return HANDLE_INFO[self.typeName].isCreateApi(api.name[:-3])
+
+ if self.typeName == "VkImage" and api.name == "vkCreateImageWithRequirementsGOOGLE":
+ return True
+
+ if self.typeName == "VkBuffer" and api.name == "vkCreateBufferWithRequirementsGOOGLE":
+ return True
+
+ return False
+
+ def isDestroyedBy(self, api):
+ if self.shouldSkip():
+ return False
+ if self.typeName in HANDLE_INFO.keys():
+ nonKhrRes = HANDLE_INFO[self.typeName].isDestroyApi(api.name)
+ if nonKhrRes:
+ return True
+ if len(api.name) > 3 and "KHR" == api.name[-3:]:
+ return HANDLE_INFO[self.typeName].isDestroyApi(api.name[:-3])
+
+ return False
+
+ def isSimpleValueType(self, typeInfo):
+ if typeInfo.isCompoundType(self.typeName):
+ return False
+ if self.isString() or self.isArrayOfStrings():
+ return False
+ if self.staticArrExpr or self.pointerIndirectionLevels > 0:
+ return False
+ return True
+
+ def getStructEnumExpr(self,):
+ return None
+
+ def getPrintFormatSpecifier(self):
+ kKnownTypePrintFormatSpecifiers = {
+ 'float': '%f',
+ 'int': '%d',
+ 'int32_t': '%d',
+ 'size_t': '%ld',
+ 'uint16_t': '%d',
+ 'uint32_t': '%d',
+ 'uint64_t': '%ld',
+ 'VkBool32': '%d',
+ 'VkDeviceSize': '%ld',
+ 'VkFormat': '%d',
+ 'VkImageLayout': '%d',
+ }
+
+ if self.pointerIndirectionLevels > 0 or self.isHandleType():
+ return '%p'
+
+ if self.typeName in kKnownTypePrintFormatSpecifiers:
+ return kKnownTypePrintFormatSpecifiers[self.typeName]
+
+ if self.typeName.endswith('Flags'):
+ # Based on `typedef uint32_t VkFlags;`
+ return '%d'
+
+ return None
+ def isOptionalPointer(self) -> bool:
+ return self.isOptional and \
+ (not self.isForceOptional()) and\
+ self.pointerIndirectionLevels > 0 and \
+ (not self.isNextPointer())
+
+ def isForceOptional(self) -> bool:
+ """
+ Returns true if we should generate a placeholder for null.
+
+ Vulkan updates change certain pointers from non-optional to
+ optional. We want to keep our encoder/decoder backward compatible.
+ Thus we should generate a placeholder for such APIs.
+ """
+ return self.getFullName() in STRUCT_MEMBER_IGNORE_OPTIONAL
+
+ def getFullName(self) -> str:
+ if self.parent is None:
+ return self.paramName
+ return f"{self.parent.name}.{self.paramName}"
+
+ def getProtectStreamFeature(self) -> Optional[str]:
+ key = self.getFullName()
+ if key in STRUCT_MEMBER_STREAM_FEATURE.keys():
+ return STRUCT_MEMBER_STREAM_FEATURE[key]
+ return None
+
+ def shouldSkip(self) -> bool:
+ return ("api" in self.attribs.keys()
+ and not "vulkan" == self.attribs["api"])
+
+# Is an S-expression w/ the following spec:
+# From https://gist.github.com/pib/240957
+class Atom(object):
+ def __init__(self, name):
+ self.name = name
+ def __repr__(self,):
+ return self.name
+
+def parse_sexp(sexp):
+ atom_end = set('()"\'') | set(whitespace)
+ stack, i, length = [[]], 0, len(sexp)
+ while i < length:
+ c = sexp[i]
+
+ reading = type(stack[-1])
+ if reading == list:
+ if c == '(': stack.append([])
+ elif c == ')':
+ stack[-2].append(stack.pop())
+ if stack[-1][0] == ('quote',): stack[-2].append(stack.pop())
+ elif c == '"': stack.append('')
+ elif c == "'": stack.append([('quote',)])
+ elif c in whitespace: pass
+ else: stack.append(Atom(c))
+ elif reading == str:
+ if c == '"':
+ stack[-2].append(stack.pop())
+ if stack[-1][0] == ('quote',): stack[-2].append(stack.pop())
+ elif c == '\\':
+ i += 1
+ stack[-1] += sexp[i]
+ else: stack[-1] += c
+ elif reading == Atom:
+ if c in atom_end:
+ atom = stack.pop()
+ if atom.name[0].isdigit(): stack[-1].append(eval(atom.name))
+ else: stack[-1].append(atom)
+ if stack[-1][0] == ('quote',): stack[-2].append(stack.pop())
+ continue
+ else: stack[-1] = Atom(stack[-1].name + c)
+ i += 1
+
+ return stack.pop()
+
+class FuncExprVal(object):
+ def __init__(self, val):
+ self.val = val
+ def __repr__(self,):
+ return self.val.__repr__()
+
+class FuncExpr(object):
+ def __init__(self, name, args):
+ self.name = name
+ self.args = args
+ def __repr__(self,):
+ if len(self.args) == 0:
+ return "(%s)" % (self.name.__repr__())
+ else:
+ return "(%s %s)" % (self.name.__repr__(), " ".join(map(lambda x: x.__repr__(), self.args)))
+
+class FuncLambda(object):
+ def __init__(self, vs, body):
+ self.vs = vs
+ self.body = body
+ def __repr__(self,):
+ return "(L (%s) %s)" % (" ".join(map(lambda x: x.__repr__(), self.vs)), self.body.__repr__())
+
+class FuncLambdaParam(object):
+ def __init__(self, name, typ):
+ self.name = name
+ self.typ = typ
+ def __repr__(self,):
+ return "%s : %s" % (self.name, self.typ)
+
+def parse_func_expr(parsed_sexp):
+ if len(parsed_sexp) != 1:
+ print("Error: parsed # expressions != 1: %d" % (len(parsed_sexp)))
+ raise
+
+ e = parsed_sexp[0]
+
+ def parse_lambda_param(e):
+ return FuncLambdaParam(e[0].name, e[1].name)
+
+ def parse_one(exp):
+ if list == type(exp):
+ if "lambda" == exp[0].__repr__():
+ return FuncLambda(list(map(parse_lambda_param, exp[1])), parse_one(exp[2]))
+ else:
+ return FuncExpr(exp[0], list(map(parse_one, exp[1:])))
+ else:
+ return FuncExprVal(exp)
+
+ return parse_one(e)
+
+def parseFilterFuncExpr(expr):
+ res = parse_func_expr(parse_sexp(expr))
+ print("parseFilterFuncExpr: parsed %s" % res)
+ return res
+
+def parseLetBodyExpr(expr):
+ res = parse_func_expr(parse_sexp(expr))
+ print("parseLetBodyExpr: parsed %s" % res)
+ return res
+
+
+def makeVulkanTypeFromXMLTag(typeInfo, parentName: str, tag: Element) -> VulkanType:
+ res = VulkanType()
+
+ # Process the length expression
+
+ if tag.attrib.get("len") is not None:
+ lengths = tag.attrib.get("len").split(",")
+ res.lenExpr = lengths[0]
+
+ # Calculate static array expression
+
+ nametag = tag.find("name")
+ enumtag = tag.find("enum")
+
+ if enumtag is not None:
+ res.staticArrExpr = enumtag.text
+ elif nametag is not None:
+ res.rawStaticArrExpr = noneStr(nametag.tail)
+
+ dimensions = res.rawStaticArrExpr.count('[')
+ if dimensions == 1:
+ res.staticArrExpr = res.rawStaticArrExpr[1:-1]
+ elif dimensions > 1:
+ arraySizes = res.rawStaticArrExpr[1:-1].split('][')
+ res.staticArrExpr = '(' + \
+ '*'.join(f'({size})' for size in arraySizes) + ')'
+
+ # Determine const
+
+ beforeTypePart = noneStr(tag.text)
+
+ if "const" in beforeTypePart:
+ res.isConst = True
+
+ # Calculate type and pointer info
+ for elem in tag:
+ if elem.tag == "name":
+ res.paramName = elem.text
+ if elem.tag == "type":
+ duringTypePart = noneStr(elem.text)
+ afterTypePart = noneStr(elem.tail)
+ # Now we know enough to fill some stuff in
+ res.typeName = duringTypePart
+
+ if res.typeName in TRANSFORMED_TYPES:
+ res.isTransformed = True
+
+ # This only handles pointerIndirectionLevels == 2
+ # along with optional constant pointer for the inner part.
+ for c in afterTypePart:
+ if c == "*":
+ res.pointerIndirectionLevels += 1
+ if "const" in afterTypePart and res.pointerIndirectionLevels == 2:
+ res.isPointerToConstPointer = True
+
+ # If void*, treat like it's not a pointer
+ # if duringTypePart == "void":
+ # res.pointerIndirectionLevels -= 1
+
+ # Calculate optionality (based on validitygenerator.py)
+ if tag.attrib.get("optional") is not None:
+ res.isOptional = True
+ res.optionalStr = tag.attrib.get("optional")
+
+ # If no validity is being generated, it usually means that
+ # validity is complex and not absolute, so let's say yes.
+ if tag.attrib.get("noautovalidity") is not None:
+ res.isOptional = True
+
+ # If this is a structure extension, it is optional.
+ if tag.attrib.get("structextends") is not None:
+ res.isOptional = True
+
+ # If this is a pNext pointer, it is optional.
+ if res.paramName == "pNext":
+ res.isOptional = True
+
+ res.primitiveEncodingSize = typeInfo.getPrimitiveEncodingSize(res.typeName)
+
+ # Annotations: Environment binds
+ if tag.attrib.get("binds") is not None:
+ bindPairs = map(lambda x: x.strip(), tag.attrib.get("binds").split(","))
+ bindPairsSplit = map(lambda p: p.split(":"), bindPairs)
+ res.binds = dict(map(lambda sp: (sp[0].strip(), sp[1].strip()), bindPairsSplit))
+
+ # Annotations: Filters
+ structMemberName = f"{parentName}.{res.paramName}"
+ if structMemberName in STRUCT_MEMBER_FILTER_VAR.keys():
+ res.filterVar = STRUCT_MEMBER_FILTER_VAR[structMemberName]
+
+ if structMemberName in STRUCT_MEMBER_FILTER_VALS.keys():
+ res.filterVals = STRUCT_MEMBER_FILTER_VALS[structMemberName]
+
+ if structMemberName in STRUCT_MEMBER_FILTER_FUNC.keys():
+ res.filterFunc = parseFilterFuncExpr(STRUCT_MEMBER_FILTER_FUNC[structMemberName])
+
+ if tag.attrib.get("filterOtherwise") is not None:
+ res.Otherwise = tag.attrib.get("filterOtherwise")
+
+ # store all other attribs here
+ res.attribs = dict(tag.attrib)
+
+ return res
+
+
+def makeVulkanTypeSimple(isConst,
+ typeName,
+ ptrIndirectionLevels,
+ paramName=None):
+ res = VulkanType()
+
+ res.typeName = typeName
+ res.isConst = isConst
+ res.pointerIndirectionLevels = ptrIndirectionLevels
+ res.isPointerToConstPointer = False
+ res.paramName = paramName
+ res.primitiveEncodingSize = None
+
+ return res
+
+
+# Classes for describing aggregate types (unions, structs) and API calls.
+class VulkanCompoundType(object):
+
+ def __init__(self, name: str, members: List[VulkanType], isUnion=False, structEnumExpr=None, structExtendsExpr=None, feature=None, initialEnv={}, optional=None):
+ self.name: str = name
+ self.typeName: str = name
+ self.members: List[VulkanType] = members
+ self.environment = initialEnv
+ self.isUnion = isUnion
+ self.structEnumExpr = structEnumExpr
+ self.structExtendsExpr = structExtendsExpr
+ self.feature = feature
+ if name in DEVICE_MEMORY_STRUCTS:
+ self.deviceMemoryInfoParameterIndices = DEVICE_MEMORY_STRUCTS[name]
+ else:
+ self.deviceMemoryInfoParameterIndices = None
+ self.isTransformed = name in TRANSFORMED_TYPES
+ self.copy = None
+ self.optionalStr = optional
+
+ def initCopies(self):
+ self.copy = self
+
+ for m in self.members:
+ m.parent = self.copy
+
+ def getMember(self, memberName) -> Optional[VulkanType]:
+ for m in self.members:
+ if m.paramName == memberName:
+ return m
+ return None
+
+ def getStructEnumExpr(self,):
+ return self.structEnumExpr
+
+ def getProtectStreamFeature(self) -> Optional[str]:
+ if not self.name in STRUCT_STREAM_FEATURE.keys():
+ return None
+ return STRUCT_STREAM_FEATURE[self.name]
+
+
+class VulkanAPI(object):
+
+ def __init__(self, name: str, retType: VulkanType, parameters, origName=None):
+ self.name: str = name
+ self.origName = name
+ self.retType: VulkanType = retType
+ self.parameters: List[VulkanType] = list(filter(lambda param: not param.shouldSkip(), parameters))
+
+ if name in DEVICE_MEMORY_COMMANDS.keys():
+ self.deviceMemoryInfoParameterIndices = DEVICE_MEMORY_COMMANDS[name]
+ else:
+ self.deviceMemoryInfoParameterIndices = None
+
+ self.copy = None
+
+ self.isTransformed = name in TRANSFORMED_TYPES
+
+ if origName:
+ self.origName = origName
+
+ def initCopies(self):
+ self.copy = self
+
+ for m in self.parameters:
+ m.parent = self.copy
+
+ def getCopy(self,):
+ return copy(self)
+
+ def getParameter(self, parameterName):
+ for p in self.parameters:
+ if p.paramName == parameterName:
+ return p
+ return None
+
+ def withModifiedName(self, newName):
+ res = VulkanAPI(newName, self.retType, self.parameters)
+ return res
+
+ def getRetVarExpr(self):
+ if self.retType.typeName == "void":
+ return None
+ return "%s_%s_return" % (self.name, self.retType.typeName)
+
+ def getRetTypeExpr(self):
+ return self.retType.typeName
+
+ def withCustomParameters(self, customParams):
+ res = self.getCopy()
+ res.parameters = customParams
+ return res
+
+ def withCustomReturnType(self, retType):
+ res = self.getCopy()
+ res.retType = retType
+ return res
+
+# Whether or not special handling of virtual elements
+# such as VkDeviceMemory is needed.
+def vulkanTypeNeedsTransform(structOrApi):
+ return structOrApi.deviceMemoryInfoParameterIndices != None
+
+def vulkanTypeGetNeededTransformTypes(structOrApi):
+ res = []
+ if structOrApi.deviceMemoryInfoParameterIndices != None:
+ res.append("devicememory")
+ return res
+
+def vulkanTypeforEachSubType(structOrApi, f):
+ toLoop = None
+ if type(structOrApi) == VulkanCompoundType:
+ toLoop = structOrApi.members
+ if type(structOrApi) == VulkanAPI:
+ toLoop = structOrApi.parameters
+
+ for (i, x) in enumerate(toLoop):
+ f(i, x)
+
+# Parses everything about Vulkan types into a Python readable format.
+class VulkanTypeInfo(object):
+
+ def __init__(self, generator):
+ self.generator = generator
+ self.categories: Set[str] = set([])
+
+ # Tracks what Vulkan type is part of what category.
+ self.typeCategories: Dict[str, str] = {}
+
+ # Tracks the primitive encoding size for each type, if applicable.
+ self.encodingSizes: Dict[str, Optional[int]] = {}
+
+ self.structs: Dict[str, VulkanCompoundType] = {}
+ self.apis: Dict[str, VulkanAPI] = {}
+
+ # Maps bitmask types to the enum type used for the flags
+ # E.g. "VkImageAspectFlags" -> "VkImageAspectFlagBits"
+ self.bitmasks: Dict[str, str] = {}
+
+ # Maps all enum names to their values.
+ # For aliases, the value is the name of the canonical enum
+ self.enumValues: Dict[str, Union[int, str]] = {}
+
+ # Maps enum to their xml element
+ self.enumElem = {}
+
+ self.feature = None
+
+ def initType(self, name: str, category: str):
+ self.categories.add(category)
+ self.typeCategories[name] = category
+ self.encodingSizes[name] = self.setPrimitiveEncodingSize(name)
+
+ def categoryOf(self, name):
+ return self.typeCategories[name]
+
+ def getPrimitiveEncodingSize(self, name):
+ return self.encodingSizes[name]
+
+ # Queries relating to categories of Vulkan types.
+ def isHandleType(self, name):
+ return self.typeCategories.get(name) == "handle"
+
+ def isCompoundType(self, name: str):
+ return self.typeCategories.get(name) in ["struct", "union"]
+
+ # Gets the best size in bytes
+ # for encoding/decoding a particular Vulkan type.
+ # If not applicable, returns None.
+ def setPrimitiveEncodingSize(self, name: str) -> Optional[int]:
+ baseEncodingSizes = {
+ "void": 8,
+ "char": 1,
+ "float": 4,
+ "uint8_t": 1,
+ "uint16_t": 2,
+ "uint32_t": 4,
+ "uint64_t": 8,
+ "int": 4,
+ "int8_t": 1,
+ "int16_t": 2,
+ "int32_t": 4,
+ "int64_t": 8,
+ "size_t": 8,
+ "ssize_t": 8,
+ "VkBool32": 4,
+ "zx_handle_t": 4,
+ }
+
+ if name in baseEncodingSizes:
+ return baseEncodingSizes[name]
+
+ category = self.typeCategories[name]
+
+ if category in [None, "api", "include", "define", "struct", "union"]:
+ return None
+
+ # Handles are pointers so they must be 8 bytes. Basetype includes VkDeviceSize which is 8 bytes.
+ if category in ["handle", "basetype", "funcpointer"]:
+ return 8
+
+ if category in ["enum", "bitmask"]:
+ return 4
+
+ def isNonAbiPortableType(self, typeName):
+ if typeName in EXPLICITLY_ABI_PORTABLE_TYPES:
+ return False
+
+ if typeName in EXPLICITLY_ABI_NON_PORTABLE_TYPES:
+ return True
+
+ category = self.typeCategories[typeName]
+ return category in NON_ABI_PORTABLE_TYPE_CATEGORIES
+
+ def onBeginFeature(self, featureName, featureType):
+ self.feature = featureName
+
+ def onEndFeature(self):
+ self.feature = None
+
+ def onGenType(self, typeinfo, name, alias):
+ category = typeinfo.elem.get("category")
+ self.initType(name, category)
+
+ if category in ["struct", "union"]:
+ self.onGenStruct(typeinfo, name, alias)
+
+ if category == "bitmask":
+ self.bitmasks[name] = typeinfo.elem.get("requires")
+
+ def onGenStruct(self, typeinfo, typeName, alias):
+ if not alias:
+ members: List[VulkanType] = []
+
+ structExtendsExpr = typeinfo.elem.get("structextends")
+
+ structEnumExpr = None
+
+ initialEnv = {}
+ envStr = typeinfo.elem.get("exists")
+ if envStr != None:
+ comma_separated = envStr.split(",")
+ name_type_pairs = map(lambda cs: tuple(map(lambda t: t.strip(), cs.split(":"))), comma_separated)
+ for (name, typ) in name_type_pairs:
+ initialEnv[name] = {
+ "type" : typ,
+ "binding" : None,
+ "structmember" : False,
+ "body" : None,
+ }
+
+ if typeName in STRUCT_ENV_STR.keys():
+ name_body_pairs = STRUCT_ENV_STR[typeName]
+ for (name, body) in name_body_pairs.items():
+ initialEnv[name] = {
+ "type" : "uint32_t",
+ "binding" : name,
+ "structmember" : False,
+ "body" : parseLetBodyExpr(body)
+ }
+
+ for member in typeinfo.elem.findall(".//member"):
+ if "api" in member.attrib.keys() and not "vulkan" == member.attrib["api"]:
+ continue
+ vulkanType = makeVulkanTypeFromXMLTag(self, typeName, member)
+ initialEnv[vulkanType.paramName] = {
+ "type": vulkanType.typeName,
+ "binding": vulkanType.paramName,
+ "structmember": True,
+ "body": None,
+ }
+ members.append(vulkanType)
+ if vulkanType.typeName == "VkStructureType" and \
+ member.get("values"):
+ structEnumExpr = member.get("values")
+
+ self.structs[typeName] = \
+ VulkanCompoundType(
+ typeName,
+ members,
+ isUnion = self.categoryOf(typeName) == "union",
+ structEnumExpr = structEnumExpr,
+ structExtendsExpr = structExtendsExpr,
+ feature = self.feature,
+ initialEnv = initialEnv,
+ optional = typeinfo.elem.get("optional", None))
+ self.structs[typeName].initCopies()
+
+ def onGenGroup(self, groupinfo, groupName, _alias=None):
+ self.initType(groupName, "enum")
+ enums = groupinfo.elem.findall("enum")
+ for enum in enums:
+ intVal, strVal = self.generator.enumToValue(enum, True)
+ self.enumValues[enum.get('name')] = intVal if intVal is not None else strVal
+ self.enumElem[enum.get('name')] = enum
+
+
+ def onGenEnum(self, enuminfo, name: str, alias):
+ self.initType(name, "enum")
+ value: str = enuminfo.elem.get("value")
+ self.enumElem[name] = enuminfo.elem
+ if value and value.isdigit():
+ self.enumValues[name] = int(value)
+ elif value and value[0] == '"' and value[-1] == '"':
+ self.enumValues[name] = value[1:-1]
+ elif alias is not None:
+ self.enumValues[name] = alias
+ else:
+ # There's about a dozen cases of using the bitwise NOT operator (e.g.: `(~0U)`, `(~0ULL)`)
+ # to concisely represent large values. Just ignore them for now.
+ # In the future, we can add a lookup table to convert these to int
+ return
+
+ def onGenCmd(self, cmdinfo, name, _alias):
+ self.initType(name, "api")
+
+ proto = cmdinfo.elem.find("proto")
+ params = cmdinfo.elem.findall("param")
+
+ self.apis[name] = \
+ VulkanAPI(
+ name,
+ makeVulkanTypeFromXMLTag(self, name, proto),
+ list(map(lambda p: makeVulkanTypeFromXMLTag(self, name, p),
+ params)))
+ self.apis[name].initCopies()
+
+ def onEnd(self):
+ pass
+
+def hasNullOptionalStringFeature(forEachType):
+ return (hasattr(forEachType, "onCheckWithNullOptionalStringFeature")) and \
+ (hasattr(forEachType, "endCheckWithNullOptionalStringFeature")) and \
+ (hasattr(forEachType, "finalCheckWithNullOptionalStringFeature"))
+
+
+# General function to iterate over a vulkan type and call code that processes
+# each of its sub-components, if any.
+def iterateVulkanType(typeInfo: VulkanTypeInfo, vulkanType: VulkanType, forEachType):
+ if not vulkanType.isArrayOfStrings():
+ if vulkanType.isPointerToConstPointer:
+ return False
+
+ if vulkanType.shouldSkip():
+ return False
+
+ forEachType.registerTypeInfo(typeInfo)
+
+ needCheck = vulkanType.isOptionalPointer()
+
+ if typeInfo.isCompoundType(vulkanType.typeName) and not vulkanType.isNextPointer():
+
+ if needCheck:
+ forEachType.onCheck(vulkanType)
+
+ forEachType.onCompoundType(vulkanType)
+
+ if needCheck:
+ forEachType.endCheck(vulkanType)
+
+ else:
+ if vulkanType.isString():
+ if needCheck and hasNullOptionalStringFeature(forEachType):
+ forEachType.onCheckWithNullOptionalStringFeature(vulkanType)
+ forEachType.onString(vulkanType)
+ forEachType.endCheckWithNullOptionalStringFeature(vulkanType)
+ forEachType.onString(vulkanType)
+ forEachType.finalCheckWithNullOptionalStringFeature(vulkanType)
+ elif needCheck:
+ forEachType.onCheck(vulkanType)
+ forEachType.onString(vulkanType)
+ forEachType.endCheck(vulkanType)
+ else:
+ forEachType.onString(vulkanType)
+
+ elif vulkanType.isArrayOfStrings():
+ forEachType.onStringArray(vulkanType)
+
+ elif vulkanType.staticArrExpr:
+ forEachType.onStaticArr(vulkanType)
+
+ elif vulkanType.isNextPointer():
+ if needCheck:
+ forEachType.onCheck(vulkanType)
+ forEachType.onStructExtension(vulkanType)
+ if needCheck:
+ forEachType.endCheck(vulkanType)
+
+ elif vulkanType.pointerIndirectionLevels > 0:
+ if needCheck:
+ forEachType.onCheck(vulkanType)
+ forEachType.onPointer(vulkanType)
+ if needCheck:
+ forEachType.endCheck(vulkanType)
+
+ else:
+ forEachType.onValue(vulkanType)
+
+ return True
+
+class VulkanTypeIterator(object):
+ def __init__(self,):
+ self.typeInfo = None
+
+ def registerTypeInfo(self, typeInfo):
+ self.typeInfo = typeInfo
+
+def vulkanTypeGetStructFieldLengthInfo(structInfo, vulkanType):
+ def getSpecialCaseVulkanStructFieldLength(structInfo, vulkanType):
+ cases = [
+ {
+ "structName": "VkShaderModuleCreateInfo",
+ "field": "pCode",
+ "lenExpr": "codeSize",
+ "postprocess": lambda expr: "(%s / 4)" % expr
+ },
+ {
+ "structName": "VkPipelineMultisampleStateCreateInfo",
+ "field": "pSampleMask",
+ "lenExpr": "rasterizationSamples",
+ "postprocess": lambda expr: "(((%s) + 31) / 32)" % expr
+ },
+ ]
+
+ for c in cases:
+ if (structInfo.name, vulkanType.paramName) == (c["structName"], c["field"]):
+ return c
+
+ return None
+
+ specialCaseAccess = getSpecialCaseVulkanStructFieldLength(structInfo, vulkanType)
+
+ if specialCaseAccess is not None:
+ return specialCaseAccess
+
+ lenExpr = vulkanType.getLengthExpression()
+
+ if lenExpr is None:
+ return None
+
+ return {
+ "structName": structInfo.name,
+ "field": vulkanType.typeName,
+ "lenExpr": lenExpr,
+ "postprocess": lambda expr: expr}
+
+
+class VulkanTypeProtobufInfo(object):
+ def __init__(self, typeInfo, structInfo, vulkanType):
+ self.needsMessage = typeInfo.isCompoundType(vulkanType.typeName)
+ self.isRepeatedString = vulkanType.isArrayOfStrings()
+ self.isString = vulkanType.isString() or (
+ vulkanType.typeName == "char" and (vulkanType.staticArrExpr != ""))
+
+ if structInfo is not None:
+ self.lengthInfo = vulkanTypeGetStructFieldLengthInfo(
+ structInfo, vulkanType)
+ else:
+ self.lengthInfo = vulkanType.getLengthExpression()
+
+ self.protobufType = None
+ self.origTypeCategory = typeInfo.categoryOf(vulkanType.typeName)
+
+ self.isExtensionStruct = \
+ vulkanType.typeName == "void" and \
+ vulkanType.pointerIndirectionLevels > 0 and \
+ vulkanType.paramName == "pNext"
+
+ if self.needsMessage:
+ return
+
+ if typeInfo.categoryOf(vulkanType.typeName) in ["enum", "bitmask"]:
+ self.protobufType = "uint32"
+
+ if typeInfo.categoryOf(vulkanType.typeName) in ["funcpointer", "handle", "define"]:
+ self.protobufType = "uint64"
+
+ if typeInfo.categoryOf(vulkanType.typeName) in ["basetype"]:
+ baseTypeMapping = {
+ "VkFlags" : "uint32",
+ "VkBool32" : "uint32",
+ "VkDeviceSize" : "uint64",
+ "VkSampleMask" : "uint32",
+ }
+ self.protobufType = baseTypeMapping[vulkanType.typeName]
+
+ if typeInfo.categoryOf(vulkanType.typeName) == None:
+
+ otherTypeMapping = {
+ "void" : "uint64",
+ "char" : "uint8",
+ "size_t" : "uint64",
+ "float" : "float",
+ "uint8_t" : "uint32",
+ "uint16_t" : "uint32",
+ "int32_t" : "int32",
+ "uint32_t" : "uint32",
+ "uint64_t" : "uint64",
+ "VkDeviceSize" : "uint64",
+ "VkSampleMask" : "uint32",
+ }
+
+ if vulkanType.typeName in otherTypeMapping:
+ self.protobufType = otherTypeMapping[vulkanType.typeName]
+ else:
+ self.protobufType = "uint64"
+
+
+ protobufCTypeMapping = {
+ "uint8" : "uint8_t",
+ "uint32" : "uint32_t",
+ "int32" : "int32_t",
+ "uint64" : "uint64_t",
+ "float" : "float",
+ "string" : "const char*",
+ }
+
+ self.protobufCType = protobufCTypeMapping[self.protobufType]
+
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/counting.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/counting.py
new file mode 100644
index 00000000000..849ceafc3e4
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/counting.py
@@ -0,0 +1,696 @@
+# 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.
+
+from copy import copy
+
+from .common.codegen import CodeGen
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType, VulkanTypeIterator, Atom, FuncExpr, FuncExprVal, FuncLambda
+
+from .wrapperdefs import VulkanWrapperGenerator
+from .wrapperdefs import ROOT_TYPE_VAR_NAME, ROOT_TYPE_PARAM
+from .wrapperdefs import STRUCT_EXTENSION_PARAM, STRUCT_EXTENSION_PARAM_FOR_WRITE, EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME
+
+class VulkanCountingCodegen(VulkanTypeIterator):
+ def __init__(self, cgen, featureBitsVar, toCountVar, countVar, rootTypeVar, prefix, forApiOutput=False, mapHandles=True, handleMapOverwrites=False, doFiltering=True):
+ self.cgen = cgen
+ self.featureBitsVar = featureBitsVar
+ self.toCountVar = toCountVar
+ self.rootTypeVar = rootTypeVar
+ self.countVar = countVar
+ self.prefix = prefix
+ self.forApiOutput = forApiOutput
+
+ self.exprAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.toCountVar, asPtr = True)
+ self.exprValueAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.toCountVar, asPtr = False)
+ self.exprPrimitiveValueAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.toCountVar, asPtr = False)
+
+ self.lenAccessor = lambda t: self.cgen.generalLengthAccess(t, parentVarName = self.toCountVar)
+ self.lenAccessorGuard = lambda t: self.cgen.generalLengthAccessGuard(t, parentVarName = self.toCountVar)
+ self.filterVarAccessor = lambda t: self.cgen.filterVarAccess(t, parentVarName = self.toCountVar)
+
+ self.checked = False
+
+ self.mapHandles = mapHandles
+ self.handleMapOverwrites = handleMapOverwrites
+ self.doFiltering = doFiltering
+
+ def getTypeForStreaming(self, vulkanType):
+ res = copy(vulkanType)
+
+ if not vulkanType.accessibleAsPointer():
+ res = res.getForAddressAccess()
+
+ if vulkanType.staticArrExpr:
+ res = res.getForAddressAccess()
+
+ return res
+
+ def makeCastExpr(self, vulkanType):
+ return "(%s)" % (
+ self.cgen.makeCTypeDecl(vulkanType, useParamName=False))
+
+ def genCount(self, sizeExpr):
+ self.cgen.stmt("*%s += %s" % (self.countVar, sizeExpr))
+
+ def genPrimitiveStreamCall(self, vulkanType):
+ self.genCount(str(self.cgen.countPrimitive(
+ self.typeInfo,
+ vulkanType)))
+
+ def genHandleMappingCall(self, vulkanType, access, lenAccess):
+
+ if lenAccess is None:
+ lenAccess = "1"
+ handle64Bytes = "8"
+ else:
+ handle64Bytes = "%s * 8" % lenAccess
+
+ handle64Var = self.cgen.var()
+ if lenAccess != "1":
+ self.cgen.beginIf(lenAccess)
+ # self.cgen.stmt("uint64_t* %s" % handle64Var)
+ # self.cgen.stmt(
+ # "%s->alloc((void**)&%s, %s * 8)" % \
+ # (self.streamVarName, handle64Var, lenAccess))
+ handle64VarAccess = handle64Var
+ handle64VarType = \
+ makeVulkanTypeSimple(False, "uint64_t", 1, paramName=handle64Var)
+ else:
+ self.cgen.stmt("uint64_t %s" % handle64Var)
+ handle64VarAccess = "&%s" % handle64Var
+ handle64VarType = \
+ makeVulkanTypeSimple(False, "uint64_t", 0, paramName=handle64Var)
+
+ if self.handleMapOverwrites:
+ # self.cgen.stmt(
+ # "static_assert(8 == sizeof(%s), \"handle map overwrite requres %s to be 8 bytes long\")" % \
+ # (vulkanType.typeName, vulkanType.typeName))
+ # self.cgen.stmt(
+ # "%s->handleMapping()->mapHandles_%s((%s*)%s, %s)" %
+ # (self.streamVarName, vulkanType.typeName, vulkanType.typeName,
+ # access, lenAccess))
+ self.genCount("8 * %s" % lenAccess)
+ else:
+ # self.cgen.stmt(
+ # "%s->handleMapping()->mapHandles_%s_u64(%s, %s, %s)" %
+ # (self.streamVarName, vulkanType.typeName,
+ # access,
+ # handle64VarAccess, lenAccess))
+ self.genCount(handle64Bytes)
+
+ if lenAccess != "1":
+ self.cgen.endIf()
+
+ def doAllocSpace(self, vulkanType):
+ pass
+
+ def getOptionalStringFeatureExpr(self, vulkanType):
+ feature = vulkanType.getProtectStreamFeature()
+ if feature is None:
+ return None
+ return "%s & %s" % (self.featureBitsVar, feature)
+
+ def onCheck(self, vulkanType):
+
+ if self.forApiOutput:
+ return
+
+ featureExpr = self.getOptionalStringFeatureExpr(vulkanType);
+
+ self.checked = True
+
+ access = self.exprAccessor(vulkanType)
+
+ needConsistencyCheck = False
+
+ self.cgen.line("// WARNING PTR CHECK")
+ checkAccess = self.exprAccessor(vulkanType)
+ addrExpr = "&" + checkAccess
+ sizeExpr = self.cgen.sizeofExpr(vulkanType)
+
+ if featureExpr is not None:
+ self.cgen.beginIf(featureExpr)
+
+ self.genPrimitiveStreamCall(
+ vulkanType)
+
+ if featureExpr is not None:
+ self.cgen.endIf()
+
+ if featureExpr is not None:
+ self.cgen.beginIf("(!(%s) || %s)" % (featureExpr, access))
+ else:
+ self.cgen.beginIf(access)
+
+ if needConsistencyCheck and featureExpr is None:
+ self.cgen.beginIf("!(%s)" % checkName)
+ self.cgen.stmt(
+ "fprintf(stderr, \"fatal: %s inconsistent between guest and host\\n\")" % (access))
+ self.cgen.endIf()
+
+
+ def onCheckWithNullOptionalStringFeature(self, vulkanType):
+ self.cgen.beginIf("%s & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT" % self.featureBitsVar)
+ self.onCheck(vulkanType)
+
+ def endCheckWithNullOptionalStringFeature(self, vulkanType):
+ self.endCheck(vulkanType)
+ self.cgen.endIf()
+ self.cgen.beginElse()
+
+ def finalCheckWithNullOptionalStringFeature(self, vulkanType):
+ self.cgen.endElse()
+
+ def endCheck(self, vulkanType):
+
+ if self.checked:
+ self.cgen.endIf()
+ self.checked = False
+
+ def genFilterFunc(self, filterfunc, env):
+
+ def loop(expr, lambdaEnv={}):
+ def do_func(expr):
+ fnamestr = expr.name.name
+ if "not" == fnamestr:
+ return "!(%s)" % (loop(expr.args[0], lambdaEnv))
+ if "eq" == fnamestr:
+ return "(%s == %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "and" == fnamestr:
+ return "(%s && %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "or" == fnamestr:
+ return "(%s || %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "bitwise_and" == fnamestr:
+ return "(%s & %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "getfield" == fnamestr:
+ ptrlevels = get_ptrlevels(expr.args[0].val.name)
+ if ptrlevels == 0:
+ return "%s.%s" % (loop(expr.args[0], lambdaEnv), expr.args[1].val)
+ else:
+ return "(%s(%s)).%s" % ("*" * ptrlevels, loop(expr.args[0], lambdaEnv), expr.args[1].val)
+
+ if "if" == fnamestr:
+ return "((%s) ? (%s) : (%s))" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv), loop(expr.args[2], lambdaEnv))
+
+ return "%s(%s)" % (fnamestr, ", ".join(map(lambda e: loop(e, lambdaEnv), expr.args)))
+
+ def do_expratom(atomname, lambdaEnv= {}):
+ if lambdaEnv.get(atomname, None) is not None:
+ return atomname
+
+ enventry = env.get(atomname, None)
+ if None != enventry:
+ return self.getEnvAccessExpr(atomname)
+ return atomname
+
+ def get_ptrlevels(atomname, lambdaEnv= {}):
+ if lambdaEnv.get(atomname, None) is not None:
+ return 0
+
+ enventry = env.get(atomname, None)
+ if None != enventry:
+ return self.getPointerIndirectionLevels(atomname)
+
+ return 0
+
+ def do_exprval(expr, lambdaEnv= {}):
+ expratom = expr.val
+
+ if Atom == type(expratom):
+ return do_expratom(expratom.name, lambdaEnv)
+
+ return "%s" % expratom
+
+ def do_lambda(expr, lambdaEnv= {}):
+ params = expr.vs
+ body = expr.body
+ newEnv = {}
+
+ for (k, v) in lambdaEnv.items():
+ newEnv[k] = v
+
+ for p in params:
+ newEnv[p.name] = p.typ
+
+ return "[](%s) { return %s; }" % (", ".join(list(map(lambda p: "%s %s" % (p.typ, p.name), params))), loop(body, lambdaEnv=newEnv))
+
+ if FuncExpr == type(expr):
+ return do_func(expr)
+ if FuncLambda == type(expr):
+ return do_lambda(expr)
+ elif FuncExprVal == type(expr):
+ return do_exprval(expr)
+
+ return loop(filterfunc)
+
+ def beginFilterGuard(self, vulkanType):
+ if vulkanType.filterVar == None:
+ return
+
+ if self.doFiltering == False:
+ return
+
+ filterVarAccess = self.getEnvAccessExpr(vulkanType.filterVar)
+
+ filterValsExpr = None
+ filterFuncExpr = None
+ filterExpr = None
+
+ filterFeature = "%s & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT" % self.featureBitsVar
+
+ if None != vulkanType.filterVals:
+ filterValsExpr = " || ".join(map(lambda filterval: "(%s == %s)" % (filterval, filterVarAccess), vulkanType.filterVals))
+
+ if None != vulkanType.filterFunc:
+ filterFuncExpr = self.genFilterFunc(vulkanType.filterFunc, self.currentStructInfo.environment)
+
+ if None != filterValsExpr and None != filterFuncExpr:
+ filterExpr = "%s || %s" % (filterValsExpr, filterFuncExpr)
+ elif None == filterValsExpr and None == filterFuncExpr:
+ # Assume is bool
+ self.cgen.beginIf(filterVarAccess)
+ elif None != filterValsExpr:
+ self.cgen.beginIf("(!(%s) || (%s))" % (filterFeature, filterValsExpr))
+ elif None != filterFuncExpr:
+ self.cgen.beginIf("(!(%s) || (%s))" % (filterFeature, filterFuncExpr))
+
+ def endFilterGuard(self, vulkanType, cleanupExpr=None):
+ if vulkanType.filterVar == None:
+ return
+
+ if self.doFiltering == False:
+ return
+
+ if cleanupExpr == None:
+ self.cgen.endIf()
+ else:
+ self.cgen.endIf()
+ self.cgen.beginElse()
+ self.cgen.stmt(cleanupExpr)
+ self.cgen.endElse()
+
+ def getEnvAccessExpr(self, varName):
+ parentEnvEntry = self.currentStructInfo.environment.get(varName, None)
+
+ if parentEnvEntry != None:
+ isParentMember = parentEnvEntry["structmember"]
+
+ if isParentMember:
+ envAccess = self.exprValueAccessor(list(filter(lambda member: member.paramName == varName, self.currentStructInfo.members))[0])
+ else:
+ envAccess = varName
+ return envAccess
+
+ return None
+
+ def getPointerIndirectionLevels(self, varName):
+ parentEnvEntry = self.currentStructInfo.environment.get(varName, None)
+
+ if parentEnvEntry != None:
+ isParentMember = parentEnvEntry["structmember"]
+
+ if isParentMember:
+ return list(filter(lambda member: member.paramName == varName, self.currentStructInfo.members))[0].pointerIndirectionLevels
+ else:
+ return 0
+ return 0
+
+ return 0
+
+
+ def onCompoundType(self, vulkanType):
+
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ self.beginFilterGuard(vulkanType)
+
+ if vulkanType.pointerIndirectionLevels > 0:
+ self.doAllocSpace(vulkanType)
+
+ if lenAccess is not None:
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ loopVar = "i"
+ access = "%s + %s" % (access, loopVar)
+ forInit = "uint32_t %s = 0" % loopVar
+ forCond = "%s < (uint32_t)%s" % (loopVar, lenAccess)
+ forIncr = "++%s" % loopVar
+ self.cgen.beginFor(forInit, forCond, forIncr)
+
+ accessWithCast = "%s(%s)" % (self.makeCastExpr(
+ self.getTypeForStreaming(vulkanType)), access)
+
+ callParams = [self.featureBitsVar,
+ self.rootTypeVar, accessWithCast, self.countVar]
+
+ for (bindName, localName) in vulkanType.binds.items():
+ callParams.append(self.getEnvAccessExpr(localName))
+
+ self.cgen.funcCall(None, self.prefix + vulkanType.typeName,
+ callParams)
+
+ if lenAccess is not None:
+ self.cgen.endFor()
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+
+ self.endFilterGuard(vulkanType)
+
+ def onString(self, vulkanType):
+ access = self.exprAccessor(vulkanType)
+ self.genCount("sizeof(uint32_t) + (%s ? strlen(%s) : 0)" % (access, access))
+
+ def onStringArray(self, vulkanType):
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ self.genCount("sizeof(uint32_t)")
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ self.cgen.beginFor("uint32_t i = 0", "i < %s" % lenAccess, "++i")
+ self.cgen.stmt("size_t l = %s[i] ? strlen(%s[i]) : 0" % (access, access))
+ self.genCount("sizeof(uint32_t) + (%s[i] ? strlen(%s[i]) : 0)" % (access, access))
+ self.cgen.endFor()
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+
+ def onStaticArr(self, vulkanType):
+ access = self.exprValueAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ finalLenExpr = "%s * %s" % (lenAccess, self.cgen.sizeofExpr(vulkanType))
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+ self.genCount(finalLenExpr)
+
+ def onStructExtension(self, vulkanType):
+ sTypeParam = copy(vulkanType)
+ sTypeParam.paramName = "sType"
+
+ access = self.exprAccessor(vulkanType)
+ sizeVar = "%s_size" % vulkanType.paramName
+
+ castedAccessExpr = access
+
+ sTypeAccess = self.exprAccessor(sTypeParam)
+ self.cgen.beginIf("%s == VK_STRUCTURE_TYPE_MAX_ENUM" %
+ self.rootTypeVar)
+ self.cgen.stmt("%s = %s" % (self.rootTypeVar, sTypeAccess))
+ self.cgen.endIf()
+
+ self.cgen.funcCall(None, self.prefix + "extension_struct",
+ [self.featureBitsVar, self.rootTypeVar, castedAccessExpr, self.countVar])
+
+
+ def onPointer(self, vulkanType):
+ access = self.exprAccessor(vulkanType)
+
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ self.beginFilterGuard(vulkanType)
+ self.doAllocSpace(vulkanType)
+
+ if vulkanType.filterVar != None:
+ print("onPointer Needs filter: %s filterVar %s" % (access, vulkanType.filterVar))
+
+ if vulkanType.isHandleType() and self.mapHandles:
+ self.genHandleMappingCall(vulkanType, access, lenAccess)
+ else:
+ if self.typeInfo.isNonAbiPortableType(vulkanType.typeName):
+ if lenAccess is not None:
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ self.cgen.beginFor("uint32_t i = 0", "i < (uint32_t)%s" % lenAccess, "++i")
+ self.genPrimitiveStreamCall(vulkanType.getForValueAccess())
+ self.cgen.endFor()
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+ else:
+ self.genPrimitiveStreamCall(vulkanType.getForValueAccess())
+ else:
+ if lenAccess is not None:
+ needLenAccessGuard = True
+ finalLenExpr = "%s * %s" % (
+ lenAccess, self.cgen.sizeofExpr(vulkanType.getForValueAccess()))
+ else:
+ needLenAccessGuard = False
+ finalLenExpr = "%s" % (
+ self.cgen.sizeofExpr(vulkanType.getForValueAccess()))
+ if needLenAccessGuard and lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ self.genCount(finalLenExpr)
+ if needLenAccessGuard and lenAccessGuard is not None:
+ self.cgen.endIf()
+
+ self.endFilterGuard(vulkanType)
+
+ def onValue(self, vulkanType):
+ self.beginFilterGuard(vulkanType)
+
+ if vulkanType.isHandleType() and self.mapHandles:
+ access = self.exprAccessor(vulkanType)
+ if vulkanType.filterVar != None:
+ print("onValue Needs filter: %s filterVar %s" % (access, vulkanType.filterVar))
+ self.genHandleMappingCall(
+ vulkanType.getForAddressAccess(), access, "1")
+ elif self.typeInfo.isNonAbiPortableType(vulkanType.typeName):
+ access = self.exprPrimitiveValueAccessor(vulkanType)
+ self.genPrimitiveStreamCall(vulkanType)
+ else:
+ access = self.exprAccessor(vulkanType)
+ self.genCount(self.cgen.sizeofExpr(vulkanType))
+
+ self.endFilterGuard(vulkanType)
+
+ def streamLetParameter(self, structInfo, letParamInfo):
+ filterFeature = "%s & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT" % (self.featureBitsVar)
+ self.cgen.stmt("%s %s = 1" % (letParamInfo.typeName, letParamInfo.paramName))
+
+ self.cgen.beginIf(filterFeature)
+
+ bodyExpr = self.currentStructInfo.environment[letParamInfo.paramName]["body"]
+ self.cgen.stmt("%s = %s" % (letParamInfo.paramName, self.genFilterFunc(bodyExpr, self.currentStructInfo.environment)))
+
+ self.genPrimitiveStreamCall(letParamInfo)
+
+ self.cgen.endIf()
+
+class VulkanCounting(VulkanWrapperGenerator):
+
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.codegen = CodeGen()
+
+ self.featureBitsVar = "featureBits"
+ self.featureBitsVarType = makeVulkanTypeSimple(False, "uint32_t", 0, self.featureBitsVar)
+ self.countingPrefix = "count_"
+ self.countVars = ["toCount", "count"]
+ self.countVarType = makeVulkanTypeSimple(False, "size_t", 1, self.countVars[1])
+ self.voidType = makeVulkanTypeSimple(False, "void", 0)
+ self.rootTypeVar = ROOT_TYPE_VAR_NAME
+
+ self.countingCodegen = \
+ VulkanCountingCodegen(
+ self.codegen,
+ self.featureBitsVar,
+ self.countVars[0],
+ self.countVars[1],
+ self.rootTypeVar,
+ self.countingPrefix)
+
+ self.knownDefs = {}
+
+ self.extensionCountingPrototype = \
+ VulkanAPI(self.countingPrefix + "extension_struct",
+ self.voidType,
+ [self.featureBitsVarType,
+ ROOT_TYPE_PARAM,
+ STRUCT_EXTENSION_PARAM,
+ self.countVarType])
+
+ def onBegin(self,):
+ VulkanWrapperGenerator.onBegin(self)
+ self.module.appendImpl(self.codegen.makeFuncDecl(
+ self.extensionCountingPrototype))
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ if name in self.knownDefs:
+ return
+
+ category = self.typeInfo.categoryOf(name)
+
+ if category in ["struct", "union"] and alias:
+ # TODO(liyl): might not work if freeParams != []
+ self.module.appendHeader(
+ self.codegen.makeFuncAlias(self.countingPrefix + name,
+ self.countingPrefix + alias))
+
+ if category in ["struct", "union"] and not alias:
+
+ structInfo = self.typeInfo.structs[name]
+
+ freeParams = []
+ letParams = []
+
+ for (envname, bindingInfo) in list(sorted(structInfo.environment.items(), key = lambda kv: kv[0])):
+ if None == bindingInfo["binding"]:
+ freeParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname))
+ else:
+ if not bindingInfo["structmember"]:
+ letParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname))
+
+ typeFromName = \
+ lambda varname: \
+ makeVulkanTypeSimple(True, name, 1, varname)
+
+ countingParams = \
+ [makeVulkanTypeSimple(False, "uint32_t", 0, self.featureBitsVar),
+ ROOT_TYPE_PARAM,
+ typeFromName(self.countVars[0]),
+ makeVulkanTypeSimple(False, "size_t", 1, self.countVars[1])]
+
+ countingPrototype = \
+ VulkanAPI(self.countingPrefix + name,
+ self.voidType,
+ countingParams + freeParams)
+
+ countingPrototypeNoFilter = \
+ VulkanAPI(self.countingPrefix + name,
+ self.voidType,
+ countingParams)
+
+ def structCountingDef(cgen):
+ self.countingCodegen.cgen = cgen
+ self.countingCodegen.currentStructInfo = structInfo
+ cgen.stmt("(void)%s" % self.featureBitsVar);
+ cgen.stmt("(void)%s" % self.rootTypeVar);
+ cgen.stmt("(void)%s" % self.countVars[0]);
+ cgen.stmt("(void)%s" % self.countVars[1]);
+
+ if category == "struct":
+ # marshal 'let' parameters first
+ for letp in letParams:
+ self.countingCodegen.streamLetParameter(self.typeInfo, letp)
+
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.countingCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.countingCodegen)
+
+ def structCountingDefNoFilter(cgen):
+ self.countingCodegen.cgen = cgen
+ self.countingCodegen.currentStructInfo = structInfo
+ self.countingCodegen.doFiltering = False
+ cgen.stmt("(void)%s" % self.featureBitsVar);
+ cgen.stmt("(void)%s" % self.rootTypeVar);
+ cgen.stmt("(void)%s" % self.countVars[0]);
+ cgen.stmt("(void)%s" % self.countVars[1]);
+
+ if category == "struct":
+ # marshal 'let' parameters first
+ for letp in letParams:
+ self.countingCodegen.streamLetParameter(self.typeInfo, letp)
+
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.countingCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.countingCodegen)
+
+ self.countingCodegen.doFiltering = True
+
+ self.module.appendHeader(
+ self.codegen.makeFuncDecl(countingPrototype))
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(countingPrototype, structCountingDef))
+
+ if freeParams != []:
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(countingPrototypeNoFilter))
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ countingPrototypeNoFilter, structCountingDefNoFilter))
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ def doExtensionStructCountCodegen(self, cgen, extParam, forEach, funcproto):
+ accessVar = "structAccess"
+ sizeVar = "currExtSize"
+ cgen.stmt("VkInstanceCreateInfo* %s = (VkInstanceCreateInfo*)(%s)" % (accessVar, extParam.paramName))
+ cgen.stmt("size_t %s = %s(%s, %s, %s)" % (sizeVar, EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME,
+ self.featureBitsVar, ROOT_TYPE_VAR_NAME, extParam.paramName))
+
+ cgen.beginIf("!%s && %s" % (sizeVar, extParam.paramName))
+
+ cgen.line("// unknown struct extension; skip and call on its pNext field");
+ cgen.funcCall(None, funcproto.name, [
+ self.featureBitsVar, ROOT_TYPE_VAR_NAME, "(void*)%s->pNext" % accessVar, self.countVars[1]])
+ cgen.stmt("return")
+
+ cgen.endIf()
+ cgen.beginElse()
+
+ cgen.line("// known or null extension struct")
+
+ cgen.stmt("*%s += sizeof(uint32_t)" % self.countVars[1])
+
+ cgen.beginIf("!%s" % (sizeVar))
+ cgen.line("// exit if this was a null extension struct (size == 0 in this branch)")
+ cgen.stmt("return")
+ cgen.endIf()
+
+ cgen.endIf()
+
+ cgen.stmt("*%s += sizeof(VkStructureType)" % self.countVars[1])
+
+ def fatalDefault(cgen):
+ cgen.line("// fatal; the switch is only taken if the extension struct is known");
+ cgen.stmt("abort()")
+ pass
+
+ self.emitForEachStructExtension(
+ cgen,
+ makeVulkanTypeSimple(False, "void", 0, "void"),
+ extParam,
+ forEach,
+ defaultEmit=fatalDefault,
+ rootTypeVar=ROOT_TYPE_PARAM)
+
+ def onEnd(self,):
+ VulkanWrapperGenerator.onEnd(self)
+
+ def forEachExtensionCounting(ext, castedAccess, cgen):
+ cgen.funcCall(None, self.countingPrefix + ext.name,
+ [self.featureBitsVar, self.rootTypeVar, castedAccess, self.countVars[1]])
+
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(
+ self.extensionCountingPrototype,
+ lambda cgen: self.doExtensionStructCountCodegen(
+ cgen,
+ STRUCT_EXTENSION_PARAM,
+ forEachExtensionCounting,
+ self.extensionCountingPrototype)))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/decoder.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/decoder.py
new file mode 100644
index 00000000000..c0e56378722
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/decoder.py
@@ -0,0 +1,945 @@
+from .common.codegen import CodeGen, VulkanWrapperGenerator
+from .common.vulkantypes import VulkanAPI, makeVulkanTypeSimple, iterateVulkanType, VulkanTypeInfo,\
+ VulkanType
+
+from .marshaling import VulkanMarshalingCodegen
+from .reservedmarshaling import VulkanReservedMarshalingCodegen
+from .transform import TransformCodegen
+
+from .wrapperdefs import API_PREFIX_MARSHAL
+from .wrapperdefs import API_PREFIX_RESERVEDUNMARSHAL
+from .wrapperdefs import MAX_PACKET_LENGTH
+from .wrapperdefs import VULKAN_STREAM_TYPE
+from .wrapperdefs import ROOT_TYPE_DEFAULT_VALUE
+from .wrapperdefs import RELAXED_APIS
+
+
+SKIPPED_DECODER_DELETES = [
+ "vkFreeDescriptorSets",
+]
+
+DELAYED_DECODER_DELETES = [
+ "vkDestroyPipelineLayout",
+]
+
+global_state_prefix = "m_state->on_"
+
+decoder_decl_preamble = """
+
+namespace gfxstream {
+class IOStream;
+} // namespace gfxstream
+
+namespace gfxstream {
+namespace vk {
+
+class VkDecoder {
+public:
+ VkDecoder();
+ ~VkDecoder();
+ void setForSnapshotLoad(bool forSnapshotLoad);
+ size_t decode(void* buf, size_t bufsize, IOStream* stream,
+ const ProcessResources* processResources, const VkDecoderContext&);
+private:
+ class Impl;
+ std::unique_ptr<Impl> mImpl;
+};
+
+} // namespace vk
+} // namespace gfxstream
+
+"""
+
+decoder_impl_preamble ="""
+namespace gfxstream {
+namespace vk {
+
+using android::base::MetricEventBadPacketLength;
+using android::base::MetricEventDuplicateSequenceNum;
+
+class VkDecoder::Impl {
+public:
+ Impl() : m_logCalls(android::base::getEnvironmentVariable("ANDROID_EMU_VK_LOG_CALLS") == "1"),
+ m_vk(vkDispatch()),
+ m_state(VkDecoderGlobalState::get()),
+ m_boxedHandleUnwrapMapping(m_state),
+ m_boxedHandleCreateMapping(m_state),
+ m_boxedHandleDestroyMapping(m_state),
+ m_boxedHandleUnwrapAndDeleteMapping(m_state),
+ m_boxedHandleUnwrapAndDeletePreserveBoxedMapping(m_state),
+ m_prevSeqno(std::nullopt) {}
+ %s* stream() { return &m_vkStream; }
+ VulkanMemReadingStream* readStream() { return &m_vkMemReadingStream; }
+
+ void setForSnapshotLoad(bool forSnapshotLoad) {
+ m_forSnapshotLoad = forSnapshotLoad;
+ }
+
+ size_t decode(void* buf, size_t bufsize, IOStream* stream,
+ const ProcessResources* processResources, const VkDecoderContext&);
+
+private:
+ bool m_logCalls;
+ bool m_forSnapshotLoad = false;
+ VulkanDispatch* m_vk;
+ VkDecoderGlobalState* m_state;
+ %s m_vkStream { nullptr };
+ VulkanMemReadingStream m_vkMemReadingStream { nullptr };
+ BoxedHandleUnwrapMapping m_boxedHandleUnwrapMapping;
+ BoxedHandleCreateMapping m_boxedHandleCreateMapping;
+ BoxedHandleDestroyMapping m_boxedHandleDestroyMapping;
+ BoxedHandleUnwrapAndDeleteMapping m_boxedHandleUnwrapAndDeleteMapping;
+ android::base::BumpPool m_pool;
+ BoxedHandleUnwrapAndDeletePreserveBoxedMapping m_boxedHandleUnwrapAndDeletePreserveBoxedMapping;
+ std::optional<uint32_t> m_prevSeqno;
+};
+
+VkDecoder::VkDecoder() :
+ mImpl(new VkDecoder::Impl()) { }
+
+VkDecoder::~VkDecoder() = default;
+
+void VkDecoder::setForSnapshotLoad(bool forSnapshotLoad) {
+ mImpl->setForSnapshotLoad(forSnapshotLoad);
+}
+
+size_t VkDecoder::decode(void* buf, size_t bufsize, IOStream* stream,
+ const ProcessResources* processResources,
+ const VkDecoderContext& context) {
+ return mImpl->decode(buf, bufsize, stream, processResources, context);
+}
+
+// VkDecoder::Impl::decode to follow
+""" % (VULKAN_STREAM_TYPE, VULKAN_STREAM_TYPE)
+
+decoder_impl_postamble = """
+
+} // namespace vk
+} // namespace gfxstream
+
+"""
+
+READ_STREAM = "vkReadStream"
+WRITE_STREAM = "vkStream"
+
+# Driver workarounds for APIs that don't work well multithreaded
+driver_workarounds_global_lock_apis = [ \
+ "vkCreatePipelineLayout",
+ "vkDestroyPipelineLayout",
+]
+
+def emit_param_decl_for_reading(param, cgen):
+ if param.staticArrExpr:
+ cgen.stmt(
+ cgen.makeRichCTypeDecl(param.getForNonConstAccess()))
+ else:
+ cgen.stmt(
+ cgen.makeRichCTypeDecl(param))
+
+def emit_unmarshal(typeInfo, param, cgen, output = False, destroy = False, noUnbox = False):
+ if destroy:
+ iterateVulkanType(typeInfo, param, VulkanReservedMarshalingCodegen(
+ cgen,
+ "host",
+ READ_STREAM,
+ ROOT_TYPE_DEFAULT_VALUE,
+ param.paramName,
+ "readStreamPtrPtr",
+ API_PREFIX_RESERVEDUNMARSHAL,
+ "",
+ direction="read",
+ dynAlloc=True))
+ lenAccess = cgen.generalLengthAccess(param)
+ lenAccessGuard = cgen.generalLengthAccessGuard(param)
+ if None == lenAccess or "1" == lenAccess:
+ cgen.stmt("boxed_%s_preserve = %s" % (param.paramName, param.paramName))
+ cgen.stmt("%s = unbox_%s(%s)" % (param.paramName, param.typeName, param.paramName))
+ else:
+ if lenAccessGuard is not None:
+ cgen.beginIf(lenAccessGuard)
+ cgen.beginFor("uint32_t i = 0", "i < %s" % lenAccess, "++i")
+ cgen.stmt("boxed_%s_preserve[i] = %s[i]" % (param.paramName, param.paramName))
+ cgen.stmt("((%s*)(%s))[i] = unbox_%s(%s[i])" % (param.typeName, param.paramName, param.typeName, param.paramName))
+ cgen.endFor()
+ if lenAccessGuard is not None:
+ cgen.endIf()
+ else:
+ if noUnbox:
+ cgen.line("// No unbox for %s" % (param.paramName))
+ iterateVulkanType(typeInfo, param, VulkanReservedMarshalingCodegen(
+ cgen,
+ "host",
+ READ_STREAM,
+ ROOT_TYPE_DEFAULT_VALUE,
+ param.paramName,
+ "readStreamPtrPtr",
+ API_PREFIX_RESERVEDUNMARSHAL,
+ "" if (output or noUnbox) else "unbox_",
+ direction="read",
+ dynAlloc=True))
+
+
+def emit_dispatch_unmarshal(typeInfo: VulkanTypeInfo, param: VulkanType, cgen, globalWrapped):
+ cgen.stmt("// Begin {} wrapped dispatchable handle unboxing for {}".format(
+ "global" if globalWrapped else "non",
+ param.paramName))
+
+ iterateVulkanType(typeInfo, param, VulkanReservedMarshalingCodegen(
+ cgen,
+ "host",
+ READ_STREAM,
+ ROOT_TYPE_DEFAULT_VALUE,
+ param.paramName,
+ "readStreamPtrPtr",
+ API_PREFIX_RESERVEDUNMARSHAL,
+ "",
+ direction="read",
+ dynAlloc=True))
+
+ if not globalWrapped:
+ cgen.stmt("auto unboxed_%s = unbox_%s(%s)" %
+ (param.paramName, param.typeName, param.paramName))
+ cgen.stmt("auto vk = dispatch_%s(%s)" %
+ (param.typeName, param.paramName))
+ cgen.stmt("// End manual dispatchable handle unboxing for %s" % param.paramName)
+
+
+def emit_transform(typeInfo, param, cgen, variant="tohost"):
+ res = iterateVulkanType(typeInfo, param, TransformCodegen(
+ cgen, param.paramName, "m_state", "transform_%s_" % variant, variant))
+ if not res:
+ cgen.stmt("(void)%s" % param.paramName)
+
+
+def emit_marshal(typeInfo, param, cgen, handleMapOverwrites=False):
+ iterateVulkanType(typeInfo, param, VulkanMarshalingCodegen(
+ cgen,
+ WRITE_STREAM,
+ ROOT_TYPE_DEFAULT_VALUE,
+ param.paramName,
+ API_PREFIX_MARSHAL,
+ direction="write",
+ handleMapOverwrites=handleMapOverwrites))
+
+
+class DecodingParameters(object):
+ def __init__(self, api: VulkanAPI):
+ self.params: list[VulkanType] = []
+ self.toRead: list[VulkanType] = []
+ self.toWrite: list[VulkanType] = []
+
+ for i, param in enumerate(api.parameters):
+ if i == 0 and param.isDispatchableHandleType():
+ param.dispatchHandle = True
+
+ if param.isNonDispatchableHandleType() and param.isCreatedBy(api):
+ param.nonDispatchableHandleCreate = True
+
+ if param.isNonDispatchableHandleType() and param.isDestroyedBy(api):
+ param.nonDispatchableHandleDestroy = True
+
+ if param.isDispatchableHandleType() and param.isCreatedBy(api):
+ param.dispatchableHandleCreate = True
+
+ if param.isDispatchableHandleType() and param.isDestroyedBy(api):
+ param.dispatchableHandleDestroy = True
+
+ self.toRead.append(param)
+
+ if param.possiblyOutput():
+ self.toWrite.append(param)
+
+ self.params.append(param)
+
+
+def emit_call_log(api, cgen):
+ decodingParams = DecodingParameters(api)
+ paramsToRead = decodingParams.toRead
+
+ cgen.beginIf("m_logCalls")
+ paramLogFormat = ""
+ paramLogArgs = []
+ for p in paramsToRead:
+ paramLogFormat += "0x%llx "
+ for p in paramsToRead:
+ paramLogArgs.append("(unsigned long long)%s" % (p.paramName))
+ cgen.stmt("fprintf(stderr, \"stream %%p: call %s %s\\n\", ioStream, %s)" % (api.name, paramLogFormat, ", ".join(paramLogArgs)))
+ cgen.endIf()
+
+def emit_decode_parameters(typeInfo: VulkanTypeInfo, api: VulkanAPI, cgen, globalWrapped=False):
+ decodingParams = DecodingParameters(api)
+
+ paramsToRead = decodingParams.toRead
+
+ for p in paramsToRead:
+ emit_param_decl_for_reading(p, cgen)
+
+ for i, p in enumerate(paramsToRead):
+ lenAccess = cgen.generalLengthAccess(p)
+
+ if p.dispatchHandle:
+ emit_dispatch_unmarshal(typeInfo, p, cgen, globalWrapped)
+ else:
+ destroy = p.nonDispatchableHandleDestroy or p.dispatchableHandleDestroy
+ noUnbox = api.name in ["vkQueueFlushCommandsGOOGLE", "vkQueueFlushCommandsFromAuxMemoryGOOGLE"] and p.paramName == "commandBuffer"
+
+ if p.nonDispatchableHandleDestroy or p.dispatchableHandleDestroy:
+ destroy = True
+ cgen.stmt("// Begin manual non dispatchable handle destroy unboxing for %s" % p.paramName)
+ if None == lenAccess or "1" == lenAccess:
+ cgen.stmt("%s boxed_%s_preserve" % (p.typeName, p.paramName))
+ else:
+ cgen.stmt("%s* boxed_%s_preserve; %s->alloc((void**)&boxed_%s_preserve, %s * sizeof(%s))" % (p.typeName, p.paramName, READ_STREAM, p.paramName, lenAccess, p.typeName))
+
+ if p.possiblyOutput():
+ cgen.stmt("// Begin manual dispatchable handle unboxing for %s" % p.paramName)
+ cgen.stmt("%s->unsetHandleMapping()" % READ_STREAM)
+
+ emit_unmarshal(typeInfo, p, cgen, output = p.possiblyOutput(), destroy = destroy, noUnbox = noUnbox)
+
+ for p in paramsToRead:
+ emit_transform(typeInfo, p, cgen, variant="tohost")
+
+ emit_call_log(api, cgen)
+
+def emit_dispatch_call(api, cgen):
+
+ decodingParams = DecodingParameters(api)
+
+ customParams = []
+
+ delay = api.name in DELAYED_DECODER_DELETES
+
+ for i, p in enumerate(api.parameters):
+ customParam = p.paramName
+ if decodingParams.params[i].dispatchHandle:
+ customParam = "unboxed_%s" % p.paramName
+ customParams.append(customParam)
+
+ if delay:
+ cgen.line("std::function<void()> delayed_remove_callback = [vk, %s]() {" % ", ".join(customParams))
+
+ if api.name in driver_workarounds_global_lock_apis:
+ if delay:
+ cgen.stmt("auto state = VkDecoderGlobalState::get()")
+ cgen.stmt("// state already locked")
+ else:
+ cgen.stmt("m_state->lock()")
+
+ cgen.vkApiCall(api, customPrefix="vk->", customParameters=customParams, \
+ globalStatePrefix=global_state_prefix, checkForDeviceLost=True,
+ checkForOutOfMemory=True)
+
+ if api.name in driver_workarounds_global_lock_apis:
+ if not delay:
+ cgen.stmt("m_state->unlock()")
+ # for delayed remove, state is already locked, so we do not need to
+ # unlock
+
+ if delay:
+ cgen.line("};")
+
+def emit_global_state_wrapped_call(api, cgen, context):
+ if api.name in DELAYED_DECODER_DELETES:
+ print("Error: Cannot generate a global state wrapped call that is also a delayed delete (yet)");
+ raise
+
+ customParams = ["&m_pool"] + list(map(lambda p: p.paramName, api.parameters))
+ if context:
+ customParams += ["context"]
+ cgen.vkApiCall(api, customPrefix=global_state_prefix, \
+ customParameters=customParams, globalStatePrefix=global_state_prefix, \
+ checkForDeviceLost=True, checkForOutOfMemory=True)
+
+def emit_decode_parameters_writeback(typeInfo, api, cgen, autobox=True):
+ decodingParams = DecodingParameters(api)
+
+ paramsToWrite = decodingParams.toWrite
+
+ cgen.stmt("%s->unsetHandleMapping()" % WRITE_STREAM)
+
+ handleMapOverwrites = False
+
+ for p in paramsToWrite:
+ emit_transform(typeInfo, p, cgen, variant="fromhost")
+
+ handleMapOverwrites = False
+
+ if p.nonDispatchableHandleCreate or p.dispatchableHandleCreate:
+ handleMapOverwrites = True
+
+ if autobox and p.nonDispatchableHandleCreate:
+ cgen.stmt("// Begin auto non dispatchable handle create for %s" % p.paramName)
+ cgen.stmt("if (%s == VK_SUCCESS) %s->setHandleMapping(&m_boxedHandleCreateMapping)" % \
+ (api.getRetVarExpr(), WRITE_STREAM))
+
+ if (not autobox) and p.nonDispatchableHandleCreate:
+ cgen.stmt("// Begin manual non dispatchable handle create for %s" % p.paramName)
+ cgen.stmt("%s->unsetHandleMapping()" % WRITE_STREAM)
+
+ emit_marshal(typeInfo, p, cgen, handleMapOverwrites=handleMapOverwrites)
+
+ if autobox and p.nonDispatchableHandleCreate:
+ cgen.stmt("// Begin auto non dispatchable handle create for %s" % p.paramName)
+ cgen.stmt("%s->setHandleMapping(&m_boxedHandleUnwrapMapping)" % WRITE_STREAM)
+
+ if (not autobox) and p.nonDispatchableHandleCreate:
+ cgen.stmt("// Begin manual non dispatchable handle create for %s" % p.paramName)
+ cgen.stmt("%s->setHandleMapping(&m_boxedHandleUnwrapMapping)" % WRITE_STREAM)
+
+def emit_decode_return_writeback(api, cgen):
+ retTypeName = api.getRetTypeExpr()
+ if retTypeName != "void":
+ retVar = api.getRetVarExpr()
+ cgen.stmt("%s->write(&%s, %s)" %
+ (WRITE_STREAM, retVar, cgen.sizeofExpr(api.retType)))
+
+def emit_decode_finish(api, cgen):
+ decodingParams = DecodingParameters(api)
+ retTypeName = api.getRetTypeExpr()
+ paramsToWrite = decodingParams.toWrite
+
+ if retTypeName != "void" or len(paramsToWrite) != 0:
+ cgen.stmt("%s->commitWrite()" % WRITE_STREAM)
+
+def emit_destroyed_handle_cleanup(api, cgen):
+ decodingParams = DecodingParameters(api)
+ paramsToRead = decodingParams.toRead
+
+ skipDelete = api.name in SKIPPED_DECODER_DELETES
+
+ if skipDelete:
+ cgen.line("// Skipping handle cleanup for %s" % api.name)
+ return
+
+ for p in paramsToRead:
+ if p.dispatchHandle:
+ pass
+ else:
+ lenAccess = cgen.generalLengthAccess(p)
+ lenAccessGuard = cgen.generalLengthAccess(p)
+ destroy = p.nonDispatchableHandleDestroy or p.dispatchableHandleDestroy
+ if destroy:
+ if None == lenAccess or "1" == lenAccess:
+ if api.name in DELAYED_DECODER_DELETES:
+ cgen.stmt("delayed_delete_%s(boxed_%s_preserve, unboxed_device, delayed_remove_callback)" % (p.typeName, p.paramName))
+ else:
+ cgen.stmt("delete_%s(boxed_%s_preserve)" % (p.typeName, p.paramName))
+ else:
+ if lenAccessGuard is not None:
+ cgen.beginIf(lenAccessGuard)
+ cgen.beginFor("uint32_t i = 0", "i < %s" % lenAccess, "++i")
+ if api.name in DELAYED_DECODER_DELETES:
+ cgen.stmt("delayed_delete_%s(boxed_%s_preserve[i], unboxed_device, delayed_remove_callback)" % (p.typeName, p.paramName))
+ else:
+ cgen.stmt("delete_%s(boxed_%s_preserve[i])" % (p.typeName, p.paramName))
+ cgen.endFor()
+ if lenAccessGuard is not None:
+ cgen.endIf()
+
+def emit_pool_free(cgen):
+ cgen.stmt("%s->clearPool()" % READ_STREAM)
+
+def emit_seqno_incr(api, cgen):
+ cgen.stmt("if (queueSubmitWithCommandsEnabled) seqnoPtr->fetch_add(1, std::memory_order_seq_cst)")
+
+def emit_snapshot(typeInfo, api, cgen):
+
+ cgen.stmt("%s->setReadPos((uintptr_t)(*readStreamPtrPtr) - (uintptr_t)snapshotTraceBegin)" % READ_STREAM)
+ cgen.stmt("size_t snapshotTraceBytes = %s->endTrace()" % READ_STREAM)
+
+ additionalParams = [ \
+ makeVulkanTypeSimple(True, "uint8_t", 1, "snapshotTraceBegin"),
+ makeVulkanTypeSimple(False, "size_t", 0, "snapshotTraceBytes"),
+ makeVulkanTypeSimple(False, "android::base::BumpPool", 1, "&m_pool"),
+ ]
+
+ retTypeName = api.getRetTypeExpr()
+ if retTypeName != "void":
+ retVar = api.getRetVarExpr()
+ additionalParams.append(makeVulkanTypeSimple(False, retTypeName, 0, retVar))
+
+ paramsForSnapshot = []
+
+ decodingParams = DecodingParameters(api)
+
+ for p in decodingParams.toRead:
+ if p.nonDispatchableHandleDestroy or (not p.dispatchHandle and p.dispatchableHandleDestroy):
+ paramsForSnapshot.append(p.withModifiedName("boxed_%s_preserve" % p.paramName))
+ else:
+ paramsForSnapshot.append(p)
+
+ customParams = additionalParams + paramsForSnapshot
+
+ apiForSnapshot = \
+ api.withCustomReturnType(makeVulkanTypeSimple(False, "void", 0, "void")). \
+ withCustomParameters(customParams)
+
+ cgen.beginIf("m_state->snapshotsEnabled()")
+ cgen.vkApiCall(apiForSnapshot, customPrefix="m_state->snapshot()->")
+ cgen.endIf()
+
+def emit_decoding(typeInfo, api, cgen, globalWrapped=False, context=False):
+ isAcquire = api.name in RELAXED_APIS
+ emit_decode_parameters(typeInfo, api, cgen, globalWrapped)
+
+ if isAcquire:
+ emit_seqno_incr(api, cgen)
+
+ if globalWrapped:
+ emit_global_state_wrapped_call(api, cgen, context)
+ else:
+ emit_dispatch_call(api, cgen)
+
+ emit_decode_parameters_writeback(typeInfo, api, cgen, autobox=not globalWrapped)
+ emit_decode_return_writeback(api, cgen)
+ emit_decode_finish(api, cgen)
+ emit_snapshot(typeInfo, api, cgen)
+ emit_destroyed_handle_cleanup(api, cgen)
+ emit_pool_free(cgen)
+
+ if not isAcquire:
+ emit_seqno_incr(api, cgen)
+
+def emit_default_decoding(typeInfo, api, cgen):
+ emit_decoding(typeInfo, api, cgen)
+
+def emit_global_state_wrapped_decoding(typeInfo, api, cgen):
+ emit_decoding(typeInfo, api, cgen, globalWrapped=True)
+
+def emit_global_state_wrapped_decoding_with_context(typeInfo, api, cgen):
+ emit_decoding(typeInfo, api, cgen, globalWrapped=True, context=True)
+
+## Custom decoding definitions##################################################
+def decode_vkFlushMappedMemoryRanges(typeInfo: VulkanTypeInfo, api, cgen):
+ emit_decode_parameters(typeInfo, api, cgen)
+
+ cgen.beginIf("!m_state->usingDirectMapping()")
+ cgen.stmt("// This is to deal with a deficiency in the encoder,");
+ cgen.stmt("// where usingDirectMapping fails to set the proper packet size,");
+ cgen.stmt("// meaning we can read off the end of the packet.");
+ cgen.stmt("uint64_t sizeLeft = end - *readStreamPtrPtr")
+ cgen.beginFor("uint32_t i = 0", "i < memoryRangeCount", "++i")
+ cgen.beginIf("sizeLeft < sizeof(uint64_t)")
+ cgen.beginIf("m_prevSeqno")
+ cgen.stmt("m_prevSeqno = m_prevSeqno.value() - 1")
+ cgen.endIf()
+ cgen.stmt("return ptr - (unsigned char*)buf;")
+ cgen.endIf()
+ cgen.stmt("auto range = pMemoryRanges[i]")
+ cgen.stmt("auto memory = pMemoryRanges[i].memory")
+ cgen.stmt("auto size = pMemoryRanges[i].size")
+ cgen.stmt("auto offset = pMemoryRanges[i].offset")
+ cgen.stmt("uint64_t readStream = 0")
+ cgen.stmt("memcpy(&readStream, *readStreamPtrPtr, sizeof(uint64_t)); *readStreamPtrPtr += sizeof(uint64_t)")
+ cgen.stmt("sizeLeft -= sizeof(uint64_t)")
+ cgen.stmt("auto hostPtr = m_state->getMappedHostPointer(memory)")
+ cgen.stmt("if (!hostPtr && readStream > 0) GFXSTREAM_ABORT(::emugl::FatalError(::emugl::ABORT_REASON_OTHER))")
+ cgen.stmt("if (!hostPtr) continue")
+ cgen.beginIf("sizeLeft < readStream")
+ cgen.beginIf("m_prevSeqno")
+ cgen.stmt("m_prevSeqno = m_prevSeqno.value() - 1")
+ cgen.endIf()
+ cgen.stmt("return ptr - (unsigned char*)buf;")
+ cgen.endIf()
+ cgen.stmt("sizeLeft -= readStream")
+ cgen.stmt("uint8_t* targetRange = hostPtr + offset")
+ cgen.stmt("memcpy(targetRange, *readStreamPtrPtr, readStream); *readStreamPtrPtr += readStream")
+ cgen.stmt("packetLen += 8 + readStream")
+ cgen.endFor()
+ cgen.endIf()
+
+ emit_dispatch_call(api, cgen)
+ emit_decode_parameters_writeback(typeInfo, api, cgen)
+ emit_decode_return_writeback(api, cgen)
+ emit_decode_finish(api, cgen)
+ emit_snapshot(typeInfo, api, cgen);
+ emit_pool_free(cgen)
+ emit_seqno_incr(api, cgen)
+
+def decode_vkInvalidateMappedMemoryRanges(typeInfo, api, cgen):
+ emit_decode_parameters(typeInfo, api, cgen)
+ emit_dispatch_call(api, cgen)
+ emit_decode_parameters_writeback(typeInfo, api, cgen)
+ emit_decode_return_writeback(api, cgen)
+
+ cgen.beginIf("!m_state->usingDirectMapping()")
+ cgen.beginFor("uint32_t i = 0", "i < memoryRangeCount", "++i")
+ cgen.stmt("auto range = pMemoryRanges[i]")
+ cgen.stmt("auto memory = range.memory")
+ cgen.stmt("auto size = range.size")
+ cgen.stmt("auto offset = range.offset")
+ cgen.stmt("auto hostPtr = m_state->getMappedHostPointer(memory)")
+ cgen.stmt("auto actualSize = size == VK_WHOLE_SIZE ? m_state->getDeviceMemorySize(memory) : size")
+ cgen.stmt("uint64_t writeStream = 0")
+ cgen.stmt("if (!hostPtr) { %s->write(&writeStream, sizeof(uint64_t)); continue; }" % WRITE_STREAM)
+ cgen.stmt("uint8_t* targetRange = hostPtr + offset")
+ cgen.stmt("writeStream = actualSize")
+ cgen.stmt("%s->write(&writeStream, sizeof(uint64_t))" % WRITE_STREAM)
+ cgen.stmt("%s->write(targetRange, actualSize)" % WRITE_STREAM)
+ cgen.endFor()
+ cgen.endIf()
+
+ emit_decode_finish(api, cgen)
+ emit_snapshot(typeInfo, api, cgen);
+ emit_pool_free(cgen)
+ emit_seqno_incr(api, cgen)
+
+def decode_unsupported_api(typeInfo, api, cgen):
+ cgen.line(f"// Decoding {api.name} is not supported. This should not run.")
+ cgen.stmt(f"fprintf(stderr, \"stream %p: fatal: decoding unsupported API {api.name}\\n\", ioStream)");
+ cgen.stmt("__builtin_trap()")
+
+custom_decodes = {
+ "vkEnumerateInstanceVersion" : emit_global_state_wrapped_decoding,
+ "vkCreateInstance" : emit_global_state_wrapped_decoding,
+ "vkDestroyInstance" : emit_global_state_wrapped_decoding,
+ "vkEnumeratePhysicalDevices" : emit_global_state_wrapped_decoding,
+
+ "vkGetPhysicalDeviceFeatures" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceFeatures2" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceFeatures2KHR" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceFormatProperties" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceFormatProperties2" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceFormatProperties2KHR" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceImageFormatProperties" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceImageFormatProperties2" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceImageFormatProperties2KHR" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceProperties" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceProperties2" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceProperties2KHR" : emit_global_state_wrapped_decoding,
+
+ "vkGetPhysicalDeviceMemoryProperties" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceMemoryProperties2" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceMemoryProperties2KHR" : emit_global_state_wrapped_decoding,
+
+ "vkGetPhysicalDeviceExternalSemaphoreProperties" : emit_global_state_wrapped_decoding,
+ "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" : emit_global_state_wrapped_decoding,
+
+ "vkEnumerateDeviceExtensionProperties" : emit_global_state_wrapped_decoding,
+
+ "vkCreateBuffer" : emit_global_state_wrapped_decoding,
+ "vkDestroyBuffer" : emit_global_state_wrapped_decoding,
+
+ "vkBindBufferMemory" : emit_global_state_wrapped_decoding,
+ "vkBindBufferMemory2" : emit_global_state_wrapped_decoding,
+ "vkBindBufferMemory2KHR" : emit_global_state_wrapped_decoding,
+
+ "vkCreateDevice" : emit_global_state_wrapped_decoding,
+ "vkGetDeviceQueue" : emit_global_state_wrapped_decoding,
+ "vkDestroyDevice" : emit_global_state_wrapped_decoding,
+
+ "vkGetDeviceQueue2" : emit_global_state_wrapped_decoding,
+
+ "vkBindImageMemory" : emit_global_state_wrapped_decoding,
+ "vkBindImageMemory2" : emit_global_state_wrapped_decoding,
+ "vkBindImageMemory2KHR" : emit_global_state_wrapped_decoding,
+
+ "vkCreateImage" : emit_global_state_wrapped_decoding,
+ "vkCreateImageView" : emit_global_state_wrapped_decoding,
+ "vkCreateSampler" : emit_global_state_wrapped_decoding,
+ "vkDestroyImage" : emit_global_state_wrapped_decoding,
+ "vkDestroyImageView" : emit_global_state_wrapped_decoding,
+ "vkDestroySampler" : emit_global_state_wrapped_decoding,
+ "vkCmdCopyBufferToImage" : emit_global_state_wrapped_decoding_with_context,
+ "vkCmdCopyImage" : emit_global_state_wrapped_decoding,
+ "vkCmdCopyImageToBuffer" : emit_global_state_wrapped_decoding,
+ "vkCmdCopyBufferToImage2" : emit_global_state_wrapped_decoding_with_context,
+ "vkCmdCopyImage2" : emit_global_state_wrapped_decoding,
+ "vkCmdCopyImageToBuffer2" : emit_global_state_wrapped_decoding,
+ "vkGetImageMemoryRequirements" : emit_global_state_wrapped_decoding,
+ "vkGetImageMemoryRequirements2" : emit_global_state_wrapped_decoding,
+ "vkGetImageMemoryRequirements2KHR" : emit_global_state_wrapped_decoding,
+ "vkGetBufferMemoryRequirements" : emit_global_state_wrapped_decoding,
+ "vkGetBufferMemoryRequirements2": emit_global_state_wrapped_decoding,
+ "vkGetBufferMemoryRequirements2KHR": emit_global_state_wrapped_decoding,
+
+ "vkCreateDescriptorSetLayout" : emit_global_state_wrapped_decoding,
+ "vkDestroyDescriptorSetLayout" : emit_global_state_wrapped_decoding,
+ "vkCreateDescriptorPool" : emit_global_state_wrapped_decoding,
+ "vkDestroyDescriptorPool" : emit_global_state_wrapped_decoding,
+ "vkResetDescriptorPool" : emit_global_state_wrapped_decoding,
+ "vkAllocateDescriptorSets" : emit_global_state_wrapped_decoding,
+ "vkFreeDescriptorSets" : emit_global_state_wrapped_decoding,
+
+ "vkUpdateDescriptorSets" : emit_global_state_wrapped_decoding,
+
+ "vkCreateShaderModule": emit_global_state_wrapped_decoding,
+ "vkDestroyShaderModule": emit_global_state_wrapped_decoding,
+ "vkCreatePipelineCache": emit_global_state_wrapped_decoding,
+ "vkDestroyPipelineCache": emit_global_state_wrapped_decoding,
+ "vkCreateGraphicsPipelines": emit_global_state_wrapped_decoding,
+ "vkDestroyPipeline": emit_global_state_wrapped_decoding,
+
+ "vkAllocateMemory" : emit_global_state_wrapped_decoding,
+ "vkFreeMemory" : emit_global_state_wrapped_decoding,
+ "vkMapMemory" : emit_global_state_wrapped_decoding,
+ "vkUnmapMemory" : emit_global_state_wrapped_decoding,
+ "vkFlushMappedMemoryRanges" : decode_vkFlushMappedMemoryRanges,
+ "vkInvalidateMappedMemoryRanges" : decode_vkInvalidateMappedMemoryRanges,
+
+ "vkAllocateCommandBuffers" : emit_global_state_wrapped_decoding,
+ "vkCmdExecuteCommands" : emit_global_state_wrapped_decoding,
+ "vkQueueSubmit" : emit_global_state_wrapped_decoding,
+ "vkQueueSubmit2" : emit_global_state_wrapped_decoding,
+ "vkQueueWaitIdle" : emit_global_state_wrapped_decoding,
+ "vkBeginCommandBuffer" : emit_global_state_wrapped_decoding_with_context,
+ "vkEndCommandBuffer" : emit_global_state_wrapped_decoding_with_context,
+ "vkResetCommandBuffer" : emit_global_state_wrapped_decoding,
+ "vkFreeCommandBuffers" : emit_global_state_wrapped_decoding,
+ "vkCreateCommandPool" : emit_global_state_wrapped_decoding,
+ "vkDestroyCommandPool" : emit_global_state_wrapped_decoding,
+ "vkResetCommandPool" : emit_global_state_wrapped_decoding,
+ "vkCmdPipelineBarrier" : emit_global_state_wrapped_decoding,
+ "vkCmdBindPipeline" : emit_global_state_wrapped_decoding,
+ "vkCmdBindDescriptorSets" : emit_global_state_wrapped_decoding,
+
+ "vkCreateRenderPass" : emit_global_state_wrapped_decoding,
+ "vkCreateRenderPass2" : emit_global_state_wrapped_decoding,
+ "vkCreateRenderPass2KHR" : emit_global_state_wrapped_decoding,
+ "vkDestroyRenderPass" : emit_global_state_wrapped_decoding,
+ "vkCreateFramebuffer" : emit_global_state_wrapped_decoding,
+ "vkDestroyFramebuffer" : emit_global_state_wrapped_decoding,
+
+ "vkCreateSamplerYcbcrConversion": emit_global_state_wrapped_decoding,
+ "vkDestroySamplerYcbcrConversion": emit_global_state_wrapped_decoding,
+
+ # VK_ANDROID_native_buffer
+ "vkGetSwapchainGrallocUsageANDROID" : emit_global_state_wrapped_decoding,
+ "vkGetSwapchainGrallocUsage2ANDROID" : emit_global_state_wrapped_decoding,
+ "vkAcquireImageANDROID" : emit_global_state_wrapped_decoding,
+ "vkQueueSignalReleaseImageANDROID" : emit_global_state_wrapped_decoding,
+
+ "vkCreateSemaphore" : emit_global_state_wrapped_decoding,
+ "vkGetSemaphoreFdKHR" : emit_global_state_wrapped_decoding,
+ "vkImportSemaphoreFdKHR" : emit_global_state_wrapped_decoding,
+ "vkDestroySemaphore" : emit_global_state_wrapped_decoding,
+
+ "vkCreateFence" : emit_global_state_wrapped_decoding,
+ "vkResetFences" : emit_global_state_wrapped_decoding,
+ "vkDestroyFence" : emit_global_state_wrapped_decoding,
+
+ # VK_GOOGLE_gfxstream
+ "vkFreeMemorySyncGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkMapMemoryIntoAddressSpaceGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkGetMemoryHostAddressInfoGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkGetBlobGOOGLE" : emit_global_state_wrapped_decoding,
+
+ # Descriptor update templates
+ "vkCreateDescriptorUpdateTemplate" : emit_global_state_wrapped_decoding,
+ "vkCreateDescriptorUpdateTemplateKHR" : emit_global_state_wrapped_decoding,
+ "vkDestroyDescriptorUpdateTemplate" : emit_global_state_wrapped_decoding,
+ "vkDestroyDescriptorUpdateTemplateKHR" : emit_global_state_wrapped_decoding,
+ "vkUpdateDescriptorSetWithTemplateSizedGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkUpdateDescriptorSetWithTemplateSized2GOOGLE" : emit_global_state_wrapped_decoding,
+
+ # VK_GOOGLE_gfxstream
+ "vkBeginCommandBufferAsyncGOOGLE" : emit_global_state_wrapped_decoding_with_context,
+ "vkEndCommandBufferAsyncGOOGLE" : emit_global_state_wrapped_decoding_with_context,
+ "vkResetCommandBufferAsyncGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkCommandBufferHostSyncGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkCreateImageWithRequirementsGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkCreateBufferWithRequirementsGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkQueueHostSyncGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkQueueSubmitAsyncGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkQueueSubmitAsync2GOOGLE" : emit_global_state_wrapped_decoding,
+ "vkQueueWaitIdleAsyncGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkQueueBindSparseAsyncGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkGetLinearImageLayoutGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkGetLinearImageLayout2GOOGLE" : emit_global_state_wrapped_decoding,
+ "vkQueueFlushCommandsGOOGLE" : emit_global_state_wrapped_decoding_with_context,
+ "vkQueueFlushCommandsFromAuxMemoryGOOGLE" : emit_global_state_wrapped_decoding_with_context,
+ "vkQueueCommitDescriptorSetUpdatesGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkCollectDescriptorPoolIdsGOOGLE" : emit_global_state_wrapped_decoding,
+ "vkQueueSignalReleaseImageANDROIDAsyncGOOGLE" : emit_global_state_wrapped_decoding,
+
+ "vkQueueBindSparse" : emit_global_state_wrapped_decoding,
+
+ # VK_KHR_xcb_surface
+ "vkCreateXcbSurfaceKHR": decode_unsupported_api,
+ "vkGetPhysicalDeviceXcbPresentationSupportKHR": decode_unsupported_api,
+
+ # VK_EXT_metal_surface
+ "vkCreateMetalSurfaceEXT": decode_unsupported_api,
+
+ # VK_KHR_sampler_ycbcr_conversion
+ "vkCreateSamplerYcbcrConversionKHR": emit_global_state_wrapped_decoding,
+ "vkDestroySamplerYcbcrConversionKHR": emit_global_state_wrapped_decoding,
+
+ #VK_KHR_copy_commands2
+ "vkCmdCopyBufferToImage2KHR" : emit_global_state_wrapped_decoding_with_context,
+ "vkCmdCopyImage2KHR" : emit_global_state_wrapped_decoding,
+ "vkCmdCopyImageToBuffer2KHR" : emit_global_state_wrapped_decoding,
+}
+
+class VulkanDecoder(VulkanWrapperGenerator):
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+ self.typeInfo: VulkanTypeInfo = typeInfo
+ self.cgen = CodeGen()
+
+ def onBegin(self,):
+ self.module.appendImpl(
+ "#define MAX_PACKET_LENGTH %s\n" % MAX_PACKET_LENGTH)
+ self.module.appendHeader(decoder_decl_preamble)
+ self.module.appendImpl(decoder_impl_preamble)
+
+ self.module.appendImpl(
+ """
+size_t VkDecoder::Impl::decode(void* buf, size_t len, IOStream* ioStream,
+ const ProcessResources* processResources,
+ const VkDecoderContext& context)
+""")
+
+ self.cgen.beginBlock() # function body
+
+ self.cgen.stmt("const char* processName = context.processName")
+ self.cgen.stmt("auto& gfx_logger = *context.gfxApiLogger")
+ self.cgen.stmt("auto* healthMonitor = context.healthMonitor")
+ self.cgen.stmt("auto& metricsLogger = *context.metricsLogger")
+ self.cgen.stmt("if (len < 8) return 0")
+ self.cgen.stmt("bool queueSubmitWithCommandsEnabled = feature_is_enabled(kFeature_VulkanQueueSubmitWithCommands)")
+ self.cgen.stmt("unsigned char *ptr = (unsigned char *)buf")
+ self.cgen.stmt("const unsigned char* const end = (const unsigned char*)buf + len")
+
+ self.cgen.beginIf("m_forSnapshotLoad")
+ self.cgen.stmt("ptr += m_state->setCreatedHandlesForSnapshotLoad(ptr)");
+ self.cgen.endIf()
+ self.cgen.line("while (end - ptr >= 8)")
+ self.cgen.beginBlock() # while loop
+
+ self.cgen.stmt("uint32_t opcode = *(uint32_t *)ptr")
+ self.cgen.stmt("uint32_t packetLen = *(uint32_t *)(ptr + 4)")
+ self.cgen.line("""
+ // packetLen should be at least 8 (op code and packet length) and should not be excessively large
+ if (packetLen < 8 || packetLen > MAX_PACKET_LENGTH) {
+ WARN("Bad packet length %d detected, decode may fail", packetLen);
+ metricsLogger.logMetricEvent(MetricEventBadPacketLength{ .len = packetLen });
+ }
+ """)
+ self.cgen.stmt("if (end - ptr < packetLen) return ptr - (unsigned char*)buf")
+ self.cgen.stmt("gfx_logger.record(ptr, std::min(size_t(packetLen + 8), size_t(end - ptr)))")
+
+ self.cgen.stmt("stream()->setStream(ioStream)")
+ self.cgen.stmt("VulkanStream* %s = stream()" % WRITE_STREAM)
+ self.cgen.stmt("VulkanMemReadingStream* %s = readStream()" % READ_STREAM)
+ self.cgen.stmt("%s->setBuf((uint8_t*)(ptr + 8))" % READ_STREAM)
+ self.cgen.stmt("uint8_t* readStreamPtr = %s->getBuf(); uint8_t** readStreamPtrPtr = &readStreamPtr" % READ_STREAM)
+ self.cgen.stmt("uint8_t* snapshotTraceBegin = %s->beginTrace()" % READ_STREAM)
+ self.cgen.stmt("%s->setHandleMapping(&m_boxedHandleUnwrapMapping)" % READ_STREAM)
+ self.cgen.line("""
+ std::unique_ptr<EventHangMetadata::HangAnnotations> executionData =
+ std::make_unique<EventHangMetadata::HangAnnotations>();
+ if (healthMonitor) {
+ executionData->insert(
+ {{"packet_length", std::to_string(packetLen)},
+ {"opcode", std::to_string(opcode)}});
+ if (processName) {
+ executionData->insert(
+ {{"renderthread_guest_process", std::string(processName)}});
+ }
+ if (m_prevSeqno) {
+ executionData->insert({{"previous_seqno", std::to_string(m_prevSeqno.value())}});
+ }
+ }
+
+ std::atomic<uint32_t>* seqnoPtr = processResources ?
+ processResources->getSequenceNumberPtr() : nullptr;
+
+ if (queueSubmitWithCommandsEnabled && ((opcode >= OP_vkFirst && opcode < OP_vkLast) || (opcode >= OP_vkFirst_old && opcode < OP_vkLast_old))) {
+ uint32_t seqno;
+ memcpy(&seqno, *readStreamPtrPtr, sizeof(uint32_t)); *readStreamPtrPtr += sizeof(uint32_t);
+ if (healthMonitor) executionData->insert({{"seqno", std::to_string(seqno)}});
+ if (m_prevSeqno && seqno == m_prevSeqno.value()) {
+ WARN(
+ "Seqno %d is the same as previously processed on thread %d. It might be a "
+ "duplicate command.",
+ seqno, getCurrentThreadId());
+ metricsLogger.logMetricEvent(MetricEventDuplicateSequenceNum{ .opcode = opcode });
+ }
+ if (seqnoPtr && !m_forSnapshotLoad) {
+ {
+ auto seqnoWatchdog =
+ WATCHDOG_BUILDER(healthMonitor,
+ "RenderThread seqno loop")
+ .setHangType(EventHangMetadata::HangType::kRenderThread)
+ .setAnnotations(std::make_unique<EventHangMetadata::HangAnnotations>(*executionData))
+ /* Data gathered if this hangs*/
+ .setOnHangCallback([=]() {
+ auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+ annotations->insert({{"seqnoPtr", std::to_string(seqnoPtr->load(std::memory_order_seq_cst))}});
+ return annotations;
+ })
+ .build();
+ while ((seqno - seqnoPtr->load(std::memory_order_seq_cst) != 1)) {
+ #if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)))
+ _mm_pause();
+ #elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
+ __asm__ __volatile__("pause;");
+ #endif
+ }
+ m_prevSeqno = seqno;
+ }
+ }
+ }
+ """)
+
+ self.cgen.line("""
+ gfx_logger.recordCommandExecution();
+ """)
+
+ self.cgen.line("""
+ auto executionWatchdog =
+ WATCHDOG_BUILDER(healthMonitor, "RenderThread VkDecoder command execution")
+ .setHangType(EventHangMetadata::HangType::kRenderThread)
+ .setAnnotations(std::move(executionData))
+ .build();
+ """)
+
+ self.cgen.stmt("auto vk = m_vk")
+
+ self.cgen.line("switch (opcode)")
+ self.cgen.beginBlock() # switch stmt
+
+ self.module.appendImpl(self.cgen.swapCode())
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ typeInfo = self.typeInfo
+ cgen = self.cgen
+ api: VulkanAPI = typeInfo.apis[name]
+
+ cgen.line("case OP_%s:" % name)
+ cgen.beginBlock()
+ cgen.stmt("android::base::beginTrace(\"%s decode\")" % name)
+
+ if api.name in custom_decodes.keys():
+ custom_decodes[api.name](typeInfo, api, cgen)
+ else:
+ emit_default_decoding(typeInfo, api, cgen)
+
+ cgen.stmt("android::base::endTrace()")
+ cgen.stmt("break")
+ cgen.endBlock()
+ self.module.appendImpl(self.cgen.swapCode())
+
+ def onEnd(self,):
+ self.cgen.line("default:")
+ self.cgen.beginBlock()
+ self.cgen.stmt("m_pool.freeAll()")
+ self.cgen.stmt("return ptr - (unsigned char *)buf")
+ self.cgen.endBlock()
+
+ self.cgen.endBlock() # switch stmt
+
+ self.cgen.stmt("ptr += packetLen")
+ self.cgen.endBlock() # while loop
+
+ self.cgen.beginIf("m_forSnapshotLoad")
+ self.cgen.stmt("m_state->clearCreatedHandlesForSnapshotLoad()");
+ self.cgen.endIf()
+
+ self.cgen.stmt("m_pool.freeAll()")
+ self.cgen.stmt("return ptr - (unsigned char*)buf;")
+ self.cgen.endBlock() # function body
+ self.module.appendImpl(self.cgen.swapCode())
+ self.module.appendImpl(decoder_impl_postamble)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/decodersnapshot.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/decodersnapshot.py
new file mode 100644
index 00000000000..4ff97a1d2c4
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/decodersnapshot.py
@@ -0,0 +1,267 @@
+from .common.codegen import CodeGen, VulkanWrapperGenerator, VulkanAPIWrapper
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType, DISPATCHABLE_HANDLE_TYPES, NON_DISPATCHABLE_HANDLE_TYPES
+
+from .transform import TransformCodegen, genTransformsForVulkanType
+
+from .wrapperdefs import API_PREFIX_MARSHAL
+from .wrapperdefs import API_PREFIX_UNMARSHAL
+from .wrapperdefs import VULKAN_STREAM_TYPE
+
+from copy import copy
+
+decoder_snapshot_decl_preamble = """
+
+namespace android {
+namespace base {
+class BumpPool;
+class Stream;
+} // namespace base {
+} // namespace android {
+
+class VkDecoderSnapshot {
+public:
+ VkDecoderSnapshot();
+ ~VkDecoderSnapshot();
+
+ void save(android::base::Stream* stream);
+ void load(android::base::Stream* stream, emugl::GfxApiLogger& gfx_logger,
+ emugl::HealthMonitor<>* healthMonitor);
+"""
+
+decoder_snapshot_decl_postamble = """
+private:
+ class Impl;
+ std::unique_ptr<Impl> mImpl;
+
+};
+"""
+
+decoder_snapshot_impl_preamble ="""
+
+using namespace gfxstream::vk;
+using emugl::GfxApiLogger;
+using emugl::HealthMonitor;
+
+class VkDecoderSnapshot::Impl {
+public:
+ Impl() { }
+
+ void save(android::base::Stream* stream) {
+ mReconstruction.save(stream);
+ }
+
+ void load(android::base::Stream* stream, GfxApiLogger& gfx_logger,
+ HealthMonitor<>* healthMonitor) {
+ mReconstruction.load(stream, gfx_logger, healthMonitor);
+ }
+
+"""
+
+decoder_snapshot_impl_postamble = """
+private:
+ android::base::Lock mLock;
+ VkReconstruction mReconstruction;
+};
+
+VkDecoderSnapshot::VkDecoderSnapshot() :
+ mImpl(new VkDecoderSnapshot::Impl()) { }
+
+void VkDecoderSnapshot::save(android::base::Stream* stream) {
+ mImpl->save(stream);
+}
+
+void VkDecoderSnapshot::load(android::base::Stream* stream, GfxApiLogger& gfx_logger,
+ HealthMonitor<>* healthMonitor) {
+ mImpl->load(stream, gfx_logger, healthMonitor);
+}
+
+VkDecoderSnapshot::~VkDecoderSnapshot() = default;
+"""
+
+AUXILIARY_SNAPSHOT_API_BASE_PARAM_COUNT = 3
+
+AUXILIARY_SNAPSHOT_API_PARAM_NAMES = [
+ "input_result",
+]
+
+# Vulkan handle dependencies.
+# (a, b): a depends on b
+SNAPSHOT_HANDLE_DEPENDENCIES = [
+ # Dispatchable handle types
+ ("VkCommandBuffer", "VkCommandPool"),
+ ("VkCommandPool", "VkDevice"),
+ ("VkQueue", "VkDevice"),
+ ("VkDevice", "VkPhysicalDevice"),
+ ("VkPhysicalDevice", "VkInstance")] + \
+ list(map(lambda handleType : (handleType, "VkDevice"), NON_DISPATCHABLE_HANDLE_TYPES))
+
+handleDependenciesDict = dict(SNAPSHOT_HANDLE_DEPENDENCIES)
+
+def extract_deps_vkAllocateCommandBuffers(param, access, lenExpr, api, cgen):
+ cgen.stmt("mReconstruction.addHandleDependency((const uint64_t*)%s, %s, (uint64_t)(uintptr_t)%s)" % \
+ (access, lenExpr, "unboxed_to_boxed_non_dispatchable_VkCommandPool(pAllocateInfo->commandPool)"))
+
+specialCaseDependencyExtractors = {
+ "vkAllocateCommandBuffers" : extract_deps_vkAllocateCommandBuffers,
+}
+
+apiSequences = {
+ "vkAllocateMemory" : ["vkAllocateMemory", "vkMapMemoryIntoAddressSpaceGOOGLE"]
+}
+
+apiModifies = {
+ "vkMapMemoryIntoAddressSpaceGOOGLE" : ["memory"],
+}
+
+def is_modify_operation(api, param):
+ if api.name in apiModifies:
+ if param.paramName in apiModifies[api.name]:
+ return True
+ return False
+
+def emit_impl(typeInfo, api, cgen):
+
+ cgen.line("// TODO: Implement")
+
+ for p in api.parameters:
+ if not (p.isHandleType):
+ continue
+
+ lenExpr = cgen.generalLengthAccess(p)
+ lenAccessGuard = cgen.generalLengthAccessGuard(p)
+
+ if lenExpr is None:
+ lenExpr = "1"
+
+ if p.pointerIndirectionLevels > 0:
+ access = p.paramName
+ else:
+ access = "(&%s)" % p.paramName
+
+ if p.isCreatedBy(api):
+ cgen.stmt("android::base::AutoLock lock(mLock)")
+ cgen.line("// %s create" % p.paramName)
+ cgen.stmt("mReconstruction.addHandles((const uint64_t*)%s, %s)" % (access, lenExpr));
+
+ if p.typeName in handleDependenciesDict:
+ dependsOnType = handleDependenciesDict[p.typeName];
+ for p2 in api.parameters:
+ if p2.typeName == dependsOnType:
+ cgen.stmt("mReconstruction.addHandleDependency((const uint64_t*)%s, %s, (uint64_t)(uintptr_t)%s)" % (access, lenExpr, p2.paramName))
+ if api.name in specialCaseDependencyExtractors:
+ specialCaseDependencyExtractors[api.name](p, access, lenExpr, api, cgen)
+
+ cgen.stmt("if (!%s) return" % access)
+ cgen.stmt("auto apiHandle = mReconstruction.createApiInfo()")
+ cgen.stmt("auto apiInfo = mReconstruction.getApiInfo(apiHandle)")
+ cgen.stmt("mReconstruction.setApiTrace(apiInfo, OP_%s, snapshotTraceBegin, snapshotTraceBytes)" % api.name)
+ if lenAccessGuard is not None:
+ cgen.beginIf(lenAccessGuard)
+ cgen.stmt("mReconstruction.forEachHandleAddApi((const uint64_t*)%s, %s, apiHandle)" % (access, lenExpr))
+ cgen.stmt("mReconstruction.setCreatedHandlesForApi(apiHandle, (const uint64_t*)%s, %s)" % (access, lenExpr))
+ if lenAccessGuard is not None:
+ cgen.endIf()
+
+ if p.isDestroyedBy(api):
+ cgen.stmt("android::base::AutoLock lock(mLock)")
+ cgen.line("// %s destroy" % p.paramName)
+ if lenAccessGuard is not None:
+ cgen.beginIf(lenAccessGuard)
+ cgen.stmt("mReconstruction.removeHandles((const uint64_t*)%s, %s)" % (access, lenExpr));
+ if lenAccessGuard is not None:
+ cgen.endIf()
+
+ if is_modify_operation(api, p):
+ cgen.stmt("android::base::AutoLock lock(mLock)")
+ cgen.line("// %s modify" % p.paramName)
+ cgen.stmt("auto apiHandle = mReconstruction.createApiInfo()")
+ cgen.stmt("auto apiInfo = mReconstruction.getApiInfo(apiHandle)")
+ cgen.stmt("mReconstruction.setApiTrace(apiInfo, OP_%s, snapshotTraceBegin, snapshotTraceBytes)" % api.name)
+ if lenAccessGuard is not None:
+ cgen.beginIf(lenAccessGuard)
+ cgen.beginFor("uint32_t i = 0", "i < %s" % lenExpr, "++i")
+ if p.isNonDispatchableHandleType():
+ cgen.stmt("%s boxed = unboxed_to_boxed_non_dispatchable_%s(%s[i])" % (p.typeName, p.typeName, access))
+ else:
+ cgen.stmt("%s boxed = unboxed_to_boxed_%s(%s[i])" % (p.typeName, p.typeName, access))
+ cgen.stmt("mReconstruction.forEachHandleAddModifyApi((const uint64_t*)(&boxed), 1, apiHandle)")
+ cgen.endFor()
+ if lenAccessGuard is not None:
+ cgen.endIf()
+
+def emit_passthrough_to_impl(typeInfo, api, cgen):
+ cgen.vkApiCall(api, customPrefix = "mImpl->")
+
+class VulkanDecoderSnapshot(VulkanWrapperGenerator):
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.typeInfo = typeInfo
+
+ self.cgenHeader = CodeGen()
+ self.cgenHeader.incrIndent()
+
+ self.cgenImpl = CodeGen()
+
+ self.currentFeature = None
+
+ self.feature_apis = []
+
+ def onBegin(self,):
+ self.module.appendHeader(decoder_snapshot_decl_preamble)
+ self.module.appendImpl(decoder_snapshot_impl_preamble)
+
+ def onBeginFeature(self, featureName, featureType):
+ VulkanWrapperGenerator.onBeginFeature(self, featureName, featureType)
+ self.currentFeature = featureName
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ api = self.typeInfo.apis[name]
+
+ additionalParams = [ \
+ makeVulkanTypeSimple(True, "uint8_t", 1, "snapshotTraceBegin"),
+ makeVulkanTypeSimple(False, "size_t", 0, "snapshotTraceBytes"),
+ makeVulkanTypeSimple(False, "android::base::BumpPool", 1, "pool"),]
+
+ if api.retType.typeName != "void":
+ additionalParams.append( \
+ makeVulkanTypeSimple(False, api.retType.typeName, 0, "input_result"))
+
+ apiForSnapshot = \
+ api.withCustomParameters( \
+ additionalParams + \
+ api.parameters).withCustomReturnType( \
+ makeVulkanTypeSimple(False, "void", 0, "void"))
+
+ self.feature_apis.append((self.currentFeature, apiForSnapshot))
+
+ self.cgenHeader.stmt(self.cgenHeader.makeFuncProto(apiForSnapshot))
+ self.module.appendHeader(self.cgenHeader.swapCode())
+
+ self.cgenImpl.emitFuncImpl( \
+ apiForSnapshot, lambda cgen: emit_impl(self.typeInfo, apiForSnapshot, cgen))
+ self.module.appendImpl(self.cgenImpl.swapCode())
+
+ def onEnd(self,):
+ self.module.appendHeader(decoder_snapshot_decl_postamble)
+ self.module.appendImpl(decoder_snapshot_impl_postamble)
+ self.cgenHeader.decrIndent()
+
+ for feature, api in self.feature_apis:
+ if feature is not None:
+ self.cgenImpl.line("#ifdef %s" % feature)
+
+ apiImplShell = \
+ api.withModifiedName("VkDecoderSnapshot::" + api.name)
+
+ self.cgenImpl.emitFuncImpl( \
+ apiImplShell, lambda cgen: emit_passthrough_to_impl(self.typeInfo, api, cgen))
+
+ if feature is not None:
+ self.cgenImpl.line("#endif")
+
+ self.module.appendImpl(self.cgenImpl.swapCode())
+
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/deepcopy.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/deepcopy.py
new file mode 100644
index 00000000000..52842e994b4
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/deepcopy.py
@@ -0,0 +1,383 @@
+# 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.
+
+from .common.codegen import CodeGen
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType, VulkanTypeIterator
+
+from .wrapperdefs import VulkanWrapperGenerator
+from .wrapperdefs import STRUCT_EXTENSION_PARAM, STRUCT_EXTENSION_PARAM_FOR_WRITE, EXTENSION_SIZE_API_NAME
+
+class DeepcopyCodegen(VulkanTypeIterator):
+ def __init__(self, cgen, inputVars, poolVarName, rootVarName, prefix, skipValues=False):
+ self.cgen = cgen
+ self.inputVars = inputVars
+ self.prefix = prefix
+ self.poolVarName = poolVarName
+ self.rootVarName = rootVarName
+ self.skipValues = skipValues
+
+ def makeAccess(varName, asPtr = True):
+ return lambda t: self.cgen.generalAccess(t, parentVarName = varName, asPtr = asPtr)
+
+ def makeLengthAccess(varName):
+ return lambda t: self.cgen.generalLengthAccess(t, parentVarName = varName)
+
+ def makeLengthAccessGuard(varName):
+ return lambda t: self.cgen.generalLengthAccessGuard(t, parentVarName=varName)
+
+ self.exprAccessorLhs = makeAccess(self.inputVars[0])
+ self.exprAccessorRhs = makeAccess(self.inputVars[1])
+
+ self.exprAccessorValueLhs = makeAccess(self.inputVars[0], asPtr = False)
+ self.exprAccessorValueRhs = makeAccess(self.inputVars[1], asPtr = False)
+
+ self.lenAccessorLhs = makeLengthAccess(self.inputVars[0])
+ self.lenAccessorRhs = makeLengthAccess(self.inputVars[1])
+
+ self.lenAccessorGuardLhs = makeLengthAccessGuard(self.inputVars[0])
+ self.lenAccessorGuardRhs = makeLengthAccessGuard(self.inputVars[1])
+
+ self.checked = False
+
+ def needSkip(self, vulkanType):
+ return False
+
+ def makeCastExpr(self, vulkanType):
+ return "(%s)" % (
+ self.cgen.makeCTypeDecl(vulkanType, useParamName=False))
+
+ def makeNonConstCastForCopy(self, access, vulkanType):
+ if vulkanType.staticArrExpr:
+ casted = "%s(%s)" % (self.makeCastExpr(vulkanType.getForAddressAccess().getForNonConstAccess()), access)
+ elif vulkanType.accessibleAsPointer():
+ casted = "%s(%s)" % (self.makeCastExpr(vulkanType.getForNonConstAccess()), access)
+ else:
+ casted = "%s(%s)" % (self.makeCastExpr(vulkanType.getForAddressAccess().getForNonConstAccess()), access)
+ return casted
+
+ def makeAllocBytesExpr(self, lenAccess, vulkanType):
+ sizeof = self.cgen.sizeofExpr( \
+ vulkanType.getForValueAccess())
+ if lenAccess:
+ bytesExpr = "%s * %s" % (lenAccess, sizeof)
+ else:
+ bytesExpr = sizeof
+
+ return bytesExpr
+
+ def onCheck(self, vulkanType):
+ pass
+
+ def endCheck(self, vulkanType):
+ pass
+
+ def onCompoundType(self, vulkanType):
+
+ if self.needSkip(vulkanType):
+ self.cgen.line("// TODO: Unsupported : %s" %
+ self.cgen.makeCTypeDecl(vulkanType))
+ return
+
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ lenAccessLhs = self.lenAccessorLhs(vulkanType)
+ lenAccessRhs = self.lenAccessorRhs(vulkanType)
+
+ lenAccessorGuardLhs = self.lenAccessorGuardLhs(vulkanType)
+ lenAccessorGuardRhs = self.lenAccessorGuardRhs(vulkanType)
+
+ isPtr = vulkanType.pointerIndirectionLevels > 0
+
+ if lenAccessorGuardLhs is not None:
+ self.cgen.beginIf(lenAccessorGuardLhs)
+
+ if isPtr:
+ self.cgen.stmt("%s = nullptr" % accessRhs)
+ self.cgen.beginIf(accessLhs)
+
+ self.cgen.stmt( \
+ "%s = %s%s->alloc(%s)" % \
+ (accessRhs, self.makeCastExpr(vulkanType.getForNonConstAccess()),
+ self.poolVarName, self.makeAllocBytesExpr(lenAccessLhs, vulkanType)))
+
+ if lenAccessLhs is not None:
+
+ loopVar = "i"
+ accessLhs = "%s + %s" % (accessLhs, loopVar)
+ forInit = "uint32_t %s = 0" % loopVar
+ forCond = "%s < (uint32_t)%s" % (loopVar, lenAccessLhs)
+ forIncr = "++%s" % loopVar
+
+ if isPtr:
+ # Avoid generating a self-assign.
+ if lenAccessRhs != lenAccessLhs:
+ self.cgen.stmt("%s = %s" % (lenAccessRhs, lenAccessLhs))
+
+ accessRhs = "%s + %s" % (accessRhs, loopVar)
+ self.cgen.beginFor(forInit, forCond, forIncr)
+
+
+ accessRhsCasted = self.makeNonConstCastForCopy(accessRhs, vulkanType)
+
+ self.cgen.funcCall(None, self.prefix + vulkanType.typeName,
+ [self.poolVarName, self.rootVarName, accessLhs, accessRhsCasted])
+
+ if lenAccessLhs is not None:
+ self.cgen.endFor()
+
+ if isPtr:
+ self.cgen.endIf()
+
+ if lenAccessorGuardLhs is not None:
+ self.cgen.endIf()
+
+ def onString(self, vulkanType):
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ self.cgen.stmt("%s = nullptr" % accessRhs)
+ self.cgen.beginIf(accessLhs)
+
+ self.cgen.stmt( \
+ "%s = %s->strDup(%s)" % \
+ (accessRhs,
+ self.poolVarName,
+ accessLhs))
+
+ self.cgen.endIf()
+
+ def onStringArray(self, vulkanType):
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ lenAccessLhs = self.lenAccessorLhs(vulkanType)
+
+ self.cgen.stmt("%s = nullptr" % accessRhs)
+ self.cgen.beginIf("%s && %s" % (accessLhs, lenAccessLhs))
+
+ self.cgen.stmt( \
+ "%s = %s->strDupArray(%s, %s)" % \
+ (accessRhs,
+ self.poolVarName,
+ accessLhs,
+ lenAccessLhs))
+
+ self.cgen.endIf()
+
+ def onStaticArr(self, vulkanType):
+ accessLhs = self.exprAccessorValueLhs(vulkanType)
+ accessRhs = self.exprAccessorValueRhs(vulkanType)
+
+ lenAccessLhs = self.lenAccessorLhs(vulkanType)
+
+ bytesExpr = self.makeAllocBytesExpr(lenAccessLhs, vulkanType)
+ self.cgen.stmt("memcpy(%s, %s, %s)" % (accessRhs, accessLhs, bytesExpr))
+
+ def onStructExtension(self, vulkanType):
+
+ lhs = self.exprAccessorLhs(vulkanType)
+ rhs = self.exprAccessorRhs(vulkanType)
+
+ rhsExpr = "(%s)(%s)" % ("void*", rhs)
+
+ nextVar = "from_%s" % vulkanType.paramName
+ sizeVar = "%s_size" % vulkanType.paramName
+
+ self.cgen.beginIf("%s == VK_STRUCTURE_TYPE_MAX_ENUM" %
+ self.rootVarName)
+ self.cgen.stmt("%s = from->sType" % self.rootVarName)
+ self.cgen.endIf()
+
+ self.cgen.stmt("const void* %s = %s" % (nextVar, self.inputVars[0]))
+ self.cgen.stmt("size_t %s = 0u" % sizeVar)
+ self.cgen.beginWhile("!%s && %s" % (sizeVar, nextVar))
+ self.cgen.stmt("%s = static_cast<const vk_struct_common*>(%s)->%s" % (
+ nextVar, nextVar, vulkanType.paramName
+ ))
+ self.cgen.stmt("%s = %s(%s, %s)" % (
+ sizeVar, EXTENSION_SIZE_API_NAME, self.rootVarName, nextVar))
+ self.cgen.endWhile()
+
+ self.cgen.stmt("%s = nullptr" % rhs)
+
+ self.cgen.beginIf(sizeVar)
+
+ self.cgen.stmt( \
+ "%s = %s%s->alloc(%s)" % \
+ (rhs, self.makeCastExpr(vulkanType.getForNonConstAccess()), self.poolVarName, sizeVar))
+
+ self.cgen.funcCall(None, self.prefix + "extension_struct",
+ [self.poolVarName, self.rootVarName, nextVar, rhsExpr])
+
+ self.cgen.endIf()
+
+ def onPointer(self, vulkanType):
+
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ if self.needSkip(vulkanType):
+ self.cgen.stmt("%s = nullptr" % accessRhs)
+ return
+
+ lenAccessLhs = self.lenAccessorLhs(vulkanType)
+
+ self.cgen.stmt("%s = nullptr" % accessRhs)
+ self.cgen.beginIf(accessLhs)
+
+ bytesExpr = self.makeAllocBytesExpr(lenAccessLhs, vulkanType)
+
+ self.cgen.stmt( \
+ "%s = %s%s->dupArray(%s, %s)" % \
+ (accessRhs,
+ self.makeCastExpr(vulkanType.getForNonConstAccess()),
+ self.poolVarName,
+ accessLhs,
+ bytesExpr))
+
+ self.cgen.endIf()
+
+ def onValue(self, vulkanType):
+ if self.skipValues:
+ return
+
+ accessLhs = self.exprAccessorValueLhs(vulkanType)
+ accessRhs = self.exprAccessorValueRhs(vulkanType)
+
+ self.cgen.stmt("%s = %s" % (accessRhs, accessLhs))
+
+class VulkanDeepcopy(VulkanWrapperGenerator):
+
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.codegen = CodeGen()
+
+ self.deepcopyPrefix = "deepcopy_"
+ self.deepcopyVars = ["from", "to"]
+ self.deepcopyAllocatorVarName = "alloc"
+ self.deepcopyAllocatorParam = \
+ makeVulkanTypeSimple(False, "Allocator", 1,
+ self.deepcopyAllocatorVarName)
+ self.deepcopyRootVarName = "rootType"
+ self.deepcopyRootParam = \
+ makeVulkanTypeSimple(False, "VkStructureType",
+ 0, self.deepcopyRootVarName)
+ self.voidType = makeVulkanTypeSimple(False, "void", 0)
+
+ self.deepcopyCodegen = \
+ DeepcopyCodegen(
+ None,
+ self.deepcopyVars,
+ self.deepcopyAllocatorVarName,
+ self.deepcopyRootVarName,
+ self.deepcopyPrefix,
+ skipValues=True)
+
+ self.knownDefs = {}
+
+ self.extensionDeepcopyPrototype = \
+ VulkanAPI(self.deepcopyPrefix + "extension_struct",
+ self.voidType,
+ [self.deepcopyAllocatorParam,
+ self.deepcopyRootParam,
+ STRUCT_EXTENSION_PARAM,
+ STRUCT_EXTENSION_PARAM_FOR_WRITE])
+
+ def onBegin(self,):
+ VulkanWrapperGenerator.onBegin(self)
+ self.module.appendImpl(self.codegen.makeFuncDecl(
+ self.extensionDeepcopyPrototype))
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ if name in self.knownDefs:
+ return
+
+ category = self.typeInfo.categoryOf(name)
+
+ if category in ["struct", "union"] and alias:
+ self.module.appendHeader(
+ self.codegen.makeFuncAlias(self.deepcopyPrefix + name,
+ self.deepcopyPrefix + alias))
+
+ if category in ["struct", "union"] and not alias:
+
+ structInfo = self.typeInfo.structs[name]
+
+ typeFromName = \
+ lambda varname: \
+ makeVulkanTypeSimple(varname == "from", name, 1, varname)
+
+ deepcopyParams = \
+ [self.deepcopyAllocatorParam, self.deepcopyRootParam] + \
+ list(map(typeFromName, self.deepcopyVars))
+
+ deepcopyPrototype = \
+ VulkanAPI(self.deepcopyPrefix + name,
+ self.voidType,
+ deepcopyParams)
+
+ def structDeepcopyDef(cgen):
+ self.deepcopyCodegen.cgen = cgen
+ canSimplyAssign = True
+ for member in structInfo.members:
+ if not member.isSimpleValueType(self.typeInfo):
+ canSimplyAssign = False
+
+ cgen.stmt("(void)%s" % self.deepcopyAllocatorVarName)
+ cgen.stmt("(void)%s" % self.deepcopyRootVarName)
+ cgen.stmt("*to = *from")
+ if canSimplyAssign:
+ pass
+ else:
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member,
+ self.deepcopyCodegen)
+
+ self.module.appendHeader(
+ self.codegen.makeFuncDecl(deepcopyPrototype))
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(deepcopyPrototype, structDeepcopyDef))
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ def onEnd(self,):
+ VulkanWrapperGenerator.onEnd(self)
+
+ def deepcopyDstExpr(cgen, typeName):
+ return cgen.makeReinterpretCast( \
+ STRUCT_EXTENSION_PARAM_FOR_WRITE.paramName,
+ typeName, const=False)
+
+ def forEachExtensionDeepcopy(ext, castedAccess, cgen):
+ cgen.funcCall(None, self.deepcopyPrefix + ext.name,
+ [self.deepcopyAllocatorVarName,
+ self.deepcopyRootVarName,
+ castedAccess, deepcopyDstExpr(cgen, ext.name)])
+
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(
+ self.extensionDeepcopyPrototype,
+ lambda cgen: self.emitForEachStructExtension(
+ cgen,
+ self.voidType,
+ STRUCT_EXTENSION_PARAM,
+ forEachExtensionDeepcopy,
+ rootTypeVar=self.deepcopyRootParam)))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/dispatch.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/dispatch.py
new file mode 100644
index 00000000000..031f52ed69e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/dispatch.py
@@ -0,0 +1,501 @@
+# 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.
+
+from .common.codegen import CodeGen
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType
+
+from .wrapperdefs import VulkanWrapperGenerator
+
+# No real good way to automatically infer the most important Vulkan API
+# functions as it relates to which getProcAddress function to use, plus
+# we might want to control which function to use depending on our
+# performance needs.
+
+# This is based on the minimum set of functions needed to be directly
+# queried with dlsym and not returning null.
+getProcAddrFuncs = [
+ "vkGetInstanceProcAddr",
+ "vkDestroyInstance",
+ "vkEnumeratePhysicalDevices",
+ "vkGetPhysicalDeviceFeatures",
+ "vkGetPhysicalDeviceFormatProperties",
+ "vkGetPhysicalDeviceImageFormatProperties",
+ "vkGetPhysicalDeviceProperties",
+ "vkGetPhysicalDeviceQueueFamilyProperties",
+ "vkGetPhysicalDeviceMemoryProperties",
+ "vkCreateDevice",
+ "vkDestroyDevice",
+ "vkEnumerateDeviceExtensionProperties",
+ "vkEnumerateDeviceLayerProperties",
+]
+
+# Some methods can only be found using dlsym() while we cannot get the function
+# address using vkGetInstProcAddr() or vkGetDeviceProcAddr(). These function
+# pointers should only be initialized when setting up the dispatch from system
+# loader.
+getProcAddrOnlyFuncs = [
+ "vkGetMTLDeviceMVK",
+ "vkSetMTLTextureMVK",
+ "vkGetMTLTextureMVK",
+ "vkGetMTLBufferMVK",
+ "vkUseIOSurfaceMVK",
+ "vkGetIOSurfaceMVK",
+]
+
+getInstanceProcAddrNoInstanceFuncs = [
+ "vkCreateInstance",
+ "vkEnumerateInstanceExtensionProperties",
+ "vkEnumerateInstanceLayerProperties",
+]
+
+getInstanceProcAddrFuncs = [
+ "vkGetDeviceProcAddr",
+ "vkCreateSwapchainKHR",
+ "vkDestroySwapchainKHR",
+ "vkGetSwapchainImagesKHR",
+ "vkAcquireNextImageKHR",
+ "vkQueuePresentKHR",
+ "vkCreateMacOSSurfaceMVK",
+ "vkCreateWin32SurfaceKHR",
+ "vkGetPhysicalDeviceWin32PresentationSupportKHR",
+ "vkCreateXlibSurfaceKHR",
+ "vkGetPhysicalDeviceXlibPresentationSupportKHR",
+ "vkCreateXcbSurfaceKHR",
+ "vkGetPhysicalDeviceXcbPresentationSupportKHR",
+ "vkGetPhysicalDeviceSparseImageFormatProperties",
+ "vkEnumerateInstanceVersion",
+ "vkEnumeratePhysicalDeviceGroups",
+ "vkGetPhysicalDeviceFeatures2",
+ "vkGetPhysicalDeviceProperties2",
+ "vkGetPhysicalDeviceFormatProperties2",
+ "vkGetPhysicalDeviceImageFormatProperties2",
+ "vkGetPhysicalDeviceQueueFamilyProperties2",
+ "vkGetPhysicalDeviceMemoryProperties2",
+ "vkGetPhysicalDeviceSparseImageFormatProperties2",
+ "vkGetPhysicalDeviceExternalBufferProperties",
+ "vkGetPhysicalDeviceExternalFenceProperties",
+ "vkGetPhysicalDeviceExternalSemaphoreProperties",
+]
+
+# Implicitly, everything else is going to be obtained
+# with vkGetDeviceProcAddr,
+# unless it has instance in the arg.
+
+def isGetProcAddressAPI(vulkanApi):
+ return vulkanApi.name in getProcAddrFuncs
+
+def isGetProcAddressOnlyAPI(vulkanApi):
+ return vulkanApi.name in getProcAddrOnlyFuncs
+
+def isGetInstanceProcAddressNoInstanceAPI(vulkanApi):
+ return vulkanApi.name in getInstanceProcAddrNoInstanceFuncs
+
+def isGetInstanceProcAddressAPI(vulkanApi):
+ if vulkanApi.name in getInstanceProcAddrFuncs:
+ return True
+
+ if vulkanApi.parameters[0].typeName == "VkInstance":
+ return True
+
+ return False
+
+def isGetDeviceProcAddressAPI(vulkanApi):
+ if isGetProcAddressAPI(vulkanApi):
+ return False
+
+ if isGetProcAddressOnlyAPI(vulkanApi):
+ return False
+
+ if isGetInstanceProcAddressAPI(vulkanApi):
+ return False
+
+ return True
+
+def inferProcAddressFuncType(vulkanApi):
+ if isGetProcAddressAPI(vulkanApi):
+ return "global"
+ if isGetProcAddressOnlyAPI(vulkanApi):
+ return "global-only"
+ if isGetInstanceProcAddressNoInstanceAPI(vulkanApi):
+ return "global-instance"
+ if isGetInstanceProcAddressAPI(vulkanApi):
+ return "instance"
+ return "device"
+
+# VulkanDispatch defines a struct, VulkanDispatch,
+# that is populated by function pointers from the Vulkan
+# loader. No attempt is made to do something different
+# for instance vs device functions.
+class VulkanDispatch(VulkanWrapperGenerator):
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.apisToGet = {}
+
+ self.cgenHeader = CodeGen()
+ self.cgenImpl = CodeGen()
+ self.typeInfo = typeInfo
+
+ self.currentFeature = ""
+ self.featureForCodegen = ""
+
+ def onBegin(self):
+
+ # The first way is to use just the loader to get symbols. This doesn't
+ # necessarily work with extensions because at that point the dispatch
+ # table needs to be specific to a particular Vulkan instance or device.
+
+ self.cgenHeader.line("""
+void init_vulkan_dispatch_from_system_loader(
+ DlOpenFunc dlOpenFunc,
+ DlSymFunc dlSymFunc,
+ VulkanDispatch* dispatch_out);
+""")
+
+ # The second way is to initialize the table from a given Vulkan
+ # instance or device. Provided the instance or device was created with
+ # the right extensions, we can obtain function pointers to extension
+ # functions this way.
+
+ self.cgenHeader.line("""
+void init_vulkan_dispatch_from_instance(
+ VulkanDispatch* vk,
+ VkInstance instance,
+ VulkanDispatch* dispatch_out);
+""")
+ self.cgenHeader.line("""
+void init_vulkan_dispatch_from_device(
+ VulkanDispatch* vk,
+ VkDevice device,
+ VulkanDispatch* dispatch_out);
+""")
+
+ # After populating a VulkanDispatch with the above methods,
+ # it can be useful to check whether the Vulkan 1.0 or 1.1 methods
+ # are all there.
+ def emit_feature_check_decl(cgen, tag, featureToCheck):
+ cgen.line("""
+bool vulkan_dispatch_check_%s_%s(
+ const VulkanDispatch* vk);
+""" % (tag, featureToCheck))
+
+ emit_feature_check_decl(self.cgenHeader, "instance", "VK_VERSION_1_0")
+ emit_feature_check_decl(self.cgenHeader, "instance", "VK_VERSION_1_1")
+ emit_feature_check_decl(self.cgenHeader, "device", "VK_VERSION_1_0")
+ emit_feature_check_decl(self.cgenHeader, "device", "VK_VERSION_1_1")
+
+ self.cgenHeader.line("struct VulkanDispatch {")
+ self.module.appendHeader(self.cgenHeader.swapCode())
+
+ def syncFeatureQuiet(self, cgen, feature):
+ if self.featureForCodegen != feature:
+ if feature == "":
+ self.featureForCodegen = feature
+ return
+
+ self.featureForCodegen = feature
+
+ def syncFeature(self, cgen, feature):
+ if self.featureForCodegen != feature:
+ if feature == "":
+ cgen.leftline("#endif")
+ self.featureForCodegen = feature
+ return
+
+ if self.featureForCodegen != "":
+ cgen.leftline("#endif")
+
+ cgen.leftline("#ifdef %s" % feature)
+ self.featureForCodegen = feature
+
+ def makeDlsymCall(self, cgen, apiname, typedecl):
+ cgen.stmt( \
+ "out->%s = (%s)dlSymFunc(lib, \"%s\")" % \
+ (apiname, typedecl, apiname))
+
+ def makeGetInstanceProcAddrCall(self, cgen, dispatch, instance, apiname, typedecl):
+ cgen.stmt( \
+ "out->%s = (%s)%s->vkGetInstanceProcAddr(%s, \"%s\")" % \
+ (apiname, typedecl, dispatch, instance, apiname))
+
+ def makeGetDeviceProcAddrCall(self, cgen, dispatch, device, apiname, typedecl):
+ cgen.stmt( \
+ "out->%s = (%s)%s->vkGetDeviceProcAddr(%s, \"%s\")" % \
+ (apiname, typedecl, dispatch, device, apiname))
+
+ def onEnd(self):
+ self.cgenHeader.line("};")
+ self.module.appendHeader(self.cgenHeader.swapCode())
+
+ # Getting dispatch tables from the loader
+ self.cgenImpl.line("""
+void init_vulkan_dispatch_from_system_loader(
+ DlOpenFunc dlOpenFunc,
+ DlSymFunc dlSymFunc,
+ VulkanDispatch* out)""")
+
+ self.cgenImpl.beginBlock()
+
+ self.cgenImpl.stmt("memset(out, 0x0, sizeof(VulkanDispatch))")
+
+ self.cgenImpl.stmt("void* lib = dlOpenFunc()")
+ self.cgenImpl.stmt("if (!lib) return")
+
+ apis = \
+ self.apisToGet["global"] + \
+ self.apisToGet["global-instance"] + \
+ self.apisToGet["instance"] + \
+ self.apisToGet["device"]
+
+ if "global-only" in self.apisToGet:
+ apis = apis + self.apisToGet["global-only"]
+
+ for vulkanApi, typeDecl, feature in apis:
+ self.syncFeature(self.cgenImpl, feature)
+ self.makeDlsymCall(self.cgenImpl, vulkanApi.name, typeDecl)
+
+ self.syncFeature(self.cgenImpl, "")
+ self.cgenImpl.endBlock()
+
+ # Getting instance dispatch tables
+ self.cgenImpl.line("""
+void init_vulkan_dispatch_from_instance(
+ VulkanDispatch* vk,
+ VkInstance instance,
+ VulkanDispatch* out)""")
+
+ self.cgenImpl.beginBlock()
+
+ self.cgenImpl.stmt("memset(out, 0x0, sizeof(VulkanDispatch))")
+
+ apis = \
+ self.apisToGet["global"] + \
+ self.apisToGet["global-instance"] + \
+ self.apisToGet["instance"] + \
+ self.apisToGet["device"]
+
+ for vulkanApi, typeDecl, feature in apis:
+ self.syncFeature(self.cgenImpl, feature)
+ self.makeGetInstanceProcAddrCall(
+ self.cgenImpl, "vk", "instance", vulkanApi.name, typeDecl)
+
+ self.syncFeature(self.cgenImpl, "")
+ self.cgenImpl.endBlock()
+
+ # Getting device dispatch tables
+ self.cgenImpl.line("""
+void init_vulkan_dispatch_from_device(
+ VulkanDispatch* vk,
+ VkDevice device,
+ VulkanDispatch* out)""")
+
+ self.cgenImpl.beginBlock()
+
+ self.cgenImpl.stmt("memset(out, 0x0, sizeof(VulkanDispatch))")
+
+ apis = \
+ self.apisToGet["global"] + \
+ self.apisToGet["global-instance"] + \
+ self.apisToGet["instance"] + \
+ self.apisToGet["device"]
+
+ for vulkanApi, typeDecl, feature in apis:
+ self.syncFeature(self.cgenImpl, feature)
+ self.makeGetDeviceProcAddrCall(
+ self.cgenImpl, "vk", "device", vulkanApi.name, typeDecl)
+
+ self.syncFeature(self.cgenImpl, "")
+ self.cgenImpl.endBlock()
+
+ # Check Vulkan 1.0 / 1.1 functions
+
+ def emit_check_impl(cgen, dispatchVar, feature, featureToCheck, apiName):
+ if feature == featureToCheck:
+ cgen.beginIf("!%s->%s" % (dispatchVar, apiName))
+ cgen.stmt("fprintf(stderr, \"%s check failed: %s not found\\n\")" % (featureToCheck, apiName))
+ cgen.stmt("good = false")
+ cgen.endIf()
+
+ def emit_feature_check_impl(context, cgen, tag, featureToCheck, apis):
+ cgen.line("""
+bool vulkan_dispatch_check_%s_%s(
+ const VulkanDispatch* vk)
+""" % (tag, featureToCheck))
+
+ cgen.beginBlock()
+
+ cgen.stmt("bool good = true")
+
+ for vulkanApi, typeDecl, feature in apis:
+ context.syncFeatureQuiet(self.cgenImpl, feature)
+ emit_check_impl(cgen, "vk", feature, featureToCheck, vulkanApi.name)
+
+ context.syncFeatureQuiet(self.cgenImpl, "")
+
+ cgen.stmt("return good")
+ cgen.endBlock()
+
+ instanceApis = self.apisToGet["global-instance"] + self.apisToGet["instance"]
+
+ emit_feature_check_impl(self, self.cgenImpl, "instance", "VK_VERSION_1_0", instanceApis)
+ emit_feature_check_impl(self, self.cgenImpl, "instance", "VK_VERSION_1_1", instanceApis)
+ emit_feature_check_impl(self, self.cgenImpl, "device", "VK_VERSION_1_0", self.apisToGet["device"])
+ emit_feature_check_impl(self, self.cgenImpl, "device", "VK_VERSION_1_1", self.apisToGet["device"])
+
+ self.module.appendImpl(self.cgenImpl.swapCode())
+
+ def onBeginFeature(self, featureName, featureType):
+ self.currentFeature = featureName
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ vulkanApi = self.typeInfo.apis[name]
+
+ typeDecl = "PFN_%s" % name
+
+ procAddressType = inferProcAddressFuncType(vulkanApi)
+
+ self.cgenHeader.stmt("%s %s" % (typeDecl, name));
+ self.module.appendHeader(self.cgenHeader.swapCode())
+
+ current = self.apisToGet.get(procAddressType, [])
+ if current == []:
+ self.apisToGet[procAddressType] = current
+ current.append((vulkanApi, typeDecl, self.currentFeature))
+
+# VulkanDispatchFast allows one to get the optimal function pointers
+# for a given Vulkan API call, in order to improve performance.
+#
+# We can optionally query VkDevices to get function pointers that are
+# closer to the ICD and have fewer levels of indirection from the loader
+# to get there.
+# See
+# https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md
+# for more info.
+#
+# This requires the calling C++ code to provide functions to
+# generate the desired instances and devices, otherwise we won't know
+# which instance or device to pass to vkGet(Instance|Device)ProcAddr,
+# so it does push more complexity to the user.
+class VulkanDispatchFast(VulkanDispatch):
+
+ def __init__(self, module, typeInfo):
+ VulkanDispatch.__init__(self, module, typeInfo)
+
+ def onBegin(self):
+ self.cgenHeader.line("""
+void init_vulkan_dispatch_from_system_loader(
+ DlOpenFunc dlOpenFunc,
+ DlSymFunc dlSymFunc,
+ InstanceGetter instanceGetter,
+ DeviceGetter deviceGetter,
+ VulkanDispatch* dispatch_out);
+""")
+
+ self.cgenHeader.line("struct VulkanDispatch {")
+ self.cgenHeader.line("VkInstance instance;")
+ self.cgenHeader.line("VkPhysicalDevice physicalDevice;")
+ self.cgenHeader.line("uint32_t physicalDeviceQueueFamilyInfoCount;")
+ self.cgenHeader.line("VkQueueFamilyProperties* physicalDeviceQueueFamilyInfos;")
+ self.cgenHeader.line("VkDevice device;")
+ self.cgenHeader.line("bool presentCapable;")
+ self.module.appendHeader(self.cgenHeader.swapCode())
+
+ def makeGetProcAddr(self, cgen, dispatchLevel, dispatch, apiname, typedecl):
+ if dispatchLevel == "instance":
+ funcname = "vkGetInstanceProcAddr"
+ elif dispatchLevel == "device":
+ funcname = "vkGetDeviceProcAddr"
+ else:
+ raise
+
+ cgen.stmt( \
+ "out->%s = (%s)out->%s(%s, \"%s\")" % \
+ (apiname, typedecl, funcname, dispatch, apiname))
+
+ def onEnd(self):
+ self.cgenHeader.line("};")
+ self.module.appendHeader(self.cgenHeader.swapCode())
+
+ self.cgenImpl.line("""
+void init_vulkan_dispatch_from_system_loader(
+ DlOpenFunc dlOpenFunc,
+ DlSymFunc dlSymFunc,
+ InstanceGetter instanceGetter,
+ DeviceGetter deviceGetter,
+ VulkanDispatch* out)""")
+
+ self.cgenImpl.beginBlock()
+
+ self.cgenImpl.stmt("out->instance = nullptr")
+ self.cgenImpl.stmt("out->physicalDevice = nullptr")
+ self.cgenImpl.stmt("out->physicalDeviceQueueFamilyInfoCount = 0")
+ self.cgenImpl.stmt("out->physicalDeviceQueueFamilyInfos = nullptr")
+ self.cgenImpl.stmt("out->device = nullptr")
+ self.cgenImpl.stmt("out->presentCapable = false")
+
+ self.cgenImpl.stmt("void* lib = dlOpenFunc()")
+ self.cgenImpl.stmt("if (!lib) return")
+
+ for vulkanApi, typeDecl, feature in self.apisToGet["global"]:
+ self.syncFeature(self.cgenImpl, feature)
+ self.makeDlsymCall(self.cgenImpl, vulkanApi.name, typeDecl)
+
+ self.syncFeature(self.cgenImpl, "")
+ self.cgenImpl.stmt("if (!out->vkGetInstanceProcAddr) return")
+
+ for vulkanApi, typeDecl, feature in self.apisToGet["global-instance"]:
+ self.syncFeature(self.cgenImpl, feature)
+ self.makeGetProcAddr( \
+ self.cgenImpl, "instance", "nullptr", vulkanApi.name, typeDecl);
+
+ self.syncFeature(self.cgenImpl, "")
+ self.cgenImpl.stmt("if (!instanceGetter(out, &out->instance)) return")
+
+ for vulkanApi, typeDecl, feature in self.apisToGet["instance"]:
+ self.syncFeature(self.cgenImpl, feature)
+ self.makeGetProcAddr( \
+ self.cgenImpl, "instance", "out->instance", vulkanApi.name, typeDecl);
+
+ self.syncFeature(self.cgenImpl, "")
+
+ self.cgenImpl.stmt("if (!deviceGetter(out, out->instance, &out->physicalDevice, &out->physicalDeviceQueueFamilyInfoCount, nullptr, &out->device, &out->presentCapable)) return")
+ self.cgenImpl.stmt("out->physicalDeviceQueueFamilyInfos = (VkQueueFamilyProperties*)malloc(out->physicalDeviceQueueFamilyInfoCount * sizeof(VkQueueFamilyProperties))");
+ self.cgenImpl.stmt("if (!deviceGetter(out, out->instance, &out->physicalDevice, &out->physicalDeviceQueueFamilyInfoCount, out->physicalDeviceQueueFamilyInfos, &out->device, &out->presentCapable)) return")
+
+ for vulkanApi, typeDecl, feature in self.apisToGet["device"]:
+ self.syncFeature(self.cgenImpl, feature)
+ self.makeGetProcAddr( \
+ self.cgenImpl, "device", "out->device", vulkanApi.name, typeDecl);
+
+ self.syncFeature(self.cgenImpl, "")
+
+ self.cgenImpl.endBlock()
+
+ self.module.appendImpl(self.cgenImpl.swapCode())
+
+ def onBeginFeature(self, featureName, featureType):
+ VulkanDispatch.onBeginFeature(self, featureName, featureType);
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanDispatch.onGenType(self, typeXml, name, alias);
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanDispatch.onGenCmd(self, cmdinfo, name, alias);
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/encoder.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/encoder.py
new file mode 100644
index 00000000000..ff62215d16e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/encoder.py
@@ -0,0 +1,723 @@
+import copy
+
+from .common.codegen import CodeGen, VulkanWrapperGenerator
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType
+
+from .marshaling import VulkanMarshalingCodegen
+from .reservedmarshaling import VulkanReservedMarshalingCodegen
+from .counting import VulkanCountingCodegen
+from .handlemap import HandleMapCodegen
+from .deepcopy import DeepcopyCodegen
+from .transform import TransformCodegen, genTransformsForVulkanType
+
+from .wrapperdefs import API_PREFIX_RESERVEDMARSHAL
+from .wrapperdefs import API_PREFIX_MARSHAL
+from .wrapperdefs import API_PREFIX_UNMARSHAL
+from .wrapperdefs import ROOT_TYPE_DEFAULT_VALUE
+from .wrapperdefs import VULKAN_STREAM_TYPE_GUEST
+
+encoder_decl_preamble = """
+
+class VkEncoder {
+public:
+ VkEncoder(gfxstream::guest::IOStream* stream, gfxstream::guest::HealthMonitor<>* healthMonitor = nullptr);
+ ~VkEncoder();
+
+#include "VkEncoder.h.inl"
+"""
+
+encoder_decl_postamble = """
+private:
+ class Impl;
+ std::unique_ptr<Impl> mImpl;
+ gfxstream::guest::HealthMonitor<>* mHealthMonitor;
+};
+"""
+
+encoder_impl_preamble ="""
+
+using namespace gfxstream::vk;
+
+using gfxstream::guest::AutoLock;
+using gfxstream::guest::Lock;
+using gfxstream::guest::BumpPool;
+
+#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; \\
+
+"""
+
+STREAM = "stream"
+RESOURCES = "sResourceTracker"
+POOL = "pool"
+
+ENCODER_PREVALIDATED_APIS = [
+ "vkFlushMappedMemoryRanges",
+ "vkInvalidateMappedMemoryRanges",
+]
+
+ENCODER_CUSTOM_RESOURCE_PREPROCESS = [
+ "vkMapMemoryIntoAddressSpaceGOOGLE",
+ "vkDestroyDevice",
+]
+
+ENCODER_CUSTOM_RESOURCE_POSTPROCESS = [
+ "vkCreateInstance",
+ "vkCreateDevice",
+ "vkMapMemoryIntoAddressSpaceGOOGLE",
+ "vkGetPhysicalDeviceFeatures2",
+ "vkGetPhysicalDeviceFeatures2KHR",
+ "vkGetPhysicalDeviceProperties",
+ "vkGetPhysicalDeviceProperties2",
+ "vkGetPhysicalDeviceProperties2KHR",
+ "vkCreateDescriptorUpdateTemplate",
+ "vkCreateDescriptorUpdateTemplateKHR",
+ "vkGetPhysicalDeviceExternalSemaphoreProperties",
+ "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR",
+ "vkGetDeviceQueue",
+ "vkGetDeviceQueue2",
+]
+
+ENCODER_EXPLICIT_FLUSHED_APIS = [
+ "vkEndCommandBufferAsyncGOOGLE",
+ "vkQueueSubmitAsyncGOOGLE",
+ "vkQueueBindSparseAsyncGOOGLE",
+ "vkQueueWaitIdleAsyncGOOGLE",
+ "vkQueueSignalReleaseImageANDROID",
+ "vkDestroyDevice",
+]
+
+SUCCESS_RET_TYPES = {
+ "VkResult" : "VK_SUCCESS",
+ "void" : None,
+ # TODO: Put up success results for other return types here.
+}
+
+ENCODER_THIS_PARAM = makeVulkanTypeSimple(False, "VkEncoder", 1, "this")
+
+# Common components of encoding a Vulkan API call
+def make_event_handler_call(
+ handler_access,
+ api,
+ context_param,
+ input_result_param,
+ cgen,
+ suffix=""):
+ extraParams = [context_param.paramName]
+ if input_result_param:
+ extraParams.append(input_result_param)
+ return cgen.makeCallExpr( \
+ "%s->on_%s%s" % (handler_access, api.name, suffix),
+ extraParams + \
+ [p.paramName for p in api.parameters[:-1]])
+
+def emit_custom_pre_validate(typeInfo, api, cgen):
+ if api.name in ENCODER_PREVALIDATED_APIS:
+ callExpr = \
+ make_event_handler_call( \
+ "mImpl->validation()", api,
+ ENCODER_THIS_PARAM,
+ SUCCESS_RET_TYPES[api.getRetTypeExpr()],
+ cgen)
+
+ if api.getRetTypeExpr() == "void":
+ cgen.stmt("VALIDATE_VOID(%s)" % callExpr)
+ else:
+ cgen.stmt("VALIDATE_RET(%s, %s, %s)" % \
+ (api.getRetTypeExpr(),
+ SUCCESS_RET_TYPES[api.getRetTypeExpr()],
+ callExpr))
+
+def emit_custom_resource_preprocess(typeInfo, api, cgen):
+ if api.name in ENCODER_CUSTOM_RESOURCE_PREPROCESS:
+ cgen.stmt( \
+ make_event_handler_call( \
+ "sResourceTracker", api,
+ ENCODER_THIS_PARAM,
+ SUCCESS_RET_TYPES[api.getRetTypeExpr()],
+ cgen, suffix="_pre"))
+
+def emit_custom_resource_postprocess(typeInfo, api, cgen):
+ if api.name in ENCODER_CUSTOM_RESOURCE_POSTPROCESS:
+ cgen.stmt(make_event_handler_call( \
+ "sResourceTracker",
+ api,
+ ENCODER_THIS_PARAM,
+ api.getRetVarExpr(),
+ cgen))
+
+def emit_count_marshal(typeInfo, param, cgen):
+ res = \
+ iterateVulkanType(
+ typeInfo, param,
+ VulkanCountingCodegen( \
+ cgen, "sFeatureBits", param.paramName, "countPtr", ROOT_TYPE_DEFAULT_VALUE,
+ "count_"))
+ if not res:
+ cgen.stmt("(void)%s" % param.paramName)
+
+def emit_marshal(typeInfo, param, cgen):
+ forOutput = param.isHandleType() and ("out" in param.inout)
+ if forOutput:
+ cgen.stmt("/* is handle, possibly out */")
+
+ res = \
+ iterateVulkanType(
+ typeInfo, param,
+ VulkanReservedMarshalingCodegen( \
+ cgen, "guest", STREAM, ROOT_TYPE_DEFAULT_VALUE, param.paramName, "streamPtrPtr",
+ API_PREFIX_RESERVEDMARSHAL,
+ "" if forOutput else "get_host_u64_",
+ direction="write"))
+ if not res:
+ cgen.stmt("(void)%s" % param.paramName)
+
+ if forOutput:
+ cgen.stmt("/* is handle, possibly out */")
+
+def emit_unmarshal(typeInfo, param, cgen):
+ iterateVulkanType(
+ typeInfo, param,
+ VulkanMarshalingCodegen( \
+ cgen, STREAM, ROOT_TYPE_DEFAULT_VALUE, param.paramName,
+ API_PREFIX_UNMARSHAL, direction="read"))
+
+def emit_deepcopy(typeInfo, param, cgen):
+ res = \
+ iterateVulkanType(typeInfo, param, DeepcopyCodegen(
+ cgen, [param.paramName, "local_" + param.paramName], "pool", ROOT_TYPE_DEFAULT_VALUE, "deepcopy_"))
+ if not res:
+ cgen.stmt("(void)%s" % param.paramName)
+
+def emit_transform(typeInfo, param, cgen, variant="tohost"):
+ res = \
+ iterateVulkanType(typeInfo, param, TransformCodegen( \
+ cgen, param.paramName, "sResourceTracker", "transform_%s_" % variant, variant))
+ if not res:
+ cgen.stmt("(void)%s" % param.paramName)
+
+def emit_handlemap_create(typeInfo, param, cgen):
+ iterateVulkanType(typeInfo, param, HandleMapCodegen(
+ cgen, None, "sResourceTracker", "handlemap_",
+ lambda vtype: typeInfo.isHandleType(vtype.typeName)
+ ))
+
+def custom_encoder_args(api):
+ params = ["this"]
+ if api.getRetVarExpr() is not None:
+ params.append(api.getRetVarExpr())
+ return params
+
+def emit_handlemap_destroy(typeInfo, param, cgen):
+ iterateVulkanType(typeInfo, param, HandleMapCodegen(
+ cgen, None, "sResourceTracker->destroyMapping()", "handlemap_",
+ lambda vtype: typeInfo.isHandleType(vtype.typeName)
+ ))
+
+class EncodingParameters(object):
+ def __init__(self, api):
+ self.localCopied = []
+ self.toWrite = []
+ self.toRead = []
+ self.toCreate = []
+ self.toDestroy = []
+
+ for param in api.parameters:
+ param.action = None
+ param.inout = "in"
+
+ if param.paramName == "doLock":
+ continue
+
+ if param.possiblyOutput():
+ param.inout += "out"
+ self.toWrite.append(param)
+ self.toRead.append(param)
+ if param.isCreatedBy(api):
+ self.toCreate.append(param)
+ param.action = "create"
+ else:
+
+ if param.paramName == "doLock":
+ continue
+
+ if param.isDestroyedBy(api):
+ self.toDestroy.append(param)
+ param.action = "destroy"
+ localCopyParam = \
+ param.getForNonConstAccess().withModifiedName( \
+ "local_" + param.paramName)
+ self.localCopied.append((param, localCopyParam))
+ self.toWrite.append(localCopyParam)
+
+def emit_parameter_encode_preamble_write(typeInfo, api, cgen):
+ emit_custom_pre_validate(typeInfo, api, cgen);
+ emit_custom_resource_preprocess(typeInfo, api, cgen);
+
+ cgen.stmt("auto %s = mImpl->stream()" % STREAM)
+ cgen.stmt("auto %s = mImpl->pool()" % POOL)
+ # cgen.stmt("%s->setHandleMapping(%s->unwrapMapping())" % (STREAM, RESOURCES))
+
+ encodingParams = EncodingParameters(api)
+ for (_, localCopyParam) in encodingParams.localCopied:
+ cgen.stmt(cgen.makeRichCTypeDecl(localCopyParam))
+
+def emit_parameter_encode_copy_unwrap_count(typeInfo, api, cgen, customUnwrap=None):
+ encodingParams = EncodingParameters(api)
+
+ for (origParam, localCopyParam) in encodingParams.localCopied:
+ shouldCustomCopy = \
+ customUnwrap and \
+ origParam.paramName in customUnwrap and \
+ "copyOp" in customUnwrap[origParam.paramName]
+
+ shouldCustomMap = \
+ customUnwrap and \
+ origParam.paramName in customUnwrap and \
+ "mapOp" in customUnwrap[origParam.paramName]
+
+ if shouldCustomCopy:
+ customUnwrap[origParam.paramName]["copyOp"](cgen, origParam, localCopyParam)
+ else:
+ # if this is a pointer type and we don't do custom copy nor unwrap,
+ # and the transform doesn't end up doing anything,
+ # don't deepcopy, just cast it.
+
+ avoidDeepcopy = False
+
+ if origParam.pointerIndirectionLevels > 0:
+ testCgen = CodeGen()
+ genTransformsForVulkanType("sResourceTracker", origParam, lambda p: testCgen.generalAccess(p, parentVarName = None, asPtr = True), lambda p: testCgen.generalLengthAccess(p, parentVarName = None), testCgen)
+ emit_transform(typeInfo, origParam, testCgen, variant="tohost")
+ if "" == testCgen.swapCode():
+ avoidDeepcopy = True
+ if avoidDeepcopy:
+ cgen.line("// Avoiding deepcopy for %s" % origParam.paramName)
+ cgen.stmt("%s = (%s%s)%s" % (localCopyParam.paramName, localCopyParam.typeName, "*" * origParam.pointerIndirectionLevels, origParam.paramName))
+ else:
+ emit_deepcopy(typeInfo, origParam, cgen)
+
+ for (origParam, localCopyParam) in encodingParams.localCopied:
+ shouldCustomMap = \
+ customUnwrap and \
+ origParam.paramName in customUnwrap and \
+ "mapOp" in customUnwrap[origParam.paramName]
+
+ if shouldCustomMap:
+ customUnwrap[origParam.paramName]["mapOp"](cgen, origParam, localCopyParam)
+ else:
+ if localCopyParam.typeName == "VkAllocationCallbacks":
+ cgen.stmt("%s = nullptr" % localCopyParam.paramName)
+
+ apiForTransform = \
+ api.withCustomParameters( \
+ map(lambda p: p[1], \
+ encodingParams.localCopied))
+
+ # Apply transforms if applicable.
+ # Apply transform to API itself:
+ genTransformsForVulkanType(
+ "sResourceTracker",
+ apiForTransform,
+ lambda p: cgen.generalAccess(p, parentVarName = None, asPtr = True),
+ lambda p: cgen.generalLengthAccess(p, parentVarName = None),
+ cgen)
+
+ # For all local copied parameters, run the transforms
+ for localParam in apiForTransform.parameters:
+ if "doLock" in localParam.paramName:
+ continue
+ emit_transform(typeInfo, localParam, cgen, variant="tohost")
+
+ cgen.stmt("size_t count = 0")
+ cgen.stmt("size_t* countPtr = &count")
+ cgen.beginBlock()
+
+ # Use counting stream to calculate the packet size.
+ for p in encodingParams.toWrite:
+ emit_count_marshal(typeInfo, p, cgen)
+
+ cgen.endBlock()
+
+def is_cmdbuf_dispatch(api):
+ return "VkCommandBuffer" == api.parameters[0].typeName
+
+def emit_parameter_encode_write_packet_info(typeInfo, api, cgen):
+ # Seqno and skipping dispatch serialize are for use with VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT
+ doSeqno = True
+ doDispatchSerialize = True
+
+ if is_cmdbuf_dispatch(api):
+ doSeqno = False
+ doDispatchSerialize = False
+
+ if doSeqno:
+ cgen.stmt("uint32_t packetSize_%s = 4 + 4 + (queueSubmitWithCommandsEnabled ? 4 : 0) + count" % (api.name))
+ else:
+ cgen.stmt("uint32_t packetSize_%s = 4 + 4 + count" % (api.name))
+ cgen.stmt("healthMonitorAnnotation_packetSize = std::make_optional(packetSize_%s)" % (api.name))
+
+ if not doDispatchSerialize:
+ cgen.stmt("if (queueSubmitWithCommandsEnabled) packetSize_%s -= 8" % api.name)
+
+ cgen.stmt("uint8_t* streamPtr = %s->reserve(packetSize_%s)" % (STREAM, api.name))
+ cgen.stmt("uint8_t* packetBeginPtr = streamPtr")
+ cgen.stmt("uint8_t** streamPtrPtr = &streamPtr")
+ cgen.stmt("uint32_t opcode_%s = OP_%s" % (api.name, api.name))
+
+ if doSeqno:
+ cgen.stmt("uint32_t seqno; if (queueSubmitWithCommandsEnabled) seqno = ResourceTracker::nextSeqno()")
+ cgen.stmt("healthMonitorAnnotation_seqno = std::make_optional(seqno)")
+
+ cgen.stmt("memcpy(streamPtr, &opcode_%s, sizeof(uint32_t)); streamPtr += sizeof(uint32_t)" % api.name)
+ cgen.stmt("memcpy(streamPtr, &packetSize_%s, sizeof(uint32_t)); streamPtr += sizeof(uint32_t)" % api.name)
+
+ if doSeqno:
+ cgen.line("if (queueSubmitWithCommandsEnabled) { memcpy(streamPtr, &seqno, sizeof(uint32_t)); streamPtr += sizeof(uint32_t); }")
+
+def emit_parameter_encode_do_parameter_write(typeInfo, api, cgen):
+ encodingParams = EncodingParameters(api)
+
+ dispatchDone = False
+
+ for p in encodingParams.toWrite:
+ if is_cmdbuf_dispatch(api) and not dispatchDone:
+ cgen.beginIf("!queueSubmitWithCommandsEnabled")
+ emit_marshal(typeInfo, p, cgen)
+ cgen.endIf()
+ else:
+ emit_marshal(typeInfo, p, cgen)
+
+ dispatchDone = True
+
+ cgen.beginIf("watchdog")
+ cgen.stmt("size_t watchdogBufSize = std::min<size_t>(static_cast<size_t>(packetSize_%s), kWatchdogBufferMax)" % (api.name))
+ cgen.stmt("healthMonitorAnnotation_packetContents.resize(watchdogBufSize)")
+ cgen.stmt("memcpy(&healthMonitorAnnotation_packetContents[0], packetBeginPtr, watchdogBufSize)")
+ cgen.endIf()
+
+def emit_parameter_encode_read(typeInfo, api, cgen):
+ encodingParams = EncodingParameters(api)
+
+ for p in encodingParams.toRead:
+ if p.action == "create":
+ cgen.stmt(
+ "%s->setHandleMapping(%s->createMapping())" % \
+ (STREAM, RESOURCES))
+ emit_unmarshal(typeInfo, p, cgen)
+ if p.action == "create":
+ cgen.stmt(
+ "%s->unsetHandleMapping()" % STREAM)
+ emit_transform(typeInfo, p, cgen, variant="fromhost")
+
+def emit_post(typeInfo, api, cgen):
+ encodingParams = EncodingParameters(api)
+
+ emit_custom_resource_postprocess(typeInfo, api, cgen)
+
+ for p in encodingParams.toDestroy:
+ emit_handlemap_destroy(typeInfo, p, cgen)
+
+ doSeqno = True
+ if is_cmdbuf_dispatch(api):
+ doSeqno = False
+
+ retType = api.getRetTypeExpr()
+
+ if api.name in ENCODER_EXPLICIT_FLUSHED_APIS:
+ cgen.stmt("stream->flush()");
+ return
+
+ if doSeqno:
+ if retType == "void":
+ encodingParams = EncodingParameters(api)
+ if 0 == len(encodingParams.toRead):
+ cgen.stmt("stream->flush()");
+
+def emit_pool_free(cgen):
+ cgen.stmt("++encodeCount;")
+ cgen.beginIf("0 == encodeCount % POOL_CLEAR_INTERVAL")
+ cgen.stmt("pool->freeAll()")
+ cgen.stmt("%s->clearPool()" % STREAM)
+ cgen.endIf()
+
+def emit_return_unmarshal(typeInfo, api, cgen):
+
+ retType = api.getRetTypeExpr()
+
+ if retType == "void":
+ return
+
+ retVar = api.getRetVarExpr()
+ cgen.stmt("%s %s = (%s)0" % (retType, retVar, retType))
+ cgen.stmt("%s->read(&%s, %s)" % \
+ (STREAM, retVar, cgen.sizeofExpr(api.retType)))
+
+def emit_return(typeInfo, api, cgen):
+ if api.getRetTypeExpr() == "void":
+ return
+
+ retVar = api.getRetVarExpr()
+ cgen.stmt("return %s" % retVar)
+
+def emit_lock(cgen):
+ cgen.stmt("(void)doLock");
+ cgen.stmt("bool queueSubmitWithCommandsEnabled = sFeatureBits & VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT")
+ cgen.stmt("if (!queueSubmitWithCommandsEnabled && doLock) this->lock()")
+
+def emit_unlock(cgen):
+ cgen.stmt("if (!queueSubmitWithCommandsEnabled && doLock) this->unlock()")
+
+def emit_debug_log(typeInfo, api, cgen):
+ logFormat = []
+ logVargs = []
+ for param in api.parameters:
+ if param.paramName == "doLock":
+ continue
+
+ paramFormatSpecifier = param.getPrintFormatSpecifier()
+ if not paramFormatSpecifier:
+ continue
+
+ logFormat.append(param.paramName + ":" + paramFormatSpecifier)
+ logVargs.append(param.paramName)
+
+ logFormatStr = ", ".join(logFormat)
+ logVargsStr = ", ".join(logVargs)
+
+ cgen.stmt("ENCODER_DEBUG_LOG(\"%s(%s)\", %s)" % (api.name, logFormatStr, logVargsStr))
+
+def emit_health_watchdog(api, cgen):
+ cgen.stmt("std::optional<uint32_t> healthMonitorAnnotation_seqno = std::nullopt")
+ cgen.stmt("std::optional<uint32_t> healthMonitorAnnotation_packetSize = std::nullopt")
+ cgen.stmt("std::vector<uint8_t> healthMonitorAnnotation_packetContents")
+ cgen.line("""
+ auto watchdog = WATCHDOG_BUILDER(mHealthMonitor, \"%s in VkEncoder\")
+ .setOnHangCallback([&]() {
+ auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+ if (healthMonitorAnnotation_seqno) {
+ annotations->insert({{"seqno", std::to_string(healthMonitorAnnotation_seqno.value())}});
+ }
+ if (healthMonitorAnnotation_packetSize) {
+ annotations->insert({{"packetSize", std::to_string(healthMonitorAnnotation_packetSize.value())}});
+ }
+ if (!healthMonitorAnnotation_packetContents.empty()) {
+ annotations->insert(
+ {{"packetContents", getPacketContents(
+ &healthMonitorAnnotation_packetContents[0], healthMonitorAnnotation_packetContents.size())}});
+ }
+ return std::move(annotations);
+ })
+ .build();
+ """% (api.name)
+ )
+
+def emit_default_encoding(typeInfo, api, cgen):
+ emit_debug_log(typeInfo, api, cgen)
+ emit_lock(cgen)
+ emit_parameter_encode_preamble_write(typeInfo, api, cgen)
+ emit_parameter_encode_copy_unwrap_count(typeInfo, api, cgen)
+ emit_parameter_encode_write_packet_info(typeInfo, api, cgen)
+ emit_parameter_encode_do_parameter_write(typeInfo, api, cgen)
+ emit_parameter_encode_read(typeInfo, api, cgen)
+ emit_return_unmarshal(typeInfo, api, cgen)
+ emit_post(typeInfo, api, cgen)
+ emit_pool_free(cgen)
+ emit_unlock(cgen)
+ emit_return(typeInfo, api, cgen)
+
+## Custom encoding definitions##################################################
+
+def emit_only_goldfish_custom(typeInfo, api, cgen):
+ emit_lock(cgen)
+ cgen.vkApiCall( \
+ api,
+ customPrefix="sResourceTracker->on_",
+ customParameters=custom_encoder_args(api) + \
+ [p.paramName for p in api.parameters[:-1]])
+ emit_unlock(cgen)
+ emit_return(typeInfo, api, cgen)
+
+def emit_only_resource_event(typeInfo, api, cgen):
+ cgen.stmt("(void)doLock");
+ input_result = None
+ retExpr = api.getRetVarExpr()
+
+ if retExpr:
+ retType = api.getRetTypeExpr()
+ input_result = SUCCESS_RET_TYPES[retType]
+ cgen.stmt("%s %s = (%s)0" % (retType, retExpr, retType))
+
+ cgen.stmt(
+ (("%s = " % retExpr) if retExpr else "") +
+ make_event_handler_call(
+ "sResourceTracker",
+ api,
+ ENCODER_THIS_PARAM,
+ input_result, cgen))
+
+ if retExpr:
+ emit_return(typeInfo, api, cgen)
+
+def emit_with_custom_unwrap(custom):
+ def call(typeInfo, api, cgen):
+ emit_lock(cgen)
+ emit_parameter_encode_preamble_write(typeInfo, api, cgen)
+ emit_parameter_encode_copy_unwrap_count(
+ typeInfo, api, cgen, customUnwrap=custom)
+ emit_parameter_encode_write_packet_info(typeInfo, api, cgen)
+ emit_parameter_encode_do_parameter_write(typeInfo, api, cgen)
+ emit_parameter_encode_read(typeInfo, api, cgen)
+ emit_return_unmarshal(typeInfo, api, cgen)
+ emit_pool_free(cgen)
+ emit_unlock(cgen)
+ emit_return(typeInfo, api, cgen)
+ return call
+
+def encode_vkFlushMappedMemoryRanges(typeInfo, api, cgen):
+ emit_lock(cgen)
+ emit_parameter_encode_preamble_write(typeInfo, api, cgen)
+ emit_parameter_encode_copy_unwrap_count(typeInfo, api, cgen)
+
+ def emit_flush_ranges(streamVar):
+ cgen.beginIf("!sResourceTracker->usingDirectMapping()")
+ cgen.beginFor("uint32_t i = 0", "i < memoryRangeCount", "++i")
+ cgen.stmt("auto range = pMemoryRanges[i]")
+ cgen.stmt("auto memory = pMemoryRanges[i].memory")
+ cgen.stmt("auto size = pMemoryRanges[i].size")
+ cgen.stmt("auto offset = pMemoryRanges[i].offset")
+ cgen.stmt("uint64_t streamSize = 0")
+ cgen.stmt("if (!memory) { %s->write(&streamSize, sizeof(uint64_t)); continue; }" % streamVar)
+ cgen.stmt("auto hostPtr = sResourceTracker->getMappedPointer(memory)")
+ cgen.stmt("auto actualSize = size == VK_WHOLE_SIZE ? sResourceTracker->getMappedSize(memory) : size")
+ cgen.stmt("if (!hostPtr) { %s->write(&streamSize, sizeof(uint64_t)); continue; }" % streamVar)
+ cgen.stmt("streamSize = actualSize")
+ cgen.stmt("%s->write(&streamSize, sizeof(uint64_t))" % streamVar)
+ cgen.stmt("uint8_t* targetRange = hostPtr + offset")
+ cgen.stmt("%s->write(targetRange, actualSize)" % streamVar)
+ cgen.endFor()
+ cgen.endIf()
+
+ emit_parameter_encode_write_packet_info(typeInfo, api, cgen)
+ emit_parameter_encode_do_parameter_write(typeInfo, api, cgen)
+
+ emit_flush_ranges(STREAM)
+
+ emit_parameter_encode_read(typeInfo, api, cgen)
+ emit_return_unmarshal(typeInfo, api, cgen)
+ emit_pool_free(cgen)
+ emit_unlock(cgen)
+ emit_return(typeInfo, api, cgen)
+
+def encode_vkInvalidateMappedMemoryRanges(typeInfo, api, cgen):
+ emit_lock(cgen)
+ emit_parameter_encode_preamble_write(typeInfo, api, cgen)
+ emit_parameter_encode_copy_unwrap_count(typeInfo, api, cgen)
+ emit_parameter_encode_write_packet_info(typeInfo, api, cgen)
+ emit_parameter_encode_do_parameter_write(typeInfo, api, cgen)
+ emit_parameter_encode_read(typeInfo, api, cgen)
+ emit_return_unmarshal(typeInfo, api, cgen)
+
+ def emit_invalidate_ranges(streamVar):
+ cgen.beginIf("!sResourceTracker->usingDirectMapping()")
+ cgen.beginFor("uint32_t i = 0", "i < memoryRangeCount", "++i")
+ cgen.stmt("auto range = pMemoryRanges[i]")
+ cgen.stmt("auto memory = pMemoryRanges[i].memory")
+ cgen.stmt("auto size = pMemoryRanges[i].size")
+ cgen.stmt("auto offset = pMemoryRanges[i].offset")
+ cgen.stmt("uint64_t streamSize = 0")
+ cgen.stmt("if (!memory) { %s->read(&streamSize, sizeof(uint64_t)); continue; }" % streamVar)
+ cgen.stmt("auto hostPtr = sResourceTracker->getMappedPointer(memory)")
+ cgen.stmt("auto actualSize = size == VK_WHOLE_SIZE ? sResourceTracker->getMappedSize(memory) : size")
+ cgen.stmt("if (!hostPtr) { %s->read(&streamSize, sizeof(uint64_t)); continue; }" % streamVar)
+ cgen.stmt("streamSize = actualSize")
+ cgen.stmt("%s->read(&streamSize, sizeof(uint64_t))" % streamVar)
+ cgen.stmt("uint8_t* targetRange = hostPtr + offset")
+ cgen.stmt("%s->read(targetRange, actualSize)" % streamVar)
+ cgen.endFor()
+ cgen.endIf()
+
+ emit_invalidate_ranges(STREAM)
+ emit_pool_free(cgen)
+ emit_unlock(cgen)
+ emit_return(typeInfo, api, cgen)
+
+def emit_manual_inline(typeInfo, api, cgen):
+ cgen.line("#include \"%s_encode_impl.cpp.inl\"" % api.name)
+
+def unwrap_vkCreateImage_pCreateInfo():
+ def mapOp(cgen, orig, local):
+ cgen.stmt("sResourceTracker->unwrap_vkCreateImage_pCreateInfo(%s, %s)" %
+ (orig.paramName, local.paramName))
+ return { "pCreateInfo" : { "mapOp" : mapOp } }
+
+def unwrap_vkBindImageMemory2_pBindInfos():
+ def mapOp(cgen, orig, local):
+ cgen.stmt("sResourceTracker->unwrap_VkBindImageMemory2_pBindInfos(bindInfoCount, %s, %s)" %
+ (orig.paramName, local.paramName))
+ return { "pBindInfos" : { "mapOp" : mapOp } }
+
+def unwrap_vkAcquireImageANDROID_nativeFenceFd():
+ def mapOp(cgen, orig, local):
+ cgen.stmt("sResourceTracker->unwrap_vkAcquireImageANDROID_nativeFenceFd(%s, &%s)" %
+ (orig.paramName, local.paramName))
+ return { "nativeFenceFd" : { "mapOp" : mapOp } }
+
+custom_encodes = {
+ "vkMapMemory" : emit_only_resource_event,
+ "vkUnmapMemory" : emit_only_resource_event,
+ "vkFlushMappedMemoryRanges" : encode_vkFlushMappedMemoryRanges,
+ "vkInvalidateMappedMemoryRanges" : encode_vkInvalidateMappedMemoryRanges,
+ "vkCreateImage" : emit_with_custom_unwrap(unwrap_vkCreateImage_pCreateInfo()),
+ "vkCreateImageWithRequirementsGOOGLE" : emit_with_custom_unwrap(unwrap_vkCreateImage_pCreateInfo()),
+ "vkBindImageMemory2": emit_with_custom_unwrap(unwrap_vkBindImageMemory2_pBindInfos()),
+ "vkAcquireImageANDROID" : emit_with_custom_unwrap(unwrap_vkAcquireImageANDROID_nativeFenceFd()),
+ "vkQueueFlushCommandsGOOGLE" : emit_manual_inline,
+}
+
+class VulkanEncoder(VulkanWrapperGenerator):
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.typeInfo = typeInfo
+
+ self.cgenHeader = CodeGen()
+ self.cgenHeader.incrIndent()
+
+ self.cgenImpl = CodeGen()
+
+ def onBegin(self,):
+ self.module.appendHeader(encoder_decl_preamble)
+ self.module.appendImpl(encoder_impl_preamble)
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ api = copy.deepcopy(self.typeInfo.apis[name])
+ api.parameters.append(makeVulkanTypeSimple(False, "uint32_t", 0, "doLock"))
+
+ self.cgenHeader.stmt(self.cgenHeader.makeFuncProto(api))
+ apiImpl = api.withModifiedName("VkEncoder::" + api.name)
+
+ self.module.appendHeader(self.cgenHeader.swapCode())
+
+ def emit_function_impl(cgen):
+ emit_health_watchdog(api, cgen)
+ if api.name in custom_encodes.keys():
+ custom_encodes[api.name](self.typeInfo, api, cgen)
+ else:
+ emit_default_encoding(self.typeInfo, api, cgen)
+
+ self.module.appendImpl(self.cgenImpl.makeFuncImpl(apiImpl, emit_function_impl))
+
+ def onEnd(self,):
+ self.module.appendHeader(encoder_decl_postamble)
+ self.cgenHeader.decrIndent()
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/extensionstructs.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/extensionstructs.py
new file mode 100644
index 00000000000..f6e30a962b3
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/extensionstructs.py
@@ -0,0 +1,137 @@
+# 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.
+
+from .common.codegen import CodeGen
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType
+
+from .wrapperdefs import VulkanWrapperGenerator
+from .wrapperdefs import STRUCT_EXTENSION_PARAM
+from .wrapperdefs import STRUCT_EXTENSION_PARAM_FOR_WRITE
+from .wrapperdefs import EXTENSION_SIZE_API_NAME
+from .wrapperdefs import EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME
+from .wrapperdefs import STRUCT_TYPE_API_NAME
+
+class VulkanExtensionStructs(VulkanWrapperGenerator):
+
+ def __init__(self, module, typeInfo, variant="host"):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.codegen = CodeGen()
+
+ self.variant = variant
+
+ self.structTypeRetType = \
+ makeVulkanTypeSimple(False, "uint32_t", 0)
+
+ self.rootTypeVarName = "rootType"
+ self.rootTypeParam = \
+ makeVulkanTypeSimple(False, "VkStructureType",
+ 0, self.rootTypeVarName)
+ self.structTypePrototype = \
+ VulkanAPI(STRUCT_TYPE_API_NAME,
+ self.structTypeRetType,
+ [STRUCT_EXTENSION_PARAM])
+
+ self.extensionStructSizeRetType = \
+ makeVulkanTypeSimple(False, "size_t", 0)
+ self.extensionStructSizePrototype = \
+ VulkanAPI(EXTENSION_SIZE_API_NAME,
+ self.extensionStructSizeRetType,
+ [self.rootTypeParam, STRUCT_EXTENSION_PARAM])
+
+ self.streamFeaturesType = makeVulkanTypeSimple(False, "uint32_t", 0, "streamFeatures")
+
+ self.extensionStructSizeWithStreamFeaturesPrototype = \
+ VulkanAPI(EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME,
+ self.extensionStructSizeRetType,
+ [self.streamFeaturesType, self.rootTypeParam, STRUCT_EXTENSION_PARAM])
+ def onBegin(self,):
+ VulkanWrapperGenerator.onBegin(self)
+ self.module.appendHeader(self.codegen.makeFuncDecl(
+ self.structTypePrototype))
+ self.module.appendHeader(self.codegen.makeFuncDecl(
+ self.extensionStructSizePrototype))
+ self.module.appendHeader(self.codegen.makeFuncDecl(
+ self.extensionStructSizeWithStreamFeaturesPrototype))
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ def onEnd(self,):
+ VulkanWrapperGenerator.onEnd(self)
+
+ def castAsStruct(varName, typeName, const=True):
+ return "reinterpret_cast<%s%s*>(%s)" % \
+ ("const " if const else "", typeName, varName)
+
+ def structTypeImpl(cgen):
+ cgen.stmt(
+ "const uint32_t asStructType = *(%s)" %
+ (castAsStruct(STRUCT_EXTENSION_PARAM.paramName, "uint32_t")))
+ cgen.stmt("return asStructType")
+
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(
+ self.structTypePrototype, structTypeImpl))
+
+ def forEachExtensionReturnSize(ext, _, cgen):
+ cgen.stmt("return sizeof(%s)" % ext.name)
+
+ def forEachExtensionReturnSizeProtectedByFeature(ext, _, cgen):
+ streamFeature = ext.getProtectStreamFeature()
+ if streamFeature is None:
+ cgen.stmt("return sizeof(%s)" % ext.name)
+ return
+ cgen.beginIf("%s & %s" % ("streamFeatures", streamFeature))
+ cgen.stmt("return sizeof(%s)" % ext.name)
+ cgen.endIf()
+ cgen.beginElse()
+ cgen.stmt("return 0")
+ cgen.endIf()
+
+ def defaultAbortEmit(cgen):
+ # The 'structType' name and return behavior are defined in
+ # emitForEachStructExtension and not accessible here. Consequently,
+ # this is a copy-paste from there and must be updated accordingly.
+ # NOTE: No need for %% if no substitution is made.
+ cgen.stmt("fprintf(stderr, \"Unhandled Vulkan structure type %d, aborting.\\n\", structType)")
+ cgen.stmt("GFXSTREAM_ABORT(::emugl::FatalError(::emugl::ABORT_REASON_OTHER))")
+ cgen.stmt("return (%s)0" % self.extensionStructSizeRetType.typeName)
+
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(
+ self.extensionStructSizePrototype,
+ lambda cgen: self.emitForEachStructExtension(
+ cgen,
+ self.extensionStructSizeRetType,
+ STRUCT_EXTENSION_PARAM,
+ forEachExtensionReturnSize, autoBreak=False,
+ defaultEmit=(defaultAbortEmit if self.variant == "host" else None),
+ rootTypeVar=self.rootTypeParam)))
+
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(
+ self.extensionStructSizeWithStreamFeaturesPrototype,
+ lambda cgen: self.emitForEachStructExtension(
+ cgen,
+ self.extensionStructSizeRetType,
+ STRUCT_EXTENSION_PARAM,
+ forEachExtensionReturnSizeProtectedByFeature, autoBreak=False,
+ defaultEmit=(defaultAbortEmit if self.variant == "host" else None),
+ rootTypeVar=self.rootTypeParam)))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/frontend.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/frontend.py
new file mode 100644
index 00000000000..b182c0e7852
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/frontend.py
@@ -0,0 +1,102 @@
+# 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.
+
+from .common.codegen import CodeGen, VulkanAPIWrapper
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType
+
+from .wrapperdefs import VulkanWrapperGenerator
+
+from .wrapperdefs import API_PREFIX_VALIDATE
+from .wrapperdefs import PARAMETERS_VALIDATE
+from .wrapperdefs import VOID_TYPE
+from .wrapperdefs import VALIDATE_RESULT_TYPE
+from .wrapperdefs import VALIDATE_VAR_NAME
+from .wrapperdefs import VALIDATE_GOOD_RESULT
+
+from .wrapperdefs import VULKAN_STREAM_TYPE
+from .wrapperdefs import VULKAN_STREAM_VAR_NAME
+
+from .wrapperdefs import API_PREFIX_MARSHAL
+from .wrapperdefs import API_PREFIX_FRONTEND
+
+# Frontend
+class VulkanFrontend(VulkanWrapperGenerator):
+
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ def validateDefFunc(_codegen, _api):
+ # TODO
+ pass
+
+ self.validateWrapper = \
+ VulkanAPIWrapper(
+ API_PREFIX_VALIDATE,
+ PARAMETERS_VALIDATE,
+ VOID_TYPE,
+ validateDefFunc)
+
+ def frontendDefFunc(codegen, api):
+ retTypeName = api.retType.typeName
+
+ codegen.stmt(
+ "%s %s = %s" % (VALIDATE_RESULT_TYPE, VALIDATE_VAR_NAME,
+ VALIDATE_GOOD_RESULT))
+ codegen.funcCall(None, API_PREFIX_VALIDATE + api.origName,
+ ["&%s" % VALIDATE_VAR_NAME] + list(
+ map(lambda p: p.paramName, api.parameters)))
+
+ codegen.beginIf(
+ "%s != %s" % (VALIDATE_VAR_NAME, VALIDATE_GOOD_RESULT))
+ if retTypeName == VALIDATE_RESULT_TYPE:
+ codegen.stmt("return %s" % VALIDATE_VAR_NAME)
+ elif retTypeName != "void":
+ codegen.stmt("return (%s)0" % retTypeName)
+ else:
+ codegen.stmt("return")
+ codegen.endIf()
+
+ codegen.stmt("// VULKAN_STREAM_GET()")
+ codegen.stmt("%s* %s = nullptr" % (VULKAN_STREAM_TYPE,
+ VULKAN_STREAM_VAR_NAME))
+
+ retLhs = None
+ if retTypeName != "void":
+ retLhs = retTypeName + " res"
+
+ codegen.funcCall(retLhs, API_PREFIX_MARSHAL + api.origName,
+ [VULKAN_STREAM_VAR_NAME] + list(
+ map(lambda p: p.paramName, api.parameters)))
+
+ if retTypeName != "void":
+ codegen.stmt("return res")
+
+ self.frontendWrapper = \
+ VulkanAPIWrapper(
+ API_PREFIX_FRONTEND,
+ [],
+ None,
+ frontendDefFunc)
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+ self.module.appendHeader(
+ self.frontendWrapper.makeDecl(self.typeInfo, name))
+ self.module.appendImpl(
+ self.validateWrapper.makeDefinition(
+ self.typeInfo, name, isStatic=True))
+ self.module.appendImpl(
+ self.frontendWrapper.makeDefinition(self.typeInfo, name))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/functable.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/functable.py
new file mode 100644
index 00000000000..5e055307471
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/functable.py
@@ -0,0 +1,628 @@
+from .common.codegen import CodeGen, VulkanWrapperGenerator
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType
+from .common.vulkantypes import EXCLUDED_APIS
+from .common.vulkantypes import HANDLE_TYPES
+
+import copy
+import re
+
+RESOURCE_TRACKER_ENTRIES = [
+ "vkEnumerateInstanceExtensionProperties",
+ "vkEnumerateDeviceExtensionProperties",
+ "vkEnumeratePhysicalDevices",
+ "vkAllocateMemory",
+ "vkFreeMemory",
+ "vkCreateImage",
+ "vkDestroyImage",
+ "vkGetImageMemoryRequirements",
+ "vkGetImageMemoryRequirements2",
+ "vkGetImageMemoryRequirements2KHR",
+ "vkBindImageMemory",
+ "vkBindImageMemory2",
+ "vkBindImageMemory2KHR",
+ "vkCreateBuffer",
+ "vkDestroyBuffer",
+ "vkGetBufferMemoryRequirements",
+ "vkGetBufferMemoryRequirements2",
+ "vkGetBufferMemoryRequirements2KHR",
+ "vkBindBufferMemory",
+ "vkBindBufferMemory2",
+ "vkBindBufferMemory2KHR",
+ "vkCreateSemaphore",
+ "vkDestroySemaphore",
+ "vkQueueSubmit",
+ "vkQueueSubmit2",
+ "vkQueueWaitIdle",
+ "vkImportSemaphoreFdKHR",
+ "vkGetSemaphoreFdKHR",
+ # Warning: These need to be defined in vk.xml (currently no-op) {
+ "vkGetMemoryFuchsiaHandleKHR",
+ "vkGetMemoryFuchsiaHandlePropertiesKHR",
+ "vkGetSemaphoreFuchsiaHandleKHR",
+ "vkImportSemaphoreFuchsiaHandleKHR",
+ # } end Warning: These need to be defined in vk.xml (currently no-op)
+ "vkGetAndroidHardwareBufferPropertiesANDROID",
+ "vkGetMemoryAndroidHardwareBufferANDROID",
+ "vkCreateSamplerYcbcrConversion",
+ "vkDestroySamplerYcbcrConversion",
+ "vkCreateSamplerYcbcrConversionKHR",
+ "vkDestroySamplerYcbcrConversionKHR",
+ "vkUpdateDescriptorSetWithTemplate",
+ "vkGetPhysicalDeviceImageFormatProperties2",
+ "vkGetPhysicalDeviceImageFormatProperties2KHR",
+ "vkBeginCommandBuffer",
+ "vkEndCommandBuffer",
+ "vkResetCommandBuffer",
+ "vkCreateImageView",
+ "vkCreateSampler",
+ "vkGetPhysicalDeviceExternalFenceProperties",
+ "vkGetPhysicalDeviceExternalFencePropertiesKHR",
+ "vkGetPhysicalDeviceExternalBufferProperties",
+ "vkGetPhysicalDeviceExternalBufferPropertiesKHR",
+ "vkCreateFence",
+ "vkResetFences",
+ "vkImportFenceFdKHR",
+ "vkGetFenceFdKHR",
+ "vkWaitForFences",
+ "vkCreateDescriptorPool",
+ "vkDestroyDescriptorPool",
+ "vkResetDescriptorPool",
+ "vkAllocateDescriptorSets",
+ "vkFreeDescriptorSets",
+ "vkCreateDescriptorSetLayout",
+ "vkCmdExecuteCommands",
+ "vkCmdBindDescriptorSets",
+ "vkDestroyDescriptorSetLayout",
+ "vkAllocateCommandBuffers",
+ "vkQueueSignalReleaseImageANDROID",
+ "vkCmdPipelineBarrier",
+ "vkCreateGraphicsPipelines",
+ # Fuchsia
+ "vkGetMemoryZirconHandleFUCHSIA",
+ "vkGetMemoryZirconHandlePropertiesFUCHSIA",
+ "vkGetSemaphoreZirconHandleFUCHSIA",
+ "vkImportSemaphoreZirconHandleFUCHSIA",
+ "vkCreateBufferCollectionFUCHSIA",
+ "vkDestroyBufferCollectionFUCHSIA",
+ "vkSetBufferCollectionImageConstraintsFUCHSIA",
+ "vkSetBufferCollectionBufferConstraintsFUCHSIA",
+ "vkGetBufferCollectionPropertiesFUCHSIA",
+]
+
+SUCCESS_VAL = {
+ "VkResult" : ["VK_SUCCESS"],
+}
+
+HANDWRITTEN_ENTRY_POINTS = [
+ # Instance/device/physical-device special-handling, dispatch tables, etc..
+ "vkCreateInstance",
+ "vkDestroyInstance",
+ "vkGetInstanceProcAddr",
+ "vkEnumerateInstanceVersion",
+ "vkEnumerateInstanceLayerProperties",
+ "vkEnumerateInstanceExtensionProperties",
+ "vkEnumerateDeviceExtensionProperties",
+ "vkGetDeviceProcAddr",
+ "vkEnumeratePhysicalDevices",
+ "vkEnumeratePhysicalDeviceGroups",
+ "vkCreateDevice",
+ "vkDestroyDevice",
+ "vkCreateComputePipelines",
+ # Manual alloc/free + vk_*_init/free() call w/ special params
+ "vkGetDeviceQueue",
+ "vkGetDeviceQueue2",
+ # Command pool/buffer handling
+ "vkCreateCommandPool",
+ "vkDestroyCommandPool",
+ "vkAllocateCommandBuffers",
+ "vkResetCommandPool",
+ "vkFreeCommandBuffers",
+ "vkResetCommandPool",
+ # Special cases to handle struct translations in the pNext chain
+ # TODO: Make a codegen module (use deepcopy as reference) to make this more robust
+ "vkCmdBeginRenderPass2KHR",
+ "vkCmdBeginRenderPass",
+ "vkAllocateMemory",
+ "vkUpdateDescriptorSets",
+ "vkQueueCommitDescriptorSetUpdatesGOOGLE",
+]
+
+# TODO: handles with no equivalent gfxstream objects (yet).
+# Might need some special handling.
+HANDLES_DONT_TRANSLATE = {
+ "VkSurfaceKHR",
+ ## The following objects have no need for mesa counterparts
+ # Allows removal of handwritten create/destroy (for array).
+ "VkDescriptorSet",
+ # Bug in translation
+ "VkSampler",
+ "VkSamplerYcbcrConversion",
+}
+
+# Handles whose gfxstream object have non-base-object vk_ structs
+# Optionally includes array of pairs of extraParams: {index, extraParam}
+# -1 means drop parameter of paramName specified by extraParam
+HANDLES_MESA_VK = {
+ # Handwritten handlers (added here for completeness)
+ "VkInstance" : None,
+ "VkPhysicalDevice" : None,
+ "VkDevice" : None,
+ "VkQueue" : None,
+ "VkCommandPool" : None,
+ "VkCommandBuffer" : None,
+ # Auto-generated creation/destroy
+ "VkDeviceMemory" : None,
+ "VkQueryPool" : None,
+ "VkBuffer" : [[-1, "pMemoryRequirements"]],
+ "VkBufferView" : None,
+ "VkImage" : [[-1, "pMemoryRequirements"]],
+ "VkImageView": [[1, "false /* driver_internal */"]],
+ "VkSampler" : None,
+}
+
+# Types that have a corresponding method for transforming
+# an input list to its internal counterpart
+TYPES_TRANSFORM_LIST_METHOD = {
+ "VkSemaphore",
+ "VkSemaphoreSubmitInfo",
+}
+
+def is_cmdbuf_dispatch(api):
+ return "VkCommandBuffer" == api.parameters[0].typeName
+
+def is_queue_dispatch(api):
+ return "VkQueue" == api.parameters[0].typeName
+
+def getCreateParam(api):
+ for param in api.parameters:
+ if param.isCreatedBy(api):
+ return param
+ return None
+
+def getDestroyParam(api):
+ for param in api.parameters:
+ if param.isDestroyedBy(api):
+ return param
+ return None
+
+# i.e. VkQueryPool --> vk_query_pool
+def typeNameToMesaType(typeName):
+ vkTypeNameRegex = "(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])"
+ words = re.split(vkTypeNameRegex, typeName)
+ outputType = "vk"
+ for word in words[1:]:
+ outputType += "_"
+ outputType += word.lower()
+ return outputType
+
+def typeNameToBaseName(typeName):
+ return typeNameToMesaType(typeName)[len("vk_"):]
+
+def paramNameToObjectName(paramName):
+ return "gfxstream_%s" % paramName
+
+def typeNameToVkObjectType(typeName):
+ return "VK_OBJECT_TYPE_%s" % typeNameToBaseName(typeName).upper()
+
+def typeNameToObjectType(typeName):
+ return "gfxstream_vk_%s" % typeNameToBaseName(typeName)
+
+def transformListFuncName(typeName):
+ return "transform%sList" % (typeName)
+
+def hasMesaVkObject(typeName):
+ return typeName in HANDLES_MESA_VK
+
+def isAllocatorParam(param):
+ ALLOCATOR_TYPE_NAME = "VkAllocationCallbacks"
+ return (param.pointerIndirectionLevels == 1
+ and param.isConst
+ and param.typeName == ALLOCATOR_TYPE_NAME)
+
+def isArrayParam(param):
+ return (1 == param.pointerIndirectionLevels
+ and param.isConst
+ and "len" in param.attribs)
+
+INTERNAL_OBJECT_NAME = "internal_object"
+
+class VulkanFuncTable(VulkanWrapperGenerator):
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+ self.typeInfo = typeInfo
+ self.cgen = CodeGen()
+ self.entries = []
+ self.entryFeatures = []
+ self.cmdToFeatureType = {}
+ self.feature = None
+ self.featureType = None
+
+ def onBegin(self,):
+ cgen = self.cgen
+ self.module.appendImpl(cgen.swapCode())
+ pass
+
+ def onBeginFeature(self, featureName, featureType):
+ self.feature = featureName
+ self.featureType = featureType
+
+ def onEndFeature(self):
+ self.feature = None
+ self.featureType = None
+
+ def onFeatureNewCmd(self, name):
+ self.cmdToFeatureType[name] = self.featureType
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ typeInfo = self.typeInfo
+ cgen = self.cgen
+ api = typeInfo.apis[name]
+ self.entries.append(api)
+ self.entryFeatures.append(self.feature)
+ self.loopVars = ["i", "j", "k", "l", "m", "n"]
+ self.loopVarIndex = 0
+
+ def getNextLoopVar():
+ if self.loopVarIndex >= len(self.loopVars):
+ raise
+ loopVar = self.loopVars[self.loopVarIndex]
+ self.loopVarIndex += 1
+ return loopVar
+
+ def isCompoundType(typeName):
+ return typeInfo.isCompoundType(typeName)
+
+ def handleTranslationRequired(typeName):
+ return typeName in HANDLE_TYPES and typeName not in HANDLES_DONT_TRANSLATE
+
+ def translationRequired(typeName):
+ if isCompoundType(typeName):
+ struct = typeInfo.structs[typeName]
+ for member in struct.members:
+ if translationRequired(member.typeName):
+ return True
+ return False
+ else:
+ return handleTranslationRequired(typeName)
+
+ def genDestroyGfxstreamObjects():
+ destroyParam = getDestroyParam(api)
+ if not destroyParam:
+ return
+ if not translationRequired(destroyParam.typeName):
+ return
+ objectName = paramNameToObjectName(destroyParam.paramName)
+ allocatorParam = "NULL"
+ for p in api.parameters:
+ if isAllocatorParam(p):
+ allocatorParam = p.paramName
+ if not hasMesaVkObject(destroyParam.typeName):
+ deviceParam = api.parameters[0]
+ if "VkDevice" != deviceParam.typeName:
+ print("ERROR: Unhandled non-VkDevice parameters[0]: %s (for API: %s)" %(deviceParam.typeName, api.name))
+ raise
+ # call vk_object_free() directly
+ mesaObjectDestroy = "(void *)%s" % objectName
+ cgen.funcCall(
+ None,
+ "vk_object_free",
+ ["&%s->vk" % paramNameToObjectName(deviceParam.paramName), allocatorParam, mesaObjectDestroy]
+ )
+ else:
+ baseName = typeNameToBaseName(destroyParam.typeName)
+ # objectName for destroy always at the back
+ mesaObjectPrimary = "&%s->vk" % paramNameToObjectName(api.parameters[0].paramName)
+ mesaObjectDestroy = "&%s->vk" % objectName
+ cgen.funcCall(
+ None,
+ "vk_%s_destroy" % (baseName),
+ [mesaObjectPrimary, allocatorParam, mesaObjectDestroy]
+ )
+
+ def genMesaObjectAlloc(allocCallLhs):
+ deviceParam = api.parameters[0]
+ if "VkDevice" != deviceParam.typeName:
+ print("ERROR: Unhandled non-VkDevice parameters[0]: %s (for API: %s)" %(deviceParam.typeName, api.name))
+ raise
+ allocatorParam = "NULL"
+ for p in api.parameters:
+ if isAllocatorParam(p):
+ allocatorParam = p.paramName
+ createParam = getCreateParam(api)
+ objectType = typeNameToObjectType(createParam.typeName)
+ # Call vk_object_zalloc directly
+ cgen.funcCall(
+ allocCallLhs,
+ "(%s *)vk_object_zalloc" % objectType,
+ ["&%s->vk" % paramNameToObjectName(deviceParam.paramName), allocatorParam, ("sizeof(%s)" % objectType), typeNameToVkObjectType(createParam.typeName)]
+ )
+
+ def genMesaObjectCreate(createCallLhs):
+ def dropParam(params, drop):
+ for p in params:
+ if p == drop:
+ params.remove(p)
+ return params
+ createParam = getCreateParam(api)
+ objectType = "struct %s" % typeNameToObjectType(createParam.typeName)
+ modParams = copy.deepcopy(api.parameters)
+ # Mod params for the vk_%s_create() call i.e. vk_buffer_create()
+ for p in modParams:
+ if p.paramName == createParam.paramName:
+ modParams.remove(p)
+ elif handleTranslationRequired(p.typeName):
+ # Cast handle to the mesa type
+ p.paramName = ("(%s*)%s" % (typeNameToMesaType(p.typeName), paramNameToObjectName(p.paramName)))
+ mesaCreateParams = [p.paramName for p in modParams] + ["sizeof(%s)" % objectType]
+ # Some special handling
+ extraParams = HANDLES_MESA_VK[createParam.typeName]
+ if extraParams:
+ for pair in extraParams:
+ if -1 == pair[0]:
+ mesaCreateParams = dropParam(mesaCreateParams, pair[1])
+ else:
+ mesaCreateParams.insert(pair[0], pair[1])
+ cgen.funcCall(
+ createCallLhs,
+ "(%s *)vk_%s_create" % (objectType, typeNameToBaseName(createParam.typeName)),
+ mesaCreateParams
+ )
+
+ # Alloc/create gfxstream_vk_* object
+ def genCreateGfxstreamObjects():
+ createParam = getCreateParam(api)
+ if not createParam:
+ return False
+ if not handleTranslationRequired(createParam.typeName):
+ return False
+ objectType = "struct %s" % typeNameToObjectType(createParam.typeName)
+ callLhs = "%s *%s" % (objectType, paramNameToObjectName(createParam.paramName))
+ if hasMesaVkObject(createParam.typeName):
+ genMesaObjectCreate(callLhs)
+ else:
+ genMesaObjectAlloc(callLhs)
+
+ retVar = api.getRetVarExpr()
+ if retVar:
+ retTypeName = api.getRetTypeExpr()
+ # ex: vkCreateBuffer_VkResult_return = gfxstream_buffer ? VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY;
+ cgen.stmt("%s = %s ? %s : %s" %
+ (retVar, paramNameToObjectName(createParam.paramName), SUCCESS_VAL[retTypeName][0], "VK_ERROR_OUT_OF_HOST_MEMORY"))
+ return True
+
+ def genVkFromHandle(param, fromName):
+ objectName = paramNameToObjectName(param.paramName)
+ cgen.stmt("VK_FROM_HANDLE(%s, %s, %s)" %
+ (typeNameToObjectType(param.typeName), objectName, fromName))
+ return objectName
+
+ def genGetGfxstreamHandles():
+ createParam = getCreateParam(api)
+ for param in api.parameters:
+ if not handleTranslationRequired(param.typeName):
+ continue
+ elif isArrayParam(param):
+ continue
+ elif param != createParam:
+ if param.pointerIndirectionLevels > 0:
+ print("ERROR: Unhandled pointerIndirectionLevels > 1 for API %s (param %s)" % (api.name, param.paramName))
+ raise
+ genVkFromHandle(param, param.paramName)
+
+ def internalNestedParamName(param):
+ parentName = ""
+ if param.parent:
+ parentName = "_%s" % param.parent.typeName
+ return "internal%s_%s" % (parentName, param.paramName)
+
+ def genInternalArrayDeclarations(param, countParamName, nestLevel=0):
+ internalArray = None
+ if 0 == nestLevel:
+ internalArray = "internal_%s" % param.paramName
+ cgen.stmt("std::vector<%s> %s(%s)" % (param.typeName, internalArray, countParamName))
+ elif 1 == nestLevel or 2 == nestLevel:
+ internalArray = internalNestedParamName(param)
+ if isArrayParam(param):
+ cgen.stmt("std::vector<std::vector<%s>> %s" % (param.typeName, internalArray))
+ else:
+ cgen.stmt("std::vector<%s> %s" % (param.typeName, internalArray))
+ else:
+ print("ERROR: nestLevel > 2 not verified.")
+ raise
+ if isCompoundType(param.typeName):
+ for member in typeInfo.structs[param.typeName].members:
+ if translationRequired(member.typeName):
+ if handleTranslationRequired(member.typeName) and not isArrayParam(member):
+ # No declarations for non-array handleType
+ continue
+ genInternalArrayDeclarations(member, countParamName, nestLevel + 1)
+ return internalArray
+
+ def genInternalCompoundType(param, outName, inName, currLoopVar):
+ nextLoopVar = None
+ cgen.stmt("%s = %s" % (outName, inName))
+ for member in typeInfo.structs[param.typeName].members:
+ if not translationRequired(member.typeName):
+ continue
+ cgen.line("/* %s::%s */" % (param.typeName, member.paramName))
+ nestedOutName = ("%s[%s]" % (internalNestedParamName(member), currLoopVar))
+ if isArrayParam(member):
+ countParamName = "%s.%s" % (outName, member.attribs["len"])
+ inArrayName = "%s.%s" % (outName, member.paramName)
+ cgen.stmt("%s.push_back(std::vector<%s>())" % (internalNestedParamName(member), member.typeName))
+ if member.typeName in TYPES_TRANSFORM_LIST_METHOD:
+ # Use the corresponding transformList call
+ cgen.funcCall(nestedOutName, transformListFuncName(member.typeName), [inArrayName, countParamName])
+ cgen.stmt("%s = %s.data()" % (inArrayName, nestedOutName))
+ cgen.stmt("%s = %s.size()" % (countParamName, nestedOutName))
+ else:
+ # Standard translation
+ cgen.stmt("%s.reserve(%s)" % (nestedOutName, countParamName))
+ cgen.stmt("memset(&%s[0], 0, sizeof(%s) * %s)" % (nestedOutName, member.typeName, countParamName))
+ if not nextLoopVar:
+ nextLoopVar = getNextLoopVar()
+ internalArray = genInternalArray(member, countParamName, nestedOutName, inArrayName, nextLoopVar)
+ cgen.stmt("%s = %s" %(inArrayName, internalArray))
+ elif isCompoundType(member.typeName):
+ memberFullName = "%s.%s" % (outName, member.paramName)
+ if 1 == member.pointerIndirectionLevels:
+ cgen.beginIf(memberFullName)
+ inParamName = "%s[0]" % memberFullName
+ genInternalCompoundType(member, nestedOutName, inParamName, currLoopVar)
+ cgen.stmt("%s.%s = &%s" % (outName, member.paramName, nestedOutName))
+ else:
+ cgen.beginBlock()
+ genInternalCompoundType(member, nestedOutName, memberFullName, currLoopVar)
+ cgen.stmt("%s.%s = %s" % (outName, member.paramName, nestedOutName))
+ cgen.endBlock()
+ else:
+ # Replace member with internal object
+ replaceName = "%s.%s" % (outName, member.paramName)
+ if member.isOptional:
+ cgen.beginIf(replaceName)
+ gfxstreamObject = genVkFromHandle(member, replaceName)
+ cgen.stmt("%s = %s->%s" % (replaceName, gfxstreamObject, INTERNAL_OBJECT_NAME))
+ if member.isOptional:
+ cgen.endIf()
+
+ def genInternalArray(param, countParamName, outArrayName, inArrayName, loopVar):
+ cgen.beginFor("uint32_t %s = 0" % loopVar, "%s < %s" % (loopVar, countParamName), "++%s" % loopVar)
+ if param.isOptional:
+ cgen.beginIf(inArrayName)
+ if isCompoundType(param.typeName):
+ genInternalCompoundType(param, ("%s[%s]" % (outArrayName, loopVar)), "%s[%s]" % (inArrayName, loopVar), loopVar)
+ else:
+ gfxstreamObject = genVkFromHandle(param, "%s[%s]" % (inArrayName, loopVar))
+ cgen.stmt("%s[%s] = %s->%s" % (outArrayName, loopVar, gfxstreamObject, INTERNAL_OBJECT_NAME))
+ if param.isOptional:
+ cgen.endIf()
+ cgen.endFor()
+ return "%s.data()" % outArrayName
+
+ # Translate params into params needed for gfxstream-internal
+ # encoder/resource-tracker calls
+ def getEncoderOrResourceTrackerParams():
+ createParam = getCreateParam(api)
+ outParams = copy.deepcopy(api.parameters)
+ nextLoopVar = getNextLoopVar()
+ for param in outParams:
+ if not translationRequired(param.typeName):
+ continue
+ elif isArrayParam(param) or isCompoundType(param.typeName):
+ if param.possiblyOutput():
+ print("ERROR: Unhandled CompoundType / Array output for API %s (param %s)" % (api.name, param.paramName))
+ raise
+ if 1 != param.pointerIndirectionLevels or not param.isConst:
+ print("ERROR: Compound type / array input is not 'const <type>*' (API: %s, paramName: %s)" % (api.name, param.paramName))
+ raise
+ countParamName = "1"
+ if "len" in param.attribs:
+ countParamName = param.attribs["len"]
+ internalArrayName = genInternalArrayDeclarations(param, countParamName)
+ param.paramName = genInternalArray(param, countParamName, internalArrayName, param.paramName, nextLoopVar)
+ elif 0 == param.pointerIndirectionLevels:
+ if param.isOptional:
+ param.paramName = ("%s ? %s->%s : VK_NULL_HANDLE" % (paramNameToObjectName(param.paramName), paramNameToObjectName(param.paramName), INTERNAL_OBJECT_NAME))
+ else:
+ param.paramName = ("%s->%s" % (paramNameToObjectName(param.paramName), INTERNAL_OBJECT_NAME))
+ elif createParam and param.paramName == createParam.paramName:
+ param.paramName = ("&%s->%s" % (paramNameToObjectName(param.paramName), INTERNAL_OBJECT_NAME))
+ else:
+ print("ERROR: Unknown handling for param: %s (API: %s)" % (param, api.name))
+ raise
+ return outParams
+
+ def genEncoderOrResourceTrackerCall(declareResources=True):
+ if is_cmdbuf_dispatch(api):
+ cgen.stmt("auto vkEnc = gfxstream::vk::ResourceTracker::getCommandBufferEncoder(%s->%s)" % (paramNameToObjectName(api.parameters[0].paramName), INTERNAL_OBJECT_NAME))
+ elif is_queue_dispatch(api):
+ cgen.stmt("auto vkEnc = gfxstream::vk::ResourceTracker::getQueueEncoder(%s->%s)" % (paramNameToObjectName(api.parameters[0].paramName), INTERNAL_OBJECT_NAME))
+ else:
+ cgen.stmt("auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder()")
+ callLhs = None
+ retTypeName = api.getRetTypeExpr()
+ if retTypeName != "void":
+ callLhs = api.getRetVarExpr()
+
+ # Get parameter list modded for gfxstream-internal call
+ parameters = getEncoderOrResourceTrackerParams()
+ if name in RESOURCE_TRACKER_ENTRIES:
+ if declareResources:
+ cgen.stmt("auto resources = gfxstream::vk::ResourceTracker::get()")
+ cgen.funcCall(
+ callLhs, "resources->" + "on_" + api.name,
+ ["vkEnc"] + SUCCESS_VAL.get(retTypeName, []) + \
+ [p.paramName for p in parameters])
+ else:
+ cgen.funcCall(
+ callLhs, "vkEnc->" + api.name, [p.paramName for p in parameters] + ["true /* do lock */"])
+
+ def genReturnExpression():
+ retTypeName = api.getRetTypeExpr()
+ # Set the createParam output, if applicable
+ createParam = getCreateParam(api)
+ if createParam and handleTranslationRequired(createParam.typeName):
+ if 1 != createParam.pointerIndirectionLevels:
+ print("ERROR: Unhandled pointerIndirectionLevels != 1 in return for API %s (createParam %s)" % api.name, createParam.paramName)
+ raise
+ # ex: *pBuffer = gfxstream_vk_buffer_to_handle(gfxstream_buffer)
+ cgen.funcCall(
+ "*%s" % createParam.paramName,
+ "%s_to_handle" % typeNameToObjectType(createParam.typeName),
+ [paramNameToObjectName(createParam.paramName)]
+ )
+
+ if retTypeName != "void":
+ cgen.stmt("return %s" % api.getRetVarExpr())
+
+ def genGfxstreamEntry(declareResources=True):
+ cgen.stmt("AEMU_SCOPED_TRACE(\"%s\")" % api.name)
+ # declare returnVar
+ retTypeName = api.getRetTypeExpr()
+ retVar = api.getRetVarExpr()
+ if retVar:
+ cgen.stmt("%s %s = (%s)0" % (retTypeName, retVar, retTypeName))
+ # Check non-null destroy param for free/destroy calls
+ destroyParam = getDestroyParam(api)
+ if destroyParam:
+ cgen.beginIf("VK_NULL_HANDLE == %s" % destroyParam.paramName)
+ if api.getRetTypeExpr() != "void":
+ cgen.stmt("return %s" % api.getRetVarExpr())
+ else:
+ cgen.stmt("return")
+ cgen.endIf()
+ # Translate handles
+ genGetGfxstreamHandles()
+ # Translation/creation of objects
+ createdObject = genCreateGfxstreamObjects()
+ # Make encoder/resource-tracker call
+ if retVar and createdObject:
+ cgen.beginIf("%s == %s" % (SUCCESS_VAL[retTypeName][0], retVar))
+ else:
+ cgen.beginBlock()
+ genEncoderOrResourceTrackerCall()
+ cgen.endBlock()
+ # Destroy gfxstream objects
+ genDestroyGfxstreamObjects()
+ # Set output / return variables
+ genReturnExpression()
+
+ api_entry = api.withModifiedName("gfxstream_vk_" + api.name[2:])
+ if api.name not in HANDWRITTEN_ENTRY_POINTS:
+ cgen.line(self.cgen.makeFuncProto(api_entry))
+ cgen.beginBlock()
+ genGfxstreamEntry()
+ cgen.endBlock()
+ self.module.appendImpl(cgen.swapCode())
+
+
+ def onEnd(self,):
+ pass
+
+ def isDeviceDispatch(self, api):
+ # TODO(230793667): improve the heuristic and just use "cmdToFeatureType"
+ return (len(api.parameters) > 0 and
+ "VkDevice" == api.parameters[0].typeName) or (
+ "VkCommandBuffer" == api.parameters[0].typeName and
+ self.cmdToFeatureType.get(api.name, "") == "device")
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/handlemap.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/handlemap.py
new file mode 100644
index 00000000000..6360e37e018
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/handlemap.py
@@ -0,0 +1,264 @@
+# 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.
+
+from .common.codegen import CodeGen
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType, VulkanTypeIterator
+
+from .wrapperdefs import VulkanWrapperGenerator
+from .wrapperdefs import STRUCT_EXTENSION_PARAM, STRUCT_EXTENSION_PARAM_FOR_WRITE
+
+class HandleMapCodegen(VulkanTypeIterator):
+ def __init__(self, cgen, inputVar, handlemapVarName, prefix, isHandleFunc):
+ self.cgen = cgen
+ self.inputVar = inputVar
+ self.prefix = prefix
+ self.handlemapVarName = handlemapVarName
+
+ def makeAccess(varName, asPtr = True):
+ return lambda t: self.cgen.generalAccess(t, parentVarName = varName, asPtr = asPtr)
+
+ def makeLengthAccess(varName):
+ return lambda t: self.cgen.generalLengthAccess(t, parentVarName = varName)
+
+ def makeLengthAccessGuard(varName):
+ return lambda t: self.cgen.generalLengthAccessGuard(t, parentVarName=varName)
+
+ self.exprAccessor = makeAccess(self.inputVar)
+ self.exprAccessorValue = makeAccess(self.inputVar, asPtr = False)
+ self.lenAccessor = makeLengthAccess(self.inputVar)
+ self.lenAccessorGuard = makeLengthAccessGuard(self.inputVar)
+
+ self.checked = False
+ self.isHandleFunc = isHandleFunc
+
+ def needSkip(self, vulkanType):
+ return False
+
+ def makeCastExpr(self, vulkanType):
+ return "(%s)" % (
+ self.cgen.makeCTypeDecl(vulkanType, useParamName=False))
+
+ def asNonConstCast(self, access, vulkanType):
+ if vulkanType.staticArrExpr:
+ casted = "%s(%s)" % (self.makeCastExpr(vulkanType.getForAddressAccess().getForNonConstAccess()), access)
+ elif vulkanType.accessibleAsPointer():
+ casted = "%s(%s)" % (self.makeCastExpr(vulkanType.getForNonConstAccess()), access)
+ else:
+ casted = "%s(%s)" % (self.makeCastExpr(vulkanType.getForAddressAccess().getForNonConstAccess()), access)
+ return casted
+
+ def onCheck(self, vulkanType):
+ pass
+
+ def endCheck(self, vulkanType):
+ pass
+
+ def onCompoundType(self, vulkanType):
+
+ if self.needSkip(vulkanType):
+ self.cgen.line("// TODO: Unsupported : %s" %
+ self.cgen.makeCTypeDecl(vulkanType))
+ return
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ isPtr = vulkanType.pointerIndirectionLevels > 0
+
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+
+ if isPtr:
+ self.cgen.beginIf(access)
+
+ if lenAccess is not None:
+
+ loopVar = "i"
+ access = "%s + %s" % (access, loopVar)
+ forInit = "uint32_t %s = 0" % loopVar
+ forCond = "%s < (uint32_t)%s" % (loopVar, lenAccess)
+ forIncr = "++%s" % loopVar
+
+ self.cgen.beginFor(forInit, forCond, forIncr)
+
+ accessCasted = self.asNonConstCast(access, vulkanType)
+ self.cgen.funcCall(None, self.prefix + vulkanType.typeName,
+ [self.handlemapVarName, accessCasted])
+
+ if lenAccess is not None:
+ self.cgen.endFor()
+
+ if isPtr:
+ self.cgen.endIf()
+
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+
+ def onString(self, vulkanType):
+ pass
+
+ def onStringArray(self, vulkanType):
+ pass
+
+ def onStaticArr(self, vulkanType):
+ if not self.isHandleFunc(vulkanType):
+ return
+
+ accessLhs = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+
+ self.cgen.stmt("%s->mapHandles_%s(%s%s, %s)" % \
+ (self.handlemapVarName, vulkanType.typeName,
+ self.makeCastExpr(vulkanType.getForAddressAccess().getForNonConstAccess()),
+ accessLhs, lenAccess))
+
+ def onStructExtension(self, vulkanType):
+ access = self.exprAccessor(vulkanType)
+
+ castedAccessExpr = "(%s)(%s)" % ("void*", access)
+ self.cgen.beginIf(access)
+ self.cgen.funcCall(None, self.prefix + "extension_struct",
+ [self.handlemapVarName, castedAccessExpr])
+ self.cgen.endIf()
+
+ def onPointer(self, vulkanType):
+ if self.needSkip(vulkanType):
+ return
+
+ if not self.isHandleFunc(vulkanType):
+ return
+
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccess = "1" if lenAccess is None else lenAccess
+
+ self.cgen.beginIf(access)
+
+ self.cgen.stmt( \
+ "%s->mapHandles_%s(%s%s, %s)" % \
+ (self.handlemapVarName,
+ vulkanType.typeName,
+ self.makeCastExpr(vulkanType.getForNonConstAccess()),
+ access,
+ lenAccess))
+
+ self.cgen.endIf()
+
+ def onValue(self, vulkanType):
+ if not self.isHandleFunc(vulkanType):
+ return
+ access = self.exprAccessor(vulkanType)
+ self.cgen.stmt(
+ "%s->mapHandles_%s(%s%s)" % \
+ (self.handlemapVarName, vulkanType.typeName,
+ self.makeCastExpr(vulkanType.getForAddressAccess().getForNonConstAccess()),
+ access))
+
+class VulkanHandleMap(VulkanWrapperGenerator):
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.codegen = CodeGen()
+
+ self.handlemapPrefix = "handlemap_"
+ self.toMapVar = "toMap"
+ self.handlemapVarName = "handlemap"
+ self.handlemapParam = \
+ makeVulkanTypeSimple(False, "VulkanHandleMapping", 1,
+ self.handlemapVarName)
+ self.voidType = makeVulkanTypeSimple(False, "void", 0)
+
+ self.handlemapCodegen = \
+ HandleMapCodegen(
+ None,
+ self.toMapVar,
+ self.handlemapVarName,
+ self.handlemapPrefix,
+ lambda vtype : typeInfo.isHandleType(vtype.typeName))
+
+ self.knownDefs = {}
+
+ self.extensionHandlemapPrototype = \
+ VulkanAPI(self.handlemapPrefix + "extension_struct",
+ self.voidType,
+ [self.handlemapParam, STRUCT_EXTENSION_PARAM_FOR_WRITE])
+
+ def onBegin(self,):
+ VulkanWrapperGenerator.onBegin(self)
+ self.module.appendImpl(self.codegen.makeFuncDecl(
+ self.extensionHandlemapPrototype))
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ if name in self.knownDefs:
+ return
+
+ category = self.typeInfo.categoryOf(name)
+
+ if category in ["struct", "union"] and alias:
+ self.module.appendHeader(
+ self.codegen.makeFuncAlias(self.handlemapPrefix + name,
+ self.handlemapPrefix + alias))
+
+ if category in ["struct", "union"] and not alias:
+
+ structInfo = self.typeInfo.structs[name]
+
+ typeFromName = \
+ lambda varname: \
+ makeVulkanTypeSimple(varname == "from", name, 1, varname)
+
+ handlemapParams = \
+ [self.handlemapParam] + \
+ list(map(typeFromName, [self.toMapVar]))
+
+ handlemapPrototype = \
+ VulkanAPI(self.handlemapPrefix + name,
+ self.voidType,
+ handlemapParams)
+
+ def funcDefGenerator(cgen):
+ self.handlemapCodegen.cgen = cgen
+ for p in handlemapParams:
+ cgen.stmt("(void)%s" % p.paramName)
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member,
+ self.handlemapCodegen)
+
+ self.module.appendHeader(
+ self.codegen.makeFuncDecl(handlemapPrototype))
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(handlemapPrototype, funcDefGenerator))
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ def onEnd(self,):
+ VulkanWrapperGenerator.onEnd(self)
+
+ def forEachExtensionHandlemap(ext, castedAccess, cgen):
+ cgen.funcCall(None, self.handlemapPrefix + ext.name,
+ [self.handlemapVarName, castedAccess])
+
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(
+ self.extensionHandlemapPrototype,
+ lambda cgen: self.emitForEachStructExtension(
+ cgen,
+ self.voidType,
+ STRUCT_EXTENSION_PARAM_FOR_WRITE,
+ forEachExtensionHandlemap)))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/marshaling.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/marshaling.py
new file mode 100644
index 00000000000..c5fd350e45a
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/marshaling.py
@@ -0,0 +1,1035 @@
+# 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.
+
+from copy import copy
+import hashlib, sys
+
+from .common.codegen import CodeGen, VulkanAPIWrapper
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType, VulkanTypeIterator, Atom, FuncExpr, FuncExprVal, FuncLambda
+
+from .wrapperdefs import VulkanWrapperGenerator
+from .wrapperdefs import VULKAN_STREAM_VAR_NAME
+from .wrapperdefs import ROOT_TYPE_VAR_NAME, ROOT_TYPE_PARAM
+from .wrapperdefs import STREAM_RET_TYPE
+from .wrapperdefs import MARSHAL_INPUT_VAR_NAME
+from .wrapperdefs import UNMARSHAL_INPUT_VAR_NAME
+from .wrapperdefs import PARAMETERS_MARSHALING
+from .wrapperdefs import PARAMETERS_MARSHALING_GUEST
+from .wrapperdefs import STYPE_OVERRIDE
+from .wrapperdefs import STRUCT_EXTENSION_PARAM, STRUCT_EXTENSION_PARAM_FOR_WRITE, EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME
+from .wrapperdefs import API_PREFIX_MARSHAL
+from .wrapperdefs import API_PREFIX_UNMARSHAL
+
+from .marshalingdefs import KNOWN_FUNCTION_OPCODES, CUSTOM_MARSHAL_TYPES
+
+class VulkanMarshalingCodegen(VulkanTypeIterator):
+
+ def __init__(self,
+ cgen,
+ streamVarName,
+ rootTypeVarName,
+ inputVarName,
+ marshalPrefix,
+ direction = "write",
+ forApiOutput = False,
+ dynAlloc = False,
+ mapHandles = True,
+ handleMapOverwrites = False,
+ doFiltering = True):
+ self.cgen = cgen
+ self.direction = direction
+ self.processSimple = "write" if self.direction == "write" else "read"
+ self.forApiOutput = forApiOutput
+
+ self.checked = False
+
+ self.streamVarName = streamVarName
+ self.rootTypeVarName = rootTypeVarName
+ self.inputVarName = inputVarName
+ self.marshalPrefix = marshalPrefix
+
+ self.exprAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.inputVarName, asPtr = True)
+ self.exprValueAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.inputVarName, asPtr = False)
+ self.exprPrimitiveValueAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.inputVarName, asPtr = False)
+ self.lenAccessor = lambda t: self.cgen.generalLengthAccess(t, parentVarName = self.inputVarName)
+ self.lenAccessorGuard = lambda t: self.cgen.generalLengthAccessGuard(
+ t, parentVarName=self.inputVarName)
+ self.filterVarAccessor = lambda t: self.cgen.filterVarAccess(t, parentVarName = self.inputVarName)
+
+ self.dynAlloc = dynAlloc
+ self.mapHandles = mapHandles
+ self.handleMapOverwrites = handleMapOverwrites
+ self.doFiltering = doFiltering
+
+ def getTypeForStreaming(self, vulkanType):
+ res = copy(vulkanType)
+
+ if not vulkanType.accessibleAsPointer():
+ res = res.getForAddressAccess()
+
+ if vulkanType.staticArrExpr:
+ res = res.getForAddressAccess()
+
+ if self.direction == "write":
+ return res
+ else:
+ return res.getForNonConstAccess()
+
+ def makeCastExpr(self, vulkanType):
+ return "(%s)" % (
+ self.cgen.makeCTypeDecl(vulkanType, useParamName=False))
+
+ def genStreamCall(self, vulkanType, toStreamExpr, sizeExpr):
+ varname = self.streamVarName
+ func = self.processSimple
+ cast = self.makeCastExpr(self.getTypeForStreaming(vulkanType))
+
+ self.cgen.stmt(
+ "%s->%s(%s%s, %s)" % (varname, func, cast, toStreamExpr, sizeExpr))
+
+ def genPrimitiveStreamCall(self, vulkanType, access):
+ varname = self.streamVarName
+
+ self.cgen.streamPrimitive(
+ self.typeInfo,
+ varname,
+ access,
+ vulkanType,
+ direction=self.direction)
+
+ def genHandleMappingCall(self, vulkanType, access, lenAccess):
+
+ if lenAccess is None:
+ lenAccess = "1"
+ handle64Bytes = "8"
+ else:
+ handle64Bytes = "%s * 8" % lenAccess
+
+ handle64Var = self.cgen.var()
+ if lenAccess != "1":
+ self.cgen.beginIf(lenAccess)
+ self.cgen.stmt("uint64_t* %s" % handle64Var)
+ self.cgen.stmt(
+ "%s->alloc((void**)&%s, %s * 8)" % \
+ (self.streamVarName, handle64Var, lenAccess))
+ handle64VarAccess = handle64Var
+ handle64VarType = \
+ makeVulkanTypeSimple(False, "uint64_t", 1, paramName=handle64Var)
+ else:
+ self.cgen.stmt("uint64_t %s" % handle64Var)
+ handle64VarAccess = "&%s" % handle64Var
+ handle64VarType = \
+ makeVulkanTypeSimple(False, "uint64_t", 0, paramName=handle64Var)
+
+ if self.direction == "write":
+ if self.handleMapOverwrites:
+ self.cgen.stmt(
+ "static_assert(8 == sizeof(%s), \"handle map overwrite requires %s to be 8 bytes long\")" % \
+ (vulkanType.typeName, vulkanType.typeName))
+ self.cgen.stmt(
+ "%s->handleMapping()->mapHandles_%s((%s*)%s, %s)" %
+ (self.streamVarName, vulkanType.typeName, vulkanType.typeName,
+ access, lenAccess))
+ self.genStreamCall(vulkanType, access, "8 * %s" % lenAccess)
+ else:
+ self.cgen.stmt(
+ "%s->handleMapping()->mapHandles_%s_u64(%s, %s, %s)" %
+ (self.streamVarName, vulkanType.typeName,
+ access,
+ handle64VarAccess, lenAccess))
+ self.genStreamCall(handle64VarType, handle64VarAccess, handle64Bytes)
+ else:
+ self.genStreamCall(handle64VarType, handle64VarAccess, handle64Bytes)
+ self.cgen.stmt(
+ "%s->handleMapping()->mapHandles_u64_%s(%s, %s%s, %s)" %
+ (self.streamVarName, vulkanType.typeName,
+ handle64VarAccess,
+ self.makeCastExpr(vulkanType.getForNonConstAccess()), access,
+ lenAccess))
+
+ if lenAccess != "1":
+ self.cgen.endIf()
+
+ def doAllocSpace(self, vulkanType):
+ if self.dynAlloc and self.direction == "read":
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ sizeof = self.cgen.sizeofExpr( \
+ vulkanType.getForValueAccess())
+ if lenAccess:
+ bytesExpr = "%s * %s" % (lenAccess, sizeof)
+ else:
+ bytesExpr = sizeof
+
+ self.cgen.stmt( \
+ "%s->alloc((void**)&%s, %s)" %
+ (self.streamVarName,
+ access, bytesExpr))
+
+ def getOptionalStringFeatureExpr(self, vulkanType):
+ streamFeature = vulkanType.getProtectStreamFeature()
+ if streamFeature is None:
+ return None
+ return "%s->getFeatureBits() & %s" % (self.streamVarName, streamFeature)
+
+ def onCheck(self, vulkanType):
+
+ if self.forApiOutput:
+ return
+
+ featureExpr = self.getOptionalStringFeatureExpr(vulkanType);
+
+ self.checked = True
+
+ access = self.exprAccessor(vulkanType)
+
+ needConsistencyCheck = False
+
+ self.cgen.line("// WARNING PTR CHECK")
+ if (self.dynAlloc and self.direction == "read") or self.direction == "write":
+ checkAccess = self.exprAccessor(vulkanType)
+ addrExpr = "&" + checkAccess
+ sizeExpr = self.cgen.sizeofExpr(vulkanType)
+ else:
+ checkName = "check_%s" % vulkanType.paramName
+ self.cgen.stmt("%s %s" % (
+ self.cgen.makeCTypeDecl(vulkanType, useParamName = False), checkName))
+ checkAccess = checkName
+ addrExpr = "&" + checkAccess
+ sizeExpr = self.cgen.sizeofExpr(vulkanType)
+ needConsistencyCheck = True
+
+ if featureExpr is not None:
+ self.cgen.beginIf(featureExpr)
+
+ self.genPrimitiveStreamCall(
+ vulkanType,
+ checkAccess)
+
+ if featureExpr is not None:
+ self.cgen.endIf()
+
+ if featureExpr is not None:
+ self.cgen.beginIf("(!(%s) || %s)" % (featureExpr, access))
+ else:
+ self.cgen.beginIf(access)
+
+ if needConsistencyCheck and featureExpr is None:
+ self.cgen.beginIf("!(%s)" % checkName)
+ self.cgen.stmt(
+ "fprintf(stderr, \"fatal: %s inconsistent between guest and host\\n\")" % (access))
+ self.cgen.endIf()
+
+
+ def onCheckWithNullOptionalStringFeature(self, vulkanType):
+ self.cgen.beginIf("%s->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT" % self.streamVarName)
+ self.onCheck(vulkanType)
+
+ def endCheckWithNullOptionalStringFeature(self, vulkanType):
+ self.endCheck(vulkanType)
+ self.cgen.endIf()
+ self.cgen.beginElse()
+
+ def finalCheckWithNullOptionalStringFeature(self, vulkanType):
+ self.cgen.endElse()
+
+ def endCheck(self, vulkanType):
+
+ if self.checked:
+ self.cgen.endIf()
+ self.checked = False
+
+ def genFilterFunc(self, filterfunc, env):
+
+ def loop(expr, lambdaEnv={}):
+ def do_func(expr):
+ fnamestr = expr.name.name
+ if "not" == fnamestr:
+ return "!(%s)" % (loop(expr.args[0], lambdaEnv))
+ if "eq" == fnamestr:
+ return "(%s == %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "and" == fnamestr:
+ return "(%s && %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "or" == fnamestr:
+ return "(%s || %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "bitwise_and" == fnamestr:
+ return "(%s & %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "getfield" == fnamestr:
+ ptrlevels = get_ptrlevels(expr.args[0].val.name)
+ if ptrlevels == 0:
+ return "%s.%s" % (loop(expr.args[0], lambdaEnv), expr.args[1].val)
+ else:
+ return "(%s(%s)).%s" % ("*" * ptrlevels, loop(expr.args[0], lambdaEnv), expr.args[1].val)
+
+ if "if" == fnamestr:
+ return "((%s) ? (%s) : (%s))" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv), loop(expr.args[2], lambdaEnv))
+
+ return "%s(%s)" % (fnamestr, ", ".join(map(lambda e: loop(e, lambdaEnv), expr.args)))
+
+ def do_expratom(atomname, lambdaEnv= {}):
+ if lambdaEnv.get(atomname, None) is not None:
+ return atomname
+
+ enventry = env.get(atomname, None)
+ if None != enventry:
+ return self.getEnvAccessExpr(atomname)
+ return atomname
+
+ def get_ptrlevels(atomname, lambdaEnv= {}):
+ if lambdaEnv.get(atomname, None) is not None:
+ return 0
+
+ enventry = env.get(atomname, None)
+ if None != enventry:
+ return self.getPointerIndirectionLevels(atomname)
+
+ return 0
+
+ def do_exprval(expr, lambdaEnv= {}):
+ expratom = expr.val
+
+ if Atom == type(expratom):
+ return do_expratom(expratom.name, lambdaEnv)
+
+ return "%s" % expratom
+
+ def do_lambda(expr, lambdaEnv= {}):
+ params = expr.vs
+ body = expr.body
+ newEnv = {}
+
+ for (k, v) in lambdaEnv.items():
+ newEnv[k] = v
+
+ for p in params:
+ newEnv[p.name] = p.typ
+
+ return "[](%s) { return %s; }" % (", ".join(list(map(lambda p: "%s %s" % (p.typ, p.name), params))), loop(body, lambdaEnv=newEnv))
+
+ if FuncExpr == type(expr):
+ return do_func(expr)
+ if FuncLambda == type(expr):
+ return do_lambda(expr)
+ elif FuncExprVal == type(expr):
+ return do_exprval(expr)
+
+ return loop(filterfunc)
+
+ def beginFilterGuard(self, vulkanType):
+ if vulkanType.filterVar == None:
+ return
+
+ if self.doFiltering == False:
+ return
+
+ filterVarAccess = self.getEnvAccessExpr(vulkanType.filterVar)
+
+ filterValsExpr = None
+ filterFuncExpr = None
+ filterExpr = None
+
+ filterFeature = "%s->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT" % self.streamVarName
+
+ if None != vulkanType.filterVals:
+ filterValsExpr = " || ".join(map(lambda filterval: "(%s == %s)" % (filterval, filterVarAccess), vulkanType.filterVals))
+
+ if None != vulkanType.filterFunc:
+ filterFuncExpr = self.genFilterFunc(vulkanType.filterFunc, self.currentStructInfo.environment)
+
+ if None != filterValsExpr and None != filterFuncExpr:
+ filterExpr = "%s || %s" % (filterValsExpr, filterFuncExpr)
+ elif None == filterValsExpr and None == filterFuncExpr:
+ # Assume is bool
+ self.cgen.beginIf(filterVarAccess)
+ elif None != filterValsExpr:
+ self.cgen.beginIf("(!(%s) || (%s))" % (filterFeature, filterValsExpr))
+ elif None != filterFuncExpr:
+ self.cgen.beginIf("(!(%s) || (%s))" % (filterFeature, filterFuncExpr))
+
+ def endFilterGuard(self, vulkanType, cleanupExpr=None):
+ if vulkanType.filterVar == None:
+ return
+
+ if self.doFiltering == False:
+ return
+
+ if cleanupExpr == None:
+ self.cgen.endIf()
+ else:
+ self.cgen.endIf()
+ self.cgen.beginElse()
+ self.cgen.stmt(cleanupExpr)
+ self.cgen.endElse()
+
+ def getEnvAccessExpr(self, varName):
+ parentEnvEntry = self.currentStructInfo.environment.get(varName, None)
+
+ if parentEnvEntry != None:
+ isParentMember = parentEnvEntry["structmember"]
+
+ if isParentMember:
+ envAccess = self.exprValueAccessor(list(filter(lambda member: member.paramName == varName, self.currentStructInfo.members))[0])
+ else:
+ envAccess = varName
+ return envAccess
+
+ return None
+
+ def getPointerIndirectionLevels(self, varName):
+ parentEnvEntry = self.currentStructInfo.environment.get(varName, None)
+
+ if parentEnvEntry != None:
+ isParentMember = parentEnvEntry["structmember"]
+
+ if isParentMember:
+ return list(filter(lambda member: member.paramName == varName, self.currentStructInfo.members))[0].pointerIndirectionLevels
+ else:
+ return 0
+ return 0
+
+ return 0
+
+
+ def onCompoundType(self, vulkanType):
+
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ self.beginFilterGuard(vulkanType)
+
+ if vulkanType.pointerIndirectionLevels > 0:
+ self.doAllocSpace(vulkanType)
+
+ if lenAccess is not None:
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ loopVar = "i"
+ access = "%s + %s" % (access, loopVar)
+ forInit = "uint32_t %s = 0" % loopVar
+ forCond = "%s < (uint32_t)%s" % (loopVar, lenAccess)
+ forIncr = "++%s" % loopVar
+ self.cgen.beginFor(forInit, forCond, forIncr)
+
+ accessWithCast = "%s(%s)" % (self.makeCastExpr(
+ self.getTypeForStreaming(vulkanType)), access)
+
+ callParams = [self.streamVarName, self.rootTypeVarName, accessWithCast]
+
+ for (bindName, localName) in vulkanType.binds.items():
+ callParams.append(self.getEnvAccessExpr(localName))
+
+ self.cgen.funcCall(None, self.marshalPrefix + vulkanType.typeName,
+ callParams)
+
+ if lenAccess is not None:
+ self.cgen.endFor()
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+
+ if self.direction == "read":
+ self.endFilterGuard(vulkanType, "%s = 0" % self.exprAccessor(vulkanType))
+ else:
+ self.endFilterGuard(vulkanType)
+
+ def onString(self, vulkanType):
+
+ access = self.exprAccessor(vulkanType)
+
+ if self.direction == "write":
+ self.cgen.stmt("%s->putString(%s)" % (self.streamVarName, access))
+ else:
+ castExpr = \
+ self.makeCastExpr( \
+ self.getTypeForStreaming( \
+ vulkanType.getForAddressAccess()))
+
+ self.cgen.stmt( \
+ "%s->loadStringInPlace(%s&%s)" % (self.streamVarName, castExpr, access))
+
+ def onStringArray(self, vulkanType):
+
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+
+ if self.direction == "write":
+ self.cgen.stmt("saveStringArray(%s, %s, %s)" % (self.streamVarName,
+ access, lenAccess))
+ else:
+ castExpr = \
+ self.makeCastExpr( \
+ self.getTypeForStreaming( \
+ vulkanType.getForAddressAccess()))
+
+ self.cgen.stmt("%s->loadStringArrayInPlace(%s&%s)" % (self.streamVarName, castExpr, access))
+
+ def onStaticArr(self, vulkanType):
+ access = self.exprValueAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ finalLenExpr = "%s * %s" % (lenAccess, self.cgen.sizeofExpr(vulkanType))
+ self.genStreamCall(vulkanType, access, finalLenExpr)
+
+ # Old version VkEncoder may have some sType values conflict with VkDecoder
+ # of new versions. For host decoder, it should not carry the incorrect old
+ # sType values to the |forUnmarshaling| struct. Instead it should overwrite
+ # the sType value.
+ def overwriteSType(self, vulkanType):
+ if self.direction == "read":
+ sTypeParam = copy(vulkanType)
+ sTypeParam.paramName = "sType"
+ sTypeAccess = self.exprAccessor(sTypeParam)
+
+ typeName = vulkanType.parent.typeName
+ if typeName in STYPE_OVERRIDE:
+ self.cgen.stmt("%s = %s" %
+ (sTypeAccess, STYPE_OVERRIDE[typeName]))
+
+ def onStructExtension(self, vulkanType):
+ self.overwriteSType(vulkanType)
+
+ sTypeParam = copy(vulkanType)
+ sTypeParam.paramName = "sType"
+
+ access = self.exprAccessor(vulkanType)
+ sizeVar = "%s_size" % vulkanType.paramName
+
+ if self.direction == "read":
+ castedAccessExpr = "(%s)(%s)" % ("void*", access)
+ else:
+ castedAccessExpr = access
+
+ sTypeAccess = self.exprAccessor(sTypeParam)
+ self.cgen.beginIf("%s == VK_STRUCTURE_TYPE_MAX_ENUM" %
+ self.rootTypeVarName)
+ self.cgen.stmt("%s = %s" % (self.rootTypeVarName, sTypeAccess))
+ self.cgen.endIf()
+
+ if self.direction == "read" and self.dynAlloc:
+ self.cgen.stmt("size_t %s" % sizeVar)
+ self.cgen.stmt("%s = %s->getBe32()" % \
+ (sizeVar, self.streamVarName))
+ self.cgen.stmt("%s = nullptr" % access)
+ self.cgen.beginIf(sizeVar)
+ self.cgen.stmt( \
+ "%s->alloc((void**)&%s, sizeof(VkStructureType))" %
+ (self.streamVarName, access))
+
+ self.genStreamCall(vulkanType, access, "sizeof(VkStructureType)")
+ self.cgen.stmt("VkStructureType extType = *(VkStructureType*)(%s)" % access)
+ self.cgen.stmt( \
+ "%s->alloc((void**)&%s, %s(%s->getFeatureBits(), %s, %s))" %
+ (self.streamVarName, access, EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME, self.streamVarName, self.rootTypeVarName, access))
+ self.cgen.stmt("*(VkStructureType*)%s = extType" % access)
+
+ self.cgen.funcCall(None, self.marshalPrefix + "extension_struct",
+ [self.streamVarName, self.rootTypeVarName, castedAccessExpr])
+ self.cgen.endIf()
+ else:
+
+ self.cgen.funcCall(None, self.marshalPrefix + "extension_struct",
+ [self.streamVarName, self.rootTypeVarName, castedAccessExpr])
+
+
+ def onPointer(self, vulkanType):
+ access = self.exprAccessor(vulkanType)
+
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ self.beginFilterGuard(vulkanType)
+ self.doAllocSpace(vulkanType)
+
+ if vulkanType.filterVar != None:
+ print("onPointer Needs filter: %s filterVar %s" % (access, vulkanType.filterVar))
+
+ if vulkanType.isHandleType() and self.mapHandles:
+ self.genHandleMappingCall(vulkanType, access, lenAccess)
+ else:
+ if self.typeInfo.isNonAbiPortableType(vulkanType.typeName):
+ if lenAccess is not None:
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ self.cgen.beginFor("uint32_t i = 0", "i < (uint32_t)%s" % lenAccess, "++i")
+ self.genPrimitiveStreamCall(vulkanType.getForValueAccess(), "%s[i]" % access)
+ self.cgen.endFor()
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+ else:
+ self.genPrimitiveStreamCall(vulkanType.getForValueAccess(), "(*%s)" % access)
+ else:
+ if lenAccess is not None:
+ finalLenExpr = "%s * %s" % (
+ lenAccess, self.cgen.sizeofExpr(vulkanType.getForValueAccess()))
+ else:
+ finalLenExpr = "%s" % (
+ self.cgen.sizeofExpr(vulkanType.getForValueAccess()))
+ self.genStreamCall(vulkanType, access, finalLenExpr)
+
+ if self.direction == "read":
+ self.endFilterGuard(vulkanType, "%s = 0" % access)
+ else:
+ self.endFilterGuard(vulkanType)
+
+ def onValue(self, vulkanType):
+ self.beginFilterGuard(vulkanType)
+
+ if vulkanType.isHandleType() and self.mapHandles:
+ access = self.exprAccessor(vulkanType)
+ if vulkanType.filterVar != None:
+ print("onValue Needs filter: %s filterVar %s" % (access, vulkanType.filterVar))
+ self.genHandleMappingCall(
+ vulkanType.getForAddressAccess(), access, "1")
+ elif self.typeInfo.isNonAbiPortableType(vulkanType.typeName):
+ access = self.exprPrimitiveValueAccessor(vulkanType)
+ self.genPrimitiveStreamCall(vulkanType, access)
+ else:
+ access = self.exprAccessor(vulkanType)
+ self.genStreamCall(vulkanType, access, self.cgen.sizeofExpr(vulkanType))
+
+ self.endFilterGuard(vulkanType)
+
+ def streamLetParameter(self, structInfo, letParamInfo):
+ filterFeature = "%s->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT" % self.streamVarName
+ self.cgen.stmt("%s %s = 1" % (letParamInfo.typeName, letParamInfo.paramName))
+
+ self.cgen.beginIf(filterFeature)
+
+ if self.direction == "write":
+ bodyExpr = self.currentStructInfo.environment[letParamInfo.paramName]["body"]
+ self.cgen.stmt("%s = %s" % (letParamInfo.paramName, self.genFilterFunc(bodyExpr, self.currentStructInfo.environment)))
+
+ self.genPrimitiveStreamCall(letParamInfo, letParamInfo.paramName)
+
+ self.cgen.endIf()
+
+
+class VulkanMarshaling(VulkanWrapperGenerator):
+
+ def __init__(self, module, typeInfo, variant="host"):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.cgenHeader = CodeGen()
+ self.cgenImpl = CodeGen()
+
+ self.variant = variant
+
+ self.currentFeature = None
+ self.apiOpcodes = {}
+ self.dynAlloc = self.variant != "guest"
+
+ if self.variant == "guest":
+ self.marshalingParams = PARAMETERS_MARSHALING_GUEST
+ else:
+ self.marshalingParams = PARAMETERS_MARSHALING
+
+ self.writeCodegen = \
+ VulkanMarshalingCodegen(
+ None,
+ VULKAN_STREAM_VAR_NAME,
+ ROOT_TYPE_VAR_NAME,
+ MARSHAL_INPUT_VAR_NAME,
+ API_PREFIX_MARSHAL,
+ direction = "write")
+
+ self.readCodegen = \
+ VulkanMarshalingCodegen(
+ None,
+ VULKAN_STREAM_VAR_NAME,
+ ROOT_TYPE_VAR_NAME,
+ UNMARSHAL_INPUT_VAR_NAME,
+ API_PREFIX_UNMARSHAL,
+ direction = "read",
+ dynAlloc=self.dynAlloc)
+
+ self.knownDefs = {}
+
+ # Begin Vulkan API opcodes from something high
+ # that is not going to interfere with renderControl
+ # opcodes
+ self.beginOpcodeOld = 20000
+ self.endOpcodeOld = 30000
+
+ self.beginOpcode = 200000000
+ self.endOpcode = 300000000
+ self.knownOpcodes = set()
+
+ self.extensionMarshalPrototype = \
+ VulkanAPI(API_PREFIX_MARSHAL + "extension_struct",
+ STREAM_RET_TYPE,
+ self.marshalingParams +
+ [STRUCT_EXTENSION_PARAM])
+
+ self.extensionUnmarshalPrototype = \
+ VulkanAPI(API_PREFIX_UNMARSHAL + "extension_struct",
+ STREAM_RET_TYPE,
+ self.marshalingParams +
+ [STRUCT_EXTENSION_PARAM_FOR_WRITE])
+
+ def onBegin(self,):
+ VulkanWrapperGenerator.onBegin(self)
+ self.module.appendImpl(self.cgenImpl.makeFuncDecl(self.extensionMarshalPrototype))
+ self.module.appendImpl(self.cgenImpl.makeFuncDecl(self.extensionUnmarshalPrototype))
+
+ def onBeginFeature(self, featureName, featureType):
+ VulkanWrapperGenerator.onBeginFeature(self, featureName, featureType)
+ self.currentFeature = featureName
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ if name in self.knownDefs:
+ return
+
+ category = self.typeInfo.categoryOf(name)
+
+ if category in ["struct", "union"] and alias:
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncAlias(API_PREFIX_MARSHAL + name,
+ API_PREFIX_MARSHAL + alias))
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncAlias(API_PREFIX_UNMARSHAL + name,
+ API_PREFIX_UNMARSHAL + alias))
+
+ if category in ["struct", "union"] and not alias:
+
+ structInfo = self.typeInfo.structs[name]
+
+ marshalParams = self.marshalingParams + \
+ [makeVulkanTypeSimple(True, name, 1, MARSHAL_INPUT_VAR_NAME)]
+
+ freeParams = []
+ letParams = []
+
+ for (envname, bindingInfo) in list(sorted(structInfo.environment.items(), key = lambda kv: kv[0])):
+ if None == bindingInfo["binding"]:
+ freeParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname))
+ else:
+ if not bindingInfo["structmember"]:
+ letParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname))
+
+ marshalPrototype = \
+ VulkanAPI(API_PREFIX_MARSHAL + name,
+ STREAM_RET_TYPE,
+ marshalParams + freeParams)
+
+ marshalPrototypeNoFilter = \
+ VulkanAPI(API_PREFIX_MARSHAL + name,
+ STREAM_RET_TYPE,
+ marshalParams)
+
+ def structMarshalingCustom(cgen):
+ self.writeCodegen.cgen = cgen
+ self.writeCodegen.currentStructInfo = structInfo
+ self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
+
+ marshalingCode = \
+ CUSTOM_MARSHAL_TYPES[name]["common"] + \
+ CUSTOM_MARSHAL_TYPES[name]["marshaling"].format(
+ streamVarName=self.writeCodegen.streamVarName,
+ rootTypeVarName=self.writeCodegen.rootTypeVarName,
+ inputVarName=self.writeCodegen.inputVarName,
+ newInputVarName=self.writeCodegen.inputVarName + "_new")
+ for line in marshalingCode.split('\n'):
+ cgen.line(line)
+
+ def structMarshalingDef(cgen):
+ self.writeCodegen.cgen = cgen
+ self.writeCodegen.currentStructInfo = structInfo
+ self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
+
+ if category == "struct":
+ # marshal 'let' parameters first
+ for letp in letParams:
+ self.writeCodegen.streamLetParameter(self.typeInfo, letp)
+
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.writeCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.writeCodegen)
+
+ def structMarshalingDefNoFilter(cgen):
+ self.writeCodegen.cgen = cgen
+ self.writeCodegen.currentStructInfo = structInfo
+ self.writeCodegen.doFiltering = False
+ self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
+
+ if category == "struct":
+ # marshal 'let' parameters first
+ for letp in letParams:
+ self.writeCodegen.streamLetParameter(self.typeInfo, letp)
+
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.writeCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.writeCodegen)
+ self.writeCodegen.doFiltering = True
+
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(marshalPrototype))
+
+ if name in CUSTOM_MARSHAL_TYPES:
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ marshalPrototype, structMarshalingCustom))
+ else:
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ marshalPrototype, structMarshalingDef))
+
+ if freeParams != []:
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(marshalPrototypeNoFilter))
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ marshalPrototypeNoFilter, structMarshalingDefNoFilter))
+
+ unmarshalPrototype = \
+ VulkanAPI(API_PREFIX_UNMARSHAL + name,
+ STREAM_RET_TYPE,
+ self.marshalingParams + [makeVulkanTypeSimple(False, name, 1, UNMARSHAL_INPUT_VAR_NAME)] + freeParams)
+
+ unmarshalPrototypeNoFilter = \
+ VulkanAPI(API_PREFIX_UNMARSHAL + name,
+ STREAM_RET_TYPE,
+ self.marshalingParams + [makeVulkanTypeSimple(False, name, 1, UNMARSHAL_INPUT_VAR_NAME)])
+
+ def structUnmarshalingCustom(cgen):
+ self.readCodegen.cgen = cgen
+ self.readCodegen.currentStructInfo = structInfo
+ self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
+
+ unmarshalingCode = \
+ CUSTOM_MARSHAL_TYPES[name]["common"] + \
+ CUSTOM_MARSHAL_TYPES[name]["unmarshaling"].format(
+ streamVarName=self.readCodegen.streamVarName,
+ rootTypeVarName=self.readCodegen.rootTypeVarName,
+ inputVarName=self.readCodegen.inputVarName,
+ newInputVarName=self.readCodegen.inputVarName + "_new")
+ for line in unmarshalingCode.split('\n'):
+ cgen.line(line)
+
+ def structUnmarshalingDef(cgen):
+ self.readCodegen.cgen = cgen
+ self.readCodegen.currentStructInfo = structInfo
+ self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
+
+ if category == "struct":
+ # unmarshal 'let' parameters first
+ for letp in letParams:
+ self.readCodegen.streamLetParameter(self.typeInfo, letp)
+
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.readCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.readCodegen)
+
+ def structUnmarshalingDefNoFilter(cgen):
+ self.readCodegen.cgen = cgen
+ self.readCodegen.currentStructInfo = structInfo
+ self.readCodegen.doFiltering = False
+ self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
+
+ if category == "struct":
+ # unmarshal 'let' parameters first
+ for letp in letParams:
+ iterateVulkanType(self.typeInfo, letp, self.readCodegen)
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.readCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.readCodegen)
+ self.readCodegen.doFiltering = True
+
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(unmarshalPrototype))
+
+ if name in CUSTOM_MARSHAL_TYPES:
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ unmarshalPrototype, structUnmarshalingCustom))
+ else:
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ unmarshalPrototype, structUnmarshalingDef))
+
+ if freeParams != []:
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(unmarshalPrototypeNoFilter))
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ unmarshalPrototypeNoFilter, structUnmarshalingDefNoFilter))
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+ if name in KNOWN_FUNCTION_OPCODES:
+ opcode = KNOWN_FUNCTION_OPCODES[name]
+ else:
+ hashCode = hashlib.sha256(name.encode()).hexdigest()[:8]
+ hashInt = int(hashCode, 16)
+ opcode = self.beginOpcode + hashInt % (self.endOpcode - self.beginOpcode)
+ hasHashCollision = False
+ while opcode in self.knownOpcodes:
+ hasHashCollision = True
+ opcode += 1
+ if hasHashCollision:
+ print("Hash collision occurred on function '{}'. "
+ "Please add the following line to marshalingdefs.py:".format(name), file=sys.stderr)
+ print("----------------------", file=sys.stderr)
+ print(" \"{}\": {},".format(name, opcode), file=sys.stderr)
+ print("----------------------", file=sys.stderr)
+
+ self.module.appendHeader(
+ "#define OP_%s %d\n" % (name, opcode))
+ self.apiOpcodes[name] = (opcode, self.currentFeature)
+ self.knownOpcodes.add(opcode)
+
+ def doExtensionStructMarshalingCodegen(self, cgen, retType, extParam, forEach, funcproto, direction):
+ accessVar = "structAccess"
+ sizeVar = "currExtSize"
+ cgen.stmt("VkInstanceCreateInfo* %s = (VkInstanceCreateInfo*)(%s)" % (accessVar, extParam.paramName))
+ cgen.stmt("size_t %s = %s(%s->getFeatureBits(), %s, %s)" % (sizeVar,
+ EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME, VULKAN_STREAM_VAR_NAME, ROOT_TYPE_VAR_NAME, extParam.paramName))
+
+ cgen.beginIf("!%s && %s" % (sizeVar, extParam.paramName))
+
+ cgen.line("// unknown struct extension; skip and call on its pNext field");
+ cgen.funcCall(None, funcproto.name, [
+ "vkStream", ROOT_TYPE_VAR_NAME, "(void*)%s->pNext" % accessVar])
+ cgen.stmt("return")
+
+ cgen.endIf()
+ cgen.beginElse()
+
+ cgen.line("// known or null extension struct")
+
+ if direction == "write":
+ cgen.stmt("vkStream->putBe32(%s)" % sizeVar)
+ elif not self.dynAlloc:
+ cgen.stmt("vkStream->getBe32()");
+
+ cgen.beginIf("!%s" % (sizeVar))
+ cgen.line("// exit if this was a null extension struct (size == 0 in this branch)")
+ cgen.stmt("return")
+ cgen.endIf()
+
+ cgen.endIf()
+
+ # Now we can do stream stuff
+ if direction == "write":
+ cgen.stmt("vkStream->write(%s, sizeof(VkStructureType))" % extParam.paramName)
+ elif not self.dynAlloc:
+ cgen.stmt("uint64_t pNext_placeholder")
+ placeholderAccess = "(&pNext_placeholder)"
+ cgen.stmt("vkStream->read((void*)(&pNext_placeholder), sizeof(VkStructureType))")
+ cgen.stmt("(void)pNext_placeholder")
+
+ def fatalDefault(cgen):
+ cgen.line("// fatal; the switch is only taken if the extension struct is known");
+ cgen.stmt("abort()")
+ pass
+
+ self.emitForEachStructExtension(
+ cgen,
+ retType,
+ extParam,
+ forEach,
+ defaultEmit=fatalDefault,
+ rootTypeVar=ROOT_TYPE_PARAM)
+
+ def onEnd(self,):
+ VulkanWrapperGenerator.onEnd(self)
+
+ def forEachExtensionMarshal(ext, castedAccess, cgen):
+ cgen.funcCall(None, API_PREFIX_MARSHAL + ext.name,
+ [VULKAN_STREAM_VAR_NAME, ROOT_TYPE_VAR_NAME, castedAccess])
+
+ def forEachExtensionUnmarshal(ext, castedAccess, cgen):
+ cgen.funcCall(None, API_PREFIX_UNMARSHAL + ext.name,
+ [VULKAN_STREAM_VAR_NAME, ROOT_TYPE_VAR_NAME, castedAccess])
+
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ self.extensionMarshalPrototype,
+ lambda cgen: self.doExtensionStructMarshalingCodegen(
+ cgen,
+ STREAM_RET_TYPE,
+ STRUCT_EXTENSION_PARAM,
+ forEachExtensionMarshal,
+ self.extensionMarshalPrototype,
+ "write")))
+
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ self.extensionUnmarshalPrototype,
+ lambda cgen: self.doExtensionStructMarshalingCodegen(
+ cgen,
+ STREAM_RET_TYPE,
+ STRUCT_EXTENSION_PARAM_FOR_WRITE,
+ forEachExtensionUnmarshal,
+ self.extensionUnmarshalPrototype,
+ "read")))
+
+ opcode2stringPrototype = \
+ VulkanAPI("api_opcode_to_string",
+ makeVulkanTypeSimple(True, "char", 1, "none"),
+ [ makeVulkanTypeSimple(True, "uint32_t", 0, "opcode") ])
+
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(opcode2stringPrototype))
+
+ def emitOpcode2StringImpl(apiOpcodes, cgen):
+ cgen.line("switch(opcode)")
+ cgen.beginBlock()
+
+ currFeature = None
+
+ for (name, (opcodeNum, feature)) in sorted(apiOpcodes.items(), key = lambda x : x[1][0]):
+ if not currFeature:
+ cgen.leftline("#ifdef %s" % feature)
+ currFeature = feature
+
+ if currFeature and feature != currFeature:
+ cgen.leftline("#endif")
+ cgen.leftline("#ifdef %s" % feature)
+ currFeature = feature
+
+ cgen.line("case OP_%s:" % name)
+ cgen.beginBlock()
+ cgen.stmt("return \"OP_%s\"" % name)
+ cgen.endBlock()
+
+ if currFeature:
+ cgen.leftline("#endif")
+
+ cgen.line("default:")
+ cgen.beginBlock()
+ cgen.stmt("return \"OP_UNKNOWN_API_CALL\"")
+ cgen.endBlock()
+
+ cgen.endBlock()
+
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ opcode2stringPrototype,
+ lambda cgen: emitOpcode2StringImpl(self.apiOpcodes, cgen)))
+
+ self.module.appendHeader(
+ "#define OP_vkFirst_old %d\n" % (self.beginOpcodeOld))
+ self.module.appendHeader(
+ "#define OP_vkLast_old %d\n" % (self.endOpcodeOld))
+ self.module.appendHeader(
+ "#define OP_vkFirst %d\n" % (self.beginOpcode))
+ self.module.appendHeader(
+ "#define OP_vkLast %d\n" % (self.endOpcode))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/marshalingdefs.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/marshalingdefs.py
new file mode 100644
index 00000000000..88791f68b86
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/marshalingdefs.py
@@ -0,0 +1,528 @@
+# 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.
+
+KNOWN_FUNCTION_OPCODES = {
+ "vkCreateInstance": 20000,
+ "vkDestroyInstance": 20001,
+ "vkEnumeratePhysicalDevices": 20002,
+ "vkGetPhysicalDeviceFeatures": 20003,
+ "vkGetPhysicalDeviceFormatProperties": 20004,
+ "vkGetPhysicalDeviceImageFormatProperties": 20005,
+ "vkGetPhysicalDeviceProperties": 20006,
+ "vkGetPhysicalDeviceQueueFamilyProperties": 20007,
+ "vkGetPhysicalDeviceMemoryProperties": 20008,
+ "vkGetInstanceProcAddr": 20009,
+ "vkGetDeviceProcAddr": 20010,
+ "vkCreateDevice": 20011,
+ "vkDestroyDevice": 20012,
+ "vkEnumerateInstanceExtensionProperties": 20013,
+ "vkEnumerateDeviceExtensionProperties": 20014,
+ "vkEnumerateInstanceLayerProperties": 20015,
+ "vkEnumerateDeviceLayerProperties": 20016,
+ "vkGetDeviceQueue": 20017,
+ "vkQueueSubmit": 20018,
+ "vkQueueWaitIdle": 20019,
+ "vkDeviceWaitIdle": 20020,
+ "vkAllocateMemory": 20021,
+ "vkFreeMemory": 20022,
+ "vkMapMemory": 20023,
+ "vkUnmapMemory": 20024,
+ "vkFlushMappedMemoryRanges": 20025,
+ "vkInvalidateMappedMemoryRanges": 20026,
+ "vkGetDeviceMemoryCommitment": 20027,
+ "vkBindBufferMemory": 20028,
+ "vkBindImageMemory": 20029,
+ "vkGetBufferMemoryRequirements": 20030,
+ "vkGetImageMemoryRequirements": 20031,
+ "vkGetImageSparseMemoryRequirements": 20032,
+ "vkGetPhysicalDeviceSparseImageFormatProperties": 20033,
+ "vkQueueBindSparse": 20034,
+ "vkCreateFence": 20035,
+ "vkDestroyFence": 20036,
+ "vkResetFences": 20037,
+ "vkGetFenceStatus": 20038,
+ "vkWaitForFences": 20039,
+ "vkCreateSemaphore": 20040,
+ "vkDestroySemaphore": 20041,
+ "vkCreateEvent": 20042,
+ "vkDestroyEvent": 20043,
+ "vkGetEventStatus": 20044,
+ "vkSetEvent": 20045,
+ "vkResetEvent": 20046,
+ "vkCreateQueryPool": 20047,
+ "vkDestroyQueryPool": 20048,
+ "vkGetQueryPoolResults": 20049,
+ "vkCreateBuffer": 20050,
+ "vkDestroyBuffer": 20051,
+ "vkCreateBufferView": 20052,
+ "vkDestroyBufferView": 20053,
+ "vkCreateImage": 20054,
+ "vkDestroyImage": 20055,
+ "vkGetImageSubresourceLayout": 20056,
+ "vkCreateImageView": 20057,
+ "vkDestroyImageView": 20058,
+ "vkCreateShaderModule": 20059,
+ "vkDestroyShaderModule": 20060,
+ "vkCreatePipelineCache": 20061,
+ "vkDestroyPipelineCache": 20062,
+ "vkGetPipelineCacheData": 20063,
+ "vkMergePipelineCaches": 20064,
+ "vkCreateGraphicsPipelines": 20065,
+ "vkCreateComputePipelines": 20066,
+ "vkDestroyPipeline": 20067,
+ "vkCreatePipelineLayout": 20068,
+ "vkDestroyPipelineLayout": 20069,
+ "vkCreateSampler": 20070,
+ "vkDestroySampler": 20071,
+ "vkCreateDescriptorSetLayout": 20072,
+ "vkDestroyDescriptorSetLayout": 20073,
+ "vkCreateDescriptorPool": 20074,
+ "vkDestroyDescriptorPool": 20075,
+ "vkResetDescriptorPool": 20076,
+ "vkAllocateDescriptorSets": 20077,
+ "vkFreeDescriptorSets": 20078,
+ "vkUpdateDescriptorSets": 20079,
+ "vkCreateFramebuffer": 20080,
+ "vkDestroyFramebuffer": 20081,
+ "vkCreateRenderPass": 20082,
+ "vkDestroyRenderPass": 20083,
+ "vkGetRenderAreaGranularity": 20084,
+ "vkCreateCommandPool": 20085,
+ "vkDestroyCommandPool": 20086,
+ "vkResetCommandPool": 20087,
+ "vkAllocateCommandBuffers": 20088,
+ "vkFreeCommandBuffers": 20089,
+ "vkBeginCommandBuffer": 20090,
+ "vkEndCommandBuffer": 20091,
+ "vkResetCommandBuffer": 20092,
+ "vkCmdBindPipeline": 20093,
+ "vkCmdSetViewport": 20094,
+ "vkCmdSetScissor": 20095,
+ "vkCmdSetLineWidth": 20096,
+ "vkCmdSetDepthBias": 20097,
+ "vkCmdSetBlendConstants": 20098,
+ "vkCmdSetDepthBounds": 20099,
+ "vkCmdSetStencilCompareMask": 20100,
+ "vkCmdSetStencilWriteMask": 20101,
+ "vkCmdSetStencilReference": 20102,
+ "vkCmdBindDescriptorSets": 20103,
+ "vkCmdBindIndexBuffer": 20104,
+ "vkCmdBindVertexBuffers": 20105,
+ "vkCmdDraw": 20106,
+ "vkCmdDrawIndexed": 20107,
+ "vkCmdDrawIndirect": 20108,
+ "vkCmdDrawIndexedIndirect": 20109,
+ "vkCmdDispatch": 20110,
+ "vkCmdDispatchIndirect": 20111,
+ "vkCmdCopyBuffer": 20112,
+ "vkCmdCopyImage": 20113,
+ "vkCmdBlitImage": 20114,
+ "vkCmdCopyBufferToImage": 20115,
+ "vkCmdCopyImageToBuffer": 20116,
+ "vkCmdUpdateBuffer": 20117,
+ "vkCmdFillBuffer": 20118,
+ "vkCmdClearColorImage": 20119,
+ "vkCmdClearDepthStencilImage": 20120,
+ "vkCmdClearAttachments": 20121,
+ "vkCmdResolveImage": 20122,
+ "vkCmdSetEvent": 20123,
+ "vkCmdResetEvent": 20124,
+ "vkCmdWaitEvents": 20125,
+ "vkCmdPipelineBarrier": 20126,
+ "vkCmdBeginQuery": 20127,
+ "vkCmdEndQuery": 20128,
+ "vkCmdResetQueryPool": 20129,
+ "vkCmdWriteTimestamp": 20130,
+ "vkCmdCopyQueryPoolResults": 20131,
+ "vkCmdPushConstants": 20132,
+ "vkCmdBeginRenderPass": 20133,
+ "vkCmdNextSubpass": 20134,
+ "vkCmdEndRenderPass": 20135,
+ "vkCmdExecuteCommands": 20136,
+ "vkEnumerateInstanceVersion": 20137,
+ "vkBindBufferMemory2": 20138,
+ "vkBindImageMemory2": 20139,
+ "vkGetDeviceGroupPeerMemoryFeatures": 20140,
+ "vkCmdSetDeviceMask": 20141,
+ "vkCmdDispatchBase": 20142,
+ "vkEnumeratePhysicalDeviceGroups": 20143,
+ "vkGetImageMemoryRequirements2": 20144,
+ "vkGetBufferMemoryRequirements2": 20145,
+ "vkGetImageSparseMemoryRequirements2": 20146,
+ "vkGetPhysicalDeviceFeatures2": 20147,
+ "vkGetPhysicalDeviceProperties2": 20148,
+ "vkGetPhysicalDeviceFormatProperties2": 20149,
+ "vkGetPhysicalDeviceImageFormatProperties2": 20150,
+ "vkGetPhysicalDeviceQueueFamilyProperties2": 20151,
+ "vkGetPhysicalDeviceMemoryProperties2": 20152,
+ "vkGetPhysicalDeviceSparseImageFormatProperties2": 20153,
+ "vkTrimCommandPool": 20154,
+ "vkGetDeviceQueue2": 20155,
+ "vkCreateSamplerYcbcrConversion": 20156,
+ "vkDestroySamplerYcbcrConversion": 20157,
+ "vkCreateDescriptorUpdateTemplate": 20158,
+ "vkDestroyDescriptorUpdateTemplate": 20159,
+ "vkUpdateDescriptorSetWithTemplate": 20160,
+ "vkGetPhysicalDeviceExternalBufferProperties": 20161,
+ "vkGetPhysicalDeviceExternalFenceProperties": 20162,
+ "vkGetPhysicalDeviceExternalSemaphoreProperties": 20163,
+ "vkGetDescriptorSetLayoutSupport": 20164,
+ "vkDestroySurfaceKHR": 20165,
+ "vkGetPhysicalDeviceSurfaceSupportKHR": 20166,
+ "vkGetPhysicalDeviceSurfaceCapabilitiesKHR": 20167,
+ "vkGetPhysicalDeviceSurfaceFormatsKHR": 20168,
+ "vkGetPhysicalDeviceSurfacePresentModesKHR": 20169,
+ "vkCreateSwapchainKHR": 20170,
+ "vkDestroySwapchainKHR": 20171,
+ "vkGetSwapchainImagesKHR": 20172,
+ "vkAcquireNextImageKHR": 20173,
+ "vkQueuePresentKHR": 20174,
+ "vkGetDeviceGroupPresentCapabilitiesKHR": 20175,
+ "vkGetDeviceGroupSurfacePresentModesKHR": 20176,
+ "vkGetPhysicalDevicePresentRectanglesKHR": 20177,
+ "vkAcquireNextImage2KHR": 20178,
+ "vkGetPhysicalDeviceDisplayPropertiesKHR": 20179,
+ "vkGetPhysicalDeviceDisplayPlanePropertiesKHR": 20180,
+ "vkGetDisplayPlaneSupportedDisplaysKHR": 20181,
+ "vkGetDisplayModePropertiesKHR": 20182,
+ "vkCreateDisplayModeKHR": 20183,
+ "vkGetDisplayPlaneCapabilitiesKHR": 20184,
+ "vkCreateDisplayPlaneSurfaceKHR": 20185,
+ "vkCreateSharedSwapchainsKHR": 20186,
+ "vkCreateXlibSurfaceKHR": 20187,
+ "vkGetPhysicalDeviceXlibPresentationSupportKHR": 20188,
+ "vkCreateXcbSurfaceKHR": 20189,
+ "vkGetPhysicalDeviceXcbPresentationSupportKHR": 20190,
+ "vkCreateWaylandSurfaceKHR": 20191,
+ "vkGetPhysicalDeviceWaylandPresentationSupportKHR": 20192,
+ "vkCreateMirSurfaceKHR": 20193,
+ "vkGetPhysicalDeviceMirPresentationSupportKHR": 20194,
+ "vkCreateAndroidSurfaceKHR": 20195,
+ "vkCreateWin32SurfaceKHR": 20196,
+ "vkGetPhysicalDeviceWin32PresentationSupportKHR": 20197,
+ "vkGetPhysicalDeviceFeatures2KHR": 20198,
+ "vkGetPhysicalDeviceProperties2KHR": 20199,
+ "vkGetPhysicalDeviceFormatProperties2KHR": 20200,
+ "vkGetPhysicalDeviceImageFormatProperties2KHR": 20201,
+ "vkGetPhysicalDeviceQueueFamilyProperties2KHR": 20202,
+ "vkGetPhysicalDeviceMemoryProperties2KHR": 20203,
+ "vkGetPhysicalDeviceSparseImageFormatProperties2KHR": 20204,
+ "vkGetDeviceGroupPeerMemoryFeaturesKHR": 20205,
+ "vkCmdSetDeviceMaskKHR": 20206,
+ "vkCmdDispatchBaseKHR": 20207,
+ "vkTrimCommandPoolKHR": 20208,
+ "vkEnumeratePhysicalDeviceGroupsKHR": 20209,
+ "vkGetPhysicalDeviceExternalBufferPropertiesKHR": 20210,
+ "vkGetMemoryWin32HandleKHR": 20211,
+ "vkGetMemoryWin32HandlePropertiesKHR": 20212,
+ "vkGetMemoryFdKHR": 20213,
+ "vkGetMemoryFdPropertiesKHR": 20214,
+ "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR": 20215,
+ "vkImportSemaphoreWin32HandleKHR": 20216,
+ "vkGetSemaphoreWin32HandleKHR": 20217,
+ "vkImportSemaphoreFdKHR": 20218,
+ "vkGetSemaphoreFdKHR": 20219,
+ "vkCmdPushDescriptorSetKHR": 20220,
+ "vkCmdPushDescriptorSetWithTemplateKHR": 20221,
+ "vkCreateDescriptorUpdateTemplateKHR": 20222,
+ "vkDestroyDescriptorUpdateTemplateKHR": 20223,
+ "vkUpdateDescriptorSetWithTemplateKHR": 20224,
+ "vkCreateRenderPass2KHR": 20225,
+ "vkCmdBeginRenderPass2KHR": 20226,
+ "vkCmdNextSubpass2KHR": 20227,
+ "vkCmdEndRenderPass2KHR": 20228,
+ "vkGetSwapchainStatusKHR": 20229,
+ "vkGetPhysicalDeviceExternalFencePropertiesKHR": 20230,
+ "vkImportFenceWin32HandleKHR": 20231,
+ "vkGetFenceWin32HandleKHR": 20232,
+ "vkImportFenceFdKHR": 20233,
+ "vkGetFenceFdKHR": 20234,
+ "vkGetPhysicalDeviceSurfaceCapabilities2KHR": 20235,
+ "vkGetPhysicalDeviceSurfaceFormats2KHR": 20236,
+ "vkGetPhysicalDeviceDisplayProperties2KHR": 20237,
+ "vkGetPhysicalDeviceDisplayPlaneProperties2KHR": 20238,
+ "vkGetDisplayModeProperties2KHR": 20239,
+ "vkGetDisplayPlaneCapabilities2KHR": 20240,
+ "vkGetImageMemoryRequirements2KHR": 20241,
+ "vkGetBufferMemoryRequirements2KHR": 20242,
+ "vkGetImageSparseMemoryRequirements2KHR": 20243,
+ "vkCreateSamplerYcbcrConversionKHR": 20244,
+ "vkDestroySamplerYcbcrConversionKHR": 20245,
+ "vkBindBufferMemory2KHR": 20246,
+ "vkBindImageMemory2KHR": 20247,
+ "vkGetDescriptorSetLayoutSupportKHR": 20248,
+ "vkCmdDrawIndirectCountKHR": 20249,
+ "vkCmdDrawIndexedIndirectCountKHR": 20250,
+ "vkGetSwapchainGrallocUsageANDROID": 20251,
+ "vkAcquireImageANDROID": 20252,
+ "vkQueueSignalReleaseImageANDROID": 20253,
+ "vkCreateDebugReportCallbackEXT": 20254,
+ "vkDestroyDebugReportCallbackEXT": 20255,
+ "vkDebugReportMessageEXT": 20256,
+ "vkDebugMarkerSetObjectTagEXT": 20257,
+ "vkDebugMarkerSetObjectNameEXT": 20258,
+ "vkCmdDebugMarkerBeginEXT": 20259,
+ "vkCmdDebugMarkerEndEXT": 20260,
+ "vkCmdDebugMarkerInsertEXT": 20261,
+ "vkCmdDrawIndirectCountAMD": 20262,
+ "vkCmdDrawIndexedIndirectCountAMD": 20263,
+ "vkGetShaderInfoAMD": 20264,
+ "vkGetPhysicalDeviceExternalImageFormatPropertiesNV": 20265,
+ "vkGetMemoryWin32HandleNV": 20266,
+ "vkCreateViSurfaceNN": 20267,
+ "vkCmdBeginConditionalRenderingEXT": 20268,
+ "vkCmdEndConditionalRenderingEXT": 20269,
+ "vkCmdProcessCommandsNVX": 20270,
+ "vkCmdReserveSpaceForCommandsNVX": 20271,
+ "vkCreateIndirectCommandsLayoutNVX": 20272,
+ "vkDestroyIndirectCommandsLayoutNVX": 20273,
+ "vkCreateObjectTableNVX": 20274,
+ "vkDestroyObjectTableNVX": 20275,
+ "vkRegisterObjectsNVX": 20276,
+ "vkUnregisterObjectsNVX": 20277,
+ "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX": 20278,
+ "vkCmdSetViewportWScalingNV": 20279,
+ "vkReleaseDisplayEXT": 20280,
+ "vkAcquireXlibDisplayEXT": 20281,
+ "vkGetRandROutputDisplayEXT": 20282,
+ "vkGetPhysicalDeviceSurfaceCapabilities2EXT": 20283,
+ "vkDisplayPowerControlEXT": 20284,
+ "vkRegisterDeviceEventEXT": 20285,
+ "vkRegisterDisplayEventEXT": 20286,
+ "vkGetSwapchainCounterEXT": 20287,
+ "vkGetRefreshCycleDurationGOOGLE": 20288,
+ "vkGetPastPresentationTimingGOOGLE": 20289,
+ "vkCmdSetDiscardRectangleEXT": 20290,
+ "vkSetHdrMetadataEXT": 20291,
+ "vkCreateIOSSurfaceMVK": 20292,
+ "vkCreateMacOSSurfaceMVK": 20293,
+ "vkSetDebugUtilsObjectNameEXT": 20294,
+ "vkSetDebugUtilsObjectTagEXT": 20295,
+ "vkQueueBeginDebugUtilsLabelEXT": 20296,
+ "vkQueueEndDebugUtilsLabelEXT": 20297,
+ "vkQueueInsertDebugUtilsLabelEXT": 20298,
+ "vkCmdBeginDebugUtilsLabelEXT": 20299,
+ "vkCmdEndDebugUtilsLabelEXT": 20300,
+ "vkCmdInsertDebugUtilsLabelEXT": 20301,
+ "vkCreateDebugUtilsMessengerEXT": 20302,
+ "vkDestroyDebugUtilsMessengerEXT": 20303,
+ "vkSubmitDebugUtilsMessageEXT": 20304,
+ "vkGetAndroidHardwareBufferPropertiesANDROID": 20305,
+ "vkGetMemoryAndroidHardwareBufferANDROID": 20306,
+ "vkCmdSetSampleLocationsEXT": 20307,
+ "vkGetPhysicalDeviceMultisamplePropertiesEXT": 20308,
+ "vkCreateValidationCacheEXT": 20309,
+ "vkDestroyValidationCacheEXT": 20310,
+ "vkMergeValidationCachesEXT": 20311,
+ "vkGetValidationCacheDataEXT": 20312,
+ "vkGetMemoryHostPointerPropertiesEXT": 20313,
+ "vkCmdWriteBufferMarkerAMD": 20314,
+ "vkCmdSetCheckpointNV": 20315,
+ "vkGetQueueCheckpointDataNV": 20316,
+ "vkMapMemoryIntoAddressSpaceGOOGLE": 20317,
+ "vkUpdateDescriptorSetWithTemplateSizedGOOGLE": 20320,
+ "vkBeginCommandBufferAsyncGOOGLE": 20321,
+ "vkEndCommandBufferAsyncGOOGLE": 20322,
+ "vkResetCommandBufferAsyncGOOGLE": 20323,
+ "vkCommandBufferHostSyncGOOGLE": 20324,
+ "vkCreateImageWithRequirementsGOOGLE": 20325,
+ "vkCreateBufferWithRequirementsGOOGLE": 20326,
+ "vkGetMemoryHostAddressInfoGOOGLE": 20327,
+ "vkFreeMemorySyncGOOGLE": 20328,
+ "vkQueueHostSyncGOOGLE": 20329,
+ "vkQueueSubmitAsyncGOOGLE": 20330,
+ "vkQueueWaitIdleAsyncGOOGLE": 20331,
+ "vkQueueBindSparseAsyncGOOGLE": 20332,
+ "vkGetLinearImageLayoutGOOGLE": 20333,
+ "vkGetMTLDeviceMVK": 20334,
+ "vkSetMTLTextureMVK": 20335,
+ "vkGetMTLTextureMVK": 20336,
+ "vkGetMTLBufferMVK": 20337,
+ "vkUseIOSurfaceMVK": 20338,
+ "vkGetIOSurfaceMVK": 20339,
+ "vkQueueFlushCommandsGOOGLE": 20340,
+ "vkGetBlobGOOGLE": 20341,
+}
+
+CUSTOM_MARSHAL_TYPES = {
+ "VkAccelerationStructureInstanceKHR": {
+ "common": """
+typedef struct VkAccelerationStructureInstanceKHRWithoutBitFields {
+ VkTransformMatrixKHR transform;
+ uint32_t dwords[2];
+ uint64_t accelerationStructureReference;
+} VkAccelerationStructureInstanceKHRWithoutBitFields;
+""",
+ "marshaling": """
+const VkAccelerationStructureInstanceKHRWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureInstanceKHRWithoutBitFields*)({inputVarName});
+marshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transform));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->write((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->write((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "unmarshaling": """
+VkAccelerationStructureInstanceKHRWithoutBitFields* {newInputVarName} = (VkAccelerationStructureInstanceKHRWithoutBitFields*)({inputVarName});
+unmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transform));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->read((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->read((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "reservedmarshaling": """
+(void)vkStream;
+const VkAccelerationStructureInstanceKHRWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureInstanceKHRWithoutBitFields*)({inputVarName});
+reservedmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transform), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy(*ptr, (uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy(*ptr, (uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ "reservedunmarshaling": """
+VkAccelerationStructureInstanceKHRWithoutBitFields* {newInputVarName} = (VkAccelerationStructureInstanceKHRWithoutBitFields*)({inputVarName});
+reservedunmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transform), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy((uint32_t*)&({newInputVarName}->dwords[i]), *ptr, sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy((uint64_t*)&{newInputVarName}->accelerationStructureReference, *ptr, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ },
+ "VkAccelerationStructureMatrixMotionInstanceNV": {
+ "common": """
+typedef struct VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields {
+ VkTransformMatrixKHR transformT0;
+ VkTransformMatrixKHR transformT1;
+ uint32_t dwords[2];
+ uint64_t accelerationStructureReference;
+} VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields;
+""",
+ "marshaling": """
+const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)({inputVarName});
+marshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT0));
+marshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT1));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->write((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->write((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "unmarshaling": """
+VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* {newInputVarName} = (VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)({inputVarName});
+unmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT0));
+unmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT1));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->read((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->read((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "reservedmarshaling": """
+(void)vkStream;
+const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)({inputVarName});
+reservedmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT0), ptr);
+reservedmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT1), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy(*ptr, (uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy(*ptr, (uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ "reservedunmarshaling": """
+VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* {newInputVarName} = (VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)({inputVarName});
+reservedunmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT0), ptr);
+reservedunmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT1), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy((uint32_t*)&({newInputVarName}->dwords[i]), *ptr, sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy((uint64_t*)&{newInputVarName}->accelerationStructureReference, *ptr, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ },
+ "VkAccelerationStructureSRTMotionInstanceNV": {
+ "common": """
+typedef struct VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields {
+ VkSRTDataNV transformT0;
+ VkSRTDataNV transformT1;
+ uint32_t dwords[2];
+ uint64_t accelerationStructureReference;
+} VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields;
+""",
+ "marshaling": """
+const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)({inputVarName});
+marshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT0));
+marshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT1));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->write((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->write((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "unmarshaling": """
+VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* {newInputVarName} = (VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)({inputVarName});
+unmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT0));
+unmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT1));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->read((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->read((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "reservedmarshaling": """
+(void)vkStream;
+const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)({inputVarName});
+reservedmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT0), ptr);
+reservedmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT1), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy(*ptr, (uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy(*ptr, (uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ "reservedunmarshaling": """
+VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* {newInputVarName} = (VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)({inputVarName});
+reservedunmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT0), ptr);
+reservedunmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT1), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy((uint32_t*)&({newInputVarName}->dwords[i]), *ptr, sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy((uint64_t*)&{newInputVarName}->accelerationStructureReference, *ptr, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ },
+ "VkXcbSurfaceCreateInfoKHR": {
+ "common": """
+// This struct should never be marshaled / unmarshaled.
+__builtin_trap();
+""",
+ "marshaling": "",
+ "unmarshaling": "",
+ "reservedmarshaling": "",
+ "reservedunmarshaling": "",
+ },
+ "VkMetalSurfaceCreateInfoEXT": {
+ "common": """
+// This struct should never be marshaled / unmarshaled.
+__builtin_trap();
+""",
+ "marshaling": "",
+ "unmarshaling": "",
+ "reservedmarshaling": "",
+ "reservedunmarshaling": "",
+ },
+}
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/reservedmarshaling.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/reservedmarshaling.py
new file mode 100644
index 00000000000..3b54a4133a3
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/reservedmarshaling.py
@@ -0,0 +1,1061 @@
+# 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.
+from copy import copy
+
+from .common.codegen import CodeGen, VulkanAPIWrapper
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType, VulkanTypeIterator, Atom, FuncExpr, FuncExprVal, FuncLambda
+
+from .wrapperdefs import VulkanWrapperGenerator
+from .wrapperdefs import VULKAN_STREAM_VAR_NAME
+from .wrapperdefs import ROOT_TYPE_VAR_NAME, ROOT_TYPE_PARAM
+from .wrapperdefs import STREAM_RET_TYPE
+from .wrapperdefs import MARSHAL_INPUT_VAR_NAME
+from .wrapperdefs import UNMARSHAL_INPUT_VAR_NAME
+from .wrapperdefs import PARAMETERS_MARSHALING
+from .wrapperdefs import PARAMETERS_MARSHALING_GUEST
+from .wrapperdefs import STYPE_OVERRIDE
+from .wrapperdefs import STRUCT_EXTENSION_PARAM, STRUCT_EXTENSION_PARAM_FOR_WRITE, EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME
+from .wrapperdefs import API_PREFIX_RESERVEDMARSHAL
+from .wrapperdefs import API_PREFIX_RESERVEDUNMARSHAL
+
+from .marshalingdefs import CUSTOM_MARSHAL_TYPES
+class VulkanReservedMarshalingCodegen(VulkanTypeIterator):
+ def __init__(self,
+ cgen,
+ variant,
+ streamVarName,
+ rootTypeVarName,
+ inputVarName,
+ ptrVarName,
+ marshalPrefix,
+ handlemapPrefix,
+ direction = "write",
+ forApiOutput = False,
+ dynAlloc = False,
+ mapHandles = True,
+ handleMapOverwrites = False,
+ doFiltering = True,
+ stackVar=None,
+ stackArrSize=None):
+ self.cgen = cgen
+ self.variant = variant
+ self.direction = direction
+ self.processSimple = "write" if self.direction == "write" else "read"
+ self.forApiOutput = forApiOutput
+
+ self.checked = False
+
+ self.streamVarName = streamVarName
+ self.rootTypeVarName = rootTypeVarName
+ self.inputVarName = inputVarName
+ self.ptrVar = ptrVarName
+ self.marshalPrefix = marshalPrefix
+ self.handlemapPrefix = handlemapPrefix
+
+ self.exprAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.inputVarName, asPtr = True)
+ self.exprValueAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.inputVarName, asPtr = False)
+ self.exprPrimitiveValueAccessor = lambda t: self.cgen.generalAccess(t, parentVarName = self.inputVarName, asPtr = False)
+ self.lenAccessor = lambda t: self.cgen.generalLengthAccess(t, parentVarName = self.inputVarName)
+ self.lenAccessorGuard = lambda t: self.cgen.generalLengthAccessGuard(
+ t, parentVarName=self.inputVarName)
+ self.filterVarAccessor = lambda t: self.cgen.filterVarAccess(t, parentVarName = self.inputVarName)
+
+ self.dynAlloc = dynAlloc
+ self.mapHandles = mapHandles
+ self.handleMapOverwrites = handleMapOverwrites
+ self.doFiltering = doFiltering
+
+ self.stackVar = stackVar
+ self.stackArrSize = stackArrSize
+
+ def getTypeForStreaming(self, vulkanType):
+ res = copy(vulkanType)
+
+ if not vulkanType.accessibleAsPointer():
+ res = res.getForAddressAccess()
+
+ if vulkanType.staticArrExpr:
+ res = res.getForAddressAccess()
+
+ if self.direction == "write":
+ return res
+ else:
+ return res.getForNonConstAccess()
+
+ def makeCastExpr(self, vulkanType):
+ return "(%s)" % (
+ self.cgen.makeCTypeDecl(vulkanType, useParamName=False))
+
+ def genPtrIncr(self, sizeExpr):
+ self.cgen.stmt("*%s += %s" % (self.ptrVar, sizeExpr))
+
+ def genMemcpyAndIncr(self, varname, cast, toStreamExpr, sizeExpr, toBe = False, actualSize = 4):
+ if self.direction == "write":
+ self.cgen.stmt("memcpy(*%s, %s%s, %s)" % (varname, cast, toStreamExpr, sizeExpr))
+ else:
+ self.cgen.stmt("memcpy(%s%s, *%s, %s)" % (cast, toStreamExpr, varname, sizeExpr))
+
+ if toBe:
+ streamPrefix = "to"
+ if "read" == self.direction:
+ streamPrefix = "from"
+
+ streamMethod = streamPrefix
+
+ if 1 == actualSize:
+ streamMethod += "Byte"
+ elif 2 == actualSize:
+ streamMethod += "Be16"
+ elif 4 == actualSize:
+ streamMethod += "Be32"
+ elif 8 == actualSize:
+ streamMethod += "Be64"
+ else:
+ pass
+
+ streamNamespace = "gfxstream::guest" if self.variant == "guest" else "android::base"
+ if self.direction == "write":
+ self.cgen.stmt("%s::Stream::%s((uint8_t*)*%s)" % (streamNamespace, streamMethod, varname))
+ else:
+ self.cgen.stmt("%s::Stream::%s((uint8_t*)%s)" % (streamNamespace, streamMethod, toStreamExpr))
+
+ self.genPtrIncr(sizeExpr)
+
+ def genStreamCall(self, vulkanType, toStreamExpr, sizeExpr):
+ varname = self.ptrVar
+ cast = self.makeCastExpr(self.getTypeForStreaming(vulkanType))
+ self.genMemcpyAndIncr(varname, cast, toStreamExpr, sizeExpr)
+
+ def genPrimitiveStreamCall(self, vulkanType, access):
+ varname = self.ptrVar
+ self.cgen.memcpyPrimitive(
+ self.typeInfo,
+ "(*" + varname + ")",
+ access,
+ vulkanType,
+ self.variant,
+ direction=self.direction)
+ self.genPtrIncr(str(self.cgen.countPrimitive(
+ self.typeInfo,
+ vulkanType)))
+
+ def genHandleMappingCall(self, vulkanType, access, lenAccess, lenAccessGuard):
+
+ if lenAccess is None:
+ lenAccess = "1"
+ handle64Bytes = "8"
+ else:
+ handle64Bytes = "%s * 8" % lenAccess
+
+ handle64Var = self.cgen.var()
+ if lenAccess != "1":
+ self.cgen.beginIf(lenAccess)
+ self.cgen.stmt("uint8_t* %s_ptr = (uint8_t*)(*%s)" % (handle64Var, self.ptrVar))
+ handle64VarAccess = handle64Var
+ handle64VarType = \
+ makeVulkanTypeSimple(False, "uint64_t", 1, paramName=handle64Var)
+ else:
+ self.cgen.stmt("uint64_t %s" % handle64Var)
+ handle64VarAccess = "&%s" % handle64Var
+ handle64VarType = \
+ makeVulkanTypeSimple(False, "uint64_t", 0, paramName=handle64Var)
+
+ if "" == self.handlemapPrefix:
+ mapFunc = ("(%s)" % vulkanType.typeName)
+ mapFunc64 = ("(%s)" % "uint64_t")
+ else:
+ mapFunc = self.handlemapPrefix + vulkanType.typeName
+ mapFunc64 = mapFunc
+
+ if self.direction == "write":
+ if self.handleMapOverwrites:
+ self.cgen.stmt(
+ "static_assert(8 == sizeof(%s), \"handle map overwrite requres %s to be 8 bytes long\")" % \
+ (vulkanType.typeName, vulkanType.typeName))
+ if "1" == lenAccess:
+ self.cgen.stmt("*%s = (%s)%s(*%s)" % (access, vulkanType.typeName, mapFunc, access))
+ self.genStreamCall(vulkanType, access, "8 * %s" % lenAccess)
+ else:
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ self.cgen.beginFor("uint32_t k = 0", "k < %s" % lenAccess, "++k")
+ self.cgen.stmt("%s[k] = (%s)%s(%s[k])" % (access, vulkanType.typeName, mapFunc, access))
+ self.cgen.endFor()
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+ self.genPtrIncr("8 * %s" % lenAccess)
+ else:
+ if "1" == lenAccess:
+ self.cgen.stmt("*%s = %s((*%s))" % (handle64VarAccess, mapFunc64, access))
+ self.genStreamCall(handle64VarType, handle64VarAccess, handle64Bytes)
+ else:
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ self.cgen.beginFor("uint32_t k = 0", "k < %s" % lenAccess, "++k")
+ self.cgen.stmt("uint64_t tmpval = %s(%s[k])" % (mapFunc64, access))
+ self.cgen.stmt("memcpy(%s_ptr + k * 8, &tmpval, sizeof(uint64_t))" % (handle64Var))
+ self.cgen.endFor()
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+ self.genPtrIncr("8 * %s" % lenAccess)
+ else:
+ if "1" == lenAccess:
+ self.genStreamCall(handle64VarType, handle64VarAccess, handle64Bytes)
+ self.cgen.stmt("*%s%s = (%s)%s((%s)(*%s))" % (
+ self.makeCastExpr(vulkanType.getForNonConstAccess()), access,
+ vulkanType.typeName, mapFunc, vulkanType.typeName, handle64VarAccess))
+ else:
+ self.genPtrIncr("8 * %s" % lenAccess)
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ self.cgen.beginFor("uint32_t k = 0", "k < %s" % lenAccess, "++k")
+ self.cgen.stmt("uint64_t tmpval; memcpy(&tmpval, %s_ptr + k * 8, sizeof(uint64_t))" % handle64Var)
+ self.cgen.stmt("*((%s%s) + k) = (%s)%s((%s)tmpval)" % (
+ self.makeCastExpr(vulkanType.getForNonConstAccess()), access,
+ vulkanType.typeName, mapFunc, vulkanType.typeName))
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+ self.cgen.endFor()
+
+ if lenAccess != "1":
+ self.cgen.endIf()
+
+ def doAllocSpace(self, vulkanType):
+ if self.dynAlloc and self.direction == "read":
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ sizeof = self.cgen.sizeofExpr(vulkanType.getForValueAccess())
+ if lenAccess:
+ bytesExpr = "%s * %s" % (lenAccess, sizeof)
+ else:
+ bytesExpr = sizeof
+ lenAccess = "1"
+
+ if self.stackVar:
+ if self.stackArrSize != lenAccess:
+ self.cgen.beginIf("%s <= %s" % (lenAccess, self.stackArrSize))
+
+ self.cgen.stmt(
+ "%s = %s%s" % (access, self.makeCastExpr(vulkanType.getForNonConstAccess()), self.stackVar))
+
+ if self.stackArrSize != lenAccess:
+ self.cgen.endIf()
+ self.cgen.beginElse()
+
+ if self.stackArrSize != lenAccess:
+ self.cgen.stmt(
+ "%s->alloc((void**)&%s, %s)" %
+ (self.streamVarName,
+ access, bytesExpr))
+
+ if self.stackArrSize != lenAccess:
+ self.cgen.endIf()
+ else:
+ self.cgen.stmt(
+ "%s->alloc((void**)&%s, %s)" %
+ (self.streamVarName,
+ access, bytesExpr))
+
+ def getOptionalStringFeatureExpr(self, vulkanType):
+ streamFeature = vulkanType.getProtectStreamFeature()
+ if streamFeature is None:
+ return None
+ return "%s->getFeatureBits() & %s" % (self.streamVarName, streamFeature)
+
+ def onCheck(self, vulkanType):
+ if self.forApiOutput:
+ return
+
+ featureExpr = self.getOptionalStringFeatureExpr(vulkanType)
+ self.checked = True
+ access = self.exprAccessor(vulkanType)
+ needConsistencyCheck = False
+
+ self.cgen.line("// WARNING PTR CHECK")
+ if (self.dynAlloc and self.direction == "read") or self.direction == "write":
+ checkAccess = self.exprAccessor(vulkanType)
+ addrExpr = "&" + checkAccess
+ sizeExpr = self.cgen.sizeofExpr(vulkanType)
+ else:
+ checkName = "check_%s" % vulkanType.paramName
+ self.cgen.stmt("%s %s" % (
+ self.cgen.makeCTypeDecl(vulkanType, useParamName = False), checkName))
+ checkAccess = checkName
+ addrExpr = "&" + checkAccess
+ sizeExpr = self.cgen.sizeofExpr(vulkanType)
+ needConsistencyCheck = True
+
+ if featureExpr is not None:
+ self.cgen.beginIf(featureExpr)
+
+ self.genPrimitiveStreamCall(
+ vulkanType,
+ checkAccess)
+
+ if featureExpr is not None:
+ self.cgen.endIf()
+
+ if featureExpr is not None:
+ self.cgen.beginIf("(!(%s) || %s)" % (featureExpr, access))
+ else:
+ self.cgen.beginIf(access)
+
+ if needConsistencyCheck and featureExpr is None:
+ self.cgen.beginIf("!(%s)" % checkName)
+ self.cgen.stmt(
+ "fprintf(stderr, \"fatal: %s inconsistent between guest and host\\n\")" % (access))
+ self.cgen.endIf()
+
+ def onCheckWithNullOptionalStringFeature(self, vulkanType):
+ self.cgen.beginIf("%s->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT" % self.streamVarName)
+ self.onCheck(vulkanType)
+
+ def endCheckWithNullOptionalStringFeature(self, vulkanType):
+ self.endCheck(vulkanType)
+ self.cgen.endIf()
+ self.cgen.beginElse()
+
+ def finalCheckWithNullOptionalStringFeature(self, vulkanType):
+ self.cgen.endElse()
+
+ def endCheck(self, vulkanType):
+
+ if self.checked:
+ self.cgen.endIf()
+ self.checked = False
+
+ def genFilterFunc(self, filterfunc, env):
+
+ def loop(expr, lambdaEnv={}):
+ def do_func(expr):
+ fnamestr = expr.name.name
+ if "not" == fnamestr:
+ return "!(%s)" % (loop(expr.args[0], lambdaEnv))
+ if "eq" == fnamestr:
+ return "(%s == %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "and" == fnamestr:
+ return "(%s && %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "or" == fnamestr:
+ return "(%s || %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "bitwise_and" == fnamestr:
+ return "(%s & %s)" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv))
+ if "getfield" == fnamestr:
+ ptrlevels = get_ptrlevels(expr.args[0].val.name)
+ if ptrlevels == 0:
+ return "%s.%s" % (loop(expr.args[0], lambdaEnv), expr.args[1].val)
+ else:
+ return "(%s(%s)).%s" % ("*" * ptrlevels, loop(expr.args[0], lambdaEnv), expr.args[1].val)
+
+ if "if" == fnamestr:
+ return "((%s) ? (%s) : (%s))" % (loop(expr.args[0], lambdaEnv), loop(expr.args[1], lambdaEnv), loop(expr.args[2], lambdaEnv))
+
+ return "%s(%s)" % (fnamestr, ", ".join(map(lambda e: loop(e, lambdaEnv), expr.args)))
+
+ def do_expratom(atomname, lambdaEnv= {}):
+ if lambdaEnv.get(atomname, None) is not None:
+ return atomname
+
+ enventry = env.get(atomname, None)
+ if None != enventry:
+ return self.getEnvAccessExpr(atomname)
+ return atomname
+
+ def get_ptrlevels(atomname, lambdaEnv= {}):
+ if lambdaEnv.get(atomname, None) is not None:
+ return 0
+
+ enventry = env.get(atomname, None)
+ if None != enventry:
+ return self.getPointerIndirectionLevels(atomname)
+
+ return 0
+
+ def do_exprval(expr, lambdaEnv= {}):
+ expratom = expr.val
+
+ if Atom == type(expratom):
+ return do_expratom(expratom.name, lambdaEnv)
+
+ return "%s" % expratom
+
+ def do_lambda(expr, lambdaEnv= {}):
+ params = expr.vs
+ body = expr.body
+ newEnv = {}
+
+ for (k, v) in lambdaEnv.items():
+ newEnv[k] = v
+
+ for p in params:
+ newEnv[p.name] = p.typ
+
+ return "[](%s) { return %s; }" % (", ".join(list(map(lambda p: "%s %s" % (p.typ, p.name), params))), loop(body, lambdaEnv=newEnv))
+
+ if FuncExpr == type(expr):
+ return do_func(expr)
+ if FuncLambda == type(expr):
+ return do_lambda(expr)
+ elif FuncExprVal == type(expr):
+ return do_exprval(expr)
+
+ return loop(filterfunc)
+
+ def beginFilterGuard(self, vulkanType):
+ if vulkanType.filterVar == None:
+ return
+
+ if self.doFiltering == False:
+ return
+
+ filterVarAccess = self.getEnvAccessExpr(vulkanType.filterVar)
+
+ filterValsExpr = None
+ filterFuncExpr = None
+ filterExpr = None
+
+ filterFeature = "%s->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT" % self.streamVarName
+
+ if None != vulkanType.filterVals:
+ filterValsExpr = " || ".join(map(lambda filterval: "(%s == %s)" % (filterval, filterVarAccess), vulkanType.filterVals))
+
+ if None != vulkanType.filterFunc:
+ filterFuncExpr = self.genFilterFunc(vulkanType.filterFunc, self.currentStructInfo.environment)
+
+ if None != filterValsExpr and None != filterFuncExpr:
+ filterExpr = "%s || %s" % (filterValsExpr, filterFuncExpr)
+ elif None == filterValsExpr and None == filterFuncExpr:
+ # Assume is bool
+ self.cgen.beginIf(filterVarAccess)
+ elif None != filterValsExpr:
+ self.cgen.beginIf("(!(%s) || (%s))" % (filterFeature, filterValsExpr))
+ elif None != filterFuncExpr:
+ self.cgen.beginIf("(!(%s) || (%s))" % (filterFeature, filterFuncExpr))
+
+ def endFilterGuard(self, vulkanType, cleanupExpr=None):
+ if vulkanType.filterVar == None:
+ return
+
+ if self.doFiltering == False:
+ return
+
+ if cleanupExpr == None:
+ self.cgen.endIf()
+ else:
+ self.cgen.endIf()
+ self.cgen.beginElse()
+ self.cgen.stmt(cleanupExpr)
+ self.cgen.endElse()
+
+ def getEnvAccessExpr(self, varName):
+ parentEnvEntry = self.currentStructInfo.environment.get(varName, None)
+
+ if parentEnvEntry != None:
+ isParentMember = parentEnvEntry["structmember"]
+
+ if isParentMember:
+ envAccess = self.exprValueAccessor(list(filter(lambda member: member.paramName == varName, self.currentStructInfo.members))[0])
+ else:
+ envAccess = varName
+ return envAccess
+
+ return None
+
+ def getPointerIndirectionLevels(self, varName):
+ parentEnvEntry = self.currentStructInfo.environment.get(varName, None)
+
+ if parentEnvEntry != None:
+ isParentMember = parentEnvEntry["structmember"]
+
+ if isParentMember:
+ return list(filter(lambda member: member.paramName == varName, self.currentStructInfo.members))[0].pointerIndirectionLevels
+ else:
+ return 0
+ return 0
+
+ return 0
+
+
+ def onCompoundType(self, vulkanType):
+
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+
+ self.beginFilterGuard(vulkanType)
+
+ if vulkanType.pointerIndirectionLevels > 0:
+ self.doAllocSpace(vulkanType)
+
+ if lenAccess is not None:
+ loopVar = "i"
+ access = "%s + %s" % (access, loopVar)
+ forInit = "uint32_t %s = 0" % loopVar
+ forCond = "%s < (uint32_t)%s" % (loopVar, lenAccess)
+ forIncr = "++%s" % loopVar
+ self.cgen.beginFor(forInit, forCond, forIncr)
+
+ accessWithCast = "%s(%s)" % (self.makeCastExpr(
+ self.getTypeForStreaming(vulkanType)), access)
+
+ callParams = [self.streamVarName, self.rootTypeVarName, accessWithCast, self.ptrVar]
+
+ for (bindName, localName) in vulkanType.binds.items():
+ callParams.append(self.getEnvAccessExpr(localName))
+
+ self.cgen.funcCall(None, self.marshalPrefix + vulkanType.typeName,
+ callParams)
+
+ if lenAccess is not None:
+ self.cgen.endFor()
+
+ if self.direction == "read":
+ self.endFilterGuard(vulkanType, "%s = 0" % self.exprAccessor(vulkanType))
+ else:
+ self.endFilterGuard(vulkanType)
+
+ def onString(self, vulkanType):
+ access = self.exprAccessor(vulkanType)
+
+ if self.direction == "write":
+ self.cgen.beginBlock()
+ self.cgen.stmt("uint32_t l = %s ? strlen(%s): 0" % (access, access))
+ self.genMemcpyAndIncr(self.ptrVar, "(uint32_t*)" ,"&l", "sizeof(uint32_t)", toBe = True, actualSize = 4)
+ self.genMemcpyAndIncr(self.ptrVar, "(char*)", access, "l")
+ self.cgen.endBlock()
+ else:
+ castExpr = \
+ self.makeCastExpr( \
+ self.getTypeForStreaming( \
+ vulkanType.getForAddressAccess()))
+ self.cgen.stmt( \
+ "%s->loadStringInPlaceWithStreamPtr(%s&%s, %s)" % (self.streamVarName, castExpr, access, self.ptrVar))
+
+ def onStringArray(self, vulkanType):
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ if self.direction == "write":
+ self.cgen.beginBlock()
+
+ self.cgen.stmt("uint32_t c = 0")
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ self.cgen.stmt("c = %s" % (lenAccess))
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+ self.genMemcpyAndIncr(self.ptrVar, "(uint32_t*)" ,"&c", "sizeof(uint32_t)", toBe = True, actualSize = 4)
+
+ self.cgen.beginFor("uint32_t i = 0", "i < c", "++i")
+ self.cgen.stmt("uint32_t l = %s ? strlen(%s[i]): 0" % (access, access))
+ self.genMemcpyAndIncr(self.ptrVar, "(uint32_t*)" ,"&l", "sizeof(uint32_t)", toBe = True, actualSize = 4)
+ self.cgen.beginIf("l")
+ self.genMemcpyAndIncr(self.ptrVar, "(char*)", "(%s[i])" % access, "l")
+ self.cgen.endIf()
+ self.cgen.endFor()
+
+ self.cgen.endBlock()
+ else:
+ castExpr = \
+ self.makeCastExpr( \
+ self.getTypeForStreaming( \
+ vulkanType.getForAddressAccess()))
+
+ self.cgen.stmt("%s->loadStringArrayInPlaceWithStreamPtr(%s&%s, %s)" % (self.streamVarName, castExpr, access, self.ptrVar))
+
+ def onStaticArr(self, vulkanType):
+ access = self.exprValueAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ finalLenExpr = "%s * %s" % (lenAccess, self.cgen.sizeofExpr(vulkanType))
+ self.genStreamCall(vulkanType, access, finalLenExpr)
+
+ # Old version VkEncoder may have some sType values conflict with VkDecoder
+ # of new versions. For host decoder, it should not carry the incorrect old
+ # sType values to the |forUnmarshaling| struct. Instead it should overwrite
+ # the sType value.
+ def overwriteSType(self, vulkanType):
+ if self.direction == "read":
+ sTypeParam = copy(vulkanType)
+ sTypeParam.paramName = "sType"
+ sTypeAccess = self.exprAccessor(sTypeParam)
+
+ typeName = vulkanType.parent.typeName
+ if typeName in STYPE_OVERRIDE:
+ self.cgen.stmt("%s = %s" %
+ (sTypeAccess, STYPE_OVERRIDE[typeName]))
+
+ def onStructExtension(self, vulkanType):
+ self.overwriteSType(vulkanType)
+
+ sTypeParam = copy(vulkanType)
+ sTypeParam.paramName = "sType"
+
+ access = self.exprAccessor(vulkanType)
+ sizeVar = "%s_size" % vulkanType.paramName
+
+ if self.direction == "read":
+ castedAccessExpr = "(%s)(%s)" % ("void*", access)
+ else:
+ castedAccessExpr = access
+
+ sTypeAccess = self.exprAccessor(sTypeParam)
+ self.cgen.beginIf("%s == VK_STRUCTURE_TYPE_MAX_ENUM" % self.rootTypeVarName)
+ self.cgen.stmt("%s = %s" % (self.rootTypeVarName, sTypeAccess))
+ self.cgen.endIf()
+
+ if self.direction == "read" and self.dynAlloc:
+ self.cgen.stmt("uint32_t %s" % sizeVar)
+
+ self.genMemcpyAndIncr(self.ptrVar, "(uint32_t*)", "&" + sizeVar, "sizeof(uint32_t)", toBe = True, actualSize = 4)
+
+ self.cgen.stmt("%s = nullptr" % access)
+ self.cgen.beginIf(sizeVar)
+ self.cgen.stmt( \
+ "%s->alloc((void**)&%s, sizeof(VkStructureType))" %
+ (self.streamVarName, access))
+
+ self.genStreamCall(vulkanType, access, "sizeof(VkStructureType)")
+ self.cgen.stmt("VkStructureType extType = *(VkStructureType*)(%s)" % access)
+ self.cgen.stmt( \
+ "%s->alloc((void**)&%s, %s(%s->getFeatureBits(), %s, %s))" %
+ (self.streamVarName, access, EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME, self.streamVarName, self.rootTypeVarName, access))
+ self.cgen.stmt("*(VkStructureType*)%s = extType" % access)
+
+ self.cgen.funcCall(None, self.marshalPrefix + "extension_struct",
+ [self.streamVarName, self.rootTypeVarName, castedAccessExpr, self.ptrVar])
+ self.cgen.endIf()
+ else:
+
+ self.cgen.funcCall(None, self.marshalPrefix + "extension_struct",
+ [self.streamVarName, self.rootTypeVarName, castedAccessExpr, self.ptrVar])
+
+ def onPointer(self, vulkanType):
+ access = self.exprAccessor(vulkanType)
+
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ self.beginFilterGuard(vulkanType)
+ self.doAllocSpace(vulkanType)
+
+ if vulkanType.filterVar != None:
+ print("onPointer Needs filter: %s filterVar %s" % (access, vulkanType.filterVar))
+
+ if vulkanType.isHandleType() and self.mapHandles:
+ self.genHandleMappingCall(
+ vulkanType, access, lenAccess, lenAccessGuard)
+ else:
+ if self.typeInfo.isNonAbiPortableType(vulkanType.typeName):
+ if lenAccess is not None:
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ self.cgen.beginFor("uint32_t i = 0", "i < (uint32_t)%s" % lenAccess, "++i")
+ self.genPrimitiveStreamCall(vulkanType.getForValueAccess(), "%s[i]" % access)
+ self.cgen.endFor()
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+ else:
+ self.genPrimitiveStreamCall(vulkanType.getForValueAccess(), "(*%s)" % access)
+ else:
+ if lenAccess is not None:
+ finalLenExpr = "%s * %s" % (
+ lenAccess, self.cgen.sizeofExpr(vulkanType.getForValueAccess()))
+ else:
+ finalLenExpr = "%s" % (
+ self.cgen.sizeofExpr(vulkanType.getForValueAccess()))
+ self.genStreamCall(vulkanType, access, finalLenExpr)
+
+ if self.direction == "read":
+ self.endFilterGuard(vulkanType, "%s = 0" % access)
+ else:
+ self.endFilterGuard(vulkanType)
+
+ def onValue(self, vulkanType):
+ self.beginFilterGuard(vulkanType)
+
+ if vulkanType.isHandleType() and self.mapHandles:
+ access = self.exprAccessor(vulkanType)
+ if vulkanType.filterVar != None:
+ print("onValue Needs filter: %s filterVar %s" % (access, vulkanType.filterVar))
+ self.genHandleMappingCall(
+ vulkanType.getForAddressAccess(), access, "1", None)
+ elif self.typeInfo.isNonAbiPortableType(vulkanType.typeName):
+ access = self.exprPrimitiveValueAccessor(vulkanType)
+ self.genPrimitiveStreamCall(vulkanType, access)
+ else:
+ access = self.exprAccessor(vulkanType)
+ self.genStreamCall(vulkanType, access, self.cgen.sizeofExpr(vulkanType))
+
+ self.endFilterGuard(vulkanType)
+
+ def streamLetParameter(self, structInfo, letParamInfo):
+ filterFeature = "%s->getFeatureBits() & VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT" % self.streamVarName
+ self.cgen.stmt("%s %s = 1" % (letParamInfo.typeName, letParamInfo.paramName))
+
+ self.cgen.beginIf(filterFeature)
+
+ if self.direction == "write":
+ bodyExpr = self.currentStructInfo.environment[letParamInfo.paramName]["body"]
+ self.cgen.stmt("%s = %s" % (letParamInfo.paramName, self.genFilterFunc(bodyExpr, self.currentStructInfo.environment)))
+
+ self.genPrimitiveStreamCall(letParamInfo, letParamInfo.paramName)
+
+ self.cgen.endIf()
+
+class VulkanReservedMarshaling(VulkanWrapperGenerator):
+
+ def __init__(self, module, typeInfo, variant="host"):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.cgenHeader = CodeGen()
+ self.cgenImpl = CodeGen()
+
+ self.variant = variant
+
+ self.currentFeature = None
+ self.apiOpcodes = {}
+ self.dynAlloc = self.variant != "guest"
+ self.ptrVarName = "ptr"
+ self.ptrVarType = makeVulkanTypeSimple(False, "uint8_t", 2, self.ptrVarName)
+ self.ptrVarTypeUnmarshal = makeVulkanTypeSimple(False, "uint8_t", 2, self.ptrVarName)
+
+ if self.variant == "guest":
+ self.marshalingParams = PARAMETERS_MARSHALING_GUEST
+ else:
+ self.marshalingParams = PARAMETERS_MARSHALING
+
+ self.writeCodegen = \
+ VulkanReservedMarshalingCodegen(
+ None,
+ self.variant,
+ VULKAN_STREAM_VAR_NAME,
+ ROOT_TYPE_VAR_NAME,
+ MARSHAL_INPUT_VAR_NAME,
+ self.ptrVarName,
+ API_PREFIX_RESERVEDMARSHAL,
+ "get_host_u64_" if "guest" == self.variant else "",
+ direction = "write")
+
+ self.readCodegen = \
+ VulkanReservedMarshalingCodegen(
+ None,
+ self.variant,
+ VULKAN_STREAM_VAR_NAME,
+ ROOT_TYPE_VAR_NAME,
+ UNMARSHAL_INPUT_VAR_NAME,
+ self.ptrVarName,
+ API_PREFIX_RESERVEDUNMARSHAL,
+ "unbox_" if "host" == self.variant else "",
+ direction = "read",
+ dynAlloc=self.dynAlloc)
+
+ self.knownDefs = {}
+
+ self.extensionMarshalPrototype = \
+ VulkanAPI(API_PREFIX_RESERVEDMARSHAL + "extension_struct",
+ STREAM_RET_TYPE,
+ self.marshalingParams +
+ [STRUCT_EXTENSION_PARAM, self.ptrVarType])
+
+ self.extensionUnmarshalPrototype = \
+ VulkanAPI(API_PREFIX_RESERVEDUNMARSHAL + "extension_struct",
+ STREAM_RET_TYPE,
+ self.marshalingParams +
+ [STRUCT_EXTENSION_PARAM_FOR_WRITE, self.ptrVarTypeUnmarshal])
+
+ def onBegin(self,):
+ VulkanWrapperGenerator.onBegin(self)
+ self.module.appendImpl(self.cgenImpl.makeFuncDecl(self.extensionMarshalPrototype))
+ self.module.appendImpl(self.cgenImpl.makeFuncDecl(self.extensionUnmarshalPrototype))
+
+ def onBeginFeature(self, featureName, featureType):
+ VulkanWrapperGenerator.onBeginFeature(self, featureName, featureType)
+ self.currentFeature = featureName
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ if name in self.knownDefs:
+ return
+
+ category = self.typeInfo.categoryOf(name)
+
+ if category in ["struct", "union"] and alias:
+ if self.variant != "host":
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncAlias(API_PREFIX_RESERVEDMARSHAL + name,
+ API_PREFIX_RESERVEDMARSHAL + alias))
+ if self.variant != "guest":
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncAlias(API_PREFIX_RESERVEDUNMARSHAL + name,
+ API_PREFIX_RESERVEDUNMARSHAL + alias))
+
+ if category in ["struct", "union"] and not alias:
+
+ structInfo = self.typeInfo.structs[name]
+
+ marshalParams = self.marshalingParams + \
+ [makeVulkanTypeSimple(True, name, 1, MARSHAL_INPUT_VAR_NAME),
+ self.ptrVarType]
+
+ freeParams = []
+ letParams = []
+
+ for (envname, bindingInfo) in list(sorted(structInfo.environment.items(), key = lambda kv: kv[0])):
+ if None == bindingInfo["binding"]:
+ freeParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname))
+ else:
+ if not bindingInfo["structmember"]:
+ letParams.append(makeVulkanTypeSimple(True, bindingInfo["type"], 0, envname))
+
+ marshalPrototype = \
+ VulkanAPI(API_PREFIX_RESERVEDMARSHAL + name,
+ STREAM_RET_TYPE,
+ marshalParams + freeParams)
+
+ marshalPrototypeNoFilter = \
+ VulkanAPI(API_PREFIX_RESERVEDMARSHAL + name,
+ STREAM_RET_TYPE,
+ marshalParams)
+
+ def structMarshalingCustom(cgen):
+ self.writeCodegen.cgen = cgen
+ self.writeCodegen.currentStructInfo = structInfo
+ marshalingCode = \
+ CUSTOM_MARSHAL_TYPES[name]["common"] + \
+ CUSTOM_MARSHAL_TYPES[name]["reservedmarshaling"].format(
+ streamVarName=self.writeCodegen.streamVarName,
+ rootTypeVarName=self.writeCodegen.rootTypeVarName,
+ inputVarName=self.writeCodegen.inputVarName,
+ newInputVarName=self.writeCodegen.inputVarName + "_new")
+ for line in marshalingCode.split('\n'):
+ cgen.line(line)
+
+ def structMarshalingDef(cgen):
+ self.writeCodegen.cgen = cgen
+ self.writeCodegen.currentStructInfo = structInfo
+ self.writeCodegen.cgen.stmt("(void)%s" % VULKAN_STREAM_VAR_NAME)
+ self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
+
+ if category == "struct":
+ # marshal 'let' parameters first
+ for letp in letParams:
+ self.writeCodegen.streamLetParameter(self.typeInfo, letp)
+
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.writeCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.writeCodegen)
+
+ def structMarshalingDefNoFilter(cgen):
+ self.writeCodegen.cgen = cgen
+ self.writeCodegen.currentStructInfo = structInfo
+ self.writeCodegen.doFiltering = False
+ self.writeCodegen.cgen.stmt("(void)%s" % VULKAN_STREAM_VAR_NAME)
+ self.writeCodegen.cgen.stmt("(void)%s" % ROOT_TYPE_VAR_NAME)
+
+ if category == "struct":
+ # marshal 'let' parameters first
+ for letp in letParams:
+ self.writeCodegen.streamLetParameter(self.typeInfo, letp)
+
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.writeCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.writeCodegen)
+ self.writeCodegen.doFiltering = True
+
+ if self.variant != "host":
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(marshalPrototype))
+
+ if name in CUSTOM_MARSHAL_TYPES:
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ marshalPrototype, structMarshalingCustom))
+ else:
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ marshalPrototype, structMarshalingDef))
+
+ if freeParams != []:
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(marshalPrototypeNoFilter))
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ marshalPrototypeNoFilter, structMarshalingDefNoFilter))
+
+ unmarshalPrototype = \
+ VulkanAPI(API_PREFIX_RESERVEDUNMARSHAL + name,
+ STREAM_RET_TYPE,
+ self.marshalingParams + [makeVulkanTypeSimple(False, name, 1, UNMARSHAL_INPUT_VAR_NAME), self.ptrVarTypeUnmarshal] + freeParams)
+
+ unmarshalPrototypeNoFilter = \
+ VulkanAPI(API_PREFIX_RESERVEDUNMARSHAL + name,
+ STREAM_RET_TYPE,
+ self.marshalingParams + [makeVulkanTypeSimple(False, name, 1, UNMARSHAL_INPUT_VAR_NAME), self.ptrVarTypeUnmarshal])
+
+ def structUnmarshalingCustom(cgen):
+ self.readCodegen.cgen = cgen
+ self.readCodegen.currentStructInfo = structInfo
+ unmarshalingCode = \
+ CUSTOM_MARSHAL_TYPES[name]["common"] + \
+ CUSTOM_MARSHAL_TYPES[name]["reservedunmarshaling"].format(
+ streamVarName=self.readCodegen.streamVarName,
+ rootTypeVarName=self.readCodegen.rootTypeVarName,
+ inputVarName=self.readCodegen.inputVarName,
+ newInputVarName=self.readCodegen.inputVarName + "_new")
+ for line in unmarshalingCode.split('\n'):
+ cgen.line(line)
+
+ def structUnmarshalingDef(cgen):
+ self.readCodegen.cgen = cgen
+ self.readCodegen.currentStructInfo = structInfo
+ if category == "struct":
+ # unmarshal 'let' parameters first
+ for letp in letParams:
+ self.readCodegen.streamLetParameter(self.typeInfo, letp)
+
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.readCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.readCodegen)
+
+ def structUnmarshalingDefNoFilter(cgen):
+ self.readCodegen.cgen = cgen
+ self.readCodegen.currentStructInfo = structInfo
+ self.readCodegen.doFiltering = False
+ if category == "struct":
+ # unmarshal 'let' parameters first
+ for letp in letParams:
+ iterateVulkanType(self.typeInfo, letp, self.readCodegen)
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member, self.readCodegen)
+ if category == "union":
+ iterateVulkanType(self.typeInfo, structInfo.members[0], self.readCodegen)
+ self.readCodegen.doFiltering = True
+
+ if self.variant != "guest":
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(unmarshalPrototype))
+
+ if name in CUSTOM_MARSHAL_TYPES:
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ unmarshalPrototype, structUnmarshalingCustom))
+ else:
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ unmarshalPrototype, structUnmarshalingDef))
+
+ if freeParams != []:
+ self.module.appendHeader(
+ self.cgenHeader.makeFuncDecl(unmarshalPrototypeNoFilter))
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ unmarshalPrototypeNoFilter, structUnmarshalingDefNoFilter))
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ def doExtensionStructMarshalingCodegen(self, cgen, retType, extParam, forEach, funcproto, direction):
+ accessVar = "structAccess"
+ sizeVar = "currExtSize"
+ cgen.stmt("VkInstanceCreateInfo* %s = (VkInstanceCreateInfo*)(%s)" % (accessVar, extParam.paramName))
+ cgen.stmt("uint32_t %s = %s(%s->getFeatureBits(), %s, %s)" % (sizeVar, EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME, VULKAN_STREAM_VAR_NAME, ROOT_TYPE_VAR_NAME, extParam.paramName))
+
+ cgen.beginIf("!%s && %s" % (sizeVar, extParam.paramName))
+
+ cgen.line("// unknown struct extension; skip and call on its pNext field");
+ cgen.funcCall(None, funcproto.name, ["vkStream", ROOT_TYPE_VAR_NAME, "(void*)%s->pNext" % accessVar, self.ptrVarName])
+ cgen.stmt("return")
+
+ cgen.endIf()
+ cgen.beginElse()
+
+ cgen.line("// known or null extension struct")
+
+ streamNamespace = "gfxstream::guest" if self.variant == "guest" else "android::base"
+
+ if direction == "write":
+ cgen.stmt("memcpy(*%s, &%s, sizeof(uint32_t));" % (self.ptrVarName, sizeVar))
+ cgen.stmt("%s::Stream::toBe32((uint8_t*)*%s); *%s += sizeof(uint32_t)" % (streamNamespace, self.ptrVarName, self.ptrVarName))
+ elif not self.dynAlloc:
+ cgen.stmt("memcpy(&%s, *%s, sizeof(uint32_t));" % (sizeVar, self.ptrVarName))
+ cgen.stmt("%s::Stream::fromBe32((uint8_t*)&%s); *%s += sizeof(uint32_t)" % (streamNamespace, sizeVar, self.ptrVarName))
+
+ cgen.beginIf("!%s" % (sizeVar))
+ cgen.line("// exit if this was a null extension struct (size == 0 in this branch)")
+ cgen.stmt("return")
+ cgen.endIf()
+
+ cgen.endIf()
+
+ # Now we can do stream stuff
+ if direction == "write":
+ cgen.stmt("memcpy(*%s, %s, sizeof(VkStructureType)); *%s += sizeof(VkStructureType)" % (self.ptrVarName, extParam.paramName, self.ptrVarName))
+ elif not self.dynAlloc:
+ cgen.stmt("uint64_t pNext_placeholder")
+ placeholderAccess = "(&pNext_placeholder)"
+ cgen.stmt("memcpy(%s, *%s, sizeof(VkStructureType)); *%s += sizeof(VkStructureType)" % (placeholderAccess, self.ptrVarName, self.ptrVarName))
+ cgen.stmt("(void)pNext_placeholder")
+
+ def fatalDefault(cgen):
+ cgen.line("// fatal; the switch is only taken if the extension struct is known");
+ cgen.stmt("abort()")
+ pass
+
+ self.emitForEachStructExtension(
+ cgen,
+ retType,
+ extParam,
+ forEach,
+ defaultEmit=fatalDefault,
+ rootTypeVar=ROOT_TYPE_PARAM)
+
+ def onEnd(self,):
+ VulkanWrapperGenerator.onEnd(self)
+
+ def forEachExtensionMarshal(ext, castedAccess, cgen):
+ cgen.funcCall(None, API_PREFIX_RESERVEDMARSHAL + ext.name,
+ [VULKAN_STREAM_VAR_NAME, ROOT_TYPE_VAR_NAME, castedAccess, self.ptrVarName])
+
+ def forEachExtensionUnmarshal(ext, castedAccess, cgen):
+ cgen.funcCall(None, API_PREFIX_RESERVEDUNMARSHAL + ext.name,
+ [VULKAN_STREAM_VAR_NAME, ROOT_TYPE_VAR_NAME, castedAccess, self.ptrVarName])
+
+ if self.variant != "host":
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ self.extensionMarshalPrototype,
+ lambda cgen: self.doExtensionStructMarshalingCodegen(
+ cgen,
+ STREAM_RET_TYPE,
+ STRUCT_EXTENSION_PARAM,
+ forEachExtensionMarshal,
+ self.extensionMarshalPrototype,
+ "write")))
+
+ if self.variant != "guest":
+ self.module.appendImpl(
+ self.cgenImpl.makeFuncImpl(
+ self.extensionUnmarshalPrototype,
+ lambda cgen: self.doExtensionStructMarshalingCodegen(
+ cgen,
+ STREAM_RET_TYPE,
+ STRUCT_EXTENSION_PARAM_FOR_WRITE,
+ forEachExtensionUnmarshal,
+ self.extensionUnmarshalPrototype,
+ "read")))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/subdecode.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/subdecode.py
new file mode 100644
index 00000000000..3de2213a189
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/subdecode.py
@@ -0,0 +1,405 @@
+from .common.codegen import CodeGen, VulkanWrapperGenerator
+from .common.vulkantypes import VulkanAPI, iterateVulkanType, VulkanType
+
+from .reservedmarshaling import VulkanReservedMarshalingCodegen
+from .transform import TransformCodegen
+
+from .wrapperdefs import API_PREFIX_RESERVEDUNMARSHAL
+from .wrapperdefs import MAX_PACKET_LENGTH
+from .wrapperdefs import ROOT_TYPE_DEFAULT_VALUE
+
+
+decoder_decl_preamble = """
+"""
+
+decoder_impl_preamble = """
+"""
+
+global_state_prefix = "this->on_"
+
+READ_STREAM = "readStream"
+WRITE_STREAM = "vkStream"
+
+# Driver workarounds for APIs that don't work well multithreaded
+driver_workarounds_global_lock_apis = [
+ "vkCreatePipelineLayout",
+ "vkDestroyPipelineLayout",
+]
+
+MAX_STACK_ITEMS = "16"
+
+
+def emit_param_decl_for_reading(param, cgen):
+ if param.staticArrExpr:
+ cgen.stmt(
+ cgen.makeRichCTypeDecl(param.getForNonConstAccess()))
+ else:
+ cgen.stmt(
+ cgen.makeRichCTypeDecl(param))
+
+ if param.pointerIndirectionLevels > 0:
+ lenAccess = cgen.generalLengthAccess(param)
+ if not lenAccess:
+ lenAccess = "1"
+ arrSize = "1" if "1" == lenAccess else "MAX_STACK_ITEMS"
+
+ typeHere = "uint8_t*" if "void" == param.typeName else param.typeName
+ cgen.stmt("%s%s stack_%s[%s]" % (
+ typeHere, "*" * (param.pointerIndirectionLevels - 1), param.paramName, arrSize))
+
+
+def emit_unmarshal(typeInfo, param, cgen, output=False, destroy=False, noUnbox=False):
+ if destroy:
+ iterateVulkanType(typeInfo, param, VulkanReservedMarshalingCodegen(
+ cgen,
+ "host",
+ READ_STREAM,
+ ROOT_TYPE_DEFAULT_VALUE,
+ param.paramName,
+ "readStreamPtrPtr",
+ API_PREFIX_RESERVEDUNMARSHAL,
+ "",
+ direction="read",
+ dynAlloc=True))
+ lenAccess = cgen.generalLengthAccess(param)
+ lenAccessGuard = cgen.generalLengthAccessGuard(param)
+ if None == lenAccess or "1" == lenAccess:
+ cgen.stmt("boxed_%s_preserve = %s" %
+ (param.paramName, param.paramName))
+ cgen.stmt("%s = unbox_%s(%s)" %
+ (param.paramName, param.typeName, param.paramName))
+ else:
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+ cgen.beginFor("uint32_t i = 0", "i < %s" % lenAccess, "++i")
+ cgen.stmt("boxed_%s_preserve[i] = %s[i]" %
+ (param.paramName, param.paramName))
+ cgen.stmt("((%s*)(%s))[i] = unbox_%s(%s[i])" % (param.typeName,
+ param.paramName, param.typeName, param.paramName))
+ cgen.endFor()
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+ else:
+ if noUnbox:
+ cgen.line("// No unbox for %s" % (param.paramName))
+
+ lenAccess = cgen.generalLengthAccess(param)
+ if not lenAccess:
+ lenAccess = "1"
+ arrSize = "1" if "1" == lenAccess else "MAX_STACK_ITEMS"
+
+ iterateVulkanType(typeInfo, param, VulkanReservedMarshalingCodegen(
+ cgen,
+ "host",
+ READ_STREAM,
+ ROOT_TYPE_DEFAULT_VALUE,
+ param.paramName,
+ "readStreamPtrPtr",
+ API_PREFIX_RESERVEDUNMARSHAL,
+ "" if (output or noUnbox) else "unbox_",
+ direction="read",
+ dynAlloc=True,
+ stackVar="stack_%s" % param.paramName,
+ stackArrSize=arrSize))
+
+
+def emit_dispatch_unmarshal(typeInfo, param, cgen, globalWrapped):
+ if globalWrapped:
+ cgen.stmt(
+ "// Begin global wrapped dispatchable handle unboxing for %s" % param.paramName)
+ iterateVulkanType(typeInfo, param, VulkanReservedMarshalingCodegen(
+ cgen,
+ "host",
+ READ_STREAM,
+ ROOT_TYPE_DEFAULT_VALUE,
+ param.paramName,
+ "readStreamPtrPtr",
+ API_PREFIX_RESERVEDUNMARSHAL,
+ "",
+ direction="read",
+ dynAlloc=True))
+ else:
+ cgen.stmt(
+ "// Begin non wrapped dispatchable handle unboxing for %s" % param.paramName)
+ # cgen.stmt("%s->unsetHandleMapping()" % READ_STREAM)
+ iterateVulkanType(typeInfo, param, VulkanReservedMarshalingCodegen(
+ cgen,
+ "host",
+ READ_STREAM,
+ ROOT_TYPE_DEFAULT_VALUE,
+ param.paramName,
+ "readStreamPtrPtr",
+ API_PREFIX_RESERVEDUNMARSHAL,
+ "",
+ direction="read",
+ dynAlloc=True))
+ cgen.stmt("auto unboxed_%s = unbox_%s(%s)" %
+ (param.paramName, param.typeName, param.paramName))
+ cgen.stmt("auto vk = dispatch_%s(%s)" %
+ (param.typeName, param.paramName))
+ cgen.stmt("// End manual dispatchable handle unboxing for %s" %
+ param.paramName)
+
+
+def emit_transform(typeInfo, param, cgen, variant="tohost"):
+ res = \
+ iterateVulkanType(typeInfo, param, TransformCodegen(
+ cgen, param.paramName, "globalstate", "transform_%s_" % variant, variant))
+ if not res:
+ cgen.stmt("(void)%s" % param.paramName)
+
+# Everything here elides the initial arg
+
+
+class DecodingParameters(object):
+ def __init__(self, api: VulkanAPI):
+ self.params: list[VulkanType] = []
+ self.toRead: list[VulkanType] = []
+ self.toWrite: list[VulkanType] = []
+
+ for i, param in enumerate(api.parameters[1:]):
+ if i == 0 and param.isDispatchableHandleType():
+ param.dispatchHandle = True
+
+ if param.isNonDispatchableHandleType() and param.isCreatedBy(api):
+ param.nonDispatchableHandleCreate = True
+
+ if param.isNonDispatchableHandleType() and param.isDestroyedBy(api):
+ param.nonDispatchableHandleDestroy = True
+
+ if param.isDispatchableHandleType() and param.isCreatedBy(api):
+ param.dispatchableHandleCreate = True
+
+ if param.isDispatchableHandleType() and param.isDestroyedBy(api):
+ param.dispatchableHandleDestroy = True
+
+ self.toRead.append(param)
+
+ if param.possiblyOutput():
+ self.toWrite.append(param)
+
+ self.params.append(param)
+
+
+def emit_call_log(api, cgen):
+ decodingParams = DecodingParameters(api)
+ paramsToRead = decodingParams.toRead
+
+ # cgen.beginIf("m_logCalls")
+ paramLogFormat = "%p"
+ paramLogArgs = ["(void*)boxed_dispatchHandle"]
+
+ for p in paramsToRead:
+ paramLogFormat += "0x%llx "
+ for p in paramsToRead:
+ paramLogArgs.append("(unsigned long long)%s" % (p.paramName))
+ # cgen.stmt("fprintf(stderr, \"substream %%p: call %s %s\\n\", readStream, %s)" % (api.name, paramLogFormat, ", ".join(paramLogArgs)))
+ # cgen.endIf()
+
+
+def emit_decode_parameters(typeInfo, api, cgen, globalWrapped=False):
+
+ decodingParams = DecodingParameters(api)
+
+ paramsToRead = decodingParams.toRead
+
+ for p in paramsToRead:
+ emit_param_decl_for_reading(p, cgen)
+
+ i = 0
+ for p in paramsToRead:
+ lenAccess = cgen.generalLengthAccess(p)
+
+ if p.dispatchHandle:
+ emit_dispatch_unmarshal(typeInfo, p, cgen, globalWrapped)
+ else:
+ destroy = p.nonDispatchableHandleDestroy or p.dispatchableHandleDestroy
+ noUnbox = False
+
+ if p.nonDispatchableHandleDestroy or p.dispatchableHandleDestroy:
+ destroy = True
+ cgen.stmt(
+ "// Begin manual non dispatchable handle destroy unboxing for %s" % p.paramName)
+ if None == lenAccess or "1" == lenAccess:
+ cgen.stmt("%s boxed_%s_preserve" %
+ (p.typeName, p.paramName))
+ else:
+ cgen.stmt("%s* boxed_%s_preserve; %s->alloc((void**)&boxed_%s_preserve, %s * sizeof(%s))" %
+ (p.typeName, p.paramName, READ_STREAM, p.paramName, lenAccess, p.typeName))
+
+ if p.possiblyOutput():
+ cgen.stmt(
+ "// Begin manual dispatchable handle unboxing for %s" % p.paramName)
+ cgen.stmt("%s->unsetHandleMapping()" % READ_STREAM)
+
+ emit_unmarshal(typeInfo, p, cgen, output=p.possiblyOutput(
+ ), destroy=destroy, noUnbox=noUnbox)
+ i += 1
+
+ for p in paramsToRead:
+ emit_transform(typeInfo, p, cgen, variant="tohost")
+
+ emit_call_log(api, cgen)
+
+
+def emit_dispatch_call(api, cgen):
+
+ decodingParams = DecodingParameters(api)
+
+ customParams = ["(VkCommandBuffer)dispatchHandle"]
+
+ for (i, p) in enumerate(api.parameters[1:]):
+ customParam = p.paramName
+ if decodingParams.params[i].dispatchHandle:
+ customParam = "unboxed_%s" % p.paramName
+ customParams.append(customParam)
+
+ if api.name in driver_workarounds_global_lock_apis:
+ cgen.stmt("lock()")
+
+ cgen.vkApiCall(api, customPrefix="vk->", customParameters=customParams,
+ checkForDeviceLost=True, globalStatePrefix=global_state_prefix,
+ checkForOutOfMemory=True)
+
+ if api.name in driver_workarounds_global_lock_apis:
+ cgen.stmt("unlock()")
+
+
+def emit_global_state_wrapped_call(api, cgen, context=False):
+ customParams = ["pool", "(VkCommandBuffer)(boxed_dispatchHandle)"] + \
+ list(map(lambda p: p.paramName, api.parameters[1:]))
+ if context:
+ customParams += ["context"];
+ cgen.vkApiCall(api, customPrefix=global_state_prefix,
+ customParameters=customParams, checkForDeviceLost=True,
+ checkForOutOfMemory=True, globalStatePrefix=global_state_prefix)
+
+
+def emit_default_decoding(typeInfo, api, cgen):
+ emit_decode_parameters(typeInfo, api, cgen)
+ emit_dispatch_call(api, cgen)
+
+
+def emit_global_state_wrapped_decoding(typeInfo, api, cgen):
+ emit_decode_parameters(typeInfo, api, cgen, globalWrapped=True)
+ emit_global_state_wrapped_call(api, cgen)
+
+def emit_global_state_wrapped_decoding_with_context(typeInfo, api, cgen):
+ emit_decode_parameters(typeInfo, api, cgen, globalWrapped=True)
+ emit_global_state_wrapped_call(api, cgen, context=True)
+
+custom_decodes = {
+ "vkCmdCopyBufferToImage": emit_global_state_wrapped_decoding_with_context,
+ "vkCmdCopyImage": emit_global_state_wrapped_decoding,
+ "vkCmdCopyImageToBuffer": emit_global_state_wrapped_decoding,
+ "vkCmdCopyBufferToImage2": emit_global_state_wrapped_decoding_with_context,
+ "vkCmdCopyImage2": emit_global_state_wrapped_decoding,
+ "vkCmdCopyImageToBuffer2": emit_global_state_wrapped_decoding,
+ "vkCmdCopyBufferToImage2KHR": emit_global_state_wrapped_decoding_with_context,
+ "vkCmdCopyImage2KHR": emit_global_state_wrapped_decoding,
+ "vkCmdCopyImageToBuffer2KHR": emit_global_state_wrapped_decoding,
+ "vkCmdExecuteCommands": emit_global_state_wrapped_decoding,
+ "vkBeginCommandBuffer": emit_global_state_wrapped_decoding_with_context,
+ "vkEndCommandBuffer": emit_global_state_wrapped_decoding_with_context,
+ "vkResetCommandBuffer": emit_global_state_wrapped_decoding,
+ "vkCmdPipelineBarrier": emit_global_state_wrapped_decoding,
+ "vkCmdBindPipeline": emit_global_state_wrapped_decoding,
+ "vkCmdBindDescriptorSets": emit_global_state_wrapped_decoding,
+ "vkCmdCopyQueryPoolResults": emit_global_state_wrapped_decoding,
+ "vkBeginCommandBufferAsyncGOOGLE": emit_global_state_wrapped_decoding_with_context,
+ "vkEndCommandBufferAsyncGOOGLE": emit_global_state_wrapped_decoding_with_context,
+ "vkResetCommandBufferAsyncGOOGLE": emit_global_state_wrapped_decoding,
+ "vkCommandBufferHostSyncGOOGLE": emit_global_state_wrapped_decoding,
+}
+
+
+class VulkanSubDecoder(VulkanWrapperGenerator):
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+ self.typeInfo = typeInfo
+ self.cgen = CodeGen()
+
+ def onBegin(self,):
+ self.module.appendImpl(
+ "#define MAX_STACK_ITEMS %s\n" % MAX_STACK_ITEMS)
+
+ self.module.appendImpl(
+ "#define MAX_PACKET_LENGTH %s\n" % MAX_PACKET_LENGTH)
+
+ self.module.appendImpl(
+ "size_t subDecode(VulkanMemReadingStream* readStream, VulkanDispatch* vk, void* boxed_dispatchHandle, void* dispatchHandle, VkDeviceSize dataSize, const void* pData, const VkDecoderContext& context)\n")
+
+ self.cgen.beginBlock() # function body
+
+ self.cgen.stmt("auto& metricsLogger = *context.metricsLogger")
+ self.cgen.stmt("uint32_t count = 0")
+ self.cgen.stmt("unsigned char *buf = (unsigned char *)pData")
+ self.cgen.stmt("android::base::BumpPool* pool = readStream->pool()")
+ self.cgen.stmt("unsigned char *ptr = (unsigned char *)pData")
+ self.cgen.stmt(
+ "const unsigned char* const end = (const unsigned char*)buf + dataSize")
+ self.cgen.stmt(
+ "VkDecoderGlobalState* globalstate = VkDecoderGlobalState::get()")
+
+ self.cgen.line("while (end - ptr >= 8)")
+ self.cgen.beginBlock() # while loop
+
+ self.cgen.stmt("uint32_t opcode = *(uint32_t *)ptr")
+ self.cgen.stmt("uint32_t packetLen = *(uint32_t *)(ptr + 4)")
+ self.cgen.line("""
+ // packetLen should be at least 8 (op code and packet length) and should not be excessively large
+ if (packetLen < 8 || packetLen > MAX_PACKET_LENGTH) {
+ WARN("Bad packet length %d detected, subdecode may fail", packetLen);
+ metricsLogger.logMetricEvent(MetricEventBadPacketLength{ .len = packetLen });
+ }
+ """)
+ self.cgen.stmt("if (end - ptr < packetLen) return ptr - (unsigned char*)buf")
+
+
+ self.cgen.stmt("%s->setBuf((uint8_t*)(ptr + 8))" % READ_STREAM)
+ self.cgen.stmt(
+ "uint8_t* readStreamPtr = %s->getBuf(); uint8_t** readStreamPtrPtr = &readStreamPtr" % READ_STREAM)
+ self.cgen.line("switch (opcode)")
+ self.cgen.beginBlock() # switch stmt
+
+ self.module.appendImpl(self.cgen.swapCode())
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ typeInfo = self.typeInfo
+ cgen = self.cgen
+ api = typeInfo.apis[name]
+
+ if "commandBuffer" != api.parameters[0].paramName:
+ return
+
+ cgen.line("case OP_%s:" % name)
+ cgen.beginBlock()
+ cgen.stmt("android::base::beginTrace(\"%s subdecode\")" % name)
+
+ if api.name in custom_decodes.keys():
+ custom_decodes[api.name](typeInfo, api, cgen)
+ else:
+ emit_default_decoding(typeInfo, api, cgen)
+
+ cgen.stmt("android::base::endTrace()")
+ cgen.stmt("break")
+ cgen.endBlock()
+ self.module.appendImpl(self.cgen.swapCode())
+
+ def onEnd(self,):
+ self.cgen.line("default:")
+ self.cgen.beginBlock()
+ self.cgen.stmt(
+ "GFXSTREAM_ABORT(::emugl::FatalError(::emugl::ABORT_REASON_OTHER)) << \"Unrecognized opcode \" << opcode")
+ self.cgen.endBlock()
+
+ self.cgen.endBlock() # switch stmt
+
+ self.cgen.stmt("++count; if (count % 1000 == 0) { pool->freeAll(); }")
+ self.cgen.stmt("ptr += packetLen")
+ self.cgen.endBlock() # while loop
+
+ self.cgen.stmt("pool->freeAll()")
+ self.cgen.stmt("return ptr - (unsigned char*)buf;")
+ self.cgen.endBlock() # function body
+ self.module.appendImpl(self.cgen.swapCode())
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/testing.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/testing.py
new file mode 100644
index 00000000000..898532fc946
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/testing.py
@@ -0,0 +1,399 @@
+# 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.
+
+from copy import copy
+
+from .common.codegen import CodeGen
+from .common.vulkantypes import \
+ VulkanAPI, makeVulkanTypeSimple, iterateVulkanType, VulkanTypeIterator
+
+from .wrapperdefs import VulkanWrapperGenerator
+from .wrapperdefs import EQUALITY_VAR_NAMES
+from .wrapperdefs import EQUALITY_ON_FAIL_VAR
+from .wrapperdefs import EQUALITY_ON_FAIL_VAR_TYPE
+from .wrapperdefs import EQUALITY_RET_TYPE
+from .wrapperdefs import API_PREFIX_EQUALITY
+from .wrapperdefs import STRUCT_EXTENSION_PARAM, STRUCT_EXTENSION_PARAM2
+
+class VulkanEqualityCodegen(VulkanTypeIterator):
+
+ def __init__(self, cgen, inputVars, onFailCompareVar, prefix):
+ self.cgen = cgen
+ self.inputVars = inputVars
+ self.onFailCompareVar = onFailCompareVar
+ self.prefix = prefix
+
+ def makeAccess(varName, asPtr = True):
+ return lambda t: self.cgen.generalAccess(t, parentVarName = varName, asPtr = asPtr)
+
+ def makeLengthAccess(varName):
+ return lambda t: self.cgen.generalLengthAccess(t, parentVarName = varName)
+
+ def makeLengthAccessGuard(varName):
+ return lambda t: self.cgen.generalLengthAccessGuard(t, parentVarName=varName)
+
+ self.exprAccessorLhs = makeAccess(self.inputVars[0])
+ self.exprAccessorRhs = makeAccess(self.inputVars[1])
+
+ self.exprAccessorValueLhs = makeAccess(self.inputVars[0], asPtr = False)
+ self.exprAccessorValueRhs = makeAccess(self.inputVars[1], asPtr = False)
+
+ self.lenAccessorLhs = makeLengthAccess(self.inputVars[0])
+ self.lenAccessorRhs = makeLengthAccess(self.inputVars[1])
+
+ self.lenAccessGuardLhs = makeLengthAccessGuard(self.inputVars[0])
+ self.lenAccessGuardRhs = makeLengthAccessGuard(self.inputVars[1])
+
+ self.checked = False
+
+ def getTypeForCompare(self, vulkanType):
+ res = copy(vulkanType)
+
+ if not vulkanType.accessibleAsPointer():
+ res = res.getForAddressAccess()
+
+ if vulkanType.staticArrExpr:
+ res = res.getForAddressAccess()
+
+ return res
+
+ def makeCastExpr(self, vulkanType):
+ return "(%s)" % (
+ self.cgen.makeCTypeDecl(vulkanType, useParamName=False))
+
+ def makeEqualExpr(self, lhs, rhs):
+ return "(%s) == (%s)" % (lhs, rhs)
+
+ def makeEqualBufExpr(self, lhs, rhs, size):
+ return "(memcmp(%s, %s, %s) == 0)" % (lhs, rhs, size)
+
+ def makeEqualStringExpr(self, lhs, rhs):
+ return "(strcmp(%s, %s) == 0)" % (lhs, rhs)
+
+ def makeBothNotNullExpr(self, lhs, rhs):
+ return "(%s) && (%s)" % (lhs, rhs)
+
+ def makeBothNullExpr(self, lhs, rhs):
+ return "!(%s) && !(%s)" % (lhs, rhs)
+
+ def compareWithConsequence(self, compareExpr, vulkanType, errMsg=""):
+ self.cgen.stmt("if (!(%s)) { %s(\"%s (Error: %s)\"); }" %
+ (compareExpr, self.onFailCompareVar,
+ self.exprAccessorValueLhs(vulkanType), errMsg))
+
+ def onCheck(self, vulkanType):
+
+ self.checked = True
+
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ bothNull = self.makeBothNullExpr(accessLhs, accessRhs)
+ bothNotNull = self.makeBothNotNullExpr(accessLhs, accessRhs)
+ nullMatchExpr = "(%s) || (%s)" % (bothNull, bothNotNull)
+
+ self.compareWithConsequence( \
+ nullMatchExpr,
+ vulkanType,
+ "Mismatch in optional field")
+
+ skipStreamInternal = vulkanType.typeName == "void"
+
+ if skipStreamInternal:
+ return
+
+ self.cgen.beginIf("%s && %s" % (accessLhs, accessRhs))
+
+ def endCheck(self, vulkanType):
+
+ skipStreamInternal = vulkanType.typeName == "void"
+ if skipStreamInternal:
+ return
+
+ if self.checked:
+ self.cgen.endIf()
+ self.checked = False
+
+ def onCompoundType(self, vulkanType):
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ lenAccessLhs = self.lenAccessorLhs(vulkanType)
+ lenAccessRhs = self.lenAccessorRhs(vulkanType)
+
+ lenAccessGuardLhs = self.lenAccessGuardLhs(vulkanType)
+ lenAccessGuardRhs = self.lenAccessGuardRhs(vulkanType)
+
+ needNullCheck = vulkanType.pointerIndirectionLevels > 0
+
+ if needNullCheck:
+ bothNotNullExpr = self.makeBothNotNullExpr(accessLhs, accessRhs)
+ self.cgen.beginIf(bothNotNullExpr)
+
+ if lenAccessLhs is not None:
+ equalLenExpr = self.makeEqualExpr(lenAccessLhs, lenAccessRhs)
+
+ self.compareWithConsequence( \
+ equalLenExpr,
+ vulkanType, "Lengths not equal")
+
+ loopVar = "i"
+ accessLhs = "%s + %s" % (accessLhs, loopVar)
+ accessRhs = "%s + %s" % (accessRhs, loopVar)
+ forInit = "uint32_t %s = 0" % loopVar
+ forCond = "%s < (uint32_t)%s" % (loopVar, lenAccessLhs)
+ forIncr = "++%s" % loopVar
+
+ if needNullCheck:
+ self.cgen.beginIf(equalLenExpr)
+
+ if lenAccessGuardLhs is not None:
+ self.cgen.beginIf(lenAccessGuardLhs)
+
+ self.cgen.beginFor(forInit, forCond, forIncr)
+
+ self.cgen.funcCall(None, self.prefix + vulkanType.typeName,
+ [accessLhs, accessRhs, self.onFailCompareVar])
+
+ if lenAccessLhs is not None:
+ self.cgen.endFor()
+ if lenAccessGuardLhs is not None:
+ self.cgen.endIf()
+ if needNullCheck:
+ self.cgen.endIf()
+
+ if needNullCheck:
+ self.cgen.endIf()
+
+ def onString(self, vulkanType):
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ bothNullExpr = self.makeBothNullExpr(accessLhs, accessRhs)
+ bothNotNullExpr = self.makeBothNotNullExpr(accessLhs, accessRhs)
+ nullMatchExpr = "(%s) || (%s)" % (bothNullExpr, bothNotNullExpr)
+
+ self.compareWithConsequence( \
+ nullMatchExpr,
+ vulkanType,
+ "Mismatch in string pointer nullness")
+
+ self.cgen.beginIf(bothNotNullExpr)
+
+ self.compareWithConsequence(
+ self.makeEqualStringExpr(accessLhs, accessRhs),
+ vulkanType, "Unequal strings")
+
+ self.cgen.endIf()
+
+ def onStringArray(self, vulkanType):
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ lenAccessLhs = self.lenAccessorLhs(vulkanType)
+ lenAccessRhs = self.lenAccessorRhs(vulkanType)
+
+ lenAccessGuardLhs = self.lenAccessGuardLhs(vulkanType)
+ lenAccessGuardRhs = self.lenAccessGuardRhs(vulkanType)
+
+ bothNullExpr = self.makeBothNullExpr(accessLhs, accessRhs)
+ bothNotNullExpr = self.makeBothNotNullExpr(accessLhs, accessRhs)
+ nullMatchExpr = "(%s) || (%s)" % (bothNullExpr, bothNotNullExpr)
+
+ self.compareWithConsequence( \
+ nullMatchExpr,
+ vulkanType,
+ "Mismatch in string array pointer nullness")
+
+ equalLenExpr = self.makeEqualExpr(lenAccessLhs, lenAccessRhs)
+
+ self.compareWithConsequence( \
+ equalLenExpr,
+ vulkanType, "Lengths not equal in string array")
+
+ self.compareWithConsequence( \
+ equalLenExpr,
+ vulkanType, "Lengths not equal in string array")
+
+ self.cgen.beginIf("%s && %s" % (equalLenExpr, bothNotNullExpr))
+
+ loopVar = "i"
+ accessLhs = "*(%s + %s)" % (accessLhs, loopVar)
+ accessRhs = "*(%s + %s)" % (accessRhs, loopVar)
+ forInit = "uint32_t %s = 0" % loopVar
+ forCond = "%s < (uint32_t)%s" % (loopVar, lenAccessLhs)
+ forIncr = "++%s" % loopVar
+
+ if lenAccessGuardLhs is not None:
+ self.cgen.beginIf(lenAccessGuardLhs)
+
+ self.cgen.beginFor(forInit, forCond, forIncr)
+
+ self.compareWithConsequence(
+ self.makeEqualStringExpr(accessLhs, accessRhs),
+ vulkanType, "Unequal string in string array")
+
+ self.cgen.endFor()
+
+ if lenAccessGuardLhs is not None:
+ self.cgen.endIf()
+
+ self.cgen.endIf()
+
+ def onStaticArr(self, vulkanType):
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ lenAccessLhs = self.lenAccessorLhs(vulkanType)
+
+ finalLenExpr = "%s * %s" % (lenAccessLhs,
+ self.cgen.sizeofExpr(vulkanType))
+
+ self.compareWithConsequence(
+ self.makeEqualBufExpr(accessLhs, accessRhs, finalLenExpr),
+ vulkanType, "Unequal static array")
+
+ def onStructExtension(self, vulkanType):
+ lhs = self.exprAccessorLhs(vulkanType)
+ rhs = self.exprAccessorRhs(vulkanType)
+
+ self.cgen.beginIf(lhs)
+ self.cgen.funcCall(None, self.prefix + "extension_struct",
+ [lhs, rhs, self.onFailCompareVar])
+ self.cgen.endIf()
+
+ def onPointer(self, vulkanType):
+ accessLhs = self.exprAccessorLhs(vulkanType)
+ accessRhs = self.exprAccessorRhs(vulkanType)
+
+ skipStreamInternal = vulkanType.typeName == "void"
+ if skipStreamInternal:
+ return
+
+ lenAccessLhs = self.lenAccessorLhs(vulkanType)
+ lenAccessRhs = self.lenAccessorRhs(vulkanType)
+
+ if lenAccessLhs is not None:
+ self.compareWithConsequence( \
+ self.makeEqualExpr(lenAccessLhs, lenAccessRhs),
+ vulkanType, "Lengths not equal")
+
+ finalLenExpr = "%s * %s" % (lenAccessLhs,
+ self.cgen.sizeofExpr(
+ vulkanType.getForValueAccess()))
+ else:
+ finalLenExpr = self.cgen.sizeofExpr(vulkanType.getForValueAccess())
+
+ self.compareWithConsequence(
+ self.makeEqualBufExpr(accessLhs, accessRhs, finalLenExpr),
+ vulkanType, "Unequal dyn array")
+
+ def onValue(self, vulkanType):
+ accessLhs = self.exprAccessorValueLhs(vulkanType)
+ accessRhs = self.exprAccessorValueRhs(vulkanType)
+ self.compareWithConsequence(
+ self.makeEqualExpr(accessLhs, accessRhs), vulkanType,
+ "Value not equal")
+
+
+class VulkanTesting(VulkanWrapperGenerator):
+
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.codegen = CodeGen()
+
+ self.equalityCodegen = \
+ VulkanEqualityCodegen(
+ None,
+ EQUALITY_VAR_NAMES,
+ EQUALITY_ON_FAIL_VAR,
+ API_PREFIX_EQUALITY)
+
+ self.knownDefs = {}
+
+ self.extensionTestingPrototype = \
+ VulkanAPI(API_PREFIX_EQUALITY + "extension_struct",
+ EQUALITY_RET_TYPE,
+ [STRUCT_EXTENSION_PARAM,
+ STRUCT_EXTENSION_PARAM2,
+ EQUALITY_ON_FAIL_VAR_TYPE])
+
+ def onBegin(self,):
+ VulkanWrapperGenerator.onBegin(self)
+ self.module.appendImpl(self.codegen.makeFuncDecl(
+ self.extensionTestingPrototype))
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ if name in self.knownDefs:
+ return
+
+ category = self.typeInfo.categoryOf(name)
+
+ if category in ["struct", "union"] and alias:
+ self.module.appendHeader(
+ self.codegen.makeFuncAlias(API_PREFIX_EQUALITY + name,
+ API_PREFIX_EQUALITY + alias))
+
+ if category in ["struct", "union"] and not alias:
+
+ structInfo = self.typeInfo.structs[name]
+
+ typeFromName = \
+ lambda varname: makeVulkanTypeSimple(True, name, 1, varname)
+
+ compareParams = \
+ list(map(typeFromName, EQUALITY_VAR_NAMES)) + \
+ [EQUALITY_ON_FAIL_VAR_TYPE]
+
+ comparePrototype = \
+ VulkanAPI(API_PREFIX_EQUALITY + name,
+ EQUALITY_RET_TYPE,
+ compareParams)
+
+ def structCompareDef(cgen):
+ self.equalityCodegen.cgen = cgen
+ for member in structInfo.members:
+ iterateVulkanType(self.typeInfo, member,
+ self.equalityCodegen)
+
+ self.module.appendHeader(
+ self.codegen.makeFuncDecl(comparePrototype))
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(comparePrototype, structCompareDef))
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ def onEnd(self,):
+ VulkanWrapperGenerator.onEnd(self)
+
+ def forEachExtensionCompare(ext, castedAccess, cgen):
+ cgen.funcCall(None, API_PREFIX_EQUALITY + ext.name,
+ [castedAccess,
+ cgen.makeReinterpretCast(
+ STRUCT_EXTENSION_PARAM2.paramName, ext.name),
+ EQUALITY_ON_FAIL_VAR])
+
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(
+ self.extensionTestingPrototype,
+ lambda cgen: self.emitForEachStructExtension(
+ cgen,
+ EQUALITY_RET_TYPE,
+ STRUCT_EXTENSION_PARAM,
+ forEachExtensionCompare)))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/transform.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/transform.py
new file mode 100644
index 00000000000..79aff0e3a8c
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/transform.py
@@ -0,0 +1,348 @@
+# 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.
+
+from .common.codegen import CodeGen
+from .common.vulkantypes import \
+ VulkanCompoundType, VulkanAPI, makeVulkanTypeSimple, vulkanTypeNeedsTransform, vulkanTypeGetNeededTransformTypes, VulkanTypeIterator, iterateVulkanType, vulkanTypeforEachSubType, TRIVIAL_TRANSFORMED_TYPES, NON_TRIVIAL_TRANSFORMED_TYPES, TRANSFORMED_TYPES
+
+from .wrapperdefs import VulkanWrapperGenerator
+from .wrapperdefs import STRUCT_EXTENSION_PARAM, STRUCT_EXTENSION_PARAM_FOR_WRITE
+
+def deviceMemoryTransform(resourceTrackerVarName, structOrApiInfo, getExpr, getLen, cgen, variant="tohost"):
+ paramIndices = \
+ structOrApiInfo.deviceMemoryInfoParameterIndices
+
+ for _, info in paramIndices.items():
+ orderedKeys = [
+ "handle",
+ "offset",
+ "size",
+ "typeIndex",
+ "typeBits",]
+
+ casts = {
+ "handle" : "VkDeviceMemory*",
+ "offset" : "VkDeviceSize*",
+ "size" : "VkDeviceSize*",
+ "typeIndex" : "uint32_t*",
+ "typeBits" : "uint32_t*",
+ }
+
+ accesses = {
+ "handle" : "nullptr",
+ "offset" : "nullptr",
+ "size" : "nullptr",
+ "typeIndex" : "nullptr",
+ "typeBits" : "nullptr",
+ }
+
+ lenAccesses = {
+ "handle" : "0",
+ "offset" : "0",
+ "size" : "0",
+ "typeIndex" : "0",
+ "typeBits" : "0",
+ }
+
+ def doParam(i, vulkanType):
+ access = getExpr(vulkanType)
+ lenAccess = getLen(vulkanType)
+
+ for k in orderedKeys:
+ if i == info.__dict__[k]:
+ accesses[k] = access
+ if lenAccess is not None:
+ lenAccesses[k] = lenAccess
+ else:
+ lenAccesses[k] = "1"
+
+ vulkanTypeforEachSubType(structOrApiInfo, doParam)
+
+ callParams = ", ".join( \
+ ["(%s)%s, %s" % (casts[k], accesses[k], lenAccesses[k]) \
+ for k in orderedKeys])
+
+ if variant == "tohost":
+ cgen.stmt("%s->deviceMemoryTransform_tohost(%s)" % \
+ (resourceTrackerVarName, callParams))
+ else:
+ cgen.stmt("%s->deviceMemoryTransform_fromhost(%s)" % \
+ (resourceTrackerVarName, callParams))
+
+def directTransform(resourceTrackerVarName, vulkanType, getExpr, getLen, cgen, variant="tohost"):
+ access = getExpr(vulkanType)
+ lenAccess = getLen(vulkanType)
+
+ if lenAccess:
+ finalLenAccess = lenAccess
+ else:
+ finalLenAccess = "1"
+
+ cgen.stmt("%s->transformImpl_%s_%s(%s, %s)" % (resourceTrackerVarName,
+ vulkanType.typeName, variant, access, finalLenAccess))
+
+def genTransformsForVulkanType(resourceTrackerVarName, structOrApiInfo, getExpr, getLen, cgen, variant="tohost"):
+ for transform in vulkanTypeGetNeededTransformTypes(structOrApiInfo):
+ if transform == "devicememory":
+ deviceMemoryTransform( \
+ resourceTrackerVarName,
+ structOrApiInfo,
+ getExpr, getLen, cgen, variant=variant)
+
+class TransformCodegen(VulkanTypeIterator):
+ def __init__(self, cgen, inputVar, resourceTrackerVarName, prefix, variant):
+ self.cgen = cgen
+ self.inputVar = inputVar
+ self.prefix = prefix
+ self.resourceTrackerVarName = resourceTrackerVarName
+
+ def makeAccess(varName, asPtr = True):
+ return lambda t: self.cgen.generalAccess(t, parentVarName = varName, asPtr = asPtr)
+
+ def makeLengthAccess(varName):
+ return lambda t: self.cgen.generalLengthAccess(t, parentVarName = varName)
+
+ def makeLengthAccessGuard(varName):
+ return lambda t: self.cgen.generalLengthAccessGuard(t, parentVarName=varName)
+
+ self.exprAccessor = makeAccess(self.inputVar)
+ self.exprAccessorValue = makeAccess(self.inputVar, asPtr = False)
+ self.lenAccessor = makeLengthAccess(self.inputVar)
+ self.lenAccessorGuard = makeLengthAccessGuard(self.inputVar)
+
+ self.checked = False
+
+ self.variant = variant
+
+ def makeCastExpr(self, vulkanType):
+ return "(%s)" % (
+ self.cgen.makeCTypeDecl(vulkanType, useParamName=False))
+
+ def asNonConstCast(self, access, vulkanType):
+ if vulkanType.staticArrExpr:
+ casted = "%s(%s)" % (self.makeCastExpr(vulkanType.getForAddressAccess().getForNonConstAccess()), access)
+ elif vulkanType.accessibleAsPointer():
+ casted = "%s(%s)" % (self.makeCastExpr(vulkanType.getForNonConstAccess()), access)
+ else:
+ casted = "%s(%s)" % (self.makeCastExpr(vulkanType.getForAddressAccess().getForNonConstAccess()), access)
+ return casted
+
+ def onCheck(self, vulkanType):
+ pass
+
+ def endCheck(self, vulkanType):
+ pass
+
+ def onCompoundType(self, vulkanType):
+
+ access = self.exprAccessor(vulkanType)
+ lenAccess = self.lenAccessor(vulkanType)
+ lenAccessGuard = self.lenAccessorGuard(vulkanType)
+
+ isPtr = vulkanType.pointerIndirectionLevels > 0
+
+ if lenAccessGuard is not None:
+ self.cgen.beginIf(lenAccessGuard)
+
+ if isPtr:
+ self.cgen.beginIf(access)
+
+ if lenAccess is not None:
+
+ loopVar = "i"
+ access = "%s + %s" % (access, loopVar)
+ forInit = "uint32_t %s = 0" % loopVar
+ forCond = "%s < (uint32_t)%s" % (loopVar, lenAccess)
+ forIncr = "++%s" % loopVar
+
+ self.cgen.beginFor(forInit, forCond, forIncr)
+
+ accessCasted = self.asNonConstCast(access, vulkanType)
+
+ if vulkanType.isTransformed:
+ directTransform(self.resourceTrackerVarName, vulkanType, self.exprAccessor, self.lenAccessor, self.cgen, variant=self.variant)
+
+ self.cgen.funcCall(None, self.prefix + vulkanType.typeName,
+ [self.resourceTrackerVarName, accessCasted])
+
+ if lenAccess is not None:
+ self.cgen.endFor()
+
+ if isPtr:
+ self.cgen.endIf()
+
+ if lenAccessGuard is not None:
+ self.cgen.endIf()
+
+ def onString(self, vulkanType):
+ pass
+
+ def onStringArray(self, vulkanType):
+ pass
+
+ def onStaticArr(self, vulkanType):
+ pass
+
+ def onStructExtension(self, vulkanType):
+ access = self.exprAccessor(vulkanType)
+
+ castedAccessExpr = "(%s)(%s)" % ("void*", access)
+ self.cgen.beginIf(access)
+ self.cgen.funcCall(None, self.prefix + "extension_struct",
+ [self.resourceTrackerVarName, castedAccessExpr])
+ self.cgen.endIf()
+
+ def onPointer(self, vulkanType):
+ pass
+
+ def onValue(self, vulkanType):
+ pass
+
+
+class VulkanTransform(VulkanWrapperGenerator):
+ def __init__(self, module, typeInfo, resourceTrackerTypeName="ResourceTracker", resourceTrackerVarName="resourceTracker"):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.codegen = CodeGen()
+
+ self.transformPrefix = "transform_"
+
+ self.tohostpart = "tohost"
+ self.fromhostpart = "fromhost"
+ self.variants = [self.tohostpart, self.fromhostpart]
+
+ self.toTransformVar = "toTransform"
+ self.resourceTrackerTypeName = resourceTrackerTypeName
+ self.resourceTrackerVarName = resourceTrackerVarName
+ self.transformParam = \
+ makeVulkanTypeSimple(False, self.resourceTrackerTypeName, 1,
+ self.resourceTrackerVarName)
+ self.voidType = makeVulkanTypeSimple(False, "void", 0)
+
+ self.extensionTransformPrototypes = []
+
+ for variant in self.variants:
+ self.extensionTransformPrototypes.append( \
+ VulkanAPI(self.transformPrefix + variant + "_extension_struct",
+ self.voidType,
+ [self.transformParam, STRUCT_EXTENSION_PARAM_FOR_WRITE]))
+
+ self.knownStructs = {}
+ self.needsTransform = set([])
+
+ def onBegin(self,):
+ VulkanWrapperGenerator.onBegin(self)
+ # Set up a convenience macro fro the transformed structs
+ # and forward-declare the resource tracker class
+ self.codegen.stmt("class %s" % self.resourceTrackerTypeName)
+ self.codegen.line("#define LIST_TRIVIAL_TRANSFORMED_TYPES(f) \\")
+ for name in TRIVIAL_TRANSFORMED_TYPES:
+ self.codegen.line("f(%s) \\" % name)
+ self.codegen.line("")
+
+ self.codegen.line("#define LIST_NON_TRIVIAL_TRANSFORMED_TYPES(f) \\")
+ for name in NON_TRIVIAL_TRANSFORMED_TYPES:
+ self.codegen.line("f(%s) \\" % name)
+ self.codegen.line("")
+
+ self.codegen.line("#define LIST_TRANSFORMED_TYPES(f) \\")
+ self.codegen.line("LIST_TRIVIAL_TRANSFORMED_TYPES(f) \\")
+ self.codegen.line("LIST_NON_TRIVIAL_TRANSFORMED_TYPES(f) \\")
+ self.codegen.line("")
+
+ self.module.appendHeader(self.codegen.swapCode())
+
+ for prototype in self.extensionTransformPrototypes:
+ self.module.appendImpl(self.codegen.makeFuncDecl(
+ prototype))
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ if name in self.knownStructs:
+ return
+
+ category = self.typeInfo.categoryOf(name)
+
+ if category in ["struct", "union"] and alias:
+ for variant in self.variants:
+ self.module.appendHeader(
+ self.codegen.makeFuncAlias(self.transformPrefix + variant + "_" + name,
+ self.transformPrefix + variant + "_" + alias))
+
+ if category in ["struct", "union"] and not alias:
+ structInfo = self.typeInfo.structs[name]
+ self.knownStructs[name] = structInfo
+
+ for variant in self.variants:
+ api = VulkanAPI( \
+ self.transformPrefix + variant + "_" + name,
+ self.voidType,
+ [self.transformParam] + \
+ [makeVulkanTypeSimple( \
+ False, name, 1, self.toTransformVar)])
+
+ transformer = TransformCodegen(
+ None,
+ self.toTransformVar,
+ self.resourceTrackerVarName,
+ self.transformPrefix + variant + "_",
+ variant)
+
+ def funcDefGenerator(cgen):
+ transformer.cgen = cgen
+ for p in api.parameters:
+ cgen.stmt("(void)%s" % p.paramName)
+
+ genTransformsForVulkanType(
+ self.resourceTrackerVarName,
+ structInfo,
+ transformer.exprAccessor,
+ transformer.lenAccessor,
+ cgen,
+ variant=variant)
+
+ for member in structInfo.members:
+ iterateVulkanType(
+ self.typeInfo, member,
+ transformer)
+
+ self.module.appendHeader(
+ self.codegen.makeFuncDecl(api))
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(api, funcDefGenerator))
+
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ def onEnd(self,):
+ VulkanWrapperGenerator.onEnd(self)
+
+ for (variant, prototype) in zip(self.variants, self.extensionTransformPrototypes):
+ def forEachExtensionTransform(ext, castedAccess, cgen):
+ if ext.isTransformed:
+ directTransform(self.resourceTrackerVarName, ext, lambda _ : castedAccess, lambda _ : "1", cgen, variant);
+ cgen.funcCall(None, self.transformPrefix + variant + "_" + ext.name,
+ [self.resourceTrackerVarName, castedAccess])
+
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(
+ prototype,
+ lambda cgen: self.emitForEachStructExtension(
+ cgen,
+ self.voidType,
+ STRUCT_EXTENSION_PARAM_FOR_WRITE,
+ forEachExtensionTransform)))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/unbox.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/unbox.py
new file mode 100644
index 00000000000..f18fa2717e7
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/unbox.py
@@ -0,0 +1,81 @@
+# 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.
+
+from .common.codegen import CodeGen
+from .common.vulkantypes import \
+ VulkanCompoundType, VulkanAPI, makeVulkanTypeSimple, vulkanTypeNeedsTransform, vulkanTypeGetNeededTransformTypes, VulkanTypeIterator, iterateVulkanType, vulkanTypeforEachSubType, TRANSFORMED_TYPES
+
+from .wrapperdefs import VulkanWrapperGenerator
+from .wrapperdefs import STRUCT_EXTENSION_PARAM, STRUCT_EXTENSION_PARAM_FOR_WRITE
+
+# This is different from others; it operations solely in terms of deepcopy and handlemap
+class VulkanUnbox(VulkanWrapperGenerator):
+ def __init__(self, module, typeInfo):
+ VulkanWrapperGenerator.__init__(self, module, typeInfo)
+
+ self.codegen = CodeGen()
+
+ self.unboxPrefix = "unbox"
+ self.toUnboxVar = "toUnbox"
+ self.poolParam = \
+ makeVulkanTypeSimple(False, "BumpPool", 1, "pool")
+
+ self.knownStructs = {}
+ self.needsTransform = set([])
+
+ def onBegin(self,):
+ VulkanWrapperGenerator.onBegin(self)
+
+ def onGenType(self, typeXml, name, alias):
+ VulkanWrapperGenerator.onGenType(self, typeXml, name, alias)
+
+ if name in self.knownStructs:
+ return
+
+ category = self.typeInfo.categoryOf(name)
+
+ if category in ["struct", "union"] and alias:
+ self.module.appendHeader(
+ self.codegen.makeFuncAlias(self.unboxPrefix + "_" + name,
+ self.unboxPrefix + "_" + alias))
+
+ if category in ["struct", "union"] and not alias:
+ structInfo = self.typeInfo.structs[name]
+ self.knownStructs[name] = structInfo
+
+ api = VulkanAPI( \
+ self.unboxPrefix + "_" + name,
+ makeVulkanTypeSimple(False, name, 1),
+ [self.poolParam] + \
+ [makeVulkanTypeSimple( \
+ True, name, 1, self.toUnboxVar)])
+
+ def funcDefGenerator(cgen):
+ cgen.stmt("BoxedHandleUnwrapMapping unboxMapping")
+ cgen.stmt("%s* res = (%s*)pool->alloc(sizeof(const %s))" % (name, name, name))
+ cgen.stmt("deepcopy_%s(pool, %s, %s)" % (name, self.toUnboxVar, "res"))
+ cgen.stmt("handlemap_%s(%s, %s)" % (name, "&unboxMapping", "res"))
+ cgen.stmt("return res")
+
+ self.module.appendHeader(
+ self.codegen.makeFuncDecl(api))
+ self.module.appendImpl(
+ self.codegen.makeFuncImpl(api, funcDefGenerator))
+
+ def onGenCmd(self, cmdinfo, name, alias):
+ VulkanWrapperGenerator.onGenCmd(self, cmdinfo, name, alias)
+
+ def onEnd(self,):
+ VulkanWrapperGenerator.onEnd(self)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/vkextensionstructuretype.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/vkextensionstructuretype.py
new file mode 100644
index 00000000000..8db988aea79
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/vkextensionstructuretype.py
@@ -0,0 +1,46 @@
+# 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.
+
+from .wrapperdefs import VulkanWrapperGenerator
+
+
+class VulkanExtensionStructureType(VulkanWrapperGenerator):
+ def __init__(self, extensionName: str, module, typeInfo):
+ super().__init__(module, typeInfo)
+ self._extensionName = extensionName
+
+ def onGenGroup(self, groupinfo, groupName, alias=None):
+ super().onGenGroup(groupinfo, groupName, alias)
+ elem = groupinfo.elem
+ if (not elem.get('type') == 'enum'):
+ return
+ if (not elem.get('name') == 'VkStructureType'):
+ return
+ extensionEnumFactoryMacro = f'{self._extensionName.upper()}_ENUM'
+ for enum in elem.findall(f"enum[@extname='{self._extensionName}']"):
+ name = enum.get('name')
+ offset = enum.get('offset')
+ self.module.appendHeader(
+ f"#define {name} {extensionEnumFactoryMacro}(VkStructureType, {offset})\n")
+
+
+class VulkanGfxstreamStructureType(VulkanExtensionStructureType):
+ def __init__(self, module, typeInfo):
+ super().__init__('VK_GOOGLE_gfxstream', module, typeInfo)
+
+
+class VulkanAndroidNativeBufferStructureType(VulkanExtensionStructureType):
+ def __init__(self, module, typeInfo):
+ super().__init__('VK_ANDROID_native_buffer', module, typeInfo)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/wrapperdefs.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/wrapperdefs.py
new file mode 100644
index 00000000000..9b96987559d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cereal/wrapperdefs.py
@@ -0,0 +1,108 @@
+# 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.
+
+from .common.codegen import VulkanWrapperGenerator
+from .common.vulkantypes import makeVulkanTypeSimple
+
+# Contains definitions for various Vulkan API wrappers. This information is
+# shared to make it easier for one kind of wrapper to know how to call
+# another one.
+
+API_PREFIX_MARSHAL = "marshal_"
+API_PREFIX_UNMARSHAL = "unmarshal_"
+API_PREFIX_RESERVEDMARSHAL = "reservedmarshal_"
+API_PREFIX_RESERVEDUNMARSHAL = "reservedunmarshal_"
+
+MARSHAL_INPUT_VAR_NAME = "forMarshaling"
+UNMARSHAL_INPUT_VAR_NAME = "forUnmarshaling"
+
+API_PREFIX_VALIDATE = "validate_"
+API_PREFIX_FRONTEND = "goldfish_frontend_"
+
+VULKAN_STREAM_TYPE = "VulkanStream"
+VULKAN_STREAM_TYPE_GUEST = "VulkanStreamGuest"
+VULKAN_STREAM_VAR_NAME = "vkStream"
+
+VALIDATE_RESULT_TYPE = "VkResult"
+VALIDATE_VAR_NAME = "validateResult"
+VALIDATE_GOOD_RESULT = "VK_SUCCESS"
+
+ROOT_TYPE_VAR_NAME = "rootType"
+ROOT_TYPE_DEFAULT_VALUE = "VK_STRUCTURE_TYPE_MAX_ENUM"
+ROOT_TYPE_TYPE = "VkStructureType"
+ROOT_TYPE_PARAM = makeVulkanTypeSimple(
+ False, ROOT_TYPE_TYPE, 0, ROOT_TYPE_VAR_NAME)
+
+PARAMETERS_MARSHALING = [
+ makeVulkanTypeSimple(False, VULKAN_STREAM_TYPE, 1, VULKAN_STREAM_VAR_NAME),
+ ROOT_TYPE_PARAM,
+]
+PARAMETERS_MARSHALING_GUEST = [
+ makeVulkanTypeSimple(False, VULKAN_STREAM_TYPE_GUEST,
+ 1, VULKAN_STREAM_VAR_NAME),
+ ROOT_TYPE_PARAM,
+]
+PARAMETERS_VALIDATE = [
+ makeVulkanTypeSimple(False, VALIDATE_RESULT_TYPE, 1, VALIDATE_VAR_NAME)
+]
+PARAMETERS_COUNTING = [
+ makeVulkanTypeSimple(False, "size_t", 1, VULKAN_STREAM_VAR_NAME)
+]
+
+STRUCT_EXTENSION_PARAM = \
+ makeVulkanTypeSimple(True, "void", 1, "structExtension")
+
+STRUCT_EXTENSION_PARAM2 = \
+ makeVulkanTypeSimple(True, "void", 1, "structExtension2")
+
+STRUCT_EXTENSION_PARAM_FOR_WRITE = \
+ makeVulkanTypeSimple(False, "void", 1, "structExtension_out")
+
+STRUCT_TYPE_API_NAME = "goldfish_vk_struct_type"
+EXTENSION_SIZE_API_NAME = "goldfish_vk_extension_struct_size"
+EXTENSION_SIZE_WITH_STREAM_FEATURES_API_NAME = "goldfish_vk_extension_struct_size_with_stream_features"
+
+VOID_TYPE = makeVulkanTypeSimple(False, "void", 0)
+STREAM_RET_TYPE = makeVulkanTypeSimple(False, "void", 0)
+
+API_PREFIX_EQUALITY = "checkEqual_"
+EQUALITY_VAR_NAMES = ["a", "b"]
+EQUALITY_ON_FAIL_VAR = "onFail"
+EQUALITY_ON_FAIL_VAR_TYPE = makeVulkanTypeSimple(False, "OnFailCompareFunc", 0,
+ EQUALITY_ON_FAIL_VAR)
+EQUALITY_RET_TYPE = makeVulkanTypeSimple(False, "void", 0)
+
+RELAXED_APIS = [
+ "vkWaitForFences",
+ "vkWaitSemaphores",
+ "vkWaitSemaphoresKHR",
+ "vkQueueWaitIdle",
+ "vkDeviceWaitIdle",
+ "vkQueueFlushCommandsGOOGLE",
+]
+
+STYPE_OVERRIDE = {
+ "VkPhysicalDeviceFragmentDensityMapFeaturesEXT": "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT",
+ "VkPhysicalDeviceFragmentDensityMapPropertiesEXT": "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT",
+ "VkRenderPassFragmentDensityMapCreateInfoEXT": "VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT",
+ "VkImportColorBufferGOOGLE": "VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE",
+ "VkImportBufferGOOGLE": "VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE",
+ "VkCreateBlobGOOGLE": "VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE",
+}
+
+MAX_PACKET_LENGTH = "(400 * 1024 * 1024) // 400MB"
+
+
+
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cerealgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cerealgenerator.py
new file mode 100644
index 00000000000..921558a8022
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cerealgenerator.py
@@ -0,0 +1,865 @@
+#!/usr/bin/python3 -i
+#
+# Copyright (c) 2013-2018 The Khronos Group Inc.
+# Copyright (c) 2013-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.
+
+import os, re, sys
+from generator import *
+from pathlib import Path, PurePosixPath
+
+import cereal
+from cereal.wrapperdefs import VULKAN_STREAM_TYPE
+from cereal.wrapperdefs import VULKAN_STREAM_TYPE_GUEST
+
+# CerealGenerator - generates set of driver sources
+# while being agnostic to the stream implementation
+from reg import GroupInfo, TypeInfo, EnumInfo
+
+VK_CEREAL_FLAG_HOST = 1
+VK_CEREAL_FLAG_GUEST = 2
+VK_CEREAL_FLAG_ALL = VK_CEREAL_FLAG_GUEST | VK_CEREAL_FLAG_HOST
+
+SUPPORTED_FEATURES = [
+ "VK_VERSION_1_0",
+ "VK_VERSION_1_1",
+ "VK_VERSION_1_2",
+ "VK_VERSION_1_3",
+ # Instance extensions
+ "VK_KHR_get_physical_device_properties2",
+ "VK_KHR_sampler_ycbcr_conversion",
+ "VK_KHR_external_semaphore_capabilities",
+ "VK_KHR_external_memory_capabilities",
+ "VK_KHR_external_fence_capabilities",
+ "VK_EXT_debug_utils",
+ # Device extensions
+ "VK_KHR_storage_buffer_storage_class",
+ "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",
+ "VK_AMD_gpu_shader_half_float",
+ "VK_NV_shader_subgroup_partitioned",
+ "VK_KHR_shader_subgroup_extended_types",
+ "VK_EXT_provoking_vertex",
+ "VK_EXT_line_rasterization",
+ "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_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",
+ "VK_EXT_scalar_block_layout",
+ "VK_KHR_external_semaphore",
+ "VK_KHR_external_semaphore_fd",
+ "VK_KHR_external_memory",
+ "VK_KHR_external_fence",
+ "VK_KHR_external_fence_fd",
+ "VK_EXT_device_memory_report",
+ "VK_KHR_create_renderpass2",
+ "VK_KHR_imageless_framebuffer",
+ "VK_KHR_descriptor_update_template",
+ "VK_EXT_depth_clip_enable",
+ # see aosp/2736079 + b/268351352
+ "VK_EXT_swapchain_maintenance1",
+ "VK_KHR_maintenance5",
+ "VK_EXT_host_image_copy",
+ "VK_EXT_image_compression_control",
+ "VK_EXT_image_compression_control_swapchain",
+ # VK1.3 extensions: see b/298704840
+ "VK_KHR_copy_commands2",
+ "VK_KHR_dynamic_rendering",
+ "VK_KHR_format_feature_flags2",
+ "VK_KHR_maintenance4",
+ "VK_KHR_shader_integer_dot_product",
+ "VK_KHR_shader_non_semantic_info",
+ "VK_KHR_shader_terminate_invocation",
+ "VK_KHR_synchronization2",
+ "VK_KHR_zero_initialize_workgroup_memory",
+ "VK_EXT_4444_formats",
+ "VK_EXT_extended_dynamic_state",
+ "VK_EXT_extended_dynamic_state2",
+ "VK_EXT_image_robustness",
+ "VK_EXT_inline_uniform_block",
+ "VK_EXT_pipeline_creation_cache_control",
+ "VK_EXT_pipeline_creation_feedback",
+ "VK_EXT_private_data",
+ "VK_EXT_shader_demote_to_helper_invocation",
+ "VK_EXT_subgroup_size_control",
+ "VK_EXT_texel_buffer_alignment",
+ "VK_EXT_texture_compression_astc_hdr",
+ "VK_EXT_tooling_info",
+ "VK_EXT_ycbcr_2plane_444_formats",
+ # Host dispatch
+ "VK_EXT_debug_utils",
+ "VK_KHR_surface",
+ "VK_KHR_swapchain",
+ "VK_KHR_xcb_surface",
+ "VK_KHR_win32_surface",
+ "VK_EXT_metal_surface",
+ "VK_MVK_moltenvk",
+ "VK_KHR_external_semaphore_win32",
+ "VK_KHR_external_memory_win32",
+ "VK_KHR_external_memory_fd",
+ # Android
+ "VK_ANDROID_native_buffer",
+ "VK_ANDROID_external_memory_android_hardware_buffer",
+ "VK_KHR_android_surface",
+ # Custom
+ "VK_GOOGLE_gfxstream",
+ # Used in tests without proper support checks
+ "VK_EXT_graphics_pipeline_library",
+ # Used by guest ANGLE
+ "VK_EXT_vertex_attribute_divisor",
+ # QNX
+ "VK_QNX_external_memory_screen_buffer",
+ # b/320855472 Chrome
+ "VK_EXT_fragment_density_map",
+]
+
+HOST_MODULES = ["goldfish_vk_extension_structs", "goldfish_vk_marshaling",
+ "goldfish_vk_reserved_marshaling", "goldfish_vk_deepcopy",
+ "goldfish_vk_dispatch", "goldfish_vk_transform", "VkDecoder",
+ "VkDecoderSnapshot", "VkSubDecoder"]
+
+# By default, the all wrappers are run all on all features. In certain cases,
+# we wish run wrappers when the module requires it. For example, `VK_GOOGLE_gfxstream`
+# shouldn't generate a function table entry since it's an internal interface.
+SUPPORTED_MODULES = {
+ "VK_EXT_debug_utils": ["goldfish_vk_dispatch"],
+ "VK_KHR_surface": ["goldfish_vk_dispatch"],
+ "VK_KHR_xcb_surface": ["goldfish_vk_dispatch"],
+ "VK_KHR_win32_surface": ["goldfish_vk_dispatch"],
+ "VK_EXT_metal_surface": ["goldfish_vk_dispatch"],
+ # VK_MVK_moltenvk doesn't generate a generate dispatch entry for some reason, but should. The
+ # lack of this extension doesn't cause any build failtures though.
+ "VK_MVK_moltenvk": ["goldfish_vk_dispatch"],
+ "VK_KHR_external_semaphore_win32" : ["goldfish_vk_dispatch"],
+ "VK_KHR_external_memory_win32" : ["goldfish_vk_dispatch"],
+ "VK_KHR_external_memory_fd": ["goldfish_vk_dispatch"],
+ "VK_QNX_external_memory_screen_buffer": ["goldfish_vk_dispatch"],
+ "VK_ANDROID_external_memory_android_hardware_buffer": ["func_table"],
+ "VK_KHR_android_surface": ["func_table"],
+ "VK_EXT_swapchain_maintenance1" : HOST_MODULES,
+ "VK_KHR_swapchain" : HOST_MODULES,
+}
+
+REQUIRED_TYPES = {
+ "int",
+ "uint16_t",
+ "int64_t",
+ "double",
+ "VkPresentScalingFlagsEXT",
+ "VkPresentGravityFlagsEXT",
+}
+
+copyrightHeader = """// 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.
+"""
+
+# We put the long generated commands in a separate paragraph, so that the formatter won't mess up
+# with other texts.
+autogeneratedHeaderTemplate = """
+// Autogenerated module %s
+//
+// %s
+//
+// 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
+//
+"""
+namespaceBegin ="""
+namespace gfxstream {
+namespace vk {\n
+"""
+
+namespaceEnd = """
+} // namespace vk
+} // namespace gfxstream
+"""
+
+def banner_command(argv):
+ """Return sanitized command-line description.
+ |argv| must be a list of command-line parameters, e.g. sys.argv.
+ Return a string corresponding to the command, with platform-specific
+ paths removed."""
+
+ def makePosixRelative(someArg):
+ if os.path.exists(someArg):
+ return str(PurePosixPath(Path(os.path.relpath(someArg))))
+ return someArg
+
+ return ' '.join(map(makePosixRelative, argv))
+
+def envGetOrDefault(key, default=None):
+ if key in os.environ:
+ return os.environ[key]
+ print("envGetOrDefault: notfound: %s" % key)
+ return default
+
+# ---- methods overriding base class ----
+# beginFile(genOpts)
+# endFile()
+# beginFeature(interface, emit)
+# endFeature()
+# genType(typeinfo,name)
+# genStruct(typeinfo,name)
+# genGroup(groupinfo,name)
+# genEnum(enuminfo, name)
+# genCmd(cmdinfo)
+class CerealGenerator(OutputGenerator):
+
+ """Generate serialization code"""
+ def __init__(self, errFile = sys.stderr,
+ warnFile = sys.stderr,
+ diagFile = sys.stdout):
+ OutputGenerator.__init__(self, errFile, warnFile, diagFile)
+
+ self.typeInfo = cereal.VulkanTypeInfo(self)
+
+ self.modules = {}
+ self.protos = {}
+ self.moduleList = []
+ self.protoList = []
+
+ self.wrappers = []
+
+ self.codegen = cereal.CodeGen()
+ self.featureSupported = False
+ self.supportedModules = None
+
+ self.guestBaseLibDirPrefix = "aemu/base"
+ self.baseLibDirPrefix = "aemu/base"
+ self.utilsHeaderDirPrefix = "utils"
+
+ # The cereal variant should be an environmental variable of one of
+ # the following:
+ # - "guest"
+ # - "host"
+ # - "both"
+ cerealVariant = envGetOrDefault("CEREAL_VARIANT", "both")
+ if cerealVariant == "guest":
+ self.cerealFlags = VK_CEREAL_FLAG_GUEST
+ elif cerealVariant == "host":
+ self.cerealFlags = VK_CEREAL_FLAG_HOST
+ else:
+ self.cerealFlags = VK_CEREAL_FLAG_ALL
+
+ # THe host always needs all possible guest struct definitions, while the guest only needs
+ # platform sepcific headers.
+ self.hostCommonExtraVulkanHeaders = '#include "vk_android_native_buffer_gfxstream.h"'
+
+ encoderInclude = f"""
+#include "{self.guestBaseLibDirPrefix}/AndroidHealthMonitor.h"
+#include "goldfish_vk_private_defs.h"
+#include <memory>
+
+namespace gfxstream {{
+namespace guest {{
+class IOStream;
+}} // namespace guest
+}} // namespace gfxstream
+"""
+ encoderImplInclude = f"""
+#include "EncoderDebug.h"
+#include "Resources.h"
+#include "ResourceTracker.h"
+#include "Validation.h"
+#include "%s.h"
+#include "gfxstream/guest/IOStream.h"
+
+#include "{self.guestBaseLibDirPrefix}/AlignedBuf.h"
+#include "{self.guestBaseLibDirPrefix}/BumpPool.h"
+#include "{self.guestBaseLibDirPrefix}/synchronization/AndroidLock.h"
+
+#include <cutils/properties.h>
+
+#include "goldfish_vk_marshaling_guest.h"
+#include "goldfish_vk_reserved_marshaling_guest.h"
+#include "goldfish_vk_deepcopy_guest.h"
+#include "goldfish_vk_counting_guest.h"
+#include "goldfish_vk_private_defs.h"
+#include "goldfish_vk_transform_guest.h"
+
+#include <memory>
+#include <optional>
+#include <unordered_map>
+#include <string>
+#include <vector>
+
+""" % VULKAN_STREAM_TYPE_GUEST
+
+ functableImplInclude = """
+#include "VkEncoder.h"
+#include "../OpenglSystemCommon/HostConnection.h"
+#include "ResourceTracker.h"
+#include "gfxstream_vk_entrypoints.h"
+#include "gfxstream_vk_private.h"
+
+#include "goldfish_vk_private_defs.h"
+
+#include <log/log.h>
+#include <cstring>
+
+// 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
+#if defined(LINUX_GUEST_BUILD) || defined(__Fuchsia__)
+#undef VK_ANDROID_native_buffer
+#endif
+"""
+ marshalIncludeGuest = """
+#include "goldfish_vk_marshaling_guest.h"
+#include "goldfish_vk_private_defs.h"
+#include "%s.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
+""" % VULKAN_STREAM_TYPE_GUEST
+
+ reservedmarshalIncludeGuest = """
+#include "goldfish_vk_marshaling_guest.h"
+#include "goldfish_vk_private_defs.h"
+#include "%s.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
+""" % VULKAN_STREAM_TYPE_GUEST
+
+ reservedmarshalImplIncludeGuest = """
+#include "Resources.h"
+"""
+
+ vulkanStreamIncludeHost = f"""
+{self.hostCommonExtraVulkanHeaders}
+#include "goldfish_vk_private_defs.h"
+
+#include "%s.h"
+#include "{self.baseLibDirPrefix}/files/StreamSerializing.h"
+""" % VULKAN_STREAM_TYPE
+
+ poolInclude = f"""
+{self.hostCommonExtraVulkanHeaders}
+#include "goldfish_vk_private_defs.h"
+#include "{self.baseLibDirPrefix}/BumpPool.h"
+using android::base::Allocator;
+using android::base::BumpPool;
+"""
+ transformIncludeGuest = """
+#include "goldfish_vk_private_defs.h"
+"""
+ transformInclude = f"""
+{self.hostCommonExtraVulkanHeaders}
+#include "goldfish_vk_private_defs.h"
+#include "goldfish_vk_extension_structs.h"
+"""
+ transformImplIncludeGuest = """
+#include "ResourceTracker.h"
+"""
+ transformImplInclude = """
+#include "VkDecoderGlobalState.h"
+"""
+ deepcopyInclude = """
+#include "vk_util.h"
+"""
+ poolIncludeGuest = f"""
+#include "goldfish_vk_private_defs.h"
+#include "{self.guestBaseLibDirPrefix}/BumpPool.h"
+using gfxstream::guest::Allocator;
+using gfxstream::guest::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
+"""
+ dispatchHeaderDefs = f"""
+{self.hostCommonExtraVulkanHeaders}
+#include "goldfish_vk_private_defs.h"
+namespace gfxstream {{
+namespace vk {{
+
+struct VulkanDispatch;
+
+}} // namespace vk
+}} // namespace gfxstream
+using DlOpenFunc = void* (void);
+using DlSymFunc = void* (void*, const char*);
+"""
+
+ extensionStructsInclude = f"""
+{self.hostCommonExtraVulkanHeaders}
+#include "goldfish_vk_private_defs.h"
+#include "host-common/GfxstreamFatalError.h"
+"""
+
+ extensionStructsIncludeGuest = """
+#include "vk_platform_compat.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
+#undef VK_ANDROID_external_memory_android_hardware_buffer
+"""
+ commonCerealImplIncludes = """
+#include "goldfish_vk_extension_structs.h"
+#include "goldfish_vk_private_defs.h"
+#include <string.h>
+"""
+ commonCerealIncludesGuest = """
+#include "vk_platform_compat.h"
+"""
+ commonCerealImplIncludesGuest = """
+#include "goldfish_vk_extension_structs_guest.h"
+#include "goldfish_vk_private_defs.h"
+
+#include <cstring>
+"""
+ countingIncludes = """
+#include "vk_platform_compat.h"
+#include "goldfish_vk_private_defs.h"
+"""
+
+ dispatchImplIncludes = """
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+"""
+
+ decoderSnapshotHeaderIncludes = f"""
+#include <memory>
+#include "{self.utilsHeaderDirPrefix}/GfxApiLogger.h"
+#include "{self.baseLibDirPrefix}/HealthMonitor.h"
+#include "goldfish_vk_private_defs.h"
+"""
+ decoderSnapshotImplIncludes = f"""
+#include "VulkanHandleMapping.h"
+#include "VkDecoderGlobalState.h"
+#include "VkReconstruction.h"
+
+#include "{self.baseLibDirPrefix}/synchronization/Lock.h"
+"""
+
+ decoderHeaderIncludes = f"""
+#include "VkDecoderContext.h"
+#include "host/ProcessResources.h"
+
+#include <memory>
+
+namespace android {{
+namespace base {{
+class BumpPool;
+}} // namespace android
+}} // namespace base
+
+"""
+
+ decoderImplIncludes = f"""
+#include "common/goldfish_vk_marshaling.h"
+#include "common/goldfish_vk_reserved_marshaling.h"
+#include "goldfish_vk_private_defs.h"
+#include "common/goldfish_vk_transform.h"
+
+#include "{self.baseLibDirPrefix}/BumpPool.h"
+#include "{self.baseLibDirPrefix}/system/System.h"
+#include "{self.baseLibDirPrefix}/Tracing.h"
+#include "{self.baseLibDirPrefix}/Metrics.h"
+#include "render-utils/IOStream.h"
+#include "host/FrameBuffer.h"
+#include "host-common/feature_control.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+
+#include "VkDecoderGlobalState.h"
+#include "VkDecoderSnapshot.h"
+
+#include "VulkanDispatch.h"
+#include "%s.h"
+
+#include <functional>
+#include <optional>
+#include <unordered_map>
+""" % VULKAN_STREAM_TYPE
+
+ def createVkExtensionStructureTypePreamble(extensionName: str) -> str:
+ return f"""
+#define {extensionName}_ENUM(type,id) \
+ ((type)(1000000000 + (1000 * ({extensionName}_NUMBER - 1)) + (id)))
+"""
+ self.guest_encoder_tag = "guest_encoder"
+ self.host_tag = "host"
+
+ default_guest_abs_encoder_destination = \
+ os.path.join(
+ os.getcwd(),
+ "..", "..",
+ "device", "generic", "goldfish-opengl",
+ "system", "vulkan_enc")
+ self.guest_abs_encoder_destination = \
+ envGetOrDefault("GFXSTREAM_GUEST_ENCODER_DIR",
+ default_guest_abs_encoder_destination)
+
+ default_host_abs_decoder_destination = \
+ os.path.join(
+ os.getcwd(),
+ "android", "android-emugl", "host",
+ "libs", "libOpenglRender", "vulkan")
+ self.host_abs_decoder_destination = \
+ envGetOrDefault("GFXSTREAM_HOST_DECODER_DIR",
+ default_host_abs_decoder_destination)
+ #self.host_script_destination = envGetOrDefault("GFXSTREAM_SCRIPTS_DIR")
+ #assert(self.host_script_destination is not None)
+
+ if self.cerealFlags & VK_CEREAL_FLAG_GUEST:
+ self.addGuestEncoderModule(
+ "VkEncoder",
+ extraHeader = encoderInclude,
+ extraImpl = encoderImplInclude)
+
+ self.addGuestEncoderModule("goldfish_vk_extension_structs_guest",
+ extraHeader=extensionStructsIncludeGuest)
+ self.addGuestEncoderModule("goldfish_vk_marshaling_guest",
+ extraHeader=commonCerealIncludesGuest + marshalIncludeGuest,
+ extraImpl=commonCerealImplIncludesGuest)
+ self.addGuestEncoderModule("goldfish_vk_reserved_marshaling_guest",
+ extraHeader=commonCerealIncludesGuest + reservedmarshalIncludeGuest,
+ extraImpl=commonCerealImplIncludesGuest + reservedmarshalImplIncludeGuest)
+ self.addGuestEncoderModule("goldfish_vk_deepcopy_guest",
+ extraHeader=commonCerealIncludesGuest + poolIncludeGuest,
+ extraImpl=commonCerealImplIncludesGuest + deepcopyInclude)
+ self.addGuestEncoderModule("goldfish_vk_counting_guest",
+ extraHeader=countingIncludes,
+ extraImpl=commonCerealImplIncludesGuest)
+ self.addGuestEncoderModule("goldfish_vk_transform_guest",
+ extraHeader=commonCerealIncludesGuest + transformIncludeGuest,
+ extraImpl=commonCerealImplIncludesGuest + transformImplIncludeGuest)
+ self.addGuestEncoderModule(
+ "vulkan_gfxstream_structure_type", headerOnly=True, suppressFeatureGuards=True,
+ moduleName="vulkan_gfxstream_structure_type_guest", useNamespace=False,
+ suppressVulkanHeaders=True,
+ extraHeader=createVkExtensionStructureTypePreamble('VK_GOOGLE_GFXSTREAM'))
+
+ self.addGuestEncoderModule("func_table", extraImpl=functableImplInclude, implOnly = True,
+ useNamespace = False)
+
+ self.addWrapper(cereal.VulkanEncoder, "VkEncoder")
+ self.addWrapper(cereal.VulkanExtensionStructs, "goldfish_vk_extension_structs_guest", variant = "guest")
+ self.addWrapper(cereal.VulkanMarshaling, "goldfish_vk_marshaling_guest", variant = "guest")
+ self.addWrapper(cereal.VulkanReservedMarshaling, "goldfish_vk_reserved_marshaling_guest", variant = "guest")
+ self.addWrapper(cereal.VulkanDeepcopy, "goldfish_vk_deepcopy_guest")
+ self.addWrapper(cereal.VulkanCounting, "goldfish_vk_counting_guest")
+ self.addWrapper(cereal.VulkanTransform, "goldfish_vk_transform_guest")
+ self.addWrapper(cereal.VulkanFuncTable, "func_table")
+ self.addWrapper(cereal.VulkanGfxstreamStructureType,
+ "vulkan_gfxstream_structure_type_guest")
+
+ if self.cerealFlags & VK_CEREAL_FLAG_HOST:
+ self.addCppModule("common", "goldfish_vk_extension_structs",
+ extraHeader=extensionStructsInclude)
+ self.addCppModule("common", "goldfish_vk_marshaling",
+ extraHeader=vulkanStreamIncludeHost,
+ extraImpl=commonCerealImplIncludes)
+ self.addCppModule("common", "goldfish_vk_reserved_marshaling",
+ extraHeader=vulkanStreamIncludeHost,
+ extraImpl=commonCerealImplIncludes)
+ self.addCppModule("common", "goldfish_vk_deepcopy",
+ extraHeader=poolInclude,
+ extraImpl=commonCerealImplIncludes + deepcopyInclude)
+ self.addCppModule("common", "goldfish_vk_dispatch",
+ extraHeader=dispatchHeaderDefs,
+ extraImpl=dispatchImplIncludes)
+ self.addCppModule("common", "goldfish_vk_transform",
+ extraHeader=transformInclude,
+ extraImpl=transformImplInclude)
+ self.addHostModule("VkDecoder",
+ extraHeader=decoderHeaderIncludes,
+ extraImpl=decoderImplIncludes,
+ useNamespace=False)
+ self.addHostModule("VkDecoderSnapshot",
+ extraHeader=decoderSnapshotHeaderIncludes,
+ extraImpl=decoderSnapshotImplIncludes,
+ useNamespace=False)
+ self.addHostModule("VkSubDecoder",
+ extraHeader="",
+ extraImpl="",
+ useNamespace=False,
+ implOnly=True)
+
+ #self.addModule(cereal.PyScript(self.host_tag, "vulkan_printer", customAbsDir=Path(
+ # self.host_script_destination) / "print_gfx_logs"), moduleName="ApiLogDecoder")
+ self.addHostModule(
+ "vulkan_gfxstream_structure_type", headerOnly=True, suppressFeatureGuards=True,
+ moduleName="vulkan_gfxstream_structure_type_host", useNamespace=False,
+ suppressVulkanHeaders=True,
+ extraHeader=createVkExtensionStructureTypePreamble('VK_GOOGLE_GFXSTREAM'))
+ self.addHostModule(
+ "vk_android_native_buffer_structure_type", headerOnly=True, suppressFeatureGuards=True,
+ useNamespace=False, suppressVulkanHeaders=True,
+ extraHeader=createVkExtensionStructureTypePreamble('VK_ANDROID_NATIVE_BUFFER'))
+
+ self.addWrapper(cereal.VulkanExtensionStructs, "goldfish_vk_extension_structs", variant = "host")
+ self.addWrapper(cereal.VulkanMarshaling, "goldfish_vk_marshaling")
+ self.addWrapper(cereal.VulkanReservedMarshaling, "goldfish_vk_reserved_marshaling", variant = "host")
+ self.addWrapper(cereal.VulkanDeepcopy, "goldfish_vk_deepcopy")
+ self.addWrapper(cereal.VulkanDispatch, "goldfish_vk_dispatch")
+ self.addWrapper(cereal.VulkanTransform, "goldfish_vk_transform", resourceTrackerTypeName="VkDecoderGlobalState")
+ self.addWrapper(cereal.VulkanDecoder, "VkDecoder")
+ self.addWrapper(cereal.VulkanDecoderSnapshot, "VkDecoderSnapshot")
+ self.addWrapper(cereal.VulkanSubDecoder, "VkSubDecoder")
+ self.addWrapper(cereal.ApiLogDecoder, "ApiLogDecoder")
+ self.addWrapper(cereal.VulkanGfxstreamStructureType, "vulkan_gfxstream_structure_type_host")
+ self.addWrapper(cereal.VulkanAndroidNativeBufferStructureType,
+ "vk_android_native_buffer_structure_type")
+
+ def addGuestEncoderModule(
+ self, basename, extraHeader="", extraImpl="", useNamespace=True, headerOnly=False,
+ suppressFeatureGuards=False, moduleName=None, suppressVulkanHeaders=False, implOnly=False):
+ if not os.path.exists(self.guest_abs_encoder_destination):
+ print("Path [%s] not found (guest encoder path), skipping" % self.guest_abs_encoder_destination)
+ return
+ self.addCppModule(self.guest_encoder_tag, basename, extraHeader=extraHeader,
+ extraImpl=extraImpl, customAbsDir=self.guest_abs_encoder_destination,
+ useNamespace=useNamespace, implOnly=implOnly, headerOnly=headerOnly,
+ suppressFeatureGuards=suppressFeatureGuards, moduleName=moduleName,
+ suppressVulkanHeaders=suppressVulkanHeaders)
+
+ def addHostModule(
+ self, basename, extraHeader="", extraImpl="", useNamespace=True, implOnly=False,
+ suppress=False, headerOnly=False, suppressFeatureGuards=False, moduleName=None,
+ suppressVulkanHeaders=False):
+ if not os.path.exists(self.host_abs_decoder_destination):
+ print("Path [%s] not found (host encoder path), skipping" %
+ self.host_abs_decoder_destination)
+ return
+ if not suppressVulkanHeaders:
+ extraHeader = self.hostCommonExtraVulkanHeaders + '\n' + extraHeader
+ self.addCppModule(
+ self.host_tag, basename, extraHeader=extraHeader, extraImpl=extraImpl,
+ customAbsDir=self.host_abs_decoder_destination, useNamespace=useNamespace,
+ implOnly=implOnly, suppress=suppress, headerOnly=headerOnly,
+ suppressFeatureGuards=suppressFeatureGuards, moduleName=moduleName,
+ suppressVulkanHeaders=suppressVulkanHeaders)
+
+ def addModule(self, module, moduleName=None):
+ if moduleName is None:
+ moduleName = module.basename
+ self.moduleList.append(moduleName)
+ self.modules[moduleName] = module
+
+ def addCppModule(
+ self, directory, basename, extraHeader="", extraImpl="", customAbsDir=None,
+ useNamespace=True, implOnly=False, suppress=False, headerOnly=False,
+ suppressFeatureGuards=False, moduleName=None, suppressVulkanHeaders=False):
+ module = cereal.Module(
+ directory, basename, customAbsDir=customAbsDir, suppress=suppress, implOnly=implOnly,
+ headerOnly=headerOnly, suppressFeatureGuards=suppressFeatureGuards)
+ self.addModule(module, moduleName=moduleName)
+ module.headerPreamble = copyrightHeader
+ module.headerPreamble += \
+ autogeneratedHeaderTemplate % \
+ (basename, "(header) generated by %s" % banner_command(sys.argv))
+
+ module.headerPreamble += "#pragma once\n"
+ if (not suppressVulkanHeaders):
+ module.headerPreamble += "#include <vulkan/vulkan.h>\n"
+ module.headerPreamble += '#include "vulkan_gfxstream.h"\n'
+ module.headerPreamble += '#include "vk_android_native_buffer_gfxstream.h"\n'
+ module.headerPreamble += extraHeader + '\n'
+ if useNamespace:
+ module.headerPreamble += namespaceBegin
+
+ module.implPreamble = copyrightHeader
+ module.implPreamble += \
+ autogeneratedHeaderTemplate % \
+ (basename, "(impl) generated by %s" % \
+ banner_command(sys.argv))
+ if not implOnly:
+ module.implPreamble += '\n#include "%s.h"' % \
+ (basename)
+
+ module.implPreamble += extraImpl
+
+ if useNamespace:
+ module.implPreamble += namespaceBegin
+ module.implPostamble += namespaceEnd
+ module.headerPostamble += namespaceEnd
+
+ def addWrapper(self, moduleType, moduleName, **kwargs):
+ if moduleName not in self.modules:
+ print(f'Unknown module: {moduleName}. All known modules are: {", ".join(self.modules)}.')
+ return
+ self.wrappers.append(
+ (moduleType(
+ self.modules[moduleName],
+ self.typeInfo, **kwargs),
+ moduleName)
+ )
+
+ def forEachModule(self, func):
+ for moduleName in self.moduleList:
+ func(self.modules[moduleName])
+
+ def forEachWrapper(self, func, supportedModules):
+ for wrapper in self.wrappers:
+ if supportedModules is None:
+ func(wrapper[0])
+ elif wrapper[1] in supportedModules:
+ func(wrapper[0])
+
+## Overrides####################################################################
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ self.forEachModule(lambda m: m.begin(self.genOpts.directory))
+ self.forEachWrapper(lambda w: w.onBegin(), None)
+
+ def endFile(self):
+ OutputGenerator.endFile(self)
+
+ self.typeInfo.onEnd()
+
+ self.forEachWrapper(lambda w: w.onEnd(), None)
+ self.forEachModule(lambda m: m.end())
+
+ def beginFeature(self, interface, emit):
+ # Start processing in superclass
+ OutputGenerator.beginFeature(self, interface, emit)
+
+ for supportedFeature in SUPPORTED_FEATURES:
+ if self.featureName == supportedFeature:
+ self.featureSupported = True
+
+ if self.featureSupported == False:
+ return
+
+ self.supportedModules = SUPPORTED_MODULES.get(self.featureName)
+ self.typeInfo.onBeginFeature(self.featureName, self.featureType)
+
+ self.forEachModule(
+ lambda m: m.appendHeader("#ifdef %s\n" % self.featureName)
+ if isinstance(m, cereal.Module) and not m.suppressFeatureGuards else None)
+ self.forEachModule(
+ lambda m: m.appendImpl("#ifdef %s\n" % self.featureName)
+ if isinstance(m, cereal.Module) and not m.suppressFeatureGuards else None)
+ self.forEachWrapper(lambda w: w.onBeginFeature(self.featureName, self.featureType), self.supportedModules)
+ # functable needs to understand the feature type (device vs instance) of each cmd
+ for features in interface.findall('require'):
+ for c in features.findall('command'):
+ self.forEachWrapper(lambda w: w.onFeatureNewCmd(c.get('name')), self.supportedModules)
+
+ def endFeature(self):
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ if self.featureSupported == False:
+ return
+
+ self.featureSupported = False
+
+ self.typeInfo.onEndFeature()
+
+ self.forEachModule(lambda m: m.appendHeader("#endif\n") if isinstance(
+ m, cereal.Module) and not m.suppressFeatureGuards else None)
+ self.forEachModule(lambda m: m.appendImpl("#endif\n") if isinstance(
+ m, cereal.Module) and not m.suppressFeatureGuards else None)
+ self.forEachWrapper(lambda w: w.onEndFeature(), self.supportedModules)
+
+ def genType(self, typeinfo: TypeInfo, name, alias):
+ OutputGenerator.genType(self, typeinfo, name, alias)
+
+ # Maybe this check can be removed if we refactor other things inside
+ # the cereal subdirectory.
+ if self.featureSupported == False and name in REQUIRED_TYPES:
+ self.typeInfo.onGenType(typeinfo, name, alias)
+ return
+
+ if self.featureSupported == False:
+ return
+
+ self.typeInfo.onGenType(typeinfo, name, alias)
+ self.forEachWrapper(lambda w: w.onGenType(typeinfo, name, alias), self.supportedModules)
+
+ def genStruct(self, typeinfo, typeName, alias):
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+ if self.featureSupported == False:
+ return
+
+ self.typeInfo.onGenStruct(typeinfo, typeName, alias)
+ self.forEachWrapper(lambda w: w.onGenStruct(typeinfo, typeName, alias), self.supportedModules)
+
+ def genGroup(self, groupinfo: GroupInfo, groupName, alias = None):
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+ if self.featureSupported == False:
+ return
+
+ self.typeInfo.onGenGroup(groupinfo, groupName, alias)
+ self.forEachWrapper(lambda w: w.onGenGroup(groupinfo, groupName, alias), self.supportedModules)
+
+ def genEnum(self, enuminfo: EnumInfo, name, alias):
+ OutputGenerator.genEnum(self, enuminfo, name, alias)
+ if self.featureSupported == False:
+ return
+ self.typeInfo.onGenEnum(enuminfo, name, alias)
+ self.forEachWrapper(lambda w: w.onGenEnum(enuminfo, name, alias), self.supportedModules)
+
+ def genCmd(self, cmdinfo, name, alias):
+ OutputGenerator.genCmd(self, cmdinfo, name, alias)
+ if self.featureSupported == False:
+ return
+
+ self.typeInfo.onGenCmd(cmdinfo, name, alias)
+ self.forEachWrapper(lambda w: w.onGenCmd(cmdinfo, name, alias), self.supportedModules)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cgenerator.py
new file mode 100644
index 00000000000..ef8d68137c0
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/cgenerator.py
@@ -0,0 +1,513 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import os
+import re
+
+from generator import (GeneratorOptions,
+ MissingGeneratorOptionsConventionsError,
+ MissingGeneratorOptionsError, MissingRegistryError,
+ OutputGenerator, noneStr, regSortFeatures, write)
+
+class CGeneratorOptions(GeneratorOptions):
+ """CGeneratorOptions - subclass of GeneratorOptions.
+
+ Adds options used by COutputGenerator objects during C language header
+ generation."""
+
+ def __init__(self,
+ prefixText='',
+ genFuncPointers=True,
+ protectFile=True,
+ protectFeature=True,
+ protectProto=None,
+ protectProtoStr=None,
+ protectExtensionProto=None,
+ protectExtensionProtoStr=None,
+ apicall='',
+ apientry='',
+ apientryp='',
+ indentFuncProto=True,
+ indentFuncPointer=False,
+ alignFuncParam=0,
+ genEnumBeginEndRange=False,
+ genAliasMacro=False,
+ genStructExtendsComment=False,
+ aliasMacro='',
+ misracstyle=False,
+ misracppstyle=False,
+ **kwargs
+ ):
+ """Constructor.
+ Additional parameters beyond parent class:
+
+ - prefixText - list of strings to prefix generated header with
+ (usually a copyright statement + calling convention macros)
+ - protectFile - True if multiple inclusion protection should be
+ generated (based on the filename) around the entire header
+ - protectFeature - True if #ifndef..#endif protection should be
+ generated around a feature interface in the header file
+ - genFuncPointers - True if function pointer typedefs should be
+ generated
+ - protectProto - If conditional protection should be generated
+ around prototype declarations, set to either '#ifdef'
+ to require opt-in (#ifdef protectProtoStr) or '#ifndef'
+ to require opt-out (#ifndef protectProtoStr). Otherwise
+ set to None.
+ - protectProtoStr - #ifdef/#ifndef symbol to use around prototype
+ declarations, if protectProto is set
+ - protectExtensionProto - If conditional protection should be generated
+ around extension prototype declarations, set to either '#ifdef'
+ to require opt-in (#ifdef protectExtensionProtoStr) or '#ifndef'
+ to require opt-out (#ifndef protectExtensionProtoStr). Otherwise
+ set to None
+ - protectExtensionProtoStr - #ifdef/#ifndef symbol to use around
+ extension prototype declarations, if protectExtensionProto is set
+ - apicall - string to use for the function declaration prefix,
+ such as APICALL on Windows
+ - apientry - string to use for the calling convention macro,
+ in typedefs, such as APIENTRY
+ - apientryp - string to use for the calling convention macro
+ in function pointer typedefs, such as APIENTRYP
+ - indentFuncProto - True if prototype declarations should put each
+ parameter on a separate line
+ - indentFuncPointer - True if typedefed function pointers should put each
+ parameter on a separate line
+ - alignFuncParam - if nonzero and parameters are being put on a
+ separate line, align parameter names at the specified column
+ - genEnumBeginEndRange - True if BEGIN_RANGE / END_RANGE macros should
+ be generated for enumerated types
+ - genAliasMacro - True if the OpenXR alias macro should be generated
+ for aliased types (unclear what other circumstances this is useful)
+ - genStructExtendsComment - True if comments showing the structures
+ whose pNext chain a structure extends are included before its
+ definition
+ - aliasMacro - alias macro to inject when genAliasMacro is True
+ - misracstyle - generate MISRA C-friendly headers
+ - misracppstyle - generate MISRA C++-friendly headers"""
+
+ GeneratorOptions.__init__(self, **kwargs)
+
+ self.prefixText = prefixText
+ """list of strings to prefix generated header with (usually a copyright statement + calling convention macros)."""
+
+ self.genFuncPointers = genFuncPointers
+ """True if function pointer typedefs should be generated"""
+
+ self.protectFile = protectFile
+ """True if multiple inclusion protection should be generated (based on the filename) around the entire header."""
+
+ self.protectFeature = protectFeature
+ """True if #ifndef..#endif protection should be generated around a feature interface in the header file."""
+
+ self.protectProto = protectProto
+ """If conditional protection should be generated around prototype declarations, set to either '#ifdef' to require opt-in (#ifdef protectProtoStr) or '#ifndef' to require opt-out (#ifndef protectProtoStr). Otherwise set to None."""
+
+ self.protectProtoStr = protectProtoStr
+ """#ifdef/#ifndef symbol to use around prototype declarations, if protectProto is set"""
+
+ self.protectExtensionProto = protectExtensionProto
+ """If conditional protection should be generated around extension prototype declarations, set to either '#ifdef' to require opt-in (#ifdef protectExtensionProtoStr) or '#ifndef' to require opt-out (#ifndef protectExtensionProtoStr). Otherwise set to None."""
+
+ self.protectExtensionProtoStr = protectExtensionProtoStr
+ """#ifdef/#ifndef symbol to use around extension prototype declarations, if protectExtensionProto is set"""
+
+ self.apicall = apicall
+ """string to use for the function declaration prefix, such as APICALL on Windows."""
+
+ self.apientry = apientry
+ """string to use for the calling convention macro, in typedefs, such as APIENTRY."""
+
+ self.apientryp = apientryp
+ """string to use for the calling convention macro in function pointer typedefs, such as APIENTRYP."""
+
+ self.indentFuncProto = indentFuncProto
+ """True if prototype declarations should put each parameter on a separate line"""
+
+ self.indentFuncPointer = indentFuncPointer
+ """True if typedefed function pointers should put each parameter on a separate line"""
+
+ self.alignFuncParam = alignFuncParam
+ """if nonzero and parameters are being put on a separate line, align parameter names at the specified column"""
+
+ self.genEnumBeginEndRange = genEnumBeginEndRange
+ """True if BEGIN_RANGE / END_RANGE macros should be generated for enumerated types"""
+
+ self.genAliasMacro = genAliasMacro
+ """True if the OpenXR alias macro should be generated for aliased types (unclear what other circumstances this is useful)"""
+
+ self.genStructExtendsComment = genStructExtendsComment
+ """True if comments showing the structures whose pNext chain a structure extends are included before its definition"""
+
+ self.aliasMacro = aliasMacro
+ """alias macro to inject when genAliasMacro is True"""
+
+ self.misracstyle = misracstyle
+ """generate MISRA C-friendly headers"""
+
+ self.misracppstyle = misracppstyle
+ """generate MISRA C++-friendly headers"""
+
+ self.codeGenerator = True
+ """True if this generator makes compilable code"""
+
+
+class COutputGenerator(OutputGenerator):
+ """Generates C-language API interfaces."""
+
+ # This is an ordered list of sections in the header file.
+ TYPE_SECTIONS = ['include', 'define', 'basetype', 'handle', 'enum',
+ 'group', 'bitmask', 'funcpointer', 'struct']
+ ALL_SECTIONS = TYPE_SECTIONS + ['commandPointer', 'command']
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Internal state - accumulators for different inner block text
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+ self.may_alias = None
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ # C-specific
+ #
+ # Multiple inclusion protection & C++ wrappers.
+ if self.genOpts.protectFile and self.genOpts.filename:
+ headerSym = re.sub(r'\.h', '_h_',
+ os.path.basename(self.genOpts.filename)).upper()
+ write('#ifndef', headerSym, file=self.outFile)
+ write('#define', headerSym, '1', file=self.outFile)
+ self.newline()
+
+ # User-supplied prefix text, if any (list of strings)
+ if genOpts.prefixText:
+ for s in genOpts.prefixText:
+ write(s, file=self.outFile)
+
+ # C++ extern wrapper - after prefix lines so they can add includes.
+ self.newline()
+ write('#ifdef __cplusplus', file=self.outFile)
+ write('extern "C" {', file=self.outFile)
+ write('#endif', file=self.outFile)
+ self.newline()
+
+ def endFile(self):
+ # C-specific
+ # Finish C++ wrapper and multiple inclusion protection
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ self.newline()
+ write('#ifdef __cplusplus', file=self.outFile)
+ write('}', file=self.outFile)
+ write('#endif', file=self.outFile)
+ if self.genOpts.protectFile and self.genOpts.filename:
+ self.newline()
+ write('#endif', file=self.outFile)
+ # Finish processing in superclass
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ # Start processing in superclass
+ OutputGenerator.beginFeature(self, interface, emit)
+ # C-specific
+ # Accumulate includes, defines, types, enums, function pointer typedefs,
+ # end function prototypes separately for this feature. They are only
+ # printed in endFeature().
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+
+ def _endProtectComment(self, protect_str, protect_directive='#ifdef'):
+ if protect_directive is None or protect_str is None:
+ raise RuntimeError('Should not call in here without something to protect')
+
+ # Do not put comments after #endif closing blocks if this is not set
+ if not self.genOpts.conventions.protectProtoComment:
+ return ''
+ elif 'ifdef' in protect_directive:
+ return f' /* {protect_str} */'
+ else:
+ return f' /* !{protect_str} */'
+
+ def endFeature(self):
+ "Actually write the interface to the output file."
+ # C-specific
+ if self.emit:
+ if self.feature_not_empty:
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ if self.genOpts.conventions is None:
+ raise MissingGeneratorOptionsConventionsError()
+ is_core = self.featureName and self.featureName.startswith(self.conventions.api_prefix + 'VERSION_')
+ if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
+ self.newline()
+ if self.genOpts.protectFeature:
+ write('#ifndef', self.featureName, file=self.outFile)
+
+ # If type declarations are needed by other features based on
+ # this one, it may be necessary to suppress the ExtraProtect,
+ # or move it below the 'for section...' loop.
+ if self.featureExtraProtect is not None:
+ write('#ifdef', self.featureExtraProtect, file=self.outFile)
+ self.newline()
+
+ # Generate warning of possible use in IDEs
+ write(f'// {self.featureName} is a preprocessor guard. Do not pass it to API calls.', file=self.outFile)
+ write('#define', self.featureName, '1', file=self.outFile)
+ for section in self.TYPE_SECTIONS:
+ contents = self.sections[section]
+ if contents:
+ write('\n'.join(contents), file=self.outFile)
+
+ if self.genOpts.genFuncPointers and self.sections['commandPointer']:
+ write('\n'.join(self.sections['commandPointer']), file=self.outFile)
+ self.newline()
+
+ if self.sections['command']:
+ if self.genOpts.protectProto:
+ write(self.genOpts.protectProto,
+ self.genOpts.protectProtoStr, file=self.outFile)
+ if self.genOpts.protectExtensionProto and not is_core:
+ write(self.genOpts.protectExtensionProto,
+ self.genOpts.protectExtensionProtoStr, file=self.outFile)
+ write('\n'.join(self.sections['command']), end='', file=self.outFile)
+ if self.genOpts.protectExtensionProto and not is_core:
+ write('#endif' +
+ self._endProtectComment(protect_directive=self.genOpts.protectExtensionProto,
+ protect_str=self.genOpts.protectExtensionProtoStr),
+ file=self.outFile)
+ if self.genOpts.protectProto:
+ write('#endif' +
+ self._endProtectComment(protect_directive=self.genOpts.protectProto,
+ protect_str=self.genOpts.protectProtoStr),
+ file=self.outFile)
+ else:
+ self.newline()
+
+ if self.featureExtraProtect is not None:
+ write('#endif' +
+ self._endProtectComment(protect_str=self.featureExtraProtect),
+ file=self.outFile)
+
+ if self.genOpts.protectFeature:
+ write('#endif' +
+ self._endProtectComment(protect_str=self.featureName),
+ file=self.outFile)
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def appendSection(self, section, text):
+ "Append a definition to the specified section"
+
+ if section is None:
+ self.logMsg('error', 'Missing section in appendSection (probably a <type> element missing its \'category\' attribute. Text:', text)
+ exit(1)
+
+ self.sections[section].append(text)
+ self.feature_not_empty = True
+
+ def genType(self, typeinfo, name, alias):
+ "Generate type."
+ OutputGenerator.genType(self, typeinfo, name, alias)
+ typeElem = typeinfo.elem
+
+ # Vulkan:
+ # Determine the category of the type, and the type section to add
+ # its definition to.
+ # 'funcpointer' is added to the 'struct' section as a workaround for
+ # internal issue #877, since structures and function pointer types
+ # can have cross-dependencies.
+ category = typeElem.get('category')
+ if category == 'funcpointer':
+ section = 'struct'
+ else:
+ section = category
+
+ if category in ('struct', 'union'):
+ # If the type is a struct type, generate it using the
+ # special-purpose generator.
+ self.genStruct(typeinfo, name, alias)
+ else:
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ # OpenXR: this section was not under 'else:' previously, just fell through
+ if alias:
+ # If the type is an alias, just emit a typedef declaration
+ body = 'typedef ' + alias + ' ' + name + ';\n'
+ else:
+ # Replace <apientry /> tags with an APIENTRY-style string
+ # (from self.genOpts). Copy other text through unchanged.
+ # If the resulting text is an empty string, do not emit it.
+ body = noneStr(typeElem.text)
+ for elem in typeElem:
+ if elem.tag == 'apientry':
+ body += self.genOpts.apientry + noneStr(elem.tail)
+ else:
+ body += noneStr(elem.text) + noneStr(elem.tail)
+ if category == 'define' and self.misracppstyle():
+ body = body.replace("(uint32_t)", "static_cast<uint32_t>")
+ if body:
+ # Add extra newline after multi-line entries.
+ if '\n' in body[0:-1]:
+ body += '\n'
+ self.appendSection(section, body)
+
+ def genProtectString(self, protect_str):
+ """Generate protection string.
+
+ Protection strings are the strings defining the OS/Platform/Graphics
+ requirements for a given API command. When generating the
+ language header files, we need to make sure the items specific to a
+ graphics API or OS platform are properly wrapped in #ifs."""
+ protect_if_str = ''
+ protect_end_str = ''
+ if not protect_str:
+ return (protect_if_str, protect_end_str)
+
+ if ',' in protect_str:
+ protect_list = protect_str.split(',')
+ protect_defs = ('defined(%s)' % d for d in protect_list)
+ protect_def_str = ' && '.join(protect_defs)
+ protect_if_str = '#if %s\n' % protect_def_str
+ protect_end_str = '#endif // %s\n' % protect_def_str
+ else:
+ protect_if_str = '#ifdef %s\n' % protect_str
+ protect_end_str = '#endif // %s\n' % protect_str
+
+ return (protect_if_str, protect_end_str)
+
+ def typeMayAlias(self, typeName):
+ if not self.may_alias:
+ if self.registry is None:
+ raise MissingRegistryError()
+ # First time we have asked if a type may alias.
+ # So, populate the set of all names of types that may.
+
+ # Everyone with an explicit mayalias="true"
+ self.may_alias = set(typeName
+ for typeName, data in self.registry.typedict.items()
+ if data.elem.get('mayalias') == 'true')
+
+ # Every type mentioned in some other type's parentstruct attribute.
+ polymorphic_bases = (otherType.elem.get('parentstruct')
+ for otherType in self.registry.typedict.values())
+ self.may_alias.update(set(x for x in polymorphic_bases
+ if x is not None))
+ return typeName in self.may_alias
+
+ def genStruct(self, typeinfo, typeName, alias):
+ """Generate struct (e.g. C "struct" type).
+
+ This is a special case of the <type> tag where the contents are
+ interpreted as a set of <member> tags instead of freeform C
+ C type declarations. The <member> tags are just like <param>
+ tags - they are a declaration of a struct or union member.
+ Only simple member declarations are supported (no nested
+ structs etc.)
+
+ If alias is not None, then this struct aliases another; just
+ generate a typedef of that alias."""
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+
+ typeElem = typeinfo.elem
+
+ if alias:
+ body = 'typedef ' + alias + ' ' + typeName + ';\n'
+ else:
+ body = ''
+ (protect_begin, protect_end) = self.genProtectString(typeElem.get('protect'))
+ if protect_begin:
+ body += protect_begin
+
+ if self.genOpts.genStructExtendsComment:
+ structextends = typeElem.get('structextends')
+ body += '// ' + typeName + ' extends ' + structextends + '\n' if structextends else ''
+
+ body += 'typedef ' + typeElem.get('category')
+
+ # This is an OpenXR-specific alternative where aliasing refers
+ # to an inheritance hierarchy of types rather than C-level type
+ # aliases.
+ if self.genOpts.genAliasMacro and self.typeMayAlias(typeName):
+ body += ' ' + self.genOpts.aliasMacro
+
+ body += ' ' + typeName + ' {\n'
+
+ targetLen = self.getMaxCParamTypeLength(typeinfo)
+ for member in typeElem.findall('.//member'):
+ body += self.makeCParamDecl(member, targetLen + 4)
+ body += ';\n'
+ body += '} ' + typeName + ';\n'
+ if protect_end:
+ body += protect_end
+
+ self.appendSection('struct', body)
+
+ def genGroup(self, groupinfo, groupName, alias=None):
+ """Generate groups (e.g. C "enum" type).
+
+ These are concatenated together with other types.
+
+ If alias is not None, it is the name of another group type
+ which aliases this type; just generate that alias."""
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+ groupElem = groupinfo.elem
+
+ # After either enumerated type or alias paths, add the declaration
+ # to the appropriate section for the group being defined.
+ if groupElem.get('type') == 'bitmask':
+ section = 'bitmask'
+ else:
+ section = 'group'
+
+ if alias:
+ # If the group name is aliased, just emit a typedef declaration
+ # for the alias.
+ body = 'typedef ' + alias + ' ' + groupName + ';\n'
+ self.appendSection(section, body)
+ else:
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ (section, body) = self.buildEnumCDecl(self.genOpts.genEnumBeginEndRange, groupinfo, groupName)
+ self.appendSection(section, '\n' + body)
+
+ def genEnum(self, enuminfo, name, alias):
+ """Generate the C declaration for a constant (a single <enum> value).
+
+ <enum> tags may specify their values in several ways, but are usually
+ just integers."""
+
+ OutputGenerator.genEnum(self, enuminfo, name, alias)
+
+ body = self.buildConstantCDecl(enuminfo, name, alias)
+ self.appendSection('enum', body)
+
+ def genCmd(self, cmdinfo, name, alias):
+ "Command generation"
+ OutputGenerator.genCmd(self, cmdinfo, name, alias)
+
+ # if alias:
+ # prefix = '// ' + name + ' is an alias of command ' + alias + '\n'
+ # else:
+ # prefix = ''
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+
+ prefix = ''
+ decls = self.makeCDecls(cmdinfo.elem)
+ self.appendSection('command', prefix + decls[0] + '\n')
+ if self.genOpts.genFuncPointers:
+ self.appendSection('commandPointer', decls[1])
+
+ def misracstyle(self):
+ return self.genOpts.misracstyle;
+
+ def misracppstyle(self):
+ return self.genOpts.misracppstyle;
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/checkXrefs b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/checkXrefs
new file mode 100755
index 00000000000..df9c51c9b36
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/checkXrefs
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Copyright 2015-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# checkXrefs - check internal links in a Vulkan HTML spec
+# Usage: checkXrefs file.html
+# Prints a list of internal hrefs with no corresponding anchors.
+# (There are many anchors with no corresponding hrefs - this is OK).
+
+xrefs=`tempfile`
+ids=`tempfile`
+
+sed -e 's/ href="#/\nhref="#/g' < $1 | \
+ grep 'href="#' | \
+ sed -e 's/href="#//g' -e 's/"[ >].*//g' | \
+ sort | uniq > $xrefs
+sed -e 's/ id="/\nid="/g' < $1 | \
+ grep 'id="' | \
+ sed -e 's/id="//g' -e 's/"[ >].*//g' | \
+ sort | uniq > $ids
+
+comm -23 $xrefs $ids
+
+rm $xrefs $ids 1>&2
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/check_html_xrefs.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/check_html_xrefs.py
new file mode 100755
index 00000000000..9f38fe07977
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/check_html_xrefs.py
@@ -0,0 +1,96 @@
+#!/usr/bin/python3
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# check_html_xrefs - simple-minded check for internal xrefs in spec HTML
+# that do not exist.
+
+# Usage: check_html_xrefs file
+# Just reports bad xrefs, not where they occur
+
+import argparse
+import re
+import sys
+from lxml import etree
+
+SECTNAME = re.compile(r'sect(?P<level>\d+)')
+
+def find_parent_ids(elem, href):
+ """Find section titles in parents, which are the 'id' elements of '<hN'
+ children of '<div class="sectM"' tags, and N = M + 1. This may be
+ specific to the Vulkan spec, though - hierarchy could be different in
+ other asciidoctor documents. Returns a list of [ anchor, title ].
+
+ elem - this node
+ href - href link text of elem"""
+
+ # Find parent <div> with class="sect#"
+ parent = elem.getparent()
+ while parent is not None:
+ if parent.tag == 'div':
+ cssclass = parent.get('class')
+ matches = SECTNAME.match(cssclass)
+ if matches is not None:
+ level = int(matches.group('level'))
+ # Look for corresponding header tag in this div
+ helem = parent.find('./h{}'.format(level+1))
+ if helem is not None:
+ return [ helem.get('id'), ''.join(helem.itertext()) ]
+ parent = parent.getparent()
+ return [ '** NO PARENT NODE IDENTIFIED **', '' ]
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('files', metavar='filename', nargs='*',
+ help='Path to registry XML')
+ args = parser.parse_args()
+
+ for filename in args.files:
+ parser = etree.HTMLParser()
+ tree = etree.parse(filename, parser)
+
+ # Find all 'id' elements
+ id_elems = tree.findall('.//*[@id]')
+ ids = set()
+ for elem in id_elems:
+ id = elem.get('id')
+ if id in ids:
+ True
+ # print('Duplicate ID attribute:', id)
+ else:
+ ids.add(id)
+
+ # Find all internal 'href' attributes and see if they are valid
+ # Keep an [element, href] list for tracking parents
+ # Also keep a count of each href
+ ref_elems = tree.findall('.//a[@href]')
+ refs = []
+ count = {}
+ for elem in ref_elems:
+ href = elem.get('href')
+ # If not a local href, skip it
+ if href[0] == '#':
+ # If there is a corresponding id, skip it
+ href = href[1:]
+ if href not in ids:
+ if href in count:
+ refs.append((elem, href))
+ True
+ count[href] = count[href] + 1
+ else:
+ refs.append((elem, href))
+ count[href] = 1
+ else:
+ True
+ # print('Skipping external href:', ref)
+
+ # Check for hrefs not found in ids
+ if len(refs) > 0:
+ print('Found bad links in {}:'.format(filename))
+ for (elem, href) in refs:
+ parents = find_parent_ids(elem, href)
+ print('{:<40} in {:<28} ({})'.format(href, parents[0], parents[1]))
+ sys.exit(1)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/check_spec_links.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/check_spec_links.py
new file mode 100755
index 00000000000..f4ae23213e1
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/check_spec_links.py
@@ -0,0 +1,182 @@
+#!/usr/bin/python3
+#
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+#
+# Purpose: This file performs some basic checks of the custom macros
+# used in the AsciiDoctor source for the spec, especially
+# related to the validity of the entities linked-to.
+
+from pathlib import Path
+
+from reg import Registry
+from spec_tools.entity_db import EntityDatabase
+from spec_tools.macro_checker import MacroChecker
+from spec_tools.macro_checker_file import MacroCheckerFile
+from spec_tools.main import checkerMain
+from spec_tools.shared import (AUTO_FIX_STRING, EXTENSION_CATEGORY, MessageId,
+ MessageType)
+
+###
+# "Configuration" constants
+
+FREEFORM_CATEGORY = 'freeform'
+
+# defines mentioned in spec but not needed in registry
+EXTRA_DEFINES = (
+ 'VKAPI_ATTR',
+ 'VKAPI_CALL',
+ 'VKAPI_PTR',
+ 'VK_NO_STDDEF_H',
+ 'VK_NO_STDINT_H',
+ )
+
+# Extra freeform refpages in addition to EXTRA_DEFINES
+EXTRA_REFPAGES = (
+ 'VK_VERSION_1_0',
+ 'VK_VERSION_1_1',
+ 'VK_VERSION_1_2',
+ 'VK_VERSION_1_3',
+ 'WSIheaders',
+ 'provisional-headers',
+ )
+
+# These are marked with the code: macro
+SYSTEM_TYPES = set(('void', 'char', 'float', 'size_t', 'uintptr_t',
+ 'int8_t', 'uint8_t',
+ 'int32_t', 'uint32_t',
+ 'int64_t', 'uint64_t'))
+
+ROOT = Path(__file__).resolve().parent.parent
+DEFAULT_DISABLED_MESSAGES = set((
+ MessageId.LEGACY,
+ MessageId.REFPAGE_MISSING,
+ MessageId.MISSING_MACRO,
+ MessageId.EXTENSION,
+ # TODO *text macro checking actually needs fixing for Vulkan
+ MessageId.MISUSED_TEXT,
+ MessageId.MISSING_TEXT
+))
+
+CWD = Path('.').resolve()
+
+
+class VulkanEntityDatabase(EntityDatabase):
+ """Vulkan-specific subclass of EntityDatabase."""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self._conditionally_recognized = set(('fname', 'sname'))
+
+ def makeRegistry(self):
+ registryFile = str(ROOT / 'xml/vk.xml')
+ registry = Registry()
+ registry.loadFile(registryFile)
+ return registry
+
+ def getNamePrefix(self):
+ return "vk"
+
+ def getPlatformRequires(self):
+ return 'vk_platform'
+
+ def getSystemTypes(self):
+ return SYSTEM_TYPES
+
+ def populateMacros(self):
+ self.addMacros('t', ['link', 'name'], ['funcpointers', 'flags'])
+
+ def populateEntities(self):
+ # These are not mentioned in the XML
+ for name in EXTRA_DEFINES:
+ self.addEntity(name, 'dlink',
+ category=FREEFORM_CATEGORY, generates=False)
+ for name in EXTRA_REFPAGES:
+ self.addEntity(name, 'code',
+ category=FREEFORM_CATEGORY, generates=False)
+
+ def shouldBeRecognized(self, macro, entity_name):
+ """Determine, based on the macro and the name provided, if we should expect to recognize the entity."""
+ if super().shouldBeRecognized(macro, entity_name):
+ return True
+
+ # The *name: macros in Vulkan should also be recognized if the entity name matches the pattern.
+ if macro in self._conditionally_recognized and self.likelyRecognizedEntity(entity_name):
+ return True
+ return False
+
+
+class VulkanMacroCheckerFile(MacroCheckerFile):
+ """Vulkan-specific subclass of MacroCheckerFile."""
+
+ def perform_entity_check(self, type):
+ """Returns True if an entity check should be performed on this
+ refpage type.
+
+ Overrides base class definition for Vulkan, since we have refpage
+ types which do not correspond to entities in the API."""
+
+ return type != 'builtins' and type != 'spirv'
+
+ def handleWrongMacro(self, msg, data):
+ """Report an appropriate message when we found that the macro used is incorrect.
+
+ May be overridden depending on each API's behavior regarding macro misuse:
+ e.g. in some cases, it may be considered a MessageId.LEGACY warning rather than
+ a MessageId.WRONG_MACRO or MessageId.EXTENSION.
+ """
+ message_type = MessageType.WARNING
+ message_id = MessageId.WRONG_MACRO
+ group = 'macro'
+
+ if data.category == EXTENSION_CATEGORY:
+ # Ah, this is an extension
+ msg.append(
+ 'This is apparently an extension name, which should be marked up as a link.')
+ message_id = MessageId.EXTENSION
+ group = None # replace the whole thing
+ else:
+ # Non-extension, we found the macro though.
+ if data.macro[0] == self.macro[0] and data.macro[1:] == 'link' and self.macro[1:] == 'name':
+ # First letter matches, old is 'name', new is 'link':
+ # This is legacy markup
+ msg.append(
+ 'This is legacy markup that has not been updated yet.')
+ message_id = MessageId.LEGACY
+ else:
+ # Not legacy, just wrong.
+ message_type = MessageType.ERROR
+
+ msg.append(AUTO_FIX_STRING)
+ self.diag(message_type, message_id, msg,
+ group=group, replacement=self.makeMacroMarkup(data=data), fix=self.makeFix(data=data))
+
+ def allowEnumXrefs(self):
+ """Returns True if enums can be specified in the 'xrefs' attribute
+ of a refpage.
+
+ Overrides base class behavior. OpenXR does not allow this.
+ """
+ return True
+
+def makeMacroChecker(enabled_messages):
+ """Create a correctly-configured MacroChecker instance."""
+ entity_db = VulkanEntityDatabase()
+ return MacroChecker(enabled_messages, entity_db, VulkanMacroCheckerFile, ROOT)
+
+
+if __name__ == '__main__':
+ default_enabled_messages = set(MessageId).difference(
+ DEFAULT_DISABLED_MESSAGES)
+
+ all_docs = [str(fn)
+ for fn in sorted((ROOT / 'chapters/').glob('**/[A-Za-z]*.adoc'))]
+ all_docs.extend([str(fn)
+ for fn in sorted((ROOT / 'appendices/').glob('**/[A-Za-z]*.adoc'))])
+ all_docs.append(str(ROOT / 'vkspec.adoc'))
+
+ checkerMain(default_enabled_messages, makeMacroChecker,
+ all_docs)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/ci/check_undefined b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/ci/check_undefined
new file mode 100755
index 00000000000..3dfcee093eb
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/ci/check_undefined
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Copyright 2020-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# scripts/ci/check_undefined
+# Check for non-tagged 'undefined' in spec sources.
+# Skip appendices/VK* files, which are non-normative.
+# Ideally we would skip NOTES too, but that would require parsing.
+
+undefined=/tmp/undefined
+ls chapters/*.adoc chapters/*/*.adoc appendices/[A-UW-Za-z]*.adoc | \
+ xargs egrep -E '(^|[[:space:]])undefined($|[^:])' > $undefined
+if test `cat $undefined | wc -l` -gt 0 ; then
+ echo "*** Found un-tagged uses of 'undefined'"
+ cat $undefined
+ rm $undefined
+ exit 1
+else
+ rm $undefined
+ exit 0
+fi
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/comment_convert.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/comment_convert.py
new file mode 100755
index 00000000000..f1fa938ce11
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/comment_convert.py
@@ -0,0 +1,203 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+#
+# Purpose: This script converts leading comments on some Python
+# classes and functions into docstrings.
+# It doesn't attempt to deal with line continuations, etc.
+# so you may want to "join line" on your def statements
+# temporarily before running.
+
+import re
+
+from spec_tools.file_process import LinewiseFileProcessor
+
+COMMENT_RE = re.compile(r" *#(!.*| (?P<content>.*))?")
+CONVERTIBLE_DEF_RE = re.compile(r"(?P<indentation> *)(def|class) .*:")
+
+
+class CommentConverter(LinewiseFileProcessor):
+ def __init__(self, single_line_quotes=False, allow_blank_lines=False):
+ super().__init__()
+ self.comment_lines = []
+ "Temporary storage for contiguous comment lines."
+
+ self.trailing_empty_lines = []
+ "Temporary storage for empty lines following a comment."
+
+ self.output_lines = []
+ "Fully-processed output lines."
+
+ self.single_line_quotes = single_line_quotes
+ "Whether we generate simple, single-line quotes for single line comments."
+
+ self.allow_blank_lines = allow_blank_lines
+ "Whether we allow blank lines between a comment and the thing it's considered to document."
+
+ self.done_with_initial_comment = False
+ "Have we read our first non-comment line yet?"
+
+ def output_line(self, line=None):
+ if line:
+ self.output_lines.append(line)
+ else:
+ self.output_lines.append("")
+
+ def output_normal_line(self, line):
+ # flush any comment lines we had stored and output this line.
+ self.dump_comment_lines()
+ self.output_line(line)
+
+ def dump_comment_lines(self):
+ # Early out for empty
+ if not self.comment_lines:
+ return
+
+ for line in self.comment_lines:
+ self.output_line(line)
+ self.comment_lines = []
+
+ for line in self.trailing_empty_lines:
+ self.output_line(line)
+ self.trailing_empty_lines = []
+
+ def dump_converted_comment_lines(self, indent):
+ # Early out for empty
+ if not self.comment_lines:
+ return
+
+ for line in self.trailing_empty_lines:
+ self.output_line(line)
+ self.trailing_empty_lines = []
+
+ indent = indent + ' '
+
+ def extract(line):
+ match = COMMENT_RE.match(line)
+ content = match.group('content')
+ if content:
+ return content
+ return ""
+
+ # Extract comment content
+ lines = [extract(line) for line in self.comment_lines]
+
+ # Drop leading empty comments.
+ while lines and not lines[0].strip():
+ lines.pop(0)
+
+ # Drop trailing empty comments.
+ while lines and not lines[-1].strip():
+ lines.pop()
+
+ # Add single- or multi-line-string quote
+ if self.single_line_quotes \
+ and len(lines) == 1 \
+ and '"' not in lines[0]:
+ quote = '"'
+ else:
+ quote = '"""'
+ lines[0] = quote + lines[0]
+ lines[-1] = lines[-1] + quote
+
+ # Output lines, indenting content as required.
+ for line in lines:
+ if line:
+ self.output_line(indent + line)
+ else:
+ # Don't indent empty comment lines
+ self.output_line()
+
+ # Clear stored comment lines since we processed them
+ self.comment_lines = []
+
+ def queue_comment_line(self, line):
+ if self.trailing_empty_lines:
+ # If we had blank lines between comment lines, they are separate blocks
+ self.dump_comment_lines()
+ self.comment_lines.append(line)
+
+ def handle_empty_line(self, line):
+ """Handle an empty line.
+
+ Contiguous empty lines between a comment and something documentable do not
+ disassociate the comment from the documentable thing.
+ We have someplace else to store these lines in case there isn't something
+ documentable coming up."""
+ if self.comment_lines and self.allow_blank_lines:
+ self.trailing_empty_lines.append(line)
+ else:
+ self.output_normal_line(line)
+
+ def is_next_line_doc_comment(self):
+ next_line = self.next_line_rstripped
+ if next_line is None:
+ return False
+
+ return next_line.strip().startswith('"')
+
+ def process_line(self, line_num, line):
+ line = line.rstrip()
+ comment_match = COMMENT_RE.match(line)
+ def_match = CONVERTIBLE_DEF_RE.match(line)
+
+ # First check if this is a comment line.
+ if comment_match:
+ if self.done_with_initial_comment:
+ self.queue_comment_line(line)
+ else:
+ self.output_line(line)
+ else:
+ # If not a comment line, then by definition we're done with the comment header.
+ self.done_with_initial_comment = True
+ if not line.strip():
+ self.handle_empty_line(line)
+ elif def_match and not self.is_next_line_doc_comment():
+ # We got something we can make a docstring for:
+ # print the thing the docstring is for first,
+ # then the converted comment.
+
+ indent = def_match.group('indentation')
+ self.output_line(line)
+ self.dump_converted_comment_lines(indent)
+ else:
+ # Can't make a docstring for this line:
+ self.output_normal_line(line)
+
+ def process(self, fn, write=False):
+ self.process_file(fn)
+
+ if write:
+ with open(fn, 'w', encoding='utf-8') as fp:
+ for line in self.output_lines:
+ fp.write(line)
+ fp.write('\n')
+
+ # Reset state
+ self.__init__(self.single_line_quotes, self.allow_blank_lines)
+
+
+def main():
+ import argparse
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('filenames', metavar='filename',
+ type=str, nargs='+',
+ help='A Python file to transform.')
+ parser.add_argument('-b', '--blanklines', action='store_true',
+ help='Allow blank lines between a comment and a define and still convert that comment.')
+
+ args = parser.parse_args()
+
+ converter = CommentConverter(allow_blank_lines=args.blanklines)
+ for fn in args.filenames:
+ print("Processing", fn)
+ converter.process(fn, write=True)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/compImages.sh b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/compImages.sh
new file mode 100755
index 00000000000..24d65ce0d41
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/compImages.sh
@@ -0,0 +1,127 @@
+#!/bin/bash
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# compareImages - compare all asciidoctor images in two branches
+# Usage: compareImages branch1 branch2
+
+# Where to put temporary files
+compare=compare
+
+branch1=$1
+branch2=$2
+
+echo "Preparing test tree under compare/"
+rm -rf $compare
+
+echo "Gathering images under compare/$1 compare/$2"
+if git checkout $branch1 ; then
+ img1=$compare/$branch1
+ files1=$compare/$branch1-files
+ mkdir -p $img1
+ cp images/*.svg $img1
+ (cd $img1 ; ls) > $files1
+else
+ echo "Cannot switch to branch $branch1"
+ rm -rf $compare
+ exit 1
+fi
+
+if git checkout $branch2 ; then
+ img2=$compare/$branch2
+ files2=$compare/$branch2-files
+ mkdir -p $img2
+ cp images/*.svg $img2
+ (cd $img2 ; ls) > $files2
+else
+ echo "Cannot switch to branch $branch2"
+ rm -rf $compare
+ exit 1
+fi
+
+srcfile=compare/compImages.adoc
+
+# Boilerplate header
+echo "= Image Comparison of Vulkan images in $branch1 $branch2
+:data-uri:
+:icons: font
+include::../config/attribs.adoc[]
+" > $srcfile
+
+
+# Files common to both branches
+echo "== Images Common to Both Branches
+" >> $srcfile
+
+# Identical images
+identical=()
+
+# Where to generate comparison images
+compdir=$compare/compare
+mkdir -p $compdir
+
+for file in `comm -12 $files1 $files2` ; do
+ echo "Comparing $file"
+ if diff -q $img1/$file $img2/$file > /dev/null ; then
+ identical+=( $file )
+ # Files are identical
+ else
+ # sum1=`sum $img1/$file | awk '{print $1}'`
+ # sum2=`sum $img2/$file | awk '{print $1}'`
+ #
+ # if test $sum1 -eq $sum2 ; then
+
+ # Generate comparison image
+ compfile="$compdir/$file"
+ compare $img1/$file $img2/$file $compfile
+
+ echo "=== $file
+
+image::$branch1/$file[title=\"$file in $branch1\",align=\"center\",opts=\"inline\"]
+
+image::$branch2/$file[title=\"$file in $branch2\",align=\"center\",opts=\"inline\"]
+
+image::compare/$file[title=\"Comparison of branches\",align=\"center\",opts=\"inline\"]
+
+<<<
+
+" >> $srcfile
+
+ fi
+done
+
+
+# Identical files
+echo "== Identical images
+" >> $srcfile
+
+for file in ${identical[@]} ; do
+ echo " * $file" >> $srcfile
+done
+echo >> $srcfile
+
+
+# Files only in first branch
+echo "== Images only in $branch1
+" >> $srcfile
+
+for file in `comm -23 $files1 $files2` ; do
+ echo " * $file" >> $srcfile
+done
+echo >> $srcfile
+
+
+# Files only in second branch
+echo "== Images only in $branch2
+" >> $srcfile
+
+for file in `comm -13 $files1 $files2` ; do
+ echo " * $file" >> $srcfile
+done
+echo >> $srcfile
+
+outfile=$compare/`basename $srcfile .adoc`.pdf
+echo "Generating $outfile from $srcfile"
+asciidoctor -b pdf -r asciidoctor-pdf -o $outfile $srcfile
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/deperiodize_vuids.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/deperiodize_vuids.py
new file mode 100755
index 00000000000..2bf32d21083
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/deperiodize_vuids.py
@@ -0,0 +1,40 @@
+#!/usr/bin/python3
+#
+# Copyright 2020 Petr Kraus
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Removes periods after Valid Usage sentence in the spec
+#
+# Usage:
+# cd <root of Vulkan-Docs repo>
+# ./scripts/deperiodize_vuids.py
+
+import os,re
+
+def deperiodizeFile(filename):
+ print(' Deperiodizing = %s' % filename)
+
+ with open(filename, 'r', encoding='utf8', newline='\n') as f:
+ data = f.read()
+
+ # Remove periods from VUs
+ data = re.sub( r'( \* \[\[VUID\-[\s\S]+?)\.?(?=(\n \* \[\[VUID\-)|(\n\*\*\*\*)|(\n// )|(\ninclude::)|(\nendif::)|(\nifdef::)|(\nifndef::))', r'\g<1>', data )
+
+ with open(filename, 'w', encoding='utf8', newline='\n') as f:
+ data = f.write(data)
+
+def deperiodizeFolder(folder):
+ print(' Parsing = %s' % folder)
+ for root, subdirs, files in os.walk(folder):
+ for file in files:
+ if file.endswith(".adoc"):
+ file_path = os.path.join(root, file)
+ deperiodizeFile(file_path)
+ for subdir in subdirs:
+ sub_folder = os.path.join(root, subdir)
+ deperiodizeFolder(sub_folder)
+
+if __name__ == '__main__':
+ deperiodizeFolder(os.getcwd() + '/chapters')
+ deperiodizeFolder(os.getcwd() + '/appendices')
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/docgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/docgenerator.py
new file mode 100644
index 00000000000..c1cf9062fdf
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/docgenerator.py
@@ -0,0 +1,510 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from pathlib import Path
+
+from generator import GeneratorOptions, OutputGenerator, noneStr, write
+from parse_dependency import dependencyLanguageComment
+
+_ENUM_TABLE_PREFIX = """
+[cols=",",options="header",]
+|====
+|Enum |Description"""
+
+_TABLE_SUFFIX = """|===="""
+
+_ENUM_BLOCK_PREFIX = """.Enumerant Descriptions
+****"""
+
+_FLAG_BLOCK_PREFIX = """.Flag Descriptions
+****"""
+
+_BLOCK_SUFFIX = """****"""
+
+def orgLevelKey(name):
+ # Sort key for organization levels of features / extensions
+ # From highest to lowest, core versions, KHR extensions, EXT extensions,
+ # and vendor extensions
+
+ prefixes = (
+ 'VK_VERSION_',
+ 'VKSC_VERSION_',
+ 'VK_KHR_',
+ 'VK_EXT_')
+
+ i = 0
+ for prefix in prefixes:
+ if name.startswith(prefix):
+ return i
+ i += 1
+
+ # Everything else (e.g. vendor extensions) is least important
+ return i
+
+
+class DocGeneratorOptions(GeneratorOptions):
+ """DocGeneratorOptions - subclass of GeneratorOptions for
+ generating declaration snippets for the spec.
+
+ Shares many members with CGeneratorOptions, since
+ both are writing C-style declarations."""
+
+ def __init__(self,
+ prefixText="",
+ apicall='',
+ apientry='',
+ apientryp='',
+ indentFuncProto=True,
+ indentFuncPointer=False,
+ alignFuncParam=0,
+ secondaryInclude=False,
+ expandEnumerants=True,
+ extEnumerantAdditions=False,
+ extEnumerantFormatString=" (Added by the {} extension)",
+ **kwargs):
+ """Constructor.
+
+ Since this generator outputs multiple files at once,
+ the filename is just a "stamp" to indicate last generation time.
+
+ Shares many parameters/members with CGeneratorOptions, since
+ both are writing C-style declarations:
+
+ - prefixText - list of strings to prefix generated header with
+ (usually a copyright statement + calling convention macros).
+ - apicall - string to use for the function declaration prefix,
+ such as APICALL on Windows.
+ - apientry - string to use for the calling convention macro,
+ in typedefs, such as APIENTRY.
+ - apientryp - string to use for the calling convention macro
+ in function pointer typedefs, such as APIENTRYP.
+ - indentFuncProto - True if prototype declarations should put each
+ parameter on a separate line
+ - indentFuncPointer - True if typedefed function pointers should put each
+ parameter on a separate line
+ - alignFuncParam - if nonzero and parameters are being put on a
+ separate line, align parameter names at the specified column
+
+ Additional parameters/members:
+
+ - expandEnumerants - if True, add BEGIN/END_RANGE macros in enumerated
+ type declarations
+ - secondaryInclude - if True, add secondary (no xref anchor) versions
+ of generated files
+ - extEnumerantAdditions - if True, include enumerants added by extensions
+ in comment tables for core enumeration types.
+ - extEnumerantFormatString - A format string for any additional message for
+ enumerants from extensions if extEnumerantAdditions is True. The correctly-
+ marked-up extension name will be passed.
+ """
+ GeneratorOptions.__init__(self, **kwargs)
+ self.prefixText = prefixText
+ """list of strings to prefix generated header with (usually a copyright statement + calling convention macros)."""
+
+ self.apicall = apicall
+ """string to use for the function declaration prefix, such as APICALL on Windows."""
+
+ self.apientry = apientry
+ """string to use for the calling convention macro, in typedefs, such as APIENTRY."""
+
+ self.apientryp = apientryp
+ """string to use for the calling convention macro in function pointer typedefs, such as APIENTRYP."""
+
+ self.indentFuncProto = indentFuncProto
+ """True if prototype declarations should put each parameter on a separate line"""
+
+ self.indentFuncPointer = indentFuncPointer
+ """True if typedefed function pointers should put each parameter on a separate line"""
+
+ self.alignFuncParam = alignFuncParam
+ """if nonzero and parameters are being put on a separate line, align parameter names at the specified column"""
+
+ self.secondaryInclude = secondaryInclude
+ """if True, add secondary (no xref anchor) versions of generated files"""
+
+ self.expandEnumerants = expandEnumerants
+ """if True, add BEGIN/END_RANGE macros in enumerated type declarations"""
+
+ self.extEnumerantAdditions = extEnumerantAdditions
+ """if True, include enumerants added by extensions in comment tables for core enumeration types."""
+
+ self.extEnumerantFormatString = extEnumerantFormatString
+ """A format string for any additional message for
+ enumerants from extensions if extEnumerantAdditions is True. The correctly-
+ marked-up extension name will be passed."""
+
+
+class DocOutputGenerator(OutputGenerator):
+ """DocOutputGenerator - subclass of OutputGenerator.
+
+ Generates AsciiDoc includes with C-language API interfaces, for reference
+ pages and the corresponding specification. Similar to COutputGenerator,
+ but each interface is written into a different file as determined by the
+ options, only actual C types are emitted, and none of the boilerplate
+ preprocessor code is emitted."""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ # This should be a separate conventions property rather than an
+ # inferred type name pattern for different APIs.
+ self.result_type = genOpts.conventions.type_prefix + "Result"
+
+ def endFile(self):
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ # Start processing in superclass
+ OutputGenerator.beginFeature(self, interface, emit)
+
+ # Decide if we are in a core <feature> or an <extension>
+ self.in_core = (interface.tag == 'feature')
+
+ def endFeature(self):
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def genRequirements(self, name, mustBeFound = True):
+ """Generate text showing what core versions and extensions introduce
+ an API. This relies on the map in apimap.py, which may be loaded at
+ runtime into self.apidict. If not present, no message is
+ generated.
+
+ - name - name of the API
+ - mustBeFound - If True, when requirements for 'name' cannot be
+ determined, a warning comment is generated.
+ """
+
+ if self.apidict:
+ if name in self.apidict.requiredBy:
+ # It is possible to get both 'A with B' and 'B with A' for
+ # the same API.
+ # To simplify this, sort the (base,dependency) requirements
+ # and put them in a set to ensure they are unique.
+ features = set()
+ # 'dependency' may be a boolean expression of extension names
+ for (base,dependency) in self.apidict.requiredBy[name]:
+ if dependency is not None:
+ # 'dependency' may be a boolean expression of extension
+ # names, in which case the sorting will not work well.
+
+ # First, convert it from asciidoctor markup to language.
+ depLanguage = dependencyLanguageComment(dependency)
+
+ # If they are the same, the dependency is only a
+ # single extension, and sorting them works.
+ # Otherwise, skip it.
+ if depLanguage == dependency:
+ deps = sorted(
+ sorted((base, dependency)),
+ key=orgLevelKey)
+ depString = ' with '.join(deps)
+ else:
+ # An expression with multiple extensions
+ depString = f'{base} with {depLanguage}'
+
+ features.add(depString)
+ else:
+ features.add(base)
+ # Sort the overall dependencies so core versions are first
+ provider = ', '.join(sorted(
+ sorted(features),
+ key=orgLevelKey))
+ return f'// Provided by {provider}\n'
+ else:
+ if mustBeFound:
+ self.logMsg('warn', 'genRequirements: API {} not found'.format(name))
+ return ''
+ else:
+ # No API dictionary available, return nothing
+ return ''
+
+ def writeInclude(self, directory, basename, contents):
+ """Generate an include file.
+
+ - directory - subdirectory to put file in
+ - basename - base name of the file
+ - contents - contents of the file (Asciidoc boilerplate aside)"""
+ # Create subdirectory, if needed
+ directory = self.genOpts.directory + '/' + directory
+ self.makeDir(directory)
+
+ # Create file
+ filename = directory + '/' + basename + self.file_suffix
+ self.logMsg('diag', '# Generating include file:', filename)
+ fp = open(filename, 'w', encoding='utf-8')
+
+ # Asciidoc anchor
+ write(self.genOpts.conventions.warning_comment, file=fp)
+ write('[[{0}]]'.format(basename), file=fp)
+
+ if self.genOpts.conventions.generate_index_terms:
+ if basename.startswith(self.conventions.command_prefix):
+ index_term = basename + " (function)"
+ elif basename.startswith(self.conventions.type_prefix):
+ index_term = basename + " (type)"
+ elif basename.startswith(self.conventions.api_prefix):
+ index_term = basename + " (define)"
+ else:
+ index_term = basename
+ write('indexterm:[{}]'.format(index_term), file=fp)
+
+ write('[source,c++]', file=fp)
+ write('----', file=fp)
+ write(contents, file=fp)
+ write('----', file=fp)
+ fp.close()
+
+ if self.genOpts.secondaryInclude:
+ # Create secondary no cross-reference include file
+ filename = f'{directory}/{basename}.no-xref{self.file_suffix}'
+ self.logMsg('diag', '# Generating include file:', filename)
+ fp = open(filename, 'w', encoding='utf-8')
+
+ # Asciidoc anchor
+ write(self.genOpts.conventions.warning_comment, file=fp)
+ write('// Include this no-xref version without cross reference id for multiple includes of same file', file=fp)
+ write('[source,c++]', file=fp)
+ write('----', file=fp)
+ write(contents, file=fp)
+ write('----', file=fp)
+ fp.close()
+
+ def writeEnumTable(self, basename, values):
+ """Output a table of enumerants."""
+ directory = Path(self.genOpts.directory) / 'enums'
+ self.makeDir(str(directory))
+
+ filename = str(directory / f'{basename}.comments{self.file_suffix}')
+ self.logMsg('diag', '# Generating include file:', filename)
+
+ with open(filename, 'w', encoding='utf-8') as fp:
+ write(self.conventions.warning_comment, file=fp)
+ write(_ENUM_TABLE_PREFIX, file=fp)
+
+ for data in values:
+ write("|ename:{}".format(data['name']), file=fp)
+ write("|{}".format(data['comment']), file=fp)
+
+ write(_TABLE_SUFFIX, file=fp)
+
+ def writeBox(self, filename, prefix, items):
+ """Write a generalized block/box for some values."""
+ self.logMsg('diag', '# Generating include file:', filename)
+
+ with open(filename, 'w', encoding='utf-8') as fp:
+ write(self.conventions.warning_comment, file=fp)
+ write(prefix, file=fp)
+
+ for item in items:
+ write("* {}".format(item), file=fp)
+
+ write(_BLOCK_SUFFIX, file=fp)
+
+ def writeEnumBox(self, basename, values):
+ """Output a box of enumerants."""
+ directory = Path(self.genOpts.directory) / 'enums'
+ self.makeDir(str(directory))
+
+ filename = str(directory / f'{basename}.comments-box{self.file_suffix}')
+ self.writeBox(filename, _ENUM_BLOCK_PREFIX,
+ ("ename:{} -- {}".format(data['name'], data['comment'])
+ for data in values))
+
+ def writeFlagBox(self, basename, values):
+ """Output a box of flag bit comments."""
+ directory = Path(self.genOpts.directory) / 'enums'
+ self.makeDir(str(directory))
+
+ filename = str(directory / f'{basename}.comments{self.file_suffix}')
+ self.writeBox(filename, _FLAG_BLOCK_PREFIX,
+ ("ename:{} -- {}".format(data['name'], data['comment'])
+ for data in values))
+
+ def genType(self, typeinfo, name, alias):
+ """Generate type."""
+ OutputGenerator.genType(self, typeinfo, name, alias)
+ typeElem = typeinfo.elem
+ # If the type is a struct type, traverse the embedded <member> tags
+ # generating a structure. Otherwise, emit the tag text.
+ category = typeElem.get('category')
+
+ if category in ('struct', 'union'):
+ # If the type is a struct type, generate it using the
+ # special-purpose generator.
+ self.genStruct(typeinfo, name, alias)
+ elif category not in OutputGenerator.categoryToPath:
+ # If there is no path, do not write output
+ self.logMsg('diag', 'NOT writing include for {} category {}'.format(
+ name, category))
+ else:
+ body = self.genRequirements(name)
+ if alias:
+ # If the type is an alias, just emit a typedef declaration
+ body += 'typedef ' + alias + ' ' + name + ';\n'
+ self.writeInclude(OutputGenerator.categoryToPath[category],
+ name, body)
+ else:
+ # Replace <apientry /> tags with an APIENTRY-style string
+ # (from self.genOpts). Copy other text through unchanged.
+ # If the resulting text is an empty string, do not emit it.
+ body += noneStr(typeElem.text)
+ for elem in typeElem:
+ if elem.tag == 'apientry':
+ body += self.genOpts.apientry + noneStr(elem.tail)
+ else:
+ body += noneStr(elem.text) + noneStr(elem.tail)
+
+ if body:
+ self.writeInclude(OutputGenerator.categoryToPath[category],
+ name, body + '\n')
+ else:
+ self.logMsg('diag', 'NOT writing empty include file for type', name)
+
+ def genStructBody(self, typeinfo, typeName):
+ """
+ Returns the body generated for a struct.
+
+ Factored out to allow aliased types to also generate the original type.
+ """
+ typeElem = typeinfo.elem
+ body = 'typedef ' + typeElem.get('category') + ' ' + typeName + ' {\n'
+
+ targetLen = self.getMaxCParamTypeLength(typeinfo)
+ for member in typeElem.findall('.//member'):
+ body += self.makeCParamDecl(member, targetLen + 4)
+ body += ';\n'
+ body += '} ' + typeName + ';'
+ return body
+
+ def genStruct(self, typeinfo, typeName, alias):
+ """Generate struct."""
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+
+ body = self.genRequirements(typeName)
+ if alias:
+ if self.conventions.duplicate_aliased_structs:
+ # TODO maybe move this outside the conditional? This would be a visual change.
+ body += '// {} is an alias for {}\n'.format(typeName, alias)
+ alias_info = self.registry.typedict[alias]
+ body += self.genStructBody(alias_info, alias)
+ body += '\n\n'
+ body += 'typedef ' + alias + ' ' + typeName + ';\n'
+ else:
+ body += self.genStructBody(typeinfo, typeName)
+
+ self.writeInclude('structs', typeName, body)
+
+ def genEnumTable(self, groupinfo, groupName):
+ """Generate tables of enumerant values and short descriptions from
+ the XML."""
+
+ values = []
+ got_comment = False
+ missing_comments = []
+ for elem in groupinfo.elem.findall('enum'):
+ if not elem.get('required'):
+ continue
+ name = elem.get('name')
+
+ data = {
+ 'name': name,
+ }
+
+ (numVal, _) = self.enumToValue(elem, True)
+ data['value'] = numVal
+
+ extname = elem.get('extname')
+
+ added_by_extension_to_core = (extname is not None and self.in_core)
+ if added_by_extension_to_core and not self.genOpts.extEnumerantAdditions:
+ # We are skipping such values
+ continue
+
+ comment = elem.get('comment')
+ if comment:
+ got_comment = True
+ elif name.endswith('_UNKNOWN') and numVal == 0:
+ # This is a placeholder for 0-initialization to be clearly invalid.
+ # Just skip this silently
+ continue
+ else:
+ # Skip but record this in case it is an odd-one-out missing
+ # a comment.
+ missing_comments.append(name)
+ continue
+
+ if added_by_extension_to_core and self.genOpts.extEnumerantFormatString:
+ # Add a note to the comment
+ comment += self.genOpts.extEnumerantFormatString.format(
+ self.conventions.formatExtension(extname))
+
+ data['comment'] = comment
+ values.append(data)
+
+ if got_comment:
+ # If any had a comment, output it.
+
+ if missing_comments:
+ self.logMsg('warn', 'The following values for', groupName,
+ 'were omitted from the table due to missing comment attributes:',
+ ', '.join(missing_comments))
+
+ group_type = groupinfo.elem.get('type')
+ if groupName == self.result_type:
+ # Split this into success and failure
+ self.writeEnumTable(groupName + '.success',
+ (data for data in values
+ if data['value'] >= 0))
+ self.writeEnumTable(groupName + '.error',
+ (data for data in values
+ if data['value'] < 0))
+ elif group_type == 'bitmask':
+ self.writeFlagBox(groupName, values)
+ elif group_type == 'enum':
+ self.writeEnumTable(groupName, values)
+ self.writeEnumBox(groupName, values)
+ else:
+ raise RuntimeError("Unrecognized enums type: " + str(group_type))
+
+ def genGroup(self, groupinfo, groupName, alias):
+ """Generate group (e.g. C "enum" type)."""
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+
+ body = self.genRequirements(groupName)
+ if alias:
+ # If the group name is aliased, just emit a typedef declaration
+ # for the alias.
+ body += 'typedef ' + alias + ' ' + groupName + ';\n'
+ else:
+ expand = self.genOpts.expandEnumerants
+ (_, enumbody) = self.buildEnumCDecl(expand, groupinfo, groupName)
+ body += enumbody
+ if self.genOpts.conventions.generate_enum_table:
+ self.genEnumTable(groupinfo, groupName)
+
+ self.writeInclude('enums', groupName, body)
+
+ def genEnum(self, enuminfo, name, alias):
+ """Generate the C declaration for a constant (a single <enum> value)."""
+
+ OutputGenerator.genEnum(self, enuminfo, name, alias)
+
+ body = self.buildConstantCDecl(enuminfo, name, alias)
+
+ self.writeInclude('enums', name, body)
+
+ def genCmd(self, cmdinfo, name, alias):
+ "Generate command."
+ OutputGenerator.genCmd(self, cmdinfo, name, alias)
+
+ body = self.genRequirements(name)
+ decls = self.makeCDecls(cmdinfo.elem)
+ body += decls[0]
+ self.writeInclude('protos', name, body)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/doctransformer.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/doctransformer.py
new file mode 100644
index 00000000000..05f6600f9dc
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/doctransformer.py
@@ -0,0 +1,449 @@
+# Copyright 2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+"""Utilities for automatic transformation of spec sources. Most of the logic
+has to do with detecting asciidoc markup or block types that should not be
+transformed (tables, code) and ignoring them. It is very likely there are many
+asciidoc constructs not yet accounted for in the script, our usage of asciidoc
+markup is intentionally somewhat limited.
+"""
+
+import re
+import sys
+from reflib import logDiag, logWarn
+
+# Vulkan-specific - will consolidate into scripts/ like OpenXR soon
+sys.path.insert(0, 'xml')
+
+from apiconventions import APIConventions
+conventions = APIConventions()
+
+# Start of an asciidoctor conditional
+# ifdef::
+# ifndef::
+conditionalStart = re.compile(r'^(ifdef|ifndef)::')
+
+# Markup that always ends a paragraph
+# empty line or whitespace
+# [block options]
+# [[anchor]]
+# // comment
+# <<<< page break
+# :attribute-setting
+# macro-directive::terms
+# + standalone list item continuation
+# label:: labelled list - label must be standalone
+endPara = re.compile(r'^( *|\[.*\]|//.*|<<<<|:.*|[a-z]+::.*|\+|.*::)$')
+
+# Special case of markup ending a paragraph, used to track the current
+# command/structure. This allows for either OpenXR or Vulkan API path
+# conventions. Nominally it should use the file suffix defined by the API
+# conventions (conventions.file_suffix), except that XR uses '.txt' for
+# generated API include files, not '.adoc' like its other includes.
+includePat = re.compile(
+ r'include::(?P<directory_traverse>((../){1,4}|\{generated\}/)(generated/)?)(?P<generated_type>[\w]+)/(?P<category>\w+)/(?P<entity_name>[^./]+).adoc[\[][\]]')
+
+# Markup that is OK in a contiguous paragraph but otherwise passed through
+# .anything (except .., which indicates a literal block)
+# === Section Titles
+# image::path_to_image[attributes] (apparently a single colon is OK but less idiomatic)
+endParaContinue = re.compile(r'^(\.[^.].*|=+ .*|image:.*\[.*\])$')
+
+# Markup for block delimiters whose contents *should* be reformatted
+# -- (exactly two) (open block)
+# **** (4 or more) (sidebar block)
+# ==== (4 or more) (example block)
+# ____ (4 or more) (quote block)
+blockTransform = re.compile(r'^(--|[*=_]{4,})$')
+
+# Fake block delimiters for "common" VU statements
+blockCommonTransform = '// Common Valid Usage\n'
+
+# Markup for block delimiters whose contents should *not* be transformed
+# |=== (3 or more) (table)
+# ``` (3 or more) (listing block)
+# //// (4 or more) (comment block)
+# ---- (4 or more) (listing block)
+# .... (4 or more) (literal block)
+# ++++ (4 or more) (passthrough block)
+blockPassthrough = re.compile(r'^(\|={3,}|[`]{3}|[\-+./]{4,})$')
+
+# Markup for introducing lists (hanging paragraphs)
+# * bullet
+# ** bullet
+# -- bullet
+# . bullet
+# :: bullet (no longer supported by asciidoctor 2)
+# {empty}:: bullet
+# 1. list item
+# <1> source listing callout
+beginBullet = re.compile(r'^ *([-*.]+|\{empty\}::|::|[0-9]+[.]|<([0-9]+)>) ')
+
+class TransformState:
+ """State machine for transforming documents.
+
+ Represents the state of the transform operation"""
+ def __init__(self):
+ self.blockStack = [ None ]
+ """The last element is a line with the asciidoc block delimiter that is
+ currently in effect, such as '--', '----', '****', '====', or '++++'.
+ This affects whether or not the block contents should be transformed."""
+ self.transformStack = [ True ]
+ """The last element is True or False if the current blockStack contents
+ should be transformed."""
+ self.vuStack = [ False ]
+ """the last element is True or False if the current blockStack contents
+ are an explicit Valid Usage block."""
+
+ self.para = []
+ """list of lines in the paragraph being accumulated.
+ When this is non-empty, there is a current paragraph."""
+
+ self.lastTitle = False
+ """true if the previous line was a document title line
+ (e.g. :leveloffset: 0 - no attempt to track changes to this is made)."""
+
+ self.leadIndent = 0
+ """indent level (in spaces) of the first line of a paragraph."""
+
+ self.hangIndent = 0
+ """indent level of the remaining lines of a paragraph."""
+
+ self.lineNumber = 0
+ """line number being read from the input file."""
+
+ self.defaultApiName = '{refpage}'
+ self.apiName = self.defaultApiName
+ """String name of an API structure or command for VUID tag generation,
+ or {refpage} if one has not been included in this file yet."""
+
+ def incrLineNumber(self):
+ self.lineNumber = self.lineNumber + 1
+
+ def isOpenBlockDelimiter(self, line):
+ """Returns True if line is an open block delimiter.
+ This does not and should not match the listing block delimiter,
+ which is used inside refpage blocks both as a listing block and,
+ via an extension, as a nested open block."""
+ return line.rstrip() == '--'
+
+ def resetPara(self):
+ """Reset the paragraph, including its indentation level"""
+ self.para = []
+ self.leadIndent = 0
+ self.hangIndent = 0
+
+ def endBlock(self, line, transform, vuBlock):
+ """If beginning a block, tag whether or not to transform the contents.
+
+ vuBlock is True if the previous line indicates this is a Valid Usage
+ block."""
+ if self.blockStack[-1] == line:
+ logDiag('endBlock line', self.lineNumber,
+ ': popping block end depth:', len(self.blockStack),
+ ':', line, end='')
+
+ # Reset apiName at the end of an open block.
+ # Open blocks cannot be nested (at present), so this is safe.
+ if self.isOpenBlockDelimiter(line):
+ logDiag('reset apiName to empty at line', self.lineNumber)
+ self.apiName = self.defaultApiName
+ else:
+ logDiag('NOT resetting apiName to default at line',
+ self.lineNumber)
+
+ self.blockStack.pop()
+ self.transformStack.pop()
+ self.vuStack.pop()
+ else:
+ # Start a block
+ self.blockStack.append(line)
+ self.transformStack.append(transform)
+ self.vuStack.append(vuBlock)
+
+ logDiag('endBlock transform =', transform, ' line', self.lineNumber,
+ ': pushing block start depth', len(self.blockStack),
+ ':', line, end='')
+
+ def addLine(self, line, indent):
+ """Add a line to the current paragraph"""
+ if self.para == []:
+ # Begin a new paragraph
+ self.para = [line]
+ self.leadIndent = indent
+ self.hangIndent = indent
+ else:
+ # Add a line to a paragraph. Increase the hanging indentation
+ # level - once.
+ if self.hangIndent == self.leadIndent:
+ self.hangIndent = indent
+ self.para.append(line)
+
+
+class TransformCallbackState:
+ """State given to the transformer callback object, derived from
+ TransformState."""
+ def __init__(self, state):
+ self.isVU = state.vuStack[-1] if len(state.vuStack) > 0 else False
+ """Whether this paragraph is a VU."""
+
+ self.apiName = state.apiName
+ """String name of an API structure or command this paragraph belongs
+ to."""
+
+ self.leadIndent = state.leadIndent
+ """indent level (in spaces) of the first line of a paragraph."""
+
+ self.hangIndent = state.hangIndent
+ """indent level of the remaining lines of a paragraph."""
+
+ self.lineNumber = state.lineNumber
+ """line number being read from the input file."""
+
+
+class DocTransformer:
+ """A transformer that recursively goes over all spec files under a path.
+
+ The transformer goes over all spec files under a path and does some basic
+ parsing. In particular, it tracks which section the current text belongs
+ to, whether it references a VU, etc and processes them in 'paragraph'
+ granularity.
+ The transformer takes a callback object with the following methods:
+
+ - transformParagraph: Called when a paragraph is parsed. The paragraph
+ along with some information (such as whether it is a VU) is passed. The
+ function may transform the paragraph as necessary.
+ - onEmbeddedVUConditional: Called when an embedded VU conditional is
+ encountered.
+ """
+ def __init__(self,
+ filename,
+ outfile,
+ callback):
+ self.filename = filename
+ """base name of file being read from."""
+
+ self.outfile = outfile
+ """file handle to write to."""
+
+ self.state = TransformState()
+ """State of transformation"""
+
+ self.callback = callback
+ """The transformation callback object"""
+
+ def printLines(self, lines):
+ """Print an array of lines with newlines already present"""
+ if len(lines) > 0:
+ logDiag(':: printLines:', len(lines), 'lines: ', lines[0], end='')
+
+ if self.outfile is not None:
+ for line in lines:
+ print(line, file=self.outfile, end='')
+
+ def emitPara(self):
+ """Emit a paragraph, possibly transforming it depending on the block
+ context.
+
+ Resets the paragraph accumulator."""
+ if self.state.para != []:
+ transformedPara = self.state.para
+
+ if self.state.transformStack[-1]:
+ callbackState = TransformCallbackState(self.state)
+
+ transformedPara = self.callback.transformParagraph(
+ self.state.para,
+ callbackState)
+
+ self.printLines(transformedPara)
+
+ self.state.resetPara()
+
+ def endPara(self, line):
+ """'line' ends a paragraph and should itself be emitted.
+ line may be None to indicate EOF or other exception."""
+ logDiag('endPara line', self.state.lineNumber, ': emitting paragraph')
+
+ # Emit current paragraph, this line, and reset tracker
+ self.emitPara()
+
+ if line:
+ self.printLines([line])
+
+ def endParaContinue(self, line):
+ """'line' ends a paragraph (unless there is already a paragraph being
+ accumulated, e.g. len(para) > 0 - currently not implemented)"""
+ self.endPara(line)
+
+ def endBlock(self, line, transform = False, vuBlock = False):
+ """'line' begins or ends a block.
+
+ If beginning a block, tag whether or not to transform the contents.
+
+ vuBlock is True if the previous line indicates this is a Valid Usage
+ block."""
+ self.endPara(line)
+ self.state.endBlock(line, transform, vuBlock)
+
+ def endParaBlockTransform(self, line, vuBlock):
+ """'line' begins or ends a block. The paragraphs in the block *should* be
+ reformatted (e.g. a NOTE)."""
+ self.endBlock(line, transform = True, vuBlock = vuBlock)
+
+ def endParaBlockPassthrough(self, line):
+ """'line' begins or ends a block. The paragraphs in the block should
+ *not* be reformatted (e.g. a code listing)."""
+ self.endBlock(line, transform = False)
+
+ def addLine(self, line):
+ """'line' starts or continues a paragraph.
+
+ Paragraphs may have "hanging indent", e.g.
+
+ ```
+ * Bullet point...
+ ... continued
+ ```
+
+ In this case, when the higher indentation level ends, so does the
+ paragraph."""
+ logDiag('addLine line', self.state.lineNumber, ':', line, end='')
+
+ # See https://stackoverflow.com/questions/13648813/what-is-the-pythonic-way-to-count-the-leading-spaces-in-a-string
+ indent = len(line) - len(line.lstrip())
+
+ # A hanging paragraph ends due to a less-indented line.
+ if self.state.para != [] and indent < self.state.hangIndent:
+ logDiag('addLine: line reduces indentation, emit paragraph')
+ self.emitPara()
+
+ # A bullet point (or something that looks like one) always ends the
+ # current paragraph.
+ if beginBullet.match(line):
+ logDiag('addLine: line matches beginBullet, emit paragraph')
+ self.emitPara()
+
+ self.state.addLine(line, indent)
+
+ def apiMatch(self, oldname, newname):
+ """Returns whether oldname and newname match, up to an API suffix.
+ This should use the API map instead of this heuristic, since aliases
+ like VkPhysicalDeviceVariablePointerFeaturesKHR ->
+ VkPhysicalDeviceVariablePointersFeatures are not recognized."""
+ upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ return oldname.rstrip(upper) == newname.rstrip(upper)
+
+ def transformFile(self, lines):
+ """Transform lines, and possibly output to to the given file."""
+
+ for line in lines:
+ self.state.incrLineNumber()
+
+ # Is this a title line (leading '= ' followed by text)?
+ thisTitle = False
+
+ # The logic here is broken. If we are in a non-transformable block and
+ # this line *does not* end the block, it should always be
+ # accumulated.
+
+ # Test for a blockCommonTransform delimiter comment first, to avoid
+ # treating it solely as a end-Paragraph marker comment.
+ if line == blockCommonTransform:
+ # Starting or ending a pseudo-block for "common" VU statements.
+ self.endParaBlockTransform(line, vuBlock = True)
+
+ elif blockTransform.match(line):
+ # Starting or ending a block whose contents may be transformed.
+ # Blocks cannot be nested.
+
+ # Is this is an explicit Valid Usage block?
+ vuBlock = (self.state.lineNumber > 1 and
+ lines[self.state.lineNumber-2] == '.Valid Usage\n')
+
+ self.endParaBlockTransform(line, vuBlock)
+
+ elif endPara.match(line):
+ # Ending a paragraph. Emit the current paragraph, if any, and
+ # prepare to begin a new paragraph.
+
+ self.endPara(line)
+
+ # If this is an include:: line starting the definition of a
+ # structure or command, track that for use in VUID generation.
+
+ matches = includePat.search(line)
+ if matches is not None:
+ generated_type = matches.group('generated_type')
+ include_type = matches.group('category')
+ if generated_type == 'api' and include_type in ('protos', 'structs', 'funcpointers'):
+ apiName = matches.group('entity_name')
+ if self.state.apiName != self.state.defaultApiName:
+ # This happens when there are multiple API include
+ # lines in a single block. The style guideline is to
+ # always place the API which others are promoted to
+ # first. In virtually all cases, the promoted API
+ # will differ solely in the vendor suffix (or
+ # absence of it), which is benign.
+ if not self.apiMatch(self.state.apiName, apiName):
+ logDiag(f'Promoted API name mismatch at line {self.state.lineNumber}: {apiName} does not match self.state.apiName (this is OK if it is just a spelling alias)')
+ else:
+ self.state.apiName = apiName
+
+ elif endParaContinue.match(line):
+ # For now, always just end the paragraph.
+ # Could check see if len(para) > 0 to accumulate.
+
+ self.endParaContinue(line)
+
+ # If it is a title line, track that
+ if line[0:2] == '= ':
+ thisTitle = True
+
+ elif blockPassthrough.match(line):
+ # Starting or ending a block whose contents must not be
+ # transformed. These are tables, etc. Blocks cannot be nested.
+ # Note that the use of a listing block masquerading as an
+ # open block, via an extension, will not be formatted even
+ # though it should be.
+ # Fixing this would require looking at the previous line
+ # state for the '[open]' tag, and there are so few cases of
+ # this in the spec markup that it is not worth the trouble.
+
+ self.endParaBlockPassthrough(line)
+ elif self.state.lastTitle:
+ # The previous line was a document title line. This line
+ # is the author / credits line and must not be transformed.
+
+ self.endPara(line)
+ else:
+ # Just accumulate a line to the current paragraph. Watch out for
+ # hanging indents / bullet-points and track that indent level.
+
+ self.addLine(line)
+
+ # Commented out now that VU extractor supports this, but may
+ # need to refactor through a conventions object enable if
+ # OpenXR still needs this.
+
+ # This test looks for disallowed conditionals inside Valid Usage
+ # blocks, by checking if (a) this line does not start a new VU
+ # (bullet point) and (b) the previous line starts an asciidoctor
+ # conditional (ifdef:: or ifndef::).
+ # if (self.state.vuStack[-1]
+ # and not beginBullet.match(line)
+ # and conditionalStart.match(lines[self.state.lineNumber-2])):
+ # self.callback.onEmbeddedVUConditional(self.state)
+
+ self.state.lastTitle = thisTitle
+
+ # Cleanup at end of file
+ self.endPara(None)
+
+ # Check for sensible block nesting
+ if len(self.state.blockStack) > 1:
+ logWarn('file', self.filename,
+ 'mismatched asciidoc block delimiters at EOF:',
+ self.state.blockStack[-1])
+
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/extdependency.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/extdependency.py
new file mode 100755
index 00000000000..20fe9c20c57
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/extdependency.py
@@ -0,0 +1,205 @@
+#!/usr/bin/env python3
+#
+# Copyright 2017-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+"""Generate a mapping of extension name -> all required extension names for
+ that extension, from dependencies in the API XML."""
+
+import argparse
+import errno
+import xml.etree.ElementTree as etree
+from pathlib import Path
+
+from apiconventions import APIConventions
+from parse_dependency import dependencyNames
+
+class DiGraph:
+ """A directed graph.
+
+ The implementation and API mimic that of networkx.DiGraph in networkx-1.11.
+ networkx implements graphs as nested dicts; it uses dicts all the way
+ down, no lists.
+
+ Some major differences between this implementation and that of
+ networkx-1.11 are:
+
+ * This omits edge and node attribute data, because we never use them
+ yet they add additional code complexity.
+
+ * This returns iterator objects when possible instead of collection
+ objects, because it simplifies the implementation and should provide
+ better performance.
+ """
+
+ def __init__(self):
+ self.__nodes = {}
+
+ def add_node(self, node):
+ if node not in self.__nodes:
+ self.__nodes[node] = DiGraphNode()
+
+ def add_edge(self, src, dest):
+ self.add_node(src)
+ self.add_node(dest)
+ self.__nodes[src].adj.add(dest)
+
+ def nodes(self):
+ """Iterate over the nodes in the graph."""
+ return self.__nodes.keys()
+
+ def descendants(self, node):
+ """
+ Iterate over the nodes reachable from the given start node, excluding
+ the start node itself. Each node in the graph is yielded at most once.
+ """
+
+ # Implementation detail: Do a breadth-first traversal because it is
+ # easier than depth-first.
+
+ # All nodes seen during traversal.
+ seen = set()
+
+ # The stack of nodes that need visiting.
+ visit_me = []
+
+ # Bootstrap the traversal.
+ seen.add(node)
+ for x in self.__nodes[node].adj:
+ if x not in seen:
+ seen.add(x)
+ visit_me.append(x)
+
+ while visit_me:
+ x = visit_me.pop()
+ assert x in seen
+ yield x
+
+ for y in self.__nodes[x].adj:
+ if y not in seen:
+ seen.add(y)
+ visit_me.append(y)
+
+class DiGraphNode:
+ def __init__(self):
+ # Set of adjacent of nodes.
+ self.adj = set()
+
+class ApiDependencies:
+ def __init__(self,
+ registry_path = None,
+ api_name = None):
+ """Load an API registry and generate extension dependencies
+
+ registry_path - relative filename of XML registry. If not specified,
+ uses the API default.
+
+ api_name - API name for which to generate dependencies. Only
+ extensions supported for that API are considered.
+ """
+
+ conventions = APIConventions()
+ if registry_path is None:
+ registry_path = conventions.registry_path
+ if api_name is None:
+ api_name = conventions.xml_api_name
+
+ self.allExts = set()
+ self.khrExts = set()
+ self.ratifiedExts = set()
+ self.graph = DiGraph()
+ self.extensions = {}
+ self.tree = etree.parse(registry_path)
+
+ # Loop over all supported extensions, creating a digraph of the
+ # extension dependencies in the 'depends' attribute, which is a
+ # boolean expression of core version and extension names.
+ # A static dependency tree can be constructed only by treating all
+ # extension names in the expression as dependencies, even though
+ # that may not be true if it is of form (ext OR ext).
+ # For the purpose these dependencies are used for - generating
+ # specifications with required dependencies included automatically -
+ # this will suffice.
+ # Separately tracks lists of all extensions and all KHR extensions,
+ # which are common specification targets.
+ for elem in self.tree.findall('extensions/extension'):
+ name = elem.get('name')
+ supported = elem.get('supported')
+ ratified = elem.get('ratified', '')
+
+ if api_name in supported.split(','):
+ self.allExts.add(name)
+
+ if 'KHR' in name:
+ self.khrExts.add(name)
+
+ if api_name in ratified.split(','):
+ self.ratifiedExts.add(name)
+
+ self.graph.add_node(name)
+
+ depends = elem.get('depends')
+ if depends:
+ # Walk a list of the leaf nodes (version and extension
+ # names) in the boolean expression.
+ for dep in dependencyNames(depends):
+ # Filter out version names, which are explicitly
+ # specified when building a specification.
+ if not conventions.is_api_version_name(dep):
+ self.graph.add_edge(name, dep)
+ else:
+ # Skip unsupported extensions
+ pass
+
+ def allExtensions(self):
+ """Returns a set of all extensions in the graph"""
+ return self.allExts
+
+ def khrExtensions(self):
+ """Returns a set of all KHR extensions in the graph"""
+ return self.khrExts
+
+ def ratifiedExtensions(self):
+ """Returns a set of all ratified extensions in the graph"""
+ return self.ratifiedExts
+
+ def children(self, extension):
+ """Returns a set of the dependencies of an extension.
+ Throws an exception if the extension is not in the graph."""
+
+ if extension not in self.allExts:
+ raise Exception(f'Extension {extension} not found in XML!')
+
+ return set(self.graph.descendants(extension))
+
+
+# Test script
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-registry', action='store',
+ default=APIConventions().registry_path,
+ help='Use specified registry file instead of ' + APIConventions().registry_path)
+ parser.add_argument('-loops', action='store',
+ default=10, type=int,
+ help='Number of timing loops to run')
+ parser.add_argument('-test', action='store',
+ default=None,
+ help='Specify extension to find dependencies of')
+
+ args = parser.parse_args()
+
+ deps = ApiDependencies(args.registry)
+ print('KHR exts =', sorted(deps.khrExtensions()))
+ print('Ratified exts =', sorted(deps.ratifiedExtensions()))
+
+ import time
+ startTime = time.process_time()
+
+ for loop in range(args.loops):
+ deps = ApiDependencies(args.registry)
+
+ endTime = time.process_time()
+
+ deltaT = endTime - startTime
+ print('Total time = {} time/loop = {}'.format(deltaT, deltaT / args.loops))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/extensionmetadocgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/extensionmetadocgenerator.py
new file mode 100644
index 00000000000..6f5e0efcd78
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/extensionmetadocgenerator.py
@@ -0,0 +1,737 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import os
+import re
+import sys
+from functools import total_ordering
+from generator import GeneratorOptions, OutputGenerator, regSortFeatures, write
+from parse_dependency import dependencyMarkup
+
+class ExtensionMetaDocGeneratorOptions(GeneratorOptions):
+ """ExtensionMetaDocGeneratorOptions - subclass of GeneratorOptions.
+
+ Represents options during extension metainformation generation for Asciidoc"""
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+@total_ordering
+class Extension:
+ def __init__(self,
+ generator, # needed for logging and API conventions
+ filename,
+ name,
+ number,
+ ext_type,
+ depends,
+ contact,
+ promotedTo,
+ deprecatedBy,
+ obsoletedBy,
+ provisional,
+ revision,
+ specialuse,
+ ratified
+ ):
+ self.generator = generator
+ self.conventions = generator.genOpts.conventions
+ self.filename = filename
+ self.name = name
+ self.number = number
+ self.ext_type = ext_type
+ self.depends = depends
+ self.contact = contact
+ self.promotedTo = promotedTo
+ self.deprecatedBy = deprecatedBy
+ self.obsoletedBy = obsoletedBy
+ self.provisional = provisional
+ self.revision = revision
+ self.specialuse = specialuse
+ self.ratified = ratified
+
+ self.deprecationType = None
+ self.supercedingAPIVersion = None
+ self.supercedingExtension = None
+ # This is a set containing names of extensions (if any) promoted
+ # *to* this extension.
+ # It is filled in after all the Extension objects are created,
+ # since it requires a reverse mapping step.
+ self.promotedFrom = set()
+
+ if self.promotedTo is not None and self.deprecatedBy is not None and self.obsoletedBy is not None:
+ self.generator.logMsg('warn', 'All \'promotedto\', \'deprecatedby\' and \'obsoletedby\' attributes used on extension ' + self.name + '! Ignoring \'promotedto\' and \'deprecatedby\'.')
+ elif self.promotedTo is not None and self.deprecatedBy is not None:
+ self.generator.logMsg('warn', 'Both \'promotedto\' and \'deprecatedby\' attributes used on extension ' + self.name + '! Ignoring \'deprecatedby\'.')
+ elif self.promotedTo is not None and self.obsoletedBy is not None:
+ self.generator.logMsg('warn', 'Both \'promotedto\' and \'obsoletedby\' attributes used on extension ' + self.name + '! Ignoring \'promotedto\'.')
+ elif self.deprecatedBy is not None and self.obsoletedBy is not None:
+ self.generator.logMsg('warn', 'Both \'deprecatedby\' and \'obsoletedby\' attributes used on extension ' + self.name + '! Ignoring \'deprecatedby\'.')
+
+ supercededBy = None
+ if self.promotedTo is not None:
+ self.deprecationType = 'promotion'
+ supercededBy = promotedTo
+ elif self.deprecatedBy is not None:
+ self.deprecationType = 'deprecation'
+ supercededBy = deprecatedBy
+ elif self.obsoletedBy is not None:
+ self.deprecationType = 'obsoletion'
+ supercededBy = obsoletedBy
+
+ if supercededBy is not None:
+ if supercededBy == '' and not self.deprecationType == 'promotion':
+ pass # supercedingAPIVersion, supercedingExtension is None
+ elif supercededBy.startswith(self.conventions.api_version_prefix):
+ self.supercedingAPIVersion = supercededBy
+ elif supercededBy.startswith(self.conventions.api_prefix):
+ self.supercedingExtension = supercededBy
+ else:
+ self.generator.logMsg('error', 'Unrecognized ' + self.deprecationType + ' attribute value \'' + supercededBy + '\'!')
+
+ def __str__(self):
+ return self.name
+ def __eq__(self, other):
+ return self.name == other.name
+ def __ne__(self, other):
+ return self.name != other.name
+
+ def __lt__(self, other):
+ self_is_KHR = self.name.startswith(self.conventions.KHR_prefix)
+ self_is_EXT = self.name.startswith(self.conventions.EXT_prefix)
+ other_is_KHR = other.name.startswith(self.conventions.KHR_prefix)
+ other_is_EXT = other.name.startswith(self.conventions.EXT_prefix)
+
+ swap = False
+ if self_is_KHR and not other_is_KHR:
+ return not swap
+ if other_is_KHR and not self_is_KHR:
+ return swap
+ if self_is_EXT and not other_is_EXT:
+ return not swap
+ if other_is_EXT and not self_is_EXT:
+ return swap
+
+ return self.name < other.name
+
+ def typeToStr(self):
+ if self.ext_type == 'instance':
+ return 'Instance extension'
+ if self.ext_type == 'device':
+ return 'Device extension'
+
+ if self.ext_type is not None:
+ self.generator.logMsg('warn', 'The type attribute of ' + self.name + ' extension is neither \'instance\' nor \'device\'. That is invalid (at the time this script was written).')
+ else: # should be unreachable
+ self.generator.logMsg('error', 'Logic error in typeToStr(): Missing type attribute!')
+ return None
+
+ def specLink(self, xrefName, xrefText, isRefpage = False):
+ """Generate a string containing a link to a specification anchor in
+ asciidoctor markup form.
+
+ - xrefName - anchor name in the spec
+ - xrefText - text to show for the link, or None
+ - isRefpage = True if generating a refpage include, False if
+ generating a specification extension appendix include"""
+
+ if isRefpage:
+ # Always link into API spec
+ specURL = self.conventions.specURL('api')
+ return 'link:{}#{}[{}^]'.format(specURL, xrefName, xrefText)
+ else:
+ return '<<' + xrefName + ', ' + xrefText + '>>'
+
+ def conditionalLinkCoreAPI(self, apiVersion, linkSuffix, isRefpage):
+ versionMatch = re.match(self.conventions.api_version_prefix + r'(\d+)_(\d+)', apiVersion)
+ major = versionMatch.group(1)
+ minor = versionMatch.group(2)
+
+ dottedVersion = major + '.' + minor
+
+ xrefName = 'versions-' + dottedVersion + linkSuffix
+ xrefText = self.conventions.api_name() + ' ' + dottedVersion
+
+ doc = 'ifdef::' + apiVersion + '[]\n'
+ doc += ' ' + self.specLink(xrefName, xrefText, isRefpage) + '\n'
+ doc += 'endif::' + apiVersion + '[]\n'
+ doc += 'ifndef::' + apiVersion + '[]\n'
+ doc += ' ' + self.conventions.api_name() + ' ' + dottedVersion + '\n'
+ doc += 'endif::' + apiVersion + '[]\n'
+
+ return doc
+
+ def conditionalLinkExt(self, extName, indent = ' '):
+ doc = 'ifdef::' + extName + '[]\n'
+ doc += indent + self.conventions.formatExtension(extName) + '\n'
+ doc += 'endif::' + extName + '[]\n'
+ doc += 'ifndef::' + extName + '[]\n'
+ doc += indent + '`' + extName + '`\n'
+ doc += 'endif::' + extName + '[]\n'
+
+ return doc
+
+ def resolveDeprecationChain(self, extensions, succeededBy, isRefpage, file):
+ if succeededBy not in extensions:
+ write(f' ** *NOTE* The extension `{succeededBy}` is not supported for the API specification being generated', file=file)
+ self.generator.logMsg('warn', f'resolveDeprecationChain: {self.name} defines a superseding interface {succeededBy} which is not in the supported extensions list')
+ return
+
+ ext = extensions[succeededBy]
+
+ if ext.deprecationType:
+ if ext.deprecationType == 'promotion':
+ if ext.supercedingAPIVersion:
+ write(' ** Which in turn was _promoted_ to\n' + ext.conditionalLinkCoreAPI(ext.supercedingAPIVersion, '-promotions', isRefpage), file=file)
+ else: # ext.supercedingExtension
+ write(' ** Which in turn was _promoted_ to extension\n' + ext.conditionalLinkExt(ext.supercedingExtension), file=file)
+ ext.resolveDeprecationChain(extensions, ext.supercedingExtension, file)
+ elif ext.deprecationType == 'deprecation':
+ if ext.supercedingAPIVersion:
+ write(' ** Which in turn was _deprecated_ by\n' + ext.conditionalLinkCoreAPI(ext.supercedingAPIVersion, '-new-feature', isRefpage), file=file)
+ elif ext.supercedingExtension:
+ write(' ** Which in turn was _deprecated_ by\n' + ext.conditionalLinkExt(ext.supercedingExtension) + ' extension', file=file)
+ ext.resolveDeprecationChain(extensions, ext.supercedingExtension, file)
+ else:
+ write(' ** Which in turn was _deprecated_ without replacement', file=file)
+ elif ext.deprecationType == 'obsoletion':
+ if ext.supercedingAPIVersion:
+ write(' ** Which in turn was _obsoleted_ by\n' + ext.conditionalLinkCoreAPI(ext.supercedingAPIVersion, '-new-feature', isRefpage), file=file)
+ elif ext.supercedingExtension:
+ write(' ** Which in turn was _obsoleted_ by\n' + ext.conditionalLinkExt(ext.supercedingExtension) + ' extension', file=file)
+ ext.resolveDeprecationChain(extensions, ext.supercedingExtension, file)
+ else:
+ write(' ** Which in turn was _obsoleted_ without replacement', file=file)
+ else: # should be unreachable
+ self.generator.logMsg('error', 'Logic error in resolveDeprecationChain(): deprecationType is neither \'promotion\', \'deprecation\' nor \'obsoletion\'!')
+
+
+ def writeTag(self, tag, value, isRefpage, fp):
+ """Write a tag and (if non-None) a tag value to a file.
+
+ If the value is None, just write the tag.
+
+ If the tag is None, just write the value (used for adding a value
+ to a just-written tag).
+
+ - tag - string tag name
+ - value - tag value, or None
+ - isRefpage - controls style in which the tag is marked up
+ - fp - open file pointer to write to"""
+
+ if isRefpage:
+ # Use subsection headers for the tag name
+ tagPrefix = '== '
+ tagSuffix = ''
+ else:
+ # Use an bolded item list for the tag name
+ tagPrefix = '*'
+ tagSuffix = '*::'
+
+ if tag is not None:
+ write(tagPrefix + tag + tagSuffix, file=fp)
+ if value is not None:
+ write(value, file=fp)
+
+ if isRefpage:
+ write('', file=fp)
+
+ def makeMetafile(self, extensions, isRefpage = False):
+ """Generate a file containing extension metainformation in
+ asciidoctor markup form.
+
+ - extensions - dictionary of Extension objects for extensions spec
+ is being generated against
+ - isRefpage - True if generating a refpage include, False if
+ generating a specification extension appendix include"""
+
+ if isRefpage:
+ filename = self.filename.replace('meta/', 'meta/refpage.')
+ else:
+ filename = self.filename
+
+ fp = self.generator.newFile(filename)
+
+ if not isRefpage:
+ write('[[' + self.name + ']]', file=fp)
+ write('=== ' + self.name, file=fp)
+ write('', file=fp)
+
+ self.writeTag('Name String', '`' + self.name + '`', isRefpage, fp)
+ self.writeTag('Extension Type', self.typeToStr(), isRefpage, fp)
+
+ self.writeTag('Registered Extension Number', self.number, isRefpage, fp)
+ self.writeTag('Revision', self.revision, isRefpage, fp)
+
+ if self.conventions.xml_api_name in self.ratified.split(','):
+ ratstatus = 'Ratified'
+ else:
+ ratstatus = 'Not ratified'
+ self.writeTag('Ratification Status', ratstatus, isRefpage, fp)
+
+ # Only API extension dependencies are coded in XML, others are explicit
+ self.writeTag('Extension and Version Dependencies', None, isRefpage, fp)
+
+ # Transform the boolean 'depends' expression into equivalent
+ # human-readable asciidoc markup.
+ if self.depends is not None:
+ if isRefpage:
+ separator = ''
+ else:
+ separator = '+'
+ write(separator + '\n--\n' +
+ dependencyMarkup(self.depends) +
+ '--', file=fp)
+ else:
+ # Do not bother specifying the base Vulkan 1.0 API redundantly
+ True
+
+ if self.provisional == 'true' and self.conventions.provisional_extension_warning:
+ write(' * *This is a _provisional_ extension and must: be used with caution.', file=fp)
+ write(' See the ' +
+ self.specLink(xrefName = 'boilerplate-provisional-header',
+ xrefText = 'description',
+ isRefpage = isRefpage) +
+ ' of provisional header files for enablement and stability details.*', file=fp)
+ write('', file=fp)
+
+ if self.deprecationType:
+ self.writeTag('Deprecation State', None, isRefpage, fp)
+
+ if self.deprecationType == 'promotion':
+ if self.supercedingAPIVersion:
+ write(' * _Promoted_ to\n' + self.conditionalLinkCoreAPI(self.supercedingAPIVersion, '-promotions', isRefpage), file=fp)
+ else: # ext.supercedingExtension
+ write(' * _Promoted_ to\n' + self.conditionalLinkExt(self.supercedingExtension) + ' extension', file=fp)
+ self.resolveDeprecationChain(extensions, self.supercedingExtension, isRefpage, fp)
+ elif self.deprecationType == 'deprecation':
+ if self.supercedingAPIVersion:
+ write(' * _Deprecated_ by\n' + self.conditionalLinkCoreAPI(self.supercedingAPIVersion, '-new-features', isRefpage), file=fp)
+ elif self.supercedingExtension:
+ write(' * _Deprecated_ by\n' + self.conditionalLinkExt(self.supercedingExtension) + ' extension' , file=fp)
+ self.resolveDeprecationChain(extensions, self.supercedingExtension, isRefpage, fp)
+ else:
+ write(' * _Deprecated_ without replacement' , file=fp)
+ elif self.deprecationType == 'obsoletion':
+ if self.supercedingAPIVersion:
+ write(' * _Obsoleted_ by\n' + self.conditionalLinkCoreAPI(self.supercedingAPIVersion, '-new-features', isRefpage), file=fp)
+ elif self.supercedingExtension:
+ write(' * _Obsoleted_ by\n' + self.conditionalLinkExt(self.supercedingExtension) + ' extension' , file=fp)
+ self.resolveDeprecationChain(extensions, self.supercedingExtension, isRefpage, fp)
+ else:
+ # TODO: Does not make sense to retroactively ban use of extensions from 1.0.
+ # Needs some tweaks to the semantics and this message, when such extension(s) occur.
+ write(' * _Obsoleted_ without replacement' , file=fp)
+ else: # should be unreachable
+ self.generator.logMsg('error', 'Logic error in makeMetafile(): deprecationType is neither \'promotion\', \'deprecation\' nor \'obsoletion\'!')
+ write('', file=fp)
+
+ if self.specialuse is not None:
+ specialuses = self.specialuse.split(',')
+ if len(specialuses) > 1:
+ header = 'Special Uses'
+ else:
+ header = 'Special Use'
+ self.writeTag(header, None, isRefpage, fp)
+
+ for use in specialuses:
+ # Each specialuse attribute value expands an asciidoctor
+ # attribute of the same name, instead of using the shorter,
+ # and harder to understand attribute
+ write('* {}'.format(
+ self.specLink(
+ xrefName = self.conventions.special_use_section_anchor,
+ xrefText = '{' + use + '}',
+ isRefpage = isRefpage)), file=fp)
+ write('', file=fp)
+
+ if self.conventions.write_contacts:
+ self.writeTag('Contact', None, isRefpage, fp)
+
+ contacts = self.contact.split(',')
+ for contact in contacts:
+ contactWords = contact.strip().split()
+ name = ' '.join(contactWords[:-1])
+ handle = contactWords[-1]
+ if handle.startswith('gitlab:'):
+ prettyHandle = 'icon:gitlab[alt=GitLab, role="red"]' + handle.replace('gitlab:@', '')
+ elif handle.startswith('@'):
+ issuePlaceholderText = '[' + self.name + '] ' + handle
+ issuePlaceholderText += '%0A*Here describe the issue or question you have about the ' + self.name + ' extension*'
+ trackerLink = 'link:++https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=' + issuePlaceholderText + '++'
+ prettyHandle = trackerLink + '[icon:github[alt=GitHub,role="black"]' + handle[1:] + ',window=_blank,opts=nofollow]'
+ else:
+ prettyHandle = handle
+
+ write(' * ' + name + ' ' + prettyHandle, file=fp)
+ write('', file=fp)
+
+ # Check if a proposal document for this extension exists in the
+ # current repository, and link to the same document (parameterized
+ # by a URL prefix attribute) if it does.
+ # The assumption is that a proposal document for an extension
+ # VK_name will be located in 'proposals/VK_name.adoc' relative
+ # to the repository root, and that this script will be invoked from
+ # the repository root.
+ # If a proposal for this extension does not exist, look for
+ # proposals for the extensions it is promoted from.
+
+ def checkProposal(extname):
+ """Check if a proposal document for an extension exists,
+ returning the path to that proposal or None otherwise."""
+
+ path = 'proposals/{}.adoc'.format(extname)
+ if os.path.exists(path) and os.access(path, os.R_OK):
+ return path
+ else:
+ return None
+
+ # List of [ extname, proposal link ]
+ proposals = []
+
+ path = checkProposal(self.name)
+ if path is not None:
+ proposals.append([self.name, path])
+ else:
+ for name in self.promotedFrom:
+ path = checkProposal(name)
+ if path is not None:
+ proposals.append([name, path])
+
+ if len(proposals) > 0:
+ tag = 'Extension Proposal'
+ for (name, path) in sorted(proposals):
+ self.writeTag(tag,
+ f'link:{{specRepositoryURL}}/{path}[{name}]',
+ isRefpage, fp)
+ # Setting tag = None so additional values will not get
+ # additional tag headers.
+ tag = None
+
+ # If this is metadata to be included in a refpage, adjust the
+ # leveloffset to account for the relative structure of the extension
+ # appendices vs. refpages.
+ if isRefpage and self.conventions.include_extension_appendix_in_refpage:
+ write(':leveloffset: -1', file=fp)
+
+ fp.close()
+
+class ExtensionMetaDocOutputGenerator(OutputGenerator):
+ """ExtensionMetaDocOutputGenerator - subclass of OutputGenerator.
+
+ Generates AsciiDoc includes with metainformation for the API extension
+ appendices. The fields used from <extension> tags in the API XML are:
+
+ - name extension name string
+ - number extension number (optional)
+ - contact name and GitHub login or email address (optional)
+ - type 'instance' | 'device' (optional)
+ - depends boolean expression of core version and extension names this depends on (optional)
+ - promotedTo extension or API version it was promoted to
+ - deprecatedBy extension or API version which deprecated this extension,
+ or empty string if deprecated without replacement
+ - obsoletedBy extension or API version which obsoleted this extension,
+ or empty string if obsoleted without replacement
+ - provisional 'true' if this extension is released provisionally"""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.extensions = {}
+ # List of strings containing all vendor tags
+ self.vendor_tags = []
+ self.file_suffix = ''
+
+ def newFile(self, filename):
+ self.logMsg('diag', '# Generating include file:', filename)
+ fp = open(filename, 'w', encoding='utf-8')
+ write(self.genOpts.conventions.warning_comment, file=fp)
+ return fp
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ self.directory = self.genOpts.directory
+ self.file_suffix = self.genOpts.conventions.file_suffix
+
+ # Iterate over all 'tag' Elements and add the names of all the valid vendor
+ # tags to the list
+ root = self.registry.tree.getroot()
+ for tag in root.findall('tags/tag'):
+ self.vendor_tags.append(tag.get('name'))
+
+ # Create subdirectory, if needed
+ self.makeDir(self.directory)
+
+ def conditionalExt(self, extName, content, ifdef = None, condition = None):
+ doc = ''
+
+ innerdoc = 'ifdef::' + extName + '[]\n'
+ innerdoc += content + '\n'
+ innerdoc += 'endif::' + extName + '[]\n'
+
+ if ifdef:
+ if ifdef == 'ifndef':
+ if condition:
+ doc += 'ifndef::' + condition + '[]\n'
+ doc += innerdoc
+ doc += 'endif::' + condition + '[]\n'
+ else: # no condition is as if condition is defined; "nothing" is always defined :p
+ pass # so no output
+ elif ifdef == 'ifdef':
+ if condition:
+ doc += 'ifdef::' + condition + '+' + extName + '[]\n'
+ doc += content + '\n' # does not include innerdoc; the ifdef was merged with the one above
+ doc += 'endif::' + condition + '+' + extName + '[]\n'
+ else: # no condition is as if condition is defined; "nothing" is always defined :p
+ doc += innerdoc
+ else: # should be unreachable
+ raise RuntimeError('Should be unreachable: ifdef is neither \'ifdef \' nor \'ifndef\'!')
+ else:
+ doc += innerdoc
+
+ return doc
+
+ def makeExtensionInclude(self, extname):
+ return self.conventions.extension_include_string(extname)
+
+ def endFile(self):
+ # Determine the extension an extension is promoted from, if any.
+ # This is used when attempting to locate a proposal document in
+ # makeMetafile() below.
+ for (extname, ext) in self.extensions.items():
+ promotedTo = ext.promotedTo
+ if promotedTo is not None:
+ if promotedTo in self.extensions:
+ #print(f'{promotedTo} is promoted from {extname}')
+ self.extensions[promotedTo].promotedFrom.add(extname)
+ #print(f'setting self.extensions[{promotedTo}].promotedFrom = {self.extensions[promotedTo].promotedFrom}')
+ elif not self.conventions.is_api_version_name(promotedTo):
+ self.logMsg('warn', f'{extname} is promoted to {promotedTo} which is not in the extension map')
+
+ # Generate metadoc extension files, in refpage and non-refpage form
+ for ext in self.extensions.values():
+ ext.makeMetafile(self.extensions, isRefpage = False)
+ if self.conventions.write_refpage_include:
+ ext.makeMetafile(self.extensions, isRefpage = True)
+
+ # Key to sort extensions alphabetically within 'KHR', 'EXT', vendor
+ # extension prefixes.
+ def makeSortKey(extname):
+ name = extname.lower()
+ prefixes = self.conventions.extension_index_prefixes
+ for i, prefix in enumerate(prefixes):
+ if extname.startswith(prefix):
+ return (i, name)
+ return (len(prefixes), name)
+
+ # Generate list of promoted extensions
+ promotedExtensions = {}
+ for ext in self.extensions.values():
+ if ext.deprecationType == 'promotion' and ext.supercedingAPIVersion:
+ promotedExtensions.setdefault(ext.supercedingAPIVersion, []).append(ext.name)
+
+ for coreVersion, extensions in promotedExtensions.items():
+ promoted_extensions_fp = self.newFile(self.directory + '/promoted_extensions_' + coreVersion + self.file_suffix)
+
+ for extname in sorted(extensions, key=makeSortKey):
+ indent = ''
+ write(' * {blank}\n+\n' + ext.conditionalLinkExt(extname, indent), file=promoted_extensions_fp)
+
+ promoted_extensions_fp.close()
+
+ # Generate include directives for the extensions appendix, grouping
+ # extensions by status (current, deprecated, provisional, etc.)
+ with self.newFile(self.directory + '/current_extensions_appendix' + self.file_suffix) as current_extensions_appendix_fp, \
+ self.newFile(self.directory + '/deprecated_extensions_appendix' + self.file_suffix) as deprecated_extensions_appendix_fp, \
+ self.newFile(self.directory + '/current_extension_appendices' + self.file_suffix) as current_extension_appendices_fp, \
+ self.newFile(self.directory + '/current_extension_appendices_toc' + self.file_suffix) as current_extension_appendices_toc_fp, \
+ self.newFile(self.directory + '/deprecated_extension_appendices' + self.file_suffix) as deprecated_extension_appendices_fp, \
+ self.newFile(self.directory + '/deprecated_extension_appendices_toc' + self.file_suffix) as deprecated_extension_appendices_toc_fp, \
+ self.newFile(self.directory + '/deprecated_extensions_guard_macro' + self.file_suffix) as deprecated_extensions_guard_macro_fp, \
+ self.newFile(self.directory + '/provisional_extensions_appendix' + self.file_suffix) as provisional_extensions_appendix_fp, \
+ self.newFile(self.directory + '/provisional_extension_appendices' + self.file_suffix) as provisional_extension_appendices_fp, \
+ self.newFile(self.directory + '/provisional_extension_appendices_toc' + self.file_suffix) as provisional_extension_appendices_toc_fp, \
+ self.newFile(self.directory + '/provisional_extensions_guard_macro' + self.file_suffix) as provisional_extensions_guard_macro_fp:
+
+ # Note: there is a hardwired assumption in creating the
+ # include:: directives below that all of these files are located
+ # in the 'meta/' subdirectory of the generated files directory.
+ # This is difficult to change, and it is very unlikely changing
+ # it will be needed.
+
+ write('', file=current_extensions_appendix_fp)
+ write('include::{generated}/meta/deprecated_extensions_guard_macro' + self.file_suffix + '[]', file=current_extensions_appendix_fp)
+ write('', file=current_extensions_appendix_fp)
+ write('ifndef::HAS_DEPRECATED_EXTENSIONS[]', file=current_extensions_appendix_fp)
+ write('[[extension-appendices-list]]', file=current_extensions_appendix_fp)
+ write('== List of Extensions', file=current_extensions_appendix_fp)
+ write('endif::HAS_DEPRECATED_EXTENSIONS[]', file=current_extensions_appendix_fp)
+ write('ifdef::HAS_DEPRECATED_EXTENSIONS[]', file=current_extensions_appendix_fp)
+ write('[[extension-appendices-list]]', file=current_extensions_appendix_fp)
+ write('== List of Current Extensions', file=current_extensions_appendix_fp)
+ write('endif::HAS_DEPRECATED_EXTENSIONS[]', file=current_extensions_appendix_fp)
+ write('', file=current_extensions_appendix_fp)
+ write('include::{generated}/meta/current_extension_appendices_toc' + self.file_suffix + '[]', file=current_extensions_appendix_fp)
+ write('\n<<<\n', file=current_extensions_appendix_fp)
+ write('include::{generated}/meta/current_extension_appendices' + self.file_suffix + '[]', file=current_extensions_appendix_fp)
+
+ write('', file=deprecated_extensions_appendix_fp)
+ write('include::{generated}/meta/deprecated_extensions_guard_macro' + self.file_suffix + '[]', file=deprecated_extensions_appendix_fp)
+ write('', file=deprecated_extensions_appendix_fp)
+ write('ifdef::HAS_DEPRECATED_EXTENSIONS[]', file=deprecated_extensions_appendix_fp)
+ write('[[deprecated-extension-appendices-list]]', file=deprecated_extensions_appendix_fp)
+ write('== List of Deprecated Extensions', file=deprecated_extensions_appendix_fp)
+ write('include::{generated}/meta/deprecated_extension_appendices_toc' + self.file_suffix + '[]', file=deprecated_extensions_appendix_fp)
+ write('\n<<<\n', file=deprecated_extensions_appendix_fp)
+ write('include::{generated}/meta/deprecated_extension_appendices' + self.file_suffix + '[]', file=deprecated_extensions_appendix_fp)
+ write('endif::HAS_DEPRECATED_EXTENSIONS[]', file=deprecated_extensions_appendix_fp)
+
+ # add include guards to allow multiple includes
+ write('ifndef::DEPRECATED_EXTENSIONS_GUARD_MACRO_INCLUDE_GUARD[]', file=deprecated_extensions_guard_macro_fp)
+ write(':DEPRECATED_EXTENSIONS_GUARD_MACRO_INCLUDE_GUARD:\n', file=deprecated_extensions_guard_macro_fp)
+ write('ifndef::PROVISIONAL_EXTENSIONS_GUARD_MACRO_INCLUDE_GUARD[]', file=provisional_extensions_guard_macro_fp)
+ write(':PROVISIONAL_EXTENSIONS_GUARD_MACRO_INCLUDE_GUARD:\n', file=provisional_extensions_guard_macro_fp)
+
+ write('', file=provisional_extensions_appendix_fp)
+ write('include::{generated}/meta/provisional_extensions_guard_macro' + self.file_suffix + '[]', file=provisional_extensions_appendix_fp)
+ write('', file=provisional_extensions_appendix_fp)
+ write('ifdef::HAS_PROVISIONAL_EXTENSIONS[]', file=provisional_extensions_appendix_fp)
+ write('[[provisional-extension-appendices-list]]', file=provisional_extensions_appendix_fp)
+ write('== List of Provisional Extensions', file=provisional_extensions_appendix_fp)
+ write('include::{generated}/meta/provisional_extension_appendices_toc' + self.file_suffix + '[]', file=provisional_extensions_appendix_fp)
+ write('\n<<<\n', file=provisional_extensions_appendix_fp)
+ write('include::{generated}/meta/provisional_extension_appendices' + self.file_suffix + '[]', file=provisional_extensions_appendix_fp)
+ write('endif::HAS_PROVISIONAL_EXTENSIONS[]', file=provisional_extensions_appendix_fp)
+
+ # Emit extensions in author ID order
+ sorted_keys = sorted(self.extensions.keys(), key=makeSortKey)
+ for name in sorted_keys:
+ ext = self.extensions[name]
+
+ include = self.makeExtensionInclude(ext.name)
+ link = ' * ' + self.conventions.formatExtension(ext.name)
+ if ext.provisional == 'true':
+ write(self.conditionalExt(ext.name, include), file=provisional_extension_appendices_fp)
+ write(self.conditionalExt(ext.name, link), file=provisional_extension_appendices_toc_fp)
+ write(self.conditionalExt(ext.name, ':HAS_PROVISIONAL_EXTENSIONS:'), file=provisional_extensions_guard_macro_fp)
+ elif ext.deprecationType is None:
+ write(self.conditionalExt(ext.name, include), file=current_extension_appendices_fp)
+ write(self.conditionalExt(ext.name, link), file=current_extension_appendices_toc_fp)
+ else:
+ condition = ext.supercedingAPIVersion if ext.supercedingAPIVersion else ext.supercedingExtension # potentially None too
+
+ write(self.conditionalExt(ext.name, include, 'ifndef', condition), file=current_extension_appendices_fp)
+ write(self.conditionalExt(ext.name, link, 'ifndef', condition), file=current_extension_appendices_toc_fp)
+
+ write(self.conditionalExt(ext.name, include, 'ifdef', condition), file=deprecated_extension_appendices_fp)
+ write(self.conditionalExt(ext.name, link, 'ifdef', condition), file=deprecated_extension_appendices_toc_fp)
+
+ write(self.conditionalExt(ext.name, ':HAS_DEPRECATED_EXTENSIONS:', 'ifdef', condition), file=deprecated_extensions_guard_macro_fp)
+
+ write('endif::DEPRECATED_EXTENSIONS_GUARD_MACRO_INCLUDE_GUARD[]', file=deprecated_extensions_guard_macro_fp)
+ write('endif::PROVISIONAL_EXTENSIONS_GUARD_MACRO_INCLUDE_GUARD[]', file=provisional_extensions_guard_macro_fp)
+
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ # Start processing in superclass
+ OutputGenerator.beginFeature(self, interface, emit)
+
+ if interface.tag != 'extension':
+ self.logMsg('diag', 'beginFeature: ignoring non-extension feature', self.featureName)
+ return
+
+ # These attributes must exist
+ name = self.featureName
+ number = self.getAttrib(interface, 'number')
+ ext_type = self.getAttrib(interface, 'type')
+ revision = self.getSpecVersion(interface, name)
+
+ # These attributes are optional
+ OPTIONAL = False
+ depends = self.getAttrib(interface, 'depends', OPTIONAL) # TODO should default to VK_VERSION_1_0?
+ contact = self.getAttrib(interface, 'contact', OPTIONAL)
+ promotedTo = self.getAttrib(interface, 'promotedto', OPTIONAL)
+ deprecatedBy = self.getAttrib(interface, 'deprecatedby', OPTIONAL)
+ obsoletedBy = self.getAttrib(interface, 'obsoletedby', OPTIONAL)
+ provisional = self.getAttrib(interface, 'provisional', OPTIONAL, 'false')
+ specialuse = self.getAttrib(interface, 'specialuse', OPTIONAL)
+ ratified = self.getAttrib(interface, 'ratified', OPTIONAL, '')
+
+ filename = self.directory + '/' + name + self.file_suffix
+
+ extdata = Extension(
+ generator = self,
+ filename = filename,
+ name = name,
+ number = number,
+ ext_type = ext_type,
+ depends = depends,
+ contact = contact,
+ promotedTo = promotedTo,
+ deprecatedBy = deprecatedBy,
+ obsoletedBy = obsoletedBy,
+ provisional = provisional,
+ revision = revision,
+ specialuse = specialuse,
+ ratified = ratified)
+ self.extensions[name] = extdata
+
+ def endFeature(self):
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def getAttrib(self, elem, attribute, required=True, default=None):
+ """Query an attribute from an element, or return a default value
+
+ - elem - element to query
+ - attribute - attribute name
+ - required - whether attribute must exist
+ - default - default value if attribute not present"""
+ attrib = elem.get(attribute, default)
+ if required and (attrib is None):
+ name = elem.get('name', 'UNKNOWN')
+ self.logMsg('error', 'While processing \'' + self.featureName + ', <' + elem.tag + '> \'' + name + '\' does not contain required attribute \'' + attribute + '\'')
+ return attrib
+
+ def numbersToWords(self, name):
+ allowlist = ['WIN32', 'INT16', 'D3D1']
+
+ # temporarily replace allowlist items
+ for i, w in enumerate(allowlist):
+ name = re.sub(w, '{' + str(i) + '}', name)
+
+ name = re.sub(r'(?<=[A-Z])(\d+)(?![A-Z])', r'_\g<1>', name)
+
+ # undo allowlist substitution
+ for i, w in enumerate(allowlist):
+ name = re.sub('\\{' + str(i) + '}', w, name)
+
+ return name
+
+ def getSpecVersion(self, elem, extname, default=None):
+ """Determine the extension revision from the EXTENSION_NAME_SPEC_VERSION
+ enumerant.
+
+ - elem - <extension> element to query
+ - extname - extension name from the <extension> 'name' attribute
+ - default - default value if SPEC_VERSION token not present"""
+ # The literal enumerant name to match
+ versioningEnumName = self.numbersToWords(extname.upper()) + '_SPEC_VERSION'
+
+ for enum in elem.findall('./require/enum'):
+ enumName = self.getAttrib(enum, 'name')
+ if enumName == versioningEnumName:
+ return self.getAttrib(enum, 'value')
+
+ #if not found:
+ for enum in elem.findall('./require/enum'):
+ enumName = self.getAttrib(enum, 'name')
+ if enumName.find('SPEC_VERSION') != -1:
+ self.logMsg('diag', 'Missing ' + versioningEnumName + '! Potential misnamed candidate ' + enumName + '.')
+ return self.getAttrib(enum, 'value')
+
+ self.logMsg('error', 'Missing ' + versioningEnumName + '!')
+ return default
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/formatsgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/formatsgenerator.py
new file mode 100644
index 00000000000..ba1733e4017
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/formatsgenerator.py
@@ -0,0 +1,224 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from generator import OutputGenerator, write
+from spec_tools.attributes import ExternSyncEntry
+from spec_tools.util import getElemName
+
+import pdb
+
+class FormatsOutputGenerator(OutputGenerator):
+ """FormatsOutputGenerator - subclass of OutputGenerator.
+ Generates AsciiDoc includes of the table for the format chapters
+ of the API specification.
+
+ ---- methods ----
+ FormatsOutputGenerator(errFile, warnFile, diagFile) - args as for
+ OutputGenerator. Defines additional internal state.
+ ---- methods overriding base class ----
+ genCmd(cmdinfo)"""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ # List of all the formats elements
+ self.formats = []
+ # <format, condition as asciidoc string>
+ self.format_conditions = dict()
+ # <class, {'formats' : [], 'meta' : {} }>
+ self.format_classes = dict()
+ # {'packedSize' : ['format', 'format', ...]}
+ self.packed_info = dict()
+ # {VkFormat : SpirvFormat}
+ self.spirv_image_format = dict()
+ # <format, [{plane_info}, ...]>
+ self.plane_format = dict()
+
+ def endFile(self):
+
+ # Generate compatibility table
+ compatibility_table = []
+ for class_name, info in self.format_classes.items():
+ # Do an initial loop of formats in class to see if whole class is a single condition
+ class_condition = None
+ for index, format in enumerate(info['formats']):
+ condition = self.format_conditions[format]
+ if (condition == None) or (class_condition != None and class_condition != condition):
+ class_condition = None
+ break
+ else:
+ class_condition = condition
+
+ # If not single class condition for the class, next check if a single format has a condition
+ # Move all condition formats to the front of array to make listing the formats in table
+ if class_condition == None:
+ condition_list = []
+ noncondition_list = []
+ for index, format in enumerate(info['formats']):
+ if self.format_conditions[format] == None:
+ noncondition_list.append(format)
+ else:
+ condition_list.append(format)
+ info['formats'] = condition_list + noncondition_list
+
+ if class_condition != None:
+ compatibility_table.append('ifdef::{}[]'.format(class_condition))
+
+ compatibility_table.append("| {} +".format(class_name))
+ compatibility_table.append(" Block size {} byte +".format(info['meta']['blockSize']))
+ compatibility_table.append(" {} block extent +".format(info['meta']['blockExtent'].replace(",", "x")))
+ compatibility_table.append(" {} texel/block |".format(info['meta']['texelsPerBlock']))
+
+ for index, format in enumerate(info['formats']):
+ format_condition = self.format_conditions[format]
+ if format_condition != None and class_condition == None:
+ compatibility_table.append('ifdef::{}[]'.format(format_condition))
+ suffix = ", +" if index != len(info['formats']) - 1 else ""
+ compatibility_table.append(" ename:{}{}".format(format, suffix))
+ if format_condition != None and class_condition == None:
+ compatibility_table.append('endif::{}[]'.format(format_condition))
+
+ if class_condition != None:
+ compatibility_table.append('endif::{}[]'.format(class_condition))
+ self.writeBlock(f'compatibility{self.file_suffix}', compatibility_table)
+
+ # Generate packed format list
+ packed_table = []
+ for packed_size, formats in self.packed_info.items():
+ packed_table.append(' * <<formats-packed-{}-bit,Packed into {}-bit data types>>:'.format(packed_size, packed_size))
+ # Do an initial loop of formats with same packed size to group conditional together for easier reading of final asciidoc
+ sorted_formats = dict() # {condition : formats}
+ for format in formats:
+ format_condition = self.format_conditions[format]
+ if format_condition == None:
+ format_condition = "None" # to allow as a key in the dict
+ if format_condition not in sorted_formats:
+ sorted_formats[format_condition] = []
+ sorted_formats[format_condition].append(format)
+
+ for condition, condition_formats in sorted_formats.items():
+ if condition != "None":
+ packed_table.append('ifdef::{}[]'.format(condition))
+ for format in condition_formats:
+ packed_table.append(' ** ename:{}'.format(format))
+ if condition != "None":
+ packed_table.append('endif::{}[]'.format(condition))
+ self.writeBlock(f'packed{self.file_suffix}', packed_table)
+
+ # Generate SPIR-V Image Format Compatibility
+ spirv_image_format_table = []
+ spirv_image_format_table.append('|code:Unknown|Any')
+ for vk_format, spirv_format in self.spirv_image_format.items():
+ spirv_image_format_table.append('|code:{}|ename:{}'.format(spirv_format, vk_format))
+ self.writeBlock(f'spirvimageformat{self.file_suffix}', spirv_image_format_table)
+
+ # Generate Plane Format Compatibility Table
+ plane_format_table = []
+ for format_name, plane_infos in self.plane_format.items():
+ format_condition = self.format_conditions[format_name]
+ # The table is already in a ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ # so no need to duplicate the condition
+ add_condition = False if format_condition == 'None' or format_condition == 'VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion' else True
+
+ if add_condition:
+ plane_format_table.append('ifdef::{}[]'.format(format_condition))
+
+ plane_format_table.append('4+| *ename:{}*'.format(format_name))
+ for plane_info in plane_infos:
+ width_divisor = 'w'
+ height_divisor = 'h'
+ if plane_info['widthDivisor'] != 1:
+ width_divisor += '/{}'.format(plane_info['widthDivisor'])
+ if plane_info['heightDivisor'] != 1:
+ height_divisor += '/{}'.format(plane_info['heightDivisor'])
+
+ plane_format_table.append('^| {} ^| ename:{} ^| {} ^| {}'.format(plane_info['index'],
+ plane_info['compatible'],
+ width_divisor,
+ height_divisor))
+ if add_condition:
+ plane_format_table.append('endif::{}[]'.format(format_condition))
+ self.writeBlock(f'planeformat{self.file_suffix}', plane_format_table)
+
+ # Finish processing in superclass
+ OutputGenerator.endFile(self)
+
+ def writeBlock(self, basename, contents):
+ """Generate an include file.
+
+ - directory - subdirectory to put file in
+ - basename - base name of the file
+ - contents - contents of the file (Asciidoc boilerplate aside)"""
+
+ filename = self.genOpts.directory + '/' + basename
+ self.logMsg('diag', '# Generating include file:', filename)
+ with open(filename, 'w', encoding='utf-8') as fp:
+ write(self.genOpts.conventions.warning_comment, file=fp)
+
+ if len(contents) > 0:
+ for str in contents:
+ write(str, file=fp)
+ else:
+ self.logMsg('diag', '# No contents for:', filename)
+
+ def genFormat(self, format, formatinfo, alias):
+ """Generate Formats
+
+ formatinfo - dictionary entry for an XML <format> element
+ name - name attribute of format.elem"""
+
+ OutputGenerator.genFormat(self, format, formatinfo, alias)
+ elem = format.elem
+ format_name = elem.get('name')
+
+ self.formats.append(elem)
+ self.format_conditions[format_name] = format.condition
+
+ # Create format class data structure to be processed later
+ class_name = elem.get('class')
+ class_meta = {
+ 'blockSize' : elem.get('blockSize'),
+ 'texelsPerBlock' : elem.get('texelsPerBlock'),
+ # default extent
+ 'blockExtent' : "1,1,1" if elem.get('blockExtent') == None else elem.get('blockExtent')
+ }
+
+ if class_name in self.format_classes:
+ self.format_classes[class_name]['formats'].append(format_name)
+ # Assert all classes are using same meta info
+ if class_meta != self.format_classes[class_name]['meta']:
+ self.logMsg('error', 'Class meta info is not consistent for class ', class_name)
+ else:
+ self.format_classes[class_name] = {
+ 'formats' : [format_name],
+ 'meta' : class_meta
+ }
+
+ # Build list of formats with packed info in xml
+ packed = elem.get('packed')
+ if packed is not None:
+ if packed not in self.packed_info:
+ self.packed_info[packed] = []
+ self.packed_info[packed].append(format_name)
+
+ # Currently there is only at most one <spirvimageformat>
+ spirv_image_format = elem.find('spirvimageformat')
+ if (spirv_image_format is not None):
+ self.spirv_image_format[format_name] = spirv_image_format.get('name')
+
+ for plane in elem.iterfind('plane'):
+ if format_name not in self.plane_format:
+ # create list if first time
+ self.plane_format[format_name] = []
+ self.plane_format[format_name].append({
+ 'index' : int(plane.get('index')),
+ 'widthDivisor' : int(plane.get('widthDivisor')),
+ 'heightDivisor' : int(plane.get('heightDivisor')),
+ 'compatible' : plane.get('compatible'),
+ })
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genRef.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genRef.py
new file mode 100755
index 00000000000..953ec6b3d91
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genRef.py
@@ -0,0 +1,1113 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# genRef.py - create API ref pages from spec source files
+#
+# Usage: genRef.py files
+
+import argparse
+import io
+import os
+import re
+import sys
+from collections import OrderedDict
+from reflib import (findRefs, fixupRefs, loadFile, logDiag, logWarn, logErr,
+ printPageInfo, setLogFile)
+from reg import Registry
+from generator import GeneratorOptions
+from parse_dependency import dependencyNames
+from apiconventions import APIConventions
+
+
+# refpage 'type' attributes which are API entities and contain structured
+# content such as API includes, valid usage blocks, etc.
+refpage_api_types = (
+ 'basetypes',
+ 'consts',
+ 'defines',
+ 'enums',
+ 'flags',
+ 'funcpointers',
+ 'handles',
+ 'protos',
+ 'structs',
+)
+
+# Other refpage types - SPIR-V builtins, API feature blocks, etc. - which do
+# not have structured content.
+refpage_other_types = (
+ 'builtins',
+ 'feature',
+ 'freeform',
+ 'spirv'
+)
+
+
+def makeExtensionInclude(name):
+ """Return an include command for a generated extension interface.
+ - name - extension name"""
+
+ return 'include::{}/meta/refpage.{}{}[]'.format(
+ conventions.generated_include_path,
+ name,
+ conventions.file_suffix)
+
+
+def makeAPIInclude(type, name):
+ """Return an include command for a generated API interface
+ - type - type of the API, e.g. 'flags', 'handles', etc
+ - name - name of the API"""
+
+ return 'include::{}/api/{}/{}{}\n'.format(
+ conventions.generated_include_path,
+ type, name, conventions.file_suffix)
+
+
+def isextension(name):
+ """Return True if name is an API extension name (ends with an upper-case
+ author ID).
+
+ This assumes that author IDs are at least two characters."""
+ return name[-2:].isalpha() and name[-2:].isupper()
+
+
+def printCopyrightSourceComments(fp):
+ """Print Khronos CC-BY copyright notice on open file fp.
+
+ Writes an asciidoc comment block, which copyrights the source
+ file."""
+ print('// Copyright 2014-2023 The Khronos Group Inc.', file=fp)
+ print('//', file=fp)
+ # This works around constraints of the 'reuse' tool
+ print('// SPDX' + '-License-Identifier: CC-BY-4.0', file=fp)
+ print('', file=fp)
+
+
+def printFooter(fp, leveloffset=0):
+ """Print footer material at the end of each refpage on open file fp.
+
+ If generating separate refpages, adds the copyright.
+ If generating the single combined refpage, just add a separator.
+
+ - leveloffset - number of levels to bias section titles up or down."""
+
+ # Generate the section header.
+ # Default depth is 2.
+ depth = max(0, leveloffset + 2)
+ prefix = '=' * depth
+
+ print('ifdef::doctype-manpage[]',
+ f'{prefix} Copyright',
+ '',
+ 'include::{config}/copyright-ccby' + conventions.file_suffix + '[]',
+ 'endif::doctype-manpage[]',
+ '',
+ 'ifndef::doctype-manpage[]',
+ '<<<',
+ 'endif::doctype-manpage[]',
+ '',
+ sep='\n', file=fp)
+
+
+def macroPrefix(name):
+ """Add a spec asciidoc macro prefix to an API name, depending on its type
+ (protos, structs, enums, etc.).
+
+ If the name is not recognized, use the generic link macro 'reflink:'."""
+ if name in api.basetypes:
+ return 'basetype:' + name
+ if name in api.defines:
+ return 'dlink:' + name
+ if name in api.enums:
+ return 'elink:' + name
+ if name in api.flags:
+ return 'tlink:' + name
+ if name in api.funcpointers:
+ return 'tlink:' + name
+ if name in api.handles:
+ return 'slink:' + name
+ if name in api.protos:
+ return 'flink:' + name
+ if name in api.structs:
+ return 'slink:' + name
+ if name == 'TBD':
+ return 'No cross-references are available'
+ return 'reflink:' + name
+
+
+def seeAlsoList(apiName, explicitRefs=None, apiAliases=[]):
+ """Return an asciidoc string with a list of 'See Also' references for the
+ API entity 'apiName', based on the relationship mapping in the api module.
+
+ 'explicitRefs' is a list of additional cross-references.
+
+ If apiAliases is not None, it is a list of aliases of apiName whose
+ cross-references will also be included.
+
+ If no relationships are available, return None."""
+
+ refs = set(())
+
+ # apiName and its aliases are treated equally
+ allApis = apiAliases.copy()
+ allApis.append(apiName)
+
+ # Add all the implicit references to refs
+ for name in allApis:
+ if name in api.mapDict:
+ refs.update(api.mapDict[name])
+
+ # Add all the explicit references
+ if explicitRefs is not None:
+ if isinstance(explicitRefs, str):
+ explicitRefs = explicitRefs.split()
+ refs.update(name for name in explicitRefs)
+
+ # Add extensions / core versions based on dependencies
+ for name in allApis:
+ if name in api.requiredBy:
+ for (base,dependency) in api.requiredBy[name]:
+ refs.add(base)
+ if dependency is not None:
+ # 'dependency' may be a boolean expression of extension
+ # names.
+ # Extract them for use in cross-references.
+ for extname in dependencyNames(dependency):
+ refs.add(extname)
+
+ if len(refs) == 0:
+ return None
+ else:
+ return ', '.join(macroPrefix(name) for name in sorted(refs)) + '\n'
+
+
+def remapIncludes(lines, baseDir, specDir):
+ """Remap include directives in a list of lines so they can be extracted to a
+ different directory.
+
+ Returns remapped lines.
+
+ - lines - text to remap
+ - baseDir - target directory
+ - specDir - source directory"""
+ # This should be compiled only once
+ includePat = re.compile(r'^include::(?P<path>.*)\[\]')
+
+ newLines = []
+ for line in lines:
+ matches = includePat.search(line)
+ if matches is not None:
+ path = matches.group('path')
+
+ if path[0] != '{':
+ # Relative path to include file from here
+ incPath = specDir + '/' + path
+ # Remap to be relative to baseDir
+ newPath = os.path.relpath(incPath, baseDir)
+ newLine = 'include::' + newPath + '[]\n'
+ logDiag('remapIncludes: remapping', line, '->', newLine)
+ newLines.append(newLine)
+ else:
+ # An asciidoctor variable starts the path.
+ # This must be an absolute path, not needing to be rewritten.
+ newLines.append(line)
+ else:
+ newLines.append(line)
+ return newLines
+
+
+def refPageShell(pageName, pageDesc, fp, head_content = None, sections=None, tail_content=None, man_section=3):
+ """Generate body of a reference page.
+
+ - pageName - string name of the page
+ - pageDesc - string short description of the page
+ - fp - file to write to
+ - head_content - text to include before the sections
+ - sections - iterable returning (title,body) for each section.
+ - tail_content - text to include after the sections
+ - man_section - Unix man page section"""
+
+ printCopyrightSourceComments(fp)
+
+ print(':data-uri:',
+ ':icons: font',
+ ':attribute-missing: warn',
+ conventions.extra_refpage_headers,
+ '',
+ sep='\n', file=fp)
+
+ s = '{}({})'.format(pageName, man_section)
+ print('= ' + s,
+ '',
+ conventions.extra_refpage_body,
+ '',
+ sep='\n', file=fp)
+ if pageDesc.strip() == '':
+ pageDesc = 'NO SHORT DESCRIPTION PROVIDED'
+ logWarn('refPageHead: no short description provided for', pageName)
+
+ print('== Name',
+ '{} - {}'.format(pageName, pageDesc),
+ '',
+ sep='\n', file=fp)
+
+ if head_content is not None:
+ print(head_content,
+ '',
+ sep='\n', file=fp)
+
+ if sections is not None:
+ for title, content in sections.items():
+ print('== {}'.format(title),
+ '',
+ content,
+ '',
+ sep='\n', file=fp)
+
+ if tail_content is not None:
+ print(tail_content,
+ '',
+ sep='\n', file=fp)
+
+
+def refPageHead(pageName, pageDesc, specText, fieldName, fieldText, descText, fp):
+ """Generate header of a reference page.
+
+ - pageName - string name of the page
+ - pageDesc - string short description of the page
+ - specType - string containing 'spec' field from refpage open block, or None.
+ Used to determine containing spec name and URL.
+ - specText - string that goes in the "C Specification" section
+ - fieldName - string heading an additional section following specText, if not None
+ - fieldText - string that goes in the additional section
+ - descText - string that goes in the "Description" section
+ - fp - file to write to"""
+ sections = OrderedDict()
+
+ if specText is not None:
+ sections['C Specification'] = specText
+
+ if fieldName is not None:
+ sections[fieldName] = fieldText
+
+ if descText is None or descText.strip() == '':
+ logWarn('refPageHead: no description provided for', pageName)
+
+ if descText is not None:
+ sections['Description'] = descText
+
+ refPageShell(pageName, pageDesc, fp, head_content=None, sections=sections)
+
+
+def refPageTail(pageName,
+ specType=None,
+ specAnchor=None,
+ seeAlso=None,
+ fp=None,
+ auto=False,
+ leveloffset=0):
+ """Generate end boilerplate of a reference page.
+
+ - pageName - name of the page
+ - specType - None or the 'spec' attribute from the refpage block,
+ identifying the specification name and URL this refpage links to.
+ - specAnchor - None or the 'anchor' attribute from the refpage block,
+ identifying the anchor in the specification this refpage links to. If
+ None, the pageName is assumed to be a valid anchor.
+ - seeAlso - text of the "See Also" section
+ - fp - file to write the page to
+ - auto - True if this is an entirely generated refpage, False if it is
+ handwritten content from the spec.
+ - leveloffset - number of levels to bias section titles up or down."""
+
+ specName = conventions.api_name(specType)
+ specURL = conventions.specURL(specType)
+ if specAnchor is None:
+ specAnchor = pageName
+
+ if seeAlso is None:
+ seeAlso = 'No cross-references are available\n'
+
+ notes = [
+ 'For more information, see the {}#{}[{} Specification^]'.format(
+ specURL, specAnchor, specName),
+ '',
+ ]
+
+ if auto:
+ notes.extend((
+ 'This page is a generated document.',
+ 'Fixes and changes should be made to the generator scripts, '
+ 'not directly.',
+ ))
+ else:
+ notes.extend((
+ 'This page is extracted from the ' + specName + ' Specification. ',
+ 'Fixes and changes should be made to the Specification, '
+ 'not directly.',
+ ))
+
+ # Generate the section header.
+ # Default depth is 2.
+ depth = max(0, leveloffset + 2)
+ prefix = '=' * depth
+
+ print(f'{prefix} See Also',
+ '',
+ seeAlso,
+ '',
+ sep='\n', file=fp)
+
+ print(f'{prefix} Document Notes',
+ '',
+ '\n'.join(notes),
+ '',
+ sep='\n', file=fp)
+
+ printFooter(fp, leveloffset)
+
+
+def xrefRewriteInitialize():
+ """Initialize substitution patterns for asciidoctor xrefs."""
+
+ global refLinkPattern, refLinkSubstitute
+ global refLinkTextPattern, refLinkTextSubstitute
+ global specLinkPattern, specLinkSubstitute
+
+ # These are xrefs to API entities, rewritten to link to refpages
+ # The refLink variants are for xrefs with only an anchor and no text.
+ # The refLinkText variants are for xrefs with both anchor and text
+ refLinkPattern = re.compile(r'<<([Vv][Kk][A-Za-z0-9_]+)>>')
+ refLinkSubstitute = r'link:\1.html[\1^]'
+
+ refLinkTextPattern = re.compile(r'<<([Vv][Kk][A-Za-z0-9_]+)[,]?[ \t\n]*([^>,]*)>>')
+ refLinkTextSubstitute = r'link:\1.html[\2^]'
+
+ # These are xrefs to other anchors, rewritten to link to the spec
+ specLinkPattern = re.compile(r'<<([-A-Za-z0-9_.(){}:]+)[,]?[ \t\n]*([^>,]*)>>')
+
+ # Unfortunately, specLinkSubstitute depends on the link target,
+ # so cannot be constructed in advance.
+ specLinkSubstitute = None
+
+
+def xrefRewrite(text, specURL):
+ """Rewrite asciidoctor xrefs in text to resolve properly in refpages.
+ Xrefs which are to refpages are rewritten to link to those
+ refpages. The remainder are rewritten to generate external links into
+ the supplied specification document URL.
+
+ - text - string to rewrite, or None
+ - specURL - URL to target
+
+ Returns rewritten text, or None, respectively"""
+
+ global refLinkPattern, refLinkSubstitute
+ global refLinkTextPattern, refLinkTextSubstitute
+ global specLinkPattern, specLinkSubstitute
+
+ specLinkSubstitute = r'link:{}#\1[\2^]'.format(specURL)
+
+ if text is not None:
+ text, _ = refLinkPattern.subn(refLinkSubstitute, text)
+ text, _ = refLinkTextPattern.subn(refLinkTextSubstitute, text)
+ text, _ = specLinkPattern.subn(specLinkSubstitute, text)
+
+ return text
+
+def emitPage(baseDir, specDir, pi, file):
+ """Extract a single reference page into baseDir.
+
+ - baseDir - base directory to emit page into
+ - specDir - directory extracted page source came from
+ - pi - pageInfo for this page relative to file
+ - file - list of strings making up the file, indexed by pi"""
+ pageName = f'{baseDir}/{pi.name}{conventions.file_suffix}'
+
+ # Add a dictionary entry for this page
+ global genDict
+ genDict[pi.name] = None
+ logDiag('emitPage:', pageName)
+
+ # Short description
+ if pi.desc is None:
+ pi.desc = '(no short description available)'
+
+ # Member/parameter section label and text, if there is one
+ field = None
+ fieldText = None
+
+ # Only do structural checks on API pages
+ if pi.type in refpage_api_types:
+ if pi.include is None:
+ logWarn('emitPage:', pageName, 'INCLUDE is None, no page generated')
+ return
+
+ # Specification text
+ lines = remapIncludes(file[pi.begin:pi.include + 1], baseDir, specDir)
+ specText = ''.join(lines)
+
+ if pi.param is not None:
+ if pi.type == 'structs':
+ field = 'Members'
+ elif pi.type in ['protos', 'funcpointers']:
+ field = 'Parameters'
+ else:
+ logWarn('emitPage: unknown field type:', pi.type,
+ 'for', pi.name)
+ lines = remapIncludes(file[pi.param:pi.body], baseDir, specDir)
+ fieldText = ''.join(lines)
+
+ # Description text
+ if pi.body != pi.include:
+ lines = remapIncludes(file[pi.body:pi.end + 1], baseDir, specDir)
+ descText = ''.join(lines)
+ else:
+ descText = None
+ logWarn('emitPage: INCLUDE == BODY, so description will be empty for', pi.name)
+ if pi.begin != pi.include:
+ logWarn('emitPage: Note: BEGIN != INCLUDE, so the description might be incorrectly located before the API include!')
+ elif pi.type in refpage_other_types:
+ specText = None
+ descText = ''.join(file[pi.begin:pi.end + 1])
+ else:
+ # This should be caught in the spec markup checking tests
+ logErr(f"emitPage: refpage type='{pi.type}' is unrecognized")
+
+ # Rewrite asciidoctor xrefs to resolve properly in refpages
+ specURL = conventions.specURL(pi.spec)
+
+ specText = xrefRewrite(specText, specURL)
+ fieldText = xrefRewrite(fieldText, specURL)
+ descText = xrefRewrite(descText, specURL)
+
+ fp = open(pageName, 'w', encoding='utf-8')
+ refPageHead(pi.name,
+ pi.desc,
+ specText,
+ field, fieldText,
+ descText,
+ fp)
+ refPageTail(pageName=pi.name,
+ specType=pi.spec,
+ specAnchor=pi.anchor,
+ seeAlso=seeAlsoList(pi.name, pi.refs, pi.alias.split()),
+ fp=fp,
+ auto=False)
+ fp.close()
+
+
+def autoGenEnumsPage(baseDir, pi, file):
+ """Autogenerate a single reference page in baseDir.
+
+ Script only knows how to do this for /enums/ pages, at present.
+
+ - baseDir - base directory to emit page into
+ - pi - pageInfo for this page relative to file
+ - file - list of strings making up the file, indexed by pi"""
+ pageName = f'{baseDir}/{pi.name}{conventions.file_suffix}'
+ fp = open(pageName, 'w', encoding='utf-8')
+
+ # Add a dictionary entry for this page
+ global genDict
+ genDict[pi.name] = None
+ logDiag('autoGenEnumsPage:', pageName)
+
+ # Short description
+ if pi.desc is None:
+ pi.desc = '(no short description available)'
+
+ # Description text. Allow for the case where an enum definition
+ # is not embedded.
+ if not pi.embed:
+ embedRef = ''
+ else:
+ embedRef = ''.join((
+ ' * The reference page for ',
+ macroPrefix(pi.embed),
+ ', where this interface is defined.\n'))
+
+ txt = ''.join((
+ 'For more information, see:\n\n',
+ embedRef,
+ ' * The See Also section for other reference pages using this type.\n',
+ ' * The ' + apiName + ' Specification.\n'))
+
+ refPageHead(pi.name,
+ pi.desc,
+ ''.join(file[pi.begin:pi.include + 1]),
+ None, None,
+ txt,
+ fp)
+ refPageTail(pageName=pi.name,
+ specType=pi.spec,
+ specAnchor=pi.anchor,
+ seeAlso=seeAlsoList(pi.name, pi.refs, pi.alias.split()),
+ fp=fp,
+ auto=True)
+ fp.close()
+
+
+# Pattern to break apart an API *Flags{authorID} name, used in
+# autoGenFlagsPage.
+flagNamePat = re.compile(r'(?P<name>\w+)Flags(?P<author>[A-Z]*)')
+
+
+def autoGenFlagsPage(baseDir, flagName):
+ """Autogenerate a single reference page in baseDir for an API *Flags type.
+
+ - baseDir - base directory to emit page into
+ - flagName - API *Flags name"""
+ pageName = f'{baseDir}/{flagName}{conventions.file_suffix}'
+ fp = open(pageName, 'w', encoding='utf-8')
+
+ # Add a dictionary entry for this page
+ global genDict
+ genDict[flagName] = None
+ logDiag('autoGenFlagsPage:', pageName)
+
+ # Short description
+ matches = flagNamePat.search(flagName)
+ if matches is not None:
+ name = matches.group('name')
+ author = matches.group('author')
+ logDiag('autoGenFlagsPage: split name into', name, 'Flags', author)
+ flagBits = name + 'FlagBits' + author
+ desc = 'Bitmask of ' + flagBits
+ else:
+ logWarn('autoGenFlagsPage:', pageName, 'does not end in "Flags{author ID}". Cannot infer FlagBits type.')
+ flagBits = None
+ desc = 'Unknown ' + apiName + ' flags type'
+
+ # Description text
+ if flagBits is not None:
+ txt = ''.join((
+ 'etext:' + flagName,
+ ' is a mask of zero or more elink:' + flagBits + '.\n',
+ 'It is used as a member and/or parameter of the structures and commands\n',
+ 'in the See Also section below.\n'))
+ else:
+ txt = ''.join((
+ 'etext:' + flagName,
+ ' is an unknown ' + apiName + ' type, assumed to be a bitmask.\n'))
+
+ refPageHead(flagName,
+ desc,
+ makeAPIInclude('flags', flagName),
+ None, None,
+ txt,
+ fp)
+ refPageTail(pageName=flagName,
+ specType=pi.spec,
+ specAnchor=pi.anchor,
+ seeAlso=seeAlsoList(flagName, None),
+ fp=fp,
+ auto=True)
+ fp.close()
+
+
+def autoGenHandlePage(baseDir, handleName):
+ """Autogenerate a single handle page in baseDir for an API handle type.
+
+ - baseDir - base directory to emit page into
+ - handleName - API handle name"""
+ # @@ Need to determine creation function & add handles/ include for the
+ # @@ interface in generator.py.
+ pageName = f'{baseDir}/{handleName}{conventions.file_suffix}'
+ fp = open(pageName, 'w', encoding='utf-8')
+
+ # Add a dictionary entry for this page
+ global genDict
+ genDict[handleName] = None
+ logDiag('autoGenHandlePage:', pageName)
+
+ # Short description
+ desc = apiName + ' object handle'
+
+ descText = ''.join((
+ 'sname:' + handleName,
+ ' is an object handle type, referring to an object used\n',
+ 'by the ' + apiName + ' implementation. These handles are created or allocated\n',
+ 'by the @@ TBD @@ function, and used by other ' + apiName + ' structures\n',
+ 'and commands in the See Also section below.\n'))
+
+ refPageHead(handleName,
+ desc,
+ makeAPIInclude('handles', handleName),
+ None, None,
+ descText,
+ fp)
+ refPageTail(pageName=handleName,
+ specType=pi.spec,
+ specAnchor=pi.anchor,
+ seeAlso=seeAlsoList(handleName, None),
+ fp=fp,
+ auto=True)
+ fp.close()
+
+
+def genRef(specFile, baseDir):
+ """Extract reference pages from a spec asciidoc source file.
+
+ - specFile - filename to extract from
+ - baseDir - output directory to generate page in"""
+ # We do not care the newline format used here.
+ file, _ = loadFile(specFile)
+ if file is None:
+ return
+
+ # Save the path to this file for later use in rewriting relative includes
+ specDir = os.path.dirname(os.path.abspath(specFile))
+
+ pageMap = findRefs(file, specFile)
+ logDiag(specFile + ': found', len(pageMap.keys()), 'potential pages')
+
+ sys.stderr.flush()
+
+ # Fix up references in pageMap
+ fixupRefs(pageMap, specFile, file)
+
+ # Create each page, if possible
+ pages = {}
+
+ for name in sorted(pageMap):
+ pi = pageMap[name]
+
+ # Only generate the page if it is in the requested build
+ # 'freeform' pages are always generated
+ # 'feature' pages (core versions & extensions) are generated if they are in
+ # the requested feature list
+ # All other pages (APIs) are generated if they are in the API map for
+ # the build.
+ if pi.type in refpage_api_types:
+ if name not in api.typeCategory:
+ # Also check aliases of name - api.nonexistent is the same
+ # mapping used to rewrite *link: macros in this build.
+ if name not in api.nonexistent:
+ logWarn(f'genRef: NOT generating feature page {name} - API not in this build')
+ continue
+ else:
+ logWarn(f'genRef: generating feature page {name} because its alias {api.nonexistent[name]} exists')
+ elif pi.type in refpage_other_types:
+ # The only non-API type which can be checked is a feature refpage
+ if pi.type == 'feature':
+ if name not in api.features:
+ logWarn(f'genRef: NOT generating feature page {name} - feature not in this build')
+ continue
+
+ printPageInfo(pi, file)
+
+ if pi.Warning:
+ logDiag('genRef:', pi.name + ':', pi.Warning)
+
+ if pi.extractPage:
+ emitPage(baseDir, specDir, pi, file)
+ elif pi.type == 'enums':
+ autoGenEnumsPage(baseDir, pi, file)
+ elif pi.type == 'flags':
+ autoGenFlagsPage(baseDir, pi.name)
+ else:
+ # Do not extract this page
+ logWarn('genRef: Cannot extract or autogenerate:', pi.name)
+
+ pages[pi.name] = pi
+ for alias in pi.alias.split():
+ pages[alias] = pi
+
+ return pages
+
+
+def genSinglePageRef(baseDir):
+ """Generate the single-page version of the ref pages.
+
+ This assumes there is a page for everything in the api module dictionaries.
+ Extensions (KHR, EXT, etc.) are currently skipped"""
+ # Accumulate head of page
+ head = io.StringIO()
+
+ printCopyrightSourceComments(head)
+
+ print('= ' + apiName + ' API Reference Pages',
+ ':data-uri:',
+ ':icons: font',
+ ':doctype: book',
+ ':numbered!:',
+ ':max-width: 200',
+ ':data-uri:',
+ ':toc2:',
+ ':toclevels: 2',
+ ':attribute-missing: warn',
+ '',
+ sep='\n', file=head)
+
+ print('== Copyright', file=head)
+ print('', file=head)
+ print('include::{config}/copyright-ccby' + conventions.file_suffix + '[]', file=head)
+ print('', file=head)
+
+ # Inject the table of contents. Asciidoc really ought to be generating
+ # this for us.
+
+ sections = [
+ [api.protos, 'protos', apiName + ' Commands'],
+ [api.handles, 'handles', 'Object Handles'],
+ [api.structs, 'structs', 'Structures'],
+ [api.enums, 'enums', 'Enumerations'],
+ [api.flags, 'flags', 'Flags'],
+ [api.funcpointers, 'funcpointers', 'Function Pointer Types'],
+ [api.basetypes, 'basetypes', apiName + ' Scalar types'],
+ [api.defines, 'defines', 'C Macro Definitions'],
+ [extensions, 'extensions', apiName + ' Extensions']
+ ]
+
+ # Accumulate body of page
+ body = io.StringIO()
+
+ for (apiDict, label, title) in sections:
+ # Add section title/anchor header to body
+ anchor = '[[' + label + ',' + title + ']]'
+ print(anchor,
+ '== ' + title,
+ '',
+ ':leveloffset: 2',
+ '',
+ sep='\n', file=body)
+
+ if label == 'extensions':
+ # preserve order of extensions since we already sorted the way we want.
+ keys = apiDict.keys()
+ else:
+ keys = sorted(apiDict.keys())
+
+ for refPage in keys:
+ # Do not generate links for aliases, which are included with the
+ # aliased page
+ if refPage not in api.alias:
+ # Add page to body
+ if 'FlagBits' in refPage and conventions.unified_flag_refpages:
+ # OpenXR does not create separate ref pages for FlagBits:
+ # the FlagBits includes go in the Flags refpage.
+ # Previously the Vulkan script would only emit non-empty
+ # Vk*Flags pages, via the logic
+ # if refPage not in api.flags or api.flags[refPage] is not None
+ # emit page
+ # Now, all are emitted.
+ continue
+ else:
+ print(f'include::{refPage}{conventions.file_suffix}[]', file=body)
+ else:
+ # Alternatively, we could (probably should) link to the
+ # aliased refpage
+ logWarn('(Benign) Not including', refPage,
+ 'in single-page reference',
+ 'because it is an alias of', api.alias[refPage])
+
+ print('\n' + ':leveloffset: 0' + '\n', file=body)
+
+ # Write head and body to the output file
+ pageName = f'{baseDir}/apispec{conventions.file_suffix}'
+ fp = open(pageName, 'w', encoding='utf-8')
+
+ print(head.getvalue(), file=fp, end='')
+ print(body.getvalue(), file=fp, end='')
+
+ head.close()
+ body.close()
+ fp.close()
+
+
+def genExtension(baseDir, extpath, name, info):
+ """Generate refpage, and add dictionary entry for an extension
+
+ - baseDir - output directory to generate page in
+ - extpath - None, or path to per-extension specification sources if
+ those are to be included in extension refpages
+ - name - extension name
+ - info - <extension> Element from XML"""
+
+ # Add a dictionary entry for this page
+ global genDict
+ genDict[name] = None
+ declares = []
+ elem = info.elem
+
+ # Type of extension (instance, device, etc.)
+ ext_type = elem.get('type')
+
+ # Autogenerate interfaces from <extension> entry
+ for required in elem.find('require'):
+ req_name = required.get('name')
+ if not req_name:
+ # This is not what we are looking for
+ continue
+ if req_name.endswith('_SPEC_VERSION') or req_name.endswith('_EXTENSION_NAME'):
+ # Do not link to spec version or extension name - those ref pages are not created.
+ continue
+
+ if required.get('extends'):
+ # These are either extensions of enumerated types, or const enum
+ # values: neither of which get a ref page - although we could
+ # include the enumerated types in the See Also list.
+ continue
+
+ if req_name not in genDict:
+ if req_name in api.alias:
+ logWarn(f'WARN: {req_name} (in extension {name}) is an alias, so does not have a ref page')
+ else:
+ logWarn(f'ERROR: {req_name} (in extension {name}) does not have a ref page.')
+
+ declares.append(req_name)
+
+ appbody = None
+ tail_content = None
+ if extpath is not None:
+ try:
+ appPath = extpath + '/' + conventions.extension_file_path(name)
+ appfp = open(appPath, 'r', encoding='utf-8')
+ appbody = appfp.read()
+ appfp.close()
+
+ # Transform internal links to crosslinks
+ specURL = conventions.specURL()
+ appbody = xrefRewrite(appbody, specURL)
+ except FileNotFoundError:
+ print('Cannot find extension appendix for', name)
+ logWarn('Cannot find extension appendix for', name)
+
+ # Fall through to autogenerated page
+ extpath = None
+ appbody = None
+
+ appbody = f'Cannot find extension appendix {appPath} for {name}\n'
+ else:
+ tail_content = makeExtensionInclude(name)
+
+ # Write the extension refpage
+ pageName = f'{baseDir}/{name}{conventions.file_suffix}'
+ logDiag('genExtension:', pageName)
+ fp = open(pageName, 'w', encoding='utf-8')
+
+ # There are no generated titled sections
+ sections = None
+
+ refPageShell(name,
+ "{} extension".format(ext_type),
+ fp,
+ appbody,
+ sections=sections,
+ tail_content=tail_content)
+
+ # Restore leveloffset for boilerplate in refPageTail
+ if conventions.include_extension_appendix_in_refpage:
+ # The generated metadata include (refpage.extensionname.adoc) moved
+ # the leveloffset attribute by -1 to account for the relative
+ # structuring of the spec extension appendix section structure vs.
+ # the refpages.
+ # This restores leveloffset for the boilerplate in refPageTail.
+ leveloffset = 1
+ else:
+ leveloffset = 0
+
+ refPageTail(pageName=name,
+ specType=None,
+ specAnchor=name,
+ seeAlso=seeAlsoList(name, declares),
+ fp=fp,
+ auto=True,
+ leveloffset=leveloffset)
+ fp.close()
+
+
+if __name__ == '__main__':
+ global genDict, extensions, conventions, apiName
+ genDict = {}
+ extensions = OrderedDict()
+ conventions = APIConventions()
+ apiName = conventions.api_name('api')
+
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-diag', action='store', dest='diagFile',
+ help='Set the diagnostic file')
+ parser.add_argument('-warn', action='store', dest='warnFile',
+ help='Set the warning file')
+ parser.add_argument('-log', action='store', dest='logFile',
+ help='Set the log file for both diagnostics and warnings')
+ parser.add_argument('-genpath', action='store',
+ default='gen',
+ help='Path to directory containing generated files')
+ parser.add_argument('-basedir', action='store', dest='baseDir',
+ default=None,
+ help='Set the base directory in which pages are generated')
+ parser.add_argument('-noauto', action='store_true',
+ help='Don\'t generate inferred ref pages automatically')
+ parser.add_argument('files', metavar='filename', nargs='*',
+ help='a filename to extract ref pages from')
+ parser.add_argument('--version', action='version', version='%(prog)s 1.0')
+ parser.add_argument('-extension', action='append',
+ default=[],
+ help='Specify an extension or extensions to add to targets')
+ parser.add_argument('-rewrite', action='store',
+ default=None,
+ help='Name of output file to write Apache mod_rewrite directives to')
+ parser.add_argument('-toc', action='store',
+ default=None,
+ help='Name of output file to write an alphabetical TOC to')
+ parser.add_argument('-registry', action='store',
+ default=conventions.registry_path,
+ help='Use specified registry file instead of default')
+ parser.add_argument('-extpath', action='store',
+ default=None,
+ help='Use extension descriptions from this directory instead of autogenerating extension refpages')
+
+ results = parser.parse_args()
+
+ # Load the generated apimap module
+ sys.path.insert(0, results.genpath)
+ import apimap as api
+
+ setLogFile(True, True, results.logFile)
+ setLogFile(True, False, results.diagFile)
+ setLogFile(False, True, results.warnFile)
+
+ # Initialize static rewrite patterns for spec xrefs
+ xrefRewriteInitialize()
+
+ if results.baseDir is None:
+ baseDir = results.genpath + '/ref'
+ else:
+ baseDir = results.baseDir
+
+ # Dictionary of pages & aliases
+ pages = {}
+
+ for file in results.files:
+ d = genRef(file, baseDir)
+ pages.update(d)
+
+ # Now figure out which pages were not generated from the spec.
+ # This relies on the dictionaries of API constructs in the api module.
+
+ if not results.noauto:
+ # Must have an apiname selected to avoid complaints from
+ # registry.loadFile, even though it is irrelevant to our uses.
+ genOpts = GeneratorOptions(apiname = conventions.xml_api_name)
+ registry = Registry(genOpts = genOpts)
+ registry.loadFile(results.registry)
+
+ if conventions.write_refpage_include:
+ # Only extensions with a supported="..." attribute in this set
+ # will be considered for extraction/generation.
+ ext_names = set(k for k, v in registry.extdict.items()
+ if conventions.xml_api_name in v.supported.split(','))
+
+ desired_extensions = ext_names.intersection(set(results.extension))
+ for prefix in conventions.extension_index_prefixes:
+ # Splits up into chunks, sorted within each chunk.
+ filtered_extensions = sorted(
+ [name for name in desired_extensions
+ if name.startswith(prefix) and name not in extensions])
+ for name in filtered_extensions:
+ # logWarn('NOT autogenerating extension refpage for', name)
+ extensions[name] = None
+ genExtension(baseDir, results.extpath, name, registry.extdict[name])
+
+ # autoGenFlagsPage is no longer needed because they are added to
+ # the spec sources now.
+ # for page in api.flags:
+ # if page not in genDict:
+ # autoGenFlagsPage(baseDir, page)
+
+ # autoGenHandlePage is no longer needed because they are added to
+ # the spec sources now.
+ # for page in api.structs:
+ # if typeCategory[page] == 'handle':
+ # autoGenHandlePage(baseDir, page)
+
+ sections = [
+ (api.flags, 'Flag Types'),
+ (api.enums, 'Enumerated Types'),
+ (api.structs, 'Structures'),
+ (api.protos, 'Prototypes'),
+ (api.funcpointers, 'Function Pointers'),
+ (api.basetypes, apiName + ' Scalar Types'),
+ (extensions, apiName + ' Extensions'),
+ ]
+
+ # Summarize pages that were not generated, for good or bad reasons
+
+ for (apiDict, title) in sections:
+ # OpenXR was keeping a 'flagged' state which only printed out a
+ # warning for the first non-generated page, but was otherwise
+ # unused. This does not seem helpful.
+ for page in apiDict:
+ if page not in genDict:
+ # Page was not generated - why not?
+ if page in api.alias:
+ logDiag('(Benign, is an alias) Ref page for', title, page, 'is aliased into', api.alias[page])
+ elif page in api.flags and api.flags[page] is None:
+ logDiag('(Benign, no FlagBits defined) No ref page generated for ', title,
+ page)
+ else:
+ # Could introduce additional logic to detect
+ # external types and not emit them.
+ logWarn('No ref page generated for ', title, page)
+
+ genSinglePageRef(baseDir)
+
+ if results.rewrite:
+ # Generate Apache rewrite directives for refpage aliases
+ fp = open(results.rewrite, 'w', encoding='utf-8')
+
+ for page in sorted(pages):
+ p = pages[page]
+ rewrite = p.name
+
+ if page != rewrite:
+ print('RewriteRule ^', page, '.html$ ', rewrite, '.html',
+ sep='', file=fp)
+ fp.close()
+
+ if results.toc:
+ # Generate dynamic portion of refpage TOC
+ fp = open(results.toc, 'w', encoding='utf-8')
+
+ # Run through dictionary of pages generating an TOC
+ print(12 * ' ', '<li class="Level1">Alphabetic Contents', sep='', file=fp)
+ print(16 * ' ', '<ul class="Level2">', sep='', file=fp)
+ lastLetter = None
+
+ for page in sorted(pages, key=str.upper):
+ p = pages[page]
+ letter = page[0:1].upper()
+
+ if letter != lastLetter:
+ if lastLetter:
+ # End previous block
+ print(24 * ' ', '</ul>', sep='', file=fp)
+ print(20 * ' ', '</li>', sep='', file=fp)
+ # Start new block
+ print(20 * ' ', '<li>', letter, sep='', file=fp)
+ print(24 * ' ', '<ul class="Level3">', sep='', file=fp)
+ lastLetter = letter
+
+ # Add this page to the list
+ print(28 * ' ', '<li><a href="', p.name, '.html" ',
+ 'target="pagedisplay">', page, '</a></li>',
+ sep='', file=fp)
+
+ if lastLetter:
+ # Close the final letter block
+ print(24 * ' ', '</ul>', sep='', file=fp)
+ print(20 * ' ', '</li>', sep='', file=fp)
+
+ # Close the list
+ print(16 * ' ', '</ul>', sep='', file=fp)
+ print(12 * ' ', '</li>', sep='', file=fp)
+
+ # print('name {} -> page {}'.format(page, pages[page].name))
+
+ fp.close()
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genRelease b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genRelease
new file mode 100755
index 00000000000..73b1f37ca71
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genRelease
@@ -0,0 +1,257 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+import argparse
+import subprocess
+import sys
+
+from genspec import *
+
+# Eventually, these may be defined by the extdependency module
+Version1_3 = [ 'VK_VERSION_1_0', 'VK_VERSION_1_1', 'VK_VERSION_1_2', 'VK_VERSION_1_3' ]
+Version1_2 = [ 'VK_VERSION_1_0', 'VK_VERSION_1_1', 'VK_VERSION_1_2' ]
+Version1_1 = [ 'VK_VERSION_1_0', 'VK_VERSION_1_1' ]
+Version1_0 = [ 'VK_VERSION_1_0' ]
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-internal', action='store_true',
+ help='Generate internal build, not public')
+ parser.add_argument('-norefpages', action='store_true',
+ help='Do not generate refpages')
+ parser.add_argument('-singlerefpage', action='store_true',
+ help='Generate single-page refpage - NOT SUPPORTED')
+ parser.add_argument('-chunked', action='store_true',
+ help='Generate chunked HTML outputs')
+ parser.add_argument('-pdf', action='store_true',
+ help='Generate PDF outputs')
+
+ parser.add_argument('-nov13', action='store_false', dest='v13',
+ help='Suppress Vulkan 1.3 targets')
+ parser.add_argument('-v12', action='store_true',
+ help='Generate Vulkan 1.2 targets')
+ parser.add_argument('-v11', action='store_true',
+ help='Generate Vulkan 1.1 targets')
+ parser.add_argument('-v10', action='store_true',
+ help='Generate Vulkan 1.0 targets')
+
+ parser.add_argument('-nocorespec', action='store_false', dest='corespec',
+ help='Do not generate core API-only targets')
+ parser.add_argument('-noratspec', action='store_false', dest='ratspec',
+ help='Do not generate core API + ratified extensions-only targets')
+ parser.add_argument('-noallspec', action='store_false', dest='allspec',
+ help='Do not generate full API + all extensions targets')
+
+ parser.add_argument('-registry', action='store',
+ default=None,
+ help='Path to API XML registry file specifying version and extension dependencies')
+ parser.add_argument('-apiname', action='store',
+ default=None,
+ help='API name to generate')
+
+ parser.add_argument('-gitroot', action='store',
+ default='/home/tree/git',
+ help='Set the directory containing gitlab vulkan and github Vulkan-Docs repo clones to build from')
+ parser.add_argument('-repodir', action='store', dest='repoDir',
+ default=None,
+ help='Set the repository directory to build from (overrides defaults)')
+ parser.add_argument('-outdir', action='store', dest='outDir',
+ default=None,
+ help='Set the output directory to build into (overrides defaults)')
+
+ args = parser.parse_args()
+
+ # Look for scripts/extdependency.py
+ # This requires makeSpec to be invoked from the repository root, but we
+ # could derive that path.
+ sys.path.insert(0, 'scripts')
+ from extdependency import ApiDependencies
+
+ deps = ApiDependencies(args.registry, args.apiname)
+
+ allExts = deps.allExtensions()
+ ratifiedExts = deps.ratifiedExtensions()
+
+ if args.internal:
+ # For internal build & pseudo-release
+ if args.repoDir is None:
+ args.repoDir = f'{args.gitroot}/vulkan'
+ if args.outDir is None:
+ args.outDir = f'{args.gitroot}/vulkan/out'
+ else:
+ # For public release
+ if args.repoDir is None:
+ args.repoDir = f'{args.gitroot}/Vulkan-Docs'
+ if args.outDir is None:
+ args.outDir = f'{args.gitroot}/registry/vulkan/specs'
+
+ refPageTargets = ''
+
+ if not args.norefpages:
+ # Generate separate reference pages
+ refPageTargets += ' manhtmlpages'
+
+ if args.singlerefpage:
+ # Generate single-page refpage.
+ refPageTargets += ' manhtml'
+ if args.pdf:
+ refPageTargets += ' manpdf'
+ print('echo Info: single-page refpage targets are NOT SUPPORTED')
+
+ specTargets = ' html'
+ if args.chunked:
+ specTargets += ' chunked'
+ if args.pdf:
+ specTargets += ' pdf'
+
+ print('echo Info: Building release from', args.repoDir, 'to', args.outDir)
+ print('echo Info: Building spec targets', specTargets)
+ print('')
+
+ # Current Vulkan 1.3 specs
+ if args.v13:
+ if args.allspec:
+ # Build ref pages and validusage targets only for 1.3 + all exts
+ # Formerly set xmlTargets = 'clobber install', but we no longer
+ # generate headers in the registry tree.
+ buildBranch(targetDir = '1.3-extensions',
+ versions = Version1_3,
+ extensions = allExts,
+ ratified = False,
+ apititle = '(with all registered Vulkan extensions)',
+ specTargets = specTargets + ' validusage' + refPageTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+
+ if args.ratspec:
+ buildBranch(targetDir = '1.3-khr-extensions',
+ versions = Version1_3,
+ extensions = ratifiedExts,
+ ratified = True,
+ apititle = '(with all ratified extensions)',
+ specTargets = specTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+
+ if args.corespec:
+ # Build style guide and registry documentation targets only for 1.3
+ # + no extensions.
+ buildBranch(targetDir = '1.3',
+ versions = Version1_3,
+ extensions = None,
+ ratified = True,
+ apititle = None,
+ specTargets = specTargets + ' styleguide registry',
+ repoDir = args.repoDir,
+ outDir = args.outDir,
+ needRefSources = True)
+
+ # Vulkan 1.2 specs
+ if args.v12:
+ if args.allspec:
+ buildBranch(targetDir = '1.2-extensions',
+ versions = Version1_2,
+ extensions = allExts,
+ ratified = False,
+ apititle = '(with all registered Vulkan extensions)',
+ specTargets = specTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+
+ if args.ratspec:
+ buildBranch(targetDir = '1.2-khr-extensions',
+ versions = Version1_2,
+ extensions = ratifiedExts,
+ ratified = True,
+ apititle = '(with all ratified extensions)',
+ specTargets = specTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+
+ if args.corespec:
+ # Build style guide and registry documentation targets only for 1.2
+ # + no extensions.
+ buildBranch(targetDir = '1.2',
+ versions = Version1_2,
+ extensions = None,
+ ratified = True,
+ apititle = None,
+ specTargets = specTargets + ' styleguide registry',
+ repoDir = args.repoDir,
+ outDir = args.outDir,
+ needRefSources = True)
+
+ # Vulkan 1.1 specs
+ if args.v11:
+ if args.allspec:
+ buildBranch(targetDir = '1.1-extensions',
+ versions = Version1_1,
+ extensions = allExts,
+ ratified = False,
+ apititle = '(with all registered Vulkan extensions)',
+ specTargets = specTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+
+ if args.ratspec:
+ buildBranch(targetDir = '1.1-khr-extensions',
+ versions = Version1_1,
+ extensions = ratifiedExts,
+ ratified = True,
+ apititle = '(with all ratified extensions)',
+ specTargets = specTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+
+ if args.corespec:
+ buildBranch(targetDir = '1.1',
+ versions = Version1_1,
+ extensions = None,
+ ratified = True,
+ apititle = None,
+ specTargets = specTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+ else:
+ print('echo Info: Not building 1.1 specs yet')
+
+
+ # Vulkan 1.0 specs.
+ if args.v10:
+ if args.allspec:
+ buildBranch(targetDir = '1.0-extensions',
+ versions = Version1_0,
+ extensions = allExts,
+ ratified = False,
+ apititle = '(with all registered Vulkan extensions)',
+ specTargets = specTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+
+ if args.ratspec:
+ buildBranch(targetDir = '1.0-wsi_extensions',
+ versions = Version1_0,
+ extensions = ratifiedExts,
+ ratified = True,
+ apititle = '(with all ratified extensions)',
+ specTargets = specTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+
+ if args.corespec:
+ buildBranch(targetDir = '1.0',
+ versions = Version1_0,
+ extensions = None,
+ ratified = True,
+ apititle = None,
+ specTargets = specTargets,
+ repoDir = args.repoDir,
+ outDir = args.outDir)
+ else:
+ print('echo Info: Not building 1.0 specs yet')
+
+ print('echo Info: post-generation cleanup')
+ createTags(releaseNum(), buildOnFriday())
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/generator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/generator.py
new file mode 100644
index 00000000000..107cffa7d50
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/generator.py
@@ -0,0 +1,1394 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+"""Base class for source/header/doc generators, as well as some utility functions."""
+
+from __future__ import unicode_literals
+
+import io
+import os
+import pdb
+import re
+import shutil
+import sys
+import tempfile
+try:
+ from pathlib import Path
+except ImportError:
+ from pathlib2 import Path # type: ignore
+
+from spec_tools.util import getElemName, getElemType
+
+
+def write(*args, **kwargs):
+ file = kwargs.pop('file', sys.stdout)
+ end = kwargs.pop('end', '\n')
+ file.write(' '.join(str(arg) for arg in args))
+ file.write(end)
+
+
+def noneStr(s):
+ """Return string argument, or "" if argument is None.
+
+ Used in converting etree Elements into text.
+ s - string to convert"""
+ if s:
+ return s
+ return ""
+
+
+def enquote(s):
+ """Return string argument with surrounding quotes,
+ for serialization into Python code."""
+ if s:
+ if isinstance(s, str):
+ return f"'{s}'"
+ else:
+ return s
+ return None
+
+
+def regSortCategoryKey(feature):
+ """Sort key for regSortFeatures.
+ Sorts by category of the feature name string:
+
+ - Core API features (those defined with a `<feature>` tag)
+ - (sort VKSC after VK - this is Vulkan-specific)
+ - ARB/KHR/OES (Khronos extensions)
+ - other (EXT/vendor extensions)"""
+
+ if feature.elem.tag == 'feature':
+ if feature.name.startswith('VKSC'):
+ return 0.5
+ else:
+ return 0
+ if (feature.category == 'ARB'
+ or feature.category == 'KHR'
+ or feature.category == 'OES'):
+ return 1
+
+ return 2
+
+
+def regSortOrderKey(feature):
+ """Sort key for regSortFeatures - key is the sortorder attribute."""
+
+ return feature.sortorder
+
+
+def regSortNameKey(feature):
+ """Sort key for regSortFeatures - key is the extension name."""
+
+ return feature.name
+
+
+def regSortFeatureVersionKey(feature):
+ """Sort key for regSortFeatures - key is the feature version.
+ `<extension>` elements all have version number 0."""
+
+ return float(feature.versionNumber)
+
+
+def regSortExtensionNumberKey(feature):
+ """Sort key for regSortFeatures - key is the extension number.
+ `<feature>` elements all have extension number 0."""
+
+ return int(feature.number)
+
+
+def regSortFeatures(featureList):
+ """Default sort procedure for features.
+
+ - Sorts by explicit sort order (default 0) relative to other features
+ - then by feature category ('feature' or 'extension'),
+ - then by version number (for features)
+ - then by extension number (for extensions)"""
+ featureList.sort(key=regSortExtensionNumberKey)
+ featureList.sort(key=regSortFeatureVersionKey)
+ featureList.sort(key=regSortCategoryKey)
+ featureList.sort(key=regSortOrderKey)
+
+
+class MissingGeneratorOptionsError(RuntimeError):
+ """Error raised when a Generator tries to do something that requires GeneratorOptions but it is None."""
+
+ def __init__(self, msg=None):
+ full_msg = 'Missing generator options object self.genOpts'
+ if msg:
+ full_msg += ': ' + msg
+ super().__init__(full_msg)
+
+
+class MissingRegistryError(RuntimeError):
+ """Error raised when a Generator tries to do something that requires a Registry object but it is None."""
+
+ def __init__(self, msg=None):
+ full_msg = 'Missing Registry object self.registry'
+ if msg:
+ full_msg += ': ' + msg
+ super().__init__(full_msg)
+
+
+class MissingGeneratorOptionsConventionsError(RuntimeError):
+ """Error raised when a Generator tries to do something that requires a Conventions object but it is None."""
+
+ def __init__(self, msg=None):
+ full_msg = 'Missing Conventions object self.genOpts.conventions'
+ if msg:
+ full_msg += ': ' + msg
+ super().__init__(full_msg)
+
+
+class GeneratorOptions:
+ """Base class for options used during header/documentation production.
+
+ These options are target language independent, and used by
+ Registry.apiGen() and by base OutputGenerator objects."""
+
+ def __init__(self,
+ conventions=None,
+ filename=None,
+ directory='.',
+ genpath=None,
+ apiname=None,
+ mergeApiNames=None,
+ profile=None,
+ versions='.*',
+ emitversions='.*',
+ defaultExtensions=None,
+ addExtensions=None,
+ removeExtensions=None,
+ emitExtensions=None,
+ emitSpirv=None,
+ emitFormats=None,
+ reparentEnums=True,
+ sortProcedure=regSortFeatures,
+ requireCommandAliases=False,
+ requireDepends=True,
+ ):
+ """Constructor.
+
+ Arguments:
+
+ - conventions - may be mandatory for some generators:
+ an object that implements ConventionsBase
+ - filename - basename of file to generate, or None to write to stdout.
+ - directory - directory in which to generate filename
+ - genpath - path to previously generated files, such as apimap.py
+ - apiname - string matching `<api>` 'apiname' attribute, e.g. 'gl'.
+ - mergeApiNames - If not None, a comma separated list of API names
+ to merge into the API specified by 'apiname'
+ - profile - string specifying API profile , e.g. 'core', or None.
+ - versions - regex matching API versions to process interfaces for.
+ Normally `'.*'` or `'[0-9][.][0-9]'` to match all defined versions.
+ - emitversions - regex matching API versions to actually emit
+ interfaces for (though all requested versions are considered
+ when deciding which interfaces to generate). For GL 4.3 glext.h,
+ this might be `'1[.][2-5]|[2-4][.][0-9]'`.
+ - defaultExtensions - If not None, a string which must in its
+ entirety match the pattern in the "supported" attribute of
+ the `<extension>`. Defaults to None. Usually the same as apiname.
+ - addExtensions - regex matching names of additional extensions
+ to include. Defaults to None.
+ - removeExtensions - regex matching names of extensions to
+ remove (after defaultExtensions and addExtensions). Defaults
+ to None.
+ - emitExtensions - regex matching names of extensions to actually emit
+ interfaces for (though all requested versions are considered when
+ deciding which interfaces to generate). Defaults to None.
+ - emitSpirv - regex matching names of extensions and capabilities
+ to actually emit interfaces for.
+ - emitFormats - regex matching names of formats to actually emit
+ interfaces for.
+ - reparentEnums - move <enum> elements which extend an enumerated
+ type from <feature> or <extension> elements to the target <enums>
+ element. This is required for almost all purposes, but the
+ InterfaceGenerator relies on the list of interfaces in the <feature>
+ or <extension> being complete. Defaults to True.
+ - sortProcedure - takes a list of FeatureInfo objects and sorts
+ them in place to a preferred order in the generated output.
+ - requireCommandAliases - if True, treat command aliases
+ as required dependencies.
+ - requireDepends - whether to follow API dependencies when emitting
+ APIs.
+
+ Default is
+ - core API versions
+ - Khronos (ARB/KHR/OES) extensions
+ - All other extensions
+ - By core API version number or extension number in each group.
+
+ The regex patterns can be None or empty, in which case they match
+ nothing."""
+ self.conventions = conventions
+ """may be mandatory for some generators:
+ an object that implements ConventionsBase"""
+
+ self.filename = filename
+ "basename of file to generate, or None to write to stdout."
+
+ self.genpath = genpath
+ """path to previously generated files, such as apimap.py"""
+
+ self.directory = directory
+ "directory in which to generate filename"
+
+ self.apiname = apiname
+ "string matching `<api>` 'apiname' attribute, e.g. 'gl'."
+
+ self.mergeApiNames = mergeApiNames
+ "comma separated list of API names to merge into the API specified by 'apiname'"
+
+ self.profile = profile
+ "string specifying API profile , e.g. 'core', or None."
+
+ self.versions = self.emptyRegex(versions)
+ """regex matching API versions to process interfaces for.
+ Normally `'.*'` or `'[0-9][.][0-9]'` to match all defined versions."""
+
+ self.emitversions = self.emptyRegex(emitversions)
+ """regex matching API versions to actually emit
+ interfaces for (though all requested versions are considered
+ when deciding which interfaces to generate). For GL 4.3 glext.h,
+ this might be `'1[.][2-5]|[2-4][.][0-9]'`."""
+
+ self.defaultExtensions = defaultExtensions
+ """If not None, a string which must in its
+ entirety match the pattern in the "supported" attribute of
+ the `<extension>`. Defaults to None. Usually the same as apiname."""
+
+ self.addExtensions = self.emptyRegex(addExtensions)
+ """regex matching names of additional extensions
+ to include. Defaults to None."""
+
+ self.removeExtensions = self.emptyRegex(removeExtensions)
+ """regex matching names of extensions to
+ remove (after defaultExtensions and addExtensions). Defaults
+ to None."""
+
+ self.emitExtensions = self.emptyRegex(emitExtensions)
+ """regex matching names of extensions to actually emit
+ interfaces for (though all requested versions are considered when
+ deciding which interfaces to generate)."""
+
+ self.emitSpirv = self.emptyRegex(emitSpirv)
+ """regex matching names of extensions and capabilities
+ to actually emit interfaces for."""
+
+ self.emitFormats = self.emptyRegex(emitFormats)
+ """regex matching names of formats
+ to actually emit interfaces for."""
+
+ self.reparentEnums = reparentEnums
+ """boolean specifying whether to remove <enum> elements from
+ <feature> or <extension> when extending an <enums> type."""
+
+ self.sortProcedure = sortProcedure
+ """takes a list of FeatureInfo objects and sorts
+ them in place to a preferred order in the generated output.
+ Default is core API versions, ARB/KHR/OES extensions, all
+ other extensions, alphabetically within each group."""
+
+ self.codeGenerator = False
+ """True if this generator makes compilable code"""
+
+ self.registry = None
+ """Populated later with the registry object."""
+
+ self.requireCommandAliases = requireCommandAliases
+ """True if alias= attributes of <command> tags are transitively
+ required."""
+
+ self.requireDepends = requireDepends
+ """True if dependencies of API tags are transitively required."""
+
+ def emptyRegex(self, pat):
+ """Substitute a regular expression which matches no version
+ or extension names for None or the empty string."""
+ if not pat:
+ return '_nomatch_^'
+
+ return pat
+
+
+class OutputGenerator:
+ """Generate specified API interfaces in a specific style, such as a C header.
+
+ Base class for generating API interfaces.
+ Manages basic logic, logging, and output file control.
+ Derived classes actually generate formatted output.
+ """
+
+ # categoryToPath - map XML 'category' to include file directory name
+ categoryToPath = {
+ 'bitmask': 'flags',
+ 'enum': 'enums',
+ 'funcpointer': 'funcpointers',
+ 'handle': 'handles',
+ 'define': 'defines',
+ 'basetype': 'basetypes',
+ }
+
+ def breakName(self, name, msg):
+ """Break into debugger if this is a special name"""
+
+ # List of string names to break on
+ bad = (
+ )
+
+ if name in bad and True:
+ print('breakName {}: {}'.format(name, msg))
+ pdb.set_trace()
+
+ def __init__(self, errFile=sys.stderr, warnFile=sys.stderr, diagFile=sys.stdout):
+ """Constructor
+
+ - errFile, warnFile, diagFile - file handles to write errors,
+ warnings, diagnostics to. May be None to not write."""
+ self.outFile = None
+ self.errFile = errFile
+ self.warnFile = warnFile
+ self.diagFile = diagFile
+ # Internal state
+ self.featureName = None
+ """The current feature name being generated."""
+
+ self.featureType = None
+ """The current feature type being generated."""
+
+ self.genOpts = None
+ """The GeneratorOptions subclass instance."""
+
+ self.registry = None
+ """The specification registry object."""
+
+ self.featureDictionary = {}
+ """The dictionary of dictionaries of API features."""
+
+ # Used for extension enum value generation
+ self.extBase = 1000000000
+ self.extBlockSize = 1000
+ self.madeDirs = {}
+
+ # API dictionary, which may be loaded by the beginFile method of
+ # derived generators.
+ self.apidict = None
+
+ # File suffix for generated files, set in beginFile below.
+ self.file_suffix = ''
+
+ def logMsg(self, level, *args):
+ """Write a message of different categories to different
+ destinations.
+
+ - `level`
+ - 'diag' (diagnostic, voluminous)
+ - 'warn' (warning)
+ - 'error' (fatal error - raises exception after logging)
+
+ - `*args` - print()-style arguments to direct to corresponding log"""
+ if level == 'error':
+ strfile = io.StringIO()
+ write('ERROR:', *args, file=strfile)
+ if self.errFile is not None:
+ write(strfile.getvalue(), file=self.errFile)
+ raise UserWarning(strfile.getvalue())
+ elif level == 'warn':
+ if self.warnFile is not None:
+ write('WARNING:', *args, file=self.warnFile)
+ elif level == 'diag':
+ if self.diagFile is not None:
+ write('DIAG:', *args, file=self.diagFile)
+ else:
+ raise UserWarning(
+ '*** FATAL ERROR in Generator.logMsg: unknown level:' + level)
+
+ def enumToValue(self, elem, needsNum, bitwidth = 32,
+ forceSuffix = False, parent_for_alias_dereference=None):
+ """Parse and convert an `<enum>` tag into a value.
+
+ - elem - <enum> Element
+ - needsNum - generate a numeric representation of the element value
+ - bitwidth - size of the numeric representation in bits (32 or 64)
+ - forceSuffix - if True, always use a 'U' / 'ULL' suffix on integers
+ - parent_for_alias_dereference - if not None, an Element containing
+ the parent of elem, used to look for elements this is an alias of
+
+ Returns a list:
+
+ - first element - integer representation of the value, or None
+ if needsNum is False. The value must be a legal number
+ if needsNum is True.
+ - second element - string representation of the value
+
+ There are several possible representations of values.
+
+ - A 'value' attribute simply contains the value.
+ - A 'bitpos' attribute defines a value by specifying the bit
+ position which is set in that value.
+ - An 'offset','extbase','extends' triplet specifies a value
+ as an offset to a base value defined by the specified
+ 'extbase' extension name, which is then cast to the
+ typename specified by 'extends'. This requires probing
+ the registry database, and imbeds knowledge of the
+ API extension enum scheme in this function.
+ - An 'alias' attribute contains the name of another enum
+ which this is an alias of. The other enum must be
+ declared first when emitting this enum."""
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ if self.genOpts.conventions is None:
+ raise MissingGeneratorOptionsConventionsError()
+
+ name = elem.get('name')
+ numVal = None
+ if 'value' in elem.keys():
+ value = elem.get('value')
+ # print('About to translate value =', value, 'type =', type(value))
+ if needsNum:
+ numVal = int(value, 0)
+ # If there is a non-integer, numeric 'type' attribute (e.g. 'u' or
+ # 'ull'), append it to the string value.
+ # t = enuminfo.elem.get('type')
+ # if t is not None and t != '' and t != 'i' and t != 's':
+ # value += enuminfo.type
+ if forceSuffix:
+ if bitwidth == 64:
+ value = value + 'ULL'
+ else:
+ value = value + 'U'
+ self.logMsg('diag', 'Enum', name, '-> value [', numVal, ',', value, ']')
+ return [numVal, value]
+ if 'bitpos' in elem.keys():
+ value = elem.get('bitpos')
+ bitpos = int(value, 0)
+ numVal = 1 << bitpos
+ value = '0x%08x' % numVal
+ if bitwidth == 64 or bitpos >= 32:
+ value = value + 'ULL'
+ elif forceSuffix:
+ value = value + 'U'
+ self.logMsg('diag', 'Enum', name, '-> bitpos [', numVal, ',', value, ']')
+ return [numVal, value]
+ if 'offset' in elem.keys():
+ # Obtain values in the mapping from the attributes
+ enumNegative = False
+ offset = int(elem.get('offset'), 0)
+ extnumber = int(elem.get('extnumber'), 0)
+ extends = elem.get('extends')
+ if 'dir' in elem.keys():
+ enumNegative = True
+ self.logMsg('diag', 'Enum', name, 'offset =', offset,
+ 'extnumber =', extnumber, 'extends =', extends,
+ 'enumNegative =', enumNegative)
+ # Now determine the actual enumerant value, as defined
+ # in the "Layers and Extensions" appendix of the spec.
+ numVal = self.extBase + (extnumber - 1) * self.extBlockSize + offset
+ if enumNegative:
+ numVal *= -1
+ value = '%d' % numVal
+ # More logic needed!
+ self.logMsg('diag', 'Enum', name, '-> offset [', numVal, ',', value, ']')
+ return [numVal, value]
+ if 'alias' in elem.keys():
+ alias_of = elem.get('alias')
+ if parent_for_alias_dereference is None:
+ return (None, alias_of)
+ siblings = parent_for_alias_dereference.findall('enum')
+ for sib in siblings:
+ sib_name = sib.get('name')
+ if sib_name == alias_of:
+ return self.enumToValue(sib, needsNum)
+ raise RuntimeError("Could not find the aliased enum value")
+ return [None, None]
+
+ def checkDuplicateEnums(self, enums):
+ """Check enumerated values for duplicates.
+
+ - enums - list of `<enum>` Elements
+
+ returns the list with duplicates stripped"""
+ # Dictionaries indexed by name and numeric value.
+ # Entries are [ Element, numVal, strVal ] matching name or value
+
+ nameMap = {}
+ valueMap = {}
+
+ stripped = []
+ for elem in enums:
+ name = elem.get('name')
+ (numVal, strVal) = self.enumToValue(elem, True)
+
+ if name in nameMap:
+ # Duplicate name found; check values
+ (name2, numVal2, strVal2) = nameMap[name]
+
+ # Duplicate enum values for the same name are benign. This
+ # happens when defining the same enum conditionally in
+ # several extension blocks.
+ if (strVal2 == strVal or (numVal is not None
+ and numVal == numVal2)):
+ True
+ # self.logMsg('info', 'checkDuplicateEnums: Duplicate enum (' + name +
+ # ') found with the same value:' + strVal)
+ else:
+ self.logMsg('warn', 'checkDuplicateEnums: Duplicate enum (' + name
+ + ') found with different values:' + strVal
+ + ' and ' + strVal2)
+
+ # Do not add the duplicate to the returned list
+ continue
+ elif numVal in valueMap:
+ # Duplicate value found (such as an alias); report it, but
+ # still add this enum to the list.
+ (name2, numVal2, strVal2) = valueMap[numVal]
+
+ msg = 'Two enums found with the same value: {} = {} = {}'.format(
+ name, name2.get('name'), strVal)
+ self.logMsg('error', msg)
+
+ # Track this enum to detect followon duplicates
+ nameMap[name] = [elem, numVal, strVal]
+ if numVal is not None:
+ valueMap[numVal] = [elem, numVal, strVal]
+
+ # Add this enum to the list
+ stripped.append(elem)
+
+ # Return the list
+ return stripped
+
+ def misracstyle(self):
+ return False;
+
+ def misracppstyle(self):
+ return False;
+
+ def buildEnumCDecl(self, expand, groupinfo, groupName):
+ """Generate the C declaration for an enum"""
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ if self.genOpts.conventions is None:
+ raise MissingGeneratorOptionsConventionsError()
+
+ groupElem = groupinfo.elem
+
+ # Determine the required bit width for the enum group.
+ # 32 is the default, which generates C enum types for the values.
+ bitwidth = 32
+
+ # If the constFlagBits preference is set, 64 is the default for bitmasks
+ if self.genOpts.conventions.constFlagBits and groupElem.get('type') == 'bitmask':
+ bitwidth = 64
+
+ # Check for an explicitly defined bitwidth, which will override any defaults.
+ if groupElem.get('bitwidth'):
+ try:
+ bitwidth = int(groupElem.get('bitwidth'))
+ except ValueError as ve:
+ self.logMsg('error', 'Invalid value for bitwidth attribute (', groupElem.get('bitwidth'), ') for ', groupName, ' - must be an integer value\n')
+ exit(1)
+
+ usebitmask = False
+ usedefine = False
+
+ # Bitmask flags can be generated as either "static const uint{32,64}_t" values,
+ # or as 32-bit C enums. 64-bit types must use uint64_t values.
+ if groupElem.get('type') == 'bitmask':
+ if bitwidth > 32 or self.misracppstyle():
+ usebitmask = True
+ if self.misracstyle():
+ usedefine = True
+
+ if usedefine or usebitmask:
+ # Validate the bitwidth and generate values appropriately
+ if bitwidth > 64:
+ self.logMsg('error', 'Invalid value for bitwidth attribute (', groupElem.get('bitwidth'), ') for bitmask type ', groupName, ' - must be less than or equal to 64\n')
+ exit(1)
+ else:
+ return self.buildEnumCDecl_BitmaskOrDefine(groupinfo, groupName, bitwidth, usedefine)
+ else:
+ # Validate the bitwidth and generate values appropriately
+ if bitwidth > 32:
+ self.logMsg('error', 'Invalid value for bitwidth attribute (', groupElem.get('bitwidth'), ') for enum type ', groupName, ' - must be less than or equal to 32\n')
+ exit(1)
+ else:
+ return self.buildEnumCDecl_Enum(expand, groupinfo, groupName)
+
+ def buildEnumCDecl_BitmaskOrDefine(self, groupinfo, groupName, bitwidth, usedefine):
+ """Generate the C declaration for an "enum" that is actually a
+ set of flag bits"""
+ groupElem = groupinfo.elem
+ flagTypeName = groupElem.get('name')
+
+ # Prefix
+ body = "// Flag bits for " + flagTypeName + "\n"
+
+ if bitwidth == 64:
+ body += "typedef VkFlags64 %s;\n" % flagTypeName;
+ else:
+ body += "typedef VkFlags %s;\n" % flagTypeName;
+
+ # Maximum allowable value for a flag (unsigned 64-bit integer)
+ maxValidValue = 2**(64) - 1
+ minValidValue = 0
+
+ # Get a list of nested 'enum' tags.
+ enums = groupElem.findall('enum')
+
+ # Check for and report duplicates, and return a list with them
+ # removed.
+ enums = self.checkDuplicateEnums(enums)
+
+ # Accumulate non-numeric enumerant values separately and append
+ # them following the numeric values, to allow for aliases.
+ # NOTE: this does not do a topological sort yet, so aliases of
+ # aliases can still get in the wrong order.
+ aliasText = ''
+
+ # Loop over the nested 'enum' tags.
+ for elem in enums:
+ # Convert the value to an integer and use that to track min/max.
+ # Values of form -(number) are accepted but nothing more complex.
+ # Should catch exceptions here for more complex constructs. Not yet.
+ (numVal, strVal) = self.enumToValue(elem, True, bitwidth, True)
+ name = elem.get('name')
+
+ # Range check for the enum value
+ if numVal is not None and (numVal > maxValidValue or numVal < minValidValue):
+ self.logMsg('error', 'Allowable range for flag types in C is [', minValidValue, ',', maxValidValue, '], but', name, 'flag has a value outside of this (', strVal, ')\n')
+ exit(1)
+
+ decl = self.genRequirements(name, mustBeFound = False)
+
+ if self.isEnumRequired(elem):
+ protect = elem.get('protect')
+ if protect is not None:
+ body += '#ifdef {}\n'.format(protect)
+
+ if usedefine:
+ decl += "#define {} {}\n".format(name, strVal)
+ elif self.misracppstyle():
+ decl += "static constexpr {} {} {{{}}};\n".format(flagTypeName, name, strVal)
+ else:
+ # Some C compilers only allow initializing a 'static const' variable with a literal value.
+ # So initializing an alias from another 'static const' value would fail to compile.
+ # Work around this by chasing the aliases to get the actual value.
+ while numVal is None:
+ alias = self.registry.tree.find("enums/enum[@name='" + strVal + "']")
+ if alias is not None:
+ (numVal, strVal) = self.enumToValue(alias, True, bitwidth, True)
+ else:
+ self.logMsg('error', 'No such alias {} for enum {}'.format(strVal, name))
+ decl += "static const {} {} = {};\n".format(flagTypeName, name, strVal)
+
+ if numVal is not None:
+ body += decl
+ else:
+ aliasText += decl
+
+ if protect is not None:
+ body += '#endif\n'
+
+ # Now append the non-numeric enumerant values
+ body += aliasText
+
+ # Postfix
+
+ return ("bitmask", body)
+
+ def buildEnumCDecl_Enum(self, expand, groupinfo, groupName):
+ """Generate the C declaration for an enumerated type"""
+ groupElem = groupinfo.elem
+
+ # Break the group name into prefix and suffix portions for range
+ # enum generation
+ expandName = re.sub(r'([0-9]+|[a-z_])([A-Z0-9])', r'\1_\2', groupName).upper()
+ expandPrefix = expandName
+ expandSuffix = ''
+ expandSuffixMatch = re.search(r'[A-Z][A-Z]+$', groupName)
+ if expandSuffixMatch:
+ expandSuffix = '_' + expandSuffixMatch.group()
+ # Strip off the suffix from the prefix
+ expandPrefix = expandName.rsplit(expandSuffix, 1)[0]
+
+ # Prefix
+ body = ["typedef enum %s {" % groupName]
+
+ # @@ Should use the type="bitmask" attribute instead
+ isEnum = ('FLAG_BITS' not in expandPrefix)
+
+ # Allowable range for a C enum - which is that of a signed 32-bit integer
+ maxValidValue = 2**(32 - 1) - 1
+ minValidValue = (maxValidValue * -1) - 1
+
+ # Get a list of nested 'enum' tags.
+ enums = groupElem.findall('enum')
+
+ # Check for and report duplicates, and return a list with them
+ # removed.
+ enums = self.checkDuplicateEnums(enums)
+
+ # Loop over the nested 'enum' tags. Keep track of the minimum and
+ # maximum numeric values, if they can be determined; but only for
+ # core API enumerants, not extension enumerants. This is inferred
+ # by looking for 'extends' attributes.
+ minName = None
+
+ # Accumulate non-numeric enumerant values separately and append
+ # them following the numeric values, to allow for aliases.
+ # NOTE: this does not do a topological sort yet, so aliases of
+ # aliases can still get in the wrong order.
+ aliasText = []
+
+ maxName = None
+ minValue = None
+ maxValue = None
+ for elem in enums:
+ # Convert the value to an integer and use that to track min/max.
+ # Values of form -(number) are accepted but nothing more complex.
+ # Should catch exceptions here for more complex constructs. Not yet.
+ (numVal, strVal) = self.enumToValue(elem, True)
+ name = elem.get('name')
+
+ # Extension enumerants are only included if they are required
+ if self.isEnumRequired(elem):
+ decl = ''
+
+ protect = elem.get('protect')
+ if protect is not None:
+ decl += '#ifdef {}\n'.format(protect)
+
+ # Indent requirements comment, if there is one
+ requirements = self.genRequirements(name, mustBeFound = False)
+ if requirements != '':
+ requirements = ' ' + requirements
+ decl += requirements
+ decl += ' {} = {},'.format(name, strVal)
+
+ if protect is not None:
+ decl += '\n#endif'
+
+ if numVal is not None:
+ body.append(decl)
+ else:
+ aliasText.append(decl)
+
+ # Range check for the enum value
+ if numVal is not None and (numVal > maxValidValue or numVal < minValidValue):
+ self.logMsg('error', 'Allowable range for C enum types is [', minValidValue, ',', maxValidValue, '], but', name, 'has a value outside of this (', strVal, ')\n')
+ exit(1)
+
+ # Do not track min/max for non-numbers (numVal is None)
+ if isEnum and numVal is not None and elem.get('extends') is None:
+ if minName is None:
+ minName = maxName = name
+ minValue = maxValue = numVal
+ elif minValue is None or numVal < minValue:
+ minName = name
+ minValue = numVal
+ elif maxValue is None or numVal > maxValue:
+ maxName = name
+ maxValue = numVal
+
+ # Now append the non-numeric enumerant values
+ body.extend(aliasText)
+
+ # Generate min/max value tokens - legacy use case.
+ if isEnum and expand:
+ body.extend((f' {expandPrefix}_BEGIN_RANGE{expandSuffix} = {minName},',
+ f' {expandPrefix}_END_RANGE{expandSuffix} = {maxName},',
+ f' {expandPrefix}_RANGE_SIZE{expandSuffix} = ({maxName} - {minName} + 1),'))
+
+ # Generate a range-padding value to ensure the enum is 32 bits, but
+ # only in code generators, so it does not appear in documentation
+ if (self.genOpts.codeGenerator or
+ self.conventions.generate_max_enum_in_docs):
+ body.append(f' {expandPrefix}_MAX_ENUM{expandSuffix} = 0x7FFFFFFF')
+
+ # Postfix
+ body.append("} %s;" % groupName)
+
+ # Determine appropriate section for this declaration
+ if groupElem.get('type') == 'bitmask':
+ section = 'bitmask'
+ else:
+ section = 'group'
+
+ return (section, '\n'.join(body))
+
+ def buildConstantCDecl(self, enuminfo, name, alias):
+ """Generate the C declaration for a constant (a single <enum>
+ value).
+
+ <enum> tags may specify their values in several ways, but are
+ usually just integers or floating-point numbers."""
+
+ (_, strVal) = self.enumToValue(enuminfo.elem, False)
+
+ if self.misracppstyle() and enuminfo.elem.get('type') and not alias:
+ # Generate e.g.: static constexpr uint32_t x = ~static_cast<uint32_t>(1U);
+ # This appeases MISRA "underlying type" rules.
+ typeStr = enuminfo.elem.get('type');
+ invert = '~' in strVal
+ number = strVal.strip("()~UL")
+ if typeStr != "float":
+ number += 'U'
+ strVal = "~" if invert else ""
+ strVal += "static_cast<" + typeStr + ">(" + number + ")"
+ body = 'static constexpr ' + typeStr.ljust(9) + name.ljust(33) + ' {' + strVal + '};'
+ elif enuminfo.elem.get('type') and not alias:
+ # Generate e.g.: #define x (~0ULL)
+ typeStr = enuminfo.elem.get('type');
+ invert = '~' in strVal
+ paren = '(' in strVal
+ number = strVal.strip("()~UL")
+ if typeStr != "float":
+ if typeStr == "uint64_t":
+ number += 'ULL'
+ else:
+ number += 'U'
+ strVal = "~" if invert else ""
+ strVal += number
+ if paren:
+ strVal = "(" + strVal + ")";
+ body = '#define ' + name.ljust(33) + ' ' + strVal;
+ else:
+ body = '#define ' + name.ljust(33) + ' ' + strVal
+
+ return body
+
+ def makeDir(self, path):
+ """Create a directory, if not already done.
+
+ Generally called from derived generators creating hierarchies."""
+ self.logMsg('diag', 'OutputGenerator::makeDir(' + path + ')')
+ if path not in self.madeDirs:
+ # This can get race conditions with multiple writers, see
+ # https://stackoverflow.com/questions/273192/
+ if not os.path.exists(path):
+ os.makedirs(path)
+ self.madeDirs[path] = None
+
+ def beginFile(self, genOpts):
+ """Start a new interface file
+
+ - genOpts - GeneratorOptions controlling what is generated and how"""
+
+ self.genOpts = genOpts
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ if self.genOpts.conventions is None:
+ raise MissingGeneratorOptionsConventionsError()
+ self.should_insert_may_alias_macro = \
+ self.genOpts.conventions.should_insert_may_alias_macro(self.genOpts)
+ self.file_suffix = self.genOpts.conventions.file_suffix
+
+ # Try to import the API dictionary, apimap.py, if it exists. Nothing
+ # in apimap.py cannot be extracted directly from the XML, and in the
+ # future we should do that.
+ if self.genOpts.genpath is not None:
+ try:
+ sys.path.insert(0, self.genOpts.genpath)
+ import apimap
+ self.apidict = apimap
+ except ImportError:
+ self.apidict = None
+
+ self.conventions = genOpts.conventions
+
+ # Open a temporary file for accumulating output.
+ if self.genOpts.filename is not None:
+ self.outFile = tempfile.NamedTemporaryFile(mode='w', encoding='utf-8', newline='\n', delete=False)
+ else:
+ self.outFile = sys.stdout
+
+ def endFile(self):
+ if self.errFile:
+ self.errFile.flush()
+ if self.warnFile:
+ self.warnFile.flush()
+ if self.diagFile:
+ self.diagFile.flush()
+ if self.outFile:
+ self.outFile.flush()
+ if self.outFile != sys.stdout and self.outFile != sys.stderr:
+ self.outFile.close()
+
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+
+ # On successfully generating output, move the temporary file to the
+ # target file.
+ if self.genOpts.filename is not None:
+ if sys.platform == 'win32':
+ directory = Path(self.genOpts.directory)
+ if not Path.exists(directory):
+ os.makedirs(directory)
+ shutil.copy(self.outFile.name, self.genOpts.directory + '/' + self.genOpts.filename)
+ os.remove(self.outFile.name)
+ self.genOpts = None
+
+ def beginFeature(self, interface, emit):
+ """Write interface for a feature and tag generated features as having been done.
+
+ - interface - element for the `<version>` / `<extension>` to generate
+ - emit - actually write to the header only when True"""
+ self.emit = emit
+ self.featureName = interface.get('name')
+ self.featureType = interface.get('type')
+ # If there is an additional 'protect' attribute in the feature, save it
+ self.featureExtraProtect = interface.get('protect')
+
+ def endFeature(self):
+ """Finish an interface file, closing it when done.
+
+ Derived classes responsible for emitting feature"""
+ self.featureName = None
+ self.featureType = None
+ self.featureExtraProtect = None
+
+ def genRequirements(self, name, mustBeFound = True):
+ """Generate text showing what core versions and extensions introduce
+ an API. This exists in the base Generator class because it is used by
+ the shared enumerant-generating interfaces (buildEnumCDecl, etc.).
+ Here it returns an empty string for most generators, but can be
+ overridden by e.g. DocGenerator.
+
+ - name - name of the API
+ - mustBeFound - If True, when requirements for 'name' cannot be
+ determined, a warning comment is generated.
+ """
+
+ return ''
+
+ def validateFeature(self, featureType, featureName):
+ """Validate we are generating something only inside a `<feature>` tag"""
+ if self.featureName is None:
+ raise UserWarning('Attempt to generate', featureType,
+ featureName, 'when not in feature')
+
+ def genType(self, typeinfo, name, alias):
+ """Generate interface for a type
+
+ - typeinfo - TypeInfo for a type
+
+ Extend to generate as desired in your derived class."""
+ self.validateFeature('type', name)
+
+ def genStruct(self, typeinfo, typeName, alias):
+ """Generate interface for a C "struct" type.
+
+ - typeinfo - TypeInfo for a type interpreted as a struct
+
+ Extend to generate as desired in your derived class."""
+ self.validateFeature('struct', typeName)
+
+ # The mixed-mode <member> tags may contain no-op <comment> tags.
+ # It is convenient to remove them here where all output generators
+ # will benefit.
+ for member in typeinfo.elem.findall('.//member'):
+ for comment in member.findall('comment'):
+ member.remove(comment)
+
+ def genGroup(self, groupinfo, groupName, alias):
+ """Generate interface for a group of enums (C "enum")
+
+ - groupinfo - GroupInfo for a group.
+
+ Extend to generate as desired in your derived class."""
+
+ self.validateFeature('group', groupName)
+
+ def genEnum(self, enuminfo, typeName, alias):
+ """Generate interface for an enum (constant).
+
+ - enuminfo - EnumInfo for an enum
+ - name - enum name
+
+ Extend to generate as desired in your derived class."""
+ self.validateFeature('enum', typeName)
+
+ def genCmd(self, cmd, cmdinfo, alias):
+ """Generate interface for a command.
+
+ - cmdinfo - CmdInfo for a command
+
+ Extend to generate as desired in your derived class."""
+ self.validateFeature('command', cmdinfo)
+
+ def genSpirv(self, spirv, spirvinfo, alias):
+ """Generate interface for a spirv element.
+
+ - spirvinfo - SpirvInfo for a command
+
+ Extend to generate as desired in your derived class."""
+ return
+
+ def genFormat(self, format, formatinfo, alias):
+ """Generate interface for a format element.
+
+ - formatinfo - FormatInfo
+
+ Extend to generate as desired in your derived class."""
+ return
+
+ def genSyncStage(self, stageinfo):
+ """Generate interface for a sync stage element.
+
+ - stageinfo - SyncStageInfo
+
+ Extend to generate as desired in your derived class."""
+ return
+
+ def genSyncAccess(self, accessinfo):
+ """Generate interface for a sync stage element.
+
+ - accessinfo - AccessInfo
+
+ Extend to generate as desired in your derived class."""
+ return
+
+ def genSyncPipeline(self, pipelineinfo):
+ """Generate interface for a sync stage element.
+
+ - pipelineinfo - SyncPipelineInfo
+
+ Extend to generate as desired in your derived class."""
+ return
+
+ def makeProtoName(self, name, tail):
+ """Turn a `<proto>` `<name>` into C-language prototype
+ and typedef declarations for that name.
+
+ - name - contents of `<name>` tag
+ - tail - whatever text follows that tag in the Element"""
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ return self.genOpts.apientry + name + tail
+
+ def makeTypedefName(self, name, tail):
+ """Make the function-pointer typedef name for a command."""
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ return '(' + self.genOpts.apientryp + 'PFN_' + name + tail + ')'
+
+ def makeCParamDecl(self, param, aligncol):
+ """Return a string which is an indented, formatted
+ declaration for a `<param>` or `<member>` block (e.g. function parameter
+ or structure/union member).
+
+ - param - Element (`<param>` or `<member>`) to format
+ - aligncol - if non-zero, attempt to align the nested `<name>` element
+ at this column"""
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ if self.genOpts.conventions is None:
+ raise MissingGeneratorOptionsConventionsError()
+ indent = ' '
+ paramdecl = indent
+ prefix = noneStr(param.text)
+
+ for elem in param:
+ text = noneStr(elem.text)
+ tail = noneStr(elem.tail)
+
+ if self.should_insert_may_alias_macro and self.genOpts.conventions.is_voidpointer_alias(elem.tag, text, tail):
+ # OpenXR-specific macro insertion - but not in apiinc for the spec
+ tail = self.genOpts.conventions.make_voidpointer_alias(tail)
+ if elem.tag == 'name' and aligncol > 0:
+ self.logMsg('diag', 'Aligning parameter', elem.text, 'to column', self.genOpts.alignFuncParam)
+ # Align at specified column, if possible
+ paramdecl = paramdecl.rstrip()
+ oldLen = len(paramdecl)
+ # This works around a problem where very long type names -
+ # longer than the alignment column - would run into the tail
+ # text.
+ paramdecl = paramdecl.ljust(aligncol - 1) + ' '
+ newLen = len(paramdecl)
+ self.logMsg('diag', 'Adjust length of parameter decl from', oldLen, 'to', newLen, ':', paramdecl)
+
+ if (self.misracppstyle() and prefix.find('const ') != -1):
+ # Change pointer type order from e.g. "const void *" to "void const *".
+ # If the string starts with 'const', reorder it to be after the first type.
+ paramdecl += prefix.replace('const ', '') + text + ' const' + tail
+ else:
+ paramdecl += prefix + text + tail
+
+ # Clear prefix for subsequent iterations
+ prefix = ''
+
+ paramdecl = paramdecl + prefix
+
+ if aligncol == 0:
+ # Squeeze out multiple spaces other than the indentation
+ paramdecl = indent + ' '.join(paramdecl.split())
+ return paramdecl
+
+ def getCParamTypeLength(self, param):
+ """Return the length of the type field is an indented, formatted
+ declaration for a `<param>` or `<member>` block (e.g. function parameter
+ or structure/union member).
+
+ - param - Element (`<param>` or `<member>`) to identify"""
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ if self.genOpts.conventions is None:
+ raise MissingGeneratorOptionsConventionsError()
+
+ # Allow for missing <name> tag
+ newLen = 0
+ paramdecl = ' ' + noneStr(param.text)
+ for elem in param:
+ text = noneStr(elem.text)
+ tail = noneStr(elem.tail)
+
+ if self.should_insert_may_alias_macro and self.genOpts.conventions.is_voidpointer_alias(elem.tag, text, tail):
+ # OpenXR-specific macro insertion
+ tail = self.genOpts.conventions.make_voidpointer_alias(tail)
+ if elem.tag == 'name':
+ # Align at specified column, if possible
+ newLen = len(paramdecl.rstrip())
+ self.logMsg('diag', 'Identifying length of', elem.text, 'as', newLen)
+ paramdecl += text + tail
+
+ return newLen
+
+ def getMaxCParamTypeLength(self, info):
+ """Return the length of the longest type field for a member/parameter.
+
+ - info - TypeInfo or CommandInfo.
+ """
+ lengths = (self.getCParamTypeLength(member)
+ for member in info.getMembers())
+ return max(lengths)
+
+ def getHandleParent(self, typename):
+ """Get the parent of a handle object."""
+ if self.registry is None:
+ raise MissingRegistryError()
+
+ info = self.registry.typedict.get(typename)
+ if info is None:
+ return None
+
+ elem = info.elem
+ if elem is not None:
+ return elem.get('parent')
+
+ return None
+
+ def iterateHandleAncestors(self, typename):
+ """Iterate through the ancestors of a handle type."""
+ current = self.getHandleParent(typename)
+ while current is not None:
+ yield current
+ current = self.getHandleParent(current)
+
+ def getHandleAncestors(self, typename):
+ """Get the ancestors of a handle object."""
+ return list(self.iterateHandleAncestors(typename))
+
+ def getTypeCategory(self, typename):
+ """Get the category of a type."""
+ if self.registry is None:
+ raise MissingRegistryError()
+
+ info = self.registry.typedict.get(typename)
+ if info is None:
+ return None
+
+ elem = info.elem
+ if elem is not None:
+ return elem.get('category')
+ return None
+
+ def isStructAlwaysValid(self, structname):
+ """Try to do check if a structure is always considered valid (i.e. there is no rules to its acceptance)."""
+ # A conventions object is required for this call.
+ if not self.conventions:
+ raise RuntimeError("To use isStructAlwaysValid, be sure your options include a Conventions object.")
+ if self.registry is None:
+ raise MissingRegistryError()
+
+ if self.conventions.type_always_valid(structname):
+ return True
+
+ category = self.getTypeCategory(structname)
+ if self.conventions.category_requires_validation(category):
+ return False
+
+ info = self.registry.typedict.get(structname)
+ if info is None:
+ self.logMsg('error', f'isStructAlwaysValid({structname}) - structure not found in typedict')
+
+ members = info.getMembers()
+
+ for member in members:
+ member_name = getElemName(member)
+ if member_name in (self.conventions.structtype_member_name,
+ self.conventions.nextpointer_member_name):
+ return False
+
+ if member.get('noautovalidity'):
+ return False
+
+ member_type = getElemType(member)
+
+ if member_type in ('void', 'char') or self.paramIsArray(member) or self.paramIsPointer(member):
+ return False
+
+ if self.conventions.type_always_valid(member_type):
+ continue
+
+ member_category = self.getTypeCategory(member_type)
+
+ if self.conventions.category_requires_validation(member_category):
+ return False
+
+ if member_category in ('struct', 'union'):
+ if self.isStructAlwaysValid(member_type) is False:
+ return False
+
+ return True
+
+ def paramIsArray(self, param):
+ """Check if the parameter passed in is a pointer to an array.
+
+ param the XML information for the param
+ """
+ return param.get('len') is not None
+
+ def paramIsPointer(self, param):
+ """Check if the parameter passed in is a pointer.
+
+ param the XML information for the param
+ """
+ tail = param.find('type').tail
+ return tail is not None and '*' in tail
+
+ def isEnumRequired(self, elem):
+ """Return True if this `<enum>` element is
+ required, False otherwise
+
+ - elem - `<enum>` element to test"""
+ required = elem.get('required') is not None
+ self.logMsg('diag', 'isEnumRequired:', elem.get('name'),
+ '->', required)
+ return required
+
+ # @@@ This code is overridden by equivalent code now run in
+ # @@@ Registry.generateFeature
+
+ required = False
+
+ extname = elem.get('extname')
+ if extname is not None:
+ # 'supported' attribute was injected when the <enum> element was
+ # moved into the <enums> group in Registry.parseTree()
+ if self.genOpts.defaultExtensions == elem.get('supported'):
+ required = True
+ elif re.match(self.genOpts.addExtensions, extname) is not None:
+ required = True
+ elif elem.get('version') is not None:
+ required = re.match(self.genOpts.emitversions, elem.get('version')) is not None
+ else:
+ required = True
+
+ return required
+
+ def makeCDecls(self, cmd):
+ """Return C prototype and function pointer typedef for a
+ `<command>` Element, as a two-element list of strings.
+
+ - cmd - Element containing a `<command>` tag"""
+ if self.genOpts is None:
+ raise MissingGeneratorOptionsError()
+ proto = cmd.find('proto')
+ params = cmd.findall('param')
+ # Begin accumulating prototype and typedef strings
+ pdecl = self.genOpts.apicall
+ tdecl = 'typedef '
+
+ # Insert the function return type/name.
+ # For prototypes, add APIENTRY macro before the name
+ # For typedefs, add (APIENTRY *<name>) around the name and
+ # use the PFN_cmdnameproc naming convention.
+ # Done by walking the tree for <proto> element by element.
+ # etree has elem.text followed by (elem[i], elem[i].tail)
+ # for each child element and any following text
+ # Leading text
+ pdecl += noneStr(proto.text)
+ tdecl += noneStr(proto.text)
+ # For each child element, if it is a <name> wrap in appropriate
+ # declaration. Otherwise append its contents and tail contents.
+ for elem in proto:
+ text = noneStr(elem.text)
+ tail = noneStr(elem.tail)
+ if elem.tag == 'name':
+ pdecl += self.makeProtoName(text, tail)
+ tdecl += self.makeTypedefName(text, tail)
+ else:
+ pdecl += text + tail
+ tdecl += text + tail
+
+ if self.genOpts.alignFuncParam == 0:
+ # Squeeze out multiple spaces - there is no indentation
+ pdecl = ' '.join(pdecl.split())
+ tdecl = ' '.join(tdecl.split())
+
+ # Now add the parameter declaration list, which is identical
+ # for prototypes and typedefs. Concatenate all the text from
+ # a <param> node without the tags. No tree walking required
+ # since all tags are ignored.
+ # Uses: self.indentFuncProto
+ # self.indentFuncPointer
+ # self.alignFuncParam
+ n = len(params)
+ # Indented parameters
+ if n > 0:
+ indentdecl = '(\n'
+ indentdecl += ',\n'.join(self.makeCParamDecl(p, self.genOpts.alignFuncParam)
+ for p in params)
+ indentdecl += ');'
+ else:
+ indentdecl = '(void);'
+ # Non-indented parameters
+ paramdecl = '('
+ if n > 0:
+ paramnames = []
+ if self.misracppstyle():
+ for p in params:
+ param = ''
+ firstIter = True;
+ for t in p.itertext():
+ if (firstIter):
+ prefix = t
+ firstIter = False
+ else:
+ # Change pointer type order from e.g. "const void *" to "void const *".
+ # If the string starts with 'const', reorder it to be after the first type.
+ if (prefix.find('const ') != -1):
+ param += prefix.replace('const ', '') + t + ' const '
+ else:
+ param += prefix + t
+ # Clear prefix for subsequent iterations
+ prefix = ''
+ paramnames.append(param);
+ else:
+ paramnames = (''.join(t for t in p.itertext())
+ for p in params)
+ paramdecl += ', '.join(paramnames)
+ else:
+ paramdecl += 'void'
+ paramdecl += ");"
+ return [pdecl + indentdecl, tdecl + paramdecl]
+
+ def newline(self):
+ """Print a newline to the output file (utility function)"""
+ write('', file=self.outFile)
+
+ def setRegistry(self, registry):
+ self.registry = registry
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genspec.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genspec.py
new file mode 100644
index 00000000000..88224494403
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genspec.py
@@ -0,0 +1,164 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+"""This script builds a full release package including XHTML and PDF
+versions of the specification, including an optional list of
+extensions. Other files in the release directory are removed,
+including man pages, XHTML chunked, HTML, validity output, etc.
+
+The current branch must be fully committed and up to date when the
+script is run, with no outstanding un-added / un-committed files.
+After completing the build, suggestions for creating tags are made."""
+
+import time
+from datetime import date, timedelta
+
+
+def releaseNum():
+ """Return the Vulkan release number, used for tags."""
+ return '$REVISION'
+
+
+def buildOnFriday():
+ """Return a date for the current, or upcoming if not already, Friday,
+ which is when releases happen."""
+ today = date.today()
+ friday = today + timedelta((4 - today.weekday()) % 7)
+ return friday
+
+
+def buildRelease(label,
+ versions,
+ extensions,
+ ratified,
+ outdir,
+ apititle,
+ xmlDir, xmlTargets,
+ specDir, specTargets,
+ miscSrc=None, miscDst=None, needRefSources=False):
+ """Build a release.
+
+ - `label` = textual label to use for target being generated
+ - `versions` = list of core API versions to include
+ - `extensions` = list of extension names to include
+ - `ratified` = True if this is a ratified spec (one built without non-KHR extensions)
+ - `outdir` = directory to generate specs in
+ - `apititle` = extra title to apply to the specification
+ - `xmlDir` = directory containing registry XML
+ - `xmlTargets` = targets to build in xml/
+ - `specDir` = directory containing spec source & Makefile
+ - `specTargets` = targets to build
+ - `miscSrc` = path to copy misc files from, if non-None
+ - `miscDst` = path to copy misc files to, if non-None
+ - `needRefSources` = True if ref pages must be extracted from the spec sources"""
+
+ print('echo Info: Generating target=' + label,
+ 'outdir=' + outdir)
+
+ outarg = 'OUTDIR=' + outdir
+
+ if versions != None and len(versions) > 0:
+ versarg = 'VERSIONS="' + ' '.join(versions) + '"'
+ else:
+ versarg = ''
+
+ if extensions != None and len(extensions) > 0:
+ extarg = 'EXTENSIONS="' + ' '.join(extensions) + '"'
+ else:
+ extarg = ''
+
+ if ratified:
+ ratifiedarg = 'EXTRAATTRIBS="-a ratified_core_spec"'
+ else:
+ ratifiedarg = ''
+
+ if apititle != None:
+ titlearg = 'APITITLE="' + apititle + '"'
+ else:
+ titlearg = ''
+
+ # print('echo Info: Creating directory and cleaning spec in', outdir)
+ print('mkdir -p', outdir)
+ print('(cd ', outdir, '&& rm -rf',
+ 'html chunked pdf',
+ 'man config checks',
+ 'vkspec.html styleguide.html apispec.html apispec.pdf registry.html',
+ ')')
+
+ if xmlTargets != '':
+ # print('echo Info: Generating headers and spec include files')
+ print('cd', xmlDir)
+ print('make', outarg, xmlTargets)
+
+ # print('echo Info: Generating ref pages sources and spec targets')
+ print('cd', specDir)
+ print('make', outarg, 'clean')
+ # This is a temporary workaround for a dependency bug - if any of the
+ # specTargets require ref page sources, and they are not already present
+ # at the time the make is invoked, that target will not be built.
+ if needRefSources:
+ print('make', outarg, versarg, extarg, 'refpages')
+ # Now make the actual targets.
+ print('make -O -k -j 8',
+ outarg, versarg, extarg, ratifiedarg, titlearg,
+ 'NOTEOPTS="-a implementation-guide"',
+ specTargets)
+
+ if miscSrc != None and miscDst != None:
+ print('mkdir -p', miscDst)
+ print('cp', miscSrc + '/*.adoc', miscDst + '/')
+
+ print('')
+
+
+def buildBranch(targetDir = '',
+ versions = '',
+ extensions = '',
+ ratified = False,
+ apititle = '(NO TITLE SPECIFIED)',
+ xmlTargets = '',
+ specTargets = '',
+ repoDir = '',
+ outDir = '',
+ needRefSources=False):
+ """Build all target documents.
+
+ - `repoDir` = path to the Vulkan git repo containing the specs
+ - `outDir` = path to the output base directory in which targets are generated"""
+
+ # Directory with vk.xml and generation tools
+ xmlDir = repoDir + '/xml'
+ # Directory with spec sources
+ specDir = repoDir
+ # Directory containing misc. files to copy to registry.
+ # At present there are none, since GLSL extensions have moved to the
+ # GLSL repository and are redirected from the Vulkan registry website.
+ # These should be relative to repoDir and outDir, respectively
+ miscSrc = None
+ miscDst = None
+
+ buildRelease(targetDir,
+ versions,
+ extensions,
+ ratified,
+ outDir + '/' + targetDir,
+ apititle,
+ xmlDir, xmlTargets,
+ specDir, specTargets,
+ miscSrc, miscDst,
+ needRefSources)
+
+
+def createTags(releaseNum, tagdate):
+ """Print commands to tag the git branches.
+
+ - `releaseNum` = release number of this spec update, to tag the tree with
+ - `tagdate` = date (used to be used to tag the tree with)"""
+ # Tag date in YYYYMMDD format
+ now = tagdate.strftime('%Y%m%d')
+
+ print('echo To tag the spec branch for this release, execute the command:')
+ print('echo git tag -a -m \\"Tag Vulkan API specification for 1.3.' +
+ releaseNum, 'release\\"', 'v1.3.' + releaseNum)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genvk.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genvk.py
new file mode 100755
index 00000000000..d4c1ab64d53
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/genvk.py
@@ -0,0 +1,1240 @@
+#!/usr/bin/python3
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import argparse
+import os
+import pdb
+import re
+import sys
+import copy
+import time
+import xml.etree.ElementTree as etree
+
+sys.path.append(os.path.abspath(os.path.dirname(__file__)))
+
+from cgenerator import CGeneratorOptions, COutputGenerator
+# Vulkan SC modules
+from json_parser import JSONParserGenerator, JSONParserOptions
+from schema_generator import SchemaGeneratorOptions, SchemaOutputGenerator
+from json_generator import JSONGeneratorOptions, JSONOutputGenerator
+from json_h_generator import JSONHeaderOutputGenerator, JSONHeaderGeneratorOptions
+from json_c_generator import JSONCOutputGenerator, JSONCGeneratorOptions
+
+from docgenerator import DocGeneratorOptions, DocOutputGenerator
+from extensionmetadocgenerator import (ExtensionMetaDocGeneratorOptions,
+ ExtensionMetaDocOutputGenerator)
+from interfacedocgenerator import InterfaceDocGenerator
+from generator import write
+from spirvcapgenerator import SpirvCapabilityOutputGenerator
+from hostsyncgenerator import HostSynchronizationOutputGenerator
+from formatsgenerator import FormatsOutputGenerator
+from syncgenerator import SyncOutputGenerator
+from jsgenerator import JSOutputGenerator
+from pygenerator import PyOutputGenerator
+from rubygenerator import RubyOutputGenerator
+from reflib import logDiag, logWarn, logErr, setLogFile
+from reg import Registry
+from validitygenerator import ValidityOutputGenerator
+from apiconventions import APIConventions
+
+# gfxstream + cereal modules
+from cerealgenerator import CerealGenerator
+
+# Simple timer functions
+startTime = None
+from typing import Optional
+
+def startTimer(timeit):
+ global startTime
+ if timeit:
+ startTime = time.process_time()
+
+
+def endTimer(timeit, msg):
+ global startTime
+ if timeit and startTime is not None:
+ endTime = time.process_time()
+ logDiag(msg, endTime - startTime)
+ startTime = None
+
+
+def makeREstring(strings, default=None, strings_are_regex=False):
+ """Turn a list of strings into a regexp string matching exactly those strings."""
+ if strings or default is None:
+ if not strings_are_regex:
+ strings = (re.escape(s) for s in strings)
+ return '^(' + '|'.join(strings) + ')$'
+ return default
+
+
+def makeGenOpts(args):
+ """Returns a directory of [ generator function, generator options ] indexed
+ by specified short names. The generator options incorporate the following
+ parameters:
+
+ args is an parsed argument object; see below for the fields that are used."""
+ global genOpts
+ genOpts = {}
+
+ # Default class of extensions to include, or None
+ defaultExtensions = args.defaultExtensions
+
+ # Additional extensions to include (list of extensions)
+ extensions = args.extension
+
+ # Extensions to remove (list of extensions)
+ removeExtensions = args.removeExtensions
+
+ # Extensions to emit (list of extensions)
+ emitExtensions = args.emitExtensions
+
+ # SPIR-V capabilities / features to emit (list of extensions & capabilities)
+ emitSpirv = args.emitSpirv
+
+ # Vulkan Formats to emit
+ emitFormats = args.emitFormats
+
+ # Features to include (list of features)
+ features = args.feature
+
+ # Whether to disable inclusion protect in headers
+ protect = args.protect
+
+ # Output target directory
+ directory = args.directory
+
+ # Path to generated files, particularly apimap.py
+ genpath = args.genpath
+
+ # Generate MISRA C-friendly headers
+ misracstyle = args.misracstyle;
+
+ # Generate MISRA C++-friendly headers
+ misracppstyle = args.misracppstyle;
+
+ # Descriptive names for various regexp patterns used to select
+ # versions and extensions
+ allFormats = allSpirv = allFeatures = allExtensions = r'.*'
+
+ # Turn lists of names/patterns into matching regular expressions
+ addExtensionsPat = makeREstring(extensions, None)
+ removeExtensionsPat = makeREstring(removeExtensions, None)
+ emitExtensionsPat = makeREstring(emitExtensions, allExtensions)
+ emitSpirvPat = makeREstring(emitSpirv, allSpirv)
+ emitFormatsPat = makeREstring(emitFormats, allFormats)
+ featuresPat = makeREstring(features, allFeatures)
+
+ # Copyright text prefixing all headers (list of strings).
+ # The SPDX formatting below works around constraints of the 'reuse' tool
+ prefixStrings = [
+ '/*',
+ '** Copyright 2015-2023 The Khronos Group Inc.',
+ '**',
+ '** SPDX-License-Identifier' + ': Apache-2.0',
+ '*/',
+ ''
+ ]
+
+ # Text specific to Vulkan headers
+ vkPrefixStrings = [
+ '/*',
+ '** This header is generated from the Khronos Vulkan XML API Registry.',
+ '**',
+ '*/',
+ ''
+ ]
+
+ vulkanLayer = args.vulkanLayer
+
+ # Defaults for generating re-inclusion protection wrappers (or not)
+ protectFile = protect
+
+ # An API style conventions object
+ conventions = APIConventions()
+
+ if args.apiname is not None:
+ defaultAPIName = args.apiname
+ else:
+ defaultAPIName = conventions.xml_api_name
+
+ # APIs to merge
+ mergeApiNames = args.mergeApiNames
+
+ isCTS = args.isCTS
+
+ # API include files for spec and ref pages
+ # Overwrites include subdirectories in spec source tree
+ # The generated include files do not include the calling convention
+ # macros (apientry etc.), unlike the header files.
+ # Because the 1.0 core branch includes ref pages for extensions,
+ # all the extension interfaces need to be generated, even though
+ # none are used by the core spec itself.
+ genOpts['apiinc'] = [
+ DocOutputGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'timeMarker',
+ directory = directory,
+ genpath = genpath,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ apicall = '',
+ apientry = '',
+ apientryp = '*',
+ alignFuncParam = 48,
+ expandEnumerants = False)
+ ]
+
+ # JavaScript, Python, and Ruby representations of API information, used
+ # by scripts that do not need to load the full XML.
+ genOpts['apimap.cjs'] = [
+ JSOutputGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'apimap.cjs',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ reparentEnums = False)
+ ]
+
+ genOpts['apimap.py'] = [
+ PyOutputGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'apimap.py',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ reparentEnums = False)
+ ]
+
+ genOpts['apimap.rb'] = [
+ RubyOutputGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'apimap.rb',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ reparentEnums = False)
+ ]
+
+
+ # API validity files for spec
+ #
+ # requireCommandAliases is set to True because we need validity files
+ # for the command something is promoted to even when the promoted-to
+ # feature is not included. This avoids wordy includes of validity files.
+ genOpts['validinc'] = [
+ ValidityOutputGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'timeMarker',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ requireCommandAliases = True,
+ )
+ ]
+
+ # API host sync table files for spec
+ genOpts['hostsyncinc'] = [
+ HostSynchronizationOutputGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'timeMarker',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ reparentEnums = False)
+ ]
+
+ # Extension metainformation for spec extension appendices
+ # Includes all extensions by default, but only so that the generated
+ # 'promoted_extensions_*' files refer to all extensions that were
+ # promoted to a core version.
+ genOpts['extinc'] = [
+ ExtensionMetaDocOutputGenerator,
+ ExtensionMetaDocGeneratorOptions(
+ conventions = conventions,
+ filename = 'timeMarker',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = None,
+ defaultExtensions = defaultExtensions,
+ addExtensions = addExtensionsPat,
+ removeExtensions = None,
+ emitExtensions = emitExtensionsPat)
+ ]
+
+ # Version and extension interface docs for version/extension appendices
+ # Includes all extensions by default.
+ genOpts['interfaceinc'] = [
+ InterfaceDocGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'timeMarker',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ reparentEnums = False)
+ ]
+
+ genOpts['spirvcapinc'] = [
+ SpirvCapabilityOutputGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'timeMarker',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ emitSpirv = emitSpirvPat,
+ reparentEnums = False)
+ ]
+
+ # Used to generate various format chapter tables
+ genOpts['formatsinc'] = [
+ FormatsOutputGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'timeMarker',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ emitFormats = emitFormatsPat,
+ reparentEnums = False)
+ ]
+
+ # Used to generate various synchronization chapter tables
+ genOpts['syncinc'] = [
+ SyncOutputGenerator,
+ DocGeneratorOptions(
+ conventions = conventions,
+ filename = 'timeMarker',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ reparentEnums = False)
+ ]
+
+ # Platform extensions, in their own header files
+ # Each element of the platforms[] array defines information for
+ # generating a single platform:
+ # [0] is the generated header file name
+ # [1] is the set of platform extensions to generate
+ # [2] is additional extensions whose interfaces should be considered,
+ # but suppressed in the output, to avoid duplicate definitions of
+ # dependent types like VkDisplayKHR and VkSurfaceKHR which come from
+ # non-platform extensions.
+
+ # Track all platform extensions, for exclusion from vulkan_core.h
+ allPlatformExtensions = []
+
+ # Extensions suppressed for all WSI platforms (WSI extensions required
+ # by all platforms)
+ commonSuppressExtensions = [ 'VK_KHR_display', 'VK_KHR_swapchain' ]
+
+ # Extensions required and suppressed for beta "platform". This can
+ # probably eventually be derived from the requires= attributes of
+ # the extension blocks.
+ betaRequireExtensions = [
+ 'VK_KHR_portability_subset',
+ 'VK_KHR_video_encode_queue',
+ 'VK_EXT_video_encode_h264',
+ 'VK_EXT_video_encode_h265',
+ 'VK_NV_displacement_micromap',
+ 'VK_AMDX_shader_enqueue',
+ ]
+
+ betaSuppressExtensions = [
+ 'VK_KHR_video_queue',
+ 'VK_EXT_opacity_micromap',
+ 'VK_KHR_pipeline_library',
+ ]
+
+ platforms = [
+ [ 'vulkan_android.h', [ 'VK_KHR_android_surface',
+ 'VK_ANDROID_external_memory_android_hardware_buffer',
+ 'VK_ANDROID_external_format_resolve'
+ ], commonSuppressExtensions +
+ [ 'VK_KHR_format_feature_flags2',
+ ] ],
+ [ 'vulkan_fuchsia.h', [ 'VK_FUCHSIA_imagepipe_surface',
+ 'VK_FUCHSIA_external_memory',
+ 'VK_FUCHSIA_external_semaphore',
+ 'VK_FUCHSIA_buffer_collection' ], commonSuppressExtensions ],
+ [ 'vulkan_ggp.h', [ 'VK_GGP_stream_descriptor_surface',
+ 'VK_GGP_frame_token' ], commonSuppressExtensions ],
+ [ 'vulkan_ios.h', [ 'VK_MVK_ios_surface' ], commonSuppressExtensions ],
+ [ 'vulkan_macos.h', [ 'VK_MVK_macos_surface' ], commonSuppressExtensions ],
+ [ 'vulkan_vi.h', [ 'VK_NN_vi_surface' ], commonSuppressExtensions ],
+ [ 'vulkan_wayland.h', [ 'VK_KHR_wayland_surface' ], commonSuppressExtensions ],
+ [ 'vulkan_win32.h', [ 'VK_.*_win32(|_.*)', 'VK_.*_winrt(|_.*)', 'VK_EXT_full_screen_exclusive' ],
+ commonSuppressExtensions +
+ [ 'VK_KHR_external_semaphore',
+ 'VK_KHR_external_memory_capabilities',
+ 'VK_KHR_external_fence',
+ 'VK_KHR_external_fence_capabilities',
+ 'VK_KHR_get_surface_capabilities2',
+ 'VK_NV_external_memory_capabilities',
+ ] ],
+ [ 'vulkan_xcb.h', [ 'VK_KHR_xcb_surface' ], commonSuppressExtensions ],
+ [ 'vulkan_xlib.h', [ 'VK_KHR_xlib_surface' ], commonSuppressExtensions ],
+ [ 'vulkan_directfb.h', [ 'VK_EXT_directfb_surface' ], commonSuppressExtensions ],
+ [ 'vulkan_xlib_xrandr.h', [ 'VK_EXT_acquire_xlib_display' ], commonSuppressExtensions ],
+ [ 'vulkan_metal.h', [ 'VK_EXT_metal_surface',
+ 'VK_EXT_metal_objects' ], commonSuppressExtensions ],
+ [ 'vulkan_screen.h', [ 'VK_QNX_screen_surface',
+ 'VK_QNX_external_memory_screen_buffer' ], commonSuppressExtensions ],
+ [ 'vulkan_sci.h', [ 'VK_NV_external_sci_sync',
+ 'VK_NV_external_sci_sync2',
+ 'VK_NV_external_memory_sci_buf'], commonSuppressExtensions ],
+ [ 'vulkan_beta.h', betaRequireExtensions, betaSuppressExtensions ],
+ ]
+
+ for platform in platforms:
+ headername = platform[0]
+
+ allPlatformExtensions += platform[1]
+
+ addPlatformExtensionsRE = makeREstring(
+ platform[1] + platform[2], strings_are_regex=True)
+ emitPlatformExtensionsRE = makeREstring(
+ platform[1], strings_are_regex=True)
+
+ opts = CGeneratorOptions(
+ conventions = conventions,
+ filename = headername,
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ mergeApiNames = mergeApiNames,
+ profile = None,
+ versions = featuresPat,
+ emitversions = None,
+ defaultExtensions = None,
+ addExtensions = addPlatformExtensionsRE,
+ removeExtensions = None,
+ emitExtensions = emitPlatformExtensionsRE,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48,
+ misracstyle = misracstyle,
+ misracppstyle = misracppstyle)
+
+ genOpts[headername] = [ COutputGenerator, opts ]
+
+ # Header for core API + extensions.
+ # To generate just the core API,
+ # change to 'defaultExtensions = None' below.
+ #
+ # By default this adds all enabled, non-platform extensions.
+ # It removes all platform extensions (from the platform headers options
+ # constructed above) as well as any explicitly specified removals.
+
+ removeExtensionsPat = makeREstring(
+ allPlatformExtensions + removeExtensions, None, strings_are_regex=True)
+
+ genOpts['vulkan_core.h'] = [
+ COutputGenerator,
+ CGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan_core.h',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ mergeApiNames = mergeApiNames,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = defaultExtensions,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48,
+ misracstyle = misracstyle,
+ misracppstyle = misracppstyle)
+ ]
+
+ # Vulkan versions to include for SC header - SC *removes* features from 1.0/1.1/1.2
+ scVersions = makeREstring(['VK_VERSION_1_0', 'VK_VERSION_1_1', 'VK_VERSION_1_2', 'VKSC_VERSION_1_0'])
+
+ genOpts['vulkan_sc_core.h'] = [
+ COutputGenerator,
+ CGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan_sc_core.h',
+ directory = directory,
+ apiname = 'vulkansc',
+ profile = None,
+ versions = scVersions,
+ emitversions = scVersions,
+ defaultExtensions = 'vulkansc',
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48,
+ misracstyle = misracstyle,
+ misracppstyle = misracppstyle)
+ ]
+
+ genOpts['vulkan_sc_core.hpp'] = [
+ COutputGenerator,
+ CGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan_sc_core.hpp',
+ directory = directory,
+ apiname = 'vulkansc',
+ profile = None,
+ versions = scVersions,
+ emitversions = scVersions,
+ defaultExtensions = 'vulkansc',
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48,
+ misracstyle = misracstyle,
+ misracppstyle = misracppstyle)
+ ]
+
+ genOpts['vk.json'] = [
+ SchemaOutputGenerator,
+ SchemaGeneratorOptions(
+ conventions = conventions,
+ filename = 'vk.json',
+ directory = directory,
+ apiname = 'vulkansc',
+ profile = None,
+ versions = scVersions,
+ emitversions = scVersions,
+ defaultExtensions = 'vulkansc',
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48)
+ ]
+
+ if vulkanLayer:
+ genOpts['vulkan_json_data.hpp'] = [
+ JSONOutputGenerator,
+ JSONGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan_json_data.hpp',
+ directory = directory,
+ apiname = 'vulkan',
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = None,
+ addExtensions = addExtensionsPat,
+ removeExtensions = None,
+ emitExtensions = None,
+ vulkanLayer = vulkanLayer,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48)
+ ]
+ else:
+ genOpts['vulkan_json_data.hpp'] = [
+ JSONOutputGenerator,
+ JSONGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan_json_data.hpp',
+ directory = directory,
+ apiname = 'vulkansc',
+ profile = None,
+ versions = scVersions,
+ emitversions = scVersions,
+ defaultExtensions = 'vulkansc',
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ vulkanLayer = vulkanLayer,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ isCTS = isCTS,
+ alignFuncParam = 48)
+ ]
+
+ # keep any relevant platform extensions for the following generators
+ # (needed for e.g. the vulkan_sci extensions)
+ explicitRemoveExtensionsPat = makeREstring(
+ removeExtensions, None, strings_are_regex=True)
+
+ # Raw C header file generator.
+ genOpts['vulkan_json_gen.h'] = [
+ JSONHeaderOutputGenerator,
+ JSONHeaderGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan_json_gen.h',
+ directory = directory,
+ apiname = 'vulkansc',
+ profile = None,
+ versions = scVersions,
+ emitversions = scVersions,
+ defaultExtensions = 'vulkansc',
+ addExtensions = addExtensionsPat,
+ removeExtensions = explicitRemoveExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48)
+ ]
+
+ # Raw C source file generator.
+ genOpts['vulkan_json_gen.c'] = [
+ JSONCOutputGenerator,
+ JSONCGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan_json_gen.c',
+ directory = directory,
+ apiname = 'vulkansc',
+ profile = None,
+ versions = scVersions,
+ emitversions = scVersions,
+ defaultExtensions = 'vulkansc',
+ addExtensions = addExtensionsPat,
+ removeExtensions = explicitRemoveExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48)
+ ]
+
+ genOpts['vulkan_json_parser.hpp'] = [
+ JSONParserGenerator,
+ JSONParserOptions(
+ conventions = conventions,
+ filename = 'vulkan_json_parser.hpp',
+ directory = directory,
+ apiname = 'vulkansc',
+ profile = None,
+ versions = scVersions,
+ emitversions = scVersions,
+ defaultExtensions = 'vulkansc',
+ addExtensions = addExtensionsPat,
+ removeExtensions = explicitRemoveExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ isCTS = isCTS,
+ alignFuncParam = 48)
+ ]
+
+ # Unused - vulkan10.h target.
+ # It is possible to generate a header with just the Vulkan 1.0 +
+ # extension interfaces defined, but since the promoted KHR extensions
+ # are now defined in terms of the 1.1 interfaces, such a header is very
+ # similar to vulkan_core.h.
+ genOpts['vulkan10.h'] = [
+ COutputGenerator,
+ CGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan10.h',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = 'VK_VERSION_1_0',
+ emitversions = 'VK_VERSION_1_0',
+ defaultExtensions = None,
+ addExtensions = None,
+ removeExtensions = None,
+ emitExtensions = None,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48,
+ misracstyle = misracstyle,
+ misracppstyle = misracppstyle)
+ ]
+
+ # Video header target - combines all video extension dependencies into a
+ # single header, at present.
+ genOpts['vk_video.h'] = [
+ COutputGenerator,
+ CGeneratorOptions(
+ conventions = conventions,
+ filename = 'vk_video.h',
+ directory = directory,
+ genpath = None,
+ apiname = 'vulkan',
+ profile = None,
+ versions = None,
+ emitversions = None,
+ defaultExtensions = defaultExtensions,
+ addExtensions = addExtensionsPat,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = '',
+ apientry = '',
+ apientryp = '',
+ alignFuncParam = 48,
+ misracstyle = misracstyle,
+ misracppstyle = misracppstyle)
+ ]
+
+ # Video extension 'Std' interfaces, each in its own header files
+ # These are not Vulkan extensions, or a part of the Vulkan API at all.
+ # They are treated in a similar fashion for generation purposes, but
+ # all required APIs for each interface must be explicitly required.
+ #
+ # Each element of the videoStd[] array is an extension name defining an
+ # interface, and is also the basis for the generated header file name.
+
+ videoStd = [
+ 'vulkan_video_codecs_common',
+ 'vulkan_video_codec_h264std',
+ 'vulkan_video_codec_h264std_decode',
+ 'vulkan_video_codec_h264std_encode',
+ 'vulkan_video_codec_h265std',
+ 'vulkan_video_codec_h265std_decode',
+ 'vulkan_video_codec_h265std_encode',
+ ]
+
+ # Unused at present
+ # addExtensionRE = makeREstring(videoStd)
+ for codec in videoStd:
+ headername = f'{codec}.h'
+
+ # Consider all of the codecs 'extensions', but only emit this one
+ emitExtensionRE = makeREstring([codec])
+
+ opts = CGeneratorOptions(
+ conventions = conventions,
+ filename = headername,
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ mergeApiNames = mergeApiNames,
+ profile = None,
+ versions = None,
+ emitversions = None,
+ defaultExtensions = None,
+ addExtensions = emitExtensionRE,
+ removeExtensions = None,
+ emitExtensions = emitExtensionRE,
+ requireDepends = False,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = False,
+ protectFile = protectFile,
+ protectFeature = False,
+ alignFuncParam = 48,
+ )
+
+ genOpts[headername] = [ COutputGenerator, opts ]
+
+ # Unused - vulkan11.h target.
+ # It is possible to generate a header with just the Vulkan 1.0 +
+ # extension interfaces defined, but since the promoted KHR extensions
+ # are now defined in terms of the 1.1 interfaces, such a header is very
+ # similar to vulkan_core.h.
+ genOpts['vulkan11.h'] = [
+ COutputGenerator,
+ CGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan11.h',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = '^VK_VERSION_1_[01]$',
+ emitversions = '^VK_VERSION_1_[01]$',
+ defaultExtensions = None,
+ addExtensions = None,
+ removeExtensions = None,
+ emitExtensions = None,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48,
+ misracstyle = misracstyle,
+ misracppstyle = misracppstyle)
+ ]
+
+ genOpts['alias.h'] = [
+ COutputGenerator,
+ CGeneratorOptions(
+ conventions = conventions,
+ filename = 'alias.h',
+ directory = directory,
+ genpath = None,
+ apiname = defaultAPIName,
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = defaultExtensions,
+ addExtensions = None,
+ removeExtensions = removeExtensionsPat,
+ emitExtensions = emitExtensionsPat,
+ prefixText = None,
+ genFuncPointers = False,
+ protectFile = False,
+ protectFeature = False,
+ protectProto = '',
+ protectProtoStr = '',
+ apicall = '',
+ apientry = '',
+ apientryp = '',
+ alignFuncParam = 36)
+ ]
+
+ # Serializer for spec
+ genOpts['cereal'] = [
+ CerealGenerator,
+ CGeneratorOptions(
+ conventions = conventions,
+ directory = directory,
+ apiname = 'vulkan',
+ profile = None,
+ versions = featuresPat,
+ emitversions = featuresPat,
+ defaultExtensions = defaultExtensions,
+ addExtensions = None,
+ removeExtensions = None,
+ emitExtensions = emitExtensionsPat,
+ prefixText = prefixStrings + vkPrefixStrings,
+ genFuncPointers = True,
+ protectFile = protectFile,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48)
+ ]
+
+ gfxstreamPrefixStrings = [
+ '#pragma once',
+ '#ifdef VK_GFXSTREAM_STRUCTURE_TYPE_EXT',
+ '#include "vulkan_gfxstream_structure_type.h"',
+ '#endif',
+ ]
+
+ # gfxstream specific header
+ genOpts['vulkan_gfxstream.h'] = [
+ COutputGenerator,
+ CGeneratorOptions(
+ conventions = conventions,
+ filename = 'vulkan_gfxstream.h',
+ directory = directory,
+ genpath = None,
+ apiname = 'vulkan',
+ profile = None,
+ versions = featuresPat,
+ emitversions = None,
+ defaultExtensions = None,
+ addExtensions = makeREstring(['VK_GOOGLE_gfxstream'], None),
+ removeExtensions = None,
+ emitExtensions = makeREstring(['VK_GOOGLE_gfxstream'], None),
+ prefixText = prefixStrings + vkPrefixStrings + gfxstreamPrefixStrings,
+ genFuncPointers = True,
+ # Use #pragma once in the prefixText instead, so that we can put the copyright comments
+ # at the beginning of the file.
+ protectFile = False,
+ protectFeature = False,
+ protectProto = '#ifndef',
+ protectProtoStr = 'VK_NO_PROTOTYPES',
+ apicall = 'VKAPI_ATTR ',
+ apientry = 'VKAPI_CALL ',
+ apientryp = 'VKAPI_PTR *',
+ alignFuncParam = 48,
+ misracstyle = misracstyle,
+ misracppstyle = misracppstyle)
+ ]
+
+def genTarget(args):
+ """Create an API generator and corresponding generator options based on
+ the requested target and command line options.
+
+ This is encapsulated in a function so it can be profiled and/or timed.
+ The args parameter is an parsed argument object containing the following
+ fields that are used:
+
+ - target - target to generate
+ - directory - directory to generate it in
+ - protect - True if re-inclusion wrappers should be created
+ - extensions - list of additional extensions to include in generated interfaces"""
+
+ # Create generator options with parameters specified on command line
+ makeGenOpts(args)
+
+ # Select a generator matching the requested target
+ if args.target in genOpts:
+ createGenerator = genOpts[args.target][0]
+ options = genOpts[args.target][1]
+
+ logDiag('* Building', args.target)
+ logDiag('* options.versions =', options.versions)
+ logDiag('* options.emitversions =', options.emitversions)
+ logDiag('* options.defaultExtensions =', options.defaultExtensions)
+ logDiag('* options.addExtensions =', options.addExtensions)
+ logDiag('* options.removeExtensions =', options.removeExtensions)
+ logDiag('* options.emitExtensions =', options.emitExtensions)
+ logDiag('* options.emitSpirv =', options.emitSpirv)
+ logDiag('* options.emitFormats =', options.emitFormats)
+
+ gen = createGenerator(errFile=errWarn,
+ warnFile=errWarn,
+ diagFile=diag)
+ return (gen, options)
+ else:
+ logErr('No generator options for unknown target:', args.target)
+ return None
+
+
+# -feature name
+# -extension name
+# For both, "name" may be a single name, or a space-separated list
+# of names, or a regular expression.
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-apiname', action='store',
+ default=None,
+ help='Specify API to generate (defaults to repository-specific conventions object value)')
+ parser.add_argument('-mergeApiNames', action='store',
+ default=None,
+ help='Specify a comma separated list of APIs to merge into the target API')
+ parser.add_argument('-defaultExtensions', action='store',
+ default=APIConventions().xml_api_name,
+ help='Specify a single class of extensions to add to targets')
+ parser.add_argument('-extension', action='append',
+ default=[],
+ help='Specify an extension or extensions to add to targets')
+ parser.add_argument('-removeExtensions', action='append',
+ default=[],
+ help='Specify an extension or extensions to remove from targets')
+ parser.add_argument('-emitExtensions', action='append',
+ default=[],
+ help='Specify an extension or extensions to emit in targets')
+ parser.add_argument('-emitSpirv', action='append',
+ default=[],
+ help='Specify a SPIR-V extension or capability to emit in targets')
+ parser.add_argument('-emitFormats', action='append',
+ default=[],
+ help='Specify Vulkan Formats to emit in targets')
+ parser.add_argument('-feature', action='append',
+ default=[],
+ help='Specify a core API feature name or names to add to targets')
+ parser.add_argument('-debug', action='store_true',
+ help='Enable debugging')
+ parser.add_argument('-dump', action='store_true',
+ help='Enable dump to stderr')
+ parser.add_argument('-diagfile', action='store',
+ default=None,
+ help='Write diagnostics to specified file')
+ parser.add_argument('-errfile', action='store',
+ default=None,
+ help='Write errors and warnings to specified file instead of stderr')
+ parser.add_argument('-noprotect', dest='protect', action='store_false',
+ help='Disable inclusion protection in output headers')
+ parser.add_argument('-profile', action='store_true',
+ help='Enable profiling')
+ parser.add_argument('-registry', action='store',
+ default='vk.xml',
+ help='Use specified registry file instead of vk.xml')
+ parser.add_argument('-registryGfxstream', action='store',
+ default=None,
+ help='Use specified gfxstream registry file')
+ parser.add_argument('-time', action='store_true',
+ help='Enable timing')
+ parser.add_argument('-genpath', action='store', default='gen',
+ help='Path to generated files')
+ parser.add_argument('-o', action='store', dest='directory',
+ default='.',
+ help='Create target and related files in specified directory')
+ parser.add_argument('target', metavar='target', nargs='?',
+ help='Specify target')
+ parser.add_argument('-quiet', action='store_true', default=True,
+ help='Suppress script output during normal execution.')
+ parser.add_argument('-verbose', action='store_false', dest='quiet', default=True,
+ help='Enable script output during normal execution.')
+ parser.add_argument('--vulkanLayer', action='store_true', dest='vulkanLayer',
+ help='Enable scripts to generate VK specific vulkan_json_data.hpp for json_gen_layer.')
+ parser.add_argument('-misracstyle', dest='misracstyle', action='store_true',
+ help='generate MISRA C-friendly headers')
+ parser.add_argument('-misracppstyle', dest='misracppstyle', action='store_true',
+ help='generate MISRA C++-friendly headers')
+ parser.add_argument('--iscts', action='store_true', dest='isCTS',
+ help='Specify if this should generate CTS compatible code')
+
+ args = parser.parse_args()
+
+ # This splits arguments which are space-separated lists
+ args.feature = [name for arg in args.feature for name in arg.split()]
+ args.extension = [name for arg in args.extension for name in arg.split()]
+
+ # create error/warning & diagnostic files
+ if args.errfile:
+ errWarn = open(args.errfile, 'w', encoding='utf-8')
+ else:
+ errWarn = sys.stderr
+
+ if args.diagfile:
+ diag = open(args.diagfile, 'w', encoding='utf-8')
+ else:
+ diag = None
+
+ if args.time:
+ # Log diagnostics and warnings
+ setLogFile(setDiag = True, setWarn = True, filename = '-')
+
+ # Create the API generator & generator options
+ (gen, options) = genTarget(args)
+
+ # Create the registry object with the specified generator and generator
+ # options. The options are set before XML loading as they may affect it.
+ reg = Registry(gen, options)
+
+ # Parse the specified registry XML into an ElementTree object
+ startTimer(args.time)
+ tree = etree.parse(args.registry)
+ endTimer(args.time, '* Time to make ElementTree =')
+
+ # Merge the gfxstream registry with the official Vulkan registry if the
+ # target is the cereal generator
+ if args.registryGfxstream is not None and args.target == 'cereal':
+ treeGfxstream = etree.parse(args.registryGfxstream)
+ treeRoot = tree.getroot()
+ treeGfxstreamRoot = treeGfxstream.getroot()
+
+ def getEntryName(entry) -> Optional[str]:
+ name = entry.get("name")
+ if name is not None:
+ return name
+ try:
+ return entry.find("proto").find("name").text
+ except AttributeError:
+ return None
+
+ for entriesName in ['types', 'commands', 'extensions']:
+ treeEntries = treeRoot.find(entriesName)
+
+ originalEntryDict = {}
+ for entry in treeEntries:
+ name = getEntryName(entry)
+ if name is not None:
+ originalEntryDict[name] = entry
+
+ for entry in treeGfxstreamRoot.find(entriesName):
+ name = getEntryName(entry)
+ # New entry, just append to entry list
+ if name not in originalEntryDict.keys():
+ treeEntries.append(entry)
+ continue
+ print(f'Entry {entriesName}:{name}')
+
+ originalEntry = originalEntryDict[name]
+
+ # Extending an existing entry. This happens for MVK.
+ if entriesName == "extensions":
+ for key, value in entry.attrib.items():
+ originalEntry.set(key, value)
+ require = entry.find("require")
+ if require is not None:
+ for child in require:
+ originalEntry.find("require").append(child)
+ continue
+
+ # Overwriting an existing entry. This happen for
+ # VkNativeBufferANDROID
+ if entriesName == "types" or entriesName == "commands":
+ originalEntry.clear()
+ originalEntry.attrib = entry.attrib
+ for child in entry:
+ originalEntry.append(child)
+
+ # Load the XML tree into the registry object
+ startTimer(args.time)
+ reg.loadElementTree(tree)
+ endTimer(args.time, '* Time to parse ElementTree =')
+
+ if args.dump:
+ logDiag('* Dumping registry to regdump.txt')
+ reg.dumpReg(filehandle=open('regdump.txt', 'w', encoding='utf-8'))
+
+ # Finally, use the output generator to create the requested target
+ if args.debug:
+ pdb.run('reg.apiGen()')
+ else:
+ startTimer(args.time)
+ reg.apiGen()
+ endTimer(args.time, '* Time to generate ' + args.target + ' =')
+
+ if not args.quiet:
+ logDiag('* Generated', args.target)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/globalizeIncludes b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/globalizeIncludes
new file mode 100755
index 00000000000..bc63c5759e6
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/globalizeIncludes
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Copyright 2019-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# globalizeIncludes - rewrites generated include::, and image:/image::
+# asciidoctor directives in specified Vulkan specification source files to
+# be relative to specified attributes {generated} and {images}, ensuring
+# they work properly when extracted to reference pages.
+#
+# usage: globalizeIncludes filenames
+# Updates specified files in-place, so make sure they are backed up first.
+
+sed -i -E \
+ -e 's#image:images/#image:{images}/#g' \
+ -e 's#image::images/#image::{images}/#g' \
+ -e 's#include::(\.\./)*(api|validity|hostsynctable)#include::{generated}/\2#g' \
+ $*
+
+# Not yet:
+# -e 's#include::meta/#include::{generated}/meta/#g' \
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/hostsyncgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/hostsyncgenerator.py
new file mode 100644
index 00000000000..850f0c6f366
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/hostsyncgenerator.py
@@ -0,0 +1,145 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from generator import OutputGenerator, write
+from spec_tools.attributes import ExternSyncEntry
+from spec_tools.validity import ValidityCollection, ValidityEntry
+from spec_tools.util import getElemName
+
+
+class HostSynchronizationOutputGenerator(OutputGenerator):
+ """HostSynchronizationOutputGenerator - subclass of OutputGenerator.
+ Generates AsciiDoc includes of the externsync parameter table for the
+ fundamentals chapter of the API specification. Similar to
+ DocOutputGenerator.
+
+ ---- methods ----
+ HostSynchronizationOutputGenerator(errFile, warnFile, diagFile) - args as for
+ OutputGenerator. Defines additional internal state.
+ ---- methods overriding base class ----
+ genCmd(cmdinfo)"""
+ # Generate Host Synchronized Parameters in a table at the top of the spec
+
+ threadsafety = {
+ 'parameters': ValidityCollection(),
+ 'parameterlists': ValidityCollection(),
+ 'implicit': ValidityCollection()
+ }
+
+ def makeParameterName(self, name):
+ return 'pname:' + name
+
+ def makeFLink(self, name):
+ return 'flink:' + name
+
+ def writeBlock(self, basename, title, contents):
+ """Generate an include file.
+
+ - directory - subdirectory to put file in
+ - basename - base name of the file
+ - contents - contents of the file (Asciidoc boilerplate aside)"""
+ filename = self.genOpts.directory + '/' + basename
+ self.logMsg('diag', '# Generating include file:', filename)
+ with open(filename, 'w', encoding='utf-8') as fp:
+ write(self.genOpts.conventions.warning_comment, file=fp)
+
+ if contents:
+ write('.%s' % title, file=fp)
+ write('****', file=fp)
+ write(contents, file=fp, end='')
+ write('****', file=fp)
+ write('', file=fp)
+ else:
+ self.logMsg('diag', '# No contents for:', filename)
+
+ def writeInclude(self):
+ "Generates the asciidoc include files."""
+ self.writeBlock('parameters.adoc',
+ 'Externally Synchronized Parameters',
+ self.threadsafety['parameters'])
+ self.writeBlock('parameterlists.adoc',
+ 'Externally Synchronized Parameter Lists',
+ self.threadsafety['parameterlists'])
+ self.writeBlock('implicit.adoc',
+ 'Implicit Externally Synchronized Parameters',
+ self.threadsafety['implicit'])
+
+ def makeThreadSafetyBlocks(self, cmd, paramtext):
+ # See also makeThreadSafetyBlock in validitygenerator.py - similar but not entirely identical
+ protoname = cmd.find('proto/name').text
+
+ # Find and add any parameters that are thread unsafe
+ explicitexternsyncparams = cmd.findall(paramtext + "[@externsync]")
+ if explicitexternsyncparams is not None:
+ for param in explicitexternsyncparams:
+ self.makeThreadSafetyForParam(protoname, param)
+
+ # Find and add any "implicit" parameters that are thread unsafe
+ implicitexternsyncparams = cmd.find('implicitexternsyncparams')
+ if implicitexternsyncparams is not None:
+ for elem in implicitexternsyncparams:
+ entry = ValidityEntry()
+ entry += elem.text
+ entry += ' in '
+ entry += self.makeFLink(protoname)
+ self.threadsafety['implicit'] += entry
+
+ # Add a VU for any command requiring host synchronization.
+ # This could be further parameterized, if a future non-Vulkan API
+ # requires it.
+ if self.genOpts.conventions.is_externsync_command(protoname):
+ entry = ValidityEntry()
+ entry += 'The sname:VkCommandPool that pname:commandBuffer was allocated from, in '
+ entry += self.makeFLink(protoname)
+ self.threadsafety['implicit'] += entry
+
+ def makeThreadSafetyForParam(self, protoname, param):
+ """Create thread safety validity for a single param of a command."""
+ externsyncattribs = ExternSyncEntry.parse_externsync_from_param(param)
+ param_name = getElemName(param)
+
+ for attrib in externsyncattribs:
+ entry = ValidityEntry()
+ is_array = False
+ if attrib.entirely_extern_sync:
+ # "true" or "true_with_children"
+ if self.paramIsArray(param):
+ entry += 'Each element of the '
+ is_array = True
+ elif self.paramIsPointer(param):
+ entry += 'The object referenced by the '
+ else:
+ entry += 'The '
+
+ entry += self.makeParameterName(param_name)
+ entry += ' parameter'
+
+ if attrib.children_extern_sync:
+ entry += ', and any child handles,'
+
+ else:
+ # parameter/member reference
+ readable = attrib.get_human_readable(make_param_name=self.makeParameterName)
+ is_array = (' element of ' in readable)
+ entry += readable
+
+ entry += ' in '
+ entry += self.makeFLink(protoname)
+
+ if is_array:
+ self.threadsafety['parameterlists'] += entry
+ else:
+ self.threadsafety['parameters'] += entry
+
+ def genCmd(self, cmdinfo, name, alias):
+ "Generate command."
+ OutputGenerator.genCmd(self, cmdinfo, name, alias)
+
+ # @@@ (Jon) something needs to be done here to handle aliases, probably
+
+ self.makeThreadSafetyBlocks(cmdinfo.elem, 'param')
+
+ self.writeInclude()
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/htmldiff/htmldiff b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/htmldiff/htmldiff
new file mode 100755
index 00000000000..f4c8c74c4bd
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/htmldiff/htmldiff
@@ -0,0 +1,135 @@
+#!/usr/bin/env python3
+#
+# Modified from the htmldiff script developed by Dominique Hazael-Massieux
+# for the http://services.w3.org/htmldiff website.
+# License information found at https://github.com/w3c/htmldiff-ui/blob/master/LICENSE
+# for "htmldiffy.py".
+#
+# Copyright (c) 2008-2020 w3c
+# Copyright 2016-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: MIT
+#
+# 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 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.
+
+import atexit
+import os
+import re
+import sys
+import tempfile
+import tidy
+
+from subprocess import Popen, PIPE
+
+def tidyFile(filename):
+ ifp = open(filename, 'r')
+
+ # option for tidy
+ options = dict(tidy_mark=0,show_warnings=0,quiet=1,char_encoding='utf8')
+ html5 = re.search(r"<!doctype\s+html\s*>", ifp.read(4096),
+ re.IGNORECASE)
+ ifp.seek(0)
+ html5_options = {'add_xml_space': 'no',
+ 'output_xhtml': 'no',
+ 'tidy_mark': 'no',
+ 'new_blocklevel_tags': 'article,aside,canvas,dialog,details,figcaption,figure,footer,header,hgroup,menu,nav,section,main,summary,math,semantics,mrow,mfenced,mtable,mtr,mtd,mi,mn,msub,mo,mfrac,munderover,mtext,svg,g,image,rect,text,desc,line,path,polygon,ellipse,tspan,defs,feoffset,fecolormatrix,filter,fegaussianblur,feblend,marker,circle',
+ 'new_inline_tags': 'video,audio,canvas,ruby,rt,rp,time,meter,progress,track,source,emu-val,emu-nt,emu-t,mark',
+ 'break_before_br': 'no',
+ 'vertical_space': 'no',
+ 'enclose_text': 'no',
+ 'numeric_entities': 'yes',
+ 'wrap': '1000',
+ 'wrap_attributes': 'no',
+ 'drop_empty_paras': 'no'
+ }
+ if html5:
+ options.update(html5_options)
+ newtidy = tidy.parseString(ifp.read(), **options)
+ if len(newtidy.errors) > 0:
+ if not html5:
+ ifp.seek(0)
+ options.update(html5_options)
+ newtidy = tidy.parseString(ifp.read(), **options)
+ ifp.close()
+
+ fp = tempfile.NamedTemporaryFile(
+ mode='w+', prefix='htmldiff-', suffix='.html')
+ atexit.register(fp.close)
+ fp.write(str(newtidy))
+ fp.flush()
+ fp.seek(0)
+
+ # sys.stderr.write('tidyFile: tempfile name %s\n' % fp.name)
+
+ if (newtidy.errors):
+ sys.stderr.write('tidyFile: tidy.parseString error: %s\n' % str(newtidy.errors))
+ return fp
+
+def call_perl(args):
+
+ scriptdir = os.path.abspath(os.path.dirname(sys.argv[0]))
+ perlscript = os.path.join(scriptdir, 'htmldiff.pl')
+ cmd = [perlscript]
+ cmd.extend(args)
+ p = Popen(cmd,
+ text=True,
+ stdin=PIPE, stdout=PIPE, stderr=PIPE)
+ sys.stdout.flush()
+ sys.stderr.flush()
+ (out, err) = p.communicate()
+ p.stdin.close()
+ if err:
+ print(out)
+ sys.stderr.write('htmldiff: An error occurred when running htmldiff.pl on the documents: %s\n'% str(err))
+ exit(1)
+ else:
+ print(out)
+ exit(0)
+
+def usage():
+ # did not investigate fully what -c does - something about mhtml comments?
+ sys.stderr.write("""htmldiff: need two filename args file1 file2
+
+May also pass arguments:
+ -l Make diff highlights links that jump to the following diff
+ -t Add a script to optionally hide old text via button
+ -o Complete omit old text
+ -h show this text
+""")
+ sys.exit(1)
+
+if __name__ == '__main__':
+
+ docs = []
+ passthru_args = []
+ for arg in sys.argv[1:]:
+ if arg in ('-c', '-l', '-t', '-o'):
+ passthru_args.append(arg)
+ elif arg == '-h':
+ usage()
+ else:
+ docs.append(arg)
+
+ if (len(docs) != 2):
+ usage()
+ refdoc = tidyFile(docs[0])
+
+ newdoc = tidyFile(docs[1])
+ passthru_args.append(refdoc.name)
+ passthru_args.append(newdoc.name)
+ call_perl(passthru_args)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/htmldiff/htmldiff.pl b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/htmldiff/htmldiff.pl
new file mode 100755
index 00000000000..af2a6cd290e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/htmldiff/htmldiff.pl
@@ -0,0 +1,581 @@
+#!/usr/bin/perl
+#
+# htmldiff - present a diff marked version of two html documents
+#
+# Copyright (c) 1998-2006 MACS, Inc.
+#
+# Copyright (c) 2007 SiSco, Inc.
+#
+# SPDX-License-Identifier: MIT
+#
+# 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 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.
+#
+# See http://www.themacs.com for more information.
+#
+# usage: htmldiff [[-c] [-l] [-o] oldversion newversion [output]]
+#
+# -c - disable metahtml comment processing
+# -o - disable outputting of old text
+# -l - use navindex to create sequence of diffs
+# oldversion - the previous version of the document
+# newversion - the newer version of the document
+# output - a filename to place the output in. If omitted, the output goes to
+# standard output.
+#
+# if invoked with no options or arguments, operates as a CGI script. It then
+# takes the following parameters:
+#
+# oldfile - the URL of the original file
+# newfile - the URL of the new file
+# mhtml - a flag to indicate whether it should be aware of MetaHTML comments.
+#
+# requires GNU diff utility
+# also requires the perl modules Getopt::Std
+#
+# NOTE: The markup created by htmldiff may not validate against the HTML 4.0
+# DTD. This is because the algorithm is realtively simple, and there are
+# places in the markup content model where the span element is not allowed.
+# Htmldiff is NOT aware of these places.
+#
+# $Source: /u/sources/public/2009/htmldiff/htmldiff.pl,v $
+# $Revision: 1.3 $
+#
+# $Log: htmldiff.pl,v $
+# Revision 1.3 2016/10/24 15:06:51 dom
+# Summary: Use nav script always
+#
+# Revision 1.2 2016/10/24 15:04:28 dom
+# Add navigation script
+#
+# Revision 1.1 2014-01-06 08:04:51 dom
+# added copy of htmldiff perl script since aptest.com repo no longer available
+#
+# Revision 1.5 2008/03/05 13:23:16 ahby
+# Fixed a problem with leading whitespace before markup.
+#
+# Revision 1.4 2007/12/13 13:09:16 ahby
+# Updated copyright and license.
+#
+# Revision 1.3 2007/12/13 12:53:34 ahby
+# Changed use of span to ins and del
+#
+# Revision 1.2 2002/02/13 16:27:23 ahby
+# Changed processing model.
+# Improved handling of old text and changed styles.
+#
+# Revision 1.1 2000/07/12 12:20:04 ahby
+# Updated to remove empty spans - this fixes validation problems under
+# strict.
+#
+# Revision 1.11 1999/12/08 19:46:45 ahby
+# Fixed validation errors introduced by placing markup where it didn't
+# belong.
+#
+# Revision 1.10 1999/10/18 13:42:58 ahby
+# Added -o to the usage message.
+#
+# Revision 1.9 1999/05/04 12:29:11 ahby
+# Added an option to turn off the display of old text.
+#
+# Revision 1.8 1999/04/09 14:37:27 ahby
+# Fixed a perl syntax error.
+#
+# Revision 1.7 1999/04/09 14:35:49 ahby
+# Added reference to MACS homepage.
+#
+# Revision 1.6 1999/04/09 14:35:09 ahby
+# Added comment about validity of generated markup.
+#
+# Revision 1.5 1999/02/22 22:17:54 ahby
+# Changed to use stylesheets.
+# Changed to rely upon span.
+# Changed to work around content model problems.
+#
+# Revision 1.4 1999/02/08 02:32:22 ahby
+# Added a copyright statement.
+#
+# Revision 1.3 1999/02/08 02:30:40 ahby
+# Added header processing.
+#
+# Revision 1.2 1998/12/10 17:31:31 ahby
+# Fixed to escape less-thans in change blocks and to not permit change
+# markup within specific elements (like TITLE).
+#
+# Revision 1.1 1998/11/26 00:09:22 ahby
+# Initial revision
+#
+#
+
+use Getopt::Std;
+
+sub usage {
+ print STDERR "htmldiff [-c] [-o] oldversion newversion [output]\n";
+ exit;
+}
+
+sub url_encode {
+ my $str = shift;
+ $str =~ s/([\x00-\x1f\x7F-\xFF])/
+ sprintf ('%%%02x', ord ($1))/eg;
+ return $str;
+}
+
+# markit - diff-mark the streams
+#
+# markit(file1, file2)
+#
+# markit relies upon GNUdiff to mark up the text.
+#
+# The markup is encoded using special control sequences:
+#
+# a block wrapped in control-a is deleted text
+# a block wrapped in control-b is old text
+# a block wrapped in control-c is new text
+#
+# The main processing loop attempts to wrap the text blocks in appropriate
+# SPANs based upon the type of text that it is.
+#
+# When the loop encounters a < in the text, it stops the span. Then it outputs
+# the element that is defined, then it restarts the span.
+
+sub markit {
+ my $retval = "";
+ my($file1) = shift;
+ my($file2) = shift;
+# my $old="<span class=\\\"diff-old-a\\\">deleted text: </span>%c'\012'%c'\001'%c'\012'%<%c'\012'%c'\001'%c'\012'";
+ my $old="%c'\012'%c'\001'%c'\012'%<%c'\012'%c'\001'%c'\012'";
+ my $new="%c'\012'%c'\003'%c'\012'%>%c'\012'%c'\003'%c'\012'";
+ my $unchanged="%=";
+ my $changed="%c'\012'%c'\001'%c'\012'%<%c'\012'%c'\001'%c'\012'%c'\004'%c'\012'%>%c'\012'%c'\004'%c'\012'";
+ if ($opt_o) {
+ $old = "";
+ $changed = "%c'\012'%c'\004'%c'\012'%>%c'\012'%c'\004'%c'\012'";
+ }
+# my $old="%c'\002'<font color=\\\"purple\\\" size=\\\"-2\\\">deleted text:</font><s>%c'\012'%c'\001'%c'\012'%<%c'\012'%c'\001'%c'\012'</s>%c'\012'%c'\002'";
+# my $new="%c'\002'<font color=\\\"purple\\\"><u>%c'\012'%c'\002'%>%c'\002'</u></font>%c'\002'%c'\012'";
+# my $unchanged="%=";
+# my $changed="%c'\002'<s>%c'\012'%c'\001'%c'\012'%<%c'\012'%c'\001'%c'\012'</s><font color=\\\"purple\\\"><u>%c'\002'%c'\012'%>%c'\012'%c'\002'</u></font>%c'\002'%c'\012'";
+
+ my @span;
+ $span[0]="</span>";
+ $span[1]="<del class=\"diff-old\">";
+ $span[2]="<del class=\"diff-old\">";
+ $span[3]="<ins class=\"diff-new\">";
+ $span[4]="<ins class=\"diff-chg\">";
+
+ my @diffEnd ;
+ $diffEnd[1] = '</del>';
+ $diffEnd[2] = '</del>';
+ $diffEnd[3] = '</ins>';
+ $diffEnd[4] = '</ins>';
+
+ my $diffcounter = 0;
+
+ open(FILE, qq(diff -d --old-group-format="$old" --new-group-format="$new" --changed-group-format="$changed" --unchanged-group-format="$unchanged" $file1 $file2 |)) || die("Diff failed: $!");
+# system (qq(diff --old-group-format="$old" --new-group-format="$new" --changed-group-format="$changed" --unchanged-group-format="$unchanged" $file1 $file2 > /tmp/output));
+
+ my $state = 0;
+ my $inblock = 0;
+ my $temp = "";
+ my $lineCount = 0;
+
+# strategy:
+#
+# process the output of diff...
+#
+# a link with control A-D means the start/end of the corresponding ordinal
+# state (1-4). Resting state is state 0.
+#
+# While in a state, accumulate the contents for that state. When exiting the
+# state, determine if it is appropriate to emit the contents with markup or
+# not (basically, if the accumulated buffer contains only empty lines or lines
+# with markup, then we don't want to emit the wrappers. We don't need them.
+#
+# Note that if there is markup in the "old" block, that markup is silently
+# removed. It isn't really that interesting, and it messes up the output
+# something fierce.
+
+ while (<FILE>) {
+ my $nextCounter = $diffcounter + 1;
+ my $anchor = $opt_l ? qq[<a tabindex="$diffcounter" id="diff-$diffcounter" href="#diff-$nextCounter">] : "" ;
+ my $anchorEnd = $opt_l ? q[</a>] : "" ;
+ $lineCount ++;
+ if ($state == 0) { # if we are resting and we find a marker,
+ # then we must be entering a block
+ if (m/^([\001-\004])/) {
+ $state = ord($1);
+ $_ = "";
+ }
+# if (m/^\001/) {
+# $state = 1;
+# s/^/$span[1]/;
+# } elsif (m/^\002/) {
+# $state = 2;
+# s/^/$span[2]/;
+# } elsif (m/^\003/) {
+# $state = 3;
+# s/^/$span[3]/;
+# } elsif (m/^\004/) {
+# $state = 4;
+# s/^/$span[4]/;
+# }
+ } else {
+ # if we are in "old" state, remove markup
+ if (($state == 1) || ($state == 2)) {
+ s/\<.*\>//; # get rid of any old markup
+ s/\</&lt;/g; # escape any remaining STAG or ETAGs
+ s/\>/&gt;/g;
+ }
+ # if we found another marker, we must be exiting the state
+ if (m/^([\001-\004])/) {
+ if ($temp ne "") {
+ $_ = $span[$state] . $anchor . $temp . $anchorEnd . $diffEnd[$state] . "\n";
+ $temp = "";
+ $diffcounter++;
+ } else {
+ $_ = "" ;
+ }
+ $state = 0;
+ } elsif (m/^\s*\</) { # otherwise, is this line markup?
+ # if it is markup AND we haven't seen anything else yet,
+ # then we will emit the markup
+ if ($temp eq "") {
+ $retval .= $_;
+ $_ = "";
+ } else { # we wrap it with the state switches and hold it
+ s/^/$anchorEnd$diffEnd[$state]/;
+ s/$/$span[$state]$anchor/;
+ $temp .= $_;
+ $_ = "";
+ $diffcounter++;
+ }
+ } else {
+ if (m/.+/) {
+ $temp .= $_;
+ $_ = "";
+ }
+ }
+ }
+
+ s/\001//g;
+ s/\002//g;
+ s/\003//g;
+ s/\004//g;
+ if ($_ !~ m/^$/) {
+ $retval .= $_;
+ }
+ }
+ close FILE;
+ $retval =~ s/$span[1]\n+$diffEnd[1]//g;
+ $retval =~ s/$span[2]\n+$diffEnd[2]//g;
+ $retval =~ s/$span[3]\n+$diffEnd[3]//g;
+ $retval =~ s/$span[4]\n+$diffEnd[4]//g;
+ $retval =~ s/$span[1]\n*$//g;
+ $retval =~ s/$span[2]\n*$//g;
+ $retval =~ s/$span[3]\n*$//g;
+ $retval =~ s/$span[4]\n*$//g;
+ return $retval;
+}
+
+sub splitit {
+ my $filename = shift;
+ my $headertmp = shift;
+ my $inheader=0;
+ my $preformatted=0;
+ my $inelement=0;
+ my $retval = "";
+ my $styles = q(<style type='text/css'>
+.diff-old-a {
+ font-size: smaller;
+ color: red;
+}
+.diff-new a { text-decoration: none; }
+.diff-new { background-color: yellow; }
+.diff-chg { background-color: lime; }
+.diff-chg a { text-decoration: none; }
+.diff-new:before,
+.diff-new:after
+ { content: "\2191" }
+.diff-chg:before, .diff-chg:after
+ { content: "\2195" }
+.diff-old { text-decoration: line-through; background-color: #FBB; }
+.diff-old:before,
+.diff-old:after
+ { content: "\2193" }
+.diff-old a { text-decoration: none; }
+:focus { border: thin red solid}
+</style>
+<script src="https://www.w3.org/2016/10/htmldiff-nav.js"></script>);
+ if ($opt_t) {
+ $styles .= q(
+<script type="text/javascript">
+<!--
+function setOldDisplay() {
+ for ( var s = 0; s < document.styleSheets.length; s++ ) {
+ var css = document.styleSheets[s];
+ var mydata ;
+ try { mydata = css.cssRules ;
+ if ( ! mydata ) mydata = css.rules;
+ for ( var r = 0; r < mydata.length; r++ ) {
+ if ( mydata[r].selectorText == '.diff-old' ) {
+ mydata[r].style.display = ( mydata[r].style.display == '' ) ? 'none'
+: '';
+ return;
+ }
+ }
+ } catch(e) {} ;
+ }
+}
+-->
+</script>
+);
+
+ }
+
+ if ($stripheader) {
+ open(HEADER, ">$headertmp");
+ }
+
+ my $incomment = 0;
+ my $inhead = 1;
+ open(FILE, $filename) || die("File $filename cannot be opened: $!");
+ while (<FILE>) {
+ if ($inhead == 1) {
+ if (m/\<\/head/i) {
+ print HEADER $styles;
+ }
+ if (m/\<body/i) {
+ $inhead = 0;
+ print HEADER;
+ if ($opt_t) {
+ print HEADER q(
+<form action=""><input type="button" onclick="setOldDisplay()" value="Show/Hide Old Content" /></form>
+);
+ }
+ if ($opt_l) {
+ print HEADER q(
+ <p><em>NOTE: Click highlighted diff text to jump to the following difference.</em></p>
+ );
+ }
+ close HEADER;
+ } else {
+ print HEADER;
+ }
+ } else {
+ if ($incomment) {
+ if (m;-->;) {
+ $incomment = 0;
+ s/.*-->//;
+ } else {
+ next;
+ }
+ }
+ if (m;<!--;) {
+ while (m;<!--.*-->;) {
+ s/<!--.*?-->//;
+ }
+ if (m;<!--; ) {
+ $incomment = 1;
+ s/<!--.*//;
+ }
+ }
+ if (m/\<pre/i) {
+ $preformatted = 1;
+ }
+ if (m/\<\/pre\>/i) {
+ $preformatted = 0;
+ }
+ if ($preformatted) {
+ $retval .= $_;
+ } elsif ($mhtmlcomments && /^;;;/) {
+ $retval .= $_;
+ } else {
+ my @list = split(' ');
+ foreach $element (@list) {
+ if ($element =~ m/\<H[1-6]/i) {
+# $inheader = 1;
+ }
+ if ($inheader == 0) {
+ $element =~ s/</\n</g;
+ $element =~ s/^\n//;
+ $element =~ s/>/>\n/g;
+ $element =~ s/\n$//;
+ $element =~ s/>\n([.,:!]+)/>$1/g;
+ }
+ if ($element =~ m/\<\/H[1-6]\>/i) {
+ $inheader = 0;
+ }
+ $retval .= "$element";
+ $inelement += ($element =~ s/</&lt;/g);
+ $inelement -= ($element =~ s/>/&gt;/g);
+ if ($inelement < 0) {
+ $inelement = 0;
+ }
+ if (($inelement == 0) && ($inheader == 0)) {
+ $retval .= "\n";
+ } else {
+ $retval .= " ";
+ }
+ }
+ undef @list;
+ }
+ }
+ }
+ $retval .= "\n";
+ close FILE;
+ return $retval;
+}
+
+$mhtmlcomments = 1;
+
+sub cli {
+ getopts("clto") || usage();
+
+ if ($opt_c) {$mhtmlcomments = 0;}
+
+ if (@ARGV < 2) { usage(); }
+
+ $file1 = $ARGV[0];
+ $file2 = $ARGV[1];
+ $file3 = $ARGV[2];
+
+ $tmp = splitit($file1, $headertmp1);
+ open (FILE, ">$tmp1");
+ print FILE $tmp;
+ close FILE;
+
+ $tmp = splitit($file2, $headertmp2);
+ open (FILE, ">$tmp2");
+ print FILE $tmp;
+ close FILE;
+
+ $output = "";
+
+ if ($stripheader) {
+ open(FILE, $headertmp2);
+ while (<FILE>) {
+ $output .= $_;
+ }
+ close(FILE);
+ }
+
+ $output .= markit($tmp1, $tmp2);
+
+ if ($file3) {
+ open(FILE, ">$file3");
+ print FILE $output;
+ close FILE;
+ } else {
+ print $output;
+ }
+}
+
+sub cgi {
+# use LWP::UserAgent;
+# use CGI;
+
+ my $query = new CGI;
+ my $url1 = $query->param("oldfile");
+ my $url2 = $query->param("newfile");
+ my $mhtml = $query->param("mhtml");
+
+ my $file1 = "/tmp/htdcgi1.$$";
+ my $file2 = "/tmp/htdcgi2.$$";
+
+ my $ua = new LWP::UserAgent;
+ $ua->agent("MACS, Inc. HTMLdiff/0.9 " . $ua->agent);
+
+ # Create a request
+
+ my $req1 = new HTTP::Request GET => $url1;
+
+ my $res1 = $ua->request($req1, $file1);
+ if ($res1->is_error) {
+ print $res1->error_as_HTML();
+ print "<p>The URL $url1 could not be found. Please check it and try again.</p>";
+ return;
+ }
+
+ my $req2 = new HTTP::Request GET => $url2;
+
+ my $res2 = $ua->request($req2, $file2);
+ if ($res2->is_error) {
+ print $res2->error_as_HTML();
+ print "<p>The URL $url2 could not be found. Please check it and try again.</p>";
+ return;
+ }
+
+ $split1 = splitit($file1, $headertmp1);
+ open (FILE, ">$tmp1");
+ print FILE $split1;
+ close FILE;
+
+ $split2 = splitit($file2, $headertmp2);
+ open (FILE, ">$tmp2");
+ print FILE $split2;
+ close FILE;
+
+ $output = "";
+
+ if ($stripheader) {
+ open(FILE, $headertmp2);
+ while (<FILE>) {
+ $output .= $_;
+ }
+ close(FILE);
+ }
+
+ $output .= markit($tmp1, $tmp2);
+
+ my $base=$res2->base;
+
+ if ($base !~ /\/$/) {
+ $base =~ s/[^\/]*$//;
+ }
+
+ if ( $output !~ /<base/i ) {
+ $output =~ s/<head>/<head>\n<base href="$base">/i ||
+ $output =~ s/<html>/<html>\n<base href="$base">/i ;
+ }
+
+ print $query->header(-type=>'text/html',-nph=>1);
+ print $output;
+
+ unlink $file1;
+ unlink $file2;
+
+}
+
+$tmp1="/tmp/htdtmp1.$$";
+$headertmp1="/tmp/htdhtmp1.$$";
+$tmp2="/tmp/htdtmp2.$$";
+$headertmp2="/tmp/htdhtmp2.$$";
+$stripheader = 1;
+
+if (@ARGV == 0) {
+ cgi(); # if no arguments, we must be operating as a cgi script
+} else {
+ cli(); # if there are arguments, then we are operating as a CLI
+}
+
+unlink $tmp1;
+unlink $headertmp1;
+unlink $tmp2;
+unlink $headertmp2;
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/indexExt.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/indexExt.py
new file mode 100755
index 00000000000..68d5528355a
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/indexExt.py
@@ -0,0 +1,94 @@
+#!/usr/bin/python3
+#
+# Copyright 2017-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Construct an HTML fragment indexing extension appendices in vkspec.html.
+# This is run only when publishing an update spec, to update the Vulkan
+# registry.
+
+import argparse,io,os,re,string,sys,copy
+import xml.etree.ElementTree as etree
+from apiconventions import APIConventions
+
+def listExts(vendor, ext, tag):
+ prefix = ' <li> <b> '
+ suffix = ' </b> </li>'
+
+ if vendor in tag:
+ desc = vendor + ' Extensions (' + tag[vendor] + ')'
+ else:
+ desc = vendor + ' Extensions (full vendor description unavailable)'
+ print(prefix, desc, suffix)
+
+ # (OLD) Links to the extension appendix in the single-page HTML document.
+ # This is very slow to load.
+ # fmtString = ' <li> <a href="specs/1.3-extensions/html/vkspec.html#{0}"> {0} </a> </li>'
+
+ # This links to the individual per-extension refpages, which are a
+ # slightly modified version of the extension appendices, and far faster
+ # to load.
+ if APIConventions().xml_api_name == 'vulkansc':
+ fmtString = ' <li> <a href="specs/1.0-extensions/man/html/{0}.html"> {0} </a> </li>'
+ else:
+ fmtString = ' <li> <a href="specs/1.3-extensions/man/html/{0}.html"> {0} </a> </li>'
+
+ for name in sorted(ext[vendor]):
+ print(fmtString.format(name))
+
+# -extension name - may be a single extension name, a a space-separated list
+# of names, or a regular expression.
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-registry', action='store',
+ default='vk.xml',
+ help='Use specified registry file instead of vk.xml')
+ parser.add_argument('-quiet', action='store_true', default=False,
+ help='Suppress script output during normal execution.')
+
+ args = parser.parse_args()
+
+ tree = etree.parse(args.registry)
+
+ # Dictionary of vendor tags -> author name mappings
+ tag = {}
+
+ # Loop over all vendor tags, tracking the full corresponding author name
+ for elem in tree.findall('tags/tag'):
+ vendor = elem.get('name')
+ author = elem.get('author')
+
+ tag[vendor] = author
+
+ # Dictionary of supported extensions, indexed by vendor prefix
+ ext = {}
+
+ # Loop over all extensions, add supported names to the dictionary
+ for elem in tree.findall('extensions/extension'):
+ name = elem.get('name')
+ supported = elem.get('supported')
+
+ if APIConventions().xml_api_name in supported.split(','):
+ # Relies on name being in the form VK_<vendor>_stuff
+ (vk, vendor) = name.split('_')[0:2]
+
+ if not vendor in ext:
+ ext[vendor] = []
+ ext[vendor].append(name)
+
+ # Emit HTML fragment indexing the extensions
+
+ print('<ul>')
+
+ for vendor in ['KHR', 'EXT']:
+ if vendor in ext:
+ listExts(vendor, ext, tag)
+ del ext[vendor]
+
+ for vendor in sorted(ext.keys()):
+ listExts(vendor, ext, tag)
+ del ext[vendor]
+
+ print('</ul>')
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/interfacedocgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/interfacedocgenerator.py
new file mode 100644
index 00000000000..37ed32ebf55
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/interfacedocgenerator.py
@@ -0,0 +1,124 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import re
+from generator import OutputGenerator, write
+from parse_dependency import dependencyLanguageSpecMacros
+
+def interfaceDocSortKey(item):
+ if item == None:
+ return '\0'
+ else:
+ return item.casefold()
+
+class InterfaceDocGenerator(OutputGenerator):
+ """InterfaceDocGenerator - subclass of OutputGenerator.
+ Generates AsciiDoc includes of the interfaces added by a an API version
+ or extension."""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.features = []
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ # Create subdirectory, if needed
+ self.makeDir(self.genOpts.directory)
+
+ def beginFeature(self, interface, emit):
+ # Start processing in superclass
+ OutputGenerator.beginFeature(self, interface, emit)
+
+ self.features.append( self.featureName )
+
+ def endFeature(self):
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def writeNewInterfaces(self, feature, key, title, markup, fp):
+ dict = self.featureDictionary[feature][key]
+
+ parentmarkup = markup
+ if key == 'enumconstant':
+ parentmarkup = 'elink:'
+
+ if dict:
+ write('=== ' + title, file=fp)
+ write('',file=fp)
+
+ # Loop through required blocks, sorted so they start with "core" features
+ for required in sorted(dict, key = interfaceDocSortKey):
+ # 'required' may be a boolean expression of extension
+ # names.
+ # Currently this syntax is the same as asciidoc conditional
+ # syntax, but will eventually become more complex.
+ if required is not None:
+ # Rewrite with spec macros and xrefs applied to names
+ requiredlink = dependencyLanguageSpecMacros(required)
+
+ # @@ A better approach would be to actually evaluate the
+ # logical expression at generation time.
+ # If the extensions required are not in the spec build,
+ # then do not include these requirements.
+ # This would support arbitrarily complex expressions,
+ # unlike asciidoc ifdef syntax.
+ write('ifdef::' + required + '[]', file=fp)
+ write(f'If {requiredlink} is supported:', file=fp)
+ write('',file=fp)
+
+ # Commands are relatively straightforward
+ if key == 'command':
+ for api in sorted(dict[required]):
+ write(' * ' + markup + api, file=fp)
+ # Types and constants are potentially parented, so need to handle that
+ else:
+ # Loop through parents, sorted so they start with unparented items
+ for parent in sorted(dict[required], key = interfaceDocSortKey):
+ parentstring = ''
+ if parent:
+ parentstring = parentmarkup + (', ' + markup).join(parent.split(','))
+ write(' * Extending ' + parentstring + ':', file=fp)
+ for api in sorted(dict[required][parent]):
+ write(' ** ' + markup + api, file=fp)
+ else:
+ for api in sorted(dict[required][parent]):
+ write(' * ' + markup + api, file=fp)
+
+ if required is not None:
+ write('endif::' + required + '[]', file=fp)
+ write('',file=fp)
+
+ def makeInterfaceFile(self, feature):
+ """Generate a file containing feature interface documentation in
+ asciidoctor markup form.
+
+ - feature - name of the feature being generated"""
+
+ filename = feature + self.genOpts.conventions.file_suffix
+ fp = open(self.genOpts.directory + '/' + filename, 'w', encoding='utf-8')
+
+ # Write out the lists of new interfaces added by the feature
+ self.writeNewInterfaces(feature, 'define', 'New Macros', 'dlink:', fp)
+ self.writeNewInterfaces(feature, 'basetype', 'New Base Types', 'basetype:',fp)
+ self.writeNewInterfaces(feature, 'handle', 'New Object Types', 'slink:', fp)
+ self.writeNewInterfaces(feature, 'command', 'New Commands', 'flink:', fp)
+ self.writeNewInterfaces(feature, 'struct', 'New Structures', 'slink:', fp)
+ self.writeNewInterfaces(feature, 'union', 'New Unions', 'slink:', fp)
+ self.writeNewInterfaces(feature, 'funcpointer', 'New Function Pointers','tlink:', fp)
+ self.writeNewInterfaces(feature, 'enum', 'New Enums', 'elink:', fp)
+ self.writeNewInterfaces(feature, 'bitmask', 'New Bitmasks', 'tlink:', fp)
+ self.writeNewInterfaces(feature, 'include', 'New Headers', 'code:', fp)
+ self.writeNewInterfaces(feature, 'enumconstant','New Enum Constants', 'ename:', fp)
+
+ fp.close()
+
+ def endFile(self):
+ # Generate metadoc feature files, in refpage and non-refpage form
+ for feature in self.features:
+ self.makeInterfaceFile(feature)
+
+ OutputGenerator.endFile(self)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/jsgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/jsgenerator.py
new file mode 100644
index 00000000000..fc7ff7ef1ac
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/jsgenerator.py
@@ -0,0 +1,100 @@
+#!/usr/bin/python3 -i
+# Copyright 2013-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+from generator import OutputGenerator, enquote, write
+from scriptgenerator import ScriptOutputGenerator
+import pprint
+
+def undefquote(s):
+ if s:
+ return enquote(s)
+ else:
+ return 'undefined'
+
+class JSOutputGenerator(ScriptOutputGenerator):
+ """JSOutputGenerator - subclass of ScriptOutputGenerator.
+ Generates JavaScript data structures describing API names and
+ relationships."""
+
+ def __init__(self, *args, **kwargs):
+ self.currentDict = None
+ super().__init__(*args, **kwargs)
+
+ def beginDict(self, name):
+ """String starting definition of a named dictionary"""
+ self.currentDict = name
+ return f'exports.{name} = {{'
+
+ def endDict(self):
+ """ String ending definition of a named dictionary"""
+ return '}'
+
+ def writeDict(self, dict, name, printValues = True):
+ """Write dictionary as a JavaScript object with the given name.
+ If printValues is False, just output keys with undefined
+ values."""
+
+ write(self.beginDict(name), file=self.outFile)
+ for key in sorted(dict):
+ if printValues:
+ value = undefquote(dict[key])
+ else:
+ value = 'undefined'
+ write(f'{enquote(key)} : {value},', file=self.outFile)
+ write(self.endDict(), file=self.outFile)
+
+ def writeList(self, l, name):
+ """Write list l as a JavaScript hash with the given name"""
+
+ self.writeDict(l, name, printValues = False)
+
+ def endFile(self):
+ # Creates the inverse mapping of nonexistent APIs to their aliases.
+ super().createInverseMap()
+
+ # Print out all the dictionaries as JavaScript strings.
+ # Could just print(dict) but that is not human-readable
+ dicts = ( [ self.basetypes, 'basetypes' ],
+ [ self.consts, 'consts' ],
+ [ self.enums, 'enums' ],
+ [ self.flags, 'flags' ],
+ [ self.funcpointers, 'funcpointers' ],
+ [ self.protos, 'protos' ],
+ [ self.structs, 'structs' ],
+ [ self.handles, 'handles' ],
+ [ self.defines, 'defines' ],
+ [ self.typeCategory, 'typeCategory' ],
+ [ self.alias, 'alias' ],
+ [ self.nonexistent, 'nonexistent' ],
+ )
+
+ for (dict, name) in dicts:
+ self.writeDict(dict, name)
+
+ # Dictionary containing the relationships of a type
+ # (e.g. a dictionary with each related type as keys).
+ write(self.beginDict('mapDict'), file=self.outFile)
+ for baseType in sorted(self.mapDict):
+ # Not actually including the relationships yet
+ write(f'{enquote(baseType)} : undefined,',
+ file=self.outFile)
+ write(self.endDict(), file=self.outFile)
+
+ # List of included feature names
+ self.writeList(sorted(self.features), 'features')
+
+ # Generate feature <-> interface mappings
+ for feature in self.features:
+ self.mapInterfaces(feature)
+
+ # Write out the reverse map from APIs to requiring features
+ write(self.beginDict('requiredBy'), file=self.outFile)
+ for api in sorted(self.apimap):
+ # Sort requirements by first feature in each one
+ deps = sorted(self.apimap[api], key = lambda dep: dep[0])
+ reqs = ', '.join('[{}, {}]'.format(undefquote(dep[0]), undefquote(dep[1])) for dep in deps)
+ write('{} : [{}],'.format(enquote(api), reqs), file=self.outFile)
+ write(self.endDict(), file=self.outFile)
+
+ super().endFile()
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_c_generator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_c_generator.py
new file mode 100644
index 00000000000..94f95b1637f
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_c_generator.py
@@ -0,0 +1,659 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Description:
+# -----------
+# This script generates a .hpp file that can be included in an application
+# to generate json data that can then be used to generate the pipeline cache.
+
+import os
+import re
+import xml.dom.minidom
+from generator import (GeneratorOptions, OutputGenerator, noneStr,
+ regSortFeatures, write)
+
+copyright = """
+/*
+** Copyright (c) 2020 The Khronos Group Inc.
+**
+** SPDX-License-Identifier: Apache-2.0
+*/
+"""
+
+predefinedCode = """
+/********************************************************************************************/
+/** This code is generated. To make changes, please modify the scripts or the relevant xml **/
+/********************************************************************************************/
+
+#pragma once
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <inttypes.h>
+#include <vulkan/vulkan.h>
+#include "vulkan_json_gen.h"
+
+#define MAX_SIZE 255 // We don't expect to write a bigger string at a time.
+#define MAX_JSON_SIZE 1024*1024 // We don't expect the entire JSON file to be bigger than this.
+
+static int s_num_spaces = 0;
+static char s_tempBuf[MAX_SIZE];
+static char s_outBuf[MAX_JSON_SIZE];
+static char *s_writePtr = s_outBuf;
+
+#define _OUT s_tempBuf
+
+#define UPDATE_BUF strncpy(s_writePtr, s_tempBuf, strnlen(s_tempBuf, MAX_SIZE)); s_writePtr += strnlen(s_tempBuf, MAX_SIZE);
+
+// Variadic macro for neat buffer update + print.
+#define vk_json_printf(...) { sprintf(__VA_ARGS__); UPDATE_BUF }
+
+// Helper utility to do indentation in the generated json file.
+#define PRINT_SPACE \
+{ \\
+ int spaces; \\
+ for (spaces = 0; spaces < s_num_spaces; spaces++) \\
+ vk_json_printf(_OUT, " "); \\
+}
+
+
+#define INDENT(sz) s_num_spaces += (sz);
+
+const char* getJSONOutput()
+{
+ return s_outBuf;
+}
+
+void resetJSONOutput(void)
+{
+ memset(s_outBuf, 0x00, MAX_JSON_SIZE);
+ s_writePtr = s_outBuf;
+}
+
+"""
+
+printVal = """
+void print_@name(const @name * obj, const char* s, int commaNeeded) {
+ PRINT_SPACE
+ if (s[0] != 0) {
+ vk_json_printf(_OUT, \"\\\"%s\\\" : FORMAT%s\\n\", s, *obj, commaNeeded ? \",\" : \"\");
+ } else {
+ vk_json_printf(_OUT, \"FORMAT%s\\n", *obj, commaNeeded ? \",\" : \"\");
+ }
+}
+"""
+
+class JSONCGeneratorOptions(GeneratorOptions):
+ """JSONCGeneratorOptions - subclass of GeneratorOptions.
+
+ Adds options used by JSONCOutputGenerator objects during C language header
+ generation."""
+
+ def __init__(self,
+ prefixText="",
+ genFuncPointers=True,
+ protectFile=True,
+ protectFeature=True,
+ protectProto=None,
+ protectProtoStr=None,
+ apicall='',
+ apientry='',
+ apientryp='',
+ indentFuncProto=True,
+ indentFuncPointer=False,
+ alignFuncParam=0,
+ genEnumBeginEndRange=False,
+ genAliasMacro=False,
+ aliasMacro='',
+ **kwargs
+ ):
+
+ GeneratorOptions.__init__(self, **kwargs)
+
+
+class JSONCOutputGenerator(OutputGenerator):
+ # This is an ordered list of sections in the header file.
+ TYPE_SECTIONS = ['basetype', 'handle', 'enum',
+ 'group', 'bitmask', 'struct']
+ ALL_SECTIONS = TYPE_SECTIONS
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Internal state - accumulators for different inner block text
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+ self.may_alias = None
+ self.featureDict = {}
+ self.vkscFeatureList = []
+ self.enumNames = []
+ self.baseTypeDict = {
+ "int32_t" : "%d",
+ "uint32_t" : "%u",
+ "uint8_t" : "%u",
+ "uint64_t" : "%\" PRIu64 \"",
+ "float" : "%f",
+ "int" : "%d",
+ "double" : "%lf",
+ "int64_t" : "%\" PRId64 \"",
+ "uint16_t" : "%u",
+ "char" : "%c",
+ "size_t" : "%zu"
+ }
+
+ def printBaseTypes(self):
+ for baseType in self.baseTypeDict:
+ temp = printVal
+ temp = printVal.replace("@name", baseType)
+ temp = temp.replace("FORMAT", self.baseTypeDict[baseType])
+ write(temp, file=self.outFile)
+
+ def genStructExtensionCode(self):
+ code = ""
+ code += "void dumpPNextChain(const void* pNext) {\n"
+ code += " VkBaseInStructure *pBase = (VkBaseInStructure*)pNext;\n"
+ code += " if (pNext) {\n"
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"\\\"pNext\\\":\\n\");\n"
+ code += " switch (pBase->sType) {\n"
+
+ typesList = self.registry.reg.findall('types')
+ currentExtension = "VK_VERSION_1_0"
+ for types in typesList:
+ typeList = types.findall("type")
+ for type in typeList:
+ if type.get('category') == 'struct' and type.get('structextends') is not None and type.get('name') in self.vkscFeatureList:
+ members = type.findall('member')
+ for m in members:
+ n = type.get('name')
+ if m.get('values'):
+ if n in self.featureDict and currentExtension != self.featureDict[n]:
+ if currentExtension != "VK_VERSION_1_0":
+ code += "#endif\n"
+ currentExtension = self.featureDict[n]
+ if self.featureDict[n] != "VK_VERSION_1_0":
+ code += "#ifdef %s\n" %(currentExtension)
+ code += " case %s:" %(m.get('values'))
+ code += "print_%s(((%s *)pNext), \"%s\", 1);\n" %(n, n, n)
+ code += " break;\n"
+
+ if currentExtension != "VK_VERSION_1_0":
+ code += "#endif\n"
+ code += " default: assert(!\"No structure type matching!\");\n"
+ code += " }\n"
+ code += " }\n"
+ code += " }\n"
+
+ return code
+
+ def createvkscFeatureList(self):
+ for feature in self.registry.reg.findall('feature'):
+ if feature.get('api').find('vulkansc') != -1:
+ # Remove entries that are removed in features in VKSC profile.
+ requiredList = feature.findall("require")
+
+ for requiredItem in requiredList:
+ typeList = requiredItem.findall("type")
+ for typeName in typeList:
+ if typeName.get("name") != "":
+ self.featureDict[typeName.get("name")] = feature.get("name")
+ self.vkscFeatureList.append(typeName.get("name"))
+
+ removeItemList = feature.findall("remove")
+ for removeItem in removeItemList:
+ removeTypes = removeItem.findall("type")
+ for item in removeTypes:
+ if self.vkscFeatureList.count(item.get("name")) > 0:
+ self.vkscFeatureList.remove(item.get("name"))
+
+ allExtensions = self.registry.reg.findall('extensions')
+ for extensions in allExtensions:
+ extensionList = extensions.findall("extension")
+ for extension in extensionList:
+ if extension.get("supported").find("vulkansc") != -1:
+ requiredList = extension.findall("require")
+ for requiredItem in requiredList:
+ typeList = requiredItem.findall("type")
+ for typeName in typeList:
+ self.featureDict[typeName.get("name")] = extension.get("name")
+ self.vkscFeatureList.append(typeName.get("name"))
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+ self.createvkscFeatureList()
+
+ write(copyright, file=self.outFile)
+ write(predefinedCode, file=self.outFile)
+ self.printBaseTypes()
+
+ write(self.genStructExtensionCode(), file=self.outFile)
+
+ def endFile(self):
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ OutputGenerator.beginFeature(self, interface, emit)
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+
+ def endFeature(self):
+ if self.emit:
+ if self.feature_not_empty:
+ if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
+
+ for section in self.TYPE_SECTIONS:
+ contents = self.sections[section]
+ if contents:
+ write('\n'.join(contents), file=self.outFile)
+
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def appendSection(self, section, text, extension):
+ if extension != "VK_VERSION_1_0":
+ self.sections[section].append("#ifdef %s" %(extension))
+ self.sections[section].append(text)
+ self.feature_not_empty = True
+ if extension != "VK_VERSION_1_0":
+ self.sections[section].append("#endif")
+
+ def genEnumData(self, name, obj):
+ code = ""
+ code += " if (strncmp(str, \"\", 255)) vk_json_printf(_OUT, \"\\\"%s\\\" : \", str);\n"
+ code += " vk_json_printf(_OUT, \"\\\"%%s\\\"%%s\\n\", %s_map(*%sobj), commaNeeded ? \",\" : \"\");\n" %(name, obj)
+ return code
+
+ def genEnumCode(self, name):
+ code = ""
+ code += "void print_%s(const %s* obj, const char* str, int commaNeeded) {\n" %(name, name)
+ code += " PRINT_SPACE\n"
+ code += self.genEnumData(name, "")
+ code += "}\n"
+
+ return code
+
+ def genBasetypeCode(self, str1, str2, name, baseType):
+ code = ""
+ code += "void print_" + name + "(" + str1 + name + str2 + " const char* str, int commaNeeded) {\n"
+ code += " PRINT_SPACE\n"
+ if name == "VkBool32":
+ code += " vk_json_printf(_OUT, \"\\\"%s\\\" : \\\"%s\\\"%s\\n\", str, (*obj == 0) ? (\"VK_FALSE\") : (\"VK_TRUE\"), commaNeeded ? \",\" : \"\");\n"
+ else:
+ code += " vk_json_printf(_OUT, \"\\\"%s\\\" : \\\"" + self.baseTypeDict[baseType] + "\\\"%s\\n\", str, *obj, commaNeeded ? \",\" : \"\");\n"
+ code += "}\n"
+ return code
+
+ def genHandleCode(self, str1, str2, name):
+ code = ""
+ code += "void print_%s(%s%s%s const char* str, int commaNeeded) {\n" %(name, str1, name, str2)
+ code += " (void)%s;\n" %(str2[:-1])
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"\\\"%s\\\"%s\\n\", str, commaNeeded ? \",\" : \"\");\n"
+ code += "}\n"
+ return code
+
+ def genBitmaskCode(self, str1, str2, name, mapName):
+ if mapName is not None:
+ code = ""
+ code += "void print_%s(%s%s%s const char* str, int commaNeeded) {\n" %(name, str1, name, str2)
+ code += " const unsigned int max_bits = 64; \n"
+ code += " unsigned int _count = 0;\n"
+ code += " unsigned int checkBit = 1;\n"
+ code += " unsigned int i = 0;\n"
+ code += " unsigned int bitCount = 0;\n"
+ code += " unsigned int n = *obj;\n"
+ code += " unsigned int b = *obj;\n"
+ code += " unsigned int res = 0;\n"
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"\\\"%s\\\" : \", str);\n"
+ code += " while (n) {\n"
+ code += " n &= (n-1);\n"
+ code += " _count++;\n"
+ code += " }\n"
+ code += " vk_json_printf(_OUT, \"\\\"\");\n"
+ code += " if (*obj == 0) vk_json_printf(_OUT, \"0\");\n"
+ #We need bitpos here, so just iterate fully.
+ code += " for (i = 0, bitCount = 0; i < max_bits; i++, checkBit <<= 1) {\n"
+ code += " res = b & checkBit;\n"
+ code += " if (res) {\n"
+ code += " bitCount++;\n"
+ code += " if (bitCount < _count) {\n"
+ code += " vk_json_printf(_OUT, \"%%s | \", %s_map(1<<i));\n" %(mapName)
+ code += " } else {\n"
+ code += " vk_json_printf(_OUT, \"%%s\", %s_map(1<<i));\n" %(mapName)
+ code += " }\n"
+ code += " }\n"
+ code += " }\n"
+ code += " vk_json_printf(_OUT, \"\\\"%s\\n\", commaNeeded ? \",\" : \"\");\n"
+ code += "}\n"
+
+ else:
+ code = ""
+ code += "void print_%s(%s%s%s const char* str, int commaNeeded) {\n" %(name, str1, name, str2)
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"\\\"%s\\\" : \\\"%d\\\"%s\\n\", str, (int)(*obj), commaNeeded ? \",\" : \"\");\n"
+ code += "}\n"
+
+ return code
+
+ def genType(self, typeinfo, name, alias):
+ OutputGenerator.genType(self, typeinfo, name, alias)
+ typeElem = typeinfo.elem
+ body = ""
+
+ category = typeElem.get('category')
+ if category == 'funcpointer':
+ section = 'struct'
+ else:
+ section = category
+
+ extension = "VK_VERSION_1_0"
+ if (name in self.featureDict):
+ extension = self.featureDict[name]
+
+ if category in ('struct', 'union'):
+ self.genStruct(typeinfo, name, alias)
+ else:
+ if typeElem.get('category') == 'bitmask':
+ for elem in typeElem:
+ if elem.tag == 'name':
+ body += self.genBitmaskCode("const ", " * obj,", elem.text, typeElem.get('requires'))
+
+ elif typeElem.get('category') == 'basetype':
+ body += self.genBasetypeCode("const ", " * obj,", typeElem.find('name').text, typeElem.find('type').text)
+
+ elif typeElem.get('category') == 'handle':
+ for elem in typeElem:
+ if elem.tag == 'name':
+ body += self.genHandleCode("const ", " * obj,", elem.text)
+ if body:
+ self.appendSection(section, body, extension)
+
+ def paramIsStruct(self, memberType):
+ if str(self.getTypeCategory(memberType)) == 'struct':
+ return 1
+ return 0
+
+ # Helper taken from the validation layers code.
+ def paramIsPointer(self, param):
+ ispointer = False
+ for elem in param:
+ if elem.tag == 'type' and elem.tail is not None and '*' in elem.tail:
+ ispointer = True
+ return ispointer
+
+ # Helper taken from the validation layers code.
+ def paramIsStaticArray(self, param):
+ isstaticarray = 0
+ paramname = param.find('name')
+ if (paramname.tail is not None) and ('[' in paramname.tail) and (']' in paramname.tail):
+ isstaticarray = paramname.tail.count('[')
+ if isstaticarray:
+ arraySize = paramname.tail[1]
+
+ if isstaticarray:
+ return arraySize
+ else:
+ return 0
+
+ def generateStructMembercode(self, param, str1, str2, str3, str4, memberName, typeName, isCommaNeeded):
+ length = ""
+ code = ""
+ comma = "," if isCommaNeeded else ""
+ isArr = param.get('len') is not None
+
+ if param.get('len') is not None:
+ length = str2 + param.get('len')
+
+ if re.search(r'\d', length) is None: derefPtr = "*"
+ else: derefPtr = ""
+
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"\\\"%s\\\" :\");\n" %(memberName)
+
+ if self.paramIsPointer(param): code += str4 + memberName + ") {\n"
+ else: code += " {\n"
+ if isArr: code += " unsigned int i = 0;\n"
+ code += " vk_json_printf(_OUT, \"\\n\");\n"
+
+ # TODO: With some tweak, we can use the genArrayCode() here.
+ if isArr is True:
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"[\\n\");\n"
+ code += " for (i = 0; i < %s(%s); i++) {\n" %(derefPtr, length)
+ code += " if (i+1 == %s(%s))\n" %(derefPtr, length)
+ code += " print_%s(%s%s[i], \"%s\", 0);\n" %(typeName, str2, memberName, memberName)
+ code += " else\n"
+ code += " print_%s(%s%s[i], \"%s\", 1);\n" %(typeName, str2, memberName, memberName)
+ code += " }\n"
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"]%s\\n\");\n" % comma
+ code += " }\n"
+ elif self.paramIsPointer(param):
+ code += " print_%s(*(%s%s), \"%s\", %s);\n" %(typeName, str2, memberName, memberName, str(isCommaNeeded))
+ code += " }\n"
+
+ else:
+ code += " print_%s(%s%s, \"%s\", %s);\n" %(typeName, str2, memberName, memberName, str(isCommaNeeded))
+ code += " }\n"
+
+ if self.paramIsPointer(param):
+ code += " else \n"
+ code += " {\n"
+ code += " vk_json_printf(_OUT, \" \\\"NULL\\\"%s\\n\");\n" % comma
+ code += " }\n"
+
+ return code
+
+ def genPNextCode(self, str2):
+ code = ""
+ code += " if (obj->pNext) {\n"
+ code += " dumpPNextChain(obj->pNext);\n"
+ code += " } else {\n"
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"\\\"pNext\\\" : \\\"NULL\\\",\\n\");\n"
+ code += " }\n"
+
+ return code
+
+ # TODO: This may need to be relaxed in the schema. The schema could say array of integers,
+ # but we will print the extra strings to show them
+ def genArrayCode(self, name, typeName, str2, arraySize, needStrPrint, isCommaNeeded):
+ comma = "," if isCommaNeeded else ""
+ code = ""
+ printStr = "\"\""
+ arraySize = arraySize.replace(')', '')
+ derefPtr = "*"
+ if arraySize.find("VK") != -1 or re.search(r'\d', arraySize) is not None:
+ derefPtr = ""
+
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"\\\"%s\\\" :\");\n" %(name)
+ code += " if (obj->%s) {\n" %(name)
+ code += " bool isCommaNeeded = false;\n"
+ code += " unsigned int i = 0;\n"
+ code += " vk_json_printf(_OUT, \"\\n\"); PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"[\\n\");\n"
+ code += " for (i = 0; i < %s(%s); i++) {\n" %(derefPtr, arraySize)
+ code += " char tmp[100];\n"
+
+ # Special case handling for giving unique names for pImmutableSamplers if there are multiple
+ # bindings in the same Descriptor set layout.
+ if name == "pImmutableSamplers":
+ code += " sprintf(tmp, \"%s_%%u_%%u\", *(%sbinding), i);\n" %(name, str2)
+ else:
+ code += " sprintf(tmp, \"%s_%%u\", i);\n" %(name)
+
+ code += " INDENT(4);\n"
+ code += " isCommaNeeded = (i+1) != %s(%s);\n" %(derefPtr, arraySize)
+ if str(self.getTypeCategory(typeName)) == 'handle':
+ code += " print_%s(%s%s[i], tmp, isCommaNeeded);\n" %(typeName, str2, name)
+ elif not typeName.startswith("Std"):
+ code += " print_%s(%s%s[i], %s, isCommaNeeded);\n" %(typeName, str2, name, printStr)
+ code += " INDENT(-4);\n"
+ code += " }\n"
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"]%s\\n\");\n" %(comma)
+ code += " } else {\n"
+ code += " vk_json_printf(_OUT, \" \\\"NULL\\\"%s\\n\");\n" %(comma)
+ code += " }\n"
+
+ return code
+
+ # Prints out member name followed by empty string.
+ def genEmptyCode(self, memberName, isCommaNeeded):
+ comma = "," if isCommaNeeded else ""
+ code = ""
+ code += " /** Note: printing just an empty entry here **/\n"
+ code += " PRINT_SPACE"
+ code += " vk_json_printf(_OUT, \"\\\"%s\\\" : \\\"\\\"%s\\n\");\n" %(memberName, comma)
+
+ return code
+
+ def genStructCode(self, param, str1, str2, str3, str4, structName, isCommaNeeded):
+ code = ""
+ memberName = ""
+ typeName = ""
+
+ for elem in param:
+ if elem.text.find('PFN_') != -1:
+ return " /** Note: Ignoring function pointer (%s). **/\n" %(elem.text)
+
+ if elem.text == 'pNext':
+ return self.genPNextCode(str2)
+
+ if elem.tag == 'name':
+ memberName = elem.text
+
+ if elem.tag == 'type':
+ typeName = elem.text
+
+ # Some arrays have constant sizes.
+ if elem.text.find("VK_") != -1:
+ return self.genArrayCode(memberName, typeName, str2, elem.text, False, isCommaNeeded)
+
+ if self.paramIsStaticArray(param):
+ return self.genArrayCode(memberName, typeName, str2, self.paramIsStaticArray(param), False, isCommaNeeded)
+
+ # If the struct's member is another struct, we need a different way to handle.
+ elif self.paramIsStruct(typeName) == 1:
+ code += self.generateStructMembercode(param, str1, str2, str3, str4, memberName, typeName, isCommaNeeded)
+
+ # Ignore void* data members
+ elif self.paramIsPointer(param) and typeName == 'void':
+ return " /** Note: Ignoring void* data. **/\n"
+
+ # Handle C style strings
+ elif self.paramIsPointer(param) and param.get('len') is not None and param.get('len').find('null-terminated') != -1:
+ code = " /** Printing string inline. **/\n"
+ code += " PRINT_SPACE\n"
+ code += " vk_json_printf(_OUT, \"\\\"%s\\\" : \\\"%%s\\\",\\n\", (char*)obj->%s);\n" %(memberName, memberName)
+ return code
+
+ #TODO: Handle this path.
+ elif self.paramIsPointer(param) and param.get('len') is not None and param.get('len').find('latexmath') != -1:
+ code = " /** Skipping %s. **/\n" %(typeName)
+
+ # For pointers where we have the 'len' field, dump them as arrays.
+ elif self.paramIsPointer(param) and param.get('len') is not None and param.get('len').find('null-terminated') == -1 and param.get('len').find('latexmath') == -1:
+ return self.genArrayCode(memberName, typeName, str2, str2+param.get('len')+")", False, isCommaNeeded)
+
+ # If a struct member is just a handle.
+ elif str(self.getTypeCategory(typeName)) == 'handle':
+ return self.genEmptyCode(memberName, isCommaNeeded)
+
+ elif not typeName.startswith("Std"):
+ code += " print_%s(%s%s, \"%s\", %s);\n" %(typeName, str2, memberName, memberName, str(isCommaNeeded))
+
+ return code
+
+ def genStruct(self, typeinfo, typeName, alias):
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+ body = ""
+ typeElem = typeinfo.elem
+
+ extension = "VK_VERSION_1_0"
+ if (typeName in self.featureDict):
+ extension = self.featureDict[typeName]
+
+ if alias:
+ body = 'typedef ' + alias + ' ' + typeName + ';\n'
+ else:
+ # The code here is similar to the hpp generator. Hence maintaining similar form.
+ genStr1 = ["const "]
+ genStr2 = ["&obj->" ]
+ genStr3 = [" * obj, const char* s, int commaNeeded) {"]
+ genStr4 = [" if (obj->"]
+
+ for index in range(len(genStr1)):
+ body += "void print_%s(%s%s%s\n" %(typeName, genStr1[index], typeName, genStr3[index])
+ body += " (void)s;\n"
+ body += " PRINT_SPACE\n"
+ body += " vk_json_printf(_OUT, \"{\\n\");\n"
+ body += " INDENT(4);\n"
+ body += "\n"
+ count = 0
+ numMembers = len(typeElem.findall('.//member'))
+
+ isCommaNeeded = 1
+ for member in typeElem.findall('.//member'):
+ count = count + 1
+ if count == numMembers:
+ isCommaNeeded = 0
+
+ body += self.genStructCode(member, genStr1[index], genStr2[index], genStr3[index], genStr4[index], typeName, isCommaNeeded)
+ body += "\n"
+
+ body += " INDENT(-4);\n"
+ body += " PRINT_SPACE\n"
+ body += " vk_json_printf(_OUT, \"}%s\\n\", commaNeeded ? \",\" : \"\");\n"
+ body += "}\n"
+
+ self.appendSection('struct', body, extension)
+
+ def genGroup(self, groupinfo, groupName, alias=None):
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+ groupElem = groupinfo.elem
+ body = ""
+ section = 'enum'
+
+ extension = "VK_VERSION_1_0"
+ if (groupName in self.featureDict):
+ extension = self.featureDict[groupName]
+ enumType = "uint32_t"
+ bitStr = "1u"
+ if groupElem.get('bitwidth') and (int(groupElem.get('bitwidth')) == 64):
+ enumType = "uint64_t"
+ bitStr = "1ull"
+
+ body += "static const char* %s_map(%s o) {\n" %(groupName, enumType)
+ body += "switch (o) {\n"
+ enums = groupElem.findall('enum')
+
+ for enum in enums:
+ # Avoid having duplicates.
+ if enum.get('name') not in self.enumNames:
+ self.enumNames.append(enum.get('name'))
+
+ if enum.get('value'):
+ body += " case %s: return \"%s\";\n" %(enum.get('value'), enum.get('name'))
+
+ elif enum.get('bitpos'):
+ body += " case (%s << %s): return \"%s\";\n" %(bitStr, enum.get('bitpos'), enum.get('name'))
+
+ #TODO: Some enums have no offset. How to handle those?
+ elif enum.get('extends') and enum.get("extnumber") and enum.get("offset"):
+ extNumber = int(enum.get("extnumber"))
+ offset = int(enum.get("offset"))
+ enumVal = self.extBase + (extNumber - 1) * self.extBlockSize + offset
+ body += " case %s: return \"%s\";\n" %(str(enumVal), enum.get('name'))
+
+ body += " }\n"
+ body += " return NULL;\n";
+ body += "}\n"
+ body += self.genEnumCode(groupName)
+
+ self.appendSection(section, body, extension)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_generator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_generator.py
new file mode 100644
index 00000000000..596afb56c8a
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_generator.py
@@ -0,0 +1,982 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Description:
+# -----------
+# This script generates a .hpp file that can be included in an application
+# to generate json data that can then be used to generate the pipeline cache.
+
+import os
+import re
+from generator import (GeneratorOptions, OutputGenerator, noneStr,
+ regSortFeatures, write)
+
+copyright = """
+/*
+ * Copyright (c) 2021 The Khronos Group 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.
+ *
+ *//*!
+ * \\file
+ * \\brief Defines JSON generators for Vulkan structures
+ */
+"""
+
+predefinedCode = """
+/********************************************************************************************/
+/** This code is generated. To make changes, please modify the scripts or the relevant xml **/
+/********************************************************************************************/
+
+#include <iostream>
+#include <map>
+#include <bitset>
+#include <functional>
+#include <sstream>
+#include <cassert>
+#include <cmath>
+#ifndef VULKAN_JSON_CTS
+ #include <vulkan/vulkan.h>
+#endif
+
+#ifdef _WIN32
+ #ifndef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
+ #endif
+ #define VC_EXTRALEAN
+ #define NOMINMAX
+ #include <windows.h>
+#endif
+
+namespace vk_json {
+
+static thread_local int s_num_spaces = 0;
+static thread_local std::stringstream _string_stream;
+
+static void dumpPNextChain(const void* pNext);
+
+// By default, redirect to std::cout. Can stream it to a stringstream if needed.
+//#define _OUT std::cout
+#define _OUT _string_stream
+
+// Helper utility to do indentation in the generated json file.
+#define PRINT_SPACE for (int k = 0; k < s_num_spaces; k++) _OUT << \" \";
+
+#define INDENT(sz) s_num_spaces += (sz);
+
+#define PRINT_VAL(c) PRINT_SPACE \\
+ if (s != "") {\\
+ _OUT << \"\\\"\" << s << \"\\\"\" << \" : \" << o << (c ? \",\" : \"\") << std::endl; \\
+ } else {\\
+ _OUT << o << (c ? \",\" : \"\") << std::endl; \\
+ }
+
+#define PRINT_STR(c) PRINT_SPACE \\
+ if (s != "") {\\
+ _OUT << \"\\\"\" << s << \"\\\"\" << \" : " << \"\\\"\" << o << \"\\\"\" << (c ? \",\" : \"\") << std::endl; \\
+ } else {\\
+ _OUT << \"\\\"\" << o << \"\\\"\" << (c ? \",\" : \"\") << std::endl; \\
+ }
+
+// To make sure the generated data is consistent across platforms,
+// we typecast to 32-bit and dump the data.
+// The value is not expected to exceed the range.
+static void print_size_t(const size_t* o, const std::string& s, bool commaNeeded=true)
+{
+ PRINT_SPACE
+ _OUT << \"\\\"\" << s << \"\\\"\" << \" : \" << static_cast<%s>(*o) << (commaNeeded ? \",\" : \"\") << std::endl;\\
+}
+static void print_size_t(size_t o, const std::string& s, bool commaNeeded=true)
+{
+ PRINT_SPACE
+ _OUT << \"\\\"\" << s << \"\\\"\" << \" : \" << static_cast<%s>(o) << (commaNeeded ? \",\" : \"\") << std::endl;\\
+}
+"""
+
+headerGuardTop = """#ifndef _VULKAN_JSON_DATA_HPP
+#define _VULKAN_JSON_DATA_HPP
+"""
+
+headerGuardBottom = """#endif // _VULKAN_JSON_DATA_HPP"""
+
+encodeBase64CodeCTS = """
+// Base 64 formatter class from executor/xeTestLogWriter.cpp
+
+class Base64Formatter
+{
+public:
+ const deUint8* data;
+ int numBytes;
+
+ Base64Formatter(const deUint8* data_, int numBytes_) : data(data_), numBytes(numBytes_) {}
+};
+
+std::ostream& operator<< (std::ostream& str, const Base64Formatter& fmt)
+{
+ static const char s_base64Table[64] =
+ {
+ 'A','B','C','D','E','F','G','H','I','J','K','L','M',
+ 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
+ 'a','b','c','d','e','f','g','h','i','j','k','l','m',
+ 'n','o','p','q','r','s','t','u','v','w','x','y','z',
+ '0','1','2','3','4','5','6','7','8','9','+','/'
+ };
+
+ const deUint8* data = fmt.data;
+ int numBytes = fmt.numBytes;
+ int srcNdx = 0;
+
+ DE_ASSERT(data && (numBytes > 0));
+
+ /* Loop all input chars. */
+ while (srcNdx < numBytes)
+ {
+ int numRead = de::min(3, numBytes - srcNdx);
+ deUint8 s0 = data[srcNdx];
+ deUint8 s1 = (numRead >= 2) ? data[srcNdx + 1] : 0;
+ deUint8 s2 = (numRead >= 3) ? data[srcNdx + 2] : 0;
+ char d[4];
+
+ srcNdx += numRead;
+
+ d[0] = s_base64Table[s0 >> 2];
+ d[1] = s_base64Table[((s0 & 0x3) << 4) | (s1 >> 4)];
+ d[2] = s_base64Table[((s1 & 0xF) << 2) | (s2 >> 6)];
+ d[3] = s_base64Table[s2 & 0x3F];
+
+ if (numRead < 3) d[3] = '=';
+ if (numRead < 2) d[2] = '=';
+
+ /* Write data. */
+ str.write(&d[0], sizeof(d));
+ }
+
+ return str;
+}
+
+inline Base64Formatter toBase64(const deUint8* bytes, int numBytes) {return Base64Formatter(bytes, numBytes); }
+
+static void print_void_data(const void * o, int oSize, const std::string& s, bool commaNeeded=true)
+{
+ if (o != NULL && oSize != 0)
+ {
+ PRINT_SPACE _OUT << "\\\"" << s << "\\\"" << " : " << "\\\"" << toBase64((deUint8*)o, oSize) << "\\\"" << (commaNeeded ? "," : "") << std::endl;
+ }
+ else
+ {
+ PRINT_SPACE _OUT << "\\\"" << s << "\\\"" << " : " << "\\\"NULL\\\"" << (commaNeeded ? "," : "") << std::endl;
+ }
+}
+"""
+encodeBase64Code = """
+// Base 64 formatter class from executor/xeTestLogWriter.cpp
+
+class Base64Formatter
+{
+public:
+ const uint8_t* data;
+ int numBytes;
+
+ Base64Formatter(const uint8_t* data_, int numBytes_) : data(data_), numBytes(numBytes_) {}
+};
+
+std::ostream& operator<< (std::ostream& str, const Base64Formatter& fmt)
+{
+ static const char s_base64Table[64] =
+ {
+ 'A','B','C','D','E','F','G','H','I','J','K','L','M',
+ 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
+ 'a','b','c','d','e','f','g','h','i','j','k','l','m',
+ 'n','o','p','q','r','s','t','u','v','w','x','y','z',
+ '0','1','2','3','4','5','6','7','8','9','+','/'
+ };
+
+ const uint8_t* data = fmt.data;
+ int numBytes = fmt.numBytes;
+ int srcNdx = 0;
+
+ assert(data && (numBytes > 0));
+
+ /* Loop all input chars. */
+ while (srcNdx < numBytes)
+ {
+ #undef min
+ int numRead = std::min(3, numBytes - srcNdx);
+ uint8_t s0 = data[srcNdx];
+ uint8_t s1 = (numRead >= 2) ? data[srcNdx + 1] : 0;
+ uint8_t s2 = (numRead >= 3) ? data[srcNdx + 2] : 0;
+ char d[4];
+
+ srcNdx += numRead;
+
+ d[0] = s_base64Table[s0 >> 2];
+ d[1] = s_base64Table[((s0 & 0x3) << 4) | (s1 >> 4)];
+ d[2] = s_base64Table[((s1 & 0xF) << 2) | (s2 >> 6)];
+ d[3] = s_base64Table[s2 & 0x3F];
+
+ if (numRead < 3) d[3] = '=';
+ if (numRead < 2) d[2] = '=';
+
+ /* Write data. */
+ str.write(&d[0], sizeof(d));
+ }
+
+ return str;
+}
+
+inline Base64Formatter toBase64(const uint8_t* bytes, int numBytes) {return Base64Formatter(bytes, numBytes); }
+
+static void print_void_data(const void * o, int oSize, const std::string& s, bool commaNeeded=true)
+{
+ if (o != NULL && oSize != 0)
+ {
+ PRINT_SPACE _OUT << "\\\"" << s << "\\\"" << " : " << "\\\"" << toBase64((uint8_t*)o, oSize) << "\\\"" << (commaNeeded ? "," : "") << std::endl;
+ }
+ else
+ {
+ PRINT_SPACE _OUT << "\\\"" << s << "\\\"" << " : " << "\\\"NULL\\\"" << (commaNeeded ? "," : "") << std::endl;
+ }
+}
+"""
+
+class JSONGeneratorOptions(GeneratorOptions):
+ """JSONGeneratorOptions - subclass of GeneratorOptions.
+
+ Adds options used by JSONOutputGenerator objects during C language header
+ generation."""
+
+ def __init__(self,
+ prefixText="",
+ genFuncPointers=True,
+ protectFile=True,
+ protectFeature=True,
+ protectProto=None,
+ protectProtoStr=None,
+ apicall='',
+ apientry='',
+ apientryp='',
+ isCTS = False,
+ indentFuncProto=True,
+ indentFuncPointer=False,
+ alignFuncParam=0,
+ genEnumBeginEndRange=False,
+ genAliasMacro=False,
+ aliasMacro='',
+ vulkanLayer=False,
+ **kwargs
+ ):
+
+ GeneratorOptions.__init__(self, **kwargs)
+ self.isCTS = isCTS
+
+ self.vulkanLayer = vulkanLayer
+
+class JSONOutputGenerator(OutputGenerator):
+ # This is an ordered list of sections in the header file.
+ TYPE_SECTIONS = ['basetype', 'handle', 'enum',
+ 'group', 'bitmask', 'struct']
+ ALL_SECTIONS = TYPE_SECTIONS
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Internal state - accumulators for different inner block text
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+ self.may_alias = None
+ self.vkscFeatureList = []
+ self.vkFeatureLayerList = []
+
+ # Fills in some extensions for exclusion while generating code for layer.
+ self.vkLayerNotReqList = set([""])
+
+ self.platformList = ["xlib",
+ "xlib_xrandr",
+ "xcb",
+ "wayland",
+ "directfb",
+ "android",
+ "win32",
+ "vi",
+ "ios",
+ "macos",
+ "metal",
+ "fuchsia",
+ "ggp",
+ "QNX",
+ "provisional"]
+ self.baseTypeList = ["int32_t",
+ "uint32_t",
+ "uint8_t",
+ "uint64_t",
+ "float",
+ "int",
+ "double",
+ "int64_t",
+ "uint16_t",
+ "char"]
+
+ def printBaseTypes(self):
+ for baseType in self.baseTypeList:
+ printStr = " PRINT_VAL(commaNeeded)\n"
+
+ # Some special handling needed here.
+ if baseType == 'char':
+ write("static void print_%s(const %s * const* o, const std::string& s, bool commaNeeded=true)\n" %(baseType, self.baseTypeListMap[baseType]) +
+ "{\n" +
+ " PRINT_STR(commaNeeded)\n" +
+ "}\n"
+ , file=self.outFile
+ )
+
+ if self.isCTS and baseType == "float":
+ printStr = " if (std::isnan(o))\n"
+ printStr +=" {\n"
+ printStr +=" PRINT_SPACE\n"
+ printStr +=" if (s != \"\")\n"
+ printStr +=" _OUT << \"\\\"\" << s << \"\\\"\" << \" : \\\"NaN\\\"\" << (commaNeeded ? \",\" : \"\") << std::endl;\n"
+ printStr +=" else\n"
+ printStr +=" _OUT << \"\\\"NaN\\\"\" << (commaNeeded ? \",\" : \"\") << std::endl;\n"
+ printStr +=" }\n"
+ printStr +=" else\n"
+ printStr +=" {\n"
+ printStr +=" PRINT_VAL(commaNeeded)\n"
+ printStr +=" }\n"
+
+ write("static void print_%s(%s o, const std::string& s, bool commaNeeded=true)\n" %(baseType, self.baseTypeListMap[baseType]) +
+ "{\n" +
+ printStr +
+ "}\n"
+ , file=self.outFile
+ )
+
+ if baseType == 'char':
+ printStr = " PRINT_STR(commaNeeded)\n"
+
+ if self.isCTS and baseType == "float":
+ printStr = " if (std::isnan(*o))\n"
+ printStr +=" {\n"
+ printStr +=" PRINT_SPACE\n"
+ printStr +=" if (s != \"\")\n"
+ printStr +=" _OUT << \"\\\"\" << s << \"\\\"\" << \" : \\\"NaN\\\"\" << (commaNeeded ? \",\" : \"\") << std::endl;\n"
+ printStr +=" else\n"
+ printStr +=" _OUT << \"\\\"NaN\\\"\" << (commaNeeded ? \",\" : \"\") << std::endl;\n"
+ printStr +=" }\n"
+ printStr +=" else\n"
+ printStr +=" {\n"
+ printStr +=" PRINT_VAL(commaNeeded)\n"
+ printStr +=" }\n"
+
+ write("static void print_%s(const %s * o, const std::string& s, bool commaNeeded=true)\n" %(baseType, self.baseTypeListMap[baseType]) +
+ "{\n" +
+ printStr +
+ "}\n"
+ , file=self.outFile
+ )
+
+ def createLayerUnusedList(self):
+ allExtensions = self.registry.reg.findall('extensions')
+ for extensions in allExtensions:
+ extensionList = extensions.findall("extension")
+ for extension in extensionList:
+ for platform in self.platformList:
+ if re.search(platform, extension.get("name"), re.IGNORECASE):
+ requiredList = extension.findall("require")
+ for requiredItem in requiredList:
+ typeList = requiredItem.findall("type")
+ for typeName in typeList:
+ if platform == "vi":
+ if re.search("NN", extension.get("name")):
+ self.vkLayerNotReqList.add(typeName.get("name"))
+ else:
+ self.vkLayerNotReqList.add(typeName.get("name"))
+ break
+
+ typesList = self.registry.reg.findall('types')
+ for types in typesList:
+ typeList = types.findall("type")
+ for type in typeList:
+ if type.get("name") != "":
+ cat = type.get("category")
+ name = type.get("name")
+ if cat in {"handle", "bitmask", "basetype", "enum", "struct"}:
+ for platform in self.platformList:
+ if re.search(platform, name, re.IGNORECASE):
+ if platform == "vi":
+ if re.search("NN", name):
+ self.vkLayerNotReqList.add(name)
+ else:
+ self.vkLayerNotReqList.add(name)
+ break
+
+
+ def createvkscFeatureList(self):
+ for feature in self.registry.reg.findall('feature'):
+ if feature.get('api').find('vulkansc') != -1:
+ # Remove entries that are removed in features in VKSC profile.
+ requiredList = feature.findall("require")
+
+ for requiredItem in requiredList:
+ typeList = requiredItem.findall("type")
+ for typeName in typeList:
+ if typeName.get("name") != "":
+ self.vkscFeatureList.append(typeName.get("name"))
+
+ removeItemList = feature.findall("remove")
+ for removeItem in removeItemList:
+ removeTypes = removeItem.findall("type")
+ for item in removeTypes:
+ if self.vkscFeatureList.count(item.get("name")) > 0:
+ self.vkscFeatureList.remove(item.get("name"))
+
+ allExtensions = self.registry.reg.findall('extensions')
+ for extensions in allExtensions:
+ extensionList = extensions.findall("extension")
+ for extension in extensionList:
+ if extension.get("supported").find("vulkansc") != -1:
+ requiredList = extension.findall("require")
+ for requiredItem in requiredList:
+ typeList = requiredItem.findall("type")
+ for typeName in typeList:
+ self.vkscFeatureList.append(typeName.get("name"))
+
+ def printPrototypesAndExtensionDump(self):
+ code = ""
+
+ code += "/*************************************** Begin prototypes ***********************************/\n"
+ if self.vulkanLayer:
+ typesList = self.registry.reg.findall('types')
+ for types in typesList:
+ typeList = types.findall("type")
+ for type in typeList:
+ if type.get("name") != "":
+ cat = type.get("category")
+ name = type.get("name")
+
+ enumList = self.registry.reg.findall('enums')
+ for enums in enumList:
+ name = enums.get("name")
+ else:
+ typesList = self.registry.reg.findall('types')
+ for types in typesList:
+ typeList = types.findall("type")
+ for type in typeList:
+ if type.get("name") != "":
+ cat = type.get("category")
+ name = type.get("name")
+
+ code += "/*************************************** End prototypes ***********************************/\n\n"
+ code += "static void dumpPNextChain(const void* pNext) {\n"
+ code += " VkBaseInStructure *pBase = (VkBaseInStructure*)pNext;\n"
+ code += " if (pNext) {\n"
+ code += " PRINT_SPACE\n"
+ code += " _OUT << \"\\\"pNext\\\":\"<< std::endl;\n\n"
+ code += " switch (pBase->sType) {\n"
+
+ for type in typeList:
+ if type.get('category') == 'struct' and type.get('structextends') is not None:
+ if (self.vulkanLayer and (type.get('name') not in self.vkLayerNotReqList)) or (not self.vulkanLayer):
+ members = type.findall('member')
+ for m in members:
+ n = type.get('name')
+ if m.get('values') and (n in self.vkFeatureLayerList):
+ code += " case %s:" %(m.get('values'))
+ code += "print_%s((%s *) pNext, \"%s\", true);\n" %(n, n, n)
+ code += " break;\n"
+
+ code += " default: assert(false); // No structure type matching\n"
+ code += " }\n"
+ code += " }\n"
+ code += " }\n"
+
+ return code
+
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ self.vulkanLayer = genOpts.vulkanLayer
+ if self.vulkanLayer:
+ self.createLayerUnusedList()
+
+ self.createvkscFeatureList()
+
+ self.isCTS = genOpts.isCTS
+
+ self.baseTypeListMap = {
+ "int32_t" : "deInt32" if self.isCTS else "int32_t",
+ "uint32_t" : "deUint32" if self.isCTS else "uint32_t",
+ "uint8_t" : "deUint8" if self.isCTS else "uint8_t",
+ "uint64_t" : "deUint64" if self.isCTS else "uint64_t",
+ "float" : "float",
+ "int" : "int",
+ "double" : "double",
+ "int64_t" : "deInt64" if self.isCTS else "int64_t",
+ "uint16_t" : "deUint16" if self.isCTS else "uint16_t",
+ "char" : "char"
+ }
+
+ write(headerGuardTop, file=self.outFile, end='')
+ write(copyright, file=self.outFile)
+ if self.isCTS:
+ write(predefinedCode % ("deUint32", "deUint32"), file=self.outFile)
+ else:
+ write(predefinedCode % ("uint32_t", "uint32_t"), file=self.outFile)
+ self.printBaseTypes()
+ if self.isCTS:
+ write(encodeBase64CodeCTS, file=self.outFile)
+ else:
+ write(encodeBase64Code, file=self.outFile)
+
+ def endFile(self):
+ write(self.printPrototypesAndExtensionDump(), file=self.outFile)
+ write("}//End of namespace vk_json\n", file=self.outFile) # end of namespace
+ write(headerGuardBottom, file=self.outFile, end='') # end of _VULKAN_JSON_DATA_HPP
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ OutputGenerator.beginFeature(self, interface, emit)
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+
+ def endFeature(self):
+ if self.emit:
+ if self.feature_not_empty:
+ if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
+
+ for section in self.TYPE_SECTIONS:
+ contents = self.sections[section]
+ if contents:
+ write('\n'.join(contents), file=self.outFile)
+
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def appendSection(self, section, text):
+ self.sections[section].append(text)
+ self.feature_not_empty = True
+
+ def genEnumData(self, name, obj):
+ code = ""
+ code += " if (str != \"\") _OUT << \"\\\"\" << str << \"\\\"\" << \" : \";\n"
+ code += " if (commaNeeded)\n"
+ code += " _OUT << \"\\\"\" << %s_map[%sobj] << \"\\\",\" << std::endl;\n" %(name, obj)
+ code += " else\n"
+ code += " _OUT << \"\\\"\" << %s_map[%sobj] << \"\\\"\" << std::endl;\n" %(name, obj)
+ return code
+
+ def genEnumCode(self, name):
+ code = ""
+ code += "static void print_%s(%s obj, const std::string& str, bool commaNeeded=true) {\n" %(name, name)
+ code += " PRINT_SPACE\n"
+ code += self.genEnumData(name, "")
+ code += "}\n"
+
+ code += "static void print_%s(const %s * obj, const std::string& str, bool commaNeeded=true) {\n" %(name, name)
+ code += " PRINT_SPACE\n"
+ code += self.genEnumData(name, "*")
+ code += "}\n"
+
+ return code
+
+ def genBasetypeCode(self, str1, str2, name):
+ code = ""
+ code += "static void print_" + name + "(" + str1 + name + str2 + " const std::string& str, bool commaNeeded=true) {\n"
+ code += " PRINT_SPACE\n"
+ if name == "VkBool32":
+ code += " _OUT << \"\\\"\" << str << \"\\\"\" << \" : \" << \"\\\"\" << ((obj == 0) ? (\"VK_FALSE\") : (\"VK_TRUE\")) << \"\\\"\" << (commaNeeded ? \",\" : \"\") << std::endl;\n"
+ else:
+ code += " _OUT << \"\\\"\" << str << \"\\\"\" << \" : \" << \"\\\"\" << obj << \"\\\"\" << (commaNeeded ? \",\" : \"\") << std::endl;\n"
+ code += "}\n"
+ return code
+
+ def genHandleCode(self, str1, str2, name):
+ code = ""
+ code += "static void print_%s(%s%s%s const std::string& str, bool commaNeeded=true) {\n" %(name, str1, name, str2)
+ code += " PRINT_SPACE\n"
+ code += " if (commaNeeded)\n"
+ code += " _OUT << \"\\\"\" << str << \"\\\"\" << \",\" << std::endl;\n"
+ code += " else\n"
+ code += " _OUT << \"\\\"\" << str << \"\\\"\" << std::endl;\n"
+ code += "}\n"
+ return code
+
+ def genBitmaskCode(self, str1, str2, name, mapName):
+ if mapName is not None:
+ code = ""
+ code += "static void print_%s(%s%s%s const std::string& str, bool commaNeeded=true) {\n" %(name, str1, name, str2)
+ code += " PRINT_SPACE\n"
+ code += " if (str != \"\") _OUT << \"\\\"\" << str << \"\\\"\" << \" : \";\n"
+ code += " const int max_bits = 64; // We don't expect the number to be larger.\n"
+ code += " std::bitset<max_bits> b(obj);\n"
+ code += " _OUT << " + "\"\\\"\"" + ";\n"
+ code += " if (obj == 0) _OUT << \"0\";\n"
+ code += " for (unsigned int i = 0, bitCount = 0; i < b.size(); i++) {\n"
+ code += " if (b[i] == 1) {\n"
+ code += " bitCount++;\n"
+ code += " if (bitCount < b.count())\n"
+ code += " _OUT << %s_map[1ULL<<i] << \" | \";\n" %(mapName)
+ code += " else\n"
+ code += " _OUT << %s_map[1ULL<<i];\n" %(mapName)
+ code += " }\n"
+ code += " }\n"
+ code += " if (commaNeeded)\n"
+ code += " _OUT << \"\\\"\" << \",\";\n"
+ code += " else\n"
+ code += " _OUT << \"\\\"\"<< \"\";\n"
+ code += " _OUT << std::endl;\n"
+ code += "}\n"
+
+ else:
+ code = ""
+ code += "static void print_%s(%s%s%s const std::string& str, bool commaNeeded=true) {\n" %(name, str1, name, str2)
+ code += " PRINT_SPACE\n"
+ code += " if (commaNeeded)\n"
+ code += " _OUT << \"\\\"\" << str << \"\\\"\" << \" : \" << obj << \",\" << std::endl;\n"
+ code += " else\n"
+ code += " _OUT << \"\\\"\" << str << \"\\\"\" << \" : \" << obj << std::endl;\n"
+ code += "}\n"
+
+ return code
+
+ def genType(self, typeinfo, name, alias):
+ OutputGenerator.genType(self, typeinfo, name, alias)
+ typeElem = typeinfo.elem
+ body = ""
+
+ self.vkFeatureLayerList.append(name);
+
+ category = typeElem.get('category')
+ if category == 'funcpointer':
+ section = 'struct'
+ else:
+ section = category
+
+ if category in ('struct', 'union'):
+ self.genStruct(typeinfo, name, alias)
+ else:
+ if typeElem.get('category') == 'bitmask':
+ for elem in typeElem:
+ if elem.tag == 'name':
+ body += self.genBitmaskCode("", " obj,", elem.text, typeElem.get('requires'))
+ body += self.genBitmaskCode("const ", " * obj,", elem.text, typeElem.get('requires'))
+
+ elif typeElem.get('category') == 'basetype':
+ for elem in typeElem:
+ if elem.tag == 'name':
+ body += self.genBasetypeCode("", " obj,", elem.text)
+ body += self.genBasetypeCode("const ", " * obj,", elem.text)
+
+ elif typeElem.get('category') == 'handle':
+ for elem in typeElem:
+ if elem.tag == 'name':
+ body += self.genHandleCode("", " obj,", elem.text)
+ body += self.genHandleCode("const ", " * obj,", elem.text)
+ if body:
+ self.appendSection(section, body)
+
+ def paramIsStruct(self, memberType):
+ if str(self.getTypeCategory(memberType)) == 'struct':
+ return 1
+ return 0
+
+ # Helper taken from the validation layers code.
+ def paramIsPointer(self, param):
+ ispointer = False
+ for elem in param:
+ if elem.tag == 'type' and elem.tail is not None and '*' in elem.tail:
+ ispointer = True
+ return ispointer
+
+ # Helper taken from the validation layers code.
+ def paramIsStaticArray(self, param):
+ isstaticarray = 0
+ paramname = param.find('name')
+ if (paramname.tail is not None) and ('[' in paramname.tail) and (']' in paramname.tail):
+ isstaticarray = paramname.tail.count('[')
+ if isstaticarray:
+ arraySize = paramname.tail[1]
+
+ if isstaticarray:
+ return arraySize
+ else:
+ return 0
+
+ def generateStructMembercode(self, param, str1, str2, str3, str4, memberName, typeName, isCommaNeeded):
+ length = ""
+ code = ""
+ isArr = param.get('len') is not None
+
+ if param.get('len') is not None:
+ length = str2 + param.get('len') + ")"
+ length = length.replace(')', '')
+ length = length.replace(',1', '')
+
+ code += " PRINT_SPACE\n"
+ code += " _OUT << \"\\\"%s\\\": \" << std::endl;\n" %(memberName)
+
+ if self.paramIsPointer(param): code += str4 + memberName + ") {\n"
+ else: code += " {\n"
+
+ # TODO: With some tweak, we can use the genArrayCode() here.
+ if isArr is True:
+ code += " PRINT_SPACE\n"
+ code += " _OUT << \"[\" << std::endl;\n"
+ code += " for (unsigned int i = 0; i < %s; i++) {\n" %(length)
+ code += " if (i+1 == %s)\n" %(length)
+ code += " print_%s(%s%s[i], \"%s\", 0);\n" %(typeName, str2, memberName, memberName)
+ code += " else\n"
+ code += " print_%s(%s%s[i], \"%s\", 1);\n" %(typeName, str2, memberName, memberName)
+ code += " }\n"
+ code += " PRINT_SPACE\n"
+ if isCommaNeeded:
+ code += " _OUT << \"],\" << std::endl;\n"
+ else:
+ code += " _OUT << \"]\" << std::endl;\n"
+ code += " }\n"
+ else:
+ if (typeName == "VkAccelerationStructureGeometryKHR"):
+ code += " print_%s(*%s%s, \"%s\", %s);\n" %(typeName, str2, memberName, memberName, str(isCommaNeeded))
+ else:
+ code += " print_%s(%s%s, \"%s\", %s);\n" %(typeName, str2, memberName, memberName, str(isCommaNeeded))
+ code += " }\n"
+
+ if self.paramIsPointer(param):
+ code += " else\n"
+ code += " {\n"
+ if isCommaNeeded:
+ code += " PRINT_SPACE _OUT << \"\\\"NULL\\\"\"<< \",\"<< std::endl;\n"
+ else:
+ code += " PRINT_SPACE _OUT << \"\\\"NULL\\\"\"<< \"\"<< std::endl;\n"
+ code += " }\n"
+
+ return code
+
+ def genPNextCode(self, str2):
+ code = ""
+ code += " if (%spNext) {\n" %(str2)
+ code += " dumpPNextChain(%spNext);\n" %(str2)
+ code += " } else {\n"
+ code += " PRINT_SPACE\n"
+ code += " _OUT << \"\\\"pNext\\\":\" << \"\\\"NULL\\\"\"<< \",\"<< std::endl;\n"
+ code += " }\n"
+
+ return code
+
+ # Prints out member name followed by empty string.
+ def genEmptyCode(self, memberName, str2, isCommaNeeded):
+ code = ""
+ if not self.isCTS:
+ code += " /** Note: printing just an empty entry here **/\n"
+ else:
+ code += " // CTS : required value\n"
+ code += " PRINT_SPACE"
+ if isCommaNeeded:
+ if self.isCTS and (memberName == "module" or memberName == "layout" or memberName == "renderPass" or memberName == "conversion"):
+ code += " _OUT << \"\\\"\" << \"%s\" << \"\\\"\" << \" : \" << %s%s.getInternal() << \",\" << std::endl;\n" %(memberName, str2, memberName)
+ else:
+ code += " _OUT << \"\\\"\" << \"%s\" << \"\\\"\" << \" : \" << \"\\\"\" << \"\\\",\" << std::endl;\n" %(memberName)
+ else:
+ if self.isCTS and (memberName == "module" or memberName == "layout" or memberName == "renderPass" or memberName == "conversion"):
+ code += " _OUT << \"\\\"\" << \"%s\" << \"\\\"\" << \" : \" << %s%s.getInternal() << std::endl;\n" %(memberName, str2, memberName)
+ else:
+ code += " _OUT << \"\\\"\" << \"%s\" << \"\\\"\" << \" : \" << \"\\\"\" << \"\\\"\" << std::endl;\n" %(memberName)
+ return code
+
+ def genArrayCode(self, structName, name, typeName, str2, arraySize, needStrPrint, isArrayType, isCommaNeeded):
+ comma = "," if isCommaNeeded else ""
+ code = ""
+ arraySize = arraySize.replace(')', '')
+ needsTmp = needStrPrint or (str(self.getTypeCategory(typeName)) == 'handle')
+
+ if needStrPrint: printStr = "tmp.str()"
+ else: printStr = "\"\""
+
+ code += " PRINT_SPACE\n"
+ code += " _OUT << \"\\\"%s\\\":\" << std::endl;\n" %(name)
+ code += " PRINT_SPACE\n"
+ if not isArrayType:
+ code += " if (%s%s) {\n" %(str2, name)
+ code += " _OUT << \"[\" << std::endl;\n"
+ code += " for (unsigned int i = 0; i < %s; i++) {\n" %(arraySize)
+ if self.isCTS and (structName == "VkPipelineLayoutCreateInfo" or structName == "VkDescriptorSetLayoutBinding"):
+ code += " bool isCommaNeeded = (i+1) != %s;\n" %(arraySize)
+ code += " if (isCommaNeeded)\n"
+ code += " {\n"
+ code += " PRINT_SPACE\n"
+ code += " _OUT << %s%s[i].getInternal() << \",\" << std::endl;\n" %(str2, name)
+ code += " }\n"
+ code += " else\n"
+ code += " {\n"
+ code += " PRINT_SPACE\n"
+ code += " _OUT << %s%s[i].getInternal() << std::endl;\n" %(str2, name)
+ code += " }\n"
+ else:
+ if needsTmp:
+ code += " std:: stringstream tmp;\n"
+
+ # Special case handling for giving unique names for pImmutableSamplers if there are multiple
+ # bindings in the same Descriptor set layout.
+ if name == "pImmutableSamplers":
+ code += " tmp << \"%s\" << \"_\" << (%sbinding) << \"_\" << i;\n" %(name, str2)
+ else:
+ code += " tmp << \"%s\" << \"_\" << i;\n" %(name)
+
+ code += " bool isCommaNeeded = (i+1) != %s;\n" %(arraySize)
+
+ if str(self.getTypeCategory(typeName)) == 'handle':
+ code += " print_%s(%s%s[i], tmp.str(), isCommaNeeded);\n" %(typeName, str2, name)
+ else:
+ if self.isCTS and name == "pipelineIdentifier":
+ code += " print_uint32_t((%s)%s%s[i], %s, isCommaNeeded);\n" %(self.baseTypeListMap["uint32_t"], str2, name, printStr)
+ else:
+ code += " print_%s(%s%s[i], %s, isCommaNeeded);\n" %(typeName, str2, name, printStr)
+ code += " }\n"
+ code += " PRINT_SPACE\n"
+ code += " _OUT << \"]\" << \"%s\" << std::endl;\n" %(comma)
+ if not isArrayType == True:
+ code += " } else {\n"
+ code += " _OUT << \"\\\"NULL\\\"\" << \"%s\" << std::endl;\n" %(comma)
+ code += " }\n"
+ return code
+
+ def genStructCode(self, param, str1, str2, str3, str4, structName, isCommaNeeded):
+ code = ""
+ memberName = ""
+ typeName = ""
+
+ for elem in param:
+ if elem.text.find('PFN_') != -1:
+ return " /** Note: Ignoring function pointer (%s). **/\n" %(elem.text)
+
+ if elem.text == 'pNext':
+ return self.genPNextCode(str2)
+
+ if elem.tag == 'name':
+ memberName = elem.text
+
+ if elem.tag == 'type':
+ typeName = elem.text
+
+ # Some arrays have constant sizes.
+ if elem.text.find("VK_") != -1:
+ return self.genArrayCode(structName, memberName, typeName, str2, elem.text, False, True, isCommaNeeded)
+
+ if self.paramIsStaticArray(param):
+ return self.genArrayCode(structName, memberName, typeName, str2, self.paramIsStaticArray(param), False, True, isCommaNeeded)
+
+ # If the struct's member is another struct, we need a different way to handle.
+ elif self.paramIsStruct(typeName) == 1:
+ code += self.generateStructMembercode(param, str1, str2, str3, str4, memberName, typeName, isCommaNeeded)
+
+ # Ignore void* data members
+ elif self.paramIsPointer(param) and typeName == 'void':
+ if structName == "VkSpecializationInfo":
+ return " print_void_data(%s%s, int(%sdataSize), \"%s\", 0);\n" %(str2, memberName, str2, memberName)
+ if self.isCTS:
+ if structName == "VkPipelineCacheCreateInfo":
+ return " print_void_data(%s%s, int(%sinitialDataSize), \"%s\", 0);\n" %(str2, memberName, str2, memberName)
+ return " /** Note: Ignoring void* data. **/\n"
+
+ # For pointers where we have the 'len' field, dump them as arrays.
+ elif self.paramIsPointer(param) and param.get('len') is not None and param.get('len').find('null-terminated') == -1 and param.get('len').find('latexmath') == -1:
+ if memberName == "versionData":
+ return self.genArrayCode(structName, memberName, typeName, str2, param.get('len')+")", False, False, isCommaNeeded)
+ else:
+ return self.genArrayCode(structName, memberName, typeName, str2, str2+param.get('len')+")", False, False, isCommaNeeded)
+
+ # Special handling for VkPipelineMultisampleStateCreateInfo::pSampleMask
+ elif typeName in "VkSampleMask":
+ code += " %s sampleMaskSize = ((%srasterizationSamples + 31) / 32);\n" % (self.baseTypeListMap["uint32_t"], str2)
+ code += self.genArrayCode(structName, memberName, "uint32_t", str2, "sampleMaskSize", False, False, isCommaNeeded)
+ return code
+
+ # If a struct member is just a handle.
+ elif str(self.getTypeCategory(typeName)) == 'handle':
+ return self.genEmptyCode(memberName, str2, isCommaNeeded)
+
+ else:
+ code += " print_%s(%s%s, \"%s\", %s);\n" %(typeName, str2, memberName, memberName, str(isCommaNeeded))
+
+ return code
+
+ def genStruct(self, typeinfo, typeName, alias):
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+ body = ""
+ typeElem = typeinfo.elem
+
+ if alias:
+ body = 'typedef ' + alias + ' ' + typeName + ';\n'
+ else:
+ genStr1 = ["" , "const "]
+ genStr2 = ["obj.", "obj->" ]
+ genStr3 = [" obj, const std::string& s, bool commaNeeded=true) {" , " * obj, const std::string& s, bool commaNeeded=true) {"]
+ genStr4 = [" if (obj.", " if (obj->"]
+
+ for index in range(len(genStr1)):
+ body += "static void print_%s(%s%s%s\n" %(typeName, genStr1[index], typeName, genStr3[index])
+ body += " PRINT_SPACE\n"
+ body += " _OUT << \"{\" << std::endl;\n"
+ body += " INDENT(4);\n"
+ body += "\n"
+ count = 0
+ numMembers = len(typeElem.findall('.//member'))
+
+ isCommaNeeded = 1
+ for member in typeElem.findall('.//member'):
+ count = count + 1
+ if count == numMembers:
+ isCommaNeeded = 0
+
+ body += self.genStructCode(member, genStr1[index], genStr2[index], genStr3[index], genStr4[index], typeName, isCommaNeeded)
+ body += "\n"
+
+ body += " INDENT(-4);\n"
+ body += " PRINT_SPACE\n"
+ body += " if (commaNeeded)\n"
+ body += " _OUT << \"},\" << std::endl;\n"
+ body += " else\n"
+ body += " _OUT << \"}\" << std::endl;\n"
+ body += "}\n"
+
+ self.appendSection('struct', body)
+
+ def genGroup(self, groupinfo, groupName, alias=None):
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+ groupElem = groupinfo.elem
+ body = ""
+ section = 'enum'
+
+ body += "static std::map<%s, std::string> %s_map = {\n" %(self.baseTypeListMap["uint64_t"], groupName)
+ enums = groupElem.findall('enum')
+
+ for enum in enums:
+ if enum.get('value'):
+ body += " std::make_pair(%s, \"%s\"),\n" %(enum.get('value'), enum.get('name'))
+
+ elif enum.get('bitpos'):
+ body += " std::make_pair(1ULL << %s, \"%s\"),\n" %(enum.get('bitpos'), enum.get('name'))
+
+ #TODO: Some enums have no offset. How to handle those?
+ elif enum.get('extends') and enum.get("extnumber") and enum.get("offset"):
+ extNumber = int(enum.get("extnumber"))
+ offset = int(enum.get("offset"))
+ enumVal = self.extBase + (extNumber - 1) * self.extBlockSize + offset
+ body += " std::make_pair(%s, \"%s\"),\n" %(str(enumVal), enum.get('name'))
+
+ body += "};\n"
+ body += self.genEnumCode(groupName)
+
+ self.appendSection(section, body)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_h_generator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_h_generator.py
new file mode 100644
index 00000000000..6c5715dcf36
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_h_generator.py
@@ -0,0 +1,196 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Description:
+# -----------
+# This script generates a .hpp file that can be included in an application
+# to generate json data that can then be used to generate the pipeline cache.
+
+import os
+import re
+import xml.dom.minidom
+from generator import (GeneratorOptions, OutputGenerator, noneStr,
+ regSortFeatures, write)
+
+copyright = """
+/*
+** Copyright (c) 2020 The Khronos Group Inc.
+**
+** SPDX-License-Identifier: Apache-2.0
+*/
+"""
+
+
+predefinedCode = """
+/********************************************************************************************/
+/** This code is generated. To make changes, please modify the scripts or the relevant xml **/
+/********************************************************************************************/
+
+#pragma once
+
+#include <stdio.h>
+#include <vulkan/vulkan.h>
+
+const char* getJSONOutput(void);
+void resetJSONOutput(void);
+"""
+
+class JSONHeaderGeneratorOptions(GeneratorOptions):
+ """JSONHeaderGeneratorOptions - subclass of GeneratorOptions.
+
+ Adds options used by JSONHeaderOutputGenerator objects during C language header
+ generation."""
+
+ def __init__(self,
+ prefixText="",
+ genFuncPointers=True,
+ protectFile=True,
+ protectFeature=True,
+ protectProto=None,
+ protectProtoStr=None,
+ apicall='',
+ apientry='',
+ apientryp='',
+ indentFuncProto=True,
+ indentFuncPointer=False,
+ alignFuncParam=0,
+ genEnumBeginEndRange=False,
+ genAliasMacro=False,
+ aliasMacro='',
+ **kwargs
+ ):
+
+ GeneratorOptions.__init__(self, **kwargs)
+
+
+class JSONHeaderOutputGenerator(OutputGenerator):
+ # This is an ordered list of sections in the header file.
+ TYPE_SECTIONS = ['basetype', 'handle', 'enum',
+ 'group', 'bitmask', 'struct']
+ ALL_SECTIONS = TYPE_SECTIONS
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Internal state - accumulators for different inner block text
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+ self.may_alias = None
+ self.featureDict = {}
+ self.vkscFeatureList = []
+ self.baseTypeList = ["int32_t",
+ "uint32_t",
+ "uint8_t",
+ "uint64_t",
+ "float",
+ "int",
+ "double",
+ "int64_t",
+ "uint16_t",
+ "char"]
+
+
+ def createvkscFeatureList(self):
+ for feature in self.registry.reg.findall('feature'):
+ if feature.get('api').find('vulkansc') != -1:
+ # Remove entries that are removed in features in VKSC profile.
+ requiredList = feature.findall("require")
+
+ for requiredItem in requiredList:
+ typeList = requiredItem.findall("type")
+ for typeName in typeList:
+ if typeName.get("name") != "":
+ self.featureDict[typeName.get("name")] = feature.get("name")
+ self.vkscFeatureList.append(typeName.get("name"))
+
+ removeItemList = feature.findall("remove")
+ for removeItem in removeItemList:
+ removeTypes = removeItem.findall("type")
+ for item in removeTypes:
+ if self.vkscFeatureList.count(item.get("name")) > 0:
+ self.vkscFeatureList.remove(item.get("name"))
+
+ allExtensions = self.registry.reg.findall('extensions')
+ for extensions in allExtensions:
+ extensionList = extensions.findall("extension")
+ for extension in extensionList:
+ if extension.get("supported").find("vulkansc") != -1:
+ requiredList = extension.findall("require")
+ for requiredItem in requiredList:
+ typeList = requiredItem.findall("type")
+ for typeName in typeList:
+ self.featureDict[typeName.get("name")] = extension.get("name")
+ self.vkscFeatureList.append(typeName.get("name"))
+
+ def printPrototypes(self):
+ code = ""
+
+ code += "/*************************************** Begin prototypes ***********************************/\n"
+ typesList = self.registry.reg.findall('types')
+ currentExtension = "VK_VERSION_1_0"
+ for types in typesList:
+ typeList = types.findall("type")
+
+ for type in typeList:
+ if type.get("name") != "":
+ cat = type.get("category")
+ name = type.get("name")
+
+ if cat in {"handle", "bitmask", "basetype", "enum", "struct"} and name in self.vkscFeatureList:
+ if name in self.featureDict and currentExtension != self.featureDict[name]:
+ if currentExtension != "VK_VERSION_1_0":
+ code += "#endif\n"
+ currentExtension = self.featureDict[name]
+ if self.featureDict[name] != "VK_VERSION_1_0":
+ code += "#ifdef %s\n" %(currentExtension)
+ code += "void print_%s(const %s* obj, const char* str, int commaNeeded);\n" %(name, name)
+
+ if currentExtension != "VK_VERSION_1_0":
+ code += "#endif\n"
+ code += "/*************************************** End prototypes ***********************************/\n\n"
+
+ return code
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ self.createvkscFeatureList()
+
+ write(copyright, file=self.outFile)
+ write(predefinedCode, file=self.outFile)
+
+ write(self.printPrototypes(), file=self.outFile)
+ write("void dumpPNextChain(const void* pNext);\n", file=self.outFile)
+
+ def endFile(self):
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ OutputGenerator.beginFeature(self, interface, emit)
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+
+ def endFeature(self):
+ if self.emit:
+ if self.feature_not_empty:
+ if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
+
+ for section in self.TYPE_SECTIONS:
+ contents = self.sections[section]
+ if contents:
+ write('\n'.join(contents), file=self.outFile)
+
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def genType(self, typeinfo, name, alias):
+ OutputGenerator.genType(self, typeinfo, name, alias)
+
+ def genStruct(self, typeinfo, typeName, alias):
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+
+ def genGroup(self, groupinfo, groupName, alias=None):
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_parser.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_parser.py
new file mode 100644
index 00000000000..680bafbb8de
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_parser.py
@@ -0,0 +1,1020 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Description:
+# -----------
+# This script generates a .hpp file that creates VK structures from a
+# json file.
+
+import os
+import re
+import xml.dom.minidom
+from generator import (GeneratorOptions, OutputGenerator, noneStr,
+ regSortFeatures, write)
+
+copyright = """
+/*
+ * Copyright (c) 2021 The Khronos Group 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.
+ *
+ *//*!
+ * \\file
+ * \\brief Defines JSON generators for Vulkan structures
+ */
+"""
+
+predefinedCode = """
+/********************************************************************************************/
+/** This code is generated. To make changes, please modify the scripts or the relevant xml **/
+/********************************************************************************************/
+
+#pragma once
+#include <iostream>
+#include <map>
+#include <cinttypes>
+#include <algorithm>
+#include <bitset>
+#include <functional>
+#include <sstream>
+#include <cinttypes>
+#include <json/json.h>
+
+namespace vk_json_parser {
+
+template <typename T1, typename T2>
+class GlobalMem {
+ static constexpr size_t MAX_ALIGNMENT = alignof(std::max_align_t);
+
+ void grow(T1 size = 0) {
+ //push_back new single vector of size m_tabSize onto vec
+ void * p = calloc(size > m_tabSize ? size : m_tabSize, sizeof(T2));
+ assert(p);
+ m_vec.push_back(p);
+ m_pointer = 0U;
+ }
+ void * alloc(T1 size) {
+ // Align to the next multiple of MAX_ALIGNMENT.
+ size = (size + static_cast<T1>(MAX_ALIGNMENT) - 1) & ~(static_cast<T1>(MAX_ALIGNMENT) - 1);
+
+ void* result = static_cast<%s *>(m_vec.back()) + m_pointer;
+ m_pointer += size;
+ return result;
+ }
+public:
+
+ GlobalMem(T1 tabSize_ = 32768U)
+ : m_tabSize(tabSize_), m_pointer(0U)
+ {
+ }
+
+ void* allocate (T1 size)
+ {
+ if (m_vec.empty() || m_pointer+size >= m_tabSize) {
+ grow();
+ }
+ return alloc(size);
+ }
+
+ void* allocate (T1 count, T1 size)
+ {
+ T1 totalSize = count * size;
+ if (m_vec.empty() || m_pointer+totalSize >= m_tabSize)
+ {
+ grow(totalSize);
+ }
+ return alloc(totalSize);
+ }
+ // deallocates all memory. Any use of earlier allocated elements is forbidden
+ void clear()
+ {
+ // remove all vectors from vec excluding the one with index 0
+ for (size_t i=1 ; i<m_vec.size(); i++) {
+ free(m_vec[i]);
+ }
+ if (!m_vec.empty()) {
+ m_vec.resize(1);
+ }
+ m_pointer = 0;
+ }
+
+ ~GlobalMem()
+ {
+ clear();
+ if (!m_vec.empty()) {
+ free(m_vec[0]);
+ }
+ }
+
+private:
+ std::vector< void * > m_vec;
+ T1 m_tabSize;
+ T1 m_pointer;
+};
+
+static thread_local GlobalMem<%s, %s> s_globalMem(32768U);
+
+// To make sure the generated data is consistent across platforms,
+// we typecast to 32-bit.
+static void parse_size_t(const char* s, Json::Value& obj, size_t& o)
+{
+ %s _res = static_cast<%s>(obj.asUInt());
+ o = _res;
+}
+
+static void parse_char(const char* s, Json::Value& obj, char o[])
+{
+ std::string _res = obj.asString();
+ memcpy((void*)o, _res.c_str(), static_cast<%s>(_res.size()));
+ o[_res.size()] = \'\\0\';
+}
+static void parse_char(const char* s, Json::Value& obj, const char* const*)
+{
+}
+static void parse_char(const char* s, Json::Value& obj, const char** o)
+{
+ std::string _res = obj.asString();
+ char *writePtr = (char *)s_globalMem.allocate(static_cast<%s>(_res.size()) + 1);
+ memcpy((void*)writePtr, _res.c_str(), _res.size());
+ writePtr[_res.size()] = \'\\0\';
+ *o = writePtr;
+}
+
+"""
+
+base64DecodeCodeCTS = """
+// base64 encoder taken from executor/xeTestResultParser.cpp
+
+static
+std::vector<deUint8> base64decode(const std::string encoded)
+{
+ int base64DecodeOffset = 0;
+ std::vector<deUint8> result;
+
+ for (std::size_t inNdx = 0; inNdx < encoded.size(); inNdx++)
+ {
+ deUint8 byte = encoded[inNdx];
+ deUint8 decodedBits = 0;
+
+ if (de::inRange<deUint8>(byte, 'A', 'Z'))
+ decodedBits = (deUint8)(byte - 'A');
+ else if (de::inRange<deUint8>(byte, 'a', 'z'))
+ decodedBits = (deUint8)(('Z' - 'A' + 1) + (byte - 'a'));
+ else if (de::inRange<deUint8>(byte, '0', '9'))
+ decodedBits = (deUint8)(('Z' - 'A' + 1) + ('z' - 'a' + 1) + (byte - '0'));
+ else if (byte == '+')
+ decodedBits = ('Z' - 'A' + 1) + ('z' - 'a' + 1) + ('9' - '0' + 1);
+ else if (byte == '/')
+ decodedBits = ('Z' - 'A' + 1) + ('z' - 'a' + 1) + ('9' - '0' + 2);
+ else
+ continue; // Not an B64 input character.
+
+ int phase = base64DecodeOffset % 4;
+
+ if (phase == 0)
+ result.resize(result.size() + 3, 0);
+
+ // if ((int)image->data.size() < (base64DecodeOffset >> 2) * 3 + 3)
+ // throw TestResultParseError("Malformed base64 data");
+ deUint8* outPtr = result.data() + (base64DecodeOffset >> 2) * 3;
+
+ switch (phase)
+ {
+ case 0: outPtr[0] |= (deUint8)(decodedBits << 2); break;
+ case 1: outPtr[0] = (deUint8)(outPtr[0] | (deUint8)(decodedBits >> 4)); outPtr[1] = (deUint8)(outPtr[1] | (deUint8)((decodedBits & 0xF) << 4)); break;
+ case 2: outPtr[1] = (deUint8)(outPtr[1] | (deUint8)(decodedBits >> 2)); outPtr[2] = (deUint8)(outPtr[2] | (deUint8)((decodedBits & 0x3) << 6)); break;
+ case 3: outPtr[2] |= decodedBits; break;
+ default:
+ DE_ASSERT(false);
+ }
+
+ base64DecodeOffset++;
+ }
+ return result;
+}
+
+static void parse_void_data(const void* s, Json::Value& obj, void* o, int oSize)
+{
+ std::vector<deUint8> data;
+ if (obj.isString())
+ {
+ data = base64decode(obj.asString());
+ }
+ else
+ {
+ data.resize(oSize);
+ for (int i = 0; i < std::min(oSize, (int)obj.size()); i++)
+ {
+ parse_uint8_t("pData", obj[i], const_cast<deUint8&>(data[i]));
+ }
+ }
+ memcpy(o, data.data(), oSize);
+}
+
+"""
+
+base64DecodeCode = """
+// base64 encoder taken from executor/xeTestResultParser.cpp
+
+static
+std::vector<uint8_t> base64decode(const std::string encoded)
+{
+ int base64DecodeOffset = 0;
+ std::vector<uint8_t> result;
+
+ for (std::size_t inNdx = 0; inNdx < encoded.size(); inNdx++)
+ {
+ uint8_t byte = encoded[inNdx];
+ uint8_t decodedBits = 0;
+
+ if ('A' <= byte && byte <= 'Z')
+ decodedBits = (uint8_t)(byte - 'A');
+ else if ('a' <= byte && byte <= 'z')
+ decodedBits = (uint8_t)(('Z' - 'A' + 1) + (byte - 'a'));
+ else if ('0' <= byte && byte <= '9')
+ decodedBits = (uint8_t)(('Z' - 'A' + 1) + ('z' - 'a' + 1) + (byte - '0'));
+ else if (byte == '+')
+ decodedBits = ('Z' - 'A' + 1) + ('z' - 'a' + 1) + ('9' - '0' + 1);
+ else if (byte == '/')
+ decodedBits = ('Z' - 'A' + 1) + ('z' - 'a' + 1) + ('9' - '0' + 2);
+ else
+ continue; // Not an B64 input character.
+
+ int phase = base64DecodeOffset % 4;
+
+ if (phase == 0)
+ result.resize(result.size() + 3, 0);
+
+ // if ((int)image->data.size() < (base64DecodeOffset >> 2) * 3 + 3)
+ // throw TestResultParseError("Malformed base64 data");
+ uint8_t* outPtr = result.data() + (base64DecodeOffset >> 2) * 3;
+
+ switch (phase)
+ {
+ case 0: outPtr[0] |= (uint8_t)(decodedBits << 2); break;
+ case 1: outPtr[0] = (uint8_t)(outPtr[0] | (uint8_t)(decodedBits >> 4)); outPtr[1] = (uint8_t)(outPtr[1] | (uint8_t)((decodedBits & 0xF) << 4)); break;
+ case 2: outPtr[1] = (uint8_t)(outPtr[1] | (uint8_t)(decodedBits >> 2)); outPtr[2] = (uint8_t)(outPtr[2] | (uint8_t)((decodedBits & 0x3) << 6)); break;
+ case 3: outPtr[2] |= decodedBits; break;
+ default:
+ assert(false);
+ }
+
+ base64DecodeOffset++;
+ }
+ return result;
+}
+
+static void parse_void_data(const void* s, Json::Value& obj, void* o, int oSize)
+{
+ std::vector<uint8_t> data;
+ if (obj.isString())
+ {
+ data = base64decode(obj.asString());
+ }
+ else
+ {
+ data.resize(oSize);
+ for (int i = 0; i < std::min(oSize, (int)obj.size()); i++)
+ {
+ parse_uint8_t("pData", obj[i], const_cast<uint8_t&>(data[i]));
+ }
+ }
+ memcpy(o, data.data(), oSize);
+}
+
+"""
+
+headerGuardTop = """#ifndef _VULKAN_JSON_PARSER_HPP
+#define _VULKAN_JSON_PARSER_HPP
+"""
+
+headerGuardBottom = """#endif // _VULKAN_JSON_PARSER_HPP"""
+
+class JSONParserOptions(GeneratorOptions):
+ """JSONParserOptions - subclass of GeneratorOptions.
+
+ Adds options used by JSONParserGenerator objects during C language header
+ generation."""
+
+ def __init__(self,
+ prefixText="",
+ genFuncPointers=True,
+ protectFile=True,
+ protectFeature=True,
+ protectProto=None,
+ protectProtoStr=None,
+ apicall='',
+ apientry='',
+ apientryp='',
+ isCTS = False,
+ indentFuncProto=True,
+ indentFuncPointer=False,
+ alignFuncParam=0,
+ genEnumBeginEndRange=False,
+ genAliasMacro=False,
+ aliasMacro='',
+ **kwargs
+ ):
+
+ GeneratorOptions.__init__(self, **kwargs)
+ self.isCTS = isCTS
+
+
+class JSONParserGenerator(OutputGenerator):
+ # This is an ordered list of sections in the header file.
+ TYPE_SECTIONS = ['basetype', 'handle', 'enum',
+ 'group', 'bitmask', 'struct']
+ ALL_SECTIONS = TYPE_SECTIONS
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Internal state - accumulators for different inner block text
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+ self.may_alias = None
+ self.featureDict = {}
+ self.vkscFeatureList = []
+ self.constDict = {}
+ self.baseTypeDict = {
+ "int32_t" : "obj.asInt()",
+ "uint32_t" : "obj.asUInt()",
+ "uint8_t" : "obj.asUInt()",
+ "uint64_t" : "obj.asUInt64()",
+ "float" : "obj.asFloat()",
+ "int" : "obj.asInt()",
+ "double" : "obj.asDouble()",
+ "int64_t" : "obj.asInt64()",
+ "uint16_t" : "obj.asUInt()",
+ "NvSciBufAttrList" : "obj.asInt()",
+ "NvSciBufObj" : "obj.asInt()",
+ "NvSciSyncAttrList" : "obj.asInt()",
+ "NvSciSyncObj" : "obj.asInt()"
+ }
+
+ def parseBaseTypes(self):
+ for baseType in self.baseTypeDict:
+ printStr = self.baseTypeDict[baseType]
+ if baseType == "uint8_t" or baseType == "uint16_t" or baseType.startswith('NvSci'):
+ write("static void parse_%s(const char* s, Json::Value& obj, %s& o)\n" %(baseType, self.baseTypeListMap[baseType]) +
+ "{\n"
+ " o = static_cast<%s>(%s);\n" %(self.baseTypeListMap[baseType],printStr) +
+ "}\n"
+ , file=self.outFile
+ )
+ else:
+ code = ""
+ code += "static void parse_%s(const char* s, Json::Value& obj, %s& o)\n" %(baseType, self.baseTypeListMap[baseType])
+ code += "{\n"
+ if baseType in self.constDict:
+ code += " if (obj.isString())\n"
+ for index, enumValue in enumerate(self.constDict[baseType]):
+ code += " %sif (obj.asString() == \"%s\")\n" %("else " if index > 0 else "", enumValue[0])
+ code += " o = %s;\n" %(enumValue[1])
+ if baseType == "float":
+ code += " else if (obj.asString() == \"NaN\")\n"
+ code += " o = std::numeric_limits<float>::quiet_NaN();\n"
+ code += " else\n"
+ code += " assert(false);\n"
+ code += " else\n"
+ code += " o = %s;\n" %(printStr)
+ else:
+ code += " o = %s;\n" %(printStr)
+ code += "}\n"
+ write(code, file=self.outFile)
+
+ def createvkscFeatureList(self):
+ for feature in self.registry.reg.findall('feature'):
+ if feature.get('api').find('vulkansc') != -1:
+ # Remove entries that are removed in features in VKSC profile.
+ requiredList = feature.findall("require")
+
+ for requiredItem in requiredList:
+ typeList = requiredItem.findall("type")
+ for typeName in typeList:
+ if typeName.get("name") != "":
+ self.featureDict[typeName.get("name")] = feature.get("name")
+ self.vkscFeatureList.append(typeName.get("name"))
+
+ removeItemList = feature.findall("remove")
+ for removeItem in removeItemList:
+ removeTypes = removeItem.findall("type")
+ for item in removeTypes:
+ if self.vkscFeatureList.count(item.get("name")) > 0:
+ self.vkscFeatureList.remove(item.get("name"))
+
+ allExtensions = self.registry.reg.findall('extensions')
+ for extensions in allExtensions:
+ extensionList = extensions.findall("extension")
+ for extension in extensionList:
+ if extension.get("supported").find("vulkansc") != -1:
+ requiredList = extension.findall("require")
+ for requiredItem in requiredList:
+ typeList = requiredItem.findall("type")
+ for typeName in typeList:
+ self.featureDict[typeName.get("name")] = extension.get("name")
+ self.vkscFeatureList.append(typeName.get("name"))
+
+ def createConstDict(self):
+ for enums in self.registry.reg.findall('enums'):
+ if enums.get("name") == "API Constants":
+ for enum in enums.findall('enum'):
+ type = enum.get("type");
+ if (type):
+ name = enum.get("name")
+ value = enum.get("value")
+ if type not in self.constDict:
+ self.constDict[type] = [(name, value)]
+ else:
+ self.constDict[type].append((name, value))
+
+ def printPrototypes(self):
+ code = ""
+
+ code += "/*************************************** Begin prototypes ***********************************/\n"
+ typesList = self.registry.reg.findall('types')
+ currentExtension = "VK_VERSION_1_0"
+ for types in typesList:
+ typeList = types.findall("type")
+
+ for type in typeList:
+ if type.get("name") != "":
+ cat = type.get("category")
+ name = type.get("name")
+
+ if cat in {"handle", "bitmask", "basetype", "enum", "struct"} and name in self.vkscFeatureList:
+ if name in self.featureDict and currentExtension != self.featureDict[name]:
+ if not self.isCTS and currentExtension != "VK_VERSION_1_0":
+ code += "#endif\n"
+ currentExtension = self.featureDict[name]
+ if self.featureDict[name] != "VK_VERSION_1_0":
+ if not self.isCTS:
+ code += "#ifdef %s\n" %(currentExtension)
+ code += "static void parse_%s(const char* s, Json::Value& obj, %s& o);\n" %(name, name)
+
+ if currentExtension != "VK_VERSION_1_0":
+ if not self.isCTS:
+ code += "#endif\n"
+ code += "/*************************************** End prototypes ***********************************/\n\n"
+
+ return code
+
+ def genStructExtensionCode(self):
+ code = ""
+ code += "static\n"
+ code += "void* parsePNextChain(Json::Value& obj) {\n"
+ code += " VkBaseInStructure o;\n"
+ code += " Json::Value& pNextObj = obj[\"pNext\"];\n"
+ code += " if (pNextObj.empty() || (pNextObj.isString() && pNextObj.asString() == \"NULL\")) return nullptr;\n\n"
+ code += " parse_VkStructureType(\"sType\", pNextObj[\"sType\"], (o.sType));\n"
+ code += " void* p = nullptr;\n"
+ code += " switch (o.sType) {\n"
+
+ typesList = self.registry.reg.findall('types')
+ currentExtension = "VK_VERSION_1_0"
+ for types in typesList:
+ typeList = types.findall("type")
+ for type in typeList:
+ if type.get('category') == 'struct' and type.get('structextends') is not None and type.get('name') in self.vkscFeatureList:
+ members = type.findall('member')
+ for m in members:
+ n = type.get('name')
+ if m.get('values'):
+ if n in self.featureDict and currentExtension != self.featureDict[n]:
+ if not self.isCTS and currentExtension != "VK_VERSION_1_0":
+ code += "#endif\n"
+ currentExtension = self.featureDict[n]
+ if self.featureDict[n] != "VK_VERSION_1_0":
+ if not self.isCTS:
+ code += "#ifdef %s\n" %(currentExtension)
+ code += " case %s:\n" %(m.get('values'))
+ code += " {\n"
+ code += " p = s_globalMem.allocate(sizeof(%s));\n" %(n)
+ code += " parse_%s(\"\", pNextObj, *((%s*)p));\n" %(n, n)
+ code += " }\n"
+ #code += "print_%s(((%s *)pNext), \"%s\", 1);\n" %(n, n, n)
+ code += " break;\n"
+
+ if currentExtension != "VK_VERSION_1_0":
+ if not self.isCTS:
+ code += "#endif\n"
+ code += " default: {/** **/}\n"
+ code += " }\n"
+ code += " return p;\n"
+ code += " }\n"
+
+ return code
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ self.createvkscFeatureList()
+ self.createConstDict()
+
+ self.isCTS = genOpts.isCTS
+
+ self.baseTypeListMap = {
+ "int32_t" : "deInt32" if self.isCTS else "int32_t",
+ "uint32_t" : "deUint32" if self.isCTS else "uint32_t",
+ "uint8_t" : "deUint8" if self.isCTS else "uint8_t",
+ "uint64_t" : "deUint64" if self.isCTS else "uint64_t",
+ "float" : "float",
+ "int" : "int",
+ "double" : "double",
+ "int64_t" : "deInt64" if self.isCTS else "int64_t",
+ "uint16_t" : "deUint16" if self.isCTS else "uint16_t",
+ "NvSciBufAttrList" : "vk::pt::NvSciBufAttrList" if self.isCTS else "NvSciBufAttrList",
+ "NvSciBufObj" : "vk::pt::NvSciBufObj" if self.isCTS else "NvSciBufObj",
+ "NvSciSyncAttrList" : "vk::pt::NvSciSyncAttrList" if self.isCTS else "NvSciSyncAttrList",
+ "NvSciSyncObj" : "vk::pt::NvSciSyncObj" if self.isCTS else "NvSciSyncObj"
+ }
+
+ write(headerGuardTop, file=self.outFile, end='')
+ write(copyright, file=self.outFile)
+ write(predefinedCode % (self.baseTypeListMap["uint8_t"],
+ self.baseTypeListMap["uint32_t"],
+ self.baseTypeListMap["uint8_t"],
+ self.baseTypeListMap["uint32_t"],
+ self.baseTypeListMap["uint32_t"],
+ self.baseTypeListMap["uint32_t"],
+ self.baseTypeListMap["uint32_t"]), file=self.outFile)
+
+ self.parseBaseTypes()
+ if self.isCTS:
+ write(base64DecodeCodeCTS, file=self.outFile)
+ else:
+ write(base64DecodeCode, file=self.outFile)
+
+ write(self.printPrototypes(), file=self.outFile)
+
+ write(self.genStructExtensionCode(), file=self.outFile)
+
+ def endFile(self):
+ write("}//End of namespace vk_json_parser\n", file=self.outFile) # end of namespace
+ write(headerGuardBottom, file=self.outFile, end='') # end of _VULKAN_JSON_PARSER_HPP
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ OutputGenerator.beginFeature(self, interface, emit)
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+
+ def endFeature(self):
+ if self.emit:
+ if self.feature_not_empty:
+ if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
+
+ for section in self.TYPE_SECTIONS:
+ contents = self.sections[section]
+ if contents:
+ write('\n'.join(contents), file=self.outFile)
+
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def appendSection(self, section, text):
+ self.sections[section].append(text)
+ self.feature_not_empty = True
+
+ def genEnumCode(self, name, endIfdef):
+ code = ""
+ code += "static void parse_%s(const char* s, Json::Value& obj, %s& o) {\n" %(name, name)
+ code += " std::string _res = obj.asString();\n"
+ code += " o = (%s)%s_map[std::string(_res)];\n" %(name, name)
+ code += "}\n"
+ if not self.isCTS and endIfdef:
+ code += "#endif\n"
+
+ return code
+
+ def genBasetypeCode(self, str1, str2, name):
+ code = ""
+ code += "static void parse_%s(const char* s, Json::Value& obj, %s& o) {\n" %(name, name)
+ code += " std::string _res = obj.asString();\n"
+ if name == "VkBool32":
+ code += " //VkBool is represented as VK_TRUE and VK_FALSE in the json\n"
+ code += " o = (_res == \"VK_TRUE\") ? (1) : (0);\n"
+ elif name == "VkDeviceAddress":
+ code += " sscanf(_res.c_str(), \"%\" SCNu64, &o);\n"
+ elif name == "VkDeviceSize":
+ code += " if (_res == \"VK_WHOLE_SIZE\")\n"
+ code += " o = (~0ULL);\n"
+ code += " else\n"
+ code += " sscanf(_res.c_str(), \"%\" SCNu64, &o);\n"
+ elif name in ["VkFlags64", "VkPipelineStageFlags2KHR", "VkAccessFlags2KHR", "VkFormatFeatureFlags2KHR"]:
+ code += " sscanf(_res.c_str(), \"%\" SCNd64, &o);\n"
+ else:
+ code += " sscanf(_res.c_str(), \"%u\", &o);\n"
+ code += "}\n"
+ return code
+
+ def genHandleCode(self, str1, str2, name):
+ code = ""
+ ifdefName = ""
+ if name in self.featureDict and self.featureDict[name] != "VK_VERSION_1_0":
+ ifdefName = self.featureDict[name]
+ if not self.isCTS and ifdefName != "":
+ code += "#ifdef %s\n" %(ifdefName)
+ code += "static void parse_%s(const char* s, Json::Value& obj, %s& o) {\n" %(name, name)
+ code += "// std::string _res = obj.asString();\n"
+ code += "}\n"
+ if not self.isCTS and ifdefName != "":
+ code += "#endif\n"
+ return code
+
+ def genBitmaskCode(self, str1, str2, name, mapName):
+ code = ""
+ ifdefName = ""
+ if mapName in self.featureDict and self.featureDict[mapName] != "VK_VERSION_1_0":
+ ifdefName = self.featureDict[mapName]
+ elif name in self.featureDict and self.featureDict[name] != "VK_VERSION_1_0":
+ ifdefName = self.featureDict[name]
+ if ifdefName != "":
+ if not self.isCTS:
+ code += "#ifdef %s\n" %(ifdefName)
+
+ if mapName is not None:
+ code += "static void parse_%s(const char* s, Json::Value& obj, %s& o) {\n" %(name, name)
+ code += " o = (%s)0;\n" %(name)
+ code += " std::string _res = obj.asString();\n"
+ code += " std::vector<std::string> bitmasks;\n"
+ code += " std::istringstream inputStream(_res);\n"
+ code += " std::string tempStr;\n"
+ code += " while (getline(inputStream, tempStr, '|')) {\n"
+ code += " tempStr.erase(std::remove_if(tempStr.begin(), tempStr.end(), isspace), tempStr.end());\n"
+ code += " bitmasks.push_back(tempStr);\n"
+ code += " }\n"
+ code += " for (auto& it : bitmasks) {\n"
+ code += " o |= (%s)%s_map[it];\n" %(mapName, mapName)
+ code += " }\n"
+ code += "}\n"
+ else:
+ code += "static void parse_%s(const char* s, Json::Value& obj, %s& o) {\n" %(name, name)
+ code += " if (obj.isString()) {\n"
+ code += " std::string _res = obj.asString();\n"
+ if name in ["VkFlags64", "VkPipelineStageFlags2KHR", "VkAccessFlags2KHR", "VkFormatFeatureFlags2KHR"]:
+ code += " sscanf(_res.c_str(), \"%\" SCNd64, &o);\n"
+ else:
+ code += " sscanf(_res.c_str(), \"%u\", &o);\n"
+ code += " }\n"
+ code += " else {\n"
+ code += " o = obj.asUInt();\n"
+ code += " }\n"
+
+ code += "}\n"
+
+ if not self.isCTS and ifdefName != "":
+ code += "#endif\n"
+
+ return code
+
+ def genType(self, typeinfo, name, alias):
+ OutputGenerator.genType(self, typeinfo, name, alias)
+ typeElem = typeinfo.elem
+ body = ""
+
+ category = typeElem.get('category')
+ if category == 'funcpointer':
+ section = 'struct'
+ else:
+ section = category
+
+ if category in ('struct', 'union'):
+ self.genStruct(typeinfo, name, alias)
+ else:
+ if typeElem.get('category') == 'bitmask':
+ for elem in typeElem:
+ if elem.tag == 'name':
+ body += self.genBitmaskCode("(", " obj,", elem.text, typeElem.get('requires'))
+
+ elif typeElem.get('category') == 'basetype':
+ for elem in typeElem:
+ if elem.tag == 'name':
+ body += self.genBasetypeCode("(", " obj,", elem.text)
+
+ elif typeElem.get('category') == 'handle':
+ for elem in typeElem:
+ if elem.tag == 'name':
+ body += self.genHandleCode("(", " obj,", elem.text)
+
+ if body:
+ self.appendSection(section, body)
+
+ def paramIsStruct(self, memberType):
+ if str(self.getTypeCategory(memberType)) == 'struct':
+ return 1
+ return 0
+
+ # Helper taken from the validation layers code.
+ def paramIsPointer(self, param):
+ ispointer = False
+ for elem in param:
+ if elem.tag == 'type' and elem.tail is not None and '*' in elem.tail:
+ ispointer = True
+ return ispointer
+
+ # Helper taken from the validation layers code.
+ def paramIsStaticArray(self, param):
+ isstaticarray = 0
+ paramname = param.find('name')
+ if (paramname.tail is not None) and ('[' in paramname.tail) and (']' in paramname.tail):
+ isstaticarray = paramname.tail.count('[')
+ if isstaticarray:
+ arraySize = paramname.tail[1]
+
+ if isstaticarray:
+ return arraySize
+ else:
+ return 0
+
+ def paramIsStaticArrayWithMacroSize(self, param):
+ paramname = param.find('name')
+ isCharArray = param.find('type') is not None and 'char' in param.find('type').text
+ hasMacroSize = paramname.tail is not None and '[' in paramname.tail and param.find('enum') is not None
+ if hasMacroSize and not isCharArray:
+ return 1
+ else:
+ return 0
+
+ def paramIsCharStaticArrayWithMacroSize(self, param):
+ paramname = param.find('name')
+ if paramname.tail is None and paramname.text == "pName":
+ return 0
+ else:
+ return 1
+
+ def generateStructMembercode(self, param, str1, str2, str3, str4, memberName, typeName, isCommaNeeded):
+ length = ""
+ code = ""
+ isArr = param.get('len') is not None
+
+ if param.get('len') is not None:
+ length = str2 + param.get('len') + ")"
+
+ if self.paramIsPointer(param) is True and isArr is True:
+ code += " %s%s) = (%s*)s_globalMem.allocate(%s, sizeof(%s));\n" %(str2, memberName, typeName, length, typeName)
+ code += " Json::Value& obj_%s = obj[\"%s\"];\n" %(memberName, memberName)
+ code += " if (obj_%s.size() == 0) %s%s) = nullptr;\n" %(memberName, str2, memberName)
+ code += " else {\n"
+ code += " for (unsigned int i = 0; i < %s; i++) {\n" %(length)
+ code += " parse_%s(\"%s\", obj_%s[i], const_cast<%s&>(%s%s[i])));\n" %(typeName, memberName, memberName, typeName, str2, memberName)
+ code += " }\n"
+ code += " }\n"
+ return code
+ elif self.paramIsPointer(param) is True:
+ code += " {\n"
+ code += " Json::Value& obj_%s = obj[\"%s\"];\n" %(memberName, memberName)
+ code += " const int sz = obj_%s.size();\n" %(memberName)
+ code += " if (obj_%s.size() == 0) {\n" %(memberName)
+ code += " %s%s) = nullptr;\n"%(str2, memberName)
+ code += " } else {\n"
+ code += " %s%s) = (%s*)s_globalMem.allocate(1, sizeof(%s));\n" %(str2, memberName, typeName, typeName)
+ code += " parse_%s(\"%s\", obj_%s, const_cast<%s&>(*%s%s)));\n" %(typeName, memberName, memberName, typeName, str2, memberName)
+ code += " }\n"
+ code += " }\n"
+ return code
+
+ # TODO: With some tweak, we can use the genArrayCode() here.
+ if isArr is True:
+ code += " Json::Value& obj_%s = obj[\"%s\"];\n" %(memberName, memberName)
+ code += " for (unsigned int i = 0; i < obj_%s.size(); i++) {\n" %(memberName)
+ code += " parse_%s(\"%s\", obj_%s[i], const_cast<%s&>(%s%s[i])));\n" %(typeName, memberName, memberName, typeName, str2, memberName)
+ code += " }\n"
+ else:
+ code += " parse_%s(\"%s\", obj[\"%s\"], %s%s));\n" %(typeName, memberName, memberName, str2, memberName)
+
+ return code
+
+ def genArrayCode(self, structName, name, typeName, str2, arraySize, needStrPrint, isMallocNeeded):
+ code = ""
+ mappedType = self.baseTypeListMap[typeName] if self.baseTypeListMap.get(typeName) != None else typeName
+ if structName == "VkPipelineLayoutCreateInfo" and self.isCTS:
+ if isMallocNeeded:
+ code += " %s* %sTab = (%s*)s_globalMem.allocate(%s, sizeof(%s));\n" %(mappedType, name, mappedType, arraySize, mappedType)
+ code += " Json::Value& obj_%s_arr = obj[\"%s\"];\n" %(name, name)
+ code += " for (unsigned int i = 0; i < obj_%s_arr.size(); i++) {\n" %(name)
+ code += " deUint64 %sInternal = 0;\n" %(name)
+ code += " parse_uint64_t(\"%s\", obj_%s_arr[i], %sInternal);\n" %(name, name, name)
+ code += " %sTab[i] = %s(%sInternal);\n" %(name, mappedType, name)
+ code += " }\n"
+ code += " %s%s = %sTab;\n" %(str2[1:], name, name)
+ else:
+ if isMallocNeeded:
+ code += " %s%s) = (%s*)s_globalMem.allocate(%s, sizeof(%s));\n" %(str2, name, mappedType, arraySize, mappedType)
+ code += " Json::Value& obj_%s_arr = obj[\"%s\"];\n" %(name, name)
+ code += " for (unsigned int i = 0; i < obj_%s_arr.size(); i++) {\n" %(name)
+ code += " parse_%s(\"%s\", obj_%s_arr[i], const_cast<%s&>(%s%s[i])));\n" %(typeName, name, name, mappedType, str2, name)
+ code += " }\n"
+
+ return code
+
+ # Prints out member name followed by empty string.
+ def genEmptyCode(self, memberName, isCommaNeeded):
+ code = ""
+ return code
+
+ def genCTSHandleCode(self, memberName, typeName):
+ code = ""
+ code += " deUint64 %sInternal = 0;\n" %(memberName)
+ code += " parse_uint64_t(\"%s\", obj[\"%s\"], %sInternal);\n" %(memberName, memberName, memberName)
+ code += " o.%s = %s(%sInternal);\n" %(memberName, typeName, memberName)
+ return code
+
+ def genStructCode(self, param, str1, str2, str3, str4, structName, isCommaNeeded):
+ code = ""
+ memberName = ""
+ typeName = ""
+
+ for elem in param:
+ if elem.text.find('PFN_') != -1:
+ return " /** Note: Ignoring function pointer (%s). **/\n" %(elem.text)
+
+ if elem.text == 'pNext':
+ return " o.pNext = (%s*)parsePNextChain(obj);\n" %(structName)
+
+ if elem.tag == 'name':
+ memberName = elem.text
+
+ if elem.tag == 'type':
+ typeName = elem.text
+
+ if self.paramIsStaticArray(param):
+ return self.genArrayCode(structName, memberName, typeName, str2, self.paramIsStaticArray(param), False, isCommaNeeded)
+
+ elif self.paramIsStaticArrayWithMacroSize(param):
+ arraySize = param.find('enum').text
+ return self.genArrayCode(structName, memberName, typeName, str2, arraySize, False, isCommaNeeded)
+
+ # If the struct's member is another struct, we need a different way to handle.
+ elif self.paramIsStruct(typeName) == 1:
+ code += self.generateStructMembercode(param, str1, str2, str3, str4, memberName, typeName, isCommaNeeded)
+
+ # Ignore void* data members
+ elif self.paramIsPointer(param) and typeName == 'void':
+ code = ""
+ if structName == "VkSpecializationInfo":
+ code += " if (o.dataSize > 0U)\n"
+ code += " {\n"
+ code += " void* data = s_globalMem.allocate(%s(%sdataSize));\n" %(self.baseTypeListMap["uint32_t"] ,str2[1:])
+ code += " parse_void_data(\"%s\", obj[\"%s\"], data, int(%sdataSize));\n" %(memberName, memberName, str2[1:])
+ code += " %s%s = data;\n" %(str2[1:], memberName)
+ code += " }\n"
+ code += " else\n"
+ code += " %s%s = NULL;\n" %(str2[1:], memberName)
+ return code
+ if self.isCTS:
+ if structName == "VkPipelineCacheCreateInfo":
+ code += " if (o.initialDataSize > 0U)\n"
+ code += " {\n"
+ code += " void* data = s_globalMem.allocate(%s(%sinitialDataSize));\n" %(self.baseTypeListMap["uint32_t"], str2[1:])
+ code += " parse_void_data(\"%s\", obj[\"%s\"], data, int(%sinitialDataSize));\n" %(memberName, memberName, str2[1:])
+ code += " %s%s = data;\n" %(str2[1:], memberName)
+ code += " }\n"
+ code += " else\n"
+ code += " %s%s = NULL;\n" %(str2[1:], memberName)
+ return code
+ return " /** Note: Ignoring void* data. **/\n"
+
+ # For pointers where we have the 'len' field, dump them as arrays.
+ elif self.paramIsPointer(param) and param.get('len') is not None and param.get('len').find('null-terminated') == -1 and param.get('len').find('latexmath') == -1:
+ # TODO: Check what the optional means here. In some cases, the pointer isn't populated, but the count gets set.
+ if param.get('optional') != 'true':
+ return self.genArrayCode(structName, memberName, typeName, str2, str2+param.get('len')+")", False, True)
+ else:
+ if structName == "VkDescriptorSetLayoutBinding" and self.isCTS:
+ code = ""
+ code += " Json::Value& obj_%s = obj[\"%s\"];\n" %(memberName, memberName)
+ code += " if (obj_%s.empty() || (obj_%s.isString() && obj_%s.asString() == \"NULL\"))\n" %(memberName, memberName, memberName)
+ code += " o.%s = nullptr;\n" %(memberName)
+ code += " else\n"
+ code += " {\n"
+ code += " %s* samplers = (%s*)s_globalMem.allocate((o.descriptorCount), sizeof(%s));\n" %(typeName, typeName, typeName)
+ code += " for (unsigned int i = 0; i < obj_%s.size(); i++)\n" %(memberName)
+ code += " {\n"
+ code += " deUint64 sInternal = 0;\n"
+ code += " parse_uint64_t(\"%s\", obj_%s[i], sInternal);\n" %(memberName, memberName)
+ code += " samplers[i] = %s(sInternal);\n" %(typeName)
+ code += " }\n"
+ code += " o.%s = samplers;\n" %(memberName)
+ code += " }"
+ return code
+ return self.genEmptyCode(memberName, isCommaNeeded)
+
+ # Special handling for VkPipelineMultisampleStateCreateInfo::pSampleMask
+ elif typeName in "VkSampleMask":
+ arraySize = "(%s(o.rasterizationSamples + 31) / 32)" %(self.baseTypeListMap["uint32_t"])
+ code += " %s%s) = (%s*)s_globalMem.allocate(%s, sizeof(%s));\n" %(str2, memberName, typeName, arraySize, typeName)
+ code += " Json::Value& obj_%s = obj[\"%s\"];\n" %(memberName, memberName)
+ code += " if (o.rasterizationSamples == 0 || obj_%s.size() == 0) {\n" %(memberName)
+ code += " %s%s) = nullptr;\n" %(str2, memberName)
+ code += " } else {\n"
+ code += " for (%s i = 0; i < %s; i++) {\n" %(self.baseTypeListMap["uint32_t"], arraySize)
+ code += " parse_uint32_t(\"%s\", obj_%s[i], const_cast<%s&>(%s%s[i])));\n" %(memberName, memberName, typeName, str2, memberName)
+ code += " }\n"
+ code += " }\n"
+
+ # If a struct member is just a handle.
+ elif str(self.getTypeCategory(typeName)) == 'handle':
+ if self.isCTS and (memberName == "module" or memberName == "layout" or memberName == "renderPass" or memberName == "conversion"):
+ return self.genCTSHandleCode(memberName, typeName)
+ return self.genEmptyCode(memberName, isCommaNeeded)
+
+ elif typeName in "char":
+ if self.paramIsCharStaticArrayWithMacroSize(param) == 0:
+ code += " %s%s) = (const char*)s_globalMem.allocate(255);\n" %(str2, memberName)
+ code += " parse_%s(\"%s\", obj[\"%s\"], &%s%s));\n" %(typeName, memberName, memberName, str2, memberName)
+ else:
+ code += " /** TODO: Handle this - %s **/\n" %(memberName)
+
+ elif typeName in "NvSciSyncFence":
+ code += " /** TODO: Handle this - %s **/\n" %(memberName)
+
+ else:
+ code += " parse_%s(\"%s\", obj[\"%s\"], %s%s));\n" %(typeName, memberName, memberName, str2, memberName)
+
+ return code
+
+ def genStruct(self, typeinfo, typeName, alias):
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+ body = ""
+ typeElem = typeinfo.elem
+ ifdefNeeded = False
+
+ if typeName in self.featureDict and self.featureDict[typeName] != "VK_VERSION_1_0":
+ ifdefNeeded = True
+ if not self.isCTS:
+ body = "#ifdef %s\n" %(self.featureDict[typeName])
+
+ if alias:
+ body += 'typedef ' + alias + ' ' + typeName + ';\n'
+ else:
+ genStr1 = ["("]
+ genStr2 = ["(o."]
+ genStr3 = [" o, const const char* s, bool commaNeeded) {"]
+ genStr4 = [" if (obj."]
+
+ index = 0
+ body += "static void parse_%s(const char* s, Json::Value& obj, %s& o) {\n" %(typeName, typeName)
+ body += "\n"
+
+ for member in typeElem.findall('.//member'):
+ body += self.genStructCode(member, genStr1[index], genStr2[index], genStr3[index], genStr4[index], typeName, 0)
+ body += "\n"
+
+ body += "}\n"
+
+ if not self.isCTS and ifdefNeeded:
+ body += "#endif\n"
+
+ self.appendSection('struct', body)
+
+ def genGroup(self, groupinfo, groupName, alias=None):
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+ groupElem = groupinfo.elem
+ body = ""
+ section = 'enum'
+ ifdefNeeded = False
+
+ if groupName in self.featureDict and self.featureDict[groupName] != "VK_VERSION_1_0":
+ ifdefNeeded = True
+ if not self.isCTS:
+ body += "#ifdef %s\n" %(self.featureDict[groupName])
+
+ if groupName == "VkPipelineStageFlagBits2KHR" or groupName == "VkAccessFlagBits2KHR" or groupName == "VkFormatFeatureFlagBits2KHR":
+ body += "static std::map<std::string, %s> %s_map = {\n" %(self.baseTypeListMap["uint64_t"],groupName)
+ else:
+ body += "static std::map<std::string, int> %s_map = {\n" %(groupName)
+ enums = groupElem.findall('enum')
+
+ for enum in enums:
+ if enum.get('value'):
+ body += " std::make_pair(\"%s\", %s),\n" %(enum.get('name'), enum.get('value'))
+
+ elif enum.get('bitpos'):
+ if groupName == "VkPipelineStageFlagBits2KHR" or groupName == "VkAccessFlagBits2KHR" or groupName == "VkFormatFeatureFlagBits2KHR":
+ body += " std::make_pair(\"%s\", 1ULL << %s),\n" %(enum.get('name'), enum.get('bitpos'))
+ else:
+ body += " std::make_pair(\"%s\", 1UL << %s),\n" %(enum.get('name'), enum.get('bitpos'))
+
+ elif enum.get('extends') and enum.get("extnumber") and enum.get("offset"):
+ extNumber = int(enum.get("extnumber"))
+ offset = int(enum.get("offset"))
+ enumVal = self.extBase + (extNumber - 1) * self.extBlockSize + offset
+ body += " std::make_pair(\"%s\", %s),\n" %(enum.get('name'), str(enumVal))
+
+ body += "};\n"
+ body += self.genEnumCode(groupName, ifdefNeeded)
+
+ self.appendSection(section, body)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_validate.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_validate.py
new file mode 100644
index 00000000000..b31fb48d66e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/json_validate.py
@@ -0,0 +1,85 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Description:
+# -----------
+# This script validates a json pipeline file against the schema files.
+
+import os,sys
+import re
+import argparse
+import json
+import jsonschema
+
+base_schema_filename = os.path.join("..", "json", "vk.json")
+vkpcc_schema_filename = os.path.join("..", "json", "vkpcc.json")
+
+# Parses input arguments
+def ParseArgs():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('json_file', help='The json file to validate')
+ return parser.parse_args()
+
+def main():
+ args = ParseArgs()
+ jsonText = ""
+ baseSchemaText = ""
+ vkSchemaText = ""
+
+ # Exit with error if json or schema files do not exist
+ if not os.path.exists(args.json_file):
+ print('Error: json file \"%s\" does not exist.' % args.json_file)
+ sys.exit(1)
+ elif not os.path.exists(base_schema_filename):
+ print('Error: json file \"%s\" does not exist.' % base_schema_filename)
+ sys.exit(1)
+ elif not os.path.exists(vkpcc_schema_filename):
+ print('Error: json file \"%s\" does not exist.' % vkpcc_schema_filename)
+ sys.exit(1)
+
+ # Read the json schemas files in as text
+ with open(base_schema_filename) as baseSchemaFile:
+ baseSchemaText = baseSchemaFile.read()
+ with open(vkpcc_schema_filename) as vkSchemaFile:
+ vkSchemaText = vkSchemaFile.read()
+ with open(args.json_file) as jsonFile:
+ jsonText = jsonFile.read()
+ baseSchema = json.loads(baseSchemaText)
+ vkSchema = json.loads(vkSchemaText)
+ jsonData = json.loads(jsonText)
+
+ # Ensure that the generated vk.json schema is a valid schema
+ try:
+ jsonschema.Draft4Validator.check_schema(baseSchema)
+ print(base_schema_filename, "is valid")
+ except jsonschema.SchemaError as e:
+ print(base_schema_filename, "error: " + str(e))
+
+ # Ensure that vkpcc.json is also a valid schema
+ try:
+ jsonschema.Draft4Validator.check_schema(vkSchema)
+ print(vkpcc_schema_filename, "schema is valid")
+ except jsonschema.exceptions.SchemaError as e:
+ print(vkpcc_schema_filename, "schema error: " + str(e))
+
+ # Construct a schema validator object from the two schema files
+ schemaRefStore = {
+ baseSchema["id"] : baseSchema,
+ vkSchema["id"] : vkSchema
+ }
+ resolver = jsonschema.RefResolver.from_schema(baseSchema, store=schemaRefStore)
+ validator = jsonschema.Draft4Validator(vkSchema, resolver=resolver)
+
+ # Validate the input .json file using the schemas
+ for error in sorted(validator.iter_errors(jsonData), key=str):
+ print(error.message)
+ print(list(error.path))
+ for suberror in sorted(error.context, key=lambda e: e.schema_path):
+ print(list(suberror.path), suberror.message, sep="\n")
+ print("\n")
+
+if __name__ == '__main__':
+ main()
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/linkcheck.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/linkcheck.py
new file mode 100755
index 00000000000..0ee0c0136ca
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/linkcheck.py
@@ -0,0 +1,84 @@
+#!/usr/bin/python3
+# Copyright 2013-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# linkcheck - check internal links of the specified HTML file against
+# internal anchors and report inconsistencies.
+#
+# Usage: linkcheck file.html
+
+import argparse
+from lxml import etree as et
+
+def printSet(s):
+ for key in sorted(s):
+ print(' {}'.format(key))
+
+def checkLinks(file, args):
+ parser = et.HTMLParser()
+ tree = et.parse(file, parser)
+
+ # Remove all <svg> elements, which just add noise to the cross-referencing
+ for svg in tree.findall('//svg'):
+ svg.getparent().remove(svg)
+
+ # Extract elements with href= and id= attributes
+ hrefs = tree.findall('//*[@href]')
+ ids = tree.findall('//*[@id]')
+
+ # Extract xref name from each xref
+ internals = set()
+ externals = set()
+
+ for e in hrefs:
+ # Do not track '<link>' tags from HTML headers
+ if e.tag != 'link':
+ xref = e.get('href')
+
+ if xref[0:1] == '#':
+ # Internal anchor
+ internals.add(xref[1:])
+ else:
+ externals.add(xref)
+
+ # Extract anchor name from each id
+ anchors = set()
+
+ for e in ids:
+ # Do not track SVG '<g>' tags
+ if e.tag != 'g':
+ anchors.add(e.get('id'))
+
+ # Intersect them to find inconsistencies
+ xrefsOnly = internals.difference(anchors)
+ anchorsOnly = anchors.difference(internals)
+
+ # print('External xrefs:', len(externals))
+ # printSet(externals)
+ #
+ # print('Internal xrefs:', len(internals))
+ # print('Anchors: ', len(anchors))
+
+ print('Internal xrefs not in anchors:', len(xrefsOnly))
+ printSet(xrefsOnly)
+
+ if args.anchors:
+ print('Internal anchors not in xrefs:', len(anchorsOnly))
+ printSet(anchorsOnly)
+
+# Patterns used to recognize interesting lines in an asciidoc source file.
+# These patterns are only compiled once.
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('files', metavar='filename', nargs='*',
+ help='a filename to promote text in')
+ parser.add_argument('-anchors', action='store_true',
+ help='Report orphaned anchors')
+
+
+ args = parser.parse_args()
+
+ for file in args.files:
+ checkLinks(file, args)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/makemanaliases.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/makemanaliases.py
new file mode 100755
index 00000000000..3bcb93962c6
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/makemanaliases.py
@@ -0,0 +1,64 @@
+#!/usr/bin/python3
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+"""Script to create symbolic links for aliases in reference pages
+ Usage: makemanaliases.py -refdir refpage-output-directory"""
+
+import argparse
+import os
+import sys
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-genpath', action='store',
+ default=None,
+ help='Path to directory containing generated apimap.py module')
+ parser.add_argument('-refdir', action='store',
+ required=True,
+ help='Path to directory containing reference pages to symlink')
+
+ args = parser.parse_args()
+
+ # Look for apimap.py in the specified directory
+ if args.genpath is not None:
+ sys.path.insert(0, args.genpath)
+ import apimap as api
+
+ # Change to refpage directory
+ try:
+ os.chdir(args.refdir)
+ except:
+ print('Cannot chdir to', args.refdir, file=sys.stderr)
+ sys.exit(1)
+
+ # For each alias in the API alias map, create a symlink if it
+ # does not exist - and warn if it does exist.
+
+ for key in api.alias:
+ if key.endswith(('_EXTENSION_NAME', '_SPEC_VERSION')):
+ # No reference pages are generated for these meta-tokens, so
+ # attempts to alias them will fail. Silently skip them.
+ continue
+
+ alias = key + '.html'
+ src = api.alias[key] + '.html'
+
+ if not os.access(src, os.R_OK):
+ # This should not happen, but is possible if the api module is
+ # not generated for the same set of APIs as were the refpages.
+ print('No source file', src, file=sys.stderr)
+ continue
+
+ if os.access(alias, os.R_OK):
+ # If the link already exists, that is not necessarily a
+ # problem, so do not fail, but it should be checked out.
+ # The usual case for this is not cleaning the target directory
+ # prior to generating refpages.
+ print('Unexpected alias file "' + alias + '" exists, skipping',
+ file=sys.stderr)
+ else:
+ # Create link from alias refpage to page for what it is aliasing
+ os.symlink(src, alias)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/map_html_anchors.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/map_html_anchors.py
new file mode 100755
index 00000000000..06c2f54a4da
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/map_html_anchors.py
@@ -0,0 +1,210 @@
+#!/usr/bin/python3
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# map_html_anchors - map each id= element in a spec HTML file onto the
+# top-level (chapter) id= element it belongs to. Used to rewrite spec
+# xrefs for Antora. Prints a Python script containing a dictionary
+# mapping each discovered ID into the top-level ID it belongs to, and the
+# corresponding title element following the id.
+#
+# This script is very specific to HTML generated by asciidoctor and
+# following conventions of the Vulkan style guide.
+
+# Usage: map_html_anchors.py file.html > xrefMap.py
+
+import argparse
+import re
+import sys
+from lxml import etree
+
+def contains_any_of(words, wordlist):
+ """Returns True if any element of 'word' is contained in 'words'
+
+ - words - iterable of words to check against wordlist
+ - wordlist - iterable of words"""
+
+ for word in words:
+ if word in wordlist:
+ return True
+ return False
+
+sectNumberPat = re.compile(r'^(Table |)([0-9]+\.)+ *')
+
+def add_id(chapelem, idelem, id_map, chapter_id):
+ """Add a ID -> [ chapter ID, title] mapping.
+
+ - chapelem - Element for the chapter containing this ID
+ - idelem - Element for the ID itself
+ - id_map - dictionary containing the map
+ - chapter_id - chapter ID of chapelem"""
+
+ # The actual ID
+ id = idelem.get('id')
+
+ # Try to determine the title corresponding to this ID, or '' otherwise
+ if idelem.tag == 'a':
+ # <a id=> does not have a corresponding title element
+ id_title = ''
+ elif idelem.tag in (('h2', 'h3', 'h4', 'h4', 'h5', 'h6')):
+ # <h# id=> has ((#.)* *title) in the text of its element
+ id_title = ''.join(idelem.itertext())
+ elif idelem.tag == 'table':
+ # <table id=> may be followed by <caption class="title">
+ # with 'Table ##. caption' text
+ capelem = idelem.find('.//caption[@class="title"]')
+ if capelem is not None:
+ id_title = ''.join(capelem.itertext())
+ else:
+ id_title = 'NO TABLE CAPTION FOUND'
+ elif idelem.tag == 'div':
+ classes = idelem.get('class')
+ if classes is not None:
+ divclass = classes.split()
+
+ if contains_any_of((('admonitionblock', 'paragraph', 'sidebarblock')), divclass):
+ # <div> classes with no title elements (paragraphs or NOTEs)
+ id_title = ''
+ elif 'listingblock' in divclass:
+ # <div id= class="listingblock"> has title == id (used for API includes)
+ id_title = id
+ elif contains_any_of((('dlist', 'openblock')), divclass):
+ # <div> classes with titles in the text of the first
+ # <dt class="hdlist1"> element of the div
+ #
+ # "dlist" are mostly glossary elements
+ # "openblock" are mostly SPIR-V keywords
+ dtelem = idelem.find('.//dt[@class="hdlist1"]')
+ if dtelem is not None:
+ # This may not find text in child Elements of <dt>
+ id_title = ''.join(dtelem.itertext())
+ else:
+ # No dtelem text found, this probably means a label on an
+ # API open block
+ id_title = ''
+ elif contains_any_of((('ulist', 'imageblock')), divclass):
+ # <div> classes with titles in the first
+ # <div class="title"> element of the div
+ titleelem = idelem.find('.//div[@class="title"]')
+ if titleelem is not None:
+ id_title = ''.join(titleelem.itertext())
+ else:
+ # No <div class="title"> text found
+ id_title = ''
+ else:
+ id_title = ''
+ print(f'Cannot find title for <div id="{id}" class="{classes}"> - unrecognized class', file=sys.stderr)
+ else:
+ # <div id=> without a class may have a corresponding <h# id=> with the
+ # same id - in this case, the div will be thrown away when the
+ # following element is encountered.
+ id_title = ''
+
+ if id in id_map:
+ val = id_map[id]
+ print(f'Replacing key {id} -> ({val[0]}, {val[1]}) with ({chapter_id}, {id_title})', file=sys.stderr)
+
+ # Strip whitespace and leading table or section numbers, if present
+ id_title = sectNumberPat.sub('', id_title.strip())
+
+ # Map the xref to the chapter it came from and its title
+ id_map[id] = [ chapter_id, id_title ]
+
+def generate_map(id_map, filename, scripttype):
+ """Encode the ID map into the specified scripttype ('python' or
+ 'javascript') in the specified file."""
+
+ fp = open(filename, 'w')
+
+ # Python and JS are extremely similar when the output is just a
+ # dictionary of lists of strings.
+
+ if scripttype == 'javascript':
+ print('exports.xrefMap = {', file=fp)
+ else:
+ print('xrefMap = {', file=fp)
+
+ # Sort keys so the can be compared between runs
+ for id in sorted(id_map):
+ print(f" '{id}' : [ '{id_map[id][0]}', '{id_map[id][1]}' ],", file=fp)
+
+ print('}', file=fp)
+
+ fp.close()
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+
+ parser.add_argument('-jsfile', action='store',
+ default=None,
+ help='Specify name of JavaScript file to generate')
+ parser.add_argument('-pyfile', action='store',
+ default=None,
+ help='Specify name of Python file to generate')
+ parser.add_argument('files', metavar='filename', nargs=1,
+ help='HTML spec file to map IDs from')
+ args = parser.parse_args()
+
+ # Tags whose id elements are anchors (we are not concerned about other
+ # tags such as <svg>).
+ idtags = (('a', 'div', 'h2', 'h3', 'h4', 'h4', 'h5', 'h6', 'table'))
+
+ # Tags whose id elements we do not care about ('h2' is a special case)
+ rejected_tags = (('svg',
+ 'circle',
+ 'clippath',
+ 'defs',
+ 'ellipse',
+ 'g',
+ 'grid',
+ 'lineargradient',
+ 'marker',
+ 'metadata',
+ 'namedview',
+ 'path',
+ 'path-effect',
+ 'rect',
+ 'stop',
+ 'text',
+ 'tspan',
+ ))
+
+ parser = etree.HTMLParser()
+
+ # There is exactly one HTML filename
+ filename = args.files[0]
+ tree = etree.parse(filename, parser)
+
+ # Dictionary mapping an ID (anchor) to [chapter ID, ID title],
+ # where 'chapter ID' is the ID of the chapter it appears in
+ id_map = {}
+
+ # Find each <div class="sect1"> element, which corresponds to a
+ # chapter.
+ chapter_elems = tree.findall('.//div[@class="sect1"]')
+ for chapelem in chapter_elems:
+ chapter_id = ''
+ h2_elems = chapelem.findall('.//h2[@id]')
+ if len(h2_elems) != 1:
+ raise UserWarning(f'Error! <div> must have exactly 1 <h2> element, has {len(h2_elems)}')
+ else:
+ chapter_id = h2_elems[0].get('id')
+
+ for idelem in chapelem.findall('.//*[@id]'):
+ if idelem.tag in idtags:
+ add_id(chapelem, idelem, id_map, chapter_id)
+ True
+ elif idelem.tag in rejected_tags:
+ # print(f'Rejecting tag {idelem.tag}')
+ # Do nothing - for tags we know we do not care about
+ True
+ else:
+ print(f' Rejecting unknown tag with ID <{idelem.tag} id="{idelem.get("id")}"', file=sys.stderr)
+ True
+
+ if args.pyfile is not None:
+ generate_map(id_map, args.pyfile, 'python')
+ if args.jsfile is not None:
+ generate_map(id_map, args.jsfile, 'javascript')
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/parse_dependency.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/parse_dependency.py
new file mode 100755
index 00000000000..313b3c08306
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/parse_dependency.py
@@ -0,0 +1,424 @@
+#!/usr/bin/python3
+
+# Copyright 2022-2023 The Khronos Group Inc.
+# Copyright 2003-2019 Paul McGuire
+# SPDX-License-Identifier: MIT
+
+# apirequirements.py - parse 'depends' expressions in API XML
+# Supported methods:
+# dependency - the expression string
+#
+# evaluateDependency(dependency, isSupported) evaluates the expression,
+# returning a boolean result. isSupported takes an extension or version name
+# string and returns a boolean.
+#
+# dependencyLanguage(dependency) returns an English string equivalent
+# to the expression, suitable for header file comments.
+#
+# dependencyNames(dependency) returns a set of the extension and
+# version names in the expression.
+#
+# dependencyMarkup(dependency) returns a string containing asciidoctor
+# markup for English equivalent to the expression, suitable for extension
+# appendices.
+#
+# All may throw a ParseException if the expression cannot be parsed or is
+# not completely consumed by parsing.
+
+# Supported expressions at present:
+# - extension names
+# - '+' as AND connector
+# - ',' as OR connector
+# - parenthesization for grouping
+
+# Based on https://github.com/pyparsing/pyparsing/blob/master/examples/fourFn.py
+
+from pyparsing import (
+ Literal,
+ Word,
+ Group,
+ Forward,
+ alphas,
+ alphanums,
+ Regex,
+ ParseException,
+ CaselessKeyword,
+ Suppress,
+ delimitedList,
+ infixNotation,
+)
+import math
+import operator
+import pyparsing as pp
+import re
+
+def markupPassthrough(name):
+ """Pass a name (leaf or operator) through without applying markup"""
+ return name
+
+# A regexp matching Vulkan and VulkanSC core version names
+# The Conventions is_api_version_name() method is similar, but does not
+# return the matches.
+apiVersionNamePat = re.compile(r'(VK|VKSC)_VERSION_([0-9]+)_([0-9]+)')
+
+def apiVersionNameMatch(name):
+ """Return [ apivariant, major, minor ] if name is an API version name,
+ or [ None, None, None ] if it is not."""
+
+ match = apiVersionNamePat.match(name)
+ if match is not None:
+ return [ match.group(1), match.group(2), match.group(3) ]
+ else:
+ return [ None, None, None ]
+
+def leafMarkupAsciidoc(name):
+ """Markup a leaf name as an asciidoc link to an API version or extension
+ anchor.
+
+ - name - version or extension name"""
+
+ (apivariant, major, minor) = apiVersionNameMatch(name)
+
+ if apivariant is not None:
+ version = major + '.' + minor
+ if apivariant == 'VKSC':
+ # Vulkan SC has a different anchor pattern for version appendices
+ if version == '1.0':
+ return 'Vulkan SC 1.0'
+ else:
+ return f'<<versions-sc-{version}, Version SC {version}>>'
+ else:
+ return f'<<versions-{version}, Version {version}>>'
+ else:
+ return f'apiext:{name}'
+
+def leafMarkupC(name):
+ """Markup a leaf name as a C expression, using conventions of the
+ Vulkan Validation Layers
+
+ - name - version or extension name"""
+
+ (apivariant, major, minor) = apiVersionNameMatch(name)
+
+ if apivariant is not None:
+ return name
+ else:
+ return f'ext.{name}'
+
+opMarkupAsciidocMap = { '+' : 'and', ',' : 'or' }
+
+def opMarkupAsciidoc(op):
+ """Markup a operator as an asciidoc spec markup equivalent
+
+ - op - operator ('+' or ',')"""
+
+ return opMarkupAsciidocMap[op]
+
+opMarkupCMap = { '+' : '&&', ',' : '||' }
+
+def opMarkupC(op):
+ """Markup a operator as an C language equivalent
+
+ - op - operator ('+' or ',')"""
+
+ return opMarkupCMap[op]
+
+
+# Unfortunately global to be used in pyparsing
+exprStack = []
+
+def push_first(toks):
+ """Push a token on the global stack
+
+ - toks - first element is the token to push"""
+
+ exprStack.append(toks[0])
+
+# An identifier (version or extension name)
+dependencyIdent = Word(alphanums + '_')
+
+# Infix expression for depends expressions
+dependencyExpr = pp.infixNotation(dependencyIdent,
+ [ (pp.oneOf(', +'), 2, pp.opAssoc.LEFT), ])
+
+# BNF grammar for depends expressions
+_bnf = None
+def dependencyBNF():
+ """
+ boolop :: '+' | ','
+ extname :: Char(alphas)
+ atom :: extname | '(' expr ')'
+ expr :: atom [ boolop atom ]*
+ """
+ global _bnf
+ if _bnf is None:
+ and_, or_ = map(Literal, '+,')
+ lpar, rpar = map(Suppress, '()')
+ boolop = and_ | or_
+
+ expr = Forward()
+ expr_list = delimitedList(Group(expr))
+ atom = (
+ boolop[...]
+ + (
+ (dependencyIdent).setParseAction(push_first)
+ | Group(lpar + expr + rpar)
+ )
+ )
+
+ expr <<= atom + (boolop + atom).setParseAction(push_first)[...]
+ _bnf = expr
+ return _bnf
+
+
+# map operator symbols to corresponding arithmetic operations
+_opn = {
+ '+': operator.and_,
+ ',': operator.or_,
+}
+
+def evaluateStack(stack, isSupported):
+ """Evaluate an expression stack, returning a boolean result.
+
+ - stack - the stack
+ - isSupported - function taking a version or extension name string and
+ returning True or False if that name is supported or not."""
+
+ op, num_args = stack.pop(), 0
+ if isinstance(op, tuple):
+ op, num_args = op
+
+ if op in '+,':
+ # Note: operands are pushed onto the stack in reverse order
+ op2 = evaluateStack(stack, isSupported)
+ op1 = evaluateStack(stack, isSupported)
+ return _opn[op](op1, op2)
+ elif op[0].isalpha():
+ return isSupported(op)
+ else:
+ raise Exception(f'invalid op: {op}')
+
+def evaluateDependency(dependency, isSupported):
+ """Evaluate a dependency expression, returning a boolean result.
+
+ - dependency - the expression
+ - isSupported - function taking a version or extension name string and
+ returning True or False if that name is supported or not."""
+
+ global exprStack
+ exprStack = []
+ results = dependencyBNF().parseString(dependency, parseAll=True)
+ val = evaluateStack(exprStack[:], isSupported)
+ return val
+
+def evalDependencyLanguage(stack, leafMarkup, opMarkup, parenthesize, root):
+ """Evaluate an expression stack, returning an English equivalent
+
+ - stack - the stack
+ - leafMarkup, opMarkup, parenthesize - same as dependencyLanguage
+ - root - True only if this is the outer (root) expression level"""
+
+ op, num_args = stack.pop(), 0
+ if isinstance(op, tuple):
+ op, num_args = op
+ if op in '+,':
+ # Could parenthesize, not needed yet
+ rhs = evalDependencyLanguage(stack, leafMarkup, opMarkup, parenthesize, root = False)
+ opname = opMarkup(op)
+ lhs = evalDependencyLanguage(stack, leafMarkup, opMarkup, parenthesize, root = False)
+ if parenthesize and not root:
+ return f'({lhs} {opname} {rhs})'
+ else:
+ return f'{lhs} {opname} {rhs}'
+ elif op[0].isalpha():
+ # This is an extension or feature name
+ return leafMarkup(op)
+ else:
+ raise Exception(f'invalid op: {op}')
+
+def dependencyLanguage(dependency, leafMarkup, opMarkup, parenthesize):
+ """Return an API dependency expression translated to a form suitable for
+ asciidoctor conditionals or header file comments.
+
+ - dependency - the expression
+ - leafMarkup - function taking an extension / version name and
+ returning an equivalent marked up version
+ - opMarkup - function taking an operator ('+' / ',') name name and
+ returning an equivalent marked up version
+ - parenthesize - True if parentheses should be used in the resulting
+ expression, False otherwise"""
+
+ global exprStack
+ exprStack = []
+ results = dependencyBNF().parseString(dependency, parseAll=True)
+ return evalDependencyLanguage(exprStack, leafMarkup, opMarkup, parenthesize, root = True)
+
+# aka specmacros = False
+def dependencyLanguageComment(dependency):
+ """Return dependency expression translated to a form suitable for
+ comments in headers of emitted C code, as used by the
+ docgenerator."""
+ return dependencyLanguage(dependency, leafMarkup = markupPassthrough, opMarkup = opMarkupAsciidoc, parenthesize = True)
+
+# aka specmacros = True
+def dependencyLanguageSpecMacros(dependency):
+ """Return dependency expression translated to a form suitable for
+ comments in headers of emitted C code, as used by the
+ interfacegenerator."""
+ return dependencyLanguage(dependency, leafMarkup = leafMarkupAsciidoc, opMarkup = opMarkupAsciidoc, parenthesize = False)
+
+def dependencyLanguageC(dependency):
+ """Return dependency expression translated to a form suitable for
+ use in C expressions"""
+ return dependencyLanguage(dependency, leafMarkup = leafMarkupC, opMarkup = opMarkupC, parenthesize = True)
+
+def evalDependencyNames(stack):
+ """Evaluate an expression stack, returning the set of extension and
+ feature names used in the expression.
+
+ - stack - the stack"""
+
+ op, num_args = stack.pop(), 0
+ if isinstance(op, tuple):
+ op, num_args = op
+ if op in '+,':
+ # Do not evaluate the operation. We only care about the names.
+ return evalDependencyNames(stack) | evalDependencyNames(stack)
+ elif op[0].isalpha():
+ return { op }
+ else:
+ raise Exception(f'invalid op: {op}')
+
+def dependencyNames(dependency):
+ """Return a set of the extension and version names in an API dependency
+ expression. Used when determining transitive dependencies for spec
+ generation with specific extensions included.
+
+ - dependency - the expression"""
+
+ global exprStack
+ exprStack = []
+ results = dependencyBNF().parseString(dependency, parseAll=True)
+ # print(f'names(): stack = {exprStack}')
+ return evalDependencyNames(exprStack)
+
+def markupTraverse(expr, level = 0, root = True):
+ """Recursively process a dependency in infix form, transforming it into
+ asciidoctor markup with expression nesting indicated by indentation
+ level.
+
+ - expr - expression to process
+ - level - indentation level to render expression at
+ - root - True only on initial call"""
+
+ if level > 0:
+ prefix = '{nbsp}{nbsp}' * level * 2 + ' '
+ else:
+ prefix = ''
+ str = ''
+
+ for elem in expr:
+ if isinstance(elem, pp.ParseResults):
+ if not root:
+ nextlevel = level + 1
+ else:
+ # Do not indent the outer expression
+ nextlevel = level
+
+ str = str + markupTraverse(elem, level = nextlevel, root = False)
+ elif elem in ('+', ','):
+ str = str + f'{prefix}{opMarkupAsciidoc(elem)} +\n'
+ else:
+ str = str + f'{prefix}{leafMarkupAsciidoc(elem)} +\n'
+
+ return str
+
+def dependencyMarkup(dependency):
+ """Return asciidoctor markup for a human-readable equivalent of an API
+ dependency expression, suitable for use in extension appendix
+ metadata.
+
+ - dependency - the expression"""
+
+ parsed = dependencyExpr.parseString(dependency)
+ return markupTraverse(parsed)
+
+if __name__ == "__main__":
+
+ termdict = {
+ 'VK_VERSION_1_1' : True,
+ 'false' : False,
+ 'true' : True,
+ }
+ termSupported = lambda name: name in termdict and termdict[name]
+
+ def test(dependency, expected):
+ val = False
+ try:
+ val = evaluateDependency(dependency, termSupported)
+ except ParseException as pe:
+ print(dependency, f'failed parse: {dependency}')
+ except Exception as e:
+ print(dependency, f'failed eval: {dependency}')
+
+ if val == expected:
+ True
+ # print(f'{dependency} = {val} (as expected)')
+ else:
+ print(f'{dependency} ERROR: {val} != {expected}')
+
+ # Verify expressions are evaluated left-to-right
+
+ test('false,false+false', False)
+ test('false,false+true', False)
+ test('false,true+false', False)
+ test('false,true+true', True)
+ test('true,false+false', False)
+ test('true,false+true', True)
+ test('true,true+false', False)
+ test('true,true+true', True)
+
+ test('false,(false+false)', False)
+ test('false,(false+true)', False)
+ test('false,(true+false)', False)
+ test('false,(true+true)', True)
+ test('true,(false+false)', True)
+ test('true,(false+true)', True)
+ test('true,(true+false)', True)
+ test('true,(true+true)', True)
+
+
+ test('false+false,false', False)
+ test('false+false,true', True)
+ test('false+true,false', False)
+ test('false+true,true', True)
+ test('true+false,false', False)
+ test('true+false,true', True)
+ test('true+true,false', True)
+ test('true+true,true', True)
+
+ test('false+(false,false)', False)
+ test('false+(false,true)', False)
+ test('false+(true,false)', False)
+ test('false+(true,true)', False)
+ test('true+(false,false)', False)
+ test('true+(false,true)', True)
+ test('true+(true,false)', True)
+ test('true+(true,true)', True)
+
+ # Check formatting
+ for dependency in [
+ #'true',
+ #'true+true+false',
+ 'true+false',
+ 'true+(true+false),(false,true)',
+ #'true+((true+false),(false,true))',
+ 'VK_VERSION_1_0+VK_KHR_display',
+ #'VK_VERSION_1_1+(true,false)',
+ ]:
+ print(f'expr = {dependency}\n{dependencyMarkup(dependency)}')
+ print(f' spec language = {dependencyLanguageSpecMacros(dependency)}')
+ print(f' comment language = {dependencyLanguageComment(dependency)}')
+ print(f' C language = {dependencyLanguageC(dependency)}')
+ print(f' names = {dependencyNames(dependency)}')
+ print(f' value = {evaluateDependency(dependency, termSupported)}')
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/promote.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/promote.py
new file mode 100755
index 00000000000..417b35763d9
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/promote.py
@@ -0,0 +1,173 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Retroactively insert markup in show both 1.1 core features and KHR
+# extensions they were promoted from.
+
+# Usage: promote.py [-overwrite] [-out dir] [-suffix str] files
+# -overwrite updates in place (can be risky, make sure there are backups)
+# -out specifies directory to create output file in, default 'out'
+# -suffix specifies suffix to add to output files, default ''
+# files are asciidoc source files from the Vulkan spec to reflow.
+
+# For error and file-loading interfaces only
+import argparse, copy, os, pdb, re, string, sys
+from reflib import *
+from promoted import *
+
+global anchor
+anchor = 0
+
+def anchorname(anchor):
+ return 'promoted-' + str(anchor)
+
+def printanchor(fp):
+ # Anchor index for navigation
+ global anchor
+
+ print('[[' + anchorname(anchor) + ']]', file=fp)
+ print('This anchor:', anchorname(anchor), file=fp)
+ print('<<' + anchorname(anchor+1) + ', OINK>>', file=fp)
+ anchor = anchor + 1
+
+# promote a core interface and include the extension it was promoted from
+# line - matching line with 1.1 interface
+# type - 'protos', 'structs', 'flags', 'enums'
+# name - interface name
+# extension - name of extension interface was promoted from
+# fp - output filename
+def promote(line, type, name, extension, fp):
+ if type == 'protos':
+ # printanchor(fp)
+ print('ifdef::VK_VERSION_1_1[]', file=fp)
+ print(line, file=fp, end='')
+ print('endif::VK_VERSION_1_1[]', file=fp)
+ print('', file=fp)
+ print('ifdef::VK_VERSION_1_1+' + extension +
+ '[or the equivalent command]', file=fp)
+ print('', file=fp)
+ print('ifdef::' + extension + '[]', file=fp)
+ print('include::../api/' + type + '/' + name + 'KHR.adoc[]', file=fp)
+ print('endif::' + extension + '[]', file=fp)
+ del promoted[name]
+ elif type == 'structs' or type == 'enums' or type == 'flags' or type == 'handles':
+ # printanchor(fp)
+ print(line, file=fp, end='')
+ print('', file=fp)
+ print('ifdef::' + extension + '[]', file=fp)
+ print('or the equivalent', file=fp)
+ print('', file=fp)
+ print('include::../api/' + type + '/' + name + 'KHR.adoc[]', file=fp)
+ print('endif::' + extension + '[]', file=fp)
+ del promoted[name]
+ else:
+ logWarn('Unrecognized promoted type', type, 'for interface', name)
+ print(line, file=fp, end='')
+
+
+def promoteFile(filename, args):
+ logDiag('promote: filename', filename)
+
+ lines = loadFile(filename)
+ if (lines == None):
+ return
+
+ # Output file handle and promote object for this file. There are no race
+ # conditions on overwriting the input, but it is not recommended unless
+ # you have backing store such as git.
+
+ if args.overwrite:
+ outFilename = filename
+ else:
+ outFilename = args.outDir + '/' + os.path.basename(filename) + args.suffix
+
+ try:
+ fp = open(outFilename, 'w', encoding='utf8')
+ True
+ except:
+ logWarn('Cannot open output file', filename, ':', sys.exc_info()[0])
+ return None
+
+ lineno = 0
+ for line in lines:
+ lineno = lineno + 1
+
+ matches = includePat.search(line)
+ if matches != None:
+ type = matches.group('type')
+ name = matches.group('name')
+ if name in promoted:
+ extension = promoted[name]['extension']
+ if extension:
+ # Promote core interface
+ promote(line, type, name, promoted[name]['extension'], fp)
+ continue
+ # Fallthrough
+ print(line, file=fp, end='')
+
+ fp.close()
+
+def promoteAllAdocFiles(folder_to_promote, args):
+ for root, subdirs, files in os.walk(folder_to_promote):
+ for file in files:
+ if file.endswith(".adoc"):
+ file_path = os.path.join(root, file)
+ promoteFile(file_path, args)
+ for subdir in subdirs:
+ sub_folder = os.path.join(root, subdir)
+ print('Sub-folder = %s' % sub_folder)
+ if not (subdir.lower() == "scripts") and not (subdir.lower() == "style"):
+ print(' Parsing = %s' % sub_folder)
+ promoteAllAdocFiles(sub_folder, args)
+ else:
+ print(' Skipping = %s' % sub_folder)
+
+# Patterns used to recognize interesting lines in an asciidoc source file.
+# These patterns are only compiled once.
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-diag', action='store', dest='diagFile',
+ help='Set the diagnostic file')
+ parser.add_argument('-warn', action='store', dest='warnFile',
+ help='Set the warning file')
+ parser.add_argument('-log', action='store', dest='logFile',
+ help='Set the log file for both diagnostics and warnings')
+ parser.add_argument('-overwrite', action='store_true',
+ help='Overwrite input filenames instead of writing different output filenames')
+ parser.add_argument('-out', action='store', dest='outDir',
+ default='out',
+ help='Set the output directory in which updated files are generated (default: out)')
+ parser.add_argument('-suffix', action='store', dest='suffix',
+ default='',
+ help='Set the suffix added to updated file names (default: none)')
+ parser.add_argument('files', metavar='filename', nargs='*',
+ help='a filename to promote text in')
+ parser.add_argument('--version', action='version', version='%(prog)s 1.0')
+
+ args = parser.parse_args()
+
+ setLogFile(True, True, args.logFile)
+ setLogFile(True, False, args.diagFile)
+ setLogFile(False, True, args.warnFile)
+
+ if args.overwrite:
+ logWarn('promote.py: will overwrite all input files')
+
+ # If no files are specified, promote the entire specification chapters folder
+ if len(args.files) == 0:
+ folder_to_promote = os.getcwd()
+ folder_to_promote += '/chapters'
+ promoteAllAdocFiles(folder_to_promote, args)
+ else:
+ for file in args.files:
+ promoteFile(file, args)
+
+ print('At end, promoted interfaces remaining:')
+ for key in promoted:
+ if promoted[key]['extension'] != None:
+ print('\t' + key)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/pygenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/pygenerator.py
new file mode 100644
index 00000000000..6e0e8f98107
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/pygenerator.py
@@ -0,0 +1,94 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from generator import OutputGenerator, enquote, write
+from scriptgenerator import ScriptOutputGenerator
+import pprint
+
+class PyOutputGenerator(ScriptOutputGenerator):
+ """PyOutputGenerator - subclass of ScriptOutputGenerator.
+ Generates Python data structures describing API names and
+ relationships."""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ def beginDict(self, name):
+ """String starting definition of a named dictionary"""
+ return f'{name} = {{'
+
+ def endDict(self):
+ """ String ending definition of a named dictionary"""
+ return '}'
+
+ def writeDict(self, dict, name, printValues = True):
+ """Write dictionary as a Python dictionary with the given name.
+ If printValues is False, just output keys with None values."""
+
+ write(self.beginDict(name), file=self.outFile)
+ for key in sorted(dict):
+ if printValues:
+ value = enquote(dict[key])
+ else:
+ value = 'None'
+ write(f'{enquote(key)} : {value},', file=self.outFile)
+ write(self.endDict(), file=self.outFile)
+
+ def writeList(self, l, name):
+ """Write list l as a Ruby hash with the given name"""
+
+ self.writeDict(l, name, printValues = False)
+
+ def endFile(self):
+ # Creates the inverse mapping of nonexistent APIs to their aliases.
+ super().createInverseMap()
+
+ # Print out all the dictionaries as Python strings.
+ # Could just print(dict) but that is not human-readable
+ dicts = ( [ self.basetypes, 'basetypes' ],
+ [ self.consts, 'consts' ],
+ [ self.enums, 'enums' ],
+ [ self.flags, 'flags' ],
+ [ self.funcpointers, 'funcpointers' ],
+ [ self.protos, 'protos' ],
+ [ self.structs, 'structs' ],
+ [ self.handles, 'handles' ],
+ [ self.defines, 'defines' ],
+ [ self.typeCategory, 'typeCategory' ],
+ [ self.alias, 'alias' ],
+ [ self.nonexistent, 'nonexistent' ],
+ )
+
+ for (dict, name) in dicts:
+ self.writeDict(dict, name)
+
+ # Dictionary containing the relationships of a type
+ # (e.g. a dictionary with each related type as keys).
+ # Could just print(self.mapDict), but prefer something
+ # human-readable and stable-ordered
+ write(self.beginDict('mapDict'), file=self.outFile)
+ for baseType in sorted(self.mapDict.keys()):
+ write('{} : {},'.format(enquote(baseType),
+ pprint.pformat(self.mapDict[baseType])), file=self.outFile)
+ write(self.endDict(), file=self.outFile)
+
+ # List of included feature names
+ self.writeList(sorted(self.features), 'features')
+
+ # Generate feature <-> interface mappings
+ for feature in self.features:
+ self.mapInterfaces(feature)
+
+ # Write out the reverse map from APIs to requiring features
+ write(self.beginDict('requiredBy'), file=self.outFile)
+ for api in sorted(self.apimap):
+ # Sort requirements by first feature in each one
+ deps = sorted(self.apimap[api], key = lambda dep: dep[0])
+ reqs = ', '.join('({}, {})'.format(enquote(dep[0]), enquote(dep[1])) for dep in deps)
+ write('{} : [{}],'.format(enquote(api), reqs), file=self.outFile)
+ write(self.endDict(), file=self.outFile)
+
+ super().endFile()
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflib.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflib.py
new file mode 100644
index 00000000000..db9353de84b
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflib.py
@@ -0,0 +1,664 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Utility functions for automatic ref page generation and other script stuff
+
+import io
+import re
+import sys
+import subprocess
+
+# global errFile, warnFile, diagFile
+
+errFile = sys.stderr
+warnFile = sys.stdout
+diagFile = None
+logSourcefile = None
+logProcname = None
+logLine = None
+
+def unescapeQuotes(s):
+ """Remove \' escape sequences in a string (refpage description)"""
+ return s.replace('\\\'', '\'')
+
+def write(*args, **kwargs ):
+ file = kwargs.pop('file',sys.stdout)
+ end = kwargs.pop('end','\n')
+ file.write(' '.join(str(arg) for arg in args))
+ file.write(end)
+
+def setLogSourcefile(filename):
+ """Metadata which may be printed (if not None) for diagnostic messages"""
+ global logSourcefile
+ logSourcefile = filename
+
+def setLogProcname(procname):
+ global logProcname
+ logProcname = procname
+
+def setLogLine(line):
+ global logLine
+ logLine = line
+
+def logHeader(severity):
+ """Generate prefix for a diagnostic line using metadata and severity"""
+ global logSourcefile, logProcname, logLine
+
+ msg = severity + ': '
+ if logProcname:
+ msg = msg + ' in ' + logProcname
+ if logSourcefile:
+ msg = msg + ' for ' + logSourcefile
+ if logLine:
+ msg = msg + ' line ' + str(logLine)
+ return msg + ' '
+
+def setLogFile(setDiag, setWarn, filename):
+ """Set the file handle to log either or both warnings and diagnostics to.
+
+ - setDiag and setWarn are True if the corresponding handle is to be set.
+ - filename is None for no logging, '-' for stdout, or a pathname."""
+ global diagFile, warnFile
+
+ if filename is None:
+ return
+
+ if filename == '-':
+ fp = sys.stdout
+ else:
+ fp = open(filename, 'w', encoding='utf-8')
+
+ if setDiag:
+ diagFile = fp
+ if setWarn:
+ warnFile = fp
+
+def logDiag(*args, **kwargs):
+ file = kwargs.pop('file', diagFile)
+ end = kwargs.pop('end','\n')
+ if file is not None:
+ file.write(logHeader('DIAG') + ' '.join(str(arg) for arg in args))
+ file.write(end)
+
+def logWarn(*args, **kwargs):
+ file = kwargs.pop('file', warnFile)
+ end = kwargs.pop('end','\n')
+ if file is not None:
+ file.write(logHeader('WARN') + ' '.join(str(arg) for arg in args))
+ file.write(end)
+
+def logErr(*args, **kwargs):
+ file = kwargs.pop('file', errFile)
+ end = kwargs.pop('end','\n')
+
+ strfile = io.StringIO()
+ strfile.write(logHeader('ERROR') + ' '.join(str(arg) for arg in args))
+ strfile.write(end)
+
+ if file is not None:
+ file.write(strfile.getvalue())
+ raise UserWarning(strfile.getvalue())
+
+def isempty(s):
+ """Return True if s is nothing but white space, False otherwise"""
+ return len(''.join(s.split())) == 0
+
+class pageInfo:
+ """Information about a ref page relative to the file it is extracted from."""
+ def __init__(self):
+ self.extractPage = True
+ """True if page should be extracted"""
+
+ self.Warning = None
+ """string warning if page is suboptimal or cannot be generated"""
+
+ self.embed = False
+ """False or the name of the ref page this include is embedded within"""
+
+ self.type = None
+ """refpage type attribute - 'structs', 'protos', 'freeform', etc."""
+
+ self.name = None
+ """struct/proto/enumerant/etc. name"""
+
+ self.desc = None
+ """short description of ref page"""
+
+ self.begin = None
+ """index of first line of the page (heuristic or // refBegin)"""
+
+ self.include = None
+ """index of include:: line defining the page"""
+
+ self.param = None
+ """index of first line of parameter/member definitions"""
+
+ self.body = None
+ """index of first line of body text"""
+
+ self.validity = None
+ """index of validity include"""
+
+ self.end = None
+ """index of last line of the page (heuristic validity include, or // refEnd)"""
+
+ self.alias = ''
+ """aliases of this name, if supplied, or ''"""
+
+ self.refs = ''
+ """cross-references on // refEnd line, if supplied"""
+
+ self.spec = None
+ """'spec' attribute in refpage open block, if supplied, or None for the default ('api') type"""
+
+ self.anchor = None
+ """'anchor' attribute in refpage open block, if supplied, or inferred to be the same as the 'name'"""
+
+def printPageInfoField(desc, line, file):
+ """Print a single field of a pageInfo struct, possibly None.
+
+ - desc - string description of field
+ - line - field value or None
+ - file - indexed by line"""
+ if line is not None:
+ logDiag(desc + ':', line + 1, '\t-> ', file[line], end='')
+ else:
+ logDiag(desc + ':', line)
+
+def printPageInfo(pi, file):
+ """Print out fields of a pageInfo struct
+
+ - pi - pageInfo
+ - file - indexed by pageInfo"""
+ logDiag('TYPE: ', pi.type)
+ logDiag('NAME: ', pi.name)
+ logDiag('WARNING:', pi.Warning)
+ logDiag('EXTRACT:', pi.extractPage)
+ logDiag('EMBED: ', pi.embed)
+ logDiag('DESC: ', pi.desc)
+ printPageInfoField('BEGIN ', pi.begin, file)
+ printPageInfoField('INCLUDE ', pi.include, file)
+ printPageInfoField('PARAM ', pi.param, file)
+ printPageInfoField('BODY ', pi.body, file)
+ printPageInfoField('VALIDITY', pi.validity, file)
+ printPageInfoField('END ', pi.end, file)
+ logDiag('REFS: "' + pi.refs + '"')
+
+def prevPara(file, line):
+ """Go back one paragraph from the specified line and return the line number
+ of the first line of that paragraph.
+
+ Paragraphs are delimited by blank lines. It is assumed that the
+ current line is the first line of a paragraph.
+
+ - file is an array of strings
+ - line is the starting point (zero-based)"""
+ # Skip over current paragraph
+ while (line >= 0 and not isempty(file[line])):
+ line = line - 1
+ # Skip over white space
+ while (line >= 0 and isempty(file[line])):
+ line = line - 1
+ # Skip to first line of previous paragraph
+ while (line >= 1 and not isempty(file[line-1])):
+ line = line - 1
+ return line
+
+def nextPara(file, line):
+ """Go forward one paragraph from the specified line and return the line
+ number of the first line of that paragraph.
+
+ Paragraphs are delimited by blank lines. It is assumed that the
+ current line is standalone (which is bogus).
+
+ - file is an array of strings
+ - line is the starting point (zero-based)"""
+ maxLine = len(file) - 1
+ # Skip over current paragraph
+ while (line != maxLine and not isempty(file[line])):
+ line = line + 1
+ # Skip over white space
+ while (line != maxLine and isempty(file[line])):
+ line = line + 1
+ return line
+
+def lookupPage(pageMap, name):
+ """Return (creating if needed) the pageInfo entry in pageMap for name"""
+ if name not in pageMap:
+ pi = pageInfo()
+ pi.name = name
+ pageMap[name] = pi
+ else:
+ pi = pageMap[name]
+ return pi
+
+def loadFile(filename):
+ """Load a file into a list of strings. Return the (list, newline_string) or (None, None) on failure"""
+ newline_string = "\n"
+ try:
+ with open(filename, 'rb') as fp:
+ contents = fp.read()
+ if contents.count(b"\r\n") > 1:
+ newline_string = "\r\n"
+
+ with open(filename, 'r', encoding='utf-8') as fp:
+ lines = fp.readlines()
+ except:
+ logWarn('Cannot open file', filename, ':', sys.exc_info()[0])
+ return None, None
+
+ return lines, newline_string
+
+def clampToBlock(line, minline, maxline):
+ """Clamp a line number to be in the range [minline,maxline].
+
+ If the line number is None, just return it.
+ If minline is None, do not clamp to that value."""
+ if line is None:
+ return line
+ if minline and line < minline:
+ return minline
+ if line > maxline:
+ return maxline
+
+ return line
+
+def fixupRefs(pageMap, specFile, file):
+ """Fill in missing fields in pageInfo structures, to the extent they can be
+ inferred.
+
+ - pageMap - dictionary of pageInfo structures
+ - specFile - filename
+ - file - list of strings making up the file, indexed by pageInfo"""
+ # All potential ref pages are now in pageMap. Process them to
+ # identify actual page start/end/description boundaries, if
+ # not already determined from the text.
+ for name in sorted(pageMap.keys()):
+ pi = pageMap[name]
+
+ # # If nothing is found but an include line with no begin, validity,
+ # # or end, this is not intended as a ref page (yet). Set the begin
+ # # line to the include line, so autogeneration can at least
+ # # pull the include out, but mark it not to be extracted.
+ # # Examples include the host sync table includes in
+ # # chapters/fundamentals.adoc and the table of Vk*Flag types in
+ # # appendices/boilerplate.adoc.
+ # if pi.begin is None and pi.validity is None and pi.end is None:
+ # pi.begin = pi.include
+ # pi.extractPage = False
+ # pi.Warning = 'No begin, validity, or end lines identified'
+ # continue
+
+ # Using open block delimiters, ref pages must *always* have a
+ # defined begin and end. If either is undefined, that is fatal.
+ if pi.begin is None:
+ pi.extractPage = False
+ pi.Warning = 'Can\'t identify begin of ref page open block'
+ continue
+
+ if pi.end is None:
+ pi.extractPage = False
+ pi.Warning = 'Can\'t identify end of ref page open block'
+ continue
+
+ # If there is no description of the page, infer one from the type
+ if pi.desc is None:
+ if pi.type is not None:
+ # pi.desc = pi.type[0:len(pi.type)-1] + ' (no short description available)'
+ pi.Warning = 'No short description available; could infer from the type and name'
+ else:
+ pi.extractPage = False
+ pi.Warning = 'No short description available, cannot infer from the type'
+ continue
+
+ # Try to determine where the parameter and body sections of the page
+ # begin. funcpointer, proto, and struct pages infer the location of
+ # the parameter and body sections. Other pages infer the location of
+ # the body, but have no parameter sections.
+ #
+ # Probably some other types infer this as well - refer to list of
+ # all page types in genRef.py:emitPage()
+ if pi.include is not None:
+ if pi.type in ['funcpointers', 'protos', 'structs']:
+ pi.param = nextPara(file, pi.include)
+ if pi.body is None:
+ pi.body = nextPara(file, pi.param)
+ else:
+ if pi.body is None:
+ pi.body = nextPara(file, pi.include)
+ else:
+ pi.Warning = 'Page does not have an API definition include::'
+
+ # It is possible for the inferred param and body lines to run past
+ # the end of block, if, for example, there is no parameter section.
+ pi.param = clampToBlock(pi.param, pi.include, pi.end)
+ pi.body = clampToBlock(pi.body, pi.param, pi.end)
+
+ # We can get to this point with .include, .param, and .validity
+ # all being None, indicating those sections were not found.
+
+ logDiag('fixupRefs: after processing,', pi.name, 'looks like:')
+ printPageInfo(pi, file)
+
+ # Now that all the valid pages have been found, try to make some
+ # inferences about invalid pages.
+ #
+ # If a reference without a .end is entirely inside a valid reference,
+ # then it is intentionally embedded - may want to create an indirect
+ # page that links into the embedding page. This is done by a very
+ # inefficient double loop, but the loop depth is small.
+ for name in sorted(pageMap.keys()):
+ pi = pageMap[name]
+
+ if pi.end is None:
+ for embedName in sorted(pageMap.keys()):
+ logDiag('fixupRefs: comparing', pi.name, 'to', embedName)
+ embed = pageMap[embedName]
+ # Do not check embeddings which are themselves invalid
+ if not embed.extractPage:
+ logDiag('Skipping check for embedding in:', embed.name)
+ continue
+ if embed.begin is None or embed.end is None:
+ logDiag('fixupRefs:', name + ':',
+ 'can\'t compare to unanchored ref:', embed.name,
+ 'in', specFile, 'at line', pi.include )
+ printPageInfo(pi, file)
+ printPageInfo(embed, file)
+ # If an embed is found, change the error to a warning
+ elif (pi.include is not None and pi.include >= embed.begin and
+ pi.include <= embed.end):
+ logDiag('fixupRefs: Found embed for:', name,
+ 'inside:', embedName,
+ 'in', specFile, 'at line', pi.include )
+ pi.embed = embed.name
+ pi.Warning = 'Embedded in definition for ' + embed.name
+ break
+ else:
+ logDiag('fixupRefs: No embed match for:', name,
+ 'inside:', embedName, 'in', specFile,
+ 'at line', pi.include)
+
+
+def compatiblePageTypes(refpage_type, pagemap_type):
+ """Returns whether two refpage 'types' (categories) are compatible -
+ this is only true for 'consts' and 'enums' types."""
+
+ constsEnums = [ 'consts', 'enums' ]
+
+ if refpage_type == pagemap_type:
+ return True
+ if refpage_type in constsEnums and pagemap_type in constsEnums:
+ return True
+ return False
+
+# Patterns used to recognize interesting lines in an asciidoc source file.
+# These patterns are only compiled once.
+endifPat = re.compile(r'^endif::(?P<condition>[\w_+,]+)\[\]')
+beginPat = re.compile(r'^\[open,(?P<attribs>refpage=.*)\]')
+# attribute key/value pairs of an open block
+attribStr = r"([a-z]+)='([^'\\]*(?:\\.[^'\\]*)*)'"
+attribPat = re.compile(attribStr)
+bodyPat = re.compile(r'^// *refBody')
+errorPat = re.compile(r'^// *refError')
+
+# This regex transplanted from check_spec_links
+# It looks for either OpenXR or Vulkan generated file conventions, and for
+# the api/validity include (generated_type), protos/struct/etc path
+# (category), and API name (entity_name). It could be put into the API
+# conventions object.
+INCLUDE = re.compile(
+ r'include::(?P<directory_traverse>((../){1,4}|\{generated\}/)(generated/)?)(?P<generated_type>[\w]+)/(?P<category>\w+)/(?P<entity_name>[^./]+).adoc[\[][\]]')
+
+def findRefs(file, filename):
+ """Identify reference pages in a list of strings, returning a dictionary of
+ pageInfo entries for each one found, or None on failure."""
+ setLogSourcefile(filename)
+ setLogProcname('findRefs')
+
+ # To reliably detect the open blocks around reference pages, we must
+ # first detect the '[open,refpage=...]' markup delimiting the block;
+ # skip past the '--' block delimiter on the next line; and identify the
+ # '--' block delimiter closing the page.
+ # This cannot be done solely with pattern matching, and requires state to
+ # track 'inside/outside block'.
+ # When looking for open blocks, possible states are:
+ # 'outside' - outside a block
+ # 'start' - have found the '[open...]' line
+ # 'inside' - have found the following '--' line
+ openBlockState = 'outside'
+
+ # Dictionary of interesting line numbers and strings related to an API
+ # name
+ pageMap = {}
+
+ numLines = len(file)
+ line = 0
+
+ # Track the pageInfo object corresponding to the current open block
+ pi = None
+
+ while (line < numLines):
+ setLogLine(line)
+
+ # Only one of the patterns can possibly match. Add it to
+ # the dictionary for that name.
+
+ # [open,refpage=...] starting a refpage block
+ matches = beginPat.search(file[line])
+ if matches is not None:
+ logDiag('Matched open block pattern')
+ attribs = matches.group('attribs')
+
+ # If the previous open block was not closed, raise an error
+ if openBlockState != 'outside':
+ logErr('Nested open block starting at line', line, 'of',
+ filename)
+
+ openBlockState = 'start'
+
+ # Parse the block attributes
+ matches = attribPat.findall(attribs)
+
+ # Extract each attribute
+ name = None
+ desc = None
+ refpage_type = None
+ spec_type = None
+ anchor = None
+ alias = None
+ xrefs = None
+
+ for (key,value) in matches:
+ logDiag('got attribute', key, '=', value)
+ if key == 'refpage':
+ name = value
+ elif key == 'desc':
+ desc = unescapeQuotes(value)
+ elif key == 'type':
+ refpage_type = value
+ elif key == 'spec':
+ spec_type = value
+ elif key == 'anchor':
+ anchor = value
+ elif key == 'alias':
+ alias = value
+ elif key == 'xrefs':
+ xrefs = value
+ else:
+ logWarn('unknown open block attribute:', key)
+
+ if name is None or desc is None or refpage_type is None:
+ logWarn('missing one or more required open block attributes:'
+ 'refpage, desc, or type')
+ # Leave pi is None so open block delimiters are ignored
+ else:
+ pi = lookupPage(pageMap, name)
+ pi.desc = desc
+ # Must match later type definitions in interface/validity includes
+ pi.type = refpage_type
+ pi.spec = spec_type
+ pi.anchor = anchor
+ if alias:
+ pi.alias = alias
+ if xrefs:
+ pi.refs = xrefs
+ logDiag('open block for', name, 'added DESC =', desc,
+ 'TYPE =', refpage_type, 'ALIAS =', alias,
+ 'XREFS =', xrefs, 'SPEC =', spec_type,
+ 'ANCHOR =', anchor)
+
+ line = line + 1
+ continue
+
+ # '--' starting or ending and open block
+ if file[line].rstrip() == '--':
+ if openBlockState == 'outside':
+ # Only refpage open blocks should use -- delimiters
+ logWarn('Unexpected double-dash block delimiters')
+ elif openBlockState == 'start':
+ # -- delimiter following [open,refpage=...]
+ openBlockState = 'inside'
+
+ if pi is None:
+ logWarn('no pageInfo available for opening -- delimiter')
+ else:
+ pi.begin = line + 1
+ logDiag('opening -- delimiter: added BEGIN =', pi.begin)
+ elif openBlockState == 'inside':
+ # -- delimiter ending an open block
+ if pi is None:
+ logWarn('no pageInfo available for closing -- delimiter')
+ else:
+ pi.end = line - 1
+ logDiag('closing -- delimiter: added END =', pi.end)
+
+ openBlockState = 'outside'
+ pi = None
+ else:
+ logWarn('unknown openBlockState:', openBlockState)
+
+ line = line + 1
+ continue
+
+ matches = INCLUDE.search(file[line])
+ if matches is not None:
+ # Something got included, not sure what yet.
+ gen_type = matches.group('generated_type')
+ refpage_type = matches.group('category')
+ name = matches.group('entity_name')
+
+ # This will never match in OpenCL
+ if gen_type == 'validity':
+ logDiag('Matched validity pattern')
+ if pi is not None:
+ if pi.type and not compatiblePageTypes(refpage_type, pi.type):
+ logWarn('ERROR: pageMap[' + name + '] type:',
+ pi.type, 'does not match type:', refpage_type)
+ pi.type = refpage_type
+ pi.validity = line
+ logDiag('added TYPE =', pi.type, 'VALIDITY =', pi.validity)
+ else:
+ logWarn('validity include:: line NOT inside block')
+
+ line = line + 1
+ continue
+
+ if gen_type == 'api':
+ logDiag('Matched include pattern')
+ if pi is not None:
+ if pi.include is not None:
+ logDiag('found multiple includes for this block')
+ if pi.type and not compatiblePageTypes(refpage_type, pi.type):
+ logWarn('ERROR: pageMap[' + name + '] type:',
+ pi.type, 'does not match type:', refpage_type)
+ pi.type = refpage_type
+ pi.include = line
+ logDiag('added TYPE =', pi.type, 'INCLUDE =', pi.include)
+ else:
+ logWarn('interface include:: line NOT inside block')
+
+ line = line + 1
+ continue
+
+ logDiag('ignoring unrecognized include line ', matches.group())
+
+ # Vulkan 1.1 markup allows the last API include construct to be
+ # followed by an asciidoctor endif:: construct (and also preceded,
+ # at some distance).
+ # This looks for endif:: immediately following an include:: line
+ # and, if found, moves the include boundary to this line.
+ matches = endifPat.search(file[line])
+ if matches is not None and pi is not None:
+ if pi.include == line - 1:
+ logDiag('Matched endif pattern following include; moving include')
+ pi.include = line
+ else:
+ logDiag('Matched endif pattern (not following include)')
+
+ line = line + 1
+ continue
+
+ matches = bodyPat.search(file[line])
+ if matches is not None:
+ logDiag('Matched // refBody pattern')
+ if pi is not None:
+ pi.body = line
+ logDiag('added BODY =', pi.body)
+ else:
+ logWarn('// refBody line NOT inside block')
+
+ line = line + 1
+ continue
+
+ # OpenCL spec uses // refError to tag "validity" (Errors) language,
+ # instead of /validity/ includes.
+ matches = errorPat.search(file[line])
+ if matches is not None:
+ logDiag('Matched // refError pattern')
+ if pi is not None:
+ pi.validity = line
+ logDiag('added VALIDITY (refError) =', pi.validity)
+ else:
+ logWarn('// refError line NOT inside block')
+
+ line = line + 1
+ continue
+
+ line = line + 1
+ continue
+
+ if pi is not None:
+ logErr('Unclosed open block at EOF!')
+
+ setLogSourcefile(None)
+ setLogProcname(None)
+ setLogLine(None)
+
+ return pageMap
+
+
+def getBranch():
+ """Determine current git branch
+
+ Returns (branch name, ''), or (None, stderr output) if the branch name
+ cannot be determined"""
+
+ command = [ 'git', 'symbolic-ref', '--short', 'HEAD' ]
+ results = subprocess.run(command,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+
+ # git command failed
+ if len(results.stderr) > 0:
+ return (None, results.stderr)
+
+ # Remove newline from output and convert to a string
+ branch = results.stdout.rstrip().decode()
+ if len(branch) > 0:
+ # Strip trailing newline
+ branch = results.stdout.decode()[0:-1]
+
+ return (branch, '')
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/.gitignore b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/.gitignore
new file mode 100644
index 00000000000..bc62debd350
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/.gitignore
@@ -0,0 +1,5 @@
+# Copyright 2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+results/
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/README.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/README.adoc
new file mode 100644
index 00000000000..2a57e39c3a6
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/README.adoc
@@ -0,0 +1,22 @@
+// Copyright 2023 The Khronos Group Inc.
+// SPDX-License-Identifier: CC-BY-4.0
+
+= Reflow Tests
+
+This directory contains test source and expectation files for the `reflow.py`
+script. These files are used by the tests in `test_reflow.py`, which is run as
+part of `pytest`.
+
+The tests reflow each source file (`src-<name>.adoc`) with multiple
+configurations (with or without VUID assignment, with or without reflowing the
+text), and match them against the expectation (`expect-<name>-<options>.adoc`).
+
+After running `pytest`, if any `test_reflow.py` test fails for example because
+the reflow script has been modified to function differently, the test results
+can be found under `results/<options>/src-<name>.adoc` and needs to be manually
+reviewed for correctness. Once correctness of new results are verified, the
+expectations can be updated with:
+
+----
+$ ./update-expectations
+----
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-default.adoc
new file mode 100644
index 00000000000..16433805d4e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-default.adoc
@@ -0,0 +1,44 @@
+// Copyright 2020-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to VkCmdCopyBufferToImage* commands
+ * [[VUID-{refpage}-pRegions-00171]]
+ pname:srcBuffer must: be large enough to contain all buffer locations
+ that are accessed according to <<copies-buffers-images-addressing,Buffer
+ and Image Addressing>>, for each element of pname:pRegions
+ * [[VUID-{refpage}-pRegions-10000]]
+ The union of all source regions, and the union of all destination
+ regions, specified by the elements of pname:pRegions, must: not overlap
+ in memory
+ * [[VUID-{refpage}-srcBuffer-10001]]
+ pname:srcBuffer must: have been created with
+ ename:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-{refpage}-dstImage-10002]]
+ The <<resources-image-format-features,format features>> of
+ pname:dstImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-{refpage}-srcBuffer-00176]]
+ If pname:srcBuffer is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-{refpage}-dstImage-00177]]
+ pname:dstImage must: have been created with
+ ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ * [[VUID-{refpage}-dstImage-00178]]
+ If pname:dstImage is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-{refpage}-dstImage-10003]]
+ pname:dstImage must: have a sample count equal to
+ ename:VK_SAMPLE_COUNT_1_BIT
+ * [[VUID-{refpage}-dstImageLayout-10004]]
+ pname:dstImageLayout must: specify the layout of the image subresources
+ of pname:dstImage specified in pname:pRegions at the time this command
+ is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-{refpage}-dstImageLayout-00181]]
+ pname:dstImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
+ or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-noreflow-novuid.adoc
new file mode 100644
index 00000000000..01e8fd48706
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-noreflow-novuid.adoc
@@ -0,0 +1,32 @@
+// Copyright 2020-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to VkCmdCopyBufferToImage* commands
+ * [[VUID-{refpage}-pRegions-00171]]
+ pname:srcBuffer must: be large enough to contain all buffer locations
+ that are accessed according to <<copies-buffers-images-addressing,Buffer
+ and Image Addressing>>, for each element of pname:pRegions
+ * The union of all source regions, and the union of all destination
+ regions, specified by the elements of pname:pRegions, must: not overlap
+ in memory
+ * pname:srcBuffer must: have been created with ename:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * The <<resources-image-format-features,format features>> of
+ pname:dstImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-{refpage}-srcBuffer-00176]]
+ If pname:srcBuffer is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-{refpage}-dstImage-00177]] pname:dstImage must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ * [[VUID-{refpage}-dstImage-00178]]
+ If pname:dstImage is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * pname:dstImage must: have a sample count equal to
+ ename:VK_SAMPLE_COUNT_1_BIT
+ * pname:dstImageLayout must: specify the layout of the image subresources of pname:dstImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-{refpage}-dstImageLayout-00181]]
+ pname:dstImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
+ or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-noreflow.adoc
new file mode 100644
index 00000000000..0cceaf17787
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-noreflow.adoc
@@ -0,0 +1,37 @@
+// Copyright 2020-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to VkCmdCopyBufferToImage* commands
+ * [[VUID-{refpage}-pRegions-00171]]
+ pname:srcBuffer must: be large enough to contain all buffer locations
+ that are accessed according to <<copies-buffers-images-addressing,Buffer
+ and Image Addressing>>, for each element of pname:pRegions
+ * [[VUID-{refpage}-pRegions-10000]]
+ The union of all source regions, and the union of all destination
+ regions, specified by the elements of pname:pRegions, must: not overlap
+ in memory
+ * [[VUID-{refpage}-srcBuffer-10001]]
+ pname:srcBuffer must: have been created with ename:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-{refpage}-dstImage-10002]]
+ The <<resources-image-format-features,format features>> of
+ pname:dstImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-{refpage}-srcBuffer-00176]]
+ If pname:srcBuffer is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-{refpage}-dstImage-00177]] pname:dstImage must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ * [[VUID-{refpage}-dstImage-00178]]
+ If pname:dstImage is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-{refpage}-dstImage-10003]]
+ pname:dstImage must: have a sample count equal to
+ ename:VK_SAMPLE_COUNT_1_BIT
+ * [[VUID-{refpage}-dstImageLayout-10004]]
+ pname:dstImageLayout must: specify the layout of the image subresources of pname:dstImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-{refpage}-dstImageLayout-00181]]
+ pname:dstImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
+ or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-novuid.adoc
new file mode 100644
index 00000000000..c22e7bce938
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-common-validity-novuid.adoc
@@ -0,0 +1,39 @@
+// Copyright 2020-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to VkCmdCopyBufferToImage* commands
+ * [[VUID-{refpage}-pRegions-00171]]
+ pname:srcBuffer must: be large enough to contain all buffer locations
+ that are accessed according to <<copies-buffers-images-addressing,Buffer
+ and Image Addressing>>, for each element of pname:pRegions
+ * The union of all source regions, and the union of all destination
+ regions, specified by the elements of pname:pRegions, must: not overlap
+ in memory
+ * pname:srcBuffer must: have been created with
+ ename:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * The <<resources-image-format-features,format features>> of
+ pname:dstImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-{refpage}-srcBuffer-00176]]
+ If pname:srcBuffer is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-{refpage}-dstImage-00177]]
+ pname:dstImage must: have been created with
+ ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ * [[VUID-{refpage}-dstImage-00178]]
+ If pname:dstImage is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * pname:dstImage must: have a sample count equal to
+ ename:VK_SAMPLE_COUNT_1_BIT
+ * pname:dstImageLayout must: specify the layout of the image subresources
+ of pname:dstImage specified in pname:pRegions at the time this command
+ is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-{refpage}-dstImageLayout-00181]]
+ pname:dstImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
+ or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-default.adoc
new file mode 100644
index 00000000000..b7f500b53dc
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-default.adoc
@@ -0,0 +1,35 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
+ ename:VK_IMAGE_LAYOUT_GENERAL
+ifdef::VK_KHR_shared_presentable_image[]
+ , or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-noreflow-novuid.adoc
new file mode 100644
index 00000000000..b7f500b53dc
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-noreflow-novuid.adoc
@@ -0,0 +1,35 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
+ ename:VK_IMAGE_LAYOUT_GENERAL
+ifdef::VK_KHR_shared_presentable_image[]
+ , or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-noreflow.adoc
new file mode 100644
index 00000000000..b7f500b53dc
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-noreflow.adoc
@@ -0,0 +1,35 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
+ ename:VK_IMAGE_LAYOUT_GENERAL
+ifdef::VK_KHR_shared_presentable_image[]
+ , or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-novuid.adoc
new file mode 100644
index 00000000000..b7f500b53dc
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-ifdef-in-vu-novuid.adoc
@@ -0,0 +1,35 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
+ ename:VK_IMAGE_LAYOUT_GENERAL
+ifdef::VK_KHR_shared_presentable_image[]
+ , or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-default.adoc
new file mode 100644
index 00000000000..43c1f992fe1
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-default.adoc
@@ -0,0 +1,24 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+= Title
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-image-10000]]
+ If pname:image is non-sparse then the following must: hold:
+
+ {empty}:: [eq]#p~i~ = {v~i~, v~i+1~}#
+
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-noreflow-novuid.adoc
new file mode 100644
index 00000000000..e96c5866560
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-noreflow-novuid.adoc
@@ -0,0 +1,22 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+= Title
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * If pname:image is non-sparse then the following must: hold:
+
+ {empty}:: [eq]#p~i~ = {v~i~, v~i+1~}#
+
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-noreflow.adoc
new file mode 100644
index 00000000000..911abe69b86
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-noreflow.adoc
@@ -0,0 +1,23 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+= Title
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-image-10000]]
+ If pname:image is non-sparse then the following must: hold:
+
+ {empty}:: [eq]#p~i~ = {v~i~, v~i+1~}#
+
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-novuid.adoc
new file mode 100644
index 00000000000..adff51596d7
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-math-block-in-vu-novuid.adoc
@@ -0,0 +1,23 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+= Title
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * If pname:image is non-sparse then the following must: hold:
+
+ {empty}:: [eq]#p~i~ = {v~i~, v~i+1~}#
+
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-default.adoc
new file mode 100644
index 00000000000..bde53670c0b
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-default.adoc
@@ -0,0 +1,43 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to dynamic state commands introduced by VK_EXT_extended_dynamic_state
+ * [[VUID-{refpage}-None-08971]]
+ At least one of the following must: be true:
+ifdef::VK_EXT_extended_dynamic_state[]
+ ** the <<features-extendedDynamicState, pname:extendedDynamicState>>
+ feature is enabled
+endif::VK_EXT_extended_dynamic_state[]
+ifdef::VK_EXT_shader_object[]
+ ** the <<features-shaderObject, pname:shaderObject>> feature is enabled
+endif::VK_EXT_shader_object[]
+ifdef::VK_VERSION_1_3[]
+ ** the value of slink:VkApplicationInfo::pname:apiVersion used to create
+ the slink:VkInstance parent of pname:commandBuffer is greater than or
+ equal to Version 1.3
+endif::VK_VERSION_1_3[]
+ * [[VUID-{refpage}-multisampledRenderToSingleSampled-07284]]
+ If rasterization is not disabled in the bound graphics pipeline,
+ifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+ and none of the following is enabled:
+ifdef::VK_AMD_mixed_attachment_samples[]
+ ** the `apiext:VK_AMD_mixed_attachment_samples` extension
+endif::VK_AMD_mixed_attachment_samples[]
+ifdef::VK_NV_framebuffer_mixed_samples[]
+ ** the `apiext:VK_NV_framebuffer_mixed_samples` extension
+endif::VK_NV_framebuffer_mixed_samples[]
+ifdef::VK_EXT_multisampled_render_to_single_sampled[]
+ ** the <<features-multisampledRenderToSingleSampled,
+ pname:multisampledRenderToSingleSampled>> feature
+endif::VK_EXT_multisampled_render_to_single_sampled[]
+endif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+
++
+then pname:rasterizationSamples for the currently bound graphics pipeline
+must: be the same as the current subpass color and/or depth/stencil
+attachments
+ * [[VUID-{refpage}-None-10000]]
+ Some VU that follows
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-noreflow-novuid.adoc
new file mode 100644
index 00000000000..52c7ab19507
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-noreflow-novuid.adoc
@@ -0,0 +1,37 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to dynamic state commands introduced by VK_EXT_extended_dynamic_state
+ * [[VUID-{refpage}-None-08971]]
+ At least one of the following must: be true:
+ifdef::VK_EXT_extended_dynamic_state[]
+ ** the <<features-extendedDynamicState, pname:extendedDynamicState>> feature is enabled
+endif::VK_EXT_extended_dynamic_state[]
+ifdef::VK_EXT_shader_object[]
+ ** the <<features-shaderObject, pname:shaderObject>> feature is enabled
+endif::VK_EXT_shader_object[]
+ifdef::VK_VERSION_1_3[]
+ ** the value of slink:VkApplicationInfo::pname:apiVersion used to create
+ the slink:VkInstance parent of pname:commandBuffer is greater than or equal to Version 1.3
+endif::VK_VERSION_1_3[]
+ * [[VUID-{refpage}-multisampledRenderToSingleSampled-07284]]
+ If rasterization is not disabled in the bound graphics pipeline,
+ifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+ and none of the following is enabled:
+ifdef::VK_AMD_mixed_attachment_samples[]
+ ** the `apiext:VK_AMD_mixed_attachment_samples` extension
+endif::VK_AMD_mixed_attachment_samples[]
+ifdef::VK_NV_framebuffer_mixed_samples[]
+ ** the `apiext:VK_NV_framebuffer_mixed_samples` extension
+endif::VK_NV_framebuffer_mixed_samples[]
+ifdef::VK_EXT_multisampled_render_to_single_sampled[]
+ ** the <<features-multisampledRenderToSingleSampled, pname:multisampledRenderToSingleSampled>> feature
+endif::VK_EXT_multisampled_render_to_single_sampled[]
+endif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+
++
+then pname:rasterizationSamples for the currently bound graphics pipeline must: be the same as the current subpass color and/or depth/stencil attachments
+ * Some VU that follows
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-noreflow.adoc
new file mode 100644
index 00000000000..bb3cc1405b4
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-noreflow.adoc
@@ -0,0 +1,38 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to dynamic state commands introduced by VK_EXT_extended_dynamic_state
+ * [[VUID-{refpage}-None-08971]]
+ At least one of the following must: be true:
+ifdef::VK_EXT_extended_dynamic_state[]
+ ** the <<features-extendedDynamicState, pname:extendedDynamicState>> feature is enabled
+endif::VK_EXT_extended_dynamic_state[]
+ifdef::VK_EXT_shader_object[]
+ ** the <<features-shaderObject, pname:shaderObject>> feature is enabled
+endif::VK_EXT_shader_object[]
+ifdef::VK_VERSION_1_3[]
+ ** the value of slink:VkApplicationInfo::pname:apiVersion used to create
+ the slink:VkInstance parent of pname:commandBuffer is greater than or equal to Version 1.3
+endif::VK_VERSION_1_3[]
+ * [[VUID-{refpage}-multisampledRenderToSingleSampled-07284]]
+ If rasterization is not disabled in the bound graphics pipeline,
+ifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+ and none of the following is enabled:
+ifdef::VK_AMD_mixed_attachment_samples[]
+ ** the `apiext:VK_AMD_mixed_attachment_samples` extension
+endif::VK_AMD_mixed_attachment_samples[]
+ifdef::VK_NV_framebuffer_mixed_samples[]
+ ** the `apiext:VK_NV_framebuffer_mixed_samples` extension
+endif::VK_NV_framebuffer_mixed_samples[]
+ifdef::VK_EXT_multisampled_render_to_single_sampled[]
+ ** the <<features-multisampledRenderToSingleSampled, pname:multisampledRenderToSingleSampled>> feature
+endif::VK_EXT_multisampled_render_to_single_sampled[]
+endif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+
++
+then pname:rasterizationSamples for the currently bound graphics pipeline must: be the same as the current subpass color and/or depth/stencil attachments
+ * [[VUID-{refpage}-None-10000]]
+ Some VU that follows
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-novuid.adoc
new file mode 100644
index 00000000000..a59bf216cf6
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-nested-lists-in-vu-novuid.adoc
@@ -0,0 +1,42 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to dynamic state commands introduced by VK_EXT_extended_dynamic_state
+ * [[VUID-{refpage}-None-08971]]
+ At least one of the following must: be true:
+ifdef::VK_EXT_extended_dynamic_state[]
+ ** the <<features-extendedDynamicState, pname:extendedDynamicState>>
+ feature is enabled
+endif::VK_EXT_extended_dynamic_state[]
+ifdef::VK_EXT_shader_object[]
+ ** the <<features-shaderObject, pname:shaderObject>> feature is enabled
+endif::VK_EXT_shader_object[]
+ifdef::VK_VERSION_1_3[]
+ ** the value of slink:VkApplicationInfo::pname:apiVersion used to create
+ the slink:VkInstance parent of pname:commandBuffer is greater than or
+ equal to Version 1.3
+endif::VK_VERSION_1_3[]
+ * [[VUID-{refpage}-multisampledRenderToSingleSampled-07284]]
+ If rasterization is not disabled in the bound graphics pipeline,
+ifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+ and none of the following is enabled:
+ifdef::VK_AMD_mixed_attachment_samples[]
+ ** the `apiext:VK_AMD_mixed_attachment_samples` extension
+endif::VK_AMD_mixed_attachment_samples[]
+ifdef::VK_NV_framebuffer_mixed_samples[]
+ ** the `apiext:VK_NV_framebuffer_mixed_samples` extension
+endif::VK_NV_framebuffer_mixed_samples[]
+ifdef::VK_EXT_multisampled_render_to_single_sampled[]
+ ** the <<features-multisampledRenderToSingleSampled,
+ pname:multisampledRenderToSingleSampled>> feature
+endif::VK_EXT_multisampled_render_to_single_sampled[]
+endif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+
++
+then pname:rasterizationSamples for the currently bound graphics pipeline
+must: be the same as the current subpass color and/or depth/stencil
+attachments
+ * Some VU that follows
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-default.adoc
new file mode 100644
index 00000000000..78d53c9668c
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-default.adoc
@@ -0,0 +1,87 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+:imageparam: srcImage
+:imagesubresource: imageSubresource
+
+// Common Valid Usage
+
+ * [[VUID-{refpage}-{imageparam}-10000]]
+ If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D, then for each
+ element of pname:pRegions, pname:imageOffset.y must: be `0` and
+ pname:imageExtent.height must: be `1`
+ * [[VUID-{refpage}-{imagesubresource}-10001]]
+ For each element of pname:pRegions, pname:imageOffset.z and
+ [eq]#(pname:imageExtent.depth {plus} pname:imageOffset.z)# must: both be
+ greater than or equal to `0` and less than or equal to the depth of the
+ specified pname:{imagesubresource} of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10002]]
+ If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D or
+ ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions,
+ pname:imageOffset.z must: be `0` and pname:imageExtent.depth must: be
+ `1`
+ * [[VUID-{refpage}-{imageparam}-10003]]
+ For each element of pname:pRegions, pname:bufferRowLength must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ width>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10004]]
+ For each element of pname:pRegions, pname:bufferImageHeight must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ height>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10005]]
+ For each element of pname:pRegions, pname:imageOffset.x must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ width>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10006]]
+ For each element of pname:pRegions, pname:imageOffset.y must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ height>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10007]]
+ For each element of pname:pRegions, pname:imageOffset.z must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ depth>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10008]]
+ For each element of pname:pRegions, if the sum of pname:imageOffset.x
+ and pname:extent.width does not equal the width of the subresource
+ specified by pname:srcSubresource, pname:extent.width must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ width>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10009]]
+ For each element of pname:pRegions, if the sum of pname:imageOffset.y
+ and pname:extent.height does not equal the height of the subresource
+ specified by pname:srcSubresource, pname:extent.height must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ height>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10010]]
+ For each element of pname:pRegions, if the sum of pname:imageOffset.z
+ and pname:extent.depth does not equal the depth of the subresource
+ specified by pname:srcSubresource, pname:extent.depth must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ depth>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imagesubresource}-10011]]
+ For each element of pname:pRegions, pname:{imagesubresource}.aspectMask
+ must: specify aspects present in pname:{imageparam}
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-{refpage}-{imageparam}-10012]]
+ If pname:{imageparam} has a elink:VkFormat with
+ <<formats-requiring-sampler-ycbcr-conversion,two planes>> then for each
+ element of pname:pRegions, pname:{imagesubresource}.aspectMask must: be
+ ename:VK_IMAGE_ASPECT_PLANE_0_BIT or ename:VK_IMAGE_ASPECT_PLANE_1_BIT
+ * [[VUID-{refpage}-{imageparam}-10013]]
+ If pname:{imageparam} has a elink:VkFormat with
+ <<formats-requiring-sampler-ycbcr-conversion,three planes>> then for
+ each element of pname:pRegions, pname:{imagesubresource}.aspectMask
+ must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT,
+ ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or ename:VK_IMAGE_ASPECT_PLANE_2_BIT
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-{refpage}-{imageparam}-10014]]
+ If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_3D, for each
+ element of pname:pRegions, pname:{imagesubresource}.baseArrayLayer must:
+ be `0` and pname:{imagesubresource}.layerCount must: be `1`
+ * [[VUID-{refpage}-{imageparam}-10015]]
+ For each element of pname:pRegions, pname:bufferRowLength divided by the
+ <<formats-compatibility-classes,texel block extent width>> and then
+ multiplied by the texel block size of pname:{imageparam} must: be less
+ than or equal to [eq]#2^31^-1#
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-noreflow-novuid.adoc
new file mode 100644
index 00000000000..4f16b0ffb53
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-noreflow-novuid.adoc
@@ -0,0 +1,47 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+:imageparam: srcImage
+:imagesubresource: imageSubresource
+
+// Common Valid Usage
+
+ * If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D, then for each element
+ of pname:pRegions, pname:imageOffset.y must: be `0` and pname:imageExtent.height must: be `1`
+ * For each element of pname:pRegions, pname:imageOffset.z and
+ [eq]#(pname:imageExtent.depth {plus} pname:imageOffset.z)# must: both be
+ greater than or equal to `0` and less than or equal to the depth of the specified pname:{imagesubresource} of pname:{imageparam}
+ * If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D or ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions, pname:imageOffset.z must: be `0` and pname:imageExtent.depth must: be `1`
+ * For each element of pname:pRegions, pname:bufferRowLength must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent width>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:bufferImageHeight must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent height>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:imageOffset.x must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent width>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:imageOffset.y must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent height>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:imageOffset.z must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent depth>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, if the sum of pname:imageOffset.x
+ and pname:extent.width does not equal the width of the subresource specified by pname:srcSubresource, pname:extent.width must: be a multiple of the <<formats-compatibility-classes,texel block extent width>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, if the sum of pname:imageOffset.y
+ and pname:extent.height does not equal the height of the subresource specified by pname:srcSubresource, pname:extent.height must: be a multiple of the <<formats-compatibility-classes,texel block extent
+ height>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, if the sum of pname:imageOffset.z
+ and pname:extent.depth does not equal the depth of the subresource specified by pname:srcSubresource, pname:extent.depth must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ depth>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:{imagesubresource}.aspectMask must: specify aspects present in pname:{imageparam}
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * If pname:{imageparam} has a elink:VkFormat with <<formats-requiring-sampler-ycbcr-conversion,two planes>> then for each
+ element of pname:pRegions, pname:{imagesubresource}.aspectMask must: be
+ ename:VK_IMAGE_ASPECT_PLANE_0_BIT or ename:VK_IMAGE_ASPECT_PLANE_1_BIT
+ * If pname:{imageparam} has a elink:VkFormat with
+ <<formats-requiring-sampler-ycbcr-conversion,three planes>> then for
+ each element of pname:pRegions, pname:{imagesubresource}.aspectMask must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or ename:VK_IMAGE_ASPECT_PLANE_2_BIT
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_3D, for each element of
+ pname:pRegions, pname:{imagesubresource}.baseArrayLayer must: be `0` and pname:{imagesubresource}.layerCount must: be `1`
+ * For each element of pname:pRegions, pname:bufferRowLength divided by the <<formats-compatibility-classes,texel block extent width>> and then multiplied by the texel block size of pname:{imageparam} must: be less than or equal to [eq]#2^31^-1#
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-noreflow.adoc
new file mode 100644
index 00000000000..566d9a8727a
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-noreflow.adoc
@@ -0,0 +1,63 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+:imageparam: srcImage
+:imagesubresource: imageSubresource
+
+// Common Valid Usage
+
+ * [[VUID-{refpage}-{imageparam}-10000]]
+ If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D, then for each element
+ of pname:pRegions, pname:imageOffset.y must: be `0` and pname:imageExtent.height must: be `1`
+ * [[VUID-{refpage}-{imagesubresource}-10001]]
+ For each element of pname:pRegions, pname:imageOffset.z and
+ [eq]#(pname:imageExtent.depth {plus} pname:imageOffset.z)# must: both be
+ greater than or equal to `0` and less than or equal to the depth of the specified pname:{imagesubresource} of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10002]]
+ If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D or ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions, pname:imageOffset.z must: be `0` and pname:imageExtent.depth must: be `1`
+ * [[VUID-{refpage}-{imageparam}-10003]]
+ For each element of pname:pRegions, pname:bufferRowLength must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent width>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10004]]
+ For each element of pname:pRegions, pname:bufferImageHeight must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent height>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10005]]
+ For each element of pname:pRegions, pname:imageOffset.x must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent width>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10006]]
+ For each element of pname:pRegions, pname:imageOffset.y must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent height>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10007]]
+ For each element of pname:pRegions, pname:imageOffset.z must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent depth>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10008]]
+ For each element of pname:pRegions, if the sum of pname:imageOffset.x
+ and pname:extent.width does not equal the width of the subresource specified by pname:srcSubresource, pname:extent.width must: be a multiple of the <<formats-compatibility-classes,texel block extent width>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10009]]
+ For each element of pname:pRegions, if the sum of pname:imageOffset.y
+ and pname:extent.height does not equal the height of the subresource specified by pname:srcSubresource, pname:extent.height must: be a multiple of the <<formats-compatibility-classes,texel block extent
+ height>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imageparam}-10010]]
+ For each element of pname:pRegions, if the sum of pname:imageOffset.z
+ and pname:extent.depth does not equal the depth of the subresource specified by pname:srcSubresource, pname:extent.depth must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ depth>> of the elink:VkFormat of pname:{imageparam}
+ * [[VUID-{refpage}-{imagesubresource}-10011]]
+ For each element of pname:pRegions, pname:{imagesubresource}.aspectMask must: specify aspects present in pname:{imageparam}
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-{refpage}-{imageparam}-10012]]
+ If pname:{imageparam} has a elink:VkFormat with <<formats-requiring-sampler-ycbcr-conversion,two planes>> then for each
+ element of pname:pRegions, pname:{imagesubresource}.aspectMask must: be
+ ename:VK_IMAGE_ASPECT_PLANE_0_BIT or ename:VK_IMAGE_ASPECT_PLANE_1_BIT
+ * [[VUID-{refpage}-{imageparam}-10013]]
+ If pname:{imageparam} has a elink:VkFormat with
+ <<formats-requiring-sampler-ycbcr-conversion,three planes>> then for
+ each element of pname:pRegions, pname:{imagesubresource}.aspectMask must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or ename:VK_IMAGE_ASPECT_PLANE_2_BIT
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-{refpage}-{imageparam}-10014]]
+ If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_3D, for each element of
+ pname:pRegions, pname:{imagesubresource}.baseArrayLayer must: be `0` and pname:{imagesubresource}.layerCount must: be `1`
+ * [[VUID-{refpage}-{imageparam}-10015]]
+ For each element of pname:pRegions, pname:bufferRowLength divided by the <<formats-compatibility-classes,texel block extent width>> and then multiplied by the texel block size of pname:{imageparam} must: be less than or equal to [eq]#2^31^-1#
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-novuid.adoc
new file mode 100644
index 00000000000..32a30b888e1
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-attribute-novuid.adoc
@@ -0,0 +1,71 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+:imageparam: srcImage
+:imagesubresource: imageSubresource
+
+// Common Valid Usage
+
+ * If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D, then for each
+ element of pname:pRegions, pname:imageOffset.y must: be `0` and
+ pname:imageExtent.height must: be `1`
+ * For each element of pname:pRegions, pname:imageOffset.z and
+ [eq]#(pname:imageExtent.depth {plus} pname:imageOffset.z)# must: both be
+ greater than or equal to `0` and less than or equal to the depth of the
+ specified pname:{imagesubresource} of pname:{imageparam}
+ * If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D or
+ ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions,
+ pname:imageOffset.z must: be `0` and pname:imageExtent.depth must: be
+ `1`
+ * For each element of pname:pRegions, pname:bufferRowLength must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ width>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:bufferImageHeight must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ height>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:imageOffset.x must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ width>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:imageOffset.y must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ height>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:imageOffset.z must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ depth>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, if the sum of pname:imageOffset.x
+ and pname:extent.width does not equal the width of the subresource
+ specified by pname:srcSubresource, pname:extent.width must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ width>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, if the sum of pname:imageOffset.y
+ and pname:extent.height does not equal the height of the subresource
+ specified by pname:srcSubresource, pname:extent.height must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ height>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, if the sum of pname:imageOffset.z
+ and pname:extent.depth does not equal the depth of the subresource
+ specified by pname:srcSubresource, pname:extent.depth must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ depth>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:{imagesubresource}.aspectMask
+ must: specify aspects present in pname:{imageparam}
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * If pname:{imageparam} has a elink:VkFormat with
+ <<formats-requiring-sampler-ycbcr-conversion,two planes>> then for each
+ element of pname:pRegions, pname:{imagesubresource}.aspectMask must: be
+ ename:VK_IMAGE_ASPECT_PLANE_0_BIT or ename:VK_IMAGE_ASPECT_PLANE_1_BIT
+ * If pname:{imageparam} has a elink:VkFormat with
+ <<formats-requiring-sampler-ycbcr-conversion,three planes>> then for
+ each element of pname:pRegions, pname:{imagesubresource}.aspectMask
+ must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT,
+ ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or ename:VK_IMAGE_ASPECT_PLANE_2_BIT
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_3D, for each
+ element of pname:pRegions, pname:{imagesubresource}.baseArrayLayer must:
+ be `0` and pname:{imagesubresource}.layerCount must: be `1`
+ * For each element of pname:pRegions, pname:bufferRowLength divided by the
+ <<formats-compatibility-classes,texel block extent width>> and then
+ multiplied by the texel block size of pname:{imageparam} must: be less
+ than or equal to [eq]#2^31^-1#
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-default.adoc
new file mode 100644
index 00000000000..558bbc1b545
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-default.adoc
@@ -0,0 +1,95 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image
+ must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-10000]]
+ pname:image must: have been created with
+ ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the
+ <<formats-requiring-sampler-ycbcr-conversion, formats that require a
+ sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-10001]]
+ If pname:image is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
+ ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-10002]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ ename:VK_IMAGE_LAYOUT_GENERAL, or
+ ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-10003]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or
+ equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-10004]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-10005]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-noreflow-novuid.adoc
new file mode 100644
index 00000000000..728e36ba1f6
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-noreflow-novuid.adoc
@@ -0,0 +1,72 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * pname:image must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the <<formats-requiring-sampler-ycbcr-conversion, formats that require a sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * If pname:image is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource ranges of pname:image specified in pname:pRanges at the time this command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, ename:VK_IMAGE_LAYOUT_GENERAL, or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the elements of the pname:pRanges array must: each be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * pname:image must: not have a compressed or depth/stencil format
+ * pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-noreflow.adoc
new file mode 100644
index 00000000000..e99e33ff58b
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-noreflow.adoc
@@ -0,0 +1,78 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-10000]]
+ pname:image must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the <<formats-requiring-sampler-ycbcr-conversion, formats that require a sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-10001]]
+ If pname:image is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource ranges of pname:image specified in pname:pRanges at the time this command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-10002]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, ename:VK_IMAGE_LAYOUT_GENERAL, or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-10003]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the elements of the pname:pRanges array must: each be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-10004]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-10005]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-novuid.adoc
new file mode 100644
index 00000000000..034729fb941
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-new-vuid-novuid.adoc
@@ -0,0 +1,89 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image
+ must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * pname:image must: have been created with
+ ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the
+ <<formats-requiring-sampler-ycbcr-conversion, formats that require a
+ sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * If pname:image is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
+ ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ ename:VK_IMAGE_LAYOUT_GENERAL, or
+ ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or
+ equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * pname:image must: not have a compressed or depth/stencil format
+ * pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-default.adoc
new file mode 100644
index 00000000000..39efd61f742
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-default.adoc
@@ -0,0 +1,33 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+<<<
+
+[[formats-numericformat]]
+.Interpretation of Numeric Format
+[width="95%",cols="2,3,10",options="header"]
+|====
+| Numeric format | SPIR-V _Sampled Type_ | Description
+| etext:UNORM | OpTypeFloat | The components are unsigned normalized values in the range [eq]#[0,1]#
+| etext:SNORM | OpTypeFloat | The components are signed normalized values in the range [eq]#[-1,1]#
+| etext:USCALED | OpTypeFloat | The components are unsigned integer values that get converted to floating-point in the range [0,2^n^-1]
+| etext:SSCALED | OpTypeFloat | The components are signed integer values that get converted to floating-point in the range [-2^n-1^,2^n-1^-1]
+| etext:UINT | OpTypeInt | The components are unsigned integer values in the range [0,2^n^-1]
+| etext:SINT | OpTypeInt | The components are signed integer values in the range [-2^n-1^,2^n-1^-1]
+| etext:UFLOAT | OpTypeFloat | The components are unsigned floating-point numbers (used by packed, shared exponent, and some compressed formats)
+| etext:SFLOAT | OpTypeFloat | The components are signed floating-point numbers
+| etext:SRGB | OpTypeFloat | The R, G, and B components are unsigned normalized values that represent values using sRGB nonlinear encoding, while the A component (if one exists) is a regular unsigned normalized value
+3+| [eq]#n# is the number of bits in the component.
+|====
+
+The suffix etext:_PACKnn indicates that the format is packed into an
+underlying type with etext:nn bits.
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+The suffix etext:_mPACKnn is a short-hand that indicates that the format has
+etext:m groups of components (which may or may not be stored in separate
+_planes_) that are each packed into an underlying type with etext:nn bits.
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-noreflow-novuid.adoc
new file mode 100644
index 00000000000..0251a4caeec
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-noreflow-novuid.adoc
@@ -0,0 +1,30 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+<<<
+
+[[formats-numericformat]]
+.Interpretation of Numeric Format
+[width="95%",cols="2,3,10",options="header"]
+|====
+| Numeric format | SPIR-V _Sampled Type_ | Description
+| etext:UNORM | OpTypeFloat | The components are unsigned normalized values in the range [eq]#[0,1]#
+| etext:SNORM | OpTypeFloat | The components are signed normalized values in the range [eq]#[-1,1]#
+| etext:USCALED | OpTypeFloat | The components are unsigned integer values that get converted to floating-point in the range [0,2^n^-1]
+| etext:SSCALED | OpTypeFloat | The components are signed integer values that get converted to floating-point in the range [-2^n-1^,2^n-1^-1]
+| etext:UINT | OpTypeInt | The components are unsigned integer values in the range [0,2^n^-1]
+| etext:SINT | OpTypeInt | The components are signed integer values in the range [-2^n-1^,2^n-1^-1]
+| etext:UFLOAT | OpTypeFloat | The components are unsigned floating-point numbers (used by packed, shared exponent, and some compressed formats)
+| etext:SFLOAT | OpTypeFloat | The components are signed floating-point numbers
+| etext:SRGB | OpTypeFloat | The R, G, and B components are unsigned normalized values that represent values using sRGB nonlinear encoding, while the A component (if one exists) is a regular unsigned normalized value
+3+| [eq]#n# is the number of bits in the component.
+|====
+
+The suffix etext:_PACKnn indicates that the format is packed into an underlying type with etext:nn bits.
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+The suffix etext:_mPACKnn is a short-hand that indicates that the format has etext:m groups of components (which may or may not be stored in separate _planes_) that are each packed into an underlying type with etext:nn bits.
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-noreflow.adoc
new file mode 100644
index 00000000000..0251a4caeec
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-noreflow.adoc
@@ -0,0 +1,30 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+<<<
+
+[[formats-numericformat]]
+.Interpretation of Numeric Format
+[width="95%",cols="2,3,10",options="header"]
+|====
+| Numeric format | SPIR-V _Sampled Type_ | Description
+| etext:UNORM | OpTypeFloat | The components are unsigned normalized values in the range [eq]#[0,1]#
+| etext:SNORM | OpTypeFloat | The components are signed normalized values in the range [eq]#[-1,1]#
+| etext:USCALED | OpTypeFloat | The components are unsigned integer values that get converted to floating-point in the range [0,2^n^-1]
+| etext:SSCALED | OpTypeFloat | The components are signed integer values that get converted to floating-point in the range [-2^n-1^,2^n-1^-1]
+| etext:UINT | OpTypeInt | The components are unsigned integer values in the range [0,2^n^-1]
+| etext:SINT | OpTypeInt | The components are signed integer values in the range [-2^n-1^,2^n-1^-1]
+| etext:UFLOAT | OpTypeFloat | The components are unsigned floating-point numbers (used by packed, shared exponent, and some compressed formats)
+| etext:SFLOAT | OpTypeFloat | The components are signed floating-point numbers
+| etext:SRGB | OpTypeFloat | The R, G, and B components are unsigned normalized values that represent values using sRGB nonlinear encoding, while the A component (if one exists) is a regular unsigned normalized value
+3+| [eq]#n# is the number of bits in the component.
+|====
+
+The suffix etext:_PACKnn indicates that the format is packed into an underlying type with etext:nn bits.
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+The suffix etext:_mPACKnn is a short-hand that indicates that the format has etext:m groups of components (which may or may not be stored in separate _planes_) that are each packed into an underlying type with etext:nn bits.
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-novuid.adoc
new file mode 100644
index 00000000000..39efd61f742
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-table-novuid.adoc
@@ -0,0 +1,33 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+<<<
+
+[[formats-numericformat]]
+.Interpretation of Numeric Format
+[width="95%",cols="2,3,10",options="header"]
+|====
+| Numeric format | SPIR-V _Sampled Type_ | Description
+| etext:UNORM | OpTypeFloat | The components are unsigned normalized values in the range [eq]#[0,1]#
+| etext:SNORM | OpTypeFloat | The components are signed normalized values in the range [eq]#[-1,1]#
+| etext:USCALED | OpTypeFloat | The components are unsigned integer values that get converted to floating-point in the range [0,2^n^-1]
+| etext:SSCALED | OpTypeFloat | The components are signed integer values that get converted to floating-point in the range [-2^n-1^,2^n-1^-1]
+| etext:UINT | OpTypeInt | The components are unsigned integer values in the range [0,2^n^-1]
+| etext:SINT | OpTypeInt | The components are signed integer values in the range [-2^n-1^,2^n-1^-1]
+| etext:UFLOAT | OpTypeFloat | The components are unsigned floating-point numbers (used by packed, shared exponent, and some compressed formats)
+| etext:SFLOAT | OpTypeFloat | The components are signed floating-point numbers
+| etext:SRGB | OpTypeFloat | The R, G, and B components are unsigned normalized values that represent values using sRGB nonlinear encoding, while the A component (if one exists) is a regular unsigned normalized value
+3+| [eq]#n# is the number of bits in the component.
+|====
+
+The suffix etext:_PACKnn indicates that the format is packed into an
+underlying type with etext:nn bits.
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+The suffix etext:_mPACKnn is a short-hand that indicates that the format has
+etext:m groups of components (which may or may not be stored in separate
+_planes_) that are each packed into an underlying type with etext:nn bits.
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-default.adoc
new file mode 100644
index 00000000000..9e3c876ef9d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-default.adoc
@@ -0,0 +1,53 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+Supported buffer and image formats may: vary across implementations.
+A minimum set of format features are guaranteed, but others must: be
+explicitly queried before use to ensure they are supported by the
+implementation.
+
+The features for the set of formats (elink:VkFormat) supported by the
+implementation are queried individually using the
+flink:vkGetPhysicalDeviceFormatProperties command.
+
+ * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
+ tempor incididunt ut labore et dolore magna aliqua.
+ Turpis egestas pretium aenean pharetra magna ac placerat.
+ Eros donec ac odio tempor orci.
+ Vel facilisis volutpat est velit egestas.
+ Rhoncus urna neque viverra justo nec ultrices.
+ Sollicitudin ac orci phasellus egestas tellus rutrum tellus
+ pellentesque.
+ * Natoque penatibus et magnis dis parturient.
+ Hac habitasse platea dictumst quisque sagittis purus sit amet volutpat.
+ Donec et odio pellentesque diam volutpat commodo sed egestas.
+ Tortor pretium viverra suspendisse potenti nullam ac tortor vitae.
+ Sed arcu non odio euismod lacinia at quis.
+ ** Convallis a cras semper auctor neque vitae tempus quam pellentesque.
+ Aliquam etiam erat velit scelerisque in dictum non consectetur a.
+ Pretium quam vulputate dignissim suspendisse in est ante.
+ Leo a diam sollicitudin tempor id eu nisl nunc mi.
+ Quis lectus nulla at volutpat diam.
+ ** Neque vitae tempus quam pellentesque nec nam aliquam sem et.
+ Adipiscing commodo elit at imperdiet.
+ Risus in hendrerit gravida rutrum quisque non.
+ Sapien faucibus et molestie ac feugiat.
+ Ac ut consequat semper viverra nam libero justo laoreet sit.
+ Elit scelerisque mauris pellentesque pulvinar pellentesque habitant
+ morbi.
+ *** Euismod quis viverra nibh cras.
+ Vel eros donec ac odio tempor.
+ Praesent semper feugiat nibh sed pulvinar proin gravida hendrerit
+ lectus.
+ Ullamcorper velit sed ullamcorper morbi tincidunt.
+ Sed pulvinar proin gravida hendrerit lectus a.
+ In nulla posuere sollicitudin aliquam ultrices.
+ Tempor id eu nisl nunc mi ipsum faucibus.
+ Non curabitur gravida arcu ac tortor dignissim convallis aenean et.
+ * Pretium quam vulputate dignissim suspendisse in est.
+ Amet volutpat consequat mauris nunc congue nisi vitae suscipit.
+ Risus at ultrices mi tempus imperdiet nulla malesuada.
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-noreflow-novuid.adoc
new file mode 100644
index 00000000000..e4e01835450
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-noreflow-novuid.adoc
@@ -0,0 +1,24 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+Supported buffer and image formats may: vary across implementations.
+A minimum set of format features are guaranteed, but others must: be explicitly queried before use to ensure they are supported by the implementation.
+
+The features for the set of formats (elink:VkFormat) supported by the implementation are queried individually using the flink:vkGetPhysicalDeviceFormatProperties command.
+
+ * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Turpis egestas pretium aenean pharetra magna ac placerat. Eros donec ac odio tempor orci. Vel facilisis volutpat est velit egestas. Rhoncus urna neque viverra justo nec ultrices. Sollicitudin ac orci phasellus egestas tellus rutrum tellus pellentesque.
+ * Natoque penatibus et magnis dis parturient. Hac habitasse platea dictumst quisque sagittis purus sit amet volutpat. Donec et odio pellentesque diam volutpat commodo sed egestas. Tortor pretium viverra suspendisse potenti nullam ac tortor vitae. Sed arcu non odio euismod lacinia at quis.
+ ** Convallis a cras semper auctor
+ neque vitae tempus quam pellentesque. Aliquam etiam erat velit scelerisque in dictum non consectetur a. Pretium quam vulputate dignissim suspendisse in est ante. Leo a diam sollicitudin tempor id eu nisl nunc mi. Quis lectus nulla at volutpat diam.
+ ** Neque vitae tempus quam pellentesque nec nam aliquam sem et. Adipiscing commodo elit at imperdiet. Risus in hendrerit gravida rutrum quisque non.
+ Sapien faucibus et molestie ac feugiat. Ac ut consequat semper viverra nam libero justo laoreet sit. Elit scelerisque mauris pellentesque pulvinar
+ pellentesque habitant morbi.
+ *** Euismod quis viverra nibh cras. Vel eros donec ac odio tempor. Praesent semper feugiat nibh sed pulvinar proin gravida hendrerit lectus. Ullamcorper
+ velit sed ullamcorper morbi tincidunt. Sed pulvinar proin gravida hendrerit lectus a. In nulla posuere sollicitudin aliquam ultrices. Tempor id eu nisl
+ nunc mi ipsum faucibus. Non curabitur gravida arcu ac tortor dignissim convallis aenean et.
+ * Pretium quam vulputate dignissim suspendisse in est. Amet volutpat consequat mauris nunc congue nisi vitae suscipit. Risus at ultrices mi tempus imperdiet
+ nulla malesuada.
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-noreflow.adoc
new file mode 100644
index 00000000000..e4e01835450
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-noreflow.adoc
@@ -0,0 +1,24 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+Supported buffer and image formats may: vary across implementations.
+A minimum set of format features are guaranteed, but others must: be explicitly queried before use to ensure they are supported by the implementation.
+
+The features for the set of formats (elink:VkFormat) supported by the implementation are queried individually using the flink:vkGetPhysicalDeviceFormatProperties command.
+
+ * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Turpis egestas pretium aenean pharetra magna ac placerat. Eros donec ac odio tempor orci. Vel facilisis volutpat est velit egestas. Rhoncus urna neque viverra justo nec ultrices. Sollicitudin ac orci phasellus egestas tellus rutrum tellus pellentesque.
+ * Natoque penatibus et magnis dis parturient. Hac habitasse platea dictumst quisque sagittis purus sit amet volutpat. Donec et odio pellentesque diam volutpat commodo sed egestas. Tortor pretium viverra suspendisse potenti nullam ac tortor vitae. Sed arcu non odio euismod lacinia at quis.
+ ** Convallis a cras semper auctor
+ neque vitae tempus quam pellentesque. Aliquam etiam erat velit scelerisque in dictum non consectetur a. Pretium quam vulputate dignissim suspendisse in est ante. Leo a diam sollicitudin tempor id eu nisl nunc mi. Quis lectus nulla at volutpat diam.
+ ** Neque vitae tempus quam pellentesque nec nam aliquam sem et. Adipiscing commodo elit at imperdiet. Risus in hendrerit gravida rutrum quisque non.
+ Sapien faucibus et molestie ac feugiat. Ac ut consequat semper viverra nam libero justo laoreet sit. Elit scelerisque mauris pellentesque pulvinar
+ pellentesque habitant morbi.
+ *** Euismod quis viverra nibh cras. Vel eros donec ac odio tempor. Praesent semper feugiat nibh sed pulvinar proin gravida hendrerit lectus. Ullamcorper
+ velit sed ullamcorper morbi tincidunt. Sed pulvinar proin gravida hendrerit lectus a. In nulla posuere sollicitudin aliquam ultrices. Tempor id eu nisl
+ nunc mi ipsum faucibus. Non curabitur gravida arcu ac tortor dignissim convallis aenean et.
+ * Pretium quam vulputate dignissim suspendisse in est. Amet volutpat consequat mauris nunc congue nisi vitae suscipit. Risus at ultrices mi tempus imperdiet
+ nulla malesuada.
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-novuid.adoc
new file mode 100644
index 00000000000..9e3c876ef9d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-text-novuid.adoc
@@ -0,0 +1,53 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+Supported buffer and image formats may: vary across implementations.
+A minimum set of format features are guaranteed, but others must: be
+explicitly queried before use to ensure they are supported by the
+implementation.
+
+The features for the set of formats (elink:VkFormat) supported by the
+implementation are queried individually using the
+flink:vkGetPhysicalDeviceFormatProperties command.
+
+ * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
+ tempor incididunt ut labore et dolore magna aliqua.
+ Turpis egestas pretium aenean pharetra magna ac placerat.
+ Eros donec ac odio tempor orci.
+ Vel facilisis volutpat est velit egestas.
+ Rhoncus urna neque viverra justo nec ultrices.
+ Sollicitudin ac orci phasellus egestas tellus rutrum tellus
+ pellentesque.
+ * Natoque penatibus et magnis dis parturient.
+ Hac habitasse platea dictumst quisque sagittis purus sit amet volutpat.
+ Donec et odio pellentesque diam volutpat commodo sed egestas.
+ Tortor pretium viverra suspendisse potenti nullam ac tortor vitae.
+ Sed arcu non odio euismod lacinia at quis.
+ ** Convallis a cras semper auctor neque vitae tempus quam pellentesque.
+ Aliquam etiam erat velit scelerisque in dictum non consectetur a.
+ Pretium quam vulputate dignissim suspendisse in est ante.
+ Leo a diam sollicitudin tempor id eu nisl nunc mi.
+ Quis lectus nulla at volutpat diam.
+ ** Neque vitae tempus quam pellentesque nec nam aliquam sem et.
+ Adipiscing commodo elit at imperdiet.
+ Risus in hendrerit gravida rutrum quisque non.
+ Sapien faucibus et molestie ac feugiat.
+ Ac ut consequat semper viverra nam libero justo laoreet sit.
+ Elit scelerisque mauris pellentesque pulvinar pellentesque habitant
+ morbi.
+ *** Euismod quis viverra nibh cras.
+ Vel eros donec ac odio tempor.
+ Praesent semper feugiat nibh sed pulvinar proin gravida hendrerit
+ lectus.
+ Ullamcorper velit sed ullamcorper morbi tincidunt.
+ Sed pulvinar proin gravida hendrerit lectus a.
+ In nulla posuere sollicitudin aliquam ultrices.
+ Tempor id eu nisl nunc mi ipsum faucibus.
+ Non curabitur gravida arcu ac tortor dignissim convallis aenean et.
+ * Pretium quam vulputate dignissim suspendisse in est.
+ Amet volutpat consequat mauris nunc congue nisi vitae suscipit.
+ Risus at ultrices mi tempus imperdiet nulla malesuada.
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-default.adoc
new file mode 100644
index 00000000000..1451c538dd8
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-default.adoc
@@ -0,0 +1,123 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+ * pname:commandBuffer is the command buffer into which the command will be
+ recorded.
+ * pname:image is the image to be cleared.
+ * pname:imageLayout specifies the current layout of the image subresource
+ ranges to be cleared, and must: be
+ifdef::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,
+endif::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_GENERAL or
+ ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL.
+ * pname:pColor is a pointer to a slink:VkClearColorValue structure
+ containing the values that the image subresource ranges will be cleared
+ to (see <<clears-values>> below).
+ * pname:rangeCount is the number of image subresource range structures in
+ pname:pRanges.
+ * pname:pRanges is a pointer to an array of slink:VkImageSubresourceRange
+ structures describing a range of mipmap levels, array layers, and
+ aspects to be cleared, as described in <<resources-image-views,Image
+ Views>>.
+
+Each specified range in pname:pRanges is cleared to the value specified by
+pname:pColor.
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image
+ must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-00002]]
+ pname:image must: have been created with
+ ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the
+ <<formats-requiring-sampler-ycbcr-conversion, formats that require a
+ sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
+ ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-01394]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ ename:VK_IMAGE_LAYOUT_GENERAL, or
+ ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01692]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or
+ equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-noreflow-novuid.adoc
new file mode 100644
index 00000000000..e50a460d38d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-noreflow-novuid.adoc
@@ -0,0 +1,101 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+ * pname:commandBuffer is the command buffer into which the command will be
+ recorded.
+ * pname:image is the image to be cleared.
+ * pname:imageLayout specifies the current layout of the image subresource ranges to be cleared, and must: be
+ifdef::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,
+endif::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_GENERAL or ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL.
+ * pname:pColor is a pointer to a slink:VkClearColorValue structure containing the values that the image subresource ranges will be cleared to (see <<clears-values>> below).
+ * pname:rangeCount is the number of image subresource range structures in pname:pRanges.
+ * pname:pRanges is a pointer to an array of slink:VkImageSubresourceRange
+ structures describing a range of mipmap levels, array layers, and
+ aspects to be cleared, as described in <<resources-image-views,Image Views>>.
+
+Each specified range in pname:pRanges is cleared to the value specified by
+pname:pColor.
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-00002]]
+ pname:image must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the <<formats-requiring-sampler-ycbcr-conversion, formats that require a sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource ranges of pname:image specified in pname:pRanges at the time this command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-01394]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, ename:VK_IMAGE_LAYOUT_GENERAL, or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01692]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the elements of the pname:pRanges array must: each be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-noreflow.adoc
new file mode 100644
index 00000000000..e50a460d38d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-noreflow.adoc
@@ -0,0 +1,101 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+ * pname:commandBuffer is the command buffer into which the command will be
+ recorded.
+ * pname:image is the image to be cleared.
+ * pname:imageLayout specifies the current layout of the image subresource ranges to be cleared, and must: be
+ifdef::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,
+endif::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_GENERAL or ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL.
+ * pname:pColor is a pointer to a slink:VkClearColorValue structure containing the values that the image subresource ranges will be cleared to (see <<clears-values>> below).
+ * pname:rangeCount is the number of image subresource range structures in pname:pRanges.
+ * pname:pRanges is a pointer to an array of slink:VkImageSubresourceRange
+ structures describing a range of mipmap levels, array layers, and
+ aspects to be cleared, as described in <<resources-image-views,Image Views>>.
+
+Each specified range in pname:pRanges is cleared to the value specified by
+pname:pColor.
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-00002]]
+ pname:image must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the <<formats-requiring-sampler-ycbcr-conversion, formats that require a sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource ranges of pname:image specified in pname:pRanges at the time this command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-01394]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, ename:VK_IMAGE_LAYOUT_GENERAL, or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01692]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the elements of the pname:pRanges array must: each be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-novuid.adoc
new file mode 100644
index 00000000000..1451c538dd8
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vu-novuid.adoc
@@ -0,0 +1,123 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+ * pname:commandBuffer is the command buffer into which the command will be
+ recorded.
+ * pname:image is the image to be cleared.
+ * pname:imageLayout specifies the current layout of the image subresource
+ ranges to be cleared, and must: be
+ifdef::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,
+endif::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_GENERAL or
+ ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL.
+ * pname:pColor is a pointer to a slink:VkClearColorValue structure
+ containing the values that the image subresource ranges will be cleared
+ to (see <<clears-values>> below).
+ * pname:rangeCount is the number of image subresource range structures in
+ pname:pRanges.
+ * pname:pRanges is a pointer to an array of slink:VkImageSubresourceRange
+ structures describing a range of mipmap levels, array layers, and
+ aspects to be cleared, as described in <<resources-image-views,Image
+ Views>>.
+
+Each specified range in pname:pRanges is cleared to the value specified by
+pname:pColor.
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image
+ must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-00002]]
+ pname:image must: have been created with
+ ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the
+ <<formats-requiring-sampler-ycbcr-conversion, formats that require a
+ sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
+ ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-01394]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ ename:VK_IMAGE_LAYOUT_GENERAL, or
+ ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01692]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or
+ equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-default.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-default.adoc
new file mode 100644
index 00000000000..3cdf891f355
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-default.adoc
@@ -0,0 +1,58 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-00007]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or
+ equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-02498]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-noreflow-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-noreflow-novuid.adoc
new file mode 100644
index 00000000000..f5fb2de4069
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-noreflow-novuid.adoc
@@ -0,0 +1,47 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the elements of the pname:pRanges array must: each only include ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the elements of the pname:pRanges array must: each be less than the pname:mipLevels specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-00007]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the elements of the pname:pRanges array must: each be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-02498]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-noreflow.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-noreflow.adoc
new file mode 100644
index 00000000000..f5fb2de4069
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-noreflow.adoc
@@ -0,0 +1,47 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the elements of the pname:pRanges array must: each only include ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the elements of the pname:pRanges array must: each be less than the pname:mipLevels specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-00007]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the elements of the pname:pRanges array must: each be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-02498]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-novuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-novuid.adoc
new file mode 100644
index 00000000000..3cdf891f355
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/expect-vuid-repeat-novuid.adoc
@@ -0,0 +1,58 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-00007]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or
+ equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-02498]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-common-validity.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-common-validity.adoc
new file mode 100644
index 00000000000..01e8fd48706
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-common-validity.adoc
@@ -0,0 +1,32 @@
+// Copyright 2020-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to VkCmdCopyBufferToImage* commands
+ * [[VUID-{refpage}-pRegions-00171]]
+ pname:srcBuffer must: be large enough to contain all buffer locations
+ that are accessed according to <<copies-buffers-images-addressing,Buffer
+ and Image Addressing>>, for each element of pname:pRegions
+ * The union of all source regions, and the union of all destination
+ regions, specified by the elements of pname:pRegions, must: not overlap
+ in memory
+ * pname:srcBuffer must: have been created with ename:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * The <<resources-image-format-features,format features>> of
+ pname:dstImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-{refpage}-srcBuffer-00176]]
+ If pname:srcBuffer is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-{refpage}-dstImage-00177]] pname:dstImage must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ * [[VUID-{refpage}-dstImage-00178]]
+ If pname:dstImage is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * pname:dstImage must: have a sample count equal to
+ ename:VK_SAMPLE_COUNT_1_BIT
+ * pname:dstImageLayout must: specify the layout of the image subresources of pname:dstImage specified in pname:pRegions at the time this command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-{refpage}-dstImageLayout-00181]]
+ pname:dstImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
+ or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-ifdef-in-vu.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-ifdef-in-vu.adoc
new file mode 100644
index 00000000000..b7f500b53dc
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-ifdef-in-vu.adoc
@@ -0,0 +1,35 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and
+ contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource
+ ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
+ ename:VK_IMAGE_LAYOUT_GENERAL
+ifdef::VK_KHR_shared_presentable_image[]
+ , or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-math-block-in-vu.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-math-block-in-vu.adoc
new file mode 100644
index 00000000000..e96c5866560
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-math-block-in-vu.adoc
@@ -0,0 +1,22 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+= Title
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * If pname:image is non-sparse then the following must: hold:
+
+ {empty}:: [eq]#p~i~ = {v~i~, v~i+1~}#
+
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource ranges of pname:image specified in pname:pRanges at the time this
+ command is executed on a sname:VkDevice
+****
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-nested-lists-in-vu.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-nested-lists-in-vu.adoc
new file mode 100644
index 00000000000..52c7ab19507
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-nested-lists-in-vu.adoc
@@ -0,0 +1,37 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+// Common Valid Usage
+// Common to dynamic state commands introduced by VK_EXT_extended_dynamic_state
+ * [[VUID-{refpage}-None-08971]]
+ At least one of the following must: be true:
+ifdef::VK_EXT_extended_dynamic_state[]
+ ** the <<features-extendedDynamicState, pname:extendedDynamicState>> feature is enabled
+endif::VK_EXT_extended_dynamic_state[]
+ifdef::VK_EXT_shader_object[]
+ ** the <<features-shaderObject, pname:shaderObject>> feature is enabled
+endif::VK_EXT_shader_object[]
+ifdef::VK_VERSION_1_3[]
+ ** the value of slink:VkApplicationInfo::pname:apiVersion used to create
+ the slink:VkInstance parent of pname:commandBuffer is greater than or equal to Version 1.3
+endif::VK_VERSION_1_3[]
+ * [[VUID-{refpage}-multisampledRenderToSingleSampled-07284]]
+ If rasterization is not disabled in the bound graphics pipeline,
+ifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+ and none of the following is enabled:
+ifdef::VK_AMD_mixed_attachment_samples[]
+ ** the `apiext:VK_AMD_mixed_attachment_samples` extension
+endif::VK_AMD_mixed_attachment_samples[]
+ifdef::VK_NV_framebuffer_mixed_samples[]
+ ** the `apiext:VK_NV_framebuffer_mixed_samples` extension
+endif::VK_NV_framebuffer_mixed_samples[]
+ifdef::VK_EXT_multisampled_render_to_single_sampled[]
+ ** the <<features-multisampledRenderToSingleSampled, pname:multisampledRenderToSingleSampled>> feature
+endif::VK_EXT_multisampled_render_to_single_sampled[]
+endif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[]
+
++
+then pname:rasterizationSamples for the currently bound graphics pipeline must: be the same as the current subpass color and/or depth/stencil attachments
+ * Some VU that follows
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-new-vuid-attribute.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-new-vuid-attribute.adoc
new file mode 100644
index 00000000000..4f16b0ffb53
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-new-vuid-attribute.adoc
@@ -0,0 +1,47 @@
+// Copyright 2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+:imageparam: srcImage
+:imagesubresource: imageSubresource
+
+// Common Valid Usage
+
+ * If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D, then for each element
+ of pname:pRegions, pname:imageOffset.y must: be `0` and pname:imageExtent.height must: be `1`
+ * For each element of pname:pRegions, pname:imageOffset.z and
+ [eq]#(pname:imageExtent.depth {plus} pname:imageOffset.z)# must: both be
+ greater than or equal to `0` and less than or equal to the depth of the specified pname:{imagesubresource} of pname:{imageparam}
+ * If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_1D or ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions, pname:imageOffset.z must: be `0` and pname:imageExtent.depth must: be `1`
+ * For each element of pname:pRegions, pname:bufferRowLength must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent width>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:bufferImageHeight must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent height>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:imageOffset.x must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent width>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:imageOffset.y must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent height>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:imageOffset.z must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent depth>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, if the sum of pname:imageOffset.x
+ and pname:extent.width does not equal the width of the subresource specified by pname:srcSubresource, pname:extent.width must: be a multiple of the <<formats-compatibility-classes,texel block extent width>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, if the sum of pname:imageOffset.y
+ and pname:extent.height does not equal the height of the subresource specified by pname:srcSubresource, pname:extent.height must: be a multiple of the <<formats-compatibility-classes,texel block extent
+ height>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, if the sum of pname:imageOffset.z
+ and pname:extent.depth does not equal the depth of the subresource specified by pname:srcSubresource, pname:extent.depth must: be a
+ multiple of the <<formats-compatibility-classes,texel block extent
+ depth>> of the elink:VkFormat of pname:{imageparam}
+ * For each element of pname:pRegions, pname:{imagesubresource}.aspectMask must: specify aspects present in pname:{imageparam}
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * If pname:{imageparam} has a elink:VkFormat with <<formats-requiring-sampler-ycbcr-conversion,two planes>> then for each
+ element of pname:pRegions, pname:{imagesubresource}.aspectMask must: be
+ ename:VK_IMAGE_ASPECT_PLANE_0_BIT or ename:VK_IMAGE_ASPECT_PLANE_1_BIT
+ * If pname:{imageparam} has a elink:VkFormat with
+ <<formats-requiring-sampler-ycbcr-conversion,three planes>> then for
+ each element of pname:pRegions, pname:{imagesubresource}.aspectMask must: be ename:VK_IMAGE_ASPECT_PLANE_0_BIT, ename:VK_IMAGE_ASPECT_PLANE_1_BIT, or ename:VK_IMAGE_ASPECT_PLANE_2_BIT
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * If pname:{imageparam} is of type ename:VK_IMAGE_TYPE_3D, for each element of
+ pname:pRegions, pname:{imagesubresource}.baseArrayLayer must: be `0` and pname:{imagesubresource}.layerCount must: be `1`
+ * For each element of pname:pRegions, pname:bufferRowLength divided by the <<formats-compatibility-classes,texel block extent width>> and then multiplied by the texel block size of pname:{imageparam} must: be less than or equal to [eq]#2^31^-1#
+// Common Valid Usage
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-new-vuid.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-new-vuid.adoc
new file mode 100644
index 00000000000..728e36ba1f6
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-new-vuid.adoc
@@ -0,0 +1,72 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * pname:image must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the <<formats-requiring-sampler-ycbcr-conversion, formats that require a sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * If pname:image is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource ranges of pname:image specified in pname:pRanges at the time this command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, ename:VK_IMAGE_LAYOUT_GENERAL, or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the elements of the pname:pRanges array must: each be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * pname:image must: not have a compressed or depth/stencil format
+ * pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-table.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-table.adoc
new file mode 100644
index 00000000000..0251a4caeec
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-table.adoc
@@ -0,0 +1,30 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+<<<
+
+[[formats-numericformat]]
+.Interpretation of Numeric Format
+[width="95%",cols="2,3,10",options="header"]
+|====
+| Numeric format | SPIR-V _Sampled Type_ | Description
+| etext:UNORM | OpTypeFloat | The components are unsigned normalized values in the range [eq]#[0,1]#
+| etext:SNORM | OpTypeFloat | The components are signed normalized values in the range [eq]#[-1,1]#
+| etext:USCALED | OpTypeFloat | The components are unsigned integer values that get converted to floating-point in the range [0,2^n^-1]
+| etext:SSCALED | OpTypeFloat | The components are signed integer values that get converted to floating-point in the range [-2^n-1^,2^n-1^-1]
+| etext:UINT | OpTypeInt | The components are unsigned integer values in the range [0,2^n^-1]
+| etext:SINT | OpTypeInt | The components are signed integer values in the range [-2^n-1^,2^n-1^-1]
+| etext:UFLOAT | OpTypeFloat | The components are unsigned floating-point numbers (used by packed, shared exponent, and some compressed formats)
+| etext:SFLOAT | OpTypeFloat | The components are signed floating-point numbers
+| etext:SRGB | OpTypeFloat | The R, G, and B components are unsigned normalized values that represent values using sRGB nonlinear encoding, while the A component (if one exists) is a regular unsigned normalized value
+3+| [eq]#n# is the number of bits in the component.
+|====
+
+The suffix etext:_PACKnn indicates that the format is packed into an underlying type with etext:nn bits.
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+The suffix etext:_mPACKnn is a short-hand that indicates that the format has etext:m groups of components (which may or may not be stored in separate _planes_) that are each packed into an underlying type with etext:nn bits.
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-text.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-text.adoc
new file mode 100644
index 00000000000..e4e01835450
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-text.adoc
@@ -0,0 +1,24 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[formats]]
+= Formats
+
+Supported buffer and image formats may: vary across implementations.
+A minimum set of format features are guaranteed, but others must: be explicitly queried before use to ensure they are supported by the implementation.
+
+The features for the set of formats (elink:VkFormat) supported by the implementation are queried individually using the flink:vkGetPhysicalDeviceFormatProperties command.
+
+ * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Turpis egestas pretium aenean pharetra magna ac placerat. Eros donec ac odio tempor orci. Vel facilisis volutpat est velit egestas. Rhoncus urna neque viverra justo nec ultrices. Sollicitudin ac orci phasellus egestas tellus rutrum tellus pellentesque.
+ * Natoque penatibus et magnis dis parturient. Hac habitasse platea dictumst quisque sagittis purus sit amet volutpat. Donec et odio pellentesque diam volutpat commodo sed egestas. Tortor pretium viverra suspendisse potenti nullam ac tortor vitae. Sed arcu non odio euismod lacinia at quis.
+ ** Convallis a cras semper auctor
+ neque vitae tempus quam pellentesque. Aliquam etiam erat velit scelerisque in dictum non consectetur a. Pretium quam vulputate dignissim suspendisse in est ante. Leo a diam sollicitudin tempor id eu nisl nunc mi. Quis lectus nulla at volutpat diam.
+ ** Neque vitae tempus quam pellentesque nec nam aliquam sem et. Adipiscing commodo elit at imperdiet. Risus in hendrerit gravida rutrum quisque non.
+ Sapien faucibus et molestie ac feugiat. Ac ut consequat semper viverra nam libero justo laoreet sit. Elit scelerisque mauris pellentesque pulvinar
+ pellentesque habitant morbi.
+ *** Euismod quis viverra nibh cras. Vel eros donec ac odio tempor. Praesent semper feugiat nibh sed pulvinar proin gravida hendrerit lectus. Ullamcorper
+ velit sed ullamcorper morbi tincidunt. Sed pulvinar proin gravida hendrerit lectus a. In nulla posuere sollicitudin aliquam ultrices. Tempor id eu nisl
+ nunc mi ipsum faucibus. Non curabitur gravida arcu ac tortor dignissim convallis aenean et.
+ * Pretium quam vulputate dignissim suspendisse in est. Amet volutpat consequat mauris nunc congue nisi vitae suscipit. Risus at ultrices mi tempus imperdiet
+ nulla malesuada.
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-vu.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-vu.adoc
new file mode 100644
index 00000000000..e50a460d38d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-vu.adoc
@@ -0,0 +1,101 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+ * pname:commandBuffer is the command buffer into which the command will be
+ recorded.
+ * pname:image is the image to be cleared.
+ * pname:imageLayout specifies the current layout of the image subresource ranges to be cleared, and must: be
+ifdef::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,
+endif::VK_KHR_shared_presentable_image[]
+ ename:VK_IMAGE_LAYOUT_GENERAL or ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL.
+ * pname:pColor is a pointer to a slink:VkClearColorValue structure containing the values that the image subresource ranges will be cleared to (see <<clears-values>> below).
+ * pname:rangeCount is the number of image subresource range structures in pname:pRanges.
+ * pname:pRanges is a pointer to an array of slink:VkImageSubresourceRange
+ structures describing a range of mipmap levels, array layers, and
+ aspects to be cleared, as described in <<resources-image-views,Image Views>>.
+
+Each specified range in pname:pRanges is cleared to the value specified by
+pname:pColor.
+
+.Valid Usage
+****
+ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-01993]]
+ The <<resources-image-format-features,format features>> of pname:image must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
+endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
+ * [[VUID-vkCmdClearColorImage-image-00002]]
+ pname:image must: have been created with ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
+ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-01545]]
+ pname:image must: not use any of the <<formats-requiring-sampler-ycbcr-conversion, formats that require a sampler {YCbCr} conversion>>
+endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
+ * [[VUID-vkCmdClearColorImage-image-00003]]
+ If pname:image is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object
+ * [[VUID-vkCmdClearColorImage-imageLayout-00004]]
+ pname:imageLayout must: specify the layout of the image subresource ranges of pname:image specified in pname:pRanges at the time this command is executed on a sname:VkDevice
+ifndef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-00005]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or ename:VK_IMAGE_LAYOUT_GENERAL
+endif::VK_KHR_shared_presentable_image[]
+ifdef::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-imageLayout-01394]]
+ pname:imageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, ename:VK_IMAGE_LAYOUT_GENERAL, or ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
+endif::VK_KHR_shared_presentable_image[]
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the
+ elements of the pname:pRanges array must: each only include
+ ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the
+ elements of the pname:pRanges array must: each be less than the
+ pname:mipLevels specified in slink:VkImageCreateInfo when pname:image
+ was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01692]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or
+ equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the elements of the pname:pRanges array must: each be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-01693]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-04961]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+ifdef::VK_VERSION_1_1[]
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01805]]
+ If pname:commandBuffer is an unprotected command buffer and <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ pname:image must: not be a protected image
+ * [[VUID-vkCmdClearColorImage-commandBuffer-01806]]
+ If pname:commandBuffer is a protected command buffer and
+ <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
+ must: not be an unprotected image
+endif::VK_VERSION_1_1[]
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-vuid-repeat.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-vuid-repeat.adoc
new file mode 100644
index 00000000000..f5fb2de4069
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/src-vuid-repeat.adoc
@@ -0,0 +1,47 @@
+// Copyright 2015-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+[[clears]]
+= Clear Commands
+
+
+[[clears-outside]]
+== Clearing Images Outside A Render Pass Instance
+
+Color and depth/stencil images can: be cleared outside a render pass
+instance using flink:vkCmdClearColorImage or
+flink:vkCmdClearDepthStencilImage, respectively.
+These commands are only allowed outside of a render pass instance.
+
+[open,refpage='vkCmdClearColorImage',desc='Clear regions of a color image',type='protos']
+--
+To clear one or more subranges of a color image, call:
+
+include::{generated}/api/protos/vkCmdClearColorImage.adoc[]
+
+.Valid Usage
+****
+ * [[VUID-vkCmdClearColorImage-aspectMask-02498]]
+ The slink:VkImageSubresourceRange::pname:aspectMask members of the elements of the pname:pRanges array must: each only include ename:VK_IMAGE_ASPECT_COLOR_BIT
+ * [[VUID-vkCmdClearColorImage-baseMipLevel-01470]]
+ The slink:VkImageSubresourceRange::pname:baseMipLevel members of the elements of the pname:pRanges array must: each be less than the pname:mipLevels specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the
+ pname:levelCount member is not ename:VK_REMAINING_MIP_LEVELS, then
+ [eq]#pname:baseMipLevel {plus} pname:levelCount# must: be less than or equal to the pname:mipLevels specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-baseArrayLayer-00007]]
+ The slink:VkImageSubresourceRange::pname:baseArrayLayer members of the elements of the pname:pRanges array must: each be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created
+ * [[VUID-vkCmdClearColorImage-pRanges-02498]]
+ For each slink:VkImageSubresourceRange element of pname:pRanges, if the pname:layerCount member is not ename:VK_REMAINING_ARRAY_LAYERS, then
+ [eq]#pname:baseArrayLayer {plus} pname:layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when
+ pname:image was created
+ * [[VUID-vkCmdClearColorImage-image-00007]]
+ pname:image must: not have a compressed or depth/stencil format
+ * [[VUID-vkCmdClearColorImage-pColor-02498]]
+ pname:pColor must: be a valid pointer to a slink:VkClearColorValue union
+****
+
+include::{generated}/validity/protos/vkCmdClearColorImage.adoc[]
+--
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/update-expectations b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/update-expectations
new file mode 100755
index 00000000000..ebfcf247785
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow-tests/update-expectations
@@ -0,0 +1,16 @@
+#! /bin/bash
+#
+# Copyright 2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+echo "Note: Run 'pytest test_reflow.py' first to generate results/"
+
+for result_file in results/*/src-*.adoc; do
+ src_file=$(basename $result_file)
+ test_name=${src_file%.adoc}
+ test_name=${test_name#src-}
+ tag=$(basename $(dirname $result_file))
+
+ cp -f "$result_file" "expect-$test_name-$tag.adoc"
+done
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow.py
new file mode 100755
index 00000000000..88495d3a5de
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reflow.py
@@ -0,0 +1,664 @@
+#!/usr/bin/python3
+#
+# Copyright 2016-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+"""Used for automatic reflow of spec sources to satisfy the agreed layout to
+minimize git churn. Also used to insert identifying tags on explicit Valid
+Usage statements.
+
+Usage: `reflow.py [-noflow] [-tagvu] [-nextvu #] [-overwrite] [-out dir] [-suffix str] files`
+
+- `-noflow` acts as a passthrough, instead of reflowing text. Other
+ processing may occur.
+- `-tagvu` generates explicit VUID tag for Valid Usage statements which
+ do not already have them.
+- `-nextvu #` starts VUID tag generation at the specified # instead of
+ the value wired into the `reflow.py` script.
+- `-overwrite` updates in place (can be risky, make sure there are backups)
+- `-check FAIL|WARN` runs some consistency checks on markup. If the checks
+ fail and the WARN option is given, the script will simply print a warning
+ message. If the checks fail and the FAIL option is given, the script will
+ exit with an error code. FAIL is for use with continuous integration
+ scripts enforcing the checks.
+- `-out` specifies directory to create output file in, default 'out'
+- `-suffix` specifies suffix to add to output files, default ''
+- `files` are asciidoc source files from the spec to reflow.
+"""
+# For error and file-loading interfaces only
+import argparse
+import os
+import re
+import sys
+from reflib import loadFile, logDiag, logWarn, logErr, setLogFile, getBranch
+from pathlib import Path
+import doctransformer
+
+# Vulkan-specific - will consolidate into scripts/ like OpenXR soon
+sys.path.insert(0, 'xml')
+
+from apiconventions import APIConventions
+conventions = APIConventions()
+
+# Patterns used to recognize interesting lines in an asciidoc source file.
+# These patterns are only compiled once.
+
+# Find the pname: or code: patterns in a Valid Usage statement
+pnamePat = re.compile(r'pname:(?P<param>\{?\w+\}?)')
+codePat = re.compile(r'code:(?P<param>\w+)')
+
+# Text that (may) not end sentences
+
+# A single letter followed by a period, typically a middle initial.
+endInitial = re.compile(r'^[A-Z]\.$')
+# An abbreviation, which does not (usually) end a line.
+endAbbrev = re.compile(r'(e\.g|i\.e|c\.f|vs)\.$', re.IGNORECASE)
+
+# Explicit Valid Usage list item with one or more leading asterisks
+# The re.DOTALL is needed to prevent vuPat.search() from stripping
+# the trailing newline.
+vuPat = re.compile(r'^(?P<head> [*]+)( *)(?P<tail>.*)', re.DOTALL)
+
+# VUID with the numeric portion captured in the match object
+vuidPat = re.compile(r'VUID-[^-]+-[^-]+-(?P<vuid>[0-9]+)')
+
+# Pattern matching leading nested bullet points
+global nestedVuPat
+nestedVuPat = re.compile(r'^ \*\*')
+
+class ReflowCallbacks:
+ """State and arguments for reflowing.
+
+ Used with DocTransformer to reflow a file."""
+ def __init__(self,
+ filename,
+ vuidDict,
+ margin = 76,
+ breakPeriod = True,
+ reflow = True,
+ nextvu = None,
+ maxvu = None,
+ check = True):
+
+ self.filename = filename
+ """base name of file being read from."""
+
+ self.check = check
+ """Whether consistency checks must be performed."""
+
+ self.margin = margin
+ """margin to reflow text to."""
+
+ self.breakPeriod = breakPeriod
+ """True if justification should break to a new line after the end of a
+ sentence."""
+
+ self.breakInitial = True
+ """True if justification should break to a new line after something
+ that appears to be an initial in someone's name. **TBD**"""
+
+ self.reflow = reflow
+ """True if text should be reflowed, False to pass through unchanged."""
+
+ self.vuPrefix = 'VUID'
+ """Prefix of generated Valid Usage tags"""
+
+ self.vuFormat = '{0}-{1}-{2}-{3:0>5d}'
+ """Format string for generating Valid Usage tags.
+ First argument is vuPrefix, second is command/struct name, third is
+ parameter name, fourth is the tag number."""
+
+ self.nextvu = nextvu
+ """Integer to start tagging un-numbered Valid Usage statements with,
+ or None if no tagging should be done."""
+
+ self.maxvu = maxvu
+ """Maximum tag to use for Valid Usage statements, or None if no
+ tagging should be done."""
+
+ self.vuidDict = vuidDict
+ """Dictionary of VUID numbers found, containing a list of (file, VUID)
+ on which that number was found. This is used to warn on duplicate
+ VUIDs."""
+
+ self.warnCount = 0
+ """Count of markup check warnings encountered."""
+
+ def endSentence(self, word):
+ """Return True if word ends with a sentence-period, False otherwise.
+
+ Allows for contraction cases which will not end a line:
+
+ - A single letter (if breakInitial is True)
+ - Abbreviations: 'c.f.', 'e.g.', 'i.e.' (or mixed-case versions)"""
+ if (word[-1:] != '.' or
+ endAbbrev.search(word) or
+ (self.breakInitial and endInitial.match(word))):
+ return False
+
+ return True
+
+ def vuidAnchor(self, word):
+ """Return True if word is a Valid Usage ID Tag anchor."""
+ return (word[0:7] == '[[VUID-')
+
+ def visitVUID(self, vuid, line):
+ if vuid not in self.vuidDict:
+ self.vuidDict[vuid] = []
+ self.vuidDict[vuid].append([self.filename, line])
+
+ def gatherVUIDs(self, para):
+ """Gather VUID tags and add them to vuidDict. Used to verify no-duplicate VUIDs"""
+ for line in para:
+ line = line.rstrip()
+
+ matches = vuidPat.search(line)
+ if matches is not None:
+ vuid = matches.group('vuid')
+ self.visitVUID(vuid, line)
+
+ def addVUID(self, para, state):
+ hangIndent = state.hangIndent
+
+ """Generate and add VUID if necessary."""
+ if not state.isVU or self.nextvu is None:
+ return para, hangIndent
+
+ # If:
+ # - this paragraph is in a Valid Usage block,
+ # - VUID tags are being assigned,
+ # Try to assign VUIDs
+
+ if nestedVuPat.search(para[0]):
+ # Do not assign VUIDs to nested bullet points.
+ # These are now allowed VU markup syntax, but will never
+ # themselves be VUs, just subsidiary points.
+ return para, hangIndent
+
+ # Skip if there is already a VUID assigned
+ if self.vuPrefix in para[0]:
+ return para, hangIndent
+
+ # If:
+ # - a tag is not already present, and
+ # - the paragraph is a properly marked-up list item
+ # Then add a VUID tag starting with the next free ID.
+
+ # Split the first line after the bullet point
+ matches = vuPat.search(para[0])
+ if matches is None:
+ # There are only a few cases of this, and they are all
+ # legitimate. Leave detecting this case to another tool
+ # or hand inspection.
+ # logWarn(self.filename + ': Unexpected non-bullet item in VU block (harmless if following an ifdef):',
+ # para[0])
+ return para, hangIndent
+
+ outPara = para
+
+ logDiag('addVUID: Matched vuPat on line:', para[0], end='')
+ head = matches.group('head')
+ tail = matches.group('tail')
+
+ # Find pname: or code: tags in the paragraph for the purposes of VUID
+ # tag generation. pname:{attribute}s are prioritized to make sure
+ # commonvalidity VUIDs end up being unique. Otherwise, the first pname:
+ # or code: tag in the paragraph is used, which may not always be
+ # correct, but should be highly reliable.
+ pnameMatches = re.findall(pnamePat, ' '.join(para))
+ codeMatches = re.findall(codePat, ' '.join(para))
+
+ # Prioritize {attribute}s, but not the ones in the exception list
+ # below. These have complex expressions including ., ->, or [index]
+ # which makes them unsuitable for VUID tags. Ideally these would be
+ # automatically discovered.
+ attributeExceptionList = ['maxinstancecheck', 'regionsparam',
+ 'rayGenShaderBindingTableAddress',
+ 'rayGenShaderBindingTableStride',
+ 'missShaderBindingTableAddress',
+ 'missShaderBindingTableStride',
+ 'hitShaderBindingTableAddress',
+ 'hitShaderBindingTableStride',
+ 'callableShaderBindingTableAddress',
+ 'callableShaderBindingTableStride',
+ ]
+ attributeMatches = [match for match in pnameMatches if
+ match[0] == '{' and
+ match[1:-1] not in attributeExceptionList]
+ nonattributeMatches = [match for match in pnameMatches if
+ match[0] != '{']
+
+ if len(attributeMatches) > 0:
+ paramName = attributeMatches[0]
+ elif len(nonattributeMatches) > 0:
+ paramName = nonattributeMatches[0]
+ elif len(codeMatches) > 0:
+ paramName = codeMatches[0]
+ else:
+ paramName = 'None'
+ logWarn(self.filename,
+ 'No param name found for VUID tag on line:',
+ para[0])
+
+ # Transform:
+ #
+ # * VU first line
+ #
+ # To:
+ #
+ # * [[VUID]]
+ # VU first line
+ #
+ tagLine = (head + ' [[' +
+ self.vuFormat.format(self.vuPrefix,
+ state.apiName,
+ paramName,
+ self.nextvu) + ']]\n')
+ self.visitVUID(str(self.nextvu), tagLine)
+
+ newLines = [tagLine]
+ if tail.strip() != '':
+ logDiag('transformParagraph first line matches bullet point -'
+ 'single line, assuming hangIndent @ input line',
+ state.lineNumber)
+ hangIndent = len(head) + 1
+ newLines.append(''.ljust(hangIndent) + tail)
+
+ logDiag('Assigning', self.vuPrefix, state.apiName, self.nextvu,
+ ' on line:\n' + para[0], '->\n' + newLines[0] + 'END', '\n' + newLines[1] if len(newLines) > 1 else '')
+
+ # Do not actually assign the VUID unless it is in the reserved range
+ if self.nextvu <= self.maxvu:
+ if self.nextvu == self.maxvu:
+ logWarn('Skipping VUID assignment, no more VUIDs available')
+ outPara = newLines + para[1:]
+ self.nextvu = self.nextvu + 1
+
+ return outPara, hangIndent
+
+ def transformParagraph(self, para, state):
+ """Reflow a given paragraph, respecting the paragraph lead and
+ hanging indentation levels.
+
+ The algorithm also respects trailing '+' signs that indicate embedded newlines,
+ and will not reflow a very long word immediately after a bullet point.
+
+ Just return the paragraph unchanged if the -noflow argument was
+ given."""
+
+ self.gatherVUIDs(para)
+
+ # If this is a VU that is missing a VUID, add it to the paragraph now.
+ para, hangIndent = self.addVUID(para, state)
+
+ if not self.reflow:
+ return para
+
+ logDiag('transformParagraph lead indent = ', state.leadIndent,
+ 'hangIndent =', state.hangIndent,
+ 'para:', para[0], end='')
+
+ # Total words processed (we care about the *first* word vs. others)
+ wordCount = 0
+
+ # Tracks the *previous* word processed. It must not be empty.
+ prevWord = ' '
+
+ # Track the previous line and paragraph being indented, if any
+ outLine = None
+ outPara = []
+
+ for line in para:
+ line = line.rstrip()
+ words = line.split()
+
+ # logDiag('transformParagraph: input line =', line)
+ numWords = len(words) - 1
+
+ for i in range(0, numWords + 1):
+ word = words[i]
+ wordLen = len(word)
+ wordCount += 1
+
+ endEscape = False
+ if i == numWords and word in ('+', '-'):
+ # Trailing ' +' or ' -' must stay on the same line
+ endEscape = word
+ # logDiag('transformParagraph last word of line =', word,
+ # 'prevWord =', prevWord, 'endEscape =', endEscape)
+ else:
+ # logDiag('transformParagraph wordCount =', wordCount,
+ # 'word =', word, 'prevWord =', prevWord)
+ pass
+
+ if wordCount == 1:
+ # The first word of the paragraph is treated specially.
+ # The loop logic becomes trickier if all this code is
+ # done prior to looping over lines and words, so all the
+ # setup logic is done here.
+
+ outLine = ''.ljust(state.leadIndent) + word
+ outLineLen = state.leadIndent + wordLen
+
+ # If the paragraph begins with a bullet point, generate
+ # a hanging indent level if there is not one already.
+ if doctransformer.beginBullet.match(para[0]):
+ bulletPoint = True
+ if len(para) > 1:
+ logDiag('transformParagraph first line matches bullet point',
+ 'but indent already hanging @ input line',
+ state.lineNumber)
+ else:
+ logDiag('transformParagraph first line matches bullet point -'
+ 'single line, assuming hangIndent @ input line',
+ state.lineNumber)
+ hangIndent = outLineLen + 1
+ else:
+ bulletPoint = False
+ else:
+ # Possible actions to take with this word
+ #
+ # addWord - add word to current line
+ # closeLine - append line and start a new (null) one
+ # startLine - add word to a new line
+
+ # Default behavior if all the tests below fail is to add
+ # this word to the current line, and keep accumulating
+ # that line.
+ (addWord, closeLine, startLine) = (True, False, False)
+
+ # How long would this line be if the word were added?
+ newLen = outLineLen + 1 + wordLen
+
+ # Are we on the first word following a bullet point?
+ firstBullet = (wordCount == 2 and bulletPoint)
+
+ if endEscape:
+ # If the new word ends the input line with ' +',
+ # add it to the current line.
+
+ (addWord, closeLine, startLine) = (True, True, False)
+ elif self.vuidAnchor(word):
+ # If the new word is a Valid Usage anchor, break the
+ # line afterwards. Note that this should only happen
+ # immediately after a bullet point, but we do not
+ # currently check for this.
+ (addWord, closeLine, startLine) = (True, True, False)
+
+ elif newLen > self.margin:
+ if firstBullet:
+ # If the word follows a bullet point, add it to
+ # the current line no matter its length.
+
+ (addWord, closeLine, startLine) = (True, True, False)
+ elif doctransformer.beginBullet.match(word + ' '):
+ # If the word *is* a bullet point, add it to
+ # the current line no matter its length.
+ # This avoids an innocent inline '-' or '*'
+ # turning into a bogus bullet point.
+
+ (addWord, closeLine, startLine) = (True, True, False)
+ else:
+ # The word overflows, so add it to a new line.
+
+ (addWord, closeLine, startLine) = (False, True, True)
+ elif (self.breakPeriod and
+ (wordCount > 2 or not firstBullet) and
+ self.endSentence(prevWord)):
+ # If the previous word ends a sentence and
+ # breakPeriod is set, start a new line.
+ # The complicated logic allows for leading bullet
+ # points which are periods (implicitly numbered lists).
+ # @@@ But not yet for explicitly numbered lists.
+
+ (addWord, closeLine, startLine) = (False, True, True)
+
+ # Add a word to the current line
+ if addWord:
+ if outLine:
+ outLine += ' ' + word
+ outLineLen = newLen
+ else:
+ # Fall through to startLine case if there is no
+ # current line yet.
+ startLine = True
+
+ # Add current line to the output paragraph. Force
+ # starting a new line, although we do not yet know if it
+ # will ever have contents.
+ if closeLine:
+ if outLine:
+ outPara.append(outLine + '\n')
+ outLine = None
+
+ # Start a new line and add a word to it
+ if startLine:
+ outLine = ''.ljust(hangIndent) + word
+ outLineLen = hangIndent + wordLen
+
+ # Track the previous word, for use in breaking at end of
+ # a sentence
+ prevWord = word
+
+ # Add last line to the output paragraph.
+ if outLine:
+ outPara.append(outLine + '\n')
+
+ return outPara
+
+ def onEmbeddedVUConditional(self, state):
+ if self.check:
+ logWarn('Detected embedded Valid Usage conditional: {}:{}'.format(
+ self.filename, state.lineNumber - 1))
+ # Keep track of warning check count
+ self.warnCount = self.warnCount + 1
+
+def reflowFile(filename, args):
+ logDiag('reflow: filename', filename)
+
+ # Output file handle and reflow object for this file. There are no race
+ # conditions on overwriting the input, but it is not recommended unless
+ # you have backing store such as git.
+
+ lines, newline_string = loadFile(filename)
+ if lines is None:
+ return
+
+ if args.overwrite:
+ outFilename = filename
+ else:
+ outDir = Path(args.outDir).resolve()
+ outDir.mkdir(parents=True, exist_ok=True)
+
+ outFilename = str(outDir / (os.path.basename(filename) + args.suffix))
+
+ if args.nowrite:
+ fp = None
+ else:
+ try:
+ fp = open(outFilename, 'w', encoding='utf8', newline=newline_string)
+ except:
+ logWarn('Cannot open output file', outFilename, ':', sys.exc_info()[0])
+ return
+
+ callback = ReflowCallbacks(filename,
+ args.vuidDict,
+ margin = args.margin,
+ reflow = not args.noflow,
+ nextvu = args.nextvu,
+ maxvu = args.maxvu,
+ check = args.check)
+
+ transformer = doctransformer.DocTransformer(filename,
+ outfile = fp,
+ callback = callback)
+
+ transformer.transformFile(lines)
+
+ if fp is not None:
+ fp.close()
+
+ # Update the 'nextvu' value
+ if args.nextvu != callback.nextvu:
+ logWarn('Updated nextvu to', callback.nextvu, 'after file', filename)
+ args.nextvu = callback.nextvu
+
+ args.warnCount += callback.warnCount
+
+def reflowAllAdocFiles(folder_to_reflow, args):
+ for root, subdirs, files in os.walk(folder_to_reflow):
+ for file in files:
+ if file.endswith(conventions.file_suffix):
+ file_path = os.path.join(root, file)
+ reflowFile(file_path, args)
+ for subdir in subdirs:
+ sub_folder = os.path.join(root, subdir)
+ print('Sub-folder = %s' % sub_folder)
+ if subdir.lower() not in conventions.spec_no_reflow_dirs:
+ print(' Parsing = %s' % sub_folder)
+ reflowAllAdocFiles(sub_folder, args)
+ else:
+ print(' Skipping = %s' % sub_folder)
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-diag', action='store', dest='diagFile',
+ help='Set the diagnostic file')
+ parser.add_argument('-warn', action='store', dest='warnFile',
+ help='Set the warning file')
+ parser.add_argument('-log', action='store', dest='logFile',
+ help='Set the log file for both diagnostics and warnings')
+ parser.add_argument('-overwrite', action='store_true',
+ help='Overwrite input filenames instead of writing different output filenames')
+ parser.add_argument('-out', action='store', dest='outDir',
+ default='out',
+ help='Set the output directory in which updated files are generated (default: out)')
+ parser.add_argument('-nowrite', action='store_true',
+ help='Do not write output files, for use with -check')
+ parser.add_argument('-check', action='store', dest='check',
+ help='Run markup checks and warn if WARN option is given, error exit if FAIL option is given')
+ parser.add_argument('-checkVUID', action='store', dest='checkVUID',
+ help='Detect duplicated VUID numbers and warn if WARN option is given, error exit if FAIL option is given')
+ parser.add_argument('-tagvu', action='store_true',
+ help='Tag un-tagged Valid Usage statements starting at the value wired into reflow.py')
+ parser.add_argument('-nextvu', action='store', dest='nextvu', type=int,
+ default=None,
+ help='Tag un-tagged Valid Usage statements starting at the specified base VUID instead of the value wired into reflow.py')
+ parser.add_argument('-maxvu', action='store', dest='maxvu', type=int,
+ default=None,
+ help='Specify maximum VUID instead of the value wired into vuidCounts.py')
+ parser.add_argument('-branch', action='store', dest='branch',
+ help='Specify branch to assign VUIDs for')
+ parser.add_argument('-noflow', action='store_true', dest='noflow',
+ help='Do not reflow text. Other actions may apply')
+ parser.add_argument('-margin', action='store', type=int, dest='margin',
+ default='76',
+ help='Width to reflow text, defaults to 76 characters')
+ parser.add_argument('-suffix', action='store', dest='suffix',
+ default='',
+ help='Set the suffix added to updated file names (default: none)')
+ parser.add_argument('files', metavar='filename', nargs='*',
+ help='a filename to reflow text in')
+ parser.add_argument('--version', action='version', version='%(prog)s 1.0')
+
+ args = parser.parse_args()
+
+ setLogFile(True, True, args.logFile)
+ setLogFile(True, False, args.diagFile)
+ setLogFile(False, True, args.warnFile)
+
+ if args.overwrite:
+ logWarn("reflow.py: will overwrite all input files")
+
+ errors = ''
+ if args.branch is None:
+ (args.branch, errors) = getBranch()
+ if args.branch is None:
+ # This is not fatal unless VUID assignment is required
+ if args.tagvu:
+ logErr('Cannot determine current git branch, so cannot assign VUIDs:', errors)
+
+ if args.tagvu and args.nextvu is None:
+ # Moved here since vuidCounts is only needed in the internal
+ # repository
+ from vuidCounts import vuidCounts
+
+ if args.branch not in vuidCounts:
+ logErr('Branch', args.branch, 'not in vuidCounts, cannot continue')
+ maxVUID = vuidCounts[args.branch][1]
+ startVUID = vuidCounts[args.branch][2]
+ args.nextvu = startVUID
+ args.maxvu = maxVUID
+
+ if args.nextvu is not None:
+ logWarn('Tagging untagged Valid Usage statements starting at', args.nextvu)
+
+ # Count of markup check warnings encountered
+ # This is added to the argparse structure
+ args.warnCount = 0
+
+ # Dictionary of VUID numbers found, containing a list of (file, VUID) on
+ # which that number was found
+ # This is added to the argparse structure
+ args.vuidDict = {}
+
+ # If no files are specified, reflow the entire specification chapters folder
+ if not args.files:
+ folder_to_reflow = conventions.spec_reflow_path
+ logWarn('Reflowing all asciidoc files under', folder_to_reflow)
+ reflowAllAdocFiles(folder_to_reflow, args)
+ else:
+ for file in args.files:
+ reflowFile(file, args)
+
+ if args.warnCount > 0:
+ if args.check == 'FAIL':
+ logErr('Failed with', args.warnCount, 'markup errors detected.\n' +
+ 'To fix these, you can take actions such as:\n' +
+ ' * Moving conditionals outside VU start / end without changing VU meaning\n' +
+ ' * Refactor conditional text using terminology defined conditionally outside the VU itself\n' +
+ ' * Remove the conditional (allowable when this just affects command / structure / enum names)\n')
+ else:
+ logWarn('Total warning count for markup issues is', args.warnCount)
+
+ # Look for duplicated VUID numbers
+ if args.checkVUID:
+ dupVUIDs = 0
+ for vuid in sorted(args.vuidDict):
+ found = args.vuidDict[vuid]
+ if len(found) > 1:
+ logWarn('Duplicate VUID number {} found in files:'.format(vuid))
+ for (file, vuidLine) in found:
+ logWarn(' {}: {}'.format(file, vuidLine))
+ dupVUIDs = dupVUIDs + 1
+
+ if dupVUIDs > 0:
+ if args.checkVUID == 'FAIL':
+ logErr('Failed with', dupVUIDs, 'duplicated VUID numbers found.\n' +
+ 'To fix this, either convert these to commonvalidity VUs if possible, or strip\n' +
+ 'the VUIDs from all but one of the duplicates and regenerate new ones.')
+ else:
+ logWarn('Total number of duplicated VUID numbers is', dupVUIDs)
+
+ if args.nextvu is not None and args.nextvu != startVUID:
+ # Update next free VUID to assign
+ vuidCounts[args.branch][2] = args.nextvu
+ try:
+ reflow_count_file_path = os.path.dirname(os.path.realpath(__file__))
+ reflow_count_file_path += '/vuidCounts.py'
+ reflow_count_file = open(reflow_count_file_path, 'w', encoding='utf8')
+ print('# Do not edit this file, unless reserving a new VUID range', file=reflow_count_file)
+ print('# VUID ranges reserved for branches', file=reflow_count_file)
+ print('# Key is branch name, value is [ start, end, nextfree ]', file=reflow_count_file)
+ print('# New reservations must be made by MR to main branch', file=reflow_count_file)
+ print('vuidCounts = {', file=reflow_count_file)
+ for key in sorted(vuidCounts.keys(), key=lambda k: vuidCounts[k][0]):
+ counts = vuidCounts[key]
+ print(f" '{key}': [ {counts[0]}, {counts[1]}, {counts[2]} ],",
+ file=reflow_count_file)
+ print('}', file=reflow_count_file)
+ reflow_count_file.close()
+ except:
+ logWarn('Cannot open output count file vuidCounts.py', ':', sys.exc_info()[0])
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reg.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reg.py
new file mode 100644
index 00000000000..4b5a80f7139
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/reg.py
@@ -0,0 +1,1779 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+"""Types and classes for manipulating an API registry."""
+
+import copy
+import re
+import sys
+import xml.etree.ElementTree as etree
+from collections import defaultdict, deque, namedtuple
+
+from generator import GeneratorOptions, OutputGenerator, noneStr, write
+from apiconventions import APIConventions
+
+def apiNameMatch(str, supported):
+ """Return whether a required api name matches a pattern specified for an
+ XML <feature> 'api' attribute or <extension> 'supported' attribute.
+
+ - str - API name such as 'vulkan' or 'openxr'. May be None, in which
+ case it never matches (this should not happen).
+ - supported - comma-separated list of XML API names. May be None, in
+ which case str always matches (this is the usual case)."""
+
+ if str is not None:
+ return supported is None or str in supported.split(',')
+
+ # Fallthrough case - either str is None or the test failed
+ return False
+
+def matchAPIProfile(api, profile, elem):
+ """Return whether an API and profile
+ being generated matches an element's profile
+
+ - api - string naming the API to match
+ - profile - string naming the profile to match
+ - elem - Element which (may) have 'api' and 'profile'
+ attributes to match to.
+
+ If a tag is not present in the Element, the corresponding API
+ or profile always matches.
+
+ Otherwise, the tag must exactly match the API or profile.
+
+ Thus, if 'profile' = core:
+
+ - `<remove>` with no attribute will match
+ - `<remove profile="core">` will match
+ - `<remove profile="compatibility">` will not match
+
+ Possible match conditions:
+
+ ```
+ Requested Element
+ Profile Profile
+ --------- --------
+ None None Always matches
+ 'string' None Always matches
+ None 'string' Does not match. Cannot generate multiple APIs
+ or profiles, so if an API/profile constraint
+ is present, it must be asked for explicitly.
+ 'string' 'string' Strings must match
+ ```
+
+ ** In the future, we will allow regexes for the attributes,
+ not just strings, so that `api="^(gl|gles2)"` will match. Even
+ this is not really quite enough, we might prefer something
+ like `"gl(core)|gles1(common-lite)"`."""
+ # Match 'api', if present
+ elem_api = elem.get('api')
+ if elem_api:
+ if api is None:
+ raise UserWarning("No API requested, but 'api' attribute is present with value '"
+ + elem_api + "'")
+ elif api != elem_api:
+ # Requested API does not match attribute
+ return False
+ elem_profile = elem.get('profile')
+ if elem_profile:
+ if profile is None:
+ raise UserWarning("No profile requested, but 'profile' attribute is present with value '"
+ + elem_profile + "'")
+ elif profile != elem_profile:
+ # Requested profile does not match attribute
+ return False
+ return True
+
+
+def mergeAPIs(tree, fromApiNames, toApiName):
+ """Merge multiple APIs using the precedence order specified in apiNames.
+ Also deletes <remove> elements.
+
+ tree - Element at the root of the hierarchy to merge.
+ apiNames - list of strings of API names."""
+
+ stack = deque()
+ stack.append(tree)
+
+ while len(stack) > 0:
+ parent = stack.pop()
+
+ for child in parent.findall('*'):
+ if child.tag == 'remove':
+ # Remove <remove> elements
+ parent.remove(child)
+ else:
+ stack.append(child)
+
+ supportedList = child.get('supported')
+ if supportedList:
+ supportedList = supportedList.split(',')
+ for apiName in [toApiName] + fromApiNames:
+ if apiName in supportedList:
+ child.set('supported', toApiName)
+
+ if child.get('api'):
+ definitionName = None
+ definitionVariants = []
+
+ # Keep only one definition with the same name if there are multiple definitions
+ if child.tag in ['type']:
+ if child.get('name') is not None:
+ definitionName = child.get('name')
+ definitionVariants = parent.findall(f"{child.tag}[@name='{definitionName}']")
+ else:
+ definitionName = child.find('name').text
+ definitionVariants = parent.findall(f"{child.tag}/name[.='{definitionName}']/..")
+ elif child.tag in ['member', 'param']:
+ definitionName = child.find('name').text
+ definitionVariants = parent.findall(f"{child.tag}/name[.='{definitionName}']/..")
+ elif child.tag in ['enum', 'feature']:
+ definitionName = child.get('name')
+ definitionVariants = parent.findall(f"{child.tag}[@name='{definitionName}']")
+ elif child.tag in ['require']:
+ definitionName = child.get('feature')
+ definitionVariants = parent.findall(f"{child.tag}[@feature='{definitionName}']")
+ elif child.tag in ['command']:
+ definitionName = child.find('proto/name').text
+ definitionVariants = parent.findall(f"{child.tag}/proto/name[.='{definitionName}']/../..")
+
+ if definitionName:
+ bestMatchApi = None
+ requires = None
+ for apiName in [toApiName] + fromApiNames:
+ for variant in definitionVariants:
+ # Keep any requires attributes from the target API
+ if variant.get('requires') and variant.get('api') == apiName:
+ requires = variant.get('requires')
+ # Find the best matching definition
+ if apiName in variant.get('api').split(',') and bestMatchApi is None:
+ bestMatchApi = variant.get('api')
+
+ if bestMatchApi:
+ for variant in definitionVariants:
+ if variant.get('api') != bestMatchApi:
+ # Only keep best matching definition
+ parent.remove(variant)
+ else:
+ # Add requires attribute from the target API if it is not overridden
+ if requires is not None and variant.get('requires') is None:
+ variant.set('requires', requires)
+ variant.set('api', toApiName)
+
+
+def stripNonmatchingAPIs(tree, apiName, actuallyDelete = True):
+ """Remove tree Elements with 'api' attributes matching apiName.
+
+ tree - Element at the root of the hierarchy to strip. Only its
+ children can actually be removed, not the tree itself.
+ apiName - string which much match a command-separated component of
+ the 'api' attribute.
+ actuallyDelete - only delete matching elements if True."""
+
+ stack = deque()
+ stack.append(tree)
+
+ while len(stack) > 0:
+ parent = stack.pop()
+
+ for child in parent.findall('*'):
+ api = child.get('api')
+
+ if apiNameMatch(apiName, api):
+ # Add child to the queue
+ stack.append(child)
+ elif not apiNameMatch(apiName, api):
+ # Child does not match requested api. Remove it.
+ if actuallyDelete:
+ parent.remove(child)
+
+
+class BaseInfo:
+ """Base class for information about a registry feature
+ (type/group/enum/command/API/extension).
+
+ Represents the state of a registry feature, used during API generation.
+ """
+
+ def __init__(self, elem):
+ self.required = False
+ """should this feature be defined during header generation
+ (has it been removed by a profile or version)?"""
+
+ self.declared = False
+ "has this feature been defined already?"
+
+ self.elem = elem
+ "etree Element for this feature"
+
+ def resetState(self):
+ """Reset required/declared to initial values. Used
+ prior to generating a new API interface."""
+ self.required = False
+ self.declared = False
+
+ def compareKeys(self, info, key, required = False):
+ """Return True if self.elem and info.elem have the same attribute
+ value for key.
+ If 'required' is not True, also returns True if neither element
+ has an attribute value for key."""
+
+ if required and key not in self.elem.keys():
+ return False
+ return self.elem.get(key) == info.elem.get(key)
+
+ def compareElem(self, info, infoName):
+ """Return True if self.elem and info.elem have the same definition.
+ info - the other object
+ infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' /
+ 'extension'"""
+
+ if infoName == 'enum':
+ if self.compareKeys(info, 'extends'):
+ # Either both extend the same type, or no type
+ if (self.compareKeys(info, 'value', required = True) or
+ self.compareKeys(info, 'bitpos', required = True)):
+ # If both specify the same value or bit position,
+ # they are equal
+ return True
+ elif (self.compareKeys(info, 'extnumber') and
+ self.compareKeys(info, 'offset') and
+ self.compareKeys(info, 'dir')):
+ # If both specify the same relative offset, they are equal
+ return True
+ elif (self.compareKeys(info, 'alias')):
+ # If both are aliases of the same value
+ return True
+ else:
+ return False
+ else:
+ # The same enum cannot extend two different types
+ return False
+ else:
+ # Non-<enum>s should never be redefined
+ return False
+
+
+class TypeInfo(BaseInfo):
+ """Registry information about a type. No additional state
+ beyond BaseInfo is required."""
+
+ def __init__(self, elem):
+ BaseInfo.__init__(self, elem)
+ self.additionalValidity = []
+ self.removedValidity = []
+
+ def getMembers(self):
+ """Get a collection of all member elements for this type, if any."""
+ return self.elem.findall('member')
+
+ def resetState(self):
+ BaseInfo.resetState(self)
+ self.additionalValidity = []
+ self.removedValidity = []
+
+
+class GroupInfo(BaseInfo):
+ """Registry information about a group of related enums
+ in an <enums> block, generally corresponding to a C "enum" type."""
+
+ def __init__(self, elem):
+ BaseInfo.__init__(self, elem)
+
+
+class EnumInfo(BaseInfo):
+ """Registry information about an enum"""
+
+ def __init__(self, elem):
+ BaseInfo.__init__(self, elem)
+ self.type = elem.get('type')
+ """numeric type of the value of the <enum> tag
+ ( '' for GLint, 'u' for GLuint, 'ull' for GLuint64 )"""
+ if self.type is None:
+ self.type = ''
+
+
+class CmdInfo(BaseInfo):
+ """Registry information about a command"""
+
+ def __init__(self, elem):
+ BaseInfo.__init__(self, elem)
+ self.additionalValidity = []
+ self.removedValidity = []
+
+ def getParams(self):
+ """Get a collection of all param elements for this command, if any."""
+ return self.elem.findall('param')
+
+ def resetState(self):
+ BaseInfo.resetState(self)
+ self.additionalValidity = []
+ self.removedValidity = []
+
+
+class FeatureInfo(BaseInfo):
+ """Registry information about an API <feature>
+ or <extension>."""
+
+ def __init__(self, elem):
+ BaseInfo.__init__(self, elem)
+ self.name = elem.get('name')
+ "feature name string (e.g. 'VK_KHR_surface')"
+
+ self.emit = False
+ "has this feature been defined already?"
+
+ self.sortorder = int(elem.get('sortorder', 0))
+ """explicit numeric sort key within feature and extension groups.
+ Defaults to 0."""
+
+ # Determine element category (vendor). Only works
+ # for <extension> elements.
+ if elem.tag == 'feature':
+ # Element category (vendor) is meaningless for <feature>
+ self.category = 'VERSION'
+ """category, e.g. VERSION or khr/vendor tag"""
+
+ self.version = elem.get('name')
+ """feature name string"""
+
+ self.versionNumber = elem.get('number')
+ """versionNumber - API version number, taken from the 'number'
+ attribute of <feature>. Extensions do not have API version
+ numbers and are assigned number 0."""
+
+ self.number = 0
+ self.supported = None
+ else:
+ # Extract vendor portion of <APIprefix>_<vendor>_<name>
+ self.category = self.name.split('_', 2)[1]
+ self.version = "0"
+ self.versionNumber = "0"
+
+ self.number = int(elem.get('number','0'))
+ """extension number, used for ordering and for assigning
+ enumerant offsets. <feature> features do not have extension
+ numbers and are assigned number 0, as are extensions without
+ numbers, so sorting works."""
+
+ self.supported = elem.get('supported', 'disabled')
+
+class SpirvInfo(BaseInfo):
+ """Registry information about an API <spirvextensions>
+ or <spirvcapability>."""
+
+ def __init__(self, elem):
+ BaseInfo.__init__(self, elem)
+
+class FormatInfo(BaseInfo):
+ """Registry information about an API <format>."""
+
+ def __init__(self, elem, condition):
+ BaseInfo.__init__(self, elem)
+ # Need to save the condition here when it is known
+ self.condition = condition
+
+class SyncStageInfo(BaseInfo):
+ """Registry information about <syncstage>."""
+
+ def __init__(self, elem, condition):
+ BaseInfo.__init__(self, elem)
+ # Need to save the condition here when it is known
+ self.condition = condition
+
+class SyncAccessInfo(BaseInfo):
+ """Registry information about <syncaccess>."""
+
+ def __init__(self, elem, condition):
+ BaseInfo.__init__(self, elem)
+ # Need to save the condition here when it is known
+ self.condition = condition
+
+class SyncPipelineInfo(BaseInfo):
+ """Registry information about <syncpipeline>."""
+
+ def __init__(self, elem):
+ BaseInfo.__init__(self, elem)
+
+class Registry:
+ """Object representing an API registry, loaded from an XML file."""
+
+ def __init__(self, gen=None, genOpts=None):
+ if gen is None:
+ # If not specified, give a default object so messaging will work
+ self.gen = OutputGenerator()
+ else:
+ self.gen = gen
+ "Output generator used to write headers / messages"
+
+ if genOpts is None:
+ # If no generator is provided, we may still need the XML API name
+ # (for example, in genRef.py).
+ self.genOpts = GeneratorOptions(apiname = APIConventions().xml_api_name)
+ else:
+ self.genOpts = genOpts
+ "Options controlling features to write and how to format them"
+
+ self.gen.registry = self
+ self.gen.genOpts = self.genOpts
+ self.gen.genOpts.registry = self
+
+ self.tree = None
+ "ElementTree containing the root `<registry>`"
+
+ self.typedict = {}
+ "dictionary of TypeInfo objects keyed by type name"
+
+ self.groupdict = {}
+ "dictionary of GroupInfo objects keyed by group name"
+
+ self.enumdict = {}
+ "dictionary of EnumInfo objects keyed by enum name"
+
+ self.cmddict = {}
+ "dictionary of CmdInfo objects keyed by command name"
+
+ self.apidict = {}
+ "dictionary of FeatureInfo objects for `<feature>` elements keyed by API name"
+
+ self.extensions = []
+ "list of `<extension>` Elements"
+
+ self.extdict = {}
+ "dictionary of FeatureInfo objects for `<extension>` elements keyed by extension name"
+
+ self.spirvextdict = {}
+ "dictionary of FeatureInfo objects for `<spirvextension>` elements keyed by spirv extension name"
+
+ self.spirvcapdict = {}
+ "dictionary of FeatureInfo objects for `<spirvcapability>` elements keyed by spirv capability name"
+
+ self.formatsdict = {}
+ "dictionary of FeatureInfo objects for `<format>` elements keyed by VkFormat name"
+
+ self.syncstagedict = {}
+ "dictionary of Sync*Info objects for `<syncstage>` elements keyed by VkPipelineStageFlagBits2 name"
+
+ self.syncaccessdict = {}
+ "dictionary of Sync*Info objects for `<syncaccess>` elements keyed by VkAccessFlagBits2 name"
+
+ self.syncpipelinedict = {}
+ "dictionary of Sync*Info objects for `<syncpipeline>` elements keyed by pipeline type name"
+
+ self.emitFeatures = False
+ """True to actually emit features for a version / extension,
+ or False to just treat them as emitted"""
+
+ self.breakPat = None
+ "regexp pattern to break on when generating names"
+ # self.breakPat = re.compile('VkFenceImportFlagBits.*')
+
+ self.requiredextensions = [] # Hack - can remove it after validity generator goes away
+
+ # ** Global types for automatic source generation **
+ # Length Member data
+ self.commandextensiontuple = namedtuple('commandextensiontuple',
+ ['command', # The name of the command being modified
+ 'value', # The value to append to the command
+ 'extension']) # The name of the extension that added it
+ self.validextensionstructs = defaultdict(list)
+ self.commandextensionsuccesses = []
+ self.commandextensionerrors = []
+
+ self.filename = None
+
+ def loadElementTree(self, tree):
+ """Load ElementTree into a Registry object and parse it."""
+ self.tree = tree
+ self.parseTree()
+
+ def loadFile(self, file):
+ """Load an API registry XML file into a Registry object and parse it"""
+ self.filename = file
+ self.tree = etree.parse(file)
+ self.parseTree()
+
+ def setGenerator(self, gen):
+ """Specify output generator object.
+
+ `None` restores the default generator."""
+ self.gen = gen
+ self.gen.setRegistry(self)
+
+ def addElementInfo(self, elem, info, infoName, dictionary):
+ """Add information about an element to the corresponding dictionary.
+
+ Intended for internal use only.
+
+ - elem - `<type>`/`<enums>`/`<enum>`/`<command>`/`<feature>`/`<extension>`/`<spirvextension>`/`<spirvcapability>`/`<format>`/`<syncstage>`/`<syncaccess>`/`<syncpipeline>` Element
+ - info - corresponding {Type|Group|Enum|Cmd|Feature|Spirv|Format|SyncStage|SyncAccess|SyncPipeline}Info object
+ - infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension' / 'spirvextension' / 'spirvcapability' / 'format' / 'syncstage' / 'syncaccess' / 'syncpipeline'
+ - dictionary - self.{type|group|enum|cmd|api|ext|format|spirvext|spirvcap|sync}dict
+
+ The dictionary key is the element 'name' attribute."""
+
+ # self.gen.logMsg('diag', 'Adding ElementInfo.required =',
+ # info.required, 'name =', elem.get('name'))
+ key = elem.get('name')
+ if key in dictionary:
+ if not dictionary[key].compareElem(info, infoName):
+ self.gen.logMsg('warn', 'Attempt to redefine', key,
+ '(this should not happen)')
+ else:
+ dictionary[key] = info
+
+ def lookupElementInfo(self, fname, dictionary):
+ """Find a {Type|Enum|Cmd}Info object by name.
+
+ Intended for internal use only.
+
+ If an object qualified by API name exists, use that.
+
+ - fname - name of type / enum / command
+ - dictionary - self.{type|enum|cmd}dict"""
+ key = (fname, self.genOpts.apiname)
+ if key in dictionary:
+ # self.gen.logMsg('diag', 'Found API-specific element for feature', fname)
+ return dictionary[key]
+ if fname in dictionary:
+ # self.gen.logMsg('diag', 'Found generic element for feature', fname)
+ return dictionary[fname]
+
+ return None
+
+ def breakOnName(self, regexp):
+ """Specify a feature name regexp to break on when generating features."""
+ self.breakPat = re.compile(regexp)
+
+ def parseTree(self):
+ """Parse the registry Element, once created"""
+ # This must be the Element for the root <registry>
+ if self.tree is None:
+ raise RuntimeError("Tree not initialized!")
+ self.reg = self.tree.getroot()
+
+ # Preprocess the tree in one of the following ways:
+ # - either merge a set of APIs to another API based on their 'api' attributes
+ # - or remove all elements with non-matching 'api' attributes
+ # The preprocessing happens through a breath-first tree traversal.
+ # This is a blunt hammer, but eliminates the need to track and test
+ # the apis deeper in processing to select the correct elements and
+ # avoid duplicates.
+ # Schema validation should prevent duplicate elements with
+ # overlapping api attributes, or where one element has an api
+ # attribute and the other does not.
+
+ if self.genOpts.mergeApiNames:
+ mergeAPIs(self.reg, self.genOpts.mergeApiNames.split(','), self.genOpts.apiname)
+ else:
+ stripNonmatchingAPIs(self.reg, self.genOpts.apiname, actuallyDelete = True)
+
+ # Create dictionary of registry types from toplevel <types> tags
+ # and add 'name' attribute to each <type> tag (where missing)
+ # based on its <name> element.
+ #
+ # There is usually one <types> block; more are OK
+ # Required <type> attributes: 'name' or nested <name> tag contents
+ self.typedict = {}
+ for type_elem in self.reg.findall('types/type'):
+ # If the <type> does not already have a 'name' attribute, set
+ # it from contents of its <name> tag.
+ if type_elem.get('name') is None:
+ name_elem = type_elem.find('name')
+ if name_elem is None or not name_elem.text:
+ raise RuntimeError("Type without a name!")
+ type_elem.set('name', name_elem.text)
+ self.addElementInfo(type_elem, TypeInfo(type_elem), 'type', self.typedict)
+
+ # Create dictionary of registry enum groups from <enums> tags.
+ #
+ # Required <enums> attributes: 'name'. If no name is given, one is
+ # generated, but that group cannot be identified and turned into an
+ # enum type definition - it is just a container for <enum> tags.
+ self.groupdict = {}
+ for group in self.reg.findall('enums'):
+ self.addElementInfo(group, GroupInfo(group), 'group', self.groupdict)
+
+ # Create dictionary of registry enums from <enum> tags
+ #
+ # <enums> tags usually define different namespaces for the values
+ # defined in those tags, but the actual names all share the
+ # same dictionary.
+ # Required <enum> attributes: 'name', 'value'
+ # For containing <enums> which have type="enum" or type="bitmask",
+ # tag all contained <enum>s are required. This is a stopgap until
+ # a better scheme for tagging core and extension enums is created.
+ self.enumdict = {}
+ for enums in self.reg.findall('enums'):
+ required = (enums.get('type') is not None)
+ for enum in enums.findall('enum'):
+ enumInfo = EnumInfo(enum)
+ enumInfo.required = required
+ self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
+
+ # Create dictionary of registry commands from <command> tags
+ # and add 'name' attribute to each <command> tag (where missing)
+ # based on its <proto><name> element.
+ #
+ # There is usually only one <commands> block; more are OK.
+ # Required <command> attributes: 'name' or <proto><name> tag contents
+ self.cmddict = {}
+ # List of commands which alias others. Contains
+ # [ aliasName, element ]
+ # for each alias
+ cmdAlias = []
+ for cmd in self.reg.findall('commands/command'):
+ # If the <command> does not already have a 'name' attribute, set
+ # it from contents of its <proto><name> tag.
+ name = cmd.get('name')
+ if name is None:
+ name_elem = cmd.find('proto/name')
+ if name_elem is None or not name_elem.text:
+ raise RuntimeError("Command without a name!")
+ name = cmd.set('name', name_elem.text)
+ ci = CmdInfo(cmd)
+ self.addElementInfo(cmd, ci, 'command', self.cmddict)
+ alias = cmd.get('alias')
+ if alias:
+ cmdAlias.append([name, alias, cmd])
+
+ # Now loop over aliases, injecting a copy of the aliased command's
+ # Element with the aliased prototype name replaced with the command
+ # name - if it exists.
+ for (name, alias, cmd) in cmdAlias:
+ if alias in self.cmddict:
+ aliasInfo = self.cmddict[alias]
+ cmdElem = copy.deepcopy(aliasInfo.elem)
+ cmdElem.find('proto/name').text = name
+ cmdElem.set('name', name)
+ cmdElem.set('alias', alias)
+ ci = CmdInfo(cmdElem)
+ # Replace the dictionary entry for the CmdInfo element
+ self.cmddict[name] = ci
+
+ # @ newString = etree.tostring(base, encoding="unicode").replace(aliasValue, aliasName)
+ # @elem.append(etree.fromstring(replacement))
+ else:
+ self.gen.logMsg('warn', 'No matching <command> found for command',
+ cmd.get('name'), 'alias', alias)
+
+ # Create dictionaries of API and extension interfaces
+ # from toplevel <api> and <extension> tags.
+ self.apidict = {}
+ format_condition = dict()
+ for feature in self.reg.findall('feature'):
+ featureInfo = FeatureInfo(feature)
+ self.addElementInfo(feature, featureInfo, 'feature', self.apidict)
+
+ # Add additional enums defined only in <feature> tags
+ # to the corresponding enumerated type.
+ # When seen here, the <enum> element, processed to contain the
+ # numeric enum value, is added to the corresponding <enums>
+ # element, as well as adding to the enum dictionary. It is no
+ # longer removed from the <require> element it is introduced in.
+ # Instead, generateRequiredInterface ignores <enum> elements
+ # that extend enumerated types.
+ #
+ # For <enum> tags which are actually just constants, if there is
+ # no 'extends' tag but there is a 'value' or 'bitpos' tag, just
+ # add an EnumInfo record to the dictionary. That works because
+ # output generation of constants is purely dependency-based, and
+ # does not need to iterate through the XML tags.
+ for elem in feature.findall('require'):
+ for enum in elem.findall('enum'):
+ addEnumInfo = False
+ groupName = enum.get('extends')
+ if groupName is not None:
+ # self.gen.logMsg('diag', 'Found extension enum',
+ # enum.get('name'))
+ # Add version number attribute to the <enum> element
+ enum.set('version', featureInfo.version)
+ # Look up the GroupInfo with matching groupName
+ if groupName in self.groupdict:
+ # self.gen.logMsg('diag', 'Matching group',
+ # groupName, 'found, adding element...')
+ gi = self.groupdict[groupName]
+ gi.elem.append(copy.deepcopy(enum))
+ else:
+ self.gen.logMsg('warn', 'NO matching group',
+ groupName, 'for enum', enum.get('name'), 'found.')
+ if groupName == "VkFormat":
+ format_name = enum.get('name')
+ if enum.get('alias'):
+ format_name = enum.get('alias')
+ format_condition[format_name] = featureInfo.name
+ addEnumInfo = True
+ elif enum.get('value') or enum.get('bitpos') or enum.get('alias'):
+ # self.gen.logMsg('diag', 'Adding extension constant "enum"',
+ # enum.get('name'))
+ addEnumInfo = True
+ if addEnumInfo:
+ enumInfo = EnumInfo(enum)
+ self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
+
+ sync_pipeline_stage_condition = dict()
+ sync_access_condition = dict()
+
+ self.extensions = self.reg.findall('extensions/extension')
+ self.extdict = {}
+ for feature in self.extensions:
+ featureInfo = FeatureInfo(feature)
+ self.addElementInfo(feature, featureInfo, 'extension', self.extdict)
+
+ # Add additional enums defined only in <extension> tags
+ # to the corresponding core type.
+ # Algorithm matches that of enums in a "feature" tag as above.
+ #
+ # This code also adds a 'extnumber' attribute containing the
+ # extension number, used for enumerant value calculation.
+ for elem in feature.findall('require'):
+ for enum in elem.findall('enum'):
+ addEnumInfo = False
+ groupName = enum.get('extends')
+ if groupName is not None:
+ # self.gen.logMsg('diag', 'Found extension enum',
+ # enum.get('name'))
+
+ # Add <extension> block's extension number attribute to
+ # the <enum> element unless specified explicitly, such
+ # as when redefining an enum in another extension.
+ extnumber = enum.get('extnumber')
+ if not extnumber:
+ enum.set('extnumber', str(featureInfo.number))
+
+ enum.set('extname', featureInfo.name)
+ enum.set('supported', noneStr(featureInfo.supported))
+ # Look up the GroupInfo with matching groupName
+ if groupName in self.groupdict:
+ # self.gen.logMsg('diag', 'Matching group',
+ # groupName, 'found, adding element...')
+ gi = self.groupdict[groupName]
+ gi.elem.append(copy.deepcopy(enum))
+ else:
+ self.gen.logMsg('warn', 'NO matching group',
+ groupName, 'for enum', enum.get('name'), 'found.')
+ # This is Vulkan-specific
+ if groupName == "VkFormat":
+ format_name = enum.get('name')
+ if enum.get('alias'):
+ format_name = enum.get('alias')
+ if format_name in format_condition:
+ format_condition[format_name] += "," + featureInfo.name
+ else:
+ format_condition[format_name] = featureInfo.name
+ elif groupName == "VkPipelineStageFlagBits2":
+ stage_flag = enum.get('name')
+ if enum.get('alias'):
+ stage_flag = enum.get('alias')
+ featureName = elem.get('depends') if elem.get('depends') is not None else featureInfo.name
+ if stage_flag in sync_pipeline_stage_condition:
+ sync_pipeline_stage_condition[stage_flag] += "," + featureName
+ else:
+ sync_pipeline_stage_condition[stage_flag] = featureName
+ elif groupName == "VkAccessFlagBits2":
+ access_flag = enum.get('name')
+ if enum.get('alias'):
+ access_flag = enum.get('alias')
+ featureName = elem.get('depends') if elem.get('depends') is not None else featureInfo.name
+ if access_flag in sync_access_condition:
+ sync_access_condition[access_flag] += "," + featureName
+ else:
+ sync_access_condition[access_flag] = featureName
+
+ addEnumInfo = True
+ elif enum.get('value') or enum.get('bitpos') or enum.get('alias'):
+ # self.gen.logMsg('diag', 'Adding extension constant "enum"',
+ # enum.get('name'))
+ addEnumInfo = True
+ if addEnumInfo:
+ enumInfo = EnumInfo(enum)
+ self.addElementInfo(enum, enumInfo, 'enum', self.enumdict)
+
+ # Parse out all spirv tags in dictionaries
+ # Use addElementInfo to catch duplicates
+ for spirv in self.reg.findall('spirvextensions/spirvextension'):
+ spirvInfo = SpirvInfo(spirv)
+ self.addElementInfo(spirv, spirvInfo, 'spirvextension', self.spirvextdict)
+ for spirv in self.reg.findall('spirvcapabilities/spirvcapability'):
+ spirvInfo = SpirvInfo(spirv)
+ self.addElementInfo(spirv, spirvInfo, 'spirvcapability', self.spirvcapdict)
+
+ for format in self.reg.findall('formats/format'):
+ condition = None
+ format_name = format.get('name')
+ if format_name in format_condition:
+ condition = format_condition[format_name]
+ formatInfo = FormatInfo(format, condition)
+ self.addElementInfo(format, formatInfo, 'format', self.formatsdict)
+
+ for stage in self.reg.findall('sync/syncstage'):
+ condition = None
+ stage_flag = stage.get('name')
+ if stage_flag in sync_pipeline_stage_condition:
+ condition = sync_pipeline_stage_condition[stage_flag]
+ syncInfo = SyncStageInfo(stage, condition)
+ self.addElementInfo(stage, syncInfo, 'syncstage', self.syncstagedict)
+
+ for access in self.reg.findall('sync/syncaccess'):
+ condition = None
+ access_flag = access.get('name')
+ if access_flag in sync_access_condition:
+ condition = sync_access_condition[access_flag]
+ syncInfo = SyncAccessInfo(access, condition)
+ self.addElementInfo(access, syncInfo, 'syncaccess', self.syncaccessdict)
+
+ for pipeline in self.reg.findall('sync/syncpipeline'):
+ syncInfo = SyncPipelineInfo(pipeline)
+ self.addElementInfo(pipeline, syncInfo, 'syncpipeline', self.syncpipelinedict)
+
+ def dumpReg(self, maxlen=120, filehandle=sys.stdout):
+ """Dump all the dictionaries constructed from the Registry object.
+
+ Diagnostic to dump the dictionaries to specified file handle (default stdout).
+ Truncates type / enum / command elements to maxlen characters (default 120)"""
+ write('***************************************', file=filehandle)
+ write(' ** Dumping Registry contents **', file=filehandle)
+ write('***************************************', file=filehandle)
+ write('// Types', file=filehandle)
+ for name in self.typedict:
+ tobj = self.typedict[name]
+ write(' Type', name, '->', etree.tostring(tobj.elem)[0:maxlen], file=filehandle)
+ write('// Groups', file=filehandle)
+ for name in self.groupdict:
+ gobj = self.groupdict[name]
+ write(' Group', name, '->', etree.tostring(gobj.elem)[0:maxlen], file=filehandle)
+ write('// Enums', file=filehandle)
+ for name in self.enumdict:
+ eobj = self.enumdict[name]
+ write(' Enum', name, '->', etree.tostring(eobj.elem)[0:maxlen], file=filehandle)
+ write('// Commands', file=filehandle)
+ for name in self.cmddict:
+ cobj = self.cmddict[name]
+ write(' Command', name, '->', etree.tostring(cobj.elem)[0:maxlen], file=filehandle)
+ write('// APIs', file=filehandle)
+ for key in self.apidict:
+ write(' API Version ', key, '->',
+ etree.tostring(self.apidict[key].elem)[0:maxlen], file=filehandle)
+ write('// Extensions', file=filehandle)
+ for key in self.extdict:
+ write(' Extension', key, '->',
+ etree.tostring(self.extdict[key].elem)[0:maxlen], file=filehandle)
+ write('// SPIR-V', file=filehandle)
+ for key in self.spirvextdict:
+ write(' SPIR-V Extension', key, '->',
+ etree.tostring(self.spirvextdict[key].elem)[0:maxlen], file=filehandle)
+ for key in self.spirvcapdict:
+ write(' SPIR-V Capability', key, '->',
+ etree.tostring(self.spirvcapdict[key].elem)[0:maxlen], file=filehandle)
+ write('// VkFormat', file=filehandle)
+ for key in self.formatsdict:
+ write(' VkFormat', key, '->',
+ etree.tostring(self.formatsdict[key].elem)[0:maxlen], file=filehandle)
+
+ def markTypeRequired(self, typename, required):
+ """Require (along with its dependencies) or remove (but not its dependencies) a type.
+
+ - typename - name of type
+ - required - boolean (to tag features as required or not)
+ """
+ self.gen.logMsg('diag', 'tagging type:', typename, '-> required =', required)
+
+ # Get TypeInfo object for <type> tag corresponding to typename
+ typeinfo = self.lookupElementInfo(typename, self.typedict)
+ if typeinfo is not None:
+ if required:
+ # Tag type dependencies in 'alias' and 'required' attributes as
+ # required. This does not un-tag dependencies in a <remove>
+ # tag. See comments in markRequired() below for the reason.
+ for attrib_name in ['requires', 'alias']:
+ depname = typeinfo.elem.get(attrib_name)
+ if depname:
+ self.gen.logMsg('diag', 'Generating dependent type',
+ depname, 'for', attrib_name, 'type', typename)
+ # Do not recurse on self-referential structures.
+ if typename != depname:
+ self.markTypeRequired(depname, required)
+ else:
+ self.gen.logMsg('diag', 'type', typename, 'is self-referential')
+ # Tag types used in defining this type (e.g. in nested
+ # <type> tags)
+ # Look for <type> in entire <command> tree,
+ # not just immediate children
+ for subtype in typeinfo.elem.findall('.//type'):
+ self.gen.logMsg('diag', 'markRequired: type requires dependent <type>', subtype.text)
+ if typename != subtype.text:
+ self.markTypeRequired(subtype.text, required)
+ else:
+ self.gen.logMsg('diag', 'type', typename, 'is self-referential')
+ # Tag enums used in defining this type, for example in
+ # <member><name>member</name>[<enum>MEMBER_SIZE</enum>]</member>
+ for subenum in typeinfo.elem.findall('.//enum'):
+ self.gen.logMsg('diag', 'markRequired: type requires dependent <enum>', subenum.text)
+ self.markEnumRequired(subenum.text, required)
+ # Tag type dependency in 'bitvalues' attributes as
+ # required. This ensures that the bit values for a flag
+ # are emitted
+ depType = typeinfo.elem.get('bitvalues')
+ if depType:
+ self.gen.logMsg('diag', 'Generating bitflag type',
+ depType, 'for type', typename)
+ self.markTypeRequired(depType, required)
+ group = self.lookupElementInfo(depType, self.groupdict)
+ if group is not None:
+ group.flagType = typeinfo
+
+ typeinfo.required = required
+ elif '.h' not in typename:
+ self.gen.logMsg('warn', 'type:', typename, 'IS NOT DEFINED')
+
+ def markEnumRequired(self, enumname, required):
+ """Mark an enum as required or not.
+
+ - enumname - name of enum
+ - required - boolean (to tag features as required or not)"""
+
+ self.gen.logMsg('diag', 'markEnumRequired: tagging enum:', enumname, '-> required =', required)
+ enum = self.lookupElementInfo(enumname, self.enumdict)
+ if enum is not None:
+ # If the enum is part of a group, and is being removed, then
+ # look it up in that <enums> tag and remove the Element there,
+ # so that it is not visible to generators (which traverse the
+ # <enums> tag elements rather than using the dictionaries).
+ if not required:
+ groupName = enum.elem.get('extends')
+ if groupName is not None:
+ self.gen.logMsg('diag', f'markEnumRequired: Removing extending enum {enum.elem.get("name")}')
+
+ # Look up the Info with matching groupName
+ if groupName in self.groupdict:
+ gi = self.groupdict[groupName]
+ gienum = gi.elem.find("enum[@name='" + enumname + "']")
+ if gienum is not None:
+ # Remove copy of this enum from the group
+ gi.elem.remove(gienum)
+ else:
+ self.gen.logMsg('warn', 'markEnumRequired: Cannot remove enum',
+ enumname, 'not found in group',
+ groupName)
+ else:
+ self.gen.logMsg('warn', 'markEnumRequired: Cannot remove enum',
+ enumname, 'from nonexistent group',
+ groupName)
+ else:
+ # This enum is not an extending enum.
+ # The XML tree must be searched for all <enums> that
+ # might have it, so we know the parent to delete from.
+
+ enumName = enum.elem.get('name')
+
+ self.gen.logMsg('diag', f'markEnumRequired: Removing non-extending enum {enumName}')
+
+ count = 0
+ for enums in self.reg.findall('enums'):
+ for thisEnum in enums.findall('enum'):
+ if thisEnum.get('name') == enumName:
+ # Actually remove it
+ count = count + 1
+ enums.remove(thisEnum)
+
+ if count == 0:
+ self.gen.logMsg('warn', f'markEnumRequired: {enumName}) not found in any <enums> tag')
+
+ enum.required = required
+ # Tag enum dependencies in 'alias' attribute as required
+ depname = enum.elem.get('alias')
+ if depname:
+ self.gen.logMsg('diag', 'markEnumRequired: Generating dependent enum',
+ depname, 'for alias', enumname, 'required =', enum.required)
+ self.markEnumRequired(depname, required)
+ else:
+ self.gen.logMsg('warn', f'markEnumRequired: {enumname} IS NOT DEFINED')
+
+ def markCmdRequired(self, cmdname, required):
+ """Mark a command as required or not.
+
+ - cmdname - name of command
+ - required - boolean (to tag features as required or not)"""
+ self.gen.logMsg('diag', 'tagging command:', cmdname, '-> required =', required)
+ cmd = self.lookupElementInfo(cmdname, self.cmddict)
+ if cmd is not None:
+ cmd.required = required
+
+ # Tag command dependencies in 'alias' attribute as required
+ #
+ # This is usually not done, because command 'aliases' are not
+ # actual C language aliases like type and enum aliases. Instead
+ # they are just duplicates of the function signature of the
+ # alias. This means that there is no dependency of a command
+ # alias on what it aliases. One exception is validity includes,
+ # where the spec markup needs the promoted-to validity include
+ # even if only the promoted-from command is being built.
+ if self.genOpts.requireCommandAliases:
+ depname = cmd.elem.get('alias')
+ if depname:
+ self.gen.logMsg('diag', 'Generating dependent command',
+ depname, 'for alias', cmdname)
+ self.markCmdRequired(depname, required)
+
+ # Tag all parameter types of this command as required.
+ # This does not remove types of commands in a <remove>
+ # tag, because many other commands may use the same type.
+ # We could be more clever and reference count types,
+ # instead of using a boolean.
+ if required:
+ # Look for <type> in entire <command> tree,
+ # not just immediate children
+ for type_elem in cmd.elem.findall('.//type'):
+ self.gen.logMsg('diag', 'markRequired: command implicitly requires dependent type', type_elem.text)
+ self.markTypeRequired(type_elem.text, required)
+ else:
+ self.gen.logMsg('warn', 'command:', cmdname, 'IS NOT DEFINED')
+
+ def markRequired(self, featurename, feature, required):
+ """Require or remove features specified in the Element.
+
+ - featurename - name of the feature
+ - feature - Element for `<require>` or `<remove>` tag
+ - required - boolean (to tag features as required or not)"""
+ self.gen.logMsg('diag', 'markRequired (feature = <too long to print>, required =', required, ')')
+
+ # Loop over types, enums, and commands in the tag
+ # @@ It would be possible to respect 'api' and 'profile' attributes
+ # in individual features, but that is not done yet.
+ for typeElem in feature.findall('type'):
+ self.markTypeRequired(typeElem.get('name'), required)
+ for enumElem in feature.findall('enum'):
+ self.markEnumRequired(enumElem.get('name'), required)
+
+ for cmdElem in feature.findall('command'):
+ self.markCmdRequired(cmdElem.get('name'), required)
+
+ # Extensions may need to extend existing commands or other items in the future.
+ # So, look for extend tags.
+ for extendElem in feature.findall('extend'):
+ extendType = extendElem.get('type')
+ if extendType == 'command':
+ commandName = extendElem.get('name')
+ successExtends = extendElem.get('successcodes')
+ if successExtends is not None:
+ for success in successExtends.split(','):
+ self.commandextensionsuccesses.append(self.commandextensiontuple(command=commandName,
+ value=success,
+ extension=featurename))
+ errorExtends = extendElem.get('errorcodes')
+ if errorExtends is not None:
+ for error in errorExtends.split(','):
+ self.commandextensionerrors.append(self.commandextensiontuple(command=commandName,
+ value=error,
+ extension=featurename))
+ else:
+ self.gen.logMsg('warn', 'extend type:', extendType, 'IS NOT SUPPORTED')
+
+ def getAlias(self, elem, dict):
+ """Check for an alias in the same require block.
+
+ - elem - Element to check for an alias"""
+
+ # Try to find an alias
+ alias = elem.get('alias')
+ if alias is None:
+ name = elem.get('name')
+ typeinfo = self.lookupElementInfo(name, dict)
+ if not typeinfo:
+ self.gen.logMsg('error', name, 'is not a known name')
+ alias = typeinfo.elem.get('alias')
+
+ return alias
+
+ def checkForCorrectionAliases(self, alias, require, tag):
+ """Check for an alias in the same require block.
+
+ - alias - String name of the alias
+ - require - `<require>` block from the registry
+ - tag - tag to look for in the require block"""
+
+ # For the time being, the code below is bypassed. It has the effect
+ # of excluding "spelling aliases" created to comply with the style
+ # guide, but this leaves references out of the specification and
+ # causes broken internal links.
+ #
+ # if alias and require.findall(tag + "[@name='" + alias + "']"):
+ # return True
+
+ return False
+
+ def fillFeatureDictionary(self, interface, featurename, api, profile):
+ """Capture added interfaces for a `<version>` or `<extension>`.
+
+ - interface - Element for `<version>` or `<extension>`, containing
+ `<require>` and `<remove>` tags
+ - featurename - name of the feature
+ - api - string specifying API name being generated
+ - profile - string specifying API profile being generated"""
+
+ # Explicitly initialize known types - errors for unhandled categories
+ self.gen.featureDictionary[featurename] = {
+ "enumconstant": {},
+ "command": {},
+ "enum": {},
+ "struct": {},
+ "handle": {},
+ "basetype": {},
+ "include": {},
+ "define": {},
+ "bitmask": {},
+ "union": {},
+ "funcpointer": {},
+ }
+
+ # <require> marks things that are required by this version/profile
+ for require in interface.findall('require'):
+ if matchAPIProfile(api, profile, require):
+
+ # Determine the required extension or version needed for a require block
+ # Assumes that only one of these is specified
+ # 'extension', and therefore 'required_key', may be a boolean
+ # expression of extension names.
+ # 'required_key' is used only as a dictionary key at
+ # present, and passed through to the script generators, so
+ # they must be prepared to parse that boolean expression.
+ required_key = require.get('depends')
+
+ # Loop over types, enums, and commands in the tag
+ for typeElem in require.findall('type'):
+ typename = typeElem.get('name')
+ typeinfo = self.lookupElementInfo(typename, self.typedict)
+
+ if typeinfo:
+ # Remove aliases in the same extension/feature; these are always added as a correction. Do not need the original to be visible.
+ alias = self.getAlias(typeElem, self.typedict)
+ if not self.checkForCorrectionAliases(alias, require, 'type'):
+ # Resolve the type info to the actual type, so we get an accurate read for 'structextends'
+ while alias:
+ typeinfo = self.lookupElementInfo(alias, self.typedict)
+ alias = typeinfo.elem.get('alias')
+
+ typecat = typeinfo.elem.get('category')
+ typeextends = typeinfo.elem.get('structextends')
+ if not required_key in self.gen.featureDictionary[featurename][typecat]:
+ self.gen.featureDictionary[featurename][typecat][required_key] = {}
+ if not typeextends in self.gen.featureDictionary[featurename][typecat][required_key]:
+ self.gen.featureDictionary[featurename][typecat][required_key][typeextends] = []
+ self.gen.featureDictionary[featurename][typecat][required_key][typeextends].append(typename)
+ else:
+ self.gen.logMsg('warn', 'fillFeatureDictionary: NOT filling for {}'.format(typename))
+
+
+ for enumElem in require.findall('enum'):
+ enumname = enumElem.get('name')
+ typeinfo = self.lookupElementInfo(enumname, self.enumdict)
+
+ # Remove aliases in the same extension/feature; these are always added as a correction. Do not need the original to be visible.
+ alias = self.getAlias(enumElem, self.enumdict)
+ if not self.checkForCorrectionAliases(alias, require, 'enum'):
+ enumextends = enumElem.get('extends')
+ if not required_key in self.gen.featureDictionary[featurename]['enumconstant']:
+ self.gen.featureDictionary[featurename]['enumconstant'][required_key] = {}
+ if not enumextends in self.gen.featureDictionary[featurename]['enumconstant'][required_key]:
+ self.gen.featureDictionary[featurename]['enumconstant'][required_key][enumextends] = []
+ self.gen.featureDictionary[featurename]['enumconstant'][required_key][enumextends].append(enumname)
+ else:
+ self.gen.logMsg('warn', 'fillFeatureDictionary: NOT filling for {}'.format(typename))
+
+ for cmdElem in require.findall('command'):
+ # Remove aliases in the same extension/feature; these are always added as a correction. Do not need the original to be visible.
+ alias = self.getAlias(cmdElem, self.cmddict)
+ if not self.checkForCorrectionAliases(alias, require, 'command'):
+ if not required_key in self.gen.featureDictionary[featurename]['command']:
+ self.gen.featureDictionary[featurename]['command'][required_key] = []
+ self.gen.featureDictionary[featurename]['command'][required_key].append(cmdElem.get('name'))
+ else:
+ self.gen.logMsg('warn', 'fillFeatureDictionary: NOT filling for {}'.format(typename))
+
+ def requireFeatures(self, interface, featurename, api, profile):
+ """Process `<require>` tags for a `<version>` or `<extension>`.
+
+ - interface - Element for `<version>` or `<extension>`, containing
+ `<require>` tags
+ - featurename - name of the feature
+ - api - string specifying API name being generated
+ - profile - string specifying API profile being generated"""
+
+ # <require> marks things that are required by this version/profile
+ for feature in interface.findall('require'):
+ if matchAPIProfile(api, profile, feature):
+ self.markRequired(featurename, feature, True)
+
+ def removeFeatures(self, interface, featurename, api, profile):
+ """Process `<remove>` tags for a `<version>` or `<extension>`.
+
+ - interface - Element for `<version>` or `<extension>`, containing
+ `<remove>` tags
+ - featurename - name of the feature
+ - api - string specifying API name being generated
+ - profile - string specifying API profile being generated"""
+
+ # <remove> marks things that are removed by this version/profile
+ for feature in interface.findall('remove'):
+ if matchAPIProfile(api, profile, feature):
+ self.markRequired(featurename, feature, False)
+
+ def assignAdditionalValidity(self, interface, api, profile):
+ # Loop over all usage inside all <require> tags.
+ for feature in interface.findall('require'):
+ if matchAPIProfile(api, profile, feature):
+ for v in feature.findall('usage'):
+ if v.get('command'):
+ self.cmddict[v.get('command')].additionalValidity.append(copy.deepcopy(v))
+ if v.get('struct'):
+ self.typedict[v.get('struct')].additionalValidity.append(copy.deepcopy(v))
+
+ def removeAdditionalValidity(self, interface, api, profile):
+ # Loop over all usage inside all <remove> tags.
+ for feature in interface.findall('remove'):
+ if matchAPIProfile(api, profile, feature):
+ for v in feature.findall('usage'):
+ if v.get('command'):
+ self.cmddict[v.get('command')].removedValidity.append(copy.deepcopy(v))
+ if v.get('struct'):
+ self.typedict[v.get('struct')].removedValidity.append(copy.deepcopy(v))
+
+ def generateFeature(self, fname, ftype, dictionary, explicit=False):
+ """Generate a single type / enum group / enum / command,
+ and all its dependencies as needed.
+
+ - fname - name of feature (`<type>`/`<enum>`/`<command>`)
+ - ftype - type of feature, 'type' | 'enum' | 'command'
+ - dictionary - of *Info objects - self.{type|enum|cmd}dict
+ - explicit - True if this is explicitly required by the top-level
+ XML <require> tag, False if it is a dependency of an explicit
+ requirement."""
+
+ self.gen.logMsg('diag', 'generateFeature: generating', ftype, fname)
+
+ if not (explicit or self.genOpts.requireDepends):
+ self.gen.logMsg('diag', 'generateFeature: NOT generating', ftype, fname, 'because generator does not require dependencies')
+ return
+
+ f = self.lookupElementInfo(fname, dictionary)
+ if f is None:
+ # No such feature. This is an error, but reported earlier
+ self.gen.logMsg('diag', 'No entry found for feature', fname,
+ 'returning!')
+ return
+
+ # If feature is not required, or has already been declared, return
+ if not f.required:
+ self.gen.logMsg('diag', 'Skipping', ftype, fname, '(not required)')
+ return
+ if f.declared:
+ self.gen.logMsg('diag', 'Skipping', ftype, fname, '(already declared)')
+ return
+ # Always mark feature declared, as though actually emitted
+ f.declared = True
+
+ # Determine if this is an alias, and of what, if so
+ alias = f.elem.get('alias')
+ if alias:
+ self.gen.logMsg('diag', fname, 'is an alias of', alias)
+
+ # Pull in dependent declaration(s) of the feature.
+ # For types, there may be one type in the 'requires' attribute of
+ # the element, one in the 'alias' attribute, and many in
+ # embedded <type> and <enum> tags within the element.
+ # For commands, there may be many in <type> tags within the element.
+ # For enums, no dependencies are allowed (though perhaps if you
+ # have a uint64 enum, it should require that type).
+ genProc = None
+ followupFeature = None
+ if ftype == 'type':
+ genProc = self.gen.genType
+
+ # Generate type dependencies in 'alias' and 'requires' attributes
+ if alias:
+ self.generateFeature(alias, 'type', self.typedict)
+ requires = f.elem.get('requires')
+ if requires:
+ self.gen.logMsg('diag', 'Generating required dependent type',
+ requires)
+ self.generateFeature(requires, 'type', self.typedict)
+
+ # Generate types used in defining this type (e.g. in nested
+ # <type> tags)
+ # Look for <type> in entire <command> tree,
+ # not just immediate children
+ for subtype in f.elem.findall('.//type'):
+ self.gen.logMsg('diag', 'Generating required dependent <type>',
+ subtype.text)
+ self.generateFeature(subtype.text, 'type', self.typedict)
+
+ # Generate enums used in defining this type, for example in
+ # <member><name>member</name>[<enum>MEMBER_SIZE</enum>]</member>
+ for subtype in f.elem.findall('.//enum'):
+ self.gen.logMsg('diag', 'Generating required dependent <enum>',
+ subtype.text)
+ self.generateFeature(subtype.text, 'enum', self.enumdict)
+
+ # If the type is an enum group, look up the corresponding
+ # group in the group dictionary and generate that instead.
+ if f.elem.get('category') == 'enum':
+ self.gen.logMsg('diag', 'Type', fname, 'is an enum group, so generate that instead')
+ group = self.lookupElementInfo(fname, self.groupdict)
+ if alias is not None:
+ # An alias of another group name.
+ # Pass to genGroup with 'alias' parameter = aliased name
+ self.gen.logMsg('diag', 'Generating alias', fname,
+ 'for enumerated type', alias)
+ # Now, pass the *aliased* GroupInfo to the genGroup, but
+ # with an additional parameter which is the alias name.
+ genProc = self.gen.genGroup
+ f = self.lookupElementInfo(alias, self.groupdict)
+ elif group is None:
+ self.gen.logMsg('warn', 'Skipping enum type', fname,
+ ': No matching enumerant group')
+ return
+ else:
+ genProc = self.gen.genGroup
+ f = group
+
+ # @ The enum group is not ready for generation. At this
+ # @ point, it contains all <enum> tags injected by
+ # @ <extension> tags without any verification of whether
+ # @ they are required or not. It may also contain
+ # @ duplicates injected by multiple consistent
+ # @ definitions of an <enum>.
+
+ # @ Pass over each enum, marking its enumdict[] entry as
+ # @ required or not. Mark aliases of enums as required,
+ # @ too.
+
+ enums = group.elem.findall('enum')
+
+ self.gen.logMsg('diag', 'generateFeature: checking enums for group', fname)
+
+ # Check for required enums, including aliases
+ # LATER - Check for, report, and remove duplicates?
+ enumAliases = []
+ for elem in enums:
+ name = elem.get('name')
+
+ required = False
+
+ extname = elem.get('extname')
+ version = elem.get('version')
+ if extname is not None:
+ # 'supported' attribute was injected when the <enum> element was
+ # moved into the <enums> group in Registry.parseTree()
+ supported_list = elem.get('supported').split(",")
+ if self.genOpts.defaultExtensions in supported_list:
+ required = True
+ elif re.match(self.genOpts.addExtensions, extname) is not None:
+ required = True
+ elif version is not None:
+ required = re.match(self.genOpts.emitversions, version) is not None
+ else:
+ required = True
+
+ self.gen.logMsg('diag', '* required =', required, 'for', name)
+ if required:
+ # Mark this element as required (in the element, not the EnumInfo)
+ elem.set('required', 'true')
+ # If it is an alias, track that for later use
+ enumAlias = elem.get('alias')
+ if enumAlias:
+ enumAliases.append(enumAlias)
+ for elem in enums:
+ name = elem.get('name')
+ if name in enumAliases:
+ elem.set('required', 'true')
+ self.gen.logMsg('diag', '* also need to require alias', name)
+ if f is None:
+ raise RuntimeError("Should not get here")
+ if f.elem.get('category') == 'bitmask':
+ followupFeature = f.elem.get('bitvalues')
+ elif ftype == 'command':
+ # Generate command dependencies in 'alias' attribute
+ if alias:
+ self.generateFeature(alias, 'command', self.cmddict)
+
+ genProc = self.gen.genCmd
+ for type_elem in f.elem.findall('.//type'):
+ depname = type_elem.text
+ self.gen.logMsg('diag', 'Generating required parameter type',
+ depname)
+ self.generateFeature(depname, 'type', self.typedict)
+ elif ftype == 'enum':
+ # Generate enum dependencies in 'alias' attribute
+ if alias:
+ self.generateFeature(alias, 'enum', self.enumdict)
+ genProc = self.gen.genEnum
+
+ # Actually generate the type only if emitting declarations
+ if self.emitFeatures:
+ self.gen.logMsg('diag', 'Emitting', ftype, 'decl for', fname)
+ if genProc is None:
+ raise RuntimeError("genProc is None when we should be emitting")
+ genProc(f, fname, alias)
+ else:
+ self.gen.logMsg('diag', 'Skipping', ftype, fname,
+ '(should not be emitted)')
+
+ if followupFeature:
+ self.gen.logMsg('diag', 'Generating required bitvalues <enum>',
+ followupFeature)
+ self.generateFeature(followupFeature, "type", self.typedict)
+
+ def generateRequiredInterface(self, interface):
+ """Generate all interfaces required by an API version or extension.
+
+ - interface - Element for `<version>` or `<extension>`"""
+
+ # Loop over all features inside all <require> tags.
+ for features in interface.findall('require'):
+ for t in features.findall('type'):
+ self.generateFeature(t.get('name'), 'type', self.typedict, explicit=True)
+ for e in features.findall('enum'):
+ # If this is an enum extending an enumerated type, do not
+ # generate it - this has already been done in reg.parseTree,
+ # by copying this element into the enumerated type.
+ enumextends = e.get('extends')
+ if not enumextends:
+ self.generateFeature(e.get('name'), 'enum', self.enumdict, explicit=True)
+ for c in features.findall('command'):
+ self.generateFeature(c.get('name'), 'command', self.cmddict, explicit=True)
+
+ def generateSpirv(self, spirv, dictionary):
+ if spirv is None:
+ self.gen.logMsg('diag', 'No entry found for element', name,
+ 'returning!')
+ return
+
+ name = spirv.elem.get('name')
+ # No known alias for spirv elements
+ alias = None
+ if spirv.emit:
+ genProc = self.gen.genSpirv
+ genProc(spirv, name, alias)
+
+ def stripUnsupportedAPIs(self, dictionary, attribute, supportedDictionary):
+ """Strip unsupported APIs from attributes of APIs.
+ dictionary - *Info dictionary of APIs to be updated
+ attribute - attribute name to look for in each API
+ supportedDictionary - dictionary in which to look for supported
+ API elements in the attribute"""
+
+ for key in dictionary:
+ eleminfo = dictionary[key]
+ attribstring = eleminfo.elem.get(attribute)
+ if attribstring is not None:
+ apis = []
+ stripped = False
+ for api in attribstring.split(','):
+ ##print('Checking API {} referenced by {}'.format(api, key))
+ if api in supportedDictionary and supportedDictionary[api].required:
+ apis.append(api)
+ else:
+ stripped = True
+ ##print('\t**STRIPPING API {} from {}'.format(api, key))
+
+ # Update the attribute after stripping stuff.
+ # Could sort apis before joining, but it is not a clear win
+ if stripped:
+ eleminfo.elem.set(attribute, ','.join(apis))
+
+ def stripUnsupportedAPIsFromList(self, dictionary, supportedDictionary):
+ """Strip unsupported APIs from attributes of APIs.
+ dictionary - dictionary of list of structure name strings
+ supportedDictionary - dictionary in which to look for supported
+ API elements in the attribute"""
+
+ for key in dictionary:
+ attribstring = dictionary[key]
+ if attribstring is not None:
+ apis = []
+ stripped = False
+ for api in attribstring:
+ ##print('Checking API {} referenced by {}'.format(api, key))
+ if supportedDictionary[api].required:
+ apis.append(api)
+ else:
+ stripped = True
+ ##print('\t**STRIPPING API {} from {}'.format(api, key))
+
+ # Update the attribute after stripping stuff.
+ # Could sort apis before joining, but it is not a clear win
+ if stripped:
+ dictionary[key] = apis
+
+ def generateFormat(self, format, dictionary):
+ if format is None:
+ self.gen.logMsg('diag', 'No entry found for format element',
+ 'returning!')
+ return
+
+ name = format.elem.get('name')
+ # No known alias for VkFormat elements
+ alias = None
+ if format.emit:
+ genProc = self.gen.genFormat
+ genProc(format, name, alias)
+
+ def generateSyncStage(self, sync):
+ genProc = self.gen.genSyncStage
+ genProc(sync)
+
+ def generateSyncAccess(self, sync):
+ genProc = self.gen.genSyncAccess
+ genProc(sync)
+
+ def generateSyncPipeline(self, sync):
+ genProc = self.gen.genSyncPipeline
+ genProc(sync)
+
+ def tagValidExtensionStructs(self):
+ """Construct a "validextensionstructs" list for parent structures
+ based on "structextends" tags in child structures.
+ Only do this for structures tagged as required."""
+
+ for typeinfo in self.typedict.values():
+ type_elem = typeinfo.elem
+ if typeinfo.required and type_elem.get('category') == 'struct':
+ struct_extends = type_elem.get('structextends')
+ if struct_extends is not None:
+ for parent in struct_extends.split(','):
+ # self.gen.logMsg('diag', type_elem.get('name'), 'extends', parent)
+ self.validextensionstructs[parent].append(type_elem.get('name'))
+
+ # Sort the lists so they do not depend on the XML order
+ for parent in self.validextensionstructs:
+ self.validextensionstructs[parent].sort()
+
+ def apiGen(self):
+ """Generate interface for specified versions using the current
+ generator and generator options"""
+
+ self.gen.logMsg('diag', '*******************************************')
+ self.gen.logMsg('diag', ' Registry.apiGen file:', self.genOpts.filename,
+ 'api:', self.genOpts.apiname,
+ 'profile:', self.genOpts.profile)
+ self.gen.logMsg('diag', '*******************************************')
+
+ # Could reset required/declared flags for all features here.
+ # This has been removed as never used. The initial motivation was
+ # the idea of calling apiGen() repeatedly for different targets, but
+ # this has never been done. The 20% or so build-time speedup that
+ # might result is not worth the effort to make it actually work.
+ #
+ # self.apiReset()
+
+ # Compile regexps used to select versions & extensions
+ regVersions = re.compile(self.genOpts.versions)
+ regEmitVersions = re.compile(self.genOpts.emitversions)
+ regAddExtensions = re.compile(self.genOpts.addExtensions)
+ regRemoveExtensions = re.compile(self.genOpts.removeExtensions)
+ regEmitExtensions = re.compile(self.genOpts.emitExtensions)
+ regEmitSpirv = re.compile(self.genOpts.emitSpirv)
+ regEmitFormats = re.compile(self.genOpts.emitFormats)
+
+ # Get all matching API feature names & add to list of FeatureInfo
+ # Note we used to select on feature version attributes, not names.
+ features = []
+ apiMatch = False
+ for key in self.apidict:
+ fi = self.apidict[key]
+ api = fi.elem.get('api')
+ if apiNameMatch(self.genOpts.apiname, api):
+ apiMatch = True
+ if regVersions.match(fi.name):
+ # Matches API & version #s being generated. Mark for
+ # emission and add to the features[] list .
+ # @@ Could use 'declared' instead of 'emit'?
+ fi.emit = (regEmitVersions.match(fi.name) is not None)
+ features.append(fi)
+ if not fi.emit:
+ self.gen.logMsg('diag', 'NOT tagging feature api =', api,
+ 'name =', fi.name, 'version =', fi.version,
+ 'for emission (does not match emitversions pattern)')
+ else:
+ self.gen.logMsg('diag', 'Including feature api =', api,
+ 'name =', fi.name, 'version =', fi.version,
+ 'for emission (matches emitversions pattern)')
+ else:
+ self.gen.logMsg('diag', 'NOT including feature api =', api,
+ 'name =', fi.name, 'version =', fi.version,
+ '(does not match requested versions)')
+ else:
+ self.gen.logMsg('diag', 'NOT including feature api =', api,
+ 'name =', fi.name,
+ '(does not match requested API)')
+ if not apiMatch:
+ self.gen.logMsg('warn', 'No matching API versions found!')
+
+ # Get all matching extensions, in order by their extension number,
+ # and add to the list of features.
+ # Start with extensions whose 'supported' attributes match the API
+ # being generated. Add extensions matching the pattern specified in
+ # regExtensions, then remove extensions matching the pattern
+ # specified in regRemoveExtensions
+ for (extName, ei) in sorted(self.extdict.items(), key=lambda x: x[1].number if x[1].number is not None else '0'):
+ extName = ei.name
+ include = False
+
+ # Include extension if defaultExtensions is not None and is
+ # exactly matched by the 'supported' attribute.
+ if apiNameMatch(self.genOpts.defaultExtensions,
+ ei.elem.get('supported')):
+ self.gen.logMsg('diag', 'Including extension',
+ extName, "(defaultExtensions matches the 'supported' attribute)")
+ include = True
+
+ # Include additional extensions if the extension name matches
+ # the regexp specified in the generator options. This allows
+ # forcing extensions into an interface even if they are not
+ # tagged appropriately in the registry.
+ # However, we still respect the 'supported' attribute.
+ if regAddExtensions.match(extName) is not None:
+ if not apiNameMatch(self.genOpts.apiname, ei.elem.get('supported')):
+ self.gen.logMsg('diag', 'NOT including extension',
+ extName, '(matches explicitly requested, but does not match the \'supported\' attribute)')
+ include = False
+ else:
+ self.gen.logMsg('diag', 'Including extension',
+ extName, '(matches explicitly requested extensions to add)')
+ include = True
+ # Remove extensions if the name matches the regexp specified
+ # in generator options. This allows forcing removal of
+ # extensions from an interface even if they are tagged that
+ # way in the registry.
+ if regRemoveExtensions.match(extName) is not None:
+ self.gen.logMsg('diag', 'Removing extension',
+ extName, '(matches explicitly requested extensions to remove)')
+ include = False
+
+ # If the extension is to be included, add it to the
+ # extension features list.
+ if include:
+ ei.emit = (regEmitExtensions.match(extName) is not None)
+ features.append(ei)
+ if not ei.emit:
+ self.gen.logMsg('diag', 'NOT tagging extension',
+ extName,
+ 'for emission (does not match emitextensions pattern)')
+
+ # Hack - can be removed when validity generator goes away
+ # (Jon) I am not sure what this does, or if it should
+ # respect the ei.emit flag above.
+ self.requiredextensions.append(extName)
+ else:
+ self.gen.logMsg('diag', 'NOT including extension',
+ extName, '(does not match api attribute or explicitly requested extensions)')
+
+ # Add all spirv elements to list
+ # generators decide to emit them all or not
+ # Currently no filtering as no client of these elements needs filtering
+ spirvexts = []
+ for key in self.spirvextdict:
+ si = self.spirvextdict[key]
+ si.emit = (regEmitSpirv.match(key) is not None)
+ spirvexts.append(si)
+ spirvcaps = []
+ for key in self.spirvcapdict:
+ si = self.spirvcapdict[key]
+ si.emit = (regEmitSpirv.match(key) is not None)
+ spirvcaps.append(si)
+
+ formats = []
+ for key in self.formatsdict:
+ si = self.formatsdict[key]
+ si.emit = (regEmitFormats.match(key) is not None)
+ formats.append(si)
+
+ # Sort the features list, if a sort procedure is defined
+ if self.genOpts.sortProcedure:
+ self.genOpts.sortProcedure(features)
+
+ # Passes 1+2: loop over requested API versions and extensions tagging
+ # types/commands/features as required (in an <require> block) or no
+ # longer required (in an <remove> block). <remove>s are processed
+ # after all <require>s, so removals win.
+ # If a profile other than 'None' is being generated, it must
+ # match the profile attribute (if any) of the <require> and
+ # <remove> tags.
+ self.gen.logMsg('diag', 'PASS 1: TAG FEATURES')
+ for f in features:
+ self.gen.logMsg('diag', 'PASS 1: Tagging required and features for', f.name)
+ self.fillFeatureDictionary(f.elem, f.name, self.genOpts.apiname, self.genOpts.profile)
+ self.requireFeatures(f.elem, f.name, self.genOpts.apiname, self.genOpts.profile)
+ self.assignAdditionalValidity(f.elem, self.genOpts.apiname, self.genOpts.profile)
+
+ for f in features:
+ self.gen.logMsg('diag', 'PASS 2: Tagging removed features for', f.name)
+ self.removeFeatures(f.elem, f.name, self.genOpts.apiname, self.genOpts.profile)
+ self.removeAdditionalValidity(f.elem, self.genOpts.apiname, self.genOpts.profile)
+
+ # Now, strip references to APIs that are not required.
+ # At present such references may occur in:
+ # Structs in <type category="struct"> 'structextends' attributes
+ # Enums in <command> 'successcodes' and 'errorcodes' attributes
+ self.stripUnsupportedAPIs(self.typedict, 'structextends', self.typedict)
+ self.stripUnsupportedAPIs(self.cmddict, 'successcodes', self.enumdict)
+ self.stripUnsupportedAPIs(self.cmddict, 'errorcodes', self.enumdict)
+ self.stripUnsupportedAPIsFromList(self.validextensionstructs, self.typedict)
+
+ # Construct lists of valid extension structures
+ self.tagValidExtensionStructs()
+
+ # @@May need to strip <spirvcapability> / <spirvextension> <enable>
+ # tags of these forms:
+ # <enable version="VK_API_VERSION_1_0"/>
+ # <enable struct="VkPhysicalDeviceFeatures" feature="geometryShader" requires="VK_VERSION_1_0"/>
+ # <enable extension="VK_KHR_shader_draw_parameters"/>
+ # <enable property="VkPhysicalDeviceVulkan12Properties" member="shaderDenormPreserveFloat16" value="VK_TRUE" requires="VK_VERSION_1_2,VK_KHR_shader_float_controls"/>
+
+ # Pass 3: loop over specified API versions and extensions printing
+ # declarations for required things which have not already been
+ # generated.
+ self.gen.logMsg('diag', 'PASS 3: GENERATE INTERFACES FOR FEATURES')
+ self.gen.beginFile(self.genOpts)
+ for f in features:
+ self.gen.logMsg('diag', 'PASS 3: Generating interface for',
+ f.name)
+ emit = self.emitFeatures = f.emit
+ if not emit:
+ self.gen.logMsg('diag', 'PASS 3: NOT declaring feature',
+ f.elem.get('name'), 'because it is not tagged for emission')
+ # Generate the interface (or just tag its elements as having been
+ # emitted, if they have not been).
+ self.gen.beginFeature(f.elem, emit)
+ self.generateRequiredInterface(f.elem)
+ self.gen.endFeature()
+ # Generate spirv elements
+ for s in spirvexts:
+ self.generateSpirv(s, self.spirvextdict)
+ for s in spirvcaps:
+ self.generateSpirv(s, self.spirvcapdict)
+ for s in formats:
+ self.generateFormat(s, self.formatsdict)
+ for s in self.syncstagedict:
+ self.generateSyncStage(self.syncstagedict[s])
+ for s in self.syncaccessdict:
+ self.generateSyncAccess(self.syncaccessdict[s])
+ for s in self.syncpipelinedict:
+ self.generateSyncPipeline(self.syncpipelinedict[s])
+ self.gen.endFile()
+
+ def apiReset(self):
+ """Reset type/enum/command dictionaries before generating another API.
+
+ Use between apiGen() calls to reset internal state."""
+ for datatype in self.typedict:
+ self.typedict[datatype].resetState()
+ for enum in self.enumdict:
+ self.enumdict[enum].resetState()
+ for cmd in self.cmddict:
+ self.cmddict[cmd].resetState()
+ for cmd in self.apidict:
+ self.apidict[cmd].resetState()
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/rubygenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/rubygenerator.py
new file mode 100644
index 00000000000..283f09f7ada
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/rubygenerator.py
@@ -0,0 +1,120 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from generator import OutputGenerator, enquote, write
+from scriptgenerator import ScriptOutputGenerator
+
+def nilquote(s):
+ if s:
+ return enquote(s)
+ else:
+ return 'nil'
+
+def makeHash(name):
+ return '@{} = {{'.format(name)
+
+class RubyOutputGenerator(ScriptOutputGenerator):
+ """RubyOutputGenerator - subclass of ScriptOutputGenerator.
+ Generates Ruby data structures describing API names and
+ relationships."""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ def beginDict(self, name):
+ """String starting definition of a named dictionary"""
+ return f'@{name} = {{'
+
+ def endDict(self):
+ """ String ending definition of a named dictionary"""
+ return '}'
+
+ def writeDict(self, dict, name, printValues = True):
+ """Write dictionary as a Ruby hash with the given name.
+ If printValues is False, just output keys with nil values."""
+
+ write(self.beginDict(name), file=self.outFile)
+ for key in sorted(dict):
+ if printValues:
+ value = nilquote(dict[key])
+ else:
+ value = 'nil'
+ write(f'{enquote(key)} => {value},', file=self.outFile)
+ write(self.endDict(), file=self.outFile)
+
+ def writeList(self, l, name):
+ """Write list l as a Ruby hash with the given name"""
+
+ self.writeDict(l, name, printValues = False)
+
+ def makeAccessor(self, name):
+ """Create an accessor method for the hash 'name'"""
+ write('def {}'.format(name), file=self.outFile)
+ write(' @{}'.format(name), file=self.outFile)
+ write('end', file=self.outFile)
+
+ def endFile(self):
+ # Creates the inverse mapping of nonexistent APIs to their aliases.
+ super().createInverseMap()
+
+ # Print out all the dictionaries as Ruby strings.
+ # Use a simple container class for namespace control
+ write('class APInames\n', ' def initialize', file=self.outFile)
+
+ dicts = ( [ self.basetypes, 'basetypes' ],
+ [ self.consts, 'consts' ],
+ [ self.enums, 'enums' ],
+ [ self.flags, 'flags' ],
+ [ self.funcpointers, 'funcpointers' ],
+ [ self.protos, 'protos' ],
+ [ self.structs, 'structs' ],
+ [ self.handles, 'handles' ],
+ [ self.defines, 'defines' ],
+ [ self.typeCategory, 'typeCategory' ],
+ [ self.alias, 'aliases' ],
+ [ self.nonexistent, 'nonexistent' ],
+ )
+ for (dict, name) in dicts:
+ self.writeDict(dict, name)
+
+ # Dictionary containing the relationships of a type
+ # (e.g. a dictionary with each related type as keys).
+ write(self.beginDict('mapDict'), file=self.outFile)
+ for baseType in sorted(self.mapDict):
+ # Not actually including the relationships yet
+ write('{} => {},'.format(enquote(baseType), 'nil'),
+ file=self.outFile)
+ write(self.endDict(), file=self.outFile)
+
+ # List of included feature names
+ self.writeList(sorted(self.features), 'features')
+
+ # Generate feature <-> interface mappings
+ for feature in self.features:
+ self.mapInterfaces(feature)
+
+ # Write out the reverse map from APIs to requiring features
+ write(self.beginDict('requiredBy'), file=self.outFile)
+ for api in sorted(self.apimap):
+ # Sort requirements by first feature in each one
+ deps = sorted(self.apimap[api], key = lambda dep: dep[0])
+ reqs = ', '.join('[{}, {}]'.format(nilquote(dep[0]), nilquote(dep[1])) for dep in deps)
+ write('{} => [{}],'.format(enquote(api), reqs), file=self.outFile)
+ write(self.endDict(), file=self.outFile)
+
+ # Remainder of the class definition
+ # End initialize method
+ write('end', file=self.outFile)
+
+ # Accessor methods
+ for (_, name) in dicts:
+ self.makeAccessor(name)
+ self.makeAccessor('features')
+
+ # Class end
+ write('end', file=self.outFile)
+
+ super().endFile()
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/runDocker b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/runDocker
new file mode 100755
index 00000000000..235e20e361f
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/runDocker
@@ -0,0 +1,31 @@
+#!/bin/bash
+# Copyright 2022-2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# runDocker - run the Khronos `asciidoctor-spec` Docker image with a local
+# clone of the Vulkan specification repository. This must be invoked from
+# the repository root directory.
+# The following command-line tools are required to run this script:
+# awk dirname docker grep id realpath
+# These are all normal Linux developer tools except for 'docker' itself.
+
+# Determine path to repository root directory
+scriptpath=`dirname $0`
+repopath=`realpath $scriptpath/..`
+
+# Get SHA256 of the asciidoctor-spec image build used by CI.
+image=`grep -m 1 khronosgroup/docker-images@sha256: $repopath/.gitlab-ci.yml | \
+ awk '{print $2}'`
+
+uid=`id -u`
+gid=`id -g`
+echo "Executing Docker with spec build image and mounted spec repository root:"
+
+# --user causes Docker to run as the specified UID:GID instead of as root
+# -it runs interactively and uses a pseudotty
+# --rm removes the container on exit
+# -v mounts the repository clone as /vulkan in the container
+# $image is image to run
+# /bin/bash drops into a shell in the container
+set -x
+docker run --network=host --user ${uid}:${gid} -it --rm -v ${repopath}:/vulkan $image /bin/bash
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/schema_generator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/schema_generator.py
new file mode 100644
index 00000000000..555f7fe2ec7
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/schema_generator.py
@@ -0,0 +1,294 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2020-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Description:
+# -----------
+# This script generates a full schema definition from the vk.xml.
+
+import os
+import re
+from generator import (GeneratorOptions, OutputGenerator, noneStr,
+ regSortFeatures, write)
+
+
+headerString = "\
+{\n\
+\"$schema\": \"http://json-schema.org/draft-04/schema#\", \n\
+\"id\": \"https://schema.khronos.org/vulkan/vk.json#\",\n\
+\"title\": \"JSON schema for Vulkan SC\",\n\
+\"description\": \"Schema for representing entire vk.xml as a schema.\",\n\
+\"type\": \"object\",\n\
+\"additionalProperties\": true,\n\
+\"definitions\": {\
+"
+
+basetypeString = "\
+ \"$schema\": {\"type\": \"string\", \"format\": \"uri\"},\n\
+ \"uint8_t\": {\"type\": \"integer\", \"minimum\": 0, \"maximum\": 255},\n\
+ \"int32_t\": {\"type\": \"integer\", \"minimum\": -2147483648, \"maximum\": 2147483647},\n\
+ \"uint32_t\": {\"type\": \"integer\", \"minimum\": 0, \"maximum\": 4294967295},\n\
+ \"uint64_t\": {\"oneOf\": [{\"enum\": [\"\"]},{\"type\": \"integer\"}]},\n\
+ \"char\": {\"type\": \"string\"},\n\
+ \"float\": {\"type\": \"number\"},\n\
+ \"size_t\": {\"$ref\": \"#/definitions/uint32_t\"},\n\
+ \"enum\": {\"type\": \"string\"},\n\
+ \"void\": {\"enum\": [\"NULL\", \"\"]},\
+"
+
+class SchemaGeneratorOptions(GeneratorOptions):
+ """SchemaGeneratorOptions - subclass of GeneratorOptions.
+
+ Adds options used by SchemaOutputGenerator objects during C language header
+ generation."""
+
+ def __init__(self,
+ prefixText="",
+ genFuncPointers=True,
+ protectFile=True,
+ protectFeature=True,
+ protectProto=None,
+ protectProtoStr=None,
+ apicall='',
+ apientry='',
+ apientryp='',
+ indentFuncProto=True,
+ indentFuncPointer=False,
+ alignFuncParam=0,
+ genEnumBeginEndRange=False,
+ genAliasMacro=False,
+ aliasMacro='',
+ **kwargs
+ ):
+
+ GeneratorOptions.__init__(self, **kwargs)
+
+ self.prefixText = prefixText
+ """list of strings to prefix generated header with (usually a copyright statement + calling convention macros)."""
+
+ self.genFuncPointers = genFuncPointers
+ """True if function pointer typedefs should be generated"""
+
+ self.protectFile = protectFile
+ """True if multiple inclusion protection should be generated (based on the filename) around the entire header."""
+
+ self.protectFeature = protectFeature
+ """True if #ifndef..#endif protection should be generated around a feature interface in the header file."""
+
+ self.protectProto = protectProto
+ """If conditional protection should be generated around prototype declarations, set to either '#ifdef' to require opt-in (#ifdef protectProtoStr) or '#ifndef' to require opt-out (#ifndef protectProtoStr). Otherwise set to None."""
+
+ self.protectProtoStr = protectProtoStr
+ """#ifdef/#ifndef symbol to use around prototype declarations, if protectProto is set"""
+
+ self.apicall = apicall
+ """string to use for the function declaration prefix, such as APICALL on Windows."""
+
+ self.apientry = apientry
+ """string to use for the calling convention macro, in typedefs, such as APIENTRY."""
+
+ self.apientryp = apientryp
+ """string to use for the calling convention macro in function pointer typedefs, such as APIENTRYP."""
+
+ self.indentFuncProto = indentFuncProto
+ """True if prototype declarations should put each parameter on a separate line"""
+
+ self.indentFuncPointer = indentFuncPointer
+ """True if typedefed function pointers should put each parameter on a separate line"""
+
+ self.alignFuncParam = alignFuncParam
+ """if nonzero and parameters are being put on a separate line, align parameter names at the specified column"""
+
+ self.genEnumBeginEndRange = genEnumBeginEndRange
+ """True if BEGIN_RANGE / END_RANGE macros should be generated for enumerated types"""
+
+ self.genAliasMacro = genAliasMacro
+ """True if the OpenXR alias macro should be generated for aliased types (unclear what other circumstances this is useful)"""
+
+ self.aliasMacro = aliasMacro
+ """alias macro to inject when genAliasMacro is True"""
+
+ self.codeGenerator = True
+ """True if this generator makes compilable code"""
+
+
+class SchemaOutputGenerator(OutputGenerator):
+ # This is an ordered list of sections in the header file.
+ TYPE_SECTIONS = ['basetype', 'handle', 'enum', 'group', 'bitmask', 'struct']
+ ALL_SECTIONS = TYPE_SECTIONS
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Internal state - accumulators for different inner block text
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+ self.may_alias = None
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ # Write schema header
+ write(headerString, file=self.outFile)
+ write(basetypeString, file=self.outFile)
+
+ def endFile(self):
+ write(" \"VkLastStructure\": {", file=self.outFile)
+ write(" }", file=self.outFile)
+ write(" }", file=self.outFile)
+ write("}", file=self.outFile)
+
+ # Finish processing in superclass
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ OutputGenerator.beginFeature(self, interface, emit)
+ self.sections = {section: [] for section in self.ALL_SECTIONS}
+ self.feature_not_empty = False
+
+ def endFeature(self):
+ if self.emit:
+ if self.feature_not_empty:
+ if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
+
+ for section in self.TYPE_SECTIONS:
+ contents = self.sections[section]
+ if contents:
+ write('\n'.join(contents), file=self.outFile)
+
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def appendSection(self, section, text):
+ self.sections[section].append(text)
+ self.feature_not_empty = True
+
+ def genType(self, typeinfo, name, alias):
+ OutputGenerator.genType(self, typeinfo, name, alias)
+ typeElem = typeinfo.elem
+ body = ""
+
+ category = typeElem.get('category')
+ if category == 'funcpointer':
+ section = 'struct'
+ else:
+ section = category
+
+ if category in ('struct', 'union'):
+ self.genStruct(typeinfo, name, alias)
+
+ elif category == 'handle':
+ for elem in typeElem:
+ if elem.tag == 'name':
+ body += " \"" + elem.text + "\": {\"$ref\": \"#/definitions/uint64_t" + "\"},"
+
+ elif category in ('bitmask','basetype'):
+ storeType = ""
+ section = 'bitmask'
+
+ for elem in typeElem:
+ if elem.tag == 'type':
+ storeType = elem.text
+
+ if elem.tag == 'name':
+ if elem.text == "VkBool32":
+ body += " \"" + elem.text + "\": {\"oneOf\": [{\"$ref\": \"#/definitions/" + storeType + "\"},{\"enum\": [\"VK_TRUE\", \"VK_FALSE\"]}]},"
+ elif elem.text == "VkFlags":
+ body += " \"" + elem.text + "\": {\"oneOf\": [{\"$ref\": \"#/definitions/" + storeType + "\"},{\"$ref\": \"#/definitions/enum\"}]},"
+ else:
+ body += " \"" + elem.text + "\": {\"$ref\": \"#/definitions/" + storeType + "\"},"
+
+ if body:
+ self.appendSection(section, body)
+
+ def genMemberSchema(self, structure, param):
+ paramdecl = ""
+ storeType = ""
+ isArr = param.get('len') not in (None, "null-terminated")
+ isPtr = False
+
+ for elem in param:
+ text = noneStr(elem.text)
+ tail = noneStr(elem.tail)
+
+ #TODO: In the actual json data, we inline the pNext structs by checking what they point to, at runtime.
+ # This is however not possible to be represented in the schema. So, the plan is to not represent the
+ # pNext structs altogether or to indicate that these would be represented at runtime.
+ #if elem.text != 'pNext' and elem.text != 'sType' and elem.text != 'VkStructureType' and elem.text != 'void' and elem.text != 'const':
+ if 1:
+ if elem.tag == 'type':
+ storeType = text
+ if '*' in tail:
+ isPtr = True
+
+ if elem.tag == 'name':
+ paramdecl += " \"" + text + "\": "
+ if isPtr and text != "pNext":
+ paramdecl += "{\"oneOf\": [{\"$ref\": \"#/definitions/void\"},"
+
+ if isArr or tail.startswith('['):
+ # TODO: How to get maxCount here?
+ paramdecl += " {\"type\": \"array\", \"minItems\": 0, \"maxItems\": 255, \"items\": {\"$ref\": \"#/definitions/"
+ if (structure == "VkPipelineLayoutCreateInfo" and text == "pSetLayouts") or \
+ (structure == "VkDescriptorSetLayoutBinding" and text == "pImmutableSamplers") or \
+ (structure == "VkSamplerYcbcrConversionInfo" and text == "conversion"):
+ paramdecl += "char\"}}"
+ elif (storeType == "void"):
+ # void* data can be NULL, an array of uint8_t data, or a Base64-encoded string
+ paramdecl += "uint8_t\"}}, {\"type\": \"string\"}"
+ else:
+ paramdecl += storeType + "\"}}"
+ else:
+ paramdecl += "{\"$ref\": \"#/definitions/"
+ paramdecl += storeType + "\"}"
+
+ if isPtr and text != "pNext":
+ paramdecl += "]}"
+ isPtr = False
+ else:
+ return ""
+
+ return paramdecl
+
+ def genStruct(self, typeinfo, typeName, alias):
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+ body = ""
+ typeElem = typeinfo.elem
+
+ if alias:
+ return
+ else:
+ body = ''
+ body += " \"" + typeName + "\": {\n"
+ body += " \"type\": \"object\",\n"
+ body += " \"additionalProperties\": false,\n"
+ body += " \"properties\": {\n"
+
+ count = 0
+ numMembers = len(typeElem.findall('.//member'))
+
+ for member in typeElem.findall('.//member'):
+ count = count + 1
+
+ genText = self.genMemberSchema(typeName, member)
+ body += genText
+
+ if count < numMembers and genText != "":
+ body += ','
+ body += '\n'
+ body += "\n }\n"
+ body += " },\n"
+
+ self.appendSection('struct', body)
+
+ def genGroup(self, groupinfo, groupName, alias=None):
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+ groupElem = groupinfo.elem
+ body = ""
+
+ section = 'enum'
+ body += " \"" + groupName + "\": {\"$ref\": \"#/definitions/enum"+ "\"},"
+
+ self.appendSection(section, body)
+
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/scriptgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/scriptgenerator.py
new file mode 100644
index 00000000000..18ce9de40de
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/scriptgenerator.py
@@ -0,0 +1,386 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from generator import OutputGenerator, enquote, noneStr
+
+def mostOfficial(api, newapi):
+ """Return the 'most official' of two related names, api and newapi.
+ KHR is more official than EXT is more official than everything else.
+ If there is ambiguity, return api."""
+
+ if api[-3:] == 'KHR':
+ return api
+ if newapi[-3:] == 'KHR':
+ return newapi;
+ if api[-3:] == 'EXT':
+ return api
+ if newapi[-3:] == 'EXT':
+ return newapi;
+ return api
+
+class ScriptOutputGenerator(OutputGenerator):
+ """ScriptOutputGenerator - subclass of OutputGenerator.
+ Base class to Generate script (Python/Ruby/JS/etc.) data structures
+ describing API names and relationships.
+ Similar to DocOutputGenerator, but writes a single file."""
+
+ def apiName(self, name):
+ """Return True if name is in the reserved API namespace.
+
+ Delegates to the conventions object. """
+ return self.genOpts.conventions.is_api_name(name)
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ # Track features being generated
+ self.features = []
+
+ # Reverse map from interface names to features requiring them
+ self.apimap = {}
+
+ # Reverse map from unsupported APIs in this build to aliases which
+ # are supported
+ self.nonexistent = {}
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+ #
+ # Dictionaries are keyed by the name of the entity (e.g.
+ # self.structs is keyed by structure names). Values are
+ # the names of related entities (e.g. structs contain
+ # a list of type names of members, enums contain a list
+ # of enumerants belong to the enumerated type, etc.), or
+ # just None if there are no directly related entities.
+ #
+ # Collect the mappings, then emit the Python script in endFile
+ self.basetypes = {}
+ self.consts = {}
+ self.enums = {}
+ self.flags = {}
+ self.funcpointers = {}
+ self.protos = {}
+ self.structs = {}
+ self.handles = {}
+ self.defines = {}
+ self.alias = {}
+ # Dictionary containing the type of a type name
+ # (e.g. the string name of the dictionary with its contents).
+ self.typeCategory = {}
+ self.mapDict = {}
+
+ def addInterfaceMapping(self, api, feature, required):
+ """Add a reverse mapping in self.apimap from an API to a feature
+ requiring that API.
+
+ - api - name of the API
+ - feature - name of the feature requiring it
+ - required - None, or an additional feature dependency within
+ 'feature'. The additional dependency is a boolean expression of
+ one or more extension and/or core version names, which is passed
+ through to the output script intact."""
+
+ # Each entry in self.apimap contains one or more
+ # ( feature, required ) tuples.
+ deps = ( feature, required )
+
+ if api in self.apimap:
+ self.apimap[api].append(deps)
+ else:
+ self.apimap[api] = [ deps ]
+
+ def mapInterfaceKeys(self, feature, key):
+ """Construct reverse mapping of APIs to features requiring them in
+ self.apimap.
+
+ - feature - name of the feature being generated
+ - key - API category - 'define', 'basetype', etc."""
+
+ dict = self.featureDictionary[feature][key]
+
+ if dict:
+ # Not clear why handling of command vs. type APIs is different -
+ # see interfacedocgenerator.py, which this was based on.
+ if key == 'command':
+ for required in dict:
+ for api in dict[required]:
+ self.addInterfaceMapping(api, feature, required)
+ else:
+ for required in dict:
+ for parent in dict[required]:
+ for api in dict[required][parent]:
+ self.addInterfaceMapping(api, feature, required)
+
+ def mapInterfaces(self, feature):
+ """Construct reverse mapping of APIs to features requiring them in
+ self.apimap.
+
+ - feature - name of the feature being generated"""
+
+ # Map each category of interface
+ self.mapInterfaceKeys(feature, 'basetype')
+ self.mapInterfaceKeys(feature, 'bitmask')
+ self.mapInterfaceKeys(feature, 'command')
+ self.mapInterfaceKeys(feature, 'define')
+ self.mapInterfaceKeys(feature, 'enum')
+ self.mapInterfaceKeys(feature, 'enumconstant')
+ self.mapInterfaceKeys(feature, 'funcpointer')
+ self.mapInterfaceKeys(feature, 'handle')
+ self.mapInterfaceKeys(feature, 'include')
+ self.mapInterfaceKeys(feature, 'struct')
+ self.mapInterfaceKeys(feature, 'union')
+
+ def endFile(self):
+ super().endFile()
+
+ def beginFeature(self, interface, emit):
+ # Start processing in superclass
+ OutputGenerator.beginFeature(self, interface, emit)
+
+ # Add this feature to the list being tracked
+ self.features.append( self.featureName )
+
+ def endFeature(self):
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ def addName(self, dict, name, value):
+ """Add a string entry to the dictionary, quoting it so it gets
+ printed out correctly in self.endFile()."""
+ dict[name] = value
+
+ def addMapping(self, baseType, refType):
+ """Add a mapping between types to mapDict.
+
+ Only include API types, so we do not end up with a lot of useless
+ uint32_t and void types."""
+ if not self.apiName(baseType) or not self.apiName(refType):
+ self.logMsg('diag', 'ScriptOutputGenerator::addMapping: IGNORE map from', baseType, '<->', refType)
+ return
+
+ self.logMsg('diag', 'ScriptOutputGenerator::addMapping: map from',
+ baseType, '<->', refType)
+
+ if baseType not in self.mapDict:
+ baseDict = {}
+ self.mapDict[baseType] = baseDict
+ else:
+ baseDict = self.mapDict[baseType]
+ if refType not in self.mapDict:
+ refDict = {}
+ self.mapDict[refType] = refDict
+ else:
+ refDict = self.mapDict[refType]
+
+ baseDict[refType] = None
+ refDict[baseType] = None
+
+ def breakCheck(self, procname, name):
+ """Debugging aid - call from procname to break on API 'name' if it
+ matches logic in this call."""
+
+ pat = 'VkExternalFenceFeatureFlagBits'
+ if name[0:len(pat)] == pat:
+ print('{}(name = {}) matches {}'.format(procname, name, pat))
+ import pdb
+ pdb.set_trace()
+
+ def genType(self, typeinfo, name, alias):
+ """Generate type.
+
+ - For 'struct' or 'union' types, defer to genStruct() to
+ add to the dictionary.
+ - For 'bitmask' types, add the type name to the 'flags' dictionary,
+ with the value being the corresponding 'enums' name defining
+ the acceptable flag bits.
+ - For 'enum' types, add the type name to the 'enums' dictionary,
+ with the value being '@STOPHERE@' (because this case seems
+ never to happen).
+ - For 'funcpointer' types, add the type name to the 'funcpointers'
+ dictionary.
+ - For 'handle' and 'define' types, add the handle or #define name
+ to the 'struct' dictionary, because that is how the spec sources
+ tag these types even though they are not structs."""
+ OutputGenerator.genType(self, typeinfo, name, alias)
+
+ typeElem = typeinfo.elem
+ # If the type is a struct type, traverse the embedded <member> tags
+ # generating a structure. Otherwise, emit the tag text.
+ category = typeElem.get('category')
+
+ # Add a typeCategory{} entry for the category of this type.
+ self.addName(self.typeCategory, name, category)
+
+ if category in ('struct', 'union'):
+ self.genStruct(typeinfo, name, alias)
+ else:
+ if alias:
+ # Add name -> alias mapping
+ self.addName(self.alias, name, alias)
+
+ # Always emit an alias (?!)
+ count = 1
+
+ # May want to only emit full type definition when not an alias?
+ else:
+ # Extract the type name
+ # (from self.genOpts). Copy other text through unchanged.
+ # If the resulting text is an empty string, do not emit it.
+ count = len(noneStr(typeElem.text))
+ for elem in typeElem:
+ count += len(noneStr(elem.text)) + len(noneStr(elem.tail))
+
+ if count > 0:
+ if category == 'bitmask':
+ requiredEnum = typeElem.get('requires')
+ self.addName(self.flags, name, requiredEnum)
+
+ # This happens when the Flags type is defined, but no
+ # FlagBits are defined yet.
+ if requiredEnum is not None:
+ self.addMapping(name, requiredEnum)
+ elif category == 'enum':
+ # This case does not seem to come up. It nominally would
+ # result from
+ # <type name="Something" category="enum"/>,
+ # but the output generator does not emit them directly.
+ self.logMsg('warn', 'ScriptOutputGenerator::genType: invalid \'enum\' category for name:', name)
+ elif category == 'funcpointer':
+ self.funcpointers[name] = None
+ elif category == 'handle':
+ self.handles[name] = None
+ elif category == 'define':
+ self.defines[name] = None
+ elif category == 'basetype':
+ self.basetypes[name] = None
+ self.addName(self.typeCategory, name, 'basetype')
+ else:
+ self.logMsg('diag', 'ScriptOutputGenerator::genType: unprocessed type:', name)
+
+ def genStruct(self, typeinfo, typeName, alias):
+ """Generate struct (e.g. C "struct" type).
+
+ Add the struct name to the 'structs' dictionary, with the
+ value being an ordered list of the struct member names."""
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+
+ if alias:
+ # Add name -> alias mapping
+ self.addName(self.alias, typeName, alias)
+ else:
+ # May want to only emit definition on this branch
+ True
+
+ members = [member.text for member in typeinfo.elem.findall('.//member/name')]
+ self.structs[typeName] = members
+ memberTypes = [member.text for member in typeinfo.elem.findall('.//member/type')]
+ for member_type in memberTypes:
+ self.addMapping(typeName, member_type)
+
+ def genGroup(self, groupinfo, groupName, alias):
+ """Generate group (e.g. C "enum" type).
+
+ These are concatenated together with other types.
+
+ - Add the enum type name to the 'enums' dictionary, with
+ the value being an ordered list of the enumerant names.
+ - Add each enumerant name to the 'consts' dictionary, with
+ the value being the enum type the enumerant is part of."""
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+ groupElem = groupinfo.elem
+
+ # Add a typeCategory{} entry for the category of this type.
+ self.addName(self.typeCategory, groupName, 'group')
+
+ if alias:
+ # Add name -> alias mapping
+ self.addName(self.alias, groupName, alias)
+ else:
+ # May want to only emit definition on this branch
+ True
+
+ # Add each nested 'enum' tag
+ enumerants = [elem.get('name') for elem in groupElem.findall('enum')]
+ for name in enumerants:
+ self.addName(self.consts, name, groupName)
+
+ # Sort enums for output stability, since their order is irrelevant
+ self.enums[groupName] = sorted(enumerants)
+
+ def genEnum(self, enuminfo, name, alias):
+ """Generate enumerant (compile time constant).
+
+ - Add the constant name to the 'consts' dictionary, with the
+ value being None to indicate that the constant is not
+ an enumeration value."""
+ OutputGenerator.genEnum(self, enuminfo, name, alias)
+
+ if name not in self.consts:
+ # Add a typeCategory{} entry for the category of this type.
+ self.addName(self.typeCategory, name, 'consts')
+ self.consts[name] = None
+
+ if alias:
+ # Add name -> alias mapping
+ self.addName(self.alias, name, alias)
+ else:
+ # May want to only emit definition on this branch
+ True
+
+ # Otherwise, do not add it to the consts dictionary because it is
+ # already present. This happens due to the generator 'reparentEnums'
+ # parameter being False, so each extension enum appears in both the
+ # <enums> type and in the <extension> or <feature> it originally
+ # came from.
+
+ def genCmd(self, cmdinfo, name, alias):
+ """Generate command.
+
+ - Add the command name to the 'protos' dictionary, with the
+ value being an ordered list of the parameter names."""
+ OutputGenerator.genCmd(self, cmdinfo, name, alias)
+
+ # Add a typeCategory{} entry for the category of this type.
+ self.addName(self.typeCategory, name, 'protos')
+
+ if alias:
+ # Add name -> alias mapping
+ self.addName(self.alias, name, alias)
+ else:
+ # May want to only emit definition on this branch
+ True
+
+ params = [param.text for param in cmdinfo.elem.findall('param/name')]
+ self.protos[name] = params
+ paramTypes = [param.text for param in cmdinfo.elem.findall('param/type')]
+ for param_type in paramTypes:
+ self.addMapping(name, param_type)
+
+ def createInverseMap(self):
+ """This creates the inverse mapping of nonexistent APIs in this
+ build to their aliases which are supported. Must be called by
+ language-specific subclasses before emitting that mapping."""
+
+ # Map from APIs not supported in this build to aliases that are.
+ # When there are multiple valid choices for remapping, choose the
+ # most-official suffixed one (KHR > EXT > vendor).
+ for key in self.alias:
+ # If the API key is aliased to something which does not exist,
+ # then add the thing that does not exist to the nonexistent map.
+ # This is used in spec macros to make promoted extension links
+ # in specs built without the promoted interface refer to the
+ # older interface instead.
+
+ invkey = self.alias[key]
+
+ if invkey not in self.typeCategory:
+ if invkey in self.nonexistent:
+ # Potentially remap existing mapping to a more official
+ # alias.
+ self.nonexistent[invkey] = mostOfficial(self.nonexistent[invkey], key)
+ else:
+ # Create remapping to an alias
+ self.nonexistent[invkey] = key
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/__init__.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/__init__.py
new file mode 100644
index 00000000000..34c01f39200
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/__init__.py
@@ -0,0 +1,7 @@
+#!/usr/bin/python3 -i
+#
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/algo.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/algo.py
new file mode 100644
index 00000000000..e9dff4a13ad
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/algo.py
@@ -0,0 +1,145 @@
+#!/usr/bin/python3 -i
+#
+# Copyright (c) 2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+"""RecursiveMemoize serves as a base class for a function modeled
+as a dictionary computed on-the-fly."""
+
+
+class RecursiveMemoize:
+ """Base class for functions that are recursive.
+
+ Derive and implement `def compute(self, key):` to perform the computation:
+ you may use __getitem__ (aka self[otherkey]) to access the results for
+ another key. Each value will be computed at most once. Your
+ function should never return None, since it is used as a sentinel here.
+
+ """
+
+ def __init__(self, func, key_iterable=None, permit_cycles=False):
+ """Initialize data structures, and optionally compute/cache the answer
+ for all elements of an iterable.
+
+ If permit_cycles is False, then __getitem__ on something that's
+ currently being computed raises an exception.
+ If permit_cycles is True, then __getitem__ on something that's
+ currently being computed returns None.
+ """
+ self._compute = func
+ self.permit_cycles = permit_cycles
+ self.d = {}
+ if key_iterable:
+ # If we were given an iterable, let's populate those.
+ for key in key_iterable:
+ _ = self[key]
+
+ def __getitem__(self, key):
+ """Access the result of computing the function on the input.
+
+ Performed lazily and cached.
+ Implement `def compute(self, key):` with the actual function,
+ which will be called on demand."""
+ if key in self.d:
+ ret = self.d[key]
+ # Detect "we're computing this" sentinel and
+ # fail if cycles not permitted
+ if ret is None and not self.permit_cycles:
+ raise RuntimeError("Cycle detected when computing function: " +
+ "f({}) depends on itself".format(key))
+ # return the memoized value
+ # (which might be None if we're in a cycle that's permitted)
+ return ret
+
+ # Set sentinel for "we're computing this"
+ self.d[key] = None
+ # Delegate to function to actually compute
+ ret = self._compute(key)
+ # Memoize
+ self.d[key] = ret
+
+ return ret
+
+ def get_dict(self):
+ """Return the dictionary where memoized results are stored.
+
+ DO NOT MODIFY!"""
+ return self.d
+
+
+def longest_common_prefix(strings):
+ """
+ Find the longest common prefix of a list of 2 or more strings.
+
+ Args:
+ strings (collection): at least 2 strings.
+
+ Returns:
+ string: The longest string that all submitted strings start with.
+
+ >>> longest_common_prefix(["abcd", "abce"])
+ 'abc'
+
+ """
+ assert(len(strings) > 1)
+ a = min(strings)
+ b = max(strings)
+ prefix = []
+ for a_char, b_char in zip(a, b):
+ if a_char == b_char:
+ prefix.append(a_char)
+ else:
+ break
+ return "".join(prefix)
+
+
+def longest_common_token_prefix(strings, delimiter='_'):
+ """
+ Find the longest common token-wise prefix of a list of 2 or more strings.
+
+ Args:
+ strings (collection): at least 2 strings.
+ delimiter (character): the character to split on.
+
+ Returns:
+ string: The longest string that all submitted strings start with.
+
+ >>> longest_common_token_prefix(["xr_abc_123", "xr_abc_567"])
+ 'xr_abc_'
+
+ "1" is in the per-character longest common prefix, but 123 != 135,
+ so it's not in the per-token prefix.
+
+ >>> longest_common_token_prefix(["xr_abc_123", "xr_abc_135"])
+ 'xr_abc_'
+
+ Here, the prefix is actually the entirety of one string, so no trailing delimiter.
+
+ >>> longest_common_token_prefix(["xr_abc_123", "xr_abc"])
+ 'xr_abc'
+
+
+ No common prefix here, because it's per-token:
+
+ >>> longest_common_token_prefix(["abc_123", "ab_123"])
+ ''
+
+ """
+ assert(len(strings) > 1)
+ a = min(strings).split(delimiter)
+ b = max(strings).split(delimiter)
+ prefix_tokens = []
+ for a_token, b_token in zip(a, b):
+ if a_token == b_token:
+ prefix_tokens.append(a_token)
+ else:
+ break
+ if prefix_tokens:
+ prefix = delimiter.join(prefix_tokens)
+ if len(prefix_tokens) < min(len(a), len(b)):
+ # This is truly a prefix, not just one of the strings.
+ prefix += delimiter
+ return prefix
+ return ''
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/attributes.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/attributes.py
new file mode 100644
index 00000000000..9267247af21
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/attributes.py
@@ -0,0 +1,134 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+"""Utilities for working with attributes of the XML registry."""
+
+import re
+
+_PARAM_REF_NAME_RE = re.compile(
+ r"(?P<name>[\w]+)(?P<brackets>\[\])?(?P<delim>\.|::|->)?")
+
+
+def _split_param_ref(val):
+ return [name for name, _, _ in _PARAM_REF_NAME_RE.findall(val)]
+
+
+def _human_readable_deref(val, make_param_name=None):
+ """Turn the "name[].member[]" notation into plain English."""
+ parts = []
+ matches = _PARAM_REF_NAME_RE.findall(val)
+ for name, brackets, delim in reversed(matches):
+ if make_param_name:
+ name = make_param_name(name)
+ if delim:
+ parts.append('member of')
+ if brackets:
+ parts.append('each element of')
+ parts.append('the')
+ parts.append(name)
+ parts.append('parameter')
+ return ' '.join(parts)
+
+
+class LengthEntry:
+ """An entry in a (comma-separated) len attribute"""
+ NULL_TERMINATED_STRING = 'null-terminated'
+ MATH_STRING = 'latexmath:'
+
+ def __init__(self, val):
+ self.full_reference = val
+ self.other_param_name = None
+ self.null_terminated = False
+ self.number = None
+ self.math = None
+ self.param_ref_parts = None
+ if val == LengthEntry.NULL_TERMINATED_STRING:
+ self.null_terminated = True
+ return
+
+ if val.startswith(LengthEntry.MATH_STRING):
+ self.math = val.replace(LengthEntry.MATH_STRING, '')[1:-1]
+ return
+
+ if val.isdigit():
+ self.number = int(val)
+ return
+
+ # Must be another param name.
+ self.param_ref_parts = _split_param_ref(val)
+ self.other_param_name = self.param_ref_parts[0]
+
+ def __str__(self):
+ return self.full_reference
+
+ def get_human_readable(self, make_param_name=None):
+ assert(self.other_param_name)
+ return _human_readable_deref(self.full_reference, make_param_name=make_param_name)
+
+ def __repr__(self):
+ "Formats an object for repr(), debugger display, etc."
+ return 'spec_tools.attributes.LengthEntry("{}")'.format(self.full_reference)
+
+ @staticmethod
+ def parse_len_from_param(param):
+ """Get a list of LengthEntry, or None."""
+ len_str = param.get('len')
+ if len_str is None:
+ return None
+ return [LengthEntry(elt) for elt in len_str.split(',')]
+
+
+class ExternSyncEntry:
+ """An entry in a (comma-separated) externsync attribute"""
+
+ TRUE_STRING = 'true'
+ TRUE_WITH_CHILDREN_STRING = 'true_with_children'
+
+ def __init__(self, val):
+ self.full_reference = val
+ self.entirely_extern_sync = (val in (ExternSyncEntry.TRUE_STRING, ExternSyncEntry.TRUE_WITH_CHILDREN_STRING))
+ self.children_extern_sync = (val == ExternSyncEntry.TRUE_WITH_CHILDREN_STRING)
+ if self.entirely_extern_sync:
+ return
+
+ self.param_ref_parts = _split_param_ref(val)
+ self.member = self.param_ref_parts[0]
+
+ def get_human_readable(self, make_param_name=None):
+ assert(not self.entirely_extern_sync)
+ return _human_readable_deref(self.full_reference, make_param_name=make_param_name)
+
+ @staticmethod
+ def parse_externsync_from_param(param):
+ """Get a list of ExternSyncEntry."""
+ sync_str = param.get('externsync')
+ if sync_str is None:
+ return None
+ return [ExternSyncEntry(elt) for elt in sync_str.split(',')]
+
+ def __repr__(self):
+ "Formats an object for repr(), debugger display, etc."
+ return 'spec_tools.attributes.ExternSyncEntry("{}")'.format(self.full_reference)
+
+
+_TRUE_STRING = 'true'
+_FALSE_STRING = 'false'
+
+
+def _parse_optional_elt(val):
+ if val not in (_TRUE_STRING, _FALSE_STRING):
+ raise ValueError("Each element of the optional attribute must be 'true', or 'false'")
+ return val == _TRUE_STRING
+
+
+def parse_optional_from_param(param):
+ """Get a list of booleans from a param: always returns at least one element."""
+ optional_str = param.get('optional', _FALSE_STRING)
+ return [_parse_optional_elt(elt) for elt in optional_str.split(',')]
+
+
+def has_any_optional_in_param(param):
+ """Returns True if we have any true in an optional attribute."""
+ return any(parse_optional_from_param(param))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/base_printer.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/base_printer.py
new file mode 100644
index 00000000000..f48905acde5
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/base_printer.py
@@ -0,0 +1,213 @@
+"""Provides the BasePrinter base class for MacroChecker/Message output techniques."""
+
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+
+from abc import ABC, abstractmethod
+from pathlib import Path
+
+from .macro_checker import MacroChecker
+from .macro_checker_file import MacroCheckerFile
+from .shared import EntityData, Message, MessageContext, MessageType
+
+
+def getColumn(message_context):
+ """Return the (zero-based) column number of the message context.
+
+ If a group is specified: returns the column of the start of the group.
+ If no group, but a match is specified: returns the column of the start of
+ the match.
+ If no match: returns column 0 (whole line).
+ """
+ if not message_context.match:
+ # whole line
+ return 0
+ if message_context.group is not None:
+ return message_context.match.start(message_context.group)
+ return message_context.match.start()
+
+
+class BasePrinter(ABC):
+ """Base class for a way of outputting results of a checker execution."""
+
+ def __init__(self):
+ """Constructor."""
+ self._cwd = None
+
+ def close(self):
+ """Write the tail end of the output and close it, if applicable.
+
+ Override if you want to print a summary or are writing to a file.
+ """
+ pass
+
+ ###
+ # Output methods: these should all print/output directly.
+ def output(self, obj):
+ """Output any object.
+
+ Delegates to other output* methods, if type known,
+ otherwise uses self.outputFallback().
+ """
+ if isinstance(obj, Message):
+ self.outputMessage(obj)
+ elif isinstance(obj, MacroCheckerFile):
+ self.outputCheckerFile(obj)
+ elif isinstance(obj, MacroChecker):
+ self.outputChecker(obj)
+ else:
+ self.outputFallback(self.formatBrief(obj))
+
+ @abstractmethod
+ def outputResults(self, checker, broken_links=True,
+ missing_includes=False):
+ """Output the full results of a checker run.
+
+ Must be implemented.
+
+ Typically will call self.output() on the MacroChecker,
+ as well as calling self.outputBrokenAndMissing()
+ """
+ raise NotImplementedError
+
+ @abstractmethod
+ def outputBrokenLinks(self, checker, broken):
+ """Output the collection of broken links.
+
+ `broken` is a dictionary of entity names: usage contexts.
+
+ Must be implemented.
+
+ Called by self.outputBrokenAndMissing() if requested.
+ """
+ raise NotImplementedError
+
+ @abstractmethod
+ def outputMissingIncludes(self, checker, missing):
+ """Output a table of missing includes.
+
+ `missing` is a iterable entity names.
+
+ Must be implemented.
+
+ Called by self.outputBrokenAndMissing() if requested.
+ """
+ raise NotImplementedError
+
+ def outputChecker(self, checker):
+ """Output the contents of a MacroChecker object.
+
+ Default implementation calls self.output() on every MacroCheckerFile.
+ """
+ for f in checker.files:
+ self.output(f)
+
+ def outputCheckerFile(self, fileChecker):
+ """Output the contents of a MacroCheckerFile object.
+
+ Default implementation calls self.output() on every Message.
+ """
+ for m in fileChecker.messages:
+ self.output(m)
+
+ def outputBrokenAndMissing(self, checker, broken_links=True,
+ missing_includes=False):
+ """Outputs broken links and missing includes, if desired.
+
+ Delegates to self.outputBrokenLinks() (if broken_links==True)
+ and self.outputMissingIncludes() (if missing_includes==True).
+ """
+ if broken_links:
+ broken = checker.getBrokenLinks()
+ if broken:
+ self.outputBrokenLinks(checker, broken)
+ if missing_includes:
+ missing = checker.getMissingUnreferencedApiIncludes()
+ if missing:
+ self.outputMissingIncludes(checker, missing)
+
+ @abstractmethod
+ def outputMessage(self, msg):
+ """Output a Message.
+
+ Must be implemented.
+ """
+ raise NotImplementedError
+
+ @abstractmethod
+ def outputFallback(self, msg):
+ """Output some text in a general way.
+
+ Must be implemented.
+ """
+ raise NotImplementedError
+
+ ###
+ # Format methods: these should all return a string.
+ def formatContext(self, context, _message_type=None):
+ """Format a message context in a verbose way, if applicable.
+
+ May override, default implementation delegates to
+ self.formatContextBrief().
+ """
+ return self.formatContextBrief(context)
+
+ def formatContextBrief(self, context, _with_color=True):
+ """Format a message context in a brief way.
+
+ May override, default is relativeFilename:line:column
+ """
+ return '{}:{}:{}'.format(self.getRelativeFilename(context.filename),
+ context.lineNum, getColumn(context))
+
+ def formatMessageTypeBrief(self, message_type, _with_color=True):
+ """Format a message type in a brief way.
+
+ May override, default is message_type:
+ """
+ return '{}:'.format(message_type)
+
+ def formatEntityBrief(self, entity_data, _with_color=True):
+ """Format an entity in a brief way.
+
+ May override, default is macro:entity.
+ """
+ return '{}:{}'.format(entity_data.macro, entity_data.entity)
+
+ def formatBrief(self, obj, with_color=True):
+ """Format any object in a brief way.
+
+ Delegates to other format*Brief methods, if known,
+ otherwise uses str().
+ """
+ if isinstance(obj, MessageContext):
+ return self.formatContextBrief(obj, with_color)
+ if isinstance(obj, MessageType):
+ return self.formatMessageTypeBrief(obj, with_color)
+ if isinstance(obj, EntityData):
+ return self.formatEntityBrief(obj, with_color)
+ return str(obj)
+
+ @property
+ def cwd(self):
+ """Get the current working directory, fully resolved.
+
+ Lazy initialized.
+ """
+ if not self._cwd:
+ self._cwd = Path('.').resolve()
+ return self._cwd
+
+ ###
+ # Helper function
+ def getRelativeFilename(self, fn):
+ """Return the given filename relative to the current directory,
+ if possible.
+ """
+ try:
+ return str(Path(fn).relative_to(self.cwd))
+ except ValueError:
+ return str(Path(fn))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/consistency_tools.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/consistency_tools.py
new file mode 100644
index 00000000000..eab6d470a8a
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/consistency_tools.py
@@ -0,0 +1,824 @@
+#!/usr/bin/python3 -i
+#
+# Copyright (c) 2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+"""Provides utilities to write a script to verify XML registry consistency."""
+
+import re
+from typing import Set
+
+import networkx as nx
+from networkx.algorithms import shortest_path
+
+from .algo import RecursiveMemoize
+from .attributes import ExternSyncEntry, LengthEntry
+from .data_structures import DictOfStringSets
+from .util import findNamedElem, getElemName, getElemType
+from .conventions import ConventionsBase
+
+
+def _get_extension_tags(reg):
+ """Get a set of all author tags registered for use."""
+ return set(elt.get("name") for elt in reg.tree.findall("./tags/tag[@name]"))
+
+
+class XMLChecker:
+ def __init__(self, entity_db, conventions: ConventionsBase, manual_types_to_codes=None,
+ forward_only_types_to_codes=None,
+ reverse_only_types_to_codes=None,
+ suppressions=None,
+ display_warnings=True):
+ """Set up data structures.
+
+ May extend - call:
+ `super().__init__(db, conventions, manual_types_to_codes)`
+ as the last statement in your function.
+
+ manual_types_to_codes is a dictionary of hard-coded
+ "manual" return codes:
+ the codes of the value are available for a command if-and-only-if
+ the key type is passed as an input.
+
+ forward_only_types_to_codes is additional entries to the above
+ that should only be used in the "forward" direction
+ (arg type implies return code)
+
+ reverse_only_types_to_codes is additional entries to
+ manual_types_to_codes that should only be used in the
+ "reverse" direction
+ (return code implies arg type)
+ """
+ self.fail = False
+ self.entity = None
+ self.errors = DictOfStringSets()
+ self.warnings = DictOfStringSets()
+ self.db = entity_db
+ self.reg = entity_db.registry
+ self.handle_data = HandleData(self.reg)
+ self.conventions = conventions
+ self.display_warnings = display_warnings
+
+ self.CONST_RE = re.compile(r"\bconst\b")
+ self.ARRAY_RE = re.compile(r"\[[^]]+\]")
+
+ # Init memoized properties
+ self._handle_data = None
+
+ if not manual_types_to_codes:
+ manual_types_to_codes = {}
+ if not reverse_only_types_to_codes:
+ reverse_only_types_to_codes = {}
+ if not forward_only_types_to_codes:
+ forward_only_types_to_codes = {}
+
+ reverse_codes = DictOfStringSets(reverse_only_types_to_codes)
+ forward_codes = DictOfStringSets(forward_only_types_to_codes)
+ for k, v in manual_types_to_codes.items():
+ forward_codes.add(k, v)
+ reverse_codes.add(k, v)
+
+ self.forward_only_manual_types_to_codes = forward_codes.get_dict()
+ self.reverse_only_manual_types_to_codes = reverse_codes.get_dict()
+
+ # The presence of some types as input to a function imply the
+ # availability of some return codes.
+ self.input_type_to_codes = compute_type_to_codes(
+ self.handle_data,
+ forward_codes,
+ extra_op=self.add_extra_codes)
+
+ # Some return codes require a type (or its child) in the input.
+ self.codes_requiring_input_type = compute_codes_requiring_type(
+ self.handle_data,
+ reverse_codes
+ )
+
+ specified_codes = set(self.codes_requiring_input_type.keys())
+ for codes in self.forward_only_manual_types_to_codes.values():
+ specified_codes.update(codes)
+ for codes in self.reverse_only_manual_types_to_codes.values():
+ specified_codes.update(codes)
+ for codes in self.input_type_to_codes.values():
+ specified_codes.update(codes)
+
+ self.return_codes: Set[str]
+ unrecognized = specified_codes - self.return_codes
+ if unrecognized:
+ raise RuntimeError("Return code mentioned in script that isn't in the registry: " +
+ ', '.join(unrecognized))
+
+ self.referenced_input_types = ReferencedTypes(self.db, self.is_input)
+ self.referenced_types = ReferencedTypes(self.db)
+ if not suppressions:
+ suppressions = {}
+ self.suppressions = DictOfStringSets(suppressions)
+ self.tags = _get_extension_tags(self.db.registry)
+
+ def is_api_type(self, member_elem):
+ """Return true if the member/parameter ElementTree passed is from this API.
+
+ May override or extend."""
+ membertext = "".join(member_elem.itertext())
+
+ return self.conventions.type_prefix in membertext
+
+ def is_input(self, member_elem):
+ """Return true if the member/parameter ElementTree passed is
+ considered "input".
+
+ May override or extend."""
+ membertext = "".join(member_elem.itertext())
+
+ if self.conventions.type_prefix not in membertext:
+ return False
+
+ ret = True
+ # Const is always input.
+ if self.CONST_RE.search(membertext):
+ ret = True
+
+ # Arrays and pointers that aren't const are always output.
+ elif "*" in membertext:
+ ret = False
+ elif self.ARRAY_RE.search(membertext):
+ ret = False
+
+ return ret
+
+ def strip_extension_tag(self, name):
+ """Remove a single author tag from the end of a name, if any.
+
+ Returns the stripped name and the tag, or the input and None if there was no tag.
+ """
+ for t in self.tags:
+ if name.endswith(t):
+ name = name[:-(len(t))]
+ if name[-1] == "_":
+ # remove trailing underscore
+ name = name[:-1]
+ return name, t
+ return name, None
+
+ def add_extra_codes(self, types_to_codes):
+ """Add any desired entries to the types-to-codes DictOfStringSets
+ before performing "ancestor propagation".
+
+ Passed to compute_type_to_codes as the extra_op.
+
+ May override."""
+ pass
+
+ def should_skip_checking_codes(self, name):
+ """Return True if more than the basic validation of return codes should
+ be skipped for a command.
+
+ May override."""
+
+ return self.conventions.should_skip_checking_codes
+
+ def get_codes_for_command_and_type(self, cmd_name, type_name):
+ """Return a set of return codes expected due to having
+ an input argument of type type_name.
+
+ The cmd_name is passed for use by extending methods.
+ Note that you should not use cmd_name to add codes, just to
+ filter them out. See get_required_codes_for_command() to do that.
+
+ May extend."""
+ return self.input_type_to_codes.get(type_name, set())
+
+ def get_required_codes_for_command(self, cmd_name):
+ """Return a set of return codes required due to having a particular name.
+
+ May override."""
+ return set()
+
+ def get_forbidden_codes_for_command(self, cmd_name):
+ """Return a set of return codes not permittted due to having a particular name.
+
+ May override."""
+ return set()
+
+ def check(self):
+ """Iterate through the registry, looking for consistency problems.
+
+ Outputs error messages at the end."""
+ # Iterate through commands, looking for consistency problems.
+ for name, info in self.reg.cmddict.items():
+ self.set_error_context(entity=name, elem=info.elem)
+
+ self.check_command(name, info)
+
+ for name, info in self.reg.typedict.items():
+ cat = info.elem.get('category')
+ if not cat:
+ # This is an external thing, skip it.
+ continue
+ self.set_error_context(entity=name, elem=info.elem)
+
+ self.check_type(name, info, cat)
+
+ self.ext_numbers = set()
+ for name, info in self.reg.extdict.items():
+ self.set_error_context(entity=name, elem=info.elem)
+
+ # Determine if this extension is supported by the API we're
+ # testing, and pass that flag to check_extension.
+ # For Vulkan, multiple APIs can be specified in the 'supported'
+ # attribute.
+ supported_apis = info.elem.get('supported', '').split(',')
+ supported = self.conventions.xml_api_name in supported_apis
+ self.check_extension(name, info, supported)
+
+ self.check_format()
+
+ entities_with_messages = set(
+ self.errors.keys()).union(self.warnings.keys())
+ if entities_with_messages:
+ print('xml_consistency/consistency_tools error and warning messages follow.')
+
+ for entity in entities_with_messages:
+ messages = self.errors.get(entity)
+ if messages:
+ print(f'\nError messages for {entity}')
+ for m in messages:
+ print('ERROR:', m)
+
+ messages = self.warnings.get(entity)
+ if messages and self.display_warnings:
+ print(f'\nWarning messages for {entity}')
+ for m in messages:
+ print('WARNING:', m)
+
+ def check_param(self, param):
+ """Check a member of a struct or a param of a function.
+
+ Called from check_params.
+
+ May extend."""
+ param_name = getElemName(param)
+ # Make sure there's something between the type and the name
+ # Can't just look at the .tail of <type> for some reason,
+ # so instead we look to see if anything's between
+ # type's text and name's text in the itertext.
+ # If there's no text between the tags, there will be no string
+ # between those tags' text in itertext()
+ text_parts = list(param.itertext())
+ type_idx = text_parts.index(getElemType(param))
+ name_idx = text_parts.index(param_name)
+ if name_idx - type_idx == 1:
+ self.record_error(
+ "Space (or other delimiter text) missing between </type> and <name> for param/member named",
+ param_name)
+
+ # Check external sync entries
+ externsyncs = ExternSyncEntry.parse_externsync_from_param(param)
+ if externsyncs:
+ for entry in externsyncs:
+ if entry.entirely_extern_sync:
+ if len(externsyncs) > 1:
+ self.record_error("Comma-separated list in externsync attribute includes 'true' for",
+ param_name)
+ else:
+ # member name
+ # TODO only looking at the superficial feature here,
+ # not entry.param_ref_parts
+ if entry.member != param_name:
+ self.record_error("externsync attribute for", param_name,
+ "refers to some other member/parameter:", entry.member)
+
+ def check_params(self, params):
+ """Check the members of a struct or params of a function.
+
+ Called from check_type and check_command.
+
+ May extend."""
+ for param in params:
+ self.check_param(param)
+
+ # Check for parameters referenced by len= attribute
+ lengths = LengthEntry.parse_len_from_param(param)
+ if lengths:
+ for entry in lengths:
+ if not entry.other_param_name:
+ continue
+ # TODO only looking at the superficial feature here,
+ # not entry.param_ref_parts
+ other_param = findNamedElem(params, entry.other_param_name)
+ if other_param is None:
+ self.record_error("References a non-existent parameter/member in the length of",
+ getElemName(param), ":", entry.other_param_name)
+
+ def check_referenced_type(self, desc, ref_name):
+ """
+ Record an error if a type mentioned somewhere doesn't exist.
+
+ :param desc: Description of where this type reference was found,
+ for the error message.
+ :param ref_name: The name of the referenced type. If false-ish (incl. None),
+ checking is skipped, so OK to pass the results of
+ info.elem.get() directly
+ """
+ if ref_name:
+ entity = self.db.findEntity(ref_name)
+ if not entity:
+ self.record_error("Unknown type named in", desc, ":",
+ ref_name)
+
+ def check_type(self, name, info, category):
+ """Check a type's XML data for consistency.
+
+ Called from check.
+
+ May extend."""
+ if category == 'struct':
+ if not name.startswith(self.conventions.type_prefix):
+ self.record_error("Name does not start with",
+ self.conventions.type_prefix)
+ members = info.elem.findall('member')
+ self.check_params(members)
+
+ # Check the structure type member, if present.
+ type_member = findNamedElem(
+ members, self.conventions.structtype_member_name)
+ if type_member is not None:
+ val = type_member.get('values')
+ if val:
+ expected = self.conventions.generate_structure_type_from_name(
+ name)
+ if val != expected:
+ self.record_error("Type has incorrect type-member value: expected",
+ expected, "got", val)
+
+ # Check structextends attribute, if present.
+ # For Vulkan, this may be a comma-separated list of multiple types
+ for type in info.elem.get("structextends", '').split(','):
+ self.check_referenced_type("'structextends' attribute", type)
+
+ # Check parentstruct attribute, if present.
+ self.check_referenced_type("'parentstruct' attribute", info.elem.get("parentstruct"))
+
+ elif category == "bitmask":
+ if 'Flags' not in name:
+ self.record_error("Name of bitmask doesn't include 'Flags'")
+ elif category == "handle":
+ # Check parent attribute, if present.
+ self.check_referenced_type("'parent' attribute", info.elem.get("parent"))
+
+ def check_extension(self, name, info, supported):
+ """Check an extension's XML data for consistency.
+
+ Called from check.
+
+ May extend."""
+
+ # Verify that each extension has a unique number
+ extension_number = info.elem.get('number')
+ if extension_number is not None and extension_number != '0':
+ if extension_number in self.ext_numbers:
+ self.record_error('Duplicate extension number ' + extension_number)
+ else:
+ self.ext_numbers.add(extension_number)
+
+ def check_format(self):
+ """Check an extension's XML data for consistency.
+
+ Called from check.
+
+ May extend."""
+ pass
+
+ def check_command(self, name, info):
+ """Check a command's XML data for consistency.
+
+ Called from check.
+
+ May extend."""
+ elem = info.elem
+
+ self.check_params(elem.findall('param'))
+
+ # Some minimal return code checking
+ errorcodes = elem.get("errorcodes")
+ if errorcodes:
+ errorcodes = errorcodes.split(",")
+ else:
+ errorcodes = []
+
+ successcodes = elem.get("successcodes")
+ if successcodes:
+ successcodes = successcodes.split(",")
+ else:
+ successcodes = []
+
+ if not successcodes and not errorcodes:
+ # Early out if no return codes.
+ return
+
+ # Create a set for each group of codes, and check that
+ # they aren't duplicated within or between groups.
+ errorcodes_set = set(errorcodes)
+ if len(errorcodes) != len(errorcodes_set):
+ self.record_error("Contains a duplicate in errorcodes")
+
+ successcodes_set = set(successcodes)
+ if len(successcodes) != len(successcodes_set):
+ self.record_error("Contains a duplicate in successcodes")
+
+ if not successcodes_set.isdisjoint(errorcodes_set):
+ self.record_error("Has errorcodes and successcodes that overlap")
+
+ self.check_command_return_codes_basic(
+ name, info, successcodes_set, errorcodes_set)
+
+ # Continue to further return code checking if not "complicated"
+ if not self.should_skip_checking_codes(name):
+ codes_set = successcodes_set.union(errorcodes_set)
+ self.check_command_return_codes(
+ name, info, successcodes_set, errorcodes_set, codes_set)
+
+ def check_command_return_codes_basic(self, name, info,
+ successcodes, errorcodes):
+ """Check a command's return codes for consistency.
+
+ Called from check_command on every command.
+
+ May extend."""
+
+ # Check that all error codes include _ERROR_,
+ # and that no success codes do.
+ for code in errorcodes:
+ if "_ERROR_" not in code:
+ self.record_error(
+ code, "in errorcodes but doesn't contain _ERROR_")
+
+ for code in successcodes:
+ if "_ERROR_" in code:
+ self.record_error(code, "in successcodes but contain _ERROR_")
+
+ def check_command_return_codes(self, name, type_info,
+ successcodes, errorcodes,
+ codes):
+ """Check a command's return codes in-depth for consistency.
+
+ Called from check_command, only if
+ `self.should_skip_checking_codes(name)` is False.
+
+ May extend."""
+ referenced_input = self.referenced_input_types[name]
+ referenced_types = self.referenced_types[name]
+ error_prefix = self.conventions.api_prefix + "ERROR"
+
+ bad_success = {x for x in successcodes if x.startswith(error_prefix)}
+ if bad_success:
+ self.record_error("Found error code(s)",
+ ",".join(bad_success),
+ "listed in the successcodes attributes")
+
+ bad_errors = {x for x in errorcodes if not x.startswith(error_prefix)}
+ if bad_errors:
+ self.record_error("Found success code(s)",
+ ",".join(bad_errors),
+ "listed in the errorcodes attributes")
+
+ # Check that we have all the codes we expect, based on input types.
+ for referenced_type in referenced_input:
+ required_codes = self.get_codes_for_command_and_type(
+ name, referenced_type)
+ missing_codes = required_codes - codes
+ if missing_codes:
+ path = self.referenced_input_types.shortest_path(
+ name, referenced_type)
+ path_str = " -> ".join(path)
+ self.record_error("Missing expected return code(s)",
+ ",".join(missing_codes),
+ "implied because of input of type",
+ referenced_type,
+ "found via path",
+ path_str)
+
+ # Check that we have all the codes we expect based on command name.
+ missing_codes = self.get_required_codes_for_command(name) - codes
+ if missing_codes:
+ self.record_error("Missing expected return code(s)",
+ ",".join(missing_codes),
+ "implied because of the name of this command")
+
+ # Check that we don't have any codes forbidden based on command name.
+ forbidden = self.get_forbidden_codes_for_command(name).intersection(codes)
+ if forbidden:
+ self.record_error("Got return code(s)",
+ ", ".join(forbidden),
+ "that were forbidden due to the name of this command")
+
+ # Check that, for each code returned by this command that we can
+ # associate with a type, we have some type that can provide it.
+ # e.g. can't have INSTANCE_LOST without an Instance
+ # (or child of Instance).
+ for code in codes:
+
+ required_types = self.codes_requiring_input_type.get(code)
+ if not required_types:
+ # This code doesn't have a known requirement
+ continue
+
+ # TODO: do we look at referenced_types or referenced_input here?
+ # the latter is stricter
+ if not referenced_types.intersection(required_types):
+ self.record_error("Unexpected return code", code,
+ "- none of these types:",
+ required_types,
+ "found in the set of referenced types",
+ referenced_types)
+
+ ###
+ # Utility properties/methods
+ ###
+
+ def set_error_context(self, entity=None, elem=None):
+ """Set the entity and/or element for future record_error calls."""
+ self.entity = entity
+ self.elem = elem
+ self.name = getElemName(elem)
+ self.entity_suppressions = self.suppressions.get(getElemName(elem))
+
+ def record_error(self, *args, **kwargs):
+ """Record failure and an error message for the current context."""
+ message = " ".join((str(x) for x in args))
+
+ if self._is_message_suppressed(message):
+ return
+
+ message = self._prepend_sourceline_to_message(message, **kwargs)
+ self.fail = True
+ self.errors.add(self.entity, message)
+
+ def record_warning(self, *args, **kwargs):
+ """Record a warning message for the current context."""
+ message = " ".join((str(x) for x in args))
+
+ if self._is_message_suppressed(message):
+ return
+
+ message = self._prepend_sourceline_to_message(message, **kwargs)
+ self.warnings.add(self.entity, message)
+
+ def _is_message_suppressed(self, message):
+ """Return True if the given message, for this entity, should be suppressed."""
+ if not self.entity_suppressions:
+ return False
+ for suppress in self.entity_suppressions:
+ if suppress in message:
+ return True
+
+ return False
+
+ def _prepend_sourceline_to_message(self, message, **kwargs):
+ """Prepend a file and/or line reference to the message, if possible.
+
+ If filename is given as a keyword argument, it is used on its own.
+
+ If filename is not given, this will attempt to retrieve the filename and line from an XML element.
+ If 'elem' is given as a keyword argument and is not None, it is used to find the line.
+ If 'elem' is given as None, no XML elements are looked at.
+ If 'elem' is not supplied, the error context element is used.
+
+ If using XML, the filename, if available, is retrieved from the Registry class.
+ If using XML and python-lxml is installed, the source line is retrieved from whatever element is chosen."""
+ fn = kwargs.get('filename')
+ sourceline = None
+
+ if fn is None:
+ elem = kwargs.get('elem', self.elem)
+ if elem is not None:
+ sourceline = getattr(elem, 'sourceline', None)
+ if self.reg.filename:
+ fn = self.reg.filename
+
+ if fn is None and sourceline is None:
+ return message
+
+ if fn is None:
+ return "Line {}: {}".format(sourceline, message)
+
+ if sourceline is None:
+ return "{}: {}".format(fn, message)
+
+ return "{}:{}: {}".format(fn, sourceline, message)
+
+
+class HandleParents(RecursiveMemoize):
+ def __init__(self, handle_types):
+ self.handle_types = handle_types
+
+ def compute(handle_type):
+ immediate_parent = self.handle_types[handle_type].elem.get(
+ 'parent')
+
+ if immediate_parent is None:
+ # No parents, no need to recurse
+ return []
+
+ # Support multiple (alternate) parents
+ immediate_parents = immediate_parent.split(',')
+
+ # Recurse, combine, and return
+ all_parents = immediate_parents[:]
+ for parent in immediate_parents:
+ all_parents.extend(self[parent])
+ return all_parents
+
+ super().__init__(compute, handle_types.keys())
+
+
+def _always_true(x):
+ return True
+
+
+class ReferencedTypes(RecursiveMemoize):
+ """Find all types(optionally matching a predicate) that are referenced
+ by a struct or function, recursively."""
+
+ def __init__(self, db, predicate=None):
+ """Initialize.
+
+ Provide an EntityDB object and a predicate function."""
+ self.db = db
+
+ self.predicate = predicate
+ if not self.predicate:
+ # Default predicate is "anything goes"
+ self.predicate = _always_true
+
+ self._directly_referenced = {}
+ self.graph = nx.DiGraph()
+
+ def compute(type_name):
+ """Compute and return all types referenced by type_name, recursively, that satisfy the predicate.
+
+ Called by the [] operator in the base class."""
+ types = self.directly_referenced(type_name)
+ if not types:
+ return types
+
+ all_types = set()
+ all_types.update(types)
+ for t in types:
+ referenced = self[t]
+ if referenced is not None:
+ # If not leading to a cycle
+ all_types.update(referenced)
+ return all_types
+
+ # Initialize base class
+ super().__init__(compute, permit_cycles=True)
+
+ def shortest_path(self, source, target):
+ """Get the shortest path between one type/function name and another."""
+ # Trigger computation
+ _ = self[source]
+
+ return shortest_path(self.graph, source=source, target=target)
+
+ def directly_referenced(self, type_name):
+ """Get all types referenced directly by type_name that satisfy the predicate.
+
+ Memoizes its results."""
+ if type_name not in self._directly_referenced:
+ members = self.db.getMemberElems(type_name)
+ if members:
+ types = ((member, member.find("type")) for member in members)
+ self._directly_referenced[type_name] = set(type_elem.text for (member, type_elem) in types
+ if type_elem is not None and self.predicate(member))
+
+ else:
+ self._directly_referenced[type_name] = set()
+ children = self.db.childTypes(type_name)
+ if children:
+ self._directly_referenced[type_name].update(children)
+ # Update graph
+ self.graph.add_node(type_name)
+ self.graph.add_edges_from((type_name, t)
+ for t in self._directly_referenced[type_name])
+
+ return self._directly_referenced[type_name]
+
+
+class HandleData:
+ """Data about all the handle types available in an API specification."""
+
+ def __init__(self, registry):
+ self.reg = registry
+ self._handle_types = None
+ self._ancestors = None
+ self._descendants = None
+
+ @property
+ def handle_types(self):
+ """Return a dictionary of handle type names to type info."""
+ if not self._handle_types:
+ # First time requested - compute it.
+ self._handle_types = {
+ type_name: type_info
+ for type_name, type_info in self.reg.typedict.items()
+ if type_info.elem.get('category') == 'handle'
+ }
+ return self._handle_types
+
+ @property
+ def ancestors_dict(self):
+ """Return a dictionary of handle type names to sets of ancestors."""
+ if not self._ancestors:
+ # First time requested - compute it.
+ self._ancestors = HandleParents(self.handle_types).get_dict()
+ return self._ancestors
+
+ @property
+ def descendants_dict(self):
+ """Return a dictionary of handle type names to sets of descendants."""
+ if not self._descendants:
+ # First time requested - compute it.
+
+ handle_parents = self.ancestors_dict
+
+ def get_descendants(handle):
+ return set(h for h in handle_parents.keys()
+ if handle in handle_parents[h])
+
+ self._descendants = {
+ h: get_descendants(h)
+ for h in handle_parents.keys()
+ }
+ return self._descendants
+
+
+def compute_type_to_codes(handle_data, types_to_codes, extra_op=None):
+ """Compute a DictOfStringSets of input type to required return codes.
+
+ - handle_data is a HandleData instance.
+ - d is a dictionary of type names to strings or string collections of
+ return codes.
+ - extra_op, if any, is called after populating the output from the input
+ dictionary, but before propagation of parent codes to child types.
+ extra_op is called with the in-progress DictOfStringSets.
+
+ Returns a DictOfStringSets of input type name to set of required return
+ code names.
+ """
+ # Initialize with the supplied "manual" codes
+ types_to_codes = DictOfStringSets(types_to_codes)
+
+ # Dynamically generate more codes, if desired
+ if extra_op:
+ extra_op(types_to_codes)
+
+ # Final post-processing
+
+ # Any handle can result in its parent handle's codes too.
+
+ handle_ancestors = handle_data.ancestors_dict
+
+ extra_handle_codes = {}
+ for handle_type, ancestors in handle_ancestors.items():
+ # The sets of return codes corresponding to each ancestor type.
+ ancestors_codes = [types_to_codes.get(ancestor, set())
+ for ancestor in ancestors]
+ extra_handle_codes[handle_type] = set().union(*ancestors_codes)
+
+ for handle_type, extras in extra_handle_codes.items():
+ types_to_codes.add(handle_type, extras)
+
+ return types_to_codes
+
+
+def compute_codes_requiring_type(handle_data, types_to_codes, registry=None):
+ """Compute a DictOfStringSets of return codes to a set of input types able
+ to provide the ability to generate that code.
+
+ handle_data is a HandleData instance.
+ d is a dictionary of input types to associated return codes(same format
+ as for input to compute_type_to_codes, may use same dict).
+ This will invert that relationship, and also permit any "child handles"
+ to satisfy a requirement for a parent in producing a code.
+
+ Returns a DictOfStringSets of return code name to the set of parameter
+ types that would allow that return code.
+ """
+ # Use DictOfStringSets to normalize the input into a dict with values
+ # that are sets of strings
+ in_dict = DictOfStringSets(types_to_codes)
+
+ handle_descendants = handle_data.descendants_dict
+
+ out = DictOfStringSets()
+ for in_type, code_set in in_dict.items():
+ descendants = handle_descendants.get(in_type)
+ for code in code_set:
+ out.add(code, in_type)
+ if descendants:
+ out.add(code, descendants)
+
+ return out
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/console_printer.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/console_printer.py
new file mode 100644
index 00000000000..7d69aac217c
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/console_printer.py
@@ -0,0 +1,274 @@
+"""Defines ConsolePrinter, a BasePrinter subclass for appealing console output."""
+
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+
+from sys import stdout
+
+from .base_printer import BasePrinter
+from .shared import (colored, getHighlightedRange, getInterestedRange,
+ toNameAndLine)
+
+try:
+ from tabulate import tabulate_impl
+ HAVE_TABULATE = True
+except ImportError:
+ HAVE_TABULATE = False
+
+
+def colWidth(collection, columnNum):
+ """Compute the required width of a column in a collection of row-tuples."""
+ MIN_PADDING = 5
+ return MIN_PADDING + max((len(row[columnNum]) for row in collection))
+
+
+def alternateTabulate(collection, headers=None):
+ """Minimal re-implementation of the tabulate module."""
+ # We need a list, not a generator or anything else.
+ if not isinstance(collection, list):
+ collection = list(collection)
+
+ # Empty collection means no table
+ if not collection:
+ return None
+
+ if headers is None:
+ fullTable = collection
+ else:
+ underline = ['-' * len(header) for header in headers]
+ fullTable = [headers, underline] + collection
+ widths = [colWidth(collection, colNum)
+ for colNum in range(len(fullTable[0]))]
+ widths[-1] = None
+
+ lines = []
+ for row in fullTable:
+ fields = []
+ for data, width in zip(row, widths):
+ if width:
+ spaces = ' ' * (width - len(data))
+ fields.append(data + spaces)
+ else:
+ fields.append(data)
+ lines.append(''.join(fields))
+ return '\n'.join(lines)
+
+
+def printTabulated(collection, headers=None):
+ """Call either tabulate.tabulate(), or our internal alternateTabulate()."""
+ if HAVE_TABULATE:
+ tabulated = tabulate_impl(collection, headers=headers)
+ else:
+ tabulated = alternateTabulate(collection, headers=headers)
+ if tabulated:
+ print(tabulated)
+
+
+def printLineSubsetWithHighlighting(
+ line, start, end, highlightStart=None, highlightEnd=None, maxLen=120, replacement=None):
+ """Print a (potential subset of a) line, with highlighting/underline and optional replacement.
+
+ Will print at least the characters line[start:end], and potentially more if possible
+ to do so without making the output too wide.
+ Will highlight (underline) line[highlightStart:highlightEnd], where the default
+ value for highlightStart is simply start, and the default value for highlightEnd is simply end.
+ replacement, if supplied, will be aligned with the highlighted range.
+
+ Output is intended to look like part of a Clang compile error/warning message.
+ """
+ # Fill in missing start/end with start/end of range.
+ if highlightStart is None:
+ highlightStart = start
+ if highlightEnd is None:
+ highlightEnd = end
+
+ # Expand interested range start/end.
+ start = min(start, highlightStart)
+ end = max(end, highlightEnd)
+
+ tildeLength = highlightEnd - highlightStart - 1
+ caretLoc = highlightStart
+ continuation = '[...]'
+
+ if len(line) > maxLen:
+ # Too long
+
+ # the max is to handle -1 from .find() (which indicates "not found")
+ followingSpaceIndex = max(end, line.find(' ', min(len(line), end + 1)))
+
+ # Maximum length has decreased by at least
+ # the length of a single continuation we absolutely need.
+ maxLen -= len(continuation)
+
+ if followingSpaceIndex <= maxLen:
+ # We can grab the whole beginning of the line,
+ # and not adjust caretLoc
+ line = line[:maxLen] + continuation
+
+ elif (len(line) - followingSpaceIndex) < 5:
+ # We need to truncate the beginning,
+ # but we're close to the end of line.
+ newBeginning = len(line) - maxLen
+
+ caretLoc += len(continuation)
+ caretLoc -= newBeginning
+ line = continuation + line[newBeginning:]
+ else:
+ # Need to truncate the beginning of the string too.
+ newEnd = followingSpaceIndex
+
+ # Now we need two continuations
+ # (and to adjust caret to the right accordingly)
+ maxLen -= len(continuation)
+ caretLoc += len(continuation)
+
+ newBeginning = newEnd - maxLen
+ caretLoc -= newBeginning
+
+ line = continuation + line[newBeginning:newEnd] + continuation
+
+ stdout.buffer.write(line.encode('utf-8'))
+ print()
+
+ spaces = ' ' * caretLoc
+ tildes = '~' * tildeLength
+ print(spaces + colored('^' + tildes, 'green'))
+ if replacement is not None:
+ print(spaces + colored(replacement, 'green'))
+
+
+class ConsolePrinter(BasePrinter):
+ """Implementation of BasePrinter for generating diagnostic reports in colored, helpful console output."""
+
+ def __init__(self):
+ self.show_script_location = False
+ super().__init__()
+
+ ###
+ # Output methods: these all print directly.
+ def outputResults(self, checker, broken_links=True,
+ missing_includes=False):
+ """Output the full results of a checker run.
+
+ Includes the diagnostics, broken links (if desired),
+ and missing includes (if desired).
+ """
+ self.output(checker)
+ if broken_links:
+ broken = checker.getBrokenLinks()
+ if broken:
+ self.outputBrokenLinks(checker, broken)
+ if missing_includes:
+ missing = checker.getMissingUnreferencedApiIncludes()
+ if missing:
+ self.outputMissingIncludes(checker, missing)
+
+ def outputBrokenLinks(self, checker, broken):
+ """Output a table of broken links.
+
+ Called by self.outputBrokenAndMissing() if requested.
+ """
+ print('Missing API includes that are referenced by a linking macro: these result in broken links in the spec!')
+
+ def makeRowOfBroken(entity, uses):
+ fn = checker.findEntity(entity).filename
+ anchor = '[[{}]]'.format(entity)
+ locations = ', '.join((toNameAndLine(context, root_path=checker.root_path)
+ for context in uses))
+ return (fn, anchor, locations)
+ printTabulated((makeRowOfBroken(entity, uses)
+ for entity, uses in sorted(broken.items())),
+ headers=['Include File', 'Anchor in lieu of include', 'Links to this entity'])
+
+ def outputMissingIncludes(self, checker, missing):
+ """Output a table of missing includes.
+
+ Called by self.outputBrokenAndMissing() if requested.
+ """
+ missing = list(sorted(missing))
+ if not missing:
+ # Exit if none
+ return
+ print(
+ 'Missing, but unreferenced, API includes/anchors - potentially not-documented entities:')
+
+ def makeRowOfMissing(entity):
+ fn = checker.findEntity(entity).filename
+ anchor = '[[{}]]'.format(entity)
+ return (fn, anchor)
+ printTabulated((makeRowOfMissing(entity) for entity in missing),
+ headers=['Include File', 'Anchor in lieu of include'])
+
+ def outputMessage(self, msg):
+ """Output a Message, with highlighted range and replacement, if appropriate."""
+ highlightStart, highlightEnd = getHighlightedRange(msg.context)
+
+ if '\n' in msg.context.filename:
+ # This is a multi-line string "filename".
+ # Extra blank line and delimiter line for readability:
+ print()
+ print('--------------------------------------------------------------------')
+
+ fileAndLine = colored('{}:'.format(
+ self.formatBrief(msg.context)), attrs=['bold'])
+
+ headingSize = len('{context}: {mtype}: '.format(
+ context=self.formatBrief(msg.context),
+ mtype=self.formatBrief(msg.message_type, False)))
+ indent = ' ' * headingSize
+ printedHeading = False
+
+ lines = msg.message[:]
+ if msg.see_also:
+ lines.append('See also:')
+ lines.extend((' {}'.format(self.formatBrief(see))
+ for see in msg.see_also))
+
+ if msg.fix:
+ lines.append('Note: Auto-fix available')
+
+ for line in msg.message:
+ if not printedHeading:
+ scriptloc = ''
+ if msg.script_location and self.show_script_location:
+ scriptloc = ', ' + msg.script_location
+ print('{fileLine} {mtype} {msg} (-{arg}{loc})'.format(
+ fileLine=fileAndLine, mtype=msg.message_type.formattedWithColon(),
+ msg=colored(line, attrs=['bold']), arg=msg.message_id.enable_arg(), loc=scriptloc))
+ printedHeading = True
+ else:
+ print(colored(indent + line, attrs=['bold']))
+
+ if len(msg.message) > 1:
+ # extra blank line after multiline message
+ print('')
+
+ start, end = getInterestedRange(msg.context)
+ printLineSubsetWithHighlighting(
+ msg.context.line,
+ start, end,
+ highlightStart, highlightEnd,
+ replacement=msg.replacement)
+
+ def outputFallback(self, obj):
+ """Output by calling print."""
+ print(obj)
+
+ ###
+ # Format methods: these all return a string.
+ def formatFilename(self, fn, _with_color=True):
+ """Format a local filename, as a relative path if possible."""
+ return self.getRelativeFilename(fn)
+
+ def formatMessageTypeBrief(self, message_type, with_color=True):
+ """Format a message type briefly, applying color if desired and possible.
+
+ Delegates to the superclass if not formatting with color.
+ """
+ if with_color:
+ return message_type.formattedWithColon()
+ return super(ConsolePrinter, self).formatMessageTypeBrief(
+ message_type, with_color)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/conventions.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/conventions.py
new file mode 100644
index 00000000000..faca3a27d84
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/conventions.py
@@ -0,0 +1,454 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Base class for working-group-specific style conventions,
+# used in generation.
+
+from enum import Enum
+import abc
+import re
+
+# Type categories that respond "False" to isStructAlwaysValid
+# basetype is home to typedefs like ..Bool32
+CATEGORIES_REQUIRING_VALIDATION = set(('handle',
+ 'enum',
+ 'bitmask',
+ 'basetype',
+ None))
+
+# These are basic C types pulled in via openxr_platform_defines.h
+TYPES_KNOWN_ALWAYS_VALID = set(('char',
+ 'float',
+ 'int8_t', 'uint8_t',
+ 'int16_t', 'uint16_t',
+ 'int32_t', 'uint32_t',
+ 'int64_t', 'uint64_t',
+ 'size_t',
+ 'intptr_t', 'uintptr_t',
+ 'int',
+ ))
+
+# Split an extension name into vendor ID and name portions
+EXT_NAME_DECOMPOSE_RE = re.compile(r'[A-Z]+_(?P<vendor>[A-Z]+)_(?P<name>[\w_]+)')
+
+# Match an API version name.
+# This could be refined further for specific APIs.
+API_VERSION_NAME_RE = re.compile(r'[A-Z]+_VERSION_[0-9]')
+
+
+class ProseListFormats(Enum):
+ """A connective, possibly with a quantifier."""
+ AND = 0
+ EACH_AND = 1
+ OR = 2
+ ANY_OR = 3
+
+ @classmethod
+ def from_string(cls, s):
+ if s == 'or':
+ return cls.OR
+ if s == 'and':
+ return cls.AND
+ raise RuntimeError("Unrecognized string connective: " + s)
+
+ @property
+ def connective(self):
+ if self in (ProseListFormats.OR, ProseListFormats.ANY_OR):
+ return 'or'
+ return 'and'
+
+ def quantifier(self, n):
+ """Return the desired quantifier for a list of a given length."""
+ if self == ProseListFormats.ANY_OR:
+ if n > 1:
+ return 'any of '
+ elif self == ProseListFormats.EACH_AND:
+ if n > 2:
+ return 'each of '
+ if n == 2:
+ return 'both of '
+ return ''
+
+
+class ConventionsBase(abc.ABC):
+ """WG-specific conventions."""
+
+ def __init__(self):
+ self._command_prefix = None
+ self._type_prefix = None
+
+ def formatExtension(self, name):
+ """Mark up an extension name as a link the spec."""
+ return '`<<{}>>`'.format(name)
+
+ @property
+ @abc.abstractmethod
+ def null(self):
+ """Preferred spelling of NULL."""
+ raise NotImplementedError
+
+ def makeProseList(self, elements, fmt=ProseListFormats.AND, with_verb=False, *args, **kwargs):
+ """Make a (comma-separated) list for use in prose.
+
+ Adds a connective (by default, 'and')
+ before the last element if there are more than 1.
+
+ Adds the right one of "is" or "are" to the end if with_verb is true.
+
+ Optionally adds a quantifier (like 'any') before a list of 2 or more,
+ if specified by fmt.
+
+ Override with a different method or different call to
+ _implMakeProseList if you want to add a comma for two elements,
+ or not use a serial comma.
+ """
+ return self._implMakeProseList(elements, fmt, with_verb, *args, **kwargs)
+
+ @property
+ def struct_macro(self):
+ """Get the appropriate format macro for a structure.
+
+ May override.
+ """
+ return 'slink:'
+
+ @property
+ def external_macro(self):
+ """Get the appropriate format macro for an external type like uint32_t.
+
+ May override.
+ """
+ return 'code:'
+
+ @property
+ @abc.abstractmethod
+ def structtype_member_name(self):
+ """Return name of the structure type member.
+
+ Must implement.
+ """
+ raise NotImplementedError()
+
+ @property
+ @abc.abstractmethod
+ def nextpointer_member_name(self):
+ """Return name of the structure pointer chain member.
+
+ Must implement.
+ """
+ raise NotImplementedError()
+
+ @property
+ @abc.abstractmethod
+ def xml_api_name(self):
+ """Return the name used in the default API XML registry for the default API"""
+ raise NotImplementedError()
+
+ @abc.abstractmethod
+ def generate_structure_type_from_name(self, structname):
+ """Generate a structure type name, like XR_TYPE_CREATE_INSTANCE_INFO.
+
+ Must implement.
+ """
+ raise NotImplementedError()
+
+ def makeStructName(self, name):
+ """Prepend the appropriate format macro for a structure to a structure type name.
+
+ Uses struct_macro, so just override that if you want to change behavior.
+ """
+ return self.struct_macro + name
+
+ def makeExternalTypeName(self, name):
+ """Prepend the appropriate format macro for an external type like uint32_t to a type name.
+
+ Uses external_macro, so just override that if you want to change behavior.
+ """
+ return self.external_macro + name
+
+ def _implMakeProseList(self, elements, fmt, with_verb, comma_for_two_elts=False, serial_comma=True):
+ """Internal-use implementation to make a (comma-separated) list for use in prose.
+
+ Adds a connective (by default, 'and')
+ before the last element if there are more than 1,
+ and only includes commas if there are more than 2
+ (if comma_for_two_elts is False).
+
+ Adds the right one of "is" or "are" to the end if with_verb is true.
+
+ Optionally adds a quantifier (like 'any') before a list of 2 or more,
+ if specified by fmt.
+
+ Do not edit these defaults, override self.makeProseList().
+ """
+ assert(serial_comma) # did not implement what we did not need
+ if isinstance(fmt, str):
+ fmt = ProseListFormats.from_string(fmt)
+
+ my_elts = list(elements)
+ if len(my_elts) > 1:
+ my_elts[-1] = '{} {}'.format(fmt.connective, my_elts[-1])
+
+ if not comma_for_two_elts and len(my_elts) <= 2:
+ prose = ' '.join(my_elts)
+ else:
+ prose = ', '.join(my_elts)
+
+ quantifier = fmt.quantifier(len(my_elts))
+
+ parts = [quantifier, prose]
+
+ if with_verb:
+ if len(my_elts) > 1:
+ parts.append(' are')
+ else:
+ parts.append(' is')
+ return ''.join(parts)
+
+ @property
+ @abc.abstractmethod
+ def file_suffix(self):
+ """Return suffix of generated Asciidoctor files"""
+ raise NotImplementedError
+
+ @abc.abstractmethod
+ def api_name(self, spectype=None):
+ """Return API or specification name for citations in ref pages.
+
+ spectype is the spec this refpage is for.
+ 'api' (the default value) is the main API Specification.
+ If an unrecognized spectype is given, returns None.
+
+ Must implement."""
+ raise NotImplementedError
+
+ def should_insert_may_alias_macro(self, genOpts):
+ """Return true if we should insert a "may alias" macro in this file.
+
+ Only used by OpenXR right now."""
+ return False
+
+ @property
+ def command_prefix(self):
+ """Return the expected prefix of commands/functions.
+
+ Implemented in terms of api_prefix."""
+ if not self._command_prefix:
+ self._command_prefix = self.api_prefix[:].replace('_', '').lower()
+ return self._command_prefix
+
+ @property
+ def type_prefix(self):
+ """Return the expected prefix of type names.
+
+ Implemented in terms of command_prefix (and in turn, api_prefix)."""
+ if not self._type_prefix:
+ self._type_prefix = ''.join(
+ (self.command_prefix[0:1].upper(), self.command_prefix[1:]))
+ return self._type_prefix
+
+ @property
+ @abc.abstractmethod
+ def api_prefix(self):
+ """Return API token prefix.
+
+ Typically two uppercase letters followed by an underscore.
+
+ Must implement."""
+ raise NotImplementedError
+
+ @property
+ def api_version_prefix(self):
+ """Return API core version token prefix.
+
+ Implemented in terms of api_prefix.
+
+ May override."""
+ return self.api_prefix + 'VERSION_'
+
+ @property
+ def KHR_prefix(self):
+ """Return extension name prefix for KHR extensions.
+
+ Implemented in terms of api_prefix.
+
+ May override."""
+ return self.api_prefix + 'KHR_'
+
+ @property
+ def EXT_prefix(self):
+ """Return extension name prefix for EXT extensions.
+
+ Implemented in terms of api_prefix.
+
+ May override."""
+ return self.api_prefix + 'EXT_'
+
+ def writeFeature(self, featureExtraProtect, filename):
+ """Return True if OutputGenerator.endFeature should write this feature.
+
+ Defaults to always True.
+ Used in COutputGenerator.
+
+ May override."""
+ return True
+
+ def requires_error_validation(self, return_type):
+ """Return True if the return_type element is an API result code
+ requiring error validation.
+
+ Defaults to always False.
+
+ May override."""
+ return False
+
+ @property
+ def required_errors(self):
+ """Return a list of required error codes for validation.
+
+ Defaults to an empty list.
+
+ May override."""
+ return []
+
+ def is_voidpointer_alias(self, tag, text, tail):
+ """Return True if the declaration components (tag,text,tail) of an
+ element represents a void * type.
+
+ Defaults to a reasonable implementation.
+
+ May override."""
+ return tag == 'type' and text == 'void' and tail.startswith('*')
+
+ def make_voidpointer_alias(self, tail):
+ """Reformat a void * declaration to include the API alias macro.
+
+ Defaults to a no-op.
+
+ Must override if you actually want to use this feature in your project."""
+ return tail
+
+ def category_requires_validation(self, category):
+ """Return True if the given type 'category' always requires validation.
+
+ Defaults to a reasonable implementation.
+
+ May override."""
+ return category in CATEGORIES_REQUIRING_VALIDATION
+
+ def type_always_valid(self, typename):
+ """Return True if the given type name is always valid (never requires validation).
+
+ This is for things like integers.
+
+ Defaults to a reasonable implementation.
+
+ May override."""
+ return typename in TYPES_KNOWN_ALWAYS_VALID
+
+ @property
+ def should_skip_checking_codes(self):
+ """Return True if more than the basic validation of return codes should
+ be skipped for a command."""
+
+ return False
+
+ @property
+ def generate_index_terms(self):
+ """Return True if asiidoctor index terms should be generated as part
+ of an API interface from the docgenerator."""
+
+ return False
+
+ @property
+ def generate_enum_table(self):
+ """Return True if asciidoctor tables describing enumerants in a
+ group should be generated as part of group generation."""
+ return False
+
+ @property
+ def generate_max_enum_in_docs(self):
+ """Return True if MAX_ENUM tokens should be generated in
+ documentation includes."""
+ return False
+
+ @abc.abstractmethod
+ def extension_file_path(self, name):
+ """Return file path to an extension appendix relative to a directory
+ containing all such appendices.
+ - name - extension name
+
+ Must implement."""
+ raise NotImplementedError
+
+ def extension_include_string(self, name):
+ """Return format string for include:: line for an extension appendix
+ file.
+ - name - extension name"""
+
+ return 'include::{{appendices}}/{}[]'.format(
+ self.extension_file_path(name))
+
+ @property
+ def provisional_extension_warning(self):
+ """Return True if a warning should be included in extension
+ appendices for provisional extensions."""
+ return True
+
+ @property
+ def generated_include_path(self):
+ """Return path relative to the generated reference pages, to the
+ generated API include files."""
+
+ return '{generated}'
+
+ @property
+ def include_extension_appendix_in_refpage(self):
+ """Return True if generating extension refpages by embedding
+ extension appendix content (default), False otherwise
+ (OpenXR)."""
+
+ return True
+
+ def valid_flag_bit(self, bitpos):
+ """Return True if bitpos is an allowed numeric bit position for
+ an API flag.
+
+ Behavior depends on the data type used for flags (which may be 32
+ or 64 bits), and may depend on assumptions about compiler
+ handling of sign bits in enumerated types, as well."""
+ return True
+
+ @property
+ def duplicate_aliased_structs(self):
+ """
+ Should aliased structs have the original struct definition listed in the
+ generated docs snippet?
+ """
+ return False
+
+ @property
+ def protectProtoComment(self):
+ """Return True if generated #endif should have a comment matching
+ the protection symbol used in the opening #ifdef/#ifndef."""
+ return False
+
+ @property
+ def extra_refpage_headers(self):
+ """Return any extra headers (preceding the title) for generated
+ reference pages."""
+ return ''
+
+ @property
+ def extra_refpage_body(self):
+ """Return any extra text (following the title) for generated
+ reference pages."""
+ return ''
+
+ def is_api_version_name(self, name):
+ """Return True if name is an API version name."""
+
+ return API_VERSION_NAME_RE.match(name) is not None
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/data_structures.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/data_structures.py
new file mode 100644
index 00000000000..f2808cf1e1b
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/data_structures.py
@@ -0,0 +1,58 @@
+#!/usr/bin/python3 -i
+#
+# Copyright (c) 2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+"""Provides general-purpose data structures."""
+
+
+class DictOfStringSets:
+ """A dictionary where the values are sets of strings.
+
+ Has some convenience functions to allow easier maintenance via
+ the .add method."""
+
+ def __init__(self, d=None):
+ self.d = {}
+ if d:
+ for k, v in d.items():
+ self.add(k, v)
+
+ def __getitem__(self, k):
+ return self.d[k]
+
+ def __contains__(self, k):
+ return k in self.d
+
+ def get(self, k, default=None):
+ return self.d.get(k, default)
+
+ def get_dict(self):
+ return self.d
+
+ def items(self):
+ """Return an iterator like dict().items()."""
+ return self.d.items()
+
+ def keys(self):
+ """Return an iterator over keys."""
+ return self.d.keys()
+
+ def values(self):
+ """Return an iterator over values."""
+ return self.d.values()
+
+ def add_key(self, k):
+ """Ensure the set for the given key exists."""
+ if k not in self.d:
+ self.d[k] = set()
+
+ def add(self, k, v):
+ self.add_key(k)
+ if isinstance(v, str):
+ v = (v, )
+ if not isinstance(v, set):
+ v = set(v)
+ self.d[k].update(v)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/entity_db.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/entity_db.py
new file mode 100644
index 00000000000..a6850069c8d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/entity_db.py
@@ -0,0 +1,666 @@
+"""Provides EntityDatabase, a class that keeps track of spec-defined entities and associated macros."""
+
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+
+from abc import ABC, abstractmethod
+
+from .shared import (CATEGORIES_WITH_VALIDITY, EXTENSION_CATEGORY,
+ NON_EXISTENT_MACROS, EntityData)
+from .util import getElemName
+
+
+def _entityToDict(data):
+ return {
+ 'macro': data.macro,
+ 'filename': data.filename,
+ 'category': data.category,
+ 'directory': data.directory
+ }
+
+
+class EntityDatabase(ABC):
+ """Parsed and processed information from the registry XML.
+
+ Must be subclasses for each specific API.
+ """
+
+ ###
+ # Methods that must be implemented in subclasses.
+ ###
+ @abstractmethod
+ def makeRegistry(self):
+ """Return a Registry object that has already had loadFile() and parseTree() called.
+
+ Called only once during construction.
+ """
+ raise NotImplementedError
+
+ @abstractmethod
+ def getNamePrefix(self):
+ """Return the (two-letter) prefix of all entity names for this API.
+
+ Called only once during construction.
+ """
+ raise NotImplementedError
+
+ @abstractmethod
+ def getPlatformRequires(self):
+ """Return the 'requires' string associated with external/platform definitions.
+
+ This is the string found in the requires attribute of the XML for entities that
+ are externally defined in a platform include file, like the question marks in:
+
+ <type requires="???" name="int8_t"/>
+
+ In Vulkan, this is 'vk_platform'.
+
+ Called only once during construction.
+ """
+ raise NotImplementedError
+
+ ###
+ # Methods that it is optional to **override**
+ ###
+ def getSystemTypes(self):
+ """Return an enumerable of strings that name system types.
+
+ System types use the macro `code`, and they do not generate API/validity includes.
+
+ Called only once during construction.
+ """
+ return []
+
+ def getGeneratedDirs(self):
+ """Return a sequence of strings that are the subdirectories of generates API includes.
+
+ Called only once during construction.
+ """
+ return ['basetypes',
+ 'defines',
+ 'enums',
+ 'flags',
+ 'funcpointers',
+ 'handles',
+ 'protos',
+ 'structs']
+
+ def populateMacros(self):
+ """Perform API-specific calls, if any, to self.addMacro() and self.addMacros().
+
+ It is recommended to implement/override this and call
+ self.addMacros(..., ..., [..., "flags"]),
+ since the base implementation, in _basicPopulateMacros(),
+ does not add any macros as pertaining to the category "flags".
+
+ Called only once during construction.
+ """
+ pass
+
+ def populateEntities(self):
+ """Perform API-specific calls, if any, to self.addEntity()."""
+ pass
+
+ def getEntitiesWithoutValidity(self):
+ """Return an enumerable of entity names that do not generate validity includes."""
+ return [self.mixed_case_name_prefix +
+ x for x in ['BaseInStructure', 'BaseOutStructure']]
+
+ def getExclusionSet(self):
+ """Return a set of "support=" attribute strings that should not be included in the database.
+
+ Called only during construction."""
+ return set(('disabled',))
+
+ ###
+ # Methods that it is optional to **extend**
+ ###
+ def handleType(self, name, info, requires):
+ """Add entities, if appropriate, for an item in registry.typedict.
+
+ Called at construction for every name, info in registry.typedict.items()
+ not immediately skipped,
+ to perform the correct associated addEntity() call, if applicable.
+ The contents of the requires attribute, if any, is passed in requires.
+
+ May be extended by API-specific code to handle some cases preferentially,
+ then calling the super implementation to handle the rest.
+ """
+ if requires == self.platform_requires:
+ # Ah, no, don't skip this, it's just in the platform header file.
+ # TODO are these code or basetype?
+ self.addEntity(name, 'code', elem=info.elem, generates=False)
+ return
+
+ protect = info.elem.get('protect')
+ if protect:
+ self.addEntity(protect, 'dlink',
+ category='configdefines', generates=False)
+
+ alias = info.elem.get('alias')
+ if alias:
+ self.addAlias(name, alias)
+
+ cat = info.elem.get('category')
+ if cat == 'struct':
+ self.addEntity(name, 'slink', elem=info.elem)
+
+ elif cat == 'union':
+ # TODO: is this right?
+ self.addEntity(name, 'slink', elem=info.elem)
+
+ elif cat == 'enum':
+ self.addEntity(
+ name, 'elink', elem=info.elem)
+
+ elif cat == 'handle':
+ self.addEntity(name, 'slink', elem=info.elem,
+ category='handles')
+
+ elif cat == 'bitmask':
+ self.addEntity(
+ name, 'tlink', elem=info.elem, category='flags')
+
+ elif cat == 'basetype':
+ self.addEntity(name, 'basetype',
+ elem=info.elem)
+
+ elif cat == 'define':
+ self.addEntity(name, 'dlink', elem=info.elem)
+
+ elif cat == 'funcpointer':
+ self.addEntity(name, 'tlink', elem=info.elem)
+
+ elif cat == 'include':
+ # skip
+ return
+
+ elif cat is None:
+ self.addEntity(name, 'code', elem=info.elem, generates=False)
+
+ else:
+ raise RuntimeError('unrecognized category {}'.format(cat))
+
+ def handleCommand(self, name, info):
+ """Add entities, if appropriate, for an item in registry.cmddict.
+
+ Called at construction for every name, info in registry.cmddict.items().
+ Calls self.addEntity() accordingly.
+ """
+ self.addEntity(name, 'flink', elem=info.elem,
+ category='commands', directory='protos')
+
+ def handleExtension(self, name, info):
+ """Add entities, if appropriate, for an item in registry.extdict.
+
+ Called at construction for every name, info in registry.extdict.items().
+ Calls self.addEntity() accordingly.
+ """
+ if info.supported in self._supportExclusionSet:
+ # Don't populate with disabled extensions.
+ return
+
+ # Only get the protect strings and name from extensions
+
+ self.addEntity(name, None, category=EXTENSION_CATEGORY,
+ generates=False)
+ protect = info.elem.get('protect')
+ if protect:
+ self.addEntity(protect, 'dlink',
+ category='configdefines', generates=False)
+
+ def handleEnumValue(self, name, info):
+ """Add entities, if appropriate, for an item in registry.enumdict.
+
+ Called at construction for every name, info in registry.enumdict.items().
+ Calls self.addEntity() accordingly.
+ """
+ self.addEntity(name, 'ename', elem=info.elem,
+ category='enumvalues', generates=False)
+
+ ###
+ # END of methods intended to be implemented, overridden, or extended in child classes!
+ ###
+
+ ###
+ # Accessors
+ ###
+ def findMacroAndEntity(self, macro, entity):
+ """Look up EntityData by macro and entity pair.
+
+ Does **not** resolve aliases."""
+ return self._byMacroAndEntity.get((macro, entity))
+
+ def findEntity(self, entity):
+ """Look up EntityData by entity name (case-sensitive).
+
+ If it fails, it will try resolving aliases.
+ """
+ result = self._byEntity.get(entity)
+ if result:
+ return result
+
+ alias_set = self._aliasSetsByEntity.get(entity)
+ if alias_set:
+ for alias in alias_set:
+ if alias in self._byEntity:
+ return self.findEntity(alias)
+
+ assert(not "Alias without main entry!")
+
+ return None
+
+ def findEntityCaseInsensitive(self, entity):
+ """Look up EntityData by entity name (case-insensitive).
+
+ Does **not** resolve aliases."""
+ return self._byLowercaseEntity.get(entity.lower())
+
+ def getMemberElems(self, commandOrStruct):
+ """Given a command or struct name, retrieve the ETree elements for each member/param.
+
+ Returns None if the entity is not found or doesn't have members/params.
+ """
+ data = self.findEntity(commandOrStruct)
+
+ if not data:
+ return None
+ if data.elem is None:
+ return None
+ if data.macro == 'slink':
+ tag = 'member'
+ else:
+ tag = 'param'
+ return data.elem.findall('.//{}'.format(tag))
+
+ def getMemberNames(self, commandOrStruct):
+ """Given a command or struct name, retrieve the names of each member/param.
+
+ Returns an empty list if the entity is not found or doesn't have members/params.
+ """
+ members = self.getMemberElems(commandOrStruct)
+ if not members:
+ return []
+ ret = []
+ for member in members:
+ name_tag = member.find('name')
+ if name_tag:
+ ret.append(name_tag.text)
+ return ret
+
+ def getEntityJson(self):
+ """Dump the internal entity dictionary to JSON for debugging."""
+ import json
+ d = {entity: _entityToDict(data)
+ for entity, data in self._byEntity.items()}
+ return json.dumps(d, sort_keys=True, indent=4)
+
+ def entityHasValidity(self, entity):
+ """Estimate if we expect to see a validity include for an entity name.
+
+ Returns None if the entity name is not known,
+ otherwise a boolean: True if a validity include is expected.
+
+ Related to Generator.isStructAlwaysValid.
+ """
+ data = self.findEntity(entity)
+ if not data:
+ return None
+
+ if entity in self.entities_without_validity:
+ return False
+
+ if data.category == 'protos':
+ # All protos have validity
+ return True
+
+ if data.category not in CATEGORIES_WITH_VALIDITY:
+ return False
+
+ # Handle structs here.
+ members = self.getMemberElems(entity)
+ if not members:
+ return None
+ for member in members:
+ member_name = getElemName(member)
+ member_type = member.find('type').text
+ member_category = member.get('category')
+
+ if member_name in ('next', 'type'):
+ return True
+
+ if member_type in ('void', 'char'):
+ return True
+
+ if member.get('noautovalidity'):
+ # Not generating validity for this member, skip it
+ continue
+
+ if member.get('len'):
+ # Array
+ return True
+
+ typetail = member.find('type').tail
+ if typetail and '*' in typetail:
+ # Pointer
+ return True
+
+ if member_category in ('handle', 'enum', 'bitmask'):
+ return True
+
+ if member.get('category') in ('struct', 'union') \
+ and self.entityHasValidity(member_type):
+ # struct or union member - recurse
+ return True
+
+ # Got this far - no validity needed
+ return False
+
+ def entityGenerates(self, entity_name):
+ """Return True if the named entity generates include file(s)."""
+ return entity_name in self._generating_entities
+
+ @property
+ def generating_entities(self):
+ """Return a sequence of all generating entity names."""
+ return self._generating_entities.keys()
+
+ def shouldBeRecognized(self, macro, entity_name):
+ """Determine, based on the macro and the name provided, if we should expect to recognize the entity.
+
+ True if it is linked. Specific APIs may also provide additional cases where it is True."""
+ return self.isLinkedMacro(macro)
+
+ def likelyRecognizedEntity(self, entity_name):
+ """Guess (based on name prefix alone) if an entity is likely to be recognized."""
+ return entity_name.lower().startswith(self.name_prefix)
+
+ def isLinkedMacro(self, macro):
+ """Identify if a macro is considered a "linked" macro."""
+ return macro in self._linkedMacros
+
+ def isValidMacro(self, macro):
+ """Identify if a macro is known and valid."""
+ if macro not in self._categoriesByMacro:
+ return False
+
+ return macro not in NON_EXISTENT_MACROS
+
+ def getCategoriesForMacro(self, macro):
+ """Identify the categories associated with a (known, valid) macro."""
+ if macro in self._categoriesByMacro:
+ return self._categoriesByMacro[macro]
+ return None
+
+ def areAliases(self, first_entity_name, second_entity_name):
+ """Return true if the two entity names are equivalent (aliases of each other)."""
+ alias_set = self._aliasSetsByEntity.get(first_entity_name)
+ if not alias_set:
+ # If this assert fails, we have goofed in addAlias
+ assert(second_entity_name not in self._aliasSetsByEntity)
+
+ return False
+
+ return second_entity_name in alias_set
+
+ @property
+ def macros(self):
+ """Return the collection of all known entity-related markup macros."""
+ return self._categoriesByMacro.keys()
+
+ def childTypes(self, typename):
+ """Return the list of types specifying typename as their parent type."""
+ children = [childname
+ for childname, entity in self._byEntity.items()
+ if entity.elem is not None and entity.elem.get("parentstruct") == typename]
+ return children
+
+ ###
+ # Methods only used during initial setup/population of this data structure
+ ###
+ def addMacro(self, macro, categories, link=False):
+ """Add a single markup macro to the collection of categories by macro.
+
+ Also adds the macro to the set of linked macros if link=True.
+
+ If a macro has already been supplied to a call, later calls for that macro have no effect.
+ """
+ if macro in self._categoriesByMacro:
+ return
+ self._categoriesByMacro[macro] = categories
+ if link:
+ self._linkedMacros.add(macro)
+
+ def addMacros(self, letter, macroTypes, categories):
+ """Add markup macros associated with a leading letter to the collection of categories by macro.
+
+ Also, those macros created using 'link' in macroTypes will also be added to the set of linked macros.
+
+ Basically automates a number of calls to addMacro().
+ """
+ for macroType in macroTypes:
+ macro = letter + macroType
+ self.addMacro(macro, categories, link=(macroType == 'link'))
+
+ def addAlias(self, entityName, aliasName):
+ """Record that entityName is an alias for aliasName."""
+ # See if we already have something with this as the alias.
+ alias_set = self._aliasSetsByEntity.get(aliasName)
+ other_alias_set = self._aliasSetsByEntity.get(entityName)
+ if alias_set and other_alias_set:
+ # If this fails, we need to merge sets and update.
+ assert(alias_set is other_alias_set)
+
+ if not alias_set:
+ # Try looking by the other name.
+ alias_set = other_alias_set
+
+ if not alias_set:
+ # Nope, this is a new set.
+ alias_set = set()
+ self._aliasSets.append(alias_set)
+
+ # Add both names to the set
+ alias_set.add(entityName)
+ alias_set.add(aliasName)
+
+ # Associate the set with each name
+ self._aliasSetsByEntity[aliasName] = alias_set
+ self._aliasSetsByEntity[entityName] = alias_set
+
+ def addEntity(self, entityName, macro, category=None, elem=None,
+ generates=None, directory=None, filename=None):
+ """Add an entity (command, structure type, enum, enum value, etc) in the database.
+
+ If an entityName has already been supplied to a call, later calls for that entityName have no effect.
+
+ Arguments:
+ entityName -- the name of the entity.
+ macro -- the macro (without the trailing colon) that should be used to refer to this entity.
+
+ Optional keyword arguments:
+ category -- If not manually specified, looked up based on the macro.
+ elem -- The ETree element associated with the entity in the registry XML.
+ generates -- Indicates whether this entity generates api and validity include files.
+ Default depends on directory (or if not specified, category).
+ directory -- The directory that include files (under api/ and validity/) are generated in.
+ If not specified (and generates is True), the default is the same as the category,
+ which is almost always correct.
+ filename -- The relative filename (under api/ or validity/) where includes are generated for this.
+ This only matters if generates is True (default). If not specified and generates is True,
+ one will be generated based on directory and entityName.
+ """
+ # Probably dealt with in handleType(), but just in case it wasn't.
+ if elem is not None:
+ alias = elem.get('alias')
+ if alias:
+ self.addAlias(entityName, alias)
+
+ if entityName in self._byEntity:
+ # skip if already recorded.
+ return
+
+ # Look up category based on the macro, if category isn't specified.
+ if category is None:
+ category = self._categoriesByMacro.get(macro)[0]
+
+ if generates is None:
+ potential_dir = directory or category
+ generates = potential_dir in self._generated_dirs
+
+ # If directory isn't specified and this entity generates,
+ # the directory is the same as the category.
+ if directory is None and generates:
+ directory = category
+
+ # Don't generate a filename if this entity doesn't generate includes.
+ if filename is None and generates:
+ filename = f'{directory}/{entityName}.adoc'
+
+ data = EntityData(
+ entity=entityName,
+ macro=macro,
+ elem=elem,
+ filename=filename,
+ category=category,
+ directory=directory
+ )
+ if entityName.lower() not in self._byLowercaseEntity:
+ self._byLowercaseEntity[entityName.lower()] = []
+
+ self._byEntity[entityName] = data
+ self._byLowercaseEntity[entityName.lower()].append(data)
+ self._byMacroAndEntity[(macro, entityName)] = data
+ if generates and filename is not None:
+ self._generating_entities[entityName] = data
+
+ def __init__(self):
+ """Constructor: Do not extend or override.
+
+ Changing the behavior of other parts of this logic should be done by
+ implementing, extending, or overriding (as documented):
+
+ - Implement makeRegistry()
+ - Implement getNamePrefix()
+ - Implement getPlatformRequires()
+ - Override getSystemTypes()
+ - Override populateMacros()
+ - Override populateEntities()
+ - Extend handleType()
+ - Extend handleCommand()
+ - Extend handleExtension()
+ - Extend handleEnumValue()
+ """
+ # Internal data that we don't want consumers of the class touching for fear of
+ # breaking invariants
+ self._byEntity = {}
+ self._byLowercaseEntity = {}
+ self._byMacroAndEntity = {}
+ self._categoriesByMacro = {}
+ self._linkedMacros = set()
+ self._aliasSetsByEntity = {}
+ self._aliasSets = []
+
+ self._registry = None
+
+ # Retrieve from subclass, if overridden, then store locally.
+ self._supportExclusionSet = set(self.getExclusionSet())
+
+ # Entities that get a generated/api/category/entity.adoc file.
+ self._generating_entities = {}
+
+ # Name prefix members
+ self.name_prefix = self.getNamePrefix().lower()
+ self.mixed_case_name_prefix = self.name_prefix[:1].upper(
+ ) + self.name_prefix[1:]
+ # Regex string for the name prefix that is case-insensitive.
+ self.case_insensitive_name_prefix_pattern = ''.join(
+ ('[{}{}]'.format(c.upper(), c) for c in self.name_prefix))
+
+ self.platform_requires = self.getPlatformRequires()
+
+ self._generated_dirs = set(self.getGeneratedDirs())
+
+ # Note: Default impl requires self.mixed_case_name_prefix
+ self.entities_without_validity = set(self.getEntitiesWithoutValidity())
+
+ # TODO: Where should flags actually go? Not mentioned in the style guide.
+ # TODO: What about flag wildcards? There are a few such uses...
+
+ # Abstract method: subclass must implement to define macros for flags
+ self.populateMacros()
+
+ # Now, do default macro population
+ self._basicPopulateMacros()
+
+ # Abstract method: subclass must implement to add any "not from the registry" (and not system type)
+ # entities
+ self.populateEntities()
+
+ # Now, do default entity population
+ self._basicPopulateEntities(self.registry)
+
+ ###
+ # Methods only used internally during initial setup/population of this data structure
+ ###
+ @property
+ def registry(self):
+ """Return a Registry."""
+ if not self._registry:
+ self._registry = self.makeRegistry()
+ return self._registry
+
+ def _basicPopulateMacros(self):
+ """Contains calls to self.addMacro() and self.addMacros().
+
+ If you need to change any of these, do so in your override of populateMacros(),
+ which will be called first.
+ """
+ self.addMacro('basetype', ['basetypes'])
+ self.addMacro('code', ['code'])
+ self.addMacros('f', ['link', 'name', 'text'], ['protos'])
+ self.addMacros('s', ['link', 'name', 'text'], ['structs', 'handles'])
+ self.addMacros('e', ['link', 'name', 'text'], ['enums'])
+ self.addMacros('p', ['name', 'text'], ['parameter', 'member'])
+ self.addMacros('t', ['link', 'name'], ['funcpointers'])
+ self.addMacros('d', ['link', 'name'], ['defines', 'configdefines'])
+
+ for macro in NON_EXISTENT_MACROS:
+ # Still search for them
+ self.addMacro(macro, None)
+
+ def _basicPopulateEntities(self, registry):
+ """Contains typical calls to self.addEntity().
+
+ If you need to change any of these, do so in your override of populateEntities(),
+ which will be called first.
+ """
+ system_types = set(self.getSystemTypes())
+ for t in system_types:
+ self.addEntity(t, 'code', generates=False)
+
+ for name, info in registry.typedict.items():
+ if name in system_types:
+ # We already added these.
+ continue
+
+ requires = info.elem.get('requires')
+
+ if requires and not requires.lower().startswith(self.name_prefix):
+ # This is an externally-defined type, will skip it.
+ continue
+
+ # OK, we might actually add an entity here
+ self.handleType(name=name, info=info, requires=requires)
+
+ for name, info in registry.enumdict.items():
+ self.handleEnumValue(name, info)
+
+ for name, info in registry.cmddict.items():
+ self.handleCommand(name, info)
+
+ for name, info in registry.extdict.items():
+ self.handleExtension(name, info)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/file_process.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/file_process.py
new file mode 100644
index 00000000000..f0d4c608197
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/file_process.py
@@ -0,0 +1,119 @@
+#!/usr/bin/python3
+#
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+"Utilities for processing files."
+
+from pathlib import Path
+
+
+class LinewiseFileProcessor:
+ """A base class for code that processes an input file (or file handle) one line at a time."""
+
+ def __init__(self):
+ self._lines = []
+ self._line_num = 0
+ self._next_line = None
+ self._line = ''
+ self._filename = Path()
+
+ @property
+ def filename(self):
+ """The Path object of the currently processed file"""
+ return self._filename
+
+ @property
+ def relative_filename(self):
+ """The current file's Path relative to the current working directory"""
+ return self.filename.relative_to(Path('.').resolve())
+
+ @property
+ def line(self):
+ """The current line, including any trailing whitespace and the line ending."""
+ return self._line
+
+ @property
+ def line_number(self):
+ """Get 1-indexed line number."""
+ return self._line_num
+
+ @property
+ def line_rstripped(self):
+ """The current line without any trailing whitespace."""
+ if self.line is None:
+ return None
+ return self.line.rstrip()
+
+ @property
+ def trailing_whitespace(self):
+ """The trailing whitespace of the current line that gets removed when accessing rstrippedLine"""
+ non_whitespace_length = len(self.line_rstripped)
+ return self.line[non_whitespace_length:]
+
+ @property
+ def next_line(self):
+ """Peek at the next line, if any."""
+ return self._next_line
+
+ @property
+ def next_line_rstripped(self):
+ """Peek at the next line, if any, without any trailing whitespace."""
+ if self.next_line is None:
+ return None
+ return self.next_line.rstrip()
+
+ def get_preceding_line(self, relative_index=-1):
+ """Retrieve the line at an line number at the given relative index, if one exists. Returns None if there is no line there."""
+ if relative_index >= 0:
+ raise RuntimeError(
+ 'relativeIndex must be negative, to retrieve a preceding line.')
+ if relative_index + self.line_number <= 0:
+ # There is no line at this index
+ return None
+ return self._lines[self.line_number + relative_index - 1]
+
+ def get_preceding_lines(self, num):
+ """Get *up to* the preceding num lines. Fewer may be returned if the requested number aren't available."""
+ return self._lines[- (num + 1):-1]
+
+ def process_line(self, line_num, line):
+ """Implement in your subclass to handle each new line."""
+ raise NotImplementedError
+
+ def _process_file_handle(self, file_handle):
+ # These are so we can process one line earlier than we're actually iterating thru.
+ processing_line_num = None
+ processing_line = None
+
+ def do_process_line():
+ self._line_num = processing_line_num
+ self._line = processing_line
+ if processing_line is not None:
+ self._lines.append(processing_line)
+ self.process_line(processing_line_num, processing_line)
+
+ for line_num, line in enumerate(file_handle, 1):
+ self._next_line = line
+ do_process_line()
+ processing_line_num = line_num
+ processing_line = line
+
+ # Finally process the left-over line
+ self._next_line = None
+ do_process_line()
+
+ def process_file(self, filename, file_handle=None):
+ """Main entry point - call with a filename and optionally the file handle to read from."""
+ if isinstance(filename, str):
+ filename = Path(filename).resolve()
+
+ self._filename = filename
+
+ if file_handle:
+ self._process_file_handle(file_handle)
+ else:
+ with self._filename.open('r', encoding='utf-8') as f:
+ self._process_file_handle(f)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/html_printer.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/html_printer.py
new file mode 100644
index 00000000000..3ec87afeeeb
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/html_printer.py
@@ -0,0 +1,436 @@
+"""Defines HTMLPrinter, a BasePrinter subclass for a single-page HTML results file."""
+
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+
+import html
+import re
+from collections import namedtuple
+
+from .base_printer import BasePrinter, getColumn
+from .shared import (MessageContext, MessageType, generateInclude,
+ getHighlightedRange)
+
+# Bootstrap styles (for constructing CSS class names) associated with MessageType values.
+MESSAGE_TYPE_STYLES = {
+ MessageType.ERROR: 'danger',
+ MessageType.WARNING: 'warning',
+ MessageType.NOTE: 'secondary'
+}
+
+
+# HTML Entity for a little emoji-icon associated with MessageType values.
+MESSAGE_TYPE_ICONS = {
+ MessageType.ERROR: '&#x2297;', # makeIcon('times-circle'),
+ MessageType.WARNING: '&#9888;', # makeIcon('exclamation-triangle'),
+ MessageType.NOTE: '&#x2139;' # makeIcon('info-circle')
+}
+
+LINK_ICON = '&#128279;' # link icon
+
+
+class HTMLPrinter(BasePrinter):
+ """Implementation of BasePrinter for generating diagnostic reports in HTML format.
+
+ Generates a single file containing neatly-formatted messages.
+
+ The HTML file loads Bootstrap 4 as well as 'prism' syntax highlighting from CDN.
+ """
+
+ def __init__(self, filename):
+ """Construct by opening the file."""
+ self.f = open(filename, 'w', encoding='utf-8')
+ self.f.write("""<!doctype html>
+ <html lang="en"><head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/themes/prism.min.css" integrity="sha256-N1K43s+8twRa+tzzoF3V8EgssdDiZ6kd9r8Rfgg8kZU=" crossorigin="anonymous" />
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/plugins/line-numbers/prism-line-numbers.min.css" integrity="sha256-Afz2ZJtXw+OuaPX10lZHY7fN1+FuTE/KdCs+j7WZTGc=" crossorigin="anonymous" />
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/plugins/line-highlight/prism-line-highlight.min.css" integrity="sha256-FFGTaA49ZxFi2oUiWjxtTBqoda+t1Uw8GffYkdt9aco=" crossorigin="anonymous" />
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
+ <style>
+ pre {
+ overflow-x: scroll;
+ white-space: nowrap;
+ }
+ </style>
+ <title>check_spec_links results</title>
+ </head>
+ <body>
+ <div class="container">
+ <h1><code>check_spec_links.py</code> Scan Results</h1>
+ """)
+ #
+ self.filenameTransformer = re.compile(r'[^\w]+')
+ self.fileRange = {}
+ self.fileLines = {}
+ self.backLink = namedtuple(
+ 'BackLink', ['lineNum', 'col', 'end_col', 'target', 'tooltip', 'message_type'])
+ self.fileBackLinks = {}
+
+ self.nextAnchor = 0
+ super().__init__()
+
+ def close(self):
+ """Write the tail end of the file and close it."""
+ self.f.write("""
+ </div>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/prism.min.js" integrity="sha256-jc6y1s/Y+F+78EgCT/lI2lyU7ys+PFYrRSJ6q8/R8+o=" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/plugins/keep-markup/prism-keep-markup.min.js" integrity="sha256-mP5i3m+wTxxOYkH+zXnKIG5oJhXLIPQYoiicCV1LpkM=" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/components/prism-asciidoc.min.js" integrity="sha256-NHPE1p3VBIdXkmfbkf/S0hMA6b4Ar4TAAUlR+Rlogoc=" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/plugins/line-numbers/prism-line-numbers.min.js" integrity="sha256-JfF9MVfGdRUxzT4pecjOZq6B+F5EylLQLwcQNg+6+Qk=" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/plugins/line-highlight/prism-line-highlight.min.js" integrity="sha256-DEl9ZQE+lseY13oqm2+mlUr+sVI18LG813P+kzzIm8o=" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/esm/popper.min.js" integrity="sha256-T0gPN+ySsI9ixTd/1ciLl2gjdLJLfECKvkQjJn98lOs=" crossorigin="anonymous"></script>
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
+ <script>
+ $(function () {
+ $('[data-toggle="tooltip"]').tooltip();
+ function autoExpand() {
+ var hash = window.location.hash;
+ if (!hash) {
+ return;
+ }
+ $(hash).parents().filter('.collapse').collapse('show');
+ }
+ window.addEventListener('hashchange', autoExpand);
+ $(document).ready(autoExpand);
+ $('.accordion').on('shown.bs.collapse', function(e) {
+ e.target.parentNode.scrollIntoView();
+ })
+ })
+ </script>
+ </body></html>
+ """)
+ self.f.close()
+
+ ###
+ # Output methods: these all write to the HTML file.
+ def outputResults(self, checker, broken_links=True,
+ missing_includes=False):
+ """Output the full results of a checker run.
+
+ Includes the diagnostics, broken links (if desired),
+ missing includes (if desired), and excerpts of all files with diagnostics.
+ """
+ self.output(checker)
+ self.outputBrokenAndMissing(
+ checker, broken_links=broken_links, missing_includes=missing_includes)
+
+ self.f.write("""
+ <div class="container">
+ <h2>Excerpts of referenced files</h2>""")
+ for fn in self.fileRange:
+ self.outputFileExcerpt(fn)
+ self.f.write('</div><!-- .container -->\n')
+
+ def outputChecker(self, checker):
+ """Output the contents of a MacroChecker object.
+
+ Starts and ends the accordion populated by outputCheckerFile().
+ """
+ self.f.write(
+ '<div class="container"><h2>Per-File Warnings and Errors</h2>\n')
+ self.f.write('<div class="accordion" id="fileAccordion">\n')
+ super(HTMLPrinter, self).outputChecker(checker)
+ self.f.write("""</div><!-- #fileAccordion -->
+ </div><!-- .container -->\n""")
+
+ def outputCheckerFile(self, fileChecker):
+ """Output the contents of a MacroCheckerFile object.
+
+ Stashes the lines of the file for later excerpts,
+ and outputs any diagnostics in an accordion card.
+ """
+ # Save lines for later
+ self.fileLines[fileChecker.filename] = fileChecker.lines
+
+ if not fileChecker.numDiagnostics():
+ return
+
+ self.f.write("""
+ <div class="card">
+ <div class="card-header" id="{id}-file-heading">
+ <div class="row">
+ <div class="col">
+ <button data-target="#collapse-{id}" class="btn btn-link btn-primary mb-0 collapsed" type="button" data-toggle="collapse" aria-expanded="false" aria-controls="collapse-{id}">
+ {relativefn}
+ </button>
+ </div>
+ """.format(id=self.makeIdentifierFromFilename(fileChecker.filename), relativefn=html.escape(self.getRelativeFilename(fileChecker.filename))))
+ self.f.write('<div class="col-1">')
+ warnings = fileChecker.numMessagesOfType(MessageType.WARNING)
+ if warnings > 0:
+ self.f.write("""<span class="badge badge-warning" data-toggle="tooltip" title="{num} warnings in this file">
+ {icon}
+ {num}<span class="sr-only"> warnings</span></span>""".format(num=warnings, icon=MESSAGE_TYPE_ICONS[MessageType.WARNING]))
+ self.f.write('</div>\n<div class="col-1">')
+ errors = fileChecker.numMessagesOfType(MessageType.ERROR)
+ if errors > 0:
+ self.f.write("""<span class="badge badge-danger" data-toggle="tooltip" title="{num} errors in this file">
+ {icon}
+ {num}<span class="sr-only"> errors</span></span>""".format(num=errors, icon=MESSAGE_TYPE_ICONS[MessageType.ERROR]))
+ self.f.write("""
+ </div><!-- .col-1 -->
+ </div><!-- .row -->
+ </div><!-- .card-header -->
+ <div id="collapse-{id}" class="collapse" aria-labelledby="{id}-file-heading" data-parent="#fileAccordion">
+ <div class="card-body">
+ """.format(id=self.makeIdentifierFromFilename(fileChecker.filename)))
+ super(HTMLPrinter, self).outputCheckerFile(fileChecker)
+
+ self.f.write("""
+ </div><!-- .card-body -->
+ </div><!-- .collapse -->
+ </div><!-- .card -->
+ <!-- ..................................... -->
+ """)
+
+ def outputMessage(self, msg):
+ """Output a Message."""
+ anchor = self.getUniqueAnchor()
+
+ self.recordUsage(msg.context,
+ linkBackTarget=anchor,
+ linkBackTooltip='{}: {} [...]'.format(
+ msg.message_type, msg.message[0]),
+ linkBackType=msg.message_type)
+
+ self.f.write("""
+ <div class="card">
+ <div class="card-body">
+ <h5 class="card-header bg bg-{style}" id="{anchor}">{icon} {t} Line {lineNum}, Column {col} (-{arg})</h5>
+ <p class="card-text">
+ """.format(
+ anchor=anchor,
+ icon=MESSAGE_TYPE_ICONS[msg.message_type],
+ style=MESSAGE_TYPE_STYLES[msg.message_type],
+ t=self.formatBrief(msg.message_type),
+ lineNum=msg.context.lineNum,
+ col=getColumn(msg.context),
+ arg=msg.message_id.enable_arg()))
+ self.f.write(self.formatContext(msg.context))
+ self.f.write('<br/>')
+ for line in msg.message:
+ self.f.write(html.escape(line))
+ self.f.write('<br />\n')
+ self.f.write('</p>\n')
+ if msg.see_also:
+ self.f.write('<p>See also:</p><ul>\n')
+ for see in msg.see_also:
+ if isinstance(see, MessageContext):
+ self.f.write(
+ '<li>{}</li>\n'.format(self.formatContext(see)))
+ self.recordUsage(see,
+ linkBackTarget=anchor,
+ linkBackType=MessageType.NOTE,
+ linkBackTooltip='see-also associated with {} at {}'.format(msg.message_type, self.formatContextBrief(see)))
+ else:
+ self.f.write('<li>{}</li>\n'.format(self.formatBrief(see)))
+ self.f.write('</ul>')
+ if msg.replacement is not None:
+ self.f.write(
+ '<div class="alert alert-primary">Hover the highlight text to view suggested replacement.</div>')
+ if msg.fix is not None:
+ self.f.write(
+ '<div class="alert alert-info">Note: Auto-fix available.</div>')
+ if msg.script_location:
+ self.f.write(
+ '<p>Message originated at <code>{}</code></p>'.format(msg.script_location))
+ self.f.write('<pre class="line-numbers language-asciidoc" data-start="{}"><code>'.format(
+ msg.context.lineNum))
+ highlightStart, highlightEnd = getHighlightedRange(msg.context)
+ self.f.write(html.escape(msg.context.line[:highlightStart]))
+ self.f.write(
+ '<span class="border border-{}"'.format(MESSAGE_TYPE_STYLES[msg.message_type]))
+ if msg.replacement is not None:
+ self.f.write(
+ ' data-toggle="tooltip" title="{}"'.format(msg.replacement))
+ self.f.write('>')
+ self.f.write(html.escape(
+ msg.context.line[highlightStart:highlightEnd]))
+ self.f.write('</span>')
+ self.f.write(html.escape(msg.context.line[highlightEnd:]))
+ self.f.write('</code></pre></div></div>')
+
+ def outputBrokenLinks(self, checker, broken):
+ """Output a table of broken links.
+
+ Called by self.outputBrokenAndMissing() if requested.
+ """
+ self.f.write("""
+ <div class="container">
+ <h2>Missing Referenced API Includes</h2>
+ <p>Items here have been referenced by a linking macro, so these are all broken links in the spec!</p>
+ <table class="table table-striped">
+ <thead>
+ <th scope="col">Add line to include this file</th>
+ <th scope="col">or add this macro instead</th>
+ <th scope="col">Links to this entity</th></thead>
+ """)
+
+ for entity_name, uses in sorted(broken.items()):
+ category = checker.findEntity(entity_name).category
+ anchor = self.getUniqueAnchor()
+ asciidocAnchor = '[[{}]]'.format(entity_name)
+ include = generateInclude(dir_traverse='../../generated/',
+ generated_type='api',
+ category=category,
+ entity=entity_name)
+ self.f.write("""
+ <tr id={}>
+ <td><code class="text-dark language-asciidoc">{}</code></td>
+ <td><code class="text-dark">{}</code></td>
+ <td><ul class="list-inline">
+ """.format(anchor, include, asciidocAnchor))
+ for context in uses:
+ self.f.write(
+ '<li class="list-inline-item">{}</li>'.format(self.formatContext(context, MessageType.NOTE)))
+ self.recordUsage(
+ context,
+ linkBackTooltip='Link broken in spec: {} not seen'.format(
+ include),
+ linkBackTarget=anchor,
+ linkBackType=MessageType.NOTE)
+ self.f.write("""</ul></td></tr>""")
+ self.f.write("""</table></div>""")
+
+ def outputMissingIncludes(self, checker, missing):
+ """Output a table of missing includes.
+
+ Called by self.outputBrokenAndMissing() if requested.
+ """
+ self.f.write("""
+ <div class="container">
+ <h2>Missing Unreferenced API Includes</h2>
+ <p>These items are expected to be generated in the spec build process, but aren't included.
+ However, as they also are not referenced by any linking macros, they aren't broken links - at worst they are undocumented entities,
+ at best they are errors in <code>check_spec_links.py</code> logic computing which entities get generated files.</p>
+ <table class="table table-striped">
+ <thead>
+ <th scope="col">Add line to include this file</th>
+ <th scope="col">or add this macro instead</th>
+ """)
+
+ for entity in sorted(missing):
+ fn = checker.findEntity(entity).filename
+ anchor = '[[{}]]'.format(entity)
+ self.f.write("""
+ <tr>
+ <td><code class="text-dark">{filename}</code></td>
+ <td><code class="text-dark">{anchor}</code></td>
+ """.format(filename=fn, anchor=anchor))
+ self.f.write("""</table></div>""")
+
+ def outputFileExcerpt(self, filename):
+ """Output a card containing an excerpt of a file, sufficient to show locations of all diagnostics plus some context.
+
+ Called by self.outputResults().
+ """
+ self.f.write("""<div class="card">
+ <div class="card-header" id="heading-{id}"><h5 class="mb-0">
+ <button class="btn btn-link" type="button">
+ {fn}
+ </button></h5></div><!-- #heading-{id} -->
+ <div class="card-body">
+ """.format(id=self.makeIdentifierFromFilename(filename), fn=self.getRelativeFilename(filename)))
+ lines = self.fileLines[filename]
+ r = self.fileRange[filename]
+ self.f.write("""<pre class="line-numbers language-asciidoc line-highlight" id="excerpt-{id}" data-start="{start}"><code>""".format(
+ id=self.makeIdentifierFromFilename(filename),
+ start=r.start))
+ for lineNum, line in enumerate(
+ lines[(r.start - 1):(r.stop - 1)], r.start):
+ # self.f.write(line)
+ lineLinks = [x for x in self.fileBackLinks[filename]
+ if x.lineNum == lineNum]
+ for col, char in enumerate(line):
+ colLinks = (x for x in lineLinks if x.col == col)
+ for link in colLinks:
+ # TODO right now the syntax highlighting is interfering with the link! so the link-generation is commented out,
+ # only generating the emoji icon.
+
+ # self.f.write('<a href="#{target}" title="{title}" data-toggle="tooltip" data-container="body">{icon}'.format(
+ # target=link.target, title=html.escape(link.tooltip),
+ # icon=MESSAGE_TYPE_ICONS[link.message_type]))
+ self.f.write(MESSAGE_TYPE_ICONS[link.message_type])
+ self.f.write('<span class="sr-only">Cross reference: {t} {title}</span>'.format(
+ title=html.escape(link.tooltip, False), t=link.message_type))
+
+ # self.f.write('</a>')
+
+ # Write the actual character
+ self.f.write(html.escape(char))
+ self.f.write('\n')
+
+ self.f.write('</code></pre>')
+ self.f.write('</div><!-- .card-body -->\n')
+ self.f.write('</div><!-- .card -->\n')
+
+ def outputFallback(self, obj):
+ """Output some text in a general way."""
+ self.f.write(obj)
+
+ ###
+ # Format method: return a string.
+ def formatContext(self, context, message_type=None):
+ """Format a message context in a verbose way."""
+ if message_type is None:
+ icon = LINK_ICON
+ else:
+ icon = MESSAGE_TYPE_ICONS[message_type]
+ return 'In context: <a href="{href}">{icon}{relative}:{lineNum}:{col}</a>'.format(
+ href=self.getAnchorLinkForContext(context),
+ icon=icon,
+ # id=self.makeIdentifierFromFilename(context.filename),
+ relative=self.getRelativeFilename(context.filename),
+ lineNum=context.lineNum,
+ col=getColumn(context))
+
+ ###
+ # Internal methods: not mandated by parent class.
+ def recordUsage(self, context, linkBackTooltip=None,
+ linkBackTarget=None, linkBackType=MessageType.NOTE):
+ """Internally record a 'usage' of something.
+
+ Increases the range of lines that are included in the excerpts,
+ and records back-links if appropriate.
+ """
+ BEFORE_CONTEXT = 6
+ AFTER_CONTEXT = 3
+ # Clamp because we need accurate start line number to make line number
+ # display right
+ start = max(1, context.lineNum - BEFORE_CONTEXT)
+ stop = context.lineNum + AFTER_CONTEXT + 1
+ if context.filename not in self.fileRange:
+ self.fileRange[context.filename] = range(start, stop)
+ self.fileBackLinks[context.filename] = []
+ else:
+ oldRange = self.fileRange[context.filename]
+ self.fileRange[context.filename] = range(
+ min(start, oldRange.start), max(stop, oldRange.stop))
+
+ if linkBackTarget is not None:
+ start_col, end_col = getHighlightedRange(context)
+ self.fileBackLinks[context.filename].append(self.backLink(
+ lineNum=context.lineNum, col=start_col, end_col=end_col,
+ target=linkBackTarget, tooltip=linkBackTooltip,
+ message_type=linkBackType))
+
+ def makeIdentifierFromFilename(self, fn):
+ """Compute an acceptable HTML anchor name from a filename."""
+ return self.filenameTransformer.sub('_', self.getRelativeFilename(fn))
+
+ def getAnchorLinkForContext(self, context):
+ """Compute the anchor link to the excerpt for a MessageContext."""
+ return '#excerpt-{}.{}'.format(
+ self.makeIdentifierFromFilename(context.filename), context.lineNum)
+
+ def getUniqueAnchor(self):
+ """Create and return a new unique string usable as a link anchor."""
+ anchor = 'anchor-{}'.format(self.nextAnchor)
+ self.nextAnchor += 1
+ return anchor
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/macro_checker.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/macro_checker.py
new file mode 100644
index 00000000000..a8a75aa81d9
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/macro_checker.py
@@ -0,0 +1,220 @@
+"""Provides the MacroChecker class."""
+
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+
+from io import StringIO
+import re
+
+
+class MacroChecker(object):
+ """Perform and track checking of one or more files in an API spec.
+
+ This does not necessarily need to be subclassed per-API: it is sufficiently
+ parameterized in the constructor for expected usage.
+ """
+
+ def __init__(self, enabled_messages, entity_db,
+ macro_checker_file_type, root_path):
+ """Construct an object that tracks checking one or more files in an API spec.
+
+ enabled_messages -- a set of MessageId that should be enabled.
+ entity_db -- an object of a EntityDatabase subclass for this API.
+ macro_checker_file_type -- Type to instantiate to create the right
+ MacroCheckerFile subclass for this API.
+ root_path -- A Path object for the root of this repository.
+ """
+ self.enabled_messages = enabled_messages
+ self.entity_db = entity_db
+ self.macro_checker_file_type = macro_checker_file_type
+ self.root_path = root_path
+
+ self.files = []
+
+ self.refpages = set()
+
+ # keys: entity names. values: MessageContext
+ self.links = {}
+ self.apiIncludes = {}
+ self.validityIncludes = {}
+ self.headings = {}
+
+ # Regexes that are members because they depend on the name prefix.
+
+ # apiPrefix, followed by some word characters or * as many times as desired,
+ # NOT followed by >> and NOT preceded by one of the characters in that first character class.
+ # (which distinguish "names being used somewhere other than prose").
+ self.suspected_missing_macro_re = re.compile(
+ r'\b(?<![-=:/[\.`+,])(?P<entity_name>{}[\w*]+)\b(?!>>)'.format(
+ self.entity_db.case_insensitive_name_prefix_pattern)
+ )
+ self.heading_command_re = re.compile(
+ r'=+ (?P<command>{}[\w]+)'.format(self.entity_db.name_prefix)
+ )
+
+ macros_pattern = '|'.join((re.escape(macro)
+ for macro in self.entity_db.macros))
+ # the "formatting" group is to strip matching */**/_/__
+ # surrounding an entire macro.
+ self.macro_re = re.compile(
+ r'(?P<formatting>\**|_*)(?P<macro>{}):(?P<entity_name>[\w*]+((?P<subscript>[\[][^\]]*[\]]))?)(?P=formatting)'.format(macros_pattern))
+
+ def haveLinkTarget(self, entity):
+ """Report if we have parsed an API include (or heading) for an entity.
+
+ None if there is no entity with that name.
+ """
+ if not self.findEntity(entity):
+ return None
+ if entity in self.apiIncludes:
+ return True
+ return entity in self.headings
+
+ def hasFixes(self):
+ """Report if any files have auto-fixes."""
+ for f in self.files:
+ if f.hasFixes():
+ return True
+ return False
+
+ def addLinkToEntity(self, entity, context):
+ """Record seeing a link to an entity's docs from a context."""
+ if entity not in self.links:
+ self.links[entity] = []
+ self.links[entity].append(context)
+
+ def seenRefPage(self, entity):
+ """Check if a ref-page markup block has been seen for an entity."""
+ return entity in self.refpages
+
+ def addRefPage(self, entity):
+ """Record seeing a ref-page markup block for an entity."""
+ self.refpages.add(entity)
+
+ def findMacroAndEntity(self, macro, entity):
+ """Look up EntityData by macro and entity pair.
+
+ Forwards to the EntityDatabase.
+ """
+ return self.entity_db.findMacroAndEntity(macro, entity)
+
+ def findEntity(self, entity):
+ """Look up EntityData by entity name (case-sensitive).
+
+ Forwards to the EntityDatabase.
+ """
+ return self.entity_db.findEntity(entity)
+
+ def findEntityCaseInsensitive(self, entity):
+ """Look up EntityData by entity name (case-insensitive).
+
+ Forwards to the EntityDatabase.
+ """
+ return self.entity_db.findEntityCaseInsensitive(entity)
+
+ def getMemberNames(self, commandOrStruct):
+ """Given a command or struct name, retrieve the names of each member/param.
+
+ Returns an empty list if the entity is not found or doesn't have members/params.
+
+ Forwards to the EntityDatabase.
+ """
+ return self.entity_db.getMemberNames(commandOrStruct)
+
+ def likelyRecognizedEntity(self, entity_name):
+ """Guess (based on name prefix alone) if an entity is likely to be recognized.
+
+ Forwards to the EntityDatabase.
+ """
+ return self.entity_db.likelyRecognizedEntity(entity_name)
+
+ def isLinkedMacro(self, macro):
+ """Identify if a macro is considered a "linked" macro.
+
+ Forwards to the EntityDatabase.
+ """
+ return self.entity_db.isLinkedMacro(macro)
+
+ def processFile(self, filename):
+ """Parse an .adoc file belonging to the spec and check it for errors."""
+ class FileStreamMaker(object):
+ def __init__(self, filename):
+ self.filename = filename
+
+ def make_stream(self):
+ return open(self.filename, 'r', encoding='utf-8')
+
+ f = self.macro_checker_file_type(self, filename, self.enabled_messages,
+ FileStreamMaker(filename))
+ f.process()
+ self.files.append(f)
+
+ def processString(self, s):
+ """Process a string as if it were a spec file.
+
+ Used for testing purposes.
+ """
+ if "\n" in s.rstrip():
+ # remove leading spaces from each line to allow easier
+ # block-quoting in tests
+ s = "\n".join((line.lstrip() for line in s.split("\n")))
+ # fabricate a "filename" that will display better.
+ filename = "string{}\n****START OF STRING****\n{}\n****END OF STRING****\n".format(
+ len(self.files), s.rstrip())
+
+ else:
+ filename = "string{}: {}".format(
+ len(self.files), s.rstrip())
+
+ class StringStreamMaker(object):
+ def __init__(self, string):
+ self.string = string
+
+ def make_stream(self):
+ return StringIO(self.string)
+
+ f = self.macro_checker_file_type(self, filename, self.enabled_messages,
+ StringStreamMaker(s))
+ f.process()
+ self.files.append(f)
+ return f
+
+ def numDiagnostics(self):
+ """Return the total number of diagnostics (warnings and errors) over all the files processed."""
+ return sum((f.numDiagnostics() for f in self.files))
+
+ def numErrors(self):
+ """Return the total number of errors over all the files processed."""
+ return sum((f.numErrors() for f in self.files))
+
+ def getMissingUnreferencedApiIncludes(self):
+ """Return the unreferenced entity names that we expected to see an API include or link target for, but did not.
+
+ Counterpart to getBrokenLinks(): This method returns the entity names
+ that were not used in a linking macro (and thus wouldn't create a broken link),
+ but were nevertheless expected and not seen.
+ """
+ return (entity for entity in self.entity_db.generating_entities
+ if (not self.haveLinkTarget(entity)) and entity not in self.links)
+
+ def getBrokenLinks(self):
+ """Return the entity names and usage contexts that we expected to see an API include or link target for, but did not.
+
+ Counterpart to getMissingUnreferencedApiIncludes(): This method returns only the
+ entity names that were used in a linking macro (and thus create a broken link),
+ but were not seen. The values of the dictionary are a list of MessageContext objects
+ for each linking macro usage for this entity name.
+ """
+ return {entity: contexts for entity, contexts in self.links.items()
+ if self.entity_db.entityGenerates(entity) and not self.haveLinkTarget(entity)}
+
+ def getMissingRefPages(self):
+ """Return a list of entities that we expected, but did not see, a ref page block for.
+
+ The heuristics here are rather crude: we expect a ref page for every generating entry.
+ """
+ return (entity for entity in sorted(self.entity_db.generating_entities)
+ if entity not in self.refpages)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/macro_checker_file.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/macro_checker_file.py
new file mode 100644
index 00000000000..ec730621661
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/macro_checker_file.py
@@ -0,0 +1,1682 @@
+"""Provides MacroCheckerFile, a subclassable type that validates a single file in the spec."""
+
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+
+import logging
+import re
+from collections import OrderedDict, namedtuple
+from enum import Enum
+from inspect import currentframe
+
+from .shared import (AUTO_FIX_STRING, CATEGORIES_WITH_VALIDITY,
+ EXTENSION_CATEGORY, NON_EXISTENT_MACROS, EntityData,
+ Message, MessageContext, MessageId, MessageType,
+ generateInclude, toNameAndLine)
+
+# Code blocks may start and end with any number of ----
+CODE_BLOCK_DELIM = '----'
+
+# Mostly for ref page blocks, but also used elsewhere?
+REF_PAGE_LIKE_BLOCK_DELIM = '--'
+
+# For insets/blocks like the implicit valid usage
+# TODO think it must start with this - does it have to be exactly this?
+BOX_BLOCK_DELIM = '****'
+
+
+INTERNAL_PLACEHOLDER = re.compile(
+ r'(?P<delim>__+)([a-zA-Z]+)(?P=delim)'
+)
+
+# Matches any include line.
+# Used to check for a leading path attribute.
+INCLUDE_PATH_ATTRIBUTE = re.compile(
+ r'include::(\{(?P<path_attribute>[a-z]+)\})?.*\[\]')
+
+allowed_path_attributes = {
+ '{appendices}',
+ '{chapters}',
+ '{config}',
+ '{generated}',
+ '{promoted}',
+ '{style}',
+}
+
+# Matches a generated (api or validity) include line.
+INCLUDE = re.compile(
+ r'include::(?P<directory_traverse>((../){1,4}|\{generated\}/)(generated/)?)(?P<generated_type>(api|validity))/(?P<category>\w+)/(?P<entity_name>[^./]+).adoc[\[][\]]')
+
+# Matches an [[AnchorLikeThis]]
+ANCHOR = re.compile(r'\[\[(?P<entity_name>[^\]]+)\]\]')
+
+# Looks for flink:foo:: or slink::foo:: at the end of string:
+# used to detect explicit pname context.
+PRECEDING_MEMBER_REFERENCE = re.compile(
+ r'\b(?P<macro>[fs](text|link)):(?P<entity_name>[\w*]+)::$')
+
+# Matches something like slink:foo::pname:bar as well as
+# the under-marked-up slink:foo::bar.
+MEMBER_REFERENCE = re.compile(
+ r'\b(?P<first_part>(?P<scope_macro>[fs](text|link)):(?P<scope>[\w*]+))(?P<double_colons>::)(?P<second_part>(?P<member_macro>pname:?)(?P<entity_name>[\w]+))\b'
+)
+
+# Matches if a string ends while a link is still "open".
+# (first half of a link being broken across two lines,
+# or containing our interested area when matched against the text preceding).
+# Used to skip checking in some places.
+OPEN_LINK = re.compile(
+ r'.*(?<!`)<<[^>]*$'
+)
+
+# Matches if a string begins and is followed by a link "close" without a matching open.
+# (second half of a link being broken across two lines)
+# Used to skip checking in some places.
+CLOSE_LINK = re.compile(
+ r'[^<]*>>.*$'
+)
+
+# Matches if a line should be skipped without further considering.
+# Matches lines starting with:
+# - `ifdef:`
+# - `endif:`
+# - `todo` (followed by something matching \b, like : or (. capitalization ignored)
+SKIP_LINE = re.compile(
+ r'^(ifdef:)|(endif:)|([tT][oO][dD][oO]\b).*'
+)
+
+# Matches the whole inside of a refpage tag.
+BRACKETS = re.compile(r'\[(?P<tags>.*)\]')
+
+# Matches a key='value' pair from a ref page tag.
+REF_PAGE_ATTRIB = re.compile(
+ r"(?P<key>[a-z]+)='(?P<value>[^'\\]*(?:\\.[^'\\]*)*)'")
+
+# Exceptions to:
+# error: Definition of link target {} with macro etext (used for category enums) does not exist. (-Wwrong_macro)
+# typically caused by using Vulkan-only enums in Vulkan SC blocks with "etext", or because they
+# are suffixed differently.
+CHECK_UNRECOGNIZED_ETEXT_EXCEPTIONS = (
+ 'VK_COLORSPACE_SRGB_NONLINEAR_KHR',
+ 'VK_COLOR_SPACE_DCI_P3_LINEAR_EXT',
+ 'VK_PIPELINE_CACHE_CREATE_READ_ONLY_BIT',
+ 'VK_STENCIL_FRONT_AND_BACK',
+ 'VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES',
+ 'VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES',
+ 'VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT',
+)
+
+# Exceptions to:
+# warning: Definition of link target {} with macro ename (used for category enums) does not exist. (-Wbad_enumerant)
+# typically caused by Vulkan SC enums not being recognized in Vulkan build
+CHECK_UNRECOGNIZED_ENAME_EXCEPTIONS = (
+ 'VK_ERROR_INVALID_PIPELINE_CACHE_DATA',
+ 'VK_ERROR_NO_PIPELINE_MATCH',
+ 'VK_ERROR_VALIDATION_FAILED',
+ 'VK_MEMORY_HEAP_SEU_SAFE_BIT',
+ 'VK_PIPELINE_CACHE_CREATE_READ_ONLY_BIT',
+ 'VK_PIPELINE_CACHE_CREATE_USE_APPLICATION_STORAGE_BIT',
+ 'VK_PIPELINE_CACHE_HEADER_VERSION_SAFETY_CRITICAL_ONE',
+)
+
+class Attrib(Enum):
+ """Attributes of a ref page."""
+
+ REFPAGE = 'refpage'
+ DESC = 'desc'
+ TYPE = 'type'
+ ALIAS = 'alias'
+ XREFS = 'xrefs'
+ ANCHOR = 'anchor'
+
+
+VALID_REF_PAGE_ATTRIBS = set(
+ (e.value for e in Attrib))
+
+AttribData = namedtuple('AttribData', ['match', 'key', 'value'])
+
+
+def makeAttribFromMatch(match):
+ """Turn a match of REF_PAGE_ATTRIB into an AttribData value."""
+ return AttribData(match=match, key=match.group(
+ 'key'), value=match.group('value'))
+
+
+def parseRefPageAttribs(line):
+ """Parse a ref page tag into a dictionary of attribute_name: AttribData."""
+ return {m.group('key'): makeAttribFromMatch(m)
+ for m in REF_PAGE_ATTRIB.finditer(line)}
+
+
+def regenerateIncludeFromMatch(match, generated_type):
+ """Create an include directive from an INCLUDE match and a (new or replacement) generated_type."""
+ return generateInclude(
+ match.group('directory_traverse'),
+ generated_type,
+ match.group('category'),
+ match.group('entity_name'))
+
+
+BlockEntry = namedtuple(
+ 'BlockEntry', ['delimiter', 'context', 'block_type', 'refpage'])
+
+
+class BlockType(Enum):
+ """Enumeration of the various distinct block types known."""
+ CODE = 'code'
+ REF_PAGE_LIKE = 'ref-page-like' # with or without a ref page tag before
+ BOX = 'box'
+
+ @classmethod
+ def lineToBlockType(self, line):
+ """Return a BlockType if the given line is a block delimiter.
+
+ Returns None otherwise.
+ """
+ if line == REF_PAGE_LIKE_BLOCK_DELIM:
+ return BlockType.REF_PAGE_LIKE
+ if line.startswith(CODE_BLOCK_DELIM):
+ return BlockType.CODE
+ if line.startswith(BOX_BLOCK_DELIM):
+ return BlockType.BOX
+
+ return None
+
+
+def _pluralize(word, num):
+ if num == 1:
+ return word
+ if word.endswith('y'):
+ return word[:-1] + 'ies'
+ return word + 's'
+
+
+def _s_suffix(num):
+ """Simplify pluralization."""
+ if num > 1:
+ return 's'
+ return ''
+
+
+def shouldEntityBeText(entity, subscript):
+ """Determine if an entity name appears to use placeholders, wildcards, etc. and thus merits use of a *text macro.
+
+ Call with the entity and subscript groups from a match of MacroChecker.macro_re.
+ """
+ entity_only = entity
+ if subscript:
+ if subscript == '[]' or subscript == '[i]' or subscript.startswith(
+ '[_') or subscript.endswith('_]'):
+ return True
+ entity_only = entity[:-len(subscript)]
+
+ if ('*' in entity) or entity.startswith('_') or entity_only.endswith('_'):
+ return True
+
+ if INTERNAL_PLACEHOLDER.search(entity):
+ return True
+ return False
+
+
+class MacroCheckerFile(object):
+ """Object performing processing of a single AsciiDoctor file from a specification.
+
+ For testing purposes, may also process a string as if it were a file.
+ """
+
+ def __init__(self, checker, filename, enabled_messages, stream_maker):
+ """Construct a MacroCheckerFile object.
+
+ Typically called by MacroChecker.processFile or MacroChecker.processString().
+
+ Arguments:
+ checker -- A MacroChecker object.
+ filename -- A string to use in messages to refer to this checker, typically the file name.
+ enabled_messages -- A set() of MessageId values that should be considered "enabled" and thus stored.
+ stream_maker -- An object with a makeStream() method that returns a stream.
+ """
+ self.checker = checker
+ self.filename = filename
+ self.stream_maker = stream_maker
+ self.enabled_messages = enabled_messages
+ self.missing_validity_suppressions = set(
+ self.getMissingValiditySuppressions())
+
+ self.logger = logging.getLogger(__name__)
+ self.logger.addHandler(logging.NullHandler())
+
+ self.fixes = set()
+ self.messages = []
+
+ self.pname_data = None
+ self.pname_mentions = {}
+
+ self.refpage_includes = {}
+
+ self.lines = []
+
+ # For both of these:
+ # keys: entity name
+ # values: MessageContext
+ self.fs_api_includes = {}
+ self.validity_includes = {}
+
+ self.in_code_block = False
+ self.in_ref_page = False
+ self.prev_line_ref_page_tag = None
+ self.current_ref_page = None
+
+ # Stack of block-starting delimiters.
+ self.block_stack = []
+
+ # Regexes that are members because they depend on the name prefix.
+ self.suspected_missing_macro_re = self.checker.suspected_missing_macro_re
+ self.heading_command_re = self.checker.heading_command_re
+
+ ###
+ # Main process/checking methods, arranged roughly from largest scope to smallest scope.
+ ###
+
+ def process(self):
+ """Check the stream (file, string) created by the streammaker supplied to the constructor.
+
+ This is the top-level method for checking a spec file.
+ """
+ self.logger.info("processing file %s", self.filename)
+
+ # File content checks - performed line-by-line
+ with self.stream_maker.make_stream() as f:
+ # Iterate through lines, calling processLine on each.
+ for lineIndex, line in enumerate(f):
+ trimmedLine = line.rstrip()
+ self.lines.append(trimmedLine)
+ self.processLine(lineIndex + 1, trimmedLine)
+
+ # End of file checks follow:
+
+ # Check "state" at end of file: should have blocks closed.
+ if self.prev_line_ref_page_tag:
+ self.error(MessageId.REFPAGE_BLOCK,
+ "Reference page tag seen, but block not opened before end of file.",
+ context=self.storeMessageContext(match=None))
+
+ if self.block_stack:
+ locations = (x.context for x in self.block_stack)
+ formatted_locations = ['{} opened at {}'.format(x.delimiter, self.getBriefLocation(x.context))
+ for x in self.block_stack]
+ self.logger.warning("Unclosed blocks: %s",
+ ', '.join(formatted_locations))
+
+ self.error(MessageId.UNCLOSED_BLOCK,
+ ["Reached end of page, with these unclosed blocks remaining:"] +
+ formatted_locations,
+ context=self.storeMessageContext(match=None),
+ see_also=locations)
+
+ # Check that every include of an /api/ file in the protos or structs category
+ # had a matching /validity/ include
+ for entity, includeContext in self.fs_api_includes.items():
+ if not self.checker.entity_db.entityHasValidity(entity):
+ continue
+
+ if entity in self.missing_validity_suppressions:
+ continue
+
+ if entity not in self.validity_includes:
+ self.warning(MessageId.MISSING_VALIDITY_INCLUDE,
+ ['Saw /api/ include for {}, but no matching /validity/ include'.format(entity),
+ 'Expected a line with ' + regenerateIncludeFromMatch(includeContext.match, 'validity')],
+ context=includeContext)
+
+ # Check that we never include a /validity/ file
+ # without a matching /api/ include
+ for entity, includeContext in self.validity_includes.items():
+ if entity not in self.fs_api_includes:
+ self.error(MessageId.MISSING_API_INCLUDE,
+ ['Saw /validity/ include for {}, but no matching /api/ include'.format(entity),
+ 'Expected a line with ' + regenerateIncludeFromMatch(includeContext.match, 'api')],
+ context=includeContext)
+
+ if not self.numDiagnostics():
+ # no problems, exit quietly
+ return
+
+ print('\nFor file {}:'.format(self.filename))
+
+ self.printMessageCounts()
+ numFixes = len(self.fixes)
+ if numFixes > 0:
+ fixes = ', '.join(('{} -> {}'.format(search, replace)
+ for search, replace in self.fixes))
+
+ print('{} unique auto-fix {} recorded: {}'.format(numFixes,
+ _pluralize('pattern', numFixes), fixes))
+
+ def processLine(self, lineNum, line):
+ """Check the contents of a single line from a file.
+
+ Eventually populates self.match, self.entity, self.macro,
+ before calling processMatch.
+ """
+ self.lineNum = lineNum
+ self.line = line
+ self.match = None
+ self.entity = None
+ self.macro = None
+
+ self.logger.debug("processing line %d", lineNum)
+
+ if self.processPossibleBlockDelimiter():
+ # This is a block delimiter - proceed to next line.
+ # Block-type-specific stuff goes in processBlockOpen and processBlockClosed.
+ return
+
+ if self.in_code_block:
+ # We do no processing in a code block.
+ return
+
+ ###
+ # Detect if the previous line was [open,...] starting a refpage
+ # but this line isn't --
+ # If the line is some other block delimiter,
+ # the related code in self.processPossibleBlockDelimiter()
+ # would have handled it.
+ # (because execution would never get to here for that line)
+ if self.prev_line_ref_page_tag:
+ self.handleExpectedRefpageBlock()
+
+ ###
+ # Detect headings
+ if line.startswith('=='):
+ # Headings cause us to clear our pname_context
+ self.pname_data = None
+
+ command = self.heading_command_re.match(line)
+ if command:
+ data = self.checker.findEntity(command)
+ if data:
+ self.pname_data = data
+ return
+
+ ###
+ # Detect [open, lines for manpages
+ if line.startswith('[open,'):
+ self.checkRefPage()
+ return
+
+ ###
+ # Skip comments
+ if line.lstrip().startswith('//'):
+ return
+
+ ###
+ # Skip ifdef/endif
+ if SKIP_LINE.match(line):
+ return
+
+ ###
+ # Detect any include:: lines
+ match = INCLUDE_PATH_ATTRIBUTE.match(line)
+ if match:
+ path_attribute = match.group(1)
+ if path_attribute is None:
+ self.error(MessageId.MISSING_INCLUDE_PATH_ATTRIBUTE,
+ '(no path attribute is present)')
+ return
+ if path_attribute not in allowed_path_attributes:
+ self.error(MessageId.MISSING_INCLUDE_PATH_ATTRIBUTE,
+ f'(path attribute {{path_attribute}} is not one of {sorted(allowed_path_attributes)})')
+ return
+
+ ###
+ # Detect include:::....[] lines for generated API fragments
+ match = INCLUDE.match(line)
+ if match:
+ self.match = match
+ entity = match.group('entity_name')
+
+ data = self.checker.findEntity(entity)
+ if not data:
+ self.error(MessageId.UNKNOWN_INCLUDE,
+ 'Saw include for {}, but that entity is unknown.'.format(entity))
+ self.pname_data = None
+ return
+
+ self.pname_data = data
+
+ if match.group('generated_type') == 'api':
+ self.recordInclude(self.checker.apiIncludes)
+
+ # Set mentions to None. The first time we see something like `* pname:paramHere`,
+ # we will set it to an empty set
+ self.pname_mentions[entity] = None
+
+ if match.group('category') in CATEGORIES_WITH_VALIDITY:
+ self.fs_api_includes[entity] = self.storeMessageContext()
+
+ if entity in self.validity_includes:
+ name_and_line = toNameAndLine(
+ self.validity_includes[entity], root_path=self.checker.root_path)
+ self.error(MessageId.API_VALIDITY_ORDER,
+ ['/api/ include found for {} after a corresponding /validity/ include'.format(entity),
+ 'Validity include located at {}'.format(name_and_line)])
+
+ elif match.group('generated_type') == 'validity':
+ self.recordInclude(self.checker.validityIncludes)
+ self.validity_includes[entity] = self.storeMessageContext()
+
+ if entity not in self.pname_mentions:
+ self.error(MessageId.API_VALIDITY_ORDER,
+ '/validity/ include found for {} without a preceding /api/ include'.format(entity))
+ return
+
+ if self.pname_mentions[entity]:
+ # Got a validity include and we have seen at least one * pname: line
+ # since we got the API include
+ # so we can warn if we haven't seen a reference to every
+ # parameter/member.
+ members = self.checker.getMemberNames(entity)
+ missing = [member for member in members
+ if member not in self.pname_mentions[entity]]
+ if missing:
+ self.error(MessageId.UNDOCUMENTED_MEMBER,
+ ['Validity include found for {}, but not all members/params apparently documented'.format(entity),
+ 'Members/params not mentioned with pname: {}'.format(', '.join(missing))])
+
+ # If we found an include line, we're done with this line.
+ return
+
+ if self.pname_data is not None and '* pname:' in line:
+ context_entity = self.pname_data.entity
+ if self.pname_mentions[context_entity] is None:
+ # First time seeing * pname: after an api include, prepare the set that
+ # tracks
+ self.pname_mentions[context_entity] = set()
+
+ ###
+ # Detect [[Entity]] anchors
+ for match in ANCHOR.finditer(line):
+ entity = match.group('entity_name')
+ if self.checker.findEntity(entity):
+ # We found an anchor with the same name as an entity:
+ # treat it (mostly) like an API include
+ self.match = match
+ self.recordInclude(self.checker.apiIncludes,
+ generated_type='api (manual anchor)')
+
+ ###
+ # Detect :: without pname
+ for match in MEMBER_REFERENCE.finditer(line):
+ if not match.group('member_macro'):
+ self.match = match
+ # Got :: but not followed by pname
+
+ search = match.group()
+ replacement = match.group(
+ 'first_part') + '::pname:' + match.group('second_part')
+ self.error(MessageId.MEMBER_PNAME_MISSING,
+ 'Found a function parameter or struct member reference with :: but missing pname:',
+ group='double_colons',
+ replacement='::pname:',
+ fix=(search, replacement))
+
+ # check pname here because it won't come up in normal iteration below
+ # because of the missing macro
+ self.entity = match.group('entity_name')
+ self.checkPname(match.group('scope'))
+
+ ###
+ # Look for things that seem like a missing macro.
+ for match in self.suspected_missing_macro_re.finditer(line):
+ if OPEN_LINK.match(line, endpos=match.start()):
+ # this is in a link, skip it.
+ continue
+ if CLOSE_LINK.match(line[match.end():]):
+ # this is in a link, skip it.
+ continue
+
+ entity = match.group('entity_name')
+ self.match = match
+ self.entity = entity
+ data = self.checker.findEntity(entity)
+ if data:
+
+ if data.category == EXTENSION_CATEGORY:
+ # Ah, this is an extension
+ self.warning(MessageId.EXTENSION, "Seems like this is an extension name that was not linked.",
+ group='entity_name', replacement=self.makeExtensionLink())
+ else:
+ self.warning(MessageId.MISSING_MACRO,
+ ['Seems like a "{}" macro was omitted for this reference to a known entity in category "{}".'.format(data.macro, data.category),
+ 'Wrap in ` ` to silence this if you do not want a verified macro here.'],
+ group='entity_name',
+ replacement=self.makeMacroMarkup(data.macro))
+ else:
+
+ dataArray = self.checker.findEntityCaseInsensitive(entity)
+ # We might have found the goof...
+
+ if dataArray:
+ if len(dataArray) == 1:
+ # Yep, found the goof:
+ # incorrect macro and entity capitalization
+ data = dataArray[0]
+ if data.category == EXTENSION_CATEGORY:
+ # Ah, this is an extension
+ self.warning(MessageId.EXTENSION,
+ "Seems like this is an extension name that was not linked.",
+ group='entity_name', replacement=self.makeExtensionLink(data.entity))
+ else:
+ self.warning(MessageId.MISSING_MACRO,
+ 'Seems like a macro was omitted for this reference to a known entity in category "{}", found by searching case-insensitively.'.format(
+ data.category),
+ replacement=self.makeMacroMarkup(data=data))
+
+ else:
+ # Ugh, more than one resolution
+
+ self.warning(MessageId.MISSING_MACRO,
+ ['Seems like a macro was omitted for this reference to a known entity, found by searching case-insensitively.',
+ 'More than one apparent match.'],
+ group='entity_name', see_also=dataArray[:])
+
+ ###
+ # Main operations: detect markup macros
+ for match in self.checker.macro_re.finditer(line):
+ self.match = match
+ self.macro = match.group('macro')
+ self.entity = match.group('entity_name')
+ self.subscript = match.group('subscript')
+ self.processMatch()
+
+ def processPossibleBlockDelimiter(self):
+ """Look at the current line, and if it's a delimiter, update the block stack.
+
+ Calls self.processBlockDelimiter() as required.
+
+ Returns True if a delimiter was processed, False otherwise.
+ """
+ line = self.line
+ new_block_type = BlockType.lineToBlockType(line)
+ if not new_block_type:
+ return False
+
+ ###
+ # Detect if the previous line was [open,...] starting a refpage
+ # but this line is some block delimiter other than --
+ # Must do this here because if we get a different block open instead of the one we want,
+ # the order of block opening will be wrong.
+ if new_block_type != BlockType.REF_PAGE_LIKE and self.prev_line_ref_page_tag:
+ self.handleExpectedRefpageBlock()
+
+ # Delegate to the main process for delimiters.
+ self.processBlockDelimiter(line, new_block_type)
+
+ return True
+
+ def processBlockDelimiter(self, line, new_block_type, context=None):
+ """Update the block stack based on the current or supplied line.
+
+ Calls self.processBlockOpen() or self.processBlockClosed() as required.
+
+ Called by self.processPossibleBlockDelimiter() both in normal operation, as well as
+ when "faking" a ref page block open.
+
+ Returns BlockProcessResult.
+ """
+ if not context:
+ context = self.storeMessageContext()
+
+ location = self.getBriefLocation(context)
+
+ top = self.getInnermostBlockEntry()
+ top_delim = self.getInnermostBlockDelimiter()
+ if top_delim == line:
+ self.processBlockClosed()
+ return
+
+ if top and top.block_type == new_block_type:
+ # Same block type, but not matching - might be an error?
+ # TODO maybe create a diagnostic here?
+ self.logger.warning(
+ "processPossibleBlockDelimiter: %s: Matched delimiter type %s, but did not exactly match current delim %s to top of stack %s, may be a typo?",
+ location, new_block_type, line, top_delim)
+
+ # Empty stack, or top doesn't match us.
+ self.processBlockOpen(new_block_type, delimiter=line)
+
+ def processBlockOpen(self, block_type, context=None, delimiter=None):
+ """Do any block-type-specific processing and push the new block.
+
+ Must call self.pushBlock().
+ May be overridden (carefully) or extended.
+
+ Called by self.processBlockDelimiter().
+ """
+ if block_type == BlockType.REF_PAGE_LIKE:
+ if self.prev_line_ref_page_tag:
+ if self.current_ref_page:
+ refpage = self.current_ref_page
+ else:
+ refpage = '?refpage-with-invalid-tag?'
+
+ self.logger.info(
+ 'processBlockOpen: Opening refpage for %s', refpage)
+ # Opening of refpage block "consumes" the preceding ref
+ # page context
+ self.prev_line_ref_page_tag = None
+ self.pushBlock(block_type, refpage=refpage,
+ context=context, delimiter=delimiter)
+ self.in_ref_page = True
+ return
+
+ if block_type == BlockType.CODE:
+ self.in_code_block = True
+
+ self.pushBlock(block_type, context=context, delimiter=delimiter)
+
+ def processBlockClosed(self):
+ """Do any block-type-specific processing and pop the top block.
+
+ Must call self.popBlock().
+ May be overridden (carefully) or extended.
+
+ Called by self.processPossibleBlockDelimiter().
+ """
+ old_top = self.popBlock()
+
+ if old_top.block_type == BlockType.CODE:
+ self.in_code_block = False
+
+ elif old_top.block_type == BlockType.REF_PAGE_LIKE and old_top.refpage:
+ self.logger.info(
+ 'processBlockClosed: Closing refpage for %s', old_top.refpage)
+ # leaving a ref page so reset associated state.
+ self.current_ref_page = None
+ self.prev_line_ref_page_tag = None
+ self.in_ref_page = False
+
+ def processMatch(self):
+ """Process a match of the macro:entity regex for correctness."""
+ match = self.match
+ entity = self.entity
+ macro = self.macro
+
+ ###
+ # Track entities that we're actually linking to.
+ ###
+ if self.checker.entity_db.isLinkedMacro(macro):
+ self.checker.addLinkToEntity(entity, self.storeMessageContext())
+
+ ###
+ # Link everything that should be, and nothing that shouldn't be
+ ###
+ if self.checkRecognizedEntity():
+ # if this returns true,
+ # then there is no need to do the remaining checks on this match
+ return
+
+ ###
+ # Non-existent macros
+ if macro in NON_EXISTENT_MACROS:
+ self.error(MessageId.BAD_MACRO, '{} is not a macro provided in the specification, despite resembling other macros.'.format(
+ macro), group='macro')
+
+ ###
+ # Wildcards (or leading underscore, or square brackets)
+ # if and only if a 'text' macro
+ self.checkText()
+
+ # Do some validation of pname references.
+ if macro == 'pname':
+ # See if there's an immediately-preceding entity
+ preceding = self.line[:match.start()]
+ scope = PRECEDING_MEMBER_REFERENCE.search(preceding)
+ if scope:
+ # Yes there is, check it out.
+ self.checkPname(scope.group('entity_name'))
+ elif self.current_ref_page is not None:
+ # No, but there is a current ref page: very reliable
+ self.checkPnameImpliedContext(self.current_ref_page)
+ elif self.pname_data is not None:
+ # No, but there is a pname_context - better than nothing.
+ self.checkPnameImpliedContext(self.pname_data)
+ else:
+ # no, and no existing context we can imply:
+ # can't check this.
+ pass
+
+ def checkRecognizedEntity(self):
+ """Check the current macro:entity match to see if it is recognized.
+
+ Returns True if there is no need to perform further checks on this match.
+
+ Helps avoid duplicate warnings/errors: typically each macro should have at most
+ one of this class of errors.
+ """
+ entity = self.entity
+ macro = self.macro
+ if self.checker.findMacroAndEntity(macro, entity) is not None:
+ # We know this macro-entity combo
+ return True
+
+ # We don't know this macro-entity combo.
+ possibleCats = self.checker.entity_db.getCategoriesForMacro(macro)
+ if possibleCats is None:
+ possibleCats = ['???']
+ msg = ['Definition of link target {} with macro {} (used for {} {}) does not exist.'.format(
+ entity,
+ macro,
+ _pluralize('category', len(possibleCats)),
+ ', '.join(possibleCats))]
+
+ data = self.checker.findEntity(entity)
+ if data:
+ if entity in CHECK_UNRECOGNIZED_ETEXT_EXCEPTIONS:
+ return False
+
+ # We found the goof: incorrect macro
+ msg.append('Apparently matching entity in category {} found.'.format(
+ data.category))
+ self.handleWrongMacro(msg, data)
+ return True
+
+ see_also = []
+ dataArray = self.checker.findEntityCaseInsensitive(entity)
+ if dataArray:
+ # We might have found the goof...
+
+ if len(dataArray) == 1:
+ # Yep, found the goof:
+ # incorrect macro and entity capitalization
+ data = dataArray[0]
+ msg.append('Apparently matching entity in category {} found by searching case-insensitively.'.format(
+ data.category))
+ self.handleWrongMacro(msg, data)
+ return True
+ else:
+ # Ugh, more than one resolution
+ msg.append(
+ 'More than one apparent match found by searching case-insensitively, cannot auto-fix.')
+ see_also = dataArray[:]
+
+ # OK, so we don't recognize this entity (and couldn't auto-fix it).
+
+ if self.checker.entity_db.shouldBeRecognized(macro, entity):
+ # We should know the target - it's a link macro,
+ # or there's some reason the entity DB thinks we should know it.
+ if self.checker.likelyRecognizedEntity(entity):
+ # Should be linked and it matches our pattern,
+ # so probably not wrong macro.
+ # Human brains required.
+ if not self.checkText():
+ self.error(MessageId.BAD_ENTITY, msg + ['Might be a misspelling, or, less likely, the wrong macro.'],
+ see_also=see_also)
+ else:
+ # Doesn't match our pattern,
+ # so probably should be name instead of link.
+ newMacro = macro[0] + 'name'
+ if self.checker.entity_db.isValidMacro(newMacro):
+ self.error(MessageId.BAD_ENTITY, msg +
+ ['Entity name does not fit the pattern for this API, which would mean it should be a "name" macro instead of a "link" macro'],
+ group='macro', replacement=newMacro, fix=self.makeFix(newMacro=newMacro), see_also=see_also)
+ else:
+ self.error(MessageId.BAD_ENTITY, msg +
+ ['Entity name does not fit the pattern for this API, which would mean it should be a "name" macro instead of a "link" macro',
+ 'However, {} is not a known macro so cannot auto-fix.'.format(newMacro)], see_also=see_also)
+
+ elif macro == 'ename':
+ # TODO This might be an ambiguity in the style guide - ename might be a known enumerant value,
+ # or it might be an enumerant value in an external library, etc. that we don't know about - so
+ # hard to check this.
+ if self.checker.likelyRecognizedEntity(entity):
+ if not self.checkText():
+ if entity in CHECK_UNRECOGNIZED_ENAME_EXCEPTIONS:
+ return False
+ else:
+ self.warning(MessageId.BAD_ENUMERANT, msg +
+ ['Unrecognized ename:{} that we would expect to recognize since it fits the pattern for this API.'.format(entity)], see_also=see_also)
+ else:
+ # This is fine:
+ # it doesn't need to be recognized since it's not linked.
+ pass
+ # Don't skip other tests.
+ return False
+
+ def checkText(self):
+ """Evaluate the usage (or non-usage) of a *text macro.
+
+ Wildcards (or leading or trailing underscore, or square brackets with
+ nothing or a placeholder) if and only if a 'text' macro.
+
+ Called by checkRecognizedEntity() when appropriate.
+ """
+ macro = self.macro
+ entity = self.entity
+ shouldBeText = shouldEntityBeText(entity, self.subscript)
+ if shouldBeText and not self.macro.endswith(
+ 'text') and not self.macro == 'code':
+ newMacro = macro[0] + 'text'
+ if self.checker.entity_db.getCategoriesForMacro(newMacro):
+ self.error(MessageId.MISSING_TEXT,
+ ['Asterisk/leading or trailing underscore/bracket found - macro should end with "text:", probably {}:'.format(newMacro),
+ AUTO_FIX_STRING],
+ group='macro', replacement=newMacro, fix=self.makeFix(newMacro=newMacro))
+ else:
+ self.error(MessageId.MISSING_TEXT,
+ ['Asterisk/leading or trailing underscore/bracket found, so macro should end with "text:".',
+ 'However {}: is not a known macro so cannot auto-fix.'.format(newMacro)],
+ group='macro')
+ return True
+ elif macro.endswith('text') and not shouldBeText:
+ msg = [
+ "No asterisk/leading or trailing underscore/bracket in the entity, so this might be a mistaken use of the 'text' macro {}:".format(macro)]
+ data = self.checker.findEntity(entity)
+ if data:
+ if entity in CHECK_UNRECOGNIZED_ETEXT_EXCEPTIONS:
+ return False
+
+ # We found the goof: incorrect macro
+ msg.append('Apparently matching entity in category {} found.'.format(
+ data.category))
+ msg.append(AUTO_FIX_STRING)
+ replacement = self.makeFix(data=data)
+ if data.category == EXTENSION_CATEGORY:
+ self.error(MessageId.EXTENSION, msg,
+ replacement=replacement, fix=replacement)
+ else:
+ self.error(MessageId.WRONG_MACRO, msg,
+ group='macro', replacement=data.macro, fix=replacement)
+ else:
+ if self.checker.likelyRecognizedEntity(entity):
+ # This is a use of *text: for something that fits the pattern but isn't in the spec.
+ # This is OK.
+ return False
+ msg.append('Entity not found in spec, either.')
+ if macro[0] != 'e':
+ # Only suggest a macro if we aren't in elink/ename/etext,
+ # since ename and elink are not related in an equivalent way
+ # to the relationship between flink and fname.
+ newMacro = macro[0] + 'name'
+ if self.checker.entity_db.getCategoriesForMacro(newMacro):
+ msg.append(
+ 'Consider if {}: might be the correct macro to use here.'.format(newMacro))
+ else:
+ msg.append(
+ 'Cannot suggest a new macro because {}: is not a known macro.'.format(newMacro))
+ self.warning(MessageId.MISUSED_TEXT, msg)
+ return True
+ return False
+
+ def checkPnameImpliedContext(self, pname_context):
+ """Handle pname: macros not immediately preceded by something like flink:entity or slink:entity.
+
+ Also records pname: mentions of members/parameters for completeness checking in doc blocks.
+
+ Contains call to self.checkPname().
+ Called by self.processMatch()
+ """
+ self.checkPname(pname_context.entity)
+ if pname_context.entity in self.pname_mentions and \
+ self.pname_mentions[pname_context.entity] is not None:
+ # Record this mention,
+ # in case we're in the documentation block.
+ self.pname_mentions[pname_context.entity].add(self.entity)
+
+ def checkPname(self, pname_context):
+ """Check the current match (as a pname: usage) with the given entity as its 'pname context', if possible.
+
+ e.g. slink:foo::pname:bar, pname_context would be 'foo', while self.entity would be 'bar', etc.
+
+ Called by self.processLine(), self.processMatch(), as well as from self.checkPnameImpliedContext().
+ """
+ if '*' in pname_context:
+ # This context has a placeholder, can't verify it.
+ return
+
+ entity = self.entity
+
+ context_data = self.checker.findEntity(pname_context)
+ members = self.checker.getMemberNames(pname_context)
+
+ if context_data and not members:
+ # This is a recognized parent entity that doesn't have detectable member names,
+ # skip validation
+ # TODO: Annotate parameters of function pointer types with <name>
+ # and <param>?
+ return
+ if not members:
+ self.warning(MessageId.UNRECOGNIZED_CONTEXT,
+ 'pname context entity was un-recognized {}'.format(pname_context))
+ return
+
+ if entity not in members:
+ self.warning(MessageId.UNKNOWN_MEMBER, ["Could not find member/param named '{}' in {}".format(entity, pname_context),
+ 'Known {} mamber/param names are: {}'.format(
+ pname_context, ', '.join(members))], group='entity_name')
+
+ def checkIncludeRefPageRelation(self, entity, generated_type):
+ """Identify if our current ref page (or lack thereof) is appropriate for an include just recorded.
+
+ Called by self.recordInclude().
+ """
+ if not self.in_ref_page:
+ # Not in a ref page block: This probably means this entity needs a
+ # ref-page block added.
+ self.handleIncludeMissingRefPage(entity, generated_type)
+ return
+
+ if not isinstance(self.current_ref_page, EntityData):
+ # This isn't a fully-valid ref page, so can't check the includes any better.
+ return
+
+ ref_page_entity = self.current_ref_page.entity
+ if ref_page_entity not in self.refpage_includes:
+ self.refpage_includes[ref_page_entity] = set()
+ expected_ref_page_entity = self.computeExpectedRefPageFromInclude(
+ entity)
+ self.refpage_includes[ref_page_entity].add((generated_type, entity))
+
+ if ref_page_entity == expected_ref_page_entity:
+ # OK, this is a total match.
+ pass
+ elif self.checker.entity_db.areAliases(expected_ref_page_entity, ref_page_entity):
+ # This appears to be a promoted synonym which is OK.
+ pass
+ else:
+ # OK, we are in a ref page block that doesn't match
+ self.handleIncludeMismatchRefPage(entity, generated_type)
+
+ def perform_entity_check(self, type):
+ """Returns True if an entity check should be performed on this
+ refpage type.
+
+ May override."""
+
+ return True
+
+ def checkRefPage(self):
+ """Check if the current line (a refpage tag) meets requirements.
+
+ Called by self.processLine().
+ """
+ line = self.line
+
+ # Should always be found
+ self.match = BRACKETS.match(line)
+
+ data = None
+ directory = None
+ if self.in_ref_page:
+ msg = ["Found reference page markup, but we are already in a refpage block.",
+ "The block before the first message of this type is most likely not closed.", ]
+ # Fake-close the previous ref page, if it's trivial to do so.
+ if self.getInnermostBlockEntry().block_type == BlockType.REF_PAGE_LIKE:
+ msg.append(
+ "Pretending that there was a line with `--` immediately above to close that ref page, for more readable messages.")
+ self.processBlockDelimiter(
+ REF_PAGE_LIKE_BLOCK_DELIM, BlockType.REF_PAGE_LIKE)
+ else:
+ msg.append(
+ "Ref page wasn't the last block opened, so not pretending to auto-close it for more readable messages.")
+
+ self.error(MessageId.REFPAGE_BLOCK, msg)
+
+ attribs = parseRefPageAttribs(line)
+
+ unknown_attribs = set(attribs.keys()).difference(
+ VALID_REF_PAGE_ATTRIBS)
+ if unknown_attribs:
+ self.error(MessageId.REFPAGE_UNKNOWN_ATTRIB,
+ "Found unknown attrib(s) in reference page markup: " + ','.join(unknown_attribs))
+
+ # Required field: refpage='xrValidEntityHere'
+ if Attrib.REFPAGE.value in attribs:
+ attrib = attribs[Attrib.REFPAGE.value]
+ text = attrib.value
+ self.entity = text
+
+ context = self.storeMessageContext(
+ group='value', match=attrib.match)
+ if self.checker.seenRefPage(text):
+ self.error(MessageId.REFPAGE_DUPLICATE,
+ ["Found reference page markup when we already saw refpage='{}' elsewhere.".format(
+ text),
+ "This (or the other mention) may be a copy-paste error."],
+ context=context)
+ self.checker.addRefPage(text)
+
+ # Entity check can be skipped depending on the refpage type
+ # Determine page type for use in several places
+ type_text = ''
+ if Attrib.TYPE.value in attribs:
+ type_text = attribs[Attrib.TYPE.value].value
+
+ if self.perform_entity_check(type_text):
+ data = self.checker.findEntity(text)
+ if data:
+ # OK, this is a known entity that we're seeing a refpage for.
+ directory = data.directory
+ self.current_ref_page = data
+ else:
+ # TODO suggest fixes here if applicable
+ self.error(MessageId.REFPAGE_NAME,
+ [ "Found reference page markup, but refpage='{}' type='{}' does not refer to a recognized entity".format(
+ text, type_text),
+ 'If this is intentional, add the entity to EXTRA_DEFINES or EXTRA_REFPAGES in check_spec_links.py.' ],
+ context=context)
+ else:
+ self.error(MessageId.REFPAGE_TAG,
+ "Found apparent reference page markup, but missing refpage='...'",
+ group=None)
+
+ # Required field: desc='preferably non-empty'
+ if Attrib.DESC.value in attribs:
+ attrib = attribs[Attrib.DESC.value]
+ text = attrib.value
+ if not text:
+ context = self.storeMessageContext(
+ group=None, match=attrib.match)
+ self.warning(MessageId.REFPAGE_MISSING_DESC,
+ "Found reference page markup, but desc='' is empty",
+ context=context)
+ else:
+ self.error(MessageId.REFPAGE_TAG,
+ "Found apparent reference page markup, but missing desc='...'",
+ group=None)
+
+ # Required field: type='protos' for example
+ # (used by genRef.py to compute the macro to use)
+ if Attrib.TYPE.value in attribs:
+ attrib = attribs[Attrib.TYPE.value]
+ text = attrib.value
+ if directory and not text == directory:
+ context = self.storeMessageContext(
+ group='value', match=attrib.match)
+ self.error(MessageId.REFPAGE_TYPE,
+ "Found reference page markup, but type='{}' is not the expected value '{}'".format(
+ text, directory),
+ context=context)
+ else:
+ self.error(MessageId.REFPAGE_TAG,
+ "Found apparent reference page markup, but missing type='...'",
+ group=None)
+
+ # Optional field: alias='spaceDelimited validEntities'
+ # Currently does nothing. Could modify checkRefPageXrefs to also
+ # check alias= attribute value
+ # if Attrib.ALIAS.value in attribs:
+ # # This field is optional
+ # self.checkRefPageXrefs(attribs[Attrib.XREFS.value])
+
+ # Optional field: xrefs='spaceDelimited validEntities'
+ if Attrib.XREFS.value in attribs:
+ # This field is optional
+ self.checkRefPageXrefs(attribs[Attrib.XREFS.value])
+ self.prev_line_ref_page_tag = self.storeMessageContext()
+
+ def checkRefPageXrefs(self, xrefs_attrib):
+ """Check all cross-refs indicated in an xrefs attribute for a ref page.
+
+ Called by self.checkRefPage().
+
+ Argument:
+ xrefs_attrib -- A match of REF_PAGE_ATTRIB where the group 'key' is 'xrefs'.
+ """
+ text = xrefs_attrib.value
+ context = self.storeMessageContext(
+ group='value', match=xrefs_attrib.match)
+
+ def splitRefs(s):
+ """Split the string on whitespace, into individual references."""
+ return s.split() # [x for x in s.split() if x]
+
+ def remakeRefs(refs):
+ """Re-create a xrefs string from something list-shaped."""
+ return ' '.join(refs)
+
+ refs = splitRefs(text)
+
+ # Pre-checking if messages are enabled, so that we can correctly determine
+ # the current string following any auto-fixes:
+ # the fixes for messages directly in this method would interact,
+ # and thus must be in the order specified here.
+
+ if self.messageEnabled(MessageId.REFPAGE_XREFS_COMMA) and ',' in text:
+ old_text = text
+ # Re-split after replacing commas.
+ refs = splitRefs(text.replace(',', ' '))
+ # Re-create the space-delimited text.
+ text = remakeRefs(refs)
+ self.error(MessageId.REFPAGE_XREFS_COMMA,
+ "Found reference page markup, with an unexpected comma in the (space-delimited) xrefs attribute",
+ context=context,
+ replacement=text,
+ fix=(old_text, text))
+
+ # We could conditionally perform this creation, but the code complexity would increase substantially,
+ # for presumably minimal runtime improvement.
+ unique_refs = OrderedDict.fromkeys(refs)
+ if self.messageEnabled(MessageId.REFPAGE_XREF_DUPE) and len(unique_refs) != len(refs):
+ # TODO is it safe to auto-fix here?
+ old_text = text
+ text = remakeRefs(unique_refs.keys())
+ self.warning(MessageId.REFPAGE_XREF_DUPE,
+ ["Reference page for {} contains at least one duplicate in its cross-references.".format(
+ self.entity),
+ "Look carefully to see if this is a copy and paste error and should be changed to a different but related entity:",
+ "auto-fix simply removes the duplicate."],
+ context=context,
+ replacement=text,
+ fix=(old_text, text))
+
+ if self.messageEnabled(MessageId.REFPAGE_SELF_XREF) and self.entity and self.entity in unique_refs:
+ # Not modifying unique_refs here because that would accidentally affect the whitespace auto-fix.
+ new_text = remakeRefs(
+ [x for x in unique_refs.keys() if x != self.entity])
+
+ # DON'T AUTOFIX HERE because these are likely copy-paste between related entities:
+ # e.g. a Create function and the associated CreateInfo struct.
+ self.warning(MessageId.REFPAGE_SELF_XREF,
+ ["Reference page for {} included itself in its cross-references.".format(self.entity),
+ "This is typically a copy and paste error, and the dupe should likely be changed to a different but related entity.",
+ "Not auto-fixing for this reason."],
+ context=context,
+ replacement=new_text,)
+
+ # We didn't have another reason to replace the whole attribute value,
+ # so let's make sure it doesn't have any extra spaces
+ if self.messageEnabled(MessageId.REFPAGE_WHITESPACE) and xrefs_attrib.value == text:
+ old_text = text
+ text = remakeRefs(unique_refs.keys())
+ if old_text != text:
+ self.warning(MessageId.REFPAGE_WHITESPACE,
+ ["Cross-references for reference page for {} had non-minimal whitespace,".format(self.entity),
+ "and no other enabled message has re-constructed this value already."],
+ context=context,
+ replacement=text,
+ fix=(old_text, text))
+
+ for entity in unique_refs.keys():
+ self.checkRefPageXref(entity, context)
+
+ @property
+ def allowEnumXrefs(self):
+ """Returns True if enums can be specified in the 'xrefs' attribute
+ of a refpage.
+
+ May override.
+ """
+ return False
+
+ def checkRefPageXref(self, referenced_entity, line_context):
+ """Check a single cross-reference entry for a refpage.
+
+ Called by self.checkRefPageXrefs().
+
+ Arguments:
+ referenced_entity -- The individual entity under consideration from the xrefs='...' string.
+ line_context -- A MessageContext referring to the entire line.
+ """
+ data = self.checker.findEntity(referenced_entity)
+ context = line_context
+ match = re.search(r'\b{}\b'.format(referenced_entity), self.line)
+ if match:
+ context = self.storeMessageContext(
+ group=None, match=match)
+
+ if data and data.category == "enumvalues" and not self.allowEnumXrefs:
+ msg = ["Found reference page markup, with an enum value listed: {}".format(
+ referenced_entity)]
+ self.error(MessageId.REFPAGE_XREFS,
+ msg,
+ context=context)
+ return
+
+ if data:
+ # This is OK: we found it, and it's not an enum value
+ return
+
+ msg = ["Found reference page markup, with an unrecognized entity listed: {}".format(
+ referenced_entity)]
+
+ see_also = None
+ dataArray = self.checker.findEntityCaseInsensitive(
+ referenced_entity)
+
+ if dataArray:
+ # We might have found the goof...
+
+ if len(dataArray) == 1:
+ # Yep, found the goof - incorrect entity capitalization
+ data = dataArray[0]
+ new_entity = data.entity
+ self.error(MessageId.REFPAGE_XREFS, msg + [
+ 'Apparently matching entity in category {} found by searching case-insensitively.'.format(
+ data.category),
+ AUTO_FIX_STRING],
+ replacement=new_entity,
+ fix=(referenced_entity, new_entity),
+ context=context)
+ return
+
+ # Ugh, more than one resolution
+ msg.append(
+ 'More than one apparent match found by searching case-insensitively, cannot auto-fix.')
+ see_also = dataArray[:]
+ else:
+ # Probably not just a typo
+ msg.append(
+ 'If this is intentional, add the entity to EXTRA_DEFINES or EXTRA_REFPAGES in check_spec_links.py.')
+
+ # Multiple or no resolutions found
+ self.error(MessageId.REFPAGE_XREFS,
+ msg,
+ see_also=see_also,
+ context=context)
+
+ ###
+ # Message-related methods.
+ ###
+
+ def warning(self, message_id, messageLines, context=None, group=None,
+ replacement=None, fix=None, see_also=None, frame=None):
+ """Log a warning for the file, if the message ID is enabled.
+
+ Wrapper around self.diag() that automatically sets severity as well as frame.
+
+ Arguments:
+ message_id -- A MessageId value.
+ messageLines -- A string or list of strings containing a human-readable error description.
+
+ Optional, named arguments:
+ context -- A MessageContext. If None, will be constructed from self.match and group.
+ group -- The name of the regex group in self.match that contains the problem. Only used if context is None.
+ If needed and is None, self.group is used instead.
+ replacement -- The string, if any, that should be suggested as a replacement for the group in question.
+ Does not create an auto-fix: sometimes we want to show a possible fix but aren't confident enough
+ (or can't easily phrase a regex) to do it automatically.
+ fix -- A (old text, new text) pair if this error is auto-fixable safely.
+ see_also -- An optional array of other MessageContext locations relevant to this message.
+ frame -- The 'inspect' stack frame corresponding to the location that raised this message.
+ If None, will assume it is the direct caller of self.warning().
+ """
+ if not frame:
+ frame = currentframe().f_back
+ self.diag(MessageType.WARNING, message_id, messageLines, group=group,
+ replacement=replacement, context=context, fix=fix, see_also=see_also, frame=frame)
+
+ def error(self, message_id, messageLines, group=None, replacement=None,
+ context=None, fix=None, see_also=None, frame=None):
+ """Log an error for the file, if the message ID is enabled.
+
+ Wrapper around self.diag() that automatically sets severity as well as frame.
+
+ Arguments:
+ message_id -- A MessageId value.
+ messageLines -- A string or list of strings containing a human-readable error description.
+
+ Optional, named arguments:
+ context -- A MessageContext. If None, will be constructed from self.match and group.
+ group -- The name of the regex group in self.match that contains the problem. Only used if context is None.
+ If needed and is None, self.group is used instead.
+ replacement -- The string, if any, that should be suggested as a replacement for the group in question.
+ Does not create an auto-fix: sometimes we want to show a possible fix but aren't confident enough
+ (or can't easily phrase a regex) to do it automatically.
+ fix -- A (old text, new text) pair if this error is auto-fixable safely.
+ see_also -- An optional array of other MessageContext locations relevant to this message.
+ frame -- The 'inspect' stack frame corresponding to the location that raised this message.
+ If None, will assume it is the direct caller of self.error().
+ """
+ if not frame:
+ frame = currentframe().f_back
+ self.diag(MessageType.ERROR, message_id, messageLines, group=group,
+ replacement=replacement, context=context, fix=fix, see_also=see_also, frame=frame)
+
+ def diag(self, severity, message_id, messageLines, context=None, group=None,
+ replacement=None, fix=None, see_also=None, frame=None):
+ """Log a diagnostic for the file, if the message ID is enabled.
+
+ Also records the auto-fix, if applicable.
+
+ Arguments:
+ severity -- A MessageType value.
+ message_id -- A MessageId value.
+ messageLines -- A string or list of strings containing a human-readable error description.
+
+ Optional, named arguments:
+ context -- A MessageContext. If None, will be constructed from self.match and group.
+ group -- The name of the regex group in self.match that contains the problem. Only used if context is None.
+ If needed and is None, self.group is used instead.
+ replacement -- The string, if any, that should be suggested as a replacement for the group in question.
+ Does not create an auto-fix: sometimes we want to show a possible fix but aren't confident enough
+ (or can't easily phrase a regex) to do it automatically.
+ fix -- A (old text, new text) pair if this error is auto-fixable safely.
+ see_also -- An optional array of other MessageContext locations relevant to this message.
+ frame -- The 'inspect' stack frame corresponding to the location that raised this message.
+ If None, will assume it is the direct caller of self.diag().
+ """
+ if not self.messageEnabled(message_id):
+ self.logger.debug(
+ 'Discarding a %s message because it is disabled.', message_id)
+ return
+
+ if isinstance(messageLines, str):
+ messageLines = [messageLines]
+
+ self.logger.info('Recording a %s message: %s',
+ message_id, ' '.join(messageLines))
+
+ # Ensure all auto-fixes are marked as such.
+ if fix is not None and AUTO_FIX_STRING not in messageLines:
+ messageLines.append(AUTO_FIX_STRING)
+
+ if not frame:
+ frame = currentframe().f_back
+ if context is None:
+ message = Message(message_id=message_id,
+ message_type=severity,
+ message=messageLines,
+ context=self.storeMessageContext(group=group),
+ replacement=replacement,
+ see_also=see_also,
+ fix=fix,
+ frame=frame)
+ else:
+ message = Message(message_id=message_id,
+ message_type=severity,
+ message=messageLines,
+ context=context,
+ replacement=replacement,
+ see_also=see_also,
+ fix=fix,
+ frame=frame)
+ if fix is not None:
+ self.fixes.add(fix)
+ self.messages.append(message)
+
+ def messageEnabled(self, message_id):
+ """Return true if the given message ID is enabled."""
+ return message_id in self.enabled_messages
+
+ ###
+ # Accessors for externally-interesting information
+
+ def numDiagnostics(self):
+ """Count the total number of diagnostics (errors or warnings) for this file."""
+ return len(self.messages)
+
+ def numErrors(self):
+ """Count the total number of errors for this file."""
+ return self.numMessagesOfType(MessageType.ERROR)
+
+ def numMessagesOfType(self, message_type):
+ """Count the number of messages of a particular type (severity)."""
+ return len(
+ [msg for msg in self.messages if msg.message_type == message_type])
+
+ def hasFixes(self):
+ """Return True if any messages included auto-fix patterns."""
+ return len(self.fixes) > 0
+
+ ###
+ # Assorted internal methods.
+ def printMessageCounts(self):
+ """Print a simple count of each MessageType of diagnostics."""
+ for message_type in [MessageType.ERROR, MessageType.WARNING]:
+ count = self.numMessagesOfType(message_type)
+ if count > 0:
+ print('{num} {mtype}{s} generated.'.format(
+ num=count, mtype=message_type, s=_s_suffix(count)))
+
+ def dumpInternals(self):
+ """Dump internal variables to screen, for debugging."""
+ print('self.lineNum: ', self.lineNum)
+ print('self.line:', self.line)
+ print('self.prev_line_ref_page_tag: ', self.prev_line_ref_page_tag)
+ print('self.current_ref_page:', self.current_ref_page)
+
+ def getMissingValiditySuppressions(self):
+ """Return an enumerable of entity names that we shouldn't warn about missing validity.
+
+ May override.
+ """
+ return []
+
+ def recordInclude(self, include_dict, generated_type=None):
+ """Store the current line as being the location of an include directive or equivalent.
+
+ Reports duplicate include errors, as well as include/ref-page mismatch or missing ref-page,
+ by calling self.checkIncludeRefPageRelation() for "actual" includes (where generated_type is None).
+
+ Arguments:
+ include_dict -- The include dictionary to update: one of self.apiIncludes or self.validityIncludes.
+ generated_type -- The type of include (e.g. 'api', 'valid', etc). By default, extracted from self.match.
+ """
+ entity = self.match.group('entity_name')
+ if generated_type is None:
+ generated_type = self.match.group('generated_type')
+
+ # Only checking the ref page relation if it's retrieved from regex.
+ # Otherwise it might be a manual anchor recorded as an include,
+ # etc.
+ self.checkIncludeRefPageRelation(entity, generated_type)
+
+ if entity in include_dict:
+ self.error(MessageId.DUPLICATE_INCLUDE,
+ "Included {} docs for {} when they were already included.".format(generated_type,
+ entity), see_also=include_dict[entity])
+ include_dict[entity].append(self.storeMessageContext())
+ else:
+ include_dict[entity] = [self.storeMessageContext()]
+
+ def getInnermostBlockEntry(self):
+ """Get the BlockEntry for the top block delim on our stack."""
+ if not self.block_stack:
+ return None
+ return self.block_stack[-1]
+
+ def getInnermostBlockDelimiter(self):
+ """Get the delimiter for the top block on our stack."""
+ top = self.getInnermostBlockEntry()
+ if not top:
+ return None
+ return top.delimiter
+
+ def pushBlock(self, block_type, refpage=None, context=None, delimiter=None):
+ """Push a new entry on the block stack."""
+ if not delimiter:
+ self.logger.info("pushBlock: not given delimiter")
+ delimiter = self.line
+ if not context:
+ context = self.storeMessageContext()
+
+ old_top_delim = self.getInnermostBlockDelimiter()
+
+ self.block_stack.append(BlockEntry(
+ delimiter=delimiter,
+ context=context,
+ refpage=refpage,
+ block_type=block_type))
+
+ location = self.getBriefLocation(context)
+ self.logger.info(
+ "pushBlock: %s: Pushed %s delimiter %s, previous top was %s, now %d elements on the stack",
+ location, block_type.value, delimiter, old_top_delim, len(self.block_stack))
+
+ self.dumpBlockStack()
+
+ def popBlock(self):
+ """Pop and return the top entry from the block stack."""
+ old_top = self.block_stack.pop()
+ location = self.getBriefLocation(old_top.context)
+ self.logger.info(
+ "popBlock: %s: popping %s delimiter %s, now %d elements on the stack",
+ location, old_top.block_type.value, old_top.delimiter, len(self.block_stack))
+
+ self.dumpBlockStack()
+
+ return old_top
+
+ def dumpBlockStack(self):
+ self.logger.debug('Block stack, top first:')
+ for distFromTop, x in enumerate(reversed(self.block_stack)):
+ self.logger.debug(' - block_stack[%d]: Line %d: "%s" refpage=%s',
+ -1 - distFromTop,
+ x.context.lineNum, x.delimiter, x.refpage)
+
+ def getBriefLocation(self, context):
+ """Format a context briefly - omitting the filename if it has newlines in it."""
+ if '\n' in context.filename:
+ return 'input string line {}'.format(context.lineNum)
+ return '{}:{}'.format(
+ context.filename, context.lineNum)
+
+ ###
+ # Handlers for a variety of diagnostic-meriting conditions
+ #
+ # Split out for clarity and for allowing fine-grained override on a per-project basis.
+ ###
+
+ def handleIncludeMissingRefPage(self, entity, generated_type):
+ """Report a message about an include outside of a ref-page block."""
+ msg = ["Found {} include for {} outside of a reference page block.".format(generated_type, entity),
+ "This is probably a missing reference page block."]
+ refpage = self.computeExpectedRefPageFromInclude(entity)
+ data = self.checker.findEntity(refpage)
+ if data:
+ msg.append('Expected ref page block might start like:')
+ msg.append(self.makeRefPageTag(refpage, data=data))
+ else:
+ msg.append(
+ "But, expected ref page entity name {} isn't recognized...".format(refpage))
+ self.warning(MessageId.REFPAGE_MISSING, msg)
+
+ def handleIncludeMismatchRefPage(self, entity, generated_type):
+ """Report a message about an include not matching its containing ref-page block."""
+ self.warning(MessageId.REFPAGE_MISMATCH, "Found {} include for {}, inside the reference page block of {}".format(
+ generated_type, entity, self.current_ref_page.entity))
+
+ def handleWrongMacro(self, msg, data):
+ """Report an appropriate message when we found that the macro used is incorrect.
+
+ May be overridden depending on each API's behavior regarding macro misuse:
+ e.g. in some cases, it may be considered a MessageId.LEGACY warning rather than
+ a MessageId.WRONG_MACRO or MessageId.EXTENSION.
+ """
+ message_type = MessageType.WARNING
+ message_id = MessageId.WRONG_MACRO
+ group = 'macro'
+
+ if data.category == EXTENSION_CATEGORY:
+ # Ah, this is an extension
+ msg.append(
+ 'This is apparently an extension name, which should be marked up as a link.')
+ message_id = MessageId.EXTENSION
+ group = None # replace the whole thing
+ else:
+ # Non-extension, we found the macro though.
+ message_type = MessageType.ERROR
+ msg.append(AUTO_FIX_STRING)
+ self.diag(message_type, message_id, msg,
+ group=group, replacement=self.makeMacroMarkup(data=data), fix=self.makeFix(data=data))
+
+ def handleExpectedRefpageBlock(self):
+ """Handle expecting to see -- to start a refpage block, but not seeing that at all."""
+ self.error(MessageId.REFPAGE_BLOCK,
+ ["Expected, but did not find, a line containing only -- following a reference page tag,",
+ "Pretending to insert one, for more readable messages."],
+ see_also=[self.prev_line_ref_page_tag])
+ # Fake "in ref page" regardless, to avoid spurious extra errors.
+ self.processBlockDelimiter('--', BlockType.REF_PAGE_LIKE,
+ context=self.prev_line_ref_page_tag)
+
+ ###
+ # Construct related values (typically named tuples) based on object state and supplied arguments.
+ #
+ # Results are typically supplied to another method call.
+ ###
+
+ def storeMessageContext(self, group=None, match=None):
+ """Create message context from corresponding instance variables.
+
+ Arguments:
+ group -- The regex group name, if any, identifying the part of the match to highlight.
+ match -- The regex match. If None, will use self.match.
+ """
+ if match is None:
+ match = self.match
+ return MessageContext(filename=self.filename,
+ lineNum=self.lineNum,
+ line=self.line,
+ match=match,
+ group=group)
+
+ def makeFix(self, newMacro=None, newEntity=None, data=None):
+ """Construct a fix pair for replacing the old macro:entity with new.
+
+ Wrapper around self.makeSearch() and self.makeMacroMarkup().
+ """
+ return (self.makeSearch(), self.makeMacroMarkup(
+ newMacro, newEntity, data))
+
+ def makeSearch(self):
+ """Construct the string self.macro:self.entity, for use in the old text part of a fix pair."""
+ return '{}:{}'.format(self.macro, self.entity)
+
+ def makeMacroMarkup(self, newMacro=None, newEntity=None, data=None):
+ """Construct appropriate markup for referring to an entity.
+
+ Typically constructs macro:entity, but can construct `<<EXTENSION_NAME>>` if the supplied
+ entity is identified as an extension.
+
+ Arguments:
+ newMacro -- The macro to use. Defaults to data.macro (if available), otherwise self.macro.
+ newEntity -- The entity to use. Defaults to data.entity (if available), otherwise self.entity.
+ data -- An EntityData value corresponding to this entity. If not provided, will be looked up by newEntity.
+ """
+ if not newEntity:
+ if data:
+ newEntity = data.entity
+ else:
+ newEntity = self.entity
+ if not newMacro:
+ if data:
+ newMacro = data.macro
+ else:
+ newMacro = self.macro
+ if not data:
+ data = self.checker.findEntity(newEntity)
+ if data and data.category == EXTENSION_CATEGORY:
+ return self.makeExtensionLink(newEntity)
+ return '{}:{}'.format(newMacro, newEntity)
+
+ def makeExtensionLink(self, newEntity=None):
+ """Create a correctly-formatted link to an extension.
+
+ Result takes the form `<<EXTENSION_NAME>>`.
+
+ Argument:
+ newEntity -- The extension name to link to. Defaults to self.entity.
+ """
+ if not newEntity:
+ newEntity = self.entity
+ return '`<<{}>>`'.format(newEntity)
+
+ def computeExpectedRefPageFromInclude(self, entity):
+ """Compute the expected ref page entity based on an include entity name."""
+ # No-op in general.
+ return entity
+
+ def makeRefPageTag(self, entity, data=None,
+ ref_type=None, desc='', xrefs=None):
+ """Construct a ref page tag string from attribute values."""
+ if ref_type is None and data is not None:
+ ref_type = data.directory
+ if ref_type is None:
+ ref_type = "????"
+ return "[open,refpage='{}',type='{}',desc='{}',xrefs='{}']".format(
+ entity, ref_type, desc, ' '.join(xrefs or []))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/main.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/main.py
new file mode 100644
index 00000000000..2cd4f69c044
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/main.py
@@ -0,0 +1,244 @@
+"""Provides a re-usable command-line interface to a MacroChecker."""
+
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+
+
+import argparse
+import logging
+import re
+from pathlib import Path
+
+from .shared import MessageId
+
+
+def checkerMain(default_enabled_messages, make_macro_checker,
+ all_docs, available_messages=None):
+ """Perform the bulk of the work for a command-line interface to a MacroChecker.
+
+ Arguments:
+ default_enabled_messages -- The MessageId values that should be enabled by default.
+ make_macro_checker -- A function that can be called with a set of enabled MessageId to create a
+ properly-configured MacroChecker.
+ all_docs -- A list of all spec documentation files.
+ available_messages -- a list of all MessageId values that can be generated for this project.
+ Defaults to every value. (e.g. some projects don't have MessageId.LEGACY)
+ """
+ enabled_messages = set(default_enabled_messages)
+ if not available_messages:
+ available_messages = list(MessageId)
+
+ disable_args = []
+ enable_args = []
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "--scriptlocation",
+ help="Append the script location generated a message to the output.",
+ action="store_true")
+ parser.add_argument(
+ "--verbose",
+ "-v",
+ help="Output 'info'-level development logging messages.",
+ action="store_true")
+ parser.add_argument(
+ "--debug",
+ "-d",
+ help="Output 'debug'-level development logging messages (more verbose than -v).",
+ action="store_true")
+ parser.add_argument(
+ "-Werror",
+ "--warning_error",
+ help="Make warnings act as errors, exiting with non-zero error code",
+ action="store_true")
+ parser.add_argument(
+ "--include_warn",
+ help="List all expected but unseen include files, not just those that are referenced.",
+ action='store_true')
+ parser.add_argument(
+ "-Wmissing_refpages",
+ help="List all entities with expected but unseen ref page blocks. NOT included in -Wall!",
+ action='store_true')
+ parser.add_argument(
+ "--include_error",
+ help="Make expected but unseen include files cause exiting with non-zero error code",
+ action='store_true')
+ parser.add_argument(
+ "--broken_error",
+ help="Make missing include/anchor for linked-to entities cause exiting with non-zero error code. Weaker version of --include_error.",
+ action='store_true')
+ parser.add_argument(
+ "--dump_entities",
+ help="Just dump the parsed entity data to entities.json and exit.",
+ action='store_true')
+ parser.add_argument(
+ "--html",
+ help="Output messages to the named HTML file instead of stdout.")
+ parser.add_argument(
+ "file",
+ help="Only check the indicated file(s). By default, all chapters and extensions are checked.",
+ nargs="*")
+ parser.add_argument(
+ "--ignore_count",
+ type=int,
+ help="Ignore up to the given number of errors without exiting with a non-zero error code.")
+ parser.add_argument("-Wall",
+ help="Enable all warning categories.",
+ action='store_true')
+
+ for message_id in MessageId:
+ enable_arg = message_id.enable_arg()
+ enable_args.append((message_id, enable_arg))
+
+ disable_arg = message_id.disable_arg()
+ disable_args.append((message_id, disable_arg))
+ if message_id in enabled_messages:
+ parser.add_argument('-' + disable_arg, action="store_true",
+ help="Disable message category {}: {}".format(str(message_id), message_id.desc()))
+ # Don't show the enable flag in help since it's enabled by default
+ parser.add_argument('-' + enable_arg, action="store_true",
+ help=argparse.SUPPRESS)
+ else:
+ parser.add_argument('-' + enable_arg, action="store_true",
+ help="Enable message category {}: {}".format(str(message_id), message_id.desc()))
+ # Don't show the disable flag in help since it's disabled by
+ # default
+ parser.add_argument('-' + disable_arg, action="store_true",
+ help=argparse.SUPPRESS)
+
+ args = parser.parse_args()
+
+ arg_dict = vars(args)
+ for message_id, arg in enable_args:
+ if args.Wall or (arg in arg_dict and arg_dict[arg]):
+ enabled_messages.add(message_id)
+
+ for message_id, arg in disable_args:
+ if arg in arg_dict and arg_dict[arg]:
+ enabled_messages.discard(message_id)
+
+ if args.verbose:
+ logging.basicConfig(level='INFO')
+
+ if args.debug:
+ logging.basicConfig(level='DEBUG')
+
+ checker = make_macro_checker(enabled_messages)
+
+ if args.dump_entities:
+ with open('entities.json', 'w', encoding='utf-8') as f:
+ f.write(checker.getEntityJson())
+ exit(0)
+
+ if args.file:
+ files = (str(Path(f).resolve()) for f in args.file)
+ else:
+ files = all_docs
+
+ for fn in files:
+ checker.processFile(fn)
+
+ if args.html:
+ from .html_printer import HTMLPrinter
+ printer = HTMLPrinter(args.html)
+ else:
+ from .console_printer import ConsolePrinter
+ printer = ConsolePrinter()
+
+ if args.scriptlocation:
+ printer.show_script_location = True
+
+ if args.file:
+ printer.output("Only checked specified files.")
+ for f in args.file:
+ printer.output(f)
+ else:
+ printer.output("Checked all chapters and extensions.")
+
+ if args.warning_error:
+ numErrors = checker.numDiagnostics()
+ else:
+ numErrors = checker.numErrors()
+
+ check_includes = args.include_warn
+ check_broken = not args.file
+
+ if args.file and check_includes:
+ print('Note: forcing --include_warn off because only checking supplied files.')
+ check_includes = False
+
+ printer.outputResults(checker, broken_links=(not args.file),
+ missing_includes=check_includes)
+
+ if check_broken:
+ numErrors += len(checker.getBrokenLinks())
+
+ if args.file and args.include_error:
+ print('Note: forcing --include_error off because only checking supplied files.')
+ args.include_error = False
+ if args.include_error:
+ numErrors += len(checker.getMissingUnreferencedApiIncludes())
+
+ check_missing_refpages = args.Wmissing_refpages
+ if args.file and check_missing_refpages:
+ print('Note: forcing -Wmissing_refpages off because only checking supplied files.')
+ check_missing_refpages = False
+
+ if check_missing_refpages:
+ missing = checker.getMissingRefPages()
+ if missing:
+ printer.output("Expected, but did not find, ref page blocks for the following {} entities: {}".format(
+ len(missing),
+ ', '.join(missing)
+ ))
+ if args.warning_error:
+ numErrors += len(missing)
+
+ printer.close()
+
+ if args.broken_error and not args.file:
+ numErrors += len(checker.getBrokenLinks())
+
+ if checker.hasFixes():
+ fixFn = 'applyfixes.sh'
+ print('Saving shell script to apply fixes as {}'.format(fixFn))
+ with open(fixFn, 'w', encoding='utf-8') as f:
+ f.write('#!/bin/sh -e\n')
+ for fileChecker in checker.files:
+ wroteComment = False
+ for msg in fileChecker.messages:
+ if msg.fix is not None:
+ if not wroteComment:
+ f.write('\n# {}\n'.format(fileChecker.filename))
+ wroteComment = True
+ search, replace = msg.fix
+ f.write(
+ r"sed -i -r 's~\b{}\b~{}~g' {}".format(
+ re.escape(search),
+ replace,
+ fileChecker.filename))
+ f.write('\n')
+
+ print('Total number of errors with this run: {}'.format(numErrors))
+
+ if args.ignore_count:
+ if numErrors > args.ignore_count:
+ # Exit with non-zero error code so that we "fail" CI, etc.
+ print('Exceeded specified limit of {}, so exiting with error'.format(
+ args.ignore_count))
+ exit(1)
+ else:
+ print('At or below specified limit of {}, so exiting with success'.format(
+ args.ignore_count))
+ exit(0)
+
+ if numErrors:
+ # Exit with non-zero error code so that we "fail" CI, etc.
+ print('Exiting with error')
+ exit(1)
+ else:
+ print('Exiting with success')
+ exit(0)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/shared.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/shared.py
new file mode 100644
index 00000000000..458632e8a69
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/shared.py
@@ -0,0 +1,257 @@
+"""Types, constants, and utility functions used by multiple sub-modules in spec_tools."""
+
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+
+import platform
+from collections import namedtuple
+from enum import Enum
+from inspect import getframeinfo
+from pathlib import Path
+from sys import stdout
+
+# if we have termcolor and we know our stdout is a TTY,
+# pull it in and use it.
+if hasattr(stdout, 'isatty') and stdout.isatty():
+ try:
+ from termcolor import colored as colored_impl
+ HAVE_COLOR = True
+ except ImportError:
+ HAVE_COLOR = False
+elif platform.system() == 'Windows':
+ try:
+ from termcolor import colored as colored_impl
+ import colorama
+ colorama.init()
+ HAVE_COLOR = True
+ except ImportError:
+ HAVE_COLOR = False
+
+else:
+ HAVE_COLOR = False
+
+
+def colored(s, color=None, attrs=None):
+ """Call termcolor.colored with same arguments if this is a tty and it is available."""
+ if HAVE_COLOR:
+ return colored_impl(s, color, attrs=attrs)
+ return s
+
+
+###
+# Constants used in multiple places.
+AUTO_FIX_STRING = 'Note: Auto-fix available.'
+EXTENSION_CATEGORY = 'extension'
+CATEGORIES_WITH_VALIDITY = set(('protos', 'structs'))
+NON_EXISTENT_MACROS = set(('plink', 'ttext', 'dtext'))
+
+###
+# MessageContext: All the information about where a message relates to.
+MessageContext = namedtuple('MessageContext',
+ ['filename', 'lineNum', 'line',
+ 'match', 'group'])
+
+
+def getInterestedRange(message_context):
+ """Return a (start, end) pair of character index for the match in a MessageContext."""
+ if not message_context.match:
+ # whole line
+ return (0, len(message_context.line))
+ return (message_context.match.start(), message_context.match.end())
+
+
+def getHighlightedRange(message_context):
+ """Return a (start, end) pair of character index for the highlighted range in a MessageContext."""
+ if message_context.group is not None and message_context.match is not None:
+ return (message_context.match.start(message_context.group),
+ message_context.match.end(message_context.group))
+ # no group (whole match) or no match (whole line)
+ return getInterestedRange(message_context)
+
+
+def toNameAndLine(context, root_path=None):
+ """Convert MessageContext into a simple filename:line string."""
+ my_fn = Path(context.filename)
+ if root_path:
+ my_fn = my_fn.relative_to(root_path)
+ return '{}:{}'.format(str(my_fn), context.lineNum)
+
+
+def generateInclude(dir_traverse, generated_type, category, entity):
+ """Create an include:: directive for generated api or validity from the various pieces."""
+ return f'include::{dir_traverse}{generated_type}/{category}/{entity}.adoc[]'
+
+
+# Data stored per entity (function, struct, enumerant type, enumerant, extension, etc.)
+EntityData = namedtuple(
+ 'EntityData', ['entity', 'macro', 'elem', 'filename', 'category', 'directory'])
+
+
+class MessageType(Enum):
+ """Type of a message."""
+
+ WARNING = 1
+ ERROR = 2
+ NOTE = 3
+
+ def __str__(self):
+ """Format a MessageType as a lowercase string."""
+ return str(self.name).lower()
+
+ def formattedWithColon(self):
+ """Format a MessageType as a colored, lowercase string followed by a colon."""
+ if self == MessageType.WARNING:
+ return colored(str(self) + ':', 'magenta', attrs=['bold'])
+ if self == MessageType.ERROR:
+ return colored(str(self) + ':', 'red', attrs=['bold'])
+ return str(self) + ':'
+
+
+class MessageId(Enum):
+ # Disable bogus pylint warnings in this enum
+ # pylint: disable=no-member
+ """Enumerates the varieties of messages that can be generated.
+
+ Control over enabled messages with -Wbla or -Wno_bla is per-MessageId.
+ """
+
+ MISSING_TEXT = 1
+ LEGACY = 2
+ WRONG_MACRO = 3
+ MISSING_MACRO = 4
+ BAD_ENTITY = 5
+ BAD_ENUMERANT = 6
+ BAD_MACRO = 7
+ UNRECOGNIZED_CONTEXT = 8
+ UNKNOWN_MEMBER = 9
+ DUPLICATE_INCLUDE = 10
+ UNKNOWN_INCLUDE = 11
+ API_VALIDITY_ORDER = 12
+ UNDOCUMENTED_MEMBER = 13
+ MEMBER_PNAME_MISSING = 14
+ MISSING_VALIDITY_INCLUDE = 15
+ MISSING_API_INCLUDE = 16
+ MISUSED_TEXT = 17
+ EXTENSION = 18
+ REFPAGE_TAG = 19
+ REFPAGE_MISSING_DESC = 20
+ REFPAGE_XREFS = 21
+ REFPAGE_XREFS_COMMA = 22
+ REFPAGE_TYPE = 23
+ REFPAGE_NAME = 24
+ REFPAGE_BLOCK = 25
+ REFPAGE_MISSING = 26
+ REFPAGE_MISMATCH = 27
+ REFPAGE_UNKNOWN_ATTRIB = 28
+ REFPAGE_SELF_XREF = 29
+ REFPAGE_XREF_DUPE = 30
+ REFPAGE_WHITESPACE = 31
+ REFPAGE_DUPLICATE = 32
+ UNCLOSED_BLOCK = 33
+ MISSING_INCLUDE_PATH_ATTRIBUTE = 34
+
+ def __str__(self):
+ """Format as a lowercase string."""
+ return self.name.lower()
+
+ def enable_arg(self):
+ """Return the corresponding Wbla string to make the 'enable this message' argument."""
+ return 'W{}'.format(self.name.lower())
+
+ def disable_arg(self):
+ """Return the corresponding Wno_bla string to make the 'enable this message' argument."""
+ return 'Wno_{}'.format(self.name.lower())
+
+ def desc(self):
+ """Return a brief description of the MessageId suitable for use in --help."""
+ return _MESSAGE_DESCRIPTIONS[self]
+
+
+_MESSAGE_DESCRIPTIONS = {
+ MessageId.MISSING_TEXT: "a *text: macro is expected but not found",
+ MessageId.LEGACY: "legacy usage of *name: macro when *link: is applicable",
+ MessageId.WRONG_MACRO: "wrong macro used for an entity",
+ MessageId.MISSING_MACRO: "a macro might be missing",
+ MessageId.BAD_ENTITY: "entity not recognized, etc.",
+ MessageId.BAD_ENUMERANT: "unrecognized enumerant value used in ename:",
+ MessageId.BAD_MACRO: "unrecognized macro used",
+ MessageId.UNRECOGNIZED_CONTEXT: "pname used with an unrecognized context",
+ MessageId.UNKNOWN_MEMBER: "pname used but member/argument by that name not found",
+ MessageId.DUPLICATE_INCLUDE: "duplicated include line",
+ MessageId.UNKNOWN_INCLUDE: "include line specified file we wouldn't expect to exists",
+ MessageId.API_VALIDITY_ORDER: "saw API include after validity include",
+ MessageId.UNDOCUMENTED_MEMBER: "saw an apparent struct/function documentation, but missing a member",
+ MessageId.MEMBER_PNAME_MISSING: "pname: missing from a 'scope' operator",
+ MessageId.MISSING_VALIDITY_INCLUDE: "missing validity include",
+ MessageId.MISSING_API_INCLUDE: "missing API include",
+ MessageId.MISUSED_TEXT: "a *text: macro is found but not expected",
+ MessageId.EXTENSION: "an extension name is incorrectly marked",
+ MessageId.REFPAGE_TAG: "a refpage tag is missing an expected field",
+ MessageId.REFPAGE_MISSING_DESC: "a refpage tag has an empty description",
+ MessageId.REFPAGE_XREFS: "an unrecognized entity is mentioned in xrefs of a refpage tag",
+ MessageId.REFPAGE_XREFS_COMMA: "a comma was founds in xrefs of a refpage tag, which is space-delimited",
+ MessageId.REFPAGE_TYPE: "a refpage tag has an incorrect type field",
+ MessageId.REFPAGE_NAME: "a refpage tag has an unrecognized entity name in its refpage field",
+ MessageId.REFPAGE_BLOCK: "a refpage block is not correctly opened or closed.",
+ MessageId.REFPAGE_MISSING: "an API include was found outside of a refpage block.",
+ MessageId.REFPAGE_MISMATCH: "an API or validity include was found in a non-matching refpage block.",
+ MessageId.REFPAGE_UNKNOWN_ATTRIB: "a refpage tag has an unrecognized attribute",
+ MessageId.REFPAGE_SELF_XREF: "a refpage tag has itself in the list of cross-references",
+ MessageId.REFPAGE_XREF_DUPE: "a refpage cross-references list has at least one duplicate",
+ MessageId.REFPAGE_WHITESPACE: "a refpage cross-references list has non-minimal whitespace",
+ MessageId.REFPAGE_DUPLICATE: "a refpage tag has been seen for a single entity for a second time",
+ MessageId.UNCLOSED_BLOCK: "one or more blocks remain unclosed at the end of a file",
+ MessageId.MISSING_INCLUDE_PATH_ATTRIBUTE: "include:: directives must begin with a recognized path attribute macro",
+}
+
+
+class Message(object):
+ """An Error, Warning, or Note with a MessageContext, MessageId, and message text.
+
+ May optionally have a replacement, a see_also array, an auto-fix,
+ and a stack frame where the message was created.
+ """
+
+ def __init__(self, message_id, message_type, message, context,
+ replacement=None, see_also=None, fix=None, frame=None):
+ """Construct a Message.
+
+ Typically called by MacroCheckerFile.diag().
+ """
+ self.message_id = message_id
+
+ self.message_type = message_type
+
+ if isinstance(message, str):
+ self.message = [message]
+ else:
+ self.message = message
+
+ self.context = context
+ if context is not None and context.match is not None and context.group is not None:
+ if context.group not in context.match.groupdict():
+ raise RuntimeError(
+ 'Group "{}" does not exist in the match'.format(context.group))
+
+ self.replacement = replacement
+
+ self.fix = fix
+
+ if see_also is None:
+ self.see_also = None
+ elif isinstance(see_also, MessageContext):
+ self.see_also = [see_also]
+ else:
+ self.see_also = see_also
+
+ self.script_location = None
+ if frame:
+ try:
+ frameinfo = getframeinfo(frame)
+ self.script_location = "{}:{}".format(
+ frameinfo.filename, frameinfo.lineno)
+ finally:
+ del frame
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/util.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/util.py
new file mode 100644
index 00000000000..bf25845081a
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/util.py
@@ -0,0 +1,58 @@
+"""Utility functions not closely tied to other spec_tools types."""
+# Copyright (c) 2018-2019 Collabora, Ltd.
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+
+def getElemName(elem, default=None):
+ """Get the name associated with an element, either a name child or name attribute."""
+ name_elem = elem.find('name')
+ if name_elem is not None:
+ return name_elem.text
+ # Fallback if there is no child.
+ return elem.get('name', default)
+
+
+def getElemType(elem, default=None):
+ """Get the type associated with an element, either a type child or type attribute."""
+ type_elem = elem.find('type')
+ if type_elem is not None:
+ return type_elem.text
+ # Fallback if there is no child.
+ return elem.get('type', default)
+
+
+def findFirstWithPredicate(collection, pred):
+ """Return the first element that satisfies the predicate, or None if none exist.
+
+ NOTE: Some places where this is used might be better served by changing to a dictionary.
+ """
+ for elt in collection:
+ if pred(elt):
+ return elt
+ return None
+
+
+def findNamedElem(elems, name):
+ """Traverse a collection of elements with 'name' nodes or attributes, looking for and returning one with the right name.
+
+ NOTE: Many places where this is used might be better served by changing to a dictionary.
+ """
+ return findFirstWithPredicate(elems, lambda elem: getElemName(elem) == name)
+
+
+def findTypedElem(elems, typename):
+ """Traverse a collection of elements with 'type' nodes or attributes, looking for and returning one with the right typename.
+
+ NOTE: Many places where this is used might be better served by changing to a dictionary.
+ """
+ return findFirstWithPredicate(elems, lambda elem: getElemType(elem) == typename)
+
+
+def findNamedObject(collection, name):
+ """Traverse a collection of elements with 'name' attributes, looking for and returning one with the right name.
+
+ NOTE: Many places where this is used might be better served by changing to a dictionary.
+ """
+ return findFirstWithPredicate(collection, lambda elt: elt.name == name)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/validity.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/validity.py
new file mode 100644
index 00000000000..18f9f979bc3
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spec_tools/validity.py
@@ -0,0 +1,225 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import re
+
+
+_A_VS_AN_RE = re.compile(r' a ([a-z]+:)?([aAeEiIoOxX]\w+\b)(?!:)')
+
+_STARTS_WITH_MACRO_RE = re.compile(r'^[a-z]+:.*')
+
+_VUID_ANCHOR_RE = re.compile(r'\[\[VUID-.*\]\]')
+
+
+def _checkAnchorComponents(anchor):
+ """Raise an exception if any component of a VUID anchor name is illegal."""
+ if anchor:
+ # Any other invalid things in an anchor name should be detected here.
+ if any((' ' in anchor_part for anchor_part in anchor)):
+ raise RuntimeError("Illegal component of a VUID anchor name!")
+
+
+def _fix_a_vs_an(s):
+ """Fix usage (often generated) of the indefinite article 'a' when 'an' is appropriate.
+
+ Explicitly excludes the markup macros."""
+ return _A_VS_AN_RE.sub(r' an \1\2', s)
+
+
+class ValidityCollection:
+ """Combines validity for a single entity."""
+
+ def __init__(self, entity_name=None, conventions=None, strict=True, verbose=False):
+ self.entity_name = entity_name
+ self.conventions = conventions
+ self.lines = []
+ self.strict = strict
+ self.verbose = verbose
+
+ def possiblyAddExtensionRequirement(self, extension_name, entity_preface):
+ """Add an extension-related validity statement if required.
+
+ entity_preface is a string that goes between "must be enabled prior to "
+ and the name of the entity, and normally ends in a macro.
+ For instance, might be "calling flink:" for a function.
+ """
+ if extension_name and not extension_name.startswith(self.conventions.api_version_prefix):
+ msg = 'The {} extension must: be enabled prior to {}{}'.format(
+ self.conventions.formatExtension(extension_name), entity_preface, self.entity_name)
+ self.addValidityEntry(msg, anchor=('extension', 'notenabled'))
+
+ def addValidityEntry(self, msg, anchor=None):
+ """Add a validity entry, optionally with a VUID anchor.
+
+ If any trailing arguments are supplied,
+ an anchor is generated by concatenating them with dashes
+ at the end of the VUID anchor name.
+ """
+ if not msg:
+ raise RuntimeError("Tried to add a blank validity line!")
+ parts = ['*']
+ _checkAnchorComponents(anchor)
+ if anchor:
+ if not self.entity_name:
+ raise RuntimeError('Cannot add a validity entry with an anchor to a collection that does not know its entity name.')
+ parts.append('[[{}]]'.format(
+ '-'.join(['VUID', self.entity_name] + list(anchor))))
+ parts.append(msg)
+ combined = _fix_a_vs_an(' '.join(parts))
+ if combined in self.lines:
+ raise RuntimeError("Duplicate validity added!")
+ self.lines.append(combined)
+
+ def addText(self, msg):
+ """Add already formatted validity text."""
+ if self.strict:
+ raise RuntimeError('addText called when collection in strict mode')
+ if not msg:
+ return
+ msg = msg.rstrip()
+ if not msg:
+ return
+ self.lines.append(msg)
+
+ def _extend(self, lines):
+ lines = list(lines)
+ dupes = set(lines).intersection(self.lines)
+ if dupes:
+ raise RuntimeError("The two sets contain some shared entries! " + str(dupes))
+ self.lines.extend(lines)
+
+ def __iadd__(self, other):
+ """Perform += with a string, iterable, or ValidityCollection."""
+ if other is None:
+ pass
+ elif isinstance(other, str):
+ if self.strict:
+ raise RuntimeError(
+ 'Collection += a string when collection in strict mode')
+ if not other:
+ # empty string
+ pass
+ elif other.startswith('*'):
+ # Handle already-formatted
+ self.addText(other)
+ else:
+ # Do the formatting ourselves.
+ self.addValidityEntry(other)
+ elif isinstance(other, ValidityEntry):
+ if other:
+ if other.verbose:
+ print(self.entity_name, 'Appending', str(other))
+ self.addValidityEntry(str(other), anchor=other.anchor)
+ elif isinstance(other, ValidityCollection):
+ if self.entity_name == other.entity_name:
+ self._extend(other.lines)
+ else:
+ # Remove foreign anchors - this is presumably an alias
+ if other.verbose:
+ print(self.entity_name,
+ 'merging with validity for',
+ other.entity_name,
+ 'so removing VUID anchor on incoming entries')
+ self._extend(_VUID_ANCHOR_RE.sub('', s, 1) for s in other.lines)
+ else:
+ # Deal with other iterables.
+ self._extend(other)
+
+ return self
+
+ def __bool__(self):
+ """Is the collection non-empty?"""
+ empty = not self.lines
+ return not empty
+
+ @property
+ def text(self):
+ """Access validity statements as a single string or None."""
+ if not self.lines:
+ return None
+ return '\n'.join(self.lines) + '\n'
+
+ def __str__(self):
+ """Access validity statements as a single string or empty string."""
+ if not self:
+ return ''
+ return self.text
+
+ def __repr__(self):
+ return '<ValidityCollection: {}>'.format(self.lines)
+
+
+class ValidityEntry:
+ """A single validity line in progress."""
+
+ def __init__(self, text=None, anchor=None):
+ """Prepare to add a validity entry, optionally with a VUID anchor.
+
+ An anchor is generated by concatenating the elements of the anchor tuple with dashes
+ at the end of the VUID anchor name.
+ """
+ _checkAnchorComponents(anchor)
+ if isinstance(anchor, str):
+ # anchor needs to be a tuple
+ anchor = (anchor,)
+
+ # VUID does not allow special chars except ":"
+ if anchor is not None:
+ anchor = [(anchor_value.replace('->', '::').replace('.', '::')) for anchor_value in anchor]
+
+ self.anchor = anchor
+ self.parts = []
+ self.verbose = False
+ if text:
+ self.append(text)
+
+ def append(self, part):
+ """Append a part of a string.
+
+ If this is the first entry part and the part doesn't start
+ with a markup macro, the first character will be capitalized."""
+ if not self.parts and not _STARTS_WITH_MACRO_RE.match(part):
+ self.parts.append(part[:1].upper())
+ self.parts.append(part[1:])
+ else:
+ self.parts.append(part)
+ if self.verbose:
+ print('ValidityEntry', id(self), 'after append:', str(self))
+
+ def drop_end(self, n):
+ """Remove up to n trailing characters from the string."""
+ temp = str(self)
+ n = min(len(temp), n)
+ self.parts = [temp[:-n]]
+
+ def __iadd__(self, other):
+ """Perform += with a string,"""
+ self.append(other)
+ return self
+
+ def __bool__(self):
+ """Return true if we have something more than just an anchor."""
+ empty = not self.parts
+ return not empty
+
+ def __str__(self):
+ """Access validity statement as a single string or empty string."""
+ if not self:
+ raise RuntimeError("No parts added?")
+ return ''.join(self.parts).strip()
+
+ def __repr__(self):
+ parts = ['<ValidityEntry: ']
+ if self:
+ parts.append('"')
+ parts.append(str(self))
+ parts.append('"')
+ else:
+ parts.append('EMPTY')
+ if self.anchor:
+ parts.append(', anchor={}'.format('-'.join(self.anchor)))
+ parts.append('>')
+ return ''.join(parts)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spirvcapgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spirvcapgenerator.py
new file mode 100644
index 00000000000..71eba3d3b50
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/spirvcapgenerator.py
@@ -0,0 +1,238 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from generator import OutputGenerator, write
+from spec_tools.attributes import ExternSyncEntry
+from spec_tools.util import getElemName
+
+import pdb
+
+def makeLink(link, altlink = None):
+ """Create an asciidoctor link, optionally with altlink text
+ if provided"""
+
+ if altlink is not None:
+ return '<<{},{}>>'.format(link, altlink)
+ else:
+ return '<<{}>>'.format(link)
+
+class SpirvCapabilityOutputGenerator(OutputGenerator):
+ """SpirvCapabilityOutputGenerator - subclass of OutputGenerator.
+ Generates AsciiDoc includes of the SPIR-V capabilities table for the
+ features chapter of the API specification.
+
+ ---- methods ----
+ SpirvCapabilityOutputGenerator(errFile, warnFile, diagFile) - args as for
+ OutputGenerator. Defines additional internal state.
+ ---- methods overriding base class ----
+ genCmd(cmdinfo)"""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ def beginFile(self, genOpts):
+ OutputGenerator.beginFile(self, genOpts)
+
+ # Accumulate SPIR-V capability and feature information
+ self.spirv = []
+
+ def getCondition(self, enable, parent):
+ """Return a strings which is the condition under which an
+ enable is supported.
+
+ - enable - ElementTree corresponding to an <enable> XML tag for a
+ SPIR-V capability or extension
+ - parent - Parent <spirvcapability> or <spirvenable> ElementTree,
+ used for error reporting"""
+
+ if enable.get('version'):
+ return enable.get('version')
+ elif enable.get('extension'):
+ return enable.get('extension')
+ elif enable.get('struct') or enable.get('property'):
+ return enable.get('requires')
+ else:
+ self.logMsg('error', f"<{parent.tag} name=\"{parent.get('name')}\"> is missing a required attribute for an <enable>")
+ return ''
+
+ def getConditions(self, enables):
+ """Return a sorted list of strings which are conditions under which
+ one or more of the enables is supported.
+
+ - enables - ElementTree corresponding to a <spirvcapability> or
+ <spirvextension> XML tag"""
+
+ conditions = set()
+ for enable in enables.findall('enable'):
+ condition = self.getCondition(enable, parent=enables)
+ if condition != None:
+ conditions.add(condition)
+ return sorted(conditions)
+
+ def endFile(self):
+ captable = []
+ exttable = []
+
+ # How to "indent" a pseudo-column for better use of space.
+ # {captableindent} is defined in appendices/spirvenv.adoc
+ indent = '{captableindent}'
+
+ for elem in self.spirv:
+ conditions = self.getConditions(elem)
+
+ # Combine all conditions for enables and surround the row with
+ # them
+ if len(conditions) > 0:
+ condition_string = ','.join(conditions)
+ prefix = [ 'ifdef::{}[]'.format(condition_string) ]
+ suffix = [ 'endif::{}[]'.format(condition_string) ]
+ else:
+ prefix = []
+ suffix = []
+
+ body = []
+
+ # Generate an anchor for each capability
+ if elem.tag == 'spirvcapability':
+ anchor = '[[spirvenv-capabilities-table-{}]]'.format(
+ elem.get('name'))
+ else:
+ # <spirvextension> entries do not get anchors
+ anchor = ''
+
+ # First "cell" in a table row, and a break for the other "cells"
+ body.append('| {}code:{} +'.format(anchor, elem.get('name')))
+
+ # Iterate over each enable emitting a formatting tag for it
+ # Protect the term if there is a version or extension
+ # requirement, and if there are multiple enables (otherwise,
+ # the ifdef protecting the entire row will suffice).
+
+ enables = [e for e in elem.findall('enable')]
+
+ remaining = len(enables)
+ for subelem in enables:
+ remaining -= 1
+
+ # Sentinel value
+ linktext = None
+ if subelem.get('version'):
+ version = subelem.get('version')
+
+ # Convert API enum to anchor for version appendices (versions-m.n)
+ # version must be the spec conditional macro VK_VERSION_m_n, not
+ # the API version macro VK_API_VERSION_m_n.
+ enable = version
+ link = 'versions-' + version[-3:].replace('_', '.')
+ altlink = version
+
+ linktext = makeLink(link, altlink)
+ elif subelem.get('extension'):
+ extension = subelem.get('extension')
+
+ enable = extension
+ link = extension
+ altlink = None
+
+ # This uses the extension name macro, rather than
+ # asciidoc markup
+ linktext = '`apiext:{}`'.format(extension)
+ elif subelem.get('struct'):
+ struct = subelem.get('struct')
+ feature = subelem.get('feature')
+ requires = subelem.get('requires')
+ alias = subelem.get('alias')
+
+ link_name = feature
+ # For cases, like bufferDeviceAddressEXT where need manual help
+ if alias:
+ link_name = alias
+ exceptions = {
+ 'VkPhysicalDeviceCooperativeMatrixFeaturesNV::cooperativeMatrix': 'cooperativeMatrix-NV',
+ }
+ if struct + '::' + feature in exceptions:
+ link_name = exceptions[struct + '::' + feature]
+
+ enable = requires
+ link = 'features-' + link_name
+ altlink = 'sname:{}::pname:{}'.format(struct, feature)
+
+ linktext = makeLink(link, altlink)
+ else:
+ property = subelem.get('property')
+ member = subelem.get('member')
+ requires = subelem.get('requires')
+ value = subelem.get('value')
+
+ enable = requires
+ # Properties should have a "feature" prefix
+ link = 'limits-' + member
+ # Display the property value by itself if it is not a boolean (matches original table)
+ # DenormPreserve is an example where it makes sense to just show the
+ # member value as it is just a boolean and the name implies "true"
+ # GroupNonUniformVote is an example where the whole name is too long
+ # better to just display the value
+ if value == "VK_TRUE":
+ altlink = 'sname:{}::pname:{}'.format(property, member)
+ else:
+ altlink = '{}'.format(value)
+
+ linktext = makeLink(link, altlink)
+
+ # If there are no more enables, do not continue the last line
+ if remaining > 0:
+ continuation = ' +'
+ else:
+ continuation = ''
+
+ # condition_string != enable is a small optimization
+ if enable is not None and condition_string != enable:
+ body.append('ifdef::{}[]'.format(enable))
+ body.append('{} {}{}'.format(indent, linktext, continuation))
+ if enable is not None and condition_string != enable:
+ body.append('endif::{}[]'.format(enable))
+
+ if elem.tag == 'spirvcapability':
+ captable += prefix + body + suffix
+ else:
+ exttable += prefix + body + suffix
+
+ # Generate the asciidoc include files
+ self.writeBlock('captable.adoc', captable)
+ self.writeBlock('exttable.adoc', exttable)
+
+ # Finish processing in superclass
+ OutputGenerator.endFile(self)
+
+ def writeBlock(self, basename, contents):
+ """Generate an include file.
+
+ - directory - subdirectory to put file in
+ - basename - base name of the file
+ - contents - contents of the file (Asciidoc boilerplate aside)"""
+
+ filename = self.genOpts.directory + '/' + basename
+ self.logMsg('diag', '# Generating include file:', filename)
+ with open(filename, 'w', encoding='utf-8') as fp:
+ write(self.genOpts.conventions.warning_comment, file=fp)
+
+ if len(contents) > 0:
+ for str in contents:
+ write(str, file=fp)
+ else:
+ self.logMsg('diag', '# No contents for:', filename)
+
+ def genSpirv(self, capinfo, name, alias):
+ """Generate SPIR-V capabilities
+
+ capinfo - dictionary entry for an XML <spirvcapability> or
+ <spirvextension> element
+ name - name attribute of capinfo.elem"""
+
+ OutputGenerator.genSpirv(self, capinfo, name, alias)
+
+ # Just accumulate each element, process in endFile
+ self.spirv.append(capinfo.elem)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/stripAPI.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/stripAPI.py
new file mode 100755
index 00000000000..ea37f59e7b2
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/stripAPI.py
@@ -0,0 +1,42 @@
+#!/usr/bin/python3
+#
+# Copyright 2023 The Khronos Group Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+import argparse
+import xml.etree.ElementTree as etree
+from reg import stripNonmatchingAPIs
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(prog='stripAPI',
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ description='''\
+Filters out elements with non-matching explicit 'api' attributes from API XML.
+To remove Vulkan SC-only elements from the combined API XML:
+ python3 scripts/stripAPI.py -input xml/vk.xml -output vulkan-only.xml -keepAPI vulkan
+To remove Vulkan-only elements:
+ python3 scripts/stripAPI.py -input xml/vk.xml -output vulkansc-only.xml -keepAPI vulkansc
+If you are parsing the XML yourself but using the xml.etree package, the
+equivalent runtime code is:
+ import reg
+ reg.stripNonmatchingAPIs(tree.getroot(), keepAPI, actuallyDelete=True)
+where 'tree' is an ElementTree created from the XML file using
+ etree.parse(filename)''')
+
+ parser.add_argument('-input', action='store',
+ required=True,
+ help='Specify input registry XML')
+ parser.add_argument('-output', action='store',
+ required=True,
+ help='Specify output registry XML')
+ parser.add_argument('-keepAPI', action='store',
+ default=None,
+ help='Specify API name whose \'api\' tags are kept')
+
+ args = parser.parse_args()
+
+ tree = etree.parse(args.input)
+ if args.keepAPI is not None:
+ stripNonmatchingAPIs(tree.getroot(), args.keepAPI, actuallyDelete = True)
+ tree.write(args.output)
+
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/syncgenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/syncgenerator.py
new file mode 100644
index 00000000000..d8f282154e1
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/syncgenerator.py
@@ -0,0 +1,241 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from generator import OutputGenerator, write
+import os
+
+queueTypeToQueueFlags = {
+ 'graphics' : 'VK_QUEUE_GRAPHICS_BIT',
+ 'compute' : 'VK_QUEUE_COMPUTE_BIT',
+ 'transfer' : 'VK_QUEUE_TRANSFER_BIT',
+ 'sparse_binding' : 'VK_QUEUE_SPARSE_BINDING_BIT',
+ 'decode' : 'VK_QUEUE_VIDEO_DECODE_BIT_KHR',
+ 'encode' : 'VK_QUEUE_VIDEO_ENCODE_BIT_KHR',
+ 'opticalflow' : 'VK_QUEUE_OPTICAL_FLOW_BIT_NV',
+}
+
+class SyncOutputGenerator(OutputGenerator):
+ """SyncOutputGenerator - subclass of OutputGenerator.
+ Generates AsciiDoc includes of the table for the Synchronization chapters
+ of the API specification.
+
+ ---- methods ----
+ SyncOutputGenerator(errFile, warnFile, diagFile) - args as for
+ OutputGenerator. Defines additional internal state.
+ ---- methods overriding base class ----
+ """
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ # List of all elements
+ self.pipeline_stages = []
+ self.access_flags = []
+
+ # <Pipeline Stage, condition as asciidoc string>
+ self.pipeline_stage_condition = dict()
+ # <sccess flag, condition as asciidoc string>
+ self.access_flag_condition = dict()
+
+ # <Pipeline Stage, [equivalent pipeline stages]>
+ self.pipeline_stage_equivalent = dict()
+ # <Pipeline Stage, [queue support]>
+ self.pipeline_stage_queue_support = dict()
+
+ # <Access Flag, [equivalent access flaga]>
+ self.access_flag_equivalent = dict()
+ # <Access Flag, [pipeline stage support]>
+ self.access_flag_stage_support = dict()
+
+ self.pipeline_order_info = []
+
+ def endFile(self):
+ self.writeFlagDefinitions()
+ self.supportedPipelineStages()
+ self.supportedAccessTypes()
+ self.pipelineOrdering()
+ OutputGenerator.endFile(self)
+
+ def writeBlock(self, basename, contents):
+ """Generate an include file.
+
+ - directory - subdirectory to put file in
+ - basename - base name of the file
+ - contents - contents of the file (Asciidoc boilerplate aside)"""
+
+ filename = self.genOpts.directory + '/' + basename
+ self.logMsg('diag', '# Generating include file:', filename)
+ dirname = os.path.dirname(filename)
+ if not os.path.exists(dirname):
+ os.makedirs(dirname)
+ with open(filename, 'w', encoding='utf-8') as fp:
+ write(self.genOpts.conventions.warning_comment, file=fp)
+
+ if len(contents) > 0:
+ for str in contents:
+ write(str, file=fp)
+ else:
+ self.logMsg('diag', '# No contents for:', filename)
+
+ def genSyncStage(self, stageinfo):
+ OutputGenerator.genSyncStage(self, stageinfo)
+ name = stageinfo.elem.get('name')
+ self.pipeline_stages.append(name)
+
+ if stageinfo.condition is not None:
+ self.pipeline_stage_condition[name] = stageinfo.condition
+
+ syncsupport = stageinfo.elem.find('syncsupport')
+ if syncsupport is not None:
+ self.pipeline_stage_queue_support[name] = syncsupport.get('queues').split(',')
+
+ syncequivalent = stageinfo.elem.find('syncequivalent')
+ if syncequivalent is not None:
+ self.pipeline_stage_equivalent[name] = syncequivalent.get('stage').split(',')
+
+ def genSyncAccess(self, accessinfo):
+ OutputGenerator.genSyncStage(self, accessinfo)
+ name = accessinfo.elem.get('name')
+ self.access_flags.append(name)
+
+ if accessinfo.condition is not None:
+ self.access_flag_condition[name] = accessinfo.condition
+
+ syncsupport = accessinfo.elem.find('syncsupport')
+ if syncsupport is not None:
+ self.access_flag_stage_support[name] = syncsupport.get('stage').split(',')
+
+ syncequivalent = accessinfo.elem.find('syncequivalent')
+ if syncequivalent is not None:
+ self.access_flag_equivalent[name] = syncequivalent.get('access').split(',')
+
+ def genSyncPipeline(self, pipelineinfo):
+ OutputGenerator.genSyncStage(self, pipelineinfo)
+ self.pipeline_order_info.append(pipelineinfo)
+
+ def isSameConditionPipeline(self, condition, stage):
+ if stage not in self.pipeline_stage_condition:
+ return False
+ if condition is None:
+ return False
+ return self.pipeline_stage_condition[stage] == condition
+
+ def isSameConditionPipelineAccess(self, stage, flag):
+ if stage not in self.pipeline_stage_condition:
+ return False
+ if flag not in self.access_flag_condition:
+ return False
+ return self.pipeline_stage_condition[stage] == self.access_flag_condition[flag]
+
+ def writePipelineIfdef(self, stage, list):
+ condition = self.pipeline_stage_condition[stage] if stage in self.pipeline_stage_condition else None
+ if condition is not None:
+ list.append('ifdef::{}[]'.format(condition))
+
+ def writePipelineEndif(self, stage, list):
+ condition = self.pipeline_stage_condition[stage] if stage in self.pipeline_stage_condition else None
+ if condition is not None:
+ list.append('endif::{}[]'.format(condition))
+
+ def writeAccessIfdef(self, flag, list):
+ condition = self.access_flag_condition[flag] if flag in self.access_flag_condition else None
+ if condition is not None:
+ list.append('ifdef::{}[]'.format(condition))
+
+ def writeAccessEndif(self, flag, list):
+ condition = self.access_flag_condition[flag] if flag in self.access_flag_condition else None
+ if condition is not None:
+ list.append('endif::{}[]'.format(condition))
+
+ def writeFlagDefinitions(self):
+ for name, stages in self.pipeline_stage_equivalent.items():
+ output = []
+ for stage in stages:
+ self.writePipelineIfdef(stage, output)
+ output.append(' ** ename:{}'.format(stage))
+ self.writePipelineEndif(stage, output)
+
+ self.writeBlock(f'flagDefinitions/{name}{self.file_suffix}', output)
+
+ for name, flags in self.access_flag_equivalent.items():
+ output = []
+ for flag in flags:
+ self.writeAccessIfdef(flag, output)
+ output.append(' ** ename:{}'.format(flag))
+ self.writeAccessEndif(flag, output)
+
+ self.writeBlock(f'flagDefinitions/{name}{self.file_suffix}', output)
+
+ def supportedPipelineStages(self):
+ output = []
+ for stage in self.pipeline_stages:
+ self.writePipelineIfdef(stage, output)
+ queue_support = ''
+ if stage not in self.pipeline_stage_queue_support:
+ queue_support = 'None required'
+ else:
+ for queue in self.pipeline_stage_queue_support[stage]:
+ ename = 'ename:{}'.format(queueTypeToQueueFlags[queue])
+ if queue_support != '':
+ queue_support += ' or '
+ queue_support += ename
+
+ output.append('|ename:{} | {}'.format(stage, queue_support))
+
+ self.writePipelineEndif(stage, output)
+
+ self.writeBlock(f'supportedPipelineStages{self.file_suffix}', output)
+
+ def supportedAccessTypes(self):
+ output = []
+ for flag in self.access_flags:
+ self.writeAccessIfdef(flag, output)
+ output.append('|ename:{} |'.format(flag))
+
+ if flag not in self.access_flag_stage_support:
+ output.append('\tAny')
+ else:
+ stages = self.access_flag_stage_support[flag]
+ for index, stage in enumerate(stages):
+ end_symbol = ''
+ if index != (len(stages) - 1) and len(stages) > 1:
+ end_symbol = ','
+
+ if not self.isSameConditionPipelineAccess(stage, flag):
+ self.writePipelineIfdef(stage, output)
+ output.append('\tename:{}{}'.format(stage, end_symbol))
+ if not self.isSameConditionPipelineAccess(stage, flag):
+ self.writePipelineEndif(stage, output)
+
+ self.writeAccessEndif(flag, output)
+
+ self.writeBlock(f'supportedAccessTypes{self.file_suffix}', output)
+
+ def pipelineOrdering(self):
+ for pipelineinfo in self.pipeline_order_info:
+ output = []
+ name = pipelineinfo.elem.get('name')
+ depends = pipelineinfo.elem.get('depends')
+ syncPipelineStages = pipelineinfo.elem.findall('syncpipelinestage')
+
+ for stageElem in syncPipelineStages:
+ stage = stageElem.text
+ order = stageElem.get('order')
+ before = stageElem.get('before')
+ after = stageElem.get('after')
+ if order == 'None':
+ continue
+
+ if not self.isSameConditionPipeline(depends, stage):
+ self.writePipelineIfdef(stage, output)
+
+ output.append(' * ename:{}'.format(stage))
+
+ if not self.isSameConditionPipeline(depends, stage):
+ self.writePipelineEndif(stage, output)
+
+ file_name = name.replace(' ', '_')
+ self.writeBlock(f'pipelineOrders/{file_name}{self.file_suffix}', output)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/testSpecVersion.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/testSpecVersion.py
new file mode 100755
index 00000000000..dbedca86a6c
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/testSpecVersion.py
@@ -0,0 +1,75 @@
+#!/usr/bin/python3
+#
+# Copyright 2017-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# testSpecVersion - check if SPEC_VERSION values for an unpublished
+# extension branch meet the requirement of being 1.
+#
+# Usage: textSpecVersion.py [-branch branchname] [-registry file]
+#
+# Checks for an XML <extension> matching the branch name specified
+# on the command line, or the current branch if not specified.
+#
+# If not found, the branch is not an extension staging branch; succeed.
+# If found, but extension is disabled, do not run the test; succeed.
+# If found, and extension SPEC_VERSION has a value of '1', succeed.
+# Otherwise, fail.
+
+import argparse
+import sys
+import xml.etree.ElementTree as etree
+from reflib import getBranch
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-branch', action='store',
+ default=None,
+ help='Specify branch to check against')
+ parser.add_argument('-registry', action='store',
+ default='xml/vk.xml',
+ help='Use specified registry file instead of vk.xml')
+ args = parser.parse_args()
+
+ try:
+ tree = etree.parse(args.registry)
+ except:
+ print('ERROR - cannot open registry XML file', args.registry)
+ sys.exit(1)
+
+ errors = ''
+ if args.branch is None:
+ (args.branch, errors) = getBranch()
+ if args.branch is None:
+ print('ERROR - Cannot determine current git branch:', errors)
+ sys.exit(1)
+
+ elem = tree.find('extensions/extension[@name="' + args.branch + '"]')
+
+ if elem == None:
+ print('Success - assuming', args.branch, 'is not an extension branch')
+ sys.exit(0)
+
+ supported = elem.get('supported')
+ if supported == 'disabled':
+ print('Success - branch name', args.branch, 'matches, but extension is disabled')
+ sys.exit(0)
+
+ for enum in elem.findall('require/enum'):
+ name = enum.get('name')
+
+ if name is not None and name[-13:] == '_SPEC_VERSION':
+ value = enum.get('value')
+ if value >= '1':
+ print('Success - {} = {} for branch {}'.format(
+ name, value, args.branch))
+ sys.exit(0)
+ else:
+ print('ERROR - {} = {} for branch {}, but must be >= 1'.format(
+ name, value, args.branch))
+ sys.exit(1)
+
+ print('ERROR - no SPEC_VERSION token found for branch', args.branch)
+ sys.exit(1)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_check_spec_links.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_check_spec_links.py
new file mode 100644
index 00000000000..fcc97f8bd4e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_check_spec_links.py
@@ -0,0 +1,643 @@
+#!/usr/bin/python3
+#
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+#
+# Purpose: This file contains tests for check_spec_links.py
+
+import pytest
+
+from check_spec_links import MessageId, makeMacroChecker
+from spec_tools.console_printer import ConsolePrinter
+from spec_tools.macro_checker_file import shouldEntityBeText
+
+# API-specific constants
+PROTO = 'vkCreateInstance'
+STRUCT = 'VkInstanceCreateInfo'
+EXT = 'VK_KHR_display'
+
+
+class CheckerWrapper(object):
+ """Little wrapper object for a MacroChecker.
+
+ Intended for use in making test assertions shorter and easier to read."""
+
+ def __init__(self, capsys):
+ self.ckr = makeMacroChecker(set())
+ self.capsys = capsys
+
+ def enabled(self, enabled_messages):
+ """Updates the checker's enable message type set, from an iterable."""
+ self.ckr.enabled_messages = set(enabled_messages)
+ return self
+
+ def check(self, string):
+ """Checks a string (as if it were a file), outputs the results to the console, then returns the MacroCheckerFile."""
+
+ # Flush the captured output.
+ _ = self.capsys.readouterr()
+
+ # Process
+ f = self.ckr.processString(string + '\n')
+
+ # Dump messages
+ ConsolePrinter().output(f)
+ return f
+
+
+@pytest.fixture
+def ckr(capsys):
+ """Fixture - add an arg named ckr to your test function to automatically get one passed to you."""
+ return CheckerWrapper(capsys)
+
+
+def msgReplacement(file_checker, which=0):
+ """Return the replacement text associated with the specified message."""
+ assert(len(file_checker.messages) > which)
+ msg = file_checker.messages[which]
+ from pprint import pprint
+ pprint(msg.script_location)
+ pprint(msg.replacement)
+ pprint(msg.fix)
+ return msg.replacement
+
+
+def loneMsgReplacement(file_checker):
+ """Assert there's only one message in a file checker, and return the replacement text associated with it."""
+ assert(len(file_checker.messages) == 1)
+ return msgReplacement(file_checker)
+
+
+def message(file_checker, which=0):
+ """Return a string of the message lines associated with the message of a file checker."""
+ assert(len(file_checker.messages) > which)
+ return "\n".join(file_checker.messages[which].message)
+
+
+def allMessages(file_checker):
+ """Return a list of strings, each being the combination of the message lines of a message from a file checker."""
+ return ['\n'.join(msg.message) for msg in file_checker.messages]
+
+
+def test_missing_macro(ckr):
+ """Verify correct functioning of MessageId.MISSING_MACRO."""
+ ckr.enabled([MessageId.MISSING_MACRO])
+
+ # This should have a missing macro warning
+ assert(ckr.check('with %s by' % PROTO).numDiagnostics() == 1)
+
+ # These 3 should not have a missing macro warning because of their context
+ # (in a link)
+ assert(not ckr.check('<<%s' % PROTO).messages)
+ # These 2 are simulating links that broke over lines
+ assert(not ckr.check('%s>>' % PROTO).messages)
+ assert(not ckr.check(
+ '%s asdf>> table' % PROTO).messages)
+
+
+def test_entity_detection(ckr):
+ ckr.enabled([MessageId.BAD_ENTITY])
+ # Should complain about BAD_ENTITY
+ assert(ckr.check('flink:abcd').numDiagnostics() == 1)
+
+ # Should just give BAD_ENTITY (an error), not MISSING_TEXT (a warning).
+ # Verifying that wrapping in asterisks (for formatting) doesn't get picked up as
+ # an asterisk in the entity name (a placeholder).
+ ckr.enabled(
+ [MessageId.MISSING_TEXT, MessageId.BAD_ENTITY])
+ assert(ckr.check('*flink:abcd*').numErrors() == 1)
+
+
+def test_wrong_macro(ckr):
+ ckr.enabled([MessageId.WRONG_MACRO])
+ # Should error - this ought to be code:uint32_t
+ assert(ckr.check('basetype:uint32_t').numErrors() == 1)
+
+ # This shouldn't error
+ assert(ckr.check('code:uint32_t').numErrors() == 0)
+
+
+def test_should_entity_be_text():
+ # These 5 are all examples of patterns that would merit usage of a ptext/etext/etc
+ # macro, for various reasons:
+
+ # has variable in subscript
+ assert(shouldEntityBeText('pBuffers[i]', '[i]'))
+ assert(shouldEntityBeText('API_ENUM_[X]', '[X]'))
+
+ # has asterisk
+ assert(shouldEntityBeText('maxPerStage*', None))
+
+ # double-underscores make italicized placeholders
+ # (triple are double-underscores delimited by underscores...)
+ assert(shouldEntityBeText('API_ENUM[__x__]', '[__x__]'))
+ assert(shouldEntityBeText('API_ENUM___i___EXT', None))
+
+ # This shouldn't be a *text: macro because it only has single underscores
+ assert(False == shouldEntityBeText('API_ENUM_i_EXT', None))
+
+
+def test_misused_text(ckr):
+ # Tests the same patterns as test_should_entity_be_text(),
+ # but in a whole checker
+ ckr.enabled([MessageId.MISUSED_TEXT])
+
+ assert(ckr.check('etext:API_ENUM_').numDiagnostics() == 0)
+ assert(ckr.check('etext:API_ENUM_[X]').numDiagnostics() == 0)
+ assert(ckr.check('etext:API_ENUM[i]').numDiagnostics() == 0)
+ assert(ckr.check('etext:API_ENUM[__x__]').numDiagnostics() == 0)
+
+ # Should be OK, since __i__ is a placeholder here
+ assert(ckr.check('etext:API_ENUM___i___EXT').numDiagnostics() == 0)
+
+ # This shouldn't be a *text: macro because it only has single underscores
+ assert(ckr.check('API_ENUM_i_EXT').numDiagnostics() == 0)
+
+
+def test_extension(ckr):
+ ckr.enabled(set(MessageId))
+ # Check formatting of extension names:
+ # the following is the canonical way to refer to an extension
+ # (link wrapped in backticks)
+ expected_replacement = '`<<%s>>`' % EXT
+
+ # Extension name mentioned without any markup, should be added
+ assert(loneMsgReplacement(ckr.check('asdf %s asdf' % EXT))
+ == expected_replacement)
+
+ # Extension name mentioned without any markup and wrong case,
+ # should be added and have case fixed
+ assert(loneMsgReplacement(ckr.check('asdf %s asdf' % EXT.upper()))
+ == expected_replacement)
+
+ # Extension name using wrong/old macro: ename isn't for extensions.
+ assert(loneMsgReplacement(ckr.check('asdf ename:%s asdf' % EXT))
+ == expected_replacement)
+
+ # Extension name using wrong macro: elink isn't for extensions.
+ assert(loneMsgReplacement(ckr.check('asdf elink:%s asdf' % EXT))
+ == expected_replacement)
+
+ # Extension name using wrong macro and wrong case: should have markup and
+ # case fixed
+ assert(loneMsgReplacement(ckr.check('asdf elink:%s asdf' % EXT.upper()))
+ == expected_replacement)
+
+ # This shouldn't cause errors because this is how we want it to look.
+ assert(not ckr.check('asdf `<<%s>>` asdf' % EXT).messages)
+
+ # This doesn't (shouldn't?) cause errors because just backticks on their own
+ # "escape" names from the "missing markup" tests.
+ assert(not ckr.check('asdf `%s` asdf' % EXT).messages)
+
+ # TODO can we auto-correct this to add the backticks?
+ # Doesn't error now, but would be nice if it did...
+ assert(not ckr.check('asdf <<%s>> asdf' % EXT).messages)
+
+
+def test_refpage_tag(ckr):
+ ckr.enabled([MessageId.REFPAGE_TAG])
+
+ # Should error: missing refpage='' field
+ assert(ckr.check("[open,desc='',type='',xrefs='']").numErrors() == 1)
+ # Should error: missing desc='' field
+ assert(ckr.check("[open,refpage='',type='',xrefs='']").numErrors() == 1)
+ # Should error: missing type='' field
+ assert(ckr.check("[open,refpage='',desc='',xrefs='']").numErrors() == 1)
+
+ # Should not error: missing xrefs field is optional
+ assert(not ckr.check("[open,refpage='',desc='',type='']").messages)
+
+ # Should error, due to missing refpage, but not crash due to message printing (note the unicode smart quote)
+ assert(ckr.check("[open,desc='',type='',xrefs=’']").numDiagnostics() == 1)
+
+
+def test_refpage_name(ckr):
+ ckr.enabled([MessageId.REFPAGE_NAME])
+ # Should not error: actually exists.
+ assert(ckr.check(
+ "[open,refpage='%s',desc='',type='']" % PROTO).numDiagnostics() == 0)
+
+ # Should error: does not exist.
+ assert(
+ ckr.check("[open,refpage='bogus',desc='',type='']").numDiagnostics() == 1)
+
+
+def test_refpage_missing_desc(ckr):
+ ckr.enabled([MessageId.REFPAGE_MISSING_DESC])
+ # Should not warn: non-empty description actually exists.
+ assert(ckr.check(
+ "[open,refpage='',desc='non-empty description',type='']").numDiagnostics() == 0)
+
+ # Should warn: desc field is empty.
+ assert(
+ ckr.check("[open,refpage='',desc='',type='']").numDiagnostics() == 1)
+
+
+def test_refpage_type(ckr):
+ ckr.enabled([MessageId.REFPAGE_TYPE])
+ # Should not error: this is of type 'protos'.
+ assert(not ckr.check(
+ "[open,refpage='%s',desc='',type='protos']" % PROTO).messages)
+
+ # Should error: this is of type 'protos', not 'structs'.
+ assert(
+ ckr.check("[open,refpage='%s',desc='',type='structs']" % PROTO).messages)
+
+
+def test_refpage_xrefs(ckr):
+ ckr.enabled([MessageId.REFPAGE_XREFS])
+ # Should not error: this is a valid entity to have an xref to.
+ assert(not ckr.check(
+ "[open,refpage='',desc='',type='protos',xrefs='%s']" % STRUCT).messages)
+
+ # case difference:
+ # should error but offer a replacement.
+ assert(loneMsgReplacement(ckr.check("[open,refpage='',xrefs='%s']" % STRUCT.lower()))
+ == STRUCT)
+
+ # Should error: not a valid entity.
+ assert(ckr.check(
+ "[open,refpage='',desc='',type='protos',xrefs='bogus']").numDiagnostics() == 1)
+
+
+def test_refpage_xrefs_comma(ckr):
+ ckr.enabled([MessageId.REFPAGE_XREFS_COMMA])
+ # Should not error: no commas in the xrefs field
+ assert(not ckr.check(
+ "[open,refpage='',xrefs='abc']").messages)
+
+ # Should error: commas shouldn't be there since it's space-delimited.
+ assert(loneMsgReplacement(
+ ckr.check("[open,refpage='',xrefs='abc,']")) == 'abc')
+
+ # All should correct to the same thing.
+ equivalent_tags_with_commas = [
+ "[open,refpage='',xrefs='abc, 123']",
+ "[open,refpage='',xrefs='abc,123']",
+ "[open,refpage='',xrefs='abc , 123']"]
+ for has_comma in equivalent_tags_with_commas:
+ assert(loneMsgReplacement(ckr.check(has_comma)) == 'abc 123')
+
+
+def test_refpage_block(ckr):
+ """Tests of the REFPAGE_BLOCK message."""
+ ckr.enabled([MessageId.REFPAGE_BLOCK])
+ # Should not error: have the tag, an open, and a close
+ assert(not ckr.check(
+ """[open,]
+ --
+ bla
+ --""").messages)
+ assert(not ckr.check(
+ """[open,refpage='abc']
+ --
+ bla
+ --
+
+ [open,refpage='123']
+ --
+ bla2
+ --""").messages)
+
+ # Should have 1 error: file ends immediately after tag
+ assert(ckr.check(
+ "[open,]").numDiagnostics() == 1)
+
+ # Should have 1 error: line after tag isn't --
+ assert(ckr.check(
+ """[open,]
+ bla
+ --""").numDiagnostics() == 1)
+ # Checking precedence of checks: this should have 1 error because line after tag isn't --
+ # (but it is something that causes a line to be handled differently)
+ assert(ckr.check(
+ """[open,]
+ == Heading
+ --""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """[open,]
+ ----
+ this is in a code block
+ ----
+ --""").numDiagnostics() == 1)
+
+ # Should have 1 error: tag inside refpage.
+ tag_inside = """[open,]
+ --
+ bla
+ [open,]
+ --"""
+ assert(ckr.check(tag_inside).numDiagnostics() == 1)
+ assert("already in a refpage block" in
+ message(ckr.check(tag_inside)))
+
+
+def test_refpage_missing(ckr):
+ """Test the REFPAGE_MISSING message."""
+ ckr.enabled([MessageId.REFPAGE_MISSING])
+ # Should not error: have the tag, an open, and the include
+ assert(not ckr.check(
+ """[open,refpage='%s']
+ --
+ include::{generated}/api/protos/%s.adoc[]""" % (PROTO, PROTO)).messages)
+ assert(not ckr.check(
+ """[open,refpage='%s']
+ --
+ include::{generated}/validity/protos/%s.adoc[]""" % (PROTO, PROTO)).messages)
+
+ # Should not error: manual anchors shouldn't trigger this.
+ assert(not ckr.check("[[%s]]" % PROTO).messages)
+
+ # Should have 1 error: file ends immediately after include
+ assert(ckr.check(
+ "include::{generated}/api/protos/%s.adoc[]" % PROTO).numDiagnostics() == 1)
+ assert(ckr.check(
+ "include::{generated}/validity/protos/%s.adoc[]" % PROTO).numDiagnostics() == 1)
+
+ # Should have 1 error: include is before the refpage open
+ assert(ckr.check(
+ """include::{generated}/api/protos/%s.adoc[]
+ [open,refpage='%s']
+ --""" % (PROTO, PROTO)).numDiagnostics() == 1)
+ assert(ckr.check(
+ """include::{generated}/validity/protos/%s.adoc[]
+ [open,refpage='%s']
+ --""" % (PROTO, PROTO)).numDiagnostics() == 1)
+
+
+def test_refpage_mismatch(ckr):
+ """Test the REFPAGE_MISMATCH message."""
+ ckr.enabled([MessageId.REFPAGE_MISMATCH])
+ # Should not error: have the tag, an open, and a matching include
+ assert(not ckr.check(
+ """[open,refpage='%s']
+ --
+ include::{generated}/api/protos/%s.adoc[]""" % (PROTO, PROTO)).messages)
+ assert(not ckr.check(
+ """[open,refpage='%s']
+ --
+ include::{generated}/validity/protos/%s.adoc[]""" % (PROTO, PROTO)).messages)
+
+ # Should error: have the tag, an open, and a mis-matching include
+ assert(ckr.check(
+ """[open,refpage='%s']
+ --
+ include::{generated}/api/structs/%s.adoc[]""" % (PROTO, STRUCT)).numDiagnostics() == 1)
+ assert(ckr.check(
+ """[open,refpage='%s']
+ --
+ include::{generated}/validity/structs/%s.adoc[]""" % (PROTO, STRUCT)).numDiagnostics() == 1)
+
+
+def test_refpage_unknown_attrib(ckr):
+ """Check the REFPAGE_UNKNOWN_ATTRIB message."""
+ ckr.enabled([MessageId.REFPAGE_UNKNOWN_ATTRIB])
+ # Should not error: these are known attribute names
+ assert(not ckr.check(
+ "[open,refpage='',desc='',type='',xrefs='']").messages)
+
+ # Should error: xref isn't an attribute name.
+ assert(ckr.check(
+ "[open,xref='']").numDiagnostics() == 1)
+
+
+def test_refpage_self_xref(ckr):
+ """Check the REFPAGE_SELF_XREF message."""
+ ckr.enabled([MessageId.REFPAGE_SELF_XREF])
+ # Should not error: not self-referencing
+ assert(not ckr.check(
+ "[open,refpage='abc',xrefs='']").messages)
+ assert(not ckr.check(
+ "[open,refpage='abc',xrefs='123']").messages)
+
+ # Should error: self-referencing isn't an attribute name.
+ assert(loneMsgReplacement(
+ ckr.check("[open,refpage='abc',xrefs='abc']")) == '')
+ assert(loneMsgReplacement(
+ ckr.check("[open,refpage='abc',xrefs='abc 123']")) == '123')
+ assert(loneMsgReplacement(
+ ckr.check("[open,refpage='abc',xrefs='123 abc']")) == '123')
+
+
+def test_refpage_xref_dupe(ckr):
+ """Check the REFPAGE_XREF_DUPE message."""
+ ckr.enabled([MessageId.REFPAGE_XREF_DUPE])
+ # Should not error: no dupes
+ assert(not ckr.check("[open,xrefs='']").messages)
+ assert(not ckr.check("[open,xrefs='123']").messages)
+ assert(not ckr.check("[open,xrefs='abc 123']").messages)
+
+ # Should error: one dupe.
+ assert(loneMsgReplacement(
+ ckr.check("[open,xrefs='abc abc']")) == 'abc')
+ assert(loneMsgReplacement(
+ ckr.check("[open,xrefs='abc abc']")) == 'abc')
+ assert(loneMsgReplacement(
+ ckr.check("[open,xrefs='abc abc abc']")) == 'abc')
+ assert(loneMsgReplacement(
+ ckr.check("[open,xrefs='abc 123 abc']")) == 'abc 123')
+ assert(loneMsgReplacement(
+ ckr.check("[open,xrefs='123 abc abc']")) == '123 abc')
+
+
+def test_REFPAGE_WHITESPACE(ckr):
+ """Check the REFPAGE_WHITESPACE message."""
+ ckr.enabled([MessageId.REFPAGE_WHITESPACE])
+ # Should not error: no extra whitespace
+ assert(not ckr.check("[open,xrefs='']").messages)
+ assert(not ckr.check("[open,xrefs='123']").messages)
+ assert(not ckr.check("[open,xrefs='abc 123']").messages)
+
+ # Should error: some extraneous whitespace.
+ assert(loneMsgReplacement(
+ ckr.check("[open,xrefs=' \t ']")) == '')
+ assert(loneMsgReplacement(
+ ckr.check("[open,xrefs=' abc 123 ']")) == 'abc 123')
+ assert(loneMsgReplacement(
+ ckr.check("[open,xrefs=' abc\t123 xyz ']")) == 'abc 123 xyz')
+
+ # Should *NOT* remove self-reference, just extra whitespace
+ assert(loneMsgReplacement(
+ ckr.check("[open,refpage='abc',xrefs=' abc 123 ']")) == 'abc 123')
+
+ # Even if we turn on the self-reference warning
+ ckr.enabled([MessageId.REFPAGE_WHITESPACE, MessageId.REFPAGE_SELF_XREF])
+ assert(msgReplacement(
+ ckr.check("[open,refpage='abc',xrefs=' abc 123 ']"), 1) == 'abc 123')
+
+
+def test_REFPAGE_DUPLICATE(ckr):
+ """Check the REFPAGE_DUPLICATE message."""
+ ckr.enabled([MessageId.REFPAGE_DUPLICATE])
+ # Should not error: no duplicate refpages.
+ assert(not ckr.check("[open,refpage='abc']").messages)
+ assert(not ckr.check("[open,refpage='123']").messages)
+
+ # Should error: repeated refpage
+ assert(ckr.check(
+ """[open,refpage='abc']
+ [open,refpage='abc']""").messages)
+
+ # Should error: repeated refpage with something intervening
+ assert(ckr.check(
+ """[open,refpage='abc']
+ [open,refpage='123']
+ [open,refpage='abc']""").messages)
+
+
+def test_UNCLOSED_BLOCK(ckr):
+ """Check the UNCLOSED_BLOCK message."""
+ ckr.enabled([MessageId.UNCLOSED_BLOCK])
+ # These should all have 0 errors
+ assert(not ckr.check("== Heading").messages)
+ assert(not ckr.check(
+ """****
+ == Heading
+ ****""").messages)
+ assert(not ckr.check(
+ """****
+ contents
+ ****""").messages)
+ assert(not ckr.check(
+ """****
+ [source,c]
+ ----
+ this is code
+ ----
+ ****""").messages)
+ assert(not ckr.check(
+ """[open,]
+ --
+ 123
+
+ [source,c]
+ ----
+ this is code
+ ----
+ ****
+ * this is in a box
+ ****
+
+ Now we can close the ref page.
+ --""").messages)
+
+ # These should all have 1 error because I removed a block close.
+ # Because some of them, the missing block close is an interior one, the stack might look weird,
+ # but it's still only 1 error - no matter how many are left unclosed.
+ assert(ckr.check(
+ """****
+ == Heading""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """****
+ contents""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """****
+ [source,c]
+ ----
+ this is code
+ ****""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """****
+ [source,c]
+ ----
+ this is code
+ ----""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """[open,]
+ --
+ 123
+
+ [source,c]
+ ----
+ this is code
+ ----
+ ****
+ * this is in a box
+ ****""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """[open,]
+ --
+ 123
+
+ [source,c]
+ ----
+ this is code
+ ----
+ ****
+ * this is in a box
+ --""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """[open,]
+ --
+ 123
+
+ [source,c]
+ ----
+ this is code
+ ****
+ * this is in a box
+ ****
+
+ Now we can close the ref page.
+ --""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """[open,]
+ --
+ 123
+
+ [source,c]
+ ----
+ this is code
+ ****
+ * this is in a box
+
+ Now we can close the ref page.
+ --""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """[open,]
+ --
+ 123
+
+ [source,c]
+ ----
+ this is code
+ ****
+ * this is in a box""").numDiagnostics() == 1)
+
+ # This should have 0 errors of UNCLOSED_BLOCK: the missing opening -- should get automatically fake-inserted,
+ assert(not ckr.check(
+ """[open,]
+ == Heading
+ --""").messages)
+
+ # Should have 1 error: block left open at end of file
+ assert(ckr.check(
+ """[open,]
+ --
+ bla""").numDiagnostics() == 1)
+
+
+def test_code_block_tracking(ckr):
+ """Check to make sure that no other messages get triggered in a code block."""
+ ckr.enabled([MessageId.BAD_ENTITY])
+
+ # Should have 1 error: not a valid entity
+ assert(ckr.check("slink:BogusStruct").numDiagnostics() == 1)
+ assert(ckr.check(
+ """****
+ * slink:BogusStruct
+ ****""").numDiagnostics() == 1)
+
+ # should have zero errors: the invalid entity is inside a code block,
+ # so it shouldn't be parsed.
+ # (In reality, it's mostly the MISSING_MACRO message that might interact with code block tracking,
+ # but this is easier to test in an API-agnostic way.)
+ assert(not ckr.check(
+ """[source,c]
+ ----
+ This code happens to include the characters slink:BogusStruct
+ ----""").messages)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_check_spec_links_api_specific.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_check_spec_links_api_specific.py
new file mode 100644
index 00000000000..587eed386a1
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_check_spec_links_api_specific.py
@@ -0,0 +1,122 @@
+#!/usr/bin/python3
+#
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+#
+# Purpose: This file contains tests for check_spec_links.py
+# that depend on the API being used.
+
+import pytest
+
+from check_spec_links import MacroChecker, MessageId, makeMacroChecker
+from spec_tools.console_printer import ConsolePrinter
+from spec_tools.macro_checker_file import shouldEntityBeText
+from test_check_spec_links import (CheckerWrapper, allMessages,
+ loneMsgReplacement, message, msgReplacement)
+
+
+@pytest.fixture
+def ckr(capsys):
+ """Fixture - add an arg named ckr to your test function to automatically get one passed to you."""
+ return CheckerWrapper(capsys)
+
+
+def test_vulkan_refpage_mismatch(ckr):
+ """Vulkan-specific tests of the REFPAGE_MISMATCH message."""
+ ckr.enabled([MessageId.REFPAGE_MISMATCH])
+ # Should error: this is actually a mismatch in Vulkan
+ assert(ckr.check(
+ """[open,refpage='VkQueueFlags']
+ --
+ include::{generated}/api/enums/VkQueueFlagBits.adoc[]""").numDiagnostics() == 1)
+ assert(ckr.check(
+ """[open,refpage='VkQueueFlags']
+ --
+ include::{generated}/validity/enums/VkQueueFlagBits.adoc[]""").numDiagnostics() == 1)
+
+ # Should not error: this is just an alias
+ assert(ckr.check(
+ """[open,refpage='vkUpdateDescriptorSetWithTemplate']
+ --
+ include::{generated}/api/protos/vkUpdateDescriptorSetWithTemplateKHR.adoc[]""").numDiagnostics() == 0)
+
+
+def test_vulkan_refpage_missing(ckr):
+ """Vulkan-specific tests of the REFPAGE_MISSING message."""
+ ckr.enabled([MessageId.REFPAGE_MISSING])
+
+ # Should error: flags are expected to have their own ref page.
+ assert(ckr.check(
+ "include::{generated}/api/flags/VkQueueFlags.adoc[]").numDiagnostics() == 1)
+
+
+def test_vulkan_refpage_block(ckr):
+ """Vulkan-specific tests of the REFPAGE_BLOCK message."""
+ ckr.enabled([MessageId.REFPAGE_BLOCK])
+
+ # Should have no errors: Non-refpage usage of '--' is acceptable
+ assert(not ckr.check(
+ """--
+ bla
+ --""").messages)
+
+ # Should have 1 error:
+ # - line after tag isn't '--'
+ result = ckr.check(
+ """--
+ [open,]
+ bla
+ --""")
+ assert(result.numDiagnostics() == 1)
+ # Internally, it's as if the following were the spec source, after putting in the "fake" lines
+ # (each of the added lines comes from one message):
+ #
+ # --
+ # [open,]
+ # --
+ # bla
+ # --
+ assert("but did not find, a line containing only -- following a reference page tag" in message(result))
+
+
+def test_vulkan_legacy(ckr):
+ """Test the LEGACY message which is Vulkan-only."""
+ ckr.enabled([MessageId.LEGACY])
+ # Should complain about LEGACY
+ assert(ckr.check('sname:VkDeviceMemory').numDiagnostics() == 1)
+
+
+def test_vulkan_alias(ckr):
+ """Tests of the aliasing data structure, dependent on Vulkan-specific registry."""
+ entity_db = ckr.ckr.entity_db
+
+ assert(entity_db.areAliases(
+ 'VkCommandPoolTrimFlagsKHR', 'VkCommandPoolTrimFlags'))
+ # Try one reversed-order, though the assert in that method should fire if this is wrong.
+ assert(entity_db.areAliases(
+ 'VkCommandPoolTrimFlags', 'VkCommandPoolTrimFlagsKHR'))
+
+ assert(entity_db.areAliases(
+ 'VkDescriptorUpdateTemplateKHR', 'VkDescriptorUpdateTemplate'))
+ assert(entity_db.areAliases('VkDescriptorUpdateTemplateTypeKHR',
+ 'VkDescriptorUpdateTemplateType'))
+ assert(entity_db.areAliases('VkQueueFamilyProperties2KHR',
+ 'VkQueueFamilyProperties2'))
+ assert(entity_db.areAliases('VK_COLORSPACE_SRGB_NONLINEAR_KHR',
+ 'VK_COLOR_SPACE_SRGB_NONLINEAR_KHR'))
+ assert(entity_db.areAliases('vkEnumeratePhysicalDeviceGroupsKHR',
+ 'vkEnumeratePhysicalDeviceGroups'))
+ assert(entity_db.areAliases(
+ 'vkCmdDrawIndirectCountAMD', 'vkCmdDrawIndirectCountKHR'))
+ assert(entity_db.areAliases('VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT',
+ 'VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT'))
+
+ assert(entity_db.areAliases('VK_LUID_SIZE_KHR', 'VK_LUID_SIZE'))
+
+def test_vulkan_entity_detection(ckr):
+ ckr.enabled([MessageId.BAD_ENTITY])
+ # Should complain about BAD_ENTITY even though it's sname
+ assert(ckr.check('sname:VkInstanceCreateInfoBOGUS').numDiagnostics() == 1)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_entity_db.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_entity_db.py
new file mode 100644
index 00000000000..ef08794c01f
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_entity_db.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python3 -i
+#
+# Copyright (c) 2018-2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+
+
+import pytest
+
+from check_spec_links import VulkanEntityDatabase
+
+
+@pytest.fixture
+def db():
+ ret = VulkanEntityDatabase()
+ # print(ret.getEntityJson())
+ return ret
+
+
+def test_likely_recognized(db):
+ assert(db.likelyRecognizedEntity('vkBla'))
+ assert(db.likelyRecognizedEntity('VkBla'))
+ assert(db.likelyRecognizedEntity('VK_BLA'))
+
+
+def test_db(db):
+ assert(db.findEntity('vkCreateInstance'))
+
+ # VKAPI_CALL is not referenced, so not added to EntityDatabase.
+ # assert(db.findEntity('VKAPI_CALL'))
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_reflow.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_reflow.py
new file mode 100644
index 00000000000..739a32ee503
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/test_reflow.py
@@ -0,0 +1,384 @@
+#!/usr/bin/python3
+#
+# Copyright 2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Shahbaz Youssefi <syoussefi@google.com>
+#
+# Purpose: This file contains tests for reflow.py
+
+import pytest
+
+from collections import namedtuple
+import os
+
+from reflib import loadFile
+from reflow import reflowFile
+
+testsDir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'reflow-tests')
+resultsDir = os.path.join(testsDir, 'results')
+
+Variations = namedtuple('Variations', ['reflow', 'addVUID'])
+
+def makeTestId(variations):
+ separator = ''
+ testid = ''
+
+ if not variations.reflow:
+ testid += separator + 'noreflow'
+ separator = '-'
+
+ if not variations.addVUID:
+ testid += separator + 'novuid'
+ separator = '-'
+
+ if testid == '':
+ testid = 'default'
+
+ return testid
+
+class ReflowArgs:
+ def __init__(self, variations):
+ self.overwrite = False
+ self.nowrite = False
+ self.outDir = os.path.join(resultsDir, makeTestId(variations))
+ self.check = True
+ self.checkVUID = True
+ self.noflow = not variations.reflow
+ self.margin = 76
+ self.suffix = ''
+ self.nextvu = 10000 if variations.addVUID else None
+ self.maxvu = 99999
+ self.warnCount = 0
+ self.vuidDict = {}
+
+ self.variations = variations
+
+variations = [
+ Variations(False, False),
+ Variations(False, True),
+ Variations(True, False),
+ Variations(True, True),
+]
+
+@pytest.fixture(params=variations, ids=makeTestId)
+def args(request):
+ return ReflowArgs(request.param)
+
+def getPath(*names):
+ return os.path.join(testsDir, *names)
+
+def match_with_expected(resultFile, expectation):
+ result, result_newline = loadFile(resultFile)
+ expect, expect_newline = loadFile(expectation)
+
+ assert(result_newline == expect_newline)
+ assert(result == expect)
+
+def run_reflow_test(args, filetag):
+ testid = makeTestId(args.variations)
+
+ source = 'src-' + filetag + '.adoc'
+ expect = 'expect-' + filetag + '-' + testid + '.adoc'
+
+ filename = getPath(source)
+
+ reflowFile(filename, args)
+
+ match_with_expected(getPath(resultsDir, testid, source), getPath(expect))
+
+def match_warn_count(args, expected):
+ assert(args.warnCount == expected)
+
+def match_vuid_dict(args, expectedExisting, expectedNew):
+ expected = expectedExisting
+ if args.nextvu is not None:
+ expected = expected | expectedNew
+
+ assert(sorted(args.vuidDict.keys()) == sorted(expected.keys()))
+
+ for vuid, locations in args.vuidDict.items():
+ for location, expectedLocation in zip(locations, expected[vuid]):
+ filename, tagline = location
+ expectedFilename, expectedTag = expectedLocation
+
+ assert(expectedFilename in filename)
+ assert(expectedTag in tagline)
+
+def test_text(args):
+ """Basic test of text reflow."""
+ run_reflow_test(args, 'text')
+ match_warn_count(args, 0)
+ match_vuid_dict(args, {}, {})
+
+def test_table(args):
+ """Basic test that ensures tables are not reformatted."""
+ run_reflow_test(args, 'table')
+ match_warn_count(args, 0)
+ match_vuid_dict(args, {}, {})
+
+def test_vu(args):
+ """Basic test that VU reflows work."""
+ run_reflow_test(args, 'vu')
+ match_warn_count(args, 0)
+ match_vuid_dict(args, {'01993':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-image-01993]]']],
+ '00002':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-image-00002]]']],
+ '01545':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-image-01545]]']],
+ '00003':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-image-00003]]']],
+ '00004':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-imageLayout-00004]]']],
+ '00005':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-imageLayout-00005]]']],
+ '01394':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-imageLayout-01394]]']],
+ '02498':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-aspectMask-02498]]']],
+ '01470':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-baseMipLevel-01470]]']],
+ '01692':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-pRanges-01692]]']],
+ '01472':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]']],
+ '01693':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-pRanges-01693]]']],
+ '00007':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-image-00007]]']],
+ '04961':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-pColor-04961]]']],
+ '01805':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-commandBuffer-01805]]']],
+ '01806':
+ [['scripts/reflow-tests/src-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-commandBuffer-01806]]']]},
+ {})
+
+# Commented out now that VU extractor supports this, but may
+# need to refactor through a conventions object enable if
+# OpenXR still needs this.
+# def test_ifdef_in_vu(args):
+# """Test that ifdef in VUs are warned against."""
+# run_reflow_test(args, 'ifdef-in-vu')
+# match_warn_count(args, 1)
+# match_vuid_dict(args, {'00003':
+# [['scripts/reflow-tests/src-ifdef-in-vu.adoc',
+# '[[VUID-vkCmdClearColorImage-image-00003]]']],
+# '00004':
+# [['scripts/reflow-tests/src-ifdef-in-vu.adoc',
+# '[[VUID-vkCmdClearColorImage-imageLayout-00004]]']],
+# '00005':
+# [['scripts/reflow-tests/src-ifdef-in-vu.adoc',
+# '[[VUID-vkCmdClearColorImage-imageLayout-00005]]']],
+# '04961':
+# [['scripts/reflow-tests/src-ifdef-in-vu.adoc',
+# '[[VUID-vkCmdClearColorImage-pColor-04961]]']]},
+# {})
+
+def test_vuid_repeat(args):
+ """Test that same VUID in multiple VUs is detected."""
+ run_reflow_test(args, 'vuid-repeat')
+ match_warn_count(args, 0)
+ match_vuid_dict(args, {'02498':
+ [['scripts/reflow-tests/src-vuid-repeat.adoc',
+ '[[VUID-vkCmdClearColorImage-aspectMask-02498]]'],
+ ['scripts/reflow-tests/src-vuid-repeat.adoc',
+ '[[VUID-vkCmdClearColorImage-pRanges-02498]]'],
+ ['scripts/reflow-tests/src-vuid-repeat.adoc',
+ '[[VUID-vkCmdClearColorImage-pRanges-02498]]'],
+ ['scripts/reflow-tests/src-vuid-repeat.adoc',
+ '[[VUID-vkCmdClearColorImage-pColor-02498]]']],
+ '01470':
+ [['scripts/reflow-tests/src-vuid-repeat.adoc',
+ '[[VUID-vkCmdClearColorImage-baseMipLevel-01470]]']],
+ '00007':
+ [['scripts/reflow-tests/src-vuid-repeat.adoc',
+ '[[VUID-vkCmdClearColorImage-baseArrayLayer-00007]]'],
+ ['scripts/reflow-tests/src-vuid-repeat.adoc',
+ '[[VUID-vkCmdClearColorImage-image-00007]]']]},
+ {})
+
+def test_new_vuid(args):
+ """Test that VUID generation works."""
+ run_reflow_test(args, 'new-vuid')
+ match_warn_count(args, 0)
+ match_vuid_dict(args, {'01993':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-image-01993]]']],
+ '01545':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-image-01545]]']],
+ '00004':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-imageLayout-00004]]']],
+ '00005':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-imageLayout-00005]]']],
+ '02498':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-aspectMask-02498]]']],
+ '01470':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-baseMipLevel-01470]]']],
+ '01472':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-baseArrayLayer-01472]]']],
+ '01693':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-pRanges-01693]]']],
+ '01805':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-commandBuffer-01805]]']],
+ '01806':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-commandBuffer-01806]]']]},
+ {'10000':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-image-10000]]']],
+ '10001':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-image-10001]]']],
+ '10002':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-imageLayout-10002]]']],
+ '10003':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-pRanges-10003]]']],
+ '10004':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-image-10004]]']],
+ '10005':
+ [['scripts/reflow-tests/src-new-vuid.adoc',
+ '[[VUID-vkCmdClearColorImage-pColor-10005]]']]})
+
+def test_new_vuid_attribute(args):
+ """Test that VUID generation works and prioritizes attributes for tags."""
+ run_reflow_test(args, 'new-vuid-attribute')
+ match_warn_count(args, 0)
+ match_vuid_dict(args, {}, {'10000':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10000]]']],
+ '10001':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imagesubresource}-10001]]']],
+ '10002':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10002]]']],
+ '10003':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10003]]']],
+ '10004':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10004]]']],
+ '10005':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10005]]']],
+ '10006':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10006]]']],
+ '10007':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10007]]']],
+ '10008':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10008]]']],
+ '10009':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10009]]']],
+ '10010':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10010]]']],
+ '10011':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imagesubresource}-10011]]']],
+ '10012':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10012]]']],
+ '10013':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10013]]']],
+ '10014':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10014]]']],
+ '10015':
+ [['scripts/reflow-tests/src-new-vuid-attribute.adoc',
+ '[[VUID-{refpage}-{imageparam}-10015]]']]})
+
+def test_common_validity(args):
+ """Test that VUID generation works for common validity files."""
+ run_reflow_test(args, 'common-validity')
+ match_warn_count(args, 0)
+ match_vuid_dict(args, {'00171':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-pRegions-00171]]']],
+ '00176':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-srcBuffer-00176]]']],
+ '00177':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-dstImage-00177]]']],
+ '00178':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-dstImage-00178]]']],
+ '00181':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-dstImageLayout-00181]]']]},
+ {'10000':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-pRegions-10000]]']],
+ '10001':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-srcBuffer-10001]]']],
+ '10002':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-dstImage-10002]]']],
+ '10003':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-dstImage-10003]]']],
+ '10004':
+ [['scripts/reflow-tests/src-common-validity.adoc',
+ '[[VUID-{refpage}-dstImageLayout-10004]]']]})
+
+def test_nested_lists_in_vu(args):
+ """Test that nested lists in VU work correctly."""
+ run_reflow_test(args, 'nested-lists-in-vu')
+ match_warn_count(args, 0)
+ match_vuid_dict(args, {'07284':
+ [['scripts/reflow-tests/src-nested-lists-in-vu.adoc',
+ '[[VUID-{refpage}-multisampledRenderToSingleSampled-07284]]']],
+ '08971':
+ [['scripts/reflow-tests/src-nested-lists-in-vu.adoc',
+ '[[VUID-{refpage}-None-08971]]']]},
+ {'10000':
+ [['scripts/reflow-tests/src-nested-lists-in-vu.adoc',
+ '[[VUID-{refpage}-None-10000]]']]})
+
+
+def test_math_block_in_vu(args):
+ """Test that nested lists in VU work correctly."""
+ run_reflow_test(args, 'math-block-in-vu')
+ match_warn_count(args, 0)
+ match_vuid_dict(args, {'00004':
+ [['scripts/reflow-tests/src-math-block-in-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-imageLayout-00004]]']]},
+ {'10000':
+ [['scripts/reflow-tests/src-math-block-in-vu.adoc',
+ '[[VUID-vkCmdClearColorImage-image-10000]]']]})
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/translate_math.js b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/translate_math.js
new file mode 100644
index 00000000000..fedf8ff9b7d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/translate_math.js
@@ -0,0 +1,33 @@
+// Copyright 2020-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: Apache-2.0
+
+// Translates the latexmath in html on build time using KaTeX
+// Usage: nodejs translate_math.js katex/katex.min.js vkspec.html
+
+const katex = require(process.argv[2]);
+const fs = require("fs");
+const escapeRegex = require("escape-string-regexp");
+const he = require('he');
+
+const filepath = process.argv[3];
+
+var html = fs.readFileSync(filepath, "utf8");
+
+const delimiters = [
+ //{ left: "$$", right: "$$", display: true},
+ { left: "\\[", right: "\\]", display: true},
+ //{ left: "$", right: "$", display: false},
+ { left: "\\(", right: "\\)", display: false}
+ ]
+
+for( var delim of delimiters ) {
+ const regex = new RegExp( escapeRegex(delim.left) + "([\\S\\s]*?)" + escapeRegex(delim.right), "g");
+ html = html.replace( regex,
+ function(match, g1) {
+ return katex.renderToString( he.decode(g1, {'strict': true}), {displayMode: delim.display, output: 'html', strict: true} );
+ }
+ );
+}
+
+fs.writeFileSync(filepath, html, 'utf8');
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/validitygenerator.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/validitygenerator.py
new file mode 100755
index 00000000000..07439c4a406
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/validitygenerator.py
@@ -0,0 +1,1591 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import re
+from collections import OrderedDict, namedtuple
+from functools import reduce
+from pathlib import Path
+
+from spec_tools.conventions import ProseListFormats as plf
+from generator import OutputGenerator, write
+from spec_tools.attributes import ExternSyncEntry, LengthEntry
+from spec_tools.util import (findNamedElem, findNamedObject, findTypedElem,
+ getElemName, getElemType)
+from spec_tools.validity import ValidityCollection, ValidityEntry
+
+
+class UnhandledCaseError(RuntimeError):
+ def __init__(self, msg=None):
+ if msg:
+ super().__init__('Got a case in the validity generator that we have not explicitly handled: ' + msg)
+ else:
+ super().__init__('Got a case in the validity generator that we have not explicitly handled.')
+
+
+def _genericIterateIntersection(a, b):
+ """Iterate through all elements in a that are also in b.
+
+ Somewhat like a set's intersection(),
+ but not type-specific so it can work with OrderedDicts, etc.
+ It also returns a generator instead of a set,
+ so you can pick a preferred container type,
+ if any.
+ """
+ return (x for x in a if x in b)
+
+
+def _make_ordered_dict(gen):
+ """Make an ordered dict (with None as the values) from a generator."""
+ return OrderedDict(((x, None) for x in gen))
+
+
+def _orderedDictIntersection(a, b):
+ return _make_ordered_dict(_genericIterateIntersection(a, b))
+
+
+def _genericIsDisjoint(a, b):
+ """Return true if nothing in a is also in b.
+
+ Like a set's is_disjoint(),
+ but not type-specific so it can work with OrderedDicts, etc.
+ """
+ for _ in _genericIterateIntersection(a, b):
+ return False
+ # if we never enter the loop...
+ return True
+
+
+class ValidityOutputGenerator(OutputGenerator):
+ """ValidityOutputGenerator - subclass of OutputGenerator.
+
+ Generates AsciiDoc includes of valid usage information, for reference
+ pages and the specification. Similar to DocOutputGenerator.
+
+ ---- methods ----
+ ValidityOutputGenerator(errFile, warnFile, diagFile) - args as for
+ OutputGenerator. Defines additional internal state.
+ ---- methods overriding base class ----
+ beginFile(genOpts)
+ endFile()
+ beginFeature(interface, emit)
+ endFeature()
+ genCmd(cmdinfo)
+ """
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ self.currentExtension = ''
+
+ # Tracks whether we are tracing operations
+ self.trace = False
+
+ @property
+ def null(self):
+ """Preferred spelling of NULL.
+
+ Delegates to the object implementing ConventionsBase.
+ """
+ return self.conventions.null
+
+ @property
+ def structtype_member_name(self):
+ """Return name of the structure type member.
+
+ Delegates to the object implementing ConventionsBase.
+ """
+ return self.conventions.structtype_member_name
+
+ @property
+ def nextpointer_member_name(self):
+ """Return name of the structure pointer chain member.
+
+ Delegates to the object implementing ConventionsBase.
+ """
+ return self.conventions.nextpointer_member_name
+
+ def makeProseList(self, elements, fmt=plf.AND,
+ comma_for_two_elts=False, *args, **kwargs):
+ """Make a (comma-separated) list for use in prose.
+
+ Adds a connective (by default, 'and')
+ before the last element if there are more than 1.
+
+ Optionally adds a quantifier (like 'any') before a list of 2 or more,
+ if specified by fmt.
+
+ Delegates to the object implementing ConventionsBase.
+ """
+ if not elements:
+ raise ValueError(
+ 'Cannot pass an empty list if you are trying to make a prose list.')
+ return self.conventions.makeProseList(elements,
+ fmt,
+ with_verb=False,
+ comma_for_two_elts=comma_for_two_elts,
+ *args, **kwargs)
+
+ def makeProseListIs(self, elements, fmt=plf.AND,
+ comma_for_two_elts=False, *args, **kwargs):
+ """Make a (comma-separated) list for use in prose, followed by either 'is' or 'are' as appropriate.
+
+ Adds a connective (by default, 'and')
+ before the last element if there are more than 1.
+
+ Optionally adds a quantifier (like 'any') before a list of 2 or more,
+ if specified by fmt.
+
+ Delegates to the object implementing ConventionsBase.
+ """
+ if not elements:
+ raise ValueError(
+ 'Cannot pass an empty list if you are trying to make a prose list.')
+ return self.conventions.makeProseList(elements,
+ fmt,
+ with_verb=True,
+ comma_for_two_elts=comma_for_two_elts,
+ *args, **kwargs)
+
+ def makeValidityCollection(self, entity_name):
+ """Create a ValidityCollection object, passing along our Conventions."""
+ return ValidityCollection(entity_name, self.conventions)
+
+ def beginFile(self, genOpts):
+ if not genOpts.conventions:
+ raise RuntimeError(
+ 'Must specify conventions object to generator options')
+ self.conventions = genOpts.conventions
+ # Vulkan says 'must: be a valid pointer' a lot, OpenXR just says
+ # 'must: be a pointer'.
+ self.valid_pointer_text = ' '.join(
+ (x for x in (self.conventions.valid_pointer_prefix, 'pointer') if x))
+ OutputGenerator.beginFile(self, genOpts)
+
+ def endFile(self):
+ OutputGenerator.endFile(self)
+
+ def beginFeature(self, interface, emit):
+ # Start processing in superclass
+ OutputGenerator.beginFeature(self, interface, emit)
+ self.currentExtension = interface.get('name')
+
+ def endFeature(self):
+ # Finish processing in superclass
+ OutputGenerator.endFeature(self)
+
+ @property
+ def struct_macro(self):
+ """Get the appropriate format macro for a structure."""
+ # delegate to conventions
+ return self.conventions.struct_macro
+
+ def makeStructName(self, name):
+ """Prepend the appropriate format macro for a structure to a structure type name."""
+ # delegate to conventions
+ return self.conventions.makeStructName(name)
+
+ def makeParameterName(self, name):
+ """Prepend the appropriate format macro for a parameter/member to a parameter name."""
+ return 'pname:' + name
+
+ def makeBaseTypeName(self, name):
+ """Prepend the appropriate format macro for a 'base type' to a type name."""
+ return 'basetype:' + name
+
+ def makeEnumerationName(self, name):
+ """Prepend the appropriate format macro for an enumeration type to a enum type name."""
+ return 'elink:' + name
+
+ def makeFlagsName(self, name):
+ """Prepend the appropriate format macro for a flags type to a flags type name."""
+ return 'tlink:' + name
+
+ def makeFuncPointerName(self, name):
+ """Prepend the appropriate format macro for a function pointer type to a type name."""
+ return 'tlink:' + name
+
+ def makeExternalTypeName(self, name):
+ """Prepend the appropriate format macro for an external type like uint32_t to a type name."""
+ # delegate to conventions
+ return self.conventions.makeExternalTypeName(name)
+
+ def makeEnumerantName(self, name):
+ """Prepend the appropriate format macro for an enumerate (value) to a enum value name."""
+ return 'ename:' + name
+
+ def writeInclude(self, directory, basename, validity: ValidityCollection,
+ threadsafety, commandpropertiesentry=None,
+ successcodes=None, errorcodes=None):
+ """Generate an include file.
+
+ directory - subdirectory to put file in (absolute or relative pathname)
+ basename - base name of the file
+ validity - ValidityCollection to write.
+ threadsafety - List (may be empty) of thread safety statements to write.
+ successcodes - Optional success codes to document.
+ errorcodes - Optional error codes to document.
+ """
+ # Create subdirectory, if needed
+ directory = Path(directory)
+ if not directory.is_absolute():
+ directory = Path(self.genOpts.directory) / directory
+ self.makeDir(str(directory))
+
+ # Create validity file
+ filename = str(directory / f'{basename}{self.file_suffix}')
+ self.logMsg('diag', '# Generating include file:', filename)
+
+ with open(filename, 'w', encoding='utf-8') as fp:
+ write(self.conventions.warning_comment, file=fp)
+
+ # Valid Usage
+ if validity:
+ write('.Valid Usage (Implicit)', file=fp)
+ write('****', file=fp)
+ write(validity, file=fp, end='')
+ write('****', file=fp)
+ write('', file=fp)
+
+ # Host Synchronization
+ if threadsafety:
+ # The heading of this block differs between projects, so an Asciidoc attribute is used.
+ write('.{externsynctitle}', file=fp)
+ write('****', file=fp)
+ write(threadsafety, file=fp, end='')
+ write('****', file=fp)
+ write('', file=fp)
+
+ # Command Properties - contained within a block, to avoid table numbering
+ if commandpropertiesentry:
+ write('.Command Properties', file=fp)
+ write('****', file=fp)
+ write('[options="header", width="100%"]', file=fp)
+ write('|====', file=fp)
+ write(self.makeCommandPropertiesTableHeader(), file=fp)
+ write(commandpropertiesentry, file=fp)
+ write('|====', file=fp)
+ write('****', file=fp)
+ write('', file=fp)
+
+ # Success Codes - contained within a block, to avoid table numbering
+ if successcodes or errorcodes:
+ write('.Return Codes', file=fp)
+ write('****', file=fp)
+ if successcodes:
+ write('ifndef::doctype-manpage[]', file=fp)
+ write('<<fundamentals-successcodes,Success>>::', file=fp)
+ write('endif::doctype-manpage[]', file=fp)
+ write('ifdef::doctype-manpage[]', file=fp)
+ write('On success, this command returns::', file=fp)
+ write('endif::doctype-manpage[]', file=fp)
+ write(successcodes, file=fp)
+ if errorcodes:
+ write('ifndef::doctype-manpage[]', file=fp)
+ write('<<fundamentals-errorcodes,Failure>>::', file=fp)
+ write('endif::doctype-manpage[]', file=fp)
+ write('ifdef::doctype-manpage[]', file=fp)
+ write('On failure, this command returns::', file=fp)
+ write('endif::doctype-manpage[]', file=fp)
+ write(errorcodes, file=fp)
+ write('****', file=fp)
+ write('', file=fp)
+
+ def paramIsStaticArray(self, param):
+ """Check if the parameter passed in is a static array."""
+ tail = param.find('name').tail
+ return tail and tail[0] == '['
+
+ def paramIsConst(self, param):
+ """Check if the parameter passed in has a type that mentions const."""
+ return param.text is not None and 'const' in param.text
+
+ def staticArrayLength(self, param):
+ """Get the length of a parameter that has been identified as a static array."""
+ paramenumsize = param.find('enum')
+ if paramenumsize is not None:
+ return paramenumsize.text
+ # TODO switch to below when cosmetic changes OK
+ # return self.makeEnumerantName(paramenumsize.text)
+
+ return param.find('name').tail[1:-1]
+
+ def getHandleDispatchableAncestors(self, typename):
+ """Get the ancestors of a handle object."""
+ ancestors = []
+ current = typename
+ while True:
+ current = self.getHandleParent(current)
+ if current is None:
+ return ancestors
+ if self.isHandleTypeDispatchable(current):
+ ancestors.append(current)
+
+ def isHandleTypeDispatchable(self, handlename):
+ """Check if a parent object is dispatchable or not."""
+ handle = self.registry.tree.find(
+ "types/type/[name='" + handlename + "'][@category='handle']")
+ if handle is not None and getElemType(handle) == 'VK_DEFINE_HANDLE':
+ return True
+ else:
+ return False
+
+ def isHandleOptional(self, param, params):
+ # Simple, if it is optional, return true
+ if param.get('optional') is not None:
+ return True
+
+ # If no validity is being generated, it usually means that validity is complex and not absolute, so say yes.
+ if param.get('noautovalidity') is not None:
+ return True
+
+ # If the parameter is an array and we have not already returned, find out if any of the len parameters are optional
+ if self.paramIsArray(param):
+ for length in LengthEntry.parse_len_from_param(param):
+ if not length.other_param_name:
+ # do not care about constants or "null-terminated"
+ continue
+
+ other_param = findNamedElem(params, length.other_param_name)
+ if other_param is None:
+ self.logMsg('warn', length.other_param_name,
+ 'is listed as a length for parameter', param, 'but no such parameter exists')
+ if other_param and other_param.get('optional'):
+ return True
+
+ return False
+
+ def makeOptionalPre(self, param):
+ # Do not generate this stub for bitflags
+ param_name = getElemName(param)
+ paramtype = getElemType(param)
+ type_category = self.getTypeCategory(paramtype)
+ is_optional = param.get('optional').split(',')[0] == 'true'
+ if type_category != 'bitmask' and is_optional:
+ if self.paramIsArray(param) or self.paramIsPointer(param):
+ optional_val = self.null
+ elif type_category == 'handle':
+ if self.isHandleTypeDispatchable(paramtype):
+ optional_val = self.null
+ else:
+ optional_val = 'dlink:' + self.conventions.api_prefix + 'NULL_HANDLE'
+ else:
+ optional_val = self.conventions.zero
+ return 'If {} is not {}, '.format(
+ self.makeParameterName(param_name),
+ optional_val)
+
+ return ""
+
+ def makeParamValidityPre(self, param, params, selector):
+ """Make the start of an entry for a parameter's validity, including a chunk of text if it is an array."""
+ param_name = getElemName(param)
+ paramtype = getElemType(param)
+
+ # General pre-amble. Check optionality and add stuff.
+ entry = ValidityEntry(anchor=(param_name, 'parameter'))
+ is_optional = param.get('optional') is not None and param.get('optional').split(',')[0] == 'true'
+
+ # This is for a union member, and the valid member is chosen by an enum selection
+ if selector:
+ selection = param.get('selection')
+
+ entry += 'If {} is {}, '.format(
+ self.makeParameterName(selector),
+ self.makeEnumerantName(selection))
+
+ if is_optional:
+ entry += "and "
+ optionalpre = self.makeOptionalPre(param)
+ entry += optionalpre[0].lower() + optionalpre[1:]
+
+ return entry
+
+ if self.paramIsStaticArray(param):
+ if paramtype != 'char':
+ entry += 'Each element of '
+ return entry
+
+ if self.paramIsArray(param) and param.get('len') != LengthEntry.NULL_TERMINATED_STRING:
+ # Find all the parameters that are called out as optional,
+ # so we can document that they might be zero, and the array may be ignored
+ optionallengths = []
+ for length in LengthEntry.parse_len_from_param(param):
+ if not length.other_param_name:
+ # Only care about length entries that are parameter names
+ continue
+
+ other_param = findNamedElem(params, length.other_param_name)
+ other_param_optional = (other_param is not None) and (
+ other_param.get('optional') is not None)
+
+ if other_param is None or not other_param_optional:
+ # Do not care about not-found params or non-optional params
+ continue
+
+ if self.paramIsPointer(other_param):
+ optionallengths.append(
+ 'the value referenced by ' + self.makeParameterName(length.other_param_name))
+ else:
+ optionallengths.append(
+ self.makeParameterName(length.other_param_name))
+
+ # Document that these arrays may be ignored if any of the length values are 0
+ if optionallengths or is_optional:
+ entry += 'If '
+ if optionallengths:
+ entry += self.makeProseListIs(optionallengths, fmt=plf.OR)
+ entry += ' not %s, ' % self.conventions.zero
+ # TODO enabling this in OpenXR, as used in Vulkan, causes nonsensical things like
+ # "If pname:propertyCapacityInput is not `0`, and pname:properties is not `NULL`, pname:properties must: be a pointer to an array of pname:propertyCapacityInput slink:XrApiLayerProperties structures"
+ if optionallengths and is_optional:
+ entry += 'and '
+ if is_optional:
+ entry += self.makeParameterName(param_name)
+ # TODO switch when cosmetic changes OK
+ # entry += ' is not {}, '.format(self.null)
+ entry += ' is not `NULL`, '
+ return entry
+
+ if param.get('optional'):
+ entry += self.makeOptionalPre(param)
+ return entry
+
+ # If none of the early returns happened, we at least return an empty
+ # entry with an anchor.
+ return entry
+
+ def createValidationLineForParameterImpl(self, blockname, param, params, typetext, selector, parentname):
+ """Make the generic validity portion used for all parameters.
+
+ May return None if nothing to validate.
+ """
+ if param.get('noautovalidity') is not None:
+ return None
+
+ validity = self.makeValidityCollection(blockname)
+ param_name = getElemName(param)
+ paramtype = getElemType(param)
+
+ entry = self.makeParamValidityPre(param, params, selector)
+
+ # pAllocator is not supported in VulkanSC and must always be NULL
+ if self.conventions.xml_api_name == "vulkansc" and param_name == 'pAllocator':
+ entry = ValidityEntry(anchor=(param_name, 'null'))
+ entry += 'pname:pAllocator must: be `NULL`'
+ return entry
+
+ # This is for a child member of a union
+ if selector:
+ entry += 'the {} member of {} must: be '.format(self.makeParameterName(param_name), self.makeParameterName(parentname))
+ else:
+ entry += '{} must: be '.format(self.makeParameterName(param_name))
+
+ if self.paramIsStaticArray(param) and paramtype == 'char':
+ # TODO this is a minor hack to determine if this is a command parameter or a struct member
+ if self.paramIsConst(param) or blockname.startswith(self.conventions.type_prefix):
+ entry += 'a null-terminated UTF-8 string whose length is less than or equal to '
+ entry += self.staticArrayLength(param)
+ else:
+ # This is a command's output parameter
+ entry += 'a character array of length %s ' % self.staticArrayLength(param)
+ validity += entry
+ return validity
+
+ elif self.paramIsArray(param):
+ # Arrays. These are hard to get right, apparently
+
+ lengths = LengthEntry.parse_len_from_param(param)
+
+ for i, length in enumerate(LengthEntry.parse_len_from_param(param)):
+ if i == 0:
+ # If the first index, make it singular.
+ entry += 'a '
+ array_text = 'an array'
+ pointer_text = self.valid_pointer_text
+ else:
+ array_text = 'arrays'
+ pointer_text = self.valid_pointer_text + 's'
+
+ if length.null_terminated:
+ # This should always be the last thing.
+ # If it ever is not for some bizarre reason, then this
+ # will need some massaging.
+ entry += 'null-terminated '
+ elif length.number == 1:
+ entry += pointer_text
+ entry += ' to '
+ else:
+ entry += pointer_text
+ entry += ' to '
+ entry += array_text
+ entry += ' of '
+ # Handle equations, which are currently denoted with latex
+ if length.math:
+ # Handle equations, which are currently denoted with latex
+ entry += str(length)
+ else:
+ entry += self.makeParameterName(str(length))
+ entry += ' '
+
+ # Void pointers do not actually point at anything - remove the word "to"
+ if paramtype == 'void':
+ if lengths[-1].number == 1:
+ if len(lengths) > 1:
+ # Take care of the extra s added by the post array chunk function. #HACK#
+ entry.drop_end(5)
+ else:
+ entry.drop_end(4)
+
+ # This has not been hit, so this has not been tested recently.
+ raise UnhandledCaseError(
+ "Got void pointer param/member with last length 1")
+ else:
+ # An array of void values is a byte array.
+ entry += 'byte'
+
+ elif paramtype == 'char':
+ # A null terminated array of chars is a string
+ if lengths[-1].null_terminated:
+ entry += 'UTF-8 string'
+ else:
+ # Else it is just a bunch of chars
+ entry += 'char value'
+
+ elif self.paramIsConst(param):
+ # If a value is "const" that means it will not get modified,
+ # so it must be valid going into the function.
+ if 'const' in param.text:
+
+ if not self.isStructAlwaysValid(paramtype):
+ entry += 'valid '
+
+ # Check if the array elements are optional
+ array_element_optional = param.get('optional') is not None \
+ and len(param.get('optional').split(',')) == len(LengthEntry.parse_len_from_param(param)) + 1 \
+ and param.get('optional').split(',')[-1] == 'true'
+ if array_element_optional and self.getTypeCategory(paramtype) != 'bitmask': # bitmask is handled later
+ entry += 'or dlink:' + self.conventions.api_prefix + 'NULL_HANDLE '
+
+ entry += typetext
+
+ # pluralize
+ if len(lengths) > 1 or (lengths[0] != 1 and not lengths[0].null_terminated):
+ entry += 's'
+
+ return self.handleRequiredBitmask(blockname, param, paramtype, entry, 'true' if array_element_optional else None)
+
+ if self.paramIsPointer(param):
+ # Handle pointers - which are really special case arrays (i.e.
+ # they do not have a length)
+ # TODO should do something here if someone ever uses some intricate comma-separated `optional`
+ pointercount = param.find('type').tail.count('*')
+
+ # Treat void* as an int
+ if paramtype == 'void':
+ optional = param.get('optional')
+ # If there is only void*, it is just optional int - we do not need any language.
+ if pointercount == 1 and optional is not None:
+ return None # early return
+ # Treat the inner-most void* as an int
+ pointercount -= 1
+
+ # Could be multi-level pointers (e.g. ppData - pointer to a pointer). Handle that.
+ entry += 'a '
+ entry += (self.valid_pointer_text + ' to a ') * pointercount
+
+ # Handle void* and pointers to it
+ if paramtype == 'void':
+ if optional is None or optional.split(',')[pointercount]:
+ # The last void* is just optional int (e.g. to be filled by the impl.)
+ typetext = 'pointer value'
+
+ # If a value is "const" that means it will not get modified, so
+ # it must be valid going into the function.
+ elif self.paramIsConst(param) and paramtype != 'void':
+ entry += 'valid '
+
+ entry += typetext
+ return self.handleRequiredBitmask(blockname, param, paramtype, entry, param.get('optional'))
+
+ # Add additional line for non-optional bitmasks
+ if self.getTypeCategory(paramtype) == 'bitmask':
+ # TODO does not really handle if someone tries something like optional="true,false"
+ # TODO OpenXR has 0 or a valid combination of flags, for optional things.
+ # Vulkan does not...
+ # isMandatory = param.get('optional') is None
+ # if not isMandatory:
+ # entry += self.conventions.zero
+ # entry += ' or '
+ # Non-pointer, non-optional things must be valid
+ entry += 'a valid {}'.format(typetext)
+
+ return self.handleRequiredBitmask(blockname, param, paramtype, entry, param.get('optional'))
+
+ # Non-pointer, non-optional things must be valid
+ entry += 'a valid {}'.format(typetext)
+ return entry
+
+ def handleRequiredBitmask(self, blockname, param, paramtype, entry, optional):
+ # TODO does not really handle if someone tries something like optional="true,false"
+ if self.getTypeCategory(paramtype) != 'bitmask' or optional == 'true':
+ return entry
+ if self.paramIsPointer(param) and not self.paramIsArray(param):
+ # This is presumably an output parameter
+ return entry
+
+ param_name = getElemName(param)
+ # If mandatory, then we need two entries instead of just one.
+ validity = self.makeValidityCollection(blockname)
+ validity += entry
+
+ entry2 = ValidityEntry(anchor=(param_name, 'requiredbitmask'))
+ if self.paramIsArray(param):
+ entry2 += 'Each element of '
+ entry2 += '{} must: not be {}'.format(
+ self.makeParameterName(param_name), self.conventions.zero)
+ validity += entry2
+ return validity
+
+ def createValidationLineForParameter(self, blockname, param, params, typecategory, selector, parentname):
+ """Make an entire validation entry for a given parameter."""
+ param_name = getElemName(param)
+ paramtype = getElemType(param)
+
+ is_array = self.paramIsArray(param)
+ is_pointer = self.paramIsPointer(param)
+ needs_recursive_validity = (is_array
+ or is_pointer
+ or not self.isStructAlwaysValid(paramtype))
+ typetext = None
+ if paramtype in ('void', 'char'):
+ # Chars and void are special cases - we call the impl function,
+ # but do not use the typetext.
+ # A null-terminated char array is a string, else it is chars.
+ # An array of void values is a byte array, a void pointer is just a pointer to nothing in particular
+ typetext = ''
+
+ elif typecategory == 'bitmask':
+ bitsname = paramtype.replace('Flags', 'FlagBits')
+ bitselem = self.registry.tree.find("enums[@name='" + bitsname + "']")
+
+ # If bitsname is an alias, then use the alias to get bitselem.
+ typeElem = self.registry.lookupElementInfo(bitsname, self.registry.typedict)
+ if typeElem is not None:
+ alias = self.registry.getAlias(typeElem.elem, self.registry.typedict)
+ if alias is not None:
+ bitselem = self.registry.tree.find("enums[@name='" + alias + "']")
+
+ if bitselem is None or len(bitselem.findall('enum[@required="true"]')) == 0:
+ # Empty bit mask: presumably just a placeholder (or only in
+ # an extension not enabled for this build)
+ entry = ValidityEntry(
+ anchor=(param_name, 'zerobitmask'))
+ entry += self.makeParameterName(param_name)
+ entry += ' must: be '
+ entry += self.conventions.zero
+ # Early return
+ return entry
+
+ is_const = self.paramIsConst(param)
+
+ if is_array:
+ if is_const:
+ # input an array of bitmask values
+ template = 'combinations of {bitsname} value'
+ else:
+ template = '{paramtype} value'
+ elif is_pointer:
+ if is_const:
+ template = 'combination of {bitsname} values'
+ else:
+ template = '{paramtype} value'
+ else:
+ template = 'combination of {bitsname} values'
+
+ # The above few cases all use makeEnumerationName, just with different context.
+ typetext = template.format(
+ bitsname=self.makeEnumerationName(bitsname),
+ paramtype=self.makeFlagsName(paramtype))
+
+ elif typecategory == 'handle':
+ typetext = '{} handle'.format(self.makeStructName(paramtype))
+
+ elif typecategory == 'enum':
+ typetext = '{} value'.format(self.makeEnumerationName(paramtype))
+
+ elif typecategory == 'funcpointer':
+ typetext = '{} value'.format(self.makeFuncPointerName(paramtype))
+
+ elif typecategory == 'struct':
+ if needs_recursive_validity:
+ typetext = '{} structure'.format(
+ self.makeStructName(paramtype))
+
+ elif typecategory == 'union':
+ if needs_recursive_validity:
+ typetext = '{} union'.format(self.makeStructName(paramtype))
+
+ elif self.paramIsArray(param) or self.paramIsPointer(param):
+ # TODO sync cosmetic changes from OpenXR?
+ if typecategory is None:
+ typetext = f'code:{paramtype} value'
+ else:
+ typetext = '{} value'.format(self.makeBaseTypeName(paramtype))
+
+ elif typecategory is None:
+ if not self.isStructAlwaysValid(paramtype):
+ typetext = '{} value'.format(
+ self.makeExternalTypeName(paramtype))
+
+ # "a valid uint32_t value" does not make much sense.
+ pass
+
+ # If any of the above conditions matched and set typetext,
+ # we call using it.
+ if typetext is not None:
+ return self.createValidationLineForParameterImpl(
+ blockname, param, params, typetext, selector, parentname)
+ return None
+
+ def makeHandleValidityParent(self, param, params):
+ """Make a validity entry for a handle's parent object.
+
+ Creates 'parent' VUID.
+ """
+ param_name = getElemName(param)
+ paramtype = getElemType(param)
+
+ # Iterate up the handle parent hierarchy for the first parameter of
+ # a parent type.
+ # This enables cases where a more distant ancestor is present, such
+ # as VkDevice and VkCommandBuffer (but no direct parent
+ # VkCommandPool).
+
+ while True:
+ # If we run out of ancestors, give up
+ handleparent = self.getHandleParent(paramtype)
+ if handleparent is None:
+ if self.trace:
+ print(f'makeHandleValidityParent:{param_name} has no handle parent, skipping')
+ return None
+
+ # Look for a parameter of the ancestor type
+ otherparam = findTypedElem(params, handleparent)
+ if otherparam is not None:
+ break
+
+ # Continue up the hierarchy
+ paramtype = handleparent
+
+ parent_name = getElemName(otherparam)
+ entry = ValidityEntry(anchor=(param_name, 'parent'))
+
+ is_optional = self.isHandleOptional(param, params)
+
+ if self.paramIsArray(param):
+ template = 'Each element of {}'
+ if is_optional:
+ template += ' that is a valid handle'
+ elif is_optional:
+ template = 'If {} is a valid handle, it'
+ else:
+ # not optional, not an array. Just say the parameter name.
+ template = '{}'
+
+ entry += template.format(self.makeParameterName(param_name))
+
+ entry += ' must: have been created, allocated, or retrieved from {}'.format(
+ self.makeParameterName(parent_name))
+
+ return entry
+
+ def makeAsciiDocHandlesCommonAncestor(self, blockname, handles, params):
+ """Make an asciidoc validity entry for a common ancestors between handles.
+
+ Only handles parent validity for signatures taking multiple handles
+ any ancestors also being supplied to this function.
+ (e.g. "Each of x, y, and z must: come from the same slink:ParentHandle")
+ See self.makeAsciiDocHandleParent() for instances where the parent
+ handle is named and also passed.
+
+ Creates 'commonparent' VUID.
+ """
+ # TODO Replace with refactored code from OpenXR
+ entry = None
+
+ if len(handles) > 1:
+ ancestormap = {}
+ anyoptional = False
+ # Find all the ancestors
+ for param in handles:
+ paramtype = getElemType(param)
+
+ if not self.paramIsPointer(param) or (param.text and 'const' in param.text):
+ ancestors = self.getHandleDispatchableAncestors(paramtype)
+
+ ancestormap[param] = ancestors
+
+ anyoptional |= self.isHandleOptional(param, params)
+
+ # Remove redundant ancestor lists
+ for param in handles:
+ paramtype = getElemType(param)
+
+ removals = []
+ for ancestors in ancestormap.items():
+ if paramtype in ancestors[1]:
+ removals.append(ancestors[0])
+
+ if removals != []:
+ for removal in removals:
+ del(ancestormap[removal])
+
+ # Intersect
+
+ if len(ancestormap.values()) > 1:
+ current = list(ancestormap.values())[0]
+ for ancestors in list(ancestormap.values())[1:]:
+ current = [val for val in current if val in ancestors]
+
+ if len(current) > 0:
+ commonancestor = current[0]
+
+ if len(ancestormap.keys()) > 1:
+
+ entry = ValidityEntry(anchor=('commonparent',))
+
+ parametertexts = []
+ for param in ancestormap.keys():
+ param_name = getElemName(param)
+ parametertext = self.makeParameterName(param_name)
+ if self.paramIsArray(param):
+ parametertext = 'the elements of ' + parametertext
+ parametertexts.append(parametertext)
+
+ parametertexts.sort()
+
+ if len(parametertexts) > 2:
+ entry += 'Each of '
+ else:
+ entry += 'Both of '
+
+ entry += self.makeProseList(parametertexts,
+ comma_for_two_elts=True)
+ if anyoptional is True:
+ entry += ' that are valid handles of non-ignored parameters'
+ entry += ' must: have been created, allocated, or retrieved from the same '
+ entry += self.makeStructName(commonancestor)
+
+ return entry
+
+ def makeStructureTypeFromName(self, structname):
+ """Create text for a structure type name, like ename:VK_STRUCTURE_TYPE_CREATE_INSTANCE_INFO"""
+ return self.makeEnumerantName(self.conventions.generate_structure_type_from_name(structname))
+
+ def makeStructureTypeValidity(self, structname):
+ """Generate an validity line for the type value of a struct.
+
+ Creates VUID named like the member name.
+ """
+ info = self.registry.typedict.get(structname)
+ assert(info is not None)
+
+ # If this fails (meaning we have something other than a struct in here),
+ # then the caller is wrong:
+ # probably passing the wrong value for structname.
+ members = info.getMembers()
+ assert(members)
+
+ # If this fails, see caller: this should only get called for a struct type with a type value.
+ param = findNamedElem(members, self.structtype_member_name)
+ # OpenXR gets some structs without a type field in here, so cannot assert
+ assert(param is not None)
+ # if param is None:
+ # return None
+
+ entry = ValidityEntry(
+ anchor=(self.structtype_member_name, self.structtype_member_name))
+ entry += self.makeParameterName(self.structtype_member_name)
+ entry += ' must: be '
+
+ values = param.get('values', '').split(',')
+ if values:
+ # Extract each enumerant value. They could be validated in the
+ # same fashion as validextensionstructs in
+ # makeStructureExtensionPointer, although that is not relevant in
+ # the current extension struct model.
+ entry += self.makeProseList((self.makeEnumerantName(v)
+ for v in values), 'or')
+ return entry
+
+ if 'Base' in structname:
+ # This type does not even have any values for its type, and it
+ # seems like it might be a base struct that we would expect to
+ # lack its own type, so omit the entire statement
+ return None
+
+ self.logMsg('warn', 'No values were marked-up for the structure type member of',
+ structname, 'so making one up!')
+ entry += self.makeStructureTypeFromName(structname)
+
+ return entry
+
+ def makeStructureExtensionPointer(self, blockname, param):
+ """Generate an validity line for the pointer chain member value of a struct."""
+ param_name = getElemName(param)
+
+ if param.get('validextensionstructs') is not None:
+ self.logMsg('warn', blockname,
+ 'validextensionstructs is deprecated/removed', '\n')
+
+ entry = ValidityEntry(
+ anchor=(param_name, self.nextpointer_member_name))
+ validextensionstructs = self.registry.validextensionstructs.get(
+ blockname)
+ extensionstructs = []
+ duplicatestructs = []
+
+ if validextensionstructs is not None:
+ # Check each structure name and skip it if not required by the
+ # generator. This allows tagging extension structs in the XML
+ # that are only included in validity when needed for the spec
+ # being targeted.
+ # Track the required structures, and of the required structures,
+ # those that allow duplicates in the pNext chain.
+ for struct in validextensionstructs:
+ # Unpleasantly breaks encapsulation. Should be a method in the registry class
+ t = self.registry.lookupElementInfo(
+ struct, self.registry.typedict)
+ if t is None:
+ self.logMsg('warn', 'makeStructureExtensionPointer: struct', struct,
+ 'is in a validextensionstructs= attribute but is not in the registry')
+ elif t.required:
+ extensionstructs.append('slink:' + struct)
+ if t.elem.get('allowduplicate') == 'true':
+ duplicatestructs.append('slink:' + struct)
+ else:
+ self.logMsg(
+ 'diag', 'makeStructureExtensionPointer: struct', struct, 'IS NOT required')
+
+ if not extensionstructs:
+ entry += '{} must: be {}'.format(
+ self.makeParameterName(param_name), self.null)
+ return entry
+
+ if len(extensionstructs) == 1:
+ entry += '{} must: be {} or a pointer to a valid instance of {}'.format(self.makeParameterName(param_name), self.null,
+ extensionstructs[0])
+ else:
+ # More than one extension struct.
+ entry += 'Each {} member of any structure (including this one) in the pname:{} chain '.format(
+ self.makeParameterName(param_name), self.nextpointer_member_name)
+ entry += 'must: be either {} or a pointer to a valid instance of '.format(
+ self.null)
+
+ entry += self.makeProseList(extensionstructs, fmt=plf.OR)
+
+ validity = self.makeValidityCollection(blockname)
+ validity += entry
+
+ # Generate VU statement requiring unique structures in the pNext
+ # chain.
+ # NOTE: OpenXR always allows non-unique type values. Instances other
+ # than the first are just ignored
+
+ vu = ('The pname:' +
+ self.structtype_member_name +
+ ' value of each struct in the pname:' +
+ self.nextpointer_member_name +
+ ' chain must: be unique')
+ anchor = (self.conventions.member_used_for_unique_vuid, 'unique')
+
+ # If duplicates of some structures are allowed, they are called out
+ # explicitly.
+ num = len(duplicatestructs)
+ if num > 0:
+ vu = (vu +
+ ', with the exception of structures of type ' +
+ self.makeProseList(duplicatestructs, fmt=plf.OR))
+
+ validity.addValidityEntry(vu, anchor = anchor )
+
+ return validity
+
+ def addSharedStructMemberValidity(self, struct, blockname, param, validity):
+ """Generate language to independently validate a parameter, for those validated even in output.
+
+ Return value indicates whether it was handled internally (True) or if it may need more validity (False)."""
+ param_name = getElemName(param)
+ paramtype = getElemType(param)
+ if param.get('noautovalidity') is None:
+
+ if self.conventions.is_structure_type_member(paramtype, param_name):
+ validity += self.makeStructureTypeValidity(blockname)
+ return True
+
+ if self.conventions.is_nextpointer_member(paramtype, param_name):
+ # Vulkan: the addition of validity here is conditional unlike OpenXR.
+ if struct.get('structextends') is None:
+ validity += self.makeStructureExtensionPointer(
+ blockname, param)
+ return True
+ return False
+
+ def makeOutputOnlyStructValidity(self, cmd, blockname, params):
+ """Generate all the valid usage information for a struct that is entirely output.
+
+ That is, it is only ever filled out by the implementation other than
+ the structure type and pointer chain members.
+ Thus, we only create validity for the pointer chain member.
+ """
+ # Start the validity collection for this struct
+ validity = self.makeValidityCollection(blockname)
+
+ for param in params:
+ self.addSharedStructMemberValidity(
+ cmd, blockname, param, validity)
+
+ return validity
+
+ def isVKVersion11(self):
+ """Returns true if VK_VERSION_1_1 is being emitted."""
+ vk11 = re.match(self.registry.genOpts.emitversions, 'VK_VERSION_1_1') is not None
+ return vk11
+
+ def videocodingRequired(self):
+ """Returns true if VK_KHR_video_queue is being emitted and thus validity
+ with respect to the videocoding attribute should be generated."""
+ return 'VK_KHR_video_queue' in self.registry.requiredextensions
+
+ def getVideocoding(self, cmd):
+ """Returns the value of the videocoding attribute, also considering the
+ default value when the attribute is not present."""
+ videocoding = cmd.get('videocoding')
+ if videocoding is None:
+ videocoding = 'outside'
+ return videocoding
+
+ def conditionallyRemoveQueueType(self, queues, queuetype, condition):
+ """Removes a queue type from a queue list based on the specified condition."""
+ if queuetype in queues and condition:
+ queues.remove(queuetype)
+
+ def getQueueList(self, cmd):
+ """Returns the list of queue types a command is supported on."""
+ queues = cmd.get('queues')
+ if queues is None:
+ return None
+ queues = queues.split(',')
+
+ # Filter queue types that have dependencies
+ self.conditionallyRemoveQueueType(queues, 'sparse_binding', self.conventions.xml_api_name == "vulkansc")
+ self.conditionallyRemoveQueueType(queues, 'decode', 'VK_KHR_video_decode_queue' not in self.registry.requiredextensions)
+ self.conditionallyRemoveQueueType(queues, 'encode', 'VK_KHR_video_encode_queue' not in self.registry.requiredextensions)
+ self.conditionallyRemoveQueueType(queues, 'opticalflow', 'VK_NV_optical_flow' not in self.registry.requiredextensions)
+
+ # Verify that no new queue type is introduced accidentally
+ for queue in queues:
+ if queue not in [ 'transfer', 'compute', 'graphics', 'sparse_binding', 'decode', 'encode', 'opticalflow' ]:
+ self.logMsg('error', f'Unknown queue type "{queue}".')
+
+ return queues
+
+ def getPrettyQueueList(self, cmd):
+ """Returns a prettified version of the queue list which can be included in spec language text."""
+ queues = self.getQueueList(cmd)
+ if queues is None:
+ return None
+
+ replace = {
+ 'sparse_binding': 'sparse binding',
+ 'opticalflow': 'optical flow'
+ }
+ return [replace[queue] if queue in replace else queue for queue in queues]
+
+ def makeStructOrCommandValidity(self, cmd, blockname, params):
+ """Generate all the valid usage information for a given struct or command."""
+ validity = self.makeValidityCollection(blockname)
+ handles = []
+ arraylengths = dict()
+ for param in params:
+ param_name = getElemName(param)
+ paramtype = getElemType(param)
+
+ # Valid usage ID tags (VUID) are generated for various
+ # conditions based on the name of the block (structure or
+ # command), name of the element (member or parameter), and type
+ # of VU statement.
+
+ # Get the type's category
+ typecategory = self.getTypeCategory(paramtype)
+
+ if not self.addSharedStructMemberValidity(
+ cmd, blockname, param, validity):
+ if not param.get('selector'):
+ validity += self.createValidationLineForParameter(
+ blockname, param, params, typecategory, None, None)
+ else:
+ selector = param.get('selector')
+ if typecategory != 'union':
+ self.logMsg('warn', 'selector attribute set on non-union parameter', param_name, 'in', blockname)
+
+ paraminfo = self.registry.lookupElementInfo(paramtype, self.registry.typedict)
+
+ for member in paraminfo.getMembers():
+ membertype = getElemType(member)
+ membertypecategory = self.getTypeCategory(membertype)
+
+ validity += self.createValidationLineForParameter(
+ blockname, member, paraminfo.getMembers(), membertypecategory, selector, param_name)
+
+ # Ensure that any parenting is properly validated, and list that a handle was found
+ if typecategory == 'handle':
+ handles.append(param)
+
+ # Get the array length for this parameter
+ lengths = LengthEntry.parse_len_from_param(param)
+ if lengths:
+ arraylengths.update({length.other_param_name: length
+ for length in lengths
+ if length.other_param_name})
+
+ # For any vkQueue* functions, there might be queue type data
+ if 'vkQueue' in blockname:
+ # The queue type must be valid
+ queues = self.getPrettyQueueList(cmd)
+ if queues:
+ entry = ValidityEntry(anchor=('queuetype',))
+ entry += 'The pname:queue must: support '
+ entry += self.makeProseList(queues,
+ fmt=plf.OR, comma_for_two_elts=True)
+ entry += ' operations'
+ validity += entry
+
+ if 'vkCmd' in blockname:
+ # The commandBuffer parameter must be being recorded
+ entry = ValidityEntry(anchor=('commandBuffer', 'recording'))
+ entry += 'pname:commandBuffer must: be in the <<commandbuffers-lifecycle, recording state>>'
+ validity += entry
+
+ #
+ # Start of valid queue type validation - command pool must have been
+ # allocated against a queue with at least one of the valid queue types
+ entry = ValidityEntry(anchor=('commandBuffer', 'cmdpool'))
+
+ #
+ # This test for vkCmdFillBuffer is a hack, since we have no path
+ # to conditionally have queues enabled or disabled by an extension.
+ # As the VU stuff is all moving out (hopefully soon), this hack solves the issue for now
+ if blockname == 'vkCmdFillBuffer':
+ entry += 'The sname:VkCommandPool that pname:commandBuffer was allocated from must: support '
+ if self.isVKVersion11() or 'VK_KHR_maintenance1' in self.registry.requiredextensions:
+ entry += 'transfer, graphics or compute operations'
+ else:
+ entry += 'graphics or compute operations'
+ else:
+ # The queue type must be valid
+ queues = self.getPrettyQueueList(cmd)
+ assert(queues)
+ entry += 'The sname:VkCommandPool that pname:commandBuffer was allocated from must: support '
+ entry += self.makeProseList(queues,
+ fmt=plf.OR, comma_for_two_elts=True)
+ entry += ' operations'
+ validity += entry
+
+ # Must be called inside/outside a render pass appropriately
+ renderpass = cmd.get('renderpass')
+
+ if renderpass != 'both':
+ entry = ValidityEntry(anchor=('renderpass',))
+ entry += 'This command must: only be called '
+ entry += renderpass
+ entry += ' of a render pass instance'
+ validity += entry
+
+ # Must be called inside/outside a video coding scope appropriately
+ if self.videocodingRequired():
+ videocoding = self.getVideocoding(cmd)
+ if videocoding != 'both':
+ entry = ValidityEntry(anchor=('videocoding',))
+ entry += 'This command must: only be called '
+ entry += videocoding
+ entry += ' of a video coding scope'
+ validity += entry
+
+ # Must be in the right level command buffer
+ cmdbufferlevel = cmd.get('cmdbufferlevel')
+
+ if cmdbufferlevel != 'primary,secondary':
+ entry = ValidityEntry(anchor=('bufferlevel',))
+ entry += 'pname:commandBuffer must: be a '
+ entry += cmdbufferlevel
+ entry += ' sname:VkCommandBuffer'
+ validity += entry
+
+ # Any non-optional arraylengths should specify they must be greater than 0
+ array_length_params = ((param, getElemName(param))
+ for param in params
+ if getElemName(param) in arraylengths)
+
+ for param, param_name in array_length_params:
+ if param.get('optional') is not None:
+ continue
+
+ length = arraylengths[param_name]
+ full_length = length.full_reference
+
+ # Is this just a name of a param? If false, then it is some kind
+ # of qualified name (a member of a param for instance)
+ simple_param_reference = (len(length.param_ref_parts) == 1)
+ if not simple_param_reference:
+ # Loop through to see if any parameters in the chain are optional
+ array_length_parent = cmd
+ array_length_optional = False
+ for part in length.param_ref_parts:
+ # Overwrite the param so it ends up as the bottom level parameter for later checks
+ param = array_length_parent.find("*/[name='{}']".format(part))
+
+ # If any parameter in the chain is optional, skip the implicit length requirement
+ array_length_optional |= (param.get('optional') is not None)
+
+ # Lookup the type of the parameter for the next loop iteration
+ type = param.findtext('type')
+ array_length_parent = self.registry.tree.find("./types/type/[@name='{}']".format(type))
+
+ if array_length_optional:
+ continue
+
+ # Get all the array dependencies
+ arrays = cmd.findall(
+ "param/[@len='{}'][@optional='true']".format(full_length))
+
+ # Get all the optional array dependencies, including those not generating validity for some reason
+ optionalarrays = arrays + \
+ cmd.findall(
+ "param/[@len='{}'][@noautovalidity='true']".format(full_length))
+
+ entry = ValidityEntry(anchor=(full_length, 'arraylength'))
+ # Allow lengths to be arbitrary if all their dependents are optional
+ if optionalarrays and len(optionalarrays) == len(arrays):
+ entry += 'If '
+ # TODO sync this section from OpenXR once cosmetic changes OK
+
+ optional_array_names = (self.makeParameterName(getElemName(array))
+ for array in optionalarrays)
+ entry += self.makeProseListIs(optional_array_names,
+ plf.ANY_OR, comma_for_two_elts=True)
+
+ entry += ' not {}, '.format(self.null)
+
+ # TODO end needs sync cosmetic
+ if self.paramIsPointer(param):
+ entry += 'the value referenced by '
+
+ # Split and re-join here to insert pname: around ::
+ entry += '::'.join(self.makeParameterName(part)
+ for part in full_length.split('::'))
+ # TODO replace the previous statement with the following when cosmetic changes OK
+ # entry += length.get_human_readable(make_param_name=self.makeParameterName)
+
+ entry += ' must: be greater than '
+ entry += self.conventions.zero
+ validity += entry
+
+ # Find the parents of all objects referenced in this command
+ for param in handles:
+ # Do not detect a parent for return values!
+ if not self.paramIsPointer(param) or self.paramIsConst(param):
+ validity += self.makeHandleValidityParent(param, params)
+
+ # Find the common ancestor of all objects referenced in this command
+ validity += self.makeAsciiDocHandlesCommonAncestor(
+ blockname, handles, params)
+
+ return validity
+
+ def makeThreadSafetyBlock(self, cmd, paramtext):
+ """Generate thread-safety validity entries for cmd/structure"""
+ # See also makeThreadSafetyBlock in validitygenerator.py
+ validity = self.makeValidityCollection(getElemName(cmd))
+
+ # This text varies between projects, so an Asciidoctor attribute is used.
+ extsync_prefix = "{externsyncprefix} "
+
+ # Find and add any parameters that are thread unsafe
+ explicitexternsyncparams = cmd.findall(paramtext + "[@externsync]")
+ if explicitexternsyncparams is not None:
+ for param in explicitexternsyncparams:
+ externsyncattribs = ExternSyncEntry.parse_externsync_from_param(
+ param)
+ param_name = getElemName(param)
+
+ for attrib in externsyncattribs:
+ entry = ValidityEntry()
+ entry += extsync_prefix
+ if attrib.entirely_extern_sync:
+ if self.paramIsArray(param):
+ entry += 'each member of '
+ elif self.paramIsPointer(param):
+ entry += 'the object referenced by '
+
+ entry += self.makeParameterName(param_name)
+
+ if attrib.children_extern_sync:
+ entry += ', and any child handles,'
+
+ else:
+ entry += 'pname:'
+ entry += str(attrib.full_reference)
+ # TODO switch to the following when cosmetic changes OK
+ # entry += attrib.get_human_readable(make_param_name=self.makeParameterName)
+ entry += ' must: be externally synchronized'
+ validity += entry
+
+ # Vulkan-specific
+ # For any vkCmd* functions, the command pool is externally synchronized
+ if cmd.find('proto/name') is not None and 'vkCmd' in cmd.find('proto/name').text:
+ entry = ValidityEntry()
+ entry += extsync_prefix
+ entry += 'the sname:VkCommandPool that pname:commandBuffer was allocated from must: be externally synchronized'
+ validity += entry
+
+ # Find and add any "implicit" parameters that are thread unsafe
+ implicitexternsyncparams = cmd.find('implicitexternsyncparams')
+ if implicitexternsyncparams is not None:
+ for elem in implicitexternsyncparams:
+ entry = ValidityEntry()
+ entry += extsync_prefix
+ entry += elem.text
+ entry += ' must: be externally synchronized'
+ validity += entry
+
+ return validity
+
+ def makeCommandPropertiesTableHeader(self):
+ header = '|<<VkCommandBufferLevel,Command Buffer Levels>>'
+ header += '|<<vkCmdBeginRenderPass,Render Pass Scope>>'
+ if self.videocodingRequired():
+ header += '|<<vkCmdBeginVideoCodingKHR,Video Coding Scope>>'
+ header += '|<<VkQueueFlagBits,Supported Queue Types>>'
+ header += '|<<fundamentals-queueoperation-command-types,Command Type>>'
+ return header
+
+ def makeCommandPropertiesTableEntry(self, cmd, name):
+ cmdbufferlevel, renderpass, videocoding, queues, tasks = None, None, None, None, None
+
+ if 'vkCmd' in name:
+ # Must be called in primary/secondary command buffers appropriately
+ cmdbufferlevel = cmd.get('cmdbufferlevel')
+ cmdbufferlevel = (' + \n').join(cmdbufferlevel.title().split(','))
+
+ # Must be called inside/outside a render pass appropriately
+ renderpass = cmd.get('renderpass')
+ renderpass = renderpass.capitalize()
+
+ # Must be called inside/outside a video coding scope appropriately
+ if self.videocodingRequired():
+ videocoding = self.getVideocoding(cmd).capitalize()
+
+ #
+ # This test for vkCmdFillBuffer is a hack, since we have no path
+ # to conditionally have queues enabled or disabled by an extension.
+ # As the VU stuff is all moving out (hopefully soon), this hack solves the issue for now
+ if name == 'vkCmdFillBuffer':
+ if self.isVKVersion11() or 'VK_KHR_maintenance1' in self.registry.requiredextensions:
+ queues = [ 'transfer', 'graphics', 'compute' ]
+ else:
+ queues = [ 'graphics', 'compute' ]
+ else:
+ queues = self.getQueueList(cmd)
+ queues = (' + \n').join([queue.title() for queue in queues])
+
+ tasks = cmd.get('tasks')
+ tasks = (' + \n').join(tasks.title().split(','))
+ elif 'vkQueue' in name:
+ # For queue commands there are no command buffer level, render
+ # pass, or video coding scope specific restrictions,
+ # or command type, but the queue types are considered
+ cmdbufferlevel = '-'
+ renderpass = '-'
+ if self.videocodingRequired():
+ videocoding = '-'
+
+ queues = self.getQueueList(cmd)
+ if queues is None:
+ queues = 'Any'
+ else:
+ queues = (' + \n').join([queue.upper() for queue in queues])
+
+ tasks = '-'
+
+ table_items = (cmdbufferlevel, renderpass, videocoding, queues, tasks)
+ entry = '|'.join(filter(None, table_items))
+
+ return ('|' + entry) if entry else None
+
+
+ def findRequiredEnums(self, enums):
+ """Check each enumerant name in the enums list and remove it if not
+ required by the generator. This allows specifying success and error
+ codes for extensions that are only included in validity when needed
+ for the spec being targeted."""
+ return self.keepOnlyRequired(enums, self.registry.enumdict)
+
+ def findRequiredCommands(self, commands):
+ """Check each command name in the commands list and remove it if not
+ required by the generator.
+
+ This will allow some state operations to take place before endFile."""
+ return self.keepOnlyRequired(commands, self.registry.cmddict)
+
+ def keepOnlyRequired(self, names, info_dict):
+ """Check each element name in the supplied dictionary and remove it if not
+ required by the generator.
+
+ This will allow some operations to take place before endFile no matter the order of generation."""
+ # TODO Unpleasantly breaks encapsulation. Should be a method in the registry class
+
+ def is_required(name):
+ info = self.registry.lookupElementInfo(name, info_dict)
+ if info is None:
+ return False
+ if not info.required:
+ self.logMsg('diag', 'keepOnlyRequired: element',
+ name, 'IS NOT required, skipping')
+ return info.required
+
+ return [name
+ for name in names
+ if is_required(name)]
+
+ def makeReturnCodeList(self, attrib, cmd, name):
+ """Return a list of possible return codes for a function.
+
+ attrib is either 'successcodes' or 'errorcodes'.
+ """
+ return_lines = []
+ RETURN_CODE_FORMAT = '* ename:{}'
+
+ codes_attr = cmd.get(attrib)
+ if codes_attr:
+ codes = self.findRequiredEnums(codes_attr.split(','))
+ if codes:
+ return_lines.extend((RETURN_CODE_FORMAT.format(code)
+ for code in codes))
+
+ applicable_ext_codes = (ext_code
+ for ext_code in self.registry.commandextensionsuccesses
+ if ext_code.command == name)
+ for ext_code in applicable_ext_codes:
+ line = RETURN_CODE_FORMAT.format(ext_code.value)
+ if ext_code.extension:
+ line += ' [only if {} is enabled]'.format(
+ self.conventions.formatExtension(ext_code.extension))
+
+ return_lines.append(line)
+ if return_lines:
+ return '\n'.join(return_lines)
+
+ return None
+
+ def makeSuccessCodes(self, cmd, name):
+ return self.makeReturnCodeList('successcodes', cmd, name)
+
+ def makeErrorCodes(self, cmd, name):
+ return self.makeReturnCodeList('errorcodes', cmd, name)
+
+ def genCmd(self, cmdinfo, name, alias):
+ """Command generation."""
+ OutputGenerator.genCmd(self, cmdinfo, name, alias)
+
+ # @@@ (Jon) something needs to be done here to handle aliases, probably
+
+ validity = self.makeValidityCollection(name)
+
+ # OpenXR-only: make sure extension is enabled
+ # validity.possiblyAddExtensionRequirement(self.currentExtension, 'calling flink:')
+
+ validity += self.makeStructOrCommandValidity(
+ cmdinfo.elem, name, cmdinfo.getParams())
+
+ threadsafety = self.makeThreadSafetyBlock(cmdinfo.elem, 'param')
+ commandpropertiesentry = None
+
+ # Vulkan-specific
+ commandpropertiesentry = self.makeCommandPropertiesTableEntry(
+ cmdinfo.elem, name)
+ successcodes = self.makeSuccessCodes(cmdinfo.elem, name)
+ errorcodes = self.makeErrorCodes(cmdinfo.elem, name)
+
+ # OpenXR-specific
+ # self.generateStateValidity(validity, name)
+
+ self.writeInclude('protos', name, validity, threadsafety,
+ commandpropertiesentry, successcodes, errorcodes)
+
+ def genStruct(self, typeinfo, typeName, alias):
+ """Struct Generation."""
+ OutputGenerator.genStruct(self, typeinfo, typeName, alias)
+
+ # @@@ (Jon) something needs to be done here to handle aliases, probably
+
+ # Anything that is only ever returned cannot be set by the user, so
+ # should not have any validity information.
+ validity = self.makeValidityCollection(typeName)
+ threadsafety = []
+
+ # OpenXR-only: make sure extension is enabled
+ # validity.possiblyAddExtensionRequirement(self.currentExtension, 'using slink:')
+
+ if typeinfo.elem.get('category') != 'union':
+ if typeinfo.elem.get('returnedonly') is None:
+ validity += self.makeStructOrCommandValidity(
+ typeinfo.elem, typeName, typeinfo.getMembers())
+ threadsafety = self.makeThreadSafetyBlock(typeinfo.elem, 'member')
+
+ else:
+ # Need to generate structure type and next pointer chain member validation
+ validity += self.makeOutputOnlyStructValidity(
+ typeinfo.elem, typeName, typeinfo.getMembers())
+
+ self.writeInclude('structs', typeName, validity,
+ threadsafety, None, None, None)
+
+ def genGroup(self, groupinfo, groupName, alias):
+ """Group (e.g. C "enum" type) generation.
+ For the validity generator, this just tags individual enumerants
+ as required or not.
+ """
+ OutputGenerator.genGroup(self, groupinfo, groupName, alias)
+
+ # @@@ (Jon) something needs to be done here to handle aliases, probably
+
+ groupElem = groupinfo.elem
+
+ # Loop over the nested 'enum' tags. Keep track of the minimum and
+ # maximum numeric values, if they can be determined; but only for
+ # core API enumerants, not extension enumerants. This is inferred
+ # by looking for 'extends' attributes.
+ for elem in groupElem.findall('enum'):
+ name = elem.get('name')
+ ei = self.registry.lookupElementInfo(name, self.registry.enumdict)
+
+ if ei is None:
+ self.logMsg('error',
+ f'genGroup({groupName}) - no element found for enum {name}')
+
+ # Tag enumerant as required or not
+ ei.required = self.isEnumRequired(elem)
+
+ def genType(self, typeinfo, name, alias):
+ """Type Generation."""
+ OutputGenerator.genType(self, typeinfo, name, alias)
+
+ # @@@ (Jon) something needs to be done here to handle aliases, probably
+
+ category = typeinfo.elem.get('category')
+ if category in ('struct', 'union'):
+ self.genStruct(typeinfo, name, alias)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/vkconventions.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/vkconventions.py
new file mode 100755
index 00000000000..b4e79666cfa
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/vkconventions.py
@@ -0,0 +1,298 @@
+#!/usr/bin/python3 -i
+#
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Working-group-specific style conventions,
+# used in generation.
+
+import re
+import os
+
+from spec_tools.conventions import ConventionsBase
+
+# Modified from default implementation - see category_requires_validation() below
+CATEGORIES_REQUIRING_VALIDATION = set(('handle', 'enum', 'bitmask'))
+
+# Tokenize into "words" for structure types, approximately per spec "Implicit Valid Usage" section 2.7.2
+# This first set is for things we recognize explicitly as words,
+# as exceptions to the general regex.
+# Ideally these would be listed in the spec as exceptions, as OpenXR does.
+SPECIAL_WORDS = set((
+ '16Bit', # VkPhysicalDevice16BitStorageFeatures
+ '2D', # VkPhysicalDeviceImage2DViewOf3DFeaturesEXT
+ '3D', # VkPhysicalDeviceImage2DViewOf3DFeaturesEXT
+ '8Bit', # VkPhysicalDevice8BitStorageFeaturesKHR
+ 'AABB', # VkGeometryAABBNV
+ 'ASTC', # VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT
+ 'D3D12', # VkD3D12FenceSubmitInfoKHR
+ 'Float16', # VkPhysicalDeviceShaderFloat16Int8FeaturesKHR
+ 'ImagePipe', # VkImagePipeSurfaceCreateInfoFUCHSIA
+ 'Int64', # VkPhysicalDeviceShaderAtomicInt64FeaturesKHR
+ 'Int8', # VkPhysicalDeviceShaderFloat16Int8FeaturesKHR
+ 'MacOS', # VkMacOSSurfaceCreateInfoMVK
+ 'RGBA10X6', # VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT
+ 'Uint8', # VkPhysicalDeviceIndexTypeUint8FeaturesEXT
+ 'Win32', # VkWin32SurfaceCreateInfoKHR
+))
+# A regex to match any of the SPECIAL_WORDS
+EXCEPTION_PATTERN = r'(?P<exception>{})'.format(
+ '|'.join('(%s)' % re.escape(w) for w in SPECIAL_WORDS))
+MAIN_RE = re.compile(
+ # the negative lookahead is to prevent the all-caps pattern from being too greedy.
+ r'({}|([0-9]+)|([A-Z][a-z]+)|([A-Z][A-Z]*(?![a-z])))'.format(EXCEPTION_PATTERN))
+
+
+class VulkanConventions(ConventionsBase):
+ @property
+ def null(self):
+ """Preferred spelling of NULL."""
+ return '`NULL`'
+
+ def formatExtension(self, name):
+ """Mark up an extension name as a link the spec."""
+ return '`apiext:{}`'.format(name)
+
+ @property
+ def struct_macro(self):
+ """Get the appropriate format macro for a structure.
+
+ Primarily affects generated valid usage statements.
+ """
+
+ return 'slink:'
+
+ @property
+ def constFlagBits(self):
+ """Returns True if static const flag bits should be generated, False if an enumerated type should be generated."""
+ return False
+
+ @property
+ def structtype_member_name(self):
+ """Return name of the structure type member"""
+ return 'sType'
+
+ @property
+ def nextpointer_member_name(self):
+ """Return name of the structure pointer chain member"""
+ return 'pNext'
+
+ @property
+ def valid_pointer_prefix(self):
+ """Return prefix to pointers which must themselves be valid"""
+ return 'valid'
+
+ def is_structure_type_member(self, paramtype, paramname):
+ """Determine if member type and name match the structure type member."""
+ return paramtype == 'VkStructureType' and paramname == self.structtype_member_name
+
+ def is_nextpointer_member(self, paramtype, paramname):
+ """Determine if member type and name match the next pointer chain member."""
+ return paramtype == 'void' and paramname == self.nextpointer_member_name
+
+ def generate_structure_type_from_name(self, structname):
+ """Generate a structure type name, like VK_STRUCTURE_TYPE_CREATE_INSTANCE_INFO"""
+
+ structure_type_parts = []
+ # Tokenize into "words"
+ for elem in MAIN_RE.findall(structname):
+ word = elem[0]
+ if word == 'Vk':
+ structure_type_parts.append('VK_STRUCTURE_TYPE')
+ else:
+ structure_type_parts.append(word.upper())
+ name = '_'.join(structure_type_parts)
+
+ # The simple-minded rules need modification for some structure names
+ subpats = [
+ [ r'_H_(26[45])_', r'_H\1_' ],
+ [ r'_VULKAN_([0-9])([0-9])_', r'_VULKAN_\1_\2_' ],
+ [ r'_VULKAN_SC_([0-9])([0-9])_',r'_VULKAN_SC_\1_\2_' ],
+ [ r'_DIRECT_FB_', r'_DIRECTFB_' ],
+ [ r'_VULKAN_SC_10', r'_VULKAN_SC_1_0' ],
+
+ ]
+
+ for subpat in subpats:
+ name = re.sub(subpat[0], subpat[1], name)
+ return name
+
+ @property
+ def warning_comment(self):
+ """Return warning comment to be placed in header of generated Asciidoctor files"""
+ return '// WARNING: DO NOT MODIFY! This file is automatically generated from the vk.xml registry'
+
+ @property
+ def file_suffix(self):
+ """Return suffix of generated Asciidoctor files"""
+ return '.adoc'
+
+ def api_name(self, spectype='api'):
+ """Return API or specification name for citations in ref pages.ref
+ pages should link to for
+
+ spectype is the spec this refpage is for: 'api' is the Vulkan API
+ Specification. Defaults to 'api'. If an unrecognized spectype is
+ given, returns None.
+ """
+ if spectype == 'api' or spectype is None:
+ return 'Vulkan'
+ else:
+ return None
+
+ @property
+ def api_prefix(self):
+ """Return API token prefix"""
+ return 'VK_'
+
+ @property
+ def write_contacts(self):
+ """Return whether contact list should be written to extension appendices"""
+ return True
+
+ @property
+ def write_refpage_include(self):
+ """Return whether refpage include should be written to extension appendices"""
+ return True
+
+ @property
+ def member_used_for_unique_vuid(self):
+ """Return the member name used in the VUID-...-...-unique ID."""
+ return self.structtype_member_name
+
+ def is_externsync_command(self, protoname):
+ """Returns True if the protoname element is an API command requiring
+ external synchronization
+ """
+ return protoname is not None and 'vkCmd' in protoname
+
+ def is_api_name(self, name):
+ """Returns True if name is in the reserved API namespace.
+ For Vulkan, these are names with a case-insensitive 'vk' prefix, or
+ a 'PFN_vk' function pointer type prefix.
+ """
+ return name[0:2].lower() == 'vk' or name[0:6] == 'PFN_vk'
+
+ def specURL(self, spectype='api'):
+ """Return public registry URL which ref pages should link to for the
+ current all-extensions HTML specification, so xrefs in the
+ asciidoc source that are not to ref pages can link into it
+ instead. N.b. this may need to change on a per-refpage basis if
+ there are multiple documents involved.
+ """
+ return 'https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html'
+
+ @property
+ def xml_api_name(self):
+ """Return the name used in the default API XML registry for the default API"""
+ return 'vulkan'
+
+ @property
+ def registry_path(self):
+ """Return relpath to the default API XML registry in this project."""
+ return 'xml/vk.xml'
+
+ @property
+ def specification_path(self):
+ """Return relpath to the Asciidoctor specification sources in this project."""
+ return '{generated}/meta'
+
+ @property
+ def special_use_section_anchor(self):
+ """Return asciidoctor anchor name in the API Specification of the
+ section describing extension special uses in detail."""
+ return 'extendingvulkan-compatibility-specialuse'
+
+ @property
+ def extension_index_prefixes(self):
+ """Return a list of extension prefixes used to group extension refpages."""
+ return ['VK_KHR', 'VK_EXT', 'VK']
+
+ @property
+ def unified_flag_refpages(self):
+ """Return True if Flags/FlagBits refpages are unified, False if
+ they are separate.
+ """
+ return False
+
+ @property
+ def spec_reflow_path(self):
+ """Return the path to the spec source folder to reflow"""
+ return os.getcwd()
+
+ @property
+ def spec_no_reflow_dirs(self):
+ """Return a set of directories not to automatically descend into
+ when reflowing spec text
+ """
+ return ('scripts', 'style')
+
+ @property
+ def zero(self):
+ return '`0`'
+
+ def category_requires_validation(self, category):
+ """Return True if the given type 'category' always requires validation.
+
+ Overridden because Vulkan does not require "valid" text for basetype
+ in the spec right now."""
+ return category in CATEGORIES_REQUIRING_VALIDATION
+
+ @property
+ def should_skip_checking_codes(self):
+ """Return True if more than the basic validation of return codes should
+ be skipped for a command.
+
+ Vulkan mostly relies on the validation layers rather than API
+ builtin error checking, so these checks are not appropriate.
+
+ For example, passing in a VkFormat parameter will not potentially
+ generate a VK_ERROR_FORMAT_NOT_SUPPORTED code."""
+
+ return True
+
+ def extension_file_path(self, name):
+ """Return file path to an extension appendix relative to a directory
+ containing all such appendices.
+ - name - extension name"""
+
+ return f'{name}{self.file_suffix}'
+
+ def valid_flag_bit(self, bitpos):
+ """Return True if bitpos is an allowed numeric bit position for
+ an API flag bit.
+
+ Vulkan uses 32 bit Vk*Flags types, and assumes C compilers may
+ cause Vk*FlagBits values with bit 31 set to result in a 64 bit
+ enumerated type, so disallows such flags."""
+ return bitpos >= 0 and bitpos < 31
+
+ @property
+ def extra_refpage_headers(self):
+ """Return any extra text to add to refpage headers."""
+ return 'include::{config}/attribs.adoc[]'
+
+ @property
+ def extra_refpage_body(self):
+ """Return any extra text (following the title) for generated
+ reference pages."""
+ return 'include::{generated}/specattribs.adoc[]'
+
+
+class VulkanSCConventions(VulkanConventions):
+
+ def specURL(self, spectype='api'):
+ """Return public registry URL which ref pages should link to for the
+ current all-extensions HTML specification, so xrefs in the
+ asciidoc source that are not to ref pages can link into it
+ instead. N.b. this may need to change on a per-refpage basis if
+ there are multiple documents involved.
+ """
+ return 'https://registry.khronos.org/vulkansc/specs/1.0-extensions/html/vkspec.html'
+
+ @property
+ def xml_api_name(self):
+ """Return the name used in the default API XML registry for the default API"""
+ return 'vulkansc'
+
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/xml_consistency.py b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/xml_consistency.py
new file mode 100755
index 00000000000..0de982d5973
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/scripts/xml_consistency.py
@@ -0,0 +1,810 @@
+#!/usr/bin/python3
+#
+# Copyright (c) 2019 Collabora, Ltd.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
+#
+# Purpose: This script checks some "business logic" in the XML registry.
+
+import argparse
+import re
+import sys
+from pathlib import Path
+from collections import defaultdict, deque, namedtuple
+
+from check_spec_links import VulkanEntityDatabase as OrigEntityDatabase
+from reg import Registry
+from spec_tools.consistency_tools import XMLChecker
+from spec_tools.util import findNamedElem, getElemName, getElemType
+from apiconventions import APIConventions
+from parse_dependency import dependencyNames
+
+# These are extensions which do not follow the usual naming conventions,
+# specifying the alternate convention they follow
+EXTENSION_ENUM_NAME_SPELLING_CHANGE = {
+ 'VK_EXT_swapchain_colorspace': 'VK_EXT_SWAPCHAIN_COLOR_SPACE',
+}
+
+# These are extensions whose names *look* like they end in version numbers,
+# but do not
+EXTENSION_NAME_VERSION_EXCEPTIONS = (
+ 'VK_AMD_gpu_shader_int16',
+ 'VK_EXT_index_type_uint8',
+ 'VK_EXT_shader_image_atomic_int64',
+ 'VK_KHR_video_decode_h264',
+ 'VK_KHR_video_decode_h265',
+ 'VK_EXT_video_encode_h264',
+ 'VK_EXT_video_encode_h265',
+ 'VK_KHR_external_fence_win32',
+ 'VK_KHR_external_memory_win32',
+ 'VK_KHR_external_semaphore_win32',
+ 'VK_KHR_shader_atomic_int64',
+ 'VK_KHR_shader_float16_int8',
+ 'VK_KHR_spirv_1_4',
+ 'VK_NV_external_memory_win32',
+ 'VK_RESERVED_do_not_use_146',
+ 'VK_RESERVED_do_not_use_94',
+)
+
+# These are APIs which can be required by an extension despite not having
+# suffixes matching the vendor ID of that extension.
+# Most are external types.
+# We could make this an (extension name, api name) set to be more specific.
+EXTENSION_API_NAME_EXCEPTIONS = {
+ 'AHardwareBuffer',
+ 'ANativeWindow',
+ 'CAMetalLayer',
+ 'IOSurfaceRef',
+ 'MTLBuffer_id',
+ 'MTLCommandQueue_id',
+ 'MTLDevice_id',
+ 'MTLSharedEvent_id',
+ 'MTLTexture_id',
+ 'VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE',
+ 'VkFlags64',
+ 'VkPipelineCacheCreateFlagBits',
+ 'VkPipelineColorBlendStateCreateFlagBits',
+ 'VkPipelineDepthStencilStateCreateFlagBits',
+ 'VkPipelineLayoutCreateFlagBits',
+}
+
+# These are APIs which contain _RESERVED_ intentionally
+EXTENSION_NAME_RESERVED_EXCEPTIONS = {
+ 'VK_STRUCTURE_TYPE_PRIVATE_VENDOR_INFO_RESERVED_OFFSET_0_NV'
+}
+
+# Exceptions to pointer parameter naming rules
+# Keyed by (entity name, type, name).
+CHECK_PARAM_POINTER_NAME_EXCEPTIONS = {
+ ('vkGetDrmDisplayEXT', 'VkDisplayKHR', 'display') : None,
+}
+
+# Exceptions to pNext member requiring an optional attribute
+CHECK_MEMBER_PNEXT_OPTIONAL_EXCEPTIONS = (
+ 'VkVideoEncodeInfoKHR',
+ 'VkVideoEncodeRateControlLayerInfoKHR',
+)
+
+# Exceptions to VK_INCOMPLETE being required for, and only applicable to, array
+# enumeration functions
+CHECK_ARRAY_ENUMERATION_RETURN_CODE_EXCEPTIONS = (
+ 'vkGetDeviceFaultInfoEXT',
+ 'vkEnumerateDeviceLayerProperties',
+)
+
+# Exceptions to unknown structure type constants.
+# This is most likely an error in this script, not the XML.
+# It does not understand Vulkan SC (alternate 'api') types.
+CHECK_TYPE_STYPE_EXCEPTIONS = (
+ 'VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_RESERVATION_INFO_KHR',
+ 'VK_STRUCTURE_TYPE_PIPELINE_POOL_SIZE',
+ 'VK_STRUCTURE_TYPE_FAULT_DATA',
+ 'VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_SC_1_0_FEATURES',
+ 'VK_STRUCTURE_TYPE_DEVICE_OBJECT_RESERVATION_CREATE_INFO',
+ 'VK_STRUCTURE_TYPE_PIPELINE_OFFLINE_CREATE_INFO',
+ 'VK_STRUCTURE_TYPE_FAULT_CALLBACK_INFO',
+ 'VK_STRUCTURE_TYPE_COMMAND_POOL_MEMORY_RESERVATION_CREATE_INFO',
+ 'VK_STRUCTURE_TYPE_DEVICE_SEMAPHORE_SCI_SYNC_POOL_RESERVATION_CREATE_INFO_NV',
+ 'VK_STRUCTURE_TYPE_COMMAND_POOL_MEMORY_CONSUMPTION',
+ 'VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_SC_1_0_PROPERTIES',
+)
+
+def get_extension_commands(reg):
+ extension_cmds = set()
+ for ext in reg.extensions:
+ for cmd in ext.findall('./require/command[@name]'):
+ extension_cmds.add(cmd.get('name'))
+ return extension_cmds
+
+
+def get_enum_value_names(reg, enum_type):
+ names = set()
+ result_elem = reg.groupdict[enum_type].elem
+ for val in result_elem.findall('./enum[@name]'):
+ names.add(val.get('name'))
+ return names
+
+
+# Regular expression matching an extension name ending in a (possible) version number
+EXTNAME_RE = re.compile(r'(?P<base>(\w+[A-Za-z]))(?P<version>\d+)')
+
+DESTROY_PREFIX = 'vkDestroy'
+TYPEENUM = 'VkStructureType'
+
+SPECIFICATION_DIR = Path(__file__).parent.parent
+REVISION_RE = re.compile(r' *[*] Revision (?P<num>[1-9][0-9]*),.*')
+
+
+def get_extension_source(extname):
+ fn = f'{extname}.adoc'
+ return str(SPECIFICATION_DIR / 'appendices' / fn)
+
+
+class EntityDatabase(OrigEntityDatabase):
+
+ def __init__(self, args):
+ """Retain command-line arguments for later use in makeRegistry"""
+ self.args = args
+
+ super().__init__()
+
+ # Override base class method to not exclude 'disabled' extensions
+ def getExclusionSet(self):
+ """Return a set of "support=" attribute strings that should not be included in the database.
+
+ Called only during construction."""
+
+ return set(())
+
+ def makeRegistry(self):
+ try:
+ import lxml.etree as etree
+ HAS_LXML = True
+ except ImportError:
+ HAS_LXML = False
+ if not HAS_LXML:
+ return super().makeRegistry()
+
+ if len(self.args.files) > 0:
+ registryFile = self.args.files[0]
+ else:
+ registryFile = str(SPECIFICATION_DIR / 'xml/vk.xml')
+
+ registry = Registry()
+ registry.filename = registryFile
+ registry.loadElementTree(etree.parse(registryFile))
+ return registry
+
+
+class Checker(XMLChecker):
+ def __init__(self, args):
+ manual_types_to_codes = {
+ # These are hard-coded "manual" return codes:
+ # the codes of the value (string, list, or tuple)
+ # are available for a command if-and-only-if
+ # the key type is passed as an input.
+ 'VkFormat': 'VK_ERROR_FORMAT_NOT_SUPPORTED'
+ }
+ forward_only = {
+ # Like the above, but these are only valid in the
+ # "type implies return code" direction
+ }
+ reverse_only = {
+ # like the above, but these are only valid in the
+ # "return code implies type or its descendant" direction
+ # "XrDuration": "XR_TIMEOUT_EXPIRED"
+ }
+ # Some return codes are related in that only one of a set
+ # may be returned by a command
+ # (eg. XR_ERROR_SESSION_RUNNING and XR_ERROR_SESSION_NOT_RUNNING)
+ self.exclusive_return_code_sets = tuple(
+ # set(("XR_ERROR_SESSION_NOT_RUNNING", "XR_ERROR_SESSION_RUNNING")),
+ )
+
+ # This is used to report collisions.
+ conventions = APIConventions()
+ db = EntityDatabase(args)
+
+ self.extension_cmds = get_extension_commands(db.registry)
+ self.return_codes = get_enum_value_names(db.registry, 'VkResult')
+ self.structure_types = get_enum_value_names(db.registry, TYPEENUM)
+
+ # Dict of entity name to a list of messages to suppress. (Exclude any context data and "Warning:"/"Error:")
+ # Keys are entity names, values are tuples or lists of message text to suppress.
+ suppressions = {}
+
+ # Structures explicitly allowed to have 'limittype' attributes
+ self.allowedStructs = set((
+ 'VkFormatProperties',
+ 'VkFormatProperties2',
+ 'VkPhysicalDeviceProperties',
+ 'VkPhysicalDeviceProperties2',
+ 'VkPhysicalDeviceLimits',
+ 'VkQueueFamilyProperties',
+ 'VkQueueFamilyProperties2',
+ 'VkSparseImageFormatProperties',
+ 'VkSparseImageFormatProperties2',
+ ))
+
+ # Substructures of allowed structures. This can be found by looking
+ # at tags, but there are so few cases that it is hardwired for now.
+ self.nestedStructs = set((
+ 'VkPhysicalDeviceLimits',
+ 'VkPhysicalDeviceSparseProperties',
+ 'VkPhysicalDeviceProperties',
+ 'VkQueueFamilyProperties',
+ 'VkSparseImageFormatProperties',
+ ))
+
+ # Structures all of whose (non pNext/sType) members are required to
+ # have 'limittype' attributes, as are their descendants
+ self.requiredStructs = set((
+ 'VkPhysicalDeviceProperties',
+ 'VkPhysicalDeviceProperties2',
+ 'VkPhysicalDeviceLimits',
+ 'VkSparseImageFormatProperties',
+ 'VkSparseImageFormatProperties2',
+ ))
+
+ # Structures which have already have their limittype attributes validated
+ self.validatedLimittype = set()
+
+ # Initialize superclass
+ super().__init__(entity_db=db, conventions=conventions,
+ manual_types_to_codes=manual_types_to_codes,
+ forward_only_types_to_codes=forward_only,
+ reverse_only_types_to_codes=reverse_only,
+ suppressions=suppressions,
+ display_warnings=args.warn)
+
+ def check(self):
+ """Extends base class behavior with additional checks"""
+
+ # This test is not run on a per-structure basis, but loops over
+ # specific structures
+ self.check_type_required_limittype()
+
+ super().check()
+
+ def check_command(self, name, info):
+ """Extends base class behavior with additional checks"""
+
+ if name[0:5] == 'vkCmd':
+ if info.elem.get('tasks') is None:
+ self.record_error(f'{name} is a vkCmd* command, but is missing a "tasks" attribute')
+
+ super().check_command(name, info)
+
+ def check_command_return_codes_basic(self, name, info,
+ successcodes, errorcodes):
+ """Check a command's return codes for consistency.
+
+ Called on every command."""
+ # Check that all extension commands can return the code associated
+ # with trying to use an extension that was not enabled.
+ # if name in self.extension_cmds and UNSUPPORTED not in errorcodes:
+ # self.record_error('Missing expected return code',
+ # UNSUPPORTED,
+ # 'implied due to being an extension command')
+
+ codes = successcodes.union(errorcodes)
+
+ # Check that all return codes are recognized.
+ unrecognized = codes - self.return_codes
+ if unrecognized:
+ self.record_error('Unrecognized return code(s):',
+ unrecognized)
+
+ elem = info.elem
+ params = [(getElemName(elt), elt) for elt in elem.findall('param')]
+
+ def is_count_output(name, elt):
+ # Must end with Count or Size,
+ # not be const,
+ # and be a pointer (detected by naming convention)
+ return (name.endswith('Count') or name.endswith('Size')) \
+ and (elt.tail is None or 'const' not in elt.tail) \
+ and (name.startswith('p'))
+
+ countParams = [elt
+ for name, elt in params
+ if is_count_output(name, elt)]
+ if countParams:
+ assert(len(countParams) == 1)
+ if 'VK_INCOMPLETE' not in successcodes:
+ message = "Apparent enumeration of an array without VK_INCOMPLETE in successcodes for command {}.".format(name)
+ if name in CHECK_ARRAY_ENUMERATION_RETURN_CODE_EXCEPTIONS:
+ self.record_warning('(Allowed exception)', message)
+ else:
+ self.record_error(message)
+
+ elif 'VK_INCOMPLETE' in successcodes:
+ message = "VK_INCOMPLETE in successcodes of command {} that is apparently not an array enumeration.".format(name)
+ if name in CHECK_ARRAY_ENUMERATION_RETURN_CODE_EXCEPTIONS:
+ self.record_warning('(Allowed exception)', message)
+ else:
+ self.record_error(message)
+
+ def check_param(self, param):
+ """Check a member of a struct or a param of a function.
+
+ Called from check_params."""
+ super().check_param(param)
+
+ if not self.is_api_type(param):
+ return
+
+ param_text = ''.join(param.itertext())
+ param_name = getElemName(param)
+
+ # Make sure the number of leading 'p' matches the pointer count.
+ pointercount = param.find('type').tail
+ if pointercount:
+ pointercount = pointercount.count('*')
+ if pointercount:
+ prefix = 'p' * pointercount
+ if not param_name.startswith(prefix):
+ param_type = param.find('type').text
+ message = "Apparently incorrect pointer-related name prefix for {} - expected it to start with '{}'".format(
+ param_text, prefix)
+ if (self.entity, param_type, param_name) in CHECK_PARAM_POINTER_NAME_EXCEPTIONS:
+ self.record_warning('(Allowed exception)', message, elem=param)
+ else:
+ self.record_error(message, elem=param)
+
+ # Make sure no members have optional="false" attributes
+ optional = param.get('optional')
+ if optional == 'false':
+ message = f'{self.entity}.{param_name} member has disallowed \'optional="false"\' attribute (remove this attribute)'
+ self.record_error(message, elem=param)
+
+ # Make sure pNext members have optional="true" attributes
+ if param_name == self.conventions.nextpointer_member_name:
+ optional = param.get('optional')
+ if optional is None or optional != 'true':
+ message = f'{self.entity}.pNext member is missing \'optional="true"\' attribute'
+ if self.entity in CHECK_MEMBER_PNEXT_OPTIONAL_EXCEPTIONS:
+ self.record_warning('(Allowed exception)', message, elem=param)
+ else:
+ self.record_error(message, elem=param)
+
+ def check_type_stype(self, name, info, type_elts):
+ """Check a struct type's sType member"""
+ if len(type_elts) > 1:
+ self.record_error(
+ 'Have more than one member of type', TYPEENUM)
+ else:
+ type_elt = type_elts[0]
+ val = type_elt.get('values')
+ if val and val not in self.structure_types:
+ message = f'{self.entity} has unknown structure type constant {val}'
+ if val in CHECK_TYPE_STYPE_EXCEPTIONS:
+ self.record_warning('(Allowed exception)', message)
+ else:
+ self.record_error(message)
+
+ def check_type_pnext(self, name, info):
+ """Check a struct type's pNext member, if present"""
+
+ next_name = self.conventions.nextpointer_member_name
+ next_member = findNamedElem(info.elem.findall('member'), next_name)
+ if next_member is not None:
+ # Ensure that the 'optional' attribute is set to 'true'
+ optional = next_member.get('optional')
+ if optional is None or optional != 'true':
+ message = f'{name}.{next_name} member is missing \'optional="true"\' attribute'
+ if name in CHECK_MEMBER_PNEXT_OPTIONAL_EXCEPTIONS:
+ self.record_warning('(Allowed exception)', message)
+ else:
+ self.record_error(message)
+
+ def __isLimittypeStruct(self, name, info, allowedStructs):
+ """Check if a type element is a structure allowed to have 'limittype' attributes
+ name - name of a structure
+ info - corresponding TypeInfo object
+ allowedStructs - set of struct names explicitly allowed"""
+
+ # Is this an explicitly allowed struct?
+ if name in allowedStructs:
+ return True
+
+ # Is this a struct extending an explicitly allowed struct?
+ extends = info.elem.get('structextends')
+ if extends is not None:
+ # See if any name in the structextends attribute is an allowed
+ # struct
+ if len(set(extends.split(',')) & allowedStructs) > 0:
+ return True
+
+ return False
+
+ def __validateStructLimittypes(self, name, info, requiredLimittype):
+ """Validate 'limittype' attributes for a single struct.
+ info - TypeInfo for a struct <type>
+ requiredLimittype - True if members *must* have a limittype"""
+
+ # Do not re-check structures
+ if name in self.validatedLimittype:
+ return {}
+ self.validatedLimittype.add(name)
+
+ limittypeDiags = namedtuple('limittypeDiags', ['missing', 'invalid'])
+ badFields = defaultdict(lambda : limittypeDiags(missing=[], invalid=[]))
+ validLimittypes = { 'min', 'max', 'pot', 'mul', 'bits', 'bitmask', 'range', 'struct', 'exact', 'noauto' }
+ for member in info.getMembers():
+ memberName = member.findtext('name')
+ if memberName in ['sType', 'pNext']:
+ continue
+ limittype = member.get('limittype')
+ if limittype is None:
+ # Do not tag this as missing if it is not required
+ if requiredLimittype:
+ badFields[info.elem.get('name')].missing.append(memberName)
+ elif limittype == 'struct':
+ typeName = member.findtext('type')
+ memberType = self.reg.typedict[typeName]
+ badFields.update(self.__validateStructLimittypes(typeName, memberType, requiredLimittype))
+ else:
+ for value in limittype.split(','):
+ if value not in validLimittypes:
+ badFields[info.elem.get('name')].invalid.append(memberName)
+
+ return badFields
+
+ def check_type_disallowed_limittype(self, name, info):
+ """Check if a struct type's members cannot have the 'limittype' attribute"""
+
+ # If not allowed to have limittypes, verify this for each member
+ if not self.__isLimittypeStruct(name, info, self.allowedStructs.union(self.nestedStructs)):
+ for member in info.getMembers():
+ if member.get('limittype') is not None:
+ memname = member.findtext('name')
+ self.record_error(f'{name} member {memname} has disallowed limittype attribute')
+
+ def check_type_optional_value(self, name, info):
+ """Check if a struct type's members have disallowed 'optional' attribute values"""
+
+ for member in info.getMembers():
+ # Make sure no members have optional="false" attributes
+ optional = member.get('optional')
+ if optional == 'false':
+ memname = member.findtext('name')
+ message = f'{name} member {memname} has disallowed \'optional="false"\' attribute (remove this attribute)'
+ self.record_error(message, elem=member)
+
+ def check_type_required_limittype(self):
+ """Check struct type members which must have the 'limittype' attribute
+
+ Called from check."""
+
+ for name in self.allowedStructs:
+ # Assume that only extending structs of structs explicitly
+ # requiring limittypes also require them
+ requiredLimittype = (name in self.requiredStructs)
+
+ info = self.reg.typedict[name]
+
+ self.set_error_context(entity=name, elem=info.elem)
+
+ badFields = self.__validateStructLimittypes(name, info, requiredLimittype)
+ for extendingStructName in self.reg.validextensionstructs[name]:
+ extendingStruct = self.reg.typedict[extendingStructName]
+ badFields.update(self.__validateStructLimittypes(extendingStructName, extendingStruct, requiredLimittype))
+
+ if badFields:
+ for key in sorted(badFields.keys()):
+ diags = badFields[key]
+ if diags.missing:
+ self.record_error(f'{name} missing limittype for members {", ".join(badFields[key].missing)}')
+ if diags.invalid:
+ self.record_error(f'{name} has invalid limittype for members {", ".join(badFields[key].invalid)}')
+
+ def check_type(self, name, info, category):
+ """Check a type's XML data for consistency.
+
+ Called from check."""
+
+ if category == 'struct':
+ type_elts = [elt
+ for elt in info.elem.findall('member')
+ if getElemType(elt) == TYPEENUM]
+
+ if type_elts:
+ self.check_type_stype(name, info, type_elts)
+ self.check_type_pnext(name, info)
+
+ # Check for disallowed limittypes on all structures
+ self.check_type_disallowed_limittype(name, info)
+
+ # Check for disallowed 'optional' values
+ self.check_type_optional_value(name, info)
+ elif category == 'bitmask':
+ if 'Flags' in name:
+ expected_require = name.replace('Flags', 'FlagBits')
+ require = info.elem.get('require')
+ if require is not None and expected_require != require:
+ self.record_error('Unexpected require attribute value:',
+ 'got', require,
+ 'but expected', expected_require)
+ super().check_type(name, info, category)
+
+ def check_suffixes(self, name, info, supported, name_exceptions):
+ """Check suffixes of new APIs required by an extension, which should
+ match the author ID of the extension.
+
+ Called from check_extension.
+
+ name - extension name
+ info - extdict entry for name
+ supported - True if extension supported by API being checked
+ name_exceptions - set of API names to not check, in addition to
+ the global exception list."""
+
+ def has_suffix(apiname, author):
+ return apiname[-len(author):] == author
+
+ def has_any_suffixes(apiname, authors):
+ for author in authors:
+ if has_suffix(apiname, author):
+ return True
+ return False
+
+ def check_names(elems, author, alt_authors, name_exceptions):
+ """Check names in a list of elements for consistency
+
+ elems - list of elements to check
+ author - author ID of the <extension> tag
+ alt_authors - set of other allowed author IDs
+ name_exceptions - additional set of allowed exceptions"""
+
+ for elem in elems:
+ apiname = elem.get('name', 'NO NAME ATTRIBUTE')
+ suffix = apiname[-len(author):]
+
+ if (not has_suffix(apiname, author) and
+ apiname not in EXTENSION_API_NAME_EXCEPTIONS and
+ apiname not in name_exceptions):
+
+ msg = f'Extension {name} <{elem.tag}> {apiname} does not have expected suffix {author}'
+
+ # Explicit 'aliased' deprecations not matching the
+ # naming rules are allowed, but warned.
+ if has_any_suffixes(apiname, alt_authors):
+ self.record_warning('Allowed alternate author ID:', msg)
+ elif not supported:
+ self.record_warning('Allowed inconsistency for disabled extension:', msg)
+ elif elem.get('deprecated') == 'aliased':
+ self.record_warning('Allowed aliasing deprecation:', msg)
+ else:
+ msg += '\n\
+This may be due to an extension interaction not having the correct <require depends="">\n\
+Other exceptions can be added to xml_consistency.py:EXTENSION_API_NAME_EXCEPTIONS'
+ self.record_error(msg)
+
+ elem = info.elem
+
+ self.set_error_context(entity=name, elem=elem)
+
+ # Extract author ID from the extension name.
+ author = name.split('_')[1]
+
+ # Loop over each <require> tag checking the API name suffixes in
+ # that tag for consistency.
+ # Names in tags whose 'depends' attribute includes extensions with
+ # different author IDs may be suffixed with those IDs.
+ for req_elem in elem.findall('./require'):
+ depends = req_elem.get('depends', '')
+ alt_authors = set()
+ if len(depends) > 0:
+ for name in dependencyNames(depends):
+ # Skip core versions
+ if name[0:11] != 'VK_VERSION_':
+ # Extract author ID from extension name
+ id = name.split('_')[1]
+ alt_authors.add(id)
+
+ check_names(req_elem.findall('./command'), author, alt_authors, name_exceptions)
+ check_names(req_elem.findall('./type'), author, alt_authors, name_exceptions)
+ check_names(req_elem.findall('./enum'), author, alt_authors, name_exceptions)
+
+ def check_extension(self, name, info, supported):
+ """Check an extension's XML data for consistency.
+
+ Called from check."""
+
+ elem = info.elem
+ enums = elem.findall('./require/enum[@name]')
+
+ # If extension name is not on the exception list and matches the
+ # versioned-extension pattern, map the extension name to the version
+ # name with the version as a separate word. Otherwise just map it to
+ # the upper-case version of the extension name.
+
+ matches = EXTNAME_RE.fullmatch(name)
+ ext_versioned_name = False
+ if name in EXTENSION_ENUM_NAME_SPELLING_CHANGE:
+ ext_enum_name = EXTENSION_ENUM_NAME_SPELLING_CHANGE.get(name)
+ elif matches is None or name in EXTENSION_NAME_VERSION_EXCEPTIONS:
+ # This is the usual case, either a name that does not look
+ # versioned, or one that does but is on the exception list.
+ ext_enum_name = name.upper()
+ else:
+ # This is a versioned extension name.
+ # Treat the version number as a separate word.
+ base = matches.group('base')
+ version = matches.group('version')
+ ext_enum_name = base.upper() + '_' + version
+ # Keep track of this case
+ ext_versioned_name = True
+
+ # Look for the expected SPEC_VERSION token name
+ version_name = f'{ext_enum_name}_SPEC_VERSION'
+ version_elem = findNamedElem(enums, version_name)
+
+ if version_elem is None:
+ # Did not find a SPEC_VERSION enum matching the extension name
+ if ext_versioned_name:
+ suffix = '\n\
+ Make sure that trailing version numbers in extension names are treated\n\
+ as separate words in extension enumerant names. If this is an extension\n\
+ whose name ends in a number which is not a version, such as "...h264"\n\
+ or "...int16", add it to EXTENSION_NAME_VERSION_EXCEPTIONS in\n\
+ scripts/xml_consistency.py.'
+ else:
+ suffix = ''
+ self.record_error(f'Missing version enum {version_name}{suffix}')
+ elif supported:
+ # Skip unsupported / disabled extensions for these checks
+
+ fn = get_extension_source(name)
+ revisions = []
+ with open(fn, 'r', encoding='utf-8') as fp:
+ for line in fp:
+ line = line.rstrip()
+ match = REVISION_RE.match(line)
+ if match:
+ revisions.append(int(match.group('num')))
+ ver_from_xml = version_elem.get('value')
+ if revisions:
+ ver_from_text = str(max(revisions))
+ if ver_from_xml != ver_from_text:
+ self.record_error('Version enum mismatch: spec text indicates', ver_from_text,
+ 'but XML says', ver_from_xml)
+ else:
+ if ver_from_xml == '1':
+ self.record_warning(
+ "Cannot find version history in spec text - make sure it has lines starting exactly like ' * Revision 1, ....'",
+ filename=fn)
+ else:
+ self.record_warning("Cannot find version history in spec text, but XML reports a non-1 version number", ver_from_xml,
+ " - make sure the spec text has lines starting exactly like ' * Revision 1, ....'",
+ filename=fn)
+
+ for enum in enums:
+ enum_name = enum.get('name')
+ if '_RESERVED_' in enum_name and enum_name not in EXTENSION_NAME_RESERVED_EXCEPTIONS:
+ self.record_error(enum_name, 'should not contain _RESERVED_ for a supported extension.\n\
+If this is intentional, add it to EXTENSION_NAME_RESERVED_EXCEPTIONS in scripts/xml_consistency.py.')
+
+ name_define = f'{ext_enum_name}_EXTENSION_NAME'
+ name_elem = findNamedElem(enums, name_define)
+ if name_elem is None:
+ self.record_error('Missing name enum', name_define)
+ else:
+ # Note: etree handles the XML entities here and turns &quot; back into "
+ expected_name = f'"{name}"'
+ name_val = name_elem.get('value')
+ if name_val != expected_name:
+ self.record_error('Incorrect name enum: expected', expected_name,
+ 'got', name_val)
+
+ self.check_suffixes(name, info, supported, { version_name, name_define })
+
+ # More general checks
+ super().check_extension(name, info, supported)
+
+ def check_format(self):
+ """Check an extension's XML data for consistency.
+
+ Called from check."""
+
+ astc3d_formats = [
+ 'VK_FORMAT_ASTC_3x3x3_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_3x3x3_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_3x3x3_SFLOAT_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_4x3x3_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_4x3x3_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_4x3x3_SFLOAT_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_4x4x3_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_4x4x3_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_4x4x3_SFLOAT_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_4x4x4_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_4x4x4_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_4x4x4_SFLOAT_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_5x4x4_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_5x4x4_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_5x4x4_SFLOAT_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_5x5x4_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_5x5x4_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_5x5x4_SFLOAT_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_5x5x5_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_5x5x5_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_5x5x5_SFLOAT_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_6x5x5_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_6x5x5_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_6x5x5_SFLOAT_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_6x6x5_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_6x6x5_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_6x6x5_SFLOAT_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_6x6x6_UNORM_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_6x6x6_SRGB_BLOCK_EXT',
+ 'VK_FORMAT_ASTC_6x6x6_SFLOAT_BLOCK_EXT'
+ ]
+
+ # Need to build list of formats from rest of <enums>
+ enum_formats = []
+ for enum in self.reg.groupdict['VkFormat'].elem:
+ if enum.get('alias') is None and enum.get('name') != 'VK_FORMAT_UNDEFINED':
+ enum_formats.append(enum.get('name'))
+
+ found_formats = []
+ for name, info in self.reg.formatsdict.items():
+ found_formats.append(name)
+ self.set_error_context(entity=name, elem=info.elem)
+
+ if name not in enum_formats:
+ self.record_error('The <format> has no matching <enum> for', name)
+
+ # Check never just 1 plane
+ plane_elems = info.elem.findall('plane')
+ if len(plane_elems) == 1:
+ self.record_error('The <format> has only 1 <plane> for', name)
+
+ valid_chroma = ['420', '422', '444']
+ if info.elem.get('chroma') and info.elem.get('chroma') not in valid_chroma:
+ self.record_error('The <format> has chroma is not a valid value for', name)
+
+ # The formatsgenerator.py assumes only 1 <spirvimageformat> tag.
+ # If this changes in the future, remove this warning and update generator script
+ spirv_image_format = info.elem.findall('spirvimageformat')
+ if len(spirv_image_format) > 1:
+ self.record_error('More than 1 <spirvimageformat> but formatsgenerator.py is not updated, for format', name)
+
+ # Re-loop to check the other way if the <format> is missing
+ for enum in self.reg.groupdict['VkFormat'].elem:
+ name = enum.get('name')
+ if enum.get('alias') is None and name != 'VK_FORMAT_UNDEFINED':
+ if name not in found_formats and name not in astc3d_formats:
+ self.set_error_context(entity=name, elem=enum)
+ self.record_error('The <enum> has no matching <format> for ', name)
+
+ super().check_format()
+
+ # This should be called from check() but as a first pass, do it here
+ # Check for invalid version names in e.g.
+ # <enable version="VK_VERSION_1_2"/>
+ # Could also consistency check struct / extension tags here
+ for capname in self.reg.spirvcapdict:
+ for elem in self.reg.spirvcapdict[capname].elem.findall('enable'):
+ version = elem.get('version')
+ if version is not None and version not in self.reg.apidict:
+ self.set_error_context(entity=capname, elem=elem)
+ self.record_error(f'<spirvcapability> {capname} enabled by a nonexistent version {version}')
+
+if __name__ == '__main__':
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-warn', action='store_true',
+ help='Enable display of warning messages')
+ parser.add_argument('files', metavar='filename', nargs='*',
+ help='XML filename to check')
+
+ args = parser.parse_args()
+
+ ckr = Checker(args)
+ ckr.check()
+
+ if ckr.fail:
+ sys.exit(1)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/Makefile b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/Makefile
new file mode 100644
index 00000000000..7a0362ef8f6
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/Makefile
@@ -0,0 +1,246 @@
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# If a recipe fails, delete its target file. Without this cleanup, the leftover
+# file from the failed recipe can falsely satisfy dependencies on subsequent
+# runs of `make`.
+.DELETE_ON_ERROR:
+
+QUIET ?= @
+MKDIR = mkdir -p
+CP = cp
+RM = rm -f
+RMRF = rm -rf
+
+# Generator scripts and options
+# GENOPTS can be e.g. '-noprotect'
+
+PYTHON ?= python3
+SCRIPTS = ../scripts
+XML_CONSISTENCY = $(SCRIPTS)/xml_consistency.py
+GENOPTS =
+
+# Generate Vulkan headers from XML. Many other files can be generated
+# from vk.xml using the scripts, but they are all generated from
+# ../Makefile as part of the process of building the Specification.
+#
+# Targets:
+#
+# default / install - regenerate headers in ../include/vulkan/.
+# validate - run XML validator on vk.xml against the schema.
+# test - check if vulkan_core.h compiles.
+# clean_dirt - remove intermediate files.
+# clean - remove installed and intermediate files.
+
+GENERATED = ../gen
+INCLUDE = $(GENERATED)/include
+TESTS = ../tests
+VULKAN = $(INCLUDE)/vulkan
+JSON = $(GENERATED)/out/json
+SRC = ../src
+
+VULKAN_API ?= vulkan
+ifeq ($(VULKAN_API),vulkan)
+API_SUFFIX :=
+MISRACOPTS ?=
+MISRACPPOPTS ?=
+else
+API_SUFFIX := _sc
+# default options for generating MISRA C or MISRA C++ headers
+# can be overridden from commandline
+MISRACOPTS ?= -misracstyle
+MISRACPPOPTS ?= -misracppstyle
+endif
+
+# Static files needed for a complete set of headers, cached in the
+# repository
+STATIC_HEADERS = $(VULKAN)/vulkan$(API_SUFFIX).h $(VULKAN)/vk_platform.h
+
+# Where static headers are stored
+STATIC = ../include/vulkan
+STATIC_JSON_SRC = ../json
+
+# Vulkan platform-specific headers
+PLATFORM_HEADERS = \
+ $(VULKAN)/vulkan_android.h \
+ $(VULKAN)/vulkan_fuchsia.h \
+ $(VULKAN)/vulkan_ggp.h \
+ $(VULKAN)/vulkan_ios.h \
+ $(VULKAN)/vulkan_macos.h \
+ $(VULKAN)/vulkan_vi.h \
+ $(VULKAN)/vulkan_wayland.h \
+ $(VULKAN)/vulkan_win32.h \
+ $(VULKAN)/vulkan_xcb.h \
+ $(VULKAN)/vulkan_xlib.h \
+ $(VULKAN)/vulkan_directfb.h \
+ $(VULKAN)/vulkan_xlib_xrandr.h \
+ $(VULKAN)/vulkan_metal.h \
+ $(VULKAN)/vulkan_screen.h \
+ $(VULKAN)/vulkan_beta.h
+
+#@ vulkan_sci.h is Vulkan SC-specific
+ifeq ($(VULKAN_API),vulkansc)
+PLATFORM_HEADERS := $(PLATFORM_HEADERS) $(VULKAN)/vulkan_sci.h
+endif
+
+HEADERS_H = $(VULKAN)/vulkan$(API_SUFFIX)_core.h $(PLATFORM_HEADERS)
+ifeq ($(VULKAN_API),vulkansc)
+HEADERS_HPP = $(VULKAN)/vulkan$(API_SUFFIX)_core.hpp
+STATIC_JSON = $(STATIC_JSON_SRC)/vkpcc.json
+JSON_PCC = $(JSON)/vkpcc.json
+STATIC_CTS_COPY = \
+ $(JSON)/cts/vkjson_data_default.h \
+ $(JSON)/cts/vkjson_parser_default.h
+JSON_SCHEMA = $(JSON)/vk.json
+JSON_GENERATOR = $(JSON)/vulkan_json_data.hpp \
+ $(JSON)/vulkan_json_gen.h \
+ $(JSON)/vulkan_json_gen.c
+JSON_PARSER = $(JSON)/vulkan_json_parser.hpp
+JSON_CTS = $(JSON)/cts/vulkan_json_data.hpp $(JSON)/cts/vulkan_json_parser.hpp
+JSON_SCRIPTS = $(SCRIPTS)/json_parser.py $(SCRIPTS)/json_generator.py
+endif
+HEADERS = $(HEADERS_H) $(HEADERS_HPP)
+JSON_FILES = $(JSON_SCHEMA) $(JSON_GENERATOR) $(JSON_PARSER)
+JSON_CTS_FILES = $(JSON_CTS)
+
+default: install
+
+install: $(HEADERS) $(STATIC_HEADERS) $(CODEC_HEADERS) $(JSON_FILES) $(JSON_PCC) $(JSON_CTS_FILES) $(STATIC_CTS_COPY)
+
+$(VULKAN)/vulkan$(API_SUFFIX).h: $(STATIC)/vulkan$(API_SUFFIX).h
+ $(QUIET)$(MKDIR) $(VULKAN)
+ $(CP) $? $@
+
+$(VULKAN)/vulkan$(API_SUFFIX).hpp: $(STATIC)/vulkan$(API_SUFFIX).h
+ $(QUIET)$(MKDIR) $(VULKAN)
+ $(CP) $? $@
+
+$(VULKAN)/vk_platform.h: $(STATIC)/vk_platform.h
+ $(QUIET)$(MKDIR) $(VULKAN)
+ $(CP) $? $@
+
+################################################
+
+# Autogenerate vulkan header from XML API description
+
+# Python and XML files on which vulkan_core.h depends
+GENSCRIPT = $(SCRIPTS)/genvk.py
+VKXML = vk.xml
+VKH_DEPENDS = $(VKXML) $(GENSCRIPT) $(SCRIPTS)/reg.py $(SCRIPTS)/generator.py
+
+$(HEADERS_H): $(VKH_DEPENDS)
+ $(MKDIR) $(VULKAN)
+ $(PYTHON) $(GENSCRIPT) $(MISRACOPTS) $(GENOPTS) -registry $(VKXML) \
+ -o $(VULKAN) $(notdir $@)
+
+$(HEADERS_HPP): $(VKH_DEPENDS)
+ $(MKDIR) $(VULKAN)
+ $(PYTHON) $(GENSCRIPT) $(MISRACPPOPTS) $(GENOPTS) -registry $(VKXML) \
+ -o $(VULKAN) $(notdir $@)
+
+platform: $(PLATFORM_HEADERS)
+
+# Autogenerate video codec headers from XML
+
+VIDEO_INCLUDE = $(INCLUDE)/vk_video
+CODECS = vulkan_video_codecs_common.h \
+ vulkan_video_codec_h264std.h \
+ vulkan_video_codec_h264std_decode.h \
+ vulkan_video_codec_h264std_encode.h \
+ vulkan_video_codec_h265std.h \
+ vulkan_video_codec_h265std_decode.h \
+ vulkan_video_codec_h265std_encode.h
+CODECXML = video.xml
+# Do not build video headers for Vulkan SC
+ifeq ($(VULKAN_API),vulkan)
+CODEC_HEADERS = $(CODECS:%=$(VIDEO_INCLUDE)/%)
+else
+CODEC_HEADERS =
+endif
+
+codec_headers: $(CODEC_HEADERS)
+
+$(VIDEO_INCLUDE)/%.h: $(CODECXML) $(GENSCRIPT) $(SCRIPTS)/reg.py $(SCRIPTS)/generator.py
+ $(QUIET)$(MKDIR) $(VIDEO_INCLUDE)
+ $(QUIET)$(PYTHON) $(GENSCRIPT) $(GENOPTS) -registry $(CODECXML) -o $(VIDEO_INCLUDE) $(notdir $@)
+
+# Verify registry XML files against the schema
+validate:
+ jing -c registry.rnc $(VKXML)
+ $(PYTHON) $(XML_CONSISTENCY) $(VKXML)
+ jing -c registry.rnc $(CODECXML)
+
+# Test that generated Vulkan headers compile
+
+# Platforms to test
+TESTDEFS = -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR
+
+TESTFILE = $(TESTS)/htest$(API_SUFFIX).c
+
+#@ -DUSE_HPP=1 is used only for Vulkan SC build
+test: $(HEADERS) $(STATIC_HEADERS) $(CODEC_HEADERS)
+ gcc -Wall -pedantic-errors -std=c99 -c -I$(INCLUDE) -I$(TESTS) $(TESTFILE)
+ gcc -Wall -pedantic-errors -std=c11 -c -I$(INCLUDE) -I$(TESTS) $(TESTFILE)
+ g++ -Wall -pedantic-errors -c -std=c++11 -I$(INCLUDE) -I$(TESTS) $(TESTFILE)
+ifeq ($(VULKAN_API),vulkansc)
+ g++ -Wall -pedantic-errors -c -std=c++98 -I$(INCLUDE) -I$(TESTS) $(TESTFILE)
+ g++ -Wall -pedantic-errors -c -std=c++11 -I$(INCLUDE) -I$(TESTS) -DUSE_HPP=1 $(TESTFILE)
+endif
+ $(RM) htest.o $(TESTS)/test.o
+
+# Test that generated video codec headers compile
+
+vtest: $(CODEC_HEADERS)
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_CODECS_COMMON
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_CODEC_H264STD
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_CODEC_H264STD_DECODE
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_CODEC_H264STD_ENCODE
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_CODEC_H264STD -D VULKAN_VIDEO_CODEC_H264STD_DECODE -D VULKAN_VIDEO_CODEC_H264STD_ENCODE
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_CODEC_H265STD
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_CODEC_H265STD_DECODE
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_CODEC_H265STD_ENCODE
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_CODEC_H265STD -D VULKAN_VIDEO_CODEC_H265STD_DECODE -D VULKAN_VIDEO_CODEC_H265STD_ENCODE
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_ALL
+ gcc -Wall -std=c99 -c -I$(INCLUDE) $(TESTS)/vtest.c -D VULKAN_VIDEO_ALL -D VK_NO_STDINT_H
+ $(RM) vtest.o
+
+################################################
+
+# Autogenerate JSON Schema and utils from the XML API description
+$(JSON_FILES): $(VKH_DEPENDS) $(JSON_SCRIPTS)
+ $(QUIET)$(MKDIR) $(JSON)
+ $(PYTHON) $(GENSCRIPT) $(GENOPTS) -registry $(VKXML) \
+ -o $(JSON) $(notdir $@)
+
+$(JSON_CTS_FILES): $(VKH_DEPENDS) $(JSON_SCRIPTS)
+ $(QUIET)$(MKDIR) $(JSON)/cts
+ $(PYTHON) $(GENSCRIPT) $(GENOPTS) -registry $(VKXML) --iscts \
+ -o $(JSON)/cts $(notdir $@)
+
+$(JSON)/cts/vkjson_data_default.h: $(STATIC_JSON_SRC)/vkjson_data_default.h
+ $(QUIET)$(MKDIR) $(JSON)/cts
+ $(CP) $? $@
+
+$(JSON)/cts/vkjson_parser_default.h: $(STATIC_JSON_SRC)/vkjson_parser_default.h
+ $(QUIET)$(MKDIR) $(JSON)/cts
+ $(CP) $? $@
+
+$(JSON_PCC): $(STATIC_JSON)
+ $(QUIET)$(MKDIR) $(JSON)
+ $(CP) $? $@
+
+################################################
+
+# Files to clean up
+PYDIRT = diag.txt dumpReg.txt errwarn.txt *.pyc regdump.txt
+DIRT = $(PYDIRT) ERRS *.o
+
+# Clean intermediate files
+clean_dirt:
+ -$(RM) $(DIRT) \#*
+
+# Clean generated targets and intermediates
+clean clobber: clean_dirt
+ -$(RMRF) $(INCLUDE) $(JSON)
+ -$(RMRF) $(INCLUDE) $(VIDEO_INCLUDE)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/README.adoc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/README.adoc
new file mode 100644
index 00000000000..5e37b9faf4e
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/README.adoc
@@ -0,0 +1,207 @@
+// Copyright 2014-2023 The Khronos Group Inc.
+//
+// SPDX-License-Identifier: CC-BY-4.0
+
+= Vulkan^(R)^ API Registry Build Instructions and Notes
+
+Jon Leech
+
+ * <<intro,Introduction>>
+ * <<build,Build Environment>>
+ * <<files,Files>>
+ * <<targets,Makefile Targets>>
+ * <<linux,Linux Software Dependencies>>
+ * <<windows,Windows Software Dependencies>>
+ * <<history,Revision History>>
+
+
+[[intro]]
+== Introduction
+
+This is the Vulkan XML API Registry. It is used to generate the canonical
+Vulkan header files, the API Asciidoc include files used by the Vulkan
+Specification and Reference Pages, and many other types of generated files.
+
+When changes to generated files are needed, follow this workflow.
+Normally changes are needed only when defining a new extension or core
+version of the API.
+
+ * Clone the repository and create a branch to work in locally
+ * Edit `vk.xml`
+ * `make validate install test`
+ ** This validates the XML files against the schema description; generates
+ headers in `../gen/include/vulkan` including `vulkan_core.h` and a set
+ of platform-dependent headers `vulkan_<platform>.h`; and runs a simple
+ compilation test of the headers.
+ * `(cd .. && make generated)`
+ ** This uses `vk.xml` to generate asciidoc includes and other intermediate
+ files in `../gen` for the specification build.
+ There are many ways to invoke the Makefile in `..`.
+ This simple recipe only generates includes for the core Vulkan API
+ without any extensions.
+ See `../BUILD.adoc` for more.
+ * Repeat until the headers and/or includes are correct
+ * Commit your changes to your local git branch, push to your upstream git
+ server (your personal repository clone of KhronosGroup/Vulkan-Docs on
+ GitHub, for people outside Khronos; the Khronos member gitlab server,
+ otherwise), and create a pull or merge request against the default
+ branch (currently `main`) or other appropriate target.
+
+For a detailed description of the schema, go to `..` and `make registry`,
+which generates `gen/out/registry.html`.
+This document also includes some examples of how to make simple changes in
+the API via the XML.
+
+The generator scripts are written in Python 3, using the `etree` package for
+processing XML.
+See `../scripts/README.adoc` for script descriptions.
+
+=== Video Headers
+
+In addition to `vk.xml` this directory also includes `video.xml`.
+This is a similarly structured XML file used to produce headers for
+structures and other types (`StdVideo*`) associated with externally defined
+video standards.
+While these data types are passed into some of the Vulkan Video extension
+APIs, they are not treated as part of the Vulkan API.
+This is why they are defined in a separate XML file.
+
+The `validate` and `install` targets described above also generate the
+`StdVideo*` headers in `../gen/include/vk_video`.
+A separate test target, `vtest`, can be used as a simple compilation test of
+the `StdVideo*` headers.
+
+
+[[build]]
+== Build Environment
+
+We strongly recommend using the Khronos-provided Docker image, which has all
+needed build tools pre-installed.
+See `../BUILD.adoc` for details.
+
+It is possible to construct your own build environment on Linux, Windows, or
+MacOS by following the recipe in the Dockerfile for the Khronos-provided
+Docker image.
+
+
+[[files]]
+== Files
+
+ * `vk.xml` - XML API description.
+ * `registry.rnc` - RelaxNG compact schema for validating XML against the
+ schema.
+ * `Makefile` - generates headers from `vk.xml` (see <<targets,Makefile
+ Targets>> below).
+ * `../gen/include/vulkan/vulkan_core.h` - Generated Vulkan non-platform
+ API header.
+ * `../gen/include/vulkan/vulkan_<platform>.h` - Generated Vulkan platform
+ API headers.
+ * `video.xml` - `StdVideo*` API description.
+ * `../gen/include/vk_video/vulkan_video*.h` - Generated `StdVideo*` API
+ headers.
+
+
+[[targets]]
+== Makefile Targets
+
+ * `install` (default target) - regenerate Vulkan and `StdVideo*` header
+ files in `../gen/include/`.
+ * `test` - make sure Vulkan headers compile.
+ *Important!* Can also be used to test if platform headers compile by
+ specifying `make TESTDEFS=-DVK_USE_PLATFORM_<PLATFORM>_<AUTHORID> test`.
+ * `vtest` - make sure `StdVideo*` headers compile.
+ * `validate` - validate `vk.xml` and `video.xml` against the schema.
+ Requires installing `jing` (see <<linux,Software Dependencies>> below).
+ Also important!
+ * `clean_dirt` - remove intermediate files.
+ * `clean` - remove generated files.
+
+Generated files can be created in a directory other than the default
+`../gen/` by setting the Makefile variable `GENERATED` to that directory
+path.
+
+If you have trouble running the Makefile on your platform, the following
+steps will build the Vulkan headers and test that `vulkan_core.h` compiles:
+
+[source,sh]
+----
+# Regenerate header from XML
+python3 ../scripts/genvk.py -registry vk.xml -o ../gen/include/vulkan vulkan_core.h
+# Verify that the resulting header compiles
+gcc -Wall -std=c99 -c -I../gen/include -I../tests ../tests/htest.c
+g++ -Wall -std=c++98 -c -I../gen/include -I../tests ../tests/htest.c
+rm -f htest.o
+----
+
+
+[[history]]
+== Revision History
+
+ * 2021-12-13 -
+ Add `video.xml` for `StdVideo*` APIs and headers.
+ * 2020-08-25 -
+ Update for new default branch (`main`).
+ * 2019/05/12 -
+ Bring up to date with changes in file paths and build tools.
+ * 2019/03/10 -
+ Update for script reorganization.
+ * 2018/05/21 -
+ Do not generate vulkan_ext.[ch] from the `install` target. Add a new
+ shortcut `extloader` target for people still using this code and needing
+ to regenerate it.
+ * 2018/03/13 -
+ Update for new directory structure.
+ * 2018/03/06 -
+ Update for Vulkan 1.1 release and new default branch.
+ * 2015/09/18 -
+ Split platform-specific headers into their own vulkan_<platform>.h
+ files, move vulkan.h to vulkan_core.h, and add a new (static) vulkan.h
+ which includes appropriate combinations of the other headers.
+ * 2015/06/01 -
+ The header that is generated has been improved relative to the first
+ version. Function arguments are indented like the hand-generated header,
+ enumerant BEGIN/END_RANGE enums are named the same, etc. The ordering of
+ declarations is unlike the hand-generated header, and probably always
+ will because it results from a type/enum/function dependency analysis.
+ Some of this can be forced by being more explicit about it, if that is a
+ big deal.
+ * 2015/06/02 -
+ Per WG signoff, converted hex constant values to decimal (for
+ non-bitmasks) and VK_BIT macros to 'bitpos' attributes in the XML and
+ hex constants in the header. Updated schema to match. Changed <ptype>
+ tag to <type>.
+ * 2015/06/03 -
+ Moved into new 'vulkan' tree (did not bother preserving history in
+ previous repo). Added semantic knowledge about structs and unions to
+ <type> tags instead of just imbedding C struct definitions. Improved
+ registry.rnc schema a bit.
+ * 2015/06/07 -
+ Incorporate feedback from F2F including Python 3 and Windows fixes to
+ the scripts. Add documentation to readme.pdf. Fold in multiple merge
+ requests resulting from action items agreed at the F2F, to prepare
+ for everyone moving to XML instead of directly editing the header.
+ * 2015/06/20 -
+ Add vulkan-docs target and instructions for installing python3 and
+ python-lxml for Windows.
+ * 2015/08/13 -
+ Bring documentation up to date with Makefile targets (default is now
+ ../include/vulkan.h).
+ * 2015/09/02 -
+ Update README with required (or known working) versions of toolchain
+ components.
+ * 2015/09/02 -
+ Move include/vulkan.h to vulkan/vulkan.h so #include "vulkan/vulkan.h"
+ is the normal usage (Bug 14576).
+ * 2016/02/12 -
+ Update README and remove old files to stage for public release.
+ * 2016/05/31 -
+ Remove dependency on lxml.
+ * 2016/07/27 -
+ Update documentation for changes to schema and generator scripts.
+ * 2016/08/26 -
+ Move README to an asciidoc file and update for the single-branch model.
+ Use 'clean' target to remove generated files in both spec source and
+ registry Makefiles.
+ * 2017/02/20 -
+ Move registry.txt (schema documentation) to the Vulkan spec source
+ directory and update the README here.
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/generate-core-block.rb b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/generate-core-block.rb
new file mode 100644
index 00000000000..159e2fe686d
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/generate-core-block.rb
@@ -0,0 +1,125 @@
+# Copyright 2018-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+require 'nokogiri'
+
+
+renames = {}
+
+extension_name = ARGV[0]
+extension_suffix = /VK_([^_]+)_.+/.match(extension_name)[1]
+
+allowed_dependency_renames = ['']
+
+file = File.open("vk.xml")
+Nokogiri::XML(file).xpath('//extension[@name="' + extension_name + '"]').each do | extension |
+ extension_enum_offset = 1000000000 + ((extension.attribute('number').content.to_i - 1) * 1000)
+ extension.xpath('require').each do |require|
+
+ do_rename = false
+
+ if require.attribute('extension')
+ allowed_dependency_renames.each do |dependency|
+ if require.attribute('extension').content == dependency
+ do_rename = true
+ end
+ end
+ else
+ do_rename = true
+ end
+
+ if do_rename == false
+ puts "Extension interaction with " + require.attribute('extension').content + " needs addressing!"
+ else
+ core_block = "\t"*2 + require.to_s.lines[0].strip + "\n"
+ alias_block = "\t"*3 + require.to_s.lines[0].strip + "\n"
+
+ require.children.each do |element|
+ if element.node_name != 'text' && element.node_name != 'comment'
+
+ # Core Block
+ if /.+_EXTENSION_NAME/.match(element.attribute('name').content) == nil &&
+ /.+_SPEC_VERSION/.match(element.attribute('name').content) == nil
+
+ case element.node_name
+ when 'enum'
+ attributes = element.attributes
+ if element.attributes['offset']
+ attributes['value'] = element.attribute('offset').content.to_i + extension_enum_offset
+ attributes.delete('offset')
+ end
+
+ core_block << "\t"*3 + '<enum'
+ attributes.each_pair do |key, value|
+ core_block << ' ' + key + '="' + value.to_s + '"'
+ end
+ core_block << '/>' + "\n"
+ when 'type', 'command'
+ core_block << "\t"*3 + element.to_s.strip + "\n"
+ else
+ core_block << "Warning: Unknown type found!\n" << element.node_name
+ end
+ end
+
+ # Alias Block + Renames
+
+ if /.+_EXTENSION_NAME/.match(element.attribute('name').content) ||
+ /.+_SPEC_VERSION/.match(element.attribute('name').content)
+ alias_block << "\t"*4 + element.to_s.strip + "\n"
+ else
+ old_name = element.attribute('name').content
+ new_name = old_name.sub('_' + extension_suffix,'').sub(extension_suffix,'')
+ alias_block << "\t"*4 + '<alias name="' + old_name + '" value="' + new_name + '"/>' + "\n"
+ renames[old_name] = new_name
+ core_block.gsub!(old_name,new_name)
+ end
+ end
+ end
+ alias_block << "\t"*3 + require.to_s.lines[-1].strip
+ core_block << "\t"*2 + require.to_s.lines[-1].strip
+
+ puts alias_block
+ puts
+ puts core_block
+ puts
+ renames.each_pair do |old, new|
+ puts old + ' -> ' + new
+ end
+ end
+ end
+end
+
+outdata = File.read('vk.xml')
+
+renames.each_pair do |old, new|
+ outdata.gsub!(old,new)
+end
+
+File.open('vk.xml', 'w') do |out|
+ out << outdata
+end
+
+def rename_text_files(dir, renames, extension_name)
+ Dir[dir + '/*.adoc'].each do |name|
+ # Skip renaming in the extension appendix, since this should preserve the old names.
+ if (name != ('../appendices/' + extension_name + '.adoc'))
+ old_file = File.read(name)
+
+ new_file = old_file.clone
+ renames.each_pair do |old, new|
+ new_file.gsub!(old,new)
+ end
+
+ if (old_file != new_file)
+ File.write(name, new_file)
+ end
+ end
+ end
+ Dir[dir + '/*/'].each do |subdir|
+ rename_text_files(subdir, renames, extension_name)
+ end
+end
+
+rename_text_files('../chapters', renames, extension_name)
+rename_text_files('../appendices', renames, extension_name)
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/profiles/VP_KHR_roadmap_2022.json b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/profiles/VP_KHR_roadmap_2022.json
new file mode 100644
index 00000000000..b528ecac1c3
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/profiles/VP_KHR_roadmap_2022.json
@@ -0,0 +1,381 @@
+{
+ "$schema": "https://schema.khronos.org/vulkan/profiles-0.8.1-204.json#",
+ "capabilities": {
+ "vulkan10requirements": {
+ "features": {
+ "VkPhysicalDeviceFeatures": {
+ "robustBufferAccess": true
+ }
+ }
+ },
+ "vulkan10requirements_roadmap2022": {
+ "features": {
+ "VkPhysicalDeviceFeatures": {
+ "fullDrawIndexUint32": true,
+ "imageCubeArray": true,
+ "independentBlend": true,
+ "sampleRateShading": true,
+ "drawIndirectFirstInstance": true,
+ "depthClamp": true,
+ "depthBiasClamp": true,
+ "samplerAnisotropy": true,
+ "occlusionQueryPrecise": true,
+ "fragmentStoresAndAtomics": true,
+ "shaderStorageImageExtendedFormats": true,
+ "shaderUniformBufferArrayDynamicIndexing": true,
+ "shaderSampledImageArrayDynamicIndexing": true,
+ "shaderStorageBufferArrayDynamicIndexing": true,
+ "shaderStorageImageArrayDynamicIndexing": true
+ }
+ },
+ "properties": {
+ "VkPhysicalDeviceProperties": {
+ "limits": {
+ "maxImageDimension1D": 8192,
+ "maxImageDimension2D": 8192,
+ "maxImageDimensionCube": 8192,
+ "maxImageArrayLayers": 2048,
+ "maxUniformBufferRange": 65536,
+ "bufferImageGranularity": 4096,
+ "maxPerStageDescriptorSamplers": 64,
+ "maxPerStageDescriptorUniformBuffers": 15,
+ "maxPerStageDescriptorStorageBuffers": 30,
+ "maxPerStageDescriptorSampledImages": 200,
+ "maxPerStageDescriptorStorageImages": 16,
+ "maxPerStageResources": 200,
+ "maxDescriptorSetSamplers": 576,
+ "maxDescriptorSetUniformBuffers": 90,
+ "maxDescriptorSetStorageBuffers": 96,
+ "maxDescriptorSetSampledImages": 1800,
+ "maxDescriptorSetStorageImages": 144,
+ "maxFragmentCombinedOutputResources": 16,
+ "maxComputeWorkGroupInvocations": 256,
+ "maxComputeWorkGroupSize": [ 256, 256, 64 ],
+ "subTexelPrecisionBits": 8,
+ "mipmapPrecisionBits": 6,
+ "maxSamplerLodBias": 14,
+ "standardSampleLocations": true,
+ "maxColorAttachments": 7
+ }
+ }
+ }
+ },
+ "vulkan10optionals_roadmap2022": {
+ "features": {
+ "VkPhysicalDeviceFeatures": {
+ "largePoints": true,
+ "wideLines": true
+ }
+ },
+ "properties": {
+ "VkPhysicalDeviceProperties": {
+ "limits": {
+ "pointSizeGranularity": 0.125,
+ "lineWidthGranularity": 0.5
+ }
+ }
+ }
+ },
+ "vulkan11requirements": {
+ "features": {
+ "VkPhysicalDeviceVulkan11Features": {
+ "multiview": true
+ }
+ },
+ "properties": {
+ "VkPhysicalDeviceVulkan11Properties": {
+ "maxMultiviewViewCount": 6,
+ "maxMultiviewInstanceIndex": 134217727
+ }
+ }
+ },
+ "vulkan11requirements_roadmap2022": {
+ "features": {
+ "VkPhysicalDeviceVulkan11Features": {
+ "samplerYcbcrConversion": true
+ }
+ },
+ "properties": {
+ "VkPhysicalDeviceVulkan11Properties": {
+ "subgroupSize": 4,
+ "subgroupSupportedStages": [ "VK_SHADER_STAGE_COMPUTE_BIT", "VK_SHADER_STAGE_FRAGMENT_BIT" ],
+ "subgroupSupportedOperations": [ "VK_SUBGROUP_FEATURE_BASIC_BIT", "VK_SUBGROUP_FEATURE_VOTE_BIT", "VK_SUBGROUP_FEATURE_ARITHMETIC_BIT", "VK_SUBGROUP_FEATURE_BALLOT_BIT", "VK_SUBGROUP_FEATURE_SHUFFLE_BIT", "VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT", "VK_SUBGROUP_FEATURE_QUAD_BIT" ]
+ }
+ }
+ },
+ "vulkan12requirements": {
+ "features": {
+ "VkPhysicalDeviceVulkan12Features": {
+ "uniformBufferStandardLayout": true,
+ "subgroupBroadcastDynamicId": true,
+ "imagelessFramebuffer": true,
+ "separateDepthStencilLayouts": true,
+ "hostQueryReset": true,
+ "timelineSemaphore": true,
+ "shaderSubgroupExtendedTypes": true
+ }
+ },
+ "properties": {
+ "VkPhysicalDeviceVulkan12Properties": {
+ "maxTimelineSemaphoreValueDifference": 2147483647
+ }
+ }
+ },
+ "vulkan12requirements_roadmap2022": {
+ "features": {
+ "VkPhysicalDeviceVulkan12Features": {
+ "samplerMirrorClampToEdge": true,
+ "descriptorIndexing": true,
+ "shaderUniformTexelBufferArrayDynamicIndexing": true,
+ "shaderStorageTexelBufferArrayDynamicIndexing": true,
+ "shaderUniformBufferArrayNonUniformIndexing": true,
+ "shaderSampledImageArrayNonUniformIndexing": true,
+ "shaderStorageBufferArrayNonUniformIndexing": true,
+ "shaderStorageImageArrayNonUniformIndexing": true,
+ "shaderUniformTexelBufferArrayNonUniformIndexing": true,
+ "shaderStorageTexelBufferArrayNonUniformIndexing": true,
+ "descriptorBindingSampledImageUpdateAfterBind": true,
+ "descriptorBindingStorageImageUpdateAfterBind": true,
+ "descriptorBindingStorageBufferUpdateAfterBind": true,
+ "descriptorBindingUniformTexelBufferUpdateAfterBind": true,
+ "descriptorBindingStorageTexelBufferUpdateAfterBind": true,
+ "descriptorBindingUpdateUnusedWhilePending": true,
+ "descriptorBindingPartiallyBound": true,
+ "descriptorBindingVariableDescriptorCount": true,
+ "runtimeDescriptorArray": true,
+ "scalarBlockLayout": true
+ }
+ },
+ "properties": {
+ "VkPhysicalDeviceVulkan12Properties": {
+ "shaderSignedZeroInfNanPreserveFloat16": true,
+ "shaderSignedZeroInfNanPreserveFloat32": true,
+ "maxPerStageDescriptorUpdateAfterBindSamplers": 500000,
+ "maxPerStageDescriptorUpdateAfterBindUniformBuffers": 12,
+ "maxPerStageDescriptorUpdateAfterBindStorageBuffers": 500000,
+ "maxPerStageDescriptorUpdateAfterBindSampledImages": 500000,
+ "maxPerStageDescriptorUpdateAfterBindStorageImages": 500000,
+ "maxPerStageDescriptorUpdateAfterBindInputAttachments": 7,
+ "maxPerStageUpdateAfterBindResources": 500000,
+ "maxDescriptorSetUpdateAfterBindSamplers": 500000,
+ "maxDescriptorSetUpdateAfterBindUniformBuffers": 72,
+ "maxDescriptorSetUpdateAfterBindUniformBuffersDynamic": 8,
+ "maxDescriptorSetUpdateAfterBindStorageBuffers": 500000,
+ "maxDescriptorSetUpdateAfterBindStorageBuffersDynamic": 4,
+ "maxDescriptorSetUpdateAfterBindSampledImages": 500000,
+ "maxDescriptorSetUpdateAfterBindStorageImages": 500000,
+ "maxDescriptorSetUpdateAfterBindInputAttachments": 7
+ }
+ }
+ },
+ "vulkan13requirements": {
+ "features": {
+ "VkPhysicalDeviceVulkan12Features": {
+ "vulkanMemoryModel": true,
+ "vulkanMemoryModelDeviceScope": true,
+ "bufferDeviceAddress": true
+ },
+ "VkPhysicalDeviceVulkan13Features": {
+ "robustImageAccess": true,
+ "shaderTerminateInvocation": true,
+ "shaderZeroInitializeWorkgroupMemory": true,
+ "synchronization2": true,
+ "shaderIntegerDotProduct": true,
+ "maintenance4": true,
+ "pipelineCreationCacheControl": true,
+ "subgroupSizeControl": true,
+ "computeFullSubgroups": true,
+ "shaderDemoteToHelperInvocation": true,
+ "inlineUniformBlock": true,
+ "dynamicRendering": true
+ }
+ },
+ "properties": {
+ "VkPhysicalDeviceVulkan13Properties": {
+ "maxBufferSize": 1073741824,
+ "maxInlineUniformBlockSize": 256,
+ "maxPerStageDescriptorInlineUniformBlocks": 4,
+ "maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4,
+ "maxDescriptorSetInlineUniformBlocks": 4,
+ "maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4,
+ "maxInlineUniformTotalSize": 256
+ }
+ }
+ },
+ "vulkan13requirements_1_2": {
+ "extensions": {
+ "VK_EXT_image_robustness": 1,
+ "VK_KHR_shader_non_semantic_info": 1,
+ "VK_KHR_shader_terminate_invocation": 1,
+ "VK_KHR_format_feature_flags2": 1,
+ "VK_KHR_zero_initialize_workgroup_memory": 1,
+ "VK_KHR_synchronization2": 1,
+ "VK_KHR_shader_integer_dot_product": 1,
+ "VK_KHR_maintenance4": 1,
+ "VK_EXT_4444_formats": 1,
+ "VK_EXT_extended_dynamic_state": 1,
+ "VK_EXT_extended_dynamic_state2": 1,
+ "VK_EXT_pipeline_creation_cache_control": 1,
+ "VK_EXT_subgroup_size_control": 1,
+ "VK_EXT_shader_demote_to_helper_invocation": 1,
+ "VK_EXT_inline_uniform_block": 1,
+ "VK_EXT_pipeline_creation_feedback": 1,
+ "VK_EXT_texel_buffer_alignment": 1,
+ "VK_EXT_ycbcr_2plane_444_formats": 1,
+ "VK_EXT_texture_compression_astc_hdr": 1,
+ "VK_EXT_tooling_info": 1,
+ "VK_EXT_private_data": 1,
+ "VK_KHR_dynamic_rendering": 1
+ },
+ "features": {
+ "VkPhysicalDeviceVulkan12Features": {
+ "vulkanMemoryModel": true,
+ "vulkanMemoryModelDeviceScope": true,
+ "vulkanMemoryModelAvailabilityVisibilityChains": true,
+ "bufferDeviceAddress": true
+ },
+ "VkPhysicalDeviceImageRobustnessFeaturesEXT": {
+ "robustImageAccess": true
+ },
+ "VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR": {
+ "shaderTerminateInvocation": true
+ },
+ "VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR": {
+ "shaderZeroInitializeWorkgroupMemory": true
+ },
+ "VkPhysicalDeviceSynchronization2FeaturesKHR": {
+ "synchronization2": true
+ },
+ "VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR": {
+ "shaderIntegerDotProduct": true
+ },
+ "VkPhysicalDeviceMaintenance4FeaturesKHR": {
+ "maintenance4": true
+ },
+ "VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT": {
+ "pipelineCreationCacheControl": true
+ },
+ "VkPhysicalDeviceSubgroupSizeControlFeaturesEXT": {
+ "subgroupSizeControl": true,
+ "computeFullSubgroups": true
+ },
+ "VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT": {
+ "shaderDemoteToHelperInvocation": true
+ },
+ "VkPhysicalDeviceInlineUniformBlockFeaturesEXT": {
+ "inlineUniformBlock": true
+ }
+ },
+ "properties": {
+ "VkPhysicalDeviceMaintenance4PropertiesKHR": {
+ "maxBufferSize": 1073741824
+ },
+ "VkPhysicalDeviceInlineUniformBlockPropertiesEXT": {
+ "maxInlineUniformBlockSize": 256,
+ "maxPerStageDescriptorInlineUniformBlocks": 4,
+ "maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4,
+ "maxDescriptorSetInlineUniformBlocks": 4,
+ "maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4
+ }
+ }
+ },
+ "vulkan13requirements_roadmap2022": {
+ "extensions": {
+ "VK_KHR_global_priority": 1
+ },
+ "features": {
+ "VkPhysicalDeviceVulkan13Features": {
+ "descriptorBindingInlineUniformBlockUpdateAfterBind": true
+ }
+ }
+ },
+ "vulkan13requirements_roadmap2022_1_2": {
+ "extensions": {
+ "VK_EXT_global_priority": 1,
+ "VK_EXT_inline_uniform_block": 1
+ },
+ "features": {
+ "VkPhysicalDeviceInlineUniformBlockFeaturesEXT": {
+ "descriptorBindingInlineUniformBlockUpdateAfterBind": true
+ }
+ }
+ }
+ },
+ "profiles": {
+ "VP_KHR_roadmap_2022": {
+ "version": 1,
+ "api-version": "1.3.204",
+ "label": "Khronos Vulkan Roadmap 2022 profile",
+ "description": "This roadmap profile is intended to be supported by newer devices shipping in 2022 across mainstream smartphone, tablet, laptops, console and desktop devices.",
+ "contributors": {
+ "Tobias Hector": {
+ "company": "AMD",
+ "email": "tobias.hector@amd.com",
+ "contact": true
+ },
+ "Christophe Riccio": {
+ "company": "LunarG",
+ "email": "christophe@lunarg.com",
+ "contact": true
+ }
+ },
+ "history": [
+ {
+ "revision": 7,
+ "date": "2022-11-16",
+ "author": "Christophe Riccio",
+ "comment": "Fix wideLines and largePoints that are optionals"
+ },
+ {
+ "revision": 6,
+ "date": "2022-11-02",
+ "author": "Christophe Riccio",
+ "comment": "Fix roadmap 2022 maxInlineUniformTotalSize limit, 256 instead of 4"
+ },
+ {
+ "revision": 5,
+ "date": "2022-05-02",
+ "author": "Christophe Riccio",
+ "comment": "Add missing dynamicRendering that is a Vulkan 1.3 requirement"
+ },
+ {
+ "revision": 4,
+ "date": "2022-03-08",
+ "author": "Christophe Riccio",
+ "comment": "Refactor requirements per Vulkan API version"
+ },
+ {
+ "revision": 3,
+ "date": "2022-03-08",
+ "author": "Christophe Riccio",
+ "comment": "Fix Vulkan 1.3.204 API version requirement"
+ },
+ {
+ "revision": 2,
+ "date": "2022-01-03",
+ "author": "Christophe Riccio",
+ "comment": "Rebase against Vulkan 1.3.203 revision"
+ },
+ {
+ "revision": 1,
+ "date": "2021-12-08",
+ "author": "Christophe Riccio",
+ "comment": "Initial revision"
+ }
+ ],
+ "capabilities": [
+ "vulkan10requirements",
+ "vulkan10requirements_roadmap2022",
+ "vulkan11requirements",
+ "vulkan11requirements_roadmap2022",
+ "vulkan12requirements",
+ "vulkan12requirements_roadmap2022",
+ "vulkan13requirements",
+ "vulkan13requirements_roadmap2022"
+ ],
+ "optionals": [
+ "vulkan10optionals_roadmap2022"
+ ]
+ }
+ }
+}
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/registry.rnc b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/registry.rnc
new file mode 100644
index 00000000000..906f1fcc202
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/registry.rnc
@@ -0,0 +1,738 @@
+# Copyright 2013-2023 The Khronos Group Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Relax NG schema for Khronos Vulkan API Registry XML
+#
+# See https://www.khronos.org/vulkan/
+#
+# This definition is subject to change (mostly in the form of additions)
+
+namespace xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
+
+# Toplevel is a <registry> tag.
+# May be led by an optional <comment> tag containing e.g. copyrights.
+start = element registry {
+ (
+ element comment { text } ? |
+ Platforms * |
+ Tags * |
+ Types * |
+ Enums * |
+ Commands * |
+ Feature * |
+ Extensions * |
+ Formats * |
+ Sync * |
+ SpirvExtensions * |
+ SpirvCapabilities *
+ ) *
+}
+
+# <platforms> defines a group of platform names
+Platforms = element platforms {
+ Comment ? ,
+ Platform *
+}
+
+# <platform> defines a single platform name.
+# name - string name of the platform, used as part of extension names
+# protect - preprocessor symbol to include platform headers from <vulkan.h>
+# comment - platform description
+Platform = element platform {
+ attribute name { text } ,
+ attribute protect { text } ,
+ Comment
+}
+
+# <tags> defines a group of author tags
+Tags = element tags {
+ Comment ? ,
+ Tag *
+}
+
+# <tag> defines a single author tag.
+# name - name of the tag
+# author - name of the author (usually a company or project name)
+# contact - contact responsible for the tag (name and contact information)
+Tag = element tag {
+ attribute name { text } ,
+ attribute author { text } ,
+ attribute contact { text }
+}
+
+# <types> defines a group of types
+Types = element types {
+ Comment ? ,
+ (
+ Type |
+ element comment { text }
+ ) *
+}
+
+# <type> defines a single type. It is usually a C typedef but
+# may contain arbitrary C code.
+# name - name of this type, if not present in the <name> tag
+# api - matches a <feature> api attribute, if present
+# alias - name of a type this type aliases
+# requires - name of another type definition required by this one
+# bitvalues - for a *Flags type, name of an enum definition that
+# defines the valid values for parameters of that type
+# name - name of the type being defined
+# category - if present, 'enum' indicates a matching <enums>
+# block to generate an enumerated type for, and 'struct'
+# causes special interpretation of the contents of the type
+# tag including ... TBD ...
+# Other allowed values are 'include', 'define', 'handle' and 'bitmask',
+# which do not change syntactic interpretation but allow organization
+# in the generated header.
+# deprecated - denotes that this type is deprecated, and why.
+# Valid values: 'aliased', 'true'.
+# parent - only applicable if category is 'handle'. Notes another type with
+# the 'handle' category that acts as a parent object for this type.
+# returnedonly - only applicable if category is 'struct'. Notes that this
+# struct is going to be filled in by the API, rather than an application
+# filling it out and passing it to the API.
+# structextends - only applicable if category is 'struct'. Lists parent
+# structures which this structure may extend via the pNext chain
+# of the parent.
+# When present it suppresses generation of automatic validity for the
+# pNext member of that structure, and instead the structure is added
+# to pNext chain validity for the parent structures it extends.
+# allowduplicate - only applicable if category is 'struct'. pNext can include
+# multiple structures of this type.
+# objtypeenum - name of VK_OBJECT_TYPE_* API enumerant which corresponds
+# to this type. Currently only specified for category="handle" types.
+# comment - descriptive text with no semantic meaning
+# For types without a category, contents include
+# <apientry /> - substitutes for an APIENTRY-style macro on output
+# <name> - contains name of the type being defined
+# <type> - contains name of types used to define this type. There
+# may be multiple imbedded <type> tags
+# For types with category 'enum', contents should be empty
+# For types with category 'struct', contents should be one or more
+# <member> - like <param> for a struct or union member
+# len - if the member is an array, len may be one or more of the following
+# things, separated by commas (one for each array indirection):
+# another member of that struct, 'null-terminated' for a string,
+# '1' to indicate it is just a pointer (used for nested pointers),
+# or a latex equation (prefixed with 'latexmath:')
+# altlen - if len has latexmath equations, this contains equivalent C99
+# expressions separated by commas.
+# deprecated - denotes that this member is deprecated, and why.
+# Valid values: 'ignored', 'true'.
+# externsync - denotes that the member should be externally synchronized
+# when accessed by Vulkan
+# optional - whether this value can be omitted by providing NULL (for
+# pointers), VK_NULL_HANDLE (for handles) or 0 (for bitmasks/values)
+# selector - for a union member, identifies a separate enum member that
+# selects which of the union's members are valid
+# selection - for a member of a union, identifies an enum value indicating the member is valid
+# noautovalidity - tag stating that no automatic validity language should be generated
+# values - comma-separated list of legal values, usually used only for sType enums
+# limittype - only applicable for members of VkPhysicalDeviceProperties and
+# VkPhysicalDeviceProperties2, their substructures, and extensions.
+# Specifies the type of a device limit.
+# Valid values: 'min', 'max', 'pot', 'mul', 'bits', bitmask', 'range', 'struct', 'exact', 'noauto'
+# objecttype - only applicable for members representing a handle as
+# a uint64_t value. Specifies the name of another member which is
+# a VkObjectType or VkDebugReportObjectTypeEXT value specifying
+# the type of object the handle references.
+# <comment> - containing arbitrary text (unused)
+#
+# *** There is a problem here: I am not sure how to represent the <type>
+# syntax where it may contain arbitrarily interleaved text, <type>, and
+# <enum> child tags. This allows only the syntax
+# text <type>name</type> text <enum>name</enum> text
+# where <type> and <enum> are both optional and occur in the specified
+# order, which might eventually be a problem.
+Type = element type {
+ attribute api { text } ? ,
+ attribute alias { text } ? ,
+ attribute requires { text } ? ,
+ attribute bitvalues { text } ? ,
+ attribute name { TypeName } ? ,
+ attribute category { text } ? ,
+ attribute deprecated { text } ? ,
+ attribute parent { TypeName } ? ,
+ attribute returnedonly { text } ? ,
+ attribute structextends { text } ? ,
+ attribute allowduplicate { text } ? ,
+ attribute objtypeenum { text } ? ,
+ Comment ? ,
+ (
+ (
+ ( text ,
+ element type { text } *
+ ) * ,
+ element apientry { text } ? ,
+ ( text ,
+ element type { text } *
+ ) * ,
+ element name { TypeName } ? ,
+ ( text ,
+ element type { text } *
+ ) *
+ ) |
+ (
+ element member {
+ attribute api { text } ? ,
+ attribute len { text } ? ,
+ attribute altlen { text } ? ,
+ attribute externsync { text } ? ,
+ attribute optional { text } ? ,
+ attribute selector { text } ? ,
+ attribute selection { EnumName } ? ,
+ attribute noautovalidity { text } ? ,
+ attribute values { text } ? ,
+ attribute limittype { text } ? ,
+ attribute objecttype { text } ? ,
+ attribute deprecated { text } ? ,
+ mixed {
+ element type { TypeName } ? ,
+ element name { text } ? ,
+ element enum { EnumName } ? ,
+ element comment { text } ?
+ } +
+ } |
+ element comment { text }
+ ) *
+ )
+}
+
+# <enums> defines a group of enumerants
+# name - identifies a type name associated with this group. Should
+# match a <type> name to trigger generation of the type.
+# type - 'enum' or 'bitmask', if present
+# bitwidth - bit width of the enum value type.
+# comment - descriptive text with no semantic meaning
+Enums = element enums {
+ attribute name { text } ? ,
+ attribute type { text } ? ,
+ attribute bitwidth { Integer } ? ,
+ Comment ? ,
+ (
+ Enum |
+ Unused |
+ element comment { text}
+ ) *
+}
+
+# <enum> defines or references a single enumerant. There are two places it
+# can be used: in an <enums> block, providing a global definition which
+# may later be required by a feature or extension; or in a feature or
+# extension, defining an enumerant specific to that feature. The second
+# form has more possible attributes. Some combinations of attributes are
+# nonsensical in on or the other place, but these are not detected by the
+# validator.
+#
+# Ways to specify the enumerant value:
+# value - integer (including hex) value of the enumerant
+# bitpos - integer bit position of the enumerant in a bitmask
+# [extnumber], offset, [dir] - integer extension number specifying a
+# base block value (inherited from surrounding <extension> if
+# not specified); integer offset in that block; and direction
+# of offset ('-' for negative, positive if not specified).
+# alias - name of another enum this is an alias of
+#
+# value and bitpos allow, and extnumber/offset/dir require:
+# extends - type name of the enumerant being extended
+#
+# Other attributes:
+# api - matches a <feature> api attribute, if present
+# type - 'uint32_t', 'uint64_t', or 'float', if present. There are
+# certain conditions under which the tag must be present, or absent,
+# but they are context-dependent and difficult to express in the
+# RNC syntax.
+# name - enumerant name
+# alias - another enumerant this is semantically identical to
+# protect - additional #ifdef symbol to place around the enum
+# comment - descriptive text with no semantic meaning
+# deprecated - denotes that this enum is deprecated, and why.
+# Valid values: 'aliased', 'ignored', 'true'.
+Enum = element enum {
+ (
+ (
+ (
+ attribute value { Integer } &
+ attribute extends { TypeName } ?
+ ) |
+ (
+ attribute bitpos { Integer } &
+ attribute extends { TypeName } ?
+ ) |
+ (
+ attribute extnumber { Integer } ? &
+ attribute offset { Integer } &
+ attribute dir { text } ? &
+ attribute extends { TypeName }
+ ) |
+ (
+ attribute extends { TypeName } ? &
+ attribute alias { TypeName }
+ )
+ ) ? &
+ attribute protect { text } ? &
+ attribute api { text } ? &
+ attribute type { TypeSuffix } ? &
+ attribute name { text } &
+ attribute deprecated { text } ? &
+ Comment ?
+ )
+}
+
+# <unused> defines a range of enumerants not currently being used
+# start, end - beginning and end of an unused numeric range
+# vendor - unused
+# comment - descriptive text with no semantic meaning
+Unused = element unused {
+ attribute start { Integer } ,
+ attribute end { Integer } ? ,
+ Vendor ? ,
+ Comment ?
+}
+
+# <commands> defines a group of commands
+Commands = element commands {
+ Comment ? ,
+ Command *
+}
+
+# <command> defines a single command
+#
+# There are two forms of the tag.
+#
+# Either form may have an 'api' attribute
+# api - matches a <feature> api attribute, if present
+#
+# The first form only has 'name' and 'alias' attributes, and no contents.
+# It defines a command alias.
+#
+# The second form fully defines a command, and has the following structure:
+# The possible attributes are not described in this comment block yet, but
+# are in registry.html. The "prefix" and "suffix" attributes are currently
+# present only in the OpenCL XML registry, where they are currently unused.
+#
+# <proto> is the C function prototype, including the return type
+# <param> are function parameters, in order
+# len - if the member is an array, len may be one or more of the following
+# things, separated by commas (one for each array indirection):
+# another member of that struct, 'null-terminated' for a string,
+# '1' to indicate it is just a pointer (used for nested pointers),
+# or a latex equation (prefixed with 'latexmath:')
+# altlen - if len has latexmath equations, this contains equivalent C99
+# expressions separated by commas.
+# externsync - denotes that the member should be externally synchronized
+# when accessed by Vulkan
+# optional - whether this value can be omitted by providing NULL (for
+# pointers), VK_NULL_HANDLE (for handles) or 0 (for bitmasks/values)
+# selector - for a union parameter, identifies a separate enum parameter that
+# selects which of the union's members are valid
+# noautovalidity - tag stating that no automatic validity language should be
+# generated
+# objecttype - only applicable for parameters representing a handle as
+# a uint64_t value. Specifies the name of another parameter which is
+# a VkObjectType or VkDebugReportObjectTypeEXT value specifying
+# the type of object the handle references.
+# validstructs - only applicable for parameters which are pointers to
+# VkBaseInStructure or VkBaseOutStructure types, used as abstract
+# placeholders. Specifies a comma-separated list of structures which
+# may be passed in place of the parameter, or anywhere in the pNext
+# chain of the parameter.
+# stride - if the member is an array, stride specifies the name of
+# another member containing the byte stride between consecutive
+# elements in the array. Is assumed tightly packed if omitted.
+# <type> is a <type> name, if present
+# <name> is the function / parameter name, if present (normally should
+# be, except for void parameters).
+# The textual contents of <proto> and <param> should be legal C
+# for those parts of a function declaration.
+# <alias> - denotes function aliasing, if present
+# name - name of aliased function
+# <description> - unused text
+# <implicitexternsyncparams> are spec-language descriptions of
+# objects that are not parameters of the command, but
+# are related to them and also require external synchronization.
+Command = element command {
+ ( attribute name { text } ,
+ attribute alias { text } ,
+ attribute api { text } ?
+ ) |
+ (
+ attribute tasks { text } ? ,
+ attribute queues { text } ? ,
+ attribute successcodes { text } ? ,
+ attribute errorcodes { text } ? ,
+ attribute renderpass { text } ? ,
+ attribute videocoding { text } ? ,
+ attribute cmdbufferlevel { text } ? ,
+ attribute prefix { text } ? ,
+ attribute suffix { text } ? ,
+ attribute api { text } ? ,
+ Comment ? ,
+ element proto {
+ mixed {
+ element type { TypeName } ? ,
+ element name { text }
+ }
+ } ,
+ element param {
+ attribute api { text } ? ,
+ attribute len { text } ? ,
+ attribute altlen { text } ? ,
+ attribute externsync { text } ? ,
+ attribute optional { text } ? ,
+ attribute selector { text } ? ,
+ attribute noautovalidity { text } ? ,
+ attribute objecttype { text } ? ,
+ attribute validstructs { text } ? ,
+ attribute stride { text } ? ,
+ mixed {
+ element type { TypeName } ? ,
+ element name { text } ?
+ }
+ } * ,
+ (
+ element alias {
+ Name
+ } ? &
+ element description {
+ text
+ } ? &
+ element implicitexternsyncparams {
+ element param { text } *
+ } ?
+ )
+ )
+}
+
+# Each <feature> defines the interface of an API version (e.g. OpenGL 1.2)
+# api - API tag (e.g. 'gl', 'gles2', etc. - used internally, not
+# necessarily an actual API name
+# name - version name (C preprocessor name, e.g. GL_VERSION_4_2)
+# number - version number, e.g. 4.2
+# protect - additional #ifdef symbol to place around the feature
+# sortorder - order relative to other features, default 0
+# <require> / <remove> contains features to require or remove in
+# this version
+# profile - only require/remove when generated profile matches
+# comment - descriptive text with no semantic meaning
+Feature = element feature {
+ attribute api { text } ,
+ Name ,
+ attribute number { xsd:float } ,
+ attribute protect { text } ? ,
+ attribute sortorder { xsd:integer } ?,
+ Comment ? ,
+ (
+ element require {
+ ProfileName ? ,
+ Depends ? ,
+ Comment ? ,
+ (
+ InterfaceElement |
+ element comment { text }
+ ) *
+ } |
+ element remove {
+ ProfileName ? ,
+ Comment ? ,
+ (
+ InterfaceElement |
+ element comment { text }
+ ) *
+ }
+ ) *
+}
+
+Extensions = element extensions {
+ Comment ? ,
+ Extension *
+}
+
+# Each <extension> defines the interface of an API <extension>.
+# Like a <feature> tag, but with slightly different attributes:
+# api - regexp pattern matching one or more API tags, indicating
+# which APIs the extension is known to work with. The only
+# syntax supported is <name>{|<name>}* and each name must
+# exactly match an API being generated (implicit ^$ surrounding).
+# name - extension name string
+# number - extension number (positive integer, should be unique)
+# sortorder - order relative to other extensions, default 0
+# protect - C preprocessor symbol to conditionally define the interface
+# platform - should be one of the platform names defined in the
+# <platform> tag. Currently unused.
+# author - name of the author (usually a company or project name)
+# contact - contact responsible for the tag (name and contact information)
+# type - 'device' or 'instance', if present
+# requires - commas-separated list of extension names required by this
+# extension
+# requiresCore - core version of Vulkan required by the extension, e.g.
+# "1.1". Defaults to "1.0".
+# supported - comma-separated list of API name(s) supporting this extension,
+# e.g. 'vulkan', or 'disabled' to never generate output.
+# ratified - comma-separated list of API name(s) for which this extension
+# has been ratified by Khronos. Defaults to "" if not specified.
+# promotedto - Vulkan version or a name of an extension that this
+# extension was promoted to; e.g. 'VK_VERSION_1_1', or
+# 'VK_KHR_draw_indirect_county'
+# deprecatedby - Vulkan version or a name of an extension that deprecates
+# this extension. It may be empty string.
+# e.g. 'VK_VERSION_1_1', or 'VK_EXT_debug_utils', or ''
+# obsoletedby - Vulkan version or a name of an extension that obsoletes
+# this extension. It may be empty string.
+# e.g. 'VK_VERSION_1_1', or 'VK_EXT_debug_utils', or ''
+# provisional - 'true' if this extension is released provisionally
+# specialuse - contains one or more tokens separated by commas, indicating
+# a special purpose of the extension. Tokens may include 'cadsupport',
+# 'd3demulation', 'devtools', 'debugging', and 'glemulation'. Others
+# may be added in the future.
+# In addition, <require> / <remove> tags also support an api attribute:
+# api - only require/remove these features for the matching API.
+# Not a regular expression.
+Extension = element extension {
+ Name ,
+ attribute number { Integer } ? ,
+ attribute sortorder { xsd:integer } ?,
+ attribute protect { text } ? ,
+ attribute platform { text } ? ,
+ attribute author { text } ? ,
+ attribute contact { text } ? ,
+ attribute type { text } ? ,
+ attribute depends { text } ?,
+ attribute supported { StringGroup } ? ,
+ attribute ratified { text } ? ,
+ attribute promotedto { text } ? ,
+ attribute deprecatedby { text } ? ,
+ attribute obsoletedby { text } ? ,
+ attribute provisional { text } ? ,
+ attribute specialuse { text } ? ,
+ Comment ? ,
+ (
+ element require {
+ attribute api { text } ? ,
+ ProfileName ? ,
+ Depends ? ,
+ Comment ? ,
+ (
+ InterfaceElement |
+ element comment { text }
+ ) *
+ } |
+ element remove {
+ attribute api { text } ? ,
+ ProfileName ? ,
+ Comment ? ,
+ (
+ InterfaceElement |
+ element comment { text }
+ ) *
+ }
+ ) *
+}
+
+# Each <format> define information about a VkFormat in a machine readable format
+Formats = element formats {
+ Format *
+}
+
+# name - Format name, matching a VkFormat enum name
+# class - Used for 'Compatible Formats' table
+# blockSize - Used for 'Compatible Formats' table
+# texelsPerBlock - Used for 'Compatible Formats' table
+# blockExtent - 3D extent, no attribute is same as blockExtent=1,1,1
+# packed - number of bits data type
+# compressed - compression format class
+# planes - number of planes, no attribute is same as planes=1
+# chroma - can be one of [420, 422, 444] and used to mark if YCbCr Sampler are required by default
+Format = element format {
+ Name ,
+ attribute class { text } ,
+ attribute blockSize { text } ,
+ attribute texelsPerBlock { text } ,
+ attribute blockExtent { text } ? ,
+ attribute packed { text } ? ,
+ attribute compressed { text } ? ,
+ attribute chroma { text } ? ,
+ Component + ,
+ Plane * ,
+ SpirvImageFormat *
+}
+
+# bits - size of component or "compressed" if part of block-compression format
+# numericFormat - as per Interpretation of Numeric Format table
+# some formats (depth/stencil) will have different numeric per component
+# planeIndex - For multi-planar formats to map to the plane element
+Component = element component {
+ Name ,
+ attribute bits { text } ,
+ attribute numericFormat { text },
+ attribute planeIndex { text } ?
+}
+
+# For multi-planar formats
+Plane = element plane {
+ attribute index { text } ,
+ attribute widthDivisor { text } ,
+ attribute heightDivisor { text } ,
+ attribute compatible { text }
+}
+
+# labels a SPIR-V Image Format
+SpirvImageFormat = element spirvimageformat {
+ Name
+}
+
+# <sync> is a set of all sync objects
+Sync = element sync {
+ Comment ? ,
+ SyncStage *,
+ SyncAccess *,
+ SyncPipeline *
+}
+
+SyncSupport = element syncsupport {
+ attribute queues { text } ? ,
+ attribute stage { text } ?
+}
+
+SyncEquivalent = element syncequivalent {
+ attribute stage { text } ?,
+ attribute access { text } ?
+}
+
+# describes all Pipeline Stages
+SyncStage = element syncstage {
+ Name ,
+ attribute alias { text } ? ,
+ SyncSupport ? ,
+ SyncEquivalent ?
+}
+
+# describes all Access Flags
+SyncAccess = element syncaccess {
+ element comment { text } ?,
+ Name ,
+ attribute alias { text } ? ,
+ SyncSupport ? ,
+ SyncEquivalent ?
+}
+
+SyncPipelineStage = element syncpipelinestage {
+ attribute order { text } ? ,
+ attribute before { text } ? ,
+ attribute after { text } ?,
+ text
+}
+
+# describes pipelines
+SyncPipeline = element syncpipeline {
+ Name ,
+ attribute depends { text } ? ,
+ SyncPipelineStage *
+}
+
+# Each <spirvextension> define a SPIR-V extension that can be used in the API.
+# Each <spirvcapability> define a SPIR-V capability that can be used in the API.
+# Contains information to both generate table in spec as well as validating
+# what needs to be enabled or supported to be used in Vulkan
+SpirvExtensions = element spirvextensions {
+ Comment ? ,
+ SpirvExtension *
+}
+
+SpirvExtension = element spirvextension {
+ Name ,
+ Enable +
+}
+
+SpirvCapabilities = element spirvcapabilities {
+ Comment ? ,
+ SpirvCapability *
+}
+
+SpirvCapability = element spirvcapability {
+ Name ,
+ Enable +
+}
+
+# <enable> defines a way to enable the parent element in the API.
+# If anyone of the <enable> elements are valid then the parent element
+# can be used.
+#
+# There are four forms of the tag.
+#
+# The first only has the minimal version of Vulkan of the application
+#
+# The second only has a single Vulkan extension that must be enabled
+#
+# The third has a single Vulkan feature with the struct where it is from
+#
+# The fourth has a property struct, the member field in it, and the value
+# that must be present
+#
+# To make scripting easier, each <enable> has a require attribute to map
+# to the asciidoctor conditional logic in the spec. For version and
+# extension attribute variations, there is no need for the require attribute
+# since it is a redundant 1:1 mapping.
+#
+# The 'alias' attribute is used in cases where the anchor link cannot be
+# properly resolved and needs a manual name to link to
+Enable = element enable {
+ (
+ attribute version { text } ) |
+ (
+ attribute extension { text } ) |
+ (
+ attribute struct { text },
+ attribute feature { text },
+ attribute requires { text },
+ attribute alias { text } ? ) |
+ (
+ attribute property { text },
+ attribute member { text },
+ attribute value { text },
+ attribute requires { text } ? )
+}
+
+# Contents of a <require> / <remove> tag, defining a group
+# of features to require or remove.
+# <type> / <enum> / <command> all have attributes
+# name - feature name which must match
+InterfaceElement =
+ element type {
+ Name ,
+ Comment ?
+ } |
+ Enum |
+ element command {
+ Name ,
+ Comment ?
+ }
+
+# Integers are allowed to be either decimal or C-hex (0x[0-9A-F]+), but
+# XML Schema types do not seem to support hex notation, so we use this
+# as a placeholder.
+Integer = text
+
+# EnumName is an compile-time constant name
+EnumName = text
+
+# TypeName is an argument/return value C type name
+TypeName = text
+
+# TypeSuffix is a C numeric type suffix, e.g. 'u' or 'ull'
+TypeSuffix = text
+
+# StringGroup is a regular expression with an implicit
+# '^(' and ')$' bracketing it.
+StringGroup = text
+
+# Repeatedly used attributes
+ProfileName = attribute profile { text }
+ExtensionName = attribute extension { text }
+# Boolean expression of core version and extension names using (),+ operators
+Depends = attribute depends { text }
+Vendor = attribute vendor { text }
+Comment = attribute comment { text }
+Name = attribute name { text }
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/video.xml b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/video.xml
new file mode 100644
index 00000000000..a7e66dbe834
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/video.xml
@@ -0,0 +1,1218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<registry>
+ <comment>
+Copyright 2021-2023 The Khronos Group Inc.
+SPDX-License-Identifier: Apache-2.0 OR MIT
+ </comment>
+
+ <comment>
+This file, video.xml, provides the machine readable definition of data
+structures and enumerations that are related to the externally-provided
+video compression standards.
+
+The current public version of video.xml is maintained in the default branch
+(currently named main) of the Khronos Vulkan GitHub project.
+ </comment>
+
+ <types comment="Video type definitions">
+ <!-- base types -->
+ <type name="stdint" category="include">#if !defined(VK_NO_STDINT_H)
+ #include &lt;stdint.h&gt;
+#endif</type>
+ <type name="uint32_t" requires="stdint"/>
+ <type name="uint16_t" requires="stdint"/>
+ <type name="uint8_t" requires="stdint"/>
+ <type name="int32_t" requires="stdint"/>
+ <type name="int8_t" requires="stdint"/>
+
+ <type category="include" name="vk_video/vulkan_video_codecs_common.h">#include "vulkan_video_codecs_common.h"</type>
+ <type category="include" name="vk_video/vulkan_video_codec_h264std.h">#include "vulkan_video_codec_h264std.h"</type>
+ <type category="include" name="vk_video/vulkan_video_codec_h265std.h">#include "vulkan_video_codec_h265std.h"</type>
+
+ <!-- vulkan_video_codecs_common macros -->
+ <type category="define">#define <name>VK_MAKE_VIDEO_STD_VERSION</name>(major, minor, patch) \
+ ((((uint32_t)(major)) &lt;&lt; 22) | (((uint32_t)(minor)) &lt;&lt; 12) | ((uint32_t)(patch)))</type>
+
+ <!-- vulkan_video_codec_h264std_decode.h macros -->
+ <type category="define" requires="VK_MAKE_VIDEO_STD_VERSION">
+#define <name>VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(1, 0, 0)</type>
+
+ <!-- vulkan_video_codec_h264std_encode.h macros -->
+ <type category="define" requires="VK_MAKE_VIDEO_STD_VERSION">// Vulkan 0.9 provisional Vulkan video H.264 encode std specification version number
+#define <name>VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_11</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(0, 9, 11)</type>
+
+ <!-- vulkan_video_codec_h265std_decode.h macros -->
+ <type category="define" requires="VK_MAKE_VIDEO_STD_VERSION">
+#define <name>VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(1, 0, 0)</type>
+
+ <!-- vulkan_video_codec_h265std_encode.h macros -->
+ <type category="define" requires="VK_MAKE_VIDEO_STD_VERSION">// Vulkan 0.9 provisional Vulkan video H.265 encode std specification version number
+#define <name>VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_12</name> <type>VK_MAKE_VIDEO_STD_VERSION</type>(0, 9, 12)</type>
+
+ <!-- vulkan_video_codec_h264std.h enumerated types -->
+ <type name="StdVideoH264ChromaFormatIdc" category="enum"/>
+ <type name="StdVideoH264ProfileIdc" category="enum"/>
+ <type name="StdVideoH264LevelIdc" category="enum"/>
+ <type name="StdVideoH264PocType" category="enum"/>
+ <type name="StdVideoH264AspectRatioIdc" category="enum"/>
+ <type name="StdVideoH264WeightedBipredIdc" category="enum"/>
+ <type name="StdVideoH264ModificationOfPicNumsIdc" category="enum"/>
+ <type name="StdVideoH264MemMgmtControlOp" category="enum"/>
+ <type name="StdVideoH264CabacInitIdc" category="enum"/>
+ <type name="StdVideoH264DisableDeblockingFilterIdc" category="enum"/>
+ <type name="StdVideoH264SliceType" category="enum"/>
+ <type name="StdVideoH264PictureType" category="enum"/>
+ <type name="StdVideoH264NonVclNaluType" category="enum"/>
+
+ <!-- vulkan_video_codec_h264std.h structs -->
+ <type category="struct" name="StdVideoH264SpsVuiFlags">
+ <member><type>uint32_t</type> <name>aspect_ratio_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>overscan_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>overscan_appropriate_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>video_signal_type_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>video_full_range_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>color_description_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>chroma_loc_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>timing_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>fixed_frame_rate_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>bitstream_restriction_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>nal_hrd_parameters_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vcl_hrd_parameters_present_flag</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoH264HrdParameters" comment="hrd_parameters">
+ <member><type>uint8_t</type> <name>cpb_cnt_minus1</name></member>
+ <member><type>uint8_t</type> <name>bit_rate_scale</name></member>
+ <member><type>uint8_t</type> <name>cpb_size_scale</name></member>
+ <member><type>uint8_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint32_t</type> <name>bit_rate_value_minus1</name>[<enum>STD_VIDEO_H264_CPB_CNT_LIST_SIZE</enum>]<comment>cpb_cnt_minus1 number of valid elements</comment></member>
+ <member><type>uint32_t</type> <name>cpb_size_value_minus1</name>[<enum>STD_VIDEO_H264_CPB_CNT_LIST_SIZE</enum>]<comment>cpb_cnt_minus1 number of valid elements</comment></member>
+ <member><type>uint8_t</type> <name>cbr_flag</name>[<enum>STD_VIDEO_H264_CPB_CNT_LIST_SIZE</enum>]<comment>cpb_cnt_minus1 number of valid elements</comment></member>
+ <member><type>uint32_t</type> <name>initial_cpb_removal_delay_length_minus1</name></member>
+ <member><type>uint32_t</type> <name>cpb_removal_delay_length_minus1</name></member>
+ <member><type>uint32_t</type> <name>dpb_output_delay_length_minus1</name></member>
+ <member><type>uint32_t</type> <name>time_offset_length</name></member>
+ </type>
+ <type category="struct" name="StdVideoH264SequenceParameterSetVui">
+ <member><type>StdVideoH264SpsVuiFlags</type> <name>flags</name></member>
+ <member><type>StdVideoH264AspectRatioIdc</type> <name>aspect_ratio_idc</name></member>
+ <member><type>uint16_t</type> <name>sar_width</name></member>
+ <member><type>uint16_t</type> <name>sar_height</name></member>
+ <member><type>uint8_t</type> <name>video_format</name></member>
+ <member><type>uint8_t</type> <name>colour_primaries</name></member>
+ <member><type>uint8_t</type> <name>transfer_characteristics</name></member>
+ <member><type>uint8_t</type> <name>matrix_coefficients</name></member>
+ <member><type>uint32_t</type> <name>num_units_in_tick</name></member>
+ <member><type>uint32_t</type> <name>time_scale</name></member>
+ <member><type>uint8_t</type> <name>max_num_reorder_frames</name></member>
+ <member><type>uint8_t</type> <name>max_dec_frame_buffering</name></member>
+ <member><type>uint8_t</type> <name>chroma_sample_loc_type_top_field</name></member>
+ <member><type>uint8_t</type> <name>chroma_sample_loc_type_bottom_field</name></member>
+ <member><type>uint32_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member>const <type>StdVideoH264HrdParameters</type>* <name>pHrdParameters</name><comment>must be a valid ptr to hrd_parameters, if nal_hrd_parameters_present_flag or vcl_hrd_parameters_present_flag are set</comment></member>
+ </type>
+ <type category="struct" name="StdVideoH264SpsFlags">
+ <member><type>uint32_t</type> <name>constraint_set0_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>constraint_set1_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>constraint_set2_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>constraint_set3_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>constraint_set4_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>constraint_set5_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>direct_8x8_inference_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>mb_adaptive_frame_field_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>frame_mbs_only_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>delta_pic_order_always_zero_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>separate_colour_plane_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>gaps_in_frame_num_value_allowed_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>qpprime_y_zero_transform_bypass_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>frame_cropping_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>seq_scaling_matrix_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vui_parameters_present_flag</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoH264ScalingLists">
+ <comment>
+ scaling_list_present_mask has one bit for each
+ seq_scaling_list_present_flag[i] for SPS OR
+ pic_scaling_list_present_flag[i] for PPS,
+ bit 0 - 5 are for each entry of ScalingList4x4
+ bit 6 - 11 are for each entry plus 6 for ScalingList8x8
+ </comment>
+ <member><type>uint16_t</type> <name>scaling_list_present_mask</name></member>
+ <comment>
+ use_default_scaling_matrix_mask has one bit for each
+ UseDefaultScalingMatrix4x4Flag[ i ] and
+ UseDefaultScalingMatrix8x8Flag[ i - 6 ] for SPS OR PPS
+ bit 0 - 5 are for each entry of ScalingList4x4
+ bit 6 - 11 are for each entry plus 6 for ScalingList8x8
+ </comment>
+ <member><type>uint16_t</type> <name>use_default_scaling_matrix_mask</name></member>
+ <member><type>uint8_t</type> <name>ScalingList4x4</name>[<enum>STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS</enum>][<enum>STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS</enum>]</member>
+ <member><type>uint8_t</type> <name>ScalingList8x8</name>[<enum>STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS</enum>][<enum>STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS</enum>]</member>
+ </type>
+ <type category="struct" name="StdVideoH264SequenceParameterSet">
+ <member><type>StdVideoH264SpsFlags</type> <name>flags</name></member>
+ <member><type>StdVideoH264ProfileIdc</type> <name>profile_idc</name></member>
+ <member><type>StdVideoH264LevelIdc</type> <name>level_idc</name></member>
+ <member><type>StdVideoH264ChromaFormatIdc</type> <name>chroma_format_idc</name></member>
+ <member><type>uint8_t</type> <name>seq_parameter_set_id</name></member>
+ <member><type>uint8_t</type> <name>bit_depth_luma_minus8</name></member>
+ <member><type>uint8_t</type> <name>bit_depth_chroma_minus8</name></member>
+ <member><type>uint8_t</type> <name>log2_max_frame_num_minus4</name></member>
+ <member><type>StdVideoH264PocType</type> <name>pic_order_cnt_type</name></member>
+ <member><type>int32_t</type> <name>offset_for_non_ref_pic</name></member>
+ <member><type>int32_t</type> <name>offset_for_top_to_bottom_field</name></member>
+ <member><type>uint8_t</type> <name>log2_max_pic_order_cnt_lsb_minus4</name></member>
+ <member><type>uint8_t</type> <name>num_ref_frames_in_pic_order_cnt_cycle</name></member>
+ <member><type>uint8_t</type> <name>max_num_ref_frames</name></member>
+ <member><type>uint8_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint32_t</type> <name>pic_width_in_mbs_minus1</name></member>
+ <member><type>uint32_t</type> <name>pic_height_in_map_units_minus1</name></member>
+ <member><type>uint32_t</type> <name>frame_crop_left_offset</name></member>
+ <member><type>uint32_t</type> <name>frame_crop_right_offset</name></member>
+ <member><type>uint32_t</type> <name>frame_crop_top_offset</name></member>
+ <member><type>uint32_t</type> <name>frame_crop_bottom_offset</name></member>
+ <member><type>uint32_t</type> <name>reserved2</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <comment>
+ pOffsetForRefFrame is a pointer representing the offset_for_ref_frame array with num_ref_frames_in_pic_order_cnt_cycle number of elements.
+ If pOffsetForRefFrame has nullptr value, then num_ref_frames_in_pic_order_cnt_cycle must also be "0".
+ </comment>
+ <member>const <type>int32_t</type>* <name>pOffsetForRefFrame</name></member>
+ <member>const <type>StdVideoH264ScalingLists</type>* <name>pScalingLists</name><comment>Must be a valid pointer if seq_scaling_matrix_present_flag is set</comment></member>
+ <member>const <type>StdVideoH264SequenceParameterSetVui</type>* <name>pSequenceParameterSetVui</name><comment>Must be a valid pointer if StdVideoH264SpsFlags:vui_parameters_present_flag is set</comment></member>
+ </type>
+ <type category="struct" name="StdVideoH264PpsFlags">
+ <member><type>uint32_t</type> <name>transform_8x8_mode_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>redundant_pic_cnt_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>constrained_intra_pred_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>deblocking_filter_control_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>weighted_pred_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>bottom_field_pic_order_in_frame_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>entropy_coding_mode_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pic_scaling_matrix_present_flag</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoH264PictureParameterSet">
+ <member><type>StdVideoH264PpsFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>seq_parameter_set_id</name></member>
+ <member><type>uint8_t</type> <name>pic_parameter_set_id</name></member>
+ <member><type>uint8_t</type> <name>num_ref_idx_l0_default_active_minus1</name></member>
+ <member><type>uint8_t</type> <name>num_ref_idx_l1_default_active_minus1</name></member>
+ <member><type>StdVideoH264WeightedBipredIdc</type> <name>weighted_bipred_idc</name></member>
+ <member><type>int8_t</type> <name>pic_init_qp_minus26</name></member>
+ <member><type>int8_t</type> <name>pic_init_qs_minus26</name></member>
+ <member><type>int8_t</type> <name>chroma_qp_index_offset</name></member>
+ <member><type>int8_t</type> <name>second_chroma_qp_index_offset</name></member>
+ <member>const <type>StdVideoH264ScalingLists</type>* <name>pScalingLists</name><comment>Must be a valid pointer if StdVideoH264PpsFlags::pic_scaling_matrix_present_flag is set.</comment></member>
+ </type>
+
+ <!-- vulkan_video_codec_h264std_decode.h enumerated types -->
+ <type name="StdVideoDecodeH264FieldOrderCount" category="enum"/>
+
+ <!-- vulkan_video_codec_h264std_decode.h structs -->
+ <type category="struct" name="StdVideoDecodeH264PictureInfoFlags">
+ <member><type>uint32_t</type> <name>field_pic_flag</name> : 1<comment>Is field picture</comment></member>
+ <member><type>uint32_t</type> <name>is_intra</name> : 1<comment>Is intra picture</comment></member>
+ <member><type>uint32_t</type> <name>IdrPicFlag</name> : 1<comment>instantaneous decoding refresh (IDR) picture</comment></member>
+ <member><type>uint32_t</type> <name>bottom_field_flag</name> : 1<comment>bottom (true) or top (false) field if field_pic_flag is set.</comment></member>
+ <member><type>uint32_t</type> <name>is_reference</name> : 1<comment>This only applies to picture info, and not to the DPB lists.</comment></member>
+ <member><type>uint32_t</type> <name>complementary_field_pair</name> : 1<comment>complementary field pair, complementary non-reference field pair, complementary reference field pair</comment></member>
+ </type>
+ <type category="struct" name="StdVideoDecodeH264PictureInfo" requires="StdVideoDecodeH264FieldOrderCount" comment="requires tag is for PicOrderCnt, which needs the enum type">
+ <member><type>StdVideoDecodeH264PictureInfoFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>seq_parameter_set_id</name><comment>Selecting SPS id from the Sequence Parameters Set</comment></member>
+ <member><type>uint8_t</type> <name>pic_parameter_set_id</name><comment>Selecting PPS id from the Picture Parameters Set</comment></member>
+ <member><type>uint8_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint8_t</type> <name>reserved2</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint16_t</type> <name>frame_num</name><comment>7.4.3 Slice header semantics</comment></member>
+ <member><type>uint16_t</type> <name>idr_pic_id</name><comment>7.4.3 Slice header semantics</comment></member>
+ <comment>
+ PicOrderCnt is based on TopFieldOrderCnt and BottomFieldOrderCnt. See 8.2.1 Decoding process for picture order count type 0 - 2
+ </comment>
+ <member><type>int32_t</type> <name>PicOrderCnt</name>[<enum>STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE</enum>]<comment>TopFieldOrderCnt and BottomFieldOrderCnt fields.</comment></member>
+ </type>
+ <type category="struct" name="StdVideoDecodeH264ReferenceInfoFlags">
+ <member><type>uint32_t</type> <name>top_field_flag</name> : 1<comment>Reference is used for top field reference.</comment></member>
+ <member><type>uint32_t</type> <name>bottom_field_flag</name> : 1<comment>Reference is used for bottom field reference.</comment></member>
+ <member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.2.5.1 Sequence of operations for decoded reference picture marking process</comment></member>
+ <member><type>uint32_t</type> <name>is_non_existing</name> : 1<comment>Must be handled in accordance with 8.2.5.2: Decoding process for gaps in frame_num</comment></member>
+ </type>
+ <type category="struct" name="StdVideoDecodeH264ReferenceInfo">
+ <member><type>StdVideoDecodeH264ReferenceInfoFlags</type> <name>flags</name></member>
+ <comment>
+ FrameNum = used_for_long_term_reference ? long_term_frame_idx : frame_num
+ </comment>
+ <member><type>uint16_t</type> <name>FrameNum</name><comment>7.4.3.3 Decoded reference picture marking semantics</comment></member>
+ <member><type>uint16_t</type> <name>reserved</name><comment>for structure members 32-bit packing/alignment</comment></member>
+ <member><type>int32_t</type> <name>PicOrderCnt</name>[<enum>STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE</enum>]<comment>TopFieldOrderCnt and BottomFieldOrderCnt fields.</comment></member>
+ </type>
+
+ <!-- vulkan_video_codec_h264std_encode.h structs -->
+ <type category="struct" name="StdVideoEncodeH264WeightTableFlags">
+ <member><type>uint32_t</type> <name>luma_weight_l0_flag</name><comment>each bit n represents the nth entry in reference list l0, n &lt;= num_ref_idx_l0_active_minus1</comment></member>
+ <member><type>uint32_t</type> <name>chroma_weight_l0_flag</name><comment>each bit n represents the nth entry in reference list l0, n &lt;= num_ref_idx_l0_active_minus1</comment></member>
+ <member><type>uint32_t</type> <name>luma_weight_l1_flag</name><comment>each bit n represents the nth entry in reference list l1, n &lt;= num_ref_idx_l1_active_minus1</comment></member>
+ <member><type>uint32_t</type> <name>chroma_weight_l1_flag</name><comment>each bit n represents the nth entry in reference list l1, n &lt;= num_ref_idx_l1_active_minus1</comment></member>
+ </type>
+
+ <type category="struct" name="StdVideoEncodeH264WeightTable">
+ <comment>
+ StdVideoEncodeH264WeightTable corresponds to the values produced by pred_weight_table() for the h.264 specification.
+ For details, refer to weighted_pred_flag, weighted_bipred_idc, pre_pred_weight_table_src and pred_weight_table().
+ </comment>
+ <member><type>StdVideoEncodeH264WeightTableFlags</type> <name>flags</name><comment></comment></member>
+ <member><type>uint8_t</type> <name>luma_log2_weight_denom</name><comment></comment></member>
+ <member><type>uint8_t</type> <name>chroma_log2_weight_denom</name><comment></comment></member>
+ <member><type>int8_t</type> <name>luma_weight_l0</name>[<enum>STD_VIDEO_H264_MAX_NUM_LIST_REF</enum>]<comment>valid entry range is [0, num_ref_idx_l0_active_minus1]</comment></member>
+ <member><type>int8_t</type> <name>luma_offset_l0</name>[<enum>STD_VIDEO_H264_MAX_NUM_LIST_REF</enum>]<comment>valid entry range is [0, num_ref_idx_l0_active_minus1]</comment></member>
+ <member><type>int8_t</type> <name>chroma_weight_l0</name>[<enum>STD_VIDEO_H264_MAX_NUM_LIST_REF</enum>][<enum>STD_VIDEO_H264_MAX_CHROMA_PLANES</enum>]<comment>[i][j]: valid entry range for i is [0, num_ref_idx_l0_active_minus1]; j = 0 for Cb, j = 1 for Cr</comment></member>
+ <member><type>int8_t</type> <name>chroma_offset_l0</name>[<enum>STD_VIDEO_H264_MAX_NUM_LIST_REF</enum>][<enum>STD_VIDEO_H264_MAX_CHROMA_PLANES</enum>]<comment>[i][j]: valid entry range for i is [0, num_ref_idx_l0_active_minus1]; j = 0 for Cb, j = 1 for Cr</comment></member>
+ <member><type>int8_t</type> <name>luma_weight_l1</name>[<enum>STD_VIDEO_H264_MAX_NUM_LIST_REF</enum>]<comment>valid entry range is [0, num_ref_idx_l1_active_minus1]</comment></member>
+ <member><type>int8_t</type> <name>luma_offset_l1</name>[<enum>STD_VIDEO_H264_MAX_NUM_LIST_REF</enum>]<comment>valid entry range is [0, num_ref_idx_l1_active_minus1]</comment></member>
+ <member><type>int8_t</type> <name>chroma_weight_l1</name>[<enum>STD_VIDEO_H264_MAX_NUM_LIST_REF</enum>][<enum>STD_VIDEO_H264_MAX_CHROMA_PLANES</enum>]<comment>[i][j]: valid entry range for i is [0, num_ref_idx_l1_active_minus1]; j = 0 for Cb, j = 1 for Cr</comment></member>
+ <member><type>int8_t</type> <name>chroma_offset_l1</name>[<enum>STD_VIDEO_H264_MAX_NUM_LIST_REF</enum>][<enum>STD_VIDEO_H264_MAX_CHROMA_PLANES</enum>]<comment>[i][j]: valid entry range for i is [0, num_ref_idx_l1_active_minus1]; j = 0 for Cb, j = 1 for Cr</comment></member>
+ </type>
+
+ <type category="struct" name="StdVideoEncodeH264SliceHeaderFlags">
+ <member><type>uint32_t</type> <name>direct_spatial_mv_pred_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>num_ref_idx_active_override_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>reserved</name> : 30</member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH264PictureInfoFlags">
+ <member><type>uint32_t</type> <name>IdrPicFlag</name> : 1</member>
+ <member><type>uint32_t</type> <name>is_reference</name> : 1<comment>A reference picture, i.e. a picture with nal_ref_idc not equal to 0, as defined in clause 3.136</comment></member>
+ <member><type>uint32_t</type> <name>no_output_of_prior_pics_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>long_term_reference_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>adaptive_ref_pic_marking_mode_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>reserved</name> : 27</member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH264ReferenceInfoFlags">
+ <member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.2.5.1 Sequence of operations for decoded reference picture marking process</comment></member>
+ <member><type>uint32_t</type> <name>reserved</name> : 31</member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH264ReferenceListsInfoFlags">
+ <member><type>uint32_t</type> <name>ref_pic_list_modification_flag_l0</name> : 1</member>
+ <member><type>uint32_t</type> <name>ref_pic_list_modification_flag_l1</name> : 1</member>
+ <member><type>uint32_t</type> <name>reserved</name> : 30</member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH264RefListModEntry">
+ <member><type>StdVideoH264ModificationOfPicNumsIdc</type> <name>modification_of_pic_nums_idc</name></member>
+ <member><type>uint16_t</type> <name>abs_diff_pic_num_minus1</name></member>
+ <member><type>uint16_t</type> <name>long_term_pic_num</name></member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH264RefPicMarkingEntry">
+ <member><type>StdVideoH264MemMgmtControlOp</type> <name>memory_management_control_operation</name></member>
+ <member><type>uint16_t</type> <name>difference_of_pic_nums_minus1</name></member>
+ <member><type>uint16_t</type> <name>long_term_pic_num</name></member>
+ <member><type>uint16_t</type> <name>long_term_frame_idx</name></member>
+ <member><type>uint16_t</type> <name>max_long_term_frame_idx_plus1</name></member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH264ReferenceListsInfo">
+ <member><type>StdVideoEncodeH264ReferenceListsInfoFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>num_ref_idx_l0_active_minus1</name></member>
+ <member><type>uint8_t</type> <name>num_ref_idx_l1_active_minus1</name></member>
+ <member><type>uint8_t</type> <name>RefPicList0</name>[STD_VIDEO_H264_MAX_NUM_LIST_REF]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H264_NO_REFERENCE_PICTURE</comment></member>
+ <member><type>uint8_t</type> <name>RefPicList1</name>[STD_VIDEO_H264_MAX_NUM_LIST_REF]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H264_NO_REFERENCE_PICTURE</comment></member>
+ <member><type>uint8_t</type> <name>refList0ModOpCount</name></member>
+ <member><type>uint8_t</type> <name>refList1ModOpCount</name></member>
+ <member><type>uint8_t</type> <name>refPicMarkingOpCount</name></member>
+ <member><type>uint8_t</type> <name>reserved1</name>[7]<comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member>const <type>StdVideoEncodeH264RefListModEntry</type>* <name>pRefList0ModOperations</name><comment>Must be a valid pointer to an array with size refList0ModOpCount if ref_pic_list_modification_flag_l0 is set and contains the RefList0 modification parameters as defined in section 7.4.3.1</comment></member>
+ <member>const <type>StdVideoEncodeH264RefListModEntry</type>* <name>pRefList1ModOperations</name><comment>Must be a valid pointer to an array with size refList1ModOpCount if ref_pic_list_modification_flag_l1 is set and contains the RefList1 modification parameters as defined in section 7.4.3.1</comment></member>
+ <member>const <type>StdVideoEncodeH264RefPicMarkingEntry</type>* <name>pRefPicMarkingOperations</name><comment>Must be a valid pointer to an array with size refPicMarkingOpCount and contains the reference picture markings as defined in section 7.4.3.3</comment></member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH264PictureInfo">
+ <member><type>StdVideoEncodeH264PictureInfoFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>seq_parameter_set_id</name><comment>Selecting SPS id from the Sequence Parameters Set</comment></member>
+ <member><type>uint8_t</type> <name>pic_parameter_set_id</name><comment>Selecting PPS from the Picture Parameters for all StdVideoEncodeH264SliceHeader(s)</comment></member>
+ <member><type>uint16_t</type> <name>idr_pic_id</name></member>
+ <member><type>StdVideoH264PictureType</type> <name>primary_pic_type</name></member>
+ <member><type>uint32_t</type> <name>frame_num</name></member>
+ <member><type>int32_t</type> <name>PicOrderCnt</name><comment>Picture order count, as defined in 8.2</comment></member>
+ <member><type>uint8_t</type> <name>temporal_id</name><comment>Temporal identifier of the picture, as defined in G.7.3.1.1 / G.7.4.1.1</comment></member>
+ <member><type>uint8_t</type> <name>reserved1</name>[3]<comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member>const <type>StdVideoEncodeH264ReferenceListsInfo</type>* <name>pRefLists</name></member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH264ReferenceInfo">
+ <member><type>StdVideoEncodeH264ReferenceInfoFlags</type> <name>flags</name></member>
+ <member><type>StdVideoH264PictureType</type> <name>primary_pic_type</name></member>
+ <member><type>uint32_t</type> <name>FrameNum</name><comment>Frame number, as defined in 8.2</comment></member>
+ <member><type>int32_t</type> <name>PicOrderCnt</name><comment>Picture order count, as defined in 8.2</comment></member>
+ <member><type>uint16_t</type> <name>long_term_pic_num</name></member>
+ <member><type>uint16_t</type> <name>long_term_frame_idx</name></member>
+ <member><type>uint8_t</type> <name>temporal_id</name><comment>Temporal identifier of the picture, as defined in G.7.3.1.1 / G.7.4.1.1</comment></member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH264SliceHeader">
+ <member><type>StdVideoEncodeH264SliceHeaderFlags</type> <name>flags</name></member>
+ <member><type>uint32_t</type> <name>first_mb_in_slice</name></member>
+ <member><type>StdVideoH264SliceType</type> <name>slice_type</name></member>
+ <member><type>int8_t</type> <name>slice_alpha_c0_offset_div2</name></member>
+ <member><type>int8_t</type> <name>slice_beta_offset_div2</name></member>
+ <member><type>int8_t</type> <name>slice_qp_delta</name></member>
+ <member><type>uint8_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>StdVideoH264CabacInitIdc</type> <name>cabac_init_idc</name></member>
+ <member><type>StdVideoH264DisableDeblockingFilterIdc</type> <name>disable_deblocking_filter_idc</name></member>
+ <member>const <type>StdVideoEncodeH264WeightTable</type>* <name>pWeightTable</name><comment></comment></member>
+ </type>
+
+ <!-- vulkan_video_codec_h265std.h enumerated types -->
+ <type name="StdVideoH265ChromaFormatIdc" category="enum"/>
+ <type name="StdVideoH265ProfileIdc" category="enum"/>
+ <type name="StdVideoH265LevelIdc" category="enum"/>
+ <type name="StdVideoH265SliceType" category="enum"/>
+ <type name="StdVideoH265PictureType" category="enum"/>
+ <type name="StdVideoH265AspectRatioIdc" category="enum"/>
+
+ <!-- vulkan_video_codec_h265std.h structs -->
+ <type category="struct" name="StdVideoH265ProfileTierLevelFlags">
+ <member><type>uint32_t</type> <name>general_tier_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>general_progressive_source_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>general_interlaced_source_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>general_non_packed_constraint_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>general_frame_only_constraint_flag</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoH265ProfileTierLevel" comment="profile_tier_level">
+ <member><type>StdVideoH265ProfileTierLevelFlags</type> <name>flags</name></member>
+ <member><type>StdVideoH265ProfileIdc</type> <name>general_profile_idc</name></member>
+ <member><type>StdVideoH265LevelIdc</type> <name>general_level_idc</name></member>
+ </type>
+ <type category="struct" name="StdVideoH265DecPicBufMgr" comment="sps_ or vps_ parameters, based on if the StdVideoH265DecPicBufMgr is used within the StdVideoH265SequenceParameterSet or StdVideoH265VideoParameterSet">
+ <member><type>uint32_t</type> <name>max_latency_increase_plus1</name>[<enum>STD_VIDEO_H265_SUBLAYERS_LIST_SIZE</enum>]<comment>represents sps_max_latency_increase_plus1 or vps_max_latency_increase_plus1</comment></member>
+ <member><type>uint8_t</type> <name>max_dec_pic_buffering_minus1</name>[<enum>STD_VIDEO_H265_SUBLAYERS_LIST_SIZE</enum>]<comment>represents sps_max_dec_pic_buffering_minus1 or vps_max_dec_pic_buffering_minus1</comment></member>
+ <member><type>uint8_t</type> <name>max_num_reorder_pics</name>[<enum>STD_VIDEO_H265_SUBLAYERS_LIST_SIZE</enum>]<comment>represents sps_max_num_reorder_pics or vps_max_num_reorder_pics</comment></member>
+ </type>
+ <type category="struct" name="StdVideoH265SubLayerHrdParameters" comment="sub_layer_hrd_parameters">
+ <member><type>uint32_t</type> <name>bit_rate_value_minus1</name>[<enum>STD_VIDEO_H265_CPB_CNT_LIST_SIZE</enum>]</member>
+ <member><type>uint32_t</type> <name>cpb_size_value_minus1</name>[<enum>STD_VIDEO_H265_CPB_CNT_LIST_SIZE</enum>]</member>
+ <member><type>uint32_t</type> <name>cpb_size_du_value_minus1</name>[<enum>STD_VIDEO_H265_CPB_CNT_LIST_SIZE</enum>]</member>
+ <member><type>uint32_t</type> <name>bit_rate_du_value_minus1</name>[<enum>STD_VIDEO_H265_CPB_CNT_LIST_SIZE</enum>]</member>
+ <member><type>uint32_t</type> <name>cbr_flag</name><comment>each bit represents a range of CpbCounts (bit 0 - cpb_cnt_minus1) per sub-layer</comment></member>
+ </type>
+ <type category="struct" name="StdVideoH265HrdFlags">
+ <member><type>uint32_t</type> <name>nal_hrd_parameters_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vcl_hrd_parameters_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sub_pic_hrd_params_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sub_pic_cpb_params_in_pic_timing_sei_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>fixed_pic_rate_general_flag</name> : 8<comment>each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1</comment></member>
+ <member><type>uint32_t</type> <name>fixed_pic_rate_within_cvs_flag</name> : 8<comment>each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1</comment></member>
+ <member><type>uint32_t</type> <name>low_delay_hrd_flag</name> : 8<comment>each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1</comment></member>
+ </type>
+ <type category="struct" name="StdVideoH265HrdParameters">
+ <member><type>StdVideoH265HrdFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>tick_divisor_minus2</name></member>
+ <member><type>uint8_t</type> <name>du_cpb_removal_delay_increment_length_minus1</name></member>
+ <member><type>uint8_t</type> <name>dpb_output_delay_du_length_minus1</name></member>
+ <member><type>uint8_t</type> <name>bit_rate_scale</name></member>
+ <member><type>uint8_t</type> <name>cpb_size_scale</name></member>
+ <member><type>uint8_t</type> <name>cpb_size_du_scale</name></member>
+ <member><type>uint8_t</type> <name>initial_cpb_removal_delay_length_minus1</name></member>
+ <member><type>uint8_t</type> <name>au_cpb_removal_delay_length_minus1</name></member>
+ <member><type>uint8_t</type> <name>dpb_output_delay_length_minus1</name></member>
+ <member><type>uint8_t</type> <name>cpb_cnt_minus1</name>[<enum>STD_VIDEO_H265_SUBLAYERS_LIST_SIZE</enum>]</member>
+ <member><type>uint16_t</type> <name>elemental_duration_in_tc_minus1</name>[<enum>STD_VIDEO_H265_SUBLAYERS_LIST_SIZE</enum>]</member>
+ <member><type>uint16_t</type> <name>reserved</name>[3]<comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member>const <type>StdVideoH265SubLayerHrdParameters</type>* <name>pSubLayerHrdParametersNal</name><comment>if flags.nal_hrd_parameters_present_flag is set, then this must be a ptr to an array of StdVideoH265SubLayerHrdParameters with a size specified by sps_max_sub_layers_minus1 + 1 or vps_max_sub_layers_minus1 + 1, depending on whether the HRD parameters are part of the SPS or VPS, respectively.</comment></member>
+ <member>const <type>StdVideoH265SubLayerHrdParameters</type>* <name>pSubLayerHrdParametersVcl</name><comment>if flags.vcl_hrd_parameters_present_flag is set, then this must be a ptr to an array of StdVideoH265SubLayerHrdParameters with a size specified by sps_max_sub_layers_minus1 + 1 or vps_max_sub_layers_minus1 + 1, depending on whether the HRD parameters are part of the SPS or VPS, respectively.</comment></member>
+ </type>
+ <type category="struct" name="StdVideoH265VpsFlags">
+ <member><type>uint32_t</type> <name>vps_temporal_id_nesting_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vps_sub_layer_ordering_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vps_timing_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vps_poc_proportional_to_timing_flag</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoH265VideoParameterSet">
+ <member><type>StdVideoH265VpsFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>vps_video_parameter_set_id</name></member>
+ <member><type>uint8_t</type> <name>vps_max_sub_layers_minus1</name></member>
+ <member><type>uint8_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint8_t</type> <name>reserved2</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint32_t</type> <name>vps_num_units_in_tick</name></member>
+ <member><type>uint32_t</type> <name>vps_time_scale</name></member>
+ <member><type>uint32_t</type> <name>vps_num_ticks_poc_diff_one_minus1</name></member>
+ <member><type>uint32_t</type> <name>reserved3</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member>const <type>StdVideoH265DecPicBufMgr</type>* <name>pDecPicBufMgr</name></member>
+ <member>const <type>StdVideoH265HrdParameters</type>* <name>pHrdParameters</name></member>
+ <member>const <type>StdVideoH265ProfileTierLevel</type>* <name>pProfileTierLevel</name></member>
+ </type>
+ <type category="struct" name="StdVideoH265ScalingLists">
+ <member><type>uint8_t</type> <name>ScalingList4x4</name>[<enum>STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS</enum>][<enum>STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS</enum>]<comment>ScalingList[ 0 ][ MatrixID ][ i ] (sizeID = 0)</comment></member>
+ <member><type>uint8_t</type> <name>ScalingList8x8</name>[<enum>STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS</enum>][<enum>STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS</enum>]<comment>ScalingList[ 1 ][ MatrixID ][ i ] (sizeID = 1)</comment></member>
+ <member><type>uint8_t</type> <name>ScalingList16x16</name>[<enum>STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS</enum>][<enum>STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS</enum>]<comment>ScalingList[ 2 ][ Matri]xID ][ i ] (sizeID = 2)</comment></member>
+ <member><type>uint8_t</type> <name>ScalingList32x32</name>[<enum>STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS</enum>][<enum>STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS</enum>]<comment>ScalingList[ 3 ][ MatrixID ][ i ] (sizeID = 3)</comment></member>
+ <member><type>uint8_t</type> <name>ScalingListDCCoef16x16</name>[<enum>STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS</enum>]<comment>scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8, sizeID = 2</comment></member>
+ <member><type>uint8_t</type> <name>ScalingListDCCoef32x32</name>[<enum>STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS</enum>]<comment>scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8. sizeID = 3</comment></member>
+ </type>
+ <type category="struct" name="StdVideoH265ShortTermRefPicSetFlags">
+ <member><type>uint32_t</type> <name>inter_ref_pic_set_prediction_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>delta_rps_sign</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoH265ShortTermRefPicSet">
+ <member><type>StdVideoH265ShortTermRefPicSetFlags</type> <name>flags</name></member>
+ <member><type>uint32_t</type> <name>delta_idx_minus1</name></member>
+ <member><type>uint16_t</type> <name>use_delta_flag</name><comment>each bit represents a use_delta_flag[j] syntax</comment></member>
+ <member><type>uint16_t</type> <name>abs_delta_rps_minus1</name></member>
+ <member><type>uint16_t</type> <name>used_by_curr_pic_flag</name><comment>each bit represents a used_by_curr_pic_flag[j] syntax</comment></member>
+ <member><type>uint16_t</type> <name>used_by_curr_pic_s0_flag</name><comment>each bit represents a used_by_curr_pic_s0_flag[i] syntax</comment></member>
+ <member><type>uint16_t</type> <name>used_by_curr_pic_s1_flag</name><comment>each bit represents a used_by_curr_pic_s1_flag[i] syntax</comment></member>
+ <member><type>uint16_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint8_t</type> <name>reserved2</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint8_t</type> <name>reserved3</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint8_t</type> <name>num_negative_pics</name></member>
+ <member><type>uint8_t</type> <name>num_positive_pics</name></member>
+ <member><type>uint16_t</type> <name>delta_poc_s0_minus1</name>[<enum>STD_VIDEO_H265_MAX_DPB_SIZE</enum>]</member>
+ <member><type>uint16_t</type> <name>delta_poc_s1_minus1</name>[<enum>STD_VIDEO_H265_MAX_DPB_SIZE</enum>]</member>
+ </type>
+ <type category="struct" name="StdVideoH265LongTermRefPicsSps">
+ <member><type>uint32_t</type> <name>used_by_curr_pic_lt_sps_flag</name><comment>each bit represents a used_by_curr_pic_lt_sps_flag[i] syntax</comment></member>
+ <member><type>uint32_t</type> <name>lt_ref_pic_poc_lsb_sps</name>[<enum>STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS</enum>]</member>
+ </type>
+ <type category="struct" name="StdVideoH265SpsVuiFlags">
+ <member><type>uint32_t</type> <name>aspect_ratio_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>overscan_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>overscan_appropriate_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>video_signal_type_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>video_full_range_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>colour_description_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>chroma_loc_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>neutral_chroma_indication_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>field_seq_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>frame_field_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>default_display_window_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vui_timing_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vui_poc_proportional_to_timing_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vui_hrd_parameters_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>bitstream_restriction_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>tiles_fixed_structure_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>motion_vectors_over_pic_boundaries_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>restricted_ref_pic_lists_flag</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoH265SequenceParameterSetVui">
+ <member><type>StdVideoH265SpsVuiFlags</type> <name>flags</name></member>
+ <member><type>StdVideoH265AspectRatioIdc</type> <name>aspect_ratio_idc</name></member>
+ <member><type>uint16_t</type> <name>sar_width</name></member>
+ <member><type>uint16_t</type> <name>sar_height</name></member>
+ <member><type>uint8_t</type> <name>video_format</name></member>
+ <member><type>uint8_t</type> <name>colour_primaries</name></member>
+ <member><type>uint8_t</type> <name>transfer_characteristics</name></member>
+ <member><type>uint8_t</type> <name>matrix_coeffs</name></member>
+ <member><type>uint8_t</type> <name>chroma_sample_loc_type_top_field</name></member>
+ <member><type>uint8_t</type> <name>chroma_sample_loc_type_bottom_field</name></member>
+ <member><type>uint8_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint8_t</type> <name>reserved2</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint16_t</type> <name>def_disp_win_left_offset</name></member>
+ <member><type>uint16_t</type> <name>def_disp_win_right_offset</name></member>
+ <member><type>uint16_t</type> <name>def_disp_win_top_offset</name></member>
+ <member><type>uint16_t</type> <name>def_disp_win_bottom_offset</name></member>
+ <member><type>uint32_t</type> <name>vui_num_units_in_tick</name></member>
+ <member><type>uint32_t</type> <name>vui_time_scale</name></member>
+ <member><type>uint32_t</type> <name>vui_num_ticks_poc_diff_one_minus1</name></member>
+ <member><type>uint16_t</type> <name>min_spatial_segmentation_idc</name></member>
+ <member><type>uint16_t</type> <name>reserved3</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint8_t</type> <name>max_bytes_per_pic_denom</name></member>
+ <member><type>uint8_t</type> <name>max_bits_per_min_cu_denom</name></member>
+ <member><type>uint8_t</type> <name>log2_max_mv_length_horizontal</name></member>
+ <member><type>uint8_t</type> <name>log2_max_mv_length_vertical</name></member>
+ <member>const <type>StdVideoH265HrdParameters</type>* <name>pHrdParameters</name></member>
+ </type>
+ <type category="struct" name="StdVideoH265PredictorPaletteEntries">
+ <member><type>uint16_t</type> <name>PredictorPaletteEntries</name>[<enum>STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE</enum>][<enum>STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE</enum>]</member>
+ </type>
+ <type category="struct" name="StdVideoH265SpsFlags">
+ <member><type>uint32_t</type> <name>sps_temporal_id_nesting_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>separate_colour_plane_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>conformance_window_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sps_sub_layer_ordering_info_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>scaling_list_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sps_scaling_list_data_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>amp_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sample_adaptive_offset_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pcm_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pcm_loop_filter_disabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>long_term_ref_pics_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sps_temporal_mvp_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>strong_intra_smoothing_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>vui_parameters_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sps_extension_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sps_range_extension_flag</name> : 1</member>
+ <comment>
+ extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS is set
+ </comment>
+ <member><type>uint32_t</type> <name>transform_skip_rotation_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>transform_skip_context_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>implicit_rdpcm_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>explicit_rdpcm_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>extended_precision_processing_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>intra_smoothing_disabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>high_precision_offsets_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>persistent_rice_adaptation_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>cabac_bypass_alignment_enabled_flag</name> : 1</member>
+ <comment>
+ extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set
+ </comment>
+ <member><type>uint32_t</type> <name>sps_scc_extension_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sps_curr_pic_ref_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>palette_mode_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sps_palette_predictor_initializers_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>intra_boundary_filtering_disabled_flag</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoH265SequenceParameterSet">
+ <member><type>StdVideoH265SpsFlags</type> <name>flags</name></member>
+ <member><type>StdVideoH265ChromaFormatIdc</type> <name>chroma_format_idc</name></member>
+ <member><type>uint32_t</type> <name>pic_width_in_luma_samples</name></member>
+ <member><type>uint32_t</type> <name>pic_height_in_luma_samples</name></member>
+ <member><type>uint8_t</type> <name>sps_video_parameter_set_id</name></member>
+ <member><type>uint8_t</type> <name>sps_max_sub_layers_minus1</name></member>
+ <member><type>uint8_t</type> <name>sps_seq_parameter_set_id</name></member>
+ <member><type>uint8_t</type> <name>bit_depth_luma_minus8</name></member>
+ <member><type>uint8_t</type> <name>bit_depth_chroma_minus8</name></member>
+ <member><type>uint8_t</type> <name>log2_max_pic_order_cnt_lsb_minus4</name></member>
+ <member><type>uint8_t</type> <name>log2_min_luma_coding_block_size_minus3</name></member>
+ <member><type>uint8_t</type> <name>log2_diff_max_min_luma_coding_block_size</name></member>
+ <member><type>uint8_t</type> <name>log2_min_luma_transform_block_size_minus2</name></member>
+ <member><type>uint8_t</type> <name>log2_diff_max_min_luma_transform_block_size</name></member>
+ <member><type>uint8_t</type> <name>max_transform_hierarchy_depth_inter</name></member>
+ <member><type>uint8_t</type> <name>max_transform_hierarchy_depth_intra</name></member>
+ <member><type>uint8_t</type> <name>num_short_term_ref_pic_sets</name></member>
+ <member><type>uint8_t</type> <name>num_long_term_ref_pics_sps</name></member>
+ <member><type>uint8_t</type> <name>pcm_sample_bit_depth_luma_minus1</name></member>
+ <member><type>uint8_t</type> <name>pcm_sample_bit_depth_chroma_minus1</name></member>
+ <member><type>uint8_t</type> <name>log2_min_pcm_luma_coding_block_size_minus3</name></member>
+ <member><type>uint8_t</type> <name>log2_diff_max_min_pcm_luma_coding_block_size</name></member>
+ <member><type>uint8_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint8_t</type> <name>reserved2</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <comment>
+ Start extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set
+ </comment>
+ <member><type>uint8_t</type> <name>palette_max_size</name></member>
+ <member><type>uint8_t</type> <name>delta_palette_max_predictor_size</name></member>
+ <member><type>uint8_t</type> <name>motion_vector_resolution_control_idc</name></member>
+ <member><type>uint8_t</type> <name>sps_num_palette_predictor_initializers_minus1</name></member>
+ <comment>
+ End extension SPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set
+ </comment>
+ <member><type>uint32_t</type> <name>conf_win_left_offset</name></member>
+ <member><type>uint32_t</type> <name>conf_win_right_offset</name></member>
+ <member><type>uint32_t</type> <name>conf_win_top_offset</name></member>
+ <member><type>uint32_t</type> <name>conf_win_bottom_offset</name></member>
+ <member>const <type>StdVideoH265ProfileTierLevel</type>* <name>pProfileTierLevel</name></member>
+ <member>const <type>StdVideoH265DecPicBufMgr</type>* <name>pDecPicBufMgr</name></member>
+ <member>const <type>StdVideoH265ScalingLists</type>* <name>pScalingLists</name><comment>Must be a valid pointer if sps_scaling_list_data_present_flag is set</comment></member>
+ <member>const <type>StdVideoH265ShortTermRefPicSet</type>* <name>pShortTermRefPicSet</name><comment>Must be a valid pointer to an array with size num_short_term_ref_pic_sets if num_short_term_ref_pic_sets is not 0.</comment></member>
+ <member>const <type>StdVideoH265LongTermRefPicsSps</type>* <name>pLongTermRefPicsSps</name><comment>Must be a valid pointer if long_term_ref_pics_present_flag is set</comment></member>
+ <member>const <type>StdVideoH265SequenceParameterSetVui</type>* <name>pSequenceParameterSetVui</name><comment>Must be a valid pointer if StdVideoH265SpsFlags:vui_parameters_present_flag is set palette_max_size</comment></member>
+ <member>const <type>StdVideoH265PredictorPaletteEntries</type>* <name>pPredictorPaletteEntries</name><comment>Must be a valid pointer if sps_palette_predictor_initializer_present_flag is set</comment></member>
+ </type>
+ <type category="struct" name="StdVideoH265PpsFlags">
+ <member><type>uint32_t</type> <name>dependent_slice_segments_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>output_flag_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>sign_data_hiding_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>cabac_init_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>constrained_intra_pred_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>transform_skip_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>cu_qp_delta_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pps_slice_chroma_qp_offsets_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>weighted_pred_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>weighted_bipred_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>transquant_bypass_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>tiles_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>entropy_coding_sync_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>uniform_spacing_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>loop_filter_across_tiles_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pps_loop_filter_across_slices_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>deblocking_filter_control_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>deblocking_filter_override_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pps_deblocking_filter_disabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pps_scaling_list_data_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>lists_modification_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>slice_segment_header_extension_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pps_extension_present_flag</name> : 1</member>
+ <comment>
+ extension PPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS is set
+ </comment>
+ <member><type>uint32_t</type> <name>cross_component_prediction_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>chroma_qp_offset_list_enabled_flag</name> : 1</member>
+ <comment>
+ extension PPS flags, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set
+ </comment>
+ <member><type>uint32_t</type> <name>pps_curr_pic_ref_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>residual_adaptive_colour_transform_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pps_slice_act_qp_offsets_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pps_palette_predictor_initializers_present_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>monochrome_palette_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pps_range_extension_flag</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoH265PictureParameterSet">
+ <member><type>StdVideoH265PpsFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>pps_pic_parameter_set_id</name></member>
+ <member><type>uint8_t</type> <name>pps_seq_parameter_set_id</name></member>
+ <member><type>uint8_t</type> <name>sps_video_parameter_set_id</name></member>
+ <member><type>uint8_t</type> <name>num_extra_slice_header_bits</name></member>
+ <member><type>uint8_t</type> <name>num_ref_idx_l0_default_active_minus1</name></member>
+ <member><type>uint8_t</type> <name>num_ref_idx_l1_default_active_minus1</name></member>
+ <member><type>int8_t</type> <name>init_qp_minus26</name></member>
+ <member><type>uint8_t</type> <name>diff_cu_qp_delta_depth</name></member>
+ <member><type>int8_t</type> <name>pps_cb_qp_offset</name></member>
+ <member><type>int8_t</type> <name>pps_cr_qp_offset</name></member>
+ <member><type>int8_t</type> <name>pps_beta_offset_div2</name></member>
+ <member><type>int8_t</type> <name>pps_tc_offset_div2</name></member>
+ <member><type>uint8_t</type> <name>log2_parallel_merge_level_minus2</name></member>
+ <comment>
+ extension PPS, valid when STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS is set
+ </comment>
+ <member><type>uint8_t</type> <name>log2_max_transform_skip_block_size_minus2</name></member>
+ <member><type>uint8_t</type> <name>diff_cu_chroma_qp_offset_depth</name></member>
+ <member><type>uint8_t</type> <name>chroma_qp_offset_list_len_minus1</name></member>
+ <member><type>int8_t</type> <name>cb_qp_offset_list</name>[<enum>STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE</enum>]</member>
+ <member><type>int8_t</type> <name>cr_qp_offset_list</name>[<enum>STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE</enum>]</member>
+ <member><type>uint8_t</type> <name>log2_sao_offset_scale_luma</name></member>
+ <member><type>uint8_t</type> <name>log2_sao_offset_scale_chroma</name></member>
+ <comment>
+ extension PPS, valid when STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS is set
+ </comment>
+ <member><type>int8_t</type> <name>pps_act_y_qp_offset_plus5</name></member>
+ <member><type>int8_t</type> <name>pps_act_cb_qp_offset_plus5</name></member>
+ <member><type>int8_t</type> <name>pps_act_cr_qp_offset_plus3</name></member>
+ <member><type>uint8_t</type> <name>pps_num_palette_predictor_initializers</name></member>
+ <member><type>uint8_t</type> <name>luma_bit_depth_entry_minus8</name></member>
+ <member><type>uint8_t</type> <name>chroma_bit_depth_entry_minus8</name></member>
+ <member><type>uint8_t</type> <name>num_tile_columns_minus1</name></member>
+ <member><type>uint8_t</type> <name>num_tile_rows_minus1</name></member>
+ <member><type>uint8_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint8_t</type> <name>reserved2</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member><type>uint16_t</type> <name>column_width_minus1</name>[<enum>STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE</enum>]</member>
+ <member><type>uint16_t</type> <name>row_height_minus1</name>[<enum>STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE</enum>]</member>
+ <member><type>uint32_t</type> <name>reserved3</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member>const <type>StdVideoH265ScalingLists</type>* <name>pScalingLists</name><comment>Must be a valid pointer if pps_scaling_list_data_present_flag is set</comment></member>
+ <member>const <type>StdVideoH265PredictorPaletteEntries</type>* <name>pPredictorPaletteEntries</name><comment>Must be a valid pointer if pps_palette_predictor_initializer_present_flag is set</comment></member>
+ </type>
+
+ <!-- vulkan_video_codec_h265std_decode.h structs -->
+ <type category="struct" name="StdVideoDecodeH265PictureInfoFlags">
+ <member><type>uint32_t</type> <name>IrapPicFlag</name> : 1</member>
+ <member><type>uint32_t</type> <name>IdrPicFlag</name> : 1</member>
+ <member><type>uint32_t</type> <name>IsReference</name> : 1</member>
+ <member><type>uint32_t</type> <name>short_term_ref_pic_set_sps_flag</name> : 1</member>
+ </type>
+ <type category="struct" name="StdVideoDecodeH265PictureInfo">
+ <member><type>StdVideoDecodeH265PictureInfoFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>sps_video_parameter_set_id</name><comment>Selecting VPS id from the Video Parameters Set</comment></member>
+ <member><type>uint8_t</type> <name>pps_seq_parameter_set_id</name><comment>Selecting SPS id from the Sequence Parameters Set</comment></member>
+ <member><type>uint8_t</type> <name>pps_pic_parameter_set_id</name><comment>Selecting PPS id from the Picture Parameters Set</comment></member>
+ <member><type>uint8_t</type> <name>NumDeltaPocsOfRefRpsIdx</name><comment>NumDeltaPocs[ RefRpsIdx ] when short_term_ref_pic_set_sps_flag = 1, otherwise 0</comment></member>
+ <member><type>int32_t</type> <name>PicOrderCntVal</name></member>
+ <member><type>uint16_t</type> <name>NumBitsForSTRefPicSetInSlice</name><comment>number of bits used in st_ref_pic_set() when short_term_ref_pic_set_sps_flag is 0otherwise set to 0.</comment></member>
+ <member><type>uint16_t</type> <name>reserved</name></member>
+ <member><type>uint8_t</type> <name>RefPicSetStCurrBefore</name>[<enum>STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE</enum>]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
+ <member><type>uint8_t</type> <name>RefPicSetStCurrAfter</name>[<enum>STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE</enum>]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
+ <member><type>uint8_t</type> <name>RefPicSetLtCurr</name>[<enum>STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE</enum>]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures representing pReferenceSlots in VkVideoDecodeInfoKHR or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
+ </type>
+ <type category="struct" name="StdVideoDecodeH265ReferenceInfoFlags">
+ <member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.3.2 Decoding process for reference picture set</comment></member>
+ <member><type>uint32_t</type> <name>unused_for_reference</name> : 1<comment>A picture that is marked as "unused for reference", derived binary value from clause 8.3.2 Decoding process for reference picture set</comment></member>
+ </type>
+ <type category="struct" name="StdVideoDecodeH265ReferenceInfo">
+ <member><type>StdVideoDecodeH265ReferenceInfoFlags</type> <name>flags</name></member>
+ <member><type>int32_t</type> <name>PicOrderCntVal</name></member>
+ </type>
+
+ <!-- vulkan_video_codec_h265std_encode.h structs -->
+ <type category="struct" name="StdVideoEncodeH265WeightTableFlags">
+ <member><type>uint16_t</type> <name>luma_weight_l0_flag</name><comment>each bit n represents the nth entry in reference list l0, n &lt;= num_ref_idx_l0_active_minus1</comment></member>
+ <member><type>uint16_t</type> <name>chroma_weight_l0_flag</name><comment>each bit n represents the nth entry in reference list l0, n &lt;= num_ref_idx_l0_active_minus1</comment></member>
+ <member><type>uint16_t</type> <name>luma_weight_l1_flag</name><comment>each bit n represents the nth entry in reference list l1, n &lt;= num_ref_idx_l1_active_minus1</comment></member>
+ <member><type>uint16_t</type> <name>chroma_weight_l1_flag</name><comment>each bit n represents the nth entry in reference list l1, n &lt;= num_ref_idx_l1_active_minus1</comment></member>
+ </type>
+
+ <type category="struct" name="StdVideoEncodeH265WeightTable">
+ <comment>
+ StdVideoEncodeH265WeightTable corresponds to the values produced by pred_weight_table() for the h.265 specification.
+ For details, refer to weighted_pred_flag, weighted_bipred_flag and pred_weight_table().
+ </comment>
+ <member><type>StdVideoEncodeH265WeightTableFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>luma_log2_weight_denom</name><comment>[0, 7]</comment></member>
+ <member><type>int8_t</type> <name>delta_chroma_log2_weight_denom</name></member>
+ <member><type>int8_t</type> <name>delta_luma_weight_l0</name>[<enum>STD_VIDEO_H265_MAX_NUM_LIST_REF</enum>]<comment>comment</comment></member>
+ <member><type>int8_t</type> <name>luma_offset_l0</name>[<enum>STD_VIDEO_H265_MAX_NUM_LIST_REF</enum>]<comment>comment</comment></member>
+ <member><type>int8_t</type> <name>delta_chroma_weight_l0</name>[<enum>STD_VIDEO_H265_MAX_NUM_LIST_REF</enum>][<enum>STD_VIDEO_H265_MAX_CHROMA_PLANES</enum>]<comment>[i][j]: valid entry range for i is [0, num_ref_idx_l0_active_minus1]; j = 0 for Cb, j = 1 for Cr</comment></member>
+ <member><type>int8_t</type> <name>delta_chroma_offset_l0</name>[<enum>STD_VIDEO_H265_MAX_NUM_LIST_REF</enum>][<enum>STD_VIDEO_H265_MAX_CHROMA_PLANES</enum>]<comment>[i][j]: valid entry range for i is [0, num_ref_idx_l0_active_minus1]; j = 0 for Cb, j = 1 for Cr</comment></member>
+ <member><type>int8_t</type> <name>delta_luma_weight_l1</name>[<enum>STD_VIDEO_H265_MAX_NUM_LIST_REF</enum>]<comment> </comment></member>
+ <member><type>int8_t</type> <name>luma_offset_l1</name>[<enum>STD_VIDEO_H265_MAX_NUM_LIST_REF</enum>]<comment> </comment></member>
+ <member><type>int8_t</type> <name>delta_chroma_weight_l1</name>[<enum>STD_VIDEO_H265_MAX_NUM_LIST_REF</enum>][<enum>STD_VIDEO_H265_MAX_CHROMA_PLANES</enum>]<comment>[i][j]: valid entry range for i is [0, num_ref_idx_l1_active_minus1]; j = 0 for Cb, j = 1 for Cr</comment></member>
+ <member><type>int8_t</type> <name>delta_chroma_offset_l1</name>[<enum>STD_VIDEO_H265_MAX_NUM_LIST_REF</enum>][<enum>STD_VIDEO_H265_MAX_CHROMA_PLANES</enum>]<comment>[i][j]: valid entry range for i is [0, num_ref_idx_l1_active_minus1]; j = 0 for Cb, j = 1 for Cr</comment></member>
+ </type>
+
+ <type category="struct" name="StdVideoEncodeH265LongTermRefPics">
+ <member><type>uint8_t</type> <name>num_long_term_sps</name></member>
+ <member><type>uint8_t</type> <name>num_long_term_pics</name></member>
+ <member><type>uint8_t</type> <name>lt_idx_sps</name>[<enum>STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS</enum>]</member>
+ <member><type>uint8_t</type> <name>poc_lsb_lt</name>[<enum>STD_VIDEO_H265_MAX_LONG_TERM_PICS</enum>]</member>
+ <member><type>uint16_t</type> <name>used_by_curr_pic_lt_flag</name><comment>each bit represents a used_by_curr_pic_lt_flag[i] syntax</comment></member>
+ <member><type>uint8_t</type> <name>delta_poc_msb_present_flag</name>[<enum>STD_VIDEO_H265_MAX_DELTA_POC</enum>]</member>
+ <member><type>uint8_t</type> <name>delta_poc_msb_cycle_lt</name>[<enum>STD_VIDEO_H265_MAX_DELTA_POC</enum>]</member>
+ </type>
+
+ <type category="struct" name="StdVideoEncodeH265SliceSegmentHeaderFlags">
+ <member><type>uint32_t</type> <name>first_slice_segment_in_pic_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>dependent_slice_segment_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>slice_sao_luma_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>slice_sao_chroma_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>num_ref_idx_active_override_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>mvd_l1_zero_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>cabac_init_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>cu_chroma_qp_offset_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>deblocking_filter_override_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>slice_deblocking_filter_disabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>collocated_from_l0_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>slice_loop_filter_across_slices_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>reserved</name> : 20</member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH265SliceSegmentHeader">
+ <member><type>StdVideoEncodeH265SliceSegmentHeaderFlags</type> <name>flags</name></member>
+ <member><type>StdVideoH265SliceType</type> <name>slice_type</name></member>
+ <member><type>uint32_t</type> <name>slice_segment_address</name></member>
+ <member><type>uint8_t</type> <name>collocated_ref_idx</name></member>
+ <member><type>uint8_t</type> <name>MaxNumMergeCand</name></member>
+ <member><type>int8_t</type> <name>slice_cb_qp_offset</name><comment>[-12, 12]</comment></member>
+ <member><type>int8_t</type> <name>slice_cr_qp_offset</name><comment>[-12, 12]</comment></member>
+ <member><type>int8_t</type> <name>slice_beta_offset_div2</name><comment>[-6, 6]</comment></member>
+ <member><type>int8_t</type> <name>slice_tc_offset_div2</name><comment>[-6, 6]</comment></member>
+ <member><type>int8_t</type> <name>slice_act_y_qp_offset</name></member>
+ <member><type>int8_t</type> <name>slice_act_cb_qp_offset</name></member>
+ <member><type>int8_t</type> <name>slice_act_cr_qp_offset</name></member>
+ <member><type>int8_t</type> <name>slice_qp_delta</name></member>
+ <member><type>uint16_t</type> <name>reserved1</name><comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member>const <type>StdVideoEncodeH265WeightTable</type>* <name>pWeightTable</name><comment></comment></member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH265ReferenceListsInfoFlags">
+ <member><type>uint32_t</type> <name>ref_pic_list_modification_flag_l0</name> : 1</member>
+ <member><type>uint32_t</type> <name>ref_pic_list_modification_flag_l1</name> : 1</member>
+ <member><type>uint32_t</type> <name>reserved</name> : 30</member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH265ReferenceListsInfo">
+ <member><type>StdVideoEncodeH265ReferenceListsInfoFlags</type> <name>flags</name></member>
+ <member><type>uint8_t</type> <name>num_ref_idx_l0_active_minus1</name></member>
+ <member><type>uint8_t</type> <name>num_ref_idx_l1_active_minus1</name></member>
+ <member><type>uint8_t</type> <name>RefPicList0</name>[STD_VIDEO_H265_MAX_NUM_LIST_REF]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
+ <member><type>uint8_t</type> <name>RefPicList1</name>[STD_VIDEO_H265_MAX_NUM_LIST_REF]<comment>slotIndex as used in VkVideoReferenceSlotInfoKHR structures or STD_VIDEO_H265_NO_REFERENCE_PICTURE</comment></member>
+ <member><type>uint8_t</type> <name>list_entry_l0</name>[STD_VIDEO_H265_MAX_NUM_LIST_REF]</member>
+ <member><type>uint8_t</type> <name>list_entry_l1</name>[STD_VIDEO_H265_MAX_NUM_LIST_REF]</member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH265PictureInfoFlags">
+ <member><type>uint32_t</type> <name>is_reference</name> : 1<comment>A reference picture, as defined in clause 3.132</comment></member>
+ <member><type>uint32_t</type> <name>IrapPicFlag</name> : 1<comment>A reference picture, as defined in clause 3.73</comment></member>
+ <member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.3.2 Decoding process for reference picture set</comment></member>
+ <member><type>uint32_t</type> <name>discardable_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>cross_layer_bla_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>pic_output_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>no_output_of_prior_pics_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>short_term_ref_pic_set_sps_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>slice_temporal_mvp_enabled_flag</name> : 1</member>
+ <member><type>uint32_t</type> <name>reserved</name> : 23</member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH265PictureInfo">
+ <member><type>StdVideoEncodeH265PictureInfoFlags</type> <name>flags</name></member>
+ <member><type>StdVideoH265PictureType</type> <name>pic_type</name></member>
+ <member><type>uint8_t</type> <name>sps_video_parameter_set_id</name><comment>Selecting VPS id from the Video Parameters Set</comment></member>
+ <member><type>uint8_t</type> <name>pps_seq_parameter_set_id</name><comment>Selecting SPS id from the Sequence Parameters Set</comment></member>
+ <member><type>uint8_t</type> <name>pps_pic_parameter_set_id</name><comment>Selecting PPS id from the Picture Parameters Set</comment></member>
+ <member><type>uint8_t</type> <name>short_term_ref_pic_set_idx</name></member>
+ <member><type>int32_t</type> <name>PicOrderCntVal</name><comment>Picture order count derived as specified in 8.3.1</comment></member>
+ <member><type>uint8_t</type> <name>TemporalId</name><comment>Temporal ID, as defined in 7.4.2.2</comment></member>
+ <member><type>uint8_t</type> <name>reserved1</name>[7]<comment>Reserved for future use and must be initialized with 0.</comment></member>
+ <member>const <type>StdVideoEncodeH265ReferenceListsInfo</type>* <name>pRefLists</name></member>
+ <member>const <type>StdVideoH265ShortTermRefPicSet</type>* <name>pShortTermRefPicSet</name><comment>Must be a valid pointer if short_term_ref_pic_set_sps_flag is not set</comment></member>
+ <member>const <type>StdVideoEncodeH265LongTermRefPics</type>* <name>pLongTermRefPics</name><comment>Must be a valid pointer if long_term_ref_pics_present_flag is set</comment></member>
+ </type>
+ <type category="struct" name="StdVideoEncodeH265ReferenceInfoFlags">
+ <member><type>uint32_t</type> <name>used_for_long_term_reference</name> : 1<comment>A picture that is marked as "used for long-term reference", derived binary value from clause 8.3.2 Decoding process for reference picture set</comment></member>
+ <member><type>uint32_t</type> <name>unused_for_reference</name> : 1<comment>A picture that is marked as "unused for reference", derived binary value from clause 8.3.2 Decoding process for reference picture set</comment></member>
+ <member><type>uint32_t</type> <name>reserved</name> : 30</member>
+ </type>
+
+ <type category="struct" name="StdVideoEncodeH265ReferenceInfo">
+ <member><type>StdVideoEncodeH265ReferenceInfoFlags</type> <name>flags</name></member>
+ <member><type>StdVideoH265PictureType</type> <name>pic_type</name></member>
+ <member><type>int32_t</type> <name>PicOrderCntVal</name><comment>Picture order count derived as specified in 8.3.1</comment></member>
+ <member><type>uint8_t</type> <name>TemporalId</name><comment>Temporal ID, as defined in 7.4.2.2</comment></member>
+ </type>
+ </types>
+
+ <!-- vulkan_video_codec_h264std.h enums -->
+ <enums name="StdVideoH264ChromaFormatIdc" type="enum">
+ <enum name="STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME" value="0"/>
+ <enum name="STD_VIDEO_H264_CHROMA_FORMAT_IDC_420" value="1"/>
+ <enum name="STD_VIDEO_H264_CHROMA_FORMAT_IDC_422" value="2"/>
+ <enum name="STD_VIDEO_H264_CHROMA_FORMAT_IDC_444" value="3"/>
+ <enum name="STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264ProfileIdc" type="enum">
+ <enum name="STD_VIDEO_H264_PROFILE_IDC_BASELINE" value="66" comment="Only constrained baseline is supported"/>
+ <enum name="STD_VIDEO_H264_PROFILE_IDC_MAIN" value="77"/>
+ <enum name="STD_VIDEO_H264_PROFILE_IDC_HIGH" value="100"/>
+ <enum name="STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE" value="244"/>
+ <enum name="STD_VIDEO_H264_PROFILE_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264LevelIdc" type="enum">
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_1_0" value="0"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_1_1" value="1"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_1_2" value="2"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_1_3" value="3"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_2_0" value="4"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_2_1" value="5"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_2_2" value="6"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_3_0" value="7"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_3_1" value="8"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_3_2" value="9"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_4_0" value="10"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_4_1" value="11"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_4_2" value="12"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_5_0" value="13"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_5_1" value="14"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_5_2" value="15"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_6_0" value="16"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_6_1" value="17"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_6_2" value="18"/>
+ <enum name="STD_VIDEO_H264_LEVEL_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264PocType" type="enum">
+ <enum name="STD_VIDEO_H264_POC_TYPE_0" value="0"/>
+ <enum name="STD_VIDEO_H264_POC_TYPE_1" value="1"/>
+ <enum name="STD_VIDEO_H264_POC_TYPE_2" value="2"/>
+ <enum name="STD_VIDEO_H264_POC_TYPE_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264AspectRatioIdc" type="enum">
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_UNSPECIFIED" value="0"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_SQUARE" value="1"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_12_11" value="2"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_10_11" value="3"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_16_11" value="4"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_40_33" value="5"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_24_11" value="6"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_20_11" value="7"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_32_11" value="8"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_80_33" value="9"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_18_11" value="10"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_15_11" value="11"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_64_33" value="12"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_160_99" value="13"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_4_3" value="14"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_3_2" value="15"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_2_1" value="16"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_EXTENDED_SAR" value="255"/>
+ <enum name="STD_VIDEO_H264_ASPECT_RATIO_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264WeightedBipredIdc" type="enum">
+ <enum name="STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_DEFAULT" value="0"/>
+ <enum name="STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT" value="1"/>
+ <enum name="STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_IMPLICIT" value="2"/>
+ <enum name="STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264ModificationOfPicNumsIdc" type="enum">
+ <enum name="STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_SUBTRACT" value="0"/>
+ <enum name="STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_ADD" value="1"/>
+ <enum name="STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_LONG_TERM" value="2"/>
+ <enum name="STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_END" value="3"/>
+ <enum name="STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264MemMgmtControlOp" type="enum">
+ <enum name="STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_END" value="0"/>
+ <enum name="STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_SHORT_TERM" value="1"/>
+ <enum name="STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_LONG_TERM" value="2"/>
+ <enum name="STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_LONG_TERM" value="3"/>
+ <enum name="STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_SET_MAX_LONG_TERM_INDEX" value="4"/>
+ <enum name="STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_ALL" value="5"/>
+ <enum name="STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_CURRENT_AS_LONG_TERM" value="6"/>
+ <enum name="STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264CabacInitIdc" type="enum">
+ <enum name="STD_VIDEO_H264_CABAC_INIT_IDC_0" value="0"/>
+ <enum name="STD_VIDEO_H264_CABAC_INIT_IDC_1" value="1"/>
+ <enum name="STD_VIDEO_H264_CABAC_INIT_IDC_2" value="2"/>
+ <enum name="STD_VIDEO_H264_CABAC_INIT_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264DisableDeblockingFilterIdc" type="enum">
+ <enum name="STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_DISABLED" value="0"/>
+ <enum name="STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_ENABLED" value="1"/>
+ <enum name="STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_PARTIAL" value="2"/>
+ <enum name="STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264SliceType" type="enum">
+ <enum name="STD_VIDEO_H264_SLICE_TYPE_P" value="0"/>
+ <enum name="STD_VIDEO_H264_SLICE_TYPE_B" value="1"/>
+ <enum name="STD_VIDEO_H264_SLICE_TYPE_I" value="2"/>
+ <comment>
+ reserved STD_VIDEO_H264_SLICE_TYPE_SP = 3
+ reserved STD_VIDEO_H264_SLICE_TYPE_SI = 4
+ </comment>
+ <enum name="STD_VIDEO_H264_SLICE_TYPE_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264PictureType" type="enum">
+ <enum name="STD_VIDEO_H264_PICTURE_TYPE_P" value="0"/>
+ <enum name="STD_VIDEO_H264_PICTURE_TYPE_B" value="1"/>
+ <enum name="STD_VIDEO_H264_PICTURE_TYPE_I" value="2"/>
+ <comment>
+ reserved STD_VIDEO_H264_PICTURE_TYPE_SP = 3
+ reserved STD_VIDEO_H264_PICTURE_TYPE_SI = 4
+ </comment>
+ <enum name="STD_VIDEO_H264_PICTURE_TYPE_IDR" value="5"/>
+ <enum name="STD_VIDEO_H264_PICTURE_TYPE_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH264NonVclNaluType" type="enum">
+ <enum name="STD_VIDEO_H264_NON_VCL_NALU_TYPE_SPS" value="0"/>
+ <enum name="STD_VIDEO_H264_NON_VCL_NALU_TYPE_PPS" value="1"/>
+ <enum name="STD_VIDEO_H264_NON_VCL_NALU_TYPE_AUD" value="2"/>
+ <enum name="STD_VIDEO_H264_NON_VCL_NALU_TYPE_PREFIX" value="3"/>
+ <enum name="STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_SEQUENCE" value="4"/>
+ <enum name="STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_STREAM" value="5"/>
+ <enum name="STD_VIDEO_H264_NON_VCL_NALU_TYPE_PRECODED" value="6"/>
+ <enum name="STD_VIDEO_H264_NON_VCL_NALU_TYPE_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+
+ <!-- vulkan_video_codec_h264std_decode.h enums -->
+ <enums name="StdVideoDecodeH264FieldOrderCount" type="enum">
+ <enum name="STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP" value="0"/>
+ <enum name="STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_BOTTOM" value="1"/>
+ <enum name="STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+
+ <!-- vulkan_video_codec_h265std.h enums -->
+ <enums name="StdVideoH265ChromaFormatIdc" type="enum">
+ <enum name="STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME" value="0"/>
+ <enum name="STD_VIDEO_H265_CHROMA_FORMAT_IDC_420" value="1"/>
+ <enum name="STD_VIDEO_H265_CHROMA_FORMAT_IDC_422" value="2"/>
+ <enum name="STD_VIDEO_H265_CHROMA_FORMAT_IDC_444" value="3"/>
+ <enum name="STD_VIDEO_H265_CHROMA_FORMAT_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH265ProfileIdc" type="enum">
+ <enum name="STD_VIDEO_H265_PROFILE_IDC_MAIN" value="1"/>
+ <enum name="STD_VIDEO_H265_PROFILE_IDC_MAIN_10" value="2"/>
+ <enum name="STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE" value="3"/>
+ <enum name="STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS" value="4"/>
+ <enum name="STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS" value="9"/>
+ <enum name="STD_VIDEO_H265_PROFILE_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH265LevelIdc" type="enum">
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_1_0" value="0"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_2_0" value="1"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_2_1" value="2"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_3_0" value="3"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_3_1" value="4"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_4_0" value="5"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_4_1" value="6"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_5_0" value="7"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_5_1" value="8"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_5_2" value="9"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_6_0" value="10"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_6_1" value="11"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_6_2" value="12"/>
+ <enum name="STD_VIDEO_H265_LEVEL_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH265SliceType" type="enum">
+ <enum name="STD_VIDEO_H265_SLICE_TYPE_B" value="0"/>
+ <enum name="STD_VIDEO_H265_SLICE_TYPE_P" value="1"/>
+ <enum name="STD_VIDEO_H265_SLICE_TYPE_I" value="2"/>
+ <enum name="STD_VIDEO_H265_SLICE_TYPE_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH265PictureType" type="enum">
+ <enum name="STD_VIDEO_H265_PICTURE_TYPE_P" value="0"/>
+ <enum name="STD_VIDEO_H265_PICTURE_TYPE_B" value="1"/>
+ <enum name="STD_VIDEO_H265_PICTURE_TYPE_I" value="2"/>
+ <enum name="STD_VIDEO_H265_PICTURE_TYPE_IDR" value="3"/>
+ <enum name="STD_VIDEO_H265_PICTURE_TYPE_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+ <enums name="StdVideoH265AspectRatioIdc" type="enum">
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_UNSPECIFIED" value="0"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_SQUARE" value="1"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_12_11" value="2"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_10_11" value="3"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_16_11" value="4"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_40_33" value="5"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_24_11" value="6"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_20_11" value="7"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_32_11" value="8"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_80_33" value="9"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_18_11" value="10"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_15_11" value="11"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_64_33" value="12"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_160_99" value="13"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_4_3" value="14"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_3_2" value="15"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_2_1" value="16"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_EXTENDED_SAR" value="255"/>
+ <enum name="STD_VIDEO_H265_ASPECT_RATIO_IDC_INVALID" value="0x7FFFFFFF"/>
+ </enums>
+
+ <extensions>
+ <extension name="vulkan_video_codecs_common" comment="protect with VULKAN_VIDEO_CODEC_COMMON_H_" supported="vulkan">
+ <require>
+ <type name="VK_MAKE_VIDEO_STD_VERSION"/>
+ <type name="stdint"/>
+ </require>
+ </extension>
+ <extension name="vulkan_video_codec_h264std" comment="protect with VULKAN_VIDEO_CODEC_H264STD_H_" supported="vulkan">
+ <require>
+ <type name="vk_video/vulkan_video_codecs_common.h"/>
+
+ <enum name="STD_VIDEO_H264_CPB_CNT_LIST_SIZE" value="32"/>
+ <enum name="STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS" value="6"/>
+ <enum name="STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS" value="16"/>
+ <enum name="STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS" value="6"/>
+ <enum name="STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS" value="64"/>
+ <enum name="STD_VIDEO_H264_MAX_NUM_LIST_REF" value="32"/>
+ <enum name="STD_VIDEO_H264_MAX_CHROMA_PLANES" value="2"/>
+ <enum name="STD_VIDEO_H264_NO_REFERENCE_PICTURE" value="0xFF"/>
+
+ <type name="StdVideoH264ChromaFormatIdc"/>
+ <type name="StdVideoH264ProfileIdc"/>
+ <type name="StdVideoH264LevelIdc"/>
+ <type name="StdVideoH264PocType"/>
+ <type name="StdVideoH264AspectRatioIdc"/>
+ <type name="StdVideoH264WeightedBipredIdc"/>
+ <type name="StdVideoH264ModificationOfPicNumsIdc"/>
+ <type name="StdVideoH264MemMgmtControlOp"/>
+ <type name="StdVideoH264CabacInitIdc"/>
+ <type name="StdVideoH264DisableDeblockingFilterIdc"/>
+ <type name="StdVideoH264SliceType"/>
+ <type name="StdVideoH264PictureType"/>
+ <type name="StdVideoH264NonVclNaluType"/>
+
+ <type name="StdVideoH264SpsVuiFlags"/>
+ <type name="StdVideoH264HrdParameters"/>
+ <type name="StdVideoH264SequenceParameterSetVui"/>
+ <type name="StdVideoH264SpsFlags"/>
+ <type name="StdVideoH264ScalingLists"/>
+ <type name="StdVideoH264SequenceParameterSet"/>
+ <type name="StdVideoH264PpsFlags"/>
+ <type name="StdVideoH264PictureParameterSet"/>
+ </require>
+ </extension>
+ <extension name="vulkan_video_codec_h264std_decode" comment="protect with VULKAN_VIDEO_CODEC_H264STD_DECODE_H_" supported="vulkan">
+ <require>
+ <type name="vk_video/vulkan_video_codec_h264std.h"/>
+
+ <type name="VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0"/>
+ <enum name="VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_SPEC_VERSION" value="VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0"/>
+ <enum name="VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_EXTENSION_NAME" value="&quot;VK_STD_vulkan_video_codec_h264_decode&quot;"/>
+
+ <enum name="STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE" value="2"/>
+
+ <type name="StdVideoDecodeH264FieldOrderCount"/>
+ <type name="StdVideoDecodeH264PictureInfoFlags"/>
+ <type name="StdVideoDecodeH264PictureInfo"/>
+ <type name="StdVideoDecodeH264ReferenceInfoFlags"/>
+ <type name="StdVideoDecodeH264ReferenceInfo"/>
+ </require>
+ </extension>
+ <extension name="vulkan_video_codec_h264std_encode" comment="protect with VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_" supported="vulkan">
+ <require>
+ <type name="vk_video/vulkan_video_codec_h264std.h"/>
+
+ <type name="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_11"/>
+ <enum name="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION" value="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_0_9_11"/>
+ <enum name="VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME" value="&quot;VK_STD_vulkan_video_codec_h264_encode&quot;"/>
+
+ <type name="StdVideoEncodeH264WeightTableFlags"/>
+ <type name="StdVideoEncodeH264WeightTable"/>
+ <type name="StdVideoEncodeH264SliceHeaderFlags"/>
+ <type name="StdVideoEncodeH264PictureInfoFlags"/>
+ <type name="StdVideoEncodeH264ReferenceInfoFlags"/>
+ <type name="StdVideoEncodeH264ReferenceListsInfoFlags"/>
+ <type name="StdVideoEncodeH264RefListModEntry"/>
+ <type name="StdVideoEncodeH264RefPicMarkingEntry"/>
+ <type name="StdVideoEncodeH264ReferenceListsInfo"/>
+ <type name="StdVideoEncodeH264PictureInfo"/>
+ <type name="StdVideoEncodeH264ReferenceInfo"/>
+ <type name="StdVideoEncodeH264SliceHeader"/>
+ </require>
+ </extension>
+ <extension name="vulkan_video_codec_h265std" comment="protect with VULKAN_VIDEO_CODEC_H265STD_H_" supported="vulkan">
+ <require>
+ <type name="vk_video/vulkan_video_codecs_common.h"/>
+
+ <enum name="STD_VIDEO_H265_CPB_CNT_LIST_SIZE" value="32"/>
+ <enum name="STD_VIDEO_H265_SUBLAYERS_LIST_SIZE" value="7"/>
+ <enum name="STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS" value="6"/>
+ <enum name="STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS" value="16"/>
+ <enum name="STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS" value="6"/>
+ <enum name="STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS" value="64"/>
+ <enum name="STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS" value="6"/>
+ <enum name="STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS" value="64"/>
+ <enum name="STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS" value="2"/>
+ <enum name="STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS" value="64"/>
+ <enum name="STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE" value="6"/>
+ <enum name="STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE" value="19"/>
+ <enum name="STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE" value="21"/>
+ <enum name="STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE" value="3"/>
+ <enum name="STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE" value="128"/>
+ <enum name="STD_VIDEO_H265_MAX_NUM_LIST_REF" value="15"/>
+ <enum name="STD_VIDEO_H265_MAX_CHROMA_PLANES" value="2"/>
+ <enum name="STD_VIDEO_H265_MAX_SHORT_TERM_REF_PIC_SETS" value="64"/>
+ <enum name="STD_VIDEO_H265_MAX_DPB_SIZE" value="16"/>
+ <enum name="STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS" value="32"/>
+ <enum name="STD_VIDEO_H265_MAX_LONG_TERM_PICS" value="16"/>
+ <enum name="STD_VIDEO_H265_MAX_DELTA_POC" value="48"/>
+ <enum name="STD_VIDEO_H265_NO_REFERENCE_PICTURE" value="0xFF"/>
+
+ <type name="StdVideoH265ChromaFormatIdc"/>
+ <type name="StdVideoH265ProfileIdc"/>
+ <type name="StdVideoH265LevelIdc"/>
+ <type name="StdVideoH265SliceType"/>
+ <type name="StdVideoH265PictureType"/>
+ <type name="StdVideoH265AspectRatioIdc"/>
+ <type name="StdVideoH265DecPicBufMgr"/>
+ <type name="StdVideoH265SubLayerHrdParameters"/>
+ <type name="StdVideoH265HrdFlags"/>
+ <type name="StdVideoH265HrdParameters"/>
+ <type name="StdVideoH265VpsFlags"/>
+ <type name="StdVideoH265ProfileTierLevelFlags"/>
+ <type name="StdVideoH265ProfileTierLevel"/>
+ <type name="StdVideoH265VideoParameterSet"/>
+ <type name="StdVideoH265ScalingLists"/>
+ <type name="StdVideoH265SpsVuiFlags"/>
+ <type name="StdVideoH265SequenceParameterSetVui"/>
+ <type name="StdVideoH265PredictorPaletteEntries"/>
+ <type name="StdVideoH265SpsFlags"/>
+ <type name="StdVideoH265ShortTermRefPicSetFlags"/>
+ <type name="StdVideoH265ShortTermRefPicSet"/>
+ <type name="StdVideoH265LongTermRefPicsSps"/>
+ <type name="StdVideoH265SequenceParameterSet"/>
+ <type name="StdVideoH265PpsFlags"/>
+ <type name="StdVideoH265PictureParameterSet"/>
+ </require>
+ </extension>
+ <extension name="vulkan_video_codec_h265std_decode" comment="protect with VULKAN_VIDEO_CODEC_H265STD_DECODE_H_" supported="vulkan">
+ <require>
+ <type name="vk_video/vulkan_video_codec_h265std.h"/>
+
+ <type name="VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0"/>
+ <enum name="VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_SPEC_VERSION" value="VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0"/>
+ <enum name="VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_EXTENSION_NAME" value="&quot;VK_STD_vulkan_video_codec_h265_decode&quot;"/>
+
+ <enum name="STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE" value="8"/>
+
+ <type name="StdVideoDecodeH265PictureInfoFlags"/>
+ <type name="StdVideoDecodeH265PictureInfo"/>
+ <type name="StdVideoDecodeH265ReferenceInfoFlags"/>
+ <type name="StdVideoDecodeH265ReferenceInfo"/>
+ </require>
+ </extension>
+ <extension name="vulkan_video_codec_h265std_encode" comment="protect with VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_" supported="vulkan">
+ <require>
+ <type name="vk_video/vulkan_video_codec_h265std.h"/>
+
+ <type name="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_12"/>
+ <enum name="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION" value="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_0_9_12"/>
+ <enum name="VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME" value="&quot;VK_STD_vulkan_video_codec_h265_encode&quot;"/>
+
+ <type name="StdVideoEncodeH265WeightTableFlags"/>
+ <type name="StdVideoEncodeH265WeightTable"/>
+ <type name="StdVideoEncodeH265SliceSegmentHeaderFlags"/>
+ <type name="StdVideoEncodeH265SliceSegmentHeader"/>
+ <type name="StdVideoEncodeH265ReferenceListsInfoFlags"/>
+ <type name="StdVideoEncodeH265ReferenceListsInfo"/>
+ <type name="StdVideoEncodeH265PictureInfoFlags"/>
+ <type name="StdVideoEncodeH265LongTermRefPics"/>
+ <type name="StdVideoEncodeH265PictureInfo"/>
+ <type name="StdVideoEncodeH265ReferenceInfoFlags"/>
+ <type name="StdVideoEncodeH265ReferenceInfo"/>
+ </require>
+ </extension>
+ </extensions>
+</registry>
diff --git a/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.xml b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.xml
new file mode 100644
index 00000000000..469ca84cf83
--- /dev/null
+++ b/src/gfxstream/codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.xml
@@ -0,0 +1,330 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<registry>
+ <comment>
+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.
+ </comment>
+
+ <comment>
+This file, vk_gfxstream.xml, is the Vulkan API Registry for gfxstream
+specific entries.
+ </comment>
+ <types comment="Vulkan type definitions">
+ <!-- b/295587347 VkNativeBufferANDROID diverged from upstream -->
+ <type category="struct" name="VkNativeBufferANDROID" structextends="VkImageCreateInfo">
+ <member values="VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
+ <member optional="true">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>VkNativeBufferUsage2ANDROID</type> <name>usage2</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="VkCreateBlobGOOGLE" structextends="VkMemoryAllocateInfo">
+ <member values="VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ <member><type>uint32_t</type> <name>blobMem</name></member>
+ <member><type>uint32_t</type> <name>blobFlags</name></member>
+ <member><type>uint64_t</type> <name>blobId</name></member>
+ </type>
+ </types>
+
+ <commands comment="Vulkan command definitions">
+ <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"><type>VkDeviceMemory</type> <name>memory</name></param>
+ <param optional="false,true"><type>uint64_t</type>* <name>pAddress</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>vkUpdateDescriptorSetWithTemplateSized2GOOGLE</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><type>uint32_t</type> <name>inlineUniformBlockCount</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>
+ <param optional="true" len="inlineUniformBlockCount">const <type>uint8_t</type>* <name>pInlineUniformBlockData</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"><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"><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>vkQueueSubmitAsync2GOOGLE</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>VkSubmitInfo2</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>vkGetLinearImageLayout2GOOGLE</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param>const <type>VkImageCreateInfo</type>* <name>pCreateInfo</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 successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
+ <proto><type>VkResult</type> <name>vkGetBlobGOOGLE</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param externsync="true"><type>VkDeviceMemory</type> <name>memory</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>
+ <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>
+ <proto><type>void</type> <name>vkQueueFlushCommandsFromAuxMemoryGOOGLE</name></proto>
+ <param externsync="true"><type>VkQueue</type> <name>queue</name></param>
+ <param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
+ <param><type>VkDeviceMemory</type> <name>deviceMemory</name></param>
+ <param><type>VkDeviceSize</type> <name>dataOffset</name></param>
+ <param><type>VkDeviceSize</type> <name>dataSize</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>
+ </commands>
+ <extensions comment="Vulkan extension interface definitions">
+ <extension name="VK_ANDROID_native_buffer" supported="vulkan"/>
+ <extension name="VK_GOOGLE_gfxstream" number="386" author="GOOGLE" contact="Lingfeng Yang @frank,Roman Kiryanov @rkir,Yilong Li @liyl_google" supported="vulkan" type="instance">
+ <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_BUFFER_GOOGLE"/>
+ <enum offset="2" extends="VkStructureType" name="VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE"/>
+ <type name="VkImportColorBufferGOOGLE"/>
+ <type name="VkImportBufferGOOGLE"/>
+ <type name="VkCreateBlobGOOGLE"/>
+ <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="vkGetLinearImageLayout2GOOGLE"/>
+ <command name="vkQueueFlushCommandsGOOGLE"/>
+ <command name="vkQueueCommitDescriptorSetUpdatesGOOGLE"/>
+ <command name="vkCollectDescriptorPoolIdsGOOGLE"/>
+ <command name="vkQueueSignalReleaseImageANDROIDAsyncGOOGLE"/>
+ <command name="vkQueueFlushCommandsFromAuxMemoryGOOGLE"/>
+ <command name="vkGetBlobGOOGLE"/>
+ <command name="vkUpdateDescriptorSetWithTemplateSized2GOOGLE"/>
+ <command name="vkQueueSubmitAsync2GOOGLE"/>
+ </require>
+ </extension>
+ <extension name="VK_MVK_moltenvk">
+ <require>
+ <command name="vkGetMTLDeviceMVK"/>
+ <command name="vkSetMTLTextureMVK"/>
+ <command name="vkGetMTLTextureMVK"/>
+ <command name="vkGetMTLBufferMVK"/>
+ <command name="vkUseIOSurfaceMVK"/>
+ <command name="vkGetIOSurfaceMVK"/>
+ </require>
+ </extension>
+ </extensions>
+</registry> \ No newline at end of file
diff --git a/src/gfxstream/common/etc/etc.cpp b/src/gfxstream/common/etc/etc.cpp
new file mode 100644
index 00000000000..18b2596ac1d
--- /dev/null
+++ b/src/gfxstream/common/etc/etc.cpp
@@ -0,0 +1,1031 @@
+// 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.
+
+#include "gfxstream/etc.h"
+
+#include <algorithm>
+#include <assert.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdio.h>
+
+typedef uint16_t etc1_uint16;
+
+/* From http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt
+
+ The number of bits that represent a 4x4 texel block is 64 bits if
+ <internalformat> is given by ETC1_RGB8_OES.
+
+ The data for a block is a number of bytes,
+
+ {q0, q1, q2, q3, q4, q5, q6, q7}
+
+ where byte q0 is located at the lowest memory address and q7 at
+ the highest. The 64 bits specifying the block is then represented
+ by the following 64 bit integer:
+
+ int64bit = 256*(256*(256*(256*(256*(256*(256*q0+q1)+q2)+q3)+q4)+q5)+q6)+q7;
+
+ ETC1_RGB8_OES:
+
+ a) bit layout in bits 63 through 32 if diffbit = 0
+
+ 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48
+ -----------------------------------------------
+ | base col1 | base col2 | base col1 | base col2 |
+ | R1 (4bits)| R2 (4bits)| G1 (4bits)| G2 (4bits)|
+ -----------------------------------------------
+
+ 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
+ ---------------------------------------------------
+ | base col1 | base col2 | table | table |diff|flip|
+ | B1 (4bits)| B2 (4bits)| cw 1 | cw 2 |bit |bit |
+ ---------------------------------------------------
+
+
+ b) bit layout in bits 63 through 32 if diffbit = 1
+
+ 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48
+ -----------------------------------------------
+ | base col1 | dcol 2 | base col1 | dcol 2 |
+ | R1' (5 bits) | dR2 | G1' (5 bits) | dG2 |
+ -----------------------------------------------
+
+ 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
+ ---------------------------------------------------
+ | base col 1 | dcol 2 | table | table |diff|flip|
+ | B1' (5 bits) | dB2 | cw 1 | cw 2 |bit |bit |
+ ---------------------------------------------------
+
+
+ c) bit layout in bits 31 through 0 (in both cases)
+
+ 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
+ -----------------------------------------------
+ | most significant pixel index bits |
+ | p| o| n| m| l| k| j| i| h| g| f| e| d| c| b| a|
+ -----------------------------------------------
+
+ 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+ --------------------------------------------------
+ | least significant pixel index bits |
+ | p| o| n| m| l| k| j| i| h| g| f| e| d| c | b | a |
+ --------------------------------------------------
+
+
+ Add table 3.17.2: Intensity modifier sets for ETC1 compressed textures:
+
+ table codeword modifier table
+ ------------------ ----------------------
+ 0 -8 -2 2 8
+ 1 -17 -5 5 17
+ 2 -29 -9 9 29
+ 3 -42 -13 13 42
+ 4 -60 -18 18 60
+ 5 -80 -24 24 80
+ 6 -106 -33 33 106
+ 7 -183 -47 47 183
+
+
+ Add table 3.17.3 Mapping from pixel index values to modifier values for
+ ETC1 compressed textures:
+
+ pixel index value
+ ---------------
+ msb lsb resulting modifier value
+ ----- ----- -------------------------
+ 1 1 -b (large negative value)
+ 1 0 -a (small negative value)
+ 0 0 a (small positive value)
+ 0 1 b (large positive value)
+
+ ETC2 codec:
+ from https://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.4.pdf
+ page 289
+ */
+
+static const int kRGBModifierTable[] = {
+/* 0 */2, 8, -2, -8,
+/* 1 */5, 17, -5, -17,
+/* 2 */9, 29, -9, -29,
+/* 3 */13, 42, -13, -42,
+/* 4 */18, 60, -18, -60,
+/* 5 */24, 80, -24, -80,
+/* 6 */33, 106, -33, -106,
+/* 7 */47, 183, -47, -183 };
+
+static const int kRGBOpaqueModifierTable[] = {
+/* 0 */0, 8, 0, -8,
+/* 1 */0, 17, 0, -17,
+/* 2 */0, 29, 0, -29,
+/* 3 */0, 42, 0, -42,
+/* 4 */0, 60, 0, -60,
+/* 5 */0, 80, 0, -80,
+/* 6 */0, 106, 0, -106,
+/* 7 */0, 183, 0, -183 };
+
+static const int kAlphaModifierTable[] = {
+/* 0 */ -3, -6, -9, -15, 2, 5, 8, 14,
+/* 1 */ -3, -7, -10, -13, 2, 6, 9, 12,
+/* 2 */ -2, -5, -8, -13, 1, 4, 7, 12,
+/* 3 */ -2, -4, -6, -13, 1, 3, 5, 12,
+/* 4 */ -3, -6, -8, -12, 2, 5, 7, 11,
+/* 5 */ -3, -7, -9, -11, 2, 6, 8, 10,
+/* 6 */ -4, -7, -8, -11, 3, 6, 7, 10,
+/* 7 */ -3, -5, -8, -11, 2, 4, 7, 10,
+/* 8 */ -2, -6, -8, -10, 1, 5, 7, 9,
+/* 9 */ -2, -5, -8, -10, 1, 4, 7, 9,
+/* 10 */ -2, -4, -8, -10, 1, 3, 7, 9,
+/* 11 */ -2, -5, -7, -10, 1, 4, 6, 9,
+/* 12 */ -3, -4, -7, -10, 2, 3, 6, 9,
+/* 13 */ -1, -2, -3, -10, 0, 1, 2, 9,
+/* 14 */ -4, -6, -8, -9, 3, 5, 7, 8,
+/* 15 */ -3, -5, -7, -9, 2, 4, 6, 8
+};
+
+static const int kLookup[8] = { 0, 1, 2, 3, -4, -3, -2, -1 };
+
+static inline int clamp(int x) {
+ return (x >= 0 ? (x < 255 ? x : 255) : 0);
+}
+
+static inline int clamp2047(int x) {
+ return (x >= 0 ? (x < 2047 ? x : 2047) : 0);
+}
+
+static inline int clampSigned1023(int x) {
+ return (x >= -1023 ? (x < 1023 ? x : 1023) : -1023);
+}
+
+static
+inline int convert4To8(int b) {
+ int c = b & 0xf;
+ return (c << 4) | c;
+}
+
+static
+inline int convert5To8(int b) {
+ int c = b & 0x1f;
+ return (c << 3) | (c >> 2);
+}
+
+static
+inline int convert6To8(int b) {
+ int c = b & 0x3f;
+ return (c << 2) | (c >> 4);
+}
+
+static
+inline int convert7To8(int b) {
+ int c = b & 0x7f;
+ return (c << 1) | (c >> 6);
+}
+
+static
+inline int divideBy255(int d) {
+ return (d + 128 + (d >> 8)) >> 8;
+}
+
+static
+inline int convert8To4(int b) {
+ int c = b & 0xff;
+ return divideBy255(c * 15);
+}
+
+static
+inline int convert8To5(int b) {
+ int c = b & 0xff;
+ return divideBy255(c * 31);
+}
+
+static
+inline int convertDiff(int base, int diff) {
+ return convert5To8((0x1f & base) + kLookup[0x7 & diff]);
+}
+static
+int isOverflowed(int base, int diff) {
+ int val = (0x1f & base) + kLookup[0x7 & diff];
+ return val < 0 || val >= 32;
+}
+
+static
+void decode_subblock(etc1_byte* pOut, int r, int g, int b, const int* table,
+ etc1_uint32 low, bool second, bool flipped, bool isPunchthroughAlpha,
+ bool opaque) {
+ int baseX = 0;
+ int baseY = 0;
+ int channels = isPunchthroughAlpha ? 4 : 3;
+ if (second) {
+ if (flipped) {
+ baseY = 2;
+ } else {
+ baseX = 2;
+ }
+ }
+ for (int i = 0; i < 8; i++) {
+ int x, y;
+ if (flipped) {
+ x = baseX + (i >> 1);
+ y = baseY + (i & 1);
+ } else {
+ x = baseX + (i >> 2);
+ y = baseY + (i & 3);
+ }
+ int k = y + (x * 4);
+ int msb = ((low >> (k + 15)) & 2);
+ int lsb = ((low >> k) & 1);
+ etc1_byte* q = pOut + channels * (x + 4 * y);
+ if (isPunchthroughAlpha && !opaque && msb && !lsb) {
+ // rgba all 0
+ memset(q, 0, 4);
+ q += 4;
+ } else {
+ int offset = lsb | msb;
+ int delta = table[offset];
+ *q++ = clamp(r + delta);
+ *q++ = clamp(g + delta);
+ *q++ = clamp(b + delta);
+ if (isPunchthroughAlpha) {
+ *q++ = 255;
+ }
+ }
+ }
+}
+
+static void etc2_T_H_index(const int* clrTable, etc1_uint32 low,
+ bool isPunchthroughAlpha, bool opaque,
+ etc1_byte* pOut) {
+ etc1_byte* q = pOut;
+ for (int y = 0; y < 4; y++) {
+ for (int x = 0; x < 4; x++) {
+ int k = y + x * 4;
+ int msb = (low >> (k + 15)) & 2;
+ int lsb = (low >> k) & 1;
+ if (isPunchthroughAlpha && !opaque && msb && !lsb) {
+ // rgba all 0
+ memset(q, 0, 4);
+ q += 4;
+ } else {
+ int offset = lsb | msb;
+ for (int c = 0; c < 3; c++) {
+ *q++ = clrTable[offset*3 + c];
+ }
+ if (isPunchthroughAlpha) {
+ *q++ = 255;
+ }
+ }
+ }
+ }
+}
+
+// ETC2 codec:
+// from https://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.4.pdf
+// page 289
+
+static void etc2_decode_block_T(etc1_uint32 high, etc1_uint32 low,
+ bool isPunchthroughAlpha, bool opaque, etc1_byte* pOut) {
+ const int LUT[] = {3, 6, 11, 16, 23, 32, 41, 64};
+ int r1, r2, g1, g2, b1, b2;
+ r1 = convert4To8((((high >> 27) & 3) << 2) | ((high >> 24) & 3));
+ g1 = convert4To8(high >> 20);
+ b1 = convert4To8(high >> 16);
+ r2 = convert4To8(high >> 12);
+ g2 = convert4To8(high >> 8);
+ b2 = convert4To8(high >> 4);
+ // 3 bits intense modifier
+ int intenseIdx = (((high >> 2) & 3) << 1) | (high & 1);
+ int intenseMod = LUT[intenseIdx];
+ int clrTable[12];
+ clrTable[0] = r1;
+ clrTable[1] = g1;
+ clrTable[2] = b1;
+ clrTable[3] = clamp(r2 + intenseMod);
+ clrTable[4] = clamp(g2 + intenseMod);
+ clrTable[5] = clamp(b2 + intenseMod);
+ clrTable[6] = r2;
+ clrTable[7] = g2;
+ clrTable[8] = b2;
+ clrTable[9] = clamp(r2 - intenseMod);
+ clrTable[10] = clamp(g2 - intenseMod);
+ clrTable[11] = clamp(b2 - intenseMod);
+ etc2_T_H_index(clrTable, low, isPunchthroughAlpha, opaque, pOut);
+}
+
+static void etc2_decode_block_H(etc1_uint32 high, etc1_uint32 low,
+ bool isPunchthroughAlpha, bool opaque, etc1_byte* pOut) {
+ const int LUT[] = {3, 6, 11, 16, 23, 32, 41, 64};
+ int r1, r2, g1, g2, b1, b2;
+ r1 = convert4To8(high >> 27);
+ g1 = convert4To8((high >> 24) << 1 | ((high >> 20) & 1));
+ b1 = convert4To8((high >> 19) << 3 | ((high >> 15) & 7));
+ r2 = convert4To8(high >> 11);
+ g2 = convert4To8(high >> 7);
+ b2 = convert4To8(high >> 3);
+ // 3 bits intense modifier
+ int intenseIdx = high & 4;
+ intenseIdx |= (high & 1) << 1;
+ intenseIdx |= (((r1 << 16) | (g1 << 8) | b1) >= ((r2 << 16) | (g2 << 8) | b2));
+ int intenseMod = LUT[intenseIdx];
+ int clrTable[12];
+ clrTable[0] = clamp(r1 + intenseMod);
+ clrTable[1] = clamp(g1 + intenseMod);
+ clrTable[2] = clamp(b1 + intenseMod);
+ clrTable[3] = clamp(r1 - intenseMod);
+ clrTable[4] = clamp(g1 - intenseMod);
+ clrTable[5] = clamp(b1 - intenseMod);
+ clrTable[6] = clamp(r2 + intenseMod);
+ clrTable[7] = clamp(g2 + intenseMod);
+ clrTable[8] = clamp(b2 + intenseMod);
+ clrTable[9] = clamp(r2 - intenseMod);
+ clrTable[10] = clamp(g2 - intenseMod);
+ clrTable[11] = clamp(b2 - intenseMod);
+ etc2_T_H_index(clrTable, low, isPunchthroughAlpha, opaque, pOut);
+}
+
+static void etc2_decode_block_P(etc1_uint32 high, etc1_uint32 low,
+ bool isPunchthroughAlpha, etc1_byte* pOut) {
+ int ro, go, bo, rh, gh, bh, rv, gv, bv;
+ uint64_t data = high;
+ data = data << 32 | low;
+ ro = convert6To8(data >> 57);
+ go = convert7To8((data >> 56 << 6) | ((data >> 49) & 63));
+ bo = convert6To8((data >> 48 << 5)
+ | (((data >> 43) & 3 ) << 3)
+ | ((data >> 39) & 7));
+ rh = convert6To8((data >> 34 << 1) | ((data >> 32) & 1));
+ gh = convert7To8(data >> 25);
+ bh = convert6To8(data >> 19);
+ rv = convert6To8(data >> 13);
+ gv = convert7To8(data >> 6);
+ bv = convert6To8(data);
+ etc1_byte* q = pOut;
+ for (int i = 0; i < 16; i++) {
+ int y = i >> 2;
+ int x = i & 3;
+ *q++ = clamp((x * (rh - ro) + y * (rv - ro) + 4 * ro + 2) >> 2);
+ *q++ = clamp((x * (gh - go) + y * (gv - go) + 4 * go + 2) >> 2);
+ *q++ = clamp((x * (bh - bo) + y * (bv - bo) + 4 * bo + 2) >> 2);
+ if (isPunchthroughAlpha) *q++ = 255;
+ }
+}
+
+// Input is an ETC1 / ETC2 compressed version of the data.
+// Output is a 4 x 4 square of 3-byte pixels in form R, G, B
+// ETC2 codec:
+// from https://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.4.pdf
+// page 289
+
+void etc2_decode_rgb_block(const etc1_byte* pIn, bool isPunchthroughAlpha,
+ etc1_byte* pOut) {
+ etc1_uint32 high = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
+ etc1_uint32 low = (pIn[4] << 24) | (pIn[5] << 16) | (pIn[6] << 8) | pIn[7];
+ bool opaque = (high >> 1) & 1;
+ int r1, r2, g1, g2, b1, b2;
+ if (isPunchthroughAlpha || high & 2) {
+ // differential
+ int rBase = high >> 27;
+ int gBase = high >> 19;
+ int bBase = high >> 11;
+ if (isOverflowed(rBase, high >> 24)) {
+ etc2_decode_block_T(high, low, isPunchthroughAlpha, opaque, pOut);
+ return;
+ }
+ if (isOverflowed(gBase, high >> 16)) {
+ etc2_decode_block_H(high, low, isPunchthroughAlpha, opaque, pOut);
+ return;
+ }
+ if (isOverflowed(bBase, high >> 8)) {
+ etc2_decode_block_P(high, low, isPunchthroughAlpha, pOut);
+ return;
+ }
+ r1 = convert5To8(rBase);
+ r2 = convertDiff(rBase, high >> 24);
+ g1 = convert5To8(gBase);
+ g2 = convertDiff(gBase, high >> 16);
+ b1 = convert5To8(bBase);
+ b2 = convertDiff(bBase, high >> 8);
+ } else {
+ // not differential
+ r1 = convert4To8(high >> 28);
+ r2 = convert4To8(high >> 24);
+ g1 = convert4To8(high >> 20);
+ g2 = convert4To8(high >> 16);
+ b1 = convert4To8(high >> 12);
+ b2 = convert4To8(high >> 8);
+ }
+ int tableIndexA = 7 & (high >> 5);
+ int tableIndexB = 7 & (high >> 2);
+ const int* rgbModifierTable = opaque || !isPunchthroughAlpha ?
+ kRGBModifierTable : kRGBOpaqueModifierTable;
+ const int* tableA = rgbModifierTable + tableIndexA * 4;
+ const int* tableB = rgbModifierTable + tableIndexB * 4;
+ bool flipped = (high & 1) != 0;
+ decode_subblock(pOut, r1, g1, b1, tableA, low, false, flipped,
+ isPunchthroughAlpha, opaque);
+ decode_subblock(pOut, r2, g2, b2, tableB, low, true, flipped,
+ isPunchthroughAlpha, opaque);
+}
+
+void eac_decode_single_channel_block(const etc1_byte* pIn,
+ int decodedElementBytes, bool isSigned,
+ etc1_byte* pOut) {
+ assert(decodedElementBytes == 1 || decodedElementBytes == 2 || decodedElementBytes == 4);
+ int base_codeword = isSigned ? reinterpret_cast<const char*>(pIn)[0]
+ : pIn[0];
+ if (base_codeword == -128) base_codeword = -127;
+ int multiplier = pIn[1] >> 4;
+ int tblIdx = pIn[1] & 15;
+ const int* table = kAlphaModifierTable + tblIdx * 8;
+ const etc1_byte* p = pIn + 2;
+ // position in a byte of the next 3-bit index:
+ // | a a a | b b b | c c c | d d d ...
+ // | byte | byte...
+ int bitOffset = 5;
+ for (int i = 0; i < 16; i ++) {
+ // flip x, y in output
+ int outIdx = (i % 4) * 4 + i / 4;
+ etc1_byte* q = pOut + outIdx * decodedElementBytes;
+
+ int modifier = 0;
+ if (bitOffset < 0) { // (Part of) the index is in the next byte.
+ modifier += p[0] << (-bitOffset);
+ p ++;
+ bitOffset += 8;
+ }
+ modifier += p[0] >> bitOffset;
+ modifier &= 7;
+ bitOffset -= 3; // move to the next index
+ if (bitOffset == -3) {
+ bitOffset = 5;
+ p++;
+ }
+ int modifierValue = table[modifier];
+ int decoded = base_codeword + modifierValue * multiplier;
+ if (decodedElementBytes == 1) {
+ *q = clamp(decoded);
+ } else { // decodedElementBytes == 4
+ decoded *= 8;
+ if (multiplier == 0) {
+ decoded += modifierValue;
+ }
+ if (isSigned) {
+ decoded = clampSigned1023(decoded);
+ reinterpret_cast<float*>(q)[0] = (float)decoded / 1023.0;
+ } else {
+ decoded += 4;
+ decoded = clamp2047(decoded);
+ reinterpret_cast<float*>(q)[0] = (float)decoded / 2047.0;
+ }
+ }
+ }
+}
+
+typedef struct {
+ etc1_uint32 high;
+ etc1_uint32 low;
+ etc1_uint32 score; // Lower is more accurate
+} etc_compressed;
+
+static
+inline void take_best(etc_compressed* a, const etc_compressed* b) {
+ if (a->score > b->score) {
+ *a = *b;
+ }
+}
+
+static
+void etc_average_colors_subblock(const etc1_byte* pIn, etc1_uint32 inMask,
+ etc1_byte* pColors, bool flipped, bool second) {
+ int r = 0;
+ int g = 0;
+ int b = 0;
+
+ if (flipped) {
+ int by = 0;
+ if (second) {
+ by = 2;
+ }
+ for (int y = 0; y < 2; y++) {
+ int yy = by + y;
+ for (int x = 0; x < 4; x++) {
+ int i = x + 4 * yy;
+ if (inMask & (1 << i)) {
+ const etc1_byte* p = pIn + i * 3;
+ r += *(p++);
+ g += *(p++);
+ b += *(p++);
+ }
+ }
+ }
+ } else {
+ int bx = 0;
+ if (second) {
+ bx = 2;
+ }
+ for (int y = 0; y < 4; y++) {
+ for (int x = 0; x < 2; x++) {
+ int xx = bx + x;
+ int i = xx + 4 * y;
+ if (inMask & (1 << i)) {
+ const etc1_byte* p = pIn + i * 3;
+ r += *(p++);
+ g += *(p++);
+ b += *(p++);
+ }
+ }
+ }
+ }
+ pColors[0] = (etc1_byte)((r + 4) >> 3);
+ pColors[1] = (etc1_byte)((g + 4) >> 3);
+ pColors[2] = (etc1_byte)((b + 4) >> 3);
+}
+
+static
+inline int square(int x) {
+ return x * x;
+}
+
+static etc1_uint32 chooseModifier(const etc1_byte* pBaseColors,
+ const etc1_byte* pIn, etc1_uint32 *pLow, int bitIndex,
+ const int* pModifierTable) {
+ etc1_uint32 bestScore = ~0;
+ int bestIndex = 0;
+ int pixelR = pIn[0];
+ int pixelG = pIn[1];
+ int pixelB = pIn[2];
+ int r = pBaseColors[0];
+ int g = pBaseColors[1];
+ int b = pBaseColors[2];
+ for (int i = 0; i < 4; i++) {
+ int modifier = pModifierTable[i];
+ int decodedG = clamp(g + modifier);
+ etc1_uint32 score = (etc1_uint32) (6 * square(decodedG - pixelG));
+ if (score >= bestScore) {
+ continue;
+ }
+ int decodedR = clamp(r + modifier);
+ score += (etc1_uint32) (3 * square(decodedR - pixelR));
+ if (score >= bestScore) {
+ continue;
+ }
+ int decodedB = clamp(b + modifier);
+ score += (etc1_uint32) square(decodedB - pixelB);
+ if (score < bestScore) {
+ bestScore = score;
+ bestIndex = i;
+ }
+ }
+ etc1_uint32 lowMask = (((bestIndex >> 1) << 16) | (bestIndex & 1))
+ << bitIndex;
+ *pLow |= lowMask;
+ return bestScore;
+}
+
+static
+void etc_encode_subblock_helper(const etc1_byte* pIn, etc1_uint32 inMask,
+ etc_compressed* pCompressed, bool flipped, bool second,
+ const etc1_byte* pBaseColors, const int* pModifierTable) {
+ int score = pCompressed->score;
+ if (flipped) {
+ int by = 0;
+ if (second) {
+ by = 2;
+ }
+ for (int y = 0; y < 2; y++) {
+ int yy = by + y;
+ for (int x = 0; x < 4; x++) {
+ int i = x + 4 * yy;
+ if (inMask & (1 << i)) {
+ score += chooseModifier(pBaseColors, pIn + i * 3,
+ &pCompressed->low, yy + x * 4, pModifierTable);
+ }
+ }
+ }
+ } else {
+ int bx = 0;
+ if (second) {
+ bx = 2;
+ }
+ for (int y = 0; y < 4; y++) {
+ for (int x = 0; x < 2; x++) {
+ int xx = bx + x;
+ int i = xx + 4 * y;
+ if (inMask & (1 << i)) {
+ score += chooseModifier(pBaseColors, pIn + i * 3,
+ &pCompressed->low, y + xx * 4, pModifierTable);
+ }
+ }
+ }
+ }
+ pCompressed->score = score;
+}
+
+static bool inRange4bitSigned(int color) {
+ return color >= -4 && color <= 3;
+}
+
+static void etc_encodeBaseColors(etc1_byte* pBaseColors,
+ const etc1_byte* pColors, etc_compressed* pCompressed) {
+ int r1, g1, b1, r2, g2, b2; // 8 bit base colors for sub-blocks
+ bool differential;
+ {
+ int r51 = convert8To5(pColors[0]);
+ int g51 = convert8To5(pColors[1]);
+ int b51 = convert8To5(pColors[2]);
+ int r52 = convert8To5(pColors[3]);
+ int g52 = convert8To5(pColors[4]);
+ int b52 = convert8To5(pColors[5]);
+
+ r1 = convert5To8(r51);
+ g1 = convert5To8(g51);
+ b1 = convert5To8(b51);
+
+ int dr = r52 - r51;
+ int dg = g52 - g51;
+ int db = b52 - b51;
+
+ differential = inRange4bitSigned(dr) && inRange4bitSigned(dg)
+ && inRange4bitSigned(db);
+ if (differential) {
+ r2 = convert5To8(r51 + dr);
+ g2 = convert5To8(g51 + dg);
+ b2 = convert5To8(b51 + db);
+ pCompressed->high |= (r51 << 27) | ((7 & dr) << 24) | (g51 << 19)
+ | ((7 & dg) << 16) | (b51 << 11) | ((7 & db) << 8) | 2;
+ }
+ }
+
+ if (!differential) {
+ int r41 = convert8To4(pColors[0]);
+ int g41 = convert8To4(pColors[1]);
+ int b41 = convert8To4(pColors[2]);
+ int r42 = convert8To4(pColors[3]);
+ int g42 = convert8To4(pColors[4]);
+ int b42 = convert8To4(pColors[5]);
+ r1 = convert4To8(r41);
+ g1 = convert4To8(g41);
+ b1 = convert4To8(b41);
+ r2 = convert4To8(r42);
+ g2 = convert4To8(g42);
+ b2 = convert4To8(b42);
+ pCompressed->high |= (r41 << 28) | (r42 << 24) | (g41 << 20) | (g42
+ << 16) | (b41 << 12) | (b42 << 8);
+ }
+ pBaseColors[0] = r1;
+ pBaseColors[1] = g1;
+ pBaseColors[2] = b1;
+ pBaseColors[3] = r2;
+ pBaseColors[4] = g2;
+ pBaseColors[5] = b2;
+}
+
+static
+void etc_encode_block_helper(const etc1_byte* pIn, etc1_uint32 inMask,
+ const etc1_byte* pColors, etc_compressed* pCompressed, bool flipped) {
+ pCompressed->score = ~0;
+ pCompressed->high = (flipped ? 1 : 0);
+ pCompressed->low = 0;
+
+ etc1_byte pBaseColors[6];
+
+ etc_encodeBaseColors(pBaseColors, pColors, pCompressed);
+
+ int originalHigh = pCompressed->high;
+
+ const int* pModifierTable = kRGBModifierTable;
+ for (int i = 0; i < 8; i++, pModifierTable += 4) {
+ etc_compressed temp;
+ temp.score = 0;
+ temp.high = originalHigh | (i << 5);
+ temp.low = 0;
+ etc_encode_subblock_helper(pIn, inMask, &temp, flipped, false,
+ pBaseColors, pModifierTable);
+ take_best(pCompressed, &temp);
+ }
+ pModifierTable = kRGBModifierTable;
+ etc_compressed firstHalf = *pCompressed;
+ for (int i = 0; i < 8; i++, pModifierTable += 4) {
+ etc_compressed temp;
+ temp.score = firstHalf.score;
+ temp.high = firstHalf.high | (i << 2);
+ temp.low = firstHalf.low;
+ etc_encode_subblock_helper(pIn, inMask, &temp, flipped, true,
+ pBaseColors + 3, pModifierTable);
+ if (i == 0) {
+ *pCompressed = temp;
+ } else {
+ take_best(pCompressed, &temp);
+ }
+ }
+}
+
+static void writeBigEndian(etc1_byte* pOut, etc1_uint32 d) {
+ pOut[0] = (etc1_byte)(d >> 24);
+ pOut[1] = (etc1_byte)(d >> 16);
+ pOut[2] = (etc1_byte)(d >> 8);
+ pOut[3] = (etc1_byte) d;
+}
+
+// Input is a 4 x 4 square of 3-byte pixels in form R, G, B
+// inmask is a 16-bit mask where bit (1 << (x + y * 4)) tells whether the corresponding (x,y)
+// pixel is valid or not. Invalid pixel color values are ignored when compressing.
+// Output is an ETC1 compressed version of the data.
+
+void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 inMask,
+ etc1_byte* pOut) {
+ etc1_byte colors[6];
+ etc1_byte flippedColors[6];
+ etc_average_colors_subblock(pIn, inMask, colors, false, false);
+ etc_average_colors_subblock(pIn, inMask, colors + 3, false, true);
+ etc_average_colors_subblock(pIn, inMask, flippedColors, true, false);
+ etc_average_colors_subblock(pIn, inMask, flippedColors + 3, true, true);
+
+ etc_compressed a, b;
+ etc_encode_block_helper(pIn, inMask, colors, &a, false);
+ etc_encode_block_helper(pIn, inMask, flippedColors, &b, true);
+ take_best(&a, &b);
+ writeBigEndian(pOut, a.high);
+ writeBigEndian(pOut + 4, a.low);
+}
+
+// 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) {
+ return (((width + 3) & ~3) * ((height + 3) & ~3)) >> 1;
+}
+
+etc1_uint32 etc_get_encoded_data_size(ETC2ImageFormat format, etc1_uint32 width,
+ etc1_uint32 height) {
+ etc1_uint32 size = ((width + 3) & ~3) * ((height + 3) & ~3);
+ switch (format) {
+ case EtcRGB8:
+ case EtcRGB8A1:
+ case EtcR11:
+ case EtcSignedR11:
+ return size >> 1;
+ case EtcRG11:
+ case EtcSignedRG11:
+ case EtcRGBA8:
+ return size;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+etc1_uint32 etc_get_decoded_pixel_size(ETC2ImageFormat format) {
+ switch (format) {
+ case EtcRGB8:
+ return 3;
+ case EtcRGBA8:
+ return 4;
+ case EtcRGB8A1:
+ case EtcR11:
+ case EtcSignedR11:
+ return 4;
+ case EtcRG11:
+ case EtcSignedRG11:
+ return 8;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+// Encode an entire image.
+// pIn - pointer to the image data. Formatted such that the Red component of
+// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset;
+// pOut - pointer to encoded data. Must be large enough to store entire encoded image.
+
+int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height,
+ etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut) {
+ if (pixelSize < 2 || pixelSize > 3) {
+ return -1;
+ }
+ static const unsigned short kYMask[] = { 0x0, 0xf, 0xff, 0xfff, 0xffff };
+ static const unsigned short kXMask[] = { 0x0, 0x1111, 0x3333, 0x7777,
+ 0xffff };
+ etc1_byte block[ETC1_DECODED_BLOCK_SIZE];
+ etc1_byte encoded[ETC1_ENCODED_BLOCK_SIZE];
+
+ etc1_uint32 encodedWidth = (width + 3) & ~3;
+ etc1_uint32 encodedHeight = (height + 3) & ~3;
+
+ for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {
+ etc1_uint32 yEnd = height - y;
+ if (yEnd > 4) {
+ yEnd = 4;
+ }
+ int ymask = kYMask[yEnd];
+ for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {
+ etc1_uint32 xEnd = width - x;
+ if (xEnd > 4) {
+ xEnd = 4;
+ }
+ int mask = ymask & kXMask[xEnd];
+ for (etc1_uint32 cy = 0; cy < yEnd; cy++) {
+ etc1_byte* q = block + (cy * 4) * 3;
+ const etc1_byte* p = pIn + pixelSize * x + stride * (y + cy);
+ if (pixelSize == 3) {
+ memcpy(q, p, xEnd * 3);
+ } else {
+ for (etc1_uint32 cx = 0; cx < xEnd; cx++) {
+ int pixel = (p[1] << 8) | p[0];
+ *q++ = convert5To8(pixel >> 11);
+ *q++ = convert6To8(pixel >> 5);
+ *q++ = convert5To8(pixel);
+ p += pixelSize;
+ }
+ }
+ }
+ etc1_encode_block(block, mask, encoded);
+ memcpy(pOut, encoded, sizeof(encoded));
+ pOut += sizeof(encoded);
+ }
+ }
+ return 0;
+}
+
+// Decode an entire image.
+// pIn - pointer to encoded data.
+// pOut - pointer to the image data. Will be written such that the Red component of
+// pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset. Must be
+// large enough to store entire image.
+
+
+int etc2_decode_image(const etc1_byte* pIn, ETC2ImageFormat format,
+ etc1_byte* pOut,
+ etc1_uint32 width, etc1_uint32 height,
+ etc1_uint32 stride) {
+ etc1_byte block[std::max({ETC1_DECODED_BLOCK_SIZE,
+ ETC2_DECODED_RGB8A1_BLOCK_SIZE,
+ EAC_DECODED_R11_BLOCK_SIZE,
+ EAC_DECODED_RG11_BLOCK_SIZE})];
+ etc1_byte alphaBlock[EAC_DECODED_ALPHA_BLOCK_SIZE];
+
+ etc1_uint32 encodedWidth = (width + 3) & ~3;
+ etc1_uint32 encodedHeight = (height + 3) & ~3;
+
+ int pixelSize = etc_get_decoded_pixel_size(format);
+ bool isSigned = (format == EtcSignedR11 || format == EtcSignedRG11);
+
+ for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {
+ etc1_uint32 yEnd = height - y;
+ if (yEnd > 4) {
+ yEnd = 4;
+ }
+ for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {
+ etc1_uint32 xEnd = width - x;
+ if (xEnd > 4) {
+ xEnd = 4;
+ }
+ switch (format) {
+ case EtcRGBA8:
+ eac_decode_single_channel_block(pIn, 1, false, alphaBlock);
+ pIn += EAC_ENCODE_ALPHA_BLOCK_SIZE;
+ // Do not break
+ // Fall through to EtcRGB8 to decode the RGB part
+ [[fallthrough]];
+ case EtcRGB8:
+ etc2_decode_rgb_block(pIn, false, block);
+ pIn += ETC1_ENCODED_BLOCK_SIZE;
+ break;
+ case EtcRGB8A1:
+ etc2_decode_rgb_block(pIn, true, block);
+ pIn += ETC1_ENCODED_BLOCK_SIZE;
+ break;
+ case EtcR11:
+ case EtcSignedR11:
+ eac_decode_single_channel_block(pIn, 4, isSigned, block);
+ pIn += EAC_ENCODE_R11_BLOCK_SIZE;
+ break;
+ case EtcRG11:
+ case EtcSignedRG11:
+ // r channel
+ eac_decode_single_channel_block(pIn, 4, isSigned, block);
+ pIn += EAC_ENCODE_R11_BLOCK_SIZE;
+ // g channel
+ eac_decode_single_channel_block(pIn, 4, isSigned,
+ block + EAC_DECODED_R11_BLOCK_SIZE);
+ pIn += EAC_ENCODE_R11_BLOCK_SIZE;
+ break;
+ default:
+ assert(0);
+ }
+ for (etc1_uint32 cy = 0; cy < yEnd; cy++) {
+ etc1_byte* p = pOut + pixelSize * x + stride * (y + cy);
+ switch (format) {
+ case EtcRGB8:
+ case EtcRGB8A1:
+ case EtcR11:
+ case EtcSignedR11: {
+ const etc1_byte* q = block + (cy * 4) * pixelSize;
+ memcpy(p, q, xEnd * pixelSize);
+ }
+ break;
+ case EtcRG11:
+ case EtcSignedRG11: {
+ const etc1_byte* r = block + cy * EAC_DECODED_R11_BLOCK_SIZE / 4;
+ const etc1_byte* g = block + cy * EAC_DECODED_R11_BLOCK_SIZE / 4 + EAC_DECODED_R11_BLOCK_SIZE;
+ int channelSize = pixelSize / 2;
+ for (etc1_uint32 cx = 0; cx < xEnd; cx++) {
+ memcpy(p, r, channelSize);
+ p += channelSize;
+ r += channelSize;
+ memcpy(p, g, channelSize);
+ p += channelSize;
+ g += channelSize;
+ }
+ }
+ break;
+ case EtcRGBA8: {
+ const etc1_byte* q = block + (cy * 4) * 3;
+ const etc1_byte* qa = alphaBlock + cy * 4;
+ for (etc1_uint32 cx = 0; cx < xEnd; cx++) {
+ // copy rgb data
+ memcpy(p, q, 3);
+ p += 3;
+ q += 3;
+ *p++ = *qa++;
+ }
+ }
+ break;
+ default:
+ assert(0);
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+static const char kMagic[] = { 'P', 'K', 'M', ' ', '1', '0' };
+
+static const etc1_uint32 ETC1_PKM_FORMAT_OFFSET = 6;
+static const etc1_uint32 ETC1_PKM_ENCODED_WIDTH_OFFSET = 8;
+static const etc1_uint32 ETC1_PKM_ENCODED_HEIGHT_OFFSET = 10;
+static const etc1_uint32 ETC1_PKM_WIDTH_OFFSET = 12;
+static const etc1_uint32 ETC1_PKM_HEIGHT_OFFSET = 14;
+
+static const etc1_uint32 ETC1_RGB_NO_MIPMAPS = 0;
+
+static void writeBEUint16(etc1_byte* pOut, etc1_uint32 data) {
+ pOut[0] = (etc1_byte) (data >> 8);
+ pOut[1] = (etc1_byte) data;
+}
+
+static etc1_uint32 readBEUint16(const etc1_byte* pIn) {
+ return (pIn[0] << 8) | pIn[1];
+}
+
+// Format a PKM header
+
+void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height) {
+ memcpy(pHeader, kMagic, sizeof(kMagic));
+ etc1_uint32 encodedWidth = (width + 3) & ~3;
+ etc1_uint32 encodedHeight = (height + 3) & ~3;
+ writeBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET, ETC1_RGB_NO_MIPMAPS);
+ writeBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET, encodedWidth);
+ writeBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET, encodedHeight);
+ writeBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET, width);
+ writeBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET, height);
+}
+
+// Check if a PKM header is correctly formatted.
+
+etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader) {
+ if (memcmp(pHeader, kMagic, sizeof(kMagic))) {
+ return false;
+ }
+ etc1_uint32 format = readBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET);
+ etc1_uint32 encodedWidth = readBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET);
+ etc1_uint32 encodedHeight = readBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET);
+ etc1_uint32 width = readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET);
+ etc1_uint32 height = readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET);
+ return format == ETC1_RGB_NO_MIPMAPS &&
+ encodedWidth >= width && encodedWidth - width < 4 &&
+ encodedHeight >= height && encodedHeight - height < 4;
+}
+
+// Read the image width from a PKM header
+
+etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader) {
+ return readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET);
+}
+
+// Read the image height from a PKM header
+
+etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader){
+ return readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET);
+}
diff --git a/src/gfxstream/common/etc/etc_unittest.cpp b/src/gfxstream/common/etc/etc_unittest.cpp
new file mode 100644
index 00000000000..e48c6d65e4e
--- /dev/null
+++ b/src/gfxstream/common/etc/etc_unittest.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 <GLcommon/etc.h>
+
+#include <gtest/gtest.h>
+#include <stdio.h>
+
+namespace {
+class Etc2Test : public ::testing::Test {
+protected:
+ static const int cRgbPatchSize = 48;
+ static const int cRgb8A1PatchSize = 64;
+ static const int cRgbEncodedSize = 8;
+ static const int cAlphaPatchSize = 16;
+ static const int cAlphaEncodedSize = 8;
+ void decodeRgbTest(const etc1_byte* bytesEncoded, const etc1_byte* expectedDecoded) {
+ etc1_byte decoded[cRgbPatchSize];
+ etc2_decode_rgb_block(bytesEncoded, false, decoded);
+ for (int i=0; i<cRgbPatchSize; i++) {
+ EXPECT_EQ(expectedDecoded[i], decoded[i]);
+ }
+ }
+ void decodeRgb8A1Test(const etc1_byte* bytesEncoded, const etc1_byte* expectedDecoded) {
+ etc1_byte decoded[cRgb8A1PatchSize];
+ etc2_decode_rgb_block(bytesEncoded, true, decoded);
+ for (int i=0; i<cRgb8A1PatchSize; i++) {
+ EXPECT_EQ(expectedDecoded[i], decoded[i]);
+ }
+ }
+ void decodeEacTest(const etc1_byte* bytesEncoded, int decodedElementBytes,
+ bool isSigned, const etc1_byte* expectedDecoded) {
+ etc1_byte decoded[cAlphaPatchSize * decodedElementBytes];
+ eac_decode_single_channel_block(bytesEncoded, decodedElementBytes, isSigned, decoded);
+ for (int i=0; i<cAlphaPatchSize * decodedElementBytes; i++) {
+ EXPECT_EQ(expectedDecoded[i], decoded[i]);
+ }
+ }
+};
+}
+
+// ETC2 rgb decoder tests.
+// The three test cases here cover T, H and planar codec, which are
+// introduced in ETC2.
+
+TEST_F(Etc2Test, ETC2T) {
+ const unsigned char encoded[cRgbEncodedSize] = {21, 101, 186, 135, 166, 238, 74, 106};
+ const unsigned char expectedDecoded[cRgbPatchSize] = {
+ 153, 102, 85, 153, 102, 85, 153, 102, 85, 153, 102, 85,
+ 171, 154, 120, 171, 154, 120, 171, 154, 120, 187, 170, 136,
+ 187, 170, 136, 171, 154, 120, 187, 170, 136, 203, 186, 152,
+ 171, 154, 120, 187, 170, 136, 203, 186, 152, 187, 170, 136};
+ decodeRgbTest((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2H) {
+ const unsigned char encoded[cRgbEncodedSize] = {110, 13, 228, 186, 119, 119, 255, 117};
+ const unsigned char expectedDecoded[cRgbPatchSize] = {
+ 198, 147, 113, 198, 147, 113, 198, 147, 113, 198, 147, 113,
+ 210, 159, 125, 198, 147, 113, 198, 147, 113, 198, 147, 113,
+ 198, 147, 113, 198, 147, 113, 198, 147, 113, 198, 147, 113,
+ 227, 210, 193, 227, 210, 193, 215, 198, 181, 215, 198, 181};
+ decodeRgbTest((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2P) {
+ const unsigned char encoded[cRgbEncodedSize] = {89, 138, 250, 79, 120, 181, 146, 29};
+ const unsigned char expectedDecoded[cRgbPatchSize] = {
+ 178, 139, 113, 173, 134, 107, 168, 130, 101, 163, 125, 95,
+ 178, 141, 114, 173, 136, 108, 168, 131, 102, 163, 126, 96,
+ 178, 142, 115, 173, 137, 109, 168, 133, 103, 163, 128, 97,
+ 178, 144, 116, 173, 139, 110, 168, 134, 104, 163, 129, 98};
+ decodeRgbTest((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+// EAC alpha decoder tests.
+TEST_F(Etc2Test, EAC_Alpha) {
+ const unsigned char encoded[cAlphaEncodedSize]
+ = {101, 65, 229, 178, 147, 5, 32, 2};
+ const unsigned char expectedDecoded[cAlphaPatchSize] = {
+ 149, 73, 89, 89,
+ 73, 61, 73, 89,
+ 49, 61, 61, 89,
+ 49, 49, 61, 61};
+ decodeEacTest((const etc1_byte*)encoded, 1, false,
+ (const etc1_byte*)expectedDecoded);
+}
+
+// EAC 16bit decoder tests.
+TEST_F(Etc2Test, DISABLED_EAC_R11_0) {
+ const int elementBytes = 2;
+ const unsigned char encoded[cAlphaEncodedSize]
+ = {0, 0, 36, 146, 73, 36, 146, 73};
+ const unsigned char expectedDecoded[cAlphaPatchSize * elementBytes] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0};
+ decodeEacTest((const etc1_byte*)encoded, elementBytes, false,
+ (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, DISABLED_EAC_R11_NonZero) {
+ const int elementBytes = 2;
+ const unsigned char encoded[cAlphaEncodedSize]
+ = {45, 16, 23, 116, 38, 100, 86, 208};
+ const unsigned char expectedDecoded[cAlphaPatchSize * elementBytes] = {
+ 133, 42, 132, 36, 131, 30, 131, 30,
+ 134, 50, 133, 42, 132, 39, 131, 30,
+ 134, 53, 133, 47, 133, 42, 132, 36,
+ 135, 59, 134, 53, 134, 50, 133, 42};
+ decodeEacTest((const etc1_byte*)encoded, elementBytes, false,
+ (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, DISABLED_EAC_SIGNED_R11) {
+ const int elementBytes = 2;
+ const unsigned char encoded[cAlphaEncodedSize]
+ = {198, 123, 74, 150, 120, 104, 6, 137};
+ const unsigned char expectedDecoded[cAlphaPatchSize * elementBytes] = {
+ 230, 148, 1, 128, 1, 128, 1, 128,
+ 230, 148, 233, 162, 230, 148, 230, 148,
+ 249, 225, 1, 5, 238, 183, 233, 162,
+ 233, 162, 238, 183, 238, 183, 233, 162};
+ decodeEacTest((const etc1_byte*)encoded, elementBytes, true,
+ (const etc1_byte*)expectedDecoded);
+}
+
+// ETC2 RGB8A1 and sRGB8A1 tests.
+TEST_F(Etc2Test, ETC2RGB8A1_All0) {
+ const unsigned char encoded[cRgbEncodedSize] = {0, 0, 0, 0, 255, 255, 0, 0};
+ const unsigned char expectedDecoded[cRgb8A1PatchSize] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ decodeRgb8A1Test((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2RGB8A1_OP1_diff_flipped) {
+ const unsigned char encoded[cRgbEncodedSize] = {76, 206, 232, 35, 126, 232, 34, 21};
+ unsigned char expectedDecoded[cRgb8A1PatchSize] = {
+ 91, 223, 255, 255, 91, 223, 255, 255, 79, 211, 244, 255, 69, 201, 234, 255,
+ 79, 211, 244, 255, 69, 201, 234, 255, 57, 189, 222, 255, 57, 189, 222, 255,
+ 49, 197, 247, 255, 39, 187, 237, 255, 39, 187, 237, 255, 39, 187, 237, 255,
+ 39, 187, 237, 255, 39, 187, 237, 255, 39, 187, 237, 255, 43, 191, 241, 255};
+ decodeRgb8A1Test((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2RGB8A1_OP1_T) {
+ const unsigned char encoded[cRgbEncodedSize] = {4, 90, 75, 238, 98, 49, 81, 32};
+ unsigned char expectedDecoded[cRgb8A1PatchSize] = {
+ 68, 187, 238, 255, 68, 187, 238, 255, 109, 228, 255, 255, 109, 228, 255, 255,
+ 0, 85, 170, 255, 27, 146, 197, 255, 68, 187, 238, 255, 68, 187, 238, 255,
+ 0, 85, 170, 255, 0, 85, 170, 255, 0, 85, 170, 255, 27, 146, 197, 255,
+ 0, 85, 170, 255, 0, 85, 170, 255, 0, 85, 170, 255, 0, 85, 170, 255};
+ decodeRgb8A1Test((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2RGB8A1_OP1_H) {
+ const unsigned char encoded[cRgbEncodedSize] = {54, 251, 38, 114, 55, 126, 64, 133};
+ unsigned char expectedDecoded[cRgb8A1PatchSize] = {
+ 96, 215, 232, 255, 74, 210, 244, 255, 74, 210, 244, 255, 74, 210, 244, 255,
+ 74, 210, 244, 255, 74, 210, 244, 255, 74, 210, 244, 255, 74, 210, 244, 255,
+ 62, 198, 232, 255, 74, 210, 244, 255, 74, 210, 244, 255, 96, 215, 232, 255,
+ 74, 210, 244, 255, 96, 215, 232, 255, 108, 227, 244, 255, 108, 227, 244, 255};
+ decodeRgb8A1Test((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2RGB8A1_OP1_Planar) {
+ const unsigned char encoded[cRgbEncodedSize] = {133, 15, 243, 23, 187, 211, 189, 62};
+ unsigned char expectedDecoded[cRgb8A1PatchSize] = {
+ 8, 143, 219, 255, 17, 154, 223, 255, 26, 165, 227, 255, 35, 176, 231, 255,
+ 35, 166, 227, 255, 44, 177, 231, 255, 53, 188, 235, 255, 62, 199, 239, 255,
+ 63, 188, 235, 255, 72, 199, 239, 255, 81, 210, 243, 255, 90, 221, 247, 255,
+ 90, 211, 243, 255, 99, 222, 247, 255, 108, 233, 251, 255, 117, 244, 255, 255};
+ decodeRgb8A1Test((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2RGB8A1_OP0_diff_noflipped) {
+ const unsigned char encoded[cRgbEncodedSize] = {118, 223, 240, 4, 193, 19, 210, 0};
+ unsigned char expectedDecoded[cRgb8A1PatchSize] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 231, 255, 255,
+ 0, 0, 0, 0, 115, 222, 247, 255, 116, 231, 255, 255, 99, 214, 247, 255,
+ 115, 222, 247, 255, 115, 222, 247, 255, 99, 214, 247, 255, 82, 197, 230, 255,
+ 115, 222, 247, 255, 115, 222, 247, 255, 99, 214, 247, 255, 82, 197, 230, 255};
+ decodeRgb8A1Test((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2RGB8A1_OP0_T) {
+ const unsigned char encoded[cRgbEncodedSize] = {6, 173, 5, 168, 230, 102, 76, 128};
+ unsigned char expectedDecoded[cRgb8A1PatchSize] = {
+ 34, 170, 221, 255, 34, 170, 221, 255, 34, 170, 221, 255, 34, 170, 221, 255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 147, 255, 0, 62, 147, 255,
+ 34, 170, 221, 255, 23, 108, 193, 255, 23, 108, 193, 255, 0, 0, 0, 0};
+ decodeRgb8A1Test((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2RGB8A1_OP0_H) {
+ const unsigned char encoded[cRgbEncodedSize] = {149, 14, 131, 89, 19, 55, 117, 81};
+ unsigned char expectedDecoded[cRgb8A1PatchSize] = {
+ 0, 86, 171, 255, 0, 86, 171, 255, 0, 86, 171, 255, 0, 86, 171, 255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 154, 205, 255,
+ 0, 0, 0, 0, 18, 154, 205, 255, 18, 154, 205, 255, 18, 154, 205, 255,
+ 50, 186, 237, 255, 50, 186, 237, 255, 50, 186, 237, 255, 50, 186, 237, 255};
+ decodeRgb8A1Test((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
+
+TEST_F(Etc2Test, ETC2RGB8A1_OP0_Planer) {
+ const unsigned char encoded[cRgbEncodedSize] = {35, 73, 249, 152, 191, 212, 60, 253};
+ unsigned char expectedDecoded[cRgb8A1PatchSize] = {
+ 69, 201, 239, 255, 64, 199, 238, 255, 59, 196, 237, 255, 53, 194, 236, 255,
+ 85, 209, 241, 255, 80, 206, 240, 255, 75, 204, 239, 255, 70, 201, 238, 255,
+ 102, 216, 243, 255, 96, 214, 242, 255, 91, 211, 241, 255, 86, 209, 240, 255,
+ 118, 224, 245, 255, 113, 221, 244, 255, 107, 219, 243, 255, 102, 216, 242, 255};
+ decodeRgb8A1Test((const etc1_byte*)encoded, (const etc1_byte*)expectedDecoded);
+}
diff --git a/src/gfxstream/common/etc/include/gfxstream/etc.h b/src/gfxstream/common/etc/include/gfxstream/etc.h
new file mode 100644
index 00000000000..7d43c891cc4
--- /dev/null
+++ b/src/gfxstream/common/etc/include/gfxstream/etc.h
@@ -0,0 +1,130 @@
+// 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.
+
+#pragma once
+
+#define MAX_ETC_SUPPORTED 12
+
+#define ETC1_ENCODED_BLOCK_SIZE 8
+#define ETC1_DECODED_BLOCK_SIZE 48
+#define ETC2_DECODED_RGB8A1_BLOCK_SIZE 64
+#define EAC_ENCODE_ALPHA_BLOCK_SIZE 8
+#define EAC_DECODED_ALPHA_BLOCK_SIZE 16
+#define EAC_ENCODE_R11_BLOCK_SIZE 8
+#define EAC_DECODED_R11_BLOCK_SIZE 64
+#define EAC_DECODED_RG11_BLOCK_SIZE (EAC_DECODED_R11_BLOCK_SIZE*2)
+
+#ifndef ETC1_RGB8_OES
+#define ETC1_RGB8_OES 0x8D64
+#endif
+
+typedef unsigned char etc1_byte;
+typedef int etc1_bool;
+typedef unsigned int etc1_uint32;
+
+enum ETC2ImageFormat {
+ EtcRGB8, EtcRGBA8, EtcR11, EtcSignedR11, EtcRG11, EtcSignedRG11, EtcRGB8A1
+};
+
+#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 rgb pixels.
+//
+// pIn is an ETC2 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 etc2_decode_rgb_block(const etc1_byte* pIn, bool isPunchthroughAlpha, etc1_byte* pOut);
+
+// Decode a block of single channel pixels
+// This is used when decoding the alpha channel of RGBA8_ETC2_EAC format, or
+// when decoding R11_EAC format
+// decodedElementBytes: number of bits per element after decoding.
+// For RGBA8_ETC2_EAC it must be 1, for R11_EAC it must be 2
+
+void eac_decode_single_channel_block(const etc1_byte* pIn,
+ int decodedElementBytes, bool isSigned,
+ 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);
+
+etc1_uint32 etc_get_encoded_data_size(ETC2ImageFormat format, etc1_uint32 width,
+ etc1_uint32 height);
+etc1_uint32 etc_get_decoded_pixel_size(ETC2ImageFormat format);
+
+// 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=3 for rgb images, pixelSize=4 for images with alpha channel)
+// returns non-zero if there is an error.
+
+int etc2_decode_image(const etc1_byte* pIn, ETC2ImageFormat format,
+ etc1_byte* pOut,
+ etc1_uint32 width, etc1_uint32 height,
+ 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
diff --git a/src/gfxstream/common/etc/meson.build b/src/gfxstream/common/etc/meson.build
new file mode 100644
index 00000000000..2c3a9ceb1e8
--- /dev/null
+++ b/src/gfxstream/common/etc/meson.build
@@ -0,0 +1,14 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_etc = include_directories('include')
+
+files_lib_etc = files(
+ 'etc.cpp',
+)
+
+lib_etc = static_library(
+ 'etc',
+ files_lib_etc,
+ include_directories: [inc_etc],
+)
diff --git a/src/gfxstream/common/meson.build b/src/gfxstream/common/meson.build
new file mode 100644
index 00000000000..276369210f6
--- /dev/null
+++ b/src/gfxstream/common/meson.build
@@ -0,0 +1,4 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+subdir('etc')
diff --git a/src/gfxstream/common/vulkan/CMakeLists.txt b/src/gfxstream/common/vulkan/CMakeLists.txt
new file mode 100644
index 00000000000..acf5e3744ec
--- /dev/null
+++ b/src/gfxstream/common/vulkan/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_library(gfxstream_vulkan_headers INTERFACE)
+target_include_directories(
+ gfxstream_vulkan_headers
+ INTERFACE include)
diff --git a/src/gfxstream/common/vulkan/include/vulkan/vk_enum_string_helper.h b/src/gfxstream/common/vulkan/include/vulkan/vk_enum_string_helper.h
new file mode 100644
index 00000000000..03d75925da0
--- /dev/null
+++ b/src/gfxstream/common/vulkan/include/vulkan/vk_enum_string_helper.h
@@ -0,0 +1,8854 @@
+// *** THIS FILE IS GENERATED - DO NOT EDIT ***
+// See helper_file_generator.py for modifications
+
+
+/***************************************************************************
+ *
+ * Copyright (c) 2015-2021 The Khronos Group Inc.
+ * Copyright (c) 2015-2021 Valve Corporation
+ * Copyright (c) 2015-2021 LunarG, Inc.
+ * Copyright (c) 2015-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.
+ *
+ * Author: Mark Lobodzinski <mark@lunarg.com>
+ * Author: Courtney Goeltzenleuchter <courtneygo@google.com>
+ * Author: Tobin Ehlis <tobine@google.com>
+ * Author: Chris Forbes <chrisforbes@google.com>
+ * Author: John Zulauf<jzulauf@lunarg.com>
+ *
+ ****************************************************************************/
+
+
+#pragma once
+#ifdef _MSC_VER
+#pragma warning( disable : 4065 )
+#endif
+
+#include <string>
+#include <vulkan/vulkan.h>
+
+
+static inline const char* string_VkResult(VkResult input_value)
+{
+ switch (input_value)
+ {
+ case VK_ERROR_DEVICE_LOST:
+ return "VK_ERROR_DEVICE_LOST";
+ case VK_ERROR_EXTENSION_NOT_PRESENT:
+ return "VK_ERROR_EXTENSION_NOT_PRESENT";
+ case VK_ERROR_FEATURE_NOT_PRESENT:
+ return "VK_ERROR_FEATURE_NOT_PRESENT";
+ case VK_ERROR_FORMAT_NOT_SUPPORTED:
+ return "VK_ERROR_FORMAT_NOT_SUPPORTED";
+ case VK_ERROR_FRAGMENTATION:
+ return "VK_ERROR_FRAGMENTATION";
+ case VK_ERROR_FRAGMENTED_POOL:
+ return "VK_ERROR_FRAGMENTED_POOL";
+ case VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT:
+ return "VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT";
+ case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR:
+ return "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR";
+ case VK_ERROR_INCOMPATIBLE_DRIVER:
+ return "VK_ERROR_INCOMPATIBLE_DRIVER";
+ case VK_ERROR_INITIALIZATION_FAILED:
+ return "VK_ERROR_INITIALIZATION_FAILED";
+ case VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT:
+ return "VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT";
+ case VK_ERROR_INVALID_EXTERNAL_HANDLE:
+ return "VK_ERROR_INVALID_EXTERNAL_HANDLE";
+ case VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS:
+ return "VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS";
+ case VK_ERROR_INVALID_SHADER_NV:
+ return "VK_ERROR_INVALID_SHADER_NV";
+ case VK_ERROR_LAYER_NOT_PRESENT:
+ return "VK_ERROR_LAYER_NOT_PRESENT";
+ case VK_ERROR_MEMORY_MAP_FAILED:
+ return "VK_ERROR_MEMORY_MAP_FAILED";
+ case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR:
+ return "VK_ERROR_NATIVE_WINDOW_IN_USE_KHR";
+ case VK_ERROR_NOT_PERMITTED_EXT:
+ return "VK_ERROR_NOT_PERMITTED_EXT";
+ case VK_ERROR_OUT_OF_DATE_KHR:
+ return "VK_ERROR_OUT_OF_DATE_KHR";
+ case VK_ERROR_OUT_OF_DEVICE_MEMORY:
+ return "VK_ERROR_OUT_OF_DEVICE_MEMORY";
+ case VK_ERROR_OUT_OF_HOST_MEMORY:
+ return "VK_ERROR_OUT_OF_HOST_MEMORY";
+ case VK_ERROR_OUT_OF_POOL_MEMORY:
+ return "VK_ERROR_OUT_OF_POOL_MEMORY";
+ case VK_ERROR_SURFACE_LOST_KHR:
+ return "VK_ERROR_SURFACE_LOST_KHR";
+ case VK_ERROR_TOO_MANY_OBJECTS:
+ return "VK_ERROR_TOO_MANY_OBJECTS";
+ case VK_ERROR_UNKNOWN:
+ return "VK_ERROR_UNKNOWN";
+ case VK_ERROR_VALIDATION_FAILED_EXT:
+ return "VK_ERROR_VALIDATION_FAILED_EXT";
+ case VK_EVENT_RESET:
+ return "VK_EVENT_RESET";
+ case VK_EVENT_SET:
+ return "VK_EVENT_SET";
+ case VK_INCOMPLETE:
+ return "VK_INCOMPLETE";
+ case VK_NOT_READY:
+ return "VK_NOT_READY";
+ case VK_OPERATION_DEFERRED_KHR:
+ return "VK_OPERATION_DEFERRED_KHR";
+ case VK_OPERATION_NOT_DEFERRED_KHR:
+ return "VK_OPERATION_NOT_DEFERRED_KHR";
+ case VK_PIPELINE_COMPILE_REQUIRED_EXT:
+ return "VK_PIPELINE_COMPILE_REQUIRED_EXT";
+ case VK_SUBOPTIMAL_KHR:
+ return "VK_SUBOPTIMAL_KHR";
+ case VK_SUCCESS:
+ return "VK_SUCCESS";
+ case VK_THREAD_DONE_KHR:
+ return "VK_THREAD_DONE_KHR";
+ case VK_THREAD_IDLE_KHR:
+ return "VK_THREAD_IDLE_KHR";
+ case VK_TIMEOUT:
+ return "VK_TIMEOUT";
+ default:
+ return "Unhandled VkResult";
+ }
+}
+
+static inline const char* string_VkStructureType(VkStructureType input_value)
+{
+ switch (input_value)
+ {
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV";
+ case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR";
+ case VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR";
+ case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID:
+ return "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID";
+ case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID:
+ return "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID";
+ case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID:
+ return "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID";
+ case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID:
+ return "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID";
+ case VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_APPLICATION_INFO:
+ return "VK_STRUCTURE_TYPE_APPLICATION_INFO";
+ case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2:
+ return "VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2";
+ case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT:
+ return "VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT";
+ case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2:
+ return "VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2";
+ case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT:
+ return "VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT";
+ case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD:
+ return "VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD";
+ case VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV:
+ return "VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV";
+ case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO:
+ return "VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO";
+ case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO:
+ return "VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO";
+ case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO:
+ return "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO";
+ case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO:
+ return "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO";
+ case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR";
+ case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO:
+ return "VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO";
+ case VK_STRUCTURE_TYPE_BIND_SPARSE_INFO:
+ return "VK_STRUCTURE_TYPE_BIND_SPARSE_INFO";
+ case VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR:
+ return "VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR";
+ case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA";
+ case VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_BUFFER_COPY_2_KHR:
+ return "VK_STRUCTURE_TYPE_BUFFER_COPY_2_KHR";
+ case VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO:
+ return "VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO";
+ case VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR:
+ return "VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR";
+ case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER:
+ return "VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER";
+ case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR:
+ return "VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR";
+ case VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2:
+ return "VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2";
+ case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT";
+ case VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV:
+ return "VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV";
+ case VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV:
+ return "VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV";
+ case VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO:
+ return "VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO";
+ case VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO:
+ return "VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO";
+ case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT";
+ case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO:
+ return "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO";
+ case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR";
+ case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM:
+ return "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM";
+ case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV:
+ return "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV";
+ case VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT";
+ case VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV:
+ return "VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV";
+ case VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR";
+ case VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR:
+ return "VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR";
+ case VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR:
+ return "VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR";
+ case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM:
+ return "VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM";
+ case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
+ return "VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET";
+ case VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR:
+ return "VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR";
+ case VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR:
+ return "VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR";
+ case VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX:
+ return "VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX";
+ case VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX:
+ return "VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX";
+ case VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX:
+ return "VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX";
+ case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT:
+ return "VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT";
+ case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT:
+ return "VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT";
+ case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR";
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO:
+ return "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO";
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT:
+ return "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT";
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
+ return "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO";
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT:
+ return "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT";
+ case VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR:
+ return "VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR";
+ case VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO:
+ return "VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO";
+ case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO:
+ return "VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO";
+ case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR:
+ return "VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR";
+ case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO:
+ return "VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO";
+ case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO:
+ return "VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO";
+ case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR:
+ return "VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR";
+ case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO:
+ return "VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO";
+ case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD:
+ return "VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD";
+ case VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT:
+ return "VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT";
+ case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2:
+ return "VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2";
+ case VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR:
+ return "VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR";
+ case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD:
+ return "VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD";
+ case VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR:
+ return "VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR";
+ case VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR:
+ return "VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR";
+ case VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR:
+ return "VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR";
+ case VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT";
+ case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR:
+ return "VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR";
+ case VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT:
+ return "VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT";
+ case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT:
+ return "VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT";
+ case VK_STRUCTURE_TYPE_EVENT_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_EVENT_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO:
+ return "VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO";
+ case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV";
+ case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES";
+ case VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES";
+ case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID:
+ return "VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID";
+ case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES";
+ case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES";
+ case VK_STRUCTURE_TYPE_FENCE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_FENCE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR";
+ case VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2:
+ return "VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2";
+ case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR:
+ return "VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR";
+ case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO:
+ return "VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO";
+ case VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV:
+ return "VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV";
+ case VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV:
+ return "VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV";
+ case VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV:
+ return "VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV";
+ case VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV:
+ return "VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV";
+ case VK_STRUCTURE_TYPE_GEOMETRY_NV:
+ return "VK_STRUCTURE_TYPE_GEOMETRY_NV";
+ case VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV:
+ return "VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV";
+ case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_HDR_METADATA_EXT:
+ return "VK_STRUCTURE_TYPE_HDR_METADATA_EXT";
+ case VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR:
+ return "VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR";
+ case VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_IMAGE_COPY_2_KHR:
+ return "VK_STRUCTURE_TYPE_IMAGE_COPY_2_KHR";
+ case VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2:
+ return "VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2";
+ case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER:
+ return "VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER";
+ case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR:
+ return "VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR";
+ case VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2:
+ return "VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2";
+ case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO:
+ return "VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO";
+ case VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR:
+ return "VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR";
+ case VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2:
+ return "VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2";
+ case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX:
+ return "VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX";
+ case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT:
+ return "VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT";
+ case VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX:
+ return "VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX";
+ case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID:
+ return "VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID";
+ case VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR";
+ case VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA";
+ case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR";
+ case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT";
+ case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV";
+ case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR";
+ case VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV:
+ return "VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV";
+ case VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL:
+ return "VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL";
+ case VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK:
+ return "VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK";
+ case VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK:
+ return "VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK";
+ case VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE:
+ return "VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE";
+ case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO:
+ return "VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO";
+ case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO:
+ return "VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO";
+ case VK_STRUCTURE_TYPE_MEMORY_BARRIER:
+ return "VK_STRUCTURE_TYPE_MEMORY_BARRIER";
+ case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR:
+ return "VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR";
+ case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO:
+ return "VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO";
+ case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS:
+ return "VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS";
+ case VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID:
+ return "VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID";
+ case VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR";
+ case VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV:
+ return "VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV";
+ case VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO:
+ return "VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO";
+ case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2:
+ return "VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2";
+ case VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA";
+ case VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX:
+ return "VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX";
+ case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE:
+ return "VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL:
+ return "VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR:
+ return "VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR:
+ return "VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL:
+ return "VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL:
+ return "VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL:
+ return "VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR:
+ return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD:
+ return "VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD";
+ case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR:
+ return "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR";
+ case VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR:
+ return "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR";
+ case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD:
+ return "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD";
+ case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP:
+ return "VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP";
+ case VK_STRUCTURE_TYPE_PRESENT_ID_KHR:
+ return "VK_STRUCTURE_TYPE_PRESENT_ID_KHR";
+ case VK_STRUCTURE_TYPE_PRESENT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_PRESENT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR:
+ return "VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR";
+ case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE:
+ return "VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE";
+ case VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO:
+ return "VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO";
+ case VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL:
+ return "VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL";
+ case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV:
+ return "VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV";
+ case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV:
+ return "VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV";
+ case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT:
+ return "VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT";
+ case VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2:
+ return "VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2";
+ case VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV";
+ case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT";
+ case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_RENDERING_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_RENDERING_INFO_KHR";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO:
+ return "VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO:
+ return "VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2:
+ return "VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM:
+ return "VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM";
+ case VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR:
+ return "VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR";
+ case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES:
+ return "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES";
+ case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO:
+ return "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO";
+ case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT";
+ case VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX:
+ return "VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX";
+ case VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR";
+ case VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA";
+ case VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO:
+ return "VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO";
+ case VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO:
+ return "VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO";
+ case VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO:
+ return "VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO";
+ case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR:
+ return "VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR";
+ case VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2:
+ return "VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2";
+ case VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2:
+ return "VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2";
+ case VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP:
+ return "VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP";
+ case VK_STRUCTURE_TYPE_SUBMIT_INFO:
+ return "VK_STRUCTURE_TYPE_SUBMIT_INFO";
+ case VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR:
+ return "VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR";
+ case VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO:
+ return "VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO";
+ case VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2:
+ return "VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2";
+ case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2:
+ return "VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2";
+ case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE:
+ return "VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE";
+ case VK_STRUCTURE_TYPE_SUBPASS_END_INFO:
+ return "VK_STRUCTURE_TYPE_SUBPASS_END_INFO";
+ case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI:
+ return "VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI";
+ case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT:
+ return "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT";
+ case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR:
+ return "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR";
+ case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT:
+ return "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT";
+ case VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR:
+ return "VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR";
+ case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT";
+ case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR:
+ return "VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR";
+ case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD:
+ return "VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD";
+ case VK_STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA:
+ return "VK_STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA";
+ case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD:
+ return "VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD";
+ case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO:
+ return "VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO";
+ case VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT:
+ return "VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT";
+ case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT:
+ return "VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT";
+ case VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT:
+ return "VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT";
+ case VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT:
+ return "VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_BIND_MEMORY_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_BIND_MEMORY_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_REFERENCE_LISTS_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_REFERENCE_LISTS_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_GET_MEMORY_PROPERTIES_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_GET_MEMORY_PROPERTIES_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_PROFILE_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ case VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN:
+ return "VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN";
+ case VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV:
+ return "VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV";
+ case VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET:
+ return "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET";
+ case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR:
+ return "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR";
+ case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV:
+ return "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV";
+ case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT:
+ return "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT";
+ case VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR:
+ return "VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR";
+ default:
+ return "Unhandled VkStructureType";
+ }
+}
+
+static inline const char* string_VkAccessFlagBits(VkAccessFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR:
+ return "VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR";
+ case VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR:
+ return "VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR";
+ case VK_ACCESS_COLOR_ATTACHMENT_READ_BIT:
+ return "VK_ACCESS_COLOR_ATTACHMENT_READ_BIT";
+ case VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT:
+ return "VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT";
+ case VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT:
+ return "VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT";
+ case VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV:
+ return "VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV";
+ case VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV:
+ return "VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV";
+ case VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT:
+ return "VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT";
+ case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT:
+ return "VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT";
+ case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT:
+ return "VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT";
+ case VK_ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT_EXT:
+ return "VK_ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT_EXT";
+ case VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR:
+ return "VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR";
+ case VK_ACCESS_HOST_READ_BIT:
+ return "VK_ACCESS_HOST_READ_BIT";
+ case VK_ACCESS_HOST_WRITE_BIT:
+ return "VK_ACCESS_HOST_WRITE_BIT";
+ case VK_ACCESS_INDEX_READ_BIT:
+ return "VK_ACCESS_INDEX_READ_BIT";
+ case VK_ACCESS_INDIRECT_COMMAND_READ_BIT:
+ return "VK_ACCESS_INDIRECT_COMMAND_READ_BIT";
+ case VK_ACCESS_INPUT_ATTACHMENT_READ_BIT:
+ return "VK_ACCESS_INPUT_ATTACHMENT_READ_BIT";
+ case VK_ACCESS_MEMORY_READ_BIT:
+ return "VK_ACCESS_MEMORY_READ_BIT";
+ case VK_ACCESS_MEMORY_WRITE_BIT:
+ return "VK_ACCESS_MEMORY_WRITE_BIT";
+ case VK_ACCESS_NONE_KHR:
+ return "VK_ACCESS_NONE_KHR";
+ case VK_ACCESS_SHADER_READ_BIT:
+ return "VK_ACCESS_SHADER_READ_BIT";
+ case VK_ACCESS_SHADER_WRITE_BIT:
+ return "VK_ACCESS_SHADER_WRITE_BIT";
+ case VK_ACCESS_TRANSFER_READ_BIT:
+ return "VK_ACCESS_TRANSFER_READ_BIT";
+ case VK_ACCESS_TRANSFER_WRITE_BIT:
+ return "VK_ACCESS_TRANSFER_WRITE_BIT";
+ case VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT:
+ return "VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT";
+ case VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT:
+ return "VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT";
+ case VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT:
+ return "VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT";
+ case VK_ACCESS_UNIFORM_READ_BIT:
+ return "VK_ACCESS_UNIFORM_READ_BIT";
+ case VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT:
+ return "VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT";
+ default:
+ return "Unhandled VkAccessFlagBits";
+ }
+}
+
+static inline std::string string_VkAccessFlags(VkAccessFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkAccessFlagBits(static_cast<VkAccessFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkAccessFlagBits(static_cast<VkAccessFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkImageLayout(VkImageLayout input_value)
+{
+ switch (input_value)
+ {
+ case VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR:
+ return "VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR";
+ case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL";
+ case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL";
+ case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL";
+ case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL";
+ case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL";
+ case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL";
+ case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL";
+ case VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT:
+ return "VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT";
+ case VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR:
+ return "VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR";
+ case VK_IMAGE_LAYOUT_GENERAL:
+ return "VK_IMAGE_LAYOUT_GENERAL";
+ case VK_IMAGE_LAYOUT_PREINITIALIZED:
+ return "VK_IMAGE_LAYOUT_PREINITIALIZED";
+ case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR:
+ return "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR";
+ case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR:
+ return "VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR";
+ case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL";
+ case VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR:
+ return "VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR";
+ case VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL";
+ case VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL";
+ case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL";
+ case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
+ return "VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL";
+ case VK_IMAGE_LAYOUT_UNDEFINED:
+ return "VK_IMAGE_LAYOUT_UNDEFINED";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR:
+ return "VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR:
+ return "VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR:
+ return "VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR:
+ return "VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR:
+ return "VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR:
+ return "VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkImageLayout";
+ }
+}
+
+static inline const char* string_VkImageAspectFlagBits(VkImageAspectFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_IMAGE_ASPECT_COLOR_BIT:
+ return "VK_IMAGE_ASPECT_COLOR_BIT";
+ case VK_IMAGE_ASPECT_DEPTH_BIT:
+ return "VK_IMAGE_ASPECT_DEPTH_BIT";
+ case VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT:
+ return "VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT";
+ case VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT:
+ return "VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT";
+ case VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT:
+ return "VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT";
+ case VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT:
+ return "VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT";
+ case VK_IMAGE_ASPECT_METADATA_BIT:
+ return "VK_IMAGE_ASPECT_METADATA_BIT";
+ case VK_IMAGE_ASPECT_PLANE_0_BIT:
+ return "VK_IMAGE_ASPECT_PLANE_0_BIT";
+ case VK_IMAGE_ASPECT_PLANE_1_BIT:
+ return "VK_IMAGE_ASPECT_PLANE_1_BIT";
+ case VK_IMAGE_ASPECT_PLANE_2_BIT:
+ return "VK_IMAGE_ASPECT_PLANE_2_BIT";
+ case VK_IMAGE_ASPECT_STENCIL_BIT:
+ return "VK_IMAGE_ASPECT_STENCIL_BIT";
+ default:
+ return "Unhandled VkImageAspectFlagBits";
+ }
+}
+
+static inline std::string string_VkImageAspectFlags(VkImageAspectFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkImageAspectFlagBits(static_cast<VkImageAspectFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkImageAspectFlagBits(static_cast<VkImageAspectFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkObjectType(VkObjectType input_value)
+{
+ switch (input_value)
+ {
+ case VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR:
+ return "VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR";
+ case VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV:
+ return "VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV";
+ case VK_OBJECT_TYPE_BUFFER:
+ return "VK_OBJECT_TYPE_BUFFER";
+ case VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA:
+ return "VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA";
+ case VK_OBJECT_TYPE_BUFFER_VIEW:
+ return "VK_OBJECT_TYPE_BUFFER_VIEW";
+ case VK_OBJECT_TYPE_COMMAND_BUFFER:
+ return "VK_OBJECT_TYPE_COMMAND_BUFFER";
+ case VK_OBJECT_TYPE_COMMAND_POOL:
+ return "VK_OBJECT_TYPE_COMMAND_POOL";
+ case VK_OBJECT_TYPE_CU_FUNCTION_NVX:
+ return "VK_OBJECT_TYPE_CU_FUNCTION_NVX";
+ case VK_OBJECT_TYPE_CU_MODULE_NVX:
+ return "VK_OBJECT_TYPE_CU_MODULE_NVX";
+ case VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT:
+ return "VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT";
+ case VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT:
+ return "VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT";
+ case VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR:
+ return "VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR";
+ case VK_OBJECT_TYPE_DESCRIPTOR_POOL:
+ return "VK_OBJECT_TYPE_DESCRIPTOR_POOL";
+ case VK_OBJECT_TYPE_DESCRIPTOR_SET:
+ return "VK_OBJECT_TYPE_DESCRIPTOR_SET";
+ case VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT:
+ return "VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT";
+ case VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE:
+ return "VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE";
+ case VK_OBJECT_TYPE_DEVICE:
+ return "VK_OBJECT_TYPE_DEVICE";
+ case VK_OBJECT_TYPE_DEVICE_MEMORY:
+ return "VK_OBJECT_TYPE_DEVICE_MEMORY";
+ case VK_OBJECT_TYPE_DISPLAY_KHR:
+ return "VK_OBJECT_TYPE_DISPLAY_KHR";
+ case VK_OBJECT_TYPE_DISPLAY_MODE_KHR:
+ return "VK_OBJECT_TYPE_DISPLAY_MODE_KHR";
+ case VK_OBJECT_TYPE_EVENT:
+ return "VK_OBJECT_TYPE_EVENT";
+ case VK_OBJECT_TYPE_FENCE:
+ return "VK_OBJECT_TYPE_FENCE";
+ case VK_OBJECT_TYPE_FRAMEBUFFER:
+ return "VK_OBJECT_TYPE_FRAMEBUFFER";
+ case VK_OBJECT_TYPE_IMAGE:
+ return "VK_OBJECT_TYPE_IMAGE";
+ case VK_OBJECT_TYPE_IMAGE_VIEW:
+ return "VK_OBJECT_TYPE_IMAGE_VIEW";
+ case VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV:
+ return "VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV";
+ case VK_OBJECT_TYPE_INSTANCE:
+ return "VK_OBJECT_TYPE_INSTANCE";
+ case VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL:
+ return "VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL";
+ case VK_OBJECT_TYPE_PHYSICAL_DEVICE:
+ return "VK_OBJECT_TYPE_PHYSICAL_DEVICE";
+ case VK_OBJECT_TYPE_PIPELINE:
+ return "VK_OBJECT_TYPE_PIPELINE";
+ case VK_OBJECT_TYPE_PIPELINE_CACHE:
+ return "VK_OBJECT_TYPE_PIPELINE_CACHE";
+ case VK_OBJECT_TYPE_PIPELINE_LAYOUT:
+ return "VK_OBJECT_TYPE_PIPELINE_LAYOUT";
+ case VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT:
+ return "VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT";
+ case VK_OBJECT_TYPE_QUERY_POOL:
+ return "VK_OBJECT_TYPE_QUERY_POOL";
+ case VK_OBJECT_TYPE_QUEUE:
+ return "VK_OBJECT_TYPE_QUEUE";
+ case VK_OBJECT_TYPE_RENDER_PASS:
+ return "VK_OBJECT_TYPE_RENDER_PASS";
+ case VK_OBJECT_TYPE_SAMPLER:
+ return "VK_OBJECT_TYPE_SAMPLER";
+ case VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION:
+ return "VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION";
+ case VK_OBJECT_TYPE_SEMAPHORE:
+ return "VK_OBJECT_TYPE_SEMAPHORE";
+ case VK_OBJECT_TYPE_SHADER_MODULE:
+ return "VK_OBJECT_TYPE_SHADER_MODULE";
+ case VK_OBJECT_TYPE_SURFACE_KHR:
+ return "VK_OBJECT_TYPE_SURFACE_KHR";
+ case VK_OBJECT_TYPE_SWAPCHAIN_KHR:
+ return "VK_OBJECT_TYPE_SWAPCHAIN_KHR";
+ case VK_OBJECT_TYPE_UNKNOWN:
+ return "VK_OBJECT_TYPE_UNKNOWN";
+ case VK_OBJECT_TYPE_VALIDATION_CACHE_EXT:
+ return "VK_OBJECT_TYPE_VALIDATION_CACHE_EXT";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_OBJECT_TYPE_VIDEO_SESSION_KHR:
+ return "VK_OBJECT_TYPE_VIDEO_SESSION_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR:
+ return "VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkObjectType";
+ }
+}
+
+static inline const char* string_VkPipelineCacheHeaderVersion(VkPipelineCacheHeaderVersion input_value)
+{
+ switch (input_value)
+ {
+ case VK_PIPELINE_CACHE_HEADER_VERSION_ONE:
+ return "VK_PIPELINE_CACHE_HEADER_VERSION_ONE";
+ default:
+ return "Unhandled VkPipelineCacheHeaderVersion";
+ }
+}
+
+static inline const char* string_VkVendorId(VkVendorId input_value)
+{
+ switch (input_value)
+ {
+ case VK_VENDOR_ID_CODEPLAY:
+ return "VK_VENDOR_ID_CODEPLAY";
+ case VK_VENDOR_ID_KAZAN:
+ return "VK_VENDOR_ID_KAZAN";
+ case VK_VENDOR_ID_MESA:
+ return "VK_VENDOR_ID_MESA";
+ case VK_VENDOR_ID_POCL:
+ return "VK_VENDOR_ID_POCL";
+ case VK_VENDOR_ID_VIV:
+ return "VK_VENDOR_ID_VIV";
+ case VK_VENDOR_ID_VSI:
+ return "VK_VENDOR_ID_VSI";
+ default:
+ return "Unhandled VkVendorId";
+ }
+}
+
+static inline const char* string_VkSystemAllocationScope(VkSystemAllocationScope input_value)
+{
+ switch (input_value)
+ {
+ case VK_SYSTEM_ALLOCATION_SCOPE_CACHE:
+ return "VK_SYSTEM_ALLOCATION_SCOPE_CACHE";
+ case VK_SYSTEM_ALLOCATION_SCOPE_COMMAND:
+ return "VK_SYSTEM_ALLOCATION_SCOPE_COMMAND";
+ case VK_SYSTEM_ALLOCATION_SCOPE_DEVICE:
+ return "VK_SYSTEM_ALLOCATION_SCOPE_DEVICE";
+ case VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE:
+ return "VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE";
+ case VK_SYSTEM_ALLOCATION_SCOPE_OBJECT:
+ return "VK_SYSTEM_ALLOCATION_SCOPE_OBJECT";
+ default:
+ return "Unhandled VkSystemAllocationScope";
+ }
+}
+
+static inline const char* string_VkInternalAllocationType(VkInternalAllocationType input_value)
+{
+ switch (input_value)
+ {
+ case VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE:
+ return "VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE";
+ default:
+ return "Unhandled VkInternalAllocationType";
+ }
+}
+
+static inline const char* string_VkFormat(VkFormat input_value)
+{
+ switch (input_value)
+ {
+ case VK_FORMAT_A1R5G5B5_UNORM_PACK16:
+ return "VK_FORMAT_A1R5G5B5_UNORM_PACK16";
+ case VK_FORMAT_A2B10G10R10_SINT_PACK32:
+ return "VK_FORMAT_A2B10G10R10_SINT_PACK32";
+ case VK_FORMAT_A2B10G10R10_SNORM_PACK32:
+ return "VK_FORMAT_A2B10G10R10_SNORM_PACK32";
+ case VK_FORMAT_A2B10G10R10_SSCALED_PACK32:
+ return "VK_FORMAT_A2B10G10R10_SSCALED_PACK32";
+ case VK_FORMAT_A2B10G10R10_UINT_PACK32:
+ return "VK_FORMAT_A2B10G10R10_UINT_PACK32";
+ case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
+ return "VK_FORMAT_A2B10G10R10_UNORM_PACK32";
+ case VK_FORMAT_A2B10G10R10_USCALED_PACK32:
+ return "VK_FORMAT_A2B10G10R10_USCALED_PACK32";
+ case VK_FORMAT_A2R10G10B10_SINT_PACK32:
+ return "VK_FORMAT_A2R10G10B10_SINT_PACK32";
+ case VK_FORMAT_A2R10G10B10_SNORM_PACK32:
+ return "VK_FORMAT_A2R10G10B10_SNORM_PACK32";
+ case VK_FORMAT_A2R10G10B10_SSCALED_PACK32:
+ return "VK_FORMAT_A2R10G10B10_SSCALED_PACK32";
+ case VK_FORMAT_A2R10G10B10_UINT_PACK32:
+ return "VK_FORMAT_A2R10G10B10_UINT_PACK32";
+ case VK_FORMAT_A2R10G10B10_UNORM_PACK32:
+ return "VK_FORMAT_A2R10G10B10_UNORM_PACK32";
+ case VK_FORMAT_A2R10G10B10_USCALED_PACK32:
+ return "VK_FORMAT_A2R10G10B10_USCALED_PACK32";
+ case VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT:
+ return "VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT";
+ case VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT:
+ return "VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT";
+ case VK_FORMAT_A8B8G8R8_SINT_PACK32:
+ return "VK_FORMAT_A8B8G8R8_SINT_PACK32";
+ case VK_FORMAT_A8B8G8R8_SNORM_PACK32:
+ return "VK_FORMAT_A8B8G8R8_SNORM_PACK32";
+ case VK_FORMAT_A8B8G8R8_SRGB_PACK32:
+ return "VK_FORMAT_A8B8G8R8_SRGB_PACK32";
+ case VK_FORMAT_A8B8G8R8_SSCALED_PACK32:
+ return "VK_FORMAT_A8B8G8R8_SSCALED_PACK32";
+ case VK_FORMAT_A8B8G8R8_UINT_PACK32:
+ return "VK_FORMAT_A8B8G8R8_UINT_PACK32";
+ case VK_FORMAT_A8B8G8R8_UNORM_PACK32:
+ return "VK_FORMAT_A8B8G8R8_UNORM_PACK32";
+ case VK_FORMAT_A8B8G8R8_USCALED_PACK32:
+ return "VK_FORMAT_A8B8G8R8_USCALED_PACK32";
+ case VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_10x10_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_10x10_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_10x5_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_10x5_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_10x6_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_10x6_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_10x8_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_10x8_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_12x10_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_12x10_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_12x12_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_12x12_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_4x4_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_4x4_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_5x4_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_5x4_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_5x5_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_5x5_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_6x5_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_6x5_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_6x6_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_6x6_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_8x5_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_8x5_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_8x6_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_8x6_UNORM_BLOCK";
+ case VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:
+ return "VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT";
+ case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
+ return "VK_FORMAT_ASTC_8x8_SRGB_BLOCK";
+ case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
+ return "VK_FORMAT_ASTC_8x8_UNORM_BLOCK";
+ case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
+ return "VK_FORMAT_B10G11R11_UFLOAT_PACK32";
+ case VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:
+ return "VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16";
+ case VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:
+ return "VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16";
+ case VK_FORMAT_B16G16R16G16_422_UNORM:
+ return "VK_FORMAT_B16G16R16G16_422_UNORM";
+ case VK_FORMAT_B4G4R4A4_UNORM_PACK16:
+ return "VK_FORMAT_B4G4R4A4_UNORM_PACK16";
+ case VK_FORMAT_B5G5R5A1_UNORM_PACK16:
+ return "VK_FORMAT_B5G5R5A1_UNORM_PACK16";
+ case VK_FORMAT_B5G6R5_UNORM_PACK16:
+ return "VK_FORMAT_B5G6R5_UNORM_PACK16";
+ case VK_FORMAT_B8G8R8A8_SINT:
+ return "VK_FORMAT_B8G8R8A8_SINT";
+ case VK_FORMAT_B8G8R8A8_SNORM:
+ return "VK_FORMAT_B8G8R8A8_SNORM";
+ case VK_FORMAT_B8G8R8A8_SRGB:
+ return "VK_FORMAT_B8G8R8A8_SRGB";
+ case VK_FORMAT_B8G8R8A8_SSCALED:
+ return "VK_FORMAT_B8G8R8A8_SSCALED";
+ case VK_FORMAT_B8G8R8A8_UINT:
+ return "VK_FORMAT_B8G8R8A8_UINT";
+ case VK_FORMAT_B8G8R8A8_UNORM:
+ return "VK_FORMAT_B8G8R8A8_UNORM";
+ case VK_FORMAT_B8G8R8A8_USCALED:
+ return "VK_FORMAT_B8G8R8A8_USCALED";
+ case VK_FORMAT_B8G8R8G8_422_UNORM:
+ return "VK_FORMAT_B8G8R8G8_422_UNORM";
+ case VK_FORMAT_B8G8R8_SINT:
+ return "VK_FORMAT_B8G8R8_SINT";
+ case VK_FORMAT_B8G8R8_SNORM:
+ return "VK_FORMAT_B8G8R8_SNORM";
+ case VK_FORMAT_B8G8R8_SRGB:
+ return "VK_FORMAT_B8G8R8_SRGB";
+ case VK_FORMAT_B8G8R8_SSCALED:
+ return "VK_FORMAT_B8G8R8_SSCALED";
+ case VK_FORMAT_B8G8R8_UINT:
+ return "VK_FORMAT_B8G8R8_UINT";
+ case VK_FORMAT_B8G8R8_UNORM:
+ return "VK_FORMAT_B8G8R8_UNORM";
+ case VK_FORMAT_B8G8R8_USCALED:
+ return "VK_FORMAT_B8G8R8_USCALED";
+ case VK_FORMAT_BC1_RGBA_SRGB_BLOCK:
+ return "VK_FORMAT_BC1_RGBA_SRGB_BLOCK";
+ case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
+ return "VK_FORMAT_BC1_RGBA_UNORM_BLOCK";
+ case VK_FORMAT_BC1_RGB_SRGB_BLOCK:
+ return "VK_FORMAT_BC1_RGB_SRGB_BLOCK";
+ case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
+ return "VK_FORMAT_BC1_RGB_UNORM_BLOCK";
+ case VK_FORMAT_BC2_SRGB_BLOCK:
+ return "VK_FORMAT_BC2_SRGB_BLOCK";
+ case VK_FORMAT_BC2_UNORM_BLOCK:
+ return "VK_FORMAT_BC2_UNORM_BLOCK";
+ case VK_FORMAT_BC3_SRGB_BLOCK:
+ return "VK_FORMAT_BC3_SRGB_BLOCK";
+ case VK_FORMAT_BC3_UNORM_BLOCK:
+ return "VK_FORMAT_BC3_UNORM_BLOCK";
+ case VK_FORMAT_BC4_SNORM_BLOCK:
+ return "VK_FORMAT_BC4_SNORM_BLOCK";
+ case VK_FORMAT_BC4_UNORM_BLOCK:
+ return "VK_FORMAT_BC4_UNORM_BLOCK";
+ case VK_FORMAT_BC5_SNORM_BLOCK:
+ return "VK_FORMAT_BC5_SNORM_BLOCK";
+ case VK_FORMAT_BC5_UNORM_BLOCK:
+ return "VK_FORMAT_BC5_UNORM_BLOCK";
+ case VK_FORMAT_BC6H_SFLOAT_BLOCK:
+ return "VK_FORMAT_BC6H_SFLOAT_BLOCK";
+ case VK_FORMAT_BC6H_UFLOAT_BLOCK:
+ return "VK_FORMAT_BC6H_UFLOAT_BLOCK";
+ case VK_FORMAT_BC7_SRGB_BLOCK:
+ return "VK_FORMAT_BC7_SRGB_BLOCK";
+ case VK_FORMAT_BC7_UNORM_BLOCK:
+ return "VK_FORMAT_BC7_UNORM_BLOCK";
+ case VK_FORMAT_D16_UNORM:
+ return "VK_FORMAT_D16_UNORM";
+ case VK_FORMAT_D16_UNORM_S8_UINT:
+ return "VK_FORMAT_D16_UNORM_S8_UINT";
+ case VK_FORMAT_D24_UNORM_S8_UINT:
+ return "VK_FORMAT_D24_UNORM_S8_UINT";
+ case VK_FORMAT_D32_SFLOAT:
+ return "VK_FORMAT_D32_SFLOAT";
+ case VK_FORMAT_D32_SFLOAT_S8_UINT:
+ return "VK_FORMAT_D32_SFLOAT_S8_UINT";
+ case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:
+ return "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32";
+ case VK_FORMAT_EAC_R11G11_SNORM_BLOCK:
+ return "VK_FORMAT_EAC_R11G11_SNORM_BLOCK";
+ case VK_FORMAT_EAC_R11G11_UNORM_BLOCK:
+ return "VK_FORMAT_EAC_R11G11_UNORM_BLOCK";
+ case VK_FORMAT_EAC_R11_SNORM_BLOCK:
+ return "VK_FORMAT_EAC_R11_SNORM_BLOCK";
+ case VK_FORMAT_EAC_R11_UNORM_BLOCK:
+ return "VK_FORMAT_EAC_R11_UNORM_BLOCK";
+ case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
+ return "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK";
+ case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:
+ return "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK";
+ case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
+ return "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK";
+ case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:
+ return "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK";
+ case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
+ return "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK";
+ case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
+ return "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK";
+ case VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:
+ return "VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16";
+ case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:
+ return "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16";
+ case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:
+ return "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16";
+ case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT:
+ return "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT";
+ case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:
+ return "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16";
+ case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:
+ return "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16";
+ case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:
+ return "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16";
+ case VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:
+ return "VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16";
+ case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:
+ return "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16";
+ case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:
+ return "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16";
+ case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT:
+ return "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT";
+ case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:
+ return "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16";
+ case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:
+ return "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16";
+ case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:
+ return "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16";
+ case VK_FORMAT_G16B16G16R16_422_UNORM:
+ return "VK_FORMAT_G16B16G16R16_422_UNORM";
+ case VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:
+ return "VK_FORMAT_G16_B16R16_2PLANE_420_UNORM";
+ case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:
+ return "VK_FORMAT_G16_B16R16_2PLANE_422_UNORM";
+ case VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT:
+ return "VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT";
+ case VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:
+ return "VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM";
+ case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:
+ return "VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM";
+ case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:
+ return "VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM";
+ case VK_FORMAT_G8B8G8R8_422_UNORM:
+ return "VK_FORMAT_G8B8G8R8_422_UNORM";
+ case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
+ return "VK_FORMAT_G8_B8R8_2PLANE_420_UNORM";
+ case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:
+ return "VK_FORMAT_G8_B8R8_2PLANE_422_UNORM";
+ case VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT:
+ return "VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT";
+ case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
+ return "VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM";
+ case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:
+ return "VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM";
+ case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:
+ return "VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM";
+ case VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:
+ return "VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG";
+ case VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:
+ return "VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG";
+ case VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:
+ return "VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG";
+ case VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:
+ return "VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG";
+ case VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:
+ return "VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG";
+ case VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:
+ return "VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG";
+ case VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:
+ return "VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG";
+ case VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:
+ return "VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG";
+ case VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:
+ return "VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16";
+ case VK_FORMAT_R10X6G10X6_UNORM_2PACK16:
+ return "VK_FORMAT_R10X6G10X6_UNORM_2PACK16";
+ case VK_FORMAT_R10X6_UNORM_PACK16:
+ return "VK_FORMAT_R10X6_UNORM_PACK16";
+ case VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:
+ return "VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16";
+ case VK_FORMAT_R12X4G12X4_UNORM_2PACK16:
+ return "VK_FORMAT_R12X4G12X4_UNORM_2PACK16";
+ case VK_FORMAT_R12X4_UNORM_PACK16:
+ return "VK_FORMAT_R12X4_UNORM_PACK16";
+ case VK_FORMAT_R16G16B16A16_SFLOAT:
+ return "VK_FORMAT_R16G16B16A16_SFLOAT";
+ case VK_FORMAT_R16G16B16A16_SINT:
+ return "VK_FORMAT_R16G16B16A16_SINT";
+ case VK_FORMAT_R16G16B16A16_SNORM:
+ return "VK_FORMAT_R16G16B16A16_SNORM";
+ case VK_FORMAT_R16G16B16A16_SSCALED:
+ return "VK_FORMAT_R16G16B16A16_SSCALED";
+ case VK_FORMAT_R16G16B16A16_UINT:
+ return "VK_FORMAT_R16G16B16A16_UINT";
+ case VK_FORMAT_R16G16B16A16_UNORM:
+ return "VK_FORMAT_R16G16B16A16_UNORM";
+ case VK_FORMAT_R16G16B16A16_USCALED:
+ return "VK_FORMAT_R16G16B16A16_USCALED";
+ case VK_FORMAT_R16G16B16_SFLOAT:
+ return "VK_FORMAT_R16G16B16_SFLOAT";
+ case VK_FORMAT_R16G16B16_SINT:
+ return "VK_FORMAT_R16G16B16_SINT";
+ case VK_FORMAT_R16G16B16_SNORM:
+ return "VK_FORMAT_R16G16B16_SNORM";
+ case VK_FORMAT_R16G16B16_SSCALED:
+ return "VK_FORMAT_R16G16B16_SSCALED";
+ case VK_FORMAT_R16G16B16_UINT:
+ return "VK_FORMAT_R16G16B16_UINT";
+ case VK_FORMAT_R16G16B16_UNORM:
+ return "VK_FORMAT_R16G16B16_UNORM";
+ case VK_FORMAT_R16G16B16_USCALED:
+ return "VK_FORMAT_R16G16B16_USCALED";
+ case VK_FORMAT_R16G16_SFLOAT:
+ return "VK_FORMAT_R16G16_SFLOAT";
+ case VK_FORMAT_R16G16_SINT:
+ return "VK_FORMAT_R16G16_SINT";
+ case VK_FORMAT_R16G16_SNORM:
+ return "VK_FORMAT_R16G16_SNORM";
+ case VK_FORMAT_R16G16_SSCALED:
+ return "VK_FORMAT_R16G16_SSCALED";
+ case VK_FORMAT_R16G16_UINT:
+ return "VK_FORMAT_R16G16_UINT";
+ case VK_FORMAT_R16G16_UNORM:
+ return "VK_FORMAT_R16G16_UNORM";
+ case VK_FORMAT_R16G16_USCALED:
+ return "VK_FORMAT_R16G16_USCALED";
+ case VK_FORMAT_R16_SFLOAT:
+ return "VK_FORMAT_R16_SFLOAT";
+ case VK_FORMAT_R16_SINT:
+ return "VK_FORMAT_R16_SINT";
+ case VK_FORMAT_R16_SNORM:
+ return "VK_FORMAT_R16_SNORM";
+ case VK_FORMAT_R16_SSCALED:
+ return "VK_FORMAT_R16_SSCALED";
+ case VK_FORMAT_R16_UINT:
+ return "VK_FORMAT_R16_UINT";
+ case VK_FORMAT_R16_UNORM:
+ return "VK_FORMAT_R16_UNORM";
+ case VK_FORMAT_R16_USCALED:
+ return "VK_FORMAT_R16_USCALED";
+ case VK_FORMAT_R32G32B32A32_SFLOAT:
+ return "VK_FORMAT_R32G32B32A32_SFLOAT";
+ case VK_FORMAT_R32G32B32A32_SINT:
+ return "VK_FORMAT_R32G32B32A32_SINT";
+ case VK_FORMAT_R32G32B32A32_UINT:
+ return "VK_FORMAT_R32G32B32A32_UINT";
+ case VK_FORMAT_R32G32B32_SFLOAT:
+ return "VK_FORMAT_R32G32B32_SFLOAT";
+ case VK_FORMAT_R32G32B32_SINT:
+ return "VK_FORMAT_R32G32B32_SINT";
+ case VK_FORMAT_R32G32B32_UINT:
+ return "VK_FORMAT_R32G32B32_UINT";
+ case VK_FORMAT_R32G32_SFLOAT:
+ return "VK_FORMAT_R32G32_SFLOAT";
+ case VK_FORMAT_R32G32_SINT:
+ return "VK_FORMAT_R32G32_SINT";
+ case VK_FORMAT_R32G32_UINT:
+ return "VK_FORMAT_R32G32_UINT";
+ case VK_FORMAT_R32_SFLOAT:
+ return "VK_FORMAT_R32_SFLOAT";
+ case VK_FORMAT_R32_SINT:
+ return "VK_FORMAT_R32_SINT";
+ case VK_FORMAT_R32_UINT:
+ return "VK_FORMAT_R32_UINT";
+ case VK_FORMAT_R4G4B4A4_UNORM_PACK16:
+ return "VK_FORMAT_R4G4B4A4_UNORM_PACK16";
+ case VK_FORMAT_R4G4_UNORM_PACK8:
+ return "VK_FORMAT_R4G4_UNORM_PACK8";
+ case VK_FORMAT_R5G5B5A1_UNORM_PACK16:
+ return "VK_FORMAT_R5G5B5A1_UNORM_PACK16";
+ case VK_FORMAT_R5G6B5_UNORM_PACK16:
+ return "VK_FORMAT_R5G6B5_UNORM_PACK16";
+ case VK_FORMAT_R64G64B64A64_SFLOAT:
+ return "VK_FORMAT_R64G64B64A64_SFLOAT";
+ case VK_FORMAT_R64G64B64A64_SINT:
+ return "VK_FORMAT_R64G64B64A64_SINT";
+ case VK_FORMAT_R64G64B64A64_UINT:
+ return "VK_FORMAT_R64G64B64A64_UINT";
+ case VK_FORMAT_R64G64B64_SFLOAT:
+ return "VK_FORMAT_R64G64B64_SFLOAT";
+ case VK_FORMAT_R64G64B64_SINT:
+ return "VK_FORMAT_R64G64B64_SINT";
+ case VK_FORMAT_R64G64B64_UINT:
+ return "VK_FORMAT_R64G64B64_UINT";
+ case VK_FORMAT_R64G64_SFLOAT:
+ return "VK_FORMAT_R64G64_SFLOAT";
+ case VK_FORMAT_R64G64_SINT:
+ return "VK_FORMAT_R64G64_SINT";
+ case VK_FORMAT_R64G64_UINT:
+ return "VK_FORMAT_R64G64_UINT";
+ case VK_FORMAT_R64_SFLOAT:
+ return "VK_FORMAT_R64_SFLOAT";
+ case VK_FORMAT_R64_SINT:
+ return "VK_FORMAT_R64_SINT";
+ case VK_FORMAT_R64_UINT:
+ return "VK_FORMAT_R64_UINT";
+ case VK_FORMAT_R8G8B8A8_SINT:
+ return "VK_FORMAT_R8G8B8A8_SINT";
+ case VK_FORMAT_R8G8B8A8_SNORM:
+ return "VK_FORMAT_R8G8B8A8_SNORM";
+ case VK_FORMAT_R8G8B8A8_SRGB:
+ return "VK_FORMAT_R8G8B8A8_SRGB";
+ case VK_FORMAT_R8G8B8A8_SSCALED:
+ return "VK_FORMAT_R8G8B8A8_SSCALED";
+ case VK_FORMAT_R8G8B8A8_UINT:
+ return "VK_FORMAT_R8G8B8A8_UINT";
+ case VK_FORMAT_R8G8B8A8_UNORM:
+ return "VK_FORMAT_R8G8B8A8_UNORM";
+ case VK_FORMAT_R8G8B8A8_USCALED:
+ return "VK_FORMAT_R8G8B8A8_USCALED";
+ case VK_FORMAT_R8G8B8_SINT:
+ return "VK_FORMAT_R8G8B8_SINT";
+ case VK_FORMAT_R8G8B8_SNORM:
+ return "VK_FORMAT_R8G8B8_SNORM";
+ case VK_FORMAT_R8G8B8_SRGB:
+ return "VK_FORMAT_R8G8B8_SRGB";
+ case VK_FORMAT_R8G8B8_SSCALED:
+ return "VK_FORMAT_R8G8B8_SSCALED";
+ case VK_FORMAT_R8G8B8_UINT:
+ return "VK_FORMAT_R8G8B8_UINT";
+ case VK_FORMAT_R8G8B8_UNORM:
+ return "VK_FORMAT_R8G8B8_UNORM";
+ case VK_FORMAT_R8G8B8_USCALED:
+ return "VK_FORMAT_R8G8B8_USCALED";
+ case VK_FORMAT_R8G8_SINT:
+ return "VK_FORMAT_R8G8_SINT";
+ case VK_FORMAT_R8G8_SNORM:
+ return "VK_FORMAT_R8G8_SNORM";
+ case VK_FORMAT_R8G8_SRGB:
+ return "VK_FORMAT_R8G8_SRGB";
+ case VK_FORMAT_R8G8_SSCALED:
+ return "VK_FORMAT_R8G8_SSCALED";
+ case VK_FORMAT_R8G8_UINT:
+ return "VK_FORMAT_R8G8_UINT";
+ case VK_FORMAT_R8G8_UNORM:
+ return "VK_FORMAT_R8G8_UNORM";
+ case VK_FORMAT_R8G8_USCALED:
+ return "VK_FORMAT_R8G8_USCALED";
+ case VK_FORMAT_R8_SINT:
+ return "VK_FORMAT_R8_SINT";
+ case VK_FORMAT_R8_SNORM:
+ return "VK_FORMAT_R8_SNORM";
+ case VK_FORMAT_R8_SRGB:
+ return "VK_FORMAT_R8_SRGB";
+ case VK_FORMAT_R8_SSCALED:
+ return "VK_FORMAT_R8_SSCALED";
+ case VK_FORMAT_R8_UINT:
+ return "VK_FORMAT_R8_UINT";
+ case VK_FORMAT_R8_UNORM:
+ return "VK_FORMAT_R8_UNORM";
+ case VK_FORMAT_R8_USCALED:
+ return "VK_FORMAT_R8_USCALED";
+ case VK_FORMAT_S8_UINT:
+ return "VK_FORMAT_S8_UINT";
+ case VK_FORMAT_UNDEFINED:
+ return "VK_FORMAT_UNDEFINED";
+ case VK_FORMAT_X8_D24_UNORM_PACK32:
+ return "VK_FORMAT_X8_D24_UNORM_PACK32";
+ default:
+ return "Unhandled VkFormat";
+ }
+}
+
+static inline const char* string_VkFormatFeatureFlagBits(VkFormatFeatureFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR:
+ return "VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR";
+ case VK_FORMAT_FEATURE_BLIT_DST_BIT:
+ return "VK_FORMAT_FEATURE_BLIT_DST_BIT";
+ case VK_FORMAT_FEATURE_BLIT_SRC_BIT:
+ return "VK_FORMAT_FEATURE_BLIT_SRC_BIT";
+ case VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT:
+ return "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT";
+ case VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT:
+ return "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT";
+ case VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT:
+ return "VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT";
+ case VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT:
+ return "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT";
+ case VK_FORMAT_FEATURE_DISJOINT_BIT:
+ return "VK_FORMAT_FEATURE_DISJOINT_BIT";
+ case VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT:
+ return "VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT";
+ case VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR";
+ case VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT:
+ return "VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT";
+ case VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT:
+ return "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT";
+ case VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG:
+ return "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG";
+ case VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT:
+ return "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT";
+ case VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT:
+ return "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT";
+ case VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT:
+ return "VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT";
+ case VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT:
+ return "VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT";
+ case VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT:
+ return "VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT";
+ case VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT:
+ return "VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT";
+ case VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT:
+ return "VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT";
+ case VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT:
+ return "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT";
+ case VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT:
+ return "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT";
+ case VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT:
+ return "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT";
+ case VK_FORMAT_FEATURE_TRANSFER_DST_BIT:
+ return "VK_FORMAT_FEATURE_TRANSFER_DST_BIT";
+ case VK_FORMAT_FEATURE_TRANSFER_SRC_BIT:
+ return "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT";
+ case VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT:
+ return "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT";
+ case VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT:
+ return "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR:
+ return "VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR:
+ return "VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkFormatFeatureFlagBits";
+ }
+}
+
+static inline std::string string_VkFormatFeatureFlags(VkFormatFeatureFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkFormatFeatureFlagBits(static_cast<VkFormatFeatureFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkFormatFeatureFlagBits(static_cast<VkFormatFeatureFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkImageCreateFlagBits(VkImageCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT:
+ return "VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT";
+ case VK_IMAGE_CREATE_ALIAS_BIT:
+ return "VK_IMAGE_CREATE_ALIAS_BIT";
+ case VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT:
+ return "VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT";
+ case VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV:
+ return "VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV";
+ case VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT:
+ return "VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT";
+ case VK_IMAGE_CREATE_DISJOINT_BIT:
+ return "VK_IMAGE_CREATE_DISJOINT_BIT";
+ case VK_IMAGE_CREATE_EXTENDED_USAGE_BIT:
+ return "VK_IMAGE_CREATE_EXTENDED_USAGE_BIT";
+ case VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT:
+ return "VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT";
+ case VK_IMAGE_CREATE_PROTECTED_BIT:
+ return "VK_IMAGE_CREATE_PROTECTED_BIT";
+ case VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT:
+ return "VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT";
+ case VK_IMAGE_CREATE_SPARSE_ALIASED_BIT:
+ return "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT";
+ case VK_IMAGE_CREATE_SPARSE_BINDING_BIT:
+ return "VK_IMAGE_CREATE_SPARSE_BINDING_BIT";
+ case VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT:
+ return "VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT";
+ case VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT:
+ return "VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT";
+ case VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT:
+ return "VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT";
+ default:
+ return "Unhandled VkImageCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkImageCreateFlags(VkImageCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkImageCreateFlagBits(static_cast<VkImageCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkImageCreateFlagBits(static_cast<VkImageCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSampleCountFlagBits(VkSampleCountFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLE_COUNT_16_BIT:
+ return "VK_SAMPLE_COUNT_16_BIT";
+ case VK_SAMPLE_COUNT_1_BIT:
+ return "VK_SAMPLE_COUNT_1_BIT";
+ case VK_SAMPLE_COUNT_2_BIT:
+ return "VK_SAMPLE_COUNT_2_BIT";
+ case VK_SAMPLE_COUNT_32_BIT:
+ return "VK_SAMPLE_COUNT_32_BIT";
+ case VK_SAMPLE_COUNT_4_BIT:
+ return "VK_SAMPLE_COUNT_4_BIT";
+ case VK_SAMPLE_COUNT_64_BIT:
+ return "VK_SAMPLE_COUNT_64_BIT";
+ case VK_SAMPLE_COUNT_8_BIT:
+ return "VK_SAMPLE_COUNT_8_BIT";
+ default:
+ return "Unhandled VkSampleCountFlagBits";
+ }
+}
+
+static inline std::string string_VkSampleCountFlags(VkSampleCountFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSampleCountFlagBits(static_cast<VkSampleCountFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSampleCountFlagBits(static_cast<VkSampleCountFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkImageTiling(VkImageTiling input_value)
+{
+ switch (input_value)
+ {
+ case VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT:
+ return "VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT";
+ case VK_IMAGE_TILING_LINEAR:
+ return "VK_IMAGE_TILING_LINEAR";
+ case VK_IMAGE_TILING_OPTIMAL:
+ return "VK_IMAGE_TILING_OPTIMAL";
+ default:
+ return "Unhandled VkImageTiling";
+ }
+}
+
+static inline const char* string_VkImageType(VkImageType input_value)
+{
+ switch (input_value)
+ {
+ case VK_IMAGE_TYPE_1D:
+ return "VK_IMAGE_TYPE_1D";
+ case VK_IMAGE_TYPE_2D:
+ return "VK_IMAGE_TYPE_2D";
+ case VK_IMAGE_TYPE_3D:
+ return "VK_IMAGE_TYPE_3D";
+ default:
+ return "Unhandled VkImageType";
+ }
+}
+
+static inline const char* string_VkImageUsageFlagBits(VkImageUsageFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT:
+ return "VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT";
+ case VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT:
+ return "VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT";
+ case VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT:
+ return "VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT";
+ case VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR:
+ return "VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR";
+ case VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT:
+ return "VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT";
+ case VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI:
+ return "VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI";
+ case VK_IMAGE_USAGE_SAMPLED_BIT:
+ return "VK_IMAGE_USAGE_SAMPLED_BIT";
+ case VK_IMAGE_USAGE_STORAGE_BIT:
+ return "VK_IMAGE_USAGE_STORAGE_BIT";
+ case VK_IMAGE_USAGE_TRANSFER_DST_BIT:
+ return "VK_IMAGE_USAGE_TRANSFER_DST_BIT";
+ case VK_IMAGE_USAGE_TRANSFER_SRC_BIT:
+ return "VK_IMAGE_USAGE_TRANSFER_SRC_BIT";
+ case VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT:
+ return "VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR:
+ return "VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR:
+ return "VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR:
+ return "VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR:
+ return "VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR:
+ return "VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR:
+ return "VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkImageUsageFlagBits";
+ }
+}
+
+static inline std::string string_VkImageUsageFlags(VkImageUsageFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkImageUsageFlagBits(static_cast<VkImageUsageFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkImageUsageFlagBits(static_cast<VkImageUsageFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkMemoryHeapFlagBits(VkMemoryHeapFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_MEMORY_HEAP_DEVICE_LOCAL_BIT:
+ return "VK_MEMORY_HEAP_DEVICE_LOCAL_BIT";
+ case VK_MEMORY_HEAP_MULTI_INSTANCE_BIT:
+ return "VK_MEMORY_HEAP_MULTI_INSTANCE_BIT";
+ default:
+ return "Unhandled VkMemoryHeapFlagBits";
+ }
+}
+
+static inline std::string string_VkMemoryHeapFlags(VkMemoryHeapFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkMemoryHeapFlagBits(static_cast<VkMemoryHeapFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkMemoryHeapFlagBits(static_cast<VkMemoryHeapFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkMemoryPropertyFlagBits(VkMemoryPropertyFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD:
+ return "VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD";
+ case VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT:
+ return "VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT";
+ case VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD:
+ return "VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD";
+ case VK_MEMORY_PROPERTY_HOST_CACHED_BIT:
+ return "VK_MEMORY_PROPERTY_HOST_CACHED_BIT";
+ case VK_MEMORY_PROPERTY_HOST_COHERENT_BIT:
+ return "VK_MEMORY_PROPERTY_HOST_COHERENT_BIT";
+ case VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT:
+ return "VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT";
+ case VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT:
+ return "VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT";
+ case VK_MEMORY_PROPERTY_PROTECTED_BIT:
+ return "VK_MEMORY_PROPERTY_PROTECTED_BIT";
+ case VK_MEMORY_PROPERTY_RDMA_CAPABLE_BIT_NV:
+ return "VK_MEMORY_PROPERTY_RDMA_CAPABLE_BIT_NV";
+ default:
+ return "Unhandled VkMemoryPropertyFlagBits";
+ }
+}
+
+static inline std::string string_VkMemoryPropertyFlags(VkMemoryPropertyFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkMemoryPropertyFlagBits(static_cast<VkMemoryPropertyFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkMemoryPropertyFlagBits(static_cast<VkMemoryPropertyFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPhysicalDeviceType(VkPhysicalDeviceType input_value)
+{
+ switch (input_value)
+ {
+ case VK_PHYSICAL_DEVICE_TYPE_CPU:
+ return "VK_PHYSICAL_DEVICE_TYPE_CPU";
+ case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU:
+ return "VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU";
+ case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU:
+ return "VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU";
+ case VK_PHYSICAL_DEVICE_TYPE_OTHER:
+ return "VK_PHYSICAL_DEVICE_TYPE_OTHER";
+ case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
+ return "VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU";
+ default:
+ return "Unhandled VkPhysicalDeviceType";
+ }
+}
+
+static inline const char* string_VkQueueFlagBits(VkQueueFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_QUEUE_COMPUTE_BIT:
+ return "VK_QUEUE_COMPUTE_BIT";
+ case VK_QUEUE_GRAPHICS_BIT:
+ return "VK_QUEUE_GRAPHICS_BIT";
+ case VK_QUEUE_PROTECTED_BIT:
+ return "VK_QUEUE_PROTECTED_BIT";
+ case VK_QUEUE_SPARSE_BINDING_BIT:
+ return "VK_QUEUE_SPARSE_BINDING_BIT";
+ case VK_QUEUE_TRANSFER_BIT:
+ return "VK_QUEUE_TRANSFER_BIT";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_QUEUE_VIDEO_DECODE_BIT_KHR:
+ return "VK_QUEUE_VIDEO_DECODE_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_QUEUE_VIDEO_ENCODE_BIT_KHR:
+ return "VK_QUEUE_VIDEO_ENCODE_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkQueueFlagBits";
+ }
+}
+
+static inline std::string string_VkQueueFlags(VkQueueFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkQueueFlagBits(static_cast<VkQueueFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkQueueFlagBits(static_cast<VkQueueFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDeviceQueueCreateFlagBits(VkDeviceQueueCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT:
+ return "VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT";
+ default:
+ return "Unhandled VkDeviceQueueCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkDeviceQueueCreateFlags(VkDeviceQueueCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDeviceQueueCreateFlagBits(static_cast<VkDeviceQueueCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDeviceQueueCreateFlagBits(static_cast<VkDeviceQueueCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPipelineStageFlagBits(VkPipelineStageFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR:
+ return "VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR";
+ case VK_PIPELINE_STAGE_ALL_COMMANDS_BIT:
+ return "VK_PIPELINE_STAGE_ALL_COMMANDS_BIT";
+ case VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT:
+ return "VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT";
+ case VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT:
+ return "VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT";
+ case VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT:
+ return "VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT";
+ case VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV:
+ return "VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV";
+ case VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT:
+ return "VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT";
+ case VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT:
+ return "VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT";
+ case VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT:
+ return "VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT";
+ case VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT:
+ return "VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT";
+ case VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT:
+ return "VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT";
+ case VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT:
+ return "VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT";
+ case VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR:
+ return "VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR";
+ case VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT:
+ return "VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT";
+ case VK_PIPELINE_STAGE_HOST_BIT:
+ return "VK_PIPELINE_STAGE_HOST_BIT";
+ case VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT:
+ return "VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT";
+ case VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV:
+ return "VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV";
+ case VK_PIPELINE_STAGE_NONE_KHR:
+ return "VK_PIPELINE_STAGE_NONE_KHR";
+ case VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR:
+ return "VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR";
+ case VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV:
+ return "VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV";
+ case VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT:
+ return "VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT";
+ case VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT:
+ return "VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT";
+ case VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT:
+ return "VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT";
+ case VK_PIPELINE_STAGE_TRANSFER_BIT:
+ return "VK_PIPELINE_STAGE_TRANSFER_BIT";
+ case VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT:
+ return "VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT";
+ case VK_PIPELINE_STAGE_VERTEX_INPUT_BIT:
+ return "VK_PIPELINE_STAGE_VERTEX_INPUT_BIT";
+ case VK_PIPELINE_STAGE_VERTEX_SHADER_BIT:
+ return "VK_PIPELINE_STAGE_VERTEX_SHADER_BIT";
+ default:
+ return "Unhandled VkPipelineStageFlagBits";
+ }
+}
+
+static inline std::string string_VkPipelineStageFlags(VkPipelineStageFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkPipelineStageFlagBits(static_cast<VkPipelineStageFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkPipelineStageFlagBits(static_cast<VkPipelineStageFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSparseMemoryBindFlagBits(VkSparseMemoryBindFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_SPARSE_MEMORY_BIND_METADATA_BIT:
+ return "VK_SPARSE_MEMORY_BIND_METADATA_BIT";
+ default:
+ return "Unhandled VkSparseMemoryBindFlagBits";
+ }
+}
+
+static inline std::string string_VkSparseMemoryBindFlags(VkSparseMemoryBindFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSparseMemoryBindFlagBits(static_cast<VkSparseMemoryBindFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSparseMemoryBindFlagBits(static_cast<VkSparseMemoryBindFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSparseImageFormatFlagBits(VkSparseImageFormatFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT:
+ return "VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT";
+ case VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT:
+ return "VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT";
+ case VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT:
+ return "VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT";
+ default:
+ return "Unhandled VkSparseImageFormatFlagBits";
+ }
+}
+
+static inline std::string string_VkSparseImageFormatFlags(VkSparseImageFormatFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSparseImageFormatFlagBits(static_cast<VkSparseImageFormatFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSparseImageFormatFlagBits(static_cast<VkSparseImageFormatFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkFenceCreateFlagBits(VkFenceCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_FENCE_CREATE_SIGNALED_BIT:
+ return "VK_FENCE_CREATE_SIGNALED_BIT";
+ default:
+ return "Unhandled VkFenceCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkFenceCreateFlags(VkFenceCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkFenceCreateFlagBits(static_cast<VkFenceCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkFenceCreateFlagBits(static_cast<VkFenceCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkEventCreateFlagBits(VkEventCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR:
+ return "VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR";
+ default:
+ return "Unhandled VkEventCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkEventCreateFlags(VkEventCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkEventCreateFlagBits(static_cast<VkEventCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkEventCreateFlagBits(static_cast<VkEventCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkQueryPipelineStatisticFlagBits(VkQueryPipelineStatisticFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT";
+ case VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT:
+ return "VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT";
+ default:
+ return "Unhandled VkQueryPipelineStatisticFlagBits";
+ }
+}
+
+static inline std::string string_VkQueryPipelineStatisticFlags(VkQueryPipelineStatisticFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkQueryPipelineStatisticFlagBits(static_cast<VkQueryPipelineStatisticFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkQueryPipelineStatisticFlagBits(static_cast<VkQueryPipelineStatisticFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkQueryType(VkQueryType input_value)
+{
+ switch (input_value)
+ {
+ case VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR:
+ return "VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR";
+ case VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV:
+ return "VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV";
+ case VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR:
+ return "VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR";
+ case VK_QUERY_TYPE_OCCLUSION:
+ return "VK_QUERY_TYPE_OCCLUSION";
+ case VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL:
+ return "VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL";
+ case VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR:
+ return "VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR";
+ case VK_QUERY_TYPE_PIPELINE_STATISTICS:
+ return "VK_QUERY_TYPE_PIPELINE_STATISTICS";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR:
+ return "VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ case VK_QUERY_TYPE_TIMESTAMP:
+ return "VK_QUERY_TYPE_TIMESTAMP";
+ case VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT:
+ return "VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_QUERY_TYPE_VIDEO_ENCODE_BITSTREAM_BUFFER_RANGE_KHR:
+ return "VK_QUERY_TYPE_VIDEO_ENCODE_BITSTREAM_BUFFER_RANGE_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkQueryType";
+ }
+}
+
+static inline const char* string_VkQueryResultFlagBits(VkQueryResultFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_QUERY_RESULT_64_BIT:
+ return "VK_QUERY_RESULT_64_BIT";
+ case VK_QUERY_RESULT_PARTIAL_BIT:
+ return "VK_QUERY_RESULT_PARTIAL_BIT";
+ case VK_QUERY_RESULT_WAIT_BIT:
+ return "VK_QUERY_RESULT_WAIT_BIT";
+ case VK_QUERY_RESULT_WITH_AVAILABILITY_BIT:
+ return "VK_QUERY_RESULT_WITH_AVAILABILITY_BIT";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_QUERY_RESULT_WITH_STATUS_BIT_KHR:
+ return "VK_QUERY_RESULT_WITH_STATUS_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkQueryResultFlagBits";
+ }
+}
+
+static inline std::string string_VkQueryResultFlags(VkQueryResultFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkQueryResultFlagBits(static_cast<VkQueryResultFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkQueryResultFlagBits(static_cast<VkQueryResultFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkBufferCreateFlagBits(VkBufferCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT:
+ return "VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT";
+ case VK_BUFFER_CREATE_PROTECTED_BIT:
+ return "VK_BUFFER_CREATE_PROTECTED_BIT";
+ case VK_BUFFER_CREATE_SPARSE_ALIASED_BIT:
+ return "VK_BUFFER_CREATE_SPARSE_ALIASED_BIT";
+ case VK_BUFFER_CREATE_SPARSE_BINDING_BIT:
+ return "VK_BUFFER_CREATE_SPARSE_BINDING_BIT";
+ case VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT:
+ return "VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT";
+ default:
+ return "Unhandled VkBufferCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkBufferCreateFlags(VkBufferCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkBufferCreateFlagBits(static_cast<VkBufferCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkBufferCreateFlagBits(static_cast<VkBufferCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkBufferUsageFlagBits(VkBufferUsageFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR:
+ return "VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR";
+ case VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR:
+ return "VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR";
+ case VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT:
+ return "VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT";
+ case VK_BUFFER_USAGE_INDEX_BUFFER_BIT:
+ return "VK_BUFFER_USAGE_INDEX_BUFFER_BIT";
+ case VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT:
+ return "VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT";
+ case VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR:
+ return "VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR";
+ case VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT:
+ return "VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT";
+ case VK_BUFFER_USAGE_STORAGE_BUFFER_BIT:
+ return "VK_BUFFER_USAGE_STORAGE_BUFFER_BIT";
+ case VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT:
+ return "VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT";
+ case VK_BUFFER_USAGE_TRANSFER_DST_BIT:
+ return "VK_BUFFER_USAGE_TRANSFER_DST_BIT";
+ case VK_BUFFER_USAGE_TRANSFER_SRC_BIT:
+ return "VK_BUFFER_USAGE_TRANSFER_SRC_BIT";
+ case VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT:
+ return "VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT";
+ case VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT:
+ return "VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT";
+ case VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT:
+ return "VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT";
+ case VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT:
+ return "VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT";
+ case VK_BUFFER_USAGE_VERTEX_BUFFER_BIT:
+ return "VK_BUFFER_USAGE_VERTEX_BUFFER_BIT";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR:
+ return "VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR:
+ return "VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR:
+ return "VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR:
+ return "VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkBufferUsageFlagBits";
+ }
+}
+
+static inline std::string string_VkBufferUsageFlags(VkBufferUsageFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkBufferUsageFlagBits(static_cast<VkBufferUsageFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkBufferUsageFlagBits(static_cast<VkBufferUsageFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSharingMode(VkSharingMode input_value)
+{
+ switch (input_value)
+ {
+ case VK_SHARING_MODE_CONCURRENT:
+ return "VK_SHARING_MODE_CONCURRENT";
+ case VK_SHARING_MODE_EXCLUSIVE:
+ return "VK_SHARING_MODE_EXCLUSIVE";
+ default:
+ return "Unhandled VkSharingMode";
+ }
+}
+
+static inline const char* string_VkComponentSwizzle(VkComponentSwizzle input_value)
+{
+ switch (input_value)
+ {
+ case VK_COMPONENT_SWIZZLE_A:
+ return "VK_COMPONENT_SWIZZLE_A";
+ case VK_COMPONENT_SWIZZLE_B:
+ return "VK_COMPONENT_SWIZZLE_B";
+ case VK_COMPONENT_SWIZZLE_G:
+ return "VK_COMPONENT_SWIZZLE_G";
+ case VK_COMPONENT_SWIZZLE_IDENTITY:
+ return "VK_COMPONENT_SWIZZLE_IDENTITY";
+ case VK_COMPONENT_SWIZZLE_ONE:
+ return "VK_COMPONENT_SWIZZLE_ONE";
+ case VK_COMPONENT_SWIZZLE_R:
+ return "VK_COMPONENT_SWIZZLE_R";
+ case VK_COMPONENT_SWIZZLE_ZERO:
+ return "VK_COMPONENT_SWIZZLE_ZERO";
+ default:
+ return "Unhandled VkComponentSwizzle";
+ }
+}
+
+static inline const char* string_VkImageViewCreateFlagBits(VkImageViewCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT:
+ return "VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT";
+ case VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT:
+ return "VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT";
+ default:
+ return "Unhandled VkImageViewCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkImageViewCreateFlags(VkImageViewCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkImageViewCreateFlagBits(static_cast<VkImageViewCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkImageViewCreateFlagBits(static_cast<VkImageViewCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkImageViewType(VkImageViewType input_value)
+{
+ switch (input_value)
+ {
+ case VK_IMAGE_VIEW_TYPE_1D:
+ return "VK_IMAGE_VIEW_TYPE_1D";
+ case VK_IMAGE_VIEW_TYPE_1D_ARRAY:
+ return "VK_IMAGE_VIEW_TYPE_1D_ARRAY";
+ case VK_IMAGE_VIEW_TYPE_2D:
+ return "VK_IMAGE_VIEW_TYPE_2D";
+ case VK_IMAGE_VIEW_TYPE_2D_ARRAY:
+ return "VK_IMAGE_VIEW_TYPE_2D_ARRAY";
+ case VK_IMAGE_VIEW_TYPE_3D:
+ return "VK_IMAGE_VIEW_TYPE_3D";
+ case VK_IMAGE_VIEW_TYPE_CUBE:
+ return "VK_IMAGE_VIEW_TYPE_CUBE";
+ case VK_IMAGE_VIEW_TYPE_CUBE_ARRAY:
+ return "VK_IMAGE_VIEW_TYPE_CUBE_ARRAY";
+ default:
+ return "Unhandled VkImageViewType";
+ }
+}
+
+static inline const char* string_VkPipelineCacheCreateFlagBits(VkPipelineCacheCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT:
+ return "VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT";
+ default:
+ return "Unhandled VkPipelineCacheCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkPipelineCacheCreateFlags(VkPipelineCacheCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkPipelineCacheCreateFlagBits(static_cast<VkPipelineCacheCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkPipelineCacheCreateFlagBits(static_cast<VkPipelineCacheCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkBlendFactor(VkBlendFactor input_value)
+{
+ switch (input_value)
+ {
+ case VK_BLEND_FACTOR_CONSTANT_ALPHA:
+ return "VK_BLEND_FACTOR_CONSTANT_ALPHA";
+ case VK_BLEND_FACTOR_CONSTANT_COLOR:
+ return "VK_BLEND_FACTOR_CONSTANT_COLOR";
+ case VK_BLEND_FACTOR_DST_ALPHA:
+ return "VK_BLEND_FACTOR_DST_ALPHA";
+ case VK_BLEND_FACTOR_DST_COLOR:
+ return "VK_BLEND_FACTOR_DST_COLOR";
+ case VK_BLEND_FACTOR_ONE:
+ return "VK_BLEND_FACTOR_ONE";
+ case VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA:
+ return "VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA";
+ case VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR:
+ return "VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR";
+ case VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA:
+ return "VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA";
+ case VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR:
+ return "VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR";
+ case VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA:
+ return "VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA";
+ case VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR:
+ return "VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR";
+ case VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA:
+ return "VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA";
+ case VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR:
+ return "VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR";
+ case VK_BLEND_FACTOR_SRC1_ALPHA:
+ return "VK_BLEND_FACTOR_SRC1_ALPHA";
+ case VK_BLEND_FACTOR_SRC1_COLOR:
+ return "VK_BLEND_FACTOR_SRC1_COLOR";
+ case VK_BLEND_FACTOR_SRC_ALPHA:
+ return "VK_BLEND_FACTOR_SRC_ALPHA";
+ case VK_BLEND_FACTOR_SRC_ALPHA_SATURATE:
+ return "VK_BLEND_FACTOR_SRC_ALPHA_SATURATE";
+ case VK_BLEND_FACTOR_SRC_COLOR:
+ return "VK_BLEND_FACTOR_SRC_COLOR";
+ case VK_BLEND_FACTOR_ZERO:
+ return "VK_BLEND_FACTOR_ZERO";
+ default:
+ return "Unhandled VkBlendFactor";
+ }
+}
+
+static inline const char* string_VkBlendOp(VkBlendOp input_value)
+{
+ switch (input_value)
+ {
+ case VK_BLEND_OP_ADD:
+ return "VK_BLEND_OP_ADD";
+ case VK_BLEND_OP_BLUE_EXT:
+ return "VK_BLEND_OP_BLUE_EXT";
+ case VK_BLEND_OP_COLORBURN_EXT:
+ return "VK_BLEND_OP_COLORBURN_EXT";
+ case VK_BLEND_OP_COLORDODGE_EXT:
+ return "VK_BLEND_OP_COLORDODGE_EXT";
+ case VK_BLEND_OP_CONTRAST_EXT:
+ return "VK_BLEND_OP_CONTRAST_EXT";
+ case VK_BLEND_OP_DARKEN_EXT:
+ return "VK_BLEND_OP_DARKEN_EXT";
+ case VK_BLEND_OP_DIFFERENCE_EXT:
+ return "VK_BLEND_OP_DIFFERENCE_EXT";
+ case VK_BLEND_OP_DST_ATOP_EXT:
+ return "VK_BLEND_OP_DST_ATOP_EXT";
+ case VK_BLEND_OP_DST_EXT:
+ return "VK_BLEND_OP_DST_EXT";
+ case VK_BLEND_OP_DST_IN_EXT:
+ return "VK_BLEND_OP_DST_IN_EXT";
+ case VK_BLEND_OP_DST_OUT_EXT:
+ return "VK_BLEND_OP_DST_OUT_EXT";
+ case VK_BLEND_OP_DST_OVER_EXT:
+ return "VK_BLEND_OP_DST_OVER_EXT";
+ case VK_BLEND_OP_EXCLUSION_EXT:
+ return "VK_BLEND_OP_EXCLUSION_EXT";
+ case VK_BLEND_OP_GREEN_EXT:
+ return "VK_BLEND_OP_GREEN_EXT";
+ case VK_BLEND_OP_HARDLIGHT_EXT:
+ return "VK_BLEND_OP_HARDLIGHT_EXT";
+ case VK_BLEND_OP_HARDMIX_EXT:
+ return "VK_BLEND_OP_HARDMIX_EXT";
+ case VK_BLEND_OP_HSL_COLOR_EXT:
+ return "VK_BLEND_OP_HSL_COLOR_EXT";
+ case VK_BLEND_OP_HSL_HUE_EXT:
+ return "VK_BLEND_OP_HSL_HUE_EXT";
+ case VK_BLEND_OP_HSL_LUMINOSITY_EXT:
+ return "VK_BLEND_OP_HSL_LUMINOSITY_EXT";
+ case VK_BLEND_OP_HSL_SATURATION_EXT:
+ return "VK_BLEND_OP_HSL_SATURATION_EXT";
+ case VK_BLEND_OP_INVERT_EXT:
+ return "VK_BLEND_OP_INVERT_EXT";
+ case VK_BLEND_OP_INVERT_OVG_EXT:
+ return "VK_BLEND_OP_INVERT_OVG_EXT";
+ case VK_BLEND_OP_INVERT_RGB_EXT:
+ return "VK_BLEND_OP_INVERT_RGB_EXT";
+ case VK_BLEND_OP_LIGHTEN_EXT:
+ return "VK_BLEND_OP_LIGHTEN_EXT";
+ case VK_BLEND_OP_LINEARBURN_EXT:
+ return "VK_BLEND_OP_LINEARBURN_EXT";
+ case VK_BLEND_OP_LINEARDODGE_EXT:
+ return "VK_BLEND_OP_LINEARDODGE_EXT";
+ case VK_BLEND_OP_LINEARLIGHT_EXT:
+ return "VK_BLEND_OP_LINEARLIGHT_EXT";
+ case VK_BLEND_OP_MAX:
+ return "VK_BLEND_OP_MAX";
+ case VK_BLEND_OP_MIN:
+ return "VK_BLEND_OP_MIN";
+ case VK_BLEND_OP_MINUS_CLAMPED_EXT:
+ return "VK_BLEND_OP_MINUS_CLAMPED_EXT";
+ case VK_BLEND_OP_MINUS_EXT:
+ return "VK_BLEND_OP_MINUS_EXT";
+ case VK_BLEND_OP_MULTIPLY_EXT:
+ return "VK_BLEND_OP_MULTIPLY_EXT";
+ case VK_BLEND_OP_OVERLAY_EXT:
+ return "VK_BLEND_OP_OVERLAY_EXT";
+ case VK_BLEND_OP_PINLIGHT_EXT:
+ return "VK_BLEND_OP_PINLIGHT_EXT";
+ case VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT:
+ return "VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT";
+ case VK_BLEND_OP_PLUS_CLAMPED_EXT:
+ return "VK_BLEND_OP_PLUS_CLAMPED_EXT";
+ case VK_BLEND_OP_PLUS_DARKER_EXT:
+ return "VK_BLEND_OP_PLUS_DARKER_EXT";
+ case VK_BLEND_OP_PLUS_EXT:
+ return "VK_BLEND_OP_PLUS_EXT";
+ case VK_BLEND_OP_RED_EXT:
+ return "VK_BLEND_OP_RED_EXT";
+ case VK_BLEND_OP_REVERSE_SUBTRACT:
+ return "VK_BLEND_OP_REVERSE_SUBTRACT";
+ case VK_BLEND_OP_SCREEN_EXT:
+ return "VK_BLEND_OP_SCREEN_EXT";
+ case VK_BLEND_OP_SOFTLIGHT_EXT:
+ return "VK_BLEND_OP_SOFTLIGHT_EXT";
+ case VK_BLEND_OP_SRC_ATOP_EXT:
+ return "VK_BLEND_OP_SRC_ATOP_EXT";
+ case VK_BLEND_OP_SRC_EXT:
+ return "VK_BLEND_OP_SRC_EXT";
+ case VK_BLEND_OP_SRC_IN_EXT:
+ return "VK_BLEND_OP_SRC_IN_EXT";
+ case VK_BLEND_OP_SRC_OUT_EXT:
+ return "VK_BLEND_OP_SRC_OUT_EXT";
+ case VK_BLEND_OP_SRC_OVER_EXT:
+ return "VK_BLEND_OP_SRC_OVER_EXT";
+ case VK_BLEND_OP_SUBTRACT:
+ return "VK_BLEND_OP_SUBTRACT";
+ case VK_BLEND_OP_VIVIDLIGHT_EXT:
+ return "VK_BLEND_OP_VIVIDLIGHT_EXT";
+ case VK_BLEND_OP_XOR_EXT:
+ return "VK_BLEND_OP_XOR_EXT";
+ case VK_BLEND_OP_ZERO_EXT:
+ return "VK_BLEND_OP_ZERO_EXT";
+ default:
+ return "Unhandled VkBlendOp";
+ }
+}
+
+static inline const char* string_VkColorComponentFlagBits(VkColorComponentFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_COLOR_COMPONENT_A_BIT:
+ return "VK_COLOR_COMPONENT_A_BIT";
+ case VK_COLOR_COMPONENT_B_BIT:
+ return "VK_COLOR_COMPONENT_B_BIT";
+ case VK_COLOR_COMPONENT_G_BIT:
+ return "VK_COLOR_COMPONENT_G_BIT";
+ case VK_COLOR_COMPONENT_R_BIT:
+ return "VK_COLOR_COMPONENT_R_BIT";
+ default:
+ return "Unhandled VkColorComponentFlagBits";
+ }
+}
+
+static inline std::string string_VkColorComponentFlags(VkColorComponentFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkColorComponentFlagBits(static_cast<VkColorComponentFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkColorComponentFlagBits(static_cast<VkColorComponentFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkCompareOp(VkCompareOp input_value)
+{
+ switch (input_value)
+ {
+ case VK_COMPARE_OP_ALWAYS:
+ return "VK_COMPARE_OP_ALWAYS";
+ case VK_COMPARE_OP_EQUAL:
+ return "VK_COMPARE_OP_EQUAL";
+ case VK_COMPARE_OP_GREATER:
+ return "VK_COMPARE_OP_GREATER";
+ case VK_COMPARE_OP_GREATER_OR_EQUAL:
+ return "VK_COMPARE_OP_GREATER_OR_EQUAL";
+ case VK_COMPARE_OP_LESS:
+ return "VK_COMPARE_OP_LESS";
+ case VK_COMPARE_OP_LESS_OR_EQUAL:
+ return "VK_COMPARE_OP_LESS_OR_EQUAL";
+ case VK_COMPARE_OP_NEVER:
+ return "VK_COMPARE_OP_NEVER";
+ case VK_COMPARE_OP_NOT_EQUAL:
+ return "VK_COMPARE_OP_NOT_EQUAL";
+ default:
+ return "Unhandled VkCompareOp";
+ }
+}
+
+static inline const char* string_VkPipelineCreateFlagBits(VkPipelineCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT:
+ return "VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT";
+ case VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR:
+ return "VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR";
+ case VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR:
+ return "VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR";
+ case VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV:
+ return "VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV";
+ case VK_PIPELINE_CREATE_DERIVATIVE_BIT:
+ return "VK_PIPELINE_CREATE_DERIVATIVE_BIT";
+ case VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT:
+ return "VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT";
+ case VK_PIPELINE_CREATE_DISPATCH_BASE_BIT:
+ return "VK_PIPELINE_CREATE_DISPATCH_BASE_BIT";
+ case VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT:
+ return "VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT";
+ case VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT:
+ return "VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT";
+ case VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV:
+ return "VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV";
+ case VK_PIPELINE_CREATE_LIBRARY_BIT_KHR:
+ return "VK_PIPELINE_CREATE_LIBRARY_BIT_KHR";
+ case VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV:
+ return "VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV";
+ case VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR:
+ return "VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR";
+ case VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR:
+ return "VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR";
+ case VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR:
+ return "VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR";
+ case VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR:
+ return "VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR";
+ case VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR:
+ return "VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR";
+ case VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR:
+ return "VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR";
+ case VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR:
+ return "VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR";
+ case VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT:
+ return "VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT";
+ case VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT:
+ return "VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT";
+ case VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR:
+ return "VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR";
+ default:
+ return "Unhandled VkPipelineCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkPipelineCreateFlags(VkPipelineCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkPipelineCreateFlagBits(static_cast<VkPipelineCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkPipelineCreateFlagBits(static_cast<VkPipelineCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPipelineShaderStageCreateFlagBits(VkPipelineShaderStageCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT:
+ return "VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT";
+ case VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT:
+ return "VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT";
+ default:
+ return "Unhandled VkPipelineShaderStageCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkPipelineShaderStageCreateFlags(VkPipelineShaderStageCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkPipelineShaderStageCreateFlagBits(static_cast<VkPipelineShaderStageCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkPipelineShaderStageCreateFlagBits(static_cast<VkPipelineShaderStageCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkShaderStageFlagBits(VkShaderStageFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_SHADER_STAGE_ALL:
+ return "VK_SHADER_STAGE_ALL";
+ case VK_SHADER_STAGE_ALL_GRAPHICS:
+ return "VK_SHADER_STAGE_ALL_GRAPHICS";
+ case VK_SHADER_STAGE_ANY_HIT_BIT_KHR:
+ return "VK_SHADER_STAGE_ANY_HIT_BIT_KHR";
+ case VK_SHADER_STAGE_CALLABLE_BIT_KHR:
+ return "VK_SHADER_STAGE_CALLABLE_BIT_KHR";
+ case VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR:
+ return "VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR";
+ case VK_SHADER_STAGE_COMPUTE_BIT:
+ return "VK_SHADER_STAGE_COMPUTE_BIT";
+ case VK_SHADER_STAGE_FRAGMENT_BIT:
+ return "VK_SHADER_STAGE_FRAGMENT_BIT";
+ case VK_SHADER_STAGE_GEOMETRY_BIT:
+ return "VK_SHADER_STAGE_GEOMETRY_BIT";
+ case VK_SHADER_STAGE_INTERSECTION_BIT_KHR:
+ return "VK_SHADER_STAGE_INTERSECTION_BIT_KHR";
+ case VK_SHADER_STAGE_MESH_BIT_NV:
+ return "VK_SHADER_STAGE_MESH_BIT_NV";
+ case VK_SHADER_STAGE_MISS_BIT_KHR:
+ return "VK_SHADER_STAGE_MISS_BIT_KHR";
+ case VK_SHADER_STAGE_RAYGEN_BIT_KHR:
+ return "VK_SHADER_STAGE_RAYGEN_BIT_KHR";
+ case VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI:
+ return "VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI";
+ case VK_SHADER_STAGE_TASK_BIT_NV:
+ return "VK_SHADER_STAGE_TASK_BIT_NV";
+ case VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT:
+ return "VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT";
+ case VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT:
+ return "VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT";
+ case VK_SHADER_STAGE_VERTEX_BIT:
+ return "VK_SHADER_STAGE_VERTEX_BIT";
+ default:
+ return "Unhandled VkShaderStageFlagBits";
+ }
+}
+
+static inline std::string string_VkShaderStageFlags(VkShaderStageFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkShaderStageFlagBits(static_cast<VkShaderStageFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkShaderStageFlagBits(static_cast<VkShaderStageFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkCullModeFlagBits(VkCullModeFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_CULL_MODE_BACK_BIT:
+ return "VK_CULL_MODE_BACK_BIT";
+ case VK_CULL_MODE_FRONT_AND_BACK:
+ return "VK_CULL_MODE_FRONT_AND_BACK";
+ case VK_CULL_MODE_FRONT_BIT:
+ return "VK_CULL_MODE_FRONT_BIT";
+ case VK_CULL_MODE_NONE:
+ return "VK_CULL_MODE_NONE";
+ default:
+ return "Unhandled VkCullModeFlagBits";
+ }
+}
+
+static inline std::string string_VkCullModeFlags(VkCullModeFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkCullModeFlagBits(static_cast<VkCullModeFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkCullModeFlagBits(static_cast<VkCullModeFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDynamicState(VkDynamicState input_value)
+{
+ switch (input_value)
+ {
+ case VK_DYNAMIC_STATE_BLEND_CONSTANTS:
+ return "VK_DYNAMIC_STATE_BLEND_CONSTANTS";
+ case VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT:
+ return "VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT";
+ case VK_DYNAMIC_STATE_CULL_MODE_EXT:
+ return "VK_DYNAMIC_STATE_CULL_MODE_EXT";
+ case VK_DYNAMIC_STATE_DEPTH_BIAS:
+ return "VK_DYNAMIC_STATE_DEPTH_BIAS";
+ case VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT:
+ return "VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT";
+ case VK_DYNAMIC_STATE_DEPTH_BOUNDS:
+ return "VK_DYNAMIC_STATE_DEPTH_BOUNDS";
+ case VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT:
+ return "VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT";
+ case VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT:
+ return "VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT";
+ case VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT:
+ return "VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT";
+ case VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT:
+ return "VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT";
+ case VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT:
+ return "VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT";
+ case VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV:
+ return "VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV";
+ case VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR:
+ return "VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR";
+ case VK_DYNAMIC_STATE_FRONT_FACE_EXT:
+ return "VK_DYNAMIC_STATE_FRONT_FACE_EXT";
+ case VK_DYNAMIC_STATE_LINE_STIPPLE_EXT:
+ return "VK_DYNAMIC_STATE_LINE_STIPPLE_EXT";
+ case VK_DYNAMIC_STATE_LINE_WIDTH:
+ return "VK_DYNAMIC_STATE_LINE_WIDTH";
+ case VK_DYNAMIC_STATE_LOGIC_OP_EXT:
+ return "VK_DYNAMIC_STATE_LOGIC_OP_EXT";
+ case VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT:
+ return "VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT";
+ case VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT:
+ return "VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT";
+ case VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT:
+ return "VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT";
+ case VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT:
+ return "VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT";
+ case VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR:
+ return "VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR";
+ case VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT:
+ return "VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT";
+ case VK_DYNAMIC_STATE_SCISSOR:
+ return "VK_DYNAMIC_STATE_SCISSOR";
+ case VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT:
+ return "VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT";
+ case VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK:
+ return "VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK";
+ case VK_DYNAMIC_STATE_STENCIL_OP_EXT:
+ return "VK_DYNAMIC_STATE_STENCIL_OP_EXT";
+ case VK_DYNAMIC_STATE_STENCIL_REFERENCE:
+ return "VK_DYNAMIC_STATE_STENCIL_REFERENCE";
+ case VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT:
+ return "VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT";
+ case VK_DYNAMIC_STATE_STENCIL_WRITE_MASK:
+ return "VK_DYNAMIC_STATE_STENCIL_WRITE_MASK";
+ case VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT:
+ return "VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT";
+ case VK_DYNAMIC_STATE_VERTEX_INPUT_EXT:
+ return "VK_DYNAMIC_STATE_VERTEX_INPUT_EXT";
+ case VK_DYNAMIC_STATE_VIEWPORT:
+ return "VK_DYNAMIC_STATE_VIEWPORT";
+ case VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV:
+ return "VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV";
+ case VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV:
+ return "VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV";
+ case VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT:
+ return "VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT";
+ case VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV:
+ return "VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV";
+ default:
+ return "Unhandled VkDynamicState";
+ }
+}
+
+static inline const char* string_VkFrontFace(VkFrontFace input_value)
+{
+ switch (input_value)
+ {
+ case VK_FRONT_FACE_CLOCKWISE:
+ return "VK_FRONT_FACE_CLOCKWISE";
+ case VK_FRONT_FACE_COUNTER_CLOCKWISE:
+ return "VK_FRONT_FACE_COUNTER_CLOCKWISE";
+ default:
+ return "Unhandled VkFrontFace";
+ }
+}
+
+static inline const char* string_VkVertexInputRate(VkVertexInputRate input_value)
+{
+ switch (input_value)
+ {
+ case VK_VERTEX_INPUT_RATE_INSTANCE:
+ return "VK_VERTEX_INPUT_RATE_INSTANCE";
+ case VK_VERTEX_INPUT_RATE_VERTEX:
+ return "VK_VERTEX_INPUT_RATE_VERTEX";
+ default:
+ return "Unhandled VkVertexInputRate";
+ }
+}
+
+static inline const char* string_VkPrimitiveTopology(VkPrimitiveTopology input_value)
+{
+ switch (input_value)
+ {
+ case VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+ return "VK_PRIMITIVE_TOPOLOGY_LINE_LIST";
+ case VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
+ return "VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY";
+ case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
+ return "VK_PRIMITIVE_TOPOLOGY_LINE_STRIP";
+ case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
+ return "VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY";
+ case VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
+ return "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST";
+ case VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
+ return "VK_PRIMITIVE_TOPOLOGY_POINT_LIST";
+ case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
+ return "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN";
+ case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
+ return "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST";
+ case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
+ return "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY";
+ case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
+ return "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP";
+ case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
+ return "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY";
+ default:
+ return "Unhandled VkPrimitiveTopology";
+ }
+}
+
+static inline const char* string_VkPolygonMode(VkPolygonMode input_value)
+{
+ switch (input_value)
+ {
+ case VK_POLYGON_MODE_FILL:
+ return "VK_POLYGON_MODE_FILL";
+ case VK_POLYGON_MODE_FILL_RECTANGLE_NV:
+ return "VK_POLYGON_MODE_FILL_RECTANGLE_NV";
+ case VK_POLYGON_MODE_LINE:
+ return "VK_POLYGON_MODE_LINE";
+ case VK_POLYGON_MODE_POINT:
+ return "VK_POLYGON_MODE_POINT";
+ default:
+ return "Unhandled VkPolygonMode";
+ }
+}
+
+static inline const char* string_VkStencilOp(VkStencilOp input_value)
+{
+ switch (input_value)
+ {
+ case VK_STENCIL_OP_DECREMENT_AND_CLAMP:
+ return "VK_STENCIL_OP_DECREMENT_AND_CLAMP";
+ case VK_STENCIL_OP_DECREMENT_AND_WRAP:
+ return "VK_STENCIL_OP_DECREMENT_AND_WRAP";
+ case VK_STENCIL_OP_INCREMENT_AND_CLAMP:
+ return "VK_STENCIL_OP_INCREMENT_AND_CLAMP";
+ case VK_STENCIL_OP_INCREMENT_AND_WRAP:
+ return "VK_STENCIL_OP_INCREMENT_AND_WRAP";
+ case VK_STENCIL_OP_INVERT:
+ return "VK_STENCIL_OP_INVERT";
+ case VK_STENCIL_OP_KEEP:
+ return "VK_STENCIL_OP_KEEP";
+ case VK_STENCIL_OP_REPLACE:
+ return "VK_STENCIL_OP_REPLACE";
+ case VK_STENCIL_OP_ZERO:
+ return "VK_STENCIL_OP_ZERO";
+ default:
+ return "Unhandled VkStencilOp";
+ }
+}
+
+static inline const char* string_VkLogicOp(VkLogicOp input_value)
+{
+ switch (input_value)
+ {
+ case VK_LOGIC_OP_AND:
+ return "VK_LOGIC_OP_AND";
+ case VK_LOGIC_OP_AND_INVERTED:
+ return "VK_LOGIC_OP_AND_INVERTED";
+ case VK_LOGIC_OP_AND_REVERSE:
+ return "VK_LOGIC_OP_AND_REVERSE";
+ case VK_LOGIC_OP_CLEAR:
+ return "VK_LOGIC_OP_CLEAR";
+ case VK_LOGIC_OP_COPY:
+ return "VK_LOGIC_OP_COPY";
+ case VK_LOGIC_OP_COPY_INVERTED:
+ return "VK_LOGIC_OP_COPY_INVERTED";
+ case VK_LOGIC_OP_EQUIVALENT:
+ return "VK_LOGIC_OP_EQUIVALENT";
+ case VK_LOGIC_OP_INVERT:
+ return "VK_LOGIC_OP_INVERT";
+ case VK_LOGIC_OP_NAND:
+ return "VK_LOGIC_OP_NAND";
+ case VK_LOGIC_OP_NOR:
+ return "VK_LOGIC_OP_NOR";
+ case VK_LOGIC_OP_NO_OP:
+ return "VK_LOGIC_OP_NO_OP";
+ case VK_LOGIC_OP_OR:
+ return "VK_LOGIC_OP_OR";
+ case VK_LOGIC_OP_OR_INVERTED:
+ return "VK_LOGIC_OP_OR_INVERTED";
+ case VK_LOGIC_OP_OR_REVERSE:
+ return "VK_LOGIC_OP_OR_REVERSE";
+ case VK_LOGIC_OP_SET:
+ return "VK_LOGIC_OP_SET";
+ case VK_LOGIC_OP_XOR:
+ return "VK_LOGIC_OP_XOR";
+ default:
+ return "Unhandled VkLogicOp";
+ }
+}
+
+static inline const char* string_VkBorderColor(VkBorderColor input_value)
+{
+ switch (input_value)
+ {
+ case VK_BORDER_COLOR_FLOAT_CUSTOM_EXT:
+ return "VK_BORDER_COLOR_FLOAT_CUSTOM_EXT";
+ case VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK:
+ return "VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK";
+ case VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE:
+ return "VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE";
+ case VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK:
+ return "VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK";
+ case VK_BORDER_COLOR_INT_CUSTOM_EXT:
+ return "VK_BORDER_COLOR_INT_CUSTOM_EXT";
+ case VK_BORDER_COLOR_INT_OPAQUE_BLACK:
+ return "VK_BORDER_COLOR_INT_OPAQUE_BLACK";
+ case VK_BORDER_COLOR_INT_OPAQUE_WHITE:
+ return "VK_BORDER_COLOR_INT_OPAQUE_WHITE";
+ case VK_BORDER_COLOR_INT_TRANSPARENT_BLACK:
+ return "VK_BORDER_COLOR_INT_TRANSPARENT_BLACK";
+ default:
+ return "Unhandled VkBorderColor";
+ }
+}
+
+static inline const char* string_VkFilter(VkFilter input_value)
+{
+ switch (input_value)
+ {
+ case VK_FILTER_CUBIC_IMG:
+ return "VK_FILTER_CUBIC_IMG";
+ case VK_FILTER_LINEAR:
+ return "VK_FILTER_LINEAR";
+ case VK_FILTER_NEAREST:
+ return "VK_FILTER_NEAREST";
+ default:
+ return "Unhandled VkFilter";
+ }
+}
+
+static inline const char* string_VkSamplerAddressMode(VkSamplerAddressMode input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER:
+ return "VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER";
+ case VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE:
+ return "VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE";
+ case VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT:
+ return "VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT";
+ case VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE:
+ return "VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE";
+ case VK_SAMPLER_ADDRESS_MODE_REPEAT:
+ return "VK_SAMPLER_ADDRESS_MODE_REPEAT";
+ default:
+ return "Unhandled VkSamplerAddressMode";
+ }
+}
+
+static inline const char* string_VkSamplerCreateFlagBits(VkSamplerCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT:
+ return "VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT";
+ case VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT:
+ return "VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT";
+ default:
+ return "Unhandled VkSamplerCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkSamplerCreateFlags(VkSamplerCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSamplerCreateFlagBits(static_cast<VkSamplerCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSamplerCreateFlagBits(static_cast<VkSamplerCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSamplerMipmapMode(VkSamplerMipmapMode input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLER_MIPMAP_MODE_LINEAR:
+ return "VK_SAMPLER_MIPMAP_MODE_LINEAR";
+ case VK_SAMPLER_MIPMAP_MODE_NEAREST:
+ return "VK_SAMPLER_MIPMAP_MODE_NEAREST";
+ default:
+ return "Unhandled VkSamplerMipmapMode";
+ }
+}
+
+static inline const char* string_VkDescriptorPoolCreateFlagBits(VkDescriptorPoolCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT:
+ return "VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT";
+ case VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE:
+ return "VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE";
+ case VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT:
+ return "VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT";
+ default:
+ return "Unhandled VkDescriptorPoolCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkDescriptorPoolCreateFlags(VkDescriptorPoolCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDescriptorPoolCreateFlagBits(static_cast<VkDescriptorPoolCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDescriptorPoolCreateFlagBits(static_cast<VkDescriptorPoolCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDescriptorType(VkDescriptorType input_value)
+{
+ switch (input_value)
+ {
+ case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR:
+ return "VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR";
+ case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV:
+ return "VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV";
+ case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
+ return "VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER";
+ case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT:
+ return "VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT";
+ case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
+ return "VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT";
+ case VK_DESCRIPTOR_TYPE_MUTABLE_VALVE:
+ return "VK_DESCRIPTOR_TYPE_MUTABLE_VALVE";
+ case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
+ return "VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE";
+ case VK_DESCRIPTOR_TYPE_SAMPLER:
+ return "VK_DESCRIPTOR_TYPE_SAMPLER";
+ case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
+ return "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER";
+ case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
+ return "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC";
+ case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
+ return "VK_DESCRIPTOR_TYPE_STORAGE_IMAGE";
+ case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
+ return "VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER";
+ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
+ return "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER";
+ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
+ return "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC";
+ case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
+ return "VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER";
+ default:
+ return "Unhandled VkDescriptorType";
+ }
+}
+
+static inline const char* string_VkDescriptorSetLayoutCreateFlagBits(VkDescriptorSetLayoutCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE:
+ return "VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE";
+ case VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR:
+ return "VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR";
+ case VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT:
+ return "VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT";
+ default:
+ return "Unhandled VkDescriptorSetLayoutCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkDescriptorSetLayoutCreateFlags(VkDescriptorSetLayoutCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDescriptorSetLayoutCreateFlagBits(static_cast<VkDescriptorSetLayoutCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDescriptorSetLayoutCreateFlagBits(static_cast<VkDescriptorSetLayoutCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkAttachmentDescriptionFlagBits(VkAttachmentDescriptionFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT:
+ return "VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT";
+ default:
+ return "Unhandled VkAttachmentDescriptionFlagBits";
+ }
+}
+
+static inline std::string string_VkAttachmentDescriptionFlags(VkAttachmentDescriptionFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkAttachmentDescriptionFlagBits(static_cast<VkAttachmentDescriptionFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkAttachmentDescriptionFlagBits(static_cast<VkAttachmentDescriptionFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkAttachmentLoadOp(VkAttachmentLoadOp input_value)
+{
+ switch (input_value)
+ {
+ case VK_ATTACHMENT_LOAD_OP_CLEAR:
+ return "VK_ATTACHMENT_LOAD_OP_CLEAR";
+ case VK_ATTACHMENT_LOAD_OP_DONT_CARE:
+ return "VK_ATTACHMENT_LOAD_OP_DONT_CARE";
+ case VK_ATTACHMENT_LOAD_OP_LOAD:
+ return "VK_ATTACHMENT_LOAD_OP_LOAD";
+ case VK_ATTACHMENT_LOAD_OP_NONE_EXT:
+ return "VK_ATTACHMENT_LOAD_OP_NONE_EXT";
+ default:
+ return "Unhandled VkAttachmentLoadOp";
+ }
+}
+
+static inline const char* string_VkAttachmentStoreOp(VkAttachmentStoreOp input_value)
+{
+ switch (input_value)
+ {
+ case VK_ATTACHMENT_STORE_OP_DONT_CARE:
+ return "VK_ATTACHMENT_STORE_OP_DONT_CARE";
+ case VK_ATTACHMENT_STORE_OP_NONE_KHR:
+ return "VK_ATTACHMENT_STORE_OP_NONE_KHR";
+ case VK_ATTACHMENT_STORE_OP_STORE:
+ return "VK_ATTACHMENT_STORE_OP_STORE";
+ default:
+ return "Unhandled VkAttachmentStoreOp";
+ }
+}
+
+static inline const char* string_VkDependencyFlagBits(VkDependencyFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEPENDENCY_BY_REGION_BIT:
+ return "VK_DEPENDENCY_BY_REGION_BIT";
+ case VK_DEPENDENCY_DEVICE_GROUP_BIT:
+ return "VK_DEPENDENCY_DEVICE_GROUP_BIT";
+ case VK_DEPENDENCY_VIEW_LOCAL_BIT:
+ return "VK_DEPENDENCY_VIEW_LOCAL_BIT";
+ default:
+ return "Unhandled VkDependencyFlagBits";
+ }
+}
+
+static inline std::string string_VkDependencyFlags(VkDependencyFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDependencyFlagBits(static_cast<VkDependencyFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDependencyFlagBits(static_cast<VkDependencyFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkFramebufferCreateFlagBits(VkFramebufferCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT:
+ return "VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT";
+ default:
+ return "Unhandled VkFramebufferCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkFramebufferCreateFlags(VkFramebufferCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkFramebufferCreateFlagBits(static_cast<VkFramebufferCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkFramebufferCreateFlagBits(static_cast<VkFramebufferCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPipelineBindPoint(VkPipelineBindPoint input_value)
+{
+ switch (input_value)
+ {
+ case VK_PIPELINE_BIND_POINT_COMPUTE:
+ return "VK_PIPELINE_BIND_POINT_COMPUTE";
+ case VK_PIPELINE_BIND_POINT_GRAPHICS:
+ return "VK_PIPELINE_BIND_POINT_GRAPHICS";
+ case VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR:
+ return "VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR";
+ case VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI:
+ return "VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI";
+ default:
+ return "Unhandled VkPipelineBindPoint";
+ }
+}
+
+static inline const char* string_VkRenderPassCreateFlagBits(VkRenderPassCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM:
+ return "VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM";
+ default:
+ return "Unhandled VkRenderPassCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkRenderPassCreateFlags(VkRenderPassCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkRenderPassCreateFlagBits(static_cast<VkRenderPassCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkRenderPassCreateFlagBits(static_cast<VkRenderPassCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSubpassDescriptionFlagBits(VkSubpassDescriptionFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM:
+ return "VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM";
+ case VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX:
+ return "VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX";
+ case VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX:
+ return "VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX";
+ case VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM:
+ return "VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM";
+ default:
+ return "Unhandled VkSubpassDescriptionFlagBits";
+ }
+}
+
+static inline std::string string_VkSubpassDescriptionFlags(VkSubpassDescriptionFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSubpassDescriptionFlagBits(static_cast<VkSubpassDescriptionFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSubpassDescriptionFlagBits(static_cast<VkSubpassDescriptionFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkCommandPoolCreateFlagBits(VkCommandPoolCreateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_COMMAND_POOL_CREATE_PROTECTED_BIT:
+ return "VK_COMMAND_POOL_CREATE_PROTECTED_BIT";
+ case VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT:
+ return "VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT";
+ case VK_COMMAND_POOL_CREATE_TRANSIENT_BIT:
+ return "VK_COMMAND_POOL_CREATE_TRANSIENT_BIT";
+ default:
+ return "Unhandled VkCommandPoolCreateFlagBits";
+ }
+}
+
+static inline std::string string_VkCommandPoolCreateFlags(VkCommandPoolCreateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkCommandPoolCreateFlagBits(static_cast<VkCommandPoolCreateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkCommandPoolCreateFlagBits(static_cast<VkCommandPoolCreateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkCommandPoolResetFlagBits(VkCommandPoolResetFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT:
+ return "VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT";
+ default:
+ return "Unhandled VkCommandPoolResetFlagBits";
+ }
+}
+
+static inline std::string string_VkCommandPoolResetFlags(VkCommandPoolResetFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkCommandPoolResetFlagBits(static_cast<VkCommandPoolResetFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkCommandPoolResetFlagBits(static_cast<VkCommandPoolResetFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkCommandBufferLevel(VkCommandBufferLevel input_value)
+{
+ switch (input_value)
+ {
+ case VK_COMMAND_BUFFER_LEVEL_PRIMARY:
+ return "VK_COMMAND_BUFFER_LEVEL_PRIMARY";
+ case VK_COMMAND_BUFFER_LEVEL_SECONDARY:
+ return "VK_COMMAND_BUFFER_LEVEL_SECONDARY";
+ default:
+ return "Unhandled VkCommandBufferLevel";
+ }
+}
+
+static inline const char* string_VkCommandBufferUsageFlagBits(VkCommandBufferUsageFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT:
+ return "VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT";
+ case VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT:
+ return "VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT";
+ case VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT:
+ return "VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT";
+ default:
+ return "Unhandled VkCommandBufferUsageFlagBits";
+ }
+}
+
+static inline std::string string_VkCommandBufferUsageFlags(VkCommandBufferUsageFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkCommandBufferUsageFlagBits(static_cast<VkCommandBufferUsageFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkCommandBufferUsageFlagBits(static_cast<VkCommandBufferUsageFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkQueryControlFlagBits(VkQueryControlFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_QUERY_CONTROL_PRECISE_BIT:
+ return "VK_QUERY_CONTROL_PRECISE_BIT";
+ default:
+ return "Unhandled VkQueryControlFlagBits";
+ }
+}
+
+static inline std::string string_VkQueryControlFlags(VkQueryControlFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkQueryControlFlagBits(static_cast<VkQueryControlFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkQueryControlFlagBits(static_cast<VkQueryControlFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkCommandBufferResetFlagBits(VkCommandBufferResetFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT:
+ return "VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT";
+ default:
+ return "Unhandled VkCommandBufferResetFlagBits";
+ }
+}
+
+static inline std::string string_VkCommandBufferResetFlags(VkCommandBufferResetFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkCommandBufferResetFlagBits(static_cast<VkCommandBufferResetFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkCommandBufferResetFlagBits(static_cast<VkCommandBufferResetFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkIndexType(VkIndexType input_value)
+{
+ switch (input_value)
+ {
+ case VK_INDEX_TYPE_NONE_KHR:
+ return "VK_INDEX_TYPE_NONE_KHR";
+ case VK_INDEX_TYPE_UINT16:
+ return "VK_INDEX_TYPE_UINT16";
+ case VK_INDEX_TYPE_UINT32:
+ return "VK_INDEX_TYPE_UINT32";
+ case VK_INDEX_TYPE_UINT8_EXT:
+ return "VK_INDEX_TYPE_UINT8_EXT";
+ default:
+ return "Unhandled VkIndexType";
+ }
+}
+
+static inline const char* string_VkStencilFaceFlagBits(VkStencilFaceFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_STENCIL_FACE_BACK_BIT:
+ return "VK_STENCIL_FACE_BACK_BIT";
+ case VK_STENCIL_FACE_FRONT_AND_BACK:
+ return "VK_STENCIL_FACE_FRONT_AND_BACK";
+ case VK_STENCIL_FACE_FRONT_BIT:
+ return "VK_STENCIL_FACE_FRONT_BIT";
+ default:
+ return "Unhandled VkStencilFaceFlagBits";
+ }
+}
+
+static inline std::string string_VkStencilFaceFlags(VkStencilFaceFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkStencilFaceFlagBits(static_cast<VkStencilFaceFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkStencilFaceFlagBits(static_cast<VkStencilFaceFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSubpassContents(VkSubpassContents input_value)
+{
+ switch (input_value)
+ {
+ case VK_SUBPASS_CONTENTS_INLINE:
+ return "VK_SUBPASS_CONTENTS_INLINE";
+ case VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS:
+ return "VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS";
+ default:
+ return "Unhandled VkSubpassContents";
+ }
+}
+
+static inline const char* string_VkSubgroupFeatureFlagBits(VkSubgroupFeatureFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_SUBGROUP_FEATURE_ARITHMETIC_BIT:
+ return "VK_SUBGROUP_FEATURE_ARITHMETIC_BIT";
+ case VK_SUBGROUP_FEATURE_BALLOT_BIT:
+ return "VK_SUBGROUP_FEATURE_BALLOT_BIT";
+ case VK_SUBGROUP_FEATURE_BASIC_BIT:
+ return "VK_SUBGROUP_FEATURE_BASIC_BIT";
+ case VK_SUBGROUP_FEATURE_CLUSTERED_BIT:
+ return "VK_SUBGROUP_FEATURE_CLUSTERED_BIT";
+ case VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV:
+ return "VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV";
+ case VK_SUBGROUP_FEATURE_QUAD_BIT:
+ return "VK_SUBGROUP_FEATURE_QUAD_BIT";
+ case VK_SUBGROUP_FEATURE_SHUFFLE_BIT:
+ return "VK_SUBGROUP_FEATURE_SHUFFLE_BIT";
+ case VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT:
+ return "VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT";
+ case VK_SUBGROUP_FEATURE_VOTE_BIT:
+ return "VK_SUBGROUP_FEATURE_VOTE_BIT";
+ default:
+ return "Unhandled VkSubgroupFeatureFlagBits";
+ }
+}
+
+static inline std::string string_VkSubgroupFeatureFlags(VkSubgroupFeatureFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSubgroupFeatureFlagBits(static_cast<VkSubgroupFeatureFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSubgroupFeatureFlagBits(static_cast<VkSubgroupFeatureFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPeerMemoryFeatureFlagBits(VkPeerMemoryFeatureFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_PEER_MEMORY_FEATURE_COPY_DST_BIT:
+ return "VK_PEER_MEMORY_FEATURE_COPY_DST_BIT";
+ case VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT:
+ return "VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT";
+ case VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT:
+ return "VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT";
+ case VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT:
+ return "VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT";
+ default:
+ return "Unhandled VkPeerMemoryFeatureFlagBits";
+ }
+}
+
+static inline std::string string_VkPeerMemoryFeatureFlags(VkPeerMemoryFeatureFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkPeerMemoryFeatureFlagBits(static_cast<VkPeerMemoryFeatureFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkPeerMemoryFeatureFlagBits(static_cast<VkPeerMemoryFeatureFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkMemoryAllocateFlagBits(VkMemoryAllocateFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT:
+ return "VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT";
+ case VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT:
+ return "VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT";
+ case VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT:
+ return "VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT";
+ default:
+ return "Unhandled VkMemoryAllocateFlagBits";
+ }
+}
+
+static inline std::string string_VkMemoryAllocateFlags(VkMemoryAllocateFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkMemoryAllocateFlagBits(static_cast<VkMemoryAllocateFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkMemoryAllocateFlagBits(static_cast<VkMemoryAllocateFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPointClippingBehavior(VkPointClippingBehavior input_value)
+{
+ switch (input_value)
+ {
+ case VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES:
+ return "VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES";
+ case VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY:
+ return "VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY";
+ default:
+ return "Unhandled VkPointClippingBehavior";
+ }
+}
+
+static inline const char* string_VkTessellationDomainOrigin(VkTessellationDomainOrigin input_value)
+{
+ switch (input_value)
+ {
+ case VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT:
+ return "VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT";
+ case VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT:
+ return "VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT";
+ default:
+ return "Unhandled VkTessellationDomainOrigin";
+ }
+}
+
+static inline const char* string_VkSamplerYcbcrModelConversion(VkSamplerYcbcrModelConversion input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY";
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020";
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601";
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709";
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY";
+ default:
+ return "Unhandled VkSamplerYcbcrModelConversion";
+ }
+}
+
+static inline const char* string_VkSamplerYcbcrRange(VkSamplerYcbcrRange input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLER_YCBCR_RANGE_ITU_FULL:
+ return "VK_SAMPLER_YCBCR_RANGE_ITU_FULL";
+ case VK_SAMPLER_YCBCR_RANGE_ITU_NARROW:
+ return "VK_SAMPLER_YCBCR_RANGE_ITU_NARROW";
+ default:
+ return "Unhandled VkSamplerYcbcrRange";
+ }
+}
+
+static inline const char* string_VkChromaLocation(VkChromaLocation input_value)
+{
+ switch (input_value)
+ {
+ case VK_CHROMA_LOCATION_COSITED_EVEN:
+ return "VK_CHROMA_LOCATION_COSITED_EVEN";
+ case VK_CHROMA_LOCATION_MIDPOINT:
+ return "VK_CHROMA_LOCATION_MIDPOINT";
+ default:
+ return "Unhandled VkChromaLocation";
+ }
+}
+
+static inline const char* string_VkDescriptorUpdateTemplateType(VkDescriptorUpdateTemplateType input_value)
+{
+ switch (input_value)
+ {
+ case VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET:
+ return "VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET";
+ case VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR:
+ return "VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR";
+ default:
+ return "Unhandled VkDescriptorUpdateTemplateType";
+ }
+}
+
+static inline const char* string_VkExternalMemoryHandleTypeFlagBits(VkExternalMemoryHandleTypeFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA";
+ default:
+ return "Unhandled VkExternalMemoryHandleTypeFlagBits";
+ }
+}
+
+static inline std::string string_VkExternalMemoryHandleTypeFlags(VkExternalMemoryHandleTypeFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalMemoryHandleTypeFlagBits(static_cast<VkExternalMemoryHandleTypeFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalMemoryHandleTypeFlagBits(static_cast<VkExternalMemoryHandleTypeFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalMemoryFeatureFlagBits(VkExternalMemoryFeatureFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT:
+ return "VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT";
+ case VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT:
+ return "VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT";
+ case VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT:
+ return "VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT";
+ default:
+ return "Unhandled VkExternalMemoryFeatureFlagBits";
+ }
+}
+
+static inline std::string string_VkExternalMemoryFeatureFlags(VkExternalMemoryFeatureFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalMemoryFeatureFlagBits(static_cast<VkExternalMemoryFeatureFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalMemoryFeatureFlagBits(static_cast<VkExternalMemoryFeatureFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalFenceHandleTypeFlagBits(VkExternalFenceHandleTypeFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT:
+ return "VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT";
+ case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT:
+ return "VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT";
+ case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT:
+ return "VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT";
+ case VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT:
+ return "VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT";
+ default:
+ return "Unhandled VkExternalFenceHandleTypeFlagBits";
+ }
+}
+
+static inline std::string string_VkExternalFenceHandleTypeFlags(VkExternalFenceHandleTypeFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalFenceHandleTypeFlagBits(static_cast<VkExternalFenceHandleTypeFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalFenceHandleTypeFlagBits(static_cast<VkExternalFenceHandleTypeFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalFenceFeatureFlagBits(VkExternalFenceFeatureFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT:
+ return "VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT";
+ case VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT:
+ return "VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT";
+ default:
+ return "Unhandled VkExternalFenceFeatureFlagBits";
+ }
+}
+
+static inline std::string string_VkExternalFenceFeatureFlags(VkExternalFenceFeatureFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalFenceFeatureFlagBits(static_cast<VkExternalFenceFeatureFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalFenceFeatureFlagBits(static_cast<VkExternalFenceFeatureFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkFenceImportFlagBits(VkFenceImportFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_FENCE_IMPORT_TEMPORARY_BIT:
+ return "VK_FENCE_IMPORT_TEMPORARY_BIT";
+ default:
+ return "Unhandled VkFenceImportFlagBits";
+ }
+}
+
+static inline std::string string_VkFenceImportFlags(VkFenceImportFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkFenceImportFlagBits(static_cast<VkFenceImportFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkFenceImportFlagBits(static_cast<VkFenceImportFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSemaphoreImportFlagBits(VkSemaphoreImportFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_SEMAPHORE_IMPORT_TEMPORARY_BIT:
+ return "VK_SEMAPHORE_IMPORT_TEMPORARY_BIT";
+ default:
+ return "Unhandled VkSemaphoreImportFlagBits";
+ }
+}
+
+static inline std::string string_VkSemaphoreImportFlags(VkSemaphoreImportFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSemaphoreImportFlagBits(static_cast<VkSemaphoreImportFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSemaphoreImportFlagBits(static_cast<VkSemaphoreImportFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalSemaphoreHandleTypeFlagBits(VkExternalSemaphoreHandleTypeFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA";
+ default:
+ return "Unhandled VkExternalSemaphoreHandleTypeFlagBits";
+ }
+}
+
+static inline std::string string_VkExternalSemaphoreHandleTypeFlags(VkExternalSemaphoreHandleTypeFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalSemaphoreHandleTypeFlagBits(static_cast<VkExternalSemaphoreHandleTypeFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalSemaphoreHandleTypeFlagBits(static_cast<VkExternalSemaphoreHandleTypeFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalSemaphoreFeatureFlagBits(VkExternalSemaphoreFeatureFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT";
+ case VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT";
+ default:
+ return "Unhandled VkExternalSemaphoreFeatureFlagBits";
+ }
+}
+
+static inline std::string string_VkExternalSemaphoreFeatureFlags(VkExternalSemaphoreFeatureFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalSemaphoreFeatureFlagBits(static_cast<VkExternalSemaphoreFeatureFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalSemaphoreFeatureFlagBits(static_cast<VkExternalSemaphoreFeatureFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDriverId(VkDriverId input_value)
+{
+ switch (input_value)
+ {
+ case VK_DRIVER_ID_AMD_OPEN_SOURCE:
+ return "VK_DRIVER_ID_AMD_OPEN_SOURCE";
+ case VK_DRIVER_ID_AMD_PROPRIETARY:
+ return "VK_DRIVER_ID_AMD_PROPRIETARY";
+ case VK_DRIVER_ID_ARM_PROPRIETARY:
+ return "VK_DRIVER_ID_ARM_PROPRIETARY";
+ case VK_DRIVER_ID_BROADCOM_PROPRIETARY:
+ return "VK_DRIVER_ID_BROADCOM_PROPRIETARY";
+ case VK_DRIVER_ID_COREAVI_PROPRIETARY:
+ return "VK_DRIVER_ID_COREAVI_PROPRIETARY";
+ case VK_DRIVER_ID_GGP_PROPRIETARY:
+ return "VK_DRIVER_ID_GGP_PROPRIETARY";
+ case VK_DRIVER_ID_GOOGLE_SWIFTSHADER:
+ return "VK_DRIVER_ID_GOOGLE_SWIFTSHADER";
+ case VK_DRIVER_ID_IMAGINATION_PROPRIETARY:
+ return "VK_DRIVER_ID_IMAGINATION_PROPRIETARY";
+ case VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA:
+ return "VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA";
+ case VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS:
+ return "VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS";
+ case VK_DRIVER_ID_JUICE_PROPRIETARY:
+ return "VK_DRIVER_ID_JUICE_PROPRIETARY";
+ case VK_DRIVER_ID_MESA_LLVMPIPE:
+ return "VK_DRIVER_ID_MESA_LLVMPIPE";
+ case VK_DRIVER_ID_MESA_PANVK:
+ return "VK_DRIVER_ID_MESA_PANVK";
+ case VK_DRIVER_ID_MESA_RADV:
+ return "VK_DRIVER_ID_MESA_RADV";
+ case VK_DRIVER_ID_MESA_TURNIP:
+ return "VK_DRIVER_ID_MESA_TURNIP";
+ case VK_DRIVER_ID_MESA_V3DV:
+ return "VK_DRIVER_ID_MESA_V3DV";
+ case VK_DRIVER_ID_MOLTENVK:
+ return "VK_DRIVER_ID_MOLTENVK";
+ case VK_DRIVER_ID_NVIDIA_PROPRIETARY:
+ return "VK_DRIVER_ID_NVIDIA_PROPRIETARY";
+ case VK_DRIVER_ID_QUALCOMM_PROPRIETARY:
+ return "VK_DRIVER_ID_QUALCOMM_PROPRIETARY";
+ case VK_DRIVER_ID_VERISILICON_PROPRIETARY:
+ return "VK_DRIVER_ID_VERISILICON_PROPRIETARY";
+ default:
+ return "Unhandled VkDriverId";
+ }
+}
+
+static inline const char* string_VkShaderFloatControlsIndependence(VkShaderFloatControlsIndependence input_value)
+{
+ switch (input_value)
+ {
+ case VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY:
+ return "VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY";
+ case VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL:
+ return "VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL";
+ case VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE:
+ return "VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE";
+ default:
+ return "Unhandled VkShaderFloatControlsIndependence";
+ }
+}
+
+static inline const char* string_VkResolveModeFlagBits(VkResolveModeFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_RESOLVE_MODE_AVERAGE_BIT:
+ return "VK_RESOLVE_MODE_AVERAGE_BIT";
+ case VK_RESOLVE_MODE_MAX_BIT:
+ return "VK_RESOLVE_MODE_MAX_BIT";
+ case VK_RESOLVE_MODE_MIN_BIT:
+ return "VK_RESOLVE_MODE_MIN_BIT";
+ case VK_RESOLVE_MODE_NONE:
+ return "VK_RESOLVE_MODE_NONE";
+ case VK_RESOLVE_MODE_SAMPLE_ZERO_BIT:
+ return "VK_RESOLVE_MODE_SAMPLE_ZERO_BIT";
+ default:
+ return "Unhandled VkResolveModeFlagBits";
+ }
+}
+
+static inline std::string string_VkResolveModeFlags(VkResolveModeFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkResolveModeFlagBits(static_cast<VkResolveModeFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkResolveModeFlagBits(static_cast<VkResolveModeFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDescriptorBindingFlagBits(VkDescriptorBindingFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT:
+ return "VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT";
+ case VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT:
+ return "VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT";
+ case VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT:
+ return "VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT";
+ case VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT:
+ return "VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT";
+ default:
+ return "Unhandled VkDescriptorBindingFlagBits";
+ }
+}
+
+static inline std::string string_VkDescriptorBindingFlags(VkDescriptorBindingFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDescriptorBindingFlagBits(static_cast<VkDescriptorBindingFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDescriptorBindingFlagBits(static_cast<VkDescriptorBindingFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSamplerReductionMode(VkSamplerReductionMode input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLER_REDUCTION_MODE_MAX:
+ return "VK_SAMPLER_REDUCTION_MODE_MAX";
+ case VK_SAMPLER_REDUCTION_MODE_MIN:
+ return "VK_SAMPLER_REDUCTION_MODE_MIN";
+ case VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE:
+ return "VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE";
+ default:
+ return "Unhandled VkSamplerReductionMode";
+ }
+}
+
+static inline const char* string_VkSemaphoreType(VkSemaphoreType input_value)
+{
+ switch (input_value)
+ {
+ case VK_SEMAPHORE_TYPE_BINARY:
+ return "VK_SEMAPHORE_TYPE_BINARY";
+ case VK_SEMAPHORE_TYPE_TIMELINE:
+ return "VK_SEMAPHORE_TYPE_TIMELINE";
+ default:
+ return "Unhandled VkSemaphoreType";
+ }
+}
+
+static inline const char* string_VkSemaphoreWaitFlagBits(VkSemaphoreWaitFlagBits input_value)
+{
+ switch (input_value)
+ {
+ case VK_SEMAPHORE_WAIT_ANY_BIT:
+ return "VK_SEMAPHORE_WAIT_ANY_BIT";
+ default:
+ return "Unhandled VkSemaphoreWaitFlagBits";
+ }
+}
+
+static inline std::string string_VkSemaphoreWaitFlags(VkSemaphoreWaitFlags input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSemaphoreWaitFlagBits(static_cast<VkSemaphoreWaitFlagBits>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSemaphoreWaitFlagBits(static_cast<VkSemaphoreWaitFlagBits>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSurfaceTransformFlagBitsKHR(VkSurfaceTransformFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR:
+ return "VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR";
+ case VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR:
+ return "VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR";
+ case VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR:
+ return "VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR";
+ case VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR:
+ return "VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR";
+ case VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR:
+ return "VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR";
+ case VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR:
+ return "VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR";
+ case VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR:
+ return "VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR";
+ case VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR:
+ return "VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR";
+ case VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR:
+ return "VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR";
+ default:
+ return "Unhandled VkSurfaceTransformFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkSurfaceTransformFlagsKHR(VkSurfaceTransformFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSurfaceTransformFlagBitsKHR(static_cast<VkSurfaceTransformFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSurfaceTransformFlagBitsKHR(static_cast<VkSurfaceTransformFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPresentModeKHR(VkPresentModeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_PRESENT_MODE_FIFO_KHR:
+ return "VK_PRESENT_MODE_FIFO_KHR";
+ case VK_PRESENT_MODE_FIFO_RELAXED_KHR:
+ return "VK_PRESENT_MODE_FIFO_RELAXED_KHR";
+ case VK_PRESENT_MODE_IMMEDIATE_KHR:
+ return "VK_PRESENT_MODE_IMMEDIATE_KHR";
+ case VK_PRESENT_MODE_MAILBOX_KHR:
+ return "VK_PRESENT_MODE_MAILBOX_KHR";
+ case VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR:
+ return "VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR";
+ case VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR:
+ return "VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR";
+ default:
+ return "Unhandled VkPresentModeKHR";
+ }
+}
+
+static inline const char* string_VkColorSpaceKHR(VkColorSpaceKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT:
+ return "VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT";
+ case VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT:
+ return "VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT";
+ case VK_COLOR_SPACE_BT2020_LINEAR_EXT:
+ return "VK_COLOR_SPACE_BT2020_LINEAR_EXT";
+ case VK_COLOR_SPACE_BT709_LINEAR_EXT:
+ return "VK_COLOR_SPACE_BT709_LINEAR_EXT";
+ case VK_COLOR_SPACE_BT709_NONLINEAR_EXT:
+ return "VK_COLOR_SPACE_BT709_NONLINEAR_EXT";
+ case VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT:
+ return "VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT";
+ case VK_COLOR_SPACE_DISPLAY_NATIVE_AMD:
+ return "VK_COLOR_SPACE_DISPLAY_NATIVE_AMD";
+ case VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT:
+ return "VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT";
+ case VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT:
+ return "VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT";
+ case VK_COLOR_SPACE_DOLBYVISION_EXT:
+ return "VK_COLOR_SPACE_DOLBYVISION_EXT";
+ case VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT:
+ return "VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT";
+ case VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT:
+ return "VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT";
+ case VK_COLOR_SPACE_HDR10_HLG_EXT:
+ return "VK_COLOR_SPACE_HDR10_HLG_EXT";
+ case VK_COLOR_SPACE_HDR10_ST2084_EXT:
+ return "VK_COLOR_SPACE_HDR10_ST2084_EXT";
+ case VK_COLOR_SPACE_PASS_THROUGH_EXT:
+ return "VK_COLOR_SPACE_PASS_THROUGH_EXT";
+ case VK_COLOR_SPACE_SRGB_NONLINEAR_KHR:
+ return "VK_COLOR_SPACE_SRGB_NONLINEAR_KHR";
+ default:
+ return "Unhandled VkColorSpaceKHR";
+ }
+}
+
+static inline const char* string_VkCompositeAlphaFlagBitsKHR(VkCompositeAlphaFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR:
+ return "VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR";
+ case VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR:
+ return "VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR";
+ case VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR:
+ return "VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR";
+ case VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR:
+ return "VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR";
+ default:
+ return "Unhandled VkCompositeAlphaFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkCompositeAlphaFlagsKHR(VkCompositeAlphaFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkCompositeAlphaFlagBitsKHR(static_cast<VkCompositeAlphaFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkCompositeAlphaFlagBitsKHR(static_cast<VkCompositeAlphaFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSwapchainCreateFlagBitsKHR(VkSwapchainCreateFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR:
+ return "VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR";
+ case VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR:
+ return "VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR";
+ case VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR:
+ return "VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR";
+ default:
+ return "Unhandled VkSwapchainCreateFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkSwapchainCreateFlagsKHR(VkSwapchainCreateFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSwapchainCreateFlagBitsKHR(static_cast<VkSwapchainCreateFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSwapchainCreateFlagBitsKHR(static_cast<VkSwapchainCreateFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDeviceGroupPresentModeFlagBitsKHR(VkDeviceGroupPresentModeFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR:
+ return "VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR";
+ case VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR:
+ return "VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR";
+ case VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR:
+ return "VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR";
+ case VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR:
+ return "VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR";
+ default:
+ return "Unhandled VkDeviceGroupPresentModeFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkDeviceGroupPresentModeFlagsKHR(VkDeviceGroupPresentModeFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDeviceGroupPresentModeFlagBitsKHR(static_cast<VkDeviceGroupPresentModeFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDeviceGroupPresentModeFlagBitsKHR(static_cast<VkDeviceGroupPresentModeFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDisplayPlaneAlphaFlagBitsKHR(VkDisplayPlaneAlphaFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR:
+ return "VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR";
+ case VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR:
+ return "VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR";
+ case VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR:
+ return "VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR";
+ case VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR:
+ return "VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR";
+ default:
+ return "Unhandled VkDisplayPlaneAlphaFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkDisplayPlaneAlphaFlagsKHR(VkDisplayPlaneAlphaFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDisplayPlaneAlphaFlagBitsKHR(static_cast<VkDisplayPlaneAlphaFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDisplayPlaneAlphaFlagBitsKHR(static_cast<VkDisplayPlaneAlphaFlagBitsKHR>(0)));
+ return ret;
+}
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoCodecOperationFlagBitsKHR(VkVideoCodecOperationFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_EXT:
+ return "VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_EXT:
+ return "VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT:
+ return "VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT:
+ return "VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ case VK_VIDEO_CODEC_OPERATION_INVALID_BIT_KHR:
+ return "VK_VIDEO_CODEC_OPERATION_INVALID_BIT_KHR";
+ default:
+ return "Unhandled VkVideoCodecOperationFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoCodecOperationFlagsKHR(VkVideoCodecOperationFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoCodecOperationFlagBitsKHR(static_cast<VkVideoCodecOperationFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoCodecOperationFlagBitsKHR(static_cast<VkVideoCodecOperationFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoChromaSubsamplingFlagBitsKHR(VkVideoChromaSubsamplingFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR:
+ return "VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR";
+ case VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR:
+ return "VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR";
+ case VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR:
+ return "VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR";
+ case VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_BIT_KHR:
+ return "VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_BIT_KHR";
+ case VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR:
+ return "VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR";
+ default:
+ return "Unhandled VkVideoChromaSubsamplingFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoChromaSubsamplingFlagsKHR(VkVideoChromaSubsamplingFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoChromaSubsamplingFlagBitsKHR(static_cast<VkVideoChromaSubsamplingFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoChromaSubsamplingFlagBitsKHR(static_cast<VkVideoChromaSubsamplingFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoComponentBitDepthFlagBitsKHR(VkVideoComponentBitDepthFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR:
+ return "VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR";
+ case VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR:
+ return "VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR";
+ case VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR:
+ return "VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR";
+ case VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR:
+ return "VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR";
+ default:
+ return "Unhandled VkVideoComponentBitDepthFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoComponentBitDepthFlagsKHR(VkVideoComponentBitDepthFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoComponentBitDepthFlagBitsKHR(static_cast<VkVideoComponentBitDepthFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoComponentBitDepthFlagBitsKHR(static_cast<VkVideoComponentBitDepthFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoCapabilityFlagBitsKHR(VkVideoCapabilityFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR:
+ return "VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR";
+ case VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR:
+ return "VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR";
+ default:
+ return "Unhandled VkVideoCapabilityFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoCapabilityFlagsKHR(VkVideoCapabilityFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoCapabilityFlagBitsKHR(static_cast<VkVideoCapabilityFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoCapabilityFlagBitsKHR(static_cast<VkVideoCapabilityFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoSessionCreateFlagBitsKHR(VkVideoSessionCreateFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_SESSION_CREATE_DEFAULT_KHR:
+ return "VK_VIDEO_SESSION_CREATE_DEFAULT_KHR";
+ case VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR:
+ return "VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR";
+ default:
+ return "Unhandled VkVideoSessionCreateFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoSessionCreateFlagsKHR(VkVideoSessionCreateFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoSessionCreateFlagBitsKHR(static_cast<VkVideoSessionCreateFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoSessionCreateFlagBitsKHR(static_cast<VkVideoSessionCreateFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoCodingControlFlagBitsKHR(VkVideoCodingControlFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_CODING_CONTROL_DEFAULT_KHR:
+ return "VK_VIDEO_CODING_CONTROL_DEFAULT_KHR";
+ case VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR:
+ return "VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR";
+ default:
+ return "Unhandled VkVideoCodingControlFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoCodingControlFlagsKHR(VkVideoCodingControlFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoCodingControlFlagBitsKHR(static_cast<VkVideoCodingControlFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoCodingControlFlagBitsKHR(static_cast<VkVideoCodingControlFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoCodingQualityPresetFlagBitsKHR(VkVideoCodingQualityPresetFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_CODING_QUALITY_PRESET_NORMAL_BIT_KHR:
+ return "VK_VIDEO_CODING_QUALITY_PRESET_NORMAL_BIT_KHR";
+ case VK_VIDEO_CODING_QUALITY_PRESET_POWER_BIT_KHR:
+ return "VK_VIDEO_CODING_QUALITY_PRESET_POWER_BIT_KHR";
+ case VK_VIDEO_CODING_QUALITY_PRESET_QUALITY_BIT_KHR:
+ return "VK_VIDEO_CODING_QUALITY_PRESET_QUALITY_BIT_KHR";
+ default:
+ return "Unhandled VkVideoCodingQualityPresetFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoCodingQualityPresetFlagsKHR(VkVideoCodingQualityPresetFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoCodingQualityPresetFlagBitsKHR(static_cast<VkVideoCodingQualityPresetFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoCodingQualityPresetFlagBitsKHR(static_cast<VkVideoCodingQualityPresetFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkQueryResultStatusKHR(VkQueryResultStatusKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_QUERY_RESULT_STATUS_COMPLETE_KHR:
+ return "VK_QUERY_RESULT_STATUS_COMPLETE_KHR";
+ case VK_QUERY_RESULT_STATUS_ERROR_KHR:
+ return "VK_QUERY_RESULT_STATUS_ERROR_KHR";
+ case VK_QUERY_RESULT_STATUS_NOT_READY_KHR:
+ return "VK_QUERY_RESULT_STATUS_NOT_READY_KHR";
+ default:
+ return "Unhandled VkQueryResultStatusKHR";
+ }
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoDecodeFlagBitsKHR(VkVideoDecodeFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_DECODE_DEFAULT_KHR:
+ return "VK_VIDEO_DECODE_DEFAULT_KHR";
+ case VK_VIDEO_DECODE_RESERVED_0_BIT_KHR:
+ return "VK_VIDEO_DECODE_RESERVED_0_BIT_KHR";
+ default:
+ return "Unhandled VkVideoDecodeFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoDecodeFlagsKHR(VkVideoDecodeFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoDecodeFlagBitsKHR(static_cast<VkVideoDecodeFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoDecodeFlagBitsKHR(static_cast<VkVideoDecodeFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkRenderingFlagBitsKHR(VkRenderingFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR:
+ return "VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR";
+ case VK_RENDERING_RESUMING_BIT_KHR:
+ return "VK_RENDERING_RESUMING_BIT_KHR";
+ case VK_RENDERING_SUSPENDING_BIT_KHR:
+ return "VK_RENDERING_SUSPENDING_BIT_KHR";
+ default:
+ return "Unhandled VkRenderingFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkRenderingFlagsKHR(VkRenderingFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkRenderingFlagBitsKHR(static_cast<VkRenderingFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkRenderingFlagBitsKHR(static_cast<VkRenderingFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPeerMemoryFeatureFlagBitsKHR(VkPeerMemoryFeatureFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_PEER_MEMORY_FEATURE_COPY_DST_BIT:
+ return "VK_PEER_MEMORY_FEATURE_COPY_DST_BIT";
+ case VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT:
+ return "VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT";
+ case VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT:
+ return "VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT";
+ case VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT:
+ return "VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT";
+ default:
+ return "Unhandled VkPeerMemoryFeatureFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkPeerMemoryFeatureFlagsKHR(VkPeerMemoryFeatureFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkPeerMemoryFeatureFlagBitsKHR(static_cast<VkPeerMemoryFeatureFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkPeerMemoryFeatureFlagBitsKHR(static_cast<VkPeerMemoryFeatureFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkMemoryAllocateFlagBitsKHR(VkMemoryAllocateFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT:
+ return "VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT";
+ case VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT:
+ return "VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT";
+ case VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT:
+ return "VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT";
+ default:
+ return "Unhandled VkMemoryAllocateFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkMemoryAllocateFlagsKHR(VkMemoryAllocateFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkMemoryAllocateFlagBitsKHR(static_cast<VkMemoryAllocateFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkMemoryAllocateFlagBitsKHR(static_cast<VkMemoryAllocateFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalMemoryHandleTypeFlagBitsKHR(VkExternalMemoryHandleTypeFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA";
+ default:
+ return "Unhandled VkExternalMemoryHandleTypeFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkExternalMemoryHandleTypeFlagsKHR(VkExternalMemoryHandleTypeFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalMemoryHandleTypeFlagBitsKHR(static_cast<VkExternalMemoryHandleTypeFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalMemoryHandleTypeFlagBitsKHR(static_cast<VkExternalMemoryHandleTypeFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalMemoryFeatureFlagBitsKHR(VkExternalMemoryFeatureFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT:
+ return "VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT";
+ case VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT:
+ return "VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT";
+ case VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT:
+ return "VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT";
+ default:
+ return "Unhandled VkExternalMemoryFeatureFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkExternalMemoryFeatureFlagsKHR(VkExternalMemoryFeatureFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalMemoryFeatureFlagBitsKHR(static_cast<VkExternalMemoryFeatureFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalMemoryFeatureFlagBitsKHR(static_cast<VkExternalMemoryFeatureFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalSemaphoreHandleTypeFlagBitsKHR(VkExternalSemaphoreHandleTypeFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT";
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA:
+ return "VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA";
+ default:
+ return "Unhandled VkExternalSemaphoreHandleTypeFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkExternalSemaphoreHandleTypeFlagsKHR(VkExternalSemaphoreHandleTypeFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalSemaphoreHandleTypeFlagBitsKHR(static_cast<VkExternalSemaphoreHandleTypeFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalSemaphoreHandleTypeFlagBitsKHR(static_cast<VkExternalSemaphoreHandleTypeFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalSemaphoreFeatureFlagBitsKHR(VkExternalSemaphoreFeatureFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT";
+ case VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT:
+ return "VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT";
+ default:
+ return "Unhandled VkExternalSemaphoreFeatureFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkExternalSemaphoreFeatureFlagsKHR(VkExternalSemaphoreFeatureFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalSemaphoreFeatureFlagBitsKHR(static_cast<VkExternalSemaphoreFeatureFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalSemaphoreFeatureFlagBitsKHR(static_cast<VkExternalSemaphoreFeatureFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSemaphoreImportFlagBitsKHR(VkSemaphoreImportFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SEMAPHORE_IMPORT_TEMPORARY_BIT:
+ return "VK_SEMAPHORE_IMPORT_TEMPORARY_BIT";
+ default:
+ return "Unhandled VkSemaphoreImportFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkSemaphoreImportFlagsKHR(VkSemaphoreImportFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSemaphoreImportFlagBitsKHR(static_cast<VkSemaphoreImportFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSemaphoreImportFlagBitsKHR(static_cast<VkSemaphoreImportFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDescriptorUpdateTemplateTypeKHR(VkDescriptorUpdateTemplateTypeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET:
+ return "VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET";
+ case VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR:
+ return "VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR";
+ default:
+ return "Unhandled VkDescriptorUpdateTemplateTypeKHR";
+ }
+}
+
+static inline const char* string_VkExternalFenceHandleTypeFlagBitsKHR(VkExternalFenceHandleTypeFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT:
+ return "VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT";
+ case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT:
+ return "VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT";
+ case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT:
+ return "VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT";
+ case VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT:
+ return "VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT";
+ default:
+ return "Unhandled VkExternalFenceHandleTypeFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkExternalFenceHandleTypeFlagsKHR(VkExternalFenceHandleTypeFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalFenceHandleTypeFlagBitsKHR(static_cast<VkExternalFenceHandleTypeFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalFenceHandleTypeFlagBitsKHR(static_cast<VkExternalFenceHandleTypeFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalFenceFeatureFlagBitsKHR(VkExternalFenceFeatureFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT:
+ return "VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT";
+ case VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT:
+ return "VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT";
+ default:
+ return "Unhandled VkExternalFenceFeatureFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkExternalFenceFeatureFlagsKHR(VkExternalFenceFeatureFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalFenceFeatureFlagBitsKHR(static_cast<VkExternalFenceFeatureFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalFenceFeatureFlagBitsKHR(static_cast<VkExternalFenceFeatureFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkFenceImportFlagBitsKHR(VkFenceImportFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_FENCE_IMPORT_TEMPORARY_BIT:
+ return "VK_FENCE_IMPORT_TEMPORARY_BIT";
+ default:
+ return "Unhandled VkFenceImportFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkFenceImportFlagsKHR(VkFenceImportFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkFenceImportFlagBitsKHR(static_cast<VkFenceImportFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkFenceImportFlagBitsKHR(static_cast<VkFenceImportFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPerformanceCounterUnitKHR(VkPerformanceCounterUnitKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR:
+ return "VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR";
+ default:
+ return "Unhandled VkPerformanceCounterUnitKHR";
+ }
+}
+
+static inline const char* string_VkPerformanceCounterScopeKHR(VkPerformanceCounterScopeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR:
+ return "VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR";
+ case VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR:
+ return "VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR";
+ case VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR:
+ return "VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR";
+ default:
+ return "Unhandled VkPerformanceCounterScopeKHR";
+ }
+}
+
+static inline const char* string_VkPerformanceCounterStorageKHR(VkPerformanceCounterStorageKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR:
+ return "VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR:
+ return "VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR:
+ return "VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR:
+ return "VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR:
+ return "VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR:
+ return "VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR";
+ default:
+ return "Unhandled VkPerformanceCounterStorageKHR";
+ }
+}
+
+static inline const char* string_VkPerformanceCounterDescriptionFlagBitsKHR(VkPerformanceCounterDescriptionFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR:
+ return "VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR";
+ case VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR:
+ return "VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR";
+ default:
+ return "Unhandled VkPerformanceCounterDescriptionFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkPerformanceCounterDescriptionFlagsKHR(VkPerformanceCounterDescriptionFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkPerformanceCounterDescriptionFlagBitsKHR(static_cast<VkPerformanceCounterDescriptionFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkPerformanceCounterDescriptionFlagBitsKHR(static_cast<VkPerformanceCounterDescriptionFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPointClippingBehaviorKHR(VkPointClippingBehaviorKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES:
+ return "VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES";
+ case VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY:
+ return "VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY";
+ default:
+ return "Unhandled VkPointClippingBehaviorKHR";
+ }
+}
+
+static inline const char* string_VkTessellationDomainOriginKHR(VkTessellationDomainOriginKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT:
+ return "VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT";
+ case VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT:
+ return "VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT";
+ default:
+ return "Unhandled VkTessellationDomainOriginKHR";
+ }
+}
+
+static inline const char* string_VkSamplerYcbcrModelConversionKHR(VkSamplerYcbcrModelConversionKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY";
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020";
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601";
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709";
+ case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY:
+ return "VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY";
+ default:
+ return "Unhandled VkSamplerYcbcrModelConversionKHR";
+ }
+}
+
+static inline const char* string_VkSamplerYcbcrRangeKHR(VkSamplerYcbcrRangeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLER_YCBCR_RANGE_ITU_FULL:
+ return "VK_SAMPLER_YCBCR_RANGE_ITU_FULL";
+ case VK_SAMPLER_YCBCR_RANGE_ITU_NARROW:
+ return "VK_SAMPLER_YCBCR_RANGE_ITU_NARROW";
+ default:
+ return "Unhandled VkSamplerYcbcrRangeKHR";
+ }
+}
+
+static inline const char* string_VkChromaLocationKHR(VkChromaLocationKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_CHROMA_LOCATION_COSITED_EVEN:
+ return "VK_CHROMA_LOCATION_COSITED_EVEN";
+ case VK_CHROMA_LOCATION_MIDPOINT:
+ return "VK_CHROMA_LOCATION_MIDPOINT";
+ default:
+ return "Unhandled VkChromaLocationKHR";
+ }
+}
+
+static inline const char* string_VkDriverIdKHR(VkDriverIdKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_DRIVER_ID_AMD_OPEN_SOURCE:
+ return "VK_DRIVER_ID_AMD_OPEN_SOURCE";
+ case VK_DRIVER_ID_AMD_PROPRIETARY:
+ return "VK_DRIVER_ID_AMD_PROPRIETARY";
+ case VK_DRIVER_ID_ARM_PROPRIETARY:
+ return "VK_DRIVER_ID_ARM_PROPRIETARY";
+ case VK_DRIVER_ID_BROADCOM_PROPRIETARY:
+ return "VK_DRIVER_ID_BROADCOM_PROPRIETARY";
+ case VK_DRIVER_ID_COREAVI_PROPRIETARY:
+ return "VK_DRIVER_ID_COREAVI_PROPRIETARY";
+ case VK_DRIVER_ID_GGP_PROPRIETARY:
+ return "VK_DRIVER_ID_GGP_PROPRIETARY";
+ case VK_DRIVER_ID_GOOGLE_SWIFTSHADER:
+ return "VK_DRIVER_ID_GOOGLE_SWIFTSHADER";
+ case VK_DRIVER_ID_IMAGINATION_PROPRIETARY:
+ return "VK_DRIVER_ID_IMAGINATION_PROPRIETARY";
+ case VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA:
+ return "VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA";
+ case VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS:
+ return "VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS";
+ case VK_DRIVER_ID_JUICE_PROPRIETARY:
+ return "VK_DRIVER_ID_JUICE_PROPRIETARY";
+ case VK_DRIVER_ID_MESA_LLVMPIPE:
+ return "VK_DRIVER_ID_MESA_LLVMPIPE";
+ case VK_DRIVER_ID_MESA_PANVK:
+ return "VK_DRIVER_ID_MESA_PANVK";
+ case VK_DRIVER_ID_MESA_RADV:
+ return "VK_DRIVER_ID_MESA_RADV";
+ case VK_DRIVER_ID_MESA_TURNIP:
+ return "VK_DRIVER_ID_MESA_TURNIP";
+ case VK_DRIVER_ID_MESA_V3DV:
+ return "VK_DRIVER_ID_MESA_V3DV";
+ case VK_DRIVER_ID_MOLTENVK:
+ return "VK_DRIVER_ID_MOLTENVK";
+ case VK_DRIVER_ID_NVIDIA_PROPRIETARY:
+ return "VK_DRIVER_ID_NVIDIA_PROPRIETARY";
+ case VK_DRIVER_ID_QUALCOMM_PROPRIETARY:
+ return "VK_DRIVER_ID_QUALCOMM_PROPRIETARY";
+ case VK_DRIVER_ID_VERISILICON_PROPRIETARY:
+ return "VK_DRIVER_ID_VERISILICON_PROPRIETARY";
+ default:
+ return "Unhandled VkDriverIdKHR";
+ }
+}
+
+static inline const char* string_VkShaderFloatControlsIndependenceKHR(VkShaderFloatControlsIndependenceKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY:
+ return "VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY";
+ case VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL:
+ return "VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL";
+ case VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE:
+ return "VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE";
+ default:
+ return "Unhandled VkShaderFloatControlsIndependenceKHR";
+ }
+}
+
+static inline const char* string_VkResolveModeFlagBitsKHR(VkResolveModeFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_RESOLVE_MODE_AVERAGE_BIT:
+ return "VK_RESOLVE_MODE_AVERAGE_BIT";
+ case VK_RESOLVE_MODE_MAX_BIT:
+ return "VK_RESOLVE_MODE_MAX_BIT";
+ case VK_RESOLVE_MODE_MIN_BIT:
+ return "VK_RESOLVE_MODE_MIN_BIT";
+ case VK_RESOLVE_MODE_NONE:
+ return "VK_RESOLVE_MODE_NONE";
+ case VK_RESOLVE_MODE_SAMPLE_ZERO_BIT:
+ return "VK_RESOLVE_MODE_SAMPLE_ZERO_BIT";
+ default:
+ return "Unhandled VkResolveModeFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkResolveModeFlagsKHR(VkResolveModeFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkResolveModeFlagBitsKHR(static_cast<VkResolveModeFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkResolveModeFlagBitsKHR(static_cast<VkResolveModeFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSemaphoreTypeKHR(VkSemaphoreTypeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SEMAPHORE_TYPE_BINARY:
+ return "VK_SEMAPHORE_TYPE_BINARY";
+ case VK_SEMAPHORE_TYPE_TIMELINE:
+ return "VK_SEMAPHORE_TYPE_TIMELINE";
+ default:
+ return "Unhandled VkSemaphoreTypeKHR";
+ }
+}
+
+static inline const char* string_VkSemaphoreWaitFlagBitsKHR(VkSemaphoreWaitFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SEMAPHORE_WAIT_ANY_BIT:
+ return "VK_SEMAPHORE_WAIT_ANY_BIT";
+ default:
+ return "Unhandled VkSemaphoreWaitFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkSemaphoreWaitFlagsKHR(VkSemaphoreWaitFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSemaphoreWaitFlagBitsKHR(static_cast<VkSemaphoreWaitFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSemaphoreWaitFlagBitsKHR(static_cast<VkSemaphoreWaitFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkFragmentShadingRateCombinerOpKHR(VkFragmentShadingRateCombinerOpKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR:
+ return "VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR";
+ case VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR:
+ return "VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR";
+ case VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR:
+ return "VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR";
+ case VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR:
+ return "VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR";
+ case VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR:
+ return "VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR";
+ default:
+ return "Unhandled VkFragmentShadingRateCombinerOpKHR";
+ }
+}
+
+static inline const char* string_VkPipelineExecutableStatisticFormatKHR(VkPipelineExecutableStatisticFormatKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR:
+ return "VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR";
+ case VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR:
+ return "VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR";
+ case VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR:
+ return "VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR";
+ case VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR:
+ return "VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR";
+ default:
+ return "Unhandled VkPipelineExecutableStatisticFormatKHR";
+ }
+}
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeFlagBitsKHR(VkVideoEncodeFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_DEFAULT_KHR:
+ return "VK_VIDEO_ENCODE_DEFAULT_KHR";
+ case VK_VIDEO_ENCODE_RESERVED_0_BIT_KHR:
+ return "VK_VIDEO_ENCODE_RESERVED_0_BIT_KHR";
+ default:
+ return "Unhandled VkVideoEncodeFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoEncodeFlagsKHR(VkVideoEncodeFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeFlagBitsKHR(static_cast<VkVideoEncodeFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeFlagBitsKHR(static_cast<VkVideoEncodeFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeRateControlFlagBitsKHR(VkVideoEncodeRateControlFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_RATE_CONTROL_DEFAULT_KHR:
+ return "VK_VIDEO_ENCODE_RATE_CONTROL_DEFAULT_KHR";
+ case VK_VIDEO_ENCODE_RATE_CONTROL_RESET_BIT_KHR:
+ return "VK_VIDEO_ENCODE_RATE_CONTROL_RESET_BIT_KHR";
+ default:
+ return "Unhandled VkVideoEncodeRateControlFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoEncodeRateControlFlagsKHR(VkVideoEncodeRateControlFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeRateControlFlagBitsKHR(static_cast<VkVideoEncodeRateControlFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeRateControlFlagBitsKHR(static_cast<VkVideoEncodeRateControlFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeRateControlModeFlagBitsKHR(VkVideoEncodeRateControlModeFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR:
+ return "VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR";
+ case VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR:
+ return "VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR";
+ case VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR:
+ return "VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR";
+ default:
+ return "Unhandled VkVideoEncodeRateControlModeFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkVideoEncodeRateControlModeFlagsKHR(VkVideoEncodeRateControlModeFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeRateControlModeFlagBitsKHR(static_cast<VkVideoEncodeRateControlModeFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeRateControlModeFlagBitsKHR(static_cast<VkVideoEncodeRateControlModeFlagBitsKHR>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkPipelineStageFlagBits2KHR(uint64_t input_value)
+{
+ switch (input_value)
+ {
+ case VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_BLIT_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_BLIT_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV:
+ return "VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV";
+ case VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT:
+ return "VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT";
+ case VK_PIPELINE_STAGE_2_COPY_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_COPY_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT:
+ return "VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT";
+ case VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_HOST_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_HOST_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI:
+ return "VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI";
+ case VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV:
+ return "VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV";
+ case VK_PIPELINE_STAGE_2_NONE_KHR:
+ return "VK_PIPELINE_STAGE_2_NONE_KHR";
+ case VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI:
+ return "VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI";
+ case VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV:
+ return "VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV";
+ case VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT:
+ return "VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT";
+ case VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR";
+ case VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR:
+ return "VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkPipelineStageFlagBits2KHR";
+ }
+}
+
+static inline std::string string_VkPipelineStageFlags2KHR(VkPipelineStageFlags2KHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkPipelineStageFlagBits2KHR(static_cast<uint64_t>(1ULL << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkPipelineStageFlagBits2KHR(static_cast<uint64_t>(0)));
+ return ret;
+}
+
+static inline const char* string_VkAccessFlagBits2KHR(uint64_t input_value)
+{
+ switch (input_value)
+ {
+ case VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR:
+ return "VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR";
+ case VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR";
+ case VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT_KHR:
+ return "VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT_KHR";
+ case VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT:
+ return "VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT";
+ case VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT_KHR";
+ case VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV:
+ return "VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV";
+ case VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV:
+ return "VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV";
+ case VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT:
+ return "VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT";
+ case VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT_KHR:
+ return "VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT_KHR";
+ case VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT_KHR";
+ case VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT:
+ return "VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT";
+ case VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR:
+ return "VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR";
+ case VK_ACCESS_2_HOST_READ_BIT_KHR:
+ return "VK_ACCESS_2_HOST_READ_BIT_KHR";
+ case VK_ACCESS_2_HOST_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_HOST_WRITE_BIT_KHR";
+ case VK_ACCESS_2_INDEX_READ_BIT_KHR:
+ return "VK_ACCESS_2_INDEX_READ_BIT_KHR";
+ case VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR:
+ return "VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR";
+ case VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT_KHR:
+ return "VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT_KHR";
+ case VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI:
+ return "VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI";
+ case VK_ACCESS_2_MEMORY_READ_BIT_KHR:
+ return "VK_ACCESS_2_MEMORY_READ_BIT_KHR";
+ case VK_ACCESS_2_MEMORY_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_MEMORY_WRITE_BIT_KHR";
+ case VK_ACCESS_2_NONE_KHR:
+ return "VK_ACCESS_2_NONE_KHR";
+ case VK_ACCESS_2_SHADER_READ_BIT_KHR:
+ return "VK_ACCESS_2_SHADER_READ_BIT_KHR";
+ case VK_ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR:
+ return "VK_ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR";
+ case VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR:
+ return "VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR";
+ case VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR";
+ case VK_ACCESS_2_SHADER_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_SHADER_WRITE_BIT_KHR";
+ case VK_ACCESS_2_TRANSFER_READ_BIT_KHR:
+ return "VK_ACCESS_2_TRANSFER_READ_BIT_KHR";
+ case VK_ACCESS_2_TRANSFER_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_TRANSFER_WRITE_BIT_KHR";
+ case VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT:
+ return "VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT";
+ case VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT:
+ return "VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT";
+ case VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT:
+ return "VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT";
+ case VK_ACCESS_2_UNIFORM_READ_BIT_KHR:
+ return "VK_ACCESS_2_UNIFORM_READ_BIT_KHR";
+ case VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR:
+ return "VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR:
+ return "VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR:
+ return "VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR:
+ return "VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkAccessFlagBits2KHR";
+ }
+}
+
+static inline std::string string_VkAccessFlags2KHR(VkAccessFlags2KHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkAccessFlagBits2KHR(static_cast<uint64_t>(1ULL << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkAccessFlagBits2KHR(static_cast<uint64_t>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSubmitFlagBitsKHR(VkSubmitFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SUBMIT_PROTECTED_BIT_KHR:
+ return "VK_SUBMIT_PROTECTED_BIT_KHR";
+ default:
+ return "Unhandled VkSubmitFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkSubmitFlagsKHR(VkSubmitFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSubmitFlagBitsKHR(static_cast<VkSubmitFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSubmitFlagBitsKHR(static_cast<VkSubmitFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkFormatFeatureFlagBits2KHR(uint64_t input_value)
+{
+ switch (input_value)
+ {
+ case VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_DISJOINT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_DISJOINT_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT:
+ return "VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT";
+ case VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT:
+ return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT";
+ case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR";
+ case VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR";
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR:
+ return "VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR";
+#endif // VK_ENABLE_BETA_EXTENSIONS
+ default:
+ return "Unhandled VkFormatFeatureFlagBits2KHR";
+ }
+}
+
+static inline std::string string_VkFormatFeatureFlags2KHR(VkFormatFeatureFlags2KHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkFormatFeatureFlagBits2KHR(static_cast<uint64_t>(1ULL << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkFormatFeatureFlagBits2KHR(static_cast<uint64_t>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDebugReportFlagBitsEXT(VkDebugReportFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEBUG_REPORT_DEBUG_BIT_EXT:
+ return "VK_DEBUG_REPORT_DEBUG_BIT_EXT";
+ case VK_DEBUG_REPORT_ERROR_BIT_EXT:
+ return "VK_DEBUG_REPORT_ERROR_BIT_EXT";
+ case VK_DEBUG_REPORT_INFORMATION_BIT_EXT:
+ return "VK_DEBUG_REPORT_INFORMATION_BIT_EXT";
+ case VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT:
+ return "VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT";
+ case VK_DEBUG_REPORT_WARNING_BIT_EXT:
+ return "VK_DEBUG_REPORT_WARNING_BIT_EXT";
+ default:
+ return "Unhandled VkDebugReportFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkDebugReportFlagsEXT(VkDebugReportFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDebugReportFlagBitsEXT(static_cast<VkDebugReportFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDebugReportFlagBitsEXT(static_cast<VkDebugReportFlagBitsEXT>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDebugReportObjectTypeEXT(VkDebugReportObjectTypeEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT";
+ case VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT:
+ return "VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT";
+ default:
+ return "Unhandled VkDebugReportObjectTypeEXT";
+ }
+}
+
+static inline const char* string_VkRasterizationOrderAMD(VkRasterizationOrderAMD input_value)
+{
+ switch (input_value)
+ {
+ case VK_RASTERIZATION_ORDER_RELAXED_AMD:
+ return "VK_RASTERIZATION_ORDER_RELAXED_AMD";
+ case VK_RASTERIZATION_ORDER_STRICT_AMD:
+ return "VK_RASTERIZATION_ORDER_STRICT_AMD";
+ default:
+ return "Unhandled VkRasterizationOrderAMD";
+ }
+}
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeH264CapabilityFlagBitsEXT(VkVideoEncodeH264CapabilityFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_EVENLY_DISTRIBUTED_SLICE_SIZE_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_EVENLY_DISTRIBUTED_SLICE_SIZE_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BI_PRED_IMPLICIT_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BI_PRED_IMPLICIT_BIT_EXT";
+ default:
+ return "Unhandled VkVideoEncodeH264CapabilityFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkVideoEncodeH264CapabilityFlagsEXT(VkVideoEncodeH264CapabilityFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeH264CapabilityFlagBitsEXT(static_cast<VkVideoEncodeH264CapabilityFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeH264CapabilityFlagBitsEXT(static_cast<VkVideoEncodeH264CapabilityFlagBitsEXT>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeH264InputModeFlagBitsEXT(VkVideoEncodeH264InputModeFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_H264_INPUT_MODE_FRAME_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_INPUT_MODE_FRAME_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT";
+ default:
+ return "Unhandled VkVideoEncodeH264InputModeFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkVideoEncodeH264InputModeFlagsEXT(VkVideoEncodeH264InputModeFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeH264InputModeFlagBitsEXT(static_cast<VkVideoEncodeH264InputModeFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeH264InputModeFlagBitsEXT(static_cast<VkVideoEncodeH264InputModeFlagBitsEXT>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeH264OutputModeFlagBitsEXT(VkVideoEncodeH264OutputModeFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FRAME_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FRAME_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT";
+ case VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT";
+ default:
+ return "Unhandled VkVideoEncodeH264OutputModeFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkVideoEncodeH264OutputModeFlagsEXT(VkVideoEncodeH264OutputModeFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeH264OutputModeFlagBitsEXT(static_cast<VkVideoEncodeH264OutputModeFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeH264OutputModeFlagBitsEXT(static_cast<VkVideoEncodeH264OutputModeFlagBitsEXT>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeH264CreateFlagBitsEXT(VkVideoEncodeH264CreateFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_H264_CREATE_DEFAULT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CREATE_DEFAULT_EXT";
+ case VK_VIDEO_ENCODE_H264_CREATE_RESERVED_0_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H264_CREATE_RESERVED_0_BIT_EXT";
+ default:
+ return "Unhandled VkVideoEncodeH264CreateFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkVideoEncodeH264CreateFlagsEXT(VkVideoEncodeH264CreateFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeH264CreateFlagBitsEXT(static_cast<VkVideoEncodeH264CreateFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeH264CreateFlagBitsEXT(static_cast<VkVideoEncodeH264CreateFlagBitsEXT>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeH265InputModeFlagBitsEXT(VkVideoEncodeH265InputModeFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_H265_INPUT_MODE_FRAME_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_INPUT_MODE_FRAME_BIT_EXT";
+ case VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT";
+ case VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_BIT_EXT";
+ default:
+ return "Unhandled VkVideoEncodeH265InputModeFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkVideoEncodeH265InputModeFlagsEXT(VkVideoEncodeH265InputModeFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeH265InputModeFlagBitsEXT(static_cast<VkVideoEncodeH265InputModeFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeH265InputModeFlagBitsEXT(static_cast<VkVideoEncodeH265InputModeFlagBitsEXT>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeH265OutputModeFlagBitsEXT(VkVideoEncodeH265OutputModeFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FRAME_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FRAME_BIT_EXT";
+ case VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT";
+ case VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_BIT_EXT";
+ default:
+ return "Unhandled VkVideoEncodeH265OutputModeFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkVideoEncodeH265OutputModeFlagsEXT(VkVideoEncodeH265OutputModeFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeH265OutputModeFlagBitsEXT(static_cast<VkVideoEncodeH265OutputModeFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeH265OutputModeFlagBitsEXT(static_cast<VkVideoEncodeH265OutputModeFlagBitsEXT>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoEncodeH265CtbSizeFlagBitsEXT(VkVideoEncodeH265CtbSizeFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT";
+ case VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT";
+ case VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT";
+ case VK_VIDEO_ENCODE_H265_CTB_SIZE_8_BIT_EXT:
+ return "VK_VIDEO_ENCODE_H265_CTB_SIZE_8_BIT_EXT";
+ default:
+ return "Unhandled VkVideoEncodeH265CtbSizeFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkVideoEncodeH265CtbSizeFlagsEXT(VkVideoEncodeH265CtbSizeFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoEncodeH265CtbSizeFlagBitsEXT(static_cast<VkVideoEncodeH265CtbSizeFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoEncodeH265CtbSizeFlagBitsEXT(static_cast<VkVideoEncodeH265CtbSizeFlagBitsEXT>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkVideoDecodeH264PictureLayoutFlagBitsEXT(VkVideoDecodeH264PictureLayoutFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_EXT:
+ return "VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_EXT";
+ case VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_EXT:
+ return "VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_EXT";
+ case VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_EXT:
+ return "VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_EXT";
+ default:
+ return "Unhandled VkVideoDecodeH264PictureLayoutFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkVideoDecodeH264PictureLayoutFlagsEXT(VkVideoDecodeH264PictureLayoutFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkVideoDecodeH264PictureLayoutFlagBitsEXT(static_cast<VkVideoDecodeH264PictureLayoutFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkVideoDecodeH264PictureLayoutFlagBitsEXT(static_cast<VkVideoDecodeH264PictureLayoutFlagBitsEXT>(0)));
+ return ret;
+}
+#endif // VK_ENABLE_BETA_EXTENSIONS
+
+static inline const char* string_VkShaderInfoTypeAMD(VkShaderInfoTypeAMD input_value)
+{
+ switch (input_value)
+ {
+ case VK_SHADER_INFO_TYPE_BINARY_AMD:
+ return "VK_SHADER_INFO_TYPE_BINARY_AMD";
+ case VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD:
+ return "VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD";
+ case VK_SHADER_INFO_TYPE_STATISTICS_AMD:
+ return "VK_SHADER_INFO_TYPE_STATISTICS_AMD";
+ default:
+ return "Unhandled VkShaderInfoTypeAMD";
+ }
+}
+
+static inline const char* string_VkExternalMemoryHandleTypeFlagBitsNV(VkExternalMemoryHandleTypeFlagBitsNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV";
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV:
+ return "VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV";
+ default:
+ return "Unhandled VkExternalMemoryHandleTypeFlagBitsNV";
+ }
+}
+
+static inline std::string string_VkExternalMemoryHandleTypeFlagsNV(VkExternalMemoryHandleTypeFlagsNV input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalMemoryHandleTypeFlagBitsNV(static_cast<VkExternalMemoryHandleTypeFlagBitsNV>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalMemoryHandleTypeFlagBitsNV(static_cast<VkExternalMemoryHandleTypeFlagBitsNV>(0)));
+ return ret;
+}
+
+static inline const char* string_VkExternalMemoryFeatureFlagBitsNV(VkExternalMemoryFeatureFlagBitsNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV:
+ return "VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV";
+ case VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV:
+ return "VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV";
+ case VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV:
+ return "VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV";
+ default:
+ return "Unhandled VkExternalMemoryFeatureFlagBitsNV";
+ }
+}
+
+static inline std::string string_VkExternalMemoryFeatureFlagsNV(VkExternalMemoryFeatureFlagsNV input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkExternalMemoryFeatureFlagBitsNV(static_cast<VkExternalMemoryFeatureFlagBitsNV>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkExternalMemoryFeatureFlagBitsNV(static_cast<VkExternalMemoryFeatureFlagBitsNV>(0)));
+ return ret;
+}
+
+static inline const char* string_VkValidationCheckEXT(VkValidationCheckEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VALIDATION_CHECK_ALL_EXT:
+ return "VK_VALIDATION_CHECK_ALL_EXT";
+ case VK_VALIDATION_CHECK_SHADERS_EXT:
+ return "VK_VALIDATION_CHECK_SHADERS_EXT";
+ default:
+ return "Unhandled VkValidationCheckEXT";
+ }
+}
+
+static inline const char* string_VkConditionalRenderingFlagBitsEXT(VkConditionalRenderingFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT:
+ return "VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT";
+ default:
+ return "Unhandled VkConditionalRenderingFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkConditionalRenderingFlagsEXT(VkConditionalRenderingFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkConditionalRenderingFlagBitsEXT(static_cast<VkConditionalRenderingFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkConditionalRenderingFlagBitsEXT(static_cast<VkConditionalRenderingFlagBitsEXT>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSurfaceCounterFlagBitsEXT(VkSurfaceCounterFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_SURFACE_COUNTER_VBLANK_BIT_EXT:
+ return "VK_SURFACE_COUNTER_VBLANK_BIT_EXT";
+ default:
+ return "Unhandled VkSurfaceCounterFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkSurfaceCounterFlagsEXT(VkSurfaceCounterFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkSurfaceCounterFlagBitsEXT(static_cast<VkSurfaceCounterFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkSurfaceCounterFlagBitsEXT(static_cast<VkSurfaceCounterFlagBitsEXT>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDisplayPowerStateEXT(VkDisplayPowerStateEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DISPLAY_POWER_STATE_OFF_EXT:
+ return "VK_DISPLAY_POWER_STATE_OFF_EXT";
+ case VK_DISPLAY_POWER_STATE_ON_EXT:
+ return "VK_DISPLAY_POWER_STATE_ON_EXT";
+ case VK_DISPLAY_POWER_STATE_SUSPEND_EXT:
+ return "VK_DISPLAY_POWER_STATE_SUSPEND_EXT";
+ default:
+ return "Unhandled VkDisplayPowerStateEXT";
+ }
+}
+
+static inline const char* string_VkDeviceEventTypeEXT(VkDeviceEventTypeEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT:
+ return "VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT";
+ default:
+ return "Unhandled VkDeviceEventTypeEXT";
+ }
+}
+
+static inline const char* string_VkDisplayEventTypeEXT(VkDisplayEventTypeEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT:
+ return "VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT";
+ default:
+ return "Unhandled VkDisplayEventTypeEXT";
+ }
+}
+
+static inline const char* string_VkViewportCoordinateSwizzleNV(VkViewportCoordinateSwizzleNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV:
+ return "VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV";
+ case VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV:
+ return "VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV";
+ case VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV:
+ return "VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV";
+ case VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV:
+ return "VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV";
+ case VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV:
+ return "VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV";
+ case VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV:
+ return "VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV";
+ case VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV:
+ return "VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV";
+ case VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV:
+ return "VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV";
+ default:
+ return "Unhandled VkViewportCoordinateSwizzleNV";
+ }
+}
+
+static inline const char* string_VkDiscardRectangleModeEXT(VkDiscardRectangleModeEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT:
+ return "VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT";
+ case VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT:
+ return "VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT";
+ default:
+ return "Unhandled VkDiscardRectangleModeEXT";
+ }
+}
+
+static inline const char* string_VkConservativeRasterizationModeEXT(VkConservativeRasterizationModeEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT:
+ return "VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT";
+ case VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT:
+ return "VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT";
+ case VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT:
+ return "VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT";
+ default:
+ return "Unhandled VkConservativeRasterizationModeEXT";
+ }
+}
+
+static inline const char* string_VkDebugUtilsMessageSeverityFlagBitsEXT(VkDebugUtilsMessageSeverityFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT:
+ return "VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT";
+ case VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT:
+ return "VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT";
+ case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
+ return "VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT";
+ case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
+ return "VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT";
+ default:
+ return "Unhandled VkDebugUtilsMessageSeverityFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkDebugUtilsMessageSeverityFlagsEXT(VkDebugUtilsMessageSeverityFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDebugUtilsMessageSeverityFlagBitsEXT(static_cast<VkDebugUtilsMessageSeverityFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDebugUtilsMessageSeverityFlagBitsEXT(static_cast<VkDebugUtilsMessageSeverityFlagBitsEXT>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDebugUtilsMessageTypeFlagBitsEXT(VkDebugUtilsMessageTypeFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT:
+ return "VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT";
+ case VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT:
+ return "VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT";
+ case VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT:
+ return "VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT";
+ default:
+ return "Unhandled VkDebugUtilsMessageTypeFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkDebugUtilsMessageTypeFlagsEXT(VkDebugUtilsMessageTypeFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDebugUtilsMessageTypeFlagBitsEXT(static_cast<VkDebugUtilsMessageTypeFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDebugUtilsMessageTypeFlagBitsEXT(static_cast<VkDebugUtilsMessageTypeFlagBitsEXT>(0)));
+ return ret;
+}
+
+static inline const char* string_VkSamplerReductionModeEXT(VkSamplerReductionModeEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_SAMPLER_REDUCTION_MODE_MAX:
+ return "VK_SAMPLER_REDUCTION_MODE_MAX";
+ case VK_SAMPLER_REDUCTION_MODE_MIN:
+ return "VK_SAMPLER_REDUCTION_MODE_MIN";
+ case VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE:
+ return "VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE";
+ default:
+ return "Unhandled VkSamplerReductionModeEXT";
+ }
+}
+
+static inline const char* string_VkBlendOverlapEXT(VkBlendOverlapEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_BLEND_OVERLAP_CONJOINT_EXT:
+ return "VK_BLEND_OVERLAP_CONJOINT_EXT";
+ case VK_BLEND_OVERLAP_DISJOINT_EXT:
+ return "VK_BLEND_OVERLAP_DISJOINT_EXT";
+ case VK_BLEND_OVERLAP_UNCORRELATED_EXT:
+ return "VK_BLEND_OVERLAP_UNCORRELATED_EXT";
+ default:
+ return "Unhandled VkBlendOverlapEXT";
+ }
+}
+
+static inline const char* string_VkCoverageModulationModeNV(VkCoverageModulationModeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_COVERAGE_MODULATION_MODE_ALPHA_NV:
+ return "VK_COVERAGE_MODULATION_MODE_ALPHA_NV";
+ case VK_COVERAGE_MODULATION_MODE_NONE_NV:
+ return "VK_COVERAGE_MODULATION_MODE_NONE_NV";
+ case VK_COVERAGE_MODULATION_MODE_RGBA_NV:
+ return "VK_COVERAGE_MODULATION_MODE_RGBA_NV";
+ case VK_COVERAGE_MODULATION_MODE_RGB_NV:
+ return "VK_COVERAGE_MODULATION_MODE_RGB_NV";
+ default:
+ return "Unhandled VkCoverageModulationModeNV";
+ }
+}
+
+static inline const char* string_VkValidationCacheHeaderVersionEXT(VkValidationCacheHeaderVersionEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT:
+ return "VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT";
+ default:
+ return "Unhandled VkValidationCacheHeaderVersionEXT";
+ }
+}
+
+static inline const char* string_VkDescriptorBindingFlagBitsEXT(VkDescriptorBindingFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT:
+ return "VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT";
+ case VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT:
+ return "VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT";
+ case VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT:
+ return "VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT";
+ case VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT:
+ return "VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT";
+ default:
+ return "Unhandled VkDescriptorBindingFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkDescriptorBindingFlagsEXT(VkDescriptorBindingFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDescriptorBindingFlagBitsEXT(static_cast<VkDescriptorBindingFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDescriptorBindingFlagBitsEXT(static_cast<VkDescriptorBindingFlagBitsEXT>(0)));
+ return ret;
+}
+
+static inline const char* string_VkShadingRatePaletteEntryNV(VkShadingRatePaletteEntryNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV";
+ case VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV:
+ return "VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV";
+ default:
+ return "Unhandled VkShadingRatePaletteEntryNV";
+ }
+}
+
+static inline const char* string_VkCoarseSampleOrderTypeNV(VkCoarseSampleOrderTypeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV:
+ return "VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV";
+ case VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV:
+ return "VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV";
+ case VK_COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV:
+ return "VK_COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV";
+ case VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV:
+ return "VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV";
+ default:
+ return "Unhandled VkCoarseSampleOrderTypeNV";
+ }
+}
+
+static inline const char* string_VkRayTracingShaderGroupTypeKHR(VkRayTracingShaderGroupTypeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR:
+ return "VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR";
+ case VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR:
+ return "VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR";
+ case VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR:
+ return "VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR";
+ default:
+ return "Unhandled VkRayTracingShaderGroupTypeKHR";
+ }
+}
+
+static inline const char* string_VkRayTracingShaderGroupTypeNV(VkRayTracingShaderGroupTypeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR:
+ return "VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR";
+ case VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR:
+ return "VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR";
+ case VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR:
+ return "VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR";
+ default:
+ return "Unhandled VkRayTracingShaderGroupTypeNV";
+ }
+}
+
+static inline const char* string_VkGeometryTypeKHR(VkGeometryTypeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_GEOMETRY_TYPE_AABBS_KHR:
+ return "VK_GEOMETRY_TYPE_AABBS_KHR";
+ case VK_GEOMETRY_TYPE_INSTANCES_KHR:
+ return "VK_GEOMETRY_TYPE_INSTANCES_KHR";
+ case VK_GEOMETRY_TYPE_TRIANGLES_KHR:
+ return "VK_GEOMETRY_TYPE_TRIANGLES_KHR";
+ default:
+ return "Unhandled VkGeometryTypeKHR";
+ }
+}
+
+static inline const char* string_VkGeometryTypeNV(VkGeometryTypeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_GEOMETRY_TYPE_AABBS_KHR:
+ return "VK_GEOMETRY_TYPE_AABBS_KHR";
+ case VK_GEOMETRY_TYPE_INSTANCES_KHR:
+ return "VK_GEOMETRY_TYPE_INSTANCES_KHR";
+ case VK_GEOMETRY_TYPE_TRIANGLES_KHR:
+ return "VK_GEOMETRY_TYPE_TRIANGLES_KHR";
+ default:
+ return "Unhandled VkGeometryTypeNV";
+ }
+}
+
+static inline const char* string_VkAccelerationStructureTypeKHR(VkAccelerationStructureTypeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR:
+ return "VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR";
+ case VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR:
+ return "VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR";
+ case VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR:
+ return "VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR";
+ default:
+ return "Unhandled VkAccelerationStructureTypeKHR";
+ }
+}
+
+static inline const char* string_VkAccelerationStructureTypeNV(VkAccelerationStructureTypeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR:
+ return "VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR";
+ case VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR:
+ return "VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR";
+ case VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR:
+ return "VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR";
+ default:
+ return "Unhandled VkAccelerationStructureTypeNV";
+ }
+}
+
+static inline const char* string_VkGeometryFlagBitsKHR(VkGeometryFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR:
+ return "VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR";
+ case VK_GEOMETRY_OPAQUE_BIT_KHR:
+ return "VK_GEOMETRY_OPAQUE_BIT_KHR";
+ default:
+ return "Unhandled VkGeometryFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkGeometryFlagsKHR(VkGeometryFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkGeometryFlagBitsKHR(static_cast<VkGeometryFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkGeometryFlagBitsKHR(static_cast<VkGeometryFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkGeometryFlagBitsNV(VkGeometryFlagBitsNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR:
+ return "VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR";
+ case VK_GEOMETRY_OPAQUE_BIT_KHR:
+ return "VK_GEOMETRY_OPAQUE_BIT_KHR";
+ default:
+ return "Unhandled VkGeometryFlagBitsNV";
+ }
+}
+
+static inline std::string string_VkGeometryFlagsNV(VkGeometryFlagsNV input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkGeometryFlagBitsNV(static_cast<VkGeometryFlagBitsNV>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkGeometryFlagBitsNV(static_cast<VkGeometryFlagBitsNV>(0)));
+ return ret;
+}
+
+static inline const char* string_VkGeometryInstanceFlagBitsKHR(VkGeometryInstanceFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR:
+ return "VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR";
+ case VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR:
+ return "VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR";
+ case VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR:
+ return "VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR";
+ case VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR:
+ return "VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR";
+ default:
+ return "Unhandled VkGeometryInstanceFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkGeometryInstanceFlagsKHR(VkGeometryInstanceFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkGeometryInstanceFlagBitsKHR(static_cast<VkGeometryInstanceFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkGeometryInstanceFlagBitsKHR(static_cast<VkGeometryInstanceFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkGeometryInstanceFlagBitsNV(VkGeometryInstanceFlagBitsNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR:
+ return "VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR";
+ case VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR:
+ return "VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR";
+ case VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR:
+ return "VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR";
+ case VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR:
+ return "VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR";
+ default:
+ return "Unhandled VkGeometryInstanceFlagBitsNV";
+ }
+}
+
+static inline std::string string_VkGeometryInstanceFlagsNV(VkGeometryInstanceFlagsNV input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkGeometryInstanceFlagBitsNV(static_cast<VkGeometryInstanceFlagBitsNV>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkGeometryInstanceFlagBitsNV(static_cast<VkGeometryInstanceFlagBitsNV>(0)));
+ return ret;
+}
+
+static inline const char* string_VkBuildAccelerationStructureFlagBitsKHR(VkBuildAccelerationStructureFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR";
+ case VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR";
+ case VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR";
+ case VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV";
+ case VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR";
+ case VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR";
+ default:
+ return "Unhandled VkBuildAccelerationStructureFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkBuildAccelerationStructureFlagsKHR(VkBuildAccelerationStructureFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkBuildAccelerationStructureFlagBitsKHR(static_cast<VkBuildAccelerationStructureFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkBuildAccelerationStructureFlagBitsKHR(static_cast<VkBuildAccelerationStructureFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkBuildAccelerationStructureFlagBitsNV(VkBuildAccelerationStructureFlagBitsNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR";
+ case VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR";
+ case VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR";
+ case VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV";
+ case VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR";
+ case VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR";
+ default:
+ return "Unhandled VkBuildAccelerationStructureFlagBitsNV";
+ }
+}
+
+static inline std::string string_VkBuildAccelerationStructureFlagsNV(VkBuildAccelerationStructureFlagsNV input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkBuildAccelerationStructureFlagBitsNV(static_cast<VkBuildAccelerationStructureFlagBitsNV>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkBuildAccelerationStructureFlagBitsNV(static_cast<VkBuildAccelerationStructureFlagBitsNV>(0)));
+ return ret;
+}
+
+static inline const char* string_VkCopyAccelerationStructureModeKHR(VkCopyAccelerationStructureModeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR:
+ return "VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR";
+ case VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR:
+ return "VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR";
+ case VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR:
+ return "VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR";
+ case VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR:
+ return "VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR";
+ default:
+ return "Unhandled VkCopyAccelerationStructureModeKHR";
+ }
+}
+
+static inline const char* string_VkCopyAccelerationStructureModeNV(VkCopyAccelerationStructureModeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR:
+ return "VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR";
+ case VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR:
+ return "VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR";
+ case VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR:
+ return "VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR";
+ case VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR:
+ return "VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR";
+ default:
+ return "Unhandled VkCopyAccelerationStructureModeNV";
+ }
+}
+
+static inline const char* string_VkAccelerationStructureMemoryRequirementsTypeNV(VkAccelerationStructureMemoryRequirementsTypeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV:
+ return "VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV";
+ case VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV:
+ return "VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV";
+ case VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV:
+ return "VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV";
+ default:
+ return "Unhandled VkAccelerationStructureMemoryRequirementsTypeNV";
+ }
+}
+
+static inline const char* string_VkQueueGlobalPriorityEXT(VkQueueGlobalPriorityEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT:
+ return "VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT";
+ case VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT:
+ return "VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT";
+ case VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT:
+ return "VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT";
+ case VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT:
+ return "VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT";
+ default:
+ return "Unhandled VkQueueGlobalPriorityEXT";
+ }
+}
+
+static inline const char* string_VkTimeDomainEXT(VkTimeDomainEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT:
+ return "VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT";
+ case VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT:
+ return "VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT";
+ case VK_TIME_DOMAIN_DEVICE_EXT:
+ return "VK_TIME_DOMAIN_DEVICE_EXT";
+ case VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT:
+ return "VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT";
+ default:
+ return "Unhandled VkTimeDomainEXT";
+ }
+}
+
+static inline const char* string_VkMemoryOverallocationBehaviorAMD(VkMemoryOverallocationBehaviorAMD input_value)
+{
+ switch (input_value)
+ {
+ case VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD:
+ return "VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD";
+ case VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD:
+ return "VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD";
+ case VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD:
+ return "VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD";
+ default:
+ return "Unhandled VkMemoryOverallocationBehaviorAMD";
+ }
+}
+
+static inline const char* string_VkPipelineCreationFeedbackFlagBitsEXT(VkPipelineCreationFeedbackFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT:
+ return "VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT";
+ case VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT:
+ return "VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT";
+ case VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT:
+ return "VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT";
+ default:
+ return "Unhandled VkPipelineCreationFeedbackFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkPipelineCreationFeedbackFlagsEXT(VkPipelineCreationFeedbackFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkPipelineCreationFeedbackFlagBitsEXT(static_cast<VkPipelineCreationFeedbackFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkPipelineCreationFeedbackFlagBitsEXT(static_cast<VkPipelineCreationFeedbackFlagBitsEXT>(0)));
+ return ret;
+}
+
+static inline const char* string_VkPerformanceConfigurationTypeINTEL(VkPerformanceConfigurationTypeINTEL input_value)
+{
+ switch (input_value)
+ {
+ case VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL:
+ return "VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL";
+ default:
+ return "Unhandled VkPerformanceConfigurationTypeINTEL";
+ }
+}
+
+static inline const char* string_VkQueryPoolSamplingModeINTEL(VkQueryPoolSamplingModeINTEL input_value)
+{
+ switch (input_value)
+ {
+ case VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL:
+ return "VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL";
+ default:
+ return "Unhandled VkQueryPoolSamplingModeINTEL";
+ }
+}
+
+static inline const char* string_VkPerformanceOverrideTypeINTEL(VkPerformanceOverrideTypeINTEL input_value)
+{
+ switch (input_value)
+ {
+ case VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL:
+ return "VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL";
+ case VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL:
+ return "VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL";
+ default:
+ return "Unhandled VkPerformanceOverrideTypeINTEL";
+ }
+}
+
+static inline const char* string_VkPerformanceParameterTypeINTEL(VkPerformanceParameterTypeINTEL input_value)
+{
+ switch (input_value)
+ {
+ case VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL:
+ return "VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL";
+ case VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL:
+ return "VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL";
+ default:
+ return "Unhandled VkPerformanceParameterTypeINTEL";
+ }
+}
+
+static inline const char* string_VkPerformanceValueTypeINTEL(VkPerformanceValueTypeINTEL input_value)
+{
+ switch (input_value)
+ {
+ case VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL:
+ return "VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL";
+ case VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL:
+ return "VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL";
+ case VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL:
+ return "VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL";
+ case VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL:
+ return "VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL";
+ case VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL:
+ return "VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL";
+ default:
+ return "Unhandled VkPerformanceValueTypeINTEL";
+ }
+}
+
+static inline const char* string_VkToolPurposeFlagBitsEXT(VkToolPurposeFlagBitsEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT:
+ return "VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT";
+ case VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT:
+ return "VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT";
+ case VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT:
+ return "VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT";
+ case VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT:
+ return "VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT";
+ case VK_TOOL_PURPOSE_PROFILING_BIT_EXT:
+ return "VK_TOOL_PURPOSE_PROFILING_BIT_EXT";
+ case VK_TOOL_PURPOSE_TRACING_BIT_EXT:
+ return "VK_TOOL_PURPOSE_TRACING_BIT_EXT";
+ case VK_TOOL_PURPOSE_VALIDATION_BIT_EXT:
+ return "VK_TOOL_PURPOSE_VALIDATION_BIT_EXT";
+ default:
+ return "Unhandled VkToolPurposeFlagBitsEXT";
+ }
+}
+
+static inline std::string string_VkToolPurposeFlagsEXT(VkToolPurposeFlagsEXT input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkToolPurposeFlagBitsEXT(static_cast<VkToolPurposeFlagBitsEXT>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkToolPurposeFlagBitsEXT(static_cast<VkToolPurposeFlagBitsEXT>(0)));
+ return ret;
+}
+
+static inline const char* string_VkValidationFeatureEnableEXT(VkValidationFeatureEnableEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT:
+ return "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT";
+ case VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT:
+ return "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT";
+ case VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT:
+ return "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT";
+ case VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT:
+ return "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT";
+ case VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT:
+ return "VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT";
+ default:
+ return "Unhandled VkValidationFeatureEnableEXT";
+ }
+}
+
+static inline const char* string_VkValidationFeatureDisableEXT(VkValidationFeatureDisableEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_VALIDATION_FEATURE_DISABLE_ALL_EXT:
+ return "VK_VALIDATION_FEATURE_DISABLE_ALL_EXT";
+ case VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT:
+ return "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT";
+ case VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT:
+ return "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT";
+ case VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT:
+ return "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT";
+ case VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT:
+ return "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT";
+ case VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT:
+ return "VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT";
+ case VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT:
+ return "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT";
+ case VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT:
+ return "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT";
+ default:
+ return "Unhandled VkValidationFeatureDisableEXT";
+ }
+}
+
+static inline const char* string_VkComponentTypeNV(VkComponentTypeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_COMPONENT_TYPE_FLOAT16_NV:
+ return "VK_COMPONENT_TYPE_FLOAT16_NV";
+ case VK_COMPONENT_TYPE_FLOAT32_NV:
+ return "VK_COMPONENT_TYPE_FLOAT32_NV";
+ case VK_COMPONENT_TYPE_FLOAT64_NV:
+ return "VK_COMPONENT_TYPE_FLOAT64_NV";
+ case VK_COMPONENT_TYPE_SINT16_NV:
+ return "VK_COMPONENT_TYPE_SINT16_NV";
+ case VK_COMPONENT_TYPE_SINT32_NV:
+ return "VK_COMPONENT_TYPE_SINT32_NV";
+ case VK_COMPONENT_TYPE_SINT64_NV:
+ return "VK_COMPONENT_TYPE_SINT64_NV";
+ case VK_COMPONENT_TYPE_SINT8_NV:
+ return "VK_COMPONENT_TYPE_SINT8_NV";
+ case VK_COMPONENT_TYPE_UINT16_NV:
+ return "VK_COMPONENT_TYPE_UINT16_NV";
+ case VK_COMPONENT_TYPE_UINT32_NV:
+ return "VK_COMPONENT_TYPE_UINT32_NV";
+ case VK_COMPONENT_TYPE_UINT64_NV:
+ return "VK_COMPONENT_TYPE_UINT64_NV";
+ case VK_COMPONENT_TYPE_UINT8_NV:
+ return "VK_COMPONENT_TYPE_UINT8_NV";
+ default:
+ return "Unhandled VkComponentTypeNV";
+ }
+}
+
+static inline const char* string_VkScopeNV(VkScopeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_SCOPE_DEVICE_NV:
+ return "VK_SCOPE_DEVICE_NV";
+ case VK_SCOPE_QUEUE_FAMILY_NV:
+ return "VK_SCOPE_QUEUE_FAMILY_NV";
+ case VK_SCOPE_SUBGROUP_NV:
+ return "VK_SCOPE_SUBGROUP_NV";
+ case VK_SCOPE_WORKGROUP_NV:
+ return "VK_SCOPE_WORKGROUP_NV";
+ default:
+ return "Unhandled VkScopeNV";
+ }
+}
+
+static inline const char* string_VkCoverageReductionModeNV(VkCoverageReductionModeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_COVERAGE_REDUCTION_MODE_MERGE_NV:
+ return "VK_COVERAGE_REDUCTION_MODE_MERGE_NV";
+ case VK_COVERAGE_REDUCTION_MODE_TRUNCATE_NV:
+ return "VK_COVERAGE_REDUCTION_MODE_TRUNCATE_NV";
+ default:
+ return "Unhandled VkCoverageReductionModeNV";
+ }
+}
+
+static inline const char* string_VkProvokingVertexModeEXT(VkProvokingVertexModeEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT:
+ return "VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT";
+ case VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT:
+ return "VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT";
+ default:
+ return "Unhandled VkProvokingVertexModeEXT";
+ }
+}
+
+
+#ifdef VK_USE_PLATFORM_WIN32_KHR
+
+static inline const char* string_VkFullScreenExclusiveEXT(VkFullScreenExclusiveEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT:
+ return "VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT";
+ case VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT:
+ return "VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT";
+ case VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT:
+ return "VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT";
+ case VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT:
+ return "VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT";
+ default:
+ return "Unhandled VkFullScreenExclusiveEXT";
+ }
+}
+#endif // VK_USE_PLATFORM_WIN32_KHR
+
+static inline const char* string_VkLineRasterizationModeEXT(VkLineRasterizationModeEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT:
+ return "VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT";
+ case VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT:
+ return "VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT";
+ case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT:
+ return "VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT";
+ case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT:
+ return "VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT";
+ default:
+ return "Unhandled VkLineRasterizationModeEXT";
+ }
+}
+
+static inline const char* string_VkIndirectStateFlagBitsNV(VkIndirectStateFlagBitsNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV:
+ return "VK_INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV";
+ default:
+ return "Unhandled VkIndirectStateFlagBitsNV";
+ }
+}
+
+static inline std::string string_VkIndirectStateFlagsNV(VkIndirectStateFlagsNV input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkIndirectStateFlagBitsNV(static_cast<VkIndirectStateFlagBitsNV>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkIndirectStateFlagBitsNV(static_cast<VkIndirectStateFlagBitsNV>(0)));
+ return ret;
+}
+
+static inline const char* string_VkIndirectCommandsTokenTypeNV(VkIndirectCommandsTokenTypeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV:
+ return "VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV";
+ case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV:
+ return "VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV";
+ case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV:
+ return "VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV";
+ case VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NV:
+ return "VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NV";
+ case VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV:
+ return "VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV";
+ case VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV:
+ return "VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV";
+ case VK_INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV:
+ return "VK_INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV";
+ case VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV:
+ return "VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV";
+ default:
+ return "Unhandled VkIndirectCommandsTokenTypeNV";
+ }
+}
+
+static inline const char* string_VkIndirectCommandsLayoutUsageFlagBitsNV(VkIndirectCommandsLayoutUsageFlagBitsNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV:
+ return "VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV";
+ case VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV:
+ return "VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV";
+ case VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV:
+ return "VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV";
+ default:
+ return "Unhandled VkIndirectCommandsLayoutUsageFlagBitsNV";
+ }
+}
+
+static inline std::string string_VkIndirectCommandsLayoutUsageFlagsNV(VkIndirectCommandsLayoutUsageFlagsNV input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkIndirectCommandsLayoutUsageFlagBitsNV(static_cast<VkIndirectCommandsLayoutUsageFlagBitsNV>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkIndirectCommandsLayoutUsageFlagBitsNV(static_cast<VkIndirectCommandsLayoutUsageFlagBitsNV>(0)));
+ return ret;
+}
+
+static inline const char* string_VkDeviceMemoryReportEventTypeEXT(VkDeviceMemoryReportEventTypeEXT input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT:
+ return "VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT";
+ case VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATION_FAILED_EXT:
+ return "VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATION_FAILED_EXT";
+ case VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT:
+ return "VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT";
+ case VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_IMPORT_EXT:
+ return "VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_IMPORT_EXT";
+ case VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_UNIMPORT_EXT:
+ return "VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_UNIMPORT_EXT";
+ default:
+ return "Unhandled VkDeviceMemoryReportEventTypeEXT";
+ }
+}
+
+static inline const char* string_VkDeviceDiagnosticsConfigFlagBitsNV(VkDeviceDiagnosticsConfigFlagBitsNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_AUTOMATIC_CHECKPOINTS_BIT_NV:
+ return "VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_AUTOMATIC_CHECKPOINTS_BIT_NV";
+ case VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_RESOURCE_TRACKING_BIT_NV:
+ return "VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_RESOURCE_TRACKING_BIT_NV";
+ case VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_DEBUG_INFO_BIT_NV:
+ return "VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_DEBUG_INFO_BIT_NV";
+ default:
+ return "Unhandled VkDeviceDiagnosticsConfigFlagBitsNV";
+ }
+}
+
+static inline std::string string_VkDeviceDiagnosticsConfigFlagsNV(VkDeviceDiagnosticsConfigFlagsNV input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkDeviceDiagnosticsConfigFlagBitsNV(static_cast<VkDeviceDiagnosticsConfigFlagBitsNV>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkDeviceDiagnosticsConfigFlagBitsNV(static_cast<VkDeviceDiagnosticsConfigFlagBitsNV>(0)));
+ return ret;
+}
+
+static inline const char* string_VkFragmentShadingRateTypeNV(VkFragmentShadingRateTypeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV:
+ return "VK_FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV";
+ case VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV:
+ return "VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV";
+ default:
+ return "Unhandled VkFragmentShadingRateTypeNV";
+ }
+}
+
+static inline const char* string_VkFragmentShadingRateNV(VkFragmentShadingRateNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV:
+ return "VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV";
+ case VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV:
+ return "VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV";
+ case VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV:
+ return "VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV";
+ case VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV:
+ return "VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV";
+ case VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV:
+ return "VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV";
+ case VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV:
+ return "VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV";
+ case VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV:
+ return "VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV";
+ case VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV:
+ return "VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV";
+ case VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV:
+ return "VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV";
+ case VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV:
+ return "VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV";
+ case VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV:
+ return "VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV";
+ case VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV:
+ return "VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV";
+ default:
+ return "Unhandled VkFragmentShadingRateNV";
+ }
+}
+
+static inline const char* string_VkAccelerationStructureMotionInstanceTypeNV(VkAccelerationStructureMotionInstanceTypeNV input_value)
+{
+ switch (input_value)
+ {
+ case VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_MATRIX_MOTION_NV:
+ return "VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_MATRIX_MOTION_NV";
+ case VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_SRT_MOTION_NV:
+ return "VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_SRT_MOTION_NV";
+ case VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_STATIC_NV:
+ return "VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_STATIC_NV";
+ default:
+ return "Unhandled VkAccelerationStructureMotionInstanceTypeNV";
+ }
+}
+
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+
+static inline const char* string_VkImageConstraintsInfoFlagBitsFUCHSIA(VkImageConstraintsInfoFlagBitsFUCHSIA input_value)
+{
+ switch (input_value)
+ {
+ case VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA:
+ return "VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA";
+ case VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA:
+ return "VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA";
+ case VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA:
+ return "VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA";
+ case VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA:
+ return "VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA";
+ case VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA:
+ return "VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA";
+ default:
+ return "Unhandled VkImageConstraintsInfoFlagBitsFUCHSIA";
+ }
+}
+
+static inline std::string string_VkImageConstraintsInfoFlagsFUCHSIA(VkImageConstraintsInfoFlagsFUCHSIA input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkImageConstraintsInfoFlagBitsFUCHSIA(static_cast<VkImageConstraintsInfoFlagBitsFUCHSIA>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkImageConstraintsInfoFlagBitsFUCHSIA(static_cast<VkImageConstraintsInfoFlagBitsFUCHSIA>(0)));
+ return ret;
+}
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+static inline const char* string_VkBuildAccelerationStructureModeKHR(VkBuildAccelerationStructureModeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR";
+ case VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR:
+ return "VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR";
+ default:
+ return "Unhandled VkBuildAccelerationStructureModeKHR";
+ }
+}
+
+static inline const char* string_VkAccelerationStructureBuildTypeKHR(VkAccelerationStructureBuildTypeKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR:
+ return "VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR";
+ case VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR:
+ return "VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR";
+ case VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR:
+ return "VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR";
+ default:
+ return "Unhandled VkAccelerationStructureBuildTypeKHR";
+ }
+}
+
+static inline const char* string_VkAccelerationStructureCreateFlagBitsKHR(VkAccelerationStructureCreateFlagBitsKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR:
+ return "VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR";
+ case VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV:
+ return "VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV";
+ default:
+ return "Unhandled VkAccelerationStructureCreateFlagBitsKHR";
+ }
+}
+
+static inline std::string string_VkAccelerationStructureCreateFlagsKHR(VkAccelerationStructureCreateFlagsKHR input_value)
+{
+ std::string ret;
+ int index = 0;
+ while(input_value) {
+ if (input_value & 1) {
+ if( !ret.empty()) ret.append("|");
+ ret.append(string_VkAccelerationStructureCreateFlagBitsKHR(static_cast<VkAccelerationStructureCreateFlagBitsKHR>(1U << index)));
+ }
+ ++index;
+ input_value >>= 1;
+ }
+ if( ret.empty()) ret.append(string_VkAccelerationStructureCreateFlagBitsKHR(static_cast<VkAccelerationStructureCreateFlagBitsKHR>(0)));
+ return ret;
+}
+
+static inline const char* string_VkAccelerationStructureCompatibilityKHR(VkAccelerationStructureCompatibilityKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR:
+ return "VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR";
+ case VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR:
+ return "VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR";
+ default:
+ return "Unhandled VkAccelerationStructureCompatibilityKHR";
+ }
+}
+
+static inline const char* string_VkShaderGroupShaderKHR(VkShaderGroupShaderKHR input_value)
+{
+ switch (input_value)
+ {
+ case VK_SHADER_GROUP_SHADER_ANY_HIT_KHR:
+ return "VK_SHADER_GROUP_SHADER_ANY_HIT_KHR";
+ case VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR:
+ return "VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR";
+ case VK_SHADER_GROUP_SHADER_GENERAL_KHR:
+ return "VK_SHADER_GROUP_SHADER_GENERAL_KHR";
+ case VK_SHADER_GROUP_SHADER_INTERSECTION_KHR:
+ return "VK_SHADER_GROUP_SHADER_INTERSECTION_KHR";
+ default:
+ return "Unhandled VkShaderGroupShaderKHR";
+ }
+}
+
+static inline const char * GetPhysDevFeatureString(uint32_t index) {
+ const char * IndexToPhysDevFeatureString[] = {
+ "robustBufferAccess",
+ "fullDrawIndexUint32",
+ "imageCubeArray",
+ "independentBlend",
+ "geometryShader",
+ "tessellationShader",
+ "sampleRateShading",
+ "dualSrcBlend",
+ "logicOp",
+ "multiDrawIndirect",
+ "drawIndirectFirstInstance",
+ "depthClamp",
+ "depthBiasClamp",
+ "fillModeNonSolid",
+ "depthBounds",
+ "wideLines",
+ "largePoints",
+ "alphaToOne",
+ "multiViewport",
+ "samplerAnisotropy",
+ "textureCompressionETC2",
+ "textureCompressionASTC_LDR",
+ "textureCompressionBC",
+ "occlusionQueryPrecise",
+ "pipelineStatisticsQuery",
+ "vertexPipelineStoresAndAtomics",
+ "fragmentStoresAndAtomics",
+ "shaderTessellationAndGeometryPointSize",
+ "shaderImageGatherExtended",
+ "shaderStorageImageExtendedFormats",
+ "shaderStorageImageMultisample",
+ "shaderStorageImageReadWithoutFormat",
+ "shaderStorageImageWriteWithoutFormat",
+ "shaderUniformBufferArrayDynamicIndexing",
+ "shaderSampledImageArrayDynamicIndexing",
+ "shaderStorageBufferArrayDynamicIndexing",
+ "shaderStorageImageArrayDynamicIndexing",
+ "shaderClipDistance",
+ "shaderCullDistance",
+ "shaderFloat64",
+ "shaderInt64",
+ "shaderInt16",
+ "shaderResourceResidency",
+ "shaderResourceMinLod",
+ "sparseBinding",
+ "sparseResidencyBuffer",
+ "sparseResidencyImage2D",
+ "sparseResidencyImage3D",
+ "sparseResidency2Samples",
+ "sparseResidency4Samples",
+ "sparseResidency8Samples",
+ "sparseResidency16Samples",
+ "sparseResidencyAliased",
+ "variableMultisampleRate",
+ "inheritedQueries",
+ };
+
+ return IndexToPhysDevFeatureString[index];
+}
+
+static inline bool IsDuplicatePnext(VkStructureType input_value)
+{
+ switch (input_value)
+ {
+ case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT:
+ case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT:
+ case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT:
+ return true;
+ default:
+ return false;
+ }
+}
diff --git a/src/gfxstream/docs/deqp.md b/src/gfxstream/docs/deqp.md
new file mode 100644
index 00000000000..024222331b1
--- /dev/null
+++ b/src/gfxstream/docs/deqp.md
@@ -0,0 +1,54 @@
+# Running dEQP with Gfxstream
+
+## dEQP-(EGL|GLES2|GLES3)
+
+TODO
+
+## dEQP-VK
+
+### Linux
+
+1. Build Gfxstream
+
+ ```
+ cd <YOUR aosp-main DIRECTORY>
+ source build/envsetup.sh
+ lunch aosp_cf_x86_64_phone-trunk_staging-userdebug
+ m libgfxstream_guest_vulkan_with_host
+
+ # Edit hardware/google/gfxstream/guest/vulkan/gfxstream_icd.json 's
+ # "library_path" value to point to
+ # "<YOUR aosp-main DIRECTORY>/out/host/linux-86/lib64/libgfxstream_guest_vulkan_with_host.so"
+ ```
+
+1. Build dEQP
+
+ ```
+ mkdir github-deqp
+ cd github-deqp
+ git clone https://github.com/KhronosGroup/VK-GL-CTS .
+ python3 external/fetch_sources.py
+ mkdir build
+ cd build
+ cmake -DCMAKE_BUILD_TYPE=Debug ..
+ make -j
+ ```
+
+1. Build Nested Vulkan Loader
+
+ ```
+ ./scripts/build-nested-vulkan-loader.sh
+
+ # Run the "export" command printed in the output of the above script.
+ ```
+
+1. Run dEQP with Gfxstream ICD
+
+ ```
+ VK_LOADER_DEBUG=all \
+ VK_ICD_FILENAMES=<YOUR aosp-main DIRECTORY>/hardware/google/gfxstream/guest/vulkan/gfxstream_icd.json \
+ GFXSTREAM_VK_LOADER_DEBUG=all \
+ GFXSTREAM_VK_ICD_FILENAMES=/etc/vulkan/icd.d/nvidia_icd.json \
+ <YOUR github-deqp DIRECTORY>/build/external/vulkancts/modules/vulkan/deqp-vk \
+ --deqp-case=dEQP-VK.api.smoke*
+ ``` \ No newline at end of file
diff --git a/src/gfxstream/guest/BUILD.gn b/src/gfxstream/guest/BUILD.gn
new file mode 100644
index 00000000000..f427469da01
--- /dev/null
+++ b/src/gfxstream/guest/BUILD.gn
@@ -0,0 +1,242 @@
+# 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.
+
+config("common_config") {
+ defines = [
+ "LOG_TAG=\"gfxstream_vulkan\"",
+ "GOLDFISH_NO_GL",
+ "VK_GFXSTREAM_STRUCTURE_TYPE_EXT",
+ "VK_USE_PLATFORM_FUCHSIA",
+ "PAGE_SIZE=4096",
+ ]
+
+ include_dirs = [
+ "../common/opengl/include",
+ "android-emu",
+ "GoldfishAddressSpace/include",
+ "iostream/include",
+ "gralloc_cb/include",
+ "qemupipe/include",
+ "qemupipe/include-types",
+ "OpenglCodecCommon",
+ "OpenglSystemCommon",
+ "renderControl_enc",
+ "vulkan_enc",
+ "platform/include",
+ ]
+
+ if (target_os == "fuchsia") {
+ include_dirs += [ "fuchsia/include" ]
+ }
+
+ cflags_cc = [
+ "-Wno-conversion",
+ "-Wno-newline-eof",
+ "-Wno-pessimizing-move",
+ "-Wno-sign-compare",
+ "-Wno-unused-function",
+ "-Wno-unused-value",
+ "-Wno-unused-variable",
+ "-Wno-unused-but-set-parameter",
+ "-Wno-unused-but-set-variable",
+ ]
+}
+
+# These sources require access to the Fuchsia goldfish protocols.
+source_set("goldfish_srcs") {
+ configs += [ ":common_config" ]
+
+ sources = [
+ "vulkan/goldfish_vulkan.cpp",
+ "vulkan_enc/ResourceTracker.cpp",
+ "vulkan_enc/ResourceTracker.h",
+ ]
+
+ public_deps = [
+ "//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_cpp",
+ "//sdk/fidl/fuchsia.logger:fuchsia.logger_cpp",
+ "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_cpp",
+ "//third_party/Vulkan-Headers:vulkan_headers",
+ "//third_party/mesa/include:drm-uapi",
+ "//zircon/system/ulib/async:async-cpp",
+ "//zircon/system/ulib/async-loop:async-loop-cpp",
+ "//zircon/system/ulib/syslog:syslog-static",
+ "//zircon/system/ulib/trace:trace-with-static-engine",
+ "//zircon/system/ulib/trace-provider:trace-provider-with-static-engine",
+ "//zircon/system/ulib/zx",
+ "//zircon/system/ulib/zxio",
+ ]
+
+ defines = [
+ "QEMU_PIPE_PATH=\"/loader-gpu-devices/class/goldfish-pipe/000\"",
+ "GOLDFISH_ADDRESS_SPACE_DEVICE_NAME=\"/loader-gpu-devices/class/goldfish-address-space/000\"",
+ ]
+}
+
+loadable_module("libvulkan_gfxstream") {
+ configs += [ ":common_config" ]
+
+ sources = [
+ "GoldfishAddressSpace/AddressSpaceStream.cpp",
+ "GoldfishAddressSpace/VirtioGpuAddressSpaceStream.cpp",
+ "OpenglCodecCommon/ChecksumCalculator.cpp",
+ "OpenglCodecCommon/ChecksumCalculator.h",
+ "OpenglCodecCommon/glUtils.cpp",
+ "OpenglCodecCommon/glUtils.h",
+ "OpenglSystemCommon/HostConnection.cpp",
+ "OpenglSystemCommon/HostConnection.h",
+ "OpenglSystemCommon/ProcessPipe.cpp",
+ "OpenglSystemCommon/ProcessPipe.h",
+ "OpenglSystemCommon/QemuPipeStream.h",
+ "OpenglSystemCommon/QemuPipeStream.cpp",
+ "OpenglSystemCommon/ThreadInfo.cpp",
+ "OpenglSystemCommon/ThreadInfo.h",
+ "OpenglSystemCommon/VirtioGpuPipeStream.cpp",
+ "android-emu/aemu/base/AlignedBuf.cpp",
+ "android-emu/aemu/base/AlignedBuf.h",
+ "android-emu/aemu/base/Allocator.h",
+ "android-emu/aemu/base/AndroidHealthMonitor.cpp",
+ "android-emu/aemu/base/AndroidHealthMonitor.h",
+ "android-emu/aemu/base/AndroidHealthMonitorConsumer.h",
+ "android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.cpp",
+ "android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.h",
+ "android-emu/aemu/base/AndroidSubAllocator.cpp",
+ "android-emu/aemu/base/AndroidSubAllocator.h",
+ "android-emu/aemu/base/BumpPool.h",
+ "android-emu/aemu/base/Pool.cpp",
+ "android-emu/aemu/base/Pool.h",
+ "android-emu/aemu/base/Process.cpp",
+ "android-emu/aemu/base/Process.h",
+ "android-emu/aemu/base/Tracing.cpp",
+ "android-emu/aemu/base/Tracing.h",
+ "android-emu/aemu/base/files/MemStream.cpp",
+ "android-emu/aemu/base/files/MemStream.h",
+ "android-emu/aemu/base/files/Stream.cpp",
+ "android-emu/aemu/base/files/Stream.h",
+ "android-emu/aemu/base/files/StreamSerializing.cpp",
+ "android-emu/aemu/base/files/StreamSerializing.h",
+ "android-emu/aemu/base/fit/Defer.h",
+ "android-emu/aemu/base/fit/Function.h",
+ "android-emu/aemu/base/fit/FunctionInternal.h",
+ "android-emu/aemu/base/fit/Nullable.h",
+ "android-emu/aemu/base/fit/ThreadChecker.h",
+ "android-emu/aemu/base/fit/ThreadSafety.h",
+ "android-emu/aemu/base/fit/UtilityInternal.h",
+ "android-emu/aemu/base/ring_buffer.c",
+ "android-emu/aemu/base/synchronization/AndroidConditionVariable.h",
+ "android-emu/aemu/base/synchronization/AndroidLock.h",
+ "android-emu/aemu/base/synchronization/AndroidMessageChannel.cpp",
+ "android-emu/aemu/base/synchronization/AndroidMessageChannel.h",
+ "android-emu/aemu/base/testing/TestClock.h",
+ "android-emu/aemu/base/threads/AndroidFunctorThread.cpp",
+ "android-emu/aemu/base/threads/AndroidFunctorThread.h",
+ "android-emu/aemu/base/threads/AndroidThread.h",
+ "android-emu/aemu/base/threads/AndroidThreadStore.h",
+ "android-emu/aemu/base/threads/AndroidThreadTypes.h",
+ "android-emu/aemu/base/threads/AndroidThread_pthread.cpp",
+ "android-emu/aemu/base/threads/AndroidWorkPool.cpp",
+ "android-emu/aemu/base/threads/AndroidWorkPool.h",
+ "gralloc_cb/include/gralloc_cb_bp.h",
+ "platform/VirtGpu.cpp",
+ "platform/include/VirtGpu.h",
+ "platform/stub/StubSync.cpp",
+ "platform/stub/StubVirtGpuBlob.cpp",
+ "platform/stub/StubVirtGpuBlobMapping.cpp",
+ "platform/stub/StubVirtGpuDevice.cpp",
+ "qemupipe/include-types/qemu_pipe_types_bp.h",
+ "qemupipe/include/qemu_pipe_bp.h",
+ "qemupipe/qemu_pipe_common.cpp",
+ "qemupipe/qemu_pipe_guest.cpp",
+ "renderControl_enc/renderControl_enc.cpp",
+ "renderControl_enc/renderControl_enc.h",
+ "vulkan_enc/CommandBufferStagingStream.cpp",
+ "vulkan_enc/CommandBufferStagingStream.h",
+ "vulkan_enc/DescriptorSetVirtualization.cpp",
+ "vulkan_enc/DescriptorSetVirtualization.h",
+ "vulkan_enc/HostVisibleMemoryVirtualization.cpp",
+ "vulkan_enc/HostVisibleMemoryVirtualization.h",
+ "vulkan_enc/Resources.cpp",
+ "vulkan_enc/Resources.h",
+ "vulkan_enc/Validation.cpp",
+ "vulkan_enc/Validation.h",
+ "vulkan_enc/VkEncoder.cpp",
+ "vulkan_enc/VkEncoder.h",
+ "vulkan_enc/VulkanHandleMapping.cpp",
+ "vulkan_enc/VulkanHandleMapping.h",
+ "vulkan_enc/VulkanStreamGuest.cpp",
+ "vulkan_enc/VulkanStreamGuest.h",
+ "vulkan_enc/func_table.cpp",
+ "vulkan_enc/func_table.h",
+ "vulkan_enc/goldfish_vk_counting_guest.cpp",
+ "vulkan_enc/goldfish_vk_counting_guest.h",
+ "vulkan_enc/goldfish_vk_deepcopy_guest.cpp",
+ "vulkan_enc/goldfish_vk_deepcopy_guest.h",
+ "vulkan_enc/goldfish_vk_extension_structs_guest.cpp",
+ "vulkan_enc/goldfish_vk_extension_structs_guest.h",
+ "vulkan_enc/goldfish_vk_marshaling_guest.cpp",
+ "vulkan_enc/goldfish_vk_marshaling_guest.h",
+ "vulkan_enc/goldfish_vk_reserved_marshaling_guest.cpp",
+ "vulkan_enc/goldfish_vk_reserved_marshaling_guest.h",
+ "vulkan_enc/goldfish_vk_transform_guest.cpp",
+ "vulkan_enc/goldfish_vk_transform_guest.h",
+ "vulkan_enc/vulkan_gfxstream.h",
+ "vulkan_enc/vulkan_gfxstream_structure_type.h",
+ ]
+
+ if (target_os == "fuchsia") {
+ sources -= [
+ "OpenglSystemCommon/QemuPipeStream.cpp",
+ "qemupipe/qemu_pipe_common.cpp",
+ "qemupipe/qemu_pipe_guest.cpp",
+ "platform/stub/StubVirtGpuBlob.cpp",
+ "platform/stub/StubVirtGpuBlobMapping.cpp",
+ "platform/stub/StubVirtGpuDevice.cpp",
+ ]
+ sources += [
+ "OpenglSystemCommon/TraceProviderFuchsia.cpp",
+ "OpenglSystemCommon/TraceProviderFuchsia.h",
+ "fuchsia/fuchsia_stdio.cc",
+ "fuchsia/port.cc",
+ "fuchsia/service_connector.cc",
+ "platform/fuchsia/FuchsiaVirtGpuBlob.cpp",
+ "platform/fuchsia/FuchsiaVirtGpuBlobMapping.cpp",
+ "platform/fuchsia/FuchsiaVirtGpuDevice.cpp",
+ ]
+
+ include_dirs = [
+ "fuchsia/include",
+ "platform/include",
+ "//third_party/Vulkan-Headers/include",
+ ]
+
+ deps = [
+ ":goldfish_srcs",
+ "//sdk/fidl/fuchsia.logger:fuchsia.logger_cpp",
+ "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_cpp",
+ "//src/zircon/lib/zircon",
+ "//zircon/system/ulib/trace:trace-with-static-engine",
+ "//zircon/system/ulib/zx",
+ "//zircon/system/ulib/zxio",
+ ]
+
+ public_deps = [ "//third_party/Vulkan-Headers:vulkan_headers" ]
+
+ # Vulkan ICDs on Fuchsia are only allowed to depend on (parts of) libc
+ # and libzircon, and no other shared libraries.
+ assert_no_deps = [
+ "//sdk/lib/fdio",
+ "//zircon/system/ulib/async-default",
+ ]
+ }
+}
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/AddressSpaceStream.cpp b/src/gfxstream/guest/GoldfishAddressSpace/AddressSpaceStream.cpp
new file mode 100644
index 00000000000..d7262a84a2d
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/AddressSpaceStream.cpp
@@ -0,0 +1,620 @@
+/*
+* 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 <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "VirtGpu.h"
+#include "aemu/base/Tracing.h"
+#include "util.h"
+#include "virtgpu_gfxstream_protocol.h"
+
+#if defined(__ANDROID__)
+#include "android-base/properties.h"
+#endif
+#include <cutils/log.h>
+
+static const size_t kReadSize = 512 * 1024;
+static const size_t kWriteOffset = kReadSize;
+
+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(__APPLE__) || defined(__MACOSX) || defined(__Fuchsia__) || defined(__linux__)
+ static const uint32_t kBackoffItersThreshold = 50000000;
+ static const uint32_t kBackoffFactorDoublingIncrement = 50000000;
+#elif defined(__ANDROID__)
+ static const uint32_t kBackoffItersThreshold =
+ android::base::GetUintProperty("ro.boot.asg.backoffiters", 50000000);
+ static const uint32_t kBackoffFactorDoublingIncrement =
+ android::base::GetUintProperty("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/src/gfxstream/guest/GoldfishAddressSpace/GoldfishAddressSpaceStream.cpp b/src/gfxstream/guest/GoldfishAddressSpace/GoldfishAddressSpaceStream.cpp
new file mode 100644
index 00000000000..03157446be9
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/GoldfishAddressSpaceStream.cpp
@@ -0,0 +1,131 @@
+// Copyright 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 "GoldfishAddressSpaceStream.h"
+
+#include "goldfish_address_space.h"
+
+AddressSpaceStream* createGoldfishAddressSpaceStream(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;
+} \ No newline at end of file
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/VirtioGpuAddressSpaceStream.cpp b/src/gfxstream/guest/GoldfishAddressSpace/VirtioGpuAddressSpaceStream.cpp
new file mode 100644
index 00000000000..7f6023e5a3b
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/VirtioGpuAddressSpaceStream.cpp
@@ -0,0 +1,149 @@
+// Copyright 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 "VirtioGpuAddressSpaceStream.h"
+
+#include "util.h"
+
+static bool GetRingParamsFromCapset(enum VirtGpuCapset capset, const VirtGpuCaps& caps,
+ uint32_t& ringSize, uint32_t& bufferSize,
+ uint32_t& blobAlignment) {
+ switch (capset) {
+ case kCapsetGfxStreamVulkan:
+ ringSize = caps.vulkanCapset.ringSize;
+ bufferSize = caps.vulkanCapset.bufferSize;
+ blobAlignment = caps.vulkanCapset.blobAlignment;
+ break;
+ case kCapsetGfxStreamMagma:
+ ringSize = caps.magmaCapset.ringSize;
+ bufferSize = caps.magmaCapset.bufferSize;
+ blobAlignment = caps.magmaCapset.blobAlignment;
+ break;
+ case kCapsetGfxStreamGles:
+ ringSize = caps.glesCapset.ringSize;
+ bufferSize = caps.glesCapset.bufferSize;
+ blobAlignment = caps.glesCapset.blobAlignment;
+ break;
+ case kCapsetGfxStreamComposer:
+ ringSize = caps.composerCapset.ringSize;
+ bufferSize = caps.composerCapset.bufferSize;
+ blobAlignment = caps.composerCapset.blobAlignment;
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}
+
+address_space_handle_t virtgpu_address_space_open() {
+ return (address_space_handle_t)(-EINVAL);
+}
+
+void virtgpu_address_space_close(address_space_handle_t) {
+ // Handle opened by VirtioGpuDevice wrapper
+}
+
+bool virtgpu_address_space_ping(address_space_handle_t, 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(enum VirtGpuCapset capset,
+ HealthMonitor<>* healthMonitor) {
+ VirtGpuBlobPtr pipe, blob;
+ VirtGpuBlobMappingPtr pipeMapping, blobMapping;
+ struct VirtGpuExecBuffer exec = {};
+ struct VirtGpuCreateBlob blobCreate = {};
+ struct gfxstreamContextCreate contextCreate = {};
+
+ uint32_t ringSize = 0;
+ uint32_t bufferSize = 0;
+ uint32_t blobAlignment = 0;
+
+ char* blobAddr, *bufferPtr;
+ int ret;
+
+ VirtGpuDevice* instance = VirtGpuDevice::getInstance();
+ auto caps = instance->getCaps();
+
+ if (!GetRingParamsFromCapset(capset, caps, ringSize, bufferSize, blobAlignment)) {
+ ALOGE("Failed to get ring parameters");
+ return nullptr;
+ }
+
+ blobCreate.blobId = 0;
+ blobCreate.blobMem = kBlobMemHost3d;
+ blobCreate.flags = kBlobFlagMappable;
+ blobCreate.size = ALIGN(ringSize + bufferSize, 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.get());
+ 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, 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;
+}
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/goldfish_address_space.cpp b/src/gfxstream/guest/GoldfishAddressSpace/goldfish_address_space.cpp
new file mode 100644
index 00000000000..3618d325e4c
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/goldfish_address_space.cpp
@@ -0,0 +1,30 @@
+// 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.
+
+#if defined(__Fuchsia__)
+#include "goldfish_address_space_fuchsia.impl"
+#else
+#include "goldfish_address_space_android.impl"
+#endif
+
+void GoldfishAddressSpaceBlock::replace(GoldfishAddressSpaceBlock *other)
+{
+ destroy();
+
+ if (other) {
+ *this = *other;
+ *other = GoldfishAddressSpaceBlock();
+ }
+}
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/include/AddressSpaceStream.h b/src/gfxstream/guest/GoldfishAddressSpace/include/AddressSpaceStream.h
new file mode 100644
index 00000000000..a2063cf5831
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/include/AddressSpaceStream.h
@@ -0,0 +1,108 @@
+/*
+* 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 "VirtGpu.h"
+#include "address_space.h"
+#include "address_space_graphics_types.h"
+#include "aemu/base/AndroidHealthMonitor.h"
+#include "gfxstream/guest/IOStream.h"
+
+using gfxstream::guest::HealthMonitor;
+using gfxstream::guest::IOStream;
+
+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/src/gfxstream/guest/GoldfishAddressSpace/include/GoldfishAddressSpaceStream.h b/src/gfxstream/guest/GoldfishAddressSpace/include/GoldfishAddressSpaceStream.h
new file mode 100644
index 00000000000..b4a5be3bf7c
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/include/GoldfishAddressSpaceStream.h
@@ -0,0 +1,19 @@
+// Copyright 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 "AddressSpaceStream.h"
+
+AddressSpaceStream* createGoldfishAddressSpaceStream(size_t bufSize, gfxstream::guest::HealthMonitor<>* healthMonitor);
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/include/VirtioGpuAddressSpaceStream.h b/src/gfxstream/guest/GoldfishAddressSpace/include/VirtioGpuAddressSpaceStream.h
new file mode 100644
index 00000000000..4e7b0da760a
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/include/VirtioGpuAddressSpaceStream.h
@@ -0,0 +1,20 @@
+// Copyright 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 "AddressSpaceStream.h"
+
+AddressSpaceStream* createVirtioGpuAddressSpaceStream(
+ enum VirtGpuCapset capset, gfxstream::guest::HealthMonitor<>* healthMonitor);
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/include/address_space.h b/src/gfxstream/guest/GoldfishAddressSpace/include/address_space.h
new file mode 100644
index 00000000000..60bff6daa3d
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/include/address_space.h
@@ -0,0 +1,79 @@
+// Copyright 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 <inttypes.h>
+#include <stddef.h>
+
+#if defined(__Fuchsia__)
+ typedef void* address_space_handle_t;
+#else
+ typedef int address_space_handle_t;
+#endif
+
+enum AddressSpaceSubdeviceType {
+ NoSubdevice = -1,
+ Graphics = 0,
+ Media = 1,
+ HostMemoryAllocator = 5,
+ SharedSlotsHostMemoryAllocator = 6,
+ VirtioGpuGraphics = 10,
+};
+
+// We also expose the ping info struct that is shared between host and guest.
+struct address_space_ping {
+ uint64_t offset;
+ uint64_t size;
+ uint64_t metadata;
+ uint32_t resourceId;
+ uint32_t wait_fd;
+ uint32_t wait_flags;
+ uint32_t direction;
+};
+
+// typedef/struct to abstract over goldfish vs virtio-gpu implementations
+typedef address_space_handle_t (*address_space_open_t)(void);
+typedef void (*address_space_close_t)(address_space_handle_t);
+
+typedef bool (*address_space_allocate_t)(
+ address_space_handle_t, size_t size, uint64_t* phys_addr, uint64_t* offset);
+typedef bool (*address_space_free_t)(
+ address_space_handle_t, uint64_t offset);
+
+typedef bool (*address_space_claim_shared_t)(
+ address_space_handle_t, uint64_t offset, uint64_t size);
+typedef bool (*address_space_unclaim_shared_t)(
+ address_space_handle_t, uint64_t offset);
+
+// pgoff is the offset into the page to return in the result
+typedef void* (*address_space_map_t)(
+ address_space_handle_t, uint64_t offset, uint64_t size, uint64_t pgoff);
+typedef void (*address_space_unmap_t)(void* ptr, uint64_t size);
+
+typedef bool (*address_space_set_subdevice_type_t)(
+ address_space_handle_t, AddressSpaceSubdeviceType type, address_space_handle_t*);
+typedef bool (*address_space_ping_t)(
+ address_space_handle_t, struct address_space_ping*);
+
+struct address_space_ops {
+ address_space_open_t open;
+ address_space_close_t close;
+ address_space_claim_shared_t claim_shared;
+ address_space_unclaim_shared_t unclaim_shared;
+ address_space_map_t map;
+ address_space_unmap_t unmap;
+ address_space_set_subdevice_type_t set_subdevice_type;
+ address_space_ping_t ping;
+};
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/include/address_space_graphics_types.h b/src/gfxstream/guest/GoldfishAddressSpace/include/address_space_graphics_types.h
new file mode 100644
index 00000000000..e52c8fe22d4
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/include/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 gfxstream {
+namespace guest {
+
+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*, gfxstream::guest::Stream*)>;
+using ConsumerLoadCallback =
+ std::function<void(void*, gfxstream::guest::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/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space.h b/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space.h
new file mode 100644
index 00000000000..bd61fd61976
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space.h
@@ -0,0 +1,139 @@
+// 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 ANDROID_INCLUDE_HARDWARE_GOLDFISH_ADDRESS_SPACE_H
+#define ANDROID_INCLUDE_HARDWARE_GOLDFISH_ADDRESS_SPACE_H
+
+#include <inttypes.h>
+#include <stddef.h>
+
+#ifdef __Fuchsia__
+#include <fidl/fuchsia.hardware.goldfish/cpp/wire.h>
+#endif
+
+#include "address_space.h"
+
+class GoldfishAddressSpaceBlock;
+class GoldfishAddressSpaceHostMemoryAllocator;
+
+using GoldfishAddressSpaceSubdeviceType = AddressSpaceSubdeviceType;
+
+class GoldfishAddressSpaceBlockProvider {
+public:
+ GoldfishAddressSpaceBlockProvider(GoldfishAddressSpaceSubdeviceType subdevice);
+ ~GoldfishAddressSpaceBlockProvider();
+
+private:
+ GoldfishAddressSpaceBlockProvider(const GoldfishAddressSpaceBlockProvider &rhs);
+ GoldfishAddressSpaceBlockProvider &operator=(const GoldfishAddressSpaceBlockProvider &rhs);
+
+ bool is_opened() const;
+ void close();
+ address_space_handle_t release();
+ static void closeHandle(address_space_handle_t handle);
+
+#ifdef __Fuchsia__
+ ::fidl::WireSyncClient<fuchsia_hardware_goldfish::AddressSpaceDevice>
+ m_device;
+ ::fidl::WireSyncClient<fuchsia_hardware_goldfish::AddressSpaceChildDriver>
+ m_child_driver;
+#else // __Fuchsia__
+ address_space_handle_t m_handle;
+#endif // !__Fuchsia__
+
+ friend class GoldfishAddressSpaceBlock;
+ friend class GoldfishAddressSpaceHostMemoryAllocator;
+};
+
+class GoldfishAddressSpaceBlock {
+public:
+ GoldfishAddressSpaceBlock();
+ ~GoldfishAddressSpaceBlock();
+
+ bool allocate(GoldfishAddressSpaceBlockProvider *provider, size_t size);
+ bool claimShared(GoldfishAddressSpaceBlockProvider *provider, uint64_t offset, uint64_t size);
+ uint64_t physAddr() const;
+ uint64_t hostAddr() const;
+ uint64_t offset() const { return m_offset; }
+ size_t size() const { return m_size; }
+ void *mmap(uint64_t opaque);
+ void *guestPtr() const;
+ void replace(GoldfishAddressSpaceBlock *other);
+ void release();
+ static int memoryMap(void *addr, size_t len, address_space_handle_t fd, uint64_t off, void** dst);
+ static void memoryUnmap(void *ptr, size_t size);
+
+private:
+ void destroy();
+ GoldfishAddressSpaceBlock &operator=(const GoldfishAddressSpaceBlock &);
+
+#ifdef __Fuchsia__
+ ::fidl::WireSyncClient<fuchsia_hardware_goldfish::AddressSpaceChildDriver>*
+ m_driver;
+ uint32_t m_vmo;
+#else // __Fuchsia__
+ address_space_handle_t m_handle;
+#endif // !__Fuchsia__
+
+ void *m_mmaped_ptr;
+ uint64_t m_phys_addr;
+ uint64_t m_host_addr;
+ uint64_t m_offset;
+ uint64_t m_size;
+ bool m_is_shared_mapping;
+};
+
+class GoldfishAddressSpaceHostMemoryAllocator {
+public:
+ GoldfishAddressSpaceHostMemoryAllocator(bool useSharedSlots);
+
+ long hostMalloc(GoldfishAddressSpaceBlock *block, size_t size);
+ void hostFree(GoldfishAddressSpaceBlock *block);
+
+ bool is_opened() const;
+ address_space_handle_t release() { return m_provider.release(); }
+ static void closeHandle(address_space_handle_t handle) { GoldfishAddressSpaceBlockProvider::closeHandle(handle); }
+
+private:
+ GoldfishAddressSpaceBlockProvider m_provider;
+ bool m_useSharedSlots;
+};
+
+// Convenience functions that run address space driver api without wrapping in
+// a class. Useful for when a client wants to manage the driver handle directly
+// (e.g., mmaping() more than one region associated with a single handle will
+// require different lifetime expectations versus GoldfishAddressSpaceBlock).
+
+address_space_handle_t goldfish_address_space_open();
+void goldfish_address_space_close(address_space_handle_t);
+
+bool goldfish_address_space_allocate(
+ address_space_handle_t, size_t size, uint64_t* phys_addr, uint64_t* offset);
+bool goldfish_address_space_free(
+ address_space_handle_t, uint64_t offset);
+
+bool goldfish_address_space_claim_shared(
+ address_space_handle_t, uint64_t offset, uint64_t size);
+bool goldfish_address_space_unclaim_shared(
+ address_space_handle_t, uint64_t offset);
+
+// pgoff is the offset into the page to return in the result
+void* goldfish_address_space_map(
+ address_space_handle_t, uint64_t offset, uint64_t size, uint64_t pgoff = 0);
+void goldfish_address_space_unmap(void* ptr, uint64_t size);
+
+bool goldfish_address_space_set_subdevice_type(address_space_handle_t, GoldfishAddressSpaceSubdeviceType type, address_space_handle_t*);
+bool goldfish_address_space_ping(address_space_handle_t, struct address_space_ping*);
+
+#endif // #ifndef ANDROID_INCLUDE_HARDWARE_GOLDFISH_ADDRESS_SPACE_H
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space_android.impl b/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space_android.impl
new file mode 100644
index 00000000000..6fec6440ddc
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space_android.impl
@@ -0,0 +1,538 @@
+// 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 <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 <errno.h>
+#include <memory>
+#include <cstring>
+
+#include "goldfish_address_space.h"
+#include <log/log.h>
+
+
+// See virgl_hw.h and p_defines.h
+#define VIRGL_FORMAT_R8_UNORM 64
+#define VIRGL_BIND_CUSTOM (1 << 17)
+#define PIPE_BUFFER 0
+
+#ifdef PAGE_SIZE
+constexpr size_t kPageSize = PAGE_SIZE;
+#else
+static const size_t kPageSize = getpagesize();
+#endif
+
+namespace {
+
+struct goldfish_address_space_allocate_block {
+ __u64 size;
+ __u64 offset;
+ __u64 phys_addr;
+};
+
+struct goldfish_address_space_claim_shared {
+ __u64 offset;
+ __u64 size;
+};
+
+#define GOLDFISH_ADDRESS_SPACE_IOCTL_MAGIC 'G'
+#define GOLDFISH_ADDRESS_SPACE_IOCTL_OP(OP, T) _IOWR(GOLDFISH_ADDRESS_SPACE_IOCTL_MAGIC, OP, T)
+#define GOLDFISH_ADDRESS_SPACE_IOCTL_ALLOCATE_BLOCK GOLDFISH_ADDRESS_SPACE_IOCTL_OP(10, struct goldfish_address_space_allocate_block)
+#define GOLDFISH_ADDRESS_SPACE_IOCTL_DEALLOCATE_BLOCK GOLDFISH_ADDRESS_SPACE_IOCTL_OP(11, __u64)
+#define GOLDFISH_ADDRESS_SPACE_IOCTL_PING GOLDFISH_ADDRESS_SPACE_IOCTL_OP(12, struct address_space_ping)
+#define GOLDFISH_ADDRESS_SPACE_IOCTL_CLAIM_SHARED GOLDFISH_ADDRESS_SPACE_IOCTL_OP(13, struct goldfish_address_space_claim_shared)
+#define GOLDFISH_ADDRESS_SPACE_IOCTL_UNCLAIM_SHARED GOLDFISH_ADDRESS_SPACE_IOCTL_OP(14, __u64)
+
+const char GOLDFISH_ADDRESS_SPACE_DEVICE_NAME[] = "/dev/goldfish_address_space";
+
+const int HOST_MEMORY_ALLOCATOR_COMMAND_ALLOCATE_ID = 1;
+const int HOST_MEMORY_ALLOCATOR_COMMAND_UNALLOCATE_ID = 2;
+
+int create_address_space_fd()
+{
+ return ::open(GOLDFISH_ADDRESS_SPACE_DEVICE_NAME, O_RDWR);
+}
+
+long ioctl_allocate(int fd, struct goldfish_address_space_allocate_block *request)
+{
+ return ::ioctl(fd, GOLDFISH_ADDRESS_SPACE_IOCTL_ALLOCATE_BLOCK, request);
+}
+
+long ioctl_deallocate(int fd, uint64_t offset)
+{
+ return ::ioctl(fd, GOLDFISH_ADDRESS_SPACE_IOCTL_DEALLOCATE_BLOCK, &offset);
+}
+
+long ioctl_ping(int fd, struct address_space_ping *request)
+{
+ return ::ioctl(fd, GOLDFISH_ADDRESS_SPACE_IOCTL_PING, request);
+}
+
+long set_address_space_subdevice_type(int fd, uint64_t type)
+{
+ struct address_space_ping request;
+ ::memset(&request, 0, sizeof(request));
+ request.resourceId = sizeof(request);
+ request.metadata = type;
+
+ long ret = ioctl_ping(fd, &request);
+ if (ret) {
+ return ret;
+ }
+
+ return request.metadata;
+}
+
+long ioctl_claim_shared(int fd, struct goldfish_address_space_claim_shared *request)
+{
+ return ::ioctl(fd, GOLDFISH_ADDRESS_SPACE_IOCTL_CLAIM_SHARED, request);
+}
+
+long ioctl_unclaim_shared(int fd, uint64_t offset)
+{
+ return ::ioctl(fd, GOLDFISH_ADDRESS_SPACE_IOCTL_UNCLAIM_SHARED, &offset);
+}
+
+} // namespace
+
+GoldfishAddressSpaceBlockProvider::GoldfishAddressSpaceBlockProvider(GoldfishAddressSpaceSubdeviceType subdevice)
+ : m_handle(create_address_space_fd())
+{
+ if ((subdevice != GoldfishAddressSpaceSubdeviceType::NoSubdevice) && is_opened()) {
+ const long ret = set_address_space_subdevice_type(m_handle, subdevice);
+ if (ret != 0 && ret != subdevice) { // TODO: retire the 'ret != subdevice' check
+ ALOGE("%s: set_address_space_subdevice_type failed for device_type=%lu, ret=%ld",
+ __func__, static_cast<unsigned long>(subdevice), ret);
+ close();
+ }
+ }
+}
+
+GoldfishAddressSpaceBlockProvider::~GoldfishAddressSpaceBlockProvider()
+{
+ if (is_opened()) {
+ ::close(m_handle);
+ }
+}
+
+bool GoldfishAddressSpaceBlockProvider::is_opened() const
+{
+ return m_handle >= 0;
+}
+
+void GoldfishAddressSpaceBlockProvider::close()
+{
+ if (is_opened()) {
+ ::close(m_handle);
+ m_handle = -1;
+ }
+}
+
+address_space_handle_t GoldfishAddressSpaceBlockProvider::release()
+{
+ address_space_handle_t handle = m_handle;
+ m_handle = -1;
+ return handle;
+}
+
+void GoldfishAddressSpaceBlockProvider::closeHandle(address_space_handle_t handle)
+{
+ ::close(handle);
+}
+
+GoldfishAddressSpaceBlock::GoldfishAddressSpaceBlock()
+ : m_handle(-1)
+ , m_mmaped_ptr(NULL)
+ , m_phys_addr(0)
+ , m_host_addr(0)
+ , m_offset(0)
+ , m_size(0) {}
+
+GoldfishAddressSpaceBlock::~GoldfishAddressSpaceBlock()
+{
+ destroy();
+}
+
+GoldfishAddressSpaceBlock &GoldfishAddressSpaceBlock::operator=(const GoldfishAddressSpaceBlock &rhs)
+{
+ m_mmaped_ptr = rhs.m_mmaped_ptr;
+ m_phys_addr = rhs.m_phys_addr;
+ m_host_addr = rhs.m_host_addr;
+ m_offset = rhs.m_offset;
+ m_size = rhs.m_size;
+ m_handle = rhs.m_handle;
+
+ return *this;
+}
+
+bool GoldfishAddressSpaceBlock::allocate(GoldfishAddressSpaceBlockProvider *provider, size_t size)
+{
+ destroy();
+
+ if (!provider->is_opened()) {
+ return false;
+ }
+
+ struct goldfish_address_space_allocate_block request;
+ ::memset(&request, 0, sizeof(request));
+ request.size = size;
+
+ long res = ioctl_allocate(provider->m_handle, &request);
+ if (res) {
+ return false;
+ } else {
+ m_phys_addr = request.phys_addr;
+ m_offset = request.offset;
+ m_size = request.size;
+ m_handle = provider->m_handle;
+ m_is_shared_mapping = false;
+
+ return true;
+ }
+}
+
+bool GoldfishAddressSpaceBlock::claimShared(GoldfishAddressSpaceBlockProvider *provider, uint64_t offset, uint64_t size)
+{
+ destroy();
+
+ if (!provider->is_opened()) {
+ return false;
+ }
+
+ struct goldfish_address_space_claim_shared request;
+ request.offset = offset;
+ request.size = size;
+ long res = ioctl_claim_shared(provider->m_handle, &request);
+
+ if (res) {
+ return false;
+ }
+
+ m_offset = offset;
+ m_size = size;
+ m_handle = provider->m_handle;
+ m_is_shared_mapping = true;
+
+ return true;
+}
+
+uint64_t GoldfishAddressSpaceBlock::physAddr() const
+{
+ return m_phys_addr;
+}
+
+uint64_t GoldfishAddressSpaceBlock::hostAddr() const
+{
+ return m_host_addr;
+}
+
+void *GoldfishAddressSpaceBlock::mmap(uint64_t host_addr)
+{
+ if (m_size == 0) {
+ ALOGE("%s: called with zero size\n", __func__);
+ return NULL;
+ }
+ if (m_mmaped_ptr) {
+ ALOGE("'mmap' called for an already mmaped address block");
+ ::abort();
+ }
+
+ void *result;
+ const int res = memoryMap(NULL, m_size, m_handle, m_offset, &result);
+ if (res) {
+ ALOGE("%s: host memory map failed with size 0x%llx "
+ "off 0x%llx errno %d\n",
+ __func__,
+ (unsigned long long)m_size,
+ (unsigned long long)m_offset, res);
+ return NULL;
+ } else {
+ m_mmaped_ptr = result;
+ m_host_addr = host_addr;
+ return guestPtr();
+ }
+}
+
+void *GoldfishAddressSpaceBlock::guestPtr() const
+{
+ return reinterpret_cast<char *>(m_mmaped_ptr) + (m_host_addr & (kPageSize - 1));
+}
+
+void GoldfishAddressSpaceBlock::destroy()
+{
+ if (m_mmaped_ptr && m_size) {
+ memoryUnmap(m_mmaped_ptr, m_size);
+ m_mmaped_ptr = NULL;
+ }
+
+ if (m_size) {
+ long res = -EINVAL;
+
+ if (m_is_shared_mapping) {
+ res = ioctl_unclaim_shared(m_handle, m_offset);
+ if (res) {
+ ALOGE("ioctl_unclaim_shared failed, res=%ld", res);
+ ::abort();
+ }
+ } else {
+ res = ioctl_deallocate(m_handle, m_offset);
+ if (res) {
+ ALOGE("ioctl_deallocate failed, res=%ld", res);
+ ::abort();
+ }
+ }
+
+ m_is_shared_mapping = false;
+
+ m_phys_addr = 0;
+ m_host_addr = 0;
+ m_offset = 0;
+ m_size = 0;
+ }
+}
+
+void GoldfishAddressSpaceBlock::release()
+{
+ m_handle = -1;
+ m_mmaped_ptr = NULL;
+ m_phys_addr = 0;
+ m_host_addr = 0;
+ m_offset = 0;
+ m_size = 0;
+}
+
+int GoldfishAddressSpaceBlock::memoryMap(void *addr,
+ size_t len,
+ address_space_handle_t fd,
+ uint64_t off,
+ void** dst) {
+ void* ptr = ::mmap64(addr, len, PROT_WRITE, MAP_SHARED, fd, off);
+ if (MAP_FAILED == ptr) {
+ return errno;
+ } else {
+ *dst = ptr;
+ return 0;
+ }
+}
+
+void GoldfishAddressSpaceBlock::memoryUnmap(void *ptr, size_t size)
+{
+ ::munmap(ptr, size);
+}
+
+GoldfishAddressSpaceHostMemoryAllocator::GoldfishAddressSpaceHostMemoryAllocator(bool useSharedSlots)
+ : m_provider(useSharedSlots
+ ? GoldfishAddressSpaceSubdeviceType::SharedSlotsHostMemoryAllocator
+ : GoldfishAddressSpaceSubdeviceType::HostMemoryAllocator),
+ m_useSharedSlots(useSharedSlots)
+{}
+
+bool GoldfishAddressSpaceHostMemoryAllocator::is_opened() const { return m_provider.is_opened(); }
+
+long GoldfishAddressSpaceHostMemoryAllocator::hostMalloc(GoldfishAddressSpaceBlock *block, size_t size)
+{
+ if (size == 0) {
+ return -EINVAL;
+ }
+ if (block->size() > 0) {
+ return -EINVAL;
+ }
+ if (!m_provider.is_opened()) {
+ return -ENODEV;
+ }
+
+ struct address_space_ping request;
+ if (m_useSharedSlots) {
+ // shared memory slots are supported
+ ::memset(&request, 0, sizeof(request));
+ request.resourceId = sizeof(request);
+ request.size = size;
+ request.metadata = HOST_MEMORY_ALLOCATOR_COMMAND_ALLOCATE_ID;
+
+ long ret = ioctl_ping(m_provider.m_handle, &request);
+ if (ret) {
+ return ret;
+ }
+ ret = static_cast<long>(request.metadata);
+ if (ret) {
+ return ret;
+ }
+
+ block->claimShared(&m_provider, request.offset, request.size);
+ } else {
+ // shared memory slots are not supported
+ if (!block->allocate(&m_provider, size)) {
+ return -ENOMEM;
+ }
+
+ ::memset(&request, 0, sizeof(request));
+ request.resourceId = sizeof(request);
+ request.offset = block->offset();
+ request.size = block->size();
+ request.metadata = HOST_MEMORY_ALLOCATOR_COMMAND_ALLOCATE_ID;
+
+ long ret = ioctl_ping(m_provider.m_handle, &request);
+ if (ret) {
+ return ret;
+ }
+ ret = static_cast<long>(request.metadata);
+ if (ret) {
+ return ret;
+ }
+ }
+
+ block->mmap(0);
+ return 0;
+}
+
+void GoldfishAddressSpaceHostMemoryAllocator::hostFree(GoldfishAddressSpaceBlock *block)
+{
+ if (block->size() == 0) {
+ return;
+ }
+
+ if (!m_provider.is_opened()) {
+ ALOGE("%s: device is not available", __func__);
+ ::abort();
+ }
+
+ if (block->guestPtr()) {
+ struct address_space_ping request;
+ ::memset(&request, 0, sizeof(request));
+ request.resourceId = sizeof(request);
+ request.offset = block->offset();
+ request.metadata = HOST_MEMORY_ALLOCATOR_COMMAND_UNALLOCATE_ID;
+
+ const long ret = ioctl_ping(m_provider.m_handle, &request);
+ if (ret) {
+ ALOGE("%s: ioctl_ping failed, ret=%ld", __func__, ret);
+ ::abort();
+ }
+ }
+
+ block->replace(NULL);
+}
+
+address_space_handle_t goldfish_address_space_open() {
+ return ::open(GOLDFISH_ADDRESS_SPACE_DEVICE_NAME, O_RDWR);
+}
+
+void goldfish_address_space_close(address_space_handle_t handle) {
+ ::close(handle);
+}
+
+bool goldfish_address_space_allocate(
+ address_space_handle_t handle,
+ size_t size, uint64_t* phys_addr, uint64_t* offset) {
+
+ struct goldfish_address_space_allocate_block request;
+ ::memset(&request, 0, sizeof(request));
+ request.size = size;
+
+ long res = ioctl_allocate(handle, &request);
+
+ if (res) return false;
+
+ *phys_addr = request.phys_addr;
+ *offset = request.offset;
+ return true;
+}
+
+bool goldfish_address_space_free(
+ address_space_handle_t handle, uint64_t offset) {
+
+ long res = ioctl_deallocate(handle, offset);
+
+ if (res) {
+ ALOGE("ioctl_deallocate failed, res=%ld", res);
+ ::abort();
+ }
+
+ return true;
+}
+
+bool goldfish_address_space_claim_shared(
+ address_space_handle_t handle, uint64_t offset, uint64_t size) {
+
+ struct goldfish_address_space_claim_shared request;
+ request.offset = offset;
+ request.size = size;
+ long res = ioctl_claim_shared(handle, &request);
+
+ if (res) return false;
+
+ return true;
+}
+
+bool goldfish_address_space_unclaim_shared(
+ address_space_handle_t handle, uint64_t offset) {
+ long res = ioctl_unclaim_shared(handle, offset);
+ if (res) {
+ ALOGE("ioctl_unclaim_shared failed, res=%ld", res);
+ ::abort();
+ }
+
+ return true;
+}
+
+// pgoff is the offset into the page to return in the result
+void* goldfish_address_space_map(
+ address_space_handle_t handle,
+ uint64_t offset, uint64_t size,
+ uint64_t pgoff) {
+
+ void* res = ::mmap64(0, size, PROT_WRITE, MAP_SHARED, handle, offset);
+
+ if (res == MAP_FAILED) {
+ ALOGE("%s: failed to map. errno: %d\n", __func__, errno);
+ return 0;
+ }
+
+ return (void*)(((char*)res) + (uintptr_t)(pgoff & (kPageSize - 1)));
+}
+
+void goldfish_address_space_unmap(void* ptr, uint64_t size) {
+ void* pagePtr = (void*)(((uintptr_t)ptr) & ~(kPageSize - 1));
+ ::munmap(pagePtr, size);
+}
+
+bool goldfish_address_space_set_subdevice_type(
+ address_space_handle_t handle, GoldfishAddressSpaceSubdeviceType type,
+ address_space_handle_t* handle_out) {
+ struct address_space_ping request;
+ request.metadata = (uint64_t)type;
+ *handle_out = handle;
+ return goldfish_address_space_ping(handle, &request);
+}
+
+bool goldfish_address_space_ping(
+ address_space_handle_t handle,
+ struct address_space_ping* ping) {
+ long res = ioctl_ping(handle, ping);
+
+ if (res) {
+ ALOGE("%s: ping failed: errno: %d\n", __func__, errno);
+ return false;
+ }
+
+ return true;
+}
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space_fuchsia.impl b/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space_fuchsia.impl
new file mode 100644
index 00000000000..57e394b30cf
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/include/goldfish_address_space_fuchsia.impl
@@ -0,0 +1,489 @@
+// 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 <memory>
+#include <fcntl.h>
+#include <lib/zx/channel.h>
+#include <lib/zx/vmo.h>
+#include <log/log.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <zircon/process.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+
+#include "goldfish_address_space.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+#include "services/service_connector.h"
+
+#include <unordered_map>
+
+#define GET_STATUS_SAFE(result, member) \
+ ((result).ok() ? ((result)->member) : ZX_OK)
+
+using gfxstream::guest::AutoLock;
+using gfxstream::guest::Lock;
+
+using fuchsia_hardware_goldfish::AddressSpaceChildDriver;
+using fuchsia_hardware_goldfish::AddressSpaceDevice;
+using fuchsia_hardware_goldfish::wire::AddressSpaceChildDriverType;
+using fuchsia_hardware_goldfish::wire::AddressSpaceChildDriverPingMessage;
+
+GoldfishAddressSpaceBlockProvider::GoldfishAddressSpaceBlockProvider(GoldfishAddressSpaceSubdeviceType subdevice) {
+
+ if (subdevice != GoldfishAddressSpaceSubdeviceType::NoSubdevice) {
+ ALOGE("%s: Tried to use a nontrivial subdevice when support has not been added\n", __func__);
+ abort();
+ }
+
+ fidl::ClientEnd<AddressSpaceDevice> channel{
+ zx::channel(GetConnectToServiceFunction()(GOLDFISH_ADDRESS_SPACE_DEVICE_NAME))};
+ if (!channel) {
+ ALOGE("%s: failed to get service handle for " GOLDFISH_ADDRESS_SPACE_DEVICE_NAME,
+ __FUNCTION__);
+ return;
+ }
+ m_device = fidl::WireSyncClient<AddressSpaceDevice>(std::move(channel));
+
+ auto child_driver_ends =
+ fidl::CreateEndpoints<::fuchsia_hardware_goldfish::AddressSpaceChildDriver>();
+ if (!child_driver_ends.is_ok()) {
+ ALOGE("%s: zx_channel_create failed: %d", __FUNCTION__, child_driver_ends.status_value());
+ return;
+ }
+
+ auto result = m_device->OpenChildDriver(
+ static_cast<AddressSpaceChildDriverType>(0 /* graphics */),
+ std::move(child_driver_ends->server));
+ if (!result.ok()) {
+ ALOGE("%s: failed to open child driver: %d",
+ __FUNCTION__, result.status());
+ return;
+ }
+ m_child_driver = fidl::WireSyncClient<AddressSpaceChildDriver>(
+ std::move(child_driver_ends->client));
+}
+
+GoldfishAddressSpaceBlockProvider::~GoldfishAddressSpaceBlockProvider()
+{
+}
+
+bool GoldfishAddressSpaceBlockProvider::is_opened() const
+{
+ return !!m_device;
+}
+
+// void GoldfishAddressSpaceBlockProvider::close() - not implemented
+// address_space_handle_t GoldfishAddressSpaceBlockProvider::release() - not imeplemented
+
+GoldfishAddressSpaceBlock::GoldfishAddressSpaceBlock()
+ : m_driver(NULL)
+ , m_vmo(ZX_HANDLE_INVALID)
+ , m_mmaped_ptr(NULL)
+ , m_phys_addr(0)
+ , m_host_addr(0)
+ , m_offset(0)
+ , m_size(0) {}
+
+GoldfishAddressSpaceBlock::~GoldfishAddressSpaceBlock()
+{
+ destroy();
+}
+
+GoldfishAddressSpaceBlock &GoldfishAddressSpaceBlock::operator=(const GoldfishAddressSpaceBlock &rhs)
+{
+ m_vmo = rhs.m_vmo;
+ m_mmaped_ptr = rhs.m_mmaped_ptr;
+ m_phys_addr = rhs.m_phys_addr;
+ m_host_addr = rhs.m_host_addr;
+ m_offset = rhs.m_offset;
+ m_size = rhs.m_size;
+ m_driver = rhs.m_driver;
+
+ return *this;
+}
+
+bool GoldfishAddressSpaceBlock::allocate(GoldfishAddressSpaceBlockProvider *provider, size_t size)
+{
+ destroy();
+
+ if (!provider->is_opened()) {
+ return false;
+ }
+
+ const fidl::WireSyncClient<AddressSpaceChildDriver>& driver = provider->m_child_driver;
+
+ auto result = driver->AllocateBlock(size);
+ if (!result.ok() || result->res != ZX_OK) {
+ ALOGE("%s: allocate block failed: %d:%d", __func__, result.status(), GET_STATUS_SAFE(result, res));
+ return false;
+ }
+ m_phys_addr = result->paddr;
+ // TODO(fxbug.dev/124700): Instead of storing raw handles we should
+ // consider using RAII zx::object instead.
+ m_vmo = result->vmo.release();
+
+ m_size = size;
+ m_offset = 0;
+ m_is_shared_mapping = false;
+ m_driver = &provider->m_child_driver;
+
+ return true;
+}
+
+bool GoldfishAddressSpaceBlock::claimShared(GoldfishAddressSpaceBlockProvider *provider, uint64_t offset, uint64_t size)
+{
+ ALOGE("%s: FATAL: not supported\n", __func__);
+ abort();
+}
+
+uint64_t GoldfishAddressSpaceBlock::physAddr() const
+{
+ return m_phys_addr;
+}
+
+uint64_t GoldfishAddressSpaceBlock::hostAddr() const
+{
+ return m_host_addr;
+}
+
+void *GoldfishAddressSpaceBlock::mmap(uint64_t host_addr)
+{
+ if (m_size == 0) {
+ ALOGE("%s: called with zero size\n", __func__);
+ return NULL;
+ }
+ if (m_mmaped_ptr) {
+ ALOGE("'mmap' called for an already mmaped address block");
+ ::abort();
+ }
+
+ bool nonzeroOffsetInPage = host_addr & (PAGE_SIZE - 1);
+ uint64_t extraBytes = nonzeroOffsetInPage ? PAGE_SIZE : 0;
+ m_size += extraBytes;
+
+ zx_vaddr_t ptr = 0;
+ zx_status_t status = zx_vmar_map(zx_vmar_root_self(),
+ ZX_VM_PERM_READ | ZX_VM_PERM_WRITE,
+ 0, m_vmo,
+ m_offset,
+ m_size,
+ &ptr);
+ if (status != ZX_OK) {
+ ALOGE("%s: host memory map failed with size 0x%llx "
+ "off 0x%llx status %d\n",
+ __func__,
+ (unsigned long long)m_size,
+ (unsigned long long)m_offset, status);
+ return NULL;
+ }
+
+ m_mmaped_ptr = (void*)ptr;
+ m_host_addr = host_addr;
+ return guestPtr();
+}
+
+void *GoldfishAddressSpaceBlock::guestPtr() const
+{
+ return reinterpret_cast<char *>(m_mmaped_ptr) + (m_host_addr & (PAGE_SIZE - 1));
+}
+
+void GoldfishAddressSpaceBlock::destroy()
+{
+ if (m_mmaped_ptr && m_size) {
+ zx_vmar_unmap(zx_vmar_root_self(),
+ (zx_vaddr_t)m_mmaped_ptr,
+ m_size);
+ m_mmaped_ptr = NULL;
+ }
+
+ if (m_size) {
+ zx_handle_close(m_vmo);
+ m_vmo = ZX_HANDLE_INVALID;
+ if (m_is_shared_mapping) {
+ // TODO
+ ALOGE("%s: unsupported: GoldfishAddressSpaceBlock destroy() for shared regions\n", __func__);
+ abort();
+ // int32_t res = ZX_OK;
+ // auto result = m_driver->UnclaimShared(m_offset);
+ // if (!result.ok() || result->res != ZX_OK) {
+ // ALOGE("%s: unclaim shared block failed: %d:%d", __func__,
+ // result.status(), GET_STATUS_SAFE(result, res));
+ // }
+ } else {
+ auto result = (*m_driver)->DeallocateBlock(m_phys_addr);
+ if (!result.ok() || result->res != ZX_OK) {
+ ALOGE("%s: deallocate block failed: %d:%d", __func__,
+ result.status(), GET_STATUS_SAFE(result, res));
+ }
+ }
+ m_driver = NULL;
+ m_phys_addr = 0;
+ m_host_addr = 0;
+ m_offset = 0;
+ m_size = 0;
+ }
+}
+
+GoldfishAddressSpaceHostMemoryAllocator::GoldfishAddressSpaceHostMemoryAllocator(bool useSharedSlots)
+ : m_provider(GoldfishAddressSpaceSubdeviceType::HostMemoryAllocator) { }
+
+long GoldfishAddressSpaceHostMemoryAllocator::hostMalloc(GoldfishAddressSpaceBlock *block, size_t size)
+{
+ return 0;
+}
+
+void GoldfishAddressSpaceHostMemoryAllocator::hostFree(GoldfishAddressSpaceBlock *block)
+{
+}
+
+class VmoStore {
+public:
+ struct Info {
+ zx_handle_t vmo = ZX_HANDLE_INVALID;
+ uint64_t phys_addr = 0;
+ };
+
+ void add(uint64_t offset, const Info& info) {
+ AutoLock lock(mLock);
+ mInfo[offset] = info;
+ }
+
+ void remove(uint64_t offset) {
+ AutoLock lock(mLock);
+ mInfo.erase(offset);
+ }
+
+ Info get(uint64_t offset) {
+ Info res;
+ AutoLock lock(mLock);
+ auto it = mInfo.find(offset);
+ if (it == mInfo.end()) {
+ ALOGE("VmoStore::%s cannot find info on offset 0x%llx\n", __func__,
+ (unsigned long long)offset);
+ return res;
+ }
+ res = it->second;
+ return res;
+ }
+
+private:
+ Lock mLock;
+ std::unordered_map<uint64_t, Info> mInfo;
+};
+
+static Lock sVmoStoreInitLock;
+static VmoStore* sVmoStore = nullptr;
+
+static VmoStore* getVmoStore() {
+ AutoLock lock(sVmoStoreInitLock);
+ if (!sVmoStore) sVmoStore = new VmoStore;
+ return sVmoStore;
+}
+
+address_space_handle_t goldfish_address_space_open() {
+ fidl::ClientEnd<AddressSpaceDevice> channel{
+ zx::channel(GetConnectToServiceFunction()(GOLDFISH_ADDRESS_SPACE_DEVICE_NAME))};
+ if (!channel) {
+ ALOGE("%s: failed to get service handle for " GOLDFISH_ADDRESS_SPACE_DEVICE_NAME,
+ __FUNCTION__);
+ return 0;
+ }
+ fidl::WireSyncClient<AddressSpaceDevice>*
+ deviceSync = new fidl::WireSyncClient<AddressSpaceDevice>(std::move(channel));
+ return (address_space_handle_t)deviceSync;
+}
+
+void goldfish_address_space_close(address_space_handle_t handle) {
+ fidl::WireSyncClient<AddressSpaceDevice>* deviceSync =
+ reinterpret_cast<
+ fidl::WireSyncClient<AddressSpaceDevice>*>(handle);
+ delete deviceSync;
+}
+
+bool goldfish_address_space_set_subdevice_type(
+ address_space_handle_t handle, GoldfishAddressSpaceSubdeviceType type,
+ address_space_handle_t* handle_out) {
+
+ auto* deviceSync =
+ reinterpret_cast<fidl::WireSyncClient<AddressSpaceDevice>*>(handle);
+
+ auto child_driver_ends =
+ fidl::CreateEndpoints<::fuchsia_hardware_goldfish::AddressSpaceChildDriver>();
+ if (!child_driver_ends.is_ok()) {
+ ALOGE("%s: zx_channel_create failed: %d", __FUNCTION__, child_driver_ends.status_value());
+ return false;
+ }
+
+ (*deviceSync)->OpenChildDriver(
+ static_cast<AddressSpaceChildDriverType>(type),
+ std::move(child_driver_ends->server));
+
+ fidl::WireSyncClient<AddressSpaceChildDriver>*
+ childSync = new fidl::WireSyncClient<AddressSpaceChildDriver>(std::move(child_driver_ends->client));
+
+ // On creating a subdevice, in our use cases we wont be needing the
+ // original device sync anymore, so get rid of it.
+ delete deviceSync;
+
+ *handle_out = (void*)childSync;
+
+ return true;
+}
+
+bool goldfish_address_space_allocate(
+ address_space_handle_t handle,
+ size_t size, uint64_t* phys_addr, uint64_t* offset) {
+ const auto& deviceSync =
+ *reinterpret_cast<
+ fidl::WireSyncClient<AddressSpaceChildDriver>*>(handle);
+
+ zx::vmo vmo;
+ auto result = deviceSync->AllocateBlock(size);
+ if (!result.ok() || result->res != ZX_OK) {
+ ALOGE("%s: allocate block failed: %d:%d", __func__, result.status(), GET_STATUS_SAFE(result, res));
+ return false;
+ }
+ *phys_addr = result->paddr;
+ vmo = std::move(result->vmo);
+
+ *offset = 0;
+
+ // TODO(fxbug.dev/124700): Instead of storing raw handles we should
+ // consider using RAII zx::object instead.
+ VmoStore::Info info = {
+ vmo.release(),
+ *phys_addr,
+ };
+
+ getVmoStore()->add(*offset, info);
+ return true;
+}
+
+bool goldfish_address_space_free(
+ address_space_handle_t handle, uint64_t offset) {
+ auto info = getVmoStore()->get(offset);
+ if (info.vmo == ZX_HANDLE_INVALID) return false;
+ zx_handle_close(info.vmo);
+
+ const auto& deviceSync =
+ *reinterpret_cast<
+ fidl::WireSyncClient<AddressSpaceChildDriver>*>(handle);
+
+ auto result = deviceSync->DeallocateBlock(info.phys_addr);
+ if (!result.ok() || result->res != ZX_OK) {
+ ALOGE("%s: deallocate block failed: %d:%d", __func__, result.status(), GET_STATUS_SAFE(result, res));
+ return false;
+ }
+
+ return true;
+}
+
+bool goldfish_address_space_claim_shared(
+ address_space_handle_t handle, uint64_t offset, uint64_t size) {
+
+ const auto& deviceSync =
+ *reinterpret_cast<
+ fidl::WireSyncClient<AddressSpaceChildDriver>*>(handle);
+
+ zx::vmo vmo;
+ auto result = deviceSync->ClaimSharedBlock(offset, size);
+ if (!result.ok() || result->res != ZX_OK) {
+ ALOGE("%s: claim shared failed: %d:%d", __func__, result.status(), GET_STATUS_SAFE(result, res));
+ return false;
+ }
+ vmo = std::move(result->vmo);
+
+ // TODO(fxbug.dev/124700): Instead of storing raw handles we should
+ // consider using RAII zx::object instead.
+ VmoStore::Info info = {
+ vmo.release(),
+ };
+
+ getVmoStore()->add(offset, info);
+
+ return true;
+}
+
+bool goldfish_address_space_unclaim_shared(
+ address_space_handle_t handle, uint64_t offset) {
+ auto info = getVmoStore()->get(offset);
+ if (info.vmo == ZX_HANDLE_INVALID) {
+ return false;
+ }
+ zx_handle_close(info.vmo);
+
+ const auto& deviceSync =
+ *reinterpret_cast<
+ fidl::WireSyncClient<AddressSpaceChildDriver>*>(handle);
+
+ auto result = deviceSync->UnclaimSharedBlock(offset);
+ if (!result.ok() || result->res != ZX_OK) {
+ ALOGE("%s: unclaim shared failed: %d:%d", __func__, result.status(), GET_STATUS_SAFE(result, res));
+ return false;
+ }
+
+ getVmoStore()->remove(offset);
+ return true;
+}
+
+// pgoff is the offset into the page to return in the result
+void* goldfish_address_space_map(
+ address_space_handle_t handle,
+ uint64_t offset, uint64_t size,
+ uint64_t pgoff) {
+
+ auto info = getVmoStore()->get(offset);
+ if (info.vmo == ZX_HANDLE_INVALID) return nullptr;
+
+ zx_vaddr_t ptr = 0;
+ zx_status_t status =
+ zx_vmar_map(zx_vmar_root_self(),
+ ZX_VM_PERM_READ | ZX_VM_PERM_WRITE,
+ 0, info.vmo,
+ 0, size,
+ &ptr);
+ return (void*)(((char*)ptr) + (uintptr_t)(pgoff & (PAGE_SIZE - 1)));
+}
+
+void goldfish_address_space_unmap(void* ptr, uint64_t size) {
+ zx_vmar_unmap(zx_vmar_root_self(),
+ (zx_vaddr_t)(((uintptr_t)ptr) & (uintptr_t)(~(PAGE_SIZE - 1))),
+ size);
+}
+
+bool goldfish_address_space_ping(
+ address_space_handle_t handle,
+ struct address_space_ping* ping) {
+
+ AddressSpaceChildDriverPingMessage fuchsiaPing =
+ *(AddressSpaceChildDriverPingMessage*)ping;
+
+ const auto& deviceSync =
+ *reinterpret_cast<
+ fidl::WireSyncClient<AddressSpaceChildDriver>*>(handle);
+
+ AddressSpaceChildDriverPingMessage res;
+ auto result = deviceSync->Ping(fuchsiaPing);
+ if (!result.ok() || result->res != ZX_OK) {
+ return false;
+ }
+ res = std::move(result->ping);
+
+ *ping = *(struct address_space_ping*)(&res);
+ return true;
+}
diff --git a/src/gfxstream/guest/GoldfishAddressSpace/meson.build b/src/gfxstream/guest/GoldfishAddressSpace/meson.build
new file mode 100644
index 00000000000..65ac5428922
--- /dev/null
+++ b/src/gfxstream/guest/GoldfishAddressSpace/meson.build
@@ -0,0 +1,26 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_goldfish_address_space = include_directories('include')
+
+files_lib_goldfish_address_space = files(
+ 'AddressSpaceStream.cpp',
+ 'GoldfishAddressSpaceStream.cpp',
+ 'VirtioGpuAddressSpaceStream.cpp',
+ 'goldfish_address_space.cpp',
+)
+
+lib_goldfish_address_space = static_library(
+ 'goldfish_address_space',
+ files_lib_goldfish_address_space,
+ cpp_args: gfxstream_guest_args,
+ include_directories: [inc_android_compat,
+ inc_android_emu,
+ inc_goldfish_address_space,
+ inc_guest_iostream,
+ inc_system,
+ inc_opengl_codec,
+ inc_platform],
+ link_with: [lib_platform],
+ dependencies: drm_dep
+)
diff --git a/src/gfxstream/guest/OpenglCodecCommon/ChecksumCalculator.cpp b/src/gfxstream/guest/OpenglCodecCommon/ChecksumCalculator.cpp
new file mode 100644
index 00000000000..370f0e6fd4c
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/ChecksumCalculator.cpp
@@ -0,0 +1,161 @@
+/*
+* 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 "gfxstream/guest/ChecksumCalculator.h"
+
+#include <string.h>
+
+namespace gfxstream {
+namespace guest {
+
+// Checklist when implementing new protocol:
+// 1. update CHECKSUMHELPER_MAX_VERSION
+// 2. update ChecksumCalculator::Sizes enum
+// 3. update checksumByteSize()
+// 4. update addBuffer, writeChecksum, resetChecksum, validate
+
+// change CHECKSUMHELPER_MAX_VERSION when you want to update the protocol version
+#define CHECKSUMHELPER_MAX_VERSION 1
+
+// utility macros to create checksum string at compilation time
+#define CHECKSUMHELPER_VERSION_STR_PREFIX "ANDROID_EMU_CHECKSUM_HELPER_v"
+#define CHECKSUMHELPER_MACRO_TO_STR(x) #x
+#define CHECKSUMHELPER_MACRO_VAL_TO_STR(x) CHECKSUMHELPER_MACRO_TO_STR(x)
+
+static const uint32_t kMaxVersion = CHECKSUMHELPER_MAX_VERSION;
+static const char* kMaxVersionStrPrefix = CHECKSUMHELPER_VERSION_STR_PREFIX;
+static const char* kMaxVersionStr = CHECKSUMHELPER_VERSION_STR_PREFIX CHECKSUMHELPER_MACRO_VAL_TO_STR(CHECKSUMHELPER_MAX_VERSION);
+
+#undef CHECKSUMHELPER_MAX_VERSION
+#undef CHECKSUMHELPER_VERSION_STR_PREFIX
+#undef CHECKSUMHELPER_MACRO_TO_STR
+#undef CHECKSUMHELPER_MACRO_VAL_TO_STR
+
+uint32_t ChecksumCalculator::getMaxVersion() {return kMaxVersion;}
+const char* ChecksumCalculator::getMaxVersionStr() {return kMaxVersionStr;}
+const char* ChecksumCalculator::getMaxVersionStrPrefix() {return kMaxVersionStrPrefix;}
+
+bool ChecksumCalculator::setVersion(uint32_t version) {
+ if (version > kMaxVersion) { // unsupported version
+ LOG_CHECKSUMHELPER("%s: ChecksumCalculator Set Unsupported version Version %d\n",
+ __FUNCTION__, m_version);
+ return false;
+ }
+ if (m_isEncodingChecksum) { // setVersion is called in the middle of encoding checksums
+ LOG_CHECKSUMHELPER("%s: called between addBuffer and writeChecksum\n",
+ __FUNCTION__);
+ return false;
+ }
+ m_version = version;
+ LOG_CHECKSUMHELPER("%s: ChecksumCalculator Set Version %d\n", __FUNCTION__,
+ m_version);
+ return true;
+}
+
+size_t ChecksumCalculator::checksumByteSize() const {
+ switch (m_version) {
+ case 0:
+ return 0;
+ case 1:
+ return sizeof(uint32_t) + sizeof(m_numWrite);
+ default:
+ return 0;
+ }
+}
+
+ChecksumCalculator::ChecksumCalculator()
+ : m_version(0)
+ , m_numRead(0)
+ , m_numWrite(0)
+ , m_isEncodingChecksum(false)
+ , m_v1BufferTotalLength(0)
+{
+}
+
+void ChecksumCalculator::addBuffer(const void*, size_t packetLen) {
+ m_isEncodingChecksum = true;
+ switch (m_version) {
+ case 1:
+ m_v1BufferTotalLength += packetLen;
+ break;
+ }
+}
+
+bool ChecksumCalculator::writeChecksum(void* outputChecksum, size_t outputChecksumLen) {
+ if (outputChecksumLen < checksumByteSize()) return false;
+ char *checksumPtr = (char *)outputChecksum;
+ switch (m_version) {
+ case 1: { // protocol v1 is to reverse the packetLen and write it at the end
+ uint32_t val = computeV1Checksum();
+ memcpy(checksumPtr, &val, sizeof(val));
+ memcpy(checksumPtr+sizeof(val), &m_numWrite, sizeof(m_numWrite));
+ break;
+ }
+ }
+ resetChecksum();
+ m_numWrite++;
+ return true;
+}
+
+void ChecksumCalculator::resetChecksum() {
+ switch (m_version) {
+ case 1:
+ m_v1BufferTotalLength = 0;
+ break;
+ }
+ m_isEncodingChecksum = false;
+}
+
+bool ChecksumCalculator::validate(const void* expectedChecksum, size_t expectedChecksumLen) {
+ size_t checksumSize = checksumByteSize();
+ if (expectedChecksumLen != checksumSize) {
+ m_numRead++;
+ resetChecksum();
+ return false;
+ }
+ bool isValid;
+ switch (m_version) {
+ case 1: {
+ const uint32_t val = computeV1Checksum();
+ isValid = 0 == memcmp(&val, expectedChecksum, sizeof(val)) &&
+ 0 == memcmp(&m_numRead,
+ static_cast<const char*>(expectedChecksum) +
+ sizeof(val),
+ sizeof(m_numRead));
+
+ break;
+ }
+ default:
+ isValid = true; // No checksum is a valid checksum.
+ break;
+ }
+ m_numRead++;
+ resetChecksum();
+ return isValid;
+}
+
+uint32_t ChecksumCalculator::computeV1Checksum() {
+ uint32_t revLen = m_v1BufferTotalLength;
+ revLen = (revLen & 0xffff0000) >> 16 | (revLen & 0x0000ffff) << 16;
+ revLen = (revLen & 0xff00ff00) >> 8 | (revLen & 0x00ff00ff) << 8;
+ revLen = (revLen & 0xf0f0f0f0) >> 4 | (revLen & 0x0f0f0f0f) << 4;
+ revLen = (revLen & 0xcccccccc) >> 2 | (revLen & 0x33333333) << 2;
+ revLen = (revLen & 0xaaaaaaaa) >> 1 | (revLen & 0x55555555) << 1;
+ return revLen;
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglCodecCommon/EncoderDebug.cpp b/src/gfxstream/guest/OpenglCodecCommon/EncoderDebug.cpp
new file mode 100644
index 00000000000..efda95897d0
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/EncoderDebug.cpp
@@ -0,0 +1,72 @@
+/*
+ * 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 "EncoderDebug.h"
+
+#include <string>
+#include <fstream>
+#include <streambuf>
+
+#include <android/log.h>
+
+namespace {
+
+bool encoderShouldLog() {
+#if defined(ENABLE_ENCODER_DEBUG_LOGGING_FOR_ALL_APPS)
+ return true;
+#elif defined(ENABLE_ENCODER_DEBUG_LOGGING_FOR_APP)
+ static const bool sEnabled = []() {
+ std::ifstream cmdlineStream("/proc/self/cmdline");
+ const std::string cmdline((std::istreambuf_iterator<char>(cmdlineStream)),
+ std::istreambuf_iterator<char>());
+
+ if (cmdline.find(ENABLE_ENCODER_DEBUG_LOGGING_FOR_APP) != std::string::npos) {
+ const std::string message = "Enabling gfxstream encoder logging for " + cmdline;
+ __android_log_write(ANDROID_LOG_DEBUG, "gfxstream", message.c_str());
+ return true;
+ } else {
+ const std::string message = "Not enabling gfxstream encoder logging for " + cmdline;
+ __android_log_write(ANDROID_LOG_DEBUG, "gfxstream", message.c_str());
+ return false;
+ }
+ }();
+ return sEnabled;
+#else
+ return false;
+#endif
+}
+
+} // namespace
+
+void encoderLog(const char* format, ...) {
+#if defined(ENABLE_ENCODER_DEBUG_LOGGING_FOR_ALL_APPS) || \
+ defined(ENABLE_ENCODER_DEBUG_LOGGING_FOR_APP)
+ if (!encoderShouldLog()) {
+ return;
+ }
+
+ char buffer[2048];
+
+ va_list args;
+ va_start(args, format);
+ vsnprintf(buffer, 2048, format, args);
+ va_end(args);
+
+ __android_log_write(ANDROID_LOG_DEBUG, "gfxstream", buffer);
+#else
+ (void)format;
+#endif
+} \ No newline at end of file
diff --git a/src/gfxstream/guest/OpenglCodecCommon/EncoderDebug.h b/src/gfxstream/guest/OpenglCodecCommon/EncoderDebug.h
new file mode 100644
index 00000000000..48813817208
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/EncoderDebug.h
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+void encoderLog(const char* format, ...);
+
+// Uncomment to log function calls with arguments:
+// #define ENABLE_ENCODER_DEBUG_LOGGING_FOR_ALL_APPS 1
+// #define ENABLE_ENCODER_DEBUG_LOGGING_FOR_APP "com.android.systemui"
+
+#if defined(ENABLE_ENCODER_DEBUG_LOGGING_FOR_ALL_APPS) || \
+ defined(ENABLE_ENCODER_DEBUG_LOGGING_FOR_APP)
+#define ENCODER_DEBUG_LOG(...) encoderLog(__VA_ARGS__)
+#else
+#define ENCODER_DEBUG_LOG(...) ((void)0)
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/ErrorLog.h b/src/gfxstream/guest/OpenglCodecCommon/ErrorLog.h
new file mode 100644
index 00000000000..7f693b7c4dc
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/ErrorLog.h
@@ -0,0 +1,37 @@
+/*
+* 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 _ERROR_LOG_H_
+#define _ERROR_LOG_H_
+
+#if defined(__ANDROID__)
+# include <log/log.h>
+# define ERR(...) ALOGE(__VA_ARGS__)
+# ifdef EMUGL_DEBUG
+# define DBG(...) ALOGD(__VA_ARGS__)
+# else
+# define DBG(...) ((void)0)
+# endif
+#else
+# include <stdio.h>
+# define ERR(...) fprintf(stderr, __VA_ARGS__)
+# ifdef EMUGL_DEBUG
+# define DBG(...) fprintf(stderr, __VA_ARGS__)
+# else
+# define DBG(...) ((void)0)
+# endif
+#endif
+
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/GLClientState.cpp b/src/gfxstream/guest/OpenglCodecCommon/GLClientState.cpp
new file mode 100644
index 00000000000..33b1562eb69
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/GLClientState.cpp
@@ -0,0 +1,3075 @@
+/*
+* 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 "gfxstream/guest/GLClientState.h"
+
+#include "GLESTextureUtils.h"
+#include "ErrorLog.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "glUtils.h"
+
+#include <cutils/log.h>
+
+#ifndef MAX
+#define MAX(a, b) ((a) < (b) ? (b) : (a))
+#endif
+
+// Don't include these in the .h file, or we get weird compile errors.
+#include <GLES2/gl2ext.h>
+#include <GLES3/gl3.h>
+#include <GLES3/gl31.h>
+
+using gfxstream::guest::AutoReadLock;
+using gfxstream::guest::AutoWriteLock;
+
+namespace gfxstream {
+namespace guest {
+
+void GLClientState::init() {
+ m_initialized = false;
+
+ state_GL_STENCIL_TEST = false;
+ state_GL_STENCIL_FUNC = GL_ALWAYS;
+ state_GL_STENCIL_VALUE_MASK = ~(0);
+ state_GL_STENCIL_REF = 0;
+ state_GL_STENCIL_FAIL = GL_KEEP;
+ state_GL_STENCIL_PASS_DEPTH_FAIL = GL_KEEP;
+ state_GL_STENCIL_PASS_DEPTH_PASS = GL_KEEP;
+ state_GL_STENCIL_BACK_FUNC = GL_ALWAYS;
+ state_GL_STENCIL_BACK_VALUE_MASK = ~(0);
+ state_GL_STENCIL_BACK_REF = 0;
+ state_GL_STENCIL_BACK_FAIL = GL_KEEP;
+ state_GL_STENCIL_BACK_PASS_DEPTH_FAIL = GL_KEEP;
+ state_GL_STENCIL_BACK_PASS_DEPTH_PASS = GL_KEEP;
+ state_GL_STENCIL_WRITEMASK = ~(0);
+ state_GL_STENCIL_BACK_WRITEMASK = ~(0);
+ state_GL_STENCIL_CLEAR_VALUE = 0;
+
+
+ m_arrayBuffer = 0;
+ m_arrayBuffer_lastEncode = 0;
+
+ m_attribEnableCache = 0;
+ m_vaoAttribBindingCacheInvalid = 0xffff;
+ m_vaoAttribBindingHasClientArrayCache = 0;
+ m_vaoAttribBindingHasVboCache = 0;
+ m_noClientArraysCache = 0;
+
+ addVertexArrayObject(0);
+ setVertexArrayObject(0);
+ // init gl constans;
+ m_currVaoState[VERTEX_LOCATION].glConst = GL_VERTEX_ARRAY;
+ m_currVaoState[NORMAL_LOCATION].glConst = GL_NORMAL_ARRAY;
+ m_currVaoState[COLOR_LOCATION].glConst = GL_COLOR_ARRAY;
+ m_currVaoState[POINTSIZE_LOCATION].glConst = GL_POINT_SIZE_ARRAY_OES;
+ m_currVaoState[TEXCOORD0_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
+ m_currVaoState[TEXCOORD1_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
+ m_currVaoState[TEXCOORD2_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
+ m_currVaoState[TEXCOORD3_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
+ m_currVaoState[TEXCOORD4_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
+ m_currVaoState[TEXCOORD5_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
+ m_currVaoState[TEXCOORD6_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
+ m_currVaoState[TEXCOORD7_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
+ m_currVaoState[MATRIXINDEX_LOCATION].glConst = GL_MATRIX_INDEX_ARRAY_OES;
+ m_currVaoState[WEIGHT_LOCATION].glConst = GL_WEIGHT_ARRAY_OES;
+
+ m_copyReadBuffer = 0;
+ m_copyWriteBuffer = 0;
+ m_pixelPackBuffer = 0;
+ m_pixelUnpackBuffer = 0;
+ m_transformFeedbackBuffer = 0;
+ m_uniformBuffer = 0;
+ m_atomicCounterBuffer = 0;
+ m_dispatchIndirectBuffer = 0;
+ m_drawIndirectBuffer = 0;
+ m_shaderStorageBuffer = 0;
+ m_textureBuffer = 0;
+
+ m_transformFeedbackActive = false;
+ m_transformFeedbackUnpaused = false;
+ m_transformFeedbackVaryingsCountForLinking = 0;
+
+ m_activeTexture = 0;
+ m_currentProgram = 0;
+ m_currentShaderProgram = 0;
+
+ m_pixelStore.unpack_alignment = 4;
+ m_pixelStore.pack_alignment = 4;
+
+ m_pixelStore.unpack_row_length = 0;
+ m_pixelStore.unpack_image_height = 0;
+ m_pixelStore.unpack_skip_pixels = 0;
+ m_pixelStore.unpack_skip_rows = 0;
+ m_pixelStore.unpack_skip_images = 0;
+
+ m_pixelStore.pack_row_length = 0;
+ m_pixelStore.pack_skip_pixels = 0;
+ m_pixelStore.pack_skip_rows = 0;
+
+ memset(m_tex.unit, 0, sizeof(m_tex.unit));
+ m_tex.activeUnit = &m_tex.unit[0];
+ m_tex.textureRecs = NULL;
+
+ mRboState.boundRenderbuffer = nullptr;
+
+ mFboState.boundDrawFramebuffer = 0;
+ mFboState.boundReadFramebuffer = 0;
+ mFboState.drawFboCheckStatus = GL_NONE;
+ mFboState.readFboCheckStatus = GL_NONE;
+
+ m_extensions_set = false;
+
+ // The default transform feedback buffer object
+ // The default sampler object
+ GLuint defaultId = 0;
+ setExistence(ObjectType::TransformFeedback, true, 1, &defaultId);
+
+ mBoundTransformFeedbackValidity.id = 0;
+ mBoundTransformFeedbackValidity.valid = true;
+
+ // query must take id that was created via glGenQueries
+ mBoundQueryValidity_AnySamplesPassed.valid = false;
+ mBoundQueryValidity_AnySamplesPassedConservative.valid = false;
+ mBoundQueryValidity_TransformFeedbackPrimitivesWritten.valid = false;
+}
+
+GLClientState::GLClientState()
+{
+ init();
+}
+
+GLClientState::GLClientState(int majorVersion, int minorVersion) :
+ m_glesMajorVersion(majorVersion),
+ m_glesMinorVersion(minorVersion) {
+ init();
+}
+
+GLClientState::~GLClientState()
+{
+}
+
+void GLClientState::enable(int location, int state)
+{
+ m_currVaoState[location].enableDirty |= (state != m_currVaoState[location].enabled);
+ m_currVaoState[location].enabled = state;
+ if (state) {
+ m_attribEnableCache |= (1 << location);
+ m_noClientArraysCache = 0;
+ } else {
+ m_attribEnableCache &= ~(1 << location);
+ }
+}
+
+void GLClientState::setVertexAttribState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, const void *data, bool isInt)
+{
+ m_currVaoState[location].size = size;
+ m_currVaoState[location].type = type;
+ m_currVaoState[location].stride = stride;
+ m_currVaoState[location].data = (void*)data;
+ m_currVaoState[location].bufferObject = m_arrayBuffer;
+ m_currVaoState[location].elementSize = size ? (glSizeof(type) * size) : 0;
+ switch (type) {
+ case GL_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ m_currVaoState[location].elementSize =
+ m_currVaoState[location].elementSize / 4;
+ break;
+ default:
+ break;
+ }
+ m_currVaoState[location].normalized = normalized;
+ m_currVaoState[location].isInt = isInt;
+}
+
+void GLClientState::setVertexBindingDivisor(int bindingindex, GLuint divisor) {
+ m_currVaoState.bufferBinding(bindingindex).divisor = divisor;
+}
+
+const GLClientState::BufferBinding& GLClientState::getCurrAttributeBindingInfo(int attribindex) {
+ return m_currVaoState.bufferBindings_const()[m_currVaoState[attribindex].bindingindex];
+}
+
+void GLClientState::setVertexAttribBinding(int attribindex, int bindingindex) {
+ m_currVaoState[attribindex].bindingindex = bindingindex;
+ m_currVaoState.bufferBinding(bindingindex).vertexAttribLoc = attribindex;
+ m_vaoAttribBindingCacheInvalid |= (1 << attribindex);
+ m_noClientArraysCache = 0;
+}
+
+void GLClientState::setVertexAttribFormat(int location, int size, GLenum type, GLboolean normalized, GLuint reloffset, bool isInt) {
+ m_currVaoState[location].size = size;
+ m_currVaoState[location].type = type;
+ m_currVaoState[location].normalized = normalized;
+ m_currVaoState[location].reloffset = reloffset;
+ m_currVaoState[location].elementSize = size ? (glSizeof(type) * size) : 0;
+ switch (type) {
+ case GL_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ m_currVaoState[location].elementSize =
+ m_currVaoState[location].elementSize / 4;
+ break;
+ default:
+ break;
+ }
+ m_currVaoState[location].isInt = isInt;
+}
+
+void GLClientState::addVertexArrayObjects(GLsizei n, GLuint* arrays) {
+ for (GLsizei i = 0; i < n; i++) {
+ addVertexArrayObject(arrays[i]);
+ }
+}
+
+void GLClientState::removeVertexArrayObjects(GLsizei n, const GLuint* arrays) {
+ for (GLsizei i = 0; i < n; i++) {
+ if (arrays[i] && m_currVaoState.vaoId() == arrays[i]) {
+ setVertexArrayObject(0);
+ }
+ removeVertexArrayObject(arrays[i]);
+ }
+}
+
+void GLClientState::addVertexArrayObject(GLuint name) {
+ if (m_vaoMap.find(name) !=
+ m_vaoMap.end()) {
+ ALOGE("%s: ERROR: %u already part of current VAO state!",
+ __FUNCTION__, name);
+ return;
+ }
+
+ m_vaoMap.insert(
+ VAOStateMap::value_type(
+ name,
+ VAOState(0, CODEC_MAX_VERTEX_ATTRIBUTES, CODEC_MAX_VERTEX_ATTRIBUTES)));
+ VertexAttribStateVector& attribState =
+ m_vaoMap.find(name)->second.attribState;
+ for (int i = 0; i < CODEC_MAX_VERTEX_ATTRIBUTES; i++) {
+ attribState[i].enabled = 0;
+ attribState[i].enableDirty = false;
+ attribState[i].data = 0;
+ attribState[i].reloffset = 0;
+ attribState[i].bindingindex = i;
+ attribState[i].divisor = 0;
+ attribState[i].size = 4; // 4 is the default size
+ attribState[i].type = GL_FLOAT; // GL_FLOAT is the default type
+ }
+
+ VertexAttribBindingVector& bindingState =
+ m_vaoMap.find(name)->second.bindingState;
+ for (int i = 0; i < bindingState.size(); i++) {
+ bindingState[i].effectiveStride = 16;
+ }
+}
+
+void GLClientState::removeVertexArrayObject(GLuint name) {
+ if (name == 0) {
+ ALOGE("%s: ERROR: cannot delete VAO 0!",
+ __FUNCTION__);
+ return;
+ }
+ if (m_vaoMap.find(name) ==
+ m_vaoMap.end()) {
+ ALOGE("%s: ERROR: %u not found in VAO state!",
+ __FUNCTION__, name);
+ return;
+ }
+ m_vaoMap.erase(name);
+}
+
+void GLClientState::setVertexArrayObject(GLuint name) {
+ if (m_vaoMap.find(name) ==
+ m_vaoMap.end()) {
+ ALOGE("%s: ERROR: %u not found in VAO state!",
+ __FUNCTION__, name);
+ return;
+ }
+
+ if (name && m_currVaoState.vaoId() == name) {
+ ALOGV("%s: set vao to self, no-op (%u)",
+ __FUNCTION__, name);
+ return;
+ }
+
+ m_currVaoState =
+ VAOStateRef(m_vaoMap.find(name));
+}
+
+bool GLClientState::isVertexArrayObject(GLuint vao) const {
+ return m_vaoMap.find(vao) != m_vaoMap.end();
+}
+
+void GLClientState::getVBOUsage(bool* hasClientArrays, bool* hasVBOs) {
+ uint8_t todo_count = 0;
+ uint8_t todo[CODEC_MAX_VERTEX_ATTRIBUTES];
+
+ if (m_noClientArraysCache) {
+ *hasClientArrays = false;
+ *hasVBOs = true;
+ return;
+ }
+
+ for (int i = 0; i < CODEC_MAX_VERTEX_ATTRIBUTES; i++) {
+ if ((1 << i) & (m_attribEnableCache)) {
+ if (!((1 << i) & m_vaoAttribBindingCacheInvalid)) {
+ if ((1 << i) & m_vaoAttribBindingHasClientArrayCache) {
+ *hasClientArrays = true;
+ }
+ if ((1 << i) & m_vaoAttribBindingHasVboCache) {
+ *hasVBOs = true;
+ }
+ if (*hasClientArrays && *hasVBOs) return;
+ } else {
+ todo[todo_count] = i;
+ ++todo_count;
+ }
+ }
+ }
+
+ if (todo_count == 0 &&
+ !(*hasClientArrays) &&
+ *hasVBOs) {
+ m_noClientArraysCache = 1;
+ }
+
+ for (int k = 0; k < todo_count; ++k) {
+ int i = todo[k];
+ const GLClientState::BufferBinding& curr_binding =
+ m_currVaoState.bufferBindings_const()[
+ m_currVaoState[i].bindingindex];
+ GLuint bufferObject = curr_binding.buffer;
+ if (bufferObject == 0 && curr_binding.offset && hasClientArrays) {
+ *hasClientArrays = true;
+ m_vaoAttribBindingHasClientArrayCache |= (1 << i);
+ } else {
+ m_vaoAttribBindingHasClientArrayCache &= ~(1 << i);
+ }
+ if (bufferObject != 0 && hasVBOs) {
+ *hasVBOs = true;
+ m_vaoAttribBindingHasVboCache |= (1 << i);
+ } else {
+ m_vaoAttribBindingHasVboCache &= ~(1 << i);
+ }
+ m_vaoAttribBindingCacheInvalid &= ~(1 << i);
+ if (*hasClientArrays && *hasVBOs) return;
+ }
+
+ if (!(*hasClientArrays) &&
+ *hasVBOs) {
+ m_noClientArraysCache = 1;
+ }
+}
+
+const GLClientState::VertexAttribState& GLClientState::getState(int location) {
+ return m_currVaoState[location];
+}
+
+const GLClientState::VertexAttribState& GLClientState::getStateAndEnableDirty(int location, bool *enableChanged)
+{
+ if (enableChanged) {
+ *enableChanged = m_currVaoState[location].enableDirty;
+ }
+
+ m_currVaoState[location].enableDirty = false;
+ return m_currVaoState[location];
+}
+
+void GLClientState::updateEnableDirtyArrayForDraw() {
+ bool enableChanged;
+ VAOState& vaoState = m_currVaoState.vaoState();
+
+ int k = 0;
+ for (int i = 0; i < CODEC_MAX_VERTEX_ATTRIBUTES; ++i) {
+ const VertexAttribState &state = getStateAndEnableDirty(i, &enableChanged);
+ if (enableChanged || state.enabled) {
+ vaoState.attributesNeedingUpdateForDraw[k] = i;
+ ++k;
+ }
+ }
+ vaoState.numAttributesNeedingUpdateForDraw = k;
+}
+
+GLClientState::VAOState& GLClientState::currentVaoState() {
+ return m_currVaoState.vaoState();
+}
+
+int GLClientState::getLocation(GLenum loc)
+{
+ int retval;
+
+ switch(loc) {
+ case GL_VERTEX_ARRAY:
+ retval = int(VERTEX_LOCATION);
+ break;
+ case GL_NORMAL_ARRAY:
+ retval = int(NORMAL_LOCATION);
+ break;
+ case GL_COLOR_ARRAY:
+ retval = int(COLOR_LOCATION);
+ break;
+ case GL_POINT_SIZE_ARRAY_OES:
+ retval = int(POINTSIZE_LOCATION);
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ retval = int (TEXCOORD0_LOCATION + m_activeTexture);
+ break;
+ case GL_MATRIX_INDEX_ARRAY_OES:
+ retval = int (MATRIXINDEX_LOCATION);
+ break;
+ case GL_WEIGHT_ARRAY_OES:
+ retval = int (WEIGHT_LOCATION);
+ break;
+ default:
+ retval = loc;
+ }
+ return retval;
+}
+
+static void sClearIndexedBufferBinding(GLuint id, std::vector<GLClientState::BufferBinding>& bindings) {
+ for (size_t i = 0; i < bindings.size(); i++) {
+ if (bindings[i].buffer == id) {
+ bindings[i].offset = 0;
+ bindings[i].stride = 0;
+ bindings[i].effectiveStride = 16;
+ bindings[i].size = 0;
+ bindings[i].buffer = 0;
+ }
+ }
+}
+
+void GLClientState::addBuffer(GLuint id) {
+ mBufferIds.add(id);
+ mBufferIds.set(id, true);
+ mHostMappedBufferDirty.add(id);
+}
+
+void GLClientState::removeBuffer(GLuint id) {
+ mHostMappedBufferDirty.remove(id);
+ mBufferIds.remove(id);
+}
+
+bool GLClientState::bufferIdExists(GLuint id) const {
+ return mBufferIds.get(id);
+}
+
+void GLClientState::setBufferHostMapDirty(GLuint id, bool dirty) {
+ mHostMappedBufferDirty.set(id, dirty);
+}
+
+bool GLClientState::isBufferHostMapDirty(GLuint id) const {
+ return mHostMappedBufferDirty.get(id);
+}
+
+void GLClientState::setExistence(ObjectType type, bool exists, GLsizei count, const GLuint* ids) {
+ if (type == ObjectType::Sampler) {
+ SamplerInfo::ScopedView view(mSamplerInfo);
+ if (exists) {
+ for (GLsizei i = 0; i < count; ++i) {
+ view.addFresh(ids[i]);
+ }
+ } else {
+ for (GLsizei i = 0; i < count; ++i) {
+ view.unref(ids[i]);
+ }
+ }
+ } else {
+ ExistenceMap* existenceMap = &mBufferIds;
+
+ switch (type) {
+ case ObjectType::Buffer:
+ existenceMap = &mBufferIds;
+ break;
+ case ObjectType::TransformFeedback:
+ existenceMap = &mTransformFeedbackIds;
+ break;
+ case ObjectType::Query:
+ existenceMap = &mQueryIds;
+ for (GLsizei i = 0; i < count; ++i) {
+ // reset the last query target
+ mLastQueryTargets.add(ids[i], 0);
+ }
+ break;
+ case ObjectType::Sampler:
+ default:
+ ALOGE("%s: Unreachable code\n", __func__);
+ abort();
+ }
+
+ if (exists) {
+ for (GLsizei i = 0; i < count; ++i) {
+ existenceMap->add(ids[i]);
+ existenceMap->set(ids[i], true);
+ }
+ } else {
+ for (GLsizei i = 0; i < count; ++i) {
+ existenceMap->remove(ids[i]);
+ }
+ }
+ }
+}
+
+bool GLClientState::queryExistence(ObjectType type, GLuint id) const {
+ switch (type) {
+ case ObjectType::Buffer:
+ return mBufferIds.get(id);
+ case ObjectType::TransformFeedback:
+ return mTransformFeedbackIds.get(id);
+ case ObjectType::Sampler:
+ return samplerExists(id);
+ case ObjectType::Query:
+ return mQueryIds.get(id);
+ default:
+ ALOGD("%s: unknown object type: 0x%x\n", __func__, type);
+ abort();
+ }
+}
+
+bool GLClientState::samplerExists(GLuint id) const {
+ if (!id) return true;
+ SamplerInfo::ScopedView view(mSamplerInfo);
+ return view.samplerExists(id);
+}
+
+bool GLClientState::tryBind(GLenum target, GLuint id) {
+ if (0 == id) { // unbind operation
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK:
+ mBoundTransformFeedbackValidity.id = 0;
+ mBoundTransformFeedbackValidity.valid = true;
+ break;
+ case GL_ANY_SAMPLES_PASSED:
+ mBoundQueryValidity_AnySamplesPassed.id = 0;
+ mBoundQueryValidity_AnySamplesPassed.valid = false;
+ break;
+ case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+ mBoundQueryValidity_AnySamplesPassedConservative.id = 0;
+ mBoundQueryValidity_AnySamplesPassedConservative.valid = false;
+ break;
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ mBoundQueryValidity_TransformFeedbackPrimitivesWritten.id = 0;
+ mBoundQueryValidity_TransformFeedbackPrimitivesWritten.valid = false;
+ break;
+ default:
+ ALOGE("%s: target 0x%x not yet supported in new state tracking model\n", __func__, target);
+ abort();
+ }
+ return true;
+ }
+
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK:
+ if (!queryExistence(ObjectType::TransformFeedback, id)) return false;
+ break;
+ case GL_ANY_SAMPLES_PASSED:
+ case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ if (!queryExistence(ObjectType::Query, id)) {
+ return false;
+ }
+ break;
+ default:
+ ALOGE("%s: target 0x%x not yet supported in new state tracking model\n", __func__, target);
+ abort();
+ }
+
+ // valid bind
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK:
+ mBoundTransformFeedbackValidity.id = id;
+ mBoundTransformFeedbackValidity.valid = true;
+ break;
+ case GL_ANY_SAMPLES_PASSED:
+ mBoundQueryValidity_AnySamplesPassed.id = id;
+ mBoundQueryValidity_AnySamplesPassed.valid = true;
+ break;
+ case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+ mBoundQueryValidity_AnySamplesPassedConservative.id = id;
+ mBoundQueryValidity_AnySamplesPassedConservative.valid = true;
+ break;
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ mBoundQueryValidity_TransformFeedbackPrimitivesWritten.id = id;
+ mBoundQueryValidity_TransformFeedbackPrimitivesWritten.valid = true;
+ break;
+ default:
+ ALOGE("%s: target 0x%x not yet supported in new state tracking model\n", __func__, target);
+ abort();
+ }
+ return true;
+}
+
+bool GLClientState::isBoundTargetValid(GLenum target) {
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK:
+ return mBoundTransformFeedbackValidity.valid;
+ case GL_ANY_SAMPLES_PASSED:
+ return mBoundQueryValidity_AnySamplesPassed.valid;
+ case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+ return mBoundQueryValidity_AnySamplesPassedConservative.valid;
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ return mBoundQueryValidity_TransformFeedbackPrimitivesWritten.valid;
+ default:
+ ALOGE("%s: target 0x%x not yet supported in new state tracking model\n", __func__, target);
+ abort();
+ }
+}
+
+bool GLClientState::isQueryBound(GLenum target) {
+ switch (target) {
+ case GL_ANY_SAMPLES_PASSED:
+ return mBoundQueryValidity_AnySamplesPassed.valid;
+ case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+ return mBoundQueryValidity_AnySamplesPassedConservative.valid;
+ case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+ return mBoundQueryValidity_TransformFeedbackPrimitivesWritten.valid;
+ default:
+ return false;
+ }
+}
+
+bool GLClientState::isQueryObjectActive(GLuint id) {
+ if (mBoundQueryValidity_AnySamplesPassed.valid &&
+ (id == mBoundQueryValidity_AnySamplesPassed.id))
+ return true;
+ if (mBoundQueryValidity_AnySamplesPassedConservative.valid &&
+ (id == mBoundQueryValidity_AnySamplesPassedConservative.id))
+ return true;
+ if (mBoundQueryValidity_TransformFeedbackPrimitivesWritten.valid &&
+ (id == mBoundQueryValidity_TransformFeedbackPrimitivesWritten.id))
+ return true;
+ return false;
+}
+
+void GLClientState::setLastQueryTarget(GLenum target, GLuint id) {
+ mLastQueryTargets.add(id, target);
+}
+
+GLenum GLClientState::getLastQueryTarget(GLuint id) {
+ auto targetPtr = mLastQueryTargets.get_const(id);
+ if (!targetPtr) return 0;
+ return *targetPtr;
+}
+
+void GLClientState::setBoundPixelPackBufferDirtyForHostMap() {
+ if (m_pixelPackBuffer)
+ setBufferHostMapDirty(m_pixelPackBuffer, true /* dirty */);
+}
+
+void GLClientState::setBoundTransformFeedbackBuffersDirtyForHostMap() {
+ if (m_transformFeedbackBuffer)
+ setBufferHostMapDirty(
+ m_transformFeedbackBuffer,
+ true /* dirty */);
+
+ for (size_t i = 0; i < m_indexedTransformFeedbackBuffers.size(); ++i)
+ if (m_indexedTransformFeedbackBuffers[i].buffer)
+ setBufferHostMapDirty(
+ m_indexedTransformFeedbackBuffers[i].buffer,
+ true /* dirty */);
+}
+
+void GLClientState::setBoundShaderStorageBuffersDirtyForHostMap() {
+ if (m_glesMajorVersion == 3 && m_glesMinorVersion == 0) return;
+
+ if (m_shaderStorageBuffer)
+ setBufferHostMapDirty(
+ m_shaderStorageBuffer,
+ true /* dirty */);
+
+ for (size_t i = 0; i < m_indexedShaderStorageBuffers.size(); ++i)
+ if (m_indexedShaderStorageBuffers[i].buffer)
+ setBufferHostMapDirty(
+ m_indexedShaderStorageBuffers[i].buffer,
+ true /* dirty */);
+}
+
+void GLClientState::setBoundAtomicCounterBuffersDirtyForHostMap() {
+ if (m_glesMajorVersion == 3 && m_glesMinorVersion == 0) return;
+
+ if (m_atomicCounterBuffer)
+ setBufferHostMapDirty(
+ m_atomicCounterBuffer,
+ true /* dirty */);
+
+ for (size_t i = 0; i < m_indexedAtomicCounterBuffers.size(); ++i)
+ if (m_indexedAtomicCounterBuffers[i].buffer)
+ setBufferHostMapDirty(
+ m_indexedAtomicCounterBuffers[i].buffer,
+ true /* dirty */);
+}
+
+void GLClientState::unBindBuffer(GLuint id) {
+ if (m_arrayBuffer == id) {
+ m_arrayBuffer = 0;
+ m_arrayBuffer_lastEncode = 0;
+ }
+
+ if (m_currVaoState.iboId() == id) {
+ m_currVaoState.iboId() = 0;
+ m_currVaoState.iboIdLastEncode() = 0;
+ }
+
+ if (m_copyReadBuffer == id)
+ m_copyReadBuffer = 0;
+ if (m_copyWriteBuffer == id)
+ m_copyWriteBuffer = 0;
+ if (m_pixelPackBuffer == id)
+ m_pixelPackBuffer = 0;
+ if (m_pixelUnpackBuffer == id)
+ m_pixelUnpackBuffer = 0;
+ if (m_transformFeedbackBuffer == id)
+ m_transformFeedbackBuffer = 0;
+ if (m_uniformBuffer == id)
+ m_uniformBuffer = 0;
+ if (m_atomicCounterBuffer == id)
+ m_atomicCounterBuffer = 0;
+ if (m_dispatchIndirectBuffer == id)
+ m_dispatchIndirectBuffer = 0;
+ if (m_drawIndirectBuffer == id)
+ m_drawIndirectBuffer = 0;
+ if (m_shaderStorageBuffer == id)
+ m_shaderStorageBuffer = 0;
+ if (m_textureBuffer == id)
+ m_textureBuffer = 0;
+
+ sClearIndexedBufferBinding(id, m_indexedTransformFeedbackBuffers);
+ sClearIndexedBufferBinding(id, m_indexedUniformBuffers);
+ sClearIndexedBufferBinding(id, m_indexedAtomicCounterBuffers);
+ sClearIndexedBufferBinding(id, m_indexedShaderStorageBuffers);
+ sClearIndexedBufferBinding(id, m_currVaoState.bufferBindings());
+ m_vaoAttribBindingCacheInvalid = 0xffff;
+ m_noClientArraysCache = 0;
+}
+
+int GLClientState::bindBuffer(GLenum target, GLuint id)
+{
+ int err = 0;
+ switch(target) {
+ case GL_ARRAY_BUFFER:
+ m_arrayBuffer = id;
+ break;
+ case GL_ELEMENT_ARRAY_BUFFER:
+ m_currVaoState.iboId() = id;
+ break;
+ case GL_COPY_READ_BUFFER:
+ m_copyReadBuffer = id;
+ break;
+ case GL_COPY_WRITE_BUFFER:
+ m_copyWriteBuffer = id;
+ break;
+ case GL_PIXEL_PACK_BUFFER:
+ m_pixelPackBuffer = id;
+ break;
+ case GL_PIXEL_UNPACK_BUFFER:
+ m_pixelUnpackBuffer = id;
+ break;
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
+ m_transformFeedbackBuffer = id;
+ break;
+ case GL_UNIFORM_BUFFER:
+ m_uniformBuffer = id;
+ break;
+ case GL_ATOMIC_COUNTER_BUFFER:
+ m_atomicCounterBuffer = id;
+ break;
+ case GL_DISPATCH_INDIRECT_BUFFER:
+ m_dispatchIndirectBuffer = id;
+ break;
+ case GL_DRAW_INDIRECT_BUFFER:
+ m_drawIndirectBuffer = id;
+ break;
+ case GL_SHADER_STORAGE_BUFFER:
+ m_shaderStorageBuffer = id;
+ break;
+ case GL_TEXTURE_BUFFER_OES:
+ m_textureBuffer = id;
+ break;
+ default:
+ err = -1;
+ }
+ return err;
+}
+
+void GLClientState::bindIndexedBuffer(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size, GLintptr stride, GLintptr effectiveStride) {
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
+ m_indexedTransformFeedbackBuffers[index].buffer = buffer;
+ m_indexedTransformFeedbackBuffers[index].offset = offset;
+ m_indexedTransformFeedbackBuffers[index].size = size;
+ m_indexedTransformFeedbackBuffers[index].stride = stride;
+ break;
+ case GL_UNIFORM_BUFFER:
+ m_indexedUniformBuffers[index].buffer = buffer;
+ m_indexedUniformBuffers[index].offset = offset;
+ m_indexedUniformBuffers[index].size = size;
+ m_indexedUniformBuffers[index].stride = stride;
+ break;
+ case GL_ATOMIC_COUNTER_BUFFER:
+ m_indexedAtomicCounterBuffers[index].buffer = buffer;
+ m_indexedAtomicCounterBuffers[index].offset = offset;
+ m_indexedAtomicCounterBuffers[index].size = size;
+ m_indexedAtomicCounterBuffers[index].stride = stride;
+ break;
+ case GL_SHADER_STORAGE_BUFFER:
+ m_indexedShaderStorageBuffers[index].buffer = buffer;
+ m_indexedShaderStorageBuffers[index].offset = offset;
+ m_indexedShaderStorageBuffers[index].size = size;
+ m_indexedShaderStorageBuffers[index].stride = stride;
+ break;
+ default:
+ m_currVaoState.bufferBinding(index).buffer = buffer;
+ m_currVaoState.bufferBinding(index).offset = offset;
+ m_currVaoState.bufferBinding(index).size = size;
+ m_currVaoState.bufferBinding(index).stride = stride;
+ m_currVaoState.bufferBinding(index).effectiveStride = effectiveStride;
+ m_vaoAttribBindingCacheInvalid |= (1 << m_currVaoState.bufferBinding(index).vertexAttribLoc);
+ return;
+ }
+}
+
+int GLClientState::getMaxIndexedBufferBindings(GLenum target) const {
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
+ return m_indexedTransformFeedbackBuffers.size();
+ case GL_UNIFORM_BUFFER:
+ return m_indexedUniformBuffers.size();
+ case GL_ATOMIC_COUNTER_BUFFER:
+ return m_indexedAtomicCounterBuffers.size();
+ case GL_SHADER_STORAGE_BUFFER:
+ return m_indexedShaderStorageBuffers.size();
+ default:
+ return m_currVaoState.bufferBindings_const().size();
+ }
+}
+
+bool GLClientState::isNonIndexedBindNoOp(GLenum target, GLuint buffer) {
+ if (buffer != getLastEncodedBufferBind(target)) return false;
+
+ int idOrError = getBuffer(target);
+ if (idOrError < 0) {
+ return false;
+ } else {
+ return buffer == (GLuint)idOrError;
+ }
+}
+
+bool GLClientState::isIndexedBindNoOp(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size, GLintptr stride, GLintptr effectiveStride) {
+
+ if (target == GL_TRANSFORM_FEEDBACK_BUFFER) return false;
+
+ if (buffer != getLastEncodedBufferBind(target)) return false;
+
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
+ return m_indexedTransformFeedbackBuffers[index].buffer == buffer &&
+ m_indexedTransformFeedbackBuffers[index].offset == offset &&
+ m_indexedTransformFeedbackBuffers[index].size == size &&
+ m_indexedTransformFeedbackBuffers[index].stride == stride;
+ case GL_UNIFORM_BUFFER:
+ return m_indexedUniformBuffers[index].buffer == buffer &&
+ m_indexedUniformBuffers[index].offset == offset &&
+ m_indexedUniformBuffers[index].size == size &&
+ m_indexedUniformBuffers[index].stride == stride;
+ case GL_ATOMIC_COUNTER_BUFFER:
+ return m_indexedAtomicCounterBuffers[index].buffer == buffer &&
+ m_indexedAtomicCounterBuffers[index].offset == offset &&
+ m_indexedAtomicCounterBuffers[index].size == size &&
+ m_indexedAtomicCounterBuffers[index].stride == stride;
+ case GL_SHADER_STORAGE_BUFFER:
+ return m_indexedShaderStorageBuffers[index].buffer == buffer &&
+ m_indexedShaderStorageBuffers[index].offset == offset &&
+ m_indexedShaderStorageBuffers[index].size == size &&
+ m_indexedShaderStorageBuffers[index].stride == stride;
+ default:
+ return m_currVaoState.bufferBinding(index).buffer == buffer &&
+ m_currVaoState.bufferBinding(index).offset == offset &&
+ m_currVaoState.bufferBinding(index).size == size &&
+ m_currVaoState.bufferBinding(index).stride == stride &&
+ m_currVaoState.bufferBinding(index).effectiveStride == effectiveStride;
+ }
+}
+
+int GLClientState::getMaxTextureSize() const {
+ return m_hostDriverCaps.max_texture_size;
+}
+
+int GLClientState::getMaxTextureSize3D() const {
+ return m_hostDriverCaps.max_texture_size_3d;
+}
+
+int GLClientState::getMaxTextureSizeCubeMap() const {
+ return m_hostDriverCaps.max_texture_size_cube_map;
+}
+
+int GLClientState::getLog2MaxTextureSize() const {
+ return m_log2MaxTextureSize;
+}
+
+void GLClientState::postDraw() {
+ setBoundTransformFeedbackBuffersDirtyForHostMap();
+ setBoundShaderStorageBuffersDirtyForHostMap();
+ setBoundAtomicCounterBuffersDirtyForHostMap();
+}
+
+void GLClientState::postReadPixels() {
+ setBoundPixelPackBufferDirtyForHostMap();
+}
+
+void GLClientState::postDispatchCompute() {
+ setBoundShaderStorageBuffersDirtyForHostMap();
+ setBoundAtomicCounterBuffersDirtyForHostMap();
+}
+
+bool GLClientState::shouldSkipHostMapBuffer(GLenum target) {
+ GLuint id = getBuffer(target);
+ return !isBufferHostMapDirty(id);
+}
+
+void GLClientState::onHostMappedBuffer(GLenum target) {
+ GLuint id = getBuffer(target);
+ setBufferHostMapDirty(id, false /* not dirty */);
+}
+
+int GLClientState::getBuffer(GLenum target) {
+ int ret=0;
+ switch (target) {
+ case GL_ARRAY_BUFFER:
+ ret = m_arrayBuffer;
+ break;
+ case GL_ELEMENT_ARRAY_BUFFER:
+ ret = m_currVaoState.iboId();
+ break;
+ case GL_COPY_READ_BUFFER:
+ ret = m_copyReadBuffer;
+ break;
+ case GL_COPY_WRITE_BUFFER:
+ ret = m_copyWriteBuffer;
+ break;
+ case GL_PIXEL_PACK_BUFFER:
+ ret = m_pixelPackBuffer;
+ break;
+ case GL_PIXEL_UNPACK_BUFFER:
+ ret = m_pixelUnpackBuffer;
+ break;
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
+ ret = m_transformFeedbackBuffer;
+ break;
+ case GL_UNIFORM_BUFFER:
+ ret = m_uniformBuffer;
+ break;
+ case GL_ATOMIC_COUNTER_BUFFER:
+ ret = m_atomicCounterBuffer;
+ break;
+ case GL_DISPATCH_INDIRECT_BUFFER:
+ ret = m_dispatchIndirectBuffer;
+ break;
+ case GL_DRAW_INDIRECT_BUFFER:
+ ret = m_drawIndirectBuffer;
+ break;
+ case GL_SHADER_STORAGE_BUFFER:
+ ret = m_shaderStorageBuffer;
+ break;
+ case GL_TEXTURE_BUFFER_OES:
+ ret = m_textureBuffer;
+ break;
+ default:
+ ret = -1;
+ }
+ return ret;
+}
+
+GLuint GLClientState::getLastEncodedBufferBind(GLenum target) {
+ GLuint ret;
+ switch (target)
+ {
+ case GL_ARRAY_BUFFER:
+ ret = m_arrayBuffer_lastEncode;
+ break;
+ case GL_ELEMENT_ARRAY_BUFFER:
+ ret = m_currVaoState.iboIdLastEncode();
+ break;
+ default:
+ {
+ int idOrError = getBuffer(target);
+ ret = (idOrError < 0) ? 0 : (GLuint)idOrError;
+ }
+ }
+
+ return ret;
+}
+
+void GLClientState::setLastEncodedBufferBind(GLenum target, GLuint id)
+{
+ switch (target)
+ {
+ case GL_ARRAY_BUFFER:
+ m_arrayBuffer_lastEncode = id;
+ break;
+ case GL_ELEMENT_ARRAY_BUFFER:
+ m_currVaoState.iboIdLastEncode() = id;
+ break;
+ default:
+ break;
+ }
+}
+
+bool GLClientState::isTexture(GLuint tex_name) const {
+ return getTextureRec(tex_name) != nullptr;
+}
+
+bool GLClientState::isTextureWithStorage(GLuint tex_name) const {
+ TextureRec* rec = getTextureRecPtr(tex_name);
+ if (!rec) return false;
+ return rec->hasStorage;
+}
+
+bool GLClientState::isTextureCubeMap(GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) return false;
+ switch (texrec->target) {
+ case GL_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool GLClientState::isRenderbuffer(GLuint name) const {
+ if (!name) return false;
+
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ return view.hasRbo(name);
+}
+
+bool GLClientState::isRenderbufferThatWasBound(GLuint name) const {
+ if (!name) return true;
+
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ if (!view.hasRbo(name)) return false;
+
+ const RboProps* props = view.get_const(name);
+ return props->previouslyBound;
+}
+
+void GLClientState::getClientStatePointer(GLenum pname, GLvoid** params)
+{
+ GLenum which_state = -1;
+ switch (pname) {
+ case GL_VERTEX_ARRAY_POINTER: {
+ which_state = GLClientState::VERTEX_LOCATION;
+ break;
+ }
+ case GL_NORMAL_ARRAY_POINTER: {
+ which_state = GLClientState::NORMAL_LOCATION;
+ break;
+ }
+ case GL_COLOR_ARRAY_POINTER: {
+ which_state = GLClientState::COLOR_LOCATION;
+ break;
+ }
+ case GL_TEXTURE_COORD_ARRAY_POINTER: {
+ which_state = getActiveTexture() + GLClientState::TEXCOORD0_LOCATION;
+ break;
+ }
+ case GL_POINT_SIZE_ARRAY_POINTER_OES: {
+ which_state = GLClientState::POINTSIZE_LOCATION;
+ break;
+ }
+ case GL_MATRIX_INDEX_ARRAY_POINTER_OES: {
+ which_state = GLClientState::MATRIXINDEX_LOCATION;
+ break;
+ }
+ case GL_WEIGHT_ARRAY_POINTER_OES: {
+ which_state = GLClientState::WEIGHT_LOCATION;
+ break;
+ }
+ }
+ if (which_state != -1)
+ *params = m_currVaoState[which_state].data;
+}
+
+int GLClientState::setPixelStore(GLenum param, GLint value)
+{
+ int retval = 0;
+ switch(param) {
+ case GL_UNPACK_ALIGNMENT:
+ m_pixelStore.unpack_alignment = value;
+ break;
+ case GL_PACK_ALIGNMENT:
+ m_pixelStore.pack_alignment = value;
+ break;
+ case GL_UNPACK_ROW_LENGTH:
+ m_pixelStore.unpack_row_length = value;
+ break;
+ case GL_UNPACK_IMAGE_HEIGHT:
+ m_pixelStore.unpack_image_height = value;
+ break;
+ case GL_UNPACK_SKIP_PIXELS:
+ m_pixelStore.unpack_skip_pixels = value;
+ break;
+ case GL_UNPACK_SKIP_ROWS:
+ m_pixelStore.unpack_skip_rows = value;
+ break;
+ case GL_UNPACK_SKIP_IMAGES:
+ m_pixelStore.unpack_skip_images = value;
+ break;
+ case GL_PACK_ROW_LENGTH:
+ m_pixelStore.pack_row_length = value;
+ break;
+ case GL_PACK_SKIP_PIXELS:
+ m_pixelStore.pack_skip_pixels = value;
+ break;
+ case GL_PACK_SKIP_ROWS:
+ m_pixelStore.pack_skip_rows = value;
+ break;
+ default:
+ retval = GL_INVALID_ENUM;
+ }
+ return retval;
+}
+
+
+size_t GLClientState::pixelDataSize(GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack) const
+{
+ if (width <= 0 || height <= 0 || depth <= 0) return 0;
+
+ ALOGV("%s: pack? %d", __FUNCTION__, pack);
+ if (pack) {
+ ALOGV("%s: pack stats", __FUNCTION__);
+ ALOGV("%s: pack align %d", __FUNCTION__, m_pixelStore.pack_alignment);
+ ALOGV("%s: pack rowlen %d", __FUNCTION__, m_pixelStore.pack_row_length);
+ ALOGV("%s: pack skippixels %d", __FUNCTION__, m_pixelStore.pack_skip_pixels);
+ ALOGV("%s: pack skiprows %d", __FUNCTION__, m_pixelStore.pack_skip_rows);
+ } else {
+ ALOGV("%s: unpack stats", __FUNCTION__);
+ ALOGV("%s: unpack align %d", __FUNCTION__, m_pixelStore.unpack_alignment);
+ ALOGV("%s: unpack rowlen %d", __FUNCTION__, m_pixelStore.unpack_row_length);
+ ALOGV("%s: unpack imgheight %d", __FUNCTION__, m_pixelStore.unpack_image_height);
+ ALOGV("%s: unpack skippixels %d", __FUNCTION__, m_pixelStore.unpack_skip_pixels);
+ ALOGV("%s: unpack skiprows %d", __FUNCTION__, m_pixelStore.unpack_skip_rows);
+ ALOGV("%s: unpack skipimages %d", __FUNCTION__, m_pixelStore.unpack_skip_images);
+ }
+ return GLESTextureUtils::computeTotalImageSize(
+ width, height, depth,
+ format, type,
+ pack ? m_pixelStore.pack_alignment : m_pixelStore.unpack_alignment,
+ pack ? m_pixelStore.pack_row_length : m_pixelStore.unpack_row_length,
+ pack ? 0 : m_pixelStore.unpack_image_height,
+ pack ? m_pixelStore.pack_skip_pixels : m_pixelStore.unpack_skip_pixels,
+ pack ? m_pixelStore.pack_skip_rows : m_pixelStore.unpack_skip_rows,
+ pack ? 0 : m_pixelStore.unpack_skip_images);
+}
+
+size_t GLClientState::pboNeededDataSize(GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack, int ignoreTrailing) const
+{
+ if (width <= 0 || height <= 0 || depth <= 0) return 0;
+
+ ALOGV("%s: pack? %d", __FUNCTION__, pack);
+ if (pack) {
+ ALOGV("%s: pack stats", __FUNCTION__);
+ ALOGV("%s: pack align %d", __FUNCTION__, m_pixelStore.pack_alignment);
+ ALOGV("%s: pack rowlen %d", __FUNCTION__, m_pixelStore.pack_row_length);
+ ALOGV("%s: pack skippixels %d", __FUNCTION__, m_pixelStore.pack_skip_pixels);
+ ALOGV("%s: pack skiprows %d", __FUNCTION__, m_pixelStore.pack_skip_rows);
+ } else {
+ ALOGV("%s: unpack stats", __FUNCTION__);
+ ALOGV("%s: unpack align %d", __FUNCTION__, m_pixelStore.unpack_alignment);
+ ALOGV("%s: unpack rowlen %d", __FUNCTION__, m_pixelStore.unpack_row_length);
+ ALOGV("%s: unpack imgheight %d", __FUNCTION__, m_pixelStore.unpack_image_height);
+ ALOGV("%s: unpack skippixels %d", __FUNCTION__, m_pixelStore.unpack_skip_pixels);
+ ALOGV("%s: unpack skiprows %d", __FUNCTION__, m_pixelStore.unpack_skip_rows);
+ ALOGV("%s: unpack skipimages %d", __FUNCTION__, m_pixelStore.unpack_skip_images);
+ }
+ return GLESTextureUtils::computeNeededBufferSize(
+ width, height, depth,
+ format, type,
+ pack ? m_pixelStore.pack_alignment : m_pixelStore.unpack_alignment,
+ pack ? m_pixelStore.pack_row_length : m_pixelStore.unpack_row_length,
+ pack ? 0 : m_pixelStore.unpack_image_height,
+ pack ? m_pixelStore.pack_skip_pixels : m_pixelStore.unpack_skip_pixels,
+ pack ? m_pixelStore.pack_skip_rows : m_pixelStore.unpack_skip_rows,
+ pack ? 0 : m_pixelStore.unpack_skip_images,
+ ignoreTrailing);
+}
+
+
+size_t GLClientState::clearBufferNumElts(GLenum buffer) const
+{
+ switch (buffer) {
+ case GL_COLOR:
+ return 4;
+ case GL_DEPTH:
+ case GL_STENCIL:
+ return 1;
+ }
+ return 1;
+}
+
+void GLClientState::getPackingOffsets2D(GLsizei width, GLsizei height, GLenum format, GLenum type, int* bpp, int* startOffset, int* pixelRowSize, int* totalRowSize, int* skipRows) const
+{
+ if (width <= 0 || height <= 0) {
+ *startOffset = 0;
+ *pixelRowSize = 0;
+ *totalRowSize = 0;
+ return;
+ }
+
+ GLESTextureUtils::computePackingOffsets2D(
+ width, height,
+ format, type,
+ m_pixelStore.pack_alignment,
+ m_pixelStore.pack_row_length,
+ m_pixelStore.pack_skip_pixels,
+ m_pixelStore.pack_skip_rows,
+ bpp,
+ startOffset,
+ pixelRowSize,
+ totalRowSize);
+
+ *skipRows = m_pixelStore.pack_skip_rows;
+}
+
+void GLClientState::getUnpackingOffsets2D(GLsizei width, GLsizei height, GLenum format, GLenum type, int* bpp, int* startOffset, int* pixelRowSize, int* totalRowSize, int* skipRows) const
+{
+ if (width <= 0 || height <= 0) {
+ *startOffset = 0;
+ *pixelRowSize = 0;
+ *totalRowSize = 0;
+ return;
+ }
+
+ GLESTextureUtils::computePackingOffsets2D(
+ width, height,
+ format, type,
+ m_pixelStore.unpack_alignment,
+ m_pixelStore.unpack_row_length,
+ m_pixelStore.unpack_skip_pixels,
+ m_pixelStore.unpack_skip_rows,
+ bpp,
+ startOffset,
+ pixelRowSize,
+ totalRowSize);
+
+ *skipRows = m_pixelStore.unpack_skip_rows;
+}
+
+void GLClientState::getUnpackingOffsets3D(GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int* bpp, int* startOffset, int* pixelRowSize, int* totalRowSize, int* pixelImageSize, int* totalImageSize, int* skipRows, int* skipImages) const
+{
+ if (width <= 0 || height <= 0) {
+ *startOffset = 0;
+ *pixelRowSize = 0;
+ *totalRowSize = 0;
+ return;
+ }
+
+ GLESTextureUtils::computePackingOffsets3D(
+ width, height, depth,
+ format, type,
+ m_pixelStore.unpack_alignment,
+ m_pixelStore.unpack_row_length,
+ m_pixelStore.unpack_image_height,
+ m_pixelStore.unpack_skip_pixels,
+ m_pixelStore.unpack_skip_rows,
+ m_pixelStore.unpack_skip_images,
+ bpp,
+ startOffset,
+ pixelRowSize,
+ totalRowSize,
+ pixelImageSize,
+ totalImageSize);
+
+ *skipRows = m_pixelStore.unpack_skip_rows;
+ *skipImages = m_pixelStore.unpack_skip_images;
+}
+
+void GLClientState::setNumActiveUniformsInUniformBlock(GLuint program, GLuint uniformBlockIndex, GLint numActiveUniforms) {
+ UniformBlockInfoKey key;
+ key.program = program;
+ key.uniformBlockIndex = uniformBlockIndex;
+
+ UniformBlockUniformInfo info;
+ info.numActiveUniforms = (size_t)numActiveUniforms;
+
+ m_uniformBlockInfoMap[key] = info;
+}
+
+size_t GLClientState::numActiveUniformsInUniformBlock(GLuint program, GLuint uniformBlockIndex) const {
+ UniformBlockInfoKey key;
+ key.program = program;
+ key.uniformBlockIndex = uniformBlockIndex;
+ UniformBlockInfoMap::const_iterator it =
+ m_uniformBlockInfoMap.find(key);
+ if (it == m_uniformBlockInfoMap.end()) return 0;
+ return it->second.numActiveUniforms;
+}
+
+void GLClientState::associateProgramWithPipeline(GLuint program, GLuint pipeline) {
+ m_programPipelines[program] = pipeline;
+}
+
+GLClientState::ProgramPipelineIterator GLClientState::programPipelineBegin() {
+ return m_programPipelines.begin();
+}
+
+GLClientState::ProgramPipelineIterator GLClientState::programPipelineEnd() {
+ return m_programPipelines.end();
+}
+
+GLenum GLClientState::setActiveTextureUnit(GLenum texture)
+{
+ GLuint unit = texture - GL_TEXTURE0;
+ if (unit >= MAX_TEXTURE_UNITS) {
+ return GL_INVALID_ENUM;
+ }
+ m_tex.activeUnit = &m_tex.unit[unit];
+ return GL_NO_ERROR;
+}
+
+GLenum GLClientState::getActiveTextureUnit() const
+{
+ return GL_TEXTURE0 + (m_tex.activeUnit - &m_tex.unit[0]);
+}
+
+void GLClientState::enableTextureTarget(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_2D:
+ m_tex.activeUnit->enables |= (1u << TEXTURE_2D);
+ break;
+ case GL_TEXTURE_EXTERNAL_OES:
+ m_tex.activeUnit->enables |= (1u << TEXTURE_EXTERNAL);
+ break;
+ }
+}
+
+void GLClientState::disableTextureTarget(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_2D:
+ m_tex.activeUnit->enables &= ~(1u << TEXTURE_2D);
+ break;
+ case GL_TEXTURE_EXTERNAL_OES:
+ m_tex.activeUnit->enables &= ~(1u << TEXTURE_EXTERNAL);
+ break;
+ }
+}
+
+bool GLClientState::bindSampler(GLuint unit, GLuint sampler) {
+ SamplerInfo::ScopedView view(mSamplerInfo);
+ view.ref(sampler);
+ if (m_tex.unit[unit].boundSampler) {
+ view.unref(sampler);
+ }
+ m_tex.unit[unit].boundSampler = sampler;
+ return true;
+}
+
+bool GLClientState::isSamplerBindNoOp(GLuint unit, GLuint sampler) {
+ return m_tex.unit[unit].boundSampler == sampler;
+}
+
+void GLClientState::onDeleteSamplers(GLsizei n, const GLuint* samplers) {
+ for (uint32_t i = 0; i < n; ++i) {
+ for (uint32_t j = 0; j < MAX_TEXTURE_UNITS; ++j) {
+ uint32_t currentSampler = m_tex.unit[j].boundSampler;
+ if (currentSampler == samplers[i]) {
+ m_tex.unit[j].boundSampler = 0;
+ }
+ }
+ }
+}
+
+GLenum GLClientState::getPriorityEnabledTarget(GLenum allDisabled) const
+{
+ unsigned int enables = m_tex.activeUnit->enables;
+ if (enables & (1u << TEXTURE_EXTERNAL)) {
+ return GL_TEXTURE_EXTERNAL_OES;
+ } else if (enables & (1u << TEXTURE_2D)) {
+ return GL_TEXTURE_2D;
+ } else {
+ return allDisabled;
+ }
+}
+
+int GLClientState::compareTexId(const void* pid, const void* prec)
+{
+ const GLuint* id = (const GLuint*)pid;
+ const TextureRec* rec = (const TextureRec*)prec;
+ return (GLint)(*id) - (GLint)rec->id;
+}
+
+GLenum GLClientState::bindTexture(GLenum target, GLuint texture,
+ GLboolean* firstUse)
+{
+ GLboolean first = GL_FALSE;
+
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) {
+ texrec = addTextureRec(texture, target);
+ first = GL_TRUE;
+ }
+
+ if (texture && target != texrec->target &&
+ (target != GL_TEXTURE_EXTERNAL_OES &&
+ texrec->target != GL_TEXTURE_EXTERNAL_OES)) {
+ return GL_INVALID_OPERATION;
+ }
+
+ switch (target) {
+ case GL_TEXTURE_2D:
+ m_tex.activeUnit->texture[TEXTURE_2D] = texture;
+ break;
+ case GL_TEXTURE_EXTERNAL_OES:
+ m_tex.activeUnit->texture[TEXTURE_EXTERNAL] = texture;
+ break;
+ case GL_TEXTURE_CUBE_MAP:
+ m_tex.activeUnit->texture[TEXTURE_CUBE_MAP] = texture;
+ break;
+ case GL_TEXTURE_2D_ARRAY:
+ m_tex.activeUnit->texture[TEXTURE_2D_ARRAY] = texture;
+ break;
+ case GL_TEXTURE_3D:
+ m_tex.activeUnit->texture[TEXTURE_3D] = texture;
+ break;
+ case GL_TEXTURE_2D_MULTISAMPLE:
+ m_tex.activeUnit->texture[TEXTURE_2D_MULTISAMPLE] = texture;
+ break;
+ case GL_TEXTURE_BUFFER_OES:
+ m_tex.activeUnit->texture[TEXTURE_BUFFER] = texture;
+ break;
+ }
+
+ if (firstUse) {
+ *firstUse = first;
+ }
+
+ return GL_NO_ERROR;
+}
+
+void GLClientState::setBoundEGLImage(GLenum target, GLeglImageOES image, int width, int height) {
+ (void)image;
+
+ if (target == GL_RENDERBUFFER) {
+ if (!boundRenderbuffer()) return;
+ setBoundRenderbufferEGLImageBacked();
+ setBoundRenderbufferFormat(GL_RGBA);
+ setBoundRenderbufferSamples(0);
+ setBoundRenderbufferDimensions(width, height);
+ } else {
+ GLuint texture = getBoundTexture(target);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) return;
+ texrec->boundEGLImage = true;
+ setBoundTextureInternalFormat(target, GL_RGBA);
+ setBoundTextureFormat(target, GL_RGBA);
+ setBoundTextureType(target, GL_UNSIGNED_BYTE);
+ setBoundTextureSamples(target, 0);
+ setBoundTextureDims(target, target, 0, width, height, 1);
+ }
+}
+
+TextureRec* GLClientState::addTextureRec(GLuint id, GLenum target)
+{
+ TextureRec* tex = new TextureRec;
+ tex->id = id;
+ tex->target = target;
+ tex->format = -1;
+ tex->multisamples = 0;
+ tex->immutable = false;
+ tex->boundEGLImage = false;
+ tex->hasStorage = false;
+ tex->dims = new TextureDims[6];
+ tex->hasCubeNegX = false;
+ tex->hasCubePosX = false;
+ tex->hasCubeNegY = false;
+ tex->hasCubePosY = false;
+ tex->hasCubeNegZ = false;
+ tex->hasCubePosZ = false;
+
+ AutoWriteLock guard(m_tex.textureRecs->lock);
+ m_tex.textureRecs->map[id] = std::shared_ptr<TextureRec>(tex);
+ return tex;
+}
+
+std::shared_ptr<TextureRec> GLClientState::getTextureRec(GLuint id) const {
+ AutoReadLock guard(m_tex.textureRecs->lock);
+ SharedTextureDataMap::const_iterator it =
+ m_tex.textureRecs->map.find(id);
+ if (it == m_tex.textureRecs->map.end()) {
+ return NULL;
+ }
+ return it->second;
+}
+
+TextureRec* GLClientState::getTextureRecPtrLocked(GLuint id) const {
+ SharedTextureDataMap::const_iterator it =
+ m_tex.textureRecs->map.find(id);
+ if (it == m_tex.textureRecs->map.end()) {
+ return NULL;
+ }
+ return it->second.get();
+}
+
+TextureRec* GLClientState::getTextureRecPtr(GLuint id) const {
+ AutoReadLock guard(m_tex.textureRecs->lock);
+ return getTextureRecPtrLocked(id);
+}
+
+void GLClientState::setBoundTextureInternalFormat(GLenum target, GLint internalformat) {
+ GLuint texture = getBoundTexture(target);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) return;
+ texrec->internalformat = internalformat;
+}
+
+void GLClientState::setBoundTextureFormat(GLenum target, GLenum format) {
+ GLuint texture = getBoundTexture(target);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) return;
+ texrec->format = format;
+}
+
+void GLClientState::setBoundTextureType(GLenum target, GLenum type) {
+ GLuint texture = getBoundTexture(target);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) return;
+ texrec->type = type;
+}
+
+static size_t textureDimArrayOfCubeTarget(GLenum cubetarget) {
+ switch (cubetarget) {
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ return 0;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ return 1;
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ return 2;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ return 3;
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ return 4;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ return 5;
+ }
+ return 0;
+}
+
+void GLClientState::setBoundTextureDims(GLenum target, GLenum cubetarget, GLsizei level, GLsizei width, GLsizei height, GLsizei depth) {
+ GLuint texture = getBoundTexture(target);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) {
+ return;
+ }
+
+ texrec->hasStorage = true;
+
+ size_t indexToSet = 0;
+
+ if (target == GL_TEXTURE_CUBE_MAP) {
+ if (-1 == cubetarget) {
+ setBoundTextureDims(target, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, level, width, height, depth);
+ setBoundTextureDims(target, GL_TEXTURE_CUBE_MAP_POSITIVE_X, level, width, height, depth);
+ setBoundTextureDims(target, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, level, width, height, depth);
+ setBoundTextureDims(target, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, level, width, height, depth);
+ setBoundTextureDims(target, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, level, width, height, depth);
+ setBoundTextureDims(target, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, level, width, height, depth);
+ return;
+ }
+ indexToSet = textureDimArrayOfCubeTarget(cubetarget);
+ }
+
+
+ if (level == -1) {
+ GLsizei curr_width = width;
+ GLsizei curr_height = height;
+ GLsizei curr_depth = depth;
+ GLsizei curr_level = 0;
+
+ while (true) {
+ texrec->dims[indexToSet].widths[curr_level] = curr_width;
+ texrec->dims[indexToSet].heights[curr_level] = curr_height;
+ texrec->dims[indexToSet].depths[curr_level] = curr_depth;
+ if (curr_width >> 1 == 0 &&
+ curr_height >> 1 == 0 &&
+ ((target == GL_TEXTURE_3D && curr_depth == 0) ||
+ true)) {
+ break;
+ }
+ curr_width = (curr_width >> 1) ? (curr_width >> 1) : 1;
+ curr_height = (curr_height >> 1) ? (curr_height >> 1) : 1;
+ if (target == GL_TEXTURE_3D) {
+ curr_depth = (curr_depth >> 1) ? (curr_depth >> 1) : 1;
+ }
+ curr_level++;
+ }
+
+ } else {
+ texrec->dims[indexToSet].widths[level] = width;
+ texrec->dims[indexToSet].heights[level] = height;
+ texrec->dims[indexToSet].depths[level] = depth;
+ }
+
+ setFboCompletenessDirtyForTexture(texture);
+}
+
+void GLClientState::setBoundTextureSamples(GLenum target, GLsizei samples) {
+ GLuint texture = getBoundTexture(target);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) return;
+ texrec->multisamples = samples;
+}
+
+void GLClientState::addTextureCubeMapImage(GLenum stateTarget, GLenum cubeTarget) {
+ if (stateTarget != GL_TEXTURE_CUBE_MAP) return;
+
+ GLuint texture = getBoundTexture(stateTarget);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) return;
+
+ switch (cubeTarget) {
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ texrec->hasCubeNegX = true;
+ return;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ texrec->hasCubePosX = true;
+ return;
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ texrec->hasCubeNegY = true;
+ return;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ texrec->hasCubePosY = true;
+ return;
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ texrec->hasCubeNegZ = true;
+ return;
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ texrec->hasCubePosZ = true;
+ return;
+ }
+}
+
+void GLClientState::setBoundTextureImmutableFormat(GLenum target) {
+ GLuint texture = getBoundTexture(target);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) return;
+ texrec->immutable = true;
+ if (target == GL_TEXTURE_CUBE_MAP) {
+ texrec->hasCubeNegX = true;
+ texrec->hasCubePosX = true;
+ texrec->hasCubeNegY = true;
+ texrec->hasCubePosY = true;
+ texrec->hasCubeNegZ = true;
+ texrec->hasCubePosZ = true;
+ }
+}
+
+bool GLClientState::isBoundTextureImmutableFormat(GLenum target) const {
+ GLuint texture = getBoundTexture(target);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) return false;
+ return texrec->immutable;
+}
+
+bool GLClientState::isBoundTextureComplete(GLenum target) const {
+ GLuint texture = getBoundTexture(target);
+ TextureRec* texrec = getTextureRecPtr(texture);
+ if (!texrec) return false;
+
+ if (texrec->immutable) return true;
+ if (!texrec->hasStorage) return true;
+
+ if (target == GL_TEXTURE_CUBE_MAP) {
+ if (!(texrec->hasCubeNegX &&
+ texrec->hasCubePosX &&
+ texrec->hasCubeNegY &&
+ texrec->hasCubePosY &&
+ texrec->hasCubeNegZ &&
+ texrec->hasCubePosZ)) return false;
+
+ size_t currBaseLevel = texrec->dims[0].widths.begin()->first;
+ size_t currWidth = texrec->dims[0].widths.begin()->second;
+ size_t currHeight = texrec->dims[0].heights.begin()->second;
+ for (size_t i = 1; i < 6; ++i) {
+ size_t nextLevel = texrec->dims[i].widths.begin()->first;
+ size_t nextWidth = texrec->dims[i].widths.begin()->second;
+ size_t nextHeight = texrec->dims[i].heights.begin()->second;
+ if (currBaseLevel != nextLevel) return false;
+ if (currWidth != nextWidth) return false;
+ if (currHeight != nextHeight) return false;
+ }
+
+ return true;
+ }
+
+ return true;
+}
+
+
+GLuint GLClientState::getBoundTexture(GLenum target) const
+{
+ switch (target) {
+ case GL_TEXTURE_2D:
+ return m_tex.activeUnit->texture[TEXTURE_2D];
+ case GL_TEXTURE_EXTERNAL_OES:
+ return m_tex.activeUnit->texture[TEXTURE_EXTERNAL];
+ case GL_TEXTURE_CUBE_MAP:
+ return m_tex.activeUnit->texture[TEXTURE_CUBE_MAP];
+ case GL_TEXTURE_2D_ARRAY:
+ return m_tex.activeUnit->texture[TEXTURE_2D_ARRAY];
+ case GL_TEXTURE_3D:
+ return m_tex.activeUnit->texture[TEXTURE_3D];
+ case GL_TEXTURE_2D_MULTISAMPLE:
+ return m_tex.activeUnit->texture[TEXTURE_2D_MULTISAMPLE];
+ case GL_TEXTURE_BUFFER_OES:
+ return m_tex.activeUnit->texture[TEXTURE_BUFFER];
+ default:
+ return 0;
+ }
+}
+
+GLuint GLClientState::getBoundFramebuffer(GLenum target) const
+{
+ switch (target) {
+ case GL_FRAMEBUFFER:
+ case GL_DRAW_FRAMEBUFFER:
+ return mFboState.boundDrawFramebuffer;
+ case GL_READ_FRAMEBUFFER:
+ return mFboState.boundReadFramebuffer;
+ default:
+ return 0;
+ }
+}
+
+GLenum GLClientState::checkFramebufferCompleteness(GLenum target) {
+ // Default framebuffer is complete
+ // TODO: Check the case where the default framebuffer is 0x0
+ if (0 == boundFramebuffer(target)) {
+ return GL_FRAMEBUFFER_COMPLETE;
+ }
+
+ bool hasAttachment = false;
+ FboProps& props = boundFboProps(target);
+
+ if (!props.completenessDirty) {
+ return props.cachedCompleteness;
+ }
+
+ int currentSamples = -1;
+
+ for (int i = 0; i < getMaxColorAttachments(); i++) {
+ if (!props.colorAttachmenti_hasTex[i] &&
+ !props.colorAttachmenti_hasRbo[i]) continue;
+
+ GLenum attachmentRes = checkFramebufferAttachmentCompleteness(target, glUtilsColorAttachmentName(i), &currentSamples);
+ if (attachmentRes != GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT) {
+ hasAttachment = true;
+ }
+ if (attachmentRes) {
+ ALOGD("%s: color attachment %d not complete: 0x%x\n", __func__, i, attachmentRes);
+ return attachmentRes;
+ }
+ }
+
+ bool hasDepth = (props.depthAttachment_hasTexObj || props.depthAttachment_hasRbo || props.depthstencilAttachment_hasTexObj || props.depthstencilAttachment_hasRbo);
+ bool hasStencil = (props.stencilAttachment_hasTexObj || props.stencilAttachment_hasRbo || props.depthstencilAttachment_hasTexObj || props.depthstencilAttachment_hasRbo);
+
+ if (hasDepth) {
+ GLenum depthAttachmentRes = checkFramebufferAttachmentCompleteness(target, GL_DEPTH_ATTACHMENT, &currentSamples);
+ if (depthAttachmentRes != GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT) {
+ hasAttachment = true;
+ }
+ if (depthAttachmentRes) {
+ ALOGD("%s: depth attachment not complete: 0x%x\n", __func__, depthAttachmentRes);
+ return depthAttachmentRes;
+ }
+ }
+
+ if (hasStencil) {
+ GLenum stencilAttachmentRes = checkFramebufferAttachmentCompleteness(target, GL_STENCIL_ATTACHMENT, &currentSamples);
+ if (stencilAttachmentRes != GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT) {
+ hasAttachment = true;
+ }
+ if (stencilAttachmentRes) {
+ ALOGD("%s: stencil attachment not complete: 0x%x\n", __func__, stencilAttachmentRes);
+ return stencilAttachmentRes;
+ }
+ }
+
+ if (hasDepth && hasStencil) {
+ // In gles3, depth/stencil must use the same image.
+ if (m_glesMajorVersion > 2) {
+ if ((props.depthAttachment_hasTexObj && props.stencilAttachment_hasRbo) ||
+ (props.stencilAttachment_hasTexObj && props.depthAttachment_hasRbo)) {
+ ALOGD("%s: GL_FRAMEBUFFER_UNSUPPORTED: using different types of depth/stencil attachment images in GLES 3+\n", __func__);
+ return GL_FRAMEBUFFER_UNSUPPORTED;
+ }
+ if (props.depthAttachment_hasTexObj) {
+ if (props.depthAttachment_texture != props.stencilAttachment_texture) {
+ ALOGD("%s: GL_FRAMEBUFFER_UNSUPPORTED: using different texture images for depth and stencil attachments in GLES 3+\n", __func__);
+ return GL_FRAMEBUFFER_UNSUPPORTED;
+ }
+ }
+ if (props.depthAttachment_hasRbo) {
+ if (props.depthAttachment_rbo != props.stencilAttachment_rbo) {
+ ALOGD("%s: GL_FRAMEBUFFER_UNSUPPORTED: using different renderbuffers for depth and stencil attachments in GLES 3+\n", __func__);
+ return GL_FRAMEBUFFER_UNSUPPORTED;
+ }
+ }
+ }
+ }
+
+ if (!hasAttachment) {
+ // Framebuffers may be missing an attachment if they have nonzero
+ // default width and height
+ if (props.defaultWidth == 0 || props.defaultHeight == 0) {
+ return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+ }
+ }
+
+ props.completenessDirty = false;
+ props.cachedCompleteness = GL_FRAMEBUFFER_COMPLETE;
+ return GL_FRAMEBUFFER_COMPLETE;
+}
+
+GLenum GLClientState::checkFramebufferAttachmentCompleteness(GLenum target, GLenum attachment, int* currentSamples) const {
+ FboFormatInfo fbo_format_info;
+ getBoundFramebufferFormat(target, attachment, &fbo_format_info);
+
+ // Check format and renderability
+ bool renderable = false;
+ switch (fbo_format_info.type) {
+ case FBO_ATTACHMENT_RENDERBUFFER:
+ switch (attachment) {
+ case GL_DEPTH_ATTACHMENT:
+ renderable = fbo_format_info.rb_external || depthRenderableFormat(fbo_format_info.rb_format);
+ break;
+ case GL_STENCIL_ATTACHMENT:
+ renderable = fbo_format_info.rb_external || stencilRenderableFormat(fbo_format_info.rb_format);
+ break;
+ default:
+ renderable = fbo_format_info.rb_external || colorRenderableFormat(
+ fbo_format_info.rb_format,
+ GL_UNSIGNED_BYTE,
+ m_glesMajorVersion, m_glesMinorVersion,
+ m_has_color_buffer_float_extension,
+ m_has_color_buffer_half_float_extension);
+ break;
+ }
+ break;
+ case FBO_ATTACHMENT_TEXTURE:
+ switch (attachment) {
+ case GL_DEPTH_ATTACHMENT:
+ renderable = fbo_format_info.tex_external || depthRenderableFormat(fbo_format_info.tex_internalformat);
+ break;
+ case GL_STENCIL_ATTACHMENT:
+ renderable = fbo_format_info.tex_external || stencilRenderableFormat(fbo_format_info.tex_internalformat);
+ break;
+ default:
+ renderable = fbo_format_info.tex_external || colorRenderableFormat(
+ fbo_format_info.tex_internalformat,
+ fbo_format_info.tex_type,
+ m_glesMajorVersion, m_glesMinorVersion,
+ m_has_color_buffer_float_extension,
+ m_has_color_buffer_half_float_extension);
+ break;
+ }
+ break;
+ case FBO_ATTACHMENT_NONE:
+ default:
+ return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+ }
+
+ if (!renderable) {
+ switch (fbo_format_info.type) {
+ case FBO_ATTACHMENT_RENDERBUFFER:
+ ALOGD("%s: rbo not color renderable. target=0x%x attachment=0x%x rb_format=0x%x "
+ "gles=%d.%d floatext=%d hfloatext=%d\n",
+ __func__, target, attachment, fbo_format_info.rb_format,
+ m_glesMajorVersion, m_glesMinorVersion,
+ m_has_color_buffer_float_extension,
+ m_has_color_buffer_half_float_extension);
+ break;
+ case FBO_ATTACHMENT_TEXTURE:
+ ALOGD("%s: tex not color renderable. target=0x%x attachment=0x%x "
+ "tex_intformat=0x%x tex_format=0x%x tex_type=0x%x gles=%d.%d "
+ "floatext=%d hfloatext=%d\n",
+ __func__, target, attachment, fbo_format_info.tex_internalformat,
+ fbo_format_info.tex_format, fbo_format_info.tex_type, m_glesMajorVersion,
+ m_glesMinorVersion, m_has_color_buffer_float_extension,
+ m_has_color_buffer_half_float_extension);
+ break;
+ default:
+ break;
+ }
+ return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+ }
+
+ // Check dimensions
+ std::shared_ptr<TextureRec> texrec;
+ std::shared_ptr<RboProps> rbo;
+ switch (fbo_format_info.type) {
+ case FBO_ATTACHMENT_RENDERBUFFER:
+ rbo = getFboAttachmentRbo(target, attachment);
+ if (!fbo_format_info.rb_external) {
+ if (!rbo || 0 == rbo->width || 0 == rbo->height) {
+ ALOGD("%s: rbo has zero dimension\n", __func__);
+ return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+ }
+ }
+ break;
+ case FBO_ATTACHMENT_TEXTURE:
+ texrec = getFboAttachmentTexture(target, attachment);
+ if (!fbo_format_info.tex_external) {
+ if (0 == texrec->dims->widths[fbo_format_info.tex_level] ||
+ 0 == texrec->dims->heights[fbo_format_info.tex_level]) {
+ ALOGD("%s: texture has zero dimension\n", __func__);
+ return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+ }
+ GLsizei depth = texrec->dims->depths[fbo_format_info.tex_level];
+ if (fbo_format_info.tex_layer >= depth) {
+ ALOGD("%s: texture layer/zoffset too high, wanted %d but only have %d layers\n", __func__,
+ fbo_format_info.tex_layer, depth);
+ return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+ }
+ }
+ break;
+ case FBO_ATTACHMENT_NONE:
+ default:
+ return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+ }
+
+ // Check samples
+ int currSamplesVal = *currentSamples;
+ bool firstTime = -1 == currSamplesVal;
+ int samplesThisAttachment = 0;
+ switch (fbo_format_info.type) {
+ case FBO_ATTACHMENT_RENDERBUFFER:
+ samplesThisAttachment = fbo_format_info.rb_multisamples;
+ break;
+ case FBO_ATTACHMENT_TEXTURE:
+ samplesThisAttachment = fbo_format_info.tex_multisamples;
+ break;
+ case FBO_ATTACHMENT_NONE:
+ break;
+ default:
+ return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+ }
+
+ if (firstTime) {
+ *currentSamples = samplesThisAttachment;
+ } else {
+ if (samplesThisAttachment != currSamplesVal) {
+ return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
+ }
+ }
+
+ return 0;
+}
+
+// BEGIN driver workarounds-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
+// (>' ')><(' '<)(>' ')><(' '<)(>' ')><(' '<)(>' ')><(' '<)(>' ')><(' '<)(>' ')>
+
+static bool unreliableInternalFormat(GLenum internalformat) {
+ switch (internalformat) {
+ case GL_LUMINANCE:
+ return true;
+ default:
+ return false;
+ }
+}
+
+void GLClientState::writeCopyTexImageState
+ (GLenum target, GLint level, GLenum internalformat) {
+ if (unreliableInternalFormat(internalformat)) {
+ CubeMapDef entry;
+ entry.id = getBoundTexture(GL_TEXTURE_2D);
+ entry.target = target;
+ entry.level = level;
+ entry.internalformat = internalformat;
+ m_cubeMapDefs.insert(entry);
+ }
+}
+
+static GLenum identifyPositiveCubeMapComponent(GLenum target) {
+ switch (target) {
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ return GL_TEXTURE_CUBE_MAP_POSITIVE_X;
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ return GL_TEXTURE_CUBE_MAP_POSITIVE_Y;
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ return GL_TEXTURE_CUBE_MAP_POSITIVE_Z;
+ default:
+ return 0;
+ }
+}
+
+GLenum GLClientState::copyTexImageNeededTarget
+ (GLenum target, GLint level, GLenum internalformat) {
+ if (unreliableInternalFormat(internalformat)) {
+ GLenum positiveComponent =
+ identifyPositiveCubeMapComponent(target);
+ if (positiveComponent) {
+ CubeMapDef query;
+ query.id = getBoundTexture(GL_TEXTURE_2D);
+ query.target = positiveComponent;
+ query.level = level;
+ query.internalformat = internalformat;
+ if (m_cubeMapDefs.find(query) ==
+ m_cubeMapDefs.end()) {
+ return positiveComponent;
+ }
+ }
+ }
+ return 0;
+}
+
+GLenum GLClientState::copyTexImageLuminanceCubeMapAMDWorkaround
+ (GLenum target, GLint level, GLenum internalformat) {
+ writeCopyTexImageState(target, level, internalformat);
+ return copyTexImageNeededTarget(target, level, internalformat);
+}
+
+// (>' ')><(' '<)(>' ')><(' '<)(>' ')><(' '<)(>' ')><(' '<)(>' ')><(' '<)(>' ')>
+// END driver workarounds-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
+
+void GLClientState::deleteTextures(GLsizei n, const GLuint* textures)
+{
+ for (const GLuint* texture = textures; texture != textures + n; texture++) {
+ setFboCompletenessDirtyForTexture(*texture);
+ }
+
+ // Updating the textures array could be made more efficient when deleting
+ // several textures:
+ // - compacting the array could be done in a single pass once the deleted
+ // textures are marked, or
+ // - could swap deleted textures to the end and re-sort.
+ TextureRec* texrec;
+ for (const GLuint* texture = textures; texture != textures + n; texture++) {
+ AutoWriteLock guard(m_tex.textureRecs->lock);
+ texrec = getTextureRecPtrLocked(*texture);
+ if (texrec && texrec->dims) {
+ delete [] texrec->dims;
+ }
+ if (texrec) {
+ m_tex.textureRecs->map.erase(*texture);
+ for (TextureUnit* unit = m_tex.unit;
+ unit != m_tex.unit + MAX_TEXTURE_UNITS;
+ unit++)
+ {
+ if (unit->texture[TEXTURE_2D] == *texture) {
+ unit->texture[TEXTURE_2D] = 0;
+ } else if (unit->texture[TEXTURE_EXTERNAL] == *texture) {
+ unit->texture[TEXTURE_EXTERNAL] = 0;
+ }
+ }
+ }
+ }
+}
+
+// RBO//////////////////////////////////////////////////////////////////////////
+
+void GLClientState::addFreshRenderbuffer(GLuint name) {
+ if (!name) return;
+
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ view.addFresh(name);
+}
+
+void GLClientState::addRenderbuffers(GLsizei n, GLuint* renderbuffers) {
+ for (size_t i = 0; i < n; i++) {
+ addFreshRenderbuffer(renderbuffers[i]);
+ }
+}
+
+void GLClientState::removeRenderbuffers(GLsizei n, const GLuint* renderbuffers) {
+ bool unbindCurrent = false;
+ {
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ for (size_t i = 0; i < n; i++) {
+ if (renderbuffers[i] != 0) { // Never remove the zero rb.
+ auto rboPtr = view.get_shared_ptr(renderbuffers[i]);
+ if (!rboPtr) {
+ continue;
+ }
+ unbindCurrent |=
+ (mRboState.boundRenderbuffer == rboPtr);
+ setFboCompletenessDirtyForRbo(rboPtr);
+ view.remove(renderbuffers[i]);
+ }
+ }
+ }
+
+ if (unbindCurrent) {
+ bindRenderbuffer(GL_RENDERBUFFER, 0);
+ }
+}
+
+bool GLClientState::usedRenderbufferName(GLuint name) const {
+ if (!name) return false;
+
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ return view.get_const(name) != 0;
+}
+
+void GLClientState::bindRenderbuffer(GLenum target, GLuint name) {
+
+ (void)target; // Must be GL_RENDERBUFFER
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ mRboState.boundRenderbuffer = view.bind(name);
+}
+
+GLuint GLClientState::boundRenderbuffer() const {
+ return mRboState.boundRenderbuffer->id;
+}
+
+void GLClientState::setBoundRenderbufferFormat(GLenum format) {
+ mRboState.boundRenderbuffer->format = format;
+}
+
+void GLClientState::setBoundRenderbufferSamples(GLsizei samples) {
+ mRboState.boundRenderbuffer->multisamples = samples;
+}
+
+void GLClientState::setBoundRenderbufferDimensions(GLsizei width, GLsizei height) {
+ mRboState.boundRenderbuffer->width = width;
+ mRboState.boundRenderbuffer->height = height;
+}
+
+void GLClientState::setBoundRenderbufferEGLImageBacked() {
+ mRboState.boundRenderbuffer->boundEGLImage = true;
+}
+
+// FBO//////////////////////////////////////////////////////////////////////////
+
+GLint GLClientState::queryTexInternalFormat(GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) return -1;
+ return texrec->internalformat;
+}
+
+GLsizei GLClientState::queryTexWidth(GLsizei level, GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) {
+ return 0;
+ }
+ return texrec->dims->widths[level];
+}
+
+GLsizei GLClientState::queryTexHeight(GLsizei level, GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) return 0;
+ return texrec->dims->heights[level];
+}
+
+GLsizei GLClientState::queryTexDepth(GLsizei level, GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) return 0;
+ return texrec->dims->depths[level];
+}
+
+bool GLClientState::queryTexEGLImageBacked(GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) return false;
+ return texrec->boundEGLImage;
+}
+
+GLenum GLClientState::queryTexFormat(GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) return -1;
+ return texrec->format;
+}
+
+GLenum GLClientState::queryTexType(GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) return -1;
+ return texrec->type;
+}
+
+GLsizei GLClientState::queryTexSamples(GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) return 0;
+ return texrec->multisamples;
+}
+
+GLenum GLClientState::queryTexLastBoundTarget(GLuint tex_name) const {
+ TextureRec* texrec = getTextureRecPtr(tex_name);
+ if (!texrec) return GL_NONE;
+ return texrec->target;
+}
+
+void GLClientState::getBoundFramebufferFormat(
+ GLenum target,
+ GLenum attachment, FboFormatInfo* res_info) const {
+ const FboProps& props = boundFboProps_const(target);
+
+ res_info->type = FBO_ATTACHMENT_NONE;
+ res_info->rb_format = GL_NONE;
+ res_info->rb_multisamples = 0;
+ res_info->rb_external = false;
+ res_info->tex_internalformat = -1;
+ res_info->tex_format = GL_NONE;
+ res_info->tex_type = GL_NONE;
+ res_info->tex_multisamples = 0;
+ res_info->tex_external = false;
+
+ int colorAttachmentIndex =
+ glUtilsColorAttachmentIndex(attachment);
+
+ if (colorAttachmentIndex != -1) {
+ if (props.colorAttachmenti_hasRbo[colorAttachmentIndex]) {
+ res_info->type = FBO_ATTACHMENT_RENDERBUFFER;
+ res_info->rb_format = props.colorAttachmenti_rbos[colorAttachmentIndex]->format;
+ res_info->rb_multisamples =
+ props.colorAttachmenti_rbos[colorAttachmentIndex]->multisamples;
+ res_info->rb_external =
+ props.colorAttachmenti_rbos[colorAttachmentIndex]->boundEGLImage;
+ } else if (props.colorAttachmenti_hasTex[colorAttachmentIndex]) {
+ res_info->type = FBO_ATTACHMENT_TEXTURE;
+ res_info->tex_external =
+ props.colorAttachmenti_textures[colorAttachmentIndex]->boundEGLImage;
+ res_info->tex_internalformat =
+ props.colorAttachmenti_textures[colorAttachmentIndex]->internalformat;
+ res_info->tex_format =
+ props.colorAttachmenti_textures[colorAttachmentIndex]->format;
+ res_info->tex_type =
+ props.colorAttachmenti_textures[colorAttachmentIndex]->type;
+ res_info->tex_multisamples =
+ props.colorAttachmenti_textures[colorAttachmentIndex]->multisamples;
+ res_info->tex_level = props.colorAttachmenti_texture_levels[colorAttachmentIndex];
+ res_info->tex_layer = props.colorAttachmenti_texture_layers[colorAttachmentIndex];
+ } else {
+ res_info->type = FBO_ATTACHMENT_NONE;
+ }
+ }
+
+ switch (attachment) {
+ case GL_DEPTH_ATTACHMENT:
+ if (props.depthAttachment_hasRbo) {
+ res_info->type = FBO_ATTACHMENT_RENDERBUFFER;
+ res_info->rb_format = props.depthAttachment_rbo->format;
+ res_info->rb_multisamples = props.depthAttachment_rbo->multisamples;
+ res_info->rb_external = props.depthAttachment_rbo->boundEGLImage;
+ } else if (props.depthAttachment_hasTexObj) {
+ res_info->type = FBO_ATTACHMENT_TEXTURE;
+ res_info->tex_external = props.depthAttachment_texture->boundEGLImage;
+ res_info->tex_internalformat = props.depthAttachment_texture->internalformat;
+ res_info->tex_format = props.depthAttachment_texture->format;
+ res_info->tex_type = props.depthAttachment_texture->type;
+ res_info->tex_multisamples = props.depthAttachment_texture->multisamples;
+ res_info->tex_level = props.depthAttachment_texture_level;
+ res_info->tex_layer = props.depthAttachment_texture_layer;
+ } else {
+ res_info->type = FBO_ATTACHMENT_NONE;
+ }
+ break;
+ case GL_STENCIL_ATTACHMENT:
+ if (props.stencilAttachment_hasRbo) {
+ res_info->type = FBO_ATTACHMENT_RENDERBUFFER;
+ res_info->rb_format = props.stencilAttachment_rbo->format;
+ res_info->rb_multisamples = props.stencilAttachment_rbo->multisamples;
+ res_info->rb_external = props.stencilAttachment_rbo->boundEGLImage;
+ } else if (props.stencilAttachment_hasTexObj) {
+ res_info->type = FBO_ATTACHMENT_TEXTURE;
+ res_info->tex_external = props.stencilAttachment_texture->boundEGLImage;
+ res_info->tex_internalformat = props.stencilAttachment_texture->internalformat;
+ res_info->tex_format = props.stencilAttachment_texture->format;
+ res_info->tex_type = props.stencilAttachment_texture->type;
+ res_info->tex_multisamples = props.stencilAttachment_texture->multisamples;
+ res_info->tex_level = props.depthAttachment_texture_level;
+ res_info->tex_layer = props.depthAttachment_texture_layer;
+ } else {
+ res_info->type = FBO_ATTACHMENT_NONE;
+ }
+ break;
+ case GL_DEPTH_STENCIL_ATTACHMENT:
+ if (props.depthstencilAttachment_hasRbo) {
+ res_info->type = FBO_ATTACHMENT_RENDERBUFFER;
+ res_info->rb_format = props.depthstencilAttachment_rbo->format;
+ res_info->rb_multisamples = props.depthstencilAttachment_rbo->multisamples;
+ res_info->rb_external = props.depthstencilAttachment_rbo->boundEGLImage;
+ } else if (props.depthstencilAttachment_hasTexObj) {
+ res_info->type = FBO_ATTACHMENT_TEXTURE;
+ res_info->tex_external = props.depthstencilAttachment_texture->boundEGLImage;
+ res_info->tex_internalformat = props.depthstencilAttachment_texture->internalformat;
+ res_info->tex_format = props.depthstencilAttachment_texture->format;
+ res_info->tex_type = props.depthstencilAttachment_texture->type;
+ res_info->tex_multisamples = props.depthstencilAttachment_texture->multisamples;
+ res_info->tex_level = props.depthAttachment_texture_level;
+ res_info->tex_layer = props.depthAttachment_texture_layer;
+ } else {
+ res_info->type = FBO_ATTACHMENT_NONE;
+ }
+ break;
+ }
+}
+
+FboAttachmentType GLClientState::getBoundFramebufferAttachmentType(GLenum target, GLenum attachment) const {
+ FboFormatInfo info;
+ getBoundFramebufferFormat(target, attachment, &info);
+ return info.type;
+}
+
+int GLClientState::getMaxColorAttachments() const {
+ return m_hostDriverCaps.max_color_attachments;
+}
+
+int GLClientState::getMaxDrawBuffers() const {
+ return m_hostDriverCaps.max_draw_buffers;
+}
+
+#define UNIFORM_VALIDATION_ERR_COND(cond, code) if (cond) { *err = code; return; }
+
+#define UNIFORM_VALIDATION_INFO_VAR_NAME info
+
+#define UNIFORM_VALIDATION_TYPE_VIOLATION_FOR_FLOATS \
+ (!(UNIFORM_VALIDATION_INFO_VAR_NAME->isBool) && (UNIFORM_VALIDATION_INFO_VAR_NAME->isInt || UNIFORM_VALIDATION_INFO_VAR_NAME->isSampler))
+
+#define UNIFORM_VALIDATION_TYPE_VIOLATION_FOR_INTS \
+ (!(UNIFORM_VALIDATION_INFO_VAR_NAME->isBool) && (!UNIFORM_VALIDATION_TYPE_VIOLATION_FOR_FLOATS || UNIFORM_VALIDATION_INFO_VAR_NAME->isUnsigned))
+
+#define UNIFORM_VALIDATION_TYPE_VIOLATION_FOR_UNSIGNED_INTS \
+ (!(UNIFORM_VALIDATION_INFO_VAR_NAME->isBool) && (!UNIFORM_VALIDATION_TYPE_VIOLATION_FOR_FLOATS || !(UNIFORM_VALIDATION_INFO_VAR_NAME->isUnsigned)))
+
+#define UNIFORM_VALIDATION_INLINING
+
+void GLClientState::validateUniform(bool isFloat, bool isUnsigned, GLint columns, GLint rows, GLint location, GLsizei count, GLenum* err) {
+ UNIFORM_VALIDATION_ERR_COND(!m_currentProgram && !m_currentShaderProgram, GL_INVALID_OPERATION);
+ if (-1 == location) return;
+ auto info = currentUniformValidationInfo.get_const(location);
+ UNIFORM_VALIDATION_ERR_COND(!info || !info->valid, GL_INVALID_OPERATION);
+ UNIFORM_VALIDATION_ERR_COND(columns != info->columns || rows != info->rows, GL_INVALID_OPERATION);
+ UNIFORM_VALIDATION_ERR_COND(count > 1 && !info->isArray, GL_INVALID_OPERATION);
+ if (isFloat) {
+ UNIFORM_VALIDATION_ERR_COND(UNIFORM_VALIDATION_TYPE_VIOLATION_FOR_FLOATS, GL_INVALID_OPERATION);
+ } else {
+ if (isUnsigned) {
+ UNIFORM_VALIDATION_ERR_COND(UNIFORM_VALIDATION_TYPE_VIOLATION_FOR_UNSIGNED_INTS, GL_INVALID_OPERATION);
+ } else {
+ UNIFORM_VALIDATION_ERR_COND(UNIFORM_VALIDATION_TYPE_VIOLATION_FOR_INTS, GL_INVALID_OPERATION);
+ }
+ }
+}
+
+bool GLClientState::isAttribIndexUsedByProgram(int index) {
+ auto info = currentAttribValidationInfo.get_const(index);
+ if (!info) return false;
+ if (!info->validInProgram) return false;
+ return true;
+}
+
+void GLClientState::addFreshFramebuffer(GLuint name) {
+ FboProps props;
+ props.name = name;
+ props.previouslyBound = false;
+
+ props.completenessDirty = true;
+
+ props.colorAttachmenti_textures.resize(m_hostDriverCaps.max_color_attachments, 0);
+ props.colorAttachmenti_texture_levels.resize(m_hostDriverCaps.max_color_attachments, 0);
+ props.colorAttachmenti_texture_layers.resize(m_hostDriverCaps.max_color_attachments, 0);
+
+ props.depthAttachment_texture_level = 0;
+ props.depthAttachment_texture_layer = 0;
+ props.stencilAttachment_texture_level = 0;
+ props.stencilAttachment_texture_layer = 0;
+
+ props.depthAttachment_texture = 0;
+ props.stencilAttachment_texture = 0;
+ props.depthstencilAttachment_texture = 0;
+
+ props.colorAttachmenti_hasTex.resize(m_hostDriverCaps.max_color_attachments, false);
+ props.depthAttachment_hasTexObj = false;
+ props.stencilAttachment_hasTexObj = false;
+ props.depthstencilAttachment_hasTexObj = false;
+
+ props.colorAttachmenti_rbos.resize(m_hostDriverCaps.max_color_attachments, 0);
+ props.depthAttachment_rbo = 0;
+ props.stencilAttachment_rbo = 0;
+ props.depthstencilAttachment_rbo = 0;
+
+ props.colorAttachmenti_hasRbo.resize(m_hostDriverCaps.max_color_attachments, false);
+ props.depthAttachment_hasRbo = false;
+ props.stencilAttachment_hasRbo = false;
+ props.depthstencilAttachment_hasRbo = false;
+
+ props.defaultWidth = 0;
+ props.defaultHeight = 0;
+
+ mFboState.fboData[name] = props;
+}
+
+void GLClientState::addFramebuffers(GLsizei n, GLuint* framebuffers) {
+ for (size_t i = 0; i < n; i++) {
+ addFreshFramebuffer(framebuffers[i]);
+ }
+}
+
+void GLClientState::removeFramebuffers(GLsizei n, const GLuint* framebuffers) {
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ for (size_t i = 0; i < n; i++) {
+ if (framebuffers[i] != 0) { // Never remove the zero fb.
+ if (framebuffers[i] == mFboState.boundDrawFramebuffer) {
+ bindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ }
+ if (framebuffers[i] == mFboState.boundReadFramebuffer) {
+ bindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+ }
+ mFboState.fboData.erase(framebuffers[i]);
+ }
+ }
+}
+
+bool GLClientState::usedFramebufferName(GLuint name) const {
+ return mFboState.fboData.find(name) != mFboState.fboData.end();
+}
+
+FboProps& GLClientState::boundFboProps(GLenum target) {
+ switch (target) {
+ case GL_DRAW_FRAMEBUFFER:
+ return mFboState.fboData[mFboState.boundDrawFramebuffer];
+ case GL_READ_FRAMEBUFFER:
+ return mFboState.fboData[mFboState.boundReadFramebuffer];
+ case GL_FRAMEBUFFER:
+ return mFboState.fboData[mFboState.boundDrawFramebuffer];
+ }
+ return mFboState.fboData[mFboState.boundDrawFramebuffer];
+}
+
+const FboProps& GLClientState::boundFboProps_const(GLenum target) const {
+ switch (target) {
+ case GL_DRAW_FRAMEBUFFER:
+ return mFboState.fboData.find(mFboState.boundDrawFramebuffer)->second;
+ case GL_READ_FRAMEBUFFER:
+ return mFboState.fboData.find(mFboState.boundReadFramebuffer)->second;
+ case GL_FRAMEBUFFER:
+ return mFboState.fboData.find(mFboState.boundDrawFramebuffer)->second;
+ }
+ return mFboState.fboData.find(mFboState.boundDrawFramebuffer)->second;
+}
+
+void GLClientState::bindFramebuffer(GLenum target, GLuint name) {
+ // If unused, add it.
+ if (!usedFramebufferName(name)) {
+ addFreshFramebuffer(name);
+ }
+ switch (target) {
+ case GL_DRAW_FRAMEBUFFER:
+ mFboState.boundDrawFramebuffer = name;
+ break;
+ case GL_READ_FRAMEBUFFER:
+ mFboState.boundReadFramebuffer = name;
+ break;
+ default: // case GL_FRAMEBUFFER:
+ mFboState.boundDrawFramebuffer = name;
+ mFboState.boundReadFramebuffer = name;
+ break;
+ }
+ boundFboProps(target).previouslyBound = true;
+}
+
+void GLClientState::setCheckFramebufferStatus(GLenum target, GLenum status) {
+ switch (target) {
+ case GL_DRAW_FRAMEBUFFER:
+ mFboState.drawFboCheckStatus = status;
+ break;
+ case GL_READ_FRAMEBUFFER:
+ mFboState.readFboCheckStatus = status;
+ break;
+ case GL_FRAMEBUFFER:
+ mFboState.drawFboCheckStatus = status;
+ break;
+ }
+}
+
+void GLClientState::setFramebufferParameter(GLenum target, GLenum pname, GLint param) {
+ switch (pname) {
+ case GL_FRAMEBUFFER_DEFAULT_WIDTH:
+ boundFboProps(target).defaultWidth = param;
+ boundFboProps(target).completenessDirty = true;
+ break;
+ case GL_FRAMEBUFFER_DEFAULT_HEIGHT:
+ boundFboProps(target).defaultHeight = param;
+ boundFboProps(target).completenessDirty = true;
+ break;
+ }
+}
+
+GLenum GLClientState::getCheckFramebufferStatus(GLenum target) const {
+ switch (target) {
+ case GL_DRAW_FRAMEBUFFER:
+ return mFboState.drawFboCheckStatus;
+ case GL_READ_FRAMEBUFFER:
+ return mFboState.readFboCheckStatus;
+ case GL_FRAMEBUFFER:
+ return mFboState.drawFboCheckStatus;
+ }
+ return mFboState.drawFboCheckStatus;
+}
+
+GLuint GLClientState::boundFramebuffer(GLenum target) const {
+ return boundFboProps_const(target).name;
+}
+
+// Texture objects for FBOs/////////////////////////////////////////////////////
+
+void GLClientState::attachTextureObject(
+ GLenum target,
+ GLenum attachment, GLuint texture, GLint level, GLint layer) {
+
+ bool attach = texture != 0;
+ std::shared_ptr<TextureRec> texrec = getTextureRec(texture);
+
+ int colorAttachmentIndex =
+ glUtilsColorAttachmentIndex(attachment);
+
+ boundFboProps(target).completenessDirty = true;
+
+ if (colorAttachmentIndex != -1) {
+ boundFboProps(target).colorAttachmenti_textures[colorAttachmentIndex] = texrec;
+ boundFboProps(target).colorAttachmenti_texture_levels[colorAttachmentIndex] = level;
+ boundFboProps(target).colorAttachmenti_texture_layers[colorAttachmentIndex] = layer;
+ boundFboProps(target).colorAttachmenti_hasTex[colorAttachmentIndex] = attach;
+ }
+
+ switch (attachment) {
+ case GL_DEPTH_ATTACHMENT:
+ boundFboProps(target).depthAttachment_texture = texrec;
+ boundFboProps(target).depthAttachment_texture_level = level;
+ boundFboProps(target).depthAttachment_texture_layer = layer;
+ boundFboProps(target).depthAttachment_hasTexObj = attach;
+ break;
+ case GL_STENCIL_ATTACHMENT:
+ boundFboProps(target).stencilAttachment_texture = texrec;
+ boundFboProps(target).stencilAttachment_texture_level = level;
+ boundFboProps(target).stencilAttachment_texture_layer = layer;
+ boundFboProps(target).stencilAttachment_hasTexObj = attach;
+ break;
+ case GL_DEPTH_STENCIL_ATTACHMENT:
+ boundFboProps(target).depthstencilAttachment_texture = texrec;
+ boundFboProps(target).depthstencilAttachment_hasTexObj = attach;
+ boundFboProps(target).stencilAttachment_texture = texrec;
+ boundFboProps(target).stencilAttachment_hasTexObj = attach;
+ boundFboProps(target).depthAttachment_texture = texrec;
+ boundFboProps(target).depthAttachment_hasTexObj = attach;
+ boundFboProps(target).depthAttachment_texture_level = level;
+ boundFboProps(target).depthAttachment_texture_layer = layer;
+ boundFboProps(target).stencilAttachment_texture_level = level;
+ boundFboProps(target).stencilAttachment_texture_layer = layer;
+ break;
+ }
+}
+
+std::shared_ptr<TextureRec> GLClientState::getFboAttachmentTexture(GLenum target, GLenum attachment) const {
+ std::shared_ptr<TextureRec> res = {}; // conservative
+
+ int colorAttachmentIndex =
+ glUtilsColorAttachmentIndex(attachment);
+
+ if (colorAttachmentIndex != -1) {
+ res = boundFboProps_const(target).colorAttachmenti_textures[colorAttachmentIndex];
+ }
+
+ switch (attachment) {
+ case GL_DEPTH_ATTACHMENT:
+ res = boundFboProps_const(target).depthAttachment_texture;
+ break;
+ case GL_STENCIL_ATTACHMENT:
+ res = boundFboProps_const(target).stencilAttachment_texture;
+ break;
+ case GL_DEPTH_STENCIL_ATTACHMENT:
+ res = boundFboProps_const(target).depthstencilAttachment_texture;
+ break;
+ }
+ return res;
+}
+
+// RBOs for FBOs////////////////////////////////////////////////////////////////
+
+void GLClientState::detachRbo(GLuint renderbuffer) {
+ for (int i = 0; i < m_hostDriverCaps.max_color_attachments; i++) {
+ detachRboFromFbo(GL_DRAW_FRAMEBUFFER, glUtilsColorAttachmentName(i), renderbuffer);
+ detachRboFromFbo(GL_READ_FRAMEBUFFER, glUtilsColorAttachmentName(i), renderbuffer);
+ }
+
+ detachRboFromFbo(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, renderbuffer);
+ detachRboFromFbo(GL_READ_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, renderbuffer);
+
+ detachRboFromFbo(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, renderbuffer);
+ detachRboFromFbo(GL_READ_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, renderbuffer);
+
+ detachRboFromFbo(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, renderbuffer);
+ detachRboFromFbo(GL_READ_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, renderbuffer);
+}
+
+void GLClientState::detachRboFromFbo(GLenum target, GLenum attachment, GLuint renderbuffer) {
+ int colorAttachmentIndex =
+ glUtilsColorAttachmentIndex(attachment);
+
+ boundFboProps(target).completenessDirty = true;
+
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ auto renderBufferSharedPtr = view.get_shared_ptr(renderbuffer);
+ if (colorAttachmentIndex != -1) {
+ if (boundFboProps(target).colorAttachmenti_hasRbo[colorAttachmentIndex] &&
+ boundFboProps(target).colorAttachmenti_rbos[colorAttachmentIndex]
+ == renderBufferSharedPtr) {
+ boundFboProps(target).colorAttachmenti_rbos[colorAttachmentIndex] = nullptr;
+ boundFboProps(target).colorAttachmenti_hasRbo[colorAttachmentIndex] = false;
+ }
+ }
+
+ switch (attachment) {
+ case GL_DEPTH_ATTACHMENT:
+ if (boundFboProps(target).depthAttachment_rbo == renderBufferSharedPtr &&
+ boundFboProps(target).depthAttachment_hasRbo) {
+ boundFboProps(target).depthAttachment_rbo = nullptr;
+ boundFboProps(target).depthAttachment_hasRbo = false;
+ }
+ break;
+ case GL_STENCIL_ATTACHMENT:
+ if (boundFboProps(target).stencilAttachment_rbo == renderBufferSharedPtr &&
+ boundFboProps(target).stencilAttachment_hasRbo) {
+ boundFboProps(target).stencilAttachment_rbo = nullptr;
+ boundFboProps(target).stencilAttachment_hasRbo = false;
+ }
+ break;
+ case GL_DEPTH_STENCIL_ATTACHMENT:
+ if (boundFboProps(target).depthAttachment_rbo == renderBufferSharedPtr &&
+ boundFboProps(target).depthAttachment_hasRbo) {
+ boundFboProps(target).depthAttachment_rbo = nullptr;
+ boundFboProps(target).depthAttachment_hasRbo = false;
+ }
+ if (boundFboProps(target).stencilAttachment_rbo == renderBufferSharedPtr &&
+ boundFboProps(target).stencilAttachment_hasRbo) {
+ boundFboProps(target).stencilAttachment_rbo = nullptr;
+ boundFboProps(target).stencilAttachment_hasRbo = false;
+ }
+ if (boundFboProps(target).depthstencilAttachment_rbo == renderBufferSharedPtr &&
+ boundFboProps(target).depthstencilAttachment_hasRbo) {
+ boundFboProps(target).depthstencilAttachment_rbo = nullptr;
+ boundFboProps(target).depthstencilAttachment_hasRbo = false;
+ }
+ break;
+ }
+}
+
+void GLClientState::attachRbo(GLenum target, GLenum attachment, GLuint renderbuffer) {
+
+ bool attach = 0 != renderbuffer;
+
+ int colorAttachmentIndex =
+ glUtilsColorAttachmentIndex(attachment);
+
+ boundFboProps(target).completenessDirty = true;
+
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ auto rboSharedPtr = view.get_or_add_shared_ptr(renderbuffer);
+ if (colorAttachmentIndex != -1) {
+ boundFboProps(target).colorAttachmenti_rbos[colorAttachmentIndex] = rboSharedPtr;
+ boundFboProps(target).colorAttachmenti_hasRbo[colorAttachmentIndex] = attach;
+ }
+
+ switch (attachment) {
+ case GL_DEPTH_ATTACHMENT:
+ boundFboProps(target).depthAttachment_rbo = rboSharedPtr;
+ boundFboProps(target).depthAttachment_hasRbo = attach;
+ break;
+ case GL_STENCIL_ATTACHMENT:
+ boundFboProps(target).stencilAttachment_rbo = rboSharedPtr;
+ boundFboProps(target).stencilAttachment_hasRbo = attach;
+ break;
+ case GL_DEPTH_STENCIL_ATTACHMENT:
+ boundFboProps(target).depthAttachment_rbo = rboSharedPtr;
+ boundFboProps(target).depthAttachment_hasRbo = attach;
+ boundFboProps(target).stencilAttachment_rbo = rboSharedPtr;
+ boundFboProps(target).stencilAttachment_hasRbo = attach;
+ boundFboProps(target).depthstencilAttachment_rbo = rboSharedPtr;
+ boundFboProps(target).depthstencilAttachment_hasRbo = attach;
+ break;
+ }
+}
+
+std::shared_ptr<RboProps> GLClientState::getFboAttachmentRbo(GLenum target, GLenum attachment) const {
+ int colorAttachmentIndex =
+ glUtilsColorAttachmentIndex(attachment);
+
+ if (colorAttachmentIndex != -1) {
+ return boundFboProps_const(target).colorAttachmenti_rbos[colorAttachmentIndex];
+ }
+
+ switch (attachment) {
+ case GL_DEPTH_ATTACHMENT:
+ return boundFboProps_const(target).depthAttachment_rbo;
+ case GL_STENCIL_ATTACHMENT:
+ return boundFboProps_const(target).stencilAttachment_rbo;
+ case GL_DEPTH_STENCIL_ATTACHMENT:
+ return boundFboProps_const(target).depthstencilAttachment_rbo;
+ }
+
+ // Bad attachment enum. Should be unreachable.
+ return nullptr;
+}
+
+void GLClientState::setFboCompletenessDirtyForTexture(GLuint texture) {
+ std::shared_ptr<TextureRec> texrec = getTextureRec(texture);
+ std::map<GLuint, FboProps>::iterator it = mFboState.fboData.begin();
+ while (it != mFboState.fboData.end()) {
+ FboProps& props = it->second;
+ for (int i = 0; i < m_hostDriverCaps.max_color_attachments; ++i) {
+ if (props.colorAttachmenti_hasTex[i]) {
+ if (texrec == props.colorAttachmenti_textures[i]) {
+ props.completenessDirty = true;
+ return;
+ }
+ }
+ }
+
+ if (props.depthAttachment_hasTexObj) {
+ if (texrec == props.depthAttachment_texture) {
+ props.completenessDirty = true;
+ return;
+ }
+ }
+
+ if (props.stencilAttachment_hasTexObj) {
+ if (texrec == props.stencilAttachment_texture) {
+ props.completenessDirty = true;
+ return;
+ }
+ }
+
+ if (props.depthstencilAttachment_hasTexObj) {
+ if (texrec == props.depthstencilAttachment_texture) {
+ props.completenessDirty = true;
+ return;
+ }
+ }
+ ++it;
+ }
+}
+
+void GLClientState::setFboCompletenessDirtyForRbo(std::shared_ptr<RboProps> rbo) {
+ std::map<GLuint, FboProps>::iterator it = mFboState.fboData.begin();
+ while (it != mFboState.fboData.end()) {
+ FboProps& props = it->second;
+ for (int i = 0; i < m_hostDriverCaps.max_color_attachments; ++i) {
+ if (props.colorAttachmenti_hasRbo[i]) {
+ if (rbo == props.colorAttachmenti_rbos[i]) {
+ props.completenessDirty = true;
+ return;
+ }
+ }
+ }
+
+ if (props.depthAttachment_hasRbo) {
+ if (rbo == props.depthAttachment_rbo) {
+ props.completenessDirty = true;
+ return;
+ }
+ }
+
+ if (props.stencilAttachment_hasRbo) {
+ if (rbo == props.stencilAttachment_rbo) {
+ props.completenessDirty = true;
+ return;
+ }
+ }
+
+ if (props.depthstencilAttachment_hasRbo) {
+ if (rbo == props.depthstencilAttachment_rbo) {
+ props.completenessDirty = true;
+ return;
+ }
+ }
+ ++it;
+ }
+}
+
+bool GLClientState::attachmentHasObject(GLenum target, GLenum attachment) const {
+ bool res = true; // liberal
+
+ int colorAttachmentIndex =
+ glUtilsColorAttachmentIndex(attachment);
+
+ if (colorAttachmentIndex != -1) {
+ res = boundFboProps_const(target).colorAttachmenti_hasTex[colorAttachmentIndex] ||
+ boundFboProps_const(target).colorAttachmenti_hasRbo[colorAttachmentIndex];
+ }
+
+ switch (attachment) {
+ case GL_DEPTH_ATTACHMENT:
+ res = (boundFboProps_const(target).depthAttachment_hasTexObj) ||
+ (boundFboProps_const(target).depthAttachment_hasRbo);
+ break;
+ case GL_STENCIL_ATTACHMENT:
+ res = (boundFboProps_const(target).stencilAttachment_hasTexObj) ||
+ (boundFboProps_const(target).stencilAttachment_hasRbo);
+ break;
+ case GL_DEPTH_STENCIL_ATTACHMENT:
+ res = (boundFboProps_const(target).depthstencilAttachment_hasTexObj) ||
+ (boundFboProps_const(target).depthstencilAttachment_hasRbo);
+ break;
+ }
+ return res;
+}
+
+bool GLClientState::depthStencilHasSameObject(GLenum target) const {
+ const FboProps& props = boundFboProps_const(target);
+
+ if (props.depthAttachment_hasTexObj != props.stencilAttachment_hasTexObj
+ || props.depthAttachment_hasRbo != props.stencilAttachment_hasRbo) {
+ return false;
+ }
+ if (props.depthAttachment_hasTexObj) {
+ return props.depthAttachment_texture == props.stencilAttachment_texture;
+ }
+ if (props.depthAttachment_hasRbo) {
+ return props.depthAttachment_rbo == props.stencilAttachment_rbo;
+ }
+ // No attachment in either
+ return true;
+}
+
+void GLClientState::setTransformFeedbackActive(bool active) {
+ m_transformFeedbackActive = active;
+}
+
+void GLClientState::setTransformFeedbackUnpaused(bool unpaused) {
+ m_transformFeedbackUnpaused = unpaused;
+}
+
+void GLClientState::setTransformFeedbackVaryingsCountForLinking(uint32_t count) {
+ m_transformFeedbackVaryingsCountForLinking = count;
+}
+
+bool GLClientState::getTransformFeedbackActive() const {
+ return m_transformFeedbackActive;
+}
+
+bool GLClientState::getTransformFeedbackUnpaused() const {
+ return m_transformFeedbackUnpaused;
+}
+
+bool GLClientState::getTransformFeedbackActiveUnpaused() const {
+ return m_transformFeedbackActive && m_transformFeedbackUnpaused;
+}
+
+uint32_t GLClientState::getTransformFeedbackVaryingsCountForLinking() const {
+ return m_transformFeedbackVaryingsCountForLinking;
+}
+
+void GLClientState::stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) {
+ if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ state_GL_STENCIL_FUNC = func;
+ state_GL_STENCIL_REF = ref;
+ state_GL_STENCIL_VALUE_MASK = mask;
+ }
+
+ if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ state_GL_STENCIL_BACK_FUNC = func;
+ state_GL_STENCIL_BACK_REF = ref;
+ state_GL_STENCIL_BACK_VALUE_MASK = mask;
+ }
+}
+
+void GLClientState::stencilMaskSeparate(GLenum face, GLuint mask) {
+ if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ state_GL_STENCIL_WRITEMASK = mask;
+ }
+
+ if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ state_GL_STENCIL_BACK_WRITEMASK = mask;
+ }
+}
+
+void GLClientState::stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
+ if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
+ state_GL_STENCIL_FAIL = fail;
+ state_GL_STENCIL_PASS_DEPTH_FAIL = zfail;
+ state_GL_STENCIL_PASS_DEPTH_PASS = zpass;
+ }
+
+ if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
+ state_GL_STENCIL_BACK_FAIL = fail;
+ state_GL_STENCIL_BACK_PASS_DEPTH_FAIL = zfail;
+ state_GL_STENCIL_BACK_PASS_DEPTH_PASS = zpass;
+ }
+}
+
+void GLClientState::setTextureData(SharedTextureDataMap* sharedTexData) {
+ m_tex.textureRecs = sharedTexData;
+}
+
+void GLClientState::setRenderbufferInfo(RenderbufferInfo* rbInfo) {
+ mRboState.rboData = rbInfo;
+ if (rbInfo) {
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ auto rbo = view.get_or_add_shared_ptr(0);
+ mRboState.boundRenderbuffer = rbo;
+ }
+}
+
+void GLClientState::setSamplerInfo(SamplerInfo* samplerInfo) {
+ mSamplerInfo = samplerInfo;
+}
+
+bool GLClientState::compressedTexImageSizeCompatible(GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize) {
+ bool error = false;
+ GLsizei compressedSize = GLESTextureUtils::getCompressedImageSize(internalformat, width, height, depth, &error);
+ if (error) return false;
+ return imageSize == compressedSize;
+}
+
+void GLClientState::fromMakeCurrent() {
+ if (mFboState.fboData.find(0) == mFboState.fboData.end()) {
+ addFreshFramebuffer(0);
+ FboProps& default_fb_props = mFboState.fboData[0];
+ default_fb_props.colorAttachmenti_hasRbo[0] = true;
+ default_fb_props.depthAttachment_hasRbo = true;
+ default_fb_props.stencilAttachment_hasRbo = true;
+ default_fb_props.depthstencilAttachment_hasRbo = true;
+ RenderbufferInfo::ScopedView view(mRboState.rboData);
+ // Use RBO 0 as placeholder
+ auto rbo0 = view.get_or_add_shared_ptr(0);
+ default_fb_props.colorAttachmenti_rbos[0] = rbo0;
+ default_fb_props.depthAttachment_rbo = rbo0;
+ default_fb_props.stencilAttachment_rbo = rbo0;
+ default_fb_props.depthstencilAttachment_rbo = rbo0;
+
+ }
+
+ if (!samplerExists(0)) {
+ GLuint id = 0;
+ setExistence(ObjectType::Sampler, true, 1, &id);
+ }
+
+}
+
+void GLClientState::initFromCaps(
+ const HostDriverCaps& caps) {
+ m_hostDriverCaps = caps;
+
+ // Override some of them
+ m_hostDriverCaps.max_vertex_attribs = CODEC_MAX_VERTEX_ATTRIBUTES;
+ m_hostDriverCaps.max_vertex_attrib_bindings = m_hostDriverCaps.max_vertex_attribs;
+
+ // Derive some other settings
+ m_log2MaxTextureSize = 0;
+ uint32_t current = 1;
+ while (current < m_hostDriverCaps.max_texture_size) {
+ current = current << 1;
+ ++m_log2MaxTextureSize;
+ }
+
+ if (m_glesMajorVersion >= 3) {
+ if (m_hostDriverCaps.max_transform_feedback_separate_attribs)
+ m_indexedTransformFeedbackBuffers.resize(m_hostDriverCaps.max_transform_feedback_separate_attribs);
+ if (m_hostDriverCaps.max_uniform_buffer_bindings)
+ m_indexedUniformBuffers.resize(m_hostDriverCaps.max_uniform_buffer_bindings);
+ if (m_hostDriverCaps.max_atomic_counter_buffer_bindings)
+ m_indexedAtomicCounterBuffers.resize(m_hostDriverCaps.max_atomic_counter_buffer_bindings);
+ if (m_hostDriverCaps.max_shader_storage_buffer_bindings)
+ m_indexedShaderStorageBuffers.resize(m_hostDriverCaps.max_shader_storage_buffer_bindings);
+
+ BufferBinding buf0Binding;
+ buf0Binding.buffer = 0;
+ buf0Binding.offset = 0;
+ buf0Binding.size = 0;
+ buf0Binding.stride = 0;
+ buf0Binding.effectiveStride = 0;
+
+ for (size_t i = 0; i < m_indexedTransformFeedbackBuffers.size(); ++i)
+ m_indexedTransformFeedbackBuffers[i] = buf0Binding;
+ for (size_t i = 0; i < m_indexedUniformBuffers.size(); ++i)
+ m_indexedUniformBuffers[i] = buf0Binding;
+ for (size_t i = 0; i < m_indexedAtomicCounterBuffers.size(); ++i)
+ m_indexedAtomicCounterBuffers[i] = buf0Binding;
+ for (size_t i = 0; i < m_indexedShaderStorageBuffers.size(); ++i)
+ m_indexedShaderStorageBuffers[i] = buf0Binding;
+ }
+
+ addFreshFramebuffer(0);
+
+ m_initialized = true;
+}
+
+bool GLClientState::needsInitFromCaps() const {
+ return !m_initialized;
+}
+
+void GLClientState::setExtensions(const std::string& extensions) {
+ if (!m_extensions_set) m_extensions = extensions;
+
+ m_has_color_buffer_float_extension =
+ hasExtension("GL_EXT_color_buffer_float");
+ m_has_color_buffer_half_float_extension =
+ hasExtension("GL_EXT_color_buffer_half_float");
+ m_extensions_set = true;
+}
+
+bool GLClientState::hasExtension(const char* ext) const {
+ return m_extensions.find(ext) != std::string::npos;
+}
+
+using gfxstream::guest::AutoLock;
+using gfxstream::guest::Lock;
+
+// A process-wide fence registry (because we can use fence sync objects across multiple contexts)
+struct FenceRegistry {
+ Lock lock;
+ PredicateMap<uint64_t, false> existence;
+
+ void onFenceCreated(GLsync sync) {
+ AutoLock<Lock> scopedLock(lock);
+ uint64_t asUint64 = (uint64_t)(uintptr_t)(sync);
+ existence.add(asUint64);
+ existence.set(asUint64, true);
+ }
+
+ void onFenceDestroyed(GLsync sync) {
+ AutoLock<Lock> scopedLock(lock);
+ uint64_t asUint64 = (uint64_t)(uintptr_t)(sync);
+ existence.remove(asUint64);
+ }
+
+ bool exists(GLsync sync) {
+ AutoLock<Lock> scopedLock(lock);
+ uint64_t asUint64 = (uint64_t)(uintptr_t)(sync);
+ return existence.get(asUint64);
+ }
+};
+
+static FenceRegistry sFenceRegistry;
+
+void GLClientState::onFenceCreated(GLsync sync) {
+ sFenceRegistry.onFenceCreated(sync);
+}
+
+void GLClientState::onFenceDestroyed(GLsync sync) {
+ sFenceRegistry.onFenceDestroyed(sync);
+}
+
+bool GLClientState::fenceExists(GLsync sync) {
+ return sFenceRegistry.exists(sync);
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglCodecCommon/GLESTextureUtils.cpp b/src/gfxstream/guest/OpenglCodecCommon/GLESTextureUtils.cpp
new file mode 100644
index 00000000000..14b8a7c3a51
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/GLESTextureUtils.cpp
@@ -0,0 +1,657 @@
+#include "GLESTextureUtils.h"
+
+#include <algorithm>
+
+#include "glUtils.h"
+#include "gfxstream/etc.h"
+#include "astc-codec.h"
+
+#include <cutils/log.h>
+
+#define ASTC_FORMATS_LIST(EXPAND_MACRO) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_4x4_KHR, astc_codec::FootprintType::k4x4, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_5x4_KHR, astc_codec::FootprintType::k5x4, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_5x5_KHR, astc_codec::FootprintType::k5x5, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_6x5_KHR, astc_codec::FootprintType::k6x5, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_6x6_KHR, astc_codec::FootprintType::k6x6, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_8x5_KHR, astc_codec::FootprintType::k8x5, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_8x6_KHR, astc_codec::FootprintType::k8x6, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_8x8_KHR, astc_codec::FootprintType::k8x8, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_10x5_KHR, astc_codec::FootprintType::k10x5, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_10x6_KHR, astc_codec::FootprintType::k10x6, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_10x8_KHR, astc_codec::FootprintType::k10x8, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_10x10_KHR, astc_codec::FootprintType::k10x10, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_12x10_KHR, astc_codec::FootprintType::k12x10, false) \
+ EXPAND_MACRO(GL_COMPRESSED_RGBA_ASTC_12x12_KHR, astc_codec::FootprintType::k12x12, false) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, astc_codec::FootprintType::k4x4, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, astc_codec::FootprintType::k5x4, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, astc_codec::FootprintType::k5x5, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, astc_codec::FootprintType::k6x5, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, astc_codec::FootprintType::k6x6, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, astc_codec::FootprintType::k8x5, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, astc_codec::FootprintType::k8x6, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, astc_codec::FootprintType::k8x8, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, astc_codec::FootprintType::k10x5, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, astc_codec::FootprintType::k10x6, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, astc_codec::FootprintType::k10x8, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, astc_codec::FootprintType::k10x10, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, astc_codec::FootprintType::k12x10, true) \
+ EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, astc_codec::FootprintType::k12x12, true) \
+
+namespace GLESTextureUtils {
+
+// Based on computations in
+// https://swiftshader.googlesource.com/SwiftShader/+/master/src/OpenGL/common/Image.cpp
+// such as Image::loadImageData,
+// ComputePitch/ComputePackingOffset
+
+#define HIGHEST_MULTIPLE_OF(align, x) \
+ (( ( x ) + ( align ) - 1) & ~( ( align ) - 1)) \
+
+static int computePixelSize(GLenum format, GLenum type) {
+
+#define FORMAT_ERROR(format, type) \
+ ALOGE("%s:%d unknown format/type 0x%x 0x%x", __FUNCTION__, __LINE__, format, type) \
+
+ switch(type) {
+ case GL_BYTE:
+ switch(format) {
+ case GL_R8:
+ case GL_R8I:
+ case GL_R8_SNORM:
+ case GL_RED: return sizeof(char);
+ case GL_RED_INTEGER: return sizeof(char);
+ case GL_RG8:
+ case GL_RG8I:
+ case GL_RG8_SNORM:
+ case GL_RG: return sizeof(char) * 2;
+ case GL_RG_INTEGER: return sizeof(char) * 2;
+ case GL_RGB8:
+ case GL_RGB8I:
+ case GL_RGB8_SNORM:
+ case GL_RGB: return sizeof(char) * 3;
+ case GL_RGB_INTEGER: return sizeof(char) * 3;
+ case GL_RGBA8:
+ case GL_RGBA8I:
+ case GL_RGBA8_SNORM:
+ case GL_RGBA: return sizeof(char) * 4;
+ case GL_RGBA_INTEGER: return sizeof(char) * 4;
+ default: FORMAT_ERROR(format, type);
+ }
+ break;
+ case GL_UNSIGNED_BYTE:
+ switch(format) {
+ case GL_R8:
+ case GL_R8UI:
+ case GL_RED: return sizeof(unsigned char);
+ case GL_RED_INTEGER: return sizeof(unsigned char);
+ case GL_ALPHA8_EXT:
+ case GL_ALPHA: return sizeof(unsigned char);
+ case GL_LUMINANCE8_EXT:
+ case GL_LUMINANCE: return sizeof(unsigned char);
+ case GL_LUMINANCE8_ALPHA8_EXT:
+ case GL_LUMINANCE_ALPHA: return sizeof(unsigned char) * 2;
+ case GL_RG8:
+ case GL_RG8UI:
+ case GL_RG: return sizeof(unsigned char) * 2;
+ case GL_RG_INTEGER: return sizeof(unsigned char) * 2;
+ case GL_RGB8:
+ case GL_RGB8UI:
+ case GL_SRGB8:
+ case GL_RGB: return sizeof(unsigned char) * 3;
+ case GL_RGB_INTEGER: return sizeof(unsigned char) * 3;
+ case GL_RGBA8:
+ case GL_RGBA8UI:
+ case GL_SRGB8_ALPHA8:
+ case GL_RGBA: return sizeof(unsigned char) * 4;
+ case GL_RGBA_INTEGER: return sizeof(unsigned char) * 4;
+ case GL_BGRA_EXT:
+ case GL_BGRA8_EXT: return sizeof(unsigned char)* 4;
+ default: FORMAT_ERROR(format, type);
+ }
+ break;
+ case GL_SHORT:
+ switch(format) {
+ case GL_R16I:
+ case GL_RED_INTEGER: return sizeof(short);
+ case GL_RG16I:
+ case GL_RG_INTEGER: return sizeof(short) * 2;
+ case GL_RGB16I:
+ case GL_RGB_INTEGER: return sizeof(short) * 3;
+ case GL_RGBA16I:
+ case GL_RGBA_INTEGER: return sizeof(short) * 4;
+ default: FORMAT_ERROR(format, type);
+ }
+ break;
+ case GL_UNSIGNED_SHORT:
+ switch(format) {
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT: return sizeof(unsigned short);
+ case GL_R16UI:
+ case GL_RED_INTEGER: return sizeof(unsigned short);
+ case GL_RG16UI:
+ case GL_RG_INTEGER: return sizeof(unsigned short) * 2;
+ case GL_RGB16UI:
+ case GL_RGB_INTEGER: return sizeof(unsigned short) * 3;
+ case GL_RGBA16UI:
+ case GL_RGBA_INTEGER: return sizeof(unsigned short) * 4;
+ default: FORMAT_ERROR(format, type);
+ }
+ break;
+ case GL_INT:
+ switch(format) {
+ case GL_R32I:
+ case GL_RED_INTEGER: return sizeof(int);
+ case GL_RG32I:
+ case GL_RG_INTEGER: return sizeof(int) * 2;
+ case GL_RGB32I:
+ case GL_RGB_INTEGER: return sizeof(int) * 3;
+ case GL_RGBA32I:
+ case GL_RGBA_INTEGER: return sizeof(int) * 4;
+ default: FORMAT_ERROR(format, type);
+ }
+ break;
+ case GL_UNSIGNED_INT:
+ switch(format) {
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32_OES:
+ case GL_DEPTH_COMPONENT: return sizeof(unsigned int);
+ case GL_R32UI:
+ case GL_RED_INTEGER: return sizeof(unsigned int);
+ case GL_RG32UI:
+ case GL_RG_INTEGER: return sizeof(unsigned int) * 2;
+ case GL_RGB32UI:
+ case GL_RGB_INTEGER: return sizeof(unsigned int) * 3;
+ case GL_RGBA32UI:
+ case GL_RGBA_INTEGER: return sizeof(unsigned int) * 4;
+ default: FORMAT_ERROR(format, type);
+ }
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
+ return sizeof(unsigned short);
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_24_8_OES:
+ return sizeof(unsigned int);
+ case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+ return sizeof(float) + sizeof(unsigned int);
+ case GL_FLOAT:
+ switch(format) {
+ case GL_DEPTH_COMPONENT32F:
+ case GL_DEPTH_COMPONENT: return sizeof(float);
+ case GL_ALPHA32F_EXT:
+ case GL_ALPHA: return sizeof(float);
+ case GL_LUMINANCE32F_EXT:
+ case GL_LUMINANCE: return sizeof(float);
+ case GL_LUMINANCE_ALPHA32F_EXT:
+ case GL_LUMINANCE_ALPHA: return sizeof(float) * 2;
+ case GL_RED: return sizeof(float);
+ case GL_R32F: return sizeof(float);
+ case GL_RG: return sizeof(float) * 2;
+ case GL_RG32F: return sizeof(float) * 2;
+ case GL_RGB: return sizeof(float) * 3;
+ case GL_RGB32F: return sizeof(float) * 3;
+ case GL_RGBA: return sizeof(float) * 4;
+ case GL_RGBA32F: return sizeof(float) * 4;
+ default: FORMAT_ERROR(format, type);
+ }
+ break;
+ case GL_HALF_FLOAT:
+ case GL_HALF_FLOAT_OES:
+ switch(format) {
+ case GL_ALPHA16F_EXT:
+ case GL_ALPHA: return sizeof(unsigned short);
+ case GL_LUMINANCE16F_EXT:
+ case GL_LUMINANCE: return sizeof(unsigned short);
+ case GL_LUMINANCE_ALPHA16F_EXT:
+ case GL_LUMINANCE_ALPHA: return sizeof(unsigned short) * 2;
+ case GL_RED: return sizeof(unsigned short);
+ case GL_R16F: return sizeof(unsigned short);
+ case GL_RG: return sizeof(unsigned short) * 2;
+ case GL_RG16F: return sizeof(unsigned short) * 2;
+ case GL_RGB: return sizeof(unsigned short) * 3;
+ case GL_RGB16F: return sizeof(unsigned short) * 3;
+ case GL_RGBA: return sizeof(unsigned short) * 4;
+ case GL_RGBA16F: return sizeof(unsigned short) * 4;
+ default: FORMAT_ERROR(format, type);
+ }
+ break;
+ default: FORMAT_ERROR(format, type);
+ }
+
+ return 0;
+}
+
+static int computePitch(GLsizei inputWidth, GLenum format, GLenum type, int align) {
+ GLsizei unaligned_width = computePixelSize(format, type) * inputWidth;
+ return HIGHEST_MULTIPLE_OF(align, unaligned_width);
+}
+
+static int computePackingOffset(GLenum format, GLenum type, GLsizei width, GLsizei height, int align, int skipPixels, int skipRows, int skipImages) {
+ GLsizei alignedPitch = computePitch(width, format, type, align);
+ int packingOffsetRows =
+ (skipImages * height + skipRows);
+ int res = packingOffsetRows * alignedPitch + skipPixels * computePixelSize(format, type);
+
+ return res;
+}
+
+void computeTextureStartEnd(
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ int unpackAlignment,
+ int unpackRowLength,
+ int unpackImageHeight,
+ int unpackSkipPixels,
+ int unpackSkipRows,
+ int unpackSkipImages,
+ int* start,
+ int* end,
+ int ignoreTrailing) {
+
+ GLsizei inputWidth = (unpackRowLength == 0) ? width : unpackRowLength;
+ GLsizei inputPitch = computePitch(inputWidth, format, type, unpackAlignment);
+ GLsizei inputHeight = (unpackImageHeight == 0) ? height : unpackImageHeight;
+
+ ALOGV("%s: input idim %d %d %d w p h %d %d %d:", __FUNCTION__, width, height, depth, inputWidth, inputPitch, inputHeight);
+
+ int startVal = computePackingOffset(format, type, inputWidth, inputHeight, unpackAlignment, unpackSkipPixels, unpackSkipRows, unpackSkipImages);
+ int endVal;
+ if (ignoreTrailing) {
+ // The last row needs to have just enough data per spec, and could
+ // ignore alignment.
+ // b/223402256
+ endVal = startVal + inputPitch * inputHeight * (depth - 1);
+ endVal += inputPitch * (std::min(height, inputHeight) - 1);
+ endVal += computePitch(std::min(width, inputWidth), format, type, 1);
+ } else {
+ endVal = startVal + inputPitch * inputHeight * depth;
+ }
+
+ if (start) *start = startVal;
+ if (end) *end = endVal;
+
+ ALOGV("%s: start/end: %d %d", __FUNCTION__, *start, *end);
+
+}
+
+int computeTotalImageSize(
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ int unpackAlignment,
+ int unpackRowLength,
+ int unpackImageHeight,
+ int unpackSkipPixels,
+ int unpackSkipRows,
+ int unpackSkipImages) {
+
+ int start, end;
+ computeTextureStartEnd(
+ width, height, depth,
+ format, type,
+ unpackAlignment,
+ unpackRowLength,
+ unpackImageHeight,
+ unpackSkipPixels,
+ unpackSkipRows,
+ unpackSkipImages,
+ &start,
+ &end,
+ 0);
+ return end;
+}
+
+int computeNeededBufferSize(
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ int unpackAlignment,
+ int unpackRowLength,
+ int unpackImageHeight,
+ int unpackSkipPixels,
+ int unpackSkipRows,
+ int unpackSkipImages,
+ int ignoreTrailing) {
+
+ int start, end;
+ computeTextureStartEnd(
+ width, height, depth,
+ format, type,
+ unpackAlignment,
+ unpackRowLength,
+ unpackImageHeight,
+ unpackSkipPixels,
+ unpackSkipRows,
+ unpackSkipImages,
+ &start,
+ &end,
+ ignoreTrailing);
+ return end - start;
+}
+
+void computePackingOffsets2D(
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ int packAlignment,
+ int packRowLength,
+ int packSkipPixels,
+ int packSkipRows,
+ int* bpp,
+ int* startOffset,
+ int* packingPixelRowSize,
+ int* packingTotalRowSize) {
+
+ int widthTotal = (packRowLength == 0) ? width : packRowLength;
+ int totalRowSize = computePitch(widthTotal, format, type, packAlignment);
+ int pixelsOnlyRowSize = computePitch(width, format, type, packAlignment);
+
+ int packingOffsetStart =
+ computePackingOffset(
+ format, type, widthTotal, height, packAlignment, packSkipPixels, packSkipRows, 0 /* skip images = 0 */);
+
+ if (bpp) *bpp = computePixelSize(format, type);
+ if (startOffset) *startOffset = packingOffsetStart;
+ if (packingPixelRowSize) *packingPixelRowSize = pixelsOnlyRowSize;
+ if (packingTotalRowSize) *packingTotalRowSize = totalRowSize;
+}
+
+void computePackingOffsets3D(
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ int packAlignment,
+ int packRowLength,
+ int packImageHeight,
+ int packSkipPixels,
+ int packSkipRows,
+ int packSkipImages,
+ int* bpp,
+ int* startOffset,
+ int* packingPixelRowSize,
+ int* packingTotalRowSize,
+ int* packingPixelImageSize,
+ int* packingTotalImageSize) {
+
+ (void)depth;
+
+ int widthTotal = (packRowLength == 0) ? width : packRowLength;
+ int totalRowSize = computePitch(widthTotal, format, type, packAlignment);
+ int pixelsOnlyRowSize = computePitch(width, format, type, packAlignment);
+
+ int heightTotal = packImageHeight == 0 ? height : packImageHeight;
+ int totalImageSize = totalRowSize * heightTotal;
+ int pixelsOnlyImageSize = totalRowSize * height;
+
+ int packingOffsetStart =
+ computePackingOffset(
+ format, type, widthTotal, heightTotal, packAlignment, packSkipPixels, packSkipRows, packSkipImages);
+
+ if (bpp) *bpp = computePixelSize(format, type);
+ if (startOffset) *startOffset = packingOffsetStart;
+ if (packingPixelRowSize) *packingPixelRowSize = pixelsOnlyRowSize;
+ if (packingTotalRowSize) *packingTotalRowSize = totalRowSize;
+ if (packingPixelImageSize) *packingPixelImageSize = pixelsOnlyImageSize;
+ if (packingTotalImageSize) *packingTotalImageSize = totalImageSize;
+}
+
+bool isEtcFormat(GLenum internalformat) {
+ switch (internalformat) {
+ case GL_ETC1_RGB8_OES:
+ case GL_COMPRESSED_RGB8_ETC2:
+ case GL_COMPRESSED_SRGB8_ETC2:
+ case GL_COMPRESSED_RGBA8_ETC2_EAC:
+ case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
+ case GL_COMPRESSED_R11_EAC:
+ case GL_COMPRESSED_SIGNED_R11_EAC:
+ case GL_COMPRESSED_RG11_EAC:
+ case GL_COMPRESSED_SIGNED_RG11_EAC:
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+ return true;
+ }
+ return false;
+}
+
+bool isEtc2Format(GLenum internalformat) {
+ return internalformat != GL_ETC1_RGB8_OES &&
+ isEtcFormat(internalformat);
+}
+
+ETC2ImageFormat getEtcFormat(GLenum internalformat) {
+ ETC2ImageFormat etcFormat = EtcRGB8;
+ switch (internalformat) {
+ case GL_COMPRESSED_RGB8_ETC2:
+ case GL_ETC1_RGB8_OES:
+ break;
+ case GL_COMPRESSED_RGBA8_ETC2_EAC:
+ etcFormat = EtcRGBA8;
+ break;
+ case GL_COMPRESSED_SRGB8_ETC2:
+ break;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
+ etcFormat = EtcRGBA8;
+ break;
+ case GL_COMPRESSED_R11_EAC:
+ etcFormat = EtcR11;
+ break;
+ case GL_COMPRESSED_SIGNED_R11_EAC:
+ etcFormat = EtcSignedR11;
+ break;
+ case GL_COMPRESSED_RG11_EAC:
+ etcFormat = EtcRG11;
+ break;
+ case GL_COMPRESSED_SIGNED_RG11_EAC:
+ etcFormat = EtcSignedRG11;
+ break;
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+ etcFormat = EtcRGB8A1;
+ break;
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+ etcFormat = EtcRGB8A1;
+ break;
+ }
+ return etcFormat;
+}
+
+bool isAstcFormat(GLenum internalformat) {
+ switch (internalformat) {
+#define ASTC_FORMAT(typeName, footprintType, srgbValue) \
+ case typeName:
+
+ ASTC_FORMATS_LIST(ASTC_FORMAT)
+#undef ASTC_FORMAT
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool isBptcFormat(GLenum internalformat) {
+ switch (internalformat) {
+ case GL_COMPRESSED_RGBA_BPTC_UNORM_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:
+ case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT:
+ case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool isRgtcFormat(GLenum internalformat) {
+ switch(internalformat)
+ {
+ case GL_COMPRESSED_RED_RGTC1_EXT:
+ case GL_COMPRESSED_SIGNED_RED_RGTC1_EXT:
+ case GL_COMPRESSED_RED_GREEN_RGTC2_EXT:
+ case GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:
+ return true;
+ }
+ return false;
+}
+
+bool isS3tcFormat(GLenum internalformat) {
+ switch (internalformat) {
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
+ return true;
+ }
+
+ return false;
+}
+
+void getAstcFormatInfo(GLenum internalformat,
+ astc_codec::FootprintType* footprint,
+ bool* srgb) {
+ switch (internalformat) {
+#define ASTC_FORMAT(typeName, footprintType, srgbValue) \
+ case typeName: \
+ *footprint = footprintType; *srgb = srgbValue; break; \
+
+ ASTC_FORMATS_LIST(ASTC_FORMAT)
+#undef ASTC_FORMAT
+ default:
+ ALOGE("%s: invalid astc format: 0x%x\n", __func__, internalformat);
+ abort();
+ }
+}
+
+int getAstcFootprintWidth(astc_codec::FootprintType footprint) {
+ switch (footprint) {
+ case astc_codec::FootprintType::k4x4: return 4;
+ case astc_codec::FootprintType::k5x4: return 5;
+ case astc_codec::FootprintType::k5x5: return 5;
+ case astc_codec::FootprintType::k6x5: return 6;
+ case astc_codec::FootprintType::k6x6: return 6;
+ case astc_codec::FootprintType::k8x5: return 8;
+ case astc_codec::FootprintType::k8x6: return 8;
+ case astc_codec::FootprintType::k10x5: return 10;
+ case astc_codec::FootprintType::k10x6: return 10;
+ case astc_codec::FootprintType::k8x8: return 8;
+ case astc_codec::FootprintType::k10x8: return 10;
+ case astc_codec::FootprintType::k10x10: return 10;
+ case astc_codec::FootprintType::k12x10: return 12;
+ case astc_codec::FootprintType::k12x12: return 12;
+ default:
+ ALOGE("%s: invalid astc footprint: 0x%x\n", __func__, footprint);
+ abort();
+ }
+}
+
+int getAstcFootprintHeight(astc_codec::FootprintType footprint) {
+ switch (footprint) {
+ case astc_codec::FootprintType::k4x4: return 4;
+ case astc_codec::FootprintType::k5x4: return 4;
+ case astc_codec::FootprintType::k5x5: return 5;
+ case astc_codec::FootprintType::k6x5: return 5;
+ case astc_codec::FootprintType::k6x6: return 6;
+ case astc_codec::FootprintType::k8x5: return 5;
+ case astc_codec::FootprintType::k8x6: return 6;
+ case astc_codec::FootprintType::k10x5: return 5;
+ case astc_codec::FootprintType::k10x6: return 6;
+ case astc_codec::FootprintType::k8x8: return 8;
+ case astc_codec::FootprintType::k10x8: return 8;
+ case astc_codec::FootprintType::k10x10: return 10;
+ case astc_codec::FootprintType::k12x10: return 10;
+ case astc_codec::FootprintType::k12x12: return 12;
+ default:
+ ALOGE("%s: invalid astc footprint: 0x%x\n", __func__, footprint);
+ abort();
+ }
+}
+
+GLsizei getAstcCompressedSize(GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, bool* error) {
+ bool srgb;
+ astc_codec::FootprintType footprintType;
+ getAstcFormatInfo(internalformat, &footprintType, &srgb);
+
+ int fpWidth = getAstcFootprintWidth(footprintType);
+ int fpHeight = getAstcFootprintHeight(footprintType);
+
+ if (width == 0 || height == 0 || depth == 0) {
+ *error = true;
+ return 0;
+ }
+
+ const size_t blocks_wide = (width + fpWidth - 1) / fpWidth;
+ if (blocks_wide == 0) {
+ *error = true;
+ return 0;
+ }
+
+ const size_t expected_block_count =
+ ((width + fpWidth - 1) / fpWidth) *
+ ((height + fpHeight - 1) / fpHeight);
+
+ const size_t kPhysBlockSizeBytes = 16;
+
+ GLsizei res = kPhysBlockSizeBytes * expected_block_count * depth;
+
+ return res;
+}
+
+GLsizei getCompressedImageBlocksize(GLenum internalformat) {
+ if (isBptcFormat(internalformat)) {
+ return 16;
+ }
+
+ switch (internalformat) {
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RED_RGTC1_EXT:
+ case GL_COMPRESSED_SIGNED_RED_RGTC1_EXT:
+ return 8;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
+ case GL_COMPRESSED_RED_GREEN_RGTC2_EXT:
+ case GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:
+ return 16;
+ }
+
+ ALOGE("%s: Unknown blocksize for internal format: 0x%x\n", __func__, internalformat);
+ abort();
+}
+
+GLsizei get4x4CompressedSize(GLsizei width, GLsizei height, GLsizei depth, GLsizei blocksize, bool* error) {
+ *error = false;
+ return blocksize * ((width + 3) / 4) * ((height + 3) / 4) * depth;
+}
+
+GLsizei getCompressedImageSize(GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, bool* error) {
+ if (isEtcFormat(internalformat)) {
+ GLsizei total = 0;
+ GLsizei one = etc_get_encoded_data_size(getEtcFormat(internalformat), width, height);
+ for (GLsizei i = 0; i < depth; ++i) {
+ total += one;
+ }
+ return total;
+ }
+
+ if (isAstcFormat(internalformat)) {
+ return getAstcCompressedSize(internalformat, width, height, depth, error);
+ }
+
+ if (isBptcFormat(internalformat) || isS3tcFormat(internalformat) || isRgtcFormat(internalformat)) {
+ GLsizei blocksize = getCompressedImageBlocksize(internalformat);
+ return get4x4CompressedSize(width, height, depth, blocksize, error);
+ }
+
+ ALOGE("%s: Unknown compressed internal format: 0x%x\n", __func__, internalformat);
+ abort();
+}
+
+} // namespace GLESTextureUtils
diff --git a/src/gfxstream/guest/OpenglCodecCommon/GLESTextureUtils.h b/src/gfxstream/guest/OpenglCodecCommon/GLESTextureUtils.h
new file mode 100644
index 00000000000..45af27e9d99
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/GLESTextureUtils.h
@@ -0,0 +1,92 @@
+#ifndef GLES_TEXTURE_UTILS_H
+#define GLES_TEXTURE_UTILS_H
+
+#include <GLES3/gl31.h>
+
+namespace GLESTextureUtils {
+
+// By spec, the buffer is only required to provide just enough data. The
+// last row does not have to fill unpackRowLength. But our decoder is
+// written to always read full row. So we add "ignoreTrailing" here. When
+// ignoreTrailing == 1 we compute the real size as defined by spec. When
+// ignoreTrailing == 0 we compute the size used by decoder/encoder.
+void computeTextureStartEnd(
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ int unpackAlignment,
+ int unpackRowLength,
+ int unpackImageHeight,
+ int unpackSkipPixels,
+ int unpackSkipRows,
+ int unpackSkipImages,
+ int* start,
+ int* end,
+ int ignoreTrailing);
+
+int computeTotalImageSize(
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ int unpackAlignment,
+ int unpackRowLength,
+ int unpackImageHeight,
+ int unpackSkipPixels,
+ int unpackSkipRows,
+ int unpackSkipImages);
+
+int computeNeededBufferSize(
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ int unpackAlignment,
+ int unpackRowLength,
+ int unpackImageHeight,
+ int unpackSkipPixels,
+ int unpackSkipRows,
+ int unpackSkipImages,
+ int ignoreTrailing);
+
+// Writes out |height| offsets for glReadPixels to read back
+// data in separate rows of pixels. Returns:
+// 1. |startOffset|: offset in bytes to apply at the beginning
+// 2. |packingPixelRowSize|: the buffer size in bytes that has the actual pixels per row.
+// 2. |packingTotalRowSize|: the length in bytes of each row including the padding from row length.
+void computePackingOffsets2D(
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ int packAlignment,
+ int packRowLength,
+ int packSkipPixels,
+ int packSkipRows,
+ int* bpp,
+ int* startOffset,
+ int* packingPixelRowSize,
+ int* packingTotalRowSize);
+
+// For processing 3D textures exactly to the sizes of client buffers.
+void computePackingOffsets3D(
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ int packAlignment,
+ int packRowLength,
+ int packImageHeight,
+ int packSkipPixels,
+ int packSkipRows,
+ int packSkipImages,
+ int* bpp,
+ int* startOffset,
+ int* packingPixelRowSize,
+ int* packingTotalRowSize,
+ int* packingPixelImageSize,
+ int* packingTotalImageSize);
+
+// For calculating compressed sizes of ETC/EAC formatted images in the guest.
+GLsizei getCompressedImageSize(GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, bool* error);
+
+// Format queries
+bool isEtc2Format(GLenum internalformat);
+bool isAstcFormat(GLenum internalformat);
+bool isBptcFormat(GLenum internalformat);
+bool isS3tcFormat(GLenum internalformat);
+bool isRgtcFormat(GLenum internalformat);
+
+} // namespace GLESTextureUtils
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/GLSharedGroup.cpp b/src/gfxstream/guest/OpenglCodecCommon/GLSharedGroup.cpp
new file mode 100755
index 00000000000..da3de64bda3
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/GLSharedGroup.cpp
@@ -0,0 +1,939 @@
+/*
+* 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 "gfxstream/guest/GLSharedGroup.h"
+
+#include "KeyedVectorUtils.h"
+#include "glUtils.h"
+
+namespace gfxstream {
+namespace guest {
+
+/**** BufferData ****/
+
+BufferData::BufferData() : m_size(0), m_usage(0), m_mapped(false) {};
+
+BufferData::BufferData(GLsizeiptr size, const void* data) :
+ m_size(size), m_usage(0), m_mapped(false) {
+
+ if (size > 0) {
+ m_fixedBuffer.resize(size);
+ }
+
+ if (data) {
+ memcpy(m_fixedBuffer.data(), data, size);
+ }
+}
+
+/**** ProgramData ****/
+ProgramData::ProgramData() : m_numIndexes(0),
+ m_numAttributes(0),
+ m_initialized(false) {
+ m_Indexes = NULL;
+ m_attribIndexes = NULL;
+ m_refcount = 1;
+ m_linkStatus = 0;
+ m_activeUniformBlockCount = 0;
+ m_transformFeedbackVaryingsCount = 0;
+}
+
+void ProgramData::initProgramData(GLuint numIndexes, GLuint numAttributes) {
+ m_initialized = true;
+ m_numIndexes = numIndexes;
+ m_numAttributes = numAttributes;
+
+ delete [] m_Indexes;
+ delete [] m_attribIndexes;
+
+ m_Indexes = new IndexInfo[numIndexes];
+ m_attribIndexes = new AttribInfo[m_numAttributes];
+}
+
+bool ProgramData::isInitialized() {
+ return m_initialized;
+}
+
+ProgramData::~ProgramData() {
+
+ delete [] m_Indexes;
+ delete [] m_attribIndexes;
+
+ m_Indexes = NULL;
+}
+
+void ProgramData::setIndexInfo(
+ GLuint index, GLint base, GLint size, GLenum type) {
+
+ if (index >= m_numIndexes) return;
+
+ m_Indexes[index].base = base;
+ m_Indexes[index].size = size;
+ m_Indexes[index].type = type;
+ m_Indexes[index].hostLocsPerElement = 1;
+ m_Indexes[index].flags = 0;
+ m_Indexes[index].samplerValue = 0;
+}
+
+void ProgramData::setAttribInfo(
+ GLuint index, GLint attribLoc, GLint size, GLenum type) {
+
+ if (index >= m_numAttributes) return;
+
+ m_attribIndexes[index].attribLoc = attribLoc;
+ m_attribIndexes[index].size = size;
+ m_attribIndexes[index].type = type;
+}
+
+void ProgramData::setIndexFlags(GLuint index, GLuint flags) {
+
+ if (index >= m_numIndexes) return;
+
+ m_Indexes[index].flags |= flags;
+}
+
+GLuint ProgramData::getIndexForLocation(GLint location) {
+ GLuint index = m_numIndexes;
+
+ GLint minDist = -1;
+
+ for (GLuint i = 0; i < m_numIndexes; ++i) {
+ GLint dist = location - m_Indexes[i].base;
+ if (dist >= 0 && (minDist < 0 || dist < minDist)) {
+ index = i;
+ minDist = dist;
+ }
+ }
+
+ return index;
+}
+
+GLenum ProgramData::getTypeForLocation(GLint location) {
+ GLuint index = getIndexForLocation(location);
+ if (index < m_numIndexes) {
+ return m_Indexes[index].type;
+ }
+ return 0;
+}
+
+bool ProgramData::isValidUniformLocation(GLint location) {
+ for (GLuint i = 0; i < m_numIndexes; ++i) {
+ if (location >= m_Indexes[i].base &&
+ location < m_Indexes[i].base + m_Indexes[i].size)
+ return true;
+ }
+
+ return false;
+}
+
+GLint ProgramData::getNextSamplerUniform(
+ GLint index, GLint* val, GLenum* target) {
+
+ for (GLint i = index + 1; i >= 0 && i < (GLint)m_numIndexes; i++) {
+
+ if (m_Indexes[i].type == GL_SAMPLER_2D) {
+
+ if (val) *val = m_Indexes[i].samplerValue;
+
+ if (target) {
+ if (m_Indexes[i].flags & INDEX_FLAG_SAMPLER_EXTERNAL) {
+ *target = GL_TEXTURE_EXTERNAL_OES;
+ } else {
+ *target = GL_TEXTURE_2D;
+ }
+ }
+
+ return i;
+ }
+
+ }
+
+ return -1;
+}
+
+bool ProgramData::setSamplerUniform(GLint appLoc, GLint val, GLenum* target) {
+
+ for (GLuint i = 0; i < m_numIndexes; i++) {
+
+ GLint elemIndex = appLoc - m_Indexes[i].base;
+
+ if (elemIndex >= 0 && elemIndex < m_Indexes[i].size) {
+ if (m_Indexes[i].type == GL_SAMPLER_2D) {
+ m_Indexes[i].samplerValue = val;
+ if (target) {
+ if (m_Indexes[i].flags & INDEX_FLAG_SAMPLER_EXTERNAL) {
+ *target = GL_TEXTURE_EXTERNAL_OES;
+ } else {
+ *target = GL_TEXTURE_2D;
+
+ }
+ }
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool ProgramData::attachShader(GLuint shader, GLenum shaderType) {
+ size_t n = m_shaders.size();
+
+ for (size_t i = 0; i < n; i++) {
+ if (m_shaders[i] == shader) {
+ return false;
+ } else if (m_shaderTypes[i] == shaderType) {
+ return false;
+ }
+ }
+ m_shaders.push_back(shader);
+ m_shaderTypes.push_back(shaderType);
+ return true;
+}
+
+bool ProgramData::detachShader(GLuint shader) {
+ size_t n = m_shaders.size();
+
+ for (size_t i = 0; i < n; i++) {
+ if (m_shaders[i] == shader) {
+ m_shaders.erase(m_shaders.begin() + i);
+ m_shaderTypes.erase(m_shaderTypes.begin() + i);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+UniformValidationInfo ProgramData::compileValidationInfo(bool* error) const {
+ UniformValidationInfo res;
+ if (!m_Indexes) {
+ *error = true;
+ return res;
+ }
+
+ for (GLuint i = 0; i < m_numIndexes; ++i) {
+ if (m_Indexes[i].base < 0) continue;
+
+ UniformLocationInfo info = {
+ .valid = true,
+ .columns = getColumnsOfType(m_Indexes[i].type),
+ .rows = getRowsOfType(m_Indexes[i].type),
+ .isSampler = isSamplerType(m_Indexes[i].type),
+ .isInt = isIntegerType(m_Indexes[i].type),
+ .isArray = m_Indexes[i].size > 1,
+ .isUnsigned = isUnsignedIntType(m_Indexes[i].type),
+ .isBool = isBoolType(m_Indexes[i].type),
+ };
+ for (GLuint j = 0; j < m_Indexes[i].size; ++j) {
+ res.add(m_Indexes[i].base + j, info);
+ }
+ }
+
+ return res;
+}
+
+AttribValidationInfo ProgramData::compileAttribValidationInfo(bool* error) const {
+ AttribValidationInfo res;
+ if (!m_attribIndexes) {
+ *error = true;
+ return res;
+ }
+
+ for (GLuint i = 0; i < m_numAttributes; ++i) {
+ if (m_attribIndexes[i].attribLoc < 0) continue;
+
+ AttribIndexInfo info = {
+ .validInProgram = true,
+ };
+
+ for (GLuint j = 0; j < getAttributeCountOfType(m_attribIndexes[i].type) * m_attribIndexes[i].size ; ++j) {
+ res.add(m_attribIndexes[i].attribLoc + j, info);
+ }
+ }
+
+ return res;
+}
+/***** GLSharedGroup ****/
+
+GLSharedGroup::GLSharedGroup() { }
+
+GLSharedGroup::~GLSharedGroup() {
+ m_buffers.clear();
+ m_programs.clear();
+ clearObjectMap(m_buffers);
+ clearObjectMap(m_programs);
+ clearObjectMap(m_shaders);
+ clearObjectMap(m_shaderPrograms);
+}
+
+bool GLSharedGroup::isShaderOrProgramObject(GLuint obj) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ return (findObjectOrDefault(m_shaders, obj) ||
+ findObjectOrDefault(m_programs, obj) ||
+ findObjectOrDefault(m_shaderPrograms, m_shaderProgramIdMap[obj]));
+}
+
+BufferData* GLSharedGroup::getBufferData(GLuint bufferId) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ return findObjectOrDefault(m_buffers, bufferId);
+}
+
+SharedTextureDataMap* GLSharedGroup::getTextureData() {
+ return &m_textureRecs;
+}
+
+RenderbufferInfo* GLSharedGroup::getRenderbufferInfo() {
+ return &m_renderbufferInfo;
+}
+
+SamplerInfo* GLSharedGroup::getSamplerInfo() {
+ return &m_samplerInfo;
+}
+
+void GLSharedGroup::addBufferData(GLuint bufferId, GLsizeiptr size, const void* data) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ m_buffers[bufferId] = new BufferData(size, data);
+}
+
+void GLSharedGroup::updateBufferData(GLuint bufferId, GLsizeiptr size, const void* data) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ BufferData* currentBuffer = findObjectOrDefault(m_buffers, bufferId);
+
+ if (currentBuffer) delete currentBuffer;
+
+ m_buffers[bufferId] = new BufferData(size, data);
+}
+
+void GLSharedGroup::setBufferUsage(GLuint bufferId, GLenum usage) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ BufferData* data = findObjectOrDefault(m_buffers, bufferId);
+
+ if (data) data->m_usage = usage;
+}
+
+void GLSharedGroup::setBufferMapped(GLuint bufferId, bool mapped) {
+ BufferData* buf = findObjectOrDefault(m_buffers, bufferId);
+
+ if (!buf) return;
+
+ buf->m_mapped = mapped;
+}
+
+GLenum GLSharedGroup::getBufferUsage(GLuint bufferId) {
+ BufferData* buf = findObjectOrDefault(m_buffers, bufferId);
+
+ if (!buf) return 0;
+
+ return buf->m_usage;
+}
+
+bool GLSharedGroup::isBufferMapped(GLuint bufferId) {
+ BufferData* buf = findObjectOrDefault(m_buffers, bufferId);
+
+ if (!buf) return false;
+
+ return buf->m_mapped;
+}
+
+GLenum GLSharedGroup::subUpdateBufferData(GLuint bufferId, GLintptr offset, GLsizeiptr size, const void* data) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ BufferData* buf = findObjectOrDefault(m_buffers, bufferId);
+
+ if ((!buf) || (buf->m_size < offset+size) || (offset < 0) || (size<0)) {
+ return GL_INVALID_VALUE;
+ }
+
+ memcpy(&buf->m_fixedBuffer[offset], data, size);
+
+ buf->m_indexRangeCache.invalidateRange((size_t)offset, (size_t)size);
+ return GL_NO_ERROR;
+}
+
+void GLSharedGroup::deleteBufferData(GLuint bufferId) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ BufferData* buf = findObjectOrDefault(m_buffers, bufferId);
+ if (buf) {
+ delete buf;
+ m_buffers.erase(bufferId);
+ }
+}
+
+void GLSharedGroup::addProgramData(GLuint program) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+ if (pData) {
+ delete pData;
+ }
+
+ m_programs[program] = new ProgramData();
+}
+
+void GLSharedGroup::initProgramData(GLuint program, GLuint numIndexes, GLuint numAttributes) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+ if (pData) {
+ pData->initProgramData(numIndexes, numAttributes);
+ }
+}
+
+void GLSharedGroup::refProgramData(GLuint program) {
+ AutoLock<Lock> _lock(m_lock);
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+ if (!pData) return;
+ pData->incRef();
+}
+
+void GLSharedGroup::onUseProgram(GLuint previous, GLuint next) {
+ if (previous == next) return;
+
+ AutoLock<Lock> _lock(m_lock);
+
+ if (previous) {
+ deleteProgramDataLocked(previous);
+ }
+
+ ProgramData* pData = findObjectOrDefault(m_programs, next);
+ if (!pData) return;
+ pData->incRef();
+}
+
+bool GLSharedGroup::isProgramInitialized(GLuint program) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+
+ if (pData) {
+ return pData->isInitialized();
+ }
+
+ if (m_shaderProgramIdMap.find(program) == m_shaderProgramIdMap.end()) {
+ return false;
+ }
+
+ ShaderProgramData* shaderProgramData =
+ findObjectOrDefault(m_shaderPrograms, m_shaderProgramIdMap[program]);
+
+ if (shaderProgramData) {
+ return shaderProgramData->programData.isInitialized();
+ }
+
+ return false;
+}
+
+void GLSharedGroup::deleteProgramData(GLuint program) {
+ AutoLock<Lock> _lock(m_lock);
+ deleteProgramDataLocked(program);
+}
+
+void GLSharedGroup::deleteProgramDataLocked(GLuint program) {
+
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+
+ if (pData && pData->decRef()) {
+ size_t numShaders = pData->getNumShaders();
+ for (size_t i = 0; i < numShaders; ++i) {
+ // changes the first one
+ detachShaderLocked(program, pData->getShader(0));
+ }
+ delete pData;
+ m_programs.erase(program);
+ }
+
+ if (m_shaderProgramIdMap.find(program) ==
+ m_shaderProgramIdMap.end()) return;
+
+ ShaderProgramData* spData =
+ findObjectOrDefault(
+ m_shaderPrograms, m_shaderProgramIdMap[program]);
+
+ if (spData) delete spData;
+
+ m_shaderPrograms.erase(m_shaderProgramIdMap[program]);
+ m_shaderProgramIdMap.erase(program);
+}
+
+// No such thing for separable shader programs.
+bool GLSharedGroup::attachShader(GLuint program, GLuint shader) {
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+ ShaderData* sData = findObjectOrDefault(m_shaders, shader);
+
+ bool res = false;
+
+ if (pData && sData) {
+ res = pData->attachShader(shader, sData->shaderType);
+ if (res) {
+ refShaderDataLocked(shader);
+ }
+ }
+
+ return res;
+}
+
+bool GLSharedGroup::detachShader(GLuint program, GLuint shader) {
+ AutoLock<Lock> _lock(m_lock);
+ return detachShaderLocked(program, shader);
+}
+
+bool GLSharedGroup::detachShaderLocked(GLuint program, GLuint shader) {
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+ ShaderData* sData = findObjectOrDefault(m_shaders, shader);
+
+ bool res = false;
+
+ if (pData && sData) {
+ res = pData->detachShader(shader);
+ if (res) {
+ unrefShaderDataLocked(shader);
+ }
+ }
+
+ return res;
+}
+
+// Not needed/used for separate shader programs.
+void GLSharedGroup::setProgramIndexInfo(
+ GLuint program, GLuint index, GLint base,
+ GLint size, GLenum type, const char* name) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+
+ if (pData) {
+ pData->setIndexInfo(index,base,size,type);
+ if (type == GL_SAMPLER_2D) {
+ size_t n = pData->getNumShaders();
+ for (size_t i = 0; i < n; i++) {
+ GLuint shaderId = pData->getShader(i);
+ ShaderData* shader = findObjectOrDefault(m_shaders, shaderId);
+ if (!shader) continue;
+ ShaderData::StringList::iterator nameIter =
+ shader->samplerExternalNames.begin();
+ ShaderData::StringList::iterator nameEnd =
+ shader->samplerExternalNames.end();
+ while (nameIter != nameEnd) {
+ if (*nameIter == name || *nameIter + "[0]" == name) {
+ pData->setIndexFlags(
+ index,
+ ProgramData::INDEX_FLAG_SAMPLER_EXTERNAL);
+ break;
+ }
+ ++nameIter;
+ }
+ }
+ }
+ }
+}
+
+void GLSharedGroup::setProgramAttribInfo(
+ GLuint program, GLuint index, GLint attribLoc,
+ GLint size, GLenum type, __attribute__((unused)) const char* name) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData = getProgramDataLocked(program);
+
+ if (pData) {
+ pData->setAttribInfo(index,attribLoc,size,type);
+ }
+}
+
+GLenum GLSharedGroup::getProgramUniformType(GLuint program, GLint location) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+ GLenum type = 0;
+
+ if (pData) {
+ type = pData->getTypeForLocation(location);
+ }
+
+ if (m_shaderProgramIdMap.find(program) ==
+ m_shaderProgramIdMap.end()) return type;
+
+ ShaderProgramData* spData =
+ findObjectOrDefault(
+ m_shaderPrograms, m_shaderProgramIdMap[program]);
+
+ if (spData) {
+ type = spData->programData.getTypeForLocation(location);
+ }
+
+ return type;
+}
+
+bool GLSharedGroup::isProgram(GLuint program) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+
+ if (pData) return true;
+
+ if (m_shaderProgramIdMap.find(program) ==
+ m_shaderProgramIdMap.end()) return false;
+
+ ShaderProgramData* spData =
+ findObjectOrDefault(m_shaderPrograms, m_shaderProgramIdMap[program]);
+
+ if (spData) return true;
+
+ return false;
+}
+
+GLint GLSharedGroup::getNextSamplerUniform(
+ GLuint program, GLint index, GLint* val, GLenum* target) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+
+ if (pData) return pData->getNextSamplerUniform(index, val, target);
+
+ if (m_shaderProgramIdMap.find(program) ==
+ m_shaderProgramIdMap.end()) return -1;
+
+ ShaderProgramData* spData =
+ findObjectOrDefault(
+ m_shaderPrograms,
+ findObjectOrDefault(m_shaderProgramIdMap, program));
+
+ if (spData) return spData->programData.getNextSamplerUniform(index, val, target);
+
+ return -1;
+}
+
+bool GLSharedGroup::setSamplerUniform(
+ GLuint program, GLint appLoc, GLint val, GLenum* target) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData =
+ findObjectOrDefault(m_programs, program);
+
+ if (pData) return pData->setSamplerUniform(appLoc, val, target);
+
+ if (m_shaderProgramIdMap.find(program) ==
+ m_shaderProgramIdMap.end()) return false;
+
+ ShaderProgramData* spData =
+ findObjectOrDefault(m_shaderPrograms, m_shaderProgramIdMap[program]);
+
+ if (spData) return spData->programData.setSamplerUniform(appLoc, val, target);
+
+ return false;
+}
+
+bool GLSharedGroup::isProgramUniformLocationValid(GLuint program, GLint location) {
+ if (location < 0) return false;
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData =
+ findObjectOrDefault(m_programs, program);
+
+ if (!pData) return false;
+
+ return pData->isValidUniformLocation(location);
+}
+
+bool GLSharedGroup::isShader(GLuint shader) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ShaderData* pData = findObjectOrDefault(m_shaders, shader);
+
+ return pData != NULL;
+}
+
+bool GLSharedGroup::addShaderData(GLuint shader, GLenum shaderType) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ShaderData* data = new ShaderData;
+
+ if (data) {
+ m_shaders[shader] = data;
+ data->refcount = 1;
+ data->shaderType = shaderType;
+ }
+
+ return data != NULL;
+}
+
+ShaderData* GLSharedGroup::getShaderData(GLuint shader) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ return findObjectOrDefault(m_shaders, shader);
+}
+
+void GLSharedGroup::unrefShaderData(GLuint shader) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ unrefShaderDataLocked(shader);
+}
+
+void GLSharedGroup::refShaderDataLocked(GLuint shaderId) {
+ ShaderData* data = findObjectOrDefault(m_shaders, shaderId);
+ data->refcount++;
+}
+
+void GLSharedGroup::unrefShaderDataLocked(GLuint shaderId) {
+ ShaderData* data = findObjectOrDefault(m_shaders, shaderId);
+
+ if (data && --data->refcount == 0) {
+
+ delete data;
+
+ m_shaders.erase(shaderId);
+ }
+}
+
+ProgramData* GLSharedGroup::getProgramDataLocked(GLuint program) {
+ // Check the space of normal programs, then separable ones
+ ProgramData* pData = findObjectOrDefault(m_programs, program);
+
+ if (pData) return pData;
+
+ std::map<GLuint, uint32_t>::const_iterator it =
+ m_shaderProgramIdMap.find(program);
+ if (it == m_shaderProgramIdMap.end()) return NULL;
+
+ ShaderProgramData* spData = findObjectOrDefault(m_shaderPrograms, it->second);
+ if (!spData) return NULL;
+ return &spData->programData;
+}
+
+uint32_t GLSharedGroup::addNewShaderProgramData() {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ShaderProgramData* data = new ShaderProgramData;
+ uint32_t currId = m_shaderProgramId;
+
+ m_shaderPrograms[currId] = data;
+ m_shaderProgramId++;
+ return currId;
+}
+
+void GLSharedGroup::associateGLShaderProgram(
+ GLuint shaderProgramName, uint32_t shaderProgramId) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ m_shaderProgramIdMap[shaderProgramName] = shaderProgramId;
+}
+
+ShaderProgramData* GLSharedGroup::getShaderProgramDataById(uint32_t id) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ShaderProgramData* res = findObjectOrDefault(m_shaderPrograms, id);
+
+ return res;
+}
+
+ShaderProgramData* GLSharedGroup::getShaderProgramData(
+ GLuint shaderProgramName) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ return findObjectOrDefault(m_shaderPrograms,
+ m_shaderProgramIdMap[shaderProgramName]);
+}
+
+void GLSharedGroup::deleteShaderProgramDataById(uint32_t id) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ShaderProgramData* data =
+ findObjectOrDefault(m_shaderPrograms, id);
+
+ delete data;
+
+ m_shaderPrograms.erase(id);
+}
+
+
+void GLSharedGroup::deleteShaderProgramData(GLuint shaderProgramName) {
+
+ AutoLock<Lock> _lock(m_lock);
+
+ uint32_t id = m_shaderProgramIdMap[shaderProgramName];
+ ShaderProgramData* data = findObjectOrDefault(m_shaderPrograms, id);
+
+ delete data;
+
+ m_shaderPrograms.erase(id);
+ m_shaderProgramIdMap.erase(shaderProgramName);
+}
+
+void GLSharedGroup::initShaderProgramData(GLuint shaderProgram, GLuint numIndices, GLuint numAttributes) {
+ ShaderProgramData* spData = getShaderProgramData(shaderProgram);
+ spData->programData.initProgramData(numIndices, numAttributes);
+}
+
+void GLSharedGroup::setShaderProgramIndexInfo(
+ GLuint shaderProgram, GLuint index, GLint base,
+ GLint size, GLenum type, const char* name) {
+
+ ShaderProgramData* spData = getShaderProgramData(shaderProgram);
+ ProgramData& pData = spData->programData;
+ ShaderData& sData = spData->shaderData;
+
+ pData.setIndexInfo(index, base, size, type);
+
+ if (type == GL_SAMPLER_2D) {
+
+ ShaderData::StringList::iterator nameIter =
+ sData.samplerExternalNames.begin();
+ ShaderData::StringList::iterator nameEnd =
+ sData.samplerExternalNames.end();
+
+ while (nameIter != nameEnd) {
+ if (*nameIter == name) {
+ pData.setIndexFlags(
+ index, ProgramData::INDEX_FLAG_SAMPLER_EXTERNAL);
+ break;
+ }
+ ++nameIter;
+ }
+ }
+}
+
+UniformValidationInfo GLSharedGroup::getUniformValidationInfo(GLuint program) {
+ UniformValidationInfo res;
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData =
+ getProgramDataLocked(program);
+
+ if (!pData) return res;
+
+ bool error; (void)error;
+ return pData->compileValidationInfo(&error);
+}
+
+AttribValidationInfo GLSharedGroup::getAttribValidationInfo(GLuint program) {
+ AttribValidationInfo res;
+
+ AutoLock<Lock> _lock(m_lock);
+
+ ProgramData* pData =
+ getProgramDataLocked(program);
+
+ if (!pData) return res;
+
+ bool error; (void)error;
+ return pData->compileAttribValidationInfo(&error);
+}
+
+void GLSharedGroup::setProgramLinkStatus(GLuint program, GLint linkStatus) {
+ AutoLock<Lock> _lock(m_lock);
+ ProgramData* pData =
+ getProgramDataLocked(program);
+ if (!pData) return;
+ pData->setLinkStatus(linkStatus);
+}
+
+GLint GLSharedGroup::getProgramLinkStatus(GLuint program) {
+ AutoLock<Lock> _lock(m_lock);
+ ProgramData* pData = getProgramDataLocked(program);
+ if (!pData) return 0;
+ return pData->getLinkStatus();
+}
+
+void GLSharedGroup::setActiveUniformBlockCountForProgram(GLuint program, GLint count) {
+ AutoLock<Lock> _lock(m_lock);
+ ProgramData* pData =
+ getProgramDataLocked(program);
+
+ if (!pData) return;
+
+ pData->setActiveUniformBlockCount(count);
+}
+
+GLint GLSharedGroup::getActiveUniformBlockCount(GLuint program) {
+ AutoLock<Lock> _lock(m_lock);
+ ProgramData* pData =
+ getProgramDataLocked(program);
+
+ if (!pData) return 0;
+
+ return pData->getActiveUniformBlockCount();
+}
+
+void GLSharedGroup::setTransformFeedbackVaryingsCountForProgram(GLuint program, GLint count) {
+ AutoLock<Lock> _lock(m_lock);
+ ProgramData* pData = getProgramDataLocked(program);
+ if (!pData) return;
+ pData->setTransformFeedbackVaryingsCount(count);
+}
+
+GLint GLSharedGroup::getTransformFeedbackVaryingsCountForProgram(GLuint program) {
+ AutoLock<Lock> _lock(m_lock);
+ ProgramData* pData = getProgramDataLocked(program);
+ if (!pData) return 0;
+ return pData->getTransformFeedbackVaryingsCount();
+}
+
+int GLSharedGroup::getActiveUniformsCountForProgram(GLuint program) {
+ AutoLock<Lock> _lock(m_lock);
+ ProgramData* pData =
+ getProgramDataLocked(program);
+
+ if (!pData) return 0;
+
+ return pData->getActiveUniformsCount();
+}
+
+int GLSharedGroup::getActiveAttributesCountForProgram(GLuint program) {
+ AutoLock<Lock> _lock(m_lock);
+ ProgramData* pData =
+ getProgramDataLocked(program);
+
+ if (!pData) return 0;
+
+ return pData->getActiveAttributesCount();
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglCodecCommon/IndexRangeCache.cpp b/src/gfxstream/guest/OpenglCodecCommon/IndexRangeCache.cpp
new file mode 100644
index 00000000000..4a73d227ba8
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/IndexRangeCache.cpp
@@ -0,0 +1,79 @@
+/*
+* 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 "IndexRangeCache.h"
+
+// This is almost literally
+// external/angle/src/libANGLE/IndexRangeCache.cpp
+
+void IndexRangeCache::addRange(GLenum type,
+ size_t offset,
+ size_t count,
+ bool primitiveRestartEnabled,
+ int start,
+ int end) {
+ IndexRange r;
+ r.start = start;
+ r.end = end;
+ mIndexRangeCache[IndexRangeKey(type, offset, count, primitiveRestartEnabled)] = r;
+}
+
+bool IndexRangeCache::findRange(GLenum type,
+ size_t offset,
+ size_t count,
+ bool primitiveRestartEnabled,
+ int* start_out,
+ int* end_out) const {
+ IndexRangeMap::const_iterator it =
+ mIndexRangeCache.find(
+ IndexRangeKey(type, offset, count, primitiveRestartEnabled));
+
+ if (it != mIndexRangeCache.end()) {
+ if (start_out) *start_out = it->second.start;
+ if (end_out) *end_out = it->second.end;
+ return true;
+ } else {
+ if (start_out) *start_out = 0;
+ if (end_out) *end_out = 0;
+ return false;
+ }
+}
+
+
+void IndexRangeCache::invalidateRange(size_t offset, size_t size) {
+ size_t invalidateStart = offset;
+ size_t invalidateEnd = offset + size;
+
+ IndexRangeMap::iterator it = mIndexRangeCache.begin();
+
+ while (it != mIndexRangeCache.end()) {
+ size_t rangeStart = it->first.offset;
+ size_t rangeEnd =
+ it->first.offset +
+ it->first.count * glSizeof(it->first.type);
+
+ if (invalidateEnd < rangeStart ||
+ invalidateStart > rangeEnd) {
+ ++it;
+ } else {
+ mIndexRangeCache.erase(it++);
+ }
+ }
+}
+
+void IndexRangeCache::clear() {
+ mIndexRangeCache.clear();
+}
diff --git a/src/gfxstream/guest/OpenglCodecCommon/IndexRangeCache.h b/src/gfxstream/guest/OpenglCodecCommon/IndexRangeCache.h
new file mode 100644
index 00000000000..4db2c56b240
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/IndexRangeCache.h
@@ -0,0 +1,99 @@
+/*
+* 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.
+*/
+
+// This is almost literally
+// external/angle/src/common/mathutil.h: IndexRange +
+// external/angle/src/libANGLE/IndexRangeCache.h: IndexRangeCache,
+// with adaptations to work with goldfish opengl driver.
+// Currently, primitive restart is not supported, so there
+// is a very minimal incorporation of that.
+
+#ifndef _GL_INDEX_RANGE_CACHE_H_
+#define _GL_INDEX_RANGE_CACHE_H_
+
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include "glUtils.h"
+
+#include <map>
+
+struct IndexRange {
+ // Inclusive range of indices that are not primitive restart
+ int start;
+ int end;
+
+ // Number of non-primitive restart indices
+ size_t vertexIndexCount; // TODO; not being accounted yet (GLES3 feature)
+};
+
+class IndexRangeCache {
+public:
+ void addRange(GLenum type,
+ size_t offset,
+ size_t count,
+ bool primitiveRestartEnabled,
+ int start,
+ int end);
+ bool findRange(GLenum type,
+ size_t offset,
+ size_t count,
+ bool primitiveRestartEnabled,
+ int* start_out,
+ int* end_out) const;
+ void invalidateRange(size_t offset, size_t size);
+ void clear();
+private:
+ struct IndexRangeKey {
+ IndexRangeKey() :
+ type(GL_NONE),
+ offset(0),
+ count(0),
+ primitiveRestartEnabled(false) { }
+ IndexRangeKey(GLenum _type,
+ size_t _offset,
+ size_t _count,
+ bool _primitiveRestart) :
+ type(_type),
+ offset(_offset),
+ count(_count),
+ primitiveRestartEnabled(_primitiveRestart) { }
+
+ bool operator<(const IndexRangeKey& rhs) const {
+ size_t end = offset + count * glSizeof(type);
+ size_t end_other = rhs.offset + rhs.count * glSizeof(rhs.type);
+
+ if (offset != rhs.offset) return offset < rhs.offset;
+ if (end != end_other) return end < end_other;
+ if (type != rhs.type) return type < rhs.type;
+ if (primitiveRestartEnabled != rhs.primitiveRestartEnabled)
+ return primitiveRestartEnabled;
+ return false;
+ }
+
+ GLenum type;
+ size_t offset;
+ size_t count;
+ bool primitiveRestartEnabled;
+ };
+
+ typedef std::map<IndexRangeKey, IndexRange> IndexRangeMap;
+ IndexRangeMap mIndexRangeCache;
+};
+
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/KeyedVectorUtils.h b/src/gfxstream/guest/OpenglCodecCommon/KeyedVectorUtils.h
new file mode 100644
index 00000000000..97dc9f14547
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/KeyedVectorUtils.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 <map>
+
+template <typename T>
+void clearObjectMap(std::map<GLuint, T>& v) {
+ typename std::map<GLuint, T>::iterator it = v.begin();
+ for (; it != v.end(); ++it) {
+ delete it->second;
+ }
+ v.clear();
+}
+
+template <typename K, typename V>
+V findObjectOrDefault(const std::map<K, V>& m, K key, V defaultValue = 0) {
+ typename std::map<K, V>::const_iterator it = m.find(key);
+
+ if (it == m.end()) {
+ return defaultValue;
+ }
+
+ return it->second;
+}
diff --git a/src/gfxstream/guest/OpenglCodecCommon/Makefile b/src/gfxstream/guest/OpenglCodecCommon/Makefile
new file mode 100644
index 00000000000..351eb26a9c9
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/Makefile
@@ -0,0 +1,13 @@
+
+ROOT=../..
+
+include $(ROOT)/make/commondefs
+
+CXXFILES = GLClientState.cpp glUtils.cpp
+CXXINCS += -I$(ROOT)/libs/GLESv1 -I$(ROOT)/include
+
+LIBRARY_NAME = libcodecCommon.a
+
+include $(COMMONRULES)
+
+
diff --git a/src/gfxstream/guest/OpenglCodecCommon/StateTrackingSupport.h b/src/gfxstream/guest/OpenglCodecCommon/StateTrackingSupport.h
new file mode 100644
index 00000000000..01fcd6b40d0
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/StateTrackingSupport.h
@@ -0,0 +1,254 @@
+/*
+* 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 _STATE_TRACKING_SUPPORT_H_
+#define _STATE_TRACKING_SUPPORT_H_
+
+#include "aemu/base/containers/HybridComponentManager.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+
+#include <GLES2/gl2.h>
+#include <memory>
+
+template <class IndexType, bool initialIsTrue>
+class PredicateMap {
+public:
+ static const uint64_t kBitsPerEntry = 64;
+ void add(IndexType objId) {
+ static const uint64_t kNone = 0ULL;
+ static const uint64_t kAll = ~kNone;
+ IndexType index = objId / kBitsPerEntry;
+ if (!mStorage.get_const(index)) {
+ mStorage.add(index, initialIsTrue ? kAll : kNone);
+ }
+ }
+
+ void remove(IndexType objId) {
+ if (initialIsTrue) {
+ set(objId, true);
+ } else {
+ set(objId, false);
+ }
+ }
+
+ void set(IndexType objId, bool predicate) {
+ IndexType index = objId / kBitsPerEntry;
+
+ if (!mStorage.get_const(index)) return;
+
+ uint64_t* current = mStorage.get(index);
+
+ uint64_t flag = 1ULL << (objId % kBitsPerEntry);
+
+ if (predicate) {
+ *current = *current | flag;
+ } else {
+ *current = *current & (~flag);
+ }
+ }
+
+ bool get(IndexType objId) const {
+ IndexType index = objId / kBitsPerEntry;
+
+ const uint64_t* current = mStorage.get_const(index);
+
+ if (!current) return initialIsTrue;
+
+ uint64_t flag = 1ULL << (objId % kBitsPerEntry);
+ return (flag & (*current)) != 0;
+ }
+
+private:
+ using Storage = gfxstream::guest::HybridComponentManager<10000, IndexType, uint64_t>;
+ Storage mStorage;
+};
+
+// Structures for fast validation of uniforms/attribs.
+
+struct UniformLocationInfo {
+ bool valid = false;
+ uint32_t columns;
+ uint32_t rows;
+ bool isSampler;
+ bool isInt;
+ bool isArray;
+ bool isUnsigned;
+ bool isBool;
+};
+
+struct AttribIndexInfo {
+ bool validInProgram = false;
+};
+
+using UniformValidationInfo = gfxstream::guest::HybridComponentManager<1000, uint32_t, UniformLocationInfo>;
+using AttribValidationInfo = gfxstream::guest::HybridComponentManager<16, uint32_t, AttribIndexInfo>;
+
+using LastQueryTargetInfo = gfxstream::guest::HybridComponentManager<1000, uint32_t, uint32_t>;
+
+using ExistenceMap = PredicateMap<uint32_t, false>;
+
+struct RboProps {
+ GLenum format;
+ GLsizei multisamples;
+ GLsizei width;
+ GLsizei height;
+ bool previouslyBound;
+ bool boundEGLImage;
+ GLuint id;
+};
+
+struct SamplerProps {
+ uint32_t refcount;
+};
+
+template <class T>
+class ScopedLockedView {
+public:
+ ScopedLockedView(T* info) : mInfo(info) {
+ mInfo->lock();
+ }
+ virtual ~ScopedLockedView() {
+ mInfo->unlock();
+ }
+protected:
+ T* mInfo;
+
+ T* internalInfo() { return mInfo; }
+ const T* internalInfo_const() const { return mInfo; }
+};
+
+struct RenderbufferInfo {
+ gfxstream::guest::Lock infoLock;
+ gfxstream::guest::HybridComponentManager<1000, uint32_t, std::shared_ptr<RboProps>> component;
+
+ void lock() { infoLock.lock(); }
+ void unlock() { infoLock.unlock(); }
+
+ class ScopedView : public ScopedLockedView<RenderbufferInfo> {
+ public:
+ ScopedView(RenderbufferInfo* info) : ScopedLockedView<RenderbufferInfo>(info) { }
+ bool hasRbo(GLuint id) const {
+ return nullptr != internalInfo_const()->component.get_const(id);
+ }
+ virtual ~ScopedView() = default;
+ RboProps* get(GLuint id) {
+ auto rboPropPtr = internalInfo()->component.get(id);
+ if (!rboPropPtr) {
+ return nullptr;
+ }
+ return rboPropPtr->get();
+ }
+ std::shared_ptr<RboProps> get_or_add_shared_ptr(GLuint id) {
+ auto rboPropPtr = internalInfo()->component.get(id);
+ if (!rboPropPtr) {
+ addFresh(id);
+ rboPropPtr = internalInfo()->component.get(id);
+ }
+ return *rboPropPtr;
+ }
+ std::shared_ptr<RboProps> get_shared_ptr(GLuint id) {
+ auto rboPropPtr = internalInfo()->component.get(id);
+ if (!internalInfo()->component.get(id)) {
+ return nullptr;
+ }
+ return *rboPropPtr;
+ }
+ const RboProps* get_const(GLuint id) {
+ auto rboPropPtr = internalInfo()->component.get_const(id);
+ if (!rboPropPtr) {
+ return nullptr;
+ }
+ return rboPropPtr->get();
+ }
+ void addFresh(GLuint id) {
+ std::shared_ptr<RboProps> props(new RboProps());
+ props->format = GL_NONE;
+ props->multisamples = 0;
+ props->width = 0;
+ props->height = 0;
+ props->previouslyBound = false;
+ props->boundEGLImage = false;
+ props->id = id;
+ internalInfo()->component.add(id, std::move(props));
+ }
+ std::shared_ptr<RboProps> bind(GLuint id) {
+ auto res = get_shared_ptr(id);
+ if (!res) {
+ addFresh(id);
+ res = get_shared_ptr(id);
+ }
+ res->previouslyBound = true;
+ return res;
+ }
+ void remove(GLuint id) {
+ if (id == 0) {
+ return;
+ }
+ internalInfo()->component.remove(id);
+ }
+ };
+};
+
+struct SamplerInfo {
+ gfxstream::guest::Lock infoLock;
+ gfxstream::guest::HybridComponentManager<1000, uint32_t, SamplerProps> component;
+
+ void lock() { infoLock.lock(); }
+ void unlock() { infoLock.unlock(); }
+
+ class ScopedView : public ScopedLockedView<SamplerInfo> {
+ public:
+ ScopedView(SamplerInfo* info) : ScopedLockedView<SamplerInfo>(info) { }
+ bool samplerExists(GLuint id) const {
+ const SamplerProps* info = internalInfo_const()->component.get_const(id);
+ if (!info) return false;
+ return 0 != info->refcount;
+ }
+ virtual ~ScopedView() = default;
+ SamplerProps* get(GLuint id) {
+ return internalInfo()->component.get(id);
+ }
+ const SamplerProps* get_const(GLuint id) {
+ return internalInfo_const()->component.get_const(id);
+ }
+ void addFresh(GLuint id) {
+ SamplerProps props;
+ props.refcount = 1;
+ internalInfo()->component.add(id, props);
+ }
+ SamplerProps* bind(GLuint id) {
+ if (!samplerExists(id)) return 0;
+ ref(id);
+ SamplerProps* res = get(id);
+ return res;
+ }
+ void ref(GLuint id) {
+ SamplerProps* props = get(id);
+ if (!props) return;
+ ++props->refcount;
+ }
+ bool unref(GLuint id) {
+ SamplerProps* props = get(id);
+ if (!props) return false;
+ if (!props->refcount) return false;
+ --props->refcount;
+ bool gone = 0 == props->refcount;
+ return gone;
+ }
+ };
+};
+
+
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/TextureSharedData.h b/src/gfxstream/guest/OpenglCodecCommon/TextureSharedData.h
new file mode 100644
index 00000000000..5f830e33e0e
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/TextureSharedData.h
@@ -0,0 +1,62 @@
+/*
+* 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 _GL_TEXTURE_SHARED_DATA_H_
+#define _GL_TEXTURE_SHARED_DATA_H_
+
+#include <GLES/gl.h>
+#include <map>
+#include <memory>
+
+#include "aemu/base/synchronization/AndroidLock.h"
+
+using gfxstream::guest::ReadWriteLock;
+
+struct TextureDims {
+ std::map<GLsizei, GLsizei> widths;
+ std::map<GLsizei, GLsizei> heights;
+ std::map<GLsizei, GLsizei> depths;
+};
+
+struct TextureRec {
+ GLuint id;
+ GLenum target;
+ GLint internalformat;
+ GLenum format;
+ GLenum type;
+ GLsizei multisamples;
+ TextureDims* dims;
+ bool immutable;
+ bool boundEGLImage;
+ bool hasStorage;
+ bool hasCubeNegX;
+ bool hasCubePosX;
+ bool hasCubeNegY;
+ bool hasCubePosY;
+ bool hasCubeNegZ;
+ bool hasCubePosZ;
+};
+
+struct SharedTextureDataMap {
+ using MapType = std::map<GLuint, std::shared_ptr<TextureRec>>;
+
+ using iterator = MapType::iterator;
+ using const_iterator = MapType::const_iterator;
+
+ MapType map;
+ ReadWriteLock lock;
+};
+
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/astc-codec.h b/src/gfxstream/guest/OpenglCodecCommon/astc-codec.h
new file mode 100644
index 00000000000..e15fe47d977
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/astc-codec.h
@@ -0,0 +1,47 @@
+// Copyright 2018 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ASTC_CODEC_ASTC_CODEC_H_
+#define ASTC_CODEC_ASTC_CODEC_H_
+
+namespace astc_codec {
+
+// These are the valid ASTC footprints according to the specification in
+// Section C.2.7.
+enum FootprintType {
+ k4x4,
+ k5x4,
+ k5x5,
+ k6x5,
+ k6x6,
+ k8x5,
+ k8x6,
+ k10x5,
+ k10x6,
+ k8x8,
+ k10x8,
+ k10x10,
+ k12x10,
+ k12x12,
+
+ kCount
+};
+
+struct AstcFootprint {
+ AstcFootprint(int width, int height);
+};
+
+} // namespace astc_codec
+
+#endif // ASTC_CODEC_ASTC_CODEC_H_
diff --git a/src/gfxstream/guest/OpenglCodecCommon/codec_defs.h b/src/gfxstream/guest/OpenglCodecCommon/codec_defs.h
new file mode 100644
index 00000000000..0656ee04400
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/codec_defs.h
@@ -0,0 +1,27 @@
+/*
+* 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 _CODEC_DEFS_H
+#define _CODEC_DEFS_H
+
+#define CODEC_SERVER_PORT 22468
+
+enum {
+
+CODEC_MAX_VERTEX_ATTRIBUTES = 16,
+
+};
+
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/glUtils.cpp b/src/gfxstream/guest/OpenglCodecCommon/glUtils.cpp
new file mode 100644
index 00000000000..d7d79efcb03
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/glUtils.cpp
@@ -0,0 +1,1209 @@
+/*
+* 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 "glUtils.h"
+#include <string.h>
+#include "ErrorLog.h"
+#include "gfxstream/guest/IOStream.h"
+
+#include <GLES3/gl31.h>
+
+using gfxstream::guest::IOStream;
+
+bool isSamplerType(GLenum type) {
+ switch (type) {
+ case GL_SAMPLER_2D:
+ case GL_SAMPLER_3D:
+ case GL_SAMPLER_CUBE:
+ case GL_SAMPLER_2D_SHADOW:
+ case GL_SAMPLER_2D_ARRAY:
+ case GL_SAMPLER_2D_ARRAY_SHADOW:
+ case GL_SAMPLER_2D_MULTISAMPLE:
+ case GL_SAMPLER_CUBE_SHADOW:
+ case GL_SAMPLER_BUFFER_OES:
+ case GL_INT_SAMPLER_2D:
+ case GL_INT_SAMPLER_3D:
+ case GL_INT_SAMPLER_CUBE:
+ case GL_INT_SAMPLER_2D_ARRAY:
+ case GL_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_INT_SAMPLER_BUFFER_OES:
+ case GL_UNSIGNED_INT_SAMPLER_2D:
+ case GL_UNSIGNED_INT_SAMPLER_3D:
+ case GL_UNSIGNED_INT_SAMPLER_CUBE:
+ case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+ case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_UNSIGNED_INT_SAMPLER_BUFFER_OES:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool isIntegerType(GLenum type) {
+ switch (type) {
+ case GL_UNSIGNED_INT:
+ case GL_INT:
+ case GL_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_INT_VEC4:
+ case GL_UNSIGNED_INT_VEC4:
+ case GL_INT_IMAGE_2D:
+ case GL_INT_IMAGE_3D:
+ case GL_INT_IMAGE_CUBE:
+ case GL_INT_IMAGE_2D_ARRAY:
+ case GL_INT_IMAGE_BUFFER_OES:
+ case GL_UNSIGNED_INT_IMAGE_2D:
+ case GL_UNSIGNED_INT_IMAGE_3D:
+ case GL_UNSIGNED_INT_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+ case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+ case GL_UNSIGNED_INT_IMAGE_BUFFER_OES:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool isUnsignedIntType(GLenum type) {
+ switch (type) {
+ case GL_UNSIGNED_INT:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC4:
+ case GL_UNSIGNED_INT_IMAGE_2D:
+ case GL_UNSIGNED_INT_IMAGE_3D:
+ case GL_UNSIGNED_INT_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+ case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+ case GL_UNSIGNED_INT_IMAGE_BUFFER_OES:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool isBoolType(GLenum type) {
+ switch (type) {
+ case GL_BOOL:
+ case GL_BOOL_VEC2:
+ case GL_BOOL_VEC3:
+ case GL_BOOL_VEC4:
+ return true;
+ default:
+ return false;
+ }
+}
+
+uint32_t getColumnsOfType(GLenum type) {
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_HALF_FLOAT:
+ case GL_HALF_FLOAT_OES:
+ case GL_IMAGE_2D:
+ case GL_IMAGE_3D:
+ case GL_UNSIGNED_INT:
+ case GL_INT:
+ case GL_FLOAT:
+ case GL_FIXED:
+ case GL_BOOL:
+ return 1;
+#ifdef GL_DOUBLE
+ case GL_DOUBLE:
+ return 1;
+ case GL_DOUBLE_VEC2:
+ case GL_DOUBLE_MAT2:
+ case GL_DOUBLE_MAT2x3:
+ case GL_DOUBLE_MAT2x4:
+ return 2;
+ case GL_DOUBLE_VEC3:
+ case GL_DOUBLE_MAT3:
+ case GL_DOUBLE_MAT3x2:
+ case GL_DOUBLE_MAT3x4:
+ return 3;
+ case GL_DOUBLE_VEC4:
+ case GL_DOUBLE_MAT4:
+ case GL_DOUBLE_MAT4x2:
+ case GL_DOUBLE_MAT4x3:
+ return 4;
+#endif
+ case GL_FLOAT_VEC2:
+ case GL_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_BOOL_VEC2:
+ case GL_FLOAT_MAT2:
+ case GL_FLOAT_MAT2x3:
+ case GL_FLOAT_MAT2x4:
+ return 2;
+ case GL_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_BOOL_VEC3:
+ case GL_FLOAT_VEC3:
+ case GL_FLOAT_MAT3:
+ case GL_FLOAT_MAT3x2:
+ case GL_FLOAT_MAT3x4:
+ return 3;
+ case GL_FLOAT_VEC4:
+ case GL_BOOL_VEC4:
+ case GL_INT_VEC4:
+ case GL_UNSIGNED_INT_VEC4:
+ case GL_FLOAT_MAT4:
+ case GL_FLOAT_MAT4x2:
+ case GL_FLOAT_MAT4x3:
+ return 4;
+ case GL_SAMPLER_2D:
+ case GL_SAMPLER_3D:
+ case GL_SAMPLER_CUBE:
+ case GL_SAMPLER_2D_SHADOW:
+ case GL_SAMPLER_2D_ARRAY:
+ case GL_SAMPLER_2D_ARRAY_SHADOW:
+ case GL_SAMPLER_2D_MULTISAMPLE:
+ case GL_SAMPLER_CUBE_SHADOW:
+ case GL_SAMPLER_BUFFER_OES:
+ case GL_INT_SAMPLER_2D:
+ case GL_INT_SAMPLER_3D:
+ case GL_INT_SAMPLER_CUBE:
+ case GL_INT_SAMPLER_2D_ARRAY:
+ case GL_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_INT_SAMPLER_BUFFER_OES:
+ case GL_UNSIGNED_INT_SAMPLER_2D:
+ case GL_UNSIGNED_INT_SAMPLER_3D:
+ case GL_UNSIGNED_INT_SAMPLER_CUBE:
+ case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+ case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_UNSIGNED_INT_SAMPLER_BUFFER_OES:
+ case GL_IMAGE_CUBE:
+ case GL_IMAGE_2D_ARRAY:
+ case GL_IMAGE_BUFFER_OES:
+ case GL_INT_IMAGE_2D:
+ case GL_INT_IMAGE_3D:
+ case GL_INT_IMAGE_CUBE:
+ case GL_INT_IMAGE_2D_ARRAY:
+ case GL_INT_IMAGE_BUFFER_OES:
+ case GL_UNSIGNED_INT_IMAGE_2D:
+ case GL_UNSIGNED_INT_IMAGE_3D:
+ case GL_UNSIGNED_INT_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+ case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+ case GL_UNSIGNED_INT_IMAGE_BUFFER_OES:
+ default:
+ return 1;
+ }
+}
+
+uint32_t getRowsOfType(GLenum type) {
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_HALF_FLOAT:
+ case GL_HALF_FLOAT_OES:
+ case GL_IMAGE_2D:
+ case GL_IMAGE_3D:
+ case GL_UNSIGNED_INT:
+ case GL_INT:
+ case GL_FLOAT:
+ case GL_FIXED:
+ case GL_BOOL:
+ return 1;
+#ifdef GL_DOUBLE
+ case GL_DOUBLE:
+ case GL_DOUBLE_VEC2:
+ case GL_DOUBLE_VEC3:
+ case GL_DOUBLE_VEC4:
+ return 1;
+ case GL_DOUBLE_MAT2:
+ case GL_DOUBLE_MAT3x2:
+ case GL_DOUBLE_MAT4x2:
+ return 2;
+ case GL_DOUBLE_MAT3:
+ case GL_DOUBLE_MAT2x3:
+ case GL_DOUBLE_MAT4x3:
+ return 3;
+ case GL_DOUBLE_MAT4:
+ case GL_DOUBLE_MAT3x4:
+ case GL_DOUBLE_MAT2x4:
+ return 4;
+#endif
+ case GL_FLOAT_VEC2:
+ case GL_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_BOOL_VEC2:
+ case GL_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_BOOL_VEC3:
+ case GL_FLOAT_VEC3:
+ case GL_FLOAT_VEC4:
+ case GL_BOOL_VEC4:
+ case GL_INT_VEC4:
+ case GL_UNSIGNED_INT_VEC4:
+ return 1;
+ case GL_FLOAT_MAT2:
+ case GL_FLOAT_MAT3x2:
+ case GL_FLOAT_MAT4x2:
+ return 2;
+ case GL_FLOAT_MAT3:
+ case GL_FLOAT_MAT2x3:
+ case GL_FLOAT_MAT4x3:
+ return 3;
+ case GL_FLOAT_MAT4:
+ case GL_FLOAT_MAT2x4:
+ case GL_FLOAT_MAT3x4:
+ return 4;
+ case GL_SAMPLER_2D:
+ case GL_SAMPLER_3D:
+ case GL_SAMPLER_CUBE:
+ case GL_SAMPLER_2D_SHADOW:
+ case GL_SAMPLER_2D_ARRAY:
+ case GL_SAMPLER_2D_ARRAY_SHADOW:
+ case GL_SAMPLER_2D_MULTISAMPLE:
+ case GL_SAMPLER_CUBE_SHADOW:
+ case GL_SAMPLER_BUFFER_OES:
+ case GL_INT_SAMPLER_2D:
+ case GL_INT_SAMPLER_3D:
+ case GL_INT_SAMPLER_CUBE:
+ case GL_INT_SAMPLER_2D_ARRAY:
+ case GL_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_INT_SAMPLER_BUFFER_OES:
+ case GL_UNSIGNED_INT_SAMPLER_2D:
+ case GL_UNSIGNED_INT_SAMPLER_3D:
+ case GL_UNSIGNED_INT_SAMPLER_CUBE:
+ case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+ case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_UNSIGNED_INT_SAMPLER_BUFFER_OES:
+ case GL_IMAGE_CUBE:
+ case GL_IMAGE_2D_ARRAY:
+ case GL_IMAGE_BUFFER_OES:
+ case GL_INT_IMAGE_2D:
+ case GL_INT_IMAGE_3D:
+ case GL_INT_IMAGE_CUBE:
+ case GL_INT_IMAGE_2D_ARRAY:
+ case GL_INT_IMAGE_BUFFER_OES:
+ case GL_UNSIGNED_INT_IMAGE_2D:
+ case GL_UNSIGNED_INT_IMAGE_3D:
+ case GL_UNSIGNED_INT_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+ case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+ case GL_UNSIGNED_INT_IMAGE_BUFFER_OES:
+ default:
+ return 1;
+ }
+}
+
+uint32_t getAttributeCountOfType(GLenum type) {
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_HALF_FLOAT:
+ case GL_HALF_FLOAT_OES:
+ case GL_IMAGE_2D:
+ case GL_IMAGE_3D:
+ case GL_UNSIGNED_INT:
+ case GL_INT:
+ case GL_FLOAT:
+ case GL_FIXED:
+ case GL_BOOL:
+ return 1;
+#ifdef GL_DOUBLE
+ case GL_DOUBLE:
+ case GL_DOUBLE_VEC2:
+ case GL_DOUBLE_VEC3:
+ case GL_DOUBLE_VEC4:
+ return 1;
+ case GL_DOUBLE_MAT2:
+ case GL_DOUBLE_MAT2x3:
+ case GL_DOUBLE_MAT2x4:
+ return 4;
+ case GL_DOUBLE_MAT3:
+ case GL_DOUBLE_MAT3x2:
+ case GL_DOUBLE_MAT3x4:
+ return 6;
+ case GL_DOUBLE_MAT4:
+ case GL_DOUBLE_MAT4x2:
+ case GL_DOUBLE_MAT4x3:
+ return 8;
+#endif
+ case GL_FLOAT_VEC2:
+ case GL_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_BOOL_VEC2:
+ case GL_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_BOOL_VEC3:
+ case GL_FLOAT_VEC3:
+ case GL_FLOAT_VEC4:
+ case GL_BOOL_VEC4:
+ case GL_INT_VEC4:
+ case GL_UNSIGNED_INT_VEC4:
+ return 1;
+ case GL_FLOAT_MAT2:
+ case GL_FLOAT_MAT2x3:
+ case GL_FLOAT_MAT2x4:
+ return 2;
+ case GL_FLOAT_MAT3:
+ case GL_FLOAT_MAT3x2:
+ case GL_FLOAT_MAT3x4:
+ return 3;
+ case GL_FLOAT_MAT4:
+ case GL_FLOAT_MAT4x2:
+ case GL_FLOAT_MAT4x3:
+ return 4;
+ case GL_SAMPLER_2D:
+ case GL_SAMPLER_3D:
+ case GL_SAMPLER_CUBE:
+ case GL_SAMPLER_2D_SHADOW:
+ case GL_SAMPLER_2D_ARRAY:
+ case GL_SAMPLER_2D_ARRAY_SHADOW:
+ case GL_SAMPLER_2D_MULTISAMPLE:
+ case GL_SAMPLER_CUBE_SHADOW:
+ case GL_SAMPLER_BUFFER_OES:
+ case GL_INT_SAMPLER_2D:
+ case GL_INT_SAMPLER_3D:
+ case GL_INT_SAMPLER_CUBE:
+ case GL_INT_SAMPLER_2D_ARRAY:
+ case GL_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_INT_SAMPLER_BUFFER_OES:
+ case GL_UNSIGNED_INT_SAMPLER_2D:
+ case GL_UNSIGNED_INT_SAMPLER_3D:
+ case GL_UNSIGNED_INT_SAMPLER_CUBE:
+ case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+ case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_UNSIGNED_INT_SAMPLER_BUFFER_OES:
+ case GL_IMAGE_CUBE:
+ case GL_IMAGE_2D_ARRAY:
+ case GL_IMAGE_BUFFER_OES:
+ case GL_INT_IMAGE_2D:
+ case GL_INT_IMAGE_3D:
+ case GL_INT_IMAGE_CUBE:
+ case GL_INT_IMAGE_2D_ARRAY:
+ case GL_INT_IMAGE_BUFFER_OES:
+ case GL_UNSIGNED_INT_IMAGE_2D:
+ case GL_UNSIGNED_INT_IMAGE_3D:
+ case GL_UNSIGNED_INT_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+ case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+ case GL_UNSIGNED_INT_IMAGE_BUFFER_OES:
+ default:
+ return 1;
+ }
+}
+
+size_t glSizeof(GLenum type)
+{
+ size_t retval = 0;
+ switch(type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ retval = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_HALF_FLOAT:
+ case GL_HALF_FLOAT_OES:
+ retval = 2;
+ break;
+ case GL_IMAGE_2D:
+ case GL_IMAGE_3D:
+ case GL_UNSIGNED_INT:
+ case GL_INT:
+ case GL_FLOAT:
+ case GL_FIXED:
+ case GL_BOOL:
+ retval = 4;
+ break;
+#ifdef GL_DOUBLE
+ case GL_DOUBLE:
+ retval = 8;
+ break;
+ case GL_DOUBLE_VEC2:
+ retval = 16;
+ break;
+ case GL_DOUBLE_VEC3:
+ retval = 24;
+ break;
+ case GL_DOUBLE_VEC4:
+ retval = 32;
+ break;
+ case GL_DOUBLE_MAT2:
+ retval = 8 * 4;
+ break;
+ case GL_DOUBLE_MAT3:
+ retval = 8 * 9;
+ break;
+ case GL_DOUBLE_MAT4:
+ retval = 8 * 16;
+ break;
+ case GL_DOUBLE_MAT2x3:
+ case GL_DOUBLE_MAT3x2:
+ retval = 8 * 6;
+ break;
+ case GL_DOUBLE_MAT2x4:
+ case GL_DOUBLE_MAT4x2:
+ retval = 8 * 8;
+ break;
+ case GL_DOUBLE_MAT3x4:
+ case GL_DOUBLE_MAT4x3:
+ retval = 8 * 12;
+ break;
+#endif
+ case GL_FLOAT_VEC2:
+ case GL_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_BOOL_VEC2:
+ retval = 8;
+ break;
+ case GL_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_BOOL_VEC3:
+ case GL_FLOAT_VEC3:
+ retval = 12;
+ break;
+ case GL_FLOAT_VEC4:
+ case GL_BOOL_VEC4:
+ case GL_INT_VEC4:
+ case GL_UNSIGNED_INT_VEC4:
+ case GL_FLOAT_MAT2:
+ retval = 16;
+ break;
+ case GL_FLOAT_MAT3:
+ retval = 36;
+ break;
+ case GL_FLOAT_MAT4:
+ retval = 64;
+ break;
+ case GL_FLOAT_MAT2x3:
+ case GL_FLOAT_MAT3x2:
+ retval = 4 * 6;
+ break;
+ case GL_FLOAT_MAT2x4:
+ case GL_FLOAT_MAT4x2:
+ retval = 4 * 8;
+ break;
+ case GL_FLOAT_MAT3x4:
+ case GL_FLOAT_MAT4x3:
+ retval = 4 * 12;
+ break;
+ case GL_SAMPLER_2D:
+ case GL_SAMPLER_3D:
+ case GL_SAMPLER_CUBE:
+ case GL_SAMPLER_2D_SHADOW:
+ case GL_SAMPLER_2D_ARRAY:
+ case GL_SAMPLER_2D_ARRAY_SHADOW:
+ case GL_SAMPLER_2D_MULTISAMPLE:
+ case GL_SAMPLER_CUBE_SHADOW:
+ case GL_SAMPLER_BUFFER_OES:
+ case GL_INT_SAMPLER_2D:
+ case GL_INT_SAMPLER_3D:
+ case GL_INT_SAMPLER_CUBE:
+ case GL_INT_SAMPLER_2D_ARRAY:
+ case GL_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_INT_SAMPLER_BUFFER_OES:
+ case GL_UNSIGNED_INT_SAMPLER_2D:
+ case GL_UNSIGNED_INT_SAMPLER_3D:
+ case GL_UNSIGNED_INT_SAMPLER_CUBE:
+ case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+ case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+ case GL_UNSIGNED_INT_SAMPLER_BUFFER_OES:
+ case GL_IMAGE_CUBE:
+ case GL_IMAGE_2D_ARRAY:
+ case GL_IMAGE_BUFFER_OES:
+ case GL_INT_IMAGE_2D:
+ case GL_INT_IMAGE_3D:
+ case GL_INT_IMAGE_CUBE:
+ case GL_INT_IMAGE_2D_ARRAY:
+ case GL_INT_IMAGE_BUFFER_OES:
+ case GL_UNSIGNED_INT_IMAGE_2D:
+ case GL_UNSIGNED_INT_IMAGE_3D:
+ case GL_UNSIGNED_INT_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+ case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+ case GL_UNSIGNED_INT_IMAGE_BUFFER_OES:
+ retval = 4;
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
+ retval = 2;
+ break;
+ case GL_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_24_8_OES:;
+ retval = 4;
+ break;
+ case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+ retval = 4 + 4;
+ break;
+ default:
+ ALOGE("**** ERROR unknown type 0x%x (%s,%d)\n", type, __FUNCTION__,__LINE__);
+ retval = 4;
+ }
+ return retval;
+
+}
+
+size_t glUtilsParamSize(GLenum param)
+{
+ size_t s = 0;
+
+ switch(param)
+ {
+ case GL_DEPTH_TEST:
+ case GL_DEPTH_FUNC:
+ case GL_DEPTH_BITS:
+ case GL_MAX_CLIP_PLANES:
+ case GL_MAX_COLOR_ATTACHMENTS:
+ case GL_MAX_DRAW_BUFFERS:
+ case GL_GREEN_BITS:
+ case GL_MAX_MODELVIEW_STACK_DEPTH:
+ case GL_MAX_PROJECTION_STACK_DEPTH:
+ case GL_MAX_TEXTURE_STACK_DEPTH:
+ case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
+ case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
+ case GL_MAX_TEXTURE_SIZE:
+ case GL_TEXTURE_GEN_MODE_OES:
+ case GL_TEXTURE_ENV_MODE:
+ case GL_FOG_MODE:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_SPOT_EXPONENT:
+ case GL_CONSTANT_ATTENUATION:
+ case GL_LINEAR_ATTENUATION:
+ case GL_QUADRATIC_ATTENUATION:
+ case GL_SHININESS:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_POINT_SIZE:
+ case GL_POINT_SIZE_MIN:
+ case GL_POINT_SIZE_MAX:
+ case GL_POINT_FADE_THRESHOLD_SIZE:
+ case GL_CULL_FACE:
+ case GL_CULL_FACE_MODE:
+ case GL_FRONT_FACE:
+ case GL_SHADE_MODEL:
+ case GL_DEPTH_WRITEMASK:
+ case GL_DEPTH_CLEAR_VALUE:
+ case GL_STENCIL_FAIL:
+ case GL_STENCIL_PASS_DEPTH_FAIL:
+ case GL_STENCIL_PASS_DEPTH_PASS:
+ case GL_STENCIL_REF:
+ case GL_STENCIL_WRITEMASK:
+ case GL_MATRIX_MODE:
+ case GL_MODELVIEW_STACK_DEPTH:
+ case GL_PROJECTION_STACK_DEPTH:
+ case GL_TEXTURE_STACK_DEPTH:
+ case GL_ALPHA_TEST_FUNC:
+ case GL_ALPHA_TEST_REF:
+ case GL_ALPHA_TEST:
+ case GL_DITHER:
+ case GL_BLEND_DST:
+ case GL_BLEND_SRC:
+ case GL_BLEND:
+ case GL_LOGIC_OP_MODE:
+ case GL_SCISSOR_TEST:
+ case GL_MAX_TEXTURE_UNITS:
+ case GL_ACTIVE_TEXTURE:
+ case GL_ALPHA_BITS:
+ case GL_ARRAY_BUFFER_BINDING:
+ case GL_BLUE_BITS:
+ case GL_CLIENT_ACTIVE_TEXTURE:
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ case GL_COLOR_ARRAY:
+ case GL_COLOR_ARRAY_BUFFER_BINDING:
+ case GL_COLOR_ARRAY_SIZE:
+ case GL_COLOR_ARRAY_STRIDE:
+ case GL_COLOR_ARRAY_TYPE:
+ case GL_COLOR_LOGIC_OP:
+ case GL_COLOR_MATERIAL:
+ case GL_PACK_ALIGNMENT:
+ case GL_PERSPECTIVE_CORRECTION_HINT:
+ case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
+ case GL_POINT_SIZE_ARRAY_STRIDE_OES:
+ case GL_POINT_SIZE_ARRAY_TYPE_OES:
+ case GL_POINT_SMOOTH:
+ case GL_POINT_SMOOTH_HINT:
+ case GL_POINT_SPRITE_OES:
+ case GL_COORD_REPLACE_OES:
+ case GL_COMBINE_ALPHA:
+ case GL_SRC0_RGB:
+ case GL_SRC1_RGB:
+ case GL_SRC2_RGB:
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND2_RGB:
+ case GL_SRC0_ALPHA:
+ case GL_SRC1_ALPHA:
+ case GL_SRC2_ALPHA:
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_ALPHA:
+ case GL_RGB_SCALE:
+ case GL_ALPHA_SCALE:
+ case GL_COMBINE_RGB:
+ case GL_POLYGON_OFFSET_FACTOR:
+ case GL_POLYGON_OFFSET_FILL:
+ case GL_POLYGON_OFFSET_UNITS:
+ case GL_RED_BITS:
+ case GL_RESCALE_NORMAL:
+ case GL_SAMPLE_ALPHA_TO_COVERAGE:
+ case GL_SAMPLE_ALPHA_TO_ONE:
+ case GL_SAMPLE_BUFFERS:
+ case GL_SAMPLE_COVERAGE:
+ case GL_SAMPLE_COVERAGE_INVERT:
+ case GL_SAMPLE_COVERAGE_VALUE:
+ case GL_SAMPLES:
+ case GL_MAX_SAMPLES_EXT:
+ case GL_STENCIL_BITS:
+ case GL_STENCIL_CLEAR_VALUE:
+ case GL_STENCIL_FUNC:
+ case GL_STENCIL_TEST:
+ case GL_STENCIL_VALUE_MASK:
+ case GL_STENCIL_BACK_FUNC:
+ case GL_STENCIL_BACK_VALUE_MASK:
+ case GL_STENCIL_BACK_REF:
+ case GL_STENCIL_BACK_FAIL:
+ case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
+ case GL_STENCIL_BACK_PASS_DEPTH_PASS:
+ case GL_STENCIL_BACK_WRITEMASK:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_BINDING_2D:
+ case GL_TEXTURE_BINDING_CUBE_MAP:
+ case GL_TEXTURE_BINDING_EXTERNAL_OES:
+ case GL_TEXTURE_COMPARE_FUNC:
+ case GL_TEXTURE_COMPARE_MODE:
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
+ case GL_TEXTURE_COORD_ARRAY_SIZE:
+ case GL_TEXTURE_COORD_ARRAY_STRIDE:
+ case GL_TEXTURE_COORD_ARRAY_TYPE:
+ case GL_TEXTURE_IMMUTABLE_FORMAT:
+ case GL_UNPACK_ALIGNMENT:
+ case GL_VERTEX_ARRAY:
+ case GL_VERTEX_ARRAY_BUFFER_BINDING:
+ case GL_VERTEX_ARRAY_SIZE:
+ case GL_VERTEX_ARRAY_STRIDE:
+ case GL_VERTEX_ARRAY_TYPE:
+ case GL_SPOT_CUTOFF:
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_SWIZZLE_R:
+ case GL_TEXTURE_SWIZZLE_G:
+ case GL_TEXTURE_SWIZZLE_B:
+ case GL_TEXTURE_SWIZZLE_A:
+ case GL_GENERATE_MIPMAP:
+ case GL_GENERATE_MIPMAP_HINT:
+ case GL_RENDERBUFFER_WIDTH_OES:
+ case GL_RENDERBUFFER_HEIGHT_OES:
+ case GL_RENDERBUFFER_INTERNAL_FORMAT_OES:
+ case GL_RENDERBUFFER_RED_SIZE_OES:
+ case GL_RENDERBUFFER_GREEN_SIZE_OES:
+ case GL_RENDERBUFFER_BLUE_SIZE_OES:
+ case GL_RENDERBUFFER_ALPHA_SIZE_OES:
+ case GL_RENDERBUFFER_DEPTH_SIZE_OES:
+ case GL_RENDERBUFFER_STENCIL_SIZE_OES:
+ case GL_RENDERBUFFER_BINDING:
+ case GL_FRAMEBUFFER_BINDING:
+ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES:
+ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES:
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES:
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES:
+ case GL_FENCE_STATUS_NV:
+ case GL_FENCE_CONDITION_NV:
+ case GL_TEXTURE_WIDTH_QCOM:
+ case GL_TEXTURE_HEIGHT_QCOM:
+ case GL_TEXTURE_DEPTH_QCOM:
+ case GL_TEXTURE_INTERNAL_FORMAT_QCOM:
+ case GL_TEXTURE_FORMAT_QCOM:
+ case GL_TEXTURE_TYPE_QCOM:
+ case GL_TEXTURE_IMAGE_VALID_QCOM:
+ case GL_TEXTURE_NUM_LEVELS_QCOM:
+ case GL_TEXTURE_TARGET_QCOM:
+ case GL_TEXTURE_OBJECT_VALID_QCOM:
+ case GL_BLEND_EQUATION_RGB_OES:
+ case GL_BLEND_EQUATION_ALPHA_OES:
+ case GL_BLEND_DST_RGB_OES:
+ case GL_BLEND_SRC_RGB_OES:
+ case GL_BLEND_DST_ALPHA_OES:
+ case GL_BLEND_SRC_ALPHA_OES:
+ case GL_MAX_LIGHTS:
+ case GL_SHADER_TYPE:
+ case GL_COMPILE_STATUS:
+ case GL_SHADER_SOURCE_LENGTH:
+ case GL_CURRENT_PROGRAM:
+ case GL_SUBPIXEL_BITS:
+ case GL_MAX_3D_TEXTURE_SIZE:
+ case GL_MAX_ARRAY_TEXTURE_LAYERS:
+ case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
+ case GL_NUM_SHADER_BINARY_FORMATS:
+ case GL_SHADER_COMPILER:
+ case GL_MAX_VERTEX_ATTRIBS:
+ case GL_MAX_VERTEX_UNIFORM_VECTORS:
+ case GL_MAX_VARYING_VECTORS:
+ case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
+ case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
+ case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
+ case GL_MAX_RENDERBUFFER_SIZE:
+ case GL_MAX_TEXTURE_IMAGE_UNITS:
+ case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
+ case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
+ case GL_LINE_WIDTH:
+ case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
+ case GL_MAX_UNIFORM_BUFFER_BINDINGS:
+ case GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS:
+ case GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS:
+ 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_REFERENCED_BY_VERTEX_SHADER:
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:
+ case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:
+ case GL_CURRENT_QUERY:
+ case GL_QUERY_RESULT:
+ case GL_QUERY_RESULT_AVAILABLE:
+ case GL_READ_BUFFER:
+ case GL_NUM_PROGRAM_BINARY_FORMATS:
+ case GL_PROGRAM_BINARY_FORMATS:
+
+ case GL_ACTIVE_ATOMIC_COUNTER_BUFFERS:
+ case GL_ACTIVE_ATTRIBUTES:
+ case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
+ case GL_ACTIVE_UNIFORM_BLOCKS:
+ case GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH:
+ case GL_ACTIVE_UNIFORMS:
+ case GL_ACTIVE_UNIFORM_MAX_LENGTH:
+ case GL_ATTACHED_SHADERS:
+ case GL_DELETE_STATUS:
+ case GL_INFO_LOG_LENGTH:
+ case GL_LINK_STATUS:
+ case GL_PROGRAM_BINARY_LENGTH:
+ case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
+ case GL_PROGRAM_SEPARABLE:
+ case GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT:
+ case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
+ case GL_TRANSFORM_FEEDBACK_VARYINGS:
+ case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH:
+ case GL_TRANSFORM_FEEDBACK_ACTIVE:
+#define GL_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+ case GL_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:
+ case GL_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:
+ case GL_VALIDATE_STATUS:
+ s = 1;
+ break;
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ case GL_DEPTH_RANGE:
+ case GL_MAX_VIEWPORT_DIMS:
+ case GL_SMOOTH_POINT_SIZE_RANGE:
+ case GL_SMOOTH_LINE_WIDTH_RANGE:
+ case GL_SAMPLE_POSITION:
+ s= 2;
+ break;
+ case GL_SPOT_DIRECTION:
+ case GL_POINT_DISTANCE_ATTENUATION:
+ case GL_CURRENT_NORMAL:
+ case GL_COMPUTE_WORK_GROUP_SIZE:
+ s = 3;
+ break;
+ case GL_CURRENT_VERTEX_ATTRIB:
+ case GL_CURRENT_TEXTURE_COORDS:
+ case GL_CURRENT_COLOR:
+ case GL_FOG_COLOR:
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ case GL_EMISSION:
+ case GL_POSITION:
+ case GL_LIGHT_MODEL_AMBIENT:
+ case GL_TEXTURE_ENV_COLOR:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ case GL_TEXTURE_CROP_RECT_OES:
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_AMBIENT_AND_DIFFUSE:
+ case GL_BLEND_COLOR:
+ s = 4;
+ break;
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ s = 16;
+ break;
+ default:
+ s = 1; // assume 1 for everything else
+ }
+ return s;
+}
+
+void glUtilsPackPointerData(unsigned char *dst, unsigned char *src,
+ int size, GLenum type, unsigned int stride,
+ unsigned int datalen)
+{
+ unsigned int vsize = size * glSizeof(type);
+ switch (type) {
+ case GL_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ vsize = vsize / 4;
+ break;
+ default:
+ break;
+ }
+
+ if (stride == 0) stride = vsize;
+
+ if (stride == vsize) {
+ memcpy(dst, src, datalen);
+ } else {
+ for (unsigned int i = 0; i < datalen; i += vsize) {
+ memcpy(dst, src, vsize);
+ dst += vsize;
+ src += stride;
+ }
+ }
+}
+
+void glUtilsWritePackPointerData(void* _stream, unsigned char *src,
+ int size, GLenum type, unsigned int stride,
+ unsigned int datalen)
+{
+ IOStream* stream = reinterpret_cast<IOStream*>(_stream);
+
+ unsigned int vsize = size * glSizeof(type);
+ if (stride == 0) stride = vsize;
+
+ if (stride == vsize) {
+ stream->writeFully(src, datalen);
+ } else {
+ for (unsigned int i = 0; i < datalen; i += vsize) {
+ stream->writeFully(src, (size_t)vsize);
+ src += stride;
+ }
+ }
+}
+
+#ifndef GL_RGBA16F
+#define GL_RGBA16F 0x881A
+#endif // GL_RGBA16F
+
+int glUtilsPixelBitSize(GLenum format, GLenum type)
+{
+ int components = 0;
+ int componentsize = 0;
+ int pixelsize = 0;
+ switch(type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ componentsize = 8;
+ break;
+ case GL_SHORT:
+ case GL_HALF_FLOAT:
+ case GL_UNSIGNED_SHORT:
+ componentsize = 16;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_FIXED:
+ componentsize = 32;
+ break;
+ 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_RGB565_OES:
+ case GL_RGB5_A1_OES:
+ case GL_RGBA4_OES:
+ pixelsize = 16;
+ break;
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_24_8_OES:
+ pixelsize = 32;
+ break;
+ default:
+ ERR("glUtilsPixelBitSize: unknown pixel type %d - assuming pixel data 0\n", type);
+ componentsize = 0;
+ }
+
+ if (pixelsize == 0) {
+ switch(format) {
+#if 0
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+#endif
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_STENCIL_OES:
+ components = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ components = 2;
+ break;
+ case GL_RGB:
+#if 0
+ case GL_BGR:
+#endif
+ components = 3;
+ break;
+ case GL_RGBA:
+ case GL_BGRA_EXT:
+ components = 4;
+ break;
+ case GL_RGBA16F:
+ pixelsize = 64;
+ break;
+ default:
+ ERR("glUtilsPixelBitSize: unknown pixel format %d\n", format);
+ components = 0;
+ }
+ if (pixelsize == 0) {
+ pixelsize = components * componentsize;
+ }
+ }
+
+ return pixelsize;
+}
+
+// pack a list of strings into one.
+void glUtilsPackStrings(char *ptr, char **strings, GLint *length, GLsizei count)
+{
+ char *p = ptr;
+ *p = '\0';
+ for (int i = 0; i < count; i++) {
+ int l=0;
+ if (strings[i]!=NULL) {
+ if (length == NULL || length[i] < 0) {
+ l = strlen(strings[i]);
+ strcat(p, strings[i]);
+ } else {
+ l = length[i];
+ strncat(p, strings[i], l);
+ }
+ }
+ p += l;
+ }
+}
+
+// claculate the length of a list of strings
+int glUtilsCalcShaderSourceLen( char **strings, GLint *length, GLsizei count)
+{
+ int len = 0;
+ for (int i = 0; i < count; i++) {
+ int l;
+ if (length == NULL || length[i] < 0) {
+ l = strings[i]!=NULL ? strlen(strings[i]) : 0;
+ } else {
+ l = length[i];
+ }
+ len += l;
+ }
+ return len;
+
+}
+
+// helper to get GL_COLOR_ATTACHMENTn names
+GLenum glUtilsColorAttachmentName(int i) {
+#undef COLOR_ATTACHMENT_CASE
+#define COLOR_ATTACHMENT_CASE(i) \
+ case i: \
+ return GL_COLOR_ATTACHMENT##i; \
+
+ switch (i) {
+ COLOR_ATTACHMENT_CASE(0)
+ COLOR_ATTACHMENT_CASE(1)
+ COLOR_ATTACHMENT_CASE(2)
+ COLOR_ATTACHMENT_CASE(3)
+ COLOR_ATTACHMENT_CASE(4)
+ COLOR_ATTACHMENT_CASE(5)
+ COLOR_ATTACHMENT_CASE(6)
+ COLOR_ATTACHMENT_CASE(7)
+ COLOR_ATTACHMENT_CASE(8)
+ COLOR_ATTACHMENT_CASE(9)
+ COLOR_ATTACHMENT_CASE(10)
+ COLOR_ATTACHMENT_CASE(11)
+ COLOR_ATTACHMENT_CASE(12)
+ COLOR_ATTACHMENT_CASE(13)
+ COLOR_ATTACHMENT_CASE(14)
+ COLOR_ATTACHMENT_CASE(15)
+ }
+ return GL_NONE;
+#undef COLOR_ATTACHMENT_CASE
+}
+
+int glUtilsColorAttachmentIndex(GLenum attachment) {
+#undef COLOR_ATTACHMENT_CASE
+#define COLOR_ATTACHMENT_CASE(i) \
+ case GL_COLOR_ATTACHMENT##i: \
+ return i; \
+
+ switch (attachment) {
+ COLOR_ATTACHMENT_CASE(0)
+ COLOR_ATTACHMENT_CASE(1)
+ COLOR_ATTACHMENT_CASE(2)
+ COLOR_ATTACHMENT_CASE(3)
+ COLOR_ATTACHMENT_CASE(4)
+ COLOR_ATTACHMENT_CASE(5)
+ COLOR_ATTACHMENT_CASE(6)
+ COLOR_ATTACHMENT_CASE(7)
+ COLOR_ATTACHMENT_CASE(8)
+ COLOR_ATTACHMENT_CASE(9)
+ COLOR_ATTACHMENT_CASE(10)
+ COLOR_ATTACHMENT_CASE(11)
+ COLOR_ATTACHMENT_CASE(12)
+ COLOR_ATTACHMENT_CASE(13)
+ COLOR_ATTACHMENT_CASE(14)
+ COLOR_ATTACHMENT_CASE(15)
+ }
+ return -1;
+#undef COLOR_ATTACHMENT_CASE
+}
+
+struct glUtilsDrawArraysIndirectCommand {
+ GLuint count;
+ GLuint primCount;
+ GLuint first;
+ GLuint reserved;
+};
+
+struct glUtilsDrawElementsIndirectCommand {
+ GLuint count;
+ GLuint primCount;
+ GLuint first;
+ GLint baseVertex;
+ GLuint reserved;
+};
+
+GLuint glUtilsIndirectStructSize(IndirectCommandType cmdType) {
+ switch (cmdType) {
+ case INDIRECT_COMMAND_DRAWARRAYS:
+ return sizeof(glUtilsDrawArraysIndirectCommand);
+ case INDIRECT_COMMAND_DRAWELEMENTS:
+ return sizeof(glUtilsDrawElementsIndirectCommand);
+ }
+ return 4;
+}
+
+bool colorRenderableFormat(GLint internalformat, GLenum texturetype, int majorVersion, __attribute__((unused)) int minorVersion, bool hasColorBufferFloatExtension, bool hasColorBufferHalfFloatExtension) {
+ switch (internalformat) {
+ case GL_RGB:
+ case GL_RGBA:
+ case GL_BGRA_EXT:
+ switch (texturetype) {
+ case GL_FLOAT:
+ case GL_HALF_FLOAT_OES:
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ return false;
+ default:
+ return true;
+ }
+ break;
+ 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:
+ case GL_BGRA8_EXT:
+ 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 majorVersion >= 3 && hasColorBufferFloatExtension;
+ case GL_RGB16F:
+ return majorVersion >= 3 && hasColorBufferHalfFloatExtension;
+ default:
+ return false;
+ }
+}
+
+bool depthRenderableFormat(GLint internalformat) {
+ switch (internalformat) {
+ case GL_DEPTH_STENCIL:
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32F:
+ case GL_DEPTH24_STENCIL8:
+ case GL_DEPTH32F_STENCIL8:
+ case 0X81A7: // GL_DEPTH_COMPONENT32
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool stencilRenderableFormat(GLint internalformat) {
+ switch (internalformat) {
+ case GL_STENCIL_INDEX:
+ case GL_DEPTH_STENCIL:
+ case GL_STENCIL_INDEX8:
+ case GL_DEPTH24_STENCIL8:
+ case GL_DEPTH32F_STENCIL8:
+ return true;
+ default:
+ return false;
+ }
+}
diff --git a/src/gfxstream/guest/OpenglCodecCommon/glUtils.h b/src/gfxstream/guest/OpenglCodecCommon/glUtils.h
new file mode 100644
index 00000000000..0121b905bfc
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/glUtils.h
@@ -0,0 +1,174 @@
+/*
+* 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_UTILS_H__
+#define __GL_UTILS_H__
+
+#include <cutils/log.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef GL_API
+ #undef GL_API
+#endif
+#define GL_API
+
+#ifdef GL_APIENTRY
+ #undef GL_APIENTRY
+#endif
+
+#ifdef GL_APIENTRYP
+ #undef GL_APIENTRYP
+#endif
+#define GL_APIENTRYP
+
+#ifndef ANDROID
+#define GL_APIENTRY
+#endif
+
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ INDIRECT_COMMAND_DRAWARRAYS = 0,
+ INDIRECT_COMMAND_DRAWELEMENTS = 1,
+} IndirectCommandType;
+
+ bool isSamplerType(GLenum type);
+ bool isIntegerType(GLenum type);
+ bool isUnsignedIntType(GLenum type);
+ bool isBoolType(GLenum type);
+ uint32_t getColumnsOfType(GLenum type);
+ uint32_t getRowsOfType(GLenum type);
+ uint32_t getAttributeCountOfType(GLenum type);
+ size_t glSizeof(GLenum type);
+ size_t glUtilsParamSize(GLenum param);
+ void glUtilsPackPointerData(unsigned char *dst, unsigned char *str,
+ int size, GLenum type, unsigned int stride,
+ unsigned int datalen);
+ void glUtilsWritePackPointerData(void* stream, unsigned char *src,
+ int size, GLenum type, unsigned int stride,
+ unsigned int datalen);
+ int glUtilsPixelBitSize(GLenum format, GLenum type);
+ void glUtilsPackStrings(char *ptr, char **strings, GLint *length, GLsizei count);
+ int glUtilsCalcShaderSourceLen(char **strings, GLint *length, GLsizei count);
+ GLenum glUtilsColorAttachmentName(int i);
+ int glUtilsColorAttachmentIndex(GLenum attachment);
+
+ GLuint glUtilsIndirectStructSize(IndirectCommandType cmdType);
+
+ bool colorRenderableFormat(GLint internalformat, GLenum texturetype, int majorVersion, int minorVersion, bool hasColorBufferFloatExtension, bool hasColorBufferHalfFloatExtension);
+
+ bool depthRenderableFormat(GLint internalformat);
+ bool stencilRenderableFormat(GLint internalformat);
+
+#ifdef __cplusplus
+}
+#endif
+
+namespace GLUtils {
+
+ template <class T> void minmax(const T *indices, int count, int *min, int *max) {
+ *min = -1;
+ *max = -1;
+ const T *ptr = indices;
+ for (int i = 0; i < count; i++) {
+ if (*min == -1 || *ptr < *min) *min = *ptr;
+ if (*max == -1 || *ptr > *max) *max = *ptr;
+ ptr++;
+ }
+ }
+
+ template <class T> void minmaxExcept
+ (const T *indices, int count, int *min, int *max,
+ bool shouldExclude, T whatExclude) {
+
+ if (!shouldExclude) return minmax(indices, count, min, max);
+
+ *min = -1;
+ *max = -1;
+ const T *ptr = indices;
+ for (int i = 0; i < count; i++) {
+ if (*ptr != whatExclude) {
+ if (*min == -1 || *ptr < *min) *min = *ptr;
+ if (*max == -1 || *ptr > *max) *max = *ptr;
+ }
+ ptr++;
+ }
+ }
+
+ template <class T> void shiftIndices(T *indices, int count, int offset) {
+ T *ptr = indices;
+ for (int i = 0; i < count; i++) {
+ *ptr += offset;
+ ptr++;
+ }
+ }
+
+
+ template <class T> void shiftIndices(const T *src, T *dst, int count, int offset)
+ {
+ for (int i = 0; i < count; i++) {
+ *dst = *src + offset;
+ dst++;
+ src++;
+ }
+ }
+
+ template <class T> void shiftIndicesExcept
+ (T *indices, int count, int offset,
+ bool shouldExclude, T whatExclude) {
+
+ if (!shouldExclude) return shiftIndices(indices, count, offset);
+
+ T *ptr = indices;
+ for (int i = 0; i < count; i++) {
+ if (*ptr != whatExclude) {
+ *ptr += offset;
+ }
+ ptr++;
+ }
+ }
+
+ template <class T> void shiftIndicesExcept
+ (const T *src, T *dst, int count, int offset,
+ bool shouldExclude, T whatExclude) {
+
+ if (!shouldExclude) return shiftIndices(src, dst, count, offset);
+
+ for (int i = 0; i < count; i++) {
+ if (*src == whatExclude) {
+ *dst = *src;
+ } else {
+ *dst = *src + offset;
+ }
+ dst++;
+ src++;
+ }
+ }
+
+ template<class T> T primitiveRestartIndex() {
+ return -1;
+ }
+
+} // namespace GLUtils
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/gl_base_types.h b/src/gfxstream/guest/OpenglCodecCommon/gl_base_types.h
new file mode 100644
index 00000000000..70cb325ec63
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/gl_base_types.h
@@ -0,0 +1,65 @@
+/*
+* 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_BASE_TYPES__H
+#define __GL_BASE_TYPES__H
+
+#include <KHR/khrplatform.h>
+
+#ifndef gles1_APIENTRY
+#define gles1_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#ifndef gles2_APIENTRY
+#define gles2_APIENTRY KHRONOS_APIENTRY
+#endif
+
+typedef void GLvoid;
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef char GLchar;
+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;
+typedef char *GLstr;
+/* JR XXX Treating this as an in handle - is this correct? */
+typedef void * GLeglImageOES;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+
+/* ErrorCode */
+#ifndef GL_INVALID_ENUM
+#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
+#endif
+
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/ChecksumCalculator.h b/src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/ChecksumCalculator.h
new file mode 100644
index 00000000000..f453f21a3d0
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/ChecksumCalculator.h
@@ -0,0 +1,193 @@
+/*
+* 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 <stdint.h>
+#include <stdlib.h>
+
+// Set TRACE_CHECKSUMHELPER to 1 to debug creation/destruction of GLprotocol
+// instances.
+#define TRACE_CHECKSUMHELPER 0
+
+#if TRACE_CHECKSUMHELPER
+#define LOG_CHECKSUMHELPER(x...) fprintf(stderr, x)
+#else
+#define LOG_CHECKSUMHELPER(x...)
+#endif
+
+// ChecksumCalculator adds checksum as an array of bytes to GL pipe communication, which
+// size depends on the protocol version. Each pipe should use one ChecksumCalculator.
+// It can:
+// (1) take a list of buffers one by one and compute their checksum string,
+// in this case the checksum should be as the data in those buffers are
+// concatenated;
+// (2) compute the checksum of the buffer list, then either write them into
+// a buffer provided by user, or compare it against a checksum provided
+// by user
+// (3) support different checksum version in future.
+//
+// For backward compatibility, checksum version 0 behaves the same as there is
+// no checksum (i.e., checksumByteSize returns 0, validate always returns true,
+// addBuffer and writeCheckSum does nothing).
+//
+// Notice that to detect package lost, ChecksumCalculator also keeps track of how
+// many times it generates/validates checksums, and might use it as part of the
+// checksum.
+//
+// To evaluate checksums from a list of data buffers buf1, buf2... Please call
+// addBuffer(buf1, buf1len), addBuffer(buf2, buf2len) ... in order.
+// Then if the checksum needs to be encoded into a buffer, one needs to allocate
+// a checksum buffer with size checksumByteSize(), and call
+// writeChecksum(checksumBuffer) to write the checksum to the buffer.
+// If the checksum needs to be validated against an existing one, one needs to
+// call validate(existChecksum, existChecksumLen).
+//
+// The checksum generator and validator must be set to the same version, and
+// the validator must check ALL checksums in the order they are generated,
+// otherwise the validation function will return false.
+//
+// It is allowed to change the checksum version between calculating two
+// checksums. This is designed for backward compatibility reason.
+//
+// Example 1, encoding and decoding:
+//
+// bool testChecksum(void* buf, size_t bufLen) {
+// // encoding message
+// ChecksumCalculator encoder;
+// encoder.setVersion(1);
+// encoder.addBuffer(buf, bufLen);
+// std::vector<unsigned char> message(bufLen + encoder.checksumByteSize());
+// memcpy(&message[0], buf, bufLen);
+// encoder.writeChecksum(&message[0] + bufLen, encoder.checksumByteSize());
+//
+// // decoding message
+// ChecksumCalculator decoder;
+// decoder.setVersion(1);
+// decoder.addBuffer(&message[0], bufLen);
+// return decoder.validate(&message[0] + bufLen, decoder.checksumByteSize());
+// }
+// The return value is true.
+//
+// Example 2, decoding will fail if the order of messages is wrong:
+//
+// bool testChecksumOrder(void* buf1, size_t bufLen1,
+// void* buf2, size_t bufLen2) {
+// // encoding messages
+// ChecksumCalculator encoder;
+// encoder.setVersion(1);
+//
+// std::vector<unsigned char> message1(bufLen1 + encoder.checksumByteSize());
+// std::vector<unsigned char> message2(bufLen2 + encoder.checksumByteSize());
+//
+// encoder.addBuffer(buf1, bufLen1);
+// std::vector<unsigned char> message1(bufLen1 + encoder.checksumByteSize());
+// memcpy(&message1[0], buf1, bufLen1);
+// encoder.writeChecksum(&message1[0] + bufLen1, encoder.checksumByteSize());
+//
+// encoder.addBuffer(buf2, bufLen2);
+// std::vector<unsigned char> message2(bufLen2 + encoder.checksumByteSize());
+// memcpy(&message2[0], buf2, bufLen2);
+// encoder.writeChecksum(&message2[0] + bufLen2, encoder.checksumByteSize());
+//
+// // decoding messages
+// ChecksumCalculator decoder;
+// decoder.setVersion(1);
+// decoder.addBuffer(&message2[0], bufLen2);
+// // returns false because the decoding order is not consistent with
+// // encoding order
+// if (!decoder.validate(&message2[0]+bufLen2, decoder.checksumByteSize())) {
+// return false;
+// }
+//
+// decoder.addBuffer(&message1[0], bufLen1);
+// if (!decoder.validate(&message1[0]+bufLen1, decoder.checksumByteSize())) {
+// return false;
+// }
+//
+// return false;
+// }
+
+namespace gfxstream {
+namespace guest {
+
+class ChecksumCalculator {
+public:
+ enum Sizes {
+ kVersion1ChecksumSize = 8,
+ kMaxChecksumSize = kVersion1ChecksumSize
+ };
+
+ ChecksumCalculator();
+ // Get and set current checksum version
+ uint32_t getVersion() const { return m_version; }
+ // Call setVersion to set a checksum version. It should be called before
+ // addBuffer(), writeChecksum() and validate(). And it should be called
+ // exact once per rendering thread if both host and guest support checksum.
+ // It won't be called if either host or guest does not support checksum.
+ bool setVersion(uint32_t version);
+
+ // Maximum supported checksum version
+ static uint32_t getMaxVersion();
+ // A version string that looks like "ANDROID_EMU_CHECKSUM_HELPER_v1"
+ // Used multiple times when the guest queries the maximum supported version
+ // from the host.
+ // The library owns the returned pointer. The returned pointer will be
+ // deconstructed when unloading library.
+ static const char* getMaxVersionStr();
+ static const char* getMaxVersionStrPrefix();
+
+ // Size of checksum in the current version
+ size_t checksumByteSize() const;
+
+ // Update the current checksum value from the data
+ // at |buf| of |bufLen| bytes. Once all buffers
+ // have been added, call writeChecksum() to store
+ // the final checksum value and reset its state.
+ void addBuffer(const void* buf, size_t bufLen);
+ // Write the checksum from the list of buffers to outputChecksum
+ // Will reset the list of buffers by calling resetChecksum.
+ // Return false if the buffer is not long enough
+ // Please query buffer size from checksumByteSize()
+ bool writeChecksum(void* outputChecksum, size_t outputChecksumLen);
+ // Restore the states for computing checksums.
+ // Automatically called at the end of writeChecksum and validate.
+ // Can also be used to abandon the current checksum being calculated.
+ // Notes: it doesn't update the internal read / write counter
+ void resetChecksum();
+
+ // Calculate the checksum from the list of buffers and
+ // compare it with the checksum encoded in expectedChecksum
+ // Will reset the list of buffers by calling resetChecksum.
+ bool validate(const void* expectedChecksum, size_t expectedChecksumLen);
+protected:
+ uint32_t m_version;
+ // A temporary state used to compute the total length of a list of buffers,
+ // if addBuffer is called.
+ uint32_t m_numRead;
+ uint32_t m_numWrite;
+ // m_isEncodingChecksum is true when between addBuffer and writeChecksum
+ bool m_isEncodingChecksum;
+private:
+ // Compute a 32bit checksum
+ // Used in protocol v1
+ uint32_t computeV1Checksum();
+ // The buffer used in protocol version 1 to compute checksum.
+ uint32_t m_v1BufferTotalLength;
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/GLClientState.h b/src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/GLClientState.h
new file mode 100644
index 00000000000..6aea8dac833
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/GLClientState.h
@@ -0,0 +1,1072 @@
+/*
+* 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_CLIENT_STATE_H_
+#define _GL_CLIENT_STATE_H_
+
+#define GL_API
+#ifndef ANDROID
+#define GL_APIENTRY
+#define GL_APIENTRYP
+#endif
+
+#include "StateTrackingSupport.h"
+
+#include "TextureSharedData.h"
+
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "ErrorLog.h"
+#include "codec_defs.h"
+
+#include <vector>
+#include <map>
+#include <memory>
+#include <set>
+#include <string>
+
+
+namespace gfxstream {
+namespace guest {
+
+// Caps of host driver that make it easy to validate stuff
+struct HostDriverCaps {
+ // ES 2
+ int max_vertex_attribs;
+ int max_combined_texture_image_units;
+ int max_color_attachments;
+
+ int max_texture_size;
+ int max_texture_size_cube_map;
+ int max_renderbuffer_size;
+
+ // ES 3.0
+ int max_draw_buffers;
+
+ int ubo_offset_alignment;
+ int max_uniform_buffer_bindings;
+ int max_transform_feedback_separate_attribs;
+
+ int max_texture_size_3d;
+ int max_array_texture_layers;
+
+ // ES 3.1
+ int max_atomic_counter_buffer_bindings;
+ int max_shader_storage_buffer_bindings;
+ int max_vertex_attrib_bindings;
+ int max_vertex_attrib_stride;
+ int ssbo_offset_alignment;
+};
+
+// Tracking framebuffer objects:
+// which framebuffer is bound,
+// and which texture names
+// are currently bound to which attachment points.
+struct FboProps {
+ GLuint name;
+ bool previouslyBound;
+ bool completenessDirty;
+ GLenum cachedCompleteness;
+ std::vector<std::shared_ptr<TextureRec>> colorAttachmenti_textures;
+ std::vector<GLint> colorAttachmenti_texture_levels;
+ std::vector<GLint> colorAttachmenti_texture_layers;
+
+ GLint depthAttachment_texture_level;
+ GLint depthAttachment_texture_layer;
+ GLint stencilAttachment_texture_level;
+ GLint stencilAttachment_texture_layer;
+
+ std::shared_ptr<TextureRec> depthAttachment_texture;
+ std::shared_ptr<TextureRec> stencilAttachment_texture;
+ std::shared_ptr<TextureRec> depthstencilAttachment_texture;
+
+ std::vector<bool> colorAttachmenti_hasTex;
+ bool depthAttachment_hasTexObj;
+ bool stencilAttachment_hasTexObj;
+ bool depthstencilAttachment_hasTexObj;
+
+ std::vector<std::shared_ptr<RboProps>> colorAttachmenti_rbos;
+ std::shared_ptr<RboProps> depthAttachment_rbo = 0;
+ std::shared_ptr<RboProps> stencilAttachment_rbo = 0;
+ std::shared_ptr<RboProps> depthstencilAttachment_rbo = 0;
+
+ std::vector<bool> colorAttachmenti_hasRbo;
+ bool depthAttachment_hasRbo = false;
+ bool stencilAttachment_hasRbo = false;
+ bool depthstencilAttachment_hasRbo = false;
+
+ GLuint defaultWidth;
+ GLuint defaultHeight;
+};
+
+// Enum for describing whether a framebuffer attachment
+// is a texture or renderbuffer.
+enum FboAttachmentType {
+ FBO_ATTACHMENT_RENDERBUFFER = 0,
+ FBO_ATTACHMENT_TEXTURE = 1,
+ FBO_ATTACHMENT_NONE = 2
+};
+
+// Tracking FBO format
+struct FboFormatInfo {
+ FboAttachmentType type;
+ GLenum rb_format;
+ GLsizei rb_multisamples;
+ bool rb_external;
+
+ GLint tex_internalformat;
+ GLenum tex_format;
+ GLenum tex_type;
+ GLsizei tex_multisamples;
+ GLint tex_level;
+ GLint tex_layer;
+ bool tex_external;
+};
+
+class GLClientState {
+public:
+ // TODO: Unify everything in here
+ typedef enum {
+ Buffer,
+ TransformFeedback,
+ Sampler,
+ Query,
+ } ObjectType;
+
+ typedef enum {
+ VERTEX_LOCATION = 0,
+ NORMAL_LOCATION = 1,
+ COLOR_LOCATION = 2,
+ POINTSIZE_LOCATION = 3,
+ TEXCOORD0_LOCATION = 4,
+ TEXCOORD1_LOCATION = 5,
+ TEXCOORD2_LOCATION = 6,
+ TEXCOORD3_LOCATION = 7,
+ TEXCOORD4_LOCATION = 8,
+ TEXCOORD5_LOCATION = 9,
+ TEXCOORD6_LOCATION = 10,
+ TEXCOORD7_LOCATION = 11,
+ MATRIXINDEX_LOCATION = 12,
+ WEIGHT_LOCATION = 13,
+ LAST_LOCATION = 14
+ } StateLocation;
+
+ typedef struct {
+ GLint enabled;
+ GLint size;
+ GLenum type;
+ GLsizei stride;
+ void *data;
+ GLuint reloffset;
+ GLuint bufferObject;
+ GLenum glConst;
+ unsigned int elementSize;
+ bool enableDirty; // true if any enable state has changed since last draw
+ bool normalized;
+ GLuint divisor;
+ bool isInt;
+ int bindingindex;
+ } VertexAttribState;
+
+ struct BufferBinding {
+ GLintptr offset;
+ GLintptr stride;
+ GLintptr effectiveStride;
+ GLsizeiptr size;
+ GLuint buffer;
+ GLuint divisor;
+ GLint vertexAttribLoc;
+ };
+
+ typedef std::vector<VertexAttribState> VertexAttribStateVector;
+ typedef std::vector<BufferBinding> VertexAttribBindingVector;
+
+ struct VAOState {
+ VAOState(GLuint ibo, int nLoc, int nBindings) :
+ attribState(nLoc),
+ bindingState(nBindings),
+ element_array_buffer_binding(ibo),
+ element_array_buffer_binding_lastEncode(ibo) { }
+ VertexAttribStateVector attribState;
+ VertexAttribBindingVector bindingState;
+ GLuint element_array_buffer_binding;
+ GLuint element_array_buffer_binding_lastEncode;
+ int attributesNeedingUpdateForDraw[CODEC_MAX_VERTEX_ATTRIBUTES];
+ int numAttributesNeedingUpdateForDraw;
+ };
+
+ typedef std::map<GLuint, VAOState> VAOStateMap;
+ struct VAOStateRef {
+ VAOStateRef() { }
+ VAOStateRef(
+ VAOStateMap::iterator iter) : it(iter) { }
+ VAOState& vaoState() { return it->second; }
+ VertexAttribState& operator[](size_t k) { return it->second.attribState[k]; }
+ BufferBinding& bufferBinding(size_t k) { return it->second.bindingState[k]; }
+ VertexAttribBindingVector& bufferBindings() { return it->second.bindingState; }
+ const VertexAttribBindingVector& bufferBindings_const() const { return it->second.bindingState; }
+ GLuint vaoId() const { return it->first; }
+ GLuint& iboId() { return it->second.element_array_buffer_binding; }
+ GLuint& iboIdLastEncode() { return it->second.element_array_buffer_binding_lastEncode; }
+ VAOStateMap::iterator it;
+ };
+
+ typedef struct {
+ int unpack_alignment;
+
+ int unpack_row_length;
+ int unpack_image_height;
+ int unpack_skip_pixels;
+ int unpack_skip_rows;
+ int unpack_skip_images;
+
+ int pack_alignment;
+
+ int pack_row_length;
+ int pack_skip_pixels;
+ int pack_skip_rows;
+ } PixelStoreState;
+
+ enum {
+ MAX_TEXTURE_UNITS = 256,
+ };
+
+public:
+ GLClientState();
+ GLClientState(int majorVersion, int minorVersion);
+ ~GLClientState();
+ int nLocations() { return CODEC_MAX_VERTEX_ATTRIBUTES; }
+ const PixelStoreState *pixelStoreState() { return &m_pixelStore; }
+ int setPixelStore(GLenum param, GLint value);
+ GLuint currentVertexArrayObject() const { return m_currVaoState.vaoId(); }
+ const VertexAttribBindingVector& currentVertexBufferBindings() const {
+ return m_currVaoState.bufferBindings_const();
+ }
+
+ GLuint currentArrayVbo() { return m_arrayBuffer; }
+ GLuint currentIndexVbo() { return m_currVaoState.iboId(); }
+ void enable(int location, int state);
+ // Vertex array objects and vertex attributes
+ void addVertexArrayObjects(GLsizei n, GLuint* arrays);
+ void removeVertexArrayObjects(GLsizei n, const GLuint* arrays);
+ void addVertexArrayObject(GLuint name);
+ void removeVertexArrayObject(GLuint name);
+ void setVertexArrayObject(GLuint vao);
+ bool isVertexArrayObject(GLuint vao) const;
+ void setVertexAttribState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, const void *data, bool isInt = false);
+ void setVertexBindingDivisor(int bindingindex, GLuint divisor);
+ const BufferBinding& getCurrAttributeBindingInfo(int attribindex);
+ void setVertexAttribBinding(int attribindex, int bindingindex);
+ void setVertexAttribFormat(int location, int size, GLenum type, GLboolean normalized, GLuint reloffset, bool isInt = false);
+ void getVBOUsage(bool* hasClientArrays, bool* hasVBOs);
+ const VertexAttribState& getState(int location);
+ const VertexAttribState& getStateAndEnableDirty(int location, bool *enableChanged);
+ void updateEnableDirtyArrayForDraw();
+ VAOState& currentVaoState();
+ int getLocation(GLenum loc);
+ void setActiveTexture(int texUnit) {m_activeTexture = texUnit; };
+ int getActiveTexture() const { return m_activeTexture; }
+
+ void addBuffer(GLuint id);
+ void removeBuffer(GLuint id);
+ bool bufferIdExists(GLuint id) const;
+ void unBindBuffer(GLuint id);
+
+ void setBufferHostMapDirty(GLuint id, bool dirty);
+ bool isBufferHostMapDirty(GLuint id) const;
+
+ void setExistence(ObjectType type, bool exists, GLsizei count, const GLuint* ids);
+ bool queryExistence(ObjectType type, GLuint id) const;
+ bool samplerExists(GLuint id) const;
+ bool tryBind(GLenum target, GLuint id);
+ bool isBoundTargetValid(GLenum target);
+ bool isQueryBound(GLenum target);
+ bool isQueryObjectActive(GLuint id);
+ void setLastQueryTarget(GLenum target, GLuint id);
+ GLenum getLastQueryTarget(GLuint id);
+
+ static void onFenceCreated(GLsync sync);
+ static void onFenceDestroyed(GLsync sync);
+ static bool fenceExists(GLsync sync);
+
+ void setBoundPixelPackBufferDirtyForHostMap();
+ void setBoundTransformFeedbackBuffersDirtyForHostMap();
+ void setBoundShaderStorageBuffersDirtyForHostMap();
+ void setBoundAtomicCounterBuffersDirtyForHostMap();
+
+ int bindBuffer(GLenum target, GLuint id);
+ void bindIndexedBuffer(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size, GLintptr stride, GLintptr effectiveStride);
+ int getMaxIndexedBufferBindings(GLenum target) const;
+ bool isNonIndexedBindNoOp(GLenum target, GLuint buffer);
+ bool isIndexedBindNoOp(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size, GLintptr stride, GLintptr effectiveStride);
+
+ int getMaxTextureSize() const;
+ int getMaxTextureSize3D() const;
+ int getMaxTextureSizeCubeMap() const;
+ int getLog2MaxTextureSize() const;
+
+ void postDraw();
+ void postReadPixels();
+ void postDispatchCompute();
+
+ bool shouldSkipHostMapBuffer(GLenum target);
+ void onHostMappedBuffer(GLenum target);
+
+ int getBuffer(GLenum target);
+ GLuint getLastEncodedBufferBind(GLenum target);
+ void setLastEncodedBufferBind(GLenum target, GLuint id);
+
+ size_t pixelDataSize(GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack) const;
+ size_t pboNeededDataSize(GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack, int ignoreTrailing = 0) const;
+ size_t clearBufferNumElts(GLenum buffer) const;
+ void getPackingOffsets2D(GLsizei width, GLsizei height, GLenum format, GLenum type, int* bpp, int* startOffset, int* pixelRowSize, int* totalRowSize, int* skipRows) const;
+ void getUnpackingOffsets2D(GLsizei width, GLsizei height, GLenum format, GLenum type, int* bpp, int* startOffset, int* pixelRowSize, int* totalRowSize, int* skipRows) const;
+ void getUnpackingOffsets3D(GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int* bpp, int* startOffset, int* pixelRowSize, int* totalRowSize, int* pixelImageSize, int* totalImageSize, int* skipRows, int* skipImages) const;
+
+ void setCurrentProgram(GLint program) { m_currentProgram = program; }
+ void setCurrentShaderProgram(GLint program) { m_currentShaderProgram = program; }
+ GLint currentProgram() const { return m_currentProgram; }
+ GLint currentShaderProgram() const { return m_currentShaderProgram; }
+
+ struct UniformBlockInfoKey {
+ GLuint program;
+ GLuint uniformBlockIndex;
+ };
+ struct UniformBlockInfoKeyCompare {
+ bool operator() (const UniformBlockInfoKey& a,
+ const UniformBlockInfoKey& b) const {
+ if (a.program != b.program) return a.program < b.program;
+ if (a.uniformBlockIndex != b.uniformBlockIndex) return a.uniformBlockIndex < b.uniformBlockIndex;
+ return false;
+ }
+ };
+ struct UniformBlockUniformInfo {
+ size_t numActiveUniforms;
+ };
+
+ typedef std::map<UniformBlockInfoKey, UniformBlockUniformInfo, UniformBlockInfoKeyCompare> UniformBlockInfoMap;
+ UniformBlockInfoMap m_uniformBlockInfoMap;
+
+ void setNumActiveUniformsInUniformBlock(GLuint program, GLuint uniformBlockIndex, GLint numActiveUniforms);
+ size_t numActiveUniformsInUniformBlock(GLuint program, GLuint uniformBlockIndex) const;
+
+ typedef std::map<GLuint, GLuint> ProgramPipelineMap;
+ typedef ProgramPipelineMap::iterator ProgramPipelineIterator;
+ void associateProgramWithPipeline(GLuint program, GLuint pipeline);
+ ProgramPipelineIterator programPipelineBegin();
+ ProgramPipelineIterator programPipelineEnd();
+
+ /* OES_EGL_image_external
+ *
+ * These functions manipulate GL state which interacts with the
+ * OES_EGL_image_external extension, to support client-side emulation on
+ * top of host implementations that don't have it.
+ *
+ * Most of these calls should only be used with TEXTURE_2D or
+ * TEXTURE_EXTERNAL_OES texture targets; TEXTURE_CUBE_MAP or other extension
+ * targets should bypass this. An exception is bindTexture(), which should
+ * see all glBindTexture() calls for any target.
+ */
+
+ // glActiveTexture(GL_TEXTURE0 + i)
+ // Sets the active texture unit. Up to MAX_TEXTURE_UNITS are supported.
+ GLenum setActiveTextureUnit(GLenum texture);
+ GLenum getActiveTextureUnit() const;
+
+ // glEnable(GL_TEXTURE_(2D|EXTERNAL_OES))
+ void enableTextureTarget(GLenum target);
+
+ // glDisable(GL_TEXTURE_(2D|EXTERNAL_OES))
+ void disableTextureTarget(GLenum target);
+
+ bool bindSampler(GLuint unit, GLuint sampler);
+ bool isSamplerBindNoOp(GLuint unit, GLuint sampler);
+ void onDeleteSamplers(GLsizei n, const GLuint* samplers);
+
+ // Implements the target priority logic:
+ // * Return GL_TEXTURE_EXTERNAL_OES if enabled, else
+ // * Return GL_TEXTURE_2D if enabled, else
+ // * Return the allDisabled value.
+ // For some cases passing GL_TEXTURE_2D for allDisabled makes callee code
+ // simpler; for other cases passing a recognizable enum like GL_ZERO or
+ // GL_INVALID_ENUM is appropriate.
+ GLenum getPriorityEnabledTarget(GLenum allDisabled) const;
+
+ // glBindTexture(GL_TEXTURE_*, ...)
+ // Set the target binding of the active texture unit to texture. Returns
+ // GL_NO_ERROR on success or GL_INVALID_OPERATION if the texture has
+ // previously been bound to a different target. If firstUse is not NULL,
+ // it is set to indicate whether this is the first use of the texture.
+ // For accurate error detection, bindTexture should be called for *all*
+ // targets, not just 2D and EXTERNAL_OES.
+ GLenum bindTexture(GLenum target, GLuint texture, GLboolean* firstUse);
+ void setBoundEGLImage(GLenum target, GLeglImageOES image, int width, int height);
+
+ // Return the texture currently bound to GL_TEXTURE_(2D|EXTERNAL_OES).
+ GLuint getBoundTexture(GLenum target) const;
+ // Return bound framebuffer for target
+ GLuint getBoundFramebuffer(GLenum target) const;
+
+ // Check framebuffer completeness
+ GLenum checkFramebufferCompleteness(GLenum target);
+ // |currentSamples|: threads through the current sample count of attachments so far,
+ // for validating consistent number of samples across attachments
+ GLenum checkFramebufferAttachmentCompleteness(GLenum target, GLenum attachment, int* currentSamples) const;
+
+ // Other publicly-visible texture queries
+ GLenum queryTexLastBoundTarget(GLuint name) const;
+ GLenum queryTexFormat(GLuint name) const;
+ GLint queryTexInternalFormat(GLuint name) const;
+ GLsizei queryTexWidth(GLsizei level, GLuint name) const;
+ GLsizei queryTexHeight(GLsizei level, GLuint name) const;
+ GLsizei queryTexDepth(GLsizei level, GLuint name) const;
+ bool queryTexEGLImageBacked(GLuint name) const;
+
+ // For AMD GPUs, it is easy for the emulator to segfault
+ // (esp. in dEQP) when a cube map is defined using glCopyTexImage2D
+ // and uses GL_LUMINANCE as internal format.
+ // In particular, the segfault happens when negative components of
+ // cube maps are defined before positive ones,
+ // This procedure checks internal state to see if we have defined
+ // the positive component of a cube map already. If not, it returns
+ // which positive component needs to be defined first.
+ // If there is no need for the extra definition, 0 is returned.
+ GLenum copyTexImageLuminanceCubeMapAMDWorkaround(GLenum target, GLint level,
+ GLenum internalformat);
+
+ // Tracks the format of the currently bound texture.
+ // This is to pass dEQP tests for fbo completeness.
+ void setBoundTextureInternalFormat(GLenum target, GLint format);
+ void setBoundTextureFormat(GLenum target, GLenum format);
+ void setBoundTextureType(GLenum target, GLenum type);
+ void setBoundTextureDims(GLenum target, GLenum cubetarget, GLsizei level, GLsizei width, GLsizei height, GLsizei depth);
+ void setBoundTextureSamples(GLenum target, GLsizei samples);
+ void addTextureCubeMapImage(GLenum stateTarget, GLenum cubeTarget);
+
+ // glTexStorage2D disallows any change in texture format after it is set for a particular texture.
+ void setBoundTextureImmutableFormat(GLenum target);
+ bool isBoundTextureImmutableFormat(GLenum target) const;
+ bool isBoundTextureComplete(GLenum target) const;
+
+ // glDeleteTextures(...)
+ // Remove references to the to-be-deleted textures.
+ void deleteTextures(GLsizei n, const GLuint* textures);
+
+ // Render buffer objects
+ void addRenderbuffers(GLsizei n, GLuint* renderbuffers);
+ void removeRenderbuffers(GLsizei n, const GLuint* renderbuffers);
+ bool usedRenderbufferName(GLuint name) const;
+ void bindRenderbuffer(GLenum target, GLuint name);
+ GLuint boundRenderbuffer() const;
+ void setBoundRenderbufferFormat(GLenum format);
+ void setBoundRenderbufferSamples(GLsizei samples);
+ void setBoundRenderbufferDimensions(GLsizei width, GLsizei height);
+ void setBoundRenderbufferEGLImageBacked();
+
+ // Frame buffer objects
+ void addFramebuffers(GLsizei n, GLuint* framebuffers);
+ void removeFramebuffers(GLsizei n, const GLuint* framebuffers);
+ bool usedFramebufferName(GLuint name) const;
+ void bindFramebuffer(GLenum target, GLuint name);
+ void setCheckFramebufferStatus(GLenum target, GLenum status);
+ void setFramebufferParameter(GLenum target, GLenum pname, GLint param);
+ GLenum getCheckFramebufferStatus(GLenum target) const;
+ GLuint boundFramebuffer(GLenum target) const;
+
+ // Texture object -> FBO
+ void attachTextureObject(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+ std::shared_ptr<TextureRec> getFboAttachmentTexture(GLenum target, GLenum attachment) const;
+
+ // RBO -> FBO
+ void detachRbo(GLuint renderbuffer);
+ void detachRboFromFbo(GLenum target, GLenum attachment, GLuint renderbuffer);
+ void attachRbo(GLenum target, GLenum attachment, GLuint renderbuffer);
+ std::shared_ptr<RboProps> getFboAttachmentRbo(GLenum target, GLenum attachment) const;
+
+ // FBO attachments in general
+ bool attachmentHasObject(GLenum target, GLenum attachment) const;
+ bool depthStencilHasSameObject(GLenum target) const;
+
+ // Dirty FBO completeness
+ void setFboCompletenessDirtyForTexture(GLuint texture);
+ void setFboCompletenessDirtyForRbo(std::shared_ptr<RboProps> rbo);
+
+ // Transform feedback state
+ void setTransformFeedbackActive(bool active);
+ void setTransformFeedbackUnpaused(bool unpaused);
+ void setTransformFeedbackVaryingsCountForLinking(uint32_t count);
+ bool getTransformFeedbackActive() const;
+ bool getTransformFeedbackUnpaused() const;
+ bool getTransformFeedbackActiveUnpaused() const;
+ uint32_t getTransformFeedbackVaryingsCountForLinking() const;
+
+ // Stencil state
+ void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
+ void stencilMaskSeparate(GLenum face, GLuint mask);
+ void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+
+ void setTextureData(SharedTextureDataMap* sharedTexData);
+ void setRenderbufferInfo(RenderbufferInfo* rbInfo);
+ void setSamplerInfo(SamplerInfo* samplerInfo);
+
+ bool compressedTexImageSizeCompatible(GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei imageSize);
+ // set eglsurface property on default framebuffer
+ // if coming from eglMakeCurrent
+ void fromMakeCurrent();
+ // set indexed buffer state.
+ // We need to query the underlying OpenGL to get
+ // accurate values for indexed buffers
+ // and # render targets.
+ void initFromCaps(
+ const HostDriverCaps& caps);
+ bool needsInitFromCaps() const;
+ void setExtensions(const std::string& extensions);
+ bool hasExtension(const char* ext) const;
+
+ // Queries the format backing the current framebuffer.
+ // Type differs depending on whether the attachment
+ // is a texture or renderbuffer.
+ void getBoundFramebufferFormat(
+ GLenum target,
+ GLenum attachment,
+ FboFormatInfo* res_info) const;
+ FboAttachmentType getBoundFramebufferAttachmentType(
+ GLenum target,
+ GLenum attachment) const;
+ int getMaxColorAttachments() const;
+ int getMaxDrawBuffers() const;
+
+ // Uniform/attribute validation info
+ UniformValidationInfo currentUniformValidationInfo;
+ AttribValidationInfo currentAttribValidationInfo;;
+
+ // Uniform validation api
+ void validateUniform(bool isFloat, bool isUnsigned, GLint columns, GLint rows, GLint location, GLsizei count, GLenum* err);
+ // Attrib validation
+ bool isAttribIndexUsedByProgram(int attribIndex);
+
+ // Fast access to some enables and stencil related glGet's
+ bool state_GL_STENCIL_TEST;
+ GLenum state_GL_STENCIL_FUNC;
+ unsigned int state_GL_STENCIL_VALUE_MASK;
+ int state_GL_STENCIL_REF;
+ GLenum state_GL_STENCIL_FAIL;
+ GLenum state_GL_STENCIL_PASS_DEPTH_FAIL;
+ GLenum state_GL_STENCIL_PASS_DEPTH_PASS;
+ GLenum state_GL_STENCIL_BACK_FUNC;
+ unsigned int state_GL_STENCIL_BACK_VALUE_MASK;
+ int state_GL_STENCIL_BACK_REF;
+ GLenum state_GL_STENCIL_BACK_FAIL;
+ GLenum state_GL_STENCIL_BACK_PASS_DEPTH_FAIL;
+ GLenum state_GL_STENCIL_BACK_PASS_DEPTH_PASS;
+ unsigned int state_GL_STENCIL_WRITEMASK;
+ unsigned int state_GL_STENCIL_BACK_WRITEMASK;
+ int state_GL_STENCIL_CLEAR_VALUE;
+private:
+ void init();
+ bool m_initialized;
+ PixelStoreState m_pixelStore;
+
+ using DirtyMap = PredicateMap<uint32_t, true>;
+
+ ExistenceMap mBufferIds;
+ ExistenceMap mTransformFeedbackIds;
+ SamplerInfo* mSamplerInfo;
+ ExistenceMap mQueryIds;
+ LastQueryTargetInfo mLastQueryTargets;
+
+ // Bound query target validity and tracking
+ struct BoundTargetInfo {
+ GLuint id;
+ bool valid;
+ };
+
+ // Transform feedback
+ BoundTargetInfo mBoundTransformFeedbackValidity;
+
+ // Queries
+ // GL_ANY_SAMPLES_PASSED
+ BoundTargetInfo mBoundQueryValidity_AnySamplesPassed;
+ // GL_ANY_SAMPLES_PASSED_CONSERVATIVE
+ BoundTargetInfo mBoundQueryValidity_AnySamplesPassedConservative;
+ // GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
+ BoundTargetInfo mBoundQueryValidity_TransformFeedbackPrimitivesWritten;
+
+ // Dirty maps
+ DirtyMap mHostMappedBufferDirty;
+
+ // GL_ARRAY_BUFFER_BINDING is separate from VAO state
+ GLuint m_arrayBuffer;
+ GLuint m_arrayBuffer_lastEncode;
+ VAOStateMap m_vaoMap;
+ VAOStateRef m_currVaoState;
+
+ uint16_t m_attribEnableCache;
+ uint16_t m_vaoAttribBindingCacheInvalid;
+ uint16_t m_vaoAttribBindingHasClientArrayCache;
+ uint16_t m_vaoAttribBindingHasVboCache;
+ uint8_t m_noClientArraysCache;
+
+ // Other buffer id's, other targets
+ GLuint m_copyReadBuffer;
+ GLuint m_copyWriteBuffer;
+
+ GLuint m_pixelPackBuffer;
+ GLuint m_pixelUnpackBuffer;
+
+ GLuint m_transformFeedbackBuffer;
+ GLuint m_uniformBuffer;
+
+ GLuint m_atomicCounterBuffer;
+ GLuint m_dispatchIndirectBuffer;
+ GLuint m_drawIndirectBuffer;
+ GLuint m_shaderStorageBuffer;
+ GLuint m_textureBuffer;
+
+ bool m_transformFeedbackActive;
+ bool m_transformFeedbackUnpaused;
+ uint32_t m_transformFeedbackVaryingsCountForLinking;
+
+ HostDriverCaps m_hostDriverCaps;
+ bool m_extensions_set;
+ std::string m_extensions;
+ bool m_has_color_buffer_float_extension;
+ bool m_has_color_buffer_half_float_extension;
+ std::vector<BufferBinding> m_indexedTransformFeedbackBuffers;
+ std::vector<BufferBinding> m_indexedUniformBuffers;
+ std::vector<BufferBinding> m_indexedAtomicCounterBuffers;
+ std::vector<BufferBinding> m_indexedShaderStorageBuffers;
+ int m_log2MaxTextureSize;
+
+ int m_glesMajorVersion;
+ int m_glesMinorVersion;
+ int m_activeTexture;
+ GLint m_currentProgram;
+ GLint m_currentShaderProgram;
+ ProgramPipelineMap m_programPipelines;
+
+ enum TextureTarget {
+ TEXTURE_2D = 0,
+ TEXTURE_EXTERNAL = 1,
+ TEXTURE_CUBE_MAP = 2,
+ TEXTURE_2D_ARRAY = 3,
+ TEXTURE_3D = 4,
+ TEXTURE_2D_MULTISAMPLE = 5,
+ TEXTURE_BUFFER = 6,
+ TEXTURE_TARGET_COUNT
+ };
+ struct TextureUnit {
+ unsigned int enables;
+ GLuint texture[TEXTURE_TARGET_COUNT];
+ GLuint boundSampler;
+ };
+ struct TextureState {
+ TextureUnit unit[MAX_TEXTURE_UNITS];
+ TextureUnit* activeUnit;
+ // Initialized from shared group.
+ SharedTextureDataMap* textureRecs;
+ };
+ TextureState m_tex;
+
+ // State tracking of cube map definitions.
+ // Currently used only for driver workarounds
+ // when using GL_LUMINANCE and defining cube maps with
+ // glCopyTexImage2D.
+ struct CubeMapDef {
+ GLuint id;
+ GLenum target;
+ GLint level;
+ GLenum internalformat;
+ };
+ struct CubeMapDefCompare {
+ bool operator() (const CubeMapDef& a,
+ const CubeMapDef& b) const {
+ if (a.id != b.id) return a.id < b.id;
+ if (a.target != b.target) return a.target < b.target;
+ if (a.level != b.level) return a.level < b.level;
+ if (a.internalformat != b.internalformat)
+ return a.internalformat < b.internalformat;
+ return false;
+ }
+ };
+ std::set<CubeMapDef, CubeMapDefCompare> m_cubeMapDefs;
+ void writeCopyTexImageState(GLenum target, GLint level,
+ GLenum internalformat);
+ GLenum copyTexImageNeededTarget(GLenum target, GLint level,
+ GLenum internalformat);
+
+ struct RboState {
+ std::shared_ptr<RboProps> boundRenderbuffer;
+ // Connects to share group.
+ // Expected that share group lifetime outlives this context.
+ RenderbufferInfo* rboData;
+ };
+ RboState mRboState;
+ void addFreshRenderbuffer(GLuint name);
+
+ struct FboState {
+ GLuint boundDrawFramebuffer;
+ GLuint boundReadFramebuffer;
+ size_t boundFramebufferIndex;
+ std::map<GLuint, FboProps> fboData;
+ GLenum drawFboCheckStatus;
+ GLenum readFboCheckStatus;
+ };
+ FboState mFboState;
+ void addFreshFramebuffer(GLuint name);
+ FboProps& boundFboProps(GLenum target);
+ const FboProps& boundFboProps_const(GLenum target) const;
+
+ // Querying framebuffer format
+ GLenum queryTexType(GLuint name) const;
+ GLsizei queryTexSamples(GLuint name) const;
+
+ static int compareTexId(const void* pid, const void* prec);
+ TextureRec* addTextureRec(GLuint id, GLenum target);
+ std::shared_ptr<TextureRec> getTextureRec(GLuint id) const;
+ TextureRec* getTextureRecPtr(GLuint id) const;
+ TextureRec* getTextureRecPtrLocked(GLuint id) const;
+
+public:
+ bool isTexture(GLuint name) const;
+ bool isTextureWithStorage(GLuint name) const;
+ bool isTextureWithTarget(GLuint name) const;
+ bool isTextureCubeMap(GLuint name) const;
+ bool isRenderbuffer(GLuint name) const;
+ bool isRenderbufferThatWasBound(GLuint name) const;
+
+ void getClientStatePointer(GLenum pname, GLvoid** params);
+
+ template <class T>
+ int getVertexAttribParameter(GLuint index, GLenum param, T *ptr)
+ {
+ bool handled = true;
+ const VertexAttribState& vertexAttrib = getState(index);
+ const BufferBinding& vertexAttribBufferBinding =
+ m_currVaoState.bufferBindings_const()[vertexAttrib.bindingindex];
+
+ switch(param) {
+#define GL_VERTEX_ATTRIB_BINDING 0x82D4
+ case GL_VERTEX_ATTRIB_BINDING:
+ *ptr = (T)vertexAttrib.bindingindex;
+ break;
+#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5
+ case GL_VERTEX_ATTRIB_RELATIVE_OFFSET:
+ *ptr = (T)vertexAttrib.reloffset;
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
+ *ptr = (T)(vertexAttribBufferBinding.buffer);
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY_ENABLED:
+ *ptr = (T)(vertexAttrib.enabled);
+ break;
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
+ case GL_VERTEX_ATTRIB_ARRAY_INTEGER:
+ *ptr = (T)(vertexAttrib.isInt);
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY_SIZE:
+ *ptr = (T)(vertexAttrib.size);
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY_STRIDE:
+ *ptr = (T)(vertexAttribBufferBinding.stride);
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY_TYPE:
+ *ptr = (T)(vertexAttrib.type);
+ break;
+ case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:
+ *ptr = (T)(vertexAttrib.normalized);
+ break;
+ case GL_CURRENT_VERTEX_ATTRIB:
+ handled = false;
+ break;
+ default:
+ handled = false;
+ ERR("unknown vertex-attrib parameter param %d\n", param);
+ }
+ return handled;
+ }
+
+ template <class T>
+ bool getClientStateParameter(GLenum param, T* out)
+ {
+ bool isClientStateParam = false;
+ switch (param) {
+ case GL_CLIENT_ACTIVE_TEXTURE: {
+ GLint tex = getActiveTexture() + GL_TEXTURE0;
+ *out = tex;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_VERTEX_ARRAY_SIZE: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::VERTEX_LOCATION);
+ *out = state.size;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_VERTEX_ARRAY_TYPE: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::VERTEX_LOCATION);
+ *out = state.type;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_VERTEX_ARRAY_STRIDE: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::VERTEX_LOCATION);
+ *out = state.stride;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_COLOR_ARRAY_SIZE: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::COLOR_LOCATION);
+ *out = state.size;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_COLOR_ARRAY_TYPE: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::COLOR_LOCATION);
+ *out = state.type;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_COLOR_ARRAY_STRIDE: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::COLOR_LOCATION);
+ *out = state.stride;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_NORMAL_ARRAY_TYPE: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::NORMAL_LOCATION);
+ *out = state.type;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_NORMAL_ARRAY_STRIDE: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::NORMAL_LOCATION);
+ *out = state.stride;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_TEXTURE_COORD_ARRAY_SIZE: {
+ const GLClientState::VertexAttribState& state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
+ *out = state.size;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_TEXTURE_COORD_ARRAY_TYPE: {
+ const GLClientState::VertexAttribState& state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
+ *out = state.type;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_TEXTURE_COORD_ARRAY_STRIDE: {
+ const GLClientState::VertexAttribState& state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
+ *out = state.stride;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_POINT_SIZE_ARRAY_TYPE_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::POINTSIZE_LOCATION);
+ *out = state.type;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_POINT_SIZE_ARRAY_STRIDE_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::POINTSIZE_LOCATION);
+ *out = state.stride;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_MATRIX_INDEX_ARRAY_SIZE_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::MATRIXINDEX_LOCATION);
+ *out = state.size;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_MATRIX_INDEX_ARRAY_TYPE_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::MATRIXINDEX_LOCATION);
+ *out = state.type;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::MATRIXINDEX_LOCATION);
+ *out = state.stride;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_WEIGHT_ARRAY_SIZE_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::WEIGHT_LOCATION);
+ *out = state.size;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_WEIGHT_ARRAY_TYPE_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::WEIGHT_LOCATION);
+ *out = state.type;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_WEIGHT_ARRAY_STRIDE_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::WEIGHT_LOCATION);
+ *out = state.stride;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_VERTEX_ARRAY_BUFFER_BINDING: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::VERTEX_LOCATION);
+ *out = state.bufferObject;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_NORMAL_ARRAY_BUFFER_BINDING: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::NORMAL_LOCATION);
+ *out = state.bufferObject;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_COLOR_ARRAY_BUFFER_BINDING: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::COLOR_LOCATION);
+ *out = state.bufferObject;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: {
+ const GLClientState::VertexAttribState& state = getState(getActiveTexture()+GLClientState::TEXCOORD0_LOCATION);
+ *out = state.bufferObject;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::POINTSIZE_LOCATION);
+ *out = state.bufferObject;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::MATRIXINDEX_LOCATION);
+ *out = state.bufferObject;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: {
+ const GLClientState::VertexAttribState& state = getState(GLClientState::WEIGHT_LOCATION);
+ *out = state.bufferObject;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_ARRAY_BUFFER_BINDING: {
+ int buffer = getBuffer(GL_ARRAY_BUFFER);
+ *out = buffer;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_ELEMENT_ARRAY_BUFFER_BINDING: {
+ int buffer = getBuffer(GL_ELEMENT_ARRAY_BUFFER);
+ *out = buffer;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_MAX_VERTEX_ATTRIBS: {
+ *out = CODEC_MAX_VERTEX_ATTRIBUTES;
+ isClientStateParam = true;
+ break;
+ }
+ case GL_FRAMEBUFFER_BINDING:
+ // also case GL_DRAW_FRAMEBUFFER_BINDING:
+ *out = (T)mFboState.boundDrawFramebuffer;
+ isClientStateParam = true;
+ break;
+ case 0x8CAA: // GL_READ_FRAMEBUFFER_BINDING
+ *out = (T)mFboState.boundReadFramebuffer;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_TEST:
+ *out = (T)state_GL_STENCIL_TEST;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_FUNC:
+ *out = (T)state_GL_STENCIL_FUNC;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_VALUE_MASK:
+ *out = (T)state_GL_STENCIL_VALUE_MASK;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_REF:
+ *out = (T)state_GL_STENCIL_REF;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_FAIL:
+ *out = (T)state_GL_STENCIL_FAIL;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_PASS_DEPTH_FAIL:
+ *out = (T)state_GL_STENCIL_PASS_DEPTH_FAIL;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_PASS_DEPTH_PASS:
+ *out = (T)state_GL_STENCIL_PASS_DEPTH_PASS;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_BACK_FUNC:
+ *out = (T)state_GL_STENCIL_BACK_FUNC;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_BACK_VALUE_MASK:
+ *out = (T)state_GL_STENCIL_BACK_VALUE_MASK;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_BACK_REF:
+ *out = (T)state_GL_STENCIL_BACK_REF;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_BACK_FAIL:
+ *out = (T)state_GL_STENCIL_BACK_FAIL;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
+ *out = (T)state_GL_STENCIL_BACK_PASS_DEPTH_FAIL;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_BACK_PASS_DEPTH_PASS:
+ *out = (T)state_GL_STENCIL_BACK_PASS_DEPTH_PASS;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_WRITEMASK:
+ *out = (T)state_GL_STENCIL_WRITEMASK;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_BACK_WRITEMASK:
+ *out = (T)state_GL_STENCIL_BACK_WRITEMASK;
+ isClientStateParam = true;
+ break;
+ case GL_STENCIL_CLEAR_VALUE:
+ *out = (T)state_GL_STENCIL_CLEAR_VALUE;
+ isClientStateParam = true;
+ break;
+ }
+ return isClientStateParam;
+ }
+
+};
+
+} // namespace guest
+} // namespace gfxstream
+
+#endif
diff --git a/src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/GLSharedGroup.h b/src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/GLSharedGroup.h
new file mode 100755
index 00000000000..86c4d620cf9
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/include/gfxstream/guest/GLSharedGroup.h
@@ -0,0 +1,267 @@
+/*
+* 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_SHARED_GROUP_H_
+#define _GL_SHARED_GROUP_H_
+
+#define GL_API
+#ifndef ANDROID
+#define GL_APIENTRY
+#define GL_APIENTRYP
+#endif
+
+#include "TextureSharedData.h"
+
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "ErrorLog.h"
+#include "IndexRangeCache.h"
+#include "StateTrackingSupport.h"
+
+using gfxstream::guest::AutoLock;
+using gfxstream::guest::Lock;
+
+namespace gfxstream {
+namespace guest {
+
+struct BufferData {
+ BufferData();
+ BufferData(GLsizeiptr size, const void* data);
+
+ // General buffer state
+ GLsizeiptr m_size;
+ GLenum m_usage;
+
+ // Mapped buffer state
+ bool m_mapped;
+ GLbitfield m_mappedAccess;
+ GLintptr m_mappedOffset;
+ GLsizeiptr m_mappedLength;
+ uint64_t m_guest_paddr;
+
+ // Internal bookkeeping
+ std::vector<char> m_fixedBuffer; // actual buffer is shadowed here
+ IndexRangeCache m_indexRangeCache;
+};
+
+class ProgramData {
+private:
+ typedef struct _IndexInfo {
+ GLint base;
+ GLint size;
+ GLenum type;
+ GLint hostLocsPerElement;
+ GLuint flags;
+ GLint samplerValue; // only set for sampler uniforms
+ } IndexInfo;
+
+ typedef struct _AttribInfo {
+ GLint attribLoc;
+ GLint size;
+ GLenum type;
+ } AttribInfo;
+
+ GLuint m_numIndexes;
+ GLuint m_numAttributes;
+ IndexInfo* m_Indexes;
+ AttribInfo* m_attribIndexes;
+ bool m_initialized;
+
+ std::vector<GLuint> m_shaders;
+ std::vector<GLenum> m_shaderTypes;
+
+ uint32_t m_refcount;
+ GLint m_linkStatus;
+
+ uint32_t m_activeUniformBlockCount;
+ uint32_t m_transformFeedbackVaryingsCount;;
+
+public:
+ enum {
+ INDEX_FLAG_SAMPLER_EXTERNAL = 0x00000001,
+ };
+
+ ProgramData();
+ void initProgramData(GLuint numIndexes, GLuint numAttributes);
+ bool isInitialized();
+ virtual ~ProgramData();
+ void setIndexInfo(GLuint index, GLint base, GLint size, GLenum type);
+ void setAttribInfo(GLuint index, GLint base, GLint size, GLenum type);
+ void setIndexFlags(GLuint index, GLuint flags);
+ GLuint getIndexForLocation(GLint location);
+ GLenum getTypeForLocation(GLint location);
+ bool isValidUniformLocation(GLint location);
+
+ GLint getNextSamplerUniform(GLint index, GLint* val, GLenum* target);
+ bool setSamplerUniform(GLint appLoc, GLint val, GLenum* target);
+
+ bool attachShader(GLuint shader, GLenum shaderType);
+ bool detachShader(GLuint shader);
+ size_t getNumShaders() const { return m_shaders.size(); }
+ GLuint getShader(size_t i) const { return m_shaders[i]; }
+
+ void incRef() { ++m_refcount; }
+ bool decRef() {
+ --m_refcount;
+ return 0 == m_refcount;
+ }
+
+ UniformValidationInfo compileValidationInfo(bool* error) const;
+ AttribValidationInfo compileAttribValidationInfo(bool* error) const;
+ void setLinkStatus(GLint status) { m_linkStatus = status; }
+ GLint getLinkStatus() { return m_linkStatus; }
+
+ void setActiveUniformBlockCount(uint32_t count) {
+ m_activeUniformBlockCount = count;
+ }
+
+ uint32_t getActiveUniformBlockCount() const {
+ return m_activeUniformBlockCount;
+ }
+
+ void setTransformFeedbackVaryingsCount(uint32_t count) {
+ m_transformFeedbackVaryingsCount = count;
+ }
+
+ uint32_t getTransformFeedbackVaryingsCount() const {
+ return m_transformFeedbackVaryingsCount;
+ }
+
+ GLuint getActiveUniformsCount() const {
+ return m_numIndexes;
+ }
+
+ GLuint getActiveAttributesCount() const {
+ return m_numAttributes;
+ }
+};
+
+struct ShaderData {
+ typedef std::vector<std::string> StringList;
+ StringList samplerExternalNames;
+ int refcount;
+ std::vector<std::string> sources;
+ GLenum shaderType;
+};
+
+class ShaderProgramData {
+public:
+ ShaderData shaderData;
+ ProgramData programData;
+};
+
+class GLSharedGroup {
+private:
+ SharedTextureDataMap m_textureRecs;
+ std::map<GLuint, BufferData*> m_buffers;
+ std::map<GLuint, ProgramData*> m_programs;
+ std::map<GLuint, ShaderData*> m_shaders;
+ std::map<uint32_t, ShaderProgramData*> m_shaderPrograms;
+ std::map<GLuint, uint32_t> m_shaderProgramIdMap;
+ RenderbufferInfo m_renderbufferInfo;
+ SamplerInfo m_samplerInfo;
+
+ Lock m_lock;
+
+ void refShaderDataLocked(GLuint shader);
+ void unrefShaderDataLocked(GLuint shader);
+
+ uint32_t m_shaderProgramId;
+
+ ProgramData* getProgramDataLocked(GLuint program);
+public:
+ GLSharedGroup();
+ ~GLSharedGroup();
+ bool isShaderOrProgramObject(GLuint obj);
+ BufferData * getBufferData(GLuint bufferId);
+ SharedTextureDataMap* getTextureData();
+ RenderbufferInfo* getRenderbufferInfo();
+ SamplerInfo* getSamplerInfo();
+ void addBufferData(GLuint bufferId, GLsizeiptr size, const void* data);
+ void updateBufferData(GLuint bufferId, GLsizeiptr size, const void* data);
+ void setBufferUsage(GLuint bufferId, GLenum usage);
+ void setBufferMapped(GLuint bufferId, bool mapped);
+ GLenum getBufferUsage(GLuint bufferId);
+ bool isBufferMapped(GLuint bufferId);
+ GLenum subUpdateBufferData(GLuint bufferId, GLintptr offset, GLsizeiptr size, const void* data);
+ void deleteBufferData(GLuint);
+
+ bool isProgram(GLuint program);
+ bool isProgramInitialized(GLuint program);
+ void addProgramData(GLuint program);
+ void initProgramData(GLuint program, GLuint numIndexes, GLuint numAttributes);
+ void refProgramData(GLuint program);
+ void onUseProgram(GLuint previous, GLuint next);
+ bool attachShader(GLuint program, GLuint shader);
+ bool detachShader(GLuint program, GLuint shader);
+ bool detachShaderLocked(GLuint program, GLuint shader);
+ void deleteProgramData(GLuint program);
+ void deleteProgramDataLocked(GLuint program);
+ void setProgramIndexInfo(GLuint program, GLuint index, GLint base, GLint size, GLenum type, const char* name);
+ void setProgramAttribInfo(GLuint program, GLuint index, GLint attribLoc, GLint size, GLenum type, const char* name);
+ GLenum getProgramUniformType(GLuint program, GLint location);
+ GLint getNextSamplerUniform(GLuint program, GLint index, GLint* val, GLenum* target);
+ bool setSamplerUniform(GLuint program, GLint appLoc, GLint val, GLenum* target);
+ bool isProgramUniformLocationValid(GLuint program, GLint location);
+
+ bool isShader(GLuint shader);
+ bool addShaderData(GLuint shader, GLenum shaderType);
+ // caller must hold a reference to the shader as long as it holds the pointer
+ ShaderData* getShaderData(GLuint shader);
+ void unrefShaderData(GLuint shader);
+
+ // For separable shader programs.
+ uint32_t addNewShaderProgramData();
+ void associateGLShaderProgram(GLuint shaderProgramName, uint32_t shaderProgramId);
+ ShaderProgramData* getShaderProgramDataById(uint32_t id);
+ ShaderProgramData* getShaderProgramData(GLuint shaderProgramName);
+ void deleteShaderProgramDataById(uint32_t id);
+ void deleteShaderProgramData(GLuint shaderProgramName);
+ void initShaderProgramData(GLuint shaderProgram, GLuint numIndices, GLuint numAttributes);
+ void setShaderProgramIndexInfo(GLuint shaderProgram, GLuint index, GLint base, GLint size, GLenum type, const char* name);
+
+ // Validation info
+ UniformValidationInfo getUniformValidationInfo(GLuint program);
+ AttribValidationInfo getAttribValidationInfo(GLuint program);
+
+ void setProgramLinkStatus(GLuint program, GLint linkStatus);
+ GLint getProgramLinkStatus(GLuint program);
+
+ void setActiveUniformBlockCountForProgram(GLuint program, GLint numBlocks);
+ GLint getActiveUniformBlockCount(GLuint program);
+
+ void setTransformFeedbackVaryingsCountForProgram(GLuint program, GLint count);
+ GLint getTransformFeedbackVaryingsCountForProgram(GLuint program);
+
+ int getActiveUniformsCountForProgram(GLuint program);
+ int getActiveAttributesCountForProgram(GLuint program);
+};
+
+typedef std::shared_ptr<GLSharedGroup> GLSharedGroupPtr;
+
+} // namespace guest
+} // namespace gfxstream
+
+#endif //_GL_SHARED_GROUP_H_
diff --git a/src/gfxstream/guest/OpenglCodecCommon/meson.build b/src/gfxstream/guest/OpenglCodecCommon/meson.build
new file mode 100644
index 00000000000..f471b16c127
--- /dev/null
+++ b/src/gfxstream/guest/OpenglCodecCommon/meson.build
@@ -0,0 +1,4 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_codec_common = include_directories('include')
diff --git a/src/gfxstream/guest/OpenglSystemCommon/ANativeWindow.h b/src/gfxstream/guest/OpenglSystemCommon/ANativeWindow.h
new file mode 100644
index 00000000000..a50d9c29480
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/ANativeWindow.h
@@ -0,0 +1,56 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#include "Gralloc.h"
+
+namespace gfxstream {
+
+// Abstraction around libnativewindow to support testing.
+class ANativeWindowHelper {
+ public:
+ virtual ~ANativeWindowHelper() {}
+
+ virtual bool isValid(EGLNativeWindowType window) = 0;
+ virtual bool isValid(EGLClientBuffer buffer) = 0;
+
+ virtual void acquire(EGLNativeWindowType window) = 0;
+ virtual void release(EGLNativeWindowType window)= 0;
+
+ virtual void acquire(EGLClientBuffer buffer) = 0;
+ virtual void release(EGLClientBuffer buffer) = 0;
+
+ virtual int getConsumerUsage(EGLNativeWindowType window, int* usage) = 0;
+ virtual void setUsage(EGLNativeWindowType window, int usage) = 0;
+
+ virtual int getWidth(EGLNativeWindowType window) = 0;
+ virtual int getHeight(EGLNativeWindowType window) = 0;
+
+ virtual int getWidth(EGLClientBuffer buffer) = 0;
+ virtual int getHeight(EGLClientBuffer buffer) = 0;
+ virtual int getFormat(EGLClientBuffer buffer, Gralloc* helper) = 0;
+ virtual int getHostHandle(EGLClientBuffer buffer, Gralloc* helper) = 0;
+
+ virtual void setSwapInterval(EGLNativeWindowType window, int interval) = 0;
+
+ virtual int queueBuffer(EGLNativeWindowType window, EGLClientBuffer buffer, int fence) = 0;
+ virtual int dequeueBuffer(EGLNativeWindowType window, EGLClientBuffer* buffer, int* fence) = 0;
+ virtual int cancelBuffer(EGLNativeWindowType window, EGLClientBuffer buffer) = 0;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglSystemCommon/ANativeWindowAndroid.cpp b/src/gfxstream/guest/OpenglSystemCommon/ANativeWindowAndroid.cpp
new file mode 100644
index 00000000000..1edae7013a4
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/ANativeWindowAndroid.cpp
@@ -0,0 +1,221 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "ANativeWindowAndroid.h"
+
+#if defined(__ANDROID__)
+#include <android/native_window.h>
+#include <system/window.h>
+#endif // defined(__ANDROID__)
+
+namespace gfxstream {
+
+bool ANativeWindowHelperAndroid::isValid(EGLNativeWindowType window) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ return anw->common.magic == ANDROID_NATIVE_WINDOW_MAGIC;
+#else
+ (void)window;
+ return false;
+#endif // defined(__ANDROID__)
+}
+
+bool ANativeWindowHelperAndroid::isValid(EGLClientBuffer buffer) {
+#if defined(__ANDROID__)
+ auto* anwb = reinterpret_cast<ANativeWindowBuffer*>(buffer);
+ if (anwb->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
+ return false;
+ }
+ if (anwb->common.version != sizeof(android_native_buffer_t)) {
+ return false;
+ }
+ if (anwb->handle == nullptr) {
+ return false;
+ }
+ return true;
+#else
+ (void)buffer;
+ return false;
+#endif // defined(__ANDROID__)
+}
+
+void ANativeWindowHelperAndroid::acquire(EGLNativeWindowType window) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ ANativeWindow_acquire(anw);
+#else
+ (void)window;
+#endif // defined(__ANDROID__)
+}
+
+void ANativeWindowHelperAndroid::release(EGLNativeWindowType window) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ ANativeWindow_release(anw);
+#else
+ (void)window;
+#endif // defined(__ANDROID__)
+}
+
+
+void ANativeWindowHelperAndroid::acquire(EGLClientBuffer buffer) {
+#if defined(__ANDROID__)
+ auto* anwb = reinterpret_cast<ANativeWindowBuffer*>(buffer);
+ anwb->incStrong(anwb);
+#else
+ (void)buffer;
+#endif // defined(__ANDROID__)
+}
+
+void ANativeWindowHelperAndroid::release(EGLClientBuffer buffer) {
+#if defined(__ANDROID__)
+ auto* anwb = reinterpret_cast<ANativeWindowBuffer*>(buffer);
+ anwb->decStrong(anwb);
+#else
+ (void)buffer;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::getConsumerUsage(EGLNativeWindowType window, int* usage) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ return anw->query(anw, NATIVE_WINDOW_CONSUMER_USAGE_BITS, usage);
+#else
+ (void)window;
+ (void)usage;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+void ANativeWindowHelperAndroid::setUsage(EGLNativeWindowType window, int usage) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ ANativeWindow_setUsage(anw, usage);
+#else
+ (void)window;
+ (void)usage;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::getWidth(EGLNativeWindowType window) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ return ANativeWindow_getWidth(anw);
+#else
+ (void)window;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::getHeight(EGLNativeWindowType window) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ return ANativeWindow_getHeight(anw);
+#else
+ (void)window;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::getWidth(EGLClientBuffer buffer) {
+#if defined(__ANDROID__)
+ auto* anwb = reinterpret_cast<ANativeWindowBuffer*>(buffer);
+ return anwb->width;
+#else
+ (void)buffer;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::getHeight(EGLClientBuffer buffer) {
+#if defined(__ANDROID__)
+ auto* anwb = reinterpret_cast<ANativeWindowBuffer*>(buffer);
+ return anwb->height;
+#else
+ (void)buffer;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::getFormat(EGLClientBuffer buffer, Gralloc* gralloc) {
+#if defined(__ANDROID__)
+ auto* anb = reinterpret_cast<ANativeWindowBuffer*>(buffer);
+ return gralloc->getFormat(anb->handle);
+#else
+ (void)buffer;
+ (void)gralloc;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+void ANativeWindowHelperAndroid::setSwapInterval(EGLNativeWindowType window, int interval) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ anw->setSwapInterval(anw, interval);
+#else
+ (void)window;
+ (void)interval;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::queueBuffer(EGLNativeWindowType window, EGLClientBuffer buffer, int fence) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ auto* anb = reinterpret_cast<ANativeWindowBuffer*>(buffer);
+ return ANativeWindow_queueBuffer(anw, anb, fence);
+#else
+ (void)window;
+ (void)buffer;
+ (void)fence;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::dequeueBuffer(EGLNativeWindowType window, EGLClientBuffer* buffer, int* fence) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ auto* anb = reinterpret_cast<ANativeWindowBuffer**>(buffer);
+ return ANativeWindow_dequeueBuffer(anw, anb, fence);
+#else
+ (void)window;
+ (void)buffer;
+ (void)fence;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::cancelBuffer(EGLNativeWindowType window, EGLClientBuffer buffer) {
+#if defined(__ANDROID__)
+ auto* anw = reinterpret_cast<ANativeWindow*>(window);
+ auto* anb = reinterpret_cast<ANativeWindowBuffer*>(buffer);
+ return ANativeWindow_cancelBuffer(anw, anb, -1);
+#else
+ (void)window;
+ (void)buffer;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+int ANativeWindowHelperAndroid::getHostHandle(EGLClientBuffer buffer, Gralloc* gralloc) {
+#if defined(__ANDROID__)
+ auto* anb = reinterpret_cast<ANativeWindowBuffer*>(buffer);
+ return gralloc->getHostHandle(anb->handle);
+#else
+ (void)buffer;
+ (void)gralloc;
+ return -1;
+#endif // defined(__ANDROID__)
+}
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/guest/OpenglSystemCommon/ANativeWindowAndroid.h b/src/gfxstream/guest/OpenglSystemCommon/ANativeWindowAndroid.h
new file mode 100644
index 00000000000..97eba6a5393
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/ANativeWindowAndroid.h
@@ -0,0 +1,57 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#include "ANativeWindow.h"
+
+namespace gfxstream {
+
+class ANativeWindowHelperAndroid : public ANativeWindowHelper {
+ public:
+ ANativeWindowHelperAndroid() = default;
+
+ bool isValid(EGLNativeWindowType window);
+ bool isValid(EGLClientBuffer buffer);
+
+ void acquire(EGLNativeWindowType window);
+ void release(EGLNativeWindowType window);
+
+ void acquire(EGLClientBuffer buffer);
+ void release(EGLClientBuffer buffer);
+
+ int getConsumerUsage(EGLNativeWindowType window, int* usage);
+ void setUsage(EGLNativeWindowType window, int usage);
+
+ int getWidth(EGLNativeWindowType window);
+ int getHeight(EGLNativeWindowType window);
+
+ int getWidth(EGLClientBuffer buffer);
+ int getHeight(EGLClientBuffer buffer);
+
+ int getFormat(EGLClientBuffer buffer, Gralloc* helper);
+
+ void setSwapInterval(EGLNativeWindowType window, int interval);
+
+ int queueBuffer(EGLNativeWindowType window, EGLClientBuffer buffer, int fence);
+ int dequeueBuffer(EGLNativeWindowType window, EGLClientBuffer* buffer, int* fence);
+ int cancelBuffer(EGLNativeWindowType window, EGLClientBuffer buffer);
+
+ int getHostHandle(EGLClientBuffer buffer, Gralloc* helper);
+};
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/guest/OpenglSystemCommon/EGLClientIface.h b/src/gfxstream/guest/OpenglSystemCommon/EGLClientIface.h
new file mode 100644
index 00000000000..35b66bf0377
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/OpenglSystemCommon/EGLImage.h b/src/gfxstream/guest/OpenglSystemCommon/EGLImage.h
new file mode 100644
index 00000000000..8ef99c22dc3
--- /dev/null
+++ b/src/gfxstream/guest/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
+ {
+ EGLClientBuffer buffer;
+ uint32_t host_egl_image;
+ };
+};
+
+#endif
diff --git a/src/gfxstream/guest/OpenglSystemCommon/EmulatorFeatureInfo.h b/src/gfxstream/guest/OpenglSystemCommon/EmulatorFeatureInfo.h
new file mode 100644
index 00000000000..f7d32e1924c
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/EmulatorFeatureInfo.h
@@ -0,0 +1,222 @@
+// 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_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/src/gfxstream/guest/OpenglSystemCommon/FormatConversions.cpp b/src/gfxstream/guest/OpenglSystemCommon/FormatConversions.cpp
new file mode 100644
index 00000000000..d092be6e3b1
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/FormatConversions.cpp
@@ -0,0 +1,373 @@
+// 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"
+
+#include <cutils/log.h>
+#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/src/gfxstream/guest/OpenglSystemCommon/FormatConversions.h b/src/gfxstream/guest/OpenglSystemCommon/FormatConversions.h
new file mode 100644
index 00000000000..51aab6d288d
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/OpenglSystemCommon/Gralloc.h b/src/gfxstream/guest/OpenglSystemCommon/Gralloc.h
new file mode 100644
index 00000000000..8d59f0b21ba
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/Gralloc.h
@@ -0,0 +1,68 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <cutils/native_handle.h>
+
+typedef struct AHardwareBuffer AHardwareBuffer;
+
+namespace gfxstream {
+
+constexpr uint32_t kGlRGB = 0x1907;
+constexpr uint32_t kGlRGBA = 0x1908;
+constexpr uint32_t kGlRGB565 = 0x8D62;
+
+// Abstraction for gralloc handle conversion
+class Gralloc {
+ public:
+ virtual ~Gralloc() {}
+
+ virtual uint32_t createColorBuffer(void* rcEnc, int width, int height,
+ uint32_t glformat) = 0;
+
+ virtual void acquire(AHardwareBuffer* ahb) = 0;
+ virtual void release(AHardwareBuffer* ahb) = 0;
+
+ virtual int allocate(uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ uint64_t usage,
+ AHardwareBuffer** outputAhb) = 0;
+
+ virtual uint32_t getHostHandle(const native_handle_t* handle) = 0;
+ virtual uint32_t getHostHandle(const AHardwareBuffer* handle) = 0;
+
+ virtual int getFormat(const native_handle_t* handle) = 0;
+ virtual int getFormat(const AHardwareBuffer* handle) = 0;
+
+ virtual uint32_t getFormatDrmFourcc(const AHardwareBuffer* /*handle*/) {
+ // Equal to DRM_FORMAT_INVALID -- see <drm_fourcc.h>
+ return 0;
+ }
+ virtual uint32_t getFormatDrmFourcc(const native_handle_t* /*handle*/) {
+ // Equal to DRM_FORMAT_INVALID -- see <drm_fourcc.h>
+ return 0;
+ }
+
+ virtual size_t getAllocatedSize(const native_handle_t* handle) = 0;
+ virtual size_t getAllocatedSize(const AHardwareBuffer* handle) = 0;
+
+ virtual bool treatBlobAsImage() { return false; };
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglSystemCommon/GrallocGoldfish.cpp b/src/gfxstream/guest/OpenglSystemCommon/GrallocGoldfish.cpp
new file mode 100644
index 00000000000..b32562a6ccc
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/GrallocGoldfish.cpp
@@ -0,0 +1,84 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "GrallocGoldfish.h"
+
+#include <gralloc_cb_bp.h>
+#include <vndk/hardware_buffer.h>
+
+#include "renderControl_enc.h"
+
+namespace gfxstream {
+
+uint32_t GoldfishGralloc::createColorBuffer(void* rcEnc, int width,
+ int height, uint32_t glformat) {
+ auto* rc = reinterpret_cast<renderControl_client_context_t*>(rcEnc);
+ return rc->rcCreateColorBuffer(rc, width, height, glformat);
+}
+
+int GoldfishGralloc::allocate(uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ uint64_t usage,
+ AHardwareBuffer** outputAhb) {
+
+ struct AHardwareBuffer_Desc desc = {
+ .width = width,
+ .height = height,
+ .layers = 1,
+ .format = format,
+ .usage = usage,
+ };
+
+ return AHardwareBuffer_allocate(&desc, outputAhb);
+}
+
+void GoldfishGralloc::acquire(AHardwareBuffer* ahb) {
+ AHardwareBuffer_acquire(ahb);
+}
+
+void GoldfishGralloc::release(AHardwareBuffer* ahb) {
+ AHardwareBuffer_release(ahb);
+}
+
+uint32_t GoldfishGralloc::getHostHandle(native_handle_t const* handle) {
+ return cb_handle_t::from(handle)->hostHandle;
+}
+
+uint32_t GoldfishGralloc::getHostHandle(const AHardwareBuffer* ahb) {
+ const native_handle_t* handle = AHardwareBuffer_getNativeHandle(ahb);
+ return getHostHandle(handle);
+}
+
+int GoldfishGralloc::getFormat(const native_handle_t* handle) {
+ return cb_handle_t::from(handle)->format;
+}
+
+int GoldfishGralloc::getFormat(const AHardwareBuffer* ahb) {
+ const native_handle_t* handle = AHardwareBuffer_getNativeHandle(ahb);
+ return getFormat(handle);
+}
+
+size_t GoldfishGralloc::getAllocatedSize(const native_handle_t* handle) {
+ return static_cast<size_t>(cb_handle_t::from(handle)->allocatedSize());
+}
+
+size_t GoldfishGralloc::getAllocatedSize(const AHardwareBuffer* ahb) {
+ const native_handle_t* handle = AHardwareBuffer_getNativeHandle(ahb);
+ return getAllocatedSize(handle);
+}
+
+bool GoldfishGralloc::treatBlobAsImage() { return true; }
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglSystemCommon/GrallocGoldfish.h b/src/gfxstream/guest/OpenglSystemCommon/GrallocGoldfish.h
new file mode 100644
index 00000000000..2d7b9faf52b
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/GrallocGoldfish.h
@@ -0,0 +1,48 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include "Gralloc.h"
+
+namespace gfxstream {
+
+class GoldfishGralloc : public Gralloc {
+ public:
+ uint32_t createColorBuffer(void* rcEnc, int width, int height,
+ uint32_t glformat) override;
+
+ int allocate(uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ uint64_t usage,
+ AHardwareBuffer** outputAhb) override;
+
+ void acquire(AHardwareBuffer* ahb) override;
+ void release(AHardwareBuffer* ahb) override;
+
+ uint32_t getHostHandle(native_handle_t const* handle) override;
+ uint32_t getHostHandle(const AHardwareBuffer* handle) override;
+
+ int getFormat(const native_handle_t* handle) override;
+ int getFormat(const AHardwareBuffer* handle) override;
+
+ size_t getAllocatedSize(const native_handle_t* handle) override;
+ size_t getAllocatedSize(const AHardwareBuffer* handle) override;
+
+ bool treatBlobAsImage() override;
+};
+
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglSystemCommon/GrallocMinigbm.cpp b/src/gfxstream/guest/OpenglSystemCommon/GrallocMinigbm.cpp
new file mode 100644
index 00000000000..a4057c89142
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/GrallocMinigbm.cpp
@@ -0,0 +1,238 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "GrallocMinigbm.h"
+
+#include <cinttypes>
+#include <cstring>
+#include <stdlib.h>
+
+#include <cros_gralloc/cros_gralloc_handle.h>
+#include <errno.h>
+#include <log/log.h>
+#include <sys/user.h>
+#include <xf86drm.h>
+#include <vndk/hardware_buffer.h>
+
+#include "virtgpu_drm.h"
+
+#if defined(PAGE_SIZE)
+constexpr size_t kPageSize = PAGE_SIZE;
+#else
+#include <unistd.h>
+static const size_t kPageSize = getpagesize();
+#endif
+
+
+namespace gfxstream {
+namespace {
+
+static inline uint32_t align_up(uint32_t n, uint32_t a) { return ((n + a - 1) / a) * a; }
+
+bool getVirtioGpuResourceInfo(int fd, native_handle_t const* handle,
+ struct drm_virtgpu_resource_info* info) {
+ memset(info, 0x0, sizeof(*info));
+ if (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(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(int fd, uint32_t handle)
+ : m_fd(fd), m_prime_handle(handle) {}
+ 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(fd, 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 synchronize with the host if
+ // the minigbm gralloc swiches to virtio-gpu blobs or cross-domain
+ // backend.
+ int retry = 0;
+ do {
+ if (retry > 10) {
+ ALOGE("%s DRM_IOCTL_VIRTGPU_WAIT failed with EBUSY %d times.", __func__, retry);
+ return false;
+ }
+ ret = drmIoctl(fd, DRM_IOCTL_VIRTGPU_WAIT, &virtgpuWait);
+ ++retry;
+ } while (ret < 0 && errno == EBUSY);
+ if (ret) {
+ ALOGE("%s: DRM_IOCTL_VIRTGPU_WAIT failed: %s(%d)", __func__, strerror(errno), errno);
+ return false;
+ }
+
+ ret = drmIoctl(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;
+}
+
+} // namespace
+
+uint32_t MinigbmGralloc::createColorBuffer(void*, int width, int height,
+ uint32_t glformat) {
+ // Only supported format for pbuffers in gfxstream should be RGBA8
+ const uint32_t kVirglFormatRGBA = 67; // VIRGL_FORMAT_R8G8B8A8_UNORM;
+ uint32_t virtgpu_format = 0;
+ uint32_t bpp = 0;
+ switch (glformat) {
+ case kGlRGB:
+ ALOGV("Note: egl wanted GL_RGB, still using RGBA");
+ virtgpu_format = kVirglFormatRGBA;
+ bpp = 4;
+ break;
+ case kGlRGBA:
+ virtgpu_format = kVirglFormatRGBA;
+ bpp = 4;
+ break;
+ default:
+ ALOGV("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, kPageSize);
+
+ 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;
+}
+
+int MinigbmGralloc::allocate(uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ uint64_t usage,
+ AHardwareBuffer** outputAhb) {
+
+ struct AHardwareBuffer_Desc desc = {
+ .width = width,
+ .height = height,
+ .layers = 1,
+ .format = format,
+ .usage = usage,
+ };
+
+ return AHardwareBuffer_allocate(&desc, outputAhb);
+}
+
+void MinigbmGralloc::acquire(AHardwareBuffer* ahb) {
+ AHardwareBuffer_acquire(ahb);
+}
+
+void MinigbmGralloc::release(AHardwareBuffer* ahb) {
+ AHardwareBuffer_release(ahb);
+}
+
+uint32_t MinigbmGralloc::getHostHandle(const native_handle_t* handle) {
+ struct drm_virtgpu_resource_info info;
+ if (!getVirtioGpuResourceInfo(m_fd, handle, &info)) {
+ ALOGE("%s: failed to get resource info\n", __func__);
+ return 0;
+ }
+
+ return info.res_handle;
+}
+
+uint32_t MinigbmGralloc::getHostHandle(const AHardwareBuffer* ahb) {
+ const native_handle_t* handle = AHardwareBuffer_getNativeHandle(ahb);
+ return getHostHandle(handle);
+}
+
+int MinigbmGralloc::getFormat(const native_handle_t* handle) {
+ return ((cros_gralloc_handle*)handle)->droid_format;
+}
+
+int MinigbmGralloc::getFormat(const AHardwareBuffer* ahb) {
+ const native_handle_t* handle = AHardwareBuffer_getNativeHandle(ahb);
+
+ return ((cros_gralloc_handle*)handle)->droid_format;
+}
+
+uint32_t MinigbmGralloc::getFormatDrmFourcc(const native_handle_t* handle) {
+ return ((cros_gralloc_handle*)handle)->format;
+}
+
+uint32_t MinigbmGralloc::getFormatDrmFourcc(const AHardwareBuffer* ahb) {
+ const native_handle_t* handle = AHardwareBuffer_getNativeHandle(ahb);
+ return getFormatDrmFourcc(handle);
+}
+
+size_t MinigbmGralloc::getAllocatedSize(const native_handle_t* handle) {
+ struct drm_virtgpu_resource_info info;
+ if (!getVirtioGpuResourceInfo(m_fd, handle, &info)) {
+ ALOGE("%s: failed to get resource info\n", __func__);
+ return 0;
+ }
+ return info.size;
+}
+
+size_t MinigbmGralloc::getAllocatedSize(const AHardwareBuffer* ahb) {
+ const native_handle_t* handle = AHardwareBuffer_getNativeHandle(ahb);
+ return getAllocatedSize(handle);
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglSystemCommon/GrallocMinigbm.h b/src/gfxstream/guest/OpenglSystemCommon/GrallocMinigbm.h
new file mode 100644
index 00000000000..d165a033f09
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/GrallocMinigbm.h
@@ -0,0 +1,53 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include "Gralloc.h"
+
+namespace gfxstream {
+
+class MinigbmGralloc : public Gralloc {
+ public:
+ uint32_t createColorBuffer(void* rcEnc, int width, int height,
+ uint32_t glformat) override;
+
+ int allocate(uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ uint64_t usage,
+ AHardwareBuffer** outputAhb) override;
+
+ void acquire(AHardwareBuffer* ahb) override;
+ void release(AHardwareBuffer* ahb) override;
+
+ uint32_t getHostHandle(native_handle_t const* handle) override;
+ uint32_t getHostHandle(const AHardwareBuffer* handle) override;
+
+ int getFormat(const native_handle_t* handle) override;
+ int getFormat(const AHardwareBuffer* handle) override;
+
+ uint32_t getFormatDrmFourcc(const native_handle_t* handle) override;
+ uint32_t getFormatDrmFourcc(const AHardwareBuffer* handle) override;
+
+ size_t getAllocatedSize(const native_handle_t* handle) override;
+ size_t getAllocatedSize(const AHardwareBuffer* handle) override;
+
+ void setFd(int fd) { m_fd = fd; }
+
+ private:
+ int m_fd;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglSystemCommon/HostConnection.cpp b/src/gfxstream/guest/OpenglSystemCommon/HostConnection.cpp
new file mode 100644
index 00000000000..3b9426e46eb
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/HostConnection.cpp
@@ -0,0 +1,375 @@
+/*
+* 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 "GoldfishAddressSpaceStream.h"
+#include "GrallocGoldfish.h"
+#include "GrallocMinigbm.h"
+#include "VirtioGpuAddressSpaceStream.h"
+#include "aemu/base/AndroidHealthMonitor.h"
+#include "aemu/base/AndroidHealthMonitorConsumerBasic.h"
+#include "aemu/base/threads/AndroidThread.h"
+
+#if defined(__ANDROID__)
+#include "ANativeWindowAndroid.h"
+#include "android-base/properties.h"
+#endif
+
+#include "aemu/base/Process.h"
+
+using gfxstream::guest::CreateHealthMonitor;
+using gfxstream::guest::HealthMonitor;
+using gfxstream::guest::HealthMonitorConsumerBasic;
+using gfxstream::guest::IOStream;
+using gfxstream::GoldfishGralloc;
+using gfxstream::MinigbmGralloc;
+
+#include "VkEncoder.h"
+#include "AddressSpaceStream.h"
+
+using gfxstream::vk::VkEncoder;
+
+#include <unistd.h>
+
+#include "ProcessPipe.h"
+#include "QemuPipeStream.h"
+#include "ThreadInfo.h"
+
+using gfxstream::guest::getCurrentThreadId;
+
+#include "VirtGpu.h"
+#include "VirtioGpuPipeStream.h"
+#include "virtgpu_drm.h"
+
+#if defined(__linux__) || defined(__ANDROID__)
+#include <fstream>
+#include <string>
+#include <unistd.h>
+
+static const size_t kPageSize = getpagesize();
+#else
+constexpr size_t kPageSize = PAGE_SIZE;
+#endif
+
+#undef LOG_TAG
+#define LOG_TAG "HostConnection"
+#include <cutils/log.h>
+
+#define STREAM_BUFFER_SIZE (4*1024*1024)
+#define STREAM_PORT_NUM 22468
+
+constexpr const auto kEglProp = "ro.hardware.egl";
+
+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(enum VirtGpuCapset capset) {
+#if defined(__Fuchsia__) || defined(LINUX_GUEST_BUILD)
+ return HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE;
+#else
+ std::string transport;
+
+#if defined(__ANDROID__)
+ transport = android::base::GetProperty("ro.boot.hardware.gltransport", "");
+#else
+ const char* transport_envvar = getenv("GFXSTREAM_TRANSPORT");
+ if (transport_envvar != nullptr) {
+ transport = std::string(transport_envvar);
+ }
+#endif
+
+ if (transport.empty()) {
+#if defined(__ANDROID__)
+ return HOST_CONNECTION_QEMU_PIPE;
+#else
+ return HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE;
+#endif
+ }
+
+ if (transport == "asg") {
+ return HOST_CONNECTION_ADDRESS_SPACE;
+ }
+ if (transport == "pipe") {
+ return HOST_CONNECTION_QEMU_PIPE;
+ }
+
+ if (transport == "virtio-gpu-asg" || transport == "virtio-gpu-pipe") {
+ std::string egl;
+#if defined(__ANDROID__)
+ egl = android::base::GetProperty(kEglProp, "");
+#endif
+ // ANGLE doesn't work well without ASG, particularly if HostComposer uses a pipe
+ // transport and VK uses ASG.
+ if (capset == kCapsetGfxStreamVulkan || egl == "angle") {
+ return HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE;
+ } else {
+ return HOST_CONNECTION_VIRTIO_GPU_PIPE;
+ }
+ }
+
+ return HOST_CONNECTION_QEMU_PIPE;
+#endif
+}
+
+static GrallocType getGrallocTypeFromProperty() {
+ std::string value;
+
+#if defined(__ANDROID__)
+ value = android::base::GetProperty("ro.hardware.gralloc", "");
+#endif
+
+ if (value.empty()) {
+ return GRALLOC_TYPE_RANCHU;
+ }
+ if (value == "minigbm") {
+ return GRALLOC_TYPE_MINIGBM;
+ }
+ if (value == "ranchu") {
+ return GRALLOC_TYPE_RANCHU;
+ }
+ return GRALLOC_TYPE_RANCHU;
+}
+
+#if defined(__ANDROID__)
+static GoldfishGralloc m_goldfishGralloc;
+#endif
+
+HostConnection::HostConnection()
+ : exitUncleanly(false),
+ m_hostExtensions(),
+ m_noHostError(true),
+ m_rendernodeFd(-1) { }
+
+HostConnection::~HostConnection()
+{
+ // round-trip to ensure that queued commands have been processed
+ // before process pipe closure is detected.
+#if GFXSTREAM_GUEST_USE_GLES
+ if (m_rcEnc && !exitUncleanly) {
+ (void)m_rcEnc->rcGetRendererVersion(m_rcEnc.get());
+ }
+#endif
+
+ 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(enum VirtGpuCapset capset) {
+ const enum HostConnectionType connType = getConnectionTypeFromProperty(capset);
+ uint32_t noRenderControlEnc = 0;
+
+ // Use "new" to access a non-public constructor.
+ auto con = std::unique_ptr<HostConnection>(new HostConnection);
+ con->m_connectionType = connType;
+
+ switch (connType) {
+ case HOST_CONNECTION_ADDRESS_SPACE: {
+#if defined(__ANDROID__) || defined(__Fuchsia__)
+ auto stream = createGoldfishAddressSpaceStream(STREAM_BUFFER_SIZE, getGlobalHealthMonitor());
+ if (!stream) {
+ ALOGE("Failed to create AddressSpaceStream for host connection\n");
+ return nullptr;
+ }
+ con->m_stream = stream;
+#else
+ ALOGE("Fatal: HOST_CONNECTION_ADDRESS_SPACE not supported on this host.");
+ abort();
+#endif
+ con->m_grallocType = GRALLOC_TYPE_RANCHU;
+#if defined(__ANDROID__)
+ con->m_grallocHelper = &m_goldfishGralloc;
+#endif
+ break;
+ }
+#if !defined(__Fuchsia__)
+ 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_grallocType = GRALLOC_TYPE_RANCHU;
+ con->m_stream = stream;
+#if defined(__ANDROID__)
+ con->m_grallocHelper = &m_goldfishGralloc;
+#endif
+ break;
+ }
+#endif
+ 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_grallocType = getGrallocTypeFromProperty();
+ auto rendernodeFd = stream->getRendernodeFd();
+ con->m_stream = stream;
+ con->m_rendernodeFd = rendernodeFd;
+#if defined(__ANDROID__)
+ 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();
+ }
+#endif
+ break;
+ }
+ case HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE: {
+ // Use kCapsetGfxStreamVulkan for now, Ranchu HWC needs to be modified to pass in
+ // right capset.
+ auto device = VirtGpuDevice::getInstance(kCapsetGfxStreamVulkan);
+ auto deviceHandle = device->getDeviceHandle();
+ auto stream =
+ createVirtioGpuAddressSpaceStream(kCapsetGfxStreamVulkan, getGlobalHealthMonitor());
+ if (!stream) {
+ ALOGE("Failed to create virtgpu AddressSpaceStream\n");
+ return nullptr;
+ }
+ con->m_grallocType = getGrallocTypeFromProperty();
+ con->m_stream = stream;
+ con->m_rendernodeFd = deviceHandle;
+#if defined(__ANDROID__)
+ switch (con->m_grallocType) {
+ case GRALLOC_TYPE_RANCHU:
+ con->m_grallocHelper = &m_goldfishGralloc;
+ break;
+ case GRALLOC_TYPE_MINIGBM: {
+ MinigbmGralloc* m = new gfxstream::MinigbmGralloc;
+ m->setFd(deviceHandle);
+ con->m_grallocHelper = m;
+ break;
+ }
+ default:
+ ALOGE("Fatal: Unknown gralloc type 0x%x\n", con->m_grallocType);
+ abort();
+ }
+#endif
+ break;
+ }
+ default:
+ break;
+ }
+
+#if defined(__ANDROID__)
+ con->m_anwHelper = new gfxstream::ANativeWindowHelperAndroid();
+#else
+ // Host builds are expected to set an ANW helper for testing.
+#endif
+ con->m_syncHelper.reset(gfxstream::createPlatformSyncHelper());
+
+ // 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 (capset == kCapsetGfxStreamMagma) {
+ noRenderControlEnc = 1;
+ } else if (capset == kCapsetGfxStreamVulkan) {
+ VirtGpuDevice* instance = VirtGpuDevice::getInstance(kCapsetGfxStreamVulkan);
+ auto caps = instance->getCaps();
+ noRenderControlEnc = caps.vulkanCapset.noRenderControlEnc;
+ }
+
+ auto fd = (connType == HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE) ? con->m_rendernodeFd : -1;
+ processPipeInit(fd, connType, noRenderControlEnc);
+ return con;
+}
+
+HostConnection* HostConnection::get() { return getWithThreadInfo(getEGLThreadInfo(), kCapsetNone); }
+
+HostConnection* HostConnection::getOrCreate(enum VirtGpuCapset capset) {
+ return getWithThreadInfo(getEGLThreadInfo(), capset);
+}
+
+HostConnection* HostConnection::getWithThreadInfo(EGLThreadInfo* tinfo, enum VirtGpuCapset capset) {
+ // Get thread info
+ if (!tinfo) {
+ return NULL;
+ }
+
+ if (tinfo->hostConn == NULL) {
+ tinfo->hostConn = HostConnection::createUnique(capset);
+ }
+
+ 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(enum VirtGpuCapset capset) {
+ return connect(capset);
+}
+
+VkEncoder* HostConnection::vkEncoder() {
+ if (!m_vkEnc) {
+ m_vkEnc = new VkEncoder(m_stream, getGlobalHealthMonitor());
+ }
+ return m_vkEnc;
+}
diff --git a/src/gfxstream/guest/OpenglSystemCommon/HostConnection.h b/src/gfxstream/guest/OpenglSystemCommon/HostConnection.h
new file mode 100644
index 00000000000..d215d04a1c4
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/HostConnection.h
@@ -0,0 +1,169 @@
+/*
+* 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 <cstring>
+#include <memory>
+#include <mutex>
+#include <optional>
+#include <string>
+
+#include "ANativeWindow.h"
+#include "EmulatorFeatureInfo.h"
+#include "Gralloc.h"
+#include "Sync.h"
+#include "VirtGpu.h"
+#include "gfxstream/guest/ChecksumCalculator.h"
+#include "gfxstream/guest/IOStream.h"
+
+#if GFXSTREAM_ENABLE_GUEST_GLES
+#include "HostConnectionGles.h"
+#endif
+
+namespace gfxstream {
+namespace vk {
+class VkEncoder;
+} // namespace vk
+} // namespace gfxstream
+
+struct EGLThreadInfo;
+
+class HostConnection
+{
+public:
+ static HostConnection *get();
+ static HostConnection* getOrCreate(enum VirtGpuCapset capset = kCapsetNone);
+
+ static HostConnection* getWithThreadInfo(EGLThreadInfo* tInfo,
+ enum VirtGpuCapset capset = kCapsetNone);
+ static void exit();
+ static void exitUnclean(); // for testing purposes
+
+ static std::unique_ptr<HostConnection> createUnique(enum VirtGpuCapset capset = kCapsetNone);
+ HostConnection(const HostConnection&) = delete;
+
+ ~HostConnection();
+
+#if GFXSTREAM_ENABLE_GUEST_GLES
+ GLEncoder *glEncoder();
+ GL2Encoder* gl2Encoder();
+ ExtendedRCEncoderContext *rcEncoder();
+ gfxstream::guest::ChecksumCalculator* checksumHelper() { return &m_checksumHelper; }
+#endif
+
+ gfxstream::vk::VkEncoder* vkEncoder();
+
+ int getRendernodeFd() { return m_rendernodeFd; }
+
+ gfxstream::Gralloc* grallocHelper() { return m_grallocHelper; }
+ void setGrallocHelperForTesting(gfxstream::Gralloc* gralloc) { m_grallocHelper = gralloc; }
+
+ gfxstream::SyncHelper* syncHelper() { return m_syncHelper.get(); }
+ void setSyncHelperForTesting(gfxstream::SyncHelper* sync) { m_syncHelper.reset(sync); }
+
+ gfxstream::ANativeWindowHelper* anwHelper() { return m_anwHelper; }
+ void setANativeWindowHelperForTesting(gfxstream::ANativeWindowHelper* anw) { m_anwHelper = anw; }
+
+ void flush() {
+ if (m_stream) {
+ m_stream->flush();
+ }
+ }
+
+#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(enum VirtGpuCapset capset);
+
+ HostConnection();
+
+#if GFXSTREAM_ENABLE_GUEST_GLES
+ static gl_client_context_t* s_getGLContext();
+ static gl2_client_context_t* s_getGL2Context();
+
+ const std::string& queryHostExtensions(ExtendedRCEncoderContext* rcEnc);
+ 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);
+#endif
+
+private:
+ HostConnectionType m_connectionType;
+ GrallocType m_grallocType;
+
+ // intrusively refcounted
+ gfxstream::guest::IOStream* m_stream = nullptr;
+
+#if GFXSTREAM_ENABLE_GUEST_GLES
+ std::unique_ptr<GLEncoder> m_glEnc;
+ std::unique_ptr<GL2Encoder> m_gl2Enc;
+ std::unique_ptr<ExtendedRCEncoderContext> m_rcEnc;
+ gfxstream::guest::ChecksumCalculator m_checksumHelper;
+#endif
+
+ // intrusively refcounted
+ gfxstream::vk::VkEncoder* m_vkEnc = nullptr;
+
+ gfxstream::ANativeWindowHelper* m_anwHelper = nullptr;
+ gfxstream::Gralloc* m_grallocHelper = nullptr;
+ std::unique_ptr<gfxstream::SyncHelper> m_syncHelper;
+ std::string m_hostExtensions;
+ bool m_noHostError;
+ mutable std::mutex m_lock;
+ int m_rendernodeFd;
+};
+
+#endif
diff --git a/src/gfxstream/guest/OpenglSystemCommon/HostConnectionGles.cpp b/src/gfxstream/guest/OpenglSystemCommon/HostConnectionGles.cpp
new file mode 100644
index 00000000000..983c0868a6f
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/HostConnectionGles.cpp
@@ -0,0 +1,377 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 "ProcessPipe.h"
+#include "ThreadInfo.h"
+
+#if defined(__ANDROID__)
+#include "android-base/properties.h"
+#endif
+
+using gfxstream::guest::ChecksumCalculator;
+using gfxstream::guest::IOStream;
+
+static uint32_t getDrawCallFlushIntervalFromProperty() {
+ constexpr uint32_t kDefaultValue = 800;
+ uint32_t value = kDefaultValue;
+
+#if defined(__ANDROID__)
+ value =
+ android::base::GetUintProperty("ro.boot.qemu.gltransport.drawFlushInterval", kDefaultValue);
+#endif
+ return value;
+}
+
+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();
+}
+
+ExtendedRCEncoderContext* HostConnection::rcEncoder() {
+ if (!m_rcEnc) {
+ m_rcEnc = std::make_unique<ExtendedRCEncoderContext>(m_stream, checksumHelper());
+
+ ExtendedRCEncoderContext* rcEnc = m_rcEnc.get();
+ setChecksumHelper(rcEnc);
+ queryAndSetSyncImpl(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);
+
+ rcEnc->rcSetPuid(rcEnc, getPuid());
+ }
+ 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);
+ ALOGV("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::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/src/gfxstream/guest/OpenglSystemCommon/HostConnectionGles.h b/src/gfxstream/guest/OpenglSystemCommon/HostConnectionGles.h
new file mode 100644
index 00000000000..9a001098887
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/HostConnectionGles.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 HOST_CONNECTION_GLES_H
+#define HOST_CONNECTION_GLES_H
+
+#include "GLEncoder.h"
+#include "GL2Encoder.h"
+#include "renderControl_enc.h"
+#include "renderControl_types.h"
+
+// 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::guest::IOStream *stream,
+ gfxstream::guest::ChecksumCalculator *checksumCalculator)
+ : renderControl_encoder_context_t(stream, checksumCalculator) {}
+ void setSyncImpl(SyncImpl syncImpl) { m_featureInfo.syncImpl = syncImpl; }
+ 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;
+ }
+ void setGLESMaxVersion(GLESMaxVersion ver) { m_featureInfo.glesMaxVersion = ver; }
+ GLESMaxVersion getGLESMaxVersion() const { return m_featureInfo.glesMaxVersion; }
+ bool hasDirectMem() const {
+ return m_featureInfo.hasDirectMem;
+ }
+
+ const EmulatorFeatureInfo* featureInfo_const() const { return &m_featureInfo; }
+ EmulatorFeatureInfo* featureInfo() { return &m_featureInfo; }
+private:
+ EmulatorFeatureInfo m_featureInfo;
+};
+
+#endif
diff --git a/src/gfxstream/guest/OpenglSystemCommon/ProcessPipe.cpp b/src/gfxstream/guest/OpenglSystemCommon/ProcessPipe.cpp
new file mode 100644
index 00000000000..670054a6e50
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/ProcessPipe.cpp
@@ -0,0 +1,202 @@
+/*
+* 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 <errno.h>
+#include <log/log.h>
+#include <pthread.h>
+#include <qemu_pipe_bp.h>
+
+#include "HostConnection.h"
+
+#ifndef __Fuchsia__
+
+#include "VirtioGpuPipeStream.h"
+static VirtioGpuPipeStream* sVirtioGpuPipeStream = 0;
+static int sStreamHandle = -1;
+
+#endif // !__Fuchsia__
+
+static QEMU_PIPE_HANDLE sProcPipe = 0;
+// sProcUID is a unique ID per process assigned by the host.
+// It is different from getpid().
+static uint64_t sProcUID = 0;
+static HostConnectionType sConnType = HOST_CONNECTION_VIRTIO_GPU_PIPE;
+
+static uint32_t* sSeqnoPtr = 0;
+
+// Meant to be called only once per process.
+static void initSeqno(void) {
+ // 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;
+}
+
+namespace {
+
+static std::mutex sNeedInitMutex;
+static bool sNeedInit = true;
+
+} // namespace
+
+#ifndef __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;
+ }
+}
+
+#endif // !__Fuchsia__
+
+static void processPipeDoInit(uint32_t noRenderControlEnc) {
+ initSeqno();
+
+ // No need to setup auxiliary pipe stream in this case
+ if (noRenderControlEnc) return;
+
+#if defined(__Fuchsia__)
+ // Note: sProcUID is not initialized.
+ ALOGE("Fuchsia: requires noRenderControlEnc");
+ abort();
+#else
+ switch (sConnType) {
+ // TODO: Move those over too
+ case HOST_CONNECTION_QEMU_PIPE:
+ case HOST_CONNECTION_ADDRESS_SPACE:
+ 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
+}
+
+bool processPipeInit(int streamHandle, HostConnectionType connType, uint32_t noRenderControlEnc) {
+ sConnType = connType;
+#ifndef __Fuchsia__
+ sStreamHandle = streamHandle;
+#endif // !__Fuchsia
+
+ {
+ std::lock_guard<std::mutex> lock(sNeedInitMutex);
+
+ if (sNeedInit) {
+ sNeedInit = false;
+ processPipeDoInit(noRenderControlEnc);
+
+ if (noRenderControlEnc) {
+ return true;
+ }
+
+#ifndef __Fuchsia__
+ if (!sProcPipe && !sVirtioGpuPipeStream) {
+ return false;
+ }
+#endif
+ }
+ }
+
+ return true;
+}
+
+uint64_t getPuid() {
+ return sProcUID;
+}
+
+void processPipeRestart() {
+ std::lock_guard<std::mutex> lock(sNeedInitMutex);
+
+ 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:
+ isPipe = true;
+ break;
+ case HOST_CONNECTION_VIRTIO_GPU_PIPE:
+ case HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE: {
+ isPipe = false;
+ break;
+ }
+ }
+
+ sProcUID = 0;
+
+ if (isPipe) {
+ if (qemu_pipe_valid(sProcPipe)) {
+ qemu_pipe_close(sProcPipe);
+ sProcPipe = 0;
+ }
+ } else {
+#ifndef __Fuchsia__
+ if (sVirtioGpuPipeStream) {
+ delete sVirtioGpuPipeStream;
+ sVirtioGpuPipeStream = nullptr;
+ }
+#endif
+ }
+
+ if (sConnType == HOST_CONNECTION_VIRTIO_GPU_PIPE ||
+ sConnType == HOST_CONNECTION_VIRTIO_GPU_ADDRESS_SPACE) {
+ VirtGpuDevice::resetInstance();
+ }
+
+ sNeedInit = true;
+}
+
+void refreshHostConnection() {
+#if GFXSTREAM_ENABLE_GUEST_GLES
+ HostConnection* hostConn = HostConnection::get();
+ ExtendedRCEncoderContext* rcEnc = hostConn->rcEncoder();
+ rcEnc->rcSetPuid(rcEnc, sProcUID);
+#endif
+}
+
+uint32_t* getSeqnoPtrForProcess() {
+ // It's assumed process pipe state has already been initialized.
+ return sSeqnoPtr;
+}
diff --git a/src/gfxstream/guest/OpenglSystemCommon/ProcessPipe.h b/src/gfxstream/guest/OpenglSystemCommon/ProcessPipe.h
new file mode 100644
index 00000000000..cb0a44fd6dd
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/ProcessPipe.h
@@ -0,0 +1,46 @@
+//
+// 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,
+ uint32_t noRenderControlEnc);
+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/src/gfxstream/guest/OpenglSystemCommon/QemuPipeStream.cpp b/src/gfxstream/guest/OpenglSystemCommon/QemuPipeStream.cpp
new file mode 100644
index 00000000000..91a4051a068
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/QemuPipeStream.cpp
@@ -0,0 +1,252 @@
+/*
+* 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>
+
+#include <cutils/log.h>
+#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/src/gfxstream/guest/OpenglSystemCommon/QemuPipeStream.h b/src/gfxstream/guest/OpenglSystemCommon/QemuPipeStream.h
new file mode 100644
index 00000000000..a578d0bfcac
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/QemuPipeStream.h
@@ -0,0 +1,59 @@
+/*
+* 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 "gfxstream/guest/IOStream.h"
+
+#include <qemu_pipe_bp.h>
+
+class QemuPipeStream : public gfxstream::guest::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;
+ QemuPipeStream(QEMU_PIPE_HANDLE sock, size_t bufSize);
+};
+
+#endif
diff --git a/src/gfxstream/guest/OpenglSystemCommon/TestingAndroidWsi.cpp b/src/gfxstream/guest/OpenglSystemCommon/TestingAndroidWsi.cpp
new file mode 100644
index 00000000000..b62ff18417f
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/TestingAndroidWsi.cpp
@@ -0,0 +1,346 @@
+/*
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include <iostream>
+#include <cutils/log.h>
+
+#include "drm_fourcc.h"
+#include "TestingAndroidWsi.h"
+
+namespace gfxstream {
+
+static constexpr int numFds = 0;
+static constexpr int numInts = 1;
+
+std::optional<uint32_t> GlFormatToDrmFormat(uint32_t glFormat) {
+ switch (glFormat) {
+ case kGlRGB:
+ return DRM_FORMAT_BGR888;
+ case kGlRGB565:
+ return DRM_FORMAT_BGR565;
+ case kGlRGBA:
+ return DRM_FORMAT_ABGR8888;
+ }
+ return std::nullopt;
+}
+
+std::optional<uint32_t> DrmToVirglFormat(uint32_t drmFormat) {
+ switch (drmFormat) {
+ case DRM_FORMAT_ABGR8888:
+ return VIRGL_FORMAT_B8G8R8A8_UNORM;
+ case DRM_FORMAT_BGR888:
+ return VIRGL_FORMAT_R8G8B8_UNORM;
+ case DRM_FORMAT_BGR565:
+ return VIRGL_FORMAT_B5G6R5_UNORM;
+ }
+ return std::nullopt;
+}
+
+TestingAHardwareBuffer::TestingAHardwareBuffer(
+ uint32_t width,
+ uint32_t height,
+ VirtGpuBlobPtr resource)
+ : mWidth(width),
+ mHeight(height),
+ mResource(resource) {
+ mHandle = native_handle_create(numFds, numInts);
+ mHandle->data[0] = mResource->getResourceHandle();
+}
+
+TestingAHardwareBuffer::~TestingAHardwareBuffer() {
+ native_handle_close(mHandle);
+}
+
+uint32_t TestingAHardwareBuffer::getResourceId() const {
+ return mResource->getResourceHandle();
+}
+
+uint32_t TestingAHardwareBuffer::getWidth() const {
+ return mWidth;
+}
+
+uint32_t TestingAHardwareBuffer::getHeight() const {
+ return mHeight;
+}
+
+int TestingAHardwareBuffer::getAndroidFormat() const {
+ return /*AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM=*/1;
+}
+
+uint32_t TestingAHardwareBuffer::getDrmFormat() const {
+ return DRM_FORMAT_ABGR8888;
+}
+
+AHardwareBuffer* TestingAHardwareBuffer::asAHardwareBuffer() {
+ return reinterpret_cast<AHardwareBuffer*>(this);
+}
+
+buffer_handle_t TestingAHardwareBuffer::asBufferHandle() {
+ return reinterpret_cast<buffer_handle_t>(mHandle);
+}
+
+EGLClientBuffer TestingAHardwareBuffer::asEglClientBuffer() {
+ return reinterpret_cast<EGLClientBuffer>(this);
+}
+
+TestingVirtGpuGralloc::TestingVirtGpuGralloc() {}
+
+uint32_t TestingVirtGpuGralloc::createColorBuffer(
+ void*,
+ int width,
+ int height,
+ uint32_t glFormat) {
+ auto drmFormat = GlFormatToDrmFormat(glFormat);
+ if (!drmFormat) {
+ ALOGE("Unhandled format");
+ }
+
+ auto ahb = allocate(width, height, *drmFormat);
+
+ uint32_t hostHandle = ahb->getResourceId();
+ mAllocatedColorBuffers.emplace(hostHandle, std::move(ahb));
+ return hostHandle;
+}
+
+int TestingVirtGpuGralloc::allocate(
+ uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ uint64_t usage,
+ AHardwareBuffer** outputAhb) {
+ (void)width;
+ (void)height;
+ (void)format;
+ (void)usage;
+ (void)outputAhb;
+
+ // TODO: support export flow?
+ ALOGE("Unimplemented");
+
+ return 0;
+}
+
+std::unique_ptr<TestingAHardwareBuffer> TestingVirtGpuGralloc::allocate(
+ uint32_t width,
+ uint32_t height,
+ uint32_t format) {
+ ALOGE("Allocating AHB w:%u, h:%u, format %u", width, height, format);
+
+ auto device = VirtGpuDevice::getInstance();
+ if (!device) {
+ ALOGE("Failed to allocate: no virtio gpu device.");
+ return nullptr;
+ }
+
+ auto virglFormat = DrmToVirglFormat(format);
+ if (!virglFormat) {
+ std::cout << "Unhandled DRM format:" << format;
+ return nullptr;
+ }
+
+ auto resource = device->createVirglBlob(width, height, *virglFormat);
+ if (!resource) {
+ ALOGE("Failed to allocate: failed to create virtio resource.");
+ return nullptr;
+ }
+
+ resource->wait();
+
+ return std::make_unique<TestingAHardwareBuffer>(width, height, std::move(resource));
+}
+
+void TestingVirtGpuGralloc::acquire(AHardwareBuffer* ahb) {
+ // TODO
+}
+
+void TestingVirtGpuGralloc::release(AHardwareBuffer* ahb) {
+ // TODO
+}
+
+uint32_t TestingVirtGpuGralloc::getHostHandle(const native_handle_t* handle) {
+ const auto* ahb = reinterpret_cast<const TestingAHardwareBuffer*>(handle);
+ return ahb->getResourceId();
+}
+
+uint32_t TestingVirtGpuGralloc::getHostHandle(const AHardwareBuffer* handle) {
+ const auto* ahb = reinterpret_cast<const TestingAHardwareBuffer*>(handle);
+ return ahb->getResourceId();
+}
+
+int TestingVirtGpuGralloc::getFormat(const native_handle_t* handle) {
+ const auto* ahb = reinterpret_cast<const TestingAHardwareBuffer*>(handle);
+ return ahb->getAndroidFormat();
+}
+
+int TestingVirtGpuGralloc::getFormat(const AHardwareBuffer* handle) {
+ const auto* ahb = reinterpret_cast<const TestingAHardwareBuffer*>(handle);
+ return ahb->getAndroidFormat();
+}
+
+uint32_t TestingVirtGpuGralloc::getFormatDrmFourcc(const AHardwareBuffer* handle) {
+ const auto* ahb = reinterpret_cast<const TestingAHardwareBuffer*>(handle);
+ return ahb->getDrmFormat();
+}
+
+size_t TestingVirtGpuGralloc::getAllocatedSize(const native_handle_t*) {
+ ALOGE("Unimplemented.");
+ return 0;
+}
+
+size_t TestingVirtGpuGralloc::getAllocatedSize(const AHardwareBuffer*) {
+ ALOGE("Unimplemented.");
+ return 0;
+}
+
+TestingANativeWindow::TestingANativeWindow(
+ uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ std::vector<std::unique_ptr<TestingAHardwareBuffer>> buffers)
+ : mWidth(width),
+ mHeight(height),
+ mFormat(format),
+ mBuffers(std::move(buffers)) {
+ for (auto& buffer : mBuffers) {
+ mBufferQueue.push_back(QueuedAHB{
+ .ahb = buffer.get(),
+ .fence = -1,
+ });
+ }
+}
+
+EGLNativeWindowType TestingANativeWindow::asEglNativeWindowType() {
+ return reinterpret_cast<EGLNativeWindowType>(this);
+}
+
+uint32_t TestingANativeWindow::getWidth() const {
+ return mWidth;
+}
+
+uint32_t TestingANativeWindow::getHeight() const {
+ return mHeight;
+}
+
+int TestingANativeWindow::getFormat() const {
+ return mFormat;
+}
+
+int TestingANativeWindow::queueBuffer(EGLClientBuffer buffer, int fence) {
+ auto ahb = reinterpret_cast<TestingAHardwareBuffer*>(buffer);
+
+ mBufferQueue.push_back(QueuedAHB{
+ .ahb = ahb,
+ .fence = fence,
+ });
+
+ return 0;
+}
+
+int TestingANativeWindow::dequeueBuffer(EGLClientBuffer* buffer, int* fence) {
+ auto queuedAhb = mBufferQueue.front();
+ mBufferQueue.pop_front();
+
+ *buffer = queuedAhb.ahb->asEglClientBuffer();
+ *fence = queuedAhb.fence;
+ return 0;
+}
+
+int TestingANativeWindow::cancelBuffer(EGLClientBuffer buffer) {
+ auto ahb = reinterpret_cast<TestingAHardwareBuffer*>(buffer);
+
+ mBufferQueue.push_back(QueuedAHB{
+ .ahb = ahb,
+ .fence = -1,
+ });
+
+ return 0;
+}
+
+bool TestingVirtGpuANativeWindowHelper::isValid(EGLNativeWindowType window) {
+ // TODO: maybe a registry of valid TestingANativeWindow-s?
+ return true;
+}
+
+bool TestingVirtGpuANativeWindowHelper::isValid(EGLClientBuffer buffer) {
+ // TODO: maybe a registry of valid TestingAHardwareBuffer-s?
+ return true;
+}
+
+void TestingVirtGpuANativeWindowHelper::acquire(EGLNativeWindowType window) {
+ // TODO: maybe a registry of valid TestingANativeWindow-s?
+}
+
+void TestingVirtGpuANativeWindowHelper::release(EGLNativeWindowType window) {
+ // TODO: maybe a registry of valid TestingANativeWindow-s?
+}
+
+void TestingVirtGpuANativeWindowHelper::acquire(EGLClientBuffer buffer) {
+ // TODO: maybe a registry of valid TestingAHardwareBuffer-s?
+}
+
+void TestingVirtGpuANativeWindowHelper::release(EGLClientBuffer buffer) {
+ // TODO: maybe a registry of valid TestingAHardwareBuffer-s?
+}
+
+int TestingVirtGpuANativeWindowHelper::getConsumerUsage(EGLNativeWindowType window, int* usage) {
+ (void)window;
+ (void)usage;
+ return 0;
+}
+void TestingVirtGpuANativeWindowHelper::setUsage(EGLNativeWindowType window, int usage) {
+ (void)window;
+ (void)usage;
+}
+
+int TestingVirtGpuANativeWindowHelper::getWidth(EGLNativeWindowType window) {
+ auto anw = reinterpret_cast<TestingANativeWindow*>(window);
+ return anw->getWidth();
+}
+
+int TestingVirtGpuANativeWindowHelper::getHeight(EGLNativeWindowType window) {
+ auto anw = reinterpret_cast<TestingANativeWindow*>(window);
+ return anw->getHeight();
+}
+
+int TestingVirtGpuANativeWindowHelper::getWidth(EGLClientBuffer buffer) {
+ auto ahb = reinterpret_cast<TestingAHardwareBuffer*>(buffer);
+ return ahb->getWidth();
+}
+
+int TestingVirtGpuANativeWindowHelper::getHeight(EGLClientBuffer buffer) {
+ auto ahb = reinterpret_cast<TestingAHardwareBuffer*>(buffer);
+ return ahb->getHeight();
+}
+
+int TestingVirtGpuANativeWindowHelper::getFormat(EGLClientBuffer buffer, Gralloc* helper) {
+ auto ahb = reinterpret_cast<TestingAHardwareBuffer*>(buffer);
+ return ahb->getAndroidFormat();
+}
+
+void TestingVirtGpuANativeWindowHelper::setSwapInterval(EGLNativeWindowType window, int interval) {
+ ALOGE("Unimplemented");
+}
+
+int TestingVirtGpuANativeWindowHelper::queueBuffer(EGLNativeWindowType window, EGLClientBuffer buffer, int fence) {
+ auto anw = reinterpret_cast<TestingANativeWindow*>(window);
+ return anw->queueBuffer(buffer, fence);
+}
+
+int TestingVirtGpuANativeWindowHelper::dequeueBuffer(EGLNativeWindowType window, EGLClientBuffer* buffer, int* fence) {
+ auto anw = reinterpret_cast<TestingANativeWindow*>(window);
+ return anw->dequeueBuffer(buffer, fence);
+}
+
+int TestingVirtGpuANativeWindowHelper::cancelBuffer(EGLNativeWindowType window, EGLClientBuffer buffer) {
+ auto anw = reinterpret_cast<TestingANativeWindow*>(window);
+ return anw->cancelBuffer(buffer);
+}
+
+int TestingVirtGpuANativeWindowHelper::getHostHandle(EGLClientBuffer buffer, Gralloc*) {
+ auto ahb = reinterpret_cast<TestingAHardwareBuffer*>(buffer);
+ return ahb->getResourceId();
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglSystemCommon/TestingAndroidWsi.h b/src/gfxstream/guest/OpenglSystemCommon/TestingAndroidWsi.h
new file mode 100644
index 00000000000..b18455e095f
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/TestingAndroidWsi.h
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include <optional>
+#include <queue>
+#include <unordered_map>
+#include <vector>
+
+#include "VirtGpu.h"
+#include "ANativeWindow.h"
+
+namespace gfxstream {
+
+class TestingAHardwareBuffer {
+ public:
+ TestingAHardwareBuffer(uint32_t width,
+ uint32_t height,
+ VirtGpuBlobPtr resource);
+
+ ~TestingAHardwareBuffer();
+
+ uint32_t getResourceId() const;
+
+ uint32_t getWidth() const;
+
+ uint32_t getHeight() const;
+
+ int getAndroidFormat() const;
+
+ uint32_t getDrmFormat() const;
+
+ AHardwareBuffer* asAHardwareBuffer();
+
+ buffer_handle_t asBufferHandle();
+
+ EGLClientBuffer asEglClientBuffer();
+
+ private:
+ uint32_t mWidth;
+ uint32_t mHeight;
+ VirtGpuBlobPtr mResource;
+ native_handle_t *mHandle = nullptr;
+};
+
+class TestingVirtGpuGralloc : public Gralloc {
+ public:
+ TestingVirtGpuGralloc();
+
+ uint32_t createColorBuffer(void*,
+ int width,
+ int height,
+ uint32_t glFormat) override;
+
+ int allocate(uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ uint64_t usage,
+ AHardwareBuffer** outputAhb) override;
+
+ std::unique_ptr<TestingAHardwareBuffer> allocate(uint32_t width,
+ uint32_t height,
+ uint32_t format);
+
+ void acquire(AHardwareBuffer* ahb) override;
+ void release(AHardwareBuffer* ahb) override;
+
+ uint32_t getHostHandle(const native_handle_t* handle) override;
+ uint32_t getHostHandle(const AHardwareBuffer* handle) override;
+
+ int getFormat(const native_handle_t* handle) override;
+ int getFormat(const AHardwareBuffer* handle) override;
+
+ uint32_t getFormatDrmFourcc(const AHardwareBuffer* handle) override;
+
+ size_t getAllocatedSize(const native_handle_t*) override;
+ size_t getAllocatedSize(const AHardwareBuffer*) override;
+
+ private:
+ std::unordered_map<uint32_t, std::unique_ptr<TestingAHardwareBuffer>> mAllocatedColorBuffers;
+};
+
+class TestingANativeWindow {
+ public:
+ TestingANativeWindow(uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ std::vector<std::unique_ptr<TestingAHardwareBuffer>> buffers);
+
+ EGLNativeWindowType asEglNativeWindowType();
+
+ uint32_t getWidth() const;
+
+ uint32_t getHeight() const;
+
+ int getFormat() const;
+
+ int queueBuffer(EGLClientBuffer buffer, int fence);
+ int dequeueBuffer(EGLClientBuffer* buffer, int* fence);
+ int cancelBuffer(EGLClientBuffer buffer);
+
+ private:
+ uint32_t mWidth;
+ uint32_t mHeight;
+ uint32_t mFormat;
+ std::vector<std::unique_ptr<TestingAHardwareBuffer>> mBuffers;
+
+ struct QueuedAHB {
+ TestingAHardwareBuffer* ahb;
+ int fence = -1;
+ };
+ std::deque<QueuedAHB> mBufferQueue;
+};
+
+class TestingVirtGpuANativeWindowHelper : public ANativeWindowHelper {
+ public:
+ bool isValid(EGLNativeWindowType window) override;
+ bool isValid(EGLClientBuffer buffer) override;
+
+ void acquire(EGLNativeWindowType window) override;
+ void release(EGLNativeWindowType window) override;
+
+ void acquire(EGLClientBuffer buffer) override;
+ void release(EGLClientBuffer buffer) override;
+
+ int getConsumerUsage(EGLNativeWindowType window, int* usage) override;
+ void setUsage(EGLNativeWindowType window, int usage) override;
+
+ int getWidth(EGLNativeWindowType window) override;
+ int getHeight(EGLNativeWindowType window) override;
+
+ int getWidth(EGLClientBuffer buffer) override;
+ int getHeight(EGLClientBuffer buffer) override;
+
+ int getFormat(EGLClientBuffer buffer, Gralloc* helper) override;
+
+ void setSwapInterval(EGLNativeWindowType window, int interval) override;
+
+ int queueBuffer(EGLNativeWindowType window, EGLClientBuffer buffer, int fence) override;
+ int dequeueBuffer(EGLNativeWindowType window, EGLClientBuffer* buffer, int* fence) override;
+ int cancelBuffer(EGLNativeWindowType window, EGLClientBuffer buffer) override;
+
+ int getHostHandle(EGLClientBuffer buffer, Gralloc*) override;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/OpenglSystemCommon/ThreadInfo.cpp b/src/gfxstream/guest/OpenglSystemCommon/ThreadInfo.cpp
new file mode 100644
index 00000000000..d0337aed036
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/ThreadInfo.cpp
@@ -0,0 +1,34 @@
+/*
+* 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>
+
+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;
+}
diff --git a/src/gfxstream/guest/OpenglSystemCommon/ThreadInfo.h b/src/gfxstream/guest/OpenglSystemCommon/ThreadInfo.h
new file mode 100644
index 00000000000..c8bf291429b
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/OpenglSystemCommon/TraceProviderFuchsia.cpp b/src/gfxstream/guest/OpenglSystemCommon/TraceProviderFuchsia.cpp
new file mode 100644
index 00000000000..2e671627290
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/OpenglSystemCommon/TraceProviderFuchsia.h b/src/gfxstream/guest/OpenglSystemCommon/TraceProviderFuchsia.h
new file mode 100644
index 00000000000..86b8bdce2bf
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/OpenglSystemCommon/VirtioGpuPipeStream.cpp b/src/gfxstream/guest/OpenglSystemCommon/VirtioGpuPipeStream.cpp
new file mode 100644
index 00000000000..d16b58c84e8
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/VirtioGpuPipeStream.cpp
@@ -0,0 +1,346 @@
+/*
+ * 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 <errno.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <log/log.h>
+
+#include "virtgpu_drm.h"
+#include "VirtGpu.h"
+
+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_virtio_mapped(nullptr),
+ m_bufsize(bufSize),
+ m_buf(nullptr),
+ m_writtenPos(0) { }
+
+VirtioGpuPipeStream::VirtioGpuPipeStream(size_t bufSize, int fd) :
+ IOStream(bufSize),
+ m_fd(fd),
+ m_virtio_mapped(nullptr),
+ m_bufsize(bufSize),
+ m_buf(nullptr),
+ m_writtenPos(0) { }
+
+VirtioGpuPipeStream::~VirtioGpuPipeStream()
+{
+ free(m_buf);
+}
+
+bool VirtioGpuPipeStream::valid() {
+ return m_device != nullptr;
+}
+
+int VirtioGpuPipeStream::getRendernodeFd() {
+ if (m_device == nullptr) {
+ return -1;
+ }
+ return m_device->getDeviceHandle();
+}
+
+int VirtioGpuPipeStream::connect(const char* serviceName)
+{
+ if (!m_device) {
+ m_device.reset(createPlatformVirtGpuDevice(kCapsetNone, m_fd));
+ if (!m_device) {
+ ALOGE("Failed to create VirtioGpuPipeStream VirtGpuDevice.");
+ return -1;
+ }
+
+ m_resource = m_device->createVirglBlob(kTransferBufferSize, 1, VIRGL_FORMAT_R8_UNORM);
+ if (!m_resource) {
+ ALOGE("Failed to create VirtioGpuPipeStream resource.");
+ return -1;
+ }
+
+ m_resourceMapping = m_resource->createMapping();
+ if (!m_resourceMapping) {
+ ALOGE("Failed to create VirtioGpuPipeStream resource mapping.");
+ return -1;
+ }
+
+ m_virtio_mapped = m_resourceMapping->asRawPtr();
+ if (!m_virtio_mapped) {
+ ALOGE("Failed to create VirtioGpuPipeStream resource mapping ptr.");
+ 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;
+}
+
+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 -EINVAL;
+ 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() {
+ int ret = m_resource->wait();
+ 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;
+
+ 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);
+
+ ret = m_resource->transferToHost(m_writtenPos, toXfer);
+ if (ret) {
+ ERR("VirtioGpuPipeStream: failed to transferToHost() 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;
+
+ 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;
+
+ ret = m_resource->transferFromHost(0, toXfer);
+ if (ret) {
+ ERR("VirtioGpuPipeStream: failed to transferFromHost() 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/src/gfxstream/guest/OpenglSystemCommon/VirtioGpuPipeStream.h b/src/gfxstream/guest/OpenglSystemCommon/VirtioGpuPipeStream.h
new file mode 100644
index 00000000000..7afdf6e726b
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/VirtioGpuPipeStream.h
@@ -0,0 +1,70 @@
+/*
+ * 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 "VirtGpu.h"
+#include "gfxstream/guest/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::guest::IOStream {
+ public:
+ explicit VirtioGpuPipeStream(size_t bufsize = 10000);
+ explicit VirtioGpuPipeStream(size_t bufsize, int stream_handle);
+ ~VirtioGpuPipeStream();
+ int connect(const char* serviceName = 0);
+ 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();
+ int getRendernodeFd();
+ int recv(void *buf, size_t len);
+
+ virtual int writeFully(const void *buf, size_t len);
+
+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 = -1;
+ std::unique_ptr<VirtGpuDevice> m_device;
+ VirtGpuBlobPtr m_resource;
+ VirtGpuBlobMappingPtr m_resourceMapping;
+ unsigned char* m_virtio_mapped; // user mapping of bo
+
+ // intermediate buffer
+ size_t m_bufsize;
+ unsigned char *m_buf;
+
+ size_t m_writtenPos;
+};
diff --git a/src/gfxstream/guest/OpenglSystemCommon/meson.build b/src/gfxstream/guest/OpenglSystemCommon/meson.build
new file mode 100644
index 00000000000..0ef41fce7d7
--- /dev/null
+++ b/src/gfxstream/guest/OpenglSystemCommon/meson.build
@@ -0,0 +1,25 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_stream = files(
+ 'HostConnection.cpp',
+ 'ProcessPipe.cpp',
+ 'QemuPipeStream.cpp',
+ 'ThreadInfo.cpp',
+ 'VirtioGpuPipeStream.cpp',
+)
+
+lib_stream = static_library(
+ 'stream',
+ files_lib_stream,
+ cpp_args: gfxstream_guest_args,
+ include_directories: [inc_vulkan_headers, inc_opengl_headers,
+ inc_guest_iostream, inc_opengl_codec,
+ inc_android_emu, inc_android_compat,
+ inc_qemu_pipe, inc_qemu_pipe_types,
+ inc_vulkan_enc, inc_goldfish_address_space,
+ inc_system, inc_platform, inc_codec_common, inc_include],
+ link_with: [lib_goldfish_address_space, lib_qemu_pipe,
+ lib_platform],
+ dependencies: [drm_dep, dep_vk_encoder_h]
+)
diff --git a/src/gfxstream/guest/android-emu/aemu/base/AlignedBuf.cpp b/src/gfxstream/guest/android-emu/aemu/base/AlignedBuf.cpp
new file mode 100644
index 00000000000..a1bc6f34ecb
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/AlignedBuf.cpp
@@ -0,0 +1,45 @@
+// 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 "AlignedBuf.h"
+
+namespace android {
+
+// Convenience function for aligned malloc across platforms
+void* aligned_buf_alloc(size_t align, size_t size) {
+ size_t actualAlign = std::max(align, sizeof(void*));
+#ifdef _WIN32
+ void* res = _aligned_malloc(size, actualAlign);
+ if (!res) {
+ abort();
+ }
+ return res;
+#else
+ void* res;
+ if (posix_memalign(&res, actualAlign, size)) {
+ abort();
+ }
+ return res;
+#endif
+}
+
+void aligned_buf_free(void* buf) {
+#ifdef _WIN32
+ _aligned_free(buf);
+#else
+ free(buf);
+#endif
+}
+
+} // namespace android \ No newline at end of file
diff --git a/src/gfxstream/guest/android-emu/aemu/base/AlignedBuf.h b/src/gfxstream/guest/android-emu/aemu/base/AlignedBuf.h
new file mode 100644
index 00000000000..bf1469ecbad
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/AlignedBuf.h
@@ -0,0 +1,154 @@
+// 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.
+
+#pragma once
+
+#include "aemu/base/Compiler.h"
+
+#include <algorithm>
+#include <atomic>
+#include <cinttypes>
+#include <cstdlib>
+#include <cstring>
+#include <type_traits>
+#include <vector>
+
+#include <stdio.h>
+
+#ifdef _WIN32
+#include <malloc.h>
+#endif
+
+namespace gfxstream {
+namespace guest {
+
+template <class T, size_t align>
+class AlignedBuf {
+public:
+ explicit AlignedBuf(size_t size) {
+ static_assert(align && ((align & (align - 1)) == 0),
+ "AlignedBuf only supports power-of-2 aligments.");
+ resizeImpl(size);
+ }
+
+ AlignedBuf(const AlignedBuf& other) : AlignedBuf(other.mSize) {
+ if (other.mBuffer) { // could have got moved out
+ std::copy(other.mBuffer, other.mBuffer + other.mSize, mBuffer);
+ }
+ }
+
+ AlignedBuf& operator=(const AlignedBuf& other) {
+ if (this != &other) {
+ AlignedBuf tmp(other);
+ *this = std::move(tmp);
+ }
+ return *this;
+ }
+
+ AlignedBuf(AlignedBuf&& other) { *this = std::move(other); }
+
+ AlignedBuf& operator=(AlignedBuf&& other) {
+ mBuffer = other.mBuffer;
+ mSize = other.mSize;
+
+ other.mBuffer = nullptr;
+ other.mSize = 0;
+
+ return *this;
+ }
+
+ ~AlignedBuf() { if (mBuffer) freeImpl(mBuffer); } // account for getting moved out
+
+ void resize(size_t newSize) {
+#if (defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 4) || \
+ defined(__OLD_STD_VERSION__)
+ // Older g++ doesn't support std::is_trivially_copyable.
+ constexpr bool triviallyCopyable =
+ std::has_trivial_copy_constructor<T>::value;
+#else
+ constexpr bool triviallyCopyable = std::is_trivially_copyable<T>::value;
+#endif
+ static_assert(triviallyCopyable,
+ "AlignedBuf can only resize trivially copyable values");
+
+ resizeImpl(newSize);
+ }
+
+ size_t size() const { return mSize; }
+
+ T* data() { return mBuffer; }
+
+ T& operator[](size_t index) { return mBuffer[index]; }
+
+ const T& operator[](size_t index) const { return mBuffer[index]; }
+
+ bool operator==(const AlignedBuf& other) const {
+ return 0 == std::memcmp(mBuffer, other.mBuffer, sizeof(T) * std::min(mSize, other.mSize));
+ }
+
+private:
+
+ void resizeImpl(size_t newSize) {
+ if (newSize) {
+ size_t pad = std::max(align, sizeof(T));
+ size_t keepSize = std::min(newSize, mSize);
+ size_t newSizeBytes = ((align - 1 + newSize * sizeof(T) + pad) / align) * align;
+
+ std::vector<T> temp(mBuffer, mBuffer + keepSize);
+ mBuffer = static_cast<T*>(reallocImpl(mBuffer, newSizeBytes));
+ std::copy(temp.data(), temp.data() + keepSize, mBuffer);
+ } else {
+ if (mBuffer) freeImpl(mBuffer);
+ mBuffer = nullptr;
+ }
+
+ mSize = newSize;
+ }
+
+ void* reallocImpl(void* oldPtr, size_t sizeBytes) {
+ if (oldPtr) { freeImpl(oldPtr); }
+ // Platform aligned malloc might not behave right
+ // if we give it an alignemnt value smaller than sizeof(void*).
+ size_t actualAlign = std::max(align, sizeof(void*));
+#ifdef _WIN32
+ return _aligned_malloc(sizeBytes, actualAlign);
+#else
+ void* res;
+ if (posix_memalign(&res, actualAlign, sizeBytes)) {
+ fprintf(stderr, "%s: failed to alloc aligned memory\n", __func__);
+ abort();
+ }
+ return res;
+#endif
+ }
+
+ void freeImpl(void* ptr) {
+#ifdef _WIN32
+ _aligned_free(ptr);
+#else
+ free(ptr);
+#endif
+
+ }
+
+ T* mBuffer = nullptr;
+ size_t mSize = 0;
+};
+
+// Convenience function for aligned malloc across platforms
+void* aligned_buf_alloc(size_t align, size_t size);
+void aligned_buf_free(void* buf);
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Allocator.h b/src/gfxstream/guest/android-emu/aemu/base/Allocator.h
new file mode 100644
index 00000000000..54a3b307422
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Allocator.h
@@ -0,0 +1,68 @@
+// 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.
+#pragma once
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <string.h>
+
+namespace gfxstream {
+namespace guest {
+
+// A generic memory allocator interface which could be used to allocate
+// a certain size of memory region, or memory region for arrays / strings.
+// How the memory are recycled / freed is up to derived classes.
+class Allocator {
+public:
+ Allocator() = default;
+ virtual ~Allocator() = default;
+
+ virtual void* alloc(size_t wantedSize) = 0;
+
+ // Convenience function to allocate an array
+ // of objects of type T.
+ template <class T>
+ T* allocArray(size_t count) {
+ size_t bytes = sizeof(T) * count;
+ void* res = alloc(bytes);
+ return (T*)res;
+ }
+
+ char* strDup(const char* toCopy) {
+ size_t bytes = strlen(toCopy) + 1;
+ void* res = alloc(bytes);
+ memset(res, 0x0, bytes);
+ memcpy(res, toCopy, bytes);
+ return (char*)res;
+ }
+
+ char** strDupArray(const char* const* arrayToCopy, size_t count) {
+ char** res = allocArray<char*>(count);
+
+ for (size_t i = 0; i < count; i++) {
+ res[i] = strDup(arrayToCopy[i]);
+ }
+
+ return res;
+ }
+
+ void* dupArray(const void* buf, size_t bytes) {
+ void* res = alloc(bytes);
+ memcpy(res, buf, bytes);
+ return res;
+ }
+};
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitor.cpp b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitor.cpp
new file mode 100644
index 00000000000..54e995db7e4
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitor.cpp
@@ -0,0 +1,282 @@
+/*
+ * 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 "aemu/base/AndroidHealthMonitor.h"
+
+#include <map>
+#include <sys/time.h>
+
+namespace gfxstream {
+namespace guest {
+
+using gfxstream::guest::AutoLock;
+using std::chrono::duration_cast;
+
+template <class... Ts>
+struct MonitoredEventVisitor : Ts... {
+ using Ts::operator()...;
+};
+template <class... Ts>
+MonitoredEventVisitor(Ts...) -> MonitoredEventVisitor<Ts...>;
+
+template <class Clock>
+HealthMonitor<Clock>::HealthMonitor(HealthMonitorConsumer& consumer, uint64_t heartbeatInterval)
+ : mInterval(Duration(std::chrono::milliseconds(heartbeatInterval))), mConsumer(consumer) {
+ start();
+}
+
+template <class Clock>
+HealthMonitor<Clock>::~HealthMonitor() {
+ auto event = std::make_unique<MonitoredEvent>(typename MonitoredEventType::EndMonitoring{});
+ {
+ AutoLock lock(mLock);
+ mEventQueue.push(std::move(event));
+ }
+ poll();
+ wait();
+}
+
+template <class Clock>
+typename HealthMonitor<Clock>::Id HealthMonitor<Clock>::startMonitoringTask(
+ std::unique_ptr<EventHangMetadata> metadata,
+ std::optional<std::function<std::unique_ptr<HangAnnotations>()>> onHangAnnotationsCallback,
+ uint64_t timeout, std::optional<Id> parentId) {
+ auto intervalMs = duration_cast<std::chrono::milliseconds>(mInterval).count();
+ if (timeout < intervalMs) {
+ ALOGW("Timeout value %llu is too low (heartbeat is every %llu). Increasing to %llu",
+ (unsigned long long)timeout, (unsigned long long) intervalMs,
+ (unsigned long long)intervalMs * 2);
+ timeout = intervalMs * 2;
+ }
+
+ AutoLock lock(mLock);
+ auto id = mNextId++;
+ auto event = std::make_unique<MonitoredEvent>(typename MonitoredEventType::Start{
+ .id = id,
+ .metadata = std::move(metadata),
+ .timeOccurred = Clock::now(),
+ .onHangAnnotationsCallback = std::move(onHangAnnotationsCallback),
+ .timeoutThreshold = Duration(std::chrono::milliseconds(timeout)),
+ .parentId = parentId});
+ mEventQueue.push(std::move(event));
+ return id;
+}
+
+template <class Clock>
+void HealthMonitor<Clock>::touchMonitoredTask(Id id) {
+ auto event = std::make_unique<MonitoredEvent>(
+ typename MonitoredEventType::Touch{.id = id, .timeOccurred = Clock::now()});
+ AutoLock lock(mLock);
+ mEventQueue.push(std::move(event));
+}
+
+template <class Clock>
+void HealthMonitor<Clock>::stopMonitoringTask(Id id) {
+ auto event = std::make_unique<MonitoredEvent>(
+ typename MonitoredEventType::Stop{.id = id, .timeOccurred = Clock::now()});
+ AutoLock lock(mLock);
+ mEventQueue.push(std::move(event));
+}
+
+template <class Clock>
+std::future<void> HealthMonitor<Clock>::poll() {
+ auto event = std::make_unique<MonitoredEvent>(typename MonitoredEventType::Poll{});
+ std::future<void> ret =
+ std::get<typename MonitoredEventType::Poll>(*event).complete.get_future();
+
+ AutoLock lock(mLock);
+ mEventQueue.push(std::move(event));
+ mCv.signalAndUnlock(&lock);
+ return ret;
+}
+
+// Thread's main loop
+template <class Clock>
+intptr_t HealthMonitor<Clock>::main() {
+ bool keepMonitoring = true;
+ std::queue<std::unique_ptr<MonitoredEvent>> events;
+
+ while (keepMonitoring) {
+ std::vector<std::promise<void>> pollPromises;
+ std::unordered_set<Id> tasksToRemove;
+ int newHungTasks = mHungTasks;
+ {
+ AutoLock lock(mLock);
+ struct timeval currentTime;
+ gettimeofday(&currentTime, 0);
+ if (mEventQueue.empty()) {
+ mCv.timedWait(
+ &mLock,
+ currentTime.tv_sec * 1000000LL + currentTime.tv_usec +
+ std::chrono::duration_cast<std::chrono::microseconds>(mInterval).count());
+ }
+ mEventQueue.swap(events);
+ }
+
+ Timestamp now = Clock::now();
+ while (!events.empty()) {
+ auto event(std::move(events.front()));
+ events.pop();
+
+ std::visit(MonitoredEventVisitor{
+ [](std::monostate&) {
+ ALOGE("MonitoredEvent type not found");
+ abort();
+ },
+ [this, &events](typename MonitoredEventType::Start& event) {
+ auto it = mMonitoredTasks.find(event.id);
+ if (it != mMonitoredTasks.end()) {
+ ALOGE("Registered multiple start events for task %llu",
+ (unsigned long long)event.id);
+ return;
+ }
+ if (event.parentId && mMonitoredTasks.find(event.parentId.value()) ==
+ mMonitoredTasks.end()) {
+ ALOGW("Requested parent task %llu does not exist.",
+ (unsigned long long)event.parentId.value());
+ event.parentId = std::nullopt;
+ }
+ it = mMonitoredTasks
+ .emplace(event.id,
+ std::move(MonitoredTask{
+ .id = event.id,
+ .timeoutTimestamp = event.timeOccurred +
+ event.timeoutThreshold,
+ .timeoutThreshold = event.timeoutThreshold,
+ .hungTimestamp = std::nullopt,
+ .metadata = std::move(event.metadata),
+ .onHangAnnotationsCallback =
+ std::move(event.onHangAnnotationsCallback),
+ .parentId = event.parentId}))
+ .first;
+ updateTaskParent(events, it->second, event.timeOccurred);
+ },
+ [this, &events](typename MonitoredEventType::Touch& event) {
+ auto it = mMonitoredTasks.find(event.id);
+ if (it == mMonitoredTasks.end()) {
+ ALOGE("HealthMonitor has no task in progress for id %llu",
+ (unsigned long long)event.id);
+ return;
+ }
+
+ auto& task = it->second;
+ task.timeoutTimestamp = event.timeOccurred + task.timeoutThreshold;
+ updateTaskParent(events, task, event.timeOccurred);
+ },
+ [this, &tasksToRemove,
+ &events](typename MonitoredEventType::Stop& event) {
+ auto it = mMonitoredTasks.find(event.id);
+ if (it == mMonitoredTasks.end()) {
+ ALOGE("HealthMonitor has no task in progress for id %llu",
+ (unsigned long long)event.id);
+ return;
+ }
+
+ auto& task = it->second;
+ task.timeoutTimestamp = event.timeOccurred + task.timeoutThreshold;
+ updateTaskParent(events, task, event.timeOccurred);
+
+ // Mark it for deletion, but retain it until the end of
+ // the health check concurrent tasks hung
+ tasksToRemove.insert(event.id);
+ },
+ [&keepMonitoring](typename MonitoredEventType::EndMonitoring&) {
+ keepMonitoring = false;
+ },
+ [&pollPromises](typename MonitoredEventType::Poll& event) {
+ pollPromises.push_back(std::move(event.complete));
+ }},
+ *event);
+ }
+
+ // Sort by what times out first. Identical timestamps are possible
+ std::multimap<Timestamp, uint64_t> sortedTasks;
+ for (auto& [_, task] : mMonitoredTasks) {
+ sortedTasks.insert(std::pair<Timestamp, uint64_t>(task.timeoutTimestamp, task.id));
+ }
+
+ for (auto& [_, task_id] : sortedTasks) {
+ auto& task = mMonitoredTasks[task_id];
+ if (task.timeoutTimestamp < now) {
+ // Newly hung task
+ if (!task.hungTimestamp.has_value()) {
+ // Copy over additional annotations captured at hangTime
+ if (task.onHangAnnotationsCallback) {
+ auto newAnnotations = (*task.onHangAnnotationsCallback)();
+ task.metadata->mergeAnnotations(std::move(newAnnotations));
+ }
+ mConsumer.consumeHangEvent(task.id, task.metadata.get(), newHungTasks);
+ task.hungTimestamp = task.timeoutTimestamp;
+ newHungTasks++;
+ }
+ } else {
+ // Task resumes
+ if (task.hungTimestamp.has_value()) {
+ auto hangTime = duration_cast<std::chrono::milliseconds>(
+ task.timeoutTimestamp -
+ (task.hungTimestamp.value() + task.timeoutThreshold))
+ .count();
+ mConsumer.consumeUnHangEvent(task.id, task.metadata.get(), hangTime);
+ task.hungTimestamp = std::nullopt;
+ newHungTasks--;
+ }
+ }
+ if (tasksToRemove.find(task_id) != tasksToRemove.end()) {
+ mMonitoredTasks.erase(task_id);
+ }
+ }
+
+ if (mHungTasks != newHungTasks) {
+ ALOGE("HealthMonitor: Number of unresponsive tasks %s: %d -> %d",
+ mHungTasks < newHungTasks ? "increased" : "decreaased", mHungTasks, newHungTasks);
+ mHungTasks = newHungTasks;
+ }
+
+ for (auto& complete : pollPromises) {
+ complete.set_value();
+ }
+ }
+
+ return 0;
+}
+
+template <class Clock>
+void HealthMonitor<Clock>::updateTaskParent(std::queue<std::unique_ptr<MonitoredEvent>>& events,
+ const MonitoredTask& task, Timestamp eventTime) {
+ std::optional<Id> parentId = task.parentId;
+ if (parentId) {
+ auto event = std::make_unique<MonitoredEvent>(typename MonitoredEventType::Touch{
+ .id = parentId.value(), .timeOccurred = eventTime + Duration(kTimeEpsilon)});
+ events.push(std::move(event));
+ }
+}
+
+std::unique_ptr<HealthMonitor<>> CreateHealthMonitor(HealthMonitorConsumer& consumer,
+ uint64_t heartbeatInterval) {
+#ifdef ENABLE_ANDROID_HEALTH_MONITOR
+ ALOGI("HealthMonitor enabled. Returning monitor.");
+ return std::make_unique<HealthMonitor<>>(consumer, heartbeatInterval);
+#else
+ (void)consumer;
+ (void)heartbeatInterval;
+ ALOGI("HealthMonitor disabled. Returning nullptr");
+ return nullptr;
+#endif
+}
+
+template class HealthMonitor<steady_clock>;
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitor.h b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitor.h
new file mode 100644
index 00000000000..faf358291d9
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitor.h
@@ -0,0 +1,281 @@
+/*
+ * 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.
+ */
+#pragma once
+
+#include <chrono>
+#include <functional>
+#include <future>
+#include <optional>
+#include <queue>
+#include <stack>
+#include <string>
+#include <type_traits>
+#include <unordered_map>
+#include <unordered_set>
+#include <variant>
+#include <utility>
+
+#include "aemu/base/AndroidHealthMonitorConsumer.h"
+#include "aemu/base/synchronization/AndroidConditionVariable.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+#include "aemu/base/threads/AndroidThread.h"
+
+#include <log/log.h>
+
+using gfxstream::guest::EventHangMetadata;
+
+#define WATCHDOG_BUILDER(healthMonitorPtr, msg) \
+ gfxstream::guest::HealthWatchdogBuilder<std::decay_t<decltype(*(healthMonitorPtr))>>( \
+ (healthMonitorPtr), __FILE__, __func__, msg, __LINE__)
+
+namespace gfxstream {
+namespace guest {
+
+using gfxstream::guest::ConditionVariable;
+using gfxstream::guest::Lock;
+using std::chrono::duration;
+using std::chrono::steady_clock;
+using std::chrono::time_point;
+using HangAnnotations = EventHangMetadata::HangAnnotations;
+
+static uint64_t kDefaultIntervalMs = 1'000;
+static uint64_t kDefaultTimeoutMs = 5'000;
+static std::chrono::nanoseconds kTimeEpsilon(1);
+
+// HealthMonitor provides the ability to register arbitrary start/touch/stop events associated
+// with client defined tasks. At some pre-defined interval, it will periodically consume
+// all logged events to assess whether the system is hanging on any task. Via the
+// HealthMonitorConsumer, it will log hang and unhang events when it detects tasks hanging/resuming.
+// Design doc: http://go/gfxstream-health-monitor
+template <class Clock = steady_clock>
+class HealthMonitor : public gfxstream::guest::Thread {
+ public:
+ // Alias for task id.
+ using Id = uint64_t;
+
+ // Constructor
+ // `heatbeatIntervalMs` is the interval, in milleseconds, that the thread will sleep for
+ // in between health checks.
+ HealthMonitor(HealthMonitorConsumer& consumer, uint64_t heartbeatInterval = kDefaultIntervalMs);
+
+ // Destructor
+ // Enqueues an event to end monitoring and waits on thread to process remaining queued events.
+ ~HealthMonitor();
+
+ // Start monitoring a task. Returns an id that is used for touch and stop operations.
+ // `metadata` is a struct containing info on the task watchdog to be passed through to the
+ // metrics logger.
+ // `onHangAnnotationsCallback` is an optional containing a callable that will return key-value
+ // string pairs to be recorded at the time a hang is detected, which is useful for debugging.
+ // `timeout` is the duration in milliseconds a task is allowed to run before it's
+ // considered "hung". Because `timeout` must be larger than the monitor's heartbeat
+ // interval, as shorter timeout periods would not be detected, this method will set actual
+ // timeout to the lesser of `timeout` and twice the heartbeat interval.
+ // `parentId` can be the Id of another task. Events in this monitored task will update
+ // the parent task recursively.
+ Id startMonitoringTask(std::unique_ptr<EventHangMetadata> metadata,
+ std::optional<std::function<std::unique_ptr<HangAnnotations>()>>
+ onHangAnnotationsCallback = std::nullopt,
+ uint64_t timeout = kDefaultTimeoutMs,
+ std::optional<Id> parentId = std::nullopt);
+
+ // Touch a monitored task. Resets the timeout countdown for that task.
+ void touchMonitoredTask(Id id);
+
+ // Stop monitoring a task.
+ void stopMonitoringTask(Id id);
+
+ private:
+ using Duration = typename Clock::duration; // duration<double>;
+ using Timestamp = time_point<Clock, Duration>;
+
+ // Allow test class access to private functions
+ friend class HealthMonitorTest;
+
+ struct MonitoredEventType {
+ struct Start {
+ Id id;
+ std::unique_ptr<EventHangMetadata> metadata;
+ Timestamp timeOccurred;
+ std::optional<std::function<std::unique_ptr<HangAnnotations>()>>
+ onHangAnnotationsCallback;
+ Duration timeoutThreshold;
+ std::optional<Id> parentId;
+ };
+ struct Touch {
+ Id id;
+ Timestamp timeOccurred;
+ };
+ struct Stop {
+ Id id;
+ Timestamp timeOccurred;
+ };
+ struct EndMonitoring {};
+ struct Poll {
+ std::promise<void> complete;
+ };
+ };
+
+ using MonitoredEvent =
+ std::variant<std::monostate, typename MonitoredEventType::Start,
+ typename MonitoredEventType::Touch, typename MonitoredEventType::Stop,
+ typename MonitoredEventType::EndMonitoring, typename MonitoredEventType::Poll>;
+
+ struct MonitoredTask {
+ Id id;
+ Timestamp timeoutTimestamp;
+ Duration timeoutThreshold;
+ std::optional<Timestamp> hungTimestamp;
+ std::unique_ptr<EventHangMetadata> metadata;
+ std::optional<std::function<std::unique_ptr<HangAnnotations>()>> onHangAnnotationsCallback;
+ std::optional<Id> parentId;
+ };
+
+ // Thread's main loop
+ intptr_t main() override;
+
+ // Update the parent task
+ void updateTaskParent(std::queue<std::unique_ptr<MonitoredEvent>>& events,
+ const MonitoredTask& task, Timestamp eventTime);
+
+ // Explicitly wake the monitor thread. Returns a future that can be used to wait until the
+ // poll event has been processed.
+ std::future<void> poll();
+
+ // Immutable. Multi-thread access is safe.
+ const Duration mInterval;
+
+ // Members accessed only on the worker thread. Not protected by mutex.
+ int mHungTasks = 0;
+ HealthMonitorConsumer& mConsumer;
+ std::unordered_map<Id, MonitoredTask> mMonitoredTasks;
+
+ // Lock and cv control access to queue and id counter
+ ConditionVariable mCv;
+ Lock mLock;
+ Id mNextId = 0;
+ std::queue<std::unique_ptr<MonitoredEvent>> mEventQueue;
+};
+
+// This class provides an RAII mechanism for monitoring a task.
+// HealthMonitorT should have the exact same interface as HealthMonitor. Note that HealthWatchdog
+// can be used in performance critical path, so we use a template to dispatch a call here to
+// overcome the performance cost of virtual function dispatch.
+template <class HealthMonitorT = HealthMonitor<>>
+class HealthWatchdog {
+ public:
+ HealthWatchdog(HealthMonitorT* healthMonitor, std::unique_ptr<EventHangMetadata> metadata,
+ std::optional<std::function<std::unique_ptr<HangAnnotations>()>>
+ onHangAnnotationsCallback = std::nullopt,
+ uint64_t timeout = kDefaultTimeoutMs)
+ : mHealthMonitor(healthMonitor), mThreadId(getCurrentThreadId()) {
+ if (!mHealthMonitor) {
+ mId = std::nullopt;
+ return;
+ }
+ // TODO: willho@ re-enable thread awareness b/253483619
+ typename HealthMonitorT::Id id = mHealthMonitor->startMonitoringTask(
+ std::move(metadata), std::move(onHangAnnotationsCallback), timeout, std::nullopt);
+ mId = id;
+ }
+
+ ~HealthWatchdog() {
+ if (!mId.has_value()) {
+ return;
+ }
+ mHealthMonitor->stopMonitoringTask(*mId);
+ }
+
+ void touch() {
+ if (!mId.has_value()) {
+ return;
+ }
+ mHealthMonitor->touchMonitoredTask(*mId);
+ }
+
+ // Return the underlying Id, and don't issue a stop on destruction.
+ std::optional<typename HealthMonitorT::Id> release() {
+ return std::exchange(mId, std::nullopt);
+ }
+
+ private:
+ using ThreadTasks =
+ std::unordered_map<HealthMonitorT*, std::stack<typename HealthMonitorT::Id>>;
+ std::optional<typename HealthMonitorT::Id> mId;
+ HealthMonitorT* mHealthMonitor;
+ const unsigned long mThreadId;
+};
+
+// HealthMonitorT should have the exact same interface as HealthMonitor. This template parameter is
+// used for injecting a different type for testing.
+template <class HealthMonitorT>
+class HealthWatchdogBuilder {
+ public:
+ HealthWatchdogBuilder(HealthMonitorT* healthMonitor, const char* fileName,
+ const char* functionName, const char* message, uint32_t line)
+ : mHealthMonitor(healthMonitor),
+ mMetadata(std::make_unique<EventHangMetadata>(
+ fileName, functionName, message, line, EventHangMetadata::HangType::kOther, nullptr)),
+ mTimeoutMs(kDefaultTimeoutMs),
+ mOnHangCallback(std::nullopt) {}
+
+ DISALLOW_COPY_ASSIGN_AND_MOVE(HealthWatchdogBuilder);
+
+ HealthWatchdogBuilder& setHangType(EventHangMetadata::HangType hangType) {
+ if (mHealthMonitor) mMetadata->hangType = hangType;
+ return *this;
+ }
+ HealthWatchdogBuilder& setTimeoutMs(uint32_t timeoutMs) {
+ if (mHealthMonitor) mTimeoutMs = timeoutMs;
+ return *this;
+ }
+ // F should be a callable that returns a std::unique_ptr<EventHangMetadata::HangAnnotations>. We
+ // use template instead of std::function here to avoid extra copy.
+ template <class F>
+ HealthWatchdogBuilder& setOnHangCallback(F&& callback) {
+ if (mHealthMonitor) {
+ mOnHangCallback =
+ std::function<std::unique_ptr<HangAnnotations>()>(std::forward<F>(callback));
+ }
+ return *this;
+ }
+
+ HealthWatchdogBuilder& setAnnotations(std::unique_ptr<HangAnnotations> annotations) {
+ if (mHealthMonitor) mMetadata->data = std::move(annotations);
+ return *this;
+ }
+
+ std::unique_ptr<HealthWatchdog<HealthMonitorT>> build() {
+ // We are allocating on the heap, so there is a performance hit. However we also allocate
+ // EventHangMetadata on the heap, so this should be Ok. If we see performance issues with
+ // these allocations, for HealthWatchdog, we can always use placement new + noop deleter to
+ // avoid heap allocation for HealthWatchdog.
+ return std::make_unique<HealthWatchdog<HealthMonitorT>>(
+ mHealthMonitor, std::move(mMetadata), std::move(mOnHangCallback), mTimeoutMs);
+ }
+
+ private:
+ HealthMonitorT* mHealthMonitor;
+ std::unique_ptr<EventHangMetadata> mMetadata;
+ uint32_t mTimeoutMs;
+ std::optional<std::function<std::unique_ptr<HangAnnotations>()>> mOnHangCallback;
+};
+
+std::unique_ptr<HealthMonitor<>> CreateHealthMonitor(
+ HealthMonitorConsumer& consumer, uint64_t heartbeatInterval = kDefaultIntervalMs);
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumer.h b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumer.h
new file mode 100644
index 00000000000..e2a477631d9
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumer.h
@@ -0,0 +1,81 @@
+// 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.
+#pragma once
+
+#include <inttypes.h>
+
+#include <memory>
+#include <string>
+#include <thread>
+#include <unordered_map>
+#include <variant>
+
+#include "aemu/base/threads/AndroidThread.h"
+
+// Interface for consuming events from HealthMonitor
+
+namespace gfxstream {
+namespace guest {
+
+// Struct for hanging events
+struct EventHangMetadata {
+ const char* file;
+ const char* function;
+ const char* msg;
+ const int line;
+ const unsigned long threadId;
+ // Field for adding custom key value annotations
+ using HangAnnotations = std::unordered_map<std::string, std::string>;
+ // Field for adding custom key value annotations
+ std::unique_ptr<HangAnnotations> data;
+
+ // TODO: willho@ replace this enum with a generic string field embedded in the
+ // proto and replace the individual event codes with a general hang event
+ // Requires a new callback to be passed from the vm to gfxstream_backend_init
+ enum class HangType { kRenderThread, kSyncThread, kOther };
+ HangType hangType;
+
+ EventHangMetadata(const char* file, const char* function, const char* msg, int line,
+ HangType hangType, std::unique_ptr<HangAnnotations> data)
+ : file(file),
+ function(function),
+ msg(msg),
+ line(line),
+ threadId(getCurrentThreadId()),
+ data(std::move(data)),
+ hangType(hangType) {}
+
+ EventHangMetadata()
+ : EventHangMetadata(nullptr, nullptr, nullptr, 0, HangType::kRenderThread, nullptr) {}
+
+ void mergeAnnotations(std::unique_ptr<HangAnnotations> annotations) {
+ if (!data) {
+ data = std::make_unique<HangAnnotations>();
+ }
+ data->merge(*annotations);
+ }
+};
+
+class HealthMonitorConsumer {
+public:
+ virtual void consumeHangEvent(uint64_t taskId, const EventHangMetadata* metadata,
+ int64_t otherHungTasks) = 0;
+ virtual void consumeUnHangEvent(uint64_t taskId, const EventHangMetadata* metadata,
+ int64_t hungMs) = 0;
+ virtual ~HealthMonitorConsumer() {}
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.cpp b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.cpp
new file mode 100644
index 00000000000..c3e0bf591e7
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.cpp
@@ -0,0 +1,57 @@
+// 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.
+
+#include "aemu/base/AndroidHealthMonitorConsumerBasic.h"
+
+#include <log/log.h>
+
+#include "aemu/base/Process.h"
+
+namespace gfxstream {
+namespace guest {
+
+void logEventHangMetadata(const EventHangMetadata* metadata) {
+ ALOGE("Metadata:");
+ ALOGE("\t file: %s", metadata->file);
+ ALOGE("\t function: %s", metadata->function);
+ ALOGE("\t line: %d", metadata->line);
+ ALOGE("\t msg: %s", metadata->msg);
+ ALOGE("\t thread: %lld (0x%08llx)", (long long)metadata->threadId,
+ (long long)metadata->threadId);
+ ALOGE("\t process name: %s", getProcessName().c_str());
+ if (metadata->data) {
+ ALOGE("\t Additional information:");
+ for (auto& [key, value] : *metadata->data) {
+ ALOGE("\t \t %s: %s", key.c_str(), value.c_str());
+ }
+ }
+}
+
+// HealthMonitorConsumerBasic
+void HealthMonitorConsumerBasic::consumeHangEvent(uint64_t,
+ const EventHangMetadata* metadata,
+ int64_t otherHungTasks) {
+ ALOGE("Logging hang event. Number of tasks already hung: %lld", (long long)otherHungTasks);
+ logEventHangMetadata(metadata);
+}
+
+void HealthMonitorConsumerBasic::consumeUnHangEvent(uint64_t,
+ const EventHangMetadata* metadata,
+ int64_t hungMs) {
+ ALOGE("Logging unhang event. Hang time: %lld ms", (long long)hungMs);
+ logEventHangMetadata(metadata);
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.h b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.h
new file mode 100644
index 00000000000..a7651ef2afe
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/AndroidHealthMonitorConsumerBasic.h
@@ -0,0 +1,30 @@
+// 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.
+#pragma once
+
+#include "AndroidHealthMonitorConsumer.h"
+
+namespace gfxstream {
+namespace guest {
+class HealthMonitorConsumerBasic: public HealthMonitorConsumer {
+public:
+ void consumeHangEvent(uint64_t taskId, const EventHangMetadata* metadata,
+ int64_t otherHungTasks) override;
+ void consumeUnHangEvent(uint64_t taskId, const EventHangMetadata* metadata,
+ int64_t hungMs) override;
+
+};
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/AndroidSubAllocator.cpp b/src/gfxstream/guest/android-emu/aemu/base/AndroidSubAllocator.cpp
new file mode 100644
index 00000000000..5f5d387266f
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/AndroidSubAllocator.cpp
@@ -0,0 +1,238 @@
+// 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 "aemu/base/AndroidSubAllocator.h"
+
+#include "aemu/base/address_space.h"
+#include "aemu/base/files/Stream.h"
+
+#include <iomanip>
+#include <sstream>
+#include <string>
+
+#include <log/log.h>
+
+namespace gfxstream {
+namespace guest {
+
+class SubAllocator::Impl {
+public:
+ Impl(
+ void* _buffer,
+ uint64_t _totalSize,
+ uint64_t _pageSize) :
+ buffer(_buffer),
+ totalSize(_totalSize),
+ pageSize(_pageSize),
+ startAddr((uintptr_t)buffer),
+ endAddr(startAddr + totalSize) {
+
+ address_space_allocator_init(
+ &addr_alloc,
+ totalSize,
+ 32);
+ }
+
+ ~Impl() {
+ address_space_allocator_destroy_nocleanup(&addr_alloc);
+ }
+
+ void clear() {
+ address_space_allocator_destroy_nocleanup(&addr_alloc);
+ address_space_allocator_init(
+ &addr_alloc,
+ totalSize,
+ 32);
+ }
+
+ bool save(Stream* stream) {
+ address_space_allocator_iter_func_t allocatorSaver =
+ [](void* context, struct address_space_allocator* allocator) {
+ Stream* stream = reinterpret_cast<Stream*>(context);
+ stream->putBe32(allocator->size);
+ stream->putBe32(allocator->capacity);
+ stream->putBe64(allocator->total_bytes);
+ };
+ address_block_iter_func_t allocatorBlockSaver =
+ [](void* context, struct address_block* block) {
+ Stream* stream = reinterpret_cast<Stream*>(context);
+ stream->putBe64(block->offset);
+ stream->putBe64(block->size_available);
+ };
+ address_space_allocator_run(
+ &addr_alloc,
+ (void*)stream,
+ allocatorSaver,
+ allocatorBlockSaver);
+
+ stream->putBe64(pageSize);
+ stream->putBe64(totalSize);
+ stream->putBe32(allocCount);
+
+ return true;
+ }
+
+ bool load(Stream* stream) {
+ clear();
+ address_space_allocator_iter_func_t allocatorLoader =
+ [](void* context, struct address_space_allocator* allocator) {
+ Stream* stream = reinterpret_cast<Stream*>(context);
+ allocator->size = stream->getBe32();
+ allocator->capacity = stream->getBe32();
+ allocator->total_bytes = stream->getBe64();
+ };
+ address_block_iter_func_t allocatorBlockLoader =
+ [](void* context, struct address_block* block) {
+ Stream* stream = reinterpret_cast<Stream*>(context);
+ block->offset = stream->getBe64();
+ block->size_available = stream->getBe64();
+ };
+ address_space_allocator_run(
+ &addr_alloc,
+ (void*)stream,
+ allocatorLoader,
+ allocatorBlockLoader);
+
+ pageSize = stream->getBe64();
+ totalSize = stream->getBe64();
+ allocCount = stream->getBe32();
+
+ return true;
+ }
+
+ bool postLoad(void* postLoadBuffer) {
+ buffer = postLoadBuffer;
+ startAddr =
+ (uint64_t)(uintptr_t)postLoadBuffer;
+ return true;
+ }
+
+ void rangeCheck(const char* task, void* ptr) {
+ uint64_t addr = (uintptr_t)ptr;
+ if (addr < startAddr ||
+ addr > endAddr) {
+ std::stringstream ss;
+ ss << "SubAllocator " << task << ": ";
+ ss << "Out of range: " << std::hex << addr << " ";
+ ss << "Range: " <<
+ std::hex << startAddr << " " <<
+ std::hex << endAddr;
+ std::string msg = ss.str();
+ ALOGE("Fatal: %s\n", msg.c_str());
+ }
+ }
+
+ uint64_t getOffset(void* checkedPtr) {
+ uint64_t addr = (uintptr_t)checkedPtr;
+ return addr - startAddr;
+ }
+
+ bool free(void* ptr) {
+ if (!ptr) return false;
+
+ rangeCheck("free", ptr);
+ if (EINVAL == address_space_allocator_deallocate(
+ &addr_alloc, getOffset(ptr))) {
+ return false;
+ }
+
+ --allocCount;
+ return true;
+ }
+
+ void freeAll() {
+ address_space_allocator_reset(&addr_alloc);
+ allocCount = 0;
+ }
+
+ void* alloc(size_t wantedSize) {
+ if (wantedSize == 0) return nullptr;
+
+ uint64_t wantedSize64 =
+ (uint64_t)wantedSize;
+
+ size_t toPageSize =
+ pageSize *
+ ((wantedSize + pageSize - 1) / pageSize);
+
+ uint64_t offset =
+ address_space_allocator_allocate(
+ &addr_alloc, toPageSize);
+
+ if (offset == ANDROID_EMU_ADDRESS_SPACE_BAD_OFFSET) {
+ return nullptr;
+ }
+
+ ++allocCount;
+ return (void*)(uintptr_t)(startAddr + offset);
+ }
+
+ bool empty() const {
+ return allocCount == 0;
+ }
+
+ void* buffer;
+ uint64_t totalSize;
+ uint64_t pageSize;
+ uint64_t startAddr;
+ uint64_t endAddr;
+ struct address_space_allocator addr_alloc;
+ uint32_t allocCount = 0;
+};
+
+SubAllocator::SubAllocator(
+ void* buffer,
+ uint64_t totalSize,
+ uint64_t pageSize) :
+ mImpl(
+ new SubAllocator::Impl(buffer, totalSize, pageSize)) { }
+
+SubAllocator::~SubAllocator() {
+ delete mImpl;
+}
+
+// Snapshotting
+bool SubAllocator::save(Stream* stream) {
+ return mImpl->save(stream);
+}
+
+bool SubAllocator::load(Stream* stream) {
+ return mImpl->load(stream);
+}
+
+bool SubAllocator::postLoad(void* postLoadBuffer) {
+ return mImpl->postLoad(postLoadBuffer);
+}
+
+void* SubAllocator::alloc(size_t wantedSize) {
+ return mImpl->alloc(wantedSize);
+}
+
+bool SubAllocator::free(void* ptr) {
+ return mImpl->free(ptr);
+}
+
+void SubAllocator::freeAll() {
+ mImpl->freeAll();
+}
+
+uint64_t SubAllocator::getOffset(void* ptr) {
+ return mImpl->getOffset(ptr);
+}
+
+bool SubAllocator::empty() const {
+ return mImpl->empty();
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/AndroidSubAllocator.h b/src/gfxstream/guest/android-emu/aemu/base/AndroidSubAllocator.h
new file mode 100644
index 00000000000..352ea4f7a1f
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/AndroidSubAllocator.h
@@ -0,0 +1,94 @@
+// 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.
+#pragma once
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <string.h>
+
+namespace gfxstream {
+namespace guest {
+
+class Stream;
+
+// Class to create sub-allocations in an existing buffer. Similar interface to
+// Pool, but underlying mechanism is different as it's difficult to combine
+// same-size heaps in Pool with a preallocated buffer.
+class SubAllocator {
+public:
+ // |pageSize| determines both the alignment of pointers returned
+ // and the multiples of space occupied.
+ SubAllocator(
+ void* buffer,
+ uint64_t totalSize,
+ uint64_t pageSize);
+
+ // Memory is freed from the perspective of the user of
+ // SubAllocator, but the prealloced buffer is not freed.
+ ~SubAllocator();
+
+ // Snapshotting
+ bool save(Stream* stream);
+ bool load(Stream* stream);
+ bool postLoad(void* postLoadBuffer);
+
+ // returns null if the allocation cannot be satisfied.
+ void* alloc(size_t wantedSize);
+ // returns true if |ptr| came from alloc(), false otherwise
+ bool free(void* ptr);
+ void freeAll();
+ uint64_t getOffset(void* ptr);
+
+ bool empty() const;
+
+ // Convenience function to allocate an array
+ // of objects of type T.
+ template <class T>
+ T* allocArray(size_t count) {
+ size_t bytes = sizeof(T) * count;
+ void* res = alloc(bytes);
+ return (T*) res;
+ }
+
+ char* strDup(const char* toCopy) {
+ size_t bytes = strlen(toCopy) + 1;
+ void* res = alloc(bytes);
+ memset(res, 0x0, bytes);
+ memcpy(res, toCopy, bytes);
+ return (char*)res;
+ }
+
+ char** strDupArray(const char* const* arrayToCopy, size_t count) {
+ char** res = allocArray<char*>(count);
+
+ for (size_t i = 0; i < count; i++) {
+ res[i] = strDup(arrayToCopy[i]);
+ }
+
+ return res;
+ }
+
+ void* dupArray(const void* buf, size_t bytes) {
+ void* res = alloc(bytes);
+ memcpy(res, buf, bytes);
+ return res;
+ }
+
+private:
+ class Impl;
+ Impl* mImpl = nullptr;
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/BumpPool.h b/src/gfxstream/guest/android-emu/aemu/base/BumpPool.h
new file mode 100644
index 00000000000..161ff709b77
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/BumpPool.h
@@ -0,0 +1,78 @@
+// 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.
+#pragma once
+
+#include "aemu/base/AlignedBuf.h"
+#include "aemu/base/Allocator.h"
+
+#include <vector>
+#include <unordered_set>
+
+#include <inttypes.h>
+
+namespace gfxstream {
+namespace guest {
+
+// Class to make it easier to set up memory regions where it is fast
+// to allocate buffers AND we don't care about freeing individual pieces,
+// BUT it's necessary to preserve previous pointer values in between the first
+// alloc() after a freeAll(), and the freeAll() itself, allowing some sloppy use of
+// malloc in the first pass while we find out how much data was needed.
+class BumpPool : public Allocator {
+public:
+ BumpPool(size_t startingBytes = 4096) : mStorage(startingBytes / sizeof(uint64_t)) { }
+ // All memory allocated by this pool
+ // is automatically deleted when the pool
+ // is deconstructed.
+ ~BumpPool() { }
+
+ void* alloc(size_t wantedSize) override {
+ size_t wantedSizeRoundedUp =
+ sizeof(uint64_t) * ((wantedSize + sizeof(uint64_t) - 1) / (sizeof(uint64_t)));
+
+ mTotalWantedThisGeneration += wantedSizeRoundedUp;
+ if (mAllocPos + wantedSizeRoundedUp > mStorage.size() * sizeof(uint64_t)) {
+ mNeedRealloc = true;
+ void* fallbackPtr = malloc(wantedSizeRoundedUp);
+ mFallbackPtrs.insert(fallbackPtr);
+ return fallbackPtr;
+ }
+ size_t avail = mStorage.size() * sizeof(uint64_t) - mAllocPos;
+ void* allocPtr = (void*)(((unsigned char*)mStorage.data()) + mAllocPos);
+ mAllocPos += wantedSizeRoundedUp;
+ return allocPtr;
+ }
+
+ void freeAll() {
+ mAllocPos = 0;
+ if (mNeedRealloc) {
+ mStorage.resize((mTotalWantedThisGeneration * 2) / sizeof(uint64_t));
+ mNeedRealloc = false;
+ for (auto ptr : mFallbackPtrs) {
+ free(ptr);
+ }
+ mFallbackPtrs.clear();
+ }
+ mTotalWantedThisGeneration = 0;
+ }
+private:
+ AlignedBuf<uint64_t, 8> mStorage;
+ std::unordered_set<void*> mFallbackPtrs;
+ size_t mAllocPos = 0;
+ size_t mTotalWantedThisGeneration = 0;
+ bool mNeedRealloc = false;
+};
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Compiler.h b/src/gfxstream/guest/android-emu/aemu/base/Compiler.h
new file mode 100644
index 00000000000..00261b04dd7
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Compiler.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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
+
+// Use this inside a class declaration to ensure that the corresponding objects
+// cannot be copy-constructed or assigned. For example:
+//
+// class Foo {
+// ....
+// DISALLOW_COPY_AND_ASSIGN(Foo)
+// ....
+// };
+//
+// Note: this macro is sometimes defined in 3rd-party libs, so let's check first
+#ifndef DISALLOW_COPY_AND_ASSIGN
+
+#define DISALLOW_COPY_AND_ASSIGN(T) \
+ T(const T& other) = delete; \
+ T& operator=(const T& other) = delete
+
+#endif
+
+#ifndef DISALLOW_COPY_ASSIGN_AND_MOVE
+
+#define DISALLOW_COPY_ASSIGN_AND_MOVE(T) \
+ DISALLOW_COPY_AND_ASSIGN(T); \
+ T(T&&) = delete; \
+ T& operator=(T&&) = delete
+
+#endif
diff --git a/src/gfxstream/guest/android-emu/aemu/base/EnumFlags.h b/src/gfxstream/guest/android-emu/aemu/base/EnumFlags.h
new file mode 100644
index 00000000000..b43e5d15911
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/EnumFlags.h
@@ -0,0 +1,120 @@
+// 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.
+
+#pragma once
+
+#include <type_traits>
+
+// This header defines some utitily methods to manipulate scoped enums as flags
+// C++11 scoped enums by default don't support flag operations (e.g. if (a & b))
+// We need to define bitwise operations for them to be able to have strongly
+// typed flags in our code.
+//
+// To enable the flag operators for your enum, most probably you just need to
+// include this file. The only exception is if your enum is located in some
+// namespace other than android, gfxstream::guest or global. In that case you also
+// need to add the following using to bring in the operators:
+//
+// using namespace gfxstream::guest::EnumFlags;
+
+namespace gfxstream {
+namespace guest {
+namespace EnumFlags {
+
+// A predicate which checks if template agument is a scoped enum
+template<class E>
+using is_scoped_enum = std::integral_constant<
+ bool,
+ std::is_enum<E>::value && !std::is_convertible<E, int>::value>;
+
+template <class E>
+using underlying_enum_type = typename std::underlying_type<E>::type;
+
+template <class E, class Res = E>
+using enable_if_scoped_enum =
+ typename std::enable_if<is_scoped_enum<E>::value, Res>::type;
+
+template <class E>
+enable_if_scoped_enum<E> operator|(E l, E r) {
+ return static_cast<E>(static_cast<underlying_enum_type<E>>(l)
+ | static_cast<underlying_enum_type<E>>(r));
+}
+
+template <class E>
+enable_if_scoped_enum<E> operator&(E l, E r) {
+ return static_cast<E>(static_cast<underlying_enum_type<E>>(l)
+ & static_cast<underlying_enum_type<E>>(r));
+}
+
+template <class E>
+enable_if_scoped_enum<E> operator~(E e) {
+ return static_cast<E>(~static_cast<underlying_enum_type<E>>(e));
+}
+
+template <class E>
+enable_if_scoped_enum<E> operator|=(E& l, E r) {
+ return l = (l | r);
+}
+
+template <class E>
+enable_if_scoped_enum<E> operator&=(E& l, E r) {
+ return l = (l & r);
+}
+
+template <class E>
+enable_if_scoped_enum<E, bool> operator!(E e) {
+ return !static_cast<underlying_enum_type<E>>(e);
+}
+
+template <class E>
+enable_if_scoped_enum<E, bool> operator!=(E e, int val) {
+ return static_cast<underlying_enum_type<E>>(e) !=
+ static_cast<underlying_enum_type<E>>(val);
+}
+
+template <class E>
+enable_if_scoped_enum<E, bool> operator!=(int val, E e) {
+ return e != val;
+}
+
+template <class E>
+enable_if_scoped_enum<E, bool> operator==(E e, int val) {
+ return static_cast<underlying_enum_type<E>>(e) ==
+ static_cast<underlying_enum_type<E>>(val);
+}
+
+template <class E>
+enable_if_scoped_enum<E, bool> operator==(int val, E e) {
+ return e == val;
+}
+
+template <class E>
+enable_if_scoped_enum<E, bool> nonzero(E e) {
+ return static_cast<underlying_enum_type<E>>(e) != 0;
+}
+
+} // namespace EnumFlags
+
+// For the ADL to kick in let's make sure we bring all the operators into our
+// main AndroidEmu namespaces...
+using namespace gfxstream::guest::EnumFlags;
+
+} // namespace base
+
+using namespace gfxstream::guest::EnumFlags;
+
+} // namespace android
+
+// ... and into the global one, where most of the client functions are
+using namespace gfxstream::guest::EnumFlags;
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Optional.h b/src/gfxstream/guest/android-emu/aemu/base/Optional.h
new file mode 100644
index 00000000000..cb63273168b
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Optional.h
@@ -0,0 +1,547 @@
+// Copyright 2015-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 "aemu/base/TypeTraits.h"
+
+#include <log/log.h>
+
+#include <cassert>
+#include <initializer_list>
+#include <type_traits>
+#include <utility>
+
+#include <cstddef>
+
+// Optional<T> - a template class to store an optional value of type T.
+//
+// Usage examples:
+//
+// Initialization and construction:
+// Optional<Foo> foo; // |foo| doesn't contain a value.
+// Optional<Foo> foo(Foo(10)); // |foo| contains a copy-constructed value.
+// Optional<Foo> foo2(foo); // |foo2| contains a copy of |foo|'s value.
+// Optional<Foo> foo3(std::move(foo2)); // Guess what?
+//
+// Assignment:
+// Foo foo_value(0);
+// Optional<Foo> foo; // |foo| is empty.
+// Optional<Foo> foo2; // |foo2| is empty.
+// foo2 = foo; // |foo2| is still empty.
+// foo = foo_value; // set value of |foo| to a copy of |foo_value|
+// foo = std::move(foo_value); // move |foo_value| into |foo|.
+// foo2 = foo; // now |foo2| has a copy of |foo|'s value.
+// foo = kNullopt; // unset |foo|, it has no value.
+//
+// Checking and accessing value:
+// if (foo) {
+// // |foo| has a value.
+// doStuff(*foo); // |*foo| is the value inside |foo|.
+// foo->callMethod(); // Same as (*foo).callMethod().
+// } else {
+// // |foo| is empty.
+// }
+//
+// foo.value() // Same as *foo
+// foo.valueOr(<default>) // Return <default> is |foo| has no value.
+//
+// In-place construction:
+//
+// Optional<Foo> foo; // |foo| is empty.
+// foo.emplace(20); // |foo| now contains a value constructed as Foo(20)
+//
+// Optional<Foo> foo(kInplace, 20); // |foo| is initialized with a value
+// // that is constructed in-place as
+// // Foo(20).
+//
+// return makeOptional<Foo>(20); // Takes Foo constructor arguments
+// // directly.
+//
+// Returning values:
+//
+// Optional<Foo> myFunc(...) {
+// if (someCondition) {
+// return Foo(10); // call Optional<Foo>(Foo&) constructor.
+// } else {
+// return {}; // call Optional<Foo>() constructor, which
+// // builds an empty value.
+// }
+// }
+//
+// Memory layout:
+// Optional<Foo> is equivalent to:
+//
+// struct {
+// bool flag;
+// Foo value;
+// };
+//
+// in terms of memory layout. This means it *doubles* the size of integral
+// types. Also:
+//
+// - Optional<Foo> can be constructed from anything that constructs a Foo.
+//
+// - Same with Optional<Foo>(kInplace, Args...) where Args... matches any
+// arguments that can be passed to a Foo constructor.
+//
+// - Comparison operators are provided. Beware: an empty Optional<Foo>
+// is always smaller than any Foo value.
+
+namespace gfxstream {
+namespace guest {
+
+namespace details {
+
+// Base classes to reduce the number of instantiations of the Optional's
+// internal members.
+class OptionalFlagBase {
+public:
+ void setConstructed(bool constructed) { mConstructed = constructed; }
+ constexpr bool constructed() const { return mConstructed; }
+ constexpr operator bool() const { return constructed(); }
+ bool hasValue() const { return constructed(); }
+
+ constexpr OptionalFlagBase(bool constructed = false)
+ : mConstructed(constructed) {}
+
+private:
+ bool mConstructed = false;
+};
+
+template <size_t Size, size_t Align>
+class OptionalStorageBase {
+protected:
+ using StoreT = typename std::aligned_storage<Size, Align>::type;
+ StoreT mStorage = {};
+};
+
+} // namespace details
+
+// A tag type for empty optional construction
+struct NulloptT {
+ constexpr explicit NulloptT(int) {}
+};
+
+// A tag type for inplace value construction
+struct InplaceT {
+ constexpr explicit InplaceT(int) {}
+};
+
+// Tag values for null optional and inplace construction
+constexpr NulloptT kNullopt{1};
+constexpr InplaceT kInplace{1};
+
+// Forward declaration for an early use
+template <class T>
+class Optional;
+
+// A type trait for checking if a type is an optional instantiation
+// Note: if you want to refer to the template name inside the template,
+// you need to declare this alias outside of it - because the
+// class name inside of the template stands for an instantiated template
+// E.g, for template <T> class Foo if you say 'Foo' inside the class, it
+// actually means Foo<T>;
+template <class U>
+using is_any_optional =
+ is_template_instantiation_of<typename std::decay<U>::type, Optional>;
+
+template <class T>
+class Optional
+ : private details::OptionalFlagBase,
+ private details::OptionalStorageBase<sizeof(T),
+ std::alignment_of<T>::value> {
+ // make sure all optionals are buddies - this is needed to implement
+ // conversion from optionals of other types
+ template <class U>
+ friend class Optional;
+
+ template <class U>
+ using self = Optional<U>;
+
+ using base_flag = details::OptionalFlagBase;
+ using base_storage =
+ details::OptionalStorageBase<sizeof(T),
+ std::alignment_of<T>::value>;
+
+public:
+ // std::optional will have this, so let's provide it
+ using value_type = T;
+
+ // make sure we forbid some Optional instantiations where things may get
+ // really messy
+ static_assert(!std::is_same<typename std::decay<T>::type, NulloptT>::value,
+ "Optional of NulloptT is not allowed");
+ static_assert(!std::is_same<typename std::decay<T>::type, InplaceT>::value,
+ "Optional of InplaceT is not allowed");
+ static_assert(!std::is_reference<T>::value,
+ "Optional references are not allowed: use a pointer instead");
+
+ // constructors
+ constexpr Optional() {}
+ constexpr Optional(NulloptT) {}
+
+ Optional(const Optional& other) : base_flag(other.constructed()) {
+ if (this->constructed()) {
+ new (&get()) T(other.get());
+ }
+ }
+ Optional(Optional&& other) : base_flag(other.constructed()) {
+ if (this->constructed()) {
+ new (&get()) T(std::move(other.get()));
+ }
+ }
+
+ // Conversion constructor from optional of similar type
+ template <class U,
+ class = enable_if_c<!is_any_optional<U>::value &&
+ std::is_constructible<T, U>::value>>
+ Optional(const Optional<U>& other) : base_flag(other.constructed()) {
+ if (this->constructed()) {
+ new (&get()) T(other.get());
+ }
+ }
+
+ // Move-conversion constructor
+ template <class U,
+ class = enable_if_c<!is_any_optional<U>::value &&
+ std::is_constructible<T, U>::value>>
+ Optional(Optional<U>&& other) : base_flag(other.constructed()) {
+ if (this->constructed()) {
+ new (&get()) T(std::move(other.get()));
+ }
+ }
+
+ // Construction from a raw value
+ Optional(const T& value) : base_flag(true) { new (&get()) T(value); }
+ // Move construction from a raw value
+ Optional(T&& value) : base_flag(true) { new (&get()) T(std::move(value)); }
+
+ // Inplace construction from a list of |T|'s ctor arguments
+ template <class... Args>
+ Optional(InplaceT, Args&&... args) : base_flag(true) {
+ new (&get()) T(std::forward<Args>(args)...);
+ }
+
+ // Inplace construction from an initializer list passed into |T|'s ctor
+ template <class U,
+ class = enable_if<
+ std::is_constructible<T, std::initializer_list<U>>>>
+ Optional(InplaceT, std::initializer_list<U> il) : base_flag(true) {
+ new (&get()) T(il);
+ }
+
+ // direct assignment
+ Optional& operator=(const Optional& other) {
+ if (&other == this) {
+ return *this;
+ }
+
+ if (this->constructed()) {
+ if (other.constructed()) {
+ get() = other.get();
+ } else {
+ destruct();
+ this->setConstructed(false);
+ }
+ } else {
+ if (other.constructed()) {
+ new (&get()) T(other.get());
+ this->setConstructed(true);
+ } else {
+ ; // we're good
+ }
+ }
+ return *this;
+ }
+
+ // move assignment
+ Optional& operator=(Optional&& other) {
+ if (this->constructed()) {
+ if (other.constructed()) {
+ get() = std::move(other.get());
+ } else {
+ destruct();
+ this->setConstructed(false);
+ }
+ } else {
+ if (other.constructed()) {
+ new (&get()) T(std::move(other.get()));
+ this->setConstructed(true);
+ } else {
+ ; // we're good
+ }
+ }
+ return *this;
+ }
+
+ // conversion assignment
+ template <class U,
+ class = enable_if_convertible<typename std::decay<U>::type, T>>
+ Optional& operator=(const Optional<U>& other) {
+ if (this->constructed()) {
+ if (other.constructed()) {
+ get() = other.get();
+ } else {
+ destruct();
+ this->setConstructed(false);
+ }
+ } else {
+ if (other.constructed()) {
+ new (&get()) T(other.get());
+ this->setConstructed(true);
+ } else {
+ ; // we're good
+ }
+ }
+ return *this;
+ }
+
+ // conversion move assignment
+ template <class U,
+ class = enable_if_convertible<typename std::decay<U>::type, T>>
+ Optional& operator=(Optional<U>&& other) {
+ if (this->constructed()) {
+ if (other.constructed()) {
+ get() = std::move(other.get());
+ } else {
+ destruct();
+ this->setConstructed(false);
+ }
+ } else {
+ if (other.constructed()) {
+ new (&get()) T(std::move(other.get()));
+ this->setConstructed(true);
+ } else {
+ ; // we're good
+ }
+ }
+ return *this;
+ }
+
+ // the most complicated one: forwarding constructor for anything convertible
+ // to |T|, excluding the stuff implemented above explicitly
+ template <class U,
+ class = enable_if_c<
+ !is_any_optional<typename std::decay<U>::type>::value &&
+ std::is_convertible<typename std::decay<U>::type,
+ T>::value>>
+ Optional& operator=(U&& other) {
+ if (this->constructed()) {
+ get() = std::forward<U>(other);
+ } else {
+ new (&get()) T(std::forward<U>(other));
+ this->setConstructed(true);
+ }
+ return *this;
+ }
+
+ // Adopt value checkers from the parent
+ using base_flag::operator bool;
+ using base_flag::hasValue;
+
+ T& value() {
+ if (!constructed()) {
+ ALOGE("Optional not constructed");
+ abort();
+ }
+ return get();
+ }
+ constexpr const T& value() const {
+ if (!constructed()) {
+ ALOGE("Optional not constructed");
+ abort();
+ }
+ return get();
+ }
+
+ T* ptr() {
+ return this->constructed() ? &get() : nullptr;
+ }
+ constexpr const T* ptr() const {
+ return this->constructed() ? &get() : nullptr;
+ }
+
+ // Value getter with fallback
+ template <class U = T,
+ class = enable_if_convertible<typename std::decay<U>::type, T>>
+ constexpr T valueOr(U&& defaultValue) const {
+ return this->constructed() ? get() : std::move(defaultValue);
+ }
+
+ // Pointer-like operators
+ T& operator*() {
+ if (!constructed()) {
+ ALOGE("Optional not constructed");
+ abort();
+ }
+ return get();
+ }
+ constexpr const T& operator*() const {
+ if (!constructed()) {
+ ALOGE("Optional not constructed");
+ abort();
+ }
+ return get();
+ }
+
+ T* operator->() {
+ if (!constructed()) {
+ ALOGE("Optional not constructed");
+ abort();
+ }
+ return &get();
+ }
+ constexpr const T* operator->() const {
+ if (!constructed()) {
+ ALOGE("Optional not constructed");
+ abort();
+ }
+ return &get();
+ }
+
+ ~Optional() {
+ if (this->constructed()) {
+ destruct();
+ }
+ }
+
+ void clear() {
+ if (this->constructed()) {
+ destruct();
+ this->setConstructed(false);
+ }
+ }
+
+ template <class U,
+ class = enable_if_convertible<typename std::decay<U>::type, T>>
+ void reset(U&& u) {
+ *this = std::forward<U>(u);
+ }
+
+ // In-place construction with possible destruction of the old value
+ template <class... Args>
+ void emplace(Args&&... args) {
+ if (this->constructed()) {
+ destruct();
+ }
+ new (&get()) T(std::forward<Args>(args)...);
+ this->setConstructed(true);
+ }
+
+ // In-place construction with possible destruction of the old value
+ // initializer-list version
+ template <class U,
+ class = enable_if<
+ std::is_constructible<T, std::initializer_list<U>>>>
+ void emplace(std::initializer_list<U> il) {
+ if (this->constructed()) {
+ destruct();
+ }
+ new (&get()) T(il);
+ this->setConstructed(true);
+ }
+
+private:
+ // A helper function to convert the internal raw storage to T&
+ constexpr const T& get() const {
+ return *reinterpret_cast<const T*>(
+ reinterpret_cast<const char*>(&this->mStorage));
+ }
+
+ // Same thing, mutable
+ T& get() {
+ return const_cast<T&>(const_cast<const Optional*>(this)->get());
+ }
+
+ // Shortcut for a destructor call for the stored object
+ void destruct() { get().T::~T(); }
+};
+
+template <class T>
+Optional<typename std::decay<T>::type> makeOptional(T&& t) {
+ return Optional<typename std::decay<T>::type>(std::forward<T>(t));
+}
+
+template <class T, class... Args>
+Optional<typename std::decay<T>::type> makeOptional(Args&&... args) {
+ return Optional<typename std::decay<T>::type>(kInplace,
+ std::forward<Args>(args)...);
+}
+
+template <class T>
+bool operator==(const Optional<T>& l, const Optional<T>& r) {
+ return l.hasValue() ? r.hasValue() && *l == *r : !r.hasValue();
+}
+template <class T>
+bool operator==(const Optional<T>& l, NulloptT) {
+ return !l;
+}
+template <class T>
+bool operator==(NulloptT, const Optional<T>& r) {
+ return !r;
+}
+template <class T>
+bool operator==(const Optional<T>& l, const T& r) {
+ return bool(l) && *l == r;
+}
+template <class T>
+bool operator==(const T& l, const Optional<T>& r) {
+ return bool(r) && l == *r;
+}
+
+template <class T>
+bool operator!=(const Optional<T>& l, const Optional<T>& r) {
+ return !(l == r);
+}
+template <class T>
+bool operator!=(const Optional<T>& l, NulloptT) {
+ return bool(l);
+}
+template <class T>
+bool operator!=(NulloptT, const Optional<T>& r) {
+ return bool(r);
+}
+template <class T>
+bool operator!=(const Optional<T>& l, const T& r) {
+ return !l || !(*l == r);
+}
+template <class T>
+bool operator!=(const T& l, const Optional<T>& r) {
+ return !r || !(l == *r);
+}
+
+template <class T>
+bool operator<(const Optional<T>& l, const Optional<T>& r) {
+ return !r ? false : (!l ? true : *l < *r);
+}
+template <class T>
+bool operator<(const Optional<T>&, NulloptT) {
+ return false;
+}
+template <class T>
+bool operator<(NulloptT, const Optional<T>& r) {
+ return bool(r);
+}
+template <class T>
+bool operator<(const Optional<T>& l, const T& r) {
+ return !l || *l < r;
+}
+template <class T>
+bool operator<(const T& l, const Optional<T>& r) {
+ return bool(r) && l < *r;
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Path.cpp b/src/gfxstream/guest/android-emu/aemu/base/Path.cpp
new file mode 100644
index 00000000000..45b1c310c0c
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Path.cpp
@@ -0,0 +1,29 @@
+#include "Path.h"
+
+#include <string.h>
+#include <unistd.h>
+
+namespace gfxstream {
+namespace guest {
+
+std::string getProgramDirectory() {
+ std::string res;
+#if defined(__linux__)
+ char path[1024];
+ memset(path, 0, sizeof(path)); // happy valgrind!
+ int len = readlink("/proc/self/exe", path, sizeof(path));
+ if (len > 0 && len < (int)sizeof(path)) {
+ char* x = ::strrchr(path, '/');
+ if (x) {
+ *x = '\0';
+ res.assign(path);
+ }
+ }
+#else
+#error "Unsupported platform!"
+#endif
+ return res;
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Path.h b/src/gfxstream/guest/android-emu/aemu/base/Path.h
new file mode 100644
index 00000000000..643a888d14c
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Path.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 <string>
+
+namespace gfxstream {
+namespace guest {
+
+std::string getProgramDirectory();
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Pool.cpp b/src/gfxstream/guest/android-emu/aemu/base/Pool.cpp
new file mode 100644
index 00000000000..38b7b02cec7
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Pool.cpp
@@ -0,0 +1,440 @@
+// 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 "aemu/base/Pool.h"
+
+#include "aemu/base/AlignedBuf.h"
+
+#include <vector>
+
+#define DEBUG_POOL 0
+
+#if DEBUG_POOL
+
+#define D(fmt,...) fprintf(stderr, "%s: " fmt "\n", __func__, ##__VA_ARGS__);
+
+#else
+
+#define D(fmt,...)
+
+#endif
+
+namespace gfxstream {
+namespace guest {
+
+// A Pool consists of:
+// - Heaps one for each allocation size
+// A Heap consists of:
+// - Block(s) for servicing allocation requests with actual memory backing
+// A Block consists of:
+// - A buffer that is the memory backing
+// - Chunks that correspond to usable units of the allocation size
+//
+// Block implementation:
+//
+// We want to make it fast to alloc new chunks and to free existing chunks from
+// this block, while not having to invalidate all existing pointers when
+// allocating new objects.
+// I'm p sure by now there's no way to do that withtout
+// - significant pre allocation
+// - linked list of blocks
+//
+// So that means some block chain (hehehehe, pun v much intended)
+// implementation Wherein, each block has fast allocation of chunks
+// correponding tot he desired allocation size.
+//
+// Any low overhead scheme of that kind, like slab alloc or buddy alloc, is
+// fine. This one is based on:
+//
+// Ben Kenwright (b.kenwright@ncl.ac.uk): "Fast Efficient Fixed-Size Memory
+// Pool: No Loops and No Overhead" In COMPUTATION TOOLS 2012: The Third
+// International Conference on Computational Logics, Algebras, Programming,
+// Tools, and Benchmarking
+
+// Interval:
+// Make it easy to track all ranges involved so we know which free()
+// in which heap to use.
+// Assuming this doesn't grow too much past around 100 intervals
+// so we dont need to use fancy algorithms to key on it.
+struct Interval {
+ uintptr_t start;
+ uintptr_t end;
+};
+
+static size_t ilog2Floor(size_t n) {
+ size_t res = 0;
+ size_t test = 1;
+
+ while (test < n) {
+ test <<= 1;
+ ++res;
+ }
+
+ return res;
+}
+
+struct Block {
+ Block(size_t _chunkSize, size_t _numChunks) {
+ if (_chunkSize < sizeof(void*)) {
+ fprintf(
+ stderr,
+ "FATAL: Cannot allocate block with chunk size "
+ "less then %zu (wanted: %zu)!\n",
+ sizeof(void*),
+ _chunkSize);
+ abort();
+ }
+
+ chunkSize = _chunkSize;
+ chunkSizeLog2 = ilog2Floor(chunkSize);
+ numChunks = _numChunks;
+
+ D("chunk size %zu log2 %zu numChunks %zu",
+ chunkSize,
+ chunkSizeLog2,
+ numChunks);
+
+ sizeBytes = chunkSize * numChunks;
+
+ storage.resize(sizeBytes);
+ data = storage.data();
+
+ numFree = numChunks;
+ numAlloced = 0;
+ nextFree = (size_t*)data;
+ }
+
+ Interval getInterval() const {
+ uintptr_t start = (uintptr_t)data;
+ uintptr_t end = (uintptr_t)(data + sizeBytes);
+ return { start, end };
+ }
+
+ bool isFull() const { return numFree == 0; }
+
+ uint8_t* getPtr(size_t element) {
+ uint8_t* res =
+ data + (uintptr_t)chunkSize *
+ (uintptr_t)element;
+ D("got %p element %zu chunkSize %zu",
+ res, element, chunkSize);
+ return res;
+ }
+
+ size_t getElement(void* ptr) {
+ uintptr_t ptrVal = (uintptr_t)ptr;
+ ptrVal -= (uintptr_t)data;
+ return (size_t)(ptrVal >> chunkSizeLog2);
+ }
+
+ void* alloc() {
+ // Lazily constructs the index to the
+ // next unallocated chunk.
+ if (numAlloced < numChunks) {
+ size_t* nextUnallocPtr =
+ (size_t*)getPtr(numAlloced);
+
+ ++numAlloced;
+ *nextUnallocPtr = numAlloced;
+ }
+
+ // Returns the next free object,
+ // if there is space remaining.
+ void* res = nullptr;
+ if (numFree) {
+
+ D("alloc new ptr @ %p\n", nextFree);
+
+ res = (void*)nextFree;
+ --numFree;
+ if (numFree) {
+ // Update nextFree to _point_ at the index
+ // of the next free chunk.
+ D("store %zu in %p as next free chunk",
+ *nextFree,
+ getPtr(*nextFree));
+ nextFree = (size_t*)getPtr(*nextFree);
+ } else {
+ // Signal that there are no more
+ // chunks available.
+ nextFree = nullptr;
+ }
+ }
+
+ return res;
+ }
+
+ void free(void* toFree) {
+ size_t* toFreeIndexPtr = (size_t*)toFree;
+ if (nextFree) {
+ D("freeing %p: still have other chunks available.", toFree);
+ D("nextFree: %p (end: %p)", nextFree, getPtr(numChunks));
+ D("nextFreeElt: %zu\n", getElement(nextFree));
+ // If there is a chunk available,
+ // point the just-freed chunk to that.
+ *toFreeIndexPtr = getElement(nextFree);
+ } else {
+ D("freeing free %p: no other chunks available.", toFree);
+ // If there are no chunks available,
+ // point the just-freed chunk to past the end.
+ *(size_t*)toFree = numChunks;
+ }
+ nextFree = (size_t*)toFree;
+ D("set next free to %p", nextFree);
+ ++numFree;
+ }
+
+ // To free everything, just reset back to the initial state :p
+ void freeAll() {
+ numFree = numChunks;
+ numAlloced = 0;
+ nextFree = (size_t*)data;
+ }
+
+ Block* next = nullptr; // Unused for now
+
+ size_t chunkSize = 0;
+ size_t chunkSizeLog2 = 0;
+ size_t numChunks = 0;
+ size_t sizeBytes = 0;
+
+ AlignedBuf<uint8_t, 64> storage { 0 };
+ uint8_t* data = nullptr;
+
+ size_t numFree = 0;
+ size_t numAlloced = 0;
+
+ size_t* nextFree = 0;
+};
+
+// Straight passthrough to Block for now unless
+// we find it necessary to track more than |kMaxAllocs|
+// allocs per heap.
+class Heap {
+public:
+ Heap(size_t allocSize, size_t chunksPerSize) :
+ mBlock(allocSize, chunksPerSize) {
+ }
+
+ Interval getInterval() const {
+ return mBlock.getInterval();
+ }
+
+ bool isFull() const {
+ return mBlock.isFull();
+ }
+
+ void* alloc() {
+ return mBlock.alloc();
+ }
+
+ void free(void* ptr) {
+ mBlock.free(ptr);
+ }
+
+ void freeAll() {
+ mBlock.freeAll();
+ }
+
+private:
+ // Just one block for now
+ Block mBlock;
+};
+
+static size_t leastPowerof2(size_t n) {
+ size_t res = 1;
+ while (res < n) {
+ res <<= 1;
+ }
+ return res;
+}
+
+class Pool::Impl {
+public:
+ Impl(size_t minSize,
+ size_t maxSize,
+ size_t chunksPerSize) :
+ // Need to bump up min alloc size
+ // because Blocks use free space for bookkeeping
+ // purposes.
+ mMinAllocSize(std::max(sizeof(void*), minSize)),
+ // Compute mMinAllocLog2.
+ // mMinAllocLog2 stores
+ // the number of bits to shift
+ // in order to obtain the heap index
+ // corresponding to a desired allocation size.
+ mMinAllocLog2(ilog2Floor(mMinAllocSize)),
+ mMaxFastSize(maxSize),
+ mChunksPerSize(chunksPerSize) {
+
+ size_t numHeaps =
+ 1 + ilog2Floor(mMaxFastSize >> mMinAllocLog2);
+
+ for (size_t i = 0; i < numHeaps; i++) {
+
+ size_t allocSize = mMinAllocSize << i;
+
+ D("create heap for size %zu", allocSize);
+
+ Heap* newHeap = new Heap(allocSize, mChunksPerSize);
+
+ HeapInfo info = {
+ newHeap,
+ allocSize,
+ newHeap->getInterval(),
+ };
+
+ mHeapInfos.push_back(info);
+ }
+ }
+
+ ~Impl() {
+ for (auto& info : mHeapInfos) {
+ delete info.heap;
+ }
+ }
+
+ void* alloc(size_t wantedSize) {
+ if (wantedSize > mMaxFastSize) {
+ D("requested size %zu too large", wantedSize);
+ return nullptr;
+ }
+
+ size_t minAllocSizeNeeded =
+ std::max(mMinAllocSize, leastPowerof2(wantedSize));
+
+ size_t index =
+ ilog2Floor(minAllocSizeNeeded >> mMinAllocLog2);
+
+ D("wanted: %zu min serviceable: %zu heap index: %zu",
+ wantedSize, minAllocSizeNeeded, index);
+
+ auto heap = mHeapInfos[index].heap;
+
+ if (heap->isFull()) {
+ D("heap %zu is full", index);
+ return nullptr;
+ }
+
+ return heap->alloc();
+ }
+
+ bool free(void* ptr) {
+
+ D("for %p:", ptr);
+
+ uintptr_t ptrVal = (uintptr_t)ptr;
+
+ // Scan through linearly to find any matching
+ // interval. Interval information has been
+ // brought up to be stored directly in HeapInfo
+ // so this should be quite easy on the cache
+ // at least until a match is found.
+ for (auto& info : mHeapInfos) {
+ uintptr_t start = info.interval.start;
+ uintptr_t end = info.interval.end;
+
+ if (ptrVal >= start && ptrVal < end) {
+ D("found heap to free %p.", ptr)
+ info.heap->free(ptr);
+ return true;
+ }
+ }
+
+ D("%p not found in any heap.", ptr);
+ return false;
+ }
+
+ void freeAll() {
+ for (auto& info : mHeapInfos) {
+ info.heap->freeAll();
+ }
+ }
+
+private:
+ size_t mMinAllocSize;
+ size_t mMinAllocLog2;
+ size_t mMaxFastSize;
+ size_t mChunksPerSize;
+
+ // No need to get really complex if there are
+ // not that many heaps.
+ struct HeapInfo {
+ Heap* heap;
+ size_t allocSize;
+ Interval interval;
+ };
+
+ std::vector<HeapInfo> mHeapInfos;
+};
+
+Pool::Pool(size_t minSize,
+ size_t maxSize,
+ size_t mChunksPerSize) :
+ mImpl(new Pool::Impl(minSize,
+ maxSize,
+ mChunksPerSize)) {
+}
+
+Pool::~Pool() {
+ delete mImpl;
+
+ for (auto ptr : mFallbackPtrs) {
+ D("delete fallback ptr %p\n", ptr);
+ ::free(ptr);
+ }
+}
+
+// Fall back to normal alloc if it cannot be
+// serviced by the implementation.
+void* Pool::alloc(size_t wantedSize) {
+ void* ptr = mImpl->alloc(wantedSize);
+
+ if (ptr) return ptr;
+
+ D("Fallback to malloc");
+
+ ptr = ::malloc(wantedSize);
+
+ if (!ptr) {
+ D("Failed to service allocation for %zu bytes", wantedSize);
+ abort();
+ }
+
+ mFallbackPtrs.insert(ptr);
+
+ D("Fallback to malloc: got ptr %p", ptr);
+
+ return ptr;
+}
+
+// Fall back to normal free if it cannot be
+// serviced by the implementation.
+void Pool::free(void* ptr) {
+ if (mImpl->free(ptr)) return;
+
+ D("fallback to free for %p", ptr);
+ mFallbackPtrs.erase(ptr);
+ ::free(ptr);
+}
+
+void Pool::freeAll() {
+ mImpl->freeAll();
+ for (auto ptr : mFallbackPtrs) {
+ ::free(ptr);
+ }
+ mFallbackPtrs.clear();
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Pool.h b/src/gfxstream/guest/android-emu/aemu/base/Pool.h
new file mode 100644
index 00000000000..8c88935426d
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Pool.h
@@ -0,0 +1,64 @@
+// 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.
+#pragma once
+
+#include "aemu/base/Allocator.h"
+
+#include <unordered_set>
+
+#include <inttypes.h>
+#include <stddef.h>
+#include <string.h>
+
+namespace gfxstream {
+namespace guest {
+
+// Class to make it easier to set up memory regions where it is fast
+// to allocate/deallocate buffers that have size within
+// the specified range.
+class Pool : public Allocator {
+public:
+ // minSize/maxSize: the target range of sizes for which we want to
+ // make allocations fast. the greater the range, the more space
+ // traded off.
+ // chunksPerSize: the target maximum number of live objects of
+ // each size that are expected. the higher it is, the more space
+ // traded off.
+ //
+ // Rough space cost formula:
+ // O(chunksPerSize * log2(maxSize / minSize) * maxSize)
+ Pool(size_t minSize = 4,
+ size_t maxSize = 4096,
+ size_t chunksPerSize = 1024);
+
+ // All memory allocated by this pool
+ // is automatically deleted when the pool
+ // is deconstructed.
+ ~Pool();
+
+ void* alloc(size_t wantedSize) override;
+ void free(void* ptr);
+
+ // Convenience function to free everything currently allocated.
+ void freeAll();
+
+private:
+ class Impl;
+ Impl* mImpl = nullptr;
+
+ std::unordered_set<void*> mFallbackPtrs;
+};
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Process.cpp b/src/gfxstream/guest/android-emu/aemu/base/Process.cpp
new file mode 100644
index 00000000000..f2ef5b45153
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Process.cpp
@@ -0,0 +1,44 @@
+
+// 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.
+
+#include "aemu/base/Process.h"
+
+#if defined(__linux__)
+#include <fstream>
+#endif
+#include <string>
+
+namespace gfxstream {
+namespace guest {
+
+std::string getProcessName() {
+ // Support for "getprogname" function in bionic was introduced in L (API level 21)
+ std::string processName;
+#if defined(__ANDROID__) && __ANDROID_API__ >= 21
+ processName = std::string(getprogname());
+#elif defined(__linux__)
+ {
+ std::ifstream stream("/proc/self/cmdline");
+ if (stream.is_open()) {
+ processName = std::string(std::istreambuf_iterator<char>(stream),
+ std::istreambuf_iterator<char>());
+ }
+ }
+#endif
+ return processName;
+}
+
+} // namespace guest
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Process.h b/src/gfxstream/guest/android-emu/aemu/base/Process.h
new file mode 100644
index 00000000000..451b6aee664
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Process.h
@@ -0,0 +1,26 @@
+
+// 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.
+
+#pragma once
+
+#include <string>
+
+namespace gfxstream {
+namespace guest {
+
+std::string getProcessName();
+
+} // namespace guest
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/guest/android-emu/aemu/base/StringFormat.cpp b/src/gfxstream/guest/android-emu/aemu/base/StringFormat.cpp
new file mode 100644
index 00000000000..60a6a4b60ef
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/StringFormat.cpp
@@ -0,0 +1,84 @@
+// Copyright 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "aemu/base/StringFormat.h"
+
+#include <stdio.h>
+
+namespace gfxstream {
+namespace guest {
+
+std::string StringFormatRaw(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ auto result = StringFormatWithArgs(format, args);
+ va_end(args);
+ return result;
+}
+
+std::string StringFormatWithArgs(const char* format, va_list args) {
+ std::string result;
+ StringAppendFormatWithArgs(&result, format, args);
+ return result;
+}
+
+void StringAppendFormatRaw(std::string* string, const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ StringAppendFormatWithArgs(string, format, args);
+ va_end(args);
+}
+
+void StringAppendFormatWithArgs(std::string* string,
+ const char* format,
+ va_list args) {
+ size_t cur_size = string->size();
+ size_t extra = 0;
+ for (;;) {
+ va_list args2;
+ va_copy(args2, args);
+ int ret = vsnprintf(&(*string)[cur_size], extra, format, args2);
+ va_end(args2);
+
+ if (ret == 0) {
+ // Nothing to do here.
+ break;
+ }
+
+ if (ret > 0) {
+ size_t ret_sz = static_cast<size_t>(ret);
+ if (extra == 0) {
+ // First pass, resize the string and try again.
+ extra = ret_sz + 1;
+ string->resize(cur_size + extra);
+ continue;
+ }
+ if (ret_sz < extra) {
+ // Second pass or later, success!
+ string->resize(cur_size + ret_sz);
+ return;
+ }
+ }
+
+ // NOTE: The MSVCRT.DLL implementation of snprintf() is broken and
+ // will return -1 in case of truncation. This code path is taken
+ // when this happens, or when |ret_sz| is equal or larger than
+ // |extra|. Grow the buffer to allow for more room, then try again.
+ extra += (extra >> 1) + 32;
+ string->resize(cur_size + extra);
+ }
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/StringFormat.h b/src/gfxstream/guest/android-emu/aemu/base/StringFormat.h
new file mode 100644
index 00000000000..b8a7f5e565a
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/StringFormat.h
@@ -0,0 +1,81 @@
+// Copyright 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <string>
+#include <type_traits>
+#include <utility>
+
+#include <stdarg.h>
+
+namespace gfxstream {
+namespace guest {
+
+// Create a new string instance that contains the printf-style formatted
+// output from |format| and potentially any following arguments.
+std::string StringFormatRaw(const char* format, ...);
+
+// A variant of StringFormat() which uses a va_list to list formatting
+// parameters instead.
+std::string StringFormatWithArgs(const char* format, va_list args);
+
+// Appends a formatted string at the end of an existing string.
+// |string| is the target string instance, |format| the format string,
+// followed by any formatting parameters. This is more efficient than
+// appending the result of StringFormat(format,...) to |*string| directly.
+void StringAppendFormatRaw(std::string* string, const char* format, ...);
+
+// A variant of StringAppendFormat() that takes a va_list to list
+// formatting parameters.
+void StringAppendFormatWithArgs(std::string* string,
+ const char* format,
+ va_list args);
+
+// unpackFormatArg() is a set of overloaded functions needed to unpack
+// an argument of the formatting list to a POD value which can be passed
+// into the sprintf()-like C function
+
+// Anything which can be used to construct a string goes here and unpacks into
+// a const char*
+inline const char* unpackFormatArg(const std::string& str) {
+ return str.c_str();
+}
+
+// Forward all PODs as-is
+template <class T>
+constexpr T&& unpackFormatArg(T&& t,
+ typename std::enable_if<
+ std::is_pod<typename std::decay<T>::type>::value
+ >::type* = nullptr) {
+ return std::forward<T>(t);
+}
+
+// These templated versions of StringFormat*() allow one to pass all kinds of
+// string objects into the argument list
+template <class... Args>
+std::string StringFormat(const char* format, Args&&... args) {
+ return StringFormatRaw(format, unpackFormatArg(std::forward<Args>(args))...);
+}
+
+template <class... Args>
+void StringAppendFormat(std::string* string,
+ const char* format,
+ Args&&... args) {
+ StringAppendFormatRaw(string, format,
+ unpackFormatArg(std::forward<Args>(args))...);
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Tracing.cpp b/src/gfxstream/guest/android-emu/aemu/base/Tracing.cpp
new file mode 100644
index 00000000000..c6517599dd9
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Tracing.cpp
@@ -0,0 +1,66 @@
+// 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 "aemu/base/Tracing.h"
+
+#if defined(__ANDROID__)
+
+#include <cutils/trace.h>
+#define TRACE_TAG ATRACE_TAG_GRAPHICS
+
+#elif defined(__Fuchsia__) && !defined(FUCHSIA_NO_TRACE)
+
+#include <lib/trace/event.h>
+#define TRACE_TAG "gfx"
+
+#else
+#endif
+
+namespace gfxstream {
+namespace guest {
+
+bool isTracingEnabled() {
+#if defined(__ANDROID__)
+ return atrace_is_tag_enabled(TRACE_TAG);
+#else
+ // TODO: Fuchsia + Linux
+ return false;
+#endif
+}
+
+void ScopedTraceGuest::beginTraceImpl(const char* name) {
+#if defined(__ANDROID__)
+ atrace_begin(TRACE_TAG, name);
+#elif defined(__Fuchsia__) && !defined(FUCHSIA_NO_TRACE)
+ TRACE_DURATION_BEGIN(TRACE_TAG, name);
+#else
+ // No-op
+ (void)name;
+#endif
+}
+
+void ScopedTraceGuest::endTraceImpl(const char* name) {
+#if defined(__ANDROID__)
+ (void)name;
+ atrace_end(TRACE_TAG);
+#elif defined(__Fuchsia__) && !defined(FUCHSIA_NO_TRACE)
+ TRACE_DURATION_END(TRACE_TAG, name);
+#else
+ // No-op
+ (void)name;
+#endif
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/Tracing.h b/src/gfxstream/guest/android-emu/aemu/base/Tracing.h
new file mode 100644
index 00000000000..125a6221870
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/Tracing.h
@@ -0,0 +1,48 @@
+// 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
+
+// Library to perform tracing. Talks to platform-specific
+// tracing libraries.
+
+namespace gfxstream {
+namespace guest {
+
+bool isTracingEnabled();
+
+class ScopedTraceGuest {
+public:
+ ScopedTraceGuest(const char* name) : name_(name) {
+ beginTraceImpl(name_);
+ }
+
+ ~ScopedTraceGuest() {
+ endTraceImpl(name_);
+ }
+private:
+ void beginTraceImpl(const char* name);
+ void endTraceImpl(const char* name);
+
+ const char* const name_;
+};
+
+} // namespace base
+} // namespace android
+
+#define __AEMU_GENSYM2(x,y) x##y
+#define __AEMU_GENSYM1(x,y) __AEMU_GENSYM2(x,y)
+#define AEMU_GENSYM(x) __AEMU_GENSYM1(x,__COUNTER__)
+
+#define AEMU_SCOPED_TRACE(tag) __attribute__ ((unused)) gfxstream::guest::ScopedTraceGuest AEMU_GENSYM(aemuScopedTrace_)(tag)
diff --git a/src/gfxstream/guest/android-emu/aemu/base/TypeTraits.h b/src/gfxstream/guest/android-emu/aemu/base/TypeTraits.h
new file mode 100644
index 00000000000..fecaac06954
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/TypeTraits.h
@@ -0,0 +1,173 @@
+// 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.
+
+#pragma once
+
+#include <iterator>
+#include <type_traits>
+
+namespace gfxstream {
+namespace guest {
+
+namespace details {
+
+// a simple helper class for SFINAE below.
+template <class X = void>
+struct dummy {
+ using type = X;
+};
+
+} // namespaces details
+
+// add some convenience shortcuts for an overly complex std::enable_if syntax
+
+// Use 'enable_if<Predicate,Type>' instead of
+// 'typename std::enable_if<Predicate::value,Type>::type'
+template <class Predicate, class Type = void*>
+using enable_if = typename std::enable_if<Predicate::value, Type>::type;
+
+// Use 'enable_if_c<BooleanFlag,Type>' instead of
+// 'typename std::enable_if<BooleanFlag,Type>::type'
+template <bool predicate, class Type = void*>
+using enable_if_c = typename std::enable_if<predicate, Type>::type;
+
+// Use 'enable_if_convertible<From,To,Type>' instead of
+// 'typename std::enable_if<std::is_convertible<From,To>::value, Type>::type'
+template <class From, class To, class Type = void*>
+using enable_if_convertible = enable_if<std::is_convertible<From, To>>;
+
+// -----------------------------------------------------------------------------
+// A predicate for checking if some object is callable with a specific
+// signature. Examples:
+//
+// is_callable_as<int, void()>::value == false.
+// is_callable_as<strcmp, void()>::value == false.
+// is_callable_as<strcmp, int(const char*, const char*)>::value == true
+//
+template <class F, class Signature, class X = void>
+struct is_callable_as : std::false_type {};
+
+// This specialization is SFINAE-d out if template arguments can't be combined
+// into a call expression F(), or if the result of that call is not |R|
+template <class F, class R, class... Args>
+struct is_callable_as<
+ F,
+ R(Args...),
+ typename std::enable_if<
+ std::is_same<typename details::dummy<decltype(std::declval<F>()(
+ std::declval<Args>()...))>::type,
+ R>::value>::type> : std::true_type {};
+
+//
+// A similar predicate to only check arguments of the function call and ignore
+// the specified return type
+//
+// is_callable_as<strcmp, int(const char*, const char*)>::value == true
+// is_callable_as<strcmp, void(const char*, const char*)>::value == false
+// is_callable_with_args<strcmp, void(const char*, const char*)>::value == true
+//
+template <class F, class Signature, class X = void>
+struct is_callable_with_args : std::false_type {};
+
+template <class F, class R, class... Args>
+struct is_callable_with_args<
+ F,
+ R(Args...),
+ typename std::enable_if<
+ !std::is_same<typename details::dummy<decltype(std::declval<F>()(
+ std::declval<Args>()...))>::type,
+ F>::value>::type> : std::true_type {};
+
+// -----------------------------------------------------------------------------
+// Check if a type |T| is any instantiation of a template |U|. Examples:
+//
+// is_template_instantiation_of<int, std::vector>::value == false
+// is_template_instantiation_of<
+// std::list<std::vector<int>>, std::vector>::value == false
+// is_template_instantiation_of<std::vector<int>, std::vector>::value == true
+// is_template_instantiation_of<
+// std::vector<std::vector<int>>, std::vector>::value == true
+//
+template <class T, template <class...> class U>
+struct is_template_instantiation_of : std::false_type {};
+
+template <template <class...> class U, class... Args>
+struct is_template_instantiation_of<U<Args...>, U> : std::true_type {};
+// -----------------------------------------------------------------------------
+
+//
+// is_range<T> - check if type |T| is a range-like type.
+//
+// It makes sure that expressions std::begin(t) and std::end(t) are well-formed
+// and those return the same type.
+//
+// Note: with expression SFINAE from C++14 is_range_helper<> could be renamed to
+// is_range<> with no extra code. C++11 needs an extra level of enable_if<>
+// to make it work when the type isn't a range.
+//
+
+namespace details {
+
+template <class T>
+using is_range_helper = std::is_same<
+ decltype(std::begin(
+ std::declval<typename std::add_lvalue_reference<T>::type>())),
+ decltype(std::end(
+ std::declval<typename std::add_lvalue_reference<T>::type>()))>;
+
+} // namespace details
+
+template <class T, class = void>
+struct is_range : std::false_type {};
+
+template <class T>
+struct is_range<
+ T,
+ typename std::enable_if<details::is_range_helper<T>::value>::type>
+ : std::true_type {};
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// A class to incapsulate integer sequence 0, 1, ..., <num_args>
+// Seq<int...>
+// Useful to pass function parameters in an array/tuple to call it later.
+//
+
+template <int...>
+struct Seq {};
+
+// A 'maker' class to construct Seq<int...> given only <num_args>
+// value.
+// MakeSeq<N, S...> works this way, e.g.
+//
+// MakeSeq<2> inherits MakeSeq<2 - 1, 2 - 1> == MakeSeq<1, 1>
+// MakeSeq<1, 1> : MakeSeq<1 - 1, 1 - 1, 1> == MakeSeq<0, 0, 1>
+// MakeSeq<0, 0, 1> == MakeSeq<0, S...> and defines |type| = Seq<0, 1>
+
+template <int N, int... S>
+struct MakeSeq : MakeSeq<N - 1, N - 1, S...> {};
+
+template <int... S>
+struct MakeSeq<0, S...> {
+ using type = Seq<S...>;
+};
+
+//
+// MakeSeqT alias to quickly create Seq<...>:
+// MakeSeqT<3> == Seq<0, 1, 2>
+template <int... S>
+using MakeSeqT = typename MakeSeq<S...>::type;
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/address_space.h b/src/gfxstream/guest/android-emu/aemu/base/address_space.h
new file mode 100644
index 00000000000..2a631618604
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/address_space.h
@@ -0,0 +1,394 @@
+// 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.
+#pragma once
+
+#include "android/utils/compiler.h"
+#include <assert.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+ANDROID_BEGIN_HEADER
+
+#ifdef ADDRESS_SPACE_NAMESPACE
+namespace ADDRESS_SPACE_NAMESPACE {
+#endif
+
+// This is ported from goldfish_address_space, allowing it to be used for
+// general sub-allocations of any buffer range.
+// It is also a pure header library, so there are no compiler tricks needed
+// to use this in a particular implementation. please don't include this
+// in a file that is included everywhere else, though.
+
+/* Represents a continuous range of addresses and a flag if this block is
+ * available
+ */
+struct address_block {
+ uint64_t offset;
+ union {
+ uint64_t size_available; /* VMSTATE_x does not support bit fields */
+ struct {
+ uint64_t size : 63;
+ uint64_t available : 1;
+ };
+ };
+};
+
+/* A dynamic array of address blocks, with the following invariant:
+ * blocks[i].size > 0
+ * blocks[i+1].offset = blocks[i].offset + blocks[i].size
+ */
+struct address_space_allocator {
+ struct address_block *blocks;
+ int size;
+ int capacity;
+ uint64_t total_bytes;
+};
+
+#define ANDROID_EMU_ADDRESS_SPACE_BAD_OFFSET (~(uint64_t)0)
+
+/* The assert function to abort if something goes wrong. */
+static void address_space_assert(bool condition) {
+#ifdef ANDROID_EMU_ADDRESS_SPACE_ASSERT_FUNC
+ ANDROID_EMU_ADDRESS_SPACE_ASSERT_FUNC(condition);
+#else
+ (void)condition;
+ assert(condition);
+#endif
+}
+
+static void* address_space_malloc0(size_t size) {
+#ifdef ANDROID_EMU_ADDRESS_SPACE_MALLOC0_FUNC
+ return ANDROID_EMU_ADDRESS_SPACE_MALLOC0_FUNC(size);
+#else
+ void* res = malloc(size);
+ memset(res, 0, size);
+ return res;
+#endif
+}
+
+static void* address_space_realloc(void* ptr, size_t size) {
+#ifdef ANDROID_EMU_ADDRESS_SPACE_REALLOC_FUNC
+ return ANDROID_EMU_ADDRESS_SPACE_REALLOC_FUNC(ptr, size);
+#else
+ void* res = realloc(ptr, size);
+ return res;
+#endif
+}
+
+static void address_space_free(void* ptr) {
+#ifdef ANDROID_EMU_ADDRESS_SPACE_FREE_FUNC
+ return ANDROID_EMU_ADDRESS_SPACE_FREE_FUNC(ptr);
+#else
+ free(ptr);
+#endif
+}
+
+/* Looks for the smallest (to reduce fragmentation) available block with size to
+ * fit the requested amount and returns its index or -1 if none is available.
+ */
+static int address_space_allocator_find_available_block(
+ struct address_block *block,
+ int n_blocks,
+ uint64_t size_at_least)
+{
+ int index = -1;
+ uint64_t size_at_index = 0;
+ int i;
+
+ address_space_assert(n_blocks >= 1);
+
+ for (i = 0; i < n_blocks; ++i, ++block) {
+ uint64_t this_size = block->size;
+ address_space_assert(this_size > 0);
+
+ if (this_size >= size_at_least && block->available &&
+ (index < 0 || this_size < size_at_index)) {
+ index = i;
+ size_at_index = this_size;
+ }
+ }
+
+ return index;
+}
+
+static int
+address_space_allocator_grow_capacity(int old_capacity) {
+ address_space_assert(old_capacity >= 1);
+
+ return old_capacity + old_capacity;
+}
+
+/* Inserts one more address block right after i'th (by borrowing i'th size) and
+ * adjusts sizes:
+ * pre:
+ * size > blocks[i].size
+ *
+ * post:
+ * * might reallocate allocator->blocks if there is no capacity to insert one
+ * * blocks[i].size -= size;
+ * * blocks[i+1].size = size;
+ */
+static struct address_block*
+address_space_allocator_split_block(
+ struct address_space_allocator *allocator,
+ int i,
+ uint64_t size)
+{
+ address_space_assert(allocator->capacity >= 1);
+ address_space_assert(allocator->size >= 1);
+ address_space_assert(allocator->size <= allocator->capacity);
+ address_space_assert(i >= 0);
+ address_space_assert(i < allocator->size);
+ address_space_assert(size < allocator->blocks[i].size);
+
+ if (allocator->size == allocator->capacity) {
+ int new_capacity = address_space_allocator_grow_capacity(allocator->capacity);
+ allocator->blocks =
+ (struct address_block*)
+ address_space_realloc(
+ allocator->blocks,
+ sizeof(struct address_block) * new_capacity);
+ address_space_assert(allocator->blocks);
+ allocator->capacity = new_capacity;
+ }
+
+ struct address_block *blocks = allocator->blocks;
+
+ /* size = 5, i = 1
+ * [ 0 | 1 | 2 | 3 | 4 ] => [ 0 | 1 | new | 2 | 3 | 4 ]
+ * i (i+1) (i+2) i (i+1) (i+2)
+ */
+ memmove(&blocks[i + 2], &blocks[i + 1],
+ sizeof(struct address_block) * (allocator->size - i - 1));
+
+ struct address_block *to_borrow_from = &blocks[i];
+ struct address_block *new_block = to_borrow_from + 1;
+
+ uint64_t new_size = to_borrow_from->size - size;
+
+ to_borrow_from->size = new_size;
+
+ new_block->offset = to_borrow_from->offset + new_size;
+ new_block->size = size;
+ new_block->available = 1;
+
+ ++allocator->size;
+
+ return new_block;
+}
+
+/* Marks i'th block as available. If adjacent ((i-1) and (i+1)) blocks are also
+ * available, it merges i'th block with them.
+ * pre:
+ * i < allocator->size
+ * post:
+ * i'th block is merged with adjacent ones if they are available, blocks that
+ * were merged from are removed. allocator->size is updated if blocks were
+ * removed.
+ */
+static void address_space_allocator_release_block(
+ struct address_space_allocator *allocator,
+ int i)
+{
+ struct address_block *blocks = allocator->blocks;
+ int before = i - 1;
+ int after = i + 1;
+ int size = allocator->size;
+
+ address_space_assert(i >= 0);
+ address_space_assert(i < size);
+
+ blocks[i].available = 1;
+
+ if (before >= 0 && blocks[before].available) {
+ if (after < size && blocks[after].available) {
+ // merge (before, i, after) into before
+ blocks[before].size += (blocks[i].size + blocks[after].size);
+
+ size -= 2;
+ memmove(&blocks[i], &blocks[i + 2],
+ sizeof(struct address_block) * (size - i));
+ allocator->size = size;
+ } else {
+ // merge (before, i) into before
+ blocks[before].size += blocks[i].size;
+
+ --size;
+ memmove(&blocks[i], &blocks[i + 1],
+ sizeof(struct address_block) * (size - i));
+ allocator->size = size;
+ }
+ } else if (after < size && blocks[after].available) {
+ // merge (i, after) into i
+ blocks[i].size += blocks[after].size;
+
+ --size;
+ memmove(&blocks[after], &blocks[after + 1],
+ sizeof(struct address_block) * (size - after));
+ allocator->size = size;
+ }
+
+}
+
+/* Takes a size to allocate an address block and returns an offset where this
+ * block is allocated. This block will not be available for other callers unless
+ * it is explicitly deallocated (see address_space_allocator_deallocate below).
+ */
+static uint64_t address_space_allocator_allocate(
+ struct address_space_allocator *allocator,
+ uint64_t size)
+{
+ int i = address_space_allocator_find_available_block(allocator->blocks,
+ allocator->size,
+ size);
+ if (i < 0) {
+ return ANDROID_EMU_ADDRESS_SPACE_BAD_OFFSET;
+ } else {
+ address_space_assert(i < allocator->size);
+
+ struct address_block *block = &allocator->blocks[i];
+ address_space_assert(block->size >= size);
+
+ if (block->size > size) {
+ block = address_space_allocator_split_block(allocator, i, size);
+ }
+
+ address_space_assert(block->size == size);
+ block->available = 0;
+
+ return block->offset;
+ }
+}
+
+/* Takes an offset returned from address_space_allocator_allocate ealier
+ * (see above) and marks this block as available for further allocation.
+ */
+static uint32_t address_space_allocator_deallocate(
+ struct address_space_allocator *allocator,
+ uint64_t offset)
+{
+ struct address_block *block = allocator->blocks;
+ int size = allocator->size;
+ int i;
+
+ address_space_assert(size >= 1);
+
+ for (i = 0; i < size; ++i, ++block) {
+ if (block->offset == offset) {
+ if (block->available) {
+ return EINVAL;
+ } else {
+ address_space_allocator_release_block(allocator, i);
+ return 0;
+ }
+ }
+ }
+
+ return EINVAL;
+}
+
+/* Creates a seed block. */
+static void address_space_allocator_init(
+ struct address_space_allocator *allocator,
+ uint64_t size,
+ int initial_capacity)
+{
+ address_space_assert(initial_capacity >= 1);
+
+ allocator->blocks =
+ (struct address_block*)
+ malloc(sizeof(struct address_block) * initial_capacity);
+ memset(allocator->blocks, 0, sizeof(struct address_block) * initial_capacity);
+ address_space_assert(allocator->blocks);
+
+ struct address_block *block = allocator->blocks;
+
+ block->offset = 0;
+ block->size = size;
+ block->available = 1;
+
+ allocator->size = 1;
+ allocator->capacity = initial_capacity;
+ allocator->total_bytes = size;
+}
+
+/* At this point there should be no used blocks and all available blocks must
+ * have been merged into one block.
+ */
+static void address_space_allocator_destroy(
+ struct address_space_allocator *allocator)
+{
+ address_space_assert(allocator->size == 1);
+ address_space_assert(allocator->capacity >= allocator->size);
+ address_space_assert(allocator->blocks[0].available);
+ address_space_free(allocator->blocks);
+}
+
+/* Destroy function if we don't care what was previoulsy allocated.
+ * have been merged into one block.
+ */
+static void address_space_allocator_destroy_nocleanup(
+ struct address_space_allocator *allocator)
+{
+ address_space_free(allocator->blocks);
+}
+
+/* Resets the state of the allocator to the initial state without
+ * performing any dynamic memory management. */
+static void address_space_allocator_reset(
+ struct address_space_allocator *allocator)
+{
+ address_space_assert(allocator->size >= 1);
+
+ allocator->size = 1;
+
+ struct address_block* block = allocator->blocks;
+ block->offset = 0;
+ block->size = allocator->total_bytes;
+ block->available = 1;
+}
+
+typedef void (*address_block_iter_func_t)(void* context, struct address_block*);
+typedef void (*address_space_allocator_iter_func_t)(void* context, struct address_space_allocator*);
+
+static void address_space_allocator_run(
+ struct address_space_allocator *allocator,
+ void* context,
+ address_space_allocator_iter_func_t allocator_func,
+ address_block_iter_func_t block_func)
+{
+ struct address_block *block = 0;
+ int size;
+ int i;
+
+ allocator_func(context, allocator);
+
+ block = allocator->blocks;
+ size = allocator->size;
+
+ address_space_assert(size >= 1);
+
+ for (i = 0; i < size; ++i, ++block) {
+ block_func(context, block);
+ }
+}
+
+#ifdef ADDRESS_SPACE_NAMESPACE
+}
+#endif
+
+ANDROID_END_HEADER
diff --git a/src/gfxstream/guest/android-emu/aemu/base/containers/EntityManager.h b/src/gfxstream/guest/android-emu/aemu/base/containers/EntityManager.h
new file mode 100644
index 00000000000..860ab46561e
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/containers/EntityManager.h
@@ -0,0 +1,618 @@
+// 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.
+#pragma once
+
+#include "aemu/base/containers/Lookup.h"
+#include "aemu/base/Optional.h"
+
+#include <functional>
+#include <unordered_map>
+#include <vector>
+
+#include <inttypes.h>
+#include <stdio.h>
+
+#define ENTITY_MANAGER_DEBUG 0
+
+#if ENTITY_MANAGER_DEBUG
+
+#define EM_DBG(fmt,...) fprintf(stderr, "%s:%d " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);
+
+#else
+#define EM_DBG(...)
+#endif
+
+#define INVALID_ENTITY_HANDLE 0
+#define INVALID_COMPONENT_HANDLE 0
+
+namespace gfxstream {
+namespace guest {
+
+// EntityManager: A way to represent an abstrat space of objects with handles.
+// Each handle is associated with data of type Item for quick access from handles to data.
+// Otherwise, entity data is spread through ComponentManagers.
+template<size_t indexBits,
+ size_t generationBits,
+ size_t typeBits,
+ class Item>
+class EntityManager {
+public:
+
+ static_assert(indexBits == 64 - generationBits - typeBits,
+ "bits of index, generation, and type must add to 64");
+
+ // https://stackoverflow.com/questions/45225925/create-bitmask-based-on-a-pattern-as-constexpr
+ // There is another answer based on a function that returns constexpr but
+ // it doesn't actually fold to a constant when given a constant argument,
+ // according to godbolt.
+ template<class T, int count> struct bit_repeater;
+ template<class T>
+ struct bit_repeater<T, 1> {
+ static constexpr T value = 0x1;
+ };
+ template<class T, int count>
+ struct bit_repeater {
+ static constexpr T value = (bit_repeater<T, count-1>::value << 1) | 0x1;
+ };
+
+ static constexpr uint64_t indexMaskBase = bit_repeater<uint64_t, indexBits>().value;
+ static constexpr uint64_t generationMaskBase = bit_repeater<uint64_t, generationBits>().value;
+ static constexpr uint64_t typeMaskBase = bit_repeater<uint64_t, typeBits>().value;
+
+ static constexpr uint64_t indexMask = indexMaskBase;
+ static constexpr uint64_t generationMask = generationMaskBase << indexBits;
+ static constexpr uint64_t typeMask = typeMaskBase << (indexBits + generationBits);
+
+ using EntityHandle = uint64_t;
+ using IteratorFunc = std::function<void(bool live, EntityHandle h, Item& item)>;
+ using ConstIteratorFunc = std::function<void(bool live, EntityHandle h, const Item& item)>;
+
+ static size_t getHandleIndex(EntityHandle h) {
+ return static_cast<size_t>(h & indexMask);
+ }
+
+ static size_t getHandleGeneration(EntityHandle h) {
+ return static_cast<size_t>((h & generationMask) >> indexBits);
+ }
+
+ static size_t getHandleType(EntityHandle h) {
+ return static_cast<size_t>((h & typeMask) >> (indexBits + generationBits));
+ }
+
+ static EntityHandle makeHandle(
+ size_t index,
+ size_t generation,
+ size_t type) {
+ EntityHandle res = (index & indexMask);
+ res |= (((uint64_t)generation) << indexBits) & generationMask;
+ res |= (((uint64_t)type) << (indexBits + generationBits)) & typeMask;
+ return res;
+ }
+
+ static EntityHandle withIndex(EntityHandle h, size_t i) {
+ return makeHandle(i, getHandleGeneration(h), getHandleType(h));
+ }
+
+ static EntityHandle withGeneration(EntityHandle h, size_t nextGen) {
+ return makeHandle(getHandleIndex(h), nextGen, getHandleType(h));
+ }
+
+ static EntityHandle withType(EntityHandle h, size_t newType) {
+ return makeHandle(getHandleIndex(h), getHandleGeneration(h), newType);
+ }
+
+ EntityManager() : EntityManager(0) { }
+
+ EntityManager(size_t initialItems) :
+ mEntries(initialItems),
+ mFirstFreeIndex(0),
+ mLiveEntries(0) {
+ reserve(initialItems);
+ }
+
+ struct EntityEntry {
+ EntityHandle handle = 0;
+ size_t nextFreeIndex = 0;
+ // 0 is a special generation for brand new entries
+ // that are not used yet
+ size_t liveGeneration = 1;
+ Item item;
+ };
+
+ void clear() {
+ reserve(mEntries.size());
+ mFirstFreeIndex = 0;
+ mLiveEntries = 0;
+ }
+
+ size_t nextFreeIndex() const {
+ return mFirstFreeIndex;
+ }
+
+ EntityHandle add(const Item& item, size_t type) {
+
+ if (!type) return INVALID_ENTITY_HANDLE;
+
+ uint64_t maxElements = (1ULL << indexBits);
+ if (mLiveEntries == maxElements) return INVALID_ENTITY_HANDLE;
+
+ uint64_t newIndex = mFirstFreeIndex;
+
+ EM_DBG("newIndex/firstFree: %zu type: %zu", newIndex, type);
+
+ uint64_t neededCapacity = newIndex + 1;
+ if (maxElements < neededCapacity) return INVALID_ENTITY_HANDLE;
+
+ uint64_t currentCapacity = mEntries.size();
+ uint64_t nextCapacity = neededCapacity << 1;
+ if (nextCapacity > maxElements) nextCapacity = maxElements;
+
+ EM_DBG("needed/current/next capacity: %zu %zu %zu",
+ neededCapacity,
+ currentCapacity,
+ nextCapacity);
+
+ if (neededCapacity > mEntries.size()) {
+ mEntries.resize((size_t)nextCapacity);
+ for (uint64_t i = currentCapacity; i < nextCapacity; ++i) {
+ mEntries[i].handle = makeHandle(i, 0, type);
+ mEntries[i].nextFreeIndex = i + 1;
+ EM_DBG("new un-init entry: index %zu nextFree %zu",
+ i, i + 1);
+ }
+ }
+
+ mEntries[newIndex].handle =
+ makeHandle(newIndex, mEntries[newIndex].liveGeneration, type);
+ mEntries[newIndex].item = item;
+
+ mFirstFreeIndex = mEntries[newIndex].nextFreeIndex;
+ EM_DBG("created. new first free: %zu", mFirstFreeIndex);
+
+ ++mLiveEntries;
+
+ EM_DBG("result handle: 0x%llx", (unsigned long long)mEntries[newIndex].handle);
+
+ return mEntries[newIndex].handle;
+ }
+
+ EntityHandle addFixed(EntityHandle fixedHandle, const Item& item, size_t type) {
+ // 3 cases:
+ // 1. handle is not allocated and doesn't correspond to mFirstFreeIndex
+ bool isFreeListNonHead = false;
+ // 2. handle already exists (replace)
+ bool isAlloced = false;
+ // 3. index(handle) == mFirstFreeIndex
+ bool isFreeListHead = false;
+
+ if (!type) return INVALID_ENTITY_HANDLE;
+
+ uint64_t maxElements = (1ULL << indexBits);
+ if (mLiveEntries == maxElements) return INVALID_ENTITY_HANDLE;
+
+ uint64_t newIndex = getHandleIndex(fixedHandle);
+
+ EM_DBG("newIndex/firstFree: %zu type: %zu", newIndex, type);
+
+ uint64_t neededCapacity = newIndex + 1;
+
+ if (maxElements < neededCapacity) return INVALID_ENTITY_HANDLE;
+
+ uint64_t currentCapacity = mEntries.size();
+ uint64_t nextCapacity = neededCapacity << 1;
+ if (nextCapacity > maxElements) nextCapacity = maxElements;
+
+ EM_DBG("needed/current/next capacity: %zu %zu %zu",
+ neededCapacity,
+ currentCapacity,
+ nextCapacity);
+
+ if (neededCapacity > mEntries.size()) {
+ mEntries.resize((size_t)nextCapacity);
+ for (uint64_t i = currentCapacity; i < nextCapacity; ++i) {
+ mEntries[i].handle = makeHandle(i, 0, type);
+ mEntries[i].nextFreeIndex = i + 1;
+ EM_DBG("new un-init entry: index %zu nextFree %zu",
+ i, i + 1);
+ }
+ }
+
+ // Now we ensured that there is enough space to talk about the entry of
+ // this |fixedHandle|.
+ if (mFirstFreeIndex == newIndex) {
+ isFreeListHead = true;
+ } else {
+ auto& entry = mEntries[newIndex];
+ if (entry.liveGeneration == getHandleGeneration(entry.handle)) {
+ isAlloced = true;
+ } else {
+ isFreeListNonHead = true;
+ }
+ }
+
+ mEntries[newIndex].handle = fixedHandle;
+ mEntries[newIndex].liveGeneration = getHandleGeneration(fixedHandle);
+ mEntries[newIndex].item = item;
+
+ EM_DBG("new index: %zu", newIndex);
+
+ if (isFreeListHead) {
+
+ EM_DBG("first free index reset from %zu to %zu",
+ mFirstFreeIndex, mEntries[newIndex].nextFreeIndex);
+
+ mFirstFreeIndex = mEntries[newIndex].nextFreeIndex;
+
+ ++mLiveEntries;
+
+ } else if (isAlloced) {
+ // Already replaced whatever is there, and since it's already allocated,
+ // no need to update freelist.
+ EM_DBG("entry at %zu already alloced. replacing.", newIndex);
+ } else if (isFreeListNonHead) {
+ // Go through the freelist and skip over the entry we just added.
+ uint64_t prevEntryIndex = mFirstFreeIndex;
+
+ EM_DBG("in free list but not head. reorganizing freelist. "
+ "start at %zu -> %zu",
+ mFirstFreeIndex, mEntries[prevEntryIndex].nextFreeIndex);
+
+ while (mEntries[prevEntryIndex].nextFreeIndex != newIndex) {
+ EM_DBG("next: %zu -> %zu",
+ prevEntryIndex,
+ mEntries[prevEntryIndex].nextFreeIndex);
+ prevEntryIndex =
+ mEntries[prevEntryIndex].nextFreeIndex;
+ }
+
+ EM_DBG("finished. set prev entry %zu to new entry's next, %zu",
+ prevEntryIndex, mEntries[newIndex].nextFreeIndex);
+
+ mEntries[prevEntryIndex].nextFreeIndex =
+ mEntries[newIndex].nextFreeIndex;
+
+ ++mLiveEntries;
+ }
+
+ return fixedHandle;
+ }
+ void remove(EntityHandle h) {
+
+ if (get(h) == nullptr) return;
+
+ uint64_t index = getHandleIndex(h);
+
+ EM_DBG("remove handle: 0x%llx -> index %zu", (unsigned long long)h, index);
+
+ auto& entry = mEntries[index];
+
+ EM_DBG("handle gen: %zu entry gen: %zu", getHandleGeneration(h), entry.liveGeneration);
+
+ ++entry.liveGeneration;
+ if ((entry.liveGeneration == 0) ||
+ (entry.liveGeneration == (1ULL << generationBits))) {
+ entry.liveGeneration = 1;
+ }
+
+ entry.nextFreeIndex = mFirstFreeIndex;
+
+ mFirstFreeIndex = index;
+
+ EM_DBG("new first free: %zu next free: %zu", mFirstFreeIndex, entry.nextFreeIndex);
+
+ --mLiveEntries;
+ }
+
+ Item* get(EntityHandle h) {
+ uint64_t index = getHandleIndex(h);
+ if (index >= mEntries.size()) return nullptr;
+
+ auto& entry = mEntries[index];
+ if (entry.liveGeneration != getHandleGeneration(h)) {
+ return nullptr;
+ }
+
+ return &entry.item;
+ }
+
+ const Item* get_const(EntityHandle h) const {
+ uint64_t index = getHandleIndex(h);
+ if (index >= mEntries.size()) return nullptr;
+
+ const auto& entry = mEntries.data() + index;
+ if (entry->liveGeneration != getHandleGeneration(h)) return nullptr;
+
+ return &entry->item;
+ }
+
+ bool isLive(EntityHandle h) const {
+ uint64_t index = getHandleIndex(h);
+ if (index >= mEntries.size()) return false;
+
+ const auto& entry = mEntries[index];
+
+ return (entry.liveGeneration == getHandleGeneration(h));
+ }
+
+ void forEachEntry(IteratorFunc func) {
+ for (auto& entry: mEntries) {
+ auto handle = entry.handle;
+ bool live = isLive(handle);
+ auto& item = entry.item;
+ func(live, handle, item);
+ }
+ }
+
+ void forEachLiveEntry(IteratorFunc func) {
+ for (auto& entry: mEntries) {
+ auto handle = entry.handle;
+ bool live = isLive(handle);
+
+ if (!live) continue;
+
+ auto& item = entry.item;
+ func(live, handle, item);
+ }
+ }
+
+ void forEachLiveEntry_const(ConstIteratorFunc func) const {
+ for (auto& entry: mEntries) {
+ auto handle = entry.handle;
+ bool live = isLive(handle);
+
+ if (!live) continue;
+
+ const auto& item = entry.item;
+ func(live, handle, item);
+ }
+ }
+
+private:
+ void reserve(size_t count) {
+ if (mEntries.size() < count) {
+ mEntries.resize(count);
+ }
+ for (size_t i = 0; i < count; ++i) {
+ mEntries[i].handle = makeHandle(i, 0, 1);
+ mEntries[i].nextFreeIndex = i + 1;
+ ++mEntries[i].liveGeneration;
+ if ((mEntries[i].liveGeneration == 0) ||
+ (mEntries[i].liveGeneration == (1ULL << generationBits))) {
+ mEntries[i].liveGeneration = 1;
+ }
+ EM_DBG("new un-init entry: index %zu nextFree %zu",
+ i, i + 1);
+ }
+ }
+
+ std::vector<EntityEntry> mEntries;
+ uint64_t mFirstFreeIndex;
+ uint64_t mLiveEntries;
+};
+
+// Tracks components over a given space of entities.
+// Looking up by entity index is slower, but takes less space overall versus
+// a flat array that parallels the entities.
+template<size_t indexBits,
+ size_t generationBits,
+ size_t typeBits,
+ class Data>
+class ComponentManager {
+public:
+
+ static_assert(64 == (indexBits + generationBits + typeBits),
+ "bits of index, generation, and type must add to 64");
+
+ using ComponentHandle = uint64_t;
+ using EntityHandle = uint64_t;
+ using ComponentIteratorFunc = std::function<void(bool, ComponentHandle componentHandle, EntityHandle entityHandle, Data& data)>;
+ using ConstComponentIteratorFunc = std::function<void(bool, ComponentHandle componentHandle, EntityHandle entityHandle, const Data& data)>;
+
+ // Adds the given |data| and associates it with EntityHandle.
+ // We can also opt-in to immediately tracking the handle in the reverse mapping,
+ // which has an upfront cost in runtime.
+ // Many uses of ComponentManager don't really need to track the associated entity handle,
+ // so it is opt-in.
+
+ ComponentHandle add(
+ EntityHandle h,
+ const Data& data,
+ size_t type,
+ bool tracked = false) {
+
+ InternalItem item = { h, data, tracked };
+ auto res = static_cast<ComponentHandle>(mData.add(item, type));
+
+ if (tracked) {
+ mEntityToComponentMap[h] = res;
+ }
+
+ return res;
+ }
+
+ void clear() {
+ mData.clear();
+ mEntityToComponentMap.clear();
+ }
+
+ // If we didn't explicitly track, just fail.
+ ComponentHandle getComponentHandle(EntityHandle h) const {
+ auto componentHandlePtr = gfxstream::guest::find(mEntityToComponentMap, h);
+ if (!componentHandlePtr) return INVALID_COMPONENT_HANDLE;
+ return *componentHandlePtr;
+ }
+
+ EntityHandle getEntityHandle(ComponentHandle h) const {
+ return mData.get(h)->entityHandle;
+ }
+
+ void removeByEntity(EntityHandle h) {
+ auto componentHandle = getComponentHandle(h);
+ removeByComponent(componentHandle);
+ }
+
+ void removeByComponent(ComponentHandle h) {
+ auto item = mData.get(h);
+
+ if (!item) return;
+ if (item->tracked) {
+ mEntityToComponentMap.erase(item->entityHandle);
+ }
+
+ mData.remove(h);
+ }
+
+ Data* getByEntity(EntityHandle h) {
+ return getByComponent(getComponentHandle(h));
+ }
+
+ Data* getByComponent(ComponentHandle h) {
+ auto item = mData.get(h);
+ if (!item) return nullptr;
+ return &(item->data);
+ }
+
+ void forEachComponent(ComponentIteratorFunc func) {
+ mData.forEachEntry(
+ [func](bool live, typename InternalEntityManager::EntityHandle componentHandle, InternalItem& item) {
+ func(live, componentHandle, item.entityHandle, item.data);
+ });
+ }
+
+ void forEachLiveComponent(ComponentIteratorFunc func) {
+ mData.forEachLiveEntry(
+ [func](bool live, typename InternalEntityManager::EntityHandle componentHandle, InternalItem& item) {
+ func(live, componentHandle, item.entityHandle, item.data);
+ });
+ }
+
+ void forEachLiveComponent_const(ConstComponentIteratorFunc func) const {
+ mData.forEachLiveEntry_const(
+ [func](bool live, typename InternalEntityManager::EntityHandle componentHandle, const InternalItem& item) {
+ func(live, componentHandle, item.entityHandle, item.data);
+ });
+ }
+
+private:
+ struct InternalItem {
+ EntityHandle entityHandle;
+ Data data;
+ bool tracked;
+ };
+
+ using InternalEntityManager = EntityManager<indexBits, generationBits, typeBits, InternalItem>;
+ using EntityToComponentMap = std::unordered_map<EntityHandle, ComponentHandle>;
+
+ mutable InternalEntityManager mData;
+ EntityToComponentMap mEntityToComponentMap;
+};
+
+// ComponentManager, but unpacked; uses the same index space as the associated
+// entities. Takes more space by default, but not more if all entities have this component.
+template<size_t indexBits,
+ size_t generationBits,
+ size_t typeBits,
+ class Data>
+class UnpackedComponentManager {
+public:
+ using ComponentHandle = uint64_t;
+ using EntityHandle = uint64_t;
+ using ComponentIteratorFunc =
+ std::function<void(bool, ComponentHandle componentHandle, EntityHandle entityHandle, Data& data)>;
+ using ConstComponentIteratorFunc =
+ std::function<void(bool, ComponentHandle componentHandle, EntityHandle entityHandle, const Data& data)>;
+
+ EntityHandle add(EntityHandle h, const Data& data) {
+
+ size_t index = indexOfEntity(h);
+
+ if (index + 1 > mItems.size()) {
+ mItems.resize((index + 1) * 2);
+ }
+
+ mItems[index].live = true;
+ mItems[index].handle = h;
+ mItems[index].data = data;
+
+ return h;
+ }
+
+ void clear() {
+ mItems.clear();
+ }
+
+ void remove(EntityHandle h) {
+ size_t index = indexOfEntity(h);
+ if (index >= mItems.size()) return;
+ mItems[index].live = false;
+ }
+
+ Data* get(EntityHandle h) {
+ size_t index = indexOfEntity(h);
+
+ if (index + 1 > mItems.size()) {
+ mItems.resize((index + 1) * 2);
+ }
+
+ auto item = mItems.data() + index;
+ if (!item->live) return nullptr;
+ return &item->data;
+ }
+
+ const Data* get_const(EntityHandle h) const {
+ size_t index = indexOfEntity(h);
+
+ if (index + 1 > mItems.size()) {
+ return nullptr;
+ }
+
+ auto item = mItems.data() + index;
+ if (!item->live) return nullptr;
+ return &item->data;
+ }
+
+ void forEachComponent(ComponentIteratorFunc func) {
+ for (auto& item : mItems) {
+ func(item.live, item.handle, item.handle, item.data);
+ }
+ }
+
+ void forEachLiveComponent(ComponentIteratorFunc func) {
+ for (auto& item : mItems) {
+ if (item.live) func(item.live, item.handle, item.handle, item.data);
+ }
+ }
+
+ void forEachLiveComponent_const(ConstComponentIteratorFunc func) const {
+ for (auto& item : mItems) {
+ if (item.live) func(item.live, item.handle, item.handle, item.data);
+ }
+ }
+
+private:
+ static size_t indexOfEntity(EntityHandle h) {
+ return EntityManager<indexBits, generationBits, typeBits, int>::getHandleIndex(h);
+ }
+
+ struct InternalItem {
+ bool live = false;
+ EntityHandle handle = 0;
+ Data data;
+ };
+
+ std::vector<InternalItem> mItems;
+};
+
+} // namespace android
+} // namespace base
diff --git a/src/gfxstream/guest/android-emu/aemu/base/containers/HybridComponentManager.h b/src/gfxstream/guest/android-emu/aemu/base/containers/HybridComponentManager.h
new file mode 100644
index 00000000000..f9ae1fec8a7
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/containers/HybridComponentManager.h
@@ -0,0 +1,132 @@
+// 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.
+#pragma once
+
+#include "aemu/base/containers/Lookup.h"
+#include "aemu/base/containers/EntityManager.h"
+
+#include <unordered_map>
+
+namespace gfxstream {
+namespace guest {
+
+template <size_t maxIndex,
+ class IndexType, // must be castable to uint64_t
+ class Data>
+class HybridComponentManager {
+public:
+ using UCM = UnpackedComponentManager<32, 16, 16, Data>;
+ using EM = EntityManager<32, 16, 16, Data>;
+ using IterFunc = typename UCM::ComponentIteratorFunc;
+ using ConstIterFunc = typename UCM::ConstComponentIteratorFunc;
+ using Handle = typename EM::EntityHandle;
+
+ void add(IndexType index, const Data& data) {
+ uint64_t index_u64 = (uint64_t)index;
+ if (index_u64 < maxIndex) {
+ auto internal_handle = index2Handle(index_u64);
+ mComponentManager.add(internal_handle, data);
+ } else {
+ mMap[index] = data;
+ }
+
+ }
+
+ void clear() {
+ mComponentManager.clear();
+ mMap.clear();
+ }
+
+ void remove(IndexType index) {
+ uint64_t index_u64 = (uint64_t)index;
+ if (index_u64 < maxIndex) {
+ auto internal_handle = index2Handle(index_u64);
+ mComponentManager.remove(internal_handle);
+ } else {
+ mMap.erase(index);
+ }
+ }
+
+ Data* get(IndexType index) {
+ uint64_t index_u64 = (uint64_t)index;
+ if (index_u64 < maxIndex) {
+ auto internal_handle = index2Handle(index_u64);
+ return mComponentManager.get(internal_handle);
+ } else {
+ return gfxstream::guest::find(mMap, index);
+ }
+ }
+
+ const Data* get_const(IndexType index) const {
+ uint64_t index_u64 = (uint64_t)index;
+ if (index_u64 < maxIndex) {
+ auto internal_handle = index2Handle(index_u64);
+ return mComponentManager.get_const(internal_handle);
+ } else {
+ return gfxstream::guest::find(mMap, index);
+ }
+ }
+
+ Data* getExceptZero(IndexType index) {
+ Data* res = get(index);
+ if (!res) return nullptr;
+ if (!(*res)) return nullptr;
+ return res;
+ }
+
+ const Data* getExceptZero_const(IndexType index) const {
+ const Data* res = get_const(index);
+ if (!res) return nullptr;
+ if (!(*res)) return nullptr;
+ return res;
+ }
+
+ void forEach(IterFunc func) {
+ mComponentManager.forEach(func);
+
+ for (auto it : mMap) {
+ auto handle = index2Handle(it.first);
+ func(true /* live */, handle, handle, it.second);
+ }
+ }
+
+ void forEachLive(IterFunc func) {
+ mComponentManager.forEachLiveComponent(func);
+
+ for (auto it : mMap) {
+ auto handle = index2Handle(it.first);
+ func(true /* live */, handle, handle, it.second);
+ }
+ }
+
+ void forEachLive_const(ConstIterFunc func) const {
+ mComponentManager.forEachLiveComponent_const(func);
+
+ for (const auto it : mMap) {
+ auto handle = index2Handle(it.first);
+ func(true /* live */, handle, handle, it.second);
+ }
+ }
+
+private:
+ static Handle index2Handle(uint64_t index) {
+ return EM::makeHandle((uint32_t)index, 1, 1);
+ }
+
+ UCM mComponentManager;
+ std::unordered_map<IndexType, Data> mMap;
+};
+
+} // namespace android
+} // namespace base
diff --git a/src/gfxstream/guest/android-emu/aemu/base/containers/Lookup.h b/src/gfxstream/guest/android-emu/aemu/base/containers/Lookup.h
new file mode 100644
index 00000000000..c720cadb036
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/containers/Lookup.h
@@ -0,0 +1,168 @@
+// Copyright 2016 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 "aemu/base/TypeTraits.h"
+
+#include <initializer_list>
+#include <set>
+#include <map>
+#include <unordered_map>
+#include <unordered_set>
+#include <utility>
+
+// A set of convenience functions for map and set lookups. They allow a simpler
+// syntax, e.g.
+// if (auto val = find(map, "key")) {
+// <process the value>
+// }
+// ... or
+// auto value = find(funcThatReturnsMap(), "other_key");
+// if (!value) ...
+//
+// Note: these don't work for multimaps, as there's no single value
+// to return (and, more importantly, as those are completely useless).
+
+namespace gfxstream {
+namespace guest {
+
+// Helper predicates that check if the template argument is a map / set /
+// a mutlikey collection of any kind.
+// These are used as a constraints for the lookup functions to get better error
+// messages if the arguments don't support the map interface.
+template <class T>
+using is_any_map = std::integral_constant<
+ bool,
+ is_template_instantiation_of<T, std::map>::value ||
+ is_template_instantiation_of<T, std::unordered_map>::value>;
+
+template <class T>
+using is_any_set = std::integral_constant<
+ bool,
+ is_template_instantiation_of<T, std::set>::value ||
+ is_template_instantiation_of<T, std::unordered_set>::value>;
+
+template <class T>
+using is_any_multikey = std::integral_constant<
+ bool,
+ is_template_instantiation_of<T, std::multimap>::value ||
+ is_template_instantiation_of<T, std::unordered_multimap>::value ||
+ is_template_instantiation_of<T, std::multiset>::value ||
+ is_template_instantiation_of<T, std::unordered_multiset>::value>;
+
+template <class T, class = enable_if<is_any_map<T>>>
+const typename T::mapped_type* find(const T& map,
+ const typename T::key_type& key) {
+ const auto it = map.find(key);
+ if (it == map.end()) {
+ return nullptr;
+ }
+
+ return &it->second;
+}
+
+// Version that returns a modifiable value.
+template <class T, class = enable_if<is_any_map<T>>>
+typename T::mapped_type* find(T& map, const typename T::key_type& key) {
+ auto it = map.find(key);
+ if (it == map.end()) {
+ return nullptr;
+ }
+
+ return &it->second;
+}
+
+// Version with a default, returns a _copy_ because of the possible fallback
+// to a default - it might be destroyed after the call.
+template <class T,
+ class U = typename T::mapped_type,
+ class = enable_if_c<
+ is_any_map<T>::value &&
+ std::is_convertible<U, typename T::mapped_type>::value>>
+typename T::mapped_type findOrDefault(const T& map,
+ const typename T::key_type& key,
+ U&& defaultVal = {}) {
+ if (auto valPtr = find(map, key)) {
+ return *valPtr;
+ }
+ return defaultVal;
+}
+
+// Version that finds the first of the values passed in |keys| in the order they
+// are passed. E.g., the following code finds '2' as the first value in |keys|:
+// set<int> s = {1, 2, 3};
+// auto val = findFirstOf(s, {2, 1});
+// EXPECT_EQ(2, *val);
+template <class T, class = enable_if<is_any_map<T>>>
+const typename T::mapped_type* findFirstOf(
+ const T& map,
+ std::initializer_list<typename T::key_type> keys) {
+ for (const auto& key : keys) {
+ if (const auto valPtr = find(map, key)) {
+ return valPtr;
+ }
+ }
+ return nullptr;
+}
+
+template <class T, class = enable_if<is_any_map<T>>>
+typename T::mapped_type* findFirstOf(
+ T& map,
+ std::initializer_list<typename T::key_type> keys) {
+ for (const auto& key : keys) {
+ if (const auto valPtr = find(map, key)) {
+ return valPtr;
+ }
+ }
+ return nullptr;
+}
+
+// Version that finds first of the passed |key| values or returns the
+// |defaultVal| if none were found.
+template <class T,
+ class U,
+ class = enable_if_c<
+ is_any_map<T>::value &&
+ std::is_convertible<U, typename T::mapped_type>::value>>
+typename T::mapped_type findFirstOfOrDefault(
+ const T& map,
+ std::initializer_list<typename T::key_type> keys,
+ U&& defaultVal) {
+ if (const auto valPtr = findFirstOf(map, keys)) {
+ return *valPtr;
+ }
+ return std::forward<U>(defaultVal);
+}
+
+template <class T,
+ class = enable_if_c<is_any_map<T>::value || is_any_set<T>::value ||
+ is_any_multikey<T>::value>>
+bool contains(const T& c, const typename T::key_type& key) {
+ const auto it = c.find(key);
+ return it != c.end();
+}
+
+template <class T,
+ class = enable_if_c<is_any_map<T>::value || is_any_set<T>::value ||
+ is_any_multikey<T>::value>>
+bool containsAnyOf(const T& c,
+ std::initializer_list<typename T::key_type> keys) {
+ for (const auto& key : keys) {
+ if (contains(c, key)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/containers/SmallVector.h b/src/gfxstream/guest/android-emu/aemu/base/containers/SmallVector.h
new file mode 100644
index 00000000000..3b806c5399e
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/containers/SmallVector.h
@@ -0,0 +1,406 @@
+// 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.
+
+#pragma once
+
+#include "aemu/base/TypeTraits.h"
+
+#include <algorithm>
+#include <initializer_list>
+#include <memory>
+#include <type_traits>
+#include <utility>
+
+#include <stddef.h>
+#include <stdlib.h>
+
+//
+// SmallVector<T>, SmallFixedVector<T, SmallSize>
+//
+// This header defines a replacement for a std::vector<> that uses small buffer
+// optimization technique - for some preset number of elements |SmallSize| it
+// stores them inside of the object, and falls back to the dynamically allocated
+// array only if one needs to add more elements.
+// This is useful for the performance-critical places where common number of
+// processed items is small, but it may still be quite large for a stack array.
+//
+// SmallFixedVector<> is the class you use to store elements, while
+// SmallVector<> is its base class that erases the small size from the type.
+//
+// NOTE: SmallVector<> cannot guarantee std::vector<>'s iterator invalidation
+// rules for move() and swap() operations - std::vector<>s just exchange
+// their iterators on swap() and pass the moved ones over, while SmallVector<>
+// may leave the iterators pointing to nowhere if they were for the in-place
+// array storage.
+//
+// Currenly only a limited subset of std::vector<>'s operations is implemented,
+// but fill free to add the ones you need.
+//
+
+namespace gfxstream {
+namespace guest {
+
+//
+// Forward-declare the 'real' small vector class.
+template <class T, size_t S>
+class SmallFixedVector;
+
+//
+// SmallVector<T> - an interface for a small-buffer-optimized vector.
+// It hides the fixed size from its type, so one can use it to pass small
+// vectors around and not leak the buffer size to all callers:
+//
+// void process(SmallVector<Foo>& data);
+// ...
+// ...
+// SmallFixedVector<Foo, 100> aLittleBitOfFoos = ...;
+// process(aLittleBitOfFoos);
+// ...
+// SmallFixedVector<Foo, 1000> moreFoos = ...;
+// process(moreFoos);
+//
+template <class T>
+class SmallVector {
+ // Make them friends so SmallFixedVector is able to refer to SmallVector's
+ // protected members in static_assert()s.
+ template <class U, size_t S>
+ friend class SmallFixedVector;
+
+public:
+ // Common set of type aliases.
+ using value_type = T;
+ using iterator = T*;
+ using const_iterator = const T*;
+ using pointer = T*;
+ using const_pointer = const T*;
+ using reference = T&;
+ using const_reference = const T&;
+ using size_type = size_t;
+
+ // It's ok to delete SmallVector<> through the base class - dtor() actually
+ // takes care of all living elements and the allocated memory.
+ ~SmallVector() { dtor(); }
+
+ // std::vector<> interface operations.
+ iterator begin() { return mBegin; }
+ const_iterator begin() const { return mBegin; }
+ const_iterator cbegin() const { return mBegin; }
+
+ iterator end() { return mEnd; }
+ const_iterator end() const { return mEnd; }
+ const_iterator cend() const { return mEnd; }
+
+ size_type size() const { return end() - begin(); }
+ size_type capacity() const { return mCapacity; }
+ bool empty() const { return begin() == end(); }
+
+ reference front() { return *begin(); }
+ const_reference front() const { return *cbegin(); }
+ reference back() { return *(end() - 1); }
+ const_reference back() const { return *(cend() - 1); }
+
+ reference operator[](size_t i) { return *(begin() + i); }
+ const_reference operator[](size_t i) const { return *(cbegin() + i); }
+
+ pointer data() { return mBegin; }
+ const_pointer data() const { return mBegin; }
+ const_pointer cdata() const { return mBegin; }
+
+ template <class... Args>
+ void emplace_back(Args&&... args) {
+ grow_for_size(size() + 1);
+ new (mEnd) T(std::forward<Args>(args)...);
+ ++mEnd;
+ }
+
+ void push_back(const T& t) { emplace_back(t); }
+ void push_back(T&& t) { emplace_back(std::move(t)); }
+
+ void pop_back() {
+ destruct(mEnd - 1, mEnd);
+ --mEnd;
+ }
+
+ void clear() {
+ destruct(begin(), end());
+ mEnd = mBegin;
+ }
+
+ void reserve(size_type newCap) {
+ if (newCap <= this->capacity()) {
+ return;
+ }
+ set_capacity(newCap);
+ }
+
+ void resize(size_type newSize) { resize_impl<true>(newSize); }
+
+ // This version of resizing doesn't initialize the newly allocated elements
+ // Useful for the cases when value-initialization is noticeably slow and
+ // one wants to directly construct or memcpy the elements into the resized
+ // place.
+ void resize_noinit(size_type newSize) { resize_impl<false>(newSize); }
+
+ // Returns if the current vector's buffer is dynamically allocated.
+ bool isAllocated() const { return this->cbegin() != smallBufferStart(); }
+
+protected:
+ // Hide the default constructor so only SmallFixedVector can be
+ // instantiated.
+ SmallVector() = default;
+
+ // Destroy all elements in the vector and free the array if it was allocated
+ // dynamically.
+ void dtor() {
+ this->destruct(this->begin(), this->end());
+ if (isAllocated()) {
+ free(this->mBegin);
+ }
+ }
+
+ // Just a convenience setter function to init all members at once.
+ void init(iterator begin, iterator end, size_type capacity) {
+ this->mBegin = begin;
+ this->mEnd = end;
+ this->mCapacity = capacity;
+ }
+
+ // An implementation of different resizing versions.
+ template <bool init>
+ void resize_impl(size_type newSize) {
+ if (newSize < this->size()) {
+ const auto newEnd = this->begin() + newSize;
+ this->destruct(newEnd, this->end());
+ this->mEnd = newEnd;
+ } else if (newSize > this->size()) {
+ grow_for_size(newSize);
+ const auto newEnd = this->begin() + newSize;
+ if (init) {
+ std::uninitialized_fill(this->end(), newEnd, T());
+ }
+ this->mEnd = newEnd;
+ }
+ }
+
+ // Templated append operation for a range of elements.
+ template <class Iter>
+ void insert_back(Iter b, Iter e) {
+ if (b == e) {
+ return;
+ }
+ const auto newSize = this->size() + (e - b);
+ grow_for_size(newSize);
+ this->mEnd = std::uninitialized_copy(b, e, this->mEnd);
+ }
+
+ // Multiplicative grow for the internal array so it can hold |newSize|
+ // elements.
+ // Doesn't change size(), only capacity().
+ void grow_for_size(size_type newSize) {
+ // Grow by 1.5x by default.
+ if (newSize > capacity()) {
+ set_capacity(std::max(newSize, capacity() + capacity() / 2));
+ }
+ }
+
+ // Sets the capacity() to be exacly |newCap|. Allocates the array
+ // dynamically, moves all elements over and (potentially) deallocates the
+ // old array.
+ // Doesn't change size(), only capacity().
+ void set_capacity(size_type newCap) {
+ // Here we can only be switching to the dynamic vector, as static one
+ // always has its capacity on the maximum.
+ const auto newBegin = (T*)malloc(sizeof(T) * newCap);
+ if (!newBegin) {
+ abort(); // what else can we do here?
+ }
+ const auto newEnd = std::uninitialized_copy(
+ std::make_move_iterator(this->begin()),
+ std::make_move_iterator(this->end()), newBegin);
+ dtor();
+ this->mBegin = newBegin;
+ this->mEnd = newEnd;
+ this->mCapacity = newCap;
+ }
+
+ // A convenience function to call destructor for a range of elements.
+ static void destruct(T* b, T* e) {
+ if (!std::is_trivially_destructible<T>::value) {
+ for (; b != e; ++b) {
+ b->~T();
+ }
+ }
+ }
+
+ // By design of the class, SmallFixedVector<> will be inheriting from
+ // SmallVector<>, so its in-place storage array is going to be the very next
+ // member after the last one here.
+ // This function returns that address, and SmallFixedVector<> has a static
+ // assert to make sure it remains correct.
+ constexpr const void* smallBufferStart() const {
+ return (const void*)(&mCapacity + 1);
+ }
+
+ // Standard set of members for a vector - begin, end and capacity.
+ // These point to the currently used chunk of memory, no matter if it's a
+ // heap-allocated one or an in-place array.
+ iterator mBegin;
+ iterator mEnd;
+ size_type mCapacity;
+};
+
+// The implementation of a SmallVector with a fixed in-place size, |SmallSize|.
+template <class T, size_t SmallSize>
+class SmallFixedVector : public SmallVector<T> {
+ using base = SmallVector<T>;
+
+public:
+ // Grab these from the base class.
+ using value_type = typename base::value_type;
+ using iterator = typename base::iterator;
+ using const_iterator = typename base::const_iterator;
+ using pointer = typename base::pointer;
+ using const_pointer = typename base::const_pointer;
+ using reference = typename base::reference;
+ using const_reference = typename base::const_reference;
+ using size_type = typename base::size_type;
+
+ static constexpr size_type kSmallSize = SmallSize;
+
+ // Default constructor - set up an empty vector with capacity at full
+ // internal array size.
+ SmallFixedVector() {
+ // Make sure that the small array starts exactly where base class
+ // expects it: right after the |mCapacity|.
+
+ // We can't use a static_assert with offsetof() because in msvc, it uses
+ // reinterpret_cast.
+ // TODO: Add runtime assertion instead?
+ // https://developercommunity.visualstudio.com/content/problem/22196/static-assert-cannot-compile-constexprs-method-tha.html
+#ifndef _MSC_VER
+ static_assert(offsetof(base, mCapacity) + sizeof(base::mCapacity) ==
+ offsetof(SmallFixedVector, mData) &&
+ offsetof(Data, array) == 0,
+ "SmallFixedVector<> class layout is wrong, "
+ "|mData| needs to follow |mCapacity|");
+#endif
+
+ init_inplace();
+ }
+
+ // Ctor from a range of iterators
+ template <class Iter>
+ SmallFixedVector(Iter b, Iter e) : SmallFixedVector() {
+ this->insert_back(b, e);
+ }
+
+ // Ctor from a range - anything that has begin and end.
+ // Note: template constructor is never a copy/move-ctor.
+ template <class Range,
+ class = enable_if_c<!std::is_same<Range, T>::value &&
+ is_range<Range>::value>>
+ explicit SmallFixedVector(const Range& r)
+ : SmallFixedVector(std::begin(r), std::end(r)) {}
+ template <class Range,
+ class = enable_if_c<!std::is_same<Range, T>::value &&
+ is_range<Range>::value>>
+ explicit SmallFixedVector(Range&& r)
+ : SmallFixedVector(std::make_move_iterator(std::begin(r)),
+ std::make_move_iterator(std::end(r))) {}
+ template <class U, class = enable_if_convertible<U, T>>
+ SmallFixedVector(std::initializer_list<U> list)
+ : SmallFixedVector(std::begin(list), std::end(list)) {}
+
+ SmallFixedVector(const SmallFixedVector& other)
+ : SmallFixedVector(other.begin(), other.end()) {}
+
+ SmallFixedVector(SmallFixedVector&& other) {
+ if (other.isAllocated()) {
+ // Just steal the allocated memory from the |other|.
+ this->mBegin = other.mBegin;
+ this->mEnd = other.mEnd;
+ this->mCapacity = other.mCapacity;
+ other.init_inplace();
+ } else {
+ // Have to move individual elements.
+ this->mBegin = mData.array;
+ this->mEnd = std::uninitialized_copy(
+ std::make_move_iterator(other.begin()),
+ std::make_move_iterator(other.end()), this->begin());
+ this->mCapacity = kSmallSize;
+ }
+ }
+
+ SmallFixedVector& operator=(const SmallFixedVector& other) {
+ if (&other != this) {
+ this->clear();
+ this->insert_back(other.begin(), other.end());
+ }
+ return *this;
+ }
+
+ SmallFixedVector& operator=(SmallFixedVector&& other) {
+ if (other.isAllocated()) {
+ // Steal it and we're done.
+ this->dtor();
+ this->mBegin = other.mBegin;
+ this->mEnd = other.mEnd;
+ this->mCapacity = other.mCapacity;
+ other.init_inplace();
+ return *this;
+ }
+
+ if (this->isAllocated() && this->mCapacity < other.size()) {
+ // Not enough dynamic memory, switch to in-place.
+ this->dtor();
+ init_inplace();
+ } else {
+ // This could potentially be improved by move-assigning
+ // only needed items and destroying the rest, but
+ // destroy-all+construct-all is just simpler. For PODs it actually
+ // is even faster as it's always a single memcpy().
+ this->destruct(this->begin(), this->end());
+ }
+
+ // Move the whole |other| into the pre-cleaned memory
+ const auto newEnd = std::uninitialized_copy(
+ std::make_move_iterator(other.begin()),
+ std::make_move_iterator(other.end()), this->mBegin);
+ this->mEnd = newEnd;
+ // |other| is valid as-is.
+ return *this;
+ }
+
+ // Make sure we don't end up trying to move from an interface - it's just
+ // inefficient with the current code.
+ SmallFixedVector(base&& other) = delete;
+ SmallFixedVector& operator=(base&& other) = delete;
+
+private:
+ // A shortcut for initialization for in-place storage.
+ void init_inplace() { this->init(mData.array, mData.array, kSmallSize); }
+
+ // A union with empty constructor and destructor makes sure that the array
+ // elements are not default-constructed in ctor and not destructed in dtor:
+ // the class needs to be able manage their lifetime more precisely.
+ union Data {
+ alignas(size_type) T array[kSmallSize];
+
+ Data() {}
+ ~Data() {}
+ } mData;
+};
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/files/MemStream.cpp b/src/gfxstream/guest/android-emu/aemu/base/files/MemStream.cpp
new file mode 100644
index 00000000000..c70624f5c04
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/files/MemStream.cpp
@@ -0,0 +1,66 @@
+// 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 "aemu/base/files/MemStream.h"
+
+#include "aemu/base/files/StreamSerializing.h"
+
+#include <algorithm>
+#include <utility>
+#include <cstring>
+
+namespace gfxstream {
+namespace guest {
+
+MemStream::MemStream(int reserveSize) {
+ mData.reserve(reserveSize);
+}
+
+MemStream::MemStream(Buffer&& data) : mData(std::move(data)) {}
+
+ssize_t MemStream::read(void* buffer, size_t size) {
+ const auto sizeToRead = std::min<int>(size, readSize());
+ memcpy(buffer, mData.data() + mReadPos, sizeToRead);
+ mReadPos += sizeToRead;
+ return sizeToRead;
+}
+
+ssize_t MemStream::write(const void* buffer, size_t size) {
+ mData.insert(mData.end(), (const char*)buffer, (const char*)buffer + size);
+ return size;
+}
+
+int MemStream::writtenSize() const {
+ return (int)mData.size();
+}
+
+int MemStream::readPos() const {
+ return mReadPos;
+}
+
+int MemStream::readSize() const {
+ return mData.size() - mReadPos;
+}
+
+void MemStream::save(Stream* stream) const {
+ saveBuffer(stream, mData);
+}
+
+void MemStream::load(Stream* stream) {
+ loadBuffer(stream, &mData);
+ mReadPos = 0;
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/files/MemStream.h b/src/gfxstream/guest/android-emu/aemu/base/files/MemStream.h
new file mode 100644
index 00000000000..51f39c94d95
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/files/MemStream.h
@@ -0,0 +1,58 @@
+// 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.
+
+#pragma once
+
+#include "aemu/base/Compiler.h"
+#include "aemu/base/files/Stream.h"
+
+#include <vector>
+
+namespace gfxstream {
+namespace guest {
+
+// An implementation of the Stream interface on top of a vector.
+class MemStream : public Stream {
+public:
+ using Buffer = std::vector<char>;
+
+ MemStream(int reserveSize = 512);
+ MemStream(Buffer&& data);
+
+ MemStream(MemStream&& other) = default;
+ MemStream& operator=(MemStream&& other) = default;
+
+ int writtenSize() const;
+ int readPos() const;
+ int readSize() const;
+
+ // Stream interface implementation.
+ ssize_t read(void* buffer, size_t size) override;
+ ssize_t write(const void* buffer, size_t size) override;
+
+ // Snapshot support.
+ void save(Stream* stream) const;
+ void load(Stream* stream);
+
+ const Buffer& buffer() const { return mData; }
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(MemStream);
+
+ Buffer mData;
+ int mReadPos = 0;
+};
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/files/Stream.cpp b/src/gfxstream/guest/android-emu/aemu/base/files/Stream.cpp
new file mode 100644
index 00000000000..ffbb3a1105c
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/files/Stream.cpp
@@ -0,0 +1,267 @@
+// 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 "aemu/base/files/Stream.h"
+
+#include <assert.h>
+#include <string.h>
+
+namespace gfxstream {
+namespace guest {
+
+void Stream::putByte(uint8_t value) {
+ write(&value, 1U);
+}
+
+uint8_t Stream::getByte() {
+ uint8_t value[1] = { 0 };
+ read(value, 1U);
+ return value[0];
+}
+
+void Stream::putBe16(uint16_t value) {
+ uint8_t b[2] = { (uint8_t)(value >> 8), (uint8_t)value };
+ write(b, 2U);
+}
+
+uint16_t Stream::getBe16() {
+ uint8_t b[2] = { 0, 0 };
+ read(b, 2U);
+ return ((uint16_t)b[0] << 8) | (uint16_t)b[1];
+}
+
+void Stream::putBe32(uint32_t value) {
+ uint8_t b[4] = {
+ (uint8_t)(value >> 24),
+ (uint8_t)(value >> 16),
+ (uint8_t)(value >> 8),
+ (uint8_t)value };
+ write(b, 4U);
+}
+
+uint32_t Stream::getBe32() {
+ uint8_t b[4] = { 0, 0, 0, 0 };
+ read(b, 4U);
+ return ((uint32_t)b[0] << 24) |
+ ((uint32_t)b[1] << 16) |
+ ((uint32_t)b[2] << 8) |
+ (uint32_t)b[3];
+}
+
+void Stream::putBe64(uint64_t value) {
+ uint8_t b[8] = {
+ (uint8_t)(value >> 56),
+ (uint8_t)(value >> 48),
+ (uint8_t)(value >> 40),
+ (uint8_t)(value >> 32),
+ (uint8_t)(value >> 24),
+ (uint8_t)(value >> 16),
+ (uint8_t)(value >> 8),
+ (uint8_t)value };
+ write(b, 8U);
+}
+
+uint64_t Stream::getBe64() {
+ uint8_t b[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ read(b, 8U);
+ return ((uint64_t)b[0] << 56) |
+ ((uint64_t)b[1] << 48) |
+ ((uint64_t)b[2] << 40) |
+ ((uint64_t)b[3] << 32) |
+ ((uint64_t)b[4] << 24) |
+ ((uint64_t)b[5] << 16) |
+ ((uint64_t)b[6] << 8) |
+ (uint64_t)b[7];
+}
+
+void Stream::putFloat(float v) {
+ union {
+ float f;
+ uint8_t bytes[sizeof(float)];
+ } u;
+ u.f = v;
+ this->write(u.bytes, sizeof(u.bytes));
+}
+
+float Stream::getFloat() {
+ union {
+ float f;
+ uint8_t bytes[sizeof(float)];
+ } u;
+ this->read(u.bytes, sizeof(u.bytes));
+ return u.f;
+}
+
+void Stream::putString(const char* str) {
+ if (str) {
+ putString(str, strlen(str));
+ } else {
+ putString("", 0);
+ }
+}
+
+void Stream::putString(const std::string& str) {
+ putString(str.data(), str.size());
+}
+
+void Stream::putString(const char* str, size_t len) {
+ if (str) {
+ this->putBe32(len);
+ this->write(str, len);
+ }
+}
+
+std::string Stream::getString() {
+ std::string result;
+ size_t len = this->getBe32();
+ if (len > 0) {
+ result.resize(len);
+ if (this->read(&result[0], len) != static_cast<ssize_t>(len)) {
+ result.clear();
+ }
+ }
+#ifdef _WIN32
+ else {
+ // std::string in GCC's STL still uses copy on write implementation
+ // with a single shared buffer for an empty string. Its dtor has
+ // a check for that shared buffer, and it deallocates memory only if
+ // the current string's instance address != shared empty string address
+ // Unfortunately, in Windows DLLs each DLL has its own copy of this
+ // empty string (that's just the way Windows DLLs work), so if this
+ // code creates an empty string and passes it over into another module,
+ // that module's std::string::~string() will compare address with its
+ // empty string object, find that they are different and will try to
+ // free() a static object.
+ // To mitigate it we make sure the string allocates something, so it
+ // isn't empty internally and dtor is OK to delete the storage.
+ result.reserve(1);
+ }
+#endif
+ return result;
+}
+
+void Stream::putPackedNum(uint64_t num) {
+ do {
+ auto byte = uint8_t(num & 0x7f);
+ num >>= 7;
+ if (num) {
+ byte |= 0x80;
+ }
+ putByte(byte);
+ } while (num != 0);
+}
+
+uint64_t Stream::getPackedNum() {
+ uint64_t res = 0;
+ uint8_t byte;
+ int i = 0;
+ do {
+ byte = getByte();
+ res |= uint64_t(byte & 0x7f) << (i++ * 7);
+ } while (byte & 0x80 && i < 10);
+ return res;
+}
+
+void Stream::putPackedSignedNum(int64_t num) {
+ if (num >= 0) {
+ assert((uint64_t(num) & (1ULL << 63)) == 0);
+ putPackedNum(uint64_t(num) << 1);
+ } else {
+ assert((uint64_t(-num) & (1ULL << 63)) == 0);
+ putPackedNum((uint64_t(-num) << 1) | 1);
+ }
+}
+
+int64_t Stream::getPackedSignedNum() {
+ auto num = getPackedNum();
+ auto sign = num & 1;
+ return sign ? -int64_t(num >> 1) : (num >> 1);
+}
+
+// Static big-endian conversions
+
+// the |v| pointer is unlikely to be aligned---use memcpy throughout
+
+void Stream::toByte(uint8_t*) { } // no conversion
+
+void Stream::toBe16(uint8_t* v) {
+ uint16_t value;
+ memcpy(&value, v, sizeof(uint16_t));
+ uint8_t b[2] = { (uint8_t)(value >> 8), (uint8_t)value };
+ memcpy(v, b, sizeof(uint16_t));
+}
+
+void Stream::toBe32(uint8_t* v) {
+ uint32_t value;
+ memcpy(&value, v, sizeof(uint32_t));
+ uint8_t b[4] = {
+ (uint8_t)(value >> 24),
+ (uint8_t)(value >> 16),
+ (uint8_t)(value >> 8),
+ (uint8_t)value };
+ memcpy(v, b, sizeof(uint32_t));
+}
+
+void Stream::toBe64(uint8_t* v) {
+ uint64_t value;
+ memcpy(&value, v, sizeof(uint64_t));
+ uint8_t b[8] = {
+ (uint8_t)(value >> 56),
+ (uint8_t)(value >> 48),
+ (uint8_t)(value >> 40),
+ (uint8_t)(value >> 32),
+ (uint8_t)(value >> 24),
+ (uint8_t)(value >> 16),
+ (uint8_t)(value >> 8),
+ (uint8_t)value };
+ memcpy(v, b, sizeof(uint64_t));
+}
+
+void Stream::fromByte(uint8_t*) { } // no conversion
+
+void Stream::fromBe16(uint8_t* v) {
+ uint8_t b[2];
+ memcpy(b, v, sizeof(uint16_t));
+ uint16_t value = ((uint16_t)b[0] << 8) | (uint16_t)b[1];
+ memcpy(v, &value, sizeof(uint16_t));
+}
+
+void Stream::fromBe32(uint8_t* v) {
+ uint8_t b[4];
+ memcpy(b, v, sizeof(uint32_t));
+ uint32_t value =
+ ((uint32_t)b[0] << 24) |
+ ((uint32_t)b[1] << 16) |
+ ((uint32_t)b[2] << 8) |
+ (uint32_t)b[3];
+ memcpy(v, &value, sizeof(uint32_t));
+}
+
+void Stream::fromBe64(uint8_t* v) {
+ uint8_t b[8];
+ memcpy(b, v, sizeof(uint64_t));
+ uint64_t value =
+ ((uint64_t)b[0] << 56) |
+ ((uint64_t)b[1] << 48) |
+ ((uint64_t)b[2] << 40) |
+ ((uint64_t)b[3] << 32) |
+ ((uint64_t)b[4] << 24) |
+ ((uint64_t)b[5] << 16) |
+ ((uint64_t)b[6] << 8) |
+ (uint64_t)b[7];
+ memcpy(v, &value, sizeof(uint64_t));
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/files/Stream.h b/src/gfxstream/guest/android-emu/aemu/base/files/Stream.h
new file mode 100644
index 00000000000..6dad32f30eb
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/files/Stream.h
@@ -0,0 +1,118 @@
+// 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.
+
+#pragma once
+
+#include <string>
+
+#include <inttypes.h>
+#include <sys/types.h>
+
+namespace gfxstream {
+namespace guest {
+
+// Abstract interface to byte streams of all kind.
+// This is mainly used to implement disk serialization.
+class Stream {
+public:
+ // Default constructor.
+ Stream() = default;
+
+ // Destructor.
+ virtual ~Stream() = default;
+
+ // Read up to |size| bytes and copy them to |buffer|. Return the number
+ // of bytes that were actually transferred, or -errno value on error.
+ virtual ssize_t read(void* buffer, size_t size) = 0;
+
+ // Write up to |size| bytes from |buffer| into the stream. Return the
+ // number of bytes that were actually transferred, or -errno value on
+ // error.
+ virtual ssize_t write(const void* buffer, size_t size) = 0;
+
+ // Write a single byte |value| into the stream. Ignore errors.
+ void putByte(uint8_t value);
+
+ // Write a 16-bit |value| as big-endian into the stream. Ignore errors.
+ void putBe16(uint16_t value);
+
+ // Write a 32-bit |value| as big-endian into the stream. Ignore errors.
+ void putBe32(uint32_t value);
+
+ // Write a 64-bit |value| as big-endian into the stream. Ignore errors.
+ void putBe64(uint64_t value);
+
+ // Read a single byte from the stream. Return 0 on error.
+ uint8_t getByte();
+
+ // Read a single big-endian 16-bit value from the stream.
+ // Return 0 on error.
+ uint16_t getBe16();
+
+ // Read a single big-endian 32-bit value from the stream.
+ // Return 0 on error.
+ uint32_t getBe32();
+
+ // Read a single big-endian 64-bit value from the stream.
+ // Return 0 on error.
+ uint64_t getBe64();
+
+ // Write a 32-bit float |value| to the stream.
+ void putFloat(float value);
+
+ // Read a single 32-bit float value from the stream.
+ float getFloat();
+
+ // Write a 0-terminated C string |str| into the stream. Ignore error.
+ void putString(const char* str);
+ void putString(const std::string& str);
+
+ // Write a string |str| of |strlen| bytes into the stream.
+ // Ignore errors.
+ void putString(const char* str, size_t strlen);
+
+ // Read a string from the stream. Return a new string instance,
+ // which will be empty on error. Note that this can only be used
+ // to read strings that were written with putString().
+ std::string getString();
+
+ // Put/gen an integer number into the stream, making it use as little space
+ // there as possible.
+ // It uses a simple byte-by-byte encoding scheme, putting 7 bits of the
+ // number with the 8th bit set when there's more data to read, until the
+ // whole number is read.
+ // The compression is efficient if the number range is small, but it starts
+ // wasting space when values approach 14 bits for int16 (16K), 28 bits for
+ // int32 (268M) or 56 bits for int64 (still a lot).
+ void putPackedNum(uint64_t num);
+ uint64_t getPackedNum();
+
+ // Same thing, but encode negative numbers efficiently as well (single sign
+ // bit + packed unsigned representation)
+ void putPackedSignedNum(int64_t num);
+ int64_t getPackedSignedNum();
+
+ // Static big-endian conversions
+ static void toByte(uint8_t*);
+ static void toBe16(uint8_t*);
+ static void toBe32(uint8_t*);
+ static void toBe64(uint8_t*);
+ static void fromByte(uint8_t*);
+ static void fromBe16(uint8_t*);
+ static void fromBe32(uint8_t*);
+ static void fromBe64(uint8_t*);
+};
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/files/StreamSerializing.cpp b/src/gfxstream/guest/android-emu/aemu/base/files/StreamSerializing.cpp
new file mode 100644
index 00000000000..554b2cbf334
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/files/StreamSerializing.cpp
@@ -0,0 +1,56 @@
+// 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.
+
+#include "aemu/base/files/StreamSerializing.h"
+
+namespace gfxstream {
+namespace guest {
+
+void saveStream(Stream* stream, const MemStream& memStream) {
+ memStream.save(stream);
+}
+
+void loadStream(Stream* stream, MemStream* memStream) {
+ memStream->load(stream);
+}
+
+void saveBufferRaw(Stream* stream, char* buffer, uint32_t len) {
+ stream->putBe32(len);
+ stream->write(buffer, len);
+}
+
+bool loadBufferRaw(Stream* stream, char* buffer) {
+ auto len = stream->getBe32();
+ int ret = (int)stream->read(buffer, len);
+ return ret == (int)len;
+}
+
+void saveStringArray(Stream* stream, const char* const* strings, uint32_t count) {
+ stream->putBe32(count);
+ for (uint32_t i = 0; i < count; ++i) {
+ stream->putString(strings[i]);
+ }
+}
+
+std::vector<std::string> loadStringArray(Stream* stream) {
+ uint32_t count = stream->getBe32();
+ std::vector<std::string> res;
+ for (uint32_t i = 0; i < count; ++i) {
+ res.push_back(stream->getString());
+ }
+ return res;
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/files/StreamSerializing.h b/src/gfxstream/guest/android-emu/aemu/base/files/StreamSerializing.h
new file mode 100644
index 00000000000..4ca4c79ef22
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/files/StreamSerializing.h
@@ -0,0 +1,117 @@
+// 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.
+
+#pragma once
+
+#include "aemu/base/containers/SmallVector.h"
+#include "aemu/base/files/MemStream.h"
+#include "aemu/base/files/Stream.h"
+#include "aemu/base/TypeTraits.h"
+
+#include <string>
+#include <vector>
+
+namespace gfxstream {
+namespace guest {
+
+//
+// Save/load operations for different types.
+//
+
+void saveStream(Stream* stream, const MemStream& memStream);
+void loadStream(Stream* stream, MemStream* memStream);
+
+void saveBufferRaw(Stream* stream, char* buffer, uint32_t len);
+bool loadBufferRaw(Stream* stream, char* buffer);
+
+template <class T, class = enable_if<std::is_standard_layout<T>>>
+void saveBuffer(Stream* stream, const std::vector<T>& buffer) {
+ stream->putBe32(buffer.size());
+ stream->write(buffer.data(), sizeof(T) * buffer.size());
+}
+
+template <class T, class = enable_if<std::is_standard_layout<T>>>
+bool loadBuffer(Stream* stream, std::vector<T>* buffer) {
+ auto len = stream->getBe32();
+ buffer->resize(len);
+ auto ret = static_cast<std::size_t>(stream->read(buffer->data(), len * sizeof(T)));
+ return ret == len * sizeof(T);
+}
+
+template <class T, class = enable_if<std::is_standard_layout<T>>>
+void saveBuffer(Stream* stream, const SmallVector<T>& buffer) {
+ stream->putBe32(buffer.size());
+ stream->write(buffer.data(), sizeof(T) * buffer.size());
+}
+
+template <class T, class = enable_if<std::is_standard_layout<T>>>
+bool loadBuffer(Stream* stream, SmallVector<T>* buffer) {
+ auto len = stream->getBe32();
+ buffer->clear();
+ buffer->resize_noinit(len);
+ int ret = (int)stream->read(buffer->data(), len * sizeof(T));
+ return ret == len * sizeof(T);
+}
+
+template <class T, class SaveFunc>
+void saveBuffer(Stream* stream, const std::vector<T>& buffer, SaveFunc&& saver) {
+ stream->putBe32(buffer.size());
+ for (const auto& val : buffer) {
+ saver(stream, val);
+ }
+}
+
+template <class T>
+void saveBuffer(Stream* stream, const T* buffer, size_t numElts) {
+ stream->putBe32(numElts);
+ stream->write(buffer, sizeof(T) * numElts);
+}
+
+template <class T>
+void loadBufferPtr(Stream* stream, T* out) {
+ auto len = stream->getBe32();
+ stream->read(out, len * sizeof(T));
+}
+
+template <class T, class LoadFunc>
+void loadBuffer(Stream* stream, std::vector<T>* buffer, LoadFunc&& loader) {
+ auto len = stream->getBe32();
+ buffer->clear();
+ buffer->reserve(len);
+ for (uint32_t i = 0; i < len; i++) {
+ buffer->emplace_back(loader(stream));
+ }
+}
+
+template <class Collection, class SaveFunc>
+void saveCollection(Stream* stream, const Collection& c, SaveFunc&& saver) {
+ stream->putBe32(c.size());
+ for (const auto& val : c) {
+ saver(stream, val);
+ }
+}
+
+template <class Collection, class LoadFunc>
+void loadCollection(Stream* stream, Collection* c, LoadFunc&& loader) {
+ const int size = stream->getBe32();
+ for (int i = 0; i < size; ++i) {
+ c->emplace(loader(stream));
+ }
+}
+
+void saveStringArray(Stream* stream, const char* const* strings, uint32_t count);
+std::vector<std::string> loadStringArray(Stream* stream);
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/guest/android-emu/aemu/base/fit/Defer.h b/src/gfxstream/guest/android-emu/aemu/base/fit/Defer.h
new file mode 100644
index 00000000000..f0be5844bdd
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/fit/Defer.h
@@ -0,0 +1,157 @@
+// 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.
+
+// Copyright 2018 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <utility>
+
+#include "Function.h"
+#include "Nullable.h"
+
+namespace gfxstream::guest {
+namespace fit {
+
+// A move-only deferred action wrapper with RAII semantics.
+// This class is not thread safe.
+//
+// The wrapper holds a function-like callable target with no arguments
+// which it invokes when it goes out of scope unless canceled, called, or
+// moved to a wrapper in a different scope.
+//
+// See |fit::defer()| for idiomatic usage.
+template <typename T>
+class DeferredAction final {
+public:
+ // Creates a deferred action without a pending target.
+ DeferredAction() = default;
+ explicit DeferredAction(decltype(nullptr)) {}
+
+ // Creates a deferred action with a pending target.
+ explicit DeferredAction(T target) : mTarget(std::move(target)) {}
+
+ // Creates a deferred action with a pending target moved from another
+ // deferred action, leaving the other one without a pending target.
+ DeferredAction(DeferredAction&& other) : mTarget(std::move(other.mTarget)) {
+ other.mTarget.reset();
+ }
+
+ // Invokes and releases the deferred action's pending target (if any).
+ ~DeferredAction() { call(); }
+
+ // Returns true if the deferred action has a pending target.
+ explicit operator bool() const { return !!mTarget; }
+
+ // Invokes and releases the deferred action's pending target (if any),
+ // then move-assigns it from another deferred action, leaving the latter
+ // one without a pending target.
+ DeferredAction& operator=(DeferredAction&& other) {
+ if (&other == this)
+ return *this;
+ call();
+ mTarget = std::move(other.mTarget);
+ other.mTarget.reset();
+ return *this;
+ }
+
+ // Invokes and releases the deferred action's pending target (if any).
+ void call() {
+ if (mTarget) {
+ // Move to a local to guard against re-entrance.
+ T local_target = std::move(*mTarget);
+ mTarget.reset();
+ local_target();
+ }
+ }
+
+ // Releases the deferred action's pending target (if any) without
+ // invoking it.
+ void cancel() { mTarget.reset(); }
+ DeferredAction& operator=(decltype(nullptr)) {
+ cancel();
+ return *this;
+ }
+
+ // Assigns a new target to the deferred action.
+ DeferredAction& operator=(T target) {
+ mTarget = std::move(target);
+ return *this;
+ }
+
+ DeferredAction(const DeferredAction& other) = delete;
+ DeferredAction& operator=(const DeferredAction& other) = delete;
+
+private:
+ Nullable<T> mTarget;
+};
+
+template <typename T>
+bool operator==(const DeferredAction<T>& action, decltype(nullptr)) {
+ return !action;
+}
+template <typename T>
+bool operator==(decltype(nullptr), const DeferredAction<T>& action) {
+ return !action;
+}
+template <typename T>
+bool operator!=(const DeferredAction<T>& action, decltype(nullptr)) {
+ return !!action;
+}
+template <typename T>
+bool operator!=(decltype(nullptr), const DeferredAction<T>& action) {
+ return !!action;
+}
+
+// Defers execution of a function-like callable target with no arguments
+// until the value returned by this function goes out of scope unless canceled,
+// called, or moved to a wrapper in a different scope.
+//
+// // This example prints "Hello..." then "Goodbye!".
+// void test() {
+// auto d = fit::defer([]{ puts("Goodbye!"); });
+// puts("Hello...");
+// }
+//
+// // This example prints nothing because the deferred action is canceled.
+// void do_nothing() {
+// auto d = fit::defer([]{ puts("I'm not here."); });
+// d.cancel();
+// }
+//
+// // This example shows how the deferred action can be reassigned assuming
+// // the new target has the same type and the old one, in this case by
+// // representing the target as a |fit::Closure|.
+// void reassign() {
+// auto d = fit::defer<fit::Closure>([] { puts("This runs first."); });
+// d = fit::defer<fit::Closure>([] { puts("This runs afterwards."); });
+// }
+template <typename T>
+inline DeferredAction<T> defer(T target) {
+ return DeferredAction<T>(std::move(target));
+}
+
+// Alias for a deferred_action using a fit::Callback.
+using DeferredCallback = DeferredAction<fit::Callback<void()>>;
+
+// Defers execution of a fit::Callback with no arguments. See |fit::defer| for
+// details.
+inline DeferredCallback deferCallback(fit::Callback<void()> target) {
+ return DeferredCallback(std::move(target));
+}
+
+} // namespace fit
+} // namespace gfxstream::guest
diff --git a/src/gfxstream/guest/android-emu/aemu/base/fit/Function.h b/src/gfxstream/guest/android-emu/aemu/base/fit/Function.h
new file mode 100644
index 00000000000..fe8e5ea67b7
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/fit/Function.h
@@ -0,0 +1,513 @@
+// 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.
+
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include "FunctionInternal.h"
+#include "UtilityInternal.h"
+
+namespace gfxstream::guest {
+namespace fit {
+
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+class FunctionImpl;
+
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+class CallbackImpl;
+
+// The default size allowance for storing a target inline within a function
+// object, in bytes. This default allows for inline storage of targets
+// as big as two pointers, such as an object pointer and a pointer to a member
+// function.
+constexpr size_t kDefaultInlineTargetSize = sizeof(void*) * 2;
+
+// A |fit::Function| is a move-only polymorphic function wrapper.
+//
+// If you need a class with similar characteristics that also ensures
+// "run-once" semantics (such as callbacks shared with timeouts, or for
+// service requests with redundant, failover, or fallback service providers),
+// see |fit::Callback|.
+//
+// |fit::Function<T>| behaves like |std::function<T>| except that it is
+// move-only instead of copyable, so it can hold targets that cannot be copied,
+// such as mutable lambdas, and immutable lambdas that capture move-only
+// objects.
+//
+// Targets of up to |inlineTargetSize| bytes in size (rounded up for memory
+// alignment) are stored inline within the function object without incurring
+// any heap allocation. Larger callable objects will be moved to the heap as
+// required.
+//
+// See also |fit::InlineFunction<T, size>| for more control over allocation
+// behavior.
+//
+// SYNOPSIS
+//
+// |T| is the function's signature. e.g. void(int, std::string).
+//
+// |inlineTargetSize| is the minimum size of target that is guaranteed to
+// fit within a function without requiring heap allocation.
+// Defaults to |kDefaultInlineTargetSize|.
+//
+// Class members are documented in |fit::FunctionImpl|, below.
+//
+// EXAMPLES
+//
+// -
+// https://fuchsia.googlesource.com/fuchsia/+/HEAD/sdk/lib/fit/test/examples/function_example1.cc
+// -
+// https://fuchsia.googlesource.com/fuchsia/+/HEAD/sdk/lib/fit/test/examples/function_example2.cc
+//
+template <typename T, size_t inlineTargetSize = kDefaultInlineTargetSize>
+using function = FunctionImpl<inlineTargetSize, /*requireInline=*/false, T>;
+
+// A move-only callable object wrapper that forces callables to be stored inline
+// and never performs heap allocation.
+//
+// Behaves just like |fit::Function<T, inlineTargetSize>| except that
+// attempting to store a target larger than |inlineTargetSize| will fail to
+// compile.
+template <typename T, size_t inlineTargetSize = kDefaultInlineTargetSize>
+using InlineFunction = FunctionImpl<inlineTargetSize,
+ /*requireInline=*/true,
+ T>;
+
+// Synonym for a function which takes no arguments and produces no result.
+using closure = function<void()>;
+
+// A |fit::Callback| is a move-only polymorphic function wrapper that also
+// ensures "run-once" semantics (such as callbacks shared with timeouts, or for
+// service requests with redundant, failover, or fallback service providers).
+// A |fit::Callback| releases it's resources after the first call, and can be
+// inspected before calling, so a potential caller can know if it should call
+// the function, or skip the call because the target was already called.
+//
+// If you need a move-only function class with typical function characteristics,
+// that permits multiple invocations of the same function, see |fit::Function|.
+//
+// |fit::Callback<T>| behaves like |std::function<T>| except:
+//
+// 1. It is move-only instead of copyable, so it can hold targets that cannot
+// be copied, such as mutable lambdas, and immutable lambdas that capture
+// move-only objects.
+// 2. On the first call to invoke a |fit::Callback|, the target function held
+// by the |fit::Callback| cannot be called again.
+//
+// When a |fit::Callback| is invoked for the first time, the target function is
+// released and destructed, along with any resources owned by that function
+// (typically the objects captured by a lambda).
+//
+// A |fit::Callback| in the "already called" state has the same state as a
+// |fit::Callback| that has been assigned to |nullptr|. It can be compared to
+// |nullptr| (via "==" or "!=", and its "operator bool()" returns false, which
+// provides a convenient way to gate whether or not the |fit::Callback| should
+// be called. (Note that invoking an empty |fit::Callback| or |fit::Function|
+// will cause a program abort!)
+//
+// As an example, sharing |fit::Callback| between both a service and a timeout
+// might look something like this:
+//
+// void service_with_timeout(fit::Callback<void(bool)> cb, uint timeout_ms) {
+// service_request([cb = cb.share()]() mutable { if (cb) cb(false); });
+// timeout(timeout_ms, [cb = std::move(cb)]() mutable { if (cb) cb(true); });
+// }
+//
+// Since |fit::Callback| objects are move-only, and not copyable, duplicate
+// references to the same |fit::Callback| can be obtained via share(), as shown
+// in the example above. This method converts the |fit::Callback| into a
+// reference-counted version of the |fit::Callback| and returns a copy of the
+// reference as another |fit::Callback| with the same target function.
+//
+// What is notable about |fit::Callback<T>.share()| is that invoking any shared
+// copy will "nullify" all shared copies, as shown in the example.
+//
+// Note that |fit::Callback| is NOT thread-safe by default. If multi-threaded
+// support is required, you would need to implement your own mutex, or similar
+// guard, before checking and calling a |fit::Callback|.
+//
+// Targets of up to |inlineTargetSize| bytes in size (rounded up for memory
+// alignment) are stored inline within the callback object without incurring
+// any heap allocation. Larger callable objects will be moved to the heap as
+// required.
+//
+// See also |fit::inline_callback<T, size>| for more control over allocation
+// behavior.
+//
+// SYNOPSIS
+//
+// |T| is the callback's signature. e.g. void(int, std::string).
+//
+// |inlineTargetSize| is the minimum size of target that is guaranteed to
+// fit within a callback without requiring heap allocation.
+// Defaults to |kDefaultInlineTargetSize|.
+//
+// Class members are documented in |fit::CallbackImpl|, below.
+//
+template <typename T, size_t inlineTargetSize = kDefaultInlineTargetSize>
+using Callback = CallbackImpl<inlineTargetSize, /*requireInline=*/false, T>;
+
+// A move-only, run-once, callable object wrapper that forces callables to be
+// stored inline and never performs heap allocation.
+//
+// Behaves just like |fit::Callback<T, inlineTargetSize>| except that
+// attempting to store a target larger than |inlineTargetSize| will fail to
+// compile.
+template <typename T, size_t inlineTargetSize = kDefaultInlineTargetSize>
+using InlineCallback = CallbackImpl<inlineTargetSize,
+ /*requireInline=*/true,
+ T>;
+
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+class FunctionImpl<inlineTargetSize, requireInline, Result(Args...)> final
+ : private gfxstream::guest::fit::internal::
+ function_base<inlineTargetSize, requireInline, Result(Args...)> {
+ using Base = gfxstream::guest::fit::internal::
+ function_base<inlineTargetSize, requireInline, Result(Args...)>;
+
+ // function_base requires private access during share()
+ friend class gfxstream::guest::fit::internal::
+ function_base<inlineTargetSize, requireInline, Result(Args...)>;
+
+ // supports target() for shared functions
+ friend const void* gfxstream::guest::fit::internal::get_target_type_id<>(
+ const FunctionImpl<inlineTargetSize, requireInline, Result(Args...)>&);
+
+ template <typename U>
+ using NotSelfType = gfxstream::guest::fit::internal::NotSameType<FunctionImpl, U>;
+
+ template <typename... Conditions>
+ using RequiresConditions = gfxstream::guest::fit::internal::RequiresConditions<Conditions...>;
+
+ template <typename... Conditions>
+ using AssignmentRequiresConditions =
+ gfxstream::guest::fit::internal::AssignmentRequiresConditions<FunctionImpl&, Conditions...>;
+
+public:
+ // The function's result type.
+ using typename Base::result_type;
+
+ // Initializes an empty (null) function. Attempting to call an empty
+ // function will abort the program.
+ FunctionImpl() = default;
+
+ // Creates a function with an empty target (same outcome as the default
+ // constructor).
+ FunctionImpl(decltype(nullptr)) : Base(nullptr) {}
+
+ // Creates a function bound to the specified function pointer.
+ // If target == nullptr, assigns an empty target.
+ FunctionImpl(Result (*target)(Args...)) : Base(target) {}
+
+ // Creates a function bound to the specified callable object.
+ // If target == nullptr, assigns an empty target.
+ //
+ // For functors, we need to capture the raw type but also restrict on the
+ // existence of an appropriate operator () to resolve overloads and implicit
+ // casts properly.
+ //
+ // Note that specializations of this template method that take fit::Callback
+ // objects as the target Callable are deleted (see below).
+ template <typename Callable,
+ RequiresConditions<
+ std::is_convertible<decltype(std::declval<Callable&>()(std::declval<Args>()...)),
+ result_type>,
+ NotSelfType<Callable>> = true>
+ FunctionImpl(Callable&& target) : Base(std::forward<Callable>(target)) {}
+
+ // Deletes the specializations of FunctionImpl(Callable) that would allow
+ // a |fit::Function| to be constructed from a |fit::Callback|. This prevents
+ // unexpected behavior of a |fit::Function| that would otherwise fail after
+ // one call. To explicitly allow this, simply wrap the |fit::Callback| in a
+ // pass-through lambda before passing it to the |fit::Function|.
+ template <size_t otherInlineTargetSize, bool otherRequireInline>
+ FunctionImpl(gfxstream::guest::fit::CallbackImpl<otherInlineTargetSize,
+ otherRequireInline,
+ Result(Args...)>) = delete;
+
+ // Creates a function with a target moved from another function,
+ // leaving the other function with an empty target.
+ FunctionImpl(FunctionImpl&& other) : Base(static_cast<Base&&>(other)) {}
+
+ // Destroys the function, releasing its target.
+ ~FunctionImpl() = default;
+
+ // Assigns the function to an empty target. Attempting to invoke the
+ // function will abort the program.
+ FunctionImpl& operator=(decltype(nullptr)) {
+ Base::assign(nullptr);
+ return *this;
+ }
+
+ // Assigns the function to the specified callable object. If target ==
+ // nullptr, assigns an empty target.
+ //
+ // For functors, we need to capture the raw type but also restrict on the
+ // existence of an appropriate operator () to resolve overloads and implicit
+ // casts properly.
+ //
+ // Note that specializations of this template method that take fit::Callback
+ // objects as the target Callable are deleted (see below).
+ template <typename Callable>
+ AssignmentRequiresConditions<
+ std::is_convertible<decltype(std::declval<Callable&>()(std::declval<Args>()...)),
+ result_type>,
+ NotSelfType<Callable>>
+ operator=(Callable&& target) {
+ Base::assign(std::forward<Callable>(target));
+ return *this;
+ }
+
+ // Deletes the specializations of operator=(Callable) that would allow
+ // a |fit::Function| to be assigned from a |fit::Callback|. This
+ // prevents unexpected behavior of a |fit::Function| that would otherwise
+ // fail after one call. To explicitly allow this, simply wrap the
+ // |fit::Callback| in a pass-through lambda before assigning it to the
+ // |fit::Function|.
+ template <size_t otherInlineTargetSize, bool otherRequireInline>
+ FunctionImpl& operator=(gfxstream::guest::fit::CallbackImpl<otherInlineTargetSize,
+ otherRequireInline,
+ Result(Args...)>) = delete;
+
+ // Move assignment
+ FunctionImpl& operator=(FunctionImpl&& other) {
+ if (&other == this)
+ return *this;
+ Base::assign(static_cast<Base&&>(other));
+ return *this;
+ }
+
+ // Swaps the functions' targets.
+ void swap(FunctionImpl& other) { Base::swap(other); }
+
+ // Returns a pointer to the function's target.
+ using Base::target;
+
+ // Returns true if the function has a non-empty target.
+ using Base::operator bool;
+
+ // Invokes the function's target.
+ // Aborts if the function's target is empty.
+ Result operator()(Args... args) const { return Base::invoke(std::forward<Args>(args)...); }
+
+ // Returns a new function object that invokes the same target.
+ // The target itself is not copied; it is moved to the heap and its
+ // lifetime is extended until all references have been released.
+ //
+ // Note: This method is not supported on |fit::InlineFunction<>|
+ // because it may incur a heap allocation which is contrary to
+ // the stated purpose of |fit::InlineFunction<>|.
+ FunctionImpl share() {
+ FunctionImpl copy;
+ Base::template share_with<FunctionImpl>(copy);
+ return copy;
+ }
+};
+
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+void swap(FunctionImpl<inlineTargetSize, requireInline, Result, Args...>& a,
+ FunctionImpl<inlineTargetSize, requireInline, Result, Args...>& b) {
+ a.swap(b);
+}
+
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+bool operator==(const FunctionImpl<inlineTargetSize, requireInline, Result, Args...>& f,
+ decltype(nullptr)) {
+ return !f;
+}
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+bool operator==(decltype(nullptr),
+ const FunctionImpl<inlineTargetSize, requireInline, Result, Args...>& f) {
+ return !f;
+}
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+bool operator!=(const FunctionImpl<inlineTargetSize, requireInline, Result, Args...>& f,
+ decltype(nullptr)) {
+ return !!f;
+}
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+bool operator!=(decltype(nullptr),
+ const FunctionImpl<inlineTargetSize, requireInline, Result, Args...>& f) {
+ return !!f;
+}
+
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+class CallbackImpl<inlineTargetSize, requireInline, Result(Args...)> final
+ : private gfxstream::guest::fit::internal::
+ function_base<inlineTargetSize, requireInline, Result(Args...)> {
+ using Base = gfxstream::guest::fit::internal::
+ function_base<inlineTargetSize, requireInline, Result(Args...)>;
+
+ // function_base requires private access during share()
+ friend class gfxstream::guest::fit::internal::
+ function_base<inlineTargetSize, requireInline, Result(Args...)>;
+
+ // supports target() for shared functions
+ friend const void* gfxstream::guest::fit::internal::get_target_type_id<>(
+ const CallbackImpl<inlineTargetSize, requireInline, Result(Args...)>&);
+
+ template <typename U>
+ using NotSelfType = gfxstream::guest::fit::internal::NotSameType<CallbackImpl, U>;
+
+ template <typename... Conditions>
+ using RequiresConditions = gfxstream::guest::fit::internal::RequiresConditions<Conditions...>;
+
+ template <typename... Conditions>
+ using AssignmentRequiresConditions =
+ gfxstream::guest::fit::internal::AssignmentRequiresConditions<CallbackImpl&, Conditions...>;
+
+public:
+ // The callback function's result type.
+ using typename Base::result_type;
+
+ // Initializes an empty (null) callback. Attempting to call an empty
+ // callback will abort the program.
+ CallbackImpl() = default;
+
+ // Creates a callback with an empty target (same outcome as the default
+ // constructor).
+ CallbackImpl(decltype(nullptr)) : Base(nullptr) {}
+
+ // Creates a callback bound to the specified function pointer.
+ // If target == nullptr, assigns an empty target.
+ CallbackImpl(Result (*target)(Args...)) : Base(target) {}
+
+ // Creates a callback bound to the specified callable object.
+ // If target == nullptr, assigns an empty target.
+ //
+ // For functors, we need to capture the raw type but also restrict on the
+ // existence of an appropriate operator () to resolve overloads and implicit
+ // casts properly.
+ template <typename Callable,
+ RequiresConditions<
+ std::is_convertible<decltype(std::declval<Callable&>()(std::declval<Args>()...)),
+ result_type>,
+ NotSelfType<Callable>> = true>
+ CallbackImpl(Callable&& target) : Base(std::forward<Callable>(target)) {}
+
+ // Creates a callback with a target moved from another callback,
+ // leaving the other callback with an empty target.
+ CallbackImpl(CallbackImpl&& other) : Base(static_cast<Base&&>(other)) {}
+
+ // Destroys the callback, releasing its target.
+ ~CallbackImpl() = default;
+
+ // Assigns the callback to an empty target. Attempting to invoke the
+ // callback will abort the program.
+ CallbackImpl& operator=(decltype(nullptr)) {
+ Base::assign(nullptr);
+ return *this;
+ }
+
+ // Assigns the callback to the specified callable object. If target ==
+ // nullptr, assigns an empty target.
+ //
+ // For functors, we need to capture the raw type but also restrict on the
+ // existence of an appropriate operator () to resolve overloads and implicit
+ // casts properly.
+ template <typename Callable>
+ AssignmentRequiresConditions<
+ std::is_convertible<decltype(std::declval<Callable&>()(std::declval<Args>()...)),
+ result_type>,
+ NotSelfType<Callable>>
+ operator=(Callable&& target) {
+ Base::assign(std::forward<Callable>(target));
+ return *this;
+ }
+
+ // Move assignment
+ CallbackImpl& operator=(CallbackImpl&& other) {
+ if (&other == this)
+ return *this;
+ Base::assign(static_cast<Base&&>(other));
+ return *this;
+ }
+
+ // Swaps the callbacks' targets.
+ void swap(CallbackImpl& other) { Base::swap(other); }
+
+ // Returns a pointer to the callback's target.
+ using Base::target;
+
+ // Returns true if the callback has a non-empty target.
+ using Base::operator bool;
+
+ // Invokes the callback's target.
+ // Aborts if the callback's target is empty.
+ // |fit::Callback| must be non-const to invoke. Before the target function
+ // is actually called, the fit::Callback will be set to the default empty
+ // state (== nullptr, and operator bool() will subsequently return |false|).
+ // The target function will then be released after the function is called.
+ // If the callback was shared, any remaining copies will also be cleared.
+ Result operator()(Args... args) {
+ auto temp = std::move(*this);
+ return temp.invoke(std::forward<Args>(args)...);
+ }
+
+ // Returns a new callback object that invokes the same target.
+ // The target itself is not copied; it is moved to the heap and its
+ // lifetime is extended until all references have been released.
+ // For |fit::Callback| (unlike fit::Function), the first invocation of the
+ // callback will release all references to the target. All callbacks
+ // derived from the same original callback (via share()) will be cleared,
+ // as if set to |nullptr|, and "operator bool()" will return false.
+ //
+ // Note: This method is not supported on |fit::InlineFunction<>|
+ // because it may incur a heap allocation which is contrary to
+ // the stated purpose of |fit::InlineFunction<>|.
+ CallbackImpl share() {
+ CallbackImpl copy;
+ Base::template share_with<CallbackImpl>(copy);
+ return copy;
+ }
+};
+
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+void swap(CallbackImpl<inlineTargetSize, requireInline, Result, Args...>& a,
+ CallbackImpl<inlineTargetSize, requireInline, Result, Args...>& b) {
+ a.swap(b);
+}
+
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+bool operator==(const CallbackImpl<inlineTargetSize, requireInline, Result, Args...>& f,
+ decltype(nullptr)) {
+ return !f;
+}
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+bool operator==(decltype(nullptr),
+ const CallbackImpl<inlineTargetSize, requireInline, Result, Args...>& f) {
+ return !f;
+}
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+bool operator!=(const CallbackImpl<inlineTargetSize, requireInline, Result, Args...>& f,
+ decltype(nullptr)) {
+ return !!f;
+}
+template <size_t inlineTargetSize, bool requireInline, typename Result, typename... Args>
+bool operator!=(decltype(nullptr),
+ const CallbackImpl<inlineTargetSize, requireInline, Result, Args...>& f) {
+ return !!f;
+}
+
+// Returns a Callable object that invokes a member function of an object.
+template <typename R, typename T, typename... Args>
+auto bindMember(T* instance, R (T::*fn)(Args...)) {
+ return [instance, fn](Args... args) { return (instance->*fn)(std::forward<Args>(args)...); };
+}
+
+} // namespace fit
+} // namespace gfxstream::guest
diff --git a/src/gfxstream/guest/android-emu/aemu/base/fit/FunctionInternal.h b/src/gfxstream/guest/android-emu/aemu/base/fit/FunctionInternal.h
new file mode 100644
index 00000000000..fbfae60679b
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/fit/FunctionInternal.h
@@ -0,0 +1,456 @@
+// 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.
+
+// Copyright 2017 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <stddef.h>
+#include <stdlib.h>
+
+#include <memory>
+
+#include "Nullable.h"
+
+#include <new>
+#include <type_traits>
+#include <utility>
+
+namespace gfxstream::guest {
+namespace fit {
+namespace internal {
+
+template <typename Result, typename... Args>
+struct target_ops final {
+ const void* (*target_type_id)(void* bits, const void* impl_ops);
+ void* (*get)(void* bits);
+ Result (*invoke)(void* bits, Args... args);
+ void (*move)(void* from_bits, void* to_bits);
+ void (*destroy)(void* bits);
+};
+
+template <typename Callable, bool is_inline, bool is_shared, typename Result, typename... Args>
+struct target;
+
+inline const void* unshared_target_type_id(void* bits, const void* impl_ops) {
+ return impl_ops;
+}
+
+// vtable for nullptr (empty target function)
+
+template <typename Result, typename... Args>
+struct target<decltype(nullptr),
+ /*is_inline=*/true,
+ /*is_shared=*/false,
+ Result,
+ Args...>
+ final {
+ static Result invoke(void* bits, Args... args) { __builtin_abort(); }
+
+ static const target_ops<Result, Args...> ops;
+};
+
+inline void* null_target_get(void* bits) {
+ return nullptr;
+}
+inline void null_target_move(void* from_bits, void* to_bits) {}
+inline void null_target_destroy(void* bits) {}
+
+template <typename Result, typename... Args>
+constexpr target_ops<Result, Args...> target<decltype(nullptr),
+ /*is_inline=*/true,
+ /*is_shared=*/false,
+ Result,
+ Args...>::ops = {
+ &unshared_target_type_id, &null_target_get, &target::invoke, &null_target_move,
+ &null_target_destroy};
+
+// vtable for inline target function
+
+template <typename Callable, typename Result, typename... Args>
+struct target<Callable,
+ /*is_inline=*/true,
+ /*is_shared=*/false,
+ Result,
+ Args...>
+ final {
+ template <typename Callable_>
+ static void initialize(void* bits, Callable_&& target) {
+ new (bits) Callable(std::forward<Callable_>(target));
+ }
+ static Result invoke(void* bits, Args... args) {
+ auto& target = *static_cast<Callable*>(bits);
+ return target(std::forward<Args>(args)...);
+ }
+ static void move(void* from_bits, void* to_bits) {
+ auto& from_target = *static_cast<Callable*>(from_bits);
+ new (to_bits) Callable(std::move(from_target));
+ from_target.~Callable();
+ }
+ static void destroy(void* bits) {
+ auto& target = *static_cast<Callable*>(bits);
+ target.~Callable();
+ }
+
+ static const target_ops<Result, Args...> ops;
+};
+
+inline void* inline_target_get(void* bits) {
+ return bits;
+}
+
+template <typename Callable, typename Result, typename... Args>
+constexpr target_ops<Result, Args...> target<Callable,
+ /*is_inline=*/true,
+ /*is_shared=*/false,
+ Result,
+ Args...>::ops = {
+ &unshared_target_type_id, &inline_target_get, &target::invoke, &target::move, &target::destroy};
+
+// vtable for pointer to target function
+
+template <typename Callable, typename Result, typename... Args>
+struct target<Callable,
+ /*is_inline=*/false,
+ /*is_shared=*/false,
+ Result,
+ Args...>
+ final {
+ template <typename Callable_>
+ static void initialize(void* bits, Callable_&& target) {
+ auto ptr = static_cast<Callable**>(bits);
+ *ptr = new Callable(std::forward<Callable_>(target));
+ }
+ static Result invoke(void* bits, Args... args) {
+ auto& target = **static_cast<Callable**>(bits);
+ return target(std::forward<Args>(args)...);
+ }
+ static void move(void* from_bits, void* to_bits) {
+ auto from_ptr = static_cast<Callable**>(from_bits);
+ auto to_ptr = static_cast<Callable**>(to_bits);
+ *to_ptr = *from_ptr;
+ }
+ static void destroy(void* bits) {
+ auto ptr = static_cast<Callable**>(bits);
+ delete *ptr;
+ }
+
+ static const target_ops<Result, Args...> ops;
+};
+
+inline void* heap_target_get(void* bits) {
+ return *static_cast<void**>(bits);
+}
+
+template <typename Callable, typename Result, typename... Args>
+constexpr target_ops<Result, Args...> target<Callable,
+ /*is_inline=*/false,
+ /*is_shared=*/false,
+ Result,
+ Args...>::ops = {
+ &unshared_target_type_id, &heap_target_get, &target::invoke, &target::move, &target::destroy};
+
+// vtable for fit::function std::shared_ptr to target function
+
+template <typename SharedFunction>
+const void* get_target_type_id(const SharedFunction& function_or_callback) {
+ return function_or_callback.target_type_id();
+}
+
+// For this vtable,
+// Callable by definition will be either a fit::function or fit::callback
+template <typename SharedFunction, typename Result, typename... Args>
+struct target<SharedFunction,
+ /*is_inline=*/false,
+ /*is_shared=*/true,
+ Result,
+ Args...>
+ final {
+ static void initialize(void* bits, SharedFunction target) {
+ new (bits) std::shared_ptr<SharedFunction>(
+ std::move(std::make_shared<SharedFunction>(std::move(target))));
+ }
+ static void copy_shared_ptr(void* from_bits, void* to_bits) {
+ auto& from_shared_ptr = *static_cast<std::shared_ptr<SharedFunction>*>(from_bits);
+ new (to_bits) std::shared_ptr<SharedFunction>(from_shared_ptr);
+ }
+ static const void* target_type_id(void* bits, const void* impl_ops) {
+ auto& function_or_callback = **static_cast<std::shared_ptr<SharedFunction>*>(bits);
+ return gfxstream::guest::fit::internal::get_target_type_id(function_or_callback);
+ }
+ static void* get(void* bits) {
+ auto& function_or_callback = **static_cast<std::shared_ptr<SharedFunction>*>(bits);
+ return function_or_callback.template target<SharedFunction>(
+ /*check=*/false); // void* will fail the check
+ }
+ static Result invoke(void* bits, Args... args) {
+ auto& function_or_callback = **static_cast<std::shared_ptr<SharedFunction>*>(bits);
+ return function_or_callback(std::forward<Args>(args)...);
+ }
+ static void move(void* from_bits, void* to_bits) {
+ auto from_shared_ptr = std::move(*static_cast<std::shared_ptr<SharedFunction>*>(from_bits));
+ new (to_bits) std::shared_ptr<SharedFunction>(std::move(from_shared_ptr));
+ }
+ static void destroy(void* bits) {
+ static_cast<std::shared_ptr<SharedFunction>*>(bits)->reset();
+ }
+
+ static const target_ops<Result, Args...> ops;
+};
+
+template <typename SharedFunction, typename Result, typename... Args>
+constexpr target_ops<Result, Args...> target<SharedFunction,
+ /*is_inline=*/false,
+ /*is_shared=*/true,
+ Result,
+ Args...>::ops = {
+ &target::target_type_id, &target::get, &target::invoke, &target::move, &target::destroy};
+
+template <size_t inline_target_size, bool requireInline, typename Result, typename... Args>
+class function_base;
+
+// Function implementation details.
+// See |fit::function| and |fit::callback| documentation for more information.
+template <size_t inline_target_size, bool requireInline, typename Result, typename... Args>
+class function_base<inline_target_size, requireInline, Result(Args...)> {
+ using ops_type = const target_ops<Result, Args...>*;
+ using storage_type = typename std::aligned_storage<(
+ inline_target_size >= sizeof(void*) ? inline_target_size : sizeof(void*))>::
+ type; // avoid including <algorithm> for max
+ template <typename Callable>
+ using target_type = target<Callable,
+ (sizeof(Callable) <= sizeof(storage_type)),
+ /*is_shared=*/false,
+ Result,
+ Args...>;
+ template <typename SharedFunction>
+ using shared_target_type = target<SharedFunction,
+ /*is_inline=*/false,
+ /*is_shared=*/true,
+ Result,
+ Args...>;
+ using null_target_type = target_type<decltype(nullptr)>;
+
+protected:
+ using result_type = Result;
+
+ function_base() { initialize_null_target(); }
+
+ function_base(decltype(nullptr)) { initialize_null_target(); }
+
+ function_base(Result (*target)(Args...)) { initialize_target(target); }
+
+ template <typename Callable,
+ typename = std::enable_if_t<
+ std::is_convertible<decltype(std::declval<Callable&>()(std::declval<Args>()...)),
+ result_type>::value>>
+ function_base(Callable&& target) {
+ initialize_target(std::forward<Callable>(target));
+ }
+
+ function_base(function_base&& other) { move_target_from(std::move(other)); }
+
+ ~function_base() { destroy_target(); }
+
+ // Returns true if the function has a non-empty target.
+ explicit operator bool() const { return ops_->get(&bits_) != nullptr; }
+
+ // Returns a pointer to the function's target.
+ // If |check| is true (the default), the function _may_ abort if the
+ // caller tries to assign the target to a varible of the wrong type. (This
+ // check is currently skipped for share()d objects.)
+ // Note the shared pointer vtable must set |check| to false to assign the
+ // target to |void*|.
+ template <typename Callable>
+ Callable* target(bool check = true) {
+ if (check)
+ check_target_type<Callable>();
+ return static_cast<Callable*>(ops_->get(&bits_));
+ }
+
+ // Returns a pointer to the function's target (const version).
+ // If |check| is true (the default), the function _may_ abort if the
+ // caller tries to assign the target to a varible of the wrong type. (This
+ // check is currently skipped for share()d objects.)
+ // Note the shared pointer vtable must set |check| to false to assign the
+ // target to |void*|.
+ template <typename Callable>
+ const Callable* target(bool check = true) const {
+ if (check)
+ check_target_type<Callable>();
+ return static_cast<Callable*>(ops_->get(&bits_));
+ }
+
+ // Used by the derived "impl" classes to implement share().
+ //
+ // The caller creates a new object of the same type as itself, and passes in
+ // the empty object. This function first checks if |this| is already shared,
+ // and if not, creates a new version of itself containing a
+ // |std::shared_ptr| to its original self, and updates |ops_| to the vtable
+ // for the shared version.
+ //
+ // Then it copies its |shared_ptr| to the |bits_| of the given |copy|,
+ // and assigns the same shared pointer vtable to the copy's |ops_|.
+ //
+ // The target itself is not copied; it is moved to the heap and its
+ // lifetime is extended until all references have been released.
+ //
+ // Note: This method is not supported on |fit::InlineFunction<>|
+ // because it may incur a heap allocation which is contrary to
+ // the stated purpose of |fit::InlineFunction<>|.
+ template <typename SharedFunction>
+ void share_with(SharedFunction& copy) {
+ static_assert(!requireInline, "Inline functions cannot be shared.");
+ if (ops_->get(&bits_) != nullptr) {
+ if (ops_ != &shared_target_type<SharedFunction>::ops) {
+ convert_to_shared_target<SharedFunction>();
+ }
+ copy_shared_target_to(copy);
+ }
+ }
+
+ // Used by derived "impl" classes to implement operator()().
+ // Invokes the function's target.
+ // Note that fit::callback will release the target immediately after
+ // invoke() (also affecting any share()d copies).
+ // Aborts if the function's target is empty.
+ Result invoke(Args... args) const { return ops_->invoke(&bits_, std::forward<Args>(args)...); }
+
+ // Used by derived "impl" classes to implement operator=().
+ // Assigns an empty target.
+ void assign(decltype(nullptr)) {
+ destroy_target();
+ initialize_null_target();
+ }
+
+ // Used by derived "impl" classes to implement operator=().
+ // Assigns the function's target.
+ // If target == nullptr, assigns an empty target.
+ template <typename Callable,
+ typename = std::enable_if_t<
+ std::is_convertible<decltype(std::declval<Callable&>()(std::declval<Args>()...)),
+ result_type>::value>>
+ void assign(Callable&& target) {
+ destroy_target();
+ initialize_target(std::forward<Callable>(target));
+ }
+
+ // Used by derived "impl" classes to implement operator=().
+ // Assigns the function with a target moved from another function,
+ // leaving the other function with an empty target.
+ void assign(function_base&& other) {
+ destroy_target();
+ move_target_from(std::move(other));
+ }
+
+ void swap(function_base& other) {
+ if (&other == this)
+ return;
+ ops_type temp_ops = ops_;
+ storage_type temp_bits;
+ ops_->move(&bits_, &temp_bits);
+
+ ops_ = other.ops_;
+ other.ops_->move(&other.bits_, &bits_);
+
+ other.ops_ = temp_ops;
+ temp_ops->move(&temp_bits, &other.bits_);
+ }
+
+ // returns an opaque ID unique to the |Callable| type of the target.
+ // Used by check_target_type.
+ const void* target_type_id() const { return ops_->target_type_id(&bits_, ops_); }
+
+ // Deleted copy constructor and assign. |function_base| implementations are
+ // move-only.
+ function_base(const function_base& other) = delete;
+ function_base& operator=(const function_base& other) = delete;
+
+ // Move assignment must be provided by subclasses.
+ function_base& operator=(function_base&& other) = delete;
+
+private:
+ // Implements the move operation, used by move construction and move
+ // assignment. Leaves other target initialized to null.
+ void move_target_from(function_base&& other) {
+ ops_ = other.ops_;
+ other.ops_->move(&other.bits_, &bits_);
+ other.initialize_null_target();
+ }
+
+ // fit::function and fit::callback are not directly copyable, but share()
+ // will create shared references to the original object. This method
+ // implements the copy operation for the |std::shared_ptr| wrapper.
+ template <typename SharedFunction>
+ void copy_shared_target_to(SharedFunction& copy) {
+ copy.destroy_target();
+ assert(ops_ == &shared_target_type<SharedFunction>::ops);
+ shared_target_type<SharedFunction>::copy_shared_ptr(&bits_, &copy.bits_);
+ copy.ops_ = ops_;
+ }
+
+ // assumes target is uninitialized
+ void initialize_null_target() { ops_ = &null_target_type::ops; }
+
+ // target may or may not be initialized.
+ template <typename Callable>
+ void initialize_target(Callable&& target) {
+ // Convert function or function references to function pointer.
+ using DecayedCallable = std::decay_t<Callable>;
+ static_assert(
+ std::alignment_of<DecayedCallable>::value <= std::alignment_of<storage_type>::value,
+ "Alignment of Callable must be <= alignment of max_align_t.");
+ static_assert(!requireInline || sizeof(DecayedCallable) <= inline_target_size,
+ "Callable too large to store inline as requested.");
+ if (is_null(target)) {
+ initialize_null_target();
+ } else {
+ ops_ = &target_type<DecayedCallable>::ops;
+ target_type<DecayedCallable>::initialize(&bits_, std::forward<Callable>(target));
+ }
+ }
+
+ // assumes target is uninitialized
+ template <typename SharedFunction>
+ void convert_to_shared_target() {
+ shared_target_type<SharedFunction>::initialize(
+ &bits_, std::move(*static_cast<SharedFunction*>(this)));
+ ops_ = &shared_target_type<SharedFunction>::ops;
+ }
+
+ // leaves target uninitialized
+ void destroy_target() { ops_->destroy(&bits_); }
+
+ // Called by target() if |check| is true.
+ // Checks the template parameter, usually inferred from the context of
+ // the call to target(), and aborts the program if it can determine that
+ // the Callable type is not compatible with the function's Result and Args.
+ template <typename Callable>
+ void check_target_type() const {
+ if (target_type<Callable>::ops.target_type_id(nullptr, &target_type<Callable>::ops) !=
+ target_type_id()) {
+ __builtin_abort();
+ }
+ }
+
+ ops_type ops_;
+ mutable storage_type bits_;
+};
+
+} // namespace internal
+
+} // namespace fit
+} // namespace gfxstream::guest
diff --git a/src/gfxstream/guest/android-emu/aemu/base/fit/Nullable.h b/src/gfxstream/guest/android-emu/aemu/base/fit/Nullable.h
new file mode 100644
index 00000000000..02b33372f8a
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/fit/Nullable.h
@@ -0,0 +1,265 @@
+// 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.
+
+// Copyright 2018 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <assert.h>
+
+#include <optional>
+#include <type_traits>
+#include <utility>
+
+namespace gfxstream::guest {
+namespace fit {
+
+// Determines whether a type can be compared with nullptr.
+template <typename T, typename Comparable = bool>
+struct IsComparableWithNull : public std::false_type {};
+template <typename T>
+struct IsComparableWithNull<T, decltype(std::declval<const T&>() == nullptr)>
+ : public std::true_type {};
+
+// Suppress the warning when the compiler can see that a nullable value is
+// never equal to nullptr.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Waddress"
+template <typename T, std::enable_if_t<IsComparableWithNull<T>::value, bool> = true>
+constexpr inline bool isNull(T&& value) {
+ return std::forward<T>(value) == nullptr;
+}
+#pragma GCC diagnostic pop
+
+template <typename T, std::enable_if_t<!IsComparableWithNull<T>::value, bool> = false>
+constexpr inline bool isNull(T&&) {
+ return false;
+}
+
+// Determines whether a type can be initialized, assigned, and compared
+// with nullptr.
+template <typename T>
+struct IsNullable
+ : public std::integral_constant<bool,
+ std::is_constructible<T, decltype(nullptr)>::value &&
+ std::is_assignable<T&, decltype(nullptr)>::value &&
+ IsComparableWithNull<T>::value> {};
+template <>
+struct IsNullable<void> : public std::false_type {};
+
+// Holds a value or nullptr.
+//
+// This class is similar to |std::optional<T>| except that it uses less
+// storage when the value type can be initialized, assigned, and compared
+// with nullptr.
+//
+// For example:
+// - sizeof(fit::nullable<void*>) == sizeof(void*)
+// - sizeof(std::optional<void*>) == sizeof(struct { bool; void*; })
+// - sizeof(fit::nullable<int>) == sizeof(struct { bool; int; })
+// - sizeof(std::optional<int>) == sizeof(struct { bool; int; })
+//
+// TODO(fxbug.dev/4681): fit::nullable does not precisely mirror
+// std::optional. This should be corrected to avoid surprises when switching
+// between the types.
+template <typename T,
+ bool = (IsNullable<T>::value && std::is_constructible<T, T&&>::value &&
+ std::is_assignable<T&, T&&>::value)>
+class Nullable final {
+public:
+ using value_type = T;
+
+ ~Nullable() = default;
+ constexpr Nullable() = default;
+
+ explicit constexpr Nullable(decltype(nullptr)) {}
+ explicit constexpr Nullable(T value) : mOpt(std::move(value)) {}
+
+ constexpr Nullable(const Nullable& other) = default;
+ constexpr Nullable& operator=(const Nullable& other) = default;
+
+ constexpr Nullable(Nullable&& other) = default;
+ constexpr Nullable& operator=(Nullable&& other) = default;
+
+ constexpr T& value() & { return mOpt.value(); }
+ constexpr const T& value() const& { return mOpt.value(); }
+ constexpr T&& value() && { return std::move(mOpt.value()); }
+ constexpr const T&& value() const&& { return std::move(mOpt.value()); }
+
+ template <typename U = T>
+ constexpr T valueOr(U&& default_value) const {
+ return mOpt.value_or(std::forward<U>(default_value));
+ }
+
+ constexpr T* operator->() { return &*mOpt; }
+ constexpr const T* operator->() const { return &*mOpt; }
+ constexpr T& operator*() { return *mOpt; }
+ constexpr const T& operator*() const { return *mOpt; }
+
+ constexpr bool hasValue() const { return mOpt.has_value(); }
+ explicit constexpr operator bool() const { return hasValue(); }
+
+ constexpr Nullable& operator=(decltype(nullptr)) {
+ reset();
+ return *this;
+ }
+
+ constexpr Nullable& operator=(T value) {
+ mOpt = std::move(value);
+ return *this;
+ }
+
+ constexpr void reset() { mOpt.reset(); }
+
+ constexpr void swap(Nullable& other) { mOpt.swap(other.mOpt); }
+
+private:
+ std::optional<T> mOpt;
+};
+
+template <typename T>
+class Nullable<T, true> final {
+public:
+ using value_type = T;
+
+ constexpr Nullable() : mValue(nullptr) {}
+ explicit constexpr Nullable(decltype(nullptr)) : mValue(nullptr) {}
+ explicit constexpr Nullable(T value) : mValue(std::move(value)) {}
+ constexpr Nullable(const Nullable& other) = default;
+ constexpr Nullable(Nullable&& other) : mValue(std::move(other.value_)) {}
+ ~Nullable() = default;
+
+ constexpr T& value() & {
+ if (hasValue()) {
+ return mValue;
+ } else {
+ __builtin_abort();
+ }
+ }
+ constexpr const T& value() const& {
+ if (hasValue()) {
+ return mValue;
+ } else {
+ __builtin_abort();
+ }
+ }
+ constexpr T&& value() && {
+ if (hasValue()) {
+ return std::move(mValue);
+ } else {
+ __builtin_abort();
+ }
+ }
+ constexpr const T&& value() const&& {
+ if (hasValue()) {
+ return std::move(mValue);
+ } else {
+ __builtin_abort();
+ }
+ }
+
+ template <typename U = T>
+ constexpr T valueOr(U&& default_value) const {
+ return hasValue() ? mValue : static_cast<T>(std::forward<U>(default_value));
+ }
+
+ constexpr T* operator->() { return &mValue; }
+ constexpr const T* operator->() const { return &mValue; }
+ constexpr T& operator*() { return mValue; }
+ constexpr const T& operator*() const { return mValue; }
+
+ constexpr bool hasValue() const { return !(mValue == nullptr); }
+ explicit constexpr operator bool() const { return hasValue(); }
+
+ constexpr Nullable& operator=(const Nullable& other) = default;
+ constexpr Nullable& operator=(Nullable&& other) {
+ mValue = std::move(other.value_);
+ return *this;
+ }
+
+ constexpr Nullable& operator=(decltype(nullptr)) {
+ reset();
+ return *this;
+ }
+
+ constexpr Nullable& operator=(T value) {
+ mValue = std::move(value);
+ return *this;
+ }
+
+ constexpr void reset() { mValue = nullptr; }
+
+ constexpr void swap(Nullable& other) {
+ using std::swap;
+ swap(mValue, other.value_);
+ }
+
+private:
+ T mValue;
+};
+
+template <typename T>
+void swap(Nullable<T>& a, Nullable<T>& b) {
+ a.swap(b);
+}
+
+template <typename T>
+constexpr bool operator==(const Nullable<T>& lhs, decltype(nullptr)) {
+ return !lhs.hasValue();
+}
+template <typename T>
+constexpr bool operator!=(const Nullable<T>& lhs, decltype(nullptr)) {
+ return lhs.hasValue();
+}
+
+template <typename T>
+constexpr bool operator==(decltype(nullptr), const Nullable<T>& rhs) {
+ return !rhs.hasValue();
+}
+template <typename T>
+constexpr bool operator!=(decltype(nullptr), const Nullable<T>& rhs) {
+ return rhs.hasValue();
+}
+
+template <typename T, typename U>
+constexpr bool operator==(const Nullable<T>& lhs, const Nullable<U>& rhs) {
+ return (lhs.hasValue() == rhs.hasValue()) && (!lhs.hasValue() || *lhs == *rhs);
+}
+template <typename T, typename U>
+constexpr bool operator!=(const Nullable<T>& lhs, const Nullable<U>& rhs) {
+ return (lhs.hasValue() != rhs.hasValue()) || (lhs.hasValue() && *lhs != *rhs);
+}
+
+template <typename T, typename U>
+constexpr bool operator==(const Nullable<T>& lhs, const U& rhs) {
+ return (lhs.hasValue() != isNull(rhs)) && (!lhs.hasValue() || *lhs == rhs);
+}
+template <typename T, typename U>
+constexpr bool operator!=(const Nullable<T>& lhs, const U& rhs) {
+ return (lhs.hasValue() == isNull(rhs)) || (lhs.hasValue() && *lhs != rhs);
+}
+
+template <typename T, typename U>
+constexpr bool operator==(const T& lhs, const Nullable<U>& rhs) {
+ return (isNull(lhs) != rhs.hasValue()) && (!rhs.hasValue() || lhs == *rhs);
+}
+template <typename T, typename U>
+constexpr bool operator!=(const T& lhs, const Nullable<U>& rhs) {
+ return (isNull(lhs) == rhs.hasValue()) || (rhs.hasValue() && lhs != *rhs);
+}
+
+} // namespace fit
+} // namespace gfxstream::guest
diff --git a/src/gfxstream/guest/android-emu/aemu/base/fit/README b/src/gfxstream/guest/android-emu/aemu/base/fit/README
new file mode 100644
index 00000000000..4b3eeebe7d7
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/fit/README
@@ -0,0 +1,150 @@
+libfit
+
+Source: https://fuchsia.googlesource.com/fuchsia/+/main/sdk/lib/fit/
+Version: 36303cd2d1611cb1b670235692d01a92e83ecd21
+License:
+
+Copyright 2019 The Fuchsia Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+======
+
+FIT is a lean library of portable C++ abstractions for control flow and
+memory management beyond what is offered by the C++ 17 standard library.
+
+FIT only depends on the C++ language and standard library, including some C++17
+library features. It offers essential enhancements to the C++ standard library
+rather than attempting to replace it or become a framework for writing
+applications. FIT can be thought of as an "annex" that expresses a few ideas
+we wish the C++ standard library might itself implement someday.
+
+FIT is lean.
+
+## What Belongs in FIT
+
+Several Fuchsia SDK libraries, such as *libfidl*, depend on FIT and on the C++
+standard library. As these libraries are broadly used, we must take care in
+deciding what features to include in FIT to avoid burdening developers with
+unnecessary code or dependencies.
+
+In general, the goal is to identify specific abstractions that make sense to
+generalize across the entire ecosystem of Fuchsia C++ applications. These will
+necessarily be somewhat low-level but high impact. We don't want to add code to
+FIT simply because we think it's cool. We need evidence that it is a common
+idiom and that a broad audience of developers will significantly benefit from
+its promotion.
+
+Here are a few criteria to consider:
+
+- Is the feature lightweight, general-purpose, and platform-independent?
+- Is the feature not well served by other means, particularly by the C++
+ standard library?
+- Is the feature needed by a Fuchsia SDK library?
+- Does the feature embody a beneficial idiom that clients of the Fuchsia SDK
+ commonly use?
+- Has the feature been re-implemented many times already leading to code
+ fragmentation that we would like to eliminate?
+
+If in doubt, leave it out. See [Justifications] below.
+
+## What Doesn't Belong in FIT
+
+FIT is not intended to become a catch-all class library.
+
+Specifically prohibited features:
+
+- Features that introduce dependencies on libraries other than the C and C++
+ standard library.
+- Features that only work on certain operating systems.
+- Collection classes where the C++ 17 standard library already offers an
+ adequate (if not perfect) alternative.
+- Classes that impose an implementation burden on clients such as event loops,
+ dispatchers, frameworks, and other glue code.
+
+## Implementation Considerations
+
+FIT is not exception safe (but could be made to be in the future).
+
+## Style Conventions
+
+The API style was modified to fit current android::base library conventions.
+
+In brief:
+
+- Class identifiers are CamelCase
+- Class methods and variable identifiers use "camelCase", class fields use
+ "mCamelCase".
+- Template parameters are `CamelCase`.
+- Preprocessor macros are `UPPER_SNAKE_CASE`.
+
+## Justifications
+
+These sections explain why certain features are in FIT.
+
+### fit::Function
+
+- *libfidl*'s API needs a callable function wrapper with move semantics but
+ C++ 14's `std::function` only supports copyable function objects which forces
+ FIDL to allocate callback state on the heap making programs less efficient
+ and harder to write.
+- Lots of other C++ code uses callbacks extensively and would benefit from move
+ semantics for similar reasons.
+- So we should create a move-only function wrapper to use everywhere.
+
+### fit::Defer
+
+- When writing asynchronous event-driven programs, it can become challenging
+ to ensure that resources remain in scope for the duration of an operation
+ in progress and are subsequently released.
+- The C++ 14 standard library offers several classes with RAII semantics, such
+ as `std::unique_ptr`, which are helpful in these situations. Unfortunately the
+ C++ 14 standard library does not offer affordances for easily invoking a
+ function when a block or object goes out of scope short of implementing a
+ new class from scratch.
+- We have observed several re-implementations of the same idea throughout the
+ system.
+- So we should create a simple way to invoke a function on scope exit.
+
+### fit::Nullable
+
+- Case study: fit::defer has a need to store a closure that may be nullable.
+ We were able to replace its hand-rolled lifetime management code with
+ fit::nullable thereby vastly simplifying its implementation.
+- Case study: fit::future has a need to track its own validity along with
+ a continuation that may or not be present.
+- Case study: We have previously observed bugs where developers were
+ surprised when assigning a null closure to wrappers such as fit::function
+ fit::defer, or fit::future left these objects in a supposedly "valid"
+ but uninvocable state. These objects therefore take care to detect
+ null closures and enter an "invalid" state. Using fit::is_null and
+ fit::nullable makes it easier to eliminate this redundant state and
+ simplifies the API for clients of these wrappers.
+- std::optional can be effective here but it doesn't directly handle nullity
+ so it takes more care to coalesce the null and "not present" states.
+ std::optional also increases the size of the object to carry an extra
+ bool and passing, whereas fit::nullable eliminates this overhead by
+ taking advantage of the underlying value's null state (if there is one).
+- So we introduce fit::nullable to handle both cases systematically while
+ still hewing close to the semantics of std::optional.
diff --git a/src/gfxstream/guest/android-emu/aemu/base/fit/ThreadChecker.h b/src/gfxstream/guest/android-emu/aemu/base/fit/ThreadChecker.h
new file mode 100644
index 00000000000..43d8e5ceaf2
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/fit/ThreadChecker.h
@@ -0,0 +1,87 @@
+// 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.
+
+// Copyright 2016 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// A class for checking that the current thread is/isn't the same as an initial
+// thread.
+
+#pragma once
+
+#include <assert.h>
+
+#include <thread>
+
+#include "ThreadSafety.h"
+
+namespace gfxstream::guest {
+namespace fit {
+
+// A simple class that records the identity of the thread that it was created
+// on, and at later points can tell if the current thread is the same as its
+// creation thread. This class is thread-safe.
+//
+// In addition to providing an explicit check of the current thread,
+// |thread_checker| complies with BasicLockable, checking the current thread
+// when |lock| is called. This allows static thread safety analysis to be used
+// to ensure that resources are accessed in a context that is checked (at debug
+// runtime) to ensure that it's running on the correct thread:
+//
+// class MyClass {
+// public:
+// void Foo() {
+// std::lock_guard<fit::thread_checker> locker(thread_checker_);
+// resource_ = 0;
+// }
+// private:
+// fit::thread_checker thread_checker_;
+// int resource_ GUARDED_BY(thread_checker_);
+// }
+//
+// Note: |lock| checks the thread in debug builds only.
+//
+class CAPABILITY("mutex") ThreadChecker final {
+public:
+ // Default constructor. Constructs a thread checker bound to the currently
+ // running thread.
+ ThreadChecker() : self_(std::this_thread::get_id()) {}
+ // Constructs a thread checker bound to an explicit other thread.
+ explicit ThreadChecker(std::thread::id self) : self_(self) {}
+ ~ThreadChecker() = default;
+
+ // Returns true if the current thread is the thread this object was created
+ // on and false otherwise.
+ bool isThreadValid() const { return std::this_thread::get_id() == self_; }
+
+ // Implementation of the BaseLockable requirement
+ void lock() ACQUIRE() { assert(isThreadValid()); }
+
+ void unlock() RELEASE() {}
+
+private:
+ const std::thread::id self_;
+};
+
+#ifndef NDEBUG
+#define DECLARE_THREAD_CHECKER(c) gfxstream::guest::fit::ThreadChecker c
+#define DCHECK_IS_THREAD_VALID(c) assert((c).isThreadValid())
+#else
+#define DECLARE_THREAD_CHECKER(c)
+#define DCHECK_IS_THREAD_VALID(c) ((void)0)
+#endif
+
+} // namespace fit
+} // namespace gfxstream::guest
diff --git a/src/gfxstream/guest/android-emu/aemu/base/fit/ThreadSafety.h b/src/gfxstream/guest/android-emu/aemu/base/fit/ThreadSafety.h
new file mode 100644
index 00000000000..bce528e484f
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/fit/ThreadSafety.h
@@ -0,0 +1,81 @@
+// 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.
+
+// Copyright 2018 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+// Other libraries (e.g. libbase) may have already defined these symbols.
+// Only define them if they are not defined elsewhere.
+
+// Thread-safety annotations.
+// Currently these are only supported on Clang.
+#ifndef THREAD_ANNOTATION_ATTRIBUTE__
+#if defined(__clang__) && defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS) && \
+ __has_attribute(acquire_capability)
+#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
+#else
+#define THREAD_ANNOTATION_ATTRIBUTE__(x)
+#endif
+#endif // THREAD_ANNOTATION_ATTRIBUTE__
+
+#ifndef CAPABILITY
+#define CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(__capability__(x))
+#endif // CAPABILITY
+
+#ifndef GUARDED_BY
+#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(__guarded_by__(x))
+#endif // GUARDED_BY
+
+#ifndef ACQUIRE
+#define ACQUIRE(...) THREAD_ANNOTATION_ATTRIBUTE__(__acquire_capability__(__VA_ARGS__))
+#endif // ACQUIRE
+
+#ifndef TRY_ACQUIRE
+#define TRY_ACQUIRE(...) THREAD_ANNOTATION_ATTRIBUTE__(__try_acquire_capability__(__VA_ARGS__))
+#endif // TRY_ACQUIRE
+
+#ifndef ACQUIRED_BEFORE
+#define ACQUIRED_BEFORE(...) THREAD_ANNOTATION_ATTRIBUTE__(__acquired_before__(__VA_ARGS__))
+#endif // ACQUIRED_BEFORE
+
+#ifndef ACQUIRED_AFTER
+#define ACQUIRED_AFTER(...) THREAD_ANNOTATION_ATTRIBUTE__(__acquired_after__(__VA_ARGS__))
+#endif // ACQUIRED_AFTER
+
+#ifndef RELEASE
+#define RELEASE(...) THREAD_ANNOTATION_ATTRIBUTE__(__release_capability__(__VA_ARGS__))
+#endif // RELEASE
+
+#ifndef REQUIRES
+#define REQUIRES(...) THREAD_ANNOTATION_ATTRIBUTE__(__requires_capability__(__VA_ARGS__))
+#endif // REQUIRES
+
+#ifndef EXCLUDES
+#define EXCLUDES(...) THREAD_ANNOTATION_ATTRIBUTE__(__locks_excluded__(__VA_ARGS__))
+#endif // EXCLUDES
+
+#ifndef RETURN_CAPABILITY
+#define RETURN_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(__lock_returned__(x))
+#endif // RETURN_CAPABILITY
+
+#ifndef SCOPED_CAPABILITY
+#define SCOPED_CAPABILITY THREAD_ANNOTATION_ATTRIBUTE__(__scoped_lockable__)
+#endif // SCOPED_CAPABILITY
+
+#ifndef NO_THREAD_SAFETY_ANALYSIS
+#define NO_THREAD_SAFETY_ANALYSIS THREAD_ANNOTATION_ATTRIBUTE__(__no_thread_safety_analysis__)
+#endif // NO_THREAD_SAFETY_ANALYSIS
diff --git a/src/gfxstream/guest/android-emu/aemu/base/fit/UtilityInternal.h b/src/gfxstream/guest/android-emu/aemu/base/fit/UtilityInternal.h
new file mode 100644
index 00000000000..73a9d7dcb7c
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/fit/UtilityInternal.h
@@ -0,0 +1,146 @@
+// 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.
+
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <type_traits>
+#include <utility>
+
+namespace gfxstream::guest {
+namespace fit {
+namespace internal {
+
+// Utility to return the first type in a parameter pack.
+template <typename... Ts>
+struct First;
+template <typename FirstType, typename... Rest>
+struct First<FirstType, Rest...> {
+ using Type = FirstType;
+};
+
+template <typename... Ts>
+using First_t = typename First<Ts...>::Type;
+
+// Utility to count the occurences of type T in the parameter pack Ts.
+template <typename T, typename... Ts>
+struct OccurencesOf : std::integral_constant<size_t, 0> {};
+template <typename T, typename U>
+struct OccurencesOf<T, U> : std::integral_constant<size_t, std::is_same<T, U>::value> {};
+template <typename T, typename First, typename... Rest>
+struct OccurencesOf<T, First, Rest...>
+ : std::integral_constant<size_t,
+ OccurencesOf<T, First>::value + OccurencesOf<T, Rest...>::value> {};
+
+template <typename T, typename... Ts>
+constexpr size_t occurencesOf = OccurencesOf<T, Ts...>::value;
+
+// Utility to remove const, volatile, and reference qualifiers.
+template <typename T>
+using RemoveCvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
+
+// Evaluates to truth-like when type T matches type U with cv-reference removed.
+template <typename T, typename U>
+using NotSameType = std::negation<std::is_same<T, RemoveCvref_t<U>>>;
+
+// Concept helper for constructors.
+template <typename... Conditions>
+using RequiresConditions = std::enable_if_t<std::conjunction_v<Conditions...>, bool>;
+
+// Concept helper for assignment operators.
+template <typename Return, typename... Conditions>
+using AssignmentRequiresConditions =
+ std::enable_if_t<std::conjunction_v<Conditions...>, std::add_lvalue_reference_t<Return>>;
+
+// Evaluates to true when every element type of Ts is trivially destructible.
+template <typename... Ts>
+constexpr bool isTriviallyDestructible = std::conjunction_v<std::is_trivially_destructible<Ts>...>;
+
+// Evaluates to true when every element type of Ts is trivially copyable.
+template <typename... Ts>
+constexpr bool isTriviallyCopyable =
+ (std::conjunction_v<std::is_trivially_copy_assignable<Ts>...> &&
+ std::conjunction_v<std::is_trivially_copy_constructible<Ts>...>);
+
+// Evaluates to true when every element type of Ts is trivially movable.
+template <typename... Ts>
+constexpr bool isTriviallyMovable =
+ (std::conjunction_v<std::is_trivially_move_assignable<Ts>...> &&
+ std::conjunction_v<std::is_trivially_move_constructible<Ts>...>);
+
+// Enable if relational operator is convertible to bool and the optional
+// conditions are true.
+template <typename Op, typename... Conditions>
+using enable_relop_t =
+ std::enable_if_t<(std::is_convertible<Op, bool>::value && std::conjunction_v<Conditions...>),
+ bool>;
+
+template <typename T>
+struct Identity {
+ using Type = T;
+};
+
+// Evaluates to true when T is an unbounded array.
+template <typename T>
+struct IsUnboundedArray : std::conjunction<std::is_array<T>, std::negation<std::extent<T>>> {};
+
+// Returns true when T is a complete type or an unbounded array.
+template <typename T, size_t = sizeof(T)>
+constexpr bool isCompleteOrUnboundedArray(Identity<T>) {
+ return true;
+}
+template <typename Identity, typename T = typename Identity::Type>
+constexpr bool isCompleteOrUnboundedArray(Identity) {
+ return std::disjunction<std::is_reference<T>, std::is_function<T>, std::is_void<T>,
+ IsUnboundedArray<T>>::value;
+}
+
+// Using swap for ADL. This directive is contained within the fit::internal
+// namespace, which prevents leaking std::swap into user namespaces. Doing this
+// at namespace scope is necessary to lookup swap via ADL while preserving the
+// noexcept() specification of the resulting lookup.
+using std::swap;
+
+// Evaluates to true when T is swappable.
+template <typename T, typename = void>
+struct IsSwappable : std::false_type {
+ static_assert(isCompleteOrUnboundedArray(Identity<T>{}),
+ "T must be a complete type or an unbounded array!");
+};
+template <typename T>
+struct IsSwappable<T, std::void_t<decltype(swap(std::declval<T&>(), std::declval<T&>()))>>
+ : std::true_type {
+ static_assert(isCompleteOrUnboundedArray(Identity<T>{}),
+ "T must be a complete type or an unbounded array!");
+};
+
+// Evaluates to true when T is nothrow swappable.
+template <typename T, typename = void>
+struct IsNothrowSwappable : std::false_type {
+ static_assert(isCompleteOrUnboundedArray(Identity<T>{}),
+ "T must be a complete type or an unbounded array!");
+};
+template <typename T>
+struct IsNothrowSwappable<T, std::void_t<decltype(swap(std::declval<T&>(), std::declval<T&>()))>>
+ : std::integral_constant<bool, noexcept(swap(std::declval<T&>(), std::declval<T&>()))> {
+ static_assert(isCompleteOrUnboundedArray(Identity<T>{}),
+ "T must be a complete type or an unbounded array!");
+};
+
+} // namespace internal
+} // namespace fit
+} // namespace gfxstream::guest
diff --git a/src/gfxstream/guest/android-emu/aemu/base/meson.build b/src/gfxstream/guest/android-emu/aemu/base/meson.build
new file mode 100644
index 00000000000..a15dd9fe6cd
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/meson.build
@@ -0,0 +1,29 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_linux_platform = files(
+ 'AlignedBuf.cpp',
+ 'AndroidSubAllocator.cpp',
+ 'AndroidSubAllocator.h',
+ 'Pool.cpp',
+ 'Process.cpp',
+ 'AndroidHealthMonitor.cpp',
+ 'AndroidHealthMonitorConsumerBasic.cpp',
+ 'Tracing.cpp',
+ 'ring_buffer.c',
+ 'files/MemStream.cpp',
+ 'files/Stream.cpp',
+ 'files/StreamSerializing.cpp',
+ 'synchronization/AndroidMessageChannel.cpp',
+ 'threads/AndroidFunctorThread.cpp',
+ 'threads/AndroidThread_pthread.cpp',
+ 'threads/AndroidWorkPool.cpp',
+)
+
+lib_emu_android_base = static_library(
+ 'emu_android_base',
+ files_lib_linux_platform,
+ cpp_args: gfxstream_guest_args,
+ include_directories: [inc_android_emu, inc_android_compat],
+ dependencies: thread_dep
+)
diff --git a/src/gfxstream/guest/android-emu/aemu/base/ring_buffer.c b/src/gfxstream/guest/android-emu/aemu/base/ring_buffer.c
new file mode 100644
index 00000000000..bb12411cd12
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/ring_buffer.c
@@ -0,0 +1,610 @@
+// 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 "aemu/base/ring_buffer.h"
+
+#include <errno.h>
+#include <string.h>
+#ifdef _MSC_VER
+#include "msvc-posix.h"
+#else
+#include <sys/time.h>
+#endif
+
+#if (defined(__i386__) || defined(__x86_64__))
+#define RING_BUFFER_X86 1
+#else
+#define RING_BUFFER_X86 0
+#endif
+
+#if RING_BUFFER_X86
+#include <emmintrin.h>
+#endif
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <sched.h>
+#include <unistd.h>
+#endif
+
+#define RING_BUFFER_MASK (RING_BUFFER_SIZE - 1)
+
+#define RING_BUFFER_VERSION 1
+
+static inline void ring_buffer_pause(void) {
+#if RING_BUFFER_X86
+ _mm_pause();
+#else
+ // TODO(lfy) analog of pause on ARM
+#endif
+}
+
+void ring_buffer_init(struct ring_buffer* r) {
+ r->guest_version = 1;
+ r->write_pos = 0;
+ r->read_pos = 0;
+
+ r->read_live_count = 0;
+ r->read_yield_count = 0;
+ r->read_sleep_us_count = 0;
+
+ r->state = 0;
+}
+
+static uint32_t get_ring_pos(uint32_t index) {
+ return index & RING_BUFFER_MASK;
+}
+
+bool ring_buffer_can_write(const struct ring_buffer* r, uint32_t bytes) {
+ uint32_t read_view;
+ __atomic_load(&r->read_pos, &read_view, __ATOMIC_SEQ_CST);
+ return get_ring_pos(read_view - r->write_pos - 1) >= bytes;
+}
+
+bool ring_buffer_can_read(const struct ring_buffer* r, uint32_t bytes) {
+ uint32_t write_view;
+ __atomic_load(&r->write_pos, &write_view, __ATOMIC_SEQ_CST);
+ return get_ring_pos(write_view - r->read_pos) >= bytes;
+}
+
+long ring_buffer_write(
+ struct ring_buffer* r, const void* data, uint32_t step_size, uint32_t steps) {
+ const uint8_t* data_bytes = (const uint8_t*)data;
+ uint32_t i;
+
+ for (i = 0; i < steps; ++i) {
+ if (!ring_buffer_can_write(r, step_size)) {
+ errno = -EAGAIN;
+ return (long)i;
+ }
+
+ // Needs to be split up into 2 writes for the edge case.
+ uint32_t available_at_end =
+ RING_BUFFER_SIZE - get_ring_pos(r->write_pos);
+
+ if (step_size > available_at_end) {
+ uint32_t remaining = step_size - available_at_end;
+ memcpy(
+ &r->buf[get_ring_pos(r->write_pos)],
+ data_bytes + i * step_size,
+ available_at_end);
+ memcpy(
+ &r->buf[get_ring_pos(r->write_pos + available_at_end)],
+ data_bytes + i * step_size + available_at_end,
+ remaining);
+ } else {
+ memcpy(
+ &r->buf[get_ring_pos(r->write_pos)],
+ data_bytes + i * step_size,
+ step_size);
+ }
+
+ __atomic_add_fetch(&r->write_pos, step_size, __ATOMIC_SEQ_CST);
+ }
+
+ errno = 0;
+ return (long)steps;
+}
+
+long ring_buffer_read(
+ struct ring_buffer* r, void* data, uint32_t step_size, uint32_t steps) {
+ uint8_t* data_bytes = (uint8_t*)data;
+ uint32_t i;
+
+ for (i = 0; i < steps; ++i) {
+ if (!ring_buffer_can_read(r, step_size)) {
+ errno = -EAGAIN;
+ return (long)i;
+ }
+
+ // Needs to be split up into 2 reads for the edge case.
+ uint32_t available_at_end =
+ RING_BUFFER_SIZE - get_ring_pos(r->read_pos);
+
+ if (step_size > available_at_end) {
+ uint32_t remaining = step_size - available_at_end;
+ memcpy(
+ data_bytes + i * step_size,
+ &r->buf[get_ring_pos(r->read_pos)],
+ available_at_end);
+ memcpy(
+ data_bytes + i * step_size + available_at_end,
+ &r->buf[get_ring_pos(r->read_pos + available_at_end)],
+ remaining);
+ } else {
+ memcpy(
+ data_bytes + i * step_size,
+ &r->buf[get_ring_pos(r->read_pos)],
+ step_size);
+ }
+
+ __atomic_add_fetch(&r->read_pos, step_size, __ATOMIC_SEQ_CST);
+ }
+
+ errno = 0;
+ return (long)steps;
+}
+
+long ring_buffer_advance_write(
+ struct ring_buffer* r, uint32_t step_size, uint32_t steps) {
+ uint32_t i;
+
+ for (i = 0; i < steps; ++i) {
+ if (!ring_buffer_can_write(r, step_size)) {
+ errno = -EAGAIN;
+ return (long)i;
+ }
+
+ __atomic_add_fetch(&r->write_pos, step_size, __ATOMIC_SEQ_CST);
+ }
+
+ errno = 0;
+ return (long)steps;
+}
+
+long ring_buffer_advance_read(
+ struct ring_buffer* r, uint32_t step_size, uint32_t steps) {
+ uint32_t i;
+
+ for (i = 0; i < steps; ++i) {
+ if (!ring_buffer_can_read(r, step_size)) {
+ errno = -EAGAIN;
+ return (long)i;
+ }
+
+ __atomic_add_fetch(&r->read_pos, step_size, __ATOMIC_SEQ_CST);
+ }
+
+ errno = 0;
+ return (long)steps;
+}
+
+uint32_t ring_buffer_calc_shift(uint32_t size) {
+ uint32_t shift = 0;
+ while ((1 << shift) < size) {
+ ++shift;
+ }
+
+ // if size is not a power of 2,
+ if ((1 << shift) > size) {
+ --shift;
+ }
+ return shift;
+}
+
+void ring_buffer_view_init(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ uint8_t* buf,
+ uint32_t size) {
+
+ uint32_t shift = ring_buffer_calc_shift(size);
+
+ ring_buffer_init(r);
+
+ v->buf = buf;
+ v->size = (1 << shift);
+ v->mask = (1 << shift) - 1;
+}
+
+void ring_buffer_init_view_only(
+ struct ring_buffer_view* v,
+ uint8_t* buf,
+ uint32_t size) {
+
+ uint32_t shift = ring_buffer_calc_shift(size);
+
+ v->buf = buf;
+ v->size = (1 << shift);
+ v->mask = (1 << shift) - 1;
+}
+
+uint32_t ring_buffer_view_get_ring_pos(
+ const struct ring_buffer_view* v,
+ uint32_t index) {
+ return index & v->mask;
+}
+
+bool ring_buffer_view_can_write(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t bytes) {
+ uint32_t read_view;
+ __atomic_load(&r->read_pos, &read_view, __ATOMIC_SEQ_CST);
+ return ring_buffer_view_get_ring_pos(
+ v, read_view - r->write_pos - 1) >= bytes;
+}
+
+bool ring_buffer_view_can_read(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t bytes) {
+ uint32_t write_view;
+ __atomic_load(&r->write_pos, &write_view, __ATOMIC_SEQ_CST);
+ return ring_buffer_view_get_ring_pos(
+ v, write_view - r->read_pos) >= bytes;
+}
+
+uint32_t ring_buffer_available_read(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v) {
+ uint32_t write_view;
+ __atomic_load(&r->write_pos, &write_view, __ATOMIC_SEQ_CST);
+ if (v) {
+ return ring_buffer_view_get_ring_pos(
+ v, write_view - r->read_pos);
+ } else {
+ return get_ring_pos(write_view - r->read_pos);
+ }
+}
+
+int ring_buffer_copy_contents(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t wanted_bytes,
+ uint8_t* res) {
+
+ uint32_t total_available =
+ ring_buffer_available_read(r, v);
+ uint32_t available_at_end = 0;
+
+ if (v) {
+ available_at_end =
+ v->size - ring_buffer_view_get_ring_pos(v, r->read_pos);
+ } else {
+ available_at_end =
+ RING_BUFFER_SIZE - get_ring_pos(r->write_pos);
+ }
+
+ if (total_available < wanted_bytes) {
+ return -1;
+ }
+
+ if (v) {
+ if (wanted_bytes > available_at_end) {
+ uint32_t remaining = wanted_bytes - available_at_end;
+ memcpy(res,
+ &v->buf[ring_buffer_view_get_ring_pos(v, r->read_pos)],
+ available_at_end);
+ memcpy(res + available_at_end,
+ &v->buf[ring_buffer_view_get_ring_pos(v, r->read_pos + available_at_end)],
+ remaining);
+ } else {
+ memcpy(res,
+ &v->buf[ring_buffer_view_get_ring_pos(v, r->read_pos)],
+ wanted_bytes);
+ }
+ } else {
+ if (wanted_bytes > available_at_end) {
+ uint32_t remaining = wanted_bytes - available_at_end;
+ memcpy(res,
+ &r->buf[get_ring_pos(r->read_pos)],
+ available_at_end);
+ memcpy(res + available_at_end,
+ &r->buf[get_ring_pos(r->read_pos + available_at_end)],
+ remaining);
+ } else {
+ memcpy(res,
+ &r->buf[get_ring_pos(r->read_pos)],
+ wanted_bytes);
+ }
+ }
+ return 0;
+}
+
+long ring_buffer_view_write(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ const void* data, uint32_t step_size, uint32_t steps) {
+
+ uint8_t* data_bytes = (uint8_t*)data;
+ uint32_t i;
+
+ for (i = 0; i < steps; ++i) {
+ if (!ring_buffer_view_can_write(r, v, step_size)) {
+ errno = -EAGAIN;
+ return (long)i;
+ }
+
+ // Needs to be split up into 2 writes for the edge case.
+ uint32_t available_at_end =
+ v->size - ring_buffer_view_get_ring_pos(v, r->write_pos);
+
+ if (step_size > available_at_end) {
+ uint32_t remaining = step_size - available_at_end;
+ memcpy(
+ &v->buf[ring_buffer_view_get_ring_pos(v, r->write_pos)],
+ data_bytes + i * step_size,
+ available_at_end);
+ memcpy(
+ &v->buf[ring_buffer_view_get_ring_pos(v, r->write_pos + available_at_end)],
+ data_bytes + i * step_size + available_at_end,
+ remaining);
+ } else {
+ memcpy(
+ &v->buf[ring_buffer_view_get_ring_pos(v, r->write_pos)],
+ data_bytes + i * step_size,
+ step_size);
+ }
+
+ __atomic_add_fetch(&r->write_pos, step_size, __ATOMIC_SEQ_CST);
+ }
+
+ errno = 0;
+ return (long)steps;
+
+}
+
+long ring_buffer_view_read(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ void* data, uint32_t step_size, uint32_t steps) {
+ uint8_t* data_bytes = (uint8_t*)data;
+ uint32_t i;
+
+ for (i = 0; i < steps; ++i) {
+ if (!ring_buffer_view_can_read(r, v, step_size)) {
+ errno = -EAGAIN;
+ return (long)i;
+ }
+
+ // Needs to be split up into 2 reads for the edge case.
+ uint32_t available_at_end =
+ v->size - ring_buffer_view_get_ring_pos(v, r->read_pos);
+
+ if (step_size > available_at_end) {
+ uint32_t remaining = step_size - available_at_end;
+ memcpy(
+ data_bytes + i * step_size,
+ &v->buf[ring_buffer_view_get_ring_pos(v, r->read_pos)],
+ available_at_end);
+ memcpy(
+ data_bytes + i * step_size + available_at_end,
+ &v->buf[ring_buffer_view_get_ring_pos(v, r->read_pos + available_at_end)],
+ remaining);
+ } else {
+ memcpy(data_bytes + i * step_size,
+ &v->buf[ring_buffer_view_get_ring_pos(v, r->read_pos)],
+ step_size);
+ }
+ __atomic_add_fetch(&r->read_pos, step_size, __ATOMIC_SEQ_CST);
+ }
+
+ errno = 0;
+ return (long)steps;
+}
+
+void ring_buffer_yield(void) { }
+
+bool ring_buffer_wait_write(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t bytes) {
+
+ bool can_write =
+ v ? ring_buffer_view_can_write(r, v, bytes) :
+ ring_buffer_can_write(r, bytes);
+
+ while (!can_write) {
+ ring_buffer_yield();
+ can_write =
+ v ? ring_buffer_view_can_write(r, v, bytes) :
+ ring_buffer_can_write(r, bytes);
+ }
+
+ return true;
+}
+
+bool ring_buffer_wait_read(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t bytes) {
+
+ bool can_read =
+ v ? ring_buffer_view_can_read(r, v, bytes) :
+ ring_buffer_can_read(r, bytes);
+
+ while (!can_read) {
+ ring_buffer_yield();
+ can_read =
+ v ? ring_buffer_view_can_read(r, v, bytes) :
+ ring_buffer_can_read(r, bytes);
+ }
+
+ ((struct ring_buffer*)r)->read_live_count++;
+ return true;
+}
+
+static uint32_t get_step_size(
+ struct ring_buffer_view* v,
+ uint32_t bytes) {
+
+ uint32_t available = v ? (v->size >> 1) : (RING_BUFFER_SIZE >> 1);
+ uint32_t res = available < bytes ? available : bytes;
+
+ return res;
+}
+
+void ring_buffer_write_fully(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ const void* data,
+ uint32_t bytes) {
+ ring_buffer_write_fully_with_abort(r, v, data, bytes, 0, 0);
+}
+
+void ring_buffer_read_fully(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ void* data,
+ uint32_t bytes) {
+ ring_buffer_read_fully_with_abort(r, v, data, bytes, 0, 0);
+}
+
+uint32_t ring_buffer_write_fully_with_abort(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ const void* data,
+ uint32_t bytes,
+ uint32_t abort_value,
+ const volatile uint32_t* abort_ptr) {
+
+ uint32_t candidate_step = get_step_size(v, bytes);
+ uint32_t processed = 0;
+
+ uint8_t* dst = (uint8_t*)data;
+
+ while (processed < bytes) {
+ if (bytes - processed < candidate_step) {
+ candidate_step = bytes - processed;
+ }
+
+ long processed_here = 0;
+ ring_buffer_wait_write(r, v, candidate_step);
+
+ if (v) {
+ processed_here = ring_buffer_view_write(r, v, dst + processed, candidate_step, 1);
+ } else {
+ processed_here = ring_buffer_write(r, dst + processed, candidate_step, 1);
+ }
+
+ processed += processed_here ? candidate_step : 0;
+
+ if (abort_ptr && (abort_value == *abort_ptr)) {
+ return processed;
+ }
+ }
+
+ return processed;
+}
+
+uint32_t ring_buffer_read_fully_with_abort(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ void* data,
+ uint32_t bytes,
+ uint32_t abort_value,
+ const volatile uint32_t* abort_ptr) {
+
+ uint32_t candidate_step = get_step_size(v, bytes);
+ uint32_t processed = 0;
+
+ uint8_t* dst = (uint8_t*)data;
+
+ while (processed < bytes) {
+ ring_buffer_pause();
+ if (bytes - processed < candidate_step) {
+ candidate_step = bytes - processed;
+ }
+
+ long processed_here = 0;
+ ring_buffer_wait_read(r, v, candidate_step);
+
+ if (v) {
+ processed_here = ring_buffer_view_read(r, v, dst + processed, candidate_step, 1);
+ } else {
+ processed_here = ring_buffer_read(r, dst + processed, candidate_step, 1);
+ }
+
+ processed += processed_here ? candidate_step : 0;
+
+ if (abort_ptr && (abort_value == *abort_ptr)) {
+ return processed;
+ }
+ }
+
+ return processed;
+}
+
+void ring_buffer_sync_init(struct ring_buffer* r) {
+ __atomic_store_n(&r->state, RING_BUFFER_SYNC_PRODUCER_IDLE, __ATOMIC_SEQ_CST);
+}
+
+bool ring_buffer_producer_acquire(struct ring_buffer* r) {
+ uint32_t expected_idle = RING_BUFFER_SYNC_PRODUCER_IDLE;
+ bool success = __atomic_compare_exchange_n(
+ &r->state,
+ &expected_idle,
+ RING_BUFFER_SYNC_PRODUCER_ACTIVE,
+ false /* strong */,
+ __ATOMIC_SEQ_CST,
+ __ATOMIC_SEQ_CST);
+ return success;
+}
+
+bool ring_buffer_producer_acquire_from_hangup(struct ring_buffer* r) {
+ uint32_t expected_hangup = RING_BUFFER_SYNC_CONSUMER_HUNG_UP;
+ bool success = __atomic_compare_exchange_n(
+ &r->state,
+ &expected_hangup,
+ RING_BUFFER_SYNC_PRODUCER_ACTIVE,
+ false /* strong */,
+ __ATOMIC_SEQ_CST,
+ __ATOMIC_SEQ_CST);
+ return success;
+}
+
+void ring_buffer_producer_wait_hangup(struct ring_buffer* r) {
+ while (__atomic_load_n(&r->state, __ATOMIC_SEQ_CST) !=
+ RING_BUFFER_SYNC_CONSUMER_HUNG_UP) {
+ ring_buffer_yield();
+ }
+}
+
+void ring_buffer_producer_idle(struct ring_buffer* r) {
+ __atomic_store_n(&r->state, RING_BUFFER_SYNC_PRODUCER_IDLE, __ATOMIC_SEQ_CST);
+}
+
+bool ring_buffer_consumer_hangup(struct ring_buffer* r) {
+ uint32_t expected_idle = RING_BUFFER_SYNC_PRODUCER_IDLE;
+ bool success = __atomic_compare_exchange_n(
+ &r->state,
+ &expected_idle,
+ RING_BUFFER_SYNC_CONSUMER_HANGING_UP,
+ false /* strong */,
+ __ATOMIC_SEQ_CST,
+ __ATOMIC_SEQ_CST);
+ return success;
+}
+
+void ring_buffer_consumer_wait_producer_idle(struct ring_buffer* r) {
+ while (__atomic_load_n(&r->state, __ATOMIC_SEQ_CST) !=
+ RING_BUFFER_SYNC_PRODUCER_IDLE) {
+ ring_buffer_yield();
+ }
+}
+
+void ring_buffer_consumer_hung_up(struct ring_buffer* r) {
+ __atomic_store_n(&r->state, RING_BUFFER_SYNC_CONSUMER_HUNG_UP, __ATOMIC_SEQ_CST);
+}
diff --git a/src/gfxstream/guest/android-emu/aemu/base/ring_buffer.h b/src/gfxstream/guest/android-emu/aemu/base/ring_buffer.h
new file mode 100644
index 00000000000..7cc56ad2e4b
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/ring_buffer.h
@@ -0,0 +1,230 @@
+// 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.
+#pragma once
+
+#include "android/utils/compiler.h"
+
+ANDROID_BEGIN_HEADER
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#define RING_BUFFER_SHIFT 11
+#define RING_BUFFER_SIZE (1 << RING_BUFFER_SHIFT)
+#define NUM_CONFIG_FIELDS 32
+
+// Single producer/consumer ring buffer struct that can be shared
+// between host and guest as-is.
+struct ring_buffer {
+ uint32_t host_version;
+ uint32_t guest_version;
+ uint32_t write_pos; // Atomically updated for the consumer
+ uint32_t unused0[13]; // Separate cache line
+ uint32_t read_pos; // Atomically updated for the producer
+ uint32_t read_live_count;
+ uint32_t read_yield_count;
+ uint32_t read_sleep_us_count;
+ uint32_t unused1[12]; // Separate cache line
+ uint8_t buf[RING_BUFFER_SIZE];
+ uint32_t state; // An atomically updated variable from both
+ // producer and consumer for other forms of
+ // coordination.
+ // Configuration fields
+ uint32_t config[NUM_CONFIG_FIELDS];
+};
+
+void ring_buffer_init(struct ring_buffer* r);
+
+// Writes or reads step_size at a time. Sets errno=EAGAIN if full or empty.
+// Returns the number of step_size steps read.
+long ring_buffer_write(
+ struct ring_buffer* r, const void* data, uint32_t step_size, uint32_t steps);
+long ring_buffer_read(
+ struct ring_buffer* r, void* data, uint32_t step_size, uint32_t steps);
+// Like ring_buffer_write / ring_buffer_read, but merely advances the counters
+// without reading or writing anything. Returns the number of step_size steps
+// advanced.
+long ring_buffer_advance_write(
+ struct ring_buffer* r, uint32_t step_size, uint32_t steps);
+long ring_buffer_advance_read(
+ struct ring_buffer* r, uint32_t step_size, uint32_t steps);
+
+// If we want to work with dynamically allocated buffers, a separate struct is
+// needed; the host and guest are in different address spaces and thus have
+// different views of the same memory, with the host and guest having different
+// copies of this struct.
+struct ring_buffer_view {
+ uint8_t* buf;
+ uint32_t size;
+ uint32_t mask;
+};
+
+// Convenience struct that holds a pointer to a ring along with a view. It's a
+// common pattern for the ring and the buffer of the view to be shared between
+// two entities (in this case, usually guest and host).
+struct ring_buffer_with_view {
+ struct ring_buffer* ring;
+ struct ring_buffer_view view;
+};
+
+// Calculates the highest power of 2 so that
+// (1 << shift) <= size.
+uint32_t ring_buffer_calc_shift(uint32_t size);
+
+// Initializes ring buffer with view using |buf|. If |size| is not a power of
+// two, then the buffer will assume a size equal to the greater power of two
+// less than |size|.
+void ring_buffer_view_init(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ uint8_t* buf,
+ uint32_t size);
+
+void ring_buffer_init_view_only(
+ struct ring_buffer_view* v,
+ uint8_t* buf,
+ uint32_t size);
+
+// Read/write functions with the view.
+long ring_buffer_view_write(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ const void* data, uint32_t step_size, uint32_t steps);
+long ring_buffer_view_read(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ void* data, uint32_t step_size, uint32_t steps);
+
+// Usage of ring_buffer as a waitable object.
+// These functions will back off if spinning too long.
+//
+// if |v| is null, it is assumed that the statically allocated ring buffer is
+// used.
+//
+// Returns true if ring buffer became available, false if timed out.
+bool ring_buffer_wait_write(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t bytes);
+bool ring_buffer_wait_read(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t bytes);
+
+// read/write fully, blocking if there is nothing to read/write.
+void ring_buffer_write_fully(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ const void* data,
+ uint32_t bytes);
+void ring_buffer_read_fully(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ void* data,
+ uint32_t bytes);
+
+// Like read/write fully, but with an abort value. The value is read from
+// |abortPtr| each time. If |abortPtr| is null, then behaves the same
+// as ring_buffer_(read|write)_fully.
+// Returns the actual number of bytes sent or received.
+uint32_t ring_buffer_write_fully_with_abort(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ const void* data,
+ uint32_t bytes,
+ uint32_t abort_value,
+ const volatile uint32_t* abort_ptr);
+uint32_t ring_buffer_read_fully_with_abort(
+ struct ring_buffer* r,
+ struct ring_buffer_view* v,
+ void* data,
+ uint32_t bytes,
+ uint32_t abort_value,
+ const volatile uint32_t* abort_ptr);
+
+uint32_t ring_buffer_view_get_ring_pos(
+ const struct ring_buffer_view* v,
+ uint32_t index);
+
+bool ring_buffer_can_write(
+ const struct ring_buffer* r, uint32_t bytes);
+bool ring_buffer_can_read(
+ const struct ring_buffer* r, uint32_t bytes);
+bool ring_buffer_view_can_write(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t bytes);
+bool ring_buffer_view_can_read(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t bytes);
+uint32_t ring_buffer_available_read(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v);
+// Copies out contents from the consumer side of
+// ring buffer/view |r,v|.
+// If there is less available read than |wanted_bytes|,
+// returns -1.
+// On success, returns 0.
+int ring_buffer_copy_contents(
+ const struct ring_buffer* r,
+ const struct ring_buffer_view* v,
+ uint32_t wanted_bytes,
+ uint8_t* res);
+
+// Lockless synchronization where the consumer is allowed to hang up and go to
+// sleep. This can be considered a sort of asymmetric lock for two threads,
+// where the consumer can be more sleepy. It captures the pattern we usually use
+// for emulator devices; the guest asks the host for something, and some host
+// thread services the request and goes back to sleep.
+enum ring_buffer_sync_state {
+ RING_BUFFER_SYNC_PRODUCER_IDLE = 0,
+ RING_BUFFER_SYNC_PRODUCER_ACTIVE = 1,
+ RING_BUFFER_SYNC_CONSUMER_HANGING_UP = 2,
+ RING_BUFFER_SYNC_CONSUMER_HUNG_UP = 3,
+};
+
+// Sync state is RING_BUFFER_SYNC_PRODUCER_IDLE.
+void ring_buffer_sync_init(struct ring_buffer* r);
+
+// Tries to acquire the channel for sending.
+// Returns false if the consumer was in the middle of hanging up,
+// true if the producer successfully acquired the channel
+// (put it in the RING_BUFFER_SYNC_PRODUCER_ACTIVE state).
+bool ring_buffer_producer_acquire(struct ring_buffer* r);
+// Same as above, but acquires from RING_BUFFER_SYNC_CONSUMER_HUNG_UP.
+bool ring_buffer_producer_acquire_from_hangup(struct ring_buffer* r);
+// Waits until the consumer hangs up.
+void ring_buffer_producer_wait_hangup(struct ring_buffer* r);
+// Sets the state back to RING_BUFFER_SYNC_PRODUCER_IDLE.
+void ring_buffer_producer_idle(struct ring_buffer* r);
+
+// There is no symmetric consumer acquire because the consumer can consume with
+// the ring buffer being in any state (albeit with long waiting if the producer
+// does not send anything)
+
+// Tries to acquire the channel on the consumer side for
+// hanging up. Returns false if the producer is in the middle of sending,
+// true if the consumer successfully hung up the channel
+// (put it in the RING_BUFFER_SYNC_CONSUMER_HUNG_UP state).
+bool ring_buffer_consumer_hangup(struct ring_buffer* r);
+// Waits until the producer has set the state to
+// RING_BUFFER_SYNC_PRODUCER_IDLE.
+void ring_buffer_consumer_wait_producer_idle(struct ring_buffer* r);
+// Sets the state to hung up.
+void ring_buffer_consumer_hung_up(struct ring_buffer* r);
+
+// Convenient function to reschedule thread
+void ring_buffer_yield(void);
+ANDROID_END_HEADER
diff --git a/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidConditionVariable.h b/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidConditionVariable.h
new file mode 100644
index 00000000000..63a0f9e6ea3
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidConditionVariable.h
@@ -0,0 +1,232 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/Compiler.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <pthread.h>
+#endif
+
+#include <stdint.h>
+#include <assert.h>
+
+namespace gfxstream {
+namespace guest {
+
+// A class that implements a condition variable, which can be used in
+// association with a Lock to blocking-wait for specific conditions.
+// Useful to implement various synchronization data structures.
+class ConditionVariable {
+public:
+ // A set of functions to efficiently unlock the lock used with
+ // the current condition variable and signal or broadcast it.
+ //
+ // The functions are needed because on some platforms (Posix) it's more
+ // efficient to signal the variable before unlocking mutex, while on others
+ // (Windows) it's exactly the opposite. Functions implement the best way
+ // for each platform and abstract it out from the user.
+ template <bool IsRecursive>
+ void signalAndUnlock(StaticLock<IsRecursive>* lock);
+
+ template <class Lockable>
+ void signalAndUnlock(AutoLock<Lockable>* lock);
+
+ template <bool IsRecursive>
+ void broadcastAndUnlock(StaticLock<IsRecursive>* lock);
+
+ template <class Lockable>
+ void broadcastAndUnlock(AutoLock<Lockable>* lock);
+
+ template <class Lockable>
+ void wait(AutoLock<Lockable>* userLock) {
+ assert(userLock->mLocked);
+ wait(&userLock->mLock);
+ }
+
+ //
+ // Convenience functions to get rid of the loop in condition variable usage
+ // Instead of hand-writing a loop, e.g.
+ //
+ // while (mRefCount < 3) {
+ // mCv.wait(&mLock);
+ // }
+ //
+ // use the following two wait() overloads:
+ //
+ // mCv.wait(&mLock, [this]() { return mRefCount >= 3; });
+ //
+ // Parameters:
+ // |lock| - a Lock or AutoLock pointer used with the condition variable.
+ // |pred| - a functor predicate that's compatible with "bool pred()"
+ // signature and returns a condition when one should stop waiting.
+ //
+
+ template <bool IsRecursive, class Predicate>
+ void wait(StaticLock<IsRecursive>* lock, Predicate pred) {
+ while (!pred()) {
+ this->wait(lock);
+ }
+ }
+
+ template <class Lockable, class Predicate>
+ void wait(AutoLock<Lockable>* lock, Predicate pred) {
+ this->wait(&lock->mLock, pred);
+ }
+
+#ifdef _WIN32
+
+ ConditionVariable() {
+ ::InitializeConditionVariable(&mCond);
+ }
+
+ // There's no special function to destroy CONDITION_VARIABLE in Windows.
+ ~ConditionVariable() = default;
+
+ // Wait until the condition variable is signaled. Note that spurious
+ // wakeups are always a possibility, so always check the condition
+ // in a loop, i.e. do:
+ //
+ // while (!condition) { condVar.wait(&lock); }
+ //
+ // instead of:
+ //
+ // if (!condition) { condVar.wait(&lock); }
+ //
+ template <bool IsRecursive>
+ void wait(StaticLock<IsRecursive>* userLock) {
+ ::SleepConditionVariableSRW(&mCond, &userLock->mLock, INFINITE, 0);
+ }
+
+ template <bool IsRecursive>
+ bool timedWait(StaticLock<IsRecursive>* userLock, System::Duration waitUntilUs) {
+ const auto now = System::get()->getUnixTimeUs();
+ const auto timeout =
+ std::max<System::Duration>(0, waitUntilUs - now) / 1000;
+ return ::SleepConditionVariableSRW(
+ &mCond, &userLock->mLock, timeout, 0) != 0;
+ }
+
+ // Signal that a condition was reached. This will wake at least (and
+ // preferrably) one waiting thread that is blocked on wait().
+ void signal() {
+ ::WakeConditionVariable(&mCond);
+ }
+
+ // Like signal(), but wakes all of the waiting threads.
+ void broadcast() {
+ ::WakeAllConditionVariable(&mCond);
+ }
+
+private:
+ CONDITION_VARIABLE mCond;
+
+#else // !_WIN32
+
+ // Note: on Posix systems, make it a naive wrapper around pthread_cond_t.
+
+ ConditionVariable() {
+ pthread_cond_init(&mCond, NULL);
+ }
+
+ ~ConditionVariable() {
+ pthread_cond_destroy(&mCond);
+ }
+
+ template <bool IsRecursive>
+ void wait(StaticLock<IsRecursive>* userLock) {
+ pthread_cond_wait(&mCond, &userLock->mLock);
+ }
+
+ template <bool IsRecursive>
+ bool timedWait(StaticLock<IsRecursive>* userLock, uint64_t waitUntilUs) {
+ timespec abstime;
+ abstime.tv_sec = waitUntilUs / 1000000LL;
+ abstime.tv_nsec = (waitUntilUs % 1000000LL) * 1000;
+ return timedWait(userLock, abstime);
+ }
+
+ template <bool IsRecursive>
+ bool timedWait(StaticLock<IsRecursive>* userLock, const timespec& abstime) {
+ return pthread_cond_timedwait(&mCond, &userLock->mLock, &abstime) == 0;
+ }
+
+ void signal() {
+ pthread_cond_signal(&mCond);
+ }
+
+ void broadcast() {
+ pthread_cond_broadcast(&mCond);
+ }
+
+private:
+ pthread_cond_t mCond;
+
+#endif // !_WIN32
+
+ DISALLOW_COPY_ASSIGN_AND_MOVE(ConditionVariable);
+};
+
+#ifdef _WIN32
+template <bool IsRecursive>
+inline void ConditionVariable::signalAndUnlock(StaticLock<IsRecursive>* lock) {
+ lock->unlock();
+ signal();
+}
+template <class Lockable>
+inline void ConditionVariable::signalAndUnlock(AutoLock<Lockable>* lock) {
+ lock->unlock();
+ signal();
+}
+
+template <bool IsRecursive>
+inline void ConditionVariable::broadcastAndUnlock(StaticLock<IsRecursive>* lock) {
+ lock->unlock();
+ broadcast();
+}
+template <class Lockable>
+inline void ConditionVariable::broadcastAndUnlock(AutoLock<Lockable>* lock) {
+ lock->unlock();
+ broadcast();
+}
+#else // !_WIN32
+
+template <bool IsRecursive>
+inline void ConditionVariable::signalAndUnlock(StaticLock<IsRecursive>* lock) {
+ signal();
+ lock->unlock();
+}
+template <class Lockable>
+inline void ConditionVariable::signalAndUnlock(AutoLock<Lockable>* lock) {
+ signal();
+ lock->unlock();
+}
+template <bool IsRecursive>
+inline void ConditionVariable::broadcastAndUnlock(StaticLock<IsRecursive>* lock) {
+ broadcast();
+ lock->unlock();
+}
+template <class Lockable>
+inline void ConditionVariable::broadcastAndUnlock(AutoLock<Lockable>* lock) {
+ broadcast();
+ lock->unlock();
+}
+#endif // !_WIN32
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidLock.h b/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidLock.h
new file mode 100644
index 00000000000..503cb9810fe
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidLock.h
@@ -0,0 +1,332 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/Compiler.h"
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#else
+#include <pthread.h>
+#endif
+
+#include <assert.h>
+
+#define AEMU_DEBUG 0
+
+#if AEMU_DEBUG
+#define AEMU_IF_DEBUG(x) x
+#else
+#define AEMU_IF_DEBUG(x)
+#endif
+
+namespace gfxstream {
+namespace guest {
+
+template <class Lockable>
+class AutoLock;
+
+class AutoWriteLock;
+class AutoReadLock;
+
+// A wrapper class for mutexes only suitable for using in static context,
+// where it's OK to leak the underlying system object.
+// Use Lock / RecursiveLock for scoped or member locks.
+template <bool IsRecursive>
+class StaticLock;
+
+template <>
+class StaticLock<false> {
+public:
+ using AutoLock = gfxstream::guest::AutoLock<StaticLock>;
+
+ constexpr StaticLock() = default;
+
+ // Acquire the lock.
+ void lock() {
+#ifdef _WIN32
+ ::AcquireSRWLockExclusive(&mLock);
+#else
+ ::pthread_mutex_lock(&mLock);
+#endif
+ AEMU_IF_DEBUG(mIsLocked = true;)
+ }
+
+ bool tryLock() {
+ bool ret = false;
+#ifdef _WIN32
+ ret = ::TryAcquireSRWLockExclusive(&mLock);
+#else
+ ret = ::pthread_mutex_trylock(&mLock) == 0;
+#endif
+ AEMU_IF_DEBUG(mIsLocked = ret;)
+ return ret;
+ }
+
+ AEMU_IF_DEBUG(bool isLocked() const { return mIsLocked; })
+
+ // Release the lock.
+ void unlock() {
+ AEMU_IF_DEBUG(mIsLocked = false;)
+#ifdef _WIN32
+ ::ReleaseSRWLockExclusive(&mLock);
+#else
+ ::pthread_mutex_unlock(&mLock);
+#endif
+ }
+
+protected:
+ friend class ConditionVariable;
+
+#ifdef _WIN32
+ // Benchmarks show that on Windows SRWLOCK performs a little bit better than
+ // CRITICAL_SECTION for uncontended mode and much better in case of
+ // contention.
+ SRWLOCK mLock = SRWLOCK_INIT;
+#else
+ pthread_mutex_t mLock = PTHREAD_MUTEX_INITIALIZER;
+#endif
+ // Both POSIX threads and WinAPI don't allow move (undefined behavior).
+ DISALLOW_COPY_ASSIGN_AND_MOVE(StaticLock);
+
+ AEMU_IF_DEBUG(bool mIsLocked = false;)
+};
+
+template <>
+class StaticLock<true> {
+public:
+ using AutoLock = gfxstream::guest::AutoLock<StaticLock>;
+
+ StaticLock() {
+#ifdef _WIN32
+ ::InitializeCriticalSectionAndSpinCount(&mLock, 0x400);
+#else
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init(&mLock, &attr);
+#endif
+ }
+
+ // Acquire the lock.
+ void lock() {
+#ifdef _WIN32
+ ::EnterCriticalSection(&mLock);
+#else
+ ::pthread_mutex_lock(&mLock);
+#endif
+ AEMU_IF_DEBUG(mIsLocked = true;)
+ }
+
+ bool tryLock() {
+ bool ret = false;
+#ifdef _WIN32
+ ret = ::TryEnterCriticalSection(&mLock);
+#else
+ ret = ::pthread_mutex_trylock(&mLock) == 0;
+#endif
+ AEMU_IF_DEBUG(mIsLocked = ret;)
+ return ret;
+ }
+
+ AEMU_IF_DEBUG(bool isLocked() const { return mIsLocked; })
+
+ // Release the lock.
+ void unlock() {
+ AEMU_IF_DEBUG(mIsLocked = false;)
+#ifdef _WIN32
+ ::LeaveCriticalSection(&mLock);
+#else
+ ::pthread_mutex_unlock(&mLock);
+#endif
+ }
+
+protected:
+ friend class ConditionVariable;
+
+#ifdef _WIN32
+ // We use CRITICAL_SECTION since it always allow recursive access.
+ CRITICAL_SECTION mLock;
+#else
+ pthread_mutex_t mLock = PTHREAD_MUTEX_INITIALIZER;
+#endif
+ // Both POSIX threads and WinAPI don't allow move (undefined behavior).
+ DISALLOW_COPY_ASSIGN_AND_MOVE(StaticLock);
+
+ AEMU_IF_DEBUG(bool mIsLocked = false;)
+};
+
+// Simple wrapper class for mutexes used in non-static context.
+class Lock : public StaticLock<false> {
+public:
+ using StaticLock::AutoLock;
+
+ constexpr Lock() = default;
+#ifndef _WIN32
+ // The only difference is that POSIX requires a deallocation function call
+ // for its mutexes.
+ ~Lock() { ::pthread_mutex_destroy(&mLock); }
+#endif
+};
+
+// Simple wrapper class for mutexes used in non-static context.
+class RecursiveLock : public StaticLock<true> {
+public:
+ using StaticLock::AutoLock;
+
+ RecursiveLock() = default;
+
+ ~RecursiveLock() {
+#ifdef _WIN32
+ ::DeleteCriticalSection(&mLock);
+#else
+ ::pthread_mutex_destroy(&mLock);
+#endif
+ }
+};
+
+class ReadWriteLock {
+public:
+ using AutoWriteLock = gfxstream::guest::AutoWriteLock;
+ using AutoReadLock = gfxstream::guest::AutoReadLock;
+
+#ifdef _WIN32
+ constexpr ReadWriteLock() = default;
+ ~ReadWriteLock() = default;
+ void lockRead() { ::AcquireSRWLockShared(&mLock); }
+ void unlockRead() { ::ReleaseSRWLockShared(&mLock); }
+ void lockWrite() { ::AcquireSRWLockExclusive(&mLock); }
+ void unlockWrite() { ::ReleaseSRWLockExclusive(&mLock); }
+
+private:
+ SRWLOCK mLock = SRWLOCK_INIT;
+#else // !_WIN32
+ ReadWriteLock() { ::pthread_rwlock_init(&mLock, NULL); }
+ ~ReadWriteLock() { ::pthread_rwlock_destroy(&mLock); }
+ void lockRead() { ::pthread_rwlock_rdlock(&mLock); }
+ void unlockRead() { ::pthread_rwlock_unlock(&mLock); }
+ void lockWrite() { ::pthread_rwlock_wrlock(&mLock); }
+ void unlockWrite() { ::pthread_rwlock_unlock(&mLock); }
+
+private:
+ pthread_rwlock_t mLock;
+#endif // !_WIN32
+
+ friend class ConditionVariable;
+ DISALLOW_COPY_ASSIGN_AND_MOVE(ReadWriteLock);
+};
+
+// Helper class to lock / unlock a mutex automatically on scope
+// entry and exit.
+// NB: not thread-safe (as opposed to the Lock class)
+template <class Lockable>
+class AutoLock {
+public:
+ AutoLock(Lockable& lock) : mLock(lock) { mLock.lock(); }
+
+ AutoLock(AutoLock<Lockable>&& other) : mLock(other.mLock), mLocked(other.mLocked) {
+ other.mLocked = false;
+ }
+
+ void lock() {
+ assert(!mLocked);
+ mLock.lock();
+ mLocked = true;
+ }
+
+ void unlock() {
+ assert(mLocked);
+ mLock.unlock();
+ mLocked = false;
+ }
+
+ bool isLocked() const { return mLocked; }
+
+ ~AutoLock() {
+ if (mLocked) {
+ mLock.unlock();
+ }
+ }
+
+private:
+ Lockable& mLock;
+ bool mLocked = true;
+
+ friend class ConditionVariable;
+ // Don't allow move because this class has a non-movable object.
+ DISALLOW_COPY_AND_ASSIGN(AutoLock);
+};
+
+class AutoWriteLock {
+public:
+ AutoWriteLock(ReadWriteLock& lock) : mLock(lock) { mLock.lockWrite(); }
+
+ void lockWrite() {
+ assert(!mWriteLocked);
+ mLock.lockWrite();
+ mWriteLocked = true;
+ }
+
+ void unlockWrite() {
+ assert(mWriteLocked);
+ mLock.unlockWrite();
+ mWriteLocked = false;
+ }
+
+ ~AutoWriteLock() {
+ if (mWriteLocked) {
+ mLock.unlockWrite();
+ }
+ }
+
+private:
+ ReadWriteLock& mLock;
+ bool mWriteLocked = true;
+ // This class has a non-movable object.
+ DISALLOW_COPY_ASSIGN_AND_MOVE(AutoWriteLock);
+};
+
+class AutoReadLock {
+public:
+ AutoReadLock(ReadWriteLock& lock) : mLock(lock) { mLock.lockRead(); }
+
+ void lockRead() {
+ assert(!mReadLocked);
+ mLock.lockRead();
+ mReadLocked = true;
+ }
+
+ void unlockRead() {
+ assert(mReadLocked);
+ mLock.unlockRead();
+ mReadLocked = false;
+ }
+
+ ~AutoReadLock() {
+ if (mReadLocked) {
+ mLock.unlockRead();
+ }
+ }
+
+private:
+ ReadWriteLock& mLock;
+ bool mReadLocked = true;
+ // This class has a non-movable object.
+ DISALLOW_COPY_ASSIGN_AND_MOVE(AutoReadLock);
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidMessageChannel.cpp b/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidMessageChannel.cpp
new file mode 100644
index 00000000000..9d699356413
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidMessageChannel.cpp
@@ -0,0 +1,120 @@
+// Copyright 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "aemu/base/synchronization/AndroidMessageChannel.h"
+
+namespace gfxstream {
+namespace guest {
+
+MessageChannelBase::MessageChannelBase(size_t capacity) : mCapacity(capacity) {}
+
+size_t MessageChannelBase::size() const {
+ AutoLock<Lock> lock(mLock);
+ return mCount;
+}
+
+void MessageChannelBase::stop() {
+ gfxstream::guest::AutoLock<Lock> lock(mLock);
+ mStopped = true;
+ mCount = 0;
+ mCanRead.broadcast();
+ mCanWrite.broadcastAndUnlock(&lock);
+}
+
+bool MessageChannelBase::isStopped() const {
+ AutoLock<Lock> lock(mLock);
+ return isStoppedLocked();
+}
+
+void MessageChannelBase::waitForEmpty() {
+ AutoLock<Lock> lock(mLock);
+ while (mCount > 0) {
+ mCanWrite.wait(&lock);
+ }
+}
+
+size_t MessageChannelBase::beforeWrite() {
+ mLock.lock();
+ while (mCount >= mCapacity && !mStopped) {
+ mCanWrite.wait(&mLock);
+ }
+ // Return value is undefined if stopped, so let's save a branch and skip the
+ // check for it.
+ size_t result = mPos + mCount;
+ if (result >= mCapacity) {
+ result -= mCapacity;
+ }
+ return result;
+}
+
+Optional<size_t> MessageChannelBase::beforeTryWrite() {
+ mLock.lock();
+
+ if (mCount >= mCapacity || mStopped) {
+ return {};
+ }
+ size_t result = mPos + mCount;
+ if (result >= mCapacity) {
+ result -= mCapacity;
+ }
+ return result;
+}
+
+void MessageChannelBase::afterWrite(bool success) {
+ if (success) {
+ ++mCount;
+ }
+ mCanRead.signalAndUnlock(&mLock);
+}
+
+size_t MessageChannelBase::beforeRead() {
+ mLock.lock();
+ while (mCount == 0 && !mStopped) {
+ mCanRead.wait(&mLock);
+ }
+ return mPos; // return value is undefined if stopped, so let's save a branch
+}
+
+Optional<size_t> MessageChannelBase::beforeTryRead() {
+ mLock.lock();
+
+ if (mCount == 0 || mStopped) {
+ return {};
+ }
+ return mPos;
+}
+
+Optional<size_t> MessageChannelBase::beforeTimedRead(uint64_t wallTimeUs) {
+ mLock.lock();
+
+ while (mCount == 0 && !mStopped) {
+ if (!mCanRead.timedWait(&mLock, wallTimeUs)) {
+ return {};
+ }
+ }
+ return mPos;
+}
+
+void MessageChannelBase::afterRead(bool success) {
+ if (success) {
+ if (++mPos == mCapacity) {
+ mPos = 0U;
+ }
+ --mCount;
+ }
+ mCanWrite.signalAndUnlock(&mLock);
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidMessageChannel.h b/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidMessageChannel.h
new file mode 100644
index 00000000000..528f8959dd2
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/synchronization/AndroidMessageChannel.h
@@ -0,0 +1,208 @@
+// Copyright 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/Optional.h"
+#include "aemu/base/synchronization/AndroidConditionVariable.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+
+#include <utility>
+#include <stddef.h>
+
+namespace gfxstream {
+namespace guest {
+
+// Base non-templated class used to reduce the amount of template
+// specialization.
+class MessageChannelBase {
+public:
+ // Get the current channel size
+ size_t size() const;
+
+ // Abort the currently pending operations and don't allow any other ones
+ void stop();
+
+ // Check if the channel is stopped.
+ bool isStopped() const;
+
+ // Block until the channel has no pending messages.
+ void waitForEmpty();
+
+protected:
+ // Constructor. |capacity| is the buffer capacity in messages.
+ MessageChannelBase(size_t capacity);
+
+ // Destructor.
+ ~MessageChannelBase() = default;
+
+ // Call this method in the sender thread before writing a new message.
+ // This returns the position of the available slot in the message array
+ // where to copy the new fixed-size message. After the copy, call
+ // afterWrite().
+ // If the channel is stopped, return value is undefined.
+ size_t beforeWrite();
+
+ // Same as beforeWrite(), but returns an empty optional if there was
+ // no room to write to instead of waiting for it.
+ // One still needs to call afterWrite() anyway.
+ Optional<size_t> beforeTryWrite();
+
+ // To be called after trying to write a new fixed-size message (which should
+ // happen after beforeWrite() or beforeTryWrite()).
+ // |success| must be true to indicate that a new item was added to the
+ // channel, or false otherwise (i.e. if the channel is stopped, or if
+ // beforeTryWrite() returned an empty optional).
+ void afterWrite(bool success);
+
+ // Call this method in the receiver thread before reading a new message.
+ // This returns the position in the message array where the new message
+ // can be read. Caller must process the message, then call afterRead().
+ // If the channel is stopped, return value is undefined.
+ size_t beforeRead();
+
+ // Same as beforeRead(), but returns an empty optional if there was
+ // no data to read instead of waiting for it.
+ // One still needs to call afterWrite() anyway.
+ Optional<size_t> beforeTryRead();
+
+ // Same as beforeRead(), but returns an empty optional if no data arrived
+ // by the |wallTimeUs| absolute time. One still needs to call
+ // afterWrite() anyway.
+ Optional<size_t> beforeTimedRead(uint64_t wallTimeUs);
+
+ // To be called after reading a fixed-size message from the channel (which
+ // must happen after beforeRead() or beforeTryRead()).
+ // |success| must be true to indicate that a message was read, or false
+ // otherwise (i.e. if the channel is stopped or if beforeTryRead() returned
+ // an empty optional).
+ void afterRead(bool success);
+
+ // A version of isStopped() that doesn't lock the channel but expects it
+ // to be locked by the caller.
+ bool isStoppedLocked() const { return mStopped; }
+
+private:
+ size_t mPos = 0;
+ size_t mCapacity;
+ size_t mCount = 0;
+ bool mStopped = false;
+ mutable Lock mLock; // Mutable to allow const members to lock it.
+ ConditionVariable mCanRead;
+ ConditionVariable mCanWrite;
+};
+
+// Helper class used to implement an uni-directional IPC channel between
+// two threads. The channel can be used to send fixed-size messages of type
+// |T|, with an internal buffer size of |CAPACITY| items. All calls are
+// blocking.
+//
+// Usage is pretty straightforward:
+//
+// - From the sender thread, call send(msg);
+// - From the receiver thread, call receive(&msg);
+// - If you want to stop the IPC, call stop();
+template <typename T, size_t CAPACITY>
+class MessageChannel : public MessageChannelBase {
+public:
+ MessageChannel() : MessageChannelBase(CAPACITY) {}
+
+ bool send(const T& msg) {
+ const size_t pos = beforeWrite();
+ const bool res = !isStoppedLocked();
+ if (res) {
+ mItems[pos] = msg;
+ }
+ afterWrite(res);
+ return res;
+ }
+
+ bool send(T&& msg) {
+ const size_t pos = beforeWrite();
+ const bool res = !isStoppedLocked();
+ if (res) {
+ mItems[pos] = std::move(msg);
+ }
+ afterWrite(res);
+ return res;
+ }
+
+ bool trySend(const T& msg) {
+ const auto pos = beforeTryWrite();
+ if (pos) {
+ mItems[*pos] = msg;
+ }
+ afterWrite(pos);
+ return pos;
+ }
+
+ bool trySend(T&& msg) {
+ const auto pos = beforeTryWrite();
+ if (pos) {
+ mItems[*pos] = std::move(msg);
+ }
+ afterWrite(pos);
+ return pos;
+ }
+
+ bool receive(T* msg) {
+ const size_t pos = beforeRead();
+ const bool res = !isStoppedLocked();
+ if (res) {
+ *msg = std::move(mItems[pos]);
+ }
+ afterRead(res);
+ return res;
+ }
+
+ Optional<T> receive() {
+ const size_t pos = beforeRead();
+ if (!isStoppedLocked()) {
+ Optional<T> msg(std::move(mItems[pos]));
+ afterRead(true);
+ return msg;
+ } else {
+ afterRead(false);
+ return {};
+ }
+ }
+
+ bool tryReceive(T* msg) {
+ const auto pos = beforeTryRead();
+ if (pos) {
+ *msg = std::move(mItems[*pos]);
+ }
+ afterRead(pos);
+ return pos;
+ }
+
+ Optional<T> timedReceive(uint64_t wallTimeUs) {
+ const auto pos = beforeTimedRead(wallTimeUs);
+ if (pos && !isStoppedLocked()) {
+ Optional<T> res(std::move(mItems[*pos]));
+ afterRead(true);
+ return res;
+ }
+ afterRead(false);
+ return {};
+ }
+
+ constexpr size_t capacity() const { return CAPACITY; }
+
+private:
+ T mItems[CAPACITY];
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidFunctorThread.cpp b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidFunctorThread.cpp
new file mode 100644
index 00000000000..80f4d7af29a
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidFunctorThread.cpp
@@ -0,0 +1,33 @@
+// 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.
+
+#include "aemu/base/threads/AndroidFunctorThread.h"
+
+#include <assert.h>
+
+namespace gfxstream {
+namespace guest {
+
+FunctorThread::FunctorThread(Functor&& func, ThreadFlags flags)
+ : Thread(flags)
+ , mThreadFunc(std::move(func)) {
+ assert(mThreadFunc);
+}
+
+intptr_t FunctorThread::main() {
+ return mThreadFunc();
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidFunctorThread.h b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidFunctorThread.h
new file mode 100644
index 00000000000..2f06cc33c8a
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidFunctorThread.h
@@ -0,0 +1,58 @@
+// 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.
+
+#pragma once
+
+#include "aemu/base/TypeTraits.h"
+#include "aemu/base/threads/AndroidThread.h"
+#include "aemu/base/threads/AndroidThreadTypes.h"
+
+#include <utility>
+
+// FunctorThread class is an implementation of base Thread interface that
+// allows one to run a function object in separate thread. It's mostly a
+// convenience class so one doesn't need to create a separate class if the only
+// needed thing is to run a specific existing function in a thread.
+
+namespace gfxstream {
+namespace guest {
+
+class FunctorThread : public gfxstream::guest::Thread {
+public:
+ using Functor = gfxstream::guest::ThreadFunctor;
+
+ explicit FunctorThread(const Functor& func,
+ ThreadFlags flags = ThreadFlags::MaskSignals)
+ : FunctorThread(Functor(func), flags) {}
+
+ explicit FunctorThread(Functor&& func,
+ ThreadFlags flags = ThreadFlags::MaskSignals);
+
+ // A constructor from a void function in case when result isn't important.
+ template <class Func, class = enable_if<is_callable_as<Func, void()>>>
+ explicit FunctorThread(Func&& func,
+ ThreadFlags flags = ThreadFlags::MaskSignals)
+ : Thread(flags), mThreadFunc([func = std::move(func)]() {
+ func();
+ return intptr_t();
+ }) {}
+
+private:
+ intptr_t main() override;
+
+ Functor mThreadFunc;
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThread.h b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThread.h
new file mode 100644
index 00000000000..60a95bb698e
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThread.h
@@ -0,0 +1,148 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/Compiler.h"
+#include "aemu/base/threads/AndroidThreadTypes.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <pthread.h>
+#endif
+
+#include <inttypes.h>
+
+namespace gfxstream {
+namespace guest {
+
+// Wrapper class for platform-specific threads.
+// To create your own thread, define a sub-class of emugl::Thread
+// and override its main() method.
+//
+// For example:
+//
+// class MyThread : public emugl::Thread {
+// public:
+// MyThread() : Thread() {}
+//
+// virtual intptr_t main() {
+// ... main thread loop implementation
+// return 0;
+// }
+// };
+//
+// ...
+//
+// // Create new instance, but does not start it.
+// MyThread* thread = new MyThread();
+//
+// // Start the thread.
+// thread->start();
+//
+// // Wait for thread completion, and gets result into |exitStatus|.
+// int exitStatus;
+// thread->wait(&exitStatus);
+//
+class Thread {
+ DISALLOW_COPY_ASSIGN_AND_MOVE(Thread);
+
+public:
+ // Public constructor.
+ Thread(ThreadFlags flags = ThreadFlags::MaskSignals, int stackSize = 0);
+
+ // Virtual destructor.
+ virtual ~Thread();
+
+ // Override this method in your own thread sub-classes. This will
+ // be called when start() is invoked on the Thread instance.
+ virtual intptr_t main() = 0;
+
+ // Override this if you need to execute some code after thread has
+ // exited main() and is guaranteed not to access any of its members.
+ // E.g. if you need to delete a thread object from the same thread
+ // it has created
+ virtual void onExit() {}
+
+ // Start a thread instance. Return true on success, false otherwise
+ // (e.g. if the thread was already started or terminated).
+ bool start();
+
+ // Wait for thread termination and retrieve exist status into
+ // |*exitStatus|. Return true on success, false otherwise.
+ // NOTE: |exitStatus| can be NULL.
+ virtual bool wait(intptr_t *exitStatus = nullptr);
+
+ // Check whether a thread has terminated. On success, return true
+ // and sets |*exitStatus|. On failure, return false.
+ // NOTE: |exitStatus| can be NULL.
+ bool tryWait(intptr_t *exitStatus);
+
+ // Mask all signals for the current thread
+ // This is needed for the qemu guest to run properly
+ // NB: noop for Win32
+ static void maskAllSignals();
+
+ // Sleep for |n| milliseconds
+ static void sleepMs(unsigned n);
+
+ // Sleep for |n| microseconds
+ static void sleepUs(unsigned n);
+
+ // Yield the remaining part of current thread's CPU time slice to another
+ // thread that's ready to run.
+ static void yield();
+
+private:
+#ifdef _WIN32
+ static DWORD WINAPI thread_main(void* arg);
+
+ HANDLE mThread = nullptr;
+#else // !WIN32
+ static void* thread_main(void* arg);
+
+ pthread_t mThread;
+#endif
+ Lock mLock;
+ // Access guarded by |mLock|.
+ intptr_t mExitStatus = 0;
+ int mStackSize;
+ const ThreadFlags mFlags;
+ bool mStarted = false;
+ // Access guarded by |mLock|.
+ bool mFinished = false;
+#ifndef _WIN32
+ // Posix-only, remember if we've joined our non-detached thread already.
+ bool mJoined = false;
+#endif
+};
+
+// Helper function to obtain a printable id for the current thread.
+unsigned long getCurrentThreadId();
+
+// Subclass of Thread covering interruptible threads.
+class InterruptibleThread : public Thread {
+ DISALLOW_COPY_ASSIGN_AND_MOVE(InterruptibleThread);
+public:
+ // Public constructor.
+ InterruptibleThread(ThreadFlags flags = ThreadFlags::MaskSignals, int stackSize = 0) :
+ Thread(flags, stackSize) { }
+
+ virtual void interrupt() = 0;
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadStore.cpp b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadStore.cpp
new file mode 100644
index 00000000000..f3e1ec31605
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadStore.cpp
@@ -0,0 +1,246 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "aemu/base/threads/AndroidThreadStore.h"
+
+#ifdef _WIN32
+#include "aemu/base/memory/LazyInstance.h"
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+// Set to 1 to print debug messages.
+#define DEBUG_THREAD_STORE 0
+
+#if DEBUG_THREAD_STORE
+# define D(...) do { printf("%s:%d: ", __FUNCTION__, __LINE__); printf(__VA_ARGS__); fflush(stdout); } while (0)
+#else
+# define D(...) ((void)0)
+#endif
+
+namespace gfxstream {
+namespace guest {
+
+#ifdef _WIN32
+
+namespace {
+
+// The ThreadStore implementation on Windows is very tricky, because
+// TlsAlloc() doesn't allow one to provide a destructor function. As
+// such threads are expected to destroy all TLS values explicitely.
+//
+// To solve this issue, this source file provides a static method called
+// ThreadStore::OnThreadExit() that must be called when a thread exits,
+// which will cleanup all values for the current thread.
+//
+// But this forces us to track thread-specific values ourselves.
+
+// Maximum amount of thread-specific slots supported by this implementation.
+enum {
+ kMaxTlsSlots = 64
+};
+
+// TlsSlotArray is a thread-specific array of values. Instances will
+// be stored in a Win32 TLS value controlled by a single master TLS
+// key.
+//
+typedef void* TlsSlotArray[kMaxTlsSlots];
+
+// Global state shared by all threads
+class GlobalState {
+public:
+ GlobalState() {
+ D("Entering\n");
+ mMasterTls = TlsAlloc();
+ D("Master TLS = %d\n", (int)mMasterTls);
+ InitializeCriticalSection(&mSection);
+ mLastIndex = 0;
+ ::memset(mDestructors, 0, sizeof(mDestructors));
+ D("Exiting\n");
+ }
+
+ // Register a new TLS key, or return -1 on error (too many keys).
+ // |destroy| is the destructor function for the key.
+ int registerKey(ThreadStoreBase::Destructor* destroy) {
+ D("Entering destroy=%p\n", destroy);
+ int ret = -1;
+ EnterCriticalSection(&mSection);
+ if (mLastIndex < kMaxTlsSlots) {
+ ret = mLastIndex++;
+ mDestructors[ret] = destroy;
+ }
+ LeaveCriticalSection(&mSection);
+ D("Exiting newKey=%d\n", ret);
+ return ret;
+ }
+
+ void unregisterKey(int key) {
+ D("key=%d\n", key);
+ if (key < 0 || key >= kMaxTlsSlots) {
+ D("Invalid key\n");
+ return;
+ }
+
+ // Note: keys are not reusable, but remove the destructor to avoid
+ // crashes in leaveCurrentThread() when it points to a function that
+ // is going to be unloaded from the process' address space.
+ EnterCriticalSection(&mSection);
+ mDestructors[key] = NULL;
+ LeaveCriticalSection(&mSection);
+ D("Exiting\n");
+ }
+
+ // Get the current thread-local value for a given |key|.
+ void* getValue(int key) const {
+ D("Entering key=%d\n", key);
+ if (key < 0 || key >= kMaxTlsSlots) {
+ D("Invalid key, result=NULL\n");
+ return NULL;
+ }
+
+ TlsSlotArray* array = getArray();
+ void* ret = (*array)[key];
+ D("Exiting keyValue=%p\n", ret);
+ return ret;
+ }
+
+ // Set the current thread-local |value| for a given |key|.
+ void setValue(int key, void* value) {
+ D("Entering key=%d\n",key);
+ if (key < 0 || key >= kMaxTlsSlots) {
+ D("Invalid key, returning\n");
+ return;
+ }
+
+ TlsSlotArray* array = getArray();
+ (*array)[key] = value;
+ D("Exiting\n");
+ }
+
+ // Call this when a thread exits to destroy all its thread-local values.
+ void leaveCurrentThread() {
+ D("Entering\n");
+ TlsSlotArray* array =
+ reinterpret_cast<TlsSlotArray*>(TlsGetValue(mMasterTls));
+ if (!array) {
+ D("Exiting, no thread-local data in this thread\n");
+ return;
+ }
+
+ for (size_t n = 0; n < kMaxTlsSlots; ++n) {
+ void* value = (*array)[n];
+ if (!value) {
+ continue;
+ }
+ (*array)[n] = NULL;
+
+ // NOTE: In theory, a destructor could reset the slot to
+ // a new value, and we would have to loop in this function
+ // in interesting ways. In practice, ignore the issue.
+ EnterCriticalSection(&mSection);
+ ThreadStoreBase::Destructor* destroy = mDestructors[n];
+ LeaveCriticalSection(&mSection);
+ if (destroy) {
+ D("Calling destructor %p for key=%d, with value=%p\n",
+ destroy, (int)n, value);
+ (*destroy)(value);
+ }
+ }
+ TlsSetValue(mMasterTls, NULL);
+ ::free(array);
+ D("Exiting\n");
+ }
+
+private:
+ // Return the thread-local array of TLS slots for the current thread.
+ // Cannot return NULL.
+ TlsSlotArray* getArray() const {
+ D("Entering\n");
+ TlsSlotArray* array =
+ reinterpret_cast<TlsSlotArray*>(TlsGetValue(mMasterTls));
+ if (!array) {
+ array = reinterpret_cast<TlsSlotArray*>(
+ ::calloc(sizeof(*array), 1));
+ TlsSetValue(mMasterTls, array);
+ D("Allocated new array at %p\n", array);
+ } else {
+ D("Retrieved array at %p\n", array);
+ }
+ return array;
+ }
+
+ DWORD mMasterTls;
+ CRITICAL_SECTION mSection;
+ int mLastIndex;
+ ThreadStoreBase::Destructor* mDestructors[kMaxTlsSlots];
+};
+
+LazyInstance<GlobalState> gGlobalState = LAZY_INSTANCE_INIT;
+
+} // namespace
+
+ThreadStoreBase::ThreadStoreBase(Destructor* destroy) {
+ D("Entering this=%p destroy=%p\n", this, destroy);
+ mKey = gGlobalState->registerKey(destroy);
+ D("Exiting this=%p key=%d\n", this, mKey);
+}
+
+ThreadStoreBase::~ThreadStoreBase() {
+ D("Entering this=%p\n", this);
+ GlobalState* state = gGlobalState.ptr();
+ state->unregisterKey(mKey);
+ D("Exiting this=%p\n", this);
+}
+
+void* ThreadStoreBase::get() const {
+ D("Entering this=%p\n", this);
+ void* ret = gGlobalState->getValue(mKey);
+ D("Exiting this=%p value=%p\n", this, ret);
+ return ret;
+}
+
+void ThreadStoreBase::set(void* value) {
+ D("Entering this=%p value=%p\n", this, value);
+ gGlobalState->setValue(mKey, value);
+ D("Exiting this=%p\n", this);
+}
+
+// static
+void ThreadStoreBase::OnThreadExit() {
+ gGlobalState->leaveCurrentThread();
+}
+
+#else // !_WIN32
+
+ThreadStoreBase::ThreadStoreBase(Destructor* destroy) {
+ int ret = pthread_key_create(&mKey, destroy);
+ if (ret != 0) {
+ fprintf(stderr,
+ "Could not create thread store key: %s\n",
+ strerror(ret));
+ exit(1);
+ }
+}
+
+ThreadStoreBase::~ThreadStoreBase() {
+ pthread_key_delete(mKey);
+}
+
+#endif // !_WIN32
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadStore.h b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadStore.h
new file mode 100644
index 00000000000..2f505ff6719
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadStore.h
@@ -0,0 +1,154 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/Compiler.h"
+
+#ifdef _WIN32
+# define WIN32_LEAN_AND_MEAN 1
+# include <windows.h>
+#else
+# include <pthread.h>
+#endif
+
+namespace gfxstream {
+namespace guest {
+
+// A class to model storage of thread-specific values, that can be
+// destroyed on thread exit.
+//
+// Note that on Windows, a thread must call OnThreadExit() explicitly
+// here to ensure that the values are probably discarded. This is an
+// unfortunate requirement of the Win32 API, which doesn't support
+// destructors at all.
+//
+// There are various hacks on the web to try to achieve this automatically
+// (e.g. [1]) but they rely on using the Microsoft build tools,
+// which doesn't work for us.
+//
+// Note another important issue with ThreadStore instances: if you create
+// one instance in a shared library, you need to make sure that it is
+// always destroyed before the library is unloaded. Otherwise, future
+// thread exit will likely crash, due to calling a destructor function
+// that is no longer in the process' address space.
+//
+// Finally, destroying an instance does _not_ free the corresponding values,
+// because doing so properly requires coordinating all participating threads,
+// which is impossible to achieve in the most general case. Thus, consider
+// that thread-local values are always leaked on library unload, or on
+// program exit.
+//
+// [1] http://stackoverflow.com/questions/14538159/about-tls-callback-in-windows
+
+// ThreadStoreBase is the base class used by all ThreadStore template
+// instances, used to reduce bloat.
+class ThreadStoreBase {
+public:
+ // Type of a function used to destroy a thread-specific value that
+ // was previously assigned by calling set().
+ typedef void (Destructor)(void* value);
+
+ // Initialize instance so that is hold keys that must be destroyed
+ // on thread exit by calling |destroy|.
+ explicit ThreadStoreBase(Destructor* destroy);
+
+ // NOTE: Destructor don't free the thread-local values, but are required
+ // to avoid crashes (see note above).
+ ~ThreadStoreBase();
+
+ // Retrieve current thread-specific value from store.
+#ifdef _WIN32
+ void* get() const;
+#else
+ inline void* get() const {
+ return pthread_getspecific(mKey);
+ }
+#endif
+
+ // Set the new thread-specific value.
+#ifdef _WIN32
+ void set(void* value);
+#else
+ inline void set(void* value) {
+ pthread_setspecific(mKey, value);
+ }
+#endif
+
+ inline void* swap(void* value) {
+ void* old = get();
+ set(value);
+ return old;
+ }
+
+#ifdef _WIN32
+ // Each thread should call this function on exit to ensure that
+ // all corresponding TLS values are properly freed.
+ static void OnThreadExit();
+#else
+ // Nothing to do on Posix.
+ static inline void OnThreadExit() {}
+#endif
+
+private:
+ // Ensure you can't create an empty ThreadStore instance.
+ ThreadStoreBase();
+
+ DISALLOW_COPY_AND_ASSIGN(ThreadStoreBase);
+
+#ifdef _WIN32
+ int mKey;
+#else
+ pthread_key_t mKey;
+#endif
+};
+
+// ThreadStore is a template class used to implement a thread-local store
+// of objects of type |T|. Note that the store owns the objects, and these
+// are destroyed when a gfxstream::guest::Thread exits.
+template <typename T>
+class ThreadStore : public ThreadStoreBase {
+public:
+ // Create a new ThreadStore instance.
+ ThreadStore() : ThreadStoreBase(myDestructor) {}
+
+ // Retrieve the thread-specific object instance, or NULL if set()
+ // was never called before in the current thread.
+ T* get() {
+ return static_cast<T*>(ThreadStoreBase::get());
+ }
+
+ // Set the current thread-specific objet instance for this thread.
+ // |t| is the new object instance.
+ // NOTE: Any previous object instance is deleted.
+ void set(T* t) {
+ T* old = static_cast<T*>(swap(t));
+ delete old;
+ }
+
+ // Swap the current thread-specific object for this thread.
+ // |t| is the new object instance.
+ // Return the previous one. Transfers ownership to the caller.
+ T* swap(T* t) {
+ return static_cast<T*>(ThreadStoreBase::swap(t));
+ }
+
+private:
+ static void myDestructor(void* opaque) {
+ delete static_cast<T*>(opaque);
+ }
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadTypes.h b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadTypes.h
new file mode 100644
index 00000000000..318d25f2aa1
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThreadTypes.h
@@ -0,0 +1,39 @@
+// 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.
+
+#pragma once
+
+#include "aemu/base/EnumFlags.h"
+
+#include <functional>
+#include <stdint.h>
+
+namespace gfxstream {
+namespace guest {
+
+// a functor which can run in a separate thread
+using ThreadFunctor = std::function<intptr_t()>;
+
+enum class ThreadFlags : unsigned char {
+ NoFlags = 0,
+ MaskSignals = 1,
+ // A Detach-ed thread is a launch-and-forget thread.
+ // wait() and tryWait() on a Detach-ed thread always fails.
+ // OTOH, if you don't wait() on a non Detach-ed thread it would do it
+ // in dtor anyway.
+ Detach = 1 << 1
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThread_pthread.cpp b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThread_pthread.cpp
new file mode 100644
index 00000000000..f7e229ec450
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidThread_pthread.cpp
@@ -0,0 +1,214 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "aemu/base/threads/AndroidThread.h"
+
+#include "aemu/base/threads/AndroidThreadStore.h"
+
+#include <log/log.h>
+#include <assert.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+#ifdef __linux__
+#include <sys/syscall.h>
+#include <sys/types.h>
+#endif
+
+#ifdef __Fuchsia__
+#include <zircon/process.h>
+#endif
+
+namespace gfxstream {
+namespace guest {
+
+Thread::Thread(ThreadFlags flags, int stackSize)
+ : mThread((pthread_t)NULL), mStackSize(stackSize), mFlags(flags) {}
+
+Thread::~Thread() {
+ assert(!mStarted || mFinished);
+ if ((mFlags & ThreadFlags::Detach) == ThreadFlags::NoFlags && mStarted &&
+ !mJoined) {
+ // Make sure we reclaim the OS resources.
+ pthread_join(mThread, nullptr);
+ }
+}
+
+bool Thread::start() {
+ if (mStarted) {
+ return false;
+ }
+
+ bool ret = true;
+ mStarted = true;
+
+ const auto useAttributes = mStackSize != 0;
+
+ pthread_attr_t attr;
+ if (useAttributes) {
+ pthread_attr_init(&attr);
+ pthread_attr_setstacksize(&attr, mStackSize);
+ }
+
+ if (pthread_create(&mThread, mStackSize ? &attr : nullptr, thread_main,
+ this)) {
+ ALOGE("Thread: failed to create a thread, errno %d\n", errno);
+ ret = false;
+ // We _do not_ need to guard this access to |mFinished| because we're
+ // sure that the launched thread failed, so there can't be parallel
+ // access.
+ mFinished = true;
+ mExitStatus = -errno;
+ // Nothing to join, so technically it's joined.
+ mJoined = true;
+ }
+
+ if (useAttributes) {
+ pthread_attr_destroy(&attr);
+ }
+
+ return ret;
+}
+
+bool Thread::wait(intptr_t* exitStatus) {
+ if (!mStarted || (mFlags & ThreadFlags::Detach) != ThreadFlags::NoFlags) {
+ return false;
+ }
+
+ // NOTE: Do not hold the lock when waiting for the thread to ensure
+ // it can update mFinished and mExitStatus properly in thread_main
+ // without blocking.
+ if (!mJoined && pthread_join(mThread, NULL)) {
+ return false;
+ }
+ mJoined = true;
+
+ if (exitStatus) {
+ *exitStatus = mExitStatus;
+ }
+ return true;
+}
+
+bool Thread::tryWait(intptr_t* exitStatus) {
+ if (!mStarted || (mFlags & ThreadFlags::Detach) != ThreadFlags::NoFlags) {
+ return false;
+ }
+
+ {
+ AutoLock<Lock> locker(mLock);
+ if (!mFinished) {
+ return false;
+ }
+ }
+
+ if (!mJoined) {
+ if (pthread_join(mThread, NULL)) {
+ ALOGW("Thread: failed to join a finished thread, errno %d\n", errno);
+ }
+ mJoined = true;
+ }
+
+ if (exitStatus) {
+ *exitStatus = mExitStatus;
+ }
+ return true;
+}
+
+// static
+void* Thread::thread_main(void* arg) {
+ intptr_t ret;
+
+ {
+ Thread* self = reinterpret_cast<Thread*>(arg);
+ if ((self->mFlags & ThreadFlags::MaskSignals) != ThreadFlags::NoFlags) {
+ Thread::maskAllSignals();
+ }
+
+ if ((self->mFlags & ThreadFlags::Detach) != ThreadFlags::NoFlags) {
+ if (pthread_detach(pthread_self())) {
+ // This only means a slow memory leak, so use VERBOSE.
+ ALOGV("Failed to set thread to detach mode\n");
+ }
+ }
+
+ ret = self->main();
+
+ {
+ AutoLock<Lock> lock(self->mLock);
+ self->mFinished = true;
+ self->mExitStatus = ret;
+ }
+
+ self->onExit();
+ // |self| is not valid beyond this point
+ }
+
+ gfxstream::guest::ThreadStoreBase::OnThreadExit();
+
+ // This return value is ignored.
+ return NULL;
+}
+
+// static
+void Thread::maskAllSignals() {
+ sigset_t set;
+ sigfillset(&set);
+ pthread_sigmask(SIG_SETMASK, &set, nullptr);
+}
+
+// static
+void Thread::sleepMs(unsigned n) {
+ usleep(n * 1000);
+}
+
+// static
+void Thread::sleepUs(unsigned n) {
+ usleep(n);
+}
+
+// static
+void Thread::yield() {
+ sched_yield();
+}
+
+unsigned long getCurrentThreadId() {
+#ifdef __ANDROID__
+ // bionic has an efficient implementation for gettid.
+ pid_t tid = gettid();
+#elif defined(__linux__)
+ // Linux doesn't always include an implementation of gettid, so we use syscall.
+ thread_local pid_t tid = -1;
+ if (tid == -1) {
+ tid = syscall(__NR_gettid);
+ }
+#elif defined(__Fuchsia__)
+ zx_handle_t tid = zx_thread_self();
+#else
+ pthread_t thread = pthread_self();
+ // POSIX doesn't require pthread_t to be a numeric type.
+ // Instead, just pick up the first sizeof(long) bytes as the "id".
+ static_assert(sizeof(thread) >= sizeof(long),
+ "Expected pthread_t to be at least sizeof(long) wide");
+ unsigned long tid = *reinterpret_cast<unsigned long*>(&tid);
+#endif
+ static_assert(sizeof(tid) <= sizeof(long),
+ "Expected thread handle to be at most sizeof(long) wide");
+ return static_cast<unsigned long>(tid);
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidWorkPool.cpp b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidWorkPool.cpp
new file mode 100644
index 00000000000..dafb6ea4f90
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidWorkPool.cpp
@@ -0,0 +1,467 @@
+// 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 "aemu/base/threads/AndroidWorkPool.h"
+
+#include "aemu/base/threads/AndroidFunctorThread.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+#include "aemu/base/synchronization/AndroidConditionVariable.h"
+#include "aemu/base/synchronization/AndroidMessageChannel.h"
+
+#include <atomic>
+#include <memory>
+#include <unordered_map>
+#include <sys/time.h>
+
+using gfxstream::guest::AutoLock;
+using gfxstream::guest::ConditionVariable;
+using gfxstream::guest::FunctorThread;
+using gfxstream::guest::Lock;
+using gfxstream::guest::MessageChannel;
+
+namespace gfxstream {
+namespace guest {
+
+class WaitGroup { // intrusive refcounted
+public:
+
+ WaitGroup(int numTasksRemaining) :
+ mNumTasksInitial(numTasksRemaining),
+ mNumTasksRemaining(numTasksRemaining) { }
+
+ ~WaitGroup() = default;
+
+ gfxstream::guest::Lock& getLock() { return mLock; }
+
+ void acquire() {
+ if (0 == mRefCount.fetch_add(1, std::memory_order_seq_cst)) {
+ ALOGE("%s: goofed, refcount0 acquire\n", __func__);
+ abort();
+ }
+ }
+
+ bool release() {
+ if (0 == mRefCount) {
+ ALOGE("%s: goofed, refcount0 release\n", __func__);
+ abort();
+ }
+ if (1 == mRefCount.fetch_sub(1, std::memory_order_seq_cst)) {
+ std::atomic_thread_fence(std::memory_order_acquire);
+ delete this;
+ return true;
+ }
+ return false;
+ }
+
+ // wait on all of or any of the associated tasks to complete.
+ bool waitAllLocked(WorkPool::TimeoutUs timeout) {
+ return conditionalTimeoutLocked(
+ [this] { return mNumTasksRemaining > 0; },
+ timeout);
+ }
+
+ bool waitAnyLocked(WorkPool::TimeoutUs timeout) {
+ return conditionalTimeoutLocked(
+ [this] { return mNumTasksRemaining == mNumTasksInitial; },
+ timeout);
+ }
+
+ // broadcasts to all waiters that there has been a new job that has completed
+ bool decrementBroadcast() {
+ AutoLock<Lock> lock(mLock);
+ bool done =
+ (1 == mNumTasksRemaining.fetch_sub(1, std::memory_order_seq_cst));
+ std::atomic_thread_fence(std::memory_order_acquire);
+ mCv.broadcast();
+ return done;
+ }
+
+private:
+
+ bool doWait(WorkPool::TimeoutUs timeout) {
+ if (timeout == ~0ULL) {
+ ALOGV("%s: uncond wait\n", __func__);
+ mCv.wait(&mLock);
+ return true;
+ } else {
+ return mCv.timedWait(&mLock, getDeadline(timeout));
+ }
+ }
+
+ struct timespec getDeadline(WorkPool::TimeoutUs relative) {
+ struct timeval deadlineUs;
+ struct timespec deadlineNs;
+ gettimeofday(&deadlineUs, 0);
+
+ auto prevDeadlineUs = deadlineUs.tv_usec;
+
+ deadlineUs.tv_usec += relative;
+
+ // Wrap around
+ if (prevDeadlineUs > deadlineUs.tv_usec) {
+ ++deadlineUs.tv_sec;
+ }
+
+ deadlineNs.tv_sec = deadlineUs.tv_sec;
+ deadlineNs.tv_nsec = deadlineUs.tv_usec * 1000LL;
+ return deadlineNs;
+ }
+
+ uint64_t currTimeUs() {
+ struct timeval tv;
+ gettimeofday(&tv, 0);
+ return (uint64_t)(tv.tv_sec * 1000000LL + tv.tv_usec);
+ }
+
+ bool conditionalTimeoutLocked(std::function<bool()> conditionFunc, WorkPool::TimeoutUs timeout) {
+ uint64_t currTime = currTimeUs();
+ WorkPool::TimeoutUs currTimeout = timeout;
+
+ while (conditionFunc()) {
+ doWait(currTimeout);
+ if (conditionFunc()) {
+ // Decrement timeout for wakeups
+ uint64_t nextTime = currTimeUs();
+ WorkPool::TimeoutUs waited =
+ nextTime - currTime;
+ currTime = nextTime;
+
+ if (currTimeout > waited) {
+ currTimeout -= waited;
+ } else {
+ return conditionFunc();
+ }
+ }
+ }
+
+ return true;
+ }
+
+ std::atomic<int> mRefCount = { 1 };
+ int mNumTasksInitial;
+ std::atomic<int> mNumTasksRemaining;
+
+ Lock mLock;
+ ConditionVariable mCv;
+};
+
+class WorkPoolThread {
+public:
+ // State diagram for each work pool thread
+ //
+ // Unacquired: (Start state) When no one else has claimed the thread.
+ // Acquired: When the thread has been claimed for work,
+ // but work has not been issued to it yet.
+ // Scheduled: When the thread is running tasks from the acquirer.
+ // Exiting: cleanup
+ //
+ // Messages:
+ //
+ // Acquire
+ // Run
+ // Exit
+ //
+ // Transitions:
+ //
+ // Note: While task is being run, messages will come back with a failure value.
+ //
+ // Unacquired:
+ // message Acquire -> Acquired. effect: return success value
+ // message Run -> Unacquired. effect: return failure value
+ // message Exit -> Exiting. effect: return success value
+ //
+ // Acquired:
+ // message Acquire -> Acquired. effect: return failure value
+ // message Run -> Scheduled. effect: run the task, return success
+ // message Exit -> Exiting. effect: return success value
+ //
+ // Scheduled:
+ // implicit effect: after task is run, transition back to Unacquired.
+ // message Acquire -> Scheduled. effect: return failure value
+ // message Run -> Scheduled. effect: return failure value
+ // message Exit -> queue up exit message, then transition to Exiting after that is done.
+ // effect: return success value
+ //
+ enum State {
+ Unacquired = 0,
+ Acquired = 1,
+ Scheduled = 2,
+ Exiting = 3,
+ };
+
+ WorkPoolThread() : mThread([this] { threadFunc(); }) {
+ mThread.start();
+ }
+
+ ~WorkPoolThread() {
+ exit();
+ mThread.wait();
+ }
+
+ bool acquire() {
+ AutoLock<Lock> lock(mLock);
+ switch (mState) {
+ case State::Unacquired:
+ mState = State::Acquired;
+ return true;
+ case State::Acquired:
+ case State::Scheduled:
+ case State::Exiting:
+ return false;
+ default:
+ return false;
+ }
+ }
+
+ bool run(WorkPool::WaitGroupHandle waitGroupHandle, WaitGroup* waitGroup, WorkPool::Task task) {
+ AutoLock<Lock> lock(mLock);
+ switch (mState) {
+ case State::Unacquired:
+ return false;
+ case State::Acquired: {
+ mState = State::Scheduled;
+ mToCleanupWaitGroupHandle = waitGroupHandle;
+ waitGroup->acquire();
+ mToCleanupWaitGroup = waitGroup;
+ mShouldCleanupWaitGroup = false;
+ TaskInfo msg = {
+ Command::Run,
+ waitGroup, task,
+ };
+ mRunMessages.send(msg);
+ return true;
+ }
+ case State::Scheduled:
+ case State::Exiting:
+ return false;
+ default:
+ return false;
+ }
+ }
+
+ bool shouldCleanupWaitGroup(WorkPool::WaitGroupHandle* waitGroupHandle, WaitGroup** waitGroup) {
+ AutoLock<Lock> lock(mLock);
+ bool res = mShouldCleanupWaitGroup;
+ *waitGroupHandle = mToCleanupWaitGroupHandle;
+ *waitGroup = mToCleanupWaitGroup;
+ mShouldCleanupWaitGroup = false;
+ return res;
+ }
+
+private:
+ enum Command {
+ Run = 0,
+ Exit = 1,
+ };
+
+ struct TaskInfo {
+ Command cmd;
+ WaitGroup* waitGroup = nullptr;
+ WorkPool::Task task = {};
+ };
+
+ bool exit() {
+ AutoLock<Lock> lock(mLock);
+ TaskInfo msg { Command::Exit, };
+ mRunMessages.send(msg);
+ return true;
+ }
+
+ void threadFunc() {
+ TaskInfo taskInfo;
+ bool done = false;
+
+ while (!done) {
+ mRunMessages.receive(&taskInfo);
+ switch (taskInfo.cmd) {
+ case Command::Run:
+ doRun(taskInfo);
+ break;
+ case Command::Exit: {
+ AutoLock<Lock> lock(mLock);
+ mState = State::Exiting;
+ break;
+ }
+ }
+ AutoLock<Lock> lock(mLock);
+ done = mState == State::Exiting;
+ }
+ }
+
+ // Assumption: the wait group refcount is >= 1 when entering
+ // this function (before decrement)..
+ // at least it doesn't get to 0
+ void doRun(TaskInfo& msg) {
+ WaitGroup* waitGroup = msg.waitGroup;
+
+ if (msg.task) msg.task();
+
+ bool lastTask =
+ waitGroup->decrementBroadcast();
+
+ AutoLock<Lock> lock(mLock);
+ mState = State::Unacquired;
+
+ if (lastTask) {
+ mShouldCleanupWaitGroup = true;
+ }
+
+ waitGroup->release();
+ }
+
+ FunctorThread mThread;
+ Lock mLock;
+ State mState = State::Unacquired;
+ MessageChannel<TaskInfo, 4> mRunMessages;
+ WorkPool::WaitGroupHandle mToCleanupWaitGroupHandle = 0;
+ WaitGroup* mToCleanupWaitGroup = nullptr;
+ bool mShouldCleanupWaitGroup = false;
+};
+
+class WorkPool::Impl {
+public:
+ Impl(int numInitialThreads) : mThreads(numInitialThreads) {
+ for (size_t i = 0; i < mThreads.size(); ++i) {
+ mThreads[i].reset(new WorkPoolThread);
+ }
+ }
+
+ ~Impl() = default;
+
+ WorkPool::WaitGroupHandle schedule(const std::vector<WorkPool::Task>& tasks) {
+
+ if (tasks.empty()) abort();
+
+ AutoLock<Lock> lock(mLock);
+
+ // Sweep old wait groups
+ for (size_t i = 0; i < mThreads.size(); ++i) {
+ WaitGroupHandle handle;
+ WaitGroup* waitGroup;
+ bool cleanup = mThreads[i]->shouldCleanupWaitGroup(&handle, &waitGroup);
+ if (cleanup) {
+ mWaitGroups.erase(handle);
+ waitGroup->release();
+ }
+ }
+
+ WorkPool::WaitGroupHandle resHandle = genWaitGroupHandleLocked();
+ WaitGroup* waitGroup =
+ new WaitGroup(tasks.size());
+
+ mWaitGroups[resHandle] = waitGroup;
+
+ std::vector<size_t> threadIndices;
+
+ while (threadIndices.size() < tasks.size()) {
+ for (size_t i = 0; i < mThreads.size(); ++i) {
+ if (!mThreads[i]->acquire()) continue;
+ threadIndices.push_back(i);
+ if (threadIndices.size() == tasks.size()) break;
+ }
+ if (threadIndices.size() < tasks.size()) {
+ mThreads.resize(mThreads.size() + 1);
+ mThreads[mThreads.size() - 1].reset(new WorkPoolThread);
+ }
+ }
+
+ // every thread here is acquired
+ for (size_t i = 0; i < threadIndices.size(); ++i) {
+ mThreads[threadIndices[i]]->run(resHandle, waitGroup, tasks[i]);
+ }
+
+ return resHandle;
+ }
+
+ bool waitAny(WorkPool::WaitGroupHandle waitGroupHandle, WorkPool::TimeoutUs timeout) {
+ AutoLock<Lock> lock(mLock);
+ auto it = mWaitGroups.find(waitGroupHandle);
+ if (it == mWaitGroups.end()) return true;
+
+ auto waitGroup = it->second;
+ waitGroup->acquire();
+ lock.unlock();
+
+ bool waitRes = false;
+
+ {
+ AutoLock<Lock> waitGroupLock(waitGroup->getLock());
+ waitRes = waitGroup->waitAnyLocked(timeout);
+ }
+
+ waitGroup->release();
+
+ return waitRes;
+ }
+
+ bool waitAll(WorkPool::WaitGroupHandle waitGroupHandle, WorkPool::TimeoutUs timeout) {
+ auto waitGroup = acquireWaitGroupFromHandle(waitGroupHandle);
+ if (!waitGroup) return true;
+
+ bool waitRes = false;
+
+ {
+ AutoLock<Lock> waitGroupLock(waitGroup->getLock());
+ waitRes = waitGroup->waitAllLocked(timeout);
+ }
+
+ waitGroup->release();
+
+ return waitRes;
+ }
+
+private:
+ // Increments wait group refcount by 1.
+ WaitGroup* acquireWaitGroupFromHandle(WorkPool::WaitGroupHandle waitGroupHandle) {
+ AutoLock<Lock> lock(mLock);
+ auto it = mWaitGroups.find(waitGroupHandle);
+ if (it == mWaitGroups.end()) return nullptr;
+
+ auto waitGroup = it->second;
+ waitGroup->acquire();
+
+ return waitGroup;
+ }
+
+ using WaitGroupStore = std::unordered_map<WorkPool::WaitGroupHandle, WaitGroup*>;
+
+ WorkPool::WaitGroupHandle genWaitGroupHandleLocked() {
+ WorkPool::WaitGroupHandle res = mNextWaitGroupHandle;
+ ++mNextWaitGroupHandle;
+ return res;
+ }
+
+ Lock mLock;
+ uint64_t mNextWaitGroupHandle = 0;
+ WaitGroupStore mWaitGroups;
+ std::vector<std::unique_ptr<WorkPoolThread>> mThreads;
+};
+
+WorkPool::WorkPool(int numInitialThreads) : mImpl(new WorkPool::Impl(numInitialThreads)) { }
+WorkPool::~WorkPool() = default;
+
+WorkPool::WaitGroupHandle WorkPool::schedule(const std::vector<WorkPool::Task>& tasks) {
+ return mImpl->schedule(tasks);
+}
+
+bool WorkPool::waitAny(WorkPool::WaitGroupHandle waitGroup, WorkPool::TimeoutUs timeout) {
+ return mImpl->waitAny(waitGroup, timeout);
+}
+
+bool WorkPool::waitAll(WorkPool::WaitGroupHandle waitGroup, WorkPool::TimeoutUs timeout) {
+ return mImpl->waitAll(waitGroup, timeout);
+}
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidWorkPool.h b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidWorkPool.h
new file mode 100644
index 00000000000..3aede31b263
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/aemu/base/threads/AndroidWorkPool.h
@@ -0,0 +1,49 @@
+
+// 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 <functional>
+#include <memory>
+#include <vector>
+
+namespace gfxstream {
+namespace guest {
+
+// WorkPool provides a way to queue several different + arbitrary wait / signal
+// operations. There is no specific imposed order to the operations; all
+// ordering is derived from dependencies among the queued tasks. The number of
+// threads used is the number of concurrent tasks in flight. Tasks are sent in
+// groups, representing a collection that can be waited on (a wait group).
+class WorkPool {
+public:
+ using Task = std::function<void()>;
+ using WaitGroupHandle = uint64_t;
+ using TimeoutUs = uint64_t;
+
+ WorkPool(int numInitialThreads = 4);
+ ~WorkPool();
+
+ WaitGroupHandle schedule(const std::vector<Task>& tasks);
+
+ bool waitAny(WaitGroupHandle waitGroup, TimeoutUs timeout = -1);
+ bool waitAll(WaitGroupHandle waitGroup, TimeoutUs timeout = -1);
+private:
+ class Impl;
+ std::unique_ptr<Impl> mImpl;
+};
+
+} // namespace guest
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/android-emu/android/utils/compiler.h b/src/gfxstream/guest/android-emu/android/utils/compiler.h
new file mode 100644
index 00000000000..fae091885c0
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/android/utils/compiler.h
@@ -0,0 +1,32 @@
+// Copyright 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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
+
+#ifdef __cplusplus
+#define ANDROID_BEGIN_HEADER extern "C" {
+#define ANDROID_END_HEADER }
+#else
+#define ANDROID_BEGIN_HEADER /* nothing */
+#define ANDROID_END_HEADER /* nothing */
+#endif
+
+// ANDROID_GCC_PREREQ(<major>,<minor>) will evaluate to true
+// iff the current version of GCC is <major>.<minor> or higher.
+#if defined(__GNUC__) && defined(__GNUC_MINOR__)
+# define ANDROID_GCC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define ANDROID_GCC_PREREQ(maj, min) 0
+#endif
diff --git a/src/gfxstream/guest/android-emu/android/utils/debug.c b/src/gfxstream/guest/android-emu/android/utils/debug.c
new file mode 100644
index 00000000000..be166bb88e6
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/android/utils/debug.c
@@ -0,0 +1,165 @@
+/* Copyright (C) 2007-2008 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.
+*/
+#include "android/utils/debug.h"
+
+#include <fcntl.h> // for open, O_WRONLY
+#include <stdint.h> // for uint64_t
+#include <stdio.h> // for fileno, fprintf, printf, stdout
+
+#ifdef _MSC_VER
+#include "msvc-posix.h"
+#else
+#include <sys/time.h>
+#include <time.h> // for localtime, tm, time_t
+#include <unistd.h> // for dup2, close, dup
+#endif
+
+
+// TODO(jansene): Some external libraries (nibmle) still rely on these, so we cannot remove them yet.
+#undef dprint
+#undef dinfo
+#undef derror
+#undef dwarning
+
+uint64_t android_verbose = 0;
+LogSeverity android_log_severity = EMULATOR_LOG_INFO;
+
+void dprint(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ fdprintfnv(stdout, 0, format, args);
+ va_end(args);
+}
+
+void fdprintf(FILE* fp, const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ fdprintfnv(fp, 0, format, args);
+ va_end(args);
+}
+
+void fdprintfnv(FILE* fp, const char* lvl, const char* format, va_list args) {
+ if (VERBOSE_CHECK(time)) {
+ struct timeval tv;
+ gettimeofday(&tv, 0);
+ time_t now = tv.tv_sec;
+ struct tm* time = localtime(&now);
+ fprintf(fp, "%02d:%02d:%02d.%05ld ", time->tm_hour, time->tm_min,
+ time->tm_sec, tv.tv_usec);
+ }
+ fprintf(fp, "emulator: ");
+ if (lvl) {
+ fprintf(fp, "%s", lvl);
+ }
+ vfprintf(fp, format, args);
+ fprintf(fp, "\n");
+}
+
+void dprintn(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ vfprintf(stdout, format, args);
+ va_end(args);
+}
+
+void dprintnv(const char* format, va_list args) {
+ vfprintf(stdout, format, args);
+}
+void dinfo(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ fdprintfnv(stdout, "INFO: ", format, args);
+ va_end(args);
+}
+
+void dwarning(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ fdprintfnv(stdout, "WARNING: ", format, args);
+ va_end(args);
+}
+
+void derror(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ fdprintfnv(stdout, "ERROR: ", format, args);
+ va_end(args);
+}
+
+
+/** STDOUT/STDERR REDIRECTION
+ **
+ ** allows you to shut temporarily shutdown stdout/stderr
+ ** this is useful to get rid of debug messages from ALSA and esd
+ ** on Linux.
+ **/
+static int stdio_disable_count;
+static int stdio_save_out_fd;
+static int stdio_save_err_fd;
+
+#ifdef _WIN32
+extern void stdio_disable(void) {
+ if (++stdio_disable_count == 1) {
+ int null_fd, out_fd, err_fd;
+ fflush(stdout);
+ out_fd = _fileno(stdout);
+ err_fd = _fileno(stderr);
+ stdio_save_out_fd = _dup(out_fd);
+ stdio_save_err_fd = _dup(err_fd);
+ null_fd = _open("NUL", _O_WRONLY);
+ _dup2(null_fd, out_fd);
+ _dup2(null_fd, err_fd);
+ close(null_fd);
+ }
+}
+
+extern void stdio_enable(void) {
+ if (--stdio_disable_count == 0) {
+ int out_fd, err_fd;
+ fflush(stdout);
+ out_fd = _fileno(stdout);
+ err_fd = _fileno(stderr);
+ _dup2(stdio_save_out_fd, out_fd);
+ _dup2(stdio_save_err_fd, err_fd);
+ _close(stdio_save_out_fd);
+ _close(stdio_save_err_fd);
+ }
+}
+#else
+extern void stdio_disable(void) {
+ if (++stdio_disable_count == 1) {
+ int null_fd, out_fd, err_fd;
+ fflush(stdout);
+ out_fd = fileno(stdout);
+ err_fd = fileno(stderr);
+ stdio_save_out_fd = dup(out_fd);
+ stdio_save_err_fd = dup(err_fd);
+ null_fd = open("/dev/null", O_WRONLY);
+ dup2(null_fd, out_fd);
+ dup2(null_fd, err_fd);
+ close(null_fd);
+ }
+}
+
+extern void stdio_enable(void) {
+ if (--stdio_disable_count == 0) {
+ int out_fd, err_fd;
+ fflush(stdout);
+ out_fd = fileno(stdout);
+ err_fd = fileno(stderr);
+ dup2(stdio_save_out_fd, out_fd);
+ dup2(stdio_save_err_fd, err_fd);
+ close(stdio_save_out_fd);
+ close(stdio_save_err_fd);
+ }
+}
+#endif
diff --git a/src/gfxstream/guest/android-emu/android/utils/debug.h b/src/gfxstream/guest/android-emu/android/utils/debug.h
new file mode 100644
index 00000000000..3de53b0c201
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/android/utils/debug.h
@@ -0,0 +1,174 @@
+/* Copyright (C) 2007-2008 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 <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#include "android/utils/compiler.h"
+#include "android/utils/log_severity.h"
+
+ANDROID_BEGIN_HEADER
+
+#define VERBOSE_TAG_LIST \
+ _VERBOSE_TAG(init, "emulator initialization") \
+ _VERBOSE_TAG(console, "control console") \
+ _VERBOSE_TAG(modem, "emulated GSM modem") \
+ _VERBOSE_TAG(radio, "emulated GSM AT Command channel") \
+ _VERBOSE_TAG(keys, "key bindings & presses") \
+ _VERBOSE_TAG(events, "events sent to the emulator") \
+ _VERBOSE_TAG(slirp, "internal router/firewall") \
+ _VERBOSE_TAG(timezone, "host timezone detection") \
+ _VERBOSE_TAG(socket, "network sockets") \
+ _VERBOSE_TAG(proxy, "network proxy support") \
+ _VERBOSE_TAG(audio, "audio sub-system") \
+ _VERBOSE_TAG(audioin, "audio input backend") \
+ _VERBOSE_TAG(audioout, "audio output backend") \
+ _VERBOSE_TAG(surface, "video surface support") \
+ _VERBOSE_TAG(qemud, "qemud multiplexer daemon") \
+ _VERBOSE_TAG(gps, "emulated GPS") \
+ _VERBOSE_TAG(nand_limits, "nand/flash read/write thresholding") \
+ _VERBOSE_TAG(hw_control, "emulated power/flashlight/led/vibrator") \
+ _VERBOSE_TAG(avd_config, "android virtual device configuration") \
+ _VERBOSE_TAG(sensors, "emulated sensors") \
+ _VERBOSE_TAG(memcheck, "memory checker") \
+ _VERBOSE_TAG(camera, "camera") \
+ _VERBOSE_TAG(adevice, "android device connected via port forwarding") \
+ _VERBOSE_TAG(sensors_port, "sensors emulator connected to android device") \
+ _VERBOSE_TAG(mtport, "multi-touch emulator connected to android device") \
+ _VERBOSE_TAG(mtscreen, "multi-touch screen emulation") \
+ _VERBOSE_TAG(gles, "hardware OpenGLES emulation") \
+ _VERBOSE_TAG(gles1emu, "emulated GLESv1 renderer") \
+ _VERBOSE_TAG(adbserver, "ADB server") \
+ _VERBOSE_TAG(adbclient, "ADB QEMU client") \
+ _VERBOSE_TAG(adb, "ADB debugger") \
+ _VERBOSE_TAG(asconnector, "Asynchronous socket connector") \
+ _VERBOSE_TAG(asyncsocket, "Asynchronous socket") \
+ _VERBOSE_TAG(sdkctlsocket, "Socket tethering to SdkControl server") \
+ _VERBOSE_TAG(updater, "Update checker") \
+ _VERBOSE_TAG(metrics, "Metrics reporting") \
+ _VERBOSE_TAG(rotation, "Device rotation debugging") \
+ _VERBOSE_TAG(goldfishsync, "Goldfish Sync Device") \
+ _VERBOSE_TAG(syncthreads, "HostGPU Sync Threads") \
+ _VERBOSE_TAG(memory, "Memory Usage Report") \
+ _VERBOSE_TAG(car, "Emulated car data") \
+ _VERBOSE_TAG(record, "Screen recording") \
+ _VERBOSE_TAG(snapshot, "Snapshots") \
+ _VERBOSE_TAG(virtualscene, "Virtual scene rendering") \
+ _VERBOSE_TAG(automation, "Automation") \
+ _VERBOSE_TAG(offworld, "Offworld") \
+ _VERBOSE_TAG(videoinjection, "Video injection") \
+ _VERBOSE_TAG(foldable, "Foldable Device") \
+ _VERBOSE_TAG(curl, "Libcurl requests") \
+ _VERBOSE_TAG(car_rotary, "Car rotary controller") \
+ _VERBOSE_TAG(wifi, "Virtio Wifi") \
+ _VERBOSE_TAG(tvremote, "TV remote") \
+ _VERBOSE_TAG(time, "Prefix a timestamp when logging") \
+ _VERBOSE_TAG(ini, "Log details around ini files.") \
+ _VERBOSE_TAG(bluetooth, "Log bluetooth details.") \
+ _VERBOSE_TAG(log, "Include timestamp, thread and location in logs")
+
+#define _VERBOSE_TAG(x, y) VERBOSE_##x,
+typedef enum {
+ VERBOSE_TAG_LIST VERBOSE_MAX /* do not remove */
+} VerboseTag;
+#undef _VERBOSE_TAG
+
+extern uint64_t android_verbose;
+
+// Enable/disable verbose logs from the base/* family.
+extern void base_enable_verbose_logs();
+extern void base_disable_verbose_logs();
+#define VERBOSE_ENABLE(tag) android_verbose |= (1ULL << VERBOSE_##tag)
+
+#define VERBOSE_DISABLE(tag) android_verbose &= (1ULL << VERBOSE_##tag)
+
+#define VERBOSE_CHECK(tag) ((android_verbose & (1ULL << VERBOSE_##tag)) != 0)
+
+#define VERBOSE_CHECK_ANY() (android_verbose != 0)
+
+extern void __emu_log_print(LogSeverity prio,
+ const char* file,
+ int line,
+ const char* fmt,
+ ...);
+
+#ifndef EMULOG
+#define EMULOG(priority, fmt, ...) \
+ __emu_log_print(priority, __FILE__, __LINE__, fmt, ##__VA_ARGS__);
+#endif
+
+#define VERBOSE_PRINT(tag, ...) \
+ if (VERBOSE_CHECK(tag)) { \
+ EMULOG(EMULATOR_LOG_VERBOSE, ##__VA_ARGS__); \
+ }
+
+#define VERBOSE_INFO(tag, ...) \
+ if (VERBOSE_CHECK(tag)) { \
+ EMULOG(EMULATOR_LOG_INFO, ##__VA_ARGS__); \
+ }
+
+#define VERBOSE_DPRINT(tag, ...) VERBOSE_PRINT(tag, __VA_ARGS__)
+
+extern void dprintn(const char* format, ...);
+
+extern void fdprintfnv(FILE* fp,
+ const char* level,
+ const char* format,
+ va_list args);
+
+// Logging support.
+
+#define dprint(fmt, ...) \
+ if (EMULATOR_LOG_VERBOSE >= android_log_severity) { \
+ EMULOG(EMULATOR_LOG_VERBOSE, fmt, ##__VA_ARGS__) \
+ }
+
+#define dinfo(fmt, ...) \
+ if (EMULATOR_LOG_INFO >= android_log_severity) { \
+ EMULOG(EMULATOR_LOG_INFO, fmt, ##__VA_ARGS__) \
+ }
+#define dwarning(fmt, ...) \
+ if (EMULATOR_LOG_WARNING >= android_log_severity) { \
+ EMULOG(EMULATOR_LOG_WARNING, fmt, ##__VA_ARGS__) \
+ }
+#define derror(fmt, ...) \
+ if (EMULATOR_LOG_ERROR >= android_log_severity) { \
+ EMULOG(EMULATOR_LOG_ERROR, fmt, ##__VA_ARGS__) \
+ }
+#define dfatal(fmt, ...) EMULOG(EMULATOR_LOG_FATAL, fmt, ##__VA_ARGS__)
+
+/** MULTITHREADED DEBUG TRACING
+ **
+ ** 'android_tid_function_print' is for tracing in multi-threaded situations.
+ ** It prints "emulator: " or not (depending on |use_emulator_prefix|),
+ ** the thread id, a function name (|function|), the message, and finally '\n'.
+ */
+extern void android_tid_function_print(bool use_emulator_prefix,
+ const char* function,
+ const char* format,
+ ...);
+
+/** STDOUT/STDERR REDIRECTION
+ **
+ ** allows you to shut temporarily shutdown stdout/stderr
+ ** this is useful to get rid of debug messages from ALSA and esd
+ ** on Linux.
+ **/
+
+extern void stdio_disable(void);
+extern void stdio_enable(void);
+
+ANDROID_END_HEADER
diff --git a/src/gfxstream/guest/android-emu/android/utils/log_severity.h b/src/gfxstream/guest/android-emu/android/utils/log_severity.h
new file mode 100644
index 00000000000..2b27f6949b5
--- /dev/null
+++ b/src/gfxstream/guest/android-emu/android/utils/log_severity.h
@@ -0,0 +1,42 @@
+// 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.
+#pragma once
+#include "android/utils/compiler.h"
+#include "android/utils/log_severity.h"
+
+ANDROID_BEGIN_HEADER
+
+// Defines the available log severities.
+
+typedef enum LogSeverity {
+ EMULATOR_LOG_DEBUG = -2,
+ EMULATOR_LOG_VERBOSE = -1,
+ EMULATOR_LOG_INFO = 0,
+ EMULATOR_LOG_WARNING = 1,
+ EMULATOR_LOG_ERROR = 2,
+ EMULATOR_LOG_FATAL = 3,
+ EMULATOR_LOG_NUM_SEVERITIES,
+
+// DFATAL will be ERROR in release builds, and FATAL in debug ones.
+#ifdef NDEBUG
+ EMULATOR_LOG_DFATAL = EMULATOR_LOG_ERROR,
+#else
+ EMULATOR_LOG_DFATAL = EMULATOR_LOG_FATAL,
+#endif
+} LogSeverity;
+
+extern LogSeverity android_log_severity;
+// #endif
+
+ANDROID_END_HEADER
diff --git a/src/gfxstream/guest/fuchsia/fuchsia_stdio.cc b/src/gfxstream/guest/fuchsia/fuchsia_stdio.cc
new file mode 100644
index 00000000000..acfb2ca5e3f
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/fuchsia_stdio.cc
@@ -0,0 +1,89 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <assert.h>
+#include <lib/syslog/global.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void __assert_fail(const char *expr, const char *file, int line, const char *func)
+{
+ FX_LOGF(ERROR, "goldfish", "Assertion failed: %s (%s: %s: %d)", expr, file, func, line);
+ abort();
+}
+
+int puts(const char *s)
+{
+ return fputs(s, stdout);
+}
+
+int printf(const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ vfprintf(stdout, format, args);
+ va_end(args);
+ return 0;
+}
+
+int vprintf(const char *format, va_list ap)
+{
+ return vfprintf(stdout, format, ap);
+}
+
+int fprintf(FILE *stream, const char *format, ...)
+{
+ assert(stream == stdout || stream == stderr);
+ if (stream == stdout || stream == stderr)
+ {
+ va_list args;
+ va_start(args, format);
+ vfprintf(stream, format, args);
+ va_end(args);
+ }
+ return 0;
+}
+
+static inline fx_log_severity_t severity(FILE *stream)
+{
+ return stream == stdout ? FX_LOG_INFO : FX_LOG_ERROR;
+}
+
+int fputs(const char *s, FILE *stream)
+{
+ assert(stream == stdout || stream == stderr);
+ if (stream == stdout || stream == stderr)
+ {
+ _FX_LOG(severity(stream), "goldfish", s);
+ }
+ return 0;
+}
+
+int vfprintf(FILE *stream, const char *format, va_list ap)
+{
+ assert(stream == stdout || stream == stderr);
+ if (stream == stdout || stream == stderr)
+ {
+ _FX_LOGVF(severity(stream), "goldfish", __FILE__, __LINE__,format, ap);
+ }
+ return 0;
+}
+
+size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream)
+{
+ assert(stream == stdout || stream == stderr);
+ char buffer[512];
+ size_t offset = 0;
+ size_t count = 0;
+ for (; count < nitems; count++)
+ {
+ snprintf(buffer + offset, sizeof(buffer) - offset, reinterpret_cast<const char *>(ptr) + offset, size);
+ offset += size;
+ if (offset > sizeof(buffer))
+ break;
+ }
+ buffer[sizeof(buffer) - 1] = 0;
+ fputs(buffer, stream);
+ return count;
+}
diff --git a/src/gfxstream/guest/fuchsia/include/android/hardware_buffer.h b/src/gfxstream/guest/fuchsia/include/android/hardware_buffer.h
new file mode 100644
index 00000000000..3d31f52117c
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/android/hardware_buffer.h
@@ -0,0 +1,535 @@
+/*
+ * 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.
+ */
+
+/**
+ * @file hardware_buffer.h
+ * @brief API for native hardware buffers.
+ */
+/**
+ * @defgroup AHardwareBuffer Native Hardware Buffer
+ *
+ * AHardwareBuffer objects represent chunks of memory that can be
+ * accessed by various hardware components in the system. It can be
+ * easily converted to the Java counterpart
+ * android.hardware.HardwareBuffer and passed between processes using
+ * Binder. All operations involving AHardwareBuffer and HardwareBuffer
+ * are zero-copy, i.e., passing AHardwareBuffer to another process
+ * creates a shared view of the same region of memory.
+ *
+ * AHardwareBuffers can be bound to EGL/OpenGL and Vulkan primitives.
+ * For EGL, use the extension function eglGetNativeClientBufferANDROID
+ * to obtain an EGLClientBuffer and pass it directly to
+ * eglCreateImageKHR. Refer to the EGL extensions
+ * EGL_ANDROID_get_native_client_buffer and
+ * EGL_ANDROID_image_native_buffer for more information. In Vulkan,
+ * the contents of the AHardwareBuffer can be accessed as external
+ * memory. See the VK_ANDROID_external_memory_android_hardware_buffer
+ * extension for details.
+ *
+ * @{
+ */
+
+#ifndef ANDROID_HARDWARE_BUFFER_H
+#define ANDROID_HARDWARE_BUFFER_H
+
+#include <inttypes.h>
+
+#include <android/rect.h>
+/**
+ * Buffer pixel formats.
+ */
+enum AHardwareBuffer_Format {
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_R8G8B8A8_UNORM
+ * OpenGL ES: GL_RGBA8
+ */
+ AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM = 1,
+
+ /**
+ * 32 bits per pixel, 8 bits per channel format where alpha values are
+ * ignored (always opaque).
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_R8G8B8A8_UNORM
+ * OpenGL ES: GL_RGB8
+ */
+ AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM = 2,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_R8G8B8_UNORM
+ * OpenGL ES: GL_RGB8
+ */
+ AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM = 3,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_R5G6B5_UNORM_PACK16
+ * OpenGL ES: GL_RGB565
+ */
+ AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM = 4,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_R16G16B16A16_SFLOAT
+ * OpenGL ES: GL_RGBA16F
+ */
+ AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT = 0x16,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_A2B10G10R10_UNORM_PACK32
+ * OpenGL ES: GL_RGB10_A2
+ */
+ AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM = 0x2b,
+
+ /**
+ * Opaque binary blob format.
+ * Must have height 1 and one layer, with width equal to the buffer
+ * size in bytes. Corresponds to Vulkan buffers and OpenGL buffer
+ * objects. Can be bound to the latter using GL_EXT_external_buffer.
+ */
+ AHARDWAREBUFFER_FORMAT_BLOB = 0x21,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_D16_UNORM
+ * OpenGL ES: GL_DEPTH_COMPONENT16
+ */
+ AHARDWAREBUFFER_FORMAT_D16_UNORM = 0x30,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_X8_D24_UNORM_PACK32
+ * OpenGL ES: GL_DEPTH_COMPONENT24
+ */
+ AHARDWAREBUFFER_FORMAT_D24_UNORM = 0x31,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_D24_UNORM_S8_UINT
+ * OpenGL ES: GL_DEPTH24_STENCIL8
+ */
+ AHARDWAREBUFFER_FORMAT_D24_UNORM_S8_UINT = 0x32,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_D32_SFLOAT
+ * OpenGL ES: GL_DEPTH_COMPONENT32F
+ */
+ AHARDWAREBUFFER_FORMAT_D32_FLOAT = 0x33,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_D32_SFLOAT_S8_UINT
+ * OpenGL ES: GL_DEPTH32F_STENCIL8
+ */
+ AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT = 0x34,
+
+ /**
+ * Corresponding formats:
+ * Vulkan: VK_FORMAT_S8_UINT
+ * OpenGL ES: GL_STENCIL_INDEX8
+ */
+ AHARDWAREBUFFER_FORMAT_S8_UINT = 0x35,
+
+ /**
+ * YUV 420 888 format.
+ * Must have an even width and height. Can be accessed in OpenGL
+ * shaders through an external sampler. Does not support mip-maps
+ * cube-maps or multi-layered textures.
+ */
+ AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 = 0x23,
+};
+
+/**
+ * Buffer usage flags, specifying how the buffer will be accessed.
+ */
+enum AHardwareBuffer_UsageFlags {
+ /// The buffer will never be locked for direct CPU reads using the
+ /// AHardwareBuffer_lock() function. Note that reading the buffer
+ /// using OpenGL or Vulkan functions or memory mappings is still
+ /// allowed.
+ AHARDWAREBUFFER_USAGE_CPU_READ_NEVER = 0UL,
+ /// The buffer will sometimes be locked for direct CPU reads using
+ /// the AHardwareBuffer_lock() function. Note that reading the
+ /// buffer using OpenGL or Vulkan functions or memory mappings
+ /// does not require the presence of this flag.
+ AHARDWAREBUFFER_USAGE_CPU_READ_RARELY = 2UL,
+ /// The buffer will often be locked for direct CPU reads using
+ /// the AHardwareBuffer_lock() function. Note that reading the
+ /// buffer using OpenGL or Vulkan functions or memory mappings
+ /// does not require the presence of this flag.
+ AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN = 3UL,
+ /// CPU read value mask.
+ AHARDWAREBUFFER_USAGE_CPU_READ_MASK = 0xFUL,
+
+ /// The buffer will never be locked for direct CPU writes using the
+ /// AHardwareBuffer_lock() function. Note that writing the buffer
+ /// using OpenGL or Vulkan functions or memory mappings is still
+ /// allowed.
+ AHARDWAREBUFFER_USAGE_CPU_WRITE_NEVER = 0UL << 4,
+ /// The buffer will sometimes be locked for direct CPU writes using
+ /// the AHardwareBuffer_lock() function. Note that writing the
+ /// buffer using OpenGL or Vulkan functions or memory mappings
+ /// does not require the presence of this flag.
+ AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY = 2UL << 4,
+ /// The buffer will often be locked for direct CPU writes using
+ /// the AHardwareBuffer_lock() function. Note that writing the
+ /// buffer using OpenGL or Vulkan functions or memory mappings
+ /// does not require the presence of this flag.
+ AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN = 3UL << 4,
+ /// CPU write value mask.
+ AHARDWAREBUFFER_USAGE_CPU_WRITE_MASK = 0xFUL << 4,
+
+ /// The buffer will be read from by the GPU as a texture.
+ AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE = 1UL << 8,
+ /// The buffer will be written to by the GPU as a framebuffer attachment.
+ AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER = 1UL << 9,
+ /**
+ * The buffer will be written to by the GPU as a framebuffer
+ * attachment.
+ *
+ * Note that the name of this flag is somewhat misleading: it does
+ * not imply that the buffer contains a color format. A buffer with
+ * depth or stencil format that will be used as a framebuffer
+ * attachment should also have this flag. Use the equivalent flag
+ * AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER to avoid this confusion.
+ */
+ AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT = AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER,
+ /**
+ * The buffer will be used as a composer HAL overlay layer.
+ *
+ * This flag is currently only needed when using ASurfaceTransaction_setBuffer
+ * to set a buffer. In all other cases, the framework adds this flag
+ * internally to buffers that could be presented in a composer overlay.
+ * ASurfaceTransaction_setBuffer is special because it uses buffers allocated
+ * directly through AHardwareBuffer_allocate instead of buffers allocated
+ * by the framework.
+ */
+ AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY = 1ULL << 11,
+ /**
+ * The buffer is protected from direct CPU access or being read by
+ * non-secure hardware, such as video encoders.
+ *
+ * This flag is incompatible with CPU read and write flags. It is
+ * mainly used when handling DRM video. Refer to the EGL extension
+ * EGL_EXT_protected_content and GL extension
+ * GL_EXT_protected_textures for more information on how these
+ * buffers are expected to behave.
+ */
+ AHARDWAREBUFFER_USAGE_PROTECTED_CONTENT = 1UL << 14,
+ /// The buffer will be read by a hardware video encoder.
+ AHARDWAREBUFFER_USAGE_VIDEO_ENCODE = 1UL << 16,
+ /**
+ * The buffer will be used for direct writes from sensors.
+ * When this flag is present, the format must be AHARDWAREBUFFER_FORMAT_BLOB.
+ */
+ AHARDWAREBUFFER_USAGE_SENSOR_DIRECT_DATA = 1UL << 23,
+ /**
+ * The buffer will be used as a shader storage or uniform buffer object.
+ * When this flag is present, the format must be AHARDWAREBUFFER_FORMAT_BLOB.
+ */
+ AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER = 1UL << 24,
+ /**
+ * The buffer will be used as a cube map texture.
+ * When this flag is present, the buffer must have a layer count
+ * that is a multiple of 6. Note that buffers with this flag must be
+ * bound to OpenGL textures using the extension
+ * GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.
+ */
+ AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP = 1UL << 25,
+ /**
+ * The buffer contains a complete mipmap hierarchy.
+ * Note that buffers with this flag must be bound to OpenGL textures using
+ * the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.
+ */
+ AHARDWAREBUFFER_USAGE_GPU_MIPMAP_COMPLETE = 1UL << 26,
+
+ AHARDWAREBUFFER_USAGE_VENDOR_0 = 1ULL << 28,
+ AHARDWAREBUFFER_USAGE_VENDOR_1 = 1ULL << 29,
+ AHARDWAREBUFFER_USAGE_VENDOR_2 = 1ULL << 30,
+ AHARDWAREBUFFER_USAGE_VENDOR_3 = 1ULL << 31,
+ AHARDWAREBUFFER_USAGE_VENDOR_4 = 1ULL << 48,
+ AHARDWAREBUFFER_USAGE_VENDOR_5 = 1ULL << 49,
+ AHARDWAREBUFFER_USAGE_VENDOR_6 = 1ULL << 50,
+ AHARDWAREBUFFER_USAGE_VENDOR_7 = 1ULL << 51,
+ AHARDWAREBUFFER_USAGE_VENDOR_8 = 1ULL << 52,
+ AHARDWAREBUFFER_USAGE_VENDOR_9 = 1ULL << 53,
+ AHARDWAREBUFFER_USAGE_VENDOR_10 = 1ULL << 54,
+ AHARDWAREBUFFER_USAGE_VENDOR_11 = 1ULL << 55,
+ AHARDWAREBUFFER_USAGE_VENDOR_12 = 1ULL << 56,
+ AHARDWAREBUFFER_USAGE_VENDOR_13 = 1ULL << 57,
+ AHARDWAREBUFFER_USAGE_VENDOR_14 = 1ULL << 58,
+ AHARDWAREBUFFER_USAGE_VENDOR_15 = 1ULL << 59,
+ AHARDWAREBUFFER_USAGE_VENDOR_16 = 1ULL << 60,
+ AHARDWAREBUFFER_USAGE_VENDOR_17 = 1ULL << 61,
+ AHARDWAREBUFFER_USAGE_VENDOR_18 = 1ULL << 62,
+ AHARDWAREBUFFER_USAGE_VENDOR_19 = 1ULL << 63,
+};
+
+/**
+ * Buffer description. Used for allocating new buffers and querying
+ * parameters of existing ones.
+ */
+typedef struct AHardwareBuffer_Desc {
+ uint32_t width; ///< Width in pixels.
+ uint32_t height; ///< Height in pixels.
+ /**
+ * Number of images in an image array. AHardwareBuffers with one
+ * layer correspond to regular 2D textures. AHardwareBuffers with
+ * more than layer correspond to texture arrays. If the layer count
+ * is a multiple of 6 and the usage flag
+ * AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP is present, the buffer is
+ * a cube map or a cube map array.
+ */
+ uint32_t layers;
+ uint32_t format; ///< One of AHardwareBuffer_Format.
+ uint64_t usage; ///< Combination of AHardwareBuffer_UsageFlags.
+ uint32_t stride; ///< Row stride in pixels, ignored for AHardwareBuffer_allocate()
+ uint32_t rfu0; ///< Initialize to zero, reserved for future use.
+ uint64_t rfu1; ///< Initialize to zero, reserved for future use.
+} AHardwareBuffer_Desc;
+
+/**
+ * Holds data for a single image plane.
+ */
+typedef struct AHardwareBuffer_Plane {
+ void* data; ///< Points to first byte in plane
+ uint32_t pixelStride; ///< Distance in bytes from the color channel of one pixel to the next
+ uint32_t rowStride; ///< Distance in bytes from the first value of one row of the image to
+ /// the first value of the next row.
+} AHardwareBuffer_Plane;
+
+/**
+ * Holds all image planes that contain the pixel data.
+ */
+typedef struct AHardwareBuffer_Planes {
+ uint32_t planeCount; ///< Number of distinct planes
+ AHardwareBuffer_Plane planes[4]; ///< Array of image planes
+} AHardwareBuffer_Planes;
+
+/**
+ * Opaque handle for a native hardware buffer.
+ */
+typedef struct AHardwareBuffer AHardwareBuffer;
+
+/**
+ * Allocates a buffer that matches the passed AHardwareBuffer_Desc.
+ *
+ * If allocation succeeds, the buffer can be used according to the
+ * usage flags specified in its description. If a buffer is used in ways
+ * not compatible with its usage flags, the results are undefined and
+ * may include program termination.
+ *
+ * Available since API level 26.
+ *
+ * \return 0 on success, or an error number of the allocation fails for
+ * any reason. The returned buffer has a reference count of 1.
+ */
+int AHardwareBuffer_allocate(const AHardwareBuffer_Desc* desc,
+ AHardwareBuffer** outBuffer);
+/**
+ * Acquire a reference on the given AHardwareBuffer object.
+ *
+ * This prevents the object from being deleted until the last reference
+ * is removed.
+ *
+ * Available since API level 26.
+ */
+void AHardwareBuffer_acquire(AHardwareBuffer* buffer);
+
+/**
+ * Remove a reference that was previously acquired with
+ * AHardwareBuffer_acquire() or AHardwareBuffer_allocate().
+ *
+ * Available since API level 26.
+ */
+void AHardwareBuffer_release(AHardwareBuffer* buffer);
+
+/**
+ * Return a description of the AHardwareBuffer in the passed
+ * AHardwareBuffer_Desc struct.
+ *
+ * Available since API level 26.
+ */
+void AHardwareBuffer_describe(const AHardwareBuffer* buffer,
+ AHardwareBuffer_Desc* outDesc);
+
+/**
+ * Lock the AHardwareBuffer for direct CPU access.
+ *
+ * This function can lock the buffer for either reading or writing.
+ * It may block if the hardware needs to finish rendering, if CPU caches
+ * need to be synchronized, or possibly for other implementation-
+ * specific reasons.
+ *
+ * The passed AHardwareBuffer must have one layer, otherwise the call
+ * will fail.
+ *
+ * If \a fence is not negative, it specifies a fence file descriptor on
+ * which to wait before locking the buffer. If it's negative, the caller
+ * is responsible for ensuring that writes to the buffer have completed
+ * before calling this function. Using this parameter is more efficient
+ * than waiting on the fence and then calling this function.
+ *
+ * The \a usage parameter may only specify AHARDWAREBUFFER_USAGE_CPU_*.
+ * If set, then outVirtualAddress is filled with the address of the
+ * buffer in virtual memory. The flags must also be compatible with
+ * usage flags specified at buffer creation: if a read flag is passed,
+ * the buffer must have been created with
+ * AHARDWAREBUFFER_USAGE_CPU_READ_RARELY or
+ * AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN. If a write flag is passed, it
+ * must have been created with AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY or
+ * AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN.
+ *
+ * If \a rect is not NULL, the caller promises to modify only data in
+ * the area specified by rect. If rect is NULL, the caller may modify
+ * the contents of the entire buffer. The content of the buffer outside
+ * of the specified rect is NOT modified by this call.
+ *
+ * It is legal for several different threads to lock a buffer for read
+ * access; none of the threads are blocked.
+ *
+ * Locking a buffer simultaneously for write or read/write is undefined,
+ * but will neither terminate the process nor block the caller.
+ * AHardwareBuffer_lock may return an error or leave the buffer's
+ * content in an indeterminate state.
+ *
+ * If the buffer has AHARDWAREBUFFER_FORMAT_BLOB, it is legal lock it
+ * for reading and writing in multiple threads and/or processes
+ * simultaneously, and the contents of the buffer behave like shared
+ * memory.
+ *
+ * Available since API level 26.
+ *
+ * \return 0 on success. -EINVAL if \a buffer is NULL, the usage flags
+ * are not a combination of AHARDWAREBUFFER_USAGE_CPU_*, or the buffer
+ * has more than one layer. Error number if the lock fails for any other
+ * reason.
+ */
+int AHardwareBuffer_lock(AHardwareBuffer* buffer, uint64_t usage,
+ int32_t fence, const ARect* rect, void** outVirtualAddress);
+
+/**
+ * Lock a potentially multi-planar AHardwareBuffer for direct CPU access.
+ *
+ * This function is similar to AHardwareBuffer_lock, but can lock multi-planar
+ * formats. The locked planes are returned in the \a outPlanes argument. Note,
+ * that multi-planar should not be confused with multi-layer images, which this
+ * locking function does not support.
+ *
+ * YUV formats are always represented by three separate planes of data, one for
+ * each color plane. The order of planes in the array is guaranteed such that
+ * plane #0 is always Y, plane #1 is always U (Cb), and plane #2 is always V
+ * (Cr). All other formats are represented by a single plane.
+ *
+ * Additional information always accompanies the buffers, describing the row
+ * stride and the pixel stride for each plane.
+ *
+ * In case the buffer cannot be locked, \a outPlanes will contain zero planes.
+ *
+ * See the AHardwareBuffer_lock documentation for all other locking semantics.
+ *
+ * Available since API level 29.
+ *
+ * \return 0 on success. -EINVAL if \a buffer is NULL, the usage flags
+ * are not a combination of AHARDWAREBUFFER_USAGE_CPU_*, or the buffer
+ * has more than one layer. Error number if the lock fails for any other
+ * reason.
+ */
+int AHardwareBuffer_lockPlanes(AHardwareBuffer* buffer, uint64_t usage,
+ int32_t fence, const ARect* rect, AHardwareBuffer_Planes* outPlanes);
+
+/**
+ * Unlock the AHardwareBuffer from direct CPU access.
+ *
+ * Must be called after all changes to the buffer are completed by the
+ * caller. If \a fence is NULL, the function will block until all work
+ * is completed. Otherwise, \a fence will be set either to a valid file
+ * descriptor or to -1. The file descriptor will become signaled once
+ * the unlocking is complete and buffer contents are updated.
+ * The caller is responsible for closing the file descriptor once it's
+ * no longer needed. The value -1 indicates that unlocking has already
+ * completed before the function returned and no further operations are
+ * necessary.
+ *
+ * Available since API level 26.
+ *
+ * \return 0 on success. -EINVAL if \a buffer is NULL. Error number if
+ * the unlock fails for any reason.
+ */
+int AHardwareBuffer_unlock(AHardwareBuffer* buffer, int32_t* fence);
+
+/**
+ * Send the AHardwareBuffer to an AF_UNIX socket.
+ *
+ * Available since API level 26.
+ *
+ * \return 0 on success, -EINVAL if \a buffer is NULL, or an error
+ * number if the operation fails for any reason.
+ */
+int AHardwareBuffer_sendHandleToUnixSocket(const AHardwareBuffer* buffer, int socketFd);
+
+/**
+ * Receive an AHardwareBuffer from an AF_UNIX socket.
+ *
+ * Available since API level 26.
+ *
+ * \return 0 on success, -EINVAL if \a outBuffer is NULL, or an error
+ * number if the operation fails for any reason.
+ */
+int AHardwareBuffer_recvHandleFromUnixSocket(int socketFd, AHardwareBuffer** outBuffer);
+
+/**
+ * Test whether the given format and usage flag combination is
+ * allocatable.
+ *
+ * If this function returns true, it means that a buffer with the given
+ * description can be allocated on this implementation, unless resource
+ * exhaustion occurs. If this function returns false, it means that the
+ * allocation of the given description will never succeed.
+ *
+ * The return value of this function may depend on all fields in the
+ * description, except stride, which is always ignored. For example,
+ * some implementations have implementation-defined limits on texture
+ * size and layer count.
+ *
+ * Available since API level 29.
+ *
+ * \return 1 if the format and usage flag combination is allocatable,
+ * 0 otherwise.
+ */
+int AHardwareBuffer_isSupported(const AHardwareBuffer_Desc* desc);
+
+/**
+ * Lock an AHardwareBuffer for direct CPU access.
+ *
+ * This function is the same as the above lock function, but passes back
+ * additional information about the bytes per pixel and the bytes per stride
+ * of the locked buffer. If the bytes per pixel or bytes per stride are unknown
+ * or variable, or if the underlying mapper implementation does not support returning
+ * additional information, then this call will fail with INVALID_OPERATION
+ *
+ * Available since API level 29.
+ */
+int AHardwareBuffer_lockAndGetInfo(AHardwareBuffer* buffer, uint64_t usage,
+ int32_t fence, const ARect* rect, void** outVirtualAddress,
+ int32_t* outBytesPerPixel, int32_t* outBytesPerStride);
+
+#endif // ANDROID_HARDWARE_BUFFER_H
+
+/** @} */
diff --git a/src/gfxstream/guest/fuchsia/include/android/rect.h b/src/gfxstream/guest/fuchsia/include/android/rect.h
new file mode 100644
index 00000000000..d52861add0a
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/android/rect.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @addtogroup NativeActivity Native Activity
+ * @{
+ */
+
+/**
+ * @file rect.h
+ */
+
+#ifndef ANDROID_RECT_H
+#define ANDROID_RECT_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Rectangular window area.
+ *
+ * This is the NDK equivalent of the android.graphics.Rect class in Java. It is
+ * used with {@link ANativeActivityCallbacks::onContentRectChanged} event
+ * callback and the ANativeWindow_lock() function.
+ *
+ * In a valid ARect, left <= right and top <= bottom. ARect with left=0, top=10,
+ * right=1, bottom=11 contains only one pixel at x=0, y=10.
+ */
+typedef struct ARect {
+#ifdef __cplusplus
+ typedef int32_t value_type;
+#endif
+ /// Minimum X coordinate of the rectangle.
+ int32_t left;
+ /// Minimum Y coordinate of the rectangle.
+ int32_t top;
+ /// Maximum X coordinate of the rectangle.
+ int32_t right;
+ /// Maximum Y coordinate of the rectangle.
+ int32_t bottom;
+} ARect;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // ANDROID_RECT_H
+
+/** @} */
diff --git a/src/gfxstream/guest/fuchsia/include/cros_gralloc_handle.h b/src/gfxstream/guest/fuchsia/include/cros_gralloc_handle.h
new file mode 100644
index 00000000000..2b70d4baaf9
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/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/src/gfxstream/guest/fuchsia/include/cutils/log.h b/src/gfxstream/guest/fuchsia/include/cutils/log.h
new file mode 100644
index 00000000000..de0895c2b9d
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/cutils/log.h
@@ -0,0 +1,62 @@
+#ifndef __CUTILS_LOG_H__
+#define __CUTILS_LOG_H__
+
+#ifndef LOG_TAG
+#define LOG_TAG nullptr
+#endif
+
+enum {
+ ANDROID_LOG_UNKNOWN = 0,
+ ANDROID_LOG_DEFAULT,
+ ANDROID_LOG_VERBOSE,
+ ANDROID_LOG_DEBUG,
+ ANDROID_LOG_INFO,
+ ANDROID_LOG_WARN,
+ ANDROID_LOG_ERROR,
+ ANDROID_LOG_FATAL,
+ ANDROID_LOG_SILENT,
+};
+
+#define android_printLog(prio, tag, format, ...) \
+ __android_log_print(prio, tag, __FILE__, __LINE__, "[prio %d] " format, prio, ##__VA_ARGS__)
+
+#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
+#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
+
+#define __android_second(dummy, second, ...) second
+#define __android_rest(first, ...) , ##__VA_ARGS__
+
+#define android_printAssert(condition, tag, format, ...) \
+ __android_log_assert(condition, tag, __FILE__, __LINE__, "assert: condition: %s " format, \
+ condition, ##__VA_ARGS__)
+
+#define LOG_ALWAYS_FATAL_IF(condition, ...) \
+ ((condition) \
+ ? ((void)android_printAssert(#condition, LOG_TAG, ##__VA_ARGS__)) \
+ : (void)0)
+
+#define LOG_ALWAYS_FATAL(...) \
+ (((void)android_printAssert(NULL, LOG_TAG, ##__VA_ARGS__)))
+
+#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
+#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
+#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
+#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
+#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+
+#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ##__VA_ARGS__)
+
+#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__)
+
+#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ##__VA_ARGS__)
+
+extern "C" {
+
+int __android_log_print(int priority, const char* tag, const char* file, int line,
+ const char* format, ...);
+
+[[noreturn]] void __android_log_assert(const char* condition, const char* tag, const char* file,
+ int line, const char* format, ...);
+}
+
+#endif
diff --git a/src/gfxstream/guest/fuchsia/include/cutils/native_handle.h b/src/gfxstream/guest/fuchsia/include/cutils/native_handle.h
new file mode 100644
index 00000000000..6444e0274a3
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/cutils/native_handle.h
@@ -0,0 +1,10 @@
+#ifndef __CUTILS_NATIVE_HANDLE_H__
+#define __CUTILS_NATIVE_HANDLE_H__
+
+typedef struct native_handle {
+ int version;
+ int numFds;
+ int numInts;
+} native_handle_t;
+
+#endif
diff --git a/src/gfxstream/guest/fuchsia/include/cutils/properties.h b/src/gfxstream/guest/fuchsia/include/cutils/properties.h
new file mode 100644
index 00000000000..d977fbfd2e6
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/cutils/properties.h
@@ -0,0 +1,12 @@
+#ifndef __CUTILS_PROPERTIES_H__
+#define __CUTILS_PROPERTIES_H__
+
+#define PROPERTY_VALUE_MAX 92
+
+extern "C" {
+
+int property_get(const char* key, char* value, const char* default_value);
+
+}
+
+#endif
diff --git a/src/gfxstream/guest/fuchsia/include/hardware/gralloc.h b/src/gfxstream/guest/fuchsia/include/hardware/gralloc.h
new file mode 100644
index 00000000000..8459a034e1b
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/hardware/gralloc.h
@@ -0,0 +1,8 @@
+#ifndef __HARDWARE_GRALLOC_H__
+#define __HARDWARE_GRALLOC_H__
+
+enum {
+ GRALLOC_USAGE_HW_FB = 0x00001000U,
+};
+
+#endif
diff --git a/src/gfxstream/guest/fuchsia/include/hardware/hardware.h b/src/gfxstream/guest/fuchsia/include/hardware/hardware.h
new file mode 100644
index 00000000000..439ad11fcd1
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/hardware/hardware.h
@@ -0,0 +1,40 @@
+#ifndef __HARDWARE_HARDWARE_H
+#define __HARDWARE_HARDWARE_H
+
+#include <stdint.h>
+
+#define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D))
+
+#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T')
+#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T')
+
+#define HARDWARE_HAL_API_VERSION 0
+
+struct hw_module_t;
+struct hw_module_methods_t;
+struct hw_device_t;
+
+typedef struct hw_module_t {
+ uint32_t tag;
+ uint16_t module_api_version;
+ uint16_t hal_api_version;
+ const char *id;
+ const char *name;
+ const char *author;
+ struct hw_module_methods_t* methods;
+ void* dso;
+} hw_module_t;
+
+typedef struct hw_module_methods_t {
+ int (*open)(const struct hw_module_t* module, const char* id,
+ struct hw_device_t** device);
+} hw_module_methods_t;
+
+typedef struct hw_device_t {
+ uint32_t tag;
+ uint32_t version;
+ struct hw_module_t* module;
+ int (*close)(struct hw_device_t* device);
+} hw_device_t;
+
+#endif
diff --git a/src/gfxstream/guest/fuchsia/include/hardware/hwvulkan.h b/src/gfxstream/guest/fuchsia/include/hardware/hwvulkan.h
new file mode 100644
index 00000000000..78180515c38
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/hardware/hwvulkan.h
@@ -0,0 +1,32 @@
+#ifndef __HARDWARE_HWVULKAN_H__
+#define __HARDWARE_HWVULKAN_H__
+
+#include <hardware/hardware.h>
+#include <vulkan/vulkan.h>
+
+#define HWVULKAN_HARDWARE_MODULE_ID "vulkan"
+#define HWVULKAN_MODULE_API_VERSION_0_1 0
+#define HWVULKAN_DEVICE_API_VERSION_0_1 0
+
+#define HWVULKAN_DEVICE_0 "vk0"
+
+typedef struct hwvulkan_module_t {
+ struct hw_module_t common;
+} hwvulkan_module_t;
+
+#define HWVULKAN_DISPATCH_MAGIC 0x01CDC0DE
+typedef union {
+ uintptr_t magic;
+ const void* vtbl;
+} hwvulkan_dispatch_t;
+
+typedef struct hwvulkan_device_t {
+ struct hw_device_t common;
+
+ PFN_vkEnumerateInstanceExtensionProperties
+ EnumerateInstanceExtensionProperties;
+ PFN_vkCreateInstance CreateInstance;
+ PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
+} hwvulkan_device_t;
+
+#endif
diff --git a/src/gfxstream/guest/fuchsia/include/log/log.h b/src/gfxstream/guest/fuchsia/include/log/log.h
new file mode 100644
index 00000000000..8b451ae771a
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/log/log.h
@@ -0,0 +1,6 @@
+#ifndef __LOG_LOG_H__
+#define __LOG_LOG_H__
+
+#include <cutils/log.h>
+
+#endif
diff --git a/src/gfxstream/guest/fuchsia/include/services/service_connector.h b/src/gfxstream/guest/fuchsia/include/services/service_connector.h
new file mode 100644
index 00000000000..13204013617
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/services/service_connector.h
@@ -0,0 +1,29 @@
+// 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.
+
+#ifndef FUCHSIA_INCLUDE_SERVICES_SERVICE_CONNECTOR_H_
+#define FUCHSIA_INCLUDE_SERVICES_SERVICE_CONNECTOR_H_
+
+#include <cstdint>
+#include <zircon/types.h>
+
+// Takes the name of a service (e.g. /svc/fuchsia.sysmem.Allocator) and returns
+// a handle to a connection to it.
+typedef zx_handle_t (*PFN_ConnectToServiceAddr)(const char *pName);
+
+void SetConnectToServiceFunction(PFN_ConnectToServiceAddr func);
+PFN_ConnectToServiceAddr GetConnectToServiceFunction();
+
+#endif // FUCHSIA_INCLUDE_SERVICES_SERVICE_CONNECTOR_H_
diff --git a/src/gfxstream/guest/fuchsia/include/sync/sync.h b/src/gfxstream/guest/fuchsia/include/sync/sync.h
new file mode 100644
index 00000000000..0eb33a9cc55
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/sync/sync.h
@@ -0,0 +1,10 @@
+#ifndef __SYNC_SYNC_H
+#define __SYNC_SYNC_H
+
+extern "C" {
+
+int sync_wait(int fd, int timeout);
+
+}
+
+#endif
diff --git a/src/gfxstream/guest/fuchsia/include/vndk/hardware_buffer.h b/src/gfxstream/guest/fuchsia/include/vndk/hardware_buffer.h
new file mode 100644
index 00000000000..3288e86e9b9
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/include/vndk/hardware_buffer.h
@@ -0,0 +1,6 @@
+#ifndef __VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H
+#define __VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H
+
+#include <cutils/native_handle.h>
+
+#endif
diff --git a/src/gfxstream/guest/fuchsia/meson.build b/src/gfxstream/guest/fuchsia/meson.build
new file mode 100644
index 00000000000..669eb0366eb
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/meson.build
@@ -0,0 +1,15 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_android_compat = include_directories('include')
+
+files_lib_android_compat = files(
+ 'port.cc',
+)
+
+lib_android_compat = static_library(
+ 'android_compat',
+ files_lib_android_compat,
+ cpp_args: gfxstream_guest_args,
+ include_directories: [inc_android_compat]
+)
diff --git a/src/gfxstream/guest/fuchsia/port.cc b/src/gfxstream/guest/fuchsia/port.cc
new file mode 100644
index 00000000000..7c0a33886c9
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/port.cc
@@ -0,0 +1,103 @@
+// Copyright 2018 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <stdlib.h>
+
+#include <atomic>
+#include <cassert>
+#include <cstdarg>
+#include <cstdint>
+#include <cstdio>
+#include <thread>
+#include <cstring>
+
+#if defined(__Fuchsia__)
+#include <lib/syslog/global.h>
+#else
+#include <libgen.h>
+#endif
+
+#include "cutils/log.h"
+#include "cutils/properties.h"
+
+extern "C" {
+
+#if !defined(__Fuchsia__)
+static void linux_log_prefix(const char *prefix, const char *file, int line, const char *format,
+ va_list ap, ...)
+{
+ char buf[50];
+ char *dup = strdup(file);
+ if (!dup)
+ return;
+
+ snprintf(buf, sizeof(buf), "[%s(%d)]", basename(dup), line);
+ fprintf(stderr, "%s\n", buf);
+ vfprintf(stderr, format, ap);
+
+ free(dup);
+}
+#endif
+
+int property_get(const char* key, char* value, const char* default_value) {
+ return 0;
+}
+
+int __android_log_print(int priority, const char* tag, const char* file,
+ int line, const char* format, ...) {
+ const char* local_tag = tag;
+ if (!local_tag) {
+ local_tag = "<NO_TAG>";
+ }
+
+ va_list ap;
+ va_start(ap, format);
+#if defined(__Fuchsia__)
+ switch (priority) {
+ case ANDROID_LOG_VERBOSE:
+ case ANDROID_LOG_DEBUG:
+ FX_LOGVF(DEBUG, local_tag, file, line, format, ap);
+ break;
+ case ANDROID_LOG_WARN:
+ FX_LOGVF(WARNING, local_tag, file, line, format, ap);
+ break;
+ case ANDROID_LOG_ERROR:
+ FX_LOGVF(ERROR, local_tag, file, line, format, ap);
+ break;
+ case ANDROID_LOG_FATAL:
+ FX_LOGVF(FATAL, local_tag, file, line, format, ap);
+ break;
+ case ANDROID_LOG_INFO:
+ default:
+ FX_LOGVF(INFO, local_tag, file, line, format, ap);
+ break;
+ }
+#else
+ linux_log_prefix(local_tag, file, line, format, ap);
+#endif
+
+ return 1;
+}
+
+void __android_log_assert(const char* condition, const char* tag,
+ const char* file, int line, const char* format, ...) {
+ const char* local_tag = tag;
+ if (!local_tag) {
+ local_tag = "<NO_TAG>";
+ }
+ va_list ap;
+ va_start(ap, format);
+#if defined(__Fuchsia__)
+ FX_LOGVF(ERROR, local_tag, file, line, format, ap);
+#else
+ linux_log_prefix(local_tag, file, line, format, ap);
+#endif
+
+ va_end(ap);
+
+ abort();
+}
+
+int sync_wait(int fd, int timeout) { return -1; }
+}
diff --git a/src/gfxstream/guest/fuchsia/releasepackage.py b/src/gfxstream/guest/fuchsia/releasepackage.py
new file mode 100644
index 00000000000..550070d377b
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/releasepackage.py
@@ -0,0 +1,153 @@
+# Copyright 2019 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import sys
+import shutil
+import subprocess
+import argparse
+import re
+
+parser = argparse.ArgumentParser(description="Upload goldfish libvulkan to CIPD")
+
+parser.add_argument("--release-dir")
+parser.add_argument("--arch")
+parser.add_argument("--dry-run", action="store_true")
+parser.add_argument("--ignore-branch", action="store_true")
+parser.add_argument("--ignore-rebuild", action="store_true")
+parser.add_argument("--ignore-buildtype", action="store_true")
+
+args = parser.parse_args()
+
+dir_path = os.path.dirname(os.path.realpath(__file__))
+
+os.chdir(dir_path)
+
+fuchsia_root = os.path.abspath(os.path.join(dir_path, "../../../"))
+fx_path = os.path.join(fuchsia_root, "scripts/fx")
+
+if args.release_dir:
+ release_dir = os.path.abspath(args.release_dir)
+else:
+ release_dir = os.path.join(fuchsia_root, "out/default")
+
+if not os.path.exists(release_dir):
+ print "Release dir: %s doesn't exist" % release_dir
+ sys.exit(1)
+
+if args.arch:
+ arch = args.arch
+else:
+ arch = "x64"
+
+target_name = "%s-shared/libvulkan_goldfish.so" % arch
+git_repo_location = "%s/third_party/goldfish-opengl" % fuchsia_root
+package_dir = "libvulkan_goldfish/%s" % arch
+package_name = "fuchsia/lib/libvulkan/%s" % package_dir
+
+debug_target_name = "%s-shared/lib.unstripped/libvulkan_goldfish.so" % arch
+debug_dir = "libvulkan_goldfish/debug-symbols-%s" % arch
+debug_package_name = "fuchsia/lib/libvulkan/%s" % debug_dir
+
+repo_name = "goldfish-opengl"
+git_branch = subprocess.check_output([
+ "git", "-C", git_repo_location, "rev-parse", "--abbrev-ref", "HEAD"
+]).strip()
+if git_branch != "master":
+ print("Git repo %s on incorrect branch %s (should be master)" %
+ (repo_name, git_branch))
+ if args.ignore_branch:
+ print("Ignoring")
+ else:
+ print("Use --ignore-branch flag to upload anyway")
+ sys.exit(1)
+
+# Force ninja dry-run
+ninja_output = subprocess.check_output([
+ fx_path, "ninja", "-C", release_dir, "-v", "-n", target_name
+])
+
+if "ninja: no work to do." not in ninja_output:
+ print("Ninja reported work needed to be done for %s" % target_name)
+ if args.ignore_rebuild:
+ print("Ignoring")
+ else:
+ print("Use --ignore-rebuild flag to upload anyway")
+ sys.exit(1)
+
+gn_output = subprocess.check_output([
+ fx_path, "gn", "args", release_dir, "--list=is_debug", "--short"
+]).strip()
+if gn_output != "is_debug = false":
+ print("GN argument \"%s\" unexpected" % gn_output)
+ if args.ignore_buildtype:
+ print("Ignoring")
+ else:
+ print("Use --ignore-buildtype flag to upload anyway")
+ sys.exit(1)
+
+# Prepare libvulkan_goldfish binaries
+file_name = "libvulkan_goldfish.so"
+full_name = os.path.join(package_dir, file_name)
+
+source_file_name = os.path.join(release_dir, target_name)
+try:
+ os.remove(full_name)
+except:
+ pass
+try:
+ os.makedirs(package_dir)
+except:
+ pass
+shutil.copyfile(source_file_name, full_name)
+
+# Prepare libvulkan_goldfish debug binaries
+debug_source_file_name = os.path.join(release_dir, debug_target_name)
+elf_info = re.search(r'Build ID: ([a-f0-9]*)',
+ subprocess.check_output(['readelf', '-n', debug_source_file_name]).strip())
+if not elf_info:
+ print("Fatal: Cannot find build ID in elf binary")
+ sys.exit(1)
+
+build_id = elf_info.group(1)
+debug_output_dir = os.path.join(debug_dir, build_id[:2])
+
+try:
+ shutil.rmtree(debug_dir)
+except:
+ pass
+os.makedirs(debug_output_dir)
+shutil.copyfile(debug_source_file_name, os.path.join(debug_output_dir, build_id[2:] + '.debug'))
+
+# Create libvulkan_goldfish CIPD package
+git_rev = subprocess.check_output(
+ ["git", "-C", git_repo_location, "rev-parse", "HEAD"]).strip()
+
+cipd_command = ("%s cipd create -in %s -name %s -ref latest"
+ " -install-mode copy -tag git_revision:%s") % (
+ fx_path, package_dir, package_name, git_rev)
+print cipd_command
+if not args.dry_run:
+ subprocess.check_call(cipd_command.split(" "))
+
+# Create libvulkan_goldfish/debug-symbols package
+cipd_command = ("%s cipd create -in %s -name %s -ref latest"
+ " -install-mode copy -tag git_revision:%s") % (
+ fx_path, debug_dir, debug_package_name, git_rev)
+print cipd_command
+if not args.dry_run:
+ subprocess.check_call(cipd_command.split(" "))
+
+
+print ("""
+ <package name="%s"
+ version="git_revision:%s"
+ path="prebuilt/third_party/%s"/>
+""" % (package_name, git_rev, package_dir))[1:-1]
+print ("""
+ <package name="%s"
+ version="git_revision:%s"
+ path="prebuilt/.build-id"
+ attributes="debug-symbols,debug-symbols-%s"/>
+""" % (debug_package_name, git_rev, arch))[1:-1]
diff --git a/src/gfxstream/guest/fuchsia/service_connector.cc b/src/gfxstream/guest/fuchsia/service_connector.cc
new file mode 100644
index 00000000000..409ef637715
--- /dev/null
+++ b/src/gfxstream/guest/fuchsia/service_connector.cc
@@ -0,0 +1,28 @@
+// 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 "services/service_connector.h"
+
+namespace {
+PFN_ConnectToServiceAddr g_connection_function;
+}
+
+void SetConnectToServiceFunction(PFN_ConnectToServiceAddr func) {
+ g_connection_function = func;
+}
+
+PFN_ConnectToServiceAddr GetConnectToServiceFunction() {
+ return g_connection_function;
+}
diff --git a/src/gfxstream/guest/include/MODULE_LICENSE_MIT b/src/gfxstream/guest/include/MODULE_LICENSE_MIT
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/src/gfxstream/guest/include/MODULE_LICENSE_MIT
diff --git a/src/gfxstream/guest/include/virtgpu_drm.h b/src/gfxstream/guest/include/virtgpu_drm.h
new file mode 100644
index 00000000000..a13e20cc66b
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/iostream/include/gfxstream/guest/IOStream.h b/src/gfxstream/guest/iostream/include/gfxstream/guest/IOStream.h
new file mode 100644
index 00000000000..60128381b03
--- /dev/null
+++ b/src/gfxstream/guest/iostream/include/gfxstream/guest/IOStream.h
@@ -0,0 +1,151 @@
+/*
+* 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 __IO_STREAM_H__
+#define __IO_STREAM_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#include "ErrorLog.h"
+
+namespace gfxstream {
+namespace guest {
+
+class IOStream {
+public:
+
+ IOStream(size_t bufSize) {
+ m_iostreamBuf = NULL;
+ m_bufsizeOrig = bufSize;
+ m_bufsize = bufSize;
+ m_free = 0;
+ m_refcount = 1;
+ }
+
+ void incRef() {
+ __atomic_add_fetch(&m_refcount, 1, __ATOMIC_SEQ_CST);
+ }
+
+ bool decRef() {
+ if (0 == __atomic_sub_fetch(&m_refcount, 1, __ATOMIC_SEQ_CST)) {
+ delete this;
+ return true;
+ }
+ return false;
+ }
+
+ virtual size_t idealAllocSize(size_t len) {
+ return m_bufsize < len ? len : m_bufsize;
+ }
+
+ virtual void *allocBuffer(size_t minSize) = 0;
+ virtual int commitBuffer(size_t size) = 0;
+ virtual const unsigned char *readFully( void *buf, size_t len) = 0;
+ virtual const unsigned char *commitBufferAndReadFully(size_t size, void *buf, size_t len) = 0;
+ virtual const unsigned char *read( void *buf, size_t *inout_len) = 0;
+ virtual int writeFully(const void* buf, size_t len) = 0;
+ virtual int writeFullyAsync(const void* buf, size_t len) {
+ return writeFully(buf, len);
+ }
+
+ virtual ~IOStream() {
+
+ // NOTE: m_iostreamBuf is 'owned' by the child class thus we expect it to be released by it
+ }
+
+ virtual unsigned char *alloc(size_t len) {
+
+ if (m_iostreamBuf && len > m_free) {
+ if (flush() < 0) {
+ ERR("Failed to flush in alloc\n");
+ return NULL; // we failed to flush so something is wrong
+ }
+ }
+
+ if (!m_iostreamBuf || len > m_bufsize) {
+ size_t allocLen = this->idealAllocSize(len);
+ m_iostreamBuf = (unsigned char *)allocBuffer(allocLen);
+ if (!m_iostreamBuf) {
+ ERR("Alloc (%zu bytes) failed\n", allocLen);
+ return NULL;
+ }
+ m_bufsize = m_free = allocLen;
+ }
+
+ unsigned char *ptr;
+
+ ptr = m_iostreamBuf + (m_bufsize - m_free);
+ m_free -= len;
+
+ return ptr;
+ }
+
+ virtual int flush() {
+
+ if (!m_iostreamBuf || m_free == m_bufsize) return 0;
+
+ int stat = commitBuffer(m_bufsize - m_free);
+ m_iostreamBuf = NULL;
+ m_free = 0;
+ return stat;
+ }
+
+ const unsigned char *readback(void *buf, size_t len) {
+ if (m_iostreamBuf && m_free != m_bufsize) {
+ size_t size = m_bufsize - m_free;
+ m_iostreamBuf = NULL;
+ m_free = 0;
+ return commitBufferAndReadFully(size, buf, len);
+ }
+ return readFully(buf, len);
+ }
+
+ // These two methods are defined and used in GLESv2_enc. Any reference
+ // outside of GLESv2_enc will produce a link error. This is intentional
+ // (technical debt).
+ void readbackPixels(void* context, int width, int height, unsigned int format, unsigned int type, void* pixels);
+ void uploadPixels(void* context, int width, int height, int depth, unsigned int format, unsigned int type, const void* pixels);
+
+
+protected:
+ void rewind() {
+ m_iostreamBuf = NULL;
+ m_bufsize = m_bufsizeOrig;
+ m_free = 0;
+ }
+
+private:
+ unsigned char *m_iostreamBuf;
+ size_t m_bufsizeOrig;
+ size_t m_bufsize;
+ size_t m_free;
+ uint32_t m_refcount;
+};
+
+} // namespace guest
+} // namespace gfxstream
+
+//
+// When a client opens a connection to the renderer, it should
+// send unsigned int value indicating the "clientFlags".
+// The following are the bitmask of the clientFlags.
+// currently only one bit is used which flags the server
+// it should exit.
+//
+#define IOSTREAM_CLIENT_EXIT_SERVER 1
+
+#endif
diff --git a/src/gfxstream/guest/iostream/meson.build b/src/gfxstream/guest/iostream/meson.build
new file mode 100644
index 00000000000..8e605c8539a
--- /dev/null
+++ b/src/gfxstream/guest/iostream/meson.build
@@ -0,0 +1,11 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_guest_iostream = include_directories('include')
+
+lib_guest_iostream = static_library(
+ 'qemu_pipe',
+ [],
+ cpp_args: [cpp_args],
+ include_directories: [inc_guest_iostream]
+) \ No newline at end of file
diff --git a/src/gfxstream/guest/meson.build b/src/gfxstream/guest/meson.build
new file mode 100644
index 00000000000..4838bbbea5c
--- /dev/null
+++ b/src/gfxstream/guest/meson.build
@@ -0,0 +1,49 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+#===============#
+# Configuration #
+#===============#
+gfxstream_guest_args = []
+
+# Our internal guest build
+gfxstream_guest_args += '-DLINUX_GUEST_BUILD'
+# This should just be called NO_TRACE eventually
+gfxstream_guest_args += '-DFUCHSIA_NO_TRACE'
+# Include the gfxstream private VkStructureType definitions
+gfxstream_guest_args += '-DVK_GFXSTREAM_STRUCTURE_TYPE_EXT'
+
+#===============#
+# Dependencies #
+#===============#
+
+dl_dep = cc.find_library('dl', required: false)
+drm_dep = dependency('libdrm')
+thread_dep = dependency('threads')
+
+#===============#
+# Includes #
+#===============#
+
+inc_vulkan_headers = inc_include
+inc_opengl_headers = inc_include
+inc_android_emu = include_directories('android-emu')
+inc_opengl_codec = include_directories('OpenglCodecCommon')
+inc_opengl_system = include_directories('OpenglSystemCommon')
+inc_system = include_directories('include')
+inc_vulkan_enc = include_directories('vulkan_enc')
+
+#================#
+# Subdirectories #
+#================#
+
+subdir('fuchsia')
+subdir('iostream')
+subdir('platform')
+subdir('android-emu/aemu/base')
+subdir('GoldfishAddressSpace')
+subdir('qemupipe')
+subdir('OpenglCodecCommon')
+subdir('vulkan_enc')
+subdir('OpenglSystemCommon')
+subdir('vulkan')
diff --git a/src/gfxstream/guest/platform/VirtGpu.cpp b/src/gfxstream/guest/platform/VirtGpu.cpp
new file mode 100644
index 00000000000..6cb2c58665f
--- /dev/null
+++ b/src/gfxstream/guest/platform/VirtGpu.cpp
@@ -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.
+ */
+
+ #include "VirtGpu.h"
+ #include <cutils/log.h>
+
+namespace {
+
+static VirtGpuDevice* sDevice = nullptr;
+
+} // namespace
+
+VirtGpuDevice* VirtGpuDevice::getInstance(enum VirtGpuCapset capset) {
+ // If kCapsetNone is passed, we return a device that was created with any capset.
+ // Otherwise, the created device's capset must match the requested capset.
+ // We could support multiple capsets with a map of devices but that case isn't needed
+ // currently, and with multiple devices it's unclear how to handle kCapsetNone.
+ if (capset != kCapsetNone && sDevice && sDevice->capset() != capset) {
+ ALOGE("Requested VirtGpuDevice capset %u, already created capset %u",
+ capset, sDevice->capset());
+ return nullptr;
+ }
+ if (!sDevice) {
+ sDevice = createPlatformVirtGpuDevice(capset);
+ }
+ return sDevice;
+}
+
+void VirtGpuDevice::resetInstance() {
+ if (sDevice) {
+ delete sDevice;
+ sDevice = nullptr;
+ }
+}
+
+void VirtGpuDevice::setInstanceForTesting(VirtGpuDevice* device) {
+ sDevice = device;
+}
diff --git a/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpu.h b/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpu.h
new file mode 100644
index 00000000000..10f6d40387f
--- /dev/null
+++ b/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpu.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright 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 "VirtGpu.h"
+
+class FuchsiaVirtGpuBlob : public std::enable_shared_from_this<FuchsiaVirtGpuBlob>,
+ public VirtGpuBlob {
+ public:
+ FuchsiaVirtGpuBlob(int64_t deviceHandle, uint32_t blobHandle, uint32_t resourceHandle,
+ uint64_t size);
+ ~FuchsiaVirtGpuBlob();
+
+ uint32_t getResourceHandle() const override;
+ uint32_t getBlobHandle() const override;
+ int wait() override;
+
+ int exportBlob(struct VirtGpuExternalHandle& handle) override;
+ int transferFromHost(uint32_t offset, uint32_t size) override;
+ int transferToHost(uint32_t offset, uint32_t size) override;
+
+ VirtGpuBlobMappingPtr createMapping(void) override;
+};
+
+class FuchsiaVirtGpuBlobMapping : public VirtGpuBlobMapping {
+ public:
+ FuchsiaVirtGpuBlobMapping(VirtGpuBlobPtr blob, uint8_t* ptr, uint64_t size);
+ ~FuchsiaVirtGpuBlobMapping(void);
+
+ uint8_t* asRawPtr(void) override;
+};
+
+class FuchsiaVirtGpuDevice : public VirtGpuDevice {
+ public:
+ FuchsiaVirtGpuDevice(enum VirtGpuCapset capset);
+ ~FuchsiaVirtGpuDevice();
+
+ int64_t getDeviceHandle(void) override;
+
+ struct VirtGpuCaps getCaps(void) override;
+
+ VirtGpuBlobPtr createBlob(const struct VirtGpuCreateBlob& blobCreate) override;
+ VirtGpuBlobPtr createVirglBlob(uint32_t width, uint32_t height, uint32_t format) override;
+ VirtGpuBlobPtr importBlob(const struct VirtGpuExternalHandle& handle) override;
+
+ int execBuffer(struct VirtGpuExecBuffer& execbuffer, const VirtGpuBlob* blob) override;
+};
diff --git a/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuBlob.cpp b/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuBlob.cpp
new file mode 100644
index 00000000000..8e512a7520a
--- /dev/null
+++ b/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuBlob.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright 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 <cutils/log.h>
+
+#include "FuchsiaVirtGpu.h"
+
+FuchsiaVirtGpuBlob::FuchsiaVirtGpuBlob(int64_t deviceHandle, uint32_t blobHandle,
+ uint32_t resourceHandle, uint64_t size) {}
+
+FuchsiaVirtGpuBlob::~FuchsiaVirtGpuBlob(void) {}
+
+uint32_t FuchsiaVirtGpuBlob::getBlobHandle() const {
+ ALOGE("%s: unimplemented", __func__);
+ return 0;
+}
+
+uint32_t FuchsiaVirtGpuBlob::getResourceHandle() const {
+ ALOGE("%s: unimplemented", __func__);
+ return 0;
+}
+
+VirtGpuBlobMappingPtr FuchsiaVirtGpuBlob::createMapping(void) {
+ ALOGE("%s: unimplemented", __func__);
+ return nullptr;
+}
+
+int FuchsiaVirtGpuBlob::wait() { return -1; }
+
+int FuchsiaVirtGpuBlob::exportBlob(struct VirtGpuExternalHandle& handle) {
+ ALOGE("%s: unimplemented", __func__);
+ return 0;
+}
+
+int FuchsiaVirtGpuBlob::transferFromHost(uint32_t offset, uint32_t size) {
+ ALOGE("%s: unimplemented", __func__);
+ return 0;
+}
+
+int FuchsiaVirtGpuBlob::transferToHost(uint32_t offset, uint32_t size) {
+ ALOGE("%s: unimplemented", __func__);
+ return 0;
+}
diff --git a/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuBlobMapping.cpp b/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuBlobMapping.cpp
new file mode 100644
index 00000000000..9eb58dc3955
--- /dev/null
+++ b/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuBlobMapping.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright 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 "FuchsiaVirtGpu.h"
+
+FuchsiaVirtGpuBlobMapping::FuchsiaVirtGpuBlobMapping(VirtGpuBlobPtr blob, uint8_t* ptr,
+ uint64_t size) {}
+
+FuchsiaVirtGpuBlobMapping::~FuchsiaVirtGpuBlobMapping(void) {}
+
+uint8_t* FuchsiaVirtGpuBlobMapping::asRawPtr(void) { return nullptr; }
diff --git a/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuDevice.cpp b/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuDevice.cpp
new file mode 100644
index 00000000000..0c97d2fd085
--- /dev/null
+++ b/src/gfxstream/guest/platform/fuchsia/FuchsiaVirtGpuDevice.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright 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 <cutils/log.h>
+
+#include "FuchsiaVirtGpu.h"
+
+FuchsiaVirtGpuDevice::FuchsiaVirtGpuDevice(enum VirtGpuCapset capset) : VirtGpuDevice(capset) {}
+
+FuchsiaVirtGpuDevice::~FuchsiaVirtGpuDevice() {}
+
+int64_t FuchsiaVirtGpuDevice::getDeviceHandle(void) {
+ ALOGE("%s: unimplemented", __func__);
+ return 0;
+}
+
+VirtGpuBlobPtr FuchsiaVirtGpuDevice::createBlob(const struct VirtGpuCreateBlob& blobCreate) {
+ ALOGE("%s: unimplemented", __func__);
+ return nullptr;
+}
+
+VirtGpuBlobPtr FuchsiaVirtGpuDevice::createVirglBlob(uint32_t width, uint32_t height,
+ uint32_t virglFormat) {
+ ALOGE("%s: unimplemented", __func__);
+ return nullptr;
+}
+
+VirtGpuBlobPtr FuchsiaVirtGpuDevice::importBlob(const struct VirtGpuExternalHandle& handle) {
+ ALOGE("%s: unimplemented", __func__);
+ return nullptr;
+}
+
+int FuchsiaVirtGpuDevice::execBuffer(struct VirtGpuExecBuffer& execbuffer,
+ const VirtGpuBlob* blob) {
+ ALOGE("%s: unimplemented", __func__);
+ return 0;
+}
+
+struct VirtGpuCaps FuchsiaVirtGpuDevice::getCaps(void) { return {}; }
+
+VirtGpuDevice* createPlatformVirtGpuDevice(enum VirtGpuCapset capset, int fd) {
+ // We don't handle the VirtioGpuPipeStream case.
+ if (fd >= 0) {
+ ALOGE("Fuchsia: fd not handled");
+ abort();
+ }
+ return new FuchsiaVirtGpuDevice(capset);
+}
diff --git a/src/gfxstream/guest/platform/include/Sync.h b/src/gfxstream/guest/platform/include/Sync.h
new file mode 100644
index 00000000000..3f7ae090c44
--- /dev/null
+++ b/src/gfxstream/guest/platform/include/Sync.h
@@ -0,0 +1,36 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <cstdint>
+#include <stddef.h>
+
+namespace gfxstream {
+
+// Abstraction around libsync for testing.
+class SyncHelper {
+ public:
+ virtual ~SyncHelper() {}
+
+ virtual int wait(int syncFd, int timeoutMilliseconds) = 0;
+
+ virtual int dup(int syncFd) = 0;
+
+ virtual int close(int syncFd) = 0;
+};
+
+SyncHelper* createPlatformSyncHelper();
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/include/VirtGpu.h b/src/gfxstream/guest/platform/include/VirtGpu.h
new file mode 100644
index 00000000000..db5e2af571d
--- /dev/null
+++ b/src/gfxstream/guest/platform/include/VirtGpu.h
@@ -0,0 +1,196 @@
+/*
+ * 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 VIRTGPU_DEVICE_H
+#define VIRTGPU_DEVICE_H
+
+#include <cstdint>
+#include <memory>
+
+#include "virtgpu_gfxstream_protocol.h"
+
+// See virgl_hw.h and p_defines.h
+#define VIRGL_FORMAT_R8_UNORM 64
+#define VIRGL_FORMAT_B8G8R8A8_UNORM 1
+#define VIRGL_FORMAT_B5G6R5_UNORM 7
+#define VIRGL_FORMAT_R8G8B8_UNORM 66
+#define VIRGL_FORMAT_R8G8B8A8_UNORM 67
+
+#define VIRGL_BIND_RENDER_TARGET (1 << 1)
+#define VIRGL_BIND_CUSTOM (1 << 17)
+#define PIPE_BUFFER 0
+#define PIPE_TEXTURE_2D 2
+
+enum VirtGpuParamId : uint32_t {
+ kParam3D = 0,
+ kParamCapsetFix = 1,
+ kParamResourceBlob = 2,
+ kParamHostVisible = 3,
+ kParamCrossDevice = 4,
+ kParamContextInit = 5,
+ kParamSupportedCapsetIds = 6,
+ kParamExplicitDebugName = 7,
+ kParamCreateGuestHandle = 8,
+ kParamMax = 9,
+};
+
+enum VirtGpuExecBufferFlags : uint32_t {
+ kFenceIn = 0x0001,
+ kFenceOut = 0x0002,
+ kRingIdx = 0x0004,
+};
+
+enum VirtGpuCapset {
+ kCapsetNone = 0,
+ kCapsetVirgl = 1,
+ kCapsetVirgl2 = 2,
+ kCapsetGfxStreamVulkan = 3,
+ kCapsetVenus = 4,
+ kCapsetCrossDomain = 5,
+ kCapsetDrm = 6,
+ kCapsetGfxStreamMagma = 7,
+ kCapsetGfxStreamGles = 8,
+ kCapsetGfxStreamComposer = 9,
+};
+
+// Try to keep aligned with vulkan-cereal / rutabaga.
+enum VirtGpuHandleType {
+ kMemHandleOpaqueFd = 0x0001,
+ kMemHandleDmabuf = 0x0002,
+ kMemHandleOpaqueWin32 = 0x0003,
+ kMemHandleShm = 0x0004,
+ kMemHandleZircon = 0x0008,
+ kFenceHandleOpaqueFd = 0x0010,
+ kFenceHandleSyncFd = 0x0020,
+ kFenceHandleOpaqueWin32 = 0x0040,
+ kFenceHandleZircon = 0x0080,
+};
+
+enum VirtGpuBlobFlags : uint32_t {
+ kBlobFlagMappable = 0x0001,
+ kBlobFlagShareable = 0x0002,
+ kBlobFlagCrossDevice = 0x0004,
+ kBlobFlagCreateGuestHandle = 0x0008,
+};
+
+enum VirtGpuBlobMem {
+ kBlobMemGuest = 0x0001,
+ kBlobMemHost3d = 0x0002,
+ kBlobMemHost3dGuest = 0x0003,
+};
+
+struct VirtGpuExternalHandle {
+ int64_t osHandle;
+ enum VirtGpuHandleType type;
+};
+
+struct VirtGpuExecBuffer {
+ void* command;
+ uint32_t command_size;
+ uint32_t ring_idx;
+ enum VirtGpuExecBufferFlags flags;
+ struct VirtGpuExternalHandle handle;
+};
+
+struct VirtGpuParam {
+ uint64_t param;
+ const char* name;
+ uint64_t value;
+};
+
+struct VirtGpuCreateBlob {
+ uint64_t size;
+ enum VirtGpuBlobFlags flags;
+ enum VirtGpuBlobMem blobMem;
+ uint64_t blobId;
+};
+
+struct VirtGpuCaps {
+ uint64_t params[kParamMax];
+ struct vulkanCapset vulkanCapset;
+ struct magmaCapset magmaCapset;
+ struct glesCapset glesCapset;
+ struct composerCapset composerCapset;
+};
+
+class VirtGpuBlobMapping;
+class VirtGpuBlob;
+using VirtGpuBlobPtr = std::shared_ptr<VirtGpuBlob>;
+using VirtGpuBlobMappingPtr = std::shared_ptr<VirtGpuBlobMapping>;
+
+class VirtGpuBlob {
+ public:
+ virtual ~VirtGpuBlob() {}
+
+ virtual uint32_t getResourceHandle() const = 0;
+ virtual uint32_t getBlobHandle() const = 0;
+ virtual int wait() = 0;
+
+ virtual VirtGpuBlobMappingPtr createMapping(void) = 0;
+ virtual int exportBlob(struct VirtGpuExternalHandle& handle) = 0;
+
+ virtual int transferFromHost(uint32_t offset, uint32_t size) = 0;
+ virtual int transferToHost(uint32_t offset, uint32_t size) = 0;
+};
+
+class VirtGpuBlobMapping {
+ public:
+ virtual ~VirtGpuBlobMapping(void) {}
+
+ virtual uint8_t* asRawPtr(void) = 0;
+};
+
+class VirtGpuDevice {
+ public:
+ static VirtGpuDevice* getInstance(enum VirtGpuCapset capset = kCapsetNone);
+ static void resetInstance();
+
+ static void setInstanceForTesting(VirtGpuDevice* device);
+
+ VirtGpuDevice(enum VirtGpuCapset capset) : mCapset(capset) {}
+ virtual ~VirtGpuDevice() {}
+
+ enum VirtGpuCapset capset() { return mCapset; }
+
+ virtual int64_t getDeviceHandle(void) = 0;
+
+ virtual struct VirtGpuCaps getCaps(void) = 0;
+
+ virtual VirtGpuBlobPtr createBlob(const struct VirtGpuCreateBlob& blobCreate) = 0;
+ virtual VirtGpuBlobPtr createVirglBlob(uint32_t width, uint32_t height, uint32_t virglFormat) = 0;
+ virtual VirtGpuBlobPtr importBlob(const struct VirtGpuExternalHandle& handle) = 0;
+
+ virtual int execBuffer(struct VirtGpuExecBuffer& execbuffer, const VirtGpuBlob* blob) = 0;
+
+ private:
+ enum VirtGpuCapset mCapset;
+};
+
+VirtGpuDevice* createPlatformVirtGpuDevice(enum VirtGpuCapset capset = kCapsetNone, int fd = -1);
+
+// HACK: We can use gfxstream::guest::EnumFlags, but we'll have to do more guest
+// refactorings to figure out our end goal. We can either depend more on base or
+// try to transition to something else (b:202552093) [atleast for guests].
+constexpr enum VirtGpuBlobFlags operator |(const enum VirtGpuBlobFlags self,
+ const enum VirtGpuBlobFlags other) {
+ return (enum VirtGpuBlobFlags)(uint32_t(self) | uint32_t(other));
+}
+
+constexpr enum VirtGpuExecBufferFlags operator |(const enum VirtGpuExecBufferFlags self,
+ const enum VirtGpuExecBufferFlags other) {
+ return (enum VirtGpuExecBufferFlags)(uint32_t(self) | uint32_t(other));
+}
+
+#endif
diff --git a/src/gfxstream/guest/platform/include/util.h b/src/gfxstream/guest/platform/include/util.h
new file mode 100644
index 00000000000..a0f5459758d
--- /dev/null
+++ b/src/gfxstream/guest/platform/include/util.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright 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.
+ */
+#ifndef UTIL_H
+#define UTIL_H
+
+#define ALIGN(A, B) (((A) + (B)-1) & ~((B)-1))
+
+#endif
diff --git a/src/gfxstream/guest/platform/include/virtgpu_drm.h b/src/gfxstream/guest/platform/include/virtgpu_drm.h
new file mode 100644
index 00000000000..965b675c3dc
--- /dev/null
+++ b/src/gfxstream/guest/platform/include/virtgpu_drm.h
@@ -0,0 +1,250 @@
+/*
+ * 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 */
+#define VIRTGPU_PARAM_EXPLICIT_DEBUG_NAME 8 /* Ability to set debug name from userspace */
+#define VIRTGPU_PARAM_CREATE_GUEST_HANDLE 9 /* Host OS handle can be created from guest memory. */
+
+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
+#define VIRTGPU_BLOB_FLAG_CREATE_GUEST_HANDLE 0x0008
+ /* 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
+#define VIRTGPU_CONTEXT_PARAM_DEBUG_NAME 0x0004
+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/src/gfxstream/guest/platform/include/virtgpu_gfxstream_protocol.h b/src/gfxstream/guest/platform/include/virtgpu_gfxstream_protocol.h
new file mode 100644
index 00000000000..285e8dff559
--- /dev/null
+++ b/src/gfxstream/guest/platform/include/virtgpu_gfxstream_protocol.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 VIRTGPU_GFXSTREAM_PROTOCOL_H
+#define VIRTGPU_GFXSTREAM_PROTOCOL_H
+
+#include <stdint.h>
+
+// See definitions in rutabaga_gfx_ffi.h
+#define VIRTGPU_CAPSET_VIRGL 1
+#define VIRTGPU_CAPSET_VIRGL2 2
+#define VIRTGPU_CAPSET_GFXSTREAM_VULKAN 3
+#define VIRTGPU_CAPSET_VENUS 4
+#define VIRTGPU_CAPSET_CROSS_DOMAIN 5
+#define VIRTGPU_CAPSET_DRM 6
+#define VIRTGPU_CAPSET_GFXSTREAM_MAGMA 7
+#define VIRTGPU_CAPSET_GFXSTREAM_GLES 8
+#define VIRTGPU_CAPSET_GFXSTREAM_COMPOSER 9
+
+// Address Space Graphics contexts
+#define GFXSTREAM_CONTEXT_CREATE 0x1001
+#define GFXSTREAM_CONTEXT_PING 0x1002
+#define GFXSTREAM_CONTEXT_PING_WITH_RESPONSE 0x1003
+
+// Native Sync FD
+#define GFXSTREAM_CREATE_EXPORT_SYNC 0x9000
+#define GFXSTREAM_CREATE_IMPORT_SYNC 0x9001
+
+// Vulkan Sync
+#define GFXSTREAM_CREATE_EXPORT_SYNC_VK 0xa000
+#define GFXSTREAM_CREATE_IMPORT_SYNC_VK 0xa001
+#define GFXSTREAM_CREATE_QSRI_EXPORT_VK 0xa002
+
+// clang-format off
+// A placeholder command to ensure virtio-gpu completes
+#define GFXSTREAM_PLACEHOLDER_COMMAND_VK 0xf002
+// clang-format on
+
+struct gfxstreamHeader {
+ uint32_t opCode;
+};
+
+struct gfxstreamContextCreate {
+ struct gfxstreamHeader hdr;
+ uint32_t resourceId;
+};
+
+struct gfxstreamContextPing {
+ struct gfxstreamHeader hdr;
+ uint32_t resourceId;
+};
+
+struct gfxstreamCreateExportSync {
+ struct gfxstreamHeader hdr;
+ uint32_t syncHandleLo;
+ uint32_t syncHandleHi;
+};
+
+struct gfxstreamCreateExportSyncVK {
+ struct gfxstreamHeader hdr;
+ uint32_t deviceHandleLo;
+ uint32_t deviceHandleHi;
+ uint32_t fenceHandleLo;
+ uint32_t fenceHandleHi;
+};
+
+struct gfxstreamCreateQSRIExportVK {
+ struct gfxstreamHeader hdr;
+ uint32_t imageHandleLo;
+ uint32_t imageHandleHi;
+};
+
+struct gfxstreamPlaceholderCommandVk {
+ struct gfxstreamHeader hdr;
+ uint32_t pad;
+ uint32_t padding;
+};
+
+struct vulkanCapset {
+ uint32_t protocolVersion;
+
+ // ASG Ring Parameters
+ uint32_t ringSize;
+ uint32_t bufferSize;
+
+ uint32_t colorBufferMemoryIndex;
+ uint32_t deferredMapping;
+ uint32_t blobAlignment;
+ uint32_t noRenderControlEnc;
+ uint32_t padding[14];
+};
+
+struct magmaCapset {
+ uint32_t protocolVersion;
+ // ASG Ring Parameters
+ uint32_t ringSize;
+ uint32_t bufferSize;
+ uint32_t blobAlignment;
+};
+
+struct glesCapset {
+ uint32_t protocolVersion;
+ // ASG Ring Parameters
+ uint32_t ringSize;
+ uint32_t bufferSize;
+ uint32_t blobAlignment;
+};
+
+struct composerCapset {
+ uint32_t protocolVersion;
+ // ASG Ring Parameters
+ uint32_t ringSize;
+ uint32_t bufferSize;
+ uint32_t blobAlignment;
+};
+
+#endif
diff --git a/src/gfxstream/guest/platform/linux/LinuxSync.cpp b/src/gfxstream/guest/platform/linux/LinuxSync.cpp
new file mode 100644
index 00000000000..6858c3220e8
--- /dev/null
+++ b/src/gfxstream/guest/platform/linux/LinuxSync.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright 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 "LinuxSync.h"
+
+#if defined(__ANDROID__)
+#include <sync/sync.h>
+#endif
+#include <unistd.h>
+
+namespace gfxstream {
+
+LinuxSyncHelper::LinuxSyncHelper() {}
+
+int LinuxSyncHelper::wait(int syncFd, int timeoutMilliseconds) {
+#if defined(__ANDROID__)
+ return sync_wait(syncFd, timeoutMilliseconds);
+#else
+ (void)syncFd;
+ (void)timeoutMilliseconds;
+ return -1;
+#endif
+}
+
+int LinuxSyncHelper::dup(int syncFd) { return ::dup(syncFd); }
+
+int LinuxSyncHelper::close(int syncFd) { return ::close(syncFd); }
+
+SyncHelper* createPlatformSyncHelper() { return new LinuxSyncHelper(); }
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/linux/LinuxSync.h b/src/gfxstream/guest/platform/linux/LinuxSync.h
new file mode 100644
index 00000000000..d4434d71f3b
--- /dev/null
+++ b/src/gfxstream/guest/platform/linux/LinuxSync.h
@@ -0,0 +1,32 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include "Sync.h"
+
+namespace gfxstream {
+
+class LinuxSyncHelper : public SyncHelper {
+ public:
+ LinuxSyncHelper();
+
+ int wait(int syncFd, int timeoutMilliseconds) override;
+
+ int dup(int syncFd) override;
+
+ int close(int syncFd) override;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/linux/LinuxVirtGpu.h b/src/gfxstream/guest/platform/linux/LinuxVirtGpu.h
new file mode 100644
index 00000000000..65157283a62
--- /dev/null
+++ b/src/gfxstream/guest/platform/linux/LinuxVirtGpu.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright 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 "VirtGpu.h"
+
+class LinuxVirtGpuBlob : public std::enable_shared_from_this<LinuxVirtGpuBlob>, public VirtGpuBlob {
+ public:
+ LinuxVirtGpuBlob(int64_t deviceHandle, uint32_t blobHandle, uint32_t resourceHandle,
+ uint64_t size);
+ ~LinuxVirtGpuBlob();
+
+ uint32_t getResourceHandle() const override;
+ uint32_t getBlobHandle() const override;
+ int wait() override;
+
+ VirtGpuBlobMappingPtr createMapping(void) override;
+ int exportBlob(struct VirtGpuExternalHandle& handle) override;
+
+ int transferFromHost(uint32_t offset, uint32_t size) override;
+ int transferToHost(uint32_t offset, uint32_t size) override;
+
+ private:
+ // Not owned. Really should use a ScopedFD for this, but doesn't matter since we have a
+ // singleton deviceimplemenentation anyways.
+ int64_t mDeviceHandle;
+
+ uint32_t mBlobHandle;
+ uint32_t mResourceHandle;
+ uint64_t mSize;
+};
+
+class LinuxVirtGpuBlobMapping : public VirtGpuBlobMapping {
+ public:
+ LinuxVirtGpuBlobMapping(VirtGpuBlobPtr blob, uint8_t* ptr, uint64_t size);
+ ~LinuxVirtGpuBlobMapping(void);
+
+ uint8_t* asRawPtr(void) override;
+
+ private:
+ VirtGpuBlobPtr mBlob;
+ uint8_t* mPtr;
+ uint64_t mSize;
+};
+
+class LinuxVirtGpuDevice : public VirtGpuDevice {
+ public:
+ LinuxVirtGpuDevice(enum VirtGpuCapset capset, int fd = -1);
+ virtual ~LinuxVirtGpuDevice();
+
+ virtual int64_t getDeviceHandle(void);
+
+ virtual struct VirtGpuCaps getCaps(void);
+
+ VirtGpuBlobPtr createBlob(const struct VirtGpuCreateBlob& blobCreate) override;
+ VirtGpuBlobPtr createVirglBlob(uint32_t width, uint32_t height, uint32_t virglFormat) override;
+
+ virtual VirtGpuBlobPtr importBlob(const struct VirtGpuExternalHandle& handle);
+ virtual int execBuffer(struct VirtGpuExecBuffer& execbuffer, const VirtGpuBlob* blob);
+
+ private:
+ int64_t mDeviceHandle;
+ struct VirtGpuCaps mCaps;
+};
diff --git a/src/gfxstream/guest/platform/linux/LinuxVirtGpuBlob.cpp b/src/gfxstream/guest/platform/linux/LinuxVirtGpuBlob.cpp
new file mode 100644
index 00000000000..9ba1adcd52c
--- /dev/null
+++ b/src/gfxstream/guest/platform/linux/LinuxVirtGpuBlob.cpp
@@ -0,0 +1,150 @@
+/*
+ * 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 <cutils/log.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <xf86drm.h>
+
+#include <cerrno>
+#include <cstring>
+
+#include "LinuxVirtGpu.h"
+#include "virtgpu_drm.h"
+
+LinuxVirtGpuBlob::LinuxVirtGpuBlob(int64_t deviceHandle, uint32_t blobHandle,
+ uint32_t resourceHandle, uint64_t size)
+ : mDeviceHandle(deviceHandle),
+ mBlobHandle(blobHandle),
+ mResourceHandle(resourceHandle),
+ mSize(size) {}
+
+LinuxVirtGpuBlob::~LinuxVirtGpuBlob() {
+ struct drm_gem_close gem_close {
+ .handle = mBlobHandle, .pad = 0,
+ };
+
+ int ret = drmIoctl(mDeviceHandle, DRM_IOCTL_GEM_CLOSE, &gem_close);
+ if (ret) {
+ ALOGE("DRM_IOCTL_GEM_CLOSE failed with : [%s, blobHandle %u, resourceHandle: %u]",
+ strerror(errno), mBlobHandle, mResourceHandle);
+ }
+}
+
+uint32_t LinuxVirtGpuBlob::getBlobHandle() const { return mBlobHandle; }
+
+uint32_t LinuxVirtGpuBlob::getResourceHandle() const { return mResourceHandle; }
+
+VirtGpuBlobMappingPtr LinuxVirtGpuBlob::createMapping() {
+ int ret;
+ struct drm_virtgpu_map map {
+ .handle = mBlobHandle, .pad = 0,
+ };
+
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_MAP, &map);
+ if (ret) {
+ ALOGE("DRM_IOCTL_VIRTGPU_MAP failed with %s", strerror(errno));
+ return nullptr;
+ }
+
+ uint8_t* ptr = static_cast<uint8_t*>(
+ mmap64(nullptr, mSize, PROT_WRITE | PROT_READ, MAP_SHARED, mDeviceHandle, map.offset));
+
+ if (ptr == MAP_FAILED) {
+ ALOGE("mmap64 failed with (%s)", strerror(errno));
+ return nullptr;
+ }
+
+ return std::make_shared<LinuxVirtGpuBlobMapping>(shared_from_this(), ptr, mSize);
+}
+
+int LinuxVirtGpuBlob::exportBlob(struct VirtGpuExternalHandle& handle) {
+ int ret, fd;
+
+ uint32_t flags = DRM_CLOEXEC;
+ ret = drmPrimeHandleToFD(mDeviceHandle, mBlobHandle, flags, &fd);
+ if (ret) {
+ ALOGE("drmPrimeHandleToFD failed with %s", strerror(errno));
+ return ret;
+ }
+
+ handle.osHandle = static_cast<int64_t>(fd);
+ handle.type = kMemHandleDmabuf;
+ return 0;
+}
+
+int LinuxVirtGpuBlob::wait() {
+ int ret;
+ struct drm_virtgpu_3d_wait wait_3d = {0};
+
+ int retry = 0;
+ do {
+ if (retry > 0 && (retry % 10 == 0)) {
+ ALOGE("DRM_IOCTL_VIRTGPU_WAIT failed with EBUSY for %d times.", retry);
+ }
+ wait_3d.handle = mBlobHandle;
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_WAIT, &wait_3d);
+ ++retry;
+ } while (ret < 0 && errno == EBUSY);
+
+ if (ret < 0) {
+ ALOGE("DRM_IOCTL_VIRTGPU_WAIT failed with %s", strerror(errno));
+ return ret;
+ }
+
+ return 0;
+}
+
+int LinuxVirtGpuBlob::transferToHost(uint32_t offset, uint32_t size) {
+ int ret;
+ struct drm_virtgpu_3d_transfer_to_host xfer = {0};
+
+ xfer.box.x = offset;
+ xfer.box.y = 0;
+ xfer.box.w = size;
+ xfer.box.h = 1;
+ xfer.box.d = 1;
+ xfer.bo_handle = mBlobHandle;
+
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST, &xfer);
+ if (ret < 0) {
+ ALOGE("DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST failed with %s", strerror(errno));
+ return ret;
+ }
+
+ return 0;
+}
+
+int LinuxVirtGpuBlob::transferFromHost(uint32_t offset, uint32_t size) {
+ int ret;
+ struct drm_virtgpu_3d_transfer_from_host xfer = {0};
+
+ xfer.box.x = offset;
+ xfer.box.y = 0;
+ xfer.box.w = size;
+ xfer.box.h = 1;
+ xfer.box.d = 1;
+ xfer.bo_handle = mBlobHandle;
+
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST, &xfer);
+ if (ret < 0) {
+ ALOGE("DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST failed with %s", strerror(errno));
+ return ret;
+ }
+
+ return 0;
+}
diff --git a/src/gfxstream/guest/platform/linux/LinuxVirtGpuBlobMapping.cpp b/src/gfxstream/guest/platform/linux/LinuxVirtGpuBlobMapping.cpp
new file mode 100644
index 00000000000..69e0e187dd3
--- /dev/null
+++ b/src/gfxstream/guest/platform/linux/LinuxVirtGpuBlobMapping.cpp
@@ -0,0 +1,26 @@
+/*
+ * 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 <sys/mman.h>
+
+#include "LinuxVirtGpu.h"
+
+LinuxVirtGpuBlobMapping::LinuxVirtGpuBlobMapping(VirtGpuBlobPtr blob, uint8_t* ptr, uint64_t size)
+ : mBlob(blob), mPtr(ptr), mSize(size) {}
+
+LinuxVirtGpuBlobMapping::~LinuxVirtGpuBlobMapping(void) { munmap(mPtr, mSize); }
+
+uint8_t* LinuxVirtGpuBlobMapping::asRawPtr(void) { return mPtr; }
diff --git a/src/gfxstream/guest/platform/linux/LinuxVirtGpuDevice.cpp b/src/gfxstream/guest/platform/linux/LinuxVirtGpuDevice.cpp
new file mode 100644
index 00000000000..569e02e38b2
--- /dev/null
+++ b/src/gfxstream/guest/platform/linux/LinuxVirtGpuDevice.cpp
@@ -0,0 +1,274 @@
+/*
+ * 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 <cutils/log.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <xf86drm.h>
+
+#include <cerrno>
+#include <cstring>
+#include <fstream>
+#include <string>
+
+#include "LinuxVirtGpu.h"
+#include "virtgpu_drm.h"
+#include "virtgpu_gfxstream_protocol.h"
+
+#define PARAM(x) \
+ (struct VirtGpuParam) { x, #x, 0 }
+
+static inline uint32_t align_up(uint32_t n, uint32_t a) { return ((n + a - 1) / a) * a; }
+
+LinuxVirtGpuDevice::LinuxVirtGpuDevice(enum VirtGpuCapset capset, int fd) : VirtGpuDevice(capset) {
+ struct VirtGpuParam params[] = {
+ PARAM(VIRTGPU_PARAM_3D_FEATURES), PARAM(VIRTGPU_PARAM_CAPSET_QUERY_FIX),
+ PARAM(VIRTGPU_PARAM_RESOURCE_BLOB), PARAM(VIRTGPU_PARAM_HOST_VISIBLE),
+ PARAM(VIRTGPU_PARAM_CROSS_DEVICE), PARAM(VIRTGPU_PARAM_CONTEXT_INIT),
+ PARAM(VIRTGPU_PARAM_SUPPORTED_CAPSET_IDs), PARAM(VIRTGPU_PARAM_EXPLICIT_DEBUG_NAME),
+ PARAM(VIRTGPU_PARAM_CREATE_GUEST_HANDLE),
+ };
+
+ int ret;
+ struct drm_virtgpu_get_caps get_caps = {0};
+ struct drm_virtgpu_context_init init = {0};
+ struct drm_virtgpu_context_set_param ctx_set_params[3] = {{0}};
+ const char* processName = nullptr;
+
+ memset(&mCaps, 0, sizeof(struct VirtGpuCaps));
+
+#ifdef __ANDROID__
+ processName = getprogname();
+#endif
+
+ if (fd < 0) {
+ mDeviceHandle = static_cast<int64_t>(drmOpenRender(128));
+ if (mDeviceHandle < 0) {
+ ALOGE("Failed to open rendernode: %s", strerror(errno));
+ return;
+ }
+ } else {
+ mDeviceHandle = dup(fd);
+ if (mDeviceHandle < 0) {
+ ALOGE("Failed to dup rendernode: %s", strerror(errno));
+ return;
+ }
+ }
+
+ for (uint32_t i = 0; i < kParamMax; i++) {
+ struct drm_virtgpu_getparam get_param = {0};
+ get_param.param = params[i].param;
+ get_param.value = (uint64_t)(uintptr_t)&params[i].value;
+
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_GETPARAM, &get_param);
+ if (ret) {
+ ALOGE("virtgpu backend not enabling %s", params[i].name);
+ continue;
+ }
+
+ mCaps.params[i] = params[i].value;
+ }
+
+ get_caps.cap_set_id = static_cast<uint32_t>(capset);
+ switch (capset) {
+ case kCapsetGfxStreamVulkan:
+ get_caps.size = sizeof(struct vulkanCapset);
+ get_caps.addr = (unsigned long long)&mCaps.vulkanCapset;
+ break;
+ case kCapsetGfxStreamMagma:
+ get_caps.size = sizeof(struct magmaCapset);
+ get_caps.addr = (unsigned long long)&mCaps.magmaCapset;
+ break;
+ case kCapsetGfxStreamGles:
+ get_caps.size = sizeof(struct vulkanCapset);
+ get_caps.addr = (unsigned long long)&mCaps.glesCapset;
+ break;
+ case kCapsetGfxStreamComposer:
+ get_caps.size = sizeof(struct vulkanCapset);
+ get_caps.addr = (unsigned long long)&mCaps.composerCapset;
+ break;
+ default:
+ get_caps.size = 0;
+ }
+
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_GET_CAPS, &get_caps);
+ if (ret) {
+ // Don't fail get capabilities just yet, AEMU doesn't use this API
+ // yet (b/272121235);
+ ALOGE("DRM_IOCTL_VIRTGPU_GET_CAPS failed with %s", strerror(errno));
+ }
+
+ // We always need an ASG blob in some cases, so always define blobAlignment
+ if (!mCaps.vulkanCapset.blobAlignment) {
+ mCaps.vulkanCapset.blobAlignment = 4096;
+ }
+
+ ctx_set_params[0].param = VIRTGPU_CONTEXT_PARAM_NUM_RINGS;
+ ctx_set_params[0].value = 2;
+ init.num_params = 1;
+
+ if (capset != kCapsetNone) {
+ ctx_set_params[init.num_params].param = VIRTGPU_CONTEXT_PARAM_CAPSET_ID;
+ ctx_set_params[init.num_params].value = static_cast<uint32_t>(capset);
+ init.num_params++;
+ }
+
+ if (mCaps.params[kParamExplicitDebugName] && processName) {
+ ctx_set_params[init.num_params].param = VIRTGPU_CONTEXT_PARAM_DEBUG_NAME;
+ ctx_set_params[init.num_params].value = reinterpret_cast<uint64_t>(processName);
+ init.num_params++;
+ }
+
+ init.ctx_set_params = (unsigned long long)&ctx_set_params[0];
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_CONTEXT_INIT, &init);
+ if (ret) {
+ ALOGE("DRM_IOCTL_VIRTGPU_CONTEXT_INIT failed with %s, continuing without context...",
+ strerror(errno));
+ }
+}
+
+LinuxVirtGpuDevice::~LinuxVirtGpuDevice() { close(mDeviceHandle); }
+
+struct VirtGpuCaps LinuxVirtGpuDevice::getCaps(void) { return mCaps; }
+
+int64_t LinuxVirtGpuDevice::getDeviceHandle(void) { return mDeviceHandle; }
+
+VirtGpuBlobPtr LinuxVirtGpuDevice::createVirglBlob(uint32_t width, uint32_t height,
+ uint32_t virglFormat) {
+ uint32_t target = 0;
+ uint32_t bind = 0;
+ uint32_t bpp = 0;
+
+ switch (virglFormat) {
+ case VIRGL_FORMAT_R8G8B8A8_UNORM:
+ case VIRGL_FORMAT_B8G8R8A8_UNORM:
+ target = PIPE_TEXTURE_2D;
+ bind = VIRGL_BIND_RENDER_TARGET;
+ bpp = 4;
+ break;
+ case VIRGL_FORMAT_R8_UNORM:
+ target = PIPE_BUFFER;
+ bind = VIRGL_BIND_CUSTOM;
+ bpp = 1;
+ break;
+ default:
+ ALOGE("Unknown virgl format");
+ return nullptr;
+ }
+
+ drm_virtgpu_resource_create create = {
+ .target = target,
+ .format = virglFormat,
+ .bind = bind,
+ .width = width,
+ .height = height,
+ .depth = 1U,
+ .array_size = 1U,
+ .last_level = 0,
+ .nr_samples = 0,
+ .size = width * height * bpp,
+ .stride = width * bpp,
+ };
+
+ int ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_RESOURCE_CREATE, &create);
+ if (ret) {
+ ALOGE("DRM_IOCTL_VIRTGPU_RESOURCE_CREATE failed with %s", strerror(errno));
+ return nullptr;
+ }
+
+ return std::make_shared<LinuxVirtGpuBlob>(mDeviceHandle, create.bo_handle, create.res_handle,
+ static_cast<uint64_t>(create.size));
+}
+
+VirtGpuBlobPtr LinuxVirtGpuDevice::createBlob(const struct VirtGpuCreateBlob& blobCreate) {
+ int ret;
+ struct drm_virtgpu_resource_create_blob create = {0};
+
+ create.size = blobCreate.size;
+ create.blob_mem = blobCreate.blobMem;
+ create.blob_flags = blobCreate.flags;
+ create.blob_id = blobCreate.blobId;
+
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_RESOURCE_CREATE_BLOB, &create);
+ if (ret < 0) {
+ ALOGE("DRM_VIRTGPU_RESOURCE_CREATE_BLOB failed with %s", strerror(errno));
+ return nullptr;
+ }
+
+ return std::make_shared<LinuxVirtGpuBlob>(mDeviceHandle, create.bo_handle, create.res_handle,
+ blobCreate.size);
+}
+
+VirtGpuBlobPtr LinuxVirtGpuDevice::importBlob(const struct VirtGpuExternalHandle& handle) {
+ struct drm_virtgpu_resource_info info = {0};
+ uint32_t blobHandle;
+ int ret;
+
+ ret = drmPrimeFDToHandle(mDeviceHandle, handle.osHandle, &blobHandle);
+ close(handle.osHandle);
+ if (ret) {
+ ALOGE("DRM_IOCTL_PRIME_FD_TO_HANDLE failed: %s", strerror(errno));
+ return nullptr;
+ }
+
+ info.bo_handle = blobHandle;
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_RESOURCE_INFO, &info);
+ if (ret) {
+ ALOGE("DRM_IOCTL_VIRTGPU_RESOURCE_INFO failed: %s", strerror(errno));
+ return nullptr;
+ }
+
+ return std::make_shared<LinuxVirtGpuBlob>(mDeviceHandle, blobHandle, info.res_handle,
+ static_cast<uint64_t>(info.size));
+}
+
+int LinuxVirtGpuDevice::execBuffer(struct VirtGpuExecBuffer& execbuffer, const VirtGpuBlob* blob) {
+ int ret;
+ struct drm_virtgpu_execbuffer exec = {0};
+ uint32_t blobHandle;
+
+ exec.flags = execbuffer.flags;
+ exec.size = execbuffer.command_size;
+ exec.ring_idx = execbuffer.ring_idx;
+ exec.command = (uint64_t)(uintptr_t)(execbuffer.command);
+ exec.fence_fd = -1;
+
+ if (blob) {
+ blobHandle = blob->getBlobHandle();
+ exec.bo_handles = (uint64_t)(uintptr_t)(&blobHandle);
+ exec.num_bo_handles = 1;
+ }
+
+ ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_EXECBUFFER, &exec);
+ if (ret) {
+ ALOGE("DRM_IOCTL_VIRTGPU_EXECBUFFER failed: %s", strerror(errno));
+ return ret;
+ }
+
+ if (execbuffer.flags & kFenceOut) {
+ execbuffer.handle.osHandle = exec.fence_fd;
+ execbuffer.handle.type = kFenceHandleSyncFd;
+ }
+
+ return 0;
+}
+
+VirtGpuDevice* createPlatformVirtGpuDevice(enum VirtGpuCapset capset, int fd) {
+ return new LinuxVirtGpuDevice(capset, fd);
+}
diff --git a/src/gfxstream/guest/platform/linux/meson.build b/src/gfxstream/guest/platform/linux/meson.build
new file mode 100644
index 00000000000..a430981a1e6
--- /dev/null
+++ b/src/gfxstream/guest/platform/linux/meson.build
@@ -0,0 +1,18 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_platform = files(
+ '../VirtGpu.cpp',
+ 'LinuxVirtGpuDevice.cpp',
+ 'LinuxVirtGpuBlobMapping.cpp',
+ 'LinuxVirtGpuBlob.cpp',
+ 'LinuxSync.cpp',
+)
+
+lib_platform = static_library(
+ 'platform',
+ files_lib_platform,
+ cpp_args: gfxstream_guest_args,
+ include_directories: [inc_platform, inc_android_compat],
+ dependencies: drm_dep,
+)
diff --git a/src/gfxstream/guest/platform/meson.build b/src/gfxstream/guest/platform/meson.build
new file mode 100644
index 00000000000..67e5ac67447
--- /dev/null
+++ b/src/gfxstream/guest/platform/meson.build
@@ -0,0 +1,6 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_platform = include_directories('include')
+subdir('linux')
+subdir('stub')
diff --git a/src/gfxstream/guest/platform/rutabaga/RutabagaLayer.cpp b/src/gfxstream/guest/platform/rutabaga/RutabagaLayer.cpp
new file mode 100644
index 00000000000..42fb57dc8a6
--- /dev/null
+++ b/src/gfxstream/guest/platform/rutabaga/RutabagaLayer.cpp
@@ -0,0 +1,1035 @@
+/*
+ * Copyright 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 "RutabagaLayer.h"
+
+#include <inttypes.h>
+#include <log/log.h>
+
+#include <cstdlib>
+#include <future>
+#include <memory>
+#include <optional>
+#include <queue>
+#include <sstream>
+#include <string>
+#include <thread>
+#include <unordered_map>
+#include <variant>
+
+#include "gfxstream/virtio-gpu-gfxstream-renderer.h"
+#include "gfxstream/virtio-gpu-gfxstream-renderer-unstable.h"
+
+namespace gfxstream {
+namespace {
+
+constexpr const uint32_t kInvalidContextId = 0;
+
+std::vector<std::string> Split(const std::string& s, const std::string& delimiters) {
+ if (delimiters.empty()) {
+ return {};
+ }
+
+ std::vector<std::string> result;
+
+ size_t base = 0;
+ size_t found;
+ while (true) {
+ found = s.find_first_of(delimiters, base);
+ result.push_back(s.substr(base, found - base));
+ if (found == s.npos) break;
+ base = found + 1;
+ }
+
+ return result;
+}
+
+std::string Join(const std::vector<std::string>& things, const std::string& separator) {
+ if (things.empty()) {
+ return "";
+ }
+
+ std::ostringstream result;
+ result << *things.begin();
+ for (auto it = std::next(things.begin()); it != things.end(); ++it) {
+ result << separator << *it;
+ }
+ return result.str();
+}
+
+} // namespace
+
+class EmulatedVirtioGpu::EmulatedVirtioGpuImpl {
+ public:
+ EmulatedVirtioGpuImpl();
+ ~EmulatedVirtioGpuImpl();
+
+ bool Init(bool withGl, bool withVk, bool withVkSnapshots, EmulatedVirtioGpu* parent);
+
+ VirtGpuCaps GetCaps(VirtGpuCapset capset);
+
+ std::optional<uint32_t> CreateContext();
+ void DestroyContext(uint32_t contextId);
+
+ uint8_t* Map(uint32_t resourceId);
+ void Unmap(uint32_t resourceId);
+
+ int ExecBuffer(uint32_t contextId, struct VirtGpuExecBuffer& execbuffer,
+ std::optional<uint32_t> blobResourceId);
+
+ int Wait(uint32_t resourceId);
+
+ int TransferFromHost(uint32_t contextId, uint32_t resourceId, uint32_t transferOffset,
+ uint32_t transferSize);
+ int TransferToHost(uint32_t contextId, uint32_t resourceId, uint32_t transferOffset,
+ uint32_t transferSize);
+
+ std::optional<uint32_t> CreateBlob(uint32_t contextId, const struct VirtGpuCreateBlob& params);
+ std::optional<uint32_t> CreateVirglBlob(uint32_t contextId, uint32_t width, uint32_t height,
+ uint32_t virglFormat);
+
+ void DestroyResource(uint32_t contextId, uint32_t resourceId);
+
+ uint32_t CreateEmulatedFence();
+
+ void SignalEmulatedFence(uint32_t fenceId);
+
+ int WaitOnEmulatedFence(int fenceAsFileDescriptor, int timeoutMilliseconds);
+
+ private:
+ struct VirtioGpuTaskContextAttachResource {
+ uint32_t contextId;
+ uint32_t resourceId;
+ };
+ struct VirtioGpuTaskContextDetachResource {
+ uint32_t contextId;
+ uint32_t resourceId;
+ };
+ struct VirtioGpuTaskCreateContext {
+ uint32_t contextId;
+ uint32_t contextInit;
+ std::string contextName;
+ };
+ struct VirtioGpuTaskCreateBlob {
+ uint32_t contextId;
+ uint32_t resourceId;
+ struct stream_renderer_create_blob params;
+ };
+ struct VirtioGpuTaskCreateResource {
+ uint32_t contextId;
+ uint32_t resourceId;
+ uint8_t* resourceBytes;
+ struct stream_renderer_resource_create_args params;
+ };
+ struct VirtioGpuTaskDestroyContext {
+ uint32_t contextId;
+ };
+ struct VirtioGpuTaskMap {
+ uint32_t resourceId;
+ std::promise<uint8_t*> resourceMappedPromise;
+ };
+ struct VirtioGpuTaskExecBuffer {
+ uint32_t contextId;
+ std::vector<std::byte> commandBuffer;
+ };
+ struct VirtioGpuTaskTransferToHost {
+ uint32_t contextId;
+ uint32_t resourceId;
+ uint32_t transferOffset;
+ uint32_t transferSize;
+ };
+ struct VirtioGpuTaskTransferFromHost {
+ uint32_t contextId;
+ uint32_t resourceId;
+ uint32_t transferOffset;
+ uint32_t transferSize;
+ };
+ struct VirtioGpuTaskUnrefResource {
+ uint32_t resourceId;
+ };
+ using VirtioGpuTask =
+ std::variant<VirtioGpuTaskContextAttachResource, VirtioGpuTaskContextDetachResource,
+ VirtioGpuTaskCreateBlob, VirtioGpuTaskCreateContext,
+ VirtioGpuTaskCreateResource, VirtioGpuTaskDestroyContext, VirtioGpuTaskMap,
+ VirtioGpuTaskExecBuffer, VirtioGpuTaskTransferFromHost,
+ VirtioGpuTaskTransferToHost, VirtioGpuTaskUnrefResource>;
+ struct VirtioGpuTaskWithWaitable {
+ uint32_t contextId;
+ VirtioGpuTask task;
+ std::promise<void> taskCompletedSignaler;
+ std::optional<uint32_t> fence;
+ };
+
+ std::shared_future<void> EnqueueVirtioGpuTask(uint32_t contextId, VirtioGpuTask task,
+ std::optional<uint32_t> fence = std::nullopt);
+ void DoTask(VirtioGpuTaskContextAttachResource task);
+ void DoTask(VirtioGpuTaskContextDetachResource task);
+ void DoTask(VirtioGpuTaskCreateContext task);
+ void DoTask(VirtioGpuTaskCreateBlob task);
+ void DoTask(VirtioGpuTaskCreateResource task);
+ void DoTask(VirtioGpuTaskDestroyContext task);
+ void DoTask(VirtioGpuTaskMap task);
+ void DoTask(VirtioGpuTaskExecBuffer task);
+ void DoTask(VirtioGpuTaskTransferFromHost task);
+ void DoTask(VirtioGpuTaskTransferToHost task);
+ void DoTask(VirtioGpuTaskWithWaitable task);
+ void DoTask(VirtioGpuTaskUnrefResource task);
+
+ void RunVirtioGpuTaskProcessingLoop();
+
+ std::atomic<uint32_t> mNextContextId{1};
+ std::atomic<uint32_t> mNextVirtioGpuResourceId{1};
+ std::atomic<uint32_t> mNextVirtioGpuFenceId{1};
+
+ std::atomic_bool mShuttingDown{false};
+
+ std::mutex mTasksMutex;
+ std::queue<VirtioGpuTaskWithWaitable> mTasks;
+
+ enum class EmulatedResourceType {
+ kBlob,
+ kPipe,
+ };
+ struct EmulatedResource {
+ EmulatedResourceType type;
+
+ std::mutex pendingWaitablesMutex;
+ std::vector<std::shared_future<void>> pendingWaitables;
+
+ // For non-blob resources, the guest shadow memory.
+ std::unique_ptr<uint8_t[]> guestBytes;
+
+ // For mappable blob resources, the host memory once it is mapped.
+ std::shared_future<uint8_t*> mappedHostBytes;
+ };
+ std::mutex mResourcesMutex;
+ std::unordered_map<uint32_t, EmulatedResource> mResources;
+
+ EmulatedResource* CreateResource(uint32_t resourceId, EmulatedResourceType resourceType) {
+ std::lock_guard<std::mutex> lock(mResourcesMutex);
+
+ auto [it, created] = mResources.emplace(
+ std::piecewise_construct, std::forward_as_tuple(resourceId), std::forward_as_tuple());
+ if (!created) {
+ ALOGE("Created resource %" PRIu32 " twice?", resourceId);
+ }
+
+ EmulatedResource* resource = &it->second;
+ resource->type = resourceType;
+ return resource;
+ }
+
+ EmulatedResource* GetResource(uint32_t resourceId) {
+ std::lock_guard<std::mutex> lock(mResourcesMutex);
+
+ auto it = mResources.find(resourceId);
+ if (it == mResources.end()) {
+ return nullptr;
+ }
+
+ return &it->second;
+ }
+
+ void DeleteResource(uint32_t resourceId) {
+ std::lock_guard<std::mutex> lock(mResourcesMutex);
+ mResources.erase(resourceId);
+ }
+
+ struct EmulatedFence {
+ std::promise<void> signaler;
+ std::shared_future<void> waitable;
+ };
+ std::mutex mVirtioGpuFencesMutex;
+ std::unordered_map<uint32_t, EmulatedFence> mVirtioGpuFences;
+
+ std::thread mWorkerThread;
+};
+
+EmulatedVirtioGpu::EmulatedVirtioGpuImpl::EmulatedVirtioGpuImpl()
+ : mWorkerThread([this]() { RunVirtioGpuTaskProcessingLoop(); }) {}
+
+EmulatedVirtioGpu::EmulatedVirtioGpuImpl::~EmulatedVirtioGpuImpl() {
+ mShuttingDown = true;
+ mWorkerThread.join();
+
+ stream_renderer_teardown();
+}
+
+namespace {
+
+void WriteFenceTrampoline(void* cookie, struct stream_renderer_fence* fence) {
+ auto* gpu = reinterpret_cast<EmulatedVirtioGpu*>(cookie);
+ gpu->SignalEmulatedFence(fence->fence_id);
+}
+
+} // namespace
+
+bool EmulatedVirtioGpu::EmulatedVirtioGpuImpl::Init(bool withGl, bool withVk, bool withVkSnapshots,
+ EmulatedVirtioGpu* parent) {
+ std::vector<stream_renderer_param> renderer_params{
+ stream_renderer_param{
+ .key = STREAM_RENDERER_PARAM_USER_DATA,
+ .value = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(parent)),
+ },
+ stream_renderer_param{
+ .key = STREAM_RENDERER_PARAM_FENCE_CALLBACK,
+ .value = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(&WriteFenceTrampoline)),
+ },
+ stream_renderer_param{
+ .key = STREAM_RENDERER_PARAM_RENDERER_FLAGS,
+ .value =
+ static_cast<uint64_t>(STREAM_RENDERER_FLAGS_USE_SURFACELESS_BIT) |
+ (withGl ? static_cast<uint64_t>(STREAM_RENDERER_FLAGS_USE_EGL_BIT |
+ STREAM_RENDERER_FLAGS_USE_GLES_BIT)
+ : 0) |
+ (withVk ? static_cast<uint64_t>(STREAM_RENDERER_FLAGS_USE_VK_BIT) : 0) |
+ (withVkSnapshots ? static_cast<uint64_t>(STREAM_RENDERER_FLAGS_VULKAN_SNAPSHOTS)
+ : 0),
+ },
+ stream_renderer_param{
+ .key = STREAM_RENDERER_PARAM_WIN0_WIDTH,
+ .value = 32,
+ },
+ stream_renderer_param{
+ .key = STREAM_RENDERER_PARAM_WIN0_HEIGHT,
+ .value = 32,
+ },
+ };
+ return stream_renderer_init(renderer_params.data(), renderer_params.size()) == 0;
+}
+
+VirtGpuCaps EmulatedVirtioGpu::EmulatedVirtioGpuImpl::GetCaps(VirtGpuCapset capset) {
+ VirtGpuCaps caps = {
+ .params =
+ {
+ [kParam3D] = 1,
+ [kParamCapsetFix] = 1,
+ [kParamResourceBlob] = 1,
+ [kParamHostVisible] = 1,
+ [kParamCrossDevice] = 0,
+ [kParamContextInit] = 1,
+ [kParamSupportedCapsetIds] = 0,
+ [kParamCreateGuestHandle] = 0,
+ },
+ };
+
+ stream_renderer_fill_caps(static_cast<uint32_t>(capset), 0, &caps.vulkanCapset);
+
+ return caps;
+}
+
+std::optional<uint32_t> EmulatedVirtioGpu::EmulatedVirtioGpuImpl::CreateContext() {
+ const uint32_t contextId = mNextContextId++;
+
+ VirtioGpuTaskCreateContext task = {
+ .contextId = contextId,
+ .contextInit = 0,
+ .contextName = "EmulatedVirtioGpu Context " + std::to_string(contextId),
+ };
+ EnqueueVirtioGpuTask(contextId, std::move(task));
+ return contextId;
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DestroyContext(uint32_t contextId) {
+ VirtioGpuTaskDestroyContext task = {
+ .contextId = contextId,
+ };
+ EnqueueVirtioGpuTask(contextId, std::move(task));
+}
+
+uint8_t* EmulatedVirtioGpu::EmulatedVirtioGpuImpl::Map(uint32_t resourceId) {
+ EmulatedResource* resource = GetResource(resourceId);
+ if (resource == nullptr) {
+ ALOGE("Failed to Map() resource %" PRIu32 ": not found.", resourceId);
+ return nullptr;
+ }
+
+ uint8_t* mapped = nullptr;
+ if (resource->type == EmulatedResourceType::kBlob) {
+ if (!resource->mappedHostBytes.valid()) {
+ ALOGE("Failed to Map() resource %" PRIu32
+ ": attempting to map blob "
+ "without mappable flag?",
+ resourceId);
+ return nullptr;
+ }
+ mapped = resource->mappedHostBytes.get();
+ } else if (resource->type == EmulatedResourceType::kPipe) {
+ mapped = resource->guestBytes.get();
+ }
+ return mapped;
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::Unmap(uint32_t resourceId) {
+ stream_renderer_resource_unmap(resourceId);
+}
+
+int EmulatedVirtioGpu::EmulatedVirtioGpuImpl::Wait(uint32_t resourceId) {
+ EmulatedResource* resource = GetResource(resourceId);
+ if (resource == nullptr) {
+ ALOGE("Failed to Wait() on resource %" PRIu32 ": not found.", resourceId);
+ return -1;
+ }
+
+ std::vector<std::shared_future<void>> pendingWaitables;
+ {
+ std::lock_guard<std::mutex> lock(resource->pendingWaitablesMutex);
+ pendingWaitables = resource->pendingWaitables;
+ resource->pendingWaitables.clear();
+ }
+ for (auto& waitable : pendingWaitables) {
+ waitable.wait();
+ }
+
+ return 0;
+}
+
+int EmulatedVirtioGpu::EmulatedVirtioGpuImpl::TransferFromHost(uint32_t contextId,
+ uint32_t resourceId,
+ uint32_t transferOffset,
+ uint32_t transferSize) {
+ EmulatedResource* resource = GetResource(resourceId);
+ if (resource == nullptr) {
+ ALOGE("Failed to TransferFromHost() on resource %" PRIu32 ": not found.", resourceId);
+ return -1;
+ }
+
+ VirtioGpuTaskTransferFromHost task = {
+ .contextId = contextId,
+ .resourceId = resourceId,
+ .transferOffset = transferOffset,
+ .transferSize = transferSize,
+ };
+ auto waitable = EnqueueVirtioGpuTask(contextId, std::move(task));
+
+ {
+ std::lock_guard<std::mutex> lock(resource->pendingWaitablesMutex);
+ resource->pendingWaitables.push_back(std::move(waitable));
+ }
+
+ return 0;
+}
+
+int EmulatedVirtioGpu::EmulatedVirtioGpuImpl::TransferToHost(uint32_t contextId,
+ uint32_t resourceId,
+ uint32_t transferOffset,
+ uint32_t transferSize) {
+ EmulatedResource* resource = GetResource(resourceId);
+ if (resource == nullptr) {
+ ALOGE("Failed to TransferFromHost() on resource %" PRIu32 ": not found.", resourceId);
+ return -1;
+ }
+
+ VirtioGpuTaskTransferToHost task = {
+ .contextId = contextId,
+ .resourceId = resourceId,
+ .transferOffset = transferOffset,
+ .transferSize = transferSize,
+ };
+ auto waitable = EnqueueVirtioGpuTask(contextId, std::move(task));
+
+ {
+ std::lock_guard<std::mutex> lock(resource->pendingWaitablesMutex);
+ resource->pendingWaitables.push_back(std::move(waitable));
+ }
+
+ return 0;
+}
+
+std::optional<uint32_t> EmulatedVirtioGpu::EmulatedVirtioGpuImpl::CreateBlob(
+ uint32_t contextId, const struct VirtGpuCreateBlob& blobCreate) {
+
+ const uint32_t resourceId = mNextVirtioGpuResourceId++;
+
+ ALOGV("Enquing task to create blob resource-id:%d size:%" PRIu64, resourceId, blobCreate.size);
+
+ EmulatedResource* resource = CreateResource(resourceId, EmulatedResourceType::kBlob);
+
+ VirtioGpuTaskCreateBlob createTask{
+ .contextId = contextId,
+ .resourceId = resourceId,
+ .params =
+ {
+ .blob_mem = static_cast<uint32_t>(blobCreate.blobMem),
+ .blob_flags = static_cast<uint32_t>(blobCreate.flags),
+ .blob_id = blobCreate.blobId,
+ .size = blobCreate.size,
+ },
+ };
+ auto createBlobCompletedWaitable = EnqueueVirtioGpuTask(contextId, std::move(createTask));
+ resource->pendingWaitables.push_back(std::move(createBlobCompletedWaitable));
+
+ if (blobCreate.flags & kBlobFlagMappable) {
+ std::promise<uint8_t*> mappedBytesPromise;
+ std::shared_future<uint8_t*> mappedBytesWaitable = mappedBytesPromise.get_future();
+
+ VirtioGpuTaskMap mapTask{
+ .resourceId = resourceId,
+ .resourceMappedPromise = std::move(mappedBytesPromise),
+ };
+ EnqueueVirtioGpuTask(contextId, std::move(mapTask));
+ resource->mappedHostBytes = std::move(mappedBytesWaitable);
+ }
+
+ VirtioGpuTaskContextAttachResource attachTask{
+ .contextId = contextId,
+ .resourceId = resourceId,
+ };
+ EnqueueVirtioGpuTask(contextId, std::move(attachTask));
+
+ return resourceId;
+}
+
+std::optional<uint32_t> EmulatedVirtioGpu::EmulatedVirtioGpuImpl::CreateVirglBlob(
+ uint32_t contextId, uint32_t width, uint32_t height, uint32_t virglFormat) {
+
+ const uint32_t resourceId = mNextVirtioGpuResourceId++;
+
+ EmulatedResource* resource = CreateResource(resourceId, EmulatedResourceType::kPipe);
+
+ uint32_t target = 0;
+ uint32_t bind = 0;
+ uint32_t bpp = 0;
+
+ switch (virglFormat) {
+ case VIRGL_FORMAT_R8G8B8A8_UNORM:
+ case VIRGL_FORMAT_B8G8R8A8_UNORM:
+ target = PIPE_TEXTURE_2D;
+ bind = VIRGL_BIND_RENDER_TARGET;
+ bpp = 4;
+ break;
+ case VIRGL_FORMAT_B5G6R5_UNORM:
+ target = PIPE_TEXTURE_2D;
+ bind = VIRGL_BIND_RENDER_TARGET;
+ bpp = 2;
+ break;
+ case VIRGL_FORMAT_R8G8B8_UNORM:
+ target = PIPE_TEXTURE_2D;
+ bind = VIRGL_BIND_RENDER_TARGET;
+ bpp = 3;
+ break;
+ case VIRGL_FORMAT_R8_UNORM:
+ target = PIPE_BUFFER;
+ bind = VIRGL_BIND_CUSTOM;
+ bpp = 1;
+ break;
+ default:
+ ALOGE("Unknown virgl format %u", virglFormat);
+ return {};
+ }
+
+ resource->guestBytes = std::make_unique<uint8_t[]>(width * height * bpp);
+
+ VirtioGpuTaskCreateResource task{
+ .contextId = contextId,
+ .resourceId = resourceId,
+ .resourceBytes = resource->guestBytes.get(),
+ .params =
+ {
+ .handle = resourceId,
+ .target = target,
+ .format = virglFormat,
+ .bind = bind,
+ .width = width,
+ .height = height,
+ .depth = 1,
+ .array_size = 1,
+ .last_level = 0,
+ .nr_samples = 0,
+ .flags = 0,
+ },
+ };
+ auto taskCompletedWaitable = EnqueueVirtioGpuTask(contextId, std::move(task));
+ resource->pendingWaitables.push_back(std::move(taskCompletedWaitable));
+
+ VirtioGpuTaskContextAttachResource attachTask{
+ .contextId = contextId,
+ .resourceId = resourceId,
+ };
+ EnqueueVirtioGpuTask(contextId, std::move(attachTask));
+
+ return resourceId;
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DestroyResource(uint32_t contextId,
+ uint32_t resourceId) {
+ DeleteResource(resourceId);
+
+ VirtioGpuTaskUnrefResource unrefTask{
+ .resourceId = resourceId,
+ };
+ EnqueueVirtioGpuTask(contextId, std::move(unrefTask));
+
+ VirtioGpuTaskContextDetachResource detachTask{
+ .contextId = contextId,
+ .resourceId = resourceId,
+ };
+ EnqueueVirtioGpuTask(contextId, std::move(detachTask));
+}
+
+int EmulatedVirtioGpu::EmulatedVirtioGpuImpl::ExecBuffer(uint32_t contextId,
+ struct VirtGpuExecBuffer& execbuffer,
+ std::optional<uint32_t> blobResourceId) {
+ std::optional<uint32_t> fence;
+
+ if (execbuffer.flags & kFenceOut) {
+ fence = CreateEmulatedFence();
+ }
+
+ const VirtioGpuTaskExecBuffer task = {
+ .contextId = contextId,
+ .commandBuffer = std::vector<std::byte>(
+ reinterpret_cast<std::byte*>(execbuffer.command),
+ reinterpret_cast<std::byte*>(execbuffer.command) + execbuffer.command_size),
+ };
+ auto taskCompletedWaitable = EnqueueVirtioGpuTask(contextId, std::move(task), fence);
+
+ if (blobResourceId) {
+ EmulatedResource* resource = GetResource(*blobResourceId);
+ if (resource == nullptr) {
+ ALOGE("Failed to ExecBuffer() with resource %" PRIu32 ": not found.", *blobResourceId);
+ return -1;
+ }
+
+ {
+ std::lock_guard<std::mutex> lock(resource->pendingWaitablesMutex);
+ resource->pendingWaitables.push_back(std::move(taskCompletedWaitable));
+ }
+ }
+
+ if (execbuffer.flags & kFenceOut) {
+ execbuffer.handle.osHandle = *fence;
+ execbuffer.handle.type = kFenceHandleSyncFd;
+ }
+
+ return 0;
+}
+
+int EmulatedVirtioGpu::EmulatedVirtioGpuImpl::WaitOnEmulatedFence(int fenceAsFileDescriptor,
+ int timeoutMilliseconds) {
+ uint32_t fenceId = static_cast<uint32_t>(fenceAsFileDescriptor);
+ ALOGV("Waiting on fence:%d", (int)fenceId);
+
+ std::shared_future<void> waitable;
+
+ {
+ std::lock_guard<std::mutex> lock(mVirtioGpuFencesMutex);
+
+ auto fenceIt = mVirtioGpuFences.find(fenceId);
+ if (fenceIt == mVirtioGpuFences.end()) {
+ ALOGE("Fence:%d already signaled", (int)fenceId);
+ return 0;
+ }
+ auto& fence = fenceIt->second;
+
+ waitable = fence.waitable;
+ }
+
+ auto status = waitable.wait_for(std::chrono::milliseconds(timeoutMilliseconds));
+ if (status == std::future_status::ready) {
+ ALOGV("Finished waiting for fence:%d", (int)fenceId);
+ return 0;
+ } else {
+ ALOGE("Timed out waiting for fence:%d", (int)fenceId);
+ return -1;
+ }
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::SignalEmulatedFence(uint32_t fenceId) {
+ ALOGV("Signaling fence:%d", (int)fenceId);
+
+ std::lock_guard<std::mutex> lock(mVirtioGpuFencesMutex);
+
+ auto fenceIt = mVirtioGpuFences.find(fenceId);
+ if (fenceIt == mVirtioGpuFences.end()) {
+ ALOGE("Failed to find fence %" PRIu32, fenceId);
+ return;
+ }
+ auto& fenceInfo = fenceIt->second;
+ fenceInfo.signaler.set_value();
+}
+
+uint32_t EmulatedVirtioGpu::EmulatedVirtioGpuImpl::CreateEmulatedFence() {
+ const uint32_t fenceId = mNextVirtioGpuFenceId++;
+
+ ALOGV("Creating fence:%d", (int)fenceId);
+
+ std::lock_guard<std::mutex> lock(mVirtioGpuFencesMutex);
+
+ auto [fenceIt, fenceCreated] = mVirtioGpuFences.emplace(fenceId, EmulatedFence{});
+ if (!fenceCreated) {
+ ALOGE("Attempting to recreate fence %" PRIu32, fenceId);
+ }
+
+ auto& fenceInfo = fenceIt->second;
+ fenceInfo.waitable = fenceInfo.signaler.get_future();
+
+ return fenceId;
+}
+
+std::shared_future<void> EmulatedVirtioGpu::EmulatedVirtioGpuImpl::EnqueueVirtioGpuTask(
+ uint32_t contextId, VirtioGpuTask task, std::optional<uint32_t> fence) {
+ std::promise<void> taskCompletedSignaler;
+ std::shared_future<void> taskCompletedWaitable(taskCompletedSignaler.get_future());
+
+ std::lock_guard<std::mutex> lock(mTasksMutex);
+ mTasks.push(VirtioGpuTaskWithWaitable{
+ .contextId = contextId,
+ .task = std::move(task),
+ .taskCompletedSignaler = std::move(taskCompletedSignaler),
+ .fence = fence,
+ });
+
+ return taskCompletedWaitable;
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskContextAttachResource task) {
+ ALOGV("Performing task to attach resource-id:%d to context-id:%d", task.resourceId,
+ task.contextId);
+
+ stream_renderer_ctx_attach_resource(task.contextId, task.resourceId);
+
+ ALOGV("Performing task to attach resource-id:%d to context-id:%d - done", task.resourceId,
+ task.contextId);
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskContextDetachResource task) {
+ ALOGV("Performing task to detach resource-id:%d to context-id:%d", task.resourceId,
+ task.contextId);
+
+ stream_renderer_ctx_detach_resource(task.contextId, task.resourceId);
+
+ ALOGV("Performing task to detach resource-id:%d to context-id:%d - done", task.resourceId,
+ task.contextId);
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskCreateBlob task) {
+ ALOGV("Performing task to create blob resource-id:%d", task.resourceId);
+
+ int ret = stream_renderer_create_blob(task.contextId, task.resourceId, &task.params,
+ /*iovecs=*/nullptr,
+ /*num_iovs=*/0,
+ /*handle=*/nullptr);
+ if (ret) {
+ ALOGE("Failed to create blob.");
+ }
+
+ ALOGV("Performing task to create blob resource-id:%d - done", task.resourceId);
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskCreateContext task) {
+ ALOGV("Performing task to create context-id:%" PRIu32 " context-init:%" PRIu32
+ " context-name:%s",
+ task.contextId, task.contextInit, task.contextName.c_str());
+
+ int ret = stream_renderer_context_create(task.contextId, task.contextName.size(),
+ task.contextName.data(), task.contextInit);
+ if (ret) {
+ ALOGE("Failed to create context-id:%" PRIu32 ".", task.contextId);
+ return;
+ }
+
+ ALOGV("Performing task to create context-id:%" PRIu32 " context-init:%" PRIu32
+ " context-name:%s - done",
+ task.contextId, task.contextInit, task.contextName.c_str());
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskCreateResource task) {
+ ALOGV("Performing task to create resource resource:%d", task.resourceId);
+
+ int ret = stream_renderer_resource_create(&task.params, nullptr, 0);
+ if (ret) {
+ ALOGE("Failed to create resource:%d", task.resourceId);
+ }
+
+ struct iovec iov = {
+ .iov_base = task.resourceBytes,
+ .iov_len = task.params.width,
+ };
+ ret = stream_renderer_resource_attach_iov(task.resourceId, &iov, 1);
+ if (ret) {
+ ALOGE("Failed to attach iov to resource:%d", task.resourceId);
+ }
+
+ ALOGV("Performing task to create resource resource:%d - done", task.resourceId);
+
+ stream_renderer_ctx_attach_resource(task.contextId, task.resourceId);
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskDestroyContext task) {
+ ALOGV("Performing task to destroy context-id:%" PRIu32, task.contextId);
+
+ stream_renderer_context_destroy(task.contextId);
+
+ ALOGV("Performing task to destroy context-id:%" PRIu32 " - done", task.contextId);
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskMap task) {
+ ALOGV("Performing task to map resource resource:%d", task.resourceId);
+
+ void* mapped = nullptr;
+
+ int ret = stream_renderer_resource_map(task.resourceId, &mapped, nullptr);
+ if (ret) {
+ ALOGE("Failed to map resource:%d", task.resourceId);
+ return;
+ }
+
+ task.resourceMappedPromise.set_value(reinterpret_cast<uint8_t*>(mapped));
+ ALOGV("Performing task to map resource resource:%d - done", task.resourceId);
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskExecBuffer task) {
+ ALOGV("Performing task to execbuffer");
+
+ if (task.commandBuffer.size() % 4 != 0) {
+ ALOGE("Unaligned command buffer?");
+ return;
+ }
+
+ stream_renderer_command cmd = {
+ .ctx_id = task.contextId,
+ .cmd_size = static_cast<uint32_t>(task.commandBuffer.size()),
+ .cmd = reinterpret_cast<uint8_t*>(task.commandBuffer.data()),
+ .num_in_fences = 0,
+ .fences = nullptr,
+ };
+
+ int ret = stream_renderer_submit_cmd(&cmd);
+ if (ret) {
+ ALOGE("Failed to execbuffer.");
+ }
+
+ ALOGV("Performing task to execbuffer - done");
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskTransferFromHost task) {
+ struct stream_renderer_box transferBox = {
+ .x = task.transferOffset,
+ .y = 0,
+ .z = 0,
+ .w = task.transferSize,
+ .h = 1,
+ .d = 1,
+ };
+
+ int ret = stream_renderer_transfer_read_iov(task.resourceId, task.contextId,
+ /*level=*/0,
+ /*stride=*/0,
+ /*layer_stride=*/0, &transferBox,
+ /*offset=*/0,
+ /*iov=*/nullptr,
+ /*iovec_cnt=*/0);
+ if (ret) {
+ ALOGE("Failed to transferFromHost() for resource:%" PRIu32, task.resourceId);
+ }
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskTransferToHost task) {
+ struct stream_renderer_box transferBox = {
+ .x = task.transferOffset,
+ .y = 0,
+ .z = 0,
+ .w = task.transferSize,
+ .h = 1,
+ .d = 1,
+ };
+
+ int ret = stream_renderer_transfer_write_iov(task.resourceId, task.contextId,
+ /*level=*/0,
+ /*stride=*/0,
+ /*layer_stride=*/0, &transferBox,
+ /*offset=*/0,
+ /*iov=*/nullptr,
+ /*iovec_cnt=*/0);
+ if (ret) {
+ ALOGE("Failed to transferToHost() for resource:%" PRIu32, task.resourceId);
+ }
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskUnrefResource task) {
+ stream_renderer_resource_unref(task.resourceId);
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::DoTask(VirtioGpuTaskWithWaitable task) {
+ std::visit(
+ [this](auto&& work) {
+ using T = std::decay_t<decltype(work)>;
+ if constexpr (std::is_same_v<T, VirtioGpuTaskContextAttachResource>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskContextDetachResource>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskCreateBlob>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskCreateContext>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskCreateResource>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskDestroyContext>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskMap>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskExecBuffer>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskTransferFromHost>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskTransferToHost>) {
+ DoTask(std::move(work));
+ } else if constexpr (std::is_same_v<T, VirtioGpuTaskUnrefResource>) {
+ DoTask(std::move(work));
+ }
+ },
+ task.task);
+
+ if (task.fence) {
+ const stream_renderer_fence fenceInfo = {
+ .flags = STREAM_RENDERER_FLAG_FENCE_RING_IDX,
+ .fence_id = *task.fence,
+ .ctx_id = task.contextId,
+ .ring_idx = 0,
+ };
+ int ret = stream_renderer_create_fence(&fenceInfo);
+ if (ret) {
+ ALOGE("Failed to create fence.");
+ }
+ }
+
+ task.taskCompletedSignaler.set_value();
+}
+
+void EmulatedVirtioGpu::EmulatedVirtioGpuImpl::RunVirtioGpuTaskProcessingLoop() {
+ while (!mShuttingDown.load()) {
+ std::optional<VirtioGpuTaskWithWaitable> task;
+
+ {
+ std::lock_guard<std::mutex> lock(mTasksMutex);
+ if (!mTasks.empty()) {
+ task = std::move(mTasks.front());
+ mTasks.pop();
+ }
+ }
+
+ if (task) {
+ DoTask(std::move(*task));
+ }
+ }
+}
+
+namespace {
+
+EmulatedVirtioGpu* sInstance = nullptr;
+
+} // namespace
+
+EmulatedVirtioGpu::EmulatedVirtioGpu()
+ : mImpl{std::make_unique<EmulatedVirtioGpu::EmulatedVirtioGpuImpl>()} {}
+
+/*static*/
+EmulatedVirtioGpu& EmulatedVirtioGpu::Get() {
+ if (sInstance == nullptr) {
+ sInstance = new EmulatedVirtioGpu();
+
+ bool withGl = false;
+ bool withVk = true;
+ bool withVkSnapshots = false;
+
+ struct Option {
+ std::string env;
+ bool* val;
+ };
+ const std::vector<Option> options = {
+ {"GFXSTREAM_EMULATED_VIRTIO_GPU_WITH_GL", &withGl},
+ {"GFXSTREAM_EMULATED_VIRTIO_GPU_WITH_VK", &withVk},
+ {"GFXSTREAM_EMULATED_VIRTIO_GPU_WITH_VK_SNAPSHOTS", &withVkSnapshots},
+ };
+ for (const Option option : options) {
+ const char* val = std::getenv(option.env.c_str());
+ if (val != nullptr && (val[0] == 'Y' || val[0] == 'y')) {
+ *option.val = true;
+ }
+ }
+
+ ALOGE("Initializing withGl:%d withVk:%d withVkSnapshots:%d", withGl, withVk,
+ withVkSnapshots);
+ if (!sInstance->Init(withGl, withVk, withVkSnapshots)) {
+ ALOGE("Failed to initialize EmulatedVirtioGpu.");
+ }
+ }
+ return *sInstance;
+}
+
+/*static*/
+void EmulatedVirtioGpu::Reset() {
+ if (sInstance != nullptr) {
+ delete sInstance;
+ sInstance = nullptr;
+ }
+}
+
+bool EmulatedVirtioGpu::Init(bool withGl, bool withVk, bool withVkSnapshots) {
+ return mImpl->Init(withGl, withVk, withVkSnapshots, this);
+}
+
+std::optional<uint32_t> EmulatedVirtioGpu::CreateContext() { return mImpl->CreateContext(); }
+
+void EmulatedVirtioGpu::DestroyContext(uint32_t contextId) { mImpl->DestroyContext(contextId); }
+
+VirtGpuCaps EmulatedVirtioGpu::GetCaps(VirtGpuCapset capset) { return mImpl->GetCaps(capset); }
+
+uint8_t* EmulatedVirtioGpu::Map(uint32_t resourceId) { return mImpl->Map(resourceId); }
+
+void EmulatedVirtioGpu::Unmap(uint32_t resourceId) { mImpl->Unmap(resourceId); }
+
+int EmulatedVirtioGpu::ExecBuffer(uint32_t contextId, struct VirtGpuExecBuffer& execbuffer,
+ std::optional<uint32_t> blobResourceId) {
+ return mImpl->ExecBuffer(contextId, execbuffer, blobResourceId);
+}
+
+int EmulatedVirtioGpu::Wait(uint32_t resourceId) { return mImpl->Wait(resourceId); }
+
+int EmulatedVirtioGpu::TransferFromHost(uint32_t contextId, uint32_t resourceId, uint32_t offset,
+ uint32_t size) {
+ return mImpl->TransferFromHost(contextId, resourceId, offset, size);
+}
+
+int EmulatedVirtioGpu::TransferToHost(uint32_t contextId, uint32_t resourceId, uint32_t offset,
+ uint32_t size) {
+ return mImpl->TransferToHost(contextId, resourceId, offset, size);
+}
+
+std::optional<uint32_t> EmulatedVirtioGpu::CreateBlob(uint32_t contextId,
+ const struct VirtGpuCreateBlob& params) {
+ return mImpl->CreateBlob(contextId, params);
+}
+
+std::optional<uint32_t> EmulatedVirtioGpu::CreateVirglBlob(uint32_t contextId, uint32_t width,
+ uint32_t height, uint32_t virglFormat) {
+ return mImpl->CreateVirglBlob(contextId, width, height, virglFormat);
+}
+
+void EmulatedVirtioGpu::DestroyResource(uint32_t contextId, uint32_t resourceId) {
+ mImpl->DestroyResource(contextId, resourceId);
+}
+
+int EmulatedVirtioGpu::WaitOnEmulatedFence(int fenceAsFileDescriptor, int timeoutMilliseconds) {
+ return mImpl->WaitOnEmulatedFence(fenceAsFileDescriptor, timeoutMilliseconds);
+}
+
+void EmulatedVirtioGpu::SignalEmulatedFence(int fenceId) { mImpl->SignalEmulatedFence(fenceId); }
+
+void ResetEmulatedVirtioGpu() { EmulatedVirtioGpu::Reset(); }
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/rutabaga/RutabagaLayer.h b/src/gfxstream/guest/platform/rutabaga/RutabagaLayer.h
new file mode 100644
index 00000000000..057b2f7575e
--- /dev/null
+++ b/src/gfxstream/guest/platform/rutabaga/RutabagaLayer.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright 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 <memory>
+#include <optional>
+
+#include "VirtGpu.h"
+
+namespace gfxstream {
+
+// Emulates parts of the Linux Virtio GPU kernel module and parts of
+// a virtual machine manager to allow speaking directly to the Gfxstream
+// host server via rutabaga.
+class EmulatedVirtioGpu {
+ public:
+ static EmulatedVirtioGpu& Get();
+ static void Reset();
+
+ bool Init(bool withGl, bool withVk, bool withVkSnapshots);
+
+ VirtGpuCaps GetCaps(VirtGpuCapset capset);
+
+ std::optional<uint32_t> CreateContext();
+ void DestroyContext(uint32_t contextId);
+
+ std::optional<uint32_t> CreateBlob(uint32_t contextId,
+ const struct VirtGpuCreateBlob& params);
+ std::optional<uint32_t> CreateVirglBlob(uint32_t contextId,
+ uint32_t width,
+ uint32_t height,
+ uint32_t virglFormat);
+
+ void DestroyResource(uint32_t contextId,
+ uint32_t resourceId);
+
+ uint8_t* Map(uint32_t resourceId);
+ void Unmap(uint32_t resourceId);
+
+ int ExecBuffer(uint32_t contextId,
+ struct VirtGpuExecBuffer& execbuffer,
+ std::optional<uint32_t> blobResourceId);
+
+ int Wait(uint32_t resourceId);
+
+ int TransferFromHost(uint32_t contextId,
+ uint32_t resourceId,
+ uint32_t transferOffset,
+ uint32_t transferSize);
+ int TransferToHost(uint32_t contextId,
+ uint32_t resourceId,
+ uint32_t transferOffset,
+ uint32_t transferSize);
+
+ void SignalEmulatedFence(int fenceId);
+
+ int WaitOnEmulatedFence(int fenceAsFileDescriptor, int timeoutMilliseconds);
+
+ private:
+ EmulatedVirtioGpu();
+
+ class EmulatedVirtioGpuImpl;
+ std::unique_ptr<EmulatedVirtioGpuImpl> mImpl;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpu.h b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpu.h
new file mode 100644
index 00000000000..8cf07f5f17b
--- /dev/null
+++ b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpu.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright 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 <memory>
+
+#include "VirtGpu.h"
+
+namespace gfxstream {
+
+// Virtio GPU abstraction that directly runs a host render server.
+
+class RutabagaVirtGpuDevice;
+
+class RutabagaVirtGpuBlobMapping : public VirtGpuBlobMapping {
+ public:
+ RutabagaVirtGpuBlobMapping(VirtGpuBlobPtr blob, uint8_t* mapped);
+ ~RutabagaVirtGpuBlobMapping();
+
+ uint8_t* asRawPtr(void) override;
+
+ private:
+ VirtGpuBlobPtr mBlob;
+ uint8_t* mMapped = nullptr;
+};
+
+class RutabagaVirtGpuResource : public std::enable_shared_from_this<RutabagaVirtGpuResource>, public VirtGpuBlob {
+ public:
+ ~RutabagaVirtGpuResource();
+
+ VirtGpuBlobMappingPtr createMapping(void) override;
+
+ uint32_t getResourceHandle() const override;
+ uint32_t getBlobHandle() const override;
+
+ int exportBlob(VirtGpuExternalHandle& handle) override;
+ int wait() override;
+
+ int transferFromHost(uint32_t offset, uint32_t size) override;
+ int transferToHost(uint32_t offset, uint32_t size) override;
+
+ private:
+ friend class RutabagaVirtGpuDevice;
+
+ enum class ResourceType {
+ kBlob,
+ kPipe,
+ };
+
+ RutabagaVirtGpuResource(uint32_t resourceId,
+ ResourceType resourceType,
+ uint32_t contextId);
+
+
+ const uint32_t mContextId;
+ const uint32_t mResourceId;
+ const ResourceType mResourceType;
+};
+
+class RutabagaVirtGpuDevice : public std::enable_shared_from_this<RutabagaVirtGpuDevice>, public VirtGpuDevice {
+ public:
+ RutabagaVirtGpuDevice(uint32_t contextId, VirtGpuCapset capset);
+ ~RutabagaVirtGpuDevice();
+
+ int64_t getDeviceHandle() override;
+
+ VirtGpuCaps getCaps() override;
+
+ VirtGpuBlobPtr createBlob(const struct VirtGpuCreateBlob& blobCreate) override;
+
+ VirtGpuBlobPtr createVirglBlob(uint32_t width, uint32_t height, uint32_t virglFormat) override;
+
+ VirtGpuBlobPtr importBlob(const struct VirtGpuExternalHandle& handle) override;
+
+ int execBuffer(struct VirtGpuExecBuffer& execbuffer, const VirtGpuBlob* blob) override;
+
+ private:
+ const uint32_t mContextId;
+ const VirtGpuCapset mCapset;
+
+ friend class RutabagaVirtGpuResource;
+ uint32_t GetContextId() const { return mContextId; }
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuBlob.cpp b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuBlob.cpp
new file mode 100644
index 00000000000..0b7db44d883
--- /dev/null
+++ b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuBlob.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright 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 <log/log.h>
+
+#include "RutabagaLayer.h"
+#include "RutabagaVirtGpu.h"
+
+namespace gfxstream {
+
+RutabagaVirtGpuResource::RutabagaVirtGpuResource(uint32_t resourceId, ResourceType resourceType,
+ uint32_t contextId)
+ : mContextId(contextId), mResourceId(resourceId), mResourceType(resourceType) {}
+
+RutabagaVirtGpuResource::~RutabagaVirtGpuResource() {
+ EmulatedVirtioGpu::Get().DestroyResource(mContextId, mResourceId);
+}
+
+VirtGpuBlobMappingPtr RutabagaVirtGpuResource::createMapping(void) {
+ uint8_t* mapped = EmulatedVirtioGpu::Get().Map(mResourceId);
+ return std::make_shared<RutabagaVirtGpuBlobMapping>(shared_from_this(), mapped);
+}
+
+uint32_t RutabagaVirtGpuResource::getResourceHandle() const { return mResourceId; }
+
+uint32_t RutabagaVirtGpuResource::getBlobHandle() const {
+ if (mResourceType != ResourceType::kBlob) {
+ ALOGE("Attempting to get blob handle for non-blob resource");
+ return -1;
+ }
+
+ ALOGE("Unimplemented: %s", __FUNCTION__);
+ return -1;
+}
+
+int RutabagaVirtGpuResource::exportBlob(VirtGpuExternalHandle&) {
+ if (mResourceType != ResourceType::kBlob) {
+ ALOGE("Attempting to export blob for non-blob resource");
+ return -1;
+ }
+
+ ALOGE("Unimplemented: %s", __FUNCTION__);
+ return -1;
+}
+
+int RutabagaVirtGpuResource::wait() { return EmulatedVirtioGpu::Get().Wait(mResourceId); }
+
+int RutabagaVirtGpuResource::transferFromHost(uint32_t offset, uint32_t size) {
+ if (mResourceType != ResourceType::kPipe) {
+ ALOGE("Unexpected transferFromHost() called on non-pipe resource.");
+ return -1;
+ }
+
+ return EmulatedVirtioGpu::Get().TransferFromHost(mContextId, mResourceId, offset, size);
+}
+
+int RutabagaVirtGpuResource::transferToHost(uint32_t offset, uint32_t size) {
+ if (mResourceType != ResourceType::kPipe) {
+ ALOGE("Unexpected transferToHost() called on non-pipe resource.");
+ return -1;
+ }
+
+ return EmulatedVirtioGpu::Get().TransferToHost(mContextId, mResourceId, offset, size);
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuBlobMapping.cpp b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuBlobMapping.cpp
new file mode 100644
index 00000000000..4f82f7c4932
--- /dev/null
+++ b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuBlobMapping.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright 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 "RutabagaLayer.h"
+#include "RutabagaVirtGpu.h"
+
+namespace gfxstream {
+
+RutabagaVirtGpuBlobMapping::RutabagaVirtGpuBlobMapping(VirtGpuBlobPtr blob, uint8_t* mapped)
+ : mBlob(blob), mMapped(mapped) {}
+
+RutabagaVirtGpuBlobMapping::~RutabagaVirtGpuBlobMapping(void) {
+ EmulatedVirtioGpu::Get().Unmap(mBlob->getResourceHandle());
+}
+
+uint8_t* RutabagaVirtGpuBlobMapping::asRawPtr(void) { return mMapped; }
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuDevice.cpp b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuDevice.cpp
new file mode 100644
index 00000000000..999ac2ff58b
--- /dev/null
+++ b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuDevice.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright 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 <log/log.h>
+
+#include "RutabagaLayer.h"
+#include "RutabagaVirtGpu.h"
+
+namespace gfxstream {
+
+RutabagaVirtGpuDevice::RutabagaVirtGpuDevice(uint32_t contextId, VirtGpuCapset capset)
+ : VirtGpuDevice(capset), mContextId(contextId), mCapset(capset) {}
+
+RutabagaVirtGpuDevice::~RutabagaVirtGpuDevice() {
+ EmulatedVirtioGpu::Get().DestroyContext(mContextId);
+ EmulatedVirtioGpu::Reset();
+}
+
+int64_t RutabagaVirtGpuDevice::getDeviceHandle() { return -1; }
+
+VirtGpuCaps RutabagaVirtGpuDevice::getCaps() { return EmulatedVirtioGpu::Get().GetCaps(mCapset); }
+
+VirtGpuBlobPtr RutabagaVirtGpuDevice::createBlob(const struct VirtGpuCreateBlob& blobCreate) {
+ const auto resourceIdOpt = EmulatedVirtioGpu::Get().CreateBlob(mContextId, blobCreate);
+ if (!resourceIdOpt) {
+ return nullptr;
+ }
+
+ return VirtGpuBlobPtr(new RutabagaVirtGpuResource(
+ *resourceIdOpt, RutabagaVirtGpuResource::ResourceType::kBlob, mContextId));
+}
+
+VirtGpuBlobPtr RutabagaVirtGpuDevice::createVirglBlob(uint32_t width, uint32_t height,
+ uint32_t virglFormat) {
+ const auto resourceIdOpt =
+ EmulatedVirtioGpu::Get().CreateVirglBlob(mContextId, width, height, virglFormat);
+ if (!resourceIdOpt) {
+ return nullptr;
+ }
+
+ return VirtGpuBlobPtr(new RutabagaVirtGpuResource(
+ *resourceIdOpt, RutabagaVirtGpuResource::ResourceType::kPipe, mContextId));
+}
+
+int RutabagaVirtGpuDevice::execBuffer(struct VirtGpuExecBuffer& execbuffer,
+ const VirtGpuBlob* blob) {
+ std::optional<uint32_t> blobResourceId;
+ if (blob) {
+ blobResourceId = blob->getResourceHandle();
+ }
+ return EmulatedVirtioGpu::Get().ExecBuffer(mContextId, execbuffer, blobResourceId);
+}
+
+VirtGpuBlobPtr RutabagaVirtGpuDevice::importBlob(const struct VirtGpuExternalHandle&) {
+ ALOGE("Unimplemented %s", __FUNCTION__);
+ return nullptr;
+}
+
+} // namespace gfxstream
+
+VirtGpuDevice* createPlatformVirtGpuDevice(enum VirtGpuCapset capset, int) {
+ const auto contextIdOp = gfxstream::EmulatedVirtioGpu::Get().CreateContext();
+ if (!contextIdOp) {
+ ALOGE("Failed to create RutabagaVirtGpuDevice: failed to create context.");
+ return nullptr;
+ }
+ return new gfxstream::RutabagaVirtGpuDevice(*contextIdOp, capset);
+}
diff --git a/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuSyncHelper.cpp b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuSyncHelper.cpp
new file mode 100644
index 00000000000..30b5f3d1863
--- /dev/null
+++ b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuSyncHelper.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright 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 "RutabagaVirtGpuSyncHelper.h"
+
+#include "RutabagaLayer.h"
+
+namespace gfxstream {
+
+RutabagaVirtGpuSyncHelper::RutabagaVirtGpuSyncHelper() {}
+
+int RutabagaVirtGpuSyncHelper::wait(int syncFd, int timeoutMilliseconds) {
+ return EmulatedVirtioGpu::Get().WaitOnEmulatedFence(syncFd, timeoutMilliseconds);
+}
+
+int RutabagaVirtGpuSyncHelper::dup(int syncFd) {
+ // TODO update reference count
+ return syncFd;
+}
+
+int RutabagaVirtGpuSyncHelper::close(int) { return 0; }
+
+SyncHelper* createPlatformSyncHelper() { return new RutabagaVirtGpuSyncHelper(); }
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuSyncHelper.h b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuSyncHelper.h
new file mode 100644
index 00000000000..c163eb399e9
--- /dev/null
+++ b/src/gfxstream/guest/platform/rutabaga/RutabagaVirtGpuSyncHelper.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 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 "Sync.h"
+
+namespace gfxstream {
+
+class RutabagaVirtGpuSyncHelper : public SyncHelper {
+ public:
+ RutabagaVirtGpuSyncHelper();
+
+ int wait(int syncFd, int timeoutMilliseconds) override;
+
+ int dup(int syncFd) override;
+
+ int close(int) override;
+};
+
+SyncHelper* createPlatformSyncHelper();
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/rutabaga/include/gfxstream/RutabagaLayerTestUtils.h b/src/gfxstream/guest/platform/rutabaga/include/gfxstream/RutabagaLayerTestUtils.h
new file mode 100644
index 00000000000..4817a9c2b41
--- /dev/null
+++ b/src/gfxstream/guest/platform/rutabaga/include/gfxstream/RutabagaLayerTestUtils.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright 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
+
+namespace gfxstream {
+
+void ResetEmulatedVirtioGpu();
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/stub/StubSync.cpp b/src/gfxstream/guest/platform/stub/StubSync.cpp
new file mode 100644
index 00000000000..96ca11abe39
--- /dev/null
+++ b/src/gfxstream/guest/platform/stub/StubSync.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright 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 "StubSync.h"
+
+namespace gfxstream {
+
+StubSyncHelper::StubSyncHelper() {}
+
+int StubSyncHelper::wait(int, int) {
+ return -1;
+}
+
+int StubSyncHelper::dup(int) {
+ return -1;
+}
+
+int StubSyncHelper::close(int) {
+ return -1;
+}
+
+SyncHelper* createPlatformSyncHelper() {
+ return new StubSyncHelper();
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/stub/StubSync.h b/src/gfxstream/guest/platform/stub/StubSync.h
new file mode 100644
index 00000000000..b081ac53aea
--- /dev/null
+++ b/src/gfxstream/guest/platform/stub/StubSync.h
@@ -0,0 +1,32 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include "Sync.h"
+
+namespace gfxstream {
+
+class StubSyncHelper : public SyncHelper {
+ public:
+ StubSyncHelper();
+
+ int wait(int syncFd, int timeoutMilliseconds) override;
+
+ int dup(int syncFd) override;
+
+ int close(int syncFd) override;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/platform/stub/StubVirtGpu.h b/src/gfxstream/guest/platform/stub/StubVirtGpu.h
new file mode 100644
index 00000000000..7466cb584ac
--- /dev/null
+++ b/src/gfxstream/guest/platform/stub/StubVirtGpu.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright 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 "VirtGpu.h"
+
+class StubVirtGpuBlob : public std::enable_shared_from_this<StubVirtGpuBlob>, public VirtGpuBlob {
+ public:
+ StubVirtGpuBlob(int64_t deviceHandle, uint32_t blobHandle, uint32_t resourceHandle, uint64_t size);
+ ~StubVirtGpuBlob();
+
+ uint32_t getResourceHandle() const override;
+ uint32_t getBlobHandle() const override;
+ int wait(void) override;
+
+ VirtGpuBlobMappingPtr createMapping(void) override;
+ int exportBlob(struct VirtGpuExternalHandle& handle) override;
+
+ int transferFromHost(uint32_t offset, uint32_t size) override;
+ int transferToHost(uint32_t offset, uint32_t size) override;
+
+ private:
+ // Not owned. Really should use a ScopedFD for this, but doesn't matter since we have a
+ // singleton deviceimplemenentation anyways.
+ int64_t mDeviceHandle;
+
+ uint32_t mBlobHandle;
+ uint32_t mResourceHandle;
+ uint64_t mSize;
+};
+
+class StubVirtGpuBlobMapping : public VirtGpuBlobMapping {
+ public:
+ StubVirtGpuBlobMapping(VirtGpuBlobPtr blob, uint8_t* ptr, uint64_t size);
+ ~StubVirtGpuBlobMapping(void);
+
+ uint8_t* asRawPtr(void) override;
+
+ private:
+ VirtGpuBlobPtr mBlob;
+ uint8_t* mPtr;
+ uint64_t mSize;
+};
+
+class StubVirtGpuDevice : public VirtGpuDevice {
+ public:
+ StubVirtGpuDevice(enum VirtGpuCapset capset);
+ virtual ~StubVirtGpuDevice();
+
+ int64_t getDeviceHandle(void) override;
+
+ struct VirtGpuCaps getCaps(void) override;
+
+ VirtGpuBlobPtr createBlob(const struct VirtGpuCreateBlob& blobCreate) override;
+ VirtGpuBlobPtr createVirglBlob(uint32_t width, uint32_t height, uint32_t virglFormat);
+ VirtGpuBlobPtr importBlob(const struct VirtGpuExternalHandle& handle) override;
+
+ int execBuffer(struct VirtGpuExecBuffer& execbuffer, const VirtGpuBlob* blob) override;
+
+ virtual VirtGpuBlobPtr createColorBuffer(int width, int height, uint32_t glFormat);
+ virtual VirtGpuBlobPtr createColorBuffer(int size);
+
+ private:
+ int64_t mDeviceHandle;
+
+ struct VirtGpuCaps mCaps;
+};
diff --git a/src/gfxstream/guest/platform/stub/StubVirtGpuBlob.cpp b/src/gfxstream/guest/platform/stub/StubVirtGpuBlob.cpp
new file mode 100644
index 00000000000..4e8c23cd312
--- /dev/null
+++ b/src/gfxstream/guest/platform/stub/StubVirtGpuBlob.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 "StubVirtGpu.h"
+
+StubVirtGpuBlob::StubVirtGpuBlob(int64_t deviceHandle, uint32_t blobHandle, uint32_t resourceHandle,
+ uint64_t size)
+ : mDeviceHandle(deviceHandle),
+ mBlobHandle(blobHandle),
+ mResourceHandle(resourceHandle),
+ mSize(size) {}
+
+StubVirtGpuBlob::~StubVirtGpuBlob() {
+ // Unimplemented stub
+}
+
+uint32_t StubVirtGpuBlob::getBlobHandle() const { return 0; }
+
+uint32_t StubVirtGpuBlob::getResourceHandle() const { return 0; }
+
+VirtGpuBlobMappingPtr StubVirtGpuBlob::createMapping() { return nullptr; }
+
+int StubVirtGpuBlob::wait() {
+ return -1;
+}
+
+int StubVirtGpuBlob::transferFromHost(uint32_t, uint32_t) {
+ return -1;
+}
+
+int StubVirtGpuBlob::transferToHost(uint32_t, uint32_t) {
+ return -1;
+}
diff --git a/src/gfxstream/guest/platform/stub/StubVirtGpuBlobMapping.cpp b/src/gfxstream/guest/platform/stub/StubVirtGpuBlobMapping.cpp
new file mode 100644
index 00000000000..f7e845b161f
--- /dev/null
+++ b/src/gfxstream/guest/platform/stub/StubVirtGpuBlobMapping.cpp
@@ -0,0 +1,31 @@
+/*
+ * 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 "StubVirtGpu.h"
+
+StubVirtGpuBlobMapping::StubVirtGpuBlobMapping(VirtGpuBlobPtr blob, uint8_t* ptr, uint64_t size)
+ : mBlob(blob), mPtr(ptr), mSize(size) {}
+
+StubVirtGpuBlobMapping::~StubVirtGpuBlobMapping(void) {
+ // Unimplemented for now
+ (void) mPtr;
+ (void) mSize;
+ (void) mBlob;
+}
+
+uint8_t* StubVirtGpuBlobMapping::asRawPtr(void) {
+ return nullptr;
+}
diff --git a/src/gfxstream/guest/platform/stub/StubVirtGpuDevice.cpp b/src/gfxstream/guest/platform/stub/StubVirtGpuDevice.cpp
new file mode 100644
index 00000000000..7908c85625b
--- /dev/null
+++ b/src/gfxstream/guest/platform/stub/StubVirtGpuDevice.cpp
@@ -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.
+ */
+
+#include "StubVirtGpu.h"
+
+StubVirtGpuDevice::StubVirtGpuDevice(enum VirtGpuCapset capset) : VirtGpuDevice(capset) {
+ // Unimplemented stub
+}
+
+struct VirtGpuCaps StubVirtGpuDevice::getCaps(void) { return mCaps; }
+
+int64_t StubVirtGpuDevice::getDeviceHandle(void) {
+ return mDeviceHandle;
+}
+
+VirtGpuBlobPtr StubVirtGpuDevice::createVirglBlob(uint32_t width, uint32_t height, uint32_t virglFormat) {
+ (void)width;
+ (void)height;
+ (void)virglFormat;
+ return nullptr;
+}
+
+VirtGpuBlobPtr StubVirtGpuDevice::createBlob(const struct VirtGpuCreateBlob&) {
+ return nullptr;
+}
+
+VirtGpuBlobPtr StubVirtGpuDevice::importBlob(const struct VirtGpuExternalHandle&) {
+ return nullptr;
+}
+
+int StubVirtGpuDevice::execBuffer(struct VirtGpuExecBuffer&, const VirtGpuBlob*) { return -1; }
+
+VirtGpuBlobPtr createColorBuffer(int, int, uint32_t) {
+ return nullptr;
+}
+
+VirtGpuBlobPtr createColorBuffer(int) {
+ return nullptr;
+}
+
+StubVirtGpuDevice::~StubVirtGpuDevice() {
+ // Unimplemented stub
+}
+
+VirtGpuDevice* createPlatformVirtGpuDevice(enum VirtGpuCapset capset, int) {
+ return new StubVirtGpuDevice(capset);
+}
diff --git a/src/gfxstream/guest/platform/stub/meson.build b/src/gfxstream/guest/platform/stub/meson.build
new file mode 100644
index 00000000000..1db61a6b582
--- /dev/null
+++ b/src/gfxstream/guest/platform/stub/meson.build
@@ -0,0 +1,18 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_platform = files(
+ '../VirtGpu.cpp',
+ 'StubVirtGpuDevice.cpp',
+ 'StubVirtGpuBlobMapping.cpp',
+ 'StubVirtGpuBlob.cpp',
+ 'StubSync.cpp',
+)
+
+lib_platform_stub = static_library(
+ 'stub_platform',
+ files_lib_platform,
+ cpp_args: gfxstream_guest_args,
+ include_directories: [inc_platform, inc_android_compat],
+ dependencies: drm_dep,
+)
diff --git a/src/gfxstream/guest/qemupipe/include-types/qemu_pipe_types_bp.h b/src/gfxstream/guest/qemupipe/include-types/qemu_pipe_types_bp.h
new file mode 100644
index 00000000000..4bd5b7c6223
--- /dev/null
+++ b/src/gfxstream/guest/qemupipe/include-types/qemu_pipe_types_bp.h
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+#pragma once
+#include <stddef.h>
+#include <stdbool.h>
+
+typedef int QEMU_PIPE_HANDLE;
+#define QEMU_PIPE_INVALID_HANDLE (-1)
+
+inline bool qemu_pipe_valid(QEMU_PIPE_HANDLE h) {
+ return h > QEMU_PIPE_INVALID_HANDLE;
+}
diff --git a/src/gfxstream/guest/qemupipe/include/qemu_pipe_bp.h b/src/gfxstream/guest/qemupipe/include/qemu_pipe_bp.h
new file mode 100644
index 00000000000..4338ee50bd4
--- /dev/null
+++ b/src/gfxstream/guest/qemupipe/include/qemu_pipe_bp.h
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+#pragma once
+#include <qemu_pipe_types_bp.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+QEMU_PIPE_HANDLE qemu_pipe_open_ns(const char* ns, const char* pipeName, int flags);
+QEMU_PIPE_HANDLE qemu_pipe_open(const char* pipeName);
+void qemu_pipe_close(QEMU_PIPE_HANDLE pipe);
+
+int qemu_pipe_read_fully(QEMU_PIPE_HANDLE pipe, void* buffer, int size);
+int qemu_pipe_write_fully(QEMU_PIPE_HANDLE pipe, const void* buffer, int size);
+int qemu_pipe_read(QEMU_PIPE_HANDLE pipe, void* buffer, int size);
+int qemu_pipe_write(QEMU_PIPE_HANDLE pipe, const void* buffer, int size);
+
+int qemu_pipe_try_again(int ret);
+void qemu_pipe_print_error(QEMU_PIPE_HANDLE pipe);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#define QEMU_PIPE_RETRY(exp) ({ \
+ __typeof__(exp) _rc; \
+ do { \
+ _rc = (exp); \
+ } while (qemu_pipe_try_again(_rc)); \
+ _rc; })
diff --git a/src/gfxstream/guest/qemupipe/meson.build b/src/gfxstream/guest/qemupipe/meson.build
new file mode 100644
index 00000000000..cf5952f018f
--- /dev/null
+++ b/src/gfxstream/guest/qemupipe/meson.build
@@ -0,0 +1,17 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_qemu_pipe = include_directories('include')
+inc_qemu_pipe_types = include_directories('include-types')
+
+files_qemu_pipe = files(
+ 'qemu_pipe_common.cpp',
+ 'qemu_pipe_guest.cpp',
+)
+
+lib_qemu_pipe = static_library(
+ 'qemu_pipe',
+ files_qemu_pipe,
+ cpp_args: gfxstream_guest_args,
+ include_directories: [inc_android_compat, inc_qemu_pipe, inc_qemu_pipe_types]
+)
diff --git a/src/gfxstream/guest/qemupipe/qemu_pipe_common.cpp b/src/gfxstream/guest/qemupipe/qemu_pipe_common.cpp
new file mode 100644
index 00000000000..859bd3fe56b
--- /dev/null
+++ b/src/gfxstream/guest/qemupipe/qemu_pipe_common.cpp
@@ -0,0 +1,43 @@
+// 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 <qemu_pipe_bp.h>
+
+int qemu_pipe_read_fully(QEMU_PIPE_HANDLE pipe, void* buffer, int size) {
+ char* p = (char*)buffer;
+
+ while (size > 0) {
+ int n = QEMU_PIPE_RETRY(qemu_pipe_read(pipe, p, size));
+ if (n < 0) return n;
+
+ p += n;
+ size -= n;
+ }
+
+ return 0;
+}
+
+int qemu_pipe_write_fully(QEMU_PIPE_HANDLE pipe, const void* buffer, int size) {
+ const char* p = (const char*)buffer;
+
+ while (size > 0) {
+ int n = QEMU_PIPE_RETRY(qemu_pipe_write(pipe, p, size));
+ if (n < 0) return n;
+
+ p += n;
+ size -= n;
+ }
+
+ return 0;
+}
diff --git a/src/gfxstream/guest/qemupipe/qemu_pipe_guest.cpp b/src/gfxstream/guest/qemupipe/qemu_pipe_guest.cpp
new file mode 100644
index 00000000000..af5c510601e
--- /dev/null
+++ b/src/gfxstream/guest/qemupipe/qemu_pipe_guest.cpp
@@ -0,0 +1,217 @@
+/*
+ * 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 <atomic>
+#include <errno.h>
+#include <log/log.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <linux/vm_sockets.h>
+#include <qemu_pipe_bp.h>
+
+namespace {
+enum class VsockPort {
+ Data = 5000,
+ Ping = 5001,
+};
+
+std::atomic<bool> gVsockAvailable{false};
+
+bool is_graphics_pipe(const char* name) {
+ if (!strcmp(name, "opengles")) { return true; }
+ if (!strcmp(name, "GLProcessPipe")) { return true; }
+ if (!strcmp(name, "refcount")) { return true; }
+
+ return false;
+}
+
+// Make sure that `e` is not zero. Assumes `def` is not zero.
+int checkErr(const int e, const int def) {
+ return e ? e : def;
+}
+
+int open_verbose_path(const char* name, const int flags) {
+ const int fd = QEMU_PIPE_RETRY(open(name, flags));
+ if (fd < 0) {
+ const int e = errno;
+ ALOGE("%s:%d: Could not open '%s': %s",
+ __func__, __LINE__, name, strerror(e));
+ return -checkErr(e, EINVAL);
+ }
+ return fd;
+}
+
+int open_verbose_vsock(const VsockPort port, const int flags) {
+ const int fd = QEMU_PIPE_RETRY(socket(AF_VSOCK, SOCK_STREAM, 0));
+ if (fd < 0) {
+ // it is ok if socket(AF_VSOCK, ...) fails - vsock might be unsupported yet
+ return -checkErr(errno, EINVAL);
+ }
+
+ struct sockaddr_vm sa;
+ memset(&sa, 0, sizeof(sa));
+ sa.svm_family = AF_VSOCK;
+ sa.svm_port = static_cast<int>(port);
+ sa.svm_cid = VMADDR_CID_HOST;
+
+ int r;
+
+ r = QEMU_PIPE_RETRY(connect(fd,
+ reinterpret_cast<const struct sockaddr*>(&sa),
+ sizeof(sa)));
+ if (r < 0) {
+ // it is ok if connect(fd, &sa, ...) fails - vsock might be unsupported yet
+ close(fd);
+ return -checkErr(errno, EINVAL);
+ }
+
+ if (flags) {
+ const int oldFlags = QEMU_PIPE_RETRY(fcntl(fd, F_GETFL, 0));
+ if (oldFlags < 0) {
+ ALOGE("%s:%d fcntl(fd=%d, F_GETFL) failed with '%s' (%d)",
+ __func__, __LINE__, fd, strerror(errno), errno);
+ close(fd);
+ return -checkErr(errno, EINVAL);
+ }
+
+ const int newFlags = oldFlags | flags;
+
+ r = QEMU_PIPE_RETRY(fcntl(fd, F_SETFL, newFlags));
+ if (r < 0) {
+ ALOGE("%s:%d fcntl(fd=%d, F_SETFL, flags=0x%X) failed with '%s' (%d)",
+ __func__, __LINE__, fd, newFlags, strerror(errno), errno);
+ close(fd);
+ return -checkErr(errno, EINVAL);
+ }
+ }
+
+ return fd;
+}
+
+int open_verbose(const char *pipeName, const int flags) {
+ int fd;
+
+ // We can't use vsock for grapshics for security reasons,
+ // virtio-gpu should be used instead.
+ if (!is_graphics_pipe(pipeName)) {
+ fd = open_verbose_vsock(VsockPort::Data, flags);
+ if (fd >= 0) {
+ gVsockAvailable = true;
+ }
+ return fd;
+ }
+
+ fd = open_verbose_path("/dev/goldfish_pipe_dprctd", flags);
+ if (fd >= 0) {
+ return fd;
+ }
+
+ ALOGE("%s:%d: both vsock and goldfish_pipe paths failed",
+ __func__, __LINE__);
+ return fd;
+}
+
+void vsock_ping() {
+ const int fd = open_verbose_vsock(VsockPort::Ping, 0);
+ if (fd >= 0) {
+ ALOGE("%s:%d open_verbose_vsock(kVsockPingPort) is expected to fail, "
+ "but it succeeded, fd=%d", __func__, __LINE__, fd);
+ close(fd);
+ }
+}
+} // namespace
+
+extern "C" {
+
+int qemu_pipe_open_ns(const char* ns, const char* pipeName, int flags) {
+ if (pipeName == NULL || pipeName[0] == '\0') {
+ errno = EINVAL;
+ return -EINVAL;
+ }
+
+ const int fd = open_verbose(pipeName, flags);
+ if (fd < 0) {
+ return fd;
+ }
+
+ char buf[256];
+ int bufLen;
+ if (ns) {
+ bufLen = snprintf(buf, sizeof(buf), "pipe:%s:%s", ns, pipeName);
+ } else {
+ bufLen = snprintf(buf, sizeof(buf), "pipe:%s", pipeName);
+ }
+
+ const int e = qemu_pipe_write_fully(fd, buf, bufLen + 1);
+ if (e < 0) {
+ ALOGE("%s:%d: Could not connect to the '%s' service: %s",
+ __func__, __LINE__, buf, strerror(-e));
+ close(fd);
+ return e;
+ }
+
+ return fd;
+}
+
+int qemu_pipe_open(const char* pipeName) {
+ return qemu_pipe_open_ns(NULL, pipeName, O_RDWR | O_NONBLOCK);
+}
+
+void qemu_pipe_close(int pipe) {
+ close(pipe);
+}
+
+int qemu_pipe_read(int pipe, void* buffer, int size) {
+ const ssize_t r = read(pipe, buffer, size);
+ return (r >= 0) ? r : -checkErr(errno, EIO);
+}
+
+int qemu_pipe_write(int pipe, const void* buffer, int size) {
+ const ssize_t r = write(pipe, buffer, size);
+ return (r >= 0) ? r : -checkErr(errno, EIO);
+}
+
+int qemu_pipe_try_again(int ret) {
+ if (ret >= 0) {
+ return 0;
+ }
+
+ switch (errno) {
+ case EAGAIN:
+ if (gVsockAvailable) {
+ vsock_ping();
+ errno = EAGAIN;
+ }
+ return 1;
+
+ case EINTR:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+void qemu_pipe_print_error(int pipe) {
+ ALOGE("pipe error: fd %d errno %d", pipe, errno);
+}
+
+} // extern "C"
diff --git a/src/gfxstream/guest/qemupipe/qemu_pipe_stub.cpp b/src/gfxstream/guest/qemupipe/qemu_pipe_stub.cpp
new file mode 100644
index 00000000000..0e1c14de157
--- /dev/null
+++ b/src/gfxstream/guest/qemupipe/qemu_pipe_stub.cpp
@@ -0,0 +1,43 @@
+// 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.
+
+extern "C" {
+
+int qemu_pipe_open_ns(const char*, const char*, int) {
+ return -1;
+}
+
+int qemu_pipe_open(const char*) {
+ return -1;
+}
+
+void qemu_pipe_close(int) {
+}
+
+int qemu_pipe_read(int, void*, int) {
+ return -1;
+}
+
+int qemu_pipe_write(int, const void*, int) {
+ return -1;
+}
+
+int qemu_pipe_try_again(int) {
+ return -1;
+}
+
+void qemu_pipe_print_error(int) {
+}
+
+} // extern "C" \ No newline at end of file
diff --git a/src/gfxstream/guest/vulkan/gfxstream_icd.json b/src/gfxstream/guest/vulkan/gfxstream_icd.json
new file mode 100644
index 00000000000..a8ce8884615
--- /dev/null
+++ b/src/gfxstream/guest/vulkan/gfxstream_icd.json
@@ -0,0 +1,7 @@
+{
+ "file_format_version": "1.0.0",
+ "ICD": {
+ "library_path": "libgfxstream_guest_vulkan_with_host.so",
+ "api_version": "1.0.5"
+ }
+} \ No newline at end of file
diff --git a/src/gfxstream/guest/vulkan/gfxstream_vk_android.cpp b/src/gfxstream/guest/vulkan/gfxstream_vk_android.cpp
new file mode 100644
index 00000000000..9b07c2bde6e
--- /dev/null
+++ b/src/gfxstream/guest/vulkan/gfxstream_vk_android.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include <errno.h>
+#include <hardware/hardware.h>
+#include <hardware/hwvulkan.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <vulkan/vk_icd.h>
+
+#include "gfxstream_vk_entrypoints.h"
+#include "util/macros.h"
+
+static int gfxstream_vk_hal_open(const struct hw_module_t* mod, const char* id,
+ struct hw_device_t** dev);
+static int gfxstream_vk_hal_close(struct hw_device_t* dev);
+
+static_assert(HWVULKAN_DISPATCH_MAGIC == ICD_LOADER_MAGIC, "");
+
+hw_module_methods_t gfxstream_vk_hal_ops = {
+ .open = gfxstream_vk_hal_open,
+};
+
+PUBLIC struct 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_MAKE_API_VERSION(1, 0),
+ .id = HWVULKAN_HARDWARE_MODULE_ID,
+ .name = "gfxstream Vulkan HAL",
+ .author = "Android Open Source Project",
+ .methods = &(gfxstream_vk_hal_ops),
+ },
+};
+
+static int gfxstream_vk_hal_open(const struct hw_module_t* mod, const char* id,
+ struct hw_device_t** dev) {
+ assert(mod == &HAL_MODULE_INFO_SYM.common);
+ assert(strcmp(id, HWVULKAN_DEVICE_0) == 0);
+
+ hwvulkan_device_t* hal_dev = (hwvulkan_device_t*)calloc(1, sizeof(*hal_dev));
+ if (!hal_dev) return -1;
+
+ *hal_dev = (hwvulkan_device_t){
+ .common =
+ {
+ .tag = HARDWARE_DEVICE_TAG,
+ .version = HWVULKAN_DEVICE_API_VERSION_0_1,
+ .module = &HAL_MODULE_INFO_SYM.common,
+ .close = gfxstream_vk_hal_close,
+ },
+ .EnumerateInstanceExtensionProperties = gfxstream_vk_EnumerateInstanceExtensionProperties,
+ .CreateInstance = gfxstream_vk_CreateInstance,
+ .GetInstanceProcAddr = gfxstream_vk_GetInstanceProcAddr,
+ };
+
+ *dev = &hal_dev->common;
+ return 0;
+}
+
+static int gfxstream_vk_hal_close(struct hw_device_t* dev) {
+ /* hwvulkan.h claims that hw_device_t::close() is never called. */
+ return -1;
+}
diff --git a/src/gfxstream/guest/vulkan/gfxstream_vk_cmd.cpp b/src/gfxstream/guest/vulkan/gfxstream_vk_cmd.cpp
new file mode 100644
index 00000000000..b3d6fce6d3c
--- /dev/null
+++ b/src/gfxstream/guest/vulkan/gfxstream_vk_cmd.cpp
@@ -0,0 +1,188 @@
+// 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 "ResourceTracker.h"
+#include "VkEncoder.h"
+#include "gfxstream_vk_private.h"
+
+VkResult gfxstream_vk_CreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkCommandPool* pCommandPool) {
+ AEMU_SCOPED_TRACE("vkCreateCommandPool");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ VkResult result = (VkResult)0;
+ struct gfxstream_vk_command_pool* gfxstream_pCommandPool =
+ (gfxstream_vk_command_pool*)vk_zalloc2(&gfxstream_device->vk.alloc, pAllocator,
+ sizeof(gfxstream_vk_command_pool), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ result = gfxstream_pCommandPool ? VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (VK_SUCCESS == result) {
+ result = vk_command_pool_init(&gfxstream_device->vk, &gfxstream_pCommandPool->vk,
+ pCreateInfo, pAllocator);
+ }
+ if (VK_SUCCESS == result) {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ result = vkEnc->vkCreateCommandPool(gfxstream_device->internal_object, pCreateInfo,
+ pAllocator, &gfxstream_pCommandPool->internal_object,
+ true /* do lock */);
+ }
+ *pCommandPool = gfxstream_vk_command_pool_to_handle(gfxstream_pCommandPool);
+ return result;
+}
+
+void gfxstream_vk_DestroyCommandPool(VkDevice device, VkCommandPool commandPool,
+ const VkAllocationCallbacks* pAllocator) {
+ AEMU_SCOPED_TRACE("vkDestroyCommandPool");
+ if (VK_NULL_HANDLE == commandPool) {
+ return;
+ }
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ VK_FROM_HANDLE(gfxstream_vk_command_pool, gfxstream_commandPool, commandPool);
+ {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ vkEnc->vkDestroyCommandPool(gfxstream_device->internal_object,
+ gfxstream_commandPool->internal_object, pAllocator,
+ true /* do lock */);
+ }
+ vk_command_pool_finish(&gfxstream_commandPool->vk);
+ vk_free(&gfxstream_commandPool->vk.alloc, gfxstream_commandPool);
+}
+
+VkResult gfxstream_vk_ResetCommandPool(VkDevice device, VkCommandPool commandPool,
+ VkCommandPoolResetFlags flags) {
+ AEMU_SCOPED_TRACE("vkResetCommandPool");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ VK_FROM_HANDLE(gfxstream_vk_command_pool, gfxstream_commandPool, commandPool);
+ VkResult vkResetCommandPool_VkResult_return = (VkResult)0;
+ {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ vkResetCommandPool_VkResult_return = vkEnc->vkResetCommandPool(
+ gfxstream_device->internal_object, gfxstream_commandPool->internal_object, flags,
+ true /* do lock */);
+ if (vkResetCommandPool_VkResult_return == VK_SUCCESS) {
+ gfxstream::vk::ResourceTracker::get()->resetCommandPoolStagingInfo(
+ gfxstream_commandPool->internal_object);
+ }
+ }
+ return vkResetCommandPool_VkResult_return;
+}
+
+static VkResult vk_command_buffer_createOp(struct vk_command_pool*, struct vk_command_buffer**);
+static void vk_command_buffer_resetOp(struct vk_command_buffer*, VkCommandBufferResetFlags);
+static void vk_command_buffer_destroyOp(struct vk_command_buffer*);
+
+static vk_command_buffer_ops gfxstream_vk_commandBufferOps = {
+ .create = vk_command_buffer_createOp,
+ .reset = vk_command_buffer_resetOp,
+ .destroy = vk_command_buffer_destroyOp};
+
+VkResult vk_command_buffer_createOp(struct vk_command_pool* commandPool,
+ struct vk_command_buffer** pCommandBuffer) {
+ VkResult result = VK_SUCCESS;
+ struct gfxstream_vk_command_buffer* gfxstream_commandBuffer =
+ (struct gfxstream_vk_command_buffer*)vk_zalloc(&commandPool->alloc,
+ sizeof(struct gfxstream_vk_command_buffer),
+ 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ if (gfxstream_commandBuffer) {
+ result =
+ vk_command_buffer_init(commandPool, &gfxstream_commandBuffer->vk,
+ &gfxstream_vk_commandBufferOps, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
+ if (VK_SUCCESS == result) {
+ *pCommandBuffer = &gfxstream_commandBuffer->vk;
+ }
+ } else {
+ result = VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ return result;
+}
+
+void vk_command_buffer_resetOp(struct vk_command_buffer* commandBuffer,
+ VkCommandBufferResetFlags flags) {
+ (void)flags;
+ vk_command_buffer_reset(commandBuffer);
+}
+
+void vk_command_buffer_destroyOp(struct vk_command_buffer* commandBuffer) {
+ vk_command_buffer_finish(commandBuffer);
+ vk_free(&commandBuffer->pool->alloc, commandBuffer);
+}
+
+VkResult gfxstream_vk_AllocateCommandBuffers(VkDevice device,
+ const VkCommandBufferAllocateInfo* pAllocateInfo,
+ VkCommandBuffer* pCommandBuffers) {
+ AEMU_SCOPED_TRACE("vkAllocateCommandBuffers");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ VK_FROM_HANDLE(gfxstream_vk_command_pool, gfxstream_commandPool, pAllocateInfo->commandPool);
+ VkResult result = (VkResult)0;
+ std::vector<gfxstream_vk_command_buffer*> gfxstream_commandBuffers(
+ pAllocateInfo->commandBufferCount);
+ for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) {
+ result = vk_command_buffer_createOp(&gfxstream_commandPool->vk,
+ (vk_command_buffer**)&gfxstream_commandBuffers[i]);
+ if (VK_SUCCESS == result) {
+ gfxstream_commandBuffers[i]->vk.level = pAllocateInfo->level;
+ } else {
+ break;
+ }
+ }
+ if (VK_SUCCESS == result) {
+ // Create gfxstream-internal commandBuffer array
+ std::vector<VkCommandBuffer> internal_objects(pAllocateInfo->commandBufferCount);
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ auto resources = gfxstream::vk::ResourceTracker::get();
+ VkCommandBufferAllocateInfo internal_allocateInfo;
+ internal_allocateInfo = *pAllocateInfo;
+ internal_allocateInfo.commandPool = gfxstream_commandPool->internal_object;
+ result = resources->on_vkAllocateCommandBuffers(
+ vkEnc, VK_SUCCESS, gfxstream_device->internal_object, &internal_allocateInfo,
+ internal_objects.data());
+ if (result == VK_SUCCESS) {
+ gfxstream::vk::ResourceTracker::get()->addToCommandPool(
+ gfxstream_commandPool->internal_object, pAllocateInfo->commandBufferCount,
+ internal_objects.data());
+ for (uint32_t i = 0; i < (uint32_t)internal_objects.size(); i++) {
+ gfxstream_commandBuffers[i]->internal_object = internal_objects[i];
+ // TODO: Also vk_command_buffer_init() on every mesa command buffer?
+ pCommandBuffers[i] =
+ gfxstream_vk_command_buffer_to_handle(gfxstream_commandBuffers[i]);
+ }
+ }
+ }
+ return result;
+}
+
+void gfxstream_vk_FreeCommandBuffers(VkDevice device, VkCommandPool commandPool,
+ uint32_t commandBufferCount,
+ const VkCommandBuffer* pCommandBuffers) {
+ AEMU_SCOPED_TRACE("vkFreeCommandBuffers");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ VK_FROM_HANDLE(gfxstream_vk_command_pool, gfxstream_commandPool, commandPool);
+ {
+ // Set up internal commandBuffer array for gfxstream-internal call
+ std::vector<VkCommandBuffer> internal_objects(commandBufferCount);
+ for (uint32_t i = 0; i < commandBufferCount; i++) {
+ VK_FROM_HANDLE(gfxstream_vk_command_buffer, gfxstream_commandBuffer,
+ pCommandBuffers[i]);
+ internal_objects[i] = gfxstream_commandBuffer->internal_object;
+ }
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ vkEnc->vkFreeCommandBuffers(gfxstream_device->internal_object,
+ gfxstream_commandPool->internal_object, commandBufferCount,
+ internal_objects.data(), true /* do lock */);
+ }
+ for (uint32_t i = 0; i < commandBufferCount; i++) {
+ VK_FROM_HANDLE(gfxstream_vk_command_buffer, gfxstream_commandBuffer, pCommandBuffers[i]);
+ vk_command_buffer_destroyOp(&gfxstream_commandBuffer->vk);
+ }
+}
diff --git a/src/gfxstream/guest/vulkan/gfxstream_vk_device.cpp b/src/gfxstream/guest/vulkan/gfxstream_vk_device.cpp
new file mode 100644
index 00000000000..6b265d0797c
--- /dev/null
+++ b/src/gfxstream/guest/vulkan/gfxstream_vk_device.cpp
@@ -0,0 +1,944 @@
+// 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 <errno.h>
+#include <string.h>
+
+#include "../vulkan_enc/vk_util.h"
+#include "HostConnection.h"
+#include "ProcessPipe.h"
+#include "ResourceTracker.h"
+#include "VkEncoder.h"
+#include "gfxstream_vk_entrypoints.h"
+#include "gfxstream_vk_private.h"
+#include "vk_alloc.h"
+#include "vk_device.h"
+#include "vk_instance.h"
+#include "vk_sync_dummy.h"
+
+static HostConnection* getConnection(void) {
+ auto hostCon = HostConnection::get();
+ return hostCon;
+}
+
+static gfxstream::vk::VkEncoder* getVkEncoder(HostConnection* con) { return con->vkEncoder(); }
+
+gfxstream::vk::ResourceTracker::ThreadingCallbacks threadingCallbacks = {
+ .hostConnectionGetFunc = getConnection,
+ .vkEncoderGetFunc = getVkEncoder,
+};
+
+VkResult SetupInstance(void) {
+ uint32_t noRenderControlEnc = 0;
+ HostConnection* hostCon = HostConnection::getOrCreate(kCapsetGfxStreamVulkan);
+ if (!hostCon) {
+ ALOGE("vulkan: Failed to get host connection\n");
+ return VK_ERROR_DEVICE_LOST;
+ }
+
+ gfxstream::vk::ResourceTracker::get()->setupCaps(noRenderControlEnc);
+ // Legacy goldfish path: could be deleted once goldfish not used guest-side.
+ if (!noRenderControlEnc) {
+#if GFXSTREAM_GUEST_ENABLE_GLES
+ // Implicitly sets up sequence number
+ ExtendedRCEncoderContext* rcEnc = hostCon->rcEncoder();
+ if (!rcEnc) {
+ ALOGE("vulkan: Failed to get renderControl encoder context\n");
+ return VK_ERROR_DEVICE_LOST;
+ }
+
+ gfxstream::vk::ResourceTracker::get()->setupFeatures(rcEnc->featureInfo_const());
+#endif
+ }
+
+ gfxstream::vk::ResourceTracker::get()->setThreadingCallbacks(threadingCallbacks);
+ gfxstream::vk::ResourceTracker::get()->setSeqnoPtr(getSeqnoPtrForProcess());
+ gfxstream::vk::VkEncoder* vkEnc = hostCon->vkEncoder();
+ if (!vkEnc) {
+ ALOGE("vulkan: Failed to get Vulkan encoder\n");
+ return VK_ERROR_DEVICE_LOST;
+ }
+
+ return VK_SUCCESS;
+}
+
+#define VK_HOST_CONNECTION(ret) \
+ HostConnection* hostCon = HostConnection::getOrCreate(kCapsetGfxStreamVulkan); \
+ gfxstream::vk::VkEncoder* vkEnc = hostCon->vkEncoder(); \
+ if (!vkEnc) { \
+ ALOGE("vulkan: Failed to get Vulkan encoder\n"); \
+ return ret; \
+ }
+
+static bool instance_extension_table_initialized = false;
+static struct vk_instance_extension_table gfxstream_vk_instance_extensions_supported = {0};
+
+// Provided by Mesa components only; never encoded/decoded through gfxstream
+static const char* const kMesaOnlyInstanceExtension[] = {
+ VK_KHR_SURFACE_EXTENSION_NAME,
+#if defined(LINUX_GUEST_BUILD)
+ VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME,
+#endif
+ VK_EXT_DEBUG_UTILS_EXTENSION_NAME,
+};
+
+static const char* const kMesaOnlyDeviceExtensions[] = {
+ VK_KHR_SWAPCHAIN_EXTENSION_NAME,
+};
+
+static bool isMesaOnlyInstanceExtension(const char* name) {
+ for (auto mesaExt : kMesaOnlyInstanceExtension) {
+ if (!strncmp(mesaExt, name, VK_MAX_EXTENSION_NAME_SIZE)) return true;
+ }
+ return false;
+}
+
+static bool isMesaOnlyDeviceExtension(const char* name) {
+ for (auto mesaExt : kMesaOnlyDeviceExtensions) {
+ if (!strncmp(mesaExt, name, VK_MAX_EXTENSION_NAME_SIZE)) return true;
+ }
+ return false;
+}
+
+// Filtered extension names for encoding
+static std::vector<const char*> filteredInstanceExtensionNames(uint32_t count,
+ const char* const* extNames) {
+ std::vector<const char*> retList;
+ for (uint32_t i = 0; i < count; ++i) {
+ auto extName = extNames[i];
+ if (!isMesaOnlyInstanceExtension(extName)) {
+ retList.push_back(extName);
+ }
+ }
+ return retList;
+}
+
+static std::vector<const char*> filteredDeviceExtensionNames(uint32_t count,
+ const char* const* extNames) {
+ std::vector<const char*> retList;
+ for (uint32_t i = 0; i < count; ++i) {
+ auto extName = extNames[i];
+ if (!isMesaOnlyDeviceExtension(extName)) {
+ retList.push_back(extName);
+ }
+ }
+ return retList;
+}
+
+static void get_device_extensions(VkPhysicalDevice physDevInternal,
+ struct vk_device_extension_table* deviceExts) {
+ VkResult result = (VkResult)0;
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ auto resources = gfxstream::vk::ResourceTracker::get();
+ uint32_t numDeviceExts = 0;
+ result = resources->on_vkEnumerateDeviceExtensionProperties(vkEnc, VK_SUCCESS, physDevInternal,
+ NULL, &numDeviceExts, NULL);
+ if (VK_SUCCESS == result) {
+ std::vector<VkExtensionProperties> extProps(numDeviceExts);
+ result = resources->on_vkEnumerateDeviceExtensionProperties(
+ vkEnc, VK_SUCCESS, physDevInternal, NULL, &numDeviceExts, extProps.data());
+ if (VK_SUCCESS == result) {
+ // device extensions from gfxstream
+ for (uint32_t i = 0; i < numDeviceExts; i++) {
+ for (uint32_t j = 0; j < VK_DEVICE_EXTENSION_COUNT; j++) {
+ if (0 == strncmp(extProps[i].extensionName,
+ vk_device_extensions[j].extensionName,
+ VK_MAX_EXTENSION_NAME_SIZE)) {
+ deviceExts->extensions[j] = true;
+ break;
+ }
+ }
+ }
+ // device extensions from Mesa
+ for (uint32_t j = 0; j < VK_DEVICE_EXTENSION_COUNT; j++) {
+ if (isMesaOnlyDeviceExtension(vk_device_extensions[j].extensionName)) {
+ deviceExts->extensions[j] = true;
+ break;
+ }
+ }
+ }
+ }
+}
+
+static VkResult gfxstream_vk_physical_device_init(
+ struct gfxstream_vk_physical_device* physical_device, struct gfxstream_vk_instance* instance,
+ VkPhysicalDevice internal_object) {
+ struct vk_device_extension_table supported_extensions = {0};
+ get_device_extensions(internal_object, &supported_extensions);
+
+ struct vk_physical_device_dispatch_table dispatch_table;
+ memset(&dispatch_table, 0, sizeof(struct vk_physical_device_dispatch_table));
+ vk_physical_device_dispatch_table_from_entrypoints(
+ &dispatch_table, &gfxstream_vk_physical_device_entrypoints, false);
+ vk_physical_device_dispatch_table_from_entrypoints(&dispatch_table,
+ &wsi_physical_device_entrypoints, false);
+
+ // Initialize the mesa object
+ VkResult result = vk_physical_device_init(&physical_device->vk, &instance->vk,
+ &supported_extensions, NULL, NULL, &dispatch_table);
+
+ if (VK_SUCCESS == result) {
+ // Set the gfxstream-internal object
+ physical_device->internal_object = internal_object;
+ physical_device->instance = instance;
+ // Note: Must use dummy_sync for correct sync object path in WSI operations
+ physical_device->sync_types[0] = &vk_sync_dummy_type;
+ physical_device->sync_types[1] = NULL;
+ physical_device->vk.supported_sync_types = physical_device->sync_types;
+
+ result = gfxstream_vk_wsi_init(physical_device);
+ }
+
+ return result;
+}
+
+static void gfxstream_vk_physical_device_finish(
+ struct gfxstream_vk_physical_device* physical_device) {
+ gfxstream_vk_wsi_finish(physical_device);
+
+ vk_physical_device_finish(&physical_device->vk);
+}
+
+static void gfxstream_vk_destroy_physical_device(struct vk_physical_device* physical_device) {
+ gfxstream_vk_physical_device_finish((struct gfxstream_vk_physical_device*)physical_device);
+ vk_free(&physical_device->instance->alloc, physical_device);
+}
+
+static VkResult gfxstream_vk_enumerate_devices(struct vk_instance* vk_instance) {
+ VkResult result = VK_SUCCESS;
+ gfxstream_vk_instance* gfxstream_instance = (gfxstream_vk_instance*)vk_instance;
+ uint32_t deviceCount = 0;
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ auto resources = gfxstream::vk::ResourceTracker::get();
+ result = resources->on_vkEnumeratePhysicalDevices(
+ vkEnc, VK_SUCCESS, gfxstream_instance->internal_object, &deviceCount, NULL);
+ if (VK_SUCCESS != result) return result;
+ std::vector<VkPhysicalDevice> internal_list(deviceCount);
+ result = resources->on_vkEnumeratePhysicalDevices(
+ vkEnc, VK_SUCCESS, gfxstream_instance->internal_object, &deviceCount, internal_list.data());
+
+ if (VK_SUCCESS == result) {
+ for (uint32_t i = 0; i < deviceCount; i++) {
+ struct gfxstream_vk_physical_device* gfxstream_physicalDevice =
+ (struct gfxstream_vk_physical_device*)vk_zalloc(
+ &gfxstream_instance->vk.alloc, sizeof(struct gfxstream_vk_physical_device), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
+ if (!gfxstream_physicalDevice) {
+ result = VK_ERROR_OUT_OF_HOST_MEMORY;
+ break;
+ }
+ result = gfxstream_vk_physical_device_init(gfxstream_physicalDevice, gfxstream_instance,
+ internal_list[i]);
+ if (VK_SUCCESS == result) {
+ list_addtail(&gfxstream_physicalDevice->vk.link,
+ &gfxstream_instance->vk.physical_devices.list);
+ } else {
+ vk_free(&gfxstream_instance->vk.alloc, gfxstream_physicalDevice);
+ break;
+ }
+ }
+ }
+
+ return result;
+}
+
+static struct vk_instance_extension_table* get_instance_extensions() {
+ struct vk_instance_extension_table* const retTablePtr =
+ &gfxstream_vk_instance_extensions_supported;
+ if (!instance_extension_table_initialized) {
+ VkResult result = SetupInstance();
+ if (VK_SUCCESS == result) {
+ VK_HOST_CONNECTION(retTablePtr)
+ auto resources = gfxstream::vk::ResourceTracker::get();
+ uint32_t numInstanceExts = 0;
+ result = resources->on_vkEnumerateInstanceExtensionProperties(vkEnc, VK_SUCCESS, NULL,
+ &numInstanceExts, NULL);
+ if (VK_SUCCESS == result) {
+ std::vector<VkExtensionProperties> extProps(numInstanceExts);
+ result = resources->on_vkEnumerateInstanceExtensionProperties(
+ vkEnc, VK_SUCCESS, NULL, &numInstanceExts, extProps.data());
+ if (VK_SUCCESS == result) {
+ // instance extensions from gfxstream
+ for (uint32_t i = 0; i < numInstanceExts; i++) {
+ for (uint32_t j = 0; j < VK_INSTANCE_EXTENSION_COUNT; j++) {
+ if (0 == strncmp(extProps[i].extensionName,
+ vk_instance_extensions[j].extensionName,
+ VK_MAX_EXTENSION_NAME_SIZE)) {
+ gfxstream_vk_instance_extensions_supported.extensions[j] = true;
+ break;
+ }
+ }
+ }
+ // instance extensions from Mesa
+ for (uint32_t j = 0; j < VK_INSTANCE_EXTENSION_COUNT; j++) {
+ if (isMesaOnlyInstanceExtension(vk_instance_extensions[j].extensionName)) {
+ gfxstream_vk_instance_extensions_supported.extensions[j] = true;
+ }
+ }
+ instance_extension_table_initialized = true;
+ }
+ }
+ }
+ }
+ return retTablePtr;
+}
+
+VkResult gfxstream_vk_CreateInstance(const VkInstanceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkInstance* pInstance) {
+ AEMU_SCOPED_TRACE("vkCreateInstance");
+
+ struct gfxstream_vk_instance* instance;
+
+ pAllocator = pAllocator ?: vk_default_allocator();
+ instance = (struct gfxstream_vk_instance*)vk_zalloc(pAllocator, sizeof(*instance), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ if (NULL == instance) {
+ return vk_error(NULL, VK_ERROR_OUT_OF_HOST_MEMORY);
+ }
+
+ VkResult result = VK_SUCCESS;
+ /* Encoder call */
+ {
+ ALOGE("calling setup instance internally");
+ result = SetupInstance();
+ if (VK_SUCCESS != result) {
+ return vk_error(NULL, result);
+ }
+ uint32_t initialEnabledExtensionCount = pCreateInfo->enabledExtensionCount;
+ const char* const* initialPpEnabledExtensionNames = pCreateInfo->ppEnabledExtensionNames;
+ std::vector<const char*> filteredExts = filteredInstanceExtensionNames(
+ pCreateInfo->enabledExtensionCount, pCreateInfo->ppEnabledExtensionNames);
+ // Temporarily modify createInfo for the encoder call
+ VkInstanceCreateInfo* mutableCreateInfo = (VkInstanceCreateInfo*)pCreateInfo;
+ mutableCreateInfo->enabledExtensionCount = static_cast<uint32_t>(filteredExts.size());
+ mutableCreateInfo->ppEnabledExtensionNames = filteredExts.data();
+
+ VK_HOST_CONNECTION(VK_ERROR_DEVICE_LOST);
+ result = vkEnc->vkCreateInstance(pCreateInfo, nullptr, &instance->internal_object,
+ true /* do lock */);
+ if (VK_SUCCESS != result) {
+ return vk_error(NULL, result);
+ }
+ // Revert the createInfo the user-set data
+ mutableCreateInfo->enabledExtensionCount = initialEnabledExtensionCount;
+ mutableCreateInfo->ppEnabledExtensionNames = initialPpEnabledExtensionNames;
+ }
+
+ struct vk_instance_dispatch_table dispatch_table;
+ memset(&dispatch_table, 0, sizeof(struct vk_instance_dispatch_table));
+ vk_instance_dispatch_table_from_entrypoints(&dispatch_table, &gfxstream_vk_instance_entrypoints,
+ false);
+ vk_instance_dispatch_table_from_entrypoints(&dispatch_table, &wsi_instance_entrypoints, false);
+
+ result = vk_instance_init(&instance->vk, get_instance_extensions(), &dispatch_table,
+ pCreateInfo, pAllocator);
+
+ if (result != VK_SUCCESS) {
+ vk_free(pAllocator, instance);
+ return vk_error(NULL, result);
+ }
+
+ instance->vk.physical_devices.enumerate = gfxstream_vk_enumerate_devices;
+ instance->vk.physical_devices.destroy = gfxstream_vk_destroy_physical_device;
+ // TODO: instance->vk.physical_devices.try_create_for_drm (?)
+
+ *pInstance = gfxstream_vk_instance_to_handle(instance);
+ return VK_SUCCESS;
+}
+
+void gfxstream_vk_DestroyInstance(VkInstance _instance, const VkAllocationCallbacks* pAllocator) {
+ AEMU_SCOPED_TRACE("vkDestroyInstance");
+ if (VK_NULL_HANDLE == _instance) return;
+
+ VK_FROM_HANDLE(gfxstream_vk_instance, instance, _instance);
+
+ VK_HOST_CONNECTION()
+ vkEnc->vkDestroyInstance(instance->internal_object, pAllocator, true /* do lock */);
+
+ vk_instance_finish(&instance->vk);
+ vk_free(&instance->vk.alloc, instance);
+
+ // To make End2EndTests happy, since now the host connection is statically linked to
+ // libvulkan_ranchu.so [separate HostConnections now].
+#if defined(END2END_TESTS)
+ hostCon->exit();
+ processPipeRestart();
+#endif
+}
+
+VkResult gfxstream_vk_EnumerateInstanceExtensionProperties(const char* pLayerName,
+ uint32_t* pPropertyCount,
+ VkExtensionProperties* pProperties) {
+ AEMU_SCOPED_TRACE("vkvkEnumerateInstanceExtensionProperties");
+ (void)pLayerName;
+
+ return vk_enumerate_instance_extension_properties(get_instance_extensions(), pPropertyCount,
+ pProperties);
+}
+
+VkResult gfxstream_vk_EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
+ const char* pLayerName,
+ uint32_t* pPropertyCount,
+ VkExtensionProperties* pProperties) {
+ AEMU_SCOPED_TRACE("vkEnumerateDeviceExtensionProperties");
+ (void)pLayerName;
+ VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice);
+
+ VK_OUTARRAY_MAKE_TYPED(VkExtensionProperties, out, pProperties, pPropertyCount);
+
+ for (int i = 0; i < VK_DEVICE_EXTENSION_COUNT; i++) {
+ if (!pdevice->supported_extensions.extensions[i]) continue;
+
+ vk_outarray_append_typed(VkExtensionProperties, &out, prop) {
+ *prop = vk_device_extensions[i];
+ }
+ }
+
+ return vk_outarray_status(&out);
+}
+
+VkResult gfxstream_vk_CreateDevice(VkPhysicalDevice physicalDevice,
+ const VkDeviceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) {
+ AEMU_SCOPED_TRACE("vkCreateDevice");
+ VK_FROM_HANDLE(gfxstream_vk_physical_device, gfxstream_physicalDevice, physicalDevice);
+ VkResult result = (VkResult)0;
+
+ /*
+ * Android's libvulkan implements VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT, but
+ * passes it to the underlying driver anyways. See:
+ *
+ * https://android-review.googlesource.com/c/platform/hardware/google/gfxstream/+/2839438
+ *
+ * and associated bugs. Mesa VK runtime also checks this, so we have to filter out before
+ * reaches it. vk_find_struct<VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT>(..) doesn't
+ * work for some reason.
+ */
+ VkBaseInStructure* extensionCreateInfo = (VkBaseInStructure*)(pCreateInfo->pNext);
+ while (extensionCreateInfo) {
+ if (extensionCreateInfo->sType ==
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT) {
+ auto swapchainMaintenance1Features =
+ reinterpret_cast<VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT*>(
+ extensionCreateInfo);
+ swapchainMaintenance1Features->swapchainMaintenance1 = VK_FALSE;
+ }
+ extensionCreateInfo = (VkBaseInStructure*)(extensionCreateInfo->pNext);
+ }
+
+ const VkAllocationCallbacks* pMesaAllocator =
+ pAllocator ?: &gfxstream_physicalDevice->instance->vk.alloc;
+ struct gfxstream_vk_device* gfxstream_device = (struct gfxstream_vk_device*)vk_zalloc(
+ pMesaAllocator, sizeof(struct gfxstream_vk_device), 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ result = gfxstream_device ? VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (VK_SUCCESS == result) {
+ uint32_t initialEnabledExtensionCount = pCreateInfo->enabledExtensionCount;
+ const char* const* initialPpEnabledExtensionNames = pCreateInfo->ppEnabledExtensionNames;
+ std::vector<const char*> filteredExts = filteredDeviceExtensionNames(
+ pCreateInfo->enabledExtensionCount, pCreateInfo->ppEnabledExtensionNames);
+ // Temporarily modify createInfo for the encoder call
+ VkDeviceCreateInfo* mutableCreateInfo = (VkDeviceCreateInfo*)pCreateInfo;
+ mutableCreateInfo->enabledExtensionCount = static_cast<uint32_t>(filteredExts.size());
+ mutableCreateInfo->ppEnabledExtensionNames = filteredExts.data();
+
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ result = vkEnc->vkCreateDevice(gfxstream_physicalDevice->internal_object, pCreateInfo,
+ pAllocator, &gfxstream_device->internal_object,
+ true /* do lock */);
+ // Revert the createInfo the user-set data
+ mutableCreateInfo->enabledExtensionCount = initialEnabledExtensionCount;
+ mutableCreateInfo->ppEnabledExtensionNames = initialPpEnabledExtensionNames;
+ }
+ if (VK_SUCCESS == result) {
+ struct vk_device_dispatch_table dispatch_table;
+ memset(&dispatch_table, 0, sizeof(struct vk_device_dispatch_table));
+ vk_device_dispatch_table_from_entrypoints(&dispatch_table, &gfxstream_vk_device_entrypoints,
+ false);
+ vk_device_dispatch_table_from_entrypoints(&dispatch_table, &wsi_device_entrypoints, false);
+
+ result = vk_device_init(&gfxstream_device->vk, &gfxstream_physicalDevice->vk,
+ &dispatch_table, pCreateInfo, pMesaAllocator);
+ }
+ if (VK_SUCCESS == result) {
+ gfxstream_device->physical_device = gfxstream_physicalDevice;
+ // TODO: Initialize cmd_dispatch for emulated secondary command buffer support?
+ gfxstream_device->vk.command_dispatch_table = &gfxstream_device->cmd_dispatch;
+ *pDevice = gfxstream_vk_device_to_handle(gfxstream_device);
+ } else {
+ vk_free(pMesaAllocator, gfxstream_device);
+ }
+
+ return result;
+}
+
+void gfxstream_vk_DestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) {
+ AEMU_SCOPED_TRACE("vkDestroyDevice");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ if (VK_NULL_HANDLE == device) return;
+
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ vkEnc->vkDestroyDevice(gfxstream_device->internal_object, pAllocator, true /* do lock */);
+
+ /* Must destroy device queues manually */
+ vk_foreach_queue_safe(queue, &gfxstream_device->vk) {
+ vk_queue_finish(queue);
+ vk_free(&gfxstream_device->vk.alloc, queue);
+ }
+ vk_device_finish(&gfxstream_device->vk);
+ vk_free(&gfxstream_device->vk.alloc, gfxstream_device);
+}
+
+void gfxstream_vk_GetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex,
+ VkQueue* pQueue) {
+ AEMU_SCOPED_TRACE("vkGetDeviceQueue");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ struct gfxstream_vk_queue* gfxstream_queue = (struct gfxstream_vk_queue*)vk_zalloc(
+ &gfxstream_device->vk.alloc, sizeof(struct gfxstream_vk_queue), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ VkResult result = gfxstream_queue ? VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (VK_SUCCESS == result) {
+ VkDeviceQueueCreateInfo createInfo = {
+ .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
+ .pNext = NULL,
+ .flags = 0,
+ .queueFamilyIndex = queueFamilyIndex,
+ .queueCount = 1,
+ .pQueuePriorities = NULL,
+ };
+ result =
+ vk_queue_init(&gfxstream_queue->vk, &gfxstream_device->vk, &createInfo, queueIndex);
+ }
+ if (VK_SUCCESS == result) {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ vkEnc->vkGetDeviceQueue(gfxstream_device->internal_object, queueFamilyIndex, queueIndex,
+ &gfxstream_queue->internal_object, true /* do lock */);
+
+ gfxstream_queue->device = gfxstream_device;
+ *pQueue = gfxstream_vk_queue_to_handle(gfxstream_queue);
+ } else {
+ *pQueue = VK_NULL_HANDLE;
+ }
+}
+
+void gfxstream_vk_GetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo,
+ VkQueue* pQueue) {
+ AEMU_SCOPED_TRACE("vkGetDeviceQueue2");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ struct gfxstream_vk_queue* gfxstream_queue = (struct gfxstream_vk_queue*)vk_zalloc(
+ &gfxstream_device->vk.alloc, sizeof(struct gfxstream_vk_queue), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ VkResult result = gfxstream_queue ? VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (VK_SUCCESS == result) {
+ VkDeviceQueueCreateInfo createInfo = {
+ .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
+ .pNext = NULL,
+ .flags = pQueueInfo->flags,
+ .queueFamilyIndex = pQueueInfo->queueFamilyIndex,
+ .queueCount = 1,
+ .pQueuePriorities = NULL,
+ };
+ result = vk_queue_init(&gfxstream_queue->vk, &gfxstream_device->vk, &createInfo,
+ pQueueInfo->queueIndex);
+ }
+ if (VK_SUCCESS == result) {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ vkEnc->vkGetDeviceQueue2(gfxstream_device->internal_object, pQueueInfo,
+ &gfxstream_queue->internal_object, true /* do lock */);
+
+ gfxstream_queue->device = gfxstream_device;
+ *pQueue = gfxstream_vk_queue_to_handle(gfxstream_queue);
+ } else {
+ *pQueue = VK_NULL_HANDLE;
+ }
+}
+
+/* The loader wants us to expose a second GetInstanceProcAddr function
+ * to work around certain LD_PRELOAD issues seen in apps.
+ */
+extern "C" PUBLIC VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
+vk_icdGetInstanceProcAddr(VkInstance instance, const char* pName);
+
+extern "C" PUBLIC VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
+vk_icdGetInstanceProcAddr(VkInstance instance, const char* pName) {
+ return gfxstream_vk_GetInstanceProcAddr(instance, pName);
+}
+
+PFN_vkVoidFunction gfxstream_vk_GetInstanceProcAddr(VkInstance _instance, const char* pName) {
+ VK_FROM_HANDLE(gfxstream_vk_instance, instance, _instance);
+ return vk_instance_get_proc_addr(&instance->vk, &gfxstream_vk_instance_entrypoints, pName);
+}
+
+PFN_vkVoidFunction gfxstream_vk_GetDeviceProcAddr(VkDevice _device, const char* pName) {
+ AEMU_SCOPED_TRACE("vkGetDeviceProcAddr");
+ VK_FROM_HANDLE(gfxstream_vk_device, device, _device);
+ return vk_device_get_proc_addr(&device->vk, pName);
+}
+
+VkResult gfxstream_vk_AllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDeviceMemory* pMemory) {
+ AEMU_SCOPED_TRACE("vkAllocateMemory");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ VkResult vkAllocateMemory_VkResult_return = (VkResult)0;
+ struct gfxstream_vk_device_memory* gfxstream_pMemory =
+ (struct gfxstream_vk_device_memory*)vk_device_memory_create(
+ (vk_device*)gfxstream_device, pAllocateInfo, pAllocator,
+ sizeof(struct gfxstream_vk_device_memory));
+ /* VkMemoryDedicatedAllocateInfo */
+ VkMemoryDedicatedAllocateInfo* dedicatedAllocInfoPtr =
+ (VkMemoryDedicatedAllocateInfo*)vk_find_struct<VkMemoryDedicatedAllocateInfo>(
+ pAllocateInfo);
+ if (dedicatedAllocInfoPtr) {
+ if (dedicatedAllocInfoPtr->buffer) {
+ VK_FROM_HANDLE(gfxstream_vk_buffer, gfxstream_buffer, dedicatedAllocInfoPtr->buffer);
+ dedicatedAllocInfoPtr->buffer = gfxstream_buffer->internal_object;
+ }
+ if (dedicatedAllocInfoPtr->image) {
+ VK_FROM_HANDLE(gfxstream_vk_image, gfxstream_image, dedicatedAllocInfoPtr->image);
+ dedicatedAllocInfoPtr->image = gfxstream_image->internal_object;
+ }
+ }
+ vkAllocateMemory_VkResult_return = gfxstream_pMemory ? VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (VK_SUCCESS == vkAllocateMemory_VkResult_return) {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ auto resources = gfxstream::vk::ResourceTracker::get();
+ vkAllocateMemory_VkResult_return = resources->on_vkAllocateMemory(
+ vkEnc, VK_SUCCESS, gfxstream_device->internal_object, pAllocateInfo, pAllocator,
+ &gfxstream_pMemory->internal_object);
+ }
+ *pMemory = gfxstream_vk_device_memory_to_handle(gfxstream_pMemory);
+ return vkAllocateMemory_VkResult_return;
+}
+
+void gfxstream_vk_CmdBeginRenderPass(VkCommandBuffer commandBuffer,
+ const VkRenderPassBeginInfo* pRenderPassBegin,
+ VkSubpassContents contents) {
+ AEMU_SCOPED_TRACE("vkCmdBeginRenderPass");
+ VK_FROM_HANDLE(gfxstream_vk_command_buffer, gfxstream_commandBuffer, commandBuffer);
+ {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getCommandBufferEncoder(
+ gfxstream_commandBuffer->internal_object);
+ VkRenderPassBeginInfo internal_pRenderPassBegin = vk_make_orphan_copy(*pRenderPassBegin);
+ vk_struct_chain_iterator structChainIter =
+ vk_make_chain_iterator(&internal_pRenderPassBegin);
+ /* VkRenderPassBeginInfo::renderPass */
+ VK_FROM_HANDLE(gfxstream_vk_render_pass, gfxstream_renderPass,
+ internal_pRenderPassBegin.renderPass);
+ internal_pRenderPassBegin.renderPass = gfxstream_renderPass->internal_object;
+ /* VkRenderPassBeginInfo::framebuffer */
+ VK_FROM_HANDLE(gfxstream_vk_framebuffer, gfxstream_framebuffer,
+ internal_pRenderPassBegin.framebuffer);
+ internal_pRenderPassBegin.framebuffer = gfxstream_framebuffer->internal_object;
+ /* pNext = VkRenderPassAttachmentBeginInfo */
+ std::vector<VkImageView> internal_pAttachments;
+ VkRenderPassAttachmentBeginInfo internal_renderPassAttachmentBeginInfo;
+ VkRenderPassAttachmentBeginInfo* pRenderPassAttachmentBeginInfo =
+ (VkRenderPassAttachmentBeginInfo*)vk_find_struct<VkRenderPassAttachmentBeginInfo>(
+ pRenderPassBegin);
+ if (pRenderPassAttachmentBeginInfo) {
+ internal_renderPassAttachmentBeginInfo = *pRenderPassAttachmentBeginInfo;
+ /* VkRenderPassAttachmentBeginInfo::pAttachments */
+ internal_pAttachments.reserve(internal_renderPassAttachmentBeginInfo.attachmentCount);
+ for (uint32_t i = 0; i < internal_renderPassAttachmentBeginInfo.attachmentCount; i++) {
+ VK_FROM_HANDLE(gfxstream_vk_image_view, gfxstream_image_view,
+ internal_renderPassAttachmentBeginInfo.pAttachments[i]);
+ internal_pAttachments[i] = gfxstream_image_view->internal_object;
+ }
+ internal_renderPassAttachmentBeginInfo.pAttachments = internal_pAttachments.data();
+ vk_append_struct(&structChainIter, &internal_renderPassAttachmentBeginInfo);
+ }
+ vkEnc->vkCmdBeginRenderPass(gfxstream_commandBuffer->internal_object,
+ &internal_pRenderPassBegin, contents, true /* do lock */);
+ }
+}
+
+void gfxstream_vk_CmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer,
+ const VkRenderPassBeginInfo* pRenderPassBegin,
+ const VkSubpassBeginInfo* pSubpassBeginInfo) {
+ AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2KHR");
+ VK_FROM_HANDLE(gfxstream_vk_command_buffer, gfxstream_commandBuffer, commandBuffer);
+ {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getCommandBufferEncoder(
+ gfxstream_commandBuffer->internal_object);
+ VkRenderPassBeginInfo internal_pRenderPassBegin = vk_make_orphan_copy(*pRenderPassBegin);
+ vk_struct_chain_iterator structChainIter =
+ vk_make_chain_iterator(&internal_pRenderPassBegin);
+ /* VkRenderPassBeginInfo::renderPass */
+ VK_FROM_HANDLE(gfxstream_vk_render_pass, gfxstream_renderPass,
+ internal_pRenderPassBegin.renderPass);
+ internal_pRenderPassBegin.renderPass = gfxstream_renderPass->internal_object;
+ /* VkRenderPassBeginInfo::framebuffer */
+ VK_FROM_HANDLE(gfxstream_vk_framebuffer, gfxstream_framebuffer,
+ internal_pRenderPassBegin.framebuffer);
+ internal_pRenderPassBegin.framebuffer = gfxstream_framebuffer->internal_object;
+ /* pNext = VkRenderPassAttachmentBeginInfo */
+ std::vector<VkImageView> internal_pAttachments;
+ VkRenderPassAttachmentBeginInfo internal_renderPassAttachmentBeginInfo;
+ VkRenderPassAttachmentBeginInfo* pRenderPassAttachmentBeginInfo =
+ (VkRenderPassAttachmentBeginInfo*)vk_find_struct<VkRenderPassAttachmentBeginInfo>(
+ pRenderPassBegin);
+ if (pRenderPassAttachmentBeginInfo) {
+ internal_renderPassAttachmentBeginInfo = *pRenderPassAttachmentBeginInfo;
+ /* VkRenderPassAttachmentBeginInfo::pAttachments */
+ internal_pAttachments.reserve(internal_renderPassAttachmentBeginInfo.attachmentCount);
+ for (uint32_t i = 0; i < internal_renderPassAttachmentBeginInfo.attachmentCount; i++) {
+ VK_FROM_HANDLE(gfxstream_vk_image_view, gfxstream_image_view,
+ internal_renderPassAttachmentBeginInfo.pAttachments[i]);
+ internal_pAttachments[i] = gfxstream_image_view->internal_object;
+ }
+ internal_renderPassAttachmentBeginInfo.pAttachments = internal_pAttachments.data();
+ vk_append_struct(&structChainIter, &internal_renderPassAttachmentBeginInfo);
+ }
+ vkEnc->vkCmdBeginRenderPass2KHR(gfxstream_commandBuffer->internal_object,
+ &internal_pRenderPassBegin, pSubpassBeginInfo,
+ true /* do lock */);
+ }
+}
+
+VkResult gfxstream_vk_GetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo,
+ int* pFd) {
+ AEMU_SCOPED_TRACE("vkGetMemoryFdKHR");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0;
+
+ {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ std::vector<VkMemoryGetFdInfoKHR> internal_pGetFdInfo(1);
+ for (uint32_t i = 0; i < 1; ++i) {
+ internal_pGetFdInfo[i] = pGetFdInfo[i];
+ /* VkMemoryGetFdInfoKHR::memory */
+ VK_FROM_HANDLE(gfxstream_vk_device_memory, gfxstream_memory,
+ internal_pGetFdInfo[i].memory);
+ internal_pGetFdInfo[i].memory = gfxstream_memory->internal_object;
+ }
+ auto resources = gfxstream::vk::ResourceTracker::get();
+ vkGetMemoryFdKHR_VkResult_return = resources->on_vkGetMemoryFdKHR(
+ vkEnc, VK_SUCCESS, gfxstream_device->internal_object, internal_pGetFdInfo.data(), pFd);
+ }
+ return vkGetMemoryFdKHR_VkResult_return;
+}
+
+VkResult gfxstream_vk_EnumerateInstanceLayerProperties(uint32_t* pPropertyCount,
+ VkLayerProperties* pProperties) {
+ AEMU_SCOPED_TRACE("vkEnumerateInstanceLayerProperties");
+ auto result = SetupInstance();
+ if (VK_SUCCESS != result) {
+ return vk_error(NULL, result);
+ }
+
+ VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0;
+ {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ vkEnumerateInstanceLayerProperties_VkResult_return =
+ vkEnc->vkEnumerateInstanceLayerProperties(pPropertyCount, pProperties,
+ true /* do lock */);
+ }
+ return vkEnumerateInstanceLayerProperties_VkResult_return;
+}
+
+VkResult gfxstream_vk_EnumerateInstanceVersion(uint32_t* pApiVersion) {
+ AEMU_SCOPED_TRACE("vkEnumerateInstanceVersion");
+ auto result = SetupInstance();
+ if (VK_SUCCESS != result) {
+ return vk_error(NULL, result);
+ }
+
+ VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0;
+ {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ vkEnumerateInstanceVersion_VkResult_return =
+ vkEnc->vkEnumerateInstanceVersion(pApiVersion, true /* do lock */);
+ }
+ return vkEnumerateInstanceVersion_VkResult_return;
+}
+
+VkResult gfxstream_vk_CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache,
+ uint32_t createInfoCount,
+ const VkComputePipelineCreateInfo* pCreateInfos,
+ const VkAllocationCallbacks* pAllocator,
+ VkPipeline* pPipelines) {
+ AEMU_SCOPED_TRACE("vkCreateComputePipelines");
+ VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0;
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ VK_FROM_HANDLE(gfxstream_vk_pipeline_cache, gfxstream_pipelineCache, pipelineCache);
+ struct gfxstream_vk_pipeline* gfxstream_pPipelines = (gfxstream_vk_pipeline*)vk_object_zalloc(
+ &gfxstream_device->vk, pAllocator, sizeof(gfxstream_vk_pipeline), VK_OBJECT_TYPE_PIPELINE);
+ vkCreateComputePipelines_VkResult_return =
+ gfxstream_pPipelines ? VK_SUCCESS : VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (VK_SUCCESS == vkCreateComputePipelines_VkResult_return) {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ std::vector<VkComputePipelineCreateInfo> internal_pCreateInfos(createInfoCount);
+ std::vector<VkPipelineShaderStageCreateInfo> internal_VkComputePipelineCreateInfo_stage(createInfoCount);
+ for (uint32_t i = 0; i < createInfoCount; ++i) {
+ internal_pCreateInfos[i] = pCreateInfos[i];
+ /* VkComputePipelineCreateInfo::stage */
+ {
+ internal_VkComputePipelineCreateInfo_stage[i] = internal_pCreateInfos[i].stage;
+ /* VkPipelineShaderStageCreateInfo::module */
+ if (internal_VkComputePipelineCreateInfo_stage[i].module) {
+ VK_FROM_HANDLE(gfxstream_vk_shader_module, gfxstream_module,
+ internal_VkComputePipelineCreateInfo_stage[i].module);
+ internal_VkComputePipelineCreateInfo_stage[i].module =
+ gfxstream_module->internal_object;
+ }
+ internal_pCreateInfos[i].stage = internal_VkComputePipelineCreateInfo_stage[i];
+ }
+ /* VkComputePipelineCreateInfo::layout */
+ VK_FROM_HANDLE(gfxstream_vk_pipeline_layout, gfxstream_layout,
+ internal_pCreateInfos[i].layout);
+ internal_pCreateInfos[i].layout = gfxstream_layout->internal_object;
+ /* VkComputePipelineCreateInfo::basePipelineHandle */
+ if (internal_pCreateInfos[i].basePipelineHandle) {
+ VK_FROM_HANDLE(gfxstream_vk_pipeline, gfxstream_basePipelineHandle,
+ internal_pCreateInfos[i].basePipelineHandle);
+ internal_pCreateInfos[i].basePipelineHandle =
+ gfxstream_basePipelineHandle->internal_object;
+ }
+ }
+ vkCreateComputePipelines_VkResult_return = vkEnc->vkCreateComputePipelines(
+ gfxstream_device->internal_object,
+ gfxstream_pipelineCache ? gfxstream_pipelineCache->internal_object : VK_NULL_HANDLE,
+ createInfoCount, internal_pCreateInfos.data(), pAllocator,
+ &gfxstream_pPipelines->internal_object, true /* do lock */);
+ }
+ *pPipelines = gfxstream_vk_pipeline_to_handle(gfxstream_pPipelines);
+ return vkCreateComputePipelines_VkResult_return;
+}
+
+struct DescriptorSetTransformStorage {
+ std::vector<std::vector<VkDescriptorImageInfo>> imageInfos;
+ std::vector<std::vector<VkDescriptorBufferInfo>> bufferInfos;
+ std::vector<std::vector<VkBufferView>> texelBuffers;
+};
+
+static std::vector<VkWriteDescriptorSet> transformDescriptorSetList(
+ const VkWriteDescriptorSet* pDescriptorSets,
+ uint32_t descriptorSetCount,
+ DescriptorSetTransformStorage& storage) {
+ std::vector<VkWriteDescriptorSet> outDescriptorSets(descriptorSetCount);
+ for (uint32_t i = 0; i < descriptorSetCount; ++i) {
+ const auto& srcDescriptorSet = pDescriptorSets[i];
+ const uint32_t descriptorCount = srcDescriptorSet.descriptorCount;
+
+ VkWriteDescriptorSet& outDescriptorSet = outDescriptorSets[i];
+ outDescriptorSet = srcDescriptorSet;
+
+ storage.imageInfos.push_back(std::vector<VkDescriptorImageInfo>());
+ storage.imageInfos[i].reserve(descriptorCount);
+ memset(&storage.imageInfos[i][0], 0, sizeof(VkDescriptorImageInfo) * descriptorCount);
+ for (uint32_t j = 0; j < descriptorCount; ++j) {
+ const auto* srcImageInfo = srcDescriptorSet.pImageInfo;
+ if (srcImageInfo) {
+ storage.imageInfos[i][j] = srcImageInfo[j];
+ storage.imageInfos[i][j].imageView = VK_NULL_HANDLE;
+ if (vk_descriptor_type_has_image_view(srcDescriptorSet.descriptorType) &&
+ srcImageInfo[j].imageView) {
+ VK_FROM_HANDLE(gfxstream_vk_image_view, gfxstreamImageView,
+ srcImageInfo[j].imageView);
+ storage.imageInfos[i][j].imageView = gfxstreamImageView->internal_object;
+ }
+ }
+ }
+ outDescriptorSet.pImageInfo = storage.imageInfos[i].data();
+
+ storage.bufferInfos.push_back(std::vector<VkDescriptorBufferInfo>());
+ storage.bufferInfos[i].reserve(descriptorCount);
+ memset(&storage.bufferInfos[i][0], 0, sizeof(VkDescriptorBufferInfo) * descriptorCount);
+ for (uint32_t j = 0; j < descriptorCount; ++j) {
+ const auto* srcBufferInfo = srcDescriptorSet.pBufferInfo;
+ if (srcBufferInfo) {
+ storage.bufferInfos[i][j] = srcBufferInfo[j];
+ storage.bufferInfos[i][j].buffer = VK_NULL_HANDLE;
+ if (vk_descriptor_type_has_descriptor_buffer(srcDescriptorSet.descriptorType) &&
+ srcBufferInfo[j].buffer) {
+ VK_FROM_HANDLE(gfxstream_vk_buffer, gfxstreamBuffer, srcBufferInfo[j].buffer);
+ storage.bufferInfos[i][j].buffer = gfxstreamBuffer->internal_object;
+ }
+ }
+ }
+ outDescriptorSet.pBufferInfo = storage.bufferInfos[i].data();
+
+ storage.texelBuffers.push_back(std::vector<VkBufferView>());
+ storage.texelBuffers[i].reserve(descriptorCount);
+ memset(&storage.texelBuffers[i][0], 0, sizeof(VkBufferView) * descriptorCount);
+ for (uint32_t j = 0; j < descriptorCount; ++j) {
+ const auto* srcBufferView = srcDescriptorSet.pTexelBufferView;
+ if (vk_descriptor_type_has_texel_buffer(srcDescriptorSet.descriptorType) &&
+ srcBufferView) {
+ VK_FROM_HANDLE(gfxstream_vk_buffer_view, gfxstreamBufferView, srcBufferView[j]);
+ storage.texelBuffers[i][j] =
+ gfxstreamBufferView->internal_object;
+ }
+ }
+ outDescriptorSet.pTexelBufferView = storage.texelBuffers[i].data();
+ }
+ return outDescriptorSets;
+}
+
+void gfxstream_vk_UpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount,
+ const VkWriteDescriptorSet* pDescriptorWrites,
+ uint32_t descriptorCopyCount,
+ const VkCopyDescriptorSet* pDescriptorCopies) {
+ AEMU_SCOPED_TRACE("vkUpdateDescriptorSets");
+ VK_FROM_HANDLE(gfxstream_vk_device, gfxstream_device, device);
+ {
+ auto vkEnc = gfxstream::vk::ResourceTracker::getThreadLocalEncoder();
+ DescriptorSetTransformStorage descriptorSetTransformStorage;
+ std::vector<VkWriteDescriptorSet> internal_pDescriptorWrites =
+ transformDescriptorSetList(pDescriptorWrites, descriptorWriteCount,
+ descriptorSetTransformStorage);
+ auto resources = gfxstream::vk::ResourceTracker::get();
+ resources->on_vkUpdateDescriptorSets(
+ vkEnc, gfxstream_device->internal_object, descriptorWriteCount,
+ internal_pDescriptorWrites.data(), descriptorCopyCount, pDescriptorCopies);
+ }
+}
+
+void gfxstream_vk_QueueCommitDescriptorSetUpdatesGOOGLE(
+ 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");
+ VK_FROM_HANDLE(gfxstream_vk_queue, gfxstream_queue, queue);
+ {
+ auto vkEnc =
+ gfxstream::vk::ResourceTracker::getQueueEncoder(gfxstream_queue->internal_object);
+ std::vector<VkDescriptorPool> internal_pDescriptorPools(descriptorPoolCount);
+ for (uint32_t i = 0; i < descriptorPoolCount; ++i) {
+ VK_FROM_HANDLE(gfxstream_vk_descriptor_pool, gfxstream_pDescriptorPools,
+ pDescriptorPools[i]);
+ internal_pDescriptorPools[i] = gfxstream_pDescriptorPools->internal_object;
+ }
+ std::vector<VkDescriptorSetLayout> internal_pSetLayouts(descriptorSetCount);
+ for (uint32_t i = 0; i < descriptorSetCount; ++i) {
+ VK_FROM_HANDLE(gfxstream_vk_descriptor_set_layout, gfxstream_pSetLayouts,
+ pSetLayouts[i]);
+ internal_pSetLayouts[i] = gfxstream_pSetLayouts->internal_object;
+ }
+ DescriptorSetTransformStorage descriptorSetTransformStorage;
+ std::vector<VkWriteDescriptorSet> internal_pPendingDescriptorWrites =
+ transformDescriptorSetList(pPendingDescriptorWrites, pendingDescriptorWriteCount,
+ descriptorSetTransformStorage);
+ vkEnc->vkQueueCommitDescriptorSetUpdatesGOOGLE(
+ gfxstream_queue->internal_object, descriptorPoolCount, internal_pDescriptorPools.data(),
+ descriptorSetCount, internal_pSetLayouts.data(), pDescriptorSetPoolIds,
+ pDescriptorSetWhichPool, pDescriptorSetPendingAllocation,
+ pDescriptorWriteStartingIndices, pendingDescriptorWriteCount,
+ internal_pPendingDescriptorWrites.data(), true /* do lock */);
+ }
+}
diff --git a/src/gfxstream/guest/vulkan/gfxstream_vk_fuchsia.cpp b/src/gfxstream/guest/vulkan/gfxstream_vk_fuchsia.cpp
new file mode 100644
index 00000000000..bfd220c65da
--- /dev/null
+++ b/src/gfxstream/guest/vulkan/gfxstream_vk_fuchsia.cpp
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2023 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#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"
+
+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) {
+ 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");
+ }
+}
+
+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();
+}
+
+} // namespace
+
+extern "C" __attribute__((visibility("default"))) void vk_icdInitializeOpenInNamespaceCallback(
+ PFN_vkOpenInNamespaceAddr callback) {
+ g_vulkan_connector = callback;
+ SetConnectToServiceFunction(&LocalConnectToServiceFunction);
+}
diff --git a/src/gfxstream/guest/vulkan/gfxstream_vk_wsi.cpp b/src/gfxstream/guest/vulkan/gfxstream_vk_wsi.cpp
new file mode 100644
index 00000000000..be212ac35fe
--- /dev/null
+++ b/src/gfxstream/guest/vulkan/gfxstream_vk_wsi.cpp
@@ -0,0 +1,47 @@
+// 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 "gfxstream_vk_entrypoints.h"
+#include "gfxstream_vk_private.h"
+#include "wsi_common.h"
+
+static VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
+gfxstream_vk_wsi_proc_addr(VkPhysicalDevice physicalDevice, const char* pName) {
+ VK_FROM_HANDLE(gfxstream_vk_physical_device, pdevice, physicalDevice);
+ return vk_instance_get_proc_addr_unchecked(&pdevice->instance->vk, pName);
+}
+
+VkResult gfxstream_vk_wsi_init(struct gfxstream_vk_physical_device* physical_device) {
+ VkResult result = (VkResult)0;
+
+ const struct wsi_device_options options = {.sw_device = false};
+ result = wsi_device_init(
+ &physical_device->wsi_device, gfxstream_vk_physical_device_to_handle(physical_device),
+ gfxstream_vk_wsi_proc_addr, &physical_device->instance->vk.alloc, -1, NULL, &options);
+ if (result != VK_SUCCESS) return result;
+
+ // Allow guest-side modifier code paths
+ physical_device->wsi_device.supports_modifiers = true;
+ // For DRM, uses the buffer-blit path for WSI images
+ physical_device->wsi_device.supports_scanout = false;
+
+ physical_device->vk.wsi_device = &physical_device->wsi_device;
+
+ return result;
+}
+
+void gfxstream_vk_wsi_finish(struct gfxstream_vk_physical_device* physical_device) {
+ physical_device->vk.wsi_device = NULL;
+ wsi_device_finish(&physical_device->wsi_device, &physical_device->instance->vk.alloc);
+}
diff --git a/src/gfxstream/guest/vulkan/meson.build b/src/gfxstream/guest/vulkan/meson.build
new file mode 100644
index 00000000000..efb35d61d4d
--- /dev/null
+++ b/src/gfxstream/guest/vulkan/meson.build
@@ -0,0 +1,43 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_vulkan_gfxstream = files(
+ 'gfxstream_vk_device.cpp',
+ 'gfxstream_vk_cmd.cpp',
+ 'gfxstream_vk_wsi.cpp'
+)
+
+lib_vulkan_gfxstream = shared_library(
+ 'vulkan_gfxstream',
+ files_lib_vulkan_gfxstream + files_lib_vulkan_enc + gfxstream_vk_entrypoints + gfxstream_guest_vk_autogen,
+ cpp_args: gfxstream_guest_args,
+ include_directories: [inc_vulkan_headers, inc_opengl_headers, inc_android_emu,
+ inc_android_compat, inc_opengl_system, inc_guest_iostream,
+ inc_opengl_codec, inc_vulkan_enc, inc_platform,
+ inc_goldfish_address_space, inc_system, inc_include, inc_src,
+ inc_platform, inc_codec_common],
+ link_with: [lib_android_compat, lib_emu_android_base, lib_stream,
+ libvulkan_wsi, lib_platform],
+ link_args: [vulkan_icd_link_args, ld_args_bsymbolic, ld_args_gc_sections],
+ link_depends: vulkan_icd_link_depends,
+ dependencies: [dependency('libdrm'), idep_vulkan_wsi_headers,
+ idep_vulkan_runtime_headers, idep_vulkan_runtime,
+ idep_vulkan_util_headers, idep_vulkan_wsi],
+ install: true,
+)
+
+gfxstream_icd = custom_target(
+ 'gfxstream_icd',
+ input : [vk_icd_gen, vk_api_xml],
+ output : 'gfxstream_icd.@0@.json'.format(host_machine.cpu()),
+ command : [
+ prog_python, '@INPUT0@',
+ '--api-version', '1.1', '--xml', '@INPUT1@',
+ '--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
+ 'libvulkan_gfxstream.so'),
+ '--out', '@OUTPUT@',
+ ],
+ build_by_default : true,
+ install_dir : with_vulkan_icd_dir,
+ install : true,
+)
diff --git a/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.cpp b/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.cpp
new file mode 100644
index 00000000000..0cb77949a6e
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.cpp
@@ -0,0 +1,298 @@
+/// 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(__ANDROID__) || defined(__linux__)
+#include <drm_fourcc.h>
+#define DRM_FORMAT_YVU420_ANDROID fourcc_code('9', '9', '9', '7')
+#endif
+
+#include <assert.h>
+
+#include "../OpenglSystemCommon/HostConnection.h"
+#include "vk_format_info.h"
+#include "vk_util.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;
+}
+
+VkResult getAndroidHardwareBufferPropertiesANDROID(
+ gfxstream::Gralloc* grallocHelper, const AHardwareBuffer* buffer,
+ VkAndroidHardwareBufferPropertiesANDROID* pProperties) {
+ VkAndroidHardwareBufferFormatPropertiesANDROID* ahbFormatProps =
+ vk_find_struct<VkAndroidHardwareBufferFormatPropertiesANDROID>(pProperties);
+
+ const auto format = grallocHelper->getFormat(buffer);
+ if (ahbFormatProps) {
+ switch (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 = 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(__ANDROID__) || defined(__linux__)
+ if (android_format_is_yuv(format)) {
+ uint32_t drmFormat = grallocHelper->getFormatDrmFourcc(buffer);
+ 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
+ ahbFormatProps->suggestedYcbcrModel = android_format_is_yuv(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(buffer);
+ if (!colorBufferHandle) {
+ return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+ }
+
+ pProperties->allocationSize = grallocHelper->getAllocatedSize(buffer);
+
+ return VK_SUCCESS;
+}
+
+// Based on Intel ANV implementation.
+VkResult getMemoryAndroidHardwareBufferANDROID(gfxstream::Gralloc* gralloc,
+ 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;
+
+ gralloc->acquire(*pBuffer);
+ return VK_SUCCESS;
+}
+
+VkResult importAndroidHardwareBuffer(gfxstream::Gralloc* grallocHelper,
+ const VkImportAndroidHardwareBufferInfoANDROID* info,
+ struct AHardwareBuffer** importOut) {
+ if (!info || !info->buffer) {
+ return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+ }
+
+ auto ahb = info->buffer;
+
+ uint32_t colorBufferHandle = grallocHelper->getHostHandle(ahb);
+ if (!colorBufferHandle) {
+ return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+ }
+
+ grallocHelper->acquire(ahb);
+
+ if (importOut) *importOut = ahb;
+
+ return VK_SUCCESS;
+}
+
+VkResult createAndroidHardwareBuffer(gfxstream::Gralloc* gralloc, 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* ahb = NULL;
+
+ if (gralloc->allocate(w, h, format, usage, &ahb) != 0) {
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ *out = ahb;
+
+ return VK_SUCCESS;
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.h b/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.h
new file mode 100644
index 00000000000..0389f096f46
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/AndroidHardwareBuffer.h
@@ -0,0 +1,53 @@
+/// 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 <vulkan/vulkan.h>
+
+#include "../OpenglSystemCommon/Gralloc.h"
+#include "HostVisibleMemoryVirtualization.h"
+
+// Structure similar to
+// https://github.com/mesa3d/mesa/blob/master/src/intel/vulkan/anv_android.c
+
+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(
+ gfxstream::Gralloc* grallocHelper, const AHardwareBuffer* buffer,
+ VkAndroidHardwareBufferPropertiesANDROID* pProperties);
+
+VkResult getMemoryAndroidHardwareBufferANDROID(gfxstream::Gralloc* grallocHelper,
+ struct AHardwareBuffer** pBuffer);
+
+VkResult importAndroidHardwareBuffer(gfxstream::Gralloc* grallocHelper,
+ const VkImportAndroidHardwareBufferInfoANDROID* info,
+ struct AHardwareBuffer** importOut);
+
+VkResult createAndroidHardwareBuffer(gfxstream::Gralloc* grallocHelper, 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/src/gfxstream/guest/vulkan_enc/CommandBufferStagingStream.cpp b/src/gfxstream/guest/vulkan_enc/CommandBufferStagingStream.cpp
new file mode 100644
index 00000000000..563aad4faae
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/CommandBufferStagingStream.cpp
@@ -0,0 +1,249 @@
+/*
+ * 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"
+
+#include <cutils/log.h>
+#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/src/gfxstream/guest/vulkan_enc/CommandBufferStagingStream.h b/src/gfxstream/guest/vulkan_enc/CommandBufferStagingStream.h
new file mode 100644
index 00000000000..45af8dc3adf
--- /dev/null
+++ b/src/gfxstream/guest/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 "gfxstream/guest/IOStream.h"
+
+namespace gfxstream {
+namespace vk {
+
+class CommandBufferStagingStream : public gfxstream::guest::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/src/gfxstream/guest/vulkan_enc/DescriptorSetVirtualization.cpp b/src/gfxstream/guest/vulkan_enc/DescriptorSetVirtualization.cpp
new file mode 100644
index 00000000000..d2389a4723c
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/DescriptorSetVirtualization.cpp
@@ -0,0 +1,521 @@
+// 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)) {
+ const VkWriteDescriptorSetInlineUniformBlock* descInlineUniformBlock =
+ static_cast<const VkWriteDescriptorSetInlineUniformBlock*>(write->pNext);
+ while (descInlineUniformBlock &&
+ descInlineUniformBlock->sType !=
+ VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK) {
+ descInlineUniformBlock = static_cast<const VkWriteDescriptorSetInlineUniformBlock*>(
+ descInlineUniformBlock->pNext);
+ }
+ if (!descInlineUniformBlock) {
+ ALOGE("%s: did not find inline uniform block\n", __func__);
+ return;
+ }
+ auto& entry = table[dstBinding][0];
+ entry.inlineUniformBlock = *descInlineUniformBlock;
+ entry.inlineUniformBlockBuffer.assign(
+ static_cast<const uint8_t*>(descInlineUniformBlock->pData),
+ static_cast<const uint8_t*>(descInlineUniformBlock->pData) +
+ descInlineUniformBlock->dataSize);
+ entry.type = DescriptorWriteType::InlineUniformBlock;
+ entry.descriptorType = descType;
+ entry.dstArrayElement = dstArrayElement;
+ } else if (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;
+ }
+}
+
+void doEmulatedDescriptorInlineUniformBlockFromTemplate(VkDescriptorType descType, uint32_t binding,
+ uint32_t dstArrayElement, uint32_t count,
+ const void* pData,
+ ReifiedDescriptorSet* set) {
+ DescriptorWriteTable& table = set->allWrites;
+ auto& entry = table[binding][0];
+ entry.dstArrayElement = dstArrayElement;
+ entry.inlineUniformBlockBuffer.assign(static_cast<const uint8_t*>(pData),
+ static_cast<const uint8_t*>(pData) + count);
+ entry.type = DescriptorWriteType::InlineUniformBlock;
+ 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/src/gfxstream/guest/vulkan_enc/DescriptorSetVirtualization.h b/src/gfxstream/guest/vulkan_enc/DescriptorSetVirtualization.h
new file mode 100644
index 00000000000..0491102b4b9
--- /dev/null
+++ b/src/gfxstream/guest/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 <vulkan/vulkan.h>
+
+#include <unordered_set>
+#include <vector>
+
+#include "aemu/base/containers/EntityManager.h"
+
+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 doEmulatedDescriptorInlineUniformBlockFromTemplate(VkDescriptorType descType, uint32_t binding,
+ uint32_t dstArrayElement, uint32_t count,
+ const void* pData,
+ 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/src/gfxstream/guest/vulkan_enc/HostVisibleMemoryVirtualization.cpp b/src/gfxstream/guest/vulkan_enc/HostVisibleMemoryVirtualization.cpp
new file mode 100644
index 00000000000..dcf9f6562db
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/HostVisibleMemoryVirtualization.cpp
@@ -0,0 +1,74 @@
+// 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 gfxstream::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<gfxstream::guest::SubAllocator>(blobMapping->asRawPtr(), mSize, 4096);
+}
+
+#if defined(__ANDROID__)
+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<gfxstream::guest::SubAllocator>(address, mSize, kLargestPageSize);
+}
+#endif // defined(__ANDROID__)
+
+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/src/gfxstream/guest/vulkan_enc/HostVisibleMemoryVirtualization.h b/src/gfxstream/guest/vulkan_enc/HostVisibleMemoryVirtualization.h
new file mode 100644
index 00000000000..92acd5e199a
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/HostVisibleMemoryVirtualization.h
@@ -0,0 +1,74 @@
+// 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<gfxstream::guest::SubAllocator>;
+
+class CoherentMemory {
+ public:
+ CoherentMemory(VirtGpuBlobMappingPtr blobMapping, uint64_t size, VkDevice device,
+ VkDeviceMemory memory);
+
+#if defined(__ANDROID__)
+ CoherentMemory(GoldfishAddressSpaceBlockPtr block, uint64_t gpuAddr, uint64_t size,
+ VkDevice device, VkDeviceMemory memory);
+#endif // defined(__ANDROID__)
+
+ ~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/src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp b/src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp
new file mode 100644
index 00000000000..eef58e6a08c
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp
@@ -0,0 +1,7344 @@
+// 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 "HostVisibleMemoryVirtualization.h"
+#include "Resources.h"
+#include "VkEncoder.h"
+#include "aemu/base/AlignedBuf.h"
+#include "gfxstream_vk_private.h"
+#include "goldfish_address_space.h"
+#include "goldfish_vk_private_defs.h"
+#include "util.h"
+#include "virtgpu_gfxstream_protocol.h"
+#include "vulkan/vulkan_core.h"
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+#include "vk_format_info.h"
+#endif
+#include <log/log.h>
+#include <stdlib.h>
+#include <vndk/hardware_buffer.h>
+
+#include <algorithm>
+#include <set>
+#include <string>
+#include <unordered_map>
+#include <unordered_set>
+
+#include "vk_struct_id.h"
+#include "vk_util.h"
+
+#if defined(__ANDROID__) || defined(__linux__) || defined(__APPLE__)
+
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+
+static inline int inline_memfd_create(const char* name, unsigned int flags) {
+#if defined(__ANDROID__)
+ return syscall(SYS_memfd_create, name, flags);
+#else
+ return -1;
+#endif
+}
+
+#define memfd_create inline_memfd_create
+#endif
+
+#ifndef VK_USE_PLATFORM_FUCHSIA
+void zx_handle_close(zx_handle_t) {}
+void zx_event_create(int, zx_handle_t*) {}
+#endif
+
+static constexpr uint32_t kDefaultApiVersion = VK_MAKE_VERSION(1, 1, 0);
+
+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(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;
+
+struct CommandBufferPendingDescriptorSets {
+ std::unordered_set<VkDescriptorSet> sets;
+};
+
+#define HANDLE_REGISTER_IMPL_IMPL(type) \
+ void ResourceTracker::register_##type(type obj) { \
+ AutoLock<RecursiveLock> lock(mLock); \
+ info_##type[obj] = type##_Info(); \
+ }
+
+#define HANDLE_UNREGISTER_IMPL_IMPL(type) \
+ void ResourceTracker::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)
+uint32_t getWaitSemaphoreCount(const VkSubmitInfo& pSubmit) { return pSubmit.waitSemaphoreCount; }
+
+uint32_t getWaitSemaphoreCount(const VkSubmitInfo2& pSubmit) {
+ return pSubmit.waitSemaphoreInfoCount;
+}
+
+uint32_t getCommandBufferCount(const VkSubmitInfo& pSubmit) { return pSubmit.commandBufferCount; }
+
+uint32_t getCommandBufferCount(const VkSubmitInfo2& pSubmit) {
+ return pSubmit.commandBufferInfoCount;
+}
+
+uint32_t getSignalSemaphoreCount(const VkSubmitInfo& pSubmit) {
+ return pSubmit.signalSemaphoreCount;
+}
+
+uint32_t getSignalSemaphoreCount(const VkSubmitInfo2& pSubmit) {
+ return pSubmit.signalSemaphoreInfoCount;
+}
+
+VkSemaphore getWaitSemaphore(const VkSubmitInfo& pSubmit, int i) {
+ return pSubmit.pWaitSemaphores[i];
+}
+
+VkSemaphore getWaitSemaphore(const VkSubmitInfo2& pSubmit, int i) {
+ return pSubmit.pWaitSemaphoreInfos[i].semaphore;
+}
+
+VkSemaphore getSignalSemaphore(const VkSubmitInfo& pSubmit, int i) {
+ return pSubmit.pSignalSemaphores[i];
+}
+
+VkSemaphore getSignalSemaphore(const VkSubmitInfo2& pSubmit, int i) {
+ return pSubmit.pSignalSemaphoreInfos[i].semaphore;
+}
+
+VkCommandBuffer getCommandBuffer(const VkSubmitInfo& pSubmit, int i) {
+ return pSubmit.pCommandBuffers[i];
+}
+
+VkCommandBuffer getCommandBuffer(const VkSubmitInfo2& pSubmit, int i) {
+ return pSubmit.pCommandBufferInfos[i].commandBuffer;
+}
+
+bool descriptorPoolSupportsIndividualFreeLocked(VkDescriptorPool pool) {
+ return as_goldfish_VkDescriptorPool(pool)->allocInfo->createFlags &
+ VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
+}
+
+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 ResourceTracker::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 ResourceTracker::emitDeviceMemoryReport(VkDevice_Info info,
+ VkDeviceMemoryReportEventTypeEXT type,
+ uint64_t memoryObjectId, VkDeviceSize size,
+ VkObjectType objectType, uint64_t objectHandle,
+ uint32_t heapIndex) {
+ 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);
+ }
+}
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+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 ResourceTracker::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 */);
+ ALOGD(
+ "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;
+}
+
+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};
+}
+#endif
+
+uint64_t getAHardwareBufferId(AHardwareBuffer* ahw) {
+ uint64_t id = 0;
+#if defined(__ANDROID__) && ANDROID_API_LEVEL >= 31
+ AHardwareBuffer_getId(ahw, &id);
+#else
+ (void)ahw;
+#endif
+ return id;
+}
+
+void transformExternalResourceMemoryDedicatedRequirementsForGuest(
+ VkMemoryDedicatedRequirements* dedicatedReqs) {
+ dedicatedReqs->prefersDedicatedAllocation = VK_TRUE;
+ dedicatedReqs->requiresDedicatedAllocation = VK_TRUE;
+}
+
+void ResourceTracker::transformImageMemoryRequirementsForGuestLocked(VkImage image,
+ VkMemoryRequirements* reqs) {
+#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;
+ reqs->size = width * height * 4;
+ }
+#elif defined(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ auto it = info_VkImage.find(image);
+ if (it == info_VkImage.end()) return;
+ auto& info = it->second;
+ if (info.isWsiImage) {
+ static const uint32_t kColorBufferBpp = 4;
+ reqs->size = kColorBufferBpp * info.createInfo.extent.width * info.createInfo.extent.height;
+ }
+#else
+ // Bypass "unused parameter" checks.
+ (void)image;
+ (void)reqs;
+#endif
+}
+
+CoherentMemoryPtr ResourceTracker::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;
+}
+
+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;
+}
+
+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;
+ }
+}
+
+uint32_t ResourceTracker::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;
+}
+
+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 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 ResourceTracker::ensureSyncDeviceFd() {
+#if GFXSTREAM_ENABLE_GUEST_GOLDFISH
+ 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
+}
+
+void ResourceTracker::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 ResourceTracker::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 ResourceTracker::unregister_VkCommandPool(VkCommandPool pool) {
+ if (!pool) return;
+
+ clearCommandPool(pool);
+
+ AutoLock<RecursiveLock> lock(mLock);
+ info_VkCommandPool.erase(pool);
+}
+
+void ResourceTracker::unregister_VkSampler(VkSampler sampler) {
+ if (!sampler) return;
+
+ AutoLock<RecursiveLock> lock(mLock);
+ info_VkSampler.erase(sampler);
+}
+
+void ResourceTracker::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 ResourceTracker::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 ResourceTracker::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) {
+ auto* gralloc =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->grallocHelper();
+ gralloc->release(memInfo.ahw);
+ }
+#endif
+
+ if (memInfo.vmoHandle != ZX_HANDLE_INVALID) {
+ zx_handle_close(memInfo.vmoHandle);
+ }
+
+ info_VkDeviceMemory.erase(mem);
+}
+
+void ResourceTracker::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 ResourceTracker::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 ResourceTracker::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) {
+ auto* syncHelper =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+ syncHelper->close(semInfo.syncFd.value());
+ }
+#endif
+
+ info_VkSemaphore.erase(sem);
+}
+
+void ResourceTracker::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 ResourceTracker::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) {
+ auto* syncHelper =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+ syncHelper->close(fenceInfo.syncFd);
+ }
+#endif
+
+ info_VkFence.erase(fence);
+}
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+void ResourceTracker::unregister_VkBufferCollectionFUCHSIA(VkBufferCollectionFUCHSIA collection) {
+ AutoLock<RecursiveLock> lock(mLock);
+ info_VkBufferCollectionFUCHSIA.erase(collection);
+}
+#endif
+
+void ResourceTracker::unregister_VkDescriptorSet_locked(VkDescriptorSet set) {
+ struct goldfish_VkDescriptorSet* ds = as_goldfish_VkDescriptorSet(set);
+ delete ds->reified;
+ info_VkDescriptorSet.erase(set);
+}
+
+void ResourceTracker::unregister_VkDescriptorSet(VkDescriptorSet set) {
+ if (!set) return;
+
+ AutoLock<RecursiveLock> lock(mLock);
+ unregister_VkDescriptorSet_locked(set);
+}
+
+void ResourceTracker::unregister_VkDescriptorSetLayout(VkDescriptorSetLayout setLayout) {
+ if (!setLayout) return;
+
+ AutoLock<RecursiveLock> lock(mLock);
+ delete as_goldfish_VkDescriptorSetLayout(setLayout)->layoutInfo;
+ info_VkDescriptorSetLayout.erase(setLayout);
+}
+
+void ResourceTracker::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 ResourceTracker::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 ResourceTracker::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);
+}
+
+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) {
+ (void)memory;
+ (void)memoryCount;
+ (void)offset;
+ (void)offsetCount;
+ (void)size;
+ (void)sizeCount;
+ (void)typeIndex;
+ (void)typeIndexCount;
+ (void)typeBits;
+ (void)typeBitsCount;
+}
+
+void ResourceTracker::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;
+ }
+}
+
+void ResourceTracker::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 ResourceTracker::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 ResourceTracker::setDeviceMemoryInfo(VkDevice device, VkDeviceMemory memory,
+ VkDeviceSize allocationSize, uint8_t* ptr,
+ uint32_t memoryTypeIndex, AHardwareBuffer* ahw,
+ bool imported, zx_handle_t vmoHandle,
+ VirtGpuBlobPtr blobPtr) {
+ 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;
+ info.blobPtr = blobPtr;
+}
+
+void ResourceTracker::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* ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::setupCaps(uint32_t& noRenderControlEnc) {
+ VirtGpuDevice* instance = VirtGpuDevice::getInstance(kCapsetGfxStreamVulkan);
+ mCaps = instance->getCaps();
+
+ // Delete once goldfish Linux drivers are gone
+ if (mCaps.vulkanCapset.protocolVersion == 0) {
+ mCaps.vulkanCapset.colorBufferMemoryIndex = 0xFFFFFFFF;
+ } else {
+ // Don't query the render control encoder for features, since for virtio-gpu the
+ // capabilities provide versioning. Set features to be unconditionally true, since
+ // using virtio-gpu encompasses all prior goldfish features. mFeatureInfo should be
+ // deprecated in favor of caps.
+
+ mFeatureInfo.reset(new EmulatorFeatureInfo);
+
+ mFeatureInfo->hasVulkanNullOptionalStrings = true;
+ mFeatureInfo->hasVulkanIgnoredHandles = true;
+ mFeatureInfo->hasVulkanShaderFloat16Int8 = true;
+ mFeatureInfo->hasVulkanQueueSubmitWithCommands = true;
+ mFeatureInfo->hasDeferredVulkanCommands = true;
+ mFeatureInfo->hasVulkanAsyncQueueSubmit = true;
+ mFeatureInfo->hasVulkanCreateResourcesWithRequirements = true;
+ mFeatureInfo->hasVirtioGpuNext = true;
+ mFeatureInfo->hasVirtioGpuNativeSync = true;
+ mFeatureInfo->hasVulkanBatchedDescriptorSetUpdate = true;
+ mFeatureInfo->hasVulkanAsyncQsri = true;
+
+ ResourceTracker::streamFeatureBits |= VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT;
+ ResourceTracker::streamFeatureBits |= VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT;
+ ResourceTracker::streamFeatureBits |= VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT;
+ ResourceTracker::streamFeatureBits |= VULKAN_STREAM_FEATURE_QUEUE_SUBMIT_WITH_COMMANDS_BIT;
+ }
+
+ noRenderControlEnc = mCaps.vulkanCapset.noRenderControlEnc;
+}
+
+void ResourceTracker::setupFeatures(const EmulatorFeatureInfo* features) {
+ if (!features || mFeatureInfo) return;
+ mFeatureInfo.reset(new EmulatorFeatureInfo);
+ *mFeatureInfo = *features;
+
+#if defined(__ANDROID__)
+ if (mFeatureInfo->hasDirectMem) {
+ mGoldfishAddressSpaceBlockProvider.reset(
+ new GoldfishAddressSpaceBlockProvider(GoldfishAddressSpaceSubdeviceType::NoSubdevice));
+ }
+#endif // defined(__ANDROID__)
+
+#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 ResourceTracker::setThreadingCallbacks(const ResourceTracker::ThreadingCallbacks& callbacks) {
+ ResourceTracker::threadingCallbacks = callbacks;
+}
+
+bool ResourceTracker::hostSupportsVulkan() const {
+ if (!mFeatureInfo) return false;
+
+ return mFeatureInfo->hasVulkan;
+}
+
+bool ResourceTracker::usingDirectMapping() const { return true; }
+
+uint32_t ResourceTracker::getStreamFeatures() const { return ResourceTracker::streamFeatureBits; }
+
+bool ResourceTracker::supportsDeferredCommands() const {
+ if (!mFeatureInfo) return false;
+ return mFeatureInfo->hasDeferredVulkanCommands;
+}
+
+bool ResourceTracker::supportsAsyncQueueSubmit() const {
+ if (!mFeatureInfo) return false;
+ return mFeatureInfo->hasVulkanAsyncQueueSubmit;
+}
+
+bool ResourceTracker::supportsCreateResourcesWithRequirements() const {
+ if (!mFeatureInfo) return false;
+ return mFeatureInfo->hasVulkanCreateResourcesWithRequirements;
+}
+
+int ResourceTracker::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 ResourceTracker::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 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) {
+ (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;
+ }
+ }
+}
+
+uint32_t ResourceTracker::getColorBufferMemoryIndex(void* context, VkDevice device) {
+ // Create test image to get the memory requirements
+ VkEncoder* enc = (VkEncoder*)context;
+ VkImageCreateInfo createInfo = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
+ .imageType = VK_IMAGE_TYPE_2D,
+ .format = VK_FORMAT_R8G8B8A8_UNORM,
+ .extent = {64, 64, 1},
+ .mipLevels = 1,
+ .arrayLayers = 1,
+ .samples = VK_SAMPLE_COUNT_1_BIT,
+ .tiling = VK_IMAGE_TILING_OPTIMAL,
+ .usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT |
+ VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
+ VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT,
+ .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
+ };
+ VkImage image = VK_NULL_HANDLE;
+ VkResult res = enc->vkCreateImage(device, &createInfo, nullptr, &image, true /* do lock */);
+
+ if (res != VK_SUCCESS) {
+ return 0;
+ }
+
+ VkMemoryRequirements memReqs;
+ enc->vkGetImageMemoryRequirements(device, image, &memReqs, true /* do lock */);
+ enc->vkDestroyImage(device, image, nullptr, true /* do lock */);
+
+ const VkPhysicalDeviceMemoryProperties& memProps =
+ getPhysicalDeviceMemoryProperties(context, device, VK_NULL_HANDLE);
+
+ // Currently, host looks for the last index that has with memory
+ // property type VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
+ VkMemoryPropertyFlags memoryProperty = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+ for (int i = VK_MAX_MEMORY_TYPES - 1; i >= 0; --i) {
+ if ((memReqs.memoryTypeBits & (1u << i)) &&
+ (memProps.memoryTypes[i].propertyFlags & memoryProperty)) {
+ return i;
+ }
+ }
+
+ return 0;
+}
+
+VkResult ResourceTracker::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",
+ "VK_EXT_debug_utils",
+#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 ResourceTracker::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",
+ "VK_EXT_scalar_block_layout",
+ "VK_KHR_descriptor_update_template",
+ "VK_KHR_storage_buffer_storage_class",
+ "VK_EXT_depth_clip_enable",
+ "VK_KHR_create_renderpass2",
+#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(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ "VK_KHR_imageless_framebuffer",
+#endif
+ // Vulkan 1.3
+ "VK_KHR_synchronization2",
+ "VK_EXT_private_data",
+ };
+
+ 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;
+ }
+ }
+
+ 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__)
+ bool hostHasPosixExternalSemaphore =
+ getHostDeviceExtensionIndex("VK_KHR_external_semaphore_fd") != -1;
+ if (!hostHasPosixExternalSemaphore) {
+ // Always advertise posix external semaphore capabilities on Android/Linux.
+ // SYNC_FD handles will always work, regardless of host support. Support
+ // for non-sync, opaque FDs, depends on host driver support, but will
+ // be handled accordingly by host.
+ 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 qnxExtMemAvailable =
+ getHostDeviceExtensionIndex("VK_QNX_external_memory_screen_buffer") != -1;
+
+ bool hostHasExternalMemorySupport =
+ win32ExtMemAvailable || posixExtMemAvailable || moltenVkExtAvailable || qnxExtMemAvailable;
+
+ 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
+ }
+
+ // NOTE: the Vulkan Loader's trampoline functions will remove duplicates. This can lead
+ // to lead errors if this function returns VK_SUCCESS with N elements (including a duplicate)
+ // but the Vulkan Loader's trampoline function returns VK_INCOMPLETE with N-1 elements
+ // (without the duplicate).
+ std::sort(filteredExts.begin(),
+ filteredExts.end(),
+ [](const VkExtensionProperties& a,
+ const VkExtensionProperties& b) {
+ return strcmp(a.extensionName, b.extensionName) < 0;
+ });
+ filteredExts.erase(std::unique(filteredExts.begin(),
+ filteredExts.end(),
+ [](const VkExtensionProperties& a,
+ const VkExtensionProperties& b) {
+ return strcmp(a.extensionName, b.extensionName) == 0;
+ }),
+ filteredExts.end());
+
+ // 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 ResourceTracker::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 ResourceTracker::on_vkGetPhysicalDeviceProperties(void*, VkPhysicalDevice,
+ VkPhysicalDeviceProperties* pProperties) {
+#if defined(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ if (pProperties) {
+ if (VK_PHYSICAL_DEVICE_TYPE_CPU == pProperties->deviceType) {
+ /* For Linux guest: Even if host driver reports DEVICE_TYPE_CPU,
+ * override this to VIRTUAL_GPU, otherwise Linux DRM interfaces
+ * will take unexpected code paths to deal with "software" driver
+ */
+ pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU;
+ }
+ }
+#endif
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceFeatures2(void*, VkPhysicalDevice,
+ VkPhysicalDeviceFeatures2* pFeatures) {
+ if (pFeatures) {
+ VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* memoryReportFeaturesEXT =
+ vk_find_struct<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT>(pFeatures);
+ if (memoryReportFeaturesEXT) {
+ memoryReportFeaturesEXT->deviceMemoryReport = VK_TRUE;
+ }
+ }
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceFeatures2KHR(void* context,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures2* pFeatures) {
+ on_vkGetPhysicalDeviceFeatures2(context, physicalDevice, pFeatures);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceProperties2(void* context,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceProperties2* pProperties) {
+ if (pProperties) {
+ VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* memoryReportFeaturesEXT =
+ vk_find_struct<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT>(pProperties);
+ if (memoryReportFeaturesEXT) {
+ memoryReportFeaturesEXT->deviceMemoryReport = VK_TRUE;
+ }
+ on_vkGetPhysicalDeviceProperties(context, physicalDevice, &pProperties->properties);
+ }
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceProperties2KHR(
+ void* context, VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) {
+ on_vkGetPhysicalDeviceProperties2(context, physicalDevice, pProperties);
+}
+
+void ResourceTracker::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 ResourceTracker::on_vkGetPhysicalDeviceMemoryProperties2(
+ void*, VkPhysicalDevice physdev, VkPhysicalDeviceMemoryProperties2* out) {
+ on_vkGetPhysicalDeviceMemoryProperties(nullptr, physdev, &out->memoryProperties);
+}
+
+void ResourceTracker::on_vkGetDeviceQueue(void*, VkDevice device, uint32_t, uint32_t,
+ VkQueue* pQueue) {
+ AutoLock<RecursiveLock> lock(mLock);
+ info_VkQueue[*pQueue].device = device;
+}
+
+void ResourceTracker::on_vkGetDeviceQueue2(void*, VkDevice device, const VkDeviceQueueInfo2*,
+ VkQueue* pQueue) {
+ AutoLock<RecursiveLock> lock(mLock);
+ info_VkQueue[*pQueue].device = device;
+}
+
+VkResult ResourceTracker::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 ResourceTracker::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 ResourceTracker::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++;
+ }
+ }
+}
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+void updateMemoryTypeBits(uint32_t* memoryTypeBits, uint32_t memoryIndex) {
+ *memoryTypeBits = 1u << memoryIndex;
+}
+#endif
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+
+VkResult ResourceTracker::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.vulkanCapset.colorBufferMemoryIndex == 0xFFFFFFFF) {
+ mCaps.vulkanCapset.colorBufferMemoryIndex = getColorBufferMemoryIndex(context, device);
+ }
+
+ updateMemoryTypeBits(&pProperties->memoryTypeBits, mCaps.vulkanCapset.colorBufferMemoryIndex);
+
+ return getAndroidHardwareBufferPropertiesANDROID(grallocHelper, buffer, pProperties);
+}
+
+VkResult ResourceTracker::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;
+
+ auto* gralloc = ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->grallocHelper();
+ VkResult queryRes = getMemoryAndroidHardwareBufferANDROID(gralloc, &info.ahw);
+
+ if (queryRes != VK_SUCCESS) return queryRes;
+
+ *pBuffer = info.ahw;
+
+ return queryRes;
+}
+#endif
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VkResult ResourceTracker::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 ResourceTracker::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 a 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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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);
+}
+
+SetBufferCollectionImageConstraintsResult ResourceTracker::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 ResourceTracker::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 =
+ gfxstream::guest::makeOptional(std::move(setConstraintsResult.constraints));
+ info_VkBufferCollectionFUCHSIA[buffer_collection].createInfoIndex =
+ std::move(setConstraintsResult.createInfoIndex);
+ }
+
+ return VK_SUCCESS;
+}
+
+VkResult ResourceTracker::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 =
+ gfxstream::guest::makeOptional(setConstraintsResult.constraints);
+ }
+
+ return VK_SUCCESS;
+}
+
+VkResult ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 =
+ gfxstream::guest::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
+
+static uint32_t getVirglFormat(VkFormat vkFormat) {
+ uint32_t virglFormat = 0;
+
+ switch (vkFormat) {
+ 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:
+ virglFormat = VIRGL_FORMAT_R8G8B8A8_UNORM;
+ break;
+ 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:
+ virglFormat = VIRGL_FORMAT_B8G8R8A8_UNORM;
+ break;
+ default:
+ break;
+ }
+
+ return virglFormat;
+}
+
+CoherentMemoryPtr ResourceTracker::createCoherentMemory(
+ VkDevice device, VkDeviceMemory mem, const VkMemoryAllocateInfo& hostAllocationInfo,
+ VkEncoder* enc, VkResult& res) {
+ CoherentMemoryPtr coherentMemory = nullptr;
+
+#if defined(__ANDROID__)
+ if (mFeatureInfo->hasDirectMem) {
+ uint64_t gpuAddr = 0;
+ GoldfishAddressSpaceBlockPtr block = nullptr;
+ res = enc->vkMapMemoryIntoAddressSpaceGOOGLE(device, mem, &gpuAddr, true);
+ if (res != VK_SUCCESS) {
+ ALOGE(
+ "Failed to create coherent memory: vkMapMemoryIntoAddressSpaceGOOGLE "
+ "returned:%d.",
+ res);
+ return coherentMemory;
+ }
+ {
+ AutoLock<RecursiveLock> lock(mLock);
+ auto it = info_VkDeviceMemory.find(mem);
+ if (it == info_VkDeviceMemory.end()) {
+ ALOGE("Failed to create coherent memory: failed to find device memory.");
+ 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
+#endif // defined(__ANDROID__)
+ 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) {
+ ALOGE(
+ "Failed to create coherent memory: vkMapMemoryIntoAddressSpaceGOOGLE "
+ "returned:%d.",
+ res);
+ 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) {
+ ALOGE("Failed to create coherent memory: failed to create blob.");
+ res = VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ return coherentMemory;
+ }
+
+ VirtGpuBlobMappingPtr mapping = blob->createMapping();
+ if (!mapping) {
+ ALOGE("Failed to create coherent memory: failed to create blob 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 ResourceTracker::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.vulkanCapset.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.vulkanCapset.deferredMapping || mCaps.params[kParamCreateGuestHandle]) {
+ hostAllocationInfo.allocationSize =
+ ALIGN(pAllocateInfo->allocationSize, mCaps.vulkanCapset.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) {
+ ALOGE("Failed to allocate coherent memory: failed to create blob.");
+ 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.get())) {
+ ALOGE("Failed to allocate coherent memory: failed to execbuffer for wait.");
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ guestBlob->wait();
+ } else if (mCaps.vulkanCapset.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) {
+ ALOGE("Failed to allocate coherent memory: failed to allocate on the host: %d.", host_res);
+ return host_res;
+ }
+
+ struct VkDeviceMemory_Info info;
+ if (mCaps.vulkanCapset.deferredMapping || mCaps.params[kParamCreateGuestHandle]) {
+ info.allocationSize = pAllocateInfo->allocationSize;
+ info.blobId = createBlobInfo.blobId;
+ }
+
+ if (guestBlob) {
+ auto mapping = guestBlob->createMapping();
+ if (!mapping) {
+ ALOGE("Failed to allocate coherent memory: failed to create blob 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.vulkanCapset.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 ResourceTracker::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.vulkanCapset.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);
+}
+
+VkResult ResourceTracker::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
+
+#if defined(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ const VkImportMemoryFdInfoKHR* importFdInfoPtr =
+ vk_find_struct<VkImportMemoryFdInfoKHR>(pAllocateInfo);
+#else
+ const VkImportMemoryFdInfoKHR* importFdInfoPtr = 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 exportDmabuf = false;
+ bool importAhb = false;
+ bool importBufferCollection = false;
+ bool importVmo = false;
+ bool importDmabuf = 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
+ exportDmabuf =
+ exportAllocateInfoPtr->handleTypes & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT);
+ } else if (importAhbInfoPtr) {
+ importAhb = true;
+ } else if (importBufferCollectionInfoPtr) {
+ importBufferCollection = true;
+ } else if (importVmoInfoPtr) {
+ importVmo = true;
+ }
+
+ if (importFdInfoPtr) {
+ importDmabuf =
+ (importFdInfoPtr->handleType & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT));
+ }
+ bool isImport = importAhb || importBufferCollection || importVmo || importDmabuf;
+
+#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(
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->grallocHelper(),
+ 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) {
+ auto* gralloc =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->grallocHelper();
+
+ const uint32_t hostHandle = gralloc->getHostHandle(ahw);
+ if (gralloc->getFormat(ahw) == AHARDWAREBUFFER_FORMAT_BLOB &&
+ !gralloc->treatBlobAsImage()) {
+ 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
+
+ VirtGpuBlobPtr colorBufferBlob = nullptr;
+#if defined(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ if (exportDmabuf) {
+ VirtGpuDevice* instance = VirtGpuDevice::getInstance();
+ // // TODO: any special action for VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA? Can mark
+ // special state if needed.
+ // // const wsi_memory_allocate_info* wsiAllocateInfoPtr =
+ // vk_find_struct<wsi_memory_allocate_info>(pAllocateInfo);
+ bool hasDedicatedImage =
+ dedicatedAllocInfoPtr && (dedicatedAllocInfoPtr->image != VK_NULL_HANDLE);
+ bool hasDedicatedBuffer =
+ dedicatedAllocInfoPtr && (dedicatedAllocInfoPtr->buffer != VK_NULL_HANDLE);
+ if (!hasDedicatedImage && !hasDedicatedBuffer) {
+ ALOGE(
+ "%s: dma-buf exportable memory requires dedicated Image or Buffer information.\n");
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+ if (hasDedicatedImage) {
+ VkImageCreateInfo imageCreateInfo;
+ {
+ 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;
+
+ imageCreateInfo = imageInfo.createInfo;
+ }
+ uint32_t virglFormat = gfxstream::vk::getVirglFormat(imageCreateInfo.format);
+ if (virglFormat < 0) {
+ ALOGE("%s: Unsupported VK format for colorBuffer, vkFormat: 0x%x", __func__,
+ imageCreateInfo.format);
+ return VK_ERROR_FORMAT_NOT_SUPPORTED;
+ }
+ colorBufferBlob = instance->createVirglBlob(imageCreateInfo.extent.width,
+ imageCreateInfo.extent.height, virglFormat);
+ if (!colorBufferBlob) {
+ ALOGE("%s: Failed to create colorBuffer resource for Image memory\n", __func__);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ if (0 != colorBufferBlob->wait()) {
+ ALOGE("%s: Failed to wait for colorBuffer resource for Image memory\n", __func__);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ }
+
+ if (hasDedicatedBuffer) {
+ VkBufferCreateInfo bufferCreateInfo;
+ {
+ 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;
+ bufferCreateInfo = bufferInfo.createInfo;
+ }
+ colorBufferBlob = instance->createVirglBlob(bufferCreateInfo.size / 4, 1,
+ VIRGL_FORMAT_R8G8B8A8_UNORM);
+ if (!colorBufferBlob) {
+ ALOGE("%s: Failed to create colorBuffer resource for Buffer memory\n", __func__);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ if (0 != colorBufferBlob->wait()) {
+ ALOGE("%s: Failed to wait for colorBuffer resource for Buffer memory\n", __func__);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ }
+ }
+
+ if (importDmabuf) {
+ VirtGpuExternalHandle importHandle = {};
+ importHandle.osHandle = importFdInfoPtr->fd;
+ importHandle.type = kMemHandleDmabuf;
+
+ auto instance = VirtGpuDevice::getInstance();
+ colorBufferBlob = instance->importBlob(importHandle);
+ if (!colorBufferBlob) {
+ ALOGE("%s: Failed to import colorBuffer resource\n", __func__);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ }
+
+ if (colorBufferBlob) {
+ importCbInfo.colorBuffer = colorBufferBlob->getResourceHandle();
+ vk_append_struct(&structChainIter, &importCbInfo);
+ }
+#endif
+
+ if (ahw || colorBufferBlob || !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, colorBufferBlob);
+
+ _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, /*blobPtr=*/nullptr);
+ 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;
+}
+
+void ResourceTracker::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 ResourceTracker::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 ResourceTracker::on_vkUnmapMemory(void*, VkDevice, VkDeviceMemory) {
+ // no-op
+}
+
+void ResourceTracker::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) {
+ transformImageMemoryRequirementsForGuestLocked(image, &reqs2->memoryRequirements);
+ return;
+ }
+
+ transformImageMemoryRequirementsForGuestLocked(image, &reqs2->memoryRequirements);
+
+ VkMemoryDedicatedRequirements* dedicatedReqs =
+ vk_find_struct<VkMemoryDedicatedRequirements>(reqs2);
+
+ if (!dedicatedReqs) return;
+
+ transformExternalResourceMemoryDedicatedRequirementsForGuest(dedicatedReqs);
+}
+
+void ResourceTracker::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 ResourceTracker::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);
+ if (localCreateInfo.sharingMode != VK_SHARING_MODE_CONCURRENT) {
+ localCreateInfo.queueFamilyIndexCount = 0;
+ localCreateInfo.pQueueFamilyIndices = nullptr;
+ }
+
+ 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);
+ }
+
+ bool isWsiImage = false;
+
+#if defined(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ if (extImgCiPtr &&
+ (extImgCiPtr->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT)) {
+ // Assumes that handleType with DMA_BUF_BIT indicates creation of a
+ // image for WSI use; no other external dma_buf usage is supported
+ isWsiImage = true;
+ // Must be linear. Otherwise querying stride and other properties
+ // can be implementation-dependent.
+ localCreateInfo.tiling = VK_IMAGE_TILING_LINEAR;
+ if (gfxstream::vk::getVirglFormat(localCreateInfo.format) < 0) {
+ localCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM;
+ }
+ }
+#endif
+
+#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
+
+ info.isWsiImage = isWsiImage;
+
+// Delete `protocolVersion` check goldfish drivers are gone.
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+ if (mCaps.vulkanCapset.colorBufferMemoryIndex == 0xFFFFFFFF) {
+ mCaps.vulkanCapset.colorBufferMemoryIndex = getColorBufferMemoryIndex(context, device);
+ }
+ if (isWsiImage ||
+ (extImgCiPtr && (extImgCiPtr->handleTypes &
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID))) {
+ updateMemoryTypeBits(&memReqs.memoryTypeBits, mCaps.vulkanCapset.colorBufferMemoryIndex);
+ }
+#endif
+
+ if (info.baseRequirementsKnown) {
+ transformImageMemoryRequirementsForGuestLocked(*pImage, &memReqs);
+ info.baseRequirements = memReqs;
+ }
+ return res;
+}
+
+VkResult ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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;
+#endif
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceExternalFencePropertiesKHR(
+ void* context, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
+ VkExternalFenceProperties* pExternalFenceProperties) {
+ 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) {
+ 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 ResourceTracker::on_vkDestroyFence(void* context, VkDevice device, VkFence fence,
+ const VkAllocationCallbacks* pAllocator) {
+ VkEncoder* enc = (VkEncoder*)context;
+ enc->vkDestroyFence(device, fence, pAllocator, true /* do lock */);
+}
+
+VkResult ResourceTracker::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 GFXSTREAM_ENABLE_GUEST_GOLDFISH
+ if (info.syncFd >= 0) {
+ ALOGV("%s: resetting fence. make fd -1\n", __func__);
+ goldfish_sync_signal(info.syncFd);
+ auto* syncHelper =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+ syncHelper->close(info.syncFd);
+ info.syncFd = -1;
+ }
+#endif
+ }
+
+ return res;
+}
+
+VkResult ResourceTracker::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;
+
+ auto* syncHelper = ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+#if GFXSTREAM_ENABLE_GUEST_GOLDFISH
+ if (info.syncFd >= 0) {
+ ALOGV("%s: previous sync fd exists, close it\n", __func__);
+ goldfish_sync_signal(info.syncFd);
+ syncHelper->close(info.syncFd);
+ }
+#endif
+
+ 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 = syncHelper->dup(pImportFenceFdInfo->fd);
+ syncHelper->close(pImportFenceFdInfo->fd);
+ }
+ return VK_SUCCESS;
+#else
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+#endif
+}
+
+VkResult ResourceTracker::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 {
+#if GFXSTREAM_ENABLE_GUEST_GOLDFISH
+ 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);
+#endif
+ }
+
+ // 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 ResourceTracker::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] {
+ auto* syncHelper =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+ syncHelper->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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::on_vkAllocateDescriptorSets(
+ void* context, VkResult, VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo,
+ VkDescriptorSet* pDescriptorSets) {
+ VkEncoder* enc = (VkEncoder*)context;
+ auto ci = pAllocateInfo;
+ auto sets = pDescriptorSets;
+ 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 {
+ 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;
+}
+
+VkResult ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::on_vkDestroyImage(void* context, VkDevice device, VkImage image,
+ const VkAllocationCallbacks* pAllocator) {
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+ auto* syncHelper = ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+ {
+ 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 = syncHelper->wait(syncFd, 3000);
+ if (syncWaitRet < 0) {
+ ALOGE("%s: Failed to wait for pending QSRI sync: sterror: %s errno: %d",
+ __func__, strerror(errno), errno);
+ }
+ syncHelper->close(syncFd);
+ }
+ imageInfo.pendingQsriSyncFds.clear();
+ }
+ }
+#endif
+ VkEncoder* enc = (VkEncoder*)context;
+ enc->vkDestroyImage(device, image, pAllocator, true /* do lock */);
+}
+
+void ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::on_vkBindImageMemory2(void* context, VkResult, VkDevice device,
+ uint32_t bindingCount,
+ const VkBindImageMemoryInfo* pBindInfos) {
+ VkEncoder* enc = (VkEncoder*)context;
+
+ if (bindingCount < 1 || !pBindInfos) {
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+ for (uint32_t i = 0; i < bindingCount; i++) {
+ const VkBindImageMemoryInfo& bimi = pBindInfos[i];
+
+ auto imageIt = info_VkImage.find(bimi.image);
+ if (imageIt == info_VkImage.end()) {
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+ if (bimi.memory != VK_NULL_HANDLE) {
+ auto memoryIt = info_VkDeviceMemory.find(bimi.memory);
+ if (memoryIt == info_VkDeviceMemory.end()) {
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ }
+ }
+
+ return enc->vkBindImageMemory2(device, bindingCount, pBindInfos, true /* do lock */);
+}
+
+VkResult ResourceTracker::on_vkBindImageMemory2KHR(void* context, VkResult result, VkDevice device,
+ uint32_t bindingCount,
+ const VkBindImageMemoryInfo* pBindInfos) {
+ return on_vkBindImageMemory2(context, result, device, bindingCount, pBindInfos);
+}
+
+VkResult ResourceTracker::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);
+ }
+
+ VkBufferOpaqueCaptureAddressCreateInfo localCapAddrCi;
+ const VkBufferOpaqueCaptureAddressCreateInfo* pCapAddrCi =
+ vk_find_struct<VkBufferOpaqueCaptureAddressCreateInfo>(pCreateInfo);
+ if (pCapAddrCi) {
+ localCapAddrCi = vk_make_orphan_copy(*pCapAddrCi);
+ vk_append_struct(&structChainIter, &localCapAddrCi);
+ }
+
+ VkBufferDeviceAddressCreateInfoEXT localDevAddrCi;
+ const VkBufferDeviceAddressCreateInfoEXT* pDevAddrCi =
+ vk_find_struct<VkBufferDeviceAddressCreateInfoEXT>(pCreateInfo);
+ if (pDevAddrCi) {
+ localDevAddrCi = vk_make_orphan_copy(*pDevAddrCi);
+ vk_append_struct(&structChainIter, &localDevAddrCi);
+ }
+
+#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 = gfxstream::guest::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;
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__)
+ if (mCaps.vulkanCapset.colorBufferMemoryIndex == 0xFFFFFFFF) {
+ mCaps.vulkanCapset.colorBufferMemoryIndex = getColorBufferMemoryIndex(context, device);
+ }
+ if (extBufCiPtr &&
+ ((extBufCiPtr->handleTypes &
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) ||
+ (extBufCiPtr->handleTypes & VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT))) {
+ updateMemoryTypeBits(&memReqs.memoryTypeBits, mCaps.vulkanCapset.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 ResourceTracker::on_vkDestroyBuffer(void* context, VkDevice device, VkBuffer buffer,
+ const VkAllocationCallbacks* pAllocator) {
+ VkEncoder* enc = (VkEncoder*)context;
+ enc->vkDestroyBuffer(device, buffer, pAllocator, true /* do lock */);
+}
+
+void ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 */);
+}
+
+VkResult ResourceTracker::on_vkCreateSemaphore(void* context, VkResult input_result,
+ VkDevice device,
+ const VkSemaphoreCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkSemaphore* pSemaphore) {
+ (void)input_result;
+ 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 {
+#if GFXSTREAM_ENABLE_GUEST_GOLDFISH
+ 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
+ }
+ }
+#endif
+
+ return VK_SUCCESS;
+}
+
+void ResourceTracker::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 ResourceTracker::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.
+ auto* syncHelper =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+ *pFd = syncHelper->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 ResourceTracker::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;
+ }
+
+ auto* syncHelper = ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+
+ 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) {
+ syncHelper->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 */);
+ syncHelper->close(fd);
+ return result;
+ }
+#else
+ (void)context;
+ (void)input_result;
+ (void)device;
+ (void)pImportSemaphoreFdInfo;
+ return VK_ERROR_INCOMPATIBLE_DRIVER;
+#endif
+}
+
+VkResult ResourceTracker::on_vkGetMemoryFdKHR(void* context, VkResult, VkDevice device,
+ const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd) {
+#if defined(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ if (!pGetFdInfo) return VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (!pGetFdInfo->memory) return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+ if (!(pGetFdInfo->handleType & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT))) {
+ ALOGE("%s: Export operation not defined for handleType: 0x%x\n", __func__,
+ pGetFdInfo->handleType);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ // Sanity-check device
+ AutoLock<RecursiveLock> lock(mLock);
+ auto deviceIt = info_VkDevice.find(device);
+ if (deviceIt == info_VkDevice.end()) {
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ auto deviceMemIt = info_VkDeviceMemory.find(pGetFdInfo->memory);
+ if (deviceMemIt == info_VkDeviceMemory.end()) {
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ auto& info = deviceMemIt->second;
+
+ if (!info.blobPtr) {
+ ALOGE("%s: VkDeviceMemory does not have a resource available for export.\n", __func__);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ VirtGpuExternalHandle handle{};
+ int ret = info.blobPtr->exportBlob(handle);
+ if (ret != 0 || handle.osHandle < 0) {
+ ALOGE("%s: Failed to export host resource to FD.\n", __func__);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ *pFd = handle.osHandle;
+ return VK_SUCCESS;
+#else
+ (void)context;
+ (void)device;
+ (void)pGetFdInfo;
+ (void)pFd;
+ return VK_ERROR_INCOMPATIBLE_DRIVER;
+#endif
+}
+
+void ResourceTracker::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();
+ }
+}
+
+uint32_t ResourceTracker::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;
+}
+
+template <class VkSubmitInfoType>
+void ResourceTracker::flushStagingStreams(void* context, VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfoType* pSubmits) {
+ std::vector<VkCommandBuffer> toFlush;
+ for (uint32_t i = 0; i < submitCount; ++i) {
+ for (uint32_t j = 0; j < getCommandBufferCount(pSubmits[i]); ++j) {
+ toFlush.push_back(getCommandBuffer(pSubmits[i], j));
+ }
+ }
+
+ std::unordered_set<VkDescriptorSet> pendingSets;
+ collectAllPendingDescriptorSetsBottomUp(toFlush, pendingSets);
+ commitDescriptorSetUpdates(context, queue, pendingSets);
+
+ flushCommandBufferPendingCommandsBottomUp(context, queue, toFlush);
+
+ for (auto cb : toFlush) {
+ resetCommandBufferPendingTopology(cb);
+ }
+}
+
+VkResult ResourceTracker::on_vkQueueSubmit(void* context, VkResult input_result, VkQueue queue,
+ uint32_t submitCount, const VkSubmitInfo* pSubmits,
+ VkFence fence) {
+ AEMU_SCOPED_TRACE("on_vkQueueSubmit");
+ return on_vkQueueSubmitTemplate<VkSubmitInfo>(context, input_result, queue, submitCount,
+ pSubmits, fence);
+}
+
+VkResult ResourceTracker::on_vkQueueSubmit2(void* context, VkResult input_result, VkQueue queue,
+ uint32_t submitCount, const VkSubmitInfo2* pSubmits,
+ VkFence fence) {
+ AEMU_SCOPED_TRACE("on_vkQueueSubmit2");
+ return on_vkQueueSubmitTemplate<VkSubmitInfo2>(context, input_result, queue, submitCount,
+ pSubmits, fence);
+}
+
+VkResult ResourceTracker::vkQueueSubmitEnc(VkEncoder* enc, VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfo* pSubmits, VkFence fence) {
+ if (supportsAsyncQueueSubmit()) {
+ enc->vkQueueSubmitAsyncGOOGLE(queue, submitCount, pSubmits, fence, true /* do lock */);
+ return VK_SUCCESS;
+ } else {
+ return enc->vkQueueSubmit(queue, submitCount, pSubmits, fence, true /* do lock */);
+ }
+}
+
+VkResult ResourceTracker::vkQueueSubmitEnc(VkEncoder* enc, VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfo2* pSubmits, VkFence fence) {
+ if (supportsAsyncQueueSubmit()) {
+ enc->vkQueueSubmitAsync2GOOGLE(queue, submitCount, pSubmits, fence, true /* do lock */);
+ return VK_SUCCESS;
+ } else {
+ return enc->vkQueueSubmit2(queue, submitCount, pSubmits, fence, true /* do lock */);
+ }
+}
+
+template <typename VkSubmitInfoType>
+VkResult ResourceTracker::on_vkQueueSubmitTemplate(void* context, VkResult input_result,
+ VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfoType* pSubmits,
+ VkFence fence) {
+ 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 < getWaitSemaphoreCount(pSubmits[i]); ++j) {
+ VkSemaphore semaphore = getWaitSemaphore(pSubmits[i], j);
+ auto it = info_VkSemaphore.find(semaphore);
+ 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(semaphore);
+ }
+#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(semaphore);
+ }
+#endif
+ }
+ }
+ for (uint32_t j = 0; j < getSignalSemaphoreCount(pSubmits[i]); ++j) {
+ auto it = info_VkSemaphore.find(getSignalSemaphore(pSubmits[i], 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()) {
+ input_result = vkQueueSubmitEnc(enc, queue, submitCount, pSubmits, fence);
+ 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] {
+ auto* syncHelper =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+ syncHelper->wait(fd, 3000);
+ });
+ }
+ }
+#endif
+ if (!preSignalTasks.empty()) {
+ auto waitGroupHandle = mWorkPool.schedule(preSignalTasks);
+ mWorkPool.waitAll(waitGroupHandle);
+ }
+
+ // Use the old version of VkSubmitInfo
+ 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()};
+ vkQueueSubmitEnc(enc, queue, 1, &submit_info, VK_NULL_HANDLE);
+ input_result = vkQueueSubmitEnc(enc, queue, submitCount, pSubmits, fence);
+ 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 GFXSTREAM_ENABLE_GUEST_GOLDFISH
+ 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 ResourceTracker::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 ResourceTracker::unwrap_VkNativeBufferANDROID(const VkNativeBufferANDROID* inputNativeInfo,
+ VkNativeBufferANDROID* outputNativeInfo) {
+ if (!inputNativeInfo || !inputNativeInfo->handle) {
+ return;
+ }
+
+ if (!outputNativeInfo || !outputNativeInfo) {
+ ALOGE("FATAL: Local native buffer info not properly allocated!");
+ abort();
+ }
+
+ auto* gralloc = ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->grallocHelper();
+ const native_handle_t* nativeHandle = (const native_handle_t*)inputNativeInfo->handle;
+
+#if defined(END2END_TESTS)
+ // This is valid since the testing backend creates the handle and we know the layout.
+ *(uint32_t*)(outputNativeInfo->handle) = (uint32_t)nativeHandle->data[0];
+#else
+ *(uint32_t*)(outputNativeInfo->handle) = gralloc->getHostHandle(nativeHandle);
+#endif
+}
+
+void ResourceTracker::unwrap_VkBindImageMemorySwapchainInfoKHR(
+ const VkBindImageMemorySwapchainInfoKHR* inputBimsi,
+ VkBindImageMemorySwapchainInfoKHR* outputBimsi) {
+ if (!inputBimsi || !inputBimsi->swapchain) {
+ return;
+ }
+
+ if (!outputBimsi || !outputBimsi->swapchain) {
+ return;
+ }
+
+ // Android based swapchains are implemented by the Android framework's
+ // libvulkan. The only exist within the guest and should not be sent to
+ // the host.
+ outputBimsi->swapchain = VK_NULL_HANDLE;
+}
+#endif
+
+void ResourceTracker::unwrap_vkCreateImage_pCreateInfo(const VkImageCreateInfo* pCreateInfo,
+ VkImageCreateInfo* local_pCreateInfo) {
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+ const VkNativeBufferANDROID* inputNativeInfo =
+ vk_find_struct<VkNativeBufferANDROID>(pCreateInfo);
+
+ VkNativeBufferANDROID* outputNativeInfo = const_cast<VkNativeBufferANDROID*>(
+ vk_find_struct<VkNativeBufferANDROID>(local_pCreateInfo));
+
+ unwrap_VkNativeBufferANDROID(inputNativeInfo, outputNativeInfo);
+#endif
+}
+
+void ResourceTracker::unwrap_vkAcquireImageANDROID_nativeFenceFd(int fd, int* fd_out) {
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+ (void)fd_out;
+ if (fd != -1) {
+ AEMU_SCOPED_TRACE("waitNativeFenceInAcquire");
+ // Implicit Synchronization
+ auto* syncHelper =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+ syncHelper->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
+ syncHelper->close(fd);
+ }
+#endif
+}
+
+void ResourceTracker::unwrap_VkBindImageMemory2_pBindInfos(
+ uint32_t bindInfoCount, const VkBindImageMemoryInfo* inputBindInfos,
+ VkBindImageMemoryInfo* outputBindInfos) {
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+ for (uint32_t i = 0; i < bindInfoCount; ++i) {
+ const VkBindImageMemoryInfo* inputBindInfo = &inputBindInfos[i];
+ VkBindImageMemoryInfo* outputBindInfo = &outputBindInfos[i];
+
+ const VkNativeBufferANDROID* inputNativeInfo =
+ vk_find_struct<VkNativeBufferANDROID>(inputBindInfo);
+
+ VkNativeBufferANDROID* outputNativeInfo = const_cast<VkNativeBufferANDROID*>(
+ vk_find_struct<VkNativeBufferANDROID>(outputBindInfo));
+
+ unwrap_VkNativeBufferANDROID(inputNativeInfo, outputNativeInfo);
+
+ const VkBindImageMemorySwapchainInfoKHR* inputBimsi =
+ vk_find_struct<VkBindImageMemorySwapchainInfoKHR>(inputBindInfo);
+
+ VkBindImageMemorySwapchainInfoKHR* outputBimsi =
+ const_cast<VkBindImageMemorySwapchainInfoKHR*>(
+ vk_find_struct<VkBindImageMemorySwapchainInfoKHR>(outputBindInfo));
+
+ unwrap_VkBindImageMemorySwapchainInfoKHR(inputBimsi, outputBimsi);
+ }
+#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 ResourceTracker::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;
+ }
+
+#if defined(__ANDROID__)
+ 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;
+#else
+ (void)pAddress;
+ return VK_ERROR_MEMORY_MAP_FAILED;
+#endif
+}
+
+VkResult ResourceTracker::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 ResourceTracker::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;
+ uint32_t inlineUniformBlockBufferSize = 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.templateEntryCount;
+ if (isDescriptorTypeInlineUniformBlock(descType)) {
+ inlineUniformBlockBufferSize += descCount;
+ ++info.inlineUniformBlockCount;
+ } else {
+ 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];
+ }
+
+ if (info.inlineUniformBlockCount) {
+ info.inlineUniformBlockBuffer.resize(inlineUniformBlockBufferSize);
+ info.inlineUniformBlockBytesPerBlocks.resize(info.inlineUniformBlockCount);
+ }
+
+ uint32_t imageInfoIndex = 0;
+ uint32_t bufferInfoIndex = 0;
+ uint32_t bufferViewIndex = 0;
+ uint32_t inlineUniformBlockIndex = 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;
+
+ if (isDescriptorTypeInlineUniformBlock(descType)) {
+ info.inlineUniformBlockBytesPerBlocks[inlineUniformBlockIndex] = descCount;
+ ++inlineUniformBlockIndex;
+ } else {
+ 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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 inlineUniformBlockCount = info.inlineUniformBlockCount;
+ 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;
+ uint8_t* inlineUniformBlockBuffer = info.inlineUniformBlockBuffer.data();
+ uint32_t* inlineUniformBlockBytesPerBlocks = info.inlineUniformBlockBytesPerBlocks.data();
+
+ lock.unlock();
+
+ size_t currImageInfoOffset = 0;
+ size_t currBufferInfoOffset = 0;
+ size_t currBufferViewOffset = 0;
+ size_t inlineUniformBlockOffset = 0;
+ size_t inlineUniformBlockIdx = 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));
+#if defined(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ // Convert mesa to internal for objects in the user buffer
+ VkDescriptorImageInfo* internalImageInfo =
+ (VkDescriptorImageInfo*)(((uint8_t*)imageInfos) + currImageInfoOffset);
+ VK_FROM_HANDLE(gfxstream_vk_image_view, gfxstream_image_view,
+ internalImageInfo->imageView);
+ internalImageInfo->imageView = gfxstream_image_view->internal_object;
+#endif
+ 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));
+#if defined(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ // Convert mesa to internal for objects in the user buffer
+ VkDescriptorBufferInfo* internalBufferInfo =
+ (VkDescriptorBufferInfo*)(((uint8_t*)bufferInfos) + currBufferInfoOffset);
+ VK_FROM_HANDLE(gfxstream_vk_buffer, gfxstream_buffer, internalBufferInfo->buffer);
+ internalBufferInfo->buffer = gfxstream_buffer->internal_object;
+#endif
+ 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));
+#if defined(__linux__) && !defined(VK_USE_PLATFORM_ANDROID_KHR)
+ // Convert mesa to internal for objects in the user buffer
+ VkBufferView* internalBufferView =
+ (VkBufferView*)(((uint8_t*)bufferViews) + currBufferViewOffset);
+ VK_FROM_HANDLE(gfxstream_vk_buffer_view, gfxstream_buffer_view,
+ *internalBufferView);
+ *internalBufferView = gfxstream_buffer_view->internal_object;
+#endif
+
+ currBufferViewOffset += sizeof(VkBufferView);
+ }
+
+ if (batched) {
+ doEmulatedDescriptorBufferViewWriteFromTemplate(
+ descType, dstBinding, dstArrayElement, descCount, currBufferViewBegin, reified);
+ }
+ } else if (isDescriptorTypeInlineUniformBlock(descType)) {
+ uint32_t inlineUniformBlockBytesPerBlock =
+ inlineUniformBlockBytesPerBlocks[inlineUniformBlockIdx];
+ uint8_t* currInlineUniformBlockBufferBegin =
+ inlineUniformBlockBuffer + inlineUniformBlockOffset;
+ memcpy(currInlineUniformBlockBufferBegin, userBuffer + offset,
+ inlineUniformBlockBytesPerBlock);
+ inlineUniformBlockIdx++;
+ inlineUniformBlockOffset += inlineUniformBlockBytesPerBlock;
+
+ if (batched) {
+ doEmulatedDescriptorInlineUniformBlockFromTemplate(
+ descType, dstBinding, dstArrayElement, descCount,
+ currInlineUniformBlockBufferBegin, reified);
+ }
+ } else {
+ ALOGE("%s: FATAL: Unknown descriptor type %d\n", __func__, descType);
+ abort();
+ }
+ }
+
+ if (batched) return;
+
+ enc->vkUpdateDescriptorSetWithTemplateSized2GOOGLE(
+ device, descriptorSet, descriptorUpdateTemplate, imageInfoCount, bufferInfoCount,
+ bufferViewCount, static_cast<uint32_t>(info.inlineUniformBlockBuffer.size()),
+ imageInfoIndices, bufferInfoIndices, bufferViewIndices, imageInfos, bufferInfos,
+ bufferViews, inlineUniformBlockBuffer, true /* do lock */);
+}
+
+VkResult ResourceTracker::on_vkGetPhysicalDeviceImageFormatProperties2_common(
+ bool isKhr, void* context, VkResult input_result, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+ VkImageFormatProperties2* pImageFormatProperties) {
+ VkEncoder* enc = (VkEncoder*)context;
+ (void)input_result;
+
+ uint32_t supportedHandleType = 0;
+ VkExternalImageFormatProperties* ext_img_properties =
+ vk_find_struct<VkExternalImageFormatProperties>(pImageFormatProperties);
+
+#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,
+ };
+
+ if (ext_img_properties) {
+ if (std::find(std::begin(kExternalImageSupportedFormats),
+ std::end(kExternalImageSupportedFormats),
+ pImageFormatInfo->format) == std::end(kExternalImageSupportedFormats)) {
+ return VK_ERROR_FORMAT_NOT_SUPPORTED;
+ }
+ }
+ supportedHandleType |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA;
+#endif
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+ VkAndroidHardwareBufferUsageANDROID* output_ahw_usage =
+ vk_find_struct<VkAndroidHardwareBufferUsageANDROID>(pImageFormatProperties);
+ supportedHandleType |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
+#endif
+ const VkPhysicalDeviceExternalImageFormatInfo* ext_img_info =
+ vk_find_struct<VkPhysicalDeviceExternalImageFormatInfo>(pImageFormatInfo);
+ if (supportedHandleType && ext_img_info) {
+ // 0 is a valid handleType so we don't check against 0
+ if (ext_img_info->handleType != (ext_img_info->handleType & supportedHandleType)) {
+ return VK_ERROR_FORMAT_NOT_SUPPORTED;
+ }
+ }
+
+ 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) {
+ 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
+ if (ext_img_properties) {
+ transformImpl_VkExternalMemoryProperties_fromhost(
+ &ext_img_properties->externalMemoryProperties, 0);
+ }
+ return hostRes;
+}
+
+VkResult ResourceTracker::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 ResourceTracker::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 ResourceTracker::on_vkGetPhysicalDeviceExternalBufferProperties_common(
+ bool isKhr, void* context, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+ VkExternalBufferProperties* pExternalBufferProperties) {
+ VkEncoder* enc = (VkEncoder*)context;
+
+ // Older versions of Goldfish's Gralloc did not support allocating AHARDWAREBUFFER_FORMAT_BLOB
+ // with GPU usage (b/299520213).
+ if (ResourceTracker::threadingCallbacks.hostConnectionGetFunc()
+ ->grallocHelper()
+ ->treatBlobAsImage() &&
+ pExternalBufferInfo->handleType ==
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) {
+ pExternalBufferProperties->externalMemoryProperties.externalMemoryFeatures = 0;
+ pExternalBufferProperties->externalMemoryProperties.exportFromImportedHandleTypes = 0;
+ pExternalBufferProperties->externalMemoryProperties.compatibleHandleTypes = 0;
+ return;
+ }
+
+ uint32_t supportedHandleType = 0;
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ supportedHandleType |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA;
+#endif
+#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
+ if (supportedHandleType) {
+ // 0 is a valid handleType so we can't check against 0
+ if (pExternalBufferInfo->handleType !=
+ (pExternalBufferInfo->handleType & supportedHandleType)) {
+ return;
+ }
+ }
+
+ if (isKhr) {
+ enc->vkGetPhysicalDeviceExternalBufferPropertiesKHR(
+ physicalDevice, pExternalBufferInfo, pExternalBufferProperties, true /* do lock */);
+ } else {
+ enc->vkGetPhysicalDeviceExternalBufferProperties(
+ physicalDevice, pExternalBufferInfo, pExternalBufferProperties, true /* do lock */);
+ }
+ transformImpl_VkExternalMemoryProperties_fromhost(
+ &pExternalBufferProperties->externalMemoryProperties, 0);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceExternalBufferProperties(
+ void* context, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+ VkExternalBufferProperties* pExternalBufferProperties) {
+ return on_vkGetPhysicalDeviceExternalBufferProperties_common(
+ false /* not KHR */, context, physicalDevice, pExternalBufferInfo,
+ pExternalBufferProperties);
+}
+
+void ResourceTracker::on_vkGetPhysicalDeviceExternalBufferPropertiesKHR(
+ void* context, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo,
+ VkExternalBufferPropertiesKHR* pExternalBufferProperties) {
+ return on_vkGetPhysicalDeviceExternalBufferProperties_common(
+ true /* is KHR */, context, physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
+}
+
+void ResourceTracker::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
+ const VkSemaphoreTypeCreateInfo* semaphoreTypeCi =
+ vk_find_struct<VkSemaphoreTypeCreateInfo>(pExternalSemaphoreInfo);
+ bool isSemaphoreTimeline =
+ semaphoreTypeCi != nullptr && semaphoreTypeCi->semaphoreType == VK_SEMAPHORE_TYPE_TIMELINE;
+ if (isSemaphoreTimeline) {
+ // b/304373623
+ // dEQP-VK.api.external.semaphore.sync_fd#info_timeline
+ pExternalSemaphoreProperties->compatibleHandleTypes = 0;
+ pExternalSemaphoreProperties->exportFromImportedHandleTypes = 0;
+ pExternalSemaphoreProperties->externalSemaphoreFeatures = 0;
+ } 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 ResourceTracker::on_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+ void* context, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+ VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
+ on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+ context, physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
+}
+
+void ResourceTracker::registerEncoderCleanupCallback(const VkEncoder* encoder, void* object,
+ CleanupCallback callback) {
+ AutoLock<RecursiveLock> lock(mLock);
+ auto& callbacks = mEncoderCleanupCallbacks[encoder];
+ callbacks[object] = callback;
+}
+
+void ResourceTracker::unregisterEncoderCleanupCallback(const VkEncoder* encoder, void* object) {
+ AutoLock<RecursiveLock> lock(mLock);
+ mEncoderCleanupCallbacks[encoder].erase(object);
+}
+
+void ResourceTracker::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();
+ }
+}
+
+CommandBufferStagingStream::Alloc ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 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) {
+ 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 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) {
+ 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 ResourceTracker::on_vkDestroyDescriptorSetLayout(void* context, VkDevice device,
+ VkDescriptorSetLayout descriptorSetLayout,
+ const VkAllocationCallbacks* pAllocator) {
+ decDescriptorSetLayoutRef(context, device, descriptorSetLayout, pAllocator);
+}
+
+VkResult ResourceTracker::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 ResourceTracker::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 {
+#if GFXSTREAM_ENABLE_GUEST_GOLDFISH
+ ensureSyncDeviceFd();
+ goldfish_sync_queue_work(
+ mSyncDeviceFd, get_host_u64_VkImage(image) /* the handle */,
+ GOLDFISH_SYNC_VULKAN_QSRI /* thread handle (doubling as type field) */, fd);
+#endif
+ }
+
+ ALOGV("%s: got fd: %d\n", __func__, *fd);
+ auto imageInfoIt = info_VkImage.find(image);
+ if (imageInfoIt != info_VkImage.end()) {
+ auto& imageInfo = imageInfoIt->second;
+
+ auto* syncHelper =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+
+ // 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 = syncHelper->wait(syncFd, /*timeout msecs*/ 0);
+ if (syncWaitRet == 0) {
+ // Sync fd is signaled.
+ syncFdIt = imageInfo.pendingQsriSyncFds.erase(syncFdIt);
+ syncHelper->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 = syncHelper->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 ResourceTracker::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) {
+ auto* syncHelper =
+ ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->syncHelper();
+ syncHelper->close(syncFd);
+ }
+ }
+
+ return result;
+}
+#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) {
+ (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;
+ }
+
+ bool forceDepthStencilState = false;
+ bool forceColorBlendState = false;
+
+ const VkPipelineRenderingCreateInfo* pipelineRenderingInfo =
+ vk_find_struct<VkPipelineRenderingCreateInfo>(&graphicsPipelineCreateInfo);
+
+ if (pipelineRenderingInfo) {
+ forceDepthStencilState |=
+ pipelineRenderingInfo->depthAttachmentFormat != VK_FORMAT_UNDEFINED;
+ forceDepthStencilState |=
+ pipelineRenderingInfo->stencilAttachmentFormat != VK_FORMAT_UNDEFINED;
+ forceColorBlendState |= pipelineRenderingInfo->colorAttachmentCount != 0;
+ }
+
+ // VUID-VkGraphicsPipelineCreateInfo-renderPass-06043
+ // VUID-VkGraphicsPipelineCreateInfo-renderPass-06044
+ if (graphicsPipelineCreateInfo.renderPass == VK_NULL_HANDLE ||
+ !shouldIncludeFragmentShaderState) {
+ // VUID-VkGraphicsPipelineCreateInfo-renderPass-06053
+ if (!forceDepthStencilState) {
+ graphicsPipelineCreateInfo.pDepthStencilState = nullptr;
+ }
+ if (!forceColorBlendState) {
+ graphicsPipelineCreateInfo.pColorBlendState = nullptr;
+ }
+ }
+ }
+ return enc->vkCreateGraphicsPipelines(device, pipelineCache, localCreateInfos.size(),
+ localCreateInfos.data(), pAllocator, pPipelines,
+ true /* do lock */);
+}
+
+uint32_t ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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);
+}
+
+// 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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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 ResourceTracker::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);
+}
+
+const VkPhysicalDeviceMemoryProperties& ResourceTracker::getPhysicalDeviceMemoryProperties(
+ void* context, VkDevice device, VkPhysicalDevice physicalDevice) {
+ 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;
+}
+
+static ResourceTracker* sTracker = nullptr;
+
+ResourceTracker::ResourceTracker() {
+ mCreateMapping = new CreateMapping();
+ mDestroyMapping = new DestroyMapping();
+ // nothing to do
+}
+
+ResourceTracker::~ResourceTracker() {
+ delete mCreateMapping;
+ delete mDestroyMapping;
+}
+
+VulkanHandleMapping* ResourceTracker::createMapping() { return mCreateMapping; }
+
+VulkanHandleMapping* ResourceTracker::destroyMapping() { return mDestroyMapping; }
+
+// static
+ResourceTracker* ResourceTracker::get() {
+ if (!sTracker) {
+ // To be initialized once on vulkan device open.
+ sTracker = new ResourceTracker;
+ }
+ return sTracker;
+}
+
+// static
+ALWAYS_INLINE_GFXSTREAM 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_GFXSTREAM 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_GFXSTREAM 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_GFXSTREAM uint32_t ResourceTracker::nextSeqno() {
+ uint32_t res = __atomic_add_fetch(sSeqnoPtr, 1, __ATOMIC_SEQ_CST);
+ return res;
+}
+
+// static
+ALWAYS_INLINE_GFXSTREAM uint32_t ResourceTracker::getSeqno() {
+ uint32_t res = __atomic_load_n(sSeqnoPtr, __ATOMIC_SEQ_CST);
+ return res;
+}
+
+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/src/gfxstream/guest/vulkan_enc/ResourceTracker.h b/src/gfxstream/guest/vulkan_enc/ResourceTracker.h
new file mode 100644
index 00000000000..8173579640e
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/ResourceTracker.h
@@ -0,0 +1,904 @@
+// 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 <atomic>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <set>
+#include <unordered_map>
+
+#include "CommandBufferStagingStream.h"
+#include "HostVisibleMemoryVirtualization.h"
+#include "VirtGpu.h"
+#include "VulkanHandleMapping.h"
+#include "VulkanHandles.h"
+#include "aemu/base/Optional.h"
+#include "aemu/base/Tracing.h"
+#include "aemu/base/synchronization/AndroidLock.h"
+#include "aemu/base/threads/AndroidWorkPool.h"
+#include "goldfish_vk_transform_guest.h"
+
+using gfxstream::guest::AutoLock;
+using gfxstream::guest::Lock;
+using gfxstream::guest::Optional;
+using gfxstream::guest::RecursiveLock;
+using gfxstream::guest::WorkPool;
+
+/// 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 <zircon/errors.h>
+#include <zircon/process.h>
+#include <zircon/rights.h>
+#include <zircon/syscalls.h>
+#include <zircon/syscalls/object.h>
+
+#include <optional>
+
+#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)
+
+struct SetBufferCollectionImageConstraintsResult {
+ VkResult result;
+ fuchsia_sysmem::wire::BufferCollectionConstraints constraints;
+ std::vector<uint32_t> createInfoIndex;
+};
+
+struct SetBufferCollectionBufferConstraintsResult {
+ VkResult result;
+ fuchsia_sysmem::wire::BufferCollectionConstraints constraints;
+};
+
+#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)
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+/// Use installed headers or locally defined Android-specific bits
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+#include "AndroidHardwareBuffer.h"
+#endif
+
+#if defined(__linux__)
+#include <android/hardware_buffer.h>
+#endif
+
+#if GFXSTREAM_ENABLE_GUEST_GOLDFISH
+/// Goldfish sync only used for AEMU -- should replace in virtio-gpu when possibe
+#include "../egl/goldfish_sync.h"
+#endif
+
+struct EmulatorFeatureInfo;
+
+class HostConnection;
+
+namespace gfxstream {
+namespace vk {
+
+class VkEncoder;
+
+class ResourceTracker {
+ public:
+ ResourceTracker();
+ ~ResourceTracker();
+ static ResourceTracker* get();
+
+ VulkanHandleMapping* createMapping();
+ VulkanHandleMapping* destroyMapping();
+
+ using HostConnectionGetFunc = HostConnection* (*)();
+ using VkEncoderGetFunc = VkEncoder* (*)(HostConnection*);
+ using CleanupCallback = std::function<void()>;
+
+ struct ThreadingCallbacks {
+ HostConnectionGetFunc hostConnectionGetFunc = nullptr;
+ VkEncoderGetFunc vkEncoderGetFunc = nullptr;
+ };
+
+ 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_vkQueueSubmit2(void* context, VkResult input_result, VkQueue queue,
+ uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence);
+
+ VkResult on_vkQueueWaitIdle(void* context, VkResult input_result, VkQueue queue);
+
+ void unwrap_vkCreateImage_pCreateInfo(const VkImageCreateInfo* pCreateInfo,
+ VkImageCreateInfo* local_pCreateInfo);
+
+ void unwrap_vkAcquireImageANDROID_nativeFenceFd(int fd, int* fd_out);
+
+ void unwrap_VkBindImageMemory2_pBindInfos(uint32_t bindInfoCount,
+ const VkBindImageMemoryInfo* inputBindInfos,
+ VkBindImageMemoryInfo* outputBindInfos);
+
+ VkResult on_vkGetMemoryFdKHR(void* context, VkResult input_result, VkDevice device,
+ const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd);
+
+#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);
+
+ VkResult setBufferCollectionImageConstraintsFUCHSIA(
+ VkEncoder* enc, VkDevice device,
+ fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>* pCollection,
+ const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
+
+ VkResult setBufferCollectionBufferConstraintsFUCHSIA(
+ fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>* pCollection,
+ const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
+
+#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_vkGetPhysicalDeviceExternalBufferProperties(
+ void* context, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+ VkExternalBufferProperties* pExternalBufferProperties);
+
+ void on_vkGetPhysicalDeviceExternalBufferPropertiesKHR(
+ void* context, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalBufferInfoKHR* pExternalBufferInfo,
+ VkExternalBufferPropertiesKHR* pExternalBufferProperties);
+
+ 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* currentEncoder);
+
+ 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(uint32_t& noRenderControlEnc);
+
+ 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_GFXSTREAM
+#elif
+#define ALWAYS_INLINE_GFXSTREAM __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_GFXSTREAM uint32_t nextSeqno();
+ static ALWAYS_INLINE_GFXSTREAM 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:
+ VulkanHandleMapping* mCreateMapping = nullptr;
+ VulkanHandleMapping* mDestroyMapping = nullptr;
+
+ uint32_t getColorBufferMemoryIndex(void* context, VkDevice device);
+ const VkPhysicalDeviceMemoryProperties& getPhysicalDeviceMemoryProperties(
+ void* context, VkDevice device, VkPhysicalDevice physicalDevice);
+
+ VkResult on_vkGetPhysicalDeviceImageFormatProperties2_common(
+ bool isKhr, void* context, VkResult input_result, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+ VkImageFormatProperties2* pImageFormatProperties);
+
+ void on_vkGetPhysicalDeviceExternalBufferProperties_common(
+ bool isKhr, void* context, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
+ VkExternalBufferProperties* pExternalBufferProperties);
+
+ template <typename VkSubmitInfoType>
+ VkResult on_vkQueueSubmitTemplate(void* context, VkResult input_result, VkQueue queue,
+ uint32_t submitCount, const VkSubmitInfoType* pSubmits,
+ VkFence fence);
+
+ void freeDescriptorSetsIfHostAllocated(VkEncoder* enc, VkDevice device,
+ uint32_t descriptorSetCount,
+ const VkDescriptorSet* sets);
+ void clearDescriptorPoolAndUnregisterDescriptorSets(void* context, VkDevice device,
+ VkDescriptorPool pool);
+
+ void setDeviceInfo(VkDevice device, VkPhysicalDevice physdev, VkPhysicalDeviceProperties props,
+ VkPhysicalDeviceMemoryProperties memProps, uint32_t enabledExtensionCount,
+ const char* const* ppEnabledExtensionNames, const void* pNext);
+
+ void setDeviceMemoryInfo(VkDevice device, VkDeviceMemory memory, VkDeviceSize allocationSize,
+ uint8_t* ptr, uint32_t memoryTypeIndex, AHardwareBuffer* ahw,
+ bool imported, zx_handle_t vmoHandle, VirtGpuBlobPtr blobPtr);
+
+ void setImageInfo(VkImage image, VkDevice device, const VkImageCreateInfo* pCreateInfo);
+
+ bool supportsDeferredCommands() const;
+ bool supportsAsyncQueueSubmit() const;
+ bool supportsCreateResourcesWithRequirements() const;
+
+ int getHostInstanceExtensionIndex(const std::string& extName) const;
+ int getHostDeviceExtensionIndex(const std::string& extName) const;
+
+ CoherentMemoryPtr createCoherentMemory(VkDevice device, VkDeviceMemory mem,
+ const VkMemoryAllocateInfo& hostAllocationInfo,
+ VkEncoder* enc, VkResult& res);
+ VkResult allocateCoherentMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
+ VkEncoder* enc, VkDeviceMemory* pMemory);
+
+ VkResult getCoherentMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkEncoder* enc,
+ VkDevice device, VkDeviceMemory* pMemory);
+
+ void transformImageMemoryRequirements2ForGuest(VkImage image, VkMemoryRequirements2* reqs2);
+
+ void transformBufferMemoryRequirements2ForGuest(VkBuffer buffer, VkMemoryRequirements2* reqs2);
+
+ void flushCommandBufferPendingCommandsBottomUp(void* context, VkQueue queue,
+ const std::vector<VkCommandBuffer>& workingSet);
+
+ template <class VkSubmitInfoType>
+ void flushStagingStreams(void* context, VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfoType* pSubmits);
+
+ VkResult vkQueueSubmitEnc(VkEncoder* enc, VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfo* pSubmits, VkFence fence);
+
+ VkResult vkQueueSubmitEnc(VkEncoder* enc, VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfo2* pSubmits, VkFence fence);
+
+ VkResult initDescriptorUpdateTemplateBuffers(
+ const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate);
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR)
+ VkResult exportSyncFdForQSRILocked(VkImage image, int* fd);
+#endif
+
+ void setInstanceInfo(VkInstance instance, uint32_t enabledExtensionCount,
+ const char* const* ppEnabledExtensionNames, uint32_t apiVersion);
+
+ void resetCommandBufferStagingInfo(VkCommandBuffer commandBuffer, bool alsoResetPrimaries,
+ bool alsoClearPendingDescriptorSets);
+
+ void resetCommandBufferPendingTopology(VkCommandBuffer commandBuffer);
+
+ void clearCommandPool(VkCommandPool commandPool);
+
+ void ensureSyncDeviceFd(void);
+
+#if defined(VK_USE_PLATFORM_ANDROID_KHR)
+ void unwrap_VkNativeBufferANDROID(const VkNativeBufferANDROID* inputNativeInfo,
+ VkNativeBufferANDROID* outputNativeInfo);
+
+ void unwrap_VkBindImageMemorySwapchainInfoKHR(
+ const VkBindImageMemorySwapchainInfoKHR* inputBimsi,
+ VkBindImageMemorySwapchainInfoKHR* outputBimsi);
+#endif
+
+#if defined(VK_USE_PLATFORM_FUCHSIA)
+ VkResult getBufferCollectionImageCreateInfoIndexLocked(
+ VkBufferCollectionFUCHSIA collection, fuchsia_sysmem::wire::BufferCollectionInfo2& info,
+ uint32_t* outCreateInfoIndex);
+
+ SetBufferCollectionImageConstraintsResult setBufferCollectionImageConstraintsImpl(
+ VkEncoder* enc, VkDevice device,
+ fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>* pCollection,
+ const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
+
+ VkResult setBufferCollectionConstraintsFUCHSIA(
+ VkEncoder* enc, VkDevice device,
+ fidl::WireSyncClient<fuchsia_sysmem::BufferCollection>* collection,
+ const VkImageCreateInfo* pImageInfo);
+#endif
+
+ void unregister_VkDescriptorSet_locked(VkDescriptorSet set);
+
+#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;
+
+#if defined(__ANDROID__)
+ GoldfishAddressSpaceBlockPtr goldfishBlock = nullptr;
+#endif // defined(__ANDROID__)
+ CoherentMemoryPtr coherentMemory = nullptr;
+ VirtGpuBlobPtr blobPtr = 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
+ bool isWsiImage = false;
+ };
+
+ 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 inlineUniformBlockCount = 0;
+ uint32_t* imageInfoIndices;
+ uint32_t* bufferInfoIndices;
+ uint32_t* bufferViewIndices;
+ VkDescriptorImageInfo* imageInfos;
+ VkDescriptorBufferInfo* bufferInfos;
+ VkBufferView* bufferViews;
+ std::vector<uint8_t> inlineUniformBlockBuffer;
+ std::vector<uint32_t> inlineUniformBlockBytesPerBlocks; // bytes per uniform block
+ };
+
+ 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
+ gfxstream::guest::Optional<fuchsia_sysmem::wire::BufferCollectionConstraints> constraints;
+ gfxstream::guest::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
+ };
+
+ VkDescriptorImageInfo filterNonexistentSampler(const VkDescriptorImageInfo& inputInfo);
+
+ void emitDeviceMemoryReport(VkDevice_Info info, VkDeviceMemoryReportEventTypeEXT type,
+ uint64_t memoryObjectId, VkDeviceSize size, VkObjectType objectType,
+ uint64_t objectHandle, uint32_t heapIndex = 0);
+
+ void transformImageMemoryRequirementsForGuestLocked(VkImage image, VkMemoryRequirements* reqs);
+ CoherentMemoryPtr freeCoherentMemoryLocked(VkDeviceMemory memory, VkDeviceMemory_Info& info);
+
+ mutable RecursiveLock mLock;
+
+ std::optional<const VkPhysicalDeviceMemoryProperties> mCachedPhysicalDeviceMemoryProps;
+ std::unique_ptr<EmulatorFeatureInfo> mFeatureInfo;
+#if defined(__ANDROID__)
+ std::unique_ptr<GoldfishAddressSpaceBlockProvider> mGoldfishAddressSpaceBlockProvider;
+#endif // defined(__ANDROID__)
+
+ 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
+
+#define HANDLE_REGISTER_DECLARATION(type) std::unordered_map<type, type##_Info> info_##type;
+
+ GOLDFISH_VK_LIST_HANDLE_TYPES(HANDLE_REGISTER_DECLARATION)
+
+ WorkPool mWorkPool{4};
+ std::unordered_map<VkQueue, std::vector<WorkPool::WaitGroupHandle>>
+ mQueueSensitiveWorkPoolItems;
+
+ std::unordered_map<const VkEncoder*, std::unordered_map<void*, CleanupCallback>>
+ mEncoderCleanupCallbacks;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/guest/vulkan_enc/Resources.cpp b/src/gfxstream/guest/vulkan_enc/Resources.cpp
new file mode 100644
index 00000000000..e60e9505345
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/Resources.cpp
@@ -0,0 +1,278 @@
+// 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" {
+
+#if defined(__ANDROID__) || defined(__Fuchsia__)
+#define SET_HWVULKAN_DISPATCH_MAGIC res->dispatch.magic = HWVULKAN_DISPATCH_MAGIC;
+#elif defined(__linux__)
+#define SET_HWVULKAN_DISPATCH_MAGIC res->loaderData.loaderMagic = ICD_LOADER_MAGIC;
+#else
+#define SET_HWVULKAN_DISPATCH_MAGIC
+#endif
+
+#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(); \
+ } \
+ SET_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(); \
+ } \
+ SET_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/src/gfxstream/guest/vulkan_enc/Resources.h b/src/gfxstream/guest/vulkan_enc/Resources.h
new file mode 100644
index 00000000000..1166da4fd74
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/Resources.h
@@ -0,0 +1,158 @@
+// 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
+
+#if defined(__ANDROID__) || defined(__Fuchsia__)
+#include <hardware/hwvulkan.h>
+#elif defined(__linux__)
+#include <vulkan/vk_icd.h>
+#endif
+#include <inttypes.h>
+#include <vulkan/vulkan.h>
+
+#include <functional>
+
+#include "VulkanHandles.h"
+
+namespace gfxstream {
+namespace guest {
+class IOStream;
+} // namespace guest
+} // namespace gfxstream
+
+namespace gfxstream {
+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;
+};
+
+#if defined(__ANDROID__) || defined(__Fuchsia__)
+#define DECLARE_HWVULKAN_DISPATCH hwvulkan_dispatch_t dispatch;
+#elif defined(__linux__)
+#define DECLARE_HWVULKAN_DISPATCH VK_LOADER_DATA loaderData;
+#else
+#define DECLARE_HWVULKAN_DISPATCH
+#endif
+
+#define GOLDFISH_VK_DEFINE_DISPATCHABLE_HANDLE_STRUCT(type) \
+ struct goldfish_##type { \
+ DECLARE_HWVULKAN_DISPATCH \
+ uint64_t underlying; \
+ gfxstream::vk::VkEncoder* lastUsedEncoder; \
+ uint32_t sequenceNumber; \
+ gfxstream::vk::VkEncoder* privateEncoder; \
+ gfxstream::guest::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 {
+ DECLARE_HWVULKAN_DISPATCH
+ uint64_t underlying;
+ gfxstream::vk::VkEncoder* lastUsedEncoder;
+ uint32_t sequenceNumber;
+ gfxstream::vk::VkEncoder* privateEncoder;
+ gfxstream::guest::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/src/gfxstream/guest/vulkan_enc/Validation.cpp b/src/gfxstream/guest/vulkan_enc/Validation.cpp
new file mode 100644
index 00000000000..00652fcb30b
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/Validation.cpp
@@ -0,0 +1,51 @@
+// 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 "ResourceTracker.h"
+#include "Resources.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/src/gfxstream/guest/vulkan_enc/Validation.h b/src/gfxstream/guest/vulkan_enc/Validation.h
new file mode 100644
index 00000000000..e4ebc5f0ee7
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/Validation.h
@@ -0,0 +1,32 @@
+// 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/src/gfxstream/guest/vulkan_enc/VkEncoder.cpp.inl b/src/gfxstream/guest/vulkan_enc/VkEncoder.cpp.inl
new file mode 100644
index 00000000000..00f0442a614
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/VkEncoder.cpp.inl
@@ -0,0 +1,91 @@
+static ResourceTracker* sResourceTracker = nullptr;
+static uint32_t sFeatureBits = 0;
+static constexpr uint32_t kWatchdogBufferMax = 1'000;
+
+class VkEncoder::Impl {
+ public:
+ Impl(gfxstream::guest::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(gfxstream::guest::IOStream* stream,
+ gfxstream::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/src/gfxstream/guest/vulkan_enc/VkEncoder.h.inl b/src/gfxstream/guest/vulkan_enc/VkEncoder.h.inl
new file mode 100644
index 00000000000..fc698d48fdb
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/vulkan_enc/VulkanHandleMapping.cpp b/src/gfxstream/guest/vulkan_enc/VulkanHandleMapping.cpp
new file mode 100644
index 00000000000..1b5c6a6691e
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/VulkanHandleMapping.cpp
@@ -0,0 +1,40 @@
+// 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 "VulkanHandleMapping.h"
+
+#include <vulkan/vulkan.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/src/gfxstream/guest/vulkan_enc/VulkanHandleMapping.h b/src/gfxstream/guest/vulkan_enc/VulkanHandleMapping.h
new file mode 100644
index 00000000000..08c229e7479
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/VulkanHandleMapping.h
@@ -0,0 +1,53 @@
+// 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/src/gfxstream/guest/vulkan_enc/VulkanHandles.h b/src/gfxstream/guest/vulkan_enc/VulkanHandles.h
new file mode 100644
index 00000000000..1be4d7045b1
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/VulkanHandles.h
@@ -0,0 +1,171 @@
+// 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) \
+ f(VkMicromapEXT) \
+ __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/src/gfxstream/guest/vulkan_enc/VulkanStreamGuest.cpp b/src/gfxstream/guest/vulkan_enc/VulkanStreamGuest.cpp
new file mode 100644
index 00000000000..53d4ad50f13
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/VulkanStreamGuest.cpp
@@ -0,0 +1,160 @@
+// 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(gfxstream::guest::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);
+ gfxstream::guest::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);
+ gfxstream::guest::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/src/gfxstream/guest/vulkan_enc/VulkanStreamGuest.h b/src/gfxstream/guest/vulkan_enc/VulkanStreamGuest.h
new file mode 100644
index 00000000000..92052afe64d
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/VulkanStreamGuest.h
@@ -0,0 +1,103 @@
+// 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 <inttypes.h>
+#include <log/log.h>
+
+#include <memory>
+#include <vector>
+
+#include "gfxstream/guest/IOStream.h"
+#include "ResourceTracker.h"
+#include "VulkanHandleMapping.h"
+#include "aemu/base/BumpPool.h"
+#include "aemu/base/Tracing.h"
+#include "aemu/base/files/Stream.h"
+#include "aemu/base/files/StreamSerializing.h"
+#include "goldfish_vk_private_defs.h"
+
+namespace gfxstream {
+namespace vk {
+
+class VulkanStreamGuest : public gfxstream::guest::Stream {
+ public:
+ VulkanStreamGuest(gfxstream::guest::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:
+ gfxstream::guest::BumpPool mPool;
+ std::vector<uint8_t> mWriteBuffer;
+ gfxstream::guest::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/src/gfxstream/guest/vulkan_enc/func_table.h b/src/gfxstream/guest/vulkan_enc/func_table.h
new file mode 100644
index 00000000000..370a866a225
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/func_table.h
@@ -0,0 +1,222 @@
+// 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/vulkan-docs-next/scripts/genvk.py -registry
+// codegen/vulkan/vulkan-docs-next/xml/vk.xml -registryGfxstream
+// codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.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 "vk_android_native_buffer_gfxstream.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_VERSION_1_3
+#endif
+#ifdef VK_KHR_surface
+#endif
+#ifdef VK_KHR_swapchain
+#endif
+#ifdef VK_KHR_xcb_surface
+#endif
+#ifdef VK_KHR_android_surface
+#endif
+#ifdef VK_KHR_win32_surface
+#endif
+#ifdef VK_KHR_dynamic_rendering
+#endif
+#ifdef VK_KHR_get_physical_device_properties2
+#endif
+#ifdef VK_KHR_maintenance1
+#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_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_shader_float16_int8
+#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_external_fence_capabilities
+#endif
+#ifdef VK_KHR_external_fence
+#endif
+#ifdef VK_KHR_external_fence_fd
+#endif
+#ifdef VK_KHR_maintenance2
+#endif
+#ifdef VK_KHR_dedicated_allocation
+#endif
+#ifdef VK_KHR_storage_buffer_storage_class
+#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_maintenance3
+#endif
+#ifdef VK_KHR_shader_subgroup_extended_types
+#endif
+#ifdef VK_KHR_vulkan_memory_model
+#endif
+#ifdef VK_KHR_shader_terminate_invocation
+#endif
+#ifdef VK_KHR_buffer_device_address
+#endif
+#ifdef VK_KHR_pipeline_executable_properties
+#endif
+#ifdef VK_KHR_shader_integer_dot_product
+#endif
+#ifdef VK_KHR_shader_non_semantic_info
+#endif
+#ifdef VK_KHR_synchronization2
+#endif
+#ifdef VK_KHR_zero_initialize_workgroup_memory
+#endif
+#ifdef VK_KHR_copy_commands2
+#endif
+#ifdef VK_KHR_format_feature_flags2
+#endif
+#ifdef VK_KHR_maintenance4
+#endif
+#ifdef VK_KHR_maintenance5
+#endif
+#ifdef VK_ANDROID_native_buffer
+#endif
+#ifdef VK_EXT_transform_feedback
+#endif
+#ifdef VK_AMD_gpu_shader_half_float
+#endif
+#ifdef VK_EXT_texture_compression_astc_hdr
+#endif
+#ifdef VK_EXT_swapchain_colorspace
+#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_inline_uniform_block
+#endif
+#ifdef VK_EXT_shader_stencil_export
+#endif
+#ifdef VK_EXT_vertex_attribute_divisor
+#endif
+#ifdef VK_EXT_pipeline_creation_feedback
+#endif
+#ifdef VK_NV_shader_subgroup_partitioned
+#endif
+#ifdef VK_EXT_metal_surface
+#endif
+#ifdef VK_EXT_scalar_block_layout
+#endif
+#ifdef VK_EXT_subgroup_size_control
+#endif
+#ifdef VK_EXT_tooling_info
+#endif
+#ifdef VK_EXT_provoking_vertex
+#endif
+#ifdef VK_EXT_line_rasterization
+#endif
+#ifdef VK_EXT_index_type_uint8
+#endif
+#ifdef VK_EXT_extended_dynamic_state
+#endif
+#ifdef VK_EXT_host_image_copy
+#endif
+#ifdef VK_EXT_swapchain_maintenance1
+#endif
+#ifdef VK_EXT_shader_demote_to_helper_invocation
+#endif
+#ifdef VK_EXT_texel_buffer_alignment
+#endif
+#ifdef VK_EXT_device_memory_report
+#endif
+#ifdef VK_EXT_custom_border_color
+#endif
+#ifdef VK_EXT_private_data
+#endif
+#ifdef VK_EXT_pipeline_creation_cache_control
+#endif
+#ifdef VK_EXT_graphics_pipeline_library
+#endif
+#ifdef VK_EXT_ycbcr_2plane_444_formats
+#endif
+#ifdef VK_EXT_image_robustness
+#endif
+#ifdef VK_EXT_image_compression_control
+#endif
+#ifdef VK_EXT_4444_formats
+#endif
+#ifdef VK_EXT_primitive_topology_list_restart
+#endif
+#ifdef VK_EXT_extended_dynamic_state2
+#endif
+#ifdef VK_GOOGLE_gfxstream
+#endif
+#ifdef VK_EXT_load_store_op_none
+#endif
+#ifdef VK_EXT_image_compression_control_swapchain
+#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/src/gfxstream/guest/vulkan_enc/gfxstream_vk_private.cpp b/src/gfxstream/guest/vulkan_enc/gfxstream_vk_private.cpp
new file mode 100644
index 00000000000..ba552ea0adc
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/gfxstream_vk_private.cpp
@@ -0,0 +1,53 @@
+// 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 "gfxstream_vk_private.h"
+
+#include "vk_sync_dummy.h"
+
+static bool isNoopSemaphore(gfxstream_vk_semaphore* semaphore) {
+ /* Under the assumption that Mesa VK runtime queue submission is used, WSI flow
+ * sets this temporary state to a dummy sync type (when no explicit dma-buf
+ * synchronization is available). For gfxstream case, ignore this semaphore
+ * when this is the case. Synchronization will be done on the host.
+ */
+ return (semaphore && semaphore->vk.temporary &&
+ vk_sync_type_is_dummy(semaphore->vk.temporary->type));
+}
+
+std::vector<VkSemaphore> transformVkSemaphoreList(const VkSemaphore* pSemaphores,
+ uint32_t semaphoreCount) {
+ std::vector<VkSemaphore> outSemaphores;
+ for (uint32_t j = 0; j < semaphoreCount; ++j) {
+ VK_FROM_HANDLE(gfxstream_vk_semaphore, gfxstream_semaphore, pSemaphores[j]);
+ if (!isNoopSemaphore(gfxstream_semaphore)) {
+ outSemaphores.push_back(gfxstream_semaphore->internal_object);
+ }
+ }
+ return outSemaphores;
+}
+
+std::vector<VkSemaphoreSubmitInfo> transformVkSemaphoreSubmitInfoList(
+ const VkSemaphoreSubmitInfo* pSemaphoreSubmitInfos, uint32_t semaphoreSubmitInfoCount) {
+ std::vector<VkSemaphoreSubmitInfo> outSemaphoreSubmitInfo;
+ for (uint32_t j = 0; j < semaphoreSubmitInfoCount; ++j) {
+ VkSemaphoreSubmitInfo outInfo = pSemaphoreSubmitInfos[j];
+ VK_FROM_HANDLE(gfxstream_vk_semaphore, gfxstream_semaphore, outInfo.semaphore);
+ if (!isNoopSemaphore(gfxstream_semaphore)) {
+ outInfo.semaphore = gfxstream_semaphore->internal_object;
+ outSemaphoreSubmitInfo.push_back(outInfo);
+ }
+ }
+ return outSemaphoreSubmitInfo;
+}
diff --git a/src/gfxstream/guest/vulkan_enc/gfxstream_vk_private.h b/src/gfxstream/guest/vulkan_enc/gfxstream_vk_private.h
new file mode 100644
index 00000000000..50628543f9b
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/gfxstream_vk_private.h
@@ -0,0 +1,246 @@
+/*
+ * Copyright © 2023 Google Inc.
+ *
+ * derived from panvk_private.h driver which is:
+ * Copyright © 2021 Collabora Ltd.
+ * Copyright © 2016 Red Hat.
+ * Copyright © 2016 Bas Nieuwenhuizen
+ * Copyright © 2015 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 GFXSTREAM_VK_PRIVATE_H
+#define GFXSTREAM_VK_PRIVATE_H
+
+#include <assert.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <vulkan/vk_icd.h>
+#include <vulkan/vulkan.h>
+
+#include <vector>
+
+#include "gfxstream_vk_entrypoints.h"
+#include "vk_alloc.h"
+#include "vk_buffer.h"
+#include "vk_buffer_view.h"
+#include "vk_command_buffer.h"
+#include "vk_command_pool.h"
+#include "vk_descriptor_update_template.h"
+#include "vk_device.h"
+#include "vk_device_memory.h"
+#include "vk_extensions.h"
+#include "vk_fence.h"
+#include "vk_image.h"
+#include "vk_instance.h"
+#include "vk_log.h"
+#include "vk_object.h"
+#include "vk_physical_device.h"
+#include "vk_query_pool.h"
+#include "vk_queue.h"
+#include "vk_semaphore.h"
+#include "vulkan/wsi/wsi_common.h"
+
+struct gfxstream_vk_instance {
+ struct vk_instance vk;
+ uint32_t api_version;
+ VkInstance internal_object;
+};
+
+struct gfxstream_vk_physical_device {
+ struct vk_physical_device vk;
+
+ struct wsi_device wsi_device;
+ const struct vk_sync_type* sync_types[2];
+ struct gfxstream_vk_instance* instance;
+ VkPhysicalDevice internal_object;
+};
+
+struct gfxstream_vk_device {
+ struct vk_device vk;
+
+ struct vk_device_dispatch_table cmd_dispatch;
+ struct gfxstream_vk_physical_device* physical_device;
+ VkDevice internal_object;
+};
+
+struct gfxstream_vk_queue {
+ struct vk_queue vk;
+ struct gfxstream_vk_device* device;
+ VkQueue internal_object;
+};
+
+struct gfxstream_vk_pipeline_cache {
+ struct vk_object_base base;
+ VkPipelineCache internal_object;
+};
+
+struct gfxstream_vk_device_memory {
+ struct vk_device_memory vk;
+ VkDeviceMemory internal_object;
+};
+
+struct gfxstream_vk_descriptor_set_layout {
+ struct vk_object_base base;
+ VkDescriptorSetLayout internal_object;
+};
+
+struct gfxstream_vk_pipeline_layout {
+ struct vk_object_base base;
+ VkPipelineLayout internal_object;
+};
+
+struct gfxstream_vk_descriptor_pool {
+ struct vk_object_base base;
+ VkDescriptorPool internal_object;
+};
+
+struct gfxstream_vk_buffer {
+ struct vk_buffer vk;
+ VkBuffer internal_object;
+};
+
+struct gfxstream_vk_command_pool {
+ struct vk_command_pool vk;
+ VkCommandPool internal_object;
+};
+
+struct gfxstream_vk_command_buffer {
+ struct vk_command_buffer vk;
+ VkCommandBuffer internal_object;
+};
+
+struct gfxstream_vk_event {
+ struct vk_object_base base;
+ VkEvent internal_object;
+};
+
+struct gfxstream_vk_pipeline {
+ struct vk_object_base base;
+ VkPipeline internal_object;
+};
+
+struct gfxstream_vk_image {
+ struct vk_image vk;
+ VkImage internal_object;
+};
+
+struct gfxstream_vk_image_view {
+ struct vk_image_view vk;
+ VkImageView internal_object;
+};
+
+struct gfxstream_vk_buffer_view {
+ struct vk_buffer_view vk;
+ VkBufferView internal_object;
+};
+
+struct gfxstream_vk_framebuffer {
+ struct vk_object_base base;
+ VkFramebuffer internal_object;
+};
+
+struct gfxstream_vk_render_pass {
+ struct vk_object_base base;
+ VkRenderPass internal_object;
+};
+
+struct gfxstream_vk_fence {
+ struct vk_fence vk;
+ VkFence internal_object;
+};
+
+struct gfxstream_vk_semaphore {
+ struct vk_semaphore vk;
+ VkSemaphore internal_object;
+};
+
+struct gfxstream_vk_query_pool {
+ struct vk_query_pool vk;
+ VkQueryPool internal_object;
+};
+
+struct gfxstream_vk_shader_module {
+ struct vk_object_base base;
+ VkShaderModule internal_object;
+};
+
+struct gfxstream_vk_descriptor_update_template {
+ struct vk_object_base base;
+ VkDescriptorUpdateTemplate internal_object;
+};
+
+VK_DEFINE_HANDLE_CASTS(gfxstream_vk_command_buffer, vk.base, VkCommandBuffer,
+ VK_OBJECT_TYPE_COMMAND_BUFFER)
+VK_DEFINE_HANDLE_CASTS(gfxstream_vk_device, vk.base, VkDevice, VK_OBJECT_TYPE_DEVICE)
+VK_DEFINE_HANDLE_CASTS(gfxstream_vk_instance, vk.base, VkInstance, VK_OBJECT_TYPE_INSTANCE)
+VK_DEFINE_HANDLE_CASTS(gfxstream_vk_physical_device, vk.base, VkPhysicalDevice,
+ VK_OBJECT_TYPE_PHYSICAL_DEVICE)
+VK_DEFINE_HANDLE_CASTS(gfxstream_vk_queue, vk.base, VkQueue, VK_OBJECT_TYPE_QUEUE)
+
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_command_pool, vk.base, VkCommandPool,
+ VK_OBJECT_TYPE_COMMAND_POOL)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_buffer, vk.base, VkBuffer, VK_OBJECT_TYPE_BUFFER)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_buffer_view, vk.base, VkBufferView,
+ VK_OBJECT_TYPE_BUFFER_VIEW)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_descriptor_pool, base, VkDescriptorPool,
+ VK_OBJECT_TYPE_DESCRIPTOR_POOL)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_descriptor_set_layout, base, VkDescriptorSetLayout,
+ VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_device_memory, vk.base, VkDeviceMemory,
+ VK_OBJECT_TYPE_DEVICE_MEMORY)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_event, base, VkEvent, VK_OBJECT_TYPE_EVENT)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_framebuffer, base, VkFramebuffer,
+ VK_OBJECT_TYPE_FRAMEBUFFER)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_image, vk.base, VkImage, VK_OBJECT_TYPE_IMAGE)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_image_view, vk.base, VkImageView,
+ VK_OBJECT_TYPE_IMAGE_VIEW);
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_pipeline_cache, base, VkPipelineCache,
+ VK_OBJECT_TYPE_PIPELINE_CACHE)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_pipeline, base, VkPipeline, VK_OBJECT_TYPE_PIPELINE)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_pipeline_layout, base, VkPipelineLayout,
+ VK_OBJECT_TYPE_PIPELINE_LAYOUT)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_render_pass, base, VkRenderPass,
+ VK_OBJECT_TYPE_RENDER_PASS)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_fence, vk.base, VkFence, VK_OBJECT_TYPE_FENCE)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_semaphore, vk.base, VkSemaphore,
+ VK_OBJECT_TYPE_SEMAPHORE)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_query_pool, vk.base, VkQueryPool,
+ VK_OBJECT_TYPE_QUERY_POOL)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_shader_module, base, VkShaderModule,
+ VK_OBJECT_TYPE_SHADER_MODULE)
+VK_DEFINE_NONDISP_HANDLE_CASTS(gfxstream_vk_descriptor_update_template, base,
+ VkDescriptorUpdateTemplate,
+ VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE)
+
+VkResult gfxstream_vk_wsi_init(struct gfxstream_vk_physical_device* physical_device);
+
+void gfxstream_vk_wsi_finish(struct gfxstream_vk_physical_device* physical_device);
+
+std::vector<VkSemaphore> transformVkSemaphoreList(const VkSemaphore* pSemaphores,
+ uint32_t semaphoreCount);
+
+std::vector<VkSemaphoreSubmitInfo> transformVkSemaphoreSubmitInfoList(
+ const VkSemaphoreSubmitInfo* pSemaphoreSubmitInfos, uint32_t semaphoreSubmitInfoCount);
+
+#endif /* GFXSTREAM_VK_PRIVATE_H */
diff --git a/src/gfxstream/guest/vulkan_enc/goldfish_vk_private_defs.h b/src/gfxstream/guest/vulkan_enc/goldfish_vk_private_defs.h
new file mode 100644
index 00000000000..d50e6f1189f
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/vulkan_enc/meson.build b/src/gfxstream/guest/vulkan_enc/meson.build
new file mode 100644
index 00000000000..1d72e7c6f85
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/meson.build
@@ -0,0 +1,57 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+output_host_path = meson.current_build_dir() + '/host/vulkan/cereal'
+guest_enc_path = meson.current_build_dir()
+
+gfxstream_guest_vk_autogen = custom_target(
+ 'gfxstream_guest_vk_autogen',
+ output : [
+ 'VkEncoder.h',
+ 'goldfish_vk_counting_guest.h',
+ 'goldfish_vk_deepcopy_guest.h',
+ 'goldfish_vk_marshaling_guest.h',
+ 'goldfish_vk_extension_structs_guest.h',
+ 'goldfish_vk_reserved_marshaling_guest.h',
+ 'goldfish_vk_transform_guest.h',
+ 'goldfish_vk_counting_guest.cpp',
+ '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',
+ 'VkEncoder.cpp',
+ 'func_table.cpp',
+ ],
+ env: {'CEREAL_VARIANT' : 'guest', 'GFXSTREAM_GUEST_ENCODER_DIR': guest_enc_path},
+ input: [genvk, vk_api_xml, vk_gfxstream_xml],
+ command: [prog_python, '@INPUT0@', '-registry', '@INPUT1@', '-registryGfxstream', '@INPUT2@',
+ 'cereal', '-o', output_host_path],
+)
+
+gfxstream_vk_entrypoints = custom_target(
+ 'gfxstream_vk_entrypoints',
+ input : [vk_entrypoints_gen, vk_api_xml],
+ output : ['gfxstream_vk_entrypoints.h', 'gfxstream_vk_entrypoints.c'],
+ command : [
+ prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
+ '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'gfxstream_vk',
+ '--beta', with_vulkan_beta.to_string()
+ ],
+)
+
+dep_vk_encoder_h = declare_dependency(
+ sources: gfxstream_guest_vk_autogen[0],
+)
+
+files_lib_vulkan_enc = files(
+ 'CommandBufferStagingStream.cpp',
+ 'DescriptorSetVirtualization.cpp',
+ 'HostVisibleMemoryVirtualization.cpp',
+ 'ResourceTracker.cpp',
+ 'Resources.cpp',
+ 'Validation.cpp',
+ 'VulkanHandleMapping.cpp',
+ 'VulkanStreamGuest.cpp',
+ 'gfxstream_vk_private.cpp',
+)
diff --git a/src/gfxstream/guest/vulkan_enc/vkQueueFlushCommandsGOOGLE_encode_impl.cpp.inl b/src/gfxstream/guest/vulkan_enc/vkQueueFlushCommandsGOOGLE_encode_impl.cpp.inl
new file mode 100644
index 00000000000..3b4cf324d99
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/vulkan_enc/vk_android_native_buffer_gfxstream.h b/src/gfxstream/guest/vulkan_enc/vk_android_native_buffer_gfxstream.h
new file mode 100644
index 00000000000..b00b2e21e75
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/vk_android_native_buffer_gfxstream.h
@@ -0,0 +1,251 @@
+/*
+ * 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 __VK_ANDROID_NATIVE_BUFFER_H__
+#define __VK_ANDROID_NATIVE_BUFFER_H__
+
+#include <vulkan/vulkan.h>
+
+/* MESA: A hack to avoid #ifdefs in driver code. */
+#if defined(ANDROID)
+#include <cutils/native_handle.h>
+
+#if ANDROID_API_LEVEL < 28
+/* buffer_handle_t was defined in the deprecated system/window.h */
+typedef const native_handle_t* buffer_handle_t;
+#endif
+
+#else
+typedef void* buffer_handle_t;
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define VK_ANDROID_native_buffer 1
+
+#define VK_ANDROID_NATIVE_BUFFER_EXTENSION_NUMBER 11
+/*
+ * NOTE ON VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
+ *
+ * This version of the extension transitions from gralloc0 to gralloc1 usage
+ * flags (int -> 2x uint64_t). The WSI implementation will temporarily continue
+ * to fill out deprecated fields in VkNativeBufferANDROID, and will call the
+ * deprecated vkGetSwapchainGrallocUsageANDROID if the new
+ * vkGetSwapchainGrallocUsage2ANDROID is not supported. This transitionary
+ * backwards-compatibility support is temporary, and will likely be removed
+ * (along with all gralloc0 support) in a future release.
+ */
+/*
+ * NOTE ON VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 8
+ *
+ * This version of the extension doesn't introduce new types or structs, but is
+ * to accommodate the new struct VkBindImageMemorySwapchainInfoKHR added in
+ * VK_KHR_swapchain spec version 69. When VkBindImageMemorySwapchainInfoKHR is
+ * chained in the pNext chain of VkBindImageMemoryInfo, a VkNativeBufferANDROID
+ * that holds the correct gralloc handle according to the imageIndex specified
+ * in VkBindImageMemorySwapchainInfoKHR will be additionally chained to the
+ * pNext chain of VkBindImageMemoryInfo and passed down to the driver.
+ */
+/*
+ * NOTE ON VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 9
+ *
+ * This version of the extension is largely designed to clean up the mix of
+ * GrallocUsage and GrallocUsage2
+ */
+#define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 9
+#define VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME "VK_ANDROID_native_buffer"
+
+#define VK_ANDROID_NATIVE_BUFFER_ENUM(type, id) \
+ ((type)(1000000000 + (1000 * (VK_ANDROID_NATIVE_BUFFER_EXTENSION_NUMBER - 1)) + (id)))
+#define VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 0)
+#define VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID \
+ VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 1)
+#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID \
+ VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 2)
+#define VK_STRUCTURE_TYPE_GRALLOC_USAGE_INFO_ANDROID \
+ VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 3)
+
+/* clang-format off */
+typedef enum VkSwapchainImageUsageFlagBitsANDROID {
+ VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_ANDROID = 0x00000001,
+ VK_SWAPCHAIN_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSwapchainImageUsageFlagBitsANDROID;
+typedef VkFlags VkSwapchainImageUsageFlagsANDROID;
+
+/*
+ * struct VkNativeBufferUsage2ANDROID
+ *
+ * consumer: gralloc1 consumer usage flag
+ * producer: gralloc1 producer usage flag
+ */
+typedef struct {
+ uint64_t consumer;
+ uint64_t producer;
+} VkNativeBufferUsage2ANDROID;
+
+/*
+ * struct VkNativeBufferANDROID
+ *
+ * sType: VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID
+ * pNext: NULL or a pointer to a structure extending this structure
+ * handle: buffer handle returned from gralloc alloc()
+ * stride: stride returned from gralloc alloc()
+ * format: gralloc format requested when the buffer was allocated
+ * usage: gralloc usage requested when the buffer was allocated
+ * usage2: gralloc usage requested when the buffer was allocated
+ * usage3: gralloc usage requested when the buffer was allocated
+ */
+typedef struct {
+ VkStructureType sType;
+ const void* pNext;
+ const uint32_t* handle;
+ int stride;
+ int format;
+ int usage; /* DEPRECATED in SPEC_VERSION 6 */
+ VkNativeBufferUsage2ANDROID usage2; /* DEPRECATED in SPEC_VERSION 9 */
+ uint64_t usage3; /* ADDED in SPEC_VERSION 9 */
+} VkNativeBufferANDROID;
+
+/*
+ * struct VkSwapchainImageCreateInfoANDROID
+ *
+ * sType: VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID
+ * pNext: NULL or a pointer to a structure extending this structure
+ * usage: is a bitmask of VkSwapchainImageUsageFlagsANDROID
+ */
+typedef struct {
+ VkStructureType sType;
+ const void* pNext;
+ VkSwapchainImageUsageFlagsANDROID usage;
+} VkSwapchainImageCreateInfoANDROID;
+
+/*
+ * struct VkPhysicalDevicePresentationPropertiesANDROID
+ *
+ * sType: VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID
+ * pNext: NULL or a pointer to a structure extending this structure
+ * sharedImage: specifies if the image can be shared with the display system
+ */
+typedef struct {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 sharedImage;
+} VkPhysicalDevicePresentationPropertiesANDROID;
+
+/*
+ * struct VkGrallocUsageInfoANDROID
+ *
+ * sType: VK_STRUCTURE_TYPE_GRALLOC_USAGE_INFO_ANDROID
+ * pNext: NULL or a pointer to a structure extending this structure
+ * format: value specifying the format the image will be created with
+ * imageUsage: bitmask of VkImageUsageFlagBits describing intended usage
+ */
+typedef struct {
+ VkStructureType sType;
+ const void* pNext;
+ VkFormat format;
+ VkImageUsageFlags imageUsage;
+} VkGrallocUsageInfoANDROID;
+
+/* DEPRECATED in SPEC_VERSION 6 */
+typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainGrallocUsageANDROID)(
+ VkDevice device,
+ VkFormat format,
+ VkImageUsageFlags imageUsage,
+ int* grallocUsage);
+
+/* DEPRECATED in SPEC_VERSION 9 */
+typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainGrallocUsage2ANDROID)(
+ VkDevice device,
+ VkFormat format,
+ VkImageUsageFlags imageUsage,
+ VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
+ uint64_t* grallocConsumerUsage,
+ uint64_t* grallocProducerUsage);
+
+/* ADDED in SPEC_VERSION 9 */
+typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainGrallocUsage3ANDROID)(
+ VkDevice device,
+ const VkGrallocUsageInfoANDROID* grallocUsageInfo,
+ uint64_t* grallocUsage);
+
+typedef VkResult (VKAPI_PTR *PFN_vkAcquireImageANDROID)(
+ VkDevice device,
+ VkImage image,
+ int nativeFenceFd,
+ VkSemaphore semaphore,
+ VkFence fence);
+
+typedef VkResult (VKAPI_PTR *PFN_vkQueueSignalReleaseImageANDROID)(
+ VkQueue queue,
+ uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores,
+ VkImage image,
+ int* pNativeFenceFd);
+
+#ifndef VK_NO_PROTOTYPES
+
+/* DEPRECATED in SPEC_VERSION 6 */
+VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsageANDROID(
+ VkDevice device,
+ VkFormat format,
+ VkImageUsageFlags imageUsage,
+ int* grallocUsage
+);
+
+/* DEPRECATED in SPEC_VERSION 9 */
+VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsage2ANDROID(
+ VkDevice device,
+ VkFormat format,
+ VkImageUsageFlags imageUsage,
+ VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
+ uint64_t* grallocConsumerUsage,
+ uint64_t* grallocProducerUsage
+);
+
+/* ADDED in SPEC_VERSION 9 */
+VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsage3ANDROID(
+ VkDevice device,
+ const VkGrallocUsageInfoANDROID* grallocUsageInfo,
+ uint64_t* grallocUsage
+);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkAcquireImageANDROID(
+ VkDevice device,
+ VkImage image,
+ int nativeFenceFd,
+ VkSemaphore semaphore,
+ VkFence fence
+);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkQueueSignalReleaseImageANDROID(
+ VkQueue queue,
+ uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores,
+ VkImage image,
+ int* pNativeFenceFd
+);
+
+#endif
+/* clang-format on */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __VK_ANDROID_NATIVE_BUFFER_H__ */
diff --git a/src/gfxstream/guest/vulkan_enc/vk_format_info.h b/src/gfxstream/guest/vulkan_enc/vk_format_info.h
new file mode 100644
index 00000000000..2d5d84ebafa
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/vk_format_info.h
@@ -0,0 +1,206 @@
+/*
+ * 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 <vndk/hardware_buffer.h>
+#include <vulkan/vulkan.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/src/gfxstream/guest/vulkan_enc/vk_platform_compat.h b/src/gfxstream/guest/vulkan_enc/vk_platform_compat.h
new file mode 100644
index 00000000000..38f78cd1d1f
--- /dev/null
+++ b/src/gfxstream/guest/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/src/gfxstream/guest/vulkan_enc/vk_struct_id.h b/src/gfxstream/guest/vulkan_enc/vk_struct_id.h
new file mode 100644
index 00000000000..eaae46bdb88
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/vk_struct_id.h
@@ -0,0 +1,125 @@
+// 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 "vk_android_native_buffer_gfxstream.h"
+#include "vulkan_gfxstream.h"
+
+// anonymous
+namespace {
+
+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(VkImportMemoryFdInfoKHR, VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR);
+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);
+REGISTER_VK_STRUCT_ID(VkBindImageMemoryInfo, VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO);
+REGISTER_VK_STRUCT_ID(VkBindImageMemorySwapchainInfoKHR,
+ VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR);
+REGISTER_VK_STRUCT_ID(VkBufferOpaqueCaptureAddressCreateInfo,
+ VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkBufferDeviceAddressCreateInfoEXT,
+ VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT);
+REGISTER_VK_STRUCT_ID(VkGraphicsPipelineCreateInfo,
+ VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkPipelineRenderingCreateInfo,
+ VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceExternalSemaphoreInfo,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO);
+REGISTER_VK_STRUCT_ID(VkRenderPassBeginInfo, VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO);
+REGISTER_VK_STRUCT_ID(VkRenderPassAttachmentBeginInfo,
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO);
+
+#undef REGISTER_VK_STRUCT_ID
+
+} // namespace
diff --git a/src/gfxstream/guest/vulkan_enc/vk_util.h b/src/gfxstream/guest/vulkan_enc/vk_util.h
new file mode 100644
index 00000000000..61ce359e3f6
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/vk_util.h
@@ -0,0 +1,281 @@
+/*
+ * 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 <stdlib.h>
+#include <vulkan/vulkan.h>
+
+#include "vk_struct_id.h"
+
+namespace { // anonymous
+
+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_MAKE_TYPED(type, name, data, len) \
+ vk_outarray(type) name; \
+ vk_outarray_init(&name, (data), (len))
+
+#define vk_outarray_status(a) __vk_outarray_status(&(a)->base)
+
+#define vk_outarray_next(a) vk_outarray_next_typed(vk_outarray_typeof_elem(a), a)
+#define vk_outarray_next_typed(type, a) \
+ ((type*)__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)
+
+#define vk_outarray_append_typed(type, a, elem) \
+ for (type* elem = vk_outarray_next_typed(type, 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);
+}
+
+bool vk_descriptor_type_has_image_view(VkDescriptorType type) {
+ switch (type) {
+ case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
+ case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
+ case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
+ case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool vk_descriptor_type_has_descriptor_buffer(VkDescriptorType type) {
+ switch (type) {
+ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
+ case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
+ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
+ case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool vk_descriptor_type_has_texel_buffer(VkDescriptorType type) {
+ switch (type) {
+ case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
+ case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
+ return true;
+ default:
+ return false;
+ }
+}
+
+} // namespace
+
+#endif /* VK_UTIL_H */
diff --git a/src/gfxstream/guest/vulkan_enc/vulkan_gfxstream.h b/src/gfxstream/guest/vulkan_enc/vulkan_gfxstream.h
new file mode 100644
index 00000000000..a2c288ce259
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/vulkan_gfxstream.h
@@ -0,0 +1,234 @@
+/*
+** Copyright 2015-2023 The Khronos Group Inc.
+**
+** SPDX-License-Identifier: Apache-2.0
+*/
+
+/*
+** This header is generated from the Khronos Vulkan XML API Registry.
+**
+*/
+
+#pragma once
+#ifdef VK_GFXSTREAM_STRUCTURE_TYPE_EXT
+#include "vulkan_gfxstream_structure_type.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+// VK_GOOGLE_gfxstream is a preprocessor guard. Do not pass it to API calls.
+#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);
+typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateSized2GOOGLE)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount, uint32_t bufferInfoCount, uint32_t bufferViewCount, uint32_t inlineUniformBlockCount, const uint32_t* pImageInfoEntryIndices, const uint32_t* pBufferInfoEntryIndices, const uint32_t* pBufferViewEntryIndices, const VkDescriptorImageInfo* pImageInfos, const VkDescriptorBufferInfo* pBufferInfos, const VkBufferView* pBufferViews, const uint8_t* pInlineUniformBlockData);
+typedef void (VKAPI_PTR *PFN_vkQueueSubmitAsync2GOOGLE)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence);
+
+#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);
+
+VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateSized2GOOGLE(
+ VkDevice device,
+ VkDescriptorSet descriptorSet,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+ uint32_t imageInfoCount,
+ uint32_t bufferInfoCount,
+ uint32_t bufferViewCount,
+ uint32_t inlineUniformBlockCount,
+ const uint32_t* pImageInfoEntryIndices,
+ const uint32_t* pBufferInfoEntryIndices,
+ const uint32_t* pBufferViewEntryIndices,
+ const VkDescriptorImageInfo* pImageInfos,
+ const VkDescriptorBufferInfo* pBufferInfos,
+ const VkBufferView* pBufferViews,
+ const uint8_t* pInlineUniformBlockData);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueSubmitAsync2GOOGLE(
+ VkQueue queue,
+ uint32_t submitCount,
+ const VkSubmitInfo2* pSubmits,
+ VkFence fence);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/gfxstream/guest/vulkan_enc/vulkan_gfxstream_structure_type.h b/src/gfxstream/guest/vulkan_enc/vulkan_gfxstream_structure_type.h
new file mode 100644
index 00000000000..7ef8ed8cb1c
--- /dev/null
+++ b/src/gfxstream/guest/vulkan_enc/vulkan_gfxstream_structure_type.h
@@ -0,0 +1,39 @@
+// 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/vulkan-docs-next/scripts/genvk.py -registry
+// codegen/vulkan/vulkan-docs-next/xml/vk.xml -registryGfxstream
+// codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.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/src/gfxstream/host/BlobManager.cpp b/src/gfxstream/host/BlobManager.cpp
new file mode 100644
index 00000000000..938f275e1f8
--- /dev/null
+++ b/src/gfxstream/host/BlobManager.cpp
@@ -0,0 +1,83 @@
+// 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.
+#include "BlobManager.h"
+
+#include <utility>
+
+using android::base::ManagedDescriptor;
+
+namespace gfxstream {
+
+static BlobManager* sMapping() {
+ static BlobManager* s = new BlobManager;
+ return s;
+}
+
+// static
+BlobManager* BlobManager::get() { return sMapping(); }
+
+void BlobManager::addMapping(uint32_t ctxId, uint64_t blobId, void* addr, uint32_t caching) {
+ struct HostMemInfo info = {
+ .addr = addr,
+ .caching = caching,
+ };
+
+ auto key = std::make_pair(ctxId, blobId);
+ std::lock_guard<std::mutex> lock(mLock);
+ mHostMemInfos.insert(std::make_pair(key, info));
+}
+
+std::optional<HostMemInfo> BlobManager::removeMapping(uint32_t ctxId, uint64_t blobId) {
+ auto key = std::make_pair(ctxId, blobId);
+ std::lock_guard<std::mutex> lock(mLock);
+ auto found = mHostMemInfos.find(key);
+ if (found != mHostMemInfos.end()) {
+ std::optional<HostMemInfo> ret = found->second;
+ mHostMemInfos.erase(found);
+ return ret;
+ }
+
+ return std::nullopt;
+}
+
+void BlobManager::addDescriptorInfo(uint32_t ctxId, uint64_t blobId, ManagedDescriptor descriptor,
+ uint32_t handleType, uint32_t caching,
+ std::optional<VulkanInfo> vulkanInfoOpt) {
+ struct ManagedDescriptorInfo info = {
+ .descriptor = std::move(descriptor),
+ .handleType = handleType,
+ .caching = caching,
+ .vulkanInfoOpt = vulkanInfoOpt,
+ };
+
+ auto key = std::make_pair(ctxId, blobId);
+ std::lock_guard<std::mutex> lock(mLock);
+ mDescriptorInfos.insert(std::make_pair(key, std::move(info)));
+}
+
+std::optional<ManagedDescriptorInfo> BlobManager::removeDescriptorInfo(uint32_t ctxId,
+ uint64_t blobId) {
+ auto key = std::make_pair(ctxId, blobId);
+ std::lock_guard<std::mutex> lock(mLock);
+ auto found = mDescriptorInfos.find(key);
+ if (found != mDescriptorInfos.end()) {
+ std::optional<ManagedDescriptorInfo> ret = std::move(found->second);
+ mDescriptorInfos.erase(found);
+ return ret;
+ }
+
+ return std::nullopt;
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/BlobManager.h b/src/gfxstream/host/BlobManager.h
new file mode 100644
index 00000000000..b23987c9ab4
--- /dev/null
+++ b/src/gfxstream/host/BlobManager.h
@@ -0,0 +1,114 @@
+// 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 <inttypes.h>
+
+#include <atomic>
+#include <mutex>
+#include <optional>
+#include <unordered_map>
+#include <utility>
+
+#include "aemu/base/Compiler.h"
+#include "aemu/base/ManagedDescriptor.hpp"
+
+// A global mapping from opaque host memory IDs to host virtual
+// addresses/sizes. This is so that the guest doesn't have to know the host
+// virtual address to be able to map them. However, we do also provide a
+// mechanism for obtaining the offsets into page for such buffers (as the guest
+// does need to know those).
+//
+// This is currently used only in conjunction with virtio-gpu-next and Vulkan /
+// address space device, though there are possible other consumers of this, so
+// it becomes a global object. It exports methods into VmOperations.
+
+using android::base::ManagedDescriptor;
+
+namespace gfxstream {
+
+// Caching types
+#define MAP_CACHE_MASK 0x0f
+#define MAP_CACHE_NONE 0x00
+#define MAP_CACHE_CACHED 0x01
+#define MAP_CACHE_UNCACHED 0x02
+#define MAP_CACHE_WC 0x03
+
+#define STREAM_MEM_HANDLE_TYPE_OPAQUE_FD 0x1
+#define STREAM_MEM_HANDLE_TYPE_DMABUF 0x2
+#define STREAM_MEM_HANDLE_TYPE_OPAQUE_WIN32 0x3
+#define STREAM_MEM_HANDLE_TYPE_SHM 0x4
+#define STREAM_MEM_HANDLE_TYPE_ZIRCON 0x5
+#define STREAM_FENCE_HANDLE_TYPE_OPAQUE_FD 0x6
+#define STREAM_FENCE_HANDLE_TYPE_SYNC_FD 0x7
+#define STREAM_FENCE_HANDLE_TYPE_OPAQUE_WIN32 0x8
+#define STREAM_FENCE_HANDLE_TYPE_ZIRCON 0x9
+
+// A struct describing the information about host memory associated
+// with a host memory id. Used with virtio-gpu-next.
+struct HostMemInfo {
+ void* addr;
+ uint32_t caching;
+};
+
+struct VulkanInfo {
+ uint32_t memoryIndex;
+ uint8_t deviceUUID[16];
+ uint8_t driverUUID[16];
+};
+
+struct ManagedDescriptorInfo {
+ ManagedDescriptor descriptor;
+ uint32_t handleType;
+ uint32_t caching;
+ std::optional<VulkanInfo> vulkanInfoOpt;
+};
+
+class BlobManager {
+ public:
+ BlobManager() = default;
+
+ static BlobManager* get();
+
+ void addMapping(uint32_t ctx_id, uint64_t blobId, void* addr, uint32_t caching);
+ std::optional<HostMemInfo> removeMapping(uint32_t ctx_id, uint64_t blobId);
+
+ void addDescriptorInfo(uint32_t ctx_id, uint64_t blobId, ManagedDescriptor descriptor,
+ uint32_t handleType, uint32_t caching,
+ std::optional<VulkanInfo> vulkanInfoOpt);
+ std::optional<ManagedDescriptorInfo> removeDescriptorInfo(uint32_t ctx_id, uint64_t blobId);
+
+ private:
+ // Only for pairs of std::hash-able types for simplicity.
+ // You can of course template this struct to allow other hash functions
+ struct pair_hash {
+ template <class T1, class T2>
+ std::size_t operator()(const std::pair<T1, T2>& p) const {
+ auto h1 = std::hash<T1>{}(p.first);
+ auto h2 = std::hash<T2>{}(p.second);
+
+ // Mainly for demonstration purposes, i.e. works but is overly simple
+ // In the real world, use sth. like boost.hash_combine
+ return h1 ^ h2;
+ }
+ };
+
+ std::mutex mLock;
+ std::unordered_map<std::pair<uint32_t, uint64_t>, HostMemInfo, pair_hash> mHostMemInfos;
+ std::unordered_map<std::pair<uint32_t, uint64_t>, ManagedDescriptorInfo, pair_hash>
+ mDescriptorInfos;
+ DISALLOW_COPY_ASSIGN_AND_MOVE(BlobManager);
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/BorrowedImage.h b/src/gfxstream/host/BorrowedImage.h
new file mode 100644
index 00000000000..ed28905681c
--- /dev/null
+++ b/src/gfxstream/host/BorrowedImage.h
@@ -0,0 +1,30 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+namespace gfxstream {
+
+// Common base struct representing images (Gl/Vk) that are borrowed
+// by server components (e.g. CompositorGl, CompositorVk, DisplayVk)
+// from the underlying server image owner (GlEmulation/VkEmulation).
+struct BorrowedImageInfo {
+ virtual ~BorrowedImageInfo() {}
+
+ uint32_t id = 0;
+ uint32_t width = 0;
+ uint32_t height = 0;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/Buffer.cpp b/src/gfxstream/host/Buffer.cpp
new file mode 100644
index 00000000000..b60a1ecb0e1
--- /dev/null
+++ b/src/gfxstream/host/Buffer.cpp
@@ -0,0 +1,141 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "Buffer.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "gl/EmulationGl.h"
+#endif
+
+#include "vulkan/BufferVk.h"
+#include "vulkan/VkCommonOperations.h"
+
+namespace gfxstream {
+
+using android::base::ManagedDescriptor;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+Buffer::Buffer(HandleType handle, uint64_t size) : mHandle(handle), mSize(size) {}
+
+/*static*/
+std::shared_ptr<Buffer> Buffer::create(gl::EmulationGl* emulationGl, vk::VkEmulation* emulationVk,
+ uint64_t size, HandleType handle) {
+ std::shared_ptr<Buffer> buffer(new Buffer(handle, size));
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (emulationGl) {
+ buffer->mBufferGl = emulationGl->createBuffer(size, handle);
+ if (!buffer->mBufferGl) {
+ ERR("Failed to initialize BufferGl.");
+ return nullptr;
+ }
+ }
+#endif
+
+ if (emulationVk && emulationVk->live) {
+ const bool vulkanOnly = emulationGl == nullptr;
+
+ buffer->mBufferVk = vk::BufferVk::create(handle, size, vulkanOnly);
+ if (!buffer->mBufferVk) {
+ ERR("Failed to initialize BufferVk.");
+ return nullptr;
+ }
+
+ if (!vulkanOnly) {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (!buffer->mBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Missing BufferGl?";
+ }
+#endif
+ // TODO: external memory sharing.
+ }
+ }
+
+ return buffer;
+}
+
+/*static*/
+std::shared_ptr<Buffer> Buffer::onLoad(gl::EmulationGl* emulationGl, vk::VkEmulation*,
+ android::base::Stream* stream) {
+ const auto handle = static_cast<HandleType>(stream->getBe32());
+ const auto size = static_cast<uint64_t>(stream->getBe64());
+
+ std::shared_ptr<Buffer> buffer(new Buffer(handle, size));
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (emulationGl) {
+ buffer->mBufferGl = emulationGl->loadBuffer(stream);
+ if (!buffer->mBufferGl) {
+ ERR("Failed to load BufferGl.");
+ return nullptr;
+ }
+ }
+#endif
+
+ buffer->mNeedRestore = true;
+
+ return buffer;
+}
+
+void Buffer::onSave(android::base::Stream* stream) {
+ stream->putBe32(mHandle);
+ stream->putBe64(mSize);
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mBufferGl) {
+ mBufferGl->onSave(stream);
+ }
+#endif
+}
+
+void Buffer::restore() {}
+
+void Buffer::readToBytes(uint64_t offset, uint64_t size, void* outBytes) {
+ touch();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mBufferGl) {
+ mBufferGl->read(offset, size, outBytes);
+ return;
+ }
+#endif
+
+ if (mBufferVk) {
+ mBufferVk->readToBytes(offset, size, outBytes);
+ return;
+ }
+
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "No Buffer impl?";
+}
+
+bool Buffer::updateFromBytes(uint64_t offset, uint64_t size, const void* bytes) {
+ touch();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mBufferGl) {
+ mBufferGl->subUpdate(offset, size, bytes);
+ return true;
+ }
+#endif
+
+ if (mBufferVk) {
+ return mBufferVk->updateFromBytes(offset, size, bytes);
+ }
+
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "No Buffer impl?";
+ return false;
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/Buffer.h b/src/gfxstream/host/Buffer.h
new file mode 100644
index 00000000000..414ff057e2e
--- /dev/null
+++ b/src/gfxstream/host/Buffer.h
@@ -0,0 +1,78 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <memory>
+
+#include "Handle.h"
+#include "aemu/base/files/Stream.h"
+#include "snapshot/LazySnapshotObj.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "gl/BufferGl.h"
+#endif
+
+namespace gfxstream {
+namespace gl {
+class EmulationGl;
+} // namespace gl
+} // namespace gfxstream
+
+namespace gfxstream {
+namespace vk {
+class BufferVk;
+struct VkEmulation;
+} // namespace vk
+} // namespace gfxstream
+
+namespace gfxstream {
+
+class Buffer : public android::snapshot::LazySnapshotObj<Buffer> {
+ public:
+ static std::shared_ptr<Buffer> create(gl::EmulationGl* emulationGl,
+ vk::VkEmulation* emulationVk, uint64_t size,
+ HandleType handle);
+
+ static std::shared_ptr<Buffer> onLoad(gl::EmulationGl* emulationGl,
+ vk::VkEmulation* emulationVk,
+ android::base::Stream* stream);
+
+ void onSave(android::base::Stream* stream);
+ void restore();
+
+ HandleType getHndl() const { return mHandle; }
+ uint64_t getSize() const { return mSize; }
+
+ void readToBytes(uint64_t offset, uint64_t size, void* outBytes);
+ bool updateFromBytes(uint64_t offset, uint64_t size, const void* bytes);
+
+ private:
+ Buffer(HandleType handle, uint64_t size);
+
+ const uint64_t mSize;
+ const HandleType mHandle;
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ // If GL emulation is enabled.
+ std::unique_ptr<gl::BufferGl> mBufferGl;
+#endif
+
+ // If Vk emulation is enabled.
+ std::unique_ptr<vk::BufferVk> mBufferVk;
+};
+
+typedef std::shared_ptr<Buffer> BufferPtr;
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/CMakeLists.txt b/src/gfxstream/host/CMakeLists.txt
new file mode 100644
index 00000000000..3e280f1e334
--- /dev/null
+++ b/src/gfxstream/host/CMakeLists.txt
@@ -0,0 +1,357 @@
+# Codec common sources
+add_subdirectory(apigen-codec-common)
+add_subdirectory(compressedTextureFormats)
+
+# GL
+add_subdirectory(gl)
+
+# Vulkan
+add_subdirectory(vulkan)
+
+# RenderControl decoder
+add_subdirectory(renderControl_dec)
+
+# Magma decoder
+add_subdirectory(magma)
+
+if(CONFIG_AEMU)
+ add_compile_definitions(CONFIG_AEMU)
+endif()
+
+# Stream server core
+set(stream-server-core-sources
+ Buffer.cpp
+ BlobManager.cpp
+ ColorBuffer.cpp
+ GfxStreamAgents.cpp
+ VirtioGpuTimelines.cpp
+ VsyncThread.cpp
+ ChannelStream.cpp
+ DisplaySurface.cpp
+ DisplaySurfaceUser.cpp
+ Hwc2.cpp
+ PostWorker.cpp
+ PostWorkerGl.cpp
+ ReadBuffer.cpp
+ RenderChannelImpl.cpp
+ RenderThreadInfo.cpp
+ RenderThreadInfoGl.cpp
+ RenderThreadInfoMagma.cpp
+ RingStream.cpp
+ SyncThread.cpp
+ RenderThread.cpp
+ RenderControl.cpp
+ RenderWindow.cpp
+ RenderLibImpl.cpp
+ RendererImpl.cpp
+ FrameBuffer.cpp)
+if (APPLE)
+ set(stream-server-core-platform-sources NativeSubWindow_cocoa.m)
+elseif (WIN32)
+ set(stream-server-core-platform-sources NativeSubWindow_win32.cpp)
+elseif (QNX)
+ set(stream-server-core-platform-sources NativeSubWindow_qnx.cpp)
+else()
+ set(stream-server-core-platform-sources NativeSubWindow_x11.cpp)
+endif()
+
+add_library(
+ gfxstream_backend_headers
+ INTERFACE)
+target_include_directories(
+ gfxstream_backend_headers
+ INTERFACE
+ include)
+
+# Compile everything as a static library first so that unit tests can call non-exported functions
+add_library(
+ gfxstream_backend_static
+ STATIC
+ ${stream-server-core-sources}
+ ${stream-server-core-platform-sources}
+)
+target_link_libraries(
+ gfxstream_backend_static
+ PUBLIC
+ GLES_CM_translator_static
+ OpenGLESDispatch
+ renderControl_dec
+ gfxstream-gl-server
+ gfxstream-magma-server
+ gfxstream-vulkan-server
+ gfxstream_egl_headers
+ gfxstream-snapshot
+ apigen-codec-common
+ ${GFXSTREAM_HOST_COMMON_LIB}
+ ${GFXSTREAM_BASE_LIB})
+
+target_include_directories(
+ gfxstream_backend_static
+ PUBLIC
+ ${GFXSTREAM_REPO_ROOT}
+ ${GFXSTREAM_REPO_ROOT}/include
+ ${GFXSTREAM_REPO_ROOT}/host
+ ${GFXSTREAM_REPO_ROOT}/host/include
+ ${GFXSTREAM_REPO_ROOT}/host/apigen-codec-common
+ ${GFXSTREAM_REPO_ROOT}/host/gl
+ ${GFXSTREAM_REPO_ROOT}/host/gl/glestranslator/include
+ ${GFXSTREAM_REPO_ROOT}/host/magma
+ ${GFXSTREAM_REPO_ROOT}/host/magma/magma_dec
+ ${GFXSTREAM_REPO_ROOT}/host/vulkan
+ ${GFXSTREAM_REPO_ROOT}/host/vulkan/cereal/common
+ ${GFXSTREAM_REPO_ROOT}/third-party/fuchsia/magma/include
+ ${GFXSTREAM_REPO_ROOT}/third-party/glm/include)
+
+if (APPLE)
+ target_link_libraries(gfxstream_backend_static PUBLIC "-framework AppKit -framework QuartzCore -framework IOSurface")
+endif()
+if (WIN32)
+ target_link_libraries(gfxstream_backend_static PRIVATE D3d9.lib)
+endif()
+
+# Suppress some warnings generated by platform/aemu repo
+target_compile_options(
+ gfxstream_backend_static
+ PRIVATE
+ -Wno-invalid-offsetof
+ -Wno-free-nonheap-object
+ -Wno-attributes
+ -DGFXSTREAM_ENABLE_HOST_GLES=1
+ )
+
+# gfxstream_backend.dll
+add_library(
+ gfxstream_backend
+ SHARED
+ render_api.cpp
+ virtio-gpu-gfxstream-renderer.cpp)
+
+target_link_libraries(
+ gfxstream_backend
+ PUBLIC
+ gfxstream_backend_static
+ PRIVATE
+ )
+
+if(BUILD_STANDALONE)
+ target_link_libraries(gfxstream_backend
+ PRIVATE
+ gfxstream-gl-host-common)
+endif()
+
+if (APPLE)
+ set_target_properties(gfxstream_backend
+ PROPERTIES
+ LINK_FLAGS "-undefined dynamic_lookup -flat_namespace")
+endif()
+
+if(CONFIG_AEMU)
+ android_install_shared(gfxstream_backend)
+else()
+ install(
+ TARGETS gfxstream_backend RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX})
+endif()
+
+# Testing libraries
+add_subdirectory(testlibs)
+
+if (ENABLE_VKCEREAL_TESTS)
+
+set(LIST_OF_TESTS)
+function(discover_tests test_name)
+if (WIN32)
+ gtest_discover_tests(
+ ${test_name}
+ ${ARGN})
+ list(APPEND LIST_OF_TESTS ${test_name})
+ set(LIST_OF_TESTS ${LIST_OF_TESTS} PARENT_SCOPE)
+else()
+ gtest_discover_tests(
+ ${test_name}
+ ${ARGN}
+ )
+endif()
+endfunction()
+ # Backend unit tests
+ add_executable(
+ gfxstream_backend_unittests
+ gfxstream_unittest.cpp)
+ target_link_libraries(
+ gfxstream_backend_unittests
+ PRIVATE
+ OSWindow
+ gfxstream_backend
+ aemu-host-common-testing-support
+ ${GFXSTREAM_BASE_LIB}
+ gtest_main)
+ discover_tests(gfxstream_backend_unittests)
+
+ # More functional tests#########################################################
+
+ # Common testing support library################################################
+ # This includes the server core and testing sources
+ add_library(
+ stream-server-testing-support
+ tests/SampleApplication.cpp
+ tests/GLSnapshotTesting.cpp
+ tests/OpenGLTestContext.cpp
+ tests/GLTestUtils.cpp
+ tests/ShaderUtils.cpp
+ tests/GLSnapshotTestDispatch.cpp
+ tests/GLSnapshotTestStateUtils.cpp
+ tests/HelloTriangleImp.cpp
+ tests/ImageUtils.cpp)
+ target_include_directories(
+ stream-server-testing-support
+ PUBLIC
+ ${GFXSTREAM_REPO_ROOT}
+ ${GFXSTREAM_REPO_ROOT}/include
+ ${GFXSTREAM_REPO_ROOT}/host
+ ${GFXSTREAM_REPO_ROOT}/host/gl/glestranslator/GLES_CM
+ ${GFXSTREAM_REPO_ROOT}/host/gl/glestranslator/include
+ ${GFXSTREAM_REPO_ROOT}/host/apigen-codec-common
+ ${GFXSTREAM_REPO_ROOT}/host/vulkan)
+ target_link_libraries(
+ stream-server-testing-support
+ PUBLIC
+ aemu-host-common-testing-support
+ aemu-base-testing-support
+ gfxstream_backend_static
+ gfxstream_stb
+ OSWindow
+ gtest)
+
+ if (LINUX)
+ add_library(
+ x11_testing_support
+ tests/X11TestingSupport.cpp)
+ target_link_libraries(
+ x11_testing_support
+ aemu-base.headers)
+ endif()
+
+ # Basic opengl rendering tests##################################################
+ add_executable(
+ OpenglRender_unittests
+ tests/FrameBuffer_unittest.cpp
+ tests/GLES1Dispatch_unittest.cpp
+ tests/DefaultFramebufferBlit_unittest.cpp
+ tests/TextureDraw_unittest.cpp
+ tests/StalePtrRegistry_unittest.cpp
+ tests/VsyncThread_unittest.cpp)
+ target_link_libraries(
+ OpenglRender_unittests
+ PRIVATE
+ stream-server-testing-support
+ aemu-host-common-testing-support
+ aemu-base-testing-support
+ gfxstream_backend_static
+ gtest_main)
+ if (LINUX)
+ target_compile_definitions(
+ OpenglRender_unittests
+ PRIVATE GFXSTREAM_HAS_X11=1)
+ target_link_libraries(
+ OpenglRender_unittests
+ PRIVATE x11_testing_support)
+ endif()
+ discover_tests(OpenglRender_unittests)
+
+ # Snapshot tests################################################################
+ add_executable(
+ OpenglRender_snapshot_unittests
+ tests/GLSnapshotBuffers_unittest.cpp
+ tests/GLSnapshotFramebufferControl_unittest.cpp
+ tests/GLSnapshotFramebuffers_unittest.cpp
+ tests/GLSnapshotMultisampling_unittest.cpp
+ tests/GLSnapshotPixelOperations_unittest.cpp
+ tests/GLSnapshotPixels_unittest.cpp
+ tests/GLSnapshotPrograms_unittest.cpp
+ tests/GLSnapshotRasterization_unittest.cpp
+ tests/GLSnapshotRenderbuffers_unittest.cpp
+ tests/GLSnapshotRendering_unittest.cpp
+ tests/GLSnapshotShaders_unittest.cpp
+ tests/GLSnapshotTextures_unittest.cpp
+ tests/GLSnapshotTransformation_unittest.cpp
+ tests/GLSnapshotVertexAttributes_unittest.cpp
+ tests/GLSnapshot_unittest.cpp)
+ target_link_libraries(
+ OpenglRender_snapshot_unittests
+ PRIVATE
+ stream-server-testing-support
+ aemu-host-common-testing-support
+ aemu-base-testing-support
+ gfxstream_backend_static
+ gtest_main)
+ discover_tests(OpenglRender_snapshot_unittests)
+
+ # Vulkan tests##################################################################
+ add_executable(
+ Vulkan_unittests
+ tests/Vulkan_unittest.cpp
+ tests/CompositorVk_unittest.cpp
+ tests/SwapChainStateVk_unittest.cpp
+ tests/DisplayVk_unittest.cpp
+ tests/VirtioGpuTimelines_unittest.cpp
+ vulkan/vk_util_unittest.cpp
+ vulkan/VkFormatUtils_unittest.cpp
+ vulkan/VkQsriTimeline_unittest.cpp
+ vulkan/VkDecoderGlobalState_unittest.cpp
+ )
+ target_link_libraries(
+ Vulkan_unittests
+ PRIVATE
+ stream-server-testing-support
+ aemu-host-common-testing-support
+ aemu-base-testing-support
+ gfxstream_backend_static
+ gtest
+ gtest_main
+ gmock)
+ if (APPLE)
+ target_compile_definitions(Vulkan_unittests PRIVATE -DVK_USE_PLATFORM_METAL_EXT)
+ target_link_libraries(Vulkan_unittests PUBLIC "-framework AppKit")
+ endif()
+ discover_tests(
+ Vulkan_unittests
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+
+ if (APPLE)
+ target_compile_definitions(Vulkan_unittests PRIVATE -DVK_USE_PLATFORM_METAL_EXT)
+ elseif (QNX)
+ target_compile_definitions(Vulkan_unittests PRIVATE -DVK_USE_PLATFORM_SCREEN_QNX)
+ elseif (UNIX)
+ target_compile_definitions(Vulkan_unittests PRIVATE -DVK_USE_PLATFORM_XCB_KHR)
+ endif()
+
+
+ file(GLOB Vulkan_unittests_datafiles "tests/testdata/*.png")
+ add_custom_command(TARGET Vulkan_unittests POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory
+ ${CMAKE_BINARY_DIR}/tests/testdata
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${Vulkan_unittests_datafiles}
+ ${CMAKE_BINARY_DIR}/tests/testdata)
+
+ add_executable(
+ Vulkan_integrationtests
+ vulkan/testing/VkDecoderTestDispatch.h
+ vulkan/testing/VulkanTestHelper.cpp
+ )
+ target_link_libraries(
+ Vulkan_integrationtests
+ PRIVATE
+ gfxstream_backend_static
+ gfxstream-gl-server
+ gfxstream-vulkan-server
+ stream-server-testing-support
+ gtest
+ gtest_main
+ gmock)
+ discover_tests(Vulkan_integrationtests)
+endif()
+if (WIN32)
+ set(BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+ configure_file(../cmake/SetWin32TestEnvironment.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/SetWin32TestEnvironment.cmake @ONLY)
+ set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES ${CMAKE_CURRENT_BINARY_DIR}/SetWin32TestEnvironment.cmake)
+endif()
diff --git a/src/gfxstream/host/ChannelStream.cpp b/src/gfxstream/host/ChannelStream.cpp
new file mode 100644
index 00000000000..3e9f413a18a
--- /dev/null
+++ b/src/gfxstream/host/ChannelStream.cpp
@@ -0,0 +1,130 @@
+// 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 "ChannelStream.h"
+
+#include "render-utils/RenderChannel.h"
+
+#define EMUGL_DEBUG_LEVEL 0
+#include "host-common/debug.h"
+#include "host-common/dma_device.h"
+#include "host-common/GfxstreamFatalError.h"
+
+#include <assert.h>
+#include <memory.h>
+
+namespace gfxstream {
+
+using IoResult = RenderChannel::IoResult;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+ChannelStream::ChannelStream(RenderChannelImpl* channel, size_t bufSize)
+ : IOStream(bufSize), mChannel(channel) {
+ mWriteBuffer.resize_noinit(bufSize);
+}
+
+void* ChannelStream::allocBuffer(size_t minSize) {
+ if (mWriteBuffer.size() < minSize) {
+ mWriteBuffer.resize_noinit(minSize);
+ }
+ return mWriteBuffer.data();
+}
+
+int ChannelStream::commitBuffer(size_t size) {
+ assert(size <= mWriteBuffer.size());
+ if (mWriteBuffer.isAllocated()) {
+ mWriteBuffer.resize(size);
+ mChannel->writeToGuest(std::move(mWriteBuffer));
+ } else {
+ mChannel->writeToGuest(
+ RenderChannel::Buffer(mWriteBuffer.data(), mWriteBuffer.data() + size));
+ }
+ return size;
+}
+
+const unsigned char* ChannelStream::readRaw(void* buf, size_t* inout_len) {
+ size_t wanted = *inout_len;
+ size_t count = 0U;
+ auto dst = static_cast<uint8_t*>(buf);
+ D("wanted %d bytes", (int)wanted);
+ while (count < wanted) {
+ if (mReadBufferLeft > 0) {
+ size_t avail = std::min<size_t>(wanted - count, mReadBufferLeft);
+ memcpy(dst + count,
+ mReadBuffer.data() + (mReadBuffer.size() - mReadBufferLeft),
+ avail);
+ count += avail;
+ mReadBufferLeft -= avail;
+ continue;
+ }
+ bool blocking = (count == 0);
+ auto result = mChannel->readFromGuest(&mReadBuffer, blocking);
+ D("readFromGuest() returned %d, size %d", (int)result, (int)mReadBuffer.size());
+ if (result == IoResult::Ok) {
+ mReadBufferLeft = mReadBuffer.size();
+ continue;
+ }
+ if (count > 0) { // There is some data to return.
+ break;
+ }
+ // Result can only be IoResult::Error if |count| == 0
+ // since |blocking| was true, it cannot be IoResult::TryAgain.
+ assert(result == IoResult::Error);
+ D("error while trying to read");
+ return nullptr;
+ }
+ *inout_len = count;
+ D("read %d bytes", (int)count);
+ return (const unsigned char*)buf;
+}
+
+void* ChannelStream::getDmaForReading(uint64_t guest_paddr) {
+ return emugl::g_emugl_dma_get_host_addr(guest_paddr);
+}
+
+void ChannelStream::unlockDma(uint64_t guest_paddr) { emugl::g_emugl_dma_unlock(guest_paddr); }
+
+void ChannelStream::forceStop() {
+ mChannel->stopFromHost();
+}
+
+int ChannelStream::writeFully(const void* buf, size_t len) {
+ void* dstBuf = alloc(len);
+ memcpy(dstBuf, buf, len);
+ flush();
+ return 0;
+}
+
+const unsigned char *ChannelStream::readFully( void *buf, size_t len) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "not intended for use with ChannelStream";
+}
+
+void ChannelStream::onSave(android::base::Stream* stream) {
+ // Write only the data that's left in read buffer, but in the same format
+ // as saveBuffer() does.
+ stream->putBe32(mReadBufferLeft);
+ stream->write(mReadBuffer.data() + mReadBuffer.size() - mReadBufferLeft,
+ mReadBufferLeft);
+ android::base::saveBuffer(stream, mWriteBuffer);
+}
+
+unsigned char* ChannelStream::onLoad(android::base::Stream* stream) {
+ android::base::loadBuffer(stream, &mReadBuffer);
+ mReadBufferLeft = mReadBuffer.size();
+ android::base::loadBuffer(stream, &mWriteBuffer);
+ return reinterpret_cast<unsigned char*>(mWriteBuffer.data());
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/ChannelStream.h b/src/gfxstream/host/ChannelStream.h
new file mode 100644
index 00000000000..33c77baa4dd
--- /dev/null
+++ b/src/gfxstream/host/ChannelStream.h
@@ -0,0 +1,51 @@
+// 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 "render-utils/IOStream.h"
+#include "RenderChannelImpl.h"
+
+#include <memory>
+
+namespace gfxstream {
+
+// An IOStream instance that can be used by the host RenderThread to
+// wrap a RenderChannelImpl channel.
+class ChannelStream final : public IOStream {
+public:
+ ChannelStream(RenderChannelImpl* channel, size_t bufSize);
+
+ void forceStop();
+ int writeFully(const void* buf, size_t len) override;
+ const unsigned char *readFully( void *buf, size_t len) override;
+
+protected:
+ virtual void* allocBuffer(size_t minSize) override final;
+ virtual int commitBuffer(size_t size) override final;
+ virtual const unsigned char* readRaw(void* buf, size_t* inout_len)
+ override final;
+ virtual void* getDmaForReading(uint64_t guest_paddr) override final;
+ virtual void unlockDma(uint64_t guest_paddr) override final;
+
+ void onSave(android::base::Stream* stream) override;
+ unsigned char* onLoad(android::base::Stream* stream) override;
+
+private:
+ RenderChannelImpl* mChannel;
+ RenderChannel::Buffer mWriteBuffer;
+ RenderChannel::Buffer mReadBuffer;
+ size_t mReadBufferLeft = 0;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/ColorBuffer.cpp b/src/gfxstream/host/ColorBuffer.cpp
new file mode 100644
index 00000000000..3cdecbfb06e
--- /dev/null
+++ b/src/gfxstream/host/ColorBuffer.cpp
@@ -0,0 +1,573 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "ColorBuffer.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "gl/EmulationGl.h"
+#endif
+
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+#include "vulkan/ColorBufferVk.h"
+#include "vulkan/VkCommonOperations.h"
+
+using android::base::ManagedDescriptor;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+namespace gfxstream {
+namespace {
+
+// ColorBufferVk natively supports YUV images. However, ColorBufferGl
+// needs to emulate YUV support by having an underlying RGBA texture
+// and adding in additional YUV<->RGBA conversions when needed. The
+// memory should not be shared between the VK YUV image and the GL RGBA
+// texture.
+bool shouldAttemptExternalMemorySharing(FrameworkFormat format) {
+ return format == FrameworkFormat::FRAMEWORK_FORMAT_GL_COMPATIBLE;
+}
+
+} // namespace
+
+ColorBuffer::ColorBuffer(HandleType handle, uint32_t width, uint32_t height, GLenum format,
+ FrameworkFormat frameworkFormat)
+ : mHandle(handle),
+ mWidth(width),
+ mHeight(height),
+ mFormat(format),
+ mFrameworkFormat(frameworkFormat) {}
+
+/*static*/
+std::shared_ptr<ColorBuffer> ColorBuffer::create(gl::EmulationGl* emulationGl,
+ vk::VkEmulation* emulationVk, uint32_t width,
+ uint32_t height, GLenum format,
+ FrameworkFormat frameworkFormat,
+ HandleType handle) {
+ std::shared_ptr<ColorBuffer> colorBuffer(
+ new ColorBuffer(handle, width, height, format, frameworkFormat));
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (emulationGl) {
+ colorBuffer->mColorBufferGl =
+ emulationGl->createColorBuffer(width, height, format, frameworkFormat, handle);
+ if (!colorBuffer->mColorBufferGl) {
+ ERR("Failed to initialize ColorBufferGl.");
+ return nullptr;
+ }
+ }
+#endif
+
+ if (emulationVk && emulationVk->live) {
+ const bool vulkanOnly = colorBuffer->mColorBufferGl == nullptr;
+
+ colorBuffer->mColorBufferVk =
+ vk::ColorBufferVk::create(handle, width, height, format, frameworkFormat, vulkanOnly,
+ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
+ if (!colorBuffer->mColorBufferVk) {
+ if (emulationGl) {
+ // Historically, ColorBufferVk setup was deferred until the first actual Vulkan
+ // usage. This allowed ColorBufferVk setup failures to be unintentionally avoided.
+ } else {
+ ERR("Failed to initialize ColorBufferVk.");
+ return nullptr;
+ }
+ }
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ bool b271028352Workaround = emulationGl && strstr(emulationGl->getGlesRenderer().c_str(), "Intel");
+
+ if (colorBuffer->mColorBufferGl && colorBuffer->mColorBufferVk &&
+ !b271028352Workaround && shouldAttemptExternalMemorySharing(frameworkFormat)) {
+ auto memoryExport = vk::exportColorBufferMemory(handle);
+ if (memoryExport) {
+ if (colorBuffer->mColorBufferGl->importMemory(
+ std::move(memoryExport->descriptor), memoryExport->size,
+ memoryExport->dedicatedAllocation, memoryExport->linearTiling)) {
+ colorBuffer->mGlAndVkAreSharingExternalMemory = true;
+ } else {
+ ERR("Failed to import memory to ColorBufferGl:%d", handle);
+ return nullptr;
+ }
+ }
+ }
+#endif
+
+ return colorBuffer;
+}
+
+/*static*/
+std::shared_ptr<ColorBuffer> ColorBuffer::onLoad(gl::EmulationGl* emulationGl, vk::VkEmulation*,
+ android::base::Stream* stream) {
+ const auto handle = static_cast<HandleType>(stream->getBe32());
+ const auto width = static_cast<uint32_t>(stream->getBe32());
+ const auto height = static_cast<uint32_t>(stream->getBe32());
+ const auto format = static_cast<GLenum>(stream->getBe32());
+ const auto frameworkFormat = static_cast<FrameworkFormat>(stream->getBe32());
+
+ std::shared_ptr<ColorBuffer> colorBuffer(
+ new ColorBuffer(handle, width, height, format, frameworkFormat));
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (emulationGl) {
+ colorBuffer->mColorBufferGl = emulationGl->loadColorBuffer(stream);
+ if (!colorBuffer->mColorBufferGl) {
+ ERR("Failed to load ColorBufferGl.");
+ return nullptr;
+ }
+ }
+#endif
+
+ colorBuffer->mNeedRestore = true;
+
+ return colorBuffer;
+}
+
+void ColorBuffer::onSave(android::base::Stream* stream) {
+ stream->putBe32(getHndl());
+ stream->putBe32(mWidth);
+ stream->putBe32(mHeight);
+ stream->putBe32(static_cast<uint32_t>(mFormat));
+ stream->putBe32(static_cast<uint32_t>(mFrameworkFormat));
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mColorBufferGl) {
+ mColorBufferGl->onSave(stream);
+ }
+#endif
+}
+
+void ColorBuffer::restore() {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mColorBufferGl) {
+ mColorBufferGl->restore();
+ }
+#endif
+}
+
+void ColorBuffer::readToBytes(int x, int y, int width, int height, GLenum pixelsFormat,
+ GLenum pixelsType, void* outPixels) {
+ touch();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mColorBufferGl) {
+ mColorBufferGl->readPixels(x, y, width, height, pixelsFormat, pixelsType, outPixels);
+ return;
+ }
+#endif
+
+ if (mColorBufferVk) {
+ mColorBufferVk->readToBytes(x, y, width, height, outPixels);
+ return;
+ }
+
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "No ColorBuffer impl?";
+}
+
+void ColorBuffer::readToBytesScaled(int pixelsWidth, int pixelsHeight, GLenum pixelsFormat,
+ GLenum pixelsType, int pixelsRotation, Rect rect,
+ void* outPixels) {
+ touch();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mColorBufferGl) {
+ mColorBufferGl->readPixelsScaled(pixelsWidth, pixelsHeight, pixelsFormat, pixelsType,
+ pixelsRotation, rect, outPixels);
+ return;
+ }
+#endif
+
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Unimplemented.";
+}
+
+void ColorBuffer::readYuvToBytes(int x, int y, int width, int height, void* outPixels,
+ uint32_t pixelsSize) {
+ touch();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mColorBufferGl) {
+ mColorBufferGl->readPixelsYUVCached(x, y, width, height, outPixels, pixelsSize);
+ return;
+ }
+#endif
+
+ if (mColorBufferVk) {
+ mColorBufferVk->readToBytes(x, y, width, height, outPixels);
+ return;
+ }
+
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "No ColorBuffer impl?";
+}
+
+bool ColorBuffer::updateFromBytes(int x, int y, int width, int height,
+ FrameworkFormat frameworkFormat, GLenum pixelsFormat,
+ GLenum pixelsType, const void* pixels, void* metadata) {
+ touch();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mColorBufferGl) {
+ mColorBufferGl->subUpdateFromFrameworkFormat(x, y, width, height, frameworkFormat,
+ pixelsFormat, pixelsType, pixels, metadata);
+ return true;
+ }
+#endif
+
+ if (mColorBufferVk) {
+ return mColorBufferVk->updateFromBytes(x, y, width, height, pixels);
+ }
+
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "No ColorBuffer impl?";
+ return false;
+}
+
+bool ColorBuffer::updateFromBytes(int x, int y, int width, int height, GLenum pixelsFormat,
+ GLenum pixelsType, const void* pixels) {
+ touch();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mColorBufferGl) {
+ return mColorBufferGl->subUpdate(x, y, width, height, pixelsFormat, pixelsType, pixels);
+ }
+#endif
+
+ if (mColorBufferVk) {
+ return mColorBufferVk->updateFromBytes(x, y, width, height, pixels);
+ }
+
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "No ColorBuffer impl?";
+ return false;
+}
+
+bool ColorBuffer::updateGlFromBytes(const void* bytes, std::size_t bytesSize) {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mColorBufferGl) {
+ touch();
+
+ return mColorBufferGl->replaceContents(bytes, bytesSize);
+ }
+#endif
+
+ return true;
+}
+
+std::unique_ptr<BorrowedImageInfo> ColorBuffer::borrowForComposition(UsedApi api, bool isTarget) {
+ switch (api) {
+ case UsedApi::kGl: {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+ return mColorBufferGl->getBorrowedImageInfo();
+#endif
+ }
+ case UsedApi::kVk: {
+ if (!mColorBufferVk) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+ return vk::borrowColorBufferForComposition(getHndl(), isTarget);
+ }
+ }
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Unimplemented";
+ return nullptr;
+}
+
+std::unique_ptr<BorrowedImageInfo> ColorBuffer::borrowForDisplay(UsedApi api) {
+ switch (api) {
+ case UsedApi::kGl: {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+ return mColorBufferGl->getBorrowedImageInfo();
+#endif
+ }
+ case UsedApi::kVk: {
+ if (!mColorBufferVk) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+ return vk::borrowColorBufferForDisplay(getHndl());
+ }
+ }
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Unimplemented";
+ return nullptr;
+}
+
+bool ColorBuffer::flushFromGl() {
+ if (!(mColorBufferGl && mColorBufferVk)) {
+ return true;
+ }
+
+ if (mGlAndVkAreSharingExternalMemory) {
+ return true;
+ }
+
+ // ColorBufferGl is currently considered the "main" backing. If this changes,
+ // the "main" should be updated from the current contents of the GL backing.
+ return true;
+}
+
+bool ColorBuffer::flushFromVk() {
+ if (!(mColorBufferGl && mColorBufferVk)) {
+ return true;
+ }
+
+ if (mGlAndVkAreSharingExternalMemory) {
+ return true;
+ }
+ std::vector<uint8_t> contents;
+ if (!vk::readColorBufferToBytes(mHandle, &contents)) {
+ ERR("Failed to get VK contents for ColorBuffer:%d", mHandle);
+ return false;
+ }
+
+ if (contents.empty()) {
+ return false;
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (!mColorBufferGl->replaceContents(contents.data(), contents.size())) {
+ ERR("Failed to set GL contents for ColorBuffer:%d", mHandle);
+ return false;
+ }
+#endif
+
+ return true;
+}
+
+bool ColorBuffer::flushFromVkBytes(const void* bytes, size_t bytesSize) {
+ if (!(mColorBufferGl && mColorBufferVk)) {
+ return true;
+ }
+
+ if (mGlAndVkAreSharingExternalMemory) {
+ return true;
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mColorBufferGl) {
+ if (!mColorBufferGl->replaceContents(bytes, bytesSize)) {
+ ERR("Failed to update ColorBuffer:%d GL backing from VK bytes.", mHandle);
+ return false;
+ }
+ }
+#endif
+
+ return true;
+}
+
+bool ColorBuffer::invalidateForGl() {
+ if (!(mColorBufferGl && mColorBufferVk)) {
+ return true;
+ }
+
+ if (mGlAndVkAreSharingExternalMemory) {
+ return true;
+ }
+
+ // ColorBufferGl is currently considered the "main" backing. If this changes,
+ // the GL backing should be updated from the "main" backing.
+ return true;
+}
+
+bool ColorBuffer::invalidateForVk() {
+ if (!(mColorBufferGl && mColorBufferVk)) {
+ return true;
+ }
+
+ if (mGlAndVkAreSharingExternalMemory) {
+ return true;
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ std::size_t contentsSize = 0;
+ if (!mColorBufferGl->readContents(&contentsSize, nullptr)) {
+ ERR("Failed to get GL contents size for ColorBuffer:%d", mHandle);
+ return false;
+ }
+
+ std::vector<uint8_t> contents(contentsSize, 0);
+
+ if (!mColorBufferGl->readContents(&contentsSize, contents.data())) {
+ ERR("Failed to get GL contents for ColorBuffer:%d", mHandle);
+ return false;
+ }
+
+ if (!mColorBufferVk->updateFromBytes(contents)) {
+ ERR("Failed to set VK contents for ColorBuffer:%d", mHandle);
+ return false;
+ }
+#endif
+
+ return true;
+}
+
+bool ColorBuffer::importNativeResource(void* nativeResource, uint32_t type, bool preserveContent) {
+ switch (type) {
+ case RESOURCE_TYPE_VK_EXT_MEMORY_HANDLE: {
+ if (mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Native resource import type %s is invalid when GL emulation is active. "
+ << "Use RESOURCE_TYPE_EGL_NATIVE_PIXMAP of RESOURCE_TYPE_EGL_IMAGE imports "
+ "instead.";
+ return false;
+ } else if (!mColorBufferVk) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Vulkan emulation must be available for RESOURCE_TYPE_VK_EXT_MEMORY_HANDLE "
+ "import.";
+ return false;
+ }
+ return mColorBufferVk->importExtMemoryHandle(nativeResource, type, preserveContent);
+ }
+ default:
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Unrecognized type for ColorBuffer::importNativeResource.";
+ return false;
+ }
+}
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+bool ColorBuffer::glOpBlitFromCurrentReadBuffer() {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ touch();
+
+ return mColorBufferGl->blitFromCurrentReadBuffer();
+}
+
+bool ColorBuffer::glOpBindToTexture() {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ touch();
+
+ return mColorBufferGl->bindToTexture();
+}
+
+bool ColorBuffer::glOpBindToTexture2() {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ return mColorBufferGl->bindToTexture2();
+}
+
+bool ColorBuffer::glOpBindToRenderbuffer() {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ touch();
+
+ return mColorBufferGl->bindToRenderbuffer();
+}
+
+GLuint ColorBuffer::glOpGetTexture() {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ touch();
+
+ return mColorBufferGl->getTexture();
+}
+
+void ColorBuffer::glOpReadback(unsigned char* img, bool readbackBgra) {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ touch();
+
+ return mColorBufferGl->readback(img, readbackBgra);
+}
+
+void ColorBuffer::glOpReadbackAsync(GLuint buffer, bool readbackBgra) {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ touch();
+
+ mColorBufferGl->readbackAsync(buffer, readbackBgra);
+}
+
+bool ColorBuffer::glOpImportEglImage(void* image, bool preserveContent) {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ return mColorBufferGl->importEglImage(image, preserveContent);
+}
+
+bool ColorBuffer::glOpImportEglNativePixmap(void* pixmap, bool preserveContent) {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ return mColorBufferGl->importEglNativePixmap(pixmap, preserveContent);
+}
+
+void ColorBuffer::glOpSwapYuvTexturesAndUpdate(GLenum format, GLenum type,
+ FrameworkFormat frameworkFormat, GLuint* textures) {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ mColorBufferGl->swapYUVTextures(frameworkFormat, textures);
+
+ // This makes ColorBufferGl regenerate the RGBA texture using
+ // YUVConverter::drawConvert() with the updated YUV textures.
+ mColorBufferGl->subUpdate(0, 0, mWidth, mHeight, format, type, nullptr);
+
+ flushFromGl();
+}
+
+bool ColorBuffer::glOpReadContents(size_t* outNumBytes, void* outContents) {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ return mColorBufferGl->readContents(outNumBytes, outContents);
+}
+
+bool ColorBuffer::glOpIsFastBlitSupported() const {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ return mColorBufferGl->isFastBlitSupported();
+}
+
+void ColorBuffer::glOpPostLayer(const ComposeLayer& l, int frameWidth, int frameHeight) {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ mColorBufferGl->postLayer(l, frameWidth, frameHeight);
+}
+
+void ColorBuffer::glOpPostViewportScaledWithOverlay(float rotation, float dx, float dy) {
+ if (!mColorBufferGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "ColorBufferGl not available.";
+ }
+
+ mColorBufferGl->postViewportScaledWithOverlay(rotation, dx, dy);
+}
+#endif
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/ColorBuffer.h b/src/gfxstream/host/ColorBuffer.h
new file mode 100644
index 00000000000..7056267c2a0
--- /dev/null
+++ b/src/gfxstream/host/ColorBuffer.h
@@ -0,0 +1,154 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <memory>
+
+#include "BorrowedImage.h"
+#include "FrameworkFormats.h"
+#include "Handle.h"
+#include "Hwc2.h"
+#include "aemu/base/files/Stream.h"
+#include "render-utils/Renderer.h"
+#include "snapshot/LazySnapshotObj.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "gl/ColorBufferGl.h"
+#else
+#include "GlesCompat.h"
+#endif
+
+namespace gfxstream {
+namespace gl {
+class EmulationGl;
+} // namespace gl
+} // namespace gfxstream
+
+namespace gfxstream {
+namespace vk {
+class ColorBufferVk;
+struct VkEmulation;
+} // namespace vk
+} // namespace gfxstream
+
+namespace gfxstream {
+
+class ColorBuffer : public android::snapshot::LazySnapshotObj<ColorBuffer> {
+ public:
+ static std::shared_ptr<ColorBuffer> create(gl::EmulationGl* emulationGl,
+ vk::VkEmulation* emulationVk, uint32_t width,
+ uint32_t height, GLenum format,
+ FrameworkFormat frameworkFormat, HandleType handle);
+
+ static std::shared_ptr<ColorBuffer> onLoad(gl::EmulationGl* emulationGl,
+ vk::VkEmulation* emulationVk,
+ android::base::Stream* stream);
+ void onSave(android::base::Stream* stream);
+ void restore();
+
+ HandleType getHndl() const { return mHandle; }
+ uint32_t getWidth() const { return mWidth; }
+ uint32_t getHeight() const { return mHeight; }
+ GLenum getFormat() const { return mFormat; }
+ FrameworkFormat getFrameworkFormat() const { return mFrameworkFormat; }
+
+ void readToBytes(int x, int y, int width, int height, GLenum pixelsFormat, GLenum pixelsType,
+ void* outPixels);
+ void readToBytesScaled(int pixelsWidth, int pixelsHeight, GLenum pixelsFormat,
+ GLenum pixelsType, int pixelsRotation, Rect rect, void* outPixels);
+ void readYuvToBytes(int x, int y, int width, int height, void* outPixels, uint32_t pixelsSize);
+
+ bool updateFromBytes(int x, int y, int width, int height, GLenum pixelsFormat,
+ GLenum pixelsType, const void* pixels);
+ bool updateFromBytes(int x, int y, int width, int height, FrameworkFormat frameworkFormat,
+ GLenum pixelsFormat, GLenum pixelsType, const void* pixels,
+ void* metadata = nullptr);
+ bool updateGlFromBytes(const void* bytes, std::size_t bytesSize);
+
+ enum class UsedApi {
+ kGl,
+ kVk,
+ };
+ std::unique_ptr<BorrowedImageInfo> borrowForComposition(UsedApi api, bool isTarget);
+ std::unique_ptr<BorrowedImageInfo> borrowForDisplay(UsedApi api);
+
+ bool flushFromGl();
+ bool flushFromVk();
+ bool flushFromVkBytes(const void* bytes, size_t bytesSize);
+ bool invalidateForGl();
+ bool invalidateForVk();
+ bool importNativeResource(void* nativeResource, uint32_t type, bool preserveContent);
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ GLuint glOpGetTexture();
+ bool glOpBlitFromCurrentReadBuffer();
+ bool glOpBindToTexture();
+ bool glOpBindToTexture2();
+ bool glOpBindToRenderbuffer();
+ void glOpReadback(unsigned char* img, bool readbackBgra);
+ void glOpReadbackAsync(GLuint buffer, bool readbackBgra);
+ bool glOpImportEglImage(void* image, bool preserveContent);
+ bool glOpImportEglNativePixmap(void* pixmap, bool preserveContent);
+ void glOpSwapYuvTexturesAndUpdate(GLenum format, GLenum type, FrameworkFormat frameworkFormat,
+ GLuint* textures);
+ bool glOpReadContents(size_t* outNumBytes, void* outContents);
+ bool glOpIsFastBlitSupported() const;
+ void glOpPostLayer(const ComposeLayer& l, int frameWidth, int frameHeight);
+ void glOpPostViewportScaledWithOverlay(float rotation, float dx, float dy);
+#endif
+
+ private:
+ ColorBuffer(HandleType, uint32_t width, uint32_t height, GLenum format,
+ FrameworkFormat frameworkFormat);
+
+ const HandleType mHandle;
+ const uint32_t mWidth;
+ const uint32_t mHeight;
+ const GLenum mFormat;
+ const FrameworkFormat mFrameworkFormat;
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ // If GL emulation is enabled.
+ std::unique_ptr<gl::ColorBufferGl> mColorBufferGl;
+#else
+ std::unique_ptr<uint32_t> mColorBufferGl = nullptr;
+#endif
+
+ // If Vk emulation is enabled.
+ std::unique_ptr<vk::ColorBufferVk> mColorBufferVk;
+
+ bool mGlAndVkAreSharingExternalMemory = false;
+};
+
+typedef std::shared_ptr<ColorBuffer> ColorBufferPtr;
+
+struct ColorBufferRef {
+ ColorBufferPtr cb;
+ uint32_t refcount; // number of client-side references
+
+ // Tracks whether opened at least once. In O+,
+ // color buffers can be created/closed immediately,
+ // but then registered (opened) afterwards.
+ bool opened;
+
+ // Tracks the time when this buffer got a close request while not being
+ // opened yet.
+ uint64_t closedTs;
+};
+
+typedef std::unordered_map<HandleType, ColorBufferRef> ColorBufferMap;
+typedef std::unordered_multiset<HandleType> ColorBufferSet;
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/Compositor.h b/src/gfxstream/host/Compositor.h
new file mode 100644
index 00000000000..cccd693e8ec
--- /dev/null
+++ b/src/gfxstream/host/Compositor.h
@@ -0,0 +1,48 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <future>
+#include <optional>
+#include <vector>
+
+#include "BorrowedImage.h"
+#include "Hwc2.h"
+
+namespace gfxstream {
+
+// Thread hostile and should only be called from the same single thread.
+class Compositor {
+ public:
+ virtual ~Compositor() {}
+
+ struct CompositionRequestLayer {
+ std::unique_ptr<BorrowedImageInfo> source;
+ ComposeLayer props;
+ };
+
+ struct CompositionRequest {
+ std::unique_ptr<BorrowedImageInfo> target;
+ std::vector<CompositionRequestLayer> layers;
+ };
+
+ using CompositionFinishedWaitable = std::shared_future<void>;
+
+ virtual CompositionFinishedWaitable compose(const CompositionRequest& compositionRequest) = 0;
+
+ virtual void onImageDestroyed(uint32_t imageId) {}
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/ContextHelper.h b/src/gfxstream/host/ContextHelper.h
new file mode 100644
index 00000000000..3aa811aea4f
--- /dev/null
+++ b/src/gfxstream/host/ContextHelper.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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+namespace gfxstream {
+namespace gl {
+class TextureDraw;
+} // namespace gl
+} // namespace gfxstream
+
+namespace gfxstream {
+
+// ContextHelper interface class used during Buffer and ColorBuffer
+// operations. This is introduced to remove coupling from the FrameBuffer
+// class implementation.
+class ContextHelper {
+ public:
+ ContextHelper() = default;
+ virtual ~ContextHelper() = default;
+ virtual bool setupContext() = 0;
+ virtual void teardownContext() = 0;
+ virtual bool isBound() const = 0;
+};
+
+// Helper class to use a ContextHelper for some set of operations.
+// Usage is pretty simple:
+//
+// {
+// RecursiveScopedContextBind context(m_helper);
+// if (!context.isOk()) {
+// return false; // something bad happened.
+// }
+// .... do something ....
+// } // automatically calls m_helper->teardownContext();
+//
+class RecursiveScopedContextBind {
+ public:
+ RecursiveScopedContextBind(ContextHelper* helper) : mHelper(helper) {
+ mIsBound = helper->setupContext();
+ }
+
+ bool isOk() const { return mIsBound; }
+
+ ~RecursiveScopedContextBind() { release(); }
+
+ void release() {
+ if (mIsBound) {
+ mHelper->teardownContext();
+ mIsBound = false;
+ }
+ }
+
+ private:
+ ContextHelper* mHelper;
+ bool mIsBound = false;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/Display.h b/src/gfxstream/host/Display.h
new file mode 100644
index 00000000000..e5c4d9b9762
--- /dev/null
+++ b/src/gfxstream/host/Display.h
@@ -0,0 +1,33 @@
+// 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.
+
+#pragma once
+
+#include <future>
+
+#include "DisplaySurfaceUser.h"
+
+namespace gfxstream {
+
+class Display : public DisplaySurfaceUser {
+ public:
+ struct PostResult {
+ bool success = false;
+ std::shared_future<void> postCompletedWaitable;
+ };
+
+ // TODO(b/233939967): move post()/viewport()/clear() interface here.
+};
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/DisplaySurface.cpp b/src/gfxstream/host/DisplaySurface.cpp
new file mode 100644
index 00000000000..b9d97fe976f
--- /dev/null
+++ b/src/gfxstream/host/DisplaySurface.cpp
@@ -0,0 +1,71 @@
+// 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 "DisplaySurface.h"
+
+#include "Display.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+
+namespace gfxstream {
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+DisplaySurface::DisplaySurface(uint32_t width,
+ uint32_t height,
+ std::unique_ptr<DisplaySurfaceImpl> impl)
+ : mWidth(width),
+ mHeight(height),
+ mImpl(std::move(impl)) {}
+
+DisplaySurface::~DisplaySurface() {
+ if (!mBoundUsers.empty()) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "DisplaySurface destroyed while there are still users!";
+ }
+}
+
+uint32_t DisplaySurface::getWidth() const {
+ std::lock_guard<std::mutex> lock(mParamsMutex);
+ return mWidth;
+}
+
+uint32_t DisplaySurface::getHeight() const {
+ std::lock_guard<std::mutex> lock(mParamsMutex);
+ return mHeight;
+}
+
+void DisplaySurface::updateSize(uint32_t newWidth, uint32_t newHeight) {
+ {
+ std::lock_guard<std::mutex> lock(mParamsMutex);
+ if (mWidth != newWidth || mHeight != newHeight) {
+ mWidth = newWidth;
+ mHeight = newHeight;
+ }
+ }
+ for (auto & users : mBoundUsers) {
+ users->surfaceUpdated(this);
+ }
+}
+
+void DisplaySurface::registerUser(DisplaySurfaceUser* user) {
+ mBoundUsers.insert(user);
+}
+
+void DisplaySurface::unregisterUser(DisplaySurfaceUser* user) {
+ mBoundUsers.erase(user);
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/DisplaySurface.h b/src/gfxstream/host/DisplaySurface.h
new file mode 100644
index 00000000000..679439a8574
--- /dev/null
+++ b/src/gfxstream/host/DisplaySurface.h
@@ -0,0 +1,68 @@
+// 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.
+
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <mutex>
+#include <unordered_set>
+
+namespace gfxstream {
+
+class DisplaySurface;
+class DisplaySurfaceUser;
+
+// Base class used for controlling the lifetime of a particular surface
+// used for a display (e.g. EGLSurface or VkSurfaceKHR).
+class DisplaySurfaceImpl {
+ public:
+ virtual ~DisplaySurfaceImpl() {}
+};
+
+class DisplaySurface {
+ public:
+ DisplaySurface(uint32_t width,
+ uint32_t height,
+ std::unique_ptr<DisplaySurfaceImpl> impl);
+ ~DisplaySurface();
+
+ DisplaySurface(const DisplaySurface&) = delete;
+ DisplaySurface& operator=(const DisplaySurface&) = delete;
+
+ // Return the API specific implementation of a DisplaySurface. This
+ // should only be called by API specific components such as DisplayGl
+ // or DisplayVk.
+ const DisplaySurfaceImpl* getImpl() const { return mImpl.get(); }
+
+ uint32_t getWidth() const;
+ uint32_t getHeight() const;
+
+ void updateSize(uint32_t newWidth, uint32_t newHeight);
+
+ private:
+ friend class DisplaySurfaceUser;
+
+ void registerUser(DisplaySurfaceUser* user);
+ void unregisterUser(DisplaySurfaceUser* user);
+
+ mutable std::mutex mParamsMutex;
+ uint32_t mWidth = 0;
+ uint32_t mHeight = 0;
+
+ std::unique_ptr<DisplaySurfaceImpl> mImpl;
+ std::unordered_set<DisplaySurfaceUser*> mBoundUsers;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/DisplaySurfaceUser.cpp b/src/gfxstream/host/DisplaySurfaceUser.cpp
new file mode 100644
index 00000000000..a1b13f732ce
--- /dev/null
+++ b/src/gfxstream/host/DisplaySurfaceUser.cpp
@@ -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.
+
+#include <memory>
+
+#include "Display.h"
+#include "DisplaySurface.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+
+namespace gfxstream {
+
+using android::base::AutoLock;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+DisplaySurfaceUser::~DisplaySurfaceUser() {
+ if (mBoundSurface != nullptr) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Failed to unbind a DisplaySurface before DisplaySurfaceUser destruction.";
+ }
+}
+
+void DisplaySurfaceUser::bindToSurface(DisplaySurface* surface) {
+ AutoLock lock(mMutex);
+ if (mBoundSurface != nullptr) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Attempting to bind a DisplaySurface while another is already bound.";
+ }
+
+ this->bindToSurfaceImpl(surface);
+ surface->registerUser(this);
+ mBoundSurface = surface;
+}
+
+void DisplaySurfaceUser::unbindFromSurface() {
+ AutoLock lock(mMutex);
+ this->unbindFromSurfaceImpl();
+ if (mBoundSurface != nullptr) {
+ mBoundSurface->unregisterUser(this);
+ mBoundSurface = nullptr;
+ }
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/DisplaySurfaceUser.h b/src/gfxstream/host/DisplaySurfaceUser.h
new file mode 100644
index 00000000000..156b01d5ed5
--- /dev/null
+++ b/src/gfxstream/host/DisplaySurfaceUser.h
@@ -0,0 +1,52 @@
+// 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.
+
+#pragma once
+
+#include <stdint.h>
+
+#include "aemu/base/synchronization/Lock.h"
+
+namespace gfxstream {
+
+class DisplaySurface;
+class DisplaySurfaceUser;
+
+class DisplaySurfaceUser {
+ public:
+ virtual ~DisplaySurfaceUser();
+
+ public:
+ void bindToSurface(DisplaySurface* surface);
+
+ void unbindFromSurface();
+
+ protected:
+ virtual void bindToSurfaceImpl(DisplaySurface* surface) = 0;
+
+ virtual void surfaceUpdated(DisplaySurface* surface) = 0;
+
+ virtual void unbindFromSurfaceImpl() = 0;
+
+ const DisplaySurface* getBoundSurface() const { return mBoundSurface; }
+
+ protected:
+ android::base::Lock mMutex;
+
+ private:
+ friend class DisplaySurface;
+ DisplaySurface* mBoundSurface = nullptr;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/FrameBuffer.cpp b/src/gfxstream/host/FrameBuffer.cpp
new file mode 100644
index 00000000000..54f78b9816e
--- /dev/null
+++ b/src/gfxstream/host/FrameBuffer.cpp
@@ -0,0 +1,3836 @@
+/*
+* Copyright (C) 2011-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 "FrameBuffer.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include <iomanip>
+
+#if defined(__linux__)
+#include <sys/resource.h>
+#endif
+
+#include "ContextHelper.h"
+#include "Hwc2.h"
+#include "NativeSubWindow.h"
+#include "RenderThreadInfo.h"
+#include "SyncThread.h"
+#include "aemu/base/LayoutResolver.h"
+#include "aemu/base/Metrics.h"
+#include "aemu/base/SharedLibrary.h"
+#include "aemu/base/Tracing.h"
+#include "aemu/base/containers/Lookup.h"
+#include "aemu/base/files/StreamSerializing.h"
+#include "aemu/base/memory/MemoryTracker.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/system/System.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "GLESVersionDetector.h"
+#include "OpenGLESDispatch/DispatchTables.h"
+#include "OpenGLESDispatch/EGLDispatch.h"
+#include "PostWorkerGl.h"
+#include "RenderControl.h"
+#include "RenderThreadInfoGl.h"
+#include "gl/YUVConverter.h"
+#include "gl/gles2_dec/gles2_dec.h"
+#include "gl/glestranslator/EGL/EglGlobalInfo.h"
+#endif
+
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/crash_reporter.h"
+#include "host-common/feature_control.h"
+#include "host-common/logging.h"
+#include "host-common/misc.h"
+#include "host-common/opengl/misc.h"
+#include "host-common/vm_operations.h"
+#include "render-utils/MediaNative.h"
+#include "vulkan/DisplayVk.h"
+#include "vulkan/PostWorkerVk.h"
+#include "vulkan/VkCommonOperations.h"
+#include "vulkan/VkDecoderGlobalState.h"
+
+namespace gfxstream {
+
+using android::base::AutoLock;
+using android::base::ManagedDescriptor;
+using android::base::MetricEventVulkanOutOfMemory;
+using android::base::Stream;
+using android::base::WorkerProcessingResult;
+using emugl::ABORT_REASON_OTHER;
+using emugl::CreateHealthMonitor;
+using emugl::FatalError;
+using emugl::GfxApiLogger;
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+using gl::DisplaySurfaceGl;
+using gl::EmulatedEglConfig;
+using gl::EmulatedEglConfigList;
+using gl::EmulatedEglContext;
+using gl::EmulatedEglContextMap;
+using gl::EmulatedEglContextPtr;
+using gl::EmulatedEglFenceSync;
+using gl::EmulatedEglWindowSurface;
+using gl::EmulatedEglWindowSurfaceMap;
+using gl::EmulatedEglWindowSurfacePtr;
+using gl::EmulationGl;
+using gl::GLES_DISPATCH_MAX_VERSION_2;
+using gl::GLESApi;
+using gl::GLESApi_2;
+using gl::GLESApi_CM;
+using gl::GLESDispatchMaxVersion;
+using gl::RenderThreadInfoGl;
+using gl::s_egl;
+using gl::s_gles2;
+using gl::TextureDraw;
+using gl::YUVConverter;
+using gl::YUVPlane;
+#endif
+
+using gfxstream::vk::AstcEmulationMode;
+using gfxstream::vk::VkEmulationFeatures;
+
+// static std::string getTimeStampString() {
+// const time_t timestamp = android::base::getUnixTimeUs();
+// const struct tm *timeinfo = localtime(&timestamp);
+// // Target format: 07-31 4:44:33
+// char b[64];
+// snprintf(
+// b,
+// sizeof(b) - 1,
+// "%02u-%02u %02u:%02u:%02u",
+// timeinfo->tm_mon + 1,
+// timeinfo->tm_mday,
+// timeinfo->tm_hour,
+// timeinfo->tm_min,
+// timeinfo->tm_sec);
+// return std::string(b);
+// }
+
+// static unsigned int getUptimeMs() {
+// return android::base::getUptimeMs();
+// }
+
+static void dumpPerfStats() {
+ // auto usage = System::get()->getMemUsage();
+ // std::string memoryStats =
+ // emugl::getMemoryTracker()
+ // ? emugl::getMemoryTracker()->printUsage()
+ // : "";
+ // auto cpuUsage = emugl::getCpuUsage();
+ // std::string lastStats =
+ // cpuUsage ? cpuUsage->printUsage() : "";
+ // printf("%s Uptime: %u ms Resident memory: %f mb %s \n%s\n",
+ // getTimeStampString().c_str(), getUptimeMs(),
+ // (float)usage.resident / 1048576.0f, lastStats.c_str(),
+ // memoryStats.c_str());
+}
+
+class PerfStatThread : public android::base::Thread {
+public:
+ PerfStatThread(bool* perfStatActive) :
+ Thread(), m_perfStatActive(perfStatActive) {}
+
+ virtual intptr_t main() {
+ while (*m_perfStatActive) {
+ sleepMs(1000);
+ dumpPerfStats();
+ }
+ return 0;
+ }
+
+private:
+ bool* m_perfStatActive;
+};
+
+FrameBuffer* FrameBuffer::s_theFrameBuffer = NULL;
+HandleType FrameBuffer::s_nextHandle = 0;
+
+// A condition variable needed to wait for framebuffer initialization.
+namespace {
+struct InitializedGlobals {
+ android::base::Lock lock;
+ android::base::ConditionVariable condVar;
+};
+
+bool postOnlyOnMainThread() {
+#ifdef __APPLE__
+ return true;
+#else
+ return false;
+#endif
+}
+
+AstcEmulationMode getAstcEmulationMode() {
+ return AstcEmulationMode::Gpu;
+// return AstcEmulationMode::Cpu;
+}
+
+} // namespace
+
+// |sInitialized| caches the initialized framebuffer state - this way
+// happy path doesn't need to lock the mutex.
+static std::atomic<bool> sInitialized{false};
+static InitializedGlobals* sGlobals() {
+ static InitializedGlobals* g = new InitializedGlobals;
+ return g;
+}
+
+void FrameBuffer::waitUntilInitialized() {
+ if (sInitialized.load(std::memory_order_relaxed)) {
+ return;
+ }
+
+#if SNAPSHOT_PROFILE > 1
+ const auto startTime = android::base::getHighResTimeUs();
+#endif
+ {
+ AutoLock l(sGlobals()->lock);
+ sGlobals()->condVar.wait(
+ &l, [] { return sInitialized.load(std::memory_order_acquire); });
+ }
+#if SNAPSHOT_PROFILE > 1
+ printf("Waited for FrameBuffer initialization for %.03f ms\n",
+ (android::base::getHighResTimeUs() - startTime) / 1000.0);
+#endif
+}
+
+void MaybeIncreaseFileDescriptorSoftLimit() {
+#if defined(__linux__)
+ // Cuttlefish with Gfxstream on Nvidia and SwiftShader often hits the default nofile
+ // soft limit (1024) when running large test suites.
+ struct rlimit nofileLimits = {
+ .rlim_cur = 0,
+ .rlim_max = 0,
+ };
+
+ int ret = getrlimit(RLIMIT_NOFILE, &nofileLimits);
+ if (ret) {
+ ERR("Warning: failed to query nofile limits.");
+ return;
+ }
+
+ const auto softLimit = nofileLimits.rlim_cur;
+ const auto hardLimit = nofileLimits.rlim_max;
+
+ constexpr const rlim_t kDesiredNofileSoftLimit = 4096;
+
+ if (softLimit < kDesiredNofileSoftLimit) {
+ if (softLimit == hardLimit) {
+ ERR("Warning: unable to raise nofile soft limit - already at hard limit.");
+ return;
+ }
+
+ if (kDesiredNofileSoftLimit > hardLimit) {
+ ERR("Warning: unable to raise nofile soft limit to desired %d - hard limit is %d.",
+ static_cast<int>(kDesiredNofileSoftLimit), static_cast<int>(hardLimit));
+ }
+
+ const rlim_t requestedSoftLimit = std::min(kDesiredNofileSoftLimit, hardLimit);
+
+ struct rlimit requestedNofileLimits = {
+ .rlim_cur = requestedSoftLimit,
+ .rlim_max = hardLimit,
+ };
+
+ ret = setrlimit(RLIMIT_NOFILE, &requestedNofileLimits);
+ if (ret) {
+ ERR("Warning: failed to raise nofile soft limit to %d: %s (%d)",
+ static_cast<int>(requestedSoftLimit), strerror(errno), errno);
+ return;
+ }
+
+ GL_LOG("Raised nofile soft limit to %d.", static_cast<int>(requestedSoftLimit));
+ }
+#endif
+}
+
+bool FrameBuffer::initialize(int width, int height, bool useSubWindow, bool egl2egl) {
+ GL_LOG("FrameBuffer::initialize");
+
+ if (s_theFrameBuffer != NULL) {
+ return true;
+ }
+
+ MaybeIncreaseFileDescriptorSoftLimit();
+
+ android::base::initializeTracing();
+
+ //
+ // allocate space for the FrameBuffer object
+ //
+ std::unique_ptr<FrameBuffer> fb(new FrameBuffer(width, height, useSubWindow));
+ if (!fb) {
+ GL_LOG("Failed to create fb");
+ ERR("Failed to create fb\n");
+ return false;
+ }
+
+ std::unique_ptr<emugl::RenderDocWithMultipleVkInstances> renderDocMultipleVkInstances = nullptr;
+ if (!android::base::getEnvironmentVariable("ANDROID_EMU_RENDERDOC").empty()) {
+ SharedLibrary* renderdocLib = nullptr;
+#ifdef _WIN32
+ renderdocLib = SharedLibrary::open(R"(C:\Program Files\RenderDoc\renderdoc.dll)");
+#elif defined(__linux__)
+ renderdocLib = SharedLibrary::open("librenderdoc.so");
+#endif
+ fb->m_renderDoc = emugl::RenderDoc::create(renderdocLib);
+ if (fb->m_renderDoc) {
+ INFO("RenderDoc integration enabled.");
+ renderDocMultipleVkInstances =
+ std::make_unique<emugl::RenderDocWithMultipleVkInstances>(*fb->m_renderDoc);
+ if (!renderDocMultipleVkInstances) {
+ ERR("Failed to initialize RenderDoc with multiple VkInstances. Can't capture any "
+ "information from guest VkInstances with RenderDoc.");
+ }
+ }
+ }
+ // Initialize Vulkan emulation state
+ //
+ // Note: This must happen before any use of s_egl,
+ // or it's possible that the existing EGL display and contexts
+ // used by underlying EGL driver might become invalid,
+ // preventing new contexts from being created that share
+ // against those contexts.
+ vk::VkEmulation* vkEmu = nullptr;
+ vk::VulkanDispatch* vkDispatch = nullptr;
+ if (feature_is_enabled(kFeature_Vulkan)) {
+ vkDispatch = vk::vkDispatch(false /* not for testing */);
+ vkEmu = vk::createGlobalVkEmulation(vkDispatch,
+ feature_is_enabled(kFeature_VulkanNativeSwapchain));
+ if (!vkEmu) {
+ ERR("Failed to initialize global Vulkan emulation. Disable the Vulkan support.");
+ }
+ fb->m_emulationVk = vkEmu;
+ }
+ if (vkEmu) {
+ fb->m_vulkanEnabled = true;
+ if (feature_is_enabled(kFeature_VulkanNativeSwapchain)) {
+ fb->m_vkInstance = vkEmu->instance;
+ }
+ if (vkEmu->deviceInfo.supportsIdProperties) {
+ GL_LOG("Supports id properties, got a vulkan device UUID");
+ fprintf(stderr, "%s: Supports id properties, got a vulkan device UUID\n", __func__);
+ memcpy(fb->m_vulkanUUID.data(), vkEmu->deviceInfo.idProps.deviceUUID, VK_UUID_SIZE);
+ } else {
+ GL_LOG("Doesn't support id properties, no vulkan device UUID");
+ fprintf(stderr, "%s: Doesn't support id properties, no vulkan device UUID\n", __func__);
+ }
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ // Do not initialize GL emulation if the guest is using ANGLE.
+ if (!feature_is_enabled(kFeature_GuestUsesAngle)) {
+ fb->m_emulationGl = EmulationGl::create(width, height, useSubWindow, egl2egl);
+ if (!fb->m_emulationGl) {
+ ERR("Failed to initialize GL emulation.");
+ return false;
+ }
+ }
+#endif
+
+ fb->m_guestUsesAngle =
+ feature_is_enabled(
+ kFeature_GuestUsesAngle);
+
+ fb->m_useVulkanComposition = feature_is_enabled(kFeature_GuestUsesAngle) ||
+ feature_is_enabled(kFeature_VulkanNativeSwapchain);
+
+ std::unique_ptr<VkEmulationFeatures> vkEmulationFeatures =
+ std::make_unique<VkEmulationFeatures>(VkEmulationFeatures{
+ .glInteropSupported = false, // Set later.
+ .deferredCommands =
+ android::base::getEnvironmentVariable("ANDROID_EMU_VK_DISABLE_DEFERRED_COMMANDS")
+ .empty(),
+ .createResourceWithRequirements =
+ android::base::getEnvironmentVariable(
+ "ANDROID_EMU_VK_DISABLE_USE_CREATE_RESOURCES_WITH_REQUIREMENTS")
+ .empty(),
+ .useVulkanComposition = fb->m_useVulkanComposition,
+ .useVulkanNativeSwapchain = feature_is_enabled(kFeature_VulkanNativeSwapchain),
+ .guestRenderDoc = std::move(renderDocMultipleVkInstances),
+ .astcLdrEmulationMode = AstcEmulationMode::Gpu,
+ .enableEtc2Emulation = true,
+ .enableYcbcrEmulation = false,
+ .guestUsesAngle = fb->m_guestUsesAngle,
+ .useDedicatedAllocations = false, // Set later.
+ });
+
+ //
+ // Cache the GL strings so we don't have to think about threading or
+ // current-context when asked for them.
+ //
+ bool useVulkanGraphicsDiagInfo =
+ vkEmu && feature_is_enabled(kFeature_VulkanNativeSwapchain) && fb->m_guestUsesAngle;
+
+ if (useVulkanGraphicsDiagInfo) {
+ fb->m_graphicsAdapterVendor = vkEmu->deviceInfo.driverVendor;
+ fb->m_graphicsAdapterName = vkEmu->deviceInfo.physdevProps.deviceName;
+
+ uint32_t vkVersion = vkEmu->vulkanInstanceVersion;
+
+ std::stringstream versionStringBuilder;
+ versionStringBuilder << "Vulkan " << VK_API_VERSION_MAJOR(vkVersion) << "."
+ << VK_API_VERSION_MINOR(vkVersion) << "."
+ << VK_API_VERSION_PATCH(vkVersion) << " "
+ << vkEmu->deviceInfo.driverVendor << " "
+ << vkEmu->deviceInfo.driverVersion;
+ fb->m_graphicsApiVersion = versionStringBuilder.str();
+
+ std::stringstream instanceExtensionsStringBuilder;
+ for (auto& ext : vkEmu->instanceExtensions) {
+ if (instanceExtensionsStringBuilder.tellp() != 0) {
+ instanceExtensionsStringBuilder << " ";
+ }
+ instanceExtensionsStringBuilder << ext.extensionName;
+ }
+
+ fb->m_graphicsApiExtensions = instanceExtensionsStringBuilder.str();
+
+ std::stringstream deviceExtensionsStringBuilder;
+ for (auto& ext : vkEmu->deviceInfo.extensions) {
+ if (deviceExtensionsStringBuilder.tellp() != 0) {
+ deviceExtensionsStringBuilder << " ";
+ }
+ deviceExtensionsStringBuilder << ext.extensionName;
+ }
+
+ fb->m_graphicsDeviceExtensions = deviceExtensionsStringBuilder.str();
+ } else if (fb->m_emulationGl) {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ fb->m_graphicsAdapterVendor = fb->m_emulationGl->getGlesVendor();
+ fb->m_graphicsAdapterName = fb->m_emulationGl->getGlesRenderer();
+ fb->m_graphicsApiVersion = fb->m_emulationGl->getGlesVersionString();
+ fb->m_graphicsApiExtensions = fb->m_emulationGl->getGlesExtensionsString();
+ fb->m_graphicsDeviceExtensions = "N/A";
+#endif
+ } else {
+ fb->m_graphicsAdapterVendor = "N/A";
+ fb->m_graphicsAdapterName = "N/A";
+ fb->m_graphicsApiVersion = "N/A";
+ fb->m_graphicsApiExtensions = "N/A";
+ fb->m_graphicsDeviceExtensions = "N/A";
+ }
+
+ // Attempt to get the device UUID of the gles and match with Vulkan. If
+ // they match, interop is possible. If they don't, then don't trust the
+ // result of interop query to egl and fall back to CPU copy, as we might
+ // have initialized Vulkan devices and GLES contexts from different
+ // physical devices.
+
+ bool vulkanInteropSupported = true;
+ // First, if the VkEmulation instance doesn't support ext memory capabilities,
+ // it won't support uuids.
+ if (!vkEmu || !vkEmu->deviceInfo.supportsIdProperties) {
+ vulkanInteropSupported = false;
+ }
+ if (!fb->m_emulationGl) {
+ vulkanInteropSupported = false;
+ } else {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (!fb->m_emulationGl->isGlesVulkanInteropSupported()) {
+ vulkanInteropSupported = false;
+ }
+ const auto& glesDeviceUuid = fb->m_emulationGl->getGlesDeviceUuid();
+ if (!glesDeviceUuid || glesDeviceUuid != fb->m_vulkanUUID) {
+ vulkanInteropSupported = false;
+ }
+#endif
+ }
+ // TODO: 0-copy gl interop on swiftshader vk
+ if (android::base::getEnvironmentVariable("ANDROID_EMU_VK_ICD") == "swiftshader") {
+ vulkanInteropSupported = false;
+ GL_LOG("vk icd swiftshader, disable interop");
+ }
+
+ fb->m_vulkanInteropSupported = vulkanInteropSupported;
+ GL_LOG("interop? %d", fb->m_vulkanInteropSupported);
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (vulkanInteropSupported && fb->m_emulationGl && fb->m_emulationGl->isMesa()) {
+ // Mesa currently expects dedicated allocations for external memory sharing
+ // between GL and VK. See b/265186355.
+ vkEmulationFeatures->useDedicatedAllocations = true;
+ }
+#endif
+
+ GL_LOG("glvk interop final: %d", fb->m_vulkanInteropSupported);
+ vkEmulationFeatures->glInteropSupported = fb->m_vulkanInteropSupported;
+ if (feature_is_enabled(kFeature_Vulkan)) {
+ vk::initVkEmulationFeatures(std::move(vkEmulationFeatures));
+ if (vkEmu && vkEmu->displayVk) {
+ fb->m_displayVk = vkEmu->displayVk.get();
+ fb->m_displaySurfaceUsers.push_back(fb->m_displayVk);
+ }
+ }
+
+ if (fb->m_useVulkanComposition) {
+ if (!vkEmu->compositorVk) {
+ ERR("Failed to get CompositorVk from VkEmulation.");
+ return false;
+ }
+ GL_LOG("Performing composition using CompositorVk.");
+ fb->m_compositor = vkEmu->compositorVk.get();
+ } else {
+ GL_LOG("Performing composition using CompositorGl.");
+#if GFXSTREAM_ENABLE_HOST_GLES
+ auto compositorGl = fb->m_emulationGl->getCompositor();
+ fb->m_compositor = compositorGl;
+#endif
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (fb->m_emulationGl) {
+ auto displayGl = fb->m_emulationGl->getDisplay();
+ fb->m_displayGl = displayGl;
+ fb->m_displaySurfaceUsers.push_back(displayGl);
+ }
+#endif
+
+ INFO("Graphics Adapter Vendor %s", fb->m_graphicsAdapterVendor.c_str());
+ INFO("Graphics Adapter %s", fb->m_graphicsAdapterName.c_str());
+ INFO("Graphics API Version %s", fb->m_graphicsApiVersion.c_str());
+ INFO("Graphics API Extensions %s", fb->m_graphicsApiExtensions.c_str());
+ INFO("Graphics Device Extensions %s", fb->m_graphicsDeviceExtensions.c_str());
+
+ if (fb->m_useVulkanComposition) {
+ fb->m_postWorker.reset(new PostWorkerVk(fb.get(), fb->m_compositor, fb->m_displayVk));
+ } else {
+ const bool shouldPostOnlyOnMainThread = postOnlyOnMainThread();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ PostWorkerGl* postWorkerGl =
+ new PostWorkerGl(shouldPostOnlyOnMainThread, fb.get(), fb->m_compositor,
+ fb->m_displayGl, fb->m_emulationGl.get());
+ fb->m_postWorker.reset(postWorkerGl);
+ fb->m_displaySurfaceUsers.push_back(postWorkerGl);
+#endif
+ }
+
+ // Start up the single sync thread. If we are using Vulkan native
+ // swapchain, then don't initialize SyncThread worker threads with EGL
+ // contexts.
+ SyncThread::initialize(
+ /* hasGL */ fb->m_emulationGl != nullptr, fb->getHealthMonitor());
+
+ // Start the vsync thread
+ const uint64_t kOneSecondNs = 1000000000ULL;
+ fb->m_vsyncThread.reset(new VsyncThread((uint64_t)kOneSecondNs / (uint64_t)fb->m_vsyncHz));
+
+ //
+ // Keep the singleton framebuffer pointer
+ //
+ s_theFrameBuffer = fb.release();
+ {
+ AutoLock lock(sGlobals()->lock);
+ sInitialized.store(true, std::memory_order_release);
+ sGlobals()->condVar.broadcastAndUnlock(&lock);
+ }
+
+ // Nothing else to do - we're ready to rock!
+ return true;
+}
+
+void FrameBuffer::finalize() {
+ FrameBuffer* fb = s_theFrameBuffer;
+ s_theFrameBuffer = nullptr;
+ if (fb) {
+ delete fb;
+ }
+}
+
+FrameBuffer::FrameBuffer(int p_width, int p_height, bool useSubWindow)
+ : m_framebufferWidth(p_width),
+ m_framebufferHeight(p_height),
+ m_windowWidth(p_width),
+ m_windowHeight(p_height),
+ m_useSubWindow(useSubWindow),
+ m_fpsStats(getenv("SHOW_FPS_STATS") != nullptr),
+ m_perfStats(!android::base::getEnvironmentVariable("SHOW_PERF_STATS").empty()),
+ m_perfThread(new PerfStatThread(&m_perfStats)),
+ m_readbackThread(
+ [this](FrameBuffer::Readback&& readback) { return sendReadbackWorkerCmd(readback); }),
+ m_refCountPipeEnabled(feature_is_enabled(kFeature_RefCountPipe)),
+ m_noDelayCloseColorBufferEnabled(feature_is_enabled(kFeature_NoDelayCloseColorBuffer) ||
+ feature_is_enabled(kFeature_Minigbm)),
+ m_postThread([this](Post&& post) { return postWorkerFunc(post); }),
+ m_logger(CreateMetricsLogger()),
+ m_healthMonitor(CreateHealthMonitor(*m_logger)) {
+ mDisplayActiveConfigId = 0;
+ mDisplayConfigs[0] = {p_width, p_height, 160, 160};
+ uint32_t displayId = 0;
+ if (createDisplay(&displayId) < 0) {
+ fprintf(stderr, "Failed to create default display\n");
+ }
+
+ setDisplayPose(displayId, 0, 0, getWidth(), getHeight(), 0);
+ m_perfThread->start();
+}
+
+FrameBuffer::~FrameBuffer() {
+ AutoLock fbLock(m_lock);
+
+ m_perfStats = false;
+ m_perfThread->wait(NULL);
+
+ m_postThread.enqueue({PostCmd::Exit});
+ m_postThread.join();
+ m_postWorker.reset();
+
+ if (m_useSubWindow) {
+ removeSubWindow_locked();
+ }
+
+ m_readbackThread.enqueue({ReadbackCmd::Exit});
+ m_readbackThread.join();
+
+ m_vsyncThread.reset();
+
+ delete m_perfThread;
+
+ SyncThread::destroy();
+
+ sweepColorBuffersLocked();
+
+ m_buffers.clear();
+ {
+ AutoLock lock(m_colorBufferMapLock);
+ m_colorbuffers.clear();
+ }
+ m_colorBufferDelayedCloseList.clear();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ m_windows.clear();
+ m_contexts.clear();
+
+ for (auto it : m_platformEglContexts) {
+ destroySharedTrivialContext(it.second.context, it.second.surface);
+ }
+#endif
+
+ vk::teardownGlobalVkEmulation();
+
+ sInitialized.store(false, std::memory_order_relaxed);
+}
+
+WorkerProcessingResult
+FrameBuffer::sendReadbackWorkerCmd(const Readback& readback) {
+ ensureReadbackWorker();
+ switch (readback.cmd) {
+ case ReadbackCmd::Init:
+ m_readbackWorker->init();
+ return WorkerProcessingResult::Continue;
+ case ReadbackCmd::GetPixels:
+ m_readbackWorker->getPixels(readback.displayId, readback.pixelsOut, readback.bytes);
+ return WorkerProcessingResult::Continue;
+ case ReadbackCmd::AddRecordDisplay:
+ m_readbackWorker->initReadbackForDisplay(readback.displayId, readback.width, readback.height);
+ return WorkerProcessingResult::Continue;
+ case ReadbackCmd::DelRecordDisplay:
+ m_readbackWorker->deinitReadbackForDisplay(readback.displayId);
+ return WorkerProcessingResult::Continue;
+ case ReadbackCmd::Exit:
+ return WorkerProcessingResult::Stop;
+ }
+ return WorkerProcessingResult::Stop;
+}
+
+WorkerProcessingResult FrameBuffer::postWorkerFunc(Post& post) {
+ auto annotations = std::make_unique<EventHangMetadata::HangAnnotations>();
+ if (m_healthMonitor)
+ annotations->insert(
+ {"Post command opcode", std::to_string(static_cast<uint64_t>(post.cmd))});
+ auto watchdog = WATCHDOG_BUILDER(m_healthMonitor.get(), "PostWorker main function")
+ .setAnnotations(std::move(annotations))
+ .build();
+ switch (post.cmd) {
+ case PostCmd::Post: {
+ // We wrap the callback like this to workaround a bug in the MS STL implementation.
+ auto packagePostCmdCallback =
+ std::shared_ptr<Post::CompletionCallback>(std::move(post.completionCallback));
+ std::unique_ptr<Post::CompletionCallback> postCallback =
+ std::make_unique<Post::CompletionCallback>(
+ [packagePostCmdCallback](std::shared_future<void> waitForGpu) {
+ SyncThread::get()->triggerGeneral(
+ [composeCallback = std::move(packagePostCmdCallback), waitForGpu] {
+ (*composeCallback)(waitForGpu);
+ },
+ "Wait for post");
+ });
+ m_postWorker->post(post.cb, std::move(postCallback));
+ decColorBufferRefCountNoDestroy(post.cbHandle);
+ break;
+ }
+ case PostCmd::Viewport:
+ m_postWorker->viewport(post.viewport.width,
+ post.viewport.height);
+ break;
+ case PostCmd::Compose: {
+ std::unique_ptr<FlatComposeRequest> composeRequest;
+ std::unique_ptr<Post::CompletionCallback> composeCallback;
+ if (post.composeVersion <= 1) {
+ composeCallback = std::move(post.completionCallback);
+ composeRequest = ToFlatComposeRequest((ComposeDevice*)post.composeBuffer.data());
+ } else {
+ // std::shared_ptr(std::move(...)) is WA for MSFT STL implementation bug:
+ // https://developercommunity.visualstudio.com/t/unable-to-move-stdpackaged-task-into-any-stl-conta/108672
+ auto packageComposeCallback =
+ std::shared_ptr<Post::CompletionCallback>(std::move(post.completionCallback));
+ composeCallback = std::make_unique<Post::CompletionCallback>(
+ [packageComposeCallback](
+ std::shared_future<void> waitForGpu) {
+ SyncThread::get()->triggerGeneral(
+ [composeCallback = std::move(packageComposeCallback), waitForGpu] {
+ (*composeCallback)(waitForGpu);
+ },
+ "Wait for host composition");
+ });
+ composeRequest = ToFlatComposeRequest((ComposeDevice_v2*)post.composeBuffer.data());
+ }
+ m_postWorker->compose(std::move(composeRequest), std::move(composeCallback));
+ break;
+ }
+ case PostCmd::Clear:
+ m_postWorker->clear();
+ break;
+ case PostCmd::Screenshot:
+ m_postWorker->screenshot(
+ post.screenshot.cb, post.screenshot.screenwidth,
+ post.screenshot.screenheight, post.screenshot.format,
+ post.screenshot.type, post.screenshot.rotation,
+ post.screenshot.pixels, post.screenshot.rect);
+ decColorBufferRefCountNoDestroy(post.cbHandle);
+ break;
+ case PostCmd::Block:
+ m_postWorker->block(std::move(post.block->scheduledSignal),
+ std::move(post.block->continueSignal));
+ break;
+ case PostCmd::Exit:
+ m_postWorker->exit();
+ return WorkerProcessingResult::Stop;
+ default:
+ break;
+ }
+ return WorkerProcessingResult::Continue;
+}
+
+std::future<void> FrameBuffer::sendPostWorkerCmd(Post post) {
+ bool expectedPostThreadStarted = false;
+ if (m_postThreadStarted.compare_exchange_strong(expectedPostThreadStarted, true)) {
+ m_postThread.start();
+ }
+
+ bool shouldPostOnlyOnMainThread = postOnlyOnMainThread();
+ // If we want to run only in the main thread and we are actually running
+ // in the main thread already, don't use the PostWorker thread. Ideally,
+ // PostWorker should handle this and dispatch directly, but we'll need to
+ // transfer ownership of the thread to PostWorker.
+ // TODO(lfy): do that refactor
+ // For now, this fixes a screenshot issue on macOS.
+ std::future<void> res = std::async(std::launch::deferred, [] {});
+ res.wait();
+ if (shouldPostOnlyOnMainThread && (PostCmd::Screenshot == post.cmd) &&
+ emugl::get_emugl_window_operations().isRunningInUiThread()) {
+ post.cb->readToBytesScaled(post.screenshot.screenwidth, post.screenshot.screenheight,
+ post.screenshot.format, post.screenshot.type,
+ post.screenshot.rotation, post.screenshot.rect,
+ post.screenshot.pixels);
+ } else {
+ std::future<void> completeFuture =
+ m_postThread.enqueue(Post(std::move(post)));
+ if (!shouldPostOnlyOnMainThread ||
+ (PostCmd::Screenshot == post.cmd &&
+ !emugl::get_emugl_window_operations().isRunningInUiThread())) {
+ res = std::move(completeFuture);
+ }
+ }
+ return res;
+}
+
+void FrameBuffer::setPostCallback(Renderer::OnPostCallback onPost, void* onPostContext,
+ uint32_t displayId, bool useBgraReadback) {
+ AutoLock lock(m_lock);
+ if (onPost) {
+ uint32_t w, h;
+ if (!emugl::get_emugl_multi_display_operations().getMultiDisplay(displayId,
+ nullptr,
+ nullptr,
+ &w, &h,
+ nullptr,
+ nullptr,
+ nullptr)) {
+ ERR("display %d not exist, cancelling OnPost callback", displayId);
+ return;
+ }
+ if (m_onPost.find(displayId) != m_onPost.end()) {
+ ERR("display %d already configured for recording", displayId);
+ return;
+ }
+ m_onPost[displayId].cb = onPost;
+ m_onPost[displayId].context = onPostContext;
+ m_onPost[displayId].displayId = displayId;
+ m_onPost[displayId].width = w;
+ m_onPost[displayId].height = h;
+ m_onPost[displayId].img = new unsigned char[4 * w * h];
+ m_onPost[displayId].readBgra = useBgraReadback;
+ bool expectedReadbackThreadStarted = false;
+ if (m_readbackThreadStarted.compare_exchange_strong(expectedReadbackThreadStarted, true)) {
+ m_readbackThread.start();
+ m_readbackThread.enqueue({ ReadbackCmd::Init });
+ }
+ std::future<void> completeFuture = m_readbackThread.enqueue(
+ {ReadbackCmd::AddRecordDisplay, displayId, nullptr, 0, w, h});
+ completeFuture.wait();
+ } else {
+ std::future<void> completeFuture = m_readbackThread.enqueue(
+ {ReadbackCmd::DelRecordDisplay, displayId});
+ completeFuture.wait();
+ m_onPost.erase(displayId);
+ }
+}
+
+static void subWindowRepaint(void* param) {
+ GL_LOG("call repost from subWindowRepaint callback");
+ auto fb = static_cast<FrameBuffer*>(param);
+ fb->repost();
+}
+
+bool FrameBuffer::setupSubWindow(FBNativeWindowType p_window,
+ int wx,
+ int wy,
+ int ww,
+ int wh,
+ int fbw,
+ int fbh,
+ float dpr,
+ float zRot,
+ bool deleteExisting,
+ bool hideWindow) {
+ GL_LOG("Begin setupSubWindow");
+ if (!m_useSubWindow) {
+ ERR("%s: Cannot create native sub-window in this configuration\n",
+ __FUNCTION__);
+ return false;
+ }
+
+ // Do a quick check before even taking the lock - maybe we don't need to
+ // do anything here.
+
+ const bool shouldCreateSubWindow = !m_subWin || deleteExisting;
+
+ // On Mac, since window coordinates are Y-up and not Y-down, the
+ // subwindow may not change dimensions, but because the main window
+ // did, the subwindow technically needs to be re-positioned. This
+ // can happen on rotation, so a change in Z-rotation can be checked
+ // for this case. However, this *should not* be done on Windows/Linux,
+ // because the functions used to resize a native window on those hosts
+ // will block if the shape doesn't actually change, freezing the
+ // emulator.
+ const bool shouldMoveSubWindow =
+ !shouldCreateSubWindow &&
+ !(m_x == wx && m_y == wy && m_windowWidth == ww && m_windowHeight == wh
+#if defined(__APPLE__)
+ && m_zRot == zRot
+#endif
+ );
+
+ const bool redrawSubwindow =
+ shouldCreateSubWindow || shouldMoveSubWindow || m_zRot != zRot || m_dpr != dpr ||
+ m_windowContentFullWidth != fbw || m_windowContentFullHeight != fbh;
+ if (!shouldCreateSubWindow && !shouldMoveSubWindow && !redrawSubwindow) {
+ assert(sInitialized.load(std::memory_order_relaxed));
+ GL_LOG("Exit setupSubWindow (nothing to do)");
+#if SNAPSHOT_PROFILE > 1
+ // printf("FrameBuffer::%s(): nothing to do at %lld ms\n", __func__,
+ // (long long)System::get()->getProcessTimes().wallClockMs);
+#endif
+ return true;
+ }
+
+#if SNAPSHOT_PROFILE > 1
+ // printf("FrameBuffer::%s(%s): start at %lld ms\n", __func__,
+ // deleteExisting ? "deleteExisting" : "keepExisting",
+ // (long long)System::get()->getProcessTimes().wallClockMs);
+#endif
+ class ScopedPromise {
+ public:
+ ~ScopedPromise() { mPromise.set_value(); }
+ std::future<void> getFuture() { return mPromise.get_future(); }
+ DISALLOW_COPY_ASSIGN_AND_MOVE(ScopedPromise);
+ static std::tuple<std::unique_ptr<ScopedPromise>, std::future<void>> create() {
+ auto scopedPromise = std::unique_ptr<ScopedPromise>(new ScopedPromise());
+ auto future = scopedPromise->mPromise.get_future();
+ return std::make_tuple(std::move(scopedPromise), std::move(future));
+ }
+
+ private:
+ ScopedPromise() = default;
+ std::promise<void> mPromise;
+ };
+ std::unique_ptr<ScopedPromise> postWorkerContinueSignal;
+ std::future<void> postWorkerContinueSignalFuture;
+ std::tie(postWorkerContinueSignal, postWorkerContinueSignalFuture) = ScopedPromise::create();
+ {
+ auto watchdog =
+ WATCHDOG_BUILDER(m_healthMonitor.get(), "Wait for other tasks on PostWorker")
+ .setTimeoutMs(6000)
+ .build();
+ blockPostWorker(std::move(postWorkerContinueSignalFuture)).wait();
+ }
+ if (m_displayVk) {
+ auto watchdog = WATCHDOG_BUILDER(m_healthMonitor.get(), "Draining the VkQueue")
+ .setTimeoutMs(6000)
+ .build();
+ m_displayVk->drainQueues();
+ }
+ auto lockWatchdog =
+ WATCHDOG_BUILDER(m_healthMonitor.get(), "Wait for the FrameBuffer global lock").build();
+ auto lockWatchdogId = lockWatchdog->release();
+ AutoLock mutex(m_lock);
+ if (lockWatchdogId.has_value()) {
+ m_healthMonitor->stopMonitoringTask(lockWatchdogId.value());
+ }
+
+#if SNAPSHOT_PROFILE > 1
+ // printf("FrameBuffer::%s(): got lock at %lld ms\n", __func__,
+ // (long long)System::get()->getProcessTimes().wallClockMs);
+#endif
+
+ if (deleteExisting) {
+ removeSubWindow_locked();
+ }
+
+ bool success = false;
+
+ // If the subwindow doesn't exist, create it with the appropriate dimensions
+ if (!m_subWin) {
+ // Create native subwindow for FB display output
+ m_x = wx;
+ m_y = wy;
+ m_windowWidth = ww;
+ m_windowHeight = wh;
+
+ if (!hideWindow) {
+ m_subWin = createSubWindow(p_window, m_x, m_y, m_windowWidth, m_windowHeight, dpr,
+ subWindowRepaint, this, hideWindow);
+ }
+ if (m_subWin) {
+ m_nativeWindow = p_window;
+
+
+
+ if (m_displayVk) {
+ m_displaySurface =
+ vk::createDisplaySurface(m_subWin, m_windowWidth, m_windowHeight);
+ } else if (m_emulationGl) {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ m_displaySurface = m_emulationGl->createWindowSurface(m_windowWidth,
+ m_windowHeight,
+ m_subWin);
+#endif
+ } else {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Unhandled window surface creation.";
+ }
+
+ if (m_displaySurface) {
+ // Some backends use a default display surface. Unbind from that before
+ // binding the new display surface. which potentially needs to be unbound.
+ for (auto* displaySurfaceUser : m_displaySurfaceUsers) {
+ displaySurfaceUser->unbindFromSurface();
+ }
+
+ // TODO: Make RenderDoc a DisplaySurfaceUser.
+ if (m_displayVk) {
+ if (m_renderDoc) {
+ m_renderDoc->call(emugl::RenderDoc::kSetActiveWindow,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(m_vkInstance),
+ reinterpret_cast<RENDERDOC_WindowHandle>(m_subWin));
+ }
+ }
+
+ m_px = 0;
+ m_py = 0;
+ for (auto* displaySurfaceUser : m_displaySurfaceUsers) {
+ displaySurfaceUser->bindToSurface(m_displaySurface.get());
+ }
+ success = true;
+ } else {
+ // Display surface creation failed.
+ if (m_emulationGl) {
+ // NOTE: This can typically happen with software-only renderers like OSMesa.
+ destroySubWindow(m_subWin);
+ m_subWin = (EGLNativeWindowType)0;
+ } else {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Failed to create DisplaySurface.";
+ }
+ }
+ }
+ }
+
+ auto watchdog = WATCHDOG_BUILDER(m_healthMonitor.get(), "Updating subwindow state").build();
+ // At this point, if the subwindow doesn't exist, it is because it either
+ // couldn't be created
+ // in the first place or the EGLSurface couldn't be created.
+ if (m_subWin) {
+ if (!shouldMoveSubWindow) {
+ // Ensure that at least viewport parameters are properly updated.
+ success = true;
+ } else {
+ // Only attempt to update window geometry if anything has actually
+ // changed.
+ m_x = wx;
+ m_y = wy;
+ m_windowWidth = ww;
+ m_windowHeight = wh;
+
+ {
+ auto watchdog = WATCHDOG_BUILDER(m_healthMonitor.get(), "Moving subwindow").build();
+ success = moveSubWindow(m_nativeWindow, m_subWin, m_x, m_y, m_windowWidth,
+ m_windowHeight);
+ }
+ m_displaySurface->updateSize(m_windowWidth, m_windowHeight);
+ }
+ // We are safe to unblock the PostWorker thread now, because we have completed all the
+ // operations that could modify the state of the m_subWin. We need to unblock the PostWorker
+ // here because we may need to send and wait for other tasks dispatched to the PostWorker
+ // later, e.g. the viewport command or the post command issued later.
+ postWorkerContinueSignal.reset();
+
+ if (success && redrawSubwindow) {
+ // Subwin creation or movement was successful,
+ // update viewport and z rotation and draw
+ // the last posted color buffer.
+ m_dpr = dpr;
+ m_zRot = zRot;
+ if (m_displayVk == nullptr) {
+ Post postCmd;
+ postCmd.cmd = PostCmd::Viewport;
+ postCmd.viewport.width = fbw;
+ postCmd.viewport.height = fbh;
+ sendPostWorkerCmd(std::move(postCmd));
+
+ if (m_lastPostedColorBuffer) {
+ GL_LOG("setupSubwindow: draw last posted cb");
+ postImpl(m_lastPostedColorBuffer,
+ [](std::shared_future<void> waitForGpu) {}, false);
+ } else {
+ Post postCmd;
+ postCmd.cmd = PostCmd::Clear;
+ sendPostWorkerCmd(std::move(postCmd));
+ }
+ }
+ m_windowContentFullWidth = fbw;
+ m_windowContentFullHeight = fbh;
+ }
+ }
+
+ mutex.unlock();
+
+ // Nobody ever checks for the return code, so there will be no retries or
+ // even aborted run; if we don't mark the framebuffer as initialized here
+ // its users will hang forever; if we do mark it, they will crash - which
+ // is a better outcome (crash report == bug fixed).
+ AutoLock lock(sGlobals()->lock);
+ sInitialized.store(true, std::memory_order_relaxed);
+ sGlobals()->condVar.broadcastAndUnlock(&lock);
+
+#if SNAPSHOT_PROFILE > 1
+ // printf("FrameBuffer::%s(): end at %lld ms\n", __func__,
+ // (long long)System::get()->getProcessTimes().wallClockMs);
+#endif
+
+ GL_LOG("Exit setupSubWindow (successful setup)");
+ return success;
+}
+
+bool FrameBuffer::removeSubWindow() {
+ if (!m_useSubWindow) {
+ ERR("Cannot remove native sub-window in this configuration");
+ return false;
+ }
+ AutoLock lock(sGlobals()->lock);
+ sInitialized.store(false, std::memory_order_relaxed);
+ sGlobals()->condVar.broadcastAndUnlock(&lock);
+
+ AutoLock mutex(m_lock);
+ return removeSubWindow_locked();
+}
+
+bool FrameBuffer::removeSubWindow_locked() {
+ if (!m_useSubWindow) {
+ ERR("Cannot remove native sub-window in this configuration");
+ return false;
+ }
+ bool removed = false;
+ if (m_subWin) {
+ for (auto* displaySurfaceUser : m_displaySurfaceUsers) {
+ displaySurfaceUser->unbindFromSurface();
+ }
+ m_displaySurface.reset();
+
+ destroySubWindow(m_subWin);
+
+ m_subWin = (EGLNativeWindowType)0;
+ removed = true;
+ }
+ return removed;
+}
+
+HandleType FrameBuffer::genHandle_locked() {
+ HandleType id;
+ do {
+ id = ++s_nextHandle;
+ } while (id == 0 ||
+#if GFXSTREAM_ENABLE_HOST_GLES
+ m_contexts.find(id) != m_contexts.end() || m_windows.find(id) != m_windows.end() ||
+#endif
+ m_colorbuffers.find(id) != m_colorbuffers.end() ||
+ m_buffers.find(id) != m_buffers.end());
+
+ return id;
+}
+
+HandleType FrameBuffer::createColorBuffer(int p_width,
+ int p_height,
+ GLenum p_internalFormat,
+ FrameworkFormat p_frameworkFormat) {
+
+ AutoLock mutex(m_lock);
+ sweepColorBuffersLocked();
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+
+ return createColorBufferWithHandleLocked(p_width, p_height, p_internalFormat, p_frameworkFormat,
+ genHandle_locked());
+}
+
+void FrameBuffer::createColorBufferWithHandle(int p_width, int p_height, GLenum p_internalFormat,
+ FrameworkFormat p_frameworkFormat,
+ HandleType handle) {
+ {
+ AutoLock mutex(m_lock);
+ sweepColorBuffersLocked();
+
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+
+ // Check for handle collision
+ if (m_colorbuffers.count(handle) != 0) {
+ // emugl::emugl_crash_reporter(
+ // "FATAL: color buffer with handle %u already exists",
+ // handle);
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER));
+ }
+
+ createColorBufferWithHandleLocked(p_width, p_height, p_internalFormat, p_frameworkFormat,
+ handle);
+ }
+}
+
+HandleType FrameBuffer::createColorBufferWithHandleLocked(
+ int p_width,
+ int p_height,
+ GLenum p_internalFormat,
+ FrameworkFormat p_frameworkFormat,
+ HandleType handle) {
+ ColorBufferPtr cb = ColorBuffer::create(m_emulationGl.get(), m_emulationVk, p_width, p_height,
+ p_internalFormat, p_frameworkFormat, handle);
+ if (cb.get() == nullptr) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Failed to create ColorBuffer:" << handle << " format:" << p_internalFormat
+ << " framework-format:" << p_frameworkFormat << " width:" << p_width
+ << " height:" << p_height;
+ }
+
+ assert(m_colorbuffers.count(handle) == 0);
+ // When guest feature flag RefCountPipe is on, no reference counting is
+ // needed. We only memoize the mapping from handle to ColorBuffer.
+ // Explicitly set refcount to 1 to avoid the colorbuffer being added to
+ // m_colorBufferDelayedCloseList in FrameBuffer::onLoad().
+ if (m_refCountPipeEnabled) {
+ m_colorbuffers.try_emplace(handle, ColorBufferRef{std::move(cb), 1, false, 0});
+ } else {
+ // Android master default api level is 1000
+ int apiLevel = 1000;
+ emugl::getAvdInfo(nullptr, &apiLevel);
+ // pre-O and post-O use different color buffer memory management
+ // logic
+ if (apiLevel > 0 && apiLevel < 26) {
+ m_colorbuffers.try_emplace(handle, ColorBufferRef{std::move(cb), 1, false, 0});
+
+ RenderThreadInfo* tInfo = RenderThreadInfo::get();
+ uint64_t puid = tInfo->m_puid;
+ if (puid) {
+ m_procOwnedColorBuffers[puid].insert(handle);
+ }
+
+ } else {
+ m_colorbuffers.try_emplace(handle, ColorBufferRef{std::move(cb), 0, false, 0});
+ }
+ }
+
+ return handle;
+}
+
+HandleType FrameBuffer::createBuffer(uint64_t p_size, uint32_t memoryProperty) {
+ AutoLock mutex(m_lock);
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ return createBufferWithHandleLocked(p_size, genHandle_locked(), memoryProperty);
+}
+
+void FrameBuffer::createBufferWithHandle(uint64_t size, HandleType handle) {
+ AutoLock mutex(m_lock);
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+
+ if (m_buffers.count(handle) != 0) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Buffer already exists with handle " << handle;
+ }
+
+ createBufferWithHandleLocked(size, handle, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
+}
+
+HandleType FrameBuffer::createBufferWithHandleLocked(int p_size, HandleType handle,
+ uint32_t memoryProperty) {
+ if (m_buffers.count(handle) != 0) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Buffer already exists with handle " << handle;
+ }
+
+ BufferPtr buffer(Buffer::create(m_emulationGl.get(), m_emulationVk, p_size, handle));
+ if (!buffer) {
+ ERR("Create buffer failed.\n");
+ return 0;
+ }
+
+ m_buffers[handle] = {std::move(buffer)};
+
+ return handle;
+}
+
+int FrameBuffer::openColorBuffer(HandleType p_colorbuffer) {
+ // When guest feature flag RefCountPipe is on, no reference counting is
+ // needed.
+ if (m_refCountPipeEnabled) return 0;
+
+ RenderThreadInfo* tInfo = RenderThreadInfo::get();
+
+ AutoLock mutex(m_lock);
+
+ ColorBufferMap::iterator c;
+ {
+ AutoLock colorBuffermapLock(m_colorBufferMapLock);
+ c = m_colorbuffers.find(p_colorbuffer);
+ if (c == m_colorbuffers.end()) {
+ // bad colorbuffer handle
+ ERR("FB: openColorBuffer cb handle %#x not found", p_colorbuffer);
+ return -1;
+ }
+ c->second.refcount++;
+ markOpened(&c->second);
+ }
+
+ uint64_t puid = tInfo ? tInfo->m_puid : 0;
+ if (puid) {
+ m_procOwnedColorBuffers[puid].insert(p_colorbuffer);
+ }
+ return 0;
+}
+
+void FrameBuffer::closeColorBuffer(HandleType p_colorbuffer) {
+ // When guest feature flag RefCountPipe is on, no reference counting is
+ // needed.
+ if (m_refCountPipeEnabled) {
+ return;
+ }
+
+ RenderThreadInfo* tInfo = RenderThreadInfo::get();
+
+ std::vector<HandleType> toCleanup;
+
+ AutoLock mutex(m_lock);
+ uint64_t puid = tInfo ? tInfo->m_puid : 0;
+ if (puid) {
+ auto ite = m_procOwnedColorBuffers.find(puid);
+ if (ite != m_procOwnedColorBuffers.end()) {
+ const auto& cb = ite->second.find(p_colorbuffer);
+ if (cb != ite->second.end()) {
+ ite->second.erase(cb);
+ if (closeColorBufferLocked(p_colorbuffer)) {
+ toCleanup.push_back(p_colorbuffer);
+ }
+ }
+ }
+ } else {
+ if (closeColorBufferLocked(p_colorbuffer)) {
+ toCleanup.push_back(p_colorbuffer);
+ }
+ }
+}
+
+void FrameBuffer::closeBuffer(HandleType p_buffer) {
+ AutoLock mutex(m_lock);
+
+ auto it = m_buffers.find(p_buffer);
+ if (it == m_buffers.end()) {
+ ERR("Failed to find Buffer:%d", p_buffer);
+ return;
+ }
+
+ m_buffers.erase(it);
+}
+
+bool FrameBuffer::closeColorBufferLocked(HandleType p_colorbuffer, bool forced) {
+ // When guest feature flag RefCountPipe is on, no reference counting is
+ // needed.
+ if (m_refCountPipeEnabled) {
+ return false;
+ }
+ bool deleted = false;
+ {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+
+ if (m_noDelayCloseColorBufferEnabled) forced = true;
+
+ ColorBufferMap::iterator c(m_colorbuffers.find(p_colorbuffer));
+ if (c == m_colorbuffers.end()) {
+ // This is harmless: it is normal for guest system to issue
+ // closeColorBuffer command when the color buffer is already
+ // garbage collected on the host. (we don't have a mechanism
+ // to give guest a notice yet)
+ return false;
+ }
+
+ // The guest can and will gralloc_alloc/gralloc_free and then
+ // gralloc_register a buffer, due to API level (O+) or
+ // timing issues.
+ // So, we don't actually close the color buffer when refcount
+ // reached zero, unless it has been opened at least once already.
+ // Instead, put it on a 'delayed close' list to return to it later.
+ if (--c->second.refcount == 0) {
+ if (forced) {
+ eraseDelayedCloseColorBufferLocked(c->first, c->second.closedTs);
+ m_colorbuffers.erase(c);
+ deleted = true;
+ } else {
+ c->second.closedTs = android::base::getUnixTimeUs();
+ m_colorBufferDelayedCloseList.push_back({c->second.closedTs, p_colorbuffer});
+ }
+ }
+ }
+
+ performDelayedColorBufferCloseLocked(false);
+
+ return deleted;
+}
+
+void FrameBuffer::decColorBufferRefCountNoDestroy(HandleType p_colorbuffer) {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+
+ ColorBufferMap::iterator c(m_colorbuffers.find(p_colorbuffer));
+ if (c == m_colorbuffers.end()) {
+ return;
+ }
+
+ if (--c->second.refcount == 0) {
+ c->second.closedTs = android::base::getUnixTimeUs();
+ m_colorBufferDelayedCloseList.push_back({c->second.closedTs, p_colorbuffer});
+ }
+}
+
+void FrameBuffer::performDelayedColorBufferCloseLocked(bool forced) {
+ // Let's wait just long enough to make sure it's not because of instant
+ // timestamp change (end of previous second -> beginning of a next one),
+ // but not for long - this is a workaround for race conditions, and they
+ // are quick.
+ static constexpr uint64_t kColorBufferClosingDelayUs = 1000000LL;
+
+ const auto now = android::base::getUnixTimeUs();
+ auto it = m_colorBufferDelayedCloseList.begin();
+ while (it != m_colorBufferDelayedCloseList.end() &&
+ (forced ||
+ it->ts + kColorBufferClosingDelayUs <= now)) {
+ if (it->cbHandle != 0) {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ const auto& cb = m_colorbuffers.find(it->cbHandle);
+ if (cb != m_colorbuffers.end()) {
+ m_colorbuffers.erase(cb);
+ }
+ }
+ ++it;
+ }
+ m_colorBufferDelayedCloseList.erase(
+ m_colorBufferDelayedCloseList.begin(), it);
+}
+
+void FrameBuffer::eraseDelayedCloseColorBufferLocked(
+ HandleType cb, uint64_t ts)
+{
+ // Find the first delayed buffer with a timestamp <= |ts|
+ auto it = std::lower_bound(
+ m_colorBufferDelayedCloseList.begin(),
+ m_colorBufferDelayedCloseList.end(), ts,
+ [](const ColorBufferCloseInfo& ci, uint64_t ts) {
+ return ci.ts < ts;
+ });
+ while (it != m_colorBufferDelayedCloseList.end() &&
+ it->ts == ts) {
+ // if this is the one we need - clear it out.
+ if (it->cbHandle == cb) {
+ it->cbHandle = 0;
+ break;
+ }
+ ++it;
+ }
+}
+
+void FrameBuffer::createGraphicsProcessResources(uint64_t puid) {
+ AutoLock mutex(m_lock);
+ bool inserted = m_procOwnedResources.try_emplace(puid, ProcessResources::create()).second;
+ if (!inserted) {
+ WARN("Failed to create process resource for puid %" PRIu64 ".", puid);
+ }
+}
+
+std::unique_ptr<ProcessResources> FrameBuffer::removeGraphicsProcessResources(uint64_t puid) {
+ std::unordered_map<uint64_t, std::unique_ptr<ProcessResources>>::node_type node;
+ {
+ AutoLock mutex(m_lock);
+ node = m_procOwnedResources.extract(puid);
+ }
+ if (node.empty()) {
+ WARN("Failed to find process resource for puid %" PRIu64 ".", puid);
+ return nullptr;
+ }
+ std::unique_ptr<ProcessResources> res = std::move(node.mapped());
+ return res;
+}
+
+void FrameBuffer::cleanupProcGLObjects(uint64_t puid) {
+ bool renderThreadWithThisPuidExists = false;
+
+ do {
+ renderThreadWithThisPuidExists = false;
+ RenderThreadInfo::forAllRenderThreadInfos(
+ [puid, &renderThreadWithThisPuidExists](RenderThreadInfo* i) {
+ if (i->m_puid == puid) {
+ renderThreadWithThisPuidExists = true;
+ }
+ });
+ android::base::sleepUs(10000);
+ } while (renderThreadWithThisPuidExists);
+
+
+ AutoLock mutex(m_lock);
+
+ cleanupProcGLObjects_locked(puid);
+
+ // Run other cleanup callbacks
+ // Avoid deadlock by first storing a separate list of callbacks
+ std::vector<std::function<void()>> callbacks;
+
+ {
+ auto procIte = m_procOwnedCleanupCallbacks.find(puid);
+ if (procIte != m_procOwnedCleanupCallbacks.end()) {
+ for (auto it : procIte->second) {
+ callbacks.push_back(it.second);
+ }
+ m_procOwnedCleanupCallbacks.erase(procIte);
+ }
+ }
+
+ mutex.unlock();
+
+ for (auto cb : callbacks) {
+ cb();
+ }
+}
+
+std::vector<HandleType> FrameBuffer::cleanupProcGLObjects_locked(uint64_t puid, bool forced) {
+ std::vector<HandleType> colorBuffersToCleanup;
+ {
+ std::unique_ptr<RecursiveScopedContextBind> bind = nullptr;
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_emulationGl) {
+ bind = std::make_unique<RecursiveScopedContextBind>(getPbufferSurfaceContextHelper());
+ }
+ // Clean up window surfaces
+ if (m_emulationGl) {
+ auto procIte = m_procOwnedEmulatedEglWindowSurfaces.find(puid);
+ if (procIte != m_procOwnedEmulatedEglWindowSurfaces.end()) {
+ for (auto whndl : procIte->second) {
+ auto w = m_windows.find(whndl);
+ // TODO(b/265186226): figure out if we are leaking?
+ if (w == m_windows.end()) {
+ continue;
+ }
+ if (!m_guestManagedColorBufferLifetime) {
+ if (m_refCountPipeEnabled) {
+ if (decColorBufferRefCountLocked(w->second.second)) {
+ colorBuffersToCleanup.push_back(w->second.second);
+ }
+ } else {
+ if (closeColorBufferLocked(w->second.second, forced)) {
+ colorBuffersToCleanup.push_back(w->second.second);
+ }
+ }
+ }
+ m_windows.erase(w);
+ }
+ m_procOwnedEmulatedEglWindowSurfaces.erase(procIte);
+ }
+ }
+#endif
+
+ // Clean up color buffers.
+ // A color buffer needs to be closed as many times as it is opened by
+ // the guest process, to give the correct reference count.
+ // (Note that a color buffer can be shared across guest processes.)
+ {
+ if (!m_guestManagedColorBufferLifetime) {
+ auto procIte = m_procOwnedColorBuffers.find(puid);
+ if (procIte != m_procOwnedColorBuffers.end()) {
+ for (auto cb : procIte->second) {
+ if (closeColorBufferLocked(cb, forced)) {
+ colorBuffersToCleanup.push_back(cb);
+ }
+ }
+ m_procOwnedColorBuffers.erase(procIte);
+ }
+ }
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ // Clean up EGLImage handles
+ if (m_emulationGl) {
+ auto procImagesIt = m_procOwnedEmulatedEglImages.find(puid);
+ if (procImagesIt != m_procOwnedEmulatedEglImages.end()) {
+ for (auto image : procImagesIt->second) {
+ m_images.erase(image);
+ }
+ m_procOwnedEmulatedEglImages.erase(procImagesIt);
+ }
+ }
+#endif
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ // Unbind before cleaning up contexts
+ // Cleanup render contexts
+ if (m_emulationGl) {
+ auto procIte = m_procOwnedEmulatedEglContexts.find(puid);
+ if (procIte != m_procOwnedEmulatedEglContexts.end()) {
+ for (auto ctx : procIte->second) {
+ m_contexts.erase(ctx);
+ }
+ m_procOwnedEmulatedEglContexts.erase(procIte);
+ }
+ }
+#endif
+
+ return colorBuffersToCleanup;
+}
+
+void FrameBuffer::markOpened(ColorBufferRef* cbRef) {
+ cbRef->opened = true;
+ eraseDelayedCloseColorBufferLocked(cbRef->cb->getHndl(), cbRef->closedTs);
+ cbRef->closedTs = 0;
+}
+
+void FrameBuffer::readBuffer(HandleType handle, uint64_t offset, uint64_t size, void* bytes) {
+ AutoLock mutex(m_lock);
+
+ BufferPtr buffer = findBuffer(handle);
+ if (!buffer) {
+ ERR("Failed to read buffer: buffer %d not found.", handle);
+ return;
+ }
+
+ buffer->readToBytes(offset, size, bytes);
+}
+
+void FrameBuffer::readColorBuffer(HandleType p_colorbuffer, int x, int y, int width, int height,
+ GLenum format, GLenum type, void* pixels) {
+ AutoLock mutex(m_lock);
+
+ ColorBufferPtr colorBuffer = findColorBuffer(p_colorbuffer);
+ if (!colorBuffer) {
+ // bad colorbuffer handle
+ return;
+ }
+
+ colorBuffer->readToBytes(x, y, width, height, format, type, pixels);
+}
+
+void FrameBuffer::readColorBufferYUV(HandleType p_colorbuffer, int x, int y, int width, int height,
+ void* pixels, uint32_t pixels_size) {
+ AutoLock mutex(m_lock);
+
+ ColorBufferPtr colorBuffer = findColorBuffer(p_colorbuffer);
+ if (!colorBuffer) {
+ // bad colorbuffer handle
+ return;
+ }
+
+ colorBuffer->readYuvToBytes(x, y, width, height, pixels, pixels_size);
+}
+
+bool FrameBuffer::updateBuffer(HandleType p_buffer, uint64_t offset, uint64_t size, void* bytes) {
+ AutoLock mutex(m_lock);
+
+ BufferPtr buffer = findBuffer(p_buffer);
+ if (!buffer) {
+ ERR("Failed to update buffer: buffer %d not found.", p_buffer);
+ return false;
+ }
+
+ return buffer->updateFromBytes(offset, size, bytes);
+}
+
+bool FrameBuffer::updateColorBuffer(HandleType p_colorbuffer,
+ int x,
+ int y,
+ int width,
+ int height,
+ GLenum format,
+ GLenum type,
+ void* pixels) {
+ if (width == 0 || height == 0) {
+ return false;
+ }
+
+ AutoLock mutex(m_lock);
+
+ ColorBufferPtr colorBuffer = findColorBuffer(p_colorbuffer);
+ if (!colorBuffer) {
+ // bad colorbuffer handle
+ return false;
+ }
+
+ colorBuffer->updateFromBytes(x, y, width, height, format, type, pixels);
+
+ return true;
+}
+
+bool FrameBuffer::updateColorBufferFromFrameworkFormat(HandleType p_colorbuffer, int x, int y,
+ int width, int height,
+ FrameworkFormat fwkFormat, GLenum format,
+ GLenum type, void* pixels, void* metadata) {
+ if (width == 0 || height == 0) {
+ return false;
+ }
+
+ AutoLock mutex(m_lock);
+
+ ColorBufferMap::iterator c(m_colorbuffers.find(p_colorbuffer));
+ if (c == m_colorbuffers.end()) {
+ // bad colorbuffer handle
+ return false;
+ }
+
+ (*c).second.cb->updateFromBytes(x, y, width, height, fwkFormat, format, type, pixels, metadata);
+ return true;
+}
+
+bool FrameBuffer::getColorBufferInfo(
+ HandleType p_colorbuffer, int* width, int* height, GLint* internalformat,
+ FrameworkFormat* frameworkFormat) {
+
+ AutoLock mutex(m_lock);
+
+ ColorBufferPtr colorBuffer = findColorBuffer(p_colorbuffer);
+ if (!colorBuffer) {
+ // bad colorbuffer handle
+ return false;
+ }
+
+ *width = colorBuffer->getWidth();
+ *height = colorBuffer->getHeight();
+ *internalformat = colorBuffer->getFormat();
+ if (frameworkFormat) {
+ *frameworkFormat = colorBuffer->getFrameworkFormat();
+ }
+
+ return true;
+}
+
+bool FrameBuffer::getBufferInfo(HandleType p_buffer, int* size) {
+ AutoLock mutex(m_lock);
+
+ BufferMap::iterator c(m_buffers.find(p_buffer));
+ if (c == m_buffers.end()) {
+ // Bad buffer handle.
+ return false;
+ }
+
+ auto buf = (*c).second.buffer;
+ *size = buf->getSize();
+ return true;
+}
+
+bool FrameBuffer::post(HandleType p_colorbuffer, bool needLockAndBind) {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_guestUsesAngle) {
+ flushColorBufferFromGl(p_colorbuffer);
+ }
+#endif
+
+ auto res = postImplSync(p_colorbuffer, needLockAndBind);
+ if (res) setGuestPostedAFrame();
+ return res;
+}
+
+void FrameBuffer::postWithCallback(HandleType p_colorbuffer, Post::CompletionCallback callback,
+ bool needLockAndBind) {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_guestUsesAngle) {
+ flushColorBufferFromGl(p_colorbuffer);
+ }
+#endif
+
+ AsyncResult res = postImpl(p_colorbuffer, callback, needLockAndBind);
+ if (res.Succeeded()) {
+ setGuestPostedAFrame();
+ }
+
+ if (!res.CallbackScheduledOrFired()) {
+ // If postImpl fails, we have not fired the callback. postWithCallback
+ // should always ensure the callback fires.
+ std::shared_future<void> callbackRes = std::async(std::launch::deferred, [] {});
+ callback(callbackRes);
+ }
+}
+
+bool FrameBuffer::postImplSync(HandleType p_colorbuffer, bool needLockAndBind, bool repaint) {
+ std::promise<void> promise;
+ std::future<void> completeFuture = promise.get_future();
+ auto posted = postImpl(
+ p_colorbuffer,
+ [&](std::shared_future<void> waitForGpu) {
+ waitForGpu.wait();
+ promise.set_value();
+ },
+ needLockAndBind, repaint);
+ if (posted.CallbackScheduledOrFired()) {
+ completeFuture.wait();
+ }
+
+ return posted.Succeeded();
+}
+
+AsyncResult FrameBuffer::postImpl(HandleType p_colorbuffer, Post::CompletionCallback callback,
+ bool needLockAndBind, bool repaint) {
+ std::unique_ptr<RecursiveScopedContextBind> bind;
+ if (needLockAndBind) {
+ m_lock.lock();
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_emulationGl) {
+ bind = std::make_unique<RecursiveScopedContextBind>(getPbufferSurfaceContextHelper());
+ }
+#endif
+ }
+ AsyncResult ret = AsyncResult::FAIL_AND_CALLBACK_NOT_SCHEDULED;
+
+ ColorBufferPtr colorBuffer = nullptr;
+ {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ ColorBufferMap::iterator c = m_colorbuffers.find(p_colorbuffer);
+ if (c != m_colorbuffers.end()) {
+ colorBuffer = c->second.cb;
+ c->second.refcount++;
+ markOpened(&c->second);
+ }
+ }
+ if (!colorBuffer) {
+ goto EXIT;
+ }
+
+ m_lastPostedColorBuffer = p_colorbuffer;
+
+ colorBuffer->touch();
+ if (m_subWin) {
+ Post postCmd;
+ postCmd.cmd = PostCmd::Post;
+ postCmd.cb = colorBuffer.get();
+ postCmd.cbHandle = p_colorbuffer;
+ postCmd.completionCallback = std::make_unique<Post::CompletionCallback>(callback);
+ sendPostWorkerCmd(std::move(postCmd));
+ ret = AsyncResult::OK_AND_CALLBACK_SCHEDULED;
+ } else {
+ // If there is no sub-window, don't display anything, the client will
+ // rely on m_onPost to get the pixels instead.
+ ret = AsyncResult::OK_AND_CALLBACK_NOT_SCHEDULED;
+ }
+
+ //
+ // output FPS and performance usage statistics
+ //
+ if (m_fpsStats) {
+ long long currTime = android::base::getHighResTimeUs() / 1000;
+ m_statsNumFrames++;
+ if (currTime - m_statsStartTime >= 1000) {
+ if (m_fpsStats) {
+ float dt = (float)(currTime - m_statsStartTime) / 1000.0f;
+ printf("FPS: %5.3f \n", (float)m_statsNumFrames / dt);
+ m_statsNumFrames = 0;
+ }
+ m_statsStartTime = currTime;
+ }
+ }
+
+ //
+ // Send framebuffer (without FPS overlay) to callback
+ //
+ if (m_onPost.size() == 0) {
+ goto DEC_REFCOUNT_AND_EXIT;
+ }
+ for (auto& iter : m_onPost) {
+ ColorBufferPtr cb;
+ if (iter.first == 0) {
+ cb = colorBuffer;
+ } else {
+ uint32_t colorBuffer;
+ if (getDisplayColorBuffer(iter.first, &colorBuffer) < 0) {
+ ERR("Failed to get color buffer for display %d, skip onPost", iter.first);
+ continue;
+ }
+
+ cb = findColorBuffer(colorBuffer);
+ if (!cb) {
+ ERR("Failed to find colorbuffer %d, skip onPost", colorBuffer);
+ continue;
+ }
+ }
+
+ if (asyncReadbackSupported()) {
+ ensureReadbackWorker();
+ const auto status = m_readbackWorker->doNextReadback(
+ iter.first, cb.get(), iter.second.img, repaint, iter.second.readBgra);
+ if (status == ReadbackWorker::DoNextReadbackResult::OK_READY_FOR_READ) {
+ doPostCallback(iter.second.img, iter.first);
+ }
+ } else {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ cb->glOpReadback(iter.second.img, iter.second.readBgra);
+#endif
+ doPostCallback(iter.second.img, iter.first);
+ }
+ }
+DEC_REFCOUNT_AND_EXIT:
+ if (!m_subWin) { // m_subWin is supposed to be false
+ decColorBufferRefCountLocked(p_colorbuffer);
+ }
+
+EXIT:
+ if (needLockAndBind) {
+ bind.reset();
+ m_lock.unlock();
+ }
+ return ret;
+}
+
+void FrameBuffer::doPostCallback(void* pixels, uint32_t displayId) {
+ const auto& iter = m_onPost.find(displayId);
+ if (iter == m_onPost.end()) {
+ ERR("Cannot find post callback function for display %d", displayId);
+ return;
+ }
+ iter->second.cb(iter->second.context, displayId, iter->second.width, iter->second.height, -1,
+ GL_RGBA, GL_UNSIGNED_BYTE, (unsigned char*)pixels);
+}
+
+void FrameBuffer::getPixels(void* pixels, uint32_t bytes, uint32_t displayId) {
+ const auto& iter = m_onPost.find(displayId);
+ if (iter == m_onPost.end()) {
+ ERR("Display %d not configured for recording yet", displayId);
+ return;
+ }
+ std::future<void> completeFuture =
+ m_readbackThread.enqueue({ReadbackCmd::GetPixels, displayId, pixels, bytes});
+ completeFuture.wait();
+}
+
+void FrameBuffer::flushReadPipeline(int displayId) {
+ const auto& iter = m_onPost.find(displayId);
+ if (iter == m_onPost.end()) {
+ ERR("Cannot find onPost pixels for display %d", displayId);
+ return;
+ }
+
+ ensureReadbackWorker();
+
+ const auto status = m_readbackWorker->flushPipeline(displayId);
+ if (status == ReadbackWorker::FlushResult::OK_READY_FOR_READ) {
+ doPostCallback(nullptr, displayId);
+ }
+}
+
+void FrameBuffer::ensureReadbackWorker() {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (!m_readbackWorker) {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "GL/EGL emulation not enabled.";
+ }
+ m_readbackWorker = m_emulationGl->getReadbackWorker();
+ }
+#endif
+}
+
+static void sFrameBuffer_ReadPixelsCallback(void* pixels, uint32_t bytes, uint32_t displayId) {
+ FrameBuffer::getFB()->getPixels(pixels, bytes, displayId);
+}
+
+static void sFrameBuffer_FlushReadPixelPipeline(int displayId) {
+ FrameBuffer::getFB()->flushReadPipeline(displayId);
+}
+
+bool FrameBuffer::asyncReadbackSupported() {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ return m_emulationGl && m_emulationGl->isAsyncReadbackSupported();
+#else
+ return false;
+#endif
+}
+
+Renderer::ReadPixelsCallback FrameBuffer::getReadPixelsCallback() {
+ return sFrameBuffer_ReadPixelsCallback;
+}
+
+Renderer::FlushReadPixelPipeline FrameBuffer::getFlushReadPixelPipeline() {
+ return sFrameBuffer_FlushReadPixelPipeline;
+}
+
+bool FrameBuffer::repost(bool needLockAndBind) {
+ GL_LOG("Reposting framebuffer.");
+ if (m_displayVk) {
+ return true;
+ }
+ if (m_lastPostedColorBuffer && sInitialized.load(std::memory_order_relaxed)) {
+ GL_LOG("Has last posted colorbuffer and is initialized; post.");
+ return postImplSync(m_lastPostedColorBuffer, needLockAndBind, true);
+ } else {
+ GL_LOG("No repost: no last posted color buffer");
+ if (!sInitialized.load(std::memory_order_relaxed)) {
+ GL_LOG("No repost: initialization is not finished.");
+ }
+ }
+ return false;
+}
+
+template <class Collection>
+static void saveProcOwnedCollection(Stream* stream, const Collection& c) {
+ // Exclude empty handle lists from saving as they add no value but only
+ // increase the snapshot size; keep the format compatible with
+ // android::base::saveCollection() though.
+ const int count = std::count_if(
+ c.begin(), c.end(),
+ [](const typename Collection::value_type& pair) { return !pair.second.empty(); });
+ stream->putBe32(count);
+ for (const auto& pair : c) {
+ if (pair.second.empty()) {
+ continue;
+ }
+ stream->putBe64(pair.first);
+ saveCollection(stream, pair.second, [](Stream* s, HandleType h) { s->putBe32(h); });
+ }
+}
+
+template <class Collection>
+static void loadProcOwnedCollection(Stream* stream, Collection* c) {
+ loadCollection(stream, c, [](Stream* stream) -> typename Collection::value_type {
+ const int processId = stream->getBe64();
+ typename Collection::mapped_type handles;
+ loadCollection(stream, &handles, [](Stream* s) { return s->getBe32(); });
+ return {processId, std::move(handles)};
+ });
+}
+
+int FrameBuffer::getScreenshot(unsigned int nChannels, unsigned int* width, unsigned int* height,
+ uint8_t* pixels, size_t* cPixels, int displayId, int desiredWidth,
+ int desiredHeight, int desiredRotation, Rect rect) {
+ AutoLock mutex(m_lock);
+ uint32_t w, h, cb, screenWidth, screenHeight;
+ if (!emugl::get_emugl_multi_display_operations().getMultiDisplay(
+ displayId, nullptr, nullptr, &w, &h, nullptr, nullptr, nullptr)) {
+ ERR("Screenshot of invalid display %d", displayId);
+ *width = 0;
+ *height = 0;
+ *cPixels = 0;
+ return -1;
+ }
+ if (nChannels != 3 && nChannels != 4) {
+ ERR("Screenshot only support 3(RGB) or 4(RGBA) channels");
+ *width = 0;
+ *height = 0;
+ *cPixels = 0;
+ return -1;
+ }
+ emugl::get_emugl_multi_display_operations().getDisplayColorBuffer(displayId, &cb);
+ if (displayId == 0) {
+ cb = m_lastPostedColorBuffer;
+ }
+ ColorBufferPtr colorBuffer = findColorBuffer(cb);
+ if (!colorBuffer) {
+ *width = 0;
+ *height = 0;
+ *cPixels = 0;
+ return -1;
+ }
+
+ screenWidth = (desiredWidth == 0) ? w : desiredWidth;
+ screenHeight = (desiredHeight == 0) ? h : desiredHeight;
+
+ bool useSnipping = (rect.size.w != 0 && rect.size.h != 0);
+ if (useSnipping) {
+ if (desiredWidth == 0 || desiredHeight == 0) {
+ ERR("Must provide non-zero desiredWidth and desireRectanlge "
+ "when using rectangle snipping");
+ *width = 0;
+ *height = 0;
+ *cPixels = 0;
+ return -1;
+ }
+ if ((rect.pos.x < 0 || rect.pos.y < 0) ||
+ (desiredWidth < rect.pos.x + rect.size.w || desiredHeight < rect.pos.y + rect.size.h)) {
+ return -1;
+ }
+ }
+
+ if (useSnipping) {
+ *width = rect.size.w;
+ *height = rect.size.h;
+ } else {
+ *width = screenWidth;
+ *height = screenHeight;
+ }
+
+ int needed =
+ useSnipping ? (nChannels * rect.size.w * rect.size.h) : (nChannels * (*width) * (*height));
+
+ if (*cPixels < needed) {
+ *cPixels = needed;
+ return -2;
+ }
+ *cPixels = needed;
+ if (desiredRotation == SKIN_ROTATION_90 || desiredRotation == SKIN_ROTATION_270) {
+ std::swap(*width, *height);
+ std::swap(screenWidth, screenHeight);
+ std::swap(rect.size.w, rect.size.h);
+ }
+ // Transform the x, y coordinates given the rotation.
+ // Assume (0, 0) represents the top left corner of the screen.
+ if (useSnipping) {
+ int x, y;
+ switch (desiredRotation) {
+ case SKIN_ROTATION_0:
+ x = rect.pos.x;
+ y = rect.pos.y;
+ break;
+ case SKIN_ROTATION_90:
+ x = rect.pos.y;
+ y = rect.pos.x;
+ break;
+ case SKIN_ROTATION_180:
+ x = screenWidth - rect.pos.x - rect.size.w;
+ y = rect.pos.y;
+ break;
+ case SKIN_ROTATION_270:
+ x = rect.pos.y;
+ y = screenHeight - rect.pos.x - rect.size.h;
+ break;
+ }
+ rect.pos.x = x;
+ rect.pos.y = y;
+ }
+
+ GLenum format = nChannels == 3 ? GL_RGB : GL_RGBA;
+ Post scrCmd;
+ scrCmd.cmd = PostCmd::Screenshot;
+ scrCmd.screenshot.cb = colorBuffer.get();
+ scrCmd.screenshot.screenwidth = screenWidth;
+ scrCmd.screenshot.screenheight = screenHeight;
+ scrCmd.screenshot.format = format;
+ scrCmd.screenshot.type = GL_UNSIGNED_BYTE;
+ scrCmd.screenshot.rotation = desiredRotation;
+ scrCmd.screenshot.pixels = pixels;
+ scrCmd.screenshot.rect = rect;
+
+ std::future<void> completeFuture = sendPostWorkerCmd(std::move(scrCmd));
+
+ mutex.unlock();
+ completeFuture.wait();
+ return 0;
+}
+
+void FrameBuffer::onLastColorBufferRef(uint32_t handle) {
+ if (!mOutstandingColorBufferDestroys.trySend((HandleType)handle)) {
+ ERR("warning: too many outstanding "
+ "color buffer destroys. leaking handle 0x%x",
+ handle);
+ }
+}
+
+bool FrameBuffer::decColorBufferRefCountLocked(HandleType p_colorbuffer) {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ const auto& it = m_colorbuffers.find(p_colorbuffer);
+ if (it != m_colorbuffers.end()) {
+ it->second.refcount -= 1;
+ if (it->second.refcount == 0) {
+ m_colorbuffers.erase(p_colorbuffer);
+ return true;
+ }
+ }
+ return false;
+}
+
+bool FrameBuffer::compose(uint32_t bufferSize, void* buffer, bool needPost) {
+ std::promise<void> promise;
+ std::future<void> completeFuture = promise.get_future();
+ auto composeRes =
+ composeWithCallback(bufferSize, buffer, [&](std::shared_future<void> waitForGpu) {
+ waitForGpu.wait();
+ promise.set_value();
+ });
+ if (!composeRes.Succeeded()) {
+ return false;
+ }
+
+ if (composeRes.CallbackScheduledOrFired()) {
+ completeFuture.wait();
+ }
+
+ const auto& multiDisplay = emugl::get_emugl_multi_display_operations();
+ const bool is_pixel_fold = multiDisplay.isPixelFold();
+ if (needPost) {
+ // AEMU with -no-window mode uses this code path.
+ ComposeDevice* composeDevice = (ComposeDevice*)buffer;
+
+ switch (composeDevice->version) {
+ case 1: {
+ post(composeDevice->targetHandle, true);
+ break;
+ }
+ case 2: {
+ ComposeDevice_v2* composeDeviceV2 = (ComposeDevice_v2*)buffer;
+ if (is_pixel_fold || composeDeviceV2->displayId == 0) {
+ post(composeDeviceV2->targetHandle, true);
+ }
+ break;
+ }
+ default: {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+AsyncResult FrameBuffer::composeWithCallback(uint32_t bufferSize, void* buffer,
+ Post::CompletionCallback callback) {
+ ComposeDevice* p = (ComposeDevice*)buffer;
+ AutoLock mutex(m_lock);
+
+ switch (p->version) {
+ case 1: {
+ Post composeCmd;
+ composeCmd.composeVersion = 1;
+ composeCmd.composeBuffer.resize(bufferSize);
+ memcpy(composeCmd.composeBuffer.data(), buffer, bufferSize);
+ composeCmd.completionCallback = std::make_unique<Post::CompletionCallback>(callback);
+ composeCmd.cmd = PostCmd::Compose;
+ sendPostWorkerCmd(std::move(composeCmd));
+ return AsyncResult::OK_AND_CALLBACK_SCHEDULED;
+ }
+
+ case 2: {
+ // support for multi-display
+ ComposeDevice_v2* p2 = (ComposeDevice_v2*)buffer;
+ if (p2->displayId != 0) {
+ mutex.unlock();
+ setDisplayColorBuffer(p2->displayId, p2->targetHandle);
+ mutex.lock();
+ }
+ Post composeCmd;
+ composeCmd.composeVersion = 2;
+ composeCmd.composeBuffer.resize(bufferSize);
+ memcpy(composeCmd.composeBuffer.data(), buffer, bufferSize);
+ composeCmd.completionCallback = std::make_unique<Post::CompletionCallback>(callback);
+ composeCmd.cmd = PostCmd::Compose;
+ sendPostWorkerCmd(std::move(composeCmd));
+ return AsyncResult::OK_AND_CALLBACK_SCHEDULED;
+ }
+
+ default:
+ ERR("yet to handle composition device version: %d", p->version);
+ return AsyncResult::FAIL_AND_CALLBACK_NOT_SCHEDULED;
+ }
+}
+
+void FrameBuffer::onSave(Stream* stream, const android::snapshot::ITextureSaverPtr& textureSaver) {
+ // Things we do not need to snapshot:
+ // m_eglSurface
+ // m_eglContext
+ // m_pbufSurface
+ // m_pbufContext
+ // m_prevContext
+ // m_prevReadSurf
+ // m_prevDrawSurf
+ AutoLock mutex(m_lock);
+
+ std::unique_ptr<RecursiveScopedContextBind> bind;
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_emulationGl) {
+ // Some snapshot commands try using GL.
+ bind = std::make_unique<RecursiveScopedContextBind>(getPbufferSurfaceContextHelper());
+ if (!bind->isOk()) {
+ ERR("Failed to make context current for saving snapshot.");
+ }
+
+ // eglPreSaveContext labels all guest context textures to be saved
+ // (textures created by the host are not saved!)
+ // eglSaveAllImages labels all EGLImages (both host and guest) to be saved
+ // and save all labeled textures and EGLImages.
+ if (s_egl.eglPreSaveContext && s_egl.eglSaveAllImages) {
+ for (const auto& ctx : m_contexts) {
+ s_egl.eglPreSaveContext(getDisplay(), ctx.second->getEGLContext(), stream);
+ }
+ s_egl.eglSaveAllImages(getDisplay(), stream, &textureSaver);
+ }
+ }
+#endif
+
+ // Don't save subWindow's x/y/w/h here - those are related to the current
+ // emulator UI state, not guest state that we're saving.
+ stream->putBe32(m_framebufferWidth);
+ stream->putBe32(m_framebufferHeight);
+ stream->putFloat(m_dpr);
+ stream->putBe32(mDisplayActiveConfigId);
+ saveCollection(stream, mDisplayConfigs,
+ [](Stream* s, const std::map<int, DisplayConfig>::value_type& pair) {
+ s->putBe32(pair.first);
+ s->putBe32(pair.second.w);
+ s->putBe32(pair.second.h);
+ s->putBe32(pair.second.dpiX);
+ s->putBe32(pair.second.dpiY);
+ });
+
+ stream->putBe32(m_useSubWindow);
+ stream->putBe32(/*Obsolete m_eglContextInitialized =*/1);
+
+ stream->putBe32(m_fpsStats);
+ stream->putBe32(m_statsNumFrames);
+ stream->putBe64(m_statsStartTime);
+
+ // Save all contexts.
+ // Note: some of the contexts might not be restored yet. In such situation
+ // we skip reading from GPU (for non-texture objects) or force a restore in
+ // previous eglPreSaveContext and eglSaveAllImages calls (for texture
+ // objects).
+ // TODO: skip reading from GPU even for texture objects.
+#if GFXSTREAM_ENABLE_HOST_GLES
+ saveCollection(
+ stream, m_contexts,
+ [](Stream* s, const EmulatedEglContextMap::value_type& pair) { pair.second->onSave(s); });
+#endif
+
+ // We don't need to save |m_colorBufferCloseTsMap| here - there's enough
+ // information to reconstruct it when loading.
+ uint64_t now = android::base::getUnixTimeUs();
+
+ {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ stream->putByte(m_guestManagedColorBufferLifetime);
+ saveCollection(stream, m_colorbuffers,
+ [now](Stream* s, const ColorBufferMap::value_type& pair) {
+ pair.second.cb->onSave(s);
+ s->putBe32(pair.second.refcount);
+ s->putByte(pair.second.opened);
+ s->putBe32(std::max<uint64_t>(0, now - pair.second.closedTs));
+ });
+ }
+ stream->putBe32(m_lastPostedColorBuffer);
+#if GFXSTREAM_ENABLE_HOST_GLES
+ saveCollection(stream, m_windows,
+ [](Stream* s, const EmulatedEglWindowSurfaceMap::value_type& pair) {
+ pair.second.first->onSave(s);
+ s->putBe32(pair.second.second); // Color buffer handle.
+ });
+#endif
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ saveProcOwnedCollection(stream, m_procOwnedEmulatedEglWindowSurfaces);
+#endif
+ saveProcOwnedCollection(stream, m_procOwnedColorBuffers);
+#if GFXSTREAM_ENABLE_HOST_GLES
+ saveProcOwnedCollection(stream, m_procOwnedEmulatedEglImages);
+ saveProcOwnedCollection(stream, m_procOwnedEmulatedEglContexts);
+#endif
+
+ // TODO(b/309858017): remove if when ready to bump snapshot version
+ if (feature_is_enabled(kFeature_VulkanSnapshots)) {
+ stream->putBe64(m_procOwnedResources.size());
+ for (const auto& element : m_procOwnedResources) {
+ stream->putBe64(element.first);
+ stream->putBe32(element.second->getSequenceNumberPtr()->load());
+ }
+ }
+
+ // Save Vulkan state
+ if (feature_is_enabled(kFeature_VulkanSnapshots) && vk::VkDecoderGlobalState::get()) {
+ vk::VkDecoderGlobalState::get()->save(stream);
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_emulationGl) {
+ if (s_egl.eglPostSaveContext) {
+ for (const auto& ctx : m_contexts) {
+ s_egl.eglPostSaveContext(getDisplay(), ctx.second->getEGLContext(), stream);
+ }
+ // We need to run the post save step for m_eglContext
+ // to mark their texture handles dirty
+ if (getContext() != EGL_NO_CONTEXT) {
+ s_egl.eglPostSaveContext(getDisplay(), getContext(), stream);
+ }
+ }
+
+ EmulatedEglFenceSync::onSave(stream);
+ }
+#endif
+}
+
+bool FrameBuffer::onLoad(Stream* stream,
+ const android::snapshot::ITextureLoaderPtr& textureLoader) {
+ AutoLock lock(m_lock);
+ // cleanups
+ {
+ sweepColorBuffersLocked();
+
+ std::unique_ptr<RecursiveScopedContextBind> bind;
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_emulationGl) {
+ // Some snapshot commands try using GL.
+ bind = std::make_unique<RecursiveScopedContextBind>(getPbufferSurfaceContextHelper());
+ if (!bind->isOk()) {
+ ERR("Failed to make context current for loading snapshot.");
+ }
+ }
+#endif
+
+ bool cleanupComplete = false;
+ {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ if (m_procOwnedCleanupCallbacks.empty() && m_procOwnedColorBuffers.empty() &&
+#if GFXSTREAM_ENABLE_HOST_GLES
+ m_procOwnedEmulatedEglContexts.empty() && m_procOwnedEmulatedEglImages.empty() &&
+ m_procOwnedEmulatedEglWindowSurfaces.empty() &&
+#endif
+ (
+#if GFXSTREAM_ENABLE_HOST_GLES
+ !m_contexts.empty() || !m_windows.empty() ||
+#endif
+ m_colorbuffers.size() > m_colorBufferDelayedCloseList.size())) {
+ // we are likely on a legacy system image, which does not have
+ // process owned objects. We need to force cleanup everything
+#if GFXSTREAM_ENABLE_HOST_GLES
+ m_contexts.clear();
+ m_windows.clear();
+#endif
+ m_colorbuffers.clear();
+ cleanupComplete = true;
+ }
+ }
+ if (!cleanupComplete) {
+ std::vector<HandleType> colorBuffersToCleanup;
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ while (m_procOwnedEmulatedEglWindowSurfaces.size()) {
+ auto cleanupHandles = cleanupProcGLObjects_locked(
+ m_procOwnedEmulatedEglWindowSurfaces.begin()->first, true);
+ colorBuffersToCleanup.insert(colorBuffersToCleanup.end(), cleanupHandles.begin(),
+ cleanupHandles.end());
+ }
+#endif
+ while (m_procOwnedColorBuffers.size()) {
+ auto cleanupHandles =
+ cleanupProcGLObjects_locked(m_procOwnedColorBuffers.begin()->first, true);
+ colorBuffersToCleanup.insert(colorBuffersToCleanup.end(), cleanupHandles.begin(),
+ cleanupHandles.end());
+ }
+#if GFXSTREAM_ENABLE_HOST_GLES
+ while (m_procOwnedEmulatedEglImages.size()) {
+ auto cleanupHandles =
+ cleanupProcGLObjects_locked(m_procOwnedEmulatedEglImages.begin()->first, true);
+ colorBuffersToCleanup.insert(colorBuffersToCleanup.end(), cleanupHandles.begin(),
+ cleanupHandles.end());
+ }
+ while (m_procOwnedEmulatedEglContexts.size()) {
+ auto cleanupHandles = cleanupProcGLObjects_locked(
+ m_procOwnedEmulatedEglContexts.begin()->first, true);
+ colorBuffersToCleanup.insert(colorBuffersToCleanup.end(), cleanupHandles.begin(),
+ cleanupHandles.end());
+ }
+#endif
+
+ std::vector<std::function<void()>> cleanupCallbacks;
+
+ while (m_procOwnedCleanupCallbacks.size()) {
+ auto it = m_procOwnedCleanupCallbacks.begin();
+ while (it != m_procOwnedCleanupCallbacks.end()) {
+ for (auto it2 : it->second) {
+ cleanupCallbacks.push_back(it2.second);
+ }
+ it = m_procOwnedCleanupCallbacks.erase(it);
+ }
+ }
+
+ m_procOwnedResources.clear();
+
+ performDelayedColorBufferCloseLocked(true);
+
+ lock.unlock();
+
+ for (auto cb : cleanupCallbacks) {
+ cb();
+ }
+
+ lock.lock();
+ cleanupComplete = true;
+ }
+ m_colorBufferDelayedCloseList.clear();
+#if GFXSTREAM_ENABLE_HOST_GLES
+ assert(m_contexts.empty());
+ assert(m_windows.empty());
+#endif
+ {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ if (!m_colorbuffers.empty()) {
+ ERR("warning: on load, stale colorbuffers: %zu", m_colorbuffers.size());
+ m_colorbuffers.clear();
+ }
+ assert(m_colorbuffers.empty());
+ }
+#ifdef SNAPSHOT_PROFILE
+ uint64_t texTime = android::base::getUnixTimeUs();
+#endif
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_emulationGl) {
+ if (s_egl.eglLoadAllImages) {
+ s_egl.eglLoadAllImages(getDisplay(), stream, &textureLoader);
+ }
+ }
+#endif
+#ifdef SNAPSHOT_PROFILE
+ printf("Texture load time: %lld ms\n",
+ (long long)(android::base::getUnixTimeUs() - texTime) / 1000);
+#endif
+ }
+ // See comment about subwindow position in onSave().
+ m_framebufferWidth = stream->getBe32();
+ m_framebufferHeight = stream->getBe32();
+ m_dpr = stream->getFloat();
+ mDisplayActiveConfigId = stream->getBe32();
+ loadCollection(stream, &mDisplayConfigs,
+ [](Stream* s) -> std::map<int, DisplayConfig>::value_type {
+ int idx = static_cast<int>(s->getBe32());
+ int w = static_cast<int>(s->getBe32());
+ int h = static_cast<int>(s->getBe32());
+ int dpiX = static_cast<int>(s->getBe32());
+ int dpiY = static_cast<int>(s->getBe32());
+ return {idx, {w, h, dpiX, dpiY}};
+ });
+
+ // TODO: resize the window
+ //
+ m_useSubWindow = stream->getBe32();
+ /*Obsolete m_eglContextInitialized =*/stream->getBe32();
+
+ m_fpsStats = stream->getBe32();
+ m_statsNumFrames = stream->getBe32();
+ m_statsStartTime = stream->getBe64();
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ loadCollection(
+ stream, &m_contexts, [this](Stream* stream) -> EmulatedEglContextMap::value_type {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "GL/EGL emulation not enabled.";
+ }
+
+ auto context = m_emulationGl->loadEmulatedEglContext(stream);
+ auto contextHandle = context ? context->getHndl() : 0;
+ return {contextHandle, std::move(context)};
+ });
+ assert(!android::base::find(m_contexts, 0));
+#endif
+
+ auto now = android::base::getUnixTimeUs();
+ {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ m_guestManagedColorBufferLifetime = stream->getByte();
+ loadCollection(
+ stream, &m_colorbuffers, [this, now](Stream* stream) -> ColorBufferMap::value_type {
+ ColorBufferPtr cb = ColorBuffer::onLoad(m_emulationGl.get(), m_emulationVk, stream);
+ const HandleType handle = cb->getHndl();
+ const unsigned refCount = stream->getBe32();
+ const bool opened = stream->getByte();
+ const uint64_t closedTs = now - stream->getBe32();
+ if (refCount == 0) {
+ m_colorBufferDelayedCloseList.push_back({closedTs, handle});
+ }
+ return {handle, ColorBufferRef{std::move(cb), refCount, opened, closedTs}};
+ });
+ }
+ m_lastPostedColorBuffer = static_cast<HandleType>(stream->getBe32());
+ GL_LOG("Got lasted posted color buffer from snapshot");
+
+ {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+#if GFXSTREAM_ENABLE_HOST_GLES
+ loadCollection(
+ stream, &m_windows, [this](Stream* stream) -> EmulatedEglWindowSurfaceMap::value_type {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "GL/EGL emulation not enabled.";
+ }
+
+ auto window =
+ m_emulationGl->loadEmulatedEglWindowSurface(stream, m_colorbuffers, m_contexts);
+
+ HandleType handle = window->getHndl();
+ HandleType colorBufferHandle = stream->getBe32();
+ return {handle, {std::move(window), colorBufferHandle}};
+ });
+#endif
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ loadProcOwnedCollection(stream, &m_procOwnedEmulatedEglWindowSurfaces);
+#endif
+ loadProcOwnedCollection(stream, &m_procOwnedColorBuffers);
+#if GFXSTREAM_ENABLE_HOST_GLES
+ loadProcOwnedCollection(stream, &m_procOwnedEmulatedEglImages);
+ loadProcOwnedCollection(stream, &m_procOwnedEmulatedEglContexts);
+#endif
+ // TODO(b/309858017): remove if when ready to bump snapshot version
+ if (feature_is_enabled(kFeature_VulkanSnapshots)) {
+ size_t resourceCount = stream->getBe64();
+ for (size_t i = 0; i < resourceCount; i++) {
+ uint64_t puid = stream->getBe64();
+ uint32_t sequenceNumber = stream->getBe32();
+ std::unique_ptr<ProcessResources> processResources = ProcessResources::create();
+ processResources->getSequenceNumberPtr()->store(sequenceNumber);
+ m_procOwnedResources.emplace(puid, std::move(processResources));
+ }
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_emulationGl) {
+ if (s_egl.eglPostLoadAllImages) {
+ s_egl.eglPostLoadAllImages(getDisplay(), stream);
+ }
+ }
+
+ registerTriggerWait();
+#endif
+
+ {
+ std::unique_ptr<RecursiveScopedContextBind> bind;
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_emulationGl) {
+ // Some snapshot commands try using GL.
+ bind = std::make_unique<RecursiveScopedContextBind>(getPbufferSurfaceContextHelper());
+ if (!bind->isOk()) {
+ ERR("Failed to make context current for loading snapshot.");
+ }
+ }
+#endif
+
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ for (auto& it : m_colorbuffers) {
+ if (it.second.cb) {
+ it.second.cb->touch();
+ }
+ }
+ }
+
+ // Restore Vulkan state
+ if (feature_is_enabled(kFeature_VulkanSnapshots) && vk::VkDecoderGlobalState::get()) {
+ lock.unlock();
+ GfxApiLogger gfxLogger;
+ vk::VkDecoderGlobalState::get()->load(stream, gfxLogger, m_healthMonitor.get());
+ lock.lock();
+ }
+
+ repost(false);
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (m_emulationGl) {
+ EmulatedEglFenceSync::onLoad(stream);
+ }
+#endif
+
+ return true;
+ // TODO: restore memory management
+}
+
+void FrameBuffer::lock() { m_lock.lock(); }
+
+void FrameBuffer::unlock() { m_lock.unlock(); }
+
+ColorBufferPtr FrameBuffer::findColorBuffer(HandleType p_colorbuffer) {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ ColorBufferMap::iterator c(m_colorbuffers.find(p_colorbuffer));
+ if (c == m_colorbuffers.end()) {
+ return nullptr;
+ } else {
+ return c->second.cb;
+ }
+}
+
+BufferPtr FrameBuffer::findBuffer(HandleType p_buffer) {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ BufferMap::iterator b(m_buffers.find(p_buffer));
+ if (b == m_buffers.end()) {
+ return nullptr;
+ } else {
+ return b->second.buffer;
+ }
+}
+
+void FrameBuffer::registerProcessCleanupCallback(void* key, std::function<void()> cb) {
+ AutoLock mutex(m_lock);
+ RenderThreadInfo* tInfo = RenderThreadInfo::get();
+ if (!tInfo) return;
+
+ auto& callbackMap = m_procOwnedCleanupCallbacks[tInfo->m_puid];
+ callbackMap[key] = cb;
+}
+
+void FrameBuffer::unregisterProcessCleanupCallback(void* key) {
+ AutoLock mutex(m_lock);
+ RenderThreadInfo* tInfo = RenderThreadInfo::get();
+ if (!tInfo) return;
+
+ auto& callbackMap = m_procOwnedCleanupCallbacks[tInfo->m_puid];
+ if (callbackMap.find(key) == callbackMap.end()) {
+ ERR("warning: tried to erase nonexistent key %p "
+ "associated with process %llu",
+ key, (unsigned long long)(tInfo->m_puid));
+ }
+ callbackMap.erase(key);
+}
+
+const ProcessResources* FrameBuffer::getProcessResources(uint64_t puid) {
+ AutoLock mutex(m_lock);
+ auto i = m_procOwnedResources.find(puid);
+ if (i == m_procOwnedResources.end()) {
+ ERR("Failed to find process owned resources for puid %" PRIu64 ".", puid);
+ return nullptr;
+ }
+ return i->second.get();
+}
+
+int FrameBuffer::createDisplay(uint32_t* displayId) {
+ return emugl::get_emugl_multi_display_operations().createDisplay(displayId);
+}
+
+int FrameBuffer::createDisplay(uint32_t displayId) {
+ return emugl::get_emugl_multi_display_operations().createDisplay(&displayId);
+}
+
+int FrameBuffer::destroyDisplay(uint32_t displayId) {
+ return emugl::get_emugl_multi_display_operations().destroyDisplay(displayId);
+}
+
+int FrameBuffer::setDisplayColorBuffer(uint32_t displayId, uint32_t colorBuffer) {
+ return emugl::get_emugl_multi_display_operations().setDisplayColorBuffer(displayId,
+ colorBuffer);
+}
+
+int FrameBuffer::getDisplayColorBuffer(uint32_t displayId, uint32_t* colorBuffer) {
+ return emugl::get_emugl_multi_display_operations().getDisplayColorBuffer(displayId,
+ colorBuffer);
+}
+
+int FrameBuffer::getColorBufferDisplay(uint32_t colorBuffer, uint32_t* displayId) {
+ return emugl::get_emugl_multi_display_operations().getColorBufferDisplay(colorBuffer,
+ displayId);
+}
+
+int FrameBuffer::getDisplayPose(uint32_t displayId, int32_t* x, int32_t* y, uint32_t* w,
+ uint32_t* h) {
+ return emugl::get_emugl_multi_display_operations().getDisplayPose(displayId, x, y, w, h);
+}
+
+int FrameBuffer::setDisplayPose(uint32_t displayId, int32_t x, int32_t y, uint32_t w, uint32_t h,
+ uint32_t dpi) {
+ return emugl::get_emugl_multi_display_operations().setDisplayPose(displayId, x, y, w, h, dpi);
+}
+
+void FrameBuffer::sweepColorBuffersLocked() {
+ HandleType handleToDestroy;
+ while (mOutstandingColorBufferDestroys.tryReceive(&handleToDestroy)) {
+ decColorBufferRefCountLocked(handleToDestroy);
+ }
+}
+
+std::future<void> FrameBuffer::blockPostWorker(std::future<void> continueSignal) {
+ std::promise<void> scheduled;
+ std::future<void> scheduledFuture = scheduled.get_future();
+ Post postCmd = {
+ .cmd = PostCmd::Block,
+ .block = std::make_unique<Post::Block>(Post::Block{
+ .scheduledSignal = std::move(scheduled),
+ .continueSignal = std::move(continueSignal),
+ }),
+ };
+ sendPostWorkerCmd(std::move(postCmd));
+ return scheduledFuture;
+}
+
+void FrameBuffer::waitForGpuVulkan(uint64_t deviceHandle, uint64_t fenceHandle) {
+ (void)deviceHandle;
+ if (!m_emulationGl) {
+ // Guest ANGLE should always use the asyncWaitForGpuVulkanWithCb call. EmulatedEglFenceSync
+ // is a wrapper over EGLSyncKHR and should not be used for pure Vulkan environment.
+ return;
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ // Note: this will always be nullptr.
+ EmulatedEglFenceSync* fenceSync = EmulatedEglFenceSync::getFromHandle(fenceHandle);
+
+ // Note: This will always signal right away.
+ SyncThread::get()->triggerBlockedWaitNoTimeline(fenceSync);
+#endif
+}
+
+void FrameBuffer::asyncWaitForGpuVulkanWithCb(uint64_t deviceHandle, uint64_t fenceHandle,
+ FenceCompletionCallback cb) {
+ (void)deviceHandle;
+ SyncThread::get()->triggerWaitVkWithCompletionCallback((VkFence)fenceHandle, std::move(cb));
+}
+
+void FrameBuffer::asyncWaitForGpuVulkanQsriWithCb(uint64_t image, FenceCompletionCallback cb) {
+ SyncThread::get()->triggerWaitVkQsriWithCompletionCallback((VkImage)image, std::move(cb));
+}
+
+void FrameBuffer::waitForGpuVulkanQsri(uint64_t image) {
+ (void)image;
+ // Signal immediately, because this was a sync wait and it's vulkan.
+#if GFXSTREAM_ENABLE_HOST_GLES
+ SyncThread::get()->triggerBlockedWaitNoTimeline(nullptr);
+#endif
+}
+
+void FrameBuffer::setGuestManagedColorBufferLifetime(bool guestManaged) {
+ m_guestManagedColorBufferLifetime = guestManaged;
+}
+
+bool FrameBuffer::platformImportResource(uint32_t handle, uint32_t info, void* resource) {
+ if (!resource) {
+ ERR("Error: resource was null");
+ }
+
+ AutoLock mutex(m_lock);
+
+ ColorBufferPtr colorBuffer = findColorBuffer(handle);
+ if (!colorBuffer) {
+ ERR("Error: resource %u not found as a ColorBuffer", handle);
+ return false;
+ }
+
+ uint32_t type = (info & RESOURCE_TYPE_MASK);
+ bool preserveContent = (info & RESOURCE_USE_PRESERVE);
+
+ switch (type) {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ case RESOURCE_TYPE_EGL_NATIVE_PIXMAP:
+ return colorBuffer->glOpImportEglNativePixmap(resource, preserveContent);
+ case RESOURCE_TYPE_EGL_IMAGE:
+ return colorBuffer->glOpImportEglImage(resource, preserveContent);
+#endif
+ // Note: Additional non-EGL resource-types can be added here, and will
+ // be propagated through color-buffer import functionality
+ case RESOURCE_TYPE_VK_EXT_MEMORY_HANDLE:
+ return colorBuffer->importNativeResource(resource, type, preserveContent);
+ default:
+ ERR("Error: unsupported resource type: %u", type);
+ return false;
+ }
+
+ return true;
+}
+
+std::unique_ptr<BorrowedImageInfo> FrameBuffer::borrowColorBufferForComposition(
+ uint32_t colorBufferHandle, bool colorBufferIsTarget) {
+ ColorBufferPtr colorBufferPtr = findColorBuffer(colorBufferHandle);
+ if (!colorBufferPtr) {
+ ERR("Failed to get borrowed image info for ColorBuffer:%d", colorBufferHandle);
+ return nullptr;
+ }
+
+ if (m_useVulkanComposition) {
+ invalidateColorBufferForVk(colorBufferHandle);
+ } else {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ invalidateColorBufferForGl(colorBufferHandle);
+#endif
+ }
+
+ const auto api = m_useVulkanComposition ? ColorBuffer::UsedApi::kVk : ColorBuffer::UsedApi::kGl;
+ return colorBufferPtr->borrowForComposition(api, colorBufferIsTarget);
+}
+
+std::unique_ptr<BorrowedImageInfo> FrameBuffer::borrowColorBufferForDisplay(
+ uint32_t colorBufferHandle) {
+ ColorBufferPtr colorBufferPtr = findColorBuffer(colorBufferHandle);
+ if (!colorBufferPtr) {
+ ERR("Failed to get borrowed image info for ColorBuffer:%d", colorBufferHandle);
+ return nullptr;
+ }
+
+ if (m_useVulkanComposition) {
+ invalidateColorBufferForVk(colorBufferHandle);
+ } else {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ invalidateColorBufferForGl(colorBufferHandle);
+#else
+ ERR("Failed to invalidate ColorBuffer:%d", colorBufferHandle);
+#endif
+ }
+
+ const auto api = m_useVulkanComposition ? ColorBuffer::UsedApi::kVk : ColorBuffer::UsedApi::kGl;
+ return colorBufferPtr->borrowForDisplay(api);
+}
+
+void FrameBuffer::logVulkanOutOfMemory(VkResult result, const char* function, int line,
+ std::optional<uint64_t> allocationSize) {
+ m_logger->logMetricEvent(MetricEventVulkanOutOfMemory{
+ .vkResultCode = result,
+ .function = function,
+ .line = std::make_optional(line),
+ .allocationSize = allocationSize,
+ });
+}
+
+void FrameBuffer::setVsyncHz(int vsyncHz) {
+ const uint64_t kOneSecondNs = 1000000000ULL;
+ m_vsyncHz = vsyncHz;
+ if (m_vsyncThread) {
+ m_vsyncThread->setPeriod(kOneSecondNs / (uint64_t)m_vsyncHz);
+ }
+}
+
+void FrameBuffer::scheduleVsyncTask(VsyncThread::VsyncTask task) {
+ if (!m_vsyncThread) {
+ fprintf(stderr, "%s: warning: no vsync thread exists\n", __func__);
+ task(0);
+ return;
+ }
+
+ m_vsyncThread->schedule(task);
+}
+
+void FrameBuffer::setDisplayConfigs(int configId, int w, int h, int dpiX, int dpiY) {
+ AutoLock mutex(m_lock);
+ mDisplayConfigs[configId] = {w, h, dpiX, dpiY};
+ INFO("setDisplayConfigs w %d h %d dpiX %d dpiY %d", w, h, dpiX, dpiY);
+}
+
+void FrameBuffer::setDisplayActiveConfig(int configId) {
+ AutoLock mutex(m_lock);
+ if (mDisplayConfigs.find(configId) == mDisplayConfigs.end()) {
+ ERR("config %d not set", configId);
+ return;
+ }
+ mDisplayActiveConfigId = configId;
+ m_framebufferWidth = mDisplayConfigs[configId].w;
+ m_framebufferHeight = mDisplayConfigs[configId].h;
+ setDisplayPose(0, 0, 0, getWidth(), getHeight(), 0);
+ INFO("setDisplayActiveConfig %d", configId);
+}
+
+const int FrameBuffer::getDisplayConfigsCount() {
+ AutoLock mutex(m_lock);
+ return mDisplayConfigs.size();
+}
+
+const int FrameBuffer::getDisplayConfigsParam(int configId, EGLint param) {
+ AutoLock mutex(m_lock);
+ if (mDisplayConfigs.find(configId) == mDisplayConfigs.end()) {
+ return -1;
+ }
+ switch (param) {
+ case FB_WIDTH:
+ return mDisplayConfigs[configId].w;
+ case FB_HEIGHT:
+ return mDisplayConfigs[configId].h;
+ case FB_XDPI:
+ return mDisplayConfigs[configId].dpiX;
+ case FB_YDPI:
+ return mDisplayConfigs[configId].dpiY;
+ case FB_FPS:
+ return 60;
+ case FB_MIN_SWAP_INTERVAL:
+ return -1;
+ case FB_MAX_SWAP_INTERVAL:
+ return -1;
+ default:
+ return -1;
+ }
+}
+
+const int FrameBuffer::getDisplayActiveConfig() {
+ AutoLock mutex(m_lock);
+ return mDisplayActiveConfigId >= 0 ? mDisplayActiveConfigId : -1;
+}
+
+bool FrameBuffer::flushColorBufferFromVk(HandleType colorBufferHandle) {
+ auto colorBuffer = findColorBuffer(colorBufferHandle);
+ if (!colorBuffer) {
+ ERR("Failed to find ColorBuffer:%d", colorBufferHandle);
+ return false;
+ }
+ return colorBuffer->flushFromVk();
+}
+
+bool FrameBuffer::flushColorBufferFromVkBytes(HandleType colorBufferHandle, const void* bytes,
+ size_t bytesSize) {
+ AutoLock mutex(m_lock);
+
+ auto colorBuffer = findColorBuffer(colorBufferHandle);
+ if (!colorBuffer) {
+ ERR("Failed to find ColorBuffer:%d", colorBufferHandle);
+ return false;
+ }
+ return colorBuffer->flushFromVkBytes(bytes, bytesSize);
+}
+
+bool FrameBuffer::invalidateColorBufferForVk(HandleType colorBufferHandle) {
+ // It reads contents from GL, which requires a context lock.
+ // Also we should not do this in PostWorkerGl, otherwise it will deadlock.
+ //
+ // b/283524158
+ // b/273986739
+ AutoLock mutex(m_lock);
+ auto colorBuffer = findColorBuffer(colorBufferHandle);
+ if (!colorBuffer) {
+ ERR("Failed to find ColorBuffer:%d", colorBufferHandle);
+ return false;
+ }
+ return colorBuffer->invalidateForVk();
+}
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+HandleType FrameBuffer::getEmulatedEglWindowSurfaceColorBufferHandle(HandleType p_surface) {
+ AutoLock mutex(m_lock);
+
+ auto it = m_EmulatedEglWindowSurfaceToColorBuffer.find(p_surface);
+ if (it == m_EmulatedEglWindowSurfaceToColorBuffer.end()) {
+ return 0;
+ }
+
+ return it->second;
+}
+
+void FrameBuffer::createTrivialContext(HandleType shared, HandleType* contextOut,
+ HandleType* surfOut) {
+ assert(contextOut);
+ assert(surfOut);
+
+ *contextOut = createEmulatedEglContext(0, shared, GLESApi_2);
+ // Zero size is formally allowed here, but SwiftShader doesn't like it and
+ // fails.
+ *surfOut = createEmulatedEglWindowSurface(0, 1, 1);
+}
+
+void FrameBuffer::createSharedTrivialContext(EGLContext* contextOut, EGLSurface* surfOut) {
+ assert(contextOut);
+ assert(surfOut);
+
+ const EmulatedEglConfig* config = getConfigs()->get(0 /* p_config */);
+ if (!config) return;
+
+ int maj, min;
+ emugl::getGlesVersion(&maj, &min);
+
+ const EGLint contextAttribs[] = {EGL_CONTEXT_MAJOR_VERSION_KHR, maj,
+ EGL_CONTEXT_MINOR_VERSION_KHR, min, EGL_NONE};
+
+ *contextOut = s_egl.eglCreateContext(getDisplay(), config->getHostEglConfig(),
+ getGlobalEGLContext(), contextAttribs);
+
+ const EGLint pbufAttribs[] = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE};
+
+ *surfOut = s_egl.eglCreatePbufferSurface(getDisplay(), config->getHostEglConfig(), pbufAttribs);
+}
+
+void FrameBuffer::destroySharedTrivialContext(EGLContext context, EGLSurface surface) {
+ if (getDisplay() != EGL_NO_DISPLAY) {
+ s_egl.eglDestroyContext(getDisplay(), context);
+ s_egl.eglDestroySurface(getDisplay(), surface);
+ }
+}
+
+const EmulatedEglConfigList* FrameBuffer::getConfigs() const {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+
+ return &m_emulationGl->getEmulationEglConfigs();
+}
+
+bool FrameBuffer::setEmulatedEglWindowSurfaceColorBuffer(HandleType p_surface,
+ HandleType p_colorbuffer) {
+ AutoLock mutex(m_lock);
+
+ EmulatedEglWindowSurfaceMap::iterator w(m_windows.find(p_surface));
+ if (w == m_windows.end()) {
+ // bad surface handle
+ ERR("bad window surface handle %#x", p_surface);
+ return false;
+ }
+
+ {
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+ ColorBufferMap::iterator c(m_colorbuffers.find(p_colorbuffer));
+ if (c == m_colorbuffers.end()) {
+ ERR("bad color buffer handle %#x", p_colorbuffer);
+ // bad colorbuffer handle
+ return false;
+ }
+
+ (*w).second.first->setColorBuffer((*c).second.cb);
+ markOpened(&c->second);
+ if (!m_guestManagedColorBufferLifetime) {
+ c->second.refcount++;
+ }
+ }
+ if (w->second.second) {
+ if (!m_guestManagedColorBufferLifetime) {
+ if (m_refCountPipeEnabled) {
+ decColorBufferRefCountLocked(w->second.second);
+ } else {
+ closeColorBufferLocked(w->second.second);
+ }
+ }
+ }
+
+ (*w).second.second = p_colorbuffer;
+
+ m_EmulatedEglWindowSurfaceToColorBuffer[p_surface] = p_colorbuffer;
+
+ return true;
+}
+
+HandleType FrameBuffer::createEmulatedEglContext(int config, HandleType shareContextHandle,
+ GLESApi version) {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation unavailable.";
+ }
+
+ AutoLock mutex(m_lock);
+ android::base::AutoWriteLock contextLock(m_contextStructureLock);
+ // Hold the ColorBuffer map lock so that the new handle won't collide with a ColorBuffer handle.
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+
+ EmulatedEglContextPtr shareContext = nullptr;
+ if (shareContextHandle != 0) {
+ auto shareContextIt = m_contexts.find(shareContextHandle);
+ if (shareContextIt == m_contexts.end()) {
+ ERR("Failed to find share EmulatedEglContext:%d", shareContextHandle);
+ return 0;
+ }
+ shareContext = shareContextIt->second;
+ }
+
+ HandleType contextHandle = genHandle_locked();
+ auto context =
+ m_emulationGl->createEmulatedEglContext(config, shareContext.get(), version, contextHandle);
+ if (!context) {
+ ERR("Failed to create EmulatedEglContext.");
+ return 0;
+ }
+
+ m_contexts[contextHandle] = std::move(context);
+
+ RenderThreadInfo* tinfo = RenderThreadInfo::get();
+ uint64_t puid = tinfo->m_puid;
+ // The new emulator manages render contexts per guest process.
+ // Fall back to per-thread management if the system image does not
+ // support it.
+ if (puid) {
+ m_procOwnedEmulatedEglContexts[puid].insert(contextHandle);
+ } else { // legacy path to manage context lifetime by threads
+ if (!tinfo->m_glInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Render thread GL not available.";
+ }
+ tinfo->m_glInfo->m_contextSet.insert(contextHandle);
+ }
+
+ return contextHandle;
+}
+
+void FrameBuffer::destroyEmulatedEglContext(HandleType contextHandle) {
+ AutoLock mutex(m_lock);
+ sweepColorBuffersLocked();
+
+ android::base::AutoWriteLock contextLock(m_contextStructureLock);
+ m_contexts.erase(contextHandle);
+ RenderThreadInfo* tinfo = RenderThreadInfo::get();
+ uint64_t puid = tinfo->m_puid;
+ // The new emulator manages render contexts per guest process.
+ // Fall back to per-thread management if the system image does not
+ // support it.
+ if (puid) {
+ auto it = m_procOwnedEmulatedEglContexts.find(puid);
+ if (it != m_procOwnedEmulatedEglContexts.end()) {
+ it->second.erase(contextHandle);
+ }
+ } else {
+ if (!tinfo->m_glInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Render thread GL not available.";
+ }
+ tinfo->m_glInfo->m_contextSet.erase(contextHandle);
+ }
+}
+
+HandleType FrameBuffer::createEmulatedEglWindowSurface(int p_config, int p_width, int p_height) {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation unavailable.";
+ }
+
+ AutoLock mutex(m_lock);
+ // Hold the ColorBuffer map lock so that the new handle won't collide with a ColorBuffer handle.
+ AutoLock colorBufferMapLock(m_colorBufferMapLock);
+
+ HandleType handle = genHandle_locked();
+
+ auto window =
+ m_emulationGl->createEmulatedEglWindowSurface(p_config, p_width, p_height, handle);
+ if (!window) {
+ ERR("Failed to create EmulatedEglWindowSurface.");
+ return 0;
+ }
+
+ m_windows[handle] = {std::move(window), 0};
+
+ RenderThreadInfo* info = RenderThreadInfo::get();
+ if (!info->m_glInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "RRenderThreadInfoGl not available.";
+ }
+
+ uint64_t puid = info->m_puid;
+ if (puid) {
+ m_procOwnedEmulatedEglWindowSurfaces[puid].insert(handle);
+ } else { // legacy path to manage window surface lifetime by threads
+ info->m_glInfo->m_windowSet.insert(handle);
+ }
+
+ return handle;
+}
+
+void FrameBuffer::destroyEmulatedEglWindowSurface(HandleType p_surface) {
+ if (m_shuttingDown) {
+ return;
+ }
+ AutoLock mutex(m_lock);
+ destroyEmulatedEglWindowSurfaceLocked(p_surface);
+}
+
+std::vector<HandleType> FrameBuffer::destroyEmulatedEglWindowSurfaceLocked(HandleType p_surface) {
+ std::vector<HandleType> colorBuffersToCleanUp;
+ const auto w = m_windows.find(p_surface);
+ if (w != m_windows.end()) {
+ RecursiveScopedContextBind bind(getPbufferSurfaceContextHelper());
+ if (!m_guestManagedColorBufferLifetime) {
+ if (m_refCountPipeEnabled) {
+ if (decColorBufferRefCountLocked(w->second.second)) {
+ colorBuffersToCleanUp.push_back(w->second.second);
+ }
+ } else {
+ if (closeColorBufferLocked(w->second.second)) {
+ colorBuffersToCleanUp.push_back(w->second.second);
+ }
+ }
+ }
+ m_windows.erase(w);
+ RenderThreadInfo* tinfo = RenderThreadInfo::get();
+ uint64_t puid = tinfo->m_puid;
+ if (puid) {
+ auto ite = m_procOwnedEmulatedEglWindowSurfaces.find(puid);
+ if (ite != m_procOwnedEmulatedEglWindowSurfaces.end()) {
+ ite->second.erase(p_surface);
+ }
+ } else {
+ if (!tinfo->m_glInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Render thread GL not available.";
+ }
+ tinfo->m_glInfo->m_windowSet.erase(p_surface);
+ }
+ }
+ return colorBuffersToCleanUp;
+}
+
+void FrameBuffer::createEmulatedEglFenceSync(EGLenum type, int destroyWhenSignaled,
+ uint64_t* outSync, uint64_t* outSyncThread) {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "GL/EGL emulation not available.";
+ }
+
+ // TODO(b/233939967): move RenderThreadInfoGl usage to EmulationGl.
+ RenderThreadInfoGl* const info = RenderThreadInfoGl::get();
+ if (!info) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "RenderThreadInfoGl not available.";
+ }
+ if (!info->currContext) {
+ auto fb = FrameBuffer::getFB();
+ uint32_t syncContext;
+ uint32_t syncSurface;
+ createTrivialContext(0, // There is no context to share.
+ &syncContext, &syncSurface);
+ bindContext(syncContext, syncSurface, syncSurface);
+ // This context is then cleaned up when the render thread exits.
+ }
+
+ auto sync = m_emulationGl->createEmulatedEglFenceSync(type, destroyWhenSignaled);
+ if (!sync) {
+ return;
+ }
+
+ if (outSync) {
+ *outSync = (uint64_t)(uintptr_t)sync.release();
+ }
+ if (outSyncThread) {
+ *outSyncThread = reinterpret_cast<uint64_t>(SyncThread::get());
+ }
+}
+
+void FrameBuffer::drainGlRenderThreadResources() {
+ // If we're already exiting then snapshot should not contain
+ // this thread information at all.
+ if (isShuttingDown()) {
+ return;
+ }
+
+ // Release references to the current thread's context/surfaces if any
+ bindContext(0, 0, 0);
+
+ drainGlRenderThreadSurfaces();
+ drainGlRenderThreadContexts();
+
+ if (!s_egl.eglReleaseThread()) {
+ ERR("Error: RenderThread @%p failed to eglReleaseThread()", this);
+ }
+}
+
+void FrameBuffer::drainGlRenderThreadContexts() {
+ if (isShuttingDown()) {
+ return;
+ }
+
+ RenderThreadInfoGl* const tinfo = RenderThreadInfoGl::get();
+ if (!tinfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Render thread GL not available.";
+ }
+
+ if (tinfo->m_contextSet.empty()) {
+ return;
+ }
+
+ AutoLock mutex(m_lock);
+ android::base::AutoWriteLock contextLock(m_contextStructureLock);
+ for (const HandleType contextHandle : tinfo->m_contextSet) {
+ m_contexts.erase(contextHandle);
+ }
+ tinfo->m_contextSet.clear();
+}
+
+void FrameBuffer::drainGlRenderThreadSurfaces() {
+ if (isShuttingDown()) {
+ return;
+ }
+
+ RenderThreadInfoGl* const tinfo = RenderThreadInfoGl::get();
+ if (!tinfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Render thread GL not available.";
+ }
+
+ if (tinfo->m_windowSet.empty()) {
+ return;
+ }
+
+ std::vector<HandleType> colorBuffersToCleanup;
+
+ AutoLock mutex(m_lock);
+ RecursiveScopedContextBind bind(getPbufferSurfaceContextHelper());
+ for (const HandleType winHandle : tinfo->m_windowSet) {
+ const auto winIt = m_windows.find(winHandle);
+ if (winIt != m_windows.end()) {
+ if (const HandleType oldColorBufferHandle = winIt->second.second) {
+ if (!m_guestManagedColorBufferLifetime) {
+ if (m_refCountPipeEnabled) {
+ if (decColorBufferRefCountLocked(oldColorBufferHandle)) {
+ colorBuffersToCleanup.push_back(oldColorBufferHandle);
+ }
+ } else {
+ if (closeColorBufferLocked(oldColorBufferHandle)) {
+ colorBuffersToCleanup.push_back(oldColorBufferHandle);
+ }
+ }
+ }
+ m_windows.erase(winIt);
+ }
+ }
+ }
+ tinfo->m_windowSet.clear();
+}
+
+EmulationGl& FrameBuffer::getEmulationGl() {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "GL/EGL emulation not enabled.";
+ }
+ return *m_emulationGl;
+}
+
+EGLDisplay FrameBuffer::getDisplay() const {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+ return m_emulationGl->mEglDisplay;
+}
+
+EGLSurface FrameBuffer::getWindowSurface() const {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+
+ if (!m_emulationGl->mWindowSurface) {
+ return EGL_NO_SURFACE;
+ }
+
+ const auto* displaySurfaceGl =
+ reinterpret_cast<const DisplaySurfaceGl*>(m_emulationGl->mWindowSurface->getImpl());
+
+ return displaySurfaceGl->getSurface();
+}
+
+EGLContext FrameBuffer::getContext() const {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+ return m_emulationGl->mEglContext;
+}
+
+EGLContext FrameBuffer::getConfig() const {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+ return m_emulationGl->mEglConfig;
+}
+
+EGLContext FrameBuffer::getGlobalEGLContext() const {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+
+ if (!m_emulationGl->mPbufferSurface) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "FrameBuffer pbuffer surface not available.";
+ }
+
+ const auto* displaySurfaceGl =
+ reinterpret_cast<const DisplaySurfaceGl*>(m_emulationGl->mPbufferSurface->getImpl());
+
+ return displaySurfaceGl->getContextForShareContext();
+}
+
+EmulatedEglContextPtr FrameBuffer::getContext_locked(HandleType p_context) {
+ return android::base::findOrDefault(m_contexts, p_context);
+}
+
+EmulatedEglWindowSurfacePtr FrameBuffer::getWindowSurface_locked(HandleType p_windowsurface) {
+ return android::base::findOrDefault(m_windows, p_windowsurface).first;
+}
+
+TextureDraw* FrameBuffer::getTextureDraw() const {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+
+ return m_emulationGl->mTextureDraw.get();
+}
+
+bool FrameBuffer::isFastBlitSupported() const {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+
+ return m_emulationGl->isFastBlitSupported();
+}
+
+void FrameBuffer::disableFastBlitForTesting() {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+
+ m_emulationGl->disableFastBlitForTesting();
+}
+
+HandleType FrameBuffer::createEmulatedEglImage(HandleType contextHandle, EGLenum target,
+ GLuint buffer) {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "GL/EGL emulation not enabled.";
+ }
+
+ AutoLock mutex(m_lock);
+
+ EmulatedEglContext* context = nullptr;
+ if (contextHandle) {
+ android::base::AutoWriteLock contextLock(m_contextStructureLock);
+
+ auto it = m_contexts.find(contextHandle);
+ if (it == m_contexts.end()) {
+ ERR("Failed to find EmulatedEglContext:%d", contextHandle);
+ return false;
+ }
+
+ context = it->second.get();
+ }
+
+ auto image = m_emulationGl->createEmulatedEglImage(context, target,
+ reinterpret_cast<EGLClientBuffer>(buffer));
+ if (!image) {
+ ERR("Failed to create EmulatedEglImage");
+ return false;
+ }
+
+ HandleType imageHandle = image->getHandle();
+
+ m_images[imageHandle] = std::move(image);
+
+ RenderThreadInfo* tInfo = RenderThreadInfo::get();
+ uint64_t puid = tInfo->m_puid;
+ if (puid) {
+ m_procOwnedEmulatedEglImages[puid].insert(imageHandle);
+ }
+ return imageHandle;
+}
+
+EGLBoolean FrameBuffer::destroyEmulatedEglImage(HandleType imageHandle) {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "GL/EGL emulation not enabled.";
+ }
+
+ AutoLock mutex(m_lock);
+
+ auto imageIt = m_images.find(imageHandle);
+ if (imageIt == m_images.end()) {
+ ERR("Failed to find EmulatedEglImage:%d", imageHandle);
+ return false;
+ }
+ auto& image = imageIt->second;
+
+ EGLBoolean success = image->destroy();
+ m_images.erase(imageIt);
+
+ RenderThreadInfo* tInfo = RenderThreadInfo::get();
+ uint64_t puid = tInfo->m_puid;
+ if (puid) {
+ m_procOwnedEmulatedEglImages[puid].erase(imageHandle);
+ // We don't explicitly call m_procOwnedEmulatedEglImages.erase(puid) when the
+ // size reaches 0, since it could go between zero and one many times in
+ // the lifetime of a process. It will be cleaned up by
+ // cleanupProcGLObjects(puid) when the process is dead.
+ }
+ return success;
+}
+
+bool FrameBuffer::flushEmulatedEglWindowSurfaceColorBuffer(HandleType p_surface) {
+ AutoLock mutex(m_lock);
+
+ auto it = m_windows.find(p_surface);
+ if (it == m_windows.end()) {
+ ERR("FB::flushEmulatedEglWindowSurfaceColorBuffer: window handle %#x not found", p_surface);
+ // bad surface handle
+ return false;
+ }
+
+ EmulatedEglWindowSurface* surface = it->second.first.get();
+ surface->flushColorBuffer();
+
+ return true;
+}
+
+GLESDispatchMaxVersion FrameBuffer::getMaxGLESVersion() {
+ if (!m_emulationGl) {
+ return GLES_DISPATCH_MAX_VERSION_2;
+ }
+ return m_emulationGl->getGlesMaxDispatchVersion();
+}
+
+void FrameBuffer::fillGLESUsages(android_studio::EmulatorGLESUsages* usages) {
+ if (s_egl.eglFillUsages) {
+ s_egl.eglFillUsages(usages);
+ }
+}
+
+void* FrameBuffer::platformCreateSharedEglContext(void) {
+ AutoLock lock(m_lock);
+
+ EGLContext context = 0;
+ EGLSurface surface = 0;
+ createSharedTrivialContext(&context, &surface);
+
+ void* underlyingContext = s_egl.eglGetNativeContextANDROID(getDisplay(), context);
+ if (!underlyingContext) {
+ ERR("Error: Underlying egl backend could not produce a native EGL context.");
+ return nullptr;
+ }
+
+ m_platformEglContexts[underlyingContext] = {context, surface};
+
+#if defined(__QNX__)
+ EGLDisplay currDisplay = eglGetCurrentDisplay();
+ EGLSurface currRead = eglGetCurrentSurface(EGL_READ);
+ EGLSurface currDraw = eglGetCurrentSurface(EGL_DRAW);
+ EGLSurface currContext = eglGetCurrentContext();
+ // Make this context current to ensure thread-state is initialized
+ s_egl.eglMakeCurrent(getDisplay(), surface, surface, context);
+ // Revert back to original state
+ s_egl.eglMakeCurrent(currDisplay, currRead, currDraw, currContext);
+#endif
+
+ return underlyingContext;
+}
+
+bool FrameBuffer::platformDestroySharedEglContext(void* underlyingContext) {
+ AutoLock lock(m_lock);
+
+ auto it = m_platformEglContexts.find(underlyingContext);
+ if (it == m_platformEglContexts.end()) {
+ ERR("Error: Could not find underlying egl context %p (perhaps already destroyed?)",
+ underlyingContext);
+ return false;
+ }
+
+ destroySharedTrivialContext(it->second.context, it->second.surface);
+
+ m_platformEglContexts.erase(it);
+
+ return true;
+}
+
+bool FrameBuffer::flushColorBufferFromGl(HandleType colorBufferHandle) {
+ auto colorBuffer = findColorBuffer(colorBufferHandle);
+ if (!colorBuffer) {
+ ERR("Failed to find ColorBuffer:%d", colorBufferHandle);
+ return false;
+ }
+ return colorBuffer->flushFromGl();
+}
+
+bool FrameBuffer::invalidateColorBufferForGl(HandleType colorBufferHandle) {
+ auto colorBuffer = findColorBuffer(colorBufferHandle);
+ if (!colorBuffer) {
+ ERR("Failed to find ColorBuffer:%d", colorBufferHandle);
+ return false;
+ }
+ return colorBuffer->invalidateForGl();
+}
+
+ContextHelper* FrameBuffer::getPbufferSurfaceContextHelper() const {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+ if (!m_emulationGl->mPbufferSurface) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "EGL emulation pbuffer surface not available.";
+ }
+ const auto* displaySurfaceGl =
+ reinterpret_cast<const DisplaySurfaceGl*>(m_emulationGl->mPbufferSurface->getImpl());
+
+ return displaySurfaceGl->getContextHelper();
+}
+
+bool FrameBuffer::bindColorBufferToTexture(HandleType p_colorbuffer) {
+ AutoLock mutex(m_lock);
+
+ ColorBufferPtr colorBuffer = findColorBuffer(p_colorbuffer);
+ if (!colorBuffer) {
+ // bad colorbuffer handle
+ return false;
+ }
+
+ return colorBuffer->glOpBindToTexture();
+}
+
+bool FrameBuffer::bindColorBufferToTexture2(HandleType p_colorbuffer) {
+ // This is only called when using multi window display
+ // It will deadlock when posting from main thread.
+ std::unique_ptr<AutoLock> mutex;
+ if (!postOnlyOnMainThread()) {
+ mutex = std::make_unique<AutoLock>(m_lock);
+ }
+
+ ColorBufferPtr colorBuffer = findColorBuffer(p_colorbuffer);
+ if (!colorBuffer) {
+ // bad colorbuffer handle
+ return false;
+ }
+
+ return colorBuffer->glOpBindToTexture2();
+}
+
+bool FrameBuffer::bindColorBufferToRenderbuffer(HandleType p_colorbuffer) {
+ AutoLock mutex(m_lock);
+
+ ColorBufferPtr colorBuffer = findColorBuffer(p_colorbuffer);
+ if (!colorBuffer) {
+ // bad colorbuffer handle
+ return false;
+ }
+
+ return colorBuffer->glOpBindToRenderbuffer();
+}
+
+bool FrameBuffer::bindContext(HandleType p_context, HandleType p_drawSurface,
+ HandleType p_readSurface) {
+ if (m_shuttingDown) {
+ return false;
+ }
+
+ AutoLock mutex(m_lock);
+
+ EmulatedEglWindowSurfacePtr draw, read;
+ EmulatedEglContextPtr ctx;
+
+ //
+ // if this is not an unbind operation - make sure all handles are good
+ //
+ if (p_context || p_drawSurface || p_readSurface) {
+ ctx = getContext_locked(p_context);
+ if (!ctx) return false;
+ EmulatedEglWindowSurfaceMap::iterator w(m_windows.find(p_drawSurface));
+ if (w == m_windows.end()) {
+ // bad surface handle
+ return false;
+ }
+ draw = (*w).second.first;
+
+ if (p_readSurface != p_drawSurface) {
+ EmulatedEglWindowSurfaceMap::iterator w(m_windows.find(p_readSurface));
+ if (w == m_windows.end()) {
+ // bad surface handle
+ return false;
+ }
+ read = (*w).second.first;
+ } else {
+ read = draw;
+ }
+ } else {
+ // if unbind operation, sweep color buffers
+ sweepColorBuffersLocked();
+ }
+
+ if (!s_egl.eglMakeCurrent(getDisplay(), draw ? draw->getEGLSurface() : EGL_NO_SURFACE,
+ read ? read->getEGLSurface() : EGL_NO_SURFACE,
+ ctx ? ctx->getEGLContext() : EGL_NO_CONTEXT)) {
+ ERR("eglMakeCurrent failed");
+ return false;
+ }
+
+ //
+ // Bind the surface(s) to the context
+ //
+ RenderThreadInfoGl* const tinfo = RenderThreadInfoGl::get();
+ if (!tinfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Render thread GL not available.";
+ }
+
+ EmulatedEglWindowSurfacePtr bindDraw, bindRead;
+ if (draw.get() == NULL && read.get() == NULL) {
+ // Unbind the current read and draw surfaces from the context
+ bindDraw = tinfo->currDrawSurf;
+ bindRead = tinfo->currReadSurf;
+ } else {
+ bindDraw = draw;
+ bindRead = read;
+ }
+
+ if (bindDraw.get() != NULL && bindRead.get() != NULL) {
+ if (bindDraw.get() != bindRead.get()) {
+ bindDraw->bind(ctx, EmulatedEglWindowSurface::BIND_DRAW);
+ bindRead->bind(ctx, EmulatedEglWindowSurface::BIND_READ);
+ } else {
+ bindDraw->bind(ctx, EmulatedEglWindowSurface::BIND_READDRAW);
+ }
+ }
+
+ //
+ // update thread info with current bound context
+ //
+ tinfo->currContext = ctx;
+ tinfo->currDrawSurf = draw;
+ tinfo->currReadSurf = read;
+ if (ctx) {
+ if (ctx->clientVersion() > GLESApi_CM)
+ tinfo->m_gl2Dec.setContextData(&ctx->decoderContextData());
+ else
+ tinfo->m_glDec.setContextData(&ctx->decoderContextData());
+ } else {
+ tinfo->m_glDec.setContextData(NULL);
+ tinfo->m_gl2Dec.setContextData(NULL);
+ }
+ return true;
+}
+
+void FrameBuffer::createYUVTextures(uint32_t type, uint32_t count, int width, int height,
+ uint32_t* output) {
+ FrameworkFormat format = static_cast<FrameworkFormat>(type);
+ AutoLock mutex(m_lock);
+ RecursiveScopedContextBind bind(getPbufferSurfaceContextHelper());
+ for (uint32_t i = 0; i < count; ++i) {
+ if (format == FRAMEWORK_FORMAT_NV12) {
+ YUVConverter::createYUVGLTex(GL_TEXTURE0, width, height, format, YUVPlane::Y,
+ &output[2 * i]);
+ YUVConverter::createYUVGLTex(GL_TEXTURE1, width / 2, height / 2, format, YUVPlane::UV,
+ &output[2 * i + 1]);
+ } else if (format == FRAMEWORK_FORMAT_YUV_420_888) {
+ YUVConverter::createYUVGLTex(GL_TEXTURE0, width, height, format, YUVPlane::Y,
+ &output[3 * i]);
+ YUVConverter::createYUVGLTex(GL_TEXTURE1, width / 2, height / 2, format, YUVPlane::U,
+ &output[3 * i + 1]);
+ YUVConverter::createYUVGLTex(GL_TEXTURE2, width / 2, height / 2, format, YUVPlane::V,
+ &output[3 * i + 2]);
+ }
+ }
+}
+
+void FrameBuffer::destroyYUVTextures(uint32_t type, uint32_t count, uint32_t* textures) {
+ AutoLock mutex(m_lock);
+ RecursiveScopedContextBind bind(getPbufferSurfaceContextHelper());
+ if (type == FRAMEWORK_FORMAT_NV12) {
+ s_gles2.glDeleteTextures(2 * count, textures);
+ } else if (type == FRAMEWORK_FORMAT_YUV_420_888) {
+ s_gles2.glDeleteTextures(3 * count, textures);
+ }
+}
+
+void FrameBuffer::updateYUVTextures(uint32_t type, uint32_t* textures, void* privData, void* func) {
+ AutoLock mutex(m_lock);
+ RecursiveScopedContextBind bind(getPbufferSurfaceContextHelper());
+
+ yuv_updater_t updater = (yuv_updater_t)func;
+ uint32_t gtextures[3] = {0, 0, 0};
+
+ if (type == FRAMEWORK_FORMAT_NV12) {
+ gtextures[0] = s_gles2.glGetGlobalTexName(textures[0]);
+ gtextures[1] = s_gles2.glGetGlobalTexName(textures[1]);
+ } else if (type == FRAMEWORK_FORMAT_YUV_420_888) {
+ gtextures[0] = s_gles2.glGetGlobalTexName(textures[0]);
+ gtextures[1] = s_gles2.glGetGlobalTexName(textures[1]);
+ gtextures[2] = s_gles2.glGetGlobalTexName(textures[2]);
+ }
+
+#ifdef __APPLE__
+ EGLContext prevContext = s_egl.eglGetCurrentContext();
+ auto mydisp = EglGlobalInfo::getInstance()->getDisplayFromDisplayType(EGL_DEFAULT_DISPLAY);
+ void* nativecontext = mydisp->getLowLevelContext(prevContext);
+ struct MediaNativeCallerData callerdata;
+ callerdata.ctx = nativecontext;
+ callerdata.converter = nsConvertVideoFrameToNV12Textures;
+ void* pcallerdata = &callerdata;
+#else
+ void* pcallerdata = nullptr;
+#endif
+
+ updater(privData, type, gtextures, pcallerdata);
+}
+
+void FrameBuffer::swapTexturesAndUpdateColorBuffer(uint32_t p_colorbuffer, int x, int y, int width,
+ int height, uint32_t format, uint32_t type,
+ uint32_t texture_type, uint32_t* textures) {
+ {
+ AutoLock mutex(m_lock);
+ ColorBufferPtr colorBuffer = findColorBuffer(p_colorbuffer);
+ if (!colorBuffer) {
+ // bad colorbuffer handle
+ return;
+ }
+ colorBuffer->glOpSwapYuvTexturesAndUpdate(
+ format, type, static_cast<FrameworkFormat>(texture_type), textures);
+ }
+}
+
+bool FrameBuffer::readColorBufferContents(HandleType p_colorbuffer, size_t* numBytes,
+ void* pixels) {
+ AutoLock mutex(m_lock);
+
+ ColorBufferPtr colorBuffer = findColorBuffer(p_colorbuffer);
+ if (!colorBuffer) {
+ // bad colorbuffer handle
+ return false;
+ }
+
+ return colorBuffer->glOpReadContents(numBytes, pixels);
+}
+
+void FrameBuffer::waitForGpu(uint64_t eglsync) {
+ EmulatedEglFenceSync* fenceSync = EmulatedEglFenceSync::getFromHandle(eglsync);
+
+ if (!fenceSync) {
+ ERR("err: fence sync 0x%llx not found", (unsigned long long)eglsync);
+ return;
+ }
+
+ SyncThread::get()->triggerBlockedWaitNoTimeline(fenceSync);
+}
+
+void FrameBuffer::asyncWaitForGpuWithCb(uint64_t eglsync, FenceCompletionCallback cb) {
+ EmulatedEglFenceSync* fenceSync = EmulatedEglFenceSync::getFromHandle(eglsync);
+
+ if (!fenceSync) {
+ ERR("err: fence sync 0x%llx not found", (unsigned long long)eglsync);
+ return;
+ }
+
+ SyncThread::get()->triggerWaitWithCompletionCallback(fenceSync, std::move(cb));
+}
+
+const gl::GLESv2Dispatch* FrameBuffer::getGles2Dispatch() {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+
+ return m_emulationGl->getGles2Dispatch();
+}
+
+const gl::EGLDispatch* FrameBuffer::getEglDispatch() {
+ if (!m_emulationGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "EGL emulation not enabled.";
+ }
+
+ return m_emulationGl->getEglDispatch();
+}
+
+#endif
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/FrameBuffer.h b/src/gfxstream/host/FrameBuffer.h
new file mode 100644
index 00000000000..d4c413d44dd
--- /dev/null
+++ b/src/gfxstream/host/FrameBuffer.h
@@ -0,0 +1,926 @@
+/*
+ * Copyright (C) 2011-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 _LIBRENDER_FRAMEBUFFER_H
+#define _LIBRENDER_FRAMEBUFFER_H
+
+#include <stdint.h>
+
+#include <array>
+#include <functional>
+#include <map>
+#include <memory>
+#include <optional>
+#include <unordered_map>
+#include <unordered_set>
+
+#include "Buffer.h"
+#include "ColorBuffer.h"
+#include "Compositor.h"
+#include "Display.h"
+#include "DisplaySurface.h"
+#include "Hwc2.h"
+#include "PostCommands.h"
+#include "PostWorker.h"
+#include "ProcessResources.h"
+#include "ReadbackWorker.h"
+#include "VsyncThread.h"
+#include "aemu/base/AsyncResult.h"
+#include "aemu/base/EventNotificationSupport.h"
+#include "aemu/base/HealthMonitor.h"
+#include "aemu/base/ManagedDescriptor.hpp"
+#include "aemu/base/Metrics.h"
+#include "aemu/base/files/Stream.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/synchronization/MessageChannel.h"
+#include "aemu/base/threads/Thread.h"
+#include "aemu/base/threads/WorkerThread.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include "gl/BufferGl.h"
+#include "gl/ColorBufferGl.h"
+#include "gl/CompositorGl.h"
+#include "gl/DisplaySurfaceGl.h"
+#include "gl/EmulatedEglConfig.h"
+#include "gl/EmulatedEglContext.h"
+#include "gl/EmulatedEglImage.h"
+#include "gl/EmulatedEglWindowSurface.h"
+#include "gl/EmulationGl.h"
+#include "gl/GLESVersionDetector.h"
+#include "gl/TextureDraw.h"
+#else
+#include "GlesCompat.h"
+#endif
+
+// 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
+
+#include "render-utils/Renderer.h"
+#include "render-utils/virtio_gpu_ops.h"
+#include "render-utils/render_api.h"
+#include "snapshot/common.h"
+#include "utils/RenderDoc.h"
+#include "vulkan/vk_util.h"
+
+namespace gfxstream {
+namespace vk {
+class DisplayVk;
+} // namespace vk
+} // namespace gfxstream
+
+namespace gfxstream {
+
+using android::base::CreateMetricsLogger;
+using emugl::HealthMonitor;
+using emugl::MetricsLogger;
+
+struct BufferRef {
+ BufferPtr buffer;
+};
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+typedef std::unordered_map<uint64_t, gl::EmulatedEglWindowSurfaceSet>
+ ProcOwnedEmulatedEglWindowSurfaces;
+
+typedef std::unordered_map<uint64_t, gl::EmulatedEglContextSet> ProcOwnedEmulatedEglContexts;
+typedef std::unordered_map<uint64_t, gl::EmulatedEglImageSet> ProcOwnedEmulatedEGLImages;
+#endif
+
+typedef std::unordered_map<uint64_t, ColorBufferSet> ProcOwnedColorBuffers;
+
+typedef std::unordered_map<HandleType, BufferRef> BufferMap;
+typedef std::unordered_multiset<HandleType> BufferSet;
+typedef std::unordered_map<uint64_t, BufferSet> ProcOwnedBuffers;
+
+typedef std::unordered_map<void*, std::function<void()>> CallbackMap;
+typedef std::unordered_map<uint64_t, CallbackMap> ProcOwnedCleanupCallbacks;
+
+// The FrameBuffer class holds the global state of the emulation library on
+// top of the underlying EGL/GLES implementation. It should probably be
+// named "Display" instead of "FrameBuffer".
+//
+// There is only one global instance, that can be retrieved with getFB(),
+// and which must be previously setup by calling initialize().
+//
+class FrameBuffer : public android::base::EventNotificationSupport<FrameBufferChangeEvent> {
+ public:
+ // Initialize the global instance.
+ // |width| and |height| are the dimensions of the emulator GPU display
+ // in pixels. |useSubWindow| is true to indicate that the caller
+ // will use setupSubWindow() to let EmuGL display the GPU content in its
+ // own sub-windows. If false, this means the caller will use
+ // setPostCallback() instead to retrieve the content.
+ // Returns true on success, false otherwise.
+ static bool initialize(int width, int height, bool useSubWindow,
+ bool egl2egl);
+
+ // Finalize the instance.
+ static void finalize();
+
+ // Setup a sub-window to display the content of the emulated GPU
+ // on-top of an existing UI window. |p_window| is the platform-specific
+ // parent window handle. |wx|, |wy|, |ww| and |wh| are the
+ // dimensions in pixels of the sub-window, relative to the parent window's
+ // coordinate. |fbw| and |fbh| are the dimensions used to initialize
+ // the framebuffer, which may be different from the dimensions of the
+ // sub-window (in which case scaling will be applied automatically).
+ // |dpr| is the device pixel ratio of the monitor, which is needed for
+ // proper panning on high-density displays (like retina)
+ // |zRot| is a rotation angle in degrees, (clockwise in the Y-upwards GL
+ // coordinate space).
+ //
+ // If a sub-window already exists, this function updates the subwindow
+ // and framebuffer properties to match the given values.
+ //
+ // Return true on success, false otherwise.
+ //
+ // NOTE: This can return false for software-only EGL engines like OSMesa.
+ bool setupSubWindow(FBNativeWindowType p_window, int wx, int wy, int ww,
+ int wh, int fbw, int fbh, float dpr, float zRot,
+ bool deleteExisting, bool hideWindow);
+
+ // Remove the sub-window created by setupSubWindow(), if any.
+ // Return true on success, false otherwise.
+ bool removeSubWindow();
+
+ // Return a pointer to the global instance. initialize() must be called
+ // previously, or this will return NULL.
+ static FrameBuffer* getFB() { return s_theFrameBuffer; }
+
+ // Wait for a FrameBuffer instance to be initialized and ready to use.
+ // This function blocks the caller until there is a valid initialized
+ // object in getFB() and
+ static void waitUntilInitialized();
+
+ // Return the emulated GPU display width in pixels.
+ int getWidth() const { return m_framebufferWidth; }
+
+ // Return the emulated GPU display height in pixels.
+ int getHeight() const { return m_framebufferHeight; }
+
+ // Set a callback that will be called each time the emulated GPU content
+ // is updated. This can be relatively slow with host-based GPU emulation,
+ // so only do this when you need to.
+ void setPostCallback(Renderer::OnPostCallback onPost, void* onPostContext, uint32_t displayId,
+ bool useBgraReadback = false);
+
+ // Create a new ColorBuffer instance from this display instance.
+ // |p_width| and |p_height| are its dimensions in pixels.
+ // |p_internalFormat| is the OpenGL format of this color buffer.
+ // |p_frameworkFormat| describes the Android frameework format of this
+ // color buffer, if differing from |p_internalFormat|.
+ // See ColorBuffer::create() for
+ // list of valid values. Note that ColorBuffer instances are reference-
+ // counted. Use openColorBuffer / closeColorBuffer to operate on the
+ // internal count.
+ HandleType createColorBuffer(int p_width, int p_height,
+ GLenum p_internalFormat,
+ FrameworkFormat p_frameworkFormat);
+ // Variant of createColorBuffer except with a particular
+ // handle already assigned. This is for use with
+ // virtio-gpu's RESOURCE_CREATE ioctl.
+ void createColorBufferWithHandle(int p_width, int p_height, GLenum p_internalFormat,
+ FrameworkFormat p_frameworkFormat, HandleType handle);
+
+ // Create a new data Buffer instance from this display instance.
+ // The buffer will be backed by a VkBuffer and VkDeviceMemory (if Vulkan
+ // is available).
+ // |size| is the requested size of Buffer in bytes.
+ // |memoryProperty| is the requested memory property bits of the device
+ // memory.
+ HandleType createBuffer(uint64_t size, uint32_t memoryProperty);
+
+ // Variant of createBuffer except with a particular handle already
+ // assigned and using device local memory. This is for use with
+ // virtio-gpu's RESOURCE_CREATE ioctl for BLOB resources.
+ void createBufferWithHandle(uint64_t size, HandleType handle);
+
+ // Increment the reference count associated with a given ColorBuffer
+ // instance. |p_colorbuffer| is its handle value as returned by
+ // createColorBuffer().
+ int openColorBuffer(HandleType p_colorbuffer);
+
+ // Decrement the reference count associated with a given ColorBuffer
+ // instance. |p_colorbuffer| is its handle value as returned by
+ // createColorBuffer(). Note that if the reference count reaches 0,
+ // the instance is destroyed automatically.
+ void closeColorBuffer(HandleType p_colorbuffer);
+
+ // Destroy a Buffer created previously. |p_buffer| is its handle value as
+ // returned by createBuffer().
+ void closeBuffer(HandleType p_colorbuffer);
+
+ // The caller mustn't refer to this puid before this function returns, i.e. the creation of the
+ // host process pipe must be blocked until this function returns.
+ void createGraphicsProcessResources(uint64_t puid);
+ // The process resource is returned so that we can destroy it on a separate thread.
+ std::unique_ptr<ProcessResources> removeGraphicsProcessResources(uint64_t puid);
+ // TODO(kaiyili): retire cleanupProcGLObjects in favor of removeGraphicsProcessResources.
+ void cleanupProcGLObjects(uint64_t puid);
+
+ // Read the content of a given Buffer into client memory.
+ // |p_buffer| is the Buffer's handle value.
+ // |offset| and |size| are the position and size of a slice of the buffer
+ // that will be read.
+ // |bytes| is the address of a caller-provided buffer that will be filled
+ // with the buffer data.
+ void readBuffer(HandleType p_buffer, uint64_t offset, uint64_t size, void* bytes);
+
+ // Read the content of a given ColorBuffer into client memory.
+ // |p_colorbuffer| is the ColorBuffer's handle value. Similar
+ // to glReadPixels(), this can be a slow operation.
+ // |x|, |y|, |width| and |height| are the position and dimensions of
+ // a rectangle whose pixel values will be transfered to the host.
+ // |format| indicates the format of the pixel data, e.g. GL_RGB or GL_RGBA.
+ // |type| is the type of pixel data, e.g. GL_UNSIGNED_BYTE.
+ // |pixels| is the address of a caller-provided buffer that will be filled
+ // with the pixel data.
+ void readColorBuffer(HandleType p_colorbuffer, int x, int y, int width,
+ int height, GLenum format, GLenum type, void* pixels);
+
+ // Read the content of a given YUV420_888 ColorBuffer into client memory.
+ // |p_colorbuffer| is the ColorBuffer's handle value. Similar
+ // to glReadPixels(), this can be a slow operation.
+ // |x|, |y|, |width| and |height| are the position and dimensions of
+ // a rectangle whose pixel values will be transfered to the host.
+ // |pixels| is the address of a caller-provided buffer that will be filled
+ // with the pixel data.
+ // |pixles_size| is the size of buffer
+ void readColorBufferYUV(HandleType p_colorbuffer, int x, int y, int width,
+ int height, void* pixels, uint32_t pixels_size);
+
+ // Update the content of a given Buffer from client data.
+ // |p_buffer| is the Buffer's handle value.
+ // |offset| and |size| are the position and size of a slice of the buffer
+ // that will be updated.
+ // |bytes| is the address of a caller-provided buffer containing the new
+ // buffer data.
+ bool updateBuffer(HandleType p_buffer, uint64_t offset, uint64_t size, void* pixels);
+
+ // Update the content of a given ColorBuffer from client data.
+ // |p_colorbuffer| is the ColorBuffer's handle value. Similar
+ // to glReadPixels(), this can be a slow operation.
+ // |x|, |y|, |width| and |height| are the position and dimensions of
+ // a rectangle whose pixel values will be transfered to the GPU
+ // |format| indicates the format of the OpenGL buffer, e.g. GL_RGB or
+ // GL_RGBA. |frameworkFormat| indicates the format of the pixel data; if
+ // FRAMEWORK_FORMAT_GL_COMPATIBLE, |format| (OpenGL format) is used.
+ // Otherwise, explicit conversion to |format| is needed.
+ // |type| is the type of pixel data, e.g. GL_UNSIGNED_BYTE.
+ // |pixels| is the address of a buffer containing the new pixel data.
+ // Returns true on success, false otherwise.
+ bool updateColorBuffer(HandleType p_colorbuffer, int x, int y, int width,
+ int height, GLenum format, GLenum type,
+ void* pixels);
+ bool updateColorBufferFromFrameworkFormat(HandleType p_colorbuffer, int x, int y, int width,
+ int height, FrameworkFormat fwkFormat, GLenum format,
+ GLenum type, void* pixels, void* metadata = nullptr);
+
+ bool getColorBufferInfo(HandleType p_colorbuffer, int* width, int* height,
+ GLint* internalformat,
+ FrameworkFormat* frameworkFormat = nullptr);
+ bool getBufferInfo(HandleType p_buffer, int* size);
+
+ // Display the content of a given ColorBuffer into the framebuffer's
+ // sub-window. |p_colorbuffer| is a handle value.
+ // |needLockAndBind| is used to indicate whether the operation requires
+ // acquiring/releasing the FrameBuffer instance's lock and binding the
+ // contexts. It should be |false| only when called internally.
+ bool post(HandleType p_colorbuffer, bool needLockAndBind = true);
+ // The callback will always be called; however, the callback may not be called
+ // until after this function has returned. If the callback is deferred, then it
+ // will be dispatched to run on SyncThread.
+ void postWithCallback(HandleType p_colorbuffer, Post::CompletionCallback callback, bool needLockAndBind = true);
+ bool hasGuestPostedAFrame() { return m_guestPostedAFrame; }
+ void resetGuestPostedAFrame() { m_guestPostedAFrame = false; }
+
+ // Runs the post callback with |pixels| (good for when the readback
+ // happens in a separate place)
+ void doPostCallback(void* pixels, uint32_t displayId);
+
+ void getPixels(void* pixels, uint32_t bytes, uint32_t displayId);
+ void flushReadPipeline(int displayId);
+ void ensureReadbackWorker();
+
+ bool asyncReadbackSupported();
+ Renderer::ReadPixelsCallback getReadPixelsCallback();
+ Renderer::FlushReadPixelPipeline getFlushReadPixelPipeline();
+
+ // Re-post the last ColorBuffer that was displayed through post().
+ // This is useful if you detect that the sub-window content needs to
+ // be re-displayed for any reason.
+ bool repost(bool needLockAndBind = true);
+
+ // Change the rotation of the displayed GPU sub-window.
+ void setDisplayRotation(float zRot) {
+ if (zRot != m_zRot) {
+ m_zRot = zRot;
+ repost();
+ }
+ }
+
+ // Changes what coordinate of this framebuffer will be displayed at the
+ // corner of the GPU sub-window. Specifically, |px| and |py| = 0 means
+ // align the bottom-left of the framebuffer with the bottom-left of the
+ // sub-window, and |px| and |py| = 1 means align the top right of the
+ // framebuffer with the top right of the sub-window. Intermediate values
+ // interpolate between these states.
+ void setDisplayTranslation(float px, float py) {
+ // Sanity check the values to ensure they are between 0 and 1
+ const float x = px > 1.f ? 1.f : (px < 0.f ? 0.f : px);
+ const float y = py > 1.f ? 1.f : (py < 0.f ? 0.f : py);
+ if (x != m_px || y != m_py) {
+ m_px = x;
+ m_py = y;
+ repost();
+ }
+ }
+
+ void lockContextStructureRead() { m_contextStructureLock.lockRead(); }
+ void unlockContextStructureRead() { m_contextStructureLock.unlockRead(); }
+
+ // For use with sync threads and otherwise, any time we need a GL context
+ // not specifically for drawing, but to obtain certain things about
+ // GL state.
+ // It can be unsafe / leaky to change the structure of contexts
+ // outside the facilities the FrameBuffer class provides.
+ void createTrivialContext(HandleType shared, HandleType* contextOut, HandleType* surfOut);
+
+ void setShuttingDown() { m_shuttingDown = true; }
+ bool isShuttingDown() const { return m_shuttingDown; }
+ bool compose(uint32_t bufferSize, void* buffer, bool post = true);
+ // When false is returned, the callback won't be called. The callback will
+ // be called on the PostWorker thread without blocking the current thread.
+ AsyncResult composeWithCallback(uint32_t bufferSize, void* buffer,
+ Post::CompletionCallback callback);
+
+ ~FrameBuffer();
+
+ void onSave(android::base::Stream* stream,
+ const android::snapshot::ITextureSaverPtr& textureSaver);
+ bool onLoad(android::base::Stream* stream,
+ const android::snapshot::ITextureLoaderPtr& textureLoader);
+
+ // lock and unlock handles (EmulatedEglContext, ColorBuffer, EmulatedEglWindowSurface)
+ void lock();
+ void unlock();
+
+ float getDpr() const { return m_dpr; }
+ int windowWidth() const { return m_windowWidth; }
+ int windowHeight() const { return m_windowHeight; }
+ float getPx() const { return m_px; }
+ float getPy() const { return m_py; }
+ int getZrot() const { return m_zRot; }
+
+ bool isVulkanInteropSupported() const { return m_vulkanInteropSupported; }
+ bool isVulkanEnabled() const { return m_vulkanEnabled; }
+
+ // Saves a screenshot of the previous frame.
+ // nChannels should be 3 (RGB) or 4 (RGBA).
+ // You must provide a pre-allocated buffer of sufficient
+ // size. Returns 0 on success. In the case of failure and if *cPixels != 0
+ // you can call this function again with a buffer of size *cPixels. cPixels
+ // should usually be at at least desiredWidth * desiredHeight * nChannels.
+ //
+ // In practice the buffer should be > desiredWidth *
+ // desiredHeight * nChannels.
+ //
+ // Note: Do not call this function again if it fails and *cPixels == 0
+ // swiftshader_indirect does not work with 3 channels
+ //
+ // This function supports rectangle snipping by
+ // providing an |rect| parameter. The default value of {{0,0}, {0,0}}
+ // indicates the users wants to snip the entire screen instead of a
+ // partial screen.
+ // - |rect| represents a rectangle within the screen defined by
+ // desiredWidth and desiredHeight.
+ int getScreenshot(unsigned int nChannels, unsigned int* width, unsigned int* height,
+ uint8_t* pixels, size_t* cPixels, int displayId, int desiredWidth,
+ int desiredHeight, int desiredRotation, Rect rect = {{0, 0}, {0, 0}});
+
+ void onLastColorBufferRef(uint32_t handle);
+ ColorBufferPtr findColorBuffer(HandleType p_colorbuffer);
+ BufferPtr findBuffer(HandleType p_buffer);
+
+ void registerProcessCleanupCallback(void* key,
+ std::function<void()> callback);
+ void unregisterProcessCleanupCallback(void* key);
+
+ const ProcessResources* getProcessResources(uint64_t puid);
+
+ int createDisplay(uint32_t *displayId);
+ int createDisplay(uint32_t displayId);
+ int destroyDisplay(uint32_t displayId);
+ int setDisplayColorBuffer(uint32_t displayId, uint32_t colorBuffer);
+ int getDisplayColorBuffer(uint32_t displayId, uint32_t* colorBuffer);
+ int getColorBufferDisplay(uint32_t colorBuffer, uint32_t* displayId);
+ int getDisplayPose(uint32_t displayId, int32_t* x, int32_t* y, uint32_t* w,
+ uint32_t* h);
+ int setDisplayPose(uint32_t displayId, int32_t x, int32_t y, uint32_t w,
+ uint32_t h, uint32_t dpi = 0);
+ void getCombinedDisplaySize(int* w, int* h);
+ struct DisplayInfo {
+ uint32_t cb;
+ int32_t pos_x;
+ int32_t pos_y;
+ uint32_t width;
+ uint32_t height;
+ uint32_t dpi;
+ DisplayInfo()
+ : cb(0), pos_x(0), pos_y(0), width(0), height(0), dpi(0){};
+ DisplayInfo(uint32_t cb, int32_t x, int32_t y, uint32_t w, uint32_t h,
+ uint32_t d)
+ : cb(cb), pos_x(x), pos_y(y), width(w), height(h), dpi(d) {}
+ };
+ // Inline with MultiDisplay::s_invalidIdMultiDisplay
+ static const uint32_t s_invalidIdMultiDisplay = 0xFFFFFFAB;
+ static const uint32_t s_maxNumMultiDisplay = 11;
+
+ HandleType getLastPostedColorBuffer() { return m_lastPostedColorBuffer; }
+ void waitForGpuVulkan(uint64_t deviceHandle, uint64_t fenceHandle);
+ void asyncWaitForGpuVulkanWithCb(uint64_t deviceHandle, uint64_t fenceHandle, FenceCompletionCallback cb);
+ void asyncWaitForGpuVulkanQsriWithCb(uint64_t image, FenceCompletionCallback cb);
+ void waitForGpuVulkanQsri(uint64_t image);
+
+ bool platformImportResource(uint32_t handle, uint32_t info, void* resource);
+
+ void setGuestManagedColorBufferLifetime(bool guestManaged);
+
+ std::unique_ptr<BorrowedImageInfo> borrowColorBufferForComposition(uint32_t colorBufferHandle,
+ bool colorBufferIsTarget);
+ std::unique_ptr<BorrowedImageInfo> borrowColorBufferForDisplay(uint32_t colorBufferHandle);
+
+ HealthMonitor<>* getHealthMonitor() { return m_healthMonitor.get(); }
+
+ emugl::MetricsLogger& getMetricsLogger() {
+ return *m_logger;
+ }
+
+ void logVulkanOutOfMemory(VkResult result, const char* function, int line,
+ std::optional<uint64_t> allocationSize = std::nullopt);
+
+ void setVsyncHz(int vsyncHz);
+ void scheduleVsyncTask(VsyncThread::VsyncTask task);
+ void setDisplayConfigs(int configId, int w, int h, int dpiX, int dpiY);
+ void setDisplayActiveConfig(int configId);
+ const int getDisplayConfigsCount();
+ const int getDisplayConfigsParam(int configId, EGLint param);
+ const int getDisplayActiveConfig();
+
+ bool flushColorBufferFromVk(HandleType colorBufferHandle);
+ bool flushColorBufferFromVkBytes(HandleType colorBufferHandle, const void* bytes,
+ size_t bytesSize);
+ bool invalidateColorBufferForVk(HandleType colorBufferHandle);
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ // Retrieves the color buffer handle associated with |p_surface|.
+ // Returns 0 if there is no such handle.
+ HandleType getEmulatedEglWindowSurfaceColorBufferHandle(HandleType p_surface);
+
+ // createTrivialContext(), but with a m_pbufContext
+ // as shared, and not adding itself to the context map at all.
+ void createSharedTrivialContext(EGLContext* contextOut, EGLSurface* surfOut);
+ void destroySharedTrivialContext(EGLContext context, EGLSurface surf);
+
+ // Attach a ColorBuffer to a EmulatedEglWindowSurface instance.
+ // See the documentation for EmulatedEglWindowSurface::setColorBuffer().
+ // |p_surface| is the target EmulatedEglWindowSurface's handle value.
+ // |p_colorbuffer| is the ColorBuffer handle value.
+ // Returns true on success, false otherwise.
+
+ bool setEmulatedEglWindowSurfaceColorBuffer(HandleType p_surface, HandleType p_colorbuffer);
+ // Return the list of configs available from this display.
+ const gl::EmulatedEglConfigList* getConfigs() const;
+
+ // Retrieve the GL strings of the underlying EGL/GLES implementation.
+ // On return, |*vendor|, |*renderer| and |*version| will point to strings
+ // that are owned by the instance (and must not be freed by the caller).
+ void getGLStrings(const char** vendor, const char** renderer, const char** version) const {
+ *vendor = m_graphicsAdapterVendor.c_str();
+ *renderer = m_graphicsAdapterName.c_str();
+ *version = m_graphicsApiVersion.c_str();
+ }
+
+ // Create a new EmulatedEglContext instance for this display instance.
+ // |p_config| is the index of one of the configs returned by getConfigs().
+ // |p_share| is either EGL_NO_CONTEXT or the handle of a shared context.
+ // |version| specifies the GLES version as a GLESApi enum.
+ // Return a new handle value, which will be 0 in case of error.
+ HandleType createEmulatedEglContext(int p_config, HandleType p_share,
+ gl::GLESApi version = gl::GLESApi_CM);
+
+ // Destroy a given EmulatedEglContext instance. |p_context| is its handle
+ // value as returned by createEmulatedEglContext().
+ void destroyEmulatedEglContext(HandleType p_context);
+
+ // Create a new EmulatedEglWindowSurface instance from this display instance.
+ // |p_config| is the index of one of the configs returned by getConfigs().
+ // |p_width| and |p_height| are the window dimensions in pixels.
+ // Return a new handle value, or 0 in case of error.
+ HandleType createEmulatedEglWindowSurface(int p_config, int p_width, int p_height);
+
+ // Destroy a given EmulatedEglWindowSurface instance. |p_surcace| is its
+ // handle value as returned by createEmulatedEglWindowSurface().
+ void destroyEmulatedEglWindowSurface(HandleType p_surface);
+
+ // Returns the set of ColorBuffers destroyed (for further cleanup)
+ std::vector<HandleType> destroyEmulatedEglWindowSurfaceLocked(HandleType p_surface);
+
+ void createEmulatedEglFenceSync(EGLenum type, int destroyWhenSignaled,
+ uint64_t* outSync = nullptr, uint64_t* outSyncThread = nullptr);
+
+ // Call this function when a render thread terminates to destroy all
+ // resources it created. Necessary to avoid leaking host resources
+ // when a guest application crashes, for example.
+ void drainGlRenderThreadResources();
+
+ // Call this function when a render thread terminates to destroy all
+ // the remaining contexts it created. Necessary to avoid leaking host
+ // contexts when a guest application crashes, for example.
+ void drainGlRenderThreadContexts();
+
+ // Call this function when a render thread terminates to destroy all
+ // remaining window surface it created. Necessary to avoid leaking
+ // host buffers when a guest application crashes, for example.
+ void drainGlRenderThreadSurfaces();
+
+ gl::EmulationGl& getEmulationGl();
+ bool hasEmulationGl() const { return m_emulationGl != nullptr; }
+
+ // Return the host EGLDisplay used by this instance.
+ EGLDisplay getDisplay() const;
+ EGLSurface getWindowSurface() const;
+ EGLContext getContext() const;
+ EGLConfig getConfig() const;
+
+ EGLContext getGlobalEGLContext() const;
+
+ // Return a render context pointer from its handle
+ gl::EmulatedEglContextPtr getContext_locked(HandleType p_context);
+
+ // Return a color buffer pointer from its handle
+ gl::EmulatedEglWindowSurfacePtr getWindowSurface_locked(HandleType p_windowsurface);
+
+ // Return a TextureDraw instance that can be used with this surfaces
+ // and windows created by this instance.
+ gl::TextureDraw* getTextureDraw() const;
+
+ bool isFastBlitSupported() const;
+ void disableFastBlitForTesting();
+
+ // Create an eglImage and return its handle. Reference:
+ // https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_image_base.txt
+ HandleType createEmulatedEglImage(HandleType context, EGLenum target, GLuint buffer);
+ // Call the implementation of eglDestroyImageKHR, return if succeeds or
+ // not. Reference:
+ // https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_image_base.txt
+ EGLBoolean destroyEmulatedEglImage(HandleType image);
+ // Copy the content of a EmulatedEglWindowSurface's Pbuffer to its attached
+ // ColorBuffer. See the documentation for
+ // EmulatedEglWindowSurface::flushColorBuffer().
+ // |p_surface| is the target WindowSurface's handle value.
+ // Returns true on success, false on failure.
+ bool flushEmulatedEglWindowSurfaceColorBuffer(HandleType p_surface);
+
+ gl::GLESDispatchMaxVersion getMaxGLESVersion();
+
+ // Fill GLES usage protobuf
+ void fillGLESUsages(android_studio::EmulatorGLESUsages*);
+
+ void* platformCreateSharedEglContext(void);
+ bool platformDestroySharedEglContext(void* context);
+
+ bool flushColorBufferFromGl(HandleType colorBufferHandle);
+
+ bool invalidateColorBufferForGl(HandleType colorBufferHandle);
+
+ ContextHelper* getPbufferSurfaceContextHelper() const;
+
+ // Bind the current context's EGL_TEXTURE_2D texture to a ColorBuffer
+ // instance's EGLImage. This is intended to implement
+ // glEGLImageTargetTexture2DOES() for all GLES versions.
+ // |p_colorbuffer| is the ColorBuffer's handle value.
+ // Returns true on success, false on failure.
+ bool bindColorBufferToTexture(HandleType p_colorbuffer);
+ bool bindColorBufferToTexture2(HandleType p_colorbuffer);
+
+ // Bind the current context's EGL_RENDERBUFFER_OES render buffer to this
+ // ColorBuffer's EGLImage. This is intended to implement
+ // glEGLImageTargetRenderbufferStorageOES() for all GLES versions.
+ // |p_colorbuffer| is the ColorBuffer's handle value.
+ // Returns true on success, false on failure.
+ bool bindColorBufferToRenderbuffer(HandleType p_colorbuffer);
+
+ // Equivalent for eglMakeCurrent() for the current display.
+ // |p_context|, |p_drawSurface| and |p_readSurface| are the handle values
+ // of the context, the draw surface and the read surface, respectively.
+ // Returns true on success, false on failure.
+ // Note: if all handle values are 0, this is an unbind operation.
+ bool bindContext(HandleType p_context, HandleType p_drawSurface, HandleType p_readSurface);
+
+ // create a Y texture and a UV texture with width and height, the created
+ // texture ids are stored in textures respectively
+ void createYUVTextures(uint32_t type, uint32_t count, int width, int height, uint32_t* output);
+ void destroyYUVTextures(uint32_t type, uint32_t count, uint32_t* textures);
+ void updateYUVTextures(uint32_t type, uint32_t* textures, void* privData, void* func);
+ void swapTexturesAndUpdateColorBuffer(uint32_t colorbufferhandle, int x, int y, int width,
+ int height, uint32_t format, uint32_t type,
+ uint32_t texture_type, uint32_t* textures);
+
+ // Reads back the raw color buffer to |pixels|
+ // if |pixels| is not null.
+ // Always returns in |numBytes| how many bytes were
+ // planned to be transmitted.
+ // |numBytes| is not an input parameter;
+ // fewer or more bytes cannot be specified.
+ // If the framework format is YUV, it will read
+ // back as raw YUV data.
+ bool readColorBufferContents(HandleType p_colorbuffer, size_t* numBytes, void* pixels);
+
+ void waitForGpu(uint64_t eglsync);
+ void asyncWaitForGpuWithCb(uint64_t eglsync, FenceCompletionCallback cb);
+
+ const gl::EGLDispatch* getEglDispatch();
+ const gl::GLESv2Dispatch* getGles2Dispatch();
+#endif
+
+ private:
+ FrameBuffer(int p_width, int p_height, bool useSubWindow);
+ // Requires the caller to hold the m_colorBufferMapLock until the new handle is inserted into of
+ // the object handle maps.
+ HandleType genHandle_locked();
+
+ bool removeSubWindow_locked();
+ // Returns the set of ColorBuffers destroyed (for further cleanup)
+ std::vector<HandleType> cleanupProcGLObjects_locked(uint64_t puid,
+ bool forced = false);
+
+ void markOpened(ColorBufferRef* cbRef);
+ // Returns true if the color buffer was erased.
+ bool closeColorBufferLocked(HandleType p_colorbuffer, bool forced = false);
+ // Returns true if this was the last ref and we need to destroy stuff.
+ bool decColorBufferRefCountLocked(HandleType p_colorbuffer);
+ // Decrease refcount but not destroy the object.
+ // Mainly used in post thread, when we need to destroy the object but cannot in post thread.
+ void decColorBufferRefCountNoDestroy(HandleType p_colorbuffer);
+ // Close all expired color buffers for real.
+ // Treat all delayed color buffers as expired if forced=true
+ void performDelayedColorBufferCloseLocked(bool forced = false);
+ void eraseDelayedCloseColorBufferLocked(HandleType cb, uint64_t ts);
+
+ AsyncResult postImpl(HandleType p_colorbuffer, Post::CompletionCallback callback,
+ bool needLockAndBind = true, bool repaint = false);
+ bool postImplSync(HandleType p_colorbuffer, bool needLockAndBind = true, bool repaint = false);
+ void setGuestPostedAFrame() {
+ m_guestPostedAFrame = true;
+ fireEvent({FrameBufferChange::FrameReady, mFrameNumber++});
+ }
+ HandleType createColorBufferWithHandleLocked(int p_width, int p_height, GLenum p_internalFormat,
+ FrameworkFormat p_frameworkFormat,
+ HandleType handle);
+ HandleType createBufferWithHandleLocked(int p_size, HandleType handle, uint32_t memoryProperty);
+
+ void recomputeLayout();
+ void setDisplayPoseInSkinUI(int totalHeight);
+ void sweepColorBuffersLocked();
+
+ std::future<void> blockPostWorker(std::future<void> continueSignal);
+
+ private:
+
+ static FrameBuffer* s_theFrameBuffer;
+ static HandleType s_nextHandle;
+ int m_x = 0;
+ int m_y = 0;
+ int m_framebufferWidth = 0;
+ int m_framebufferHeight = 0;
+ std::atomic_int m_windowWidth = 0;
+ std::atomic_int m_windowHeight = 0;
+ // When zoomed in, the size of the content is bigger than the window size, and we only
+ // display / store a portion of it.
+ int m_windowContentFullWidth = 0;
+ int m_windowContentFullHeight = 0;
+ float m_dpr = 0;
+
+ bool m_useSubWindow = false;
+
+ bool m_fpsStats = false;
+ bool m_perfStats = false;
+ int m_statsNumFrames = 0;
+ long long m_statsStartTime = 0;
+
+ android::base::Thread* m_perfThread;
+ android::base::Lock m_lock;
+ android::base::ReadWriteLock m_contextStructureLock;
+ android::base::Lock m_colorBufferMapLock;
+ uint64_t mFrameNumber;
+ FBNativeWindowType m_nativeWindow = 0;
+
+ ColorBufferMap m_colorbuffers;
+ BufferMap m_buffers;
+
+ // A collection of color buffers that were closed without any usages
+ // (|opened| == false).
+ //
+ // If a buffer reached |refcount| == 0 while not being |opened|, instead of
+ // deleting it we remember the timestamp when this happened. Later, we
+ // check if the buffer stayed unopened long enough and if it did, we delete
+ // it permanently. On the other hand, if the color buffer was used then
+ // we don't care about timestamps anymore.
+ //
+ // Note: this collection is ordered by |ts| field.
+ struct ColorBufferCloseInfo {
+ uint64_t ts; // when we got the close request.
+ HandleType cbHandle; // 0 == already closed, do nothing
+ };
+ using ColorBufferDelayedClose = std::vector<ColorBufferCloseInfo>;
+ ColorBufferDelayedClose m_colorBufferDelayedCloseList;
+
+ EGLNativeWindowType m_subWin = {};
+ HandleType m_lastPostedColorBuffer = 0;
+ float m_zRot = 0;
+ float m_px = 0;
+ float m_py = 0;
+
+ // Async readback
+ enum class ReadbackCmd {
+ Init = 0,
+ GetPixels = 1,
+ AddRecordDisplay = 2,
+ DelRecordDisplay = 3,
+ Exit = 4,
+ };
+ struct Readback {
+ ReadbackCmd cmd;
+ uint32_t displayId;
+ void* pixelsOut;
+ uint32_t bytes;
+ uint32_t width;
+ uint32_t height;
+ };
+ android::base::WorkerProcessingResult sendReadbackWorkerCmd(
+ const Readback& readback);
+ bool m_guestPostedAFrame = false;
+
+ struct onPost {
+ Renderer::OnPostCallback cb;
+ void* context;
+ uint32_t displayId;
+ uint32_t width;
+ uint32_t height;
+ unsigned char* img = nullptr;
+ bool readBgra;
+ ~onPost() {
+ if (img) {
+ delete[] img;
+ img = nullptr;
+ }
+ }
+ };
+ std::map<uint32_t, onPost> m_onPost;
+ ReadbackWorker* m_readbackWorker = nullptr;
+ android::base::WorkerThread<Readback> m_readbackThread;
+ std::atomic_bool m_readbackThreadStarted = false;
+
+ std::string m_graphicsAdapterVendor;
+ std::string m_graphicsAdapterName;
+ std::string m_graphicsApiVersion;
+ std::string m_graphicsApiExtensions;
+ std::string m_graphicsDeviceExtensions;
+ std::unordered_map<uint64_t, std::unique_ptr<ProcessResources>> m_procOwnedResources;
+
+ // Flag set when emulator is shutting down.
+ bool m_shuttingDown = false;
+
+ // When this feature is enabled, open/close operations from gralloc in guest
+ // will no longer control the reference counting of color buffers on host.
+ // Instead, it will be managed by a file descriptor in the guest kernel. In
+ // case all the native handles in guest are destroyed, the pipe will be
+ // automatically closed by the kernel. We only need to do reference counting
+ // for color buffers attached in window surface.
+ bool m_refCountPipeEnabled = false;
+
+ // When this feature is enabled, and m_refCountPipeEnabled == false, color
+ // buffer close operations will immediately close the color buffer if host
+ // refcount hits 0. This is for use with guest kernels where the color
+ // buffer is already tied to a file descriptor in the guest kernel.
+ bool m_noDelayCloseColorBufferEnabled = false;
+
+ std::unique_ptr<PostWorker> m_postWorker = {};
+ std::atomic_bool m_postThreadStarted = false;
+ android::base::WorkerThread<Post> m_postThread;
+ android::base::WorkerProcessingResult postWorkerFunc(Post& post);
+ std::future<void> sendPostWorkerCmd(Post post);
+
+ bool m_vulkanInteropSupported = false;
+ bool m_vulkanEnabled = false;
+ bool m_guestUsesAngle = false;
+ // Whether the guest manages ColorBuffer lifetime
+ // so we don't need refcounting on the host side.
+ bool m_guestManagedColorBufferLifetime = false;
+
+ android::base::MessageChannel<HandleType, 1024>
+ mOutstandingColorBufferDestroys;
+
+ Compositor* m_compositor = nullptr;
+ bool m_useVulkanComposition = false;
+
+ vk::VkEmulation* m_emulationVk = nullptr;
+ // The implementation for Vulkan native swapchain. Only initialized when useVulkan is set when
+ // calling FrameBuffer::initialize(). DisplayVk is actually owned by VkEmulation.
+ vk::DisplayVk* m_displayVk = nullptr;
+ VkInstance m_vkInstance = VK_NULL_HANDLE;
+ std::unique_ptr<emugl::RenderDoc> m_renderDoc = nullptr;
+
+ // TODO(b/233939967): Refactor to create DisplayGl and DisplaySurfaceGl
+ // and remove usage of non-generic DisplayVk.
+ Display* m_display;
+ std::unique_ptr<DisplaySurface> m_displaySurface;
+
+ // CompositorGl.
+ // TODO: update RenderDoc to be a DisplaySurfaceUser.
+ std::vector<DisplaySurfaceUser*> m_displaySurfaceUsers;
+
+ // UUIDs of physical devices for Vulkan and GLES, respectively. In most
+ // cases, this determines whether we can support zero-copy interop.
+ using VkUuid = std::array<uint8_t, VK_UUID_SIZE>;
+ VkUuid m_vulkanUUID{};
+
+ // Tracks platform EGL contexts that have been handed out to other users,
+ // indexed by underlying native EGL context object.
+
+ std::unique_ptr<MetricsLogger> m_logger;
+ std::unique_ptr<HealthMonitor<>> m_healthMonitor;
+
+ int m_vsyncHz = 60;
+
+ // Vsync thread.
+ std::unique_ptr<VsyncThread> m_vsyncThread = {};
+
+ struct DisplayConfig{
+ int w;
+ int h;
+ int dpiX;
+ int dpiY;
+ DisplayConfig() {}
+ DisplayConfig(int w, int h, int x, int y)
+ : w(w), h(h), dpiX(x), dpiY(y) {}
+ };
+ std::map<int, DisplayConfig> mDisplayConfigs;
+ int mDisplayActiveConfigId = -1;
+
+ std::unique_ptr<gl::EmulationGl> m_emulationGl;
+
+ // The host associates color buffers with guest processes for memory
+ // cleanup. Guest processes are identified with a host generated unique ID.
+ // TODO(kaiyili): move all those resources to the ProcessResources struct.
+ ProcOwnedColorBuffers m_procOwnedColorBuffers;
+ ProcOwnedCleanupCallbacks m_procOwnedCleanupCallbacks;
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ gl::EmulatedEglContextMap m_contexts;
+ gl::EmulatedEglImageMap m_images;
+ gl::EmulatedEglWindowSurfaceMap m_windows;
+
+ std::unordered_map<HandleType, HandleType> m_EmulatedEglWindowSurfaceToColorBuffer;
+
+ ProcOwnedEmulatedEGLImages m_procOwnedEmulatedEglImages;
+ ProcOwnedEmulatedEglContexts m_procOwnedEmulatedEglContexts;
+ ProcOwnedEmulatedEglWindowSurfaces m_procOwnedEmulatedEglWindowSurfaces;
+ gl::DisplayGl* m_displayGl = nullptr;
+
+ struct PlatformEglContextInfo {
+ EGLContext context;
+ EGLSurface surface;
+ };
+
+ std::unordered_map<void*, PlatformEglContextInfo> m_platformEglContexts;
+#endif
+};
+
+} // namespace gfxstream
+
+#endif
diff --git a/src/gfxstream/host/FrameworkFormats.h b/src/gfxstream/host/FrameworkFormats.h
new file mode 100644
index 00000000000..ba1e457bb3e
--- /dev/null
+++ b/src/gfxstream/host/FrameworkFormats.h
@@ -0,0 +1,25 @@
+#pragma once
+
+namespace gfxstream {
+
+// Android system might want to allocate some color buffers with formats
+// that are not compatible with most OpenGL implementations,
+// such as YV12.
+// In this situation, we need to convert to some OpenGL format such as
+// RGB888 that actually works.
+// While we can do some of this conversion in the guest gralloc driver itself
+// (which would make ColorBuffer see only the OpenGL formatted pixels),
+// it may be advantageous to do the conversion on the host as well.
+// FrameworkFormat tracks whether the incoming color buffer from the guest
+// can be directly used as a GL texture (FRAMEWORK_FORMAT_GL_COMPATIBLE).
+// Otherwise, we need to know which format it is (e.g., FRAMEWORK_FORMAT_YV12)
+// and convert on the host.
+enum FrameworkFormat {
+ FRAMEWORK_FORMAT_GL_COMPATIBLE = 0,
+ FRAMEWORK_FORMAT_YV12 = 1,
+ FRAMEWORK_FORMAT_YUV_420_888 = 2,
+ FRAMEWORK_FORMAT_NV12 = 3,
+ FRAMEWORK_FORMAT_P010 = 4,
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/GfxStreamAgents.cpp b/src/gfxstream/host/GfxStreamAgents.cpp
new file mode 100644
index 00000000000..a8f89d88f3b
--- /dev/null
+++ b/src/gfxstream/host/GfxStreamAgents.cpp
@@ -0,0 +1,479 @@
+// 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 "GfxStreamAgents.h"
+
+#include <stdint.h> // for uint32_t
+#include <stdio.h> // for fprintf
+
+#include <map> // for map, __ma...
+#include <utility> // for pair
+
+#include "host-common/HostmemIdMapping.h" // for android_e...
+#include "host-common/MultiDisplay.h" // for MultiDisp...
+#include "host-common/multi_display_agent.h" // for QAndroidM...
+#include "host-common/vm_operations.h" // for SnapshotC...
+#include "host-common/window_agent.h" // for WindowMes...
+#include "host-common/misc.h"
+
+#ifdef _DEBUG
+#define DEBUG_LOG(fd, fmt, ...) fprintf(fd, fmt, __VA_ARGS__);
+#else
+#define DEBUG_LOG(fd, fmt, ...)
+#endif
+
+static std::map<uint32_t, android::MultiDisplayInfo> mMultiDisplay;
+
+using namespace android;
+
+static const QAndroidMultiDisplayAgent sMultiDisplayAgent = {
+ .setMultiDisplay = [](uint32_t id,
+ int32_t x,
+ int32_t y,
+ uint32_t w,
+ uint32_t h,
+ uint32_t dpi,
+ uint32_t flag,
+ bool add) -> int {
+ return 0;
+ },
+ .getMultiDisplay = [](uint32_t id,
+ int32_t* x,
+ int32_t* y,
+ uint32_t* w,
+ uint32_t* h,
+ uint32_t* dpi,
+ uint32_t* flag,
+ bool* enabled) -> bool {
+ if (mMultiDisplay.find(id) == mMultiDisplay.end()) {
+ if (enabled) {
+ *enabled = false;
+ }
+ return false;
+ }
+ if (x) {
+ *x = mMultiDisplay[id].pos_x;
+ }
+ if (y) {
+ *y = mMultiDisplay[id].pos_y;
+ }
+ if (w) {
+ *w = mMultiDisplay[id].width;
+ }
+ if (h) {
+ *h = mMultiDisplay[id].height;
+ }
+ if (dpi) {
+ *dpi = mMultiDisplay[id].dpi;
+ }
+ if (flag) {
+ *flag = mMultiDisplay[id].flag;
+ }
+ if (enabled) {
+ *enabled = mMultiDisplay[id].enabled;
+ }
+ return true;
+ },
+ .getNextMultiDisplay = [](int32_t start_id,
+ uint32_t* id,
+ int32_t* x,
+ int32_t* y,
+ uint32_t* w,
+ uint32_t* h,
+ uint32_t* dpi,
+ uint32_t* flag,
+ uint32_t* cb) -> bool {
+ uint32_t key;
+ std::map<uint32_t, android::MultiDisplayInfo>::iterator i;
+ if (start_id < 0) {
+ key = 0;
+ } else {
+ key = start_id + 1;
+ }
+ i = mMultiDisplay.lower_bound(key);
+ if (i == mMultiDisplay.end()) {
+ return false;
+ } else {
+ if (id) {
+ *id = i->first;
+ }
+ if (x) {
+ *x = i->second.pos_x;
+ }
+ if (y) {
+ *y = i->second.pos_y;
+ }
+ if (w) {
+ *w = i->second.width;
+ }
+ if (h) {
+ *h = i->second.height;
+ }
+ if (dpi) {
+ *dpi = i->second.dpi;
+ }
+ if (flag) {
+ *flag = i->second.flag;
+ }
+ if (cb) {
+ *cb = i->second.cb;
+ }
+ return true;
+ }
+ },
+ .isMultiDisplayEnabled = [](void) -> bool {
+ return mMultiDisplay.size() > 1;
+ },
+ .getCombinedDisplaySize = [](uint32_t* width, uint32_t* height) {},
+ .multiDisplayParamValidate = [](uint32_t id,
+ uint32_t w,
+ uint32_t h,
+ uint32_t dpi,
+ uint32_t flag) -> bool { return true; },
+ .translateCoordination =
+ [](uint32_t* x, uint32_t* y, uint32_t* displayId) -> bool {
+ return true;
+ },
+ .setGpuMode = [](bool isGuestMode, uint32_t w, uint32_t h) {},
+ .createDisplay = [](uint32_t* displayId) -> int {
+ if (displayId == nullptr) {
+ fprintf(stderr, "null displayId pointer\n");
+ return -1;
+ }
+ if (mMultiDisplay.size() >= MultiDisplay::s_maxNumMultiDisplay) {
+ fprintf(stderr, "cannot create more displays, exceeding limits %d\n",
+ MultiDisplay::s_maxNumMultiDisplay);
+ return -1;
+ }
+ if (mMultiDisplay.find(*displayId) != mMultiDisplay.end()) {
+ return 0;
+ }
+ // displays created by internal rcCommands
+ if (*displayId == MultiDisplay::s_invalidIdMultiDisplay) {
+ for (int i = MultiDisplay::s_displayIdInternalBegin; i < MultiDisplay::s_maxNumMultiDisplay; i++) {
+ if (mMultiDisplay.find(i) == mMultiDisplay.end()) {
+ *displayId = i;
+ break;
+ }
+ }
+ }
+ if (*displayId == MultiDisplay::s_invalidIdMultiDisplay) {
+ fprintf(stderr, "cannot create more internaldisplays, exceeding limits %d\n",
+ MultiDisplay::s_maxNumMultiDisplay - MultiDisplay::s_displayIdInternalBegin);
+ return -1;
+ }
+
+ mMultiDisplay.emplace(*displayId, android::MultiDisplayInfo());
+ return 0;
+ },
+ .destroyDisplay = [](uint32_t displayId) -> int {
+ mMultiDisplay.erase(displayId);
+ return 0;
+ },
+ .setDisplayPose = [](uint32_t displayId,
+ int32_t x,
+ int32_t y,
+ uint32_t w,
+ uint32_t h,
+ uint32_t dpi) -> int {
+ if (mMultiDisplay.find(displayId) == mMultiDisplay.end()) {
+ fprintf(stderr, "cannot find display %d\n", displayId);
+ return -1;
+ }
+ mMultiDisplay[displayId].pos_x = x;
+ mMultiDisplay[displayId].pos_y = y;
+ mMultiDisplay[displayId].width = w;
+ mMultiDisplay[displayId].height = h;
+ mMultiDisplay[displayId].dpi = dpi;
+ return 0;
+ },
+ .getDisplayPose = [](uint32_t displayId,
+ int32_t* x,
+ int32_t* y,
+ uint32_t* w,
+ uint32_t* h) -> int {
+ if (mMultiDisplay.find(displayId) == mMultiDisplay.end()) {
+ fprintf(stderr, "cannot find display %d\n", displayId);
+ return -1;
+ }
+ if (x)
+ *x = mMultiDisplay[displayId].pos_x;
+ if (y)
+ *y = mMultiDisplay[displayId].pos_y;
+ if (w)
+ *w = mMultiDisplay[displayId].width;
+ if (h)
+ *h = mMultiDisplay[displayId].height;
+ return 0;
+ },
+ .getDisplayColorBuffer = [](uint32_t displayId,
+ uint32_t* colorBuffer) -> int {
+ if (mMultiDisplay.find(displayId) == mMultiDisplay.end()) {
+ fprintf(stderr, "cannot find display %d\n", displayId);
+ return -1;
+ }
+ *colorBuffer = mMultiDisplay[displayId].cb;
+ return 0;
+ },
+ .getColorBufferDisplay = [](uint32_t colorBuffer,
+ uint32_t* displayId) -> int {
+ for (const auto& iter : mMultiDisplay) {
+ if (iter.second.cb == colorBuffer) {
+ *displayId = iter.first;
+ return 0;
+ }
+ }
+ return -1;
+ },
+ .setDisplayColorBuffer = [](uint32_t displayId,
+ uint32_t colorBuffer) -> int {
+ if (mMultiDisplay.find(displayId) == mMultiDisplay.end()) {
+ fprintf(stderr, "cannot find display %d\n", displayId);
+ return -1;
+ }
+ mMultiDisplay[displayId].cb = colorBuffer;
+ return 0;
+ },
+ .isPixelFold = [] () {
+ return false;
+ },
+ };
+
+static bool sIsFolded = false;
+
+static const QAndroidEmulatorWindowAgent sQAndroidEmulatorWindowAgent = {
+ .getEmulatorWindow =
+ [](void) {
+ DEBUG_LOG(stderr,
+ "window-agent-GfxStream-impl: "
+ ".getEmulatorWindow\n");
+ return (EmulatorWindow*)nullptr;
+ },
+ .rotate90Clockwise =
+ [](void) {
+ DEBUG_LOG(stderr,
+ "window-agent-GfxStream-impl: "
+ ".rotate90Clockwise\n");
+ return true;
+ },
+ .rotate =
+ [](int rotation) {
+ DEBUG_LOG(stderr,
+ "window-agent-GfxStream-impl: "
+ ".rotate90Clockwise\n");
+ return true;
+ },
+ .getRotation =
+ [](void) {
+ DEBUG_LOG(stderr,
+ "window-agent-GfxStream-impl: .getRotation\n");
+ return (int)SKIN_ROTATION_0;
+ },
+ .showMessage =
+ [](const char* message, WindowMessageType type, int timeoutMs) {
+ DEBUG_LOG(stderr,
+ "window-agent-GfxStream-impl: .showMessage %s\n",
+ message);
+ },
+ .showMessageWithDismissCallback =
+ [](const char* message,
+ WindowMessageType type,
+ const char* dismissText,
+ void* context,
+ void (*func)(void*),
+ int timeoutMs) {
+ DEBUG_LOG(stderr,
+ "window-agent-GfxStream-impl: "
+ ".showMessageWithDismissCallback %s\n",
+ message);
+ },
+ .fold =
+ [](bool is_fold) -> bool {
+ DEBUG_LOG(stderr, "window-agent-GfxStream-impl: .fold %d\n",
+ is_fold);
+ sIsFolded = is_fold;
+ return true;
+ },
+ .isFolded = [](void) -> bool { return sIsFolded; },
+ .getFoldedArea = [](int* x, int* y, int* w, int* h) -> bool {
+ DEBUG_LOG(stderr, "window-agent-GfxStream-impl: .getFoldedArea\n");
+ return true;
+ },
+ .updateFoldablePostureIndicator = [](bool) {
+ DEBUG_LOG(stderr, "window-agent-GfxStream-impl: updateFoldablePostureIndicator\n");
+ },
+ .setUIDisplayRegion =
+ [](int x_offset, int y_offset, int w, int h, bool ignoreOrientation) {
+ DEBUG_LOG(stderr,
+ "window-agent-GfxStream-impl: .setUIDisplayRegion "
+ "%d %d %dx%d\n",
+ x_offset, y_offset, w, h);
+ },
+ .getMultiDisplay = 0,
+ .setNoSkin = [](void) {},
+ .restoreSkin = [](void) {},
+ .updateUIMultiDisplayPage =
+ [](uint32_t id) {
+ DEBUG_LOG(stderr, "updateMultiDisplayPage\n");
+ },
+ .getMonitorRect =
+ [](uint32_t* w, uint32_t* h) -> bool {
+ if (w)
+ *w = 2500;
+ if (h)
+ *h = 1600;
+ return true;
+ },
+};
+
+static const QAndroidVmOperations sQAndroidVmOperations = {
+ .vmStop = []() -> bool {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm stop\n");
+ return true;
+ },
+ .vmStart = []() -> bool {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm start\n");
+ return true;
+ },
+ .vmReset =
+ []() { DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm reset\n"); },
+ .vmShutdown =
+ []() { DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm reset\n"); },
+ .vmPause = []() -> bool {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm pause\n");
+ return true;
+ },
+ .vmResume = []() -> bool {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm resume\n");
+ return true;
+ },
+ .vmIsRunning = []() -> bool {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm is running\n");
+ return true;
+ },
+ .snapshotList =
+ [](void*, LineConsumerCallback, LineConsumerCallback) -> bool {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: snapshot list\n");
+ return true;
+ },
+ .snapshotSave = [](const char* name,
+ void* opaque,
+ LineConsumerCallback) -> bool {
+ DEBUG_LOG(stderr, "gfxstream vm ops: snapshot save\n");
+ return true;
+ },
+ .snapshotLoad = [](const char* name,
+ void* opaque,
+ LineConsumerCallback) -> bool {
+ DEBUG_LOG(stderr, "gfxstream vm ops: snapshot load\n");
+ return true;
+ },
+ .snapshotDelete = [](const char* name,
+ void* opaque,
+ LineConsumerCallback errConsumer) -> bool {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: snapshot delete\n");
+ return true;
+ },
+ .snapshotRemap = [](bool shared,
+ void* opaque,
+ LineConsumerCallback errConsumer) -> bool {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: snapshot remap\n");
+ return true;
+ },
+ .snapshotExport = [](const char* snapshot,
+ const char* dest,
+ void* opaque,
+ LineConsumerCallback errConsumer) -> bool {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: snapshot export image\n");
+ return true;
+ },
+ .setSnapshotCallbacks =
+ [](void* opaque, const SnapshotCallbacks* callbacks) {
+ DEBUG_LOG(stderr,
+ "goldfish-opengl vm ops: set snapshot callbacks\n");
+ },
+ .mapUserBackedRam =
+ [](uint64_t gpa, void* hva, uint64_t size) {
+ DEBUG_LOG(stderr, "%s: map user backed ram\n", __func__);
+ },
+ .unmapUserBackedRam =
+ [](uint64_t gpa, uint64_t size) {
+ DEBUG_LOG(stderr, "%s: unmap user backed ram\n", __func__);
+ },
+ .getVmConfiguration =
+ [](VmConfiguration* out) {
+ DEBUG_LOG(stderr,
+ "goldfish-opengl vm ops: get vm configuration\n");
+ },
+ .setFailureReason =
+ [](const char* name, int failureReason) {
+ DEBUG_LOG(stderr,
+ "goldfish-opengl vm ops: set failure reason\n");
+ },
+ .setExiting =
+ []() {
+ DEBUG_LOG(stderr, "goldfish-opengl vm ops: set exiting\n");
+ },
+ .allowRealAudio =
+ [](bool allow) {
+ DEBUG_LOG(stderr,
+ "goldfish-opengl vm ops: allow real audio\n");
+ },
+ .physicalMemoryGetAddr =
+ [](uint64_t gpa) {
+ DEBUG_LOG(stderr, "%s: physmemGetAddr\n", __func__);
+ return (void*)nullptr;
+ },
+ .isRealAudioAllowed =
+ [](void) {
+ DEBUG_LOG(stderr,
+ "goldfish-opengl vm ops: is real audiop allowed\n");
+ return true;
+ },
+ .setSkipSnapshotSave =
+ [](bool used) {
+ DEBUG_LOG(stderr,
+ "goldfish-opengl vm ops: set skip snapshot save\n");
+ },
+ .isSnapshotSaveSkipped =
+ []() {
+ DEBUG_LOG(stderr,
+ "goldfish-opengl vm ops: is snapshot save "
+ "skipped\n");
+ return false;
+ },
+ .hostmemRegister = android_emulation_hostmem_register,
+ .hostmemUnregister = android_emulation_hostmem_unregister,
+ .hostmemGetInfo = android_emulation_hostmem_get_info,
+};
+
+namespace android {
+namespace emulation {
+
+const QAndroidVmOperations* const
+GfxStreamGraphicsAgentFactory::android_get_QAndroidVmOperations() const {
+ return &sQAndroidVmOperations;
+}
+
+const QAndroidMultiDisplayAgent* const
+GfxStreamGraphicsAgentFactory::android_get_QAndroidMultiDisplayAgent() const {
+ return &sMultiDisplayAgent;
+}
+
+const QAndroidEmulatorWindowAgent* const
+GfxStreamGraphicsAgentFactory::android_get_QAndroidEmulatorWindowAgent()
+ const {
+ return &sQAndroidEmulatorWindowAgent;
+}
+} // namespace emulation
+} // namespace android
diff --git a/src/gfxstream/host/GfxStreamAgents.h b/src/gfxstream/host/GfxStreamAgents.h
new file mode 100644
index 00000000000..864d3ddec2f
--- /dev/null
+++ b/src/gfxstream/host/GfxStreamAgents.h
@@ -0,0 +1,40 @@
+// 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.
+#pragma once
+
+#include <stdio.h>
+
+#include "host-common/GraphicsAgentFactory.h"
+
+namespace android {
+namespace emulation {
+
+// Creates a series of GfxStream Agents that can be used by GfxStream backend.
+//
+// Most of the agents are not defined, add your agents here if you need
+// access to additional agents.
+class GfxStreamGraphicsAgentFactory : public GraphicsAgentFactory {
+public:
+ const QAndroidVmOperations* const android_get_QAndroidVmOperations()
+ const override;
+
+ const QAndroidMultiDisplayAgent* const
+ android_get_QAndroidMultiDisplayAgent() const override;
+
+ const QAndroidEmulatorWindowAgent* const
+ android_get_QAndroidEmulatorWindowAgent() const override;
+};
+
+} // namespace emulation
+} // namespace android
diff --git a/src/gfxstream/host/GfxStreamBackendInitOverride.cpp b/src/gfxstream/host/GfxStreamBackendInitOverride.cpp
new file mode 100644
index 00000000000..9d8859d64f3
--- /dev/null
+++ b/src/gfxstream/host/GfxStreamBackendInitOverride.cpp
@@ -0,0 +1,17 @@
+// 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 "render-utils/virtio-gpu-gfxstream-renderer.h"
+
+void gfxstream_backend_init_product_override() {}
diff --git a/src/gfxstream/host/GlesCompat.h b/src/gfxstream/host/GlesCompat.h
new file mode 100644
index 00000000000..3c57028fd7d
--- /dev/null
+++ b/src/gfxstream/host/GlesCompat.h
@@ -0,0 +1,38 @@
+// Copyright 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_COMPAT_H
+#define GLES_COMPAT_H
+
+#include <cstdint>
+
+typedef unsigned int GLenum;
+typedef int32_t EGLint;
+// typedef void *EGLNativeDisplayType;
+typedef unsigned int EGLNativeWindowType;
+
+namespace gfxstream {
+namespace gl {
+class EmulationGl {
+ public:
+ EmulationGl() {}
+ ~EmulationGl() {}
+
+ private:
+ uint32_t payload;
+};
+} // namespace gl
+} // namespace gfxstream
+
+#endif
diff --git a/src/gfxstream/host/Handle.h b/src/gfxstream/host/Handle.h
new file mode 100644
index 00000000000..c2fd6c090f6
--- /dev/null
+++ b/src/gfxstream/host/Handle.h
@@ -0,0 +1,26 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <cstdint>
+#include <unordered_set>
+
+namespace gfxstream {
+
+using HandleType = uint32_t;
+using ThreadContextSet = std::unordered_set<HandleType>;
+using WindowSurfaceSet = std::unordered_set<HandleType>;
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/Hwc2.cpp b/src/gfxstream/host/Hwc2.cpp
new file mode 100644
index 00000000000..b4629bdbdfd
--- /dev/null
+++ b/src/gfxstream/host/Hwc2.cpp
@@ -0,0 +1,41 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "Hwc2.h"
+
+namespace gfxstream {
+
+std::unique_ptr<FlatComposeRequest> ToFlatComposeRequest(
+ const ComposeDevice* composeRequest) {
+ auto flatComposeRequest = std::make_unique<FlatComposeRequest>();
+ flatComposeRequest->displayId = 0;
+ flatComposeRequest->targetHandle = composeRequest->targetHandle;
+ for (uint32_t i = 0; i < composeRequest->numLayers; i++) {
+ flatComposeRequest->layers.emplace_back(composeRequest->layer[i]);
+ }
+ return flatComposeRequest;
+}
+
+std::unique_ptr<FlatComposeRequest> ToFlatComposeRequest(
+ const ComposeDevice_v2* composeRequest) {
+ auto flatComposeRequest = std::make_unique<FlatComposeRequest>();
+ flatComposeRequest->displayId = composeRequest->displayId;
+ flatComposeRequest->targetHandle = composeRequest->targetHandle;
+ for (uint32_t i = 0; i < composeRequest->numLayers; i++) {
+ flatComposeRequest->layers.emplace_back(composeRequest->layer[i]);
+ }
+ return flatComposeRequest;
+}
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/Hwc2.h b/src/gfxstream/host/Hwc2.h
new file mode 100644
index 00000000000..6b5e004e214
--- /dev/null
+++ b/src/gfxstream/host/Hwc2.h
@@ -0,0 +1,127 @@
+/*
+* Copyright (C) 2011-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 _LIBRENDER_HWC2_H
+#define _LIBRENDER_HWC2_H
+
+#include <memory>
+#include <stdint.h>
+#include <vector>
+
+namespace gfxstream {
+
+/* Copied from Android source */
+
+// Should be identical to graphics-base-v1.0.h
+typedef enum {
+ HAL_TRANSFORM_NONE = 0,
+ HAL_TRANSFORM_FLIP_H = 1, // (1 << 0)
+ HAL_TRANSFORM_FLIP_V = 2, // (1 << 1)
+ HAL_TRANSFORM_ROT_90 = 4, // (1 << 2)
+ HAL_TRANSFORM_ROT_180 = 3, // (FLIP_H | FLIP_V)
+ HAL_TRANSFORM_ROT_270 = 7, // ((FLIP_H | FLIP_V) | ROT_90)
+} android_transform_t;
+
+// Should be identical to hwcomposer_defs.h
+typedef struct hwc_color {
+ uint8_t r;
+ uint8_t g;
+ uint8_t b;
+ uint8_t a;
+} hwc_color_t;
+typedef struct hwc_frect {
+ float left;
+ float top;
+ float right;
+ float bottom;
+} hwc_frect_t;
+typedef struct hwc_rect {
+ int left;
+ int top;
+ int right;
+ int bottom;
+} hwc_rect_t;
+
+typedef enum {
+ /* No transform */
+ HWC_TRANSFORM_NONE = HAL_TRANSFORM_NONE,
+ /* flip source image horizontally */
+ HWC_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H,
+ /* flip source image vertically */
+ HWC_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V,
+ /* rotate source image 90 degrees clock-wise */
+ HWC_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90,
+ /* rotate source image 180 degrees */
+ HWC_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180,
+ /* rotate source image 270 degrees clock-wise */
+ HWC_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270,
+ /* flip source image horizontally, the rotate 90 degrees clock-wise */
+ HWC_TRANSFORM_FLIP_H_ROT_90 = HAL_TRANSFORM_FLIP_H | HAL_TRANSFORM_ROT_90,
+ /* flip source image vertically, the rotate 90 degrees clock-wise */
+ HWC_TRANSFORM_FLIP_V_ROT_90 = HAL_TRANSFORM_FLIP_V | HAL_TRANSFORM_ROT_90,
+} hwc_transform_t;
+
+// Should be identical to hwcomposer2.h
+typedef enum {
+ HWC2_COMPOSITION_INVALID = 0,
+ HWC2_COMPOSITION_CLIENT = 1,
+ HWC2_COMPOSITION_DEVICE = 2,
+ HWC2_COMPOSITION_SOLID_COLOR = 3,
+ HWC2_COMPOSITION_CURSOR = 4,
+ HWC2_COMPOSITION_SIDEBAND = 5,
+} hwc2_composition_t;
+typedef enum {
+ HWC2_BLEND_MODE_INVALID = 0,
+ HWC2_BLEND_MODE_NONE = 1,
+ HWC2_BLEND_MODE_PREMULTIPLIED = 2,
+ HWC2_BLEND_MODE_COVERAGE = 3,
+} hwc2_blend_mode_t;
+
+// Should be identical to EmuHwc2.h
+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;
+
+typedef struct FlatComposeRequest {
+ uint32_t displayId;
+ uint32_t targetHandle;
+ std::vector<ComposeLayer> layers;
+} FlatComposeRequest;
+std::unique_ptr<FlatComposeRequest> ToFlatComposeRequest(const ComposeDevice* in);
+std::unique_ptr<FlatComposeRequest> ToFlatComposeRequest(const ComposeDevice_v2* in);
+
+} // namespace gfxstream
+
+#endif
diff --git a/src/gfxstream/host/NativeSubWindow.h b/src/gfxstream/host/NativeSubWindow.h
new file mode 100644
index 00000000000..aff117c7df1
--- /dev/null
+++ b/src/gfxstream/host/NativeSubWindow.h
@@ -0,0 +1,76 @@
+/*
+* 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 NATIVE_SUB_WINDOW_H
+#define NATIVE_SUB_WINDOW_H
+
+#include "render-utils/render_api_platform_types.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include <EGL/egl.h>
+#else
+#include "GlesCompat.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*SubWindowRepaintCallback)(void*);
+
+// Create a new sub-window that will be used to display the content of the
+// emulated GPU on top of the regular UI window.
+// |p_window| is the platform-specific handle to the main UI window.
+// |x|, |y| is the position sub-window relative to the top-left corner of the
+// main window.
+// |width| and |height| are the dimensions of the sub-window, as well as of
+// the emulated framebuffer.
+// |repaint_callback| may be invoked every time the window has to be repainted
+// (such as receiving a WM_PAINT event on Windows). If the provided argument is
+// NULL, nothing will be invoked.
+// |repaint_callback_param| an additional parameter that will be passed to the
+// repaint callback when/if it's invoked.
+// On success, return a new platform-specific window handle, cast as an
+// EGLNativeWindowType. Or 0/NULL in case of failure.
+EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
+ int x,
+ int y,
+ int width,
+ int height,
+ float dpr,
+ SubWindowRepaintCallback repaint_callback,
+ void* repaint_callback_param,
+ int hideWindow);
+
+// Destroy a sub-window previously created through createSubWindow() above.
+void destroySubWindow(EGLNativeWindowType win);
+
+// Moves a sub-window previously created through createSubWindow() above.
+// |p_parent_window| is the platform-specific handle to the main UI window.
+// |p_sub_window| is the platform-specific handle to the EGL subwindow.
+// |x|,|y|,|width|,|height| are the new location and dimensions of the
+// subwindow.
+int moveSubWindow(FBNativeWindowType p_parent_window,
+ EGLNativeWindowType p_sub_window,
+ int x,
+ int y,
+ int width,
+ int height);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gfxstream/host/NativeSubWindow_android.cpp b/src/gfxstream/host/NativeSubWindow_android.cpp
new file mode 100644
index 00000000000..ec661548176
--- /dev/null
+++ b/src/gfxstream/host/NativeSubWindow_android.cpp
@@ -0,0 +1,47 @@
+/*
+* 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 "NativeSubWindow.h"
+#include <android/native_window.h>
+
+#include <stdio.h>
+
+EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
+ int x,
+ int y,
+ int width,
+ int height,
+ float dpr,
+ SubWindowRepaintCallback repaint_callback,
+ void* repaint_callback_param,
+ int hideWindow) {
+ ANativeWindow_acquire(p_window);
+ ANativeWindow_setBuffersGeometry(p_window, width, height, AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM);
+ return p_window;
+}
+
+void destroySubWindow(EGLNativeWindowType win) {
+ ANativeWindow_release(win);
+}
+
+int moveSubWindow(FBNativeWindowType p_parent_window,
+ EGLNativeWindowType p_sub_window,
+ int x,
+ int y,
+ int width,
+ int height) {
+ // moving windows not supported in Android; we can't create an actual sub window
+ return true;
+}
diff --git a/src/gfxstream/host/NativeSubWindow_cocoa.m b/src/gfxstream/host/NativeSubWindow_cocoa.m
new file mode 100644
index 00000000000..2b764fcaec5
--- /dev/null
+++ b/src/gfxstream/host/NativeSubWindow_cocoa.m
@@ -0,0 +1,138 @@
+/*
+* 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.
+*/
+#import <QuartzCore/CALayer.h>
+#import <QuartzCore/CAMetalLayer.h>
+
+
+#include "NativeSubWindow.h"
+#include <Cocoa/Cocoa.h>
+
+/*
+ * EmuGLView inherit from NSView and override the isOpaque
+ * method to return YES. That prevents drawing of underlying window/view
+ * when the view needs to be redrawn.
+ */
+@interface EmuGLView : NSView {
+} @end
+
+@implementation EmuGLView
+
+ - (BOOL)isOpaque {
+ return YES;
+ }
+
+@end
+
+@interface EmuGLViewWithMetal : NSView {
+} @end
+
+@implementation EmuGLViewWithMetal
+
+ - (BOOL)isOpaque {
+ return YES;
+ }
+
+ + (Class) layerClass {
+ return [CAMetalLayer class];
+ }
+
+ - (CALayer *)makeBackingLayer {
+ CALayer * layer = [CAMetalLayer layer];
+ return layer;
+ }
+
+@end
+
+EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
+ int x,
+ int y,
+ int width,
+ int height,
+ float dpr,
+ SubWindowRepaintCallback repaint_callback,
+ void* repaint_callback_param,
+ int hideWindow) {
+ NSWindow* win = (NSWindow *)p_window;
+ if (!win) {
+ return NULL;
+ }
+
+ /* (x,y) assume an upper-left origin, but Cocoa uses a lower-left origin */
+ NSRect content_rect = [win contentRectForFrameRect:[win frame]];
+ int cocoa_y = (int)content_rect.size.height - (y + height);
+ NSRect contentRect = NSMakeRect(x, cocoa_y, width, height);
+
+ NSView *glView = NULL;
+ const char* angle_default_platform = getenv("ANGLE_DEFAULT_PLATFORM");
+ if (angle_default_platform && 0 == strcmp("metal", angle_default_platform)) {
+ glView = [[EmuGLViewWithMetal alloc] initWithFrame:contentRect];
+ } else {
+ glView = [[EmuGLView alloc] initWithFrame:contentRect];
+ }
+ if (!glView) {
+ return NULL;
+ }
+ [glView setWantsBestResolutionOpenGLSurface:YES];
+ [glView setWantsLayer:YES];
+ [[win contentView] addSubview:glView];
+ [win makeKeyAndOrderFront:nil];
+ if (hideWindow) {
+ [glView setHidden:YES];
+ }
+ // We cannot use the dpr from [NSScreen mainScreen], which usually
+ // gives the wrong screen at this point.
+ [glView.layer setContentsScale:dpr];
+ return (EGLNativeWindowType)(glView);
+}
+
+void destroySubWindow(EGLNativeWindowType win) {
+ if(win){
+ NSView *glView = (NSView *)win;
+ [glView removeFromSuperview];
+ [glView release];
+ }
+}
+
+int moveSubWindow(FBNativeWindowType p_parent_window,
+ EGLNativeWindowType p_sub_window,
+ int x,
+ int y,
+ int width,
+ int height) {
+ NSWindow *win = (NSWindow *)p_parent_window;
+ if (!win) {
+ return 0;
+ }
+
+ NSView *glView = (NSView *)p_sub_window;
+ if (!glView) {
+ return 0;
+ }
+
+ /* The view must be removed from the hierarchy to be properly resized */
+ [glView removeFromSuperview];
+
+ /* (x,y) assume an upper-left origin, but Cocoa uses a lower-left origin */
+ NSRect content_rect = [win contentRectForFrameRect:[win frame]];
+ int cocoa_y = (int)content_rect.size.height - (y + height);
+ NSRect newFrame = NSMakeRect(x, cocoa_y, width, height);
+ [glView setFrame:newFrame];
+
+ /* Re-add the sub-window to the view hierarchy */
+ [[win contentView] addSubview:glView];
+
+ return 1;
+}
diff --git a/src/gfxstream/host/NativeSubWindow_qnx.cpp b/src/gfxstream/host/NativeSubWindow_qnx.cpp
new file mode 100644
index 00000000000..f983d324e59
--- /dev/null
+++ b/src/gfxstream/host/NativeSubWindow_qnx.cpp
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2023 BlackBerry Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 <pthread.h>
+#include <screen/screen.h>
+
+#include "NativeSubWindow.h"
+
+namespace {
+
+static pthread_once_t once_control = PTHREAD_ONCE_INIT;
+static screen_context_t g_screen_ctx;
+
+static void screen_init(void) {
+ /* initialize the global screen context */
+ screen_create_context(&g_screen_ctx, SCREEN_APPLICATION_CONTEXT);
+}
+
+static screen_context_t get_screen_context() {
+ pthread_once(&once_control, screen_init);
+ return g_screen_ctx;
+}
+
+} // namespace
+
+EGLNativeWindowType createSubWindow(FBNativeWindowType p_window, int x, int y, int width,
+ int height, float dpr,
+ SubWindowRepaintCallback repaint_callback,
+ void* repaint_callback_param, int hideWindow) {
+ screen_context_t screen_ctx;
+ screen_window_t screen_window;
+ int rc;
+
+ screen_ctx = get_screen_context();
+ if (screen_ctx == nullptr) {
+ perror("No screen context");
+ return nullptr;
+ }
+
+ int type = p_window ? SCREEN_EMBEDDED_WINDOW : SCREEN_APPLICATION_WINDOW;
+ rc = screen_create_window_type(&screen_window, screen_ctx, type);
+ if (rc) {
+ perror("screen_create_window");
+ return nullptr;
+ }
+
+ int alpha_mode = SCREEN_NON_PRE_MULTIPLIED_ALPHA;
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_ALPHA_MODE, &alpha_mode);
+
+ int usage = SCREEN_USAGE_NATIVE | SCREEN_USAGE_OPENGL_ES2;
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_USAGE, &usage);
+
+ int interval = 1;
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_SWAP_INTERVAL, &interval);
+
+ int format = SCREEN_FORMAT_RGBA8888;
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_FORMAT, &format);
+
+ int transp = SCREEN_TRANSPARENCY_NONE;
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_TRANSPARENCY, &transp);
+
+ int pos[2] = {x, y};
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_POSITION, pos);
+
+ int size[2] = {width, height};
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_SIZE, size);
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_BUFFER_SIZE, size);
+
+ rc = screen_create_window_buffers(screen_window, 2);
+ if (rc) {
+ perror("screen_create_window_buffers");
+ screen_destroy_window(screen_window);
+ return nullptr;
+ }
+
+ if (p_window) {
+ char group[64] = {0};
+ rc = screen_get_window_property_cv(p_window, SCREEN_PROPERTY_ID, sizeof(group), group);
+ if (!rc && group[0]) {
+ rc = screen_join_window_group(screen_window, group);
+ }
+ if (rc || !group[0]) {
+ perror("group");
+ }
+ } else {
+ // TODO: yodai create window group?
+ }
+
+ int sensitivity = SCREEN_SENSITIVITY_TEST;
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_SENSITIVITY, &sensitivity);
+
+ int visible = hideWindow ? 0 : 1;
+ screen_set_window_property_iv(screen_window, SCREEN_PROPERTY_VISIBLE, &visible);
+
+ rc = screen_flush_context(screen_ctx, SCREEN_WAIT_IDLE);
+ if (rc) {
+ perror("flush");
+ }
+
+ return screen_window;
+}
+
+void destroySubWindow(EGLNativeWindowType win) { screen_destroy_window(win); }
+
+int moveSubWindow(FBNativeWindowType p_parent_window, EGLNativeWindowType p_sub_window, int x,
+ int y, int width, int height) {
+ int pos[2] = {x, y};
+ if (screen_set_window_property_iv(p_sub_window, SCREEN_PROPERTY_POSITION, pos)) {
+ return 0;
+ }
+ int size[2] = {width, height};
+ if (screen_set_window_property_iv(p_sub_window, SCREEN_PROPERTY_SIZE, size)) {
+ return 0;
+ }
+ return screen_flush_context(get_screen_context(), 0) == EOK;
+}
diff --git a/src/gfxstream/host/NativeSubWindow_stub.cpp b/src/gfxstream/host/NativeSubWindow_stub.cpp
new file mode 100644
index 00000000000..75a1ea85134
--- /dev/null
+++ b/src/gfxstream/host/NativeSubWindow_stub.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 "GlesCompat.h"
+#include "NativeSubWindow.h"
+
+EGLNativeWindowType createSubWindow(FBNativeWindowType p_window, int x, int y, int width,
+ int height, float dpr,
+ SubWindowRepaintCallback repaint_callback,
+ void* repaint_callback_param, int hideWindow) {
+ return 0;
+}
+
+void destroySubWindow(EGLNativeWindowType win) { return; }
+
+int moveSubWindow(FBNativeWindowType p_parent_window, EGLNativeWindowType p_sub_window, int x,
+ int y, int width, int height) {
+ return 0;
+}
diff --git a/src/gfxstream/host/NativeSubWindow_win32.cpp b/src/gfxstream/host/NativeSubWindow_win32.cpp
new file mode 100644
index 00000000000..a5d7a1b665f
--- /dev/null
+++ b/src/gfxstream/host/NativeSubWindow_win32.cpp
@@ -0,0 +1,91 @@
+/*
+* 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 "NativeSubWindow.h"
+
+struct SubWindowUserData {
+ SubWindowRepaintCallback repaint_callback;
+ void* repaint_callback_param;
+};
+
+static LRESULT CALLBACK subWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+ if (uMsg == WM_PAINT) {
+ auto user_data =
+ (SubWindowUserData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ if (user_data && user_data->repaint_callback) {
+ user_data->repaint_callback(user_data->repaint_callback_param);
+ }
+ } else if (uMsg == WM_NCDESTROY) {
+ SubWindowUserData* user_data =
+ (SubWindowUserData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ delete user_data;
+ }
+ return DefWindowProcA(hwnd, uMsg, wParam, lParam);
+}
+
+EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
+ int x, int y,int width, int height, float dpr,
+ SubWindowRepaintCallback repaint_callback,
+ void* repaint_callback_param, int hideWindow){
+ static const char className[] = "subWin";
+
+ WNDCLASSA wc = {};
+ if (!GetClassInfoA(GetModuleHandle(NULL), className, &wc)) {
+ wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;// redraw if size changes
+ wc.lpfnWndProc = &subWindowProc; // points to window procedure
+ wc.cbWndExtra = sizeof(void*) ; // save extra window memory
+ wc.lpszClassName = className; // name of window class
+ RegisterClassA(&wc);
+ }
+
+ EGLNativeWindowType ret = CreateWindowExA(
+ WS_EX_NOPARENTNOTIFY, // do not bother our parent window
+ className,
+ "sub",
+ WS_CHILD|WS_DISABLED,
+ x,y,width,height,
+ p_window,
+ NULL,
+ NULL,
+ NULL);
+
+ auto user_data = new SubWindowUserData();
+ user_data->repaint_callback = repaint_callback;
+ user_data->repaint_callback_param = repaint_callback_param;
+
+ SetWindowLongPtr(ret, GWLP_USERDATA, (LONG_PTR)user_data);
+ if (!hideWindow)
+ ShowWindow(ret, SW_SHOW);
+ return ret;
+}
+
+void destroySubWindow(EGLNativeWindowType win){
+ PostMessage(win, WM_CLOSE, 0, 0);
+}
+
+int moveSubWindow(FBNativeWindowType p_parent_window,
+ EGLNativeWindowType p_sub_window,
+ int x,
+ int y,
+ int width,
+ int height) {
+ BOOL ret = MoveWindow(p_sub_window,
+ x,
+ y,
+ width,
+ height,
+ TRUE);
+ return ret;
+}
diff --git a/src/gfxstream/host/NativeSubWindow_x11.cpp b/src/gfxstream/host/NativeSubWindow_x11.cpp
new file mode 100644
index 00000000000..58f96fd3be4
--- /dev/null
+++ b/src/gfxstream/host/NativeSubWindow_x11.cpp
@@ -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.
+*/
+#include "NativeSubWindow.h"
+#include "apigen-codec-common/X11Support.h"
+
+#include <stdio.h>
+
+namespace {
+
+static Bool WaitForMapNotify(Display *d, XEvent *e, char *arg) {
+ if (e->type == MapNotify && e->xmap.window == (Window)arg) {
+ return 1;
+ }
+ return 0;
+}
+
+static Bool WaitForConfigureNotify(Display *d, XEvent *e, char *arg) {
+ if (e->type == ConfigureNotify && e->xmap.window == (Window)arg) {
+ return 1;
+ }
+ return 0;
+}
+
+static Display *s_display = NULL;
+
+} // namespace
+
+EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
+ int x,
+ int y,
+ int width,
+ int height,
+ float dpr,
+ SubWindowRepaintCallback repaint_callback,
+ void* repaint_callback_param,
+ int hideWindow) {
+ auto x11 = getX11Api();
+ // The call to this function is protected by a lock
+ // in FrameBuffer so it is safe to check and initialize s_display here
+ if (!s_display) {
+ s_display = x11->XOpenDisplay(NULL);
+ }
+
+ XSetWindowAttributes wa;
+ wa.event_mask = StructureNotifyMask;
+ wa.override_redirect = True;
+ Window win = x11->XCreateWindow(s_display,
+ p_window,
+ x,
+ y,
+ width,
+ height,
+ 0,
+ CopyFromParent,
+ CopyFromParent,
+ CopyFromParent,
+ CWEventMask,
+ &wa);
+ if (!hideWindow) {
+ x11->XMapWindow(s_display,win);
+ x11->XSetWindowBackground(s_display, win, 0);
+ XEvent e;
+ x11->XIfEvent(s_display, &e, WaitForMapNotify, (char *)win);
+ }
+ return win;
+}
+
+void destroySubWindow(EGLNativeWindowType win) {
+ if (!s_display) {
+ return;
+ }
+
+ getX11Api()->XDestroyWindow(s_display, win);
+}
+
+int moveSubWindow(FBNativeWindowType p_parent_window,
+ EGLNativeWindowType p_sub_window,
+ int x,
+ int y,
+ int width,
+ int height) {
+ // This value is set during create, so if it is still null, simply
+ // return because the global state is corrupted
+ if (!s_display) {
+ return false;
+ }
+
+ auto x11 = getX11Api();
+
+ // Make sure something has changed, otherwise XIfEvent will block and
+ // freeze the emulator.
+ XWindowAttributes attrs;
+ if (!x11->XGetWindowAttributes(s_display, p_sub_window, &attrs)) {
+ return false;
+ }
+ if (x == attrs.x && y == attrs.y &&
+ width == attrs.width && height == attrs.height) {
+ // Technically, resizing was a success because it was unneeded.
+ return true;
+ }
+
+ // This prevents flicker on resize.
+ x11->XSetWindowBackgroundPixmap(s_display, p_sub_window, None);
+
+ int ret = x11->XMoveResizeWindow(
+ s_display,
+ p_sub_window,
+ x,
+ y,
+ width,
+ height);
+
+ XEvent e;
+ x11->XIfEvent(s_display, &e, WaitForConfigureNotify, (char *)p_sub_window);
+
+ return ret;
+}
diff --git a/src/gfxstream/host/PostCommands.h b/src/gfxstream/host/PostCommands.h
new file mode 100644
index 00000000000..697f6952c94
--- /dev/null
+++ b/src/gfxstream/host/PostCommands.h
@@ -0,0 +1,62 @@
+#pragma once
+
+#include <GLES2/gl2.h>
+
+#include <functional>
+#include <future>
+#include <memory>
+#include <vector>
+
+#include "Handle.h"
+#include "render-utils/Renderer.h"
+
+namespace gfxstream {
+
+class ColorBuffer;
+
+// Posting
+enum class PostCmd {
+ Post = 0,
+ Viewport = 1,
+ Compose = 2,
+ Clear = 3,
+ Screenshot = 4,
+ Exit = 5,
+ Block = 6,
+};
+
+struct Post {
+ struct Block {
+ // schduledSignal will be set when the block task is scheduled.
+ std::promise<void> scheduledSignal;
+ // The block task won't stop until continueSignal is ready.
+ std::future<void> continueSignal;
+ };
+ using CompletionCallback =
+ std::function<void(std::shared_future<void> waitForGpu)>;
+ PostCmd cmd;
+ int composeVersion;
+ std::vector<char> composeBuffer;
+ std::unique_ptr<CompletionCallback> completionCallback = nullptr;
+ std::unique_ptr<Block> block = nullptr;
+ HandleType cbHandle = 0;
+ union {
+ ColorBuffer* cb;
+ struct {
+ int width;
+ int height;
+ } viewport;
+ struct {
+ ColorBuffer* cb;
+ int screenwidth;
+ int screenheight;
+ GLenum format;
+ GLenum type;
+ int rotation;
+ void* pixels;
+ Rect rect;
+ } screenshot;
+ };
+};
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/PostWorker.cpp b/src/gfxstream/host/PostWorker.cpp
new file mode 100644
index 00000000000..a06ec8d4f76
--- /dev/null
+++ b/src/gfxstream/host/PostWorker.cpp
@@ -0,0 +1,208 @@
+/*
+* 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.
+*/
+#include "PostWorker.h"
+
+#include <string.h>
+
+#include <chrono>
+
+#include "ColorBuffer.h"
+#include "FrameBuffer.h"
+#include "RenderThreadInfo.h"
+#include "aemu/base/Tracing.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+#include "host-common/misc.h"
+#include "vulkan/VkCommonOperations.h"
+
+#define POST_DEBUG 0
+#if POST_DEBUG >= 1
+#define DD(fmt, ...) \
+ fprintf(stderr, "%s:%d| " fmt, __func__, __LINE__, ##__VA_ARGS__)
+#else
+#define DD(fmt, ...) (void)0
+#endif
+
+#define POST_ERROR(fmt, ...) \
+ do { \
+ fprintf(stderr, "%s(%s:%d): " fmt "\n", __func__, __FILE__, __LINE__, \
+ ##__VA_ARGS__); \
+ fflush(stderr); \
+ } while (0)
+
+static void sDefaultRunOnUiThread(UiUpdateFunc f, void* data, bool wait) {
+ (void)f;
+ (void)data;
+ (void)wait;
+}
+
+namespace gfxstream {
+namespace {
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+hwc_transform_t getTransformFromRotation(int rotation) {
+ switch (static_cast<int>(rotation / 90)) {
+ case 1:
+ return HWC_TRANSFORM_ROT_270;
+ case 2:
+ return HWC_TRANSFORM_ROT_180;
+ case 3:
+ return HWC_TRANSFORM_ROT_90;
+ default:
+ return HWC_TRANSFORM_NONE;
+ }
+}
+
+} // namespace
+
+PostWorker::PostWorker(bool mainThreadPostingOnly, FrameBuffer* fb, Compositor* compositor)
+ : mFb(fb),
+ m_mainThreadPostingOnly(mainThreadPostingOnly),
+ m_runOnUiThread(m_mainThreadPostingOnly ? emugl::get_emugl_window_operations().runOnUiThread
+ : sDefaultRunOnUiThread),
+ m_compositor(compositor) {}
+
+std::shared_future<void> PostWorker::composeImpl(const FlatComposeRequest& composeRequest) {
+ std::shared_future<void> completedFuture =
+ std::async(std::launch::deferred, [] {}).share();
+ completedFuture.wait();
+
+ if (!isComposeTargetReady(composeRequest.targetHandle)) {
+ ERR("The last composition on the target buffer hasn't completed.");
+ }
+
+ Compositor::CompositionRequest compositorRequest = {};
+ compositorRequest.target = mFb->borrowColorBufferForComposition(composeRequest.targetHandle,
+ /*colorBufferIsTarget=*/true);
+ if (!compositorRequest.target) {
+ ERR("Compose target is null (cb=0x%x).", composeRequest.targetHandle);
+ return completedFuture;
+ }
+
+ for (const ComposeLayer& guestLayer : composeRequest.layers) {
+ if (guestLayer.composeMode == HWC2_COMPOSITION_SOLID_COLOR) {
+ // HWC2_COMPOSITION_SOLID_COLOR has no colorbuffer backing.
+ auto& compositorLayer = compositorRequest.layers.emplace_back();
+ compositorLayer.props = guestLayer;
+ } else {
+ auto source = mFb->borrowColorBufferForComposition(guestLayer.cbHandle,
+ /*colorBufferIsTarget=*/false);
+ if (!source) {
+ continue;
+ }
+
+ auto& compositorLayer = compositorRequest.layers.emplace_back();
+ compositorLayer.props = guestLayer;
+ compositorLayer.source = std::move(source);
+ }
+ }
+
+ return m_compositor->compose(compositorRequest);
+}
+
+void PostWorker::block(std::promise<void> scheduledSignal, std::future<void> continueSignal) {
+ // Do not block mainthread.
+ if (m_mainThreadPostingOnly) {
+ return;
+ }
+ // MSVC STL doesn't support not copyable std::packaged_task. As a workaround, we use the
+ // copyable std::shared_ptr here.
+ auto block = std::make_shared<Post::Block>(Post::Block{
+ .scheduledSignal = std::move(scheduledSignal),
+ .continueSignal = std::move(continueSignal),
+ });
+ runTask(std::packaged_task<void()>([block] {
+ block->scheduledSignal.set_value();
+ block->continueSignal.wait();
+ }));
+}
+
+PostWorker::~PostWorker() {}
+
+void PostWorker::post(ColorBuffer* cb, std::unique_ptr<Post::CompletionCallback> postCallback) {
+ auto packagedPostCallback = std::shared_ptr<Post::CompletionCallback>(std::move(postCallback));
+ runTask(
+ std::packaged_task<void()>([cb, packagedPostCallback, this] {
+ auto completedFuture = postImpl(cb);
+ (*packagedPostCallback)(completedFuture);
+ }));
+}
+
+void PostWorker::exit() {
+ runTask(std::packaged_task<void()>([this] { exitImpl(); }));
+}
+
+void PostWorker::viewport(int width, int height) {
+ runTask(std::packaged_task<void()>(
+ [width, height, this] { viewportImpl(width, height); }));
+}
+
+void PostWorker::compose(std::unique_ptr<FlatComposeRequest> composeRequest,
+ std::unique_ptr<Post::CompletionCallback> composeCallback) {
+ // std::shared_ptr(std::move(...)) is WA for MSFT STL implementation bug:
+ // https://developercommunity.visualstudio.com/t/unable-to-move-stdpackaged-task-into-any-stl-conta/108672
+ auto packagedComposeCallback =
+ std::shared_ptr<Post::CompletionCallback>(std::move(composeCallback));
+ auto packagedComposeRequest = std::shared_ptr<FlatComposeRequest>(std::move(composeRequest));
+ runTask(
+ std::packaged_task<void()>([packagedComposeCallback, packagedComposeRequest, this] {
+ auto completedFuture = composeImpl(*packagedComposeRequest);
+ m_composeTargetToComposeFuture.emplace(packagedComposeRequest->targetHandle,
+ completedFuture);
+ (*packagedComposeCallback)(completedFuture);
+ }));
+}
+
+void PostWorker::clear() {
+ runTask(std::packaged_task<void()>([this] { clearImpl(); }));
+}
+
+void PostWorker::runTask(std::packaged_task<void()> task) {
+ using Task = std::packaged_task<void()>;
+ auto taskPtr = std::make_unique<Task>(std::move(task));
+ if (m_mainThreadPostingOnly) {
+ m_runOnUiThread(
+ [](void* data) {
+ std::unique_ptr<Task> taskPtr(reinterpret_cast<Task*>(data));
+ (*taskPtr)();
+ },
+ taskPtr.release(), false);
+ } else {
+ (*taskPtr)();
+ }
+}
+
+bool PostWorker::isComposeTargetReady(uint32_t targetHandle) {
+ // Even if the target ColorBuffer has already been destroyed, the compose future should have
+ // been waited and set to the ready state.
+ for (auto i = m_composeTargetToComposeFuture.begin();
+ i != m_composeTargetToComposeFuture.end();) {
+ auto& composeFuture = i->second;
+ if (composeFuture.wait_for(std::chrono::seconds(0)) == std::future_status::ready) {
+ i = m_composeTargetToComposeFuture.erase(i);
+ } else {
+ i++;
+ }
+ }
+ if (m_composeTargetToComposeFuture.find(targetHandle) == m_composeTargetToComposeFuture.end()) {
+ return true;
+ }
+ return false;
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/PostWorker.h b/src/gfxstream/host/PostWorker.h
new file mode 100644
index 00000000000..1cfe1053e1b
--- /dev/null
+++ b/src/gfxstream/host/PostWorker.h
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ */
+#pragma once
+
+#include <functional>
+#include <future>
+#include <optional>
+#include <unordered_map>
+#include <vector>
+
+#include "Compositor.h"
+#include "ContextHelper.h"
+#include "Hwc2.h"
+#include "PostCommands.h"
+#include "aemu/base/Compiler.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/synchronization/MessageChannel.h"
+#include "host-common/window_agent.h"
+
+namespace gfxstream {
+class ColorBuffer;
+class FrameBuffer;
+struct RenderThreadInfo;
+
+class PostWorker {
+ public:
+ PostWorker(bool mainThreadPostingOnly, FrameBuffer* fb, Compositor* compositor);
+ virtual ~PostWorker();
+
+ // post: posts the next color buffer.
+ // Assumes framebuffer lock is held.
+ void post(ColorBuffer* cb, std::unique_ptr<Post::CompletionCallback> postCallback);
+
+ // viewport: (re)initializes viewport dimensions.
+ // Assumes framebuffer lock is held.
+ // This is called whenever the subwindow needs a refresh
+ // (FrameBuffer::setupSubWindow).
+ void viewport(int width, int height);
+
+ // compose: compse the layers into final framebuffer. The callback will be
+ // called when the CPU side job completes. The passed in future in the
+ // callback will be completed when the GPU opereation completes.
+ void compose(std::unique_ptr<FlatComposeRequest> composeRequest,
+ std::unique_ptr<Post::CompletionCallback> composeCallback);
+
+ // clear: blanks out emulator display when refreshing the subwindow
+ // if there is no last posted color buffer to show yet.
+ void clear();
+
+ virtual void screenshot(ColorBuffer* cb, int screenwidth, int screenheight, GLenum format,
+ GLenum type, int skinRotation, void* pixels, Rect rect) = 0;
+
+ // The block task will set the scheduledSignal promise when the task is scheduled, and wait
+ // until continueSignal is ready before completes.
+ void block(std::promise<void> scheduledSignal, std::future<void> continueSignal);
+
+ // Exit post worker, unbind gl context if necessary.
+ void exit();
+
+ protected:
+ void runTask(std::packaged_task<void()>);
+ // Impl versions of the above, so we can run it from separate threads
+ virtual std::shared_future<void> postImpl(ColorBuffer* cb) = 0;
+ virtual void viewportImpl(int width, int height) = 0;
+ virtual void clearImpl() = 0;
+ virtual void exitImpl() = 0;
+ virtual std::shared_future<void> composeImpl(const FlatComposeRequest& composeRequest);
+
+ protected:
+ FrameBuffer* mFb;
+ Compositor* m_compositor = nullptr;
+
+ protected:
+ // If m_mainThreadPostingOnly is true, schedule the task to UI thread by
+ // using m_runOnUiThread. Otherwise, execute the task on the current thread.
+ bool m_mainThreadPostingOnly = false;
+
+ private:
+ using UiThreadRunner = std::function<void(UiUpdateFunc, void*, bool)>;
+
+ UiThreadRunner m_runOnUiThread = 0;
+
+ std::unordered_map<uint32_t, std::shared_future<void>> m_composeTargetToComposeFuture;
+
+ bool isComposeTargetReady(uint32_t targetHandle);
+
+ DISALLOW_COPY_AND_ASSIGN(PostWorker);
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/PostWorkerGl.cpp b/src/gfxstream/host/PostWorkerGl.cpp
new file mode 100644
index 00000000000..7d630e7bdee
--- /dev/null
+++ b/src/gfxstream/host/PostWorkerGl.cpp
@@ -0,0 +1,321 @@
+/*
+ * 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 "PostWorkerGl.h"
+
+#include "FrameBuffer.h"
+#include "gl/DisplayGl.h"
+#include "gl/DisplaySurfaceGl.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+#include "host-common/misc.h"
+
+namespace gfxstream {
+
+namespace {
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+using gl::DisplayGl;
+using gl::DisplaySurfaceGl;
+using gl::EmulationGl;
+using gl::s_egl;
+
+hwc_transform_t getTransformFromRotation(int rotation) {
+ switch (static_cast<int>(rotation / 90)) {
+ case 1:
+ return HWC_TRANSFORM_ROT_270;
+ case 2:
+ return HWC_TRANSFORM_ROT_180;
+ case 3:
+ return HWC_TRANSFORM_ROT_90;
+ default:
+ return HWC_TRANSFORM_NONE;
+ }
+}
+
+} // namespace
+
+PostWorkerGl::PostWorkerGl(bool mainThreadPostingOnly, FrameBuffer* fb, Compositor* compositor,
+ DisplayGl* displayGl, gl::EmulationGl* emulationGl)
+ : PostWorker(mainThreadPostingOnly, fb, compositor),
+ m_displayGl(displayGl),
+ mEmulationGl(emulationGl) {
+ if (!m_displayGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "PostWorker missing DisplayGl.";
+ }
+}
+
+void PostWorkerGl::screenshot(ColorBuffer* cb, int screenwidth, int screenheight, GLenum format,
+ GLenum type, int skinRotation, void* pixels, Rect rect) {
+ // See b/292237104.
+ mFb->lock();
+ cb->readToBytesScaled(screenwidth, screenheight, format, type, skinRotation, rect, pixels);
+ mFb->unlock();
+}
+
+std::shared_future<void> PostWorkerGl::postImpl(ColorBuffer* cb) {
+ if (!mContextBound || m_mainThreadPostingOnly) {
+ // This might happen on headless mode
+ // Also if posting on main thread, the context binding can get polluted easily, which
+ // requires frequent rebinds.
+ setupContext();
+ }
+ std::shared_future<void> completedFuture = std::async(std::launch::deferred, [] {}).share();
+ completedFuture.wait();
+
+ DisplayGl::Post post = {};
+
+ ComposeLayer postLayerOptions = {
+ .composeMode = HWC2_COMPOSITION_DEVICE,
+ .blendMode = HWC2_BLEND_MODE_NONE,
+ .alpha = 1.0f,
+ .transform = HWC_TRANSFORM_NONE,
+ };
+
+ const auto& multiDisplay = emugl::get_emugl_multi_display_operations();
+ const bool pixel_fold = multiDisplay.isPixelFold();
+ if (pixel_fold) {
+ post.layers.push_back(postWithOverlay(cb));
+ }
+ else if (multiDisplay.isMultiDisplayEnabled()) {
+ if (multiDisplay.isMultiDisplayWindow()) {
+ int32_t previousDisplayId = -1;
+ uint32_t currentDisplayId;
+ uint32_t currentDisplayColorBufferHandle;
+ while (multiDisplay.getNextMultiDisplay(previousDisplayId, &currentDisplayId,
+ /*x=*/nullptr,
+ /*y=*/nullptr,
+ /*w=*/nullptr,
+ /*h=*/nullptr,
+ /*dpi=*/nullptr,
+ /*flags=*/nullptr,
+ &currentDisplayColorBufferHandle)) {
+ previousDisplayId = currentDisplayId;
+
+ if (currentDisplayColorBufferHandle == 0) {
+ continue;
+ }
+ emugl::get_emugl_window_operations().paintMultiDisplayWindow(
+ currentDisplayId, currentDisplayColorBufferHandle);
+ }
+ post.layers.push_back(postWithOverlay(cb));
+ } else {
+ uint32_t combinedDisplayW = 0;
+ uint32_t combinedDisplayH = 0;
+ multiDisplay.getCombinedDisplaySize(&combinedDisplayW, &combinedDisplayH);
+
+ post.frameWidth = combinedDisplayW;
+ post.frameHeight = combinedDisplayH;
+
+ int32_t previousDisplayId = -1;
+ uint32_t currentDisplayId;
+ int32_t currentDisplayOffsetX;
+ int32_t currentDisplayOffsetY;
+ uint32_t currentDisplayW;
+ uint32_t currentDisplayH;
+ uint32_t currentDisplayColorBufferHandle;
+ while (multiDisplay.getNextMultiDisplay(
+ previousDisplayId, &currentDisplayId, &currentDisplayOffsetX,
+ &currentDisplayOffsetY, &currentDisplayW, &currentDisplayH,
+ /*dpi=*/nullptr,
+ /*flags=*/nullptr, &currentDisplayColorBufferHandle)) {
+ previousDisplayId = currentDisplayId;
+
+ if (currentDisplayW == 0 || currentDisplayH == 0 ||
+ (currentDisplayId != 0 && currentDisplayColorBufferHandle == 0)) {
+ continue;
+ }
+
+ ColorBuffer* currentCb =
+ currentDisplayId == 0
+ ? cb
+ : mFb->findColorBuffer(currentDisplayColorBufferHandle).get();
+ if (!currentCb) {
+ continue;
+ }
+
+ const auto transform = getTransformFromRotation(mFb->getZrot());
+ postLayerOptions.transform = transform;
+ if ( transform == HWC_TRANSFORM_ROT_90 || transform == HWC_TRANSFORM_ROT_270) {
+ std::swap(currentDisplayW, currentDisplayH);
+ }
+ postLayerOptions.displayFrame = {
+ .left = static_cast<int>(currentDisplayOffsetX),
+ .top = static_cast<int>(currentDisplayOffsetY),
+ .right = static_cast<int>(currentDisplayOffsetX + currentDisplayW),
+ .bottom = static_cast<int>(currentDisplayOffsetY + currentDisplayH),
+ };
+ postLayerOptions.crop = {
+ .left = 0.0f,
+ .top = static_cast<float>(currentCb->getHeight()),
+ .right = static_cast<float>(currentCb->getWidth()),
+ .bottom = 0.0f,
+ };
+
+ post.layers.push_back(DisplayGl::PostLayer{
+ .colorBuffer = currentCb,
+ .layerOptions = postLayerOptions,
+ });
+ }
+ }
+ } else if (emugl::get_emugl_window_operations().isFolded()) {
+ const float dpr = mFb->getDpr();
+
+ post.frameWidth = m_viewportWidth / dpr;
+ post.frameHeight = m_viewportHeight / dpr;
+
+ int displayOffsetX;
+ int displayOffsetY;
+ int displayW;
+ int displayH;
+ emugl::get_emugl_window_operations().getFoldedArea(&displayOffsetX, &displayOffsetY,
+ &displayW, &displayH);
+
+ postLayerOptions.displayFrame = {
+ .left = 0,
+ .top = 0,
+ .right = mFb->windowWidth(),
+ .bottom = mFb->windowHeight(),
+ };
+ postLayerOptions.crop = {
+ .left = static_cast<float>(displayOffsetX),
+ .top = static_cast<float>(displayOffsetY + displayH),
+ .right = static_cast<float>(displayOffsetX + displayW),
+ .bottom = static_cast<float>(displayOffsetY),
+ };
+ postLayerOptions.transform = getTransformFromRotation(mFb->getZrot());
+
+ post.layers.push_back(DisplayGl::PostLayer{
+ .colorBuffer = cb,
+ .layerOptions = postLayerOptions,
+ });
+ } else {
+ post.layers.push_back(postWithOverlay(cb));
+ }
+ return m_displayGl->post(post);
+}
+
+DisplayGl::PostLayer PostWorkerGl::postWithOverlay(ColorBuffer* cb) {
+ float dpr = mFb->getDpr();
+ int windowWidth = mFb->windowWidth();
+ int windowHeight = mFb->windowHeight();
+ float px = mFb->getPx();
+ float py = mFb->getPy();
+ int zRot = mFb->getZrot();
+ hwc_transform_t rotation = (hwc_transform_t)0;
+
+ // Find the x and y values at the origin when "fully scrolled."
+ // Multiply by 2 because the texture goes from -1 to 1, not 0 to 1.
+ // Multiply the windowing coordinates by DPR because they ignore
+ // DPR, but the viewport includes DPR.
+ float fx = 2.f * (m_viewportWidth - windowWidth * dpr) / (float)m_viewportWidth;
+ float fy = 2.f * (m_viewportHeight - windowHeight * dpr) / (float)m_viewportHeight;
+
+ // finally, compute translation values
+ float dx = px * fx;
+ float dy = py * fy;
+
+ return DisplayGl::PostLayer{
+ .colorBuffer = cb,
+ .overlayOptions =
+ DisplayGl::PostLayer::OverlayOptions{
+ .rotation = static_cast<float>(zRot),
+ .dx = dx,
+ .dy = dy,
+ },
+ };
+}
+
+// Called whenever the subwindow needs a refresh (FrameBuffer::setupSubWindow).
+// This rebinds the subwindow context (to account for
+// when the refresh is a display change, for instance)
+// and resets the posting viewport.
+void PostWorkerGl::viewportImpl(int width, int height) {
+ setupContext();
+ const float dpr = mFb->getDpr();
+ m_viewportWidth = width * dpr;
+ m_viewportHeight = height * dpr;
+
+ if (!m_displayGl) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "PostWorker missing DisplayGl.";
+ }
+ m_displayGl->viewport(m_viewportWidth, m_viewportHeight);
+}
+
+// Called when the subwindow refreshes, but there is no
+// last posted color buffer to show to the user. Instead of
+// displaying whatever happens to be in the back buffer,
+// clear() is useful for outputting consistent colors.
+void PostWorkerGl::clearImpl() {
+ if (!mContextBound || m_mainThreadPostingOnly) {
+ // This might happen on headless mode
+ setupContext();
+ }
+ m_displayGl->clear();
+}
+
+std::shared_future<void> PostWorkerGl::composeImpl(const FlatComposeRequest& composeRequest) {
+ if (!mContextBound || m_mainThreadPostingOnly) {
+ // This might happen on headless mode
+ setupContext();
+ }
+ return PostWorker::composeImpl(composeRequest);
+}
+
+void PostWorkerGl::setupContext() {
+ android::base::AutoLock lock(mMutex);
+ const auto* surface = getBoundSurface();
+ const DisplaySurfaceGl* surfaceGl = nullptr;
+ if (surface) {
+ surfaceGl = static_cast<const DisplaySurfaceGl*>(surface->getImpl());
+ } else {
+ // Create a fake context.
+ // This could happen in AEMU with -qt-hide-window. Also due to an Intel bug
+ // this needs to happen on post thread.
+ // b/274313125
+ if (!mFakeWindowSurface) {
+ mFakeWindowSurface = mEmulationGl->createFakeWindowSurface();
+ }
+ if (!mFakeWindowSurface) {
+ ERR("Post worker does not have a window surface.");
+ return;
+ }
+ surfaceGl = static_cast<const DisplaySurfaceGl*>(mFakeWindowSurface->getImpl());
+ }
+
+ // It will be no-op if it rebinds to the same context.
+ // We need to retry just in case the surface is changed.
+
+ // Also we could not use the scope context helper here,
+ // because (1) binds and unbinds happen in very different places;
+ // (2) they both need to happen in post thread, but the d'tor
+ // of PostWorker can happen in a different thread.
+ if (!surfaceGl->bindContext()) {
+ ERR("Failed to bind to post worker context.");
+ return;
+ }
+ mContextBound = true;
+}
+
+void PostWorkerGl::exitImpl() {
+ if (!mContextBound) {
+ return;
+ }
+ s_egl.eglMakeCurrent(s_egl.eglGetDisplay(EGL_DEFAULT_DISPLAY), nullptr, nullptr, nullptr);
+ mContextBound = false;
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/PostWorkerGl.h b/src/gfxstream/host/PostWorkerGl.h
new file mode 100644
index 00000000000..ab2f947d6bb
--- /dev/null
+++ b/src/gfxstream/host/PostWorkerGl.h
@@ -0,0 +1,71 @@
+/*
+ * 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 <future>
+#include <optional>
+
+#include "DisplaySurfaceUser.h"
+#include "PostWorker.h"
+#include "gl/DisplayGl.h"
+#include "gl/EmulationGl.h"
+
+namespace gfxstream {
+
+class RecursiveScopedContextBind;
+
+namespace gl {
+class DisplayGl;
+class EmulationGl;
+} // namespace gl
+
+class PostWorkerGl : public PostWorker, public DisplaySurfaceUser {
+ public:
+ PostWorkerGl(bool mainThreadPostingOnly, FrameBuffer* fb, Compositor* compositor,
+ gl::DisplayGl* displayGl, gl::EmulationGl* emulationGl);
+
+ void screenshot(ColorBuffer* cb, int screenwidth, int screenheight, GLenum format, GLenum type,
+ int skinRotation, void* pixels, Rect rect) override;
+
+ protected:
+ std::shared_future<void> postImpl(ColorBuffer* cb) override;
+ void viewportImpl(int width, int height) override;
+ void clearImpl() override;
+ void exitImpl() override;
+ std::shared_future<void> composeImpl(const FlatComposeRequest& composeRequest) override;
+
+ void bindToSurfaceImpl(gfxstream::DisplaySurface* surface) override {}
+ void surfaceUpdated(gfxstream::DisplaySurface* surface) override {}
+ void unbindFromSurfaceImpl() override {}
+
+ private:
+ void setupContext();
+ gl::DisplayGl::PostLayer postWithOverlay(ColorBuffer* cb);
+
+ private:
+ // TODO(b/233939967): conslidate DisplayGl and DisplayVk into
+ // `Display* const m_display`.
+ gl::DisplayGl* const m_displayGl;
+
+ int m_viewportWidth = 0;
+ int m_viewportHeight = 0;
+
+ bool mContextBound = false;
+ std::unique_ptr<gfxstream::DisplaySurface> mFakeWindowSurface = nullptr;
+ gl::EmulationGl* mEmulationGl;
+};
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/ProcessResources.h b/src/gfxstream/host/ProcessResources.h
new file mode 100644
index 00000000000..f90d49b1075
--- /dev/null
+++ b/src/gfxstream/host/ProcessResources.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _PROCESS_RESOURCES_H
+#define _PROCESS_RESOURCES_H
+
+#include <atomic>
+#include <memory>
+
+namespace gfxstream {
+
+class ProcessResources {
+ public:
+ // We only allow ProcessResources to be created on the heap, because the pointer to
+ // mSequenceNumber shouldn't change until ProcessResources is destroyed.
+ static std::unique_ptr<ProcessResources> create() {
+ return std::unique_ptr<ProcessResources>(new ProcessResources());
+ }
+ DISALLOW_COPY_ASSIGN_AND_MOVE(ProcessResources);
+
+ ~ProcessResources() = default;
+ std::atomic<uint32_t>* getSequenceNumberPtr() const { return &mSequenceNumber; }
+
+ private:
+ ProcessResources() : mSequenceNumber(0) {}
+ mutable std::atomic<uint32_t> mSequenceNumber;
+};
+
+} // namespace gfxstream
+#endif
diff --git a/src/gfxstream/host/ReadBuffer.cpp b/src/gfxstream/host/ReadBuffer.cpp
new file mode 100644
index 00000000000..32382eb94a0
--- /dev/null
+++ b/src/gfxstream/host/ReadBuffer.cpp
@@ -0,0 +1,138 @@
+/*
+* 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 "ReadBuffer.h"
+
+#include "host-common/logging.h"
+
+#include <algorithm>
+
+#include <assert.h>
+#include <string.h>
+#include <limits.h>
+
+namespace gfxstream {
+
+ReadBuffer::ReadBuffer(size_t bufsize) {
+ m_size = bufsize;
+ m_buf = (unsigned char*)malloc(m_size);
+ m_validData = 0;
+ m_readPtr = m_buf;
+}
+
+ReadBuffer::~ReadBuffer() {
+ free(m_buf);
+}
+
+void ReadBuffer::setNeededFreeTailSize(size_t size) {
+ m_neededFreeTailSize = size;
+}
+
+int ReadBuffer::getData(IOStream* stream, size_t minSize) {
+ assert(stream);
+ assert(minSize > m_validData);
+
+ const size_t minSizeToRead = minSize - m_validData;
+ const size_t neededFreeTailThisTime =
+ std::max(minSizeToRead,
+ m_neededFreeTailSize);
+
+ size_t maxSizeToRead;
+ const size_t freeTailSize = m_buf + m_size - (m_readPtr + m_validData);
+ if (freeTailSize >= neededFreeTailThisTime) {
+ maxSizeToRead = freeTailSize;
+ } else {
+ if (freeTailSize + (m_readPtr - m_buf) >= neededFreeTailThisTime) {
+ // There's some gap in the beginning, if we move the data over it
+ // that's going to be enough.
+ memmove(m_buf, m_readPtr, m_validData);
+ } else {
+ // Not enough space even with moving, reallocate.
+ // Note: make sure we can fit at least two of the requested packets
+ // into the new buffer to minimize the reallocations and
+ // memmove()-ing stuff around.
+ size_t new_size = std::max(2 * minSizeToRead + m_validData, 2 * m_size);
+ if (new_size < m_size) { // overflow check
+ new_size = INT_MAX;
+ }
+
+ const auto new_buf = (unsigned char*)malloc(new_size);
+ if (!new_buf) {
+ ERR("Failed to alloc %zu bytes for ReadBuffer\n", new_size);
+ return -1;
+ }
+
+ memcpy(new_buf, m_readPtr, m_validData);
+ free(m_buf);
+ m_buf = new_buf;
+ m_size = new_size;
+ }
+ // We can read more now, let's request it in case all data is ready
+ // for reading.
+ maxSizeToRead = m_size - m_validData;
+ m_readPtr = m_buf;
+ }
+
+ // get fresh data into the buffer;
+ int readTotal = 0;
+ do {
+ const size_t readNow = stream->read(m_readPtr + m_validData,
+ maxSizeToRead - readTotal);
+
+ if (!readNow) {
+ if (readTotal > 0) {
+ return readTotal;
+ } else {
+ return -1;
+ }
+ }
+ readTotal += readNow;
+ m_validData += readNow;
+ } while (readTotal < minSizeToRead);
+
+ return readTotal;
+}
+
+void ReadBuffer::consume(size_t amount) {
+ assert(amount <= m_validData);
+ m_validData -= amount;
+ m_readPtr += amount;
+}
+
+void ReadBuffer::onSave(android::base::Stream* stream) {
+ stream->putBe32(m_size);
+ stream->putBe32(m_validData);
+ stream->write(m_readPtr, m_validData);
+}
+
+void ReadBuffer::onLoad(android::base::Stream* stream) {
+ const auto size = stream->getBe32();
+ if (size > m_size) {
+ m_size = size;
+ free(m_buf);
+ m_buf = (unsigned char*)malloc(m_size);
+ }
+ m_readPtr = m_buf;
+ m_validData = stream->getBe32();
+ assert(m_validData <= m_size);
+ stream->read(m_readPtr, m_validData);
+}
+
+void ReadBuffer::printStats() {
+ printf("ReadBuffer::%s: tail move time %f ms\n", __func__,
+ (float)m_tailMoveTimeUs / 1000.0f);
+ m_tailMoveTimeUs = 0;
+}
+} // namespace gfxstream
diff --git a/src/gfxstream/host/ReadBuffer.h b/src/gfxstream/host/ReadBuffer.h
new file mode 100644
index 00000000000..fb0c56f3510
--- /dev/null
+++ b/src/gfxstream/host/ReadBuffer.h
@@ -0,0 +1,47 @@
+/*
+* 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.
+*/
+#pragma once
+#include "aemu/base/files/Stream.h"
+#include "render-utils/IOStream.h"
+
+namespace gfxstream {
+
+class ReadBuffer {
+public:
+ explicit ReadBuffer(size_t bufSize);
+ ~ReadBuffer();
+
+ void setNeededFreeTailSize(size_t size);
+ int getData(IOStream *stream, size_t minSize); // get fresh data from the stream
+ unsigned char *buf() { return m_readPtr; } // return the next read location
+ size_t validData() const { return m_validData; } // return the amount of valid data in readptr
+ void consume(size_t amount); // notify that 'amount' data has been consumed;
+
+ void onLoad(android::base::Stream* stream);
+ void onSave(android::base::Stream* stream);
+
+ void printStats();
+private:
+ unsigned char *m_buf;
+ unsigned char *m_readPtr;
+ size_t m_size;
+ size_t m_validData;
+
+ uint64_t m_tailMoveTimeUs = 0;
+ size_t m_neededFreeTailSize = 0;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/ReadbackWorker.h b/src/gfxstream/host/ReadbackWorker.h
new file mode 100644
index 00000000000..369a3bec405
--- /dev/null
+++ b/src/gfxstream/host/ReadbackWorker.h
@@ -0,0 +1,79 @@
+/*
+* 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.
+*/
+#pragma once
+
+namespace gfxstream {
+
+class ColorBuffer;
+
+// This class implements async readback of ColorBuffers on both the FrameBuffer
+// posting thread and a separate worker thread.
+class ReadbackWorker {
+ public:
+ virtual ~ReadbackWorker() = default;
+
+ virtual void init() = 0;
+
+ // Enables readback of the given display.
+ virtual void initReadbackForDisplay(uint32_t displayId, uint32_t w, uint32_t h) = 0;
+
+ // Enables readback of the given display.
+ virtual void deinitReadbackForDisplay(uint32_t displayId) = 0;
+
+ enum class DoNextReadbackResult {
+ OK_NOT_READY_FOR_READ,
+
+ OK_READY_FOR_READ,
+ };
+
+ // doNextReadback(): Call this from the emugl FrameBuffer::post thread
+ // or similar rendering thread.
+ // This will trigger an async glReadPixels of the current framebuffer.
+ // The post callback of Framebuffer will also be triggered, but
+ // in async mode it should do minimal work that involves |fbImage|.
+ // |repaint|: flag to prime async readback with multiple iterations
+ // so that the consumer of readback doesn't lag behind.
+ // |readbackBgra|: Whether to force the readback format as GL_BGRA_EXT,
+ // so that we get (depending on driver quality, heh) a gpu conversion of the
+ // readback image that is suitable for webrtc, which expects formats like that.
+ virtual DoNextReadbackResult doNextReadback(uint32_t displayId,
+ ColorBuffer* cb,
+ void* fbImage,
+ bool repaint,
+ bool readbackBgra) = 0;
+
+ // Retrieves the latest framebuffer that has been posted and read with
+ // doNextReadback. This is meant for apps like video encoding to use as
+ // input; they will need to do synchronized communication with the thread
+ // ReadbackWorker is running on.
+ virtual void getPixels(uint32_t displayId, void* out, uint32_t bytes) = 0;
+
+ // Duplicates the last frame and generates a post events if
+ // there are no read events active.
+ // This is usually called when there was no doNextReadback activity
+ // for a few ms, to guarantee that end users see the final frame.
+ enum class FlushResult {
+ FAIL,
+
+ OK_NOT_READY_FOR_READ,
+
+ OK_READY_FOR_READ,
+ };
+
+ virtual FlushResult flushPipeline(uint32_t displayId) = 0;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderChannelImpl.cpp b/src/gfxstream/host/RenderChannelImpl.cpp
new file mode 100644
index 00000000000..84144afe4b0
--- /dev/null
+++ b/src/gfxstream/host/RenderChannelImpl.cpp
@@ -0,0 +1,234 @@
+// 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 "RenderChannelImpl.h"
+
+#include "RenderThread.h"
+#include "aemu/base/synchronization/Lock.h"
+
+#include <algorithm>
+#include <utility>
+
+#include <assert.h>
+#include <string.h>
+
+#define EMUGL_DEBUG_LEVEL 0
+#include "host-common/debug.h"
+
+namespace gfxstream {
+
+using Buffer = RenderChannel::Buffer;
+using IoResult = android::base::BufferQueueResult;
+using State = RenderChannel::State;
+using AutoLock = android::base::AutoLock;
+
+// These constants correspond to the capacities of buffer queues
+// used by each RenderChannelImpl instance. Benchmarking shows that
+// it's important to have a large queue for guest -> host transfers,
+// but a much smaller one works for host -> guest ones.
+// Note: 32-bit Windows just doesn't have enough RAM to allocate optimal
+// capacity.
+#if defined(_WIN32) && !defined(_WIN64)
+static constexpr size_t kGuestToHostQueueCapacity = 32U;
+#else
+static constexpr size_t kGuestToHostQueueCapacity = 1024U;
+#endif
+static constexpr size_t kHostToGuestQueueCapacity = 16U;
+
+RenderChannelImpl::RenderChannelImpl(android::base::Stream* loadStream, uint32_t contextId)
+ : mFromGuest(kGuestToHostQueueCapacity, mLock),
+ mToGuest(kHostToGuestQueueCapacity, mLock) {
+ if (loadStream) {
+ mFromGuest.onLoadLocked(loadStream);
+ mToGuest.onLoadLocked(loadStream);
+ mState = (State)loadStream->getBe32();
+ mWantedEvents = (State)loadStream->getBe32();
+#ifndef NDEBUG
+ // Make sure we're in a consistent state after loading.
+ const auto state = mState;
+ updateStateLocked();
+ assert(state == mState);
+#endif
+ } else {
+ updateStateLocked();
+ }
+ mRenderThread.reset(new RenderThread(this, loadStream, contextId));
+ mRenderThread->start();
+}
+
+void RenderChannelImpl::setEventCallback(EventCallback&& callback) {
+ mEventCallback = std::move(callback);
+ notifyStateChangeLocked();
+}
+
+void RenderChannelImpl::setWantedEvents(State state) {
+ D("state=%d", (int)state);
+ AutoLock lock(mLock);
+ mWantedEvents |= state;
+ notifyStateChangeLocked();
+}
+
+RenderChannel::State RenderChannelImpl::state() const {
+ AutoLock lock(mLock);
+ return mState;
+}
+
+IoResult RenderChannelImpl::tryWrite(Buffer&& buffer) {
+ D("buffer size=%d", (int)buffer.size());
+ AutoLock lock(mLock);
+ auto result = mFromGuest.tryPushLocked(std::move(buffer));
+ updateStateLocked();
+ DD("mFromGuest.tryPushLocked() returned %d, state %d", (int)result,
+ (int)mState);
+ return result;
+}
+
+void RenderChannelImpl::waitUntilWritable() {
+ AutoLock lock(mLock);
+ mFromGuest.waitUntilPushableLocked();
+}
+
+IoResult RenderChannelImpl::tryRead(Buffer* buffer) {
+ D("enter");
+ AutoLock lock(mLock);
+ auto result = mToGuest.tryPopLocked(buffer);
+ updateStateLocked();
+ DD("mToGuest.tryPopLocked() returned %d, buffer size %d, state %d",
+ (int)result, (int)buffer->size(), (int)mState);
+ return result;
+}
+
+IoResult RenderChannelImpl::readBefore(Buffer* buffer, Duration waitUntilUs) {
+ D("enter");
+ AutoLock lock(mLock);
+ auto result = mToGuest.popLockedBefore(buffer, waitUntilUs);
+ updateStateLocked();
+ DD("mToGuest.popLockedBefore() returned %d, buffer size %d, state %d",
+ (int)result, (int)buffer->size(), (int)mState);
+ return result;
+}
+
+void RenderChannelImpl::waitUntilReadable() {
+ AutoLock lock(mLock);
+ mToGuest.waitUntilPopableLocked();
+}
+
+void RenderChannelImpl::stop() {
+ D("enter");
+ AutoLock lock(mLock);
+ mFromGuest.closeLocked();
+ mToGuest.closeLocked();
+ mEventCallback = [](State state) {};
+}
+
+bool RenderChannelImpl::writeToGuest(Buffer&& buffer) {
+ D("buffer size=%d", (int)buffer.size());
+ AutoLock lock(mLock);
+ IoResult result = mToGuest.pushLocked(std::move(buffer));
+ updateStateLocked();
+ D("mToGuest.pushLocked() returned %d, state %d", (int)result, (int)mState);
+ notifyStateChangeLocked();
+ return result == IoResult::Ok;
+}
+
+IoResult RenderChannelImpl::readFromGuest(Buffer* buffer, bool blocking) {
+ D("enter");
+ AutoLock lock(mLock);
+ IoResult result;
+ if (blocking) {
+ result = mFromGuest.popLocked(buffer);
+ } else {
+ result = mFromGuest.tryPopLocked(buffer);
+ }
+ updateStateLocked();
+ DD("mFromGuest.%s() return %d, buffer size %d, state %d",
+ blocking ? "popLocked" : "tryPopLocked", (int)result,
+ (int)buffer->size(), (int)mState);
+ notifyStateChangeLocked();
+ return result;
+}
+
+void RenderChannelImpl::stopFromHost() {
+ D("enter");
+
+ AutoLock lock(mLock);
+ mFromGuest.closeLocked();
+ mToGuest.closeLocked();
+ mState |= State::Stopped;
+ notifyStateChangeLocked();
+ mEventCallback = [](State state) {};
+}
+
+bool RenderChannelImpl::isStopped() const {
+ AutoLock lock(mLock);
+ return (mState & State::Stopped) != 0;
+}
+
+RenderThread* RenderChannelImpl::renderThread() const {
+ return mRenderThread.get();
+}
+
+void RenderChannelImpl::pausePreSnapshot() {
+ AutoLock lock(mLock);
+ mFromGuest.setSnapshotModeLocked(true);
+ mToGuest.setSnapshotModeLocked(true);
+}
+
+void RenderChannelImpl::resume() {
+ AutoLock lock(mLock);
+ mFromGuest.setSnapshotModeLocked(false);
+ mToGuest.setSnapshotModeLocked(false);
+}
+
+RenderChannelImpl::~RenderChannelImpl() {
+ // Make sure the render thread is stopped before the channel is gone.
+ mRenderThread->wait();
+}
+
+void RenderChannelImpl::updateStateLocked() {
+ State state = RenderChannel::State::Empty;
+
+ if (mToGuest.canPopLocked()) {
+ state |= State::CanRead;
+ }
+ if (mFromGuest.canPushLocked()) {
+ state |= State::CanWrite;
+ }
+ if (mToGuest.isClosedLocked()) {
+ state |= State::Stopped;
+ }
+ mState = state;
+}
+
+void RenderChannelImpl::notifyStateChangeLocked() {
+ // Always report stop events, event if not explicitly asked for.
+ State available = mState & (mWantedEvents | State::Stopped);
+ if (available != 0) {
+ D("callback with %d", (int)available);
+ mWantedEvents &= ~mState;
+ mEventCallback(available);
+ }
+}
+
+void RenderChannelImpl::onSave(android::base::Stream* stream) {
+ D("enter");
+ AutoLock lock(mLock);
+ mFromGuest.onSaveLocked(stream);
+ mToGuest.onSaveLocked(stream);
+ stream->putBe32(static_cast<uint32_t>(mState));
+ stream->putBe32(static_cast<uint32_t>(mWantedEvents));
+ lock.unlock();
+ mRenderThread->save(stream);
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderChannelImpl.h b/src/gfxstream/host/RenderChannelImpl.h
new file mode 100644
index 00000000000..c7bffb1ab8e
--- /dev/null
+++ b/src/gfxstream/host/RenderChannelImpl.h
@@ -0,0 +1,123 @@
+// 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 "aemu/base/containers/BufferQueue.h"
+#include "render-utils/RenderChannel.h"
+#include "RendererImpl.h"
+
+namespace gfxstream {
+
+class RenderThread;
+
+using android::base::BufferQueue;
+
+// Implementation of the RenderChannel interface that connects a guest
+// client thread (really an AndroidPipe implementation) to a host
+// RenderThread instance.
+class RenderChannelImpl final : public RenderChannel {
+public:
+ explicit RenderChannelImpl(android::base::Stream* loadStream = nullptr,
+ uint32_t contextId = -1);
+ ~RenderChannelImpl();
+
+ /////////////////////////////////////////////////////////////////
+ // RenderChannel overriden methods. These are called from the guest
+ // client thread.
+
+ // Set the event |callback| to be notified when the host changes the
+ // state of the channel, according to the event mask provided by
+ // setWantedEvents(). Call this function right after creating the
+ // instance.
+ virtual void setEventCallback(EventCallback&& callback) override final;
+
+ // Set the mask of events the guest wants to be notified of from the
+ // host thread.
+ virtual void setWantedEvents(State state) override final;
+
+ // Return the current channel state relative to the guest.
+ virtual State state() const override final;
+
+ // Try to send a buffer from the guest to the host render thread.
+ virtual IoResult tryWrite(Buffer&& buffer) override final;
+
+ // Blocking call that waits until a buffer is ready to be sent from guest to host.
+ virtual void waitUntilWritable() override final;
+
+ // Try to read a buffer from the host render thread into the guest.
+ virtual IoResult tryRead(Buffer* buffer) override final;
+
+ // Read a buffer from the host render thread into the guest.
+ virtual IoResult readBefore(Buffer* buffer, Duration waitUntilUs) override final;
+
+ // Blocking call that waits until a buffer is ready to be read from host to guest.
+ virtual void waitUntilReadable() override final;
+
+ // Close the channel from the guest.
+ virtual void stop() override final;
+
+ // Callback function when snapshotting the virtual machine.
+ virtual void onSave(android::base::Stream* stream) override;
+
+ /////////////////////////////////////////////////////////////////
+ // These functions are called from the host render thread or renderer.
+
+ // Send a buffer to the guest, this call is blocking. On success,
+ // move |buffer| into the channel and return true. On failure, return
+ // false (meaning that the channel was closed).
+ bool writeToGuest(Buffer&& buffer);
+
+ // Read data from the guest. If |blocking| is true, the call will be
+ // blocking. On success, move item into |*buffer| and return true. On
+ // failure, return IoResult::Error to indicate the channel was closed,
+ // or IoResult::TryAgain to indicate it was empty (this can happen only
+ // if |blocking| is false).
+ IoResult readFromGuest(Buffer* buffer, bool blocking);
+
+ // Close the channel from the host.
+ void stopFromHost();
+
+ // Check if either guest or host stopped the channel.
+ bool isStopped() const;
+
+ // Return the underlying render thread object.
+ RenderThread* renderThread() const;
+
+ // Pause normal operations and enter the snapshot mode. In snapshot mode
+ // RenderChannel is supposed to allow everyone to write data into the
+ // channel, but it should not return any data back. This way we can make
+ // sure all data at the snapshot time is here and is saved, and we won't
+ // miss some important rendering call.
+ void pausePreSnapshot();
+
+ // Resume the normal operation after saving or loading a snapshot.
+ void resume();
+
+private:
+ void updateStateLocked();
+ void notifyStateChangeLocked();
+
+ EventCallback mEventCallback;
+ std::unique_ptr<RenderThread> mRenderThread;
+
+ // A single lock to protect the state and the two buffer queues at the
+ // same time. NOTE: This needs to appear before the BufferQueue instances.
+ mutable android::base::Lock mLock;
+ State mState = State::Empty;
+ State mWantedEvents = State::Empty;
+ BufferQueue<RenderChannel::Buffer> mFromGuest;
+ BufferQueue<RenderChannel::Buffer> mToGuest;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderControl.cpp b/src/gfxstream/host/RenderControl.cpp
new file mode 100644
index 00000000000..698914c2c76
--- /dev/null
+++ b/src/gfxstream/host/RenderControl.cpp
@@ -0,0 +1,1639 @@
+/*
+* 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 "RenderControl.h"
+
+#include <inttypes.h>
+#include <string.h>
+
+#include <atomic>
+#include <limits>
+#include <memory>
+
+#include "ChecksumCalculatorThreadInfo.h"
+#include "FrameBuffer.h"
+#include "GLESVersionDetector.h"
+#include "OpenGLESDispatch/DispatchTables.h"
+#include "OpenGLESDispatch/EGLDispatch.h"
+#include "RenderThreadInfo.h"
+#include "RenderThreadInfoGl.h"
+#include "SyncThread.h"
+#include "aemu/base/Tracing.h"
+#include "host-common/feature_control.h"
+#include "host-common/logging.h"
+#include "host-common/misc.h"
+#include "host-common/opengl/misc.h"
+#include "host-common/sync_device.h"
+#include "host/compressedTextureFormats/AstcCpuDecompressor.h"
+#include "vulkan/VkCommonOperations.h"
+#include "vulkan/VkDecoderGlobalState.h"
+
+namespace gfxstream {
+
+using android::base::AutoLock;
+using android::base::Lock;
+using emugl::emugl_sync_device_exists;
+using emugl::emugl_sync_register_trigger_wait;
+using gl::EmulatedEglFenceSync;
+using gl::GLES_DISPATCH_MAX_VERSION_2;
+using gl::GLES_DISPATCH_MAX_VERSION_3_0;
+using gl::GLES_DISPATCH_MAX_VERSION_3_1;
+using gl::GLESApi;
+using gl::GLESApi_CM;
+using gl::GLESDispatchMaxVersion;
+using gl::RenderThreadInfoGl;
+
+#define DEBUG 0
+#define DEBUG_GRALLOC_SYNC 0
+#define DEBUG_EGL_SYNC 0
+
+#define RENDERCONTROL_DPRINT(...) \
+ do { \
+ if (DEBUG) { \
+ fprintf(stderr, __VA_ARGS__); \
+ } \
+ } while (0)
+
+#if DEBUG_GRALLOC_SYNC
+#define GRSYNC_DPRINT RENDERCONTROL_DPRINT
+#else
+#define GRSYNC_DPRINT(...)
+#endif
+
+#if DEBUG_EGL_SYNC
+#define EGLSYNC_DPRINT RENDERCONTROL_DPRINT
+#else
+#define EGLSYNC_DPRINT(...)
+#endif
+
+// GrallocSync is a class that helps to reflect the behavior of
+// gralloc_lock/gralloc_unlock on the guest.
+// If we don't use this, apps that use gralloc buffers (such as webcam)
+// will have out-of-order frames,
+// as GL calls from different threads in the guest
+// are allowed to arrive at the host in any ordering.
+class GrallocSync {
+public:
+ GrallocSync() {
+ // Having in-order webcam frames is nice, but not at the cost
+ // of potential deadlocks;
+ // we need to be careful of what situations in which
+ // we actually lock/unlock the gralloc color buffer.
+ //
+ // To avoid deadlock:
+ // we require rcColorBufferCacheFlush to be called
+ // whenever gralloc_lock is called on the guest,
+ // and we require rcUpdateWindowColorBuffer to be called
+ // whenever gralloc_unlock is called on the guest.
+ //
+ // Some versions of the system image optimize out
+ // the call to rcUpdateWindowColorBuffer in the case of zero
+ // width/height, but since we're using that as synchronization,
+ // that lack of calling can lead to a deadlock on the host
+ // in many situations
+ // (switching camera sides, exiting benchmark apps, etc).
+ // So, we put GrallocSync under the feature control.
+ mEnabled = feature_is_enabled(kFeature_GrallocSync);
+
+ // There are two potential tricky situations to handle:
+ // a. Multiple users of gralloc buffers that all want to
+ // call gralloc_lock. This is obeserved to happen on older APIs
+ // (<= 19).
+ // b. The pipe doesn't have to preserve ordering of the
+ // gralloc_lock and gralloc_unlock commands themselves.
+ //
+ // To handle a), notice the situation is one of one type of user
+ // needing multiple locks that needs to exclude concurrent use
+ // by another type of user. This maps well to a read/write lock,
+ // where gralloc_lock and gralloc_unlock users are readers
+ // and rcFlushWindowColorBuffer is the writer.
+ // From the perspective of the host preparing and posting
+ // buffers, these are indeed read/write operations.
+ //
+ // To handle b), we give up on locking when the state is observed
+ // to be bad. lockState tracks how many color buffer locks there are.
+ // If lockState < 0, it means we definitely have an unlock before lock
+ // sort of situation, and should give up.
+ lockState = 0;
+ }
+
+ // lockColorBufferPrepare is designed to handle
+ // gralloc_lock/unlock requests, and uses the read lock.
+ // When rcFlushWindowColorBuffer is called (when frames are posted),
+ // we use the write lock (see GrallocSyncPostLock).
+ void lockColorBufferPrepare() {
+ int newLockState = ++lockState;
+ if (mEnabled && newLockState == 1) {
+ mGrallocColorBufferLock.lockRead();
+ } else if (mEnabled) {
+ GRSYNC_DPRINT("warning: recursive/multiple locks from guest!");
+ }
+ }
+ void unlockColorBufferPrepare() {
+ int newLockState = --lockState;
+ if (mEnabled && newLockState == 0) mGrallocColorBufferLock.unlockRead();
+ }
+ android::base::ReadWriteLock mGrallocColorBufferLock;
+private:
+ bool mEnabled;
+ std::atomic<int> lockState;
+ DISALLOW_COPY_ASSIGN_AND_MOVE(GrallocSync);
+};
+
+class GrallocSyncPostLock : public android::base::AutoWriteLock {
+public:
+ GrallocSyncPostLock(GrallocSync& grallocsync) :
+ android::base::AutoWriteLock(grallocsync.mGrallocColorBufferLock) { }
+};
+
+static GrallocSync* sGrallocSync() {
+ static GrallocSync* g = new GrallocSync;
+ return g;
+}
+
+static const GLint rendererVersion = 1;
+
+// GLAsyncSwap version history:
+// "ANDROID_EMU_NATIVE_SYNC": original version
+// "ANDROIDEMU_native_sync_v2": +cleanup of sync objects
+// "ANDROIDEMU_native_sync_v3": EGL_KHR_wait_sync
+// "ANDROIDEMU_native_sync_v4": Correct eglGetSyncAttrib via rcIsSyncSignaled
+// (We need all the different strings to not be prefixes of any other
+// due to how they are checked for in the GL extensions on the guest)
+static const char* kAsyncSwapStrV2 = "ANDROID_EMU_native_sync_v2";
+static const char* kAsyncSwapStrV3 = "ANDROID_EMU_native_sync_v3";
+static const char* kAsyncSwapStrV4 = "ANDROID_EMU_native_sync_v4";
+
+// DMA version history:
+// "ANDROID_EMU_dma_v1": add dma device and rcUpdateColorBufferDMA and do
+// yv12 conversion on the GPU
+// "ANDROID_EMU_dma_v2": adds DMA support glMapBufferRange (and unmap)
+static const char* kDma1Str = "ANDROID_EMU_dma_v1";
+static const char* kDma2Str = "ANDROID_EMU_dma_v2";
+static const char* kDirectMemStr = "ANDROID_EMU_direct_mem";
+
+// GLESDynamicVersion: up to 3.1 so far
+static const char* kGLESDynamicVersion_2 = "ANDROID_EMU_gles_max_version_2";
+static const char* kGLESDynamicVersion_3_0 = "ANDROID_EMU_gles_max_version_3_0";
+static const char* kGLESDynamicVersion_3_1 = "ANDROID_EMU_gles_max_version_3_1";
+
+// HWComposer Host Composition
+static const char* kHostCompositionV1 = "ANDROID_EMU_host_composition_v1";
+static const char* kHostCompositionV2 = "ANDROID_EMU_host_composition_v2";
+
+// Vulkan
+static const char* kVulkanFeatureStr = "ANDROID_EMU_vulkan";
+static const char* kDeferredVulkanCommands = "ANDROID_EMU_deferred_vulkan_commands";
+static const char* kVulkanNullOptionalStrings = "ANDROID_EMU_vulkan_null_optional_strings";
+static const char* kVulkanCreateResourcesWithRequirements = "ANDROID_EMU_vulkan_create_resources_with_requirements";
+
+// treat YUV420_888 as NV21
+static const char* kYUV420888toNV21 = "ANDROID_EMU_YUV420_888_to_NV21";
+
+// Cache YUV frame
+static const char* kYUVCache = "ANDROID_EMU_YUV_Cache";
+
+// GL protocol v2
+static const char* kAsyncUnmapBuffer = "ANDROID_EMU_async_unmap_buffer";
+// Vulkan: Correct marshaling for ignored handles
+static const char* kVulkanIgnoredHandles = "ANDROID_EMU_vulkan_ignored_handles";
+
+// virtio-gpu-next
+static const char* kVirtioGpuNext = "ANDROID_EMU_virtio_gpu_next";
+
+// address space subdevices
+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 native sync
+static const char* kVirtioGpuNativeSync = "ANDROID_EMU_virtio_gpu_native_sync";
+
+// Struct defs for VK_KHR_shader_float16_int8
+static const char* kVulkanShaderFloat16Int8 = "ANDROID_EMU_vulkan_shader_float16_int8";
+
+// Async queue submit
+static const char* kVulkanAsyncQueueSubmit = "ANDROID_EMU_vulkan_async_queue_submit";
+
+// Host side tracing
+static const char* kHostSideTracing = "ANDROID_EMU_host_side_tracing";
+
+// Some frame commands we can easily make async
+// rcMakeCurrent
+// rcCompose
+// rcDestroySyncKHR
+static const char* kAsyncFrameCommands = "ANDROID_EMU_async_frame_commands";
+
+// Queue submit with commands
+static const char* kVulkanQueueSubmitWithCommands = "ANDROID_EMU_vulkan_queue_submit_with_commands";
+
+// Batched descriptor set update
+static const char* kVulkanBatchedDescriptorSetUpdate = "ANDROID_EMU_vulkan_batched_descriptor_set_update";
+
+// Synchronized glBufferData call
+static const char* kSyncBufferData = "ANDROID_EMU_sync_buffer_data";
+
+// Async vkQSRI
+static const char* kVulkanAsyncQsri = "ANDROID_EMU_vulkan_async_qsri";
+
+// Read color buffer DMA
+static const char* kReadColorBufferDma = "ANDROID_EMU_read_color_buffer_dma";
+
+// Multiple display configs
+static const char* kHWCMultiConfigs= "ANDROID_EMU_hwc_multi_configs";
+
+static constexpr const uint64_t kInvalidPUID = std::numeric_limits<uint64_t>::max();
+
+static void rcTriggerWait(uint64_t glsync_ptr,
+ uint64_t thread_ptr,
+ uint64_t timeline);
+
+void registerTriggerWait() {
+ emugl_sync_register_trigger_wait(rcTriggerWait);
+}
+
+static GLint rcGetRendererVersion()
+{
+ registerTriggerWait();
+
+ sGrallocSync();
+ return rendererVersion;
+}
+
+static EGLint rcGetEGLVersion(EGLint* major, EGLint* minor)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return EGL_FALSE;
+ }
+ fb->getEmulationGl().getEglVersion(major, minor);
+
+ return EGL_TRUE;
+}
+
+static EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+
+ const char* str = gl::s_egl.eglQueryString(fb->getDisplay(), name);
+ if (!str) {
+ return 0;
+ }
+
+ std::string eglStr(str);
+ if ((fb->getMaxGLESVersion() >= GLES_DISPATCH_MAX_VERSION_3_0) &&
+ feature_is_enabled(kFeature_GLESDynamicVersion) &&
+ eglStr.find("EGL_KHR_create_context") == std::string::npos) {
+ eglStr += "EGL_KHR_create_context ";
+ }
+
+ int len = eglStr.size() + 1;
+ if (!buffer || len > bufferSize) {
+ return -len;
+ }
+
+ strcpy((char *)buffer, eglStr.c_str());
+ return len;
+}
+
+static bool shouldEnableAsyncSwap() {
+ bool isPhone = true;
+ bool playStoreImage = feature_is_enabled(
+ kFeature_PlayStoreImage);
+ return feature_is_enabled(kFeature_GLAsyncSwap) &&
+ emugl_sync_device_exists() && (isPhone || playStoreImage) &&
+ sizeof(void*) == 8;
+}
+
+static bool shouldEnableVirtioGpuNativeSync() {
+ return feature_is_enabled(kFeature_VirtioGpuNativeSync);
+}
+
+static bool shouldEnableHostComposition() {
+ return feature_is_enabled(kFeature_HostComposition);
+}
+
+static bool shouldEnableVulkan() {
+ // TODO: Restrict further to devices supporting external memory.
+ return feature_is_enabled(kFeature_Vulkan) && vk::getGlobalVkEmulation() &&
+ vk::VkDecoderGlobalState::get()->getHostFeatureSupport().supportsVulkan;
+}
+
+static bool shouldEnableDeferredVulkanCommands() {
+ auto supportInfo = vk::VkDecoderGlobalState::get()->getHostFeatureSupport();
+ return supportInfo.supportsVulkan &&
+ supportInfo.useDeferredCommands;
+}
+
+static bool shouldEnableCreateResourcesWithRequirements() {
+ auto supportInfo = vk::VkDecoderGlobalState::get()->getHostFeatureSupport();
+ return supportInfo.supportsVulkan &&
+ supportInfo.useCreateResourcesWithRequirements;
+}
+
+static bool shouldEnableVulkanShaderFloat16Int8() {
+ return shouldEnableVulkan() &&
+ feature_is_enabled(kFeature_VulkanShaderFloat16Int8);
+}
+
+static bool shouldEnableAsyncQueueSubmit() {
+ return shouldEnableVulkan();
+}
+
+static bool shouldEnableVulkanAsyncQsri() {
+ return shouldEnableVulkan() &&
+ (feature_is_enabled(kFeature_GLAsyncSwap) ||
+ (feature_is_enabled(kFeature_VirtioGpuNativeSync) &&
+ feature_is_enabled(kFeature_VirtioGpuFenceContexts)));
+}
+
+static bool shouldEnableVsyncGatedSyncFences() {
+ return shouldEnableAsyncSwap();
+}
+
+const char* maxVersionToFeatureString(GLESDispatchMaxVersion version) {
+ switch (version) {
+ case GLES_DISPATCH_MAX_VERSION_2:
+ return kGLESDynamicVersion_2;
+ case GLES_DISPATCH_MAX_VERSION_3_0:
+ return kGLESDynamicVersion_3_0;
+ case GLES_DISPATCH_MAX_VERSION_3_1:
+ return kGLESDynamicVersion_3_1;
+ default:
+ return kGLESDynamicVersion_2;
+ }
+}
+
+static bool shouldEnableQueueSubmitWithCommands() {
+ return shouldEnableVulkan() &&
+ feature_is_enabled(kFeature_VulkanQueueSubmitWithCommands);
+}
+
+static bool shouldEnableBatchedDescriptorSetUpdate() {
+ return shouldEnableVulkan() &&
+ shouldEnableQueueSubmitWithCommands() &&
+ feature_is_enabled(kFeature_VulkanBatchedDescriptorSetUpdate);
+}
+
+// OpenGL ES 3.x support involves changing the GL_VERSION string, which is
+// assumed to be formatted in the following way:
+// "OpenGL ES-CM 1.m <vendor-info>" or
+// "OpenGL ES M.m <vendor-info>"
+// where M is the major version number and m is minor version number. If the
+// GL_VERSION string doesn't reflect the maximum available version of OpenGL
+// ES, many apps will not be able to detect support. We need to mess with the
+// version string in the first place since the underlying backend (whether it
+// is Translator, SwiftShader, ANGLE, et al) may not advertise a GL_VERSION
+// string reflecting their maximum capabilities.
+std::string replaceESVersionString(const std::string& prev,
+ const std::string& newver) {
+
+ // There is no need to fiddle with the string
+ // if we are in a ES 1.x context.
+ // Such contexts are considered as a special case that must
+ // be untouched.
+ if (prev.find("ES-CM") != std::string::npos) {
+ return prev;
+ }
+
+ size_t esStart = prev.find("ES ");
+ size_t esEnd = prev.find(" ", esStart + 3);
+
+ if (esStart == std::string::npos ||
+ esEnd == std::string::npos) {
+ // Account for out-of-spec version strings.
+ fprintf(stderr, "%s: Error: invalid OpenGL ES version string %s\n",
+ __func__, prev.c_str());
+ return prev;
+ }
+
+ std::string res = prev.substr(0, esStart + 3);
+ res += newver;
+ res += prev.substr(esEnd);
+
+ return res;
+}
+
+// If the GLES3 feature is disabled, we also want to splice out
+// OpenGL extensions that should not appear in a GLES2 system.
+void removeExtension(std::string& currExts, const std::string& toRemove) {
+ size_t pos = currExts.find(toRemove);
+
+ if (pos != std::string::npos)
+ currExts.erase(pos, toRemove.length());
+}
+
+static EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize) {
+ RenderThreadInfoGl* const tInfo = RenderThreadInfoGl::get();
+
+ // whatever we end up returning,
+ // it will have a terminating \0,
+ // so account for it here.
+ std::string glStr;
+
+ if (tInfo && tInfo->currContext.get()) {
+ const char *str = nullptr;
+ if (tInfo->currContext->clientVersion() > GLESApi_CM) {
+ str = (const char*)gl::s_gles2.glGetString(name);
+ }
+ else {
+ str = (const char*)gl::s_gles1.glGetString(name);
+ }
+ if (str) {
+ glStr += str;
+ }
+ }
+
+ // We add the maximum supported GL protocol number into GL_EXTENSIONS
+
+ // filter extensions by name to match guest-side support
+ GLESDispatchMaxVersion maxVersion = FrameBuffer::getFB()->getMaxGLESVersion();
+ if (name == GL_EXTENSIONS) {
+ glStr = gl::filterExtensionsBasedOnMaxVersion(maxVersion, glStr);
+ }
+
+ bool isChecksumEnabled =
+ feature_is_enabled(kFeature_GLPipeChecksum);
+ bool asyncSwapEnabled = shouldEnableAsyncSwap();
+ bool virtioGpuNativeSyncEnabled = shouldEnableVirtioGpuNativeSync();
+ bool dma1Enabled =
+ feature_is_enabled(kFeature_GLDMA);
+ bool dma2Enabled =
+ feature_is_enabled(kFeature_GLDMA2);
+ bool directMemEnabled =
+ feature_is_enabled(kFeature_GLDirectMem);
+ bool hostCompositionEnabled = shouldEnableHostComposition();
+ bool vulkanEnabled = shouldEnableVulkan();
+ bool deferredVulkanCommandsEnabled =
+ shouldEnableVulkan() && shouldEnableDeferredVulkanCommands();
+ bool vulkanNullOptionalStringsEnabled =
+ shouldEnableVulkan() && feature_is_enabled(kFeature_VulkanNullOptionalStrings);
+ bool vulkanCreateResourceWithRequirementsEnabled =
+ shouldEnableVulkan() && shouldEnableCreateResourcesWithRequirements();
+ bool YUV420888toNV21Enabled =
+ feature_is_enabled(kFeature_YUV420888toNV21);
+ bool YUVCacheEnabled =
+ feature_is_enabled(kFeature_YUVCache);
+ bool AsyncUnmapBufferEnabled = feature_is_enabled(kFeature_AsyncComposeSupport);
+ bool vulkanIgnoredHandlesEnabled =
+ shouldEnableVulkan() && feature_is_enabled(kFeature_VulkanIgnoredHandles);
+ bool virtioGpuNextEnabled =
+ feature_is_enabled(kFeature_VirtioGpuNext);
+ bool hasSharedSlotsHostMemoryAllocatorEnabled =
+ feature_is_enabled(kFeature_HasSharedSlotsHostMemoryAllocator);
+ bool vulkanFreeMemorySyncEnabled =
+ shouldEnableVulkan();
+ bool vulkanShaderFloat16Int8Enabled = shouldEnableVulkanShaderFloat16Int8();
+ bool vulkanAsyncQueueSubmitEnabled = shouldEnableAsyncQueueSubmit();
+ bool vulkanQueueSubmitWithCommands = shouldEnableQueueSubmitWithCommands();
+ bool vulkanBatchedDescriptorSetUpdate = shouldEnableBatchedDescriptorSetUpdate();
+ bool syncBufferDataEnabled = true;
+ bool vulkanAsyncQsri = shouldEnableVulkanAsyncQsri();
+ bool readColorBufferDma = directMemEnabled && hasSharedSlotsHostMemoryAllocatorEnabled;
+ bool hwcMultiConfigs = feature_is_enabled(kFeature_HWCMultiConfigs);
+
+ if (isChecksumEnabled && name == GL_EXTENSIONS) {
+ glStr += ChecksumCalculatorThreadInfo::getMaxVersionString();
+ glStr += " ";
+ }
+
+ if (asyncSwapEnabled && name == GL_EXTENSIONS) {
+ glStr += kAsyncSwapStrV2;
+ glStr += " "; // for compatibility with older system images
+ // Only enable EGL_KHR_wait_sync (and above) for host gpu.
+ if (emugl::getRenderer() == SELECTED_RENDERER_HOST) {
+ glStr += kAsyncSwapStrV3;
+ glStr += " ";
+ glStr += kAsyncSwapStrV4;
+ glStr += " ";
+ }
+ }
+
+ if (dma1Enabled && name == GL_EXTENSIONS) {
+ glStr += kDma1Str;
+ glStr += " ";
+ }
+
+ if (dma2Enabled && name == GL_EXTENSIONS) {
+ glStr += kDma2Str;
+ glStr += " ";
+ }
+
+ if (directMemEnabled && name == GL_EXTENSIONS) {
+ glStr += kDirectMemStr;
+ glStr += " ";
+ }
+
+ if (hostCompositionEnabled && name == GL_EXTENSIONS) {
+ glStr += kHostCompositionV1;
+ glStr += " ";
+ }
+
+ if (hostCompositionEnabled && name == GL_EXTENSIONS) {
+ glStr += kHostCompositionV2;
+ glStr += " ";
+ }
+
+ if (vulkanEnabled && name == GL_EXTENSIONS) {
+ glStr += kVulkanFeatureStr;
+ glStr += " ";
+ }
+
+ if (deferredVulkanCommandsEnabled && name == GL_EXTENSIONS) {
+ glStr += kDeferredVulkanCommands;
+ glStr += " ";
+ }
+
+ if (vulkanNullOptionalStringsEnabled && name == GL_EXTENSIONS) {
+ glStr += kVulkanNullOptionalStrings;
+ glStr += " ";
+ }
+
+ if (vulkanCreateResourceWithRequirementsEnabled && name == GL_EXTENSIONS) {
+ glStr += kVulkanCreateResourcesWithRequirements;
+ glStr += " ";
+ }
+
+ if (YUV420888toNV21Enabled && name == GL_EXTENSIONS) {
+ glStr += kYUV420888toNV21;
+ glStr += " ";
+ }
+
+ if (YUVCacheEnabled && name == GL_EXTENSIONS) {
+ glStr += kYUVCache;
+ glStr += " ";
+ }
+
+ if (AsyncUnmapBufferEnabled && name == GL_EXTENSIONS) {
+ glStr += kAsyncUnmapBuffer;
+ glStr += " ";
+ }
+
+ if (vulkanIgnoredHandlesEnabled && name == GL_EXTENSIONS) {
+ glStr += kVulkanIgnoredHandles;
+ glStr += " ";
+ }
+
+ if (virtioGpuNextEnabled && name == GL_EXTENSIONS) {
+ glStr += kVirtioGpuNext;
+ glStr += " ";
+ }
+
+ if (hasSharedSlotsHostMemoryAllocatorEnabled && name == GL_EXTENSIONS) {
+ glStr += kHasSharedSlotsHostMemoryAllocator;
+ glStr += " ";
+ }
+
+ if (vulkanFreeMemorySyncEnabled && name == GL_EXTENSIONS) {
+ glStr += kVulkanFreeMemorySync;
+ glStr += " ";
+ }
+
+ if (vulkanShaderFloat16Int8Enabled && name == GL_EXTENSIONS) {
+ glStr += kVulkanShaderFloat16Int8;
+ glStr += " ";
+ }
+
+ if (vulkanAsyncQueueSubmitEnabled && name == GL_EXTENSIONS) {
+ glStr += kVulkanAsyncQueueSubmit;
+ glStr += " ";
+ }
+
+ if (vulkanQueueSubmitWithCommands && name == GL_EXTENSIONS) {
+ glStr += kVulkanQueueSubmitWithCommands;
+ glStr += " ";
+ }
+
+ if (vulkanBatchedDescriptorSetUpdate && name == GL_EXTENSIONS) {
+ glStr += kVulkanBatchedDescriptorSetUpdate;
+ glStr += " ";
+ }
+
+ if (virtioGpuNativeSyncEnabled && name == GL_EXTENSIONS) {
+ glStr += kVirtioGpuNativeSync;
+ glStr += " ";
+ }
+
+ if (syncBufferDataEnabled && name == GL_EXTENSIONS) {
+ glStr += kSyncBufferData;
+ glStr += " ";
+ }
+
+ if (vulkanAsyncQsri && name == GL_EXTENSIONS) {
+ glStr += kVulkanAsyncQsri;
+ glStr += " ";
+ }
+
+ if (readColorBufferDma && name == GL_EXTENSIONS) {
+ glStr += kReadColorBufferDma;
+ glStr += " ";
+ }
+
+ if (hwcMultiConfigs && name == GL_EXTENSIONS) {
+ glStr += kHWCMultiConfigs;
+ glStr += " ";
+ }
+
+ if (name == GL_EXTENSIONS) {
+
+ GLESDispatchMaxVersion guestExtVer = GLES_DISPATCH_MAX_VERSION_2;
+ if (feature_is_enabled(kFeature_GLESDynamicVersion)) {
+ // If the image is in ES 3 mode, add GL_OES_EGL_image_external_essl3 for better Skia support.
+ glStr += "GL_OES_EGL_image_external_essl3 ";
+ guestExtVer = maxVersion;
+ }
+
+ // If we have a GLES3 implementation, add the corresponding
+ // GLESv2 extensions as well.
+ if (maxVersion > GLES_DISPATCH_MAX_VERSION_2) {
+ glStr += "GL_OES_vertex_array_object ";
+ }
+
+
+
+ // ASTC LDR compressed texture support.
+ const std::string& glExtensions =
+ FrameBuffer::getFB()->hasEmulationGl()
+ ? FrameBuffer::getFB()->getEmulationGl().getGlesExtensionsString()
+ : "<no GL emulation>";
+ const bool hasNativeAstc =
+ glExtensions.find("GL_KHR_texture_compression_astc_ldr") != std::string::npos;
+ const bool hasAstcDecompressor = vk::AstcCpuDecompressor::get().available();
+ if (hasNativeAstc || hasAstcDecompressor) {
+ glStr += "GL_KHR_texture_compression_astc_ldr ";
+ } else {
+ RENDERCONTROL_DPRINT(
+ "rcGetGLString: ASTC not supported. CPU decompressor? %d. GL extensions: %s",
+ hasAstcDecompressor, glExtensions.c_str());
+ }
+
+ // Host side tracing support.
+ glStr += kHostSideTracing;
+ glStr += " ";
+
+ if (feature_is_enabled(kFeature_AsyncComposeSupport)) {
+ // Async makecurrent support.
+ glStr += kAsyncFrameCommands;
+ glStr += " ";
+ }
+
+ glStr += maxVersionToFeatureString(guestExtVer);
+ glStr += " ";
+ }
+
+ if (name == GL_VERSION) {
+ if (feature_is_enabled(kFeature_GLESDynamicVersion)) {
+ switch (maxVersion) {
+ // Underlying GLES implmentation's max version string
+ // is allowed to be higher than the version of the request
+ // for the context---it can create a higher version context,
+ // and return simply the max possible version overall.
+ case GLES_DISPATCH_MAX_VERSION_2:
+ glStr = replaceESVersionString(glStr, "2.0");
+ break;
+ case GLES_DISPATCH_MAX_VERSION_3_0:
+ glStr = replaceESVersionString(glStr, "3.0");
+ break;
+ case GLES_DISPATCH_MAX_VERSION_3_1:
+ glStr = replaceESVersionString(glStr, "3.1");
+ break;
+ default:
+ break;
+ }
+ } else {
+ glStr = replaceESVersionString(glStr, "2.0");
+ }
+ }
+
+ int nextBufferSize = glStr.size() + 1;
+
+ if (!buffer || nextBufferSize > bufferSize) {
+ return -nextBufferSize;
+ }
+
+ snprintf((char *)buffer, nextBufferSize, "%s", glStr.c_str());
+ return nextBufferSize;
+}
+
+static EGLint rcGetNumConfigs(uint32_t* p_numAttribs)
+{
+ int numConfigs = 0, numAttribs = 0;
+
+ FrameBuffer::getFB()->getConfigs()->getPackInfo(&numConfigs, &numAttribs);
+ if (p_numAttribs) {
+ *p_numAttribs = static_cast<uint32_t>(numAttribs);
+ }
+ return numConfigs;
+}
+
+static EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer)
+{
+ GLuint bufferSize = (GLuint)bufSize;
+ return FrameBuffer::getFB()->getConfigs()->packConfigs(bufferSize, buffer);
+}
+
+static EGLint rcChooseConfig(EGLint *attribs,
+ uint32_t attribs_size,
+ uint32_t *configs,
+ uint32_t configs_size)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+
+ if (attribs_size == 0) {
+ if (configs && configs_size > 0) {
+ // Pick the first config
+ *configs = 0;
+ if (attribs) *attribs = EGL_NONE;
+ }
+ }
+
+ return fb->getConfigs()->chooseConfig(
+ attribs, (EGLint*)configs, (EGLint)configs_size);
+}
+
+static EGLint rcGetFBParam(EGLint param)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+ return fb->getDisplayConfigsParam(0, param);
+}
+
+static uint32_t rcCreateContext(uint32_t config,
+ uint32_t share, uint32_t glVersion)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+
+ HandleType ret = fb->createEmulatedEglContext(config, share, (GLESApi)glVersion);
+ return ret;
+}
+
+static void rcDestroyContext(uint32_t context)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+
+ fb->destroyEmulatedEglContext(context);
+}
+
+static uint32_t rcCreateWindowSurface(uint32_t config,
+ uint32_t width, uint32_t height)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+
+ return fb->createEmulatedEglWindowSurface(config, width, height);
+}
+
+static void rcDestroyWindowSurface(uint32_t windowSurface)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+
+ fb->destroyEmulatedEglWindowSurface(windowSurface);
+}
+
+static uint32_t rcCreateColorBuffer(uint32_t width,
+ uint32_t height, GLenum internalFormat)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+
+ return fb->createColorBuffer(width, height, internalFormat,
+ FRAMEWORK_FORMAT_GL_COMPATIBLE);
+}
+
+static uint32_t rcCreateColorBufferDMA(uint32_t width,
+ uint32_t height, GLenum internalFormat,
+ int frameworkFormat)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+
+ return fb->createColorBuffer(width, height, internalFormat,
+ (FrameworkFormat)frameworkFormat);
+}
+
+static int rcOpenColorBuffer2(uint32_t colorbuffer)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+ return fb->openColorBuffer( colorbuffer );
+}
+
+static void rcOpenColorBuffer(uint32_t colorbuffer)
+{
+ (void) rcOpenColorBuffer2(colorbuffer);
+}
+
+static void rcCloseColorBuffer(uint32_t colorbuffer)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+ fb->closeColorBuffer( colorbuffer );
+}
+
+static int rcFlushWindowColorBuffer(uint32_t windowSurface)
+{
+ GRSYNC_DPRINT("waiting for gralloc cb lock");
+ GrallocSyncPostLock lock(*sGrallocSync());
+ GRSYNC_DPRINT("lock gralloc cb lock {");
+
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ GRSYNC_DPRINT("unlock gralloc cb lock");
+ return -1;
+ }
+
+ HandleType colorBufferHandle = fb->getEmulatedEglWindowSurfaceColorBufferHandle(windowSurface);
+
+ if (!fb->flushEmulatedEglWindowSurfaceColorBuffer(windowSurface)) {
+ GRSYNC_DPRINT("unlock gralloc cb lock }");
+ return -1;
+ }
+
+ // Make the GL updates visible to other backings if necessary.
+ fb->flushColorBufferFromGl(colorBufferHandle);
+
+ GRSYNC_DPRINT("unlock gralloc cb lock }");
+
+ return 0;
+}
+
+// Note that even though this calls rcFlushWindowColorBuffer,
+// the "Async" part is in the return type, which is void
+// versus return type int for rcFlushWindowColorBuffer.
+//
+// The different return type, even while calling the same
+// functions internally, will end up making the encoder
+// and decoder use a different protocol. This is because
+// the encoder generally obeys the following conventions:
+//
+// - The encoder will immediately send and wait for a command
+// result if the return type is not void.
+// - The encoder will cache the command in a buffer and send
+// at a convenient time if the return type is void.
+//
+// It can also be expensive performance-wise to trigger
+// sending traffic back to the guest. Generally, the more we avoid
+// encoding commands that perform two-way traffic, the better.
+//
+// Hence, |rcFlushWindowColorBufferAsync| will avoid extra traffic;
+// with return type void,
+// the guest will not wait until this function returns,
+// nor will it immediately send the command,
+// resulting in more asynchronous behavior.
+static void rcFlushWindowColorBufferAsync(uint32_t windowSurface)
+{
+ rcFlushWindowColorBuffer(windowSurface);
+}
+
+static void rcSetWindowColorBuffer(uint32_t windowSurface,
+ uint32_t colorBuffer)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+ fb->setEmulatedEglWindowSurfaceColorBuffer(windowSurface, colorBuffer);
+}
+
+static EGLint rcMakeCurrent(uint32_t context,
+ uint32_t drawSurf, uint32_t readSurf)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return EGL_FALSE;
+ }
+
+ bool ret = fb->bindContext(context, drawSurf, readSurf);
+
+ return (ret ? EGL_TRUE : EGL_FALSE);
+}
+
+static void rcFBPost(uint32_t colorBuffer)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+
+ fb->post(colorBuffer);
+}
+
+static void rcFBSetSwapInterval(EGLint interval)
+{
+ // XXX: TBD - should be implemented
+}
+
+static void rcBindTexture(uint32_t colorBuffer)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+
+ // Update for GL use if necessary.
+ fb->invalidateColorBufferForGl(colorBuffer);
+
+ fb->bindColorBufferToTexture(colorBuffer);
+}
+
+static void rcBindRenderbuffer(uint32_t colorBuffer)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+
+ // Update for GL use if necessary.
+ fb->invalidateColorBufferForGl(colorBuffer);
+
+ fb->bindColorBufferToRenderbuffer(colorBuffer);
+}
+
+static EGLint rcColorBufferCacheFlush(uint32_t colorBuffer,
+ EGLint postCount, int forRead)
+{
+ // gralloc_lock() on the guest calls rcColorBufferCacheFlush
+ GRSYNC_DPRINT("waiting for gralloc cb lock");
+ sGrallocSync()->lockColorBufferPrepare();
+ GRSYNC_DPRINT("lock gralloc cb lock {");
+ return 0;
+}
+
+static void rcReadColorBuffer(uint32_t colorBuffer,
+ GLint x, GLint y,
+ GLint width, GLint height,
+ GLenum format, GLenum type, void* pixels)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+
+ fb->readColorBuffer(colorBuffer, x, y, width, height, format, type, pixels);
+}
+
+static int rcUpdateColorBuffer(uint32_t colorBuffer,
+ GLint x, GLint y,
+ GLint width, GLint height,
+ GLenum format, GLenum type, void* pixels)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+
+ if (!fb) {
+ GRSYNC_DPRINT("unlock gralloc cb lock");
+ sGrallocSync()->unlockColorBufferPrepare();
+ return -1;
+ }
+
+ fb->updateColorBuffer(colorBuffer, x, y, width, height, format, type, pixels);
+
+ GRSYNC_DPRINT("unlock gralloc cb lock");
+ sGrallocSync()->unlockColorBufferPrepare();
+
+ return 0;
+}
+
+static int rcUpdateColorBufferDMA(uint32_t colorBuffer,
+ GLint x, GLint y,
+ GLint width, GLint height,
+ GLenum format, GLenum type,
+ void* pixels, uint32_t pixels_size)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+
+ if (!fb) {
+ GRSYNC_DPRINT("unlock gralloc cb lock");
+ sGrallocSync()->unlockColorBufferPrepare();
+ return -1;
+ }
+
+ fb->updateColorBuffer(colorBuffer, x, y, width, height,
+ format, type, pixels);
+
+ GRSYNC_DPRINT("unlock gralloc cb lock");
+ sGrallocSync()->unlockColorBufferPrepare();
+
+ return 0;
+}
+
+static uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+
+ return fb->createEmulatedEglImage(context, target, buffer);
+}
+
+static int rcDestroyClientImage(uint32_t image)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+
+ return fb->destroyEmulatedEglImage(image);
+}
+
+static void rcSelectChecksumHelper(uint32_t protocol, uint32_t reserved) {
+ ChecksumCalculatorThreadInfo::setVersion(protocol);
+}
+
+// |rcTriggerWait| is called from the goldfish sync
+// kernel driver whenever a native fence fd is created.
+// We will then need to use the host to find out
+// when to signal that native fence fd. We use
+// SyncThread for that.
+static void rcTriggerWait(uint64_t eglsync_ptr,
+ uint64_t thread_ptr,
+ uint64_t timeline) {
+ if (thread_ptr == 1) {
+ // Is vulkan sync fd;
+ // just signal right away for now
+ EGLSYNC_DPRINT("vkFence=0x%llx timeline=0x%llx", eglsync_ptr,
+ thread_ptr, timeline);
+ SyncThread::get()->triggerWaitVk(reinterpret_cast<VkFence>(eglsync_ptr),
+ timeline);
+ } else if (thread_ptr == 2) {
+ EGLSYNC_DPRINT("vkFence=0x%llx timeline=0x%llx", eglsync_ptr,
+ thread_ptr, timeline);
+ SyncThread::get()->triggerWaitVkQsri(reinterpret_cast<VkImage>(eglsync_ptr), timeline);
+ } else {
+ EmulatedEglFenceSync* fenceSync = EmulatedEglFenceSync::getFromHandle(eglsync_ptr);
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (fb && fenceSync && fenceSync->isCompositionFence()) {
+ fb->scheduleVsyncTask([eglsync_ptr, fenceSync, timeline](uint64_t) {
+ EGLSYNC_DPRINT(
+ "vsync: eglsync=0x%llx fenceSync=%p thread_ptr=0x%llx "
+ "timeline=0x%llx",
+ eglsync_ptr, fenceSync, thread_ptr, timeline);
+ SyncThread::get()->triggerWait(fenceSync, timeline);
+ });
+ } else {
+ EGLSYNC_DPRINT(
+ "eglsync=0x%llx fenceSync=%p thread_ptr=0x%llx "
+ "timeline=0x%llx",
+ eglsync_ptr, fenceSync, thread_ptr, timeline);
+ SyncThread::get()->triggerWait(fenceSync, timeline);
+ }
+ }
+}
+
+// |rcCreateSyncKHR| implements the guest's |eglCreateSyncKHR| by calling the
+// host's implementation of |eglCreateSyncKHR|. A SyncThread is also notified
+// for purposes of signaling any native fence fd's that get created in the
+// guest off the sync object created here.
+static void rcCreateSyncKHR(EGLenum type,
+ EGLint* attribs,
+ uint32_t num_attribs,
+ int destroyWhenSignaled,
+ uint64_t* outSync,
+ uint64_t* outSyncThread) {
+ // Usually we expect rcTriggerWait to be registered
+ // at the beginning in rcGetRendererVersion, called
+ // on init for all contexts.
+ // But if we are loading from snapshot, that's not
+ // guaranteed, and we need to make sure
+ // rcTriggerWait is registered.
+ emugl_sync_register_trigger_wait(rcTriggerWait);
+
+ FrameBuffer::getFB()->createEmulatedEglFenceSync(type,
+ destroyWhenSignaled,
+ outSync,
+ outSyncThread);
+
+ RenderThreadInfo* tInfo = RenderThreadInfo::get();
+ if (tInfo && outSync && shouldEnableVsyncGatedSyncFences()) {
+ auto fenceSync = reinterpret_cast<EmulatedEglFenceSync*>(outSync);
+ fenceSync->setIsCompositionFence(tInfo->m_isCompositionThread);
+ }
+}
+
+// |rcClientWaitSyncKHR| implements |eglClientWaitSyncKHR|
+// on the guest through using the host's existing
+// |eglClientWaitSyncKHR| implementation, which is done
+// through the EmulatedEglFenceSync object.
+static EGLint rcClientWaitSyncKHR(uint64_t handle,
+ EGLint flags,
+ uint64_t timeout) {
+ RenderThreadInfoGl* const tInfo = RenderThreadInfoGl::get();
+ if (!tInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Render thread GL not available.";
+ }
+
+ FrameBuffer *fb = FrameBuffer::getFB();
+
+ EGLSYNC_DPRINT("handle=0x%lx flags=0x%x timeout=%" PRIu64,
+ handle, flags, timeout);
+
+ EmulatedEglFenceSync* fenceSync = EmulatedEglFenceSync::getFromHandle(handle);
+
+ if (!fenceSync) {
+ EGLSYNC_DPRINT("fenceSync null, return condition satisfied");
+ return EGL_CONDITION_SATISFIED_KHR;
+ }
+
+ // Sometimes a gralloc-buffer-only thread is doing stuff with sync.
+ // This happens all the time with YouTube videos in the browser.
+ // In this case, create a context on the host just for syncing.
+ if (!tInfo->currContext) {
+ uint32_t gralloc_sync_cxt, gralloc_sync_surf;
+ fb->createTrivialContext(0, // There is no context to share.
+ &gralloc_sync_cxt,
+ &gralloc_sync_surf);
+ fb->bindContext(gralloc_sync_cxt,
+ gralloc_sync_surf,
+ gralloc_sync_surf);
+ // This context is then cleaned up when the render thread exits.
+ }
+
+ return fenceSync->wait(timeout);
+}
+
+static void rcWaitSyncKHR(uint64_t handle,
+ EGLint flags) {
+ RenderThreadInfoGl* const tInfo = RenderThreadInfoGl::get();
+ if (!tInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Render thread GL not available.";
+ }
+
+ FrameBuffer *fb = FrameBuffer::getFB();
+
+ EGLSYNC_DPRINT("handle=0x%lx flags=0x%x", handle, flags);
+
+ EmulatedEglFenceSync* fenceSync = EmulatedEglFenceSync::getFromHandle(handle);
+
+ if (!fenceSync) { return; }
+
+ // Sometimes a gralloc-buffer-only thread is doing stuff with sync.
+ // This happens all the time with YouTube videos in the browser.
+ // In this case, create a context on the host just for syncing.
+ if (!tInfo->currContext) {
+ uint32_t gralloc_sync_cxt, gralloc_sync_surf;
+ fb->createTrivialContext(0, // There is no context to share.
+ &gralloc_sync_cxt,
+ &gralloc_sync_surf);
+ fb->bindContext(gralloc_sync_cxt,
+ gralloc_sync_surf,
+ gralloc_sync_surf);
+ // This context is then cleaned up when the render thread exits.
+ }
+
+ fenceSync->waitAsync();
+}
+
+static int rcDestroySyncKHR(uint64_t handle) {
+ EmulatedEglFenceSync* fenceSync = EmulatedEglFenceSync::getFromHandle(handle);
+ if (!fenceSync) return 0;
+ fenceSync->decRef();
+ return 0;
+}
+
+static void rcSetPuid(uint64_t puid) {
+ if (puid == kInvalidPUID) {
+ // The host process pipe implementation (GLProcessPipe) has been updated
+ // to not generate a unique pipe id when running with virtio gpu and
+ // instead send -1 to the guest. Ignore those requests as the PUID will
+ // instead be the virtio gpu context id.
+ return;
+ }
+
+ RenderThreadInfo *tInfo = RenderThreadInfo::get();
+ tInfo->m_puid = puid;
+}
+
+static int rcCompose(uint32_t bufferSize, void* buffer) {
+ RenderThreadInfo *tInfo = RenderThreadInfo::get();
+ if (tInfo) tInfo->m_isCompositionThread = true;
+
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+ return fb->compose(bufferSize, buffer, true);
+}
+
+static int rcComposeWithoutPost(uint32_t bufferSize, void* buffer) {
+ RenderThreadInfo *tInfo = RenderThreadInfo::get();
+ if (tInfo) tInfo->m_isCompositionThread = true;
+
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+ return fb->compose(bufferSize, buffer, false);
+}
+
+static int rcCreateDisplay(uint32_t* displayId) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ // Assume this API call always allocates a new displayId
+ *displayId = FrameBuffer::s_invalidIdMultiDisplay;
+ return fb->createDisplay(displayId);
+}
+
+static int rcCreateDisplayById(uint32_t displayId) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ return fb->createDisplay(displayId);
+}
+
+static int rcDestroyDisplay(uint32_t displayId) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ return fb->destroyDisplay(displayId);
+}
+
+static int rcSetDisplayColorBuffer(uint32_t displayId, uint32_t colorBuffer) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ return fb->setDisplayColorBuffer(displayId, colorBuffer);
+}
+
+static int rcGetDisplayColorBuffer(uint32_t displayId, uint32_t* colorBuffer) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ return fb->getDisplayColorBuffer(displayId, colorBuffer);
+}
+
+static int rcGetColorBufferDisplay(uint32_t colorBuffer, uint32_t* displayId) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ return fb->getColorBufferDisplay(colorBuffer, displayId);
+}
+
+static int rcGetDisplayPose(uint32_t displayId,
+ int32_t* x,
+ int32_t* y,
+ uint32_t* w,
+ uint32_t* h) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ return fb->getDisplayPose(displayId, x, y, w, h);
+}
+
+static int rcSetDisplayPose(uint32_t displayId,
+ int32_t x,
+ int32_t y,
+ uint32_t w,
+ uint32_t h) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ return fb->setDisplayPose(displayId, x, y, w, h);
+}
+
+static int rcSetDisplayPoseDpi(uint32_t displayId,
+ int32_t x,
+ int32_t y,
+ uint32_t w,
+ uint32_t h,
+ uint32_t dpi) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ return fb->setDisplayPose(displayId, x, y, w, h, dpi);
+}
+
+static void rcReadColorBufferYUV(uint32_t colorBuffer,
+ GLint x, GLint y,
+ GLint width, GLint height,
+ void* pixels, uint32_t pixels_size)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+
+ fb->readColorBufferYUV(colorBuffer, x, y, width, height, pixels, pixels_size);
+}
+
+static int rcIsSyncSignaled(uint64_t handle) {
+ EmulatedEglFenceSync* fenceSync = EmulatedEglFenceSync::getFromHandle(handle);
+ if (!fenceSync) return 1; // assume destroyed => signaled
+ return fenceSync->isSignaled() ? 1 : 0;
+}
+
+static void rcCreateColorBufferWithHandle(
+ uint32_t width, uint32_t height, GLenum internalFormat, uint32_t handle)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+
+ if (!fb) {
+ return;
+ }
+
+ fb->createColorBufferWithHandle(
+ width, height, internalFormat,
+ FRAMEWORK_FORMAT_GL_COMPATIBLE, handle);
+}
+
+static uint32_t rcCreateBuffer2(uint64_t size, uint32_t memoryProperty) {
+ FrameBuffer* fb = FrameBuffer::getFB();
+ if (!fb) {
+ return 0;
+ }
+
+ return fb->createBuffer(size, memoryProperty);
+}
+
+static uint32_t rcCreateBuffer(uint32_t size) {
+ return rcCreateBuffer2(size, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
+}
+
+static void rcCloseBuffer(uint32_t buffer) {
+ FrameBuffer* fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+ fb->closeBuffer(buffer);
+}
+
+static int rcSetColorBufferVulkanMode2(uint32_t colorBuffer, uint32_t mode,
+ uint32_t memoryProperty) {
+#define VULKAN_MODE_VULKAN_ONLY 1
+
+ bool modeIsVulkanOnly = mode == VULKAN_MODE_VULKAN_ONLY;
+
+ if (!vk::setColorBufferVulkanMode(colorBuffer, mode)) {
+ fprintf(stderr,
+ "%s: error: failed to set Vulkan mode for colorBuffer 0x%x\n",
+ __func__, colorBuffer);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int rcSetColorBufferVulkanMode(uint32_t colorBuffer, uint32_t mode) {
+ return rcSetColorBufferVulkanMode2(colorBuffer, mode,
+ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
+}
+
+static int32_t rcMapGpaToBufferHandle(uint32_t bufferHandle, uint64_t gpa) {
+ int32_t result = vk::mapGpaToBufferHandle(bufferHandle, gpa);
+ if (result < 0) {
+ fprintf(stderr,
+ "%s: error: failed to map gpa %" PRIx64 " to buffer handle 0x%x: %d\n",
+ __func__, gpa, bufferHandle, result);
+ }
+ return result;
+}
+
+static int32_t rcMapGpaToBufferHandle2(uint32_t bufferHandle,
+ uint64_t gpa,
+ uint64_t size) {
+ int32_t result = vk::mapGpaToBufferHandle(bufferHandle, gpa, size);
+ if (result < 0) {
+ fprintf(stderr,
+ "%s: error: failed to map gpa %" PRIx64 " to buffer handle 0x%x: %d\n",
+ __func__, gpa, bufferHandle, result);
+ }
+ return result;
+}
+
+static void rcFlushWindowColorBufferAsyncWithFrameNumber(uint32_t windowSurface, uint32_t frameNumber) {
+ android::base::traceCounter("gfxstreamFrameNumber", (int64_t)frameNumber);
+ rcFlushWindowColorBufferAsync(windowSurface);
+}
+
+static void rcSetTracingForPuid(uint64_t puid, uint32_t enable, uint64_t time) {
+ if (enable) {
+ android::base::setGuestTime(time);
+ android::base::enableTracing();
+ } else {
+ android::base::disableTracing();
+ }
+}
+
+static void rcMakeCurrentAsync(uint32_t context, uint32_t drawSurf, uint32_t readSurf) {
+ AEMU_SCOPED_THRESHOLD_TRACE_CALL();
+ FrameBuffer* fb = FrameBuffer::getFB();
+ if (!fb) { return; }
+
+ fb->bindContext(context, drawSurf, readSurf);
+}
+
+static void rcComposeAsync(uint32_t bufferSize, void* buffer) {
+ RenderThreadInfo *tInfo = RenderThreadInfo::get();
+ if (tInfo) tInfo->m_isCompositionThread = true;
+
+ FrameBuffer* fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+ fb->compose(bufferSize, buffer, true);
+}
+
+static void rcComposeAsyncWithoutPost(uint32_t bufferSize, void* buffer) {
+ RenderThreadInfo *tInfo = RenderThreadInfo::get();
+ if (tInfo) tInfo->m_isCompositionThread = true;
+
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return;
+ }
+ fb->compose(bufferSize, buffer, false);
+}
+
+static void rcDestroySyncKHRAsync(uint64_t handle) {
+ EmulatedEglFenceSync* fenceSync = EmulatedEglFenceSync::getFromHandle(handle);
+ if (!fenceSync) return;
+ fenceSync->decRef();
+}
+
+static int rcReadColorBufferDMA(uint32_t colorBuffer,
+ GLint x, GLint y,
+ GLint width, GLint height,
+ GLenum format, GLenum type, void* pixels, uint32_t pixels_size)
+{
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+
+ fb->readColorBuffer(colorBuffer, x, y, width, height, format, type, pixels);
+ return 0;
+}
+
+static int rcGetFBDisplayConfigsCount() {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+ return fb->getDisplayConfigsCount();
+}
+
+static int rcGetFBDisplayConfigsParam(int configId, GLint param) {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+ return fb->getDisplayConfigsParam(configId, param);
+}
+
+static int rcGetFBDisplayActiveConfig() {
+ FrameBuffer *fb = FrameBuffer::getFB();
+ if (!fb) {
+ return -1;
+ }
+ return fb->getDisplayActiveConfig();
+}
+
+static void rcSetProcessMetadata(char* key, RenderControlByte* valuePtr, uint32_t valueSize) {
+ RenderThreadInfo* tInfo = RenderThreadInfo::get();
+ if (strcmp(key, "process_name") == 0) {
+ // We know this is a c formatted string
+ tInfo->m_processName = std::string((char*) valuePtr);
+ }
+}
+
+static int rcGetHostExtensionsString(uint32_t bufferSize, void* buffer) {
+ // TODO(b/233939967): split off host extensions from GL extensions.
+ return rcGetGLString(GL_EXTENSIONS, buffer, bufferSize);
+}
+
+void initRenderControlContext(renderControl_decoder_context_t *dec)
+{
+ dec->rcGetRendererVersion = rcGetRendererVersion;
+ dec->rcGetEGLVersion = rcGetEGLVersion;
+ dec->rcQueryEGLString = rcQueryEGLString;
+ dec->rcGetGLString = rcGetGLString;
+ dec->rcGetNumConfigs = rcGetNumConfigs;
+ dec->rcGetConfigs = rcGetConfigs;
+ dec->rcChooseConfig = rcChooseConfig;
+ dec->rcGetFBParam = rcGetFBParam;
+ dec->rcCreateContext = rcCreateContext;
+ dec->rcDestroyContext = rcDestroyContext;
+ dec->rcCreateWindowSurface = rcCreateWindowSurface;
+ dec->rcDestroyWindowSurface = rcDestroyWindowSurface;
+ dec->rcCreateColorBuffer = rcCreateColorBuffer;
+ dec->rcOpenColorBuffer = rcOpenColorBuffer;
+ dec->rcCloseColorBuffer = rcCloseColorBuffer;
+ dec->rcSetWindowColorBuffer = rcSetWindowColorBuffer;
+ dec->rcFlushWindowColorBuffer = rcFlushWindowColorBuffer;
+ dec->rcMakeCurrent = rcMakeCurrent;
+ dec->rcFBPost = rcFBPost;
+ dec->rcFBSetSwapInterval = rcFBSetSwapInterval;
+ dec->rcBindTexture = rcBindTexture;
+ dec->rcBindRenderbuffer = rcBindRenderbuffer;
+ dec->rcColorBufferCacheFlush = rcColorBufferCacheFlush;
+ dec->rcReadColorBuffer = rcReadColorBuffer;
+ dec->rcUpdateColorBuffer = rcUpdateColorBuffer;
+ dec->rcOpenColorBuffer2 = rcOpenColorBuffer2;
+ dec->rcCreateClientImage = rcCreateClientImage;
+ dec->rcDestroyClientImage = rcDestroyClientImage;
+ dec->rcSelectChecksumHelper = rcSelectChecksumHelper;
+ dec->rcCreateSyncKHR = rcCreateSyncKHR;
+ dec->rcClientWaitSyncKHR = rcClientWaitSyncKHR;
+ dec->rcFlushWindowColorBufferAsync = rcFlushWindowColorBufferAsync;
+ dec->rcDestroySyncKHR = rcDestroySyncKHR;
+ dec->rcSetPuid = rcSetPuid;
+ dec->rcUpdateColorBufferDMA = rcUpdateColorBufferDMA;
+ dec->rcCreateColorBufferDMA = rcCreateColorBufferDMA;
+ dec->rcWaitSyncKHR = rcWaitSyncKHR;
+ dec->rcCompose = rcCompose;
+ dec->rcCreateDisplay = rcCreateDisplay;
+ dec->rcDestroyDisplay = rcDestroyDisplay;
+ dec->rcSetDisplayColorBuffer = rcSetDisplayColorBuffer;
+ dec->rcGetDisplayColorBuffer = rcGetDisplayColorBuffer;
+ dec->rcGetColorBufferDisplay = rcGetColorBufferDisplay;
+ dec->rcGetDisplayPose = rcGetDisplayPose;
+ dec->rcSetDisplayPose = rcSetDisplayPose;
+ dec->rcSetColorBufferVulkanMode = rcSetColorBufferVulkanMode;
+ dec->rcReadColorBufferYUV = rcReadColorBufferYUV;
+ dec->rcIsSyncSignaled = rcIsSyncSignaled;
+ dec->rcCreateColorBufferWithHandle = rcCreateColorBufferWithHandle;
+ dec->rcCreateBuffer = rcCreateBuffer;
+ dec->rcCreateBuffer2 = rcCreateBuffer2;
+ dec->rcCloseBuffer = rcCloseBuffer;
+ dec->rcSetColorBufferVulkanMode2 = rcSetColorBufferVulkanMode2;
+ dec->rcMapGpaToBufferHandle = rcMapGpaToBufferHandle;
+ dec->rcMapGpaToBufferHandle2 = rcMapGpaToBufferHandle2;
+ dec->rcFlushWindowColorBufferAsyncWithFrameNumber = rcFlushWindowColorBufferAsyncWithFrameNumber;
+ dec->rcSetTracingForPuid = rcSetTracingForPuid;
+ dec->rcMakeCurrentAsync = rcMakeCurrentAsync;
+ dec->rcComposeAsync = rcComposeAsync;
+ dec->rcDestroySyncKHRAsync = rcDestroySyncKHRAsync;
+ dec->rcComposeWithoutPost = rcComposeWithoutPost;
+ dec->rcComposeAsyncWithoutPost = rcComposeAsyncWithoutPost;
+ dec->rcCreateDisplayById = rcCreateDisplayById;
+ dec->rcSetDisplayPoseDpi = rcSetDisplayPoseDpi;
+ dec->rcReadColorBufferDMA = rcReadColorBufferDMA;
+ dec->rcGetFBDisplayConfigsCount = rcGetFBDisplayConfigsCount;
+ dec->rcGetFBDisplayConfigsParam = rcGetFBDisplayConfigsParam;
+ dec->rcGetFBDisplayActiveConfig = rcGetFBDisplayActiveConfig;
+ dec->rcSetProcessMetadata = rcSetProcessMetadata;
+ dec->rcGetHostExtensionsString = rcGetHostExtensionsString;
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderControl.h b/src/gfxstream/host/RenderControl.h
new file mode 100644
index 00000000000..d7a622d4419
--- /dev/null
+++ b/src/gfxstream/host/RenderControl.h
@@ -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.
+*/
+#ifndef _RENDER_CONTROL_H
+#define _RENDER_CONTROL_H
+
+#include "renderControl_dec/renderControl_dec.h"
+
+namespace gfxstream {
+
+void initRenderControlContext(renderControl_decoder_context_t *dec);
+void registerTriggerWait();
+
+} // namespace gfxstream
+
+#endif
diff --git a/src/gfxstream/host/RenderLibImpl.cpp b/src/gfxstream/host/RenderLibImpl.cpp
new file mode 100644
index 00000000000..8f695e6a8ec
--- /dev/null
+++ b/src/gfxstream/host/RenderLibImpl.cpp
@@ -0,0 +1,149 @@
+// 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 "RenderLibImpl.h"
+
+#include "FrameBuffer.h"
+#include "RendererImpl.h"
+#include "aemu/base/files/Stream.h"
+#include "host-common/address_space_device_control_ops.h"
+#include "host-common/crash_reporter.h"
+#include "host-common/dma_device.h"
+#include "host-common/emugl_vm_operations.h"
+#include "host-common/feature_control.h"
+#include "host-common/logging.h"
+#include "host-common/opengl/misc.h"
+#include "host-common/sync_device.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "OpenGLESDispatch/DispatchTables.h"
+#include "OpenGLESDispatch/EGLDispatch.h"
+#endif
+
+namespace gfxstream {
+
+void RenderLibImpl::setRenderer(SelectedRenderer renderer) {
+ emugl::setRenderer(renderer);
+}
+
+void RenderLibImpl::setAvdInfo(bool phone, int api) {
+ emugl::setAvdInfo(phone, api);
+}
+
+void RenderLibImpl::getGlesVersion(int* maj, int* min) {
+ emugl::getGlesVersion(maj, min);
+}
+
+void RenderLibImpl::setLogger(emugl_logger_struct logger) {
+#ifdef CONFIG_AEMU
+ set_gfxstream_logger(logger.coarse);
+ set_gfxstream_fine_logger(logger.fine);
+#endif
+}
+
+void RenderLibImpl::setGLObjectCounter(
+ android::base::GLObjectCounter* counter) {
+ emugl::setGLObjectCounter(counter);
+}
+
+void RenderLibImpl::setCrashReporter(emugl_crash_reporter_t reporter) {
+ // set_emugl_crash_reporter(reporter);
+}
+
+void RenderLibImpl::setFeatureController(emugl_feature_is_enabled_t featureController) {
+ android::featurecontrol::setFeatureEnabledCallback(featureController);
+}
+
+void RenderLibImpl::setSyncDevice
+ (emugl_sync_create_timeline_t create_timeline,
+ emugl_sync_create_fence_t create_fence,
+ emugl_sync_timeline_inc_t timeline_inc,
+ emugl_sync_destroy_timeline_t destroy_timeline,
+ emugl_sync_register_trigger_wait_t register_trigger_wait,
+ emugl_sync_device_exists_t device_exists) {
+ emugl::set_emugl_sync_create_timeline(create_timeline);
+ emugl::set_emugl_sync_create_fence(create_fence);
+ emugl::set_emugl_sync_timeline_inc(timeline_inc);
+ emugl::set_emugl_sync_destroy_timeline(destroy_timeline);
+ emugl::set_emugl_sync_register_trigger_wait(register_trigger_wait);
+ emugl::set_emugl_sync_device_exists(device_exists);
+}
+
+void RenderLibImpl::setDmaOps(emugl_dma_ops ops) {
+ emugl::set_emugl_dma_get_host_addr(ops.get_host_addr);
+ emugl::set_emugl_dma_unlock(ops.unlock);
+}
+
+void RenderLibImpl::setVmOps(const QAndroidVmOperations &vm_operations) {
+ set_emugl_vm_operations(vm_operations);
+}
+
+void RenderLibImpl::setAddressSpaceDeviceControlOps(struct address_space_device_control_ops* ops) {
+ set_emugl_address_space_device_control_ops(ops);
+}
+
+void RenderLibImpl::setWindowOps(const QAndroidEmulatorWindowAgent &window_operations,
+ const QAndroidMultiDisplayAgent &multi_display_operations) {
+ emugl::set_emugl_window_operations(window_operations);
+ emugl::set_emugl_multi_display_operations(multi_display_operations);
+}
+
+void RenderLibImpl::setUsageTracker(android::base::CpuUsage* cpuUsage,
+ android::base::MemoryTracker* memUsage) {
+ emugl::setCpuUsage(cpuUsage);
+ emugl::setMemoryTracker(memUsage);
+}
+
+void RenderLibImpl::setGrallocImplementation(GrallocImplementation gralloc) {
+ emugl::setGrallocImplementation(gralloc);
+}
+
+bool RenderLibImpl::getOpt(RenderOpt* opt) {
+ FrameBuffer* fb = FrameBuffer::getFB();
+ if (fb == nullptr) {
+ return false;
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ opt->display = fb->getDisplay();
+ opt->surface = fb->getWindowSurface();
+ opt->config = fb->getConfig();
+#endif
+ return (opt->display && opt->surface && opt->config);
+}
+
+RendererPtr RenderLibImpl::initRenderer(int width, int height,
+ bool useSubWindow, bool egl2egl) {
+ if (!mRenderer.expired()) {
+ return nullptr;
+ }
+
+ const auto res = std::make_shared<RendererImpl>();
+ if (!res->initialize(width, height, useSubWindow, egl2egl)) {
+ return nullptr;
+ }
+ mRenderer = res;
+ return res;
+}
+
+static void impl_onLastCbRef(uint32_t handle) {
+ FrameBuffer* fb = FrameBuffer::getFB();
+ if (fb)
+ fb->onLastColorBufferRef(handle);
+}
+
+OnLastColorBufferRef RenderLibImpl::getOnLastColorBufferRef() {
+ return (OnLastColorBufferRef)impl_onLastCbRef;
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderLibImpl.h b/src/gfxstream/host/RenderLibImpl.h
new file mode 100644
index 00000000000..dccce4de5b9
--- /dev/null
+++ b/src/gfxstream/host/RenderLibImpl.h
@@ -0,0 +1,73 @@
+// 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 "render-utils/RenderLib.h"
+
+#include "aemu/base/Compiler.h"
+#include "host-common/vm_operations.h"
+#include "host-common/misc.h"
+
+#include <memory>
+
+namespace gfxstream {
+
+class RenderLibImpl final : public RenderLib {
+public:
+ RenderLibImpl() = default;
+
+ virtual void setRenderer(SelectedRenderer renderer) override;
+ virtual void setAvdInfo(bool phone, int api) override;
+ virtual void getGlesVersion(int* maj, int* min) override;
+ virtual void setLogger(emugl_logger_struct logger) override;
+ virtual void setGLObjectCounter(
+ android::base::GLObjectCounter* counter) override;
+ virtual void setCrashReporter(emugl_crash_reporter_t reporter) override;
+ virtual void setFeatureController(emugl_feature_is_enabled_t featureController) override;
+ virtual void setSyncDevice(emugl_sync_create_timeline_t,
+ emugl_sync_create_fence_t,
+ emugl_sync_timeline_inc_t,
+ emugl_sync_destroy_timeline_t,
+ emugl_sync_register_trigger_wait_t,
+ emugl_sync_device_exists_t) override;
+
+ virtual void setDmaOps(emugl_dma_ops) override;
+
+ virtual void setVmOps(const QAndroidVmOperations &vm_operations) override;
+ virtual void setAddressSpaceDeviceControlOps(struct address_space_device_control_ops* ops) override;
+
+ virtual void setWindowOps(const QAndroidEmulatorWindowAgent &window_operations,
+ const QAndroidMultiDisplayAgent &multi_display_operations) override;
+
+ virtual void setUsageTracker(android::base::CpuUsage* cpuUsage,
+ android::base::MemoryTracker* memUsage) override;
+ virtual void setGrallocImplementation(GrallocImplementation gralloc) override;
+
+ virtual bool getOpt(RenderOpt* opt) override;
+
+ virtual RendererPtr initRenderer(int width,
+ int height,
+ bool useSubWindow,
+ bool egl2egl) override;
+
+ OnLastColorBufferRef getOnLastColorBufferRef() override;
+
+private:
+ DISALLOW_COPY_ASSIGN_AND_MOVE(RenderLibImpl);
+
+private:
+ std::weak_ptr<Renderer> mRenderer;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderThread.cpp b/src/gfxstream/host/RenderThread.cpp
new file mode 100644
index 00000000000..d1d34eacb04
--- /dev/null
+++ b/src/gfxstream/host/RenderThread.cpp
@@ -0,0 +1,612 @@
+/*
+* 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 "RenderThread.h"
+
+#include "ChannelStream.h"
+#include "FrameBuffer.h"
+#include "ReadBuffer.h"
+#include "RenderChannelImpl.h"
+#include "RenderThreadInfo.h"
+#include "RingStream.h"
+#include "VkDecoderContext.h"
+#include "aemu/base/HealthMonitor.h"
+#include "aemu/base/Metrics.h"
+#include "aemu/base/files/StreamSerializing.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/synchronization/MessageChannel.h"
+#include "aemu/base/system/System.h"
+#include "apigen-codec-common/ChecksumCalculatorThreadInfo.h"
+#include "host-common/feature_control.h"
+#include "host-common/logging.h"
+#include "vulkan/VkCommonOperations.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "RenderControl.h"
+#endif
+
+#define EMUGL_DEBUG_LEVEL 0
+#include "host-common/debug.h"
+
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+
+#include <assert.h>
+#include <string.h>
+
+#include <unordered_map>
+
+namespace gfxstream {
+
+using android::base::AutoLock;
+using android::base::EventHangMetadata;
+using android::base::MessageChannel;
+using emugl::GfxApiLogger;
+using vk::VkDecoderContext;
+
+struct RenderThread::SnapshotObjects {
+ RenderThreadInfo* threadInfo;
+ ChecksumCalculator* checksumCalc;
+ ChannelStream* channelStream;
+ RingStream* ringStream;
+ ReadBuffer* readBuffer;
+};
+
+static bool getBenchmarkEnabledFromEnv() {
+ auto threadEnabled = android::base::getEnvironmentVariable("ANDROID_EMUGL_RENDERTHREAD_STATS");
+ if (threadEnabled == "1") return true;
+ return false;
+}
+
+// Start with a smaller buffer to not waste memory on a low-used render threads.
+static constexpr int kStreamBufferSize = 128 * 1024;
+
+// Requires this many threads on the system available to run unlimited.
+static constexpr int kMinThreadsToRunUnlimited = 5;
+
+// A thread run limiter that limits render threads to run one slice at a time.
+static android::base::Lock sThreadRunLimiter;
+
+RenderThread::RenderThread(RenderChannelImpl* channel,
+ android::base::Stream* loadStream,
+ uint32_t virtioGpuContextId)
+ : android::base::Thread(android::base::ThreadFlags::MaskSignals, 2 * 1024 * 1024),
+ mChannel(channel),
+ mRunInLimitedMode(android::base::getCpuCoreCount() < kMinThreadsToRunUnlimited),
+ mContextId(virtioGpuContextId)
+{
+ if (loadStream) {
+ const bool success = loadStream->getByte();
+ if (success) {
+ mStream.emplace(0);
+ android::base::loadStream(loadStream, &*mStream);
+ mState = SnapshotState::StartLoading;
+ } else {
+ mFinished.store(true, std::memory_order_relaxed);
+ }
+ }
+}
+
+RenderThread::RenderThread(
+ struct asg_context context,
+ android::base::Stream* loadStream,
+ android::emulation::asg::ConsumerCallbacks callbacks,
+ uint32_t contextId, uint32_t capsetId,
+ std::optional<std::string> nameOpt)
+ : android::base::Thread(android::base::ThreadFlags::MaskSignals, 2 * 1024 * 1024,
+ std::move(nameOpt)),
+ mRingStream(
+ new RingStream(context, callbacks, kStreamBufferSize)),
+ mContextId(contextId), mCapsetId(capsetId) {
+ if (loadStream) {
+ const bool success = loadStream->getByte();
+ if (success) {
+ mStream.emplace(0);
+ android::base::loadStream(loadStream, &*mStream);
+ mState = SnapshotState::StartLoading;
+ } else {
+ mFinished.store(true, std::memory_order_relaxed);
+ }
+ }
+}
+
+// Note: the RenderThread destructor might be called from a different thread
+// than from RenderThread::main() so thread specific cleanup likely belongs at
+// the end of RenderThread::main().
+RenderThread::~RenderThread() = default;
+
+void RenderThread::pausePreSnapshot() {
+ AutoLock lock(mLock);
+ assert(mState == SnapshotState::Empty);
+ mStream.emplace();
+ mState = SnapshotState::StartSaving;
+ if (mRingStream) {
+ mRingStream->pausePreSnapshot();
+ // mCondVar.broadcastAndUnlock(&lock);
+ }
+ if (mChannel) {
+ mChannel->pausePreSnapshot();
+ mCondVar.broadcastAndUnlock(&lock);
+ }
+}
+
+void RenderThread::resume(bool waitForSave) {
+ AutoLock lock(mLock);
+ // This function can be called for a thread from pre-snapshot loading
+ // state; it doesn't need to do anything.
+ if (mState == SnapshotState::Empty) {
+ return;
+ }
+ if (mRingStream) mRingStream->resume();
+ if (waitForSave) {
+ waitForSnapshotCompletion(&lock);
+ }
+ mNeedReloadProcessResources = true;
+ mStream.clear();
+ mState = SnapshotState::Empty;
+ if (mChannel) mChannel->resume();
+ if (mRingStream) mRingStream->resume();
+ mCondVar.broadcastAndUnlock(&lock);
+}
+
+void RenderThread::save(android::base::Stream* stream) {
+ bool success;
+ {
+ AutoLock lock(mLock);
+ assert(mState == SnapshotState::StartSaving ||
+ mState == SnapshotState::InProgress ||
+ mState == SnapshotState::Finished);
+ waitForSnapshotCompletion(&lock);
+ success = mState == SnapshotState::Finished;
+ }
+
+ if (success) {
+ assert(mStream);
+ stream->putByte(1);
+ android::base::saveStream(stream, *mStream);
+ } else {
+ stream->putByte(0);
+ }
+}
+
+void RenderThread::waitForSnapshotCompletion(AutoLock* lock) {
+ while (mState != SnapshotState::Finished &&
+ !mFinished.load(std::memory_order_relaxed)) {
+ mCondVar.wait(lock);
+ }
+}
+
+template <class OpImpl>
+void RenderThread::snapshotOperation(AutoLock* lock, OpImpl&& implFunc) {
+ assert(isPausedForSnapshotLocked());
+ mState = SnapshotState::InProgress;
+ mCondVar.broadcastAndUnlock(lock);
+
+ implFunc();
+
+ lock->lock();
+
+ mState = SnapshotState::Finished;
+ mCondVar.broadcast();
+
+ // Only return after we're allowed to proceed.
+ while (isPausedForSnapshotLocked()) {
+ mCondVar.wait(lock);
+ }
+}
+
+void RenderThread::loadImpl(AutoLock* lock, const SnapshotObjects& objects) {
+ snapshotOperation(lock, [this, &objects] {
+ objects.readBuffer->onLoad(&*mStream);
+ if (objects.channelStream) objects.channelStream->load(&*mStream);
+ if (objects.ringStream) objects.ringStream->load(&*mStream);
+ objects.checksumCalc->load(&*mStream);
+ objects.threadInfo->onLoad(&*mStream);
+ });
+}
+
+void RenderThread::saveImpl(AutoLock* lock, const SnapshotObjects& objects) {
+ snapshotOperation(lock, [this, &objects] {
+ objects.readBuffer->onSave(&*mStream);
+ if (objects.channelStream) objects.channelStream->save(&*mStream);
+ if (objects.ringStream) objects.ringStream->save(&*mStream);
+ objects.checksumCalc->save(&*mStream);
+ objects.threadInfo->onSave(&*mStream);
+ });
+}
+
+bool RenderThread::isPausedForSnapshotLocked() const {
+ return mState != SnapshotState::Empty;
+}
+
+bool RenderThread::doSnapshotOperation(const SnapshotObjects& objects,
+ SnapshotState state) {
+ AutoLock lock(mLock);
+ if (mState == state) {
+ switch (state) {
+ case SnapshotState::StartLoading:
+ loadImpl(&lock, objects);
+ return true;
+ case SnapshotState::StartSaving:
+ saveImpl(&lock, objects);
+ return true;
+ default:
+ return false;
+ }
+ }
+ return false;
+}
+
+void RenderThread::setFinished() {
+ // Make sure it never happens that we wait forever for the thread to
+ // save to snapshot while it was not even going to.
+ AutoLock lock(mLock);
+ mFinished.store(true, std::memory_order_relaxed);
+ if (mState != SnapshotState::Empty) {
+ mCondVar.broadcastAndUnlock(&lock);
+ }
+}
+
+intptr_t RenderThread::main() {
+ if (mFinished.load(std::memory_order_relaxed)) {
+ ERR("Error: fail loading a RenderThread @%p", this);
+ return 0;
+ }
+
+ RenderThreadInfo tInfo;
+ ChecksumCalculatorThreadInfo tChecksumInfo;
+ ChecksumCalculator& checksumCalc = tChecksumInfo.get();
+ bool needRestoreFromSnapshot = false;
+
+ //
+ // initialize decoders
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (!feature_is_enabled(kFeature_GuestUsesAngle)) {
+ tInfo.initGl();
+ }
+
+ initRenderControlContext(&tInfo.m_rcDec);
+#endif
+
+ if (!mChannel && !mRingStream) {
+ GL_LOG("Exited a loader RenderThread @%p", this);
+ mFinished.store(true, std::memory_order_relaxed);
+ return 0;
+ }
+
+ ChannelStream stream(mChannel, RenderChannel::Buffer::kSmallSize);
+ IOStream* ioStream =
+ mChannel ? (IOStream*)&stream : (IOStream*)mRingStream.get();
+
+ ReadBuffer readBuf(kStreamBufferSize);
+ if (mRingStream) {
+ readBuf.setNeededFreeTailSize(0);
+ }
+
+ const SnapshotObjects snapshotObjects = {
+ &tInfo, &checksumCalc, &stream, mRingStream.get(), &readBuf,
+ };
+
+ // Framebuffer initialization is asynchronous, so we need to make sure
+ // it's completely initialized before running any GL commands.
+ FrameBuffer::waitUntilInitialized();
+ if (vk::getGlobalVkEmulation()) {
+ tInfo.m_vkInfo.emplace();
+ }
+
+#if GFXSTREAM_ENABLE_HOST_MAGMA
+ tInfo.m_magmaInfo.emplace(mContextId);
+#endif
+
+ // This is the only place where we try loading from snapshot.
+ // But the context bind / restoration will be delayed after receiving
+ // the first GL command.
+ if (doSnapshotOperation(snapshotObjects, SnapshotState::StartLoading)) {
+ GL_LOG("Loaded RenderThread @%p from snapshot", this);
+ needRestoreFromSnapshot = true;
+ } else {
+ // Not loading from a snapshot: continue regular startup, read
+ // the |flags|.
+ uint32_t flags = 0;
+ while (ioStream->read(&flags, sizeof(flags)) != sizeof(flags)) {
+ // Stream read may fail because of a pending snapshot.
+ if (!doSnapshotOperation(snapshotObjects, SnapshotState::StartSaving)) {
+ setFinished();
+ GL_LOG("Exited a RenderThread @%p early", this);
+ return 0;
+ }
+ }
+
+ // |flags| used to mean something, now they're not used.
+ (void)flags;
+ }
+
+ int stats_totalBytes = 0;
+ uint64_t stats_progressTimeUs = 0;
+ auto stats_t0 = android::base::getHighResTimeUs() / 1000;
+ bool benchmarkEnabled = getBenchmarkEnabledFromEnv();
+
+ //
+ // open dump file if RENDER_DUMP_DIR is defined
+ //
+ const char* dump_dir = getenv("RENDERER_DUMP_DIR");
+ FILE* dumpFP = nullptr;
+ if (dump_dir) {
+ // size_t bsize = strlen(dump_dir) + 32;
+ // char* fname = new char[bsize];
+ // snprintf(fname, bsize, "%s" PATH_SEP "stream_%p", dump_dir, this);
+ // dumpFP = android_fopen(fname, "wb");
+ // if (!dumpFP) {
+ // fprintf(stderr, "Warning: stream dump failed to open file %s\n",
+ // fname);
+ // }
+ // delete[] fname;
+ }
+
+ GfxApiLogger gfxLogger;
+ auto& metricsLogger = FrameBuffer::getFB()->getMetricsLogger();
+
+ const ProcessResources* processResources = nullptr;
+ bool anyProgress = false;
+ while (true) {
+ // Let's make sure we read enough data for at least some processing.
+ uint32_t packetSize;
+ if (readBuf.validData() >= 8) {
+ // We know that packet size is the second int32_t from the start.
+ packetSize = *(uint32_t*)(readBuf.buf() + 4);
+ if (!packetSize) {
+ // Emulator will get live-stuck here if packet size is read to be zero;
+ // crash right away so we can see these events.
+ // emugl::emugl_crash_reporter(
+ // "Guest should never send a size-0 GL packet\n");
+ }
+ } else {
+ // Read enough data to at least be able to get the packet size next
+ // time.
+ packetSize = 8;
+ }
+ if (!anyProgress) {
+ // If we didn't make any progress last time, then make sure we read at least one
+ // extra byte.
+ packetSize = std::max(packetSize, static_cast<uint32_t>(readBuf.validData() + 1));
+ }
+ int stat = 0;
+ if (packetSize > readBuf.validData()) {
+ stat = readBuf.getData(ioStream, packetSize);
+ if (stat <= 0) {
+ if (doSnapshotOperation(snapshotObjects, SnapshotState::StartSaving)) {
+ continue;
+ } else {
+ D("Warning: render thread could not read data from stream");
+ break;
+ }
+ } else if (needRestoreFromSnapshot) {
+ // If we're using RingStream that might load before FrameBuffer
+ // restores the contexts from the handles, so check again here.
+
+ tInfo.postLoadRefreshCurrentContextSurfacePtrs();
+ needRestoreFromSnapshot = false;
+ }
+ if (mNeedReloadProcessResources) {
+ processResources = nullptr;
+ mNeedReloadProcessResources = false;
+ }
+ }
+
+ DD("render thread read %i bytes, op %i, packet size %i",
+ readBuf.validData(), *(uint32_t*)readBuf.buf(),
+ *(uint32_t*)(readBuf.buf() + 4));
+
+ //
+ // log received bandwidth statistics
+ //
+ if (benchmarkEnabled) {
+ stats_totalBytes += readBuf.validData();
+ auto dt = android::base::getHighResTimeUs() / 1000 - stats_t0;
+ if (dt > 1000) {
+ float dts = (float)dt / 1000.0f;
+ printf("Used Bandwidth %5.3f MB/s, time in progress %f ms total %f ms\n", ((float)stats_totalBytes / dts) / (1024.0f*1024.0f),
+ stats_progressTimeUs / 1000.0f,
+ (float)dt);
+ readBuf.printStats();
+ stats_t0 = android::base::getHighResTimeUs() / 1000;
+ stats_progressTimeUs = 0;
+ stats_totalBytes = 0;
+ }
+ }
+
+ //
+ // dump stream to file if needed
+ //
+ if (dumpFP) {
+ int skip = readBuf.validData() - stat;
+ fwrite(readBuf.buf() + skip, 1, readBuf.validData() - skip, dumpFP);
+ fflush(dumpFP);
+ }
+
+ bool progress = false;
+ anyProgress = false;
+ do {
+ anyProgress |= progress;
+ std::unique_ptr<EventHangMetadata::HangAnnotations> renderThreadData =
+ std::make_unique<EventHangMetadata::HangAnnotations>();
+
+ const char* contextName = nullptr;
+ if (mNameOpt) {
+ contextName = (*mNameOpt).c_str();
+ }
+
+ auto* healthMonitor = FrameBuffer::getFB()->getHealthMonitor();
+ if (healthMonitor) {
+ if (contextName) {
+ renderThreadData->insert(
+ {{"renderthread_guest_process", contextName}});
+ }
+ if (readBuf.validData() >= 4) {
+ renderThreadData->insert(
+ {{"first_opcode", std::to_string(*(uint32_t*)readBuf.buf())},
+ {"buffer_length", std::to_string(readBuf.validData())}});
+ }
+ }
+ auto watchdog = WATCHDOG_BUILDER(healthMonitor, "RenderThread decode operation")
+ .setHangType(EventHangMetadata::HangType::kRenderThread)
+ .setAnnotations(std::move(renderThreadData))
+ .build();
+
+#ifndef AEMU_BUILD
+ if (!tInfo.m_puid) {
+ tInfo.m_puid = mContextId;
+ }
+#endif
+
+ if (!processResources && tInfo.m_puid) {
+ processResources = FrameBuffer::getFB()->getProcessResources(tInfo.m_puid);
+ }
+
+ progress = false;
+ size_t last;
+
+ //
+ // try to process some of the command buffer using the
+ // Vulkan decoder
+ //
+ // Note: It's risky to limit Vulkan decoding to one thread,
+ // so we do it outside the limiter
+ if (tInfo.m_vkInfo) {
+ tInfo.m_vkInfo->ctx_id = mContextId;
+ VkDecoderContext context = {
+ .processName = contextName,
+ .gfxApiLogger = &gfxLogger,
+ .healthMonitor = FrameBuffer::getFB()->getHealthMonitor(),
+ .metricsLogger = &metricsLogger,
+ };
+ last = tInfo.m_vkInfo->m_vkDec.decode(readBuf.buf(), readBuf.validData(), ioStream,
+ processResources, context);
+ if (last > 0) {
+ if (!processResources) {
+ ERR("Processed some Vulkan packets without process resources created. "
+ "That's problematic.");
+ }
+ readBuf.consume(last);
+ progress = true;
+ }
+ }
+
+ if (mRunInLimitedMode) {
+ sThreadRunLimiter.lock();
+ }
+
+ // try to process some of the command buffer using the GLESv1
+ // decoder
+ //
+ // DRIVER WORKAROUND:
+ // On Linux with NVIDIA GPU's at least, we need to avoid performing
+ // GLES ops while someone else holds the FrameBuffer write lock.
+ //
+ // To be more specific, on Linux with NVIDIA Quadro K2200 v361.xx,
+ // we get a segfault in the NVIDIA driver when glTexSubImage2D
+ // is called at the same time as glXMake(Context)Current.
+ //
+ // To fix, this driver workaround avoids calling
+ // any sort of GLES call when we are creating/destroying EGL
+ // contexts.
+ {
+ FrameBuffer::getFB()->lockContextStructureRead();
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (tInfo.m_glInfo) {
+ {
+ last = tInfo.m_glInfo->m_glDec.decode(
+ readBuf.buf(), readBuf.validData(), ioStream, &checksumCalc);
+ if (last > 0) {
+ progress = true;
+ readBuf.consume(last);
+ }
+ }
+
+ //
+ // try to process some of the command buffer using the GLESv2
+ // decoder
+ //
+ {
+ last = tInfo.m_glInfo->m_gl2Dec.decode(readBuf.buf(), readBuf.validData(),
+ ioStream, &checksumCalc);
+
+ if (last > 0) {
+ progress = true;
+ readBuf.consume(last);
+ }
+ }
+ }
+#endif
+
+ FrameBuffer::getFB()->unlockContextStructureRead();
+ //
+ // try to process some of the command buffer using the
+ // renderControl decoder
+ //
+#if GFXSTREAM_ENABLE_HOST_GLES
+ {
+ last = tInfo.m_rcDec.decode(readBuf.buf(), readBuf.validData(),
+ ioStream, &checksumCalc);
+ if (last > 0) {
+ readBuf.consume(last);
+ progress = true;
+ }
+ }
+#endif
+
+ //
+ // try to process some of the command buffer using the Magma
+ // decoder
+ //
+#if GFXSTREAM_ENABLE_HOST_MAGMA
+ if (tInfo.m_magmaInfo && tInfo.m_magmaInfo->mMagmaDec)
+ {
+ last = tInfo.m_magmaInfo->mMagmaDec->decode(readBuf.buf(), readBuf.validData(),
+ ioStream, &checksumCalc);
+ if (last > 0) {
+ readBuf.consume(last);
+ progress = true;
+ }
+ }
+#endif
+
+ if (mRunInLimitedMode) {
+ sThreadRunLimiter.unlock();
+ }
+
+ } while (progress);
+ }
+
+ if (dumpFP) {
+ fclose(dumpFP);
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (tInfo.m_glInfo) {
+ FrameBuffer::getFB()->drainGlRenderThreadResources();
+ }
+#endif
+
+ setFinished();
+
+ GL_LOG("Exited a RenderThread @%p", this);
+ return 0;
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderThread.h b/src/gfxstream/host/RenderThread.h
new file mode 100644
index 00000000000..38cc58b1738
--- /dev/null
+++ b/src/gfxstream/host/RenderThread.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.
+*/
+#pragma once
+
+#include "aemu/base/files/MemStream.h"
+#include "aemu/base/Optional.h"
+#include "host-common/address_space_graphics_types.h"
+#include "aemu/base/synchronization/ConditionVariable.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/threads/Thread.h"
+
+#include <atomic>
+#include <memory>
+
+namespace gfxstream {
+
+class RenderChannelImpl;
+class RendererImpl;
+class ReadBuffer;
+class RingStream;
+
+// A class used to model a thread of the RenderServer. Each one of them
+// handles a single guest client / protocol byte stream.
+class RenderThread : public android::base::Thread {
+ using MemStream = android::base::MemStream;
+
+public:
+ // Create a new RenderThread instance.
+ RenderThread(RenderChannelImpl* channel,
+ android::base::Stream* loadStream = nullptr,
+ uint32_t virtioGpuContextId = -1);
+
+ // Create a new RenderThread instance tied to the address space device.
+ RenderThread(
+ struct asg_context context,
+ android::base::Stream* loadStream,
+ android::emulation::asg::ConsumerCallbacks callbacks,
+ uint32_t contextId, uint32_t capsetId,
+ std::optional<std::string> nameOpt);
+ virtual ~RenderThread();
+
+ // Returns true iff the thread has finished.
+ bool isFinished() const { return mFinished.load(std::memory_order_relaxed); }
+
+ void pausePreSnapshot();
+ void resume(bool waitForSave);
+ void save(android::base::Stream* stream);
+
+private:
+ virtual intptr_t main();
+ void setFinished();
+
+ // Snapshot support.
+ enum class SnapshotState {
+ Empty,
+ StartSaving,
+ StartLoading,
+ InProgress,
+ Finished,
+ };
+
+ // Whether using RenderChannel or a ring buffer.
+ enum TransportMode {
+ Channel,
+ Ring,
+ };
+
+ template <class OpImpl>
+ void snapshotOperation(android::base::AutoLock* lock, OpImpl&& impl);
+
+ struct SnapshotObjects;
+
+ bool doSnapshotOperation(const SnapshotObjects& objects,
+ SnapshotState operation);
+ void waitForSnapshotCompletion(android::base::AutoLock* lock);
+ void loadImpl(android::base::AutoLock* lock, const SnapshotObjects& objects);
+ void saveImpl(android::base::AutoLock* lock, const SnapshotObjects& objects);
+
+ bool isPausedForSnapshotLocked() const;
+
+ RenderChannelImpl* mChannel = nullptr;
+ std::unique_ptr<RingStream> mRingStream;
+
+ SnapshotState mState = SnapshotState::Empty;
+ std::atomic<bool> mFinished { false };
+ android::base::Lock mLock;
+ android::base::ConditionVariable mCondVar;
+ android::base::Optional<android::base::MemStream> mStream;
+
+ bool mRunInLimitedMode = false;
+ uint32_t mContextId = 0;
+ uint32_t mCapsetId = 0;
+ // If we need to reload process resources.
+ // This happens in snapshot testing where we don't snapshot render threads.
+ bool mNeedReloadProcessResources = false;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderThreadInfo.cpp b/src/gfxstream/host/RenderThreadInfo.cpp
new file mode 100644
index 00000000000..b3cab715891
--- /dev/null
+++ b/src/gfxstream/host/RenderThreadInfo.cpp
@@ -0,0 +1,101 @@
+/*
+* 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 "RenderThreadInfo.h"
+
+#include "aemu/base/synchronization/Lock.h"
+#include "host-common/feature_control.h"
+
+#include <unordered_map>
+#include <unordered_set>
+
+namespace gfxstream {
+
+using android::base::AutoLock;
+using android::base::Stream;
+using android::base::Lock;
+
+static thread_local RenderThreadInfo* s_threadInfoPtr;
+
+struct RenderThreadRegistry {
+ Lock lock;
+ std::unordered_set<RenderThreadInfo*> threadInfos;
+};
+
+static RenderThreadRegistry sRegistry;
+
+RenderThreadInfo::RenderThreadInfo() {
+ s_threadInfoPtr = this;
+ AutoLock lock(sRegistry.lock);
+ sRegistry.threadInfos.insert(this);
+}
+
+RenderThreadInfo::~RenderThreadInfo() {
+ s_threadInfoPtr = nullptr;
+ AutoLock lock(sRegistry.lock);
+ sRegistry.threadInfos.erase(this);
+}
+
+RenderThreadInfo* RenderThreadInfo::get() {
+ return s_threadInfoPtr;
+}
+
+// Loop over all active render thread infos. Takes the global render thread info lock.
+void RenderThreadInfo::forAllRenderThreadInfos(std::function<void(RenderThreadInfo*)> f) {
+ AutoLock lock(sRegistry.lock);
+ for (auto info: sRegistry.threadInfos) {
+ f(info);
+ }
+}
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+void RenderThreadInfo::initGl() {
+ m_glInfo.emplace();
+}
+#endif
+
+void RenderThreadInfo::onSave(Stream* stream) {
+ // TODO(b/309858017): remove if when ready to bump snapshot version
+ if (feature_is_enabled(kFeature_VulkanSnapshots)) {
+ stream->putBe64(m_puid);
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ m_glInfo->onSave(stream);
+#endif
+}
+
+bool RenderThreadInfo::onLoad(Stream* stream) {
+ // TODO(b/309858017): remove if when ready to bump snapshot version
+ if (feature_is_enabled(kFeature_VulkanSnapshots)) {
+ m_puid = stream->getBe64();
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ return m_glInfo->onLoad(stream);
+#else
+ // Functions only work with GLES for now.
+ return false;
+#endif
+}
+
+void RenderThreadInfo::postLoadRefreshCurrentContextSurfacePtrs() {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ return m_glInfo->postLoadRefreshCurrentContextSurfacePtrs();
+#endif
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderThreadInfo.h b/src/gfxstream/host/RenderThreadInfo.h
new file mode 100644
index 00000000000..5e20d8a5188
--- /dev/null
+++ b/src/gfxstream/host/RenderThreadInfo.h
@@ -0,0 +1,88 @@
+/*
+* 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 _LIB_OPENGL_RENDER_THREAD_INFO_H
+#define _LIB_OPENGL_RENDER_THREAD_INFO_H
+
+#include <functional>
+#include <memory>
+#include <unordered_set>
+
+#include "aemu/base/files/Stream.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "renderControl_dec/renderControl_dec.h"
+#include "RenderThreadInfoGl.h"
+#endif
+
+#include "RenderThreadInfoVk.h"
+
+#if GFXSTREAM_ENABLE_HOST_MAGMA
+#include "RenderThreadInfoMagma.h"
+#endif
+
+namespace gfxstream {
+
+// A class used to model the state of each RenderThread related
+struct RenderThreadInfo {
+ // Create new instance. Only call this once per thread.
+ // Future callls to get() will return this instance until
+ // it is destroyed.
+ RenderThreadInfo();
+
+ // Destructor.
+ ~RenderThreadInfo();
+
+ // Return the current thread's instance, if any, or NULL.
+ static RenderThreadInfo* get();
+
+ // Loop over all active render thread infos
+ static void forAllRenderThreadInfos(std::function<void(RenderThreadInfo*)>);
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ void initGl();
+#endif
+
+ // The unique id of owner guest process of this render thread
+ uint64_t m_puid = 0;
+ std::optional<std::string> m_processName;
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ renderControl_decoder_context_t m_rcDec;
+ std::optional<gl::RenderThreadInfoGl> m_glInfo;
+#endif
+
+ std::optional<vk::RenderThreadInfoVk> m_vkInfo;
+
+#if GFXSTREAM_ENABLE_HOST_MAGMA
+ std::optional<RenderThreadInfoMagma> m_magmaInfo;
+#endif
+
+ // Whether this thread was used to perform composition.
+ bool m_isCompositionThread = false;
+
+ // Functions to save / load a snapshot
+ // They must be called after Framebuffer snapshot
+ void onSave(android::base::Stream* stream);
+ bool onLoad(android::base::Stream* stream);
+
+ // Sometimes we can load render thread info before
+ // FrameBuffer repopulates the contexts.
+ void postLoadRefreshCurrentContextSurfacePtrs();
+};
+
+} // namespace gfxstream
+
+#endif
diff --git a/src/gfxstream/host/RenderThreadInfoGl.cpp b/src/gfxstream/host/RenderThreadInfoGl.cpp
new file mode 100644
index 00000000000..5bd191f13cc
--- /dev/null
+++ b/src/gfxstream/host/RenderThreadInfoGl.cpp
@@ -0,0 +1,137 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "RenderThreadInfoGl.h"
+
+#include <unordered_set>
+
+#include "FrameBuffer.h"
+#include "OpenGLESDispatch/EGLDispatch.h"
+#include "OpenGLESDispatch/GLESv1Dispatch.h"
+#include "OpenGLESDispatch/GLESv2Dispatch.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/containers/Lookup.h"
+#include "aemu/base/files/StreamSerializing.h"
+#include "host-common/GfxstreamFatalError.h"
+
+namespace gfxstream {
+namespace gl {
+
+using android::base::AutoLock;
+using android::base::Lock;
+using android::base::Stream;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+static thread_local RenderThreadInfoGl* tlThreadInfo = nullptr;
+
+RenderThreadInfoGl::RenderThreadInfoGl() {
+ m_glDec.initGL(gles1_dispatch_get_proc_func, nullptr);
+ m_gl2Dec.initGL(gles2_dispatch_get_proc_func, nullptr);
+
+ if (tlThreadInfo != nullptr) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Attempted to set thread local GL render thread info twice.";
+ }
+ tlThreadInfo = this;
+}
+
+RenderThreadInfoGl::~RenderThreadInfoGl() {
+ tlThreadInfo = nullptr;
+}
+
+RenderThreadInfoGl* RenderThreadInfoGl::get() { return tlThreadInfo; }
+
+void RenderThreadInfoGl::onSave(Stream* stream) {
+ if (currContext) {
+ stream->putBe32(currContext->getHndl());
+ } else {
+ stream->putBe32(0);
+ }
+ if (currDrawSurf) {
+ stream->putBe32(currDrawSurf->getHndl());
+ } else {
+ stream->putBe32(0);
+ }
+ if (currReadSurf) {
+ stream->putBe32(currReadSurf->getHndl());
+ } else {
+ stream->putBe32(0);
+ }
+
+ saveCollection(stream, m_contextSet, [](Stream* stream, HandleType val) {
+ stream->putBe32(val);
+ });
+ saveCollection(stream, m_windowSet, [](Stream* stream, HandleType val) {
+ stream->putBe32(val);
+ });
+
+ stream->putBe64(m_puid);
+
+ // No need to associate render threads with sync threads
+ // if there is a global sync thread. This is only needed
+ // to maintain backward compatibility with snapshot file format.
+ // (Used to be: stream->putBe64(syncThreadAlias))
+ stream->putBe64(0);
+}
+
+bool RenderThreadInfoGl::onLoad(Stream* stream) {
+ FrameBuffer* fb = FrameBuffer::getFB();
+ assert(fb);
+ HandleType ctxHndl = stream->getBe32();
+ HandleType drawSurf = stream->getBe32();
+ HandleType readSurf = stream->getBe32();
+ currContextHandleFromLoad = ctxHndl;
+ currDrawSurfHandleFromLoad = drawSurf;
+ currReadSurfHandleFromLoad = readSurf;
+
+ fb->lock();
+ currContext = fb->getContext_locked(ctxHndl);
+ currDrawSurf = fb->getWindowSurface_locked(drawSurf);
+ currReadSurf = fb->getWindowSurface_locked(readSurf);
+ fb->unlock();
+
+ loadCollection(stream, &m_contextSet, [](Stream* stream) {
+ return stream->getBe32();
+ });
+ loadCollection(stream, &m_windowSet, [](Stream* stream) {
+ return stream->getBe32();
+ });
+
+ m_puid = stream->getBe64();
+
+ // (Used to be: syncThreadAlias = stream->getBe64())
+ stream->getBe64();
+
+ return true;
+}
+
+void RenderThreadInfoGl::postLoadRefreshCurrentContextSurfacePtrs() {
+ FrameBuffer* fb = FrameBuffer::getFB();
+ assert(fb);
+
+ fb->lock();
+ currContext = fb->getContext_locked(currContextHandleFromLoad);
+ currDrawSurf = fb->getWindowSurface_locked(currDrawSurfHandleFromLoad);
+ currReadSurf = fb->getWindowSurface_locked(currReadSurfHandleFromLoad);
+ fb->unlock();
+
+ const HandleType ctx = currContext ? currContext->getHndl() : 0;
+ const HandleType draw = currDrawSurf ? currDrawSurf->getHndl() : 0;
+ const HandleType read = currReadSurf ? currReadSurf->getHndl() : 0;
+ fb->bindContext(ctx, draw, read);
+}
+
+} // namespace gl
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/RenderThreadInfoGl.h b/src/gfxstream/host/RenderThreadInfoGl.h
new file mode 100644
index 00000000000..f6c02554423
--- /dev/null
+++ b/src/gfxstream/host/RenderThreadInfoGl.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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <optional>
+#include <string>
+
+#include "Handle.h"
+#include "StalePtrRegistry.h"
+#include "aemu/base/files/Stream.h"
+#include "gl/EmulatedEglContext.h"
+#include "gl/EmulatedEglWindowSurface.h"
+#include "gl/gles1_dec/GLESv1Decoder.h"
+#include "gl/gles2_dec/GLESv2Decoder.h"
+
+namespace gfxstream {
+namespace gl {
+
+struct RenderThreadInfoGl {
+ // Create new instance. Only call this once per thread.
+ // Future calls to get() will return this instance until
+ // it is destroyed.
+ RenderThreadInfoGl();
+
+ // Destructor.
+ ~RenderThreadInfoGl();
+
+ // Return the current thread's instance, if any, or NULL.
+ static RenderThreadInfoGl* get();
+
+ // Functions to save / load a snapshot
+ // They must be called after Framebuffer snapshot
+ void onSave(android::base::Stream* stream);
+ bool onLoad(android::base::Stream* stream);
+
+ // Sometimes we can load render thread info before
+ // FrameBuffer repopulates the contexts.
+ void postLoadRefreshCurrentContextSurfacePtrs();
+
+ // The unique id of owner guest process of this render thread
+ uint64_t m_puid = 0;
+
+ // All the contexts that are created by this render thread.
+ // New emulator manages contexts in guest process level,
+ // m_contextSet should be deprecated. It is only kept for
+ // backward compatibility reason.
+ ThreadContextSet m_contextSet;
+ // all the window surfaces that are created by this render thread
+ WindowSurfaceSet m_windowSet;
+
+ // Current EGL context, draw surface and read surface.
+ HandleType currContextHandleFromLoad;
+ HandleType currDrawSurfHandleFromLoad;
+ HandleType currReadSurfHandleFromLoad;
+
+ EmulatedEglContextPtr currContext;
+ EmulatedEglWindowSurfacePtr currDrawSurf;
+ EmulatedEglWindowSurfacePtr currReadSurf;
+
+ // Decoder states.
+ GLESv1Decoder m_glDec;
+ GLESv2Decoder m_gl2Dec;
+};
+
+} // namespace gl
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/RenderThreadInfoMagma.cpp b/src/gfxstream/host/RenderThreadInfoMagma.cpp
new file mode 100644
index 00000000000..3c8b678e0a8
--- /dev/null
+++ b/src/gfxstream/host/RenderThreadInfoMagma.cpp
@@ -0,0 +1,36 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "RenderThreadInfoMagma.h"
+
+#include "host-common/GfxstreamFatalError.h"
+
+static thread_local RenderThreadInfoMagma* tlThreadInfo = nullptr;
+
+RenderThreadInfoMagma::RenderThreadInfoMagma(uint32_t context_id) {
+ if (tlThreadInfo != nullptr) {
+ GFXSTREAM_ABORT(emugl::FatalError(emugl::ABORT_REASON_OTHER))
+ << "Attempted to set thread local Magma render thread info twice.";
+ }
+ tlThreadInfo = this;
+ mMagmaDec = gfxstream::magma::Decoder::create(context_id);
+}
+
+RenderThreadInfoMagma::~RenderThreadInfoMagma() {
+ tlThreadInfo = nullptr;
+}
+
+RenderThreadInfoMagma* RenderThreadInfoMagma::get() {
+ return tlThreadInfo;
+}
diff --git a/src/gfxstream/host/RenderThreadInfoMagma.h b/src/gfxstream/host/RenderThreadInfoMagma.h
new file mode 100644
index 00000000000..42e327c9480
--- /dev/null
+++ b/src/gfxstream/host/RenderThreadInfoMagma.h
@@ -0,0 +1,34 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include "magma/Decoder.h"
+
+struct RenderThreadInfoMagma {
+ // Create new instance. Only call this once per thread.
+ // Future calls to get() will return this instance until
+ // it is destroyed.
+ RenderThreadInfoMagma(uint32_t context_id);
+
+ // Destructor.
+ ~RenderThreadInfoMagma();
+
+ // Return the current thread's instance, if any, or NULL.
+ static RenderThreadInfoMagma* get();
+
+ // Decoder state.
+ // TODO(b/271593488): Support dynamic detection of host device.
+ std::unique_ptr<gfxstream::magma::Decoder> mMagmaDec;
+};
diff --git a/src/gfxstream/host/RenderWindow.cpp b/src/gfxstream/host/RenderWindow.cpp
new file mode 100644
index 00000000000..ace61148123
--- /dev/null
+++ b/src/gfxstream/host/RenderWindow.cpp
@@ -0,0 +1,698 @@
+// Copyright 2014-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 "RenderWindow.h"
+
+#include "aemu/base/threads/Thread.h"
+#include "aemu/base/synchronization/MessageChannel.h"
+#include "host-common/logging.h"
+#include "FrameBuffer.h"
+#include "RendererImpl.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#ifndef _WIN32
+#include <signal.h>
+#include <pthread.h>
+#endif
+
+namespace gfxstream {
+
+#define DEBUG 0
+
+#if DEBUG
+# define D(...) my_debug(__PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
+#else
+# define D(...) ((void)0)
+#endif
+
+namespace {
+
+#if DEBUG
+void my_debug(const char* function, int line, const char* format, ...) {
+ static ::android::base::Lock mutex;
+ va_list args;
+ va_start(args, format);
+ mutex.lock();
+ fprintf(stderr, "%s:%d:", function, line);
+ vfprintf(stderr, format, args);
+ mutex.unlock();
+ va_end(args);
+}
+#endif
+
+// List of possible commands to send to the render window thread from
+// the main one.
+enum Command {
+ CMD_INITIALIZE,
+ CMD_SET_POST_CALLBACK,
+ CMD_SETUP_SUBWINDOW,
+ CMD_REMOVE_SUBWINDOW,
+ CMD_SET_ROTATION,
+ CMD_SET_TRANSLATION,
+ CMD_REPAINT,
+ CMD_HAS_GUEST_POSTED_A_FRAME,
+ CMD_RESET_GUEST_POSTED_A_FRAME,
+ CMD_SET_VSYNC_HZ,
+ CMD_SET_DISPLAY_CONFIGS,
+ CMD_SET_DISPLAY_ACTIVE_CONFIG,
+ CMD_FINALIZE,
+};
+
+} // namespace
+
+// A single message sent from the main thread to the render window thread.
+// |cmd| determines which fields are valid to read.
+struct RenderWindowMessage {
+ Command cmd;
+ union {
+ // CMD_INITIALIZE
+ struct {
+ int width;
+ int height;
+ bool useSubWindow;
+ bool egl2egl;
+ } init;
+
+ // CMD_SET_POST_CALLBACK
+ struct {
+ Renderer::OnPostCallback on_post;
+ void* on_post_context;
+ uint32_t on_post_displayId;
+ bool use_bgra_readback;
+ } set_post_callback;
+
+ // CMD_SETUP_SUBWINDOW
+ struct {
+ FBNativeWindowType parent;
+ int wx;
+ int wy;
+ int ww;
+ int wh;
+ int fbw;
+ int fbh;
+ float dpr;
+ float rotation;
+ bool deleteExisting;
+ bool hideWindow;
+ } subwindow;
+
+ // CMD_SET_TRANSLATION;
+ struct {
+ float px;
+ float py;
+ } trans;
+
+ // CMD_SET_ROTATION
+ float rotation;
+
+ // CMD_SET_VSYNC_HZ
+ int vsyncHz;
+
+ // CMD_SET_COMPOSE_DIMENSIONS
+ struct {
+ int configId;
+ int width;
+ int height;
+ int dpiX;
+ int dpiY;
+ } displayConfigs;
+
+ int displayActiveConfig;
+
+ // result of operations.
+ bool result;
+ };
+
+ // Process the current message, and updates its |result| field.
+ // Returns true on success, or false on failure.
+ bool process() const {
+ const RenderWindowMessage& msg = *this;
+ FrameBuffer* fb;
+ bool result = false;
+ switch (msg.cmd) {
+ case CMD_INITIALIZE:
+ GL_LOG("RenderWindow: CMD_INITIALIZE w=%d h=%d",
+ msg.init.width, msg.init.height);
+ result = FrameBuffer::initialize(msg.init.width,
+ msg.init.height,
+ msg.init.useSubWindow,
+ msg.init.egl2egl);
+ break;
+
+ case CMD_FINALIZE:
+ GL_LOG("CMD_FINALIZE");
+ D("CMD_FINALIZE\n");
+ // this command may be issued even when frame buffer is not
+ // yet created (e.g. if CMD_INITIALIZE failed),
+ // so make sure we check if it is there before finalizing
+ FrameBuffer::finalize();
+ result = true;
+ break;
+
+ case CMD_SET_POST_CALLBACK:
+ GL_LOG("CMD_SET_POST_CALLBACK");
+ D("CMD_SET_POST_CALLBACK\n");
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->setPostCallback(msg.set_post_callback.on_post,
+ msg.set_post_callback.on_post_context,
+ msg.set_post_callback.on_post_displayId,
+ msg.set_post_callback.use_bgra_readback);
+ result = true;
+ }
+ break;
+
+ case CMD_SETUP_SUBWINDOW:
+ GL_LOG("CMD_SETUP_SUBWINDOW: parent=%p wx=%d wy=%d ww=%d wh=%d fbw=%d fbh=%d dpr=%f rotation=%f",
+ (void*)(intptr_t)msg.subwindow.parent,
+ msg.subwindow.wx,
+ msg.subwindow.wy,
+ msg.subwindow.ww,
+ msg.subwindow.wh,
+ msg.subwindow.fbw,
+ msg.subwindow.fbh,
+ msg.subwindow.dpr,
+ msg.subwindow.rotation);
+ D("CMD_SETUP_SUBWINDOW: parent=%p wx=%d wy=%d ww=%d wh=%d fbw=%d fbh=%d dpr=%f rotation=%f\n",
+ (void*)(intptr_t)msg.subwindow.parent,
+ msg.subwindow.wx,
+ msg.subwindow.wy,
+ msg.subwindow.ww,
+ msg.subwindow.wh,
+ msg.subwindow.fbw,
+ msg.subwindow.fbh,
+ msg.subwindow.dpr,
+ msg.subwindow.rotation);
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ result = FrameBuffer::getFB()->setupSubWindow(
+ msg.subwindow.parent, msg.subwindow.wx, msg.subwindow.wy, msg.subwindow.ww,
+ msg.subwindow.wh, msg.subwindow.fbw, msg.subwindow.fbh, msg.subwindow.dpr,
+ msg.subwindow.rotation, msg.subwindow.deleteExisting,
+ msg.subwindow.hideWindow);
+ }
+ break;
+
+ case CMD_REMOVE_SUBWINDOW:
+ GL_LOG("CMD_REMOVE_SUBWINDOW");
+ D("CMD_REMOVE_SUBWINDOW\n");
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ result = fb->removeSubWindow();
+ }
+ break;
+
+ case CMD_SET_ROTATION:
+ GL_LOG("CMD_SET_ROTATION rotation=%f", msg.rotation);
+ D("CMD_SET_ROTATION rotation=%f\n", msg.rotation);
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->setDisplayRotation(msg.rotation);
+ result = true;
+ }
+ break;
+
+ case CMD_SET_TRANSLATION:
+ GL_LOG("CMD_SET_TRANSLATION translation=%f,%f", msg.trans.px, msg.trans.py);
+ D("CMD_SET_TRANSLATION translation=%f,%f\n", msg.trans.px, msg.trans.py);
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->setDisplayTranslation(msg.trans.px, msg.trans.py);
+ result = true;
+ }
+ break;
+
+ case CMD_REPAINT:
+ GL_LOG("CMD_REPAINT");
+ D("CMD_REPAINT\n");
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->repost();
+ result = true;
+ } else {
+ GL_LOG("CMD_REPAINT: no repost, no FrameBuffer");
+ }
+ break;
+
+ case CMD_HAS_GUEST_POSTED_A_FRAME:
+ GL_LOG("CMD_HAS_GUEST_POSTED_A_FRAME");
+ D("CMD_HAS_GUEST_POSTED_A_FRAME\n");
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ result = fb->hasGuestPostedAFrame();
+ } else {
+ GL_LOG("CMD_HAS_GUEST_POSTED_A_FRAME: no FrameBuffer");
+ }
+ break;
+
+ case CMD_RESET_GUEST_POSTED_A_FRAME:
+ GL_LOG("CMD_RESET_GUEST_POSTED_A_FRAME");
+ D("CMD_RESET_GUEST_POSTED_A_FRAME\n");
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->resetGuestPostedAFrame();
+ result = true;
+ } else {
+ GL_LOG("CMD_RESET_GUEST_POSTED_A_FRAME: no FrameBuffer");
+ }
+ break;
+
+ case CMD_SET_VSYNC_HZ:
+ GL_LOG("CMD_SET_VSYNC_HZ");
+ D("CMD_SET_VSYNC_HZ\n");
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->setVsyncHz(msg.vsyncHz);
+ result = true;
+ } else {
+ GL_LOG("CMD_RESET_GUEST_POSTED_A_FRAME: no FrameBuffer");
+ }
+ break;
+
+ case CMD_SET_DISPLAY_CONFIGS:
+ GL_LOG("CMD_SET_DISPLAY_CONFIGS");
+ D("CMD_SET_DISPLAY_CONFIGS");
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->setDisplayConfigs(msg.displayConfigs.configId,
+ msg.displayConfigs.width,
+ msg.displayConfigs.height,
+ msg.displayConfigs.dpiX,
+ msg.displayConfigs.dpiY);
+ result = true;
+ } else {
+ GL_LOG("CMD_SET_DISPLAY_CONFIGS: no FrameBuffer");
+ }
+ break;
+
+ case CMD_SET_DISPLAY_ACTIVE_CONFIG:
+ GL_LOG("CMD_SET_DISPLAY_ACTIVE_CONFIG");
+ D("CMD_SET_DISPLAY_ACTIVE_CONFIG");
+ fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->setDisplayActiveConfig(msg.displayActiveConfig);
+ result = true;
+ } else {
+ GL_LOG("CMD_SET_DISPLAY_ACTIVE_CONFIG: no FrameBuffer");
+ }
+ break;
+
+ default:
+ ;
+ }
+ return result;
+ }
+};
+
+// Simple synchronization structure used to exchange data between the
+// main and render window threads. Usage is the following:
+//
+// The main thread does the following in a loop:
+//
+// canWriteCmd.wait()
+// updates |message| by writing a new |cmd| value and appropriate
+// parameters.
+// canReadCmd.signal()
+// canReadResult.wait()
+// reads |message.result|
+// canWriteResult.signal()
+//
+// The render window thread will do the following:
+//
+// canReadCmd.wait()
+// reads |message.cmd| and acts upon it.
+// canWriteResult.wait()
+// writes |message.result|
+// canReadResult.signal()
+// canWriteCmd.signal()
+//
+class RenderWindowChannel {
+public:
+ RenderWindowChannel() : mIn(), mOut() {}
+ ~RenderWindowChannel() {}
+
+ // Send a message from the main thread.
+ // Note that the content of |msg| is copied into the channel.
+ // Returns with the command's result (true or false).
+ bool sendMessageAndGetResult(const RenderWindowMessage& msg) {
+ D("msg.cmd=%d\n", msg.cmd);
+ mIn.send(msg);
+ D("waiting for result\n");
+ bool result = false;
+ mOut.receive(&result);
+ D("result=%s\n", result ? "success" : "failure");
+ return result;
+ }
+
+ // Receive a message from the render window thread.
+ // On exit, |*msg| gets a copy of the message. The caller
+ // must always call sendResult() after processing the message.
+ void receiveMessage(RenderWindowMessage* msg) {
+ D("entering\n");
+ mIn.receive(msg);
+ D("message cmd=%d\n", msg->cmd);
+ }
+
+ // Send result from the render window thread to the main one.
+ // Must always be called after receiveMessage().
+ void sendResult(bool result) {
+ D("waiting to send result (%s)\n", result ? "success" : "failure");
+ mOut.send(result);
+ D("result sent\n");
+ }
+
+private:
+ android::base::MessageChannel<RenderWindowMessage, 16U> mIn;
+ android::base::MessageChannel<bool, 16U> mOut;
+};
+
+namespace {
+
+// This class implements the window render thread.
+// Its purpose is to listen for commands from the main thread in a loop,
+// process them, then return a boolean result for each one of them.
+//
+// The thread ends with a CMD_FINALIZE.
+//
+class RenderWindowThread : public android::base::Thread {
+public:
+ RenderWindowThread(RenderWindowChannel* channel) : mChannel(channel) {}
+
+ virtual intptr_t main() {
+ D("Entering render window thread thread\n");
+#ifndef _WIN32
+ sigset_t set;
+ sigfillset(&set);
+ pthread_sigmask(SIG_SETMASK, &set, NULL);
+#endif
+ bool running = true;
+ while (running) {
+ RenderWindowMessage msg = {};
+
+ D("Waiting for message from main thread\n");
+ mChannel->receiveMessage(&msg);
+
+ bool result = msg.process();
+ if (msg.cmd == CMD_FINALIZE) {
+ running = false;
+ }
+
+ D("Sending result (%s) to main thread\n", result ? "success" : "failure");
+ mChannel->sendResult(result);
+ }
+ D("Exiting thread\n");
+ return 0;
+ }
+
+private:
+ RenderWindowChannel* mChannel;
+};
+
+} // namespace
+
+RenderWindow::RenderWindow(int width,
+ int height,
+ bool use_thread,
+ bool use_sub_window,
+ bool egl2egl)
+ : mRepostThread([this] {
+ while (auto cmd = mRepostCommands.receive()) {
+ if (*cmd == RepostCommand::Sync) {
+ continue;
+ } else if (*cmd == RepostCommand::Repost &&
+ !mPaused) {
+ GL_LOG("Reposting thread dequeueing a CMD_REPAINT");
+ RenderWindowMessage msg = {CMD_REPAINT};
+ (void)msg.process();
+ }
+ }
+ }) {
+ if (use_thread) {
+ mChannel = new RenderWindowChannel();
+ mThread = new RenderWindowThread(mChannel);
+ mThread->start();
+ } else {
+ mRepostThread.start();
+ }
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_INITIALIZE;
+ msg.init.width = width;
+ msg.init.height = height;
+ msg.init.useSubWindow = use_sub_window;
+ msg.init.egl2egl = egl2egl;
+ mValid = processMessage(msg);
+}
+
+RenderWindow::~RenderWindow() {
+ D("Entering\n");
+ removeSubWindow();
+ mRepostCommands.stop();
+ D("Sending CMD_FINALIZE\n");
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_FINALIZE;
+ (void) processMessage(msg);
+
+ if (useThread()) {
+ mThread->wait(NULL);
+ delete mThread;
+ delete mChannel;
+ } else {
+ mRepostThread.wait();
+ }
+}
+
+void RenderWindow::setPaused(bool paused) {
+ // If pausing, flush commands
+ if (!mPaused && paused) {
+ if (useThread()) {
+ fprintf(stderr,
+ "WARNING: flushMessages unsupported for RenderWindowThread. "
+ "Generic snapshot load might segfault.\n");
+ } else {
+ mRepostCommands.waitForEmpty();
+ }
+ }
+
+ mPaused = paused;
+}
+
+bool RenderWindow::getHardwareStrings(const char** vendor,
+ const char** renderer,
+ const char** version) {
+ D("Entering\n");
+ // TODO(digit): Move this to render window thread.
+ FrameBuffer* fb = FrameBuffer::getFB();
+ if (!fb) {
+ D("No framebuffer!\n");
+ return false;
+ }
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ fb->getGLStrings(vendor, renderer, version);
+ D("Exiting vendor=[%s] renderer=[%s] version=[%s]\n",
+ *vendor, *renderer, *version);
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+void RenderWindow::setPostCallback(Renderer::OnPostCallback onPost, void* onPostContext,
+ uint32_t displayId, bool useBgraReadback) {
+ D("Entering\n");
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_SET_POST_CALLBACK;
+ msg.set_post_callback.on_post = onPost;
+ msg.set_post_callback.on_post_context = onPostContext;
+ msg.set_post_callback.on_post_displayId = displayId;
+ msg.set_post_callback.use_bgra_readback = useBgraReadback;
+ (void) processMessage(msg);
+ D("Exiting\n");
+}
+
+bool RenderWindow::asyncReadbackSupported() {
+ D("Entering\n");
+ return FrameBuffer::getFB()->asyncReadbackSupported();
+}
+
+Renderer::ReadPixelsCallback RenderWindow::getReadPixelsCallback() {
+ D("Entering\n");
+ return FrameBuffer::getFB()->getReadPixelsCallback();
+}
+
+void RenderWindow::addListener(Renderer::FrameBufferChangeEventListener* listener) {
+ FrameBuffer::getFB()->addListener(listener);
+}
+
+void RenderWindow::removeListener(Renderer::FrameBufferChangeEventListener* listener) {
+ FrameBuffer::getFB()->removeListener(listener);
+}
+
+Renderer::FlushReadPixelPipeline RenderWindow::getFlushReadPixelPipeline() {
+ return FrameBuffer::getFB()->getFlushReadPixelPipeline();
+}
+bool RenderWindow::setupSubWindow(FBNativeWindowType window,
+ int wx,
+ int wy,
+ int ww,
+ int wh,
+ int fbw,
+ int fbh,
+ float dpr,
+ float zRot,
+ bool deleteExisting,
+ bool hideWindow) {
+ D("Entering mHasSubWindow=%s\n", mHasSubWindow ? "true" : "false");
+
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_SETUP_SUBWINDOW;
+ msg.subwindow.parent = window;
+ msg.subwindow.wx = wx;
+ msg.subwindow.wy = wy;
+ msg.subwindow.ww = ww;
+ msg.subwindow.wh = wh;
+ msg.subwindow.fbw = fbw;
+ msg.subwindow.fbh = fbh;
+ msg.subwindow.dpr = dpr;
+ msg.subwindow.rotation = zRot;
+ msg.subwindow.deleteExisting = deleteExisting;
+ msg.subwindow.hideWindow = hideWindow;
+ mHasSubWindow = processMessage(msg);
+
+ D("Exiting mHasSubWindow=%s\n", mHasSubWindow ? "true" : "false");
+ return mHasSubWindow;
+}
+
+bool RenderWindow::removeSubWindow() {
+ D("Entering mHasSubWindow=%s\n", mHasSubWindow ? "true" : "false");
+ if (!mHasSubWindow) {
+ return false;
+ }
+ mHasSubWindow = false;
+ if (!useThread()) {
+ mRepostCommands.send(RepostCommand::Sync);
+ mRepostCommands.waitForEmpty();
+ }
+
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_REMOVE_SUBWINDOW;
+ bool result = processMessage(msg);
+ D("Exiting result=%s\n", result ? "success" : "failure");
+ return result;
+}
+
+void RenderWindow::setRotation(float zRot) {
+ D("Entering rotation=%f\n", zRot);
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_SET_ROTATION;
+ msg.rotation = zRot;
+ (void) processMessage(msg);
+ D("Exiting\n");
+}
+
+void RenderWindow::setTranslation(float px, float py) {
+ D("Entering translation=%f,%f\n", px, py);
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_SET_TRANSLATION;
+ msg.trans.px = px;
+ msg.trans.py = py;
+ (void) processMessage(msg);
+ D("Exiting\n");
+}
+
+void RenderWindow::setScreenMask(int width, int height, const unsigned char* rgbaData) {
+ if (FrameBuffer* fb = FrameBuffer::getFB()) {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (fb->hasEmulationGl()) {
+ fb->getTextureDraw()->setScreenMask(width, height, rgbaData);
+ }
+#endif
+ }
+}
+
+void RenderWindow::repaint() {
+ D("Entering\n");
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_REPAINT;
+ (void) processMessage(msg);
+ D("Exiting\n");
+}
+
+bool RenderWindow::hasGuestPostedAFrame() {
+ D("Entering\n");
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_HAS_GUEST_POSTED_A_FRAME;
+ bool res = processMessage(msg);
+ D("Exiting\n");
+ return res;
+}
+
+void RenderWindow::resetGuestPostedAFrame() {
+ D("Entering\n");
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_RESET_GUEST_POSTED_A_FRAME;
+ (void) processMessage(msg);
+ D("Exiting\n");
+}
+
+void RenderWindow::setVsyncHz(int vsyncHz) {
+ D("Entering\n");
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_SET_VSYNC_HZ;
+ msg.vsyncHz = vsyncHz;
+ (void) processMessage(msg);
+ D("Exiting\n");
+}
+
+void RenderWindow::setDisplayConfigs(int configId, int w, int h,
+ int dpiX, int dpiY) {
+ D("Entering\n");
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_SET_DISPLAY_CONFIGS;
+ msg.displayConfigs.configId = configId;
+ msg.displayConfigs.width = w;
+ msg.displayConfigs.height= h;
+ msg.displayConfigs.dpiX= dpiX;
+ msg.displayConfigs.dpiY = dpiY;
+ (void) processMessage(msg);
+ D("Exiting\n");
+}
+
+void RenderWindow::setDisplayActiveConfig(int configId) {
+ D("Entering\n");
+ RenderWindowMessage msg = {};
+ msg.cmd = CMD_SET_DISPLAY_ACTIVE_CONFIG;
+ msg.displayActiveConfig = configId;
+ (void) processMessage(msg);
+ D("Exiting\n");
+}
+
+bool RenderWindow::processMessage(const RenderWindowMessage& msg) {
+ if (useThread()) {
+ if (msg.cmd == CMD_REPAINT) {
+ GL_LOG("Sending CMD_REPAINT to render window channel");
+ }
+ return mChannel->sendMessageAndGetResult(msg);
+ } else if (msg.cmd == CMD_REPAINT) {
+ GL_LOG("Sending CMD_REPAINT to reposting thread");
+ mRepostCommands.send(RepostCommand::Repost);
+ return true;
+ } else {
+ return msg.process();
+ }
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RenderWindow.h b/src/gfxstream/host/RenderWindow.h
new file mode 100644
index 00000000000..907e63590c5
--- /dev/null
+++ b/src/gfxstream/host/RenderWindow.h
@@ -0,0 +1,174 @@
+// Copyright 2014-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 ANDROID_EMUGL_LIBRENDER_RENDER_WINDOW_H
+#define ANDROID_EMUGL_LIBRENDER_RENDER_WINDOW_H
+
+#include "render-utils/render_api.h"
+
+#include "aemu/base/synchronization/MessageChannel.h"
+#include "aemu/base/threads/FunctorThread.h"
+#include "aemu/base/threads/Thread.h"
+
+namespace gfxstream {
+
+class RenderWindowChannel;
+struct RenderWindowMessage;
+
+// Helper class used to manage the sub-window that displays the emulated GPU
+// output. To use it, do the following:
+//
+// 1) Create a new instance, passing the size of the emulated accelerated
+// framebuffer in pixels you need.
+//
+// 2) Check isValid() after construction. If false, the library could not
+// initialize the class properly, and one should abort.
+//
+// 3) Optional: call setPostCallback() to specify a callback function which
+// will be called everytime a new frame is drawn.
+//
+// 4) Call setupSubWindow() to setup a new sub-window within the UI window.
+// One can call removeSubWindow() to remove it, and one can call
+// setupSubWindow() + removeSubWindow() any number of time (e.g. for
+// changing the position / rotation of the subwindow).
+//
+// 5) Optional: call setRotation() to only change the display rotation of
+// the sub-window content.
+//
+// 6) Call repaint() to force a repaint().
+//
+class RenderWindow {
+public:
+ // Create new instance. |width| and |height| are the dimensions of the
+ // emulated accelerated framebuffer. |use_thread| can be true to force
+ // the use of a separate thread, which might be required on some platforms
+ // to avoid GL-realted corruption issues in the main window. Call
+ // isValid() after construction to verify that it worked properly.
+ //
+ // |use_sub_window| is true if the client will call setupSubWindow(),
+ // and false if it will call setPostCallback().
+ //
+ // Note that this call doesn't display anything, it just initializes
+ // the library, use setupSubWindow() to display something.
+ RenderWindow(int width, int height, bool use_thread, bool use_sub_window,
+ bool egl2egl);
+
+ // Destructor. This will automatically call removeSubWindow() is needed.
+ ~RenderWindow();
+
+ // Returns true if the RenderWindow instance is valid, which really
+ // means that the constructor succeeded.
+ bool isValid() const { return mValid; }
+
+ // Return misc. GL strings to the caller. On success, return true and sets
+ // |*vendor| to the GL vendor string, |*renderer| to the GL renderer one,
+ // and |*version| to the GL version one. On failure, return false.
+ bool getHardwareStrings(const char** vendor,
+ const char** renderer,
+ const char** version);
+
+ // Specify a function that will be called everytime a new frame is
+ // displayed. This is relatively slow but allows one to capture the
+ // output.
+ void setPostCallback(Renderer::OnPostCallback onPost, void* onPostContext, uint32_t displayId,
+ bool useBgraReadback = false);
+
+ bool asyncReadbackSupported();
+ Renderer::ReadPixelsCallback getReadPixelsCallback();
+ Renderer::FlushReadPixelPipeline getFlushReadPixelPipeline();
+
+ // Start displaying the emulated framebuffer using a sub-window of a
+ // parent |window| id. |wx|, |wy|, |ww| and |wh| are the position
+ // and dimension of the sub-window, relative to its parent.
+ // |fbw| and |fbh| are the dimensions of the underlying guest framebuffer.
+ // |dpr| is the device pixel ratio for the monitor, which is required for
+ // higher-density displays (such as retina).
+ // |rotation| is a clockwise-rotation for the content. Only multiples of
+ // 90. are accepted. Returns true on success, false otherwise.
+ //
+ // If the subwindow already exists, this function will update
+ // the dimensions of the subwindow, backing framebuffer, and rendering
+ // pipeline to reflect the new values.
+ //
+ // One can call removeSubWindow() to remove the sub-window.
+ bool setupSubWindow(FBNativeWindowType window,
+ int wx,
+ int wy,
+ int ww,
+ int wh,
+ int fbw,
+ int fbh,
+ float dpr,
+ float rotation,
+ bool deleteExisting,
+ bool hideWindow);
+
+ // Remove the sub-window created by calling setupSubWindow().
+ // Note that this doesn't discard the content of the emulated framebuffer,
+ // it just hides it from the main window. Returns true on success, false
+ // otherwise.
+ bool removeSubWindow();
+
+ // Change the display rotation on the fly. |zRot| is a clockwise rotation
+ // angle in degrees. Only multiples of 90. are accepted.
+ void setRotation(float zRot);
+
+ // Change the display translation. |px|,|py| are numbers between 0 and 1,
+ // with (0,0) indicating "align the bottom left of the framebuffer with the
+ // bottom left of the subwindow", and (1,1) indicating "align the top right of
+ // the framebuffer with the top right of the subwindow."
+ void setTranslation(float px, float py);
+
+ // Receive a screen mask and pass it to TextureDraw
+ void setScreenMask(int width, int height, const unsigned char* rgbaData);
+
+ // Force a repaint of the whole content into the sub-window.
+ void repaint();
+
+ // Returns whether or not the guest posted a frame. For checking emulator
+ // liveness.
+ bool hasGuestPostedAFrame();
+ // Resets whether the guest has posted a frame.
+ void resetGuestPostedAFrame();
+
+ void setPaused(bool paused);
+
+ void addListener(Renderer::FrameBufferChangeEventListener* listener);
+ void removeListener(Renderer::FrameBufferChangeEventListener* listener);
+
+ void setVsyncHz(int vsyncHz);
+ void setDisplayConfigs(int configId, int w, int h, int dpiX, int dpiY);
+ void setDisplayActiveConfig(int configId);
+private:
+ bool processMessage(const RenderWindowMessage& msg);
+ bool useThread() const { return mThread != nullptr; }
+
+ bool mValid = false;
+ bool mHasSubWindow = false;
+ android::base::Thread* mThread = nullptr;
+ RenderWindowChannel* mChannel = nullptr;
+
+ // A worker thread to run repost() commands asynchronously.
+ enum class RepostCommand : char {
+ Repost, Sync
+ };
+ android::base::MessageChannel<RepostCommand, 10> mRepostCommands;
+ android::base::FunctorThread mRepostThread;
+
+ bool mPaused = false;
+};
+
+} // namespace gfxstream
+
+#endif // ANDROID_EMUGL_LIBRENDER_RENDER_WINDOW_H
diff --git a/src/gfxstream/host/RendererImpl.cpp b/src/gfxstream/host/RendererImpl.cpp
new file mode 100644
index 00000000000..33972b4a3bc
--- /dev/null
+++ b/src/gfxstream/host/RendererImpl.cpp
@@ -0,0 +1,742 @@
+// 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 "RendererImpl.h"
+
+#include <assert.h>
+
+#include <algorithm>
+#include <utility>
+#include <variant>
+
+#include "FrameBuffer.h"
+#include "RenderChannelImpl.h"
+#include "RenderThread.h"
+#include "aemu/base/system/System.h"
+#include "aemu/base/threads/WorkerThread.h"
+#include "host-common/logging.h"
+#include "snapshot/common.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "gl/EmulatedEglFenceSync.h"
+#endif
+
+namespace gfxstream {
+
+// kUseSubwindowThread is used to determine whether the RenderWindow should use
+// a separate thread to manage its subwindow GL/GLES context.
+// For now, this feature is disabled entirely for the following
+// reasons:
+//
+// - It must be disabled on Windows at all times, otherwise the main window
+// becomes unresponsive after a few seconds of user interaction (e.g. trying
+// to move it over the desktop). Probably due to the subtle issues around
+// input on this platform (input-queue is global, message-queue is
+// per-thread). Also, this messes considerably the display of the
+// main window when running the executable under Wine.
+//
+// - On Linux/XGL and OSX/Cocoa, this used to be necessary to avoid corruption
+// issues with the GL state of the main window when using the SDL UI.
+// After the switch to Qt, this is no longer necessary and may actually cause
+// undesired interactions between the UI thread and the RenderWindow thread:
+// for example, in a multi-monitor setup the context might be recreated when
+// dragging the window between monitors, triggering a Qt-specific callback
+// in the context of RenderWindow thread, which will become blocked on the UI
+// thread, which may in turn be blocked on something else.
+static const bool kUseSubwindowThread = false;
+
+// This object manages the cleanup of guest process resources when the process
+// exits. It runs the cleanup in a separate thread to never block the main
+// render thread for a low-priority task.
+class RendererImpl::ProcessCleanupThread {
+public:
+ ProcessCleanupThread()
+ : mCleanupWorker([](Cmd cmd) {
+ using android::base::WorkerProcessingResult;
+ struct {
+ WorkerProcessingResult operator()(CleanProcessResources resources) {
+ FrameBuffer::getFB()->cleanupProcGLObjects(resources.puid);
+ // resources.resource are destroyed automatically when going out of the scope.
+ return WorkerProcessingResult::Continue;
+ }
+ WorkerProcessingResult operator()(Exit) {
+ return WorkerProcessingResult::Stop;
+ }
+ } visitor;
+ return std::visit(visitor, std::move(cmd));
+ }) {
+ mCleanupWorker.start();
+ }
+
+ ~ProcessCleanupThread() {
+ mCleanupWorker.enqueue(Exit{});
+ }
+
+ void cleanup(uint64_t processId, std::unique_ptr<ProcessResources> resource) {
+ mCleanupWorker.enqueue(CleanProcessResources{
+ .puid = processId,
+ .resource = std::move(resource),
+ });
+ }
+
+ void stop() {
+ mCleanupWorker.enqueue(Exit{});
+ mCleanupWorker.join();
+ }
+
+ void waitForCleanup() {
+ mCleanupWorker.waitQueuedItems();
+ }
+
+private:
+ struct CleanProcessResources {
+ uint64_t puid;
+ std::unique_ptr<ProcessResources> resource;
+ };
+ struct Exit {};
+ using Cmd = std::variant<CleanProcessResources, Exit>;
+ DISALLOW_COPY_AND_ASSIGN(ProcessCleanupThread);
+
+ android::base::WorkerThread<Cmd> mCleanupWorker;
+};
+
+RendererImpl::RendererImpl() {
+ mCleanupThread.reset(new ProcessCleanupThread());
+}
+
+RendererImpl::~RendererImpl() {
+ stop(true);
+ // We can't finish until the loader render thread has
+ // completed else can get a crash at the end of the destructor.
+ if (mLoaderRenderThread) {
+ mLoaderRenderThread->wait();
+ }
+ mRenderWindow.reset();
+}
+
+bool RendererImpl::initialize(int width, int height, bool useSubWindow, bool egl2egl) {
+ if (android::base::getEnvironmentVariable("ANDROID_EMUGL_VERBOSE") == "1") {
+ // base_enable_verbose_logs();
+ }
+
+ if (mRenderWindow) {
+ return false;
+ }
+
+ std::unique_ptr<RenderWindow> renderWindow(new RenderWindow(
+ width, height, kUseSubwindowThread, useSubWindow, egl2egl));
+ if (!renderWindow) {
+ ERR("Could not create rendering window class\n");
+ GL_LOG("Could not create rendering window class");
+ return false;
+ }
+ if (!renderWindow->isValid()) {
+ ERR("Could not initialize emulated framebuffer\n");
+ return false;
+ }
+
+ mRenderWindow = std::move(renderWindow);
+ GL_LOG("OpenGL renderer initialized successfully");
+
+ // This render thread won't do anything but will only preload resources
+ // for the real threads to start faster.
+ mLoaderRenderThread.reset(new RenderThread(nullptr));
+ mLoaderRenderThread->start();
+
+ return true;
+}
+
+void RendererImpl::stop(bool wait) {
+ android::base::AutoLock lock(mChannelsLock);
+ mStopped = true;
+ auto channels = std::move(mChannels);
+ lock.unlock();
+
+ if (const auto fb = FrameBuffer::getFB()) {
+ fb->setShuttingDown();
+ }
+ for (const auto& c : channels) {
+ c->stopFromHost();
+ }
+ // We're stopping the renderer, so there's no need to clean up resources
+ // of some pending processes: we'll destroy everything soon.
+ mCleanupThread->stop();
+
+ mStoppedChannels.insert(mStoppedChannels.end(),
+ std::make_move_iterator(channels.begin()),
+ std::make_move_iterator(channels.end()));
+
+ if (!wait) {
+ return;
+ }
+
+ // Each render channel is referenced in the corresponing pipe object, so
+ // even if we clear the |channels| vector they could still be alive
+ // for a while. This means we need to make sure to wait for render thread
+ // exit explicitly.
+ for (const auto& c : mStoppedChannels) {
+ c->renderThread()->wait();
+ }
+ mCleanupThread->waitForCleanup();
+ mStoppedChannels.clear();
+}
+
+void RendererImpl::finish() {
+ {
+ android::base::AutoLock lock(mChannelsLock);
+ mRenderWindow->setPaused(true);
+ }
+ cleanupRenderThreads();
+ {
+ android::base::AutoLock lock(mChannelsLock);
+ mRenderWindow->setPaused(false);
+ }
+}
+
+void RendererImpl::cleanupRenderThreads() {
+ android::base::AutoLock lock(mChannelsLock);
+ const auto channels = std::move(mChannels);
+ assert(mChannels.empty());
+ lock.unlock();
+ for (const auto& c : channels) {
+ // Please DO NOT notify the guest about this event (DO NOT call
+ // stopFromHost() ), because this is used to kill old threads when
+ // loading from a snapshot, and the newly loaded guest should not
+ // be notified for those behavior.
+ c->stop();
+ }
+ for (const auto& c : channels) {
+ c->renderThread()->wait();
+ }
+}
+
+void RendererImpl::waitForProcessCleanup() {
+ mCleanupThread->waitForCleanup();
+ // Recreate it to make sure we've started from scratch and that we've
+ // finished all in-progress cleanups as well.
+ mCleanupThread.reset(new ProcessCleanupThread());
+}
+
+RenderChannelPtr RendererImpl::createRenderChannel(
+ android::base::Stream* loadStream, uint32_t virtioGpuContextId) {
+ const auto channel =
+ std::make_shared<RenderChannelImpl>(loadStream, virtioGpuContextId);
+ {
+ android::base::AutoLock lock(mChannelsLock);
+
+ if (mStopped) {
+ return nullptr;
+ }
+
+ // Clean up the stopped channels.
+ mChannels.erase(
+ std::remove_if(mChannels.begin(), mChannels.end(),
+ [](const std::shared_ptr<RenderChannelImpl>& c) {
+ return c->renderThread()->isFinished();
+ }),
+ mChannels.end());
+ mChannels.emplace_back(channel);
+
+ // Take the time to check if our loader thread is done as well.
+ if (mLoaderRenderThread && mLoaderRenderThread->isFinished()) {
+ mLoaderRenderThread->wait();
+ mLoaderRenderThread.reset();
+ }
+
+ GL_LOG("Started new RenderThread (total %" PRIu64 ") @%p",
+ static_cast<uint64_t>(mChannels.size()), channel->renderThread());
+ }
+
+ return channel;
+}
+
+void RendererImpl::addListener(FrameBufferChangeEventListener* listener) {
+ mRenderWindow->addListener(listener);
+}
+
+void RendererImpl::removeListener(FrameBufferChangeEventListener* listener) {
+ mRenderWindow->removeListener(listener);
+}
+
+void* RendererImpl::addressSpaceGraphicsConsumerCreate(
+ struct asg_context context,
+ android::base::Stream* loadStream,
+ android::emulation::asg::ConsumerCallbacks callbacks,
+ uint32_t contextId, uint32_t capsetId,
+ std::optional<std::string> nameOpt) {
+ auto thread = new RenderThread(context, loadStream, callbacks, contextId,
+ capsetId, std::move(nameOpt));
+ thread->start();
+ android::base::AutoLock lock(mAddressSpaceRenderThreadLock);
+ mAddressSpaceRenderThreads.emplace(thread);
+ return (void*)thread;
+}
+
+void RendererImpl::addressSpaceGraphicsConsumerDestroy(void* consumer) {
+ RenderThread* thread = (RenderThread*)consumer;
+ {
+ android::base::AutoLock lock(mAddressSpaceRenderThreadLock);
+ mAddressSpaceRenderThreads.erase(thread);
+ }
+ thread->wait();
+ delete thread;
+}
+
+void RendererImpl::addressSpaceGraphicsConsumerPreSave(void* consumer) {
+ RenderThread* thread = (RenderThread*)consumer;
+ thread->pausePreSnapshot();
+}
+
+void RendererImpl::addressSpaceGraphicsConsumerSave(void* consumer, android::base::Stream* stream) {
+ RenderThread* thread = (RenderThread*)consumer;
+ thread->save(stream);
+}
+
+void RendererImpl::addressSpaceGraphicsConsumerPostSave(void* consumer) {
+ RenderThread* thread = (RenderThread*)consumer;
+ thread->resume(true);
+}
+
+void RendererImpl::addressSpaceGraphicsConsumerRegisterPostLoadRenderThread(void* consumer) {
+ RenderThread* thread = (RenderThread*)consumer;
+ mAdditionalPostLoadRenderThreads.push_back(thread);
+}
+
+void RendererImpl::pauseAllPreSave() {
+ {
+ android::base::AutoLock lock(mChannelsLock);
+ if (mStopped) {
+ return;
+ }
+ for (const auto& c : mChannels) {
+ c->renderThread()->pausePreSnapshot();
+ }
+ }
+ {
+ android::base::AutoLock lock(mAddressSpaceRenderThreadLock);
+ for (const auto& thread : mAddressSpaceRenderThreads) {
+ thread->pausePreSnapshot();
+ }
+ }
+ waitForProcessCleanup();
+}
+
+void RendererImpl::resumeAll(bool waitForSave) {
+ {
+ android::base::AutoLock lock(mAddressSpaceRenderThreadLock);
+ for (const auto t : mAdditionalPostLoadRenderThreads) {
+ t->resume(waitForSave);
+ }
+ }
+ {
+ android::base::AutoLock lock(mChannelsLock);
+ if (mStopped) {
+ return;
+ }
+ for (const auto& c : mChannels) {
+ c->renderThread()->resume(waitForSave);
+ }
+ for (const auto& thread : mAddressSpaceRenderThreads) {
+ thread->resume(waitForSave);
+ }
+ mAdditionalPostLoadRenderThreads.clear();
+ }
+
+ repaintOpenGLDisplay();
+}
+
+void RendererImpl::save(android::base::Stream* stream,
+ const android::snapshot::ITextureSaverPtr& textureSaver) {
+ stream->putByte(mStopped);
+ if (mStopped) {
+ return;
+ }
+ auto fb = FrameBuffer::getFB();
+ assert(fb);
+ fb->onSave(stream, textureSaver);
+}
+
+bool RendererImpl::load(android::base::Stream* stream,
+ const android::snapshot::ITextureLoaderPtr& textureLoader) {
+
+#ifdef SNAPSHOT_PROFILE
+ android::base::System::Duration startTime =
+ android::base::System::get()->getUnixTimeUs();
+#endif
+ waitForProcessCleanup();
+#ifdef SNAPSHOT_PROFILE
+ printf("Previous session cleanup time: %lld ms\n",
+ (long long)(android::base::System::get()
+ ->getUnixTimeUs() -
+ startTime) /
+ 1000);
+#endif
+
+ mStopped = stream->getByte();
+ if (mStopped) {
+ return true;
+ }
+ auto fb = FrameBuffer::getFB();
+ assert(fb);
+
+ bool res = true;
+
+ res = fb->onLoad(stream, textureLoader);
+#if GFXSTREAM_ENABLE_HOST_GLES
+ gl::EmulatedEglFenceSync::onLoad(stream);
+#endif
+
+ return res;
+}
+
+void RendererImpl::fillGLESUsages(android_studio::EmulatorGLESUsages* usages) {
+ auto fb = FrameBuffer::getFB();
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (fb) fb->fillGLESUsages(usages);
+#endif
+}
+
+int RendererImpl::getScreenshot(unsigned int nChannels, unsigned int* width, unsigned int* height,
+ uint8_t* pixels, size_t* cPixels, int displayId = 0,
+ int desiredWidth = 0, int desiredHeight = 0,
+ int desiredRotation = 0, Rect rect = {{0, 0}, {0, 0}}) {
+ auto fb = FrameBuffer::getFB();
+ if (fb) {
+ return fb->getScreenshot(nChannels, width, height, pixels, cPixels,
+ displayId, desiredWidth, desiredHeight,
+ desiredRotation, rect);
+ }
+ *cPixels = 0;
+ return -1;
+}
+
+void RendererImpl::setMultiDisplay(uint32_t id,
+ int32_t x,
+ int32_t y,
+ uint32_t w,
+ uint32_t h,
+ uint32_t dpi,
+ bool add) {
+ auto fb = FrameBuffer::getFB();
+ if (fb) {
+ if (add) {
+ fb->createDisplay(&id);
+ fb->setDisplayPose(id, x, y, w, h, dpi);
+ } else {
+ fb->destroyDisplay(id);
+ }
+ }
+}
+
+void RendererImpl::setMultiDisplayColorBuffer(uint32_t id, uint32_t cb) {
+ auto fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->setDisplayColorBuffer(id, cb);
+ }
+}
+
+RendererImpl::HardwareStrings RendererImpl::getHardwareStrings() {
+ assert(mRenderWindow);
+
+ const char* vendor = nullptr;
+ const char* renderer = nullptr;
+ const char* version = nullptr;
+ if (!mRenderWindow->getHardwareStrings(&vendor, &renderer, &version)) {
+ return {};
+ }
+ HardwareStrings res;
+ res.vendor = vendor ? vendor : "";
+ res.renderer = renderer ? renderer : "";
+ res.version = version ? version : "";
+ return res;
+}
+
+void RendererImpl::setPostCallback(RendererImpl::OnPostCallback onPost,
+ void* context,
+ bool useBgraReadback,
+ uint32_t displayId) {
+ assert(mRenderWindow);
+ mRenderWindow->setPostCallback(onPost, context, displayId, useBgraReadback);
+}
+
+bool RendererImpl::asyncReadbackSupported() {
+ assert(mRenderWindow);
+ return mRenderWindow->asyncReadbackSupported();
+}
+
+RendererImpl::ReadPixelsCallback
+RendererImpl::getReadPixelsCallback() {
+ assert(mRenderWindow);
+ return mRenderWindow->getReadPixelsCallback();
+}
+
+RendererImpl::FlushReadPixelPipeline
+RendererImpl::getFlushReadPixelPipeline() {
+ assert(mRenderWindow);
+ return mRenderWindow->getFlushReadPixelPipeline();
+}
+
+bool RendererImpl::showOpenGLSubwindow(FBNativeWindowType window,
+ int wx,
+ int wy,
+ int ww,
+ int wh,
+ int fbw,
+ int fbh,
+ float dpr,
+ float zRot,
+ bool deleteExisting,
+ bool hideWindow) {
+ assert(mRenderWindow);
+ return mRenderWindow->setupSubWindow(window, wx, wy, ww, wh, fbw, fbh, dpr,
+ zRot, deleteExisting, hideWindow);
+}
+
+bool RendererImpl::destroyOpenGLSubwindow() {
+ assert(mRenderWindow);
+ return mRenderWindow->removeSubWindow();
+}
+
+void RendererImpl::setOpenGLDisplayRotation(float zRot) {
+ assert(mRenderWindow);
+ mRenderWindow->setRotation(zRot);
+}
+
+void RendererImpl::setOpenGLDisplayTranslation(float px, float py) {
+ assert(mRenderWindow);
+ mRenderWindow->setTranslation(px, py);
+}
+
+void RendererImpl::repaintOpenGLDisplay() {
+ assert(mRenderWindow);
+ mRenderWindow->repaint();
+}
+
+bool RendererImpl::hasGuestPostedAFrame() {
+ if (mRenderWindow) {
+ return mRenderWindow->hasGuestPostedAFrame();
+ }
+ return false;
+}
+
+void RendererImpl::resetGuestPostedAFrame() {
+ if (mRenderWindow) {
+ mRenderWindow->resetGuestPostedAFrame();
+ }
+}
+
+void RendererImpl::setScreenMask(int width, int height, const unsigned char* rgbaData) {
+ assert(mRenderWindow);
+ mRenderWindow->setScreenMask(width, height, rgbaData);
+}
+
+void RendererImpl::onGuestGraphicsProcessCreate(uint64_t puid) {
+ FrameBuffer::getFB()->createGraphicsProcessResources(puid);
+}
+
+void RendererImpl::cleanupProcGLObjects(uint64_t puid) {
+ std::unique_ptr<ProcessResources> resource =
+ FrameBuffer::getFB()->removeGraphicsProcessResources(puid);
+ mCleanupThread->cleanup(puid, std::move(resource));
+}
+
+static struct AndroidVirtioGpuOps sVirtioGpuOps = {
+ .create_buffer_with_handle =
+ [](uint64_t size, uint32_t handle) {
+ FrameBuffer::getFB()->createBufferWithHandle(size, handle);
+ },
+ .create_color_buffer_with_handle =
+ [](uint32_t width, uint32_t height, uint32_t format, uint32_t fwkFormat, uint32_t handle) {
+ FrameBuffer::getFB()->createColorBufferWithHandle(width, height, (GLenum)format,
+ (FrameworkFormat)fwkFormat, handle);
+ },
+ .open_color_buffer = [](uint32_t handle) { FrameBuffer::getFB()->openColorBuffer(handle); },
+ .close_buffer = [](uint32_t handle) { FrameBuffer::getFB()->closeBuffer(handle); },
+ .close_color_buffer = [](uint32_t handle) { FrameBuffer::getFB()->closeColorBuffer(handle); },
+ .update_buffer =
+ [](uint32_t handle, uint64_t offset, uint64_t size, void* bytes) {
+ FrameBuffer::getFB()->updateBuffer(handle, offset, size, bytes);
+ },
+ .update_color_buffer =
+ [](uint32_t handle, int x, int y, int width, int height, uint32_t format, uint32_t type,
+ void* pixels) {
+ FrameBuffer::getFB()->updateColorBuffer(handle, x, y, width, height, format, type,
+ pixels);
+ },
+ .read_buffer =
+ [](uint32_t handle, uint64_t offset, uint64_t size, void* bytes) {
+ FrameBuffer::getFB()->readBuffer(handle, offset, size, bytes);
+ },
+ .read_color_buffer =
+ [](uint32_t handle, int x, int y, int width, int height, uint32_t format, uint32_t type,
+ void* pixels) {
+ FrameBuffer::getFB()->readColorBuffer(handle, x, y, width, height, format, type,
+ pixels);
+ },
+ .read_color_buffer_yuv =
+ [](uint32_t handle, int x, int y, int width, int height, void* pixels,
+ uint32_t pixels_size) {
+ FrameBuffer::getFB()->readColorBufferYUV(handle, x, y, width, height, pixels,
+ pixels_size);
+ },
+ .post_color_buffer = [](uint32_t handle) { FrameBuffer::getFB()->post(handle); },
+ .async_post_color_buffer =
+ [](uint32_t handle, CpuCompletionCallback cb) {
+ FrameBuffer::getFB()->postWithCallback(handle, cb);
+ },
+ .repost = []() { FrameBuffer::getFB()->repost(); },
+#if GFXSTREAM_ENABLE_HOST_GLES
+ .create_yuv_textures =
+ [](uint32_t type, uint32_t count, int width, int height, uint32_t* output) {
+ FrameBuffer::getFB()->createYUVTextures(type, count, width, height, output);
+ },
+ .destroy_yuv_textures =
+ [](uint32_t type, uint32_t count, uint32_t* textures) {
+ FrameBuffer::getFB()->destroyYUVTextures(type, count, textures);
+ },
+ .update_yuv_textures =
+ [](uint32_t type, uint32_t* textures, void* privData, void* func) {
+ FrameBuffer::getFB()->updateYUVTextures(type, textures, privData, func);
+ },
+ .swap_textures_and_update_color_buffer =
+ [](uint32_t colorbufferhandle, int x, int y, int width, int height, uint32_t format,
+ uint32_t type, uint32_t texture_type, uint32_t* textures, void* metadata) {
+ FrameBuffer::getFB()->swapTexturesAndUpdateColorBuffer(
+ colorbufferhandle, x, y, width, height, format, type, texture_type, textures);
+ },
+#endif
+ .get_last_posted_color_buffer =
+ []() { return FrameBuffer::getFB()->getLastPostedColorBuffer(); },
+#if GFXSTREAM_ENABLE_HOST_GLES
+ .bind_color_buffer_to_texture =
+ [](uint32_t handle) { FrameBuffer::getFB()->bindColorBufferToTexture2(handle); },
+ .get_global_egl_context = []() { return FrameBuffer::getFB()->getGlobalEGLContext(); },
+ .wait_for_gpu = [](uint64_t eglsync) { FrameBuffer::getFB()->waitForGpu(eglsync); },
+#endif
+ .wait_for_gpu_vulkan =
+ [](uint64_t device, uint64_t fence) {
+ FrameBuffer::getFB()->waitForGpuVulkan(device, fence);
+ },
+ .set_guest_managed_color_buffer_lifetime =
+ [](bool guestManaged) {
+ FrameBuffer::getFB()->setGuestManagedColorBufferLifetime(guestManaged);
+ },
+#if GFXSTREAM_ENABLE_HOST_GLES
+ .async_wait_for_gpu_with_cb =
+ [](uint64_t eglsync, FenceCompletionCallback cb) {
+ FrameBuffer::getFB()->asyncWaitForGpuWithCb(eglsync, cb);
+ },
+#endif
+ .async_wait_for_gpu_vulkan_with_cb =
+ [](uint64_t device, uint64_t fence, FenceCompletionCallback cb) {
+ FrameBuffer::getFB()->asyncWaitForGpuVulkanWithCb(device, fence, cb);
+ },
+ .async_wait_for_gpu_vulkan_qsri_with_cb =
+ [](uint64_t image, FenceCompletionCallback cb) {
+ FrameBuffer::getFB()->asyncWaitForGpuVulkanQsriWithCb(image, cb);
+ },
+ .wait_for_gpu_vulkan_qsri =
+ [](uint64_t image) { FrameBuffer::getFB()->waitForGpuVulkanQsri(image); },
+ .update_color_buffer_from_framework_format =
+ [](uint32_t handle, int x, int y, int width, int height, uint32_t fwkFormat,
+ uint32_t format, uint32_t type, void* pixels, void* pMetadata) {
+ FrameBuffer::getFB()->updateColorBufferFromFrameworkFormat(
+ handle, x, y, width, height, (FrameworkFormat)fwkFormat, format, type, pixels,
+ pMetadata);
+ },
+ .platform_import_resource =
+ [](uint32_t handle, uint32_t info, void* resource) {
+ return FrameBuffer::getFB()->platformImportResource(handle, info, resource);
+ },
+ .platform_resource_info =
+ [](uint32_t handle, int32_t* width, int32_t* height, int32_t* internal_format) {
+ return FrameBuffer::getFB()->getColorBufferInfo(handle, width, height, internal_format);
+ },
+#if GFXSTREAM_ENABLE_HOST_GLES
+ .platform_create_shared_egl_context =
+ []() { return FrameBuffer::getFB()->platformCreateSharedEglContext(); },
+ .platform_destroy_shared_egl_context =
+ [](void* context) {
+ return FrameBuffer::getFB()->platformDestroySharedEglContext(context);
+ },
+#endif
+};
+
+struct AndroidVirtioGpuOps* RendererImpl::getVirtioGpuOps() {
+ return &sVirtioGpuOps;
+}
+
+void RendererImpl::snapshotOperationCallback(int op, int stage) {
+ using namespace android::snapshot;
+ switch (op) {
+ case SNAPSHOTTER_OPERATION_LOAD:
+ if (stage == SNAPSHOTTER_STAGE_START) {
+#ifdef SNAPSHOT_PROFILE
+ android::base::System::Duration startTime =
+ android::base::System::get()->getUnixTimeUs();
+#endif
+ mRenderWindow->setPaused(true);
+ cleanupRenderThreads();
+#ifdef SNAPSHOT_PROFILE
+ printf("Previous session suspend time: %lld ms\n",
+ (long long)(android::base::System::get()
+ ->getUnixTimeUs() -
+ startTime) /
+ 1000);
+#endif
+ }
+ if (stage == SNAPSHOTTER_STAGE_END) {
+ mRenderWindow->setPaused(false);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+void RendererImpl::setVsyncHz(int vsyncHz) {
+ if (mRenderWindow) {
+ mRenderWindow->setVsyncHz(vsyncHz);
+ }
+}
+
+void RendererImpl::setDisplayConfigs(int configId, int w, int h,
+ int dpiX, int dpiY) {
+ if (mRenderWindow) {
+ mRenderWindow->setDisplayConfigs(configId, w, h, dpiX, dpiY);
+ }
+}
+
+void RendererImpl::setDisplayActiveConfig(int configId) {
+ if (mRenderWindow) {
+ mRenderWindow->setDisplayActiveConfig(configId);
+ }
+}
+
+const void* RendererImpl::getEglDispatch() {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ return FrameBuffer::getFB()->getEglDispatch();
+#else
+ return nullptr;
+#endif
+}
+
+const void* RendererImpl::getGles2Dispatch() {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ return FrameBuffer::getFB()->getGles2Dispatch();
+#else
+ return nullptr;
+#endif
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RendererImpl.h b/src/gfxstream/host/RendererImpl.h
new file mode 100644
index 00000000000..0c1bd98bf2c
--- /dev/null
+++ b/src/gfxstream/host/RendererImpl.h
@@ -0,0 +1,156 @@
+// 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 <memory>
+#include <unordered_set>
+#include <utility>
+#include <vector>
+
+#include "RenderThread.h"
+#include "RenderWindow.h"
+#include "aemu/base/Compiler.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/synchronization/MessageChannel.h"
+#include "aemu/base/threads/FunctorThread.h"
+#include "render-utils/Renderer.h"
+#include "snapshot/common.h"
+
+namespace android_studio {
+ class EmulatorGLESUsages;
+}
+
+namespace gfxstream {
+
+class RendererImpl final : public Renderer {
+public:
+ RendererImpl();
+ ~RendererImpl();
+
+ bool initialize(int width, int height, bool useSubWindow, bool egl2egl);
+ void stop(bool wait) override;
+ void finish() override;
+
+public:
+ RenderChannelPtr createRenderChannel(
+ android::base::Stream* loadStream, uint32_t virtioGpuContextId) final;
+
+ void* addressSpaceGraphicsConsumerCreate(
+ struct asg_context,
+ android::base::Stream* stream,
+ android::emulation::asg::ConsumerCallbacks,
+ uint32_t contextId, uint32_t capsetId,
+ std::optional<std::string> name) override final;
+ void addressSpaceGraphicsConsumerDestroy(void*) override final;
+ void addressSpaceGraphicsConsumerPreSave(void* consumer) override final;
+ void addressSpaceGraphicsConsumerSave(void* consumer, android::base::Stream* stream) override final;
+ void addressSpaceGraphicsConsumerPostSave(void* consumer) override final;
+ void addressSpaceGraphicsConsumerRegisterPostLoadRenderThread(void* consumer) override final;
+
+ HardwareStrings getHardwareStrings() final;
+ void setPostCallback(OnPostCallback onPost,
+ void* context,
+ bool useBgraReadback,
+ uint32_t displayId) final;
+ bool asyncReadbackSupported() final;
+ ReadPixelsCallback getReadPixelsCallback() final;
+ FlushReadPixelPipeline getFlushReadPixelPipeline() final;
+ bool showOpenGLSubwindow(FBNativeWindowType window,
+ int wx,
+ int wy,
+ int ww,
+ int wh,
+ int fbw,
+ int fbh,
+ float dpr,
+ float zRot,
+ bool deleteExisting,
+ bool hideWindow) final;
+ bool destroyOpenGLSubwindow() final;
+ void setOpenGLDisplayRotation(float zRot) final;
+ void setOpenGLDisplayTranslation(float px, float py) final;
+ void repaintOpenGLDisplay() final;
+
+ bool hasGuestPostedAFrame() final;
+ void resetGuestPostedAFrame() final;
+
+ void setScreenMask(int width, int height, const unsigned char* rgbaData) final;
+ void setMultiDisplay(uint32_t id,
+ int32_t x,
+ int32_t y,
+ uint32_t w,
+ uint32_t h,
+ uint32_t dpi,
+ bool add) final;
+ void setMultiDisplayColorBuffer(uint32_t id, uint32_t cb) override;
+ void onGuestGraphicsProcessCreate(uint64_t puid) final;
+ // TODO(kaiyili): rename this interface to onGuestGraphicsProcessDestroy.
+ void cleanupProcGLObjects(uint64_t puid) final;
+ void waitForProcessCleanup() final;
+ struct AndroidVirtioGpuOps* getVirtioGpuOps() final;
+
+ void pauseAllPreSave() final;
+ void resumeAll(bool waitForSave = true) final;
+
+ void save(android::base::Stream* stream,
+ const android::snapshot::ITextureSaverPtr& textureSaver) final;
+ bool load(android::base::Stream* stream,
+ const android::snapshot::ITextureLoaderPtr& textureLoader) final;
+ void fillGLESUsages(android_studio::EmulatorGLESUsages*) final;
+ int getScreenshot(unsigned int nChannels, unsigned int* width, unsigned int* height,
+ uint8_t* pixels, size_t* cPixels, int displayId, int desiredWidth,
+ int desiredHeight, int desiredRotation, Rect rect) final;
+
+ void snapshotOperationCallback(
+ int snapshotterOp,
+ int snapshotterStage) final;
+
+ void addListener(FrameBufferChangeEventListener* listener) override;
+ void removeListener(FrameBufferChangeEventListener* listener) override;
+
+ void setVsyncHz(int vsyncHz) final;
+ void setDisplayConfigs(int configId, int w, int h, int dpiX, int dpiY) override;
+ void setDisplayActiveConfig(int configId) override;
+
+ const void* getEglDispatch() override;
+ const void* getGles2Dispatch() override;
+
+private:
+ DISALLOW_COPY_ASSIGN_AND_MOVE(RendererImpl);
+
+private:
+ // Stop all render threads and wait until they exit,
+ // and also delete them.
+ void cleanupRenderThreads();
+
+ std::unique_ptr<RenderWindow> mRenderWindow;
+
+ android::base::Lock mChannelsLock;
+
+ std::vector<std::shared_ptr<RenderChannelImpl>> mChannels;
+ std::vector<std::shared_ptr<RenderChannelImpl>> mStoppedChannels;
+ bool mStopped = false;
+
+ class ProcessCleanupThread;
+ std::unique_ptr<ProcessCleanupThread> mCleanupThread;
+
+ std::unique_ptr<RenderThread> mLoaderRenderThread;
+
+ std::vector<RenderThread*> mAdditionalPostLoadRenderThreads;
+
+ android::base::Lock mAddressSpaceRenderThreadLock;
+ std::unordered_set<RenderThread*> mAddressSpaceRenderThreads;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RingStream.cpp b/src/gfxstream/host/RingStream.cpp
new file mode 100644
index 00000000000..5f3018ab787
--- /dev/null
+++ b/src/gfxstream/host/RingStream.cpp
@@ -0,0 +1,367 @@
+// 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 "RingStream.h"
+
+#include "aemu/base/system/System.h"
+
+#define EMUGL_DEBUG_LEVEL 0
+
+#include "host-common/crash_reporter.h"
+#include "host-common/debug.h"
+#include "host-common/dma_device.h"
+#include "host-common/GfxstreamFatalError.h"
+
+#include <assert.h>
+#include <memory.h>
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+namespace gfxstream {
+
+RingStream::RingStream(
+ struct asg_context context,
+ android::emulation::asg::ConsumerCallbacks callbacks,
+ size_t bufsize) :
+ IOStream(bufsize),
+ mContext(context),
+ mCallbacks(callbacks) { }
+RingStream::~RingStream() = default;
+
+int RingStream::getNeededFreeTailSize() const {
+ return mContext.ring_config->flush_interval;
+}
+
+void* RingStream::allocBuffer(size_t minSize) {
+ if (mWriteBuffer.size() < minSize) {
+ mWriteBuffer.resize_noinit(minSize);
+ }
+ return mWriteBuffer.data();
+}
+
+int RingStream::commitBuffer(size_t size) {
+ size_t sent = 0;
+ auto data = mWriteBuffer.data();
+
+ size_t iters = 0;
+ size_t backedOffIters = 0;
+ const size_t kBackoffIters = 10000000ULL;
+ while (sent < size) {
+ ++iters;
+ auto avail = ring_buffer_available_write(
+ mContext.from_host_large_xfer.ring,
+ &mContext.from_host_large_xfer.view);
+
+ // Check if the guest process crashed.
+ if (!avail) {
+ if (*(mContext.host_state) == ASG_HOST_STATE_EXIT) {
+ return sent;
+ } else {
+ ring_buffer_yield();
+ if (iters > kBackoffIters) {
+ android::base::sleepUs(10);
+ ++backedOffIters;
+ }
+ }
+ continue;
+ }
+
+ auto remaining = size - sent;
+ auto todo = remaining < avail ? remaining : avail;
+
+ ring_buffer_view_write(
+ mContext.from_host_large_xfer.ring,
+ &mContext.from_host_large_xfer.view,
+ data + sent, todo, 1);
+
+ sent += todo;
+ }
+
+ if (backedOffIters > 0) {
+ fprintf(stderr, "%s: warning: backed off %zu times due to guest slowness.\n",
+ __func__,
+ backedOffIters);
+ }
+ return sent;
+}
+
+const unsigned char* RingStream::readRaw(void* buf, size_t* inout_len) {
+ size_t wanted = *inout_len;
+ size_t count = 0U;
+ auto dst = static_cast<char*>(buf);
+
+ uint32_t ringAvailable = 0;
+ uint32_t ringLargeXferAvailable = 0;
+
+ const uint32_t maxSpins = 30;
+ uint32_t spins = 0;
+ bool inLargeXfer = true;
+
+ *(mContext.host_state) = ASG_HOST_STATE_CAN_CONSUME;
+
+ while (count < wanted) {
+
+ if (mReadBufferLeft) {
+ size_t avail = std::min<size_t>(wanted - count, mReadBufferLeft);
+ memcpy(dst + count,
+ mReadBuffer.data() + (mReadBuffer.size() - mReadBufferLeft),
+ avail);
+ count += avail;
+ mReadBufferLeft -= avail;
+ continue;
+ }
+
+ mReadBuffer.clear();
+
+ // no read buffer left...
+ if (count > 0) { // There is some data to return.
+ break;
+ }
+
+ *(mContext.host_state) = ASG_HOST_STATE_CAN_CONSUME;
+
+ // if (mInSnapshotOperation) {
+ // fprintf(stderr, "%s: %p in snapshot operation, exit\n", __func__, mRenderThreadPtr);
+ // // In a snapshot operation, exit
+ // return nullptr;
+ // }
+
+ if (mShouldExit) {
+ return nullptr;
+ }
+
+ ringAvailable =
+ ring_buffer_available_read(mContext.to_host, 0);
+ ringLargeXferAvailable =
+ ring_buffer_available_read(
+ mContext.to_host_large_xfer.ring,
+ &mContext.to_host_large_xfer.view);
+
+ auto current = dst + count;
+ auto ptrEnd = dst + wanted;
+
+ if (ringAvailable) {
+ inLargeXfer = false;
+ uint32_t transferMode =
+ mContext.ring_config->transfer_mode;
+ switch (transferMode) {
+ case 1:
+ type1Read(ringAvailable, dst, &count, &current, ptrEnd);
+ break;
+ case 2:
+ type2Read(ringAvailable, &count, &current, ptrEnd);
+ break;
+ case 3:
+ // emugl::emugl_crash_reporter(
+ // "Guest should never set to "
+ // "transfer mode 3 with ringAvailable != 0\n");
+ default:
+ // emugl::emugl_crash_reporter(
+ // "Unknown transfer mode %u\n",
+ // transferMode);
+ break;
+ }
+ } else if (ringLargeXferAvailable) {
+ type3Read(ringLargeXferAvailable,
+ &count, &current, ptrEnd);
+ inLargeXfer = true;
+ if (0 == __atomic_load_n(&mContext.ring_config->transfer_size, __ATOMIC_ACQUIRE)) {
+ inLargeXfer = false;
+ }
+ } else {
+ if (inLargeXfer && 0 != __atomic_load_n(&mContext.ring_config->transfer_size, __ATOMIC_ACQUIRE)) {
+ continue;
+ }
+
+ if (inLargeXfer && 0 == __atomic_load_n(&mContext.ring_config->transfer_size, __ATOMIC_ACQUIRE)) {
+ inLargeXfer = false;
+ }
+
+ if (++spins < maxSpins) {
+ ring_buffer_yield();
+ continue;
+ } else {
+ spins = 0;
+ }
+
+ if (mShouldExit) {
+ return nullptr;
+ }
+
+ if (mShouldExitForSnapshot && mInSnapshotOperation) {
+ return nullptr;
+ }
+
+ int unavailReadResult = mCallbacks.onUnavailableRead();
+
+ if (-1 == unavailReadResult) {
+ mShouldExit = true;
+ }
+
+ // pause pre snapshot
+ if (-2 == unavailReadResult) {
+ mShouldExitForSnapshot = true;
+ }
+
+ // resume post snapshot
+ if (-3 == unavailReadResult) {
+ mShouldExitForSnapshot = false;
+ }
+
+ continue;
+ }
+ }
+
+ *inout_len = count;
+ ++mXmits;
+ mTotalRecv += count;
+ D("read %d bytes", (int)count);
+
+ *(mContext.host_state) = ASG_HOST_STATE_RENDERING;
+ return (const unsigned char*)buf;
+}
+
+void RingStream::type1Read(
+ uint32_t available,
+ char* begin,
+ size_t* count, char** current, const char* ptrEnd) {
+
+ uint32_t xferTotal = available / sizeof(struct asg_type1_xfer);
+
+ if (mType1Xfers.size() < xferTotal) {
+ mType1Xfers.resize(xferTotal * 2);
+ }
+
+ auto xfersPtr = mType1Xfers.data();
+
+ ring_buffer_copy_contents(
+ mContext.to_host, 0, xferTotal * sizeof(struct asg_type1_xfer), (uint8_t*)xfersPtr);
+
+ for (uint32_t i = 0; i < xferTotal; ++i) {
+ if (*current + xfersPtr[i].size > ptrEnd) {
+ // Save in a temp buffer or we'll get stuck
+ if (begin == *current && i == 0) {
+ const char* src = mContext.buffer + xfersPtr[i].offset;
+ mReadBuffer.resize_noinit(xfersPtr[i].size);
+ memcpy(mReadBuffer.data(), src, xfersPtr[i].size);
+ mReadBufferLeft = xfersPtr[i].size;
+ ring_buffer_advance_read(
+ mContext.to_host, sizeof(struct asg_type1_xfer), 1);
+ __atomic_fetch_add(&mContext.ring_config->host_consumed_pos, xfersPtr[i].size, __ATOMIC_RELEASE);
+ }
+ return;
+ }
+ const char* src = mContext.buffer + xfersPtr[i].offset;
+ memcpy(*current, src, xfersPtr[i].size);
+ ring_buffer_advance_read(
+ mContext.to_host, sizeof(struct asg_type1_xfer), 1);
+ __atomic_fetch_add(&mContext.ring_config->host_consumed_pos, xfersPtr[i].size, __ATOMIC_RELEASE);
+ *current += xfersPtr[i].size;
+ *count += xfersPtr[i].size;
+
+ // TODO: Figure out why running multiple xfers here can result in data
+ // corruption.
+ return;
+ }
+}
+
+void RingStream::type2Read(
+ uint32_t available,
+ size_t* count, char** current,const char* ptrEnd) {
+
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "nyi. abort";
+
+ uint32_t xferTotal = available / sizeof(struct asg_type2_xfer);
+
+ if (mType2Xfers.size() < xferTotal) {
+ mType2Xfers.resize(xferTotal * 2);
+ }
+
+ auto xfersPtr = mType2Xfers.data();
+
+ ring_buffer_copy_contents(
+ mContext.to_host, 0, available, (uint8_t*)xfersPtr);
+
+ for (uint32_t i = 0; i < xferTotal; ++i) {
+
+ if (*current + xfersPtr[i].size > ptrEnd) return;
+
+ const char* src =
+ mCallbacks.getPtr(xfersPtr[i].physAddr);
+
+ memcpy(*current, src, xfersPtr[i].size);
+
+ ring_buffer_advance_read(
+ mContext.to_host, sizeof(struct asg_type1_xfer), 1);
+
+ *current += xfersPtr[i].size;
+ *count += xfersPtr[i].size;
+ }
+}
+
+void RingStream::type3Read(
+ uint32_t available,
+ size_t* count, char** current, const char* ptrEnd) {
+
+ uint32_t xferTotal = __atomic_load_n(&mContext.ring_config->transfer_size, __ATOMIC_ACQUIRE);
+ uint32_t maxCanRead = ptrEnd - *current;
+ uint32_t ringAvail = available;
+ uint32_t actuallyRead = std::min(ringAvail, std::min(xferTotal, maxCanRead));
+
+ // Decrement transfer_size before letting the guest proceed in ring_buffer funcs or we will race
+ // to the next time the guest sets transfer_size
+ __atomic_fetch_sub(&mContext.ring_config->transfer_size, actuallyRead, __ATOMIC_RELEASE);
+
+ ring_buffer_read_fully_with_abort(
+ mContext.to_host_large_xfer.ring,
+ &mContext.to_host_large_xfer.view,
+ *current, actuallyRead,
+ 1, &mContext.ring_config->in_error);
+
+ *current += actuallyRead;
+ *count += actuallyRead;
+}
+
+void* RingStream::getDmaForReading(uint64_t guest_paddr) {
+ return emugl::g_emugl_dma_get_host_addr(guest_paddr);
+}
+
+void RingStream::unlockDma(uint64_t guest_paddr) { emugl::g_emugl_dma_unlock(guest_paddr); }
+
+int RingStream::writeFully(const void* buf, size_t len) {
+ void* dstBuf = alloc(len);
+ memcpy(dstBuf, buf, len);
+ flush();
+ return 0;
+}
+
+const unsigned char *RingStream::readFully( void *buf, size_t len) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "not intended for use with RingStream";
+}
+
+void RingStream::onSave(android::base::Stream* stream) {
+ stream->putBe32(mReadBufferLeft);
+ stream->write(mReadBuffer.data() + mReadBuffer.size() - mReadBufferLeft,
+ mReadBufferLeft);
+ android::base::saveBuffer(stream, mWriteBuffer);
+}
+
+unsigned char* RingStream::onLoad(android::base::Stream* stream) {
+ android::base::loadBuffer(stream, &mReadBuffer);
+ mReadBufferLeft = mReadBuffer.size();
+ android::base::loadBuffer(stream, &mWriteBuffer);
+ return reinterpret_cast<unsigned char*>(mWriteBuffer.data());
+}
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/RingStream.h b/src/gfxstream/host/RingStream.h
new file mode 100644
index 00000000000..78e6cf71453
--- /dev/null
+++ b/src/gfxstream/host/RingStream.h
@@ -0,0 +1,94 @@
+// 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.
+#pragma once
+
+#include "render-utils/IOStream.h"
+#include "render-utils/RenderChannel.h"
+
+#include "aemu/base/ring_buffer.h"
+#include "host-common/address_space_graphics_types.h"
+
+#include <functional>
+#include <vector>
+
+namespace gfxstream {
+
+// An IOStream instance that can be used by the host RenderThread to process
+// messages from a pair of ring buffers (to host and from host). It also takes
+// a callback that does something when there are no available bytes to read in
+// the "to host" ring buffer.
+class RingStream final : public IOStream {
+public:
+ using OnUnavailableReadCallback = std::function<int()>;
+ using GetPtrAndSizeCallback =
+ std::function<void(uint64_t, char**, size_t*)>;
+
+ RingStream(
+ struct asg_context context,
+ android::emulation::asg::ConsumerCallbacks callbacks,
+ size_t bufsize);
+ ~RingStream();
+
+ int getNeededFreeTailSize() const;
+
+ int writeFully(const void* buf, size_t len) override;
+ const unsigned char *readFully( void *buf, size_t len) override;
+
+ void printStats();
+
+ void pausePreSnapshot() {
+ mInSnapshotOperation = true;
+ }
+
+ void resume() {
+ mInSnapshotOperation = false;
+ }
+
+ bool inSnapshotOperation() const {
+ return mInSnapshotOperation;
+ }
+
+protected:
+ virtual void* allocBuffer(size_t minSize) override final;
+ virtual int commitBuffer(size_t size) override final;
+ virtual const unsigned char* readRaw(void* buf, size_t* inout_len) override final;
+ virtual void* getDmaForReading(uint64_t guest_paddr) override final;
+ virtual void unlockDma(uint64_t guest_paddr) override final;
+
+ void onSave(android::base::Stream* stream) override;
+ unsigned char* onLoad(android::base::Stream* stream) override;
+
+ void type1Read(uint32_t available, char* begin, size_t* count, char** current, const char* ptrEnd);
+ void type2Read(uint32_t available, size_t* count, char** current, const char* ptrEnd);
+ void type3Read(uint32_t available, size_t* count, char** current, const char* ptrEnd);
+
+ struct asg_context mContext;
+ android::emulation::asg::ConsumerCallbacks mCallbacks;
+
+ std::vector<asg_type1_xfer> mType1Xfers;
+ std::vector<asg_type2_xfer> mType2Xfers;
+
+ RenderChannel::Buffer mReadBuffer;
+ RenderChannel::Buffer mWriteBuffer;
+ size_t mReadBufferLeft = 0;
+
+ size_t mXmits = 0;
+ size_t mTotalRecv = 0;
+ bool mBenchmarkEnabled = false;
+ bool mShouldExit = false;
+ bool mShouldExitForSnapshot = false;
+ bool mInSnapshotOperation = false;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/StalePtrRegistry.h b/src/gfxstream/host/StalePtrRegistry.h
new file mode 100644
index 00000000000..6a9656f5913
--- /dev/null
+++ b/src/gfxstream/host/StalePtrRegistry.h
@@ -0,0 +1,146 @@
+/*
+* 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.
+*/
+#pragma once
+
+#include "aemu/base/containers/Lookup.h"
+#include "aemu/base/files/Stream.h"
+#include "aemu/base/files/StreamSerializing.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/Compiler.h"
+
+#include <algorithm>
+#include <cstdint>
+#include <unordered_map>
+
+namespace gfxstream {
+
+// The purpose of StalePtrRegistry is to track integers corresponding to
+// host-side pointers that may be invalidated after snapshots.
+template <class T>
+class StalePtrRegistry {
+public:
+ StalePtrRegistry() = default;
+
+ void addPtr(T* ptr) {
+ android::base::AutoWriteLock lock(mLock);
+ mPtrs[asHandle(ptr)] = { ptr, Staleness::Live };
+ }
+
+ void removePtr(T* ptr) {
+ android::base::AutoWriteLock lock(mLock);
+ uint64_t handle = asHandle(ptr);
+ mPtrs.erase(handle);
+ }
+
+ void remapStalePtr(uint64_t handle, T* newptr) {
+ android::base::AutoWriteLock lock(mLock);
+ mPtrs[handle] = { newptr, Staleness::PrevSnapshot };
+ }
+
+ T* getPtr(uint64_t handle, T* defaultPtr = nullptr,
+ bool removeFromStaleOnGet = false) {
+ android::base::AutoReadLock lock(mLock);
+
+ // return |defaultPtr| if not found.
+ T* res = defaultPtr;
+
+ Entry* it = nullptr;
+
+ if ((it = android::base::find(mPtrs, handle)))
+ res = it->ptr;
+
+ if (removeFromStaleOnGet &&
+ it && it->staleness == Staleness::PrevSnapshot) {
+ lock.unlockRead();
+ android::base::AutoWriteLock wrlock(mLock);
+ mPtrs.erase(handle);
+ }
+
+ return res;
+ }
+
+ void makeCurrentPtrsStale() {
+ android::base::AutoWriteLock lock(mLock);
+ for (auto& it : mPtrs) {
+ it.second.staleness =
+ Staleness::PrevSnapshot;
+ }
+ }
+
+ size_t numCurrEntries() const {
+ return countWithStaleness(Staleness::Live);
+ }
+
+ size_t numStaleEntries() const {
+ return countWithStaleness(Staleness::PrevSnapshot);
+ }
+
+ void onSave(android::base::Stream* stream) {
+ android::base::AutoReadLock lock(mLock);
+ saveCollection(
+ stream, mPtrs,
+ [](android::base::Stream* stream,
+ const std::pair<uint64_t, Entry>& entry) {
+ stream->putBe64(entry.first);
+ });
+ }
+
+ void onLoad(android::base::Stream* stream) {
+ android::base::AutoWriteLock lock(mLock);
+ loadCollection(
+ stream, &mPtrs,
+ [](android::base::Stream* stream) {
+ uint64_t handle = stream->getBe64();
+ return std::make_pair(
+ handle,
+ (Entry){ nullptr, Staleness::PrevSnapshot });
+ });
+ }
+private:
+ static uint64_t asHandle(const T* ptr) {
+ return (uint64_t)(uintptr_t)ptr;
+ }
+
+ static T* asPtr(uint64_t handle) {
+ return (T*)(uintptr_t)handle;
+ }
+
+ enum class Staleness {
+ Live,
+ PrevSnapshot,
+ };
+ struct Entry {
+ T* ptr;
+ Staleness staleness;
+ };
+
+ using PtrMap = std::unordered_map<uint64_t, Entry>;
+
+ size_t countWithStaleness(Staleness check) const {
+ android::base::AutoReadLock lock(mLock);
+ return std::count_if(mPtrs.begin(), mPtrs.end(),
+ [check](const typename PtrMap::value_type& entry) {
+ return entry.second.staleness == check;
+ });
+ }
+
+ mutable android::base::ReadWriteLock mLock;
+ PtrMap mPtrs;
+
+ DISALLOW_COPY_AND_ASSIGN(StalePtrRegistry);
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/SyncThread.cpp b/src/gfxstream/host/SyncThread.cpp
new file mode 100644
index 00000000000..5b1d1c11ed3
--- /dev/null
+++ b/src/gfxstream/host/SyncThread.cpp
@@ -0,0 +1,476 @@
+/*
+* 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 "SyncThread.h"
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include "OpenGLESDispatch/OpenGLDispatchLoader.h"
+#endif
+
+#include "aemu/base/Metrics.h"
+#include "aemu/base/system/System.h"
+#include "aemu/base/threads/Thread.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/crash_reporter.h"
+#include "host-common/logging.h"
+#include "host-common/sync_device.h"
+
+#ifndef _MSC_VER
+#include <sys/time.h>
+#endif
+#include <memory>
+
+namespace gfxstream {
+
+using android::base::EventHangMetadata;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+using gl::EGLDispatch;
+using gl::EmulatedEglFenceSync;
+#endif
+
+#define DEBUG 0
+
+#if DEBUG
+
+static uint64_t curr_ms() {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_usec / 1000 + tv.tv_sec * 1000;
+}
+
+#define DPRINT(fmt, ...) do { \
+ if (!VERBOSE_CHECK(syncthreads)) VERBOSE_ENABLE(syncthreads); \
+ VERBOSE_TID_FUNCTION_DPRINT(syncthreads, "@ time=%llu: " fmt, curr_ms(), ##__VA_ARGS__); \
+} while(0)
+
+#else
+
+#define DPRINT(...)
+
+#endif
+
+#define SYNC_THREAD_CHECK(condition) \
+ do { \
+ if (!(condition)) { \
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << \
+ #condition << " is false"; \
+ } \
+ } while (0)
+
+// The single global sync thread instance.
+class GlobalSyncThread {
+public:
+ GlobalSyncThread() = default;
+
+ void initialize(bool hasGl, HealthMonitor<>* healthMonitor) {
+ AutoLock mutex(mLock);
+ SYNC_THREAD_CHECK(!mSyncThread);
+ mSyncThread = std::make_unique<SyncThread>(hasGl, healthMonitor);
+ }
+ SyncThread* syncThreadPtr() {
+ AutoLock mutex(mLock);
+ return mSyncThread.get();
+ }
+
+ void destroy() {
+ AutoLock mutex(mLock);
+ mSyncThread = nullptr;
+ }
+
+private:
+ std::unique_ptr<SyncThread> mSyncThread = nullptr;
+ // lock for the access to this object
+ android::base::Lock mLock;
+ using AutoLock = android::base::AutoLock;
+};
+
+static GlobalSyncThread* sGlobalSyncThread() {
+ static GlobalSyncThread* t = new GlobalSyncThread;
+ return t;
+}
+
+static const uint32_t kTimelineInterval = 1;
+static const uint64_t kDefaultTimeoutNsecs = 5ULL * 1000ULL * 1000ULL * 1000ULL;
+
+SyncThread::SyncThread(bool hasGl, HealthMonitor<>* healthMonitor)
+ : android::base::Thread(android::base::ThreadFlags::MaskSignals, 512 * 1024),
+ mWorkerThreadPool(kNumWorkerThreads,
+ [this](Command&& command, ThreadPool::WorkerId id) {
+ doSyncThreadCmd(std::move(command), id);
+ }),
+ mHasGl(hasGl),
+ mHealthMonitor(healthMonitor) {
+ this->start();
+ mWorkerThreadPool.start();
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (hasGl) {
+ initSyncEGLContext();
+ }
+#endif
+}
+
+SyncThread::~SyncThread() {
+ cleanup();
+}
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+void SyncThread::triggerWait(EmulatedEglFenceSync* fenceSync,
+ uint64_t timeline) {
+ std::stringstream ss;
+ ss << "triggerWait fenceSyncInfo=0x" << std::hex << reinterpret_cast<uintptr_t>(fenceSync)
+ << " timeline=0x" << std::hex << timeline;
+ sendAsync(
+ [fenceSync, timeline, this](WorkerId) {
+ doSyncWait(fenceSync, [timeline] {
+ DPRINT("wait done (with fence), use goldfish sync timeline inc");
+ emugl::emugl_sync_timeline_inc(timeline, kTimelineInterval);
+ });
+ },
+ ss.str());
+}
+
+void SyncThread::triggerBlockedWaitNoTimeline(EmulatedEglFenceSync* fenceSync) {
+ std::stringstream ss;
+ ss << "triggerBlockedWaitNoTimeline fenceSyncInfo=0x" << std::hex
+ << reinterpret_cast<uintptr_t>(fenceSync);
+ sendAndWaitForResult(
+ [fenceSync, this](WorkerId) {
+ doSyncWait(fenceSync, std::function<void()>());
+ return 0;
+ },
+ ss.str());
+}
+
+void SyncThread::triggerWaitWithCompletionCallback(EmulatedEglFenceSync* fenceSync, FenceCompletionCallback cb) {
+ std::stringstream ss;
+ ss << "triggerWaitWithCompletionCallback fenceSyncInfo=0x" << std::hex
+ << reinterpret_cast<uintptr_t>(fenceSync);
+ sendAsync(
+ [fenceSync, cb = std::move(cb), this](WorkerId) { doSyncWait(fenceSync, std::move(cb)); },
+ ss.str());
+}
+
+void SyncThread::initSyncEGLContext() {
+ mWorkerThreadPool.broadcast([this] {
+ return Command{
+ .mTask = std::packaged_task<int(WorkerId)>([this](WorkerId workerId) {
+ DPRINT("for worker id: %d", workerId);
+ // We shouldn't initialize EGL context, when SyncThread is initialized
+ // without GL enabled.
+ SYNC_THREAD_CHECK(mHasGl);
+
+ const EGLDispatch* egl = gl::LazyLoadedEGLDispatch::get();
+
+ mDisplay = egl->eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ int eglMaj, eglMin;
+ egl->eglInitialize(mDisplay, &eglMaj, &eglMin);
+
+ const EGLint configAttribs[] = {
+ EGL_SURFACE_TYPE,
+ EGL_PBUFFER_BIT,
+ EGL_RENDERABLE_TYPE,
+ EGL_OPENGL_ES2_BIT,
+ EGL_RED_SIZE,
+ 8,
+ EGL_GREEN_SIZE,
+ 8,
+ EGL_BLUE_SIZE,
+ 8,
+ EGL_NONE,
+ };
+
+ EGLint nConfigs;
+ EGLConfig config;
+
+ egl->eglChooseConfig(mDisplay, configAttribs, &config, 1, &nConfigs);
+
+ const EGLint pbufferAttribs[] = {
+ EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE,
+ };
+
+ mSurface[workerId] = egl->eglCreatePbufferSurface(mDisplay, config, pbufferAttribs);
+
+ const EGLint contextAttribs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
+ mContext[workerId] =
+ egl->eglCreateContext(mDisplay, config, EGL_NO_CONTEXT, contextAttribs);
+
+ egl->eglMakeCurrent(mDisplay, mSurface[workerId], mSurface[workerId],
+ mContext[workerId]);
+ return 0;
+ }),
+ .mDescription = "init sync EGL context",
+ };
+ });
+ mWorkerThreadPool.waitAllItems();
+}
+
+void SyncThread::doSyncWait(EmulatedEglFenceSync* fenceSync, std::function<void()> onComplete) {
+ DPRINT("enter");
+
+ if (!EmulatedEglFenceSync::getFromHandle((uint64_t)(uintptr_t)fenceSync)) {
+ if (onComplete) {
+ onComplete();
+ }
+ return;
+ }
+ // We shouldn't use EmulatedEglFenceSync to wait, when SyncThread is initialized
+ // without GL enabled, because EmulatedEglFenceSync uses EGL/GLES.
+ SYNC_THREAD_CHECK(mHasGl);
+
+ EGLint wait_result = 0x0;
+
+ DPRINT("wait on sync obj: %p", fenceSync);
+ wait_result = fenceSync->wait(kDefaultTimeoutNsecs);
+
+ DPRINT(
+ "done waiting, with wait result=0x%x. "
+ "increment timeline (and signal fence)",
+ wait_result);
+
+ if (wait_result != EGL_CONDITION_SATISFIED_KHR) {
+ EGLint error = gl::s_egl.eglGetError();
+ DPRINT("error: eglClientWaitSync abnormal exit 0x%x. sync handle 0x%llx. egl error = %#x\n",
+ wait_result, (unsigned long long)fenceSync, error);
+ (void)error;
+ }
+
+ DPRINT("issue timeline increment");
+
+ // We always unconditionally increment timeline at this point, even
+ // if the call to eglClientWaitSync returned abnormally.
+ // There are three cases to consider:
+ // - EGL_CONDITION_SATISFIED_KHR: either the sync object is already
+ // signaled and we need to increment this timeline immediately, or
+ // we have waited until the object is signaled, and then
+ // we increment the timeline.
+ // - EGL_TIMEOUT_EXPIRED_KHR: the fence command we put in earlier
+ // in the OpenGL stream is not actually ever signaled, and we
+ // end up blocking in the above eglClientWaitSyncKHR call until
+ // our timeout runs out. In this case, provided we have waited
+ // for |kDefaultTimeoutNsecs|, the guest will have received all
+ // relevant error messages about fence fd's not being signaled
+ // in time, so we are properly emulating bad behavior even if
+ // we now increment the timeline.
+ // - EGL_FALSE (error): chances are, the underlying EGL implementation
+ // on the host doesn't actually support fence objects. In this case,
+ // we should fail safe: 1) It must be only very old or faulty
+ // graphics drivers / GPU's that don't support fence objects.
+ // 2) The consequences of signaling too early are generally, out of
+ // order frames and scrambled textures in some apps. But, not
+ // incrementing the timeline means that the app's rendering freezes.
+ // So, despite the faulty GPU driver, not incrementing is too heavyweight a response.
+
+ if (onComplete) {
+ onComplete();
+ }
+ EmulatedEglFenceSync::incrementTimelineAndDeleteOldFences();
+
+ DPRINT("done timeline increment");
+
+ DPRINT("exit");
+}
+
+#endif
+
+void SyncThread::triggerWaitVk(VkFence vkFence, uint64_t timeline) {
+ std::stringstream ss;
+ ss << "triggerWaitVk vkFence=0x" << std::hex << reinterpret_cast<uintptr_t>(vkFence)
+ << " timeline=0x" << std::hex << timeline;
+ sendAsync(
+ [vkFence, timeline](WorkerId) {
+ doSyncWaitVk(vkFence, [timeline] {
+ DPRINT("vk wait done, use goldfish sync timeline inc");
+ emugl::emugl_sync_timeline_inc(timeline, kTimelineInterval);
+ });
+ },
+ ss.str());
+}
+
+void SyncThread::triggerWaitVkWithCompletionCallback(VkFence vkFence, FenceCompletionCallback cb) {
+ std::stringstream ss;
+ ss << "triggerWaitVkWithCompletionCallback vkFence=0x" << std::hex
+ << reinterpret_cast<uintptr_t>(vkFence);
+ sendAsync([vkFence, cb = std::move(cb)](WorkerId) { doSyncWaitVk(vkFence, std::move(cb)); },
+ ss.str());
+}
+
+void SyncThread::triggerWaitVkQsriWithCompletionCallback(VkImage vkImage, FenceCompletionCallback cb) {
+ std::stringstream ss;
+ ss << "triggerWaitVkQsriWithCompletionCallback vkImage=0x"
+ << reinterpret_cast<uintptr_t>(vkImage);
+ sendAsync(
+ [vkImage, cb = std::move(cb)](WorkerId) {
+ auto decoder = vk::VkDecoderGlobalState::get();
+ auto res = decoder->registerQsriCallback(vkImage, cb);
+ // If registerQsriCallback does not schedule the callback, we still need to complete
+ // the task, otherwise we may hit deadlocks on tasks on the same ring.
+ if (!res.CallbackScheduledOrFired()) {
+ cb();
+ }
+ },
+ ss.str());
+}
+
+void SyncThread::triggerWaitVkQsri(VkImage vkImage, uint64_t timeline) {
+ std::stringstream ss;
+ ss << "triggerWaitVkQsri vkImage=0x" << std::hex << vkImage
+ << " timeline=0x" << std::hex << timeline;
+ sendAsync(
+ [vkImage, timeline](WorkerId) {
+ auto decoder = vk::VkDecoderGlobalState::get();
+ auto res = decoder->registerQsriCallback(vkImage, [timeline](){
+ emugl::emugl_sync_timeline_inc(timeline, kTimelineInterval);
+ });
+ // If registerQsriCallback does not schedule the callback, we still need to complete
+ // the task, otherwise we may hit deadlocks on tasks on the same ring.
+ if (!res.CallbackScheduledOrFired()) {
+ emugl::emugl_sync_timeline_inc(timeline, kTimelineInterval);
+ }
+ },
+ ss.str());
+}
+
+void SyncThread::triggerGeneral(FenceCompletionCallback cb, std::string description) {
+ std::stringstream ss;
+ ss << "triggerGeneral: " << description;
+ sendAsync(std::bind(std::move(cb)), ss.str());
+}
+
+void SyncThread::cleanup() {
+ sendAndWaitForResult(
+ [this](WorkerId workerId) {
+#if GFXSTREAM_ENABLE_HOST_GLES
+ if (mHasGl) {
+ const EGLDispatch* egl = gl::LazyLoadedEGLDispatch::get();
+
+ egl->eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+
+ egl->eglDestroyContext(mDisplay, mContext[workerId]);
+ egl->eglDestroySurface(mDisplay, mSurface[workerId]);
+ mContext[workerId] = EGL_NO_CONTEXT;
+ mSurface[workerId] = EGL_NO_SURFACE;
+ }
+#endif
+ return 0;
+ },
+ "cleanup");
+ DPRINT("signal");
+ mLock.lock();
+ mExiting = true;
+ mCv.signalAndUnlock(&mLock);
+ DPRINT("exit");
+ // Wait for the control thread to exit. We can't destroy the SyncThread
+ // before we wait the control thread.
+ if (!wait(nullptr)) {
+ ERR("Fail to wait the control thread of the SyncThread to exit.");
+ }
+}
+
+// Private methods below////////////////////////////////////////////////////////
+
+intptr_t SyncThread::main() {
+ DPRINT("in sync thread");
+ mLock.lock();
+ mCv.wait(&mLock, [this] { return mExiting; });
+
+ mWorkerThreadPool.done();
+ mWorkerThreadPool.join();
+ DPRINT("exited sync thread");
+ return 0;
+}
+
+int SyncThread::sendAndWaitForResult(std::function<int(WorkerId)> job, std::string description) {
+ DPRINT("sendAndWaitForResult task(%s)", description.c_str());
+ std::packaged_task<int(WorkerId)> task(std::move(job));
+ std::future<int> resFuture = task.get_future();
+ Command command = {
+ .mTask = std::move(task),
+ .mDescription = std::move(description),
+ };
+
+ mWorkerThreadPool.enqueue(std::move(command));
+ auto res = resFuture.get();
+ DPRINT("exit");
+ return res;
+}
+
+void SyncThread::sendAsync(std::function<void(WorkerId)> job, std::string description) {
+ DPRINT("send task(%s)", description.c_str());
+ mWorkerThreadPool.enqueue(Command{
+ .mTask =
+ std::packaged_task<int(WorkerId)>([job = std::move(job)](WorkerId workerId) mutable {
+ job(workerId);
+ return 0;
+ }),
+ .mDescription = std::move(description),
+ });
+ DPRINT("exit");
+}
+
+void SyncThread::doSyncThreadCmd(Command&& command, WorkerId workerId) {
+ std::unique_ptr<std::unordered_map<std::string, std::string>> syncThreadData =
+ std::make_unique<std::unordered_map<std::string, std::string>>();
+ syncThreadData->insert({{"syncthread_cmd_desc", command.mDescription}});
+ auto watchdog = WATCHDOG_BUILDER(mHealthMonitor, "SyncThread task execution")
+ .setHangType(EventHangMetadata::HangType::kSyncThread)
+ .setAnnotations(std::move(syncThreadData))
+ .build();
+ command.mTask(workerId);
+}
+
+int SyncThread::doSyncWaitVk(VkFence vkFence, std::function<void()> onComplete) {
+ DPRINT("enter");
+
+ auto decoder = vk::VkDecoderGlobalState::get();
+ auto result = decoder->waitForFence(vkFence, kDefaultTimeoutNsecs);
+ if (result == VK_TIMEOUT) {
+ DPRINT("SYNC_WAIT_VK timeout: vkFence=%p", vkFence);
+ } else if (result != VK_SUCCESS) {
+ DPRINT("SYNC_WAIT_VK error: %d vkFence=%p", result, vkFence);
+ }
+
+ DPRINT("issue timeline increment");
+
+ // We always unconditionally increment timeline at this point, even
+ // if the call to vkWaitForFences returned abnormally.
+ // See comments in |doSyncWait| about the rationale.
+ if (onComplete) {
+ onComplete();
+ }
+
+ DPRINT("done timeline increment");
+
+ DPRINT("exit");
+ return result;
+}
+
+/* static */
+SyncThread* SyncThread::get() {
+ auto res = sGlobalSyncThread()->syncThreadPtr();
+ SYNC_THREAD_CHECK(res);
+ return res;
+}
+
+void SyncThread::initialize(bool hasGl, HealthMonitor<>* healthMonitor) {
+ sGlobalSyncThread()->initialize(hasGl, healthMonitor);
+}
+
+void SyncThread::destroy() { sGlobalSyncThread()->destroy(); }
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/SyncThread.h b/src/gfxstream/host/SyncThread.h
new file mode 100644
index 00000000000..1c843019838
--- /dev/null
+++ b/src/gfxstream/host/SyncThread.h
@@ -0,0 +1,164 @@
+/*
+ * 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
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include "gl/EmulatedEglFenceSync.h"
+#endif
+
+#include <functional>
+#include <future>
+#include <string>
+#include <type_traits>
+
+#include "aemu/base/HealthMonitor.h"
+#include "aemu/base/Optional.h"
+#include "aemu/base/synchronization/ConditionVariable.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/synchronization/MessageChannel.h"
+#include "aemu/base/threads/Thread.h"
+#include "aemu/base/threads/ThreadPool.h"
+#include "render-utils/virtio_gpu_ops.h"
+#include "vulkan/VkDecoderGlobalState.h"
+
+namespace gfxstream {
+
+using emugl::HealthMonitor;
+using emugl::HealthWatchdog;
+
+// SyncThread///////////////////////////////////////////////////////////////////
+// The purpose of SyncThread is to track sync device timelines and give out +
+// signal FD's that correspond to the completion of host-side GL fence commands.
+
+struct RenderThreadInfo;
+class SyncThread : public android::base::Thread {
+ public:
+ // - constructor: start up the sync worker threads for a given context.
+ // The initialization of the sync threads is nonblocking.
+ // - Triggers a |SyncThreadCmd| with op code |SYNC_THREAD_EGL_INIT|
+ SyncThread(bool hasGl, HealthMonitor<>* healthMonitor);
+ ~SyncThread();
+
+ // |triggerWaitVk|: async wait with a given VkFence object.
+ // The |vkFence| argument is a *boxed* host Vulkan handle of the fence.
+ //
+ // We call vkWaitForFences() on host Vulkan device to wait for the fence.
+ // After wait is over, the timeline will be incremented,
+ // which should signal the guest-side fence FD / Zircon eventpair.
+ // This method is how the goldfish sync virtual device
+ // knows when to increment timelines / signal native fence FD's.
+ void triggerWaitVk(VkFence vkFence, uint64_t timeline);
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ // |triggerWait|: async wait with a given EmulatedEglFenceSync object.
+ // We use the wait() method to do a eglClientWaitSyncKHR.
+ // After wait is over, the timeline will be incremented,
+ // which should signal the guest-side fence FD.
+ // This method is how the goldfish sync virtual device
+ // knows when to increment timelines / signal native fence FD's.
+ void triggerWait(gl::EmulatedEglFenceSync* fenceSync, uint64_t timeline);
+
+ // for use with the virtio-gpu path; is meant to have a current context
+ // while waiting.
+ void triggerBlockedWaitNoTimeline(gl::EmulatedEglFenceSync* fenceSync);
+
+ // For use with virtio-gpu and async fence completion callback. This is async like triggerWait,
+ // but takes a fence completion callback instead of incrementing some timeline directly.
+ void triggerWaitWithCompletionCallback(gl::EmulatedEglFenceSync* fenceSync,
+ FenceCompletionCallback);
+
+ // |initSyncContext| creates an EGL context expressly for calling
+ // eglClientWaitSyncKHR in the processing caused by |triggerWait|.
+ // This is used by the constructor only. It is non-blocking.
+ // - Triggers a |SyncThreadCmd| with op code |SYNC_THREAD_EGL_INIT|
+ void initSyncEGLContext();
+
+ void doSyncWait(gl::EmulatedEglFenceSync* fenceSync, std::function<void()> onComplete);
+#endif
+
+ // This increments the timeline after the QSRI completes.
+ void triggerWaitVkQsri(VkImage vkImage, uint64_t timeline);
+
+ void triggerWaitVkWithCompletionCallback(VkFence fenceHandle, FenceCompletionCallback);
+ void triggerWaitVkQsriWithCompletionCallback(VkImage image, FenceCompletionCallback);
+ void triggerGeneral(FenceCompletionCallback, std::string description);
+
+ // |cleanup|: for use with destructors and other cleanup functions.
+ // it destroys the sync context and exits the sync thread.
+ // This is blocking; after this function returns, we're sure
+ // the sync thread is gone.
+ // - Triggers a |SyncThreadCmd| with op code |SYNC_THREAD_EXIT|
+ void cleanup();
+
+ // Initialize the global sync thread.
+ static void initialize(bool hasGl, HealthMonitor<>* healthMonitor);
+
+ // Obtains the global sync thread.
+ static SyncThread* get();
+
+ // Destroys and cleanup the global sync thread.
+ static void destroy();
+
+ private:
+ using WorkerId = android::base::ThreadPoolWorkerId;
+ struct Command {
+ std::packaged_task<int(WorkerId)> mTask;
+ std::string mDescription;
+ };
+ using ThreadPool = android::base::ThreadPool<Command>;
+
+ // Thread function.
+ // It keeps the workers runner until |mExiting| is set.
+ virtual intptr_t main() override final;
+
+ // These two functions are used to communicate with the sync thread from another thread:
+ // - |sendAndWaitForResult| issues |job| to the sync thread, and blocks until it receives the
+ // result of the job.
+ // - |sendAsync| issues |job| to the sync thread and does not wait for the result, returning
+ // immediately after.
+ int sendAndWaitForResult(std::function<int(WorkerId)> job, std::string description);
+ void sendAsync(std::function<void(WorkerId)> job, std::string description);
+
+ // |doSyncThreadCmd| execute the actual task. These run on the sync thread.
+ void doSyncThreadCmd(Command&& command, ThreadPool::WorkerId);
+
+ static int doSyncWaitVk(VkFence, std::function<void()> onComplete);
+
+ // EGL objects / object handles specific to
+ // a sync thread.
+ static const uint32_t kNumWorkerThreads = 4u;
+
+#if GFXSTREAM_ENABLE_HOST_GLES
+ EGLDisplay mDisplay = EGL_NO_DISPLAY;
+ EGLSurface mSurface[kNumWorkerThreads];
+ EGLContext mContext[kNumWorkerThreads];
+#endif
+
+ bool mExiting = false;
+ android::base::Lock mLock;
+ android::base::ConditionVariable mCv;
+ ThreadPool mWorkerThreadPool;
+ bool mHasGl;
+
+ HealthMonitor<>* mHealthMonitor;
+};
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/VirtioGpuTimelines.cpp b/src/gfxstream/host/VirtioGpuTimelines.cpp
new file mode 100644
index 00000000000..635aa819d24
--- /dev/null
+++ b/src/gfxstream/host/VirtioGpuTimelines.cpp
@@ -0,0 +1,121 @@
+// 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 "VirtioGpuTimelines.h"
+
+#include <cinttypes>
+#include <cstdio>
+
+#include "host-common/GfxstreamFatalError.h"
+
+using TaskId = VirtioGpuTimelines::TaskId;
+using Ring = VirtioGpuTimelines::Ring;
+using FenceId = VirtioGpuTimelines::FenceId;
+using AutoLock = android::base::AutoLock;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+std::unique_ptr<VirtioGpuTimelines> VirtioGpuTimelines::create(bool withAsyncCallback) {
+ return std::unique_ptr<VirtioGpuTimelines>(new VirtioGpuTimelines(withAsyncCallback));
+}
+
+VirtioGpuTimelines::VirtioGpuTimelines(bool withAsyncCallback)
+ : mNextId(0), mWithAsyncCallback(withAsyncCallback) {}
+
+TaskId VirtioGpuTimelines::enqueueTask(const Ring& ring) {
+ AutoLock lock(mLock);
+
+ TaskId id = mNextId++;
+ std::shared_ptr<Task> task(new Task(id, ring), [this](Task* task) {
+ mTaskIdToTask.erase(task->mId);
+ delete task;
+ });
+ mTaskIdToTask[id] = task;
+ mTimelineQueues[ring].emplace_back(std::move(task));
+ return id;
+}
+
+void VirtioGpuTimelines::enqueueFence(const Ring& ring, FenceId fenceId,
+ FenceCompletionCallback fenceCompletionCallback) {
+ AutoLock lock(mLock);
+
+ auto fence = std::make_unique<Fence>(fenceId, std::move(fenceCompletionCallback));
+ mTimelineQueues[ring].emplace_back(std::move(fence));
+ if (mWithAsyncCallback) {
+ poll_locked(ring);
+ }
+}
+
+void VirtioGpuTimelines::notifyTaskCompletion(TaskId taskId) {
+ AutoLock lock(mLock);
+ auto iTask = mTaskIdToTask.find(taskId);
+ if (iTask == mTaskIdToTask.end()) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Task(id = " << static_cast<uint64_t>(taskId) << ") can't be found";
+ }
+ std::shared_ptr<Task> task = iTask->second.lock();
+ if (task == nullptr) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Task(id = " << static_cast<uint64_t>(taskId) << ") has been destroyed";
+ }
+ if (task->mId != taskId) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Task id mismatch. Expected " << static_cast<uint64_t>(taskId) << " Actual "
+ << static_cast<uint64_t>(task->mId);
+ }
+ if (task->mHasCompleted) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Task(id = " << static_cast<uint64_t>(taskId) << ") has been set to completed.";
+ }
+ task->mHasCompleted = true;
+ if (mWithAsyncCallback) {
+ poll_locked(task->mRing);
+ }
+}
+
+void VirtioGpuTimelines::poll() {
+ if (mWithAsyncCallback) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Can't call poll with async callback enabled.";
+ }
+ AutoLock lock(mLock);
+ for (const auto& [ring, timeline] : mTimelineQueues) {
+ poll_locked(ring);
+ }
+}
+void VirtioGpuTimelines::poll_locked(const Ring& ring) {
+ auto iTimelineQueue = mTimelineQueues.find(ring);
+ if (iTimelineQueue == mTimelineQueues.end()) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Ring(" << to_string(ring) << ") doesn't exist.";
+ }
+ std::list<TimelineItem> &timelineQueue = iTimelineQueue->second;
+ auto i = timelineQueue.begin();
+ for (; i != timelineQueue.end(); i++) {
+ // This visitor will signal the fence and return whether the timeline
+ // item is an incompleted task.
+ struct {
+ bool operator()(std::unique_ptr<Fence> &fence) {
+ fence->mCompletionCallback();
+ return false;
+ }
+ bool operator()(std::shared_ptr<Task> &task) {
+ return !task->mHasCompleted;
+ }
+ } visitor;
+ if (std::visit(visitor, *i)) {
+ break;
+ }
+ }
+ timelineQueue.erase(timelineQueue.begin(), i);
+}
diff --git a/src/gfxstream/host/VirtioGpuTimelines.h b/src/gfxstream/host/VirtioGpuTimelines.h
new file mode 100644
index 00000000000..e703610a0af
--- /dev/null
+++ b/src/gfxstream/host/VirtioGpuTimelines.h
@@ -0,0 +1,119 @@
+// 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.
+#ifndef VIRTIO_GPU_TIMELINES_H
+#define VIRTIO_GPU_TIMELINES_H
+
+#include <atomic>
+#include <functional>
+#include <list>
+#include <memory>
+#include <sstream>
+#include <string>
+#include <unordered_map>
+#include <variant>
+
+#include "aemu/base/synchronization/Lock.h"
+#include "gfxstream/virtio-gpu-gfxstream-renderer.h"
+#include "render-utils/virtio_gpu_ops.h"
+
+typedef uint32_t VirtioGpuCtxId;
+typedef uint8_t VirtioGpuRingIdx;
+
+struct VirtioGpuRingGlobal {};
+struct VirtioGpuRingContextSpecific {
+ VirtioGpuCtxId mCtxId;
+ VirtioGpuRingIdx mRingIdx;
+};
+using VirtioGpuRing = std::variant<VirtioGpuRingGlobal, VirtioGpuRingContextSpecific>;
+
+template <>
+struct std::hash<VirtioGpuRingGlobal> {
+ std::size_t operator()(VirtioGpuRingGlobal const&) const noexcept { return 0; }
+};
+
+inline bool operator==(const VirtioGpuRingGlobal&, const VirtioGpuRingGlobal&) { return true; }
+
+template <>
+struct std::hash<VirtioGpuRingContextSpecific> {
+ std::size_t operator()(VirtioGpuRingContextSpecific const& ringContextSpecific) const noexcept {
+ std::size_t ctxHash = std::hash<VirtioGpuCtxId>{}(ringContextSpecific.mCtxId);
+ std::size_t ringHash = std::hash<VirtioGpuRingIdx>{}(ringContextSpecific.mRingIdx);
+ // Use the hash_combine from
+ // https://www.boost.org/doc/libs/1_78_0/boost/container_hash/hash.hpp.
+ std::size_t res = ctxHash;
+ res ^= ringHash + 0x9e3779b9 + (res << 6) + (res >> 2);
+ return res;
+ }
+};
+
+inline bool operator==(const VirtioGpuRingContextSpecific& lhs,
+ const VirtioGpuRingContextSpecific& rhs) {
+ return lhs.mCtxId == rhs.mCtxId && lhs.mRingIdx == rhs.mRingIdx;
+}
+
+inline std::string to_string(const VirtioGpuRing& ring) {
+ struct {
+ std::string operator()(const VirtioGpuRingGlobal&) { return "global"; }
+ std::string operator()(const VirtioGpuRingContextSpecific& ring) {
+ std::stringstream ss;
+ ss << "context specific {ctx = " << ring.mCtxId << ", ring = " << (int)ring.mRingIdx
+ << "}";
+ return ss.str();
+ }
+ } visitor;
+ return std::visit(visitor, ring);
+}
+
+class VirtioGpuTimelines {
+ public:
+ using FenceId = uint64_t;
+ using Ring = VirtioGpuRing;
+ using TaskId = uint64_t;
+
+ TaskId enqueueTask(const Ring&);
+ void enqueueFence(const Ring&, FenceId, FenceCompletionCallback);
+ void notifyTaskCompletion(TaskId);
+ void poll();
+ static std::unique_ptr<VirtioGpuTimelines> create(bool withAsyncCallback);
+
+ private:
+ VirtioGpuTimelines(bool withAsyncCallback);
+ struct Fence {
+ FenceId mId;
+ FenceCompletionCallback mCompletionCallback;
+ Fence(FenceId id, FenceCompletionCallback completionCallback)
+ : mId(id), mCompletionCallback(std::move(completionCallback)) {}
+ };
+ struct Task {
+ TaskId mId;
+ Ring mRing;
+ std::atomic_bool mHasCompleted;
+ Task(TaskId id, const Ring& ring) : mId(id), mRing(ring), mHasCompleted(false) {}
+ };
+ using TimelineItem =
+ std::variant<std::unique_ptr<Fence>, std::shared_ptr<Task>>;
+ android::base::Lock mLock;
+ std::atomic<TaskId> mNextId;
+ // The mTaskIdToTask cache must be destroyed after the actual owner of Task,
+ // mTimelineQueues, is destroyed, because the deleter of Task will
+ // automatically remove the entry in mTaskIdToTask.
+ std::unordered_map<TaskId, std::weak_ptr<Task>> mTaskIdToTask;
+ std::unordered_map<Ring, std::list<TimelineItem>> mTimelineQueues;
+ const bool mWithAsyncCallback;
+ // Go over the timeline, signal any fences without pending tasks, and remove
+ // timeline items that are no longer needed.
+ void poll_locked(const Ring&);
+};
+
+#endif // VIRTIO_GPU_TIMELINES_H
diff --git a/src/gfxstream/host/VsyncThread.cpp b/src/gfxstream/host/VsyncThread.cpp
new file mode 100644
index 00000000000..414ef46c6a9
--- /dev/null
+++ b/src/gfxstream/host/VsyncThread.cpp
@@ -0,0 +1,82 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "VsyncThread.h"
+
+#include "aemu/base/system/System.h"
+
+namespace gfxstream {
+
+VsyncThread::VsyncThread(uint64_t vsyncPeriodNs) :
+ mPeriodNs(vsyncPeriodNs),
+ mThread([this] { threadFunc(); }) {
+ mThread.start();
+}
+
+VsyncThread::~VsyncThread() {
+ exit();
+}
+
+void VsyncThread::schedule(VsyncTask task) {
+ mChannel.send({ CommandType::Default, task });
+}
+
+void VsyncThread::setPeriod(uint64_t newPeriod) {
+ mChannel.send({ CommandType::ChangePeriod, {}, newPeriod });
+}
+
+void VsyncThread::exit() {
+ mChannel.send({ CommandType::Exit });
+ mThread.wait();
+}
+
+void VsyncThread::threadFunc() {
+ VsyncThreadCommand currentCommand;
+ uint64_t lastTimeUs = ~0ULL;
+ uint64_t phasedWaitTimeUs;
+ uint64_t currentUs;
+
+ while (true) {
+ uint64_t periodUs = mPeriodNs / 1000ULL;
+ currentUs = android::base::getHighResTimeUs();
+
+ if (lastTimeUs == ~0ULL) {
+ phasedWaitTimeUs = currentUs + periodUs;
+ } else {
+ phasedWaitTimeUs =
+ periodUs * ((currentUs - lastTimeUs) / periodUs + 1) +
+ lastTimeUs;
+ }
+
+ android::base::sleepToUs(phasedWaitTimeUs);
+
+ lastTimeUs = phasedWaitTimeUs;
+
+ while (mChannel.tryReceive(&currentCommand)) {
+ switch (currentCommand.type) {
+ case CommandType::Exit:
+ return;
+ case CommandType::ChangePeriod:
+ mPeriodNs = currentCommand.newPeriod;
+ break;
+ case CommandType::Default:
+ default:
+ currentCommand.task(mCount);
+ }
+ }
+
+ ++mCount;
+ }
+}
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/VsyncThread.h b/src/gfxstream/host/VsyncThread.h
new file mode 100644
index 00000000000..5cbfb57ec12
--- /dev/null
+++ b/src/gfxstream/host/VsyncThread.h
@@ -0,0 +1,79 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include "aemu/base/threads/FunctorThread.h"
+#include "aemu/base/synchronization/MessageChannel.h"
+
+#include <inttypes.h>
+#include <functional>
+
+namespace gfxstream {
+
+// A thread that regularly processes tasks that need to happen at some vsync
+// interval (initialized from FrameBuffer).
+//
+// Some examples of such tasks include
+//
+// 1. Signaling guest-side hwc present syncfd's at a regular interval so SF can
+// properly schedule presents
+// 2.
+class VsyncThread {
+public:
+ using Count = uint64_t;
+ using VsyncTask = std::function<void(Count)>;
+ VsyncThread(uint64_t vsyncPeriod);
+ ~VsyncThread();
+
+ // Runs specificed |task| at the next vsync time as specified by the vsync
+ // period. Passes the number of vsyncs so far (Count).
+ void schedule(VsyncTask task);
+
+ uint64_t getCount() const {
+ return mCount;
+ }
+
+ uint64_t getPeriod() const {
+ return mPeriodNs;
+ }
+
+ // Sets the period dynamically. This is implemented as another scheduled task, so as to not
+ // interfere with assumptions of previously scheduled tasks.
+ void setPeriod(uint64_t newPeriod);
+
+private:
+
+ enum class CommandType {
+ Default = 0,
+ Exit = 1,
+ ChangePeriod = 2,
+ };
+
+ struct VsyncThreadCommand {
+ CommandType type;
+ VsyncTask task;
+ uint64_t newPeriod;
+ };
+
+ void exit();
+ void threadFunc();
+
+ uint64_t mPeriodNs = 0;
+ uint64_t mCount = 0;
+ bool mExiting = false;
+ android::base::MessageChannel<VsyncThreadCommand, 128> mChannel;
+ android::base::FunctorThread mThread;
+};
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/apigen-codec-common/ChecksumCalculator.cpp b/src/gfxstream/host/apigen-codec-common/ChecksumCalculator.cpp
new file mode 100644
index 00000000000..86cf52b494e
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/ChecksumCalculator.cpp
@@ -0,0 +1,172 @@
+/*
+* 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 "ChecksumCalculator.h"
+
+#include "aemu/base/files/Stream.h"
+
+#include <string>
+#include <vector>
+
+#include <assert.h>
+#include <string.h>
+
+// Checklist when implementing new protocol:
+// 1. update CHECKSUMHELPER_MAX_VERSION
+// 2. update checksumByteSize()
+// 3. update addBuffer, writeChecksum, resetChecksum, validate
+
+// change CHECKSUMHELPER_MAX_VERSION when you want to update the protocol version
+#define CHECKSUMHELPER_MAX_VERSION 1
+
+// utility macros to create checksum string at compilation time
+#define CHECKSUMHELPER_VERSION_STR_PREFIX "ANDROID_EMU_CHECKSUM_HELPER_v"
+#define CHECKSUMHELPER_MACRO_TO_STR(x) #x
+#define CHECKSUMHELPER_MACRO_VAL_TO_STR(x) CHECKSUMHELPER_MACRO_TO_STR(x)
+
+static const uint32_t kMaxVersion = CHECKSUMHELPER_MAX_VERSION;
+static const char* kMaxVersionStrPrefix = CHECKSUMHELPER_VERSION_STR_PREFIX;
+static const char* kMaxVersionStr = CHECKSUMHELPER_VERSION_STR_PREFIX CHECKSUMHELPER_MACRO_VAL_TO_STR(CHECKSUMHELPER_MAX_VERSION);
+
+#undef CHECKSUMHELPER_MAX_VERSION
+#undef CHECKSUMHELPER_VERSION_STR_PREFIX
+#undef CHECKSUMHELPER_MACRO_TO_STR
+#undef CHECKSUMHELPER_MACRO_VAL_TO_STR
+
+uint32_t ChecksumCalculator::getMaxVersion() {return kMaxVersion;}
+const char* ChecksumCalculator::getMaxVersionStr() {return kMaxVersionStr;}
+const char* ChecksumCalculator::getMaxVersionStrPrefix() {return kMaxVersionStrPrefix;}
+
+bool ChecksumCalculator::setVersion(uint32_t version) {
+ if (version > kMaxVersion) { // unsupported version
+ LOG_CHECKSUMHELPER("%s: ChecksumCalculator Set Unsupported version Version %d\n",
+ __FUNCTION__, m_version);
+ return false;
+ }
+ if (m_isEncodingChecksum) { // setVersion is called in the middle of encoding checksums
+ LOG_CHECKSUMHELPER("%s: called between addBuffer and writeChecksum\n",
+ __FUNCTION__);
+ return false;
+ }
+ m_version = version;
+ m_checksumSize = checksumByteSize(version);
+ LOG_CHECKSUMHELPER("%s: ChecksumCalculator Set Version %d\n", __FUNCTION__,
+ m_version);
+ return true;
+}
+
+void ChecksumCalculator::addBuffer(const void* buf, size_t packetLen) {
+ m_isEncodingChecksum = true;
+ switch (m_version) {
+ case 1:
+ m_v1BufferTotalLength += packetLen;
+ break;
+ }
+}
+
+bool ChecksumCalculator::writeChecksum(void* outputChecksum, size_t outputChecksumLen) {
+ if (outputChecksumLen < checksumByteSize()) return false;
+ char *checksumPtr = (char *)outputChecksum;
+ switch (m_version) {
+ case 1: { // protocol v1 is to reverse the packetLen and write it at the end
+ uint32_t val = computeV1Checksum();
+ memcpy(checksumPtr, &val, sizeof(val));
+ memcpy(checksumPtr+sizeof(val), &m_numWrite, sizeof(m_numWrite));
+ break;
+ }
+ }
+ resetChecksum();
+ m_numWrite++;
+ return true;
+}
+
+void ChecksumCalculator::resetChecksum() {
+ switch (m_version) {
+ case 1:
+ m_v1BufferTotalLength = 0;
+ break;
+ }
+ m_isEncodingChecksum = false;
+}
+
+bool ChecksumCalculator::validate(const void* expectedChecksum,
+ size_t expectedChecksumLen) {
+ const size_t checksumSize = checksumByteSize();
+ if (expectedChecksumLen != checksumSize) {
+ m_numRead++;
+ resetChecksum();
+ return false;
+ }
+ bool isValid;
+ switch (m_version) {
+ case 1: {
+ const uint32_t val = computeV1Checksum();
+ assert(checksumSize == sizeof(val) + sizeof(m_numRead));
+ isValid = 0 == memcmp(&val, expectedChecksum, sizeof(val)) &&
+ 0 == memcmp(&m_numRead,
+ static_cast<const char*>(expectedChecksum) +
+ sizeof(val),
+ sizeof(m_numRead));
+ break;
+ }
+ default:
+ isValid = true; // No checksum is a valid checksum.
+ break;
+ }
+ m_numRead++;
+ resetChecksum();
+ return isValid;
+}
+
+uint32_t ChecksumCalculator::computeV1Checksum() const {
+ uint32_t revLen = m_v1BufferTotalLength;
+ revLen = (revLen & 0xffff0000) >> 16 | (revLen & 0x0000ffff) << 16;
+ revLen = (revLen & 0xff00ff00) >> 8 | (revLen & 0x00ff00ff) << 8;
+ revLen = (revLen & 0xf0f0f0f0) >> 4 | (revLen & 0x0f0f0f0f) << 4;
+ revLen = (revLen & 0xcccccccc) >> 2 | (revLen & 0x33333333) << 2;
+ revLen = (revLen & 0xaaaaaaaa) >> 1 | (revLen & 0x55555555) << 1;
+ return revLen;
+}
+
+void ChecksumCalculator::save(android::base::Stream* stream) {
+ assert(!m_isEncodingChecksum);
+ switch (m_version) {
+ case 1:
+ assert(m_v1BufferTotalLength == 0);
+ break;
+ }
+
+ // Our checksum should never become > 255 bytes. Ever.
+ assert((uint8_t)m_checksumSize == m_checksumSize);
+ stream->putByte(m_checksumSize);
+ stream->putBe32(m_version);
+ stream->putBe32(m_numRead);
+ stream->putBe32(m_numWrite);
+}
+
+void ChecksumCalculator::load(android::base::Stream* stream) {
+ assert(!m_isEncodingChecksum);
+ switch (m_version) {
+ case 1:
+ assert(m_v1BufferTotalLength == 0);
+ break;
+ }
+
+ m_checksumSize = stream->getByte();
+ m_version = stream->getBe32();
+ m_numRead = stream->getBe32();
+ m_numWrite = stream->getBe32();
+}
diff --git a/src/gfxstream/host/apigen-codec-common/ChecksumCalculator.h b/src/gfxstream/host/apigen-codec-common/ChecksumCalculator.h
new file mode 100644
index 00000000000..df94403e2dc
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/ChecksumCalculator.h
@@ -0,0 +1,200 @@
+/*
+* 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 <stdint.h>
+#include <stdlib.h>
+
+// Set TRACE_CHECKSUMHELPER to 1 to debug creation/destruction of GLprotocol
+// instances.
+#define TRACE_CHECKSUMHELPER 0
+
+#if TRACE_CHECKSUMHELPER
+#define LOG_CHECKSUMHELPER(x...) fprintf(stderr, x)
+#else
+#define LOG_CHECKSUMHELPER(x...)
+#endif
+
+namespace android { namespace base { class Stream; } }
+
+// ChecksumCalculator adds checksum as an array of bytes to GL pipe communication, which
+// size depends on the protocol version. Each pipe should use one ChecksumCalculator.
+// It can:
+// (1) take a list of buffers one by one and compute their checksum string,
+// in this case the checksum should be as the data in those buffers are
+// concatenated;
+// (2) compute the checksum of the buffer list, then either write them into
+// a buffer provided by user, or compare it against a checksum provided
+// by user
+// (3) support different checksum version in future.
+//
+// For backward compatibility, checksum version 0 behaves the same as there is
+// no checksum (i.e., checksumByteSize returns 0, validate always returns true,
+// addBuffer and writeCheckSum does nothing).
+//
+// Notice that to detect package lost, ChecksumCalculator also keeps track of how
+// many times it generates/validates checksums, and might use it as part of the
+// checksum.
+//
+// To evaluate checksums from a list of data buffers buf1, buf2... Please call
+// addBuffer(buf1, buf1len), addBuffer(buf2, buf2len) ... in order.
+// Then if the checksum needs to be encoded into a buffer, one needs to allocate
+// a checksum buffer with size checksumByteSize(), and call
+// writeChecksum(checksumBuffer) to write the checksum to the buffer.
+// If the checksum needs to be validated against an existing one, one needs to
+// call validate(existChecksum, existChecksumLen).
+//
+// The checksum generator and validator must be set to the same version, and
+// the validator must check ALL checksums in the order they are generated,
+// otherwise the validation function will return false.
+//
+// It is allowed to change the checksum version between calculating two
+// checksums. This is designed for backward compatibility reason.
+//
+// Example 1, encoding and decoding:
+//
+// bool testChecksum(void* buf, size_t bufLen) {
+// // encoding message
+// ChecksumCalculator encoder;
+// encoder.setVersion(1);
+// encoder.addBuffer(buf, bufLen);
+// std::vector<unsigned char> message(bufLen + encoder.checksumByteSize());
+// memcpy(&message[0], buf, bufLen);
+// encoder.writeChecksum(&message[0] + bufLen, encoder.checksumByteSize());
+//
+// // decoding message
+// ChecksumCalculator decoder;
+// decoder.setVersion(1);
+// decoder.addBuffer(&message[0], bufLen);
+// return decoder.validate(&message[0] + bufLen, decoder.checksumByteSize());
+// }
+// The return value is true.
+//
+// Example 2, decoding will fail if the order of messages is wrong:
+//
+// bool testChecksumOrder(void* buf1, size_t bufLen1,
+// void* buf2, size_t bufLen2) {
+// // encoding messages
+// ChecksumCalculator encoder;
+// encoder.setVersion(1);
+//
+// std::vector<unsigned char> message1(bufLen1 + encoder.checksumByteSize());
+// std::vector<unsigned char> message2(bufLen2 + encoder.checksumByteSize());
+//
+// encoder.addBuffer(buf1, bufLen1);
+// std::vector<unsigned char> message1(bufLen1 + encoder.checksumByteSize());
+// memcpy(&message1[0], buf1, bufLen1);
+// encoder.writeChecksum(&message1[0] + bufLen1, encoder.checksumByteSize());
+//
+// encoder.addBuffer(buf2, bufLen2);
+// std::vector<unsigned char> message2(bufLen2 + encoder.checksumByteSize());
+// memcpy(&message2[0], buf2, bufLen2);
+// encoder.writeChecksum(&message2[0] + bufLen2, encoder.checksumByteSize());
+//
+// // decoding messages
+// ChecksumCalculator decoder;
+// decoder.setVersion(1);
+// decoder.addBuffer(&message2[0], bufLen2);
+// // returns false because the decoding order is not consistent with
+// // encoding order
+// if (!decoder.validate(&message2[0]+bufLen2, decoder.checksumByteSize())) {
+// return false;
+// }
+//
+// decoder.addBuffer(&message1[0], bufLen1);
+// if (!decoder.validate(&message1[0]+bufLen1, decoder.checksumByteSize())) {
+// return false;
+// }
+//
+// return false;
+// }
+
+class ChecksumCalculator {
+public:
+ static constexpr size_t kMaxChecksumLength = 8;
+
+ // Get and set current checksum version
+ uint32_t getVersion() const { return m_version; }
+ // Call setVersion to set a checksum version. It should be called before
+ // addBuffer(), writeChecksum() and validate(). And it should be called
+ // exact once per rendering thread if both host and guest support checksum.
+ // It won't be called if either host or guest does not support checksum.
+ bool setVersion(uint32_t version);
+
+ // Maximum supported checksum version
+ static uint32_t getMaxVersion();
+ // A version string that looks like "ANDROID_EMU_CHECKSUM_HELPER_v1"
+ // Used multiple times when the guest queries the maximum supported version
+ // from the host.
+ // The library owns the returned pointer. The returned pointer will be
+ // deconstructed when unloading library.
+ static const char* getMaxVersionStr();
+ static const char* getMaxVersionStrPrefix();
+
+ // Size of checksum in the current version
+ size_t checksumByteSize() const { return m_checksumSize; }
+
+ // Update the current checksum value from the data
+ // at |buf| of |bufLen| bytes. Once all buffers
+ // have been added, call writeChecksum() to store
+ // the final checksum value and reset its state.
+ void addBuffer(const void* buf, size_t bufLen);
+ // Write the checksum from the list of buffers to outputChecksum
+ // Will reset the list of buffers by calling resetChecksum.
+ // Return false if the buffer is not long enough
+ // Please query buffer size from checksumByteSize()
+ bool writeChecksum(void* outputChecksum, size_t outputChecksumLen);
+ // Restore the states for computing checksums.
+ // Automatically called at the end of writeChecksum and validate.
+ // Can also be used to abandon the current checksum being calculated.
+ // Notes: it doesn't update the internal read / write counter
+ void resetChecksum();
+
+ // Calculate the checksum from the list of buffers and
+ // compare it with the checksum encoded in expectedChecksum
+ // Will reset the list of buffers by calling resetChecksum.
+ bool validate(const void* expectedChecksum, size_t expectedChecksumLen);
+
+ // Snapshot support.
+ void save(android::base::Stream* stream);
+ void load(android::base::Stream* stream);
+
+private:
+ static constexpr size_t kVersion1ChecksumSize = 8; // 2 x uint32_t
+
+ static_assert(kVersion1ChecksumSize <= kMaxChecksumLength,
+ "Invalid ChecksumCalculator::kMaxChecksumLength value");
+
+ static constexpr size_t checksumByteSize(uint32_t version) {
+ return version == 1 ? kVersion1ChecksumSize : 0;
+ }
+
+ uint32_t m_version = 0;
+ uint32_t m_checksumSize = checksumByteSize(0);
+ // A temporary state used to compute the total length of a list of buffers,
+ // if addBuffer is called.
+ uint32_t m_numRead = 0;
+ uint32_t m_numWrite = 0;
+ // m_isEncodingChecksum is true when between addBuffer and writeChecksum
+ bool m_isEncodingChecksum = false;
+
+ // Compute a 32bit checksum
+ // Used in protocol v1
+ uint32_t computeV1Checksum() const;
+ // The buffer used in protocol version 1 to compute checksum.
+ uint32_t m_v1BufferTotalLength = 0;
+};
diff --git a/src/gfxstream/host/apigen-codec-common/ChecksumCalculatorThreadInfo.cpp b/src/gfxstream/host/apigen-codec-common/ChecksumCalculatorThreadInfo.cpp
new file mode 100644
index 00000000000..338571ef90d
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/ChecksumCalculatorThreadInfo.cpp
@@ -0,0 +1,84 @@
+/*
+* 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 "ChecksumCalculatorThreadInfo.h"
+
+#include "host-common/crash_reporter.h"
+
+#include <atomic>
+#include <string>
+
+#include <assert.h>
+#include <stdio.h>
+
+namespace {
+
+#if TRACE_CHECKSUMHELPER
+std::atomic<size_t> sNumInstances(0);
+#endif // TRACE_CHECKSUMHELPER
+}
+
+static ChecksumCalculatorThreadInfo* getChecksumCalculatorThreadInfo() {
+ static thread_local ChecksumCalculatorThreadInfo* tls = new ChecksumCalculatorThreadInfo;
+ return tls;
+}
+
+ChecksumCalculatorThreadInfo::ChecksumCalculatorThreadInfo() {
+ LOG_CHECKSUMHELPER("%s: Checksum thread created (%u instances)\n",
+ __FUNCTION__, (unsigned int)(++sNumInstances));
+}
+
+ChecksumCalculatorThreadInfo::~ChecksumCalculatorThreadInfo() {
+ LOG_CHECKSUMHELPER("%s: GLprotocol destroyed (%u instances)\n",
+ __FUNCTION__, (unsigned int)(--sNumInstances));
+}
+
+ChecksumCalculator& ChecksumCalculatorThreadInfo::get() {
+ return getChecksumCalculatorThreadInfo()->m_protocol;
+}
+
+bool ChecksumCalculatorThreadInfo::setVersion(uint32_t version) {
+ return getChecksumCalculatorThreadInfo()->m_protocol.setVersion(version);
+}
+
+bool ChecksumCalculatorThreadInfo::writeChecksum(ChecksumCalculator* calc,
+ void* buf,
+ size_t bufLen,
+ void* outputChecksum,
+ size_t outputChecksumLen) {
+ calc->addBuffer(buf, bufLen);
+ return calc->writeChecksum(outputChecksum, outputChecksumLen);
+}
+
+bool ChecksumCalculatorThreadInfo::validate(ChecksumCalculator* calc,
+ void* buf,
+ size_t bufLen,
+ void* checksum,
+ size_t checksumLen) {
+ calc->addBuffer(buf, bufLen);
+ return calc->validate(checksum, checksumLen);
+}
+
+void ChecksumCalculatorThreadInfo::validOrDie(ChecksumCalculator* calc,
+ void* buf,
+ size_t bufLen,
+ void* checksum,
+ size_t checksumLen,
+ const char* message) {
+ if (!validate(calc, buf, bufLen, checksum, checksumLen)) {
+ emugl::emugl_crash_reporter(message);
+ }
+}
diff --git a/src/gfxstream/host/apigen-codec-common/ChecksumCalculatorThreadInfo.h b/src/gfxstream/host/apigen-codec-common/ChecksumCalculatorThreadInfo.h
new file mode 100644
index 00000000000..e22d3badef1
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/ChecksumCalculatorThreadInfo.h
@@ -0,0 +1,60 @@
+/*
+* 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 "ChecksumCalculator.h"
+
+// ChecksumCalculatorThreadInfo is the class that makes ChecksumCalculator
+// thread-safe. On the host, please only use ChecksumCalculator through this
+// class.
+
+class ChecksumCalculatorThreadInfo {
+public:
+ ChecksumCalculatorThreadInfo();
+ ~ChecksumCalculatorThreadInfo();
+
+ ChecksumCalculator& get();
+
+ static bool setVersion(uint32_t version);
+
+ static uint32_t getMaxVersion();
+ static const char* getMaxVersionString() {
+ return ChecksumCalculator::getMaxVersionStr();
+ }
+
+ static bool writeChecksum(ChecksumCalculator* calc,
+ void* buf,
+ size_t bufLen,
+ void* outputChecksum,
+ size_t outputChecksumLen);
+
+ static bool validate(ChecksumCalculator* calc,
+ void* buf,
+ size_t bufLen,
+ void* checksum,
+ size_t checksumLen);
+
+ static void validOrDie(ChecksumCalculator* calc,
+ void* buf,
+ size_t bufLen,
+ void* checksum,
+ size_t checksumLen,
+ const char* message);
+
+private:
+ ChecksumCalculator m_protocol;
+};
diff --git a/src/gfxstream/host/apigen-codec-common/GL/dri_interface.h b/src/gfxstream/host/apigen-codec-common/GL/dri_interface.h
new file mode 100644
index 00000000000..c236cb732fd
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/GL/dri_interface.h
@@ -0,0 +1,1144 @@
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2007-2008 Red Hat, Inc.
+ * (C) Copyright IBM Corporation 2004
+ * 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
+ * on 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
+ * THE COPYRIGHT HOLDERS AND/OR THEIR 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.
+ */
+
+/**
+ * \file dri_interface.h
+ *
+ * This file contains all the types and functions that define the interface
+ * between a DRI driver and driver loader. Currently, the most common driver
+ * loader is the XFree86 libGL.so. However, other loaders do exist, and in
+ * the future the server-side libglx.a will also be a loader.
+ *
+ * \author Kevin E. Martin <kevin@precisioninsight.com>
+ * \author Ian Romanick <idr@us.ibm.com>
+ * \author Kristian Høgsberg <krh@redhat.com>
+ */
+
+#ifndef DRI_INTERFACE_H
+#define DRI_INTERFACE_H
+
+/* For archs with no drm.h */
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
+#ifndef __NOT_HAVE_DRM_H
+#define __NOT_HAVE_DRM_H
+#endif
+#endif
+
+#ifndef __NOT_HAVE_DRM_H
+#include <drm.h>
+#else
+typedef unsigned int drm_context_t;
+typedef unsigned int drm_drawable_t;
+typedef struct drm_clip_rect drm_clip_rect_t;
+#endif
+
+/**
+ * \name DRI interface structures
+ *
+ * The following structures define the interface between the GLX client
+ * side library and the DRI (direct rendering infrastructure).
+ */
+/*@{*/
+typedef struct __DRIdisplayRec __DRIdisplay;
+typedef struct __DRIscreenRec __DRIscreen;
+typedef struct __DRIcontextRec __DRIcontext;
+typedef struct __DRIdrawableRec __DRIdrawable;
+typedef struct __DRIconfigRec __DRIconfig;
+typedef struct __DRIframebufferRec __DRIframebuffer;
+typedef struct __DRIversionRec __DRIversion;
+
+typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
+typedef struct __DRIextensionRec __DRIextension;
+typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
+typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
+typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
+typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
+typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
+typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;
+typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;
+typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
+typedef struct __DRIbufferRec __DRIbuffer;
+typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
+typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
+typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
+typedef struct __DRI2throttleExtensionRec __DRI2throttleExtension;
+
+/*@}*/
+
+
+/**
+ * Extension struct. Drivers 'inherit' from this struct by embedding
+ * it as the first element in the extension struct.
+ *
+ * We never break API in for a DRI extension. If we need to change
+ * the way things work in a non-backwards compatible manner, we
+ * introduce a new extension. During a transition period, we can
+ * leave both the old and the new extension in the driver, which
+ * allows us to move to the new interface without having to update the
+ * loader(s) in lock step.
+ *
+ * However, we can add entry points to an extension over time as long
+ * as we don't break the old ones. As we add entry points to an
+ * extension, we increase the version number. The corresponding
+ * #define can be used to guard code that accesses the new entry
+ * points at compile time and the version field in the extension
+ * struct can be used at run-time to determine how to use the
+ * extension.
+ */
+struct __DRIextensionRec {
+ const char *name;
+ int version;
+};
+
+/**
+ * The first set of extension are the screen extensions, returned by
+ * __DRIcore::getExtensions(). This entry point will return a list of
+ * extensions and the loader can use the ones it knows about by
+ * casting them to more specific extensions and advertising any GLX
+ * extensions the DRI extensions enables.
+ */
+
+/**
+ * Used by drivers to indicate support for setting the read drawable.
+ */
+#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
+#define __DRI_READ_DRAWABLE_VERSION 1
+
+/**
+ * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
+ */
+#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
+#define __DRI_COPY_SUB_BUFFER_VERSION 1
+struct __DRIcopySubBufferExtensionRec {
+ __DRIextension base;
+ void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
+};
+
+/**
+ * Used by drivers that implement the GLX_SGI_swap_control or
+ * GLX_MESA_swap_control extension.
+ */
+#define __DRI_SWAP_CONTROL "DRI_SwapControl"
+#define __DRI_SWAP_CONTROL_VERSION 1
+struct __DRIswapControlExtensionRec {
+ __DRIextension base;
+ void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
+ unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
+};
+
+/**
+ * Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
+ */
+#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
+#define __DRI_FRAME_TRACKING_VERSION 1
+struct __DRIframeTrackingExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Enable or disable frame usage tracking.
+ *
+ * \since Internal API version 20030317.
+ */
+ int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
+
+ /**
+ * Retrieve frame usage information.
+ *
+ * \since Internal API version 20030317.
+ */
+ int (*queryFrameTracking)(__DRIdrawable *drawable,
+ int64_t * sbc, int64_t * missedFrames,
+ float * lastMissedUsage, float * usage);
+};
+
+
+/**
+ * Used by drivers that implement the GLX_SGI_video_sync extension.
+ */
+#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
+#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
+struct __DRImediaStreamCounterExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Wait for the MSC to equal target_msc, or, if that has already passed,
+ * the next time (MSC % divisor) is equal to remainder. If divisor is
+ * zero, the function will return as soon as MSC is greater than or equal
+ * to target_msc.
+ */
+ int (*waitForMSC)(__DRIdrawable *drawable,
+ int64_t target_msc, int64_t divisor, int64_t remainder,
+ int64_t * msc, int64_t * sbc);
+
+ /**
+ * Get the number of vertical refreshes since some point in time before
+ * this function was first called (i.e., system start up).
+ */
+ int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable,
+ int64_t *msc);
+};
+
+
+#define __DRI_TEX_OFFSET "DRI_TexOffset"
+#define __DRI_TEX_OFFSET_VERSION 1
+struct __DRItexOffsetExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Method to override base texture image with a driver specific 'offset'.
+ * The depth passed in allows e.g. to ignore the alpha channel of texture
+ * images where the non-alpha components don't occupy a whole texel.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth, GLuint pitch);
+};
+
+
+/* Valid values for format in the setTexBuffer2 function below. These
+ * values match the GLX tokens for compatibility reasons, but we
+ * define them here since the DRI interface can't depend on GLX. */
+#define __DRI_TEXTURE_FORMAT_NONE 0x20D8
+#define __DRI_TEXTURE_FORMAT_RGB 0x20D9
+#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
+
+#define __DRI_TEX_BUFFER "DRI_TexBuffer"
+#define __DRI_TEX_BUFFER_VERSION 2
+struct __DRItexBufferExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Method to override base texture image with the contents of a
+ * __DRIdrawable.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
+ * setTexBuffer2 in version 2 of this interface
+ */
+ void (*setTexBuffer)(__DRIcontext *pDRICtx,
+ GLint target,
+ __DRIdrawable *pDraw);
+
+ /**
+ * Method to override base texture image with the contents of a
+ * __DRIdrawable, including the required texture format attribute.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*setTexBuffer2)(__DRIcontext *pDRICtx,
+ GLint target,
+ GLint format,
+ __DRIdrawable *pDraw);
+ /**
+ * Method to release texture buffer in case some special platform
+ * need this.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
+ GLint target,
+ __DRIdrawable *pDraw);
+};
+
+/**
+ * Used by drivers that implement DRI2
+ */
+#define __DRI2_FLUSH "DRI2_Flush"
+#define __DRI2_FLUSH_VERSION 4
+
+#define __DRI2_FLUSH_DRAWABLE (1 << 0) /* the drawable should be flushed. */
+#define __DRI2_FLUSH_CONTEXT (1 << 1) /* glFlush should be called */
+
+enum __DRI2throttleReason {
+ __DRI2_THROTTLE_SWAPBUFFER,
+ __DRI2_THROTTLE_COPYSUBBUFFER,
+ __DRI2_THROTTLE_FLUSHFRONT
+};
+
+struct __DRI2flushExtensionRec {
+ __DRIextension base;
+ void (*flush)(__DRIdrawable *drawable);
+
+ /**
+ * Ask the driver to call getBuffers/getBuffersWithFormat before
+ * it starts rendering again.
+ *
+ * \param drawable the drawable to invalidate
+ *
+ * \since 3
+ */
+ void (*invalidate)(__DRIdrawable *drawable);
+
+ /**
+ * This function reduces the number of flushes in the driver by combining
+ * several operations into one call.
+ *
+ * It can:
+ * - throttle
+ * - flush a drawable
+ * - flush a context
+ *
+ * \param context the context
+ * \param drawable the drawable to flush
+ * \param flags a combination of _DRI2_FLUSH_xxx flags
+ * \param throttle_reason the reason for throttling, 0 = no throttling
+ *
+ * \since 4
+ */
+ void (*flush_with_flags)(__DRIcontext *ctx,
+ __DRIdrawable *drawable,
+ unsigned flags,
+ enum __DRI2throttleReason throttle_reason);
+};
+
+
+/**
+ * Extension that the driver uses to request
+ * throttle callbacks.
+ */
+
+#define __DRI2_THROTTLE "DRI2_Throttle"
+#define __DRI2_THROTTLE_VERSION 1
+
+struct __DRI2throttleExtensionRec {
+ __DRIextension base;
+ void (*throttle)(__DRIcontext *ctx,
+ __DRIdrawable *drawable,
+ enum __DRI2throttleReason reason);
+};
+
+/**
+ * XML document describing the configuration options supported by the
+ * driver.
+ */
+extern const char __driConfigOptions[];
+
+/*@}*/
+
+/**
+ * The following extensions describe loader features that the DRI
+ * driver can make use of. Some of these are mandatory, such as the
+ * getDrawableInfo extension for DRI and the DRI Loader extensions for
+ * DRI2, while others are optional, and if present allow the driver to
+ * expose certain features. The loader pass in a NULL terminated
+ * array of these extensions to the driver in the createNewScreen
+ * constructor.
+ */
+
+typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;
+typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;
+typedef struct __DRIdamageExtensionRec __DRIdamageExtension;
+typedef struct __DRIloaderExtensionRec __DRIloaderExtension;
+typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;
+
+
+/**
+ * Callback to getDrawableInfo protocol
+ */
+#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
+#define __DRI_GET_DRAWABLE_INFO_VERSION 1
+struct __DRIgetDrawableInfoExtensionRec {
+ __DRIextension base;
+
+ /**
+ * This function is used to get information about the position, size, and
+ * clip rects of a drawable.
+ */
+ GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable,
+ unsigned int * index, unsigned int * stamp,
+ int * x, int * y, int * width, int * height,
+ int * numClipRects, drm_clip_rect_t ** pClipRects,
+ int * backX, int * backY,
+ int * numBackClipRects, drm_clip_rect_t ** pBackClipRects,
+ void *loaderPrivate);
+};
+
+/**
+ * Callback to get system time for media stream counter extensions.
+ */
+#define __DRI_SYSTEM_TIME "DRI_SystemTime"
+#define __DRI_SYSTEM_TIME_VERSION 1
+struct __DRIsystemTimeExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Get the 64-bit unadjusted system time (UST).
+ */
+ int (*getUST)(int64_t * ust);
+
+ /**
+ * Get the media stream counter (MSC) rate.
+ *
+ * Matching the definition in GLX_OML_sync_control, this function returns
+ * the rate of the "media stream counter". In practical terms, this is
+ * the frame refresh rate of the display.
+ */
+ GLboolean (*getMSCRate)(__DRIdrawable *draw,
+ int32_t * numerator, int32_t * denominator,
+ void *loaderPrivate);
+};
+
+/**
+ * Damage reporting
+ */
+#define __DRI_DAMAGE "DRI_Damage"
+#define __DRI_DAMAGE_VERSION 1
+struct __DRIdamageExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Reports areas of the given drawable which have been modified by the
+ * driver.
+ *
+ * \param drawable which the drawing was done to.
+ * \param rects rectangles affected, with the drawable origin as the
+ * origin.
+ * \param x X offset of the drawable within the screen (used in the
+ * front_buffer case)
+ * \param y Y offset of the drawable within the screen.
+ * \param front_buffer boolean flag for whether the drawing to the
+ * drawable was actually done directly to the front buffer (instead
+ * of backing storage, for example)
+ * \param loaderPrivate the data passed in at createNewDrawable time
+ */
+ void (*reportDamage)(__DRIdrawable *draw,
+ int x, int y,
+ drm_clip_rect_t *rects, int num_rects,
+ GLboolean front_buffer,
+ void *loaderPrivate);
+};
+
+#define __DRI_SWRAST_IMAGE_OP_DRAW 1
+#define __DRI_SWRAST_IMAGE_OP_CLEAR 2
+#define __DRI_SWRAST_IMAGE_OP_SWAP 3
+
+/**
+ * SWRast Loader extension.
+ */
+#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
+#define __DRI_SWRAST_LOADER_VERSION 1
+struct __DRIswrastLoaderExtensionRec {
+ __DRIextension base;
+
+ /*
+ * Drawable position and size
+ */
+ void (*getDrawableInfo)(__DRIdrawable *drawable,
+ int *x, int *y, int *width, int *height,
+ void *loaderPrivate);
+
+ /**
+ * Put image to drawable
+ */
+ void (*putImage)(__DRIdrawable *drawable, int op,
+ int x, int y, int width, int height,
+ char *data, void *loaderPrivate);
+
+ /**
+ * Get image from readable
+ */
+ void (*getImage)(__DRIdrawable *readable,
+ int x, int y, int width, int height,
+ char *data, void *loaderPrivate);
+};
+
+/**
+ * Invalidate loader extension. The presence of this extension
+ * indicates to the DRI driver that the loader will call invalidate in
+ * the __DRI2_FLUSH extension, whenever the needs to query for new
+ * buffers. This means that the DRI driver can drop the polling in
+ * glViewport().
+ *
+ * The extension doesn't provide any functionality, it's only use to
+ * indicate to the driver that it can use the new semantics. A DRI
+ * driver can use this to switch between the different semantics or
+ * just refuse to initialize if this extension isn't present.
+ */
+#define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
+#define __DRI_USE_INVALIDATE_VERSION 1
+
+typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
+struct __DRIuseInvalidateExtensionRec {
+ __DRIextension base;
+};
+
+/**
+ * The remaining extensions describe driver extensions, immediately
+ * available interfaces provided by the driver. To start using the
+ * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
+ * the extension you need in the array.
+ */
+#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
+
+/**
+ * Tokens for __DRIconfig attribs. A number of attributes defined by
+ * GLX or EGL standards are not in the table, as they must be provided
+ * by the loader. For example, FBConfig ID or visual ID, drawable type.
+ */
+
+#define __DRI_ATTRIB_BUFFER_SIZE 1
+#define __DRI_ATTRIB_LEVEL 2
+#define __DRI_ATTRIB_RED_SIZE 3
+#define __DRI_ATTRIB_GREEN_SIZE 4
+#define __DRI_ATTRIB_BLUE_SIZE 5
+#define __DRI_ATTRIB_LUMINANCE_SIZE 6
+#define __DRI_ATTRIB_ALPHA_SIZE 7
+#define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
+#define __DRI_ATTRIB_DEPTH_SIZE 9
+#define __DRI_ATTRIB_STENCIL_SIZE 10
+#define __DRI_ATTRIB_ACCUM_RED_SIZE 11
+#define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
+#define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
+#define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
+#define __DRI_ATTRIB_SAMPLE_BUFFERS 15
+#define __DRI_ATTRIB_SAMPLES 16
+#define __DRI_ATTRIB_RENDER_TYPE 17
+#define __DRI_ATTRIB_CONFIG_CAVEAT 18
+#define __DRI_ATTRIB_CONFORMANT 19
+#define __DRI_ATTRIB_DOUBLE_BUFFER 20
+#define __DRI_ATTRIB_STEREO 21
+#define __DRI_ATTRIB_AUX_BUFFERS 22
+#define __DRI_ATTRIB_TRANSPARENT_TYPE 23
+#define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
+#define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
+#define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
+#define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
+#define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
+#define __DRI_ATTRIB_FLOAT_MODE 29
+#define __DRI_ATTRIB_RED_MASK 30
+#define __DRI_ATTRIB_GREEN_MASK 31
+#define __DRI_ATTRIB_BLUE_MASK 32
+#define __DRI_ATTRIB_ALPHA_MASK 33
+#define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
+#define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
+#define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
+#define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
+#define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
+#define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
+#define __DRI_ATTRIB_SWAP_METHOD 40
+#define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
+#define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
+#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
+#define __DRI_ATTRIB_YINVERTED 47
+#define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE 48
+
+/* __DRI_ATTRIB_RENDER_TYPE */
+#define __DRI_ATTRIB_RGBA_BIT 0x01
+#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
+#define __DRI_ATTRIB_LUMINANCE_BIT 0x04
+
+/* __DRI_ATTRIB_CONFIG_CAVEAT */
+#define __DRI_ATTRIB_SLOW_BIT 0x01
+#define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
+
+/* __DRI_ATTRIB_TRANSPARENT_TYPE */
+#define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
+#define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
+
+/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
+#define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
+#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
+#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
+
+/**
+ * This extension defines the core DRI functionality.
+ */
+#define __DRI_CORE "DRI_Core"
+#define __DRI_CORE_VERSION 1
+
+struct __DRIcoreExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen, int fd,
+ unsigned int sarea_handle,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driverConfigs,
+ void *loaderPrivate);
+
+ void (*destroyScreen)(__DRIscreen *screen);
+
+ const __DRIextension **(*getExtensions)(__DRIscreen *screen);
+
+ int (*getConfigAttrib)(const __DRIconfig *config,
+ unsigned int attrib,
+ unsigned int *value);
+
+ int (*indexConfigAttrib)(const __DRIconfig *config, int index,
+ unsigned int *attrib, unsigned int *value);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ unsigned int drawable_id,
+ unsigned int head,
+ void *loaderPrivate);
+
+ void (*destroyDrawable)(__DRIdrawable *drawable);
+
+ void (*swapBuffers)(__DRIdrawable *drawable);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
+
+ int (*copyContext)(__DRIcontext *dest,
+ __DRIcontext *src,
+ unsigned long mask);
+
+ void (*destroyContext)(__DRIcontext *context);
+
+ int (*bindContext)(__DRIcontext *ctx,
+ __DRIdrawable *pdraw,
+ __DRIdrawable *pread);
+
+ int (*unbindContext)(__DRIcontext *ctx);
+};
+
+/**
+ * Stored version of some component (i.e., server-side DRI module, kernel-side
+ * DRM, etc.).
+ *
+ * \todo
+ * There are several data structures that explicitly store a major version,
+ * minor version, and patch level. These structures should be modified to
+ * have a \c __DRIversionRec instead.
+ */
+struct __DRIversionRec {
+ int major; /**< Major version number. */
+ int minor; /**< Minor version number. */
+ int patch; /**< Patch-level. */
+};
+
+/**
+ * Framebuffer information record. Used by libGL to communicate information
+ * about the framebuffer to the driver's \c __driCreateNewScreen function.
+ *
+ * In XFree86, most of this information is derrived from data returned by
+ * calling \c XF86DRIGetDeviceInfo.
+ *
+ * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
+ * __driUtilCreateNewScreen CallCreateNewScreen
+ *
+ * \bug This structure could be better named.
+ */
+struct __DRIframebufferRec {
+ unsigned char *base; /**< Framebuffer base address in the CPU's
+ * address space. This value is calculated by
+ * calling \c drmMap on the framebuffer handle
+ * returned by \c XF86DRIGetDeviceInfo (or a
+ * similar function).
+ */
+ int size; /**< Framebuffer size, in bytes. */
+ int stride; /**< Number of bytes from one line to the next. */
+ int width; /**< Pixel width of the framebuffer. */
+ int height; /**< Pixel height of the framebuffer. */
+ int dev_priv_size; /**< Size of the driver's dev-priv structure. */
+ void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
+};
+
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for legacy DRI functionality. This is used in
+ * conjunction with the core extension.
+ */
+#define __DRI_LEGACY "DRI_Legacy"
+#define __DRI_LEGACY_VERSION 1
+
+struct __DRIlegacyExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen,
+ const __DRIversion *ddx_version,
+ const __DRIversion *dri_version,
+ const __DRIversion *drm_version,
+ const __DRIframebuffer *frame_buffer,
+ void *pSAREA, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ drm_drawable_t hwDrawable,
+ int renderType, const int *attrs,
+ void *loaderPrivate);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ int render_type,
+ __DRIcontext *shared,
+ drm_context_t hwContext,
+ void *loaderPrivate);
+};
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for swrast DRI functionality. This is used in
+ * conjunction with the core extension.
+ */
+#define __DRI_SWRAST "DRI_SWRast"
+#define __DRI_SWRAST_VERSION 3
+
+struct __DRIswrastExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ void *loaderPrivate);
+
+ /* Since version 2 */
+ __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *data);
+
+ /**
+ * Create a context for a particular API with a set of attributes
+ *
+ * \since version 3
+ *
+ * \sa __DRIdri2ExtensionRec::createContextAttribs
+ */
+ __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ unsigned num_attribs,
+ const uint32_t *attribs,
+ unsigned *error,
+ void *loaderPrivate);
+};
+
+/**
+ * DRI2 Loader extension.
+ */
+#define __DRI_BUFFER_FRONT_LEFT 0
+#define __DRI_BUFFER_BACK_LEFT 1
+#define __DRI_BUFFER_FRONT_RIGHT 2
+#define __DRI_BUFFER_BACK_RIGHT 3
+#define __DRI_BUFFER_DEPTH 4
+#define __DRI_BUFFER_STENCIL 5
+#define __DRI_BUFFER_ACCUM 6
+#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
+#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
+#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
+#define __DRI_BUFFER_HIZ 10
+
+/* Inofficial and for internal use. Increase when adding a new buffer token. */
+#define __DRI_BUFFER_COUNT 11
+
+struct __DRIbufferRec {
+ unsigned int attachment;
+ unsigned int name;
+ unsigned int pitch;
+ unsigned int cpp;
+ unsigned int flags;
+};
+
+#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
+#define __DRI_DRI2_LOADER_VERSION 3
+struct __DRIdri2LoaderExtensionRec {
+ __DRIextension base;
+
+ __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate);
+
+ /**
+ * Flush pending front-buffer rendering
+ *
+ * Any rendering that has been performed to the
+ * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
+ * \c __DRI_BUFFER_FRONT_LEFT.
+ *
+ * \param driDrawable Drawable whose front-buffer is to be flushed
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable
+ */
+ void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
+
+
+ /**
+ * Get list of buffers from the server
+ *
+ * Gets a list of buffer for the specified set of attachments. Unlike
+ * \c ::getBuffers, this function takes a list of attachments paired with
+ * opaque \c unsigned \c int value describing the format of the buffer.
+ * It is the responsibility of the caller to know what the service that
+ * allocates the buffers will expect to receive for the format.
+ *
+ * \param driDrawable Drawable whose buffers are being queried.
+ * \param width Output where the width of the buffers is stored.
+ * \param height Output where the height of the buffers is stored.
+ * \param attachments List of pairs of attachment ID and opaque format
+ * requested for the drawable.
+ * \param count Number of attachment / format pairs stored in
+ * \c attachments.
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable.
+ */
+ __DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate);
+};
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for DRI2.
+ */
+#define __DRI_DRI2 "DRI_DRI2"
+#define __DRI_DRI2_VERSION 3
+
+#define __DRI_API_OPENGL 0 /**< OpenGL compatibility profile */
+#define __DRI_API_GLES 1 /**< OpenGL ES 1.x */
+#define __DRI_API_GLES2 2 /**< OpenGL ES 2.x */
+#define __DRI_API_OPENGL_CORE 3 /**< OpenGL 3.2+ core profile */
+#define __DRI_API_GLES3 4 /**< OpenGL ES 3.x */
+
+#define __DRI_CTX_ATTRIB_MAJOR_VERSION 0
+#define __DRI_CTX_ATTRIB_MINOR_VERSION 1
+#define __DRI_CTX_ATTRIB_FLAGS 2
+
+/**
+ * \requires __DRI2_ROBUSTNESS.
+ */
+#define __DRI_CTX_ATTRIB_RESET_STRATEGY 3
+
+#define __DRI_CTX_FLAG_DEBUG 0x00000001
+#define __DRI_CTX_FLAG_FORWARD_COMPATIBLE 0x00000002
+
+/**
+ * \requires __DRI2_ROBUSTNESS.
+ */
+#define __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS 0x00000004
+
+/**
+ * \name Context reset strategies.
+ */
+/*@{*/
+#define __DRI_CTX_RESET_NO_NOTIFICATION 0
+#define __DRI_CTX_RESET_LOSE_CONTEXT 1
+/*@}*/
+
+/**
+ * \name Reasons that __DRIdri2Extension::createContextAttribs might fail
+ */
+/*@{*/
+/** Success! */
+#define __DRI_CTX_ERROR_SUCCESS 0
+
+/** Memory allocation failure */
+#define __DRI_CTX_ERROR_NO_MEMORY 1
+
+/** Client requested an API (e.g., OpenGL ES 2.0) that the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_API 2
+
+/** Client requested an API version that the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_VERSION 3
+
+/** Client requested a flag or combination of flags the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_FLAG 4
+
+/** Client requested an attribute the driver doesn't understand. */
+#define __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE 5
+
+/** Client requested a flag the driver doesn't understand. */
+#define __DRI_CTX_ERROR_UNKNOWN_FLAG 6
+/*@}*/
+
+struct __DRIdri2ExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ void *loaderPrivate);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
+
+ /* Since version 2 */
+ unsigned int (*getAPIMask)(__DRIscreen *screen);
+
+ __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *data);
+
+ __DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
+ unsigned int attachment,
+ unsigned int format,
+ int width,
+ int height);
+ void (*releaseBuffer)(__DRIscreen *screen,
+ __DRIbuffer *buffer);
+
+ /**
+ * Create a context for a particular API with a set of attributes
+ *
+ * \since version 3
+ *
+ * \sa __DRIswrastExtensionRec::createContextAttribs
+ */
+ __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ unsigned num_attribs,
+ const uint32_t *attribs,
+ unsigned *error,
+ void *loaderPrivate);
+};
+
+
+/**
+ * This extension provides functionality to enable various EGLImage
+ * extensions.
+ */
+#define __DRI_IMAGE "DRI_IMAGE"
+#define __DRI_IMAGE_VERSION 5
+
+/**
+ * These formats correspond to the similarly named MESA_FORMAT_*
+ * tokens, except in the native endian of the CPU. For example, on
+ * little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
+ * MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
+ *
+ * __DRI_IMAGE_FORMAT_NONE is for images that aren't directly usable
+ * by the driver (YUV planar formats) but serve as a base image for
+ * creating sub-images for the different planes within the image.
+ *
+ * R8, GR88 and NONE should not be used with createImageFormName or
+ * createImage, and are returned by query from sub images created with
+ * createImageFromNames (NONE, see above) and fromPlane (R8 & GR88).
+ */
+#define __DRI_IMAGE_FORMAT_RGB565 0x1001
+#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
+#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
+#define __DRI_IMAGE_FORMAT_ABGR8888 0x1004
+#define __DRI_IMAGE_FORMAT_XBGR8888 0x1005
+#define __DRI_IMAGE_FORMAT_R8 0x1006 /* Since version 5 */
+#define __DRI_IMAGE_FORMAT_GR88 0x1007
+#define __DRI_IMAGE_FORMAT_NONE 0x1008
+
+#define __DRI_IMAGE_USE_SHARE 0x0001
+#define __DRI_IMAGE_USE_SCANOUT 0x0002
+#define __DRI_IMAGE_USE_CURSOR 0x0004 /* Depricated */
+
+
+/**
+ * Four CC formats that matches with WL_DRM_FORMAT_* from wayland_drm.h
+ * and GBM_FORMAT_* from gbm.h, used with createImageFromNames.
+ *
+ * \since 5
+ */
+
+#define __DRI_IMAGE_FOURCC_RGB565 0x36314752
+#define __DRI_IMAGE_FOURCC_ARGB8888 0x34325241
+#define __DRI_IMAGE_FOURCC_XRGB8888 0x34325258
+#define __DRI_IMAGE_FOURCC_ABGR8888 0x34324241
+#define __DRI_IMAGE_FOURCC_XBGR8888 0x34324258
+#define __DRI_IMAGE_FOURCC_YUV410 0x39565559
+#define __DRI_IMAGE_FOURCC_YUV411 0x31315559
+#define __DRI_IMAGE_FOURCC_YUV420 0x32315559
+#define __DRI_IMAGE_FOURCC_YUV422 0x36315559
+#define __DRI_IMAGE_FOURCC_YUV444 0x34325559
+#define __DRI_IMAGE_FOURCC_NV12 0x3231564e
+#define __DRI_IMAGE_FOURCC_NV16 0x3631564e
+#define __DRI_IMAGE_FOURCC_YUYV 0x56595559
+
+
+/**
+ * Queryable on images created by createImageFromNames.
+ *
+ * RGB and RGBA are may be usable directly as images but its still
+ * recommended to call fromPlanar with plane == 0.
+ *
+ * Y_U_V, Y_UV and Y_XUXV all requires call to fromPlanar to create
+ * usable sub-images, sampling from images return raw YUV data and
+ * color conversion needs to be done in the shader.
+ *
+ * \since 5
+ */
+
+#define __DRI_IMAGE_COMPONENTS_RGB 0x3001
+#define __DRI_IMAGE_COMPONENTS_RGBA 0x3002
+#define __DRI_IMAGE_COMPONENTS_Y_U_V 0x3003
+#define __DRI_IMAGE_COMPONENTS_Y_UV 0x3004
+#define __DRI_IMAGE_COMPONENTS_Y_XUXV 0x3005
+
+
+/**
+ * queryImage attributes
+ */
+
+#define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
+#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
+#define __DRI_IMAGE_ATTRIB_NAME 0x2002
+#define __DRI_IMAGE_ATTRIB_FORMAT 0x2003 /* available in versions 3+ */
+#define __DRI_IMAGE_ATTRIB_WIDTH 0x2004 /* available in versions 4+ */
+#define __DRI_IMAGE_ATTRIB_HEIGHT 0x2005
+#define __DRI_IMAGE_ATTRIB_COMPONENTS 0x2006 /* available in versions 5+ */
+
+typedef struct __DRIimageRec __DRIimage;
+typedef struct __DRIimageExtensionRec __DRIimageExtension;
+struct __DRIimageExtensionRec {
+ __DRIextension base;
+
+ __DRIimage *(*createImageFromName)(__DRIscreen *screen,
+ int width, int height, int format,
+ int name, int pitch,
+ void *loaderPrivate);
+
+ __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
+ int renderbuffer,
+ void *loaderPrivate);
+
+ void (*destroyImage)(__DRIimage *image);
+
+ __DRIimage *(*createImage)(__DRIscreen *screen,
+ int width, int height, int format,
+ unsigned int use,
+ void *loaderPrivate);
+
+ GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
+
+ /**
+ * The new __DRIimage will share the content with the old one, see dup(2).
+ */
+ __DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
+
+ /**
+ * Validate that a __DRIimage can be used a certain way.
+ *
+ * \since 2
+ */
+ GLboolean (*validateUsage)(__DRIimage *image, unsigned int use);
+
+ /**
+ * Unlike createImageFromName __DRI_IMAGE_FORMAT is not but instead
+ * __DRI_IMAGE_FOURCC and strides are in bytes not pixels. Stride is
+ * also per block and not per pixel (for non-RGB, see gallium blocks).
+ *
+ * \since 5
+ */
+ __DRIimage *(*createImageFromNames)(__DRIscreen *screen,
+ int width, int height, int fourcc,
+ int *names, int num_names,
+ int *strides, int *offsets,
+ void *loaderPrivate);
+
+ /**
+ * Create an image out of a sub-region of a parent image. This
+ * entry point lets us create individual __DRIimages for different
+ * planes in a planar buffer (typically yuv), for example. While a
+ * sub-image shares the underlying buffer object with the parent
+ * image and other sibling sub-images, the life times of parent and
+ * sub-images are not dependent. Destroying the parent or a
+ * sub-image doesn't affect other images. The underlying buffer
+ * object is free when no __DRIimage remains that references it.
+ *
+ * Sub-images may overlap, but rendering to overlapping sub-images
+ * is undefined.
+ *
+ * \since 5
+ */
+ __DRIimage *(*fromPlanar)(__DRIimage *image, int plane,
+ void *loaderPrivate);
+};
+
+
+/**
+ * This extension must be implemented by the loader and passed to the
+ * driver at screen creation time. The EGLImage entry points in the
+ * various client APIs take opaque EGLImage handles and use this
+ * extension to map them to a __DRIimage. At version 1, this
+ * extensions allows mapping EGLImage pointers to __DRIimage pointers,
+ * but future versions could support other EGLImage-like, opaque types
+ * with new lookup functions.
+ */
+#define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP"
+#define __DRI_IMAGE_LOOKUP_VERSION 1
+
+typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
+struct __DRIimageLookupExtensionRec {
+ __DRIextension base;
+
+ __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
+ void *loaderPrivate);
+};
+
+/**
+ * This extension allows for common DRI2 options
+ */
+#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
+#define __DRI2_CONFIG_QUERY_VERSION 1
+
+typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
+struct __DRI2configQueryExtensionRec {
+ __DRIextension base;
+
+ int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
+ int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
+ int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
+};
+
+/**
+ * Robust context driver extension.
+ *
+ * Existence of this extension means the driver can accept the
+ * \c __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
+ * \c __DRI_CTX_ATTRIB_RESET_STRATEGY attribute in
+ * \c __DRIdri2ExtensionRec::createContextAttribs.
+ */
+#define __DRI2_ROBUSTNESS "DRI_Robustness"
+#define __DRI2_ROBUSTNESS_VERSION 1
+
+typedef struct __DRIrobustnessExtensionRec __DRIrobustnessExtension;
+struct __DRIrobustnessExtensionRec {
+ __DRIextension base;
+};
+
+#endif
diff --git a/src/gfxstream/host/apigen-codec-common/GL/gl.h b/src/gfxstream/host/apigen-codec-common/GL/gl.h
new file mode 100644
index 00000000000..97094fc5997
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/GL/gl.h
@@ -0,0 +1,2235 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.6
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. 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 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
+ * BRIAN PAUL 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 __gl_h_
+#define __gl_h_
+
+#if defined(USE_MGL_NAMESPACE)
+#include "gl_mangle.h"
+#endif
+
+
+/**********************************************************************
+ * Begin system-specific stuff. Do not do any of this when building
+ * for SciTech SNAP, as this is all done before this header file is
+ * included.
+ */
+#if !defined(__SCITECH_SNAP__)
+
+#if defined(__BEOS__)
+#include <stdlib.h> /* to get some BeOS-isms */
+#endif
+
+#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO))
+#define OPENSTEP
+#endif
+
+#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
+#define __WIN32__
+#endif
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
+# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+# define GLAPI __declspec(dllexport)
+# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+# define GLAPI __declspec(dllimport)
+# else /* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+# endif /* _STATIC_MESA support */
+# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
+# define GLAPIENTRY
+# else
+# define GLAPIENTRY __stdcall
+# endif
+#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
+# define GLAPI extern
+# define GLAPIENTRY __stdcall
+#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define GLAPI __attribute__((visibility("default")))
+# define GLAPIENTRY
+#endif /* WIN32 && !CYGWIN */
+
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+# define PRAGMA_EXPORT_SUPPORTED 1
+#endif
+
+/*
+ * WINDOWS: Include windows.h here to define APIENTRY.
+ * It is also useful when applications include this file by
+ * including only glut.h, since glut.h depends on windows.h.
+ * Applications needing to include windows.h with parms other
+ * than "WIN32_LEAN_AND_MEAN" may include windows.h before
+ * glut.h or gl.h.
+ */
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN 1
+#endif
+#include <windows.h>
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import on
+#endif
+
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+/* "P" suffix to be used for a pointer to a function */
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#ifdef CENTERLINE_CLPP
+#define signed
+#endif
+
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export on
+#endif
+
+#endif /* !__SCITECH_SNAP__ */
+/*
+ * End system-specific stuff.
+ **********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+#define GL_VERSION_1_1 1
+#define GL_VERSION_1_2 1
+#define GL_VERSION_1_3 1
+#define GL_ARB_imaging 1
+
+
+/*
+ * Datatypes
+ */
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef void GLvoid;
+typedef signed char GLbyte; /* 1-byte signed */
+typedef short GLshort; /* 2-byte signed */
+typedef int GLint; /* 4-byte signed */
+typedef unsigned char GLubyte; /* 1-byte unsigned */
+typedef unsigned short GLushort; /* 2-byte unsigned */
+typedef unsigned int GLuint; /* 4-byte unsigned */
+typedef int GLsizei; /* 4-byte signed */
+typedef float GLfloat; /* single precision float */
+typedef float GLclampf; /* single precision float in [0,1] */
+typedef double GLdouble; /* double precision float */
+typedef double GLclampd; /* double precision float in [0,1] */
+
+
+
+/*
+ * Constants
+ */
+
+/* Boolean values */
+#define GL_FALSE 0
+#define GL_TRUE 1
+
+/* Data types */
+#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_2_BYTES 0x1407
+#define GL_3_BYTES 0x1408
+#define GL_4_BYTES 0x1409
+#define GL_DOUBLE 0x140A
+
+/* Primitives */
+#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_QUADS 0x0007
+#define GL_QUAD_STRIP 0x0008
+#define GL_POLYGON 0x0009
+
+/* Vertex Arrays */
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_INDEX_ARRAY 0x8077
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#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_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_V2F 0x2A20
+#define GL_V3F 0x2A21
+#define GL_C4UB_V2F 0x2A22
+#define GL_C4UB_V3F 0x2A23
+#define GL_C3F_V3F 0x2A24
+#define GL_N3F_V3F 0x2A25
+#define GL_C4F_N3F_V3F 0x2A26
+#define GL_T2F_V3F 0x2A27
+#define GL_T4F_V4F 0x2A28
+#define GL_T2F_C4UB_V3F 0x2A29
+#define GL_T2F_C3F_V3F 0x2A2A
+#define GL_T2F_N3F_V3F 0x2A2B
+#define GL_T2F_C4F_N3F_V3F 0x2A2C
+#define GL_T4F_C4F_N3F_V4F 0x2A2D
+
+/* Matrix Mode */
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
+
+/* Points */
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_POINT_SIZE_RANGE 0x0B12
+
+/* Lines */
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_STIPPLE 0x0B24
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_LINE_WIDTH_RANGE 0x0B22
+
+/* Polygons */
+#define GL_POINT 0x1B00
+#define GL_LINE 0x1B01
+#define GL_FILL 0x1B02
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_EDGE_FLAG 0x0B43
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
+
+/* Display Lists */
+#define GL_COMPILE 0x1300
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#define GL_LIST_BASE 0x0B32
+#define GL_LIST_INDEX 0x0B33
+#define GL_LIST_MODE 0x0B30
+
+/* Depth buffer */
+#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_DEPTH_TEST 0x0B71
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_COMPONENT 0x1902
+
+/* Lighting */
+#define GL_LIGHTING 0x0B50
+#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
+#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
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_SHININESS 0x1601
+#define GL_EMISSION 0x1600
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_COLOR_INDEXES 0x1603
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_SHADE_MODEL 0x0B54
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_NORMALIZE 0x0BA1
+
+/* User clipping planes */
+#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
+
+/* Accumulation buffer */
+#define GL_ACCUM_RED_BITS 0x0D58
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#define GL_ACCUM 0x0100
+#define GL_ADD 0x0104
+#define GL_LOAD 0x0101
+#define GL_MULT 0x0103
+#define GL_RETURN 0x0102
+
+/* Alpha testing */
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+
+/* Blending */
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND_DST 0x0BE0
+#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
+
+/* Render Mode */
+#define GL_FEEDBACK 0x1C01
+#define GL_RENDER 0x1C00
+#define GL_SELECT 0x1C02
+
+/* Feedback */
+#define GL_2D 0x0600
+#define GL_3D 0x0601
+#define GL_3D_COLOR 0x0602
+#define GL_3D_COLOR_TEXTURE 0x0603
+#define GL_4D_COLOR_TEXTURE 0x0604
+#define GL_POINT_TOKEN 0x0701
+#define GL_LINE_TOKEN 0x0702
+#define GL_LINE_RESET_TOKEN 0x0707
+#define GL_POLYGON_TOKEN 0x0703
+#define GL_BITMAP_TOKEN 0x0704
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#define GL_PASS_THROUGH_TOKEN 0x0700
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+
+/* Selection */
+#define GL_SELECTION_BUFFER_POINTER 0x0DF3
+#define GL_SELECTION_BUFFER_SIZE 0x0DF4
+
+/* Fog */
+#define GL_FOG 0x0B60
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_COLOR 0x0B66
+#define GL_FOG_INDEX 0x0B61
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_LINEAR 0x2601
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+
+/* Logic Ops */
+#define GL_LOGIC_OP 0x0BF1
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_CLEAR 0x1500
+#define GL_SET 0x150F
+#define GL_COPY 0x1503
+#define GL_COPY_INVERTED 0x150C
+#define GL_NOOP 0x1505
+#define GL_INVERT 0x150A
+#define GL_AND 0x1501
+#define GL_NAND 0x150E
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_XOR 0x1506
+#define GL_EQUIV 0x1509
+#define GL_AND_REVERSE 0x1502
+#define GL_AND_INVERTED 0x1504
+#define GL_OR_REVERSE 0x150B
+#define GL_OR_INVERTED 0x150D
+
+/* Stencil */
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_TEST 0x0B90
+#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_STENCIL_INDEX 0x1901
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+
+/* Buffers, Pixel Drawing/Reading */
+#define GL_NONE 0
+#define GL_LEFT 0x0406
+#define GL_RIGHT 0x0407
+/*GL_FRONT 0x0404 */
+/*GL_BACK 0x0405 */
+/*GL_FRONT_AND_BACK 0x0408 */
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_AUX0 0x0409
+#define GL_AUX1 0x040A
+#define GL_AUX2 0x040B
+#define GL_AUX3 0x040C
+#define GL_COLOR_INDEX 0x1900
+#define GL_RED 0x1903
+#define GL_GREEN 0x1904
+#define GL_BLUE 0x1905
+#define GL_ALPHA 0x1906
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_ALPHA_BITS 0x0D55
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_INDEX_BITS 0x0D51
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_AUX_BUFFERS 0x0C00
+#define GL_READ_BUFFER 0x0C02
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_STEREO 0x0C33
+#define GL_BITMAP 0x1A00
+#define GL_COLOR 0x1800
+#define GL_DEPTH 0x1801
+#define GL_STENCIL 0x1802
+#define GL_DITHER 0x0BD0
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+
+/* Implementation limits */
+#define GL_MAX_LIST_NESTING 0x0B31
+#define GL_MAX_EVAL_ORDER 0x0D30
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
+#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_NAME_STACK_DEPTH 0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+
+/* Gets */
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_MODE 0x0C30
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_NAME_STACK_DEPTH 0x0D70
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_RENDER_MODE 0x0C40
+#define GL_RGBA_MODE 0x0C31
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_VIEWPORT 0x0BA2
+
+/* Evaluators */
+#define GL_AUTO_NORMAL 0x0D80
+#define GL_MAP1_COLOR_4 0x0D90
+#define GL_MAP1_INDEX 0x0D91
+#define GL_MAP1_NORMAL 0x0D92
+#define GL_MAP1_TEXTURE_COORD_1 0x0D93
+#define GL_MAP1_TEXTURE_COORD_2 0x0D94
+#define GL_MAP1_TEXTURE_COORD_3 0x0D95
+#define GL_MAP1_TEXTURE_COORD_4 0x0D96
+#define GL_MAP1_VERTEX_3 0x0D97
+#define GL_MAP1_VERTEX_4 0x0D98
+#define GL_MAP2_COLOR_4 0x0DB0
+#define GL_MAP2_INDEX 0x0DB1
+#define GL_MAP2_NORMAL 0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
+#define GL_MAP2_VERTEX_3 0x0DB7
+#define GL_MAP2_VERTEX_4 0x0DB8
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
+#define GL_COEFF 0x0A00
+#define GL_ORDER 0x0A01
+#define GL_DOMAIN 0x0A02
+
+/* Hints */
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_FOG_HINT 0x0C54
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* Scissor box */
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+
+/* Pixel Mode / Transfer */
+#define GL_MAP_COLOR 0x0D10
+#define GL_MAP_STENCIL 0x0D11
+#define GL_INDEX_SHIFT 0x0D12
+#define GL_INDEX_OFFSET 0x0D13
+#define GL_RED_SCALE 0x0D14
+#define GL_RED_BIAS 0x0D15
+#define GL_GREEN_SCALE 0x0D18
+#define GL_GREEN_BIAS 0x0D19
+#define GL_BLUE_SCALE 0x0D1A
+#define GL_BLUE_BIAS 0x0D1B
+#define GL_ALPHA_SCALE 0x0D1C
+#define GL_ALPHA_BIAS 0x0D1D
+#define GL_DEPTH_SCALE 0x0D1E
+#define GL_DEPTH_BIAS 0x0D1F
+#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
+#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
+#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
+#define GL_PIXEL_MAP_S_TO_S 0x0C71
+#define GL_PIXEL_MAP_I_TO_I 0x0C70
+#define GL_PIXEL_MAP_I_TO_R 0x0C72
+#define GL_PIXEL_MAP_I_TO_G 0x0C73
+#define GL_PIXEL_MAP_I_TO_B 0x0C74
+#define GL_PIXEL_MAP_I_TO_A 0x0C75
+#define GL_PIXEL_MAP_R_TO_R 0x0C76
+#define GL_PIXEL_MAP_G_TO_G 0x0C77
+#define GL_PIXEL_MAP_B_TO_B 0x0C78
+#define GL_PIXEL_MAP_A_TO_A 0x0C79
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_ZOOM_X 0x0D16
+#define GL_ZOOM_Y 0x0D17
+
+/* Texture mapping */
+#define GL_TEXTURE_ENV 0x2300
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_Q 0x0C63
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_COMPONENTS 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_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_OBJECT_PLANE 0x2501
+#define GL_EYE_LINEAR 0x2400
+#define GL_EYE_PLANE 0x2502
+#define GL_SPHERE_MAP 0x2402
+#define GL_DECAL 0x2101
+#define GL_MODULATE 0x2100
+#define GL_NEAREST 0x2600
+#define GL_REPEAT 0x2901
+#define GL_CLAMP 0x2900
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#define GL_Q 0x2003
+
+/* Utility */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* Errors */
+#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
+
+/* glPush/PopAttrib bits */
+#define GL_CURRENT_BIT 0x00000001
+#define GL_POINT_BIT 0x00000002
+#define GL_LINE_BIT 0x00000004
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_LIGHTING_BIT 0x00000040
+#define GL_FOG_BIT 0x00000080
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_ENABLE_BIT 0x00002000
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_HINT_BIT 0x00008000
+#define GL_EVAL_BIT 0x00010000
+#define GL_LIST_BIT 0x00020000
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_ALL_ATTRIB_BITS 0x000FFFFF
+
+
+/* OpenGL 1.1 */
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+
+
+
+/*
+ * Miscellaneous
+ */
+
+GLAPI void GLAPIENTRY glClearIndex( GLfloat c );
+
+GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glClear( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glIndexMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
+
+GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref );
+
+GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor );
+
+GLAPI void GLAPIENTRY glLogicOp( GLenum opcode );
+
+GLAPI void GLAPIENTRY glCullFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glFrontFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glPointSize( GLfloat size );
+
+GLAPI void GLAPIENTRY glLineWidth( GLfloat width );
+
+GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern );
+
+GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode );
+
+GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units );
+
+GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask );
+
+GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask );
+
+GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag );
+
+GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag );
+
+GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height);
+
+GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation );
+
+GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation );
+
+GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glReadBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnable( GLenum cap );
+
+GLAPI void GLAPIENTRY glDisable( GLenum cap );
+
+GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap );
+
+
+GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */
+
+
+GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params );
+
+GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params );
+
+GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glPopAttrib( void );
+
+
+GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */
+
+
+GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
+
+GLAPI GLenum GLAPIENTRY glGetError( void );
+
+GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
+
+GLAPI void GLAPIENTRY glFinish( void );
+
+GLAPI void GLAPIENTRY glFlush( void );
+
+GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode );
+
+
+/*
+ * Depth Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearDepth( GLclampd depth );
+
+GLAPI void GLAPIENTRY glDepthFunc( GLenum func );
+
+GLAPI void GLAPIENTRY glDepthMask( GLboolean flag );
+
+GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val );
+
+
+/*
+ * Accumulation Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
+
+GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
+
+
+/*
+ * Transformation
+ */
+
+GLAPI void GLAPIENTRY glMatrixMode( GLenum mode );
+
+GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glViewport( GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+GLAPI void GLAPIENTRY glPushMatrix( void );
+
+GLAPI void GLAPIENTRY glPopMatrix( void );
+
+GLAPI void GLAPIENTRY glLoadIdentity( void );
+
+GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glRotated( GLdouble angle,
+ GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRotatef( GLfloat angle,
+ GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z );
+
+
+/*
+ * Display Lists
+ */
+
+GLAPI GLboolean GLAPIENTRY glIsList( GLuint list );
+
+GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range );
+
+GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range );
+
+GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode );
+
+GLAPI void GLAPIENTRY glEndList( void );
+
+GLAPI void GLAPIENTRY glCallList( GLuint list );
+
+GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type,
+ const GLvoid *lists );
+
+GLAPI void GLAPIENTRY glListBase( GLuint base );
+
+
+/*
+ * Drawing Functions
+ */
+
+GLAPI void GLAPIENTRY glBegin( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnd( void );
+
+
+GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex2iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex3iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex4iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz );
+GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz );
+GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz );
+GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz );
+GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz );
+
+GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glNormal3iv( const GLint *v );
+GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glIndexd( GLdouble c );
+GLAPI void GLAPIENTRY glIndexf( GLfloat c );
+GLAPI void GLAPIENTRY glIndexi( GLint c );
+GLAPI void GLAPIENTRY glIndexs( GLshort c );
+GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c );
+GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c );
+GLAPI void GLAPIENTRY glIndexiv( const GLint *c );
+GLAPI void GLAPIENTRY glIndexsv( const GLshort *c );
+GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue );
+GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue );
+GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue );
+GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue );
+GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue );
+GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
+GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue );
+GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue );
+
+GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green,
+ GLbyte blue, GLbyte alpha );
+GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green,
+ GLdouble blue, GLdouble alpha );
+GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green,
+ GLfloat blue, GLfloat alpha );
+GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green,
+ GLint blue, GLint alpha );
+GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green,
+ GLshort blue, GLshort alpha );
+GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green,
+ GLubyte blue, GLubyte alpha );
+GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green,
+ GLuint blue, GLuint alpha );
+GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green,
+ GLushort blue, GLushort alpha );
+
+
+GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor3iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor3sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor3usv( const GLushort *v );
+
+GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor4iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor4sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor4usv( const GLushort *v );
+
+
+GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s );
+GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s );
+GLAPI void GLAPIENTRY glTexCoord1i( GLint s );
+GLAPI void GLAPIENTRY glTexCoord1s( GLshort s );
+
+GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t );
+GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t );
+GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t );
+GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r );
+GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r );
+GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r );
+GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q );
+GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
+GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
+GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 );
+GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
+
+
+GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 );
+GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 );
+GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 );
+GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 );
+
+
+/*
+ * Vertex Arrays (1.1)
+ */
+
+GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params );
+
+GLAPI void GLAPIENTRY glArrayElement( GLint i );
+
+GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count );
+
+GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride,
+ const GLvoid *pointer );
+
+/*
+ * Lighting
+ */
+
+GLAPI void GLAPIENTRY glShadeModel( GLenum mode );
+
+GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname,
+ GLfloat *params );
+GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode );
+
+
+/*
+ * Raster functions
+ */
+
+GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor );
+
+GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize,
+ const GLfloat *values );
+GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize,
+ const GLuint *values );
+GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize,
+ const GLushort *values );
+
+GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values );
+GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values );
+GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values );
+
+GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig,
+ GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap );
+
+GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type );
+
+/*
+ * Stenciling
+ */
+
+GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
+
+GLAPI void GLAPIENTRY glClearStencil( GLint s );
+
+
+
+/*
+ * Texture mapping
+ */
+
+GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param );
+GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params );
+GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
+GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target,
+ GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target,
+ GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level,
+ GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level,
+ GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+
+/* 1.1 functions */
+
+GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );
+
+GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures);
+
+GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture );
+
+GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n,
+ const GLuint *textures,
+ const GLclampf *priorities );
+
+GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n,
+ const GLuint *textures,
+ GLboolean *residences );
+
+GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture );
+
+
+GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLint border );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y,
+ GLsizei width );
+
+
+GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+
+/*
+ * Evaluators
+ */
+
+GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2,
+ GLint stride,
+ GLint order, const GLdouble *points );
+GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2,
+ GLint stride,
+ GLint order, const GLfloat *points );
+
+GLAPI void GLAPIENTRY glMap2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points );
+GLAPI void GLAPIENTRY glMap2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points );
+
+GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v );
+GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v );
+GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v );
+
+GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u );
+GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u );
+
+GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v );
+GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v );
+
+GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
+GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
+
+GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 );
+GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 );
+
+GLAPI void GLAPIENTRY glEvalPoint1( GLint i );
+
+GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j );
+
+GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
+
+GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+
+
+/*
+ * Fog
+ */
+
+GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param );
+
+GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params );
+
+GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params );
+
+
+/*
+ * Selection and Feedback
+ */
+
+GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
+
+GLAPI void GLAPIENTRY glPassThrough( GLfloat token );
+
+GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer );
+
+GLAPI void GLAPIENTRY glInitNames( void );
+
+GLAPI void GLAPIENTRY glLoadName( GLuint name );
+
+GLAPI void GLAPIENTRY glPushName( GLuint name );
+
+GLAPI void GLAPIENTRY glPopName( void );
+
+
+
+/*
+ * OpenGL 1.2
+ */
+
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#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_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_TEXTURE_BINDING_3D 0x806A
+
+GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
+ GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format,
+ GLenum type, const GLvoid *pixels);
+
+GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLint x,
+ GLint y, GLsizei width,
+ GLsizei height );
+
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+
+/*
+ * GL_ARB_imaging
+ */
+
+#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_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_BLEND_EQUATION 0x8009
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_BLEND_COLOR 0x8005
+
+
+GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *table );
+
+GLAPI void GLAPIENTRY glColorSubTable( GLenum target,
+ GLsizei start, GLsizei count,
+ GLenum format, GLenum type,
+ const GLvoid *data );
+
+GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname,
+ const GLint *params);
+
+GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params);
+
+GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format,
+ GLenum type, GLvoid *table );
+
+GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glBlendEquation( GLenum mode );
+
+GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green,
+ GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width,
+ GLenum internalformat, GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetHistogram( GLenum target );
+
+GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset,
+ GLenum format, GLenum type,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat,
+ GLboolean sink );
+
+GLAPI void GLAPIENTRY glResetMinmax( GLenum target );
+
+GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset,
+ GLenum format, GLenum types,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLsizei width, GLenum format, GLenum type,
+ const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *image );
+
+GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname,
+ GLfloat params );
+
+GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname,
+ GLint params );
+
+GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width,
+ GLsizei height);
+
+GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *image );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *row, const GLvoid *column );
+
+GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
+
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+
+
+
+/*
+ * OpenGL 1.3
+ */
+
+/* multitexture */
+#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
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+/* texture_cube_map */
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#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_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+/* texture_compression */
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+/* multisample */
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_MULTISAMPLE_BIT 0x20000000
+/* transpose_matrix */
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+/* texture_env_combine */
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#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_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+/* texture_env_dot3 */
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+/* texture_border_clamp */
+#define GL_CLAMP_TO_BORDER 0x812D
+
+GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s );
+
+GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
+
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+
+
+
+/*
+ * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
+ */
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+
+GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s);
+GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s);
+GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s);
+GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s);
+GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
+GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
+GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
+GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
+GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
+GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
+
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+
+#endif /* GL_ARB_multitexture */
+
+
+
+/*
+ * Define this token if you want "old-style" header file behaviour (extensions
+ * defined in gl.h). Otherwise, extensions will be included from glext.h.
+ */
+#if defined(GL_GLEXT_LEGACY)
+
+/* All extensions that used to be here are now found in glext.h */
+
+#else /* GL_GLEXT_LEGACY */
+
+#include <GL/glext.h>
+
+#endif /* GL_GLEXT_LEGACY */
+
+
+
+#if GL_ARB_shader_objects
+
+#ifndef GL_MESA_shader_debug
+#define GL_MESA_shader_debug 1
+
+#define GL_DEBUG_OBJECT_MESA 0x8759
+#define GL_DEBUG_PRINT_MESA 0x875A
+#define GL_DEBUG_ASSERT_MESA 0x875B
+
+GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void);
+GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
+ GLsizei *length, GLcharARB *debugLog);
+GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+
+#endif /* GL_MESA_shader_debug */
+
+#endif /* GL_ARB_shader_objects */
+
+
+/*
+ * ???. GL_MESA_packed_depth_stencil
+ * XXX obsolete
+ */
+#ifndef GL_MESA_packed_depth_stencil
+#define GL_MESA_packed_depth_stencil 1
+
+#define GL_DEPTH_STENCIL_MESA 0x8750
+#define GL_UNSIGNED_INT_24_8_MESA 0x8751
+#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
+#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
+#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
+
+#endif /* GL_MESA_packed_depth_stencil */
+
+
+#ifndef GL_MESA_program_debug
+#define GL_MESA_program_debug 1
+
+#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0
+#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1
+#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2
+#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3
+#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4
+#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5
+#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6
+#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7
+
+typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
+
+GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
+
+GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
+
+#endif /* GL_MESA_program_debug */
+
+
+#ifndef GL_MESA_texture_array
+#define GL_MESA_texture_array 1
+
+/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array.
+ */
+#ifndef GL_EXT_texture_array
+
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target,
+ GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif /* GL_GLEXT_PROTOTYPES */
+
+#if 0
+/* (temporarily) disabled because of collision with typedef in glext.h
+ * that happens if apps include both gl.h and glext.h
+ */
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target,
+ GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif
+
+#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
+#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#endif
+
+#endif
+
+
+#ifndef GL_ATI_blend_equation_separate
+#define GL_ATI_blend_equation_separate 1
+
+#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D
+
+GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
+
+#endif /* GL_ATI_blend_equation_separate */
+
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+typedef void* GLeglImageOES;
+#endif
+
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#endif
+
+
+/**
+ ** NOTE!!!!! If you add new functions to this file, or update
+ ** glext.h be sure to regenerate the gl_mangle.h file. See comments
+ ** in that file for details.
+ **/
+
+
+
+/**********************************************************************
+ * Begin system-specific stuff
+ */
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export off
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import off
+#endif
+/*
+ * End system-specific stuff
+ **********************************************************************/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
diff --git a/src/gfxstream/host/apigen-codec-common/GL/gl_mangle.h b/src/gfxstream/host/apigen-codec-common/GL/gl_mangle.h
new file mode 100644
index 00000000000..36848033817
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/GL/gl_mangle.h
@@ -0,0 +1,2311 @@
+#if 0
+#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output"
+#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names"
+ files="gl.h glext.h"
+#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line"
+ awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0
+ echo ""
+#define GL_MANGLE_C4 get aliases
+ grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq
+ echo ""
+ echo "#endif /* GL_MANGLE_H */"
+ exit
+#endif /* REGENERATION */
+
+/*
+ * If you compile Mesa with USE_MGL_NAMESPACE defined then you can link
+ * your application both with OpenGL and Mesa. The Mesa functions will
+ * be redefined so they are prefixed with "mgl" instead of "gl".
+ * Mgl contributed by Randy Frank (rfrank@rsinc.com)
+ * Regneration code contributed by Ray Tice (rayt@ma.ultra.net)
+ */
+
+#ifndef GL_MANGLE_H
+#define GL_MANGLE_H
+
+#ifndef MANGLE
+#define MANGLE(x) mgl##x
+#endif /*MANGLE*/
+
+/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
+
+#define glAccum MANGLE(Accum)
+#define glActiveProgramEXT MANGLE(ActiveProgramEXT)
+#define glActiveShaderProgram MANGLE(ActiveShaderProgram)
+#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
+#define glActiveTextureARB MANGLE(ActiveTextureARB)
+#define glActiveTexture MANGLE(ActiveTexture)
+#define glActiveVaryingNV MANGLE(ActiveVaryingNV)
+#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI)
+#define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI)
+#define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI)
+#define glAlphaFunc MANGLE(AlphaFunc)
+#define glApplyTextureEXT MANGLE(ApplyTextureEXT)
+#define glAreProgramsResidentNV MANGLE(AreProgramsResidentNV)
+#define glAreTexturesResidentEXT MANGLE(AreTexturesResidentEXT)
+#define glAreTexturesResident MANGLE(AreTexturesResident)
+#define glArrayElementEXT MANGLE(ArrayElementEXT)
+#define glArrayElement MANGLE(ArrayElement)
+#define glArrayObjectATI MANGLE(ArrayObjectATI)
+#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX)
+#define glAttachObjectARB MANGLE(AttachObjectARB)
+#define glAttachShader MANGLE(AttachShader)
+#define glBeginConditionalRender MANGLE(BeginConditionalRender)
+#define glBeginConditionalRenderNV MANGLE(BeginConditionalRenderNV)
+#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI)
+#define glBegin MANGLE(Begin)
+#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
+#define glBeginPerfMonitorAMD MANGLE(BeginPerfMonitorAMD)
+#define glBeginQueryARB MANGLE(BeginQueryARB)
+#define glBeginQueryIndexed MANGLE(BeginQueryIndexed)
+#define glBeginQuery MANGLE(BeginQuery)
+#define glBeginTransformFeedbackEXT MANGLE(BeginTransformFeedbackEXT)
+#define glBeginTransformFeedback MANGLE(BeginTransformFeedback)
+#define glBeginTransformFeedbackNV MANGLE(BeginTransformFeedbackNV)
+#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT)
+#define glBeginVideoCaptureNV MANGLE(BeginVideoCaptureNV)
+#define glBindAttribLocationARB MANGLE(BindAttribLocationARB)
+#define glBindAttribLocation MANGLE(BindAttribLocation)
+#define glBindBufferARB MANGLE(BindBufferARB)
+#define glBindBufferBaseEXT MANGLE(BindBufferBaseEXT)
+#define glBindBufferBase MANGLE(BindBufferBase)
+#define glBindBufferBaseNV MANGLE(BindBufferBaseNV)
+#define glBindBuffer MANGLE(BindBuffer)
+#define glBindBufferOffsetEXT MANGLE(BindBufferOffsetEXT)
+#define glBindBufferOffsetNV MANGLE(BindBufferOffsetNV)
+#define glBindBufferRangeEXT MANGLE(BindBufferRangeEXT)
+#define glBindBufferRange MANGLE(BindBufferRange)
+#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
+#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
+#define glBindFragDataLocationIndexed MANGLE(BindFragDataLocationIndexed)
+#define glBindFragDataLocation MANGLE(BindFragDataLocation)
+#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
+#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
+#define glBindFramebuffer MANGLE(BindFramebuffer)
+#define glBindImageTextureEXT MANGLE(BindImageTextureEXT)
+#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
+#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
+#define glBindMultiTextureEXT MANGLE(BindMultiTextureEXT)
+#define glBindParameterEXT MANGLE(BindParameterEXT)
+#define glBindProgramARB MANGLE(BindProgramARB)
+#define glBindProgramNV MANGLE(BindProgramNV)
+#define glBindProgramPipeline MANGLE(BindProgramPipeline)
+#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
+#define glBindRenderbuffer MANGLE(BindRenderbuffer)
+#define glBindSampler MANGLE(BindSampler)
+#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
+#define glBindTextureEXT MANGLE(BindTextureEXT)
+#define glBindTexture MANGLE(BindTexture)
+#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
+#define glBindTransformFeedback MANGLE(BindTransformFeedback)
+#define glBindTransformFeedbackNV MANGLE(BindTransformFeedbackNV)
+#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
+#define glBindVertexArray MANGLE(BindVertexArray)
+#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT)
+#define glBindVideoCaptureStreamBufferNV MANGLE(BindVideoCaptureStreamBufferNV)
+#define glBindVideoCaptureStreamTextureNV MANGLE(BindVideoCaptureStreamTextureNV)
+#define glBinormal3bEXT MANGLE(Binormal3bEXT)
+#define glBinormal3bvEXT MANGLE(Binormal3bvEXT)
+#define glBinormal3dEXT MANGLE(Binormal3dEXT)
+#define glBinormal3dvEXT MANGLE(Binormal3dvEXT)
+#define glBinormal3fEXT MANGLE(Binormal3fEXT)
+#define glBinormal3fvEXT MANGLE(Binormal3fvEXT)
+#define glBinormal3iEXT MANGLE(Binormal3iEXT)
+#define glBinormal3ivEXT MANGLE(Binormal3ivEXT)
+#define glBinormal3sEXT MANGLE(Binormal3sEXT)
+#define glBinormal3svEXT MANGLE(Binormal3svEXT)
+#define glBinormalPointerEXT MANGLE(BinormalPointerEXT)
+#define glBitmap MANGLE(Bitmap)
+#define glBlendColorEXT MANGLE(BlendColorEXT)
+#define glBlendColor MANGLE(BlendColor)
+#define glBlendEquationEXT MANGLE(BlendEquationEXT)
+#define glBlendEquationiARB MANGLE(BlendEquationiARB)
+#define glBlendEquationi MANGLE(BlendEquationi)
+#define glBlendEquationIndexedAMD MANGLE(BlendEquationIndexedAMD)
+#define glBlendEquation MANGLE(BlendEquation)
+#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
+#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
+#define glBlendEquationSeparateiARB MANGLE(BlendEquationSeparateiARB)
+#define glBlendEquationSeparatei MANGLE(BlendEquationSeparatei)
+#define glBlendEquationSeparateIndexedAMD MANGLE(BlendEquationSeparateIndexedAMD)
+#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
+#define glBlendFunciARB MANGLE(BlendFunciARB)
+#define glBlendFunci MANGLE(BlendFunci)
+#define glBlendFuncIndexedAMD MANGLE(BlendFuncIndexedAMD)
+#define glBlendFunc MANGLE(BlendFunc)
+#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
+#define glBlendFuncSeparateiARB MANGLE(BlendFuncSeparateiARB)
+#define glBlendFuncSeparatei MANGLE(BlendFuncSeparatei)
+#define glBlendFuncSeparateIndexedAMD MANGLE(BlendFuncSeparateIndexedAMD)
+#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
+#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
+#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
+#define glBlitFramebuffer MANGLE(BlitFramebuffer)
+#define glBufferAddressRangeNV MANGLE(BufferAddressRangeNV)
+#define glBufferDataARB MANGLE(BufferDataARB)
+#define glBufferData MANGLE(BufferData)
+#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE)
+#define glBufferSubDataARB MANGLE(BufferSubDataARB)
+#define glBufferSubData MANGLE(BufferSubData)
+#define glCallList MANGLE(CallList)
+#define glCallLists MANGLE(CallLists)
+#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
+#define glCheckFramebufferStatus MANGLE(CheckFramebufferStatus)
+#define glCheckNamedFramebufferStatusEXT MANGLE(CheckNamedFramebufferStatusEXT)
+#define glClampColorARB MANGLE(ClampColorARB)
+#define glClampColor MANGLE(ClampColor)
+#define glClearAccum MANGLE(ClearAccum)
+#define glClearBufferfi MANGLE(ClearBufferfi)
+#define glClearBufferfv MANGLE(ClearBufferfv)
+#define glClearBufferiv MANGLE(ClearBufferiv)
+#define glClearBufferuiv MANGLE(ClearBufferuiv)
+#define glClearColorIiEXT MANGLE(ClearColorIiEXT)
+#define glClearColorIuiEXT MANGLE(ClearColorIuiEXT)
+#define glClearColor MANGLE(ClearColor)
+#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA)
+#define glClearDepthdNV MANGLE(ClearDepthdNV)
+#define glClearDepthf MANGLE(ClearDepthf)
+#define glClearDepth MANGLE(ClearDepth)
+#define glClearIndex MANGLE(ClearIndex)
+#define glClear MANGLE(Clear)
+#define glClearStencil MANGLE(ClearStencil)
+#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB)
+#define glClientActiveTexture MANGLE(ClientActiveTexture)
+#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
+#define glClientAttribDefaultEXT MANGLE(ClientAttribDefaultEXT)
+#define glClientWaitSync MANGLE(ClientWaitSync)
+#define glClipPlane MANGLE(ClipPlane)
+#define glColor3b MANGLE(Color3b)
+#define glColor3bv MANGLE(Color3bv)
+#define glColor3d MANGLE(Color3d)
+#define glColor3dv MANGLE(Color3dv)
+#define glColor3f MANGLE(Color3f)
+#define glColor3fVertex3fSUN MANGLE(Color3fVertex3fSUN)
+#define glColor3fVertex3fvSUN MANGLE(Color3fVertex3fvSUN)
+#define glColor3fv MANGLE(Color3fv)
+#define glColor3hNV MANGLE(Color3hNV)
+#define glColor3hvNV MANGLE(Color3hvNV)
+#define glColor3i MANGLE(Color3i)
+#define glColor3iv MANGLE(Color3iv)
+#define glColor3s MANGLE(Color3s)
+#define glColor3sv MANGLE(Color3sv)
+#define glColor3ub MANGLE(Color3ub)
+#define glColor3ubv MANGLE(Color3ubv)
+#define glColor3ui MANGLE(Color3ui)
+#define glColor3uiv MANGLE(Color3uiv)
+#define glColor3us MANGLE(Color3us)
+#define glColor3usv MANGLE(Color3usv)
+#define glColor4b MANGLE(Color4b)
+#define glColor4bv MANGLE(Color4bv)
+#define glColor4d MANGLE(Color4d)
+#define glColor4dv MANGLE(Color4dv)
+#define glColor4f MANGLE(Color4f)
+#define glColor4fNormal3fVertex3fSUN MANGLE(Color4fNormal3fVertex3fSUN)
+#define glColor4fNormal3fVertex3fvSUN MANGLE(Color4fNormal3fVertex3fvSUN)
+#define glColor4fv MANGLE(Color4fv)
+#define glColor4hNV MANGLE(Color4hNV)
+#define glColor4hvNV MANGLE(Color4hvNV)
+#define glColor4i MANGLE(Color4i)
+#define glColor4iv MANGLE(Color4iv)
+#define glColor4s MANGLE(Color4s)
+#define glColor4sv MANGLE(Color4sv)
+#define glColor4ub MANGLE(Color4ub)
+#define glColor4ubVertex2fSUN MANGLE(Color4ubVertex2fSUN)
+#define glColor4ubVertex2fvSUN MANGLE(Color4ubVertex2fvSUN)
+#define glColor4ubVertex3fSUN MANGLE(Color4ubVertex3fSUN)
+#define glColor4ubVertex3fvSUN MANGLE(Color4ubVertex3fvSUN)
+#define glColor4ubv MANGLE(Color4ubv)
+#define glColor4ui MANGLE(Color4ui)
+#define glColor4uiv MANGLE(Color4uiv)
+#define glColor4us MANGLE(Color4us)
+#define glColor4usv MANGLE(Color4usv)
+#define glColorFormatNV MANGLE(ColorFormatNV)
+#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI)
+#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI)
+#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI)
+#define glColorMaski MANGLE(ColorMaski)
+#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
+#define glColorMask MANGLE(ColorMask)
+#define glColorMaterial MANGLE(ColorMaterial)
+#define glColorP3ui MANGLE(ColorP3ui)
+#define glColorP3uiv MANGLE(ColorP3uiv)
+#define glColorP4ui MANGLE(ColorP4ui)
+#define glColorP4uiv MANGLE(ColorP4uiv)
+#define glColorPointerEXT MANGLE(ColorPointerEXT)
+#define glColorPointerListIBM MANGLE(ColorPointerListIBM)
+#define glColorPointer MANGLE(ColorPointer)
+#define glColorPointervINTEL MANGLE(ColorPointervINTEL)
+#define glColorSubTableEXT MANGLE(ColorSubTableEXT)
+#define glColorSubTable MANGLE(ColorSubTable)
+#define glColorTableEXT MANGLE(ColorTableEXT)
+#define glColorTable MANGLE(ColorTable)
+#define glColorTableParameterfv MANGLE(ColorTableParameterfv)
+#define glColorTableParameterfvSGI MANGLE(ColorTableParameterfvSGI)
+#define glColorTableParameteriv MANGLE(ColorTableParameteriv)
+#define glColorTableParameterivSGI MANGLE(ColorTableParameterivSGI)
+#define glColorTableSGI MANGLE(ColorTableSGI)
+#define glCombinerInputNV MANGLE(CombinerInputNV)
+#define glCombinerOutputNV MANGLE(CombinerOutputNV)
+#define glCombinerParameterfNV MANGLE(CombinerParameterfNV)
+#define glCombinerParameterfvNV MANGLE(CombinerParameterfvNV)
+#define glCombinerParameteriNV MANGLE(CombinerParameteriNV)
+#define glCombinerParameterivNV MANGLE(CombinerParameterivNV)
+#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
+#define glCompileShaderARB MANGLE(CompileShaderARB)
+#define glCompileShaderIncludeARB MANGLE(CompileShaderIncludeARB)
+#define glCompileShader MANGLE(CompileShader)
+#define glCompressedMultiTexImage1DEXT MANGLE(CompressedMultiTexImage1DEXT)
+#define glCompressedMultiTexImage2DEXT MANGLE(CompressedMultiTexImage2DEXT)
+#define glCompressedMultiTexImage3DEXT MANGLE(CompressedMultiTexImage3DEXT)
+#define glCompressedMultiTexSubImage1DEXT MANGLE(CompressedMultiTexSubImage1DEXT)
+#define glCompressedMultiTexSubImage2DEXT MANGLE(CompressedMultiTexSubImage2DEXT)
+#define glCompressedMultiTexSubImage3DEXT MANGLE(CompressedMultiTexSubImage3DEXT)
+#define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB)
+#define glCompressedTexImage1D MANGLE(CompressedTexImage1D)
+#define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB)
+#define glCompressedTexImage2D MANGLE(CompressedTexImage2D)
+#define glCompressedTexImage3DARB MANGLE(CompressedTexImage3DARB)
+#define glCompressedTexImage3D MANGLE(CompressedTexImage3D)
+#define glCompressedTexSubImage1DARB MANGLE(CompressedTexSubImage1DARB)
+#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D)
+#define glCompressedTexSubImage2DARB MANGLE(CompressedTexSubImage2DARB)
+#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D)
+#define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB)
+#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D)
+#define glCompressedTextureImage1DEXT MANGLE(CompressedTextureImage1DEXT)
+#define glCompressedTextureImage2DEXT MANGLE(CompressedTextureImage2DEXT)
+#define glCompressedTextureImage3DEXT MANGLE(CompressedTextureImage3DEXT)
+#define glCompressedTextureSubImage1DEXT MANGLE(CompressedTextureSubImage1DEXT)
+#define glCompressedTextureSubImage2DEXT MANGLE(CompressedTextureSubImage2DEXT)
+#define glCompressedTextureSubImage3DEXT MANGLE(CompressedTextureSubImage3DEXT)
+#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT)
+#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D)
+#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT)
+#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D)
+#define glConvolutionParameterfEXT MANGLE(ConvolutionParameterfEXT)
+#define glConvolutionParameterf MANGLE(ConvolutionParameterf)
+#define glConvolutionParameterfvEXT MANGLE(ConvolutionParameterfvEXT)
+#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv)
+#define glConvolutionParameteriEXT MANGLE(ConvolutionParameteriEXT)
+#define glConvolutionParameteri MANGLE(ConvolutionParameteri)
+#define glConvolutionParameterivEXT MANGLE(ConvolutionParameterivEXT)
+#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv)
+#define glCopyBufferSubData MANGLE(CopyBufferSubData)
+#define glCopyColorSubTableEXT MANGLE(CopyColorSubTableEXT)
+#define glCopyColorSubTable MANGLE(CopyColorSubTable)
+#define glCopyColorTable MANGLE(CopyColorTable)
+#define glCopyColorTableSGI MANGLE(CopyColorTableSGI)
+#define glCopyConvolutionFilter1DEXT MANGLE(CopyConvolutionFilter1DEXT)
+#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D)
+#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT)
+#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D)
+#define glCopyImageSubDataNV MANGLE(CopyImageSubDataNV)
+#define glCopyMultiTexImage1DEXT MANGLE(CopyMultiTexImage1DEXT)
+#define glCopyMultiTexImage2DEXT MANGLE(CopyMultiTexImage2DEXT)
+#define glCopyMultiTexSubImage1DEXT MANGLE(CopyMultiTexSubImage1DEXT)
+#define glCopyMultiTexSubImage2DEXT MANGLE(CopyMultiTexSubImage2DEXT)
+#define glCopyMultiTexSubImage3DEXT MANGLE(CopyMultiTexSubImage3DEXT)
+#define glCopyPixels MANGLE(CopyPixels)
+#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT)
+#define glCopyTexImage1D MANGLE(CopyTexImage1D)
+#define glCopyTexImage2DEXT MANGLE(CopyTexImage2DEXT)
+#define glCopyTexImage2D MANGLE(CopyTexImage2D)
+#define glCopyTexSubImage1DEXT MANGLE(CopyTexSubImage1DEXT)
+#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D)
+#define glCopyTexSubImage2DEXT MANGLE(CopyTexSubImage2DEXT)
+#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D)
+#define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT)
+#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D)
+#define glCopyTextureImage1DEXT MANGLE(CopyTextureImage1DEXT)
+#define glCopyTextureImage2DEXT MANGLE(CopyTextureImage2DEXT)
+#define glCopyTextureSubImage1DEXT MANGLE(CopyTextureSubImage1DEXT)
+#define glCopyTextureSubImage2DEXT MANGLE(CopyTextureSubImage2DEXT)
+#define glCopyTextureSubImage3DEXT MANGLE(CopyTextureSubImage3DEXT)
+#define glCreateDebugObjectMESA MANGLE(CreateDebugObjectMESA)
+#define glCreateProgram MANGLE(CreateProgram)
+#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB)
+#define glCreateShader MANGLE(CreateShader)
+#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
+#define glCreateShaderProgramEXT MANGLE(CreateShaderProgramEXT)
+#define glCreateShaderProgramv MANGLE(CreateShaderProgramv)
+#define glCreateSyncFromCLeventARB MANGLE(CreateSyncFromCLeventARB)
+#define glCullFace MANGLE(CullFace)
+#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
+#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
+#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB)
+#define glDebugMessageCallbackAMD MANGLE(DebugMessageCallbackAMD)
+#define glDebugMessageCallbackARB MANGLE(DebugMessageCallbackARB)
+#define glDebugMessageControlARB MANGLE(DebugMessageControlARB)
+#define glDebugMessageEnableAMD MANGLE(DebugMessageEnableAMD)
+#define glDebugMessageInsertAMD MANGLE(DebugMessageInsertAMD)
+#define glDebugMessageInsertARB MANGLE(DebugMessageInsertARB)
+#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX)
+#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX)
+#define glDeformSGIX MANGLE(DeformSGIX)
+#define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX)
+#define glDeleteBuffersARB MANGLE(DeleteBuffersARB)
+#define glDeleteBuffers MANGLE(DeleteBuffers)
+#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE)
+#define glDeleteFencesNV MANGLE(DeleteFencesNV)
+#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI)
+#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
+#define glDeleteFramebuffers MANGLE(DeleteFramebuffers)
+#define glDeleteLists MANGLE(DeleteLists)
+#define glDeleteNamedStringARB MANGLE(DeleteNamedStringARB)
+#define glDeleteNamesAMD MANGLE(DeleteNamesAMD)
+#define glDeleteObjectARB MANGLE(DeleteObjectARB)
+#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
+#define glDeletePerfMonitorsAMD MANGLE(DeletePerfMonitorsAMD)
+#define glDeleteProgram MANGLE(DeleteProgram)
+#define glDeleteProgramPipelines MANGLE(DeleteProgramPipelines)
+#define glDeleteProgramsARB MANGLE(DeleteProgramsARB)
+#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
+#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
+#define glDeleteQueries MANGLE(DeleteQueries)
+#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
+#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers)
+#define glDeleteSamplers MANGLE(DeleteSamplers)
+#define glDeleteShader MANGLE(DeleteShader)
+#define glDeleteSync MANGLE(DeleteSync)
+#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
+#define glDeleteTextures MANGLE(DeleteTextures)
+#define glDeleteTransformFeedbacks MANGLE(DeleteTransformFeedbacks)
+#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV)
+#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
+#define glDeleteVertexArrays MANGLE(DeleteVertexArrays)
+#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT)
+#define glDepthBoundsdNV MANGLE(DepthBoundsdNV)
+#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
+#define glDepthFunc MANGLE(DepthFunc)
+#define glDepthMask MANGLE(DepthMask)
+#define glDepthRangeArrayv MANGLE(DepthRangeArrayv)
+#define glDepthRangedNV MANGLE(DepthRangedNV)
+#define glDepthRangef MANGLE(DepthRangef)
+#define glDepthRangeIndexed MANGLE(DepthRangeIndexed)
+#define glDepthRange MANGLE(DepthRange)
+#define glDetachObjectARB MANGLE(DetachObjectARB)
+#define glDetachShader MANGLE(DetachShader)
+#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS)
+#define glDisableClientStateIndexedEXT MANGLE(DisableClientStateIndexedEXT)
+#define glDisableClientState MANGLE(DisableClientState)
+#define glDisablei MANGLE(Disablei)
+#define glDisableIndexedEXT MANGLE(DisableIndexedEXT)
+#define glDisable MANGLE(Disable)
+#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
+#define glDisableVertexAttribAPPLE MANGLE(DisableVertexAttribAPPLE)
+#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
+#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
+#define glDrawArraysEXT MANGLE(DrawArraysEXT)
+#define glDrawArraysIndirect MANGLE(DrawArraysIndirect)
+#define glDrawArraysInstancedARB MANGLE(DrawArraysInstancedARB)
+#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
+#define glDrawArraysInstanced MANGLE(DrawArraysInstanced)
+#define glDrawArrays MANGLE(DrawArrays)
+#define glDrawBuffer MANGLE(DrawBuffer)
+#define glDrawBuffersARB MANGLE(DrawBuffersARB)
+#define glDrawBuffersATI MANGLE(DrawBuffersATI)
+#define glDrawBuffers MANGLE(DrawBuffers)
+#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
+#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
+#define glDrawElementsBaseVertex MANGLE(DrawElementsBaseVertex)
+#define glDrawElementsIndirect MANGLE(DrawElementsIndirect)
+#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB)
+#define glDrawElementsInstancedBaseVertex MANGLE(DrawElementsInstancedBaseVertex)
+#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
+#define glDrawElementsInstanced MANGLE(DrawElementsInstanced)
+#define glDrawElements MANGLE(DrawElements)
+#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN)
+#define glDrawPixels MANGLE(DrawPixels)
+#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE)
+#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI)
+#define glDrawRangeElementsBaseVertex MANGLE(DrawRangeElementsBaseVertex)
+#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
+#define glDrawRangeElements MANGLE(DrawRangeElements)
+#define glDrawTransformFeedback MANGLE(DrawTransformFeedback)
+#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
+#define glDrawTransformFeedbackStream MANGLE(DrawTransformFeedbackStream)
+#define glEdgeFlagFormatNV MANGLE(EdgeFlagFormatNV)
+#define glEdgeFlag MANGLE(EdgeFlag)
+#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
+#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM)
+#define glEdgeFlagPointer MANGLE(EdgeFlagPointer)
+#define glEdgeFlagv MANGLE(EdgeFlagv)
+#define glEGLImageTargetRenderbufferStorageOES MANGLE(EGLImageTargetRenderbufferStorageOES)
+#define glEGLImageTargetTexture2DOES MANGLE(EGLImageTargetTexture2DOES)
+#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE)
+#define glElementPointerATI MANGLE(ElementPointerATI)
+#define glEnableClientStateIndexedEXT MANGLE(EnableClientStateIndexedEXT)
+#define glEnableClientState MANGLE(EnableClientState)
+#define glEnablei MANGLE(Enablei)
+#define glEnableIndexedEXT MANGLE(EnableIndexedEXT)
+#define glEnable MANGLE(Enable)
+#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
+#define glEnableVertexAttribAPPLE MANGLE(EnableVertexAttribAPPLE)
+#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
+#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray)
+#define glEndConditionalRender MANGLE(EndConditionalRender)
+#define glEndConditionalRenderNV MANGLE(EndConditionalRenderNV)
+#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI)
+#define glEndList MANGLE(EndList)
+#define glEnd MANGLE(End)
+#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
+#define glEndPerfMonitorAMD MANGLE(EndPerfMonitorAMD)
+#define glEndQueryARB MANGLE(EndQueryARB)
+#define glEndQueryIndexed MANGLE(EndQueryIndexed)
+#define glEndQuery MANGLE(EndQuery)
+#define glEndTransformFeedbackEXT MANGLE(EndTransformFeedbackEXT)
+#define glEndTransformFeedback MANGLE(EndTransformFeedback)
+#define glEndTransformFeedbackNV MANGLE(EndTransformFeedbackNV)
+#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT)
+#define glEndVideoCaptureNV MANGLE(EndVideoCaptureNV)
+#define glEvalCoord1d MANGLE(EvalCoord1d)
+#define glEvalCoord1dv MANGLE(EvalCoord1dv)
+#define glEvalCoord1f MANGLE(EvalCoord1f)
+#define glEvalCoord1fv MANGLE(EvalCoord1fv)
+#define glEvalCoord2d MANGLE(EvalCoord2d)
+#define glEvalCoord2dv MANGLE(EvalCoord2dv)
+#define glEvalCoord2f MANGLE(EvalCoord2f)
+#define glEvalCoord2fv MANGLE(EvalCoord2fv)
+#define glEvalMapsNV MANGLE(EvalMapsNV)
+#define glEvalMesh1 MANGLE(EvalMesh1)
+#define glEvalMesh2 MANGLE(EvalMesh2)
+#define glEvalPoint1 MANGLE(EvalPoint1)
+#define glEvalPoint2 MANGLE(EvalPoint2)
+#define glExecuteProgramNV MANGLE(ExecuteProgramNV)
+#define glExtractComponentEXT MANGLE(ExtractComponentEXT)
+#define glFeedbackBuffer MANGLE(FeedbackBuffer)
+#define glFenceSync MANGLE(FenceSync)
+#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV)
+#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX)
+#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE)
+#define glFinishFenceNV MANGLE(FinishFenceNV)
+#define glFinish MANGLE(Finish)
+#define glFinishObjectAPPLE MANGLE(FinishObjectAPPLE)
+#define glFinishTextureSUNX MANGLE(FinishTextureSUNX)
+#define glFlush MANGLE(Flush)
+#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
+#define glFlushMappedBufferRange MANGLE(FlushMappedBufferRange)
+#define glFlushMappedNamedBufferRangeEXT MANGLE(FlushMappedNamedBufferRangeEXT)
+#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
+#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
+#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
+#define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV)
+#define glFogCoorddEXT MANGLE(FogCoorddEXT)
+#define glFogCoordd MANGLE(FogCoordd)
+#define glFogCoorddvEXT MANGLE(FogCoorddvEXT)
+#define glFogCoorddv MANGLE(FogCoorddv)
+#define glFogCoordfEXT MANGLE(FogCoordfEXT)
+#define glFogCoordf MANGLE(FogCoordf)
+#define glFogCoordFormatNV MANGLE(FogCoordFormatNV)
+#define glFogCoordfvEXT MANGLE(FogCoordfvEXT)
+#define glFogCoordfv MANGLE(FogCoordfv)
+#define glFogCoordhNV MANGLE(FogCoordhNV)
+#define glFogCoordhvNV MANGLE(FogCoordhvNV)
+#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT)
+#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM)
+#define glFogCoordPointer MANGLE(FogCoordPointer)
+#define glFogf MANGLE(Fogf)
+#define glFogFuncSGIS MANGLE(FogFuncSGIS)
+#define glFogfv MANGLE(Fogfv)
+#define glFogi MANGLE(Fogi)
+#define glFogiv MANGLE(Fogiv)
+#define glFragmentColorMaterialSGIX MANGLE(FragmentColorMaterialSGIX)
+#define glFragmentLightfSGIX MANGLE(FragmentLightfSGIX)
+#define glFragmentLightfvSGIX MANGLE(FragmentLightfvSGIX)
+#define glFragmentLightiSGIX MANGLE(FragmentLightiSGIX)
+#define glFragmentLightivSGIX MANGLE(FragmentLightivSGIX)
+#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX)
+#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX)
+#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX)
+#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX)
+#define glFragmentMaterialfSGIX MANGLE(FragmentMaterialfSGIX)
+#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX)
+#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX)
+#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX)
+#define glFramebufferDrawBufferEXT MANGLE(FramebufferDrawBufferEXT)
+#define glFramebufferDrawBuffersEXT MANGLE(FramebufferDrawBuffersEXT)
+#define glFramebufferReadBufferEXT MANGLE(FramebufferReadBufferEXT)
+#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT)
+#define glFramebufferRenderbuffer MANGLE(FramebufferRenderbuffer)
+#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT)
+#define glFramebufferTexture1D MANGLE(FramebufferTexture1D)
+#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT)
+#define glFramebufferTexture2D MANGLE(FramebufferTexture2D)
+#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT)
+#define glFramebufferTexture3D MANGLE(FramebufferTexture3D)
+#define glFramebufferTextureARB MANGLE(FramebufferTextureARB)
+#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
+#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB)
+#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
+#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB)
+#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
+#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer)
+#define glFramebufferTexture MANGLE(FramebufferTexture)
+#define glFrameTerminatorGREMEDY MANGLE(FrameTerminatorGREMEDY)
+#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
+#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
+#define glFrontFace MANGLE(FrontFace)
+#define glFrustum MANGLE(Frustum)
+#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX)
+#define glGenBuffersARB MANGLE(GenBuffersARB)
+#define glGenBuffers MANGLE(GenBuffers)
+#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT)
+#define glGenerateMipmap MANGLE(GenerateMipmap)
+#define glGenerateMultiTexMipmapEXT MANGLE(GenerateMultiTexMipmapEXT)
+#define glGenerateTextureMipmapEXT MANGLE(GenerateTextureMipmapEXT)
+#define glGenFencesAPPLE MANGLE(GenFencesAPPLE)
+#define glGenFencesNV MANGLE(GenFencesNV)
+#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
+#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
+#define glGenFramebuffers MANGLE(GenFramebuffers)
+#define glGenLists MANGLE(GenLists)
+#define glGenNamesAMD MANGLE(GenNamesAMD)
+#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
+#define glGenPerfMonitorsAMD MANGLE(GenPerfMonitorsAMD)
+#define glGenProgramPipelines MANGLE(GenProgramPipelines)
+#define glGenProgramsARB MANGLE(GenProgramsARB)
+#define glGenProgramsNV MANGLE(GenProgramsNV)
+#define glGenQueriesARB MANGLE(GenQueriesARB)
+#define glGenQueries MANGLE(GenQueries)
+#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
+#define glGenRenderbuffers MANGLE(GenRenderbuffers)
+#define glGenSamplers MANGLE(GenSamplers)
+#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
+#define glGenTexturesEXT MANGLE(GenTexturesEXT)
+#define glGenTextures MANGLE(GenTextures)
+#define glGenTransformFeedbacks MANGLE(GenTransformFeedbacks)
+#define glGenTransformFeedbacksNV MANGLE(GenTransformFeedbacksNV)
+#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
+#define glGenVertexArrays MANGLE(GenVertexArrays)
+#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
+#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
+#define glGetActiveAttrib MANGLE(GetActiveAttrib)
+#define glGetActiveSubroutineName MANGLE(GetActiveSubroutineName)
+#define glGetActiveSubroutineUniformiv MANGLE(GetActiveSubroutineUniformiv)
+#define glGetActiveSubroutineUniformName MANGLE(GetActiveSubroutineUniformName)
+#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
+#define glGetActiveUniformBlockiv MANGLE(GetActiveUniformBlockiv)
+#define glGetActiveUniformBlockName MANGLE(GetActiveUniformBlockName)
+#define glGetActiveUniform MANGLE(GetActiveUniform)
+#define glGetActiveUniformName MANGLE(GetActiveUniformName)
+#define glGetActiveUniformsiv MANGLE(GetActiveUniformsiv)
+#define glGetActiveVaryingNV MANGLE(GetActiveVaryingNV)
+#define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI)
+#define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI)
+#define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB)
+#define glGetAttachedShaders MANGLE(GetAttachedShaders)
+#define glGetAttribLocationARB MANGLE(GetAttribLocationARB)
+#define glGetAttribLocation MANGLE(GetAttribLocation)
+#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT)
+#define glGetBooleani_v MANGLE(GetBooleani_v)
+#define glGetBooleanv MANGLE(GetBooleanv)
+#define glGetBufferParameteri64v MANGLE(GetBufferParameteri64v)
+#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
+#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
+#define glGetBufferParameterui64vNV MANGLE(GetBufferParameterui64vNV)
+#define glGetBufferPointervARB MANGLE(GetBufferPointervARB)
+#define glGetBufferPointerv MANGLE(GetBufferPointerv)
+#define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB)
+#define glGetBufferSubData MANGLE(GetBufferSubData)
+#define glGetClipPlane MANGLE(GetClipPlane)
+#define glGetColorTableEXT MANGLE(GetColorTableEXT)
+#define glGetColorTable MANGLE(GetColorTable)
+#define glGetColorTableParameterfvEXT MANGLE(GetColorTableParameterfvEXT)
+#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv)
+#define glGetColorTableParameterfvSGI MANGLE(GetColorTableParameterfvSGI)
+#define glGetColorTableParameterivEXT MANGLE(GetColorTableParameterivEXT)
+#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv)
+#define glGetColorTableParameterivSGI MANGLE(GetColorTableParameterivSGI)
+#define glGetColorTableSGI MANGLE(GetColorTableSGI)
+#define glGetCombinerInputParameterfvNV MANGLE(GetCombinerInputParameterfvNV)
+#define glGetCombinerInputParameterivNV MANGLE(GetCombinerInputParameterivNV)
+#define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV)
+#define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV)
+#define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV)
+#define glGetCompressedMultiTexImageEXT MANGLE(GetCompressedMultiTexImageEXT)
+#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB)
+#define glGetCompressedTexImage MANGLE(GetCompressedTexImage)
+#define glGetCompressedTextureImageEXT MANGLE(GetCompressedTextureImageEXT)
+#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT)
+#define glGetConvolutionFilter MANGLE(GetConvolutionFilter)
+#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT)
+#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv)
+#define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT)
+#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv)
+#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA)
+#define glGetDebugLogMESA MANGLE(GetDebugLogMESA)
+#define glGetDebugMessageLogAMD MANGLE(GetDebugMessageLogAMD)
+#define glGetDebugMessageLogARB MANGLE(GetDebugMessageLogARB)
+#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS)
+#define glGetDoubleIndexedvEXT MANGLE(GetDoubleIndexedvEXT)
+#define glGetDoublei_v MANGLE(GetDoublei_v)
+#define glGetDoublev MANGLE(GetDoublev)
+#define glGetError MANGLE(GetError)
+#define glGetFenceivNV MANGLE(GetFenceivNV)
+#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV)
+#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
+#define glGetFloatIndexedvEXT MANGLE(GetFloatIndexedvEXT)
+#define glGetFloati_v MANGLE(GetFloati_v)
+#define glGetFloatv MANGLE(GetFloatv)
+#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
+#define glGetFragDataIndex MANGLE(GetFragDataIndex)
+#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
+#define glGetFragDataLocation MANGLE(GetFragDataLocation)
+#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
+#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX)
+#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX)
+#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX)
+#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
+#define glGetFramebufferAttachmentParameteriv MANGLE(GetFramebufferAttachmentParameteriv)
+#define glGetFramebufferParameterivEXT MANGLE(GetFramebufferParameterivEXT)
+#define glGetGraphicsResetStatusARB MANGLE(GetGraphicsResetStatusARB)
+#define glGetHandleARB MANGLE(GetHandleARB)
+#define glGetHistogramEXT MANGLE(GetHistogramEXT)
+#define glGetHistogram MANGLE(GetHistogram)
+#define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT)
+#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv)
+#define glGetHistogramParameterivEXT MANGLE(GetHistogramParameterivEXT)
+#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv)
+#define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP)
+#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP)
+#define glGetInfoLogARB MANGLE(GetInfoLogARB)
+#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX)
+#define glGetInteger64i_v MANGLE(GetInteger64i_v)
+#define glGetInteger64v MANGLE(GetInteger64v)
+#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT)
+#define glGetIntegeri_v MANGLE(GetIntegeri_v)
+#define glGetIntegerui64i_vNV MANGLE(GetIntegerui64i_vNV)
+#define glGetIntegerui64vNV MANGLE(GetIntegerui64vNV)
+#define glGetIntegerv MANGLE(GetIntegerv)
+#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT)
+#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT)
+#define glGetInvariantIntegervEXT MANGLE(GetInvariantIntegervEXT)
+#define glGetLightfv MANGLE(GetLightfv)
+#define glGetLightiv MANGLE(GetLightiv)
+#define glGetListParameterfvSGIX MANGLE(GetListParameterfvSGIX)
+#define glGetListParameterivSGIX MANGLE(GetListParameterivSGIX)
+#define glGetLocalConstantBooleanvEXT MANGLE(GetLocalConstantBooleanvEXT)
+#define glGetLocalConstantFloatvEXT MANGLE(GetLocalConstantFloatvEXT)
+#define glGetLocalConstantIntegervEXT MANGLE(GetLocalConstantIntegervEXT)
+#define glGetMapAttribParameterfvNV MANGLE(GetMapAttribParameterfvNV)
+#define glGetMapAttribParameterivNV MANGLE(GetMapAttribParameterivNV)
+#define glGetMapControlPointsNV MANGLE(GetMapControlPointsNV)
+#define glGetMapdv MANGLE(GetMapdv)
+#define glGetMapfv MANGLE(GetMapfv)
+#define glGetMapiv MANGLE(GetMapiv)
+#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV)
+#define glGetMapParameterivNV MANGLE(GetMapParameterivNV)
+#define glGetMaterialfv MANGLE(GetMaterialfv)
+#define glGetMaterialiv MANGLE(GetMaterialiv)
+#define glGetMinmaxEXT MANGLE(GetMinmaxEXT)
+#define glGetMinmax MANGLE(GetMinmax)
+#define glGetMinmaxParameterfvEXT MANGLE(GetMinmaxParameterfvEXT)
+#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv)
+#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT)
+#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv)
+#define glGetMultisamplefv MANGLE(GetMultisamplefv)
+#define glGetMultisamplefvNV MANGLE(GetMultisamplefvNV)
+#define glGetMultiTexEnvfvEXT MANGLE(GetMultiTexEnvfvEXT)
+#define glGetMultiTexEnvivEXT MANGLE(GetMultiTexEnvivEXT)
+#define glGetMultiTexGendvEXT MANGLE(GetMultiTexGendvEXT)
+#define glGetMultiTexGenfvEXT MANGLE(GetMultiTexGenfvEXT)
+#define glGetMultiTexGenivEXT MANGLE(GetMultiTexGenivEXT)
+#define glGetMultiTexImageEXT MANGLE(GetMultiTexImageEXT)
+#define glGetMultiTexLevelParameterfvEXT MANGLE(GetMultiTexLevelParameterfvEXT)
+#define glGetMultiTexLevelParameterivEXT MANGLE(GetMultiTexLevelParameterivEXT)
+#define glGetMultiTexParameterfvEXT MANGLE(GetMultiTexParameterfvEXT)
+#define glGetMultiTexParameterIivEXT MANGLE(GetMultiTexParameterIivEXT)
+#define glGetMultiTexParameterIuivEXT MANGLE(GetMultiTexParameterIuivEXT)
+#define glGetMultiTexParameterivEXT MANGLE(GetMultiTexParameterivEXT)
+#define glGetNamedBufferParameterivEXT MANGLE(GetNamedBufferParameterivEXT)
+#define glGetNamedBufferParameterui64vNV MANGLE(GetNamedBufferParameterui64vNV)
+#define glGetNamedBufferPointervEXT MANGLE(GetNamedBufferPointervEXT)
+#define glGetNamedBufferSubDataEXT MANGLE(GetNamedBufferSubDataEXT)
+#define glGetNamedFramebufferAttachmentParameterivEXT MANGLE(GetNamedFramebufferAttachmentParameterivEXT)
+#define glGetNamedProgramivEXT MANGLE(GetNamedProgramivEXT)
+#define glGetNamedProgramLocalParameterdvEXT MANGLE(GetNamedProgramLocalParameterdvEXT)
+#define glGetNamedProgramLocalParameterfvEXT MANGLE(GetNamedProgramLocalParameterfvEXT)
+#define glGetNamedProgramLocalParameterIivEXT MANGLE(GetNamedProgramLocalParameterIivEXT)
+#define glGetNamedProgramLocalParameterIuivEXT MANGLE(GetNamedProgramLocalParameterIuivEXT)
+#define glGetNamedProgramStringEXT MANGLE(GetNamedProgramStringEXT)
+#define glGetNamedRenderbufferParameterivEXT MANGLE(GetNamedRenderbufferParameterivEXT)
+#define glGetNamedStringARB MANGLE(GetNamedStringARB)
+#define glGetNamedStringivARB MANGLE(GetNamedStringivARB)
+#define glGetnColorTableARB MANGLE(GetnColorTableARB)
+#define glGetnCompressedTexImageARB MANGLE(GetnCompressedTexImageARB)
+#define glGetnConvolutionFilterARB MANGLE(GetnConvolutionFilterARB)
+#define glGetnHistogramARB MANGLE(GetnHistogramARB)
+#define glGetnMapdvARB MANGLE(GetnMapdvARB)
+#define glGetnMapfvARB MANGLE(GetnMapfvARB)
+#define glGetnMapivARB MANGLE(GetnMapivARB)
+#define glGetnMinmaxARB MANGLE(GetnMinmaxARB)
+#define glGetnPixelMapfvARB MANGLE(GetnPixelMapfvARB)
+#define glGetnPixelMapuivARB MANGLE(GetnPixelMapuivARB)
+#define glGetnPixelMapusvARB MANGLE(GetnPixelMapusvARB)
+#define glGetnPolygonStippleARB MANGLE(GetnPolygonStippleARB)
+#define glGetnSeparableFilterARB MANGLE(GetnSeparableFilterARB)
+#define glGetnTexImageARB MANGLE(GetnTexImageARB)
+#define glGetnUniformdvARB MANGLE(GetnUniformdvARB)
+#define glGetnUniformfvARB MANGLE(GetnUniformfvARB)
+#define glGetnUniformivARB MANGLE(GetnUniformivARB)
+#define glGetnUniformuivARB MANGLE(GetnUniformuivARB)
+#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
+#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
+#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
+#define glGetObjectParameterivAPPLE MANGLE(GetObjectParameterivAPPLE)
+#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB)
+#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV)
+#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV)
+#define glGetPerfMonitorCounterDataAMD MANGLE(GetPerfMonitorCounterDataAMD)
+#define glGetPerfMonitorCounterInfoAMD MANGLE(GetPerfMonitorCounterInfoAMD)
+#define glGetPerfMonitorCountersAMD MANGLE(GetPerfMonitorCountersAMD)
+#define glGetPerfMonitorCounterStringAMD MANGLE(GetPerfMonitorCounterStringAMD)
+#define glGetPerfMonitorGroupsAMD MANGLE(GetPerfMonitorGroupsAMD)
+#define glGetPerfMonitorGroupStringAMD MANGLE(GetPerfMonitorGroupStringAMD)
+#define glGetPixelMapfv MANGLE(GetPixelMapfv)
+#define glGetPixelMapuiv MANGLE(GetPixelMapuiv)
+#define glGetPixelMapusv MANGLE(GetPixelMapusv)
+#define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS)
+#define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS)
+#define glGetPointerIndexedvEXT MANGLE(GetPointerIndexedvEXT)
+#define glGetPointervEXT MANGLE(GetPointervEXT)
+#define glGetPointerv MANGLE(GetPointerv)
+#define glGetPolygonStipple MANGLE(GetPolygonStipple)
+#define glGetProgramBinary MANGLE(GetProgramBinary)
+#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
+#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
+#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV)
+#define glGetProgramEnvParameterIuivNV MANGLE(GetProgramEnvParameterIuivNV)
+#define glGetProgramInfoLog MANGLE(GetProgramInfoLog)
+#define glGetProgramivARB MANGLE(GetProgramivARB)
+#define glGetProgramiv MANGLE(GetProgramiv)
+#define glGetProgramivNV MANGLE(GetProgramivNV)
+#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB)
+#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB)
+#define glGetProgramLocalParameterIivNV MANGLE(GetProgramLocalParameterIivNV)
+#define glGetProgramLocalParameterIuivNV MANGLE(GetProgramLocalParameterIuivNV)
+#define glGetProgramNamedParameterdvNV MANGLE(GetProgramNamedParameterdvNV)
+#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
+#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
+#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
+#define glGetProgramPipelineInfoLog MANGLE(GetProgramPipelineInfoLog)
+#define glGetProgramPipelineiv MANGLE(GetProgramPipelineiv)
+#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
+#define glGetProgramStageiv MANGLE(GetProgramStageiv)
+#define glGetProgramStringARB MANGLE(GetProgramStringARB)
+#define glGetProgramStringNV MANGLE(GetProgramStringNV)
+#define glGetProgramSubroutineParameteruivNV MANGLE(GetProgramSubroutineParameteruivNV)
+#define glGetQueryIndexediv MANGLE(GetQueryIndexediv)
+#define glGetQueryivARB MANGLE(GetQueryivARB)
+#define glGetQueryiv MANGLE(GetQueryiv)
+#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT)
+#define glGetQueryObjecti64v MANGLE(GetQueryObjecti64v)
+#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
+#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
+#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT)
+#define glGetQueryObjectui64v MANGLE(GetQueryObjectui64v)
+#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
+#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
+#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
+#define glGetRenderbufferParameteriv MANGLE(GetRenderbufferParameteriv)
+#define glGetSamplerParameterfv MANGLE(GetSamplerParameterfv)
+#define glGetSamplerParameterIiv MANGLE(GetSamplerParameterIiv)
+#define glGetSamplerParameterIuiv MANGLE(GetSamplerParameterIuiv)
+#define glGetSamplerParameteriv MANGLE(GetSamplerParameteriv)
+#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
+#define glGetSeparableFilter MANGLE(GetSeparableFilter)
+#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
+#define glGetShaderiv MANGLE(GetShaderiv)
+#define glGetShaderPrecisionFormat MANGLE(GetShaderPrecisionFormat)
+#define glGetShaderSourceARB MANGLE(GetShaderSourceARB)
+#define glGetShaderSource MANGLE(GetShaderSource)
+#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
+#define glGetStringi MANGLE(GetStringi)
+#define glGetString MANGLE(GetString)
+#define glGetSubroutineIndex MANGLE(GetSubroutineIndex)
+#define glGetSubroutineUniformLocation MANGLE(GetSubroutineUniformLocation)
+#define glGetSynciv MANGLE(GetSynciv)
+#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
+#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
+#define glGetTexEnvfv MANGLE(GetTexEnvfv)
+#define glGetTexEnviv MANGLE(GetTexEnviv)
+#define glGetTexFilterFuncSGIS MANGLE(GetTexFilterFuncSGIS)
+#define glGetTexGendv MANGLE(GetTexGendv)
+#define glGetTexGenfv MANGLE(GetTexGenfv)
+#define glGetTexGeniv MANGLE(GetTexGeniv)
+#define glGetTexImage MANGLE(GetTexImage)
+#define glGetTexLevelParameterfv MANGLE(GetTexLevelParameterfv)
+#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv)
+#define glGetTexParameterfv MANGLE(GetTexParameterfv)
+#define glGetTexParameterIivEXT MANGLE(GetTexParameterIivEXT)
+#define glGetTexParameterIiv MANGLE(GetTexParameterIiv)
+#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT)
+#define glGetTexParameterIuiv MANGLE(GetTexParameterIuiv)
+#define glGetTexParameteriv MANGLE(GetTexParameteriv)
+#define glGetTexParameterPointervAPPLE MANGLE(GetTexParameterPointervAPPLE)
+#define glGetTextureImageEXT MANGLE(GetTextureImageEXT)
+#define glGetTextureLevelParameterfvEXT MANGLE(GetTextureLevelParameterfvEXT)
+#define glGetTextureLevelParameterivEXT MANGLE(GetTextureLevelParameterivEXT)
+#define glGetTextureParameterfvEXT MANGLE(GetTextureParameterfvEXT)
+#define glGetTextureParameterIivEXT MANGLE(GetTextureParameterIivEXT)
+#define glGetTextureParameterIuivEXT MANGLE(GetTextureParameterIuivEXT)
+#define glGetTextureParameterivEXT MANGLE(GetTextureParameterivEXT)
+#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV)
+#define glGetTransformFeedbackVaryingEXT MANGLE(GetTransformFeedbackVaryingEXT)
+#define glGetTransformFeedbackVarying MANGLE(GetTransformFeedbackVarying)
+#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
+#define glGetUniformBlockIndex MANGLE(GetUniformBlockIndex)
+#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
+#define glGetUniformdv MANGLE(GetUniformdv)
+#define glGetUniformfvARB MANGLE(GetUniformfvARB)
+#define glGetUniformfv MANGLE(GetUniformfv)
+#define glGetUniformi64vNV MANGLE(GetUniformi64vNV)
+#define glGetUniformIndices MANGLE(GetUniformIndices)
+#define glGetUniformivARB MANGLE(GetUniformivARB)
+#define glGetUniformiv MANGLE(GetUniformiv)
+#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
+#define glGetUniformLocation MANGLE(GetUniformLocation)
+#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
+#define glGetUniformSubroutineuiv MANGLE(GetUniformSubroutineuiv)
+#define glGetUniformui64vNV MANGLE(GetUniformui64vNV)
+#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
+#define glGetUniformuiv MANGLE(GetUniformuiv)
+#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI)
+#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI)
+#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT)
+#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT)
+#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT)
+#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT)
+#define glGetVaryingLocationNV MANGLE(GetVaryingLocationNV)
+#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI)
+#define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI)
+#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB)
+#define glGetVertexAttribdv MANGLE(GetVertexAttribdv)
+#define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV)
+#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB)
+#define glGetVertexAttribfv MANGLE(GetVertexAttribfv)
+#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV)
+#define glGetVertexAttribIivEXT MANGLE(GetVertexAttribIivEXT)
+#define glGetVertexAttribIiv MANGLE(GetVertexAttribIiv)
+#define glGetVertexAttribIuivEXT MANGLE(GetVertexAttribIuivEXT)
+#define glGetVertexAttribIuiv MANGLE(GetVertexAttribIuiv)
+#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
+#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
+#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
+#define glGetVertexAttribLdvEXT MANGLE(GetVertexAttribLdvEXT)
+#define glGetVertexAttribLdv MANGLE(GetVertexAttribLdv)
+#define glGetVertexAttribLi64vNV MANGLE(GetVertexAttribLi64vNV)
+#define glGetVertexAttribLui64vNV MANGLE(GetVertexAttribLui64vNV)
+#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
+#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv)
+#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
+#define glGetVideoCaptureivNV MANGLE(GetVideoCaptureivNV)
+#define glGetVideoCaptureStreamdvNV MANGLE(GetVideoCaptureStreamdvNV)
+#define glGetVideoCaptureStreamfvNV MANGLE(GetVideoCaptureStreamfvNV)
+#define glGetVideoCaptureStreamivNV MANGLE(GetVideoCaptureStreamivNV)
+#define glGetVideoi64vNV MANGLE(GetVideoi64vNV)
+#define glGetVideoivNV MANGLE(GetVideoivNV)
+#define glGetVideoui64vNV MANGLE(GetVideoui64vNV)
+#define glGetVideouivNV MANGLE(GetVideouivNV)
+#define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN)
+#define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN)
+#define glGlobalAlphaFactorfSUN MANGLE(GlobalAlphaFactorfSUN)
+#define glGlobalAlphaFactoriSUN MANGLE(GlobalAlphaFactoriSUN)
+#define glGlobalAlphaFactorsSUN MANGLE(GlobalAlphaFactorsSUN)
+#define glGlobalAlphaFactorubSUN MANGLE(GlobalAlphaFactorubSUN)
+#define glGlobalAlphaFactoruiSUN MANGLE(GlobalAlphaFactoruiSUN)
+#define glGlobalAlphaFactorusSUN MANGLE(GlobalAlphaFactorusSUN)
+#define glHint MANGLE(Hint)
+#define glHintPGI MANGLE(HintPGI)
+#define glHistogramEXT MANGLE(HistogramEXT)
+#define glHistogram MANGLE(Histogram)
+#define glIglooInterfaceSGIX MANGLE(IglooInterfaceSGIX)
+#define glImageTransformParameterfHP MANGLE(ImageTransformParameterfHP)
+#define glImageTransformParameterfvHP MANGLE(ImageTransformParameterfvHP)
+#define glImageTransformParameteriHP MANGLE(ImageTransformParameteriHP)
+#define glImageTransformParameterivHP MANGLE(ImageTransformParameterivHP)
+#define glIndexd MANGLE(Indexd)
+#define glIndexdv MANGLE(Indexdv)
+#define glIndexf MANGLE(Indexf)
+#define glIndexFormatNV MANGLE(IndexFormatNV)
+#define glIndexFuncEXT MANGLE(IndexFuncEXT)
+#define glIndexfv MANGLE(Indexfv)
+#define glIndexi MANGLE(Indexi)
+#define glIndexiv MANGLE(Indexiv)
+#define glIndexMask MANGLE(IndexMask)
+#define glIndexMaterialEXT MANGLE(IndexMaterialEXT)
+#define glIndexPointerEXT MANGLE(IndexPointerEXT)
+#define glIndexPointerListIBM MANGLE(IndexPointerListIBM)
+#define glIndexPointer MANGLE(IndexPointer)
+#define glIndexs MANGLE(Indexs)
+#define glIndexsv MANGLE(Indexsv)
+#define glIndexub MANGLE(Indexub)
+#define glIndexubv MANGLE(Indexubv)
+#define glInitNames MANGLE(InitNames)
+#define glInsertComponentEXT MANGLE(InsertComponentEXT)
+#define glInstrumentsBufferSGIX MANGLE(InstrumentsBufferSGIX)
+#define glInterleavedArrays MANGLE(InterleavedArrays)
+#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX)
+#define glIsBufferARB MANGLE(IsBufferARB)
+#define glIsBuffer MANGLE(IsBuffer)
+#define glIsBufferResidentNV MANGLE(IsBufferResidentNV)
+#define glIsEnabledi MANGLE(IsEnabledi)
+#define glIsEnabledIndexedEXT MANGLE(IsEnabledIndexedEXT)
+#define glIsEnabled MANGLE(IsEnabled)
+#define glIsFenceAPPLE MANGLE(IsFenceAPPLE)
+#define glIsFenceNV MANGLE(IsFenceNV)
+#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
+#define glIsFramebuffer MANGLE(IsFramebuffer)
+#define glIsList MANGLE(IsList)
+#define glIsNameAMD MANGLE(IsNameAMD)
+#define glIsNamedBufferResidentNV MANGLE(IsNamedBufferResidentNV)
+#define glIsNamedStringARB MANGLE(IsNamedStringARB)
+#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
+#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
+#define glIsProgramARB MANGLE(IsProgramARB)
+#define glIsProgram MANGLE(IsProgram)
+#define glIsProgramNV MANGLE(IsProgramNV)
+#define glIsProgramPipeline MANGLE(IsProgramPipeline)
+#define glIsQueryARB MANGLE(IsQueryARB)
+#define glIsQuery MANGLE(IsQuery)
+#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
+#define glIsRenderbuffer MANGLE(IsRenderbuffer)
+#define glIsSampler MANGLE(IsSampler)
+#define glIsShader MANGLE(IsShader)
+#define glIsSync MANGLE(IsSync)
+#define glIsTextureEXT MANGLE(IsTextureEXT)
+#define glIsTexture MANGLE(IsTexture)
+#define glIsTransformFeedback MANGLE(IsTransformFeedback)
+#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV)
+#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
+#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
+#define glIsVertexArray MANGLE(IsVertexArray)
+#define glIsVertexAttribEnabledAPPLE MANGLE(IsVertexAttribEnabledAPPLE)
+#define glLightEnviSGIX MANGLE(LightEnviSGIX)
+#define glLightf MANGLE(Lightf)
+#define glLightfv MANGLE(Lightfv)
+#define glLighti MANGLE(Lighti)
+#define glLightiv MANGLE(Lightiv)
+#define glLightModelf MANGLE(LightModelf)
+#define glLightModelfv MANGLE(LightModelfv)
+#define glLightModeli MANGLE(LightModeli)
+#define glLightModeliv MANGLE(LightModeliv)
+#define glLineStipple MANGLE(LineStipple)
+#define glLineWidth MANGLE(LineWidth)
+#define glLinkProgramARB MANGLE(LinkProgramARB)
+#define glLinkProgram MANGLE(LinkProgram)
+#define glListBase MANGLE(ListBase)
+#define glListParameterfSGIX MANGLE(ListParameterfSGIX)
+#define glListParameterfvSGIX MANGLE(ListParameterfvSGIX)
+#define glListParameteriSGIX MANGLE(ListParameteriSGIX)
+#define glListParameterivSGIX MANGLE(ListParameterivSGIX)
+#define glLoadIdentityDeformationMapSGIX MANGLE(LoadIdentityDeformationMapSGIX)
+#define glLoadIdentity MANGLE(LoadIdentity)
+#define glLoadMatrixd MANGLE(LoadMatrixd)
+#define glLoadMatrixf MANGLE(LoadMatrixf)
+#define glLoadName MANGLE(LoadName)
+#define glLoadProgramNV MANGLE(LoadProgramNV)
+#define glLoadTransposeMatrixdARB MANGLE(LoadTransposeMatrixdARB)
+#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd)
+#define glLoadTransposeMatrixfARB MANGLE(LoadTransposeMatrixfARB)
+#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf)
+#define glLockArraysEXT MANGLE(LockArraysEXT)
+#define glLogicOp MANGLE(LogicOp)
+#define glMakeBufferNonResidentNV MANGLE(MakeBufferNonResidentNV)
+#define glMakeBufferResidentNV MANGLE(MakeBufferResidentNV)
+#define glMakeNamedBufferNonResidentNV MANGLE(MakeNamedBufferNonResidentNV)
+#define glMakeNamedBufferResidentNV MANGLE(MakeNamedBufferResidentNV)
+#define glMap1d MANGLE(Map1d)
+#define glMap1f MANGLE(Map1f)
+#define glMap2d MANGLE(Map2d)
+#define glMap2f MANGLE(Map2f)
+#define glMapBufferARB MANGLE(MapBufferARB)
+#define glMapBuffer MANGLE(MapBuffer)
+#define glMapBufferRange MANGLE(MapBufferRange)
+#define glMapControlPointsNV MANGLE(MapControlPointsNV)
+#define glMapGrid1d MANGLE(MapGrid1d)
+#define glMapGrid1f MANGLE(MapGrid1f)
+#define glMapGrid2d MANGLE(MapGrid2d)
+#define glMapGrid2f MANGLE(MapGrid2f)
+#define glMapNamedBufferEXT MANGLE(MapNamedBufferEXT)
+#define glMapNamedBufferRangeEXT MANGLE(MapNamedBufferRangeEXT)
+#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
+#define glMapParameterfvNV MANGLE(MapParameterfvNV)
+#define glMapParameterivNV MANGLE(MapParameterivNV)
+#define glMapVertexAttrib1dAPPLE MANGLE(MapVertexAttrib1dAPPLE)
+#define glMapVertexAttrib1fAPPLE MANGLE(MapVertexAttrib1fAPPLE)
+#define glMapVertexAttrib2dAPPLE MANGLE(MapVertexAttrib2dAPPLE)
+#define glMapVertexAttrib2fAPPLE MANGLE(MapVertexAttrib2fAPPLE)
+#define glMaterialf MANGLE(Materialf)
+#define glMaterialfv MANGLE(Materialfv)
+#define glMateriali MANGLE(Materiali)
+#define glMaterialiv MANGLE(Materialiv)
+#define glMatrixFrustumEXT MANGLE(MatrixFrustumEXT)
+#define glMatrixIndexPointerARB MANGLE(MatrixIndexPointerARB)
+#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB)
+#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB)
+#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB)
+#define glMatrixLoaddEXT MANGLE(MatrixLoaddEXT)
+#define glMatrixLoadfEXT MANGLE(MatrixLoadfEXT)
+#define glMatrixLoadIdentityEXT MANGLE(MatrixLoadIdentityEXT)
+#define glMatrixLoadTransposedEXT MANGLE(MatrixLoadTransposedEXT)
+#define glMatrixLoadTransposefEXT MANGLE(MatrixLoadTransposefEXT)
+#define glMatrixMode MANGLE(MatrixMode)
+#define glMatrixMultdEXT MANGLE(MatrixMultdEXT)
+#define glMatrixMultfEXT MANGLE(MatrixMultfEXT)
+#define glMatrixMultTransposedEXT MANGLE(MatrixMultTransposedEXT)
+#define glMatrixMultTransposefEXT MANGLE(MatrixMultTransposefEXT)
+#define glMatrixOrthoEXT MANGLE(MatrixOrthoEXT)
+#define glMatrixPopEXT MANGLE(MatrixPopEXT)
+#define glMatrixPushEXT MANGLE(MatrixPushEXT)
+#define glMatrixRotatedEXT MANGLE(MatrixRotatedEXT)
+#define glMatrixRotatefEXT MANGLE(MatrixRotatefEXT)
+#define glMatrixScaledEXT MANGLE(MatrixScaledEXT)
+#define glMatrixScalefEXT MANGLE(MatrixScalefEXT)
+#define glMatrixTranslatedEXT MANGLE(MatrixTranslatedEXT)
+#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT)
+#define glMemoryBarrierEXT MANGLE(MemoryBarrierEXT)
+#define glMinmaxEXT MANGLE(MinmaxEXT)
+#define glMinmax MANGLE(Minmax)
+#define glMinSampleShadingARB MANGLE(MinSampleShadingARB)
+#define glMinSampleShading MANGLE(MinSampleShading)
+#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
+#define glMultiDrawArrays MANGLE(MultiDrawArrays)
+#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE)
+#define glMultiDrawElementsBaseVertex MANGLE(MultiDrawElementsBaseVertex)
+#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT)
+#define glMultiDrawElements MANGLE(MultiDrawElements)
+#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE)
+#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM)
+#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM)
+#define glMultiTexBufferEXT MANGLE(MultiTexBufferEXT)
+#define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB)
+#define glMultiTexCoord1d MANGLE(MultiTexCoord1d)
+#define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB)
+#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv)
+#define glMultiTexCoord1fARB MANGLE(MultiTexCoord1fARB)
+#define glMultiTexCoord1f MANGLE(MultiTexCoord1f)
+#define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB)
+#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv)
+#define glMultiTexCoord1hNV MANGLE(MultiTexCoord1hNV)
+#define glMultiTexCoord1hvNV MANGLE(MultiTexCoord1hvNV)
+#define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB)
+#define glMultiTexCoord1i MANGLE(MultiTexCoord1i)
+#define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB)
+#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv)
+#define glMultiTexCoord1sARB MANGLE(MultiTexCoord1sARB)
+#define glMultiTexCoord1s MANGLE(MultiTexCoord1s)
+#define glMultiTexCoord1svARB MANGLE(MultiTexCoord1svARB)
+#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv)
+#define glMultiTexCoord2dARB MANGLE(MultiTexCoord2dARB)
+#define glMultiTexCoord2d MANGLE(MultiTexCoord2d)
+#define glMultiTexCoord2dvARB MANGLE(MultiTexCoord2dvARB)
+#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv)
+#define glMultiTexCoord2fARB MANGLE(MultiTexCoord2fARB)
+#define glMultiTexCoord2f MANGLE(MultiTexCoord2f)
+#define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB)
+#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv)
+#define glMultiTexCoord2hNV MANGLE(MultiTexCoord2hNV)
+#define glMultiTexCoord2hvNV MANGLE(MultiTexCoord2hvNV)
+#define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB)
+#define glMultiTexCoord2i MANGLE(MultiTexCoord2i)
+#define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB)
+#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv)
+#define glMultiTexCoord2sARB MANGLE(MultiTexCoord2sARB)
+#define glMultiTexCoord2s MANGLE(MultiTexCoord2s)
+#define glMultiTexCoord2svARB MANGLE(MultiTexCoord2svARB)
+#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv)
+#define glMultiTexCoord3dARB MANGLE(MultiTexCoord3dARB)
+#define glMultiTexCoord3d MANGLE(MultiTexCoord3d)
+#define glMultiTexCoord3dvARB MANGLE(MultiTexCoord3dvARB)
+#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv)
+#define glMultiTexCoord3fARB MANGLE(MultiTexCoord3fARB)
+#define glMultiTexCoord3f MANGLE(MultiTexCoord3f)
+#define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB)
+#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv)
+#define glMultiTexCoord3hNV MANGLE(MultiTexCoord3hNV)
+#define glMultiTexCoord3hvNV MANGLE(MultiTexCoord3hvNV)
+#define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB)
+#define glMultiTexCoord3i MANGLE(MultiTexCoord3i)
+#define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB)
+#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv)
+#define glMultiTexCoord3sARB MANGLE(MultiTexCoord3sARB)
+#define glMultiTexCoord3s MANGLE(MultiTexCoord3s)
+#define glMultiTexCoord3svARB MANGLE(MultiTexCoord3svARB)
+#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv)
+#define glMultiTexCoord4dARB MANGLE(MultiTexCoord4dARB)
+#define glMultiTexCoord4d MANGLE(MultiTexCoord4d)
+#define glMultiTexCoord4dvARB MANGLE(MultiTexCoord4dvARB)
+#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv)
+#define glMultiTexCoord4fARB MANGLE(MultiTexCoord4fARB)
+#define glMultiTexCoord4f MANGLE(MultiTexCoord4f)
+#define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB)
+#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv)
+#define glMultiTexCoord4hNV MANGLE(MultiTexCoord4hNV)
+#define glMultiTexCoord4hvNV MANGLE(MultiTexCoord4hvNV)
+#define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB)
+#define glMultiTexCoord4i MANGLE(MultiTexCoord4i)
+#define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB)
+#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv)
+#define glMultiTexCoord4sARB MANGLE(MultiTexCoord4sARB)
+#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
+#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
+#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
+#define glMultiTexCoordP1ui MANGLE(MultiTexCoordP1ui)
+#define glMultiTexCoordP1uiv MANGLE(MultiTexCoordP1uiv)
+#define glMultiTexCoordP2ui MANGLE(MultiTexCoordP2ui)
+#define glMultiTexCoordP2uiv MANGLE(MultiTexCoordP2uiv)
+#define glMultiTexCoordP3ui MANGLE(MultiTexCoordP3ui)
+#define glMultiTexCoordP3uiv MANGLE(MultiTexCoordP3uiv)
+#define glMultiTexCoordP4ui MANGLE(MultiTexCoordP4ui)
+#define glMultiTexCoordP4uiv MANGLE(MultiTexCoordP4uiv)
+#define glMultiTexCoordPointerEXT MANGLE(MultiTexCoordPointerEXT)
+#define glMultiTexEnvfEXT MANGLE(MultiTexEnvfEXT)
+#define glMultiTexEnvfvEXT MANGLE(MultiTexEnvfvEXT)
+#define glMultiTexEnviEXT MANGLE(MultiTexEnviEXT)
+#define glMultiTexEnvivEXT MANGLE(MultiTexEnvivEXT)
+#define glMultiTexGendEXT MANGLE(MultiTexGendEXT)
+#define glMultiTexGendvEXT MANGLE(MultiTexGendvEXT)
+#define glMultiTexGenfEXT MANGLE(MultiTexGenfEXT)
+#define glMultiTexGenfvEXT MANGLE(MultiTexGenfvEXT)
+#define glMultiTexGeniEXT MANGLE(MultiTexGeniEXT)
+#define glMultiTexGenivEXT MANGLE(MultiTexGenivEXT)
+#define glMultiTexImage1DEXT MANGLE(MultiTexImage1DEXT)
+#define glMultiTexImage2DEXT MANGLE(MultiTexImage2DEXT)
+#define glMultiTexImage3DEXT MANGLE(MultiTexImage3DEXT)
+#define glMultiTexParameterfEXT MANGLE(MultiTexParameterfEXT)
+#define glMultiTexParameterfvEXT MANGLE(MultiTexParameterfvEXT)
+#define glMultiTexParameteriEXT MANGLE(MultiTexParameteriEXT)
+#define glMultiTexParameterIivEXT MANGLE(MultiTexParameterIivEXT)
+#define glMultiTexParameterIuivEXT MANGLE(MultiTexParameterIuivEXT)
+#define glMultiTexParameterivEXT MANGLE(MultiTexParameterivEXT)
+#define glMultiTexRenderbufferEXT MANGLE(MultiTexRenderbufferEXT)
+#define glMultiTexSubImage1DEXT MANGLE(MultiTexSubImage1DEXT)
+#define glMultiTexSubImage2DEXT MANGLE(MultiTexSubImage2DEXT)
+#define glMultiTexSubImage3DEXT MANGLE(MultiTexSubImage3DEXT)
+#define glMultMatrixd MANGLE(MultMatrixd)
+#define glMultMatrixf MANGLE(MultMatrixf)
+#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB)
+#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd)
+#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB)
+#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
+#define glNamedBufferDataEXT MANGLE(NamedBufferDataEXT)
+#define glNamedBufferSubDataEXT MANGLE(NamedBufferSubDataEXT)
+#define glNamedCopyBufferSubDataEXT MANGLE(NamedCopyBufferSubDataEXT)
+#define glNamedFramebufferRenderbufferEXT MANGLE(NamedFramebufferRenderbufferEXT)
+#define glNamedFramebufferTexture1DEXT MANGLE(NamedFramebufferTexture1DEXT)
+#define glNamedFramebufferTexture2DEXT MANGLE(NamedFramebufferTexture2DEXT)
+#define glNamedFramebufferTexture3DEXT MANGLE(NamedFramebufferTexture3DEXT)
+#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT)
+#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT)
+#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT)
+#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT)
+#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT)
+#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT)
+#define glNamedProgramLocalParameter4fvEXT MANGLE(NamedProgramLocalParameter4fvEXT)
+#define glNamedProgramLocalParameterI4iEXT MANGLE(NamedProgramLocalParameterI4iEXT)
+#define glNamedProgramLocalParameterI4ivEXT MANGLE(NamedProgramLocalParameterI4ivEXT)
+#define glNamedProgramLocalParameterI4uiEXT MANGLE(NamedProgramLocalParameterI4uiEXT)
+#define glNamedProgramLocalParameterI4uivEXT MANGLE(NamedProgramLocalParameterI4uivEXT)
+#define glNamedProgramLocalParameters4fvEXT MANGLE(NamedProgramLocalParameters4fvEXT)
+#define glNamedProgramLocalParametersI4ivEXT MANGLE(NamedProgramLocalParametersI4ivEXT)
+#define glNamedProgramLocalParametersI4uivEXT MANGLE(NamedProgramLocalParametersI4uivEXT)
+#define glNamedProgramStringEXT MANGLE(NamedProgramStringEXT)
+#define glNamedRenderbufferStorageEXT MANGLE(NamedRenderbufferStorageEXT)
+#define glNamedRenderbufferStorageMultisampleCoverageEXT MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT)
+#define glNamedRenderbufferStorageMultisampleEXT MANGLE(NamedRenderbufferStorageMultisampleEXT)
+#define glNamedStringARB MANGLE(NamedStringARB)
+#define glNewList MANGLE(NewList)
+#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
+#define glNormal3b MANGLE(Normal3b)
+#define glNormal3bv MANGLE(Normal3bv)
+#define glNormal3d MANGLE(Normal3d)
+#define glNormal3dv MANGLE(Normal3dv)
+#define glNormal3f MANGLE(Normal3f)
+#define glNormal3fVertex3fSUN MANGLE(Normal3fVertex3fSUN)
+#define glNormal3fVertex3fvSUN MANGLE(Normal3fVertex3fvSUN)
+#define glNormal3fv MANGLE(Normal3fv)
+#define glNormal3hNV MANGLE(Normal3hNV)
+#define glNormal3hvNV MANGLE(Normal3hvNV)
+#define glNormal3i MANGLE(Normal3i)
+#define glNormal3iv MANGLE(Normal3iv)
+#define glNormal3s MANGLE(Normal3s)
+#define glNormal3sv MANGLE(Normal3sv)
+#define glNormalFormatNV MANGLE(NormalFormatNV)
+#define glNormalP3ui MANGLE(NormalP3ui)
+#define glNormalP3uiv MANGLE(NormalP3uiv)
+#define glNormalPointerEXT MANGLE(NormalPointerEXT)
+#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
+#define glNormalPointer MANGLE(NormalPointer)
+#define glNormalPointervINTEL MANGLE(NormalPointervINTEL)
+#define glNormalStream3bATI MANGLE(NormalStream3bATI)
+#define glNormalStream3bvATI MANGLE(NormalStream3bvATI)
+#define glNormalStream3dATI MANGLE(NormalStream3dATI)
+#define glNormalStream3dvATI MANGLE(NormalStream3dvATI)
+#define glNormalStream3fATI MANGLE(NormalStream3fATI)
+#define glNormalStream3fvATI MANGLE(NormalStream3fvATI)
+#define glNormalStream3iATI MANGLE(NormalStream3iATI)
+#define glNormalStream3ivATI MANGLE(NormalStream3ivATI)
+#define glNormalStream3sATI MANGLE(NormalStream3sATI)
+#define glNormalStream3svATI MANGLE(NormalStream3svATI)
+#define glObjectPurgeableAPPLE MANGLE(ObjectPurgeableAPPLE)
+#define glObjectUnpurgeableAPPLE MANGLE(ObjectUnpurgeableAPPLE)
+#define glOrtho MANGLE(Ortho)
+#define glPassTexCoordATI MANGLE(PassTexCoordATI)
+#define glPassThrough MANGLE(PassThrough)
+#define glPatchParameterfv MANGLE(PatchParameterfv)
+#define glPatchParameteri MANGLE(PatchParameteri)
+#define glPauseTransformFeedback MANGLE(PauseTransformFeedback)
+#define glPauseTransformFeedbackNV MANGLE(PauseTransformFeedbackNV)
+#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
+#define glPixelMapfv MANGLE(PixelMapfv)
+#define glPixelMapuiv MANGLE(PixelMapuiv)
+#define glPixelMapusv MANGLE(PixelMapusv)
+#define glPixelStoref MANGLE(PixelStoref)
+#define glPixelStorei MANGLE(PixelStorei)
+#define glPixelTexGenParameterfSGIS MANGLE(PixelTexGenParameterfSGIS)
+#define glPixelTexGenParameterfvSGIS MANGLE(PixelTexGenParameterfvSGIS)
+#define glPixelTexGenParameteriSGIS MANGLE(PixelTexGenParameteriSGIS)
+#define glPixelTexGenParameterivSGIS MANGLE(PixelTexGenParameterivSGIS)
+#define glPixelTexGenSGIX MANGLE(PixelTexGenSGIX)
+#define glPixelTransferf MANGLE(PixelTransferf)
+#define glPixelTransferi MANGLE(PixelTransferi)
+#define glPixelTransformParameterfEXT MANGLE(PixelTransformParameterfEXT)
+#define glPixelTransformParameterfvEXT MANGLE(PixelTransformParameterfvEXT)
+#define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT)
+#define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT)
+#define glPixelZoom MANGLE(PixelZoom)
+#define glPNTrianglesfATI MANGLE(PNTrianglesfATI)
+#define glPNTrianglesiATI MANGLE(PNTrianglesiATI)
+#define glPointParameterfARB MANGLE(PointParameterfARB)
+#define glPointParameterfEXT MANGLE(PointParameterfEXT)
+#define glPointParameterf MANGLE(PointParameterf)
+#define glPointParameterfSGIS MANGLE(PointParameterfSGIS)
+#define glPointParameterfvARB MANGLE(PointParameterfvARB)
+#define glPointParameterfvEXT MANGLE(PointParameterfvEXT)
+#define glPointParameterfv MANGLE(PointParameterfv)
+#define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS)
+#define glPointParameteri MANGLE(PointParameteri)
+#define glPointParameteriNV MANGLE(PointParameteriNV)
+#define glPointParameteriv MANGLE(PointParameteriv)
+#define glPointParameterivNV MANGLE(PointParameterivNV)
+#define glPointSize MANGLE(PointSize)
+#define glPollAsyncSGIX MANGLE(PollAsyncSGIX)
+#define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX)
+#define glPolygonMode MANGLE(PolygonMode)
+#define glPolygonOffsetEXT MANGLE(PolygonOffsetEXT)
+#define glPolygonOffset MANGLE(PolygonOffset)
+#define glPolygonStipple MANGLE(PolygonStipple)
+#define glPopAttrib MANGLE(PopAttrib)
+#define glPopClientAttrib MANGLE(PopClientAttrib)
+#define glPopMatrix MANGLE(PopMatrix)
+#define glPopName MANGLE(PopName)
+#define glPresentFrameDualFillNV MANGLE(PresentFrameDualFillNV)
+#define glPresentFrameKeyedNV MANGLE(PresentFrameKeyedNV)
+#define glPrimitiveRestartIndex MANGLE(PrimitiveRestartIndex)
+#define glPrimitiveRestartIndexNV MANGLE(PrimitiveRestartIndexNV)
+#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
+#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
+#define glPrioritizeTextures MANGLE(PrioritizeTextures)
+#define glProgramBinary MANGLE(ProgramBinary)
+#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV)
+#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV)
+#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV)
+#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA)
+#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB)
+#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB)
+#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB)
+#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB)
+#define glProgramEnvParameterI4iNV MANGLE(ProgramEnvParameterI4iNV)
+#define glProgramEnvParameterI4ivNV MANGLE(ProgramEnvParameterI4ivNV)
+#define glProgramEnvParameterI4uiNV MANGLE(ProgramEnvParameterI4uiNV)
+#define glProgramEnvParameterI4uivNV MANGLE(ProgramEnvParameterI4uivNV)
+#define glProgramEnvParameters4fvEXT MANGLE(ProgramEnvParameters4fvEXT)
+#define glProgramEnvParametersI4ivNV MANGLE(ProgramEnvParametersI4ivNV)
+#define glProgramEnvParametersI4uivNV MANGLE(ProgramEnvParametersI4uivNV)
+#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB)
+#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB)
+#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB)
+#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB)
+#define glProgramLocalParameterI4iNV MANGLE(ProgramLocalParameterI4iNV)
+#define glProgramLocalParameterI4ivNV MANGLE(ProgramLocalParameterI4ivNV)
+#define glProgramLocalParameterI4uiNV MANGLE(ProgramLocalParameterI4uiNV)
+#define glProgramLocalParameterI4uivNV MANGLE(ProgramLocalParameterI4uivNV)
+#define glProgramLocalParameters4fvEXT MANGLE(ProgramLocalParameters4fvEXT)
+#define glProgramLocalParametersI4ivNV MANGLE(ProgramLocalParametersI4ivNV)
+#define glProgramLocalParametersI4uivNV MANGLE(ProgramLocalParametersI4uivNV)
+#define glProgramNamedParameter4dNV MANGLE(ProgramNamedParameter4dNV)
+#define glProgramNamedParameter4dvNV MANGLE(ProgramNamedParameter4dvNV)
+#define glProgramNamedParameter4fNV MANGLE(ProgramNamedParameter4fNV)
+#define glProgramNamedParameter4fvNV MANGLE(ProgramNamedParameter4fvNV)
+#define glProgramParameter4dNV MANGLE(ProgramParameter4dNV)
+#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV)
+#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV)
+#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
+#define glProgramParameteriARB MANGLE(ProgramParameteriARB)
+#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT)
+#define glProgramParameteri MANGLE(ProgramParameteri)
+#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
+#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
+#define glProgramStringARB MANGLE(ProgramStringARB)
+#define glProgramSubroutineParametersuivNV MANGLE(ProgramSubroutineParametersuivNV)
+#define glProgramUniform1dEXT MANGLE(ProgramUniform1dEXT)
+#define glProgramUniform1d MANGLE(ProgramUniform1d)
+#define glProgramUniform1dvEXT MANGLE(ProgramUniform1dvEXT)
+#define glProgramUniform1dv MANGLE(ProgramUniform1dv)
+#define glProgramUniform1fEXT MANGLE(ProgramUniform1fEXT)
+#define glProgramUniform1f MANGLE(ProgramUniform1f)
+#define glProgramUniform1fvEXT MANGLE(ProgramUniform1fvEXT)
+#define glProgramUniform1fv MANGLE(ProgramUniform1fv)
+#define glProgramUniform1i64NV MANGLE(ProgramUniform1i64NV)
+#define glProgramUniform1i64vNV MANGLE(ProgramUniform1i64vNV)
+#define glProgramUniform1iEXT MANGLE(ProgramUniform1iEXT)
+#define glProgramUniform1i MANGLE(ProgramUniform1i)
+#define glProgramUniform1ivEXT MANGLE(ProgramUniform1ivEXT)
+#define glProgramUniform1iv MANGLE(ProgramUniform1iv)
+#define glProgramUniform1ui64NV MANGLE(ProgramUniform1ui64NV)
+#define glProgramUniform1ui64vNV MANGLE(ProgramUniform1ui64vNV)
+#define glProgramUniform1uiEXT MANGLE(ProgramUniform1uiEXT)
+#define glProgramUniform1ui MANGLE(ProgramUniform1ui)
+#define glProgramUniform1uivEXT MANGLE(ProgramUniform1uivEXT)
+#define glProgramUniform1uiv MANGLE(ProgramUniform1uiv)
+#define glProgramUniform2dEXT MANGLE(ProgramUniform2dEXT)
+#define glProgramUniform2d MANGLE(ProgramUniform2d)
+#define glProgramUniform2dvEXT MANGLE(ProgramUniform2dvEXT)
+#define glProgramUniform2dv MANGLE(ProgramUniform2dv)
+#define glProgramUniform2fEXT MANGLE(ProgramUniform2fEXT)
+#define glProgramUniform2f MANGLE(ProgramUniform2f)
+#define glProgramUniform2fvEXT MANGLE(ProgramUniform2fvEXT)
+#define glProgramUniform2fv MANGLE(ProgramUniform2fv)
+#define glProgramUniform2i64NV MANGLE(ProgramUniform2i64NV)
+#define glProgramUniform2i64vNV MANGLE(ProgramUniform2i64vNV)
+#define glProgramUniform2iEXT MANGLE(ProgramUniform2iEXT)
+#define glProgramUniform2i MANGLE(ProgramUniform2i)
+#define glProgramUniform2ivEXT MANGLE(ProgramUniform2ivEXT)
+#define glProgramUniform2iv MANGLE(ProgramUniform2iv)
+#define glProgramUniform2ui64NV MANGLE(ProgramUniform2ui64NV)
+#define glProgramUniform2ui64vNV MANGLE(ProgramUniform2ui64vNV)
+#define glProgramUniform2uiEXT MANGLE(ProgramUniform2uiEXT)
+#define glProgramUniform2ui MANGLE(ProgramUniform2ui)
+#define glProgramUniform2uivEXT MANGLE(ProgramUniform2uivEXT)
+#define glProgramUniform2uiv MANGLE(ProgramUniform2uiv)
+#define glProgramUniform3dEXT MANGLE(ProgramUniform3dEXT)
+#define glProgramUniform3d MANGLE(ProgramUniform3d)
+#define glProgramUniform3dvEXT MANGLE(ProgramUniform3dvEXT)
+#define glProgramUniform3dv MANGLE(ProgramUniform3dv)
+#define glProgramUniform3fEXT MANGLE(ProgramUniform3fEXT)
+#define glProgramUniform3f MANGLE(ProgramUniform3f)
+#define glProgramUniform3fvEXT MANGLE(ProgramUniform3fvEXT)
+#define glProgramUniform3fv MANGLE(ProgramUniform3fv)
+#define glProgramUniform3i64NV MANGLE(ProgramUniform3i64NV)
+#define glProgramUniform3i64vNV MANGLE(ProgramUniform3i64vNV)
+#define glProgramUniform3iEXT MANGLE(ProgramUniform3iEXT)
+#define glProgramUniform3i MANGLE(ProgramUniform3i)
+#define glProgramUniform3ivEXT MANGLE(ProgramUniform3ivEXT)
+#define glProgramUniform3iv MANGLE(ProgramUniform3iv)
+#define glProgramUniform3ui64NV MANGLE(ProgramUniform3ui64NV)
+#define glProgramUniform3ui64vNV MANGLE(ProgramUniform3ui64vNV)
+#define glProgramUniform3uiEXT MANGLE(ProgramUniform3uiEXT)
+#define glProgramUniform3ui MANGLE(ProgramUniform3ui)
+#define glProgramUniform3uivEXT MANGLE(ProgramUniform3uivEXT)
+#define glProgramUniform3uiv MANGLE(ProgramUniform3uiv)
+#define glProgramUniform4dEXT MANGLE(ProgramUniform4dEXT)
+#define glProgramUniform4d MANGLE(ProgramUniform4d)
+#define glProgramUniform4dvEXT MANGLE(ProgramUniform4dvEXT)
+#define glProgramUniform4dv MANGLE(ProgramUniform4dv)
+#define glProgramUniform4fEXT MANGLE(ProgramUniform4fEXT)
+#define glProgramUniform4f MANGLE(ProgramUniform4f)
+#define glProgramUniform4fvEXT MANGLE(ProgramUniform4fvEXT)
+#define glProgramUniform4fv MANGLE(ProgramUniform4fv)
+#define glProgramUniform4i64NV MANGLE(ProgramUniform4i64NV)
+#define glProgramUniform4i64vNV MANGLE(ProgramUniform4i64vNV)
+#define glProgramUniform4iEXT MANGLE(ProgramUniform4iEXT)
+#define glProgramUniform4i MANGLE(ProgramUniform4i)
+#define glProgramUniform4ivEXT MANGLE(ProgramUniform4ivEXT)
+#define glProgramUniform4iv MANGLE(ProgramUniform4iv)
+#define glProgramUniform4ui64NV MANGLE(ProgramUniform4ui64NV)
+#define glProgramUniform4ui64vNV MANGLE(ProgramUniform4ui64vNV)
+#define glProgramUniform4uiEXT MANGLE(ProgramUniform4uiEXT)
+#define glProgramUniform4ui MANGLE(ProgramUniform4ui)
+#define glProgramUniform4uivEXT MANGLE(ProgramUniform4uivEXT)
+#define glProgramUniform4uiv MANGLE(ProgramUniform4uiv)
+#define glProgramUniformMatrix2dvEXT MANGLE(ProgramUniformMatrix2dvEXT)
+#define glProgramUniformMatrix2dv MANGLE(ProgramUniformMatrix2dv)
+#define glProgramUniformMatrix2fvEXT MANGLE(ProgramUniformMatrix2fvEXT)
+#define glProgramUniformMatrix2fv MANGLE(ProgramUniformMatrix2fv)
+#define glProgramUniformMatrix2x3dvEXT MANGLE(ProgramUniformMatrix2x3dvEXT)
+#define glProgramUniformMatrix2x3dv MANGLE(ProgramUniformMatrix2x3dv)
+#define glProgramUniformMatrix2x3fvEXT MANGLE(ProgramUniformMatrix2x3fvEXT)
+#define glProgramUniformMatrix2x3fv MANGLE(ProgramUniformMatrix2x3fv)
+#define glProgramUniformMatrix2x4dvEXT MANGLE(ProgramUniformMatrix2x4dvEXT)
+#define glProgramUniformMatrix2x4dv MANGLE(ProgramUniformMatrix2x4dv)
+#define glProgramUniformMatrix2x4fvEXT MANGLE(ProgramUniformMatrix2x4fvEXT)
+#define glProgramUniformMatrix2x4fv MANGLE(ProgramUniformMatrix2x4fv)
+#define glProgramUniformMatrix3dvEXT MANGLE(ProgramUniformMatrix3dvEXT)
+#define glProgramUniformMatrix3dv MANGLE(ProgramUniformMatrix3dv)
+#define glProgramUniformMatrix3fvEXT MANGLE(ProgramUniformMatrix3fvEXT)
+#define glProgramUniformMatrix3fv MANGLE(ProgramUniformMatrix3fv)
+#define glProgramUniformMatrix3x2dvEXT MANGLE(ProgramUniformMatrix3x2dvEXT)
+#define glProgramUniformMatrix3x2dv MANGLE(ProgramUniformMatrix3x2dv)
+#define glProgramUniformMatrix3x2fvEXT MANGLE(ProgramUniformMatrix3x2fvEXT)
+#define glProgramUniformMatrix3x2fv MANGLE(ProgramUniformMatrix3x2fv)
+#define glProgramUniformMatrix3x4dvEXT MANGLE(ProgramUniformMatrix3x4dvEXT)
+#define glProgramUniformMatrix3x4dv MANGLE(ProgramUniformMatrix3x4dv)
+#define glProgramUniformMatrix3x4fvEXT MANGLE(ProgramUniformMatrix3x4fvEXT)
+#define glProgramUniformMatrix3x4fv MANGLE(ProgramUniformMatrix3x4fv)
+#define glProgramUniformMatrix4dvEXT MANGLE(ProgramUniformMatrix4dvEXT)
+#define glProgramUniformMatrix4dv MANGLE(ProgramUniformMatrix4dv)
+#define glProgramUniformMatrix4fvEXT MANGLE(ProgramUniformMatrix4fvEXT)
+#define glProgramUniformMatrix4fv MANGLE(ProgramUniformMatrix4fv)
+#define glProgramUniformMatrix4x2dvEXT MANGLE(ProgramUniformMatrix4x2dvEXT)
+#define glProgramUniformMatrix4x2dv MANGLE(ProgramUniformMatrix4x2dv)
+#define glProgramUniformMatrix4x2fvEXT MANGLE(ProgramUniformMatrix4x2fvEXT)
+#define glProgramUniformMatrix4x2fv MANGLE(ProgramUniformMatrix4x2fv)
+#define glProgramUniformMatrix4x3dvEXT MANGLE(ProgramUniformMatrix4x3dvEXT)
+#define glProgramUniformMatrix4x3dv MANGLE(ProgramUniformMatrix4x3dv)
+#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
+#define glProgramUniformMatrix4x3fv MANGLE(ProgramUniformMatrix4x3fv)
+#define glProgramUniformui64NV MANGLE(ProgramUniformui64NV)
+#define glProgramUniformui64vNV MANGLE(ProgramUniformui64vNV)
+#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
+#define glProvokingVertexEXT MANGLE(ProvokingVertexEXT)
+#define glProvokingVertex MANGLE(ProvokingVertex)
+#define glPushAttrib MANGLE(PushAttrib)
+#define glPushClientAttribDefaultEXT MANGLE(PushClientAttribDefaultEXT)
+#define glPushClientAttrib MANGLE(PushClientAttrib)
+#define glPushMatrix MANGLE(PushMatrix)
+#define glPushName MANGLE(PushName)
+#define glQueryCounter MANGLE(QueryCounter)
+#define glRasterPos2d MANGLE(RasterPos2d)
+#define glRasterPos2dv MANGLE(RasterPos2dv)
+#define glRasterPos2f MANGLE(RasterPos2f)
+#define glRasterPos2fv MANGLE(RasterPos2fv)
+#define glRasterPos2i MANGLE(RasterPos2i)
+#define glRasterPos2iv MANGLE(RasterPos2iv)
+#define glRasterPos2s MANGLE(RasterPos2s)
+#define glRasterPos2sv MANGLE(RasterPos2sv)
+#define glRasterPos3d MANGLE(RasterPos3d)
+#define glRasterPos3dv MANGLE(RasterPos3dv)
+#define glRasterPos3f MANGLE(RasterPos3f)
+#define glRasterPos3fv MANGLE(RasterPos3fv)
+#define glRasterPos3i MANGLE(RasterPos3i)
+#define glRasterPos3iv MANGLE(RasterPos3iv)
+#define glRasterPos3s MANGLE(RasterPos3s)
+#define glRasterPos3sv MANGLE(RasterPos3sv)
+#define glRasterPos4d MANGLE(RasterPos4d)
+#define glRasterPos4dv MANGLE(RasterPos4dv)
+#define glRasterPos4f MANGLE(RasterPos4f)
+#define glRasterPos4fv MANGLE(RasterPos4fv)
+#define glRasterPos4i MANGLE(RasterPos4i)
+#define glRasterPos4iv MANGLE(RasterPos4iv)
+#define glRasterPos4s MANGLE(RasterPos4s)
+#define glRasterPos4sv MANGLE(RasterPos4sv)
+#define glReadBuffer MANGLE(ReadBuffer)
+#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX)
+#define glReadnPixelsARB MANGLE(ReadnPixelsARB)
+#define glReadPixels MANGLE(ReadPixels)
+#define glRectd MANGLE(Rectd)
+#define glRectdv MANGLE(Rectdv)
+#define glRectf MANGLE(Rectf)
+#define glRectfv MANGLE(Rectfv)
+#define glRecti MANGLE(Recti)
+#define glRectiv MANGLE(Rectiv)
+#define glRects MANGLE(Rects)
+#define glRectsv MANGLE(Rectsv)
+#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
+#define glReleaseShaderCompiler MANGLE(ReleaseShaderCompiler)
+#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
+#define glRenderbufferStorage MANGLE(RenderbufferStorage)
+#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV)
+#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT)
+#define glRenderbufferStorageMultisample MANGLE(RenderbufferStorageMultisample)
+#define glRenderMode MANGLE(RenderMode)
+#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
+#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN)
+#define glReplacementCodeubvSUN MANGLE(ReplacementCodeubvSUN)
+#define glReplacementCodeuiColor3fVertex3fSUN MANGLE(ReplacementCodeuiColor3fVertex3fSUN)
+#define glReplacementCodeuiColor3fVertex3fvSUN MANGLE(ReplacementCodeuiColor3fVertex3fvSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiColor4ubVertex3fSUN MANGLE(ReplacementCodeuiColor4ubVertex3fSUN)
+#define glReplacementCodeuiColor4ubVertex3fvSUN MANGLE(ReplacementCodeuiColor4ubVertex3fvSUN)
+#define glReplacementCodeuiNormal3fVertex3fSUN MANGLE(ReplacementCodeuiNormal3fVertex3fSUN)
+#define glReplacementCodeuiNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiNormal3fVertex3fvSUN)
+#define glReplacementCodeuiSUN MANGLE(ReplacementCodeuiSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fSUN)
+#define glReplacementCodeuiTexCoord2fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fvSUN)
+#define glReplacementCodeuiVertex3fSUN MANGLE(ReplacementCodeuiVertex3fSUN)
+#define glReplacementCodeuiVertex3fvSUN MANGLE(ReplacementCodeuiVertex3fvSUN)
+#define glReplacementCodeuivSUN MANGLE(ReplacementCodeuivSUN)
+#define glReplacementCodeusSUN MANGLE(ReplacementCodeusSUN)
+#define glReplacementCodeusvSUN MANGLE(ReplacementCodeusvSUN)
+#define glRequestResidentProgramsNV MANGLE(RequestResidentProgramsNV)
+#define glResetHistogramEXT MANGLE(ResetHistogramEXT)
+#define glResetHistogram MANGLE(ResetHistogram)
+#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
+#define glResetMinmax MANGLE(ResetMinmax)
+#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
+#define glResumeTransformFeedback MANGLE(ResumeTransformFeedback)
+#define glResumeTransformFeedbackNV MANGLE(ResumeTransformFeedbackNV)
+#define glRotated MANGLE(Rotated)
+#define glRotatef MANGLE(Rotatef)
+#define glSampleCoverageARB MANGLE(SampleCoverageARB)
+#define glSampleCoverage MANGLE(SampleCoverage)
+#define glSampleMapATI MANGLE(SampleMapATI)
+#define glSampleMaskEXT MANGLE(SampleMaskEXT)
+#define glSampleMaski MANGLE(SampleMaski)
+#define glSampleMaskIndexedNV MANGLE(SampleMaskIndexedNV)
+#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
+#define glSamplePatternEXT MANGLE(SamplePatternEXT)
+#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
+#define glSamplerParameterf MANGLE(SamplerParameterf)
+#define glSamplerParameterfv MANGLE(SamplerParameterfv)
+#define glSamplerParameterIiv MANGLE(SamplerParameterIiv)
+#define glSamplerParameteri MANGLE(SamplerParameteri)
+#define glSamplerParameterIuiv MANGLE(SamplerParameterIuiv)
+#define glSamplerParameteriv MANGLE(SamplerParameteriv)
+#define glScaled MANGLE(Scaled)
+#define glScalef MANGLE(Scalef)
+#define glScissorArrayv MANGLE(ScissorArrayv)
+#define glScissorIndexed MANGLE(ScissorIndexed)
+#define glScissorIndexedv MANGLE(ScissorIndexedv)
+#define glScissor MANGLE(Scissor)
+#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT)
+#define glSecondaryColor3b MANGLE(SecondaryColor3b)
+#define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT)
+#define glSecondaryColor3bv MANGLE(SecondaryColor3bv)
+#define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT)
+#define glSecondaryColor3d MANGLE(SecondaryColor3d)
+#define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT)
+#define glSecondaryColor3dv MANGLE(SecondaryColor3dv)
+#define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT)
+#define glSecondaryColor3f MANGLE(SecondaryColor3f)
+#define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT)
+#define glSecondaryColor3fv MANGLE(SecondaryColor3fv)
+#define glSecondaryColor3hNV MANGLE(SecondaryColor3hNV)
+#define glSecondaryColor3hvNV MANGLE(SecondaryColor3hvNV)
+#define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT)
+#define glSecondaryColor3i MANGLE(SecondaryColor3i)
+#define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT)
+#define glSecondaryColor3iv MANGLE(SecondaryColor3iv)
+#define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT)
+#define glSecondaryColor3s MANGLE(SecondaryColor3s)
+#define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT)
+#define glSecondaryColor3sv MANGLE(SecondaryColor3sv)
+#define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT)
+#define glSecondaryColor3ub MANGLE(SecondaryColor3ub)
+#define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT)
+#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv)
+#define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT)
+#define glSecondaryColor3ui MANGLE(SecondaryColor3ui)
+#define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT)
+#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv)
+#define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT)
+#define glSecondaryColor3us MANGLE(SecondaryColor3us)
+#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
+#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
+#define glSecondaryColorFormatNV MANGLE(SecondaryColorFormatNV)
+#define glSecondaryColorP3ui MANGLE(SecondaryColorP3ui)
+#define glSecondaryColorP3uiv MANGLE(SecondaryColorP3uiv)
+#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
+#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
+#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
+#define glSelectBuffer MANGLE(SelectBuffer)
+#define glSelectPerfMonitorCountersAMD MANGLE(SelectPerfMonitorCountersAMD)
+#define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT)
+#define glSeparableFilter2D MANGLE(SeparableFilter2D)
+#define glSetFenceAPPLE MANGLE(SetFenceAPPLE)
+#define glSetFenceNV MANGLE(SetFenceNV)
+#define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI)
+#define glSetInvariantEXT MANGLE(SetInvariantEXT)
+#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT)
+#define glShadeModel MANGLE(ShadeModel)
+#define glShaderBinary MANGLE(ShaderBinary)
+#define glShaderOp1EXT MANGLE(ShaderOp1EXT)
+#define glShaderOp2EXT MANGLE(ShaderOp2EXT)
+#define glShaderOp3EXT MANGLE(ShaderOp3EXT)
+#define glShaderSourceARB MANGLE(ShaderSourceARB)
+#define glShaderSource MANGLE(ShaderSource)
+#define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS)
+#define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX)
+#define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX)
+#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX)
+#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX)
+#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX)
+#define glStencilClearTagEXT MANGLE(StencilClearTagEXT)
+#define glStencilFunc MANGLE(StencilFunc)
+#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI)
+#define glStencilFuncSeparate MANGLE(StencilFuncSeparate)
+#define glStencilMask MANGLE(StencilMask)
+#define glStencilMaskSeparate MANGLE(StencilMaskSeparate)
+#define glStencilOp MANGLE(StencilOp)
+#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI)
+#define glStencilOpSeparate MANGLE(StencilOpSeparate)
+#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX)
+#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY)
+#define glSwizzleEXT MANGLE(SwizzleEXT)
+#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX)
+#define glTangent3bEXT MANGLE(Tangent3bEXT)
+#define glTangent3bvEXT MANGLE(Tangent3bvEXT)
+#define glTangent3dEXT MANGLE(Tangent3dEXT)
+#define glTangent3dvEXT MANGLE(Tangent3dvEXT)
+#define glTangent3fEXT MANGLE(Tangent3fEXT)
+#define glTangent3fvEXT MANGLE(Tangent3fvEXT)
+#define glTangent3iEXT MANGLE(Tangent3iEXT)
+#define glTangent3ivEXT MANGLE(Tangent3ivEXT)
+#define glTangent3sEXT MANGLE(Tangent3sEXT)
+#define glTangent3svEXT MANGLE(Tangent3svEXT)
+#define glTangentPointerEXT MANGLE(TangentPointerEXT)
+#define glTbufferMask3DFX MANGLE(TbufferMask3DFX)
+#define glTessellationFactorAMD MANGLE(TessellationFactorAMD)
+#define glTessellationModeAMD MANGLE(TessellationModeAMD)
+#define glTestFenceAPPLE MANGLE(TestFenceAPPLE)
+#define glTestFenceNV MANGLE(TestFenceNV)
+#define glTestObjectAPPLE MANGLE(TestObjectAPPLE)
+#define glTexBufferARB MANGLE(TexBufferARB)
+#define glTexBufferEXT MANGLE(TexBufferEXT)
+#define glTexBuffer MANGLE(TexBuffer)
+#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI)
+#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI)
+#define glTexCoord1d MANGLE(TexCoord1d)
+#define glTexCoord1dv MANGLE(TexCoord1dv)
+#define glTexCoord1f MANGLE(TexCoord1f)
+#define glTexCoord1fv MANGLE(TexCoord1fv)
+#define glTexCoord1hNV MANGLE(TexCoord1hNV)
+#define glTexCoord1hvNV MANGLE(TexCoord1hvNV)
+#define glTexCoord1i MANGLE(TexCoord1i)
+#define glTexCoord1iv MANGLE(TexCoord1iv)
+#define glTexCoord1s MANGLE(TexCoord1s)
+#define glTexCoord1sv MANGLE(TexCoord1sv)
+#define glTexCoord2d MANGLE(TexCoord2d)
+#define glTexCoord2dv MANGLE(TexCoord2dv)
+#define glTexCoord2fColor3fVertex3fSUN MANGLE(TexCoord2fColor3fVertex3fSUN)
+#define glTexCoord2fColor3fVertex3fvSUN MANGLE(TexCoord2fColor3fVertex3fvSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN)
+#define glTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN)
+#define glTexCoord2fColor4ubVertex3fSUN MANGLE(TexCoord2fColor4ubVertex3fSUN)
+#define glTexCoord2fColor4ubVertex3fvSUN MANGLE(TexCoord2fColor4ubVertex3fvSUN)
+#define glTexCoord2f MANGLE(TexCoord2f)
+#define glTexCoord2fNormal3fVertex3fSUN MANGLE(TexCoord2fNormal3fVertex3fSUN)
+#define glTexCoord2fNormal3fVertex3fvSUN MANGLE(TexCoord2fNormal3fVertex3fvSUN)
+#define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN)
+#define glTexCoord2fVertex3fvSUN MANGLE(TexCoord2fVertex3fvSUN)
+#define glTexCoord2fv MANGLE(TexCoord2fv)
+#define glTexCoord2hNV MANGLE(TexCoord2hNV)
+#define glTexCoord2hvNV MANGLE(TexCoord2hvNV)
+#define glTexCoord2i MANGLE(TexCoord2i)
+#define glTexCoord2iv MANGLE(TexCoord2iv)
+#define glTexCoord2s MANGLE(TexCoord2s)
+#define glTexCoord2sv MANGLE(TexCoord2sv)
+#define glTexCoord3d MANGLE(TexCoord3d)
+#define glTexCoord3dv MANGLE(TexCoord3dv)
+#define glTexCoord3f MANGLE(TexCoord3f)
+#define glTexCoord3fv MANGLE(TexCoord3fv)
+#define glTexCoord3hNV MANGLE(TexCoord3hNV)
+#define glTexCoord3hvNV MANGLE(TexCoord3hvNV)
+#define glTexCoord3i MANGLE(TexCoord3i)
+#define glTexCoord3iv MANGLE(TexCoord3iv)
+#define glTexCoord3s MANGLE(TexCoord3s)
+#define glTexCoord3sv MANGLE(TexCoord3sv)
+#define glTexCoord4d MANGLE(TexCoord4d)
+#define glTexCoord4dv MANGLE(TexCoord4dv)
+#define glTexCoord4fColor4fNormal3fVertex4fSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN)
+#define glTexCoord4fColor4fNormal3fVertex4fvSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN)
+#define glTexCoord4f MANGLE(TexCoord4f)
+#define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN)
+#define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN)
+#define glTexCoord4fv MANGLE(TexCoord4fv)
+#define glTexCoord4hNV MANGLE(TexCoord4hNV)
+#define glTexCoord4hvNV MANGLE(TexCoord4hvNV)
+#define glTexCoord4i MANGLE(TexCoord4i)
+#define glTexCoord4iv MANGLE(TexCoord4iv)
+#define glTexCoord4s MANGLE(TexCoord4s)
+#define glTexCoord4sv MANGLE(TexCoord4sv)
+#define glTexCoordFormatNV MANGLE(TexCoordFormatNV)
+#define glTexCoordP1ui MANGLE(TexCoordP1ui)
+#define glTexCoordP1uiv MANGLE(TexCoordP1uiv)
+#define glTexCoordP2ui MANGLE(TexCoordP2ui)
+#define glTexCoordP2uiv MANGLE(TexCoordP2uiv)
+#define glTexCoordP3ui MANGLE(TexCoordP3ui)
+#define glTexCoordP3uiv MANGLE(TexCoordP3uiv)
+#define glTexCoordP4ui MANGLE(TexCoordP4ui)
+#define glTexCoordP4uiv MANGLE(TexCoordP4uiv)
+#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
+#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
+#define glTexCoordPointer MANGLE(TexCoordPointer)
+#define glTexCoordPointervINTEL MANGLE(TexCoordPointervINTEL)
+#define glTexEnvf MANGLE(TexEnvf)
+#define glTexEnvfv MANGLE(TexEnvfv)
+#define glTexEnvi MANGLE(TexEnvi)
+#define glTexEnviv MANGLE(TexEnviv)
+#define glTexFilterFuncSGIS MANGLE(TexFilterFuncSGIS)
+#define glTexGend MANGLE(TexGend)
+#define glTexGendv MANGLE(TexGendv)
+#define glTexGenf MANGLE(TexGenf)
+#define glTexGenfv MANGLE(TexGenfv)
+#define glTexGeni MANGLE(TexGeni)
+#define glTexGeniv MANGLE(TexGeniv)
+#define glTexImage1D MANGLE(TexImage1D)
+#define glTexImage2D MANGLE(TexImage2D)
+#define glTexImage2DMultisample MANGLE(TexImage2DMultisample)
+#define glTexImage3DEXT MANGLE(TexImage3DEXT)
+#define glTexImage3D MANGLE(TexImage3D)
+#define glTexImage3DMultisample MANGLE(TexImage3DMultisample)
+#define glTexImage4DSGIS MANGLE(TexImage4DSGIS)
+#define glTexParameterf MANGLE(TexParameterf)
+#define glTexParameterfv MANGLE(TexParameterfv)
+#define glTexParameterIivEXT MANGLE(TexParameterIivEXT)
+#define glTexParameterIiv MANGLE(TexParameterIiv)
+#define glTexParameteri MANGLE(TexParameteri)
+#define glTexParameterIuivEXT MANGLE(TexParameterIuivEXT)
+#define glTexParameterIuiv MANGLE(TexParameterIuiv)
+#define glTexParameteriv MANGLE(TexParameteriv)
+#define glTexRenderbufferNV MANGLE(TexRenderbufferNV)
+#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT)
+#define glTexSubImage1D MANGLE(TexSubImage1D)
+#define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT)
+#define glTexSubImage2D MANGLE(TexSubImage2D)
+#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT)
+#define glTexSubImage3D MANGLE(TexSubImage3D)
+#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS)
+#define glTextureBarrierNV MANGLE(TextureBarrierNV)
+#define glTextureBufferEXT MANGLE(TextureBufferEXT)
+#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS)
+#define glTextureImage1DEXT MANGLE(TextureImage1DEXT)
+#define glTextureImage2DEXT MANGLE(TextureImage2DEXT)
+#define glTextureImage3DEXT MANGLE(TextureImage3DEXT)
+#define glTextureLightEXT MANGLE(TextureLightEXT)
+#define glTextureMaterialEXT MANGLE(TextureMaterialEXT)
+#define glTextureNormalEXT MANGLE(TextureNormalEXT)
+#define glTextureParameterfEXT MANGLE(TextureParameterfEXT)
+#define glTextureParameterfvEXT MANGLE(TextureParameterfvEXT)
+#define glTextureParameteriEXT MANGLE(TextureParameteriEXT)
+#define glTextureParameterIivEXT MANGLE(TextureParameterIivEXT)
+#define glTextureParameterIuivEXT MANGLE(TextureParameterIuivEXT)
+#define glTextureParameterivEXT MANGLE(TextureParameterivEXT)
+#define glTextureRangeAPPLE MANGLE(TextureRangeAPPLE)
+#define glTextureRenderbufferEXT MANGLE(TextureRenderbufferEXT)
+#define glTextureSubImage1DEXT MANGLE(TextureSubImage1DEXT)
+#define glTextureSubImage2DEXT MANGLE(TextureSubImage2DEXT)
+#define glTextureSubImage3DEXT MANGLE(TextureSubImage3DEXT)
+#define glTrackMatrixNV MANGLE(TrackMatrixNV)
+#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
+#define glTransformFeedbackStreamAttribsNV MANGLE(TransformFeedbackStreamAttribsNV)
+#define glTransformFeedbackVaryingsEXT MANGLE(TransformFeedbackVaryingsEXT)
+#define glTransformFeedbackVaryings MANGLE(TransformFeedbackVaryings)
+#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
+#define glTranslated MANGLE(Translated)
+#define glTranslatef MANGLE(Translatef)
+#define glUniform1d MANGLE(Uniform1d)
+#define glUniform1dv MANGLE(Uniform1dv)
+#define glUniform1fARB MANGLE(Uniform1fARB)
+#define glUniform1f MANGLE(Uniform1f)
+#define glUniform1fvARB MANGLE(Uniform1fvARB)
+#define glUniform1fv MANGLE(Uniform1fv)
+#define glUniform1i64NV MANGLE(Uniform1i64NV)
+#define glUniform1i64vNV MANGLE(Uniform1i64vNV)
+#define glUniform1iARB MANGLE(Uniform1iARB)
+#define glUniform1i MANGLE(Uniform1i)
+#define glUniform1ivARB MANGLE(Uniform1ivARB)
+#define glUniform1iv MANGLE(Uniform1iv)
+#define glUniform1ui64NV MANGLE(Uniform1ui64NV)
+#define glUniform1ui64vNV MANGLE(Uniform1ui64vNV)
+#define glUniform1uiEXT MANGLE(Uniform1uiEXT)
+#define glUniform1ui MANGLE(Uniform1ui)
+#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
+#define glUniform1uiv MANGLE(Uniform1uiv)
+#define glUniform2d MANGLE(Uniform2d)
+#define glUniform2dv MANGLE(Uniform2dv)
+#define glUniform2fARB MANGLE(Uniform2fARB)
+#define glUniform2f MANGLE(Uniform2f)
+#define glUniform2fvARB MANGLE(Uniform2fvARB)
+#define glUniform2fv MANGLE(Uniform2fv)
+#define glUniform2i64NV MANGLE(Uniform2i64NV)
+#define glUniform2i64vNV MANGLE(Uniform2i64vNV)
+#define glUniform2iARB MANGLE(Uniform2iARB)
+#define glUniform2i MANGLE(Uniform2i)
+#define glUniform2ivARB MANGLE(Uniform2ivARB)
+#define glUniform2iv MANGLE(Uniform2iv)
+#define glUniform2ui64NV MANGLE(Uniform2ui64NV)
+#define glUniform2ui64vNV MANGLE(Uniform2ui64vNV)
+#define glUniform2uiEXT MANGLE(Uniform2uiEXT)
+#define glUniform2ui MANGLE(Uniform2ui)
+#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
+#define glUniform2uiv MANGLE(Uniform2uiv)
+#define glUniform3d MANGLE(Uniform3d)
+#define glUniform3dv MANGLE(Uniform3dv)
+#define glUniform3fARB MANGLE(Uniform3fARB)
+#define glUniform3f MANGLE(Uniform3f)
+#define glUniform3fvARB MANGLE(Uniform3fvARB)
+#define glUniform3fv MANGLE(Uniform3fv)
+#define glUniform3i64NV MANGLE(Uniform3i64NV)
+#define glUniform3i64vNV MANGLE(Uniform3i64vNV)
+#define glUniform3iARB MANGLE(Uniform3iARB)
+#define glUniform3i MANGLE(Uniform3i)
+#define glUniform3ivARB MANGLE(Uniform3ivARB)
+#define glUniform3iv MANGLE(Uniform3iv)
+#define glUniform3ui64NV MANGLE(Uniform3ui64NV)
+#define glUniform3ui64vNV MANGLE(Uniform3ui64vNV)
+#define glUniform3uiEXT MANGLE(Uniform3uiEXT)
+#define glUniform3ui MANGLE(Uniform3ui)
+#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
+#define glUniform3uiv MANGLE(Uniform3uiv)
+#define glUniform4d MANGLE(Uniform4d)
+#define glUniform4dv MANGLE(Uniform4dv)
+#define glUniform4fARB MANGLE(Uniform4fARB)
+#define glUniform4f MANGLE(Uniform4f)
+#define glUniform4fvARB MANGLE(Uniform4fvARB)
+#define glUniform4fv MANGLE(Uniform4fv)
+#define glUniform4i64NV MANGLE(Uniform4i64NV)
+#define glUniform4i64vNV MANGLE(Uniform4i64vNV)
+#define glUniform4iARB MANGLE(Uniform4iARB)
+#define glUniform4i MANGLE(Uniform4i)
+#define glUniform4ivARB MANGLE(Uniform4ivARB)
+#define glUniform4iv MANGLE(Uniform4iv)
+#define glUniform4ui64NV MANGLE(Uniform4ui64NV)
+#define glUniform4ui64vNV MANGLE(Uniform4ui64vNV)
+#define glUniform4uiEXT MANGLE(Uniform4uiEXT)
+#define glUniform4ui MANGLE(Uniform4ui)
+#define glUniform4uivEXT MANGLE(Uniform4uivEXT)
+#define glUniform4uiv MANGLE(Uniform4uiv)
+#define glUniformBlockBinding MANGLE(UniformBlockBinding)
+#define glUniformBufferEXT MANGLE(UniformBufferEXT)
+#define glUniformMatrix2dv MANGLE(UniformMatrix2dv)
+#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
+#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
+#define glUniformMatrix2x3dv MANGLE(UniformMatrix2x3dv)
+#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
+#define glUniformMatrix2x4dv MANGLE(UniformMatrix2x4dv)
+#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv)
+#define glUniformMatrix3dv MANGLE(UniformMatrix3dv)
+#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
+#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
+#define glUniformMatrix3x2dv MANGLE(UniformMatrix3x2dv)
+#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv)
+#define glUniformMatrix3x4dv MANGLE(UniformMatrix3x4dv)
+#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv)
+#define glUniformMatrix4dv MANGLE(UniformMatrix4dv)
+#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
+#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
+#define glUniformMatrix4x2dv MANGLE(UniformMatrix4x2dv)
+#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
+#define glUniformMatrix4x3dv MANGLE(UniformMatrix4x3dv)
+#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
+#define glUniformSubroutinesuiv MANGLE(UniformSubroutinesuiv)
+#define glUniformui64NV MANGLE(Uniformui64NV)
+#define glUniformui64vNV MANGLE(Uniformui64vNV)
+#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
+#define glUnmapBufferARB MANGLE(UnmapBufferARB)
+#define glUnmapBuffer MANGLE(UnmapBuffer)
+#define glUnmapNamedBufferEXT MANGLE(UnmapNamedBufferEXT)
+#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI)
+#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
+#define glUseProgram MANGLE(UseProgram)
+#define glUseProgramObjectARB MANGLE(UseProgramObjectARB)
+#define glUseProgramStages MANGLE(UseProgramStages)
+#define glUseShaderProgramEXT MANGLE(UseShaderProgramEXT)
+#define glValidateProgramARB MANGLE(ValidateProgramARB)
+#define glValidateProgram MANGLE(ValidateProgram)
+#define glValidateProgramPipeline MANGLE(ValidateProgramPipeline)
+#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI)
+#define glVariantbvEXT MANGLE(VariantbvEXT)
+#define glVariantdvEXT MANGLE(VariantdvEXT)
+#define glVariantfvEXT MANGLE(VariantfvEXT)
+#define glVariantivEXT MANGLE(VariantivEXT)
+#define glVariantPointerEXT MANGLE(VariantPointerEXT)
+#define glVariantsvEXT MANGLE(VariantsvEXT)
+#define glVariantubvEXT MANGLE(VariantubvEXT)
+#define glVariantuivEXT MANGLE(VariantuivEXT)
+#define glVariantusvEXT MANGLE(VariantusvEXT)
+#define glVDPAUFiniNV MANGLE(VDPAUFiniNV)
+#define glVDPAUGetSurfaceivNV MANGLE(VDPAUGetSurfaceivNV)
+#define glVDPAUInitNV MANGLE(VDPAUInitNV)
+#define glVDPAUIsSurfaceNV MANGLE(VDPAUIsSurfaceNV)
+#define glVDPAUMapSurfacesNV MANGLE(VDPAUMapSurfacesNV)
+#define glVDPAURegisterOutputSurfaceNV MANGLE(VDPAURegisterOutputSurfaceNV)
+#define glVDPAURegisterVideoSurfaceNV MANGLE(VDPAURegisterVideoSurfaceNV)
+#define glVDPAUSurfaceAccessNV MANGLE(VDPAUSurfaceAccessNV)
+#define glVDPAUUnmapSurfacesNV MANGLE(VDPAUUnmapSurfacesNV)
+#define glVDPAUUnregisterSurfaceNV MANGLE(VDPAUUnregisterSurfaceNV)
+#define glVertex2d MANGLE(Vertex2d)
+#define glVertex2dv MANGLE(Vertex2dv)
+#define glVertex2f MANGLE(Vertex2f)
+#define glVertex2fv MANGLE(Vertex2fv)
+#define glVertex2hNV MANGLE(Vertex2hNV)
+#define glVertex2hvNV MANGLE(Vertex2hvNV)
+#define glVertex2i MANGLE(Vertex2i)
+#define glVertex2iv MANGLE(Vertex2iv)
+#define glVertex2s MANGLE(Vertex2s)
+#define glVertex2sv MANGLE(Vertex2sv)
+#define glVertex3d MANGLE(Vertex3d)
+#define glVertex3dv MANGLE(Vertex3dv)
+#define glVertex3f MANGLE(Vertex3f)
+#define glVertex3fv MANGLE(Vertex3fv)
+#define glVertex3hNV MANGLE(Vertex3hNV)
+#define glVertex3hvNV MANGLE(Vertex3hvNV)
+#define glVertex3i MANGLE(Vertex3i)
+#define glVertex3iv MANGLE(Vertex3iv)
+#define glVertex3s MANGLE(Vertex3s)
+#define glVertex3sv MANGLE(Vertex3sv)
+#define glVertex4d MANGLE(Vertex4d)
+#define glVertex4dv MANGLE(Vertex4dv)
+#define glVertex4f MANGLE(Vertex4f)
+#define glVertex4fv MANGLE(Vertex4fv)
+#define glVertex4hNV MANGLE(Vertex4hNV)
+#define glVertex4hvNV MANGLE(Vertex4hvNV)
+#define glVertex4i MANGLE(Vertex4i)
+#define glVertex4iv MANGLE(Vertex4iv)
+#define glVertex4s MANGLE(Vertex4s)
+#define glVertex4sv MANGLE(Vertex4sv)
+#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE)
+#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE)
+#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV)
+#define glVertexArrayVertexAttribLOffsetEXT MANGLE(VertexArrayVertexAttribLOffsetEXT)
+#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
+#define glVertexAttrib1d MANGLE(VertexAttrib1d)
+#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV)
+#define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB)
+#define glVertexAttrib1dv MANGLE(VertexAttrib1dv)
+#define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV)
+#define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB)
+#define glVertexAttrib1f MANGLE(VertexAttrib1f)
+#define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV)
+#define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB)
+#define glVertexAttrib1fv MANGLE(VertexAttrib1fv)
+#define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV)
+#define glVertexAttrib1hNV MANGLE(VertexAttrib1hNV)
+#define glVertexAttrib1hvNV MANGLE(VertexAttrib1hvNV)
+#define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB)
+#define glVertexAttrib1s MANGLE(VertexAttrib1s)
+#define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV)
+#define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB)
+#define glVertexAttrib1sv MANGLE(VertexAttrib1sv)
+#define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV)
+#define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB)
+#define glVertexAttrib2d MANGLE(VertexAttrib2d)
+#define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV)
+#define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB)
+#define glVertexAttrib2dv MANGLE(VertexAttrib2dv)
+#define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV)
+#define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB)
+#define glVertexAttrib2f MANGLE(VertexAttrib2f)
+#define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV)
+#define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB)
+#define glVertexAttrib2fv MANGLE(VertexAttrib2fv)
+#define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV)
+#define glVertexAttrib2hNV MANGLE(VertexAttrib2hNV)
+#define glVertexAttrib2hvNV MANGLE(VertexAttrib2hvNV)
+#define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB)
+#define glVertexAttrib2s MANGLE(VertexAttrib2s)
+#define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV)
+#define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB)
+#define glVertexAttrib2sv MANGLE(VertexAttrib2sv)
+#define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV)
+#define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB)
+#define glVertexAttrib3d MANGLE(VertexAttrib3d)
+#define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV)
+#define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB)
+#define glVertexAttrib3dv MANGLE(VertexAttrib3dv)
+#define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV)
+#define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB)
+#define glVertexAttrib3f MANGLE(VertexAttrib3f)
+#define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV)
+#define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB)
+#define glVertexAttrib3fv MANGLE(VertexAttrib3fv)
+#define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV)
+#define glVertexAttrib3hNV MANGLE(VertexAttrib3hNV)
+#define glVertexAttrib3hvNV MANGLE(VertexAttrib3hvNV)
+#define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB)
+#define glVertexAttrib3s MANGLE(VertexAttrib3s)
+#define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV)
+#define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB)
+#define glVertexAttrib3sv MANGLE(VertexAttrib3sv)
+#define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV)
+#define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB)
+#define glVertexAttrib4bv MANGLE(VertexAttrib4bv)
+#define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB)
+#define glVertexAttrib4d MANGLE(VertexAttrib4d)
+#define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV)
+#define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB)
+#define glVertexAttrib4dv MANGLE(VertexAttrib4dv)
+#define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV)
+#define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB)
+#define glVertexAttrib4f MANGLE(VertexAttrib4f)
+#define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV)
+#define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB)
+#define glVertexAttrib4fv MANGLE(VertexAttrib4fv)
+#define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV)
+#define glVertexAttrib4hNV MANGLE(VertexAttrib4hNV)
+#define glVertexAttrib4hvNV MANGLE(VertexAttrib4hvNV)
+#define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB)
+#define glVertexAttrib4iv MANGLE(VertexAttrib4iv)
+#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB)
+#define glVertexAttrib4Nbv MANGLE(VertexAttrib4Nbv)
+#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB)
+#define glVertexAttrib4Niv MANGLE(VertexAttrib4Niv)
+#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB)
+#define glVertexAttrib4Nsv MANGLE(VertexAttrib4Nsv)
+#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB)
+#define glVertexAttrib4Nub MANGLE(VertexAttrib4Nub)
+#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB)
+#define glVertexAttrib4Nubv MANGLE(VertexAttrib4Nubv)
+#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB)
+#define glVertexAttrib4Nuiv MANGLE(VertexAttrib4Nuiv)
+#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB)
+#define glVertexAttrib4Nusv MANGLE(VertexAttrib4Nusv)
+#define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB)
+#define glVertexAttrib4s MANGLE(VertexAttrib4s)
+#define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV)
+#define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB)
+#define glVertexAttrib4sv MANGLE(VertexAttrib4sv)
+#define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV)
+#define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV)
+#define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB)
+#define glVertexAttrib4ubv MANGLE(VertexAttrib4ubv)
+#define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV)
+#define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB)
+#define glVertexAttrib4uiv MANGLE(VertexAttrib4uiv)
+#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB)
+#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
+#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
+#define glVertexAttribDivisorARB MANGLE(VertexAttribDivisorARB)
+#define glVertexAttribDivisor MANGLE(VertexAttribDivisor)
+#define glVertexAttribFormatNV MANGLE(VertexAttribFormatNV)
+#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
+#define glVertexAttribI1i MANGLE(VertexAttribI1i)
+#define glVertexAttribI1ivEXT MANGLE(VertexAttribI1ivEXT)
+#define glVertexAttribI1iv MANGLE(VertexAttribI1iv)
+#define glVertexAttribI1uiEXT MANGLE(VertexAttribI1uiEXT)
+#define glVertexAttribI1ui MANGLE(VertexAttribI1ui)
+#define glVertexAttribI1uivEXT MANGLE(VertexAttribI1uivEXT)
+#define glVertexAttribI1uiv MANGLE(VertexAttribI1uiv)
+#define glVertexAttribI2iEXT MANGLE(VertexAttribI2iEXT)
+#define glVertexAttribI2i MANGLE(VertexAttribI2i)
+#define glVertexAttribI2ivEXT MANGLE(VertexAttribI2ivEXT)
+#define glVertexAttribI2iv MANGLE(VertexAttribI2iv)
+#define glVertexAttribI2uiEXT MANGLE(VertexAttribI2uiEXT)
+#define glVertexAttribI2ui MANGLE(VertexAttribI2ui)
+#define glVertexAttribI2uivEXT MANGLE(VertexAttribI2uivEXT)
+#define glVertexAttribI2uiv MANGLE(VertexAttribI2uiv)
+#define glVertexAttribI3iEXT MANGLE(VertexAttribI3iEXT)
+#define glVertexAttribI3i MANGLE(VertexAttribI3i)
+#define glVertexAttribI3ivEXT MANGLE(VertexAttribI3ivEXT)
+#define glVertexAttribI3iv MANGLE(VertexAttribI3iv)
+#define glVertexAttribI3uiEXT MANGLE(VertexAttribI3uiEXT)
+#define glVertexAttribI3ui MANGLE(VertexAttribI3ui)
+#define glVertexAttribI3uivEXT MANGLE(VertexAttribI3uivEXT)
+#define glVertexAttribI3uiv MANGLE(VertexAttribI3uiv)
+#define glVertexAttribI4bvEXT MANGLE(VertexAttribI4bvEXT)
+#define glVertexAttribI4bv MANGLE(VertexAttribI4bv)
+#define glVertexAttribI4iEXT MANGLE(VertexAttribI4iEXT)
+#define glVertexAttribI4i MANGLE(VertexAttribI4i)
+#define glVertexAttribI4ivEXT MANGLE(VertexAttribI4ivEXT)
+#define glVertexAttribI4iv MANGLE(VertexAttribI4iv)
+#define glVertexAttribI4svEXT MANGLE(VertexAttribI4svEXT)
+#define glVertexAttribI4sv MANGLE(VertexAttribI4sv)
+#define glVertexAttribI4ubvEXT MANGLE(VertexAttribI4ubvEXT)
+#define glVertexAttribI4ubv MANGLE(VertexAttribI4ubv)
+#define glVertexAttribI4uiEXT MANGLE(VertexAttribI4uiEXT)
+#define glVertexAttribI4ui MANGLE(VertexAttribI4ui)
+#define glVertexAttribI4uivEXT MANGLE(VertexAttribI4uivEXT)
+#define glVertexAttribI4uiv MANGLE(VertexAttribI4uiv)
+#define glVertexAttribI4usvEXT MANGLE(VertexAttribI4usvEXT)
+#define glVertexAttribI4usv MANGLE(VertexAttribI4usv)
+#define glVertexAttribIFormatNV MANGLE(VertexAttribIFormatNV)
+#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
+#define glVertexAttribIPointer MANGLE(VertexAttribIPointer)
+#define glVertexAttribL1dEXT MANGLE(VertexAttribL1dEXT)
+#define glVertexAttribL1d MANGLE(VertexAttribL1d)
+#define glVertexAttribL1dvEXT MANGLE(VertexAttribL1dvEXT)
+#define glVertexAttribL1dv MANGLE(VertexAttribL1dv)
+#define glVertexAttribL1i64NV MANGLE(VertexAttribL1i64NV)
+#define glVertexAttribL1i64vNV MANGLE(VertexAttribL1i64vNV)
+#define glVertexAttribL1ui64NV MANGLE(VertexAttribL1ui64NV)
+#define glVertexAttribL1ui64vNV MANGLE(VertexAttribL1ui64vNV)
+#define glVertexAttribL2dEXT MANGLE(VertexAttribL2dEXT)
+#define glVertexAttribL2d MANGLE(VertexAttribL2d)
+#define glVertexAttribL2dvEXT MANGLE(VertexAttribL2dvEXT)
+#define glVertexAttribL2dv MANGLE(VertexAttribL2dv)
+#define glVertexAttribL2i64NV MANGLE(VertexAttribL2i64NV)
+#define glVertexAttribL2i64vNV MANGLE(VertexAttribL2i64vNV)
+#define glVertexAttribL2ui64NV MANGLE(VertexAttribL2ui64NV)
+#define glVertexAttribL2ui64vNV MANGLE(VertexAttribL2ui64vNV)
+#define glVertexAttribL3dEXT MANGLE(VertexAttribL3dEXT)
+#define glVertexAttribL3d MANGLE(VertexAttribL3d)
+#define glVertexAttribL3dvEXT MANGLE(VertexAttribL3dvEXT)
+#define glVertexAttribL3dv MANGLE(VertexAttribL3dv)
+#define glVertexAttribL3i64NV MANGLE(VertexAttribL3i64NV)
+#define glVertexAttribL3i64vNV MANGLE(VertexAttribL3i64vNV)
+#define glVertexAttribL3ui64NV MANGLE(VertexAttribL3ui64NV)
+#define glVertexAttribL3ui64vNV MANGLE(VertexAttribL3ui64vNV)
+#define glVertexAttribL4dEXT MANGLE(VertexAttribL4dEXT)
+#define glVertexAttribL4d MANGLE(VertexAttribL4d)
+#define glVertexAttribL4dvEXT MANGLE(VertexAttribL4dvEXT)
+#define glVertexAttribL4dv MANGLE(VertexAttribL4dv)
+#define glVertexAttribL4i64NV MANGLE(VertexAttribL4i64NV)
+#define glVertexAttribL4i64vNV MANGLE(VertexAttribL4i64vNV)
+#define glVertexAttribL4ui64NV MANGLE(VertexAttribL4ui64NV)
+#define glVertexAttribL4ui64vNV MANGLE(VertexAttribL4ui64vNV)
+#define glVertexAttribLFormatNV MANGLE(VertexAttribLFormatNV)
+#define glVertexAttribLPointerEXT MANGLE(VertexAttribLPointerEXT)
+#define glVertexAttribLPointer MANGLE(VertexAttribLPointer)
+#define glVertexAttribP1ui MANGLE(VertexAttribP1ui)
+#define glVertexAttribP1uiv MANGLE(VertexAttribP1uiv)
+#define glVertexAttribP2ui MANGLE(VertexAttribP2ui)
+#define glVertexAttribP2uiv MANGLE(VertexAttribP2uiv)
+#define glVertexAttribP3ui MANGLE(VertexAttribP3ui)
+#define glVertexAttribP3uiv MANGLE(VertexAttribP3uiv)
+#define glVertexAttribP4ui MANGLE(VertexAttribP4ui)
+#define glVertexAttribP4uiv MANGLE(VertexAttribP4uiv)
+#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
+#define glVertexAttribPointer MANGLE(VertexAttribPointer)
+#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
+#define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV)
+#define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV)
+#define glVertexAttribs1hvNV MANGLE(VertexAttribs1hvNV)
+#define glVertexAttribs1svNV MANGLE(VertexAttribs1svNV)
+#define glVertexAttribs2dvNV MANGLE(VertexAttribs2dvNV)
+#define glVertexAttribs2fvNV MANGLE(VertexAttribs2fvNV)
+#define glVertexAttribs2hvNV MANGLE(VertexAttribs2hvNV)
+#define glVertexAttribs2svNV MANGLE(VertexAttribs2svNV)
+#define glVertexAttribs3dvNV MANGLE(VertexAttribs3dvNV)
+#define glVertexAttribs3fvNV MANGLE(VertexAttribs3fvNV)
+#define glVertexAttribs3hvNV MANGLE(VertexAttribs3hvNV)
+#define glVertexAttribs3svNV MANGLE(VertexAttribs3svNV)
+#define glVertexAttribs4dvNV MANGLE(VertexAttribs4dvNV)
+#define glVertexAttribs4fvNV MANGLE(VertexAttribs4fvNV)
+#define glVertexAttribs4hvNV MANGLE(VertexAttribs4hvNV)
+#define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV)
+#define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV)
+#define glVertexBlendARB MANGLE(VertexBlendARB)
+#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
+#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
+#define glVertexFormatNV MANGLE(VertexFormatNV)
+#define glVertexP2ui MANGLE(VertexP2ui)
+#define glVertexP2uiv MANGLE(VertexP2uiv)
+#define glVertexP3ui MANGLE(VertexP3ui)
+#define glVertexP3uiv MANGLE(VertexP3uiv)
+#define glVertexP4ui MANGLE(VertexP4ui)
+#define glVertexP4uiv MANGLE(VertexP4uiv)
+#define glVertexPointerEXT MANGLE(VertexPointerEXT)
+#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
+#define glVertexPointer MANGLE(VertexPointer)
+#define glVertexPointervINTEL MANGLE(VertexPointervINTEL)
+#define glVertexStream1dATI MANGLE(VertexStream1dATI)
+#define glVertexStream1dvATI MANGLE(VertexStream1dvATI)
+#define glVertexStream1fATI MANGLE(VertexStream1fATI)
+#define glVertexStream1fvATI MANGLE(VertexStream1fvATI)
+#define glVertexStream1iATI MANGLE(VertexStream1iATI)
+#define glVertexStream1ivATI MANGLE(VertexStream1ivATI)
+#define glVertexStream1sATI MANGLE(VertexStream1sATI)
+#define glVertexStream1svATI MANGLE(VertexStream1svATI)
+#define glVertexStream2dATI MANGLE(VertexStream2dATI)
+#define glVertexStream2dvATI MANGLE(VertexStream2dvATI)
+#define glVertexStream2fATI MANGLE(VertexStream2fATI)
+#define glVertexStream2fvATI MANGLE(VertexStream2fvATI)
+#define glVertexStream2iATI MANGLE(VertexStream2iATI)
+#define glVertexStream2ivATI MANGLE(VertexStream2ivATI)
+#define glVertexStream2sATI MANGLE(VertexStream2sATI)
+#define glVertexStream2svATI MANGLE(VertexStream2svATI)
+#define glVertexStream3dATI MANGLE(VertexStream3dATI)
+#define glVertexStream3dvATI MANGLE(VertexStream3dvATI)
+#define glVertexStream3fATI MANGLE(VertexStream3fATI)
+#define glVertexStream3fvATI MANGLE(VertexStream3fvATI)
+#define glVertexStream3iATI MANGLE(VertexStream3iATI)
+#define glVertexStream3ivATI MANGLE(VertexStream3ivATI)
+#define glVertexStream3sATI MANGLE(VertexStream3sATI)
+#define glVertexStream3svATI MANGLE(VertexStream3svATI)
+#define glVertexStream4dATI MANGLE(VertexStream4dATI)
+#define glVertexStream4dvATI MANGLE(VertexStream4dvATI)
+#define glVertexStream4fATI MANGLE(VertexStream4fATI)
+#define glVertexStream4fvATI MANGLE(VertexStream4fvATI)
+#define glVertexStream4iATI MANGLE(VertexStream4iATI)
+#define glVertexStream4ivATI MANGLE(VertexStream4ivATI)
+#define glVertexStream4sATI MANGLE(VertexStream4sATI)
+#define glVertexStream4svATI MANGLE(VertexStream4svATI)
+#define glVertexWeightfEXT MANGLE(VertexWeightfEXT)
+#define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT)
+#define glVertexWeighthNV MANGLE(VertexWeighthNV)
+#define glVertexWeighthvNV MANGLE(VertexWeighthvNV)
+#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT)
+#define glVideoCaptureNV MANGLE(VideoCaptureNV)
+#define glVideoCaptureStreamParameterdvNV MANGLE(VideoCaptureStreamParameterdvNV)
+#define glVideoCaptureStreamParameterfvNV MANGLE(VideoCaptureStreamParameterfvNV)
+#define glVideoCaptureStreamParameterivNV MANGLE(VideoCaptureStreamParameterivNV)
+#define glViewportArrayv MANGLE(ViewportArrayv)
+#define glViewportIndexedf MANGLE(ViewportIndexedf)
+#define glViewportIndexedfv MANGLE(ViewportIndexedfv)
+#define glViewport MANGLE(Viewport)
+#define glWaitSync MANGLE(WaitSync)
+#define glWeightbvARB MANGLE(WeightbvARB)
+#define glWeightdvARB MANGLE(WeightdvARB)
+#define glWeightfvARB MANGLE(WeightfvARB)
+#define glWeightivARB MANGLE(WeightivARB)
+#define glWeightPointerARB MANGLE(WeightPointerARB)
+#define glWeightsvARB MANGLE(WeightsvARB)
+#define glWeightubvARB MANGLE(WeightubvARB)
+#define glWeightuivARB MANGLE(WeightuivARB)
+#define glWeightusvARB MANGLE(WeightusvARB)
+#define glWindowPos2dARB MANGLE(WindowPos2dARB)
+#define glWindowPos2d MANGLE(WindowPos2d)
+#define glWindowPos2dMESA MANGLE(WindowPos2dMESA)
+#define glWindowPos2dvARB MANGLE(WindowPos2dvARB)
+#define glWindowPos2dv MANGLE(WindowPos2dv)
+#define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA)
+#define glWindowPos2fARB MANGLE(WindowPos2fARB)
+#define glWindowPos2f MANGLE(WindowPos2f)
+#define glWindowPos2fMESA MANGLE(WindowPos2fMESA)
+#define glWindowPos2fvARB MANGLE(WindowPos2fvARB)
+#define glWindowPos2fv MANGLE(WindowPos2fv)
+#define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA)
+#define glWindowPos2iARB MANGLE(WindowPos2iARB)
+#define glWindowPos2i MANGLE(WindowPos2i)
+#define glWindowPos2iMESA MANGLE(WindowPos2iMESA)
+#define glWindowPos2ivARB MANGLE(WindowPos2ivARB)
+#define glWindowPos2iv MANGLE(WindowPos2iv)
+#define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA)
+#define glWindowPos2sARB MANGLE(WindowPos2sARB)
+#define glWindowPos2s MANGLE(WindowPos2s)
+#define glWindowPos2sMESA MANGLE(WindowPos2sMESA)
+#define glWindowPos2svARB MANGLE(WindowPos2svARB)
+#define glWindowPos2sv MANGLE(WindowPos2sv)
+#define glWindowPos2svMESA MANGLE(WindowPos2svMESA)
+#define glWindowPos3dARB MANGLE(WindowPos3dARB)
+#define glWindowPos3d MANGLE(WindowPos3d)
+#define glWindowPos3dMESA MANGLE(WindowPos3dMESA)
+#define glWindowPos3dvARB MANGLE(WindowPos3dvARB)
+#define glWindowPos3dv MANGLE(WindowPos3dv)
+#define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA)
+#define glWindowPos3fARB MANGLE(WindowPos3fARB)
+#define glWindowPos3f MANGLE(WindowPos3f)
+#define glWindowPos3fMESA MANGLE(WindowPos3fMESA)
+#define glWindowPos3fvARB MANGLE(WindowPos3fvARB)
+#define glWindowPos3fv MANGLE(WindowPos3fv)
+#define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA)
+#define glWindowPos3iARB MANGLE(WindowPos3iARB)
+#define glWindowPos3i MANGLE(WindowPos3i)
+#define glWindowPos3iMESA MANGLE(WindowPos3iMESA)
+#define glWindowPos3ivARB MANGLE(WindowPos3ivARB)
+#define glWindowPos3iv MANGLE(WindowPos3iv)
+#define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA)
+#define glWindowPos3sARB MANGLE(WindowPos3sARB)
+#define glWindowPos3s MANGLE(WindowPos3s)
+#define glWindowPos3sMESA MANGLE(WindowPos3sMESA)
+#define glWindowPos3svARB MANGLE(WindowPos3svARB)
+#define glWindowPos3sv MANGLE(WindowPos3sv)
+#define glWindowPos3svMESA MANGLE(WindowPos3svMESA)
+#define glWindowPos4dMESA MANGLE(WindowPos4dMESA)
+#define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA)
+#define glWindowPos4fMESA MANGLE(WindowPos4fMESA)
+#define glWindowPos4fvMESA MANGLE(WindowPos4fvMESA)
+#define glWindowPos4iMESA MANGLE(WindowPos4iMESA)
+#define glWindowPos4ivMESA MANGLE(WindowPos4ivMESA)
+#define glWindowPos4sMESA MANGLE(WindowPos4sMESA)
+#define glWindowPos4svMESA MANGLE(WindowPos4svMESA)
+#define glWriteMaskEXT MANGLE(WriteMaskEXT)
+
+#endif /* GL_MANGLE_H */
diff --git a/src/gfxstream/host/apigen-codec-common/GL/glext.h b/src/gfxstream/host/apigen-codec-common/GL/glext.h
new file mode 100644
index 00000000000..0b9029c16c2
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/GL/glext.h
@@ -0,0 +1,12742 @@
+#ifndef __glext_h_
+#define __glext_h_
+
+#include <KHR/khrplatform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2012 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.
+*/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glext.h last updated $Date: 2012-09-19 19:02:24 -0700 (Wed, 19 Sep 2012) $ */
+/* Current version at http://www.opengl.org/registry/ */
+#define GL_GLEXT_VERSION 85
+/* Function declaration macros - to move into glplatform.h */
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_TEXTURE_BINDING_3D 0x806A
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_CLAMP_TO_EDGE 0x812F
+#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_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#endif
+
+#ifndef GL_ARB_imaging
+#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_FUNC_ADD 0x8006
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_BLEND_EQUATION 0x8009
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#endif
+
+#ifndef GL_VERSION_1_3
+#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_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#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_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_CLAMP_TO_BORDER 0x812D
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+#define GL_MULTISAMPLE_BIT 0x20000000
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#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_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+#endif
+
+#ifndef GL_VERSION_1_4
+#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_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_DEPTH_COMPONENT24 0x81A6
+#define GL_DEPTH_COMPONENT32 0x81A7
+#define GL_MIRRORED_REPEAT 0x8370
+#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
+#define GL_TEXTURE_LOD_BIAS 0x8501
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+#define GL_TEXTURE_DEPTH_SIZE 0x884A
+#define GL_TEXTURE_COMPARE_MODE 0x884C
+#define GL_TEXTURE_COMPARE_FUNC 0x884D
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_GENERATE_MIPMAP 0x8191
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#define GL_FOG_COORDINATE_SOURCE 0x8450
+#define GL_FOG_COORDINATE 0x8451
+#define GL_FRAGMENT_DEPTH 0x8452
+#define GL_CURRENT_FOG_COORDINATE 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
+#define GL_FOG_COORDINATE_ARRAY 0x8457
+#define GL_COLOR_SUM 0x8458
+#define GL_CURRENT_SECONDARY_COLOR 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
+#define GL_SECONDARY_COLOR_ARRAY 0x845E
+#define GL_TEXTURE_FILTER_CONTROL 0x8500
+#define GL_DEPTH_TEXTURE_MODE 0x884B
+#define GL_COMPARE_R_TO_TEXTURE 0x884E
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_QUERY_COUNTER_BITS 0x8864
+#define GL_CURRENT_QUERY 0x8865
+#define GL_QUERY_RESULT 0x8866
+#define GL_QUERY_RESULT_AVAILABLE 0x8867
+#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_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY 0x88B8
+#define GL_WRITE_ONLY 0x88B9
+#define GL_READ_WRITE 0x88BA
+#define GL_BUFFER_ACCESS 0x88BB
+#define GL_BUFFER_MAPPED 0x88BC
+#define GL_BUFFER_MAP_POINTER 0x88BD
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STREAM_READ 0x88E1
+#define GL_STREAM_COPY 0x88E2
+#define GL_STATIC_DRAW 0x88E4
+#define GL_STATIC_READ 0x88E5
+#define GL_STATIC_COPY 0x88E6
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_DYNAMIC_READ 0x88E9
+#define GL_DYNAMIC_COPY 0x88EA
+#define GL_SAMPLES_PASSED 0x8914
+#define GL_SRC1_ALPHA 0x8589
+#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
+#define GL_FOG_COORD_SRC 0x8450
+#define GL_FOG_COORD 0x8451
+#define GL_CURRENT_FOG_COORD 0x8453
+#define GL_FOG_COORD_ARRAY_TYPE 0x8454
+#define GL_FOG_COORD_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORD_ARRAY_POINTER 0x8456
+#define GL_FOG_COORD_ARRAY 0x8457
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
+#define GL_SRC0_RGB 0x8580
+#define GL_SRC1_RGB 0x8581
+#define GL_SRC2_RGB 0x8582
+#define GL_SRC0_ALPHA 0x8588
+#define GL_SRC2_ALPHA 0x858A
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_BLEND_EQUATION_RGB 0x8009
+#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_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#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_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_BLEND_EQUATION_ALPHA 0x883D
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
+#define GL_MAX_VARYING_FLOATS 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_SHADER_TYPE 0x8B4F
+#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_1D 0x8B5D
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_3D 0x8B5F
+#define GL_SAMPLER_CUBE 0x8B60
+#define GL_SAMPLER_1D_SHADOW 0x8B61
+#define GL_SAMPLER_2D_SHADOW 0x8B62
+#define GL_DELETE_STATUS 0x8B80
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_LINK_STATUS 0x8B82
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_CURRENT_PROGRAM 0x8B8D
+#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
+#define GL_LOWER_LEFT 0x8CA1
+#define GL_UPPER_LEFT 0x8CA2
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
+#define GL_POINT_SPRITE 0x8861
+#define GL_COORD_REPLACE 0x8862
+#define GL_MAX_TEXTURE_COORDS 0x8871
+#endif
+
+#ifndef GL_VERSION_2_1
+#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_SRGB_ALPHA 0x8C42
+#define GL_SRGB8_ALPHA8 0x8C43
+#define GL_COMPRESSED_SRGB 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
+#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
+#define GL_SLUMINANCE_ALPHA 0x8C44
+#define GL_SLUMINANCE8_ALPHA8 0x8C45
+#define GL_SLUMINANCE 0x8C46
+#define GL_SLUMINANCE8 0x8C47
+#define GL_COMPRESSED_SLUMINANCE 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
+#endif
+
+#ifndef GL_VERSION_3_0
+#define GL_COMPARE_REF_TO_TEXTURE 0x884E
+#define GL_CLIP_DISTANCE0 0x3000
+#define GL_CLIP_DISTANCE1 0x3001
+#define GL_CLIP_DISTANCE2 0x3002
+#define GL_CLIP_DISTANCE3 0x3003
+#define GL_CLIP_DISTANCE4 0x3004
+#define GL_CLIP_DISTANCE5 0x3005
+#define GL_CLIP_DISTANCE6 0x3006
+#define GL_CLIP_DISTANCE7 0x3007
+#define GL_MAX_CLIP_DISTANCES 0x0D32
+#define GL_MAJOR_VERSION 0x821B
+#define GL_MINOR_VERSION 0x821C
+#define GL_NUM_EXTENSIONS 0x821D
+#define GL_CONTEXT_FLAGS 0x821E
+#define GL_COMPRESSED_RED 0x8225
+#define GL_COMPRESSED_RG 0x8226
+#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
+#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_CLAMP_READ_COLOR 0x891C
+#define GL_FIXED_ONLY 0x891D
+#define GL_MAX_VARYING_COMPONENTS 0x8B4B
+#define GL_TEXTURE_1D_ARRAY 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
+#define GL_TEXTURE_2D_ARRAY 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
+#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_TEXTURE_SHARED_SIZE 0x8C3F
+#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_PRIMITIVES_GENERATED 0x8C87
+#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_GREEN_INTEGER 0x8D95
+#define GL_BLUE_INTEGER 0x8D96
+#define GL_RGB_INTEGER 0x8D98
+#define GL_RGBA_INTEGER 0x8D99
+#define GL_BGR_INTEGER 0x8D9A
+#define GL_BGRA_INTEGER 0x8D9B
+#define GL_SAMPLER_1D_ARRAY 0x8DC0
+#define GL_SAMPLER_2D_ARRAY 0x8DC1
+#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
+#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_1D 0x8DC9
+#define GL_INT_SAMPLER_2D 0x8DCA
+#define GL_INT_SAMPLER_3D 0x8DCB
+#define GL_INT_SAMPLER_CUBE 0x8DCC
+#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
+#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
+#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_1D_ARRAY 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
+#define GL_QUERY_WAIT 0x8E13
+#define GL_QUERY_NO_WAIT 0x8E14
+#define GL_QUERY_BY_REGION_WAIT 0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
+#define GL_BUFFER_ACCESS_FLAGS 0x911F
+#define GL_BUFFER_MAP_LENGTH 0x9120
+#define GL_BUFFER_MAP_OFFSET 0x9121
+/* Reuse tokens from ARB_depth_buffer_float */
+/* reuse GL_DEPTH_COMPONENT32F */
+/* reuse GL_DEPTH32F_STENCIL8 */
+/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */
+/* Reuse tokens from ARB_framebuffer_object */
+/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+/* reuse GL_FRAMEBUFFER_DEFAULT */
+/* reuse GL_FRAMEBUFFER_UNDEFINED */
+/* reuse GL_DEPTH_STENCIL_ATTACHMENT */
+/* reuse GL_INDEX */
+/* reuse GL_MAX_RENDERBUFFER_SIZE */
+/* reuse GL_DEPTH_STENCIL */
+/* reuse GL_UNSIGNED_INT_24_8 */
+/* reuse GL_DEPTH24_STENCIL8 */
+/* reuse GL_TEXTURE_STENCIL_SIZE */
+/* reuse GL_TEXTURE_RED_TYPE */
+/* reuse GL_TEXTURE_GREEN_TYPE */
+/* reuse GL_TEXTURE_BLUE_TYPE */
+/* reuse GL_TEXTURE_ALPHA_TYPE */
+/* reuse GL_TEXTURE_DEPTH_TYPE */
+/* reuse GL_UNSIGNED_NORMALIZED */
+/* reuse GL_FRAMEBUFFER_BINDING */
+/* reuse GL_DRAW_FRAMEBUFFER_BINDING */
+/* reuse GL_RENDERBUFFER_BINDING */
+/* reuse GL_READ_FRAMEBUFFER */
+/* reuse GL_DRAW_FRAMEBUFFER */
+/* reuse GL_READ_FRAMEBUFFER_BINDING */
+/* reuse GL_RENDERBUFFER_SAMPLES */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+/* reuse GL_FRAMEBUFFER_COMPLETE */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
+/* reuse GL_FRAMEBUFFER_UNSUPPORTED */
+/* reuse GL_MAX_COLOR_ATTACHMENTS */
+/* reuse GL_COLOR_ATTACHMENT0 */
+/* reuse GL_COLOR_ATTACHMENT1 */
+/* reuse GL_COLOR_ATTACHMENT2 */
+/* reuse GL_COLOR_ATTACHMENT3 */
+/* reuse GL_COLOR_ATTACHMENT4 */
+/* reuse GL_COLOR_ATTACHMENT5 */
+/* reuse GL_COLOR_ATTACHMENT6 */
+/* reuse GL_COLOR_ATTACHMENT7 */
+/* reuse GL_COLOR_ATTACHMENT8 */
+/* reuse GL_COLOR_ATTACHMENT9 */
+/* reuse GL_COLOR_ATTACHMENT10 */
+/* reuse GL_COLOR_ATTACHMENT11 */
+/* reuse GL_COLOR_ATTACHMENT12 */
+/* reuse GL_COLOR_ATTACHMENT13 */
+/* reuse GL_COLOR_ATTACHMENT14 */
+/* reuse GL_COLOR_ATTACHMENT15 */
+/* reuse GL_DEPTH_ATTACHMENT */
+/* reuse GL_STENCIL_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER */
+/* reuse GL_RENDERBUFFER */
+/* reuse GL_RENDERBUFFER_WIDTH */
+/* reuse GL_RENDERBUFFER_HEIGHT */
+/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */
+/* reuse GL_STENCIL_INDEX1 */
+/* reuse GL_STENCIL_INDEX4 */
+/* reuse GL_STENCIL_INDEX8 */
+/* reuse GL_STENCIL_INDEX16 */
+/* reuse GL_RENDERBUFFER_RED_SIZE */
+/* reuse GL_RENDERBUFFER_GREEN_SIZE */
+/* reuse GL_RENDERBUFFER_BLUE_SIZE */
+/* reuse GL_RENDERBUFFER_ALPHA_SIZE */
+/* reuse GL_RENDERBUFFER_DEPTH_SIZE */
+/* reuse GL_RENDERBUFFER_STENCIL_SIZE */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+/* reuse GL_MAX_SAMPLES */
+/* Reuse tokens from ARB_framebuffer_sRGB */
+/* reuse GL_FRAMEBUFFER_SRGB */
+/* Reuse tokens from ARB_half_float_vertex */
+/* reuse GL_HALF_FLOAT */
+/* Reuse tokens from ARB_map_buffer_range */
+/* reuse GL_MAP_READ_BIT */
+/* reuse GL_MAP_WRITE_BIT */
+/* reuse GL_MAP_INVALIDATE_RANGE_BIT */
+/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */
+/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */
+/* reuse GL_MAP_UNSYNCHRONIZED_BIT */
+/* Reuse tokens from ARB_texture_compression_rgtc */
+/* reuse GL_COMPRESSED_RED_RGTC1 */
+/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */
+/* reuse GL_COMPRESSED_RG_RGTC2 */
+/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */
+/* Reuse tokens from ARB_texture_rg */
+/* reuse GL_RG */
+/* reuse GL_RG_INTEGER */
+/* reuse GL_R8 */
+/* reuse GL_R16 */
+/* reuse GL_RG8 */
+/* reuse GL_RG16 */
+/* reuse GL_R16F */
+/* reuse GL_R32F */
+/* reuse GL_RG16F */
+/* reuse GL_RG32F */
+/* reuse GL_R8I */
+/* reuse GL_R8UI */
+/* reuse GL_R16I */
+/* reuse GL_R16UI */
+/* reuse GL_R32I */
+/* reuse GL_R32UI */
+/* reuse GL_RG8I */
+/* reuse GL_RG8UI */
+/* reuse GL_RG16I */
+/* reuse GL_RG16UI */
+/* reuse GL_RG32I */
+/* reuse GL_RG32UI */
+/* Reuse tokens from ARB_vertex_array_object */
+/* reuse GL_VERTEX_ARRAY_BINDING */
+#define GL_CLAMP_VERTEX_COLOR 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR 0x891B
+#define GL_ALPHA_INTEGER 0x8D97
+/* Reuse tokens from ARB_framebuffer_object */
+/* reuse GL_TEXTURE_LUMINANCE_TYPE */
+/* reuse GL_TEXTURE_INTENSITY_TYPE */
+#endif
+
+#ifndef GL_VERSION_3_1
+#define GL_SAMPLER_2D_RECT 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
+#define GL_SAMPLER_BUFFER 0x8DC2
+#define GL_INT_SAMPLER_2D_RECT 0x8DCD
+#define GL_INT_SAMPLER_BUFFER 0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
+#define GL_TEXTURE_BUFFER 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
+#define GL_TEXTURE_RECTANGLE 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
+#define GL_RED_SNORM 0x8F90
+#define GL_RG_SNORM 0x8F91
+#define GL_RGB_SNORM 0x8F92
+#define GL_RGBA_SNORM 0x8F93
+#define GL_R8_SNORM 0x8F94
+#define GL_RG8_SNORM 0x8F95
+#define GL_RGB8_SNORM 0x8F96
+#define GL_RGBA8_SNORM 0x8F97
+#define GL_R16_SNORM 0x8F98
+#define GL_RG16_SNORM 0x8F99
+#define GL_RGB16_SNORM 0x8F9A
+#define GL_RGBA16_SNORM 0x8F9B
+#define GL_SIGNED_NORMALIZED 0x8F9C
+#define GL_PRIMITIVE_RESTART 0x8F9D
+#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
+/* Reuse tokens from ARB_copy_buffer */
+/* reuse GL_COPY_READ_BUFFER */
+/* reuse GL_COPY_WRITE_BUFFER */
+/* Reuse tokens from ARB_draw_instanced (none) */
+/* Reuse tokens from ARB_uniform_buffer_object */
+/* reuse GL_UNIFORM_BUFFER */
+/* reuse GL_UNIFORM_BUFFER_BINDING */
+/* reuse GL_UNIFORM_BUFFER_START */
+/* reuse GL_UNIFORM_BUFFER_SIZE */
+/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */
+/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */
+/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */
+/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */
+/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */
+/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */
+/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */
+/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */
+/* reuse GL_ACTIVE_UNIFORM_BLOCKS */
+/* reuse GL_UNIFORM_TYPE */
+/* reuse GL_UNIFORM_SIZE */
+/* reuse GL_UNIFORM_NAME_LENGTH */
+/* reuse GL_UNIFORM_BLOCK_INDEX */
+/* reuse GL_UNIFORM_OFFSET */
+/* reuse GL_UNIFORM_ARRAY_STRIDE */
+/* reuse GL_UNIFORM_MATRIX_STRIDE */
+/* reuse GL_UNIFORM_IS_ROW_MAJOR */
+/* reuse GL_UNIFORM_BLOCK_BINDING */
+/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */
+/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */
+/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */
+/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */
+/* reuse GL_INVALID_INDEX */
+#endif
+
+#ifndef GL_VERSION_3_2
+#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
+#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
+#define GL_LINES_ADJACENCY 0x000A
+#define GL_LINE_STRIP_ADJACENCY 0x000B
+#define GL_TRIANGLES_ADJACENCY 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
+#define GL_PROGRAM_POINT_SIZE 0x8642
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
+#define GL_GEOMETRY_SHADER 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT 0x8916
+#define GL_GEOMETRY_INPUT_TYPE 0x8917
+#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
+#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
+#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
+#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
+#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
+#define GL_CONTEXT_PROFILE_MASK 0x9126
+/* reuse GL_MAX_VARYING_COMPONENTS */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+/* Reuse tokens from ARB_depth_clamp */
+/* reuse GL_DEPTH_CLAMP */
+/* Reuse tokens from ARB_draw_elements_base_vertex (none) */
+/* Reuse tokens from ARB_fragment_coord_conventions (none) */
+/* Reuse tokens from ARB_provoking_vertex */
+/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
+/* reuse GL_FIRST_VERTEX_CONVENTION */
+/* reuse GL_LAST_VERTEX_CONVENTION */
+/* reuse GL_PROVOKING_VERTEX */
+/* Reuse tokens from ARB_seamless_cube_map */
+/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */
+/* Reuse tokens from ARB_sync */
+/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */
+/* reuse GL_OBJECT_TYPE */
+/* reuse GL_SYNC_CONDITION */
+/* reuse GL_SYNC_STATUS */
+/* reuse GL_SYNC_FLAGS */
+/* reuse GL_SYNC_FENCE */
+/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */
+/* reuse GL_UNSIGNALED */
+/* reuse GL_SIGNALED */
+/* reuse GL_ALREADY_SIGNALED */
+/* reuse GL_TIMEOUT_EXPIRED */
+/* reuse GL_CONDITION_SATISFIED */
+/* reuse GL_WAIT_FAILED */
+/* reuse GL_TIMEOUT_IGNORED */
+/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */
+/* reuse GL_TIMEOUT_IGNORED */
+/* Reuse tokens from ARB_texture_multisample */
+/* reuse GL_SAMPLE_POSITION */
+/* reuse GL_SAMPLE_MASK */
+/* reuse GL_SAMPLE_MASK_VALUE */
+/* reuse GL_MAX_SAMPLE_MASK_WORDS */
+/* reuse GL_TEXTURE_2D_MULTISAMPLE */
+/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */
+/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */
+/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_TEXTURE_SAMPLES */
+/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */
+/* reuse GL_SAMPLER_2D_MULTISAMPLE */
+/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */
+/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */
+/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */
+/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */
+/* reuse GL_MAX_INTEGER_SAMPLES */
+/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */
+#endif
+
+#ifndef GL_VERSION_3_3
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
+/* Reuse tokens from ARB_blend_func_extended */
+/* reuse GL_SRC1_COLOR */
+/* reuse GL_ONE_MINUS_SRC1_COLOR */
+/* reuse GL_ONE_MINUS_SRC1_ALPHA */
+/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */
+/* Reuse tokens from ARB_explicit_attrib_location (none) */
+/* Reuse tokens from ARB_occlusion_query2 */
+/* reuse GL_ANY_SAMPLES_PASSED */
+/* Reuse tokens from ARB_sampler_objects */
+/* reuse GL_SAMPLER_BINDING */
+/* Reuse tokens from ARB_shader_bit_encoding (none) */
+/* Reuse tokens from ARB_texture_rgb10_a2ui */
+/* reuse GL_RGB10_A2UI */
+/* Reuse tokens from ARB_texture_swizzle */
+/* reuse GL_TEXTURE_SWIZZLE_R */
+/* reuse GL_TEXTURE_SWIZZLE_G */
+/* reuse GL_TEXTURE_SWIZZLE_B */
+/* reuse GL_TEXTURE_SWIZZLE_A */
+/* reuse GL_TEXTURE_SWIZZLE_RGBA */
+/* Reuse tokens from ARB_timer_query */
+/* reuse GL_TIME_ELAPSED */
+/* reuse GL_TIMESTAMP */
+/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */
+/* reuse GL_INT_2_10_10_10_REV */
+#endif
+
+#ifndef GL_VERSION_4_0
+#define GL_SAMPLE_SHADING 0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
+#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B
+#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
+/* Reuse tokens from ARB_texture_query_lod (none) */
+/* Reuse tokens from ARB_draw_buffers_blend (none) */
+/* Reuse tokens from ARB_draw_indirect */
+/* reuse GL_DRAW_INDIRECT_BUFFER */
+/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */
+/* Reuse tokens from ARB_gpu_shader5 */
+/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */
+/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */
+/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */
+/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */
+/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */
+/* reuse GL_MAX_VERTEX_STREAMS */
+/* Reuse tokens from ARB_gpu_shader_fp64 */
+/* reuse GL_DOUBLE_VEC2 */
+/* reuse GL_DOUBLE_VEC3 */
+/* reuse GL_DOUBLE_VEC4 */
+/* reuse GL_DOUBLE_MAT2 */
+/* reuse GL_DOUBLE_MAT3 */
+/* reuse GL_DOUBLE_MAT4 */
+/* reuse GL_DOUBLE_MAT2x3 */
+/* reuse GL_DOUBLE_MAT2x4 */
+/* reuse GL_DOUBLE_MAT3x2 */
+/* reuse GL_DOUBLE_MAT3x4 */
+/* reuse GL_DOUBLE_MAT4x2 */
+/* reuse GL_DOUBLE_MAT4x3 */
+/* Reuse tokens from ARB_shader_subroutine */
+/* reuse GL_ACTIVE_SUBROUTINES */
+/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */
+/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */
+/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */
+/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */
+/* reuse GL_MAX_SUBROUTINES */
+/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */
+/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */
+/* reuse GL_COMPATIBLE_SUBROUTINES */
+/* Reuse tokens from ARB_tessellation_shader */
+/* reuse GL_PATCHES */
+/* reuse GL_PATCH_VERTICES */
+/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */
+/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */
+/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */
+/* reuse GL_TESS_GEN_MODE */
+/* reuse GL_TESS_GEN_SPACING */
+/* reuse GL_TESS_GEN_VERTEX_ORDER */
+/* reuse GL_TESS_GEN_POINT_MODE */
+/* reuse GL_ISOLINES */
+/* reuse GL_FRACTIONAL_ODD */
+/* reuse GL_FRACTIONAL_EVEN */
+/* reuse GL_MAX_PATCH_VERTICES */
+/* reuse GL_MAX_TESS_GEN_LEVEL */
+/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */
+/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */
+/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_PATCH_COMPONENTS */
+/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */
+/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */
+/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */
+/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */
+/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */
+/* reuse GL_TESS_EVALUATION_SHADER */
+/* reuse GL_TESS_CONTROL_SHADER */
+/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */
+/* Reuse tokens from ARB_transform_feedback2 */
+/* reuse GL_TRANSFORM_FEEDBACK */
+/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
+/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
+/* reuse GL_TRANSFORM_FEEDBACK_BINDING */
+/* Reuse tokens from ARB_transform_feedback3 */
+/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */
+/* reuse GL_MAX_VERTEX_STREAMS */
+#endif
+
+#ifndef GL_VERSION_4_1
+/* Reuse tokens from ARB_ES2_compatibility */
+/* reuse GL_FIXED */
+/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */
+/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */
+/* reuse GL_LOW_FLOAT */
+/* reuse GL_MEDIUM_FLOAT */
+/* reuse GL_HIGH_FLOAT */
+/* reuse GL_LOW_INT */
+/* reuse GL_MEDIUM_INT */
+/* reuse GL_HIGH_INT */
+/* reuse GL_SHADER_COMPILER */
+/* reuse GL_SHADER_BINARY_FORMATS */
+/* reuse GL_NUM_SHADER_BINARY_FORMATS */
+/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */
+/* reuse GL_MAX_VARYING_VECTORS */
+/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */
+/* reuse GL_RGB565 */
+/* Reuse tokens from ARB_get_program_binary */
+/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
+/* reuse GL_PROGRAM_BINARY_LENGTH */
+/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */
+/* reuse GL_PROGRAM_BINARY_FORMATS */
+/* Reuse tokens from ARB_separate_shader_objects */
+/* reuse GL_VERTEX_SHADER_BIT */
+/* reuse GL_FRAGMENT_SHADER_BIT */
+/* reuse GL_GEOMETRY_SHADER_BIT */
+/* reuse GL_TESS_CONTROL_SHADER_BIT */
+/* reuse GL_TESS_EVALUATION_SHADER_BIT */
+/* reuse GL_ALL_SHADER_BITS */
+/* reuse GL_PROGRAM_SEPARABLE */
+/* reuse GL_ACTIVE_PROGRAM */
+/* reuse GL_PROGRAM_PIPELINE_BINDING */
+/* Reuse tokens from ARB_shader_precision (none) */
+/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */
+/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */
+/* reuse GL_MAX_VIEWPORTS */
+/* reuse GL_VIEWPORT_SUBPIXEL_BITS */
+/* reuse GL_VIEWPORT_BOUNDS_RANGE */
+/* reuse GL_LAYER_PROVOKING_VERTEX */
+/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */
+/* reuse GL_UNDEFINED_VERTEX */
+#endif
+
+#ifndef GL_VERSION_4_2
+/* Reuse tokens from ARB_base_instance (none) */
+/* Reuse tokens from ARB_shading_language_420pack (none) */
+/* Reuse tokens from ARB_transform_feedback_instanced (none) */
+/* Reuse tokens from ARB_compressed_texture_pixel_storage */
+/* reuse GL_UNPACK_COMPRESSED_BLOCK_WIDTH */
+/* reuse GL_UNPACK_COMPRESSED_BLOCK_HEIGHT */
+/* reuse GL_UNPACK_COMPRESSED_BLOCK_DEPTH */
+/* reuse GL_UNPACK_COMPRESSED_BLOCK_SIZE */
+/* reuse GL_PACK_COMPRESSED_BLOCK_WIDTH */
+/* reuse GL_PACK_COMPRESSED_BLOCK_HEIGHT */
+/* reuse GL_PACK_COMPRESSED_BLOCK_DEPTH */
+/* reuse GL_PACK_COMPRESSED_BLOCK_SIZE */
+/* Reuse tokens from ARB_conservative_depth (none) */
+/* Reuse tokens from ARB_internalformat_query */
+/* reuse GL_NUM_SAMPLE_COUNTS */
+/* Reuse tokens from ARB_map_buffer_alignment */
+/* reuse GL_MIN_MAP_BUFFER_ALIGNMENT */
+/* Reuse tokens from ARB_shader_atomic_counters */
+/* reuse GL_ATOMIC_COUNTER_BUFFER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_BINDING */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_START */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_SIZE */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER */
+/* reuse GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_VERTEX_ATOMIC_COUNTERS */
+/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS */
+/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS */
+/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTERS */
+/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTERS */
+/* reuse GL_MAX_COMBINED_ATOMIC_COUNTERS */
+/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE */
+/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS */
+/* reuse GL_ACTIVE_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX */
+/* reuse GL_UNSIGNED_INT_ATOMIC_COUNTER */
+/* Reuse tokens from ARB_shader_image_load_store */
+/* reuse GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT */
+/* reuse GL_ELEMENT_ARRAY_BARRIER_BIT */
+/* reuse GL_UNIFORM_BARRIER_BIT */
+/* reuse GL_TEXTURE_FETCH_BARRIER_BIT */
+/* reuse GL_SHADER_IMAGE_ACCESS_BARRIER_BIT */
+/* reuse GL_COMMAND_BARRIER_BIT */
+/* reuse GL_PIXEL_BUFFER_BARRIER_BIT */
+/* reuse GL_TEXTURE_UPDATE_BARRIER_BIT */
+/* reuse GL_BUFFER_UPDATE_BARRIER_BIT */
+/* reuse GL_FRAMEBUFFER_BARRIER_BIT */
+/* reuse GL_TRANSFORM_FEEDBACK_BARRIER_BIT */
+/* reuse GL_ATOMIC_COUNTER_BARRIER_BIT */
+/* reuse GL_ALL_BARRIER_BITS */
+/* reuse GL_MAX_IMAGE_UNITS */
+/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */
+/* reuse GL_IMAGE_BINDING_NAME */
+/* reuse GL_IMAGE_BINDING_LEVEL */
+/* reuse GL_IMAGE_BINDING_LAYERED */
+/* reuse GL_IMAGE_BINDING_LAYER */
+/* reuse GL_IMAGE_BINDING_ACCESS */
+/* reuse GL_IMAGE_1D */
+/* reuse GL_IMAGE_2D */
+/* reuse GL_IMAGE_3D */
+/* reuse GL_IMAGE_2D_RECT */
+/* reuse GL_IMAGE_CUBE */
+/* reuse GL_IMAGE_BUFFER */
+/* reuse GL_IMAGE_1D_ARRAY */
+/* reuse GL_IMAGE_2D_ARRAY */
+/* reuse GL_IMAGE_CUBE_MAP_ARRAY */
+/* reuse GL_IMAGE_2D_MULTISAMPLE */
+/* reuse GL_IMAGE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_INT_IMAGE_1D */
+/* reuse GL_INT_IMAGE_2D */
+/* reuse GL_INT_IMAGE_3D */
+/* reuse GL_INT_IMAGE_2D_RECT */
+/* reuse GL_INT_IMAGE_CUBE */
+/* reuse GL_INT_IMAGE_BUFFER */
+/* reuse GL_INT_IMAGE_1D_ARRAY */
+/* reuse GL_INT_IMAGE_2D_ARRAY */
+/* reuse GL_INT_IMAGE_CUBE_MAP_ARRAY */
+/* reuse GL_INT_IMAGE_2D_MULTISAMPLE */
+/* reuse GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_UNSIGNED_INT_IMAGE_1D */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D */
+/* reuse GL_UNSIGNED_INT_IMAGE_3D */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D_RECT */
+/* reuse GL_UNSIGNED_INT_IMAGE_CUBE */
+/* reuse GL_UNSIGNED_INT_IMAGE_BUFFER */
+/* reuse GL_UNSIGNED_INT_IMAGE_1D_ARRAY */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D_ARRAY */
+/* reuse GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE */
+/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_MAX_IMAGE_SAMPLES */
+/* reuse GL_IMAGE_BINDING_FORMAT */
+/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */
+/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE */
+/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS */
+/* reuse GL_MAX_VERTEX_IMAGE_UNIFORMS */
+/* reuse GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS */
+/* reuse GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS */
+/* reuse GL_MAX_GEOMETRY_IMAGE_UNIFORMS */
+/* reuse GL_MAX_FRAGMENT_IMAGE_UNIFORMS */
+/* reuse GL_MAX_COMBINED_IMAGE_UNIFORMS */
+/* Reuse tokens from ARB_shading_language_packing (none) */
+/* Reuse tokens from ARB_texture_storage */
+/* reuse GL_TEXTURE_IMMUTABLE_FORMAT */
+#endif
+
+#ifndef GL_VERSION_4_3
+#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9
+#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E
+/* Reuse tokens from ARB_arrays_of_arrays (none, GLSL only) */
+/* Reuse tokens from ARB_fragment_layer_viewport (none, GLSL only) */
+/* Reuse tokens from ARB_shader_image_size (none, GLSL only) */
+/* Reuse tokens from ARB_ES3_compatibility */
+/* reuse GL_COMPRESSED_RGB8_ETC2 */
+/* reuse GL_COMPRESSED_SRGB8_ETC2 */
+/* reuse GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 */
+/* reuse GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 */
+/* reuse GL_COMPRESSED_RGBA8_ETC2_EAC */
+/* reuse GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC */
+/* reuse GL_COMPRESSED_R11_EAC */
+/* reuse GL_COMPRESSED_SIGNED_R11_EAC */
+/* reuse GL_COMPRESSED_RG11_EAC */
+/* reuse GL_COMPRESSED_SIGNED_RG11_EAC */
+/* reuse GL_PRIMITIVE_RESTART_FIXED_INDEX */
+/* reuse GL_ANY_SAMPLES_PASSED_CONSERVATIVE */
+/* reuse GL_MAX_ELEMENT_INDEX */
+/* Reuse tokens from ARB_clear_buffer_object (none) */
+/* Reuse tokens from ARB_compute_shader */
+/* reuse GL_COMPUTE_SHADER */
+/* reuse GL_MAX_COMPUTE_UNIFORM_BLOCKS */
+/* reuse GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS */
+/* reuse GL_MAX_COMPUTE_IMAGE_UNIFORMS */
+/* reuse GL_MAX_COMPUTE_SHARED_MEMORY_SIZE */
+/* reuse GL_MAX_COMPUTE_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS */
+/* reuse GL_MAX_COMPUTE_ATOMIC_COUNTERS */
+/* reuse GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_COMPUTE_LOCAL_INVOCATIONS */
+/* reuse GL_MAX_COMPUTE_WORK_GROUP_COUNT */
+/* reuse GL_MAX_COMPUTE_WORK_GROUP_SIZE */
+/* reuse GL_COMPUTE_LOCAL_WORK_SIZE */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER */
+/* reuse GL_DISPATCH_INDIRECT_BUFFER */
+/* reuse GL_DISPATCH_INDIRECT_BUFFER_BINDING */
+/* Reuse tokens from ARB_copy_image (none) */
+/* Reuse tokens from KHR_debug */
+/* reuse GL_DEBUG_OUTPUT_SYNCHRONOUS */
+/* reuse GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH */
+/* reuse GL_DEBUG_CALLBACK_FUNCTION */
+/* reuse GL_DEBUG_CALLBACK_USER_PARAM */
+/* reuse GL_DEBUG_SOURCE_API */
+/* reuse GL_DEBUG_SOURCE_WINDOW_SYSTEM */
+/* reuse GL_DEBUG_SOURCE_SHADER_COMPILER */
+/* reuse GL_DEBUG_SOURCE_THIRD_PARTY */
+/* reuse GL_DEBUG_SOURCE_APPLICATION */
+/* reuse GL_DEBUG_SOURCE_OTHER */
+/* reuse GL_DEBUG_TYPE_ERROR */
+/* reuse GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR */
+/* reuse GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR */
+/* reuse GL_DEBUG_TYPE_PORTABILITY */
+/* reuse GL_DEBUG_TYPE_PERFORMANCE */
+/* reuse GL_DEBUG_TYPE_OTHER */
+/* reuse GL_MAX_DEBUG_MESSAGE_LENGTH */
+/* reuse GL_MAX_DEBUG_LOGGED_MESSAGES */
+/* reuse GL_DEBUG_LOGGED_MESSAGES */
+/* reuse GL_DEBUG_SEVERITY_HIGH */
+/* reuse GL_DEBUG_SEVERITY_MEDIUM */
+/* reuse GL_DEBUG_SEVERITY_LOW */
+/* reuse GL_DEBUG_TYPE_MARKER */
+/* reuse GL_DEBUG_TYPE_PUSH_GROUP */
+/* reuse GL_DEBUG_TYPE_POP_GROUP */
+/* reuse GL_DEBUG_SEVERITY_NOTIFICATION */
+/* reuse GL_MAX_DEBUG_GROUP_STACK_DEPTH */
+/* reuse GL_DEBUG_GROUP_STACK_DEPTH */
+/* reuse GL_BUFFER */
+/* reuse GL_SHADER */
+/* reuse GL_PROGRAM */
+/* reuse GL_QUERY */
+/* reuse GL_PROGRAM_PIPELINE */
+/* reuse GL_SAMPLER */
+/* reuse GL_DISPLAY_LIST */
+/* reuse GL_MAX_LABEL_LENGTH */
+/* reuse GL_DEBUG_OUTPUT */
+/* reuse GL_CONTEXT_FLAG_DEBUG_BIT */
+/* reuse GL_STACK_UNDERFLOW */
+/* reuse GL_STACK_OVERFLOW */
+/* Reuse tokens from ARB_explicit_uniform_location */
+/* reuse GL_MAX_UNIFORM_LOCATIONS */
+/* Reuse tokens from ARB_framebuffer_no_attachments */
+/* reuse GL_FRAMEBUFFER_DEFAULT_WIDTH */
+/* reuse GL_FRAMEBUFFER_DEFAULT_HEIGHT */
+/* reuse GL_FRAMEBUFFER_DEFAULT_LAYERS */
+/* reuse GL_FRAMEBUFFER_DEFAULT_SAMPLES */
+/* reuse GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS */
+/* reuse GL_MAX_FRAMEBUFFER_WIDTH */
+/* reuse GL_MAX_FRAMEBUFFER_HEIGHT */
+/* reuse GL_MAX_FRAMEBUFFER_LAYERS */
+/* reuse GL_MAX_FRAMEBUFFER_SAMPLES */
+/* Reuse tokens from ARB_internalformat_query2 */
+/* reuse GL_INTERNALFORMAT_SUPPORTED */
+/* reuse GL_INTERNALFORMAT_PREFERRED */
+/* reuse GL_INTERNALFORMAT_RED_SIZE */
+/* reuse GL_INTERNALFORMAT_GREEN_SIZE */
+/* reuse GL_INTERNALFORMAT_BLUE_SIZE */
+/* reuse GL_INTERNALFORMAT_ALPHA_SIZE */
+/* reuse GL_INTERNALFORMAT_DEPTH_SIZE */
+/* reuse GL_INTERNALFORMAT_STENCIL_SIZE */
+/* reuse GL_INTERNALFORMAT_SHARED_SIZE */
+/* reuse GL_INTERNALFORMAT_RED_TYPE */
+/* reuse GL_INTERNALFORMAT_GREEN_TYPE */
+/* reuse GL_INTERNALFORMAT_BLUE_TYPE */
+/* reuse GL_INTERNALFORMAT_ALPHA_TYPE */
+/* reuse GL_INTERNALFORMAT_DEPTH_TYPE */
+/* reuse GL_INTERNALFORMAT_STENCIL_TYPE */
+/* reuse GL_MAX_WIDTH */
+/* reuse GL_MAX_HEIGHT */
+/* reuse GL_MAX_DEPTH */
+/* reuse GL_MAX_LAYERS */
+/* reuse GL_MAX_COMBINED_DIMENSIONS */
+/* reuse GL_COLOR_COMPONENTS */
+/* reuse GL_DEPTH_COMPONENTS */
+/* reuse GL_STENCIL_COMPONENTS */
+/* reuse GL_COLOR_RENDERABLE */
+/* reuse GL_DEPTH_RENDERABLE */
+/* reuse GL_STENCIL_RENDERABLE */
+/* reuse GL_FRAMEBUFFER_RENDERABLE */
+/* reuse GL_FRAMEBUFFER_RENDERABLE_LAYERED */
+/* reuse GL_FRAMEBUFFER_BLEND */
+/* reuse GL_READ_PIXELS */
+/* reuse GL_READ_PIXELS_FORMAT */
+/* reuse GL_READ_PIXELS_TYPE */
+/* reuse GL_TEXTURE_IMAGE_FORMAT */
+/* reuse GL_TEXTURE_IMAGE_TYPE */
+/* reuse GL_GET_TEXTURE_IMAGE_FORMAT */
+/* reuse GL_GET_TEXTURE_IMAGE_TYPE */
+/* reuse GL_MIPMAP */
+/* reuse GL_MANUAL_GENERATE_MIPMAP */
+/* reuse GL_AUTO_GENERATE_MIPMAP */
+/* reuse GL_COLOR_ENCODING */
+/* reuse GL_SRGB_READ */
+/* reuse GL_SRGB_WRITE */
+/* reuse GL_FILTER */
+/* reuse GL_VERTEX_TEXTURE */
+/* reuse GL_TESS_CONTROL_TEXTURE */
+/* reuse GL_TESS_EVALUATION_TEXTURE */
+/* reuse GL_GEOMETRY_TEXTURE */
+/* reuse GL_FRAGMENT_TEXTURE */
+/* reuse GL_COMPUTE_TEXTURE */
+/* reuse GL_TEXTURE_SHADOW */
+/* reuse GL_TEXTURE_GATHER */
+/* reuse GL_TEXTURE_GATHER_SHADOW */
+/* reuse GL_SHADER_IMAGE_LOAD */
+/* reuse GL_SHADER_IMAGE_STORE */
+/* reuse GL_SHADER_IMAGE_ATOMIC */
+/* reuse GL_IMAGE_TEXEL_SIZE */
+/* reuse GL_IMAGE_COMPATIBILITY_CLASS */
+/* reuse GL_IMAGE_PIXEL_FORMAT */
+/* reuse GL_IMAGE_PIXEL_TYPE */
+/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST */
+/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST */
+/* reuse GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE */
+/* reuse GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE */
+/* reuse GL_TEXTURE_COMPRESSED_BLOCK_WIDTH */
+/* reuse GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT */
+/* reuse GL_TEXTURE_COMPRESSED_BLOCK_SIZE */
+/* reuse GL_CLEAR_BUFFER */
+/* reuse GL_TEXTURE_VIEW */
+/* reuse GL_VIEW_COMPATIBILITY_CLASS */
+/* reuse GL_FULL_SUPPORT */
+/* reuse GL_CAVEAT_SUPPORT */
+/* reuse GL_IMAGE_CLASS_4_X_32 */
+/* reuse GL_IMAGE_CLASS_2_X_32 */
+/* reuse GL_IMAGE_CLASS_1_X_32 */
+/* reuse GL_IMAGE_CLASS_4_X_16 */
+/* reuse GL_IMAGE_CLASS_2_X_16 */
+/* reuse GL_IMAGE_CLASS_1_X_16 */
+/* reuse GL_IMAGE_CLASS_4_X_8 */
+/* reuse GL_IMAGE_CLASS_2_X_8 */
+/* reuse GL_IMAGE_CLASS_1_X_8 */
+/* reuse GL_IMAGE_CLASS_11_11_10 */
+/* reuse GL_IMAGE_CLASS_10_10_10_2 */
+/* reuse GL_VIEW_CLASS_128_BITS */
+/* reuse GL_VIEW_CLASS_96_BITS */
+/* reuse GL_VIEW_CLASS_64_BITS */
+/* reuse GL_VIEW_CLASS_48_BITS */
+/* reuse GL_VIEW_CLASS_32_BITS */
+/* reuse GL_VIEW_CLASS_24_BITS */
+/* reuse GL_VIEW_CLASS_16_BITS */
+/* reuse GL_VIEW_CLASS_8_BITS */
+/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGB */
+/* reuse GL_VIEW_CLASS_S3TC_DXT1_RGBA */
+/* reuse GL_VIEW_CLASS_S3TC_DXT3_RGBA */
+/* reuse GL_VIEW_CLASS_S3TC_DXT5_RGBA */
+/* reuse GL_VIEW_CLASS_RGTC1_RED */
+/* reuse GL_VIEW_CLASS_RGTC2_RG */
+/* reuse GL_VIEW_CLASS_BPTC_UNORM */
+/* reuse GL_VIEW_CLASS_BPTC_FLOAT */
+/* Reuse tokens from ARB_invalidate_subdata (none) */
+/* Reuse tokens from ARB_multi_draw_indirect (none) */
+/* Reuse tokens from ARB_program_interface_query */
+/* reuse GL_UNIFORM */
+/* reuse GL_UNIFORM_BLOCK */
+/* reuse GL_PROGRAM_INPUT */
+/* reuse GL_PROGRAM_OUTPUT */
+/* reuse GL_BUFFER_VARIABLE */
+/* reuse GL_SHADER_STORAGE_BLOCK */
+/* reuse GL_VERTEX_SUBROUTINE */
+/* reuse GL_TESS_CONTROL_SUBROUTINE */
+/* reuse GL_TESS_EVALUATION_SUBROUTINE */
+/* reuse GL_GEOMETRY_SUBROUTINE */
+/* reuse GL_FRAGMENT_SUBROUTINE */
+/* reuse GL_COMPUTE_SUBROUTINE */
+/* reuse GL_VERTEX_SUBROUTINE_UNIFORM */
+/* reuse GL_TESS_CONTROL_SUBROUTINE_UNIFORM */
+/* reuse GL_TESS_EVALUATION_SUBROUTINE_UNIFORM */
+/* reuse GL_GEOMETRY_SUBROUTINE_UNIFORM */
+/* reuse GL_FRAGMENT_SUBROUTINE_UNIFORM */
+/* reuse GL_COMPUTE_SUBROUTINE_UNIFORM */
+/* reuse GL_TRANSFORM_FEEDBACK_VARYING */
+/* reuse GL_ACTIVE_RESOURCES */
+/* reuse GL_MAX_NAME_LENGTH */
+/* reuse GL_MAX_NUM_ACTIVE_VARIABLES */
+/* reuse GL_MAX_NUM_COMPATIBLE_SUBROUTINES */
+/* reuse GL_NAME_LENGTH */
+/* reuse GL_TYPE */
+/* reuse GL_ARRAY_SIZE */
+/* reuse GL_OFFSET */
+/* reuse GL_BLOCK_INDEX */
+/* reuse GL_ARRAY_STRIDE */
+/* reuse GL_MATRIX_STRIDE */
+/* reuse GL_IS_ROW_MAJOR */
+/* reuse GL_ATOMIC_COUNTER_BUFFER_INDEX */
+/* reuse GL_BUFFER_BINDING */
+/* reuse GL_BUFFER_DATA_SIZE */
+/* reuse GL_NUM_ACTIVE_VARIABLES */
+/* reuse GL_ACTIVE_VARIABLES */
+/* reuse GL_REFERENCED_BY_VERTEX_SHADER */
+/* reuse GL_REFERENCED_BY_TESS_CONTROL_SHADER */
+/* reuse GL_REFERENCED_BY_TESS_EVALUATION_SHADER */
+/* reuse GL_REFERENCED_BY_GEOMETRY_SHADER */
+/* reuse GL_REFERENCED_BY_FRAGMENT_SHADER */
+/* reuse GL_REFERENCED_BY_COMPUTE_SHADER */
+/* reuse GL_TOP_LEVEL_ARRAY_SIZE */
+/* reuse GL_TOP_LEVEL_ARRAY_STRIDE */
+/* reuse GL_LOCATION */
+/* reuse GL_LOCATION_INDEX */
+/* reuse GL_IS_PER_PATCH */
+/* Reuse tokens from ARB_robust_buffer_access_behavior (none) */
+/* Reuse tokens from ARB_shader_storage_buffer_object */
+/* reuse GL_SHADER_STORAGE_BUFFER */
+/* reuse GL_SHADER_STORAGE_BUFFER_BINDING */
+/* reuse GL_SHADER_STORAGE_BUFFER_START */
+/* reuse GL_SHADER_STORAGE_BUFFER_SIZE */
+/* reuse GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS */
+/* reuse GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS */
+/* reuse GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS */
+/* reuse GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS */
+/* reuse GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS */
+/* reuse GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS */
+/* reuse GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS */
+/* reuse GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS */
+/* reuse GL_MAX_SHADER_STORAGE_BLOCK_SIZE */
+/* reuse GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT */
+/* reuse GL_SHADER_STORAGE_BARRIER_BIT */
+/* reuse GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES */
+/* Reuse tokens from ARB_stencil_texturing */
+/* reuse GL_DEPTH_STENCIL_TEXTURE_MODE */
+/* Reuse tokens from ARB_texture_buffer_range */
+/* reuse GL_TEXTURE_BUFFER_OFFSET */
+/* reuse GL_TEXTURE_BUFFER_SIZE */
+/* reuse GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT */
+/* Reuse tokens from ARB_texture_query_levels (none) */
+/* Reuse tokens from ARB_texture_storage_multisample (none) */
+/* Reuse tokens from ARB_texture_view */
+/* reuse GL_TEXTURE_VIEW_MIN_LEVEL */
+/* reuse GL_TEXTURE_VIEW_NUM_LEVELS */
+/* reuse GL_TEXTURE_VIEW_MIN_LAYER */
+/* reuse GL_TEXTURE_VIEW_NUM_LAYERS */
+/* reuse GL_TEXTURE_IMMUTABLE_LEVELS */
+/* Reuse tokens from ARB_vertex_attrib_binding */
+/* reuse GL_VERTEX_ATTRIB_BINDING */
+/* reuse GL_VERTEX_ATTRIB_RELATIVE_OFFSET */
+/* reuse GL_VERTEX_BINDING_DIVISOR */
+/* reuse GL_VERTEX_BINDING_OFFSET */
+/* reuse GL_VERTEX_BINDING_STRIDE */
+/* reuse GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET */
+/* reuse GL_MAX_VERTEX_ATTRIB_BINDINGS */
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_MULTISAMPLE_ARB 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
+#define GL_SAMPLE_COVERAGE_ARB 0x80A0
+#define GL_SAMPLE_BUFFERS_ARB 0x80A8
+#define GL_SAMPLES_ARB 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
+#define GL_MULTISAMPLE_BIT_ARB 0x20000000
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_NORMAL_MAP_ARB 0x8511
+#define GL_REFLECTION_MAP_ARB 0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_COMPRESSED_ALPHA_ARB 0x84E9
+#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
+#define GL_COMPRESSED_RGB_ARB 0x84ED
+#define GL_COMPRESSED_RGBA_ARB 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
+#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_ARB 0x812D
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_POINT_SIZE_MIN_ARB 0x8126
+#define GL_POINT_SIZE_MAX_ARB 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
+#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
+#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
+#define GL_VERTEX_BLEND_ARB 0x86A7
+#define GL_CURRENT_WEIGHT_ARB 0x86A8
+#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
+#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
+#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
+#define GL_WEIGHT_ARRAY_ARB 0x86AD
+#define GL_MODELVIEW0_ARB 0x1700
+#define GL_MODELVIEW1_ARB 0x850A
+#define GL_MODELVIEW2_ARB 0x8722
+#define GL_MODELVIEW3_ARB 0x8723
+#define GL_MODELVIEW4_ARB 0x8724
+#define GL_MODELVIEW5_ARB 0x8725
+#define GL_MODELVIEW6_ARB 0x8726
+#define GL_MODELVIEW7_ARB 0x8727
+#define GL_MODELVIEW8_ARB 0x8728
+#define GL_MODELVIEW9_ARB 0x8729
+#define GL_MODELVIEW10_ARB 0x872A
+#define GL_MODELVIEW11_ARB 0x872B
+#define GL_MODELVIEW12_ARB 0x872C
+#define GL_MODELVIEW13_ARB 0x872D
+#define GL_MODELVIEW14_ARB 0x872E
+#define GL_MODELVIEW15_ARB 0x872F
+#define GL_MODELVIEW16_ARB 0x8730
+#define GL_MODELVIEW17_ARB 0x8731
+#define GL_MODELVIEW18_ARB 0x8732
+#define GL_MODELVIEW19_ARB 0x8733
+#define GL_MODELVIEW20_ARB 0x8734
+#define GL_MODELVIEW21_ARB 0x8735
+#define GL_MODELVIEW22_ARB 0x8736
+#define GL_MODELVIEW23_ARB 0x8737
+#define GL_MODELVIEW24_ARB 0x8738
+#define GL_MODELVIEW25_ARB 0x8739
+#define GL_MODELVIEW26_ARB 0x873A
+#define GL_MODELVIEW27_ARB 0x873B
+#define GL_MODELVIEW28_ARB 0x873C
+#define GL_MODELVIEW29_ARB 0x873D
+#define GL_MODELVIEW30_ARB 0x873E
+#define GL_MODELVIEW31_ARB 0x873F
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_MATRIX_PALETTE_ARB 0x8840
+#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
+#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
+#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
+#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
+#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_COMBINE_ARB 0x8570
+#define GL_COMBINE_RGB_ARB 0x8571
+#define GL_COMBINE_ALPHA_ARB 0x8572
+#define GL_SOURCE0_RGB_ARB 0x8580
+#define GL_SOURCE1_RGB_ARB 0x8581
+#define GL_SOURCE2_RGB_ARB 0x8582
+#define GL_SOURCE0_ALPHA_ARB 0x8588
+#define GL_SOURCE1_ALPHA_ARB 0x8589
+#define GL_SOURCE2_ALPHA_ARB 0x858A
+#define GL_OPERAND0_RGB_ARB 0x8590
+#define GL_OPERAND1_RGB_ARB 0x8591
+#define GL_OPERAND2_RGB_ARB 0x8592
+#define GL_OPERAND0_ALPHA_ARB 0x8598
+#define GL_OPERAND1_ALPHA_ARB 0x8599
+#define GL_OPERAND2_ALPHA_ARB 0x859A
+#define GL_RGB_SCALE_ARB 0x8573
+#define GL_ADD_SIGNED_ARB 0x8574
+#define GL_INTERPOLATE_ARB 0x8575
+#define GL_SUBTRACT_ARB 0x84E7
+#define GL_CONSTANT_ARB 0x8576
+#define GL_PRIMARY_COLOR_ARB 0x8577
+#define GL_PREVIOUS_ARB 0x8578
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_DOT3_RGB_ARB 0x86AE
+#define GL_DOT3_RGBA_ARB 0x86AF
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_ARB 0x8370
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_DEPTH_COMPONENT16_ARB 0x81A5
+#define GL_DEPTH_COMPONENT24_ARB 0x81A6
+#define GL_DEPTH_COMPONENT32_ARB 0x81A7
+#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
+#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
+#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
+#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
+#endif
+
+#ifndef GL_ARB_window_pos
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_COLOR_SUM_ARB 0x8458
+#define GL_VERTEX_PROGRAM_ARB 0x8620
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
+#define GL_PROGRAM_LENGTH_ARB 0x8627
+#define GL_PROGRAM_STRING_ARB 0x8628
+#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
+#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#define GL_CURRENT_MATRIX_ARB 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
+#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
+#define GL_PROGRAM_BINDING_ARB 0x8677
+#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
+#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
+#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
+#define GL_PROGRAM_FORMAT_ARB 0x8876
+#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
+#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
+#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
+#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
+#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
+#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
+#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
+#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
+#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
+#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
+#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
+#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
+#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
+#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
+#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
+#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
+#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
+#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
+#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
+#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
+#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
+#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
+#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
+#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
+#define GL_MATRIX0_ARB 0x88C0
+#define GL_MATRIX1_ARB 0x88C1
+#define GL_MATRIX2_ARB 0x88C2
+#define GL_MATRIX3_ARB 0x88C3
+#define GL_MATRIX4_ARB 0x88C4
+#define GL_MATRIX5_ARB 0x88C5
+#define GL_MATRIX6_ARB 0x88C6
+#define GL_MATRIX7_ARB 0x88C7
+#define GL_MATRIX8_ARB 0x88C8
+#define GL_MATRIX9_ARB 0x88C9
+#define GL_MATRIX10_ARB 0x88CA
+#define GL_MATRIX11_ARB 0x88CB
+#define GL_MATRIX12_ARB 0x88CC
+#define GL_MATRIX13_ARB 0x88CD
+#define GL_MATRIX14_ARB 0x88CE
+#define GL_MATRIX15_ARB 0x88CF
+#define GL_MATRIX16_ARB 0x88D0
+#define GL_MATRIX17_ARB 0x88D1
+#define GL_MATRIX18_ARB 0x88D2
+#define GL_MATRIX19_ARB 0x88D3
+#define GL_MATRIX20_ARB 0x88D4
+#define GL_MATRIX21_ARB 0x88D5
+#define GL_MATRIX22_ARB 0x88D6
+#define GL_MATRIX23_ARB 0x88D7
+#define GL_MATRIX24_ARB 0x88D8
+#define GL_MATRIX25_ARB 0x88D9
+#define GL_MATRIX26_ARB 0x88DA
+#define GL_MATRIX27_ARB 0x88DB
+#define GL_MATRIX28_ARB 0x88DC
+#define GL_MATRIX29_ARB 0x88DD
+#define GL_MATRIX30_ARB 0x88DE
+#define GL_MATRIX31_ARB 0x88DF
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_FRAGMENT_PROGRAM_ARB 0x8804
+#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
+#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
+#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
+#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
+#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
+#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
+#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
+#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
+#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
+#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
+#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
+#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
+#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_BUFFER_SIZE_ARB 0x8764
+#define GL_BUFFER_USAGE_ARB 0x8765
+#define GL_ARRAY_BUFFER_ARB 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
+#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
+#define GL_READ_ONLY_ARB 0x88B8
+#define GL_WRITE_ONLY_ARB 0x88B9
+#define GL_READ_WRITE_ARB 0x88BA
+#define GL_BUFFER_ACCESS_ARB 0x88BB
+#define GL_BUFFER_MAPPED_ARB 0x88BC
+#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
+#define GL_STREAM_DRAW_ARB 0x88E0
+#define GL_STREAM_READ_ARB 0x88E1
+#define GL_STREAM_COPY_ARB 0x88E2
+#define GL_STATIC_DRAW_ARB 0x88E4
+#define GL_STATIC_READ_ARB 0x88E5
+#define GL_STATIC_COPY_ARB 0x88E6
+#define GL_DYNAMIC_DRAW_ARB 0x88E8
+#define GL_DYNAMIC_READ_ARB 0x88E9
+#define GL_DYNAMIC_COPY_ARB 0x88EA
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_QUERY_COUNTER_BITS_ARB 0x8864
+#define GL_CURRENT_QUERY_ARB 0x8865
+#define GL_QUERY_RESULT_ARB 0x8866
+#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
+#define GL_SAMPLES_PASSED_ARB 0x8914
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_PROGRAM_OBJECT_ARB 0x8B40
+#define GL_SHADER_OBJECT_ARB 0x8B48
+#define GL_OBJECT_TYPE_ARB 0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
+#define GL_FLOAT_VEC2_ARB 0x8B50
+#define GL_FLOAT_VEC3_ARB 0x8B51
+#define GL_FLOAT_VEC4_ARB 0x8B52
+#define GL_INT_VEC2_ARB 0x8B53
+#define GL_INT_VEC3_ARB 0x8B54
+#define GL_INT_VEC4_ARB 0x8B55
+#define GL_BOOL_ARB 0x8B56
+#define GL_BOOL_VEC2_ARB 0x8B57
+#define GL_BOOL_VEC3_ARB 0x8B58
+#define GL_BOOL_VEC4_ARB 0x8B59
+#define GL_FLOAT_MAT2_ARB 0x8B5A
+#define GL_FLOAT_MAT3_ARB 0x8B5B
+#define GL_FLOAT_MAT4_ARB 0x8B5C
+#define GL_SAMPLER_1D_ARB 0x8B5D
+#define GL_SAMPLER_2D_ARB 0x8B5E
+#define GL_SAMPLER_3D_ARB 0x8B5F
+#define GL_SAMPLER_CUBE_ARB 0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
+#define GL_SAMPLER_2D_RECT_ARB 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
+#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_VERTEX_SHADER_ARB 0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_FRAGMENT_SHADER_ARB 0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_POINT_SPRITE_ARB 0x8861
+#define GL_COORD_REPLACE_ARB 0x8862
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
+#define GL_DRAW_BUFFER0_ARB 0x8825
+#define GL_DRAW_BUFFER1_ARB 0x8826
+#define GL_DRAW_BUFFER2_ARB 0x8827
+#define GL_DRAW_BUFFER3_ARB 0x8828
+#define GL_DRAW_BUFFER4_ARB 0x8829
+#define GL_DRAW_BUFFER5_ARB 0x882A
+#define GL_DRAW_BUFFER6_ARB 0x882B
+#define GL_DRAW_BUFFER7_ARB 0x882C
+#define GL_DRAW_BUFFER8_ARB 0x882D
+#define GL_DRAW_BUFFER9_ARB 0x882E
+#define GL_DRAW_BUFFER10_ARB 0x882F
+#define GL_DRAW_BUFFER11_ARB 0x8830
+#define GL_DRAW_BUFFER12_ARB 0x8831
+#define GL_DRAW_BUFFER13_ARB 0x8832
+#define GL_DRAW_BUFFER14_ARB 0x8833
+#define GL_DRAW_BUFFER15_ARB 0x8834
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_RGBA_FLOAT_MODE_ARB 0x8820
+#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
+#define GL_CLAMP_READ_COLOR_ARB 0x891C
+#define GL_FIXED_ONLY_ARB 0x891D
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_HALF_FLOAT_ARB 0x140B
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
+#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
+#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
+#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
+#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
+#define GL_RGBA32F_ARB 0x8814
+#define GL_RGB32F_ARB 0x8815
+#define GL_ALPHA32F_ARB 0x8816
+#define GL_INTENSITY32F_ARB 0x8817
+#define GL_LUMINANCE32F_ARB 0x8818
+#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
+#define GL_RGBA16F_ARB 0x881A
+#define GL_RGB16F_ARB 0x881B
+#define GL_ALPHA16F_ARB 0x881C
+#define GL_INTENSITY16F_ARB 0x881D
+#define GL_LUMINANCE16F_ARB 0x881E
+#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
+#endif
+
+#ifndef GL_ARB_depth_buffer_float
+#define GL_DEPTH_COMPONENT32F 0x8CAC
+#define GL_DEPTH32F_STENCIL8 0x8CAD
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+#endif
+
+#ifndef GL_ARB_draw_instanced
+#endif
+
+#ifndef GL_ARB_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
+#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_MAX_RENDERBUFFER_SIZE 0x84E8
+#define GL_DEPTH_STENCIL 0x84F9
+#define GL_UNSIGNED_INT_24_8 0x84FA
+#define GL_DEPTH24_STENCIL8 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE 0x88F1
+#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_UNSIGNED_NORMALIZED 0x8C17
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
+#define GL_RENDERBUFFER_BINDING 0x8CA7
+#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_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_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
+#define GL_COLOR_ATTACHMENT0 0x8CE0
+#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_DEPTH_ATTACHMENT 0x8D00
+#define GL_STENCIL_ATTACHMENT 0x8D20
+#define GL_FRAMEBUFFER 0x8D40
+#define GL_RENDERBUFFER 0x8D41
+#define GL_RENDERBUFFER_WIDTH 0x8D42
+#define GL_RENDERBUFFER_HEIGHT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
+#define GL_STENCIL_INDEX1 0x8D46
+#define GL_STENCIL_INDEX4 0x8D47
+#define GL_STENCIL_INDEX8 0x8D48
+#define GL_STENCIL_INDEX16 0x8D49
+#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_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_MAX_SAMPLES 0x8D57
+#define GL_INDEX 0x8222
+#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
+#endif
+
+#ifndef GL_ARB_framebuffer_sRGB
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+#endif
+
+#ifndef GL_ARB_geometry_shader4
+#define GL_LINES_ADJACENCY_ARB 0x000A
+#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B
+#define GL_TRIANGLES_ADJACENCY_ARB 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D
+#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
+#define GL_GEOMETRY_SHADER_ARB 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
+/* reuse GL_MAX_VARYING_COMPONENTS */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+#endif
+
+#ifndef GL_ARB_half_float_vertex
+#define GL_HALF_FLOAT 0x140B
+#endif
+
+#ifndef GL_ARB_instanced_arrays
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
+#endif
+
+#ifndef GL_ARB_map_buffer_range
+#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
+#endif
+
+#ifndef GL_ARB_texture_buffer_object
+#define GL_TEXTURE_BUFFER_ARB 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
+#endif
+
+#ifndef GL_ARB_texture_compression_rgtc
+#define GL_COMPRESSED_RED_RGTC1 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
+#define GL_COMPRESSED_RG_RGTC2 0x8DBD
+#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
+#endif
+
+#ifndef GL_ARB_texture_rg
+#define GL_RG 0x8227
+#define GL_RG_INTEGER 0x8228
+#define GL_R8 0x8229
+#define GL_R16 0x822A
+#define GL_RG8 0x822B
+#define GL_RG16 0x822C
+#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
+#endif
+
+#ifndef GL_ARB_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING 0x85B5
+#endif
+
+#ifndef GL_ARB_uniform_buffer_object
+#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_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
+#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_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
+#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_GEOMETRY_SHADER 0x8A45
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
+#define GL_INVALID_INDEX 0xFFFFFFFFu
+#endif
+
+#ifndef GL_ARB_compatibility
+/* ARB_compatibility just defines tokens from core 3.0 */
+#endif
+
+#ifndef GL_ARB_copy_buffer
+#define GL_COPY_READ_BUFFER_BINDING 0x8F36
+#define GL_COPY_READ_BUFFER GL_COPY_READ_BUFFER_BINDING
+#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
+#define GL_COPY_WRITE_BUFFER GL_COPY_WRITE_BUFFER_BINDING
+#endif
+
+#ifndef GL_ARB_shader_texture_lod
+#endif
+
+#ifndef GL_ARB_depth_clamp
+#define GL_DEPTH_CLAMP 0x864F
+#endif
+
+#ifndef GL_ARB_draw_elements_base_vertex
+#endif
+
+#ifndef GL_ARB_fragment_coord_conventions
+#endif
+
+#ifndef GL_ARB_provoking_vertex
+#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
+#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
+#define GL_LAST_VERTEX_CONVENTION 0x8E4E
+#define GL_PROVOKING_VERTEX 0x8E4F
+#endif
+
+#ifndef GL_ARB_seamless_cube_map
+#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
+#endif
+
+#ifndef GL_ARB_sync
+#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
+#endif
+
+#ifndef GL_ARB_texture_multisample
+#define GL_SAMPLE_POSITION 0x8E50
+#define GL_SAMPLE_MASK 0x8E51
+#define GL_SAMPLE_MASK_VALUE 0x8E52
+#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
+#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
+#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
+#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
+#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
+#define GL_TEXTURE_SAMPLES 0x9106
+#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
+#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
+#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
+#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
+#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
+#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
+#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
+#define GL_MAX_INTEGER_SAMPLES 0x9110
+#endif
+
+#ifndef GL_ARB_vertex_array_bgra
+/* reuse GL_BGRA */
+#endif
+
+#ifndef GL_ARB_draw_buffers_blend
+#endif
+
+#ifndef GL_ARB_sample_shading
+#define GL_SAMPLE_SHADING_ARB 0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37
+#endif
+
+#ifndef GL_ARB_texture_cube_map_array
+#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
+#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
+#endif
+
+#ifndef GL_ARB_texture_gather
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F
+#endif
+
+#ifndef GL_ARB_texture_query_lod
+#endif
+
+#ifndef GL_ARB_shading_language_include
+#define GL_SHADER_INCLUDE_ARB 0x8DAE
+#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9
+#define GL_NAMED_STRING_TYPE_ARB 0x8DEA
+#endif
+
+#ifndef GL_ARB_texture_compression_bptc
+#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
+#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
+#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
+#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
+#endif
+
+#ifndef GL_ARB_blend_func_extended
+#define GL_SRC1_COLOR 0x88F9
+/* reuse GL_SRC1_ALPHA */
+#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
+#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
+#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
+#endif
+
+#ifndef GL_ARB_explicit_attrib_location
+#endif
+
+#ifndef GL_ARB_occlusion_query2
+#define GL_ANY_SAMPLES_PASSED 0x8C2F
+#endif
+
+#ifndef GL_ARB_sampler_objects
+#define GL_SAMPLER_BINDING 0x8919
+#endif
+
+#ifndef GL_ARB_shader_bit_encoding
+#endif
+
+#ifndef GL_ARB_texture_rgb10_a2ui
+#define GL_RGB10_A2UI 0x906F
+#endif
+
+#ifndef GL_ARB_texture_swizzle
+#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_TEXTURE_SWIZZLE_RGBA 0x8E46
+#endif
+
+#ifndef GL_ARB_timer_query
+#define GL_TIME_ELAPSED 0x88BF
+#define GL_TIMESTAMP 0x8E28
+#endif
+
+#ifndef GL_ARB_vertex_type_2_10_10_10_rev
+/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */
+#define GL_INT_2_10_10_10_REV 0x8D9F
+#endif
+
+#ifndef GL_ARB_draw_indirect
+#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
+#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43
+#endif
+
+#ifndef GL_ARB_gpu_shader5
+#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F
+#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
+#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
+#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
+#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
+/* reuse GL_MAX_VERTEX_STREAMS */
+#endif
+
+#ifndef GL_ARB_gpu_shader_fp64
+/* reuse GL_DOUBLE */
+#define GL_DOUBLE_VEC2 0x8FFC
+#define GL_DOUBLE_VEC3 0x8FFD
+#define GL_DOUBLE_VEC4 0x8FFE
+#define GL_DOUBLE_MAT2 0x8F46
+#define GL_DOUBLE_MAT3 0x8F47
+#define GL_DOUBLE_MAT4 0x8F48
+#define GL_DOUBLE_MAT2x3 0x8F49
+#define GL_DOUBLE_MAT2x4 0x8F4A
+#define GL_DOUBLE_MAT3x2 0x8F4B
+#define GL_DOUBLE_MAT3x4 0x8F4C
+#define GL_DOUBLE_MAT4x2 0x8F4D
+#define GL_DOUBLE_MAT4x3 0x8F4E
+#endif
+
+#ifndef GL_ARB_shader_subroutine
+#define GL_ACTIVE_SUBROUTINES 0x8DE5
+#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6
+#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
+#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48
+#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49
+#define GL_MAX_SUBROUTINES 0x8DE7
+#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
+#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A
+#define GL_COMPATIBLE_SUBROUTINES 0x8E4B
+/* reuse GL_UNIFORM_SIZE */
+/* reuse GL_UNIFORM_NAME_LENGTH */
+#endif
+
+#ifndef GL_ARB_tessellation_shader
+#define GL_PATCHES 0x000E
+#define GL_PATCH_VERTICES 0x8E72
+#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73
+#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74
+#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75
+#define GL_TESS_GEN_MODE 0x8E76
+#define GL_TESS_GEN_SPACING 0x8E77
+#define GL_TESS_GEN_VERTEX_ORDER 0x8E78
+#define GL_TESS_GEN_POINT_MODE 0x8E79
+/* reuse GL_TRIANGLES */
+/* reuse GL_QUADS */
+#define GL_ISOLINES 0x8E7A
+/* reuse GL_EQUAL */
+#define GL_FRACTIONAL_ODD 0x8E7B
+#define GL_FRACTIONAL_EVEN 0x8E7C
+/* reuse GL_CCW */
+/* reuse GL_CW */
+#define GL_MAX_PATCH_VERTICES 0x8E7D
+#define GL_MAX_TESS_GEN_LEVEL 0x8E7E
+#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
+#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
+#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
+#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
+#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
+#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84
+#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
+#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
+#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
+#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
+#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
+#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
+#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
+#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
+#define GL_TESS_EVALUATION_SHADER 0x8E87
+#define GL_TESS_CONTROL_SHADER 0x8E88
+#endif
+
+#ifndef GL_ARB_texture_buffer_object_rgb32
+/* reuse GL_RGB32F */
+/* reuse GL_RGB32UI */
+/* reuse GL_RGB32I */
+#endif
+
+#ifndef GL_ARB_transform_feedback2
+#define GL_TRANSFORM_FEEDBACK 0x8E22
+#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23
+#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED GL_TRANSFORM_FEEDBACK_PAUSED
+#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
+#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE GL_TRANSFORM_FEEDBACK_ACTIVE
+#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
+#endif
+
+#ifndef GL_ARB_transform_feedback3
+#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
+#define GL_MAX_VERTEX_STREAMS 0x8E71
+#endif
+
+#ifndef GL_ARB_ES2_compatibility
+#define GL_FIXED 0x140C
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#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_SHADER_COMPILER 0x8DFA
+#define GL_SHADER_BINARY_FORMATS 0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
+#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
+#define GL_MAX_VARYING_VECTORS 0x8DFC
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
+#define GL_RGB565 0x8D62
+#endif
+
+#ifndef GL_ARB_get_program_binary
+#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
+#endif
+
+#ifndef GL_ARB_separate_shader_objects
+#define GL_VERTEX_SHADER_BIT 0x00000001
+#define GL_FRAGMENT_SHADER_BIT 0x00000002
+#define GL_GEOMETRY_SHADER_BIT 0x00000004
+#define GL_TESS_CONTROL_SHADER_BIT 0x00000008
+#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
+#define GL_ALL_SHADER_BITS 0xFFFFFFFF
+#define GL_PROGRAM_SEPARABLE 0x8258
+#define GL_ACTIVE_PROGRAM 0x8259
+#define GL_PROGRAM_PIPELINE_BINDING 0x825A
+#endif
+
+#ifndef GL_ARB_shader_precision
+#endif
+
+#ifndef GL_ARB_vertex_attrib_64bit
+/* reuse GL_RGB32I */
+/* reuse GL_DOUBLE_VEC2 */
+/* reuse GL_DOUBLE_VEC3 */
+/* reuse GL_DOUBLE_VEC4 */
+/* reuse GL_DOUBLE_MAT2 */
+/* reuse GL_DOUBLE_MAT3 */
+/* reuse GL_DOUBLE_MAT4 */
+/* reuse GL_DOUBLE_MAT2x3 */
+/* reuse GL_DOUBLE_MAT2x4 */
+/* reuse GL_DOUBLE_MAT3x2 */
+/* reuse GL_DOUBLE_MAT3x4 */
+/* reuse GL_DOUBLE_MAT4x2 */
+/* reuse GL_DOUBLE_MAT4x3 */
+#endif
+
+#ifndef GL_ARB_viewport_array
+/* reuse GL_SCISSOR_BOX */
+/* reuse GL_VIEWPORT */
+/* reuse GL_DEPTH_RANGE */
+/* reuse GL_SCISSOR_TEST */
+#define GL_MAX_VIEWPORTS 0x825B
+#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C
+#define GL_VIEWPORT_BOUNDS_RANGE 0x825D
+#define GL_LAYER_PROVOKING_VERTEX 0x825E
+#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
+#define GL_UNDEFINED_VERTEX 0x8260
+/* reuse GL_FIRST_VERTEX_CONVENTION */
+/* reuse GL_LAST_VERTEX_CONVENTION */
+/* reuse GL_PROVOKING_VERTEX */
+#endif
+
+#ifndef GL_ARB_cl_event
+#define GL_SYNC_CL_EVENT_ARB 0x8240
+#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241
+#endif
+
+#ifndef GL_ARB_debug_output
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
+#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
+#define GL_DEBUG_SOURCE_API_ARB 0x8246
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
+#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
+#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
+#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
+#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
+#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
+#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
+#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
+#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
+#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
+#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
+#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
+#endif
+
+#ifndef GL_ARB_robustness
+/* reuse GL_NO_ERROR */
+#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
+#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
+#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
+#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
+#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
+#endif
+
+#ifndef GL_ARB_shader_stencil_export
+#endif
+
+#ifndef GL_ARB_base_instance
+#endif
+
+#ifndef GL_ARB_shading_language_420pack
+#endif
+
+#ifndef GL_ARB_transform_feedback_instanced
+#endif
+
+#ifndef GL_ARB_compressed_texture_pixel_storage
+#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127
+#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128
+#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129
+#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A
+#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B
+#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C
+#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D
+#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E
+#endif
+
+#ifndef GL_ARB_conservative_depth
+#endif
+
+#ifndef GL_ARB_internalformat_query
+#define GL_NUM_SAMPLE_COUNTS 0x9380
+#endif
+
+#ifndef GL_ARB_map_buffer_alignment
+#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC
+#endif
+
+#ifndef GL_ARB_shader_atomic_counters
+#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
+#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
+#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
+#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
+#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4
+#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5
+#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB
+#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF
+#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_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5
+#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_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA
+#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
+#endif
+
+#ifndef GL_ARB_shader_image_load_store
+#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_MAX_IMAGE_UNITS 0x8F38
+#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
+#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_1D 0x904C
+#define GL_IMAGE_2D 0x904D
+#define GL_IMAGE_3D 0x904E
+#define GL_IMAGE_2D_RECT 0x904F
+#define GL_IMAGE_CUBE 0x9050
+#define GL_IMAGE_BUFFER 0x9051
+#define GL_IMAGE_1D_ARRAY 0x9052
+#define GL_IMAGE_2D_ARRAY 0x9053
+#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
+#define GL_IMAGE_2D_MULTISAMPLE 0x9055
+#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
+#define GL_INT_IMAGE_1D 0x9057
+#define GL_INT_IMAGE_2D 0x9058
+#define GL_INT_IMAGE_3D 0x9059
+#define GL_INT_IMAGE_2D_RECT 0x905A
+#define GL_INT_IMAGE_CUBE 0x905B
+#define GL_INT_IMAGE_BUFFER 0x905C
+#define GL_INT_IMAGE_1D_ARRAY 0x905D
+#define GL_INT_IMAGE_2D_ARRAY 0x905E
+#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
+#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
+#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
+#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
+#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
+#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
+#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
+#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
+#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
+#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
+#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
+#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
+#define GL_MAX_IMAGE_SAMPLES 0x906D
+#define GL_IMAGE_BINDING_FORMAT 0x906E
+#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_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
+#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
+#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
+#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
+#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
+#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
+#endif
+
+#ifndef GL_ARB_shading_language_packing
+#endif
+
+#ifndef GL_ARB_texture_storage
+#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
+#endif
+
+#ifndef GL_KHR_texture_compression_astc_ldr
+#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
+
+#ifndef GL_KHR_debug
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
+#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
+#define GL_DEBUG_SOURCE_API 0x8246
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
+#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
+#define GL_DEBUG_SOURCE_APPLICATION 0x824A
+#define GL_DEBUG_SOURCE_OTHER 0x824B
+#define GL_DEBUG_TYPE_ERROR 0x824C
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
+#define GL_DEBUG_TYPE_PORTABILITY 0x824F
+#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
+#define GL_DEBUG_TYPE_OTHER 0x8251
+#define GL_DEBUG_TYPE_MARKER 0x8268
+#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
+#define GL_DEBUG_TYPE_POP_GROUP 0x826A
+#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
+#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
+#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
+#define GL_BUFFER 0x82E0
+#define GL_SHADER 0x82E1
+#define GL_PROGRAM 0x82E2
+#define GL_QUERY 0x82E3
+#define GL_PROGRAM_PIPELINE 0x82E4
+#define GL_SAMPLER 0x82E6
+#define GL_DISPLAY_LIST 0x82E7
+/* DISPLAY_LIST used in compatibility profile only */
+#define GL_MAX_LABEL_LENGTH 0x82E8
+#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
+#define GL_DEBUG_LOGGED_MESSAGES 0x9145
+#define GL_DEBUG_SEVERITY_HIGH 0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
+#define GL_DEBUG_SEVERITY_LOW 0x9148
+#define GL_DEBUG_OUTPUT 0x92E0
+#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
+/* reuse GL_STACK_UNDERFLOW */
+/* reuse GL_STACK_OVERFLOW */
+#endif
+
+#ifndef GL_ARB_arrays_of_arrays
+#endif
+
+#ifndef GL_ARB_clear_buffer_object
+#endif
+
+#ifndef GL_ARB_compute_shader
+#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_LOCAL_INVOCATIONS 0x90EB
+#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE
+#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF
+#define GL_COMPUTE_LOCAL_WORK_SIZE 0x8267
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED
+#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
+#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
+#define GL_COMPUTE_SHADER_BIT 0x00000020
+#endif
+
+#ifndef GL_ARB_copy_image
+#endif
+
+#ifndef GL_ARB_texture_view
+#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB
+#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC
+#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD
+#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE
+#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
+#endif
+
+#ifndef GL_ARB_vertex_attrib_binding
+#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_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
+#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA
+#endif
+
+#ifndef GL_ARB_robustness_isolation
+#endif
+
+#ifndef GL_ARB_ES3_compatibility
+#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_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_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
+#define GL_MAX_ELEMENT_INDEX 0x8D6B
+#endif
+
+#ifndef GL_ARB_explicit_uniform_location
+#define GL_MAX_UNIFORM_LOCATIONS 0x826E
+#endif
+
+#ifndef GL_ARB_fragment_layer_viewport
+#endif
+
+#ifndef GL_ARB_framebuffer_no_attachments
+#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
+#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
+#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312
+#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_LAYERS 0x9317
+#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318
+#endif
+
+#ifndef GL_ARB_internalformat_query2
+/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */
+/* reuse GL_NUM_SAMPLE_COUNTS */
+/* reuse GL_RENDERBUFFER */
+/* reuse GL_SAMPLES */
+/* reuse GL_TEXTURE_1D */
+/* reuse GL_TEXTURE_1D_ARRAY */
+/* reuse GL_TEXTURE_2D */
+/* reuse GL_TEXTURE_2D_ARRAY */
+/* reuse GL_TEXTURE_3D */
+/* reuse GL_TEXTURE_CUBE_MAP */
+/* reuse GL_TEXTURE_CUBE_MAP_ARRAY */
+/* reuse GL_TEXTURE_RECTANGLE */
+/* reuse GL_TEXTURE_BUFFER */
+/* reuse GL_TEXTURE_2D_MULTISAMPLE */
+/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
+/* reuse GL_TEXTURE_COMPRESSED */
+#define GL_INTERNALFORMAT_SUPPORTED 0x826F
+#define GL_INTERNALFORMAT_PREFERRED 0x8270
+#define GL_INTERNALFORMAT_RED_SIZE 0x8271
+#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272
+#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273
+#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274
+#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275
+#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276
+#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277
+#define GL_INTERNALFORMAT_RED_TYPE 0x8278
+#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279
+#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A
+#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B
+#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C
+#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D
+#define GL_MAX_WIDTH 0x827E
+#define GL_MAX_HEIGHT 0x827F
+#define GL_MAX_DEPTH 0x8280
+#define GL_MAX_LAYERS 0x8281
+#define GL_MAX_COMBINED_DIMENSIONS 0x8282
+#define GL_COLOR_COMPONENTS 0x8283
+#define GL_DEPTH_COMPONENTS 0x8284
+#define GL_STENCIL_COMPONENTS 0x8285
+#define GL_COLOR_RENDERABLE 0x8286
+#define GL_DEPTH_RENDERABLE 0x8287
+#define GL_STENCIL_RENDERABLE 0x8288
+#define GL_FRAMEBUFFER_RENDERABLE 0x8289
+#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A
+#define GL_FRAMEBUFFER_BLEND 0x828B
+#define GL_READ_PIXELS 0x828C
+#define GL_READ_PIXELS_FORMAT 0x828D
+#define GL_READ_PIXELS_TYPE 0x828E
+#define GL_TEXTURE_IMAGE_FORMAT 0x828F
+#define GL_TEXTURE_IMAGE_TYPE 0x8290
+#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291
+#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292
+#define GL_MIPMAP 0x8293
+#define GL_MANUAL_GENERATE_MIPMAP 0x8294
+#define GL_AUTO_GENERATE_MIPMAP 0x8295
+#define GL_COLOR_ENCODING 0x8296
+#define GL_SRGB_READ 0x8297
+#define GL_SRGB_WRITE 0x8298
+#define GL_SRGB_DECODE_ARB 0x8299
+#define GL_FILTER 0x829A
+#define GL_VERTEX_TEXTURE 0x829B
+#define GL_TESS_CONTROL_TEXTURE 0x829C
+#define GL_TESS_EVALUATION_TEXTURE 0x829D
+#define GL_GEOMETRY_TEXTURE 0x829E
+#define GL_FRAGMENT_TEXTURE 0x829F
+#define GL_COMPUTE_TEXTURE 0x82A0
+#define GL_TEXTURE_SHADOW 0x82A1
+#define GL_TEXTURE_GATHER 0x82A2
+#define GL_TEXTURE_GATHER_SHADOW 0x82A3
+#define GL_SHADER_IMAGE_LOAD 0x82A4
+#define GL_SHADER_IMAGE_STORE 0x82A5
+#define GL_SHADER_IMAGE_ATOMIC 0x82A6
+#define GL_IMAGE_TEXEL_SIZE 0x82A7
+#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8
+#define GL_IMAGE_PIXEL_FORMAT 0x82A9
+#define GL_IMAGE_PIXEL_TYPE 0x82AA
+#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC
+#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD
+#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE
+#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF
+#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1
+#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2
+#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3
+#define GL_CLEAR_BUFFER 0x82B4
+#define GL_TEXTURE_VIEW 0x82B5
+#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6
+#define GL_FULL_SUPPORT 0x82B7
+#define GL_CAVEAT_SUPPORT 0x82B8
+#define GL_IMAGE_CLASS_4_X_32 0x82B9
+#define GL_IMAGE_CLASS_2_X_32 0x82BA
+#define GL_IMAGE_CLASS_1_X_32 0x82BB
+#define GL_IMAGE_CLASS_4_X_16 0x82BC
+#define GL_IMAGE_CLASS_2_X_16 0x82BD
+#define GL_IMAGE_CLASS_1_X_16 0x82BE
+#define GL_IMAGE_CLASS_4_X_8 0x82BF
+#define GL_IMAGE_CLASS_2_X_8 0x82C0
+#define GL_IMAGE_CLASS_1_X_8 0x82C1
+#define GL_IMAGE_CLASS_11_11_10 0x82C2
+#define GL_IMAGE_CLASS_10_10_10_2 0x82C3
+#define GL_VIEW_CLASS_128_BITS 0x82C4
+#define GL_VIEW_CLASS_96_BITS 0x82C5
+#define GL_VIEW_CLASS_64_BITS 0x82C6
+#define GL_VIEW_CLASS_48_BITS 0x82C7
+#define GL_VIEW_CLASS_32_BITS 0x82C8
+#define GL_VIEW_CLASS_24_BITS 0x82C9
+#define GL_VIEW_CLASS_16_BITS 0x82CA
+#define GL_VIEW_CLASS_8_BITS 0x82CB
+#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC
+#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD
+#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE
+#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF
+#define GL_VIEW_CLASS_RGTC1_RED 0x82D0
+#define GL_VIEW_CLASS_RGTC2_RG 0x82D1
+#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2
+#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3
+#endif
+
+#ifndef GL_ARB_invalidate_subdata
+#endif
+
+#ifndef GL_ARB_multi_draw_indirect
+#endif
+
+#ifndef GL_ARB_program_interface_query
+#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
+/* reuse GL_ATOMIC_COUNTER_BUFFER */
+#define GL_VERTEX_SUBROUTINE 0x92E8
+#define GL_TESS_CONTROL_SUBROUTINE 0x92E9
+#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA
+#define GL_GEOMETRY_SUBROUTINE 0x92EB
+#define GL_FRAGMENT_SUBROUTINE 0x92EC
+#define GL_COMPUTE_SUBROUTINE 0x92ED
+#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE
+#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF
+#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0
+#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1
+#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2
+#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3
+#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_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8
+#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_TESS_CONTROL_SHADER 0x9307
+#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308
+#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309
+#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_LOCATION_INDEX 0x930F
+#define GL_IS_PER_PATCH 0x92E7
+/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */
+/* reuse GL_COMPATIBLE_SUBROUTINES */
+#endif
+
+#ifndef GL_ARB_robust_buffer_access_behavior
+#endif
+
+#ifndef GL_ARB_shader_image_size
+#endif
+
+#ifndef GL_ARB_shader_storage_buffer_object
+#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_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7
+#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8
+#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9
+#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 0x2000
+#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS
+/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */
+#endif
+
+#ifndef GL_ARB_stencil_texturing
+#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA
+#endif
+
+#ifndef GL_ARB_texture_buffer_range
+#define GL_TEXTURE_BUFFER_OFFSET 0x919D
+#define GL_TEXTURE_BUFFER_SIZE 0x919E
+#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F
+#endif
+
+#ifndef GL_ARB_texture_query_levels
+#endif
+
+#ifndef GL_ARB_texture_storage_multisample
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_ABGR_EXT 0x8000
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_CONSTANT_COLOR_EXT 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
+#define GL_CONSTANT_ALPHA_EXT 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
+#define GL_BLEND_COLOR_EXT 0x8005
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_POLYGON_OFFSET_EXT 0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_ALPHA4_EXT 0x803B
+#define GL_ALPHA8_EXT 0x803C
+#define GL_ALPHA12_EXT 0x803D
+#define GL_ALPHA16_EXT 0x803E
+#define GL_LUMINANCE4_EXT 0x803F
+#define GL_LUMINANCE8_EXT 0x8040
+#define GL_LUMINANCE12_EXT 0x8041
+#define GL_LUMINANCE16_EXT 0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
+#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
+#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
+#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
+#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
+#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
+#define GL_INTENSITY_EXT 0x8049
+#define GL_INTENSITY4_EXT 0x804A
+#define GL_INTENSITY8_EXT 0x804B
+#define GL_INTENSITY12_EXT 0x804C
+#define GL_INTENSITY16_EXT 0x804D
+#define GL_RGB2_EXT 0x804E
+#define GL_RGB4_EXT 0x804F
+#define GL_RGB5_EXT 0x8050
+#define GL_RGB8_EXT 0x8051
+#define GL_RGB10_EXT 0x8052
+#define GL_RGB12_EXT 0x8053
+#define GL_RGB16_EXT 0x8054
+#define GL_RGBA2_EXT 0x8055
+#define GL_RGBA4_EXT 0x8056
+#define GL_RGB5_A1_EXT 0x8057
+#define GL_RGBA8_EXT 0x8058
+#define GL_RGB10_A2_EXT 0x8059
+#define GL_RGBA12_EXT 0x805A
+#define GL_RGBA16_EXT 0x805B
+#define GL_TEXTURE_RED_SIZE_EXT 0x805C
+#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
+#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
+#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
+#define GL_REPLACE_EXT 0x8062
+#define GL_PROXY_TEXTURE_1D_EXT 0x8063
+#define GL_PROXY_TEXTURE_2D_EXT 0x8064
+#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_PACK_SKIP_IMAGES_EXT 0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
+#define GL_TEXTURE_3D_EXT 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT 0x8070
+#define GL_TEXTURE_DEPTH_EXT 0x8071
+#define GL_TEXTURE_WRAP_R_EXT 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_FILTER4_SGIS 0x8146
+#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
+#endif
+
+#ifndef GL_EXT_subtexture
+#endif
+
+#ifndef GL_EXT_copy_texture
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_HISTOGRAM_EXT 0x8024
+#define GL_PROXY_HISTOGRAM_EXT 0x8025
+#define GL_HISTOGRAM_WIDTH_EXT 0x8026
+#define GL_HISTOGRAM_FORMAT_EXT 0x8027
+#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
+#define GL_HISTOGRAM_SINK_EXT 0x802D
+#define GL_MINMAX_EXT 0x802E
+#define GL_MINMAX_FORMAT_EXT 0x802F
+#define GL_MINMAX_SINK_EXT 0x8030
+#define GL_TABLE_TOO_LARGE_EXT 0x8031
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_CONVOLUTION_1D_EXT 0x8010
+#define GL_CONVOLUTION_2D_EXT 0x8011
+#define GL_SEPARABLE_2D_EXT 0x8012
+#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
+#define GL_REDUCE_EXT 0x8016
+#define GL_CONVOLUTION_FORMAT_EXT 0x8017
+#define GL_CONVOLUTION_WIDTH_EXT 0x8018
+#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_COLOR_MATRIX_SGI 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_COLOR_TABLE_SGI 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
+#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
+#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
+#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
+#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
+#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_PIXEL_TEXTURE_SGIS 0x8353
+#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
+#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
+#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_PIXEL_TEX_GEN_SGIX 0x8139
+#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
+#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
+#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
+#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
+#define GL_TEXTURE_4D_SGIS 0x8134
+#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
+#define GL_TEXTURE_4DSIZE_SGIS 0x8136
+#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
+#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
+#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
+#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_CMYK_EXT 0x800C
+#define GL_CMYKA_EXT 0x800D
+#define GL_PACK_CMYK_HINT_EXT 0x800E
+#define GL_UNPACK_CMYK_HINT_EXT 0x800F
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_TEXTURE_PRIORITY_EXT 0x8066
+#define GL_TEXTURE_RESIDENT_EXT 0x8067
+#define GL_TEXTURE_1D_BINDING_EXT 0x8068
+#define GL_TEXTURE_2D_BINDING_EXT 0x8069
+#define GL_TEXTURE_3D_BINDING_EXT 0x806A
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#define GL_LINEAR_DETAIL_SGIS 0x8097
+#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
+#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
+#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_LINEAR_SHARPEN_SGIS 0x80AD
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
+#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
+#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
+#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
+#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
+#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_MULTISAMPLE_SGIS 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
+#define GL_SAMPLE_MASK_SGIS 0x80A0
+#define GL_1PASS_SGIS 0x80A1
+#define GL_2PASS_0_SGIS 0x80A2
+#define GL_2PASS_1_SGIS 0x80A3
+#define GL_4PASS_0_SGIS 0x80A4
+#define GL_4PASS_1_SGIS 0x80A5
+#define GL_4PASS_2_SGIS 0x80A6
+#define GL_4PASS_3_SGIS 0x80A7
+#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
+#define GL_SAMPLES_SGIS 0x80A9
+#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
+#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
+#define GL_SAMPLE_PATTERN_SGIS 0x80AC
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_RESCALE_NORMAL_EXT 0x803A
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_VERTEX_ARRAY_EXT 0x8074
+#define GL_NORMAL_ARRAY_EXT 0x8075
+#define GL_COLOR_ARRAY_EXT 0x8076
+#define GL_INDEX_ARRAY_EXT 0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_GENERATE_MIPMAP_SGIS 0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
+#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
+#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
+#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
+#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
+#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
+#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
+#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
+#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
+#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
+#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_TEXTURE_COMPARE_SGIX 0x819A
+#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
+#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
+#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_CLAMP_TO_EDGE_SGIS 0x812F
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_SGIS 0x812D
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_FUNC_ADD_EXT 0x8006
+#define GL_MIN_EXT 0x8007
+#define GL_MAX_EXT 0x8008
+#define GL_BLEND_EQUATION_EXT 0x8009
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_FUNC_SUBTRACT_EXT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_INTERLACE_SGIX 0x8094
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
+#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
+#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
+#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
+#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
+#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
+#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
+#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
+#endif
+
+#ifndef GL_SGIS_texture_select
+#define GL_DUAL_ALPHA4_SGIS 0x8110
+#define GL_DUAL_ALPHA8_SGIS 0x8111
+#define GL_DUAL_ALPHA12_SGIS 0x8112
+#define GL_DUAL_ALPHA16_SGIS 0x8113
+#define GL_DUAL_LUMINANCE4_SGIS 0x8114
+#define GL_DUAL_LUMINANCE8_SGIS 0x8115
+#define GL_DUAL_LUMINANCE12_SGIS 0x8116
+#define GL_DUAL_LUMINANCE16_SGIS 0x8117
+#define GL_DUAL_INTENSITY4_SGIS 0x8118
+#define GL_DUAL_INTENSITY8_SGIS 0x8119
+#define GL_DUAL_INTENSITY12_SGIS 0x811A
+#define GL_DUAL_INTENSITY16_SGIS 0x811B
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
+#define GL_QUAD_ALPHA4_SGIS 0x811E
+#define GL_QUAD_ALPHA8_SGIS 0x811F
+#define GL_QUAD_LUMINANCE4_SGIS 0x8120
+#define GL_QUAD_LUMINANCE8_SGIS 0x8121
+#define GL_QUAD_INTENSITY4_SGIS 0x8122
+#define GL_QUAD_INTENSITY8_SGIS 0x8123
+#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
+#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SPRITE_SGIX 0x8148
+#define GL_SPRITE_MODE_SGIX 0x8149
+#define GL_SPRITE_AXIS_SGIX 0x814A
+#define GL_SPRITE_TRANSLATION_SGIX 0x814B
+#define GL_SPRITE_AXIAL_SGIX 0x814C
+#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
+#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_POINT_SIZE_MIN_EXT 0x8126
+#define GL_POINT_SIZE_MAX_EXT 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
+#define GL_DISTANCE_ATTENUATION_EXT 0x8129
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_POINT_SIZE_MIN_SGIS 0x8126
+#define GL_POINT_SIZE_MAX_SGIS 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
+#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
+#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
+#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
+#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_FRAMEZOOM_SGIX 0x818B
+#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
+#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#endif
+
+#ifndef GL_FfdMaskSGIX
+#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
+#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
+#define GL_DEFORMATIONS_MASK_SGIX 0x8196
+#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_REFERENCE_PLANE_SGIX 0x817D
+#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
+#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
+#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_FOG_FUNC_SGIS 0x812A
+#define GL_FOG_FUNC_POINTS_SGIS 0x812B
+#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_FOG_OFFSET_SGIX 0x8198
+#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_IMAGE_SCALE_X_HP 0x8155
+#define GL_IMAGE_SCALE_Y_HP 0x8156
+#define GL_IMAGE_TRANSLATE_X_HP 0x8157
+#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
+#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
+#define GL_IMAGE_MAG_FILTER_HP 0x815C
+#define GL_IMAGE_MIN_FILTER_HP 0x815D
+#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
+#define GL_CUBIC_HP 0x815F
+#define GL_AVERAGE_HP 0x8160
+#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
+#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
+#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_IGNORE_BORDER_HP 0x8150
+#define GL_CONSTANT_BORDER_HP 0x8151
+#define GL_REPLICATE_BORDER_HP 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
+#endif
+
+#ifndef GL_INGR_palette_buffer
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
+#endif
+
+#ifndef GL_EXT_color_subtable
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
+#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
+#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
+#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
+#define GL_COLOR3_BIT_PGI 0x00010000
+#define GL_COLOR4_BIT_PGI 0x00020000
+#define GL_EDGEFLAG_BIT_PGI 0x00040000
+#define GL_INDEX_BIT_PGI 0x00080000
+#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
+#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
+#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
+#define GL_MAT_EMISSION_BIT_PGI 0x00800000
+#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
+#define GL_MAT_SHININESS_BIT_PGI 0x02000000
+#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
+#define GL_NORMAL_BIT_PGI 0x08000000
+#define GL_TEXCOORD1_BIT_PGI 0x10000000
+#define GL_TEXCOORD2_BIT_PGI 0x20000000
+#define GL_TEXCOORD3_BIT_PGI 0x40000000
+#define GL_TEXCOORD4_BIT_PGI 0x80000000
+#define GL_VERTEX23_BIT_PGI 0x00000004
+#define GL_VERTEX4_BIT_PGI 0x00000008
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
+#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
+#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
+#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
+#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
+#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
+#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
+#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
+#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
+#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
+#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
+#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
+#define GL_CLIP_NEAR_HINT_PGI 0x1A220
+#define GL_CLIP_FAR_HINT_PGI 0x1A221
+#define GL_WIDE_LINE_HINT_PGI 0x1A222
+#define GL_BACK_NORMALS_HINT_PGI 0x1A223
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_COLOR_INDEX1_EXT 0x80E2
+#define GL_COLOR_INDEX2_EXT 0x80E3
+#define GL_COLOR_INDEX4_EXT 0x80E4
+#define GL_COLOR_INDEX8_EXT 0x80E5
+#define GL_COLOR_INDEX12_EXT 0x80E6
+#define GL_COLOR_INDEX16_EXT 0x80E7
+#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_LIST_PRIORITY_SGIX 0x8182
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_IR_INSTRUMENT1_SGIX 0x817F
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
+#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
+#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SHADOW_AMBIENT_SGIX 0x80BF
+#endif
+
+#ifndef GL_EXT_index_texture
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_INDEX_MATERIAL_EXT 0x81B8
+#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
+#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_INDEX_TEST_EXT 0x81B5
+#define GL_INDEX_TEST_FUNC_EXT 0x81B6
+#define GL_INDEX_TEST_REF_EXT 0x81B7
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_IUI_V2F_EXT 0x81AD
+#define GL_IUI_V3F_EXT 0x81AE
+#define GL_IUI_N3F_V2F_EXT 0x81AF
+#define GL_IUI_N3F_V3F_EXT 0x81B0
+#define GL_T2F_IUI_V2F_EXT 0x81B1
+#define GL_T2F_IUI_V3F_EXT 0x81B2
+#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
+#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_CULL_VERTEX_EXT 0x81AA
+#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_YCRCB_422_SGIX 0x81BB
+#define GL_YCRCB_444_SGIX 0x81BC
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
+#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
+#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
+#define GL_LIGHT_ENV_MODE_SGIX 0x8407
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
+#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
+#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
+#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
+#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
+#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
+#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
+#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
+#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
+#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
+#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_PHONG_WIN 0x80EA
+#define GL_PHONG_HINT_WIN 0x80EB
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_FRAGMENT_MATERIAL_EXT 0x8349
+#define GL_FRAGMENT_NORMAL_EXT 0x834A
+#define GL_FRAGMENT_COLOR_EXT 0x834C
+#define GL_ATTENUATION_EXT 0x834D
+#define GL_SHADOW_ATTENUATION_EXT 0x834E
+#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
+#define GL_TEXTURE_LIGHT_EXT 0x8350
+#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
+#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
+/* reuse GL_FRAGMENT_DEPTH_EXT */
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_ALPHA_MIN_SGIX 0x8320
+#define GL_ALPHA_MAX_SGIX 0x8321
+#endif
+
+#ifndef GL_SGIX_impact_pixel_texture
+#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
+#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
+#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
+#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
+#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
+#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
+#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_BGR_EXT 0x80E0
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_ASYNC_MARKER_SGIX 0x8329
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
+#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
+#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
+#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
+#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
+#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
+#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
+#endif
+
+#ifndef GL_INTEL_texture_scissor
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
+#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
+#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_OCCLUSION_TEST_HP 0x8165
+#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
+#define GL_PIXEL_MAG_FILTER_EXT 0x8331
+#define GL_PIXEL_MIN_FILTER_EXT 0x8332
+#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
+#define GL_CUBIC_EXT 0x8334
+#define GL_AVERAGE_EXT 0x8335
+#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
+#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
+#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
+#define GL_SINGLE_COLOR_EXT 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_COLOR_SUM_EXT 0x8458
+#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_PERTURB_EXT 0x85AE
+#define GL_TEXTURE_NORMAL_EXT 0x85AF
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
+#define GL_FOG_COORDINATE_EXT 0x8451
+#define GL_FRAGMENT_DEPTH_EXT 0x8452
+#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_SCREEN_COORDINATES_REND 0x8490
+#define GL_INVERTED_SCREEN_W_REND 0x8491
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_TANGENT_ARRAY_EXT 0x8439
+#define GL_BINORMAL_ARRAY_EXT 0x843A
+#define GL_CURRENT_TANGENT_EXT 0x843B
+#define GL_CURRENT_BINORMAL_EXT 0x843C
+#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
+#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
+#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
+#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
+#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
+#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
+#define GL_MAP1_TANGENT_EXT 0x8444
+#define GL_MAP2_TANGENT_EXT 0x8445
+#define GL_MAP1_BINORMAL_EXT 0x8446
+#define GL_MAP2_BINORMAL_EXT 0x8447
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_COMBINE_EXT 0x8570
+#define GL_COMBINE_RGB_EXT 0x8571
+#define GL_COMBINE_ALPHA_EXT 0x8572
+#define GL_RGB_SCALE_EXT 0x8573
+#define GL_ADD_SIGNED_EXT 0x8574
+#define GL_INTERPOLATE_EXT 0x8575
+#define GL_CONSTANT_EXT 0x8576
+#define GL_PRIMARY_COLOR_EXT 0x8577
+#define GL_PREVIOUS_EXT 0x8578
+#define GL_SOURCE0_RGB_EXT 0x8580
+#define GL_SOURCE1_RGB_EXT 0x8581
+#define GL_SOURCE2_RGB_EXT 0x8582
+#define GL_SOURCE0_ALPHA_EXT 0x8588
+#define GL_SOURCE1_ALPHA_EXT 0x8589
+#define GL_SOURCE2_ALPHA_EXT 0x858A
+#define GL_OPERAND0_RGB_EXT 0x8590
+#define GL_OPERAND1_RGB_EXT 0x8591
+#define GL_OPERAND2_RGB_EXT 0x8592
+#define GL_OPERAND0_ALPHA_EXT 0x8598
+#define GL_OPERAND1_ALPHA_EXT 0x8599
+#define GL_OPERAND2_ALPHA_EXT 0x859A
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_TRANSFORM_HINT_APPLE 0x85B1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_FOG_SCALE_SGIX 0x81FC
+#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
+#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_GLOBAL_ALPHA_SUN 0x81D9
+#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_RESTART_SUN 0x0001
+#define GL_REPLACE_MIDDLE_SUN 0x0002
+#define GL_REPLACE_OLDEST_SUN 0x0003
+#define GL_TRIANGLE_LIST_SUN 0x81D7
+#define GL_REPLACEMENT_CODE_SUN 0x81D8
+#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
+#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
+#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
+#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
+#define GL_R1UI_V3F_SUN 0x85C4
+#define GL_R1UI_C4UB_V3F_SUN 0x85C5
+#define GL_R1UI_C3F_V3F_SUN 0x85C6
+#define GL_R1UI_N3F_V3F_SUN 0x85C7
+#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
+#define GL_R1UI_T2F_V3F_SUN 0x85C9
+#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
+#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
+#endif
+
+#ifndef GL_SUN_vertex
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_BLEND_DST_RGB_EXT 0x80C8
+#define GL_BLEND_SRC_RGB_EXT 0x80C9
+#define GL_BLEND_DST_ALPHA_EXT 0x80CA
+#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_RED_MIN_CLAMP_INGR 0x8560
+#define GL_GREEN_MIN_CLAMP_INGR 0x8561
+#define GL_BLUE_MIN_CLAMP_INGR 0x8562
+#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
+#define GL_RED_MAX_CLAMP_INGR 0x8564
+#define GL_GREEN_MAX_CLAMP_INGR 0x8565
+#define GL_BLUE_MAX_CLAMP_INGR 0x8566
+#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INTERLACE_READ_INGR 0x8568
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_INCR_WRAP_EXT 0x8507
+#define GL_DECR_WRAP_EXT 0x8508
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_422_EXT 0x80CC
+#define GL_422_REV_EXT 0x80CD
+#define GL_422_AVERAGE_EXT 0x80CE
+#define GL_422_REV_AVERAGE_EXT 0x80CF
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NORMAL_MAP_NV 0x8511
+#define GL_REFLECTION_MAP_NV 0x8512
+#endif
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_NORMAL_MAP_EXT 0x8511
+#define GL_REFLECTION_MAP_EXT 0x8512
+#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_WRAP_BORDER_SUN 0x81D4
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#endif
+
+#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
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
+#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
+#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
+#define GL_MODELVIEW1_MATRIX_EXT 0x8506
+#define GL_VERTEX_WEIGHTING_EXT 0x8509
+#define GL_MODELVIEW0_EXT GL_MODELVIEW
+#define GL_MODELVIEW1_EXT 0x850A
+#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
+#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
+#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
+#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
+#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
+#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_MAX_SHININESS_NV 0x8504
+#define GL_MAX_SPOT_EXPONENT_NV 0x8505
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
+#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_REGISTER_COMBINERS_NV 0x8522
+#define GL_VARIABLE_A_NV 0x8523
+#define GL_VARIABLE_B_NV 0x8524
+#define GL_VARIABLE_C_NV 0x8525
+#define GL_VARIABLE_D_NV 0x8526
+#define GL_VARIABLE_E_NV 0x8527
+#define GL_VARIABLE_F_NV 0x8528
+#define GL_VARIABLE_G_NV 0x8529
+#define GL_CONSTANT_COLOR0_NV 0x852A
+#define GL_CONSTANT_COLOR1_NV 0x852B
+#define GL_PRIMARY_COLOR_NV 0x852C
+#define GL_SECONDARY_COLOR_NV 0x852D
+#define GL_SPARE0_NV 0x852E
+#define GL_SPARE1_NV 0x852F
+#define GL_DISCARD_NV 0x8530
+#define GL_E_TIMES_F_NV 0x8531
+#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
+#define GL_UNSIGNED_IDENTITY_NV 0x8536
+#define GL_UNSIGNED_INVERT_NV 0x8537
+#define GL_EXPAND_NORMAL_NV 0x8538
+#define GL_EXPAND_NEGATE_NV 0x8539
+#define GL_HALF_BIAS_NORMAL_NV 0x853A
+#define GL_HALF_BIAS_NEGATE_NV 0x853B
+#define GL_SIGNED_IDENTITY_NV 0x853C
+#define GL_SIGNED_NEGATE_NV 0x853D
+#define GL_SCALE_BY_TWO_NV 0x853E
+#define GL_SCALE_BY_FOUR_NV 0x853F
+#define GL_SCALE_BY_ONE_HALF_NV 0x8540
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
+#define GL_COMBINER_INPUT_NV 0x8542
+#define GL_COMBINER_MAPPING_NV 0x8543
+#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
+#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
+#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
+#define GL_COMBINER_MUX_SUM_NV 0x8547
+#define GL_COMBINER_SCALE_NV 0x8548
+#define GL_COMBINER_BIAS_NV 0x8549
+#define GL_COMBINER_AB_OUTPUT_NV 0x854A
+#define GL_COMBINER_CD_OUTPUT_NV 0x854B
+#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
+#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
+#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
+#define GL_COLOR_SUM_CLAMP_NV 0x854F
+#define GL_COMBINER0_NV 0x8550
+#define GL_COMBINER1_NV 0x8551
+#define GL_COMBINER2_NV 0x8552
+#define GL_COMBINER3_NV 0x8553
+#define GL_COMBINER4_NV 0x8554
+#define GL_COMBINER5_NV 0x8555
+#define GL_COMBINER6_NV 0x8556
+#define GL_COMBINER7_NV 0x8557
+/* reuse GL_TEXTURE0_ARB */
+/* reuse GL_TEXTURE1_ARB */
+/* reuse GL_ZERO */
+/* reuse GL_NONE */
+/* reuse GL_FOG */
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_FOG_DISTANCE_MODE_NV 0x855A
+#define GL_EYE_RADIAL_NV 0x855B
+#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
+/* reuse GL_EYE_PLANE */
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_EMBOSS_LIGHT_NV 0x855D
+#define GL_EMBOSS_CONSTANT_NV 0x855E
+#define GL_EMBOSS_MAP_NV 0x855F
+#endif
+
+#ifndef GL_NV_blend_square
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_COMBINE4_NV 0x8503
+#define GL_SOURCE3_RGB_NV 0x8583
+#define GL_SOURCE3_ALPHA_NV 0x858B
+#define GL_OPERAND3_RGB_NV 0x8593
+#define GL_OPERAND3_ALPHA_NV 0x859B
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#endif
+
+#ifndef GL_MESA_window_pos
+#endif
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_CULL_VERTEX_IBM 103050
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_VERTEX_ARRAY_LIST_IBM 103070
+#define GL_NORMAL_ARRAY_LIST_IBM 103071
+#define GL_COLOR_ARRAY_LIST_IBM 103072
+#define GL_INDEX_ARRAY_LIST_IBM 103073
+#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
+#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
+#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
+#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
+#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
+#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
+#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
+#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
+#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_YCRCB_SGIX 0x8318
+#define GL_YCRCBA_SGIX 0x8319
+#endif
+
+#ifndef GL_SGI_depth_pass_instrument
+#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
+#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
+#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_MULTISAMPLE_3DFX 0x86B2
+#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
+#define GL_SAMPLES_3DFX 0x86B4
+#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_MULTISAMPLE_EXT 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
+#define GL_SAMPLE_MASK_EXT 0x80A0
+#define GL_1PASS_EXT 0x80A1
+#define GL_2PASS_0_EXT 0x80A2
+#define GL_2PASS_1_EXT 0x80A3
+#define GL_4PASS_0_EXT 0x80A4
+#define GL_4PASS_1_EXT 0x80A5
+#define GL_4PASS_2_EXT 0x80A6
+#define GL_4PASS_3_EXT 0x80A7
+#define GL_SAMPLE_BUFFERS_EXT 0x80A8
+#define GL_SAMPLES_EXT 0x80A9
+#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
+#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
+#define GL_SAMPLE_PATTERN_EXT 0x80AC
+#define GL_MULTISAMPLE_BIT_EXT 0x20000000
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_VERTEX_PRECLIP_SGIX 0x83EE
+#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_CONVOLUTION_HINT_SGIX 0x8316
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_PACK_RESAMPLE_SGIX 0x842C
+#define GL_UNPACK_RESAMPLE_SGIX 0x842D
+#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
+#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
+#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
+#define GL_EYE_POINT_SGIS 0x81F4
+#define GL_OBJECT_POINT_SGIS 0x81F5
+#define GL_EYE_LINE_SGIS 0x81F6
+#define GL_OBJECT_LINE_SGIS 0x81F7
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_DOT3_RGB_EXT 0x8740
+#define GL_DOT3_RGBA_EXT 0x8741
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_MIRROR_CLAMP_ATI 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
+#endif
+
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+
+#ifndef GL_IBM_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_IBM 0x8370
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_EVAL_2D_NV 0x86C0
+#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
+#define GL_MAP_TESSELLATION_NV 0x86C2
+#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
+#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
+#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
+#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
+#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
+#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
+#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
+#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
+#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
+#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
+#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
+#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
+#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
+#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
+#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
+#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
+#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
+#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
+#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_DEPTH_STENCIL_NV 0x84F9
+#define GL_UNSIGNED_INT_24_8_NV 0x84FA
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_PER_STAGE_CONSTANTS_NV 0x8535
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_NV 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
+#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
+#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
+#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
+#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
+#define GL_SHADER_CONSISTENT_NV 0x86DD
+#define GL_TEXTURE_SHADER_NV 0x86DE
+#define GL_SHADER_OPERATION_NV 0x86DF
+#define GL_CULL_MODES_NV 0x86E0
+#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
+#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
+#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
+#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
+#define GL_CONST_EYE_NV 0x86E5
+#define GL_PASS_THROUGH_NV 0x86E6
+#define GL_CULL_FRAGMENT_NV 0x86E7
+#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
+#define GL_DOT_PRODUCT_NV 0x86EC
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#define GL_HILO_NV 0x86F4
+#define GL_DSDT_NV 0x86F5
+#define GL_DSDT_MAG_NV 0x86F6
+#define GL_DSDT_MAG_VIB_NV 0x86F7
+#define GL_HILO16_NV 0x86F8
+#define GL_SIGNED_HILO_NV 0x86F9
+#define GL_SIGNED_HILO16_NV 0x86FA
+#define GL_SIGNED_RGBA_NV 0x86FB
+#define GL_SIGNED_RGBA8_NV 0x86FC
+#define GL_SIGNED_RGB_NV 0x86FE
+#define GL_SIGNED_RGB8_NV 0x86FF
+#define GL_SIGNED_LUMINANCE_NV 0x8701
+#define GL_SIGNED_LUMINANCE8_NV 0x8702
+#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
+#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
+#define GL_SIGNED_ALPHA_NV 0x8705
+#define GL_SIGNED_ALPHA8_NV 0x8706
+#define GL_SIGNED_INTENSITY_NV 0x8707
+#define GL_SIGNED_INTENSITY8_NV 0x8708
+#define GL_DSDT8_NV 0x8709
+#define GL_DSDT8_MAG8_NV 0x870A
+#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
+#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
+#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
+#define GL_HI_SCALE_NV 0x870E
+#define GL_LO_SCALE_NV 0x870F
+#define GL_DS_SCALE_NV 0x8710
+#define GL_DT_SCALE_NV 0x8711
+#define GL_MAGNITUDE_SCALE_NV 0x8712
+#define GL_VIBRANCE_SCALE_NV 0x8713
+#define GL_HI_BIAS_NV 0x8714
+#define GL_LO_BIAS_NV 0x8715
+#define GL_DS_BIAS_NV 0x8716
+#define GL_DT_BIAS_NV 0x8717
+#define GL_MAGNITUDE_BIAS_NV 0x8718
+#define GL_VIBRANCE_BIAS_NV 0x8719
+#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
+#define GL_TEXTURE_HI_SIZE_NV 0x871B
+#define GL_TEXTURE_LO_SIZE_NV 0x871C
+#define GL_TEXTURE_DS_SIZE_NV 0x871D
+#define GL_TEXTURE_DT_SIZE_NV 0x871E
+#define GL_TEXTURE_MAG_SIZE_NV 0x871F
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_VERTEX_PROGRAM_NV 0x8620
+#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
+#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
+#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
+#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
+#define GL_CURRENT_ATTRIB_NV 0x8626
+#define GL_PROGRAM_LENGTH_NV 0x8627
+#define GL_PROGRAM_STRING_NV 0x8628
+#define GL_MODELVIEW_PROJECTION_NV 0x8629
+#define GL_IDENTITY_NV 0x862A
+#define GL_INVERSE_NV 0x862B
+#define GL_TRANSPOSE_NV 0x862C
+#define GL_INVERSE_TRANSPOSE_NV 0x862D
+#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
+#define GL_MAX_TRACK_MATRICES_NV 0x862F
+#define GL_MATRIX0_NV 0x8630
+#define GL_MATRIX1_NV 0x8631
+#define GL_MATRIX2_NV 0x8632
+#define GL_MATRIX3_NV 0x8633
+#define GL_MATRIX4_NV 0x8634
+#define GL_MATRIX5_NV 0x8635
+#define GL_MATRIX6_NV 0x8636
+#define GL_MATRIX7_NV 0x8637
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
+#define GL_CURRENT_MATRIX_NV 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
+#define GL_PROGRAM_PARAMETER_NV 0x8644
+#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
+#define GL_PROGRAM_TARGET_NV 0x8646
+#define GL_PROGRAM_RESIDENT_NV 0x8647
+#define GL_TRACK_MATRIX_NV 0x8648
+#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
+#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
+#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
+#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
+#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
+#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
+#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
+#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
+#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
+#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
+#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
+#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
+#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
+#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
+#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
+#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
+#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
+#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
+#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
+#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
+#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SCALEBIAS_HINT_SGIX 0x8322
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_INTERLACE_OML 0x8980
+#define GL_INTERLACE_READ_OML 0x8981
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
+#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
+#endif
+
+#ifndef GL_OML_resample
+#define GL_PACK_RESAMPLE_OML 0x8984
+#define GL_UNPACK_RESAMPLE_OML 0x8985
+#define GL_RESAMPLE_REPLICATE_OML 0x8986
+#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
+#define GL_RESAMPLE_AVERAGE_OML 0x8988
+#define GL_RESAMPLE_DECIMATE_OML 0x8989
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
+#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_BUMP_ROT_MATRIX_ATI 0x8775
+#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
+#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
+#define GL_BUMP_TEX_UNITS_ATI 0x8778
+#define GL_DUDV_ATI 0x8779
+#define GL_DU8DV8_ATI 0x877A
+#define GL_BUMP_ENVMAP_ATI 0x877B
+#define GL_BUMP_TARGET_ATI 0x877C
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_FRAGMENT_SHADER_ATI 0x8920
+#define GL_REG_0_ATI 0x8921
+#define GL_REG_1_ATI 0x8922
+#define GL_REG_2_ATI 0x8923
+#define GL_REG_3_ATI 0x8924
+#define GL_REG_4_ATI 0x8925
+#define GL_REG_5_ATI 0x8926
+#define GL_REG_6_ATI 0x8927
+#define GL_REG_7_ATI 0x8928
+#define GL_REG_8_ATI 0x8929
+#define GL_REG_9_ATI 0x892A
+#define GL_REG_10_ATI 0x892B
+#define GL_REG_11_ATI 0x892C
+#define GL_REG_12_ATI 0x892D
+#define GL_REG_13_ATI 0x892E
+#define GL_REG_14_ATI 0x892F
+#define GL_REG_15_ATI 0x8930
+#define GL_REG_16_ATI 0x8931
+#define GL_REG_17_ATI 0x8932
+#define GL_REG_18_ATI 0x8933
+#define GL_REG_19_ATI 0x8934
+#define GL_REG_20_ATI 0x8935
+#define GL_REG_21_ATI 0x8936
+#define GL_REG_22_ATI 0x8937
+#define GL_REG_23_ATI 0x8938
+#define GL_REG_24_ATI 0x8939
+#define GL_REG_25_ATI 0x893A
+#define GL_REG_26_ATI 0x893B
+#define GL_REG_27_ATI 0x893C
+#define GL_REG_28_ATI 0x893D
+#define GL_REG_29_ATI 0x893E
+#define GL_REG_30_ATI 0x893F
+#define GL_REG_31_ATI 0x8940
+#define GL_CON_0_ATI 0x8941
+#define GL_CON_1_ATI 0x8942
+#define GL_CON_2_ATI 0x8943
+#define GL_CON_3_ATI 0x8944
+#define GL_CON_4_ATI 0x8945
+#define GL_CON_5_ATI 0x8946
+#define GL_CON_6_ATI 0x8947
+#define GL_CON_7_ATI 0x8948
+#define GL_CON_8_ATI 0x8949
+#define GL_CON_9_ATI 0x894A
+#define GL_CON_10_ATI 0x894B
+#define GL_CON_11_ATI 0x894C
+#define GL_CON_12_ATI 0x894D
+#define GL_CON_13_ATI 0x894E
+#define GL_CON_14_ATI 0x894F
+#define GL_CON_15_ATI 0x8950
+#define GL_CON_16_ATI 0x8951
+#define GL_CON_17_ATI 0x8952
+#define GL_CON_18_ATI 0x8953
+#define GL_CON_19_ATI 0x8954
+#define GL_CON_20_ATI 0x8955
+#define GL_CON_21_ATI 0x8956
+#define GL_CON_22_ATI 0x8957
+#define GL_CON_23_ATI 0x8958
+#define GL_CON_24_ATI 0x8959
+#define GL_CON_25_ATI 0x895A
+#define GL_CON_26_ATI 0x895B
+#define GL_CON_27_ATI 0x895C
+#define GL_CON_28_ATI 0x895D
+#define GL_CON_29_ATI 0x895E
+#define GL_CON_30_ATI 0x895F
+#define GL_CON_31_ATI 0x8960
+#define GL_MOV_ATI 0x8961
+#define GL_ADD_ATI 0x8963
+#define GL_MUL_ATI 0x8964
+#define GL_SUB_ATI 0x8965
+#define GL_DOT3_ATI 0x8966
+#define GL_DOT4_ATI 0x8967
+#define GL_MAD_ATI 0x8968
+#define GL_LERP_ATI 0x8969
+#define GL_CND_ATI 0x896A
+#define GL_CND0_ATI 0x896B
+#define GL_DOT2_ADD_ATI 0x896C
+#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
+#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
+#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
+#define GL_NUM_PASSES_ATI 0x8970
+#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
+#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
+#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
+#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
+#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
+#define GL_SWIZZLE_STR_ATI 0x8976
+#define GL_SWIZZLE_STQ_ATI 0x8977
+#define GL_SWIZZLE_STR_DR_ATI 0x8978
+#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
+#define GL_SWIZZLE_STRQ_ATI 0x897A
+#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
+#define GL_RED_BIT_ATI 0x00000001
+#define GL_GREEN_BIT_ATI 0x00000002
+#define GL_BLUE_BIT_ATI 0x00000004
+#define GL_2X_BIT_ATI 0x00000001
+#define GL_4X_BIT_ATI 0x00000002
+#define GL_8X_BIT_ATI 0x00000004
+#define GL_HALF_BIT_ATI 0x00000008
+#define GL_QUARTER_BIT_ATI 0x00000010
+#define GL_EIGHTH_BIT_ATI 0x00000020
+#define GL_SATURATE_BIT_ATI 0x00000040
+#define GL_COMP_BIT_ATI 0x00000002
+#define GL_NEGATE_BIT_ATI 0x00000004
+#define GL_BIAS_BIT_ATI 0x00000008
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_PN_TRIANGLES_ATI 0x87F0
+#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
+#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
+#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
+#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
+#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
+#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
+#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
+#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_STATIC_ATI 0x8760
+#define GL_DYNAMIC_ATI 0x8761
+#define GL_PRESERVE_ATI 0x8762
+#define GL_DISCARD_ATI 0x8763
+#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
+#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
+#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
+#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_VERTEX_SHADER_EXT 0x8780
+#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
+#define GL_OP_INDEX_EXT 0x8782
+#define GL_OP_NEGATE_EXT 0x8783
+#define GL_OP_DOT3_EXT 0x8784
+#define GL_OP_DOT4_EXT 0x8785
+#define GL_OP_MUL_EXT 0x8786
+#define GL_OP_ADD_EXT 0x8787
+#define GL_OP_MADD_EXT 0x8788
+#define GL_OP_FRAC_EXT 0x8789
+#define GL_OP_MAX_EXT 0x878A
+#define GL_OP_MIN_EXT 0x878B
+#define GL_OP_SET_GE_EXT 0x878C
+#define GL_OP_SET_LT_EXT 0x878D
+#define GL_OP_CLAMP_EXT 0x878E
+#define GL_OP_FLOOR_EXT 0x878F
+#define GL_OP_ROUND_EXT 0x8790
+#define GL_OP_EXP_BASE_2_EXT 0x8791
+#define GL_OP_LOG_BASE_2_EXT 0x8792
+#define GL_OP_POWER_EXT 0x8793
+#define GL_OP_RECIP_EXT 0x8794
+#define GL_OP_RECIP_SQRT_EXT 0x8795
+#define GL_OP_SUB_EXT 0x8796
+#define GL_OP_CROSS_PRODUCT_EXT 0x8797
+#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
+#define GL_OP_MOV_EXT 0x8799
+#define GL_OUTPUT_VERTEX_EXT 0x879A
+#define GL_OUTPUT_COLOR0_EXT 0x879B
+#define GL_OUTPUT_COLOR1_EXT 0x879C
+#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
+#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
+#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
+#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
+#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
+#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
+#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
+#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
+#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
+#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
+#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
+#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
+#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
+#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
+#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
+#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
+#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
+#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
+#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
+#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
+#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
+#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
+#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
+#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
+#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
+#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
+#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
+#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
+#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
+#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
+#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
+#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
+#define GL_OUTPUT_FOG_EXT 0x87BD
+#define GL_SCALAR_EXT 0x87BE
+#define GL_VECTOR_EXT 0x87BF
+#define GL_MATRIX_EXT 0x87C0
+#define GL_VARIANT_EXT 0x87C1
+#define GL_INVARIANT_EXT 0x87C2
+#define GL_LOCAL_CONSTANT_EXT 0x87C3
+#define GL_LOCAL_EXT 0x87C4
+#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
+#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
+#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
+#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
+#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
+#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
+#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
+#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
+#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
+#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
+#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
+#define GL_X_EXT 0x87D5
+#define GL_Y_EXT 0x87D6
+#define GL_Z_EXT 0x87D7
+#define GL_W_EXT 0x87D8
+#define GL_NEGATIVE_X_EXT 0x87D9
+#define GL_NEGATIVE_Y_EXT 0x87DA
+#define GL_NEGATIVE_Z_EXT 0x87DB
+#define GL_NEGATIVE_W_EXT 0x87DC
+#define GL_ZERO_EXT 0x87DD
+#define GL_ONE_EXT 0x87DE
+#define GL_NEGATIVE_ONE_EXT 0x87DF
+#define GL_NORMALIZED_RANGE_EXT 0x87E0
+#define GL_FULL_RANGE_EXT 0x87E1
+#define GL_CURRENT_VERTEX_EXT 0x87E2
+#define GL_MVP_MATRIX_EXT 0x87E3
+#define GL_VARIANT_VALUE_EXT 0x87E4
+#define GL_VARIANT_DATATYPE_EXT 0x87E5
+#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
+#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
+#define GL_VARIANT_ARRAY_EXT 0x87E8
+#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
+#define GL_INVARIANT_VALUE_EXT 0x87EA
+#define GL_INVARIANT_DATATYPE_EXT 0x87EB
+#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
+#define GL_VERTEX_STREAM0_ATI 0x876C
+#define GL_VERTEX_STREAM1_ATI 0x876D
+#define GL_VERTEX_STREAM2_ATI 0x876E
+#define GL_VERTEX_STREAM3_ATI 0x876F
+#define GL_VERTEX_STREAM4_ATI 0x8770
+#define GL_VERTEX_STREAM5_ATI 0x8771
+#define GL_VERTEX_STREAM6_ATI 0x8772
+#define GL_VERTEX_STREAM7_ATI 0x8773
+#define GL_VERTEX_SOURCE_ATI 0x8774
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ELEMENT_ARRAY_ATI 0x8768
+#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_QUAD_MESH_SUN 0x8614
+#define GL_TRIANGLE_MESH_SUN 0x8615
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SLICE_ACCUM_SUN 0x85CC
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_DEPTH_CLAMP_NV 0x864F
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_PIXEL_COUNTER_BITS_NV 0x8864
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
+#define GL_PIXEL_COUNT_NV 0x8866
+#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_POINT_SPRITE_NV 0x8861
+#define GL_COORD_REPLACE_NV 0x8862
+#define GL_POINT_SPRITE_R_MODE_NV 0x8863
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
+#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
+#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#define GL_HILO8_NV 0x885E
+#define GL_SIGNED_HILO8_NV 0x885F
+#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_ELEMENT_ARRAY_APPLE 0x8A0C
+#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D
+#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_DRAW_PIXELS_APPLE 0x8A0A
+#define GL_FENCE_APPLE 0x8A0B
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
+#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
+#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
+#define GL_STORAGE_CLIENT_APPLE 0x85B4
+#define GL_STORAGE_CACHED_APPLE 0x85BE
+#define GL_STORAGE_SHARED_APPLE 0x85BF
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_YCBCR_422_APPLE 0x85B9
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_RGB_S3TC 0x83A0
+#define GL_RGB4_S3TC 0x83A1
+#define GL_RGBA_S3TC 0x83A2
+#define GL_RGBA4_S3TC 0x83A3
+#define GL_RGBA_DXT5_S3TC 0x83A4
+#define GL_RGBA4_DXT5_S3TC 0x83A5
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
+#define GL_DRAW_BUFFER0_ATI 0x8825
+#define GL_DRAW_BUFFER1_ATI 0x8826
+#define GL_DRAW_BUFFER2_ATI 0x8827
+#define GL_DRAW_BUFFER3_ATI 0x8828
+#define GL_DRAW_BUFFER4_ATI 0x8829
+#define GL_DRAW_BUFFER5_ATI 0x882A
+#define GL_DRAW_BUFFER6_ATI 0x882B
+#define GL_DRAW_BUFFER7_ATI 0x882C
+#define GL_DRAW_BUFFER8_ATI 0x882D
+#define GL_DRAW_BUFFER9_ATI 0x882E
+#define GL_DRAW_BUFFER10_ATI 0x882F
+#define GL_DRAW_BUFFER11_ATI 0x8830
+#define GL_DRAW_BUFFER12_ATI 0x8831
+#define GL_DRAW_BUFFER13_ATI 0x8832
+#define GL_DRAW_BUFFER14_ATI 0x8833
+#define GL_DRAW_BUFFER15_ATI 0x8834
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_RGBA_FLOAT_MODE_ATI 0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_MODULATE_ADD_ATI 0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
+#define GL_MODULATE_SUBTRACT_ATI 0x8746
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_RGBA_FLOAT32_ATI 0x8814
+#define GL_RGB_FLOAT32_ATI 0x8815
+#define GL_ALPHA_FLOAT32_ATI 0x8816
+#define GL_INTENSITY_FLOAT32_ATI 0x8817
+#define GL_LUMINANCE_FLOAT32_ATI 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
+#define GL_RGBA_FLOAT16_ATI 0x881A
+#define GL_RGB_FLOAT16_ATI 0x881B
+#define GL_ALPHA_FLOAT16_ATI 0x881C
+#define GL_INTENSITY_FLOAT16_ATI 0x881D
+#define GL_LUMINANCE_FLOAT16_ATI 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_FLOAT_R_NV 0x8880
+#define GL_FLOAT_RG_NV 0x8881
+#define GL_FLOAT_RGB_NV 0x8882
+#define GL_FLOAT_RGBA_NV 0x8883
+#define GL_FLOAT_R16_NV 0x8884
+#define GL_FLOAT_R32_NV 0x8885
+#define GL_FLOAT_RG16_NV 0x8886
+#define GL_FLOAT_RG32_NV 0x8887
+#define GL_FLOAT_RGB16_NV 0x8888
+#define GL_FLOAT_RGB32_NV 0x8889
+#define GL_FLOAT_RGBA16_NV 0x888A
+#define GL_FLOAT_RGBA32_NV 0x888B
+#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
+#define GL_FLOAT_RGBA_MODE_NV 0x888E
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
+#define GL_FRAGMENT_PROGRAM_NV 0x8870
+#define GL_MAX_TEXTURE_COORDS_NV 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
+#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
+#define GL_PROGRAM_ERROR_STRING_NV 0x8874
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_HALF_FLOAT_NV 0x140B
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
+#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
+#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
+#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
+#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
+#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_PRIMITIVE_RESTART_NV 0x8558
+#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#endif
+
+#ifndef GL_NV_vertex_program2
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_STENCIL_BACK_FUNC_ATI 0x8800
+#define GL_STENCIL_BACK_FAIL_ATI 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
+#define GL_DEPTH_BOUNDS_EXT 0x8891
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_MIRROR_CLAMP_EXT 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
+#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_BLEND_EQUATION_RGB_EXT 0x8009
+#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_PACK_INVERT_MESA 0x8758
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
+#define GL_YCBCR_MESA 0x8757
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
+#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
+#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
+#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
+#endif
+
+#ifndef GL_NV_vertex_program3
+/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
+#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
+#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
+#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
+#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
+#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
+#define GL_FRAMEBUFFER_EXT 0x8D40
+#define GL_RENDERBUFFER_EXT 0x8D41
+#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
+#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_STENCIL_INDEX1_EXT 0x8D46
+#define GL_STENCIL_INDEX4_EXT 0x8D47
+#define GL_STENCIL_INDEX8_EXT 0x8D48
+#define GL_STENCIL_INDEX16_EXT 0x8D49
+#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#endif
+
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_DEPTH_STENCIL_EXT 0x84F9
+#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
+#define GL_DEPTH24_STENCIL8_EXT 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_STENCIL_TAG_BITS_EXT 0x88F2
+#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_SRGB_EXT 0x8C40
+#define GL_SRGB8_EXT 0x8C41
+#define GL_SRGB_ALPHA_EXT 0x8C42
+#define GL_SRGB8_ALPHA8_EXT 0x8C43
+#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
+#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
+#define GL_SLUMINANCE_EXT 0x8C46
+#define GL_SLUMINANCE8_EXT 0x8C47
+#define GL_COMPRESSED_SRGB_EXT 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
+#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
+#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
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT
+#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#define GL_MAX_SAMPLES_EXT 0x8D57
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_TEXTURE_1D_STACK_MESAX 0x8759
+#define GL_TEXTURE_2D_STACK_MESAX 0x875A
+#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
+#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
+#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
+#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_TIME_ELAPSED_EXT 0x88BF
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#endif
+
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
+#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
+#endif
+
+#ifndef GL_NV_gpu_program4
+#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
+#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
+#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
+#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
+#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
+#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
+#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
+#endif
+
+#ifndef GL_NV_geometry_program4
+#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_GEOMETRY_PROGRAM_NV 0x8C26
+#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
+#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
+#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
+#endif
+
+#ifndef GL_EXT_geometry_shader4
+#define GL_GEOMETRY_SHADER_EXT 0x8DD9
+/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */
+/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */
+/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */
+/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
+#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
+/* reuse GL_LINES_ADJACENCY_EXT */
+/* reuse GL_LINE_STRIP_ADJACENCY_EXT */
+/* reuse GL_TRIANGLES_ADJACENCY_EXT */
+/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+/* reuse GL_PROGRAM_POINT_SIZE_EXT */
+#endif
+
+#ifndef GL_NV_vertex_program4
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
+#endif
+
+#ifndef GL_EXT_gpu_shader4
+#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
+#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
+#define GL_SAMPLER_BUFFER_EXT 0x8DC2
+#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
+#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
+#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
+#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
+#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
+#define GL_INT_SAMPLER_1D_EXT 0x8DC9
+#define GL_INT_SAMPLER_2D_EXT 0x8DCA
+#define GL_INT_SAMPLER_3D_EXT 0x8DCB
+#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
+#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
+#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
+#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
+#endif
+
+#ifndef GL_EXT_draw_instanced
+#endif
+
+#ifndef GL_EXT_packed_float
+#define GL_R11F_G11F_B10F_EXT 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
+#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
+#endif
+
+#ifndef GL_EXT_texture_array
+#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
+#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+#endif
+
+#ifndef GL_EXT_texture_buffer_object
+#define GL_TEXTURE_BUFFER_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_FORMAT_EXT 0x8C2E
+#endif
+
+#ifndef GL_EXT_texture_compression_latc
+#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
+#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
+#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
+#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
+#endif
+
+#ifndef GL_EXT_texture_compression_rgtc
+#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
+
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_RGB9_E5_EXT 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
+#endif
+
+#ifndef GL_NV_depth_buffer_float
+#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
+#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
+#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
+#endif
+
+#ifndef GL_NV_fragment_program4
+#endif
+
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
+#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
+#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
+#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
+#endif
+
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
+#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
+#endif
+
+#ifndef GL_NV_geometry_shader4
+#endif
+
+#ifndef GL_NV_parameter_buffer_object
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
+#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
+#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
+#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
+#endif
+
+#ifndef GL_EXT_draw_buffers2
+#endif
+
+#ifndef GL_NV_transform_feedback
+#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
+#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
+#define GL_TEXTURE_COORD_NV 0x8C79
+#define GL_CLIP_DISTANCE_NV 0x8C7A
+#define GL_VERTEX_ID_NV 0x8C7B
+#define GL_PRIMITIVE_ID_NV 0x8C7C
+#define GL_GENERIC_ATTRIB_NV 0x8C7D
+#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
+#define GL_ACTIVE_VARYINGS_NV 0x8C81
+#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
+#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
+#define GL_PRIMITIVES_GENERATED_NV 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
+#define GL_RASTERIZER_DISCARD_NV 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
+#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
+#define GL_LAYER_NV 0x8DAA
+#define GL_NEXT_BUFFER_NV -2
+#define GL_SKIP_COMPONENTS4_NV -3
+#define GL_SKIP_COMPONENTS3_NV -4
+#define GL_SKIP_COMPONENTS2_NV -5
+#define GL_SKIP_COMPONENTS1_NV -6
+#endif
+
+#ifndef GL_EXT_bindable_uniform
+#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
+#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
+#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
+#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
+#define GL_UNIFORM_BUFFER_EXT 0x8DEE
+#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
+#endif
+
+#ifndef GL_EXT_texture_integer
+#define GL_RGBA32UI_EXT 0x8D70
+#define GL_RGB32UI_EXT 0x8D71
+#define GL_ALPHA32UI_EXT 0x8D72
+#define GL_INTENSITY32UI_EXT 0x8D73
+#define GL_LUMINANCE32UI_EXT 0x8D74
+#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
+#define GL_RGBA16UI_EXT 0x8D76
+#define GL_RGB16UI_EXT 0x8D77
+#define GL_ALPHA16UI_EXT 0x8D78
+#define GL_INTENSITY16UI_EXT 0x8D79
+#define GL_LUMINANCE16UI_EXT 0x8D7A
+#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
+#define GL_RGBA8UI_EXT 0x8D7C
+#define GL_RGB8UI_EXT 0x8D7D
+#define GL_ALPHA8UI_EXT 0x8D7E
+#define GL_INTENSITY8UI_EXT 0x8D7F
+#define GL_LUMINANCE8UI_EXT 0x8D80
+#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
+#define GL_RGBA32I_EXT 0x8D82
+#define GL_RGB32I_EXT 0x8D83
+#define GL_ALPHA32I_EXT 0x8D84
+#define GL_INTENSITY32I_EXT 0x8D85
+#define GL_LUMINANCE32I_EXT 0x8D86
+#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
+#define GL_RGBA16I_EXT 0x8D88
+#define GL_RGB16I_EXT 0x8D89
+#define GL_ALPHA16I_EXT 0x8D8A
+#define GL_INTENSITY16I_EXT 0x8D8B
+#define GL_LUMINANCE16I_EXT 0x8D8C
+#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
+#define GL_RGBA8I_EXT 0x8D8E
+#define GL_RGB8I_EXT 0x8D8F
+#define GL_ALPHA8I_EXT 0x8D90
+#define GL_INTENSITY8I_EXT 0x8D91
+#define GL_LUMINANCE8I_EXT 0x8D92
+#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
+#define GL_RED_INTEGER_EXT 0x8D94
+#define GL_GREEN_INTEGER_EXT 0x8D95
+#define GL_BLUE_INTEGER_EXT 0x8D96
+#define GL_ALPHA_INTEGER_EXT 0x8D97
+#define GL_RGB_INTEGER_EXT 0x8D98
+#define GL_RGBA_INTEGER_EXT 0x8D99
+#define GL_BGR_INTEGER_EXT 0x8D9A
+#define GL_BGRA_INTEGER_EXT 0x8D9B
+#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
+#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
+#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
+#endif
+
+#ifndef GL_GREMEDY_frame_terminator
+#endif
+
+#ifndef GL_NV_conditional_render
+#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
+#endif
+
+#ifndef GL_NV_present_video
+#define GL_FRAME_NV 0x8E26
+#define GL_FIELDS_NV 0x8E27
+#define GL_CURRENT_TIME_NV 0x8E28
+#define GL_NUM_FILL_STREAMS_NV 0x8E29
+#define GL_PRESENT_TIME_NV 0x8E2A
+#define GL_PRESENT_DURATION_NV 0x8E2B
+#endif
+
+#ifndef GL_EXT_transform_feedback
+#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
+#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
+#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
+#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
+#define GL_RASTERIZER_DISCARD_EXT 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
+#endif
+
+#ifndef GL_EXT_direct_state_access
+#define GL_PROGRAM_MATRIX_EXT 0x8E2D
+#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
+#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
+#endif
+
+#ifndef GL_EXT_vertex_array_bgra
+/* reuse GL_BGRA */
+#endif
+
+#ifndef GL_EXT_texture_swizzle
+#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42
+#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43
+#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44
+#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45
+#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46
+#endif
+
+#ifndef GL_NV_explicit_multisample
+#define GL_SAMPLE_POSITION_NV 0x8E50
+#define GL_SAMPLE_MASK_NV 0x8E51
+#define GL_SAMPLE_MASK_VALUE_NV 0x8E52
+#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
+#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
+#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55
+#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56
+#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57
+#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
+#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59
+#endif
+
+#ifndef GL_NV_transform_feedback2
+#define GL_TRANSFORM_FEEDBACK_NV 0x8E22
+#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
+#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25
+#endif
+
+#ifndef GL_ATI_meminfo
+#define GL_VBO_FREE_MEMORY_ATI 0x87FB
+#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
+#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
+#endif
+
+#ifndef GL_AMD_performance_monitor
+#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
+#endif
+
+#ifndef GL_AMD_texture_texture4
+#endif
+
+#ifndef GL_AMD_vertex_shader_tesselator
+#define GL_SAMPLER_BUFFER_AMD 0x9001
+#define GL_INT_SAMPLER_BUFFER_AMD 0x9002
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003
+#define GL_TESSELLATION_MODE_AMD 0x9004
+#define GL_TESSELLATION_FACTOR_AMD 0x9005
+#define GL_DISCRETE_AMD 0x9006
+#define GL_CONTINUOUS_AMD 0x9007
+#endif
+
+#ifndef GL_EXT_provoking_vertex
+#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C
+#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D
+#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E
+#define GL_PROVOKING_VERTEX_EXT 0x8E4F
+#endif
+
+#ifndef GL_EXT_texture_snorm
+#define GL_ALPHA_SNORM 0x9010
+#define GL_LUMINANCE_SNORM 0x9011
+#define GL_LUMINANCE_ALPHA_SNORM 0x9012
+#define GL_INTENSITY_SNORM 0x9013
+#define GL_ALPHA8_SNORM 0x9014
+#define GL_LUMINANCE8_SNORM 0x9015
+#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016
+#define GL_INTENSITY8_SNORM 0x9017
+#define GL_ALPHA16_SNORM 0x9018
+#define GL_LUMINANCE16_SNORM 0x9019
+#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A
+#define GL_INTENSITY16_SNORM 0x901B
+/* reuse GL_RED_SNORM */
+/* reuse GL_RG_SNORM */
+/* reuse GL_RGB_SNORM */
+/* reuse GL_RGBA_SNORM */
+/* reuse GL_R8_SNORM */
+/* reuse GL_RG8_SNORM */
+/* reuse GL_RGB8_SNORM */
+/* reuse GL_RGBA8_SNORM */
+/* reuse GL_R16_SNORM */
+/* reuse GL_RG16_SNORM */
+/* reuse GL_RGB16_SNORM */
+/* reuse GL_RGBA16_SNORM */
+/* reuse GL_SIGNED_NORMALIZED */
+#endif
+
+#ifndef GL_AMD_draw_buffers_blend
+#endif
+
+#ifndef GL_APPLE_texture_range
+#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7
+#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8
+#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
+#define GL_STORAGE_PRIVATE_APPLE 0x85BD
+/* reuse GL_STORAGE_CACHED_APPLE */
+/* reuse GL_STORAGE_SHARED_APPLE */
+#endif
+
+#ifndef GL_APPLE_float_pixels
+#define GL_HALF_APPLE 0x140B
+#define GL_RGBA_FLOAT32_APPLE 0x8814
+#define GL_RGB_FLOAT32_APPLE 0x8815
+#define GL_ALPHA_FLOAT32_APPLE 0x8816
+#define GL_INTENSITY_FLOAT32_APPLE 0x8817
+#define GL_LUMINANCE_FLOAT32_APPLE 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819
+#define GL_RGBA_FLOAT16_APPLE 0x881A
+#define GL_RGB_FLOAT16_APPLE 0x881B
+#define GL_ALPHA_FLOAT16_APPLE 0x881C
+#define GL_INTENSITY_FLOAT16_APPLE 0x881D
+#define GL_LUMINANCE_FLOAT16_APPLE 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F
+#define GL_COLOR_FLOAT_APPLE 0x8A0F
+#endif
+
+#ifndef GL_APPLE_vertex_program_evaluators
+#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00
+#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01
+#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02
+#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03
+#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04
+#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05
+#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06
+#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07
+#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08
+#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09
+#endif
+
+#ifndef GL_APPLE_aux_depth_stencil
+#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14
+#endif
+
+#ifndef GL_APPLE_object_purgeable
+#define GL_BUFFER_OBJECT_APPLE 0x85B3
+#define GL_RELEASED_APPLE 0x8A19
+#define GL_VOLATILE_APPLE 0x8A1A
+#define GL_RETAINED_APPLE 0x8A1B
+#define GL_UNDEFINED_APPLE 0x8A1C
+#define GL_PURGEABLE_APPLE 0x8A1D
+#endif
+
+#ifndef GL_APPLE_row_bytes
+#define GL_PACK_ROW_BYTES_APPLE 0x8A15
+#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16
+#endif
+
+#ifndef GL_APPLE_rgb_422
+#define GL_RGB_422_APPLE 0x8A1F
+/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */
+/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+#endif
+
+#ifndef GL_NV_video_capture
+#define GL_VIDEO_BUFFER_NV 0x9020
+#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
+#define GL_FIELD_UPPER_NV 0x9022
+#define GL_FIELD_LOWER_NV 0x9023
+#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
+#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
+#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
+#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
+#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
+#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
+#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
+#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
+#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
+#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
+#define GL_PARTIAL_SUCCESS_NV 0x902E
+#define GL_SUCCESS_NV 0x902F
+#define GL_FAILURE_NV 0x9030
+#define GL_YCBYCR8_422_NV 0x9031
+#define GL_YCBAYCR8A_4224_NV 0x9032
+#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
+#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
+#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
+#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
+#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
+#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
+#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
+#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
+#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
+#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
+#endif
+
+#ifndef GL_NV_copy_image
+#endif
+
+#ifndef GL_EXT_separate_shader_objects
+#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
+#endif
+
+#ifndef GL_NV_parameter_buffer_object2
+#endif
+
+#ifndef GL_NV_shader_buffer_load
+#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
+#define GL_GPU_ADDRESS_NV 0x8F34
+#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35
+#endif
+
+#ifndef GL_NV_vertex_buffer_unified_memory
+#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
+#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F
+#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
+#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21
+#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22
+#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23
+#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24
+#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
+#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26
+#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
+#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28
+#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29
+#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A
+#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B
+#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C
+#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D
+#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E
+#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F
+#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30
+#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
+#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32
+#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33
+#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40
+#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41
+#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42
+#endif
+
+#ifndef GL_NV_texture_barrier
+#endif
+
+#ifndef GL_AMD_shader_stencil_export
+#endif
+
+#ifndef GL_AMD_seamless_cubemap_per_texture
+/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */
+#endif
+
+#ifndef GL_AMD_conservative_depth
+#endif
+
+#ifndef GL_EXT_shader_image_load_store
+#define GL_MAX_IMAGE_UNITS_EXT 0x8F38
+#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39
+#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A
+#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B
+#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C
+#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D
+#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E
+#define GL_IMAGE_1D_EXT 0x904C
+#define GL_IMAGE_2D_EXT 0x904D
+#define GL_IMAGE_3D_EXT 0x904E
+#define GL_IMAGE_2D_RECT_EXT 0x904F
+#define GL_IMAGE_CUBE_EXT 0x9050
+#define GL_IMAGE_BUFFER_EXT 0x9051
+#define GL_IMAGE_1D_ARRAY_EXT 0x9052
+#define GL_IMAGE_2D_ARRAY_EXT 0x9053
+#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054
+#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055
+#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056
+#define GL_INT_IMAGE_1D_EXT 0x9057
+#define GL_INT_IMAGE_2D_EXT 0x9058
+#define GL_INT_IMAGE_3D_EXT 0x9059
+#define GL_INT_IMAGE_2D_RECT_EXT 0x905A
+#define GL_INT_IMAGE_CUBE_EXT 0x905B
+#define GL_INT_IMAGE_BUFFER_EXT 0x905C
+#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D
+#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E
+#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F
+#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060
+#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061
+#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062
+#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063
+#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064
+#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065
+#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066
+#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067
+#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068
+#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069
+#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B
+#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C
+#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D
+#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E
+#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001
+#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002
+#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004
+#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008
+#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020
+#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040
+#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080
+#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100
+#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200
+#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400
+#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800
+#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000
+#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF
+#endif
+
+#ifndef GL_EXT_vertex_attrib_64bit
+/* reuse GL_DOUBLE */
+#define GL_DOUBLE_VEC2_EXT 0x8FFC
+#define GL_DOUBLE_VEC3_EXT 0x8FFD
+#define GL_DOUBLE_VEC4_EXT 0x8FFE
+#define GL_DOUBLE_MAT2_EXT 0x8F46
+#define GL_DOUBLE_MAT3_EXT 0x8F47
+#define GL_DOUBLE_MAT4_EXT 0x8F48
+#define GL_DOUBLE_MAT2x3_EXT 0x8F49
+#define GL_DOUBLE_MAT2x4_EXT 0x8F4A
+#define GL_DOUBLE_MAT3x2_EXT 0x8F4B
+#define GL_DOUBLE_MAT3x4_EXT 0x8F4C
+#define GL_DOUBLE_MAT4x2_EXT 0x8F4D
+#define GL_DOUBLE_MAT4x3_EXT 0x8F4E
+#endif
+
+#ifndef GL_NV_gpu_program5
+#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A
+#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
+#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
+#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F
+#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44
+#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45
+#endif
+
+#ifndef GL_NV_gpu_shader5
+#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
+/* reuse GL_PATCHES */
+#endif
+
+#ifndef GL_NV_shader_buffer_store
+#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010
+/* reuse GL_READ_WRITE */
+/* reuse GL_WRITE_ONLY */
+#endif
+
+#ifndef GL_NV_tessellation_program5
+#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
+#define GL_TESS_CONTROL_PROGRAM_NV 0x891E
+#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F
+#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74
+#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75
+#endif
+
+#ifndef GL_NV_vertex_attrib_integer_64bit
+/* reuse GL_INT64_NV */
+/* reuse GL_UNSIGNED_INT64_NV */
+#endif
+
+#ifndef GL_NV_multisample_coverage
+#define GL_COVERAGE_SAMPLES_NV 0x80A9
+#define GL_COLOR_SAMPLES_NV 0x8E20
+#endif
+
+#ifndef GL_AMD_name_gen_delete
+#define GL_DATA_BUFFER_AMD 0x9151
+#define GL_PERFORMANCE_MONITOR_AMD 0x9152
+#define GL_QUERY_OBJECT_AMD 0x9153
+#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154
+#define GL_SAMPLER_OBJECT_AMD 0x9155
+#endif
+
+#ifndef GL_AMD_debug_output
+#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144
+#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145
+#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147
+#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148
+#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149
+#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A
+#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B
+#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C
+#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D
+#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E
+#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F
+#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150
+#endif
+
+#ifndef GL_NV_vdpau_interop
+#define GL_SURFACE_STATE_NV 0x86EB
+#define GL_SURFACE_REGISTERED_NV 0x86FD
+#define GL_SURFACE_MAPPED_NV 0x8700
+#define GL_WRITE_DISCARD_NV 0x88BE
+#endif
+
+#ifndef GL_AMD_transform_feedback3_lines_triangles
+#endif
+
+#ifndef GL_AMD_depth_clamp_separate
+#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E
+#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
+#endif
+
+#ifndef GL_EXT_texture_sRGB_decode
+#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
+#define GL_DECODE_EXT 0x8A49
+#define GL_SKIP_DECODE_EXT 0x8A4A
+#endif
+
+#ifndef GL_NV_texture_multisample
+#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
+#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
+#endif
+
+#ifndef GL_AMD_blend_minmax_factor
+#define GL_FACTOR_MIN_AMD 0x901C
+#define GL_FACTOR_MAX_AMD 0x901D
+#endif
+
+#ifndef GL_AMD_sample_positions
+#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
+#endif
+
+#ifndef GL_EXT_x11_sync_object
+#define GL_SYNC_X11_FENCE_EXT 0x90E1
+#endif
+
+#ifndef GL_AMD_multi_draw_indirect
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample_blit_scaled
+#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
+#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
+#endif
+
+#ifndef GL_NV_path_rendering
+#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_PATH_SAMPLE_QUALITY_NV 0x9085
+#define GL_PATH_STROKE_BOUND_NV 0x9086
+#define GL_PATH_STROKE_OVERSAMPLE_COUNT_NV 0x9087
+#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_MULTI_HULLS_NV 0x908C
+#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_PROJECTIVE_2D_NV 0x9093
+#define GL_AFFINE_3D_NV 0x9094
+#define GL_PROJECTIVE_3D_NV 0x9095
+#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096
+#define GL_TRANSPOSE_PROJECTIVE_2D_NV 0x9097
+#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098
+#define GL_TRANSPOSE_PROJECTIVE_3D_NV 0x9099
+#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_PATH_FOG_GEN_MODE_NV 0x90AC
+#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_COLOR_FORMAT_NV 0x90B2
+#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_NV 0x100
+#define GL_FONT_X_MIN_BOUNDS_NV 0x00010000
+#define GL_FONT_Y_MIN_BOUNDS_NV 0x00020000
+#define GL_FONT_X_MAX_BOUNDS_NV 0x00040000
+#define GL_FONT_Y_MAX_BOUNDS_NV 0x00080000
+#define GL_FONT_UNITS_PER_EM_NV 0x00100000
+#define GL_FONT_ASCENDER_NV 0x00200000
+#define GL_FONT_DESCENDER_NV 0x00400000
+#define GL_FONT_HEIGHT_NV 0x00800000
+#define GL_FONT_MAX_ADVANCE_WIDTH_NV 0x01000000
+#define GL_FONT_MAX_ADVANCE_HEIGHT_NV 0x02000000
+#define GL_FONT_UNDERLINE_POSITION_NV 0x04000000
+#define GL_FONT_UNDERLINE_THICKNESS_NV 0x08000000
+#define GL_FONT_HAS_KERNING_NV 0x10000000
+#endif
+
+#ifndef GL_AMD_pinned_memory
+#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160
+#endif
+
+#ifndef GL_AMD_stencil_operation_extended
+#define GL_SET_AMD 0x874A
+#define GL_REPLACE_VALUE_AMD 0x874B
+#define GL_STENCIL_OP_VALUE_AMD 0x874C
+#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D
+#endif
+
+#ifndef GL_AMD_vertex_shader_viewport_index
+#endif
+
+#ifndef GL_AMD_vertex_shader_layer
+#endif
+
+#ifndef GL_NV_bindless_texture
+#endif
+
+#ifndef GL_NV_shader_atomic_float
+#endif
+
+#ifndef GL_AMD_query_buffer_object
+#define GL_QUERY_BUFFER_AMD 0x9192
+#define GL_QUERY_BUFFER_BINDING_AMD 0x9193
+#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194
+#endif
+
+#ifndef GL_AMD_sparse_texture
+#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195
+#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196
+#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197
+#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198
+#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199
+#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A
+#define GL_MIN_SPARSE_LEVEL_AMD 0x919B
+#define GL_MIN_LOD_WARNING_AMD 0x919C
+#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001
+#endif
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar;
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+typedef khronos_ssize_t GLintptr;
+typedef khronos_intptr_t GLsizeiptr;
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for program/shader text and shader object handles */
+typedef char GLcharARB;
+typedef unsigned int GLhandleARB;
+#endif
+
+/* GL type for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+typedef unsigned short GLhalfNV;
+#endif
+
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glxext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GL_EXT_timer_query extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+#elif defined(__sun__) || defined(__digital__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__) || defined(_LP64)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS ) || defined(__sgi)
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(_WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+/* Fallback if nothing above works */
+#include <inttypes.h>
+#endif
+#endif
+
+#ifndef GL_EXT_timer_query
+typedef int64_t GLint64EXT;
+typedef uint64_t GLuint64EXT;
+#endif
+
+#ifndef GL_ARB_sync
+typedef int64_t GLint64;
+typedef uint64_t GLuint64;
+typedef struct __GLsync *GLsync;
+#endif
+
+#ifndef GL_ARB_cl_event
+/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */
+struct _cl_context;
+struct _cl_event;
+#endif
+
+#ifndef GL_ARB_debug_output
+typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_AMD_debug_output
+typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_KHR_debug
+typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_NV_vdpau_interop
+typedef GLintptr GLvdpauSurfaceNV;
+#endif
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GLAPI void APIENTRY glBlendEquation (GLenum mode);
+GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glResetHistogram (GLenum target);
+GLAPI void APIENTRY glResetMinmax (GLenum target);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTexture (GLenum texture);
+GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img);
+GLAPI void APIENTRY glClientActiveTexture (GLenum texture);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
+GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount);
+GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param);
+GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFogCoordf (GLfloat coord);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord);
+GLAPI void APIENTRY glFogCoordd (GLdouble coord);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord);
+GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v);
+GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *v);
+GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *v);
+GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint id);
+GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id);
+GLAPI void APIENTRY glEndQuery (GLenum target);
+GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer);
+GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GLAPI void APIENTRY glCompileShader (GLuint shader);
+GLAPI GLuint APIENTRY glCreateProgram (void);
+GLAPI GLuint APIENTRY glCreateShader (GLenum type);
+GLAPI void APIENTRY glDeleteProgram (GLuint program);
+GLAPI void APIENTRY glDeleteShader (GLuint shader);
+GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint program);
+GLAPI GLboolean APIENTRY glIsShader (GLuint shader);
+GLAPI void APIENTRY glLinkProgram (GLuint program);
+GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length);
+GLAPI void APIENTRY glUseProgram (GLuint program);
+GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0);
+GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glUniform1i (GLint location, GLint v0);
+GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glValidateProgram (GLuint program);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length);
+typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_VERSION_2_1
+#define GL_VERSION_2_1 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+
+#ifndef GL_VERSION_3_0
+#define GL_VERSION_3_0 1
+/* OpenGL 3.0 also reuses entry points from these extensions: */
+/* ARB_framebuffer_object */
+/* ARB_map_buffer_range */
+/* ARB_vertex_array_object */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY glEnablei (GLenum target, GLuint index);
+GLAPI void APIENTRY glDisablei (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index);
+GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedback (void);
+GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode);
+GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp);
+GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode);
+GLAPI void APIENTRY glEndConditionalRender (void);
+GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x);
+GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x);
+GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0);
+GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
+GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
+GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
+typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
+typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
+#endif
+
+#ifndef GL_VERSION_3_1
+#define GL_VERSION_3_1 1
+/* OpenGL 3.1 also reuses entry points from these extensions: */
+/* ARB_copy_buffer */
+/* ARB_uniform_buffer_object */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount);
+GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount);
+typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
+#endif
+
+#ifndef GL_VERSION_3_2
+#define GL_VERSION_3_2 1
+/* OpenGL 3.2 also reuses entry points from these extensions: */
+/* ARB_draw_elements_base_vertex */
+/* ARB_provoking_vertex */
+/* ARB_sync */
+/* ARB_texture_multisample */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
+GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#endif
+
+#ifndef GL_VERSION_3_3
+#define GL_VERSION_3_3 1
+/* OpenGL 3.3 also reuses entry points from these extensions: */
+/* ARB_blend_func_extended */
+/* ARB_sampler_objects */
+/* ARB_explicit_attrib_location, but it has none */
+/* ARB_occlusion_query2 (no entry points) */
+/* ARB_shader_bit_encoding (no entry points) */
+/* ARB_texture_rgb10_a2ui (no entry points) */
+/* ARB_texture_swizzle (no entry points) */
+/* ARB_timer_query */
+/* ARB_vertex_type_2_10_10_10_rev */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
+#endif
+
+#ifndef GL_VERSION_4_0
+#define GL_VERSION_4_0 1
+/* OpenGL 4.0 also reuses entry points from these extensions: */
+/* ARB_texture_query_lod (no entry points) */
+/* ARB_draw_indirect */
+/* ARB_gpu_shader5 (no entry points) */
+/* ARB_gpu_shader_fp64 */
+/* ARB_shader_subroutine */
+/* ARB_tessellation_shader */
+/* ARB_texture_buffer_object_rgb32 (no entry points) */
+/* ARB_texture_cube_map_array (no entry points) */
+/* ARB_texture_gather (no entry points) */
+/* ARB_transform_feedback2 */
+/* ARB_transform_feedback3 */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMinSampleShading (GLfloat value);
+GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+
+#ifndef GL_VERSION_4_1
+#define GL_VERSION_4_1 1
+/* OpenGL 4.1 reuses entry points from these extensions: */
+/* ARB_ES2_compatibility */
+/* ARB_get_program_binary */
+/* ARB_separate_shader_objects */
+/* ARB_shader_precision (no entry points) */
+/* ARB_vertex_attrib_64bit */
+/* ARB_viewport_array */
+#endif
+
+#ifndef GL_VERSION_4_2
+#define GL_VERSION_4_2 1
+/* OpenGL 4.2 reuses entry points from these extensions: */
+/* ARB_base_instance */
+/* ARB_shading_language_420pack (no entry points) */
+/* ARB_transform_feedback_instanced */
+/* ARB_compressed_texture_pixel_storage (no entry points) */
+/* ARB_conservative_depth (no entry points) */
+/* ARB_internalformat_query */
+/* ARB_map_buffer_alignment (no entry points) */
+/* ARB_shader_atomic_counters */
+/* ARB_shader_image_load_store */
+/* ARB_shading_language_packing (no entry points) */
+/* ARB_texture_storage */
+#endif
+
+#ifndef GL_VERSION_4_3
+#define GL_VERSION_4_3 1
+/* OpenGL 4.3 reuses entry points from these extensions: */
+/* ARB_arrays_of_arrays (no entry points, GLSL only) */
+/* ARB_fragment_layer_viewport (no entry points, GLSL only) */
+/* ARB_shader_image_size (no entry points, GLSL only) */
+/* ARB_ES3_compatibility (no entry points) */
+/* ARB_clear_buffer_object */
+/* ARB_compute_shader */
+/* ARB_copy_image */
+/* KHR_debug (includes ARB_debug_output commands promoted to KHR without suffixes) */
+/* ARB_explicit_uniform_location (no entry points) */
+/* ARB_framebuffer_no_attachments */
+/* ARB_internalformat_query2 */
+/* ARB_invalidate_subdata */
+/* ARB_multi_draw_indirect */
+/* ARB_program_interface_query */
+/* ARB_robust_buffer_access_behavior (no entry points) */
+/* ARB_shader_storage_buffer_object */
+/* ARB_stencil_texturing (no entry points) */
+/* ARB_texture_buffer_range */
+/* ARB_texture_query_levels (no entry points) */
+/* ARB_texture_storage_multisample */
+/* ARB_texture_view */
+/* ARB_vertex_attrib_binding */
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert);
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#define GL_ARB_texture_env_add 1
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_ARB_texture_border_clamp 1
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_ARB_vertex_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights);
+GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights);
+GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights);
+GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights);
+GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights);
+GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights);
+GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights);
+GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights);
+GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexBlendARB (GLint count);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_ARB_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#define GL_ARB_texture_env_crossbar 1
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_ARB_texture_mirrored_repeat 1
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_ARB_depth_texture 1
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_ARB_shadow 1
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_ARB_shadow_ambient 1
+#endif
+
+#ifndef GL_ARB_window_pos
+#define GL_ARB_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer);
+GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id);
+GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id);
+GLAPI void APIENTRY glEndQueryARB (GLenum target);
+GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj);
+GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0);
+GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0);
+GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#define GL_ARB_fragment_program_shadow 1
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_ARB_texture_rectangle 1
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_ARB_color_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+#endif
+
+#ifndef GL_ARB_depth_buffer_float
+#define GL_ARB_depth_buffer_float 1
+#endif
+
+#ifndef GL_ARB_draw_instanced
+#define GL_ARB_draw_instanced 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_ARB_framebuffer_object
+#define GL_ARB_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer);
+GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target);
+GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateMipmap (GLenum target);
+GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif
+
+#ifndef GL_ARB_framebuffer_sRGB
+#define GL_ARB_framebuffer_sRGB 1
+#endif
+
+#ifndef GL_ARB_geometry_shader4
+#define GL_ARB_geometry_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value);
+GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif
+
+#ifndef GL_ARB_half_float_vertex
+#define GL_ARB_half_float_vertex 1
+#endif
+
+#ifndef GL_ARB_instanced_arrays
+#define GL_ARB_instanced_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
+#endif
+
+#ifndef GL_ARB_map_buffer_range
+#define GL_ARB_map_buffer_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif
+
+#ifndef GL_ARB_texture_buffer_object
+#define GL_ARB_texture_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+#endif
+
+#ifndef GL_ARB_texture_compression_rgtc
+#define GL_ARB_texture_compression_rgtc 1
+#endif
+
+#ifndef GL_ARB_texture_rg
+#define GL_ARB_texture_rg 1
+#endif
+
+#ifndef GL_ARB_vertex_array_object
+#define GL_ARB_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArray (GLuint array);
+GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
+GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
+#endif
+
+#ifndef GL_ARB_uniform_buffer_object
+#define GL_ARB_uniform_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices);
+GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
+GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
+GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
+typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+#endif
+
+#ifndef GL_ARB_compatibility
+#define GL_ARB_compatibility 1
+#endif
+
+#ifndef GL_ARB_copy_buffer
+#define GL_ARB_copy_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+#endif
+
+#ifndef GL_ARB_shader_texture_lod
+#define GL_ARB_shader_texture_lod 1
+#endif
+
+#ifndef GL_ARB_depth_clamp
+#define GL_ARB_depth_clamp 1
+#endif
+
+#ifndef GL_ARB_draw_elements_base_vertex
+#define GL_ARB_draw_elements_base_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);
+GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex);
+#endif
+
+#ifndef GL_ARB_fragment_coord_conventions
+#define GL_ARB_fragment_coord_conventions 1
+#endif
+
+#ifndef GL_ARB_provoking_vertex
+#define GL_ARB_provoking_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProvokingVertex (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_ARB_seamless_cube_map
+#define GL_ARB_seamless_cube_map 1
+#endif
+
+#ifndef GL_ARB_sync
+#define GL_ARB_sync 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
+GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
+GLAPI void APIENTRY glDeleteSync (GLsync sync);
+GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
+typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync);
+typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
+typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+#endif
+
+#ifndef GL_ARB_texture_multisample
+#define GL_ARB_texture_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
+GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
+typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);
+#endif
+
+#ifndef GL_ARB_vertex_array_bgra
+#define GL_ARB_vertex_array_bgra 1
+#endif
+
+#ifndef GL_ARB_draw_buffers_blend
+#define GL_ARB_draw_buffers_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+
+#ifndef GL_ARB_sample_shading
+#define GL_ARB_sample_shading 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value);
+#endif
+
+#ifndef GL_ARB_texture_cube_map_array
+#define GL_ARB_texture_cube_map_array 1
+#endif
+
+#ifndef GL_ARB_texture_gather
+#define GL_ARB_texture_gather 1
+#endif
+
+#ifndef GL_ARB_texture_query_lod
+#define GL_ARB_texture_query_lod 1
+#endif
+
+#ifndef GL_ARB_shading_language_include
+#define GL_ARB_shading_language_include 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
+GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name);
+GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
+GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name);
+GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
+GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string);
+typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length);
+typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
+typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_ARB_texture_compression_bptc
+#define GL_ARB_texture_compression_bptc 1
+#endif
+
+#ifndef GL_ARB_blend_func_extended
+#define GL_ARB_blend_func_extended 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
+#endif
+
+#ifndef GL_ARB_explicit_attrib_location
+#define GL_ARB_explicit_attrib_location 1
+#endif
+
+#ifndef GL_ARB_occlusion_query2
+#define GL_ARB_occlusion_query2 1
+#endif
+
+#ifndef GL_ARB_sampler_objects
+#define GL_ARB_sampler_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
+GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
+GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler);
+GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler);
+GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
+GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
+GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
+GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param);
+GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param);
+GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
+typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
+typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler);
+typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_bit_encoding
+#define GL_ARB_shader_bit_encoding 1
+#endif
+
+#ifndef GL_ARB_texture_rgb10_a2ui
+#define GL_ARB_texture_rgb10_a2ui 1
+#endif
+
+#ifndef GL_ARB_texture_swizzle
+#define GL_ARB_texture_swizzle 1
+#endif
+
+#ifndef GL_ARB_timer_query
+#define GL_ARB_timer_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target);
+GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params);
+GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
+#endif
+
+#ifndef GL_ARB_vertex_type_2_10_10_10_rev
+#define GL_ARB_vertex_type_2_10_10_10_rev 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value);
+GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value);
+GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords);
+GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords);
+GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords);
+GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color);
+GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color);
+GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value);
+typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
+typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords);
+typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
+#endif
+
+#ifndef GL_ARB_draw_indirect
+#define GL_ARB_draw_indirect 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect);
+GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect);
+#endif
+
+#ifndef GL_ARB_gpu_shader5
+#define GL_ARB_gpu_shader5 1
+#endif
+
+#ifndef GL_ARB_gpu_shader_fp64
+#define GL_ARB_gpu_shader_fp64 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x);
+GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
+typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params);
+#endif
+
+#ifndef GL_ARB_shader_subroutine
+#define GL_ARB_shader_subroutine 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
+GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
+GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
+GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
+GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
+GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
+typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
+typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
+#endif
+
+#ifndef GL_ARB_tessellation_shader
+#define GL_ARB_tessellation_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value);
+GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values);
+#endif
+
+#ifndef GL_ARB_texture_buffer_object_rgb32
+#define GL_ARB_texture_buffer_object_rgb32 1
+#endif
+
+#ifndef GL_ARB_transform_feedback2
+#define GL_ARB_transform_feedback2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
+GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id);
+GLAPI void APIENTRY glPauseTransformFeedback (void);
+GLAPI void APIENTRY glResumeTransformFeedback (void);
+GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids);
+typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
+#endif
+
+#ifndef GL_ARB_transform_feedback3
+#define GL_ARB_transform_feedback3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream);
+GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id);
+GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index);
+GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
+typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_ARB_ES2_compatibility
+#define GL_ARB_ES2_compatibility 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReleaseShaderCompiler (void);
+GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
+GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f);
+GLAPI void APIENTRY glClearDepthf (GLfloat d);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
+typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
+typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
+typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
+#endif
+
+#ifndef GL_ARB_get_program_binary
+#define GL_ARB_get_program_binary 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
+GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
+#endif
+
+#ifndef GL_ARB_separate_shader_objects
+#define GL_ARB_separate_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
+GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
+GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* const *strings);
+GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
+GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
+GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
+GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
+GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
+GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0);
+GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
+GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1);
+GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
+GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline);
+GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* const *strings);
+typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
+typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif
+
+#ifndef GL_ARB_vertex_attrib_64bit
+#define GL_ARB_vertex_attrib_64bit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+#endif
+
+#ifndef GL_ARB_viewport_array
+#define GL_ARB_viewport_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v);
+GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v);
+GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f);
+GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data);
+GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);
+typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f);
+typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
+#endif
+
+#ifndef GL_ARB_cl_event
+#define GL_ARB_cl_event 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
+#endif
+
+#ifndef GL_ARB_debug_output
+#define GL_ARB_debug_output 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+#endif
+
+#ifndef GL_ARB_robustness
+#define GL_ARB_robustness 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void);
+GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
+GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
+GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
+GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values);
+GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values);
+GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values);
+GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern);
+GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
+GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
+GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
+GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
+GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
+GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
+typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
+typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
+typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values);
+typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values);
+typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern);
+typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img);
+typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img);
+typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
+typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
+#endif
+
+#ifndef GL_ARB_shader_stencil_export
+#define GL_ARB_shader_stencil_export 1
+#endif
+
+#ifndef GL_ARB_base_instance
+#define GL_ARB_base_instance 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
+GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
+GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
+#endif
+
+#ifndef GL_ARB_shading_language_420pack
+#define GL_ARB_shading_language_420pack 1
+#endif
+
+#ifndef GL_ARB_transform_feedback_instanced
+#define GL_ARB_transform_feedback_instanced 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount);
+GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
+#endif
+
+#ifndef GL_ARB_compressed_texture_pixel_storage
+#define GL_ARB_compressed_texture_pixel_storage 1
+#endif
+
+#ifndef GL_ARB_conservative_depth
+#define GL_ARB_conservative_depth 1
+#endif
+
+#ifndef GL_ARB_internalformat_query
+#define GL_ARB_internalformat_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+#endif
+
+#ifndef GL_ARB_map_buffer_alignment
+#define GL_ARB_map_buffer_alignment 1
+#endif
+
+#ifndef GL_ARB_shader_atomic_counters
+#define GL_ARB_shader_atomic_counters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_ARB_shader_image_load_store
+#define GL_ARB_shader_image_load_store 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
+#endif
+
+#ifndef GL_ARB_shading_language_packing
+#define GL_ARB_shading_language_packing 1
+#endif
+
+#ifndef GL_ARB_texture_storage
+#define GL_ARB_texture_storage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
+#ifndef GL_KHR_texture_compression_astc_ldr
+#define GL_KHR_texture_compression_astc_ldr 1
+#endif
+
+#ifndef GL_KHR_debug
+#define GL_KHR_debug 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message);
+GLAPI void APIENTRY glPopDebugGroup (void);
+GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label);
+GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
+typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void);
+typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);
+typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+#endif
+
+#ifndef GL_ARB_arrays_of_arrays
+#define GL_ARB_arrays_of_arrays 1
+#endif
+
+#ifndef GL_ARB_clear_buffer_object
+#define GL_ARB_clear_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
+GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
+typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);
+#endif
+
+#ifndef GL_ARB_compute_shader
+#define GL_ARB_compute_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
+#endif
+
+#ifndef GL_ARB_copy_image
+#define GL_ARB_copy_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyImageSubData (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 /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (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
+
+#ifndef GL_ARB_texture_view
+#define GL_ARB_texture_view 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+#endif
+
+#ifndef GL_ARB_vertex_attrib_binding
+#define GL_ARB_vertex_attrib_binding 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex);
+GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);
+GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
+GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);
+typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
+typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor);
+#endif
+
+#ifndef GL_ARB_robustness_isolation
+#define GL_ARB_robustness_isolation 1
+#endif
+
+#ifndef GL_ARB_ES3_compatibility
+#define GL_ARB_ES3_compatibility 1
+#endif
+
+#ifndef GL_ARB_explicit_uniform_location
+#define GL_ARB_explicit_uniform_location 1
+#endif
+
+#ifndef GL_ARB_fragment_layer_viewport
+#define GL_ARB_fragment_layer_viewport 1
+#endif
+
+#ifndef GL_ARB_framebuffer_no_attachments
+#define GL_ARB_framebuffer_no_attachments 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param);
+GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_ARB_internalformat_query2
+#define GL_ARB_internalformat_query2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
+#endif
+
+#ifndef GL_ARB_invalidate_subdata
+#define GL_ARB_invalidate_subdata 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
+GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level);
+GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length);
+GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer);
+GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_ARB_multi_draw_indirect
+#define GL_ARB_multi_draw_indirect 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
+#endif
+
+#ifndef GL_ARB_program_interface_query
+#define GL_ARB_program_interface_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
+GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
+GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
+#endif
+
+#ifndef GL_ARB_robust_buffer_access_behavior
+#define GL_ARB_robust_buffer_access_behavior 1
+#endif
+
+#ifndef GL_ARB_shader_image_size
+#define GL_ARB_shader_image_size 1
+#endif
+
+#ifndef GL_ARB_shader_storage_buffer_object
+#define GL_ARB_shader_storage_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
+#endif
+
+#ifndef GL_ARB_stencil_texturing
+#define GL_ARB_stencil_texturing 1
+#endif
+
+#ifndef GL_ARB_texture_buffer_range
+#define GL_ARB_texture_buffer_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#endif
+
+#ifndef GL_ARB_texture_query_levels
+#define GL_ARB_texture_query_levels 1
+#endif
+
+#ifndef GL_ARB_texture_storage_multisample
+#define GL_ARB_texture_storage_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_EXT_texture 1
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_SGIS_texture_filter4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
+typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif
+
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum target);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum target);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_SGI_color_matrix 1
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_SGI_color_table 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_SGIX_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_SGIS_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_SGIS_texture4D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_SGI_texture_color_table 1
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences);
+GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture);
+GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures);
+GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures);
+GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture);
+GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
+typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_SGIS_detail_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_SGIS_sharpen_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_SGIS_texture_lod 1
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_SGIS_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glArrayElementEXT (GLint i);
+GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer);
+GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
+typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
+typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#define GL_EXT_misc_attribute 1
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_SGIX_clipmap 1
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_SGIX_shadow 1
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_SGIS_texture_border_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationEXT (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_SGIX_interlace 1
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_SGIX_pixel_tiles 1
+#endif
+
+#ifndef GL_SGIX_texture_select
+#define GL_SGIX_texture_select 1
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SGIX_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_SGIX_texture_multi_buffer 1
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_SGIS_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_SGIX_instruments 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
+GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker);
+GLAPI void APIENTRY glStartInstrumentsSGIX (void);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
+typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
+typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
+typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_SGIX_texture_scale_bias 1
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_SGIX_framezoom 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameZoomSGIX (GLint factor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#define GL_SGIX_tag_sample_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTagSampleBufferSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_SGIX_polynomial_ffd 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield mask);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_SGIX_reference_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#define GL_SGIX_flush_raster 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushRasterSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_SGIX_depth_texture 1
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_SGIS_fog_function 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_SGIX_fog_offset 1
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_HP_image_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_HP_convolution_border_modes 1
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_SGIX_texture_add_env 1
+#endif
+
+#ifndef GL_EXT_color_subtable
+#define GL_EXT_color_subtable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_PGI_vertex_hints 1
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_SGIX_list_priority 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_SGIX_ir_instrument1 1
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_SGIX_calligraphic_fragment 1
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_SGIX_texture_lod_bias 1
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SGIX_shadow_ambient 1
+#endif
+
+#ifndef GL_EXT_index_texture
+#define GL_EXT_index_texture 1
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_EXT_index_material 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_EXT_index_func 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_EXT_index_array_formats 1
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count);
+GLAPI void APIENTRY glUnlockArraysEXT (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_EXT_cull_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_SGIX_ycrcb 1
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_SGIX_fragment_lighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_IBM_rasterpos_clip 1
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_HP_texture_lighting 1
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_EXT_draw_range_elements 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_WIN_phong_shading 1
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_WIN_specular_fog 1
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_EXT_light_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glApplyTextureEXT (GLenum mode);
+GLAPI void APIENTRY glTextureLightEXT (GLenum pname);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_SGIX_blend_alpha_minmax 1
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_EXT_bgra 1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_SGIX_async 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
+typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
+typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
+typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_SGIX_async_pixel 1
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_SGIX_async_histogram 1
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_INTEL_parallel_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_HP_occlusion_test 1
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_EXT_pixel_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#define GL_EXT_pixel_transform_color_table 1
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_EXT_separate_specular_color 1
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_EXT_texture_perturb_normal 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_REND_screen_coordinates 1
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_EXT_coordinate_frame 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *v);
+GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *v);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v);
+GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
+typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
+typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
+typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
+typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
+typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
+typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
+typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
+typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
+typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
+typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_APPLE_specular_vector 1
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_APPLE_transform_hint 1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_SGIX_fog_scale 1
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_SUNX_constant_data 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFinishTextureSUNX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_SUN_global_alpha 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_SUN_triangle_list 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_SUN_vertex
+#define GL_SUN_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_blend_func_separate
+#define GL_INGR_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_INGR_color_clamp 1
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INGR_interlace_read 1
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_EXT_422_pixels 1
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_SUN_convolution_border_modes 1
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_EXT_vertex_weighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_NV_light_max_exponent 1
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_NV_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param);
+GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_NV_fog_distance 1
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_NV_texgen_emboss 1
+#endif
+
+#ifndef GL_NV_blend_square
+#define GL_NV_blend_square 1
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_NV_texture_env_combine4 1
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#define GL_MESA_resize_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glResizeBuffersMESA (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
+#endif
+
+#ifndef GL_MESA_window_pos
+#define GL_MESA_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_IBM_cull_vertex 1
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#define GL_IBM_multimode_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_IBM_vertex_array_lists 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_SGIX_subsample 1
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_SGIX_ycrcba 1
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#define GL_SGIX_ycrcb_subsample 1
+#endif
+
+#ifndef GL_SGIX_depth_pass_instrument
+#define GL_SGIX_depth_pass_instrument 1
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_3DFX_texture_compression_FXT1 1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_3DFX_multisample 1
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#define GL_3DFX_tbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_EXT_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_SGIX_vertex_preclip 1
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_SGIX_resample 1
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_SGIS_texture_color_mask 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif
+
+#ifndef GL_SGIX_igloo_interface
+#define GL_SGIX_igloo_interface 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_ATI_texture_mirror_once 1
+#endif
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
+GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence);
+GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
+GLAPI void APIENTRY glFinishFenceNV (GLuint fence);
+GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_NV_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_NV_packed_depth_stencil 1
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_NV_texture_rectangle 1
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_NV_texture_shader2 1
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_NV_vertex_array_range2 1
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences);
+GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id);
+GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
+typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_SGIX_texture_coordinate_clamp 1
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SGIX_scalebias_hint 1
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_OML_interlace 1
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_OML_subsample 1
+#endif
+
+#ifndef GL_OML_resample
+#define GL_OML_resample 1
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_NV_copy_depth_to_color 1
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_ATI_envmap_bumpmap 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id);
+GLAPI void APIENTRY glBeginFragmentShaderATI (void);
+GLAPI void APIENTRY glEndFragmentShaderATI (void);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle);
+GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_ATI_pn_triangles 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_ATI_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
+typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_EXT_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVertexShaderEXT (void);
+GLAPI void APIENTRY glEndVertexShaderEXT (void);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr);
+GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr);
+GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr);
+GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr);
+GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr);
+GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr);
+GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr);
+GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr);
+GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
+typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
+typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
+typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
+typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
+typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
+typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
+typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
+typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
+typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_ATI_vertex_streams 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ATI_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_SUN_mesh_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SUN_slice_accum 1
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_NV_multisample_filter_hint 1
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_NV_depth_clamp 1
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id);
+GLAPI void APIENTRY glEndOcclusionQueryNV (void);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_NV_point_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param);
+GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_NV_texture_shader3 1
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#define GL_NV_vertex_program1_1 1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#define GL_EXT_shadow_funcs 1
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_ATI_text_fragment_shader 1
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_APPLE_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_APPLE_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
+typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
+typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_APPLE_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_APPLE_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_S3_s3tc 1
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_ATI_pixel_format_float 1
+/* This is really a WGL extension, but defines some associated GL enums.
+ * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
+ */
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_NV_float_buffer 1
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_NV_half_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y);
+GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s);
+GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t);
+GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s);
+GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t);
+GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v);
+GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog);
+GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog);
+GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v);
+GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight);
+GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight);
+GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x);
+GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y);
+GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
+typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
+typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_NV_pixel_data_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const GLvoid *pointer);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_NV_primitive_restart 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPrimitiveRestartNV (void);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_NV_texture_expand_normal 1
+#endif
+
+#ifndef GL_NV_vertex_program2
+#define GL_NV_vertex_program2 1
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#define GL_ATI_map_object_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_ATI_separate_stencil 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#define GL_ATI_vertex_attrib_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_EXT_depth_bounds_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_EXT_texture_mirror_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+#endif
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#define GL_GREMEDY_string_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
+#endif
+
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_EXT_packed_depth_stencil 1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_EXT_stencil_clear_tag 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_EXT_texture_sRGB 1
+#endif
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_EXT_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_EXT_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_MESAX_texture_stack 1
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_EXT_timer_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#define GL_EXT_gpu_program_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+#endif
+
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_APPLE_flush_buffer_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
+#endif
+
+#ifndef GL_NV_gpu_program4
+#define GL_NV_gpu_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+#endif
+
+#ifndef GL_NV_geometry_program4
+#define GL_NV_geometry_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);
+GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif
+
+#ifndef GL_EXT_geometry_shader4
+#define GL_EXT_geometry_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+#endif
+
+#ifndef GL_NV_vertex_program4
+#define GL_NV_vertex_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x);
+GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x);
+GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_EXT_gpu_shader4
+#define GL_EXT_gpu_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
+GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+#endif
+
+#ifndef GL_EXT_draw_instanced
+#define GL_EXT_draw_instanced 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_packed_float
+#define GL_EXT_packed_float 1
+#endif
+
+#ifndef GL_EXT_texture_array
+#define GL_EXT_texture_array 1
+#endif
+
+#ifndef GL_EXT_texture_buffer_object
+#define GL_EXT_texture_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+#endif
+
+#ifndef GL_EXT_texture_compression_latc
+#define GL_EXT_texture_compression_latc 1
+#endif
+
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_EXT_texture_compression_rgtc 1
+#endif
+
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_EXT_texture_shared_exponent 1
+#endif
+
+#ifndef GL_NV_depth_buffer_float
+#define GL_NV_depth_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
+GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
+#endif
+
+#ifndef GL_NV_fragment_program4
+#define GL_NV_fragment_program4 1
+#endif
+
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_NV_framebuffer_multisample_coverage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef GL_NV_geometry_shader4
+#define GL_NV_geometry_shader4 1
+#endif
+
+#ifndef GL_NV_parameter_buffer_object
+#define GL_NV_parameter_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
+#endif
+
+#ifndef GL_EXT_draw_buffers2
+#define GL_EXT_draw_buffers2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index);
+GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
+#endif
+
+#ifndef GL_NV_transform_feedback
+#define GL_NV_transform_feedback 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedbackNV (void);
+GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode);
+GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name);
+GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location);
+GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
+#endif
+
+#ifndef GL_EXT_bindable_uniform
+#define GL_EXT_bindable_uniform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer);
+GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location);
+GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
+typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
+#endif
+
+#ifndef GL_EXT_texture_integer
+#define GL_EXT_texture_integer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha);
+GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
+typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+#endif
+
+#ifndef GL_GREMEDY_frame_terminator
+#define GL_GREMEDY_frame_terminator 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameTerminatorGREMEDY (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void);
+#endif
+
+#ifndef GL_NV_conditional_render
+#define GL_NV_conditional_render 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode);
+GLAPI void APIENTRY glEndConditionalRenderNV (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
+typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
+#endif
+
+#ifndef GL_NV_present_video
+#define GL_NV_present_video 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
+GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
+GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
+typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
+typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params);
+#endif
+
+#ifndef GL_EXT_transform_feedback
+#define GL_EXT_transform_feedback 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedbackEXT (void);
+GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+#endif
+
+#ifndef GL_EXT_direct_state_access
+#define GL_EXT_direct_state_access 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask);
+GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask);
+GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glMatrixPopEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixPushEXT (GLenum mode);
+GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);
+GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);
+GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
+GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture);
+GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index);
+GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
+GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
+GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
+GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param);
+GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data);
+GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data);
+GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data);
+GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img);
+GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
+GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string);
+GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);
+GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);
+GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);
+GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access);
+GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer);
+GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length);
+GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params);
+GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
+GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params);
+GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target);
+GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target);
+GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target);
+GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode);
+GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode);
+GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params);
+GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
+GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x);
+GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
+typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
+typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
+typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data);
+typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
+typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params);
+typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);
+typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
+typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
+#endif
+
+#ifndef GL_EXT_vertex_array_bgra
+#define GL_EXT_vertex_array_bgra 1
+#endif
+
+#ifndef GL_EXT_texture_swizzle
+#define GL_EXT_texture_swizzle 1
+#endif
+
+#ifndef GL_NV_explicit_multisample
+#define GL_NV_explicit_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val);
+GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask);
+GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val);
+typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
+typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);
+#endif
+
+#ifndef GL_NV_transform_feedback2
+#define GL_NV_transform_feedback2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id);
+GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids);
+GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids);
+GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id);
+GLAPI void APIENTRY glPauseTransformFeedbackNV (void);
+GLAPI void APIENTRY glResumeTransformFeedbackNV (void);
+GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids);
+typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);
+#endif
+
+#ifndef GL_ATI_meminfo
+#define GL_ATI_meminfo 1
+#endif
+
+#ifndef GL_AMD_performance_monitor
+#define GL_AMD_performance_monitor 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
+GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor);
+GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif
+
+#ifndef GL_AMD_texture_texture4
+#define GL_AMD_texture_texture4 1
+#endif
+
+#ifndef GL_AMD_vertex_shader_tesselator
+#define GL_AMD_vertex_shader_tesselator 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor);
+GLAPI void APIENTRY glTessellationModeAMD (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_provoking_vertex
+#define GL_EXT_provoking_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_texture_snorm
+#define GL_EXT_texture_snorm 1
+#endif
+
+#ifndef GL_AMD_draw_buffers_blend
+#define GL_AMD_draw_buffers_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst);
+GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode);
+GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_APPLE_texture_range
+#define GL_APPLE_texture_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer);
+GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_APPLE_float_pixels
+#define GL_APPLE_float_pixels 1
+#endif
+
+#ifndef GL_APPLE_vertex_program_evaluators
+#define GL_APPLE_vertex_program_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname);
+GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname);
+GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname);
+GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+#endif
+
+#ifndef GL_APPLE_aux_depth_stencil
+#define GL_APPLE_aux_depth_stencil 1
+#endif
+
+#ifndef GL_APPLE_object_purgeable
+#define GL_APPLE_object_purgeable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
+GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option);
+GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
+typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_APPLE_row_bytes
+#define GL_APPLE_row_bytes 1
+#endif
+
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#endif
+
+#ifndef GL_NV_video_capture
+#define GL_NV_video_capture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot);
+GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
+GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
+GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot);
+GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
+GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
+GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
+typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
+typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params);
+typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
+#endif
+
+#ifndef GL_NV_copy_image
+#define GL_NV_copy_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyImageSubDataNV (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 width, GLsizei height, GLsizei depth);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (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 width, GLsizei height, GLsizei depth);
+#endif
+
+#ifndef GL_EXT_separate_shader_objects
+#define GL_EXT_separate_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program);
+GLAPI void APIENTRY glActiveProgramEXT (GLuint program);
+GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
+typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
+#endif
+
+#ifndef GL_NV_parameter_buffer_object2
+#define GL_NV_parameter_buffer_object2 1
+#endif
+
+#ifndef GL_NV_shader_buffer_load
+#define GL_NV_shader_buffer_load 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access);
+GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target);
+GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target);
+GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access);
+GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer);
+GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer);
+GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result);
+GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value);
+GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);
+GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value);
+GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
+typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
+typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);
+typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
+typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
+typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif
+
+#ifndef GL_NV_vertex_buffer_unified_memory
+#define GL_NV_vertex_buffer_unified_memory 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
+GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride);
+GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
+GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
+GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
+typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
+typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result);
+#endif
+
+#ifndef GL_NV_texture_barrier
+#define GL_NV_texture_barrier 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureBarrierNV (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void);
+#endif
+
+#ifndef GL_AMD_shader_stencil_export
+#define GL_AMD_shader_stencil_export 1
+#endif
+
+#ifndef GL_AMD_seamless_cubemap_per_texture
+#define GL_AMD_seamless_cubemap_per_texture 1
+#endif
+
+#ifndef GL_AMD_conservative_depth
+#define GL_AMD_conservative_depth 1
+#endif
+
+#ifndef GL_EXT_shader_image_load_store
+#define GL_EXT_shader_image_load_store 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
+GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
+typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);
+#endif
+
+#ifndef GL_EXT_vertex_attrib_64bit
+#define GL_EXT_vertex_attrib_64bit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x);
+GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+#endif
+
+#ifndef GL_NV_gpu_program5
+#define GL_NV_gpu_program5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param);
+#endif
+
+#ifndef GL_NV_gpu_shader5
+#define GL_NV_gpu_shader5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
+GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
+GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
+GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
+GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
+GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
+typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
+#endif
+
+#ifndef GL_NV_shader_buffer_store
+#define GL_NV_shader_buffer_store 1
+#endif
+
+#ifndef GL_NV_tessellation_program5
+#define GL_NV_tessellation_program5 1
+#endif
+
+#ifndef GL_NV_vertex_attrib_integer_64bit
+#define GL_NV_vertex_attrib_integer_64bit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x);
+GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y);
+GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x);
+GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y);
+GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v);
+GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params);
+GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params);
+GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
+#endif
+
+#ifndef GL_NV_multisample_coverage
+#define GL_NV_multisample_coverage 1
+#endif
+
+#ifndef GL_AMD_name_gen_delete
+#define GL_AMD_name_gen_delete 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names);
+GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names);
+GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names);
+typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names);
+typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);
+#endif
+
+#ifndef GL_AMD_debug_output
+#define GL_AMD_debug_output 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
+GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam);
+GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
+typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam);
+typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
+#endif
+
+#ifndef GL_NV_vdpau_interop
+#define GL_NV_vdpau_interop 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
+GLAPI void APIENTRY glVDPAUFiniNV (void);
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
+GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);
+GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);
+GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
+GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress);
+typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void);
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
+typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
+typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
+typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
+typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
+typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
+#endif
+
+#ifndef GL_AMD_transform_feedback3_lines_triangles
+#define GL_AMD_transform_feedback3_lines_triangles 1
+#endif
+
+#ifndef GL_AMD_depth_clamp_separate
+#define GL_AMD_depth_clamp_separate 1
+#endif
+
+#ifndef GL_EXT_texture_sRGB_decode
+#define GL_EXT_texture_sRGB_decode 1
+#endif
+
+#ifndef GL_NV_texture_multisample
+#define GL_NV_texture_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
+#endif
+
+#ifndef GL_AMD_blend_minmax_factor
+#define GL_AMD_blend_minmax_factor 1
+#endif
+
+#ifndef GL_AMD_sample_positions
+#define GL_AMD_sample_positions 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
+#endif
+
+#ifndef GL_EXT_x11_sync_object
+#define GL_EXT_x11_sync_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
+#endif
+
+#ifndef GL_AMD_multi_draw_indirect
+#define GL_AMD_multi_draw_indirect 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample_blit_scaled
+#define GL_EXT_framebuffer_multisample_blit_scaled 1
+#endif
+
+#ifndef GL_NV_path_rendering
+#define GL_NV_path_rendering 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range);
+GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
+GLAPI GLboolean APIENTRY glIsPathNV (GLuint path);
+GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords);
+GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords);
+GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords);
+GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords);
+GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString);
+GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
+GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath);
+GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
+GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value);
+GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value);
+GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value);
+GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value);
+GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
+GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask);
+GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units);
+GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask);
+GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask);
+GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func);
+GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);
+GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);
+GLAPI void APIENTRY glPathFogGenNV (GLenum genMode);
+GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode);
+GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode);
+GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value);
+GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value);
+GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands);
+GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords);
+GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray);
+GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
+GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
+GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
+GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value);
+GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value);
+GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value);
+GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value);
+GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y);
+GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y);
+GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments);
+GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path);
+typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords);
+typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords);
+typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords);
+typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords);
+typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString);
+typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath);
+typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
+typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value);
+typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value);
+typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value);
+typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray);
+typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units);
+typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func);
+typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);
+typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);
+typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode);
+typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode);
+typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode);
+typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
+typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value);
+typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value);
+typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands);
+typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords);
+typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray);
+typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
+typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics);
+typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
+typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value);
+typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value);
+typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value);
+typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value);
+typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y);
+typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);
+typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);
+typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
+#endif
+
+#ifndef GL_AMD_pinned_memory
+#define GL_AMD_pinned_memory 1
+#endif
+
+#ifndef GL_AMD_stencil_operation_extended
+#define GL_AMD_stencil_operation_extended 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value);
+#endif
+
+#ifndef GL_AMD_vertex_shader_viewport_index
+#define GL_AMD_vertex_shader_viewport_index 1
+#endif
+
+#ifndef GL_AMD_vertex_shader_layer
+#define GL_AMD_vertex_shader_layer 1
+#endif
+
+#ifndef GL_NV_bindless_texture
+#define GL_NV_bindless_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture);
+GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler);
+GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle);
+GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle);
+GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access);
+GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle);
+GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value);
+GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value);
+GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value);
+GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle);
+GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture);
+typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler);
+typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
+typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle);
+typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access);
+typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle);
+typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value);
+typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value);
+typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
+typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle);
+#endif
+
+#ifndef GL_NV_shader_atomic_float
+#define GL_NV_shader_atomic_float 1
+#endif
+
+#ifndef GL_AMD_query_buffer_object
+#define GL_AMD_query_buffer_object 1
+#endif
+
+#ifndef GL_AMD_sparse_texture
+#define GL_AMD_sparse_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
+GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gfxstream/host/apigen-codec-common/GL/glx.h b/src/gfxstream/host/apigen-codec-common/GL/glx.h
new file mode 100644
index 00000000000..acbd9e2c9dd
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/GL/glx.h
@@ -0,0 +1,513 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul 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 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
+ * BRIAN PAUL 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 GLX_H
+#define GLX_H
+
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <GL/gl.h>
+
+
+#if defined(USE_MGL_NAMESPACE)
+#include "glx_mangle.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define GLX_VERSION_1_1 1
+#define GLX_VERSION_1_2 1
+#define GLX_VERSION_1_3 1
+#define GLX_VERSION_1_4 1
+
+#define GLX_EXTENSION_NAME "GLX"
+
+
+
+/*
+ * Tokens for glXChooseVisual and glXGetConfig:
+ */
+#define GLX_USE_GL 1
+#define GLX_BUFFER_SIZE 2
+#define GLX_LEVEL 3
+#define GLX_RGBA 4
+#define GLX_DOUBLEBUFFER 5
+#define GLX_STEREO 6
+#define GLX_AUX_BUFFERS 7
+#define GLX_RED_SIZE 8
+#define GLX_GREEN_SIZE 9
+#define GLX_BLUE_SIZE 10
+#define GLX_ALPHA_SIZE 11
+#define GLX_DEPTH_SIZE 12
+#define GLX_STENCIL_SIZE 13
+#define GLX_ACCUM_RED_SIZE 14
+#define GLX_ACCUM_GREEN_SIZE 15
+#define GLX_ACCUM_BLUE_SIZE 16
+#define GLX_ACCUM_ALPHA_SIZE 17
+
+
+/*
+ * Error codes returned by glXGetConfig:
+ */
+#define GLX_BAD_SCREEN 1
+#define GLX_BAD_ATTRIBUTE 2
+#define GLX_NO_EXTENSION 3
+#define GLX_BAD_VISUAL 4
+#define GLX_BAD_CONTEXT 5
+#define GLX_BAD_VALUE 6
+#define GLX_BAD_ENUM 7
+
+
+/*
+ * GLX 1.1 and later:
+ */
+#define GLX_VENDOR 1
+#define GLX_VERSION 2
+#define GLX_EXTENSIONS 3
+
+
+/*
+ * GLX 1.3 and later:
+ */
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_VISUAL_ID 0x800B
+#define GLX_SCREEN 0x800C
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+
+
+/*
+ * GLX 1.4 and later:
+ */
+#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
+#define GLX_SAMPLES 0x186a1 /*100001*/
+
+
+
+typedef struct __GLXcontextRec *GLXContext;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+/* GLX 1.3 and later */
+typedef struct __GLXFBConfigRec *GLXFBConfig;
+typedef XID GLXFBConfigID;
+typedef XID GLXContextID;
+typedef XID GLXWindow;
+typedef XID GLXPbuffer;
+
+
+/*
+** Events.
+** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
+** event - this helps initialization if the server supports the pbuffer
+** extension and the client doesn't.
+*/
+#define GLX_PbufferClobber 0
+#define GLX_BufferSwapComplete 1
+
+#define __GLX_NUMBER_EVENTS 17
+
+extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
+ int *attribList );
+
+extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
+ GLXContext shareList, Bool direct );
+
+extern void glXDestroyContext( Display *dpy, GLXContext ctx );
+
+extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
+ GLXContext ctx);
+
+extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
+ unsigned long mask );
+
+extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
+
+extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
+ Pixmap pixmap );
+
+extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
+
+extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
+
+extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
+
+extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
+ int attrib, int *value );
+
+extern GLXContext glXGetCurrentContext( void );
+
+extern GLXDrawable glXGetCurrentDrawable( void );
+
+extern void glXWaitGL( void );
+
+extern void glXWaitX( void );
+
+extern void glXUseXFont( Font font, int first, int count, int list );
+
+
+
+/* GLX 1.1 and later */
+extern const char *glXQueryExtensionsString( Display *dpy, int screen );
+
+extern const char *glXQueryServerString( Display *dpy, int screen, int name );
+
+extern const char *glXGetClientString( Display *dpy, int name );
+
+
+/* GLX 1.2 and later */
+extern Display *glXGetCurrentDisplay( void );
+
+
+/* GLX 1.3 and later */
+extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
+ const int *attribList, int *nitems );
+
+extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
+ int attribute, int *value );
+
+extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
+ int *nelements );
+
+extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
+ GLXFBConfig config );
+
+extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
+ Window win, const int *attribList );
+
+extern void glXDestroyWindow( Display *dpy, GLXWindow window );
+
+extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
+ Pixmap pixmap, const int *attribList );
+
+extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
+ const int *attribList );
+
+extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
+
+extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
+ unsigned int *value );
+
+extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
+ int renderType, GLXContext shareList,
+ Bool direct );
+
+extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
+ GLXDrawable read, GLXContext ctx );
+
+extern GLXDrawable glXGetCurrentReadDrawable( void );
+
+extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
+ int *value );
+
+extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long mask );
+
+extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long *mask );
+
+/* GLX 1.3 function pointer typedefs */
+typedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
+typedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void);
+typedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+
+
+/*
+ * ARB 2. GLX_ARB_get_proc_address
+ */
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+
+typedef void (*__GLXextFuncPtr)(void);
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+
+#endif /* GLX_ARB_get_proc_address */
+
+
+
+/* GLX 1.4 and later */
+extern void (*glXGetProcAddress(const GLubyte *procname))( void );
+
+/* GLX 1.4 function pointer typedefs */
+typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
+
+
+#ifndef GLX_GLXEXT_LEGACY
+
+#include <GL/glxext.h>
+
+#endif /* GLX_GLXEXT_LEGACY */
+
+
+/**
+ ** The following aren't in glxext.h yet.
+ **/
+
+
+/*
+ * ???. GLX_NV_vertex_array_range
+ */
+#ifndef GLX_NV_vertex_array_range
+#define GLX_NV_vertex_array_range
+
+extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+extern void glXFreeMemoryNV(GLvoid *pointer);
+typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
+
+#endif /* GLX_NV_vertex_array_range */
+
+
+/*
+ * ARB ?. GLX_ARB_render_texture
+ * XXX This was never finalized!
+ */
+#ifndef GLX_ARB_render_texture
+#define GLX_ARB_render_texture 1
+
+extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
+extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
+extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
+
+#endif /* GLX_ARB_render_texture */
+
+
+/*
+ * Remove this when glxext.h is updated.
+ */
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+
+#endif /* GLX_NV_float_buffer */
+
+
+
+/*
+ * #?. GLX_MESA_swap_frame_usage
+ */
+#ifndef GLX_MESA_swap_frame_usage
+#define GLX_MESA_swap_frame_usage 1
+
+extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
+extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
+extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
+typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
+typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
+
+#endif /* GLX_MESA_swap_frame_usage */
+
+
+
+/*
+ * #?. GLX_MESA_swap_control
+ */
+#ifndef GLX_MESA_swap_control
+#define GLX_MESA_swap_control 1
+
+extern int glXSwapIntervalMESA(unsigned int interval);
+extern int glXGetSwapIntervalMESA(void);
+
+typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
+typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
+
+#endif /* GLX_MESA_swap_control */
+
+
+
+/*
+ * #?. GLX_EXT_texture_from_pixmap
+ * XXX not finished?
+ */
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+
+extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
+
+#endif /* GLX_EXT_texture_from_pixmap */
+
+
+
+
+/*** Should these go here, or in another header? */
+/*
+** GLX Events
+*/
+typedef struct {
+ int event_type; /* GLX_DAMAGED or GLX_SAVED */
+ int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* XID of Drawable */
+ unsigned int buffer_mask; /* mask indicating which buffers are affected */
+ unsigned int aux_buffer; /* which aux buffer was affected */
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXPbufferClobberEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ GLXDrawable drawable; /* drawable on which event was requested in event mask */
+ int event_type;
+ int64_t ust;
+ int64_t msc;
+ int64_t sbc;
+} GLXBufferSwapComplete;
+
+typedef union __GLXEvent {
+ GLXPbufferClobberEvent glxpbufferclobber;
+ GLXBufferSwapComplete glxbufferswapcomplete;
+ long pad[24];
+} GLXEvent;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gfxstream/host/apigen-codec-common/GL/glx_mangle.h b/src/gfxstream/host/apigen-codec-common/GL/glx_mangle.h
new file mode 100644
index 00000000000..fa664a7f59e
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/GL/glx_mangle.h
@@ -0,0 +1,82 @@
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul 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 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
+ * BRIAN PAUL 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 GLX_MANGLE_H
+#define GLX_MANGLE_H
+
+#define glXChooseVisual mglXChooseVisual
+#define glXCreateContext mglXCreateContext
+#define glXDestroyContext mglXDestroyContext
+#define glXMakeCurrent mglXMakeCurrent
+#define glXCopyContext mglXCopyContext
+#define glXSwapBuffers mglXSwapBuffers
+#define glXCreateGLXPixmap mglXCreateGLXPixmap
+#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
+#define glXQueryExtension mglXQueryExtension
+#define glXQueryVersion mglXQueryVersion
+#define glXIsDirect mglXIsDirect
+#define glXGetConfig mglXGetConfig
+#define glXGetCurrentContext mglXGetCurrentContext
+#define glXGetCurrentDrawable mglXGetCurrentDrawable
+#define glXWaitGL mglXWaitGL
+#define glXWaitX mglXWaitX
+#define glXUseXFont mglXUseXFont
+#define glXQueryExtensionsString mglXQueryExtensionsString
+#define glXQueryServerString mglXQueryServerString
+#define glXGetClientString mglXGetClientString
+#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
+#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
+#define glXCopySubBufferMESA mglXCopySubBufferMESA
+#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
+#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
+
+/* GLX 1.2 */
+#define glXGetCurrentDisplay mglXGetCurrentDisplay
+
+/* GLX 1.3 */
+#define glXChooseFBConfig mglXChooseFBConfig
+#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
+#define glXGetFBConfigs mglXGetFBConfigs
+#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
+#define glXCreateWindow mglXCreateWindow
+#define glXDestroyWindow mglXDestroyWindow
+#define glXCreatePixmap mglXCreatePixmap
+#define glXDestroyPixmap mglXDestroyPixmap
+#define glXCreatePbuffer mglXCreatePbuffer
+#define glXDestroyPbuffer mglXDestroyPbuffer
+#define glXQueryDrawable mglXQueryDrawable
+#define glXCreateNewContext mglXCreateNewContext
+#define glXMakeContextCurrent mglXMakeContextCurrent
+#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
+#define glXQueryContext mglXQueryContext
+#define glXSelectEvent mglXSelectEvent
+#define glXGetSelectedEvent mglXGetSelectedEvent
+
+/* GLX 1.4 */
+#define glXGetProcAddress mglXGetProcAddress
+#define glXGetProcAddressARB mglXGetProcAddressARB
+
+
+#endif
diff --git a/src/gfxstream/host/apigen-codec-common/GL/glxext.h b/src/gfxstream/host/apigen-codec-common/GL/glxext.h
new file mode 100644
index 00000000000..e640ff7e397
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/GL/glxext.h
@@ -0,0 +1,1001 @@
+#ifndef __glxext_h_
+#define __glxext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2012 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.
+*/
+
+/* Function declaration macros - to move into glplatform.h */
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glxext.h last updated 2012/02/29 */
+/* Current version at http://www.opengl.org/registry/ */
+#define GLX_GLXEXT_VERSION 33
+
+#ifndef GLX_VERSION_1_3
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_NONE 0x8000
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_VISUAL_ID 0x800B
+#define GLX_SCREEN 0x800C
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_SAMPLE_BUFFERS 100000
+#define GLX_SAMPLES 100001
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_SAMPLE_BUFFERS_ARB 100000
+#define GLX_SAMPLES_ARB 100001
+#endif
+
+#ifndef GLX_ARB_vertex_buffer_object
+#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
+#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
+#endif
+
+#ifndef GLX_ARB_framebuffer_sRGB
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
+#endif
+
+#ifndef GLX_ARB_create_context
+#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
+#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
+#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define GLX_CONTEXT_FLAGS_ARB 0x2094
+#endif
+
+#ifndef GLX_ARB_create_context_profile
+#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
+#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
+#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
+#endif
+
+#ifndef GLX_ARB_create_context_robustness
+#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
+#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
+#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SAMPLE_BUFFERS_SGIS 100000
+#define GLX_SAMPLES_SGIS 100001
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_X_VISUAL_TYPE_EXT 0x22
+#define GLX_TRANSPARENT_TYPE_EXT 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
+#define GLX_NONE_EXT 0x8000
+#define GLX_TRUE_COLOR_EXT 0x8002
+#define GLX_DIRECT_COLOR_EXT 0x8003
+#define GLX_PSEUDO_COLOR_EXT 0x8004
+#define GLX_STATIC_COLOR_EXT 0x8005
+#define GLX_GRAY_SCALE_EXT 0x8006
+#define GLX_STATIC_GRAY_EXT 0x8007
+#define GLX_TRANSPARENT_RGB_EXT 0x8008
+#define GLX_TRANSPARENT_INDEX_EXT 0x8009
+#endif
+
+#ifndef GLX_SGI_swap_control
+#endif
+
+#ifndef GLX_SGI_video_sync
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#endif
+
+#ifndef GLX_SGIX_video_source
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_VISUAL_CAVEAT_EXT 0x20
+#define GLX_SLOW_VISUAL_EXT 0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
+/* reuse GLX_NONE_EXT */
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_SHARE_CONTEXT_EXT 0x800A
+#define GLX_VISUAL_ID_EXT 0x800B
+#define GLX_SCREEN_EXT 0x800C
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_WINDOW_BIT_SGIX 0x00000001
+#define GLX_PIXMAP_BIT_SGIX 0x00000002
+#define GLX_RGBA_BIT_SGIX 0x00000001
+#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
+#define GLX_DRAWABLE_TYPE_SGIX 0x8010
+#define GLX_RENDER_TYPE_SGIX 0x8011
+#define GLX_X_RENDERABLE_SGIX 0x8012
+#define GLX_FBCONFIG_ID_SGIX 0x8013
+#define GLX_RGBA_TYPE_SGIX 0x8014
+#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
+/* reuse GLX_SCREEN_EXT */
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_PBUFFER_BIT_SGIX 0x00000004
+#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
+#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
+#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
+#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
+#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
+#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
+#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
+#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
+#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
+#define GLX_LARGEST_PBUFFER_SGIX 0x801C
+#define GLX_WIDTH_SGIX 0x801D
+#define GLX_HEIGHT_SGIX 0x801E
+#define GLX_EVENT_MASK_SGIX 0x801F
+#define GLX_DAMAGED_SGIX 0x8020
+#define GLX_SAVED_SGIX 0x8021
+#define GLX_WINDOW_SGIX 0x8022
+#define GLX_PBUFFER_SGIX 0x8023
+#endif
+
+#ifndef GLX_SGI_cushion
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SYNC_FRAME_SGIX 0x00000000
+#define GLX_SYNC_SWAP_SGIX 0x00000001
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#endif
+
+#ifndef GLX_SGIS_blended_overlay
+#define GLX_BLENDED_RGBA_SGIS 0x8025
+#endif
+
+#ifndef GLX_SGIS_shared_multisample
+#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
+#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#endif
+
+#ifndef GLX_3DFX_multisample
+#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
+#define GLX_SAMPLES_3DFX 0x8051
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_3DFX_WINDOW_MODE_MESA 0x1
+#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_SWAP_METHOD_OML 0x8060
+#define GLX_SWAP_EXCHANGE_OML 0x8061
+#define GLX_SWAP_COPY_OML 0x8062
+#define GLX_SWAP_UNDEFINED_OML 0x8063
+#endif
+
+#ifndef GLX_OML_sync_control
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
+#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
+#define GLX_BAD_HYPERPIPE_SGIX 92
+#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
+#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
+#define GLX_PIPE_RECT_SGIX 0x00000001
+#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
+#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
+#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
+#define GLX_HYPERPIPE_ID_SGIX 0x8030
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
+#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+#endif
+
+#ifndef GLX_NV_present_video
+#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
+#endif
+
+#ifndef GLX_NV_video_out
+#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
+#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
+#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
+#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
+#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
+#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
+#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
+#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
+#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
+#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
+#endif
+
+#ifndef GLX_NV_swap_group
+#endif
+
+#ifndef GLX_NV_video_capture
+#define GLX_DEVICE_ID_NV 0x20CD
+#define GLX_UNIQUE_ID_NV 0x20CE
+#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
+#endif
+
+#ifndef GLX_EXT_swap_control
+#define GLX_SWAP_INTERVAL_EXT 0x20F1
+#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
+#endif
+
+#ifndef GLX_NV_copy_image
+#endif
+
+#ifndef GLX_INTEL_swap_event
+#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
+#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
+#define GLX_COPY_COMPLETE_INTEL 0x8181
+#define GLX_FLIP_COMPLETE_INTEL 0x8182
+#endif
+
+#ifndef GLX_NV_multisample_coverage
+#define GLX_COVERAGE_SAMPLES_NV 100001
+#define GLX_COLOR_SAMPLES_NV 0x20B3
+#endif
+
+#ifndef GLX_AMD_gpu_association
+#define GLX_GPU_VENDOR_AMD 0x1F00
+#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
+#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
+#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
+#define GLX_GPU_RAM_AMD 0x21A3
+#define GLX_GPU_CLOCK_AMD 0x21A4
+#define GLX_GPU_NUM_PIPES_AMD 0x21A5
+#define GLX_GPU_NUM_SIMD_AMD 0x21A6
+#define GLX_GPU_NUM_RB_AMD 0x21A7
+#define GLX_GPU_NUM_SPI_AMD 0x21A8
+#endif
+
+#ifndef GLX_EXT_create_context_es2_profile
+#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
+#endif
+
+#ifndef GLX_EXT_swap_control_tear
+#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
+#endif
+
+
+/*************************************************************/
+
+#ifndef GLX_ARB_get_proc_address
+typedef void (*__GLXextFuncPtr)(void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+typedef XID GLXVideoSourceSGIX;
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+typedef XID GLXFBConfigIDSGIX;
+typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+typedef XID GLXPbufferSGIX;
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* i.d. of Drawable */
+ int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
+ int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
+ unsigned int mask; /* mask indicating which buffers are affected*/
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXBufferClobberEventSGIX;
+#endif
+
+#ifndef GLX_NV_video_output
+typedef unsigned int GLXVideoDeviceNV;
+#endif
+
+#ifndef GLX_NV_video_capture
+typedef XID GLXVideoCaptureDeviceNV;
+#endif
+
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GLX_OML_sync_control extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+#elif defined(__sun__) || defined(__digital__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__) || defined(_LP64)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS ) || defined(__sgi)
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(_WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <inttypes.h> /* Fallback option */
+#endif
+#endif
+
+#ifndef GLX_VERSION_1_3
+#define GLX_VERSION_1_3 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXFBConfig * glXGetFBConfigs (Display *dpy, int screen, int *nelements);
+extern GLXFBConfig * glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements);
+extern int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value);
+extern XVisualInfo * glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config);
+extern GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+extern void glXDestroyWindow (Display *dpy, GLXWindow win);
+extern GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+extern void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap);
+extern GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list);
+extern void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf);
+extern void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+extern GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+extern Bool glXMakeContextCurrent (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+extern GLXDrawable glXGetCurrentReadDrawable (void);
+extern Display * glXGetCurrentDisplay (void);
+extern int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value);
+extern void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+extern void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
+typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
+typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
+typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
+typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
+typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
+typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
+typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
+#endif
+
+#ifndef GLX_VERSION_1_4
+#define GLX_VERSION_1_4 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_ARB_multisample 1
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_ARB_fbconfig_float 1
+#endif
+
+#ifndef GLX_ARB_framebuffer_sRGB
+#define GLX_ARB_framebuffer_sRGB 1
+#endif
+
+#ifndef GLX_ARB_create_context
+#define GLX_ARB_create_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
+#endif
+
+#ifndef GLX_ARB_create_context_profile
+#define GLX_ARB_create_context_profile 1
+#endif
+
+#ifndef GLX_ARB_create_context_robustness
+#define GLX_ARB_create_context_robustness 1
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SGIS_multisample 1
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_EXT_visual_info 1
+#endif
+
+#ifndef GLX_SGI_swap_control
+#define GLX_SGI_swap_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXSwapIntervalSGI (int interval);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
+#endif
+
+#ifndef GLX_SGI_video_sync
+#define GLX_SGI_video_sync 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoSyncSGI (unsigned int *count);
+extern int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
+typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#define GLX_SGI_make_current_read 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXMakeCurrentReadSGI (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+#define GLX_SGIX_video_source 1
+#ifdef _VL_H
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
+extern void glXDestroyGLXVideoSourceSGIX (Display *dpy, GLXVideoSourceSGIX glxvideosource);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
+typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
+#endif /* _VL_H */
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_EXT_visual_rating 1
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_EXT_import_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Display * glXGetCurrentDisplayEXT (void);
+extern int glXQueryContextInfoEXT (Display *dpy, GLXContext context, int attribute, int *value);
+extern GLXContextID glXGetContextIDEXT (const GLXContext context);
+extern GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID);
+extern void glXFreeContextEXT (Display *dpy, GLXContext context);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
+typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
+typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
+typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_SGIX_fbconfig 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetFBConfigAttribSGIX (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *dpy, int screen, int *attrib_list, int *nelements);
+extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
+extern GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfigSGIX config);
+extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *vis);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
+typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
+typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_SGIX_pbuffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+extern void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf);
+extern int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+extern void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask);
+extern void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
+typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
+#endif
+
+#ifndef GLX_SGI_cushion
+#define GLX_SGI_cushion 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCushionSGI (Display *dpy, Window window, float cushion);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SGIX_video_resize 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXBindChannelToWindowSGIX (Display *display, int screen, int channel, Window window);
+extern int glXChannelRectSGIX (Display *display, int screen, int channel, int x, int y, int w, int h);
+extern int glXQueryChannelRectSGIX (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
+extern int glXQueryChannelDeltasSGIX (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
+extern int glXChannelRectSyncSGIX (Display *display, int screen, int channel, GLenum synctype);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
+typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
+typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
+typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
+typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_SGIX_dmbuffer 1
+#ifdef _DM_BUFFER_H_
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXAssociateDMPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
+#endif /* _DM_BUFFER_H_ */
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#define GLX_SGIX_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#define GLX_SGIX_swap_barrier 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier);
+extern Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
+typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#define GLX_SUN_get_transparent_index 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#define GLX_MESA_copy_sub_buffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCopySubBufferMESA (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#define GLX_MESA_pixmap_colormap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#define GLX_MESA_release_buffers 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_MESA_set_3dfx_mode 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXSet3DfxModeMESA (int mode);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_SGIX_visual_select_group 1
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_OML_swap_method 1
+#endif
+
+#ifndef GLX_OML_sync_control
+#define GLX_OML_sync_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXGetSyncValuesOML (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
+extern Bool glXGetMscRateOML (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
+extern int64_t glXSwapBuffersMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
+extern Bool glXWaitForMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
+extern Bool glXWaitForSbcOML (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
+typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
+typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_SGIX_hyperpipe 1
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int networkId;
+} GLXHyperpipeNetworkSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int channel;
+ unsigned int
+ participationType;
+ int timeSlice;
+} GLXHyperpipeConfigSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
+ int destXOrigin, destYOrigin, destWidth, destHeight;
+} GLXPipeRect;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int XOrigin, YOrigin, maxHeight, maxWidth;
+} GLXPipeRectLimits;
+
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes);
+extern int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes);
+extern int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId);
+extern int glXBindHyperpipeSGIX (Display *dpy, int hpId);
+extern int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+extern int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+extern int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
+typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
+typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#define GLX_MESA_agp_offset 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int glXGetAGPOffsetMESA (const void *pointer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_EXT_fbconfig_packed_float 1
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+extern void glXReleaseTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
+#endif
+
+#ifndef GLX_NV_present_video
+#define GLX_NV_present_video 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int * glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements);
+extern int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef unsigned int * ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
+typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
+#endif
+
+#ifndef GLX_NV_video_output
+#define GLX_NV_video_output 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoDeviceNV (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
+extern int glXReleaseVideoDeviceNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
+extern int glXBindVideoImageNV (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
+extern int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);
+extern int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
+extern int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
+typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
+typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
+typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf);
+typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
+typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#endif
+
+#ifndef GLX_NV_swap_group
+#define GLX_NV_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXJoinSwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint group);
+extern Bool glXBindSwapBarrierNV (Display *dpy, GLuint group, GLuint barrier);
+extern Bool glXQuerySwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
+extern Bool glXQueryMaxSwapGroupsNV (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
+extern Bool glXQueryFrameCountNV (Display *dpy, int screen, GLuint *count);
+extern Bool glXResetFrameCountNV (Display *dpy, int screen);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);
+typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);
+typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
+typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
+typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count);
+typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
+#endif
+
+#ifndef GLX_NV_video_capture
+#define GLX_NV_video_capture 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXBindVideoCaptureDeviceNV (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
+extern GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display *dpy, int screen, int *nelements);
+extern void glXLockVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
+extern int glXQueryVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
+extern void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
+typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements);
+typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
+typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
+typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
+#endif
+
+#ifndef GLX_EXT_swap_control
+#define GLX_EXT_swap_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
+#endif
+
+#ifndef GLX_NV_copy_image
+#define GLX_NV_copy_image 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
+#ifndef GLX_INTEL_swap_event
+#define GLX_INTEL_swap_event 1
+#endif
+
+#ifndef GLX_NV_multisample_coverage
+#define GLX_NV_multisample_coverage 1
+#endif
+
+#ifndef GLX_EXT_swap_control_tear
+#define GLX_EXT_swap_control_tear 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gfxstream/host/apigen-codec-common/GL/internal/dri_interface.h b/src/gfxstream/host/apigen-codec-common/GL/internal/dri_interface.h
new file mode 100644
index 00000000000..c236cb732fd
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/GL/internal/dri_interface.h
@@ -0,0 +1,1144 @@
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2007-2008 Red Hat, Inc.
+ * (C) Copyright IBM Corporation 2004
+ * 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
+ * on 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
+ * THE COPYRIGHT HOLDERS AND/OR THEIR 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.
+ */
+
+/**
+ * \file dri_interface.h
+ *
+ * This file contains all the types and functions that define the interface
+ * between a DRI driver and driver loader. Currently, the most common driver
+ * loader is the XFree86 libGL.so. However, other loaders do exist, and in
+ * the future the server-side libglx.a will also be a loader.
+ *
+ * \author Kevin E. Martin <kevin@precisioninsight.com>
+ * \author Ian Romanick <idr@us.ibm.com>
+ * \author Kristian Høgsberg <krh@redhat.com>
+ */
+
+#ifndef DRI_INTERFACE_H
+#define DRI_INTERFACE_H
+
+/* For archs with no drm.h */
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
+#ifndef __NOT_HAVE_DRM_H
+#define __NOT_HAVE_DRM_H
+#endif
+#endif
+
+#ifndef __NOT_HAVE_DRM_H
+#include <drm.h>
+#else
+typedef unsigned int drm_context_t;
+typedef unsigned int drm_drawable_t;
+typedef struct drm_clip_rect drm_clip_rect_t;
+#endif
+
+/**
+ * \name DRI interface structures
+ *
+ * The following structures define the interface between the GLX client
+ * side library and the DRI (direct rendering infrastructure).
+ */
+/*@{*/
+typedef struct __DRIdisplayRec __DRIdisplay;
+typedef struct __DRIscreenRec __DRIscreen;
+typedef struct __DRIcontextRec __DRIcontext;
+typedef struct __DRIdrawableRec __DRIdrawable;
+typedef struct __DRIconfigRec __DRIconfig;
+typedef struct __DRIframebufferRec __DRIframebuffer;
+typedef struct __DRIversionRec __DRIversion;
+
+typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
+typedef struct __DRIextensionRec __DRIextension;
+typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
+typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
+typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
+typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
+typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
+typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;
+typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;
+typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
+typedef struct __DRIbufferRec __DRIbuffer;
+typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
+typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
+typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
+typedef struct __DRI2throttleExtensionRec __DRI2throttleExtension;
+
+/*@}*/
+
+
+/**
+ * Extension struct. Drivers 'inherit' from this struct by embedding
+ * it as the first element in the extension struct.
+ *
+ * We never break API in for a DRI extension. If we need to change
+ * the way things work in a non-backwards compatible manner, we
+ * introduce a new extension. During a transition period, we can
+ * leave both the old and the new extension in the driver, which
+ * allows us to move to the new interface without having to update the
+ * loader(s) in lock step.
+ *
+ * However, we can add entry points to an extension over time as long
+ * as we don't break the old ones. As we add entry points to an
+ * extension, we increase the version number. The corresponding
+ * #define can be used to guard code that accesses the new entry
+ * points at compile time and the version field in the extension
+ * struct can be used at run-time to determine how to use the
+ * extension.
+ */
+struct __DRIextensionRec {
+ const char *name;
+ int version;
+};
+
+/**
+ * The first set of extension are the screen extensions, returned by
+ * __DRIcore::getExtensions(). This entry point will return a list of
+ * extensions and the loader can use the ones it knows about by
+ * casting them to more specific extensions and advertising any GLX
+ * extensions the DRI extensions enables.
+ */
+
+/**
+ * Used by drivers to indicate support for setting the read drawable.
+ */
+#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
+#define __DRI_READ_DRAWABLE_VERSION 1
+
+/**
+ * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
+ */
+#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
+#define __DRI_COPY_SUB_BUFFER_VERSION 1
+struct __DRIcopySubBufferExtensionRec {
+ __DRIextension base;
+ void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
+};
+
+/**
+ * Used by drivers that implement the GLX_SGI_swap_control or
+ * GLX_MESA_swap_control extension.
+ */
+#define __DRI_SWAP_CONTROL "DRI_SwapControl"
+#define __DRI_SWAP_CONTROL_VERSION 1
+struct __DRIswapControlExtensionRec {
+ __DRIextension base;
+ void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
+ unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
+};
+
+/**
+ * Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
+ */
+#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
+#define __DRI_FRAME_TRACKING_VERSION 1
+struct __DRIframeTrackingExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Enable or disable frame usage tracking.
+ *
+ * \since Internal API version 20030317.
+ */
+ int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
+
+ /**
+ * Retrieve frame usage information.
+ *
+ * \since Internal API version 20030317.
+ */
+ int (*queryFrameTracking)(__DRIdrawable *drawable,
+ int64_t * sbc, int64_t * missedFrames,
+ float * lastMissedUsage, float * usage);
+};
+
+
+/**
+ * Used by drivers that implement the GLX_SGI_video_sync extension.
+ */
+#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
+#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
+struct __DRImediaStreamCounterExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Wait for the MSC to equal target_msc, or, if that has already passed,
+ * the next time (MSC % divisor) is equal to remainder. If divisor is
+ * zero, the function will return as soon as MSC is greater than or equal
+ * to target_msc.
+ */
+ int (*waitForMSC)(__DRIdrawable *drawable,
+ int64_t target_msc, int64_t divisor, int64_t remainder,
+ int64_t * msc, int64_t * sbc);
+
+ /**
+ * Get the number of vertical refreshes since some point in time before
+ * this function was first called (i.e., system start up).
+ */
+ int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable,
+ int64_t *msc);
+};
+
+
+#define __DRI_TEX_OFFSET "DRI_TexOffset"
+#define __DRI_TEX_OFFSET_VERSION 1
+struct __DRItexOffsetExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Method to override base texture image with a driver specific 'offset'.
+ * The depth passed in allows e.g. to ignore the alpha channel of texture
+ * images where the non-alpha components don't occupy a whole texel.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
+ unsigned long long offset, GLint depth, GLuint pitch);
+};
+
+
+/* Valid values for format in the setTexBuffer2 function below. These
+ * values match the GLX tokens for compatibility reasons, but we
+ * define them here since the DRI interface can't depend on GLX. */
+#define __DRI_TEXTURE_FORMAT_NONE 0x20D8
+#define __DRI_TEXTURE_FORMAT_RGB 0x20D9
+#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
+
+#define __DRI_TEX_BUFFER "DRI_TexBuffer"
+#define __DRI_TEX_BUFFER_VERSION 2
+struct __DRItexBufferExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Method to override base texture image with the contents of a
+ * __DRIdrawable.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
+ * setTexBuffer2 in version 2 of this interface
+ */
+ void (*setTexBuffer)(__DRIcontext *pDRICtx,
+ GLint target,
+ __DRIdrawable *pDraw);
+
+ /**
+ * Method to override base texture image with the contents of a
+ * __DRIdrawable, including the required texture format attribute.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*setTexBuffer2)(__DRIcontext *pDRICtx,
+ GLint target,
+ GLint format,
+ __DRIdrawable *pDraw);
+ /**
+ * Method to release texture buffer in case some special platform
+ * need this.
+ *
+ * For GLX_EXT_texture_from_pixmap with AIGLX.
+ */
+ void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
+ GLint target,
+ __DRIdrawable *pDraw);
+};
+
+/**
+ * Used by drivers that implement DRI2
+ */
+#define __DRI2_FLUSH "DRI2_Flush"
+#define __DRI2_FLUSH_VERSION 4
+
+#define __DRI2_FLUSH_DRAWABLE (1 << 0) /* the drawable should be flushed. */
+#define __DRI2_FLUSH_CONTEXT (1 << 1) /* glFlush should be called */
+
+enum __DRI2throttleReason {
+ __DRI2_THROTTLE_SWAPBUFFER,
+ __DRI2_THROTTLE_COPYSUBBUFFER,
+ __DRI2_THROTTLE_FLUSHFRONT
+};
+
+struct __DRI2flushExtensionRec {
+ __DRIextension base;
+ void (*flush)(__DRIdrawable *drawable);
+
+ /**
+ * Ask the driver to call getBuffers/getBuffersWithFormat before
+ * it starts rendering again.
+ *
+ * \param drawable the drawable to invalidate
+ *
+ * \since 3
+ */
+ void (*invalidate)(__DRIdrawable *drawable);
+
+ /**
+ * This function reduces the number of flushes in the driver by combining
+ * several operations into one call.
+ *
+ * It can:
+ * - throttle
+ * - flush a drawable
+ * - flush a context
+ *
+ * \param context the context
+ * \param drawable the drawable to flush
+ * \param flags a combination of _DRI2_FLUSH_xxx flags
+ * \param throttle_reason the reason for throttling, 0 = no throttling
+ *
+ * \since 4
+ */
+ void (*flush_with_flags)(__DRIcontext *ctx,
+ __DRIdrawable *drawable,
+ unsigned flags,
+ enum __DRI2throttleReason throttle_reason);
+};
+
+
+/**
+ * Extension that the driver uses to request
+ * throttle callbacks.
+ */
+
+#define __DRI2_THROTTLE "DRI2_Throttle"
+#define __DRI2_THROTTLE_VERSION 1
+
+struct __DRI2throttleExtensionRec {
+ __DRIextension base;
+ void (*throttle)(__DRIcontext *ctx,
+ __DRIdrawable *drawable,
+ enum __DRI2throttleReason reason);
+};
+
+/**
+ * XML document describing the configuration options supported by the
+ * driver.
+ */
+extern const char __driConfigOptions[];
+
+/*@}*/
+
+/**
+ * The following extensions describe loader features that the DRI
+ * driver can make use of. Some of these are mandatory, such as the
+ * getDrawableInfo extension for DRI and the DRI Loader extensions for
+ * DRI2, while others are optional, and if present allow the driver to
+ * expose certain features. The loader pass in a NULL terminated
+ * array of these extensions to the driver in the createNewScreen
+ * constructor.
+ */
+
+typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;
+typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;
+typedef struct __DRIdamageExtensionRec __DRIdamageExtension;
+typedef struct __DRIloaderExtensionRec __DRIloaderExtension;
+typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;
+
+
+/**
+ * Callback to getDrawableInfo protocol
+ */
+#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
+#define __DRI_GET_DRAWABLE_INFO_VERSION 1
+struct __DRIgetDrawableInfoExtensionRec {
+ __DRIextension base;
+
+ /**
+ * This function is used to get information about the position, size, and
+ * clip rects of a drawable.
+ */
+ GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable,
+ unsigned int * index, unsigned int * stamp,
+ int * x, int * y, int * width, int * height,
+ int * numClipRects, drm_clip_rect_t ** pClipRects,
+ int * backX, int * backY,
+ int * numBackClipRects, drm_clip_rect_t ** pBackClipRects,
+ void *loaderPrivate);
+};
+
+/**
+ * Callback to get system time for media stream counter extensions.
+ */
+#define __DRI_SYSTEM_TIME "DRI_SystemTime"
+#define __DRI_SYSTEM_TIME_VERSION 1
+struct __DRIsystemTimeExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Get the 64-bit unadjusted system time (UST).
+ */
+ int (*getUST)(int64_t * ust);
+
+ /**
+ * Get the media stream counter (MSC) rate.
+ *
+ * Matching the definition in GLX_OML_sync_control, this function returns
+ * the rate of the "media stream counter". In practical terms, this is
+ * the frame refresh rate of the display.
+ */
+ GLboolean (*getMSCRate)(__DRIdrawable *draw,
+ int32_t * numerator, int32_t * denominator,
+ void *loaderPrivate);
+};
+
+/**
+ * Damage reporting
+ */
+#define __DRI_DAMAGE "DRI_Damage"
+#define __DRI_DAMAGE_VERSION 1
+struct __DRIdamageExtensionRec {
+ __DRIextension base;
+
+ /**
+ * Reports areas of the given drawable which have been modified by the
+ * driver.
+ *
+ * \param drawable which the drawing was done to.
+ * \param rects rectangles affected, with the drawable origin as the
+ * origin.
+ * \param x X offset of the drawable within the screen (used in the
+ * front_buffer case)
+ * \param y Y offset of the drawable within the screen.
+ * \param front_buffer boolean flag for whether the drawing to the
+ * drawable was actually done directly to the front buffer (instead
+ * of backing storage, for example)
+ * \param loaderPrivate the data passed in at createNewDrawable time
+ */
+ void (*reportDamage)(__DRIdrawable *draw,
+ int x, int y,
+ drm_clip_rect_t *rects, int num_rects,
+ GLboolean front_buffer,
+ void *loaderPrivate);
+};
+
+#define __DRI_SWRAST_IMAGE_OP_DRAW 1
+#define __DRI_SWRAST_IMAGE_OP_CLEAR 2
+#define __DRI_SWRAST_IMAGE_OP_SWAP 3
+
+/**
+ * SWRast Loader extension.
+ */
+#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
+#define __DRI_SWRAST_LOADER_VERSION 1
+struct __DRIswrastLoaderExtensionRec {
+ __DRIextension base;
+
+ /*
+ * Drawable position and size
+ */
+ void (*getDrawableInfo)(__DRIdrawable *drawable,
+ int *x, int *y, int *width, int *height,
+ void *loaderPrivate);
+
+ /**
+ * Put image to drawable
+ */
+ void (*putImage)(__DRIdrawable *drawable, int op,
+ int x, int y, int width, int height,
+ char *data, void *loaderPrivate);
+
+ /**
+ * Get image from readable
+ */
+ void (*getImage)(__DRIdrawable *readable,
+ int x, int y, int width, int height,
+ char *data, void *loaderPrivate);
+};
+
+/**
+ * Invalidate loader extension. The presence of this extension
+ * indicates to the DRI driver that the loader will call invalidate in
+ * the __DRI2_FLUSH extension, whenever the needs to query for new
+ * buffers. This means that the DRI driver can drop the polling in
+ * glViewport().
+ *
+ * The extension doesn't provide any functionality, it's only use to
+ * indicate to the driver that it can use the new semantics. A DRI
+ * driver can use this to switch between the different semantics or
+ * just refuse to initialize if this extension isn't present.
+ */
+#define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
+#define __DRI_USE_INVALIDATE_VERSION 1
+
+typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
+struct __DRIuseInvalidateExtensionRec {
+ __DRIextension base;
+};
+
+/**
+ * The remaining extensions describe driver extensions, immediately
+ * available interfaces provided by the driver. To start using the
+ * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
+ * the extension you need in the array.
+ */
+#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
+
+/**
+ * Tokens for __DRIconfig attribs. A number of attributes defined by
+ * GLX or EGL standards are not in the table, as they must be provided
+ * by the loader. For example, FBConfig ID or visual ID, drawable type.
+ */
+
+#define __DRI_ATTRIB_BUFFER_SIZE 1
+#define __DRI_ATTRIB_LEVEL 2
+#define __DRI_ATTRIB_RED_SIZE 3
+#define __DRI_ATTRIB_GREEN_SIZE 4
+#define __DRI_ATTRIB_BLUE_SIZE 5
+#define __DRI_ATTRIB_LUMINANCE_SIZE 6
+#define __DRI_ATTRIB_ALPHA_SIZE 7
+#define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
+#define __DRI_ATTRIB_DEPTH_SIZE 9
+#define __DRI_ATTRIB_STENCIL_SIZE 10
+#define __DRI_ATTRIB_ACCUM_RED_SIZE 11
+#define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
+#define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
+#define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
+#define __DRI_ATTRIB_SAMPLE_BUFFERS 15
+#define __DRI_ATTRIB_SAMPLES 16
+#define __DRI_ATTRIB_RENDER_TYPE 17
+#define __DRI_ATTRIB_CONFIG_CAVEAT 18
+#define __DRI_ATTRIB_CONFORMANT 19
+#define __DRI_ATTRIB_DOUBLE_BUFFER 20
+#define __DRI_ATTRIB_STEREO 21
+#define __DRI_ATTRIB_AUX_BUFFERS 22
+#define __DRI_ATTRIB_TRANSPARENT_TYPE 23
+#define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
+#define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
+#define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
+#define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
+#define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
+#define __DRI_ATTRIB_FLOAT_MODE 29
+#define __DRI_ATTRIB_RED_MASK 30
+#define __DRI_ATTRIB_GREEN_MASK 31
+#define __DRI_ATTRIB_BLUE_MASK 32
+#define __DRI_ATTRIB_ALPHA_MASK 33
+#define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
+#define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
+#define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
+#define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
+#define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
+#define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
+#define __DRI_ATTRIB_SWAP_METHOD 40
+#define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
+#define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
+#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
+#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
+#define __DRI_ATTRIB_YINVERTED 47
+#define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE 48
+
+/* __DRI_ATTRIB_RENDER_TYPE */
+#define __DRI_ATTRIB_RGBA_BIT 0x01
+#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
+#define __DRI_ATTRIB_LUMINANCE_BIT 0x04
+
+/* __DRI_ATTRIB_CONFIG_CAVEAT */
+#define __DRI_ATTRIB_SLOW_BIT 0x01
+#define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
+
+/* __DRI_ATTRIB_TRANSPARENT_TYPE */
+#define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
+#define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
+
+/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
+#define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
+#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
+#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
+
+/**
+ * This extension defines the core DRI functionality.
+ */
+#define __DRI_CORE "DRI_Core"
+#define __DRI_CORE_VERSION 1
+
+struct __DRIcoreExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen, int fd,
+ unsigned int sarea_handle,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driverConfigs,
+ void *loaderPrivate);
+
+ void (*destroyScreen)(__DRIscreen *screen);
+
+ const __DRIextension **(*getExtensions)(__DRIscreen *screen);
+
+ int (*getConfigAttrib)(const __DRIconfig *config,
+ unsigned int attrib,
+ unsigned int *value);
+
+ int (*indexConfigAttrib)(const __DRIconfig *config, int index,
+ unsigned int *attrib, unsigned int *value);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ unsigned int drawable_id,
+ unsigned int head,
+ void *loaderPrivate);
+
+ void (*destroyDrawable)(__DRIdrawable *drawable);
+
+ void (*swapBuffers)(__DRIdrawable *drawable);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
+
+ int (*copyContext)(__DRIcontext *dest,
+ __DRIcontext *src,
+ unsigned long mask);
+
+ void (*destroyContext)(__DRIcontext *context);
+
+ int (*bindContext)(__DRIcontext *ctx,
+ __DRIdrawable *pdraw,
+ __DRIdrawable *pread);
+
+ int (*unbindContext)(__DRIcontext *ctx);
+};
+
+/**
+ * Stored version of some component (i.e., server-side DRI module, kernel-side
+ * DRM, etc.).
+ *
+ * \todo
+ * There are several data structures that explicitly store a major version,
+ * minor version, and patch level. These structures should be modified to
+ * have a \c __DRIversionRec instead.
+ */
+struct __DRIversionRec {
+ int major; /**< Major version number. */
+ int minor; /**< Minor version number. */
+ int patch; /**< Patch-level. */
+};
+
+/**
+ * Framebuffer information record. Used by libGL to communicate information
+ * about the framebuffer to the driver's \c __driCreateNewScreen function.
+ *
+ * In XFree86, most of this information is derrived from data returned by
+ * calling \c XF86DRIGetDeviceInfo.
+ *
+ * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
+ * __driUtilCreateNewScreen CallCreateNewScreen
+ *
+ * \bug This structure could be better named.
+ */
+struct __DRIframebufferRec {
+ unsigned char *base; /**< Framebuffer base address in the CPU's
+ * address space. This value is calculated by
+ * calling \c drmMap on the framebuffer handle
+ * returned by \c XF86DRIGetDeviceInfo (or a
+ * similar function).
+ */
+ int size; /**< Framebuffer size, in bytes. */
+ int stride; /**< Number of bytes from one line to the next. */
+ int width; /**< Pixel width of the framebuffer. */
+ int height; /**< Pixel height of the framebuffer. */
+ int dev_priv_size; /**< Size of the driver's dev-priv structure. */
+ void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
+};
+
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for legacy DRI functionality. This is used in
+ * conjunction with the core extension.
+ */
+#define __DRI_LEGACY "DRI_Legacy"
+#define __DRI_LEGACY_VERSION 1
+
+struct __DRIlegacyExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen,
+ const __DRIversion *ddx_version,
+ const __DRIversion *dri_version,
+ const __DRIversion *drm_version,
+ const __DRIframebuffer *frame_buffer,
+ void *pSAREA, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ drm_drawable_t hwDrawable,
+ int renderType, const int *attrs,
+ void *loaderPrivate);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ int render_type,
+ __DRIcontext *shared,
+ drm_context_t hwContext,
+ void *loaderPrivate);
+};
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for swrast DRI functionality. This is used in
+ * conjunction with the core extension.
+ */
+#define __DRI_SWRAST "DRI_SWRast"
+#define __DRI_SWRAST_VERSION 3
+
+struct __DRIswrastExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ void *loaderPrivate);
+
+ /* Since version 2 */
+ __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *data);
+
+ /**
+ * Create a context for a particular API with a set of attributes
+ *
+ * \since version 3
+ *
+ * \sa __DRIdri2ExtensionRec::createContextAttribs
+ */
+ __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ unsigned num_attribs,
+ const uint32_t *attribs,
+ unsigned *error,
+ void *loaderPrivate);
+};
+
+/**
+ * DRI2 Loader extension.
+ */
+#define __DRI_BUFFER_FRONT_LEFT 0
+#define __DRI_BUFFER_BACK_LEFT 1
+#define __DRI_BUFFER_FRONT_RIGHT 2
+#define __DRI_BUFFER_BACK_RIGHT 3
+#define __DRI_BUFFER_DEPTH 4
+#define __DRI_BUFFER_STENCIL 5
+#define __DRI_BUFFER_ACCUM 6
+#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
+#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
+#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
+#define __DRI_BUFFER_HIZ 10
+
+/* Inofficial and for internal use. Increase when adding a new buffer token. */
+#define __DRI_BUFFER_COUNT 11
+
+struct __DRIbufferRec {
+ unsigned int attachment;
+ unsigned int name;
+ unsigned int pitch;
+ unsigned int cpp;
+ unsigned int flags;
+};
+
+#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
+#define __DRI_DRI2_LOADER_VERSION 3
+struct __DRIdri2LoaderExtensionRec {
+ __DRIextension base;
+
+ __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate);
+
+ /**
+ * Flush pending front-buffer rendering
+ *
+ * Any rendering that has been performed to the
+ * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
+ * \c __DRI_BUFFER_FRONT_LEFT.
+ *
+ * \param driDrawable Drawable whose front-buffer is to be flushed
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable
+ */
+ void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
+
+
+ /**
+ * Get list of buffers from the server
+ *
+ * Gets a list of buffer for the specified set of attachments. Unlike
+ * \c ::getBuffers, this function takes a list of attachments paired with
+ * opaque \c unsigned \c int value describing the format of the buffer.
+ * It is the responsibility of the caller to know what the service that
+ * allocates the buffers will expect to receive for the format.
+ *
+ * \param driDrawable Drawable whose buffers are being queried.
+ * \param width Output where the width of the buffers is stored.
+ * \param height Output where the height of the buffers is stored.
+ * \param attachments List of pairs of attachment ID and opaque format
+ * requested for the drawable.
+ * \param count Number of attachment / format pairs stored in
+ * \c attachments.
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable.
+ */
+ __DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate);
+};
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for DRI2.
+ */
+#define __DRI_DRI2 "DRI_DRI2"
+#define __DRI_DRI2_VERSION 3
+
+#define __DRI_API_OPENGL 0 /**< OpenGL compatibility profile */
+#define __DRI_API_GLES 1 /**< OpenGL ES 1.x */
+#define __DRI_API_GLES2 2 /**< OpenGL ES 2.x */
+#define __DRI_API_OPENGL_CORE 3 /**< OpenGL 3.2+ core profile */
+#define __DRI_API_GLES3 4 /**< OpenGL ES 3.x */
+
+#define __DRI_CTX_ATTRIB_MAJOR_VERSION 0
+#define __DRI_CTX_ATTRIB_MINOR_VERSION 1
+#define __DRI_CTX_ATTRIB_FLAGS 2
+
+/**
+ * \requires __DRI2_ROBUSTNESS.
+ */
+#define __DRI_CTX_ATTRIB_RESET_STRATEGY 3
+
+#define __DRI_CTX_FLAG_DEBUG 0x00000001
+#define __DRI_CTX_FLAG_FORWARD_COMPATIBLE 0x00000002
+
+/**
+ * \requires __DRI2_ROBUSTNESS.
+ */
+#define __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS 0x00000004
+
+/**
+ * \name Context reset strategies.
+ */
+/*@{*/
+#define __DRI_CTX_RESET_NO_NOTIFICATION 0
+#define __DRI_CTX_RESET_LOSE_CONTEXT 1
+/*@}*/
+
+/**
+ * \name Reasons that __DRIdri2Extension::createContextAttribs might fail
+ */
+/*@{*/
+/** Success! */
+#define __DRI_CTX_ERROR_SUCCESS 0
+
+/** Memory allocation failure */
+#define __DRI_CTX_ERROR_NO_MEMORY 1
+
+/** Client requested an API (e.g., OpenGL ES 2.0) that the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_API 2
+
+/** Client requested an API version that the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_VERSION 3
+
+/** Client requested a flag or combination of flags the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_FLAG 4
+
+/** Client requested an attribute the driver doesn't understand. */
+#define __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE 5
+
+/** Client requested a flag the driver doesn't understand. */
+#define __DRI_CTX_ERROR_UNKNOWN_FLAG 6
+/*@}*/
+
+struct __DRIdri2ExtensionRec {
+ __DRIextension base;
+
+ __DRIscreen *(*createNewScreen)(int screen, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
+ __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ void *loaderPrivate);
+
+ __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *loaderPrivate);
+
+ /* Since version 2 */
+ unsigned int (*getAPIMask)(__DRIscreen *screen);
+
+ __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ void *data);
+
+ __DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
+ unsigned int attachment,
+ unsigned int format,
+ int width,
+ int height);
+ void (*releaseBuffer)(__DRIscreen *screen,
+ __DRIbuffer *buffer);
+
+ /**
+ * Create a context for a particular API with a set of attributes
+ *
+ * \since version 3
+ *
+ * \sa __DRIswrastExtensionRec::createContextAttribs
+ */
+ __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
+ int api,
+ const __DRIconfig *config,
+ __DRIcontext *shared,
+ unsigned num_attribs,
+ const uint32_t *attribs,
+ unsigned *error,
+ void *loaderPrivate);
+};
+
+
+/**
+ * This extension provides functionality to enable various EGLImage
+ * extensions.
+ */
+#define __DRI_IMAGE "DRI_IMAGE"
+#define __DRI_IMAGE_VERSION 5
+
+/**
+ * These formats correspond to the similarly named MESA_FORMAT_*
+ * tokens, except in the native endian of the CPU. For example, on
+ * little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
+ * MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
+ *
+ * __DRI_IMAGE_FORMAT_NONE is for images that aren't directly usable
+ * by the driver (YUV planar formats) but serve as a base image for
+ * creating sub-images for the different planes within the image.
+ *
+ * R8, GR88 and NONE should not be used with createImageFormName or
+ * createImage, and are returned by query from sub images created with
+ * createImageFromNames (NONE, see above) and fromPlane (R8 & GR88).
+ */
+#define __DRI_IMAGE_FORMAT_RGB565 0x1001
+#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
+#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
+#define __DRI_IMAGE_FORMAT_ABGR8888 0x1004
+#define __DRI_IMAGE_FORMAT_XBGR8888 0x1005
+#define __DRI_IMAGE_FORMAT_R8 0x1006 /* Since version 5 */
+#define __DRI_IMAGE_FORMAT_GR88 0x1007
+#define __DRI_IMAGE_FORMAT_NONE 0x1008
+
+#define __DRI_IMAGE_USE_SHARE 0x0001
+#define __DRI_IMAGE_USE_SCANOUT 0x0002
+#define __DRI_IMAGE_USE_CURSOR 0x0004 /* Depricated */
+
+
+/**
+ * Four CC formats that matches with WL_DRM_FORMAT_* from wayland_drm.h
+ * and GBM_FORMAT_* from gbm.h, used with createImageFromNames.
+ *
+ * \since 5
+ */
+
+#define __DRI_IMAGE_FOURCC_RGB565 0x36314752
+#define __DRI_IMAGE_FOURCC_ARGB8888 0x34325241
+#define __DRI_IMAGE_FOURCC_XRGB8888 0x34325258
+#define __DRI_IMAGE_FOURCC_ABGR8888 0x34324241
+#define __DRI_IMAGE_FOURCC_XBGR8888 0x34324258
+#define __DRI_IMAGE_FOURCC_YUV410 0x39565559
+#define __DRI_IMAGE_FOURCC_YUV411 0x31315559
+#define __DRI_IMAGE_FOURCC_YUV420 0x32315559
+#define __DRI_IMAGE_FOURCC_YUV422 0x36315559
+#define __DRI_IMAGE_FOURCC_YUV444 0x34325559
+#define __DRI_IMAGE_FOURCC_NV12 0x3231564e
+#define __DRI_IMAGE_FOURCC_NV16 0x3631564e
+#define __DRI_IMAGE_FOURCC_YUYV 0x56595559
+
+
+/**
+ * Queryable on images created by createImageFromNames.
+ *
+ * RGB and RGBA are may be usable directly as images but its still
+ * recommended to call fromPlanar with plane == 0.
+ *
+ * Y_U_V, Y_UV and Y_XUXV all requires call to fromPlanar to create
+ * usable sub-images, sampling from images return raw YUV data and
+ * color conversion needs to be done in the shader.
+ *
+ * \since 5
+ */
+
+#define __DRI_IMAGE_COMPONENTS_RGB 0x3001
+#define __DRI_IMAGE_COMPONENTS_RGBA 0x3002
+#define __DRI_IMAGE_COMPONENTS_Y_U_V 0x3003
+#define __DRI_IMAGE_COMPONENTS_Y_UV 0x3004
+#define __DRI_IMAGE_COMPONENTS_Y_XUXV 0x3005
+
+
+/**
+ * queryImage attributes
+ */
+
+#define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
+#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
+#define __DRI_IMAGE_ATTRIB_NAME 0x2002
+#define __DRI_IMAGE_ATTRIB_FORMAT 0x2003 /* available in versions 3+ */
+#define __DRI_IMAGE_ATTRIB_WIDTH 0x2004 /* available in versions 4+ */
+#define __DRI_IMAGE_ATTRIB_HEIGHT 0x2005
+#define __DRI_IMAGE_ATTRIB_COMPONENTS 0x2006 /* available in versions 5+ */
+
+typedef struct __DRIimageRec __DRIimage;
+typedef struct __DRIimageExtensionRec __DRIimageExtension;
+struct __DRIimageExtensionRec {
+ __DRIextension base;
+
+ __DRIimage *(*createImageFromName)(__DRIscreen *screen,
+ int width, int height, int format,
+ int name, int pitch,
+ void *loaderPrivate);
+
+ __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
+ int renderbuffer,
+ void *loaderPrivate);
+
+ void (*destroyImage)(__DRIimage *image);
+
+ __DRIimage *(*createImage)(__DRIscreen *screen,
+ int width, int height, int format,
+ unsigned int use,
+ void *loaderPrivate);
+
+ GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
+
+ /**
+ * The new __DRIimage will share the content with the old one, see dup(2).
+ */
+ __DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
+
+ /**
+ * Validate that a __DRIimage can be used a certain way.
+ *
+ * \since 2
+ */
+ GLboolean (*validateUsage)(__DRIimage *image, unsigned int use);
+
+ /**
+ * Unlike createImageFromName __DRI_IMAGE_FORMAT is not but instead
+ * __DRI_IMAGE_FOURCC and strides are in bytes not pixels. Stride is
+ * also per block and not per pixel (for non-RGB, see gallium blocks).
+ *
+ * \since 5
+ */
+ __DRIimage *(*createImageFromNames)(__DRIscreen *screen,
+ int width, int height, int fourcc,
+ int *names, int num_names,
+ int *strides, int *offsets,
+ void *loaderPrivate);
+
+ /**
+ * Create an image out of a sub-region of a parent image. This
+ * entry point lets us create individual __DRIimages for different
+ * planes in a planar buffer (typically yuv), for example. While a
+ * sub-image shares the underlying buffer object with the parent
+ * image and other sibling sub-images, the life times of parent and
+ * sub-images are not dependent. Destroying the parent or a
+ * sub-image doesn't affect other images. The underlying buffer
+ * object is free when no __DRIimage remains that references it.
+ *
+ * Sub-images may overlap, but rendering to overlapping sub-images
+ * is undefined.
+ *
+ * \since 5
+ */
+ __DRIimage *(*fromPlanar)(__DRIimage *image, int plane,
+ void *loaderPrivate);
+};
+
+
+/**
+ * This extension must be implemented by the loader and passed to the
+ * driver at screen creation time. The EGLImage entry points in the
+ * various client APIs take opaque EGLImage handles and use this
+ * extension to map them to a __DRIimage. At version 1, this
+ * extensions allows mapping EGLImage pointers to __DRIimage pointers,
+ * but future versions could support other EGLImage-like, opaque types
+ * with new lookup functions.
+ */
+#define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP"
+#define __DRI_IMAGE_LOOKUP_VERSION 1
+
+typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
+struct __DRIimageLookupExtensionRec {
+ __DRIextension base;
+
+ __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
+ void *loaderPrivate);
+};
+
+/**
+ * This extension allows for common DRI2 options
+ */
+#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
+#define __DRI2_CONFIG_QUERY_VERSION 1
+
+typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
+struct __DRI2configQueryExtensionRec {
+ __DRIextension base;
+
+ int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
+ int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
+ int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
+};
+
+/**
+ * Robust context driver extension.
+ *
+ * Existence of this extension means the driver can accept the
+ * \c __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
+ * \c __DRI_CTX_ATTRIB_RESET_STRATEGY attribute in
+ * \c __DRIdri2ExtensionRec::createContextAttribs.
+ */
+#define __DRI2_ROBUSTNESS "DRI_Robustness"
+#define __DRI2_ROBUSTNESS_VERSION 1
+
+typedef struct __DRIrobustnessExtensionRec __DRIrobustnessExtension;
+struct __DRIrobustnessExtensionRec {
+ __DRIextension base;
+};
+
+#endif
diff --git a/src/gfxstream/host/apigen-codec-common/GLDecoderContextData.h b/src/gfxstream/host/apigen-codec-common/GLDecoderContextData.h
new file mode 100644
index 00000000000..824ea9cbcf8
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/GLDecoderContextData.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.
+*/
+#pragma once
+
+#include <array>
+#include <vector>
+
+// Convenient class used to hold the common context data shared
+// by both the GLESv1 and GLESv2 decoders. This corresponds to
+// vertex attribute buffers.
+class GLDecoderContextData {
+public:
+ // List of supported vertex attribute indices, as they appear in
+ // a glVertexAttribPointer() call.
+ enum PointerDataLocation {
+ VERTEX_LOCATION = 0,
+ NORMAL_LOCATION = 1,
+ COLOR_LOCATION = 2,
+ POINTSIZE_LOCATION = 3,
+ TEXCOORD0_LOCATION = 4,
+ TEXCOORD1_LOCATION = 5,
+ TEXCOORD2_LOCATION = 6,
+ TEXCOORD3_LOCATION = 7,
+ TEXCOORD4_LOCATION = 8,
+ TEXCOORD5_LOCATION = 9,
+ TEXCOORD6_LOCATION = 10,
+ TEXCOORD7_LOCATION = 11,
+ MATRIXINDEX_LOCATION = 12,
+ WEIGHT_LOCATION = 13,
+ LAST_LOCATION = 14
+ };
+
+ // Store |len| bytes from |data| into the buffer associated with
+ // vertex attribute index |loc|.
+ void storePointerData(unsigned int loc, void *data, size_t len) {
+ if (loc < mPointerData.size()) {
+ auto& ptrData = mPointerData[loc];
+ ptrData.assign(reinterpret_cast<char*>(data),
+ reinterpret_cast<char*>(data) + len);
+ } else {
+ // User error, don't do anything here
+ }
+ }
+
+ // Return pointer to data associated with vertex attribute index |loc|
+ void* pointerData(unsigned int loc) const {
+ if (loc < mPointerData.size()) {
+ return const_cast<char*>(mPointerData[loc].data());
+ } else {
+ // User error. Return nullptr.
+ return nullptr;
+ }
+ }
+
+private:
+ static const int kMaxVertexAttributes = 16;
+
+ std::array<std::vector<char>, kMaxVertexAttributes> mPointerData = {};
+}; \ No newline at end of file
diff --git a/src/gfxstream/host/apigen-codec-common/Makefile b/src/gfxstream/host/apigen-codec-common/Makefile
new file mode 100644
index 00000000000..351eb26a9c9
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/Makefile
@@ -0,0 +1,13 @@
+
+ROOT=../..
+
+include $(ROOT)/make/commondefs
+
+CXXFILES = GLClientState.cpp glUtils.cpp
+CXXINCS += -I$(ROOT)/libs/GLESv1 -I$(ROOT)/include
+
+LIBRARY_NAME = libcodecCommon.a
+
+include $(COMMONRULES)
+
+
diff --git a/src/gfxstream/host/apigen-codec-common/ProtocolUtils.h b/src/gfxstream/host/apigen-codec-common/ProtocolUtils.h
new file mode 100644
index 00000000000..b03db3cb94d
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/ProtocolUtils.h
@@ -0,0 +1,181 @@
+#pragma once
+
+#include "aemu/base/Tracing.h"
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+namespace gfxstream {
+
+// A helper template to extract values form the wire protocol stream
+// and convert them to appropriate host values.
+//
+// The wire protocol uses 32-bit exclusively when transferring
+// GLintptr or GLsizei values, as well as opaque handles like GLeglImage,
+// from the guest (even when the guest is 64-bit).
+//
+// The corresponding host definitions depend on the host bitness. For
+// example, GLintptr is 64-bit on linux-x86_64. The following is a set
+// of templates that can simplify the conversion of protocol values
+// into host ones.
+//
+// The most important one is:
+//
+// unpack<HOST_TYPE,SIZE_TYPE>(const void* ptr)
+//
+// Which reads bytes from |ptr|, using |SIZE_TYPE| as the underlying
+// sized-integer specifier (e.g. 'uint32_t'), and converting the result
+// into a |HOST_TYPE| value. For example:
+//
+// unpack<EGLImage,uint32_t>(ptr + 12);
+//
+// will read a 4-byte value from |ptr + 12| and convert it into
+// an EGLImage, which is a host void*. The template detects host
+// pointer types to perform proper type casting.
+//
+// TODO(digit): Add custom unpackers to handle generic opaque void* values.
+// and map them to unique 32-bit values.
+
+template <typename T, typename S>
+struct UnpackerT {
+ static T unpack(const void* ptr) {
+ static_assert(sizeof(T) == sizeof(S),
+ "Bad input arguments, have to be of the same size");
+ return *(const T*)ptr;
+ }
+};
+
+template <typename T, typename S>
+struct UnpackerT<T*, S> {
+ static T* unpack(const void* ptr) {
+ return (T*)(uintptr_t)(*(const S*)ptr);
+ }
+};
+
+template <>
+struct UnpackerT<ssize_t, uint32_t> {
+ static ssize_t unpack(const void* ptr) {
+ return (ssize_t)*(const int32_t*)ptr;
+ }
+};
+
+template <typename T, typename S>
+inline T Unpack(const void* ptr) {
+ return UnpackerT<T, S>::unpack(ptr);
+}
+
+// Helper classes GenericInputBuffer and GenericOutputBuffer used to ensure
+// input and output buffers passed to EGL/GL functions are properly aligned
+// (preventing crashes with some backends).
+//
+// Usage example:
+//
+// GenericInputBuffer<> inputBuffer(ptrIn, sizeIn);
+// GenericOutputBuffer<> outputBuffer(ptrOut, sizeOut);
+// glDoGetStuff(inputBuffer.get(), outputBuffer.get());
+// outputBuffer.flush();
+//
+// get() will return the original value of |ptr| if it was aligned on the
+// configured boundary (8 bytes by default). Otherwise, it will return the
+// address of an aligned copy of the original |size| bytes starting from |ptr|.
+//
+// Allowed alignment values are 1, 2, 4, 8.
+//
+// outputBuffer.flush() copies the content of the copy back to |ptr| explictly,
+// if needed. It is a no-op if |ptr| was aligned.
+//
+// Both classes try to minimize heap usage as much as possible - the first
+// template argument defines the size of an internal array Generic*Buffer-s use
+// if the |ptr|'s |size| is small enough. If it doesn't fit into the internal
+// array, an aligned copy is allocated on the heap and freed in the dtor.
+
+template <size_t StackSize = 1024, size_t Align = 8>
+class GenericInputBuffer {
+ static_assert(Align == 1 || Align == 2 || Align == 4 || Align == 8,
+ "Bad alignment parameter");
+
+public:
+ GenericInputBuffer(const void* input, size_t size) : mOrigBuff(input) {
+ if (((uintptr_t)input & (Align - 1U)) == 0) {
+ mPtr = const_cast<void*>(input);
+ } else {
+ if (size <= StackSize) {
+ mPtr = &mArray[0];
+ } else {
+ mPtr = malloc(size);
+ }
+ memcpy(mPtr, input, size);
+ }
+ }
+
+ ~GenericInputBuffer() {
+ if (mPtr != mOrigBuff && mPtr != &mArray[0]) {
+ free(mPtr);
+ }
+ }
+
+ const void* get() const { return mPtr; }
+
+private:
+ // A pointer to the aligned buffer, might point either to mOrgBuf, to mArray
+ // start or to a heap-allocated chunk of data.
+ void* mPtr;
+ // Original buffer.
+ const void* mOrigBuff;
+ // Inplace aligned array for small enough buffers.
+ char __attribute__((__aligned__(Align))) mArray[StackSize];
+};
+
+template <size_t StackSize = 1024, size_t Align = 8>
+class GenericOutputBuffer {
+ static_assert(Align == 1 || Align == 2 || Align == 4 || Align == 8,
+ "Bad alignment parameter");
+
+public:
+ GenericOutputBuffer(unsigned char* ptr, size_t size) :
+ mOrigBuff(ptr), mSize(size) {
+ if (((uintptr_t)ptr & (Align - 1U)) == 0) {
+ mPtr = ptr;
+ } else {
+ if (size <= StackSize) {
+ mPtr = &mArray[0];
+ } else {
+ mPtr = calloc(1, size);
+ }
+ }
+ }
+
+ ~GenericOutputBuffer() {
+ if (mPtr != mOrigBuff && mPtr != &mArray[0]) {
+ free(mPtr);
+ }
+ }
+
+ void* get() const { return mPtr; }
+
+ void flush() {
+ if (mPtr != mOrigBuff) {
+ memcpy(mOrigBuff, mPtr, mSize);
+ }
+ }
+
+private:
+ // A pointer to the aligned buffer, might point either to mOrgBuf, to mArray
+ // start or to a heap-allocated chunk of data.
+ void* mPtr;
+ // Original buffer.
+ unsigned char* mOrigBuff;
+ // Original buffer size.
+ size_t mSize;
+ // Inplace array for small enough buffers.
+ unsigned char __attribute__((__aligned__(Align))) mArray[StackSize];
+};
+
+// Pin the defaults for the commonly used type names
+using InputBuffer = GenericInputBuffer<>;
+using OutputBuffer = GenericOutputBuffer<>;
+
+} // namespace gfxstream
diff --git a/src/gfxstream/host/apigen-codec-common/glUtils.cpp b/src/gfxstream/host/apigen-codec-common/glUtils.cpp
new file mode 100644
index 00000000000..80d292e95ad
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/glUtils.cpp
@@ -0,0 +1,467 @@
+/*
+* 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 "glUtils.h"
+
+#include <string.h>
+#include <GLES3/gl31.h>
+
+#include "host-common/logging.h"
+
+size_t glSizeof(GLenum type)
+{
+ size_t retval = 0;
+ switch(type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ retval = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ case GL_HALF_FLOAT:
+ case GL_HALF_FLOAT_OES:
+ retval = 2;
+ break;
+ case GL_IMAGE_2D:
+ case GL_IMAGE_3D:
+ case GL_UNSIGNED_INT:
+ case GL_INT:
+ case GL_FLOAT:
+ case GL_FIXED:
+ case GL_BOOL:
+ retval = 4;
+ break;
+#ifdef GL_DOUBLE
+ case GL_DOUBLE:
+ retval = 8;
+ break;
+#endif
+ case GL_FLOAT_VEC2:
+ case GL_INT_VEC2:
+ case GL_UNSIGNED_INT_VEC2:
+ case GL_BOOL_VEC2:
+ retval = 8;
+ break;
+ case GL_INT_VEC3:
+ case GL_UNSIGNED_INT_VEC3:
+ case GL_BOOL_VEC3:
+ case GL_FLOAT_VEC3:
+ retval = 12;
+ break;
+ case GL_FLOAT_VEC4:
+ case GL_BOOL_VEC4:
+ case GL_INT_VEC4:
+ case GL_UNSIGNED_INT_VEC4:
+ case GL_FLOAT_MAT2:
+ retval = 16;
+ break;
+ case GL_FLOAT_MAT3:
+ retval = 36;
+ break;
+ case GL_FLOAT_MAT4:
+ retval = 64;
+ break;
+ case GL_FLOAT_MAT2x3:
+ case GL_FLOAT_MAT3x2:
+ retval = 4 * 6;
+ break;
+ case GL_FLOAT_MAT2x4:
+ case GL_FLOAT_MAT4x2:
+ retval = 4 * 8;
+ break;
+ case GL_FLOAT_MAT3x4:
+ case GL_FLOAT_MAT4x3:
+ retval = 4 * 12;
+ break;
+ case GL_SAMPLER_2D:
+ case GL_SAMPLER_3D:
+ case GL_SAMPLER_CUBE:
+ case GL_SAMPLER_2D_SHADOW:
+ case GL_SAMPLER_2D_ARRAY:
+ case GL_SAMPLER_2D_ARRAY_SHADOW:
+ case GL_SAMPLER_CUBE_SHADOW:
+ case GL_INT_SAMPLER_2D:
+ case GL_INT_SAMPLER_3D:
+ case GL_INT_SAMPLER_CUBE:
+ case GL_INT_SAMPLER_2D_ARRAY:
+ case GL_UNSIGNED_INT_SAMPLER_2D:
+ case GL_UNSIGNED_INT_SAMPLER_3D:
+ case GL_UNSIGNED_INT_SAMPLER_CUBE:
+ case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+ retval = 4;
+ break;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
+ retval = 2;
+ break;
+ case GL_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_24_8_OES:;
+ retval = 4;
+ break;
+ case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+ retval = 4 + 4;
+ break;
+ default:
+ ERR("**** ERROR unknown type 0x%x", type);
+ retval = 4;
+ }
+ return retval;
+
+}
+
+size_t glUtilsParamSize(GLenum param)
+{
+ size_t s = 0;
+
+ switch(param)
+ {
+ case GL_DEPTH_TEST:
+ case GL_DEPTH_FUNC:
+ case GL_DEPTH_BITS:
+ case GL_MAX_CLIP_PLANES:
+ case GL_GREEN_BITS:
+ case GL_MAX_MODELVIEW_STACK_DEPTH:
+ case GL_MAX_PROJECTION_STACK_DEPTH:
+ case GL_MAX_TEXTURE_STACK_DEPTH:
+ case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
+ case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
+ case GL_MAX_TEXTURE_SIZE:
+ case GL_TEXTURE_GEN_MODE_OES:
+ case GL_TEXTURE_ENV_MODE:
+ case GL_FOG_MODE:
+ case GL_FOG_DENSITY:
+ case GL_FOG_START:
+ case GL_FOG_END:
+ case GL_SPOT_EXPONENT:
+ case GL_CONSTANT_ATTENUATION:
+ case GL_LINEAR_ATTENUATION:
+ case GL_QUADRATIC_ATTENUATION:
+ case GL_SHININESS:
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ case GL_POINT_SIZE:
+ case GL_POINT_SIZE_MIN:
+ case GL_POINT_SIZE_MAX:
+ case GL_POINT_FADE_THRESHOLD_SIZE:
+ case GL_CULL_FACE_MODE:
+ case GL_FRONT_FACE:
+ case GL_SHADE_MODEL:
+ case GL_DEPTH_WRITEMASK:
+ case GL_DEPTH_CLEAR_VALUE:
+ case GL_STENCIL_FAIL:
+ case GL_STENCIL_PASS_DEPTH_FAIL:
+ case GL_STENCIL_PASS_DEPTH_PASS:
+ case GL_STENCIL_REF:
+ case GL_STENCIL_WRITEMASK:
+ case GL_MATRIX_MODE:
+ case GL_MODELVIEW_STACK_DEPTH:
+ case GL_PROJECTION_STACK_DEPTH:
+ case GL_TEXTURE_STACK_DEPTH:
+ case GL_ALPHA_TEST_FUNC:
+ case GL_ALPHA_TEST_REF:
+ case GL_ALPHA_TEST:
+ case GL_BLEND_DST:
+ case GL_BLEND_SRC:
+ case GL_BLEND:
+ case GL_LOGIC_OP_MODE:
+ case GL_SCISSOR_TEST:
+ case GL_MAX_TEXTURE_UNITS:
+ case GL_ACTIVE_TEXTURE:
+ case GL_ALPHA_BITS:
+ case GL_ARRAY_BUFFER_BINDING:
+ case GL_BLUE_BITS:
+ case GL_CLIENT_ACTIVE_TEXTURE:
+ case GL_CLIP_PLANE0:
+ case GL_CLIP_PLANE1:
+ case GL_CLIP_PLANE2:
+ case GL_CLIP_PLANE3:
+ case GL_CLIP_PLANE4:
+ case GL_CLIP_PLANE5:
+ case GL_COLOR_ARRAY:
+ case GL_COLOR_ARRAY_BUFFER_BINDING:
+ case GL_COLOR_ARRAY_SIZE:
+ case GL_COLOR_ARRAY_STRIDE:
+ case GL_COLOR_ARRAY_TYPE:
+ case GL_COLOR_LOGIC_OP:
+ case GL_COLOR_MATERIAL:
+ case GL_PACK_ALIGNMENT:
+ case GL_PERSPECTIVE_CORRECTION_HINT:
+ case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
+ case GL_POINT_SIZE_ARRAY_STRIDE_OES:
+ case GL_POINT_SIZE_ARRAY_TYPE_OES:
+ case GL_POINT_SMOOTH:
+ case GL_POINT_SMOOTH_HINT:
+ case GL_POINT_SPRITE_OES:
+ case GL_COORD_REPLACE_OES:
+ case GL_COMBINE_ALPHA:
+ case GL_SRC0_RGB:
+ case GL_SRC1_RGB:
+ case GL_SRC2_RGB:
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND2_RGB:
+ case GL_SRC0_ALPHA:
+ case GL_SRC1_ALPHA:
+ case GL_SRC2_ALPHA:
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_ALPHA:
+ case GL_RGB_SCALE:
+ case GL_ALPHA_SCALE:
+ case GL_COMBINE_RGB:
+ case GL_POLYGON_OFFSET_FACTOR:
+ case GL_POLYGON_OFFSET_FILL:
+ case GL_POLYGON_OFFSET_UNITS:
+ case GL_RED_BITS:
+ case GL_RESCALE_NORMAL:
+ case GL_SAMPLE_ALPHA_TO_COVERAGE:
+ case GL_SAMPLE_ALPHA_TO_ONE:
+ case GL_SAMPLE_BUFFERS:
+ case GL_SAMPLE_COVERAGE:
+ case GL_SAMPLE_COVERAGE_INVERT:
+ case GL_SAMPLE_COVERAGE_VALUE:
+ case GL_SAMPLES:
+ case GL_STENCIL_BITS:
+ case GL_STENCIL_CLEAR_VALUE:
+ case GL_STENCIL_FUNC:
+ case GL_STENCIL_TEST:
+ case GL_STENCIL_VALUE_MASK:
+ case GL_STENCIL_BACK_FUNC:
+ case GL_STENCIL_BACK_VALUE_MASK:
+ case GL_STENCIL_BACK_REF:
+ case GL_STENCIL_BACK_FAIL:
+ case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
+ case GL_STENCIL_BACK_PASS_DEPTH_PASS:
+ case GL_STENCIL_BACK_WRITEMASK:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_BINDING_2D:
+ case GL_TEXTURE_BINDING_CUBE_MAP:
+ case GL_TEXTURE_BINDING_EXTERNAL_OES:
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
+ case GL_TEXTURE_COORD_ARRAY_SIZE:
+ case GL_TEXTURE_COORD_ARRAY_STRIDE:
+ case GL_TEXTURE_COORD_ARRAY_TYPE:
+ case GL_UNPACK_ALIGNMENT:
+ case GL_VERTEX_ARRAY:
+ case GL_VERTEX_ARRAY_BUFFER_BINDING:
+ case GL_VERTEX_ARRAY_SIZE:
+ case GL_VERTEX_ARRAY_STRIDE:
+ case GL_VERTEX_ARRAY_TYPE:
+ case GL_SPOT_CUTOFF:
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_GENERATE_MIPMAP:
+ case GL_GENERATE_MIPMAP_HINT:
+ case GL_RENDERBUFFER_WIDTH_OES:
+ case GL_RENDERBUFFER_HEIGHT_OES:
+ case GL_RENDERBUFFER_INTERNAL_FORMAT_OES:
+ case GL_RENDERBUFFER_RED_SIZE_OES:
+ case GL_RENDERBUFFER_GREEN_SIZE_OES:
+ case GL_RENDERBUFFER_BLUE_SIZE_OES:
+ case GL_RENDERBUFFER_ALPHA_SIZE_OES:
+ case GL_RENDERBUFFER_DEPTH_SIZE_OES:
+ case GL_RENDERBUFFER_STENCIL_SIZE_OES:
+ case GL_RENDERBUFFER_BINDING:
+ case GL_FRAMEBUFFER_BINDING:
+ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES:
+ case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES:
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES:
+ case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES:
+ case GL_FENCE_STATUS_NV:
+ case GL_FENCE_CONDITION_NV:
+ case GL_TEXTURE_WIDTH_QCOM:
+ case GL_TEXTURE_HEIGHT_QCOM:
+ case GL_TEXTURE_DEPTH_QCOM:
+ case GL_TEXTURE_INTERNAL_FORMAT_QCOM:
+ case GL_TEXTURE_FORMAT_QCOM:
+ case GL_TEXTURE_TYPE_QCOM:
+ case GL_TEXTURE_IMAGE_VALID_QCOM:
+ case GL_TEXTURE_NUM_LEVELS_QCOM:
+ case GL_TEXTURE_TARGET_QCOM:
+ case GL_TEXTURE_OBJECT_VALID_QCOM:
+ case GL_BLEND_EQUATION_RGB_OES:
+ case GL_BLEND_EQUATION_ALPHA_OES:
+ case GL_BLEND_DST_RGB_OES:
+ case GL_BLEND_SRC_RGB_OES:
+ case GL_BLEND_DST_ALPHA_OES:
+ case GL_BLEND_SRC_ALPHA_OES:
+ case GL_MAX_LIGHTS:
+ case GL_SHADER_TYPE:
+ case GL_DELETE_STATUS:
+ case GL_COMPILE_STATUS:
+ case GL_INFO_LOG_LENGTH:
+ case GL_SHADER_SOURCE_LENGTH:
+ case GL_CURRENT_PROGRAM:
+ case GL_LINK_STATUS:
+ case GL_VALIDATE_STATUS:
+ case GL_ATTACHED_SHADERS:
+ case GL_ACTIVE_UNIFORMS:
+ case GL_ACTIVE_ATTRIBUTES:
+ case GL_SUBPIXEL_BITS:
+ case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
+ case GL_NUM_SHADER_BINARY_FORMATS:
+ case GL_SHADER_COMPILER:
+ case GL_MAX_VERTEX_ATTRIBS:
+ case GL_MAX_VERTEX_UNIFORM_VECTORS:
+ case GL_MAX_VARYING_VECTORS:
+ case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
+ case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
+ case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
+ case GL_MAX_RENDERBUFFER_SIZE:
+ case GL_MAX_TEXTURE_IMAGE_UNITS:
+ case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
+ case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
+ case GL_LINE_WIDTH:
+ s = 1;
+ break;
+ case GL_ALIASED_LINE_WIDTH_RANGE:
+ case GL_ALIASED_POINT_SIZE_RANGE:
+ case GL_DEPTH_RANGE:
+ case GL_MAX_VIEWPORT_DIMS:
+ case GL_SMOOTH_POINT_SIZE_RANGE:
+ case GL_SMOOTH_LINE_WIDTH_RANGE:
+ s= 2;
+ break;
+ case GL_SPOT_DIRECTION:
+ case GL_POINT_DISTANCE_ATTENUATION:
+ case GL_CURRENT_NORMAL:
+ s = 3;
+ break;
+ case GL_CURRENT_VERTEX_ATTRIB:
+ case GL_CURRENT_TEXTURE_COORDS:
+ case GL_CURRENT_COLOR:
+ case GL_FOG_COLOR:
+ case GL_AMBIENT:
+ case GL_DIFFUSE:
+ case GL_SPECULAR:
+ case GL_EMISSION:
+ case GL_POSITION:
+ case GL_LIGHT_MODEL_AMBIENT:
+ case GL_TEXTURE_ENV_COLOR:
+ case GL_SCISSOR_BOX:
+ case GL_VIEWPORT:
+ case GL_TEXTURE_CROP_RECT_OES:
+ case GL_COLOR_CLEAR_VALUE:
+ case GL_COLOR_WRITEMASK:
+ case GL_AMBIENT_AND_DIFFUSE:
+ case GL_BLEND_COLOR:
+ s = 4;
+ break;
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ s = 16;
+ break;
+ default:
+ ERR("glUtilsParamSize: unknown param 0x%08x", param);
+ s = 1; // assume 1
+ }
+ return s;
+}
+
+void glUtilsPackPointerData(unsigned char *dst, unsigned char *src,
+ int size, GLenum type, unsigned int stride,
+ unsigned int datalen)
+{
+ unsigned int vsize = size * glSizeof(type);
+ if (stride == 0) stride = vsize;
+
+ if (stride == vsize) {
+ memcpy(dst, src, datalen);
+ } else {
+ for (unsigned int i = 0; i < datalen; i += vsize) {
+ memcpy(dst, src, vsize);
+ dst += vsize;
+ src += stride;
+ }
+ }
+}
+
+int glUtilsPixelBitSize(GLenum format, GLenum type)
+{
+ int components = 0;
+ int componentsize = 0;
+ int pixelsize = 0;
+ switch(type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ componentsize = 8;
+ break;
+ case GL_SHORT:
+ 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_RGB565_OES:
+ case GL_RGB5_A1_OES:
+ case GL_RGBA4_OES:
+ pixelsize = 16;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ case GL_FIXED:
+ case GL_UNSIGNED_INT_24_8_OES:
+ pixelsize = 32;
+ break;
+ default:
+ ERR("glUtilsPixelBitSize: unknown pixel type - assuming pixel data 0");
+ componentsize = 0;
+ }
+
+ if (pixelsize == 0) {
+ switch(format) {
+#if 0
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+#endif
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_STENCIL_OES:
+ components = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ components = 2;
+ break;
+ case GL_RGB:
+#if 0
+ case GL_BGR:
+#endif
+ components = 3;
+ break;
+ case GL_RGBA:
+ case GL_BGRA_EXT:
+ components = 4;
+ break;
+ default:
+ ERR("glUtilsPixelBitSize: unknown pixel format...");
+ components = 0;
+ }
+ pixelsize = components * componentsize;
+ }
+
+ return pixelsize;
+}
diff --git a/src/gfxstream/host/apigen-codec-common/glUtils.h b/src/gfxstream/host/apigen-codec-common/glUtils.h
new file mode 100644
index 00000000000..73c1912876a
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/glUtils.h
@@ -0,0 +1,41 @@
+/*
+* 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.
+*/
+#pragma once
+
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+size_t glSizeof(GLenum type);
+
+size_t glUtilsParamSize(GLenum param);
+
+void glUtilsPackPointerData(unsigned char *dst, unsigned char *str,
+ int size, GLenum type, unsigned int stride,
+ unsigned int datalen);
+
+int glUtilsPixelBitSize(GLenum format, GLenum type);
+
+#ifdef __cplusplus
+};
+#endif
diff --git a/src/gfxstream/host/apigen-codec-common/gl_base_types.h b/src/gfxstream/host/apigen-codec-common/gl_base_types.h
new file mode 100644
index 00000000000..70cb325ec63
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/gl_base_types.h
@@ -0,0 +1,65 @@
+/*
+* 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_BASE_TYPES__H
+#define __GL_BASE_TYPES__H
+
+#include <KHR/khrplatform.h>
+
+#ifndef gles1_APIENTRY
+#define gles1_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#ifndef gles2_APIENTRY
+#define gles2_APIENTRY KHRONOS_APIENTRY
+#endif
+
+typedef void GLvoid;
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef char GLchar;
+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;
+typedef char *GLstr;
+/* JR XXX Treating this as an in handle - is this correct? */
+typedef void * GLeglImageOES;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+
+/* ErrorCode */
+#ifndef GL_INVALID_ENUM
+#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
+#endif
+
+#endif
diff --git a/src/gfxstream/host/apigen-codec-common/meson.build b/src/gfxstream/host/apigen-codec-common/meson.build
new file mode 100644
index 00000000000..b6d862227e1
--- /dev/null
+++ b/src/gfxstream/host/apigen-codec-common/meson.build
@@ -0,0 +1,18 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_apigen_codec = include_directories('.')
+
+files_lib_apigen_codec = files(
+ 'ChecksumCalculator.cpp',
+ 'ChecksumCalculatorThreadInfo.cpp',
+ 'glUtils.cpp',
+)
+
+lib_apigen_codec = static_library(
+ 'apigen_codec',
+ files_lib_apigen_codec,
+ cpp_args: gfxstream_host_args,
+ include_directories: [inc_gfxstream_include, inc_include],
+ dependencies: [aemu_base_dep, aemu_common_dep]
+)
diff --git a/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressor.h b/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressor.h
new file mode 100644
index 00000000000..4823ee255e0
--- /dev/null
+++ b/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressor.h
@@ -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.
+#pragma once
+
+#include <memory>
+#include <string>
+
+namespace gfxstream {
+namespace vk {
+
+// This class is responsible for decompressing ASTC textures on the CPU.
+// This class is thread-safe and all its methods can be called by any thread.
+class AstcCpuDecompressor {
+ public:
+ // Returns the global singleton instance of this class.
+ static AstcCpuDecompressor& get();
+
+ virtual ~AstcCpuDecompressor() = default;
+
+ // Whether the ASTC decompressor is available. Reasons why it may not be available include:
+ // - It wasn't compiled on this platform.
+ // - The CPU doesn't support AVX2 instructions.
+ // If this returns false, decompress() will fail.
+ virtual bool available() const = 0;
+
+ // Decompress an ASTC texture.
+ //
+ // imgWidth, imgHeight: width and height of the texture, in texels.
+ // blockWidth, blockHeight: ASTC encoding block size.
+ // astData: pointer to the ASTC data to decompress
+ // astcDataLength: size of astData
+ // output: where to white the decompressed output. This buffer must be able to hold at least
+ // imgWidth * imgHeight * 4 bytes.
+ //
+ // Returns 0 on success, or a non-zero status code on error. Use getStatusString() to convert
+ // this status code to an error string.
+ virtual int32_t decompress(uint32_t imgWidth, uint32_t imgHeight, uint32_t blockWidth,
+ uint32_t blockHeight, const uint8_t* astcData,
+ size_t astcDataLength, uint8_t* output) = 0;
+
+ // Returns an error string for a given status code. Will always return non-null.
+ virtual const char* getStatusString(int32_t statusCode) const = 0;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressorImpl.cpp b/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressorImpl.cpp
new file mode 100644
index 00000000000..8013165be48
--- /dev/null
+++ b/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressorImpl.cpp
@@ -0,0 +1,282 @@
+// 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 <array>
+#include <future>
+#include <unordered_map>
+
+#include "AstcCpuDecompressor.h"
+#include "astcenc.h"
+
+namespace gfxstream {
+namespace vk {
+namespace {
+
+constexpr uint32_t kNumThreads = 2;
+
+const astcenc_swizzle kSwizzle = {ASTCENC_SWZ_R, ASTCENC_SWZ_G, ASTCENC_SWZ_B, ASTCENC_SWZ_A};
+
+// Used by std::unique_ptr to release the context when the pointer is destroyed
+struct AstcencContextDeleter {
+ void operator()(astcenc_context* c) { astcenc_context_free(c); }
+};
+
+using AstcencContextUniquePtr = std::unique_ptr<astcenc_context, AstcencContextDeleter>;
+
+// Creates a new astcenc_context and wraps it in a smart pointer.
+// It is not needed to call astcenc_context_free() on the returned pointer.
+// blockWith, blockSize: ASTC block size for the context
+// Error: (output param) Where to put the error status. Must not be null.
+// Returns nullptr in case of error.
+AstcencContextUniquePtr makeDecoderContext(uint32_t blockWidth, uint32_t blockHeight,
+ astcenc_error* error) {
+ astcenc_config config = {};
+ *error =
+ // TODO(gregschlom): Do we need to pass ASTCENC_PRF_LDR_SRGB here?
+ astcenc_config_init(ASTCENC_PRF_LDR, blockWidth, blockHeight, 1, ASTCENC_PRE_FASTEST,
+ ASTCENC_FLG_DECOMPRESS_ONLY, &config);
+ if (*error != ASTCENC_SUCCESS) {
+ return nullptr;
+ }
+
+ astcenc_context* context;
+ *error = astcenc_context_alloc(&config, kNumThreads, &context);
+ if (*error != ASTCENC_SUCCESS) {
+ return nullptr;
+ }
+ return AstcencContextUniquePtr(context);
+}
+
+
+#if !defined(__clang__) && defined(_MSC_VER)
+// AVX2 support detection for Visual Studio
+#include <intrin.h>
+bool cpuSupportsAvx2()
+{
+ int data[4];
+ __cpuid(data, 0);
+ if (data[0] >= 7) {
+ __cpuidex(data, 7, 0);
+ return data[1] & (1 << 5); // AVX2 = Bank 7, EBX, bit 5
+ }
+ return false;
+}
+#elif defined(__aarch64__)
+bool cpuSupportsAvx2()
+{
+ return false;
+}
+#else
+// AVX2 support detection for GCC and Clang
+#include <cpuid.h>
+bool cpuSupportsAvx2()
+{
+ unsigned int data[4];
+ if (__get_cpuid_count(7, 0, &data[0], &data[1], &data[2], &data[3])) {
+ return data[1] & (1 << 5); // AVX2 = Bank 7, EBX, bit 5
+ }
+ return false;
+}
+#endif
+
+// Returns whether the ASTC decoder can be used on this machine. It might not be available if the
+// CPU doesn't support AVX2 instructions for example. Since this call is a bit expensive and never
+// changes, the result should be cached.
+bool isAstcDecoderAvailable() {
+ if (!cpuSupportsAvx2()) return false;
+ astcenc_error error;
+ // Try getting an arbitrary context. If it works, the decoder is available.
+ auto context = makeDecoderContext(5, 5, &error);
+ return context != nullptr;
+}
+
+// Caches and manages astcenc_context objects.
+//
+// Each context is fairly large (around 30 MB) and takes a while to construct, so it's important to
+// reuse them as much as possible.
+//
+// While context objects can be reused across multiple threads, they must be used sequentially. To
+// avoid having to lock and manage access between threads, we keep one cache per thread. This avoids
+// any concurrency issues, at the cost of extra memory.
+//
+// Currently, there is no eviction strategy. Each cache could grow to a maximum of ~400 MB in size
+// since they are 13 possible ASTC block sizes.
+//
+// Thread-safety: not thread safe.
+class AstcDecoderContextCache {
+ public:
+ // Returns a context object for a given ASTC block size, along with the error code if the
+ // context initialization failed.
+ // In this case, the context will be null, and the status code will be non-zero.
+ std::pair<astcenc_context*, astcenc_error> get(uint32_t blockWidth, uint32_t blockHeight) {
+ Value& value = mContexts[{blockWidth, blockHeight}];
+ if (value.context == nullptr) {
+ value.context = makeDecoderContext(blockWidth, blockHeight, &value.error);
+ }
+ return {value.context.get(), value.error};
+ }
+
+ private:
+ // Holds the data we use as the cache key
+ struct Key {
+ uint32_t blockWidth;
+ uint32_t blockHeight;
+
+ bool operator==(const Key& other) const {
+ return blockWidth == other.blockWidth && blockHeight == other.blockHeight;
+ }
+ };
+
+ struct Value {
+ AstcencContextUniquePtr context = nullptr;
+ astcenc_error error = ASTCENC_SUCCESS;
+ };
+
+ // Computes the hash of a Key
+ struct KeyHash {
+ std::size_t operator()(const Key& k) const {
+ // blockWidth and blockHeight are < 256 (actually, < 16), so this is safe
+ return k.blockWidth << 8 | k.blockHeight;
+ }
+ };
+
+ std::unordered_map<Key, Value, KeyHash> mContexts;
+};
+
+// Thread-safety: all public methods are thread-safe
+class WorkerThread {
+ public:
+ explicit WorkerThread() : mThread(&WorkerThread::main, this) {}
+
+ // Terminates the thread. Call wait() to wait until the thread fully exits.
+ void terminate() {
+ std::lock_guard lock(mWorkerMutex);
+ mTerminated = true;
+ mWorkerCondition.notify_one();
+ }
+
+ // Blocks until the thread exits.
+ void wait() { mThread.join(); }
+
+ std::future<astcenc_error> decompress(astcenc_context* context, uint32_t threadIndex,
+ const uint8_t* data, size_t dataLength,
+ astcenc_image* image) {
+ std::lock_guard lock(mWorkerMutex);
+ mTask = std::packaged_task<astcenc_error()>{[=] {
+ return astcenc_decompress_image(context, data, dataLength, image, &kSwizzle,
+ threadIndex);
+ }};
+ mWorkerCondition.notify_one();
+ return mTask.get_future();
+ }
+
+ private:
+ // Thread's main loop
+ void main() {
+ while (true) {
+ std::packaged_task<astcenc_error()> task;
+ {
+ std::unique_lock lock(mWorkerMutex);
+ mWorkerCondition.wait(lock, [this] { return mTask.valid() || mTerminated; });
+ if (mTerminated) return;
+ task = std::move(mTask);
+ }
+ task();
+ }
+ }
+
+ bool mTerminated = false;
+ std::condition_variable mWorkerCondition = {}; // Signals availability of work
+ std::mutex mWorkerMutex = {}; // Mutex used with mWorkerCondition.
+ std::packaged_task<astcenc_error()> mTask = {};
+ std::thread mThread = {};
+};
+
+// Performs ASTC decompression of an image on the CPU
+class AstcCpuDecompressorImpl : public AstcCpuDecompressor {
+ public:
+ AstcCpuDecompressorImpl()
+ : AstcCpuDecompressor(), mContextCache(std::make_unique<AstcDecoderContextCache>()) {}
+
+ ~AstcCpuDecompressorImpl() override {
+ // Stop the worker threads, otherwise the process would hang upon exit.
+ std::lock_guard global_lock(mMutex);
+ for (auto& worker : mWorkerThreads) {
+ worker.terminate();
+ worker.wait();
+ }
+ }
+
+ bool available() const override {
+ static bool available = isAstcDecoderAvailable();
+ return available;
+ }
+
+ int32_t decompress(const uint32_t imgWidth, const uint32_t imgHeight, const uint32_t blockWidth,
+ const uint32_t blockHeight, const uint8_t* astcData, size_t astcDataLength,
+ uint8_t* output) override {
+ std::array<std::future<astcenc_error>, kNumThreads> futures;
+
+ std::lock_guard global_lock(mMutex);
+
+ auto [context, context_status] = mContextCache->get(blockWidth, blockHeight);
+ if (context_status != ASTCENC_SUCCESS) return context_status;
+
+ astcenc_image image = {
+ .dim_x = imgWidth,
+ .dim_y = imgHeight,
+ .dim_z = 1,
+ .data_type = ASTCENC_TYPE_U8,
+ .data = reinterpret_cast<void**>(&output),
+ };
+
+ for (uint32_t i = 0; i < kNumThreads; ++i) {
+ futures[i] = mWorkerThreads[i].decompress(context, i, astcData, astcDataLength, &image);
+ }
+
+ astcenc_error result = ASTCENC_SUCCESS;
+
+ // Wait for all threads to be done
+ for (auto& future : futures) {
+ astcenc_error status = future.get();
+ if (status != ASTCENC_SUCCESS) {
+ result = status;
+ }
+ }
+
+ astcenc_decompress_reset(context);
+
+ return result;
+ }
+
+ const char* getStatusString(int32_t statusCode) const override {
+ const char* msg = astcenc_get_error_string((astcenc_error)statusCode);
+ return msg ? msg : "ASTCENC_UNKNOWN_STATUS";
+ }
+
+ private:
+ std::unique_ptr<AstcDecoderContextCache> mContextCache;
+ std::mutex mMutex; // Locked while calling `decompress()`
+ std::array<WorkerThread, kNumThreads> mWorkerThreads;
+};
+
+} // namespace
+
+AstcCpuDecompressor& AstcCpuDecompressor::get() {
+ static AstcCpuDecompressorImpl instance;
+ return instance;
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressorNoOp.cpp b/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressorNoOp.cpp
new file mode 100644
index 00000000000..f0e4f32be0a
--- /dev/null
+++ b/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressorNoOp.cpp
@@ -0,0 +1,44 @@
+// 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 "AstcCpuDecompressor.h"
+
+namespace gfxstream {
+namespace vk {
+namespace {
+
+class AstcCpuDecompressorNoOp : public AstcCpuDecompressor {
+ public:
+ bool available() const override { return false; }
+
+ int32_t decompress(uint32_t imgWidth, uint32_t imgHeight, uint32_t blockWidth,
+ uint32_t blockHeight, const uint8_t* astcData, size_t astcDataLength,
+ uint8_t* output) override {
+ return -1;
+ };
+
+ const char* getStatusString(int32_t statusCode) const override {
+ return "ASTC CPU decomp not available";
+ }
+};
+
+} // namespace
+
+AstcCpuDecompressor& AstcCpuDecompressor::get() {
+ static AstcCpuDecompressorNoOp instance;
+ return instance;
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressor_unittest.cpp b/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressor_unittest.cpp
new file mode 100644
index 00000000000..319fe11ca64
--- /dev/null
+++ b/src/gfxstream/host/compressedTextureFormats/AstcCpuDecompressor_unittest.cpp
@@ -0,0 +1,78 @@
+// Copyright 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 <gmock/gmock.h>
+
+#include "AstcCpuDecompressor.h"
+
+namespace gfxstream {
+namespace vk {
+namespace {
+
+using ::testing::ElementsAreArray;
+using ::testing::NotNull;
+
+// 16x16 checkerboard pattern, compressed with 8x8 block size.
+const uint8_t kCheckerboard[] = {
+ 0x44, 0x05, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
+ 0x44, 0x05, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
+ 0x44, 0x05, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
+ 0x44, 0x05, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa};
+
+struct Rgba {
+ uint8_t r, g, b, a;
+ bool operator==(const Rgba& o) const { return r == o.r && g == o.g && b == o.b && a == o.a; }
+};
+
+TEST(AstcCpuDecompressor, Decompress) {
+ auto& decompressor = AstcCpuDecompressor::get();
+ if (!decompressor.available()) GTEST_SKIP() << "ASTC decompressor not available";
+
+ std::vector<Rgba> output(16 * 16);
+ int32_t status = decompressor.decompress(16, 16, 8, 8, kCheckerboard, sizeof(kCheckerboard),
+ (uint8_t*)output.data());
+ EXPECT_EQ(status, 0);
+
+ const Rgba W = {0xFF, 0xFF, 0xFF, 0xFF};
+ const Rgba B = {0, 0, 0, 0xFF};
+
+ std::vector<Rgba> expected = {
+ W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, // 0
+ B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, // 1
+ W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, // 2
+ B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, // 3
+ W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, // 4
+ B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, // 5
+ W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, // 6
+ B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, // 7
+ W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, // 8
+ B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, // 9
+ W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, // 10
+ B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, // 11
+ W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, // 12
+ B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, // 13
+ W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, // 14
+ B, W, B, W, B, W, B, W, B, W, B, W, B, W, B, W, // 15
+ };
+
+ ASSERT_THAT(output, ElementsAreArray(expected));
+}
+
+TEST(AstcCpuDecompressor, getStatusStringAlwaysNonNull) {
+ EXPECT_THAT(AstcCpuDecompressor::get().getStatusString(-10000), NotNull());
+}
+
+} // namespace
+} // namespace vk
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/compressedTextureFormats/meson.build b/src/gfxstream/host/compressedTextureFormats/meson.build
new file mode 100644
index 00000000000..e2e28a1b06f
--- /dev/null
+++ b/src/gfxstream/host/compressedTextureFormats/meson.build
@@ -0,0 +1,14 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_compressed_textures = files(
+ 'AstcCpuDecompressorNoOp.cpp',
+)
+
+lib_compressed_textures = static_library(
+ 'compressed_textures',
+ files_lib_compressed_textures,
+ cpp_args: gfxstream_host_args,
+ include_directories: [inc_etc],
+ link_with: [lib_etc],
+)
diff --git a/src/gfxstream/host/drm_fourcc.h b/src/gfxstream/host/drm_fourcc.h
new file mode 100644
index 00000000000..11912fde24b
--- /dev/null
+++ b/src/gfxstream/host/drm_fourcc.h
@@ -0,0 +1,411 @@
+/*
+ * Copyright 2011 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
+ * VA LINUX SYSTEMS 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 DRM_FOURCC_H
+#define DRM_FOURCC_H
+
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define fourcc_code(a, b, c, d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \
+ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
+
+#define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */
+
+/* color index */
+#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
+
+/* 8 bpp Red */
+#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
+
+/* 16 bpp Red */
+#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */
+
+/* 16 bpp RG */
+#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */
+#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */
+
+/* 32 bpp RG */
+#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */
+#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 little endian */
+
+/* 8 bpp RGB */
+#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */
+#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */
+
+/* 16 bpp RGB */
+#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */
+#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */
+#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */
+#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */
+
+#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */
+#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */
+#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */
+#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */
+
+#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */
+#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */
+#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */
+#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */
+
+#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */
+#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */
+#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */
+#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */
+
+#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */
+#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */
+
+/* 24 bpp RGB */
+#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */
+#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */
+
+/* 32 bpp RGB */
+#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */
+#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */
+#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */
+#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */
+
+#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */
+#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */
+#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */
+#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */
+
+#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */
+#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */
+#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */
+#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */
+
+#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */
+#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */
+#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */
+#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */
+
+/* packed YCbCr */
+#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */
+#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */
+#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */
+#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
+
+#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
+
+/*
+ * 2 plane RGB + A
+ * index 0 = RGB plane, same format as the corresponding non _A8 format has
+ * index 1 = A plane, [7:0] A
+ */
+#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8')
+#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8')
+#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8')
+#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8')
+#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8')
+#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8')
+#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8')
+#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8')
+
+/*
+ * 2 plane YCbCr
+ * index 0 = Y plane, [7:0] Y
+ * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian
+ * or
+ * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian
+ */
+#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */
+#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */
+#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */
+#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */
+#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */
+#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
+
+/*
+ * 3 plane YCbCr
+ * index 0: Y plane, [7:0] Y
+ * index 1: Cb plane, [7:0] Cb
+ * index 2: Cr plane, [7:0] Cr
+ * or
+ * index 1: Cr plane, [7:0] Cr
+ * index 2: Cb plane, [7:0] Cb
+ */
+#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */
+#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */
+#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */
+#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */
+#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */
+#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */
+#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */
+#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */
+#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */
+#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */
+
+
+/*
+ * Format Modifiers:
+ *
+ * Format modifiers describe, typically, a re-ordering or modification
+ * of the data in a plane of an FB. This can be used to express tiled/
+ * swizzled formats, or compression, or a combination of the two.
+ *
+ * The upper 8 bits of the format modifier are a vendor-id as assigned
+ * below. The lower 56 bits are assigned as vendor sees fit.
+ */
+
+/* Vendor Ids: */
+#define DRM_FORMAT_MOD_NONE 0
+#define DRM_FORMAT_MOD_VENDOR_NONE 0
+#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01
+#define DRM_FORMAT_MOD_VENDOR_AMD 0x02
+#define DRM_FORMAT_MOD_VENDOR_NVIDIA 0x03
+#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04
+#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05
+#define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06
+#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07
+/* add more to the end as needed */
+
+#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1)
+
+#define fourcc_mod_code(vendor, val) \
+ ((((uint64_t)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
+
+/*
+ * Format Modifier tokens:
+ *
+ * When adding a new token please document the layout with a code comment,
+ * similar to the fourcc codes above. drm_fourcc.h is considered the
+ * authoritative source for all of these.
+ */
+
+/*
+ * Invalid Modifier
+ *
+ * This modifier can be used as a sentinel to terminate the format modifiers
+ * list, or to initialize a variable with an invalid modifier. It might also be
+ * used to report an error back to userspace for certain APIs.
+ */
+#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED)
+
+/*
+ * Linear Layout
+ *
+ * Just plain linear layout. Note that this is different from no specifying any
+ * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the DRM_ADDFB2 ioctl),
+ * which tells the driver to also take driver-internal information into account
+ * and so might actually result in a tiled framebuffer.
+ */
+#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0)
+
+/* Intel framebuffer modifiers */
+
+/*
+ * Intel X-tiling layout
+ *
+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
+ * in row-major layout. Within the tile bytes are laid out row-major, with
+ * a platform-dependent stride. On top of that the memory can apply
+ * platform-depending swizzling of some higher address bits into bit6.
+ *
+ * This format is highly platforms specific and not useful for cross-driver
+ * sharing. It exists since on a given platform it does uniquely identify the
+ * layout in a simple way for i915-specific userspace.
+ */
+#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1)
+
+/*
+ * Intel Y-tiling layout
+ *
+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
+ * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes)
+ * chunks column-major, with a platform-dependent height. On top of that the
+ * memory can apply platform-depending swizzling of some higher address bits
+ * into bit6.
+ *
+ * This format is highly platforms specific and not useful for cross-driver
+ * sharing. It exists since on a given platform it does uniquely identify the
+ * layout in a simple way for i915-specific userspace.
+ */
+#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2)
+
+/*
+ * Intel Yf-tiling layout
+ *
+ * This is a tiled layout using 4Kb tiles in row-major layout.
+ * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which
+ * are arranged in four groups (two wide, two high) with column-major layout.
+ * Each group therefore consits out of four 256 byte units, which are also laid
+ * out as 2x2 column-major.
+ * 256 byte units are made out of four 64 byte blocks of pixels, producing
+ * either a square block or a 2:1 unit.
+ * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the width
+ * in pixel depends on the pixel depth.
+ */
+#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3)
+
+/*
+ * Intel color control surface (CCS) for render compression
+ *
+ * The framebuffer format must be one of the 8:8:8:8 RGB formats.
+ * The main surface will be plane index 0 and must be Y/Yf-tiled,
+ * the CCS will be plane index 1.
+ *
+ * Each CCS tile matches a 1024x512 pixel area of the main surface.
+ * To match certain aspects of the 3D hardware the CCS is
+ * considered to be made up of normal 128Bx32 Y tiles, Thus
+ * the CCS pitch must be specified in multiples of 128 bytes.
+ *
+ * In reality the CCS tile appears to be a 64Bx64 Y tile, composed
+ * of QWORD (8 bytes) chunks instead of OWORD (16 bytes) chunks.
+ * But that fact is not relevant unless the memory is accessed
+ * directly.
+ */
+#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4)
+#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5)
+
+/*
+ * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
+ *
+ * Macroblocks are laid in a Z-shape, and each pixel data is following the
+ * standard NV12 style.
+ * As for NV12, an image is the result of two frame buffers: one for Y,
+ * one for the interleaved Cb/Cr components (1/2 the height of the Y buffer).
+ * Alignment requirements are (for each buffer):
+ * - multiple of 128 pixels for the width
+ * - multiple of 32 pixels for the height
+ *
+ * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html
+ */
+#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
+
+/* Vivante framebuffer modifiers */
+
+/*
+ * Vivante 4x4 tiling layout
+ *
+ * This is a simple tiled layout using tiles of 4x4 pixels in a row-major
+ * layout.
+ */
+#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1)
+
+/*
+ * Vivante 64x64 super-tiling layout
+ *
+ * This is a tiled layout using 64x64 pixel super-tiles, where each super-tile
+ * contains 8x4 groups of 2x4 tiles of 4x4 pixels (like above) each, all in row-
+ * major layout.
+ *
+ * For more information: see
+ * https://github.com/etnaviv/etna_viv/blob/master/doc/hardware.md#texture-tiling
+ */
+#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2)
+
+/*
+ * Vivante 4x4 tiling layout for dual-pipe
+ *
+ * Same as the 4x4 tiling layout, except every second 4x4 pixel tile starts at a
+ * different base address. Offsets from the base addresses are therefore halved
+ * compared to the non-split tiled layout.
+ */
+#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3)
+
+/*
+ * Vivante 64x64 super-tiling layout for dual-pipe
+ *
+ * Same as the 64x64 super-tiling layout, except every second 4x4 pixel tile
+ * starts at a different base address. Offsets from the base addresses are
+ * therefore halved compared to the non-split super-tiled layout.
+ */
+#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4)
+
+/* NVIDIA frame buffer modifiers */
+
+/*
+ * Tegra Tiled Layout, used by Tegra 2, 3 and 4.
+ *
+ * Pixels are arranged in simple tiles of 16 x 16 bytes.
+ */
+#define DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED fourcc_mod_code(NVIDIA, 1)
+
+/*
+ * 16Bx2 Block Linear layout, used by desktop GPUs, and Tegra K1 and later
+ *
+ * Pixels are arranged in 64x8 Groups Of Bytes (GOBs). GOBs are then stacked
+ * vertically by a power of 2 (1 to 32 GOBs) to form a block.
+ *
+ * Within a GOB, data is ordered as 16B x 2 lines sectors laid in Z-shape.
+ *
+ * Parameter 'v' is the log2 encoding of the number of GOBs stacked vertically.
+ * Valid values are:
+ *
+ * 0 == ONE_GOB
+ * 1 == TWO_GOBS
+ * 2 == FOUR_GOBS
+ * 3 == EIGHT_GOBS
+ * 4 == SIXTEEN_GOBS
+ * 5 == THIRTYTWO_GOBS
+ *
+ * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format
+ * in full detail.
+ */
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(v) \
+ fourcc_mod_code(NVIDIA, 0x10 | ((v) & 0xf))
+
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB \
+ fourcc_mod_code(NVIDIA, 0x10)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB \
+ fourcc_mod_code(NVIDIA, 0x11)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB \
+ fourcc_mod_code(NVIDIA, 0x12)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB \
+ fourcc_mod_code(NVIDIA, 0x13)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB \
+ fourcc_mod_code(NVIDIA, 0x14)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB \
+ fourcc_mod_code(NVIDIA, 0x15)
+
+/*
+ * Broadcom VC4 "T" format
+ *
+ * This is the primary layout that the V3D GPU can texture from (it
+ * can't do linear). The T format has:
+ *
+ * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4
+ * pixels at 32 bit depth.
+ *
+ * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually
+ * 16x16 pixels).
+ *
+ * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On
+ * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows
+ * they're (TR, BR, BL, TL), where bottom left is start of memory.
+ *
+ * - an image made of 4k tiles in rows either left-to-right (even rows of 4k
+ * tiles) or right-to-left (odd rows of 4k tiles).
+ */
+#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1)
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* DRM_FOURCC_H */
diff --git a/src/gfxstream/host/gfxstream_unittest.cpp b/src/gfxstream/host/gfxstream_unittest.cpp
new file mode 100644
index 00000000000..e4a47525a5a
--- /dev/null
+++ b/src/gfxstream/host/gfxstream_unittest.cpp
@@ -0,0 +1,207 @@
+// 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 <gtest/gtest.h>
+
+#include <vector>
+
+#include "OSWindow.h"
+#include "aemu/base/system/System.h"
+#include "host-common/testing/MockGraphicsAgentFactory.h"
+#include "virgl_hw.h"
+#include "gfxstream/virtio-gpu-gfxstream-renderer-unstable.h"
+#include "gfxstream/virtio-gpu-gfxstream-renderer.h"
+
+using android::base::sleepMs;
+
+class GfxStreamBackendTest : public ::testing::Test {
+private:
+ static void sWriteFence(void* cookie, struct stream_renderer_fence* fence) {
+ uint32_t current = *(uint32_t*)cookie;
+ if (current < fence->fence_id) *(uint64_t*)(cookie) = fence->fence_id;
+ }
+
+protected:
+ uint32_t cookie;
+ static const bool useWindow;
+ std::vector<stream_renderer_param> streamRendererParams;
+ std::vector<stream_renderer_param> minimumRequiredParams;
+ static constexpr uint32_t width = 256;
+ static constexpr uint32_t height = 256;
+ static std::unique_ptr<OSWindow> window;
+ static constexpr int rendererFlags = STREAM_RENDERER_FLAGS_USE_GLES_BIT;
+ static constexpr int surfacelessFlags = STREAM_RENDERER_FLAGS_USE_SURFACELESS_BIT;
+
+ GfxStreamBackendTest()
+ : cookie(0),
+ streamRendererParams{{STREAM_RENDERER_PARAM_USER_DATA,
+ static_cast<uint64_t>(reinterpret_cast<uintptr_t>(&cookie))},
+ {STREAM_RENDERER_PARAM_FENCE_CALLBACK,
+ static_cast<uint64_t>(reinterpret_cast<uintptr_t>(&sWriteFence))},
+ {STREAM_RENDERER_PARAM_RENDERER_FLAGS, surfacelessFlags},
+ {STREAM_RENDERER_PARAM_WIN0_WIDTH, width},
+ {STREAM_RENDERER_PARAM_WIN0_HEIGHT, height}},
+ minimumRequiredParams{{STREAM_RENDERER_PARAM_USER_DATA,
+ static_cast<uint64_t>(reinterpret_cast<uintptr_t>(&cookie))},
+ {STREAM_RENDERER_PARAM_FENCE_CALLBACK,
+ static_cast<uint64_t>(reinterpret_cast<uintptr_t>(&sWriteFence))},
+ {STREAM_RENDERER_PARAM_RENDERER_FLAGS, surfacelessFlags}} {}
+
+ static void SetUpTestSuite() {
+ android::emulation::injectGraphicsAgents(android::emulation::MockGraphicsAgentFactory());
+ if (useWindow) {
+ window.reset(CreateOSWindow());
+ }
+ }
+
+ static void TearDownTestSuite() { window.reset(nullptr); }
+
+ void SetUp() override {
+ android::base::setEnvironmentVariable("ANDROID_GFXSTREAM_EGL", "1");
+ if (useWindow) {
+ window->initialize("GfxStreamBackendTestWindow", width, height);
+ window->setVisible(true);
+ window->messageLoop();
+ }
+ }
+
+ void TearDown() override {
+ // Ensure background threads aren't mid-initialization.
+ sleepMs(100);
+ if (useWindow) {
+ window->destroy();
+ }
+ stream_renderer_teardown();
+ }
+};
+
+std::unique_ptr<OSWindow> GfxStreamBackendTest::window = nullptr;
+
+const bool GfxStreamBackendTest::useWindow =
+ android::base::getEnvironmentVariable("ANDROID_EMU_TEST_WITH_WINDOW") == "1";
+
+TEST_F(GfxStreamBackendTest, Init) {
+ stream_renderer_init(streamRendererParams.data(), streamRendererParams.size());
+}
+
+TEST_F(GfxStreamBackendTest, InitOpenGLWindow) {
+ if (!useWindow) {
+ return;
+ }
+
+ std::vector<stream_renderer_param> glParams = streamRendererParams;
+ for (auto& param: glParams) {
+ if (param.key == STREAM_RENDERER_PARAM_RENDERER_FLAGS) {
+ param.value = rendererFlags;
+ }
+ }
+ stream_renderer_init(glParams.data(), glParams.size());
+ gfxstream_backend_setup_window(window->getFramebufferNativeWindow(), 0, 0,
+ width, height, width, height);
+}
+
+TEST_F(GfxStreamBackendTest, SimpleFlush) {
+ stream_renderer_init(streamRendererParams.data(), streamRendererParams.size());
+
+ const uint32_t res_id = 8;
+ struct stream_renderer_resource_create_args create_resource_args = {
+ .handle = res_id,
+ .target = 2, // PIPE_TEXTURE_2D
+ .format = VIRGL_FORMAT_R8G8B8A8_UNORM,
+ .bind = VIRGL_BIND_SAMPLER_VIEW | VIRGL_BIND_SCANOUT | VIRGL_BIND_SHARED,
+ .width = width,
+ .height = height,
+ .depth = 1,
+ .array_size = 1,
+ .last_level = 0,
+ .nr_samples = 0,
+ .flags = 0,
+ };
+ EXPECT_EQ(stream_renderer_resource_create(&create_resource_args, NULL, 0), 0);
+ // R8G8B8A8 is used, so 4 bytes per pixel
+ auto fb = std::make_unique<uint32_t[]>(width * height);
+ EXPECT_NE(fb, nullptr);
+ stream_renderer_flush(res_id);
+}
+
+// Tests compile and link only.
+TEST_F(GfxStreamBackendTest, DISABLED_ApiCallLinkTest) {
+ stream_renderer_init(streamRendererParams.data(), streamRendererParams.size());
+
+ const uint32_t res_id = 8;
+ struct stream_renderer_resource_create_args create_resource_args = {
+ .handle = res_id,
+ .target = 2, // PIPE_TEXTURE_2D
+ .format = VIRGL_FORMAT_R8G8B8A8_UNORM,
+ .bind = VIRGL_BIND_SAMPLER_VIEW | VIRGL_BIND_SCANOUT | VIRGL_BIND_SHARED,
+ .width = width,
+ .height = height,
+ .depth = 1,
+ .array_size = 1,
+ .last_level = 0,
+ .nr_samples = 0,
+ .flags = 0,
+ };
+ EXPECT_EQ(stream_renderer_resource_create(&create_resource_args, NULL, 0), 0);
+ struct stream_renderer_command cmd;
+ cmd.ctx_id = 0;
+ cmd.cmd = nullptr;
+ cmd.cmd_size = 0;
+
+ // R8G8B8A8 is used, so 4 bytes per pixel
+ auto fb = std::make_unique<uint32_t[]>(width * height);
+ EXPECT_NE(fb, nullptr);
+ stream_renderer_flush(res_id);
+ stream_renderer_resource_unref(0);
+ stream_renderer_context_create(0, 0, NULL, 0);
+ stream_renderer_context_destroy(0);
+ stream_renderer_submit_cmd(&cmd);
+ stream_renderer_transfer_read_iov(0, 0, 0, 0, 0, 0, 0, 0, 0);
+ stream_renderer_transfer_write_iov(0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ stream_renderer_get_cap_set(0, 0, 0);
+ stream_renderer_fill_caps(0, 0, 0);
+
+ stream_renderer_resource_attach_iov(0, 0, 0);
+ stream_renderer_resource_detach_iov(0, 0, 0);
+ stream_renderer_create_fence(NULL);
+ stream_renderer_ctx_attach_resource(0, 0);
+ stream_renderer_ctx_detach_resource(0, 0);
+ stream_renderer_resource_get_info(0, 0);
+}
+
+TEST_F(GfxStreamBackendTest, MinimumRequiredParameters) {
+ // Only the minimum required parameters.
+ int initResult =
+ stream_renderer_init(minimumRequiredParams.data(), minimumRequiredParams.size());
+ EXPECT_EQ(initResult, 0);
+}
+
+TEST_F(GfxStreamBackendTest, MissingRequiredParameter) {
+ for (size_t i = 0; i < minimumRequiredParams.size(); ++i) {
+ // For each parameter, remove it and try to init, expecting failure.
+ std::vector<stream_renderer_param> insufficientParams = minimumRequiredParams;
+ insufficientParams.erase(insufficientParams.begin() + i);
+ int initResult = stream_renderer_init(insufficientParams.data(), insufficientParams.size());
+ EXPECT_NE(initResult, 0);
+
+ // Ensure background threads aren't mid-initialization.
+ sleepMs(100);
+ stream_renderer_teardown();
+ }
+
+ // Initialize once more for the teardown function.
+ int initResult = stream_renderer_init(streamRendererParams.data(), streamRendererParams.size());
+ EXPECT_EQ(initResult, 0);
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/EmuglBackendList.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/EmuglBackendList.h
new file mode 100644
index 00000000000..76b3d25d3f2
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/EmuglBackendList.h
@@ -0,0 +1,72 @@
+// Copyright 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.
+
+#pragma once
+
+#include <string>
+#include <vector>
+
+namespace android {
+namespace opengl {
+
+class EmuglBackendList {
+public:
+ // Parse the content of |execDir|/<lib>/ for Emugl backends.
+ // |programBitness| can be 0 (autodetect), 32 or 64, and determines
+ // the value of <lib> which will be 'lib' for 32-bit systems,
+ // and 'lib64' for 64-bit ones.
+ EmuglBackendList(const char* execDir, int programBitness);
+
+ // Create a backend list with a fixed list of names
+ EmuglBackendList(int programBitness, const std::vector<std::string>& names);
+
+ // Return the name of the default Emugl backend.
+ const std::string& defaultName() const { return mDefaultName; }
+
+ // Return the list of installed Emugl backends.
+ const std::vector<std::string>& names() const { return mNames; }
+
+ // Returns true if |name| is part of names().
+ bool contains(const char* name) const;
+
+ // Convert the name of an Emugl backend into the path of the
+ // corresponding sub-directory, if it exits, or NULL otherwise.
+ std::string getLibDirPath(const char* name);
+
+ // List of supported Emugl shared libraries.
+ enum Library {
+ LIBRARY_NONE,
+ LIBRARY_EGL,
+ LIBRARY_GLESv1,
+ LIBRARY_GLESv2,
+ LIBRARY_GLES12TR
+ };
+
+ // Probe the library directory for Emugl backend |name| and return
+ // the path of one of the EmuGL shared libraries for it. The result
+ // will be empty if there is no such library.
+ // |library| is a library type. On success, return true and sets
+ // |*libPath| to the library's path value. On failure, return false.
+ bool getBackendLibPath(const char* name, Library library,
+ std::string* libPath);
+
+private:
+ std::string mDefaultName;
+ std::vector<std::string> mNames;
+ int mProgramBitness;
+ std::string mExecDir;
+};
+
+} // namespace opengl
+} // namespace android
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/GLProcessPipe.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/GLProcessPipe.h
new file mode 100644
index 00000000000..f05d3ad96e6
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/GLProcessPipe.h
@@ -0,0 +1,29 @@
+// Copyright 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.
+#pragma once
+
+#include <functional>
+
+namespace android {
+namespace opengl {
+
+// registerGLProcessPipeService() registers a "GLProcessPipe" pipe service that is
+// used to detect GL process exits.
+void registerGLProcessPipeService();
+
+void forEachProcessPipeId(std::function<void(uint64_t)>);
+void forEachProcessPipeIdRunAndErase(std::function<void(uint64_t)>);
+
+} // namespace opengl
+} // namespace android
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/GpuFrameBridge.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/GpuFrameBridge.h
new file mode 100644
index 00000000000..03bc1d51368
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/GpuFrameBridge.h
@@ -0,0 +1,77 @@
+// 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.
+
+#pragma once
+
+#include <cstdint>
+
+class Looper;
+namespace android {
+
+namespace base {
+class Looper;
+} // namespace base
+
+namespace opengl {
+
+// GpuFrameBridge is a helper class to forward Gpu frame to its clients.
+// Usage is the following:
+// 1) Create a new GpuFrameBridge instance.
+// 2) Register the FrameAvailableCallback if needed.
+// 3) Call getRecordFrame or getRecordFrameAsync to receive frame.
+class GpuFrameBridge {
+public:
+ // Create a new GpuFrameBridge instance.
+ static GpuFrameBridge* create();
+
+ // Destructor
+ virtual ~GpuFrameBridge() {}
+
+ // Post callback (synchronous) specifically for recording purposes.
+ virtual void postRecordFrame(int width, int height, const void* pixels) = 0;
+
+ // Async version of postRecordFrame for use with async readback.
+ // Does not read the frame immediately.
+ virtual void postRecordFrameAsync(int width,
+ int height,
+ const void* pixels) = 0;
+
+ // Returns the currently displayed frame. This method is designed only for
+ // recording. Returns null if there is no frame available. Make sure to
+ // attach the postFrameRecording() as the callback or you will not get a
+ // valid frame.
+ virtual void* getRecordFrame() = 0;
+
+ // Async version of getRecordFrame.
+ virtual void* getRecordFrameAsync() = 0;
+
+ // Invalidates the recording buffers. Once called, getRecordFrame() and it's
+ // async version will return null until new data has been posted.
+ virtual void invalidateRecordingBuffers() = 0;
+
+ typedef void (*FrameAvailableCallback)(void* opaque);
+
+ virtual void setFrameReceiver(FrameAvailableCallback receiver, void* opaque) = 0;
+
+ virtual void setDisplayId(uint32_t displayId) = 0;
+
+ // virtual void setLooper(android::base::Looper* aLooper) = 0;
+
+protected:
+ GpuFrameBridge() {}
+ GpuFrameBridge(const GpuFrameBridge& other);
+};
+
+} // namespace opengl
+} // namespace android
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/NativeGpuInfo.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/NativeGpuInfo.h
new file mode 100644
index 00000000000..d5b96e0bff8
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/NativeGpuInfo.h
@@ -0,0 +1,21 @@
+// 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.
+
+#pragma once
+
+#include "gpuinfo.h"
+
+void getGpuInfoListNative(GpuInfoList*);
+
+bool isVulkanSafeToUseNative();
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/OpenglEsPipe.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/OpenglEsPipe.h
new file mode 100644
index 00000000000..b444f5ebb95
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/OpenglEsPipe.h
@@ -0,0 +1,22 @@
+// Copyright 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.
+#pragma once
+
+namespace android {
+namespace opengl {
+
+void registerPipeService();
+
+} // namespace opengl
+} // namespace android
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/emugl_config.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/emugl_config.h
new file mode 100644
index 00000000000..f08e4ce09d4
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/emugl_config.h
@@ -0,0 +1,155 @@
+// Copyright 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.
+
+#pragma once
+
+#include "aemu/base/c_header.h"
+#include "aemu/base/export.h"
+// #include "android/skin/winsys.h"
+
+#include <stdbool.h>
+
+ANDROID_BEGIN_HEADER
+
+// List of values describing how EGL/GLES emulation should work in a given
+// Android virtual device.
+//
+// kAndroidGlesEmulationOff
+// Means there is no GPU emulation, equivalent to "-gpu off" and instructs
+// the guest system to use its old GLES 1.x software renderer.
+//
+// kAndroidGlesEmulationHost
+// Means Host GPU emulation is being used. All EGL/GLES commands are
+// sent to the host GPU or CPU through a simple wire protocol. This
+// corresponds to "-gpu host" and "-gpu mesa".
+//
+// kAndroidGlesEmulationGuest
+// Means a guest GLES 2.x library (e.g. SwiftShader) is being used in
+// the guest. This should only be used with accelerated emulation, or
+// results will be very very slow.
+typedef enum {
+ kAndroidGlesEmulationOff = 0,
+ kAndroidGlesEmulationHost,
+ kAndroidGlesEmulationGuest,
+} AndroidGlesEmulationMode;
+// A small structure used to model the EmuGL configuration
+// to use.
+// |enabled| is true if GPU emulation is enabled, false otherwise.
+// |backend| contains the name of the backend to use, if |enabled|
+// is true.
+// |status| is a string used to report error or the current status
+// of EmuGL emulation.
+typedef struct {
+ bool enabled;
+ bool use_backend;
+ int bitness;
+ char backend[64];
+ char status[256];
+ bool use_host_vulkan;
+} EmuglConfig;
+
+// Check whether or not the host GPU is blacklisted. If so, fall back
+// to software rendering.
+bool isHostGpuBlacklisted();
+
+typedef struct {
+ char* make;
+ char* model;
+ char* device_id;
+ char* revision_id;
+ char* version;
+ char* renderer;
+} emugl_host_gpu_props;
+
+typedef struct {
+ int num_gpus;
+ emugl_host_gpu_props* props;
+} emugl_host_gpu_prop_list;
+
+// Get a description of host GPU properties.
+// Need to free after use.
+emugl_host_gpu_prop_list emuglConfig_get_host_gpu_props();
+
+// Enum tracking all current available renderer backends
+// for the emulator.
+typedef enum SelectedRenderer {
+ SELECTED_RENDERER_UNKNOWN = 0,
+ SELECTED_RENDERER_HOST = 1,
+ SELECTED_RENDERER_OFF = 2,
+ SELECTED_RENDERER_GUEST = 3,
+ SELECTED_RENDERER_MESA = 4,
+ SELECTED_RENDERER_SWIFTSHADER = 5,
+ SELECTED_RENDERER_ANGLE = 6, // ANGLE D3D11 with D3D9 fallback
+ SELECTED_RENDERER_ANGLE9 = 7, // ANGLE forced to D3D9
+ SELECTED_RENDERER_SWIFTSHADER_INDIRECT = 8,
+ SELECTED_RENDERER_ANGLE_INDIRECT = 9,
+ SELECTED_RENDERER_ANGLE9_INDIRECT = 10,
+ SELECTED_RENDERER_ERROR = 255,
+} SelectedRenderer;
+
+enum GrallocImplementation { MINIGBM, GOLDFISH_GRALLOC };
+
+// Returns SelectedRenderer value the selected gpu mode.
+// Assumes that the -gpu command line option
+// has been taken into account already.
+SelectedRenderer emuglConfig_get_renderer(const char* gpu_mode);
+
+// Returns the renderer that is active, after config is done.
+SelectedRenderer emuglConfig_get_current_renderer();
+
+// Returns the '-gpu <mode>' option. If '-gpu <mode>' option is NULL, returns
+// the hw.gpu.mode hardware property.
+const char* emuglConfig_get_user_gpu_option();
+
+// Returns a string representation of the renderer enum. Return value is a
+// static constant string, it is NOT heap-allocated.
+const char* emuglConfig_renderer_to_string(SelectedRenderer renderer);
+
+// Returns if the current renderer supports snapshot.
+bool emuglConfig_current_renderer_supports_snapshot();
+
+void free_emugl_host_gpu_props(emugl_host_gpu_prop_list props);
+
+// Initialize an EmuglConfig instance based on the AVD's hardware properties
+// and the command-line -gpu option, if any.
+//
+// |config| is the instance to initialize.
+// |gpu_enabled| is the value of the hw.gpu.enabled hardware property.
+// |gpu_mode| is the value of the hw.gpu.mode hardware property.
+// |gpu_option| is the value of the '-gpu <mode>' option, or NULL.
+// |bitness| is the host bitness (0, 32 or 64).
+// |no_window| is true if the '-no-window' emulator flag was used.
+// |blacklisted| is true if the GPU driver is on the list of
+// crashy GPU drivers.
+// |use_host_vulkan| is true if the '-use-host-vulkan' emulator flag was used.
+//
+// Returns true on success, or false if there was an error (e.g. bad
+// mode or option value), in which case the |status| field will contain
+// a small error message.
+AEMU_EXPORT bool emuglConfig_init(EmuglConfig* config,
+ bool gpu_enabled,
+ const char* gpu_mode,
+ const char* gpu_option,
+ int bitness,
+ bool no_window,
+ bool blacklisted,
+ bool google_apis,
+ int uiPreferredBackend,
+ bool use_host_vulkan);
+
+// Setup GPU emulation according to a given |backend|.
+// |bitness| is the host bitness, and can be 0 (autodetect), 32 or 64.
+AEMU_EXPORT void emuglConfig_setupEnv(const EmuglConfig* config);
+
+ANDROID_END_HEADER
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/gpuinfo.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/gpuinfo.h
new file mode 100644
index 00000000000..a00d7b07fac
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/gpuinfo.h
@@ -0,0 +1,135 @@
+// Copyright 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.
+#pragma once
+
+#include "aemu/base/Compiler.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string>
+#include <string.h>
+#include <vector>
+
+// gpuinfo is designed to collect information about the GPUs
+// installed on the host system for the purposes of
+// automatically determining which renderer to select,
+// in the cases where the GPU drivers are known to have issues
+// running the emulator.
+
+// The main entry points:
+
+// host_gpu_blacklisted_async() does the two steps above,
+// but on a different thread, with a timeout in case
+// the started processes hang or what not.
+void async_query_host_gpu_start();
+bool async_query_host_gpu_blacklisted();
+bool async_query_host_gpu_AngleWhitelisted();
+bool async_query_host_gpu_SyncBlacklisted();
+bool async_query_host_gpu_VulkanBlacklisted();
+
+// Below is the implementation.
+
+struct GpuInfoView{
+ const char* make;
+ const char* model;
+ const char* device_id;
+ const char* revision_id;
+ const char* version;
+ const char* renderer;
+ const char* os;
+};
+// We keep a blacklist of known crashy GPU drivers
+// as a static const list with items of this type:
+using BlacklistEntry = GpuInfoView;
+// We keep a whitelist to use Angle for buggy
+// GPU drivers
+using WhitelistEntry = GpuInfoView;
+
+// GpuInfo/GpuInfoList are the representation of parsed information
+// about the system's GPU.s
+class GpuInfo {
+public:
+ GpuInfo() : current_gpu(false) { }
+ GpuInfo(const std::string& _make,
+ const std::string& _model,
+ const std::string& _device_id,
+ const std::string& _revision_id,
+ const std::string& _version,
+ const std::string& _renderer) :
+ current_gpu(false),
+ make(_make),
+ model(_model),
+ device_id(_device_id),
+ revision_id(_revision_id),
+ version(_version),
+ renderer(_renderer) { }
+
+ bool current_gpu;
+
+ void addDll(std::string dll_str);
+
+ std::string make;
+ std::string model;
+ std::string device_id;
+ std::string revision_id;
+ std::string version;
+ std::string renderer;
+
+ std::vector<std::string> dlls;
+ std::string os;
+};
+
+class GpuInfoList {
+public:
+ GpuInfoList() = default;
+ void addGpu();
+ GpuInfo& currGpu();
+ std::string dump() const;
+ void clear();
+
+ std::vector<GpuInfo> infos;
+
+ bool blacklist_status = false;
+ bool Anglelist_status = false;
+ bool SyncBlacklist_status = false;
+ bool VulkanBlacklist_status = false;
+
+ DISALLOW_COPY_ASSIGN_AND_MOVE(GpuInfoList);
+};
+
+// Below are helper functions that can be useful in various
+// contexts (e.g., unit testing).
+
+// gpuinfo_query_blacklist():
+// Function to query a given blacklist of GPU's.
+// The blacklist |list| (of length |size|) attempts
+// to match all non-NULL entry fields exactly against
+// info of all GPU's in |gpulist|. If there is any match,
+// the host system is considered on the blacklist.
+// (Null blacklist entry fields are ignored and
+// essentially act as wildcards).
+bool gpuinfo_query_blacklist(GpuInfoList* gpulist,
+ const BlacklistEntry* list,
+ int size);
+
+// Platform-specific information parsing functions.
+void parse_gpu_info_list_linux(const std::string& contents, GpuInfoList* gpulist);
+void parse_gpu_info_list_windows(const std::string& contents, GpuInfoList* gpulist);
+
+// If we actually switched to software, call this.
+void setGpuBlacklistStatus(bool switchedToSoftware);
+
+// Return a fully loaded global GPU info list.
+const GpuInfoList& globalGpuInfoList();
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/logger.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/logger.h
new file mode 100644
index 00000000000..8cf0975e92d
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/logger.h
@@ -0,0 +1,45 @@
+// Copyright 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.
+
+#pragma once
+
+// The purpose of the OpenGL logger is to log
+// information about such things as EGL initialization
+// and possibly miscellanous OpenGL commands,
+// in order to get a better idea of what is going on
+// in crash reports.
+
+// Flags for controlling fine logging and printing to stdout.
+typedef enum {
+ // Default logging settings
+ // (coarse log active, sent to crash server, no fine logging)
+ OPENGL_LOGGER_NONE = 0,
+
+ // Log GL API calls and timestamps at fine grained level.
+ OPENGL_LOGGER_DO_FINE_LOGGING = (1 << 0),
+
+ // Print GL logs to stdout. For fine logs, do not print to storage if this flag is active.
+ OPENGL_LOGGER_PRINT_TO_STDOUT = (1 << 1),
+} AndroidOpenglLoggerFlags;
+
+// C interface for android-emugl
+void android_init_opengl_logger();
+void android_opengl_logger_set_flags(AndroidOpenglLoggerFlags flags);
+void android_opengl_logger_write(const char* fmt, ...);
+void android_stop_opengl_logger();
+
+// This is for logging what goes on in individual OpenGL
+// contexts (cxts). Only called when emugl is compiled
+// with -DOPENGL_DEBUG_PRINTOUT.
+void android_opengl_cxt_logger_write(const char* fmt, ...);
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/macTouchOpenGL.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/macTouchOpenGL.h
new file mode 100644
index 00000000000..f7fa45ab1ea
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/macTouchOpenGL.h
@@ -0,0 +1,23 @@
+// 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.
+
+#pragma once
+
+#include "aemu/base/c_header.h"
+
+ANDROID_BEGIN_HEADER
+
+void macTouchOpenGL();
+
+ANDROID_END_HEADER
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/misc.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/misc.h
new file mode 100644
index 00000000000..ece78788c64
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengl/misc.h
@@ -0,0 +1,60 @@
+// 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 "host-common/opengl/emugl_config.h"
+
+#ifdef _MSC_VER
+# ifdef BUILDING_EMUGL_COMMON_SHARED
+# define EMUGL_COMMON_API __declspec(dllexport)
+# else
+# define EMUGL_COMMON_API __declspec(dllimport)
+#endif
+#else
+# define EMUGL_COMMON_API
+#endif
+
+namespace android {
+
+namespace base {
+
+class GLObjectCounter;
+
+} // namespace base
+} // namespace android
+
+namespace emugl {
+ // Set/get GLES major/minor version.
+ EMUGL_COMMON_API void setGlesVersion(int maj, int min);
+ EMUGL_COMMON_API void getGlesVersion(int* maj, int* min);
+
+ // Set/get renderer
+ EMUGL_COMMON_API void setRenderer(SelectedRenderer renderer);
+ EMUGL_COMMON_API SelectedRenderer getRenderer();
+
+ // Extension string query
+ EMUGL_COMMON_API bool hasExtension(const char* extensionsStr,
+ const char* wantedExtension);
+
+ // GL object counter get/set
+ EMUGL_COMMON_API void setGLObjectCounter(
+ android::base::GLObjectCounter* counter);
+ EMUGL_COMMON_API android::base::GLObjectCounter* getGLObjectCounter();
+
+ // Gralloc implementation get/set
+ EMUGL_COMMON_API void setGrallocImplementation(
+ GrallocImplementation gralloc);
+ EMUGL_COMMON_API GrallocImplementation getGrallocImplementation();
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengles-pipe.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengles-pipe.h
new file mode 100644
index 00000000000..af1fb7240f4
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengles-pipe.h
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include "aemu/base/c_header.h"
+#include "aemu/base/export.h"
+
+ANDROID_BEGIN_HEADER
+
+// Initialize the 'opengles' pipe - the one used for GPU emulation protocol
+// between guest and the emugl library.
+// |dummyLooper| is now unused, this will be removed in a future patch.
+AEMU_EXPORT void android_init_opengles_pipe(void);
+
+// Set the way in which the pipe processes guest recv depending on the OS
+// 0: Android
+// 1: Fuchsia
+AEMU_EXPORT void android_opengles_pipe_set_recv_mode(int);
+
+ANDROID_END_HEADER
diff --git a/src/gfxstream/host/gl/gl-host-common/include/host-common/opengles.h b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengles.h
new file mode 100644
index 00000000000..6e4f51fd34a
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/include/host-common/opengles.h
@@ -0,0 +1,170 @@
+// Copyright 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.
+
+#pragma once
+
+#include <stddef.h>
+
+#include "aemu/base/c_header.h"
+#include "aemu/base/export.h"
+#include "host-common/multi_display_agent.h"
+#include "host-common/vm_operations.h"
+#include "host-common/window_agent.h"
+#include "render-utils/virtio_gpu_ops.h"
+
+#ifdef __cplusplus
+#include "host-common/opengl/misc.h"
+#include "render-utils/RenderLib.h"
+#endif
+
+#ifndef USING_ANDROID_BP
+ANDROID_BEGIN_HEADER
+#endif
+
+/* A version of android_initOpenglesEmulation that is called from a library
+ * that has static access to libOpenglRender. */
+AEMU_EXPORT int android_prepareOpenglesEmulation(void);
+AEMU_EXPORT int android_setOpenglesEmulation(void* renderLib, void* eglDispatch, void* glesv2Dispatch);
+
+/* Call this function to initialize the hardware opengles emulation.
+ * This function will abort if we can't find the corresponding host
+ * libraries through dlopen() or equivalent.
+ */
+AEMU_EXPORT int android_initOpenglesEmulation(void);
+
+/* Tries to start the renderer process. Returns 0 on success, -1 on error.
+ * At the moment, this must be done before the VM starts. The onPost callback
+ * may be NULL.
+ *
+ * width and height: the framebuffer dimensions that will be reported
+ * to the guest display driver.
+ * guestApiLevel: API level of guest image (23 for mnc, 24 for nyc, etc)
+ */
+AEMU_EXPORT int android_startOpenglesRenderer(int width, int height,
+ bool isPhone, int guestApiLevel,
+ const QAndroidVmOperations *vm_operations,
+ const QAndroidEmulatorWindowAgent *window_agent,
+ const QAndroidMultiDisplayAgent *multi_display_agent,
+ int* glesMajorVersion_out,
+ int* glesMinorVersion_out);
+
+AEMU_EXPORT bool android_asyncReadbackSupported();
+
+/* See the description in render_api.h. */
+typedef void (*OnPostFunc)(void* context, uint32_t displayId, int width,
+ int height, int ydir, int format, int type,
+ unsigned char* pixels);
+AEMU_EXPORT void android_setPostCallback(OnPostFunc onPost,
+ void* onPostContext,
+ bool useBgraReadback,
+ uint32_t displayId);
+
+typedef void (*ReadPixelsFunc)(void* pixels, uint32_t bytes, uint32_t displayId);
+AEMU_EXPORT ReadPixelsFunc android_getReadPixelsFunc();
+
+
+typedef void (*FlushReadPixelPipeline)(int displayId);
+
+/* Gets the function that can be used to make sure no
+ * frames are left in the video producer pipeline.
+ * This can result in a post callback.
+ */
+FlushReadPixelPipeline android_getFlushReadPixelPipeline();
+
+/* Retrieve the Vendor/Renderer/Version strings describing the underlying GL
+ * implementation. The call only works while the renderer is started.
+ *
+ * Expects |*vendor|, |*renderer| and |*version| to be NULL.
+ *
+ * On exit, sets |*vendor|, |*renderer| and |*version| to point to new
+ * heap-allocated strings (that must be freed by the caller) which represent the
+ * OpenGL hardware vendor name, driver name and version, respectively.
+ * In case of error, |*vendor| etc. are set to NULL.
+ */
+AEMU_EXPORT void android_getOpenglesHardwareStrings(char** vendor,
+ char** renderer,
+ char** version);
+
+AEMU_EXPORT int android_showOpenglesWindow(void* window,
+ int wx,
+ int wy,
+ int ww,
+ int wh,
+ int fbw,
+ int fbh,
+ float dpr,
+ float rotation,
+ bool deleteExisting,
+ bool hideWindow);
+
+AEMU_EXPORT int android_hideOpenglesWindow(void);
+
+AEMU_EXPORT void android_setOpenglesTranslation(float px, float py);
+
+AEMU_EXPORT void android_setOpenglesScreenMask(int width, int height, const unsigned char* rgbaData);
+
+AEMU_EXPORT void android_redrawOpenglesWindow(void);
+
+AEMU_EXPORT bool android_hasGuestPostedAFrame(void);
+AEMU_EXPORT void android_resetGuestPostedAFrame(void);
+
+typedef bool (*ScreenshotFunc)(const char* dirname, uint32_t displayId);
+AEMU_EXPORT void android_registerScreenshotFunc(ScreenshotFunc f);
+AEMU_EXPORT bool android_screenShot(const char* dirname, uint32_t displayId);
+
+/* Stop the renderer process */
+EMUGL_COMMON_API void android_stopOpenglesRenderer(bool wait);
+
+/* Finish all renderer work, deleting current
+ * render threads. Renderer is allowed to get
+ * new render threads after that. */
+AEMU_EXPORT void android_finishOpenglesRenderer();
+
+/* set to TRUE if you want to use fast GLES pipes, 0 if you want to
+ * fallback to local TCP ones
+ */
+AEMU_EXPORT extern int android_gles_fast_pipes;
+
+// Notify the renderer that a guest graphics process is created or destroyed.
+AEMU_EXPORT void android_onGuestGraphicsProcessCreate(uint64_t puid);
+// TODO(kaiyili): rename this API to android_onGuestGraphicsProcessDestroy
+AEMU_EXPORT void android_cleanupProcGLObjects(uint64_t puid);
+
+AEMU_EXPORT void android_waitForOpenglesProcessCleanup();
+
+#ifdef __cplusplus
+namespace gfxstream {
+class Renderer;
+}
+
+AEMU_EXPORT const gfxstream::RendererPtr& android_getOpenglesRenderer();
+EMUGL_COMMON_API void android_setOpenglesRenderer(gfxstream::RendererPtr* renderer);
+#endif
+
+AEMU_EXPORT struct AndroidVirtioGpuOps* android_getVirtioGpuOps(void);
+
+/* Get EGL/GLESv2 dispatch tables */
+AEMU_EXPORT const void* android_getEGLDispatch();
+AEMU_EXPORT const void* android_getGLESv2Dispatch();
+
+/* Set vsync rate at runtime */
+AEMU_EXPORT void android_setVsyncHz(int vsyncHz);
+
+AEMU_EXPORT void android_setOpenglesDisplayConfigs(int configId, int w, int h,
+ int dpiX, int dpiY);
+AEMU_EXPORT void android_setOpenglesDisplayActiveConfig(int configId);
+
+#ifndef USING_ANDROID_BP
+ANDROID_END_HEADER
+#endif
diff --git a/src/gfxstream/host/gl/gl-host-common/meson.build b/src/gfxstream/host/gl/gl-host-common/meson.build
new file mode 100644
index 00000000000..26d96ce96af
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/meson.build
@@ -0,0 +1,52 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_gl_host_common = files(
+ 'opengles.cpp',
+ 'opengl/EmuglBackendList.cpp',
+ 'opengl/emugl_config.cpp',
+ 'opengl/GLProcessPipe.cpp',
+ 'opengl/GpuFrameBridge.cpp',
+ 'opengl/gpuinfo.cpp',
+ 'opengl/logger.cpp',
+ 'opengl/misc.cpp',
+ 'opengl/OpenglEsPipe.cpp',
+)
+
+files_gl_host_common_darwin = files(
+ 'opengl/macTouchOpenGL.m',
+ 'opengl/NativeGpuInfo_darwin.cpp',
+)
+
+files_gl_host_common_win32 = files(
+ 'opengl/NativeGpuInfo_windows.cpp',
+)
+
+files_gl_host_common_linux = files(
+ 'opengl/NativeGpuInfo_linux.cpp',
+)
+
+files_gl_host_common_qnx = files(
+ 'opengl/NativeGpuInfo_qnx.cpp',
+)
+
+# HACK: For the misc.h file already in AEMU host common
+inc_gl_host_common = include_directories('include')
+
+if host_machine.system() == 'darwin'
+ files_lib_gl_host_common += files_gl_host_common_darwin
+elif host_machine.system() == 'windows'
+ files_lib_gl_host_common += files_gl_host_common_win32
+elif host_machine.system() == 'linux'
+ files_lib_gl_host_common += files_gl_host_common_linux
+elif host_machine.system() == 'qnx'
+ files_lib_gl_host_common += files_gl_host_common_qnx
+endif
+
+lib_gl_host_common = static_library(
+ 'gl_host_common',
+ files_lib_gl_host_common,
+ cpp_args: gfxstream_host_args,
+ include_directories: [inc_gfxstream_include, inc_include, inc_gl_host_common],
+ dependencies: [aemu_base_dep, aemu_common_dep, aemu_snapshot_dep]
+)
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/EmuglBackendList.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/EmuglBackendList.cpp
new file mode 100644
index 00000000000..85829906e34
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/EmuglBackendList.cpp
@@ -0,0 +1,91 @@
+// Copyright 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 "host-common/opengl/EmuglBackendList.h"
+
+#include "aemu/base/StringFormat.h"
+#include "aemu/base/system/System.h"
+#include "aemu/base/files/PathUtils.h"
+
+#define DEBUG 0
+
+#if DEBUG
+# include <stdio.h>
+# define D(...) printf(__VA_ARGS__)
+#else
+# define D(...) ((void)0)
+#endif
+
+namespace android {
+namespace opengl {
+
+EmuglBackendList::EmuglBackendList(int programBitness,
+ const std::vector<std::string>& names) :
+ mDefaultName("auto"), mNames(names), mProgramBitness(programBitness) { }
+
+bool EmuglBackendList::contains(const char* name) const {
+ for (size_t n = 0; n < mNames.size(); ++n) {
+ if (mNames[n] == name) {
+ return true;
+ }
+ }
+ return false;
+}
+
+std::string EmuglBackendList::getLibDirPath(const char* name) {
+ // remove the "_indirect" suffix
+ std::string suffix("_indirect");
+ std::string nameNoSuffix(name);
+ int nameNoSuffixLen = (int)nameNoSuffix.size() - (int)suffix.size();
+ if (nameNoSuffixLen > 0 &&
+ suffix == nameNoSuffix.c_str() + nameNoSuffixLen) {
+ nameNoSuffix.erase(nameNoSuffixLen);
+ }
+ return android::base::pj({mExecDir, "lib64", std::string("gles_%s") + nameNoSuffix});
+}
+
+#ifdef _WIN32
+static const char kLibSuffix[] = ".dll";
+#elif defined(__APPLE__)
+static const char kLibSuffix[] = ".dylib";
+#else
+static const char kLibSuffix[] = ".so";
+#endif
+
+bool EmuglBackendList::getBackendLibPath(const char* name,
+ Library library,
+ std::string* libPath) {
+
+ const char* libraryName = NULL;
+ if (library == LIBRARY_EGL) {
+ libraryName = "EGL";
+ } else if (library == LIBRARY_GLESv1) {
+ libraryName = "GLES_CM";
+ } else if (library == LIBRARY_GLESv2) {
+ libraryName = "GLESv2";
+ } else {
+ // Should not happen.
+ D("%s: Invalid library type: %d\n", __FUNCTION__, library);
+ return false;
+ }
+
+ std::string path = android::base::pj({
+ getLibDirPath(name), std::string("lib") + libraryName + kLibSuffix});
+
+ *libPath = path;
+ return true;
+}
+
+} // namespace opengl
+} // namespace android
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/EmuglBackendList_unittest.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/EmuglBackendList_unittest.cpp
new file mode 100644
index 00000000000..df2b620adb7
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/EmuglBackendList_unittest.cpp
@@ -0,0 +1,135 @@
+// Copyright 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/opengl/EmuglBackendList.h"
+
+#include "android/base/files/PathUtils.h"
+#include "android/base/testing/TestSystem.h"
+#include "android/base/testing/TestTempDir.h"
+
+#include <gtest/gtest.h>
+
+namespace android {
+namespace opengl {
+
+#define ARRAYLEN(x) (sizeof(x)/sizeof(x[0]))
+
+using android::base::pj;
+using android::base::System;
+using android::base::TestTempDir;
+using android::base::TestSystem;
+
+static std::string makeLibSubPath(const char* name) {
+ return pj("foo", System::kLibSubDir, name);
+}
+
+static void makeLibSubDir(TestTempDir* dir, const char* name) {
+ dir->makeSubDir(makeLibSubPath(name).c_str());
+}
+
+static void makeLibSubFile(TestTempDir* dir, const char* name) {
+ dir->makeSubFile(makeLibSubPath(name).c_str());
+}
+
+TEST(EmuglBackendList, init) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+
+ myDir->makeSubDir("foo");
+
+ makeLibSubDir(myDir, "");
+ makeLibSubDir(myDir, "gles_first");
+ makeLibSubFile(myDir, "gles_second"); // should be ignored (file).
+ makeLibSubDir(myDir, "gles_"); // should be ignored (no name).
+ makeLibSubDir(myDir, "gles_fourth");
+ makeLibSubDir(myDir, "gles_fifth");
+
+ EmuglBackendList list("foo", System::kProgramBitness);
+
+ // NOTE: Must appear in alphabetical order
+ const char* const kExpected[] = {
+ "fifth", "first", "fourth",
+ };
+ const size_t kExpectedLen = ARRAYLEN(kExpected);
+
+ const std::vector<std::string>& names = list.names();
+ EXPECT_EQ(kExpectedLen, names.size());
+ for (size_t n = 0; n < kExpectedLen; ++n) {
+ EXPECT_STREQ(kExpected[n], names[n].c_str()) << "#" << n;
+ EXPECT_TRUE(list.contains(kExpected[n]));
+ }
+}
+
+TEST(EmuglBackendList, getBackendLibPath) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+
+ myDir->makeSubDir("foo");
+
+ makeLibSubDir(myDir, "");
+ makeLibSubDir(myDir, "gles_bar");
+
+ static const struct {
+ EmuglBackendList::Library library;
+ const char* libName;
+ } kData[] = {
+#ifdef _WIN32
+ { EmuglBackendList::LIBRARY_EGL, "libEGL.dll" },
+ { EmuglBackendList::LIBRARY_GLESv1, "libGLES_CM.dll" },
+ { EmuglBackendList::LIBRARY_GLESv2, "libGLESv2.dll" },
+#elif defined(__APPLE__)
+ { EmuglBackendList::LIBRARY_EGL, "libEGL.dylib" },
+ { EmuglBackendList::LIBRARY_GLESv1, "libGLES_CM.dylib" },
+ { EmuglBackendList::LIBRARY_GLESv2, "libGLESv2.dylib" },
+#else
+ { EmuglBackendList::LIBRARY_EGL, "libEGL.so" },
+ { EmuglBackendList::LIBRARY_GLESv1, "libGLES_CM.so" },
+ { EmuglBackendList::LIBRARY_GLESv2, "libGLESv2.so" },
+#endif
+ };
+ const size_t kDataLen = ARRAYLEN(kData);
+
+ for (size_t n = 0; n < kDataLen; ++n) {
+ std::string file =
+ pj("gles_bar", kData[n].libName);
+ makeLibSubFile(myDir, file.c_str());
+ }
+
+ auto sysdir = pj("/", "foo");
+ EmuglBackendList list(sysdir.c_str(), System::kProgramBitness);
+ const std::vector<std::string>& names = list.names();
+
+ EXPECT_EQ(1U, names.size());
+ EXPECT_STREQ("bar", names[0].c_str());
+
+ for (size_t n = 0; n < kDataLen; ++n) {
+ std::string expected =
+ pj("/", "foo", System::kLibSubDir, "gles_bar", kData[n].libName);
+ std::string libdir;
+ EXPECT_TRUE(list.getBackendLibPath("bar", kData[n].library, &libdir));
+ EXPECT_TRUE(list.contains("bar"));
+ EXPECT_FALSE(list.contains("foo"));
+ EXPECT_STREQ(expected.c_str(), libdir.c_str());
+ }
+}
+
+TEST(EmuglBackend, defaultName) {
+ EmuglBackendList list("foo", 0);
+ EXPECT_STREQ("auto", list.defaultName().c_str());
+}
+
+} // namespace opengl
+} // namespace android
+
+
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/GLProcessPipe.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/GLProcessPipe.cpp
new file mode 100644
index 00000000000..a2c82d3178e
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/GLProcessPipe.cpp
@@ -0,0 +1,188 @@
+// Copyright 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 <assert.h>
+#include <atomic>
+#include <limits>
+#include <memory>
+#include <string.h>
+#include <unordered_set>
+
+#include "aemu/base/synchronization/Lock.h"
+#include "host-common/AndroidPipe.h"
+#include "host-common/opengles.h"
+
+using android::base::AutoLock;
+using android::base::Lock;
+
+namespace android {
+namespace opengl {
+
+struct ProcessPipeIdRegistry {
+ Lock lock;
+ std::unordered_set<uint64_t> ids;
+};
+
+static ProcessPipeIdRegistry sRegistry;
+
+static bool sIdExistsInRegistry(uint64_t id) {
+ AutoLock lock(sRegistry.lock);
+ auto it = sRegistry.ids.find(id);
+ return it != sRegistry.ids.end();
+}
+
+namespace {
+
+// GLProcessPipe is a pipe service that is used for releasing graphics resources
+// per guest process. At the time being, guest processes can acquire host color
+// buffer handles / EGLImage handles and they need to be properly released when
+// guest process exits unexpectedly. This class is used to detect if guest
+// process exits, so that a proper cleanup function can be called.
+
+// It is done by setting up a pipe per guest process before acquiring color
+// buffer handles. When guest process exits, the pipe will be closed, and
+// onGuestClose() will trigger the cleanup path.
+
+class GLProcessPipe : public AndroidPipe {
+public:
+ //////////////////////////////////////////////////////////////////////////
+ // The pipe service class for this implementation.
+ class Service : public AndroidPipe::Service {
+ public:
+ Service() : AndroidPipe::Service("GLProcessPipe") {}
+
+ bool canLoad() const override { return true; }
+
+ AndroidPipe* create(void* hwPipe, const char* args, enum AndroidPipeFlags flags) override {
+ return new GLProcessPipe(hwPipe, this, flags);
+ }
+
+ AndroidPipe* load(void* hwPipe, const char* args,
+ base::Stream* stream) override {
+ return new GLProcessPipe(hwPipe, this, (AndroidPipeFlags)0, stream);
+ }
+
+ void preLoad(base::Stream* stream) override {
+ GLProcessPipe::s_headId.store(stream->getBe64());
+ }
+
+ void preSave(base::Stream* stream) override {
+ stream->putBe64(GLProcessPipe::s_headId.load());
+ }
+ };
+
+ GLProcessPipe(void* hwPipe, Service* service, enum AndroidPipeFlags flags,
+ base::Stream* loadStream = nullptr)
+ : AndroidPipe(hwPipe, service) {
+ if (loadStream) {
+ m_uniqueId = loadStream->getBe64();
+ m_hasData = (loadStream->getByte() != 0);
+ } else {
+ if (flags & ANDROID_PIPE_VIRTIO_GPU_BIT) {
+ // virtio-gpu uses context creation to manage process resources
+ return;
+ } else {
+ m_uniqueId = ++s_headId;
+ }
+ }
+ AutoLock lock(sRegistry.lock);
+ sRegistry.ids.insert(m_uniqueId);
+ android_onGuestGraphicsProcessCreate(m_uniqueId);
+ }
+
+ ~GLProcessPipe() {
+ AutoLock lock(sRegistry.lock);
+ sRegistry.ids.erase(m_uniqueId);
+ }
+
+ void onSave(base::Stream* stream) override {
+ stream->putBe64(m_uniqueId);
+ stream->putByte(m_hasData ? 1 : 0);
+ }
+
+ void onGuestClose(PipeCloseReason reason) override {
+ if (sIdExistsInRegistry(m_uniqueId)) {
+ android_cleanupProcGLObjects(m_uniqueId);
+ }
+ delete this;
+ }
+
+ unsigned onGuestPoll() const override {
+ return PIPE_POLL_IN | PIPE_POLL_OUT;
+ }
+
+ int onGuestRecv(AndroidPipeBuffer* buffers, int numBuffers) override {
+ assert(buffers[0].size >= 8);
+ if (m_hasData) {
+ m_hasData = false;
+ memcpy(buffers[0].data, (const char*)&m_uniqueId, sizeof(m_uniqueId));
+ return sizeof(m_uniqueId);
+ } else {
+ return 0;
+ }
+ }
+
+ int onGuestSend(const AndroidPipeBuffer* buffers,
+ int numBuffers,
+ void** newPipePtr) override {
+ // The guest is supposed to send us a confirm code first. The code is
+ // 100 (4 byte integer).
+ assert(buffers[0].size >= 4);
+ int32_t confirmInt = *((int32_t*)buffers[0].data);
+ assert(confirmInt == 100);
+ (void)confirmInt;
+ m_hasData = true;
+ return buffers[0].size;
+ }
+
+ void onGuestWantWakeOn(int flags) override {}
+
+private:
+ // An identifier for the guest process corresponding to this pipe.
+ // With very high probability, all currently-active processes have unique
+ // identifiers, since the IDs are assigned sequentially from a 64-bit ID
+ // space.
+ // Please change it if you ever have a use case that exhausts them
+ uint64_t m_uniqueId = std::numeric_limits<uint64_t>::max();
+ bool m_hasData = false;
+ static std::atomic<uint64_t> s_headId;
+
+};
+
+std::atomic<uint64_t> GLProcessPipe::s_headId {0};
+
+}
+
+void registerGLProcessPipeService() {
+ AndroidPipe::Service::add(std::make_unique<GLProcessPipe::Service>());
+}
+
+void forEachProcessPipeId(std::function<void(uint64_t)> f) {
+ AutoLock lock(sRegistry.lock);
+ for (auto id: sRegistry.ids) {
+ f(id);
+ }
+}
+
+void forEachProcessPipeIdRunAndErase(std::function<void(uint64_t)> f) {
+ AutoLock lock(sRegistry.lock);
+ auto it = sRegistry.ids.begin();
+ while (it != sRegistry.ids.end()) {
+ f(*it);
+ it = sRegistry.ids.erase(it);
+ }
+}
+
+}
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/GpuFrameBridge.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/GpuFrameBridge.cpp
new file mode 100644
index 00000000000..717025df0e7
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/GpuFrameBridge.cpp
@@ -0,0 +1,242 @@
+// 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.
+
+#include "host-common/opengl/GpuFrameBridge.h"
+
+#include <stdio.h> // for printf
+#include <stdlib.h> // for NULL, free, malloc
+#include <string.h> // for memcpy
+
+#include <atomic> // for atomic_bool, memory_o...
+#include <memory> // for unique_ptr
+
+#include "aemu/base/synchronization/Lock.h" // for Lock, AutoLock
+#include "aemu/base/synchronization/MessageChannel.h"
+#include "host-common/opengles.h" // for android_getFlushReadP...
+
+#ifdef _WIN32
+#undef ERROR
+#endif
+
+namespace android {
+namespace opengl {
+
+using android::base::AutoLock;
+using android::base::Lock;
+using android::base::MessageChannel;
+
+namespace {
+
+// A small structure to model a single frame of the GPU display,
+// as passed between the EmuGL and main loop thread.
+struct Frame {
+ int width;
+ int height;
+ void* pixels;
+ bool isValid;
+
+ Frame(int w, int h, const void* pixels)
+ : width(w), height(h), pixels(NULL), isValid(true) {
+ this->pixels = ::malloc(w * 4 * h);
+ }
+
+ ~Frame() { ::free(pixels); }
+};
+
+// Real implementation of GpuFrameBridge interface.
+class Bridge : public GpuFrameBridge {
+public:
+ // Constructor.
+ Bridge()
+ : GpuFrameBridge(),
+ mRecFrame(NULL),
+ mRecTmpFrame(NULL),
+ mRecFrameUpdated(false),
+ mReadPixelsFunc(android_getReadPixelsFunc()),
+ mFlushPixelPipeline(android_getFlushReadPixelPipeline()) {}
+
+ // The gpu bridge receives frames from a buffer that can contain multiple
+ // frames. usually the bridge is one frame behind. This is usually not a
+ // problem when we have a high enough framerate. However it is possible that
+ // the framerate drops really low (even <1). This can result in the bridge
+ // never delivering this "stuck frame".
+ //
+ // As a work around we will flush the reader pipeline if no frames are
+ // delivered within at most 2x kFrameDelayms
+ const long kMinFPS = 24;
+ const long kFrameDelayMs = 1000 / kMinFPS;
+
+ // Destructor
+ virtual ~Bridge() {
+ if (mRecFrame) {
+ delete mRecFrame;
+ }
+ if (mRecTmpFrame) {
+ delete mRecTmpFrame;
+ }
+ }
+
+ // virtual void setLooper(android::base::Looper* aLooper) override {
+ // mTimer = std::unique_ptr<android::base::Looper::Timer>(
+ // aLooper->createTimer(_on_frame_notify, this));
+ // }
+
+ void notify() {
+ AutoLock delay(mDelayLock);
+ switch (mDelayCallback) {
+ case FrameDelay::Reschedule:
+ // mTimer->startRelative(kFrameDelayMs);
+ mDelayCallback = FrameDelay::Scheduled;
+ break;
+ case FrameDelay::Scheduled:
+ // mTimer->stop();
+ mDelayCallback = FrameDelay::Firing;
+ delay.unlock();
+ mFlushPixelPipeline(mDisplayId);
+ break;
+ default:
+ assert(false);
+ }
+ }
+
+ // static void _on_frame_notify(void* opaque,
+ // android::base::Looper::Timer* timer) {
+ // Bridge* worker = static_cast<Bridge*>(opaque);
+ // worker->notify();
+ // }
+
+ // Implementation of the GpuFrameBridge::postRecordFrame() method, must be
+ // called from the EmuGL thread.
+ virtual void postRecordFrame(int width,
+ int height,
+ const void* pixels) override {
+ postFrame(width, height, pixels, true);
+ }
+
+ virtual void postRecordFrameAsync(int width,
+ int height,
+ const void* pixels) override {
+ postFrame(width, height, pixels, false);
+ }
+
+ virtual void* getRecordFrame() override {
+ if (mRecFrameUpdated.exchange(false)) {
+ AutoLock lock(mRecLock);
+ memcpy(mRecFrame->pixels, mRecTmpFrame->pixels,
+ mRecFrame->width * mRecFrame->height * 4);
+ mRecFrame->isValid = true;
+ }
+ return mRecFrame && mRecFrame->isValid ? mRecFrame->pixels : nullptr;
+ }
+
+ virtual void* getRecordFrameAsync() override {
+ if (mRecFrameUpdated.exchange(false)) {
+ AutoLock lock(mRecLock);
+ mReadPixelsFunc(mRecFrame->pixels,
+ mRecFrame->width * mRecFrame->height * 4,
+ mDisplayId);
+ mRecFrame->isValid = true;
+ }
+ return mRecFrame && mRecFrame->isValid ? mRecFrame->pixels : nullptr;
+ }
+
+ virtual void invalidateRecordingBuffers() override {
+ {
+ AutoLock lock(mRecLock);
+ // Release the buffers because new recording in the furture may have
+ // different resolution if multi display changes its resolution.
+ if (mRecFrame) {
+ delete mRecFrame;
+ mRecFrame = nullptr;
+ }
+ if (mRecTmpFrame) {
+ delete mRecTmpFrame;
+ mRecTmpFrame = nullptr;
+ }
+ }
+ mRecFrameUpdated.store(false, std::memory_order_release);
+ }
+
+ void setFrameReceiver(FrameAvailableCallback receiver,
+ void* opaque) override {
+ mReceiver = receiver;
+ mReceiverOpaque = opaque;
+ }
+
+ void postFrame(int width, int height, const void* pixels, bool copy) {
+ {
+ AutoLock lock(mRecLock);
+ if (!mRecFrame) {
+ mRecFrame = new Frame(width, height, pixels);
+ }
+ if (!mRecTmpFrame) {
+ mRecTmpFrame = new Frame(width, height, pixels);
+ }
+ if (copy) {
+ memcpy(mRecTmpFrame->pixels, pixels, width * height * 4);
+ }
+ }
+ mRecFrameUpdated.store(true, std::memory_order_release);
+ if (mReceiver) {
+ mReceiver(mReceiverOpaque);
+ AutoLock delay(mDelayLock);
+ switch (mDelayCallback) {
+ case FrameDelay::NotScheduled:
+ // mTimer->startRelative(kFrameDelayMs);
+ mDelayCallback = FrameDelay::Scheduled;
+ break;
+ case FrameDelay::Firing:
+ mDelayCallback = FrameDelay::NotScheduled;
+ break;
+ default:
+ mDelayCallback = FrameDelay::Reschedule;
+ break;
+ }
+ }
+ }
+
+ virtual void setDisplayId(uint32_t displayId) override {
+ mDisplayId = displayId;
+ }
+ enum class FrameDelay {
+ NotScheduled = 0, // No delay timer is scheduled
+ Scheduled, // A delay timer has been scheduled and will flush the
+ // pipeline on expiration
+ Reschedule, // Do not flush the pipeline, but reschedule
+ Firing, // A callback has been scheduled, nothing needs to happen
+ };
+
+private:
+ FrameAvailableCallback mReceiver = nullptr;
+ void* mReceiverOpaque = nullptr;
+ Lock mRecLock;
+ Frame* mRecFrame;
+ Frame* mRecTmpFrame;
+ std::atomic_bool mRecFrameUpdated;
+ ReadPixelsFunc mReadPixelsFunc = 0;
+ uint32_t mDisplayId = 0;
+ FlushReadPixelPipeline mFlushPixelPipeline = 0;
+
+ // std::unique_ptr<android::base::Looper::Timer> mTimer;
+ Lock mDelayLock;
+ FrameDelay mDelayCallback{FrameDelay::NotScheduled};
+};
+} // namespace
+// static
+GpuFrameBridge* GpuFrameBridge::create() {
+ return new Bridge();
+}
+
+} // namespace opengl
+} // namespace android
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/GpuFrameBridge_unittest.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/GpuFrameBridge_unittest.cpp
new file mode 100644
index 00000000000..03c62dd706b
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/GpuFrameBridge_unittest.cpp
@@ -0,0 +1,50 @@
+// 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.
+
+#include "android/opengl/GpuFrameBridge.h"
+
+#include "android/base/async/Looper.h"
+#include "android/base/Log.h"
+#include "android/base/memory/ScopedPtr.h"
+
+#include <gtest/gtest.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+namespace android {
+namespace opengl {
+
+using android::base::ScopedPtr;
+using android::base::Looper;
+
+TEST(GpuFrameBridge, postFrameWithinSingleThread) {
+ GpuFrameBridge* bridge =
+ GpuFrameBridge::create();
+ EXPECT_TRUE(bridge);
+
+ static const unsigned char kFrame0[4] = {
+ 0xff, 0x80, 0x40, 0xff,
+ };
+
+ bridge->postRecordFrame(1, 1, kFrame0);
+ unsigned char* pixel = (unsigned char*)bridge->getRecordFrame();
+ for (size_t n = 0; n < sizeof(kFrame0); ++n) {
+ EXPECT_EQ(kFrame0[n], pixel[n]) << "# " << n;
+ }
+}
+
+} // namespace opengl
+} // namespace android
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_darwin.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_darwin.cpp
new file mode 100644
index 00000000000..885c8d0b59d
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_darwin.cpp
@@ -0,0 +1,120 @@
+// 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.
+
+#include "host-common/opengl/NativeGpuInfo.h"
+
+#include "host-common/opengl/macTouchOpenGL.h"
+
+#include <CoreGraphics/CGDirectDisplay.h>
+#include <IOKit/graphics/IOGraphicsLib.h>
+#include <IOKit/IOTypes.h>
+#include <IOKit/IOKitLib.h>
+
+#include <string>
+#include <vector>
+
+#include <stdio.h>
+
+typedef std::pair<uint32_t, uint32_t> GpuVendorDeviceId;
+typedef std::vector<GpuVendorDeviceId> GpuVendorDeviceIdList;
+
+// Based on code from:
+// https://chromium.googlesource.com/chromium/src/gpu/+/e626016b34c63b7ff51bf9a6c20b37bcc18150c4/config/gpu_info_collector_mac.mm
+// https://github.com/glfw/glfw/blob/e0a6772e5e4c672179fc69a90bcda3369792ed1f/src/cocoa_monitor.m
+
+// GetEntryProperty():
+// Return 0 if we couldn't find the property.
+// The property values we use should not be 0, so it's OK to use 0 as failure.
+uint32_t GetEntryProperty(io_registry_entry_t entry, CFStringRef property_name) {
+ CFDataRef ref(
+ static_cast<CFDataRef>(IORegistryEntrySearchCFProperty(
+ entry,
+ kIOServicePlane,
+ property_name,
+ kCFAllocatorDefault,
+ kIORegistryIterateRecursively | kIORegistryIterateParents)));
+
+ if (!ref)
+ return 0;
+
+ uint32_t value = 0;
+ const uint32_t* value_pointer =
+ reinterpret_cast<const uint32_t*>(CFDataGetBytePtr(ref));
+
+ if (value_pointer != NULL)
+ value = *value_pointer;
+
+ CFRelease(ref);
+ return value;
+}
+
+static auto GetGPUInfoMac() {
+
+ GpuVendorDeviceIdList res;
+
+ io_iterator_t iter;
+ io_service_t serv = 0;
+
+ CFMutableDictionaryRef matching = IOServiceMatching("IODisplayConnect");
+ kern_return_t err = IOServiceGetMatchingServices(kIOMasterPortDefault,
+ matching,
+ &iter);
+
+ if (err) return res;
+
+ while ((serv = IOIteratorNext(iter)) != 0) {
+ uint32_t vendor_id = GetEntryProperty(serv, CFSTR("vendor-id"));
+ if (vendor_id) {
+ uint32_t device_id = GetEntryProperty(serv, CFSTR("device-id"));
+ if (device_id) {
+ res.push_back(std::make_pair(vendor_id, device_id));
+ }
+ }
+ }
+
+ return res;
+}
+
+void getGpuInfoListNative(GpuInfoList* out) {
+ // This call initializes a pixel format,
+ // which should update the IOKit stuff to the
+ // correct GPU that will actually be used
+ // while the emulator is running.
+ macTouchOpenGL();
+
+ auto gpulist = GetGPUInfoMac();
+
+ char vendoridbuf[64] = {};
+ char deviceidbuf[64] = {};
+
+ for (const auto& elt : gpulist) {
+ snprintf(vendoridbuf, sizeof(vendoridbuf), "%04x", elt.first);
+ snprintf(deviceidbuf, sizeof(deviceidbuf), "%04x", elt.second);
+ out->infos.emplace_back(
+ std::string(vendoridbuf), // make -> vendorid
+ std::string(deviceidbuf), // model -> deviceid
+ std::string(deviceidbuf), // device_id -> deviceid
+ "", "", "" // revision, version, renderer blank
+ );
+ }
+}
+
+// macOS: Disable Vulkan for now unless on M1.
+bool isVulkanSafeToUseNative() {
+#ifdef __aarch64__
+ return true;
+#else
+ return false;
+#endif
+} \ No newline at end of file
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_linux.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_linux.cpp
new file mode 100644
index 00000000000..5b07bbd0ba1
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_linux.cpp
@@ -0,0 +1,118 @@
+// 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.
+
+#include "host-common/opengl/NativeGpuInfo.h"
+
+#include "aemu/base/files/PathUtils.h"
+#include "aemu/base/files/ScopedFd.h"
+#include "aemu/base/misc/FileUtils.h"
+#include "aemu/base/system/System.h"
+
+#include <string>
+
+using android::base::PathUtils;
+using android::base::ScopedFd;
+
+static const int kGPUInfoQueryTimeoutMs = 5000;
+
+// static std::string load_gpu_info() {
+// // Execute the command to get GPU info.
+// return System::get()
+// ->runCommandWithResult({"lspci", "-mvnn"}, kGPUInfoQueryTimeoutMs)
+// .valueOr({});
+// }
+
+static std::string parse_last_hexbrackets(const std::string& str) {
+ size_t closebrace_p = str.rfind("]");
+ size_t openbrace_p = str.rfind("[", closebrace_p - 1);
+ return str.substr(openbrace_p + 1, closebrace_p - openbrace_p - 1);
+}
+
+void parse_gpu_info_list_linux(const std::string& contents,
+ GpuInfoList* gpulist) {
+ size_t line_loc = contents.find("\n");
+ if (line_loc == std::string::npos) {
+ line_loc = contents.size();
+ }
+ size_t p = 0;
+ std::string key;
+ std::string val;
+ bool lookfor = false;
+
+ // Linux - Only support one GPU for now.
+ // On Linux, the only command that seems not to take
+ // forever is lspci.
+ // We just look for "VGA" in lspci, then
+ // attempt to grab vendor and device information.
+ // Second, we use glx to look for the version string,
+ // in case there is a renderer such as Mesa
+ // to look out for.
+ while (line_loc != std::string::npos) {
+ key = contents.substr(p, line_loc - p);
+ if (!lookfor && (key.find("VGA") != std::string::npos)) {
+ lookfor = true;
+ gpulist->addGpu();
+ gpulist->currGpu().os = "L";
+ } else if (lookfor && (key.find("Vendor") != std::string::npos)) {
+ gpulist->currGpu().make = parse_last_hexbrackets(key);
+ } else if (lookfor && (key.find("Device") != std::string::npos)) {
+ gpulist->currGpu().device_id = parse_last_hexbrackets(key);
+ lookfor = false;
+ } else if (key.find("OpenGL version string") != std::string::npos) {
+ gpulist->currGpu().renderer = key;
+ } else {
+ }
+ if (line_loc == contents.size()) {
+ break;
+ }
+ p = line_loc + 1;
+ line_loc = contents.find("\n", p);
+ if (line_loc == std::string::npos) {
+ line_loc = contents.size();
+ }
+ }
+}
+
+void getGpuInfoListNative(GpuInfoList* gpulist) {
+ (void)gpulist;
+ // Load it in a traditional way - by parsing output of external process.
+
+ // TODO: Don't do GPU info detection on Linux for now---lspci can be
+ // inaccurate as to what GPU the user is actually using.
+#ifdef ANDROID_DEBUG
+ // Workaround for b/77586363, clang -O0 introduces some unexpected behavior
+ // when it comes to the else. See the bug for details
+ // load_gpu_info();
+#else
+ // (void)load_gpu_info; // Make Werror happy
+#endif
+ // std::string gpu_info = load_gpu_info();
+ // parse_gpu_info_list_linux(gpu_info, gpulist);
+
+ // Unfortunately, even to obtain a driver version on Linux one has to either
+ // create a full rendering context (very slow, 150+ms) or hardcode specific
+ // ways to get it for each existing GPU driver (just insane).
+ //
+ // That's why this function doesn't populate driver version and renderer.
+ //
+ // If you ever need start from something to get them from OpenGL, here's
+ // a very simple example:
+ // http://web.mit.edu/jhawk/mnt/spo/3d/src/Mesa-3.0/samples/oglinfo.c
+ //
+}
+
+// Linux: do not blacklist Vulkan
+bool isVulkanSafeToUseNative() {
+ return true;
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_qnx.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_qnx.cpp
new file mode 100644
index 00000000000..9cd2ca468bf
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_qnx.cpp
@@ -0,0 +1,25 @@
+// 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.
+
+#include "host-common/opengl/NativeGpuInfo.h"
+
+void getGpuInfoListNative(GpuInfoList* gpulist) {
+ (void)gpulist;
+ // Adding noop instead of messing with the meson build.
+ // The cmake build did not require adding this file.
+}
+
+bool isVulkanSafeToUseNative() {
+ return true;
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_windows.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_windows.cpp
new file mode 100755
index 00000000000..17d019ed0c3
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/NativeGpuInfo_windows.cpp
@@ -0,0 +1,416 @@
+// 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.
+
+#include "host-common/opengl/NativeGpuInfo.h"
+
+#include "aemu/base/StringFormat.h"
+#include "aemu/base/containers/SmallVector.h"
+#include "aemu/base/StringFormat.h"
+#include "aemu/base/files/PathUtils.h"
+#include "aemu/base/system/System.h"
+#include "aemu/base/system/Win32UnicodeString.h"
+
+#include <windows.h>
+#include <d3d9.h>
+
+#include <ctype.h>
+
+#include <algorithm>
+#include <string>
+#include <tuple>
+
+using android::base::PathUtils;
+using android::base::SmallFixedVector;
+using android::base::StringFormat;
+using android::base::Win32UnicodeString;
+
+static std::string& toLower(std::string& s) {
+ std::transform(s.begin(), s.end(), s.begin(), ::tolower);
+ return s;
+}
+
+static void parse_windows_gpu_ids(const std::string& val,
+ GpuInfoList* gpulist) {
+ std::string result;
+ size_t key_start = 0;
+ size_t key_end = 0;
+
+ key_start = val.find("VEN_", key_start);
+ if (key_start == std::string::npos) {
+ return;
+ }
+ key_end = val.find("&", key_start);
+ if (key_end == std::string::npos) {
+ return;
+ }
+ result = val.substr(key_start + 4, key_end - key_start - 4);
+ gpulist->currGpu().make = std::move(toLower(result));
+
+ key_start = val.find("DEV_", key_start);
+ if (key_start == std::string::npos) {
+ return;
+ }
+ key_end = val.find("&", key_start);
+ if (key_end == std::string::npos) {
+ return;
+ }
+ result = val.substr(key_start + 4, key_end - key_start - 4);
+ gpulist->currGpu().device_id = std::move(toLower(result));
+}
+
+static bool startsWith(const std::string& string, const std::string& prefix) {
+ return string.size() >= prefix.size() &&
+ memcmp(string.data(), prefix.data(), prefix.size()) == 0;
+}
+
+static void add_predefined_gpu_dlls(GpuInfo* gpu) {
+ const std::string& currMake = gpu->make;
+ if (currMake == "NVIDIA" || startsWith(gpu->model, "NVIDIA")) {
+ gpu->addDll("nvoglv32.dll");
+ gpu->addDll("nvoglv64.dll");
+ } else if (currMake == "Advanced Micro Devices, Inc." ||
+ startsWith(gpu->model, "Advanced Micro Devices, Inc.")) {
+ gpu->addDll("atioglxx.dll");
+ gpu->addDll("atig6txx.dll");
+ }
+}
+
+static void parse_windows_gpu_dlls(int line_loc,
+ int val_pos,
+ const std::string& contents,
+ GpuInfoList* gpulist) {
+ if (line_loc - val_pos != 0) {
+ const std::string& dll_str =
+ contents.substr(val_pos, line_loc - val_pos);
+
+ size_t vp = 0;
+ size_t dll_sep_loc = dll_str.find(",", vp);
+ size_t dll_end = (dll_sep_loc != std::string::npos)
+ ? dll_sep_loc
+ : dll_str.size() - vp;
+ gpulist->currGpu().addDll(dll_str.substr(vp, dll_end - vp));
+
+ while (dll_sep_loc != std::string::npos) {
+ vp = dll_sep_loc + 1;
+ dll_sep_loc = dll_str.find(",", vp);
+ dll_end = (dll_sep_loc != std::string::npos) ? dll_sep_loc
+ : dll_str.size() - vp;
+ gpulist->currGpu().addDll(dll_str.substr(vp, dll_end - vp));
+ }
+ }
+
+ add_predefined_gpu_dlls(&gpulist->currGpu());
+}
+
+static void load_gpu_registry_info(const wchar_t* keyName, GpuInfo* gpu) {
+ HKEY hkey;
+ if (::RegOpenKeyW(HKEY_LOCAL_MACHINE, keyName, &hkey) != ERROR_SUCCESS) {
+ return;
+ }
+
+ SmallFixedVector<wchar_t, 256> name;
+ SmallFixedVector<BYTE, 1024> value;
+ for (int i = 0;; ++i) {
+ name.resize_noinit(name.capacity());
+ value.resize_noinit(value.capacity());
+ DWORD nameLen = name.size();
+ DWORD valueLen = value.size();
+ DWORD type;
+ auto res = RegEnumValueW(hkey, i, name.data(), &nameLen, nullptr, &type,
+ value.data(), &valueLen);
+ if (res == ERROR_NO_MORE_ITEMS) {
+ break;
+ } else if (res == ERROR_MORE_DATA) {
+ if (type != REG_SZ && type != REG_MULTI_SZ) {
+ // we don't care about other types for now, so let's not even
+ // try
+ continue;
+ }
+ name.resize_noinit(nameLen + 1);
+ value.resize_noinit(valueLen + 1);
+ nameLen = name.size();
+ valueLen = value.size();
+ res = ::RegEnumValueW(hkey, i, name.data(), &nameLen, nullptr,
+ &type, value.data(), &valueLen);
+ if (res != ERROR_SUCCESS) {
+ break;
+ }
+ }
+ if (res != ERROR_SUCCESS) {
+ break; // well, what can we do here?
+ }
+
+ name[nameLen] = L'\0';
+
+ if (type == REG_SZ && wcscmp(name.data(), L"DriverVersion") == 0) {
+ const auto strVal = (wchar_t*)value.data();
+ const auto strLen = valueLen / sizeof(wchar_t);
+ strVal[strLen] = L'\0';
+ gpu->version = Win32UnicodeString::convertToUtf8(strVal, strLen);
+ } else if (type == REG_MULTI_SZ &&
+ (wcscmp(name.data(), L"UserModeDriverName") == 0 ||
+ wcscmp(name.data(), L"UserModeDriverNameWoW") == 0)) {
+ const auto strVal = (wchar_t*)value.data();
+ const auto strLen = valueLen / sizeof(wchar_t);
+ strVal[strLen] = L'\0';
+ // Iterate over the '0'-delimited list of strings,
+ // stopping at double '0' (AKA empty string after the
+ // delimiter).
+ for (const wchar_t* ptr = strVal;;) {
+ auto len = wcslen(ptr);
+ if (!len) {
+ break;
+ }
+ gpu->dlls.emplace_back(
+ Win32UnicodeString::convertToUtf8(ptr, len));
+ ptr += len + 1;
+ }
+ }
+ }
+
+ ::RegCloseKey(hkey);
+}
+
+// static const int kGPUInfoQueryTimeoutMs = 5000;
+// static std::string load_gpu_info_wmic() {
+// auto guid = Uuid::generateFast().toString();
+// // WMIC doesn't allow one to have any unquoted '-' characters in file name,
+// // so let's get rid of them.
+// guid.erase(std::remove(guid.begin(), guid.end(), '-'), guid.end());
+// auto tempName = PathUtils::join(System::get()->getTempDir(),
+// StringFormat("gpuinfo_%s.txt", guid));
+//
+// auto deleteTempFile = makeCustomScopedPtr(
+// &tempName,
+// [](const std::string* name) { path_delete_file(name->c_str()); });
+// if (!System::get()->runCommand(
+// {"wmic", StringFormat("/OUTPUT:%s", tempName), "path",
+// "Win32_VideoController", "get", "/value"},
+// RunOptions::WaitForCompletion | RunOptions::TerminateOnTimeout,
+// kGPUInfoQueryTimeoutMs)) {
+// return {};
+// }
+// auto res = android::readFileIntoString(tempName);
+// return res ? Win32UnicodeString::convertToUtf8(
+// (const wchar_t*)res->c_str(),
+// res->size() / sizeof(wchar_t))
+// : std::string{};
+// }
+
+void parse_gpu_info_list_windows(const std::string& contents,
+ GpuInfoList* gpulist) {
+ size_t line_loc = contents.find("\r\n");
+ if (line_loc == std::string::npos) {
+ line_loc = contents.size();
+ }
+ size_t p = 0;
+ size_t equals_pos = 0;
+ size_t val_pos = 0;
+ std::string key;
+ std::string val;
+
+ // Windows: We use `wmic path Win32_VideoController get /value`
+ // to get a reasonably detailed list of '<key>=<val>'
+ // pairs. From these, we can get the make/model
+ // of the GPU, the driver version, and all DLLs involved.
+ while (line_loc != std::string::npos) {
+ equals_pos = contents.find("=", p);
+ if ((equals_pos != std::string::npos) && (equals_pos < line_loc)) {
+ key = contents.substr(p, equals_pos - p);
+ val_pos = equals_pos + 1;
+ val = contents.substr(val_pos, line_loc - val_pos);
+
+ if (key.find("AdapterCompatibility") != std::string::npos) {
+ gpulist->addGpu();
+ gpulist->currGpu().os = "W";
+ // 'make' will be overwritten in parsing 'PNPDeviceID'
+ // later. Set it here because we need it in paring
+ // 'InstalledDisplayDrivers' which comes before
+ // 'PNPDeviceID'.
+ gpulist->currGpu().make = val;
+ } else if (key.find("Caption") != std::string::npos) {
+ gpulist->currGpu().model = val;
+ } else if (key.find("PNPDeviceID") != std::string::npos) {
+ parse_windows_gpu_ids(val, gpulist);
+ } else if (key.find("DriverVersion") != std::string::npos) {
+ gpulist->currGpu().version = val;
+ } else if (key.find("InstalledDisplayDrivers") !=
+ std::string::npos) {
+ parse_windows_gpu_dlls(line_loc, val_pos, contents, gpulist);
+ }
+ }
+ if (line_loc == contents.size()) {
+ break;
+ }
+ p = line_loc + 2;
+ line_loc = contents.find("\r\n", p);
+ if (line_loc == std::string::npos) {
+ line_loc = contents.size();
+ }
+ }
+}
+
+static bool queryGpuInfoD3D(GpuInfoList* gpus) {
+ LPDIRECT3D9 pD3D = Direct3DCreate9(D3D_SDK_VERSION);
+ UINT numAdapters = pD3D->GetAdapterCount();
+
+ char vendoridBuf[16] = {};
+ char deviceidBuf[16] = {};
+
+ // MAX_DEVICE_IDENTIFIER_STRING can be pretty big,
+ // don't allocate on stack.
+ std::vector<char> descriptionBuf(MAX_DEVICE_IDENTIFIER_STRING + 1, '\0');
+
+ if (numAdapters == 0) return false;
+
+ // The adapter that is equal to D3DADAPTER_DEFAULT is the primary display adapter.
+ // D3DADAPTER_DEFAULT is currently defined to be 0, btw---but this is more future proof
+ for (UINT i = 0; i < numAdapters; i++) {
+ if (i == D3DADAPTER_DEFAULT) {
+ gpus->addGpu();
+ GpuInfo& gpu = gpus->currGpu();
+ gpu.os = "W";
+
+ D3DADAPTER_IDENTIFIER9 id;
+ pD3D->GetAdapterIdentifier(0, 0, &id);
+ snprintf(vendoridBuf, sizeof(vendoridBuf), "%04x", (unsigned int)id.VendorId);
+ snprintf(deviceidBuf, sizeof(deviceidBuf), "%04x", (unsigned int)id.DeviceId);
+ snprintf(&descriptionBuf[0], MAX_DEVICE_IDENTIFIER_STRING, "%s", id.Description);
+ gpu.make = vendoridBuf;
+ gpu.device_id = deviceidBuf;
+ gpu.model = &descriptionBuf[0];
+ // crashhandler_append_message_format(
+ // "gpu found. vendor id %04x device id 0x%04x\n",
+ // (unsigned int)(id.VendorId),
+ // (unsigned int)(id.DeviceId));
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void getGpuInfoListNative(GpuInfoList* gpus) {
+ if (queryGpuInfoD3D(gpus)) return;
+
+ // crashhandler_append_message_format("d3d gpu query failed.\n");
+
+ DISPLAY_DEVICEW device = { sizeof(device) };
+
+ for (int i = 0; EnumDisplayDevicesW(nullptr, i, &device, 0); ++i) {
+ gpus->addGpu();
+ GpuInfo& gpu = gpus->currGpu();
+ gpu.os = "W";
+ gpu.current_gpu =
+ (device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) != 0;
+ gpu.model = Win32UnicodeString::convertToUtf8(device.DeviceString);
+ parse_windows_gpu_ids(
+ Win32UnicodeString::convertToUtf8(device.DeviceID), gpus);
+
+ // Now try inspecting the registry directly; |device|.DeviceKey can be a
+ // path to the GPU information key.
+ static const std::string prefix = "\\Registry\\Machine\\";
+ if (startsWith(Win32UnicodeString::convertToUtf8(device.DeviceKey),
+ prefix)) {
+ load_gpu_registry_info(device.DeviceKey + prefix.size(), &gpu);
+ }
+ add_predefined_gpu_dlls(&gpu);
+ }
+
+ if (gpus->infos.empty()) {
+ // Everything failed; bail.
+ // Everything failed - fall back to the good^Wbad old WMIC command.
+ // auto gpuInfoWmic = load_gpu_info_wmic();
+ // parse_gpu_info_list_windows(gpuInfoWmic, gpus);
+ }
+}
+
+// windows: blacklist depending on amdvlk and certain versions of vulkan-1.dll
+// Based on chromium/src/gpu/config/gpu_info_collector_win.cc
+bool badAmdVulkanDriverVersion() {
+ int major, minor, build_1, build_2;
+
+ // crashhandler_append_message_format(
+ // "checking for bad AMD Vulkan driver version...\n");
+
+ if (!android::base::queryFileVersionInfo("amdvlk64.dll", &major, &minor, &build_1, &build_2)) {
+ // crashhandler_append_message_format(
+ // "amdvlk64.dll not found. Checking for amdvlk32...\n");
+ if (!android::base::queryFileVersionInfo("amdvlk32.dll", &major, &minor, &build_1, &build_2)) {
+ // crashhandler_append_message_format(
+ // "amdvlk32.dll not found. No bad AMD Vulkan driver versions found.\n");
+ // Information about amdvlk64 not availble; not blacklisted
+ return false;
+ }
+ }
+
+ // crashhandler_append_message_format(
+ // "AMD driver info found. Version: %d.%d.%d.%d\n",
+ // major, minor, build_1, build_2);
+
+ bool isBad = (major == 1 && minor == 0 && build_1 <= 54);
+
+ if (isBad) {
+ // crashhandler_append_message_format(
+ // "Is bad AMD driver version; blacklisting.\n");
+ } else {
+ // crashhandler_append_message_format(
+ // "Not known bad AMD driver version; passing.\n");
+ }
+
+ return isBad;
+}
+
+using WindowsDllVersion = std::tuple<int, int, int, int>;
+
+bool badVulkanDllVersion() {
+ int major, minor, build_1, build_2;
+
+ // crashhandler_append_message_format(
+ // "checking for bad vulkan-1.dll version...\n");
+
+ if (!android::base::queryFileVersionInfo("vulkan-1.dll", &major, &minor, &build_1, &build_2)) {
+ // crashhandler_append_message_format(
+ // "info on vulkan-1.dll cannot be found, continue.\n");
+ // Information about vulkan-1.dll not available; not blacklisted
+ return false;
+ }
+
+ // crashhandler_append_message_format(
+ // "vulkan-1.dll version: %d.%d.%d.%d\n",
+ // major, minor, build_1, build_2);
+
+ // Ban all Windows Vulkan drivers < 1.1;
+ // they sometimes advertise vkEnumerateInstanceVersion
+ // and then running that function pointer causes a segfault.
+ // In any case, properly updated GPU drivers for Windows
+ // should all be 1.1 now for the major manufacturers
+ // (even Intel; see https://www.intel.com/content/www/us/en/support/articles/000005524/graphics-drivers.html)
+ bool isBad =
+ major == 1 && minor == 0;
+
+ if (isBad) {
+ // crashhandler_append_message_format(
+ // "Is bad vulkan-1.dll version; blacklisting.\n");
+ } else {
+ // crashhandler_append_message_format(
+ // "Not known bad vulkan-1.dll version; continue.\n");
+ }
+
+ return isBad;
+}
+
+bool isVulkanSafeToUseNative() {
+ return !badAmdVulkanDriverVersion() && !badVulkanDllVersion();
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/OpenglEsPipe.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/OpenglEsPipe.cpp
new file mode 100644
index 00000000000..60e4189abd7
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/OpenglEsPipe.cpp
@@ -0,0 +1,596 @@
+// Copyright 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 "host-common/opengl/OpenglEsPipe.h"
+
+#include "aemu/base/Optional.h"
+#include "aemu/base/files/PathUtils.h"
+#include "aemu/base/files/StreamSerializing.h"
+#include "aemu/base/threads/FunctorThread.h"
+#include "aemu/base/system/System.h"
+#include "host-common/globals.h"
+// #include "loadpng.h"
+#include "host-common/opengl/GLProcessPipe.h"
+#include "host-common/opengles-pipe.h"
+#include "host-common/opengles.h"
+// #include "snapshot/Loader.h"
+// #include "snapshot/Saver.h"
+// #include "snapshot/Snapshotter.h"
+
+#include <atomic>
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
+// Set to 1 or 2 for debug traces
+#define DEBUG 0
+
+#if DEBUG >= 1
+#define D(...) printf(__VA_ARGS__), printf("\n"), fflush(stdout)
+#else
+#define D(...) ((void)0)
+#endif
+
+#if DEBUG >= 2
+#define DD(...) printf(__VA_ARGS__), printf("\n"), fflush(stdout)
+#else
+#define DD(...) ((void)0)
+#endif
+
+using ChannelBuffer = gfxstream::RenderChannel::Buffer;
+using gfxstream::RenderChannel;
+using gfxstream::RenderChannelPtr;
+using ChannelState = gfxstream::RenderChannel::State;
+using IoResult = gfxstream::RenderChannel::IoResult;
+// using android::base::Stopwatch;
+// using android::snapshot::Snapshotter;
+
+#define OPENGL_SAVE_VERSION 1
+
+namespace android {
+namespace opengl {
+
+// TODO (b/138549350): See if Android/Fuchsia pipe protocols can be unified
+// to give the best performance in each guest OS.
+enum class RecvMode {
+ Android = 0,
+ Fuchsia = 1,
+ VirtioGpu = 2,
+};
+
+static RecvMode recvMode = RecvMode::Android;
+
+namespace {
+
+class EmuglPipe : public AndroidPipe {
+public:
+
+ //////////////////////////////////////////////////////////////////////////
+ // The pipe service class for this implementation.
+ class Service : public AndroidPipe::Service {
+ public:
+ Service() : AndroidPipe::Service("opengles") {}
+
+ // Create a new EmuglPipe instance.
+ AndroidPipe* create(void* hwPipe, const char* args, AndroidPipeFlags flags) override {
+ return createPipe(hwPipe, this, args, flags);
+ }
+
+ bool canLoad() const override { return true; }
+
+ virtual void preLoad(android::base::Stream* stream) override {
+// #ifdef SNAPSHOT_PROFILE
+// mLoadMeter.restartUs();
+// #endif
+// const bool hasRenderer = stream->getByte();
+// const auto& renderer = android_getOpenglesRenderer();
+// if (hasRenderer != (bool)renderer) {
+// // die?
+// return;
+// }
+// if (!hasRenderer) {
+// return;
+// }
+// int version = stream->getBe32();
+// (void)version;
+// renderer->load(stream, Snapshotter::get().loader().textureLoader());
+// #ifdef SNAPSHOT_PROFILE
+// printf("OpenglEs preload time: %lld ms\n",
+// (long long)(mLoadMeter.elapsedUs() / 1000));
+// #endif
+ }
+
+ void postLoad(android::base::Stream* stream) override {
+ if (const auto& renderer = android_getOpenglesRenderer()) {
+ renderer->resumeAll();
+ }
+#ifdef SNAPSHOT_PROFILE
+ printf("OpenglEs total load time: %lld ms\n",
+ (long long)(mLoadMeter.elapsedUs() / 1000));
+#endif
+ }
+
+ void preSave(android::base::Stream* stream) override {
+ // #ifdef SNAPSHOT_PROFILE
+ // mSaveMeter.restartUs();
+ // #endif
+ // if (const auto& renderer = android_getOpenglesRenderer()) {
+ // renderer->pauseAllPreSave();
+ // stream->putByte(1);
+ // stream->putBe32(OPENGL_SAVE_VERSION);
+ // renderer->save(stream,
+ // Snapshotter::get().saver().textureSaver());
+ //
+ // writeScreenshot(*renderer);
+ // } else {
+ // stream->putByte(0);
+ // }
+ }
+
+ void postSave(android::base::Stream* stream) override {
+ if (const auto& renderer = android_getOpenglesRenderer()) {
+ renderer->resumeAll();
+ }
+#ifdef SNAPSHOT_PROFILE
+ printf("OpenglEs total save time: %lld ms\n",
+ (long long)(mSaveMeter.elapsedUs() / 1000));
+#endif
+ }
+
+ virtual AndroidPipe* load(void* hwPipe,
+ const char* args,
+ android::base::Stream* stream) override {
+ return createPipe(hwPipe, this, args, ANDROID_PIPE_DEFAULT, stream);
+ }
+
+ private:
+ static AndroidPipe* createPipe(
+ void* hwPipe,
+ Service* service,
+ const char* args,
+ AndroidPipeFlags flags,
+ android::base::Stream* loadStream = nullptr) {
+ const auto& renderer = android_getOpenglesRenderer();
+ if (!renderer) {
+ // This should never happen, unless there is a bug in the
+ // emulator's initialization, or the system image, or we're
+ // loading from an incompatible snapshot.
+ D("Trying to open the OpenGLES pipe without GPU emulation!");
+ return nullptr;
+ }
+
+ auto pipe = new EmuglPipe(hwPipe, service, renderer, flags, loadStream);
+ if (!pipe->mIsWorking) {
+ delete pipe;
+ pipe = nullptr;
+ }
+ return pipe;
+ }
+
+ void writeScreenshot(gfxstream::Renderer& renderer) {
+ // #if SNAPSHOT_PROFILE > 1
+ // Stopwatch sw;
+ // #endif
+ // if (!mSnapshotCallbackRegistered) {
+ // // We have to wait for the screenshot saving thread, but
+ // // there's no need to join it too soon: it is ok to only
+ // // block when the rest of snapshot saving is complete.
+ // // Snapshotter::get().addOperationCallback(
+ // // [this](Snapshotter::Operation op,
+ // // Snapshotter::Stage stage) {
+ // // if (op == Snapshotter::Operation::Save &&
+ // // stage == Snapshotter::Stage::End) {
+ // // if (mScreenshotSaver) {
+ // // mScreenshotSaver->wait();
+ // // mScreenshotSaver.clear();
+ // // }
+ // // }
+ // // });
+ // mSnapshotCallbackRegistered = true;
+ // }
+ // // always do 4 channel screenshot because swiftshader_indirect
+ // // has issues with 3 channels
+ // const unsigned int nChannels = 4;
+ // unsigned int width;
+ // unsigned int height;
+ // std::vector<unsigned char> pixels;
+ // renderer.getScreenshot(nChannels, &width, &height, pixels);
+ // #if SNAPSHOT_PROFILE > 1
+ // printf("Screenshot load texture time %lld ms\n",
+ // (long long)(sw.elapsedUs() / 1000));
+ // #endif
+ // if (width > 0 && height > 0) {
+ // std::string dataDir =
+ // Snapshotter::get().saver().snapshot().dataDir();
+ // mScreenshotSaver.emplace([nChannels, width, height,
+ // dataDir = std::move(dataDir),
+ // pixels = std::move(pixels)] {
+ // #if SNAPSHOT_PROFILE > 1
+ // Stopwatch sw;
+ // #endif
+ // std::string fileName = android::base::PathUtils::join(
+ // dataDir, "screenshot.png");
+ // // TODO: fix the screenshot rotation?
+ // savepng(fileName.c_str(), nChannels, width, height,
+ // SKIN_ROTATION_0,
+ // const_cast<unsigned char*>(pixels.data()));
+ // #if SNAPSHOT_PROFILE > 1
+ // printf("Screenshot image write time %lld ms\n",
+ // (long long)(sw.elapsedUs() / 1000));
+ // #endif
+ // });
+ // mScreenshotSaver->start();
+ // }
+ }
+
+ base::Optional<base::FunctorThread> mScreenshotSaver;
+#ifdef SNAPSHOT_PROFILE
+ Stopwatch mSaveMeter;
+ Stopwatch mLoadMeter;
+#endif
+ };
+
+ /////////////////////////////////////////////////////////////////////////
+ // Constructor, check that |mIsWorking| is true after this call to verify
+ // that everything went well.
+ EmuglPipe(void* hwPipe, Service* service, const gfxstream::RendererPtr& renderer,
+ AndroidPipeFlags flags, android::base::Stream* loadStream = nullptr)
+ : AndroidPipe(hwPipe, service) {
+ bool isWorking = true;
+ if (loadStream) {
+ DD("%s: loading GLES pipe state for hwpipe=%p", __func__, mHwPipe);
+ isWorking = (bool)loadStream->getBe32();
+ android::base::loadBuffer(loadStream, &mDataForReading);
+ mDataForReadingLeft = loadStream->getBe32();
+ }
+
+ uint32_t virtioGpuContextId = -1;
+ if (flags & ANDROID_PIPE_VIRTIO_GPU_BIT) {
+ virtioGpuContextId = (uint32_t)(uintptr_t)hwPipe;
+ }
+
+ mChannel = renderer->createRenderChannel(loadStream, virtioGpuContextId);
+ if (!mChannel) {
+ D("Failed to create an OpenGLES pipe channel!");
+ return;
+ }
+
+ mIsWorking = isWorking;
+ mChannel->setEventCallback([this](RenderChannel::State events) {
+ onChannelHostEvent(events);
+ });
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // Overriden AndroidPipe methods
+
+ virtual void onSave(android::base::Stream* stream) override {
+ DD("%s: saving GLES pipe state for hwpipe=%p", __FUNCTION__, mHwPipe);
+ stream->putBe32(mIsWorking);
+ android::base::saveBuffer(stream, mDataForReading);
+ stream->putBe32(mDataForReadingLeft);
+
+ mChannel->onSave(stream);
+ }
+
+ virtual void onGuestClose(PipeCloseReason reason) override {
+ D("%s", __func__);
+ mIsWorking = false;
+ mChannel->stop();
+ // Make sure there's no operation scheduled for this pipe instance to
+ // run on the main thread.
+ abortPendingOperation();
+ delete this;
+ }
+
+ virtual unsigned onGuestPoll() const override {
+ DD("%s", __func__);
+
+ unsigned ret = 0;
+ if (mDataForReadingLeft > 0) {
+ ret |= PIPE_POLL_IN;
+ }
+ ChannelState state = mChannel->state();
+ if ((state & ChannelState::CanRead) != 0) {
+ ret |= PIPE_POLL_IN;
+ }
+ if ((state & ChannelState::CanWrite) != 0) {
+ ret |= PIPE_POLL_OUT;
+ }
+ if ((state & ChannelState::Stopped) != 0) {
+ ret |= PIPE_POLL_HUP;
+ }
+ DD("%s: returning %d", __func__, ret);
+ return ret;
+ }
+
+ virtual int onGuestRecv(AndroidPipeBuffer* buffers,
+ int numBuffers) override {
+ DD("%s", __func__);
+
+ // Consume the pipe's dataForReading, then put the next received data
+ // piece there. Repeat until the buffers are full or we're out of data
+ // in the channel.
+ int len = 0;
+ size_t buffOffset = 0;
+
+ auto buff = buffers;
+ const auto buffEnd = buff + numBuffers;
+ while (buff != buffEnd) {
+ if (mDataForReadingLeft == 0) {
+ if (android::opengl::recvMode == android::opengl::RecvMode::Android) {
+ // No data left, read a new chunk from the channel.
+ int spinCount = 20;
+ for (;;) {
+
+ auto result = mChannel->tryRead(&mDataForReading);
+ if (result == IoResult::Ok) {
+ mDataForReadingLeft = mDataForReading.size();
+ break;
+ }
+ DD("%s: tryRead() failed with %d", __func__, (int)result);
+ if (len > 0) {
+ DD("%s: returning %d bytes", __func__, (int)len);
+ return len;
+ }
+ // This failed either because the channel was stopped
+ // from the host, or if there was no data yet in the
+ if (result == IoResult::Error) {
+ return PIPE_ERROR_IO;
+ }
+ // Spin a little before declaring there is nothing
+ // to read. Many GL calls are much faster than the
+ // whole host-to-guest-to-host transition.
+ if (--spinCount > 0) {
+ continue;
+ }
+ DD("%s: returning PIPE_ERROR_AGAIN", __func__);
+ return PIPE_ERROR_AGAIN;
+ }
+ } else if (android::opengl::recvMode == android::opengl::RecvMode::Fuchsia) {
+ // No data left, return if we already received some data,
+ // otherwise read a new chunk from the channel.
+ if (len > 0) {
+ DD("%s: returning %d bytes", __func__, (int)len);
+ return len;
+ }
+ // Block a little before declaring there is nothing
+ // to read. This gives the render thread a chance to
+ // process pending data before we return control to
+ // the guest. The amount of time we block here should
+ // be kept at a minimum. It's preferred to instead have
+ // the guest block on work that takes a significant
+ // amount of time.
+
+ const RenderChannel::Duration kBlockAtMostUs = 100;
+ auto currTime = android::base::getUnixTimeUs();
+ auto result = mChannel->readBefore(&mDataForReading, currTime + kBlockAtMostUs);
+
+ if (result != IoResult::Ok) {
+ DD("%s: tryRead() failed with %d", __func__, (int)result);
+ // This failed either because the channel was stopped
+ // from the host, or if there was no data yet in the
+ // channel.
+ if (len > 0) {
+ DD("%s: returning %d bytes", __func__, (int)len);
+ return len;
+ }
+ if (result == IoResult::Error) {
+ return PIPE_ERROR_IO;
+ }
+
+ DD("%s: returning PIPE_ERROR_AGAIN", __func__);
+ return PIPE_ERROR_AGAIN;
+ }
+ mDataForReadingLeft = mDataForReading.size();
+ } else { // Virtio-gpu
+ // No data left, return if we already received some data,
+ // otherwise read a new chunk from the channel.
+ if (len > 0) {
+ DD("%s: returning %d bytes", __func__, (int)len);
+ return len;
+ }
+ // Block a little before declaring there is nothing
+ // to read. This gives the render thread a chance to
+ // process pending data before we return control to
+ // the guest. The amount of time we block here should
+ // be kept at a minimum. It's preferred to instead have
+ // the guest block on work that takes a significant
+ // amount of time.
+
+ const RenderChannel::Duration kBlockAtMostUs = 10000;
+ auto currTime = android::base::getUnixTimeUs();
+ auto result = mChannel->readBefore(&mDataForReading, currTime + kBlockAtMostUs);
+
+ if (result != IoResult::Ok) {
+ DD("%s: tryRead() failed with %d", __func__, (int)result);
+ // This failed either because the channel was stopped
+ // from the host, or if there was no data yet in the
+ // channel.
+ if (len > 0) {
+ DD("%s: returning %d bytes", __func__, (int)len);
+ return len;
+ }
+ if (result == IoResult::Error) {
+ return PIPE_ERROR_IO;
+ }
+
+ DD("%s: returning PIPE_ERROR_AGAIN", __func__);
+ return PIPE_ERROR_AGAIN;
+ }
+ mDataForReadingLeft = mDataForReading.size();
+ }
+ }
+
+ const size_t curSize = std::min<size_t>(buff->size - buffOffset,
+ mDataForReadingLeft);
+ memcpy(buff->data + buffOffset,
+ mDataForReading.data() +
+ (mDataForReading.size() - mDataForReadingLeft),
+ curSize);
+
+ len += curSize;
+ mDataForReadingLeft -= curSize;
+ buffOffset += curSize;
+ if (buffOffset == buff->size) {
+ ++buff;
+ buffOffset = 0;
+ }
+ }
+
+ DD("%s: received %d bytes", __func__, (int)len);
+ return len;
+ }
+
+ virtual int onGuestSend(const AndroidPipeBuffer* buffers,
+ int numBuffers,
+ void** newPipePtr) override {
+ DD("%s", __func__);
+
+ if (!mIsWorking) {
+ DD("%s: pipe already closed!", __func__);
+ return PIPE_ERROR_IO;
+ }
+
+ // Count the total bytes to send.
+ int count = 0;
+ for (int n = 0; n < numBuffers; ++n) {
+ count += buffers[n].size;
+ }
+
+ // Copy everything into a single ChannelBuffer.
+ ChannelBuffer outBuffer;
+ outBuffer.resize_noinit(count);
+ auto ptr = outBuffer.data();
+ for (int n = 0; n < numBuffers; ++n) {
+ memcpy(ptr, buffers[n].data, buffers[n].size);
+ ptr += buffers[n].size;
+ }
+
+ D("%s: %p sending %d bytes to host", __func__, this, count);
+ // Send it through the channel.
+ auto result = mChannel->tryWrite(std::move(outBuffer));
+ if (result != IoResult::Ok) {
+ D("%s: tryWrite() failed with %d", __func__, (int)result);
+ return result == IoResult::Error ? PIPE_ERROR_IO : PIPE_ERROR_AGAIN;
+ }
+
+ return count;
+ }
+
+ virtual void onGuestWantWakeOn(int flags) override {
+ DD("%s: flags=%d", __func__, flags);
+
+ // Translate |flags| into ChannelState flags.
+ ChannelState wanted = ChannelState::Empty;
+ if (flags & PIPE_WAKE_READ) {
+ wanted |= ChannelState::CanRead;
+ }
+ if (flags & PIPE_WAKE_WRITE) {
+ wanted |= ChannelState::CanWrite;
+ }
+
+ // Signal events that are already available now.
+ ChannelState state = mChannel->state();
+ ChannelState available = state & wanted;
+ DD("%s: state=%d wanted=%d available=%d", __func__, (int)state,
+ (int)wanted, (int)available);
+ if (available != ChannelState::Empty) {
+ DD("%s: signaling events %d", __func__, (int)available);
+ signalState(available);
+ wanted &= ~available;
+ }
+
+ // Ask the channel to be notified of remaining events.
+ if (wanted != ChannelState::Empty) {
+ DD("%s: waiting for events %d", __func__, (int)wanted);
+ mChannel->setWantedEvents(wanted);
+ }
+ }
+
+private:
+ // Called to signal the guest that read/write wake events occured.
+ // Note: this can be called from either the guest or host render
+ // thread.
+ void signalState(ChannelState state) {
+ int wakeFlags = 0;
+ if ((state & ChannelState::CanRead) != 0) {
+ wakeFlags |= PIPE_WAKE_READ;
+ }
+ if ((state & ChannelState::CanWrite) != 0) {
+ wakeFlags |= PIPE_WAKE_WRITE;
+ }
+ if (wakeFlags != 0) {
+ this->signalWake(wakeFlags);
+ }
+ }
+
+ // Called when an i/o event occurs on the render channel
+ void onChannelHostEvent(ChannelState state) {
+ D("%s: events %d (working %d)", __func__, (int)state, (int)mIsWorking);
+ // NOTE: This is called from the host-side render thread.
+ // but closeFromHost() and signalWake() can be called from
+ // any thread.
+ if (!mIsWorking) {
+ return;
+ }
+ if ((state & ChannelState::Stopped) != 0) {
+ this->closeFromHost();
+ return;
+ }
+ signalState(state);
+ }
+
+ // A RenderChannel pointer used for communication.
+ RenderChannelPtr mChannel;
+
+ // Set to |true| if the pipe is in working state, |false| means we're not
+ // initialized or the pipe is closed.
+ bool mIsWorking = false;
+
+ // These two variables serve as a reading buffer for the guest.
+ // Each time we get a read request, first we extract a single chunk from
+ // the |mChannel| into here, and then copy its content into the
+ // guest-supplied memory.
+ // If guest didn't have enough room for the whole buffer, we track the
+ // number of remaining bytes in |mDataForReadingLeft| for the next read().
+ uint32_t mDataForReadingLeft = 0;
+ ChannelBuffer mDataForReading;
+
+ DISALLOW_COPY_ASSIGN_AND_MOVE(EmuglPipe);
+};
+
+} // namespace
+
+void registerPipeService() {
+ android::AndroidPipe::Service::add(std::make_unique<EmuglPipe::Service>());
+ registerGLProcessPipeService();
+}
+
+void pipeSetRecvMode(int mode) {
+ recvMode = (RecvMode)mode;
+}
+
+} // namespace opengl
+} // namespace android
+
+// Declared in android/opengles-pipe.h
+void android_init_opengles_pipe() {
+ android::opengl::registerPipeService();
+}
+
+void android_opengles_pipe_set_recv_mode(int mode) {
+ android::opengl::pipeSetRecvMode(mode);
+}
+
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/emugl_config.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/emugl_config.cpp
new file mode 100644
index 00000000000..d8f3f1601e5
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/emugl_config.cpp
@@ -0,0 +1,473 @@
+// Copyright 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 "host-common/opengl/emugl_config.h"
+
+#include "aemu/base/StringFormat.h"
+#include "aemu/base/system/System.h"
+#include "host-common/globals.h"
+#include "host-common/opengl/EmuglBackendList.h"
+#include "host-common/opengl/gpuinfo.h"
+#include "host-common/opengl/misc.h"
+
+#include <string>
+
+#include <assert.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define DEBUG 0
+
+#if DEBUG
+#define D(...) printf(__VA_ARGS__)
+#else
+// #define D(...) crashhandler_append_message_format(__VA_ARGS__)
+#define D(...)
+#endif
+
+using android::base::StringFormat;
+using android::opengl::EmuglBackendList;
+
+static EmuglBackendList* sBackendList = NULL;
+
+static void resetBackendList(int bitness) {
+ delete sBackendList;
+ std::vector<std::string> fixedBackendNames = {
+ "swiftshader_indirect",
+ "angle_indirect",
+ };
+ sBackendList = new EmuglBackendList(64, fixedBackendNames);
+}
+
+static bool stringVectorContains(const std::vector<std::string>& list,
+ const char* value) {
+ for (size_t n = 0; n < list.size(); ++n) {
+ if (!strcmp(list[n].c_str(), value)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool isHostGpuBlacklisted() {
+ return async_query_host_gpu_blacklisted();
+}
+
+// Get a description of host GPU properties.
+// Need to free after use.
+emugl_host_gpu_prop_list emuglConfig_get_host_gpu_props() {
+ const GpuInfoList& gpulist = globalGpuInfoList();
+ emugl_host_gpu_prop_list res;
+ res.num_gpus = gpulist.infos.size();
+ res.props = new emugl_host_gpu_props[res.num_gpus];
+
+ const std::vector<GpuInfo>& infos = gpulist.infos;
+ for (int i = 0; i < res.num_gpus; i++) {
+ res.props[i].make = strdup(infos[i].make.c_str());
+ res.props[i].model = strdup(infos[i].model.c_str());
+ res.props[i].device_id = strdup(infos[i].device_id.c_str());
+ res.props[i].revision_id = strdup(infos[i].revision_id.c_str());
+ res.props[i].version = strdup(infos[i].version.c_str());
+ res.props[i].renderer = strdup(infos[i].renderer.c_str());
+ }
+ return res;
+}
+
+SelectedRenderer emuglConfig_get_renderer(const char* gpu_mode) {
+ if (!gpu_mode) {
+ return SELECTED_RENDERER_UNKNOWN;
+ } else if (!strcmp(gpu_mode, "host") ||
+ !strcmp(gpu_mode, "on")) {
+ return SELECTED_RENDERER_HOST;
+ } else if (!strcmp(gpu_mode, "off")) {
+ return SELECTED_RENDERER_OFF;
+ } else if (!strcmp(gpu_mode, "guest")) {
+ return SELECTED_RENDERER_GUEST;
+ } else if (!strcmp(gpu_mode, "mesa")) {
+ return SELECTED_RENDERER_MESA;
+ } else if (!strcmp(gpu_mode, "swiftshader")) {
+ return SELECTED_RENDERER_SWIFTSHADER;
+ } else if (!strcmp(gpu_mode, "angle")) {
+ return SELECTED_RENDERER_ANGLE;
+ } else if (!strcmp(gpu_mode, "angle9")) {
+ return SELECTED_RENDERER_ANGLE9;
+ } else if (!strcmp(gpu_mode, "swiftshader_indirect")) {
+ return SELECTED_RENDERER_SWIFTSHADER_INDIRECT;
+ } else if (!strcmp(gpu_mode, "angle_indirect")) {
+ return SELECTED_RENDERER_ANGLE_INDIRECT;
+ } else if (!strcmp(gpu_mode, "angle9_indirect")) {
+ return SELECTED_RENDERER_ANGLE9_INDIRECT;
+ } else if (!strcmp(gpu_mode, "error")) {
+ return SELECTED_RENDERER_ERROR;
+ } else {
+ return SELECTED_RENDERER_UNKNOWN;
+ }
+}
+
+static SelectedRenderer sCurrentRenderer =
+ SELECTED_RENDERER_UNKNOWN;
+
+SelectedRenderer emuglConfig_get_current_renderer() {
+ return sCurrentRenderer;
+}
+
+static std::string sGpuOption;
+
+const char* emuglConfig_get_user_gpu_option() {
+ return sGpuOption.c_str();
+}
+
+const char* emuglConfig_renderer_to_string(SelectedRenderer renderer) {
+ switch (renderer) {
+ case SELECTED_RENDERER_UNKNOWN:
+ return "(Unknown)";
+ case SELECTED_RENDERER_HOST:
+ return "Host";
+ case SELECTED_RENDERER_OFF:
+ return "Off";
+ case SELECTED_RENDERER_GUEST:
+ return "Guest";
+ case SELECTED_RENDERER_MESA:
+ return "Mesa";
+ case SELECTED_RENDERER_SWIFTSHADER:
+ return "Swiftshader";
+ case SELECTED_RENDERER_ANGLE:
+ return "Angle";
+ case SELECTED_RENDERER_ANGLE9:
+ return "Angle9";
+ case SELECTED_RENDERER_SWIFTSHADER_INDIRECT:
+ return "Swiftshader Indirect";
+ case SELECTED_RENDERER_ANGLE_INDIRECT:
+ return "Angle Indirect";
+ case SELECTED_RENDERER_ANGLE9_INDIRECT:
+ return "Angle9 Indirect";
+ case SELECTED_RENDERER_ERROR:
+ return "(Error)";
+ }
+ return "(Bad value)";
+}
+
+bool emuglConfig_current_renderer_supports_snapshot() {
+ if (aemu_get_android_hw()->hw_arc) {
+ return sCurrentRenderer == SELECTED_RENDERER_OFF ||
+ sCurrentRenderer == SELECTED_RENDERER_GUEST;
+ }
+ return sCurrentRenderer == SELECTED_RENDERER_HOST ||
+ sCurrentRenderer == SELECTED_RENDERER_OFF ||
+ sCurrentRenderer == SELECTED_RENDERER_GUEST ||
+ sCurrentRenderer == SELECTED_RENDERER_ANGLE_INDIRECT ||
+ sCurrentRenderer == SELECTED_RENDERER_SWIFTSHADER_INDIRECT;
+}
+
+void free_emugl_host_gpu_props(emugl_host_gpu_prop_list proplist) {
+ for (int i = 0; i < proplist.num_gpus; i++) {
+ free(proplist.props[i].make);
+ free(proplist.props[i].model);
+ free(proplist.props[i].device_id);
+ free(proplist.props[i].revision_id);
+ free(proplist.props[i].version);
+ free(proplist.props[i].renderer);
+ }
+ delete [] proplist.props;
+}
+
+static void setCurrentRenderer(const char* gpuMode) {
+ sCurrentRenderer = emuglConfig_get_renderer(gpuMode);
+}
+
+bool emuglConfig_init(EmuglConfig* config,
+ bool gpu_enabled,
+ const char* gpu_mode,
+ const char* gpu_option,
+ int bitness,
+ bool no_window,
+ bool blacklisted,
+ bool has_guest_renderer,
+ int uiPreferredBackend,
+ bool use_host_vulkan) {
+ D("%s: blacklisted=%d has_guest_renderer=%d, mode: %s, option: %s\n",
+ __FUNCTION__,
+ blacklisted,
+ has_guest_renderer,
+ gpu_mode, gpu_option);
+
+ // zero all fields first.
+ memset(config, 0, sizeof(*config));
+
+ bool host_set_in_hwconfig = false;
+ bool has_auto_no_window = false;
+
+ bool hasUiPreference = uiPreferredBackend != WINSYS_GLESBACKEND_PREFERENCE_AUTO;
+
+ // The value of '-gpu <mode>' overrides both the hardware properties
+ // and the UI setting, except if <mode> is 'auto'.
+ if (gpu_option) {
+ sGpuOption = gpu_option;
+ if (!strcmp(gpu_option, "on") || !strcmp(gpu_option, "enable")) {
+ gpu_enabled = true;
+ if (!gpu_mode || !strcmp(gpu_mode, "auto")) {
+ gpu_mode = "host";
+ }
+ } else if (!strcmp(gpu_option, "off") ||
+ !strcmp(gpu_option, "disable") ||
+ !strcmp(gpu_option, "guest")) {
+ gpu_mode = gpu_option;
+ gpu_enabled = false;
+ } else if (!strcmp(gpu_option, "auto")){
+ // Nothing to do, use gpu_mode set from
+ // hardware properties instead.
+ } else if (!strcmp(gpu_option, "auto-no-window")) {
+ // Nothing to do, use gpu_mode set from
+ // hardware properties instead.
+ has_auto_no_window = true;
+ } else {
+ gpu_enabled = true;
+ gpu_mode = gpu_option;
+ }
+ } else {
+ // Support "hw.gpu.mode=on" in config.ini
+ if (gpu_enabled && gpu_mode && (
+ !strcmp(gpu_mode, "on") ||
+ !strcmp(gpu_mode, "enable") ||
+ !strcmp(gpu_mode, "host"))) {
+ gpu_enabled = true;
+ gpu_mode = "host";
+ host_set_in_hwconfig = true;
+ }
+ }
+ sGpuOption = gpu_mode;
+
+ if (gpu_mode &&
+ (!strcmp(gpu_mode, "guest") ||
+ !strcmp(gpu_mode, "off"))) {
+ gpu_enabled = false;
+ }
+
+ if (!gpu_option && hasUiPreference) {
+ gpu_enabled = true;
+ gpu_mode = "auto";
+ }
+
+ if (!gpu_enabled) {
+ config->enabled = false;
+ snprintf(config->backend, sizeof(config->backend), "%s", gpu_mode);
+ snprintf(config->status, sizeof(config->status),
+ "GPU emulation is disabled");
+ setCurrentRenderer(gpu_mode);
+ return true;
+ }
+
+ if (gpu_mode && !strcmp("angle", gpu_mode)) {
+ gpu_mode = "angle_indirect";
+ }
+
+ if (gpu_mode && !strcmp("swiftshader", gpu_mode)) {
+ gpu_mode = "swiftshader_indirect";
+ }
+
+ if (!bitness) {
+ bitness = 64;
+ }
+
+ config->bitness = bitness;
+ config->use_host_vulkan = use_host_vulkan;
+ resetBackendList(bitness);
+
+ // Check that the GPU mode is a valid value. 'auto' means determine
+ // the best mode depending on the environment. Its purpose is to
+ // enable 'swiftshader' mode automatically when NX or Chrome Remote Desktop
+ // is detected.
+ if ((gpu_mode && !strcmp(gpu_mode, "auto")) || host_set_in_hwconfig) {
+ // The default will be 'host' unless:
+ // 1. NX or Chrome Remote Desktop is detected, or |no_window| is true.
+ // 2. The user's host GPU is on the blacklist.
+ std::string sessionType;
+ if (!has_auto_no_window && (no_window || (blacklisted && !hasUiPreference))) {
+ if (stringVectorContains(sBackendList->names(), "swiftshader")) {
+ D("%s: Headless mode or blacklisted GPU driver, "
+ "using Swiftshader backend\n",
+ __FUNCTION__);
+ gpu_mode = "swiftshader_indirect";
+ } else if (!has_guest_renderer) {
+ D("%s: Headless (-no-window) mode (or blacklisted GPU driver)"
+ " without Swiftshader, forcing '-gpu off'\n",
+ __FUNCTION__);
+ config->enabled = false;
+ gpu_mode = "off";
+ snprintf(config->backend, sizeof(config->backend), "%s", gpu_mode);
+ snprintf(config->status, sizeof(config->status),
+ "GPU emulation is disabled (-no-window without Swiftshader)");
+ setCurrentRenderer(gpu_mode);
+ return true;
+ } else {
+ D("%s: Headless (-no-window) mode (or blacklisted GPU driver)"
+ ", using guest GPU backend\n",
+ __FUNCTION__);
+ config->enabled = false;
+ gpu_mode = "off";
+ snprintf(config->backend, sizeof(config->backend), "%s", gpu_mode);
+ snprintf(config->status, sizeof(config->status),
+ "GPU emulation is in the guest");
+ gpu_mode = "guest";
+ setCurrentRenderer(gpu_mode);
+ return true;
+ }
+ } else {
+ switch (uiPreferredBackend) {
+ case WINSYS_GLESBACKEND_PREFERENCE_ANGLE:
+ gpu_mode = "angle_indirect";
+ break;
+ case WINSYS_GLESBACKEND_PREFERENCE_ANGLE9:
+ gpu_mode = "angle_indirect";
+ break;
+ case WINSYS_GLESBACKEND_PREFERENCE_SWIFTSHADER:
+ gpu_mode = "swiftshader_indirect";
+ break;
+ case WINSYS_GLESBACKEND_PREFERENCE_NATIVEGL:
+ gpu_mode = "host";
+ break;
+ default:
+ gpu_mode = "host";
+ break;
+ }
+ D("%s: auto-selected %s based on conditions and UI preference %d\n",
+ __func__, gpu_mode, uiPreferredBackend);
+ }
+ }
+
+ // 'host' is a special value corresponding to the default translation
+ // to desktop GL, 'guest' does not use host-side emulation,
+ // anything else must be checked against existing host-side backends.
+ if (!gpu_mode ||
+ (strcmp(gpu_mode, "host") != 0 && strcmp(gpu_mode, "guest") != 0)) {
+ const std::vector<std::string>& backends = sBackendList->names();
+ if (!gpu_mode || !stringVectorContains(backends, gpu_mode)) {
+ std::string error = StringFormat(
+ "Invalid GPU mode '%s', use one of: host swiftshader_indirect. "
+ "If you're already using one of those modes, "
+ "the emulator installation may be corrupt. "
+ "Please re-install the emulator.", gpu_mode);
+
+ for (size_t n = 0; n < backends.size(); ++n) {
+ error += " ";
+ error += backends[n];
+ }
+
+ D("%s: Error: [%s]\n", __func__, error.c_str());
+ fprintf(stderr, "%s: %s\n", __func__, error.c_str());
+
+ config->enabled = false;
+ gpu_mode = "error";
+ snprintf(config->backend, sizeof(config->backend), "%s", gpu_mode);
+ snprintf(config->status, sizeof(config->status), "%s",
+ error.c_str());
+ setCurrentRenderer(gpu_mode);
+ return false;
+ }
+ }
+
+ if (strcmp(gpu_mode, "guest")) {
+ config->enabled = true;
+ }
+
+ snprintf(config->backend, sizeof(config->backend), "%s", gpu_mode);
+ snprintf(config->status, sizeof(config->status),
+ "GPU emulation enabled using '%s' mode", gpu_mode);
+ setCurrentRenderer(gpu_mode);
+ D("%s: %s\n", __func__, config->status);
+ return true;
+}
+
+void emuglConfig_setupEnv(const EmuglConfig* config) {
+ if (config->use_host_vulkan) {
+ android::base::setEnvironmentVariable("ANDROID_EMU_VK_ICD", "");
+ } else if (sCurrentRenderer == SELECTED_RENDERER_SWIFTSHADER_INDIRECT) {
+ // Use Swiftshader vk icd if using swiftshader_indirect
+ android::base::setEnvironmentVariable("ANDROID_EMU_VK_ICD", "swiftshader");
+ }
+
+ if (!config->enabled) {
+ // There is no real GPU emulation. As a special case, define
+ // SDL_RENDER_DRIVER to 'software' to ensure that the
+ // software SDL renderer is being used. This allows one
+ // to run with '-gpu off' under NX and Chrome Remote Desktop
+ // properly.
+ android::base::setEnvironmentVariable("SDL_RENDER_DRIVER", "software");
+ return;
+ }
+
+ // $EXEC_DIR/<lib>/ is already added to the library search path by default,
+ // since generic libraries are bundled there. We may need more though:
+ resetBackendList(config->bitness);
+ if (strcmp(config->backend, "host") != 0) {
+ // If the backend is not 'host', we also need to add the
+ // backend directory.
+ std::string dir = sBackendList->getLibDirPath(config->backend);
+ if (dir.size()) {
+ D("Adding to the library search path: %s\n", dir.c_str());
+ // fprintf(stderr, "%s: non-host backends not supported\n", __func__);
+ // abort();
+ // android::base::addLibrarySearchDir(dir);
+ }
+ }
+
+ if (!strcmp(config->backend, "host")) {
+ // Nothing more to do for the 'host' backend.
+ return;
+ }
+
+ if (!strcmp(config->backend, "angle_indirect")
+ || !strcmp(config->backend, "swiftshader_indirect")) {
+ android::base::setEnvironmentVariable("ANDROID_EGL_ON_EGL", "1");
+ return;
+ }
+
+ // For now, EmuGL selects its own translation libraries for
+ // EGL/GLES libraries, unless the following environment
+ // variables are defined:
+ // ANDROID_EGL_LIB
+ // ANDROID_GLESv1_LIB
+ // ANDROID_GLESv2_LIB
+ //
+ // If a backend provides one of these libraries, use it.
+ std::string lib;
+ if (sBackendList->getBackendLibPath(
+ config->backend, EmuglBackendList::LIBRARY_EGL, &lib)) {
+ android::base::setEnvironmentVariable("ANDROID_EGL_LIB", lib);
+ }
+ if (sBackendList->getBackendLibPath(
+ config->backend, EmuglBackendList::LIBRARY_GLESv1, &lib)) {
+ android::base::setEnvironmentVariable("ANDROID_GLESv1_LIB", lib);
+ } else if (strcmp(config->backend, "mesa")) {
+ fprintf(stderr, "OpenGL backend '%s' without OpenGL ES 1.x library detected. "
+ "Using GLESv2 only.\n",
+ config->backend);
+ // A GLESv1 lib is optional---we can deal with a GLESv2 only
+ // backend by using CoreProfileEngine in the Translator.
+ }
+
+ if (sBackendList->getBackendLibPath(
+ config->backend, EmuglBackendList::LIBRARY_GLESv2, &lib)) {
+ android::base::setEnvironmentVariable("ANDROID_GLESv2_LIB", lib);
+ }
+
+ if (!strcmp(config->backend, "mesa")) {
+ fprintf(stderr, "WARNING: The Mesa software renderer is deprecated. "
+ "Use Swiftshader (-gpu swiftshader) for software rendering.\n");
+ android::base::setEnvironmentVariable("ANDROID_GL_LIB", "mesa");
+ android::base::setEnvironmentVariable("ANDROID_GL_SOFTWARE_RENDERER", "1");
+ }
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/emugl_config_unittest.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/emugl_config_unittest.cpp
new file mode 100644
index 00000000000..2938d687365
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/emugl_config_unittest.cpp
@@ -0,0 +1,549 @@
+// Copyright 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/opengl/emugl_config.h"
+#include "android/opengl/EmuglBackendList.h"
+#include "android/opengl/gpuinfo.h"
+
+#include "android/base/testing/TestSystem.h"
+#include "android/base/testing/TestTempDir.h"
+
+#include <gtest/gtest.h>
+
+namespace android {
+namespace base {
+
+#if defined(_WIN32)
+# define LIB_NAME(x) x ".dll"
+#elif defined(__APPLE__)
+# define LIB_NAME(x) "lib" x ".dylib"
+#else
+# define LIB_NAME(x) "lib" x ".so"
+#endif
+
+static std::string makeLibSubPath(const char* name) {
+ return StringFormat("%s/%s/%s",
+ System::get()->getLauncherDirectory().c_str(),
+ System::kLibSubDir, name);
+}
+
+static void makeLibSubDir(TestTempDir* dir, const char* name) {
+ dir->makeSubDir(makeLibSubPath(name).c_str());
+}
+
+static void makeLibSubFile(TestTempDir* dir, const char* name) {
+ dir->makeSubFile(makeLibSubPath(name).c_str());
+}
+
+TEST(EmuglConfig, init) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ makeLibSubDir(myDir, "gles_mesa");
+ makeLibSubFile(myDir, "gles_mesa/libGLES.so");
+
+ makeLibSubDir(myDir, "gles_vendor");
+ makeLibSubFile(myDir, "gles_vendor/" LIB_NAME("EGL"));
+ makeLibSubFile(myDir, "gles_vendor/" LIB_NAME("GLESv2"));
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, false, "host", NULL, 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "host", NULL, 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("host", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'host' mode", config.status);
+ }
+
+ // Check that "host" mode is available with -no-window if explicitly
+ // specified on command line.
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "host", "host", 0, true, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("host", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'host' mode", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "mesa", NULL, 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("mesa", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'mesa' mode", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "host", "off", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "host", "disable", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, false, "host", "on", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("host", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'host' mode", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, false, NULL, "on", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("host", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'host' mode", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, false, "mesa", "enable", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("mesa", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'mesa' mode", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, false, "vendor", "auto", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "host", "vendor", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("vendor", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'vendor' mode", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "guest", "auto", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, false, "guest", "auto", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "host", "guest", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ }
+
+}
+
+TEST(EmuglConfig, initFromUISetting) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ makeLibSubDir(myDir, "gles_mesa");
+ makeLibSubFile(myDir, "gles_mesa/libGLES.so");
+
+ makeLibSubDir(myDir, "gles_angle");
+ makeLibSubFile(myDir, "gles_angle/" LIB_NAME("EGL"));
+ makeLibSubFile(myDir, "gles_angle/" LIB_NAME("GLESv2"));
+
+ makeLibSubDir(myDir, "gles_angle9");
+ makeLibSubFile(myDir, "gles_angle9/" LIB_NAME("EGL"));
+ makeLibSubFile(myDir, "gles_angle9/" LIB_NAME("GLESv2"));
+
+ makeLibSubDir(myDir, "gles_swiftshader");
+ makeLibSubFile(myDir, "gles_swiftshader/" LIB_NAME("EGL"));
+ makeLibSubFile(myDir, "gles_swiftshader/" LIB_NAME("GLESv2"));
+
+ // If the gpu command line option is specified, the UI setting is overridden.
+ for (int i = 0; i < 10; i++) {
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, false, "host", "on", 0, false, false, false,
+ (enum WinsysPreferredGlesBackend)i, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("host", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'host' mode", config.status);
+ }
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, false, "guest", "auto", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled", config.status);
+ }
+ }
+
+ // If the UI setting is not "auto", and there is no gpu command line option,
+ // then use the UI setting, regardless of the AVD config.
+ for (int i = 1; i < 5; i++) {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, false, "host", NULL, 0, false, false, false,
+ (enum WinsysPreferredGlesBackend)i, false));
+
+ EXPECT_TRUE(config.enabled);
+ switch (i) {
+ case 0:
+ EXPECT_STREQ("host", config.backend);
+ break;
+ case 1:
+ EXPECT_STREQ("angle_indirect", config.backend);
+ break;
+ case 2:
+ EXPECT_STREQ("angle_indirect", config.backend);
+ break;
+ case 3:
+ EXPECT_STREQ("swiftshader_indirect", config.backend);
+ break;
+ case 4:
+ EXPECT_STREQ("host", config.backend);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+TEST(EmuglConfig, initGLESv2Only) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ makeLibSubDir(myDir, "gles_angle");
+
+#ifdef _WIN32
+ const char* kEglLibName = "libEGL.dll";
+ const char* kGLESv1LibName = "libGLES_CM.dll";
+ const char* kGLESv2LibName = "libGLESv2.dll";
+#elif defined(__APPLE__)
+ const char* kEglLibName = "libEGL.dylib";
+ const char* kGLESv1LibName = "libGLES_CM.dylib";
+ const char* kGLESv2LibName = "libGLESv2.dylib";
+#else
+ const char* kEglLibName = "libEGL.so";
+ const char* kGLESv1LibName = "libGLES_CM.so";
+ const char* kGLESv2LibName = "libGLESv2.so";
+#endif
+
+ std::string eglLibPath = StringFormat("gles_angle/%s", kEglLibName);
+ std::string GLESv1LibPath = StringFormat("gles_angle/%s", kGLESv1LibName);
+ std::string GLESv2LibPath = StringFormat("gles_angle/%s", kGLESv2LibName);
+
+ makeLibSubFile(myDir, eglLibPath.c_str());
+ makeLibSubFile(myDir, GLESv2LibPath.c_str());
+
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "angle", "auto", 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("angle_indirect", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'angle_indirect' mode",
+ config.status);
+ emuglConfig_setupEnv(&config);
+ }
+}
+
+TEST(EmuglConfig, initNxWithSwiftshader) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ makeLibSubDir(myDir, "gles_swiftshader");
+ makeLibSubFile(myDir, "gles_swiftshader/libEGL.so");
+ makeLibSubFile(myDir, "gles_swiftshader/libGLES_CM.so");
+ makeLibSubFile(myDir, "gles_swiftshader/libGLESv2.so");
+
+ testSys.setRemoteSessionType("NX");
+
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "auto", NULL, 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("swiftshader_indirect", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'swiftshader_indirect' mode",
+ config.status);
+}
+
+TEST(EmuglConfig, initNxWithoutSwiftshader) {
+ TestSystem testSys("foo", System::kProgramBitness);
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ testSys.setRemoteSessionType("NX");
+
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "auto", NULL, 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled under NX without Swiftshader", config.status);
+}
+
+TEST(EmuglConfig, initChromeRemoteDesktopWithSwiftshader) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ makeLibSubDir(myDir, "gles_swiftshader");
+ makeLibSubFile(myDir, "gles_swiftshader/libEGL.so");
+ makeLibSubFile(myDir, "gles_swiftshader/libGLES_CM.so");
+ makeLibSubFile(myDir, "gles_swiftshader/libGLESv2.so");
+
+ testSys.setRemoteSessionType("Chrome Remote Desktop");
+
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "auto", NULL, 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("swiftshader_indirect", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'swiftshader_indirect' mode",
+ config.status);
+}
+
+TEST(EmuglConfig, initChromeRemoteDesktopWithoutSwiftshader) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ testSys.setRemoteSessionType("Chrome Remote Desktop");
+
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "auto", NULL, 0, false, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled under Chrome Remote Desktop without Swiftshader", config.status);
+}
+
+TEST(EmuglConfig, initNoWindowWithSwiftshader) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ makeLibSubDir(myDir, "gles_swiftshader");
+ makeLibSubFile(myDir, "gles_swiftshader/libEGL.so");
+ makeLibSubFile(myDir, "gles_swiftshader/libGLES_CM.so");
+ makeLibSubFile(myDir, "gles_swiftshader/libGLESv2.so");
+
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "auto", NULL, 0, true, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_TRUE(config.enabled);
+ EXPECT_STREQ("swiftshader_indirect", config.backend);
+ EXPECT_STREQ("GPU emulation enabled using 'swiftshader_indirect' mode",
+ config.status);
+}
+
+TEST(EmuglConfig, initWithSwiftshaderCheckVulkanEnvVar) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ makeLibSubDir(myDir, "gles_swiftshader");
+ makeLibSubFile(myDir, "gles_swiftshader/libEGL.so");
+ makeLibSubFile(myDir, "gles_swiftshader/libGLES_CM.so");
+ makeLibSubFile(myDir, "gles_swiftshader/libGLESv2.so");
+
+ // Do not force use host vulkan
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "auto", NULL, 0, true, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ emuglConfig_setupEnv(&config);
+ EXPECT_STREQ("swiftshader",
+ System::get()->envGet("ANDROID_EMU_VK_ICD").c_str());
+ }
+
+ // Force use host vulkan
+ {
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "auto", NULL, 0, true, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, true));
+ emuglConfig_setupEnv(&config);
+ EXPECT_STREQ("",
+ System::get()->envGet("ANDROID_EMU_VK_ICD").c_str());
+ }
+}
+
+TEST(EmuglConfig, initNoWindowWithoutSwiftshader) {
+ TestSystem testSys("foo", System::kProgramBitness, "/");
+ TestTempDir* myDir = testSys.getTempRoot();
+ myDir->makeSubDir(System::get()->getLauncherDirectory().c_str());
+ makeLibSubDir(myDir, "");
+
+ EmuglConfig config;
+ EXPECT_TRUE(emuglConfig_init(
+ &config, true, "auto", NULL, 0, true, false, false,
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, false));
+ EXPECT_FALSE(config.enabled);
+ EXPECT_STREQ("GPU emulation is disabled (-no-window without Swiftshader)",
+ config.status);
+}
+
+TEST(EmuglConfig, setupEnv) {
+}
+
+TEST(EmuglConfig, hostGpuProps) {
+ TestSystem testSys("/usr", 32);
+ testSys.setLiveUnixTime(true);
+ GpuInfoList* gpulist = const_cast<GpuInfoList*>(&globalGpuInfoList());
+ gpulist->clear();
+ EXPECT_TRUE(gpulist->infos.size() == 0);
+ gpulist->addGpu();
+ gpulist->currGpu().make = "TEST GPU0 MAKE";
+ gpulist->currGpu().model = "TEST GPU0 MODEL";
+ gpulist->currGpu().device_id = "TEST GPU0 DEVICEID";
+ gpulist->currGpu().revision_id = "TEST GPU0 REVISIONID";
+ gpulist->currGpu().version = "TEST GPU0 VERSION";
+ gpulist->currGpu().renderer = "TEST GPU0 RENDERER";
+ gpulist->addGpu();
+ gpulist->currGpu().make = "TEST GPU1 MAKE";
+ gpulist->currGpu().model = "TEST GPU1 MODEL";
+ gpulist->currGpu().device_id = "TEST GPU1 DEVICEID";
+ gpulist->currGpu().revision_id = "TEST GPU1 REVISIONID";
+ gpulist->currGpu().version = "TEST GPU1 VERSION";
+ gpulist->currGpu().renderer = "TEST GPU1 RENDERER";
+ gpulist->addGpu();
+ gpulist->currGpu().make = "TEST GPU2 MAKE";
+ gpulist->currGpu().model = "TEST GPU2 MODEL";
+ gpulist->currGpu().device_id = "TEST GPU2 DEVICEID";
+ gpulist->currGpu().revision_id = "TEST GPU2 REVISIONID";
+ gpulist->currGpu().version = "TEST GPU2 VERSION";
+ gpulist->currGpu().renderer = "TEST GPU2 RENDERER";
+ gpulist->addGpu();
+ gpulist->currGpu().make = "TEST GPU3 MAKE";
+ gpulist->currGpu().model = "TEST GPU3 MODEL";
+ gpulist->currGpu().device_id = "TEST GPU3 DEVICEID";
+ gpulist->currGpu().revision_id = "TEST GPU3 REVISIONID";
+ gpulist->currGpu().version = "TEST GPU3 VERSION";
+ gpulist->currGpu().renderer = "TEST GPU3 RENDERER";
+
+ emugl_host_gpu_prop_list gpu_props = emuglConfig_get_host_gpu_props();
+ EXPECT_TRUE(gpu_props.num_gpus == 4);
+
+ EXPECT_STREQ("TEST GPU0 MAKE", gpu_props.props[0].make);
+ EXPECT_STREQ("TEST GPU1 MAKE", gpu_props.props[1].make);
+ EXPECT_STREQ("TEST GPU2 MAKE", gpu_props.props[2].make);
+ EXPECT_STREQ("TEST GPU3 MAKE", gpu_props.props[3].make);
+
+ EXPECT_STREQ("TEST GPU0 MODEL", gpu_props.props[0].model);
+ EXPECT_STREQ("TEST GPU1 MODEL", gpu_props.props[1].model);
+ EXPECT_STREQ("TEST GPU2 MODEL", gpu_props.props[2].model);
+ EXPECT_STREQ("TEST GPU3 MODEL", gpu_props.props[3].model);
+
+ EXPECT_STREQ("TEST GPU0 DEVICEID", gpu_props.props[0].device_id);
+ EXPECT_STREQ("TEST GPU1 DEVICEID", gpu_props.props[1].device_id);
+ EXPECT_STREQ("TEST GPU2 DEVICEID", gpu_props.props[2].device_id);
+ EXPECT_STREQ("TEST GPU3 DEVICEID", gpu_props.props[3].device_id);
+
+ EXPECT_STREQ("TEST GPU0 REVISIONID", gpu_props.props[0].revision_id);
+ EXPECT_STREQ("TEST GPU1 REVISIONID", gpu_props.props[1].revision_id);
+ EXPECT_STREQ("TEST GPU2 REVISIONID", gpu_props.props[2].revision_id);
+ EXPECT_STREQ("TEST GPU3 REVISIONID", gpu_props.props[3].revision_id);
+
+ EXPECT_STREQ("TEST GPU0 VERSION", gpu_props.props[0].version);
+ EXPECT_STREQ("TEST GPU1 VERSION", gpu_props.props[1].version);
+ EXPECT_STREQ("TEST GPU2 VERSION", gpu_props.props[2].version);
+ EXPECT_STREQ("TEST GPU3 VERSION", gpu_props.props[3].version);
+
+ EXPECT_STREQ("TEST GPU0 RENDERER", gpu_props.props[0].renderer);
+ EXPECT_STREQ("TEST GPU1 RENDERER", gpu_props.props[1].renderer);
+ EXPECT_STREQ("TEST GPU2 RENDERER", gpu_props.props[2].renderer);
+ EXPECT_STREQ("TEST GPU3 RENDERER", gpu_props.props[3].renderer);
+
+ free_emugl_host_gpu_props(gpu_props);
+}
+
+TEST(EmuglConfig, hostGpuProps_empty) {
+ TestSystem testSys("/usr", 32);
+ testSys.setLiveUnixTime(true);
+ GpuInfoList* gpulist = const_cast<GpuInfoList*>(&globalGpuInfoList());
+ gpulist->clear();
+ EXPECT_TRUE(gpulist->infos.size() == 0);
+
+ emugl_host_gpu_prop_list gpu_props = emuglConfig_get_host_gpu_props();
+ EXPECT_TRUE(gpu_props.num_gpus == 0);
+ free_emugl_host_gpu_props(gpu_props);
+}
+
+} // namespace base
+} // namespace android
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/gpuinfo.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/gpuinfo.cpp
new file mode 100644
index 00000000000..4231f535075
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/gpuinfo.cpp
@@ -0,0 +1,425 @@
+// Copyright 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 "host-common/opengl/gpuinfo.h"
+
+#include "aemu/base/ArraySize.h"
+#include "aemu/base/system/System.h"
+#include "aemu/base/threads/FunctorThread.h"
+#include "host-common/opengl/NativeGpuInfo.h"
+
+#include <assert.h>
+#include <inttypes.h>
+#include <sstream>
+#include <utility>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+using android::base::arraySize;
+using android::base::FunctorThread;
+
+// Try to switch to NVIDIA on Optimus systems,
+// and AMD GPU on AmdPowerXpress.
+// See http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
+// and https://community.amd.com/thread/169965
+// These variables need to be visible from the final emulator executable
+// as exported symbols.
+#ifdef _WIN32
+#define FLAG_EXPORT __declspec(dllexport)
+#else
+#define FLAG_EXPORT __attribute__ ((visibility ("default")))
+#endif
+
+extern "C" {
+
+FLAG_EXPORT int NvOptimusEnablement = 0x00000001;
+FLAG_EXPORT int AmdPowerXpressRequestHighPerformance = 0x00000001;
+
+} // extern "C"
+
+#undef FLAG_EXPORT
+
+
+void GpuInfo::addDll(std::string dll_str) {
+ dlls.push_back(std::move(dll_str));
+}
+
+void GpuInfoList::addGpu() {
+ infos.push_back(GpuInfo());
+}
+GpuInfo& GpuInfoList::currGpu() {
+ if (infos.empty()) { addGpu(); }
+ return infos.back();
+}
+
+std::string GpuInfoList::dump() const {
+ std::stringstream ss;
+ for (unsigned int i = 0; i < infos.size(); i++) {
+ ss << "GPU #" << i + 1 << std::endl;
+
+ if (!infos[i].make.empty()) {
+ ss << " Make: " << infos[i].make << std::endl;
+ }
+ if (!infos[i].model.empty()) {
+ ss << " Model: " << infos[i].model << std::endl;
+ }
+ if (!infos[i].device_id.empty()) {
+ ss << " Device ID: " << infos[i].device_id << std::endl;
+ }
+ if (!infos[i].revision_id.empty()) {
+ ss << " Revision ID: " << infos[i].revision_id << std::endl;
+ }
+ if (!infos[i].version.empty()) {
+ ss << " Driver version: " << infos[i].version << std::endl;
+ }
+ if (!infos[i].renderer.empty()) {
+ ss << " Renderer: " << infos[i].renderer << std::endl;
+ }
+ }
+ return ss.str();
+}
+
+void GpuInfoList::clear() {
+ blacklist_status = false;
+ Anglelist_status = false;
+ SyncBlacklist_status = false;
+ VulkanBlacklist_status = false;
+ infos.clear();
+}
+
+static bool gpuinfo_query_list(GpuInfoList* gpulist,
+ const BlacklistEntry* list,
+ int size) {
+ for (auto gpuinfo : gpulist->infos) {
+ for (int i = 0; i < size; i++) {
+ auto bl_entry = list[i];
+ const char* bl_make = bl_entry.make;
+ const char* bl_model = bl_entry.model;
+ const char* bl_device_id = bl_entry.device_id;
+ const char* bl_revision_id = bl_entry.revision_id;
+ const char* bl_version = bl_entry.version;
+ const char* bl_renderer = bl_entry.renderer;
+ const char* bl_os = bl_entry.os;
+
+ if (bl_make && (gpuinfo.make != bl_make))
+ continue;
+ if (bl_model && (gpuinfo.model != bl_model))
+ continue;
+ if (bl_device_id && (gpuinfo.device_id != bl_device_id))
+ continue;
+ if (bl_revision_id && (gpuinfo.revision_id != bl_revision_id))
+ continue;
+ if (bl_version && (gpuinfo.revision_id != bl_version))
+ continue;
+ if (bl_renderer && (gpuinfo.renderer.find(bl_renderer) ==
+ std::string::npos))
+ continue;
+ if (bl_os && (gpuinfo.os != bl_os))
+ continue;
+ return true;
+ }
+ }
+ return false;
+}
+
+// Actual blacklist starts here.
+// Most entries imported from Chrome blacklist.
+static const BlacklistEntry sGpuBlacklist[] = {
+
+ // Make | Model | DeviceID | RevisionID | DriverVersion | Renderer |
+ // OS
+ {nullptr, nullptr, "0x7249", nullptr, nullptr,
+ nullptr, "M"}, // ATI Radeon X1900 on Mac
+ {"8086", nullptr, nullptr, nullptr, nullptr,
+ "Mesa", "L"}, // Linux, Intel, Mesa
+ {"8086", nullptr, nullptr, nullptr, nullptr,
+ "mesa", "L"}, // Linux, Intel, Mesa
+
+ {"8086", nullptr, "27ae", nullptr, nullptr,
+ nullptr, nullptr}, // Intel 945 Chipset
+ {"1002", nullptr, nullptr, nullptr, nullptr, nullptr,
+ "L"}, // Linux, ATI
+
+ {nullptr, nullptr, "0x9583", nullptr, nullptr,
+ nullptr, "M"}, // ATI Radeon HD2600 on Mac
+ {nullptr, nullptr, "0x94c8", nullptr, nullptr,
+ nullptr, "M"}, // ATI Radeon HD2400 on Mac
+
+ {"NVIDIA (0x10de)", nullptr, "0x0324", nullptr, nullptr,
+ nullptr, "M"}, // NVIDIA GeForce FX Go5200 (Mac)
+ {"10DE", "NVIDIA GeForce FX Go5200", nullptr, nullptr, nullptr,
+ nullptr, "W"}, // NVIDIA GeForce FX Go5200 (Win)
+ {"10de", nullptr, "0324", nullptr, nullptr,
+ nullptr, "L"}, // NVIDIA GeForce FX Go5200 (Linux)
+
+ {"10de", nullptr, "029e", nullptr, nullptr,
+ nullptr, "L"}, // NVIDIA Quadro FX 1500 (Linux)
+
+ // Various Quadro FX cards on Linux
+ {"10de", nullptr, "00cd", nullptr, "195.36.24",
+ nullptr, "L"},
+ {"10de", nullptr, "00ce", nullptr, "195.36.24",
+ nullptr, "L"},
+ // Driver version 260.19.6 on Linux
+ {"10de", nullptr, nullptr, nullptr, "260.19.6",
+ nullptr, "L"},
+
+ {"NVIDIA (0x10de)", nullptr, "0x0393", nullptr, nullptr,
+ nullptr, "M"}, // NVIDIA GeForce 7300 GT (Mac)
+
+ // GPUs with < OpenGL 2.1 support
+
+ // Intel Auburn
+ {"8086", nullptr, "7800", nullptr, nullptr, nullptr, nullptr},
+
+ // Intel Portola
+ {"8086", nullptr, "1240", nullptr, nullptr, nullptr, nullptr},
+
+ // Intel Whitney
+ {"8086", nullptr, "7121", nullptr, nullptr, nullptr, nullptr},
+ {"8086", nullptr, "7123", nullptr, nullptr, nullptr, nullptr},
+ {"8086", nullptr, "7125", nullptr, nullptr, nullptr, nullptr},
+
+ // Intel Solano
+ {"8086", nullptr, "1132", nullptr, nullptr, nullptr, nullptr},
+
+ // Intel Brookdale
+ {"8086", nullptr, "2562", nullptr, nullptr, nullptr, nullptr},
+
+ // Intel Almador
+ {"8086", nullptr, "3577", nullptr, nullptr, nullptr, nullptr},
+
+ // Intel Springdale
+ {"8086", nullptr, "2572", nullptr, nullptr, nullptr, nullptr},
+
+ // Intel Montara
+ {"8086", nullptr, "3582", nullptr, nullptr, nullptr, nullptr},
+ {"8086", nullptr, "358e", nullptr, nullptr, nullptr, nullptr},
+
+ // Intel Grantsdale (2.1 desktop / ES 2.0 on Linux supported)
+ {"8086", nullptr, "2582", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "258a", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Alviso
+ {"8086", nullptr, "2592", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Lakeport
+ {"8086", nullptr, "2772", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Calistoga
+ {"8086", nullptr, "27a2", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "27ae", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Bearlake
+ {"8086", nullptr, "29c2", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "29b2", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "29d2", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Pineview
+ {"8086", nullptr, "a001", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "a011", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Lakeport
+ {"8086", nullptr, "2972", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Broadwater
+ {"8086", nullptr, "2992", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "29a2", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Bearlake 2
+ {"8086", nullptr, "2982", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Crestine
+ {"8086", nullptr, "2a02", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "2a12", nullptr, nullptr, nullptr, "W"},
+
+ // Display-only devices
+
+ // Microsoft Basic Render Driver
+ {"1414", nullptr, "008c", nullptr, nullptr, nullptr, nullptr},
+
+ // Matrix MGA G200eW
+ {"102b", nullptr, "0532", nullptr, nullptr, nullptr, nullptr},
+
+ // VMWare SVGA 3D
+ {"15ad", nullptr, "0405", nullptr, nullptr, nullptr, nullptr},
+
+ // Citrix Display Only Adapter
+ {"5853", nullptr, "1002", nullptr, nullptr, nullptr, nullptr},
+
+ // SeaBIOS Display-Only Device?
+ {"1b36", nullptr, "0100", nullptr, nullptr, nullptr, nullptr},
+
+ // Devices incapable of reliably calling wglMakeCurrent
+ // when switching HDC
+
+ // Intel Eaglelake
+ {"8086", nullptr, "2e42", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "2e92", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "2e12", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "2e32", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "2e22", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Cantiga
+ {"8086", nullptr, "2a42", nullptr, nullptr, nullptr, "W"},
+
+ // Intel Ironlake
+ {"8086", nullptr, "0042", nullptr, nullptr, nullptr, "W"},
+ {"8086", nullptr, "0046", nullptr, nullptr, nullptr, "W"},
+};
+
+// If any blacklist entry matches any gpu, return true.
+bool gpuinfo_query_blacklist(GpuInfoList* gpulist,
+ const BlacklistEntry* list,
+ int size) {
+ return gpuinfo_query_list(gpulist, list, size);
+}
+
+#ifdef _WIN32
+static const WhitelistEntry sAngleWhitelist[] = {
+ // Make | Model | DeviceID | RevisionID | DriverVersion | Renderer |
+ // OS
+ // HD 3000 on Windows
+ {"8086", nullptr, "0116", nullptr, nullptr,
+ nullptr, "W"},
+ {"8086", nullptr, "0126", nullptr, nullptr,
+ nullptr, "W"},
+ {"8086", nullptr, "0102", nullptr, nullptr,
+ nullptr, "W"},
+};
+
+static bool gpuinfo_query_whitelist(GpuInfoList *gpulist,
+ const WhitelistEntry *list,
+ int size) {
+ return gpuinfo_query_list(gpulist, list, size);
+}
+
+#endif
+
+static const BlacklistEntry sSyncBlacklist[] = {
+ // Make | Model | DeviceID | RevisionID | DriverVersion | Renderer |
+ // OS
+ // All NVIDIA Quadro NVS and NVIDIA NVS GPUs on Windows
+ {"10de", nullptr, "06fd", nullptr, nullptr, nullptr, "W"}, // NVS 295
+ {"10de", nullptr, "0a6a", nullptr, nullptr, nullptr, "W"}, // NVS 2100M
+ {"10de", nullptr, "0a6c", nullptr, nullptr, nullptr, "W"}, // NVS 5100M
+ {"10de", nullptr, "0ffd", nullptr, nullptr, nullptr, "W"}, // NVS 510
+ {"10de", nullptr, "1056", nullptr, nullptr, nullptr, "W"}, // NVS 4200M
+ {"10de", nullptr, "10d8", nullptr, nullptr, nullptr, "W"}, // NVS 300
+ {"10de", nullptr, "014a", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 440
+ {"10de", nullptr, "0165", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 285
+ {"10de", nullptr, "017a", nullptr, nullptr, nullptr, "W"}, // Quadro NVS (generic)
+ {"10de", nullptr, "018a", nullptr, nullptr, nullptr, "W"}, // Quadro NVS AGP8X (generic)
+ {"10de", nullptr, "018c", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 50 PCI (generic)
+ {"10de", nullptr, "01db", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 120M
+ {"10de", nullptr, "0245", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 210S / NVIDIA GeForce 6150LE
+ {"10de", nullptr, "032a", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 55/280 PCI
+ {"10de", nullptr, "040c", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 570M / Mobile Quadro FX/NVS video card
+ {"10de", nullptr, "0429", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 135M or Quadro NVS 140M
+ {"10de", nullptr, "042b", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 135M
+ {"10de", nullptr, "042f", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 290
+ {"10de", nullptr, "06ea", nullptr, nullptr, nullptr, "W"}, // quadro nvs 150m
+ {"10de", nullptr, "06eb", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 160M
+ {"10de", nullptr, "06f8", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 420
+ {"10de", nullptr, "06fa", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 450
+ {"10de", nullptr, "0a2c", nullptr, nullptr, nullptr, "W"}, // Quadro NVS 5100M
+};
+
+namespace {
+
+// A set of global variables for GPU information - a single instance of
+// GpuInfoList and its loading thread.
+class Globals {
+ DISALLOW_COPY_AND_ASSIGN(Globals);
+
+public:
+ Globals()
+ : mAsyncLoadThread([this]() {
+ getGpuInfoListNative(&mGpuInfoList);
+
+ mGpuInfoList.blacklist_status = gpuinfo_query_blacklist(
+ &mGpuInfoList, sGpuBlacklist, arraySize(sGpuBlacklist));
+#ifdef _WIN32
+ mGpuInfoList.Anglelist_status =
+ gpuinfo_query_whitelist(&mGpuInfoList, sAngleWhitelist,
+ arraySize(sAngleWhitelist));
+#else
+ mGpuInfoList.Anglelist_status = false;
+#endif
+ mGpuInfoList.SyncBlacklist_status = gpuinfo_query_blacklist(
+ &mGpuInfoList, sSyncBlacklist, arraySize(sSyncBlacklist));
+
+ mGpuInfoList.VulkanBlacklist_status =
+ !isVulkanSafeToUseNative();
+
+ }) {
+ mAsyncLoadThread.start();
+ }
+
+ const GpuInfoList& gpuInfoList() {
+ mAsyncLoadThread.wait();
+ return mGpuInfoList;
+ }
+
+private:
+ GpuInfoList mGpuInfoList;
+
+ // Separate thread for GPU info querying:
+ //
+ // GPU information querying may take a while, but the implementation is
+ // expected to abort if it's over reasonable limits. That's why we use a
+ // separate thread that's started as soon as possible at startup and then
+ // wait for it synchronoulsy before using the information.
+ //
+ FunctorThread mAsyncLoadThread;
+};
+
+} // namespace
+
+static Globals* sGlobals() {
+ static Globals* g = new Globals;
+ return g;
+}
+
+void async_query_host_gpu_start() {
+ sGlobals();
+}
+
+const GpuInfoList& globalGpuInfoList() {
+ return sGlobals()->gpuInfoList();
+}
+
+bool async_query_host_gpu_blacklisted() {
+ return globalGpuInfoList().blacklist_status;
+}
+
+bool async_query_host_gpu_AngleWhitelisted() {
+ return globalGpuInfoList().Anglelist_status;
+}
+
+bool async_query_host_gpu_SyncBlacklisted() {
+ return globalGpuInfoList().SyncBlacklist_status;
+}
+
+bool async_query_host_gpu_VulkanBlacklisted() {
+ return globalGpuInfoList().VulkanBlacklist_status;
+}
+
+void setGpuBlacklistStatus(bool switchedToSoftware) {
+ // We know what we're doing here: GPU list doesn't change after it's fully
+ // loaded.
+ const_cast<GpuInfoList&>(globalGpuInfoList()).blacklist_status =
+ switchedToSoftware;
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/gpuinfo_unittest.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/gpuinfo_unittest.cpp
new file mode 100644
index 00000000000..a72005ccf6c
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/gpuinfo_unittest.cpp
@@ -0,0 +1,592 @@
+// Copyright 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/opengl/gpuinfo.h"
+
+#include "android/base/testing/TestSystem.h"
+#include "android/base/testing/TestTempDir.h"
+
+#include <gtest/gtest.h>
+
+static const char win_noinstalleddrivers[] =
+"\r\n"
+"\r\n"
+"AcceleratorCapabilities=\r\n"
+"AdapterCompatibility=RealVNC\r\n"
+"AdapterDACType=\r\n"
+"AdapterRAM=\r\n"
+"Availability=8\r\n"
+"CapabilityDescriptions=\r\n"
+"Caption=VNC Mirror Driver\r\n"
+"ColorTableEntries=\r\n"
+"ConfigManagerErrorCode=0\r\n"
+"ConfigManagerUserConfig=FALSE\r\n"
+"CreationClassName=Win32_VideoController\r\n"
+"CurrentBitsPerPixel=\r\n"
+"CurrentHorizontalResolution=\r\n"
+"CurrentNumberOfColors=\r\n"
+"CurrentNumberOfColumns=\r\n"
+"CurrentNumberOfRows=\r\n"
+"CurrentRefreshRate=\r\n"
+"CurrentScanMode=\r\n"
+"CurrentVerticalResolution=\r\n"
+"Description=VNC Mirror Driver\r\n"
+"DeviceID=VideoController1\r\n"
+"DeviceSpecificPens=\r\n"
+"DitherType=\r\n"
+"DriverDate=20080314000000.000000-000\r\n"
+"DriverVersion=1.8.0.0\r\n"
+"ErrorCleared=\r\n"
+"ErrorDescription=\r\n"
+"ICMIntent=\r\n"
+"ICMMethod=\r\n"
+"InfFilename=oem24.inf\r\n"
+"InfSection=vncmirror\r\n"
+"InstallDate=\r\n"
+"InstalledDisplayDrivers=\r\n"
+"LastErrorCode=\r\n"
+"MaxMemorySupported=\r\n"
+"MaxNumberControlled=\r\n"
+"MaxRefreshRate=\r\n"
+"MinRefreshRate=\r\n"
+"Monochrome=FALSE\r\n"
+"Name=VNC Mirror Driver\r\n"
+"NumberOfColorPlanes=\r\n"
+"NumberOfVideoPages=\r\n"
+"PNPDeviceID=ROOT\\DISPLAY\\0000\r\n"
+"PowerManagementCapabilities=\r\n"
+"PowerManagementSupported=\r\n"
+"ProtocolSupported=\r\n"
+"ReservedSystemPaletteEntries=\r\n"
+"SpecificationVersion=\r\n"
+"Status=Degraded\r\n"
+"StatusInfo=\r\n"
+"SystemCreationClassName=Win32_ComputerSystem\r\n"
+"SystemName=ANDREW-PC\r\n"
+"SystemPaletteEntries=\r\n"
+"TimeOfLastReset=\r\n"
+"VideoArchitecture=5\r\n"
+"VideoMemoryType=2\r\n"
+"VideoMode=\r\n"
+"VideoModeDescription=\r\n"
+"VideoProcessor=\r\n"
+"\r\n"
+"\r\n"
+"AcceleratorCapabilities=\r\n"
+"AdapterCompatibility=NVIDIA\r\n"
+"AdapterDACType=Integrated RAMDAC\r\n"
+"AdapterRAM=2147483648\r\n"
+"Availability=3\r\n"
+"CapabilityDescriptions=\r\n"
+"Caption=NVIDIA GeForce GTX 660M \r\n"
+"ColorTableEntries=\r\n"
+"ConfigManagerErrorCode=0\r\n"
+"ConfigManagerUserConfig=FALSE\r\n"
+"CreationClassName=Win32_VideoController\r\n"
+"CurrentBitsPerPixel=32\r\n"
+"CurrentHorizontalResolution=1600\r\n"
+"CurrentNumberOfColors=4294967296\r\n"
+"CurrentNumberOfColumns=0\r\n"
+"CurrentNumberOfRows=0\r\n"
+"CurrentRefreshRate=60\r\n"
+"CurrentScanMode=4\r\n"
+"CurrentVerticalResolution=900\r\n"
+"Description=NVIDIA GeForce GTX 660M \r\n"
+"DeviceID=VideoController2\r\n"
+"DeviceSpecificPens=\r\n"
+"DitherType=0\r\n"
+"DriverDate=20160321000000.000000-000\r\n"
+"DriverVersion=10.18.13.6472\r\n"
+"ErrorCleared=\r\n"
+"ErrorDescription=\r\n"
+"ICMIntent=\r\n"
+"ICMMethod=\r\n"
+"InfFilename=oem65.inf\r\n"
+"InfSection=Section031\r\n"
+"InstallDate=\r\n"
+"InstalledDisplayDrivers=nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um,nvwgf2um\r\n"
+"LastErrorCode=\r\n"
+"MaxMemorySupported=\r\n"
+"MaxNumberControlled=\r\n"
+"MaxRefreshRate=60\r\n"
+"MinRefreshRate=60\r\n"
+"Monochrome=FALSE\r\n"
+"Name=NVIDIA GeForce GTX 660M \r\n"
+"NumberOfColorPlanes=\r\n"
+"NumberOfVideoPages=\r\n"
+"PNPDeviceID=PCI\\VEN_10DE&amp;DEV_0FD4&amp;SUBSYS_21151043&amp;REV_A1\\4&amp;169534F2&amp;0&amp;0008\r\n"
+"PowerManagementCapabilities=\r\n"
+"PowerManagementSupported=\r\n"
+"ProtocolSupported=\r\n"
+"ReservedSystemPaletteEntries=\r\n"
+"SpecificationVersion=\r\n"
+"Status=OK\r\n"
+"StatusInfo=\r\n"
+"SystemCreationClassName=Win32_ComputerSystem\r\n"
+"SystemName=ANDREW-PC\r\n"
+"SystemPaletteEntries=\r\n"
+"TimeOfLastReset=\r\n"
+"VideoArchitecture=5\r\n"
+"VideoMemoryType=2\r\n"
+"VideoMode=\r\n"
+"VideoModeDescription=1600 x 900 x 4294967296 colors\r\n"
+"VideoProcessor=GeForce GTX 660M\r\n";
+
+static const char win_single_gpu[] =
+"\r\n"
+"\r\n"
+"AcceleratorCapabilities=\r\n"
+"AdapterCompatibility=NVIDIA\r\n"
+"AdapterDACType=Integrated RAMDAC\r\n"
+"AdapterRAM=1073741824\r\n"
+"Availability=3\r\n"
+"CapabilityDescriptions=\r\n"
+"Caption=NVIDIA Quadro K600\r\n"
+"ColorTableEntries=\r\n"
+"ConfigManagerErrorCode=0\r\n"
+"ConfigManagerUserConfig=FALSE\r\n"
+"CreationClassName=Win32_VideoController\r\n"
+"CurrentBitsPerPixel=32\r\n"
+"CurrentHorizontalResolution=2560\r\n"
+"CurrentNumberOfColors=4294967296\r\n"
+"CurrentNumberOfColumns=0\r\n"
+"CurrentNumberOfRows=0\r\n"
+"CurrentRefreshRate=59\r\n"
+"CurrentScanMode=4\r\n"
+"CurrentVerticalResolution=1600\r\n"
+"Description=NVIDIA Quadro K600\r\n"
+"DeviceID=VideoController1\r\n"
+"DeviceSpecificPens=\r\n"
+"DitherType=0\r\n"
+"DriverDate=20130830000000.000000-000\r\n"
+"DriverVersion=9.18.13.2086\r\n"
+"ErrorCleared=\r\n"
+"ErrorDescription=\r\n"
+"ICMIntent=\r\n"
+"ICMMethod=\r\n"
+"InfFilename=oem39.inf\r\n"
+"InfSection=Section078\r\n"
+"InstallDate=\r\n"
+"InstalledDisplayDrivers=nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um\r\n"
+"LastErrorCode=\r\n"
+"MaxMemorySupported=\r\n"
+"MaxNumberControlled=\r\n"
+"MaxRefreshRate=60\r\n"
+"MinRefreshRate=50\r\n"
+"Monochrome=FALSE\r\n"
+"Name=NVIDIA Quadro K600\r\n"
+"NumberOfColorPlanes=\r\n"
+"NumberOfVideoPages=\r\n"
+"PNPDeviceID=PCI\\VEN_10DE&amp;DEV_0FFA&amp;SUBSYS_094B103C&amp;REV_A1\\4&amp;16C9E9F9&amp;0&amp;0010\r\n"
+"PowerManagementCapabilities=\r\n"
+"PowerManagementSupported=\r\n"
+"ProtocolSupported=\r\n"
+"ReservedSystemPaletteEntries=\r\n"
+"SpecificationVersion=\r\n"
+"Status=OK\r\n"
+"StatusInfo=\r\n"
+"SystemCreationClassName=Win32_ComputerSystem\r\n"
+"SystemPaletteEntries=\r\n"
+"TimeOfLastReset=\r\n"
+"VideoArchitecture=5\r\n"
+"VideoMemoryType=2\r\n"
+"VideoMode=\r\n"
+"VideoModeDescription=2560 x 1600 x 4294967296 colors\r\n"
+"VideoProcessor=Quadro K600\r\n";
+
+static const char win_dual_gpu[] =
+"AcceleratorCapabilities=\r\n"
+"AdapterCompatibility=Advanced Micro Devices, Inc.\r\n"
+"AdapterDACType=Internal DAC(400MHz)\r\n"
+"AdapterRAM=4293918720\r\n"
+"Availability=8\r\n"
+"CapabilityDescriptions=\r\n"
+"Caption=AMD Radeon (TM) R5 M335\r\n"
+"ColorTableEntries=\r\n"
+"ConfigManagerErrorCode=0\r\n"
+"ConfigManagerUserConfig=FALSE\r\n"
+"CreationClassName=Win32_VideoController\r\n"
+"CurrentBitsPerPixel=\r\n"
+"CurrentHorizontalResolution=\r\n"
+"CurrentNumberOfColors=\r\n"
+"CurrentNumberOfColumns=\r\n"
+"CurrentNumberOfRows=\r\n"
+"CurrentRefreshRate=\r\n"
+"CurrentScanMode=\r\n"
+"CurrentVerticalResolution=\r\n"
+"Description=AMD Radeon (TM) R5 M335\r\n"
+"DeviceID=VideoController1\r\n"
+"DeviceSpecificPens=\r\n"
+"DitherType=\r\n"
+"DriverDate=20151204000000.000000-000\r\n"
+"DriverVersion=15.300.1025.1001\r\n"
+"ErrorCleared=\r\n"
+"ErrorDescription=\r\n"
+"ICMIntent=\r\n"
+"ICMMethod=\r\n"
+"InfFilename=oem27.inf\r\n"
+"InfSection=ati2mtag_R503\r\n"
+"InstallDate=\r\n"
+"InstalledDisplayDrivers=aticfx64.dll,aticfx64.dll,aticfx64.dll,amdxc64.dll,aticfx32,aticfx32,aticfx32,amdxc32,atiumd64.dll,atidxx64.dll,atidxx64.dll,atiumdag,atidxx32,atidxx32,atiumdva,atiumd6a.cap,atitmm64.dll\r\n"
+"LastErrorCode=\r\n"
+"MaxMemorySupported=\r\n"
+"MaxNumberControlled=\r\n"
+"MaxRefreshRate=\r\n"
+"MinRefreshRate=\r\n"
+"Monochrome=FALSE\r\n"
+"Name=AMD Radeon (TM) R5 M335\r\n"
+"NumberOfColorPlanes=\r\n"
+"NumberOfVideoPages=\r\n"
+"PNPDeviceID=PCI\\VEN_1002&amp;DEV_6660&amp;SUBSYS_06B21028&amp;REV_81\\4&amp;2370267D&amp;0&amp;00E0\r\n"
+"PowerManagementCapabilities=\r\n"
+"PowerManagementSupported=\r\n"
+"ProtocolSupported=\r\n"
+"ReservedSystemPaletteEntries=\r\n"
+"SpecificationVersion=\r\n"
+"Status=OK\r\n"
+"StatusInfo=\r\n"
+"SystemCreationClassName=Win32_ComputerSystem\r\n"
+"SystemName=DESKTOP-Q7BG33N\r\n"
+"SystemPaletteEntries=\r\n"
+"TimeOfLastReset=\r\n"
+"VideoArchitecture=5\r\n"
+"VideoMemoryType=2\r\n"
+"VideoMode=\r\n"
+"VideoModeDescription=\r\n"
+"VideoProcessor=AMD Radeon Graphics Processor (0x6660)\r\n"
+"\r\n"
+"\r\n"
+"AcceleratorCapabilities=\r\n"
+"AdapterCompatibility=Intel Corporation\r\n"
+"AdapterDACType=Internal\r\n"
+"AdapterRAM=1073741824\r\n"
+"Availability=3\r\n"
+"CapabilityDescriptions=\r\n"
+"Caption=Intel(R) HD Graphics 520\r\n"
+"ColorTableEntries=\r\n"
+"ConfigManagerErrorCode=0\r\n"
+"ConfigManagerUserConfig=FALSE\r\n"
+"CreationClassName=Win32_VideoController\r\n"
+"CurrentBitsPerPixel=32\r\n"
+"CurrentHorizontalResolution=1920\r\n"
+"CurrentNumberOfColors=4294967296\r\n"
+"CurrentNumberOfColumns=0\r\n"
+"CurrentNumberOfRows=0\r\n"
+"CurrentRefreshRate=59\r\n"
+"CurrentScanMode=4\r\n"
+"CurrentVerticalResolution=1080\r\n"
+"Description=Intel(R) HD Graphics 520\r\n"
+"DeviceID=VideoController2\r\n"
+"DeviceSpecificPens=\r\n"
+"DitherType=0\r\n"
+"DriverDate=20150831000000.000000-000\r\n"
+"DriverVersion=10.18.15.4281\r\n"
+"ErrorCleared=\r\n"
+"ErrorDescription=\r\n"
+"ICMIntent=\r\n"
+"ICMMethod=\r\n"
+"InfFilename=oem6.inf\r\n"
+"InfSection=iSKLD_w10\r\n"
+"InstallDate=\r\n"
+"InstalledDisplayDrivers=igdumdim64.dll,igd10iumd64.dll,igd10iumd64.dll,igd12umd64.dll,igdumdim32,igd10iumd32,igd10iumd32,igd12umd32\r\n"
+"LastErrorCode=\r\n"
+"MaxMemorySupported=\r\n"
+"MaxNumberControlled=\r\n"
+"MaxRefreshRate=59\r\n"
+"MinRefreshRate=48\r\n"
+"Monochrome=FALSE\r\n"
+"Name=Intel(R) HD Graphics 520\r\n"
+"NumberOfColorPlanes=\r\n"
+"NumberOfVideoPages=\r\n"
+"PNPDeviceID=PCI\\VEN_8086&amp;DEV_1916&amp;SUBSYS_06B21028&amp;REV_07\\3&amp;11583659&amp;0&amp;10\r\n"
+"PowerManagementCapabilities=\r\n"
+"PowerManagementSupported=\r\n"
+"ProtocolSupported=\r\n"
+"ReservedSystemPaletteEntries=\r\n"
+"SpecificationVersion=\r\n"
+"Status=OK\r\n"
+"StatusInfo=\r\n"
+"SystemCreationClassName=Win32_ComputerSystem\r\n"
+"SystemPaletteEntries=\r\n"
+"TimeOfLastReset=\r\n"
+"VideoArchitecture=5\r\n"
+"VideoMemoryType=2\r\n"
+"VideoMode=\r\n"
+"VideoModeDescription=1920 x 1080 x 4294967296 colors\r\n"
+"VideoProcessor=Intel(R) HD Graphics Family\r\n";
+
+static const char linux_single_gpu[] =
+"Rev: 05\n"
+"\n"
+"Device: 04:00.0\n"
+"Class: VGA compatible controller [0300]\n"
+"Vendor: NVIDIA Corporation [10de]\n"
+"Device: GM107GL [Quadro K2200] [13ba]\n"
+"SVendor: Hewlett-Packard Company [103c]\n"
+"SDevice: Device [1097]\n"
+"PhySlot: 2\n"
+"Rev: a2\n"
+"\n"
+"Device: 04:00.1\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"OpenGL version string: 4.4.0 NVIDIA 340.96\n"
+"OpenGL shading language version string: 4.40 NVIDIA via Cg compiler\n"
+"OpenGL context flags: (none)\n"
+"\n";
+
+static const char linux_mesadri[] =
+"Rev: 05\n"
+"\n"
+"Device: 04:00.0\n"
+"Class: VGA compatible controller [0300]\n"
+"Vendor: NVIDIA Corporation [10de]\n"
+"Device: GM107GL [Quadro K2200] [13ba]\n"
+"SVendor: Hewlett-Packard Company [103c]\n"
+"SDevice: Device [1097]\n"
+"PhySlot: 2\n"
+"Rev: a2\n"
+"\n"
+"Device: 04:00.1\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"OpenGL version string: 3.0 Mesa 10.4.2 (git-)\n"
+"\n";
+
+static const char linux_2[] =
+"Rev: 05\n"
+"\n"
+"Device: 04:00.0\n"
+"Class: VGA compatible controller [0300]\n"
+"Vendor: NVIDIA Corporation [10de]\n"
+"Device: GM107GL [Quadro K2200] [13ba]\n"
+"SVendor: Hewlett-Packard Company [103c]\n"
+"SDevice: Device [1097]\n"
+"PhySlot: 2\n"
+"Rev: a2\n"
+"\n"
+"Device: 04:00.1\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n";
+
+#ifdef _WIN32
+
+TEST(parse_gpu_info_list_windows, WinNoInstalledDriversContinueCase) {
+ std::string contents(win_noinstalleddrivers);
+
+ GpuInfoList gpulist;
+ parse_gpu_info_list_windows(contents, &gpulist);
+
+ EXPECT_EQ(2, (int)gpulist.infos.size());
+}
+
+TEST(parse_gpu_info_list_windows, SingleGpu) {
+ std::string contents(win_single_gpu);
+
+ GpuInfoList gpulist;
+ parse_gpu_info_list_windows(contents, &gpulist);
+
+ EXPECT_TRUE(gpulist.infos.size() == 1);
+
+ GpuInfo& nvidia_info = gpulist.infos[0];
+
+ EXPECT_FALSE(nvidia_info.current_gpu);
+ EXPECT_STREQ("10de", nvidia_info.make.c_str());
+ EXPECT_STREQ("NVIDIA Quadro K600", nvidia_info.model.c_str());
+ EXPECT_STREQ("0ffa", nvidia_info.device_id.c_str());
+ EXPECT_TRUE(nvidia_info.revision_id.empty());
+ EXPECT_STREQ("9.18.13.2086", nvidia_info.version.c_str());
+ EXPECT_TRUE(nvidia_info.renderer.empty());
+
+ EXPECT_TRUE(nvidia_info.dlls.size() == 8);
+ EXPECT_STREQ("nvd3dumx.dll", nvidia_info.dlls[0].c_str());
+ EXPECT_STREQ("nvwgf2umx.dll", nvidia_info.dlls[1].c_str());
+ EXPECT_STREQ("nvwgf2umx.dll", nvidia_info.dlls[2].c_str());
+ EXPECT_STREQ("nvd3dum", nvidia_info.dlls[3].c_str());
+ EXPECT_STREQ("nvwgf2um", nvidia_info.dlls[4].c_str());
+ EXPECT_STREQ("nvwgf2um", nvidia_info.dlls[5].c_str());
+ EXPECT_STREQ("nvoglv32.dll", nvidia_info.dlls[6].c_str());
+ EXPECT_STREQ("nvoglv64.dll", nvidia_info.dlls[7].c_str());
+}
+
+TEST(parse_gpu_info_list_windows, DualGpu) {
+ std::string contents(win_dual_gpu);
+
+ GpuInfoList gpulist;
+ parse_gpu_info_list_windows(contents, &gpulist);
+
+ EXPECT_TRUE(gpulist.infos.size() == 2);
+
+ GpuInfo& ati_info = gpulist.infos[0];
+ EXPECT_FALSE(ati_info.current_gpu);
+ EXPECT_STREQ("1002", ati_info.make.c_str());
+ EXPECT_STREQ("AMD Radeon (TM) R5 M335", ati_info.model.c_str());
+ EXPECT_STREQ("6660", ati_info.device_id.c_str());
+ EXPECT_TRUE(ati_info.revision_id.empty());
+ EXPECT_STREQ("15.300.1025.1001", ati_info.version.c_str());
+ EXPECT_TRUE(ati_info.renderer.empty());
+
+ EXPECT_TRUE(ati_info.dlls.size() == 19);
+ EXPECT_STREQ("aticfx64.dll", ati_info.dlls[0].c_str());
+ EXPECT_STREQ("aticfx64.dll", ati_info.dlls[1].c_str());
+ EXPECT_STREQ("aticfx64.dll", ati_info.dlls[2].c_str());
+ EXPECT_STREQ("amdxc64.dll", ati_info.dlls[3].c_str());
+ EXPECT_STREQ("aticfx32", ati_info.dlls[4].c_str());
+ EXPECT_STREQ("aticfx32", ati_info.dlls[5].c_str());
+ EXPECT_STREQ("aticfx32", ati_info.dlls[6].c_str());
+ EXPECT_STREQ("amdxc32", ati_info.dlls[7].c_str());
+ EXPECT_STREQ("atiumd64.dll", ati_info.dlls[8].c_str());
+ EXPECT_STREQ("atidxx64.dll", ati_info.dlls[9].c_str());
+ EXPECT_STREQ("atidxx64.dll", ati_info.dlls[10].c_str());
+ EXPECT_STREQ("atiumdag", ati_info.dlls[11].c_str());
+ EXPECT_STREQ("atidxx32", ati_info.dlls[12].c_str());
+ EXPECT_STREQ("atidxx32", ati_info.dlls[13].c_str());
+ EXPECT_STREQ("atiumdva", ati_info.dlls[14].c_str());
+ EXPECT_STREQ("atiumd6a.cap", ati_info.dlls[15].c_str());
+ EXPECT_STREQ("atitmm64.dll", ati_info.dlls[16].c_str());
+ EXPECT_STREQ("atioglxx.dll", ati_info.dlls[17].c_str());
+ EXPECT_STREQ("atig6txx.dll", ati_info.dlls[18].c_str());
+
+ GpuInfo& intel_info = gpulist.infos[1];
+ EXPECT_FALSE(intel_info.current_gpu);
+ EXPECT_STREQ("8086", intel_info.make.c_str());
+ EXPECT_STREQ("Intel(R) HD Graphics 520", intel_info.model.c_str());
+ EXPECT_STREQ("1916", intel_info.device_id.c_str());
+ EXPECT_TRUE(intel_info.revision_id.empty());
+ EXPECT_STREQ("10.18.15.4281", intel_info.version.c_str());
+ EXPECT_TRUE(intel_info.renderer.empty());
+
+ EXPECT_TRUE(intel_info.dlls.size() == 8);
+ EXPECT_STREQ("igdumdim64.dll", intel_info.dlls[0].c_str());
+ EXPECT_STREQ("igd10iumd64.dll", intel_info.dlls[1].c_str());
+ EXPECT_STREQ("igd10iumd64.dll", intel_info.dlls[2].c_str());
+ EXPECT_STREQ("igd12umd64.dll", intel_info.dlls[3].c_str());
+ EXPECT_STREQ("igdumdim32", intel_info.dlls[4].c_str());
+ EXPECT_STREQ("igd10iumd32", intel_info.dlls[5].c_str());
+ EXPECT_STREQ("igd10iumd32", intel_info.dlls[6].c_str());
+ EXPECT_STREQ("igd12umd32", intel_info.dlls[7].c_str());
+}
+
+#elif defined(__linux__)
+
+TEST(parse_gpu_info_list_linux, EmptyStr) {
+ std::string contents;
+
+ GpuInfoList gpulist;
+ parse_gpu_info_list_linux(contents, &gpulist);
+
+ EXPECT_TRUE(gpulist.infos.size() == 0);
+}
+
+TEST(parse_gpu_info_list_linux, NoGlxInfo) {
+ std::string contents(linux_2);
+
+ GpuInfoList gpulist;
+ parse_gpu_info_list_linux(contents, &gpulist);
+
+ EXPECT_TRUE(gpulist.infos.size() == 1);
+}
+
+TEST(parse_gpu_info_list_linux, Nolspci) {
+ std::string contents("\n");
+
+ GpuInfoList gpulist;
+ parse_gpu_info_list_linux(contents, &gpulist);
+
+ EXPECT_TRUE(gpulist.infos.size() == 0);
+}
+
+TEST(parse_gpu_info_list_linux, SingleGpu) {
+ std::string contents(linux_single_gpu);
+
+ GpuInfoList gpulist;
+ parse_gpu_info_list_linux(contents, &gpulist);
+
+ EXPECT_TRUE(gpulist.infos.size() == 1);
+ GpuInfo& nvidia_info = gpulist.infos[0];
+ EXPECT_FALSE(nvidia_info.current_gpu);
+ EXPECT_STREQ("10de", nvidia_info.make.c_str());
+ EXPECT_TRUE(nvidia_info.model.empty());
+ EXPECT_STREQ("13ba", nvidia_info.device_id.c_str());
+ EXPECT_TRUE(nvidia_info.revision_id.empty());
+ EXPECT_TRUE(nvidia_info.version.empty());
+ EXPECT_STREQ("OpenGL version string: 4.4.0 NVIDIA 340.96",
+ nvidia_info.renderer.c_str());
+ EXPECT_TRUE(nvidia_info.dlls.empty());
+}
+
+TEST(parse_gpu_info_list_linux, MesaDRI) {
+ std::string contents(linux_mesadri);
+
+ GpuInfoList gpulist;
+ parse_gpu_info_list_linux(contents, &gpulist);
+
+ EXPECT_TRUE(gpulist.infos.size() == 1);
+ GpuInfo& nvidia_info = gpulist.infos[0];
+ EXPECT_FALSE(nvidia_info.current_gpu);
+ EXPECT_STREQ("10de", nvidia_info.make.c_str());
+ EXPECT_TRUE(nvidia_info.model.empty());
+ EXPECT_STREQ("13ba", nvidia_info.device_id.c_str());
+ EXPECT_TRUE(nvidia_info.revision_id.empty());
+ EXPECT_TRUE(nvidia_info.version.empty());
+ EXPECT_STREQ("OpenGL version string: 3.0 Mesa 10.4.2 (git-)",
+ nvidia_info.renderer.c_str());
+ EXPECT_TRUE(nvidia_info.dlls.empty());
+}
+
+
+TEST(gpuinfo_query_blacklist, testBlacklist_Pos) {
+ const BlacklistEntry test_list[] = {
+ {"10de", nullptr, "13ba", nullptr, nullptr, nullptr, nullptr}
+ };
+
+ int test_list_len = sizeof(test_list) / sizeof(BlacklistEntry);
+
+ std::string contents(linux_single_gpu);
+ GpuInfoList gpulist;
+ parse_gpu_info_list_linux(contents, &gpulist);
+ bool on_blacklist = gpuinfo_query_blacklist(&gpulist,
+ test_list,
+ test_list_len);
+
+ EXPECT_TRUE(on_blacklist);
+}
+
+TEST(gpuinfo_query_blacklist, testBlacklist_Neg) {
+ const BlacklistEntry test_list[] = {
+ {"10dd", nullptr, "13ba", nullptr, nullptr, nullptr, nullptr},
+ {"ATI", "NVIDIA Quadro K600", nullptr, nullptr, nullptr, nullptr, nullptr},
+ {"ASDF", "Intel Iris Pro", nullptr, nullptr, nullptr, nullptr, nullptr}
+ };
+
+ int test_list_len = sizeof(test_list) / sizeof(BlacklistEntry);
+
+ std::string contents(linux_2);
+ GpuInfoList gpulist;
+ parse_gpu_info_list_linux(contents, &gpulist);
+ bool on_blacklist = gpuinfo_query_blacklist(&gpulist,
+ test_list,
+ test_list_len);
+
+ EXPECT_FALSE(on_blacklist);
+}
+
+#endif // __linux__
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/logger.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/logger.cpp
new file mode 100644
index 00000000000..796a9377581
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/logger.cpp
@@ -0,0 +1,254 @@
+// Copyright 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 "host-common/opengl/logger.h"
+
+#include "aemu/base/files/PathUtils.h"
+#include "aemu/base/synchronization/Lock.h"
+
+#include <algorithm>
+#include <fstream>
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string>
+
+#include "aemu/base/msvc.h"
+
+#ifndef _MSC_VER
+#include <sys/time.h>
+#endif
+#include <vector>
+
+using android::base::AutoLock;
+using android::base::Lock;
+using android::base::PathUtils;
+
+// The purpose of the OpenGL logger is to log
+// information about such things as EGL initialization
+// and possibly miscellanous OpenGL commands,
+// in order to get a better idea of what is going on
+// in crash reports.
+
+// The OpenGLLogger implementation's initialization method
+// by default uses the crash reporter's data directory.
+
+static const int kBufferLen = 2048;
+
+typedef std::pair<uint64_t, std::string> TimestampedLogEntry;
+
+class OpenGLLogger {
+public:
+ OpenGLLogger();
+ OpenGLLogger(const char* filename);
+ void stop();
+
+ // Coarse log: Call this infrequently.
+ void writeCoarse(const char* str);
+
+ // Fine log: When we want to log very frequent events.
+ // Fine logs can be toggled on/off.
+ void writeFineTimestamped(const char* str);
+
+ void setLoggerFlags(AndroidOpenglLoggerFlags flags);
+ bool isFineLogging() const;
+
+ static OpenGLLogger* get();
+
+private:
+
+ void writeFineLocked(uint64_t time, const char* str);
+ void stopFineLogLocked();
+
+ Lock mLock;
+ AndroidOpenglLoggerFlags mLoggerFlags = OPENGL_LOGGER_NONE;
+ uint64_t mPrevTimeUs = 0;
+ std::string mFileName;
+ std::ofstream mFileHandle;
+ std::string mFineLogFileName;
+ std::ofstream mFineLogFileHandle;
+ std::vector<TimestampedLogEntry> mFineLog;
+ DISALLOW_COPY_ASSIGN_AND_MOVE(OpenGLLogger);
+};
+
+static OpenGLLogger* sOpenGLLogger() {
+ static OpenGLLogger* g = new OpenGLLogger;
+ return g;
+}
+
+OpenGLLogger* OpenGLLogger::get() {
+ return sOpenGLLogger();
+}
+
+OpenGLLogger::OpenGLLogger() {
+// #ifdef AEMU_MIN
+ return;
+// #else
+// const std::string& data_dir =
+// CrashReporter::get()->getDataExchangeDir();
+// mFileName = PathUtils::join(data_dir,
+// "opengl_log.txt");
+// mFileHandle.open(mFileName, std::ios::app);
+// mFineLogFileName = PathUtils::join(data_dir,
+// "opengl_cxt_log.txt");
+// mFineLogFileHandle.open(mFineLogFileName, std::ios::app);
+// #endif
+}
+
+OpenGLLogger::OpenGLLogger(const char* filename) :
+ mFileName(filename) {
+ mFileHandle.open(mFileName, std::ios::app);
+}
+
+void OpenGLLogger::writeCoarse(const char* str) {
+ AutoLock lock(mLock);
+ if (mLoggerFlags & OPENGL_LOGGER_PRINT_TO_STDOUT) {
+ printf("%s\n", str);
+ }
+ if (mFileHandle) {
+ mFileHandle << str << std::endl;
+ }
+}
+
+void OpenGLLogger::stop() {
+ AutoLock lock(mLock);
+ stopFineLogLocked();
+ mFileHandle.close();
+}
+
+void OpenGLLogger::writeFineLocked(uint64_t time, const char* str) {
+ if (mLoggerFlags & OPENGL_LOGGER_PRINT_TO_STDOUT) {
+ printf("%s", str);
+ } else {
+ mFineLog.emplace_back(time, str);
+ }
+}
+
+void OpenGLLogger::writeFineTimestamped(const char* str) {
+ if (mLoggerFlags & OPENGL_LOGGER_DO_FINE_LOGGING) {
+ char buf[kBufferLen] = {};
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+
+ uint64_t curr_micros = (tv.tv_usec) % 1000;
+ uint64_t curr_millis = (tv.tv_usec / 1000) % 1000;
+ uint64_t curr_secs = tv.tv_sec;
+ uint64_t curr_us = tv.tv_sec * 1000000ULL + tv.tv_usec;
+ snprintf(buf, sizeof(buf) - 1,
+ "time_us="
+ "%" PRIu64 " s "
+ "%" PRIu64 " ms "
+ "%" PRIu64 " us deltaUs "
+ "%" PRIu64 " | %s",
+ curr_secs,
+ curr_millis,
+ curr_micros,
+ curr_us - mPrevTimeUs,
+ str);
+ AutoLock lock(mLock);
+ writeFineLocked(curr_micros + 1000ULL * curr_millis +
+ 1000ULL * 1000ULL * curr_secs, buf);
+ mPrevTimeUs = curr_us;
+ }
+}
+
+void OpenGLLogger::setLoggerFlags(AndroidOpenglLoggerFlags flags) {
+ AutoLock lock(mLock);
+ bool needStopFineLog =
+ (mLoggerFlags & OPENGL_LOGGER_DO_FINE_LOGGING) &&
+ (!(flags & OPENGL_LOGGER_DO_FINE_LOGGING));
+
+ if (needStopFineLog) {
+ stopFineLogLocked();
+ }
+
+ mLoggerFlags = flags;
+}
+
+bool OpenGLLogger::isFineLogging() const {
+ // For speed, we'll just let this read of mLoggerFlags race.
+ return (mLoggerFlags & OPENGL_LOGGER_DO_FINE_LOGGING);
+}
+
+void OpenGLLogger::stopFineLogLocked() {
+ // Only print message when fine-grained
+ // logging is turned on.
+ if (!mFineLog.empty()) {
+ fprintf(stderr,
+ "Writing fine-grained GL log to %s...",
+ mFineLogFileName.c_str());
+ }
+
+ // Sort log entries according to their timestamps.
+ // This is because the log entries might arrive
+ // out of order.
+ std::sort(mFineLog.begin(), mFineLog.end(),
+ [](const TimestampedLogEntry& x,
+ const TimestampedLogEntry& y) {
+ return x.first < y.first;
+ });
+
+ if (mFineLogFileHandle) {
+ for (const auto& entry : mFineLog) {
+ // The fine log does not print newlines
+ // as it is used with the opengl debug
+ // printout in emugl, which adds
+ // newlines of its own.
+ mFineLogFileHandle << entry.second;
+ }
+ mFineLogFileHandle.close();
+ if (!mFineLog.empty()) {
+ fprintf(stderr, "done\n");
+ }
+ }
+ mFineLog.clear();
+}
+
+// C interface
+
+void android_init_opengl_logger() {
+ OpenGLLogger::get();
+}
+
+void android_opengl_logger_set_flags(AndroidOpenglLoggerFlags flags) {
+ OpenGLLogger::get()->setLoggerFlags(flags);
+}
+
+void android_opengl_logger_write(const char* fmt, ...) {
+ char buf[kBufferLen] = {};
+ va_list ap;
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
+ va_end(ap);
+ OpenGLLogger::get()->writeCoarse(buf);
+}
+
+void android_opengl_cxt_logger_write(const char* fmt, ...) {
+ auto gl_log = OpenGLLogger::get();
+
+ if (!gl_log->isFineLogging()) return;
+
+ char buf[kBufferLen] = {};
+ va_list ap;
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
+ va_end(ap);
+
+ gl_log->writeFineTimestamped(buf);
+}
+
+void android_stop_opengl_logger() {
+ OpenGLLogger* gl_log = OpenGLLogger::get();
+ gl_log->stop();
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/macTouchOpenGL.m b/src/gfxstream/host/gl/gl-host-common/opengl/macTouchOpenGL.m
new file mode 100644
index 00000000000..31495dbcd9b
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/macTouchOpenGL.m
@@ -0,0 +1,37 @@
+// 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.
+
+#include "host-common/opengl/macTouchOpenGL.h"
+
+#include <Cocoa/Cocoa.h>
+#include <OpenGL/OpenGL.h>
+
+static NSOpenGLPixelFormatAttribute testAttrs[] =
+{
+ NSOpenGLPFADoubleBuffer,
+ NSOpenGLPFAWindow,
+ NSOpenGLPFAPixelBuffer,
+ NSOpenGLPFAColorSize ,32,
+ NSOpenGLPFADepthSize ,24,
+ NSOpenGLPFAStencilSize ,8,
+ 0
+};
+
+// In order for IOKit to know the latest GPU selection status, we need
+// to touch OpenGL a little bit. Here, we allocate and initialize a pixel
+// format, which seems to be enough.
+void macTouchOpenGL() {
+ void* res = [[NSOpenGLPixelFormat alloc] initWithAttributes:testAttrs];
+ [res release];
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/opengl/misc.cpp b/src/gfxstream/host/gl/gl-host-common/opengl/misc.cpp
new file mode 100644
index 00000000000..2459e9bf6d5
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengl/misc.cpp
@@ -0,0 +1,84 @@
+// 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 "host-common/opengl/misc.h"
+
+#include "aemu/base/GLObjectCounter.h"
+
+#include <cstring>
+
+static int s_glesMajorVersion = 2;
+static int s_glesMinorVersion = 0;
+
+android::base::GLObjectCounter* s_default_gl_object_counter = nullptr;
+
+android::base::GLObjectCounter* s_gl_object_counter = nullptr;
+static GrallocImplementation s_gralloc_implementation = MINIGBM;
+
+static SelectedRenderer s_renderer =
+ SELECTED_RENDERER_HOST;
+
+void emugl::setGlesVersion(int maj, int min) {
+ s_glesMajorVersion = maj;
+ s_glesMinorVersion = min;
+}
+
+void emugl::getGlesVersion(int* maj, int* min) {
+ if (maj) *maj = s_glesMajorVersion;
+ if (min) *min = s_glesMinorVersion;
+}
+
+void emugl::setRenderer(SelectedRenderer renderer) {
+ s_renderer = renderer;
+}
+
+SelectedRenderer emugl::getRenderer() {
+ return s_renderer;
+}
+
+bool emugl::hasExtension(const char* extensionsStr, const char* wantedExtension) {
+ if (!extensionsStr) {
+ return false;
+ }
+ const char* match = strstr(extensionsStr, wantedExtension);
+ size_t wantedTerminatorOffset = strlen(wantedExtension);
+ if (match &&
+ (match[wantedTerminatorOffset] == ' ' ||
+ match[wantedTerminatorOffset] == '\0')) {
+ return true;
+ }
+ return false;
+}
+
+void emugl::setGLObjectCounter(android::base::GLObjectCounter* counter) {
+ s_gl_object_counter = counter;
+}
+
+android::base::GLObjectCounter* emugl::getGLObjectCounter() {
+ if (!s_gl_object_counter) {
+ if (!s_default_gl_object_counter) {
+ s_default_gl_object_counter = new android::base::GLObjectCounter;
+ }
+ return s_default_gl_object_counter;
+ }
+ return s_gl_object_counter;
+}
+
+void emugl::setGrallocImplementation(GrallocImplementation gralloc) {
+ s_gralloc_implementation = gralloc;
+}
+
+GrallocImplementation emugl::getGrallocImplementation() {
+ return s_gralloc_implementation;
+}
diff --git a/src/gfxstream/host/gl/gl-host-common/opengles.cpp b/src/gfxstream/host/gl/gl-host-common/opengles.cpp
new file mode 100644
index 00000000000..a5b3de5d678
--- /dev/null
+++ b/src/gfxstream/host/gl/gl-host-common/opengles.cpp
@@ -0,0 +1,531 @@
+// Copyright 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 "host-common/opengles.h"
+
+#include "aemu/base/GLObjectCounter.h"
+#include "aemu/base/files/PathUtils.h"
+#include "aemu/base/files/Stream.h"
+#include "aemu/base/memory/MemoryTracker.h"
+#include "aemu/base/SharedLibrary.h"
+#include "aemu/base/system/System.h"
+#include "host-common/address_space_device.h"
+#include "host-common/address_space_graphics.h"
+#include "host-common/address_space_graphics_types.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/GoldfishDma.h"
+#include "host-common/RefcountPipe.h"
+#include "host-common/FeatureControl.h"
+#include "host-common/globals.h"
+#include "host-common/opengl/emugl_config.h"
+#include "host-common/opengl/GLProcessPipe.h"
+#include "host-common/opengl/logger.h"
+#include "host-common/opengl/gpuinfo.h"
+
+#include "render-utils/render_api_functions.h"
+#include "OpenGLESDispatch/EGLDispatch.h"
+#include "OpenGLESDispatch/GLESv2Dispatch.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <optional>
+
+#define D(...)
+#define DD(...)
+#define E(...)
+
+// #define D(...) do { \
+// VERBOSE_PRINT(init,__VA_ARGS__); \
+// android_opengl_logger_write(__VA_ARGS__); \
+// } while(0);
+//
+// #define DD(...) do { \
+// VERBOSE_PRINT(gles,__VA_ARGS__); \
+// android_opengl_logger_write(__VA_ARGS__); \
+// } while(0);
+//
+// #define E(fmt,...) do { \
+// derror(fmt, ##__VA_ARGS__); \
+// android_opengl_logger_write(fmt "\n", ##__VA_ARGS__); \
+// } while(0);
+
+using android::base::pj;
+using android::base::SharedLibrary;
+using android::emulation::asg::AddressSpaceGraphicsContext;
+using android::emulation::asg::ConsumerCallbacks;
+using android::emulation::asg::ConsumerInterface;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+using gfxstream::gl::EGLDispatch;
+using gfxstream::gl::GLESv2Dispatch;
+
+/* Name of the GLES rendering library we're going to use */
+#define RENDERER_LIB_NAME "libOpenglRender"
+
+/* Declared in "android/globals.h" */
+int android_gles_fast_pipes = 1;
+
+// Define the Render API function pointers.
+#define FUNCTION_(ret, name, sig, params) \
+ inline ret (*name) sig = NULL;
+LIST_RENDER_API_FUNCTIONS(FUNCTION_)
+#undef FUNCTION_
+
+static bool sOpenglLoggerInitialized = false;
+static bool sRendererUsesSubWindow = false;
+static bool sEgl2egl = false;
+static gfxstream::RenderLib* sRenderLib = nullptr;
+static gfxstream::RendererPtr sRenderer = nullptr;
+
+int android_prepareOpenglesEmulation() {
+ android_init_opengl_logger();
+
+ bool glFineLogging = android::base::getEnvironmentVariable("ANDROID_EMUGL_FINE_LOG") == "1";
+ bool glLogPrinting = android::base::getEnvironmentVariable("ANDROID_EMUGL_LOG_PRINT") == "1";
+
+ AndroidOpenglLoggerFlags loggerFlags =
+ static_cast<AndroidOpenglLoggerFlags>(
+ (glFineLogging ? OPENGL_LOGGER_DO_FINE_LOGGING : 0) |
+ (glLogPrinting ? OPENGL_LOGGER_PRINT_TO_STDOUT : 0));
+
+ android_opengl_logger_set_flags(loggerFlags);
+
+ sOpenglLoggerInitialized = true;
+ sRendererUsesSubWindow = true;
+
+ sEgl2egl = false;
+ if (android::base::getEnvironmentVariable("ANDROID_EGL_ON_EGL") == "1") {
+ sEgl2egl = true;
+ }
+
+ return 0;
+}
+
+int android_setOpenglesEmulation(void* renderLib, void* eglDispatch, void* glesv2Dispatch) {
+ sRenderLib = (gfxstream::RenderLib*)renderLib;
+ (void)eglDispatch;
+ (void)glesv2Dispatch;
+ sEgl2egl = android::base::getEnvironmentVariable("ANDROID_EGL_ON_EGL") == "1";
+ return 0;
+}
+
+int android_initOpenglesEmulation() {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Not meant to call android_initOpenglesEmulation in the new build.";
+}
+
+int
+android_startOpenglesRenderer(int width, int height, bool guestPhoneApi, int guestApiLevel,
+ const QAndroidVmOperations *vm_operations,
+ const QAndroidEmulatorWindowAgent *window_agent,
+ const QAndroidMultiDisplayAgent *multi_display_agent,
+ int* glesMajorVersion_out,
+ int* glesMinorVersion_out)
+{
+ if (!sRenderLib) {
+ D("Can't start OpenGLES renderer without support libraries");
+ return -1;
+ }
+
+ if (sRenderer) {
+ return 0;
+ }
+
+ const GpuInfoList& gpuList = globalGpuInfoList();
+ std::string gpuInfoAsString = gpuList.dump();
+ android_opengl_logger_write("%s: gpu info", __func__);
+ android_opengl_logger_write("%s", gpuInfoAsString.c_str());
+
+ sRenderLib->setRenderer(emuglConfig_get_current_renderer());
+ sRenderLib->setAvdInfo(guestPhoneApi, guestApiLevel);
+ // sRenderLib->setCrashReporter(&crashhandler_die_format);
+ // sRenderLib->setFeatureController(&android::featurecontrol::isEnabled);
+ sRenderLib->setSyncDevice(goldfish_sync_create_timeline,
+ goldfish_sync_create_fence,
+ goldfish_sync_timeline_inc,
+ goldfish_sync_destroy_timeline,
+ goldfish_sync_register_trigger_wait,
+ goldfish_sync_device_exists);
+
+ emugl_logger_struct logfuncs;
+ logfuncs.coarse = android_opengl_logger_write;
+ logfuncs.fine = android_opengl_cxt_logger_write;
+ sRenderLib->setLogger(logfuncs);
+ sRenderLib->setGLObjectCounter(android::base::GLObjectCounter::get());
+ emugl_dma_ops dma_ops;
+ dma_ops.get_host_addr = android_goldfish_dma_ops.get_host_addr;
+ dma_ops.unlock = android_goldfish_dma_ops.unlock;
+ sRenderLib->setDmaOps(dma_ops);
+ sRenderLib->setVmOps(*vm_operations);
+ sRenderLib->setAddressSpaceDeviceControlOps(get_address_space_device_control_ops());
+ sRenderLib->setWindowOps(*window_agent, *multi_display_agent);
+ // sRenderLib->setUsageTracker(android::base::CpuUsage::get(),
+ // android::base::MemoryTracker::get());
+
+ sRenderer = sRenderLib->initRenderer(width, height, sRendererUsesSubWindow, sEgl2egl);
+ android_setOpenglesRenderer(&sRenderer);
+
+ // android::snapshot::Snapshotter::get().addOperationCallback(
+ // [](android::snapshot::Snapshotter::Operation op,
+ // android::snapshot::Snapshotter::Stage stage) {
+ // sRenderer->snapshotOperationCallback(op, stage);
+ // });
+
+ android::emulation::registerOnLastRefCallback(
+ sRenderLib->getOnLastColorBufferRef());
+
+ ConsumerInterface iface = {
+ // create
+ [](struct asg_context context,
+ android::base::Stream* loadStream, ConsumerCallbacks callbacks,
+ uint32_t contextId, uint32_t capsetId,
+ std::optional<std::string> nameOpt) {
+ return sRenderer->addressSpaceGraphicsConsumerCreate(
+ context, loadStream, callbacks, contextId, capsetId, std::move(nameOpt));
+ },
+ // destroy
+ [](void* consumer) {
+ sRenderer->addressSpaceGraphicsConsumerDestroy(consumer);
+ },
+ // pre save
+ [](void* consumer) {
+ sRenderer->addressSpaceGraphicsConsumerPreSave(consumer);
+ },
+ // global presave
+ []() {
+ sRenderer->pauseAllPreSave();
+ },
+ // save
+ [](void* consumer, android::base::Stream* stream) {
+ sRenderer->addressSpaceGraphicsConsumerSave(consumer, stream);
+ },
+ // global postsave
+ []() {
+ sRenderer->resumeAll();
+ },
+ // postSave
+ [](void* consumer) {
+ sRenderer->addressSpaceGraphicsConsumerPostSave(consumer);
+ },
+ // postLoad
+ [](void* consumer) {
+ sRenderer->addressSpaceGraphicsConsumerRegisterPostLoadRenderThread(consumer);
+ },
+ // global preload
+ []() {
+ // This wants to address that when using asg, pipe wants to clean
+ // up all render threads and wait for gl objects, but framebuffer
+ // notices that there is a render thread info that is still not
+ // cleaned up because these render threads come from asg.
+ android::opengl::forEachProcessPipeIdRunAndErase([](uint64_t id) {
+ android_cleanupProcGLObjects(id);
+ });
+ android_waitForOpenglesProcessCleanup();
+ },
+ };
+ AddressSpaceGraphicsContext::setConsumer(iface);
+
+ if (!sRenderer) {
+ D("Can't start OpenGLES renderer?");
+ return -1;
+ }
+
+ // after initRenderer is a success, the maximum GLES API is calculated depending
+ // on feature control and host GPU support. Set the obtained GLES version here.
+ if (glesMajorVersion_out && glesMinorVersion_out)
+ sRenderLib->getGlesVersion(glesMajorVersion_out, glesMinorVersion_out);
+ return 0;
+}
+
+bool
+android_asyncReadbackSupported() {
+ if (sRenderer) {
+ return sRenderer->asyncReadbackSupported();
+ } else {
+ D("tried to query async readback support "
+ "before renderer initialized. Likely guest rendering");
+ return false;
+ }
+}
+
+void
+android_setPostCallback(OnPostFunc onPost, void* onPostContext, bool useBgraReadback, uint32_t displayId)
+{
+ if (sRenderer) {
+ sRenderer->setPostCallback(onPost, onPostContext, useBgraReadback, displayId);
+ }
+}
+
+ReadPixelsFunc android_getReadPixelsFunc() {
+ if (sRenderer) {
+ return sRenderer->getReadPixelsCallback();
+ } else {
+ return nullptr;
+ }
+}
+
+FlushReadPixelPipeline android_getFlushReadPixelPipeline() {
+ if (sRenderer) {
+ return sRenderer->getFlushReadPixelPipeline();
+ } else {
+ return nullptr;
+ }
+}
+
+
+static char* strdupBaseString(const char* src) {
+ const char* begin = strchr(src, '(');
+ if (!begin) {
+ return strdup(src);
+ }
+
+ const char* end = strrchr(begin + 1, ')');
+ if (!end) {
+ return strdup(src);
+ }
+
+ // src is of the form:
+ // "foo (barzzzzzzzzzz)"
+ // ^ ^
+ // (b+1) e
+ // = 5 18
+ int len;
+ begin += 1;
+ len = end - begin;
+
+ char* result;
+ result = (char*)malloc(len + 1);
+ memcpy(result, begin, len);
+ result[len] = '\0';
+ return result;
+}
+
+void android_getOpenglesHardwareStrings(char** vendor,
+ char** renderer,
+ char** version) {
+ assert(vendor != NULL && renderer != NULL && version != NULL);
+ assert(*vendor == NULL && *renderer == NULL && *version == NULL);
+ if (!sRenderer) {
+ D("Can't get OpenGL ES hardware strings when renderer not started");
+ return;
+ }
+
+ const gfxstream::Renderer::HardwareStrings strings = sRenderer->getHardwareStrings();
+ D("OpenGL Vendor=[%s]", strings.vendor.c_str());
+ D("OpenGL Renderer=[%s]", strings.renderer.c_str());
+ D("OpenGL Version=[%s]", strings.version.c_str());
+
+ /* Special case for the default ES to GL translators: extract the strings
+ * of the underlying OpenGL implementation. */
+ if (strncmp(strings.vendor.c_str(), "Google", 6) == 0 &&
+ strncmp(strings.renderer.c_str(), "Android Emulator OpenGL ES Translator", 37) == 0) {
+ *vendor = strdupBaseString(strings.vendor.c_str());
+ *renderer = strdupBaseString(strings.renderer.c_str());
+ *version = strdupBaseString(strings.version.c_str());
+ } else {
+ *vendor = strdup(strings.vendor.c_str());
+ *renderer = strdup(strings.renderer.c_str());
+ *version = strdup(strings.version.c_str());
+ }
+}
+
+void android_getOpenglesVersion(int* maj, int* min) {
+ sRenderLib->getGlesVersion(maj, min);
+ fprintf(stderr, "%s: maj min %d %d\n", __func__, *maj, *min);
+}
+
+void
+android_stopOpenglesRenderer(bool wait)
+{
+ if (sRenderer) {
+ sRenderer->stop(wait);
+ if (wait) {
+ sRenderer.reset();
+ android_stop_opengl_logger();
+ }
+ }
+}
+
+void
+android_finishOpenglesRenderer()
+{
+ if (sRenderer) {
+ sRenderer->finish();
+ }
+}
+
+static gfxstream::RenderOpt sOpt;
+static int sWidth, sHeight;
+static int sNewWidth, sNewHeight;
+
+int android_showOpenglesWindow(void* window,
+ int wx,
+ int wy,
+ int ww,
+ int wh,
+ int fbw,
+ int fbh,
+ float dpr,
+ float rotation,
+ bool deleteExisting,
+ bool hideWindow) {
+ if (!sRenderer) {
+ return -1;
+ }
+ FBNativeWindowType win = (FBNativeWindowType)(uintptr_t)window;
+ bool success = sRenderer->showOpenGLSubwindow(win, wx, wy, ww, wh, fbw, fbh,
+ dpr, rotation, deleteExisting,
+ hideWindow);
+ sNewWidth = ww * dpr;
+ sNewHeight = wh * dpr;
+ return success ? 0 : -1;
+}
+
+void
+android_setOpenglesTranslation(float px, float py)
+{
+ if (sRenderer) {
+ sRenderer->setOpenGLDisplayTranslation(px, py);
+ }
+}
+
+void
+android_setOpenglesScreenMask(int width, int height, const unsigned char* rgbaData)
+{
+ if (sRenderer) {
+ sRenderer->setScreenMask(width, height, rgbaData);
+ }
+}
+
+int
+android_hideOpenglesWindow(void)
+{
+ if (!sRenderer) {
+ return -1;
+ }
+ bool success = sRenderer->destroyOpenGLSubwindow();
+ return success ? 0 : -1;
+}
+
+void
+android_redrawOpenglesWindow(void)
+{
+ if (sRenderer) {
+ sRenderer->repaintOpenGLDisplay();
+ }
+}
+
+bool
+android_hasGuestPostedAFrame(void)
+{
+ if (sRenderer) {
+ return sRenderer->hasGuestPostedAFrame();
+ }
+ return false;
+}
+
+void
+android_resetGuestPostedAFrame(void)
+{
+ if (sRenderer) {
+ sRenderer->resetGuestPostedAFrame();
+ }
+}
+
+static ScreenshotFunc sScreenshotFunc = nullptr;
+
+void android_registerScreenshotFunc(ScreenshotFunc f)
+{
+ sScreenshotFunc = f;
+}
+
+bool android_screenShot(const char* dirname, uint32_t displayId)
+{
+ if (sScreenshotFunc) {
+ return sScreenshotFunc(dirname, displayId);
+ }
+ return false;
+}
+
+const gfxstream::RendererPtr& android_getOpenglesRenderer() { return sRenderer; }
+
+void android_setOpenglesRenderer(gfxstream::RendererPtr* renderer) {
+ sRenderer = *renderer;
+}
+
+void android_onGuestGraphicsProcessCreate(uint64_t puid) {
+ if (sRenderer) {
+ sRenderer->onGuestGraphicsProcessCreate(puid);
+ }
+}
+
+void android_cleanupProcGLObjects(uint64_t puid) {
+ if (sRenderer) {
+ sRenderer->cleanupProcGLObjects(puid);
+ }
+}
+
+void android_cleanupProcGLObjectsAndWaitFinished(uint64_t puid) {
+ if (sRenderer) {
+ sRenderer->cleanupProcGLObjects(puid);
+ }
+}
+
+void android_waitForOpenglesProcessCleanup() {
+ if (sRenderer) {
+ sRenderer->waitForProcessCleanup();
+ }
+}
+
+struct AndroidVirtioGpuOps* android_getVirtioGpuOps() {
+ if (sRenderer) {
+ return sRenderer->getVirtioGpuOps();
+ }
+ return nullptr;
+}
+
+const void* android_getEGLDispatch() {
+ if (sRenderer) {
+ return sRenderer->getEglDispatch();
+ }
+ return nullptr;
+}
+
+const void* android_getGLESv2Dispatch() {
+ if (sRenderer) {
+ return sRenderer->getGles2Dispatch();
+ }
+ return nullptr;
+}
+
+void android_setVsyncHz(int vsyncHz) {
+ if (sRenderer) {
+ sRenderer->setVsyncHz(vsyncHz);
+ }
+}
+
+void android_setOpenglesDisplayConfigs(int configId, int w, int h, int dpiX,
+ int dpiY) {
+ if (sRenderer) {
+ sRenderer->setDisplayConfigs(configId, w, h, dpiX, dpiY);
+ }
+}
+
+void android_setOpenglesDisplayActiveConfig(int configId) {
+ if (sRenderer) {
+ sRenderer->setDisplayActiveConfig(configId);
+ }
+}
diff --git a/src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer-goldfish.h b/src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer-goldfish.h
new file mode 100644
index 00000000000..7ef859bf725
--- /dev/null
+++ b/src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer-goldfish.h
@@ -0,0 +1,36 @@
+// Copyright 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 <cstdint>
+
+#include "gfxstream/virtio-gpu-gfxstream-renderer.h"
+#include "host-common/goldfish_pipe.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+VG_EXPORT void stream_renderer_set_service_ops(const GoldfishPipeServiceOps* ops);
+
+VG_EXPORT int stream_renderer_snapshot_presave_pause();
+VG_EXPORT int stream_renderer_snapshot_save(void* stream, void* textureSaver);
+VG_EXPORT int stream_renderer_snapshot_postsave_resume();
+VG_EXPORT int stream_renderer_snapshot_postsave_resume_for_testing();
+VG_EXPORT int stream_renderer_snapshot_load(void* stream, void* textureSaver);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer-unstable.h b/src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer-unstable.h
new file mode 100644
index 00000000000..429bfa58ded
--- /dev/null
+++ b/src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer-unstable.h
@@ -0,0 +1,109 @@
+#ifndef VIRTGPU_GFXSTREAM_RENDERER_UNSTABLE_H
+#define VIRTGPU_GFXSTREAM_RENDERER_UNSTABLE_H
+
+#include "gfxstream/virtio-gpu-gfxstream-renderer.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Enables the host to control which memory types the guest will be allowed to map. For types not
+// in the mask, the bits HOST_VISIBLE and HOST_COHERENT will be removed.
+#define STREAM_RENDERER_PARAM_HOST_VISIBLE_MEMORY_MASK 8
+
+// Skip android opengles initiation. Used by aemu to skip android opengles initiation.
+// aemu does its own initialization in qemu/android/android/android-emu/android/opengles.cpp.
+// TODO(joshuaduong): Migrate aemu to use stream_renderer_init without this hack. This will
+// require adding more options to customize the feature flags, etc.
+#define STREAM_RENDERER_SKIP_OPENGLES_INIT 10
+
+// Information about one device's memory mask.
+struct stream_renderer_param_host_visible_memory_mask_entry {
+ // Which device the mask applies to.
+ struct stream_renderer_device_id device_id;
+ // Memory types allowed to be host visible are 1, otherwise 0.
+ uint32_t memory_type_mask;
+};
+
+// Information about the devices in the system with host visible memory type constraints.
+struct stream_renderer_param_host_visible_memory_mask {
+ // Points to a stream_renderer_param_host_visible_memory_mask_entry array.
+ uint64_t entries;
+ // Length of the entries array.
+ uint64_t num_entries;
+};
+
+// Enables the host to control which GPU is used for rendering.
+#define STREAM_RENDERER_PARAM_RENDERING_GPU 9
+
+// External callbacks for tracking metrics.
+// Separating each function to a parameter allows new functions to be added later.
+#define STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_INSTANT_EVENT 1024
+typedef void (*stream_renderer_param_metrics_callback_add_instant_event)(int64_t event_code);
+
+#define STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_INSTANT_EVENT_WITH_DESCRIPTOR 1025
+typedef void (*stream_renderer_param_metrics_callback_add_instant_event_with_descriptor)(
+ int64_t event_code, int64_t descriptor);
+
+#define STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_INSTANT_EVENT_WITH_METRIC 1026
+typedef void (*stream_renderer_param_metrics_callback_add_instant_event_with_metric)(
+ int64_t event_code, int64_t metric_value);
+
+#define STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_VULKAN_OUT_OF_MEMORY_EVENT 1027
+typedef void (*stream_renderer_param_metrics_callback_add_vulkan_out_of_memory_event)(
+ int64_t result_code, uint32_t op_code, const char* function, uint32_t line,
+ uint64_t allocation_size, bool is_host_side_result, bool is_allocation);
+
+#define STREAM_RENDERER_PARAM_METRICS_CALLBACK_SET_ANNOTATION 1028
+typedef void (*stream_renderer_param_metrics_callback_set_annotation)(const char* key,
+ const char* value);
+
+#define STREAM_RENDERER_PARAM_METRICS_CALLBACK_ABORT 1029
+typedef void (*stream_renderer_param_metrics_callback_abort)();
+
+VG_EXPORT void gfxstream_backend_setup_window(void* native_window_handle, int32_t window_x,
+ int32_t window_y, int32_t window_width,
+ int32_t window_height, int32_t fb_width,
+ int32_t fb_height);
+
+VG_EXPORT void stream_renderer_flush(uint32_t res_handle);
+
+// Platform resources and contexts support
+#define STREAM_RENDERER_PLATFORM_RESOURCE_USE_MASK 0xF0
+#define STREAM_RENDERER_PLATFORM_RESOURCE_TYPE_MASK 0x0F
+
+// types
+#define STREAM_RENDERER_PLATFORM_RESOURCE_TYPE_EGL_NATIVE_PIXMAP 0x01
+#define STREAM_RENDERER_PLATFORM_RESOURCE_TYPE_EGL_IMAGE 0x02
+#define STREAM_RENDERER_PLATFORM_RESOURCE_TYPE_VK_EXT_MEMORY_HANDLE 0x03
+
+// uses
+#define STREAM_RENDERER_PLATFORM_RESOURCE_USE_PRESERVE 0x10
+
+VG_EXPORT int stream_renderer_platform_import_resource(int res_handle, int res_info,
+ void* resource);
+VG_EXPORT int stream_renderer_platform_resource_info(int res_handle, int* width, int* height,
+ int* internal_format);
+VG_EXPORT void* stream_renderer_platform_create_shared_egl_context(void);
+VG_EXPORT int stream_renderer_platform_destroy_shared_egl_context(void*);
+
+struct stream_renderer_resource_info {
+ uint32_t handle;
+ uint32_t virgl_format;
+ uint32_t width;
+ uint32_t height;
+ uint32_t depth;
+ uint32_t flags;
+ uint32_t tex_id;
+ uint32_t stride;
+ int drm_fourcc;
+};
+
+VG_EXPORT int stream_renderer_resource_get_info(int res_handle,
+ struct stream_renderer_resource_info* info);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif
diff --git a/src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer.h b/src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer.h
new file mode 100644
index 00000000000..20383d34293
--- /dev/null
+++ b/src/gfxstream/host/include/gfxstream/virtio-gpu-gfxstream-renderer.h
@@ -0,0 +1,258 @@
+// Copyright 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.
+
+#ifndef VIRTGPU_GFXSTREAM_RENDERER_H
+#define VIRTGPU_GFXSTREAM_RENDERER_H
+
+/* An implementation of virtio-gpu-3d that streams rendering commands. */
+
+#include <stddef.h>
+#include <stdint.h>
+
+#if defined(_WIN32)
+struct iovec;
+#else
+#include <sys/uio.h>
+#endif
+
+struct stream_renderer_box {
+ uint32_t x, y, z;
+ uint32_t w, h, d;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Versioning
+ */
+#define STREAM_RENDERER_VERSION_MAJOR 0
+#define STREAM_RENDERER_VERSION_MINOR 1
+#define STREAM_RENDERER_VERSION_PATCH 2
+
+#ifdef _WIN32
+#define VG_EXPORT __declspec(dllexport)
+#else
+#define VG_EXPORT __attribute__((visibility("default")))
+#endif
+
+struct stream_renderer_resource_create_args {
+ uint32_t handle;
+ uint32_t target;
+ uint32_t format;
+ uint32_t bind;
+ uint32_t width;
+ uint32_t height;
+ uint32_t depth;
+ uint32_t array_size;
+ uint32_t last_level;
+ uint32_t nr_samples;
+ uint32_t flags;
+};
+
+#define STREAM_RENDERER_FLAG_FENCE (1 << 0)
+#define STREAM_RENDERER_FLAG_FENCE_RING_IDX (1 << 1)
+#define STREAM_RENDERER_FLAG_FENCE_SHAREABLE (1 << 2)
+struct stream_renderer_fence {
+ uint32_t flags;
+ uint64_t fence_id;
+ uint32_t ctx_id;
+ uint8_t ring_idx;
+};
+
+#define STREAM_MEM_HANDLE_TYPE_OPAQUE_FD 0x1
+#define STREAM_MEM_HANDLE_TYPE_DMABUF 0x2
+#define STREAM_MEM_HANDLE_TYPE_OPAQUE_WIN32 0x3
+#define STREAM_MEM_HANDLE_TYPE_SHM 0x4
+#define STREAM_MEM_HANDLE_TYPE_ZIRCON 0x5
+#define STREAM_FENCE_HANDLE_TYPE_OPAQUE_FD 0x6
+#define STREAM_FENCE_HANDLE_TYPE_SYNC_FD 0x7
+#define STREAM_FENCE_HANDLE_TYPE_OPAQUE_WIN32 0x8
+#define STREAM_FENCE_HANDLE_TYPE_ZIRCON 0x9
+struct stream_renderer_handle {
+ int64_t os_handle;
+ uint32_t handle_type;
+};
+
+// Log level of gfxstream
+#ifndef STREAM_RENDERER_LOG_LEVEL
+#define STREAM_RENDERER_LOG_LEVEL 1
+#endif
+
+// @user_data: custom user data passed during `stream_renderer_init`
+// @type: one of STREAM_RENDERER_DEBUG_*
+// @string: null-terminated C-string
+#define STREAM_RENDERER_DEBUG_ERROR 0x1
+#define STREAM_RENDERER_DEBUG_WARN 0x2
+#define STREAM_RENDERER_DEBUG_INFO 0x3
+struct stream_renderer_debug {
+ uint32_t debug_type;
+ const char* message;
+};
+
+// Callback for writing a fence.
+typedef void (*stream_renderer_fence_callback)(void* user_data,
+ struct stream_renderer_fence* fence_data);
+
+// Callback for allowing debug prints or possibly even aborts.
+typedef void (*stream_renderer_debug_callback)(void* user_data,
+ struct stream_renderer_debug* debug);
+
+// Parameters - data passed to initialize the renderer, with the goal of avoiding FFI breakages.
+// To change the data a parameter is passing safely, you should create a new parameter and
+// deprecate the old one. The old parameter may be removed after sufficient time.
+//
+// STREAM_RENDERER_PARAM_NULL: Reserved value
+//
+// The following are required for correct operation:
+// STREAM_RENDERER_PARAM_USER_DATA: User data, for custom use by VMM.
+// STREAM_RENDERER_PARAM_RENDERER_FLAGS: Bitwise flags for the renderer.
+// STREAM_RENDERER_PARAM_FENCE_CALLBACK: A function of the type `stream_renderer_fence_callback`
+
+// The following are optional:
+// STREAM_RENDERER_PARAM_WIN0_WIDTH: The width of window[0], when using surface-based rendering
+// STREAM_RENDERER_PARAM_WIN0_HEIGHT: The height of window[0], when using surface-based rendering
+#define STREAM_RENDERER_PARAM_NULL 0
+#define STREAM_RENDERER_PARAM_USER_DATA 1
+#define STREAM_RENDERER_PARAM_RENDERER_FLAGS 2
+#define STREAM_RENDERER_PARAM_FENCE_CALLBACK 3
+#define STREAM_RENDERER_PARAM_WIN0_WIDTH 4
+#define STREAM_RENDERER_PARAM_WIN0_HEIGHT 5
+#define STREAM_RENDERER_PARAM_DEBUG_CALLBACK 6
+
+// An entry in the stream renderer parameters list.
+// The key should be one of STREAM_RENDERER_PARAM_*
+// The value can be either a uint64_t or cast to a pointer to a struct, depending on if the
+// parameter needs to pass data bigger than a single uint64_t.
+struct stream_renderer_param {
+ uint64_t key;
+ uint64_t value;
+};
+
+// Entry point for the stream renderer.
+// Pass a list of parameters to configure the renderer. The available ones are listed above. If a
+// parameter is not supported, the renderer will ignore it and warn in stderr.
+// Return value 0 indicates success, and a negative number indicates failure.
+VG_EXPORT int stream_renderer_init(struct stream_renderer_param* stream_renderer_params,
+ uint64_t num_params);
+
+VG_EXPORT void stream_renderer_teardown(void);
+
+VG_EXPORT int stream_renderer_resource_create(struct stream_renderer_resource_create_args* args,
+ struct iovec* iov, uint32_t num_iovs);
+VG_EXPORT void stream_renderer_resource_unref(uint32_t res_handle);
+VG_EXPORT void stream_renderer_context_destroy(uint32_t handle);
+
+struct stream_renderer_command {
+ uint32_t ctx_id;
+ uint32_t cmd_size;
+ uint8_t* cmd;
+
+ // Unstable: do not use until release strictly greater than 0.1.2
+ uint32_t num_in_fences;
+ struct stream_renderer_handle* fences;
+};
+
+VG_EXPORT int stream_renderer_submit_cmd(struct stream_renderer_command* cmd);
+
+VG_EXPORT int stream_renderer_transfer_read_iov(uint32_t handle, uint32_t ctx_id, uint32_t level,
+ uint32_t stride, uint32_t layer_stride,
+ struct stream_renderer_box* box, uint64_t offset,
+ struct iovec* iov, int iovec_cnt);
+VG_EXPORT int stream_renderer_transfer_write_iov(uint32_t handle, uint32_t ctx_id, int level,
+ uint32_t stride, uint32_t layer_stride,
+ struct stream_renderer_box* box, uint64_t offset,
+ struct iovec* iovec, unsigned int iovec_cnt);
+VG_EXPORT void stream_renderer_get_cap_set(uint32_t set, uint32_t* max_ver, uint32_t* max_size);
+VG_EXPORT void stream_renderer_fill_caps(uint32_t set, uint32_t version, void* caps);
+
+VG_EXPORT int stream_renderer_resource_attach_iov(int res_handle, struct iovec* iov, int num_iovs);
+VG_EXPORT void stream_renderer_resource_detach_iov(int res_handle, struct iovec** iov,
+ int* num_iovs);
+VG_EXPORT void stream_renderer_ctx_attach_resource(int ctx_id, int res_handle);
+VG_EXPORT void stream_renderer_ctx_detach_resource(int ctx_id, int res_handle);
+
+struct stream_renderer_create_blob {
+ uint32_t blob_mem;
+ uint32_t blob_flags;
+ uint64_t blob_id;
+ uint64_t size;
+};
+
+#define STREAM_BLOB_MEM_GUEST 1
+#define STREAM_BLOB_MEM_HOST3D 2
+#define STREAM_BLOB_MEM_HOST3D_GUEST 3
+
+#define STREAM_BLOB_FLAG_USE_MAPPABLE 1
+#define STREAM_BLOB_FLAG_USE_SHAREABLE 2
+#define STREAM_BLOB_FLAG_USE_CROSS_DEVICE 4
+#define STREAM_BLOB_FLAG_CREATE_GUEST_HANDLE 8
+
+VG_EXPORT int stream_renderer_create_blob(uint32_t ctx_id, uint32_t res_handle,
+ const struct stream_renderer_create_blob* create_blob,
+ const struct iovec* iovecs, uint32_t num_iovs,
+ const struct stream_renderer_handle* handle);
+
+VG_EXPORT int stream_renderer_export_blob(uint32_t res_handle,
+ struct stream_renderer_handle* handle);
+
+VG_EXPORT int stream_renderer_resource_map(uint32_t res_handle, void** hvaOut, uint64_t* sizeOut);
+VG_EXPORT int stream_renderer_resource_unmap(uint32_t res_handle);
+
+VG_EXPORT int stream_renderer_context_create(uint32_t ctx_id, uint32_t nlen, const char* name,
+ uint32_t context_init);
+
+VG_EXPORT int stream_renderer_create_fence(const struct stream_renderer_fence* fence);
+
+#define STREAM_RENDERER_MAP_CACHE_MASK 0x0f
+#define STREAM_RENDERER_MAP_CACHE_NONE 0x00
+#define STREAM_RENDERER_MAP_CACHE_CACHED 0x01
+#define STREAM_RENDERER_MAP_CACHE_UNCACHED 0x02
+#define STREAM_RENDERER_MAP_CACHE_WC 0x03
+VG_EXPORT int stream_renderer_resource_map_info(uint32_t res_handle, uint32_t* map_info);
+
+// Unique identifier for a GPU device.
+struct stream_renderer_device_id {
+ uint8_t device_uuid[16];
+ uint8_t driver_uuid[16];
+};
+
+struct stream_renderer_vulkan_info {
+ uint32_t memory_index;
+ struct stream_renderer_device_id device_id;
+};
+
+VG_EXPORT int stream_renderer_vulkan_info(uint32_t res_handle,
+ struct stream_renderer_vulkan_info* vulkan_info);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+// based on VIRGL_RENDERER_USE* and friends
+enum RendererFlags {
+ STREAM_RENDERER_FLAGS_USE_EGL_BIT = 1 << 0,
+ STREAM_RENDERER_FLAGS_THREAD_SYNC = 1 << 1,
+ STREAM_RENDERER_FLAGS_USE_GLX_BIT = 1 << 2,
+ STREAM_RENDERER_FLAGS_USE_SURFACELESS_BIT = 1 << 3,
+ STREAM_RENDERER_FLAGS_USE_GLES_BIT = 1 << 4,
+ STREAM_RENDERER_FLAGS_USE_VK_BIT = 1 << 5,
+ STREAM_RENDERER_FLAGS_USE_EXTERNAL_BLOB = 1 << 6,
+ STREAM_RENDERER_FLAGS_USE_SYSTEM_BLOB = 1 << 7,
+ STREAM_RENDERER_FLAGS_VULKAN_NATIVE_SWAPCHAIN_BIT = 1 << 8,
+ STREAM_RENDERER_FLAGS_VULKAN_SNAPSHOTS = 1 << 9,
+};
+
+#endif
diff --git a/src/gfxstream/host/meson.build b/src/gfxstream/host/meson.build
new file mode 100644
index 00000000000..bf1f793e355
--- /dev/null
+++ b/src/gfxstream/host/meson.build
@@ -0,0 +1,285 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+#===============#
+# Configuration #
+#===============#
+gfxstream_host_args = [
+ '-D_FILE_OFFSET_BITS=64',
+ '-Wno-unused-parameter',
+ '-Wno-unused-function',
+ '-Wno-unused-variable',
+ '-Wno-ignored-qualifiers',
+ '-Wno-mismatched-tags',
+ '-Wno-missing-field-initializers',
+ '-Wno-implicit-fallthrough',
+]
+
+if host_machine.system() == 'qnx'
+ gfxstream_host_args += '-D_QNX_SOURCE'
+ qnx_target = get_option('qnx_target')
+ if qnx_target == ''
+ error('option qnx_target is not set')
+ endif
+endif
+
+#===============#
+# Dependencies #
+#===============#
+if host_machine.system() == 'qnx'
+ ## have not yet got pkgconfig to work with cross-compile,
+ ## finding libraries manually in the meantime.
+
+ ## ERROR: Dependency "screen" not found, tried pkgconfig
+ # qnx_screen_dep = dependency('screen')
+
+ rel_path_prefix = meson.get_external_property('qnx_path_prefix')
+ abs_path_prefix = meson.current_source_dir() + '/' + rel_path_prefix
+
+ aemu_libs_path = abs_path_prefix + '/aemu/install/lib'
+
+ incl_aemu_headers = include_directories([
+ rel_path_prefix + '/aemu/install/include',
+ rel_path_prefix + '/aemu/install/include/aemu/host-common',
+ rel_path_prefix + '/aemu/install/include/aemu/snapshot',
+ ])
+
+ aemu_base_lib = cc.find_library('aemu-base', dirs: aemu_libs_path)
+ aemu_base_dep = declare_dependency(include_directories : incl_aemu_headers, dependencies : [aemu_base_lib])
+
+ aemu_common_lib = cc.find_library('aemu-host-common', dirs: aemu_libs_path)
+ aemu_common_dep = declare_dependency(include_directories : incl_aemu_headers, dependencies : [aemu_common_lib])
+
+ aemu_logging_lib = cc.find_library('aemu-logging', dirs: aemu_libs_path)
+ aemu_logging_dep = declare_dependency(include_directories : incl_aemu_headers, dependencies : [aemu_logging_lib])
+
+ aemu_snapshot_lib = cc.find_library('aemu-snapshot', dirs: aemu_libs_path)
+ aemu_snapshot_dep = declare_dependency(include_directories : incl_aemu_headers, dependencies : [aemu_snapshot_lib])
+
+ inc_qnx_headers = include_directories(join_paths(qnx_target, 'usr/include'))
+ qnx_screen_lib = cc.find_library('screen', required : true)
+ qnx_screen_dep = declare_dependency(include_directories: inc_qnx_headers, dependencies: [qnx_screen_lib])
+
+ qnx_egl_lib = cc.find_library('EGL', required : true)
+ qnx_egl_dep = declare_dependency(include_directories: inc_qnx_headers, dependencies: [qnx_egl_lib])
+
+ qnx_gles2_lib = cc.find_library('GLESv2', required : true)
+ qnx_gles2_dep = declare_dependency(include_directories: inc_qnx_headers, dependencies: [qnx_gles2_lib])
+
+else
+ aemu_base_dep = dependency('aemu_base')
+ aemu_common_dep = dependency('aemu_host_common')
+ aemu_logging_dep = dependency('aemu_logging')
+ aemu_snapshot_dep = dependency('aemu_snapshot')
+ dl_dep = dependency('dl')
+ thread_dep = dependency('threads')
+endif
+
+if log_level == 'error'
+ gfxstream_host_args += '-DSTREAM_RENDERER_LOG_LEVEL=1'
+elif log_level == 'warn'
+ gfxstream_host_args += '-DSTREAM_RENDERER_LOG_LEVEL=2'
+elif log_level == 'info'
+ gfxstream_host_args += '-DSTREAM_RENDERER_LOG_LEVEL=3'
+endif
+
+if use_auto and (use_gles or use_vulkan or use_magma)
+ error('Can not specify auto and custom options are same time')
+endif
+
+if use_auto
+ use_gles = true
+ use_vulkan = true
+ use_composer = true
+ use_magma = host_machine.system() == 'linux'
+endif
+
+gfxstream_host_args += '-DGFXSTREAM_ENABLE_HOST_GLES=@0@'.format(use_gles ? '1' : '0')
+if use_magma
+ gfxstream_host_args += '-DUSE_MAGMA=1'
+ drm_dep = dependency('libdrm')
+else
+ gfxstream_host_args += '-DUSE_MAGMA=0'
+endif
+
+if use_magma
+ gfxstream_host_args += '-DGFXSTREAM_ENABLE_HOST_GLES=1'
+ drm_dep = dependency('libdrm')
+else
+ gfxstream_host_args += '-DGFXSTREAM_ENABLE_HOST_GLES=0'
+endif
+
+#===============#
+# Includes #
+#===============#
+
+gfxstream_headers = files(
+ 'include/gfxstream/virtio-gpu-gfxstream-renderer.h',
+ 'include/gfxstream/virtio-gpu-gfxstream-renderer-unstable.h')
+
+inc_root = include_directories('../')
+inc_gfxstream_include = include_directories('../include')
+inc_utils = include_directories('../utils/include')
+
+if use_vulkan
+ if cc.has_header('vulkan/vulkan.h')
+ inc_vulkan_headers = include_directories()
+ else
+ inc_vulkan_headers = include_directories('../common/vulkan/include')
+ endif
+
+ if cc.has_header('renderdoc_app.h')
+ inc_renderdoc_external = include_directories()
+ else
+ inc_renderdoc_external = include_directories('../third-party/renderdoc/include')
+ endif
+endif
+
+if use_magma
+ inc_magma_external = include_directories('../third-party/fuchsia/magma/include')
+ inc_magma_external_lib = include_directories('../third-party/fuchsia/magma/include/lib')
+endif
+
+dep_glm = dependency('glm')
+
+inc_stream_servers = include_directories('.')
+inc_host_include = include_directories('include')
+
+subdir('apigen-codec-common')
+subdir('gl/gl-host-common')
+
+inc_gfxstream_backend = [inc_root, inc_gfxstream_include, inc_include, inc_apigen_codec, inc_utils,
+ inc_gl_host_common, inc_host_include]
+
+link_gfxstream_backend = [lib_gl_host_common, lib_apigen_codec]
+
+files_lib_gfxstream_backend = files(
+ 'Buffer.cpp',
+ 'BlobManager.cpp',
+ 'ChannelStream.cpp',
+ 'ColorBuffer.cpp',
+ 'DisplaySurface.cpp',
+ 'DisplaySurfaceUser.cpp',
+ 'Hwc2.cpp',
+ 'PostWorker.cpp',
+ 'ReadBuffer.cpp',
+ 'render_api.cpp',
+ 'RenderChannelImpl.cpp',
+ 'RenderThread.cpp',
+ 'RenderThreadInfo.cpp',
+ 'RingStream.cpp',
+ 'SyncThread.cpp',
+ 'RenderWindow.cpp',
+ 'RenderLibImpl.cpp',
+ 'RendererImpl.cpp',
+ 'FrameBuffer.cpp',
+ 'GfxStreamAgents.cpp',
+ 'virtio-gpu-gfxstream-renderer.cpp',
+ 'VirtioGpuTimelines.cpp',
+ 'VsyncThread.cpp',
+)
+
+deps_gfxstream_backend = [
+ aemu_common_dep,
+ aemu_base_dep,
+ aemu_logging_dep,
+ aemu_snapshot_dep,
+ dep_glm,
+]
+
+link_args_gfxstream_backend = ''
+
+if host_machine.system() == 'linux'
+ deps_gfxstream_backend += [
+ dl_dep,
+ thread_dep,
+ ]
+ link_args_gfxstream_backend = '-Wl,-lpthread,-lrt'
+endif
+
+if host_machine.system() == 'qnx'
+ deps_gfxstream_backend += [
+ qnx_egl_dep,
+ qnx_gles2_dep,
+ qnx_screen_dep,
+ ]
+endif
+
+if use_gles or use_vulkan
+ subdir('compressedTextureFormats')
+endif
+
+if use_gles
+ subdir('gl')
+
+ files_lib_gfxstream_backend += files('PostWorkerGl.cpp')
+ files_lib_gfxstream_backend += files('RenderThreadInfoGl.cpp')
+ files_lib_gfxstream_backend += files('RenderControl.cpp')
+
+ inc_gfxstream_backend += [inc_gl_server, inc_gl_snapshot, inc_gles_translator]
+ link_gfxstream_backend += lib_gl_server
+endif
+
+if use_vulkan
+ subdir('vulkan')
+ inc_gfxstream_backend += [inc_cereal, inc_vulkan_headers,
+ inc_vulkan_server, inc_renderdoc_external]
+ link_gfxstream_backend += lib_vulkan_server
+ deps_gfxstream_backend += dep_cereal_common
+endif
+
+if use_composer
+ subdir('renderControl_dec')
+ link_gfxstream_backend += lib_composer
+endif
+
+if use_magma
+ subdir('magma')
+ files_lib_gfxstream_backend += files('RenderThreadInfoMagma.cpp')
+ inc_gfxstream_backend += [inc_magma_dec, inc_magma_external]
+ link_gfxstream_backend += lib_magma_server
+endif
+
+if not use_gles
+ files_lib_gfxstream_backend += files('NativeSubWindow_stub.cpp')
+elif host_machine.system() == 'darwin'
+ files_lib_gfxstream_backend += files('NativeSubWindow_cocoa.m')
+elif host_machine.system() == 'windows'
+ files_lib_gfxstream_backend += files('NativeSubWindow_win32.cpp')
+elif host_machine.system() == 'linux' and use_gles
+ files_lib_gfxstream_backend += files('NativeSubWindow_x11.cpp')
+elif host_machine.system() == 'qnx'
+ files_lib_gfxstream_backend += files(
+ 'NativeSubWindow_qnx.cpp',
+ '../qnx/host/platform_qnx.cpp',
+ )
+endif
+
+gfxstream_backend_cpp_args = [
+ '-Wno-unused-parameter',
+ '-Wno-unused-variable',
+ '-Wno-unused-function',
+ '-DVK_GFXSTREAM_STRUCTURE_TYPE_EXT',
+]
+
+gfxstream_backend = library(
+ 'gfxstream_backend',
+ files_lib_gfxstream_backend,
+ cpp_args: gfxstream_host_args + gfxstream_backend_cpp_args,
+ include_directories: [inc_gfxstream_backend],
+ gnu_symbol_visibility: 'default',
+ dependencies: deps_gfxstream_backend,
+ link_with: link_gfxstream_backend,
+ link_args : link_args_gfxstream_backend,
+ version: '0.1.2',
+ install: true,
+)
+
+install_headers(gfxstream_headers,
+ subdir: 'gfxstream')
+
+pkg = import('pkgconfig')
+pkg.generate(gfxstream_backend,
+ description: 'gfxstream backend',
+ subdirs: 'gfxstream'
+)
diff --git a/src/gfxstream/host/render_api.cpp b/src/gfxstream/host/render_api.cpp
new file mode 100644
index 00000000000..a133c1a607c
--- /dev/null
+++ b/src/gfxstream/host/render_api.cpp
@@ -0,0 +1,29 @@
+/*
+* Copyright (C) 2011-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 "render-utils/render_api.h"
+
+#include "host-common/logging.h"
+#include "RenderLibImpl.h"
+
+#include <memory>
+
+namespace gfxstream {
+
+RENDER_APICALL RenderLibPtr RENDER_APIENTRY initLibrary() {
+ return RenderLibPtr(new RenderLibImpl());
+}
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/virgl_hw.h b/src/gfxstream/host/virgl_hw.h
new file mode 100644
index 00000000000..fac182552eb
--- /dev/null
+++ b/src/gfxstream/host/virgl_hw.h
@@ -0,0 +1,370 @@
+/**************************************************************************
+ *
+ * Copyright (C) 2015 Red Hat 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 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 VIRGL_HW_H
+#define VIRGL_HW_H
+
+#include <stdint.h>
+
+struct virgl_box {
+ uint32_t x, y, z;
+ uint32_t w, h, d;
+};
+
+/* formats known by the HW device - based on gallium subset */
+enum virgl_formats {
+ VIRGL_FORMAT_B8G8R8A8_UNORM = 1,
+ VIRGL_FORMAT_B8G8R8X8_UNORM = 2,
+ VIRGL_FORMAT_A8R8G8B8_UNORM = 3,
+ VIRGL_FORMAT_X8R8G8B8_UNORM = 4,
+ VIRGL_FORMAT_B5G5R5A1_UNORM = 5,
+ VIRGL_FORMAT_B4G4R4A4_UNORM = 6,
+ VIRGL_FORMAT_B5G6R5_UNORM = 7,
+ VIRGL_FORMAT_R10G10B10A2_UNORM = 8,
+ VIRGL_FORMAT_L8_UNORM = 9, /**< ubyte luminance */
+ VIRGL_FORMAT_A8_UNORM = 10, /**< ubyte alpha */
+ VIRGL_FORMAT_L8A8_UNORM = 12, /**< ubyte alpha, luminance */
+ VIRGL_FORMAT_L16_UNORM = 13, /**< ushort luminance */
+
+ VIRGL_FORMAT_Z16_UNORM = 16,
+ VIRGL_FORMAT_Z32_UNORM = 17,
+ VIRGL_FORMAT_Z32_FLOAT = 18,
+ VIRGL_FORMAT_Z24_UNORM_S8_UINT = 19,
+ VIRGL_FORMAT_S8_UINT_Z24_UNORM = 20,
+ VIRGL_FORMAT_Z24X8_UNORM = 21,
+ VIRGL_FORMAT_S8_UINT = 23, /**< ubyte stencil */
+
+ VIRGL_FORMAT_R32_FLOAT = 28,
+ VIRGL_FORMAT_R32G32_FLOAT = 29,
+ VIRGL_FORMAT_R32G32B32_FLOAT = 30,
+ VIRGL_FORMAT_R32G32B32A32_FLOAT = 31,
+
+ VIRGL_FORMAT_R16_UNORM = 48,
+ VIRGL_FORMAT_R16G16_UNORM = 49,
+
+ VIRGL_FORMAT_R16G16B16A16_UNORM = 51,
+
+ VIRGL_FORMAT_R16_SNORM = 56,
+ VIRGL_FORMAT_R16G16_SNORM = 57,
+ VIRGL_FORMAT_R16G16B16A16_SNORM = 59,
+
+ VIRGL_FORMAT_R8_UNORM = 64,
+ VIRGL_FORMAT_R8G8_UNORM = 65,
+ VIRGL_FORMAT_R8G8B8_UNORM = 66,
+ VIRGL_FORMAT_R8G8B8A8_UNORM = 67,
+
+ VIRGL_FORMAT_R8_SNORM = 74,
+ VIRGL_FORMAT_R8G8_SNORM = 75,
+ VIRGL_FORMAT_R8G8B8_SNORM = 76,
+ VIRGL_FORMAT_R8G8B8A8_SNORM = 77,
+
+ VIRGL_FORMAT_R16_FLOAT = 91,
+ VIRGL_FORMAT_R16G16_FLOAT = 92,
+ VIRGL_FORMAT_R16G16B16_FLOAT = 93,
+ VIRGL_FORMAT_R16G16B16A16_FLOAT = 94,
+
+ VIRGL_FORMAT_L8_SRGB = 95,
+ VIRGL_FORMAT_L8A8_SRGB = 96,
+ VIRGL_FORMAT_B8G8R8A8_SRGB = 100,
+ VIRGL_FORMAT_B8G8R8X8_SRGB = 101,
+ VIRGL_FORMAT_R8G8B8A8_SRGB = 104,
+
+ /* compressed formats */
+ VIRGL_FORMAT_DXT1_RGB = 105,
+ VIRGL_FORMAT_DXT1_RGBA = 106,
+ VIRGL_FORMAT_DXT3_RGBA = 107,
+ VIRGL_FORMAT_DXT5_RGBA = 108,
+
+ /* sRGB, compressed */
+ VIRGL_FORMAT_DXT1_SRGB = 109,
+ VIRGL_FORMAT_DXT1_SRGBA = 110,
+ VIRGL_FORMAT_DXT3_SRGBA = 111,
+ VIRGL_FORMAT_DXT5_SRGBA = 112,
+
+ /* rgtc compressed */
+ VIRGL_FORMAT_RGTC1_UNORM = 113,
+ VIRGL_FORMAT_RGTC1_SNORM = 114,
+ VIRGL_FORMAT_RGTC2_UNORM = 115,
+ VIRGL_FORMAT_RGTC2_SNORM = 116,
+
+ VIRGL_FORMAT_A8B8G8R8_UNORM = 121,
+ VIRGL_FORMAT_B5G5R5X1_UNORM = 122,
+ VIRGL_FORMAT_R11G11B10_FLOAT = 124,
+ VIRGL_FORMAT_R9G9B9E5_FLOAT = 125,
+ VIRGL_FORMAT_Z32_FLOAT_S8X24_UINT = 126,
+
+ VIRGL_FORMAT_B10G10R10A2_UNORM = 131,
+ VIRGL_FORMAT_R8G8B8X8_UNORM = 134,
+ VIRGL_FORMAT_B4G4R4X4_UNORM = 135,
+ VIRGL_FORMAT_X24S8_UINT = 136,
+ VIRGL_FORMAT_S8X24_UINT = 137,
+ VIRGL_FORMAT_B2G3R3_UNORM = 139,
+
+ VIRGL_FORMAT_L16A16_UNORM = 140,
+ VIRGL_FORMAT_A16_UNORM = 141,
+
+ VIRGL_FORMAT_A8_SNORM = 147,
+ VIRGL_FORMAT_L8_SNORM = 148,
+ VIRGL_FORMAT_L8A8_SNORM = 149,
+
+ VIRGL_FORMAT_A16_SNORM = 151,
+ VIRGL_FORMAT_L16_SNORM = 152,
+ VIRGL_FORMAT_L16A16_SNORM = 153,
+
+ VIRGL_FORMAT_A16_FLOAT = 155,
+ VIRGL_FORMAT_L16_FLOAT = 156,
+ VIRGL_FORMAT_L16A16_FLOAT = 157,
+
+ VIRGL_FORMAT_A32_FLOAT = 159,
+ VIRGL_FORMAT_L32_FLOAT = 160,
+ VIRGL_FORMAT_L32A32_FLOAT = 161,
+
+ VIRGL_FORMAT_YV12 = 163,
+ VIRGL_FORMAT_YV16 = 164,
+ VIRGL_FORMAT_IYUV = 165, /**< aka I420 */
+ VIRGL_FORMAT_NV12 = 166,
+ VIRGL_FORMAT_NV21 = 167,
+
+ VIRGL_FORMAT_R8_UINT = 177,
+ VIRGL_FORMAT_R8G8_UINT = 178,
+ VIRGL_FORMAT_R8G8B8_UINT = 179,
+ VIRGL_FORMAT_R8G8B8A8_UINT = 180,
+
+ VIRGL_FORMAT_R8_SINT = 181,
+ VIRGL_FORMAT_R8G8_SINT = 182,
+ VIRGL_FORMAT_R8G8B8_SINT = 183,
+ VIRGL_FORMAT_R8G8B8A8_SINT = 184,
+
+ VIRGL_FORMAT_R16_UINT = 185,
+ VIRGL_FORMAT_R16G16_UINT = 186,
+ VIRGL_FORMAT_R16G16B16_UINT = 187,
+ VIRGL_FORMAT_R16G16B16A16_UINT = 188,
+
+ VIRGL_FORMAT_R16_SINT = 189,
+ VIRGL_FORMAT_R16G16_SINT = 190,
+ VIRGL_FORMAT_R16G16B16_SINT = 191,
+ VIRGL_FORMAT_R16G16B16A16_SINT = 192,
+ VIRGL_FORMAT_R32_UINT = 193,
+ VIRGL_FORMAT_R32G32_UINT = 194,
+ VIRGL_FORMAT_R32G32B32_UINT = 195,
+ VIRGL_FORMAT_R32G32B32A32_UINT = 196,
+
+ VIRGL_FORMAT_R32_SINT = 197,
+ VIRGL_FORMAT_R32G32_SINT = 198,
+ VIRGL_FORMAT_R32G32B32_SINT = 199,
+ VIRGL_FORMAT_R32G32B32A32_SINT = 200,
+
+ VIRGL_FORMAT_A8_UINT = 201,
+ VIRGL_FORMAT_L8_UINT = 203,
+ VIRGL_FORMAT_L8A8_UINT = 204,
+
+ VIRGL_FORMAT_A8_SINT = 205,
+ VIRGL_FORMAT_L8_SINT = 207,
+ VIRGL_FORMAT_L8A8_SINT = 208,
+
+ VIRGL_FORMAT_A16_UINT = 209,
+ VIRGL_FORMAT_L16_UINT = 211,
+ VIRGL_FORMAT_L16A16_UINT = 212,
+
+ VIRGL_FORMAT_A16_SINT = 213,
+ VIRGL_FORMAT_L16_SINT = 215,
+ VIRGL_FORMAT_L16A16_SINT = 216,
+
+ VIRGL_FORMAT_A32_UINT = 217,
+ VIRGL_FORMAT_L32_UINT = 219,
+ VIRGL_FORMAT_L32A32_UINT = 220,
+
+ VIRGL_FORMAT_A32_SINT = 221,
+ VIRGL_FORMAT_L32_SINT = 223,
+ VIRGL_FORMAT_L32A32_SINT = 224,
+
+ VIRGL_FORMAT_B10G10R10A2_UINT = 225,
+ VIRGL_FORMAT_R8G8B8X8_SNORM = 229,
+
+ VIRGL_FORMAT_R8G8B8X8_SRGB = 230,
+
+ VIRGL_FORMAT_R8G8B8X8_UINT = 231,
+ VIRGL_FORMAT_R8G8B8X8_SINT = 232,
+ VIRGL_FORMAT_B10G10R10X2_UNORM = 233,
+ VIRGL_FORMAT_R16G16B16X16_UNORM = 234,
+ VIRGL_FORMAT_R16G16B16X16_SNORM = 235,
+ VIRGL_FORMAT_R16G16B16X16_FLOAT = 236,
+ VIRGL_FORMAT_R16G16B16X16_UINT = 237,
+ VIRGL_FORMAT_R16G16B16X16_SINT = 238,
+
+ VIRGL_FORMAT_R10G10B10A2_UINT = 253,
+
+ VIRGL_FORMAT_BPTC_RGBA_UNORM = 255,
+ VIRGL_FORMAT_BPTC_SRGBA = 256,
+ VIRGL_FORMAT_BPTC_RGB_FLOAT = 257,
+ VIRGL_FORMAT_BPTC_RGB_UFLOAT = 258,
+
+ VIRGL_FORMAT_R10G10B10X2_UNORM = 308,
+ VIRGL_FORMAT_A4B4G4R4_UNORM = 311,
+
+ VIRGL_FORMAT_R8_SRGB = 312,
+ VIRGL_FORMAT_R8G8_SRGB = 313,
+
+ VIRGL_FORMAT_P010 = 314,
+ VIRGL_FORMAT_P012 = 315,
+ VIRGL_FORMAT_P016 = 316,
+
+ VIRGL_FORMAT_MAX /* = PIPE_FORMAT_COUNT */,
+};
+
+struct virgl_caps_bool_set1 {
+ unsigned indep_blend_enable:1;
+ unsigned indep_blend_func:1;
+ unsigned cube_map_array:1;
+ unsigned shader_stencil_export:1;
+ unsigned conditional_render:1;
+ unsigned start_instance:1;
+ unsigned primitive_restart:1;
+ unsigned blend_eq_sep:1;
+ unsigned instanceid:1;
+ unsigned vertex_element_instance_divisor:1;
+ unsigned seamless_cube_map:1;
+ unsigned occlusion_query:1;
+ unsigned timer_query:1;
+ unsigned streamout_pause_resume:1;
+ unsigned texture_multisample:1;
+ unsigned fragment_coord_conventions:1;
+ unsigned depth_clip_disable:1;
+ unsigned seamless_cube_map_per_texture:1;
+ unsigned ubo:1;
+ unsigned color_clamping:1; /* not in GL 3.1 core profile */
+ unsigned poly_stipple:1; /* not in GL 3.1 core profile */
+ unsigned mirror_clamp:1;
+ unsigned texture_query_lod:1;
+ unsigned has_fp64:1;
+ unsigned has_tessellation_shaders:1;
+ unsigned has_indirect_draw:1;
+ unsigned has_sample_shading:1;
+ unsigned has_cull:1;
+};
+
+/* endless expansion capabilites - current gallium has 252 formats */
+struct virgl_supported_format_mask {
+ uint32_t bitmask[16];
+};
+/* capabilities set 2 - version 1 - 32-bit and float values */
+struct virgl_caps_v1 {
+ uint32_t max_version;
+ struct virgl_supported_format_mask sampler;
+ struct virgl_supported_format_mask render;
+ struct virgl_supported_format_mask depthstencil;
+ struct virgl_supported_format_mask vertexbuffer;
+ struct virgl_caps_bool_set1 bset;
+ uint32_t glsl_level;
+ uint32_t max_texture_array_layers;
+ uint32_t max_streamout_buffers;
+ uint32_t max_dual_source_render_targets;
+ uint32_t max_render_targets;
+ uint32_t max_samples;
+ uint32_t prim_mask;
+ uint32_t max_tbo_size;
+ uint32_t max_uniform_blocks;
+ uint32_t max_viewports;
+ uint32_t max_texture_gather_components;
+};
+
+/*
+ * This struct should be growable when used in capset 2,
+ * so we shouldn't have to add a v3 ever.
+ */
+struct virgl_caps_v2 {
+ struct virgl_caps_v1 v1;
+ float min_aliased_point_size;
+ float max_aliased_point_size;
+ float min_smooth_point_size;
+ float max_smooth_point_size;
+ float min_aliased_line_width;
+ float max_aliased_line_width;
+ float min_smooth_line_width;
+ float max_smooth_line_width;
+ float max_texture_lod_bias;
+ uint32_t max_geom_output_vertices;
+ uint32_t max_geom_total_output_components;
+ uint32_t max_vertex_outputs;
+ uint32_t max_vertex_attribs;
+ uint32_t max_shader_patch_varyings;
+ int32_t min_texel_offset;
+ int32_t max_texel_offset;
+ int32_t min_texture_gather_offset;
+ int32_t max_texture_gather_offset;
+ uint32_t texture_buffer_offset_alignment;
+ uint32_t uniform_buffer_offset_alignment;
+ uint32_t tgsi_invariant;
+ uint32_t shader_buffer_offset_alignment;
+};
+
+union virgl_caps {
+ uint32_t max_version;
+ struct virgl_caps_v1 v1;
+ struct virgl_caps_v2 v2;
+};
+
+enum virgl_errors {
+ VIRGL_ERROR_NONE,
+ VIRGL_ERROR_UNKNOWN,
+ VIRGL_ERROR_UNKNOWN_RESOURCE_FORMAT,
+};
+
+enum virgl_ctx_errors {
+ VIRGL_ERROR_CTX_NONE,
+ VIRGL_ERROR_CTX_UNKNOWN,
+ VIRGL_ERROR_CTX_ILLEGAL_SHADER,
+ VIRGL_ERROR_CTX_ILLEGAL_HANDLE,
+ VIRGL_ERROR_CTX_ILLEGAL_RESOURCE,
+ VIRGL_ERROR_CTX_ILLEGAL_SURFACE,
+ VIRGL_ERROR_CTX_ILLEGAL_VERTEX_FORMAT,
+ VIRGL_ERROR_CTX_ILLEGAL_CMD_BUFFER,
+};
+
+/* virgl bind flags - these are compatible with mesa 10.5 gallium.
+ * but are fixed, no other should be passed to virgl either.
+ */
+#define VIRGL_BIND_DEPTH_STENCIL (1 << 0)
+#define VIRGL_BIND_RENDER_TARGET (1 << 1)
+#define VIRGL_BIND_SAMPLER_VIEW (1 << 3)
+#define VIRGL_BIND_VERTEX_BUFFER (1 << 4)
+#define VIRGL_BIND_INDEX_BUFFER (1 << 5)
+#define VIRGL_BIND_CONSTANT_BUFFER (1 << 6)
+#define VIRGL_BIND_DISPLAY_TARGET (1 << 7)
+#define VIRGL_BIND_COMMAND_ARGS (1 << 8)
+#define VIRGL_BIND_STREAM_OUTPUT (1 << 11)
+#define VIRGL_BIND_SHADER_BUFFER (1 << 14)
+#define VIRGL_BIND_QUERY_BUFFER (1 << 15)
+#define VIRGL_BIND_CURSOR (1 << 16)
+#define VIRGL_BIND_CUSTOM (1 << 17)
+#define VIRGL_BIND_SCANOUT (1 << 18)
+/* Used for buffers that are backed by guest storage and
+ * are only read by the host.
+ */
+#define VIRGL_BIND_STAGING (1 << 19)
+#define VIRGL_BIND_SHARED (1 << 20)
+#define VIRGL_BIND_PREFER_EMULATED_BGRA (1 << 21)
+#define VIRGL_BIND_LINEAR (1 << 22)
+
+#define VIRGL_RESOURCE_Y_0_TOP (1 << 0)
+#endif
diff --git a/src/gfxstream/host/virtgpu_gfxstream_protocol.h b/src/gfxstream/host/virtgpu_gfxstream_protocol.h
new file mode 100644
index 00000000000..823f30020d5
--- /dev/null
+++ b/src/gfxstream/host/virtgpu_gfxstream_protocol.h
@@ -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.
+
+#ifndef VIRTGPU_GFXSTREAM_PROTOCOL_H
+#define VIRTGPU_GFXSTREAM_PROTOCOL_H
+
+#include <stdint.h>
+
+namespace gfxstream {
+
+// See definitions in rutabaga_gfx_ffi.h
+#define VIRTGPU_CAPSET_VIRGL 1
+#define VIRTGPU_CAPSET_VIRGL2 2
+#define VIRTGPU_CAPSET_GFXSTREAM_VULKAN 3
+#define VIRTGPU_CAPSET_VENUS 4
+#define VIRTGPU_CAPSET_CROSS_DOMAIN 5
+#define VIRTGPU_CAPSET_DRM 6
+#define VIRTGPU_CAPSET_GFXSTREAM_MAGMA 7
+#define VIRTGPU_CAPSET_GFXSTREAM_GLES 8
+#define VIRTGPU_CAPSET_GFXSTREAM_COMPOSER 9
+
+// Address Space Graphics contexts
+#define GFXSTREAM_CONTEXT_CREATE 0x1001
+#define GFXSTREAM_CONTEXT_PING 0x1002
+#define GFXSTREAM_CONTEXT_PING_WITH_RESPONSE 0x1003
+
+// Native Sync FD
+#define GFXSTREAM_CREATE_EXPORT_SYNC 0x9000
+#define GFXSTREAM_CREATE_IMPORT_SYNC 0x9001
+
+// Vulkan Sync
+#define GFXSTREAM_CREATE_EXPORT_SYNC_VK 0xa000
+#define GFXSTREAM_CREATE_IMPORT_SYNC_VK 0xa001
+#define GFXSTREAM_CREATE_QSRI_EXPORT_VK 0xa002
+
+// clang-format off
+// A placeholder command to ensure virtio-gpu completes
+#define GFXSTREAM_PLACEHOLDER_COMMAND_VK 0xf002
+// clang-format on
+
+struct gfxstreamHeader {
+ uint32_t opCode;
+};
+
+struct gfxstreamContextCreate {
+ struct gfxstreamHeader hdr;
+ uint32_t resourceId;
+};
+
+struct gfxstreamContextPing {
+ struct gfxstreamHeader hdr;
+ uint32_t resourceId;
+};
+
+struct gfxstreamCreateExportSync {
+ struct gfxstreamHeader hdr;
+ uint32_t syncHandleLo;
+ uint32_t syncHandleHi;
+};
+
+struct gfxstreamCreateExportSyncVK {
+ struct gfxstreamHeader hdr;
+ uint32_t deviceHandleLo;
+ uint32_t deviceHandleHi;
+ uint32_t fenceHandleLo;
+ uint32_t fenceHandleHi;
+};
+
+struct gfxstreamCreateQSRIExportVK {
+ struct gfxstreamHeader hdr;
+ uint32_t imageHandleLo;
+ uint32_t imageHandleHi;
+};
+
+struct gfxstreamPlaceholderCommandVk {
+ struct gfxstreamHeader hdr;
+ uint32_t pad;
+ uint32_t padding;
+};
+
+struct vulkanCapset {
+ uint32_t protocolVersion;
+
+ // ASG Ring Parameters
+ uint32_t ringSize;
+ uint32_t bufferSize;
+
+ uint32_t colorBufferMemoryIndex;
+ uint32_t deferredMapping;
+ uint32_t blobAlignment;
+ uint32_t noRenderControlEnc;
+ uint32_t padding[14];
+};
+
+struct magmaCapset {
+ uint32_t protocolVersion;
+ // ASG Ring Parameters
+ uint32_t ringSize;
+ uint32_t bufferSize;
+ uint32_t blobAlignment;
+};
+
+struct glesCapset {
+ uint32_t protocolVersion;
+ // ASG Ring Parameters
+ uint32_t ringSize;
+ uint32_t bufferSize;
+ uint32_t blobAlignment;
+};
+
+struct composerCapset {
+ uint32_t protocolVersion;
+ // ASG Ring Parameters
+ uint32_t ringSize;
+ uint32_t bufferSize;
+ uint32_t blobAlignment;
+};
+
+} // namespace gfxstream
+
+#endif
diff --git a/src/gfxstream/host/virtio-gpu-gfxstream-renderer-goldfish.cpp b/src/gfxstream/host/virtio-gpu-gfxstream-renderer-goldfish.cpp
new file mode 100644
index 00000000000..bda3615c4d8
--- /dev/null
+++ b/src/gfxstream/host/virtio-gpu-gfxstream-renderer-goldfish.cpp
@@ -0,0 +1,48 @@
+// Copyright 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 "gfxstream/virtio-gpu-gfxstream-renderer-goldfish.h"
+
+#include "host-common/opengles.h"
+
+VG_EXPORT int stream_renderer_snapshot_presave_pause() {
+ android_getOpenglesRenderer()->pauseAllPreSave();
+ return 0;
+}
+
+VG_EXPORT int stream_renderer_snapshot_postsave_resume() {
+ android_getOpenglesRenderer()->resumeAll();
+ return 0;
+}
+
+// In end2end tests, we don't really do snapshot save for render threads.
+// We will need to resume all render threads without waiting for snapshot.
+VG_EXPORT int stream_renderer_snapshot_postsave_resume_for_testing() {
+ android_getOpenglesRenderer()->resumeAll(false);
+ return 0;
+}
+
+VG_EXPORT int stream_renderer_snapshot_save(void* stream, void* textureSaver) {
+ android_getOpenglesRenderer()->save(
+ static_cast<android::base::Stream*>(stream),
+ *static_cast<const android::snapshot::ITextureSaverPtr*>(textureSaver));
+ return 0;
+}
+
+VG_EXPORT int stream_renderer_snapshot_load(void* stream, void* textureLoader) {
+ android_getOpenglesRenderer()->load(
+ static_cast<android::base::Stream*>(stream),
+ *static_cast<const android::snapshot::ITextureLoaderPtr*>(textureLoader));
+ return 0;
+}
diff --git a/src/gfxstream/host/virtio-gpu-gfxstream-renderer.cpp b/src/gfxstream/host/virtio-gpu-gfxstream-renderer.cpp
new file mode 100644
index 00000000000..2d8acd1ba6f
--- /dev/null
+++ b/src/gfxstream/host/virtio-gpu-gfxstream-renderer.cpp
@@ -0,0 +1,2509 @@
+// 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.
+#include <vulkan/vulkan.h>
+
+#include <cstdarg>
+#include <cstdio>
+#include <deque>
+#include <type_traits>
+#include <unordered_map>
+
+#include "BlobManager.h"
+#include "FrameBuffer.h"
+#include "GfxStreamAgents.h"
+#include "VirtioGpuTimelines.h"
+#include "VkCommonOperations.h"
+#include "aemu/base/AlignedBuf.h"
+#include "aemu/base/ManagedDescriptor.hpp"
+#include "aemu/base/Metrics.h"
+#include "aemu/base/Tracing.h"
+#include "aemu/base/memory/SharedMemory.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "host-common/AddressSpaceService.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/address_space_device.h"
+#include "host-common/android_pipe_common.h"
+#include "host-common/android_pipe_device.h"
+#include "host-common/feature_control.h"
+#include "host-common/globals.h"
+#include "host-common/opengles-pipe.h"
+#include "host-common/opengles.h"
+#include "host-common/refcount-pipe.h"
+#include "host-common/vm_operations.h"
+#include "virgl_hw.h"
+#include "virtgpu_gfxstream_protocol.h"
+#include "vk_util.h"
+
+extern "C" {
+#include "drm_fourcc.h"
+#include "gfxstream/virtio-gpu-gfxstream-renderer-unstable.h"
+#include "gfxstream/virtio-gpu-gfxstream-renderer.h"
+#include "host-common/goldfish_pipe.h"
+#include "virgl_hw.h"
+} // extern "C"
+
+#if defined(_WIN32)
+struct iovec {
+ void* iov_base; /* Starting address */
+ size_t iov_len; /* Length in bytes */
+};
+#else
+#include <unistd.h>
+#endif // _WIN32
+
+#define MAX_DEBUG_BUFFER_SIZE 512
+
+void* globalUserData = nullptr;
+stream_renderer_debug_callback globalDebugCallback = nullptr;
+
+void stream_renderer_debug(uint32_t type, const char* format, ...) {
+ char buf[MAX_DEBUG_BUFFER_SIZE];
+ va_list args;
+ va_start(args, format);
+ vsnprintf(buf, MAX_DEBUG_BUFFER_SIZE, format, args);
+ va_end(args);
+
+ if (globalUserData && globalDebugCallback) {
+ struct stream_renderer_debug debug = {0};
+ debug.debug_type = type;
+ debug.message = &buf[0];
+
+ globalDebugCallback(globalUserData, &debug);
+ } else {
+ fprintf(stderr, "%s\n", buf);
+ }
+}
+
+#if STREAM_RENDERER_LOG_LEVEL >= 1
+#define stream_renderer_error(format, ...) \
+ do { \
+ stream_renderer_debug(STREAM_RENDERER_DEBUG_ERROR, "[%s(%d)] %s " format, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); \
+ } while (0)
+#else
+#define stream_renderer_error(format, ...)
+#endif
+
+#if STREAM_RENDERER_LOG_LEVEL >= 3
+#define stream_renderer_info(format, ...) \
+ do { \
+ stream_renderer_debug(STREAM_RENDERER_DEBUG_INFO, "[%s(%d)] %s " format, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); \
+ } while (0)
+#else
+#define stream_renderer_info(format, ...)
+#endif
+
+// Virtio Goldfish Pipe: Overview-----------------------------------------------
+//
+// Virtio Goldfish Pipe is meant for running goldfish pipe services with a
+// stock Linux kernel that is already capable of virtio-gpu. It runs DRM
+// VIRTGPU ioctls on top of a custom implementation of virglrenderer on the
+// host side that doesn't (directly) do any rendering, but instead talks to
+// host-side pipe services.
+//
+// This is mainly used for graphics at the moment, though it's possible to run
+// other pipe services over virtio-gpu as well. virtio-gpu is selected over
+// other devices primarily because of the existence of an API (virglrenderer)
+// that is already somewhat separate from virtio-gpu, and not needing to create
+// a new virtio device to handle goldfish pipe.
+//
+// How it works is, existing virglrenderer API are remapped to perform pipe
+// operations. First of all, pipe operations consist of the following:
+//
+// - open() / close(): Starts or stops an instance of a pipe service.
+//
+// - write(const void* buf, size_t len) / read(const void* buf, size_t len):
+// Sends or receives data over the pipe. The first write() is the name of the
+// pipe service. After the pipe service is determined, the host calls
+// resetPipe() to replace the host-side pipe instance with an instance of the
+// pipe service.
+//
+// - reset(void* initialPipe, void* actualPipe): the operation that replaces an
+// initial pipe with an instance of a pipe service.
+//
+// Next, here's how the pipe operations map to virglrenderer commands:
+//
+// - open() -> virgl_renderer_context_create(),
+// virgl_renderer_resource_create(),
+// virgl_renderer_resource_attach_iov()
+//
+// The open() corresponds to a guest-side open of a rendernode, which triggers
+// context creation. Each pipe corresponds 1:1 with a drm virtgpu context id.
+// We also associate an R8 resource with each pipe as the backing data for
+// write/read.
+//
+// - close() -> virgl_rendrerer_resource_unref(),
+// virgl_renderer_context_destroy()
+//
+// The close() corresponds to undoing the operations of open().
+//
+// - write() -> virgl_renderer_transfer_write_iov() OR
+// virgl_renderer_submit_cmd()
+//
+// Pipe write() operation corresponds to performing a TRANSFER_TO_HOST ioctl on
+// the resource created alongside open(), OR an EXECBUFFER ioctl.
+//
+// - read() -> virgl_renderer_transfer_read_iov()
+//
+// Pipe read() operation corresponds to performing a TRANSFER_FROM_HOST ioctl on
+// the resource created alongside open().
+//
+// Details on transfer mechanism: mapping 2D transfer to 1D ones----------------
+//
+// Resource objects are typically 2D textures, while we're wanting to transmit
+// 1D buffers to the pipe services on the host. DRM VIRTGPU uses the concept
+// of a 'box' to represent transfers that do not involve an entire resource
+// object. Each box has a x, y, width and height parameter to define the
+// extent of the transfer for a 2D texture. In our use case, we only use the x
+// and width parameters. We've also created the resource with R8 format
+// (byte-by-byte) with width equal to the total size of the transfer buffer we
+// want (around 1 MB).
+//
+// The resource object itself is currently backed via plain guest RAM, which
+// can be physically not-contiguous from the guest POV, and therefore
+// corresponds to a possibly-long list of pointers and sizes (iov) on the host
+// side. The sync_iov helper function converts convert the list of pointers
+// to one contiguous buffer on the host (or vice versa), at the cost of a copy.
+// (TODO: see if we can use host coherent memory to do away with the copy).
+//
+// We can see this abstraction in use via the implementation of
+// transferWriteIov and transferReadIov below, which sync the iovec to/from a
+// linear buffer if necessary, and then perform a corresponding pip operation
+// based on the box parameter's x and width values.
+
+using android::AndroidPipe;
+using android::base::AutoLock;
+using android::base::DescriptorType;
+using android::base::Lock;
+using android::base::ManagedDescriptor;
+using android::base::MetricsLogger;
+using android::base::SharedMemory;
+
+using emugl::FatalError;
+using gfxstream::BlobManager;
+using gfxstream::ManagedDescriptorInfo;
+
+using VirtioGpuResId = uint32_t;
+
+static constexpr int kPipeTryAgain = -2;
+
+struct VirtioGpuCmd {
+ uint32_t op;
+ uint32_t cmdSize;
+ unsigned char buf[0];
+} __attribute__((packed));
+
+struct PipeCtxEntry {
+ std::string name;
+ uint32_t capsetId;
+ VirtioGpuCtxId ctxId;
+ GoldfishHostPipe* hostPipe;
+ int fence;
+ uint32_t addressSpaceHandle;
+ bool hasAddressSpaceHandle;
+ std::unordered_map<VirtioGpuResId, uint32_t> addressSpaceHandles;
+};
+
+enum class ResType {
+ // Used as a communication channel between the guest and the host
+ // which does not need an allocation on the host GPU.
+ PIPE,
+ // Used as a GPU data buffer.
+ BUFFER,
+ // Used as a GPU texture.
+ COLOR_BUFFER,
+};
+
+struct PipeResEntry {
+ stream_renderer_resource_create_args args;
+ iovec* iov;
+ uint32_t numIovs;
+ void* linear;
+ size_t linearSize;
+ GoldfishHostPipe* hostPipe;
+ VirtioGpuCtxId ctxId;
+ void* hva;
+ uint64_t hvaSize;
+ uint64_t blobId;
+ uint32_t blobMem;
+ uint32_t blobFlags;
+ uint32_t caching;
+ ResType type;
+ std::shared_ptr<SharedMemory> ringBlob = nullptr;
+ bool externalAddr = false;
+ std::shared_ptr<ManagedDescriptorInfo> descriptorInfo = nullptr;
+};
+
+static inline uint32_t align_up(uint32_t n, uint32_t a) { return ((n + a - 1) / a) * a; }
+
+static inline uint32_t align_up_power_of_2(uint32_t n, uint32_t a) {
+ return (n + (a - 1)) & ~(a - 1);
+}
+
+#define VIRGL_FORMAT_NV12 166
+#define VIRGL_FORMAT_YV12 163
+#define VIRGL_FORMAT_P010 314
+
+const uint32_t kGlBgra = 0x80e1;
+const uint32_t kGlRgba = 0x1908;
+const uint32_t kGlRgba16f = 0x881A;
+const uint32_t kGlRgb565 = 0x8d62;
+const uint32_t kGlRgba1010102 = 0x8059;
+const uint32_t kGlR8 = 0x8229;
+const uint32_t kGlR16 = 0x822A;
+const uint32_t kGlRg8 = 0x822b;
+const uint32_t kGlLuminance = 0x1909;
+const uint32_t kGlLuminanceAlpha = 0x190a;
+const uint32_t kGlUnsignedByte = 0x1401;
+const uint32_t kGlUnsignedShort565 = 0x8363;
+
+constexpr uint32_t kFwkFormatGlCompat = 0;
+constexpr uint32_t kFwkFormatYV12 = 1;
+// constexpr uint32_t kFwkFormatYUV420888 = 2;
+constexpr uint32_t kFwkFormatNV12 = 3;
+constexpr uint32_t kFwkFormatP010 = 4;
+
+static inline bool virgl_format_is_yuv(uint32_t format) {
+ switch (format) {
+ case VIRGL_FORMAT_B8G8R8X8_UNORM:
+ case VIRGL_FORMAT_B8G8R8A8_UNORM:
+ case VIRGL_FORMAT_R8G8B8X8_UNORM:
+ case VIRGL_FORMAT_R8G8B8A8_UNORM:
+ case VIRGL_FORMAT_B5G6R5_UNORM:
+ case VIRGL_FORMAT_R8_UNORM:
+ case VIRGL_FORMAT_R16_UNORM:
+ case VIRGL_FORMAT_R16G16B16A16_FLOAT:
+ case VIRGL_FORMAT_R8G8_UNORM:
+ case VIRGL_FORMAT_R10G10B10A2_UNORM:
+ return false;
+ case VIRGL_FORMAT_NV12:
+ case VIRGL_FORMAT_P010:
+ case VIRGL_FORMAT_YV12:
+ return true;
+ default:
+ stream_renderer_error("Unknown virgl format 0x%x", format);
+ return false;
+ }
+}
+
+static inline uint32_t virgl_format_to_gl(uint32_t virgl_format) {
+ switch (virgl_format) {
+ case VIRGL_FORMAT_B8G8R8X8_UNORM:
+ case VIRGL_FORMAT_B8G8R8A8_UNORM:
+ return kGlBgra;
+ case VIRGL_FORMAT_R8G8B8X8_UNORM:
+ case VIRGL_FORMAT_R8G8B8A8_UNORM:
+ return kGlRgba;
+ case VIRGL_FORMAT_B5G6R5_UNORM:
+ return kGlRgb565;
+ case VIRGL_FORMAT_R16_UNORM:
+ return kGlR16;
+ case VIRGL_FORMAT_R16G16B16A16_FLOAT:
+ return kGlRgba16f;
+ case VIRGL_FORMAT_R8_UNORM:
+ return kGlR8;
+ case VIRGL_FORMAT_R8G8_UNORM:
+ return kGlRg8;
+ case VIRGL_FORMAT_NV12:
+ case VIRGL_FORMAT_P010:
+ case VIRGL_FORMAT_YV12:
+ // emulated as RGBA8888
+ return kGlRgba;
+ case VIRGL_FORMAT_R10G10B10A2_UNORM:
+ return kGlRgba1010102;
+ default:
+ return kGlRgba;
+ }
+}
+
+static inline uint32_t virgl_format_to_fwk_format(uint32_t virgl_format) {
+ switch (virgl_format) {
+ case VIRGL_FORMAT_NV12:
+ return kFwkFormatNV12;
+ case VIRGL_FORMAT_P010:
+ return kFwkFormatP010;
+ case VIRGL_FORMAT_YV12:
+ return kFwkFormatYV12;
+ case VIRGL_FORMAT_R8_UNORM:
+ case VIRGL_FORMAT_R16_UNORM:
+ case VIRGL_FORMAT_R16G16B16A16_FLOAT:
+ case VIRGL_FORMAT_R8G8_UNORM:
+ case VIRGL_FORMAT_B8G8R8X8_UNORM:
+ case VIRGL_FORMAT_B8G8R8A8_UNORM:
+ case VIRGL_FORMAT_R8G8B8X8_UNORM:
+ case VIRGL_FORMAT_R8G8B8A8_UNORM:
+ case VIRGL_FORMAT_B5G6R5_UNORM:
+ case VIRGL_FORMAT_R10G10B10A2_UNORM:
+ default: // kFwkFormatGlCompat: No extra conversions needed
+ return kFwkFormatGlCompat;
+ }
+}
+
+static inline uint32_t gl_format_to_natural_type(uint32_t format) {
+ switch (format) {
+ case kGlBgra:
+ case kGlRgba:
+ case kGlLuminance:
+ case kGlLuminanceAlpha:
+ return kGlUnsignedByte;
+ case kGlRgb565:
+ return kGlUnsignedShort565;
+ default:
+ return kGlUnsignedByte;
+ }
+}
+
+static inline size_t virgl_format_to_linear_base(uint32_t format, uint32_t totalWidth,
+ uint32_t totalHeight, uint32_t x, uint32_t y,
+ uint32_t w, uint32_t h) {
+ if (virgl_format_is_yuv(format)) {
+ return 0;
+ } else {
+ uint32_t bpp = 4;
+ switch (format) {
+ case VIRGL_FORMAT_R16G16B16A16_FLOAT:
+ bpp = 8;
+ break;
+ case VIRGL_FORMAT_B8G8R8X8_UNORM:
+ case VIRGL_FORMAT_B8G8R8A8_UNORM:
+ case VIRGL_FORMAT_R8G8B8X8_UNORM:
+ case VIRGL_FORMAT_R8G8B8A8_UNORM:
+ case VIRGL_FORMAT_R10G10B10A2_UNORM:
+ bpp = 4;
+ break;
+ case VIRGL_FORMAT_B5G6R5_UNORM:
+ case VIRGL_FORMAT_R8G8_UNORM:
+ case VIRGL_FORMAT_R16_UNORM:
+ bpp = 2;
+ break;
+ case VIRGL_FORMAT_R8_UNORM:
+ bpp = 1;
+ break;
+ default:
+ stream_renderer_error("Unknown virgl format: 0x%x", format);
+ return 0;
+ }
+
+ uint32_t stride = totalWidth * bpp;
+ return y * stride + x * bpp;
+ }
+ return 0;
+}
+
+static inline size_t virgl_format_to_total_xfer_len(uint32_t format, uint32_t totalWidth,
+ uint32_t totalHeight, uint32_t x, uint32_t y,
+ uint32_t w, uint32_t h) {
+ if (virgl_format_is_yuv(format)) {
+ uint32_t bpp = format == VIRGL_FORMAT_P010 ? 2 : 1;
+
+ uint32_t yWidth = totalWidth;
+ uint32_t yHeight = totalHeight;
+ uint32_t yStridePixels;
+ if (format == VIRGL_FORMAT_NV12) {
+ yStridePixels = yWidth;
+ } else if (format == VIRGL_FORMAT_P010) {
+ yStridePixels = yWidth;
+ } else if (format == VIRGL_FORMAT_YV12) {
+ yStridePixels = align_up_power_of_2(yWidth, 32);
+ } else {
+ stream_renderer_error("Unknown virgl format: 0x%x", format);
+ return 0;
+ }
+ uint32_t yStrideBytes = yStridePixels * bpp;
+ uint32_t ySize = yStrideBytes * yHeight;
+
+ uint32_t uvStridePixels;
+ uint32_t uvPlaneCount;
+ if (format == VIRGL_FORMAT_NV12) {
+ uvStridePixels = yStridePixels;
+ uvPlaneCount = 1;
+ } else if (format == VIRGL_FORMAT_P010) {
+ uvStridePixels = yStridePixels;
+ uvPlaneCount = 1;
+ } else if (format == VIRGL_FORMAT_YV12) {
+ uvStridePixels = yStridePixels / 2;
+ uvPlaneCount = 2;
+ } else {
+ stream_renderer_error("Unknown virgl yuv format: 0x%x", format);
+ return 0;
+ }
+ uint32_t uvStrideBytes = uvStridePixels * bpp;
+ uint32_t uvHeight = totalHeight / 2;
+ uint32_t uvSize = uvStrideBytes * uvHeight * uvPlaneCount;
+
+ uint32_t dataSize = ySize + uvSize;
+ return dataSize;
+ } else {
+ uint32_t bpp = 4;
+ switch (format) {
+ case VIRGL_FORMAT_R16G16B16A16_FLOAT:
+ bpp = 8;
+ break;
+ case VIRGL_FORMAT_B8G8R8X8_UNORM:
+ case VIRGL_FORMAT_B8G8R8A8_UNORM:
+ case VIRGL_FORMAT_R8G8B8X8_UNORM:
+ case VIRGL_FORMAT_R8G8B8A8_UNORM:
+ case VIRGL_FORMAT_R10G10B10A2_UNORM:
+ bpp = 4;
+ break;
+ case VIRGL_FORMAT_B5G6R5_UNORM:
+ case VIRGL_FORMAT_R16_UNORM:
+ case VIRGL_FORMAT_R8G8_UNORM:
+ bpp = 2;
+ break;
+ case VIRGL_FORMAT_R8_UNORM:
+ bpp = 1;
+ break;
+ default:
+ stream_renderer_error("Unknown virgl format: 0x%x", format);
+ return 0;
+ }
+
+ uint32_t stride = totalWidth * bpp;
+ return (h - 1U) * stride + w * bpp;
+ }
+ return 0;
+}
+
+enum IovSyncDir {
+ IOV_TO_LINEAR = 0,
+ LINEAR_TO_IOV = 1,
+};
+
+static int sync_iov(PipeResEntry* res, uint64_t offset, const stream_renderer_box* box,
+ IovSyncDir dir) {
+ stream_renderer_info("offset: 0x%llx box: %u %u %u %u size %u x %u iovs %u linearSize %zu",
+ (unsigned long long)offset, box->x, box->y, box->w, box->h,
+ res->args.width, res->args.height, res->numIovs, res->linearSize);
+
+ if (box->x > res->args.width || box->y > res->args.height) {
+ stream_renderer_error("Box out of range of resource");
+ return -EINVAL;
+ }
+ if (box->w == 0U || box->h == 0U) {
+ stream_renderer_error("Empty transfer");
+ return -EINVAL;
+ }
+ if (box->x + box->w > res->args.width) {
+ stream_renderer_error("Box overflows resource width");
+ return -EINVAL;
+ }
+
+ size_t linearBase = virgl_format_to_linear_base(
+ res->args.format, res->args.width, res->args.height, box->x, box->y, box->w, box->h);
+ size_t start = linearBase;
+ // height - 1 in order to treat the (w * bpp) row specially
+ // (i.e., the last row does not occupy the full stride)
+ size_t length = virgl_format_to_total_xfer_len(
+ res->args.format, res->args.width, res->args.height, box->x, box->y, box->w, box->h);
+ size_t end = start + length;
+
+ if (start == end) {
+ stream_renderer_error("nothing to transfer");
+ return -EINVAL;
+ }
+
+ if (end > res->linearSize) {
+ stream_renderer_error("start + length overflows!");
+ return -EINVAL;
+ }
+
+ uint32_t iovIndex = 0;
+ size_t iovOffset = 0;
+ size_t written = 0;
+ char* linear = static_cast<char*>(res->linear);
+
+ while (written < length) {
+ if (iovIndex >= res->numIovs) {
+ stream_renderer_error("write request overflowed numIovs");
+ return -EINVAL;
+ }
+
+ const char* iovBase_const = static_cast<const char*>(res->iov[iovIndex].iov_base);
+ char* iovBase = static_cast<char*>(res->iov[iovIndex].iov_base);
+ size_t iovLen = res->iov[iovIndex].iov_len;
+ size_t iovOffsetEnd = iovOffset + iovLen;
+
+ auto lower_intersect = std::max(iovOffset, start);
+ auto upper_intersect = std::min(iovOffsetEnd, end);
+ if (lower_intersect < upper_intersect) {
+ size_t toWrite = upper_intersect - lower_intersect;
+ switch (dir) {
+ case IOV_TO_LINEAR:
+ memcpy(linear + lower_intersect, iovBase_const + lower_intersect - iovOffset,
+ toWrite);
+ break;
+ case LINEAR_TO_IOV:
+ memcpy(iovBase + lower_intersect - iovOffset, linear + lower_intersect,
+ toWrite);
+ break;
+ default:
+ stream_renderer_error("Invalid synchronization dir");
+ return -EINVAL;
+ }
+ written += toWrite;
+ }
+ ++iovIndex;
+ iovOffset += iovLen;
+ }
+
+ return 0;
+}
+
+static uint64_t convert32to64(uint32_t lo, uint32_t hi) {
+ return ((uint64_t)lo) | (((uint64_t)hi) << 32);
+}
+
+class PipeVirglRenderer {
+ public:
+ PipeVirglRenderer() = default;
+
+ int init(void* cookie, int flags, stream_renderer_fence_callback fence_callback) {
+ stream_renderer_info("cookie: %p", cookie);
+ mCookie = cookie;
+ mFenceCallback = fence_callback;
+ mVirtioGpuOps = android_getVirtioGpuOps();
+ if (!mVirtioGpuOps) {
+ stream_renderer_error("Could not get virtio gpu ops!");
+ return -EINVAL;
+ }
+ mAddressSpaceDeviceControlOps = get_address_space_device_control_ops();
+ if (!mAddressSpaceDeviceControlOps) {
+ stream_renderer_error("Could not get address space device control ops!");
+ return -EINVAL;
+ }
+ mVirtioGpuTimelines = VirtioGpuTimelines::create(true);
+ mVirtioGpuTimelines = VirtioGpuTimelines::create(true);
+
+#if !defined(_WIN32)
+ mPageSize = getpagesize();
+#endif
+
+ return 0;
+ }
+
+ int resetPipe(GoldfishHwPipe* hwPipe, GoldfishHostPipe* hostPipe) {
+ stream_renderer_info("Want to reset hwpipe %p to hostpipe %p", hwPipe, hostPipe);
+ VirtioGpuCtxId asCtxId = (VirtioGpuCtxId)(uintptr_t)hwPipe;
+ auto it = mContexts.find(asCtxId);
+ if (it == mContexts.end()) {
+ stream_renderer_error("fatal: pipe id %u", asCtxId);
+ return -EINVAL;
+ }
+
+ auto& entry = it->second;
+ stream_renderer_info("ctxid: %u prev hostpipe: %p", asCtxId, entry.hostPipe);
+ entry.hostPipe = hostPipe;
+ stream_renderer_info("ctxid: %u next hostpipe: %p", asCtxId, entry.hostPipe);
+
+ // Also update any resources associated with it
+ auto resourcesIt = mContextResources.find(asCtxId);
+
+ if (resourcesIt == mContextResources.end()) {
+ return 0;
+ }
+
+ const auto& resIds = resourcesIt->second;
+
+ for (auto resId : resIds) {
+ auto resEntryIt = mResources.find(resId);
+ if (resEntryIt == mResources.end()) {
+ stream_renderer_error("entry with res id %u not found", resId);
+ return -EINVAL;
+ }
+
+ auto& resEntry = resEntryIt->second;
+ resEntry.hostPipe = hostPipe;
+ }
+
+ return 0;
+ }
+
+ int createContext(VirtioGpuCtxId ctx_id, uint32_t nlen, const char* name,
+ uint32_t context_init) {
+ std::string contextName(name, nlen);
+
+ stream_renderer_info("ctxid: %u len: %u name: %s", ctx_id, nlen, contextName.c_str());
+ auto ops = ensureAndGetServiceOps();
+ auto hostPipe = ops->guest_open_with_flags(reinterpret_cast<GoldfishHwPipe*>(ctx_id),
+ 0x1 /* is virtio */);
+
+ if (!hostPipe) {
+ stream_renderer_error("failed to create hw pipe!\n");
+ return -EINVAL;
+ }
+ std::unordered_map<uint32_t, uint32_t> map;
+
+ PipeCtxEntry res = {
+ std::move(contextName), // contextName
+ context_init, // capsetId
+ ctx_id, // ctxId
+ hostPipe, // hostPipe
+ 0, // fence
+ 0, // AS handle
+ false, // does not have an AS handle
+ map, // resourceId --> ASG handle map
+ };
+
+ stream_renderer_info("initial host pipe for ctxid %u: %p", ctx_id, hostPipe);
+ mContexts[ctx_id] = res;
+ android_onGuestGraphicsProcessCreate(ctx_id);
+ return 0;
+ }
+
+ int destroyContext(VirtioGpuCtxId handle) {
+ stream_renderer_info("ctxid: %u", handle);
+
+ auto it = mContexts.find(handle);
+ if (it == mContexts.end()) {
+ stream_renderer_error("could not find context handle %u\n", handle);
+ return -EINVAL;
+ }
+
+ if (it->second.hasAddressSpaceHandle) {
+ for (auto const& [resourceId, handle] : it->second.addressSpaceHandles) {
+ mAddressSpaceDeviceControlOps->destroy_handle(handle);
+ }
+ }
+
+ auto hostPipe = it->second.hostPipe;
+ if (!hostPipe) {
+ stream_renderer_error("0 is not a valid hostpipe");
+ return -EINVAL;
+ }
+
+ auto ops = ensureAndGetServiceOps();
+ ops->guest_close(hostPipe, GOLDFISH_PIPE_CLOSE_GRACEFUL);
+
+ android_cleanupProcGLObjects(handle);
+ mContexts.erase(it);
+ return 0;
+ }
+
+ int setContextAddressSpaceHandleLocked(VirtioGpuCtxId ctxId, uint32_t handle,
+ uint32_t resourceId) {
+ auto ctxIt = mContexts.find(ctxId);
+ if (ctxIt == mContexts.end()) {
+ stream_renderer_error("ctx id %u is not found", ctxId);
+ return -EINVAL;
+ }
+
+ auto& ctxEntry = ctxIt->second;
+ ctxEntry.addressSpaceHandle = handle;
+ ctxEntry.hasAddressSpaceHandle = true;
+ ctxEntry.addressSpaceHandles[resourceId] = handle;
+ return 0;
+ }
+
+ uint32_t getAddressSpaceHandleLocked(VirtioGpuCtxId ctxId, uint32_t resourceId) {
+ auto ctxIt = mContexts.find(ctxId);
+ if (ctxIt == mContexts.end()) {
+ stream_renderer_error("ctx id %u is not found", ctxId);
+ return -EINVAL;
+ }
+
+ auto& ctxEntry = ctxIt->second;
+
+ if (!ctxEntry.addressSpaceHandles.count(resourceId)) {
+ stream_renderer_error("ASG context with resource id %u", resourceId);
+ return -EINVAL;
+ }
+
+ return ctxEntry.addressSpaceHandles[resourceId];
+ }
+
+#define DECODE(variable, type, input) \
+ type variable = {}; \
+ memcpy(&variable, input, sizeof(type));
+
+ int addressSpaceProcessCmd(VirtioGpuCtxId ctxId, uint32_t* dwords) {
+ DECODE(header, gfxstream::gfxstreamHeader, dwords)
+
+ switch (header.opCode) {
+ case GFXSTREAM_CONTEXT_CREATE: {
+ DECODE(contextCreate, gfxstream::gfxstreamContextCreate, dwords)
+
+ auto resEntryIt = mResources.find(contextCreate.resourceId);
+ if (resEntryIt == mResources.end()) {
+ stream_renderer_error("ASG coherent resource %u not found",
+ contextCreate.resourceId);
+ return -EINVAL;
+ }
+
+ auto ctxIt = mContexts.find(ctxId);
+ if (ctxIt == mContexts.end()) {
+ stream_renderer_error("ctx id %u not found", ctxId);
+ return -EINVAL;
+ }
+
+ auto& ctxEntry = ctxIt->second;
+ auto& resEntry = resEntryIt->second;
+
+ std::string name = ctxEntry.name + "-" + std::to_string(contextCreate.resourceId);
+ uint32_t handle = mAddressSpaceDeviceControlOps->gen_handle();
+
+ struct AddressSpaceCreateInfo createInfo = {
+ .handle = handle,
+ .type = android::emulation::VirtioGpuGraphics,
+ .createRenderThread = true,
+ .externalAddr = resEntry.hva,
+ .externalAddrSize = resEntry.hvaSize,
+ .virtioGpuContextId = ctxId,
+ .virtioGpuCapsetId = ctxEntry.capsetId,
+ .contextName = name.c_str(),
+ .contextNameSize = static_cast<uint32_t>(ctxEntry.name.size()),
+ };
+
+ mAddressSpaceDeviceControlOps->create_instance(createInfo);
+ if (setContextAddressSpaceHandleLocked(ctxId, handle, contextCreate.resourceId)) {
+ return -EINVAL;
+ }
+ break;
+ }
+ case GFXSTREAM_CONTEXT_PING: {
+ DECODE(contextPing, gfxstream::gfxstreamContextPing, dwords)
+
+ struct android::emulation::AddressSpaceDevicePingInfo ping = {0};
+ ping.metadata = ASG_NOTIFY_AVAILABLE;
+
+ mAddressSpaceDeviceControlOps->ping_at_hva(
+ getAddressSpaceHandleLocked(ctxId, contextPing.resourceId), &ping);
+ break;
+ }
+ default:
+ break;
+ }
+
+ return 0;
+ }
+
+ int submitCmd(struct stream_renderer_command* cmd) {
+ if (!cmd) return -EINVAL;
+
+ void* buffer = reinterpret_cast<void*>(cmd->cmd);
+
+ VirtioGpuRing ring = VirtioGpuRingGlobal{};
+ stream_renderer_info("ctx: % u, ring: %s buffer: %p dwords: %d", cmd->ctx_id,
+ to_string(ring).c_str(), buffer, cmd->cmd_size);
+
+ if (!buffer) {
+ stream_renderer_error("error: buffer null\n");
+ return -EINVAL;
+ }
+
+ if (cmd->cmd_size < 4) {
+ stream_renderer_error("error: not enough bytes (got %d)\n", cmd->cmd_size);
+ return -EINVAL;
+ }
+
+ DECODE(header, gfxstream::gfxstreamHeader, buffer);
+ switch (header.opCode) {
+ case GFXSTREAM_CONTEXT_CREATE:
+ case GFXSTREAM_CONTEXT_PING:
+ case GFXSTREAM_CONTEXT_PING_WITH_RESPONSE:
+ if (addressSpaceProcessCmd(cmd->ctx_id, (uint32_t*)buffer)) {
+ return -EINVAL;
+ }
+ break;
+ case GFXSTREAM_CREATE_EXPORT_SYNC: {
+ DECODE(exportSync, gfxstream::gfxstreamCreateExportSync, buffer)
+
+ uint64_t sync_handle =
+ convert32to64(exportSync.syncHandleLo, exportSync.syncHandleHi);
+
+ stream_renderer_info("wait for gpu ring %s", to_string(ring).c_str());
+ auto taskId = mVirtioGpuTimelines->enqueueTask(ring);
+ mVirtioGpuOps->async_wait_for_gpu_with_cb(sync_handle, [this, taskId] {
+ mVirtioGpuTimelines->notifyTaskCompletion(taskId);
+ });
+ break;
+ }
+ case GFXSTREAM_CREATE_EXPORT_SYNC_VK:
+ case GFXSTREAM_CREATE_IMPORT_SYNC_VK: {
+ // The guest sync export assumes fence context support and always uses
+ // VIRTGPU_EXECBUF_RING_IDX. With this, the task created here must use
+ // the same ring as the fence created for the virtio gpu command or the
+ // fence may be signaled without properly waiting for the task to complete.
+ ring = VirtioGpuRingContextSpecific{
+ .mCtxId = cmd->ctx_id,
+ .mRingIdx = 0,
+ };
+
+ DECODE(exportSyncVK, gfxstream::gfxstreamCreateExportSyncVK, buffer)
+
+ uint64_t device_handle =
+ convert32to64(exportSyncVK.deviceHandleLo, exportSyncVK.deviceHandleHi);
+
+ uint64_t fence_handle =
+ convert32to64(exportSyncVK.fenceHandleLo, exportSyncVK.fenceHandleHi);
+
+ stream_renderer_info("wait for gpu ring %s", to_string(ring).c_str());
+ auto taskId = mVirtioGpuTimelines->enqueueTask(ring);
+ mVirtioGpuOps->async_wait_for_gpu_vulkan_with_cb(
+ device_handle, fence_handle,
+ [this, taskId] { mVirtioGpuTimelines->notifyTaskCompletion(taskId); });
+ break;
+ }
+ case GFXSTREAM_CREATE_QSRI_EXPORT_VK: {
+ // The guest QSRI export assumes fence context support and always uses
+ // VIRTGPU_EXECBUF_RING_IDX. With this, the task created here must use
+ // the same ring as the fence created for the virtio gpu command or the
+ // fence may be signaled without properly waiting for the task to complete.
+ ring = VirtioGpuRingContextSpecific{
+ .mCtxId = cmd->ctx_id,
+ .mRingIdx = 0,
+ };
+
+ DECODE(exportQSRI, gfxstream::gfxstreamCreateQSRIExportVK, buffer)
+
+ uint64_t image_handle =
+ convert32to64(exportQSRI.imageHandleLo, exportQSRI.imageHandleHi);
+
+ stream_renderer_info("wait for gpu vk qsri ring %u image 0x%llx",
+ to_string(ring).c_str(), (unsigned long long)image_handle);
+ auto taskId = mVirtioGpuTimelines->enqueueTask(ring);
+ mVirtioGpuOps->async_wait_for_gpu_vulkan_qsri_with_cb(image_handle, [this, taskId] {
+ mVirtioGpuTimelines->notifyTaskCompletion(taskId);
+ });
+ break;
+ }
+ case GFXSTREAM_PLACEHOLDER_COMMAND_VK: {
+ // Do nothing, this is a placeholder command
+ break;
+ }
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+ }
+
+ int createFence(uint64_t fence_id, const VirtioGpuRing& ring) {
+ stream_renderer_info("fenceid: %llu ring: %s", (unsigned long long)fence_id,
+ to_string(ring).c_str());
+
+ struct {
+ FenceCompletionCallback operator()(const VirtioGpuRingGlobal&) {
+ return [renderer = mRenderer, fenceId = mFenceId] {
+ struct stream_renderer_fence fence = {0};
+ fence.fence_id = fenceId;
+ fence.flags = STREAM_RENDERER_FLAG_FENCE;
+ renderer->mFenceCallback(renderer->mCookie, &fence);
+ };
+ }
+ FenceCompletionCallback operator()(const VirtioGpuRingContextSpecific& ring) {
+ return [renderer = mRenderer, fenceId = mFenceId, ring] {
+ struct stream_renderer_fence fence = {0};
+ fence.fence_id = fenceId;
+ fence.flags = STREAM_RENDERER_FLAG_FENCE | STREAM_RENDERER_FLAG_FENCE_RING_IDX;
+ fence.ctx_id = ring.mCtxId;
+ fence.ring_idx = ring.mRingIdx;
+ renderer->mFenceCallback(renderer->mCookie, &fence);
+ };
+ }
+
+ PipeVirglRenderer* mRenderer;
+ VirtioGpuTimelines::FenceId mFenceId;
+ } visitor{
+ .mRenderer = this,
+ .mFenceId = fence_id,
+ };
+ FenceCompletionCallback callback = std::visit(visitor, ring);
+ if (!callback) {
+ return -EINVAL;
+ }
+ mVirtioGpuTimelines->enqueueFence(ring, fence_id, std::move(callback));
+
+ return 0;
+ }
+
+ void poll() { mVirtioGpuTimelines->poll(); }
+
+ enum pipe_texture_target {
+ PIPE_BUFFER,
+ PIPE_TEXTURE_1D,
+ PIPE_TEXTURE_2D,
+ PIPE_TEXTURE_3D,
+ PIPE_TEXTURE_CUBE,
+ PIPE_TEXTURE_RECT,
+ PIPE_TEXTURE_1D_ARRAY,
+ PIPE_TEXTURE_2D_ARRAY,
+ PIPE_TEXTURE_CUBE_ARRAY,
+ PIPE_MAX_TEXTURE_TYPES,
+ };
+
+ /**
+ * * Resource binding flags -- state tracker must specify in advance all
+ * * the ways a resource might be used.
+ * */
+#define PIPE_BIND_DEPTH_STENCIL (1 << 0) /* create_surface */
+#define PIPE_BIND_RENDER_TARGET (1 << 1) /* create_surface */
+#define PIPE_BIND_BLENDABLE (1 << 2) /* create_surface */
+#define PIPE_BIND_SAMPLER_VIEW (1 << 3) /* create_sampler_view */
+#define PIPE_BIND_VERTEX_BUFFER (1 << 4) /* set_vertex_buffers */
+#define PIPE_BIND_INDEX_BUFFER (1 << 5) /* draw_elements */
+#define PIPE_BIND_CONSTANT_BUFFER (1 << 6) /* set_constant_buffer */
+#define PIPE_BIND_DISPLAY_TARGET (1 << 7) /* flush_front_buffer */
+ /* gap */
+#define PIPE_BIND_STREAM_OUTPUT (1 << 10) /* set_stream_output_buffers */
+#define PIPE_BIND_CURSOR (1 << 11) /* mouse cursor */
+#define PIPE_BIND_CUSTOM (1 << 12) /* state-tracker/winsys usages */
+#define PIPE_BIND_GLOBAL (1 << 13) /* set_global_binding */
+#define PIPE_BIND_SHADER_BUFFER (1 << 14) /* set_shader_buffers */
+#define PIPE_BIND_SHADER_IMAGE (1 << 15) /* set_shader_images */
+#define PIPE_BIND_COMPUTE_RESOURCE (1 << 16) /* set_compute_resources */
+#define PIPE_BIND_COMMAND_ARGS_BUFFER (1 << 17) /* pipe_draw_info.indirect */
+#define PIPE_BIND_QUERY_BUFFER (1 << 18) /* get_query_result_resource */
+
+ ResType getResourceType(const struct stream_renderer_resource_create_args& args) const {
+ if (args.target == PIPE_BUFFER) {
+ return ResType::PIPE;
+ }
+
+ if (args.format != VIRGL_FORMAT_R8_UNORM) {
+ return ResType::COLOR_BUFFER;
+ }
+ if (args.bind & VIRGL_BIND_SAMPLER_VIEW) {
+ return ResType::COLOR_BUFFER;
+ }
+ if (args.bind & VIRGL_BIND_RENDER_TARGET) {
+ return ResType::COLOR_BUFFER;
+ }
+ if (args.bind & VIRGL_BIND_SCANOUT) {
+ return ResType::COLOR_BUFFER;
+ }
+ if (args.bind & VIRGL_BIND_CURSOR) {
+ return ResType::COLOR_BUFFER;
+ }
+ if (!(args.bind & VIRGL_BIND_LINEAR)) {
+ return ResType::COLOR_BUFFER;
+ }
+
+ return ResType::BUFFER;
+ }
+
+ void handleCreateResourceBuffer(struct stream_renderer_resource_create_args* args) {
+ mVirtioGpuOps->create_buffer_with_handle(args->width * args->height, args->handle);
+ }
+
+ void handleCreateResourceColorBuffer(struct stream_renderer_resource_create_args* args) {
+ // corresponds to allocation of gralloc buffer in minigbm
+ stream_renderer_info("w h %u %u resid %u -> CreateColorBufferWithHandle", args->width,
+ args->height, args->handle);
+
+ const uint32_t glformat = virgl_format_to_gl(args->format);
+ const uint32_t fwkformat = virgl_format_to_fwk_format(args->format);
+ mVirtioGpuOps->create_color_buffer_with_handle(args->width, args->height, glformat,
+ fwkformat, args->handle);
+ mVirtioGpuOps->set_guest_managed_color_buffer_lifetime(true /* guest manages lifetime */);
+ mVirtioGpuOps->open_color_buffer(args->handle);
+ }
+
+ int createResource(struct stream_renderer_resource_create_args* args, struct iovec* iov,
+ uint32_t num_iovs) {
+ stream_renderer_info("handle: %u. num iovs: %u", args->handle, num_iovs);
+
+ const auto resType = getResourceType(*args);
+ switch (resType) {
+ case ResType::PIPE:
+ break;
+ case ResType::BUFFER:
+ handleCreateResourceBuffer(args);
+ break;
+ case ResType::COLOR_BUFFER:
+ handleCreateResourceColorBuffer(args);
+ break;
+ }
+
+ PipeResEntry e;
+ e.args = *args;
+ e.linear = 0;
+ e.hostPipe = 0;
+ e.hva = nullptr;
+ e.hvaSize = 0;
+ e.blobId = 0;
+ e.blobMem = 0;
+ e.type = resType;
+ allocResource(e, iov, num_iovs);
+
+ mResources[args->handle] = e;
+ return 0;
+ }
+
+ void unrefResource(uint32_t toUnrefId) {
+ stream_renderer_info("handle: %u", toUnrefId);
+
+ auto it = mResources.find(toUnrefId);
+ if (it == mResources.end()) return;
+
+ auto contextsIt = mResourceContexts.find(toUnrefId);
+ if (contextsIt != mResourceContexts.end()) {
+ mResourceContexts.erase(contextsIt->first);
+ }
+
+ for (auto& ctxIdResources : mContextResources) {
+ detachResourceLocked(ctxIdResources.first, toUnrefId);
+ }
+
+ auto& entry = it->second;
+ switch (entry.type) {
+ case ResType::PIPE:
+ break;
+ case ResType::BUFFER:
+ mVirtioGpuOps->close_buffer(toUnrefId);
+ break;
+ case ResType::COLOR_BUFFER:
+ mVirtioGpuOps->close_color_buffer(toUnrefId);
+ break;
+ }
+
+ if (entry.linear) {
+ free(entry.linear);
+ entry.linear = nullptr;
+ }
+
+ if (entry.iov) {
+ free(entry.iov);
+ entry.iov = nullptr;
+ entry.numIovs = 0;
+ }
+
+ if (entry.externalAddr && !entry.ringBlob) {
+ android::aligned_buf_free(entry.hva);
+ }
+
+ entry.hva = nullptr;
+ entry.hvaSize = 0;
+ entry.blobId = 0;
+
+ mResources.erase(it);
+ }
+
+ int attachIov(int resId, iovec* iov, int num_iovs) {
+ stream_renderer_info("resid: %d numiovs: %d", resId, num_iovs);
+
+ auto it = mResources.find(resId);
+ if (it == mResources.end()) return ENOENT;
+
+ auto& entry = it->second;
+ stream_renderer_info("res linear: %p", entry.linear);
+ if (!entry.linear) allocResource(entry, iov, num_iovs);
+
+ stream_renderer_info("done");
+ return 0;
+ }
+
+ void detachIov(int resId, iovec** iov, int* num_iovs) {
+ auto it = mResources.find(resId);
+ if (it == mResources.end()) return;
+
+ auto& entry = it->second;
+
+ if (num_iovs) {
+ *num_iovs = entry.numIovs;
+ stream_renderer_info("resid: %d numIovs: %d", resId, *num_iovs);
+ } else {
+ stream_renderer_info("resid: %d numIovs: 0", resId);
+ }
+
+ entry.numIovs = 0;
+
+ if (entry.iov) free(entry.iov);
+ entry.iov = nullptr;
+
+ if (iov) {
+ *iov = entry.iov;
+ }
+
+ allocResource(entry, entry.iov, entry.numIovs);
+ stream_renderer_info("done");
+ }
+
+ int handleTransferReadPipe(PipeResEntry* res, uint64_t offset, stream_renderer_box* box) {
+ if (res->type != ResType::PIPE) {
+ stream_renderer_error("resid: %d not a PIPE resource", res->args.handle);
+ return -EINVAL;
+ }
+
+ // Do the pipe service op here, if there is an associated hostpipe.
+ auto hostPipe = res->hostPipe;
+ if (!hostPipe) return -EINVAL;
+
+ auto ops = ensureAndGetServiceOps();
+
+ size_t readBytes = 0;
+ size_t wantedBytes = readBytes + (size_t)box->w;
+
+ while (readBytes < wantedBytes) {
+ GoldfishPipeBuffer buf = {
+ ((char*)res->linear) + box->x + readBytes,
+ wantedBytes - readBytes,
+ };
+ auto status = ops->guest_recv(hostPipe, &buf, 1);
+
+ if (status > 0) {
+ readBytes += status;
+ } else if (status == kPipeTryAgain) {
+ ops->wait_guest_recv(hostPipe);
+ } else {
+ return EIO;
+ }
+ }
+
+ return 0;
+ }
+
+ int handleTransferWritePipe(PipeResEntry* res, uint64_t offset, stream_renderer_box* box) {
+ if (res->type != ResType::PIPE) {
+ stream_renderer_error("resid: %d not a PIPE resource", res->args.handle);
+ return -EINVAL;
+ }
+
+ // Do the pipe service op here, if there is an associated hostpipe.
+ auto hostPipe = res->hostPipe;
+ if (!hostPipe) {
+ stream_renderer_info("No hostPipe");
+ return -EINVAL;
+ }
+
+ stream_renderer_info("resid: %d offset: 0x%llx hostpipe: %p", res->args.handle,
+ (unsigned long long)offset, hostPipe);
+
+ auto ops = ensureAndGetServiceOps();
+
+ size_t writtenBytes = 0;
+ size_t wantedBytes = (size_t)box->w;
+
+ while (writtenBytes < wantedBytes) {
+ GoldfishPipeBuffer buf = {
+ ((char*)res->linear) + box->x + writtenBytes,
+ wantedBytes - writtenBytes,
+ };
+
+ // guest_send can now reallocate the pipe.
+ void* hostPipeBefore = hostPipe;
+ auto status = ops->guest_send(&hostPipe, &buf, 1);
+ if (hostPipe != hostPipeBefore) {
+ if (resetPipe((GoldfishHwPipe*)(uintptr_t)(res->ctxId), hostPipe)) {
+ return -EINVAL;
+ }
+
+ auto it = mResources.find(res->args.handle);
+ res = &it->second;
+ }
+
+ if (status > 0) {
+ writtenBytes += status;
+ } else if (status == kPipeTryAgain) {
+ ops->wait_guest_send(hostPipe);
+ } else {
+ return EIO;
+ }
+ }
+
+ return 0;
+ }
+
+ int handleTransferReadBuffer(PipeResEntry* res, uint64_t offset, stream_renderer_box* box) {
+ if (res->type != ResType::BUFFER) {
+ stream_renderer_error("resid: %d not a BUFFER resource", res->args.handle);
+ return -EINVAL;
+ }
+
+ mVirtioGpuOps->read_buffer(res->args.handle, 0, res->args.width * res->args.height,
+ res->linear);
+ return 0;
+ }
+
+ int handleTransferWriteBuffer(PipeResEntry* res, uint64_t offset, stream_renderer_box* box) {
+ if (res->type != ResType::BUFFER) {
+ stream_renderer_error("resid: %d not a BUFFER resource", res->args.handle);
+ return -EINVAL;
+ }
+
+ mVirtioGpuOps->update_buffer(res->args.handle, 0, res->args.width * res->args.height,
+ res->linear);
+ return 0;
+ }
+
+ int handleTransferReadColorBuffer(PipeResEntry* res, uint64_t offset,
+ stream_renderer_box* box) {
+ if (res->type != ResType::COLOR_BUFFER) {
+ stream_renderer_error("resid: %d not a COLOR_BUFFER resource", res->args.handle);
+ return -EINVAL;
+ }
+
+ auto glformat = virgl_format_to_gl(res->args.format);
+ auto gltype = gl_format_to_natural_type(glformat);
+
+ // We always xfer the whole thing again from GL
+ // since it's fiddly to calc / copy-out subregions
+ if (virgl_format_is_yuv(res->args.format)) {
+ mVirtioGpuOps->read_color_buffer_yuv(res->args.handle, 0, 0, res->args.width,
+ res->args.height, res->linear, res->linearSize);
+ } else {
+ mVirtioGpuOps->read_color_buffer(res->args.handle, 0, 0, res->args.width,
+ res->args.height, glformat, gltype, res->linear);
+ }
+
+ return 0;
+ }
+
+ int handleTransferWriteColorBuffer(PipeResEntry* res, uint64_t offset,
+ stream_renderer_box* box) {
+ if (res->type != ResType::COLOR_BUFFER) {
+ stream_renderer_error("resid: %d not a COLOR_BUFFER resource", res->args.handle);
+ return -EINVAL;
+ }
+
+ auto glformat = virgl_format_to_gl(res->args.format);
+ auto gltype = gl_format_to_natural_type(glformat);
+
+ // We always xfer the whole thing again to GL
+ // since it's fiddly to calc / copy-out subregions
+ mVirtioGpuOps->update_color_buffer(res->args.handle, 0, 0, res->args.width,
+ res->args.height, glformat, gltype, res->linear);
+ return 0;
+ }
+
+ int transferReadIov(int resId, uint64_t offset, stream_renderer_box* box, struct iovec* iov,
+ int iovec_cnt) {
+ auto it = mResources.find(resId);
+ if (it == mResources.end()) return EINVAL;
+
+ int ret = 0;
+
+ auto& entry = it->second;
+ switch (entry.type) {
+ case ResType::PIPE:
+ ret = handleTransferReadPipe(&entry, offset, box);
+ break;
+ case ResType::BUFFER:
+ ret = handleTransferReadBuffer(&entry, offset, box);
+ break;
+ case ResType::COLOR_BUFFER:
+ ret = handleTransferReadColorBuffer(&entry, offset, box);
+ break;
+ }
+
+ if (ret != 0) {
+ return ret;
+ }
+
+ if (iovec_cnt) {
+ PipeResEntry e = {
+ entry.args, iov, (uint32_t)iovec_cnt, entry.linear, entry.linearSize,
+ };
+ ret = sync_iov(&e, offset, box, LINEAR_TO_IOV);
+ } else {
+ ret = sync_iov(&entry, offset, box, LINEAR_TO_IOV);
+ }
+
+ return ret;
+ }
+
+ int transferWriteIov(int resId, uint64_t offset, stream_renderer_box* box, struct iovec* iov,
+ int iovec_cnt) {
+ auto it = mResources.find(resId);
+ if (it == mResources.end()) return EINVAL;
+
+ auto& entry = it->second;
+
+ int ret = 0;
+ if (iovec_cnt) {
+ PipeResEntry e = {
+ entry.args, iov, (uint32_t)iovec_cnt, entry.linear, entry.linearSize,
+ };
+ ret = sync_iov(&e, offset, box, IOV_TO_LINEAR);
+ } else {
+ ret = sync_iov(&entry, offset, box, IOV_TO_LINEAR);
+ }
+
+ if (ret != 0) {
+ return ret;
+ }
+
+ switch (entry.type) {
+ case ResType::PIPE:
+ ret = handleTransferWritePipe(&entry, offset, box);
+ break;
+ case ResType::BUFFER:
+ ret = handleTransferWriteBuffer(&entry, offset, box);
+ break;
+ case ResType::COLOR_BUFFER:
+ ret = handleTransferWriteColorBuffer(&entry, offset, box);
+ break;
+ }
+
+ return ret;
+ }
+
+ void getCapset(uint32_t set, uint32_t* max_size) {
+ switch (set) {
+ case VIRTGPU_CAPSET_GFXSTREAM_VULKAN:
+ *max_size = sizeof(struct gfxstream::vulkanCapset);
+ break;
+ case VIRTGPU_CAPSET_GFXSTREAM_MAGMA:
+ *max_size = sizeof(struct gfxstream::magmaCapset);
+ break;
+ case VIRTGPU_CAPSET_GFXSTREAM_GLES:
+ *max_size = sizeof(struct gfxstream::glesCapset);
+ break;
+ case VIRTGPU_CAPSET_GFXSTREAM_COMPOSER:
+ *max_size = sizeof(struct gfxstream::composerCapset);
+ break;
+ default:
+ stream_renderer_error("Incorrect capability set specified");
+ }
+ }
+
+ void fillCaps(uint32_t set, void* caps) {
+ switch (set) {
+ case VIRTGPU_CAPSET_GFXSTREAM_VULKAN: {
+ struct gfxstream::vulkanCapset* capset =
+ reinterpret_cast<struct gfxstream::vulkanCapset*>(caps);
+
+ memset(capset, 0, sizeof(*capset));
+
+ capset->protocolVersion = 1;
+ capset->ringSize = 12288;
+ capset->bufferSize = 1048576;
+
+ auto vk_emu = gfxstream::vk::getGlobalVkEmulation();
+ if (vk_emu && vk_emu->live && vk_emu->representativeColorBufferMemoryTypeIndex) {
+ capset->colorBufferMemoryIndex =
+ *vk_emu->representativeColorBufferMemoryTypeIndex;
+ }
+
+ capset->noRenderControlEnc = 1;
+ capset->blobAlignment = mPageSize;
+ if (vk_emu && vk_emu->live) {
+ capset->deferredMapping = 1;
+ }
+ break;
+ }
+ case VIRTGPU_CAPSET_GFXSTREAM_MAGMA: {
+ struct gfxstream::magmaCapset* capset =
+ reinterpret_cast<struct gfxstream::magmaCapset*>(caps);
+
+ capset->protocolVersion = 1;
+ capset->ringSize = 12288;
+ capset->bufferSize = 1048576;
+ capset->blobAlignment = mPageSize;
+ break;
+ }
+ case VIRTGPU_CAPSET_GFXSTREAM_GLES: {
+ struct gfxstream::glesCapset* capset =
+ reinterpret_cast<struct gfxstream::glesCapset*>(caps);
+
+ capset->protocolVersion = 1;
+ capset->ringSize = 12288;
+ capset->bufferSize = 1048576;
+ capset->blobAlignment = mPageSize;
+ break;
+ }
+ case VIRTGPU_CAPSET_GFXSTREAM_COMPOSER: {
+ struct gfxstream::composerCapset* capset =
+ reinterpret_cast<struct gfxstream::composerCapset*>(caps);
+
+ capset->protocolVersion = 1;
+ capset->ringSize = 12288;
+ capset->bufferSize = 1048576;
+ capset->blobAlignment = mPageSize;
+ break;
+ }
+ default:
+ stream_renderer_error("Incorrect capability set specified");
+ }
+ }
+
+ void attachResource(uint32_t ctxId, uint32_t resId) {
+ stream_renderer_info("ctxid: %u resid: %u", ctxId, resId);
+
+ auto resourcesIt = mContextResources.find(ctxId);
+
+ if (resourcesIt == mContextResources.end()) {
+ std::vector<VirtioGpuResId> ids;
+ ids.push_back(resId);
+ mContextResources[ctxId] = ids;
+ } else {
+ auto& ids = resourcesIt->second;
+ auto idIt = std::find(ids.begin(), ids.end(), resId);
+ if (idIt == ids.end()) ids.push_back(resId);
+ }
+
+ auto contextsIt = mResourceContexts.find(resId);
+
+ if (contextsIt == mResourceContexts.end()) {
+ std::vector<VirtioGpuCtxId> ids;
+ ids.push_back(ctxId);
+ mResourceContexts[resId] = ids;
+ } else {
+ auto& ids = contextsIt->second;
+ auto idIt = std::find(ids.begin(), ids.end(), ctxId);
+ if (idIt == ids.end()) ids.push_back(ctxId);
+ }
+
+ // Associate the host pipe of the resource entry with the host pipe of
+ // the context entry. That is, the last context to call attachResource
+ // wins if there is any conflict.
+ auto ctxEntryIt = mContexts.find(ctxId);
+ auto resEntryIt = mResources.find(resId);
+
+ if (ctxEntryIt == mContexts.end() || resEntryIt == mResources.end()) return;
+
+ stream_renderer_info("hostPipe: %p", ctxEntryIt->second.hostPipe);
+ resEntryIt->second.hostPipe = ctxEntryIt->second.hostPipe;
+ resEntryIt->second.ctxId = ctxId;
+ }
+
+ void detachResource(uint32_t ctxId, uint32_t toUnrefId) {
+ stream_renderer_info("ctxid: %u resid: %u", ctxId, toUnrefId);
+ detachResourceLocked(ctxId, toUnrefId);
+ }
+
+ int getResourceInfo(uint32_t resId, struct stream_renderer_resource_info* info) {
+ stream_renderer_info("resid: %u", resId);
+ if (!info) return EINVAL;
+
+ auto it = mResources.find(resId);
+ if (it == mResources.end()) return ENOENT;
+
+ auto& entry = it->second;
+
+ uint32_t bpp = 4U;
+ switch (entry.args.format) {
+ case VIRGL_FORMAT_B8G8R8A8_UNORM:
+ info->drm_fourcc = DRM_FORMAT_ARGB8888;
+ break;
+ case VIRGL_FORMAT_B5G6R5_UNORM:
+ info->drm_fourcc = DRM_FORMAT_RGB565;
+ bpp = 2U;
+ break;
+ case VIRGL_FORMAT_R8G8B8A8_UNORM:
+ info->drm_fourcc = DRM_FORMAT_ABGR8888;
+ break;
+ case VIRGL_FORMAT_R8G8B8X8_UNORM:
+ info->drm_fourcc = DRM_FORMAT_XBGR8888;
+ break;
+ case VIRGL_FORMAT_R8_UNORM:
+ info->drm_fourcc = DRM_FORMAT_R8;
+ bpp = 1U;
+ break;
+ default:
+ return EINVAL;
+ }
+
+ info->stride = align_up(entry.args.width * bpp, 16U);
+ info->virgl_format = entry.args.format;
+ info->handle = entry.args.handle;
+ info->height = entry.args.height;
+ info->width = entry.args.width;
+ info->depth = entry.args.depth;
+ info->flags = entry.args.flags;
+ info->tex_id = 0;
+ return 0;
+ }
+
+ void flushResource(uint32_t res_handle) {
+ auto taskId = mVirtioGpuTimelines->enqueueTask(VirtioGpuRingGlobal{});
+ mVirtioGpuOps->async_post_color_buffer(
+ res_handle, [this, taskId](std::shared_future<void> waitForGpu) {
+ waitForGpu.wait();
+ mVirtioGpuTimelines->notifyTaskCompletion(taskId);
+ });
+ }
+
+ int createRingBlob(PipeResEntry& entry, uint32_t res_handle,
+ const struct stream_renderer_create_blob* create_blob,
+ const struct stream_renderer_handle* handle) {
+ if (feature_is_enabled(kFeature_ExternalBlob)) {
+ std::string name = "shared-memory-" + std::to_string(res_handle);
+ auto ringBlob = std::make_shared<SharedMemory>(name, create_blob->size);
+ int ret = ringBlob->create(0600);
+ if (ret) {
+ stream_renderer_error("Failed to create shared memory blob");
+ return ret;
+ }
+
+ entry.ringBlob = ringBlob;
+ entry.hva = ringBlob->get();
+ } else {
+ void* addr =
+ android::aligned_buf_alloc(mPageSize, create_blob->size);
+ if (addr == nullptr) {
+ stream_renderer_error("Failed to allocate ring blob");
+ return -ENOMEM;
+ }
+
+ entry.hva = addr;
+ }
+
+ entry.hvaSize = create_blob->size;
+ entry.externalAddr = true;
+ entry.caching = STREAM_RENDERER_MAP_CACHE_CACHED;
+
+ return 0;
+ }
+
+ int createBlob(uint32_t ctx_id, uint32_t res_handle,
+ const struct stream_renderer_create_blob* create_blob,
+ const struct stream_renderer_handle* handle) {
+ stream_renderer_info("ctx:%u res:%u blob-id:%u blob-size:%u",
+ ctx_id, res_handle, create_blob->blob_id, create_blob->size);
+
+ PipeResEntry e;
+ struct stream_renderer_resource_create_args args = {0};
+ e.args = args;
+ e.hostPipe = 0;
+
+ if (create_blob->blob_id == 0) {
+ int ret = createRingBlob(e, res_handle, create_blob, handle);
+ if (ret) {
+ return ret;
+ }
+ } else if (feature_is_enabled(kFeature_ExternalBlob)) {
+ if (create_blob->blob_mem == STREAM_BLOB_MEM_GUEST &&
+ (create_blob->blob_flags & STREAM_BLOB_FLAG_CREATE_GUEST_HANDLE)) {
+#if defined(__linux__) || defined(__QNX__)
+ ManagedDescriptor managedHandle(handle->os_handle);
+ BlobManager::get()->addDescriptorInfo(ctx_id, create_blob->blob_id,
+ std::move(managedHandle), handle->handle_type,
+ 0, std::nullopt);
+
+ e.caching = STREAM_RENDERER_MAP_CACHE_CACHED;
+#else
+ return -EINVAL;
+#endif
+ } else {
+ auto descriptorInfoOpt =
+ BlobManager::get()->removeDescriptorInfo(ctx_id, create_blob->blob_id);
+ if (descriptorInfoOpt) {
+ e.descriptorInfo =
+ std::make_shared<ManagedDescriptorInfo>(std::move(*descriptorInfoOpt));
+ } else {
+ return -EINVAL;
+ }
+
+ e.caching = e.descriptorInfo->caching;
+ }
+ } else {
+ auto entryOpt = BlobManager::get()->removeMapping(ctx_id, create_blob->blob_id);
+ if (entryOpt) {
+ e.hva = entryOpt->addr;
+ e.caching = entryOpt->caching;
+ e.hvaSize = create_blob->size;
+ } else {
+ return -EINVAL;
+ }
+ }
+
+ e.blobId = create_blob->blob_id;
+ e.blobMem = create_blob->blob_mem;
+ e.blobFlags = create_blob->blob_flags;
+ e.iov = nullptr;
+ e.numIovs = 0;
+ e.linear = 0;
+ e.linearSize = 0;
+
+ mResources[res_handle] = e;
+ return 0;
+ }
+
+ int resourceMap(uint32_t res_handle, void** hvaOut, uint64_t* sizeOut) {
+ if (feature_is_enabled(kFeature_ExternalBlob)) return -EINVAL;
+
+ auto it = mResources.find(res_handle);
+ if (it == mResources.end()) {
+ if (hvaOut) *hvaOut = nullptr;
+ if (sizeOut) *sizeOut = 0;
+ return -EINVAL;
+ }
+
+ const auto& entry = it->second;
+
+ if (hvaOut) *hvaOut = entry.hva;
+ if (sizeOut) *sizeOut = entry.hvaSize;
+ return 0;
+ }
+
+ int resourceUnmap(uint32_t res_handle) {
+ auto it = mResources.find(res_handle);
+ if (it == mResources.end()) {
+ return -EINVAL;
+ }
+
+ // TODO(lfy): Good place to run any registered cleanup callbacks.
+ // No-op for now.
+ return 0;
+ }
+
+ int platformImportResource(int res_handle, int res_info, void* resource) {
+ auto it = mResources.find(res_handle);
+ if (it == mResources.end()) return -EINVAL;
+ bool success = mVirtioGpuOps->platform_import_resource(res_handle, res_info, resource);
+ return success ? 0 : -1;
+ }
+
+ int platformResourceInfo(int res_handle, int* width, int* height, int* internal_format) {
+ auto it = mResources.find(res_handle);
+ if (it == mResources.end()) return -EINVAL;
+ bool success =
+ mVirtioGpuOps->platform_resource_info(res_handle, width, height, internal_format);
+ return success ? 0 : -1;
+ }
+
+ void* platformCreateSharedEglContext() {
+ return mVirtioGpuOps->platform_create_shared_egl_context();
+ }
+
+ int platformDestroySharedEglContext(void* context) {
+ bool success = mVirtioGpuOps->platform_destroy_shared_egl_context(context);
+ return success ? 0 : -1;
+ }
+
+ int resourceMapInfo(uint32_t res_handle, uint32_t* map_info) {
+ auto it = mResources.find(res_handle);
+ if (it == mResources.end()) return -EINVAL;
+
+ const auto& entry = it->second;
+ *map_info = entry.caching;
+ return 0;
+ }
+
+ int exportBlob(uint32_t res_handle, struct stream_renderer_handle* handle) {
+ auto it = mResources.find(res_handle);
+ if (it == mResources.end()) {
+ return -EINVAL;
+ }
+
+ auto& entry = it->second;
+ if (entry.ringBlob) {
+ // Handle ownership transferred to VMM, gfxstream keeps the mapping.
+#ifdef _WIN32
+ handle->os_handle =
+ static_cast<int64_t>(reinterpret_cast<intptr_t>(entry.ringBlob->releaseHandle()));
+#else
+ handle->os_handle = static_cast<int64_t>(entry.ringBlob->releaseHandle());
+#endif
+ handle->handle_type = STREAM_MEM_HANDLE_TYPE_SHM;
+ return 0;
+ }
+
+ if (entry.descriptorInfo) {
+ bool shareable = entry.blobFlags &
+ (STREAM_BLOB_FLAG_USE_SHAREABLE | STREAM_BLOB_FLAG_USE_CROSS_DEVICE);
+
+ DescriptorType rawDescriptor;
+ if (shareable) {
+ // TODO: Add ManagedDescriptor::{clone, dup} method and use it;
+ // This should have no affect since gfxstream allocates mappable-only buffers
+ // currently
+ return -EINVAL;
+ } else {
+ auto rawDescriptorOpt = entry.descriptorInfo->descriptor.release();
+ if (rawDescriptorOpt)
+ rawDescriptor = *rawDescriptorOpt;
+ else
+ return -EINVAL;
+ }
+
+ handle->handle_type = entry.descriptorInfo->handleType;
+
+#ifdef _WIN32
+ handle->os_handle = static_cast<int64_t>(reinterpret_cast<intptr_t>(rawDescriptor));
+#else
+ handle->os_handle = static_cast<int64_t>(rawDescriptor);
+#endif
+
+ return 0;
+ }
+
+ return -EINVAL;
+ }
+
+ int vulkanInfo(uint32_t res_handle, struct stream_renderer_vulkan_info* vulkan_info) {
+ auto it = mResources.find(res_handle);
+ if (it == mResources.end()) return -EINVAL;
+
+ const auto& entry = it->second;
+ if (entry.descriptorInfo && entry.descriptorInfo->vulkanInfoOpt) {
+ vulkan_info->memory_index = (*entry.descriptorInfo->vulkanInfoOpt).memoryIndex;
+ memcpy(vulkan_info->device_id.device_uuid,
+ (*entry.descriptorInfo->vulkanInfoOpt).deviceUUID,
+ sizeof(vulkan_info->device_id.device_uuid));
+ memcpy(vulkan_info->device_id.driver_uuid,
+ (*entry.descriptorInfo->vulkanInfoOpt).driverUUID,
+ sizeof(vulkan_info->device_id.driver_uuid));
+ return 0;
+ }
+
+ return -EINVAL;
+ }
+
+#ifdef CONFIG_AEMU
+ void setServiceOps(const GoldfishPipeServiceOps* ops) { mServiceOps = ops; }
+#endif // CONFIG_AEMU
+ private:
+ void allocResource(PipeResEntry& entry, iovec* iov, int num_iovs) {
+ stream_renderer_info("entry linear: %p", entry.linear);
+ if (entry.linear) free(entry.linear);
+
+ size_t linearSize = 0;
+ for (uint32_t i = 0; i < num_iovs; ++i) {
+ stream_renderer_info("iov base: %p", iov[i].iov_base);
+ linearSize += iov[i].iov_len;
+ stream_renderer_info("has iov of %zu. linearSize current: %zu", iov[i].iov_len,
+ linearSize);
+ }
+ stream_renderer_info("final linearSize: %zu", linearSize);
+
+ void* linear = nullptr;
+
+ if (linearSize) linear = malloc(linearSize);
+
+ entry.iov = (iovec*)malloc(sizeof(*iov) * num_iovs);
+ entry.numIovs = num_iovs;
+ memcpy(entry.iov, iov, num_iovs * sizeof(*iov));
+ entry.linear = linear;
+ entry.linearSize = linearSize;
+ }
+
+ void detachResourceLocked(uint32_t ctxId, uint32_t toUnrefId) {
+ stream_renderer_info("ctxid: %u resid: %u", ctxId, toUnrefId);
+
+ auto it = mContextResources.find(ctxId);
+ if (it == mContextResources.end()) return;
+
+ std::vector<VirtioGpuResId> withoutRes;
+ for (auto resId : it->second) {
+ if (resId != toUnrefId) {
+ withoutRes.push_back(resId);
+ }
+ }
+ mContextResources[ctxId] = withoutRes;
+
+ auto resIt = mResources.find(toUnrefId);
+ if (resIt == mResources.end()) return;
+
+ resIt->second.hostPipe = 0;
+ resIt->second.ctxId = 0;
+
+ auto ctxIt = mContexts.find(ctxId);
+ if (ctxIt != mContexts.end()) {
+ auto& ctxEntry = ctxIt->second;
+ if (ctxEntry.addressSpaceHandles.count(toUnrefId)) {
+ uint32_t handle = ctxEntry.addressSpaceHandles[toUnrefId];
+ mAddressSpaceDeviceControlOps->destroy_handle(handle);
+ ctxEntry.addressSpaceHandles.erase(toUnrefId);
+ }
+ }
+ }
+
+ inline const GoldfishPipeServiceOps* ensureAndGetServiceOps() {
+ if (mServiceOps) return mServiceOps;
+ mServiceOps = goldfish_pipe_get_service_ops();
+ return mServiceOps;
+ }
+
+ void* mCookie = nullptr;
+ stream_renderer_fence_callback mFenceCallback;
+ AndroidVirtioGpuOps* mVirtioGpuOps = nullptr;
+ uint32_t mPageSize = 4096;
+ struct address_space_device_control_ops* mAddressSpaceDeviceControlOps = nullptr;
+
+ const GoldfishPipeServiceOps* mServiceOps = nullptr;
+
+ std::unordered_map<VirtioGpuCtxId, PipeCtxEntry> mContexts;
+ std::unordered_map<VirtioGpuResId, PipeResEntry> mResources;
+ std::unordered_map<VirtioGpuCtxId, std::vector<VirtioGpuResId>> mContextResources;
+ std::unordered_map<VirtioGpuResId, std::vector<VirtioGpuCtxId>> mResourceContexts;
+
+ // When we wait for gpu or wait for gpu vulkan, the next (and subsequent)
+ // fences created for that context should not be signaled immediately.
+ // Rather, they should get in line.
+ std::unique_ptr<VirtioGpuTimelines> mVirtioGpuTimelines = nullptr;
+};
+
+static PipeVirglRenderer* sRenderer() {
+ static PipeVirglRenderer* p = new PipeVirglRenderer;
+ return p;
+}
+
+extern "C" {
+
+VG_EXPORT int stream_renderer_resource_create(struct stream_renderer_resource_create_args* args,
+ struct iovec* iov, uint32_t num_iovs) {
+ return sRenderer()->createResource(args, iov, num_iovs);
+}
+
+VG_EXPORT void stream_renderer_resource_unref(uint32_t res_handle) {
+ sRenderer()->unrefResource(res_handle);
+}
+
+VG_EXPORT void stream_renderer_context_destroy(uint32_t handle) {
+ sRenderer()->destroyContext(handle);
+}
+
+VG_EXPORT int stream_renderer_submit_cmd(struct stream_renderer_command* cmd) {
+ return sRenderer()->submitCmd(cmd);
+}
+
+VG_EXPORT int stream_renderer_transfer_read_iov(uint32_t handle, uint32_t ctx_id, uint32_t level,
+ uint32_t stride, uint32_t layer_stride,
+ struct stream_renderer_box* box, uint64_t offset,
+ struct iovec* iov, int iovec_cnt) {
+ return sRenderer()->transferReadIov(handle, offset, box, iov, iovec_cnt);
+}
+
+VG_EXPORT int stream_renderer_transfer_write_iov(uint32_t handle, uint32_t ctx_id, int level,
+ uint32_t stride, uint32_t layer_stride,
+ struct stream_renderer_box* box, uint64_t offset,
+ struct iovec* iovec, unsigned int iovec_cnt) {
+ return sRenderer()->transferWriteIov(handle, offset, box, iovec, iovec_cnt);
+}
+
+VG_EXPORT void stream_renderer_get_cap_set(uint32_t set, uint32_t* max_ver, uint32_t* max_size) {
+ // `max_ver` not useful
+ return sRenderer()->getCapset(set, max_size);
+}
+
+VG_EXPORT void stream_renderer_fill_caps(uint32_t set, uint32_t version, void* caps) {
+ // `version` not useful
+ return sRenderer()->fillCaps(set, caps);
+}
+
+VG_EXPORT int stream_renderer_resource_attach_iov(int res_handle, struct iovec* iov, int num_iovs) {
+ return sRenderer()->attachIov(res_handle, iov, num_iovs);
+}
+
+VG_EXPORT void stream_renderer_resource_detach_iov(int res_handle, struct iovec** iov,
+ int* num_iovs) {
+ return sRenderer()->detachIov(res_handle, iov, num_iovs);
+}
+
+VG_EXPORT void stream_renderer_ctx_attach_resource(int ctx_id, int res_handle) {
+ sRenderer()->attachResource(ctx_id, res_handle);
+}
+
+VG_EXPORT void stream_renderer_ctx_detach_resource(int ctx_id, int res_handle) {
+ sRenderer()->detachResource(ctx_id, res_handle);
+}
+
+VG_EXPORT int stream_renderer_resource_get_info(int res_handle,
+ struct stream_renderer_resource_info* info) {
+ return sRenderer()->getResourceInfo(res_handle, info);
+}
+
+VG_EXPORT void stream_renderer_flush(uint32_t res_handle) {
+ sRenderer()->flushResource(res_handle);
+}
+
+VG_EXPORT int stream_renderer_create_blob(uint32_t ctx_id, uint32_t res_handle,
+ const struct stream_renderer_create_blob* create_blob,
+ const struct iovec* iovecs, uint32_t num_iovs,
+ const struct stream_renderer_handle* handle) {
+ sRenderer()->createBlob(ctx_id, res_handle, create_blob, handle);
+ return 0;
+}
+
+VG_EXPORT int stream_renderer_export_blob(uint32_t res_handle,
+ struct stream_renderer_handle* handle) {
+ return sRenderer()->exportBlob(res_handle, handle);
+}
+
+VG_EXPORT int stream_renderer_resource_map(uint32_t res_handle, void** hvaOut, uint64_t* sizeOut) {
+ return sRenderer()->resourceMap(res_handle, hvaOut, sizeOut);
+}
+
+VG_EXPORT int stream_renderer_resource_unmap(uint32_t res_handle) {
+ return sRenderer()->resourceUnmap(res_handle);
+}
+
+VG_EXPORT int stream_renderer_context_create(uint32_t ctx_id, uint32_t nlen, const char* name,
+ uint32_t context_init) {
+ return sRenderer()->createContext(ctx_id, nlen, name, context_init);
+}
+
+VG_EXPORT int stream_renderer_create_fence(const struct stream_renderer_fence* fence) {
+ if (fence->flags & STREAM_RENDERER_FLAG_FENCE_RING_IDX) {
+ sRenderer()->createFence(fence->fence_id, VirtioGpuRingContextSpecific{
+ .mCtxId = fence->ctx_id,
+ .mRingIdx = fence->ring_idx,
+ });
+ } else {
+ sRenderer()->createFence(fence->fence_id, VirtioGpuRingGlobal{});
+ }
+
+ return 0;
+}
+
+VG_EXPORT int stream_renderer_platform_import_resource(int res_handle, int res_info,
+ void* resource) {
+ return sRenderer()->platformImportResource(res_handle, res_info, resource);
+}
+
+VG_EXPORT int stream_renderer_platform_resource_info(int res_handle, int* width, int* height,
+ int* internal_format) {
+ return sRenderer()->platformResourceInfo(res_handle, width, height, internal_format);
+}
+
+VG_EXPORT void* stream_renderer_platform_create_shared_egl_context() {
+ return sRenderer()->platformCreateSharedEglContext();
+}
+
+VG_EXPORT int stream_renderer_platform_destroy_shared_egl_context(void* context) {
+ return sRenderer()->platformDestroySharedEglContext(context);
+}
+
+VG_EXPORT int stream_renderer_resource_map_info(uint32_t res_handle, uint32_t* map_info) {
+ return sRenderer()->resourceMapInfo(res_handle, map_info);
+}
+
+VG_EXPORT int stream_renderer_vulkan_info(uint32_t res_handle,
+ struct stream_renderer_vulkan_info* vulkan_info) {
+ return sRenderer()->vulkanInfo(res_handle, vulkan_info);
+}
+
+static const GoldfishPipeServiceOps goldfish_pipe_service_ops = {
+ // guest_open()
+ [](GoldfishHwPipe* hwPipe) -> GoldfishHostPipe* {
+ return static_cast<GoldfishHostPipe*>(android_pipe_guest_open(hwPipe));
+ },
+ // guest_open_with_flags()
+ [](GoldfishHwPipe* hwPipe, uint32_t flags) -> GoldfishHostPipe* {
+ return static_cast<GoldfishHostPipe*>(android_pipe_guest_open_with_flags(hwPipe, flags));
+ },
+ // guest_close()
+ [](GoldfishHostPipe* hostPipe, GoldfishPipeCloseReason reason) {
+ static_assert((int)GOLDFISH_PIPE_CLOSE_GRACEFUL == (int)PIPE_CLOSE_GRACEFUL,
+ "Invalid PIPE_CLOSE_GRACEFUL value");
+ static_assert((int)GOLDFISH_PIPE_CLOSE_REBOOT == (int)PIPE_CLOSE_REBOOT,
+ "Invalid PIPE_CLOSE_REBOOT value");
+ static_assert((int)GOLDFISH_PIPE_CLOSE_LOAD_SNAPSHOT == (int)PIPE_CLOSE_LOAD_SNAPSHOT,
+ "Invalid PIPE_CLOSE_LOAD_SNAPSHOT value");
+ static_assert((int)GOLDFISH_PIPE_CLOSE_ERROR == (int)PIPE_CLOSE_ERROR,
+ "Invalid PIPE_CLOSE_ERROR value");
+
+ android_pipe_guest_close(hostPipe, static_cast<PipeCloseReason>(reason));
+ },
+ // guest_pre_load()
+ [](QEMUFile* file) { (void)file; },
+ // guest_post_load()
+ [](QEMUFile* file) { (void)file; },
+ // guest_pre_save()
+ [](QEMUFile* file) { (void)file; },
+ // guest_post_save()
+ [](QEMUFile* file) { (void)file; },
+ // guest_load()
+ [](QEMUFile* file, GoldfishHwPipe* hwPipe, char* force_close) -> GoldfishHostPipe* {
+ (void)file;
+ (void)hwPipe;
+ (void)force_close;
+ return nullptr;
+ },
+ // guest_save()
+ [](GoldfishHostPipe* hostPipe, QEMUFile* file) {
+ (void)hostPipe;
+ (void)file;
+ },
+ // guest_poll()
+ [](GoldfishHostPipe* hostPipe) {
+ static_assert((int)GOLDFISH_PIPE_POLL_IN == (int)PIPE_POLL_IN, "invalid POLL_IN values");
+ static_assert((int)GOLDFISH_PIPE_POLL_OUT == (int)PIPE_POLL_OUT, "invalid POLL_OUT values");
+ static_assert((int)GOLDFISH_PIPE_POLL_HUP == (int)PIPE_POLL_HUP, "invalid POLL_HUP values");
+
+ return static_cast<GoldfishPipePollFlags>(android_pipe_guest_poll(hostPipe));
+ },
+ // guest_recv()
+ [](GoldfishHostPipe* hostPipe, GoldfishPipeBuffer* buffers, int numBuffers) -> int {
+ // NOTE: Assumes that AndroidPipeBuffer and GoldfishPipeBuffer
+ // have exactly the same layout.
+ static_assert(sizeof(AndroidPipeBuffer) == sizeof(GoldfishPipeBuffer),
+ "Invalid PipeBuffer sizes");
+ // We can't use a static_assert with offsetof() because in msvc, it uses
+ // reinterpret_cast.
+ // TODO: Add runtime assertion instead?
+ // https://developercommunity.visualstudio.com/content/problem/22196/static-assert-cannot-compile-constexprs-method-tha.html
+#ifndef _MSC_VER
+ static_assert(offsetof(AndroidPipeBuffer, data) == offsetof(GoldfishPipeBuffer, data),
+ "Invalid PipeBuffer::data offsets");
+ static_assert(offsetof(AndroidPipeBuffer, size) == offsetof(GoldfishPipeBuffer, size),
+ "Invalid PipeBuffer::size offsets");
+#endif
+ return android_pipe_guest_recv(hostPipe, reinterpret_cast<AndroidPipeBuffer*>(buffers),
+ numBuffers);
+ },
+ // wait_guest_recv()
+ [](GoldfishHostPipe* hostPipe) {
+ android_pipe_wait_guest_recv(hostPipe);
+ },
+ // guest_send()
+ [](GoldfishHostPipe** hostPipe, const GoldfishPipeBuffer* buffers, int numBuffers) -> int {
+ return android_pipe_guest_send(reinterpret_cast<void**>(hostPipe),
+ reinterpret_cast<const AndroidPipeBuffer*>(buffers),
+ numBuffers);
+ },
+ // wait_guest_send()
+ [](GoldfishHostPipe* hostPipe) {
+ android_pipe_wait_guest_send(hostPipe);
+ },
+ // guest_wake_on()
+ [](GoldfishHostPipe* hostPipe, GoldfishPipeWakeFlags wakeFlags) {
+ android_pipe_guest_wake_on(hostPipe, static_cast<int>(wakeFlags));
+ },
+ // dma_add_buffer()
+ [](void* pipe, uint64_t paddr, uint64_t sz) {
+ // not considered for virtio
+ },
+ // dma_remove_buffer()
+ [](uint64_t paddr) {
+ // not considered for virtio
+ },
+ // dma_invalidate_host_mappings()
+ []() {
+ // not considered for virtio
+ },
+ // dma_reset_host_mappings()
+ []() {
+ // not considered for virtio
+ },
+ // dma_save_mappings()
+ [](QEMUFile* file) { (void)file; },
+ // dma_load_mappings()
+ [](QEMUFile* file) { (void)file; },
+};
+
+static int stream_renderer_opengles_init(uint32_t display_width, uint32_t display_height,
+ int renderer_flags) {
+ stream_renderer_info("start. display dimensions: width %u height %u, renderer flags: 0x%x",
+ display_width, display_height, renderer_flags);
+
+ // Flags processing
+
+ // TODO: hook up "gfxstream egl" to the renderer flags
+ // STREAM_RENDERER_FLAGS_USE_EGL_BIT in crosvm
+ // as it's specified from launch_cvd.
+ // At the moment, use ANDROID_GFXSTREAM_EGL=1
+ // For test on GCE
+ if (android::base::getEnvironmentVariable("ANDROID_GFXSTREAM_EGL") == "1") {
+ android::base::setEnvironmentVariable("ANDROID_EGL_ON_EGL", "1");
+ android::base::setEnvironmentVariable("ANDROID_EMUGL_LOG_PRINT", "1");
+ android::base::setEnvironmentVariable("ANDROID_EMUGL_VERBOSE", "1");
+ }
+ // end for test on GCE
+
+ android::base::setEnvironmentVariable("ANDROID_EMU_HEADLESS", "1");
+ bool enableVk = (renderer_flags & STREAM_RENDERER_FLAGS_USE_VK_BIT);
+ bool enableGles = (renderer_flags & STREAM_RENDERER_FLAGS_USE_GLES_BIT);
+ bool enableVkSnapshot = (renderer_flags & STREAM_RENDERER_FLAGS_VULKAN_SNAPSHOTS);
+
+ bool egl2eglByEnv = android::base::getEnvironmentVariable("ANDROID_EGL_ON_EGL") == "1";
+ bool egl2eglByFlag = renderer_flags & STREAM_RENDERER_FLAGS_USE_EGL_BIT;
+ bool enable_egl2egl = egl2eglByFlag || egl2eglByEnv;
+ if (enable_egl2egl) {
+ android::base::setEnvironmentVariable("ANDROID_GFXSTREAM_EGL", "1");
+ android::base::setEnvironmentVariable("ANDROID_EGL_ON_EGL", "1");
+ }
+
+ bool surfaceless = renderer_flags & STREAM_RENDERER_FLAGS_USE_SURFACELESS_BIT;
+ bool enableGlEs31Flag = enableGles;
+ bool useExternalBlob = renderer_flags & STREAM_RENDERER_FLAGS_USE_EXTERNAL_BLOB;
+ bool useSystemBlob = renderer_flags & STREAM_RENDERER_FLAGS_USE_SYSTEM_BLOB;
+ bool guestUsesAngle = enableVk && !enableGles;
+ bool useVulkanNativeSwapchain =
+ renderer_flags & STREAM_RENDERER_FLAGS_VULKAN_NATIVE_SWAPCHAIN_BIT;
+
+ stream_renderer_info("GLES enabled? %d", enableGles);
+ stream_renderer_info("Vulkan enabled? %d", enableVk);
+ stream_renderer_info("egl2egl enabled? %d", enable_egl2egl);
+ stream_renderer_info("surfaceless? %d", surfaceless);
+ stream_renderer_info("OpenGL ES 3.1 enabled? %d", enableGlEs31Flag);
+ stream_renderer_info("use external blob? %d", useExternalBlob);
+ stream_renderer_info("use system blob? %d", useSystemBlob);
+ stream_renderer_info("guest using ANGLE? %d", guestUsesAngle);
+ stream_renderer_info("use Vulkan native swapchain on the host? %d", useVulkanNativeSwapchain);
+
+ if (useSystemBlob) {
+ if (!useExternalBlob) {
+ stream_renderer_info("USE_EXTERNAL_BLOB must be on with USE_SYSTEM_BLOB");
+ return -EINVAL;
+ }
+
+#ifndef _WIN32
+ stream_renderer_info("Warning: USE_SYSTEM_BLOB has only been tested on Windows");
+#endif
+ }
+
+ feature_set_enabled_override(kFeature_GLPipeChecksum, false);
+ feature_set_enabled_override(kFeature_GLESDynamicVersion, true);
+ feature_set_enabled_override(kFeature_PlayStoreImage, !enableGlEs31Flag);
+ feature_set_enabled_override(kFeature_GLDMA, false);
+ feature_set_enabled_override(kFeature_GLAsyncSwap, false);
+ feature_set_enabled_override(kFeature_RefCountPipe, false);
+ feature_set_enabled_override(kFeature_NoDelayCloseColorBuffer, true);
+ feature_set_enabled_override(kFeature_NativeTextureDecompression, false);
+ feature_set_enabled_override(kFeature_GLDirectMem, false);
+ feature_set_enabled_override(kFeature_Vulkan, enableVk);
+ feature_set_enabled_override(kFeature_VulkanSnapshots, enableVkSnapshot);
+ feature_set_enabled_override(kFeature_VulkanNullOptionalStrings, true);
+ feature_set_enabled_override(kFeature_VulkanShaderFloat16Int8, true);
+ feature_set_enabled_override(kFeature_HostComposition, true);
+ feature_set_enabled_override(kFeature_VulkanIgnoredHandles, true);
+ feature_set_enabled_override(kFeature_VirtioGpuNext, true);
+ feature_set_enabled_override(kFeature_VirtioGpuNativeSync, true);
+ feature_set_enabled_override(kFeature_GuestUsesAngle, guestUsesAngle);
+ feature_set_enabled_override(kFeature_VulkanQueueSubmitWithCommands, true);
+ feature_set_enabled_override(kFeature_VulkanNativeSwapchain, useVulkanNativeSwapchain);
+ feature_set_enabled_override(kFeature_VulkanBatchedDescriptorSetUpdate, true);
+ feature_set_enabled_override(kFeature_VirtioGpuFenceContexts, true);
+ feature_set_enabled_override(kFeature_ExternalBlob, useExternalBlob);
+ feature_set_enabled_override(kFeature_SystemBlob, useSystemBlob);
+
+ android::featurecontrol::productFeatureOverride();
+
+ if (useVulkanNativeSwapchain && !enableVk) {
+ stream_renderer_error("can't enable vulkan native swapchain, Vulkan is disabled");
+ return -EINVAL;
+ }
+
+ gfxstream::vk::vkDispatch(false /* don't use test ICD */);
+
+ auto androidHw = aemu_get_android_hw();
+
+ androidHw->hw_gltransport_asg_writeBufferSize = 1048576;
+ androidHw->hw_gltransport_asg_writeStepSize = 262144;
+ androidHw->hw_gltransport_asg_dataRingSize = 524288;
+ androidHw->hw_gltransport_drawFlushInterval = 10000;
+
+ EmuglConfig config;
+
+ // Make all the console agents available.
+ android::emulation::injectGraphicsAgents(android::emulation::GfxStreamGraphicsAgentFactory());
+
+ emuglConfig_init(&config, true /* gpu enabled */, "auto",
+ enable_egl2egl ? "swiftshader_indirect" : "host", 64, /* bitness */
+ surfaceless, /* no window */
+ false, /* blocklisted */
+ false, /* has guest renderer */
+ WINSYS_GLESBACKEND_PREFERENCE_AUTO, true /* force host gpu vulkan */);
+
+ emuglConfig_setupEnv(&config);
+
+ android_prepareOpenglesEmulation();
+
+ {
+ static gfxstream::RenderLibPtr renderLibPtr = gfxstream::initLibrary();
+ android_setOpenglesEmulation(renderLibPtr.get(), nullptr, nullptr);
+ }
+
+ int maj;
+ int min;
+ android_startOpenglesRenderer(display_width, display_height, 1, 28, getGraphicsAgents()->vm,
+ getGraphicsAgents()->emu, getGraphicsAgents()->multi_display,
+ &maj, &min);
+
+ char* vendor = nullptr;
+ char* renderer = nullptr;
+ char* version = nullptr;
+
+ android_getOpenglesHardwareStrings(&vendor, &renderer, &version);
+
+ stream_renderer_info("GL strings; [%s] [%s] [%s].\n", vendor, renderer, version);
+
+ auto openglesRenderer = android_getOpenglesRenderer();
+
+ if (!openglesRenderer) {
+ stream_renderer_error("No renderer started, fatal");
+ return -EINVAL;
+ }
+
+ address_space_set_vm_operations(getGraphicsAgents()->vm);
+ android_init_opengles_pipe();
+ android_opengles_pipe_set_recv_mode(2 /* virtio-gpu */);
+ android_init_refcount_pipe();
+
+ return 0;
+}
+
+VG_EXPORT int stream_renderer_init(struct stream_renderer_param* stream_renderer_params,
+ uint64_t num_params) {
+ // Required parameters.
+ std::unordered_set<uint64_t> required_params{STREAM_RENDERER_PARAM_USER_DATA,
+ STREAM_RENDERER_PARAM_RENDERER_FLAGS,
+ STREAM_RENDERER_PARAM_FENCE_CALLBACK};
+
+ // String names of the parameters.
+ std::unordered_map<uint64_t, std::string> param_strings{
+ {STREAM_RENDERER_PARAM_USER_DATA, "USER_DATA"},
+ {STREAM_RENDERER_PARAM_RENDERER_FLAGS, "RENDERER_FLAGS"},
+ {STREAM_RENDERER_PARAM_FENCE_CALLBACK, "FENCE_CALLBACK"},
+ {STREAM_RENDERER_PARAM_WIN0_WIDTH, "WIN0_WIDTH"},
+ {STREAM_RENDERER_PARAM_WIN0_HEIGHT, "WIN0_HEIGHT"},
+ {STREAM_RENDERER_PARAM_DEBUG_CALLBACK, "DEBUG_CALLBACK"},
+ {STREAM_RENDERER_SKIP_OPENGLES_INIT, "SKIP_OPENGLES_INIT"},
+ {STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_INSTANT_EVENT,
+ "METRICS_CALLBACK_ADD_INSTANT_EVENT"},
+ {STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_INSTANT_EVENT_WITH_DESCRIPTOR,
+ "METRICS_CALLBACK_ADD_INSTANT_EVENT_WITH_DESCRIPTOR"},
+ {STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_INSTANT_EVENT_WITH_METRIC,
+ "METRICS_CALLBACK_ADD_INSTANT_EVENT_WITH_METRIC"},
+ {STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_VULKAN_OUT_OF_MEMORY_EVENT,
+ "METRICS_CALLBACK_ADD_VULKAN_OUT_OF_MEMORY_EVENT"},
+ {STREAM_RENDERER_PARAM_METRICS_CALLBACK_SET_ANNOTATION, "METRICS_CALLBACK_SET_ANNOTATION"},
+ {STREAM_RENDERER_PARAM_METRICS_CALLBACK_ABORT, "METRICS_CALLBACK_ABORT"}};
+
+ // Print full values for these parameters:
+ // Values here must not be pointers (e.g. callback functions), to avoid potentially identifying
+ // someone via ASLR. Pointers in ASLR are randomized on boot, which means pointers may be
+ // different between users but similar across a single user's sessions.
+ // As a convenience, any value <= 4096 is also printed, to catch small or null pointer errors.
+ std::unordered_set<uint64_t> printed_param_values{STREAM_RENDERER_PARAM_RENDERER_FLAGS,
+ STREAM_RENDERER_PARAM_WIN0_WIDTH,
+ STREAM_RENDERER_PARAM_WIN0_HEIGHT};
+
+ // We may have unknown parameters, so this function is lenient.
+ auto get_param_string = [&](uint64_t key) -> std::string {
+ auto param_string = param_strings.find(key);
+ if (param_string != param_strings.end()) {
+ return param_string->second;
+ } else {
+ return "Unknown param with key=" + std::to_string(key);
+ }
+ };
+
+ // Initialization data.
+ uint32_t display_width = 0;
+ uint32_t display_height = 0;
+ void* renderer_cookie = nullptr;
+ int renderer_flags = 0;
+ stream_renderer_fence_callback fence_callback = nullptr;
+ bool skip_opengles = false;
+
+ // Iterate all parameters that we support.
+ stream_renderer_info("Reading stream renderer parameters:");
+ for (uint64_t i = 0; i < num_params; ++i) {
+ stream_renderer_param& param = stream_renderer_params[i];
+
+ // Print out parameter we are processing. See comment above `printed_param_values` before
+ // adding new prints.
+ if (printed_param_values.find(param.key) != printed_param_values.end() ||
+ param.value <= 4096) {
+ stream_renderer_info("%s - %llu", get_param_string(param.key).c_str(),
+ static_cast<unsigned long long>(param.value));
+ } else {
+ // If not full value, print that it was passed.
+ stream_renderer_info("%s", get_param_string(param.key).c_str());
+ }
+
+ // Removing every param we process will leave required_params empty if all provided.
+ required_params.erase(param.key);
+
+ switch (param.key) {
+ case STREAM_RENDERER_PARAM_USER_DATA: {
+ renderer_cookie = reinterpret_cast<void*>(static_cast<uintptr_t>(param.value));
+ globalUserData = renderer_cookie;
+ break;
+ }
+ case STREAM_RENDERER_PARAM_RENDERER_FLAGS: {
+ renderer_flags = static_cast<int>(param.value);
+ break;
+ }
+ case STREAM_RENDERER_PARAM_FENCE_CALLBACK: {
+ fence_callback = reinterpret_cast<stream_renderer_fence_callback>(
+ static_cast<uintptr_t>(param.value));
+ break;
+ }
+ case STREAM_RENDERER_PARAM_WIN0_WIDTH: {
+ display_width = static_cast<uint32_t>(param.value);
+ break;
+ }
+ case STREAM_RENDERER_PARAM_WIN0_HEIGHT: {
+ display_height = static_cast<uint32_t>(param.value);
+ break;
+ }
+ case STREAM_RENDERER_PARAM_DEBUG_CALLBACK: {
+ globalDebugCallback = reinterpret_cast<stream_renderer_debug_callback>(
+ static_cast<uintptr_t>(param.value));
+ break;
+ }
+ case STREAM_RENDERER_SKIP_OPENGLES_INIT: {
+ skip_opengles = static_cast<bool>(param.value);
+ break;
+ }
+ case STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_INSTANT_EVENT: {
+ MetricsLogger::add_instant_event_callback =
+ reinterpret_cast<stream_renderer_param_metrics_callback_add_instant_event>(
+ static_cast<uintptr_t>(param.value));
+ break;
+ }
+ case STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_INSTANT_EVENT_WITH_DESCRIPTOR: {
+ MetricsLogger::add_instant_event_with_descriptor_callback = reinterpret_cast<
+ stream_renderer_param_metrics_callback_add_instant_event_with_descriptor>(
+ static_cast<uintptr_t>(param.value));
+ break;
+ }
+ case STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_INSTANT_EVENT_WITH_METRIC: {
+ MetricsLogger::add_instant_event_with_metric_callback = reinterpret_cast<
+ stream_renderer_param_metrics_callback_add_instant_event_with_metric>(
+ static_cast<uintptr_t>(param.value));
+ break;
+ }
+ case STREAM_RENDERER_PARAM_METRICS_CALLBACK_ADD_VULKAN_OUT_OF_MEMORY_EVENT: {
+ MetricsLogger::add_vulkan_out_of_memory_event = reinterpret_cast<
+ stream_renderer_param_metrics_callback_add_vulkan_out_of_memory_event>(
+ static_cast<uintptr_t>(param.value));
+ break;
+ }
+ case STREAM_RENDERER_PARAM_METRICS_CALLBACK_SET_ANNOTATION: {
+ MetricsLogger::set_crash_annotation_callback =
+ reinterpret_cast<stream_renderer_param_metrics_callback_set_annotation>(
+ static_cast<uintptr_t>(param.value));
+ break;
+ }
+ case STREAM_RENDERER_PARAM_METRICS_CALLBACK_ABORT: {
+ emugl::setDieFunction(
+ reinterpret_cast<stream_renderer_param_metrics_callback_abort>(
+ static_cast<uintptr_t>(param.value)));
+ break;
+ }
+ default: {
+ // We skip any parameters we don't recognize.
+ stream_renderer_error(
+ "Skipping unknown parameter key: %llu. May need to upgrade gfxstream.",
+ static_cast<unsigned long long>(param.key));
+ break;
+ }
+ }
+ }
+ stream_renderer_info("Finished reading parameters");
+
+ // Some required params not found.
+ if (required_params.size() > 0) {
+ stream_renderer_error("Missing required parameters:");
+ for (uint64_t param : required_params) {
+ stream_renderer_error("%s", get_param_string(param).c_str());
+ }
+ stream_renderer_error("Failing initialization intentionally");
+ return -EINVAL;
+ }
+
+ // Set non product-specific callbacks
+ gfxstream::vk::vk_util::setVkCheckCallbacks(
+ std::make_unique<gfxstream::vk::vk_util::VkCheckCallbacks>(
+ gfxstream::vk::vk_util::VkCheckCallbacks{
+ .onVkErrorOutOfMemory =
+ [](VkResult result, const char* function, int line) {
+ auto fb = gfxstream::FrameBuffer::getFB();
+ if (!fb) {
+ stream_renderer_error(
+ "FrameBuffer not yet initialized. Dropping out of memory event");
+ return;
+ }
+ fb->logVulkanOutOfMemory(result, function, line);
+ },
+ .onVkErrorOutOfMemoryOnAllocation =
+ [](VkResult result, const char* function, int line,
+ std::optional<uint64_t> allocationSize) {
+ auto fb = gfxstream::FrameBuffer::getFB();
+ if (!fb) {
+ stream_renderer_error(
+ "FrameBuffer not yet initialized. Dropping out of memory event");
+ return;
+ }
+ fb->logVulkanOutOfMemory(result, function, line, allocationSize);
+ }}));
+
+ if (!skip_opengles) {
+ // aemu currently does its own opengles initialization in
+ // qemu/android/android-emu/android/opengles.cpp.
+ int ret = stream_renderer_opengles_init(display_width, display_height, renderer_flags);
+ if (ret) {
+ return ret;
+ }
+ }
+
+ sRenderer()->init(renderer_cookie, renderer_flags, fence_callback);
+ gfxstream::FrameBuffer::waitUntilInitialized();
+
+ stream_renderer_info("Started renderer");
+ return 0;
+}
+
+VG_EXPORT void gfxstream_backend_setup_window(void* native_window_handle, int32_t window_x,
+ int32_t window_y, int32_t window_width,
+ int32_t window_height, int32_t fb_width,
+ int32_t fb_height) {
+ android_showOpenglesWindow(native_window_handle, window_x, window_y, window_width,
+ window_height, fb_width, fb_height, 1.0f, 0, false, false);
+}
+
+VG_EXPORT void stream_renderer_teardown() {
+ android_finishOpenglesRenderer();
+ android_hideOpenglesWindow();
+ android_stopOpenglesRenderer(true);
+}
+
+VG_EXPORT void gfxstream_backend_set_screen_mask(int width, int height,
+ const unsigned char* rgbaData) {
+ android_setOpenglesScreenMask(width, height, rgbaData);
+}
+
+const GoldfishPipeServiceOps* goldfish_pipe_get_service_ops() { return &goldfish_pipe_service_ops; }
+
+static_assert(sizeof(struct stream_renderer_device_id) == 32,
+ "stream_renderer_device_id must be 32 bytes");
+static_assert(offsetof(struct stream_renderer_device_id, device_uuid) == 0,
+ "stream_renderer_device_id.device_uuid must be at offset 0");
+static_assert(offsetof(struct stream_renderer_device_id, driver_uuid) == 16,
+ "stream_renderer_device_id.driver_uuid must be at offset 16");
+
+static_assert(sizeof(struct stream_renderer_vulkan_info) == 36,
+ "stream_renderer_vulkan_info must be 36 bytes");
+static_assert(offsetof(struct stream_renderer_vulkan_info, memory_index) == 0,
+ "stream_renderer_vulkan_info.memory_index must be at offset 0");
+static_assert(offsetof(struct stream_renderer_vulkan_info, device_id) == 4,
+ "stream_renderer_vulkan_info.device_id must be at offset 4");
+
+static_assert(sizeof(struct stream_renderer_param_host_visible_memory_mask_entry) == 36,
+ "stream_renderer_param_host_visible_memory_mask_entry must be 36 bytes");
+static_assert(offsetof(struct stream_renderer_param_host_visible_memory_mask_entry, device_id) == 0,
+ "stream_renderer_param_host_visible_memory_mask_entry.device_id must be at offset 0");
+static_assert(
+ offsetof(struct stream_renderer_param_host_visible_memory_mask_entry, memory_type_mask) == 32,
+ "stream_renderer_param_host_visible_memory_mask_entry.memory_type_mask must be at offset 32");
+
+static_assert(sizeof(struct stream_renderer_param_host_visible_memory_mask) == 16,
+ "stream_renderer_param_host_visible_memory_mask must be 16 bytes");
+static_assert(offsetof(struct stream_renderer_param_host_visible_memory_mask, entries) == 0,
+ "stream_renderer_param_host_visible_memory_mask.entries must be at offset 0");
+static_assert(offsetof(struct stream_renderer_param_host_visible_memory_mask, num_entries) == 8,
+ "stream_renderer_param_host_visible_memory_mask.num_entries must be at offset 8");
+
+static_assert(sizeof(struct stream_renderer_param) == 16, "stream_renderer_param must be 16 bytes");
+static_assert(offsetof(struct stream_renderer_param, key) == 0,
+ "stream_renderer_param.key must be at offset 0");
+static_assert(offsetof(struct stream_renderer_param, value) == 8,
+ "stream_renderer_param.value must be at offset 8");
+
+#ifdef CONFIG_AEMU
+
+VG_EXPORT void stream_renderer_set_service_ops(const GoldfishPipeServiceOps* ops) {
+ sRenderer()->setServiceOps(ops);
+}
+
+#endif // CONFIG_AEMU
+
+} // extern "C"
diff --git a/src/gfxstream/host/vulkan/BorrowedImageVk.cpp b/src/gfxstream/host/vulkan/BorrowedImageVk.cpp
new file mode 100644
index 00000000000..9d11a7c4352
--- /dev/null
+++ b/src/gfxstream/host/vulkan/BorrowedImageVk.cpp
@@ -0,0 +1,119 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "BorrowedImageVk.h"
+
+namespace gfxstream {
+namespace vk {
+
+void addNeededBarriersToUseBorrowedImage(
+ const BorrowedImageInfoVk& borrowedImageInfo, uint32_t usedQueueFamilyIndex,
+ VkImageLayout usedInitialImageLayout, VkImageLayout usedFinalImageLayout,
+ VkAccessFlags usedAccessMask, std::vector<VkImageMemoryBarrier>* preUseQueueTransferBarriers,
+ std::vector<VkImageMemoryBarrier>* preUseLayoutTransitionBarriers,
+ std::vector<VkImageMemoryBarrier>* postUseLayoutTransitionBarriers,
+ std::vector<VkImageMemoryBarrier>* postUseQueueTransferBarriers) {
+ if (borrowedImageInfo.preBorrowQueueFamilyIndex != usedQueueFamilyIndex) {
+ const VkImageMemoryBarrier queueTransferBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .oldLayout = borrowedImageInfo.preBorrowLayout,
+ .newLayout = borrowedImageInfo.preBorrowLayout,
+ .srcQueueFamilyIndex = borrowedImageInfo.preBorrowQueueFamilyIndex,
+ .dstQueueFamilyIndex = usedQueueFamilyIndex,
+ .image = borrowedImageInfo.image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ preUseQueueTransferBarriers->emplace_back(queueTransferBarrier);
+ }
+ if (borrowedImageInfo.preBorrowLayout != usedInitialImageLayout &&
+ usedInitialImageLayout != VK_IMAGE_LAYOUT_UNDEFINED) {
+ const VkImageMemoryBarrier layoutTransitionBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .dstAccessMask = usedAccessMask,
+ .oldLayout = borrowedImageInfo.preBorrowLayout,
+ .newLayout = usedInitialImageLayout,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = borrowedImageInfo.image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ preUseLayoutTransitionBarriers->emplace_back(layoutTransitionBarrier);
+ }
+ if (borrowedImageInfo.postBorrowLayout != usedFinalImageLayout) {
+ const VkImageMemoryBarrier layoutTransitionBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = usedAccessMask,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .oldLayout = usedFinalImageLayout,
+ .newLayout = borrowedImageInfo.postBorrowLayout,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = borrowedImageInfo.image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ postUseLayoutTransitionBarriers->emplace_back(layoutTransitionBarrier);
+ }
+ if (borrowedImageInfo.postBorrowQueueFamilyIndex != usedQueueFamilyIndex) {
+ const VkImageMemoryBarrier queueTransferBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .oldLayout = borrowedImageInfo.postBorrowLayout,
+ .newLayout = borrowedImageInfo.postBorrowLayout,
+ .srcQueueFamilyIndex = usedQueueFamilyIndex,
+ .dstQueueFamilyIndex = borrowedImageInfo.postBorrowQueueFamilyIndex,
+ .image = borrowedImageInfo.image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ postUseQueueTransferBarriers->emplace_back(queueTransferBarrier);
+ }
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/BorrowedImageVk.h b/src/gfxstream/host/vulkan/BorrowedImageVk.h
new file mode 100644
index 00000000000..0a422177db8
--- /dev/null
+++ b/src/gfxstream/host/vulkan/BorrowedImageVk.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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <cstdint>
+#include <vector>
+
+#include "BorrowedImage.h"
+#include "goldfish_vk_dispatch.h"
+
+namespace gfxstream {
+namespace vk {
+
+struct BorrowedImageInfoVk : public BorrowedImageInfo {
+ VkImage image = VK_NULL_HANDLE;
+ VkImageView imageView = VK_NULL_HANDLE;
+ VkImageCreateInfo imageCreateInfo = {};
+
+ // The image layout that `image` is in before composition.
+ //
+ // This is currently ignored for composition target images as
+ // composition targets are expected to be cleared during
+ // composition.
+ VkImageLayout preBorrowLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+
+ // The queue family index that owns `image` before composition.
+ uint32_t preBorrowQueueFamilyIndex = 0;
+
+ // The image layout that `image` should be transitioned to
+ // after composition.
+ //
+ // This is currently ignored for composition target images as
+ // composition targets are expected to be transitioned to
+ // VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL after composition for
+ // blitting to display images.
+ VkImageLayout postBorrowLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+
+ // The queue family index that `image` should be transitioned to
+ // after composition.
+ uint32_t postBorrowQueueFamilyIndex = 0;
+};
+
+// The caller should always record the queue transfer barriers with stages that supoort
+// VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT.
+void addNeededBarriersToUseBorrowedImage(
+ const BorrowedImageInfoVk& borrowedImageInfo, uint32_t usedQueueFamilyIndex,
+ VkImageLayout usedInitialImageLayout, VkImageLayout usedFinalImageLayout,
+ VkAccessFlags usedAccessMask, std::vector<VkImageMemoryBarrier>* preUseQueueTransferBarriers,
+ std::vector<VkImageMemoryBarrier>* preUseLayoutTransitionBarriers,
+ std::vector<VkImageMemoryBarrier>* postUseLayoutTransitionBarriers,
+ std::vector<VkImageMemoryBarrier>* postUseQueueTransferBarriers);
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/BufferVk.cpp b/src/gfxstream/host/vulkan/BufferVk.cpp
new file mode 100644
index 00000000000..46f454049cf
--- /dev/null
+++ b/src/gfxstream/host/vulkan/BufferVk.cpp
@@ -0,0 +1,49 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "BufferVk.h"
+
+#include "VkCommonOperations.h"
+
+namespace gfxstream {
+namespace vk {
+
+/*static*/
+std::unique_ptr<BufferVk> BufferVk::create(uint32_t handle, uint64_t size, bool vulkanOnly) {
+ if (!setupVkBuffer(size, handle, vulkanOnly, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) {
+ ERR("Failed to create BufferVk:%d", handle);
+ return nullptr;
+ }
+
+ return std::unique_ptr<BufferVk>(new BufferVk(handle));
+}
+
+BufferVk::BufferVk(uint32_t handle) : mHandle(handle) {}
+
+BufferVk::~BufferVk() {
+ if (!teardownVkBuffer(mHandle)) {
+ ERR("Failed to destroy BufferVk:%d", mHandle);
+ }
+}
+
+void BufferVk::readToBytes(uint64_t offset, uint64_t size, void* outBytes) {
+ readBufferToBytes(mHandle, offset, size, outBytes);
+}
+
+bool BufferVk::updateFromBytes(uint64_t offset, uint64_t size, const void* bytes) {
+ return updateBufferFromBytes(mHandle, offset, size, bytes);
+}
+
+} // namespace vk
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/BufferVk.h b/src/gfxstream/host/vulkan/BufferVk.h
new file mode 100644
index 00000000000..9016fd745a1
--- /dev/null
+++ b/src/gfxstream/host/vulkan/BufferVk.h
@@ -0,0 +1,38 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <memory>
+#include <vector>
+
+namespace gfxstream {
+namespace vk {
+
+class BufferVk {
+ public:
+ static std::unique_ptr<BufferVk> create(uint32_t handle, uint64_t size, bool vulkanOnly);
+
+ ~BufferVk();
+
+ void readToBytes(uint64_t offset, uint64_t size, void* outBytes);
+
+ bool updateFromBytes(uint64_t offset, uint64_t size, const void* bytes);
+
+ private:
+ BufferVk(uint32_t handle);
+
+ const uint32_t mHandle;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/CMakeLists.txt b/src/gfxstream/host/vulkan/CMakeLists.txt
new file mode 100644
index 00000000000..80e6ab196b5
--- /dev/null
+++ b/src/gfxstream/host/vulkan/CMakeLists.txt
@@ -0,0 +1,64 @@
+add_subdirectory(cereal)
+add_subdirectory(emulated_textures)
+
+add_library(gfxstream-vulkan-server
+ BorrowedImageVk.cpp
+ BufferVk.cpp
+ ColorBufferVk.cpp
+ CompositorVk.cpp
+ DisplayVk.cpp
+ DisplaySurfaceVk.cpp
+ DebugUtilsHelper.cpp
+ PostWorkerVk.cpp
+ SwapChainStateVk.cpp
+ RenderThreadInfoVk.cpp
+ VkAndroidNativeBuffer.cpp
+ VkCommonOperations.cpp
+ VkDecoder.cpp
+ VkDecoderGlobalState.cpp
+ VkDecoderSnapshot.cpp
+ VkFormatUtils.cpp
+ VkReconstruction.cpp
+ VulkanDispatch.cpp
+ VulkanHandleMapping.cpp
+ VulkanStream.cpp
+ vk_util.cpp)
+set_source_files_properties(VkDecoder.cpp PROPERTIES COMPILE_FLAGS -Wno-unused-variable)
+
+target_link_libraries(gfxstream-vulkan-server PUBLIC
+ OpenglRender_vulkan_cereal
+ gfxstream-compressedTextures
+ emulated_textures
+ apigen-codec-common
+ aemu-base.headers
+ gfxstream-snapshot.headers
+ gfxstream_utils
+ gfxstream_vulkan_headers
+ PRIVATE
+ gfxstream_egl_headers)
+
+if (WIN32)
+target_compile_definitions(gfxstream-vulkan-server PRIVATE -DVK_USE_PLATFORM_WIN32_KHR)
+elseif (APPLE)
+target_compile_definitions(gfxstream-vulkan-server PRIVATE -DVK_USE_PLATFORM_METAL_EXT)
+elseif (QNX)
+target_compile_definitions(gfxstream-vulkan-server PRIVATE -DVK_USE_PLATFORM_SCREEN_QNX)
+endif()
+
+if (NOT MSVC)
+ target_compile_options(gfxstream-vulkan-server PRIVATE -fvisibility=hidden)
+endif()
+target_compile_options(gfxstream-vulkan-server PRIVATE -Wno-unused-value -Wno-return-type -Wno-return-type-c-linkage)
+
+target_include_directories(gfxstream-vulkan-server
+ PUBLIC
+ ${GFXSTREAM_REPO_ROOT}/vulkan
+ ${GFXSTREAM_REPO_ROOT}/vulkan/cereal
+ PRIVATE
+ ${GFXSTREAM_REPO_ROOT}
+ ${GFXSTREAM_REPO_ROOT}/include
+ ${GFXSTREAM_REPO_ROOT}/host
+ ${GFXSTREAM_REPO_ROOT}/host/vulkan
+ ${GFXSTREAM_REPO_ROOT}/host/vulkan/cereal/common
+ ${GFXSTREAM_REPO_ROOT}/host/apigen-codec-common
+ ${GFXSTREAM_REPO_ROOT}/third-party/glm/include)
diff --git a/src/gfxstream/host/vulkan/ColorBufferVk.cpp b/src/gfxstream/host/vulkan/ColorBufferVk.cpp
new file mode 100644
index 00000000000..0d569b39cb7
--- /dev/null
+++ b/src/gfxstream/host/vulkan/ColorBufferVk.cpp
@@ -0,0 +1,71 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "ColorBufferVk.h"
+
+#include "VkCommonOperations.h"
+
+namespace gfxstream {
+namespace vk {
+
+/*static*/
+std::unique_ptr<ColorBufferVk> ColorBufferVk::create(uint32_t handle, uint32_t width,
+ uint32_t height, GLenum format,
+ FrameworkFormat frameworkFormat,
+ bool vulkanOnly, uint32_t memoryProperty) {
+ if (!createVkColorBuffer(width, height, format, frameworkFormat, handle, vulkanOnly,
+ memoryProperty)) {
+ GL_LOG("Failed to create ColorBufferVk:%d", handle);
+ return nullptr;
+ }
+
+ return std::unique_ptr<ColorBufferVk>(new ColorBufferVk(handle));
+}
+
+ColorBufferVk::ColorBufferVk(uint32_t handle) : mHandle(handle) {}
+
+ColorBufferVk::~ColorBufferVk() {
+ if (!teardownVkColorBuffer(mHandle)) {
+ ERR("Failed to destroy ColorBufferVk:%d", mHandle);
+ }
+}
+
+bool ColorBufferVk::readToBytes(std::vector<uint8_t>* outBytes) {
+ return readColorBufferToBytes(mHandle, outBytes);
+}
+
+bool ColorBufferVk::readToBytes(uint32_t x, uint32_t y, uint32_t w, uint32_t h, void* outBytes) {
+ return readColorBufferToBytes(mHandle, x, y, w, h, outBytes);
+}
+
+bool ColorBufferVk::updateFromBytes(const std::vector<uint8_t>& bytes) {
+ return updateColorBufferFromBytes(mHandle, bytes);
+}
+
+bool ColorBufferVk::updateFromBytes(uint32_t x, uint32_t y, uint32_t w, uint32_t h,
+ const void* bytes) {
+ return updateColorBufferFromBytes(mHandle, x, y, w, h, bytes);
+}
+
+bool ColorBufferVk::importExtMemoryHandle(void* nativeResource, uint32_t type,
+ bool preserveContent) {
+ // TODO: Any need to support preserveContent?
+ assert(!preserveContent);
+ VK_EXT_MEMORY_HANDLE extMemoryHandle =
+ *reinterpret_cast<VK_EXT_MEMORY_HANDLE*>(&nativeResource);
+ return importExtMemoryHandleToVkColorBuffer(mHandle, type, extMemoryHandle);
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/ColorBufferVk.h b/src/gfxstream/host/vulkan/ColorBufferVk.h
new file mode 100644
index 00000000000..8364c937ed5
--- /dev/null
+++ b/src/gfxstream/host/vulkan/ColorBufferVk.h
@@ -0,0 +1,48 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <GLES2/gl2.h>
+
+#include <memory>
+#include <vector>
+
+#include "FrameworkFormats.h"
+
+namespace gfxstream {
+namespace vk {
+
+class ColorBufferVk {
+ public:
+ static std::unique_ptr<ColorBufferVk> create(uint32_t handle, uint32_t width, uint32_t height,
+ GLenum format, FrameworkFormat frameworkFormat,
+ bool vulkanOnly, uint32_t memoryProperty);
+
+ ~ColorBufferVk();
+
+ bool readToBytes(std::vector<uint8_t>* outBytes);
+ bool readToBytes(uint32_t x, uint32_t y, uint32_t w, uint32_t h, void* outBytes);
+
+ bool updateFromBytes(const std::vector<uint8_t>& bytes);
+ bool updateFromBytes(uint32_t x, uint32_t y, uint32_t w, uint32_t h, const void* bytes);
+
+ bool importExtMemoryHandle(void* nativeResource, uint32_t type, bool preserveContent);
+
+ private:
+ ColorBufferVk(uint32_t handle);
+
+ const uint32_t mHandle;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/Compositor.frag b/src/gfxstream/host/vulkan/Compositor.frag
new file mode 100644
index 00000000000..060441e863d
--- /dev/null
+++ b/src/gfxstream/host/vulkan/Compositor.frag
@@ -0,0 +1,25 @@
+#version 450
+#extension GL_ARB_separate_shader_objects : enable
+
+layout(binding = 0) uniform sampler2D texSampler;
+layout(binding = 1) uniform UniformBufferObject {
+ mat4 posTransform;
+ mat4 texcoordTransform;
+ uvec4 mode;
+ vec4 alpha;
+ vec4 color;
+} ubo;
+
+layout(location = 0) in vec2 fragTexCoord;
+
+layout(location = 0) out vec4 outColor;
+
+void main() {
+ if (ubo.mode.x == 2) {
+ outColor = ubo.alpha * texture(texSampler, fragTexCoord);
+ } else if (ubo.mode.x == 3) {
+ outColor = ubo.alpha * ubo.color;
+ } else {
+ outColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+}
diff --git a/src/gfxstream/host/vulkan/Compositor.vert b/src/gfxstream/host/vulkan/Compositor.vert
new file mode 100644
index 00000000000..77953876574
--- /dev/null
+++ b/src/gfxstream/host/vulkan/Compositor.vert
@@ -0,0 +1,20 @@
+#version 450
+#extension GL_ARB_separate_shader_objects : enable
+
+layout(binding = 1) uniform UniformBufferObject {
+ mat4 posTransform;
+ mat4 texcoordTransform;
+ uvec4 mode;
+ vec4 alpha;
+ vec4 color;
+} ubo;
+
+layout(location = 0) in vec2 inPosition;
+layout(location = 1) in vec2 texCoord;
+
+layout(location = 0) out vec2 fragTexCoord;
+
+void main() {
+ gl_Position = vec4((ubo.posTransform * vec4(inPosition, 0.0, 1.0)).xy, 0.0, 1.0);
+ fragTexCoord = (ubo.texcoordTransform * vec4(texCoord, 0.0, 1.0)).xy;
+}
diff --git a/src/gfxstream/host/vulkan/CompositorFragmentShader.h b/src/gfxstream/host/vulkan/CompositorFragmentShader.h
new file mode 100644
index 00000000000..4e87c209ff2
--- /dev/null
+++ b/src/gfxstream/host/vulkan/CompositorFragmentShader.h
@@ -0,0 +1,136 @@
+// Copyright (C) 2023 The Android Open Source Project
+// Copyright (C) 2023 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 host/vulkan/CompositorFragmentShader.h
+// generated by python3 scripts/glsl-shader-to-spv-c-array.py host/vulkan/Compositor.frag host/vulkan/CompositorFragmentShader.h compositorFragmentShader
+// Please do not modify directly.
+
+#include <stdint.h>
+
+const uint32_t compositorFragmentShader[] = {
+0x07230203, 0x00010000, 0x000d000a, 0x0000003b,
+0x00000000, 0x00020011, 0x00000001, 0x0006000b,
+0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e,
+0x00000000, 0x0003000e, 0x00000000, 0x00000001,
+0x0007000f, 0x00000004, 0x00000004, 0x6e69616d,
+0x00000000, 0x0000001a, 0x00000026, 0x00030010,
+0x00000004, 0x00000007, 0x00030003, 0x00000002,
+0x000001c2, 0x00090004, 0x415f4c47, 0x735f4252,
+0x72617065, 0x5f657461, 0x64616873, 0x6f5f7265,
+0x63656a62, 0x00007374, 0x000a0004, 0x475f4c47,
+0x4c474f4f, 0x70635f45, 0x74735f70, 0x5f656c79,
+0x656e696c, 0x7269645f, 0x69746365, 0x00006576,
+0x00080004, 0x475f4c47, 0x4c474f4f, 0x6e695f45,
+0x64756c63, 0x69645f65, 0x74636572, 0x00657669,
+0x00040005, 0x00000004, 0x6e69616d, 0x00000000,
+0x00070005, 0x0000000b, 0x66696e55, 0x426d726f,
+0x65666675, 0x6a624f72, 0x00746365, 0x00070006,
+0x0000000b, 0x00000000, 0x54736f70, 0x736e6172,
+0x6d726f66, 0x00000000, 0x00080006, 0x0000000b,
+0x00000001, 0x63786574, 0x64726f6f, 0x6e617254,
+0x726f6673, 0x0000006d, 0x00050006, 0x0000000b,
+0x00000002, 0x65646f6d, 0x00000000, 0x00050006,
+0x0000000b, 0x00000003, 0x68706c61, 0x00000061,
+0x00050006, 0x0000000b, 0x00000004, 0x6f6c6f63,
+0x00000072, 0x00030005, 0x0000000d, 0x006f6275,
+0x00050005, 0x0000001a, 0x4374756f, 0x726f6c6f,
+0x00000000, 0x00050005, 0x00000022, 0x53786574,
+0x6c706d61, 0x00007265, 0x00060005, 0x00000026,
+0x67617266, 0x43786554, 0x64726f6f, 0x00000000,
+0x00040048, 0x0000000b, 0x00000000, 0x00000005,
+0x00050048, 0x0000000b, 0x00000000, 0x00000023,
+0x00000000, 0x00050048, 0x0000000b, 0x00000000,
+0x00000007, 0x00000010, 0x00040048, 0x0000000b,
+0x00000001, 0x00000005, 0x00050048, 0x0000000b,
+0x00000001, 0x00000023, 0x00000040, 0x00050048,
+0x0000000b, 0x00000001, 0x00000007, 0x00000010,
+0x00050048, 0x0000000b, 0x00000002, 0x00000023,
+0x00000080, 0x00050048, 0x0000000b, 0x00000003,
+0x00000023, 0x00000090, 0x00050048, 0x0000000b,
+0x00000004, 0x00000023, 0x000000a0, 0x00030047,
+0x0000000b, 0x00000002, 0x00040047, 0x0000000d,
+0x00000022, 0x00000000, 0x00040047, 0x0000000d,
+0x00000021, 0x00000001, 0x00040047, 0x0000001a,
+0x0000001e, 0x00000000, 0x00040047, 0x00000022,
+0x00000022, 0x00000000, 0x00040047, 0x00000022,
+0x00000021, 0x00000000, 0x00040047, 0x00000026,
+0x0000001e, 0x00000000, 0x00020013, 0x00000002,
+0x00030021, 0x00000003, 0x00000002, 0x00030016,
+0x00000006, 0x00000020, 0x00040017, 0x00000007,
+0x00000006, 0x00000004, 0x00040018, 0x00000008,
+0x00000007, 0x00000004, 0x00040015, 0x00000009,
+0x00000020, 0x00000000, 0x00040017, 0x0000000a,
+0x00000009, 0x00000004, 0x0007001e, 0x0000000b,
+0x00000008, 0x00000008, 0x0000000a, 0x00000007,
+0x00000007, 0x00040020, 0x0000000c, 0x00000002,
+0x0000000b, 0x0004003b, 0x0000000c, 0x0000000d,
+0x00000002, 0x00040015, 0x0000000e, 0x00000020,
+0x00000001, 0x0004002b, 0x0000000e, 0x0000000f,
+0x00000002, 0x0004002b, 0x00000009, 0x00000010,
+0x00000000, 0x00040020, 0x00000011, 0x00000002,
+0x00000009, 0x0004002b, 0x00000009, 0x00000014,
+0x00000002, 0x00020014, 0x00000015, 0x00040020,
+0x00000019, 0x00000003, 0x00000007, 0x0004003b,
+0x00000019, 0x0000001a, 0x00000003, 0x0004002b,
+0x0000000e, 0x0000001b, 0x00000003, 0x00040020,
+0x0000001c, 0x00000002, 0x00000007, 0x00090019,
+0x0000001f, 0x00000006, 0x00000001, 0x00000000,
+0x00000000, 0x00000000, 0x00000001, 0x00000000,
+0x0003001b, 0x00000020, 0x0000001f, 0x00040020,
+0x00000021, 0x00000000, 0x00000020, 0x0004003b,
+0x00000021, 0x00000022, 0x00000000, 0x00040017,
+0x00000024, 0x00000006, 0x00000002, 0x00040020,
+0x00000025, 0x00000001, 0x00000024, 0x0004003b,
+0x00000025, 0x00000026, 0x00000001, 0x0004002b,
+0x00000009, 0x0000002d, 0x00000003, 0x0004002b,
+0x0000000e, 0x00000033, 0x00000004, 0x0004002b,
+0x00000006, 0x00000038, 0x00000000, 0x0004002b,
+0x00000006, 0x00000039, 0x3f800000, 0x0007002c,
+0x00000007, 0x0000003a, 0x00000038, 0x00000039,
+0x00000038, 0x00000039, 0x00050036, 0x00000002,
+0x00000004, 0x00000000, 0x00000003, 0x000200f8,
+0x00000005, 0x00060041, 0x00000011, 0x00000012,
+0x0000000d, 0x0000000f, 0x00000010, 0x0004003d,
+0x00000009, 0x00000013, 0x00000012, 0x000500aa,
+0x00000015, 0x00000016, 0x00000013, 0x00000014,
+0x000300f7, 0x00000018, 0x00000000, 0x000400fa,
+0x00000016, 0x00000017, 0x0000002a, 0x000200f8,
+0x00000017, 0x00050041, 0x0000001c, 0x0000001d,
+0x0000000d, 0x0000001b, 0x0004003d, 0x00000007,
+0x0000001e, 0x0000001d, 0x0004003d, 0x00000020,
+0x00000023, 0x00000022, 0x0004003d, 0x00000024,
+0x00000027, 0x00000026, 0x00050057, 0x00000007,
+0x00000028, 0x00000023, 0x00000027, 0x00050085,
+0x00000007, 0x00000029, 0x0000001e, 0x00000028,
+0x0003003e, 0x0000001a, 0x00000029, 0x000200f9,
+0x00000018, 0x000200f8, 0x0000002a, 0x00060041,
+0x00000011, 0x0000002b, 0x0000000d, 0x0000000f,
+0x00000010, 0x0004003d, 0x00000009, 0x0000002c,
+0x0000002b, 0x000500aa, 0x00000015, 0x0000002e,
+0x0000002c, 0x0000002d, 0x000300f7, 0x00000030,
+0x00000000, 0x000400fa, 0x0000002e, 0x0000002f,
+0x00000037, 0x000200f8, 0x0000002f, 0x00050041,
+0x0000001c, 0x00000031, 0x0000000d, 0x0000001b,
+0x0004003d, 0x00000007, 0x00000032, 0x00000031,
+0x00050041, 0x0000001c, 0x00000034, 0x0000000d,
+0x00000033, 0x0004003d, 0x00000007, 0x00000035,
+0x00000034, 0x00050085, 0x00000007, 0x00000036,
+0x00000032, 0x00000035, 0x0003003e, 0x0000001a,
+0x00000036, 0x000200f9, 0x00000030, 0x000200f8,
+0x00000037, 0x0003003e, 0x0000001a, 0x0000003a,
+0x000200f9, 0x00000030, 0x000200f8, 0x00000030,
+0x000200f9, 0x00000018, 0x000200f8, 0x00000018,
+0x000100fd, 0x00010038
+}; \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/CompositorVertexShader.h b/src/gfxstream/host/vulkan/CompositorVertexShader.h
new file mode 100644
index 00000000000..b30527af8f6
--- /dev/null
+++ b/src/gfxstream/host/vulkan/CompositorVertexShader.h
@@ -0,0 +1,142 @@
+// Copyright (C) 2023 The Android Open Source Project
+// Copyright (C) 2023 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 host/vulkan/CompositorVertexShader.h
+// generated by python3 scripts/glsl-shader-to-spv-c-array.py host/vulkan/Compositor.vert host/vulkan/CompositorVertexShader.h compositorVertexShader
+// Please do not modify directly.
+
+#include <stdint.h>
+
+const uint32_t compositorVertexShader[] = {
+0x07230203, 0x00010000, 0x000d000a, 0x00000034,
+0x00000000, 0x00020011, 0x00000001, 0x0006000b,
+0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e,
+0x00000000, 0x0003000e, 0x00000000, 0x00000001,
+0x0009000f, 0x00000000, 0x00000004, 0x6e69616d,
+0x00000000, 0x0000000d, 0x0000001a, 0x00000029,
+0x0000002d, 0x00030003, 0x00000002, 0x000001c2,
+0x00090004, 0x415f4c47, 0x735f4252, 0x72617065,
+0x5f657461, 0x64616873, 0x6f5f7265, 0x63656a62,
+0x00007374, 0x000a0004, 0x475f4c47, 0x4c474f4f,
+0x70635f45, 0x74735f70, 0x5f656c79, 0x656e696c,
+0x7269645f, 0x69746365, 0x00006576, 0x00080004,
+0x475f4c47, 0x4c474f4f, 0x6e695f45, 0x64756c63,
+0x69645f65, 0x74636572, 0x00657669, 0x00040005,
+0x00000004, 0x6e69616d, 0x00000000, 0x00060005,
+0x0000000b, 0x505f6c67, 0x65567265, 0x78657472,
+0x00000000, 0x00060006, 0x0000000b, 0x00000000,
+0x505f6c67, 0x7469736f, 0x006e6f69, 0x00070006,
+0x0000000b, 0x00000001, 0x505f6c67, 0x746e696f,
+0x657a6953, 0x00000000, 0x00070006, 0x0000000b,
+0x00000002, 0x435f6c67, 0x4470696c, 0x61747369,
+0x0065636e, 0x00070006, 0x0000000b, 0x00000003,
+0x435f6c67, 0x446c6c75, 0x61747369, 0x0065636e,
+0x00030005, 0x0000000d, 0x00000000, 0x00070005,
+0x00000012, 0x66696e55, 0x426d726f, 0x65666675,
+0x6a624f72, 0x00746365, 0x00070006, 0x00000012,
+0x00000000, 0x54736f70, 0x736e6172, 0x6d726f66,
+0x00000000, 0x00080006, 0x00000012, 0x00000001,
+0x63786574, 0x64726f6f, 0x6e617254, 0x726f6673,
+0x0000006d, 0x00050006, 0x00000012, 0x00000002,
+0x65646f6d, 0x00000000, 0x00050006, 0x00000012,
+0x00000003, 0x68706c61, 0x00000061, 0x00050006,
+0x00000012, 0x00000004, 0x6f6c6f63, 0x00000072,
+0x00030005, 0x00000014, 0x006f6275, 0x00050005,
+0x0000001a, 0x6f506e69, 0x69746973, 0x00006e6f,
+0x00060005, 0x00000029, 0x67617266, 0x43786554,
+0x64726f6f, 0x00000000, 0x00050005, 0x0000002d,
+0x43786574, 0x64726f6f, 0x00000000, 0x00050048,
+0x0000000b, 0x00000000, 0x0000000b, 0x00000000,
+0x00050048, 0x0000000b, 0x00000001, 0x0000000b,
+0x00000001, 0x00050048, 0x0000000b, 0x00000002,
+0x0000000b, 0x00000003, 0x00050048, 0x0000000b,
+0x00000003, 0x0000000b, 0x00000004, 0x00030047,
+0x0000000b, 0x00000002, 0x00040048, 0x00000012,
+0x00000000, 0x00000005, 0x00050048, 0x00000012,
+0x00000000, 0x00000023, 0x00000000, 0x00050048,
+0x00000012, 0x00000000, 0x00000007, 0x00000010,
+0x00040048, 0x00000012, 0x00000001, 0x00000005,
+0x00050048, 0x00000012, 0x00000001, 0x00000023,
+0x00000040, 0x00050048, 0x00000012, 0x00000001,
+0x00000007, 0x00000010, 0x00050048, 0x00000012,
+0x00000002, 0x00000023, 0x00000080, 0x00050048,
+0x00000012, 0x00000003, 0x00000023, 0x00000090,
+0x00050048, 0x00000012, 0x00000004, 0x00000023,
+0x000000a0, 0x00030047, 0x00000012, 0x00000002,
+0x00040047, 0x00000014, 0x00000022, 0x00000000,
+0x00040047, 0x00000014, 0x00000021, 0x00000001,
+0x00040047, 0x0000001a, 0x0000001e, 0x00000000,
+0x00040047, 0x00000029, 0x0000001e, 0x00000000,
+0x00040047, 0x0000002d, 0x0000001e, 0x00000001,
+0x00020013, 0x00000002, 0x00030021, 0x00000003,
+0x00000002, 0x00030016, 0x00000006, 0x00000020,
+0x00040017, 0x00000007, 0x00000006, 0x00000004,
+0x00040015, 0x00000008, 0x00000020, 0x00000000,
+0x0004002b, 0x00000008, 0x00000009, 0x00000001,
+0x0004001c, 0x0000000a, 0x00000006, 0x00000009,
+0x0006001e, 0x0000000b, 0x00000007, 0x00000006,
+0x0000000a, 0x0000000a, 0x00040020, 0x0000000c,
+0x00000003, 0x0000000b, 0x0004003b, 0x0000000c,
+0x0000000d, 0x00000003, 0x00040015, 0x0000000e,
+0x00000020, 0x00000001, 0x0004002b, 0x0000000e,
+0x0000000f, 0x00000000, 0x00040018, 0x00000010,
+0x00000007, 0x00000004, 0x00040017, 0x00000011,
+0x00000008, 0x00000004, 0x0007001e, 0x00000012,
+0x00000010, 0x00000010, 0x00000011, 0x00000007,
+0x00000007, 0x00040020, 0x00000013, 0x00000002,
+0x00000012, 0x0004003b, 0x00000013, 0x00000014,
+0x00000002, 0x00040020, 0x00000015, 0x00000002,
+0x00000010, 0x00040017, 0x00000018, 0x00000006,
+0x00000002, 0x00040020, 0x00000019, 0x00000001,
+0x00000018, 0x0004003b, 0x00000019, 0x0000001a,
+0x00000001, 0x0004002b, 0x00000006, 0x0000001c,
+0x00000000, 0x0004002b, 0x00000006, 0x0000001d,
+0x3f800000, 0x00040020, 0x00000026, 0x00000003,
+0x00000007, 0x00040020, 0x00000028, 0x00000003,
+0x00000018, 0x0004003b, 0x00000028, 0x00000029,
+0x00000003, 0x0004002b, 0x0000000e, 0x0000002a,
+0x00000001, 0x0004003b, 0x00000019, 0x0000002d,
+0x00000001, 0x00050036, 0x00000002, 0x00000004,
+0x00000000, 0x00000003, 0x000200f8, 0x00000005,
+0x00050041, 0x00000015, 0x00000016, 0x00000014,
+0x0000000f, 0x0004003d, 0x00000010, 0x00000017,
+0x00000016, 0x0004003d, 0x00000018, 0x0000001b,
+0x0000001a, 0x00050051, 0x00000006, 0x0000001e,
+0x0000001b, 0x00000000, 0x00050051, 0x00000006,
+0x0000001f, 0x0000001b, 0x00000001, 0x00070050,
+0x00000007, 0x00000020, 0x0000001e, 0x0000001f,
+0x0000001c, 0x0000001d, 0x00050091, 0x00000007,
+0x00000021, 0x00000017, 0x00000020, 0x0007004f,
+0x00000018, 0x00000022, 0x00000021, 0x00000021,
+0x00000000, 0x00000001, 0x00050051, 0x00000006,
+0x00000023, 0x00000022, 0x00000000, 0x00050051,
+0x00000006, 0x00000024, 0x00000022, 0x00000001,
+0x00070050, 0x00000007, 0x00000025, 0x00000023,
+0x00000024, 0x0000001c, 0x0000001d, 0x00050041,
+0x00000026, 0x00000027, 0x0000000d, 0x0000000f,
+0x0003003e, 0x00000027, 0x00000025, 0x00050041,
+0x00000015, 0x0000002b, 0x00000014, 0x0000002a,
+0x0004003d, 0x00000010, 0x0000002c, 0x0000002b,
+0x0004003d, 0x00000018, 0x0000002e, 0x0000002d,
+0x00050051, 0x00000006, 0x0000002f, 0x0000002e,
+0x00000000, 0x00050051, 0x00000006, 0x00000030,
+0x0000002e, 0x00000001, 0x00070050, 0x00000007,
+0x00000031, 0x0000002f, 0x00000030, 0x0000001c,
+0x0000001d, 0x00050091, 0x00000007, 0x00000032,
+0x0000002c, 0x00000031, 0x0007004f, 0x00000018,
+0x00000033, 0x00000032, 0x00000032, 0x00000000,
+0x00000001, 0x0003003e, 0x00000029, 0x00000033,
+0x000100fd, 0x00010038
+}; \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/CompositorVk.cpp b/src/gfxstream/host/vulkan/CompositorVk.cpp
new file mode 100644
index 00000000000..e861e13610e
--- /dev/null
+++ b/src/gfxstream/host/vulkan/CompositorVk.cpp
@@ -0,0 +1,1349 @@
+#include "CompositorVk.h"
+
+#include <string.h>
+
+#include <cinttypes>
+#include <glm/gtc/matrix_transform.hpp>
+#include <optional>
+
+#include "host-common/logging.h"
+#include "vulkan/vk_enum_string_helper.h"
+#include "vulkan/vk_util.h"
+
+namespace gfxstream {
+namespace vk {
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+namespace CompositorVkShader {
+#include "vulkan/CompositorFragmentShader.h"
+#include "vulkan/CompositorVertexShader.h"
+} // namespace CompositorVkShader
+
+namespace {
+
+constexpr const VkImageLayout kSourceImageInitialLayoutUsed =
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
+constexpr const VkImageLayout kSourceImageFinalLayoutUsed =
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
+
+constexpr const VkImageLayout kTargetImageInitialLayoutUsed = VK_IMAGE_LAYOUT_UNDEFINED;
+constexpr const VkImageLayout kTargetImageFinalLayoutUsed = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
+
+const BorrowedImageInfoVk* getInfoOrAbort(const std::unique_ptr<BorrowedImageInfo>& info) {
+ auto imageVk = static_cast<const BorrowedImageInfoVk*>(info.get());
+ if (imageVk != nullptr) {
+ return imageVk;
+ }
+
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "CompositorVk did not find BorrowedImageInfoVk";
+}
+
+struct Vertex {
+ alignas(8) glm::vec2 pos;
+ alignas(8) glm::vec2 tex;
+
+ static VkVertexInputBindingDescription getBindingDescription() {
+ return VkVertexInputBindingDescription{
+ .binding = 0,
+ .stride = sizeof(struct Vertex),
+ .inputRate = VK_VERTEX_INPUT_RATE_VERTEX,
+ };
+ }
+
+ static std::array<VkVertexInputAttributeDescription, 2> getAttributeDescription() {
+ return {
+ VkVertexInputAttributeDescription{
+ .location = 0,
+ .binding = 0,
+ .format = VK_FORMAT_R32G32_SFLOAT,
+ .offset = offsetof(struct Vertex, pos),
+ },
+ VkVertexInputAttributeDescription{
+ .location = 1,
+ .binding = 0,
+ .format = VK_FORMAT_R32G32_SFLOAT,
+ .offset = offsetof(struct Vertex, tex),
+ },
+ };
+ }
+};
+
+static const std::vector<Vertex> k_vertices = {
+ // clang-format off
+ { .pos = {-1.0f, -1.0f}, .tex = {0.0f, 0.0f}},
+ { .pos = { 1.0f, -1.0f}, .tex = {1.0f, 0.0f}},
+ { .pos = { 1.0f, 1.0f}, .tex = {1.0f, 1.0f}},
+ { .pos = {-1.0f, 1.0f}, .tex = {0.0f, 1.0f}},
+ // clang-format on
+};
+
+static const std::vector<uint16_t> k_indices = {0, 1, 2, 2, 3, 0};
+
+static VkShaderModule createShaderModule(const VulkanDispatch& vk, VkDevice device,
+ const std::vector<uint32_t>& code) {
+ const VkShaderModuleCreateInfo shaderModuleCi = {
+ .sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
+ .codeSize = static_cast<uint32_t>(code.size() * sizeof(uint32_t)),
+ .pCode = code.data(),
+ };
+ VkShaderModule res;
+ VK_CHECK(vk.vkCreateShaderModule(device, &shaderModuleCi, nullptr, &res));
+ return res;
+}
+
+} // namespace
+
+CompositorVk::RenderTarget::RenderTarget(const VulkanDispatch& vk, VkDevice vkDevice,
+ VkImage vkImage, VkImageView vkImageView, uint32_t width,
+ uint32_t height, VkRenderPass vkRenderPass)
+ : m_vk(vk),
+ m_vkDevice(vkDevice),
+ m_vkImage(vkImage),
+ m_vkFramebuffer(VK_NULL_HANDLE),
+ m_width(width),
+ m_height(height) {
+ if (vkImageView == VK_NULL_HANDLE) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "CompositorVk found empty image view handle when creating RenderTarget.";
+ }
+
+ const VkFramebufferCreateInfo framebufferCi = {
+ .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
+ .flags = 0,
+ .renderPass = vkRenderPass,
+ .attachmentCount = 1,
+ .pAttachments = &vkImageView,
+ .width = width,
+ .height = height,
+ .layers = 1,
+ };
+ VK_CHECK(m_vk.vkCreateFramebuffer(vkDevice, &framebufferCi, nullptr, &m_vkFramebuffer));
+}
+
+CompositorVk::RenderTarget::~RenderTarget() {
+ if (m_vkFramebuffer != VK_NULL_HANDLE) {
+ m_vk.vkDestroyFramebuffer(m_vkDevice, m_vkFramebuffer, nullptr);
+ }
+}
+
+std::unique_ptr<CompositorVk> CompositorVk::create(const VulkanDispatch& vk, VkDevice vkDevice,
+ VkPhysicalDevice vkPhysicalDevice,
+ VkQueue vkQueue,
+ std::shared_ptr<android::base::Lock> queueLock,
+ uint32_t queueFamilyIndex,
+ uint32_t maxFramesInFlight) {
+ auto res = std::unique_ptr<CompositorVk>(new CompositorVk(
+ vk, vkDevice, vkPhysicalDevice, vkQueue, queueLock, queueFamilyIndex, maxFramesInFlight));
+ res->setUpCommandPool();
+ res->setUpSampler();
+ res->setUpGraphicsPipeline();
+ res->setUpVertexBuffers();
+ res->setUpUniformBuffers();
+ res->setUpDescriptorSets();
+ res->setUpFences();
+ res->setUpDefaultImage();
+ res->setUpFrameResourceFutures();
+ return res;
+}
+
+CompositorVk::CompositorVk(const VulkanDispatch& vk, VkDevice vkDevice,
+ VkPhysicalDevice vkPhysicalDevice, VkQueue vkQueue,
+ std::shared_ptr<android::base::Lock> queueLock,
+ uint32_t queueFamilyIndex, uint32_t maxFramesInFlight)
+ : CompositorVkBase(vk, vkDevice, vkPhysicalDevice, vkQueue, queueLock, queueFamilyIndex,
+ maxFramesInFlight),
+ m_maxFramesInFlight(maxFramesInFlight),
+ m_renderTargetCache(k_renderTargetCacheSize) {}
+
+CompositorVk::~CompositorVk() {
+ {
+ android::base::AutoLock lock(*m_vkQueueLock);
+ VK_CHECK(vk_util::waitForVkQueueIdleWithRetry(m_vk, m_vkQueue));
+ }
+ if (m_defaultImage.m_vkImageView != VK_NULL_HANDLE) {
+ m_vk.vkDestroyImageView(m_vkDevice, m_defaultImage.m_vkImageView, nullptr);
+ }
+ if (m_defaultImage.m_vkImage != VK_NULL_HANDLE) {
+ m_vk.vkDestroyImage(m_vkDevice, m_defaultImage.m_vkImage, nullptr);
+ }
+ if (m_defaultImage.m_vkImageMemory != VK_NULL_HANDLE) {
+ m_vk.vkFreeMemory(m_vkDevice, m_defaultImage.m_vkImageMemory, nullptr);
+ }
+ m_vk.vkDestroyDescriptorPool(m_vkDevice, m_vkDescriptorPool, nullptr);
+ if (m_uniformStorage.m_vkDeviceMemory != VK_NULL_HANDLE) {
+ m_vk.vkUnmapMemory(m_vkDevice, m_uniformStorage.m_vkDeviceMemory);
+ }
+ m_vk.vkDestroyBuffer(m_vkDevice, m_uniformStorage.m_vkBuffer, nullptr);
+ m_vk.vkFreeMemory(m_vkDevice, m_uniformStorage.m_vkDeviceMemory, nullptr);
+ m_vk.vkFreeMemory(m_vkDevice, m_vertexVkDeviceMemory, nullptr);
+ m_vk.vkDestroyBuffer(m_vkDevice, m_vertexVkBuffer, nullptr);
+ m_vk.vkFreeMemory(m_vkDevice, m_indexVkDeviceMemory, nullptr);
+ m_vk.vkDestroyBuffer(m_vkDevice, m_indexVkBuffer, nullptr);
+ m_vk.vkDestroyPipeline(m_vkDevice, m_graphicsVkPipeline, nullptr);
+ m_vk.vkDestroyRenderPass(m_vkDevice, m_vkRenderPass, nullptr);
+ m_vk.vkDestroyPipelineLayout(m_vkDevice, m_vkPipelineLayout, nullptr);
+ m_vk.vkDestroySampler(m_vkDevice, m_vkSampler, nullptr);
+ m_vk.vkDestroyDescriptorSetLayout(m_vkDevice, m_vkDescriptorSetLayout, nullptr);
+ m_vk.vkDestroyCommandPool(m_vkDevice, m_vkCommandPool, nullptr);
+ for (PerFrameResources& frameResources : m_frameResources) {
+ m_vk.vkDestroyFence(m_vkDevice, frameResources.m_vkFence, nullptr);
+ }
+}
+
+void CompositorVk::setUpGraphicsPipeline() {
+ const std::vector<uint32_t> vertSpvBuff(CompositorVkShader::compositorVertexShader,
+ std::end(CompositorVkShader::compositorVertexShader));
+ const std::vector<uint32_t> fragSpvBuff(CompositorVkShader::compositorFragmentShader,
+ std::end(CompositorVkShader::compositorFragmentShader));
+ const auto vertShaderMod = createShaderModule(m_vk, m_vkDevice, vertSpvBuff);
+ const auto fragShaderMod = createShaderModule(m_vk, m_vkDevice, fragSpvBuff);
+
+ const VkPipelineShaderStageCreateInfo shaderStageCis[2] = {
+ VkPipelineShaderStageCreateInfo{
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
+ .stage = VK_SHADER_STAGE_VERTEX_BIT,
+ .module = vertShaderMod,
+ .pName = "main",
+ },
+ VkPipelineShaderStageCreateInfo{
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
+ .stage = VK_SHADER_STAGE_FRAGMENT_BIT,
+ .module = fragShaderMod,
+ .pName = "main",
+ },
+ };
+
+ const auto vertexAttributeDescription = Vertex::getAttributeDescription();
+ const auto vertexBindingDescription = Vertex::getBindingDescription();
+ const VkPipelineVertexInputStateCreateInfo vertexInputStateCi = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
+ .vertexBindingDescriptionCount = 1,
+ .pVertexBindingDescriptions = &vertexBindingDescription,
+ .vertexAttributeDescriptionCount = static_cast<uint32_t>(vertexAttributeDescription.size()),
+ .pVertexAttributeDescriptions = vertexAttributeDescription.data(),
+ };
+ const VkPipelineInputAssemblyStateCreateInfo inputAssemblyStateCi = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
+ .topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
+ .primitiveRestartEnable = VK_FALSE,
+ };
+
+ const VkPipelineViewportStateCreateInfo viewportStateCi = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,
+ .viewportCount = 1,
+ // The viewport state is dynamic.
+ .pViewports = nullptr,
+ .scissorCount = 1,
+ // The scissor state is dynamic.
+ .pScissors = nullptr,
+ };
+
+ const VkPipelineRasterizationStateCreateInfo rasterizerStateCi = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
+ .depthClampEnable = VK_FALSE,
+ .rasterizerDiscardEnable = VK_FALSE,
+ .polygonMode = VK_POLYGON_MODE_FILL,
+ .cullMode = VK_CULL_MODE_BACK_BIT,
+ .frontFace = VK_FRONT_FACE_CLOCKWISE,
+ .depthBiasEnable = VK_FALSE,
+ .depthBiasConstantFactor = 0.0f,
+ .depthBiasClamp = 0.0f,
+ .depthBiasSlopeFactor = 0.0f,
+ .lineWidth = 1.0f,
+ };
+
+ const VkPipelineMultisampleStateCreateInfo multisampleStateCi = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
+ .rasterizationSamples = VK_SAMPLE_COUNT_1_BIT,
+ .sampleShadingEnable = VK_FALSE,
+ .minSampleShading = 1.0f,
+ .pSampleMask = nullptr,
+ .alphaToCoverageEnable = VK_FALSE,
+ .alphaToOneEnable = VK_FALSE,
+ };
+
+ const VkPipelineColorBlendAttachmentState colorBlendAttachment = {
+ .blendEnable = VK_TRUE,
+ .srcColorBlendFactor = VK_BLEND_FACTOR_ONE,
+ .dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
+ .colorBlendOp = VK_BLEND_OP_ADD,
+ .srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE,
+ .dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
+ .alphaBlendOp = VK_BLEND_OP_ADD,
+ .colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT |
+ VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT,
+ };
+
+ const VkPipelineColorBlendStateCreateInfo colorBlendStateCi = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
+ .logicOpEnable = VK_FALSE,
+ .attachmentCount = 1,
+ .pAttachments = &colorBlendAttachment,
+ };
+
+ const VkDynamicState dynamicStates[] = {
+ VK_DYNAMIC_STATE_VIEWPORT,
+ VK_DYNAMIC_STATE_SCISSOR,
+ };
+ const VkPipelineDynamicStateCreateInfo dynamicStateCi = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
+ .dynamicStateCount = std::size(dynamicStates),
+ .pDynamicStates = dynamicStates,
+ };
+
+ const VkDescriptorSetLayoutBinding layoutBindings[2] = {
+ VkDescriptorSetLayoutBinding{
+ .binding = 0,
+ .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
+ .descriptorCount = 1,
+ .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,
+ .pImmutableSamplers = &m_vkSampler,
+ },
+ VkDescriptorSetLayoutBinding{
+ .binding = 1,
+ .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
+ .descriptorCount = 1,
+ .stageFlags = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT,
+ .pImmutableSamplers = nullptr,
+ },
+ };
+
+ const VkDescriptorSetLayoutCreateInfo descriptorSetLayoutCi = {
+ .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+ .pNext = nullptr,
+ .flags = 0,
+ .bindingCount = static_cast<uint32_t>(std::size(layoutBindings)),
+ .pBindings = layoutBindings,
+ };
+ VK_CHECK(m_vk.vkCreateDescriptorSetLayout(m_vkDevice, &descriptorSetLayoutCi, nullptr,
+ &m_vkDescriptorSetLayout));
+
+ const VkPipelineLayoutCreateInfo pipelineLayoutCi = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
+ .setLayoutCount = 1,
+ .pSetLayouts = &m_vkDescriptorSetLayout,
+ .pushConstantRangeCount = 0,
+ };
+
+ VK_CHECK(
+ m_vk.vkCreatePipelineLayout(m_vkDevice, &pipelineLayoutCi, nullptr, &m_vkPipelineLayout));
+
+ const VkAttachmentDescription colorAttachment = {
+ .format = VK_FORMAT_R8G8B8A8_UNORM,
+ .samples = VK_SAMPLE_COUNT_1_BIT,
+ .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
+ .storeOp = VK_ATTACHMENT_STORE_OP_STORE,
+ .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,
+ .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE,
+ .initialLayout = kTargetImageInitialLayoutUsed,
+ .finalLayout = kTargetImageFinalLayoutUsed,
+ };
+
+ const VkAttachmentReference colorAttachmentRef = {
+ .attachment = 0,
+ .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
+ };
+
+ const VkSubpassDescription subpass = {
+ .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
+ .colorAttachmentCount = 1,
+ .pColorAttachments = &colorAttachmentRef,
+ };
+
+ // TODO: to support multiple layer composition, we could run the same render
+ // pass for multiple time. In that case, we should use explicit
+ // VkImageMemoryBarriers to transform the image layout instead of relying on
+ // renderpass to do it.
+ const VkSubpassDependency subpassDependency = {
+ .srcSubpass = VK_SUBPASS_EXTERNAL,
+ .dstSubpass = 0,
+ .srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+ .dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+ .srcAccessMask = 0,
+ .dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
+ };
+
+ const VkRenderPassCreateInfo renderPassCi = {
+ .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
+ .attachmentCount = 1,
+ .pAttachments = &colorAttachment,
+ .subpassCount = 1,
+ .pSubpasses = &subpass,
+ .dependencyCount = 1,
+ .pDependencies = &subpassDependency,
+ };
+ VK_CHECK(m_vk.vkCreateRenderPass(m_vkDevice, &renderPassCi, nullptr, &m_vkRenderPass));
+
+ const VkGraphicsPipelineCreateInfo graphicsPipelineCi = {
+ .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
+ .stageCount = static_cast<uint32_t>(std::size(shaderStageCis)),
+ .pStages = shaderStageCis,
+ .pVertexInputState = &vertexInputStateCi,
+ .pInputAssemblyState = &inputAssemblyStateCi,
+ .pViewportState = &viewportStateCi,
+ .pRasterizationState = &rasterizerStateCi,
+ .pMultisampleState = &multisampleStateCi,
+ .pDepthStencilState = nullptr,
+ .pColorBlendState = &colorBlendStateCi,
+ .pDynamicState = &dynamicStateCi,
+ .layout = m_vkPipelineLayout,
+ .renderPass = m_vkRenderPass,
+ .subpass = 0,
+ .basePipelineHandle = VK_NULL_HANDLE,
+ .basePipelineIndex = -1,
+ };
+ VK_CHECK(m_vk.vkCreateGraphicsPipelines(m_vkDevice, VK_NULL_HANDLE, 1, &graphicsPipelineCi,
+ nullptr, &m_graphicsVkPipeline));
+
+ m_vk.vkDestroyShaderModule(m_vkDevice, vertShaderMod, nullptr);
+ m_vk.vkDestroyShaderModule(m_vkDevice, fragShaderMod, nullptr);
+}
+
+void CompositorVk::setUpVertexBuffers() {
+ const VkDeviceSize vertexBufferSize = sizeof(Vertex) * k_vertices.size();
+ std::tie(m_vertexVkBuffer, m_vertexVkDeviceMemory) =
+ createBuffer(vertexBufferSize,
+ VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
+ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
+ .value();
+ auto [vertexStagingBuffer, vertexStagingBufferMemory] =
+ createStagingBufferWithData(k_vertices.data(), vertexBufferSize);
+ copyBuffer(vertexStagingBuffer, m_vertexVkBuffer, vertexBufferSize);
+ m_vk.vkDestroyBuffer(m_vkDevice, vertexStagingBuffer, nullptr);
+ m_vk.vkFreeMemory(m_vkDevice, vertexStagingBufferMemory, nullptr);
+
+ VkDeviceSize indexBufferSize = sizeof(k_indices[0]) * k_indices.size();
+ auto [indexStagingBuffer, indexStagingBufferMemory] =
+ createStagingBufferWithData(k_indices.data(), indexBufferSize);
+ std::tie(m_indexVkBuffer, m_indexVkDeviceMemory) =
+ createBuffer(indexBufferSize,
+ VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
+ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
+ .value();
+
+ copyBuffer(indexStagingBuffer, m_indexVkBuffer, indexBufferSize);
+ m_vk.vkDestroyBuffer(m_vkDevice, indexStagingBuffer, nullptr);
+ m_vk.vkFreeMemory(m_vkDevice, indexStagingBufferMemory, nullptr);
+}
+
+void CompositorVk::setUpDescriptorSets() {
+ const uint32_t descriptorSetsPerFrame = kMaxLayersPerFrame;
+ const uint32_t descriptorSetsTotal = descriptorSetsPerFrame * m_maxFramesInFlight;
+
+ const uint32_t descriptorsOfEachTypePerSet = 1;
+ const uint32_t descriptorsOfEachTypePerFrame =
+ descriptorSetsPerFrame * descriptorsOfEachTypePerSet;
+ const uint32_t descriptorsOfEachTypeTotal = descriptorsOfEachTypePerFrame * m_maxFramesInFlight;
+
+ const VkDescriptorPoolSize descriptorPoolSizes[2] = {
+ VkDescriptorPoolSize{
+ .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
+ .descriptorCount = descriptorsOfEachTypeTotal,
+ },
+ VkDescriptorPoolSize{
+ .type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
+ .descriptorCount = descriptorsOfEachTypeTotal,
+ }};
+ const VkDescriptorPoolCreateInfo descriptorPoolCi = {
+ .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
+ .flags = 0,
+ .maxSets = descriptorSetsTotal,
+ .poolSizeCount = static_cast<uint32_t>(std::size(descriptorPoolSizes)),
+ .pPoolSizes = descriptorPoolSizes,
+ };
+ VK_CHECK(
+ m_vk.vkCreateDescriptorPool(m_vkDevice, &descriptorPoolCi, nullptr, &m_vkDescriptorPool));
+
+ const std::vector<VkDescriptorSetLayout> frameDescriptorSetLayouts(descriptorSetsPerFrame,
+ m_vkDescriptorSetLayout);
+ const VkDescriptorSetAllocateInfo frameDescriptorSetAllocInfo = {
+ .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,
+ .descriptorPool = m_vkDescriptorPool,
+ .descriptorSetCount = descriptorSetsPerFrame,
+ .pSetLayouts = frameDescriptorSetLayouts.data(),
+ };
+
+ VkDeviceSize uniformBufferOffset = 0;
+ for (uint32_t frameIndex = 0; frameIndex < m_maxFramesInFlight; ++frameIndex) {
+ PerFrameResources& frameResources = m_frameResources[frameIndex];
+ frameResources.m_layerDescriptorSets.resize(descriptorSetsPerFrame);
+
+ VK_CHECK(m_vk.vkAllocateDescriptorSets(m_vkDevice, &frameDescriptorSetAllocInfo,
+ frameResources.m_layerDescriptorSets.data()));
+
+ for (uint32_t layerIndex = 0; layerIndex < kMaxLayersPerFrame; ++layerIndex) {
+ const VkDescriptorBufferInfo bufferInfo = {
+ .buffer = m_uniformStorage.m_vkBuffer,
+ .offset = uniformBufferOffset,
+ .range = sizeof(UniformBufferBinding),
+ };
+ const VkWriteDescriptorSet descriptorSetWrite = {
+ .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+ .dstSet = frameResources.m_layerDescriptorSets[layerIndex],
+ .dstBinding = 1,
+ .dstArrayElement = 0,
+ .descriptorCount = 1,
+ .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
+ .pBufferInfo = &bufferInfo,
+ };
+ m_vk.vkUpdateDescriptorSets(m_vkDevice, 1, &descriptorSetWrite, 0, nullptr);
+
+ uniformBufferOffset += m_uniformStorage.m_stride;
+ }
+ }
+}
+
+void CompositorVk::setUpCommandPool() {
+ const VkCommandPoolCreateInfo commandPoolCreateInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
+ .flags = 0,
+ .queueFamilyIndex = m_queueFamilyIndex,
+ };
+
+ VkCommandPool commandPool = VK_NULL_HANDLE;
+ VK_CHECK(m_vk.vkCreateCommandPool(m_vkDevice, &commandPoolCreateInfo, nullptr, &commandPool));
+ m_vkCommandPool = commandPool;
+}
+
+void CompositorVk::setUpFences() {
+ for (uint32_t frameIndex = 0; frameIndex < m_maxFramesInFlight; ++frameIndex) {
+ PerFrameResources& frameResources = m_frameResources[frameIndex];
+
+ const VkFenceCreateInfo fenceCi = {
+ .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ };
+
+ VkFence fence;
+ VK_CHECK(m_vk.vkCreateFence(m_vkDevice, &fenceCi, nullptr, &fence));
+
+ frameResources.m_vkFence = fence;
+ }
+}
+
+void CompositorVk::setUpDefaultImage() {
+ const VkImageCreateInfo imageCreateInfo = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
+ .pNext = nullptr,
+ .flags = 0,
+ .imageType = VK_IMAGE_TYPE_2D,
+ .format = VK_FORMAT_R8G8B8A8_UNORM,
+ .extent =
+ {
+ .width = 2,
+ .height = 2,
+ .depth = 1,
+ },
+ .mipLevels = 1,
+ .arrayLayers = 1,
+ .samples = VK_SAMPLE_COUNT_1_BIT,
+ .tiling = VK_IMAGE_TILING_OPTIMAL,
+ .usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT,
+ .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
+ .queueFamilyIndexCount = 0,
+ .pQueueFamilyIndices = nullptr,
+ .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
+ };
+ VkImage image = VK_NULL_HANDLE;
+ VK_CHECK(m_vk.vkCreateImage(m_vkDevice, &imageCreateInfo, nullptr, &image));
+
+ VkMemoryRequirements imageMemoryRequirements;
+ m_vk.vkGetImageMemoryRequirements(m_vkDevice, image, &imageMemoryRequirements);
+
+ auto memoryTypeIndexOpt =
+ findMemoryType(imageMemoryRequirements.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
+ if (!memoryTypeIndexOpt) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "CompositorVk failed to find memory type for default image.";
+ }
+
+ const VkMemoryAllocateInfo imageMemoryAllocInfo = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ .pNext = nullptr,
+ .allocationSize = imageMemoryRequirements.size,
+ .memoryTypeIndex = *memoryTypeIndexOpt,
+ };
+ VkDeviceMemory imageMemory = VK_NULL_HANDLE;
+ VK_CHECK_MEMALLOC(
+ m_vk.vkAllocateMemory(m_vkDevice, &imageMemoryAllocInfo, nullptr, &imageMemory),
+ imageMemoryAllocInfo);
+
+ VK_CHECK(m_vk.vkBindImageMemory(m_vkDevice, image, imageMemory, 0));
+
+ const VkImageViewCreateInfo imageViewCreateInfo = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
+ .pNext = nullptr,
+ .flags = 0,
+ .image = image,
+ .viewType = VK_IMAGE_VIEW_TYPE_2D,
+ .format = VK_FORMAT_R8G8B8A8_UNORM,
+ .components =
+ {
+ .r = VK_COMPONENT_SWIZZLE_IDENTITY,
+ .g = VK_COMPONENT_SWIZZLE_IDENTITY,
+ .b = VK_COMPONENT_SWIZZLE_IDENTITY,
+ .a = VK_COMPONENT_SWIZZLE_IDENTITY,
+ },
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ VkImageView imageView = VK_NULL_HANDLE;
+ VK_CHECK(m_vk.vkCreateImageView(m_vkDevice, &imageViewCreateInfo, nullptr, &imageView));
+
+ const std::vector<uint8_t> pixels = {
+ 0xFF, 0x00, 0xFF, 0xFF, //
+ 0xFF, 0x00, 0xFF, 0xFF, //
+ 0xFF, 0x00, 0xFF, 0xFF, //
+ 0xFF, 0x00, 0xFF, 0xFF, //
+ };
+ VkBuffer stagingBuffer = VK_NULL_HANDLE;
+ VkDeviceMemory stagingBufferMemory = VK_NULL_HANDLE;
+ std::tie(stagingBuffer, stagingBufferMemory) =
+ createStagingBufferWithData(pixels.data(), pixels.size());
+
+ runSingleTimeCommands(m_vkQueue, m_vkQueueLock, [&, this](const VkCommandBuffer& cmdBuff) {
+ const VkImageMemoryBarrier toTransferDstImageBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = 0,
+ .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT,
+ .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
+ .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ m_vk.vkCmdPipelineBarrier(cmdBuff,
+ /*srcStageMask=*/VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ /*dstStageMask=*/VK_PIPELINE_STAGE_TRANSFER_BIT,
+ /*dependencyFlags=*/0,
+ /*memoryBarrierCount=*/0,
+ /*pMemoryBarriers=*/nullptr,
+ /*bufferMemoryBarrierCount=*/0,
+ /*pBufferMemoryBarriers=*/nullptr, 1, &toTransferDstImageBarrier);
+
+ const VkBufferImageCopy bufferToImageCopy = {
+ .bufferOffset = 0,
+ .bufferRowLength = 0,
+ .bufferImageHeight = 0,
+ .imageSubresource =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ .imageOffset =
+ {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ },
+ .imageExtent =
+ {
+ .width = 2,
+ .height = 2,
+ .depth = 1,
+ },
+ };
+ m_vk.vkCmdCopyBufferToImage(cmdBuff, stagingBuffer, image,
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &bufferToImageCopy);
+
+ const VkImageMemoryBarrier toSampledImageImageBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT,
+ .dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
+ .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ .newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ m_vk.vkCmdPipelineBarrier(cmdBuff,
+ /*srcStageMask=*/VK_PIPELINE_STAGE_TRANSFER_BIT,
+ /*dstStageMask=*/VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
+ /*dependencyFlags=*/0,
+ /*memoryBarrierCount=*/0,
+ /*pMemoryBarriers=*/nullptr,
+ /*bufferMemoryBarrierCount=*/0,
+ /*pBufferMemoryBarriers=*/nullptr, 1,
+ &toSampledImageImageBarrier);
+ });
+
+ m_vk.vkDestroyBuffer(m_vkDevice, stagingBuffer, nullptr);
+ m_vk.vkFreeMemory(m_vkDevice, stagingBufferMemory, nullptr);
+
+ m_defaultImage.m_vkImage = image;
+ m_defaultImage.m_vkImageView = imageView;
+ m_defaultImage.m_vkImageMemory = imageMemory;
+}
+
+void CompositorVk::setUpFrameResourceFutures() {
+ for (uint32_t frameIndex = 0; frameIndex < m_maxFramesInFlight; ++frameIndex) {
+ std::shared_future<PerFrameResources*> availableFrameResourceFuture =
+ std::async(std::launch::deferred, [this, frameIndex] {
+ return &m_frameResources[frameIndex];
+ }).share();
+
+ m_availableFrameResources.push_back(std::move(availableFrameResourceFuture));
+ }
+}
+
+void CompositorVk::setUpUniformBuffers() {
+ VkPhysicalDeviceProperties physicalDeviceProperties;
+ m_vk.vkGetPhysicalDeviceProperties(m_vkPhysicalDevice, &physicalDeviceProperties);
+ const VkDeviceSize alignment = physicalDeviceProperties.limits.minUniformBufferOffsetAlignment;
+ m_uniformStorage.m_stride = ((sizeof(UniformBufferBinding) - 1) / alignment + 1) * alignment;
+
+ VkDeviceSize size = m_uniformStorage.m_stride * m_maxFramesInFlight * kMaxLayersPerFrame;
+ auto maybeBuffer =
+ createBuffer(size, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
+ VK_MEMORY_PROPERTY_HOST_CACHED_BIT);
+ auto buffer = std::make_tuple<VkBuffer, VkDeviceMemory>(VK_NULL_HANDLE, VK_NULL_HANDLE);
+ if (maybeBuffer.has_value()) {
+ buffer = maybeBuffer.value();
+ } else {
+ buffer =
+ createBuffer(size, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)
+ .value();
+ }
+ std::tie(m_uniformStorage.m_vkBuffer, m_uniformStorage.m_vkDeviceMemory) = buffer;
+
+ void* mapped = nullptr;
+ VK_CHECK(m_vk.vkMapMemory(m_vkDevice, m_uniformStorage.m_vkDeviceMemory, 0, size, 0, &mapped));
+
+ uint8_t* data = reinterpret_cast<uint8_t*>(mapped);
+ for (uint32_t frameIndex = 0; frameIndex < m_maxFramesInFlight; ++frameIndex) {
+ PerFrameResources& frameResources = m_frameResources[frameIndex];
+ for (uint32_t layerIndex = 0; layerIndex < kMaxLayersPerFrame; ++layerIndex) {
+ auto* layerUboStorage = reinterpret_cast<UniformBufferBinding*>(data);
+ frameResources.m_layerUboStorages.push_back(layerUboStorage);
+ data += m_uniformStorage.m_stride;
+ }
+ }
+}
+
+void CompositorVk::setUpSampler() {
+ // The texture coordinate transformation matrices for flip/rotate/etc
+ // currently depends on this being repeat.
+ constexpr const VkSamplerAddressMode kSamplerMode = VK_SAMPLER_ADDRESS_MODE_REPEAT;
+
+ const VkSamplerCreateInfo samplerCi = {
+ .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
+ .magFilter = VK_FILTER_LINEAR,
+ .minFilter = VK_FILTER_LINEAR,
+ .mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR,
+ .addressModeU = kSamplerMode,
+ .addressModeV = kSamplerMode,
+ .addressModeW = kSamplerMode,
+ .mipLodBias = 0.0f,
+ .anisotropyEnable = VK_FALSE,
+ .maxAnisotropy = 1.0f,
+ .compareEnable = VK_FALSE,
+ .compareOp = VK_COMPARE_OP_ALWAYS,
+ .minLod = 0.0f,
+ .maxLod = 0.0f,
+ .borderColor = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK,
+ .unnormalizedCoordinates = VK_FALSE,
+ };
+ VK_CHECK(m_vk.vkCreateSampler(m_vkDevice, &samplerCi, nullptr, &m_vkSampler));
+}
+
+// Create a VkBuffer and a bound VkDeviceMemory. When the specified memory type
+// can't be found, return std::nullopt. When Vulkan call fails, terminate the
+// program.
+std::optional<std::tuple<VkBuffer, VkDeviceMemory>> CompositorVk::createBuffer(
+ VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags memProperty) const {
+ const VkBufferCreateInfo bufferCi = {
+ .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
+ .size = size,
+ .usage = usage,
+ .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
+ };
+ VkBuffer resBuffer;
+ VK_CHECK(m_vk.vkCreateBuffer(m_vkDevice, &bufferCi, nullptr, &resBuffer));
+ VkMemoryRequirements memRequirements;
+ m_vk.vkGetBufferMemoryRequirements(m_vkDevice, resBuffer, &memRequirements);
+ VkPhysicalDeviceMemoryProperties physicalMemProperties;
+ m_vk.vkGetPhysicalDeviceMemoryProperties(m_vkPhysicalDevice, &physicalMemProperties);
+ auto maybeMemoryTypeIndex = findMemoryType(memRequirements.memoryTypeBits, memProperty);
+ if (!maybeMemoryTypeIndex.has_value()) {
+ ERR("Failed to find memory type for creating buffer.");
+ m_vk.vkDestroyBuffer(m_vkDevice, resBuffer, nullptr);
+ return std::nullopt;
+ }
+ const VkMemoryAllocateInfo memAllocInfo = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ .allocationSize = memRequirements.size,
+ .memoryTypeIndex = maybeMemoryTypeIndex.value(),
+ };
+ VkDeviceMemory resMemory;
+ VK_CHECK_MEMALLOC(m_vk.vkAllocateMemory(m_vkDevice, &memAllocInfo, nullptr, &resMemory),
+ memAllocInfo);
+ VK_CHECK(m_vk.vkBindBufferMemory(m_vkDevice, resBuffer, resMemory, 0));
+ return std::make_tuple(resBuffer, resMemory);
+}
+
+std::tuple<VkBuffer, VkDeviceMemory> CompositorVk::createStagingBufferWithData(
+ const void* srcData, VkDeviceSize size) const {
+ auto [stagingBuffer, stagingBufferMemory] =
+ createBuffer(size, VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)
+ .value();
+ void* data;
+ VK_CHECK(m_vk.vkMapMemory(m_vkDevice, stagingBufferMemory, 0, size, 0, &data));
+ memcpy(data, srcData, size);
+ m_vk.vkUnmapMemory(m_vkDevice, stagingBufferMemory);
+ return std::make_tuple(stagingBuffer, stagingBufferMemory);
+}
+
+void CompositorVk::copyBuffer(VkBuffer src, VkBuffer dst, VkDeviceSize size) const {
+ runSingleTimeCommands(m_vkQueue, m_vkQueueLock, [&, this](const auto& cmdBuff) {
+ VkBufferCopy copyRegion = {};
+ copyRegion.srcOffset = 0;
+ copyRegion.dstOffset = 0;
+ copyRegion.size = size;
+ m_vk.vkCmdCopyBuffer(cmdBuff, src, dst, 1, &copyRegion);
+ });
+}
+
+// TODO: move this to another common CRTP helper class in vk_util.h.
+VkFormatFeatureFlags CompositorVk::getFormatFeatures(VkFormat format, VkImageTiling tiling) {
+ auto i = m_vkFormatProperties.find(format);
+ if (i == m_vkFormatProperties.end()) {
+ VkFormatProperties formatProperties;
+ m_vk.vkGetPhysicalDeviceFormatProperties(m_vkPhysicalDevice, format, &formatProperties);
+ i = m_vkFormatProperties.emplace(format, formatProperties).first;
+ }
+ const VkFormatProperties& formatProperties = i->second;
+ VkFormatFeatureFlags formatFeatures = 0;
+ if (tiling == VK_IMAGE_TILING_LINEAR) {
+ formatFeatures = formatProperties.linearTilingFeatures;
+ } else if (tiling == VK_IMAGE_TILING_OPTIMAL) {
+ formatFeatures = formatProperties.optimalTilingFeatures;
+ } else {
+ ERR("Unknown tiling:%#" PRIx64 ".", static_cast<uint64_t>(tiling));
+ }
+ return formatFeatures;
+}
+
+CompositorVk::RenderTarget* CompositorVk::getOrCreateRenderTargetInfo(
+ const BorrowedImageInfoVk& imageInfo) {
+ auto* renderTargetPtr = m_renderTargetCache.get(imageInfo.id);
+ if (renderTargetPtr != nullptr) {
+ return renderTargetPtr->get();
+ }
+
+ auto* renderTarget = new RenderTarget(m_vk, m_vkDevice, imageInfo.image, imageInfo.imageView,
+ imageInfo.imageCreateInfo.extent.width,
+ imageInfo.imageCreateInfo.extent.height, m_vkRenderPass);
+
+ m_renderTargetCache.set(imageInfo.id, std::unique_ptr<RenderTarget>(renderTarget));
+
+ return renderTarget;
+}
+
+bool CompositorVk::canCompositeFrom(const VkImageCreateInfo& imageCi) {
+ VkFormatFeatureFlags formatFeatures = getFormatFeatures(imageCi.format, imageCi.tiling);
+ if (!(formatFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) {
+ ERR("The format, %s, with tiling, %s, doesn't support the "
+ "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT feature. All supported features are %s.",
+ string_VkFormat(imageCi.format), string_VkImageTiling(imageCi.tiling),
+ string_VkFormatFeatureFlags(formatFeatures).c_str());
+ return false;
+ }
+ return true;
+}
+
+bool CompositorVk::canCompositeTo(const VkImageCreateInfo& imageCi) {
+ VkFormatFeatureFlags formatFeatures = getFormatFeatures(imageCi.format, imageCi.tiling);
+ if (!(formatFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) {
+ ERR("The format, %s, with tiling, %s, doesn't support the "
+ "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT feature. All supported features are %s.",
+ string_VkFormat(imageCi.format), string_VkImageTiling(imageCi.tiling),
+ string_VkFormatFeatureFlags(formatFeatures).c_str());
+ return false;
+ }
+ if (!(imageCi.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)) {
+ ERR("The VkImage is not created with the VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT usage flag. "
+ "The usage flags are %s.",
+ string_VkImageUsageFlags(imageCi.usage).c_str());
+ return false;
+ }
+ if (imageCi.format != k_renderTargetFormat) {
+ ERR("The format of the image, %s, is not supported by the CompositorVk as the render "
+ "target.",
+ string_VkFormat(imageCi.format));
+ return false;
+ }
+ return true;
+}
+
+void CompositorVk::buildCompositionVk(const CompositionRequest& compositionRequest,
+ CompositionVk* compositionVk) {
+ const BorrowedImageInfoVk* targetImage = getInfoOrAbort(compositionRequest.target);
+ RenderTarget* targetImageRenderTarget = getOrCreateRenderTargetInfo(*targetImage);
+
+ const uint32_t targetWidth = targetImage->width;
+ const uint32_t targetHeight = targetImage->height;
+
+ compositionVk->targetImage = targetImage;
+ compositionVk->targetFramebuffer = targetImageRenderTarget->m_vkFramebuffer;
+
+ for (const CompositionRequestLayer& layer : compositionRequest.layers) {
+ uint32_t sourceImageWidth = 0;
+ uint32_t sourceImageHeight = 0;
+ const BorrowedImageInfoVk* sourceImage = nullptr;
+
+ if (layer.props.composeMode == HWC2_COMPOSITION_SOLID_COLOR) {
+ sourceImageWidth = targetWidth;
+ sourceImageHeight = targetHeight;
+ } else {
+ sourceImage = getInfoOrAbort(layer.source);
+ if (!canCompositeFrom(sourceImage->imageCreateInfo)) {
+ continue;
+ }
+
+ sourceImageWidth = sourceImage->width;
+ sourceImageHeight = sourceImage->height;
+ }
+
+ // Calculate the posTransform and the texcoordTransform needed in the
+ // uniform of the Compositor.vert shader. The posTransform should transform
+ // the square(top = -1, bottom = 1, left = -1, right = 1) to the position
+ // where the layer should be drawn in NDC space given the layer.
+ // texcoordTransform should transform the unit square(top = 0, bottom = 1,
+ // left = 0, right = 1) to where we should sample the layer in the
+ // normalized uv space given the composeLayer.
+ const hwc_rect_t& posRect = layer.props.displayFrame;
+ const hwc_frect_t& texcoordRect = layer.props.crop;
+
+ const int posWidth = posRect.right - posRect.left;
+ const int posHeight = posRect.bottom - posRect.top;
+
+ const float posScaleX = float(posWidth) / targetWidth;
+ const float posScaleY = float(posHeight) / targetHeight;
+
+ const float posTranslateX = -1.0f + posScaleX + 2.0f * float(posRect.left) / targetWidth;
+ const float posTranslateY = -1.0f + posScaleY + 2.0f * float(posRect.top) / targetHeight;
+
+ float texCoordScaleX = (texcoordRect.right - texcoordRect.left) / float(sourceImageWidth);
+ float texCoordScaleY = (texcoordRect.bottom - texcoordRect.top) / float(sourceImageHeight);
+
+ const float texCoordTranslateX = texcoordRect.left / float(sourceImageWidth);
+ const float texCoordTranslateY = texcoordRect.top / float(sourceImageHeight);
+
+ float texcoordRotation = 0.0f;
+
+ const float pi = glm::pi<float>();
+
+ switch (layer.props.transform) {
+ case HWC_TRANSFORM_NONE:
+ break;
+ case HWC_TRANSFORM_ROT_90:
+ texcoordRotation = pi * 0.5f;
+ break;
+ case HWC_TRANSFORM_ROT_180:
+ texcoordRotation = pi;
+ break;
+ case HWC_TRANSFORM_ROT_270:
+ texcoordRotation = pi * 1.5f;
+ break;
+ case HWC_TRANSFORM_FLIP_H:
+ texCoordScaleX *= -1.0f;
+ break;
+ case HWC_TRANSFORM_FLIP_V:
+ texCoordScaleY *= -1.0f;
+ break;
+ case HWC_TRANSFORM_FLIP_H_ROT_90:
+ texcoordRotation = pi * 0.5f;
+ texCoordScaleX *= -1.0f;
+ break;
+ case HWC_TRANSFORM_FLIP_V_ROT_90:
+ texcoordRotation = pi * 0.5f;
+ texCoordScaleY *= -1.0f;
+ break;
+ default:
+ ERR("Unknown transform:%d", static_cast<int>(layer.props.transform));
+ break;
+ }
+
+ DescriptorSetContents descriptorSetContents = {
+ .binding1 =
+ {
+ .positionTransform =
+ glm::translate(glm::mat4(1.0f),
+ glm::vec3(posTranslateX, posTranslateY, 0.0f)) *
+ glm::scale(glm::mat4(1.0f), glm::vec3(posScaleX, posScaleY, 1.0f)),
+ .texCoordTransform =
+ glm::translate(glm::mat4(1.0f),
+ glm::vec3(texCoordTranslateX, texCoordTranslateY, 0.0f)) *
+ glm::scale(glm::mat4(1.0f),
+ glm::vec3(texCoordScaleX, texCoordScaleY, 1.0f)) *
+ glm::rotate(glm::mat4(1.0f), texcoordRotation, glm::vec3(0.0f, 0.0f, 1.0f)),
+ .mode = glm::uvec4(static_cast<uint32_t>(layer.props.composeMode), 0, 0, 0),
+ .alpha =
+ glm::vec4(layer.props.alpha, layer.props.alpha, layer.props.alpha,
+ layer.props.alpha),
+ },
+ };
+
+ if (layer.props.composeMode == HWC2_COMPOSITION_SOLID_COLOR) {
+ descriptorSetContents.binding0.sampledImageView = m_defaultImage.m_vkImageView;
+ descriptorSetContents.binding1.color =
+ glm::vec4(static_cast<float>(layer.props.color.r) / 255.0f,
+ static_cast<float>(layer.props.color.g) / 255.0f,
+ static_cast<float>(layer.props.color.b) / 255.0f,
+ static_cast<float>(layer.props.color.a) / 255.0f);
+ } else {
+ if (sourceImage == nullptr) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "CompositorVk failed to find sourceImage.";
+ }
+ descriptorSetContents.binding0.sampledImageView = sourceImage->imageView;
+ compositionVk->layersSourceImages.emplace_back(sourceImage);
+ }
+
+ compositionVk->layersDescriptorSets.descriptorSets.emplace_back(descriptorSetContents);
+ }
+}
+
+CompositorVk::CompositionFinishedWaitable CompositorVk::compose(
+ const CompositionRequest& compositionRequest) {
+ CompositionVk compositionVk;
+ buildCompositionVk(compositionRequest, &compositionVk);
+
+ // Grab and wait for the next available resources.
+ if (m_availableFrameResources.empty()) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "CompositorVk failed to get PerFrameResources.";
+ }
+ auto frameResourceFuture = std::move(m_availableFrameResources.front());
+ m_availableFrameResources.pop_front();
+ PerFrameResources* frameResources = frameResourceFuture.get();
+
+ updateDescriptorSetsIfChanged(compositionVk.layersDescriptorSets, frameResources);
+
+ std::vector<VkImageMemoryBarrier> preCompositionQueueTransferBarriers;
+ std::vector<VkImageMemoryBarrier> preCompositionLayoutTransitionBarriers;
+ std::vector<VkImageMemoryBarrier> postCompositionLayoutTransitionBarriers;
+ std::vector<VkImageMemoryBarrier> postCompositionQueueTransferBarriers;
+ addNeededBarriersToUseBorrowedImage(
+ *compositionVk.targetImage, m_queueFamilyIndex, kTargetImageInitialLayoutUsed,
+ kTargetImageFinalLayoutUsed, VK_ACCESS_MEMORY_WRITE_BIT,
+ &preCompositionQueueTransferBarriers, &preCompositionLayoutTransitionBarriers,
+ &postCompositionLayoutTransitionBarriers, &postCompositionQueueTransferBarriers);
+ for (const BorrowedImageInfoVk* sourceImage : compositionVk.layersSourceImages) {
+ addNeededBarriersToUseBorrowedImage(
+ *sourceImage, m_queueFamilyIndex, kSourceImageInitialLayoutUsed,
+ kSourceImageFinalLayoutUsed, VK_ACCESS_SHADER_READ_BIT,
+ &preCompositionQueueTransferBarriers, &preCompositionLayoutTransitionBarriers,
+ &postCompositionLayoutTransitionBarriers, &postCompositionQueueTransferBarriers);
+ }
+
+ VkCommandBuffer& commandBuffer = frameResources->m_vkCommandBuffer;
+ if (commandBuffer != VK_NULL_HANDLE) {
+ m_vk.vkFreeCommandBuffers(m_vkDevice, m_vkCommandPool, 1, &commandBuffer);
+ }
+
+ const VkCommandBufferAllocateInfo commandBufferAllocInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ .commandPool = m_vkCommandPool,
+ .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
+ .commandBufferCount = 1,
+ };
+ VK_CHECK(m_vk.vkAllocateCommandBuffers(m_vkDevice, &commandBufferAllocInfo, &commandBuffer));
+
+ const VkCommandBufferBeginInfo beginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+ VK_CHECK(m_vk.vkBeginCommandBuffer(commandBuffer, &beginInfo));
+
+ if (!preCompositionQueueTransferBarriers.empty()) {
+ m_vk.vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr,
+ static_cast<uint32_t>(preCompositionQueueTransferBarriers.size()),
+ preCompositionQueueTransferBarriers.data());
+ }
+ if (!preCompositionLayoutTransitionBarriers.empty()) {
+ m_vk.vkCmdPipelineBarrier(
+ commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ static_cast<uint32_t>(preCompositionLayoutTransitionBarriers.size()),
+ preCompositionLayoutTransitionBarriers.data());
+ }
+
+ const VkClearValue renderTargetClearColor = {
+ .color =
+ {
+ .float32 = {0.0f, 0.0f, 0.0f, 1.0f},
+ },
+ };
+ const VkRenderPassBeginInfo renderPassBeginInfo = {
+ .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
+ .renderPass = m_vkRenderPass,
+ .framebuffer = compositionVk.targetFramebuffer,
+ .renderArea =
+ {
+ .offset =
+ {
+ .x = 0,
+ .y = 0,
+ },
+ .extent =
+ {
+ .width = compositionVk.targetImage->imageCreateInfo.extent.width,
+ .height = compositionVk.targetImage->imageCreateInfo.extent.height,
+ },
+ },
+ .clearValueCount = 1,
+ .pClearValues = &renderTargetClearColor,
+ };
+ m_vk.vkCmdBeginRenderPass(commandBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
+
+ m_vk.vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, m_graphicsVkPipeline);
+
+ const VkRect2D scissor = {
+ .offset =
+ {
+ .x = 0,
+ .y = 0,
+ },
+ .extent =
+ {
+ .width = compositionVk.targetImage->imageCreateInfo.extent.width,
+ .height = compositionVk.targetImage->imageCreateInfo.extent.height,
+ },
+ };
+ m_vk.vkCmdSetScissor(commandBuffer, 0, 1, &scissor);
+
+ const VkViewport viewport = {
+ .x = 0.0f,
+ .y = 0.0f,
+ .width = static_cast<float>(compositionVk.targetImage->imageCreateInfo.extent.width),
+ .height = static_cast<float>(compositionVk.targetImage->imageCreateInfo.extent.height),
+ .minDepth = 0.0f,
+ .maxDepth = 1.0f,
+ };
+ m_vk.vkCmdSetViewport(commandBuffer, 0, 1, &viewport);
+
+ const VkDeviceSize offsets[] = {0};
+ m_vk.vkCmdBindVertexBuffers(commandBuffer, 0, 1, &m_vertexVkBuffer, offsets);
+
+ m_vk.vkCmdBindIndexBuffer(commandBuffer, m_indexVkBuffer, 0, VK_INDEX_TYPE_UINT16);
+
+ const uint32_t numLayers = compositionVk.layersDescriptorSets.descriptorSets.size();
+ for (uint32_t layerIndex = 0; layerIndex < numLayers; ++layerIndex) {
+ VkDescriptorSet layerDescriptorSet = frameResources->m_layerDescriptorSets[layerIndex];
+
+ m_vk.vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
+ m_vkPipelineLayout,
+ /*firstSet=*/0,
+ /*descriptorSetCount=*/1, &layerDescriptorSet,
+ /*dynamicOffsetCount=*/0,
+ /*pDynamicOffsets=*/nullptr);
+
+ m_vk.vkCmdDrawIndexed(commandBuffer, static_cast<uint32_t>(k_indices.size()), 1, 0, 0, 0);
+ }
+
+ m_vk.vkCmdEndRenderPass(commandBuffer);
+
+ // Insert a VkImageMemoryBarrier so that the vkCmdBlitImage in post will wait for the rendering
+ // to the render target to complete.
+ const VkImageMemoryBarrier renderTargetBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT,
+ .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = compositionVk.targetImage->image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ m_vk.vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+ VK_PIPELINE_STAGE_TRANSFER_BIT,
+ /*dependencyFlags=*/0,
+ /*memoryBarrierCount=*/0,
+ /*pMemoryBarriers=*/nullptr,
+ /*bufferMemoryBarrierCount=*/0,
+ /*pBufferMemoryBarriers=*/nullptr, 1, &renderTargetBarrier);
+
+ if (!postCompositionLayoutTransitionBarriers.empty()) {
+ m_vk.vkCmdPipelineBarrier(
+ commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ static_cast<uint32_t>(postCompositionLayoutTransitionBarriers.size()),
+ postCompositionLayoutTransitionBarriers.data());
+ }
+ if (!postCompositionQueueTransferBarriers.empty()) {
+ m_vk.vkCmdPipelineBarrier(
+ commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ static_cast<uint32_t>(postCompositionQueueTransferBarriers.size()),
+ postCompositionQueueTransferBarriers.data());
+ }
+
+ VK_CHECK(m_vk.vkEndCommandBuffer(commandBuffer));
+
+ VkFence composeCompleteFence = frameResources->m_vkFence;
+ VK_CHECK(m_vk.vkResetFences(m_vkDevice, 1, &composeCompleteFence));
+
+ const VkPipelineStageFlags submitWaitStages[] = {
+ VK_PIPELINE_STAGE_TRANSFER_BIT,
+ };
+ const VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .waitSemaphoreCount = 0,
+ .pWaitSemaphores = nullptr,
+ .pWaitDstStageMask = submitWaitStages,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &commandBuffer,
+ .signalSemaphoreCount = 0,
+ .pSignalSemaphores = nullptr,
+ };
+
+ {
+ android::base::AutoLock lock(*m_vkQueueLock);
+ VK_CHECK(m_vk.vkQueueSubmit(m_vkQueue, 1, &submitInfo, composeCompleteFence));
+ }
+
+ // Create a future that will return the PerFrameResources to the next
+ // iteration of CompostiorVk::compose() once this current composition
+ // completes.
+ std::shared_future<PerFrameResources*> composeCompleteFutureForResources =
+ std::async(std::launch::deferred, [composeCompleteFence, frameResources, this]() mutable {
+ VkResult res = m_vk.vkWaitForFences(m_vkDevice, 1, &composeCompleteFence, VK_TRUE,
+ kVkWaitForFencesTimeoutNsecs);
+ if (res == VK_SUCCESS) {
+ return frameResources;
+ }
+ if (res == VK_TIMEOUT) {
+ // Retry. If device lost, hopefully this returns immediately.
+ res = m_vk.vkWaitForFences(m_vkDevice, 1, &composeCompleteFence, VK_TRUE,
+ kVkWaitForFencesTimeoutNsecs);
+ }
+ VK_CHECK(res);
+ return frameResources;
+ }).share();
+ m_availableFrameResources.push_back(composeCompleteFutureForResources);
+
+ // Create a future that will return once this current composition
+ // completes that can be shared outside of CompositorVk.
+ std::shared_future<void> composeCompleteFuture =
+ std::async(std::launch::deferred, [composeCompleteFutureForResources]() {
+ composeCompleteFutureForResources.get();
+ }).share();
+
+ return composeCompleteFuture;
+}
+
+void CompositorVk::onImageDestroyed(uint32_t imageId) { m_renderTargetCache.remove(imageId); }
+
+bool operator==(const CompositorVkBase::DescriptorSetContents& lhs,
+ const CompositorVkBase::DescriptorSetContents& rhs) {
+ return std::tie(lhs.binding0.sampledImageView, //
+ lhs.binding1.mode, //
+ lhs.binding1.alpha, //
+ lhs.binding1.color, //
+ lhs.binding1.positionTransform, //
+ lhs.binding1.texCoordTransform) //
+ == //
+ std::tie(rhs.binding0.sampledImageView, //
+ rhs.binding1.mode, //
+ rhs.binding1.alpha, //
+ rhs.binding1.color, //
+ rhs.binding1.positionTransform, //
+ rhs.binding1.texCoordTransform);
+}
+
+bool operator==(const CompositorVkBase::FrameDescriptorSetsContents& lhs,
+ const CompositorVkBase::FrameDescriptorSetsContents& rhs) {
+ return lhs.descriptorSets == rhs.descriptorSets;
+}
+
+void CompositorVk::updateDescriptorSetsIfChanged(
+ const FrameDescriptorSetsContents& descriptorSetsContents, PerFrameResources* frameResources) {
+ if (frameResources->m_vkDescriptorSetsContents == descriptorSetsContents) {
+ return;
+ }
+
+ const uint32_t numRequestedLayers =
+ static_cast<uint32_t>(descriptorSetsContents.descriptorSets.size());
+ if (numRequestedLayers > kMaxLayersPerFrame) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "CompositorVk can't compose more than " << kMaxLayersPerFrame
+ << " layers. layers asked: " << numRequestedLayers;
+ return;
+ }
+
+ std::vector<VkDescriptorImageInfo> descriptorImageInfos(numRequestedLayers);
+ std::vector<VkWriteDescriptorSet> descriptorWrites;
+ for (uint32_t layerIndex = 0; layerIndex < numRequestedLayers; ++layerIndex) {
+ const DescriptorSetContents& layerDescriptorSetContents =
+ descriptorSetsContents.descriptorSets[layerIndex];
+
+ descriptorImageInfos[layerIndex] = VkDescriptorImageInfo{
+ // Empty as we only use immutable samplers.
+ .sampler = VK_NULL_HANDLE,
+ .imageView = layerDescriptorSetContents.binding0.sampledImageView,
+ .imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
+ };
+
+ descriptorWrites.emplace_back(VkWriteDescriptorSet{
+ .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+ .dstSet = frameResources->m_layerDescriptorSets[layerIndex],
+ .dstBinding = 0,
+ .dstArrayElement = 0,
+ .descriptorCount = 1,
+ .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
+ .pImageInfo = &descriptorImageInfos[layerIndex],
+ });
+
+ UniformBufferBinding* layerUboStorage = frameResources->m_layerUboStorages[layerIndex];
+ *layerUboStorage = layerDescriptorSetContents.binding1;
+ }
+
+ m_vk.vkUpdateDescriptorSets(m_vkDevice, descriptorWrites.size(), descriptorWrites.data(), 0,
+ nullptr);
+
+ frameResources->m_vkDescriptorSetsContents = descriptorSetsContents;
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/CompositorVk.h b/src/gfxstream/host/vulkan/CompositorVk.h
new file mode 100644
index 00000000000..cd98e233815
--- /dev/null
+++ b/src/gfxstream/host/vulkan/CompositorVk.h
@@ -0,0 +1,250 @@
+#ifndef COMPOSITOR_VK_H
+#define COMPOSITOR_VK_H
+
+#include <array>
+#include <deque>
+#include <future>
+#include <glm/glm.hpp>
+#include <list>
+#include <memory>
+#include <optional>
+#include <tuple>
+#include <unordered_map>
+#include <vector>
+
+#include "BorrowedImage.h"
+#include "BorrowedImageVk.h"
+#include "Compositor.h"
+#include "Hwc2.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/LruCache.h"
+#include "goldfish_vk_dispatch.h"
+#include "vulkan/vk_util.h"
+
+namespace gfxstream {
+namespace vk {
+
+// We do see a composition requests with 12 layers. (b/222700096)
+// Inside hwc2, we will ask for surfaceflinger to
+// do the composition, if the layers more than 16.
+// If we see rendering error or significant time spent on updating
+// descriptors in setComposition, we should tune this number.
+static constexpr const uint32_t kMaxLayersPerFrame = 16;
+static const uint64_t kVkWaitForFencesTimeoutNsecs = 5ULL * 1000ULL * 1000ULL * 1000ULL;
+
+// Base used to grant visibility to members to the vk_util::* helper classes.
+struct CompositorVkBase : public vk_util::MultiCrtp<CompositorVkBase, //
+ vk_util::FindMemoryType, //
+ vk_util::RunSingleTimeCommand> {
+ const VulkanDispatch& m_vk;
+ const VkDevice m_vkDevice;
+ const VkPhysicalDevice m_vkPhysicalDevice;
+ const VkQueue m_vkQueue;
+ const uint32_t m_queueFamilyIndex;
+ std::shared_ptr<android::base::Lock> m_vkQueueLock;
+ VkDescriptorSetLayout m_vkDescriptorSetLayout;
+ VkPipelineLayout m_vkPipelineLayout;
+ VkRenderPass m_vkRenderPass;
+ VkPipeline m_graphicsVkPipeline;
+ VkBuffer m_vertexVkBuffer;
+ VkDeviceMemory m_vertexVkDeviceMemory;
+ VkBuffer m_indexVkBuffer;
+ VkDeviceMemory m_indexVkDeviceMemory;
+ VkDescriptorPool m_vkDescriptorPool;
+ VkCommandPool m_vkCommandPool;
+ // TODO: create additional VkSampler-s for YCbCr layers.
+ VkSampler m_vkSampler;
+ // Unused image that is solely used to occupy the sampled image binding
+ // when compositing a solid color layer.
+ struct DefaultImage {
+ VkImage m_vkImage = VK_NULL_HANDLE;
+ VkImageView m_vkImageView = VK_NULL_HANDLE;
+ VkDeviceMemory m_vkImageMemory = VK_NULL_HANDLE;
+ } m_defaultImage;
+
+ // The underlying storage for all of the uniform buffer objects.
+ struct UniformBufferStorage {
+ VkBuffer m_vkBuffer = VK_NULL_HANDLE;
+ VkDeviceMemory m_vkDeviceMemory = VK_NULL_HANDLE;
+ VkDeviceSize m_stride = 0;
+ } m_uniformStorage;
+
+ // Keep in sync with vulkan/Compositor.frag.
+ struct SamplerBinding {
+ VkImageView sampledImageView = VK_NULL_HANDLE;
+ };
+
+ // Keep in sync with vulkan/Compositor.vert.
+ struct UniformBufferBinding {
+ alignas(16) glm::mat4 positionTransform;
+ alignas(16) glm::mat4 texCoordTransform;
+ alignas(16) glm::uvec4 mode;
+ alignas(16) glm::vec4 alpha;
+ alignas(16) glm::vec4 color;
+ };
+
+ // The cached contents of a given descriptor set.
+ struct DescriptorSetContents {
+ SamplerBinding binding0;
+ UniformBufferBinding binding1;
+ };
+
+ // The cached contents of all descriptors sets of a given frame.
+ struct FrameDescriptorSetsContents {
+ std::vector<DescriptorSetContents> descriptorSets;
+ };
+
+ friend bool operator==(const DescriptorSetContents& lhs, const DescriptorSetContents& rhs);
+
+ friend bool operator==(const FrameDescriptorSetsContents& lhs,
+ const FrameDescriptorSetsContents& rhs);
+
+ struct PerFrameResources {
+ VkFence m_vkFence = VK_NULL_HANDLE;
+ VkCommandBuffer m_vkCommandBuffer = VK_NULL_HANDLE;
+ std::vector<VkDescriptorSet> m_layerDescriptorSets;
+ // Pointers into the underlying uniform buffer storage for the uniform
+ // buffer of part of each descriptor set for each layer.
+ std::vector<UniformBufferBinding*> m_layerUboStorages;
+ std::optional<FrameDescriptorSetsContents> m_vkDescriptorSetsContents;
+ };
+ std::vector<PerFrameResources> m_frameResources;
+ std::deque<std::shared_future<PerFrameResources*>> m_availableFrameResources;
+
+ explicit CompositorVkBase(const VulkanDispatch& vk, VkDevice device,
+ VkPhysicalDevice physicalDevice, VkQueue queue,
+ std::shared_ptr<android::base::Lock> queueLock,
+ uint32_t queueFamilyIndex, uint32_t maxFramesInFlight)
+ : m_vk(vk),
+ m_vkDevice(device),
+ m_vkPhysicalDevice(physicalDevice),
+ m_vkQueue(queue),
+ m_queueFamilyIndex(queueFamilyIndex),
+ m_vkQueueLock(queueLock),
+ m_vkDescriptorSetLayout(VK_NULL_HANDLE),
+ m_vkPipelineLayout(VK_NULL_HANDLE),
+ m_vkRenderPass(VK_NULL_HANDLE),
+ m_graphicsVkPipeline(VK_NULL_HANDLE),
+ m_vertexVkBuffer(VK_NULL_HANDLE),
+ m_vertexVkDeviceMemory(VK_NULL_HANDLE),
+ m_indexVkBuffer(VK_NULL_HANDLE),
+ m_indexVkDeviceMemory(VK_NULL_HANDLE),
+ m_vkDescriptorPool(VK_NULL_HANDLE),
+ m_vkCommandPool(VK_NULL_HANDLE),
+ m_vkSampler(VK_NULL_HANDLE),
+ m_frameResources(maxFramesInFlight) {}
+};
+
+class CompositorVk : protected CompositorVkBase, public Compositor {
+ public:
+ static std::unique_ptr<CompositorVk> create(const VulkanDispatch& vk, VkDevice vkDevice,
+ VkPhysicalDevice vkPhysicalDevice, VkQueue vkQueue,
+ std::shared_ptr<android::base::Lock> queueLock,
+ uint32_t queueFamilyIndex,
+ uint32_t maxFramesInFlight);
+
+ ~CompositorVk();
+
+ CompositionFinishedWaitable compose(const CompositionRequest& compositionRequest) override;
+
+ void onImageDestroyed(uint32_t imageId) override;
+
+ static bool queueSupportsComposition(const VkQueueFamilyProperties& properties) {
+ return properties.queueFlags & VK_QUEUE_GRAPHICS_BIT;
+ }
+
+ private:
+ explicit CompositorVk(const VulkanDispatch&, VkDevice, VkPhysicalDevice, VkQueue,
+ std::shared_ptr<android::base::Lock> queueLock, uint32_t queueFamilyIndex,
+ uint32_t maxFramesInFlight);
+
+ void setUpGraphicsPipeline();
+ void setUpVertexBuffers();
+ void setUpSampler();
+ void setUpDescriptorSets();
+ void setUpUniformBuffers();
+ void setUpCommandPool();
+ void setUpFences();
+ void setUpDefaultImage();
+ void setUpFrameResourceFutures();
+
+ std::optional<std::tuple<VkBuffer, VkDeviceMemory>> createBuffer(VkDeviceSize,
+ VkBufferUsageFlags,
+ VkMemoryPropertyFlags) const;
+ std::tuple<VkBuffer, VkDeviceMemory> createStagingBufferWithData(const void* data,
+ VkDeviceSize size) const;
+ void copyBuffer(VkBuffer src, VkBuffer dst, VkDeviceSize) const;
+
+ VkFormatFeatureFlags getFormatFeatures(VkFormat format, VkImageTiling tiling);
+
+ // Check if the ColorBuffer can be used as a compose layer to be sampled from.
+ bool canCompositeFrom(const VkImageCreateInfo& info);
+
+ // Check if the ColorBuffer can be used as a render target of a composition.
+ bool canCompositeTo(const VkImageCreateInfo& info);
+
+ // A consolidated view of a `Compositor::CompositionRequestLayer` with only
+ // the Vulkan components needed for command recording and submission.
+ struct CompositionLayerVk {
+ VkImage image = VK_NULL_HANDLE;
+ VkImageView imageView = VK_NULL_HANDLE;
+ VkImageLayout preCompositionLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ uint32_t preCompositionQueueFamilyIndex = 0;
+ VkImageLayout postCompositionLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ uint32_t postCompositionQueueFamilyIndex = 0;
+ };
+
+ // A consolidated view of a `Compositor::CompositionRequest` with only
+ // the Vulkan components needed for command recording and submission.
+ struct CompositionVk {
+ const BorrowedImageInfoVk* targetImage = nullptr;
+ VkFramebuffer targetFramebuffer = VK_NULL_HANDLE;
+ std::vector<const BorrowedImageInfoVk*> layersSourceImages;
+ FrameDescriptorSetsContents layersDescriptorSets;
+ };
+ void buildCompositionVk(const CompositionRequest& compositionRequest,
+ CompositionVk* compositionVk);
+
+ void updateDescriptorSetsIfChanged(const FrameDescriptorSetsContents& contents,
+ PerFrameResources* frameResources);
+
+ class RenderTarget {
+ public:
+ ~RenderTarget();
+
+ DISALLOW_COPY_ASSIGN_AND_MOVE(RenderTarget);
+
+ private:
+ friend class CompositorVk;
+ RenderTarget(const VulkanDispatch& vk, VkDevice vkDevice, VkImage vkImage,
+ VkImageView vkImageView, uint32_t width, uint32_t height,
+ VkRenderPass vkRenderPass);
+
+ const VulkanDispatch& m_vk;
+ VkDevice m_vkDevice;
+ VkImage m_vkImage;
+ VkFramebuffer m_vkFramebuffer;
+ uint32_t m_width;
+ uint32_t m_height;
+ };
+
+ // Gets the RenderTarget used for composing into the given image if it already exists,
+ // otherwise creates it.
+ RenderTarget* getOrCreateRenderTargetInfo(const BorrowedImageInfoVk& info);
+
+ // Cached format properties used for checking if composition is supported with a given
+ // format.
+ std::unordered_map<VkFormat, VkFormatProperties> m_vkFormatProperties;
+
+ uint32_t m_maxFramesInFlight = 0;
+
+ static constexpr const VkFormat k_renderTargetFormat = VK_FORMAT_R8G8B8A8_UNORM;
+ static constexpr const uint32_t k_renderTargetCacheSize = 128;
+ // Maps from borrowed image ids to render target info.
+ android::base::LruCache<uint32_t, std::unique_ptr<RenderTarget>> m_renderTargetCache;
+};
+
+} // namespace vk
+} // namespace gfxstream
+
+#endif /* COMPOSITOR_VK_H */
diff --git a/src/gfxstream/host/vulkan/DebugUtilsHelper.cpp b/src/gfxstream/host/vulkan/DebugUtilsHelper.cpp
new file mode 100644
index 00000000000..0c2269aecfd
--- /dev/null
+++ b/src/gfxstream/host/vulkan/DebugUtilsHelper.cpp
@@ -0,0 +1,96 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "DebugUtilsHelper.h"
+
+#include <inttypes.h>
+
+#include <cstdarg>
+#include <cstdio>
+
+#include "host-common/logging.h"
+
+namespace gfxstream {
+namespace vk {
+
+/*static*/ DebugUtilsHelper DebugUtilsHelper::withUtilsDisabled() {
+ return DebugUtilsHelper(false, VK_NULL_HANDLE, nullptr);
+}
+
+/*static*/ DebugUtilsHelper DebugUtilsHelper::withUtilsEnabled(VkDevice device,
+ const VulkanDispatch* dispatch) {
+ return DebugUtilsHelper(true, device, dispatch);
+}
+
+DebugUtilsHelper::DebugUtilsHelper(bool enabled, VkDevice device, const VulkanDispatch* dispatch)
+ : m_debugUtilsEnabled(enabled), m_vkDevice(device), m_vk(dispatch) {}
+
+void DebugUtilsHelper::addDebugLabelToHandle(uint64_t object, VkObjectType objectType,
+ const char* format, ...) const {
+ if (!m_debugUtilsEnabled) {
+ return;
+ }
+
+ char objectLabelBuffer[256];
+
+ va_list vararg;
+ va_start(vararg, format);
+ vsnprintf(objectLabelBuffer, sizeof(objectLabelBuffer), format, vararg);
+ va_end(vararg);
+
+ const VkDebugUtilsObjectNameInfoEXT objectNameInfo = {
+ .sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT,
+ .pNext = nullptr,
+ .objectType = objectType,
+ .objectHandle = object,
+ .pObjectName = objectLabelBuffer,
+ };
+
+ VkResult result = m_vk->vkSetDebugUtilsObjectNameEXT(m_vkDevice, &objectNameInfo);
+ if (result != VK_SUCCESS) {
+ ERR("Failed to add debug label to %" PRIu64, object);
+ }
+}
+
+void DebugUtilsHelper::cmdBeginDebugLabel(VkCommandBuffer commandBuffer, const char* format,
+ ...) const {
+ if (!m_debugUtilsEnabled) {
+ return;
+ }
+
+ va_list vararg;
+ va_start(vararg, format);
+ char labelBuffer[256];
+ vsnprintf(labelBuffer, sizeof(labelBuffer), format, vararg);
+ va_end(vararg);
+
+ const VkDebugUtilsLabelEXT labelInfo = {
+ .sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
+ .pNext = nullptr,
+ .pLabelName = labelBuffer,
+ .color = { 0.0f, 0.0f, 0.0f, 1.0f },
+ };
+ m_vk->vkCmdBeginDebugUtilsLabelEXT(commandBuffer, &labelInfo);
+}
+
+void DebugUtilsHelper::cmdEndDebugLabel(VkCommandBuffer commandBuffer) const {
+ if (!m_debugUtilsEnabled) {
+ return;
+ }
+
+ m_vk->vkCmdEndDebugUtilsLabelEXT(commandBuffer);
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/DebugUtilsHelper.h b/src/gfxstream/host/vulkan/DebugUtilsHelper.h
new file mode 100644
index 00000000000..fd52e77943e
--- /dev/null
+++ b/src/gfxstream/host/vulkan/DebugUtilsHelper.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 expresso 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_dispatch.h"
+
+namespace gfxstream {
+namespace vk {
+
+class DebugUtilsHelper {
+ public:
+ static DebugUtilsHelper withUtilsEnabled(VkDevice device, const VulkanDispatch* dispatch);
+
+ static DebugUtilsHelper withUtilsDisabled();
+
+ ~DebugUtilsHelper() = default;
+
+ template <typename VkObjectT, typename... T>
+ void addDebugLabel(VkObjectT object, const char* format, T&&... formatArgs) const {
+ if (!m_debugUtilsEnabled) {
+ return;
+ }
+
+ VkObjectType objectType = VK_OBJECT_TYPE_UNKNOWN;
+ if constexpr(std::is_same_v<VkObjectT, VkCommandBuffer>) {
+ objectType = VK_OBJECT_TYPE_COMMAND_BUFFER;
+ } else if constexpr(std::is_same_v<VkObjectT, VkCommandPool>) {
+ objectType = VK_OBJECT_TYPE_COMMAND_POOL;
+ } else if constexpr(std::is_same_v<VkObjectT, VkDescriptorSet>) {
+ objectType = VK_OBJECT_TYPE_DESCRIPTOR_SET;
+ } else if constexpr(std::is_same_v<VkObjectT, VkFramebuffer>) {
+ objectType = VK_OBJECT_TYPE_FRAMEBUFFER;
+ } else if constexpr(std::is_same_v<VkObjectT, VkImage>) {
+ objectType = VK_OBJECT_TYPE_IMAGE;
+ } else if constexpr(std::is_same_v<VkObjectT, VkImageView>) {
+ objectType = VK_OBJECT_TYPE_IMAGE_VIEW;
+ } else if constexpr(std::is_same_v<VkObjectT, VkPipeline>) {
+ objectType = VK_OBJECT_TYPE_PIPELINE;
+ } else if constexpr(std::is_same_v<VkObjectT, VkSampler>) {
+ objectType = VK_OBJECT_TYPE_SAMPLER;
+ } else {
+ static_assert(sizeof(VkObjectT) == 0,
+ "Unhandled VkObjectT. Please update DebugUtilsHelper.h.");
+ }
+
+ addDebugLabelToHandle((uint64_t)object, objectType, format, std::forward<T>(formatArgs)...);
+ }
+
+ void cmdBeginDebugLabel(VkCommandBuffer commandBuffer, const char* format, ...) const;
+ void cmdEndDebugLabel(VkCommandBuffer commandBuffer) const;
+
+ private:
+ DebugUtilsHelper(bool enabled, VkDevice device, const VulkanDispatch* dispatch);
+
+ void addDebugLabelToHandle(uint64_t object, VkObjectType objectType, const char* format,
+ ...) const;
+
+ bool m_debugUtilsEnabled = false;
+ VkDevice m_vkDevice = VK_NULL_HANDLE;
+ const VulkanDispatch* m_vk = nullptr;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/DisplaySurfaceVk.cpp b/src/gfxstream/host/vulkan/DisplaySurfaceVk.cpp
new file mode 100644
index 00000000000..4228b3eb83e
--- /dev/null
+++ b/src/gfxstream/host/vulkan/DisplaySurfaceVk.cpp
@@ -0,0 +1,63 @@
+// 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 "DisplaySurfaceVk.h"
+
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+#include "vk_util.h"
+
+namespace gfxstream {
+namespace vk {
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+std::unique_ptr<DisplaySurfaceVk> DisplaySurfaceVk::create(const VulkanDispatch& vk,
+ VkInstance instance,
+ FBNativeWindowType window) {
+ VkSurfaceKHR surface = VK_NULL_HANDLE;
+#ifdef _WIN32
+ const VkWin32SurfaceCreateInfoKHR surfaceCi = {
+ .sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
+ .pNext = nullptr,
+ .flags = 0,
+ .hinstance = GetModuleHandle(nullptr),
+ .hwnd = window,
+ };
+ VK_CHECK(vk.vkCreateWin32SurfaceKHR(instance, &surfaceCi, nullptr, &surface));
+#else
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Unimplemented.";
+#endif
+ if (surface == VK_NULL_HANDLE) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "No VkSurfaceKHR created?";
+ }
+
+ return std::unique_ptr<DisplaySurfaceVk>(new DisplaySurfaceVk(vk, instance, surface));
+}
+
+DisplaySurfaceVk::DisplaySurfaceVk(const VulkanDispatch& vk, VkInstance instance,
+ VkSurfaceKHR surface)
+ : mVk(vk), mInstance(instance), mSurface(surface) {}
+
+DisplaySurfaceVk::~DisplaySurfaceVk() {
+ if (mSurface != VK_NULL_HANDLE) {
+ mVk.vkDestroySurfaceKHR(mInstance, mSurface, nullptr);
+ }
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/DisplaySurfaceVk.h b/src/gfxstream/host/vulkan/DisplaySurfaceVk.h
new file mode 100644
index 00000000000..27d386cdf9a
--- /dev/null
+++ b/src/gfxstream/host/vulkan/DisplaySurfaceVk.h
@@ -0,0 +1,45 @@
+// 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.
+
+#pragma once
+
+#include <cstdint>
+#include <memory>
+
+#include "DisplaySurface.h"
+#include "render-utils/render_api_platform_types.h"
+#include "goldfish_vk_dispatch.h"
+
+namespace gfxstream {
+namespace vk {
+
+class DisplaySurfaceVk : public gfxstream::DisplaySurfaceImpl {
+ public:
+ static std::unique_ptr<DisplaySurfaceVk> create(const VulkanDispatch& vk, VkInstance vkInstance,
+ FBNativeWindowType window);
+
+ ~DisplaySurfaceVk();
+
+ VkSurfaceKHR getSurface() const { return mSurface; }
+
+ private:
+ DisplaySurfaceVk(const VulkanDispatch& vk, VkInstance vkInstance, VkSurfaceKHR vkSurface);
+
+ const VulkanDispatch& mVk;
+ VkInstance mInstance = VK_NULL_HANDLE;
+ VkSurfaceKHR mSurface = VK_NULL_HANDLE;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/DisplayVk.cpp b/src/gfxstream/host/vulkan/DisplayVk.cpp
new file mode 100644
index 00000000000..fbf1b42fd8c
--- /dev/null
+++ b/src/gfxstream/host/vulkan/DisplayVk.cpp
@@ -0,0 +1,765 @@
+#include "DisplayVk.h"
+
+#include <algorithm>
+#include <glm/glm.hpp>
+#include <glm/gtx/matrix_transform_2d.hpp>
+
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+#include "vulkan/VkFormatUtils.h"
+#include "vulkan/vk_enum_string_helper.h"
+
+namespace gfxstream {
+namespace vk {
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+using gfxstream::vk::formatIsDepthOrStencil;
+using gfxstream::vk::formatIsSInt;
+using gfxstream::vk::formatIsUInt;
+using gfxstream::vk::formatRequiresSamplerYcbcrConversion;
+
+#define DISPLAY_VK_ERROR(fmt, ...) \
+ do { \
+ fprintf(stderr, "%s(%s:%d): " fmt "\n", __func__, __FILE__, __LINE__, ##__VA_ARGS__); \
+ fflush(stderr); \
+ } while (0)
+
+#define DISPLAY_VK_ERROR_ONCE(fmt, ...) \
+ do { \
+ static bool displayVkInternalLogged = false; \
+ if (!displayVkInternalLogged) { \
+ DISPLAY_VK_ERROR(fmt, ##__VA_ARGS__); \
+ displayVkInternalLogged = true; \
+ } \
+ } while (0)
+
+namespace {
+
+bool shouldRecreateSwapchain(VkResult result) {
+ switch (result) {
+ case VK_SUBOPTIMAL_KHR:
+ case VK_ERROR_OUT_OF_DATE_KHR:
+ // b/217229121: drivers may return VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT in
+ // vkQueuePresentKHR even if VK_EXT_full_screen_exclusive is not enabled.
+ case VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+} // namespace
+
+DisplayVk::DisplayVk(const VulkanDispatch& vk, VkPhysicalDevice vkPhysicalDevice,
+ uint32_t swapChainQueueFamilyIndex, uint32_t compositorQueueFamilyIndex,
+ VkDevice vkDevice, VkQueue compositorVkQueue,
+ std::shared_ptr<android::base::Lock> compositorVkQueueLock,
+ VkQueue swapChainVkqueue,
+ std::shared_ptr<android::base::Lock> swapChainVkQueueLock)
+ : m_vk(vk),
+ m_vkPhysicalDevice(vkPhysicalDevice),
+ m_swapChainQueueFamilyIndex(swapChainQueueFamilyIndex),
+ m_compositorQueueFamilyIndex(compositorQueueFamilyIndex),
+ m_vkDevice(vkDevice),
+ m_compositorVkQueue(compositorVkQueue),
+ m_compositorVkQueueLock(compositorVkQueueLock),
+ m_swapChainVkQueue(swapChainVkqueue),
+ m_swapChainVkQueueLock(swapChainVkQueueLock),
+ m_vkCommandPool(VK_NULL_HANDLE),
+ m_swapChainStateVk(nullptr) {
+ // TODO(kaiyili): validate the capabilites of the passed in Vulkan
+ // components.
+ VkCommandPoolCreateInfo commandPoolCi = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
+ .flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
+ .queueFamilyIndex = m_compositorQueueFamilyIndex,
+ };
+ VK_CHECK(m_vk.vkCreateCommandPool(m_vkDevice, &commandPoolCi, nullptr, &m_vkCommandPool));
+ constexpr size_t imageBorrowResourcePoolSize = 10;
+ for (size_t i = 0; i < imageBorrowResourcePoolSize; i++) {
+ m_imageBorrowResources.emplace_back(
+ ImageBorrowResource::create(m_vk, m_vkDevice, m_vkCommandPool));
+ }
+}
+
+DisplayVk::~DisplayVk() {
+ destroySwapchain();
+ m_imageBorrowResources.clear();
+ m_vk.vkDestroyCommandPool(m_vkDevice, m_vkCommandPool, nullptr);
+}
+
+void DisplayVk::drainQueues() {
+ {
+ android::base::AutoLock lock(*m_swapChainVkQueueLock);
+ VK_CHECK(vk_util::waitForVkQueueIdleWithRetry(m_vk, m_swapChainVkQueue));
+ }
+ // We don't assume all VkCommandBuffer submitted to m_compositorVkQueueLock is always followed
+ // by another operation on the m_swapChainVkQueue. Therefore, only waiting for the
+ // m_swapChainVkQueue is not enough to guarantee all resources used are free to be destroyed.
+ {
+ android::base::AutoLock lock(*m_compositorVkQueueLock);
+ VK_CHECK(vk_util::waitForVkQueueIdleWithRetry(m_vk, m_compositorVkQueue));
+ }
+}
+
+void DisplayVk::bindToSurfaceImpl(gfxstream::DisplaySurface* surface) {
+ m_needToRecreateSwapChain = true;
+}
+
+void DisplayVk::surfaceUpdated(gfxstream::DisplaySurface* surface) {
+ m_needToRecreateSwapChain = true;
+}
+
+void DisplayVk::unbindFromSurfaceImpl() { destroySwapchain(); }
+
+void DisplayVk::destroySwapchain() {
+ drainQueues();
+ m_freePostResources.clear();
+ m_postResourceFutures.clear();
+ m_swapChainStateVk.reset();
+ m_needToRecreateSwapChain = true;
+}
+
+bool DisplayVk::recreateSwapchain() {
+ destroySwapchain();
+
+ const auto* surface = getBoundSurface();
+ if (!surface) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "DisplayVk can't create VkSwapchainKHR without a VkSurfaceKHR";
+ }
+ const auto* surfaceVk = static_cast<const DisplaySurfaceVk*>(surface->getImpl());
+
+ if (!SwapChainStateVk::validateQueueFamilyProperties(
+ m_vk, m_vkPhysicalDevice, surfaceVk->getSurface(), m_swapChainQueueFamilyIndex)) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "DisplayVk can't create VkSwapchainKHR with given VkDevice and VkSurfaceKHR.";
+ }
+ INFO("Creating swapchain with size %" PRIu32 "x%" PRIu32 ".", surface->getWidth(),
+ surface->getHeight());
+ auto swapChainCi = SwapChainStateVk::createSwapChainCi(
+ m_vk, surfaceVk->getSurface(), m_vkPhysicalDevice, surface->getWidth(),
+ surface->getHeight(), {m_swapChainQueueFamilyIndex, m_compositorQueueFamilyIndex});
+ if (!swapChainCi) {
+ return false;
+ }
+ VkFormatProperties formatProps;
+ m_vk.vkGetPhysicalDeviceFormatProperties(m_vkPhysicalDevice,
+ swapChainCi->mCreateInfo.imageFormat, &formatProps);
+ if (!(formatProps.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "DisplayVk: The image format chosen for present VkImage can't be used as the color "
+ "attachment, and therefore can't be used as the render target of CompositorVk.";
+ }
+ m_swapChainStateVk =
+ SwapChainStateVk::createSwapChainVk(m_vk, m_vkDevice, swapChainCi->mCreateInfo);
+ if (m_swapChainStateVk == nullptr) return false;
+ int numSwapChainImages = m_swapChainStateVk->getVkImages().size();
+
+ m_postResourceFutures.resize(numSwapChainImages, std::nullopt);
+ for (uint32_t i = 0; i < numSwapChainImages + 1; ++i) {
+ m_freePostResources.emplace_back(PostResource::create(m_vk, m_vkDevice, m_vkCommandPool));
+ }
+
+ m_inFlightFrameIndex = 0;
+ m_needToRecreateSwapChain = false;
+ return true;
+}
+
+DisplayVk::PostResult DisplayVk::post(const BorrowedImageInfo* sourceImageInfo) {
+ auto completedFuture = std::async(std::launch::deferred, [] {}).share();
+ completedFuture.wait();
+
+ const auto* surface = getBoundSurface();
+ if (!surface) {
+ ERR("Trying to present to non-existing surface!");
+ return PostResult{
+ .success = true,
+ .postCompletedWaitable = completedFuture,
+ };
+ }
+
+ if (m_needToRecreateSwapChain) {
+ INFO("Recreating swapchain...");
+
+ constexpr const int kMaxRecreateSwapchainRetries = 8;
+ int retriesRemaining = kMaxRecreateSwapchainRetries;
+ while (retriesRemaining >= 0 && !recreateSwapchain()) {
+ std::this_thread::sleep_for(std::chrono::milliseconds(1));
+ --retriesRemaining;
+ INFO("Swapchain recreation failed, retrying...");
+ }
+
+ if (retriesRemaining < 0) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Failed to create Swapchain."
+ << " w:" << surface->getWidth() << " h:" << surface->getHeight();
+ }
+
+ INFO("Recreating swapchain completed.");
+ }
+
+ auto result = postImpl(sourceImageInfo);
+ if (!result.success) {
+ m_needToRecreateSwapChain = true;
+ }
+ return result;
+}
+
+DisplayVk::PostResult DisplayVk::postImpl(const BorrowedImageInfo* sourceImageInfo) {
+ auto completedFuture = std::async(std::launch::deferred, [] {}).share();
+ completedFuture.wait();
+
+ // One for acquire, one for release.
+ const ImageBorrowResource* imageBorrowResources[2] = {nullptr};
+ for (size_t i = 0; i < std::size(imageBorrowResources); i++) {
+ auto freeImageBorrowResource =
+ std::find_if(m_imageBorrowResources.begin(), m_imageBorrowResources.end(),
+ [this](const std::unique_ptr<ImageBorrowResource>& imageBorrowResource) {
+ VkResult fenceStatus = m_vk.vkGetFenceStatus(
+ m_vkDevice, imageBorrowResource->m_completeFence);
+ if (fenceStatus == VK_SUCCESS) { return true; }
+ if (fenceStatus == VK_NOT_READY) { return false; }
+ VK_CHECK(fenceStatus);
+ return false;
+ });
+ if (freeImageBorrowResource == m_imageBorrowResources.end()) {
+ freeImageBorrowResource = m_imageBorrowResources.begin();
+ VK_CHECK(m_vk.vkWaitForFences(
+ m_vkDevice, 1, &(*freeImageBorrowResource)->m_completeFence, VK_TRUE, UINT64_MAX));
+ }
+ VK_CHECK(m_vk.vkResetFences(m_vkDevice, 1, &(*freeImageBorrowResource)->m_completeFence));
+ imageBorrowResources[i] = freeImageBorrowResource->get();
+ }
+ // We need to unconditionally acquire and release the image to satisfy the requiremment for the
+ // borrowed image.
+ const auto* sourceImageInfoVk = static_cast<const BorrowedImageInfoVk*>(sourceImageInfo);
+ struct ImageBorrower {
+ ImageBorrower(const VulkanDispatch& vk, VkQueue queue,
+ std::shared_ptr<android::base::Lock> queueLock, uint32_t usedQueueFamilyIndex,
+ const BorrowedImageInfoVk& image, const ImageBorrowResource& acquireResource,
+ const ImageBorrowResource& releaseResource)
+ : m_vk(vk),
+ m_vkQueue(queue),
+ m_queueLock(queueLock),
+ m_releaseResource(releaseResource) {
+ std::vector<VkImageMemoryBarrier> acquireQueueTransferBarriers;
+ std::vector<VkImageMemoryBarrier> acquireLayoutTransitionBarriers;
+ std::vector<VkImageMemoryBarrier> releaseLayoutTransitionBarriers;
+ std::vector<VkImageMemoryBarrier> releaseQueueTransferBarriers;
+ addNeededBarriersToUseBorrowedImage(
+ image, usedQueueFamilyIndex,
+ /*usedInitialImageLayout=*/VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ /*usedFinalImageLayout=*/VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ VK_ACCESS_TRANSFER_READ_BIT, &acquireQueueTransferBarriers,
+ &acquireLayoutTransitionBarriers, &releaseLayoutTransitionBarriers,
+ &releaseQueueTransferBarriers);
+
+ // Record the acquire commands.
+ const VkCommandBufferBeginInfo acquireBeginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+ VK_CHECK(
+ m_vk.vkBeginCommandBuffer(acquireResource.m_vkCommandBuffer, &acquireBeginInfo));
+ if (!acquireQueueTransferBarriers.empty()) {
+ m_vk.vkCmdPipelineBarrier(
+ acquireResource.m_vkCommandBuffer,
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT,
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ static_cast<uint32_t>(acquireQueueTransferBarriers.size()),
+ acquireQueueTransferBarriers.data());
+ }
+ if (!acquireLayoutTransitionBarriers.empty()) {
+ m_vk.vkCmdPipelineBarrier(
+ acquireResource.m_vkCommandBuffer,
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT,
+ VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, nullptr, 0, nullptr,
+ static_cast<uint32_t>(acquireLayoutTransitionBarriers.size()),
+ acquireLayoutTransitionBarriers.data());
+ }
+ VK_CHECK(m_vk.vkEndCommandBuffer(acquireResource.m_vkCommandBuffer));
+
+ // Record the release commands.
+ const VkCommandBufferBeginInfo releaseBeginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+ VK_CHECK(
+ m_vk.vkBeginCommandBuffer(releaseResource.m_vkCommandBuffer, &releaseBeginInfo));
+ if (!releaseLayoutTransitionBarriers.empty()) {
+ m_vk.vkCmdPipelineBarrier(
+ releaseResource.m_vkCommandBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr,
+ static_cast<uint32_t>(releaseLayoutTransitionBarriers.size()),
+ releaseLayoutTransitionBarriers.data());
+ }
+ if (!releaseQueueTransferBarriers.empty()) {
+ m_vk.vkCmdPipelineBarrier(
+ releaseResource.m_vkCommandBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr,
+ static_cast<uint32_t>(releaseQueueTransferBarriers.size()),
+ releaseQueueTransferBarriers.data());
+ }
+ VK_CHECK(m_vk.vkEndCommandBuffer(releaseResource.m_vkCommandBuffer));
+
+ VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .waitSemaphoreCount = 0,
+ .pWaitSemaphores = nullptr,
+ .pWaitDstStageMask = nullptr,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &acquireResource.m_vkCommandBuffer,
+ .signalSemaphoreCount = 0,
+ .pSignalSemaphores = nullptr,
+ };
+ // Submit the acquire commands.
+ {
+ android::base::AutoLock lock(*m_queueLock);
+ VK_CHECK(
+ m_vk.vkQueueSubmit(m_vkQueue, 1, &submitInfo, acquireResource.m_completeFence));
+ }
+ }
+
+ const VulkanDispatch& m_vk;
+ const VkQueue m_vkQueue;
+ std::shared_ptr<android::base::Lock> m_queueLock;
+ const ImageBorrowResource& m_releaseResource;
+ ~ImageBorrower() {
+ VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .waitSemaphoreCount = 0,
+ .pWaitSemaphores = nullptr,
+ .pWaitDstStageMask = nullptr,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &m_releaseResource.m_vkCommandBuffer,
+ .signalSemaphoreCount = 0,
+ .pSignalSemaphores = nullptr,
+ };
+ // Submit the release commands.
+ {
+ android::base::AutoLock lock(*m_queueLock);
+ VK_CHECK(m_vk.vkQueueSubmit(m_vkQueue, 1, &submitInfo,
+ m_releaseResource.m_completeFence));
+ }
+ }
+ } imageBorrower(m_vk, m_compositorVkQueue, m_compositorVkQueueLock,
+ m_compositorQueueFamilyIndex, *sourceImageInfoVk, *imageBorrowResources[0],
+ *imageBorrowResources[1]);
+
+ const auto* surface = getBoundSurface();
+ if (!m_swapChainStateVk || !surface) {
+ DISPLAY_VK_ERROR("Haven't bound to a surface, can't post ColorBuffer.");
+ return PostResult{true, std::move(completedFuture)};
+ }
+
+ if (!canPost(sourceImageInfoVk->imageCreateInfo)) {
+ DISPLAY_VK_ERROR("Can't post ColorBuffer.");
+ return PostResult{true, std::move(completedFuture)};
+ }
+
+ for (auto& postResourceFutureOpt : m_postResourceFutures) {
+ if (!postResourceFutureOpt.has_value()) {
+ continue;
+ }
+ auto postResourceFuture = postResourceFutureOpt.value();
+ if (!postResourceFuture.valid()) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Invalid postResourceFuture in m_postResourceFutures.";
+ }
+ std::future_status status = postResourceFuture.wait_for(std::chrono::seconds(0));
+ if (status == std::future_status::ready) {
+ m_freePostResources.emplace_back(postResourceFuture.get());
+ postResourceFutureOpt = std::nullopt;
+ }
+ }
+ if (m_freePostResources.empty()) {
+ for (auto& postResourceFutureOpt : m_postResourceFutures) {
+ if (!postResourceFutureOpt.has_value()) {
+ continue;
+ }
+ m_freePostResources.emplace_back(postResourceFutureOpt.value().get());
+ postResourceFutureOpt = std::nullopt;
+ break;
+ }
+ }
+ std::shared_ptr<PostResource> postResource = m_freePostResources.front();
+ m_freePostResources.pop_front();
+
+ VkSemaphore imageReadySem = postResource->m_swapchainImageAcquireSemaphore;
+
+ uint32_t imageIndex;
+ VkResult acquireRes =
+ m_vk.vkAcquireNextImageKHR(m_vkDevice, m_swapChainStateVk->getSwapChain(), UINT64_MAX,
+ imageReadySem, VK_NULL_HANDLE, &imageIndex);
+ if (shouldRecreateSwapchain(acquireRes)) {
+ return PostResult{false, std::shared_future<void>()};
+ }
+ VK_CHECK(acquireRes);
+
+ if (m_postResourceFutures[imageIndex].has_value()) {
+ m_freePostResources.emplace_back(m_postResourceFutures[imageIndex].value().get());
+ m_postResourceFutures[imageIndex] = std::nullopt;
+ }
+
+ VkCommandBuffer cmdBuff = postResource->m_vkCommandBuffer;
+ VK_CHECK(m_vk.vkResetCommandBuffer(cmdBuff, 0));
+
+ const VkCommandBufferBeginInfo beginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+ VK_CHECK(m_vk.vkBeginCommandBuffer(cmdBuff, &beginInfo));
+
+ VkImageMemoryBarrier acquireSwapchainImageBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = VK_PIPELINE_STAGE_TRANSFER_BIT,
+ .dstAccessMask = VK_PIPELINE_STAGE_TRANSFER_BIT,
+ .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
+ .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = m_swapChainStateVk->getVkImages()[imageIndex],
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ m_vk.vkCmdPipelineBarrier(cmdBuff, VK_PIPELINE_STAGE_TRANSFER_BIT,
+ VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &acquireSwapchainImageBarrier);
+
+ // Note: The extent used during swapchain creation must be used here and not the
+ // current surface's extent as the swapchain may not have been updated after the
+ // surface resized. The blit must not try to write outside of the extent of the
+ // existing swapchain images.
+ const VkExtent2D swapchainImageExtent = m_swapChainStateVk->getImageExtent();
+ const VkImageBlit region = {
+ .srcSubresource = {.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1},
+ .srcOffsets = {{0, 0, 0},
+ {static_cast<int32_t>(sourceImageInfoVk->imageCreateInfo.extent.width),
+ static_cast<int32_t>(sourceImageInfoVk->imageCreateInfo.extent.height), 1}},
+ .dstSubresource = {.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1},
+ .dstOffsets = {{0, 0, 0},
+ {static_cast<int32_t>(swapchainImageExtent.width),
+ static_cast<int32_t>(swapchainImageExtent.height), 1}},
+ };
+ VkFormat displayBufferFormat = sourceImageInfoVk->imageCreateInfo.format;
+ VkImageTiling displayBufferTiling = sourceImageInfoVk->imageCreateInfo.tiling;
+ VkFilter filter = VK_FILTER_NEAREST;
+ VkFormatFeatureFlags displayBufferFormatFeatures =
+ getFormatFeatures(displayBufferFormat, displayBufferTiling);
+ if (formatIsDepthOrStencil(displayBufferFormat)) {
+ DISPLAY_VK_ERROR_ONCE(
+ "The format of the display buffer, %s, is a depth/stencil format, we can only use the "
+ "VK_FILTER_NEAREST filter according to VUID-vkCmdBlitImage-srcImage-00232.",
+ string_VkFormat(displayBufferFormat));
+ filter = VK_FILTER_NEAREST;
+ } else if (!(displayBufferFormatFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT)) {
+ DISPLAY_VK_ERROR_ONCE(
+ "The format of the display buffer, %s, with the tiling, %s, doesn't support "
+ "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, so we can only use the "
+ "VK_FILTER_NEAREST filter according VUID-vkCmdBlitImage-filter-02001. The supported "
+ "features are %s.",
+ string_VkFormat(displayBufferFormat), string_VkImageTiling(displayBufferTiling),
+ string_VkFormatFeatureFlags(displayBufferFormatFeatures).c_str());
+ filter = VK_FILTER_NEAREST;
+ } else {
+ filter = VK_FILTER_LINEAR;
+ }
+ m_vk.vkCmdBlitImage(cmdBuff, sourceImageInfoVk->image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ m_swapChainStateVk->getVkImages()[imageIndex],
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &region, filter);
+
+ VkImageMemoryBarrier releaseSwapchainImageBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .srcAccessMask = VK_PIPELINE_STAGE_TRANSFER_BIT,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT,
+ .oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = m_swapChainStateVk->getVkImages()[imageIndex],
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ m_vk.vkCmdPipelineBarrier(cmdBuff, VK_PIPELINE_STAGE_TRANSFER_BIT,
+ VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &releaseSwapchainImageBarrier);
+
+ VK_CHECK(m_vk.vkEndCommandBuffer(cmdBuff));
+
+ VkFence postCompleteFence = postResource->m_swapchainImageReleaseFence;
+ VK_CHECK(m_vk.vkResetFences(m_vkDevice, 1, &postCompleteFence));
+ VkSemaphore postCompleteSemaphore = postResource->m_swapchainImageReleaseSemaphore;
+ VkPipelineStageFlags waitStages[] = {VK_PIPELINE_STAGE_TRANSFER_BIT};
+ VkSubmitInfo submitInfo = {.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .waitSemaphoreCount = 1,
+ .pWaitSemaphores = &imageReadySem,
+ .pWaitDstStageMask = waitStages,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &cmdBuff,
+ .signalSemaphoreCount = 1,
+ .pSignalSemaphores = &postCompleteSemaphore};
+ {
+ android::base::AutoLock lock(*m_compositorVkQueueLock);
+ VK_CHECK(m_vk.vkQueueSubmit(m_compositorVkQueue, 1, &submitInfo, postCompleteFence));
+ }
+ std::shared_future<std::shared_ptr<PostResource>> postResourceFuture =
+ std::async(std::launch::deferred, [postCompleteFence, postResource, this]() mutable {
+ VkResult res = m_vk.vkWaitForFences(m_vkDevice, 1, &postCompleteFence, VK_TRUE,
+ kVkWaitForFencesTimeoutNsecs);
+ if (res == VK_SUCCESS) {
+ return postResource;
+ }
+ if (res == VK_TIMEOUT) {
+ // Retry. If device lost, hopefully this returns immediately.
+ res = m_vk.vkWaitForFences(m_vkDevice, 1, &postCompleteFence, VK_TRUE,
+ kVkWaitForFencesTimeoutNsecs);
+ }
+ VK_CHECK(res);
+ return postResource;
+ }).share();
+ m_postResourceFutures[imageIndex] = postResourceFuture;
+
+ auto swapChain = m_swapChainStateVk->getSwapChain();
+ VkPresentInfoKHR presentInfo = {.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,
+ .waitSemaphoreCount = 1,
+ .pWaitSemaphores = &postCompleteSemaphore,
+ .swapchainCount = 1,
+ .pSwapchains = &swapChain,
+ .pImageIndices = &imageIndex};
+ VkResult presentRes;
+ {
+ android::base::AutoLock lock(*m_swapChainVkQueueLock);
+ presentRes = m_vk.vkQueuePresentKHR(m_swapChainVkQueue, &presentInfo);
+ }
+ if (shouldRecreateSwapchain(presentRes)) {
+ postResourceFuture.wait();
+ return PostResult{false, std::shared_future<void>()};
+ }
+ VK_CHECK(presentRes);
+ return PostResult{true, std::async(std::launch::deferred, [postResourceFuture] {
+ // We can't directly wait for the VkFence here, because we
+ // share the VkFences on different frames, but we don't share
+ // the future on different frames. If we directly wait for the
+ // VkFence here, we may wait for a different frame if a new
+ // frame starts to be drawn before this future is waited.
+ postResourceFuture.wait();
+ }).share()};
+}
+
+VkFormatFeatureFlags DisplayVk::getFormatFeatures(VkFormat format, VkImageTiling tiling) {
+ auto i = m_vkFormatProperties.find(format);
+ if (i == m_vkFormatProperties.end()) {
+ VkFormatProperties formatProperties;
+ m_vk.vkGetPhysicalDeviceFormatProperties(m_vkPhysicalDevice, format, &formatProperties);
+ i = m_vkFormatProperties.emplace(format, formatProperties).first;
+ }
+ const VkFormatProperties& formatProperties = i->second;
+ VkFormatFeatureFlags formatFeatures = 0;
+ if (tiling == VK_IMAGE_TILING_LINEAR) {
+ formatFeatures = formatProperties.linearTilingFeatures;
+ } else if (tiling == VK_IMAGE_TILING_OPTIMAL) {
+ formatFeatures = formatProperties.optimalTilingFeatures;
+ } else {
+ DISPLAY_VK_ERROR("Unknown tiling %#" PRIx64 ".", static_cast<uint64_t>(tiling));
+ }
+ return formatFeatures;
+}
+
+bool DisplayVk::canPost(const VkImageCreateInfo& postImageCi) {
+ // According to VUID-vkCmdBlitImage-srcImage-01999, the format features of srcImage must contain
+ // VK_FORMAT_FEATURE_BLIT_SRC_BIT.
+ VkFormatFeatureFlags formatFeatures = getFormatFeatures(postImageCi.format, postImageCi.tiling);
+ if (!(formatFeatures & VK_FORMAT_FEATURE_BLIT_SRC_BIT)) {
+ DISPLAY_VK_ERROR(
+ "VK_FORMAT_FEATURE_BLIT_SRC_BLIT is not supported for VkImage with format %s, tilling "
+ "%s. Supported features are %s.",
+ string_VkFormat(postImageCi.format), string_VkImageTiling(postImageCi.tiling),
+ string_VkFormatFeatureFlags(formatFeatures).c_str());
+ return false;
+ }
+
+ // According to VUID-vkCmdBlitImage-srcImage-06421, srcImage must not use a format that requires
+ // a sampler Y’CBCR conversion.
+ if (formatRequiresSamplerYcbcrConversion(postImageCi.format)) {
+ DISPLAY_VK_ERROR("Format %s requires a sampler Y'CbCr conversion. Can't be used to post.",
+ string_VkFormat(postImageCi.format));
+ return false;
+ }
+
+ if (!(postImageCi.usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT)) {
+ // According to VUID-vkCmdBlitImage-srcImage-00219, srcImage must have been created with
+ // VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag.
+ DISPLAY_VK_ERROR(
+ "The VkImage is not created with the VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag. The "
+ "usage flags are %s.",
+ string_VkImageUsageFlags(postImageCi.usage).c_str());
+ return false;
+ }
+
+ VkFormat swapChainFormat = m_swapChainStateVk->getFormat();
+ if (formatIsSInt(postImageCi.format) || formatIsSInt(swapChainFormat)) {
+ // According to VUID-vkCmdBlitImage-srcImage-00229, if either of srcImage or dstImage was
+ // created with a signed integer VkFormat, the other must also have been created with a
+ // signed integer VkFormat.
+ if (!(formatIsSInt(postImageCi.format) && formatIsSInt(m_swapChainStateVk->getFormat()))) {
+ DISPLAY_VK_ERROR(
+ "The format(%s) doesn't match with the format of the presentable image(%s): either "
+ "of the formats is a signed integer VkFormat, but the other is not.",
+ string_VkFormat(postImageCi.format), string_VkFormat(swapChainFormat));
+ return false;
+ }
+ }
+
+ if (formatIsUInt(postImageCi.format) || formatIsUInt(swapChainFormat)) {
+ // According to VUID-vkCmdBlitImage-srcImage-00230, if either of srcImage or dstImage was
+ // created with an unsigned integer VkFormat, the other must also have been created with an
+ // unsigned integer VkFormat.
+ if (!(formatIsUInt(postImageCi.format) && formatIsUInt(swapChainFormat))) {
+ DISPLAY_VK_ERROR(
+ "The format(%s) doesn't match with the format of the presentable image(%s): either "
+ "of the formats is an unsigned integer VkFormat, but the other is not.",
+ string_VkFormat(postImageCi.format), string_VkFormat(swapChainFormat));
+ return false;
+ }
+ }
+
+ if (formatIsDepthOrStencil(postImageCi.format) || formatIsDepthOrStencil(swapChainFormat)) {
+ // According to VUID-vkCmdBlitImage-srcImage-00231, if either of srcImage or dstImage was
+ // created with a depth/stencil format, the other must have exactly the same format.
+ if (postImageCi.format != swapChainFormat) {
+ DISPLAY_VK_ERROR(
+ "The format(%s) doesn't match with the format of the presentable image(%s): either "
+ "of the formats is a depth/stencil VkFormat, but the other is not the same format.",
+ string_VkFormat(postImageCi.format), string_VkFormat(swapChainFormat));
+ return false;
+ }
+ }
+
+ if (postImageCi.samples != VK_SAMPLE_COUNT_1_BIT) {
+ // According to VUID-vkCmdBlitImage-srcImage-00233, srcImage must have been created with a
+ // samples value of VK_SAMPLE_COUNT_1_BIT.
+ DISPLAY_VK_ERROR(
+ "The VkImage is not created with the VK_SAMPLE_COUNT_1_BIT samples value. The samples "
+ "value is %s.",
+ string_VkSampleCountFlagBits(postImageCi.samples));
+ return false;
+ }
+ if (postImageCi.flags & VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT) {
+ // According to VUID-vkCmdBlitImage-dstImage-02545, dstImage and srcImage must not have been
+ // created with flags containing VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT.
+ DISPLAY_VK_ERROR(
+ "The VkImage can't be created with flags containing "
+ "VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT. The flags are %s.",
+ string_VkImageCreateFlags(postImageCi.flags).c_str());
+ return false;
+ }
+ return true;
+}
+
+std::shared_ptr<DisplayVk::PostResource> DisplayVk::PostResource::create(
+ const VulkanDispatch& vk, VkDevice vkDevice, VkCommandPool vkCommandPool) {
+ VkFenceCreateInfo fenceCi = {
+ .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ };
+ VkFence fence;
+ VK_CHECK(vk.vkCreateFence(vkDevice, &fenceCi, nullptr, &fence));
+ VkSemaphore semaphores[2];
+ for (uint32_t i = 0; i < std::size(semaphores); i++) {
+ VkSemaphoreCreateInfo semaphoreCi = {
+ .sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
+ };
+ VK_CHECK(vk.vkCreateSemaphore(vkDevice, &semaphoreCi, nullptr, &semaphores[i]));
+ }
+ VkCommandBuffer commandBuffer;
+ VkCommandBufferAllocateInfo commandBufferAllocInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ .commandPool = vkCommandPool,
+ .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
+ .commandBufferCount = 1,
+ };
+ VK_CHECK(vk.vkAllocateCommandBuffers(vkDevice, &commandBufferAllocInfo, &commandBuffer));
+ return std::shared_ptr<PostResource>(new PostResource(
+ vk, vkDevice, vkCommandPool, fence, semaphores[0], semaphores[1], commandBuffer));
+}
+
+DisplayVk::PostResource::~PostResource() {
+ m_vk.vkFreeCommandBuffers(m_vkDevice, m_vkCommandPool, 1, &m_vkCommandBuffer);
+ m_vk.vkDestroyFence(m_vkDevice, m_swapchainImageReleaseFence, nullptr);
+ m_vk.vkDestroySemaphore(m_vkDevice, m_swapchainImageAcquireSemaphore, nullptr);
+ m_vk.vkDestroySemaphore(m_vkDevice, m_swapchainImageReleaseSemaphore, nullptr);
+}
+
+DisplayVk::PostResource::PostResource(const VulkanDispatch& vk, VkDevice vkDevice,
+ VkCommandPool vkCommandPool,
+ VkFence swapchainImageReleaseFence,
+ VkSemaphore swapchainImageAcquireSemaphore,
+ VkSemaphore swapchainImageReleaseSemaphore,
+ VkCommandBuffer vkCommandBuffer)
+ : m_swapchainImageReleaseFence(swapchainImageReleaseFence),
+ m_swapchainImageAcquireSemaphore(swapchainImageAcquireSemaphore),
+ m_swapchainImageReleaseSemaphore(swapchainImageReleaseSemaphore),
+ m_vkCommandBuffer(vkCommandBuffer),
+ m_vk(vk),
+ m_vkDevice(vkDevice),
+ m_vkCommandPool(vkCommandPool) {}
+
+std::unique_ptr<DisplayVk::ImageBorrowResource> DisplayVk::ImageBorrowResource::create(
+ const VulkanDispatch& vk, VkDevice device, VkCommandPool commandPool) {
+ const VkCommandBufferAllocateInfo allocInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ .pNext = nullptr,
+ .commandPool = commandPool,
+ .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
+ .commandBufferCount = 1,
+ };
+ VkCommandBuffer commandBuffer = VK_NULL_HANDLE;
+ VK_CHECK(vk.vkAllocateCommandBuffers(device, &allocInfo, &commandBuffer));
+ const VkFenceCreateInfo fenceCi = {
+ .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ .pNext = nullptr,
+ .flags = VK_FENCE_CREATE_SIGNALED_BIT,
+ };
+ VkFence fence = VK_NULL_HANDLE;
+ VK_CHECK(vk.vkCreateFence(device, &fenceCi, nullptr, &fence));
+ return std::unique_ptr<ImageBorrowResource>(
+ new ImageBorrowResource(vk, device, commandPool, fence, commandBuffer));
+}
+
+DisplayVk::ImageBorrowResource::~ImageBorrowResource() {
+ m_vk.vkFreeCommandBuffers(m_vkDevice, m_vkCommandPool, 1, &m_vkCommandBuffer);
+}
+
+DisplayVk::ImageBorrowResource::ImageBorrowResource(const VulkanDispatch& vk, VkDevice device,
+ VkCommandPool commandPool, VkFence fence,
+ VkCommandBuffer commandBuffer)
+ : m_completeFence(fence),
+ m_vkCommandBuffer(commandBuffer),
+ m_vk(vk),
+ m_vkDevice(device),
+ m_vkCommandPool(commandPool) {}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/DisplayVk.h b/src/gfxstream/host/vulkan/DisplayVk.h
new file mode 100644
index 00000000000..00eff763cfc
--- /dev/null
+++ b/src/gfxstream/host/vulkan/DisplayVk.h
@@ -0,0 +1,121 @@
+#ifndef DISPLAY_VK_H
+#define DISPLAY_VK_H
+
+#include <deque>
+#include <functional>
+#include <future>
+#include <memory>
+#include <optional>
+#include <tuple>
+#include <unordered_map>
+#include <unordered_set>
+
+#include "BorrowedImage.h"
+#include "CompositorVk.h"
+#include "Display.h"
+#include "DisplaySurfaceVk.h"
+#include "Hwc2.h"
+#include "SwapChainStateVk.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "goldfish_vk_dispatch.h"
+
+// The DisplayVk class holds the Vulkan and other states required to draw a
+// frame in a host window.
+
+namespace gfxstream {
+namespace vk {
+
+class DisplayVk : public gfxstream::Display {
+ public:
+ DisplayVk(const VulkanDispatch&, VkPhysicalDevice, uint32_t swapChainQueueFamilyIndex,
+ uint32_t compositorQueueFamilyIndex, VkDevice, VkQueue compositorVkQueue,
+ std::shared_ptr<android::base::Lock> compositorVkQueueLock, VkQueue swapChainVkQueue,
+ std::shared_ptr<android::base::Lock> swapChainVkQueueLock);
+ ~DisplayVk();
+
+ PostResult post(const BorrowedImageInfo* info);
+
+ void drainQueues();
+
+ protected:
+ void bindToSurfaceImpl(gfxstream::DisplaySurface* surface) override;
+ void surfaceUpdated(gfxstream::DisplaySurface* surface) override;
+ void unbindFromSurfaceImpl() override;
+
+ private:
+ void destroySwapchain();
+ bool recreateSwapchain();
+
+ // The success component of the result is false when the swapchain is no longer valid and
+ // bindToSurface() needs to be called again. When the success component is true, the waitable
+ // component of the returned result is a future that will complete when the GPU side of work
+ // completes. The caller is responsible to guarantee the synchronization and the layout of
+ // ColorBufferCompositionInfo::m_vkImage is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL.
+ PostResult postImpl(const BorrowedImageInfo* info);
+
+ VkFormatFeatureFlags getFormatFeatures(VkFormat, VkImageTiling);
+ bool canPost(const VkImageCreateInfo&);
+
+ const VulkanDispatch& m_vk;
+ VkPhysicalDevice m_vkPhysicalDevice;
+ uint32_t m_swapChainQueueFamilyIndex;
+ uint32_t m_compositorQueueFamilyIndex;
+ VkDevice m_vkDevice;
+ VkQueue m_compositorVkQueue;
+ std::shared_ptr<android::base::Lock> m_compositorVkQueueLock;
+ VkQueue m_swapChainVkQueue;
+ std::shared_ptr<android::base::Lock> m_swapChainVkQueueLock;
+ VkCommandPool m_vkCommandPool;
+
+ class PostResource {
+ public:
+ const VkFence m_swapchainImageReleaseFence;
+ const VkSemaphore m_swapchainImageAcquireSemaphore;
+ const VkSemaphore m_swapchainImageReleaseSemaphore;
+ const VkCommandBuffer m_vkCommandBuffer;
+ static std::shared_ptr<PostResource> create(const VulkanDispatch&, VkDevice, VkCommandPool);
+ ~PostResource();
+ DISALLOW_COPY_ASSIGN_AND_MOVE(PostResource);
+
+ private:
+ PostResource(const VulkanDispatch&, VkDevice, VkCommandPool,
+ VkFence swapchainImageReleaseFence, VkSemaphore swapchainImageAcquireSemaphore,
+ VkSemaphore swapchainImageReleaseSemaphore, VkCommandBuffer);
+ const VulkanDispatch& m_vk;
+ const VkDevice m_vkDevice;
+ const VkCommandPool m_vkCommandPool;
+ };
+
+ std::deque<std::shared_ptr<PostResource>> m_freePostResources;
+ std::vector<std::optional<std::shared_future<std::shared_ptr<PostResource>>>>
+ m_postResourceFutures;
+ int m_inFlightFrameIndex;
+
+ class ImageBorrowResource {
+ public:
+ const VkFence m_completeFence;
+ const VkCommandBuffer m_vkCommandBuffer;
+ static std::unique_ptr<ImageBorrowResource> create(const VulkanDispatch&, VkDevice,
+ VkCommandPool);
+ ~ImageBorrowResource();
+ DISALLOW_COPY_ASSIGN_AND_MOVE(ImageBorrowResource);
+
+ private:
+ ImageBorrowResource(const VulkanDispatch&, VkDevice, VkCommandPool, VkFence,
+ VkCommandBuffer);
+ const VulkanDispatch& m_vk;
+ const VkDevice m_vkDevice;
+ const VkCommandPool m_vkCommandPool;
+ };
+ std::vector<std::unique_ptr<ImageBorrowResource>> m_imageBorrowResources;
+
+ std::unique_ptr<SwapChainStateVk> m_swapChainStateVk;
+ bool m_needToRecreateSwapChain = true;
+
+ std::unordered_map<VkFormat, VkFormatProperties> m_vkFormatProperties;
+};
+
+} // namespace vk
+} // namespace gfxstream
+
+#endif
diff --git a/src/gfxstream/host/vulkan/GrallocDefs.h b/src/gfxstream/host/vulkan/GrallocDefs.h
new file mode 100644
index 00000000000..2f8d96d9dee
--- /dev/null
+++ b/src/gfxstream/host/vulkan/GrallocDefs.h
@@ -0,0 +1,279 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+typedef enum {
+ HAL_PIXEL_FORMAT_RGBA_8888 = 1,
+ HAL_PIXEL_FORMAT_RGBX_8888 = 2,
+ HAL_PIXEL_FORMAT_RGB_888 = 3,
+ HAL_PIXEL_FORMAT_RGB_565 = 4,
+ HAL_PIXEL_FORMAT_BGRA_8888 = 5,
+ HAL_PIXEL_FORMAT_RGBA_1010102 = 43, // 0x2B
+ HAL_PIXEL_FORMAT_RGBA_FP16 = 22, // 0x16
+ HAL_PIXEL_FORMAT_YV12 = 842094169, // 0x32315659
+ HAL_PIXEL_FORMAT_Y8 = 538982489, // 0x20203859
+ HAL_PIXEL_FORMAT_Y16 = 540422489, // 0x20363159
+ HAL_PIXEL_FORMAT_RAW16 = 32, // 0x20
+ HAL_PIXEL_FORMAT_RAW10 = 37, // 0x25
+ HAL_PIXEL_FORMAT_RAW12 = 38, // 0x26
+ HAL_PIXEL_FORMAT_RAW_OPAQUE = 36, // 0x24
+ HAL_PIXEL_FORMAT_BLOB = 33, // 0x21
+ HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED = 34, // 0x22
+ HAL_PIXEL_FORMAT_YCBCR_420_888 = 35, // 0x23
+ HAL_PIXEL_FORMAT_YCBCR_422_888 = 39, // 0x27
+ HAL_PIXEL_FORMAT_YCBCR_444_888 = 40, // 0x28
+ HAL_PIXEL_FORMAT_FLEX_RGB_888 = 41, // 0x29
+ HAL_PIXEL_FORMAT_FLEX_RGBA_8888 = 42, // 0x2A
+ HAL_PIXEL_FORMAT_YCBCR_422_SP = 16, // 0x10
+ HAL_PIXEL_FORMAT_YCRCB_420_SP = 17, // 0x11
+ HAL_PIXEL_FORMAT_YCBCR_422_I = 20, // 0x14
+ HAL_PIXEL_FORMAT_JPEG = 256, // 0x100
+} android_pixel_format_t;
+
+enum {
+ /* buffer is never read in software */
+ GRALLOC_USAGE_SW_READ_NEVER = 0x00000000U,
+ /* buffer is rarely read in software */
+ GRALLOC_USAGE_SW_READ_RARELY = 0x00000002U,
+ /* buffer is often read in software */
+ GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003U,
+ /* mask for the software read values */
+ GRALLOC_USAGE_SW_READ_MASK = 0x0000000FU,
+
+ /* buffer is never written in software */
+ GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000U,
+ /* buffer is rarely written in software */
+ GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020U,
+ /* buffer is often written in software */
+ GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030U,
+ /* mask for the software write values */
+ GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0U,
+
+ /* buffer will be used as an OpenGL ES texture */
+ GRALLOC_USAGE_HW_TEXTURE = 0x00000100U,
+ /* buffer will be used as an OpenGL ES render target */
+ GRALLOC_USAGE_HW_RENDER = 0x00000200U,
+ /* buffer will be used by the 2D hardware blitter */
+ GRALLOC_USAGE_HW_2D = 0x00000400U,
+ /* buffer will be used by the HWComposer HAL module */
+ GRALLOC_USAGE_HW_COMPOSER = 0x00000800U,
+ /* buffer will be used with the framebuffer device */
+ GRALLOC_USAGE_HW_FB = 0x00001000U,
+
+ /* buffer should be displayed full-screen on an external display when
+ * possible */
+ GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000U,
+
+ /* Must have a hardware-protected path to external display sink for
+ * this buffer. If a hardware-protected path is not available, then
+ * either don't composite only this buffer (preferred) to the
+ * external sink, or (less desirable) do not route the entire
+ * composition to the external sink. */
+ GRALLOC_USAGE_PROTECTED = 0x00004000U,
+
+ /* buffer may be used as a cursor */
+ GRALLOC_USAGE_CURSOR = 0x00008000U,
+
+ /* buffer will be used with the HW video encoder */
+ GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000U,
+ /* buffer will be written by the HW camera pipeline */
+ GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000U,
+ /* buffer will be read by the HW camera pipeline */
+ GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000U,
+ /* buffer will be used as part of zero-shutter-lag queue */
+ GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000U,
+ /* mask for the camera access values */
+ GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000U,
+ /* mask for the software usage bit-mask */
+ GRALLOC_USAGE_HW_MASK = 0x00071F00U,
+
+ /* buffer will be used as a RenderScript Allocation */
+ GRALLOC_USAGE_RENDERSCRIPT = 0x00100000U,
+
+ /* Set by the consumer to indicate to the producer that they may attach a
+ * buffer that they did not detach from the BufferQueue. Will be filtered
+ * out by GRALLOC_USAGE_ALLOC_MASK, so gralloc modules will not need to
+ * handle this flag. */
+ GRALLOC_USAGE_FOREIGN_BUFFERS = 0x00200000U,
+
+ /* Mask of all flags which could be passed to a gralloc module for buffer
+ * allocation. Any flags not in this mask do not need to be handled by
+ * gralloc modules. */
+ GRALLOC_USAGE_ALLOC_MASK = ~(GRALLOC_USAGE_FOREIGN_BUFFERS),
+
+ /* implementation-specific private usage flags */
+ GRALLOC_USAGE_PRIVATE_0 = 0x10000000U,
+ GRALLOC_USAGE_PRIVATE_1 = 0x20000000U,
+ GRALLOC_USAGE_PRIVATE_2 = 0x40000000U,
+ GRALLOC_USAGE_PRIVATE_3 = 0x80000000U,
+ GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
+};
+
+typedef enum {
+ GRALLOC1_CONSUMER_USAGE_NONE = 0,
+ GRALLOC1_CONSUMER_USAGE_CPU_READ_NEVER = 0,
+ /* 1ULL << 0 */
+ GRALLOC1_CONSUMER_USAGE_CPU_READ = 1ULL << 1,
+ GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN = 1ULL << 2 | GRALLOC1_CONSUMER_USAGE_CPU_READ,
+ /* 1ULL << 3 */
+ /* 1ULL << 4 */
+ /* 1ULL << 5 */
+ /* 1ULL << 6 */
+ /* 1ULL << 7 */
+ GRALLOC1_CONSUMER_USAGE_GPU_TEXTURE = 1ULL << 8,
+ /* 1ULL << 9 */
+ /* 1ULL << 10 */
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER = 1ULL << 11,
+ GRALLOC1_CONSUMER_USAGE_CLIENT_TARGET = 1ULL << 12,
+ /* 1ULL << 13 */
+ /* 1ULL << 14 */
+ GRALLOC1_CONSUMER_USAGE_CURSOR = 1ULL << 15,
+ GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER = 1ULL << 16,
+ /* 1ULL << 17 */
+ GRALLOC1_CONSUMER_USAGE_CAMERA = 1ULL << 18,
+ /* 1ULL << 19 */
+ GRALLOC1_CONSUMER_USAGE_RENDERSCRIPT = 1ULL << 20,
+
+ /* Indicates that the consumer may attach buffers to their end of the
+ * BufferQueue, which means that the producer may never have seen a given
+ * dequeued buffer before. May be ignored by the gralloc device. */
+ GRALLOC1_CONSUMER_USAGE_FOREIGN_BUFFERS = 1ULL << 21,
+
+ /* 1ULL << 22 */
+ GRALLOC1_CONSUMER_USAGE_GPU_DATA_BUFFER = 1ULL << 23,
+ /* 1ULL << 24 */
+ /* 1ULL << 25 */
+ /* 1ULL << 26 */
+ /* 1ULL << 27 */
+
+ /* Bits reserved for implementation-specific usage flags */
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_0 = 1ULL << 28,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_1 = 1ULL << 29,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_2 = 1ULL << 30,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_3 = 1ULL << 31,
+
+ /* 1ULL << 32 */
+ /* 1ULL << 33 */
+ /* 1ULL << 34 */
+ /* 1ULL << 35 */
+ /* 1ULL << 36 */
+ /* 1ULL << 37 */
+ /* 1ULL << 38 */
+ /* 1ULL << 39 */
+ /* 1ULL << 40 */
+ /* 1ULL << 41 */
+ /* 1ULL << 42 */
+ /* 1ULL << 43 */
+ /* 1ULL << 44 */
+ /* 1ULL << 45 */
+ /* 1ULL << 46 */
+ /* 1ULL << 47 */
+
+ /* Bits reserved for implementation-specific usage flags */
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_19 = 1ULL << 48,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_18 = 1ULL << 49,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_17 = 1ULL << 50,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_16 = 1ULL << 51,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_15 = 1ULL << 52,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_14 = 1ULL << 53,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_13 = 1ULL << 54,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_12 = 1ULL << 55,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_11 = 1ULL << 56,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_10 = 1ULL << 57,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_9 = 1ULL << 58,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_8 = 1ULL << 59,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_7 = 1ULL << 60,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_6 = 1ULL << 61,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_5 = 1ULL << 62,
+ GRALLOC1_CONSUMER_USAGE_PRIVATE_4 = 1ULL << 63,
+} gralloc1_consumer_usage_t;
+
+typedef enum {
+ GRALLOC1_PRODUCER_USAGE_NONE = 0,
+ GRALLOC1_PRODUCER_USAGE_CPU_WRITE_NEVER = 0,
+ /* 1ULL << 0 */
+ GRALLOC1_PRODUCER_USAGE_CPU_READ = 1ULL << 1,
+ GRALLOC1_PRODUCER_USAGE_CPU_READ_OFTEN = 1ULL << 2 | GRALLOC1_PRODUCER_USAGE_CPU_READ,
+ /* 1ULL << 3 */
+ /* 1ULL << 4 */
+ GRALLOC1_PRODUCER_USAGE_CPU_WRITE = 1ULL << 5,
+ GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN = 1ULL << 6 | GRALLOC1_PRODUCER_USAGE_CPU_WRITE,
+ /* 1ULL << 7 */
+ /* 1ULL << 8 */
+ GRALLOC1_PRODUCER_USAGE_GPU_RENDER_TARGET = 1ULL << 9,
+ /* 1ULL << 10 */
+ /* 1ULL << 11 */
+ /* 1ULL << 12 */
+ /* 1ULL << 13 */
+
+ /* The consumer must have a hardware-protected path to an external display
+ * sink for this buffer. If a hardware-protected path is not available, then
+ * do not attempt to display this buffer. */
+ GRALLOC1_PRODUCER_USAGE_PROTECTED = 1ULL << 14,
+
+ /* 1ULL << 15 */
+ /* 1ULL << 16 */
+ GRALLOC1_PRODUCER_USAGE_CAMERA = 1ULL << 17,
+ /* 1ULL << 18 */
+ /* 1ULL << 19 */
+ /* 1ULL << 20 */
+ /* 1ULL << 21 */
+ GRALLOC1_PRODUCER_USAGE_VIDEO_DECODER = 1ULL << 22,
+ GRALLOC1_PRODUCER_USAGE_SENSOR_DIRECT_DATA = 1ULL << 23,
+ /* 1ULL << 24 */
+ /* 1ULL << 25 */
+ /* 1ULL << 26 */
+ /* 1ULL << 27 */
+
+ /* Bits reserved for implementation-specific usage flags */
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_0 = 1ULL << 28,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_1 = 1ULL << 29,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_2 = 1ULL << 30,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_3 = 1ULL << 31,
+
+ /* 1ULL << 32 */
+ /* 1ULL << 33 */
+ /* 1ULL << 34 */
+ /* 1ULL << 35 */
+ /* 1ULL << 36 */
+ /* 1ULL << 37 */
+ /* 1ULL << 38 */
+ /* 1ULL << 39 */
+ /* 1ULL << 40 */
+ /* 1ULL << 41 */
+ /* 1ULL << 42 */
+ /* 1ULL << 43 */
+ /* 1ULL << 44 */
+ /* 1ULL << 45 */
+ /* 1ULL << 46 */
+ /* 1ULL << 47 */
+
+ /* Bits reserved for implementation-specific usage flags */
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_19 = 1ULL << 48,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_18 = 1ULL << 49,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_17 = 1ULL << 50,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_16 = 1ULL << 51,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_15 = 1ULL << 52,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_14 = 1ULL << 53,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_13 = 1ULL << 54,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_12 = 1ULL << 55,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_11 = 1ULL << 56,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_10 = 1ULL << 57,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_9 = 1ULL << 58,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_8 = 1ULL << 59,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_7 = 1ULL << 60,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_6 = 1ULL << 61,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_5 = 1ULL << 62,
+ GRALLOC1_PRODUCER_USAGE_PRIVATE_4 = 1ULL << 63,
+} gralloc1_producer_usage_t; \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/PostWorkerVk.cpp b/src/gfxstream/host/vulkan/PostWorkerVk.cpp
new file mode 100644
index 00000000000..5ca0ac2bb9c
--- /dev/null
+++ b/src/gfxstream/host/vulkan/PostWorkerVk.cpp
@@ -0,0 +1,71 @@
+/*
+ * 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 "PostWorkerVk.h"
+
+#include "FrameBuffer.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+#include "vulkan/DisplayVk.h"
+
+namespace gfxstream {
+
+namespace {
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+} // namespace
+
+PostWorkerVk::PostWorkerVk(FrameBuffer* fb, Compositor* compositor, vk::DisplayVk* displayVk)
+ : PostWorker(false, fb, compositor), m_displayVk(displayVk) {}
+
+std::shared_future<void> PostWorkerVk::postImpl(ColorBuffer* cb) {
+ std::shared_future<void> completedFuture = std::async(std::launch::deferred, [] {}).share();
+ completedFuture.wait();
+
+ if (!m_displayVk) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "PostWorker missing DisplayVk.";
+ }
+
+ constexpr const int kMaxPostRetries = 2;
+ for (int i = 0; i < kMaxPostRetries; i++) {
+ const auto imageInfo = mFb->borrowColorBufferForDisplay(cb->getHndl());
+ auto result = m_displayVk->post(imageInfo.get());
+ if (result.success) {
+ return result.postCompletedWaitable;
+ }
+ }
+
+ ERR("Failed to post ColorBuffer after %d retries.", kMaxPostRetries);
+ return completedFuture;
+}
+
+void PostWorkerVk::screenshot(ColorBuffer* cb, int width, int height, GLenum format, GLenum type,
+ int rotation, void* pixels, Rect rect) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Screenshot not supported with native Vulkan swapchain enabled.";
+}
+
+void PostWorkerVk::viewportImpl(int width, int height) {}
+
+void PostWorkerVk::clearImpl() {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "PostWorker with Vulkan doesn't support clear";
+}
+
+void PostWorkerVk::exitImpl() {}
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/PostWorkerVk.h b/src/gfxstream/host/vulkan/PostWorkerVk.h
new file mode 100644
index 00000000000..224c47495f6
--- /dev/null
+++ b/src/gfxstream/host/vulkan/PostWorkerVk.h
@@ -0,0 +1,52 @@
+/*
+ * 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 <future>
+
+#include "DisplaySurfaceUser.h"
+#include "PostWorker.h"
+
+namespace gfxstream {
+
+namespace vk {
+class DisplayVk;
+} // namespace vk
+
+class PostWorkerVk : public PostWorker {
+ public:
+ PostWorkerVk(FrameBuffer* fb, Compositor* compositor, vk::DisplayVk* displayGl);
+
+ void screenshot(ColorBuffer* cb, int screenwidth, int screenheight, GLenum format, GLenum type,
+ int skinRotation, void* pixels, Rect rect) override;
+
+ protected:
+ std::shared_future<void> postImpl(ColorBuffer* cb) override;
+ void viewportImpl(int width, int height) override;
+ void clearImpl() override;
+ void exitImpl() override;
+
+ private:
+ // TODO(b/233939967): conslidate DisplayGl and DisplayVk into
+ // `Display* const m_display`.
+ //
+ // The implementation for Vulkan native swapchain. Only initialized when
+ // useVulkan is set when calling FrameBuffer::initialize(). PostWorker
+ // doesn't take the ownership of this DisplayVk object.
+ vk::DisplayVk* const m_displayVk;
+};
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/RenderThreadInfoVk.cpp b/src/gfxstream/host/vulkan/RenderThreadInfoVk.cpp
new file mode 100644
index 00000000000..08fa4e365bb
--- /dev/null
+++ b/src/gfxstream/host/vulkan/RenderThreadInfoVk.cpp
@@ -0,0 +1,37 @@
+// Copyright 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "RenderThreadInfoVk.h"
+
+#include "host-common/GfxstreamFatalError.h"
+
+namespace gfxstream {
+namespace vk {
+
+static thread_local RenderThreadInfoVk* tlThreadInfo = nullptr;
+
+RenderThreadInfoVk::RenderThreadInfoVk() {
+ if (tlThreadInfo != nullptr) {
+ GFXSTREAM_ABORT(emugl::FatalError(emugl::ABORT_REASON_OTHER))
+ << "Attempted to set thread local Vk render thread info twice.";
+ }
+ tlThreadInfo = this;
+}
+
+RenderThreadInfoVk::~RenderThreadInfoVk() { tlThreadInfo = nullptr; }
+
+RenderThreadInfoVk* RenderThreadInfoVk::get() { return tlThreadInfo; }
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/RenderThreadInfoVk.h b/src/gfxstream/host/vulkan/RenderThreadInfoVk.h
new file mode 100644
index 00000000000..63d8f6a9c2b
--- /dev/null
+++ b/src/gfxstream/host/vulkan/RenderThreadInfoVk.h
@@ -0,0 +1,42 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <optional>
+#include <string>
+
+#include "VkDecoder.h"
+
+namespace gfxstream {
+namespace vk {
+
+struct RenderThreadInfoVk {
+ // Create new instance. Only call this once per thread.
+ // Future calls to get() will return this instance until
+ // it is destroyed.
+ RenderThreadInfoVk();
+
+ // Destructor.
+ ~RenderThreadInfoVk();
+
+ // Return the current thread's instance, if any, or NULL.
+ static RenderThreadInfoVk* get();
+
+ uint32_t ctx_id;
+ VkDecoder m_vkDec;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/SwapChainStateVk.cpp b/src/gfxstream/host/vulkan/SwapChainStateVk.cpp
new file mode 100644
index 00000000000..875cdaf23c4
--- /dev/null
+++ b/src/gfxstream/host/vulkan/SwapChainStateVk.cpp
@@ -0,0 +1,309 @@
+#include "SwapChainStateVk.h"
+
+#include <cinttypes>
+#include <unordered_set>
+
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+#include "vulkan/vk_enum_string_helper.h"
+#include "vulkan/vk_util.h"
+
+namespace gfxstream {
+namespace vk {
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+#define SWAPCHAINSTATE_VK_ERROR(fmt, ...) \
+ do { \
+ fprintf(stderr, "%s(%s:%d): " fmt "\n", __func__, __FILE__, __LINE__, ##__VA_ARGS__); \
+ fflush(stderr); \
+ } while (0)
+
+namespace {
+
+void swap(SwapchainCreateInfoWrapper& a, SwapchainCreateInfoWrapper& b) {
+ std::swap(a.mQueueFamilyIndices, b.mQueueFamilyIndices);
+ std::swap(a.mCreateInfo, b.mCreateInfo);
+ // The C++ spec guarantees that after std::swap is called, all iterators and references of the
+ // container remain valid, and the past-the-end iterator is invalidated. Therefore, no need to
+ // reset the VkSwapchainCreateInfoKHR::pQueueFamilyIndices.
+}
+
+} // namespace
+
+SwapchainCreateInfoWrapper::SwapchainCreateInfoWrapper(const VkSwapchainCreateInfoKHR& createInfo)
+ : mCreateInfo(createInfo) {
+ if (createInfo.pNext) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "VkSwapchainCreateInfoKHR with pNext in the chain is not supported.";
+ }
+
+ if (createInfo.pQueueFamilyIndices && (createInfo.queueFamilyIndexCount > 0)) {
+ setQueueFamilyIndices(std::vector<uint32_t>(
+ createInfo.pQueueFamilyIndices,
+ createInfo.pQueueFamilyIndices + createInfo.queueFamilyIndexCount));
+ } else {
+ setQueueFamilyIndices({});
+ }
+}
+
+SwapchainCreateInfoWrapper::SwapchainCreateInfoWrapper(const SwapchainCreateInfoWrapper& other)
+ : mCreateInfo(other.mCreateInfo) {
+ if (other.mCreateInfo.pNext) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "VkSwapchainCreateInfoKHR with pNext in the chain is not supported.";
+ }
+ setQueueFamilyIndices(other.mQueueFamilyIndices);
+}
+
+SwapchainCreateInfoWrapper& SwapchainCreateInfoWrapper::operator=(
+ const SwapchainCreateInfoWrapper& other) {
+ SwapchainCreateInfoWrapper tmp(other);
+ swap(*this, tmp);
+ return *this;
+}
+
+void SwapchainCreateInfoWrapper::setQueueFamilyIndices(
+ const std::vector<uint32_t>& queueFamilyIndices) {
+ mQueueFamilyIndices = queueFamilyIndices;
+ mCreateInfo.queueFamilyIndexCount = static_cast<uint32_t>(mQueueFamilyIndices.size());
+ if (mQueueFamilyIndices.empty()) {
+ mCreateInfo.pQueueFamilyIndices = nullptr;
+ } else {
+ mCreateInfo.pQueueFamilyIndices = queueFamilyIndices.data();
+ }
+}
+
+std::unique_ptr<SwapChainStateVk> SwapChainStateVk::createSwapChainVk(
+ const VulkanDispatch& vk, VkDevice vkDevice, const VkSwapchainCreateInfoKHR& swapChainCi) {
+ std::unique_ptr<SwapChainStateVk> swapChainVk(new SwapChainStateVk(vk, vkDevice));
+ if (swapChainVk->initSwapChainStateVk(swapChainCi) != VK_SUCCESS) {
+ return nullptr;
+ }
+ return swapChainVk;
+}
+
+SwapChainStateVk::SwapChainStateVk(const VulkanDispatch& vk, VkDevice vkDevice)
+ : m_vk(vk),
+ m_vkDevice(vkDevice),
+ m_vkSwapChain(VK_NULL_HANDLE),
+ m_vkImages(0),
+ m_vkImageViews(0) {}
+
+VkResult SwapChainStateVk::initSwapChainStateVk(const VkSwapchainCreateInfoKHR& swapChainCi) {
+ VkResult res = m_vk.vkCreateSwapchainKHR(m_vkDevice, &swapChainCi, nullptr, &m_vkSwapChain);
+ if (res == VK_ERROR_INITIALIZATION_FAILED) return res;
+ VK_CHECK(res);
+ uint32_t imageCount = 0;
+ VK_CHECK(m_vk.vkGetSwapchainImagesKHR(m_vkDevice, m_vkSwapChain, &imageCount, nullptr));
+ m_vkImageExtent = swapChainCi.imageExtent;
+ m_vkImages.resize(imageCount);
+ VK_CHECK(
+ m_vk.vkGetSwapchainImagesKHR(m_vkDevice, m_vkSwapChain, &imageCount, m_vkImages.data()));
+ for (auto i = 0; i < m_vkImages.size(); i++) {
+ VkImageViewCreateInfo imageViewCi = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
+ .image = m_vkImages[i],
+ .viewType = VK_IMAGE_VIEW_TYPE_2D,
+ .format = k_vkFormat,
+ .components = {.r = VK_COMPONENT_SWIZZLE_IDENTITY,
+ .g = VK_COMPONENT_SWIZZLE_IDENTITY,
+ .b = VK_COMPONENT_SWIZZLE_IDENTITY,
+ .a = VK_COMPONENT_SWIZZLE_IDENTITY},
+ .subresourceRange = {.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1}};
+ VkImageView vkImageView;
+ VK_CHECK(m_vk.vkCreateImageView(m_vkDevice, &imageViewCi, nullptr, &vkImageView));
+ m_vkImageViews.push_back(vkImageView);
+ }
+ return VK_SUCCESS;
+}
+
+SwapChainStateVk::~SwapChainStateVk() {
+ for (auto imageView : m_vkImageViews) {
+ m_vk.vkDestroyImageView(m_vkDevice, imageView, nullptr);
+ }
+ if (m_vkSwapChain != VK_NULL_HANDLE) {
+ m_vk.vkDestroySwapchainKHR(m_vkDevice, m_vkSwapChain, nullptr);
+ }
+}
+
+std::vector<const char*> SwapChainStateVk::getRequiredInstanceExtensions() {
+ return {
+ VK_KHR_SURFACE_EXTENSION_NAME,
+#ifdef _WIN32
+ VK_KHR_WIN32_SURFACE_EXTENSION_NAME,
+#endif
+#ifdef __APPLE__
+ VK_EXT_METAL_SURFACE_EXTENSION_NAME,
+#endif
+#ifdef VK_USE_PLATFORM_XCB_KHR
+ VK_KHR_XCB_SURFACE_EXTENSION_NAME,
+#endif
+ };
+}
+
+std::vector<const char*> SwapChainStateVk::getRequiredDeviceExtensions() {
+ return {
+ VK_KHR_SWAPCHAIN_EXTENSION_NAME,
+ };
+}
+
+bool SwapChainStateVk::validateQueueFamilyProperties(const VulkanDispatch& vk,
+ VkPhysicalDevice physicalDevice,
+ VkSurfaceKHR surface,
+ uint32_t queueFamilyIndex) {
+ VkBool32 presentSupport = VK_FALSE;
+ VK_CHECK(vk.vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface,
+ &presentSupport));
+ return presentSupport;
+}
+
+std::optional<SwapchainCreateInfoWrapper> SwapChainStateVk::createSwapChainCi(
+ const VulkanDispatch& vk, VkSurfaceKHR surface, VkPhysicalDevice physicalDevice, uint32_t width,
+ uint32_t height, const std::unordered_set<uint32_t>& queueFamilyIndices) {
+ uint32_t formatCount = 0;
+ VK_CHECK(
+ vk.vkGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, &formatCount, nullptr));
+ std::vector<VkSurfaceFormatKHR> formats(formatCount);
+ VkResult res = vk.vkGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, &formatCount,
+ formats.data());
+ // b/217226027: drivers may return VK_INCOMPLETE with pSurfaceFormatCount returned by
+ // vkGetPhysicalDeviceSurfaceFormatsKHR. Retry here as a work around to the potential driver
+ // bug.
+ if (res == VK_INCOMPLETE) {
+ formatCount = (formatCount + 1) * 2;
+ INFO(
+ "VK_INCOMPLETE returned by vkGetPhysicalDeviceSurfaceFormatsKHR. A possible driver "
+ "bug. Retry with *pSurfaceFormatCount = %" PRIu32 ".",
+ formatCount);
+ formats.resize(formatCount);
+ res = vk.vkGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, &formatCount,
+ formats.data());
+ formats.resize(formatCount);
+ }
+ if (res == VK_INCOMPLETE) {
+ INFO(
+ "VK_INCOMPLETE still returned by vkGetPhysicalDeviceSurfaceFormatsKHR with retry. A "
+ "possible driver bug.");
+ } else {
+ VK_CHECK(res);
+ }
+ auto iSurfaceFormat =
+ std::find_if(formats.begin(), formats.end(), [](const VkSurfaceFormatKHR& format) {
+ return format.format == k_vkFormat && format.colorSpace == k_vkColorSpace;
+ });
+ if (iSurfaceFormat == formats.end()) {
+ SWAPCHAINSTATE_VK_ERROR("Fail to create swapchain: the format(%#" PRIx64
+ ") with color space(%#" PRIx64 ") not supported.",
+ static_cast<uint64_t>(k_vkFormat),
+ static_cast<uint64_t>(k_vkColorSpace));
+ return std::nullopt;
+ }
+
+ uint32_t presentModeCount = 0;
+ VK_CHECK(vk.vkGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface,
+ &presentModeCount, nullptr));
+ std::vector<VkPresentModeKHR> presentModes_(presentModeCount);
+ VK_CHECK(vk.vkGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface,
+ &presentModeCount, presentModes_.data()));
+ std::unordered_set<VkPresentModeKHR> presentModes(presentModes_.begin(), presentModes_.end());
+ VkPresentModeKHR presentMode = VK_PRESENT_MODE_FIFO_KHR;
+ if (!presentModes.count(VK_PRESENT_MODE_FIFO_KHR)) {
+ SWAPCHAINSTATE_VK_ERROR("Fail to create swapchain: FIFO present mode not supported.");
+ return std::nullopt;
+ }
+ VkFormatProperties formatProperties = {};
+ vk.vkGetPhysicalDeviceFormatProperties(physicalDevice, k_vkFormat, &formatProperties);
+ // According to the spec, a presentable image is equivalent to a non-presentable image created
+ // with the VK_IMAGE_TILING_OPTIMAL tiling parameter.
+ VkFormatFeatureFlags formatFeatures = formatProperties.optimalTilingFeatures;
+ if (!(formatFeatures & VK_FORMAT_FEATURE_BLIT_DST_BIT)) {
+ // According to VUID-vkCmdBlitImage-dstImage-02000, the format features of dstImage must
+ // contain VK_FORMAT_FEATURE_BLIT_DST_BIT.
+ SWAPCHAINSTATE_VK_ERROR(
+ "The format %s with the optimal tiling doesn't support VK_FORMAT_FEATURE_BLIT_DST_BIT. "
+ "The supported features are %s.",
+ string_VkFormat(k_vkFormat), string_VkFormatFeatureFlags(formatFeatures).c_str());
+ return std::nullopt;
+ }
+ VkSurfaceCapabilitiesKHR surfaceCaps;
+ VK_CHECK(vk.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, &surfaceCaps));
+ if (!(surfaceCaps.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT)) {
+ SWAPCHAINSTATE_VK_ERROR(
+ "The supported usage flags of the presentable images is %s, and don't contain "
+ "VK_IMAGE_USAGE_TRANSFER_DST_BIT.",
+ string_VkImageUsageFlags(surfaceCaps.supportedUsageFlags).c_str());
+ return std::nullopt;
+ }
+ std::optional<VkExtent2D> maybeExtent = std::nullopt;
+ if (surfaceCaps.currentExtent.width != UINT32_MAX && surfaceCaps.currentExtent.width == width &&
+ surfaceCaps.currentExtent.height == height) {
+ maybeExtent = surfaceCaps.currentExtent;
+ } else if (width >= surfaceCaps.minImageExtent.width &&
+ width <= surfaceCaps.maxImageExtent.width &&
+ height >= surfaceCaps.minImageExtent.height &&
+ height <= surfaceCaps.maxImageExtent.height) {
+ maybeExtent = VkExtent2D({width, height});
+ }
+ if (!maybeExtent.has_value()) {
+ SWAPCHAINSTATE_VK_ERROR("Fail to create swapchain: extent(%" PRIu64 "x%" PRIu64
+ ") not supported.",
+ static_cast<uint64_t>(width), static_cast<uint64_t>(height));
+ return std::nullopt;
+ }
+ auto extent = maybeExtent.value();
+ uint32_t imageCount = surfaceCaps.minImageCount + 1;
+ if (surfaceCaps.maxImageCount != 0 && surfaceCaps.maxImageCount < imageCount) {
+ imageCount = surfaceCaps.maxImageCount;
+ }
+ SwapchainCreateInfoWrapper swapChainCi(VkSwapchainCreateInfoKHR{
+ .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
+ .pNext = nullptr,
+ .flags = VkSwapchainCreateFlagsKHR{0},
+ .surface = surface,
+ .minImageCount = imageCount,
+ .imageFormat = iSurfaceFormat->format,
+ .imageColorSpace = iSurfaceFormat->colorSpace,
+ .imageExtent = extent,
+ .imageArrayLayers = 1,
+ .imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT,
+ .imageSharingMode = VkSharingMode{},
+ .queueFamilyIndexCount = 0,
+ .pQueueFamilyIndices = nullptr,
+ .preTransform = surfaceCaps.currentTransform,
+ .compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
+ .presentMode = presentMode,
+ .clipped = VK_TRUE,
+ .oldSwapchain = VK_NULL_HANDLE});
+ if (queueFamilyIndices.empty()) {
+ SWAPCHAINSTATE_VK_ERROR("Fail to create swapchain: no Vulkan queue family specified.");
+ return std::nullopt;
+ }
+ if (queueFamilyIndices.size() == 1) {
+ swapChainCi.mCreateInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
+ swapChainCi.setQueueFamilyIndices({});
+ } else {
+ swapChainCi.mCreateInfo.imageSharingMode = VK_SHARING_MODE_CONCURRENT;
+ swapChainCi.setQueueFamilyIndices(
+ std::vector<uint32_t>(queueFamilyIndices.begin(), queueFamilyIndices.end()));
+ }
+ return std::optional(swapChainCi);
+}
+
+VkFormat SwapChainStateVk::getFormat() { return k_vkFormat; }
+
+VkExtent2D SwapChainStateVk::getImageExtent() const { return m_vkImageExtent; }
+
+const std::vector<VkImage>& SwapChainStateVk::getVkImages() const { return m_vkImages; }
+
+const std::vector<VkImageView>& SwapChainStateVk::getVkImageViews() const { return m_vkImageViews; }
+
+VkSwapchainKHR SwapChainStateVk::getSwapChain() const { return m_vkSwapChain; }
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/SwapChainStateVk.h b/src/gfxstream/host/vulkan/SwapChainStateVk.h
new file mode 100644
index 00000000000..1643adddee2
--- /dev/null
+++ b/src/gfxstream/host/vulkan/SwapChainStateVk.h
@@ -0,0 +1,78 @@
+#ifndef SWAP_CHAIN_STATE_VK_H
+#define SWAP_CHAIN_STATE_VK_H
+
+#include <functional>
+#include <memory>
+#include <optional>
+#include <type_traits>
+#include <unordered_set>
+#include <vector>
+
+#include "goldfish_vk_dispatch.h"
+
+namespace gfxstream {
+namespace vk {
+
+struct SwapchainCreateInfoWrapper {
+ VkSwapchainCreateInfoKHR mCreateInfo;
+ std::vector<uint32_t> mQueueFamilyIndices;
+
+ SwapchainCreateInfoWrapper(const SwapchainCreateInfoWrapper&);
+ SwapchainCreateInfoWrapper(SwapchainCreateInfoWrapper&&) = delete;
+ SwapchainCreateInfoWrapper& operator=(const SwapchainCreateInfoWrapper&);
+ SwapchainCreateInfoWrapper& operator=(SwapchainCreateInfoWrapper&&) = delete;
+
+ SwapchainCreateInfoWrapper(const VkSwapchainCreateInfoKHR&);
+
+ void setQueueFamilyIndices(const std::vector<uint32_t>& queueFamilyIndices);
+};
+
+// Assert SwapchainCreateInfoWrapper is a copy only class.
+static_assert(std::is_copy_assignable_v<SwapchainCreateInfoWrapper> &&
+ std::is_copy_constructible_v<SwapchainCreateInfoWrapper> &&
+ !std::is_move_constructible_v<SwapchainCreateInfoWrapper> &&
+ !std::is_move_assignable_v<SwapchainCreateInfoWrapper>);
+
+class SwapChainStateVk {
+ public:
+ static std::vector<const char*> getRequiredInstanceExtensions();
+ static std::vector<const char*> getRequiredDeviceExtensions();
+ static bool validateQueueFamilyProperties(const VulkanDispatch&, VkPhysicalDevice, VkSurfaceKHR,
+ uint32_t queueFamilyIndex);
+ static std::optional<SwapchainCreateInfoWrapper> createSwapChainCi(
+ const VulkanDispatch&, VkSurfaceKHR, VkPhysicalDevice, uint32_t width, uint32_t height,
+ const std::unordered_set<uint32_t>& queueFamilyIndices);
+
+ SwapChainStateVk() = delete;
+ SwapChainStateVk(const SwapChainStateVk&) = delete;
+ SwapChainStateVk& operator = (const SwapChainStateVk&) = delete;
+
+ static std::unique_ptr<SwapChainStateVk> createSwapChainVk(const VulkanDispatch&, VkDevice,
+ const VkSwapchainCreateInfoKHR&);
+
+ ~SwapChainStateVk();
+ VkFormat getFormat();
+ VkExtent2D getImageExtent() const;
+ const std::vector<VkImage>& getVkImages() const;
+ const std::vector<VkImageView>& getVkImageViews() const;
+ VkSwapchainKHR getSwapChain() const;
+
+ private:
+ explicit SwapChainStateVk(const VulkanDispatch&, VkDevice);
+
+ VkResult initSwapChainStateVk(const VkSwapchainCreateInfoKHR& swapChainCi);
+ const static VkFormat k_vkFormat = VK_FORMAT_B8G8R8A8_UNORM;
+ const static VkColorSpaceKHR k_vkColorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
+
+ const VulkanDispatch& m_vk;
+ VkDevice m_vkDevice;
+ VkSwapchainKHR m_vkSwapChain;
+ VkExtent2D m_vkImageExtent;
+ std::vector<VkImage> m_vkImages;
+ std::vector<VkImageView> m_vkImageViews;
+};
+
+} // namespace vk
+} // namespace gfxstream
+
+#endif \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/VkAndroidNativeBuffer.cpp b/src/gfxstream/host/vulkan/VkAndroidNativeBuffer.cpp
new file mode 100644
index 00000000000..095d387313b
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkAndroidNativeBuffer.cpp
@@ -0,0 +1,829 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "VkAndroidNativeBuffer.h"
+
+#include <string.h>
+
+#include <future>
+
+#include "GrallocDefs.h"
+#include "SyncThread.h"
+#include "VkCommonOperations.h"
+#include "VulkanDispatch.h"
+#include "cereal/common/goldfish_vk_deepcopy.h"
+#include "cereal/common/goldfish_vk_extension_structs.h"
+
+#include "goldfish_vk_private_defs.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host/FrameBuffer.h"
+#include "vulkan/vk_enum_string_helper.h"
+
+namespace gfxstream {
+namespace vk {
+
+#define VK_ANB_ERR(fmt, ...) fprintf(stderr, "%s:%d " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);
+
+#define ENABLE_VK_ANB_DEBUG 0
+
+#if ENABLE_VK_ANB_DEBUG
+#define VK_ANB_DEBUG(fmt, ...) \
+ fprintf(stderr, "vk-anb-debug: %s:%d " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);
+#define VK_ANB_DEBUG_OBJ(obj, fmt, ...) \
+ fprintf(stderr, "vk-anb-debug: %s:%d:%p " fmt "\n", __func__, __LINE__, obj, ##__VA_ARGS__);
+#else
+#define VK_ANB_DEBUG(fmt, ...)
+#define VK_ANB_DEBUG_OBJ(obj, fmt, ...)
+#endif
+
+using android::base::AutoLock;
+using android::base::Lock;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+AndroidNativeBufferInfo::QsriWaitFencePool::QsriWaitFencePool(VulkanDispatch* vk, VkDevice device)
+ : mVk(vk), mDevice(device) {}
+
+VkFence AndroidNativeBufferInfo::QsriWaitFencePool::getFenceFromPool() {
+ VK_ANB_DEBUG("enter");
+ AutoLock lock(mLock);
+ VkFence fence = VK_NULL_HANDLE;
+ if (mAvailableFences.empty()) {
+ VkFenceCreateInfo fenceCreateInfo = {
+ VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ 0,
+ 0,
+ };
+ mVk->vkCreateFence(mDevice, &fenceCreateInfo, nullptr, &fence);
+ VK_ANB_DEBUG("no fences in pool, created %p", fence);
+ } else {
+ fence = mAvailableFences.back();
+ mAvailableFences.pop_back();
+ VkResult res = mVk->vkResetFences(mDevice, 1, &fence);
+ if (res != VK_SUCCESS) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Fail to reset Qsri VkFence: " << res << "(" << string_VkResult(res) << ").";
+ }
+ VK_ANB_DEBUG("existing fence in pool: %p. also reset the fence", fence);
+ }
+ mUsedFences.emplace(fence);
+ VK_ANB_DEBUG("exit");
+ return fence;
+}
+
+AndroidNativeBufferInfo::QsriWaitFencePool::~QsriWaitFencePool() {
+ VK_ANB_DEBUG("enter");
+ // Nothing in the fence pool is unsignaled
+ if (!mUsedFences.empty()) {
+ VK_ANB_ERR("%zu VkFences are still being used when destroying the Qsri fence pool.",
+ mUsedFences.size());
+ }
+ for (auto fence : mAvailableFences) {
+ VK_ANB_DEBUG("destroy fence %p", fence);
+ mVk->vkDestroyFence(mDevice, fence, nullptr);
+ }
+ VK_ANB_DEBUG("exit");
+}
+
+void AndroidNativeBufferInfo::QsriWaitFencePool::returnFence(VkFence fence) {
+ AutoLock lock(mLock);
+ if (!mUsedFences.erase(fence)) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Return an unmanaged Qsri VkFence back to the pool.";
+ return;
+ }
+ mAvailableFences.push_back(fence);
+}
+
+bool parseAndroidNativeBufferInfo(const VkImageCreateInfo* pCreateInfo,
+ AndroidNativeBufferInfo* info_out) {
+ // Look through the extension chain.
+ const void* curr_pNext = pCreateInfo->pNext;
+ if (!curr_pNext) return false;
+
+ uint32_t structType = goldfish_vk_struct_type(curr_pNext);
+
+ return structType == VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID;
+}
+
+VkResult prepareAndroidNativeBufferImage(VulkanDispatch* vk, VkDevice device,
+ android::base::BumpPool& allocator,
+ const VkImageCreateInfo* pCreateInfo,
+ const VkNativeBufferANDROID* nativeBufferANDROID,
+ const VkAllocationCallbacks* pAllocator,
+ const VkPhysicalDeviceMemoryProperties* memProps,
+ AndroidNativeBufferInfo* out) {
+ out->vk = vk;
+ out->device = device;
+ out->vkFormat = pCreateInfo->format;
+ out->extent = pCreateInfo->extent;
+ out->usage = pCreateInfo->usage;
+
+ for (uint32_t i = 0; i < pCreateInfo->queueFamilyIndexCount; ++i) {
+ out->queueFamilyIndices.push_back(pCreateInfo->pQueueFamilyIndices[i]);
+ }
+
+ out->format = nativeBufferANDROID->format;
+ out->stride = nativeBufferANDROID->stride;
+ out->colorBufferHandle = *static_cast<const uint32_t*>(nativeBufferANDROID->handle);
+
+ bool externalMemoryCompatible = false;
+
+ auto emu = getGlobalVkEmulation();
+
+ if (emu && emu->live) {
+ externalMemoryCompatible = emu->deviceInfo.supportsExternalMemoryImport &&
+ emu->deviceInfo.supportsExternalMemoryExport;
+ }
+
+ bool colorBufferExportedToGl = false;
+ if (!isColorBufferExportedToGl(out->colorBufferHandle, &colorBufferExportedToGl)) {
+ VK_ANB_ERR("Failed to query if ColorBuffer:%d exported to GL.", out->colorBufferHandle);
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+
+ if (externalMemoryCompatible) {
+ releaseColorBufferForGuestUse(out->colorBufferHandle);
+ out->externallyBacked = true;
+ }
+
+ out->useVulkanNativeImage =
+ (emu && emu->live && emu->guestUsesAngle) || colorBufferExportedToGl;
+
+ VkDeviceSize bindOffset = 0;
+ if (out->externallyBacked) {
+ VkImageCreateInfo createImageCi;
+ deepcopy_VkImageCreateInfo(&allocator, VK_STRUCTURE_TYPE_MAX_ENUM, pCreateInfo,
+ &createImageCi);
+ auto* nativeBufferAndroid = vk_find_struct<VkNativeBufferANDROID>(&createImageCi);
+ if (!nativeBufferAndroid) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "VkNativeBufferANDROID is required to be included in the pNext chain of the "
+ "VkImageCreateInfo when importing a gralloc buffer.";
+ }
+ vk_struct_chain_remove(nativeBufferAndroid, &createImageCi);
+
+ if (vk_find_struct<VkExternalMemoryImageCreateInfo>(&createImageCi)) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Unhandled VkExternalMemoryImageCreateInfo in the pNext chain.";
+ }
+ // Create the image with extension structure about external backing.
+ VkExternalMemoryImageCreateInfo extImageCi = {
+ VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO,
+ 0,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ };
+
+ vk_insert_struct(createImageCi, extImageCi);
+
+ VkResult createResult = vk->vkCreateImage(device, &createImageCi, pAllocator, &out->image);
+
+ if (createResult != VK_SUCCESS) return createResult;
+
+ // Now import the backing memory.
+ const auto& cbInfo = getColorBufferInfo(out->colorBufferHandle);
+ const auto& memInfo = cbInfo.memory;
+
+ vk->vkGetImageMemoryRequirements(device, out->image, &out->memReqs);
+
+ if (out->memReqs.size < memInfo.size) {
+ out->memReqs.size = memInfo.size;
+ }
+
+ if (memInfo.dedicatedAllocation) {
+ if (!importExternalMemoryDedicatedImage(vk, device, &memInfo, out->image,
+ &out->imageMemory)) {
+ VK_ANB_ERR(
+ "VK_ANDROID_native_buffer: Failed to import external memory (dedicated)");
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+ } else {
+ if (!importExternalMemory(vk, device, &memInfo, &out->imageMemory)) {
+ VK_ANB_ERR("VK_ANDROID_native_buffer: Failed to import external memory");
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+ }
+
+ bindOffset = memInfo.bindOffset;
+ } else {
+ // delete the info struct and pass to vkCreateImage, and also add
+ // transfer src capability to allow us to copy to CPU.
+ VkImageCreateInfo infoNoNative = *pCreateInfo;
+ infoNoNative.pNext = nullptr;
+ infoNoNative.usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+ VkResult createResult = vk->vkCreateImage(device, &infoNoNative, pAllocator, &out->image);
+
+ if (createResult != VK_SUCCESS) return createResult;
+
+ vk->vkGetImageMemoryRequirements(device, out->image, &out->memReqs);
+
+ uint32_t imageMemoryTypeIndex = 0;
+ bool imageMemoryTypeIndexFound = false;
+
+ for (uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i) {
+ bool supported = out->memReqs.memoryTypeBits & (1 << i);
+ if (supported) {
+ imageMemoryTypeIndex = i;
+ imageMemoryTypeIndexFound = true;
+ break;
+ }
+ }
+
+ if (!imageMemoryTypeIndexFound) {
+ VK_ANB_ERR(
+ "VK_ANDROID_native_buffer: could not obtain "
+ "image memory type index");
+ teardownAndroidNativeBufferImage(vk, out);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+ out->imageMemoryTypeIndex = imageMemoryTypeIndex;
+
+ VkMemoryAllocateInfo allocInfo = {
+ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ 0,
+ out->memReqs.size,
+ out->imageMemoryTypeIndex,
+ };
+
+ if (VK_SUCCESS != vk->vkAllocateMemory(device, &allocInfo, nullptr, &out->imageMemory)) {
+ VK_ANB_ERR(
+ "VK_ANDROID_native_buffer: could not allocate "
+ "image memory. requested size: %zu",
+ (size_t)(out->memReqs.size));
+ teardownAndroidNativeBufferImage(vk, out);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ }
+
+ if (VK_SUCCESS != vk->vkBindImageMemory(device, out->image, out->imageMemory, bindOffset)) {
+ VK_ANB_ERR(
+ "VK_ANDROID_native_buffer: could not bind "
+ "image memory.");
+ teardownAndroidNativeBufferImage(vk, out);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+ // Allocate a staging memory and set up the staging buffer.
+ // TODO: Make this shared as well if we can get that to
+ // work on Windows with NVIDIA.
+ {
+ bool stagingIndexRes =
+ getStagingMemoryTypeIndex(vk, device, memProps, &out->stagingMemoryTypeIndex);
+
+ if (!stagingIndexRes) {
+ VK_ANB_ERR(
+ "VK_ANDROID_native_buffer: could not obtain "
+ "staging memory type index");
+ teardownAndroidNativeBufferImage(vk, out);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ VkMemoryAllocateInfo allocInfo = {
+ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ 0,
+ out->memReqs.size,
+ out->stagingMemoryTypeIndex,
+ };
+
+ VkResult res = vk->vkAllocateMemory(device, &allocInfo, nullptr, &out->stagingMemory);
+ if (VK_SUCCESS != res) {
+ VK_ANB_ERR(
+ "VK_ANDROID_native_buffer: could not allocate staging memory. "
+ "res = %d. requested size: %zu",
+ (int)res, (size_t)(out->memReqs.size));
+ teardownAndroidNativeBufferImage(vk, out);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ VkBufferCreateInfo stagingBufferCreateInfo = {
+ VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
+ 0,
+ 0,
+ out->memReqs.size,
+ VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
+ VK_SHARING_MODE_EXCLUSIVE,
+ 0,
+ nullptr,
+ };
+ if (out->queueFamilyIndices.size() > 1) {
+ stagingBufferCreateInfo.sharingMode = VK_SHARING_MODE_CONCURRENT;
+ stagingBufferCreateInfo.queueFamilyIndexCount =
+ static_cast<uint32_t>(out->queueFamilyIndices.size());
+ stagingBufferCreateInfo.pQueueFamilyIndices = out->queueFamilyIndices.data();
+ }
+
+ if (VK_SUCCESS !=
+ vk->vkCreateBuffer(device, &stagingBufferCreateInfo, nullptr, &out->stagingBuffer)) {
+ VK_ANB_ERR(
+ "VK_ANDROID_native_buffer: could not create "
+ "staging buffer.");
+ teardownAndroidNativeBufferImage(vk, out);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ if (VK_SUCCESS !=
+ vk->vkBindBufferMemory(device, out->stagingBuffer, out->stagingMemory, 0)) {
+ VK_ANB_ERR(
+ "VK_ANDROID_native_buffer: could not bind "
+ "staging buffer to staging memory.");
+ teardownAndroidNativeBufferImage(vk, out);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ if (VK_SUCCESS != vk->vkMapMemory(device, out->stagingMemory, 0, out->memReqs.size, 0,
+ (void**)&out->mappedStagingPtr)) {
+ VK_ANB_ERR(
+ "VK_ANDROID_native_buffer: could not map "
+ "staging buffer.");
+ teardownAndroidNativeBufferImage(vk, out);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ }
+
+ out->qsriWaitFencePool =
+ std::make_unique<AndroidNativeBufferInfo::QsriWaitFencePool>(out->vk, out->device);
+ out->qsriTimeline = std::make_unique<VkQsriTimeline>();
+ return VK_SUCCESS;
+}
+
+void teardownAndroidNativeBufferImage(VulkanDispatch* vk, AndroidNativeBufferInfo* anbInfo) {
+ auto device = anbInfo->device;
+
+ auto image = anbInfo->image;
+ auto imageMemory = anbInfo->imageMemory;
+
+ auto stagingBuffer = anbInfo->stagingBuffer;
+ auto mappedPtr = anbInfo->mappedStagingPtr;
+ auto stagingMemory = anbInfo->stagingMemory;
+
+ if (image) vk->vkDestroyImage(device, image, nullptr);
+ if (imageMemory) vk->vkFreeMemory(device, imageMemory, nullptr);
+ if (stagingBuffer) vk->vkDestroyBuffer(device, stagingBuffer, nullptr);
+ if (mappedPtr) vk->vkUnmapMemory(device, stagingMemory);
+ if (stagingMemory) vk->vkFreeMemory(device, stagingMemory, nullptr);
+
+ for (auto queueState : anbInfo->queueStates) {
+ queueState.teardown(vk, device);
+ }
+
+ anbInfo->queueStates.clear();
+
+ anbInfo->acquireQueueState.teardown(vk, device);
+
+ anbInfo->vk = nullptr;
+ anbInfo->device = VK_NULL_HANDLE;
+ anbInfo->image = VK_NULL_HANDLE;
+ anbInfo->imageMemory = VK_NULL_HANDLE;
+ anbInfo->stagingBuffer = VK_NULL_HANDLE;
+ anbInfo->mappedStagingPtr = nullptr;
+ anbInfo->stagingMemory = VK_NULL_HANDLE;
+
+ anbInfo->qsriWaitFencePool = nullptr;
+}
+
+void getGralloc0Usage(VkFormat format, VkImageUsageFlags imageUsage, int* usage_out) {
+ // Pick some default flexible values for gralloc usage for now.
+ (void)format;
+ (void)imageUsage;
+ *usage_out = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN |
+ GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE;
+}
+
+// Taken from Android GrallocUsageConversion.h
+void getGralloc1Usage(VkFormat format, VkImageUsageFlags imageUsage,
+ VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
+ uint64_t* consumerUsage_out, uint64_t* producerUsage_out) {
+ // Pick some default flexible values for gralloc usage for now.
+ (void)format;
+ (void)imageUsage;
+ (void)swapchainImageUsage;
+
+ constexpr int usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN |
+ GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE;
+
+ constexpr uint64_t PRODUCER_MASK =
+ GRALLOC1_PRODUCER_USAGE_CPU_READ |
+ /* GRALLOC1_PRODUCER_USAGE_CPU_READ_OFTEN | */
+ GRALLOC1_PRODUCER_USAGE_CPU_WRITE |
+ /* GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN | */
+ GRALLOC1_PRODUCER_USAGE_GPU_RENDER_TARGET | GRALLOC1_PRODUCER_USAGE_PROTECTED |
+ GRALLOC1_PRODUCER_USAGE_CAMERA | GRALLOC1_PRODUCER_USAGE_VIDEO_DECODER |
+ GRALLOC1_PRODUCER_USAGE_SENSOR_DIRECT_DATA;
+ constexpr uint64_t CONSUMER_MASK =
+ GRALLOC1_CONSUMER_USAGE_CPU_READ |
+ /* GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN | */
+ GRALLOC1_CONSUMER_USAGE_GPU_TEXTURE | GRALLOC1_CONSUMER_USAGE_HWCOMPOSER |
+ GRALLOC1_CONSUMER_USAGE_CLIENT_TARGET | GRALLOC1_CONSUMER_USAGE_CURSOR |
+ GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER | GRALLOC1_CONSUMER_USAGE_CAMERA |
+ GRALLOC1_CONSUMER_USAGE_RENDERSCRIPT | GRALLOC1_CONSUMER_USAGE_GPU_DATA_BUFFER;
+
+ *producerUsage_out = static_cast<uint64_t>(usage) & PRODUCER_MASK;
+ *consumerUsage_out = static_cast<uint64_t>(usage) & CONSUMER_MASK;
+
+ if ((static_cast<uint32_t>(usage) & GRALLOC_USAGE_SW_READ_OFTEN) ==
+ GRALLOC_USAGE_SW_READ_OFTEN) {
+ *producerUsage_out |= GRALLOC1_PRODUCER_USAGE_CPU_READ_OFTEN;
+ *consumerUsage_out |= GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN;
+ }
+
+ if ((static_cast<uint32_t>(usage) & GRALLOC_USAGE_SW_WRITE_OFTEN) ==
+ GRALLOC_USAGE_SW_WRITE_OFTEN) {
+ *producerUsage_out |= GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN;
+ }
+}
+
+void AndroidNativeBufferInfo::QueueState::setup(VulkanDispatch* vk, VkDevice device,
+ VkQueue queueIn, uint32_t queueFamilyIndexIn,
+ android::base::Lock* queueLockIn) {
+ queue = queueIn;
+ queueFamilyIndex = queueFamilyIndexIn;
+ lock = queueLockIn;
+
+ VkCommandPoolCreateInfo poolCreateInfo = {
+ VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
+ 0,
+ VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
+ queueFamilyIndex,
+ };
+
+ vk->vkCreateCommandPool(device, &poolCreateInfo, nullptr, &pool);
+
+ VkCommandBufferAllocateInfo cbAllocInfo = {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, 0, pool, VK_COMMAND_BUFFER_LEVEL_PRIMARY, 1,
+ };
+
+ vk->vkAllocateCommandBuffers(device, &cbAllocInfo, &cb);
+
+ vk->vkAllocateCommandBuffers(device, &cbAllocInfo, &cb2);
+
+ VkFenceCreateInfo fenceCreateInfo = {
+ VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ 0,
+ 0,
+ };
+
+ vk->vkCreateFence(device, &fenceCreateInfo, nullptr, &fence);
+}
+
+void AndroidNativeBufferInfo::QueueState::teardown(VulkanDispatch* vk, VkDevice device) {
+ if (queue) {
+ AutoLock qlock(*lock);
+ vk->vkQueueWaitIdle(queue);
+ }
+ if (cb) vk->vkFreeCommandBuffers(device, pool, 1, &cb);
+ if (pool) vk->vkDestroyCommandPool(device, pool, nullptr);
+ if (fence) vk->vkDestroyFence(device, fence, nullptr);
+
+ lock = nullptr;
+ queue = VK_NULL_HANDLE;
+ pool = VK_NULL_HANDLE;
+ cb = VK_NULL_HANDLE;
+ fence = VK_NULL_HANDLE;
+ queueFamilyIndex = 0;
+}
+
+VkResult setAndroidNativeImageSemaphoreSignaled(VulkanDispatch* vk, VkDevice device,
+ VkQueue defaultQueue,
+ uint32_t defaultQueueFamilyIndex,
+ Lock* defaultQueueLock, VkSemaphore semaphore,
+ VkFence fence, AndroidNativeBufferInfo* anbInfo) {
+ auto fb = FrameBuffer::getFB();
+
+ bool firstTimeSetup = !anbInfo->everSynced && !anbInfo->everAcquired;
+
+ anbInfo->everAcquired = true;
+
+ if (firstTimeSetup) {
+ VkSubmitInfo submitInfo = {
+ VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ 0,
+ 0,
+ nullptr,
+ nullptr,
+ 0,
+ nullptr,
+ (uint32_t)(semaphore == VK_NULL_HANDLE ? 0 : 1),
+ semaphore == VK_NULL_HANDLE ? nullptr : &semaphore,
+ };
+ AutoLock qlock(*defaultQueueLock);
+ VK_CHECK(vk->vkQueueSubmit(defaultQueue, 1, &submitInfo, fence));
+ } else {
+ // Setup queue state for this queue family index.
+ auto queueFamilyIndex = anbInfo->lastUsedQueueFamilyIndex;
+ if (queueFamilyIndex >= anbInfo->queueStates.size()) {
+ anbInfo->queueStates.resize(queueFamilyIndex + 1);
+ }
+ AndroidNativeBufferInfo::QueueState& queueState =
+ anbInfo->queueStates[queueFamilyIndex];
+ if (!queueState.queue) {
+ queueState.setup(vk, anbInfo->device, defaultQueue, queueFamilyIndex, defaultQueueLock);
+ }
+
+ // If we used the Vulkan image without copying it back
+ // to the CPU, reset the layout to PRESENT.
+ if (anbInfo->useVulkanNativeImage) {
+ VkCommandBufferBeginInfo beginInfo = {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ 0,
+ VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ nullptr /* no inheritance info */,
+ };
+
+ vk->vkBeginCommandBuffer(queueState.cb2, &beginInfo);
+
+ VkImageMemoryBarrier queueTransferBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
+ .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL,
+ .dstQueueFamilyIndex = anbInfo->lastUsedQueueFamilyIndex,
+ .image = anbInfo->image,
+ .subresourceRange =
+ {
+ VK_IMAGE_ASPECT_COLOR_BIT,
+ 0,
+ 1,
+ 0,
+ 1,
+ },
+ };
+ vk->vkCmdPipelineBarrier(queueState.cb2, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr,
+ 1, &queueTransferBarrier);
+ vk->vkEndCommandBuffer(queueState.cb2);
+
+ VkSubmitInfo submitInfo = {
+ VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ 0,
+ 0,
+ nullptr,
+ nullptr,
+ 1,
+ &queueState.cb2,
+ (uint32_t)(semaphore == VK_NULL_HANDLE ? 0 : 1),
+ semaphore == VK_NULL_HANDLE ? nullptr : &semaphore,
+ };
+
+ AutoLock qlock(*queueState.lock);
+ // TODO(kaiyili): initiate ownership transfer from DisplayVk here
+ VK_CHECK(vk->vkQueueSubmit(queueState.queue, 1, &submitInfo, fence));
+ } else {
+ const AndroidNativeBufferInfo::QueueState& queueState =
+ anbInfo->queueStates[anbInfo->lastUsedQueueFamilyIndex];
+ VkSubmitInfo submitInfo = {
+ VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ 0,
+ 0,
+ nullptr,
+ nullptr,
+ 0,
+ nullptr,
+ (uint32_t)(semaphore == VK_NULL_HANDLE ? 0 : 1),
+ semaphore == VK_NULL_HANDLE ? nullptr : &semaphore,
+ };
+ AutoLock qlock(*queueState.lock);
+ VK_CHECK(vk->vkQueueSubmit(queueState.queue, 1, &submitInfo, fence));
+ }
+ }
+
+ return VK_SUCCESS;
+}
+
+static constexpr uint64_t kTimeoutNs = 3ULL * 1000000000ULL;
+
+VkResult syncImageToColorBuffer(VulkanDispatch* vk, uint32_t queueFamilyIndex, VkQueue queue,
+ Lock* queueLock, uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores, int* pNativeFenceFd,
+ std::shared_ptr<AndroidNativeBufferInfo> anbInfo) {
+ auto anbInfoPtr = anbInfo.get();
+ auto fb = FrameBuffer::getFB();
+ fb->lock();
+
+ // Implicitly synchronized
+ *pNativeFenceFd = -1;
+
+ anbInfo->everSynced = true;
+ anbInfo->lastUsedQueueFamilyIndex = queueFamilyIndex;
+
+ // Setup queue state for this queue family index.
+ if (queueFamilyIndex >= anbInfo->queueStates.size()) {
+ anbInfo->queueStates.resize(queueFamilyIndex + 1);
+ }
+
+ auto& queueState = anbInfo->queueStates[queueFamilyIndex];
+
+ if (!queueState.queue) {
+ queueState.setup(vk, anbInfo->device, queue, queueFamilyIndex, queueLock);
+ }
+
+ // Record our synchronization commands.
+ VkCommandBufferBeginInfo beginInfo = {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ 0,
+ VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ nullptr /* no inheritance info */,
+ };
+
+ vk->vkBeginCommandBuffer(queueState.cb, &beginInfo);
+
+ // If using the Vulkan image directly (rather than copying it back to
+ // the CPU), change its layout for that use.
+ if (anbInfo->useVulkanNativeImage) {
+ VkImageMemoryBarrier queueTransferBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
+ .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
+ .srcQueueFamilyIndex = queueFamilyIndex,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL,
+ .image = anbInfo->image,
+ .subresourceRange =
+ {
+ VK_IMAGE_ASPECT_COLOR_BIT,
+ 0,
+ 1,
+ 0,
+ 1,
+ },
+ };
+ vk->vkCmdPipelineBarrier(queueState.cb, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &queueTransferBarrier);
+
+ } else {
+ // Not a GL texture. Read it back and put it back in present layout.
+
+ // From the spec: If an application does not need the contents of a resource
+ // to remain valid when transferring from one queue family to another, then
+ // the ownership transfer should be skipped.
+ // We definitely need to transition the image to
+ // VK_TRANSFER_SRC_OPTIMAL and back.
+ VkImageMemoryBarrier presentToTransferSrc = {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ 0,
+ 0,
+ VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
+ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ VK_QUEUE_FAMILY_IGNORED,
+ VK_QUEUE_FAMILY_IGNORED,
+ anbInfo->image,
+ {
+ VK_IMAGE_ASPECT_COLOR_BIT,
+ 0,
+ 1,
+ 0,
+ 1,
+ },
+ };
+
+ vk->vkCmdPipelineBarrier(queueState.cb, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &presentToTransferSrc);
+
+ VkBufferImageCopy region = {
+ 0 /* buffer offset */,
+ anbInfo->extent.width,
+ anbInfo->extent.height,
+ {
+ VK_IMAGE_ASPECT_COLOR_BIT,
+ 0,
+ 0,
+ 1,
+ },
+ {0, 0, 0},
+ anbInfo->extent,
+ };
+
+ vk->vkCmdCopyImageToBuffer(queueState.cb, anbInfo->image,
+ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, anbInfo->stagingBuffer, 1,
+ &region);
+
+ // Transfer back to present src.
+ VkImageMemoryBarrier backToPresentSrc = {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ 0,
+ VK_ACCESS_TRANSFER_READ_BIT,
+ 0,
+ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
+ VK_QUEUE_FAMILY_IGNORED,
+ VK_QUEUE_FAMILY_IGNORED,
+ anbInfo->image,
+ {
+ VK_IMAGE_ASPECT_COLOR_BIT,
+ 0,
+ 1,
+ 0,
+ 1,
+ },
+ };
+
+ vk->vkCmdPipelineBarrier(queueState.cb, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &backToPresentSrc);
+ }
+
+ vk->vkEndCommandBuffer(queueState.cb);
+
+ std::vector<VkPipelineStageFlags> pipelineStageFlags;
+ pipelineStageFlags.resize(waitSemaphoreCount, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT);
+
+ VkSubmitInfo submitInfo = {
+ VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ 0,
+ waitSemaphoreCount,
+ pWaitSemaphores,
+ pipelineStageFlags.data(),
+ 1,
+ &queueState.cb,
+ 0,
+ nullptr,
+ };
+
+ // TODO(kaiyili): initiate ownership transfer to DisplayVk here.
+ VkFence qsriFence = anbInfo->qsriWaitFencePool->getFenceFromPool();
+ AutoLock qLock(*queueLock);
+ VK_CHECK(vk->vkQueueSubmit(queueState.queue, 1, &submitInfo, qsriFence));
+ auto waitForQsriFenceTask = [anbInfoPtr, anbInfo, vk, device = anbInfo->device, qsriFence] {
+ (void)anbInfoPtr;
+ VK_ANB_DEBUG_OBJ(anbInfoPtr, "wait callback: enter");
+ VK_ANB_DEBUG_OBJ(anbInfoPtr, "wait callback: wait for fence %p...", qsriFence);
+ VkResult res = vk->vkWaitForFences(device, 1, &qsriFence, VK_FALSE, kTimeoutNs);
+ switch (res) {
+ case VK_SUCCESS:
+ break;
+ case VK_TIMEOUT:
+ VK_ANB_ERR("Timeout when waiting for the Qsri fence.");
+ break;
+ default:
+ ERR("Failed to wait for QSRI fence: %s\n", string_VkResult(res));
+ VK_CHECK(res);
+ }
+ VK_ANB_DEBUG_OBJ(anbInfoPtr, "wait callback: wait for fence %p...(done)", qsriFence);
+ anbInfo->qsriWaitFencePool->returnFence(qsriFence);
+ };
+ fb->unlock();
+
+ if (anbInfo->useVulkanNativeImage) {
+ VK_ANB_DEBUG_OBJ(anbInfoPtr, "using native image, so use sync thread to wait");
+ // Queue wait to sync thread with completion callback
+ // Pass anbInfo by value to get a ref
+ SyncThread::get()->triggerGeneral(
+ [waitForQsriFenceTask = std::move(waitForQsriFenceTask), anbInfo]() mutable {
+ waitForQsriFenceTask();
+ anbInfo->qsriTimeline->signalNextPresentAndPoll();
+ },
+ "wait for the guest Qsri VkFence signaled");
+ } else {
+ VK_ANB_DEBUG_OBJ(anbInfoPtr, "not using native image, so wait right away");
+ waitForQsriFenceTask();
+
+ VkMappedMemoryRange toInvalidate = {
+ VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, 0, anbInfo->stagingMemory, 0, VK_WHOLE_SIZE,
+ };
+
+ vk->vkInvalidateMappedMemoryRanges(anbInfo->device, 1, &toInvalidate);
+
+ uint32_t colorBufferHandle = anbInfo->colorBufferHandle;
+
+ // Copy to from staging buffer to color buffer
+ uint32_t bpp = 4; /* format always rgba8...not */
+ switch (anbInfo->vkFormat) {
+ case VK_FORMAT_R5G6B5_UNORM_PACK16:
+ bpp = 2;
+ break;
+ case VK_FORMAT_R8G8B8_UNORM:
+ bpp = 3;
+ break;
+ default:
+ case VK_FORMAT_R8G8B8A8_UNORM:
+ case VK_FORMAT_B8G8R8A8_UNORM:
+ bpp = 4;
+ break;
+ }
+
+ FrameBuffer::getFB()->flushColorBufferFromVkBytes(
+ colorBufferHandle, anbInfo->mappedStagingPtr,
+ bpp * anbInfo->extent.width * anbInfo->extent.height);
+ anbInfo->qsriTimeline->signalNextPresentAndPoll();
+ }
+
+ return VK_SUCCESS;
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkAndroidNativeBuffer.h b/src/gfxstream/host/vulkan/VkAndroidNativeBuffer.h
new file mode 100644
index 00000000000..08bc7d7cad5
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkAndroidNativeBuffer.h
@@ -0,0 +1,172 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+#include <atomic>
+#include <deque>
+#include <memory>
+#include <unordered_set>
+#include <vector>
+
+#include "VkCommonOperations.h"
+#include "VkQsriTimeline.h"
+#include "aemu/base/BumpPool.h"
+#include "aemu/base/synchronization/ConditionVariable.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "goldfish_vk_private_defs.h"
+
+namespace gfxstream {
+namespace vk {
+
+struct AndroidNativeBufferInfo;
+struct VulkanDispatch;
+
+// This class provides methods to create and query information about Android
+// native buffers in the context of creating Android swapchain images that have
+// Android native buffer backing.
+
+// This is to be refactored to move to external memory only once we get that
+// working.
+
+void teardownAndroidNativeBufferImage(VulkanDispatch* vk, AndroidNativeBufferInfo* anbInfo);
+
+struct AndroidNativeBufferInfo {
+ ~AndroidNativeBufferInfo() {
+ if (vk) {
+ teardownAndroidNativeBufferImage(vk, this);
+ }
+ }
+
+ VulkanDispatch* vk = nullptr;
+ VkDevice device = VK_NULL_HANDLE;
+ VkFormat vkFormat;
+ VkExtent3D extent;
+ VkImageUsageFlags usage;
+ std::vector<uint32_t> queueFamilyIndices;
+
+ int format;
+ int stride;
+ uint32_t colorBufferHandle;
+ bool externallyBacked = false;
+ bool useVulkanNativeImage = false;
+
+ // We will be using separate allocations for image versus staging memory,
+ // because not all host Vulkan drivers will support directly rendering to
+ // host visible memory in a layout that glTexSubImage2D can consume.
+
+ // If we are using external memory, these memories are imported
+ // to the current instance.
+ VkDeviceMemory imageMemory = VK_NULL_HANDLE;
+ VkDeviceMemory stagingMemory = VK_NULL_HANDLE;
+
+ VkBuffer stagingBuffer = VK_NULL_HANDLE;
+
+ uint32_t imageMemoryTypeIndex;
+ uint32_t stagingMemoryTypeIndex;
+
+ uint8_t* mappedStagingPtr = nullptr;
+
+ // To be populated later as we go.
+ VkImage image = VK_NULL_HANDLE;
+ VkMemoryRequirements memReqs;
+
+ // The queue over which we send the buffer/image copy commands depends on
+ // the queue over which vkQueueSignalReleaseImageANDROID happens.
+ // It is assumed that the VkImage object has been created by Android swapchain layer
+ // with all the relevant queue family indices for sharing set properly.
+ struct QueueState {
+ VkQueue queue = VK_NULL_HANDLE;
+ VkCommandPool pool = VK_NULL_HANDLE;
+ VkCommandBuffer cb = VK_NULL_HANDLE;
+ VkCommandBuffer cb2 = VK_NULL_HANDLE;
+ VkFence fence = VK_NULL_HANDLE;
+ android::base::Lock* lock = nullptr;
+ uint32_t queueFamilyIndex = 0;
+ void setup(VulkanDispatch* vk, VkDevice device, VkQueue queue, uint32_t queueFamilyIndex,
+ android::base::Lock* queueLock);
+ void teardown(VulkanDispatch* vk, VkDevice device);
+ };
+ // We keep one QueueState for each queue family index used by the guest
+ // in vkQueuePresentKHR.
+ std::vector<QueueState> queueStates;
+
+ // Did we ever sync the Vulkan image with a ColorBuffer?
+ // If so, set everSynced along with the queue family index
+ // used to do that.
+ // If the swapchain image was created with exclusive sharing
+ // mode (reflected in this struct's |sharingMode| field),
+ // this part doesn't really matter.
+ bool everSynced = false;
+ uint32_t lastUsedQueueFamilyIndex;
+
+ // On first acquire, we might use a different queue family
+ // to initially set the semaphore/fence to be signaled.
+ // Track that here.
+ bool everAcquired = false;
+ QueueState acquireQueueState;
+
+ // State that is of interest when interacting with sync fds and SyncThread.
+ // Protected by this lock and condition variable.
+ class QsriWaitFencePool {
+ public:
+ QsriWaitFencePool(VulkanDispatch*, VkDevice);
+ ~QsriWaitFencePool();
+ VkFence getFenceFromPool();
+ void returnFence(VkFence fence);
+
+ private:
+ android::base::Lock mLock;
+
+ VulkanDispatch* mVk;
+ VkDevice mDevice;
+
+ // A pool of vkFences for waiting (optimization so we don't keep recreating them every
+ // time).
+ std::vector<VkFence> mAvailableFences;
+ std::unordered_set<VkFence> mUsedFences;
+ };
+
+ std::unique_ptr<QsriWaitFencePool> qsriWaitFencePool = nullptr;
+ std::unique_ptr<VkQsriTimeline> qsriTimeline = nullptr;
+};
+
+VkResult prepareAndroidNativeBufferImage(VulkanDispatch* vk, VkDevice device,
+ android::base::BumpPool& allocator,
+ const VkImageCreateInfo* pCreateInfo,
+ const VkNativeBufferANDROID* nativeBufferANDROID,
+ const VkAllocationCallbacks* pAllocator,
+ const VkPhysicalDeviceMemoryProperties* memProps,
+ AndroidNativeBufferInfo* out);
+
+void getGralloc0Usage(VkFormat format, VkImageUsageFlags imageUsage, int* usage_out);
+void getGralloc1Usage(VkFormat format, VkImageUsageFlags imageUsage,
+ VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
+ uint64_t* consumerUsage_out, uint64_t* producerUsage_out);
+
+VkResult setAndroidNativeImageSemaphoreSignaled(VulkanDispatch* vk, VkDevice device,
+ VkQueue defaultQueue,
+ uint32_t defaultQueueFamilyIndex,
+ android::base::Lock* defaultQueueLock,
+ VkSemaphore semaphore, VkFence fence,
+ AndroidNativeBufferInfo* anbInfo);
+
+VkResult syncImageToColorBuffer(VulkanDispatch* vk, uint32_t queueFamilyIndex, VkQueue queue,
+ android::base::Lock* queueLock, uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores, int* pNativeFenceFd,
+ std::shared_ptr<AndroidNativeBufferInfo> anbInfo);
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkCommonOperations.cpp b/src/gfxstream/host/vulkan/VkCommonOperations.cpp
new file mode 100644
index 00000000000..83b84e53d08
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkCommonOperations.cpp
@@ -0,0 +1,3554 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "VkCommonOperations.h"
+
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#include <GLES3/gl3.h>
+#include <stdio.h>
+#include <string.h>
+#include <vulkan/vk_enum_string_helper.h>
+
+#include <iomanip>
+#include <ostream>
+#include <sstream>
+#include <unordered_set>
+
+#include "VkDecoderGlobalState.h"
+#include "VkFormatUtils.h"
+#include "VulkanDispatch.h"
+#include "aemu/base/Optional.h"
+#include "aemu/base/Tracing.h"
+#include "aemu/base/containers/Lookup.h"
+#include "aemu/base/containers/StaticMap.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/system/System.h"
+#include "common/goldfish_vk_dispatch.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/emugl_vm_operations.h"
+#include "host-common/vm_operations.h"
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <fcntl.h>
+#include <unistd.h>
+#endif
+
+#ifdef __APPLE__
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
+namespace gfxstream {
+namespace vk {
+namespace {
+
+#define VK_COMMON_ERROR(fmt, ...) \
+ fprintf(stderr, "%s:%d " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);
+#define VK_COMMON_LOG(fmt, ...) \
+ fprintf(stdout, "%s:%d " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);
+#define VK_COMMON_VERBOSE(fmt, ...) \
+ if (android::base::isVerboseLogging()) \
+ fprintf(stderr, "%s:%d " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);
+
+using android::base::AutoLock;
+using android::base::kNullopt;
+using android::base::ManagedDescriptor;
+using android::base::Optional;
+using android::base::StaticLock;
+using android::base::StaticMap;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+constexpr size_t kPageBits = 12;
+constexpr size_t kPageSize = 1u << kPageBits;
+
+static int kMaxDebugMarkerAnnotations = 10;
+
+static std::optional<std::string> sMemoryLogPath = std::nullopt;
+
+const char* string_AstcEmulationMode(AstcEmulationMode mode) {
+ switch (mode) {
+ case AstcEmulationMode::Disabled:
+ return "Disabled";
+ case AstcEmulationMode::Cpu:
+ return "Cpu";
+ case AstcEmulationMode::Gpu:
+ return "Gpu";
+ }
+ return "Unknown";
+}
+
+} // namespace
+
+static StaticMap<VkDevice, uint32_t> sKnownStagingTypeIndices;
+
+static android::base::StaticLock sVkEmulationLock;
+
+static bool updateColorBufferFromBytesLocked(uint32_t colorBufferHandle, uint32_t x, uint32_t y,
+ uint32_t w, uint32_t h, const void* pixels,
+ size_t inputPixelsSize);
+
+#if !defined(__QNX__)
+VK_EXT_MEMORY_HANDLE dupExternalMemory(VK_EXT_MEMORY_HANDLE h) {
+#ifdef _WIN32
+ auto myProcessHandle = GetCurrentProcess();
+ VK_EXT_MEMORY_HANDLE res;
+ DuplicateHandle(myProcessHandle, h, // source process and handle
+ myProcessHandle, &res, // target process and pointer to handle
+ 0 /* desired access (ignored) */, true /* inherit */,
+ DUPLICATE_SAME_ACCESS /* same access option */);
+ return res;
+#else
+ return dup(h);
+#endif
+}
+#endif
+
+bool getStagingMemoryTypeIndex(VulkanDispatch* vk, VkDevice device,
+ const VkPhysicalDeviceMemoryProperties* memProps,
+ uint32_t* typeIndex) {
+ auto res = sKnownStagingTypeIndices.get(device);
+
+ if (res) {
+ *typeIndex = *res;
+ return true;
+ }
+
+ VkBufferCreateInfo testCreateInfo = {
+ VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
+ 0,
+ 0,
+ 4096,
+ // To be a staging buffer, it must support being
+ // both a transfer src and dst.
+ VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
+ // TODO: See if buffers over shared queues need to be
+ // considered separately
+ VK_SHARING_MODE_EXCLUSIVE,
+ 0,
+ nullptr,
+ };
+
+ VkBuffer testBuffer;
+ VkResult testBufferCreateRes =
+ vk->vkCreateBuffer(device, &testCreateInfo, nullptr, &testBuffer);
+
+ if (testBufferCreateRes != VK_SUCCESS) {
+ VK_COMMON_ERROR(
+ "Could not create test buffer "
+ "for staging buffer query. VkResult: 0x%llx",
+ (unsigned long long)testBufferCreateRes);
+ return false;
+ }
+
+ VkMemoryRequirements memReqs;
+ vk->vkGetBufferMemoryRequirements(device, testBuffer, &memReqs);
+
+ // To be a staging buffer, we need to allow CPU read/write access.
+ // Thus, we need the memory type index both to be host visible
+ // and to be supported in the memory requirements of the buffer.
+ bool foundSuitableStagingMemoryType = false;
+ uint32_t stagingMemoryTypeIndex = 0;
+
+ for (uint32_t i = 0; i < memProps->memoryTypeCount; ++i) {
+ const auto& typeInfo = memProps->memoryTypes[i];
+ bool hostVisible = typeInfo.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+ bool hostCached = typeInfo.propertyFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
+ bool allowedInBuffer = (1 << i) & memReqs.memoryTypeBits;
+ if (hostVisible && hostCached && allowedInBuffer) {
+ foundSuitableStagingMemoryType = true;
+ stagingMemoryTypeIndex = i;
+ break;
+ }
+ }
+
+ // If the previous loop failed, try to accept a type that is not HOST_CACHED.
+ if (!foundSuitableStagingMemoryType) {
+ for (uint32_t i = 0; i < memProps->memoryTypeCount; ++i) {
+ const auto& typeInfo = memProps->memoryTypes[i];
+ bool hostVisible = typeInfo.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+ bool allowedInBuffer = (1 << i) & memReqs.memoryTypeBits;
+ if (hostVisible && allowedInBuffer) {
+ VK_COMMON_ERROR("Warning: using non-cached HOST_VISIBLE type for staging memory");
+ foundSuitableStagingMemoryType = true;
+ stagingMemoryTypeIndex = i;
+ break;
+ }
+ }
+ }
+
+ vk->vkDestroyBuffer(device, testBuffer, nullptr);
+
+ if (!foundSuitableStagingMemoryType) {
+ std::stringstream ss;
+ ss << "Could not find suitable memory type index "
+ << "for staging buffer. Memory type bits: " << std::hex << memReqs.memoryTypeBits << "\n"
+ << "Available host visible memory type indices:"
+ << "\n";
+ for (uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i) {
+ if (memProps->memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
+ ss << "Host visible memory type index: %u" << i << "\n";
+ }
+ if (memProps->memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) {
+ ss << "Host cached memory type index: %u" << i << "\n";
+ }
+ }
+
+ VK_COMMON_ERROR("Error: %s", ss.str().c_str());
+
+ return false;
+ }
+
+ sKnownStagingTypeIndices.set(device, stagingMemoryTypeIndex);
+ *typeIndex = stagingMemoryTypeIndex;
+
+ return true;
+}
+
+static VkEmulation* sVkEmulation = nullptr;
+
+static bool extensionsSupported(const std::vector<VkExtensionProperties>& currentProps,
+ const std::vector<const char*>& wantedExtNames) {
+ std::vector<bool> foundExts(wantedExtNames.size(), false);
+
+ for (uint32_t i = 0; i < currentProps.size(); ++i) {
+ VK_COMMON_VERBOSE("has extension: %s", currentProps[i].extensionName);
+ for (size_t j = 0; j < wantedExtNames.size(); ++j) {
+ if (!strcmp(wantedExtNames[j], currentProps[i].extensionName)) {
+ foundExts[j] = true;
+ }
+ }
+ }
+
+ for (size_t i = 0; i < wantedExtNames.size(); ++i) {
+ bool found = foundExts[i];
+ // LOG(VERBOSE) << "needed extension: " << wantedExtNames[i]
+ // << " found: " << found;
+ if (!found) {
+ // LOG(VERBOSE) << wantedExtNames[i] << " not found, bailing.";
+ return false;
+ }
+ }
+
+ return true;
+}
+
+// For a given ImageSupportInfo, populates usageWithExternalHandles and
+// requiresDedicatedAllocation. memoryTypeBits are populated later once the
+// device is created, beacuse that needs a test image to be created.
+// If we don't support external memory, it's assumed dedicated allocations are
+// not needed.
+// Precondition: sVkEmulation instance has been created and ext memory caps known.
+// Returns false if the query failed.
+static bool getImageFormatExternalMemorySupportInfo(VulkanDispatch* vk, VkPhysicalDevice physdev,
+ VkEmulation::ImageSupportInfo* info) {
+ // Currently there is nothing special we need to do about
+ // VkFormatProperties2, so just use the normal version
+ // and put it in the format2 struct.
+ VkFormatProperties outFormatProps;
+ vk->vkGetPhysicalDeviceFormatProperties(physdev, info->format, &outFormatProps);
+
+ info->formatProps2 = {
+ VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2,
+ 0,
+ outFormatProps,
+ };
+
+ if (!sVkEmulation->instanceSupportsExternalMemoryCapabilities) {
+ info->supportsExternalMemory = false;
+ info->requiresDedicatedAllocation = false;
+
+ VkImageFormatProperties outImageFormatProps;
+ VkResult res = vk->vkGetPhysicalDeviceImageFormatProperties(
+ physdev, info->format, info->type, info->tiling, info->usageFlags, info->createFlags,
+ &outImageFormatProps);
+
+ if (res != VK_SUCCESS) {
+ if (res == VK_ERROR_FORMAT_NOT_SUPPORTED) {
+ info->supported = false;
+ return true;
+ } else {
+ fprintf(stderr,
+ "%s: vkGetPhysicalDeviceImageFormatProperties query "
+ "failed with %d "
+ "for format 0x%x type 0x%x usage 0x%x flags 0x%x\n",
+ __func__, res, info->format, info->type, info->usageFlags,
+ info->createFlags);
+ return false;
+ }
+ }
+
+ info->supported = true;
+
+ info->imageFormatProps2 = {
+ VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2,
+ 0,
+ outImageFormatProps,
+ };
+
+ // LOG(VERBOSE) << "Supported (not externally): "
+ // << string_VkFormat(info->format) << " "
+ // << string_VkImageType(info->type) << " "
+ // << string_VkImageTiling(info->tiling) << " "
+ // << string_VkImageUsageFlagBits(
+ // (VkImageUsageFlagBits)info->usageFlags);
+
+ return true;
+ }
+
+ VkPhysicalDeviceExternalImageFormatInfo extInfo = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO,
+ 0,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ };
+
+ VkPhysicalDeviceImageFormatInfo2 formatInfo2 = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2,
+ &extInfo,
+ info->format,
+ info->type,
+ info->tiling,
+ info->usageFlags,
+ info->createFlags,
+ };
+
+ VkExternalImageFormatProperties outExternalProps = {
+ VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES,
+ 0,
+ {
+ (VkExternalMemoryFeatureFlags)0,
+ (VkExternalMemoryHandleTypeFlags)0,
+ (VkExternalMemoryHandleTypeFlags)0,
+ },
+ };
+
+ VkImageFormatProperties2 outProps2 = {VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2,
+ &outExternalProps,
+ {
+ {0, 0, 0},
+ 0,
+ 0,
+ 1,
+ 0,
+ }};
+
+ VkResult res = sVkEmulation->getImageFormatProperties2Func(physdev, &formatInfo2, &outProps2);
+
+ if (res != VK_SUCCESS) {
+ if (res == VK_ERROR_FORMAT_NOT_SUPPORTED) {
+ info->supported = false;
+ return true;
+ } else {
+ fprintf(stderr,
+ "%s: vkGetPhysicalDeviceImageFormatProperties2KHR query "
+ "failed "
+ "for format 0x%x type 0x%x usage 0x%x flags 0x%x\n",
+ __func__, info->format, info->type, info->usageFlags, info->createFlags);
+ return false;
+ }
+ }
+
+ info->supported = true;
+
+ VkExternalMemoryFeatureFlags featureFlags =
+ outExternalProps.externalMemoryProperties.externalMemoryFeatures;
+
+ VkExternalMemoryHandleTypeFlags exportImportedFlags =
+ outExternalProps.externalMemoryProperties.exportFromImportedHandleTypes;
+
+ // Don't really care about export form imported handle types yet
+ (void)exportImportedFlags;
+
+ VkExternalMemoryHandleTypeFlags compatibleHandleTypes =
+ outExternalProps.externalMemoryProperties.compatibleHandleTypes;
+
+ info->supportsExternalMemory = (VK_EXT_MEMORY_HANDLE_TYPE_BIT & compatibleHandleTypes) &&
+ (VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT & featureFlags) &&
+ (VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT & featureFlags);
+
+ info->requiresDedicatedAllocation =
+ (VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT & featureFlags);
+
+ info->imageFormatProps2 = outProps2;
+ info->extFormatProps = outExternalProps;
+ info->imageFormatProps2.pNext = &info->extFormatProps;
+
+ // LOG(VERBOSE) << "Supported: "
+ // << string_VkFormat(info->format) << " "
+ // << string_VkImageType(info->type) << " "
+ // << string_VkImageTiling(info->tiling) << " "
+ // << string_VkImageUsageFlagBits(
+ // (VkImageUsageFlagBits)info->usageFlags)
+ // << " "
+ // << "supportsExternalMemory? " << info->supportsExternalMemory
+ // << " "
+ // << "requiresDedicated? " << info->requiresDedicatedAllocation;
+
+ return true;
+}
+
+// Vulkan driverVersions are bit-shift packs of their dotted versions
+// For example, nvidia driverversion 1934229504 unpacks to 461.40
+// note: while this is equivalent to VkPhysicalDeviceDriverProperties.driverInfo on NVIDIA,
+// on intel that value is simply "Intel driver".
+static std::string decodeDriverVersion(uint32_t vendorId, uint32_t driverVersion) {
+ std::stringstream result;
+ switch (vendorId) {
+ case 0x10DE: {
+ // Nvidia. E.g. driverVersion = 1934229504(0x734a0000) maps to 461.40
+ uint32_t major = driverVersion >> 22;
+ uint32_t minor = (driverVersion >> 14) & 0xff;
+ uint32_t build = (driverVersion >> 6) & 0xff;
+ uint32_t revision = driverVersion & 0x3f;
+ result << major << '.' << minor << '.' << build << '.' << revision;
+ break;
+ }
+ case 0x8086: {
+ // Intel. E.g. driverVersion = 1647866(0x1924fa) maps to 100.9466 (27.20.100.9466)
+ uint32_t high = driverVersion >> 14;
+ uint32_t low = driverVersion & 0x3fff;
+ result << high << '.' << low;
+ break;
+ }
+ case 0x002: // amd
+ default: {
+ uint32_t major = VK_VERSION_MAJOR(driverVersion);
+ uint32_t minor = VK_VERSION_MINOR(driverVersion);
+ uint32_t patch = VK_VERSION_PATCH(driverVersion);
+ result << major << "." << minor << "." << patch;
+ break;
+ }
+ }
+ return result.str();
+}
+
+static std::vector<VkEmulation::ImageSupportInfo> getBasicImageSupportList() {
+ struct ImageFeatureCombo {
+ VkFormat format;
+ VkImageCreateFlags createFlags = 0;
+ };
+ // Set the mutable flag for RGB UNORM formats so that the created image can also be sampled in
+ // the sRGB Colorspace. See
+ // https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3827672/comments/77db9cb3_60663a6a
+ // for details.
+ std::vector<ImageFeatureCombo> combos = {
+ // Cover all the gralloc formats
+ {VK_FORMAT_R8G8B8A8_UNORM,
+ VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT},
+ {VK_FORMAT_R8G8B8_UNORM,
+ VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT},
+
+ {VK_FORMAT_R5G6B5_UNORM_PACK16},
+
+ {VK_FORMAT_R16G16B16A16_SFLOAT},
+ {VK_FORMAT_R16G16B16_SFLOAT},
+
+ {VK_FORMAT_B8G8R8A8_UNORM,
+ VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT},
+
+ {VK_FORMAT_R8_UNORM,
+ VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT},
+ {VK_FORMAT_R16_UNORM,
+ VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT},
+
+ {VK_FORMAT_A2R10G10B10_UINT_PACK32},
+ {VK_FORMAT_A2R10G10B10_UNORM_PACK32},
+ {VK_FORMAT_A2B10G10R10_UNORM_PACK32},
+
+ // Compressed texture formats
+ {VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK},
+ {VK_FORMAT_ASTC_4x4_UNORM_BLOCK},
+
+ // TODO: YUV formats used in Android
+ // Fails on Mac
+ {VK_FORMAT_G8_B8R8_2PLANE_420_UNORM},
+ {VK_FORMAT_G8_B8R8_2PLANE_422_UNORM},
+ {VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM},
+ {VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM},
+ {VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16},
+
+ };
+
+ std::vector<VkImageType> types = {
+ VK_IMAGE_TYPE_2D,
+ };
+
+ std::vector<VkImageTiling> tilings = {
+ VK_IMAGE_TILING_LINEAR,
+ VK_IMAGE_TILING_OPTIMAL,
+ };
+
+ std::vector<VkImageUsageFlags> usageFlags = {
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT,
+ VK_IMAGE_USAGE_SAMPLED_BIT, VK_IMAGE_USAGE_TRANSFER_SRC_BIT,
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT,
+ };
+
+ std::vector<VkEmulation::ImageSupportInfo> res;
+
+ // Currently: 17 format + create flags combo, 2 tilings, 5 usage flags -> 170 cases to check.
+ for (auto combo : combos) {
+ for (auto t : types) {
+ for (auto ti : tilings) {
+ for (auto u : usageFlags) {
+ VkEmulation::ImageSupportInfo info;
+ info.format = combo.format;
+ info.type = t;
+ info.tiling = ti;
+ info.usageFlags = u;
+ info.createFlags = combo.createFlags;
+ res.push_back(info);
+ }
+ }
+ }
+ }
+
+ return res;
+}
+
+VkEmulation* createGlobalVkEmulation(VulkanDispatch* vk, bool useVulkanNativeSwapchain) {
+// Downstream branches can provide abort logic or otherwise use result without a new macro
+#define VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(res, ...) \
+ do { \
+ (void)res; /* no-op of unused param*/ \
+ ERR(__VA_ARGS__); \
+ return nullptr; \
+ } while (0)
+
+ AutoLock lock(sVkEmulationLock);
+
+ if (sVkEmulation) return sVkEmulation;
+
+ if (!vkDispatchValid(vk)) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER, "Dispatch is invalid.");
+ }
+
+ sVkEmulation = new VkEmulation;
+
+ sVkEmulation->gvk = vk;
+ auto gvk = vk;
+
+ std::vector<const char*> externalMemoryInstanceExtNames = {
+ VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME,
+ VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,
+ };
+
+ std::vector<const char*> externalMemoryDeviceExtNames = {
+ VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME,
+ VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME,
+#ifdef _WIN32
+ VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME,
+#elif defined(__QNX__)
+ VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME,
+#else
+ VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME,
+#endif
+ };
+
+ std::vector<const char*> externalSemaphoreInstanceExtNames = {
+ VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME,
+ };
+
+ std::vector<const char*> surfaceInstanceExtNames = {
+ VK_KHR_SURFACE_EXTENSION_NAME,
+ };
+
+ uint32_t extCount = 0;
+ gvk->vkEnumerateInstanceExtensionProperties(nullptr, &extCount, nullptr);
+ std::vector<VkExtensionProperties>& exts = sVkEmulation->instanceExtensions;
+ exts.resize(extCount);
+ gvk->vkEnumerateInstanceExtensionProperties(nullptr, &extCount, exts.data());
+
+ bool externalMemoryCapabilitiesSupported =
+ extensionsSupported(exts, externalMemoryInstanceExtNames);
+ bool externalSemaphoreCapabilitiesSupported =
+ extensionsSupported(exts, externalSemaphoreInstanceExtNames);
+ bool surfaceSupported =
+ extensionsSupported(exts, surfaceInstanceExtNames);
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ bool moltenVKSupported =
+ (vk->vkGetMTLTextureMVK != nullptr) && (vk->vkSetMTLTextureMVK != nullptr);
+#endif
+
+ VkInstanceCreateInfo instCi = {
+ VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, 0, 0, nullptr, 0, nullptr, 0, nullptr,
+ };
+
+ std::unordered_set<const char*> enabledExtensions;
+
+ const bool debugUtilsSupported = extensionsSupported(exts, {VK_EXT_DEBUG_UTILS_EXTENSION_NAME});
+ const bool debugUtilsRequested = false; // TODO: enable via a feature or env var?
+ const bool debugUtilsAvailableAndRequested = debugUtilsSupported && debugUtilsRequested;
+ if (debugUtilsAvailableAndRequested) {
+ enabledExtensions.emplace(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
+ }
+
+ if (externalMemoryCapabilitiesSupported) {
+ for (auto extension : externalMemoryInstanceExtNames) {
+ enabledExtensions.emplace(extension);
+ }
+ }
+
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ if (moltenVKSupported) {
+ // We don't need both moltenVK and external memory. Disable
+ // external memory if moltenVK is supported.
+ externalMemoryCapabilitiesSupported = false;
+ enabledExtensions.clear();
+ }
+#endif
+
+ if (useVulkanNativeSwapchain) {
+ for (auto extension : SwapChainStateVk::getRequiredInstanceExtensions()) {
+ enabledExtensions.emplace(extension);
+ }
+ }
+
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ if (moltenVKSupported) {
+ enabledExtensions.emplace(VK_MVK_MOLTENVK_EXTENSION_NAME);
+ }
+#endif
+
+ std::vector<const char*> enabledExtensions_(enabledExtensions.begin(), enabledExtensions.end());
+ instCi.enabledExtensionCount = static_cast<uint32_t>(enabledExtensions_.size());
+ instCi.ppEnabledExtensionNames = enabledExtensions_.data();
+
+ VkApplicationInfo appInfo = {
+ VK_STRUCTURE_TYPE_APPLICATION_INFO, 0, "AEMU", 1, "AEMU", 1, VK_MAKE_VERSION(1, 0, 0),
+ };
+
+ instCi.pApplicationInfo = &appInfo;
+
+ // Can we know instance version early?
+ if (gvk->vkEnumerateInstanceVersion) {
+ // LOG(VERBOSE) << "global loader has vkEnumerateInstanceVersion.";
+ uint32_t instanceVersion;
+ VkResult res = gvk->vkEnumerateInstanceVersion(&instanceVersion);
+ if (VK_SUCCESS == res) {
+ if (instanceVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ // LOG(VERBOSE) << "global loader has vkEnumerateInstanceVersion returning >= 1.1.";
+ appInfo.apiVersion = VK_MAKE_VERSION(1, 1, 0);
+ }
+ }
+ }
+
+ // LOG(VERBOSE) << "Creating instance, asking for version "
+ // << VK_VERSION_MAJOR(appInfo.apiVersion) << "."
+ // << VK_VERSION_MINOR(appInfo.apiVersion) << "."
+ // << VK_VERSION_PATCH(appInfo.apiVersion) << " ...";
+
+ VkResult res = gvk->vkCreateInstance(&instCi, nullptr, &sVkEmulation->instance);
+
+ if (res != VK_SUCCESS) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(res, "Failed to create Vulkan instance. Error %s.",
+ string_VkResult(res));
+ }
+
+ // Create instance level dispatch.
+ sVkEmulation->ivk = new VulkanDispatch;
+ init_vulkan_dispatch_from_instance(vk, sVkEmulation->instance, sVkEmulation->ivk);
+
+ auto ivk = sVkEmulation->ivk;
+
+ if (!vulkan_dispatch_check_instance_VK_VERSION_1_0(ivk)) {
+ fprintf(stderr, "%s: Warning: Vulkan 1.0 APIs missing from instance\n", __func__);
+ }
+
+ if (ivk->vkEnumerateInstanceVersion) {
+ uint32_t instanceVersion;
+ VkResult enumInstanceRes = ivk->vkEnumerateInstanceVersion(&instanceVersion);
+ if ((VK_SUCCESS == enumInstanceRes) && instanceVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ if (!vulkan_dispatch_check_instance_VK_VERSION_1_1(ivk)) {
+ fprintf(stderr, "%s: Warning: Vulkan 1.1 APIs missing from instance (1st try)\n",
+ __func__);
+ }
+ }
+
+ if (appInfo.apiVersion < VK_MAKE_VERSION(1, 1, 0) &&
+ instanceVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ // LOG(VERBOSE) << "Found out that we can create a higher version instance.";
+ appInfo.apiVersion = VK_MAKE_VERSION(1, 1, 0);
+
+ gvk->vkDestroyInstance(sVkEmulation->instance, nullptr);
+
+ VkResult res = gvk->vkCreateInstance(&instCi, nullptr, &sVkEmulation->instance);
+
+ if (res != VK_SUCCESS) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(
+ res, "Failed to create Vulkan 1.1 instance. Error %s.", string_VkResult(res));
+ }
+
+ init_vulkan_dispatch_from_instance(vk, sVkEmulation->instance, sVkEmulation->ivk);
+
+ // LOG(VERBOSE) << "Created Vulkan 1.1 instance on second try.";
+
+ if (!vulkan_dispatch_check_instance_VK_VERSION_1_1(ivk)) {
+ fprintf(stderr, "%s: Warning: Vulkan 1.1 APIs missing from instance (2nd try)\n",
+ __func__);
+ }
+ }
+ }
+
+ sVkEmulation->vulkanInstanceVersion = appInfo.apiVersion;
+
+ sVkEmulation->instanceSupportsExternalMemoryCapabilities = externalMemoryCapabilitiesSupported;
+ sVkEmulation->instanceSupportsExternalSemaphoreCapabilities =
+ externalSemaphoreCapabilitiesSupported;
+ sVkEmulation->instanceSupportsSurface = surfaceSupported;
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ sVkEmulation->instanceSupportsMoltenVK = moltenVKSupported;
+#endif
+
+ if (sVkEmulation->instanceSupportsExternalMemoryCapabilities) {
+ sVkEmulation->getImageFormatProperties2Func = vk_util::getVkInstanceProcAddrWithFallback<
+ vk_util::vk_fn_info::GetPhysicalDeviceImageFormatProperties2>(
+ {ivk->vkGetInstanceProcAddr, vk->vkGetInstanceProcAddr}, sVkEmulation->instance);
+ sVkEmulation->getPhysicalDeviceProperties2Func = vk_util::getVkInstanceProcAddrWithFallback<
+ vk_util::vk_fn_info::GetPhysicalDeviceProperties2>(
+ {ivk->vkGetInstanceProcAddr, vk->vkGetInstanceProcAddr}, sVkEmulation->instance);
+ }
+ sVkEmulation->getPhysicalDeviceFeatures2Func =
+ vk_util::getVkInstanceProcAddrWithFallback<vk_util::vk_fn_info::GetPhysicalDeviceFeatures2>(
+ {ivk->vkGetInstanceProcAddr, vk->vkGetInstanceProcAddr}, sVkEmulation->instance);
+
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ if (sVkEmulation->instanceSupportsMoltenVK) {
+ sVkEmulation->setMTLTextureFunc = reinterpret_cast<PFN_vkSetMTLTextureMVK>(
+ vk->vkGetInstanceProcAddr(sVkEmulation->instance, "vkSetMTLTextureMVK"));
+
+ if (!sVkEmulation->setMTLTextureFunc) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER,
+ "Cannot find vkSetMTLTextureMVK.");
+ }
+ sVkEmulation->getMTLTextureFunc = reinterpret_cast<PFN_vkGetMTLTextureMVK>(
+ vk->vkGetInstanceProcAddr(sVkEmulation->instance, "vkGetMTLTextureMVK"));
+ if (!sVkEmulation->getMTLTextureFunc) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER,
+ "Cannot find vkGetMTLTextureMVK.");
+ }
+ // LOG(VERBOSE) << "Instance supports VK_MVK_moltenvk.";
+ }
+#endif
+
+ uint32_t physdevCount = 0;
+ ivk->vkEnumeratePhysicalDevices(sVkEmulation->instance, &physdevCount, nullptr);
+ std::vector<VkPhysicalDevice> physdevs(physdevCount);
+ ivk->vkEnumeratePhysicalDevices(sVkEmulation->instance, &physdevCount, physdevs.data());
+
+ // LOG(VERBOSE) << "Found " << physdevCount << " Vulkan physical devices.";
+
+ if (physdevCount == 0) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER, "No physical devices available.");
+ }
+
+ std::vector<VkEmulation::DeviceSupportInfo> deviceInfos(physdevCount);
+
+ for (int i = 0; i < physdevCount; ++i) {
+ ivk->vkGetPhysicalDeviceProperties(physdevs[i], &deviceInfos[i].physdevProps);
+
+ // LOG(VERBOSE) << "Considering Vulkan physical device " << i << ": "
+ // << deviceInfos[i].physdevProps.deviceName;
+
+ // It's easier to figure out the staging buffer along with
+ // external memories if we have the memory properties on hand.
+ ivk->vkGetPhysicalDeviceMemoryProperties(physdevs[i], &deviceInfos[i].memProps);
+
+ uint32_t deviceExtensionCount = 0;
+ ivk->vkEnumerateDeviceExtensionProperties(physdevs[i], nullptr, &deviceExtensionCount,
+ nullptr);
+ std::vector<VkExtensionProperties>& deviceExts = deviceInfos[i].extensions;
+ deviceExts.resize(deviceExtensionCount);
+ ivk->vkEnumerateDeviceExtensionProperties(physdevs[i], nullptr, &deviceExtensionCount,
+ deviceExts.data());
+
+ deviceInfos[i].supportsExternalMemoryImport = false;
+ deviceInfos[i].supportsExternalMemoryExport = false;
+ deviceInfos[i].glInteropSupported = 0; // set later
+
+ if (sVkEmulation->instanceSupportsExternalMemoryCapabilities) {
+ deviceInfos[i].supportsExternalMemoryExport =
+ deviceInfos[i].supportsExternalMemoryImport =
+ extensionsSupported(deviceExts, externalMemoryDeviceExtNames);
+#if defined(__QNX__)
+ // External memory export not supported on QNX
+ deviceInfos[i].supportsExternalMemoryExport = false;
+#endif
+ deviceInfos[i].supportsIdProperties =
+ sVkEmulation->getPhysicalDeviceProperties2Func != nullptr;
+ deviceInfos[i].supportsDriverProperties =
+ extensionsSupported(deviceExts, {VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME}) ||
+ (deviceInfos[i].physdevProps.apiVersion >= VK_API_VERSION_1_2);
+
+ if (!sVkEmulation->getPhysicalDeviceProperties2Func) {
+ fprintf(stderr,
+ "%s: warning: device claims to support ID properties "
+ "but vkGetPhysicalDeviceProperties2 could not be found\n",
+ __func__);
+ }
+ }
+
+ if (sVkEmulation->getPhysicalDeviceProperties2Func) {
+ VkPhysicalDeviceProperties2 deviceProps = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR,
+ };
+ VkPhysicalDeviceIDProperties idProps = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR,
+ };
+ VkPhysicalDeviceDriverPropertiesKHR driverProps = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR,
+ };
+
+ auto devicePropsChain = vk_make_chain_iterator(&deviceProps);
+
+ if (deviceInfos[i].supportsIdProperties) {
+ vk_append_struct(&devicePropsChain, &idProps);
+ }
+
+ if (deviceInfos[i].supportsDriverProperties) {
+ vk_append_struct(&devicePropsChain, &driverProps);
+ }
+
+ sVkEmulation->getPhysicalDeviceProperties2Func(physdevs[i], &deviceProps);
+
+ deviceInfos[i].idProps = vk_make_orphan_copy(idProps);
+
+ std::stringstream driverVendorBuilder;
+ driverVendorBuilder << "Vendor " << std::hex << std::setfill('0') << std::showbase
+ << deviceInfos[i].physdevProps.vendorID;
+
+ std::string decodedDriverVersion = decodeDriverVersion(
+ deviceInfos[i].physdevProps.vendorID, deviceInfos[i].physdevProps.driverVersion);
+
+ std::stringstream driverVersionBuilder;
+ driverVersionBuilder << "Driver Version " << std::hex << std::setfill('0')
+ << std::showbase << deviceInfos[i].physdevProps.driverVersion
+ << " Decoded As " << decodedDriverVersion;
+
+ std::string driverVendor = driverVendorBuilder.str();
+ std::string driverVersion = driverVersionBuilder.str();
+ if (deviceInfos[i].supportsDriverProperties && driverProps.driverID) {
+ driverVendor = std::string{driverProps.driverName} + " (" + driverVendor + ")";
+ driverVersion = std::string{driverProps.driverInfo} + " (" +
+ string_VkDriverId(driverProps.driverID) + " " + driverVersion + ")";
+ }
+
+ deviceInfos[i].driverVendor = driverVendor;
+ deviceInfos[i].driverVersion = driverVersion;
+ }
+
+ deviceInfos[i].hasSamplerYcbcrConversionExtension =
+ extensionsSupported(deviceExts, {VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME});
+ if (sVkEmulation->getPhysicalDeviceFeatures2Func) {
+ VkPhysicalDeviceFeatures2 features2 = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
+ };
+ auto features2Chain = vk_make_chain_iterator(&features2);
+ VkPhysicalDeviceSamplerYcbcrConversionFeatures samplerYcbcrConversionFeatures = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
+ };
+ vk_append_struct(&features2Chain, &samplerYcbcrConversionFeatures);
+#if defined(__QNX__)
+ VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX extMemScreenBufferFeatures = {
+ .sType =
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX,
+ };
+ vk_append_struct(&features2Chain, &extMemScreenBufferFeatures);
+#endif
+ sVkEmulation->getPhysicalDeviceFeatures2Func(physdevs[i], &features2);
+
+ deviceInfos[i].supportsSamplerYcbcrConversion =
+ samplerYcbcrConversionFeatures.samplerYcbcrConversion == VK_TRUE;
+#if defined(__QNX__)
+ deviceInfos[i].supportsExternalMemoryImport =
+ extMemScreenBufferFeatures.screenBufferImport == VK_TRUE;
+ } else {
+ deviceInfos[i].supportsExternalMemoryImport = false;
+#endif
+ }
+
+ uint32_t queueFamilyCount = 0;
+ ivk->vkGetPhysicalDeviceQueueFamilyProperties(physdevs[i], &queueFamilyCount, nullptr);
+ std::vector<VkQueueFamilyProperties> queueFamilyProps(queueFamilyCount);
+ ivk->vkGetPhysicalDeviceQueueFamilyProperties(physdevs[i], &queueFamilyCount,
+ queueFamilyProps.data());
+
+ for (uint32_t j = 0; j < queueFamilyCount; ++j) {
+ auto count = queueFamilyProps[j].queueCount;
+ auto flags = queueFamilyProps[j].queueFlags;
+
+ bool hasGraphicsQueueFamily = (count > 0 && (flags & VK_QUEUE_GRAPHICS_BIT));
+ bool hasComputeQueueFamily = (count > 0 && (flags & VK_QUEUE_COMPUTE_BIT));
+
+ deviceInfos[i].hasGraphicsQueueFamily =
+ deviceInfos[i].hasGraphicsQueueFamily || hasGraphicsQueueFamily;
+
+ deviceInfos[i].hasComputeQueueFamily =
+ deviceInfos[i].hasComputeQueueFamily || hasComputeQueueFamily;
+
+ if (hasGraphicsQueueFamily) {
+ deviceInfos[i].graphicsQueueFamilyIndices.push_back(j);
+ // LOG(VERBOSE) << "Graphics queue family index: " << j;
+ }
+
+ if (hasComputeQueueFamily) {
+ deviceInfos[i].computeQueueFamilyIndices.push_back(j);
+ // LOG(VERBOSE) << "Compute queue family index: " << j;
+ }
+ }
+ }
+
+ // Of all the devices enumerated, find the best one. Try to find a device
+ // with graphics queue as the highest priority, then ext memory, then
+ // compute.
+
+ // Graphics queue is highest priority since without that, we really
+ // shouldn't be using the driver. Although, one could make a case for doing
+ // some sorts of things if only a compute queue is available (such as for
+ // AI), that's not really the priority yet.
+
+ // As for external memory, we really should not be running on any driver
+ // without external memory support, but we might be able to pull it off, and
+ // single Vulkan apps might work via CPU transfer of the rendered frames.
+
+ // Compute support is treated as icing on the cake and not relied upon yet
+ // for anything critical to emulation. However, we might potentially use it
+ // to perform image format conversion on GPUs where that's not natively
+ // supported.
+
+ // Another implicit choice is to select only one Vulkan device. This makes
+ // things simple for now, but we could consider utilizing multiple devices
+ // in use cases that make sense, if/when they come up.
+
+ std::vector<uint32_t> deviceScores(physdevCount, 0);
+
+ for (uint32_t i = 0; i < physdevCount; ++i) {
+ uint32_t deviceScore = 0;
+ if (deviceInfos[i].hasGraphicsQueueFamily) deviceScore += 10000;
+ if (deviceInfos[i].supportsExternalMemoryImport ||
+ deviceInfos[i].supportsExternalMemoryExport)
+ deviceScore += 1000;
+ if (deviceInfos[i].physdevProps.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU ||
+ deviceInfos[i].physdevProps.deviceType == VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU) {
+ deviceScore += 100;
+ }
+ if (deviceInfos[i].physdevProps.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) {
+ deviceScore += 50;
+ }
+ deviceScores[i] = deviceScore;
+ }
+
+ uint32_t maxScoringIndex = 0;
+ uint32_t maxScore = 0;
+
+ // If we don't support physical device ID properties,
+ // just pick the first physical device.
+ if (!sVkEmulation->instanceSupportsExternalMemoryCapabilities) {
+ fprintf(stderr,
+ "%s: warning: instance doesn't support "
+ "external memory capabilities, picking first physical device\n",
+ __func__);
+ maxScoringIndex = 0;
+ } else {
+ for (uint32_t i = 0; i < physdevCount; ++i) {
+ if (deviceScores[i] > maxScore) {
+ maxScoringIndex = i;
+ maxScore = deviceScores[i];
+ }
+ }
+ }
+
+ sVkEmulation->physdev = physdevs[maxScoringIndex];
+ sVkEmulation->physicalDeviceIndex = maxScoringIndex;
+ sVkEmulation->deviceInfo = deviceInfos[maxScoringIndex];
+ // Postcondition: sVkEmulation has valid device support info
+
+ // Ask about image format support here.
+ // TODO: May have to first ask when selecting physical devices
+ // (e.g., choose between Intel or NVIDIA GPU for certain image format
+ // support)
+ sVkEmulation->imageSupportInfo = getBasicImageSupportList();
+ for (size_t i = 0; i < sVkEmulation->imageSupportInfo.size(); ++i) {
+ getImageFormatExternalMemorySupportInfo(ivk, sVkEmulation->physdev,
+ &sVkEmulation->imageSupportInfo[i]);
+ }
+
+ if (!sVkEmulation->deviceInfo.hasGraphicsQueueFamily) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER,
+ "No Vulkan devices with graphics queues found.");
+ }
+
+ auto deviceVersion = sVkEmulation->deviceInfo.physdevProps.apiVersion;
+ VK_COMMON_LOG("Selecting Vulkan device: %s", sVkEmulation->deviceInfo.physdevProps.deviceName);
+
+ // LOG(VERBOSE) << "Version: "
+ // << VK_VERSION_MAJOR(deviceVersion) << "." << VK_VERSION_MINOR(deviceVersion) <<
+ // "." << VK_VERSION_PATCH(deviceVersion);
+ // LOG(VERBOSE) << "Has graphics queue? "
+ // << sVkEmulation->deviceInfo.hasGraphicsQueueFamily;
+ // LOG(VERBOSE) << "Has external memory support? "
+ // << sVkEmulation->deviceInfo.supportsExternalMemory;
+ // LOG(VERBOSE) << "Has compute queue? "
+ // << sVkEmulation->deviceInfo.hasComputeQueueFamily;
+
+ float priority = 1.0f;
+ VkDeviceQueueCreateInfo dqCi = {
+ VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
+ 0,
+ 0,
+ sVkEmulation->deviceInfo.graphicsQueueFamilyIndices[0],
+ 1,
+ &priority,
+ };
+
+ std::unordered_set<const char*> selectedDeviceExtensionNames_;
+
+ if (sVkEmulation->deviceInfo.supportsExternalMemoryImport ||
+ sVkEmulation->deviceInfo.supportsExternalMemoryExport) {
+ for (auto extension : externalMemoryDeviceExtNames) {
+ selectedDeviceExtensionNames_.emplace(extension);
+ }
+ }
+ if (useVulkanNativeSwapchain) {
+ for (auto extension : SwapChainStateVk::getRequiredDeviceExtensions()) {
+ selectedDeviceExtensionNames_.emplace(extension);
+ }
+ }
+ if (sVkEmulation->deviceInfo.hasSamplerYcbcrConversionExtension) {
+ selectedDeviceExtensionNames_.emplace(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME);
+ }
+ std::vector<const char*> selectedDeviceExtensionNames(selectedDeviceExtensionNames_.begin(),
+ selectedDeviceExtensionNames_.end());
+
+ VkDeviceCreateInfo dCi = {};
+ dCi.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
+ dCi.queueCreateInfoCount = 1;
+ dCi.pQueueCreateInfos = &dqCi;
+ dCi.enabledExtensionCount = static_cast<uint32_t>(selectedDeviceExtensionNames.size());
+ dCi.ppEnabledExtensionNames = selectedDeviceExtensionNames.data();
+
+ // Setting up VkDeviceCreateInfo::pNext
+ auto deviceCiChain = vk_make_chain_iterator(&dCi);
+
+ VkPhysicalDeviceFeatures2 features = {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2};
+ vk_append_struct(&deviceCiChain, &features);
+
+ std::unique_ptr<VkPhysicalDeviceSamplerYcbcrConversionFeatures> samplerYcbcrConversionFeatures =
+ nullptr;
+ if (sVkEmulation->deviceInfo.supportsSamplerYcbcrConversion) {
+ samplerYcbcrConversionFeatures =
+ std::make_unique<VkPhysicalDeviceSamplerYcbcrConversionFeatures>(
+ VkPhysicalDeviceSamplerYcbcrConversionFeatures{
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
+ .samplerYcbcrConversion = VK_TRUE,
+ });
+ vk_append_struct(&deviceCiChain, samplerYcbcrConversionFeatures.get());
+ }
+#if defined(__QNX__)
+ std::unique_ptr<VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX>
+ extMemScreenBufferFeaturesQNX = nullptr;
+ if (sVkEmulation->deviceInfo.supportsExternalMemoryImport) {
+ extMemScreenBufferFeaturesQNX = std::make_unique<
+ VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX>(
+ VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX{
+ .sType =
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX,
+ .screenBufferImport = VK_TRUE,
+ });
+ vk_append_struct(&deviceCiChain, extMemScreenBufferFeaturesQNX.get());
+ }
+#endif
+
+ ivk->vkCreateDevice(sVkEmulation->physdev, &dCi, nullptr, &sVkEmulation->device);
+
+ if (res != VK_SUCCESS) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(res, "Failed to create Vulkan device. Error %s.",
+ string_VkResult(res));
+ }
+
+ // device created; populate dispatch table
+ sVkEmulation->dvk = new VulkanDispatch;
+ init_vulkan_dispatch_from_device(ivk, sVkEmulation->device, sVkEmulation->dvk);
+
+ auto dvk = sVkEmulation->dvk;
+
+ // Check if the dispatch table has everything 1.1 related
+ if (!vulkan_dispatch_check_device_VK_VERSION_1_0(dvk)) {
+ fprintf(stderr, "%s: Warning: Vulkan 1.0 APIs missing from device.\n", __func__);
+ }
+ if (deviceVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ if (!vulkan_dispatch_check_device_VK_VERSION_1_1(dvk)) {
+ fprintf(stderr, "%s: Warning: Vulkan 1.1 APIs missing from device\n", __func__);
+ }
+ }
+
+ if (sVkEmulation->deviceInfo.supportsExternalMemoryImport) {
+ sVkEmulation->deviceInfo.getImageMemoryRequirements2Func =
+ reinterpret_cast<PFN_vkGetImageMemoryRequirements2KHR>(
+ dvk->vkGetDeviceProcAddr(sVkEmulation->device, "vkGetImageMemoryRequirements2KHR"));
+ if (!sVkEmulation->deviceInfo.getImageMemoryRequirements2Func) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER,
+ "Cannot find vkGetImageMemoryRequirements2KHR.");
+ }
+ sVkEmulation->deviceInfo.getBufferMemoryRequirements2Func =
+ reinterpret_cast<PFN_vkGetBufferMemoryRequirements2KHR>(dvk->vkGetDeviceProcAddr(
+ sVkEmulation->device, "vkGetBufferMemoryRequirements2KHR"));
+ if (!sVkEmulation->deviceInfo.getBufferMemoryRequirements2Func) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER,
+ "Cannot find vkGetBufferMemoryRequirements2KHR");
+ }
+ }
+ if (sVkEmulation->deviceInfo.supportsExternalMemoryExport) {
+#ifdef _WIN32
+ sVkEmulation->deviceInfo.getMemoryHandleFunc =
+ reinterpret_cast<PFN_vkGetMemoryWin32HandleKHR>(
+ dvk->vkGetDeviceProcAddr(sVkEmulation->device, "vkGetMemoryWin32HandleKHR"));
+#else
+ sVkEmulation->deviceInfo.getMemoryHandleFunc = reinterpret_cast<PFN_vkGetMemoryFdKHR>(
+ dvk->vkGetDeviceProcAddr(sVkEmulation->device, "vkGetMemoryFdKHR"));
+#endif
+ if (!sVkEmulation->deviceInfo.getMemoryHandleFunc) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER,
+ "Cannot find vkGetMemory(Fd|Win32Handle)KHR");
+ }
+ }
+
+ // LOG(VERBOSE) << "Vulkan logical device created and extension functions obtained.\n";
+
+ sVkEmulation->queueLock = std::make_shared<android::base::Lock>();
+ {
+ android::base::AutoLock lock(*sVkEmulation->queueLock);
+ dvk->vkGetDeviceQueue(sVkEmulation->device,
+ sVkEmulation->deviceInfo.graphicsQueueFamilyIndices[0], 0,
+ &sVkEmulation->queue);
+ }
+
+ sVkEmulation->queueFamilyIndex = sVkEmulation->deviceInfo.graphicsQueueFamilyIndices[0];
+
+ // LOG(VERBOSE) << "Vulkan device queue obtained.";
+
+ VkCommandPoolCreateInfo poolCi = {
+ VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
+ 0,
+ VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
+ sVkEmulation->queueFamilyIndex,
+ };
+
+ VkResult poolCreateRes = dvk->vkCreateCommandPool(sVkEmulation->device, &poolCi, nullptr,
+ &sVkEmulation->commandPool);
+
+ if (poolCreateRes != VK_SUCCESS) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(poolCreateRes,
+ "Failed to create command pool. Error: %s.",
+ string_VkResult(poolCreateRes));
+ }
+
+ VkCommandBufferAllocateInfo cbAi = {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ 0,
+ sVkEmulation->commandPool,
+ VK_COMMAND_BUFFER_LEVEL_PRIMARY,
+ 1,
+ };
+
+ VkResult cbAllocRes =
+ dvk->vkAllocateCommandBuffers(sVkEmulation->device, &cbAi, &sVkEmulation->commandBuffer);
+
+ if (cbAllocRes != VK_SUCCESS) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(cbAllocRes,
+ "Failed to allocate command buffer. Error: %s.",
+ string_VkResult(cbAllocRes));
+ }
+
+ VkFenceCreateInfo fenceCi = {
+ VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ 0,
+ 0,
+ };
+
+ VkResult fenceCreateRes = dvk->vkCreateFence(sVkEmulation->device, &fenceCi, nullptr,
+ &sVkEmulation->commandBufferFence);
+
+ if (fenceCreateRes != VK_SUCCESS) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(
+ fenceCreateRes, "Failed to create fence for command buffer. Error: %s.",
+ string_VkResult(fenceCreateRes));
+ }
+
+ // At this point, the global emulation state's logical device can alloc
+ // memory and send commands. However, it can't really do much yet to
+ // communicate the results without the staging buffer. Set that up here.
+ // Note that the staging buffer is meant to use external memory, with a
+ // non-external-memory fallback.
+
+ VkBufferCreateInfo bufCi = {
+ VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
+ 0,
+ 0,
+ sVkEmulation->staging.size,
+ VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
+ VK_SHARING_MODE_EXCLUSIVE,
+ 0,
+ nullptr,
+ };
+
+ VkResult bufCreateRes =
+ dvk->vkCreateBuffer(sVkEmulation->device, &bufCi, nullptr, &sVkEmulation->staging.buffer);
+
+ if (bufCreateRes != VK_SUCCESS) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(bufCreateRes,
+ "Failed to create staging buffer index. Error: %s.",
+ string_VkResult(bufCreateRes));
+ }
+
+ VkMemoryRequirements memReqs;
+ dvk->vkGetBufferMemoryRequirements(sVkEmulation->device, sVkEmulation->staging.buffer,
+ &memReqs);
+
+ sVkEmulation->staging.memory.size = memReqs.size;
+
+ bool gotStagingTypeIndex =
+ getStagingMemoryTypeIndex(dvk, sVkEmulation->device, &sVkEmulation->deviceInfo.memProps,
+ &sVkEmulation->staging.memory.typeIndex);
+
+ if (!gotStagingTypeIndex) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER,
+ "Failed to determine staging memory type index.");
+ }
+
+ if (!((1 << sVkEmulation->staging.memory.typeIndex) & memReqs.memoryTypeBits)) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(
+ ABORT_REASON_OTHER,
+ "Failed: Inconsistent determination of memory type index for staging buffer");
+ }
+
+ if (!allocExternalMemory(dvk, &sVkEmulation->staging.memory, false /* not external */,
+ kNullopt /* deviceAlignment */)) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(ABORT_REASON_OTHER,
+ "Failed to allocate memory for staging buffer.");
+ }
+
+ VkResult stagingBufferBindRes = dvk->vkBindBufferMemory(
+ sVkEmulation->device, sVkEmulation->staging.buffer, sVkEmulation->staging.memory.memory, 0);
+
+ if (stagingBufferBindRes != VK_SUCCESS) {
+ VK_EMU_INIT_RETURN_OR_ABORT_ON_ERROR(stagingBufferBindRes,
+ "Failed to bind memory for staging buffer. Error %s.",
+ string_VkResult(stagingBufferBindRes));
+ }
+
+ sVkEmulation->debugUtilsAvailableAndRequested = debugUtilsAvailableAndRequested;
+ if (sVkEmulation->debugUtilsAvailableAndRequested) {
+ sVkEmulation->debugUtilsHelper =
+ DebugUtilsHelper::withUtilsEnabled(sVkEmulation->device, sVkEmulation->ivk);
+ }
+
+ // LOG(VERBOSE) << "Vulkan global emulation state successfully initialized.";
+ sVkEmulation->live = true;
+
+ sVkEmulation->transferQueueCommandBufferPool.resize(0);
+
+ return sVkEmulation;
+}
+
+std::optional<uint32_t> findRepresentativeColorBufferMemoryTypeIndexLocked();
+
+void initVkEmulationFeatures(std::unique_ptr<VkEmulationFeatures> features) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ ERR("VkEmulation is either not initialized or destroyed.");
+ return;
+ }
+
+ AutoLock lock(sVkEmulationLock);
+ INFO("Initializing VkEmulation features:");
+ INFO(" glInteropSupported: %s", features->glInteropSupported ? "true" : "false");
+ INFO(" useDeferredCommands: %s", features->deferredCommands ? "true" : "false");
+ INFO(" createResourceWithRequirements: %s",
+ features->createResourceWithRequirements ? "true" : "false");
+ INFO(" useVulkanComposition: %s", features->useVulkanComposition ? "true" : "false");
+ INFO(" useVulkanNativeSwapchain: %s", features->useVulkanNativeSwapchain ? "true" : "false");
+ INFO(" enable guestRenderDoc: %s", features->guestRenderDoc ? "true" : "false");
+ INFO(" ASTC LDR emulation mode: %d", features->astcLdrEmulationMode);
+ INFO(" enable ETC2 emulation: %s", features->enableEtc2Emulation ? "true" : "false");
+ INFO(" enable Ycbcr emulation: %s", features->enableYcbcrEmulation ? "true" : "false");
+ INFO(" guestUsesAngle: %s", features->guestUsesAngle ? "true" : "false");
+ INFO(" useDedicatedAllocations: %s", features->useDedicatedAllocations ? "true" : "false");
+ sVkEmulation->deviceInfo.glInteropSupported = features->glInteropSupported;
+ sVkEmulation->useDeferredCommands = features->deferredCommands;
+ sVkEmulation->useCreateResourcesWithRequirements = features->createResourceWithRequirements;
+ sVkEmulation->guestRenderDoc = std::move(features->guestRenderDoc);
+ sVkEmulation->astcLdrEmulationMode = features->astcLdrEmulationMode;
+ sVkEmulation->enableEtc2Emulation = features->enableEtc2Emulation;
+ sVkEmulation->enableYcbcrEmulation = features->enableYcbcrEmulation;
+ sVkEmulation->guestUsesAngle = features->guestUsesAngle;
+ sVkEmulation->useDedicatedAllocations = features->useDedicatedAllocations;
+
+ if (features->useVulkanComposition) {
+ if (sVkEmulation->compositorVk) {
+ ERR("Reset VkEmulation::compositorVk.");
+ }
+ sVkEmulation->compositorVk = CompositorVk::create(
+ *sVkEmulation->ivk, sVkEmulation->device, sVkEmulation->physdev, sVkEmulation->queue,
+ sVkEmulation->queueLock, sVkEmulation->queueFamilyIndex, 3);
+ }
+
+ if (features->useVulkanNativeSwapchain) {
+ if (sVkEmulation->displayVk) {
+ ERR("Reset VkEmulation::displayVk.");
+ }
+ sVkEmulation->displayVk = std::make_unique<DisplayVk>(
+ *sVkEmulation->ivk, sVkEmulation->physdev, sVkEmulation->queueFamilyIndex,
+ sVkEmulation->queueFamilyIndex, sVkEmulation->device, sVkEmulation->queue,
+ sVkEmulation->queueLock, sVkEmulation->queue, sVkEmulation->queueLock);
+ }
+
+ sVkEmulation->representativeColorBufferMemoryTypeIndex =
+ findRepresentativeColorBufferMemoryTypeIndexLocked();
+ if (sVkEmulation->representativeColorBufferMemoryTypeIndex) {
+ VK_COMMON_VERBOSE("Emulated ColorBuffer memory type is based on memory type index %d.",
+ *sVkEmulation->representativeColorBufferMemoryTypeIndex);
+ } else {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Failed to find memory type for ColorBuffers.";
+ }
+}
+
+VkEmulation* getGlobalVkEmulation() {
+ if (sVkEmulation && !sVkEmulation->live) return nullptr;
+ return sVkEmulation;
+}
+
+void teardownGlobalVkEmulation() {
+ if (!sVkEmulation) return;
+
+ // Don't try to tear down something that did not set up completely; too risky
+ if (!sVkEmulation->live) return;
+
+ sVkEmulation->compositorVk.reset();
+ sVkEmulation->displayVk.reset();
+
+ freeExternalMemoryLocked(sVkEmulation->dvk, &sVkEmulation->staging.memory);
+
+ sVkEmulation->dvk->vkDestroyBuffer(sVkEmulation->device, sVkEmulation->staging.buffer, nullptr);
+
+ sVkEmulation->dvk->vkDestroyFence(sVkEmulation->device, sVkEmulation->commandBufferFence,
+ nullptr);
+
+ sVkEmulation->dvk->vkFreeCommandBuffers(sVkEmulation->device, sVkEmulation->commandPool, 1,
+ &sVkEmulation->commandBuffer);
+
+ sVkEmulation->dvk->vkDestroyCommandPool(sVkEmulation->device, sVkEmulation->commandPool,
+ nullptr);
+
+ sVkEmulation->ivk->vkDestroyDevice(sVkEmulation->device, nullptr);
+ sVkEmulation->gvk->vkDestroyInstance(sVkEmulation->instance, nullptr);
+
+ VkDecoderGlobalState::reset();
+
+ sVkEmulation->live = false;
+ delete sVkEmulation;
+ sVkEmulation = nullptr;
+}
+
+std::unique_ptr<gfxstream::DisplaySurface> createDisplaySurface(FBNativeWindowType window,
+ uint32_t width, uint32_t height) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ return nullptr;
+ }
+
+ auto surfaceVk = DisplaySurfaceVk::create(*sVkEmulation->ivk, sVkEmulation->instance, window);
+ if (!surfaceVk) {
+ VK_COMMON_ERROR("Failed to create DisplaySurfaceVk.");
+ return nullptr;
+ }
+
+ return std::make_unique<gfxstream::DisplaySurface>(width, height, std::move(surfaceVk));
+}
+
+// Precondition: sVkEmulation has valid device support info
+bool allocExternalMemory(VulkanDispatch* vk, VkEmulation::ExternalMemoryInfo* info,
+ bool actuallyExternal, Optional<uint64_t> deviceAlignment,
+ Optional<VkBuffer> bufferForDedicatedAllocation,
+ Optional<VkImage> imageForDedicatedAllocation) {
+ VkExportMemoryAllocateInfo exportAi = {
+ .sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,
+ .pNext = nullptr,
+ .handleTypes = VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ };
+
+ VkMemoryDedicatedAllocateInfo dedicatedAllocInfo = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
+ .pNext = nullptr,
+ .image = VK_NULL_HANDLE,
+ .buffer = VK_NULL_HANDLE,
+ };
+
+ VkMemoryAllocateInfo allocInfo = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ .pNext = nullptr,
+ .allocationSize = info->size,
+ .memoryTypeIndex = info->typeIndex,
+ };
+
+ auto allocInfoChain = vk_make_chain_iterator(&allocInfo);
+
+ if (sVkEmulation->deviceInfo.supportsExternalMemoryExport && actuallyExternal) {
+ vk_append_struct(&allocInfoChain, &exportAi);
+ }
+
+ if (bufferForDedicatedAllocation.hasValue() || imageForDedicatedAllocation.hasValue()) {
+ info->dedicatedAllocation = true;
+ if (bufferForDedicatedAllocation.hasValue()) {
+ dedicatedAllocInfo.buffer = *bufferForDedicatedAllocation;
+ }
+ if (imageForDedicatedAllocation.hasValue()) {
+ dedicatedAllocInfo.image = *imageForDedicatedAllocation;
+ }
+ vk_append_struct(&allocInfoChain, &dedicatedAllocInfo);
+ }
+
+ bool memoryAllocated = false;
+ std::vector<VkDeviceMemory> allocationAttempts;
+ constexpr size_t kMaxAllocationAttempts = 20u;
+
+ while (!memoryAllocated) {
+ VkResult allocRes =
+ vk->vkAllocateMemory(sVkEmulation->device, &allocInfo, nullptr, &info->memory);
+
+ if (allocRes != VK_SUCCESS) {
+ // LOG(VERBOSE) << "allocExternalMemory: failed in vkAllocateMemory: "
+ // << allocRes;
+ break;
+ }
+
+ if (sVkEmulation->deviceInfo.memProps.memoryTypes[info->typeIndex].propertyFlags &
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
+ VkResult mapRes = vk->vkMapMemory(sVkEmulation->device, info->memory, 0, info->size, 0,
+ &info->mappedPtr);
+ if (mapRes != VK_SUCCESS) {
+ // LOG(VERBOSE) << "allocExternalMemory: failed in vkMapMemory: "
+ // << mapRes;
+ break;
+ }
+ }
+
+ uint64_t mappedPtrPageOffset = reinterpret_cast<uint64_t>(info->mappedPtr) % kPageSize;
+
+ if ( // don't care about alignment (e.g. device-local memory)
+ !deviceAlignment.hasValue() ||
+ // If device has an alignment requirement larger than current
+ // host pointer alignment (i.e. the lowest 1 bit of mappedPtr),
+ // the only possible way to make mappedPtr valid is to ensure
+ // that it is already aligned to page.
+ mappedPtrPageOffset == 0u ||
+ // If device has an alignment requirement smaller or equals to
+ // current host pointer alignment, clients can set a offset
+ // |kPageSize - mappedPtrPageOffset| in vkBindImageMemory to
+ // make it aligned to page and compatible with device
+ // requirements.
+ (kPageSize - mappedPtrPageOffset) % deviceAlignment.value() == 0) {
+ // allocation success.
+ memoryAllocated = true;
+ } else {
+ allocationAttempts.push_back(info->memory);
+
+ // LOG(VERBOSE) << "allocExternalMemory: attempt #"
+ // << allocationAttempts.size()
+ // << " failed; deviceAlignment: "
+ // << deviceAlignment.valueOr(0)
+ // << " mappedPtrPageOffset: " << mappedPtrPageOffset;
+
+ if (allocationAttempts.size() >= kMaxAllocationAttempts) {
+ // LOG(VERBOSE) << "allocExternalMemory: unable to allocate"
+ // << " memory with CPU mapped ptr aligned to page";
+ break;
+ }
+ }
+ }
+
+ // clean up previous failed attempts
+ for (const auto& mem : allocationAttempts) {
+ vk->vkFreeMemory(sVkEmulation->device, mem, nullptr /* allocator */);
+ }
+ if (!memoryAllocated) {
+ return false;
+ }
+
+ if (!sVkEmulation->deviceInfo.supportsExternalMemoryExport || !actuallyExternal) {
+ return true;
+ }
+
+ VkResult exportRes = VK_SUCCESS;
+#ifdef _WIN32
+ VkMemoryGetWin32HandleInfoKHR getWin32HandleInfo = {
+ VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR,
+ 0,
+ info->memory,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ };
+ exportRes = sVkEmulation->deviceInfo.getMemoryHandleFunc(
+ sVkEmulation->device, &getWin32HandleInfo, &info->externalHandle);
+#elif !defined(__QNX__)
+ VkMemoryGetFdInfoKHR getFdInfo = {
+ VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR,
+ 0,
+ info->memory,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ };
+ exportRes = sVkEmulation->deviceInfo.getMemoryHandleFunc(sVkEmulation->device, &getFdInfo,
+ &info->externalHandle);
+#endif
+
+ if (exportRes != VK_SUCCESS || VK_EXT_MEMORY_HANDLE_INVALID == info->externalHandle) {
+ // LOG(VERBOSE) << "allocExternalMemory: Failed to get external memory "
+ // "native handle: "
+ // << exportRes;
+ return false;
+ }
+
+ return true;
+}
+
+void freeExternalMemoryLocked(VulkanDispatch* vk, VkEmulation::ExternalMemoryInfo* info) {
+ if (!info->memory) return;
+
+ if (sVkEmulation->deviceInfo.memProps.memoryTypes[info->typeIndex].propertyFlags &
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
+ if (sVkEmulation->occupiedGpas.find(info->gpa) != sVkEmulation->occupiedGpas.end()) {
+ sVkEmulation->occupiedGpas.erase(info->gpa);
+ get_emugl_vm_operations().unmapUserBackedRam(info->gpa, info->sizeToPage);
+ info->gpa = 0u;
+ }
+
+ vk->vkUnmapMemory(sVkEmulation->device, info->memory);
+ info->mappedPtr = nullptr;
+ info->pageAlignedHva = nullptr;
+ }
+
+ vk->vkFreeMemory(sVkEmulation->device, info->memory, nullptr);
+
+ info->memory = VK_NULL_HANDLE;
+
+ if (info->externalHandle != VK_EXT_MEMORY_HANDLE_INVALID) {
+#ifdef _WIN32
+ CloseHandle(info->externalHandle);
+#elif !defined(__QNX__)
+ close(info->externalHandle);
+#endif
+ info->externalHandle = VK_EXT_MEMORY_HANDLE_INVALID;
+ }
+}
+
+bool importExternalMemory(VulkanDispatch* vk, VkDevice targetDevice,
+ const VkEmulation::ExternalMemoryInfo* info, VkDeviceMemory* out) {
+#ifdef _WIN32
+ VkImportMemoryWin32HandleInfoKHR importInfo = {
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR,
+ 0,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ info->externalHandle,
+ 0,
+ };
+#elif defined(__QNX__)
+ VkImportScreenBufferInfoQNX importInfo = {
+ VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX,
+ info->externalHandle,
+ };
+#else
+ VkImportMemoryFdInfoKHR importInfo = {
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR,
+ 0,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ dupExternalMemory(info->externalHandle),
+ };
+#endif
+ VkMemoryAllocateInfo allocInfo = {
+ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ &importInfo,
+ info->size,
+ info->typeIndex,
+ };
+
+ VkResult res = vk->vkAllocateMemory(targetDevice, &allocInfo, nullptr, out);
+
+ if (res != VK_SUCCESS) {
+ // LOG(ERROR) << "importExternalMemory: Failed with " << res;
+ return false;
+ }
+
+ return true;
+}
+
+bool importExternalMemoryDedicatedImage(VulkanDispatch* vk, VkDevice targetDevice,
+ const VkEmulation::ExternalMemoryInfo* info, VkImage image,
+ VkDeviceMemory* out) {
+ VkMemoryDedicatedAllocateInfo dedicatedInfo = {
+ VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
+ 0,
+ image,
+ VK_NULL_HANDLE,
+ };
+
+#ifdef _WIN32
+ VkImportMemoryWin32HandleInfoKHR importInfo = {
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR,
+ &dedicatedInfo,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ info->externalHandle,
+ 0,
+ };
+#elif defined(__QNX__)
+ VkImportScreenBufferInfoQNX importInfo = {
+ VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX,
+ &dedicatedInfo,
+ info->externalHandle,
+ };
+#else
+ VkImportMemoryFdInfoKHR importInfo = {
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR,
+ &dedicatedInfo,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ info->externalHandle,
+ };
+#endif
+ VkMemoryAllocateInfo allocInfo = {
+ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ &importInfo,
+ info->size,
+ info->typeIndex,
+ };
+
+ VkResult res = vk->vkAllocateMemory(targetDevice, &allocInfo, nullptr, out);
+
+ if (res != VK_SUCCESS) {
+ // LOG(ERROR) << "importExternalMemoryDedicatedImage: Failed with " << res;
+ return false;
+ }
+
+ return true;
+}
+
+// From ANGLE "src/common/angleutils.h"
+#define GL_BGR10_A2_ANGLEX 0x6AF9
+
+static VkFormat glFormat2VkFormat(GLint internalFormat) {
+ switch (internalFormat) {
+ case GL_R8:
+ case GL_LUMINANCE:
+ return VK_FORMAT_R8_UNORM;
+ case GL_RGB:
+ case GL_RGB8:
+ // b/281550953
+ // RGB8 is not supported on many vulkan drivers.
+ // Try RGBA8 instead.
+ // Note: copyImageData() performs channel conversion for this case.
+ return VK_FORMAT_R8G8B8A8_UNORM;
+ case GL_RGB565:
+ return VK_FORMAT_R5G6B5_UNORM_PACK16;
+ case GL_RGB16F:
+ return VK_FORMAT_R16G16B16_SFLOAT;
+ case GL_RGBA:
+ case GL_RGBA8:
+ return VK_FORMAT_R8G8B8A8_UNORM;
+ case GL_RGB5_A1_OES:
+ return VK_FORMAT_A1R5G5B5_UNORM_PACK16;
+ case GL_RGBA4_OES:
+ return VK_FORMAT_R4G4B4A4_UNORM_PACK16;
+ case GL_RGB10_A2:
+ case GL_UNSIGNED_INT_10_10_10_2_OES:
+ return VK_FORMAT_A2R10G10B10_UNORM_PACK32;
+ case GL_BGR10_A2_ANGLEX:
+ return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
+ case GL_RGBA16F:
+ return VK_FORMAT_R16G16B16A16_SFLOAT;
+ case GL_BGRA_EXT:
+ case GL_BGRA8_EXT:
+ return VK_FORMAT_B8G8R8A8_UNORM;
+ case GL_R16_EXT:
+ return VK_FORMAT_R16_UNORM;
+ case GL_RG8_EXT:
+ return VK_FORMAT_R8G8_UNORM;
+ default:
+ VK_COMMON_ERROR("Unhandled format %d, falling back to VK_FORMAT_R8G8B8A8_UNORM",
+ internalFormat);
+ return VK_FORMAT_R8G8B8A8_UNORM;
+ }
+};
+
+static bool isFormatVulkanCompatible(GLenum internalFormat) {
+ VkFormat vkFormat = glFormat2VkFormat(internalFormat);
+
+ for (const auto& supportInfo : sVkEmulation->imageSupportInfo) {
+ if (supportInfo.format == vkFormat && supportInfo.supported) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool isColorBufferExportedToGl(uint32_t colorBufferHandle, bool* exported) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Vulkan emulation not available.";
+ }
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto info = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!info) {
+ return false;
+ }
+
+ *exported = info->glExported;
+ return true;
+}
+
+bool getColorBufferAllocationInfoLocked(uint32_t colorBufferHandle, VkDeviceSize* outSize,
+ uint32_t* outMemoryTypeIndex,
+ bool* outMemoryIsDedicatedAlloc, void** outMappedPtr) {
+ auto info = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!info) {
+ return false;
+ }
+
+ if (outSize) {
+ *outSize = info->memory.size;
+ }
+
+ if (outMemoryTypeIndex) {
+ *outMemoryTypeIndex = info->memory.typeIndex;
+ }
+
+ if (outMemoryIsDedicatedAlloc) {
+ *outMemoryIsDedicatedAlloc = info->memory.dedicatedAllocation;
+ }
+
+ if (outMappedPtr) {
+ *outMappedPtr = info->memory.mappedPtr;
+ }
+
+ return true;
+}
+
+bool getColorBufferAllocationInfo(uint32_t colorBufferHandle, VkDeviceSize* outSize,
+ uint32_t* outMemoryTypeIndex, bool* outMemoryIsDedicatedAlloc,
+ void** outMappedPtr) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Vulkan emulation not available.";
+ }
+
+ AutoLock lock(sVkEmulationLock);
+ return getColorBufferAllocationInfoLocked(colorBufferHandle, outSize, outMemoryTypeIndex,
+ outMemoryIsDedicatedAlloc, outMappedPtr);
+}
+
+static uint32_t lastGoodTypeIndex(uint32_t indices) {
+ for (int32_t i = 31; i >= 0; --i) {
+ if (indices & (1 << i)) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+static uint32_t lastGoodTypeIndexWithMemoryProperties(uint32_t indices,
+ VkMemoryPropertyFlags memoryProperty) {
+ for (int32_t i = 31; i >= 0; --i) {
+ if ((indices & (1u << i)) &&
+ (!memoryProperty ||
+ (sVkEmulation->deviceInfo.memProps.memoryTypes[i].propertyFlags & memoryProperty))) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+// pNext, sharingMode, queueFamilyIndexCount, pQueueFamilyIndices, and initialLayout won't be
+// filled.
+static std::unique_ptr<VkImageCreateInfo> generateColorBufferVkImageCreateInfo_locked(
+ VkFormat format, uint32_t width, uint32_t height, VkImageTiling tiling) {
+ const VkEmulation::ImageSupportInfo* maybeImageSupportInfo = nullptr;
+ for (const auto& supportInfo : sVkEmulation->imageSupportInfo) {
+ if (supportInfo.format == format && supportInfo.supported) {
+ maybeImageSupportInfo = &supportInfo;
+ break;
+ }
+ }
+ if (!maybeImageSupportInfo) {
+ ERR("Format %s is not supported.", string_VkFormat(format));
+ return nullptr;
+ }
+ const VkEmulation::ImageSupportInfo& imageSupportInfo = *maybeImageSupportInfo;
+ const VkFormatProperties& formatProperties = imageSupportInfo.formatProps2.formatProperties;
+
+ constexpr std::pair<VkFormatFeatureFlags, VkImageUsageFlags> formatUsagePairs[] = {
+ {VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT,
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT},
+ {VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, VK_IMAGE_USAGE_SAMPLED_BIT},
+ {VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, VK_IMAGE_USAGE_TRANSFER_SRC_BIT},
+ {VK_FORMAT_FEATURE_TRANSFER_DST_BIT, VK_IMAGE_USAGE_TRANSFER_DST_BIT},
+ {VK_FORMAT_FEATURE_BLIT_SRC_BIT, VK_IMAGE_USAGE_TRANSFER_SRC_BIT},
+ };
+ VkFormatFeatureFlags tilingFeatures = (tiling == VK_IMAGE_TILING_OPTIMAL)
+ ? formatProperties.optimalTilingFeatures
+ : formatProperties.linearTilingFeatures;
+
+ VkImageUsageFlags usage = 0;
+ for (const auto& formatUsage : formatUsagePairs) {
+ usage |= (tilingFeatures & formatUsage.first) ? formatUsage.second : 0u;
+ }
+
+ return std::make_unique<VkImageCreateInfo>(VkImageCreateInfo{
+ .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
+ // The caller is responsible to fill pNext.
+ .pNext = nullptr,
+ .flags = imageSupportInfo.createFlags,
+ .imageType = VK_IMAGE_TYPE_2D,
+ .format = format,
+ .extent =
+ {
+ .width = width,
+ .height = height,
+ .depth = 1,
+ },
+ .mipLevels = 1,
+ .arrayLayers = 1,
+ .samples = VK_SAMPLE_COUNT_1_BIT,
+ .tiling = tiling,
+ .usage = usage,
+ // The caller is responsible to fill sharingMode.
+ .sharingMode = VK_SHARING_MODE_MAX_ENUM,
+ // The caller is responsible to fill queueFamilyIndexCount.
+ .queueFamilyIndexCount = 0,
+ // The caller is responsible to fill pQueueFamilyIndices.
+ .pQueueFamilyIndices = nullptr,
+ // The caller is responsible to fill initialLayout.
+ .initialLayout = VK_IMAGE_LAYOUT_MAX_ENUM,
+ });
+}
+
+std::unique_ptr<VkImageCreateInfo> generateColorBufferVkImageCreateInfo(VkFormat format,
+ uint32_t width,
+ uint32_t height,
+ VkImageTiling tiling) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Host Vulkan device lost";
+ }
+ AutoLock lock(sVkEmulationLock);
+ return generateColorBufferVkImageCreateInfo_locked(format, width, height, tiling);
+}
+
+static bool updateExternalMemoryInfo(VK_EXT_MEMORY_HANDLE extMemHandle,
+ const VkMemoryRequirements* pMemReqs,
+ VkEmulation::ExternalMemoryInfo* pInfo) {
+ // Set externalHandle on the output info
+ pInfo->externalHandle = extMemHandle;
+
+#if defined(__QNX__)
+ VkScreenBufferPropertiesQNX screenBufferProps = {
+ VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX,
+ 0,
+ };
+ auto vk = sVkEmulation->dvk;
+ VkResult queryRes =
+ vk->vkGetScreenBufferPropertiesQNX(sVkEmulation->device, extMemHandle, &screenBufferProps);
+ if (VK_SUCCESS != queryRes) {
+ VK_COMMON_ERROR("Failed to get QNX Screen Buffer properties, VK error: %d", queryRes);
+ return false;
+ }
+ if (!((1 << pInfo->typeIndex) & screenBufferProps.memoryTypeBits)) {
+ VK_COMMON_ERROR("QNX Screen buffer can not be imported to memory (typeIndex=%d): %d",
+ pInfo->typeIndex);
+ return false;
+ }
+ if (screenBufferProps.allocationSize < pMemReqs->size) {
+ VK_COMMON_ERROR(
+ "QNX Screen buffer allocationSize (0x%lx) is not large enough for ColorBuffer image "
+ "size requirements (0x%lx)",
+ screenBufferProps.allocationSize, pMemReqs->size);
+ return false;
+ }
+ // Use the actual allocationSize for VkDeviceMemory object creation
+ pInfo->size = screenBufferProps.allocationSize;
+#endif
+
+ return true;
+}
+
+// TODO(liyl): Currently we can only specify required memoryProperty
+// for a color buffer.
+//
+// Ideally we would like to specify a memory type index directly from
+// localAllocInfo.memoryTypeIndex when allocating color buffers in
+// vkAllocateMemory(). But this type index mechanism breaks "Modify the
+// allocation size and type index to suit the resulting image memory
+// size." which seems to be needed to keep the Android/Fuchsia guest
+// memory type index consistent across guest allocations, and without
+// which those guests might end up import allocating from a color buffer
+// with mismatched type indices.
+//
+// We should make it so the guest can only allocate external images/
+// buffers of one type index for image and one type index for buffer
+// to begin with, via filtering from the host.
+
+bool initializeVkColorBufferLocked(
+ uint32_t colorBufferHandle, VK_EXT_MEMORY_HANDLE extMemHandle = VK_EXT_MEMORY_HANDLE_INVALID) {
+ auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ // Not initialized
+ if (!infoPtr) {
+ return false;
+ }
+ // Already initialized Vulkan memory and other related Vulkan objects
+ if (infoPtr->initialized) {
+ return true;
+ }
+
+ if (!isFormatVulkanCompatible(infoPtr->internalFormat)) {
+ VK_COMMON_VERBOSE("Failed to create Vk ColorBuffer: format:%d not compatible.",
+ infoPtr->internalFormat);
+ return false;
+ }
+
+ if ((VK_EXT_MEMORY_HANDLE_INVALID != extMemHandle) &&
+ (!sVkEmulation->deviceInfo.supportsExternalMemoryImport)) {
+ VK_COMMON_ERROR(
+ "Failed to initialize Vk ColorBuffer -- extMemHandle provided, but device does "
+ "not support externalMemoryImport");
+ return false;
+ }
+
+ VkFormat vkFormat;
+ bool glCompatible = (infoPtr->frameworkFormat == FRAMEWORK_FORMAT_GL_COMPATIBLE);
+ switch (infoPtr->frameworkFormat) {
+ case FrameworkFormat::FRAMEWORK_FORMAT_GL_COMPATIBLE:
+ vkFormat = glFormat2VkFormat(infoPtr->internalFormat);
+ break;
+ case FrameworkFormat::FRAMEWORK_FORMAT_NV12:
+ vkFormat = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
+ break;
+ case FrameworkFormat::FRAMEWORK_FORMAT_P010:
+ vkFormat = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
+ break;
+ case FrameworkFormat::FRAMEWORK_FORMAT_YV12:
+ case FrameworkFormat::FRAMEWORK_FORMAT_YUV_420_888:
+ vkFormat = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM;
+ break;
+ default:
+ VK_COMMON_ERROR("WARNING: unhandled framework format %d\n", infoPtr->frameworkFormat);
+ vkFormat = glFormat2VkFormat(infoPtr->internalFormat);
+ break;
+ }
+
+ VkImageTiling tiling = (infoPtr->memoryProperty & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
+ ? VK_IMAGE_TILING_LINEAR
+ : VK_IMAGE_TILING_OPTIMAL;
+ std::unique_ptr<VkImageCreateInfo> imageCi = generateColorBufferVkImageCreateInfo_locked(
+ vkFormat, infoPtr->width, infoPtr->height, tiling);
+ // pNext will be filled later.
+ if (imageCi == nullptr) {
+ // it can happen if the format is not supported
+ return false;
+ }
+ imageCi->sharingMode = VK_SHARING_MODE_EXCLUSIVE;
+ imageCi->queueFamilyIndexCount = 0;
+ imageCi->pQueueFamilyIndices = nullptr;
+ imageCi->initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+
+ auto imageCiChain = vk_make_chain_iterator(imageCi.get());
+
+ // Create the image. If external memory is supported, make it external.
+ VkExternalMemoryImageCreateInfo extImageCi = {
+ VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO,
+ 0,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ };
+
+ if (sVkEmulation->deviceInfo.supportsExternalMemoryImport ||
+ sVkEmulation->deviceInfo.supportsExternalMemoryExport) {
+ vk_append_struct(&imageCiChain, &extImageCi);
+ }
+
+#if defined(__QNX__)
+ VkExternalFormatQNX externalFormatQnx = {
+ .sType = VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX,
+ .pNext = NULL,
+ .externalFormat = 0, /* Do not override screen format */
+ };
+ if (VK_EXT_MEMORY_HANDLE_INVALID != extMemHandle) {
+ vk_append_struct(&imageCiChain, &externalFormatQnx);
+ /* Maintain linear tiling on QNX for downstream display controller interaction */
+ imageCi->tiling = VK_IMAGE_TILING_LINEAR;
+ }
+#endif
+
+ auto vk = sVkEmulation->dvk;
+
+ VkResult createRes =
+ vk->vkCreateImage(sVkEmulation->device, imageCi.get(), nullptr, &infoPtr->image);
+ if (createRes != VK_SUCCESS) {
+ // LOG(VERBOSE) << "Failed to create Vulkan image for ColorBuffer "
+ // << colorBufferHandle;
+ return false;
+ }
+
+ bool useDedicated =
+ sVkEmulation->useDedicatedAllocations || (VK_EXT_MEMORY_HANDLE_INVALID != extMemHandle);
+
+ infoPtr->imageCreateInfoShallow = vk_make_orphan_copy(*imageCi);
+ infoPtr->currentLayout = infoPtr->imageCreateInfoShallow.initialLayout;
+ infoPtr->currentQueueFamilyIndex = sVkEmulation->queueFamilyIndex;
+
+ if (!useDedicated && vk->vkGetImageMemoryRequirements2KHR) {
+ VkMemoryDedicatedRequirements dedicated_reqs{
+ VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS, nullptr};
+ VkMemoryRequirements2 reqs{VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, &dedicated_reqs};
+
+ VkImageMemoryRequirementsInfo2 info{VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2,
+ nullptr, infoPtr->image};
+ vk->vkGetImageMemoryRequirements2KHR(sVkEmulation->device, &info, &reqs);
+ useDedicated = dedicated_reqs.requiresDedicatedAllocation;
+ infoPtr->memReqs = reqs.memoryRequirements;
+ } else {
+ vk->vkGetImageMemoryRequirements(sVkEmulation->device, infoPtr->image, &infoPtr->memReqs);
+ }
+
+ // Currently we only care about two memory properties: DEVICE_LOCAL
+ // and HOST_VISIBLE; other memory properties specified in
+ // rcSetColorBufferVulkanMode2() call will be ignored for now.
+ infoPtr->memoryProperty = infoPtr->memoryProperty & (VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
+
+ infoPtr->memory.size = infoPtr->memReqs.size;
+
+ // Determine memory type.
+ if (infoPtr->memoryProperty) {
+ infoPtr->memory.typeIndex = lastGoodTypeIndexWithMemoryProperties(
+ infoPtr->memReqs.memoryTypeBits, infoPtr->memoryProperty);
+ } else {
+ infoPtr->memory.typeIndex = lastGoodTypeIndex(infoPtr->memReqs.memoryTypeBits);
+ }
+
+ // LOG(VERBOSE) << "ColorBuffer " << colorBufferHandle
+ // << ", allocation size and type index: " << res.memory.size
+ // << ", " << res.memory.typeIndex
+ // << ", allocated memory property: "
+ // << sVkEmulation->deviceInfo.memProps
+ // .memoryTypes[res.memory.typeIndex]
+ // .propertyFlags
+ // << ", requested memory property: " << memoryProperty;
+
+ Optional<VkImage> dedicatedImage = useDedicated ? Optional<VkImage>(infoPtr->image) : kNullopt;
+ if (VK_EXT_MEMORY_HANDLE_INVALID != extMemHandle) {
+ if (!updateExternalMemoryInfo(extMemHandle, &infoPtr->memReqs, &infoPtr->memory)) {
+ VK_COMMON_ERROR(
+ "Failed to update external memory info for ColorBuffer: %d\n",
+ colorBufferHandle);
+ return false;
+ }
+ if (!importExternalMemoryDedicatedImage(vk, sVkEmulation->device, &infoPtr->memory,
+ *dedicatedImage, &infoPtr->memory.memory)) {
+ VK_COMMON_ERROR(
+ "Failed to import external memory with dedicated Image for colorBuffer: %d\n",
+ colorBufferHandle);
+ return false;
+ }
+ } else {
+ bool isHostVisible = infoPtr->memoryProperty & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+ Optional<uint64_t> deviceAlignment =
+ isHostVisible ? Optional<uint64_t>(infoPtr->memReqs.alignment) : kNullopt;
+ bool allocRes = allocExternalMemory(vk, &infoPtr->memory, true /*actuallyExternal*/,
+ deviceAlignment, kNullopt, dedicatedImage);
+ if (!allocRes) {
+ // LOG(VERBOSE) << "Failed to allocate ColorBuffer with Vulkan backing.";
+ return false;
+ }
+ }
+
+ infoPtr->memory.pageOffset = reinterpret_cast<uint64_t>(infoPtr->memory.mappedPtr) % kPageSize;
+ infoPtr->memory.bindOffset =
+ infoPtr->memory.pageOffset ? kPageSize - infoPtr->memory.pageOffset : 0u;
+
+ VkResult bindImageMemoryRes = vk->vkBindImageMemory(
+ sVkEmulation->device, infoPtr->image, infoPtr->memory.memory, infoPtr->memory.bindOffset);
+
+ if (bindImageMemoryRes != VK_SUCCESS) {
+ fprintf(stderr, "%s: Failed to bind image memory. %d\n", __func__, bindImageMemoryRes);
+ return false;
+ }
+
+ const VkImageViewCreateInfo imageViewCi = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
+ .pNext = nullptr,
+ .flags = 0,
+ .image = infoPtr->image,
+ .viewType = VK_IMAGE_VIEW_TYPE_2D,
+ .format = infoPtr->imageCreateInfoShallow.format,
+ .components =
+ {
+ .r = VK_COMPONENT_SWIZZLE_IDENTITY,
+ .g = VK_COMPONENT_SWIZZLE_IDENTITY,
+ .b = VK_COMPONENT_SWIZZLE_IDENTITY,
+ .a = VK_COMPONENT_SWIZZLE_IDENTITY,
+ },
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ createRes =
+ vk->vkCreateImageView(sVkEmulation->device, &imageViewCi, nullptr, &infoPtr->imageView);
+ if (createRes != VK_SUCCESS) {
+ // LOG(VERBOSE) << "Failed to create Vulkan image for ColorBuffer "
+ // << colorBufferHandle;
+ return false;
+ }
+
+#if defined(VK_MVK_moltenvk) && defined(__APPLE__)
+ if (sVkEmulation->instanceSupportsMoltenVK) {
+ sVkEmulation->getMTLTextureFunc(infoPtr->image, &infoPtr->mtlTexture);
+ if (!infoPtr->mtlTexture) {
+ fprintf(stderr, "%s: Failed to get MTLTexture.\n", __func__);
+ }
+
+ CFRetain(infoPtr->mtlTexture);
+ }
+#endif
+
+ infoPtr->initialized = true;
+
+ return true;
+}
+
+static bool createVkColorBufferLocked(uint32_t width, uint32_t height, GLenum internalFormat,
+ FrameworkFormat frameworkFormat, uint32_t colorBufferHandle,
+ bool vulkanOnly, uint32_t memoryProperty) {
+ auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ // Already initialized
+ if (infoPtr) {
+ return true;
+ }
+
+ VkEmulation::ColorBufferInfo res;
+
+ res.handle = colorBufferHandle;
+ res.width = width;
+ res.height = height;
+ res.memoryProperty = memoryProperty;
+ res.internalFormat = internalFormat;
+ res.frameworkFormat = frameworkFormat;
+ res.frameworkStride = 0;
+
+ if (vulkanOnly) {
+ res.vulkanMode = VkEmulation::VulkanMode::VulkanOnly;
+ }
+
+ sVkEmulation->colorBuffers[colorBufferHandle] = res;
+ return true;
+}
+
+bool createVkColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat,
+ FrameworkFormat frameworkFormat, uint32_t colorBufferHandle,
+ bool vulkanOnly, uint32_t memoryProperty) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "VkEmulation not available.";
+ }
+
+ AutoLock lock(sVkEmulationLock);
+ if (!createVkColorBufferLocked(width, height, internalFormat, frameworkFormat,
+ colorBufferHandle, vulkanOnly, memoryProperty)) {
+ return false;
+ }
+
+ const auto& deviceInfo = sVkEmulation->deviceInfo;
+ if (!deviceInfo.supportsExternalMemoryExport && deviceInfo.supportsExternalMemoryImport) {
+ /* Returns, deferring initialization of the Vulkan components themselves.
+ * Platforms that support import but not export of external memory must
+ * use importExtMemoryHandleToVkColorBuffer(). Otherwise, the colorBuffer
+ * memory can not be externalized.
+ */
+ return true;
+ }
+
+ return initializeVkColorBufferLocked(colorBufferHandle);
+}
+
+std::optional<VkColorBufferMemoryExport> exportColorBufferMemory(uint32_t colorBufferHandle) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ return std::nullopt;
+ }
+
+ AutoLock lock(sVkEmulationLock);
+
+ const auto& deviceInfo = sVkEmulation->deviceInfo;
+ if ((!(deviceInfo.supportsExternalMemoryExport || !deviceInfo.supportsExternalMemoryImport)) ||
+ (!deviceInfo.glInteropSupported)) {
+ return std::nullopt;
+ }
+
+ auto info = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!info) {
+ return std::nullopt;
+ }
+
+ if (info->frameworkFormat != FRAMEWORK_FORMAT_GL_COMPATIBLE) {
+ return std::nullopt;
+ }
+
+#if !defined(__QNX__)
+ ManagedDescriptor descriptor(dupExternalMemory(info->memory.externalHandle));
+
+ info->glExported = true;
+
+ return VkColorBufferMemoryExport{
+ .descriptor = std::move(descriptor),
+ .size = info->memory.size,
+ .linearTiling = info->imageCreateInfoShallow.tiling == VK_IMAGE_TILING_LINEAR,
+ .dedicatedAllocation = info->memory.dedicatedAllocation,
+ };
+#else
+ return std::nullopt;
+#endif
+}
+
+bool teardownVkColorBufferLocked(uint32_t colorBufferHandle) {
+ if (!sVkEmulation || !sVkEmulation->live) return false;
+
+ auto vk = sVkEmulation->dvk;
+
+ auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+
+ if (!infoPtr) return false;
+
+ if (infoPtr->initialized) {
+ auto& info = *infoPtr;
+ {
+ android::base::AutoLock lock(*sVkEmulation->queueLock);
+ VK_CHECK(vk->vkQueueWaitIdle(sVkEmulation->queue));
+ }
+ vk->vkDestroyImageView(sVkEmulation->device, info.imageView, nullptr);
+ vk->vkDestroyImage(sVkEmulation->device, info.image, nullptr);
+ freeExternalMemoryLocked(vk, &info.memory);
+
+#ifdef __APPLE__
+ if (info.mtlTexture) {
+ CFRelease(info.mtlTexture);
+ }
+#endif
+ }
+
+ sVkEmulation->colorBuffers.erase(colorBufferHandle);
+
+ return true;
+}
+
+bool teardownVkColorBuffer(uint32_t colorBufferHandle) {
+ if (!sVkEmulation || !sVkEmulation->live) return false;
+
+ AutoLock lock(sVkEmulationLock);
+ return teardownVkColorBufferLocked(colorBufferHandle);
+}
+
+bool importExtMemoryHandleToVkColorBuffer(uint32_t colorBufferHandle, uint32_t type,
+ VK_EXT_MEMORY_HANDLE extMemHandle) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "VkEmulation not available.";
+ }
+ if (VK_EXT_MEMORY_HANDLE_INVALID == extMemHandle) {
+ return false;
+ }
+
+ AutoLock lock(sVkEmulationLock);
+ // Initialize the colorBuffer with the external memory handle
+ // Note that this will fail if the colorBuffer memory was previously initialized.
+ return initializeVkColorBufferLocked(colorBufferHandle, extMemHandle);
+}
+
+VkEmulation::ColorBufferInfo getColorBufferInfo(uint32_t colorBufferHandle) {
+ VkEmulation::ColorBufferInfo res;
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+
+ if (!infoPtr) return res;
+
+ res = *infoPtr;
+ return res;
+}
+
+bool colorBufferNeedsUpdateBetweenGlAndVk(const VkEmulation::ColorBufferInfo& colorBufferInfo) {
+ // GL is not used.
+ if (colorBufferInfo.vulkanMode == VkEmulation::VulkanMode::VulkanOnly) {
+ return false;
+ }
+
+ // YUV formats require extra conversions.
+ if (colorBufferInfo.frameworkFormat != FrameworkFormat::FRAMEWORK_FORMAT_GL_COMPATIBLE) {
+ return true;
+ }
+
+ // GL and VK are sharing the same underlying memory.
+ if (colorBufferInfo.glExported) {
+ return false;
+ }
+
+ return true;
+}
+
+bool colorBufferNeedsUpdateBetweenGlAndVk(uint32_t colorBufferHandle) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ return false;
+ }
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto colorBufferInfo = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!colorBufferInfo) {
+ return false;
+ }
+
+ return colorBufferNeedsUpdateBetweenGlAndVk(*colorBufferInfo);
+}
+
+bool readColorBufferToBytes(uint32_t colorBufferHandle, std::vector<uint8_t>* bytes) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ VK_COMMON_VERBOSE("VkEmulation not available.");
+ return false;
+ }
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto colorBufferInfo = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!colorBufferInfo) {
+ VK_COMMON_VERBOSE("Failed to read from ColorBuffer:%d, not found.", colorBufferHandle);
+ bytes->clear();
+ return false;
+ }
+
+ VkDeviceSize bytesNeeded = 0;
+ bool result = getFormatTransferInfo(colorBufferInfo->imageCreateInfoShallow.format,
+ colorBufferInfo->imageCreateInfoShallow.extent.width,
+ colorBufferInfo->imageCreateInfoShallow.extent.height,
+ &bytesNeeded, nullptr);
+ if (!result) {
+ VK_COMMON_ERROR("Failed to read from ColorBuffer:%d, failed to get read size.",
+ colorBufferHandle);
+ return false;
+ }
+
+ bytes->resize(bytesNeeded);
+
+ result = readColorBufferToBytesLocked(
+ colorBufferHandle, 0, 0, colorBufferInfo->imageCreateInfoShallow.extent.width,
+ colorBufferInfo->imageCreateInfoShallow.extent.height, bytes->data());
+ if (!result) {
+ VK_COMMON_ERROR("Failed to read from ColorBuffer:%d, failed to get read size.",
+ colorBufferHandle);
+ return false;
+ }
+
+ return true;
+}
+
+bool readColorBufferToBytes(uint32_t colorBufferHandle, uint32_t x, uint32_t y, uint32_t w,
+ uint32_t h, void* outPixels) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ VK_COMMON_ERROR("VkEmulation not available.");
+ return false;
+ }
+
+ AutoLock lock(sVkEmulationLock);
+ return readColorBufferToBytesLocked(colorBufferHandle, x, y, w, h, outPixels);
+}
+
+bool readColorBufferToBytesLocked(uint32_t colorBufferHandle, uint32_t x, uint32_t y, uint32_t w,
+ uint32_t h, void* outPixels) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ VK_COMMON_ERROR("VkEmulation not available.");
+ return false;
+ }
+
+ auto vk = sVkEmulation->dvk;
+
+ auto colorBufferInfo = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!colorBufferInfo) {
+ VK_COMMON_ERROR("Failed to read from ColorBuffer:%d, not found.", colorBufferHandle);
+ return false;
+ }
+
+ if (!colorBufferInfo->image) {
+ VK_COMMON_ERROR("Failed to read from ColorBuffer:%d, no VkImage.", colorBufferHandle);
+ return false;
+ }
+
+ if (x != 0 || y != 0 || w != colorBufferInfo->imageCreateInfoShallow.extent.width ||
+ h != colorBufferInfo->imageCreateInfoShallow.extent.height) {
+ VK_COMMON_ERROR("Failed to read from ColorBuffer:%d, unhandled subrect.",
+ colorBufferHandle);
+ return false;
+ }
+
+ VkDeviceSize bufferCopySize = 0;
+ std::vector<VkBufferImageCopy> bufferImageCopies;
+ if (!getFormatTransferInfo(colorBufferInfo->imageCreateInfoShallow.format,
+ colorBufferInfo->imageCreateInfoShallow.extent.width,
+ colorBufferInfo->imageCreateInfoShallow.extent.height,
+ &bufferCopySize, &bufferImageCopies)) {
+ VK_COMMON_ERROR("Failed to read ColorBuffer:%d, unable to get transfer info.",
+ colorBufferHandle);
+ return false;
+ }
+
+ // Avoid transitioning from VK_IMAGE_LAYOUT_UNDEFINED. Unfortunetly, Android does not
+ // yet have a mechanism for sharing the expected VkImageLayout. 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
+ // ColorBuffer-s being unintentionally cleared. See go/ahb-vkimagelayout for a more
+ // thorough write up.
+ if (colorBufferInfo->currentLayout == VK_IMAGE_LAYOUT_UNDEFINED) {
+ colorBufferInfo->currentLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
+ }
+
+ // Record our synchronization commands.
+ const VkCommandBufferBeginInfo beginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .pNext = nullptr,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+
+ VkCommandBuffer commandBuffer = sVkEmulation->commandBuffer;
+
+ VK_CHECK(vk->vkBeginCommandBuffer(commandBuffer, &beginInfo));
+
+ const VkImageMemoryBarrier toTransferSrcImageBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = 0,
+ .dstAccessMask = VK_ACCESS_HOST_READ_BIT,
+ .oldLayout = colorBufferInfo->currentLayout,
+ .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = colorBufferInfo->image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+
+ vk->vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &toTransferSrcImageBarrier);
+
+ colorBufferInfo->currentLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
+
+ vk->vkCmdCopyImageToBuffer(commandBuffer, colorBufferInfo->image,
+ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, sVkEmulation->staging.buffer,
+ bufferImageCopies.size(), bufferImageCopies.data());
+
+ VK_CHECK(vk->vkEndCommandBuffer(commandBuffer));
+
+ const VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .pNext = nullptr,
+ .waitSemaphoreCount = 0,
+ .pWaitSemaphores = nullptr,
+ .pWaitDstStageMask = nullptr,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &commandBuffer,
+ .signalSemaphoreCount = 0,
+ .pSignalSemaphores = nullptr,
+ };
+
+ {
+ android::base::AutoLock lock(*sVkEmulation->queueLock);
+ VK_CHECK(vk->vkQueueSubmit(sVkEmulation->queue, 1, &submitInfo,
+ sVkEmulation->commandBufferFence));
+ }
+
+ static constexpr uint64_t ANB_MAX_WAIT_NS = 5ULL * 1000ULL * 1000ULL * 1000ULL;
+
+ VK_CHECK(vk->vkWaitForFences(sVkEmulation->device, 1, &sVkEmulation->commandBufferFence,
+ VK_TRUE, ANB_MAX_WAIT_NS));
+
+ VK_CHECK(vk->vkResetFences(sVkEmulation->device, 1, &sVkEmulation->commandBufferFence));
+
+ const VkMappedMemoryRange toInvalidate = {
+ .sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
+ .pNext = nullptr,
+ .memory = sVkEmulation->staging.memory.memory,
+ .offset = 0,
+ .size = VK_WHOLE_SIZE,
+ };
+
+ VK_CHECK(vk->vkInvalidateMappedMemoryRanges(sVkEmulation->device, 1, &toInvalidate));
+
+ const auto* stagingBufferPtr = sVkEmulation->staging.memory.mappedPtr;
+ std::memcpy(outPixels, stagingBufferPtr, bufferCopySize);
+
+ return true;
+}
+
+bool updateColorBufferFromBytes(uint32_t colorBufferHandle, const std::vector<uint8_t>& bytes) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ VK_COMMON_VERBOSE("VkEmulation not available.");
+ return false;
+ }
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto colorBufferInfo = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!colorBufferInfo) {
+ VK_COMMON_VERBOSE("Failed to update ColorBuffer:%d, not found.", colorBufferHandle);
+ return false;
+ }
+
+ return updateColorBufferFromBytesLocked(
+ colorBufferHandle, 0, 0, colorBufferInfo->imageCreateInfoShallow.extent.width,
+ colorBufferInfo->imageCreateInfoShallow.extent.height, bytes.data(), bytes.size());
+}
+
+bool updateColorBufferFromBytes(uint32_t colorBufferHandle, uint32_t x, uint32_t y, uint32_t w,
+ uint32_t h, const void* pixels) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ VK_COMMON_ERROR("VkEmulation not available.");
+ return false;
+ }
+
+ AutoLock lock(sVkEmulationLock);
+ return updateColorBufferFromBytesLocked(colorBufferHandle, x, y, w, h, pixels, 0);
+}
+
+static void convertRgbToRgbaPixels(void* dst, const void* src, uint32_t w, uint32_t h) {
+ const size_t pixelCount = w * h;
+ const uint8_t* srcBytes = reinterpret_cast<const uint8_t*>(src);
+ uint32_t* dstPixels = reinterpret_cast<uint32_t*>(dst);
+ for (size_t i = 0; i < pixelCount; ++i) {
+ const uint8_t r = *(srcBytes++);
+ const uint8_t g = *(srcBytes++);
+ const uint8_t b = *(srcBytes++);
+ *(dstPixels++) = 0xff000000 | (b << 16) | (g << 8) | r;
+ }
+}
+
+static bool updateColorBufferFromBytesLocked(uint32_t colorBufferHandle, uint32_t x, uint32_t y,
+ uint32_t w, uint32_t h, const void* pixels,
+ size_t inputPixelsSize) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ VK_COMMON_ERROR("VkEmulation not available.");
+ return false;
+ }
+
+ auto vk = sVkEmulation->dvk;
+
+ auto colorBufferInfo = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!colorBufferInfo) {
+ VK_COMMON_ERROR("Failed to update ColorBuffer:%d, not found.", colorBufferHandle);
+ return false;
+ }
+
+ if (!colorBufferInfo->image) {
+ VK_COMMON_ERROR("Failed to update ColorBuffer:%d, no VkImage.", colorBufferHandle);
+ return false;
+ }
+
+ if (x != 0 || y != 0 || w != colorBufferInfo->imageCreateInfoShallow.extent.width ||
+ h != colorBufferInfo->imageCreateInfoShallow.extent.height) {
+ VK_COMMON_ERROR("Failed to update ColorBuffer:%d, unhandled subrect.", colorBufferHandle);
+ return false;
+ }
+
+ VkDeviceSize dstBufferSize = 0;
+ std::vector<VkBufferImageCopy> bufferImageCopies;
+ if (!getFormatTransferInfo(colorBufferInfo->imageCreateInfoShallow.format,
+ colorBufferInfo->imageCreateInfoShallow.extent.width,
+ colorBufferInfo->imageCreateInfoShallow.extent.height,
+ &dstBufferSize, &bufferImageCopies)) {
+ VK_COMMON_ERROR("Failed to update ColorBuffer:%d, unable to get transfer info.",
+ colorBufferHandle);
+ return false;
+ }
+
+ const VkDeviceSize stagingBufferSize = sVkEmulation->staging.size;
+ if (dstBufferSize > stagingBufferSize) {
+ VK_COMMON_ERROR("Failed to update ColorBuffer:%d, transfer size %" PRIu64
+ " too large for staging buffer size:%" PRIu64 ".",
+ colorBufferHandle, dstBufferSize, stagingBufferSize);
+ return false;
+ }
+
+ bool isThreeByteRgb = (colorBufferInfo->internalFormat == GL_RGB ||
+ colorBufferInfo->internalFormat == GL_RGB8);
+ size_t expectedInputSize = (isThreeByteRgb ? dstBufferSize / 4 * 3 : dstBufferSize);
+
+ if (inputPixelsSize != 0 && inputPixelsSize != expectedInputSize) {
+ VK_COMMON_ERROR(
+ "Unexpected contents size when trying to update ColorBuffer:%d, "
+ "provided:%zu expected:%zu",
+ colorBufferHandle, inputPixelsSize, expectedInputSize);
+ return false;
+ }
+
+ auto* stagingBufferPtr = sVkEmulation->staging.memory.mappedPtr;
+
+ if (isThreeByteRgb) {
+ // Convert RGB to RGBA, since only for these types glFormat2VkFormat() makes
+ // an incompatible choice of 4-byte backing VK_FORMAT_R8G8B8A8_UNORM.
+ // b/281550953
+ convertRgbToRgbaPixels(stagingBufferPtr, pixels, w, h);
+ } else {
+ std::memcpy(stagingBufferPtr, pixels, dstBufferSize);
+ }
+
+ // Avoid transitioning from VK_IMAGE_LAYOUT_UNDEFINED. Unfortunetly, Android does not
+ // yet have a mechanism for sharing the expected VkImageLayout. 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
+ // ColorBuffer-s being unintentionally cleared. See go/ahb-vkimagelayout for a more
+ // thorough write up.
+ if (colorBufferInfo->currentLayout == VK_IMAGE_LAYOUT_UNDEFINED) {
+ colorBufferInfo->currentLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
+ }
+
+ // Record our synchronization commands.
+ const VkCommandBufferBeginInfo beginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .pNext = nullptr,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+
+ VkCommandBuffer commandBuffer = sVkEmulation->commandBuffer;
+
+ VK_CHECK(vk->vkBeginCommandBuffer(commandBuffer, &beginInfo));
+
+ const VkImageMemoryBarrier toTransferDstImageBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = 0,
+ .dstAccessMask = VK_ACCESS_HOST_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .oldLayout = colorBufferInfo->currentLayout,
+ .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = colorBufferInfo->image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+
+ vk->vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &toTransferDstImageBarrier);
+
+ colorBufferInfo->currentLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
+
+ // Copy to staging buffer
+ vk->vkCmdCopyBufferToImage(commandBuffer, sVkEmulation->staging.buffer, colorBufferInfo->image,
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, bufferImageCopies.size(),
+ bufferImageCopies.data());
+
+ VK_CHECK(vk->vkEndCommandBuffer(commandBuffer));
+
+ const VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .pNext = nullptr,
+ .waitSemaphoreCount = 0,
+ .pWaitSemaphores = nullptr,
+ .pWaitDstStageMask = nullptr,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &commandBuffer,
+ .signalSemaphoreCount = 0,
+ .pSignalSemaphores = nullptr,
+ };
+
+ {
+ android::base::AutoLock lock(*sVkEmulation->queueLock);
+ VK_CHECK(vk->vkQueueSubmit(sVkEmulation->queue, 1, &submitInfo,
+ sVkEmulation->commandBufferFence));
+ }
+
+ static constexpr uint64_t ANB_MAX_WAIT_NS = 5ULL * 1000ULL * 1000ULL * 1000ULL;
+
+ VK_CHECK(vk->vkWaitForFences(sVkEmulation->device, 1, &sVkEmulation->commandBufferFence,
+ VK_TRUE, ANB_MAX_WAIT_NS));
+
+ VK_CHECK(vk->vkResetFences(sVkEmulation->device, 1, &sVkEmulation->commandBufferFence));
+
+ const VkMappedMemoryRange toInvalidate = {
+ .sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
+ .pNext = nullptr,
+ .memory = sVkEmulation->staging.memory.memory,
+ .offset = 0,
+ .size = VK_WHOLE_SIZE,
+ };
+ VK_CHECK(vk->vkInvalidateMappedMemoryRanges(sVkEmulation->device, 1, &toInvalidate));
+
+ return true;
+}
+
+VK_EXT_MEMORY_HANDLE getColorBufferExtMemoryHandle(uint32_t colorBuffer) {
+ if (!sVkEmulation || !sVkEmulation->live) return VK_EXT_MEMORY_HANDLE_INVALID;
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBuffer);
+
+ if (!infoPtr) {
+ // Color buffer not found; this is usually OK.
+ return VK_EXT_MEMORY_HANDLE_INVALID;
+ }
+
+ return infoPtr->memory.externalHandle;
+}
+
+bool setColorBufferVulkanMode(uint32_t colorBuffer, uint32_t vulkanMode) {
+ if (!sVkEmulation || !sVkEmulation->live) return VK_EXT_MEMORY_HANDLE_INVALID;
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBuffer);
+
+ if (!infoPtr) {
+ return false;
+ }
+
+ infoPtr->vulkanMode = static_cast<VkEmulation::VulkanMode>(vulkanMode);
+
+ return true;
+}
+
+MTLTextureRef getColorBufferMTLTexture(uint32_t colorBuffer) {
+ if (!sVkEmulation || !sVkEmulation->live) return nullptr;
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBuffer);
+
+ if (!infoPtr) {
+ // Color buffer not found; this is usually OK.
+ return nullptr;
+ }
+
+#ifdef __APPLE__
+ CFRetain(infoPtr->mtlTexture);
+#endif
+ return infoPtr->mtlTexture;
+}
+
+int32_t mapGpaToBufferHandle(uint32_t bufferHandle, uint64_t gpa, uint64_t size) {
+ if (!sVkEmulation || !sVkEmulation->live) return VK_ERROR_DEVICE_LOST;
+
+ AutoLock lock(sVkEmulationLock);
+
+ VkEmulation::ExternalMemoryInfo* memoryInfoPtr = nullptr;
+
+ auto colorBufferInfoPtr = android::base::find(sVkEmulation->colorBuffers, bufferHandle);
+ if (colorBufferInfoPtr) {
+ memoryInfoPtr = &colorBufferInfoPtr->memory;
+ }
+ auto bufferInfoPtr = android::base::find(sVkEmulation->buffers, bufferHandle);
+ if (bufferInfoPtr) {
+ memoryInfoPtr = &bufferInfoPtr->memory;
+ }
+
+ if (!memoryInfoPtr) {
+ return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+ }
+
+ // memory should be already mapped to host.
+ if (!memoryInfoPtr->mappedPtr) {
+ return VK_ERROR_MEMORY_MAP_FAILED;
+ }
+
+ memoryInfoPtr->gpa = gpa;
+ memoryInfoPtr->pageAlignedHva =
+ reinterpret_cast<uint8_t*>(memoryInfoPtr->mappedPtr) + memoryInfoPtr->bindOffset;
+
+ size_t rawSize = memoryInfoPtr->size + memoryInfoPtr->pageOffset;
+ if (size && size < rawSize) {
+ rawSize = size;
+ }
+
+ memoryInfoPtr->sizeToPage = ((rawSize + kPageSize - 1) >> kPageBits) << kPageBits;
+
+ // LOG(VERBOSE) << "mapGpaToColorBuffer: hva = " << memoryInfoPtr->mappedPtr
+ // << ", pageAlignedHva = " << memoryInfoPtr->pageAlignedHva
+ // << " -> [ " << memoryInfoPtr->gpa << ", "
+ // << memoryInfoPtr->gpa + memoryInfoPtr->sizeToPage << " ]";
+
+ if (sVkEmulation->occupiedGpas.find(gpa) != sVkEmulation->occupiedGpas.end()) {
+ // emugl::emugl_crash_reporter("FATAL: already mapped gpa 0x%lx! ", gpa);
+ return VK_ERROR_MEMORY_MAP_FAILED;
+ }
+
+ get_emugl_vm_operations().mapUserBackedRam(gpa, memoryInfoPtr->pageAlignedHva,
+ memoryInfoPtr->sizeToPage);
+
+ sVkEmulation->occupiedGpas.insert(gpa);
+
+ return memoryInfoPtr->pageOffset;
+}
+
+bool getBufferAllocationInfo(uint32_t bufferHandle, VkDeviceSize* outSize,
+ uint32_t* outMemoryTypeIndex, bool* outMemoryIsDedicatedAlloc) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Vulkan emulation not available.";
+ }
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto info = android::base::find(sVkEmulation->buffers, bufferHandle);
+ if (!info) {
+ return false;
+ }
+
+ if (outSize) {
+ *outSize = info->memory.size;
+ }
+
+ if (outMemoryTypeIndex) {
+ *outMemoryTypeIndex = info->memory.typeIndex;
+ }
+
+ if (outMemoryIsDedicatedAlloc) {
+ *outMemoryIsDedicatedAlloc = info->memory.dedicatedAllocation;
+ }
+
+ return true;
+}
+
+bool setupVkBuffer(uint64_t size, uint32_t bufferHandle, bool vulkanOnly, uint32_t memoryProperty) {
+ if (vulkanOnly == false) {
+ VK_COMMON_ERROR("Data buffers should be vulkanOnly. Setup failed.");
+ return false;
+ }
+
+ auto vk = sVkEmulation->dvk;
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto infoPtr = android::base::find(sVkEmulation->buffers, bufferHandle);
+
+ // Already setup
+ if (infoPtr) {
+ return true;
+ }
+
+ VkEmulation::BufferInfo res;
+
+ res.handle = bufferHandle;
+
+ res.size = size;
+ res.usageFlags = VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT |
+ VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT |
+ VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+ res.createFlags = 0;
+
+ res.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
+
+ // Create the image. If external memory is supported, make it external.
+ VkExternalMemoryBufferCreateInfo extBufferCi = {
+ VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO,
+ 0,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ };
+
+ VkExternalMemoryBufferCreateInfo* extBufferCiPtr = nullptr;
+ if (sVkEmulation->deviceInfo.supportsExternalMemoryImport ||
+ sVkEmulation->deviceInfo.supportsExternalMemoryExport) {
+ extBufferCiPtr = &extBufferCi;
+ }
+
+ VkBufferCreateInfo bufferCi = {
+ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
+ extBufferCiPtr,
+ res.createFlags,
+ res.size,
+ res.usageFlags,
+ res.sharingMode,
+ /* queueFamilyIndexCount */ 0,
+ /* pQueueFamilyIndices */ nullptr,
+ };
+
+ VkResult createRes = vk->vkCreateBuffer(sVkEmulation->device, &bufferCi, nullptr, &res.buffer);
+
+ if (createRes != VK_SUCCESS) {
+ // LOG(VERBOSE) << "Failed to create Vulkan Buffer for Buffer "
+ // << bufferHandle;
+ return false;
+ }
+ bool useDedicated = false;
+ if (vk->vkGetBufferMemoryRequirements2KHR) {
+ VkMemoryDedicatedRequirements dedicated_reqs{
+ VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS, nullptr};
+ VkMemoryRequirements2 reqs{VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, &dedicated_reqs};
+
+ VkBufferMemoryRequirementsInfo2 info{VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2,
+ nullptr, res.buffer};
+ vk->vkGetBufferMemoryRequirements2KHR(sVkEmulation->device, &info, &reqs);
+ useDedicated = dedicated_reqs.requiresDedicatedAllocation;
+ res.memReqs = reqs.memoryRequirements;
+ } else {
+ vk->vkGetBufferMemoryRequirements(sVkEmulation->device, res.buffer, &res.memReqs);
+ }
+
+ // Currently we only care about two memory properties: DEVICE_LOCAL
+ // and HOST_VISIBLE; other memory properties specified in
+ // rcSetColorBufferVulkanMode2() call will be ignored for now.
+ memoryProperty = memoryProperty &
+ (VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
+
+ res.memory.size = res.memReqs.size;
+
+ // Determine memory type.
+ if (memoryProperty) {
+ res.memory.typeIndex =
+ lastGoodTypeIndexWithMemoryProperties(res.memReqs.memoryTypeBits, memoryProperty);
+ } else {
+ res.memory.typeIndex = lastGoodTypeIndex(res.memReqs.memoryTypeBits);
+ }
+
+ // LOG(VERBOSE) << "Buffer " << bufferHandle
+ // << "allocation size and type index: " << res.memory.size
+ // << ", " << res.memory.typeIndex
+ // << ", allocated memory property: "
+ // << sVkEmulation->deviceInfo.memProps
+ // .memoryTypes[res.memory.typeIndex]
+ // .propertyFlags
+ // << ", requested memory property: " << memoryProperty;
+
+ bool isHostVisible = memoryProperty & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+ Optional<uint64_t> deviceAlignment =
+ isHostVisible ? Optional<uint64_t>(res.memReqs.alignment) : kNullopt;
+ Optional<VkBuffer> dedicated_buffer = useDedicated ? Optional<VkBuffer>(res.buffer) : kNullopt;
+ bool allocRes = allocExternalMemory(vk, &res.memory, true /* actuallyExternal */,
+ deviceAlignment, dedicated_buffer);
+
+ if (!allocRes) {
+ // LOG(VERBOSE) << "Failed to allocate ColorBuffer with Vulkan backing.";
+ }
+
+ res.memory.pageOffset = reinterpret_cast<uint64_t>(res.memory.mappedPtr) % kPageSize;
+ res.memory.bindOffset = res.memory.pageOffset ? kPageSize - res.memory.pageOffset : 0u;
+
+ VkResult bindBufferMemoryRes =
+ vk->vkBindBufferMemory(sVkEmulation->device, res.buffer, res.memory.memory, 0);
+
+ if (bindBufferMemoryRes != VK_SUCCESS) {
+ fprintf(stderr, "%s: Failed to bind buffer memory. %d\n", __func__, bindBufferMemoryRes);
+ return bindBufferMemoryRes;
+ }
+
+ bool isHostVisibleMemory = memoryProperty & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+
+ if (isHostVisibleMemory) {
+ VkResult mapMemoryRes = vk->vkMapMemory(sVkEmulation->device, res.memory.memory, 0,
+ res.memory.size, {}, &res.memory.mappedPtr);
+
+ if (mapMemoryRes != VK_SUCCESS) {
+ fprintf(stderr, "%s: Failed to map image memory. %d\n", __func__, mapMemoryRes);
+ return false;
+ }
+ }
+
+ res.glExported = false;
+
+ sVkEmulation->buffers[bufferHandle] = res;
+ return allocRes;
+}
+
+bool teardownVkBuffer(uint32_t bufferHandle) {
+ if (!sVkEmulation || !sVkEmulation->live) return false;
+
+ auto vk = sVkEmulation->dvk;
+ AutoLock lock(sVkEmulationLock);
+
+ auto infoPtr = android::base::find(sVkEmulation->buffers, bufferHandle);
+ if (!infoPtr) return false;
+ {
+ android::base::AutoLock lock(*sVkEmulation->queueLock);
+ VK_CHECK(vk->vkQueueWaitIdle(sVkEmulation->queue));
+ }
+ auto& info = *infoPtr;
+
+ vk->vkDestroyBuffer(sVkEmulation->device, info.buffer, nullptr);
+ freeExternalMemoryLocked(vk, &info.memory);
+ sVkEmulation->buffers.erase(bufferHandle);
+
+ return true;
+}
+
+VK_EXT_MEMORY_HANDLE getBufferExtMemoryHandle(uint32_t bufferHandle) {
+ if (!sVkEmulation || !sVkEmulation->live) return VK_EXT_MEMORY_HANDLE_INVALID;
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto infoPtr = android::base::find(sVkEmulation->buffers, bufferHandle);
+ if (!infoPtr) {
+ // Color buffer not found; this is usually OK.
+ return VK_EXT_MEMORY_HANDLE_INVALID;
+ }
+
+ return infoPtr->memory.externalHandle;
+}
+
+bool readBufferToBytes(uint32_t bufferHandle, uint64_t offset, uint64_t size, void* outBytes) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ VK_COMMON_ERROR("VkEmulation not available.");
+ return false;
+ }
+
+ auto vk = sVkEmulation->dvk;
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto bufferInfo = android::base::find(sVkEmulation->buffers, bufferHandle);
+ if (!bufferInfo) {
+ VK_COMMON_ERROR("Failed to read from Buffer:%d, not found.", bufferHandle);
+ return false;
+ }
+
+ const auto& stagingBufferInfo = sVkEmulation->staging;
+ if (size > stagingBufferInfo.size) {
+ VK_COMMON_ERROR("Failed to read from Buffer:%d, staging buffer too small.", bufferHandle);
+ return false;
+ }
+
+ const VkCommandBufferBeginInfo beginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .pNext = nullptr,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+
+ VkCommandBuffer commandBuffer = sVkEmulation->commandBuffer;
+
+ VK_CHECK(vk->vkBeginCommandBuffer(commandBuffer, &beginInfo));
+
+ const VkBufferCopy bufferCopy = {
+ .srcOffset = offset,
+ .dstOffset = 0,
+ .size = size,
+ };
+ vk->vkCmdCopyBuffer(commandBuffer, bufferInfo->buffer, stagingBufferInfo.buffer, 1,
+ &bufferCopy);
+
+ VK_CHECK(vk->vkEndCommandBuffer(commandBuffer));
+
+ const VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .pNext = nullptr,
+ .waitSemaphoreCount = 0,
+ .pWaitSemaphores = nullptr,
+ .pWaitDstStageMask = nullptr,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &commandBuffer,
+ .signalSemaphoreCount = 0,
+ .pSignalSemaphores = nullptr,
+ };
+
+ {
+ android::base::AutoLock lock(*sVkEmulation->queueLock);
+ VK_CHECK(vk->vkQueueSubmit(sVkEmulation->queue, 1, &submitInfo,
+ sVkEmulation->commandBufferFence));
+ }
+
+ static constexpr uint64_t ANB_MAX_WAIT_NS = 5ULL * 1000ULL * 1000ULL * 1000ULL;
+
+ VK_CHECK(vk->vkWaitForFences(sVkEmulation->device, 1, &sVkEmulation->commandBufferFence,
+ VK_TRUE, ANB_MAX_WAIT_NS));
+
+ VK_CHECK(vk->vkResetFences(sVkEmulation->device, 1, &sVkEmulation->commandBufferFence));
+
+ const VkMappedMemoryRange toInvalidate = {
+ .sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
+ .pNext = nullptr,
+ .memory = stagingBufferInfo.memory.memory,
+ .offset = 0,
+ .size = size,
+ };
+
+ VK_CHECK(vk->vkInvalidateMappedMemoryRanges(sVkEmulation->device, 1, &toInvalidate));
+
+ const void* srcPtr = reinterpret_cast<const void*>(
+ reinterpret_cast<const char*>(stagingBufferInfo.memory.mappedPtr));
+ void* dstPtr = outBytes;
+ void* dstPtrOffset = reinterpret_cast<void*>(reinterpret_cast<char*>(dstPtr) + offset);
+ std::memcpy(dstPtrOffset, srcPtr, size);
+
+ return true;
+}
+
+bool updateBufferFromBytes(uint32_t bufferHandle, uint64_t offset, uint64_t size,
+ const void* bytes) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ VK_COMMON_ERROR("VkEmulation not available.");
+ return false;
+ }
+
+ auto vk = sVkEmulation->dvk;
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto bufferInfo = android::base::find(sVkEmulation->buffers, bufferHandle);
+ if (!bufferInfo) {
+ VK_COMMON_ERROR("Failed to update Buffer:%d, not found.", bufferHandle);
+ return false;
+ }
+
+ const auto& stagingBufferInfo = sVkEmulation->staging;
+ if (size > stagingBufferInfo.size) {
+ VK_COMMON_ERROR("Failed to update Buffer:%d, staging buffer too small.", bufferHandle);
+ return false;
+ }
+
+ const void* srcPtr = bytes;
+ const void* srcPtrOffset =
+ reinterpret_cast<const void*>(reinterpret_cast<const char*>(srcPtr) + offset);
+ void* dstPtr = stagingBufferInfo.memory.mappedPtr;
+ std::memcpy(dstPtr, srcPtrOffset, size);
+
+ const VkMappedMemoryRange toFlush = {
+ .sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
+ .pNext = nullptr,
+ .memory = stagingBufferInfo.memory.memory,
+ .offset = 0,
+ .size = size,
+ };
+ VK_CHECK(vk->vkFlushMappedMemoryRanges(sVkEmulation->device, 1, &toFlush));
+
+ const VkCommandBufferBeginInfo beginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .pNext = nullptr,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+
+ VkCommandBuffer commandBuffer = sVkEmulation->commandBuffer;
+
+ VK_CHECK(vk->vkBeginCommandBuffer(commandBuffer, &beginInfo));
+
+ const VkBufferCopy bufferCopy = {
+ .srcOffset = 0,
+ .dstOffset = offset,
+ .size = size,
+ };
+ vk->vkCmdCopyBuffer(commandBuffer, stagingBufferInfo.buffer, bufferInfo->buffer, 1,
+ &bufferCopy);
+
+ VK_CHECK(vk->vkEndCommandBuffer(commandBuffer));
+
+ const VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .pNext = nullptr,
+ .waitSemaphoreCount = 0,
+ .pWaitSemaphores = nullptr,
+ .pWaitDstStageMask = nullptr,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &commandBuffer,
+ .signalSemaphoreCount = 0,
+ .pSignalSemaphores = nullptr,
+ };
+
+ {
+ android::base::AutoLock lock(*sVkEmulation->queueLock);
+ VK_CHECK(vk->vkQueueSubmit(sVkEmulation->queue, 1, &submitInfo,
+ sVkEmulation->commandBufferFence));
+ }
+
+ static constexpr uint64_t ANB_MAX_WAIT_NS = 5ULL * 1000ULL * 1000ULL * 1000ULL;
+
+ VK_CHECK(vk->vkWaitForFences(sVkEmulation->device, 1, &sVkEmulation->commandBufferFence,
+ VK_TRUE, ANB_MAX_WAIT_NS));
+
+ VK_CHECK(vk->vkResetFences(sVkEmulation->device, 1, &sVkEmulation->commandBufferFence));
+
+ return true;
+}
+
+VkExternalMemoryHandleTypeFlags transformExternalMemoryHandleTypeFlags_tohost(
+ VkExternalMemoryHandleTypeFlags bits) {
+ VkExternalMemoryHandleTypeFlags res = bits;
+
+ // Transform Android/Fuchsia/Linux bits to host bits.
+ if (bits & VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) {
+ res &= ~VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
+ }
+
+#ifdef _WIN32
+ res &= ~VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
+ res &= ~VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
+#endif
+
+ if (bits & VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) {
+ res &= ~VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
+ res |= VK_EXT_MEMORY_HANDLE_TYPE_BIT;
+ }
+
+ if (bits & VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA) {
+ res &= ~VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA;
+ res |= VK_EXT_MEMORY_HANDLE_TYPE_BIT;
+ }
+
+ if (bits & VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA) {
+ res &= ~VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA;
+ res |= VK_EXT_MEMORY_HANDLE_TYPE_BIT;
+ }
+
+#if defined(__QNX__)
+ // QNX only: Replace DMA_BUF_BIT_EXT with SCREEN_BUFFER_BIT_QNX for host calls
+ if (bits & VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT) {
+ res &= ~VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
+ res |= VK_EXT_MEMORY_HANDLE_TYPE_BIT;
+ }
+#endif
+
+ return res;
+}
+
+VkExternalMemoryHandleTypeFlags transformExternalMemoryHandleTypeFlags_fromhost(
+ VkExternalMemoryHandleTypeFlags hostBits,
+ VkExternalMemoryHandleTypeFlags wantedGuestHandleType) {
+ VkExternalMemoryHandleTypeFlags res = hostBits;
+
+ if (res & VK_EXT_MEMORY_HANDLE_TYPE_BIT) {
+ res &= ~VK_EXT_MEMORY_HANDLE_TYPE_BIT;
+ res |= wantedGuestHandleType;
+ }
+
+#ifdef _WIN32
+ res &= ~VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
+ res &= ~VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
+#endif
+
+ return res;
+}
+
+VkExternalMemoryProperties transformExternalMemoryProperties_tohost(
+ VkExternalMemoryProperties props) {
+ VkExternalMemoryProperties res = props;
+ res.exportFromImportedHandleTypes =
+ transformExternalMemoryHandleTypeFlags_tohost(props.exportFromImportedHandleTypes);
+ res.compatibleHandleTypes =
+ transformExternalMemoryHandleTypeFlags_tohost(props.compatibleHandleTypes);
+ return res;
+}
+
+VkExternalMemoryProperties transformExternalMemoryProperties_fromhost(
+ VkExternalMemoryProperties props, VkExternalMemoryHandleTypeFlags wantedGuestHandleType) {
+ VkExternalMemoryProperties res = props;
+ res.exportFromImportedHandleTypes = transformExternalMemoryHandleTypeFlags_fromhost(
+ props.exportFromImportedHandleTypes, wantedGuestHandleType);
+ res.compatibleHandleTypes = transformExternalMemoryHandleTypeFlags_fromhost(
+ props.compatibleHandleTypes, wantedGuestHandleType);
+ return res;
+}
+
+void setColorBufferCurrentLayout(uint32_t colorBufferHandle, VkImageLayout layout) {
+ AutoLock lock(sVkEmulationLock);
+
+ auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!infoPtr) {
+ VK_COMMON_ERROR("Invalid ColorBuffer handle %d.", static_cast<int>(colorBufferHandle));
+ return;
+ }
+ infoPtr->currentLayout = layout;
+}
+
+// Allocate a ready to use VkCommandBuffer for queue transfer. The caller needs
+// to signal the returned VkFence when the VkCommandBuffer completes.
+static std::tuple<VkCommandBuffer, VkFence> allocateQueueTransferCommandBuffer_locked() {
+ auto vk = sVkEmulation->dvk;
+ // Check if a command buffer in the pool is ready to use. If the associated
+ // VkFence is ready, vkGetFenceStatus will return VK_SUCCESS, and the
+ // associated command buffer should be ready to use, so we return that
+ // command buffer with the associated VkFence. If the associated VkFence is
+ // not ready, vkGetFenceStatus will return VK_NOT_READY, we will continue to
+ // search and test the next command buffer. If the VkFence is in an error
+ // state, vkGetFenceStatus will return with other VkResult variants, we will
+ // abort.
+ for (auto& [commandBuffer, fence] : sVkEmulation->transferQueueCommandBufferPool) {
+ auto res = vk->vkGetFenceStatus(sVkEmulation->device, fence);
+ if (res == VK_SUCCESS) {
+ VK_CHECK(vk->vkResetFences(sVkEmulation->device, 1, &fence));
+ VK_CHECK(vk->vkResetCommandBuffer(commandBuffer,
+ VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT));
+ return std::make_tuple(commandBuffer, fence);
+ }
+ if (res == VK_NOT_READY) {
+ continue;
+ }
+ // We either have a device lost, or an invalid fence state. For the device lost case,
+ // VK_CHECK will ensure we capture the relevant streams.
+ VK_CHECK(res);
+ }
+ VkCommandBuffer commandBuffer;
+ VkCommandBufferAllocateInfo allocateInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ .pNext = nullptr,
+ .commandPool = sVkEmulation->commandPool,
+ .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
+ .commandBufferCount = 1,
+ };
+ VK_CHECK(vk->vkAllocateCommandBuffers(sVkEmulation->device, &allocateInfo, &commandBuffer));
+ VkFence fence;
+ VkFenceCreateInfo fenceCi = {
+ .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ .pNext = nullptr,
+ .flags = 0,
+ };
+ VK_CHECK(vk->vkCreateFence(sVkEmulation->device, &fenceCi, nullptr, &fence));
+
+ sVkEmulation->transferQueueCommandBufferPool.emplace_back(commandBuffer, fence);
+
+ VK_COMMON_VERBOSE(
+ "Create a new command buffer for queue transfer for a total of %d "
+ "transfer command buffers",
+ static_cast<int>(sVkEmulation->transferQueueCommandBufferPool.size()));
+
+ return std::make_tuple(commandBuffer, fence);
+}
+
+const VkImageLayout kGuestUseDefaultImageLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+
+void releaseColorBufferForGuestUse(uint32_t colorBufferHandle) {
+ if (!sVkEmulation || !sVkEmulation->live) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Host Vulkan device lost";
+ }
+
+ AutoLock lock(sVkEmulationLock);
+
+ auto infoPtr = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!infoPtr) {
+ VK_COMMON_ERROR("Failed to find ColorBuffer handle %d.",
+ static_cast<int>(colorBufferHandle));
+ return;
+ }
+
+ std::optional<VkImageMemoryBarrier> layoutTransitionBarrier;
+ if (infoPtr->currentLayout != kGuestUseDefaultImageLayout) {
+ layoutTransitionBarrier = VkImageMemoryBarrier{
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .oldLayout = infoPtr->currentLayout,
+ .newLayout = kGuestUseDefaultImageLayout,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = infoPtr->image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ infoPtr->currentLayout = kGuestUseDefaultImageLayout;
+ }
+
+ std::optional<VkImageMemoryBarrier> queueTransferBarrier;
+ if (infoPtr->currentQueueFamilyIndex != VK_QUEUE_FAMILY_EXTERNAL) {
+ queueTransferBarrier = VkImageMemoryBarrier{
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .pNext = nullptr,
+ .srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .oldLayout = infoPtr->currentLayout,
+ .newLayout = infoPtr->currentLayout,
+ .srcQueueFamilyIndex = infoPtr->currentQueueFamilyIndex,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL,
+ .image = infoPtr->image,
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+ infoPtr->currentQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL;
+ }
+
+ if (!layoutTransitionBarrier && !queueTransferBarrier) {
+ return;
+ }
+
+ auto vk = sVkEmulation->dvk;
+ auto [commandBuffer, fence] = allocateQueueTransferCommandBuffer_locked();
+
+ VK_CHECK(vk->vkResetCommandBuffer(commandBuffer, 0));
+
+ const VkCommandBufferBeginInfo beginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .pNext = nullptr,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ .pInheritanceInfo = nullptr,
+ };
+ VK_CHECK(vk->vkBeginCommandBuffer(commandBuffer, &beginInfo));
+
+ if (layoutTransitionBarrier) {
+ vk->vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &layoutTransitionBarrier.value());
+ }
+ if (queueTransferBarrier) {
+ vk->vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &queueTransferBarrier.value());
+ }
+
+ VK_CHECK(vk->vkEndCommandBuffer(commandBuffer));
+
+ const VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .pNext = nullptr,
+ .waitSemaphoreCount = 0,
+ .pWaitSemaphores = nullptr,
+ .pWaitDstStageMask = nullptr,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &commandBuffer,
+ .signalSemaphoreCount = 0,
+ .pSignalSemaphores = nullptr,
+ };
+ {
+ android::base::AutoLock lock(*sVkEmulation->queueLock);
+ VK_CHECK(vk->vkQueueSubmit(sVkEmulation->queue, 1, &submitInfo, fence));
+ }
+
+ static constexpr uint64_t ANB_MAX_WAIT_NS = 5ULL * 1000ULL * 1000ULL * 1000ULL;
+ VK_CHECK(vk->vkWaitForFences(sVkEmulation->device, 1, &fence, VK_TRUE, ANB_MAX_WAIT_NS));
+}
+
+std::unique_ptr<BorrowedImageInfoVk> borrowColorBufferForComposition(uint32_t colorBufferHandle,
+ bool colorBufferIsTarget) {
+ AutoLock lock(sVkEmulationLock);
+
+ auto colorBufferInfo = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!colorBufferInfo) {
+ VK_COMMON_ERROR("Invalid ColorBuffer handle %d.", static_cast<int>(colorBufferHandle));
+ return nullptr;
+ }
+
+ auto compositorInfo = std::make_unique<BorrowedImageInfoVk>();
+ compositorInfo->id = colorBufferInfo->handle;
+ compositorInfo->width = colorBufferInfo->imageCreateInfoShallow.extent.width;
+ compositorInfo->height = colorBufferInfo->imageCreateInfoShallow.extent.height;
+ compositorInfo->image = colorBufferInfo->image;
+ compositorInfo->imageView = colorBufferInfo->imageView;
+ compositorInfo->imageCreateInfo = colorBufferInfo->imageCreateInfoShallow;
+ compositorInfo->preBorrowLayout = colorBufferInfo->currentLayout;
+ compositorInfo->preBorrowQueueFamilyIndex = colorBufferInfo->currentQueueFamilyIndex;
+ if (colorBufferIsTarget && sVkEmulation->displayVk) {
+ // Instruct the compositor to perform the layout transition after use so
+ // that it is ready to be blitted to the display.
+ compositorInfo->postBorrowQueueFamilyIndex = sVkEmulation->queueFamilyIndex;
+ compositorInfo->postBorrowLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
+ } else {
+ // Instruct the compositor to perform the queue transfer release after use
+ // so that the color buffer can be acquired by the guest.
+ compositorInfo->postBorrowQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL;
+ compositorInfo->postBorrowLayout = colorBufferInfo->currentLayout;
+
+ if (compositorInfo->postBorrowLayout == VK_IMAGE_LAYOUT_UNDEFINED) {
+ compositorInfo->postBorrowLayout = kGuestUseDefaultImageLayout;
+ }
+ }
+
+ colorBufferInfo->currentLayout = compositorInfo->postBorrowLayout;
+ colorBufferInfo->currentQueueFamilyIndex = compositorInfo->postBorrowQueueFamilyIndex;
+
+ return compositorInfo;
+}
+
+std::unique_ptr<BorrowedImageInfoVk> borrowColorBufferForDisplay(uint32_t colorBufferHandle) {
+ AutoLock lock(sVkEmulationLock);
+
+ auto colorBufferInfo = android::base::find(sVkEmulation->colorBuffers, colorBufferHandle);
+ if (!colorBufferInfo) {
+ VK_COMMON_ERROR("Invalid ColorBuffer handle %d.", static_cast<int>(colorBufferHandle));
+ return nullptr;
+ }
+
+ auto compositorInfo = std::make_unique<BorrowedImageInfoVk>();
+ compositorInfo->id = colorBufferInfo->handle;
+ compositorInfo->width = colorBufferInfo->imageCreateInfoShallow.extent.width;
+ compositorInfo->height = colorBufferInfo->imageCreateInfoShallow.extent.height;
+ compositorInfo->image = colorBufferInfo->image;
+ compositorInfo->imageView = colorBufferInfo->imageView;
+ compositorInfo->imageCreateInfo = colorBufferInfo->imageCreateInfoShallow;
+ compositorInfo->preBorrowLayout = colorBufferInfo->currentLayout;
+ compositorInfo->preBorrowQueueFamilyIndex = sVkEmulation->queueFamilyIndex;
+
+ // Instruct the display to perform the queue transfer release after use so
+ // that the color buffer can be acquired by the guest.
+ compositorInfo->postBorrowQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL;
+ compositorInfo->postBorrowLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+
+ colorBufferInfo->currentLayout = compositorInfo->postBorrowLayout;
+ colorBufferInfo->currentQueueFamilyIndex = compositorInfo->postBorrowQueueFamilyIndex;
+
+ return compositorInfo;
+}
+
+std::optional<uint32_t> findRepresentativeColorBufferMemoryTypeIndexLocked() {
+ constexpr const uint32_t kArbitraryWidth = 64;
+ constexpr const uint32_t kArbitraryHeight = 64;
+ constexpr const uint32_t kArbitraryHandle = std::numeric_limits<uint32_t>::max();
+ if (!createVkColorBufferLocked(kArbitraryWidth, kArbitraryHeight, GL_RGBA8,
+ FrameworkFormat::FRAMEWORK_FORMAT_GL_COMPATIBLE,
+ kArbitraryHandle, true, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) {
+ ERR("Failed to setup memory type index test ColorBuffer.");
+ return std::nullopt;
+ }
+ if (!initializeVkColorBufferLocked(kArbitraryHandle)) {
+ ERR("Failed to initialize memory type index test ColorBuffer.");
+ return std::nullopt;
+ }
+
+ uint32_t memoryTypeIndex = 0;
+ if (!getColorBufferAllocationInfoLocked(kArbitraryHandle, nullptr, &memoryTypeIndex, nullptr,
+ nullptr)) {
+ ERR("Failed to lookup memory type index test ColorBuffer.");
+ return std::nullopt;
+ }
+
+ if (!teardownVkColorBufferLocked(kArbitraryHandle)) {
+ ERR("Failed to clean up memory type index test ColorBuffer.");
+ return std::nullopt;
+ }
+
+ return memoryTypeIndex;
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkCommonOperations.h b/src/gfxstream/host/vulkan/VkCommonOperations.h
new file mode 100644
index 00000000000..6cf4d502fe1
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkCommonOperations.h
@@ -0,0 +1,523 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <GLES2/gl2.h>
+#include <vulkan/vulkan.h>
+
+#include <atomic>
+#include <functional>
+#include <memory>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include "BorrowedImageVk.h"
+#include "CompositorVk.h"
+#include "DebugUtilsHelper.h"
+#include "DisplayVk.h"
+#include "FrameworkFormats.h"
+#include "aemu/base/ManagedDescriptor.hpp"
+#include "aemu/base/Optional.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "goldfish_vk_private_defs.h"
+#include "utils/GfxApiLogger.h"
+#include "utils/RenderDoc.h"
+
+namespace gfxstream {
+namespace vk {
+
+struct VulkanDispatch;
+
+// Returns a consistent answer for which memory type index is best for staging
+// memory. This is not the simplest thing in the world because even if a memory
+// type index is host visible, that doesn't mean a VkBuffer is allowed to be
+// associated with it.
+bool getStagingMemoryTypeIndex(VulkanDispatch* vk, VkDevice device,
+ const VkPhysicalDeviceMemoryProperties* memProps,
+ uint32_t* typeIndex);
+
+#ifdef _WIN32
+typedef void* HANDLE;
+#endif
+
+#if defined(_WIN32)
+// External memory objects are HANDLE on Windows
+typedef HANDLE VK_EXT_MEMORY_HANDLE;
+// corresponds to INVALID_HANDLE_VALUE
+#define VK_EXT_MEMORY_HANDLE_INVALID (VK_EXT_MEMORY_HANDLE)(uintptr_t)(-1)
+#define VK_EXT_MEMORY_HANDLE_TYPE_BIT VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT
+#elif defined(__QNX__)
+#include <screen/screen.h>
+// External memory objects are screen_buffer_t handles on QNX
+typedef screen_buffer_t VK_EXT_MEMORY_HANDLE;
+#define VK_EXT_MEMORY_HANDLE_INVALID (VK_EXT_MEMORY_HANDLE) nullptr
+#define VK_EXT_MEMORY_HANDLE_TYPE_BIT VK_EXTERNAL_MEMORY_HANDLE_TYPE_SCREEN_BUFFER_BIT_QNX
+#else
+// External memory objects are fd's on other POSIX systems
+typedef int VK_EXT_MEMORY_HANDLE;
+#define VK_EXT_MEMORY_HANDLE_INVALID (-1)
+#define VK_EXT_MEMORY_HANDLE_TYPE_BIT VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT
+#endif
+
+VK_EXT_MEMORY_HANDLE dupExternalMemory(VK_EXT_MEMORY_HANDLE);
+
+enum class AstcEmulationMode {
+ Disabled, // No ASTC emulation (ie: ASTC not supported unless the GPU supports it natively)
+ Cpu, // Decompress ASTC textures on the CPU
+ Gpu, // Decompress ASTC textures on the GPU
+};
+
+// Global state that holds a global Vulkan instance along with globally
+// exported memory allocations + images. This is in order to service things
+// like AndroidHardwareBuffer/FuchsiaImagePipeHandle. Each such allocation is
+// associated with a ColorBuffer handle, and depending on host-side support for
+// GL_EXT_memory_object, also be able to zero-copy render into and readback
+// with the traditional GL pipeline.
+struct VkEmulation {
+ // Whether initialization succeeded.
+ bool live = false;
+
+ // Whether to use deferred command submission.
+ bool useDeferredCommands = false;
+
+ // Whether to fuse memory requirements getting with resource creation.
+ bool useCreateResourcesWithRequirements = false;
+
+ // RenderDoc integration for guest VkInstances.
+ std::unique_ptr<emugl::RenderDocWithMultipleVkInstances> guestRenderDoc = nullptr;
+
+ // Whether to use ASTC emulation. Our current ASTC decoder implementation may lead to device
+ // lost on certain device on Windows.
+ AstcEmulationMode astcLdrEmulationMode = AstcEmulationMode::Disabled;
+
+ // Whether to use ETC2 emulation.
+ bool enableEtc2Emulation = false;
+
+ // Whether to use Ycbcr emulation. If this feature is turned on, Ycbcr request will always use
+ // the emulation path regardless of whether the host Vulkan driver actually supports Ycbcr
+ // conversion or not.
+ bool enableYcbcrEmulation = false;
+
+ bool guestUsesAngle = false;
+
+ bool useDedicatedAllocations = false;
+
+ // Instance and device for creating the system-wide shareable objects.
+ VkInstance instance = VK_NULL_HANDLE;
+ VkPhysicalDevice physdev = VK_NULL_HANDLE;
+ VkDevice device = VK_NULL_HANDLE;
+
+ // Physical device index
+ uint32_t physicalDeviceIndex = 0;
+
+ // Global, instance and device dispatch tables.
+ VulkanDispatch* gvk = nullptr;
+ VulkanDispatch* ivk = nullptr;
+ VulkanDispatch* dvk = nullptr;
+
+ bool instanceSupportsExternalMemoryCapabilities = false;
+ bool instanceSupportsExternalSemaphoreCapabilities = false;
+ bool instanceSupportsSurface = false;
+ PFN_vkGetPhysicalDeviceImageFormatProperties2KHR getImageFormatProperties2Func = nullptr;
+ PFN_vkGetPhysicalDeviceProperties2KHR getPhysicalDeviceProperties2Func = nullptr;
+ PFN_vkGetPhysicalDeviceFeatures2 getPhysicalDeviceFeatures2Func = nullptr;
+
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ bool instanceSupportsMoltenVK = false;
+ PFN_vkSetMTLTextureMVK setMTLTextureFunc = nullptr;
+ PFN_vkGetMTLTextureMVK getMTLTextureFunc = nullptr;
+#endif
+
+ bool debugUtilsAvailableAndRequested = false;
+ DebugUtilsHelper debugUtilsHelper = DebugUtilsHelper::withUtilsDisabled();
+
+ // Queue, command pool, and command buffer
+ // for running commands to sync stuff system-wide.
+ // TODO(b/197362803): Encapsulate host side VkQueue and the lock.
+ VkQueue queue = VK_NULL_HANDLE;
+ std::shared_ptr<android::base::Lock> queueLock = nullptr;
+ uint32_t queueFamilyIndex = 0;
+ VkCommandPool commandPool = VK_NULL_HANDLE;
+ VkCommandBuffer commandBuffer = VK_NULL_HANDLE;
+ VkFence commandBufferFence = VK_NULL_HANDLE;
+
+ struct ImageSupportInfo {
+ // Input parameters
+ VkFormat format;
+ VkImageType type;
+ VkImageTiling tiling;
+ VkImageUsageFlags usageFlags;
+ VkImageCreateFlags createFlags;
+
+ // Output parameters
+ bool supported = false;
+ bool supportsExternalMemory = false;
+ bool requiresDedicatedAllocation = false;
+
+ // Keep the raw output around.
+ VkFormatProperties2 formatProps2;
+ VkImageFormatProperties2 imageFormatProps2;
+ VkExternalImageFormatProperties extFormatProps;
+
+ // Populated later when device is available.
+ uint32_t memoryTypeBits = 0;
+ bool memoryTypeBitsKnown = false;
+ };
+
+ std::vector<ImageSupportInfo> imageSupportInfo;
+
+ struct DeviceSupportInfo {
+ bool hasGraphicsQueueFamily = false;
+ bool hasComputeQueueFamily = false;
+ bool supportsExternalMemoryImport = false;
+ bool supportsExternalMemoryExport = false;
+ bool supportsIdProperties = false;
+ bool supportsDriverProperties = false;
+ bool hasSamplerYcbcrConversionExtension = false;
+ bool supportsSamplerYcbcrConversion = false;
+ bool glInteropSupported = false;
+
+ std::vector<VkExtensionProperties> extensions;
+
+ std::vector<uint32_t> graphicsQueueFamilyIndices;
+ std::vector<uint32_t> computeQueueFamilyIndices;
+
+ VkPhysicalDeviceProperties physdevProps;
+ VkPhysicalDeviceMemoryProperties memProps;
+ VkPhysicalDeviceIDPropertiesKHR idProps;
+
+ std::string driverVendor;
+ std::string driverVersion;
+
+ PFN_vkGetImageMemoryRequirements2KHR getImageMemoryRequirements2Func = nullptr;
+ PFN_vkGetBufferMemoryRequirements2KHR getBufferMemoryRequirements2Func = nullptr;
+
+#ifdef _WIN32
+ PFN_vkGetMemoryWin32HandleKHR getMemoryHandleFunc = nullptr;
+#else
+ PFN_vkGetMemoryFdKHR getMemoryHandleFunc = nullptr;
+#endif
+ };
+
+ struct ExternalMemoryInfo {
+ // Input fields
+ VkDeviceSize size;
+ uint32_t typeIndex;
+
+ // Output fields
+ uint32_t id = 0;
+ VkDeviceMemory memory = VK_NULL_HANDLE;
+
+ // host-mapping fields
+ // host virtual address (hva).
+ void* mappedPtr = nullptr;
+ // host virtual address, aligned to 4KB page.
+ void* pageAlignedHva = nullptr;
+ // the offset of |mappedPtr| off its memory page.
+ uint32_t pageOffset = 0u;
+ // the offset set in |vkBindImageMemory| or |vkBindBufferMemory|.
+ uint32_t bindOffset = 0u;
+ // the size of all the pages the mmeory uses.
+ size_t sizeToPage = 0u;
+ // guest physical address.
+ uintptr_t gpa = 0u;
+
+ VK_EXT_MEMORY_HANDLE externalHandle = VK_EXT_MEMORY_HANDLE_INVALID;
+
+ bool dedicatedAllocation = false;
+ };
+
+ // 128 mb staging buffer (really, just a few 4K frames or one 4k HDR frame)
+ // ought to be big enough for anybody!
+ static constexpr VkDeviceSize kDefaultStagingBufferSize = 128ULL * 1048576ULL;
+
+ struct StagingBufferInfo {
+ // TODO: Don't actually use this as external memory until host visible
+ // external is supported on all platforms
+ ExternalMemoryInfo memory;
+ VkBuffer buffer = VK_NULL_HANDLE;
+ VkDeviceSize size = kDefaultStagingBufferSize;
+ };
+
+ enum class VulkanMode {
+ // Default: ColorBuffers can still be used with the existing GL-based
+ // API. Synchronization with (if it exists) Vulkan images happens on
+ // every one of the GL-based API calls:
+ //
+ // rcReadColorBuffer
+ // rcUpdateColorBuffer
+ // rcBindTexture
+ // rcBindRenderbuffer
+ // rcFlushWindowColorBuffer
+ //
+ // either through explicit CPU copies or implicit in the host driver
+ // if OpenGL interop is supported.
+ //
+ // When images are posted (rcFBPost),
+ // eglSwapBuffers is used, even if that requires a CPU readback.
+
+ Default = 0,
+
+ // VulkanOnly: It is assumed that the guest interacts entirely with
+ // the underlying Vulkan image in the guest and does not use the
+ // GL-based API. This means we can assume those APIs are not called:
+ //
+ // rcReadColorBuffer
+ // rcUpdateColorBuffer
+ // rcBindTexture
+ // rcBindRenderbuffer
+ // rcFlushWindowColorBuffer
+ //
+ // and thus we skip a lot of GL/Vk synchronization.
+ //
+ // When images are posted, eglSwapBuffers is only used if OpenGL
+ // interop is supported. If OpenGL interop is not supported, then we
+ // use a host platform-specific Vulkan swapchain to display the
+ // results.
+
+ VulkanOnly = 1,
+ };
+ struct ColorBufferInfo {
+ ExternalMemoryInfo memory;
+
+ uint32_t handle;
+
+ /* Set in create(), before initialize() */
+ uint32_t width;
+ uint32_t height;
+ GLenum internalFormat;
+ uint32_t memoryProperty;
+ int frameworkFormat;
+ int frameworkStride;
+ bool initialized = false;
+
+ VkImage image = VK_NULL_HANDLE;
+ VkImageView imageView = VK_NULL_HANDLE;
+ VkImageCreateInfo imageCreateInfoShallow = {};
+ VkMemoryRequirements memReqs;
+
+ VkImageLayout currentLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ uint32_t currentQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL;
+
+ bool glExported = false;
+
+ VulkanMode vulkanMode = VulkanMode::Default;
+
+ MTLTextureRef mtlTexture = nullptr;
+ };
+
+ struct BufferInfo {
+ ExternalMemoryInfo memory;
+ uint32_t handle;
+
+ VkDeviceSize size;
+ VkBufferCreateFlags createFlags;
+ VkBufferUsageFlags usageFlags;
+ VkSharingMode sharingMode;
+
+ VkBuffer buffer = VK_NULL_HANDLE;
+ VkMemoryRequirements memReqs;
+
+ bool glExported = false;
+ VulkanMode vulkanMode = VulkanMode::Default;
+ MTLBufferRef mtlBuffer = nullptr;
+ };
+
+ // Track what is supported on whatever device was selected.
+ DeviceSupportInfo deviceInfo;
+
+ // Track additional vulkan diagnostics
+ uint32_t vulkanInstanceVersion;
+ std::vector<VkExtensionProperties> instanceExtensions;
+
+ // A single staging buffer to perform most transfers to/from OpenGL on the
+ // host. It is shareable across instances. The memory is shareable but the
+ // buffer is not; other users need to create buffers that
+ // bind to imported versions of the memory.
+ StagingBufferInfo staging;
+
+ // ColorBuffers are intended to back the guest's shareable images.
+ // For example:
+ // Android: gralloc
+ // Fuchsia: ImagePipeHandle
+ // Linux: dmabuf
+ std::unordered_map<uint32_t, ColorBufferInfo> colorBuffers;
+
+ // Buffers are intended to back the guest's shareable Vulkan buffers.
+ std::unordered_map<uint32_t, BufferInfo> buffers;
+
+ // In order to support VK_KHR_external_memory_(fd|win32) we need also to
+ // support the concept of plain external memories that are just memory and
+ // not necessarily images. These are then intended to pass through to the
+ // guest in some way, with 1:1 mapping between guest and host external
+ // memory handles.
+ std::unordered_map<uint32_t, ExternalMemoryInfo> externalMemories;
+
+ // The host keeps a set of occupied guest memory addresses to avoid a
+ // host memory address mapped to guest twice.
+ std::unordered_set<uint64_t> occupiedGpas;
+
+ // We can also consider using a single external memory object to back all
+ // host visible allocations in the guest. This would save memory, but we
+ // would also need to automatically add
+ // VkExternalMemory(Image|Buffer)CreateInfo, or if it is already there, OR
+ // it with the handle types on the host.
+ // A rough sketch: Some memories/images/buffers in the guest
+ // are backed by host visible memory:
+ // There is already a virtual memory type for those things in the current
+ // implementation. The guest doesn't know whether the pointer or the
+ // VkDeviceMemory object is backed by host external or non external.
+ // TODO: are all possible buffer / image usages compatible with
+ // external backing?
+ // TODO: try switching to this
+ ExternalMemoryInfo virtualHostVisibleHeap;
+
+ // Every command buffer in the pool is associated with a VkFence which is
+ // signaled only if the command buffer completes.
+ std::vector<std::tuple<VkCommandBuffer, VkFence>> transferQueueCommandBufferPool;
+
+ std::unique_ptr<CompositorVk> compositorVk;
+
+ // The implementation for Vulkan native swapchain. Only initialized in initVkEmulationFeatures
+ // if useVulkanNativeSwapchain is set.
+ std::unique_ptr<DisplayVk> displayVk;
+
+ // The host memory type index that will be used to create an emulated memory type specifically
+ // for AHardwareBuffers/ColorBuffers so that the host can control which memory flags are
+ // exposed to the guest (i.e. hide VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT from the guest).
+ std::optional<uint32_t> representativeColorBufferMemoryTypeIndex;
+};
+
+VkEmulation* createGlobalVkEmulation(VulkanDispatch* vk, bool useVulkanNativeSwapchain);
+
+struct VkEmulationFeatures {
+ bool glInteropSupported = false;
+ bool deferredCommands = false;
+ bool createResourceWithRequirements = false;
+ bool useVulkanComposition = false;
+ bool useVulkanNativeSwapchain = false;
+ std::unique_ptr<emugl::RenderDocWithMultipleVkInstances> guestRenderDoc = nullptr;
+ AstcEmulationMode astcLdrEmulationMode = AstcEmulationMode::Disabled;
+ bool enableEtc2Emulation = false;
+ bool enableYcbcrEmulation = false;
+ bool guestUsesAngle = false;
+ bool useDedicatedAllocations = false;
+};
+void initVkEmulationFeatures(std::unique_ptr<VkEmulationFeatures>);
+
+VkEmulation* getGlobalVkEmulation();
+void teardownGlobalVkEmulation();
+
+std::unique_ptr<gfxstream::DisplaySurface> createDisplaySurface(FBNativeWindowType window,
+ uint32_t width, uint32_t height);
+
+bool allocExternalMemory(
+ VulkanDispatch* vk, VkEmulation::ExternalMemoryInfo* info, bool actuallyExternal = true,
+ android::base::Optional<uint64_t> deviceAlignment = android::base::kNullopt,
+ android::base::Optional<VkBuffer> bufferForDedicatedAllocation = android::base::kNullopt,
+ android::base::Optional<VkImage> imageForDedicatedAllocation = android::base::kNullopt);
+void freeExternalMemoryLocked(VulkanDispatch* vk, VkEmulation::ExternalMemoryInfo* info);
+
+bool importExternalMemory(VulkanDispatch* vk, VkDevice targetDevice,
+ const VkEmulation::ExternalMemoryInfo* info, VkDeviceMemory* out);
+bool importExternalMemoryDedicatedImage(VulkanDispatch* vk, VkDevice targetDevice,
+ const VkEmulation::ExternalMemoryInfo* info, VkImage image,
+ VkDeviceMemory* out);
+
+// ColorBuffer operations
+
+bool isColorBufferExportedToGl(uint32_t colorBufferHandle, bool* exported);
+
+bool getColorBufferAllocationInfo(uint32_t colorBufferHandle, VkDeviceSize* outSize,
+ uint32_t* outMemoryTypeIndex, bool* outMemoryIsDedicatedAlloc,
+ void** outMappedPtr);
+
+std::unique_ptr<VkImageCreateInfo> generateColorBufferVkImageCreateInfo(VkFormat format,
+ uint32_t width,
+ uint32_t height,
+ VkImageTiling tiling);
+
+bool createVkColorBuffer(uint32_t width, uint32_t height, GLenum format,
+ FrameworkFormat frameworkFormat, uint32_t colorBufferHandle,
+ bool vulkanOnly, uint32_t memoryProperty);
+
+bool teardownVkColorBuffer(uint32_t colorBufferHandle);
+
+bool importExtMemoryHandleToVkColorBuffer(uint32_t colorBufferHandle, uint32_t type,
+ VK_EXT_MEMORY_HANDLE extMemHandle);
+
+VkEmulation::ColorBufferInfo getColorBufferInfo(uint32_t colorBufferHandle);
+VK_EXT_MEMORY_HANDLE getColorBufferExtMemoryHandle(uint32_t colorBufferHandle);
+
+struct VkColorBufferMemoryExport {
+ android::base::ManagedDescriptor descriptor;
+ uint64_t size = 0;
+ bool linearTiling = false;
+ bool dedicatedAllocation = false;
+};
+std::optional<VkColorBufferMemoryExport> exportColorBufferMemory(uint32_t colorBufferHandle);
+
+MTLTextureRef getColorBufferMTLTexture(uint32_t colorBufferHandle);
+bool setColorBufferVulkanMode(uint32_t colorBufferHandle, uint32_t vulkanMode);
+int32_t mapGpaToBufferHandle(uint32_t bufferHandle, uint64_t gpa, uint64_t size = 0);
+
+bool colorBufferNeedsUpdateBetweenGlAndVk(uint32_t colorBufferHandle);
+
+bool readColorBufferToBytes(uint32_t colorBufferHandle, std::vector<uint8_t>* bytes);
+bool readColorBufferToBytes(uint32_t colorBufferHandle, uint32_t x, uint32_t y, uint32_t w,
+ uint32_t h, void* outPixels);
+bool readColorBufferToBytesLocked(uint32_t colorBufferHandle, uint32_t x, uint32_t y, uint32_t w,
+ uint32_t h, void* outPixels);
+
+bool updateColorBufferFromBytes(uint32_t colorBufferHandle, const std::vector<uint8_t>& bytes);
+bool updateColorBufferFromBytes(uint32_t colorBufferHandle, uint32_t x, uint32_t y, uint32_t w,
+ uint32_t h, const void* pixels);
+
+// Data buffer operations
+bool getBufferAllocationInfo(uint32_t bufferHandle, VkDeviceSize* outSize,
+ uint32_t* outMemoryTypeIndex, bool* outMemoryIsDedicatedAlloc);
+
+bool setupVkBuffer(uint64_t size, uint32_t bufferHandle, bool vulkanOnly = false,
+ uint32_t memoryProperty = 0);
+bool teardownVkBuffer(uint32_t bufferHandle);
+VK_EXT_MEMORY_HANDLE getBufferExtMemoryHandle(uint32_t bufferHandle);
+
+bool readBufferToBytes(uint32_t bufferHandle, uint64_t offset, uint64_t size, void* outBytes);
+bool updateBufferFromBytes(uint32_t bufferHandle, uint64_t offset, uint64_t size,
+ const void* bytes);
+
+VkExternalMemoryHandleTypeFlags transformExternalMemoryHandleTypeFlags_tohost(
+ VkExternalMemoryHandleTypeFlags bits);
+
+VkExternalMemoryHandleTypeFlags transformExternalMemoryHandleTypeFlags_fromhost(
+ VkExternalMemoryHandleTypeFlags hostBits,
+ VkExternalMemoryHandleTypeFlags wantedGuestHandleType);
+
+VkExternalMemoryProperties transformExternalMemoryProperties_tohost(
+ VkExternalMemoryProperties props);
+
+VkExternalMemoryProperties transformExternalMemoryProperties_fromhost(
+ VkExternalMemoryProperties props, VkExternalMemoryHandleTypeFlags wantedGuestHandleType);
+
+void setColorBufferCurrentLayout(uint32_t colorBufferHandle, VkImageLayout);
+
+void releaseColorBufferForGuestUse(uint32_t colorBufferHandle);
+
+std::unique_ptr<BorrowedImageInfoVk> borrowColorBufferForComposition(uint32_t colorBufferHandle,
+ bool colorBufferIsTarget);
+std::unique_ptr<BorrowedImageInfoVk> borrowColorBufferForDisplay(uint32_t colorBufferHandle);
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkDecoderContext.h b/src/gfxstream/host/vulkan/VkDecoderContext.h
new file mode 100644
index 00000000000..4a997cff08a
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkDecoderContext.h
@@ -0,0 +1,35 @@
+// 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.
+
+#pragma once
+
+#include <memory>
+
+#include "aemu/base/HealthMonitor.h"
+#include "aemu/base/Metrics.h"
+#include "utils/GfxApiLogger.h"
+
+namespace gfxstream {
+namespace vk {
+
+struct VkDecoderContext {
+ const char* processName = nullptr;
+ emugl::GfxApiLogger* gfxApiLogger = nullptr;
+ emugl::HealthMonitor<>* healthMonitor = nullptr;
+ emugl::MetricsLogger* metricsLogger = nullptr;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkDecoderGlobalState.cpp b/src/gfxstream/host/vulkan/VkDecoderGlobalState.cpp
new file mode 100644
index 00000000000..30847214c1d
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkDecoderGlobalState.cpp
@@ -0,0 +1,8196 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "VkDecoderGlobalState.h"
+
+#include <algorithm>
+#include <functional>
+#include <list>
+#include <memory>
+#include <mutex>
+#include <unordered_map>
+#include <vector>
+
+#include "BlobManager.h"
+#include "FrameBuffer.h"
+#include "RenderThreadInfoVk.h"
+#include "VkAndroidNativeBuffer.h"
+#include "VkCommonOperations.h"
+#include "VkDecoderContext.h"
+#include "VkDecoderSnapshot.h"
+#include "VulkanDispatch.h"
+#include "VulkanStream.h"
+#include "aemu/base/ManagedDescriptor.hpp"
+#include "aemu/base/Optional.h"
+#include "aemu/base/Tracing.h"
+#include "aemu/base/containers/EntityManager.h"
+#include "aemu/base/containers/HybridEntityManager.h"
+#include "aemu/base/containers/Lookup.h"
+#include "aemu/base/files/Stream.h"
+#include "aemu/base/memory/SharedMemory.h"
+#include "aemu/base/synchronization/ConditionVariable.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/system/System.h"
+#include "common/goldfish_vk_deepcopy.h"
+#include "common/goldfish_vk_dispatch.h"
+#include "common/goldfish_vk_marshaling.h"
+#include "common/goldfish_vk_reserved_marshaling.h"
+#include "compressedTextureFormats/AstcCpuDecompressor.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/HostmemIdMapping.h"
+#include "host-common/address_space_device_control_ops.h"
+#include "host-common/emugl_vm_operations.h"
+#include "host-common/feature_control.h"
+#include "host-common/vm_operations.h"
+#include "vulkan/VkFormatUtils.h"
+#include "utils/RenderDoc.h"
+#include "vk_util.h"
+#include "vulkan/emulated_textures/AstcTexture.h"
+#include "vulkan/emulated_textures/CompressedImageInfo.h"
+#include "vulkan/emulated_textures/GpuDecompressionPipeline.h"
+#include "vulkan/vk_enum_string_helper.h"
+
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+
+#ifdef __APPLE__
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
+#include <climits>
+
+namespace gfxstream {
+namespace vk {
+
+using android::base::AutoLock;
+using android::base::ConditionVariable;
+using android::base::DescriptorType;
+using android::base::Lock;
+using android::base::ManagedDescriptor;
+using android::base::MetricEventBadPacketLength;
+using android::base::MetricEventDuplicateSequenceNum;
+using android::base::MetricEventVulkanOutOfMemory;
+using android::base::Optional;
+using android::base::SharedMemory;
+using android::base::StaticLock;
+using android::emulation::ManagedDescriptorInfo;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+using emugl::GfxApiLogger;
+using gfxstream::BlobManager;
+using gfxstream::VulkanInfo;
+
+// TODO(b/261477138): Move to a shared aemu definition
+#define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
+#define __ALIGN(x, a) __ALIGN_MASK(x, (__typeof__(x))(a)-1)
+
+// TODO: Asserts build
+#define DCHECK(condition) (void)(condition);
+
+#define VKDGS_DEBUG 0
+
+#if VKDGS_DEBUG
+#define VKDGS_LOG(fmt, ...) fprintf(stderr, "%s:%d " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);
+#else
+#define VKDGS_LOG(fmt, ...)
+#endif
+
+// Blob mem
+#define STREAM_BLOB_MEM_GUEST 1
+#define STREAM_BLOB_MEM_HOST3D 2
+#define STREAM_BLOB_MEM_HOST3D_GUEST 3
+
+// Blob flags
+#define STREAM_BLOB_FLAG_USE_MAPPABLE 1
+#define STREAM_BLOB_FLAG_USE_SHAREABLE 2
+#define STREAM_BLOB_FLAG_USE_CROSS_DEVICE 4
+#define STREAM_BLOB_FLAG_CREATE_GUEST_HANDLE 8
+
+#define VALIDATE_REQUIRED_HANDLE(parameter) \
+ validateRequiredHandle(__FUNCTION__, #parameter, parameter)
+
+template <typename T>
+void validateRequiredHandle(const char* api_name, const char* parameter_name, T value) {
+ if (value == VK_NULL_HANDLE) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << api_name << ":" << parameter_name;
+ }
+}
+
+#if defined(_WIN32)
+// External sync objects are HANDLE on Windows
+typedef HANDLE VK_EXT_SYNC_HANDLE;
+// corresponds to INVALID_HANDLE_VALUE
+#define VK_EXT_SYNC_HANDLE_INVALID (VK_EXT_SYNC_HANDLE)(uintptr_t)(-1)
+#else
+// External sync objects are fd's on other POSIX systems
+typedef int VK_EXT_SYNC_HANDLE;
+#define VK_EXT_SYNC_HANDLE_INVALID (-1)
+#endif
+
+VK_EXT_SYNC_HANDLE dupExternalSync(VK_EXT_SYNC_HANDLE h) {
+#ifdef _WIN32
+ auto myProcessHandle = GetCurrentProcess();
+ VK_EXT_SYNC_HANDLE res;
+ DuplicateHandle(myProcessHandle, h, // source process and handle
+ myProcessHandle, &res, // target process and pointer to handle
+ 0 /* desired access (ignored) */, true /* inherit */,
+ DUPLICATE_SAME_ACCESS /* same access option */);
+ return res;
+#else
+ return dup(h);
+#endif
+}
+
+// A list of device extensions that should not be passed to the host driver.
+// These will mainly include Vulkan features that we emulate ourselves.
+static constexpr const char* const kEmulatedDeviceExtensions[] = {
+ "VK_ANDROID_external_memory_android_hardware_buffer",
+ "VK_ANDROID_native_buffer",
+ "VK_FUCHSIA_buffer_collection",
+ "VK_FUCHSIA_external_memory",
+ "VK_FUCHSIA_external_semaphore",
+ VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME,
+ VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME,
+#if defined(__QNX__)
+ VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME,
+ VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME,
+#endif
+};
+
+// A list of instance extensions that should not be passed to the host driver.
+// On older pre-1.1 Vulkan platforms, gfxstream emulates these features.
+static constexpr const char* const kEmulatedInstanceExtensions[] = {
+ VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME,
+ VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME,
+};
+
+static constexpr uint32_t kMaxSafeVersion = VK_MAKE_VERSION(1, 3, 0);
+static constexpr uint32_t kMinVersion = VK_MAKE_VERSION(1, 0, 0);
+
+static constexpr uint64_t kPageSizeforBlob = 4096;
+static constexpr uint64_t kPageMaskForBlob = ~(0xfff);
+
+static uint64_t hostBlobId = 0;
+
+#define DEFINE_BOXED_HANDLE_TYPE_TAG(type) Tag_##type,
+
+enum BoxedHandleTypeTag {
+ Tag_Invalid = 0,
+ GOLDFISH_VK_LIST_HANDLE_TYPES_BY_STAGE(DEFINE_BOXED_HANDLE_TYPE_TAG)
+};
+
+template <class T>
+class BoxedHandleManager {
+ public:
+ // The hybrid entity manager uses a sequence lock to protect access to
+ // a working set of 16000 handles, allowing us to avoid using a regular
+ // lock for those. Performance is degraded when going over this number,
+ // as it will then fall back to a std::map.
+ //
+ // We use 16000 as the max number of live handles to track; we don't
+ // expect the system to go over 16000 total live handles, outside some
+ // dEQP object management tests.
+ using Store = android::base::HybridEntityManager<16000, uint64_t, T>;
+
+ Lock lock;
+ mutable Store store;
+ std::unordered_map<uint64_t, uint64_t> reverseMap;
+ struct DelayedRemove {
+ uint64_t handle;
+ std::function<void()> callback;
+ };
+ std::unordered_map<VkDevice, std::vector<DelayedRemove>> delayedRemoves;
+
+ void clear() {
+ reverseMap.clear();
+ store.clear();
+ }
+
+ uint64_t add(const T& item, BoxedHandleTypeTag tag) {
+ auto res = (uint64_t)store.add(item, (size_t)tag);
+ AutoLock l(lock);
+ reverseMap[(uint64_t)(item.underlying)] = res;
+ return res;
+ }
+
+ uint64_t addFixed(uint64_t handle, const T& item, BoxedHandleTypeTag tag) {
+ auto res = (uint64_t)store.addFixed(handle, item, (size_t)tag);
+ AutoLock l(lock);
+ reverseMap[(uint64_t)(item.underlying)] = res;
+ return res;
+ }
+
+ void remove(uint64_t h) {
+ auto item = get(h);
+ if (item) {
+ AutoLock l(lock);
+ reverseMap.erase((uint64_t)(item->underlying));
+ }
+ store.remove(h);
+ }
+
+ void removeDelayed(uint64_t h, VkDevice device, std::function<void()> callback) {
+ AutoLock l(lock);
+ delayedRemoves[device].push_back({h, callback});
+ }
+
+ void processDelayedRemovesGlobalStateLocked(VkDevice device) {
+ AutoLock l(lock);
+ auto it = delayedRemoves.find(device);
+ if (it == delayedRemoves.end()) return;
+ auto& delayedRemovesList = it->second;
+ for (const auto& r : delayedRemovesList) {
+ auto h = r.handle;
+ // VkDecoderGlobalState is already locked when callback is called.
+ auto funcGlobalStateLocked = r.callback;
+ funcGlobalStateLocked();
+ store.remove(h);
+ }
+ delayedRemovesList.clear();
+ delayedRemoves.erase(it);
+ }
+
+ T* get(uint64_t h) { return (T*)store.get_const(h); }
+
+ uint64_t getBoxedFromUnboxedLocked(uint64_t unboxed) {
+ auto* res = android::base::find(reverseMap, unboxed);
+ if (!res) return 0;
+ return *res;
+ }
+};
+
+struct OrderMaintenanceInfo {
+ uint32_t sequenceNumber = 0;
+ Lock lock;
+ ConditionVariable cv;
+
+ uint32_t refcount = 1;
+
+ void incRef() { __atomic_add_fetch(&refcount, 1, __ATOMIC_SEQ_CST); }
+
+ bool decRef() { return 0 == __atomic_sub_fetch(&refcount, 1, __ATOMIC_SEQ_CST); }
+};
+
+static void acquireOrderMaintInfo(OrderMaintenanceInfo* ord) {
+ if (!ord) return;
+ ord->incRef();
+}
+
+static void releaseOrderMaintInfo(OrderMaintenanceInfo* ord) {
+ if (!ord) return;
+ if (ord->decRef()) delete ord;
+}
+
+template <class T>
+class DispatchableHandleInfo {
+ public:
+ T underlying;
+ VulkanDispatch* dispatch = nullptr;
+ bool ownDispatch = false;
+ OrderMaintenanceInfo* ordMaintInfo = nullptr;
+ VulkanMemReadingStream* readStream = nullptr;
+};
+
+static BoxedHandleManager<DispatchableHandleInfo<uint64_t>> sBoxedHandleManager;
+
+struct ReadStreamRegistry {
+ Lock mLock;
+
+ std::vector<VulkanMemReadingStream*> freeStreams;
+
+ ReadStreamRegistry() { freeStreams.reserve(100); };
+
+ VulkanMemReadingStream* pop() {
+ AutoLock lock(mLock);
+ if (freeStreams.empty()) {
+ return new VulkanMemReadingStream(0);
+ } else {
+ VulkanMemReadingStream* res = freeStreams.back();
+ freeStreams.pop_back();
+ return res;
+ }
+ }
+
+ void push(VulkanMemReadingStream* stream) {
+ AutoLock lock(mLock);
+ freeStreams.push_back(stream);
+ }
+};
+
+static ReadStreamRegistry sReadStreamRegistry;
+
+class VkDecoderGlobalState::Impl {
+ public:
+ Impl()
+ : m_vk(vkDispatch()),
+ m_emu(getGlobalVkEmulation()),
+ mRenderDocWithMultipleVkInstances(m_emu->guestRenderDoc.get()) {
+ mSnapshotsEnabled = feature_is_enabled(kFeature_VulkanSnapshots);
+ mVkCleanupEnabled =
+ android::base::getEnvironmentVariable("ANDROID_EMU_VK_NO_CLEANUP") != "1";
+ mLogging = android::base::getEnvironmentVariable("ANDROID_EMU_VK_LOG_CALLS") == "1";
+ mVerbosePrints = android::base::getEnvironmentVariable("ANDROID_EMUGL_VERBOSE") == "1";
+ if (get_emugl_address_space_device_control_ops().control_get_hw_funcs &&
+ get_emugl_address_space_device_control_ops().control_get_hw_funcs()) {
+ mUseOldMemoryCleanupPath = 0 == get_emugl_address_space_device_control_ops()
+ .control_get_hw_funcs()
+ ->getPhysAddrStartLocked();
+ }
+ mGuestUsesAngle = feature_is_enabled(kFeature_GuestUsesAngle);
+ }
+
+ ~Impl() = default;
+
+ // Resets all internal tracking info.
+ // Assumes that the heavyweight cleanup operations
+ // have already happened.
+ void clear() {
+ mInstanceInfo.clear();
+ mPhysdevInfo.clear();
+ mDeviceInfo.clear();
+ mImageInfo.clear();
+ mImageViewInfo.clear();
+ mSamplerInfo.clear();
+ mCmdBufferInfo.clear();
+ mCmdPoolInfo.clear();
+ mDeviceToPhysicalDevice.clear();
+ mPhysicalDeviceToInstance.clear();
+ mQueueInfo.clear();
+ mBufferInfo.clear();
+ mMemoryInfo.clear();
+ mShaderModuleInfo.clear();
+ mPipelineCacheInfo.clear();
+ mPipelineInfo.clear();
+ mRenderPassInfo.clear();
+ mFramebufferInfo.clear();
+ mSemaphoreInfo.clear();
+ mFenceInfo.clear();
+#ifdef _WIN32
+ mSemaphoreId = 1;
+ mExternalSemaphoresById.clear();
+#endif
+ mDescriptorUpdateTemplateInfo.clear();
+
+ mCreatedHandlesForSnapshotLoad.clear();
+ mCreatedHandlesForSnapshotLoadIndex = 0;
+
+ sBoxedHandleManager.clear();
+ }
+
+ bool snapshotsEnabled() const { return mSnapshotsEnabled; }
+
+ bool vkCleanupEnabled() const { return mVkCleanupEnabled; }
+
+ void save(android::base::Stream* stream) { snapshot()->save(stream); }
+
+ void load(android::base::Stream* stream, GfxApiLogger& gfxLogger,
+ HealthMonitor<>* healthMonitor) {
+ // assume that we already destroyed all instances
+ // from FrameBuffer's onLoad method.
+
+ // destroy all current internal data structures
+ clear();
+
+ // this part will replay in the decoder
+ snapshot()->load(stream, gfxLogger, healthMonitor);
+ }
+
+ void lock() { mLock.lock(); }
+
+ void unlock() { mLock.unlock(); }
+
+ size_t setCreatedHandlesForSnapshotLoad(const unsigned char* buffer) {
+ size_t consumed = 0;
+
+ if (!buffer) return consumed;
+
+ uint32_t bufferSize = *(uint32_t*)buffer;
+
+ consumed += 4;
+
+ uint32_t handleCount = bufferSize / 8;
+ VKDGS_LOG("incoming handle count: %u", handleCount);
+
+ uint64_t* handles = (uint64_t*)(buffer + 4);
+
+ mCreatedHandlesForSnapshotLoad.clear();
+ mCreatedHandlesForSnapshotLoadIndex = 0;
+
+ for (uint32_t i = 0; i < handleCount; ++i) {
+ VKDGS_LOG("handle to load: 0x%llx", (unsigned long long)(uintptr_t)handles[i]);
+ mCreatedHandlesForSnapshotLoad.push_back(handles[i]);
+ consumed += 8;
+ }
+
+ return consumed;
+ }
+
+ void clearCreatedHandlesForSnapshotLoad() {
+ mCreatedHandlesForSnapshotLoad.clear();
+ mCreatedHandlesForSnapshotLoadIndex = 0;
+ }
+
+ VkResult on_vkEnumerateInstanceVersion(android::base::BumpPool* pool, uint32_t* pApiVersion) {
+ if (m_vk->vkEnumerateInstanceVersion) {
+ VkResult res = m_vk->vkEnumerateInstanceVersion(pApiVersion);
+
+ if (*pApiVersion > kMaxSafeVersion) {
+ *pApiVersion = kMaxSafeVersion;
+ }
+
+ return res;
+ }
+ *pApiVersion = kMinVersion;
+ return VK_SUCCESS;
+ }
+
+ VkResult on_vkCreateInstance(android::base::BumpPool* pool,
+ const VkInstanceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkInstance* pInstance) {
+ std::vector<const char*> finalExts = filteredInstanceExtensionNames(
+ pCreateInfo->enabledExtensionCount, pCreateInfo->ppEnabledExtensionNames);
+
+ if (pCreateInfo->pApplicationInfo) {
+ if (pCreateInfo->pApplicationInfo->pApplicationName)
+ INFO("Creating Vulkan instance for app: %s",
+ pCreateInfo->pApplicationInfo->pApplicationName);
+ if (pCreateInfo->pApplicationInfo->pEngineName)
+ INFO("Creating Vulkan instance for engine: %s",
+ pCreateInfo->pApplicationInfo->pEngineName);
+ }
+
+ // Create higher version instance whenever it is possible.
+ uint32_t apiVersion = VK_MAKE_VERSION(1, 0, 0);
+ if (pCreateInfo->pApplicationInfo) {
+ apiVersion = pCreateInfo->pApplicationInfo->apiVersion;
+ }
+ if (m_vk->vkEnumerateInstanceVersion) {
+ uint32_t instanceVersion;
+ VkResult result = m_vk->vkEnumerateInstanceVersion(&instanceVersion);
+ if (result == VK_SUCCESS && instanceVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ apiVersion = instanceVersion;
+ }
+ }
+
+ VkInstanceCreateInfo createInfoFiltered;
+ VkApplicationInfo appInfo = {};
+ deepcopy_VkInstanceCreateInfo(pool, VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, pCreateInfo,
+ &createInfoFiltered);
+
+ createInfoFiltered.enabledExtensionCount = static_cast<uint32_t>(finalExts.size());
+ createInfoFiltered.ppEnabledExtensionNames = finalExts.data();
+ if (createInfoFiltered.pApplicationInfo != nullptr) {
+ const_cast<VkApplicationInfo*>(createInfoFiltered.pApplicationInfo)->apiVersion =
+ apiVersion;
+ appInfo = *createInfoFiltered.pApplicationInfo;
+ }
+
+ // remove VkDebugReportCallbackCreateInfoEXT and
+ // VkDebugUtilsMessengerCreateInfoEXT from the chain.
+ auto* curr = reinterpret_cast<vk_struct_common*>(&createInfoFiltered);
+ while (curr != nullptr) {
+ if (curr->pNext != nullptr &&
+ (curr->pNext->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT ||
+ curr->pNext->sType == VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT)) {
+ curr->pNext = curr->pNext->pNext;
+ }
+ curr = curr->pNext;
+ }
+
+ // bug: 155795731
+ bool swiftshader =
+ (android::base::getEnvironmentVariable("ANDROID_EMU_VK_ICD").compare("swiftshader") ==
+ 0);
+ std::unique_ptr<std::lock_guard<std::recursive_mutex>> lock = nullptr;
+
+ if (swiftshader) {
+ if (mLogging) {
+ fprintf(stderr, "%s: acquire lock\n", __func__);
+ }
+ lock = std::make_unique<std::lock_guard<std::recursive_mutex>>(mLock);
+ }
+
+ VkResult res = m_vk->vkCreateInstance(&createInfoFiltered, pAllocator, pInstance);
+
+ if (res != VK_SUCCESS) {
+ return res;
+ }
+
+ if (!swiftshader) {
+ lock = std::make_unique<std::lock_guard<std::recursive_mutex>>(mLock);
+ }
+
+ // TODO: bug 129484301
+ get_emugl_vm_operations().setSkipSnapshotSave(
+ !feature_is_enabled(kFeature_VulkanSnapshots));
+
+ InstanceInfo info;
+ info.apiVersion = apiVersion;
+ for (uint32_t i = 0; i < createInfoFiltered.enabledExtensionCount; ++i) {
+ info.enabledExtensionNames.push_back(createInfoFiltered.ppEnabledExtensionNames[i]);
+ }
+
+ // Box it up
+ VkInstance boxed = new_boxed_VkInstance(*pInstance, nullptr, true /* own dispatch */);
+ init_vulkan_dispatch_from_instance(m_vk, *pInstance, dispatch_VkInstance(boxed));
+ info.boxed = boxed;
+
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ if (m_emu->instanceSupportsMoltenVK) {
+ if (!m_vk->vkSetMTLTextureMVK) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Cannot find vkSetMTLTextureMVK";
+ }
+ }
+#endif
+
+ std::string_view engineName = appInfo.pEngineName ? appInfo.pEngineName : "";
+ info.isAngle = (engineName == "ANGLE");
+
+ mInstanceInfo[*pInstance] = info;
+
+ *pInstance = (VkInstance)info.boxed;
+
+ auto fb = FrameBuffer::getFB();
+ if (!fb) return res;
+
+ if (vkCleanupEnabled()) {
+ fb->registerProcessCleanupCallback(unbox_VkInstance(boxed), [this, boxed] {
+ vkDestroyInstanceImpl(unbox_VkInstance(boxed), nullptr);
+ });
+ }
+
+ return res;
+ }
+
+ void vkDestroyInstanceImpl(VkInstance instance, const VkAllocationCallbacks* pAllocator) {
+ // Do delayed removes out of the lock, but get the list of devices to destroy inside the
+ // lock.
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::vector<VkDevice> devicesToDestroy;
+
+ for (auto it : mDeviceToPhysicalDevice) {
+ auto* otherInstance = android::base::find(mPhysicalDeviceToInstance, it.second);
+ if (!otherInstance) continue;
+ if (instance == *otherInstance) {
+ devicesToDestroy.push_back(it.first);
+ }
+ }
+
+ for (auto device : devicesToDestroy) {
+ sBoxedHandleManager.processDelayedRemovesGlobalStateLocked(device);
+ }
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ teardownInstanceLocked(instance);
+
+ if (mRenderDocWithMultipleVkInstances) {
+ mRenderDocWithMultipleVkInstances->removeVkInstance(instance);
+ }
+ m_vk->vkDestroyInstance(instance, pAllocator);
+
+ auto it = mPhysicalDeviceToInstance.begin();
+
+ while (it != mPhysicalDeviceToInstance.end()) {
+ if (it->second == instance) {
+ it = mPhysicalDeviceToInstance.erase(it);
+ } else {
+ ++it;
+ }
+ }
+
+ auto* instInfo = android::base::find(mInstanceInfo, instance);
+ delete_VkInstance(instInfo->boxed);
+ mInstanceInfo.erase(instance);
+ }
+
+ void on_vkDestroyInstance(android::base::BumpPool* pool, VkInstance boxed_instance,
+ const VkAllocationCallbacks* pAllocator) {
+ auto instance = unbox_VkInstance(boxed_instance);
+
+ vkDestroyInstanceImpl(instance, pAllocator);
+
+ auto fb = FrameBuffer::getFB();
+ if (!fb) return;
+
+ fb->unregisterProcessCleanupCallback(instance);
+ }
+
+ VkResult on_vkEnumeratePhysicalDevices(android::base::BumpPool* pool, VkInstance boxed_instance,
+ uint32_t* physicalDeviceCount,
+ VkPhysicalDevice* physicalDevices) {
+ auto instance = unbox_VkInstance(boxed_instance);
+ auto vk = dispatch_VkInstance(boxed_instance);
+
+ uint32_t physicalDevicesSize = 0;
+ if (physicalDeviceCount) {
+ physicalDevicesSize = *physicalDeviceCount;
+ }
+
+ uint32_t actualPhysicalDeviceCount;
+ auto res = vk->vkEnumeratePhysicalDevices(instance, &actualPhysicalDeviceCount, nullptr);
+ if (res != VK_SUCCESS) {
+ return res;
+ }
+ std::vector<VkPhysicalDevice> validPhysicalDevices(actualPhysicalDeviceCount);
+ res = vk->vkEnumeratePhysicalDevices(instance, &actualPhysicalDeviceCount,
+ validPhysicalDevices.data());
+ if (res != VK_SUCCESS) return res;
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ if (m_emu->instanceSupportsExternalMemoryCapabilities) {
+ PFN_vkGetPhysicalDeviceProperties2KHR getPhysdevProps2Func =
+ vk_util::getVkInstanceProcAddrWithFallback<
+ vk_util::vk_fn_info::GetPhysicalDeviceProperties2>(
+ {
+ vk->vkGetInstanceProcAddr,
+ m_vk->vkGetInstanceProcAddr,
+ },
+ instance);
+
+ if (getPhysdevProps2Func) {
+ validPhysicalDevices.erase(
+ std::remove_if(validPhysicalDevices.begin(), validPhysicalDevices.end(),
+ [getPhysdevProps2Func, this](VkPhysicalDevice physicalDevice) {
+ // We can get the device UUID.
+ VkPhysicalDeviceIDPropertiesKHR idProps = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR,
+ nullptr,
+ };
+ VkPhysicalDeviceProperties2KHR propsWithId = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR,
+ &idProps,
+ };
+ getPhysdevProps2Func(physicalDevice, &propsWithId);
+
+ // Remove those devices whose UUIDs don't match the one
+ // in VkCommonOperations.
+ return memcmp(m_emu->deviceInfo.idProps.deviceUUID,
+ idProps.deviceUUID, VK_UUID_SIZE) != 0;
+ }),
+ validPhysicalDevices.end());
+ } else {
+ fprintf(stderr,
+ "%s: warning: failed to "
+ "vkGetPhysicalDeviceProperties2KHR\n",
+ __func__);
+ }
+ } else {
+ // If we don't support ID properties then just advertise only the
+ // first physical device.
+ fprintf(stderr,
+ "%s: device id properties not supported, using first "
+ "physical device\n",
+ __func__);
+ }
+ if (!validPhysicalDevices.empty()) {
+ validPhysicalDevices.erase(std::next(validPhysicalDevices.begin()),
+ validPhysicalDevices.end());
+ }
+
+ if (physicalDeviceCount) {
+ *physicalDeviceCount = validPhysicalDevices.size();
+ }
+
+ if (physicalDeviceCount && physicalDevices) {
+ // Box them up
+ for (uint32_t i = 0; i < std::min(*physicalDeviceCount, physicalDevicesSize); ++i) {
+ mPhysicalDeviceToInstance[validPhysicalDevices[i]] = instance;
+
+ auto& physdevInfo = mPhysdevInfo[validPhysicalDevices[i]];
+
+ physdevInfo.boxed = new_boxed_VkPhysicalDevice(validPhysicalDevices[i], vk,
+ false /* does not own dispatch */);
+
+ vk->vkGetPhysicalDeviceProperties(validPhysicalDevices[i], &physdevInfo.props);
+
+ if (physdevInfo.props.apiVersion > kMaxSafeVersion) {
+ physdevInfo.props.apiVersion = kMaxSafeVersion;
+ }
+
+ vk->vkGetPhysicalDeviceMemoryProperties(validPhysicalDevices[i],
+ &physdevInfo.memoryProperties);
+
+ uint32_t queueFamilyPropCount = 0;
+
+ vk->vkGetPhysicalDeviceQueueFamilyProperties(validPhysicalDevices[i],
+ &queueFamilyPropCount, nullptr);
+
+ physdevInfo.queueFamilyProperties.resize((size_t)queueFamilyPropCount);
+
+ vk->vkGetPhysicalDeviceQueueFamilyProperties(
+ validPhysicalDevices[i], &queueFamilyPropCount,
+ physdevInfo.queueFamilyProperties.data());
+
+ physicalDevices[i] = (VkPhysicalDevice)physdevInfo.boxed;
+ }
+ if (physicalDevicesSize < *physicalDeviceCount) {
+ res = VK_INCOMPLETE;
+ }
+ }
+
+ return res;
+ }
+
+ void on_vkGetPhysicalDeviceFeatures(android::base::BumpPool* pool,
+ VkPhysicalDevice boxed_physicalDevice,
+ VkPhysicalDeviceFeatures* pFeatures) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+
+ vk->vkGetPhysicalDeviceFeatures(physicalDevice, pFeatures);
+ pFeatures->textureCompressionETC2 |= enableEmulatedEtc2(physicalDevice, vk);
+ pFeatures->textureCompressionASTC_LDR |= enableEmulatedAstc(physicalDevice, vk);
+ }
+
+ void on_vkGetPhysicalDeviceFeatures2(android::base::BumpPool* pool,
+ VkPhysicalDevice boxed_physicalDevice,
+ VkPhysicalDeviceFeatures2* pFeatures) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* physdevInfo = android::base::find(mPhysdevInfo, physicalDevice);
+ if (!physdevInfo) return;
+
+ auto instance = mPhysicalDeviceToInstance[physicalDevice];
+ auto* instanceInfo = android::base::find(mInstanceInfo, instance);
+ if (!instanceInfo) return;
+
+ if (instanceInfo->apiVersion >= VK_MAKE_VERSION(1, 1, 0) &&
+ physdevInfo->props.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ vk->vkGetPhysicalDeviceFeatures2(physicalDevice, pFeatures);
+ } else if (hasInstanceExtension(instance,
+ VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) {
+ vk->vkGetPhysicalDeviceFeatures2KHR(physicalDevice, pFeatures);
+ } else {
+ // No instance extension, fake it!!!!
+ if (pFeatures->pNext) {
+ fprintf(stderr,
+ "%s: Warning: Trying to use extension struct in "
+ "VkPhysicalDeviceFeatures2 without having enabled "
+ "the extension!!!!11111\n",
+ __func__);
+ }
+ *pFeatures = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
+ 0,
+ };
+ vk->vkGetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features);
+ }
+
+ pFeatures->features.textureCompressionETC2 |= enableEmulatedEtc2(physicalDevice, vk);
+ pFeatures->features.textureCompressionASTC_LDR |= enableEmulatedAstc(physicalDevice, vk);
+ VkPhysicalDeviceSamplerYcbcrConversionFeatures* ycbcrFeatures =
+ vk_find_struct<VkPhysicalDeviceSamplerYcbcrConversionFeatures>(pFeatures);
+ if (ycbcrFeatures != nullptr) {
+ ycbcrFeatures->samplerYcbcrConversion |= m_emu->enableYcbcrEmulation;
+ }
+ }
+
+ VkResult on_vkGetPhysicalDeviceImageFormatProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice boxed_physicalDevice, VkFormat format,
+ VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
+ VkImageFormatProperties* pImageFormatProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+ const bool emulatedTexture = isEmulatedCompressedTexture(format, physicalDevice, vk);
+ if (emulatedTexture) {
+ if (!supportEmulatedCompressedImageFormatProperty(format, type, tiling, usage, flags)) {
+ memset(pImageFormatProperties, 0, sizeof(VkImageFormatProperties));
+ return VK_ERROR_FORMAT_NOT_SUPPORTED;
+ }
+ flags &= ~VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT;
+ flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
+ usage |= VK_IMAGE_USAGE_STORAGE_BIT;
+ format = CompressedImageInfo::getCompressedMipmapsFormat(format);
+ }
+
+ VkResult res = vk->vkGetPhysicalDeviceImageFormatProperties(
+ physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
+ if (res != VK_SUCCESS) {
+ return res;
+ }
+ if (emulatedTexture) {
+ maskImageFormatPropertiesForEmulatedTextures(pImageFormatProperties);
+ }
+ return res;
+ }
+
+ VkResult on_vkGetPhysicalDeviceImageFormatProperties2(
+ android::base::BumpPool* pool, VkPhysicalDevice boxed_physicalDevice,
+ const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+ VkImageFormatProperties2* pImageFormatProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+ VkPhysicalDeviceImageFormatInfo2 imageFormatInfo;
+ VkFormat format = pImageFormatInfo->format;
+ const bool emulatedTexture = isEmulatedCompressedTexture(format, physicalDevice, vk);
+ if (emulatedTexture) {
+ if (!supportEmulatedCompressedImageFormatProperty(
+ pImageFormatInfo->format, pImageFormatInfo->type, pImageFormatInfo->tiling,
+ pImageFormatInfo->usage, pImageFormatInfo->flags)) {
+ memset(&pImageFormatProperties->imageFormatProperties, 0,
+ sizeof(VkImageFormatProperties));
+ return VK_ERROR_FORMAT_NOT_SUPPORTED;
+ }
+ imageFormatInfo = *pImageFormatInfo;
+ pImageFormatInfo = &imageFormatInfo;
+ imageFormatInfo.flags &= ~VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT;
+ imageFormatInfo.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
+ imageFormatInfo.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
+ imageFormatInfo.format = CompressedImageInfo::getCompressedMipmapsFormat(format);
+ }
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* physdevInfo = android::base::find(mPhysdevInfo, physicalDevice);
+ if (!physdevInfo) {
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ VkResult res = VK_ERROR_INITIALIZATION_FAILED;
+
+ auto instance = mPhysicalDeviceToInstance[physicalDevice];
+ auto* instanceInfo = android::base::find(mInstanceInfo, instance);
+ if (!instanceInfo) {
+ return res;
+ }
+
+ if (instanceInfo->apiVersion >= VK_MAKE_VERSION(1, 1, 0) &&
+ physdevInfo->props.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ res = vk->vkGetPhysicalDeviceImageFormatProperties2(physicalDevice, pImageFormatInfo,
+ pImageFormatProperties);
+ } else if (hasInstanceExtension(instance,
+ VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) {
+ res = vk->vkGetPhysicalDeviceImageFormatProperties2KHR(physicalDevice, pImageFormatInfo,
+ pImageFormatProperties);
+ } else {
+ // No instance extension, fake it!!!!
+ if (pImageFormatProperties->pNext) {
+ fprintf(stderr,
+ "%s: Warning: Trying to use extension struct in "
+ "VkPhysicalDeviceFeatures2 without having enabled "
+ "the extension!!!!11111\n",
+ __func__);
+ }
+ *pImageFormatProperties = {
+ VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2,
+ 0,
+ };
+ res = vk->vkGetPhysicalDeviceImageFormatProperties(
+ physicalDevice, pImageFormatInfo->format, pImageFormatInfo->type,
+ pImageFormatInfo->tiling, pImageFormatInfo->usage, pImageFormatInfo->flags,
+ &pImageFormatProperties->imageFormatProperties);
+ }
+ if (res != VK_SUCCESS) {
+ return res;
+ }
+
+ const VkPhysicalDeviceExternalImageFormatInfo* extImageFormatInfo =
+ vk_find_struct<VkPhysicalDeviceExternalImageFormatInfo>(pImageFormatInfo);
+ VkExternalImageFormatProperties* extImageFormatProps =
+ vk_find_struct<VkExternalImageFormatProperties>(pImageFormatProperties);
+
+ // Only allow dedicated allocations for external images.
+ if (extImageFormatInfo && extImageFormatProps) {
+ extImageFormatProps->externalMemoryProperties.externalMemoryFeatures |=
+ VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT;
+ }
+
+ if (emulatedTexture) {
+ maskImageFormatPropertiesForEmulatedTextures(
+ &pImageFormatProperties->imageFormatProperties);
+ }
+
+ return res;
+ }
+
+ void on_vkGetPhysicalDeviceFormatProperties(android::base::BumpPool* pool,
+ VkPhysicalDevice boxed_physicalDevice,
+ VkFormat format,
+ VkFormatProperties* pFormatProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+ getPhysicalDeviceFormatPropertiesCore<VkFormatProperties>(
+ [vk](VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties* pFormatProperties) {
+ vk->vkGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties);
+ },
+ vk, physicalDevice, format, pFormatProperties);
+ }
+
+ void on_vkGetPhysicalDeviceFormatProperties2(android::base::BumpPool* pool,
+ VkPhysicalDevice boxed_physicalDevice,
+ VkFormat format,
+ VkFormatProperties2* pFormatProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* physdevInfo = android::base::find(mPhysdevInfo, physicalDevice);
+ if (!physdevInfo) return;
+
+ auto instance = mPhysicalDeviceToInstance[physicalDevice];
+ auto* instanceInfo = android::base::find(mInstanceInfo, instance);
+ if (!instanceInfo) return;
+
+ if (instanceInfo->apiVersion >= VK_MAKE_VERSION(1, 1, 0) &&
+ physdevInfo->props.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ getPhysicalDeviceFormatPropertiesCore<VkFormatProperties2>(
+ [vk](VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties2* pFormatProperties) {
+ vk->vkGetPhysicalDeviceFormatProperties2(physicalDevice, format,
+ pFormatProperties);
+ },
+ vk, physicalDevice, format, pFormatProperties);
+ } else if (hasInstanceExtension(instance,
+ VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) {
+ getPhysicalDeviceFormatPropertiesCore<VkFormatProperties2>(
+ [vk](VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties2* pFormatProperties) {
+ vk->vkGetPhysicalDeviceFormatProperties2KHR(physicalDevice, format,
+ pFormatProperties);
+ },
+ vk, physicalDevice, format, pFormatProperties);
+ } else {
+ // No instance extension, fake it!!!!
+ if (pFormatProperties->pNext) {
+ fprintf(stderr,
+ "%s: Warning: Trying to use extension struct in "
+ "vkGetPhysicalDeviceFormatProperties2 without having "
+ "enabled the extension!!!!11111\n",
+ __func__);
+ }
+ pFormatProperties->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2;
+ getPhysicalDeviceFormatPropertiesCore<VkFormatProperties>(
+ [vk](VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties* pFormatProperties) {
+ vk->vkGetPhysicalDeviceFormatProperties(physicalDevice, format,
+ pFormatProperties);
+ },
+ vk, physicalDevice, format, &pFormatProperties->formatProperties);
+ }
+ }
+
+ void on_vkGetPhysicalDeviceProperties(android::base::BumpPool* pool,
+ VkPhysicalDevice boxed_physicalDevice,
+ VkPhysicalDeviceProperties* pProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+
+ vk->vkGetPhysicalDeviceProperties(physicalDevice, pProperties);
+
+ if (pProperties->apiVersion > kMaxSafeVersion) {
+ pProperties->apiVersion = kMaxSafeVersion;
+ }
+ }
+
+ void on_vkGetPhysicalDeviceProperties2(android::base::BumpPool* pool,
+ VkPhysicalDevice boxed_physicalDevice,
+ VkPhysicalDeviceProperties2* pProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* physdevInfo = android::base::find(mPhysdevInfo, physicalDevice);
+ if (!physdevInfo) return;
+
+ auto instance = mPhysicalDeviceToInstance[physicalDevice];
+ auto* instanceInfo = android::base::find(mInstanceInfo, instance);
+ if (!instanceInfo) return;
+
+ if (instanceInfo->apiVersion >= VK_MAKE_VERSION(1, 1, 0) &&
+ physdevInfo->props.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ vk->vkGetPhysicalDeviceProperties2(physicalDevice, pProperties);
+ } else if (hasInstanceExtension(instance,
+ VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) {
+ vk->vkGetPhysicalDeviceProperties2KHR(physicalDevice, pProperties);
+ } else {
+ // No instance extension, fake it!!!!
+ if (pProperties->pNext) {
+ fprintf(stderr,
+ "%s: Warning: Trying to use extension struct in "
+ "VkPhysicalDeviceProperties2 without having enabled "
+ "the extension!!!!11111\n",
+ __func__);
+ }
+ *pProperties = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
+ 0,
+ };
+ vk->vkGetPhysicalDeviceProperties(physicalDevice, &pProperties->properties);
+ }
+
+ if (pProperties->properties.apiVersion > kMaxSafeVersion) {
+ pProperties->properties.apiVersion = kMaxSafeVersion;
+ }
+ }
+
+ void on_vkGetPhysicalDeviceMemoryProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice boxed_physicalDevice,
+ VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+
+ vk->vkGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
+
+ // Pick a max heap size that will work around
+ // drivers that give bad suggestions (such as 0xFFFFFFFFFFFFFFFF for the heap size)
+ // plus won't break the bank on 32-bit userspace.
+ static constexpr VkDeviceSize kMaxSafeHeapSize = 2ULL * 1024ULL * 1024ULL * 1024ULL;
+
+ for (uint32_t i = 0; i < pMemoryProperties->memoryTypeCount; ++i) {
+ uint32_t heapIndex = pMemoryProperties->memoryTypes[i].heapIndex;
+ auto& heap = pMemoryProperties->memoryHeaps[heapIndex];
+
+ if (heap.size > kMaxSafeHeapSize) {
+ heap.size = kMaxSafeHeapSize;
+ }
+
+ if (!feature_is_enabled(kFeature_GLDirectMem) &&
+ !feature_is_enabled(kFeature_VirtioGpuNext)) {
+ pMemoryProperties->memoryTypes[i].propertyFlags =
+ pMemoryProperties->memoryTypes[i].propertyFlags &
+ ~(VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
+ }
+ }
+ }
+
+ void on_vkGetPhysicalDeviceMemoryProperties2(
+ android::base::BumpPool* pool, VkPhysicalDevice boxed_physicalDevice,
+ VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+
+ auto* physdevInfo = android::base::find(mPhysdevInfo, physicalDevice);
+ if (!physdevInfo) return;
+
+ auto instance = mPhysicalDeviceToInstance[physicalDevice];
+ auto* instanceInfo = android::base::find(mInstanceInfo, instance);
+ if (!instanceInfo) return;
+
+ if (instanceInfo->apiVersion >= VK_MAKE_VERSION(1, 1, 0) &&
+ physdevInfo->props.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ vk->vkGetPhysicalDeviceMemoryProperties2(physicalDevice, pMemoryProperties);
+ } else if (hasInstanceExtension(instance,
+ VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) {
+ vk->vkGetPhysicalDeviceMemoryProperties2KHR(physicalDevice, pMemoryProperties);
+ } else {
+ // No instance extension, fake it!!!!
+ if (pMemoryProperties->pNext) {
+ fprintf(stderr,
+ "%s: Warning: Trying to use extension struct in "
+ "VkPhysicalDeviceMemoryProperties2 without having enabled "
+ "the extension!!!!11111\n",
+ __func__);
+ }
+ *pMemoryProperties = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2,
+ 0,
+ };
+ vk->vkGetPhysicalDeviceMemoryProperties(physicalDevice,
+ &pMemoryProperties->memoryProperties);
+ }
+
+ // Pick a max heap size that will work around
+ // drivers that give bad suggestions (such as 0xFFFFFFFFFFFFFFFF for the heap size)
+ // plus won't break the bank on 32-bit userspace.
+ static constexpr VkDeviceSize kMaxSafeHeapSize = 2ULL * 1024ULL * 1024ULL * 1024ULL;
+
+ for (uint32_t i = 0; i < pMemoryProperties->memoryProperties.memoryTypeCount; ++i) {
+ uint32_t heapIndex = pMemoryProperties->memoryProperties.memoryTypes[i].heapIndex;
+ auto& heap = pMemoryProperties->memoryProperties.memoryHeaps[heapIndex];
+
+ if (heap.size > kMaxSafeHeapSize) {
+ heap.size = kMaxSafeHeapSize;
+ }
+
+ if (!feature_is_enabled(kFeature_GLDirectMem) &&
+ !feature_is_enabled(kFeature_VirtioGpuNext)) {
+ pMemoryProperties->memoryProperties.memoryTypes[i].propertyFlags =
+ pMemoryProperties->memoryProperties.memoryTypes[i].propertyFlags &
+ ~(VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
+ }
+ }
+ }
+
+ VkResult on_vkEnumerateDeviceExtensionProperties(android::base::BumpPool* pool,
+ VkPhysicalDevice boxed_physicalDevice,
+ const char* pLayerName,
+ uint32_t* pPropertyCount,
+ VkExtensionProperties* pProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+
+ bool shouldPassthrough = !m_emu->enableYcbcrEmulation;
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ shouldPassthrough = shouldPassthrough && !m_emu->instanceSupportsMoltenVK;
+#endif
+ if (shouldPassthrough) {
+ return vk->vkEnumerateDeviceExtensionProperties(physicalDevice, pLayerName,
+ pPropertyCount, pProperties);
+ }
+
+ // If MoltenVK is supported on host, we need to ensure that we include
+ // VK_MVK_moltenvk extenstion in returned properties.
+ std::vector<VkExtensionProperties> properties;
+ VkResult result =
+ enumerateDeviceExtensionProperties(vk, physicalDevice, pLayerName, properties);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ if (m_emu->instanceSupportsMoltenVK &&
+ !hasDeviceExtension(properties, VK_MVK_MOLTENVK_EXTENSION_NAME)) {
+ VkExtensionProperties mvk_props;
+ strncpy(mvk_props.extensionName, VK_MVK_MOLTENVK_EXTENSION_NAME,
+ sizeof(mvk_props.extensionName));
+ mvk_props.specVersion = VK_MVK_MOLTENVK_SPEC_VERSION;
+ properties.push_back(mvk_props);
+ }
+#endif
+
+ if (m_emu->enableYcbcrEmulation &&
+ !hasDeviceExtension(properties, VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME)) {
+ VkExtensionProperties ycbcr_props;
+ strncpy(ycbcr_props.extensionName, VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME,
+ sizeof(ycbcr_props.extensionName));
+ ycbcr_props.specVersion = VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION;
+ properties.push_back(ycbcr_props);
+ }
+ if (pProperties == nullptr) {
+ *pPropertyCount = properties.size();
+ } else {
+ // return number of structures actually written to pProperties.
+ *pPropertyCount = std::min((uint32_t)properties.size(), *pPropertyCount);
+ memcpy(pProperties, properties.data(), *pPropertyCount * sizeof(VkExtensionProperties));
+ }
+ return *pPropertyCount < properties.size() ? VK_INCOMPLETE : VK_SUCCESS;
+ }
+
+ VkResult on_vkCreateDevice(android::base::BumpPool* pool, VkPhysicalDevice boxed_physicalDevice,
+ const VkDeviceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) {
+ if (mLogging) {
+ fprintf(stderr, "%s: begin\n", __func__);
+ }
+
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+ auto vk = dispatch_VkPhysicalDevice(boxed_physicalDevice);
+
+ std::vector<const char*> finalExts =
+ filteredDeviceExtensionNames(vk, physicalDevice, pCreateInfo->enabledExtensionCount,
+ pCreateInfo->ppEnabledExtensionNames);
+
+ // Run the underlying API call, filtering extensions.
+ VkDeviceCreateInfo createInfoFiltered = *pCreateInfo;
+ // According to the spec, it seems that the application can use compressed texture formats
+ // without enabling the feature when creating the VkDevice, as long as
+ // vkGetPhysicalDeviceFormatProperties and vkGetPhysicalDeviceImageFormatProperties reports
+ // support: to query for additional properties, or if the feature is not enabled,
+ // vkGetPhysicalDeviceFormatProperties and vkGetPhysicalDeviceImageFormatProperties can be
+ // used to check for supported properties of individual formats as normal.
+ bool emulateTextureEtc2 = needEmulatedEtc2(physicalDevice, vk);
+ bool emulateTextureAstc = needEmulatedAstc(physicalDevice, vk);
+ VkPhysicalDeviceFeatures featuresFiltered;
+ std::vector<VkPhysicalDeviceFeatures*> featuresToFilter;
+
+ if (pCreateInfo->pEnabledFeatures) {
+ featuresFiltered = *pCreateInfo->pEnabledFeatures;
+ createInfoFiltered.pEnabledFeatures = &featuresFiltered;
+ featuresToFilter.emplace_back(&featuresFiltered);
+ }
+
+ if (VkPhysicalDeviceFeatures2* features2 =
+ vk_find_struct<VkPhysicalDeviceFeatures2>(&createInfoFiltered)) {
+ featuresToFilter.emplace_back(&features2->features);
+ }
+
+ for (VkPhysicalDeviceFeatures* feature : featuresToFilter) {
+ if (emulateTextureEtc2) {
+ feature->textureCompressionETC2 = VK_FALSE;
+ }
+ if (emulateTextureAstc) {
+ feature->textureCompressionASTC_LDR = VK_FALSE;
+ }
+ }
+
+ if (auto* ycbcrFeatures = vk_find_struct<VkPhysicalDeviceSamplerYcbcrConversionFeatures>(
+ &createInfoFiltered)) {
+ if (m_emu->enableYcbcrEmulation && !m_emu->deviceInfo.supportsSamplerYcbcrConversion) {
+ ycbcrFeatures->samplerYcbcrConversion = VK_FALSE;
+ }
+ }
+
+ if (auto* swapchainMaintenance1Features =
+ vk_find_struct<VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT>(
+ &createInfoFiltered)) {
+ if (!supportsSwapchainMaintenance1(physicalDevice, vk)) {
+ swapchainMaintenance1Features->swapchainMaintenance1 = VK_FALSE;
+ }
+ }
+
+ createInfoFiltered.enabledExtensionCount = (uint32_t)finalExts.size();
+ createInfoFiltered.ppEnabledExtensionNames = finalExts.data();
+
+ // bug: 155795731
+ bool swiftshader =
+ (android::base::getEnvironmentVariable("ANDROID_EMU_VK_ICD").compare("swiftshader") ==
+ 0);
+
+ std::unique_ptr<std::lock_guard<std::recursive_mutex>> lock = nullptr;
+
+ if (swiftshader) {
+ if (mLogging) {
+ fprintf(stderr, "%s: acquire lock\n", __func__);
+ }
+ lock = std::make_unique<std::lock_guard<std::recursive_mutex>>(mLock);
+ }
+
+ if (mLogging) {
+ fprintf(stderr, "%s: got lock, calling host\n", __func__);
+ }
+
+ VkResult result =
+ vk->vkCreateDevice(physicalDevice, &createInfoFiltered, pAllocator, pDevice);
+
+ if (mLogging) {
+ fprintf(stderr, "%s: host returned. result: %d\n", __func__, result);
+ }
+
+ if (result != VK_SUCCESS) return result;
+
+ if (mLogging) {
+ fprintf(stderr, "%s: track the new device (begin)\n", __func__);
+ }
+
+ if (!swiftshader) {
+ lock = std::make_unique<std::lock_guard<std::recursive_mutex>>(mLock);
+ }
+
+ mDeviceToPhysicalDevice[*pDevice] = physicalDevice;
+
+ // Fill out information about the logical device here.
+ auto& deviceInfo = mDeviceInfo[*pDevice];
+ deviceInfo.physicalDevice = physicalDevice;
+ deviceInfo.emulateTextureEtc2 = emulateTextureEtc2;
+ deviceInfo.emulateTextureAstc = emulateTextureAstc;
+ deviceInfo.useAstcCpuDecompression =
+ m_emu->astcLdrEmulationMode == AstcEmulationMode::Cpu &&
+ AstcCpuDecompressor::get().available();
+ deviceInfo.decompPipelines =
+ std::make_unique<GpuDecompressionPipelineManager>(m_vk, *pDevice);
+ INFO("Created new VkDevice. ASTC emulation? %d. CPU decoding? %d",
+ deviceInfo.emulateTextureAstc, deviceInfo.useAstcCpuDecompression);
+
+ for (uint32_t i = 0; i < createInfoFiltered.enabledExtensionCount; ++i) {
+ deviceInfo.enabledExtensionNames.push_back(
+ createInfoFiltered.ppEnabledExtensionNames[i]);
+ }
+
+ // First, get the dispatch table.
+ VkDevice boxed = new_boxed_VkDevice(*pDevice, nullptr, true /* own dispatch */);
+
+ if (mLogging) {
+ fprintf(stderr, "%s: init vulkan dispatch from device\n", __func__);
+ }
+
+ VulkanDispatch* dispatch = dispatch_VkDevice(boxed);
+ init_vulkan_dispatch_from_device(vk, *pDevice, dispatch);
+ if (m_emu->debugUtilsAvailableAndRequested) {
+ deviceInfo.debugUtilsHelper = DebugUtilsHelper::withUtilsEnabled(*pDevice, dispatch);
+ }
+
+ deviceInfo.externalFencePool =
+ std::make_unique<ExternalFencePool<VulkanDispatch>>(dispatch, *pDevice);
+
+ if (mLogging) {
+ fprintf(stderr, "%s: init vulkan dispatch from device (end)\n", __func__);
+ }
+
+ deviceInfo.boxed = boxed;
+
+ // Next, get information about the queue families used by this device.
+ std::unordered_map<uint32_t, uint32_t> queueFamilyIndexCounts;
+ for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i) {
+ const auto& queueCreateInfo = pCreateInfo->pQueueCreateInfos[i];
+ // Check only queues created with flags = 0 in VkDeviceQueueCreateInfo.
+ auto flags = queueCreateInfo.flags;
+ if (flags) continue;
+ uint32_t queueFamilyIndex = queueCreateInfo.queueFamilyIndex;
+ uint32_t queueCount = queueCreateInfo.queueCount;
+ queueFamilyIndexCounts[queueFamilyIndex] = queueCount;
+ }
+
+ for (auto it : queueFamilyIndexCounts) {
+ auto index = it.first;
+ auto count = it.second;
+ auto& queues = deviceInfo.queues[index];
+ for (uint32_t i = 0; i < count; ++i) {
+ VkQueue queueOut;
+
+ if (mLogging) {
+ fprintf(stderr, "%s: get device queue (begin)\n", __func__);
+ }
+
+ vk->vkGetDeviceQueue(*pDevice, index, i, &queueOut);
+
+ if (mLogging) {
+ fprintf(stderr, "%s: get device queue (end)\n", __func__);
+ }
+ queues.push_back(queueOut);
+ mQueueInfo[queueOut].device = *pDevice;
+ mQueueInfo[queueOut].queueFamilyIndex = index;
+
+ auto boxed = new_boxed_VkQueue(queueOut, dispatch_VkDevice(deviceInfo.boxed),
+ false /* does not own dispatch */);
+ mQueueInfo[queueOut].boxed = boxed;
+ mQueueInfo[queueOut].lock = new Lock;
+ }
+ }
+
+ // Box the device.
+ *pDevice = (VkDevice)deviceInfo.boxed;
+
+ if (mLogging) {
+ fprintf(stderr, "%s: (end)\n", __func__);
+ }
+
+ return VK_SUCCESS;
+ }
+
+ void on_vkGetDeviceQueue(android::base::BumpPool* pool, VkDevice boxed_device,
+ uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue) {
+ auto device = unbox_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ *pQueue = VK_NULL_HANDLE;
+
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return;
+
+ const auto& queues = deviceInfo->queues;
+
+ const auto* queueList = android::base::find(queues, queueFamilyIndex);
+ if (!queueList) return;
+ if (queueIndex >= queueList->size()) return;
+
+ VkQueue unboxedQueue = (*queueList)[queueIndex];
+
+ auto* queueInfo = android::base::find(mQueueInfo, unboxedQueue);
+ if (!queueInfo) return;
+
+ *pQueue = (VkQueue)queueInfo->boxed;
+ }
+
+ void on_vkGetDeviceQueue2(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) {
+ // Protected memory is not supported on emulators. So we should
+ // not return any queue if a client requests a protected device
+ // queue.
+ if (pQueueInfo->flags & VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT) {
+ *pQueue = VK_NULL_HANDLE;
+ fprintf(stderr, "%s: Cannot get protected Vulkan device queue\n", __func__);
+ return;
+ }
+ uint32_t queueFamilyIndex = pQueueInfo->queueFamilyIndex;
+ uint32_t queueIndex = pQueueInfo->queueIndex;
+ on_vkGetDeviceQueue(pool, boxed_device, queueFamilyIndex, queueIndex, pQueue);
+ }
+
+ void destroyDeviceLocked(VkDevice device, const VkAllocationCallbacks* pAllocator) {
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return;
+
+ deviceInfo->decompPipelines->clear();
+
+ auto eraseIt = mQueueInfo.begin();
+ for (; eraseIt != mQueueInfo.end();) {
+ if (eraseIt->second.device == device) {
+ delete eraseIt->second.lock;
+ delete_VkQueue(eraseIt->second.boxed);
+ eraseIt = mQueueInfo.erase(eraseIt);
+ } else {
+ ++eraseIt;
+ }
+ }
+
+ VulkanDispatch* deviceDispatch = dispatch_VkDevice(deviceInfo->boxed);
+
+ // Destroy pooled external fences
+ auto deviceFences = deviceInfo->externalFencePool->popAll();
+ for (auto fence : deviceFences) {
+ deviceDispatch->vkDestroyFence(device, fence, pAllocator);
+ mFenceInfo.erase(fence);
+ }
+
+ for (auto fence : findDeviceObjects(device, mFenceInfo)) {
+ deviceDispatch->vkDestroyFence(device, fence, pAllocator);
+ mFenceInfo.erase(fence);
+ }
+
+ // Run the underlying API call.
+ m_vk->vkDestroyDevice(device, pAllocator);
+
+ delete_VkDevice(deviceInfo->boxed);
+ }
+
+ void on_vkDestroyDevice(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ sBoxedHandleManager.processDelayedRemovesGlobalStateLocked(device);
+ destroyDeviceLocked(device, pAllocator);
+
+ mDeviceInfo.erase(device);
+ mDeviceToPhysicalDevice.erase(device);
+ }
+
+ VkResult on_vkCreateBuffer(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkBufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VkResult result = vk->vkCreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
+
+ if (result == VK_SUCCESS) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto& bufInfo = mBufferInfo[*pBuffer];
+ bufInfo.device = device;
+ bufInfo.size = pCreateInfo->size;
+ *pBuffer = new_boxed_non_dispatchable_VkBuffer(*pBuffer);
+ }
+
+ return result;
+ }
+
+ void on_vkDestroyBuffer(android::base::BumpPool* pool, VkDevice boxed_device, VkBuffer buffer,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ vk->vkDestroyBuffer(device, buffer, pAllocator);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ mBufferInfo.erase(buffer);
+ }
+
+ void setBufferMemoryBindInfoLocked(VkBuffer buffer, VkDeviceMemory memory,
+ VkDeviceSize memoryOffset) {
+ auto* bufferInfo = android::base::find(mBufferInfo, buffer);
+ if (!bufferInfo) return;
+ bufferInfo->memory = memory;
+ bufferInfo->memoryOffset = memoryOffset;
+ }
+
+ VkResult on_vkBindBufferMemory(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkBuffer buffer, VkDeviceMemory memory,
+ VkDeviceSize memoryOffset) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VALIDATE_REQUIRED_HANDLE(memory);
+ VkResult result = vk->vkBindBufferMemory(device, buffer, memory, memoryOffset);
+
+ if (result == VK_SUCCESS) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ setBufferMemoryBindInfoLocked(buffer, memory, memoryOffset);
+ }
+ return result;
+ }
+
+ VkResult on_vkBindBufferMemory2(android::base::BumpPool* pool, VkDevice boxed_device,
+ uint32_t bindInfoCount,
+ const VkBindBufferMemoryInfo* pBindInfos) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ for (uint32_t i = 0; i < bindInfoCount; ++i) {
+ VALIDATE_REQUIRED_HANDLE(pBindInfos[i].memory);
+ }
+ VkResult result = vk->vkBindBufferMemory2(device, bindInfoCount, pBindInfos);
+
+ if (result == VK_SUCCESS) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ for (uint32_t i = 0; i < bindInfoCount; ++i) {
+ setBufferMemoryBindInfoLocked(pBindInfos[i].buffer, pBindInfos[i].memory,
+ pBindInfos[i].memoryOffset);
+ }
+ }
+
+ return result;
+ }
+
+ VkResult on_vkBindBufferMemory2KHR(android::base::BumpPool* pool, VkDevice boxed_device,
+ uint32_t bindInfoCount,
+ const VkBindBufferMemoryInfo* pBindInfos) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ for (uint32_t i = 0; i < bindInfoCount; ++i) {
+ VALIDATE_REQUIRED_HANDLE(pBindInfos[i].memory);
+ }
+ VkResult result = vk->vkBindBufferMemory2KHR(device, bindInfoCount, pBindInfos);
+
+ if (result == VK_SUCCESS) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ for (uint32_t i = 0; i < bindInfoCount; ++i) {
+ setBufferMemoryBindInfoLocked(pBindInfos[i].buffer, pBindInfos[i].memory,
+ pBindInfos[i].memoryOffset);
+ }
+ }
+
+ return result;
+ }
+
+ VkResult on_vkCreateImage(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkImageCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkImage* pImage) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) {
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ if (deviceInfo->imageFormats.find(pCreateInfo->format) == deviceInfo->imageFormats.end()) {
+ INFO("gfxstream_texture_format_manifest: %s", string_VkFormat(pCreateInfo->format));
+ deviceInfo->imageFormats.insert(pCreateInfo->format);
+ }
+
+ const bool needDecompression = deviceInfo->needEmulatedDecompression(pCreateInfo->format);
+ CompressedImageInfo cmpInfo =
+ needDecompression
+ ? CompressedImageInfo(device, *pCreateInfo, deviceInfo->decompPipelines.get())
+ : CompressedImageInfo(device);
+ VkImageCreateInfo decompInfo;
+ if (needDecompression) {
+ decompInfo = cmpInfo.getOutputCreateInfo(*pCreateInfo);
+ pCreateInfo = &decompInfo;
+ }
+
+ auto anbInfo = std::make_unique<AndroidNativeBufferInfo>();
+ const VkNativeBufferANDROID* nativeBufferANDROID =
+ vk_find_struct<VkNativeBufferANDROID>(pCreateInfo);
+
+ VkResult createRes = VK_SUCCESS;
+
+ if (nativeBufferANDROID) {
+ auto memProps = memPropsOfDeviceLocked(device);
+
+ createRes =
+ prepareAndroidNativeBufferImage(vk, device, *pool, pCreateInfo, nativeBufferANDROID,
+ pAllocator, memProps, anbInfo.get());
+ if (createRes == VK_SUCCESS) {
+ *pImage = anbInfo->image;
+ }
+ } else {
+ createRes = vk->vkCreateImage(device, pCreateInfo, pAllocator, pImage);
+ }
+
+ if (createRes != VK_SUCCESS) return createRes;
+
+ if (needDecompression) {
+ cmpInfo.setOutputImage(*pImage);
+ cmpInfo.createCompressedMipmapImages(vk, *pCreateInfo);
+
+ if (cmpInfo.isAstc()) {
+ if (deviceInfo->useAstcCpuDecompression) {
+ cmpInfo.initAstcCpuDecompression(m_vk, mDeviceInfo[device].physicalDevice);
+ }
+ }
+ }
+
+ auto& imageInfo = mImageInfo[*pImage];
+ imageInfo.device = device;
+ imageInfo.cmpInfo = std::move(cmpInfo);
+ imageInfo.imageCreateInfoShallow = vk_make_orphan_copy(*pCreateInfo);
+ if (nativeBufferANDROID) imageInfo.anbInfo = std::move(anbInfo);
+
+ *pImage = new_boxed_non_dispatchable_VkImage(*pImage);
+ return createRes;
+ }
+
+ void destroyImageLocked(VkDevice device, VulkanDispatch* deviceDispatch, VkImage image,
+ const VkAllocationCallbacks* pAllocator) {
+ auto* imageInfo = android::base::find(mImageInfo, image);
+ if (!imageInfo) return;
+
+ if (!imageInfo->anbInfo) {
+ imageInfo->cmpInfo.destroy(deviceDispatch);
+ if (image != imageInfo->cmpInfo.outputImage()) {
+ deviceDispatch->vkDestroyImage(device, image, pAllocator);
+ }
+ }
+ mImageInfo.erase(image);
+ }
+
+ void on_vkDestroyImage(android::base::BumpPool* pool, VkDevice boxed_device, VkImage image,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ destroyImageLocked(device, deviceDispatch, image, pAllocator);
+ }
+
+ VkResult performBindImageMemoryDeferredAhb(android::base::BumpPool* pool,
+ VkDevice boxed_device,
+ const VkBindImageMemoryInfo* bimi) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ auto original_underlying_image = bimi->image;
+ auto original_boxed_image = unboxed_to_boxed_non_dispatchable_VkImage(original_underlying_image);
+
+ VkImageCreateInfo ici = {};
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* imageInfo = android::base::find(mImageInfo, original_underlying_image);
+ if (!imageInfo) {
+ ERR("Image for deferred AHB bind does not exist.");
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ ici = imageInfo->imageCreateInfoShallow;
+ }
+
+ ici.pNext = vk_find_struct<VkNativeBufferANDROID>(bimi);
+ if (!ici.pNext) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Missing VkNativeBufferANDROID for deferred AHB bind.";
+ }
+
+ VkImage boxed_replacement_image = VK_NULL_HANDLE;
+ VkResult result = on_vkCreateImage(pool, boxed_device, &ici, nullptr, &boxed_replacement_image);
+ if (result != VK_SUCCESS) {
+ ERR("Failed to create image for deferred AHB bind.");
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ on_vkDestroyImage(pool, boxed_device, original_underlying_image, nullptr);
+
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto underlying_replacement_image = unbox_VkImage(boxed_replacement_image);
+ delete_VkImage(boxed_replacement_image);
+ set_boxed_non_dispatchable_VkImage(original_boxed_image, underlying_replacement_image);
+ }
+
+ return VK_SUCCESS;
+ }
+
+ VkResult performBindImageMemory(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkBindImageMemoryInfo* bimi) {
+ auto image = bimi->image;
+ auto memory = bimi->memory;
+ auto memoryOffset = bimi->memoryOffset;
+
+ const auto* anb = vk_find_struct<VkNativeBufferANDROID>(bimi);
+ if (memory == VK_NULL_HANDLE && anb != nullptr) {
+ return performBindImageMemoryDeferredAhb(pool, boxed_device, bimi);
+ }
+
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VALIDATE_REQUIRED_HANDLE(memory);
+ VkResult result = vk->vkBindImageMemory(device, image, memory, memoryOffset);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+ auto* memoryInfo = android::base::find(mMemoryInfo, memory);
+ if (!memoryInfo) return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+ auto* imageInfo = android::base::find(mImageInfo, image);
+ if (imageInfo) {
+ imageInfo->boundColorBuffer = memoryInfo->boundColorBuffer;
+ }
+
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ if (memoryInfo->mtlTexture) {
+ result = m_vk->vkSetMTLTextureMVK(image, memoryInfo->mtlTexture);
+ if (result != VK_SUCCESS) {
+ fprintf(stderr, "vkSetMTLTexture failed\n");
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ }
+#endif
+ if (!deviceInfo->emulateTextureEtc2 && !deviceInfo->emulateTextureAstc) {
+ return VK_SUCCESS;
+ }
+
+ if (!imageInfo) return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+ CompressedImageInfo& cmpInfo = imageInfo->cmpInfo;
+ if (!deviceInfo->needEmulatedDecompression(cmpInfo)) {
+ return VK_SUCCESS;
+ }
+ return cmpInfo.bindCompressedMipmapsMemory(vk, memory, memoryOffset);
+ }
+
+ VkResult on_vkBindImageMemory(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) {
+ const VkBindImageMemoryInfo bimi = {
+ .sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO,
+ .pNext = nullptr,
+ .image = image,
+ .memory = memory,
+ .memoryOffset = memoryOffset,
+ };
+ return performBindImageMemory(pool, boxed_device, &bimi);
+ }
+
+ VkResult on_vkBindImageMemory2(android::base::BumpPool* pool, VkDevice boxed_device,
+ uint32_t bindInfoCount,
+ const VkBindImageMemoryInfo* pBindInfos) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ bool needEmulation = false;
+
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return VK_ERROR_UNKNOWN;
+
+ for (uint32_t i = 0; i < bindInfoCount; i++) {
+ auto* imageInfo = android::base::find(mImageInfo, pBindInfos[i].image);
+ if (!imageInfo) return VK_ERROR_UNKNOWN;
+
+ const auto* anb = vk_find_struct<VkNativeBufferANDROID>(&pBindInfos[i]);
+ if (anb != nullptr) {
+ needEmulation = true;
+ break;
+ }
+
+ if (deviceInfo->needEmulatedDecompression(imageInfo->cmpInfo)) {
+ needEmulation = true;
+ break;
+ }
+ }
+
+ if (needEmulation) {
+ VkResult result;
+ for (uint32_t i = 0; i < bindInfoCount; i++) {
+ result = performBindImageMemory(pool, boxed_device, &pBindInfos[i]);
+ if (result != VK_SUCCESS) return result;
+ }
+
+ return VK_SUCCESS;
+ }
+
+ return vk->vkBindImageMemory2(device, bindInfoCount, pBindInfos);
+ }
+
+ VkResult on_vkCreateImageView(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkImageViewCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkImageView* pView) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ if (!pCreateInfo) {
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ auto* imageInfo = android::base::find(mImageInfo, pCreateInfo->image);
+ if (!deviceInfo || !imageInfo) return VK_ERROR_OUT_OF_HOST_MEMORY;
+ VkImageViewCreateInfo createInfo;
+ bool needEmulatedAlpha = false;
+ if (deviceInfo->needEmulatedDecompression(pCreateInfo->format)) {
+ if (imageInfo->cmpInfo.outputImage()) {
+ createInfo = *pCreateInfo;
+ createInfo.format = CompressedImageInfo::getOutputFormat(pCreateInfo->format);
+ needEmulatedAlpha = CompressedImageInfo::needEmulatedAlpha(pCreateInfo->format);
+ createInfo.image = imageInfo->cmpInfo.outputImage();
+ pCreateInfo = &createInfo;
+ }
+ } else if (deviceInfo->needEmulatedDecompression(imageInfo->cmpInfo)) {
+ // Image view on the compressed mipmaps
+ createInfo = *pCreateInfo;
+ createInfo.format =
+ CompressedImageInfo::getCompressedMipmapsFormat(pCreateInfo->format);
+ needEmulatedAlpha = false;
+ createInfo.image =
+ imageInfo->cmpInfo.compressedMipmap(pCreateInfo->subresourceRange.baseMipLevel);
+ createInfo.subresourceRange.baseMipLevel = 0;
+ pCreateInfo = &createInfo;
+ }
+ if (imageInfo->anbInfo && imageInfo->anbInfo->externallyBacked) {
+ createInfo = *pCreateInfo;
+ pCreateInfo = &createInfo;
+ }
+
+ VkResult result = vk->vkCreateImageView(device, pCreateInfo, pAllocator, pView);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+ auto& imageViewInfo = mImageViewInfo[*pView];
+ imageViewInfo.device = device;
+ imageViewInfo.needEmulatedAlpha = needEmulatedAlpha;
+ imageViewInfo.boundColorBuffer = imageInfo->boundColorBuffer;
+
+ *pView = new_boxed_non_dispatchable_VkImageView(*pView);
+
+ return result;
+ }
+
+ void on_vkDestroyImageView(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkImageView imageView, const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ vk->vkDestroyImageView(device, imageView, pAllocator);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ mImageViewInfo.erase(imageView);
+ }
+
+ VkResult on_vkCreateSampler(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkSamplerCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkSampler* pSampler) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ VkResult result = vk->vkCreateSampler(device, pCreateInfo, pAllocator, pSampler);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto& samplerInfo = mSamplerInfo[*pSampler];
+ samplerInfo.device = device;
+ deepcopy_VkSamplerCreateInfo(&samplerInfo.pool, VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
+ pCreateInfo, &samplerInfo.createInfo);
+ // We emulate RGB with RGBA for some compressed textures, which does not
+ // handle translarent border correctly.
+ samplerInfo.needEmulatedAlpha =
+ (pCreateInfo->addressModeU == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER ||
+ pCreateInfo->addressModeV == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER ||
+ pCreateInfo->addressModeW == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER) &&
+ (pCreateInfo->borderColor == VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK ||
+ pCreateInfo->borderColor == VK_BORDER_COLOR_INT_TRANSPARENT_BLACK ||
+ pCreateInfo->borderColor == VK_BORDER_COLOR_FLOAT_CUSTOM_EXT ||
+ pCreateInfo->borderColor == VK_BORDER_COLOR_INT_CUSTOM_EXT);
+
+ *pSampler = new_boxed_non_dispatchable_VkSampler(*pSampler);
+
+ return result;
+ }
+
+ void destroySamplerLocked(VkDevice device, VulkanDispatch* deviceDispatch, VkSampler sampler,
+ const VkAllocationCallbacks* pAllocator) {
+ deviceDispatch->vkDestroySampler(device, sampler, pAllocator);
+
+ auto* samplerInfo = android::base::find(mSamplerInfo, sampler);
+ if (!samplerInfo) return;
+
+ if (samplerInfo->emulatedborderSampler != VK_NULL_HANDLE) {
+ deviceDispatch->vkDestroySampler(device, samplerInfo->emulatedborderSampler, nullptr);
+ }
+ mSamplerInfo.erase(sampler);
+ }
+
+ void on_vkDestroySampler(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkSampler sampler, const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ destroySamplerLocked(device, deviceDispatch, sampler, pAllocator);
+ }
+
+ VkResult on_vkCreateSemaphore(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkSemaphoreCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkSemaphore* pSemaphore) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VkSemaphoreCreateInfo localCreateInfo = vk_make_orphan_copy(*pCreateInfo);
+ vk_struct_chain_iterator structChainIter = vk_make_chain_iterator(&localCreateInfo);
+
+ VkSemaphoreTypeCreateInfoKHR localSemaphoreTypeCreateInfo;
+ if (const VkSemaphoreTypeCreateInfoKHR* semaphoreTypeCiPtr =
+ vk_find_struct<VkSemaphoreTypeCreateInfoKHR>(pCreateInfo);
+ semaphoreTypeCiPtr) {
+ localSemaphoreTypeCreateInfo = vk_make_orphan_copy(*semaphoreTypeCiPtr);
+ vk_append_struct(&structChainIter, &localSemaphoreTypeCreateInfo);
+ }
+
+ const VkExportSemaphoreCreateInfoKHR* exportCiPtr =
+ vk_find_struct<VkExportSemaphoreCreateInfoKHR>(pCreateInfo);
+ VkExportSemaphoreCreateInfoKHR localSemaphoreCreateInfo;
+
+ if (exportCiPtr) {
+ localSemaphoreCreateInfo = vk_make_orphan_copy(*exportCiPtr);
+
+#ifdef _WIN32
+ if (localSemaphoreCreateInfo.handleTypes) {
+ localSemaphoreCreateInfo.handleTypes =
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR;
+ }
+#endif
+
+ vk_append_struct(&structChainIter, &localSemaphoreCreateInfo);
+ }
+
+ VkResult res = vk->vkCreateSemaphore(device, &localCreateInfo, pAllocator, pSemaphore);
+
+ if (res != VK_SUCCESS) return res;
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto& semaphoreInfo = mSemaphoreInfo[*pSemaphore];
+ semaphoreInfo.device = device;
+
+ *pSemaphore = new_boxed_non_dispatchable_VkSemaphore(*pSemaphore);
+
+ return res;
+ }
+
+ VkResult on_vkCreateFence(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkFenceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkFence* pFence) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VkFenceCreateInfo& createInfo = const_cast<VkFenceCreateInfo&>(*pCreateInfo);
+
+ const VkExportFenceCreateInfo* exportFenceInfoPtr =
+ vk_find_struct<VkExportFenceCreateInfo>(pCreateInfo);
+ bool exportSyncFd = exportFenceInfoPtr && (exportFenceInfoPtr->handleTypes &
+ VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT);
+ bool fenceReused = false;
+
+ *pFence = VK_NULL_HANDLE;
+
+ if (exportSyncFd) {
+ // Remove VkExportFenceCreateInfo, since host doesn't need to create
+ // an exportable fence in this case
+ ExternalFencePool<VulkanDispatch>* externalFencePool = nullptr;
+ vk_struct_chain_remove(exportFenceInfoPtr, &createInfo);
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return VK_ERROR_OUT_OF_HOST_MEMORY;
+ externalFencePool = deviceInfo->externalFencePool.get();
+ }
+ *pFence = externalFencePool->pop(pCreateInfo);
+ if (*pFence != VK_NULL_HANDLE) {
+ fenceReused = true;
+ }
+ }
+
+ if (*pFence == VK_NULL_HANDLE) {
+ VkResult res = vk->vkCreateFence(device, &createInfo, pAllocator, pFence);
+ if (res != VK_SUCCESS) {
+ return res;
+ }
+ }
+
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ DCHECK(fenceReused || mFenceInfo.find(*pFence) == mFenceInfo.end());
+ // Create FenceInfo for *pFence.
+ auto& fenceInfo = mFenceInfo[*pFence];
+ fenceInfo.device = device;
+ fenceInfo.vk = vk;
+
+ *pFence = new_boxed_non_dispatchable_VkFence(*pFence);
+ fenceInfo.boxed = *pFence;
+ fenceInfo.external = exportSyncFd;
+ fenceInfo.state = FenceInfo::State::kNotWaitable;
+ }
+
+ return VK_SUCCESS;
+ }
+
+ VkResult on_vkResetFences(android::base::BumpPool* pool, VkDevice boxed_device,
+ uint32_t fenceCount, const VkFence* pFences) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ std::vector<VkFence> cleanedFences;
+ std::vector<VkFence> externalFences;
+
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ for (uint32_t i = 0; i < fenceCount; i++) {
+ if (pFences[i] == VK_NULL_HANDLE) continue;
+
+ DCHECK(mFenceInfo.find(pFences[i]) != mFenceInfo.end());
+ if (mFenceInfo[pFences[i]].external) {
+ externalFences.push_back(pFences[i]);
+ } else {
+ // Reset all fences' states to kNotWaitable.
+ cleanedFences.push_back(pFences[i]);
+ mFenceInfo[pFences[i]].state = FenceInfo::State::kNotWaitable;
+ }
+ }
+ }
+
+ if (!cleanedFences.empty()) {
+ VK_CHECK(vk->vkResetFences(device, (uint32_t)cleanedFences.size(),
+ cleanedFences.data()));
+ }
+
+ // For external fences, we unilaterally put them in the pool to ensure they finish
+ // TODO: should store creation info / pNext chain per fence and re-apply?
+ VkFenceCreateInfo createInfo{
+ .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, .pNext = 0, .flags = 0};
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ for (auto fence : externalFences) {
+ VkFence replacement = deviceInfo->externalFencePool->pop(&createInfo);
+ if (replacement == VK_NULL_HANDLE) {
+ VK_CHECK(vk->vkCreateFence(device, &createInfo, 0, &replacement));
+ }
+ deviceInfo->externalFencePool->add(fence);
+
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto boxed_fence = unboxed_to_boxed_non_dispatchable_VkFence(fence);
+ delete_VkFence(boxed_fence);
+ set_boxed_non_dispatchable_VkFence(boxed_fence, replacement);
+
+ auto& fenceInfo = mFenceInfo[replacement];
+ fenceInfo.device = device;
+ fenceInfo.vk = vk;
+ fenceInfo.boxed = boxed_fence;
+ fenceInfo.external = true;
+ fenceInfo.state = FenceInfo::State::kNotWaitable;
+
+ mFenceInfo[fence].boxed = VK_NULL_HANDLE;
+ }
+ }
+
+ return VK_SUCCESS;
+ }
+
+ VkResult on_vkImportSemaphoreFdKHR(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+#ifdef _WIN32
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* infoPtr = android::base::find(mSemaphoreInfo,
+ mExternalSemaphoresById[pImportSemaphoreFdInfo->fd]);
+
+ if (!infoPtr) {
+ return VK_ERROR_INVALID_EXTERNAL_HANDLE;
+ }
+
+ VK_EXT_SYNC_HANDLE handle = dupExternalSync(infoPtr->externalHandle);
+
+ VkImportSemaphoreWin32HandleInfoKHR win32ImportInfo = {
+ VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR,
+ 0,
+ pImportSemaphoreFdInfo->semaphore,
+ pImportSemaphoreFdInfo->flags,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR,
+ handle,
+ L"",
+ };
+
+ return vk->vkImportSemaphoreWin32HandleKHR(device, &win32ImportInfo);
+#else
+ if (!hasDeviceExtension(device, VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME)) {
+ // Note: VK_KHR_external_semaphore_fd might be advertised in the guest,
+ // because SYNC_FD handling is performed guest-side only. But still need
+ // need to error out here when handling a non-sync, opaque FD.
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ VkImportSemaphoreFdInfoKHR importInfo = *pImportSemaphoreFdInfo;
+ importInfo.fd = dup(pImportSemaphoreFdInfo->fd);
+ return vk->vkImportSemaphoreFdKHR(device, &importInfo);
+#endif
+ }
+
+ VkResult on_vkGetSemaphoreFdKHR(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+#ifdef _WIN32
+ VkSemaphoreGetWin32HandleInfoKHR getWin32 = {
+ VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR,
+ 0,
+ pGetFdInfo->semaphore,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT,
+ };
+ VK_EXT_SYNC_HANDLE handle;
+ VkResult result = vk->vkGetSemaphoreWin32HandleKHR(device, &getWin32, &handle);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ mSemaphoreInfo[pGetFdInfo->semaphore].externalHandle = handle;
+ int nextId = genSemaphoreId();
+ mExternalSemaphoresById[nextId] = pGetFdInfo->semaphore;
+ *pFd = nextId;
+#else
+ if (!hasDeviceExtension(device, VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME)) {
+ // Note: VK_KHR_external_semaphore_fd might be advertised in the guest,
+ // because SYNC_FD handling is performed guest-side only. But still need
+ // need to error out here when handling a non-sync, opaque FD.
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ VkResult result = vk->vkGetSemaphoreFdKHR(device, pGetFdInfo, pFd);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ mSemaphoreInfo[pGetFdInfo->semaphore].externalHandle = *pFd;
+ // No next id; its already an fd
+#endif
+ return result;
+ }
+
+ void destroySemaphoreLocked(VkDevice device, VulkanDispatch* deviceDispatch,
+ VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) {
+#ifndef _WIN32
+ const auto& ite = mSemaphoreInfo.find(semaphore);
+ if (ite != mSemaphoreInfo.end() &&
+ (ite->second.externalHandle != VK_EXT_SYNC_HANDLE_INVALID)) {
+ close(ite->second.externalHandle);
+ }
+#endif
+ deviceDispatch->vkDestroySemaphore(device, semaphore, pAllocator);
+
+ mSemaphoreInfo.erase(semaphore);
+ }
+
+ void on_vkDestroySemaphore(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ destroySemaphoreLocked(device, deviceDispatch, semaphore, pAllocator);
+ }
+
+ void on_vkDestroyFence(android::base::BumpPool* pool, VkDevice boxed_device, VkFence fence,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ // External fences are just slated for recycling. This addresses known
+ // behavior where the guest might destroy the fence prematurely. b/228221208
+ if (mFenceInfo[fence].external) {
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (deviceInfo) {
+ deviceInfo->externalFencePool->add(fence);
+ mFenceInfo[fence].boxed = VK_NULL_HANDLE;
+ return;
+ }
+ }
+ mFenceInfo.erase(fence);
+ }
+
+ vk->vkDestroyFence(device, fence, pAllocator);
+ }
+
+ VkResult on_vkCreateDescriptorSetLayout(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorSetLayout* pSetLayout) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ auto res = vk->vkCreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
+
+ if (res == VK_SUCCESS) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto& info = mDescriptorSetLayoutInfo[*pSetLayout];
+ info.device = device;
+ *pSetLayout = new_boxed_non_dispatchable_VkDescriptorSetLayout(*pSetLayout);
+ info.boxed = *pSetLayout;
+
+ info.createInfo = *pCreateInfo;
+ for (uint32_t i = 0; i < pCreateInfo->bindingCount; ++i) {
+ info.bindings.push_back(pCreateInfo->pBindings[i]);
+ }
+ }
+
+ return res;
+ }
+
+ void on_vkDestroyDescriptorSetLayout(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorSetLayout descriptorSetLayout,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ vk->vkDestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ mDescriptorSetLayoutInfo.erase(descriptorSetLayout);
+ }
+
+ VkResult on_vkCreateDescriptorPool(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDescriptorPoolCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorPool* pDescriptorPool) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ auto res = vk->vkCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool);
+
+ if (res == VK_SUCCESS) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto& info = mDescriptorPoolInfo[*pDescriptorPool];
+ info.device = device;
+ *pDescriptorPool = new_boxed_non_dispatchable_VkDescriptorPool(*pDescriptorPool);
+ info.boxed = *pDescriptorPool;
+ info.createInfo = *pCreateInfo;
+ info.maxSets = pCreateInfo->maxSets;
+ info.usedSets = 0;
+
+ for (uint32_t i = 0; i < pCreateInfo->poolSizeCount; ++i) {
+ DescriptorPoolInfo::PoolState state;
+ state.type = pCreateInfo->pPoolSizes[i].type;
+ state.descriptorCount = pCreateInfo->pPoolSizes[i].descriptorCount;
+ state.used = 0;
+ info.pools.push_back(state);
+ }
+
+ if (feature_is_enabled(kFeature_VulkanBatchedDescriptorSetUpdate)) {
+ for (uint32_t i = 0; i < pCreateInfo->maxSets; ++i) {
+ info.poolIds.push_back(
+ (uint64_t)new_boxed_non_dispatchable_VkDescriptorSet(VK_NULL_HANDLE));
+ }
+ }
+ }
+
+ return res;
+ }
+
+ void cleanupDescriptorPoolAllocedSetsLocked(VkDescriptorPool descriptorPool,
+ bool isDestroy = false) {
+ auto* info = android::base::find(mDescriptorPoolInfo, descriptorPool);
+ if (!info) return;
+
+ for (auto it : info->allocedSetsToBoxed) {
+ auto unboxedSet = it.first;
+ auto boxedSet = it.second;
+ mDescriptorSetInfo.erase(unboxedSet);
+ if (!feature_is_enabled(kFeature_VulkanBatchedDescriptorSetUpdate)) {
+ delete_VkDescriptorSet(boxedSet);
+ }
+ }
+
+ if (feature_is_enabled(kFeature_VulkanBatchedDescriptorSetUpdate)) {
+ if (isDestroy) {
+ for (auto poolId : info->poolIds) {
+ delete_VkDescriptorSet((VkDescriptorSet)poolId);
+ }
+ } else {
+ for (auto poolId : info->poolIds) {
+ auto handleInfo = sBoxedHandleManager.get(poolId);
+ if (handleInfo)
+ handleInfo->underlying = reinterpret_cast<uint64_t>(VK_NULL_HANDLE);
+ }
+ }
+ }
+
+ info->usedSets = 0;
+ info->allocedSetsToBoxed.clear();
+
+ for (auto& pool : info->pools) {
+ pool.used = 0;
+ }
+ }
+
+ void on_vkDestroyDescriptorPool(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorPool descriptorPool,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ vk->vkDestroyDescriptorPool(device, descriptorPool, pAllocator);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ cleanupDescriptorPoolAllocedSetsLocked(descriptorPool, true /* destroy */);
+ mDescriptorPoolInfo.erase(descriptorPool);
+ }
+
+ VkResult on_vkResetDescriptorPool(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorPool descriptorPool,
+ VkDescriptorPoolResetFlags flags) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ auto res = vk->vkResetDescriptorPool(device, descriptorPool, flags);
+
+ if (res == VK_SUCCESS) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ cleanupDescriptorPoolAllocedSetsLocked(descriptorPool);
+ }
+
+ return res;
+ }
+
+ void initDescriptorSetInfoLocked(VkDescriptorPool pool, VkDescriptorSetLayout setLayout,
+ uint64_t boxedDescriptorSet, VkDescriptorSet descriptorSet) {
+ auto* poolInfo = android::base::find(mDescriptorPoolInfo, pool);
+ if (!poolInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Cannot find poolInfo";
+ }
+
+ auto* setLayoutInfo = android::base::find(mDescriptorSetLayoutInfo, setLayout);
+ if (!setLayoutInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Cannot find setLayout";
+ }
+
+ auto& setInfo = mDescriptorSetInfo[descriptorSet];
+
+ setInfo.pool = pool;
+ setInfo.bindings = setLayoutInfo->bindings;
+
+ poolInfo->allocedSetsToBoxed[descriptorSet] = (VkDescriptorSet)boxedDescriptorSet;
+ applyDescriptorSetAllocationLocked(*poolInfo, setInfo.bindings);
+ }
+
+ VkResult on_vkAllocateDescriptorSets(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDescriptorSetAllocateInfo* pAllocateInfo,
+ VkDescriptorSet* pDescriptorSets) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto allocValidationRes = validateDescriptorSetAllocLocked(pAllocateInfo);
+ if (allocValidationRes != VK_SUCCESS) return allocValidationRes;
+
+ auto res = vk->vkAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets);
+
+ if (res == VK_SUCCESS) {
+ auto* poolInfo =
+ android::base::find(mDescriptorPoolInfo, pAllocateInfo->descriptorPool);
+ if (!poolInfo) return res;
+
+ for (uint32_t i = 0; i < pAllocateInfo->descriptorSetCount; ++i) {
+ auto unboxed = pDescriptorSets[i];
+ pDescriptorSets[i] = new_boxed_non_dispatchable_VkDescriptorSet(pDescriptorSets[i]);
+ initDescriptorSetInfoLocked(pAllocateInfo->descriptorPool,
+ pAllocateInfo->pSetLayouts[i],
+ (uint64_t)(pDescriptorSets[i]), unboxed);
+ }
+ }
+
+ return res;
+ }
+
+ VkResult on_vkFreeDescriptorSets(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorPool descriptorPool, uint32_t descriptorSetCount,
+ const VkDescriptorSet* pDescriptorSets) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ auto res =
+ vk->vkFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets);
+
+ if (res == VK_SUCCESS) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ for (uint32_t i = 0; i < descriptorSetCount; ++i) {
+ auto* setInfo = android::base::find(mDescriptorSetInfo, pDescriptorSets[i]);
+ if (!setInfo) continue;
+ auto* poolInfo = android::base::find(mDescriptorPoolInfo, setInfo->pool);
+ if (!poolInfo) continue;
+
+ removeDescriptorSetAllocationLocked(*poolInfo, setInfo->bindings);
+
+ auto descSetAllocedEntry =
+ android::base::find(poolInfo->allocedSetsToBoxed, pDescriptorSets[i]);
+ if (!descSetAllocedEntry) continue;
+
+ auto handleInfo = sBoxedHandleManager.get((uint64_t)*descSetAllocedEntry);
+ if (handleInfo) {
+ if (feature_is_enabled(kFeature_VulkanBatchedDescriptorSetUpdate)) {
+ handleInfo->underlying = reinterpret_cast<uint64_t>(VK_NULL_HANDLE);
+ } else {
+ delete_VkDescriptorSet(*descSetAllocedEntry);
+ }
+ }
+
+ poolInfo->allocedSetsToBoxed.erase(pDescriptorSets[i]);
+
+ mDescriptorSetInfo.erase(pDescriptorSets[i]);
+ }
+ }
+
+ return res;
+ }
+
+ void on_vkUpdateDescriptorSets(android::base::BumpPool* pool, VkDevice boxed_device,
+ uint32_t descriptorWriteCount,
+ const VkWriteDescriptorSet* pDescriptorWrites,
+ uint32_t descriptorCopyCount,
+ const VkCopyDescriptorSet* pDescriptorCopies) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ on_vkUpdateDescriptorSetsImpl(pool, vk, device, descriptorWriteCount, pDescriptorWrites,
+ descriptorCopyCount, pDescriptorCopies);
+ }
+
+ void on_vkUpdateDescriptorSetsImpl(android::base::BumpPool* pool, VulkanDispatch* vk,
+ VkDevice device, uint32_t descriptorWriteCount,
+ const VkWriteDescriptorSet* pDescriptorWrites,
+ uint32_t descriptorCopyCount,
+ const VkCopyDescriptorSet* pDescriptorCopies) {
+ bool needEmulateWriteDescriptor = false;
+ // c++ seems to allow for 0-size array allocation
+ std::unique_ptr<bool[]> descriptorWritesNeedDeepCopy(new bool[descriptorWriteCount]);
+ for (uint32_t i = 0; i < descriptorWriteCount; i++) {
+ const VkWriteDescriptorSet& descriptorWrite = pDescriptorWrites[i];
+ descriptorWritesNeedDeepCopy[i] = false;
+ if (!vk_util::vk_descriptor_type_has_image_view(descriptorWrite.descriptorType)) {
+ continue;
+ }
+ for (uint32_t j = 0; j < descriptorWrite.descriptorCount; j++) {
+ const VkDescriptorImageInfo& imageInfo = descriptorWrite.pImageInfo[j];
+ const auto* imgViewInfo = android::base::find(mImageViewInfo, imageInfo.imageView);
+ if (!imgViewInfo) {
+ continue;
+ }
+ if (imgViewInfo->boundColorBuffer) {
+ // TODO(igorc): Move this to vkQueueSubmit time.
+ auto fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->invalidateColorBufferForVk(imgViewInfo->boundColorBuffer);
+ }
+ }
+ if (descriptorWrite.descriptorType != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) {
+ continue;
+ }
+ const auto* samplerInfo = android::base::find(mSamplerInfo, imageInfo.sampler);
+ if (samplerInfo && imgViewInfo->needEmulatedAlpha &&
+ samplerInfo->needEmulatedAlpha) {
+ needEmulateWriteDescriptor = true;
+ descriptorWritesNeedDeepCopy[i] = true;
+ break;
+ }
+ }
+ }
+ if (!needEmulateWriteDescriptor) {
+ vk->vkUpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites,
+ descriptorCopyCount, pDescriptorCopies);
+ return;
+ }
+ std::list<std::unique_ptr<VkDescriptorImageInfo[]>> imageInfoPool;
+ std::unique_ptr<VkWriteDescriptorSet[]> descriptorWrites(
+ new VkWriteDescriptorSet[descriptorWriteCount]);
+ for (uint32_t i = 0; i < descriptorWriteCount; i++) {
+ const VkWriteDescriptorSet& srcDescriptorWrite = pDescriptorWrites[i];
+ VkWriteDescriptorSet& dstDescriptorWrite = descriptorWrites[i];
+ // Shallow copy first
+ dstDescriptorWrite = srcDescriptorWrite;
+ if (!descriptorWritesNeedDeepCopy[i]) {
+ continue;
+ }
+ // Deep copy
+ assert(dstDescriptorWrite.descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
+ imageInfoPool.emplace_back(
+ new VkDescriptorImageInfo[dstDescriptorWrite.descriptorCount]);
+ VkDescriptorImageInfo* imageInfos = imageInfoPool.back().get();
+ memcpy(imageInfos, srcDescriptorWrite.pImageInfo,
+ dstDescriptorWrite.descriptorCount * sizeof(VkDescriptorImageInfo));
+ dstDescriptorWrite.pImageInfo = imageInfos;
+ for (uint32_t j = 0; j < dstDescriptorWrite.descriptorCount; j++) {
+ VkDescriptorImageInfo& imageInfo = imageInfos[j];
+ const auto* imgViewInfo = android::base::find(mImageViewInfo, imageInfo.imageView);
+ auto* samplerInfo = android::base::find(mSamplerInfo, imageInfo.sampler);
+ if (!imgViewInfo || !samplerInfo) continue;
+ if (imgViewInfo->needEmulatedAlpha && samplerInfo->needEmulatedAlpha) {
+ if (samplerInfo->emulatedborderSampler == VK_NULL_HANDLE) {
+ // create the emulated sampler
+ VkSamplerCreateInfo createInfo;
+ deepcopy_VkSamplerCreateInfo(pool, VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
+ &samplerInfo->createInfo, &createInfo);
+ switch (createInfo.borderColor) {
+ case VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK:
+ createInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK;
+ break;
+ case VK_BORDER_COLOR_INT_TRANSPARENT_BLACK:
+ createInfo.borderColor = VK_BORDER_COLOR_INT_OPAQUE_BLACK;
+ break;
+ case VK_BORDER_COLOR_FLOAT_CUSTOM_EXT:
+ case VK_BORDER_COLOR_INT_CUSTOM_EXT: {
+ VkSamplerCustomBorderColorCreateInfoEXT*
+ customBorderColorCreateInfo =
+ vk_find_struct<VkSamplerCustomBorderColorCreateInfoEXT>(
+ &createInfo);
+ if (customBorderColorCreateInfo) {
+ switch (createInfo.borderColor) {
+ case VK_BORDER_COLOR_FLOAT_CUSTOM_EXT:
+ customBorderColorCreateInfo->customBorderColor
+ .float32[3] = 1.0f;
+ break;
+ case VK_BORDER_COLOR_INT_CUSTOM_EXT:
+ customBorderColorCreateInfo->customBorderColor
+ .int32[3] = 128;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ vk->vkCreateSampler(device, &createInfo, nullptr,
+ &samplerInfo->emulatedborderSampler);
+ }
+ imageInfo.sampler = samplerInfo->emulatedborderSampler;
+ }
+ }
+ }
+ vk->vkUpdateDescriptorSets(device, descriptorWriteCount, descriptorWrites.get(),
+ descriptorCopyCount, pDescriptorCopies);
+ }
+
+ VkResult on_vkCreateShaderModule(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkShaderModuleCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkShaderModule* pShaderModule) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ VkResult result =
+ deviceDispatch->vkCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto& shaderModuleInfo = mShaderModuleInfo[*pShaderModule];
+ shaderModuleInfo.device = device;
+
+ *pShaderModule = new_boxed_non_dispatchable_VkShaderModule(*pShaderModule);
+
+ return result;
+ }
+
+ void destroyShaderModuleLocked(VkDevice device, VulkanDispatch* deviceDispatch,
+ VkShaderModule shaderModule,
+ const VkAllocationCallbacks* pAllocator) {
+ deviceDispatch->vkDestroyShaderModule(device, shaderModule, pAllocator);
+
+ mShaderModuleInfo.erase(shaderModule);
+ }
+
+ void on_vkDestroyShaderModule(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkShaderModule shaderModule,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ destroyShaderModuleLocked(device, deviceDispatch, shaderModule, pAllocator);
+ }
+
+ VkResult on_vkCreatePipelineCache(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkPipelineCacheCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkPipelineCache* pPipelineCache) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ VkResult result =
+ deviceDispatch->vkCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto& pipelineCacheInfo = mPipelineCacheInfo[*pPipelineCache];
+ pipelineCacheInfo.device = device;
+
+ *pPipelineCache = new_boxed_non_dispatchable_VkPipelineCache(*pPipelineCache);
+
+ return result;
+ }
+
+ void destroyPipelineCacheLocked(VkDevice device, VulkanDispatch* deviceDispatch,
+ VkPipelineCache pipelineCache,
+ const VkAllocationCallbacks* pAllocator) {
+ deviceDispatch->vkDestroyPipelineCache(device, pipelineCache, pAllocator);
+
+ mPipelineCacheInfo.erase(pipelineCache);
+ }
+
+ void on_vkDestroyPipelineCache(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkPipelineCache pipelineCache,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ destroyPipelineCacheLocked(device, deviceDispatch, pipelineCache, pAllocator);
+ }
+
+ VkResult on_vkCreateGraphicsPipelines(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkPipelineCache pipelineCache, uint32_t createInfoCount,
+ const VkGraphicsPipelineCreateInfo* pCreateInfos,
+ const VkAllocationCallbacks* pAllocator,
+ VkPipeline* pPipelines) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ VkResult result = deviceDispatch->vkCreateGraphicsPipelines(
+ device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
+ if (result != VK_SUCCESS && result != VK_PIPELINE_COMPILE_REQUIRED) {
+ return result;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ for (uint32_t i = 0; i < createInfoCount; i++) {
+ if (!pPipelines[i]) {
+ continue;
+ }
+ auto& pipelineInfo = mPipelineInfo[pPipelines[i]];
+ pipelineInfo.device = device;
+
+ pPipelines[i] = new_boxed_non_dispatchable_VkPipeline(pPipelines[i]);
+ }
+
+ return result;
+ }
+
+ void destroyPipelineLocked(VkDevice device, VulkanDispatch* deviceDispatch, VkPipeline pipeline,
+ const VkAllocationCallbacks* pAllocator) {
+ deviceDispatch->vkDestroyPipeline(device, pipeline, pAllocator);
+
+ mPipelineInfo.erase(pipeline);
+ }
+
+ void on_vkDestroyPipeline(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ destroyPipelineLocked(device, deviceDispatch, pipeline, pAllocator);
+ }
+
+ void on_vkCmdCopyImage(android::base::BumpPool* pool, VkCommandBuffer boxed_commandBuffer,
+ VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkImageCopy* pRegions) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* srcImg = android::base::find(mImageInfo, srcImage);
+ auto* dstImg = android::base::find(mImageInfo, dstImage);
+ if (!srcImg || !dstImg) return;
+
+ VkDevice device = srcImg->cmpInfo.device();
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return;
+
+ bool needEmulatedSrc = deviceInfo->needEmulatedDecompression(srcImg->cmpInfo);
+ bool needEmulatedDst = deviceInfo->needEmulatedDecompression(dstImg->cmpInfo);
+ if (!needEmulatedSrc && !needEmulatedDst) {
+ vk->vkCmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout,
+ regionCount, pRegions);
+ return;
+ }
+ VkImage srcImageMip = srcImage;
+ VkImage dstImageMip = dstImage;
+ for (uint32_t r = 0; r < regionCount; r++) {
+ if (needEmulatedSrc) {
+ srcImageMip = srcImg->cmpInfo.compressedMipmap(pRegions[r].srcSubresource.mipLevel);
+ }
+ if (needEmulatedDst) {
+ dstImageMip = dstImg->cmpInfo.compressedMipmap(pRegions[r].dstSubresource.mipLevel);
+ }
+ VkImageCopy region = CompressedImageInfo::getCompressedMipmapsImageCopy(
+ pRegions[r], srcImg->cmpInfo, dstImg->cmpInfo, needEmulatedSrc, needEmulatedDst);
+ vk->vkCmdCopyImage(commandBuffer, srcImageMip, srcImageLayout, dstImageMip,
+ dstImageLayout, 1, &region);
+ }
+ }
+
+ void on_vkCmdCopyImageToBuffer(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer, VkImage srcImage,
+ VkImageLayout srcImageLayout, VkBuffer dstBuffer,
+ uint32_t regionCount, const VkBufferImageCopy* pRegions) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* imageInfo = android::base::find(mImageInfo, srcImage);
+ auto* bufferInfo = android::base::find(mBufferInfo, dstBuffer);
+ if (!imageInfo || !bufferInfo) return;
+ auto* deviceInfo = android::base::find(mDeviceInfo, bufferInfo->device);
+ if (!deviceInfo) return;
+ CompressedImageInfo& cmpInfo = imageInfo->cmpInfo;
+ if (!deviceInfo->needEmulatedDecompression(cmpInfo)) {
+ vk->vkCmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer,
+ regionCount, pRegions);
+ return;
+ }
+ for (uint32_t r = 0; r < regionCount; r++) {
+ uint32_t mipLevel = pRegions[r].imageSubresource.mipLevel;
+ VkBufferImageCopy region = cmpInfo.getBufferImageCopy(pRegions[r]);
+ vk->vkCmdCopyImageToBuffer(commandBuffer, cmpInfo.compressedMipmap(mipLevel),
+ srcImageLayout, dstBuffer, 1, &region);
+ }
+ }
+
+ void on_vkCmdCopyImage2(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkCopyImageInfo2* pCopyImageInfo) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* srcImg = android::base::find(mImageInfo, pCopyImageInfo->srcImage);
+ auto* dstImg = android::base::find(mImageInfo, pCopyImageInfo->dstImage);
+ if (!srcImg || !dstImg) return;
+
+ VkDevice device = srcImg->cmpInfo.device();
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return;
+
+ bool needEmulatedSrc = deviceInfo->needEmulatedDecompression(srcImg->cmpInfo);
+ bool needEmulatedDst = deviceInfo->needEmulatedDecompression(dstImg->cmpInfo);
+ if (!needEmulatedSrc && !needEmulatedDst) {
+ vk->vkCmdCopyImage2(commandBuffer, pCopyImageInfo);
+ return;
+ }
+ VkImage srcImageMip = pCopyImageInfo->srcImage;
+ VkImage dstImageMip = pCopyImageInfo->dstImage;
+ for (uint32_t r = 0; r < pCopyImageInfo->regionCount; r++) {
+ if (needEmulatedSrc) {
+ srcImageMip = srcImg->cmpInfo.compressedMipmap(pCopyImageInfo->pRegions[r].srcSubresource.mipLevel);
+ }
+ if (needEmulatedDst) {
+ dstImageMip = dstImg->cmpInfo.compressedMipmap(pCopyImageInfo->pRegions[r].dstSubresource.mipLevel);
+ }
+
+ VkCopyImageInfo2 inf2 = *pCopyImageInfo;
+ inf2.regionCount = 1;
+ inf2.srcImage = srcImageMip;
+ inf2.dstImage = dstImageMip;
+
+ VkImageCopy2 region = CompressedImageInfo::getCompressedMipmapsImageCopy(
+ pCopyImageInfo->pRegions[r], srcImg->cmpInfo, dstImg->cmpInfo, needEmulatedSrc, needEmulatedDst);
+ inf2.pRegions = &region;
+
+ vk->vkCmdCopyImage2(commandBuffer, &inf2);
+ }
+ }
+
+ void on_vkCmdCopyImageToBuffer2(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* imageInfo = android::base::find(mImageInfo, pCopyImageToBufferInfo->srcImage);
+ auto* bufferInfo = android::base::find(mBufferInfo, pCopyImageToBufferInfo->dstBuffer);
+ if (!imageInfo || !bufferInfo) return;
+ auto* deviceInfo = android::base::find(mDeviceInfo, bufferInfo->device);
+ if (!deviceInfo) return;
+ CompressedImageInfo& cmpInfo = imageInfo->cmpInfo;
+ if (!deviceInfo->needEmulatedDecompression(cmpInfo)) {
+ vk->vkCmdCopyImageToBuffer2(commandBuffer, pCopyImageToBufferInfo);
+ return;
+ }
+ for (uint32_t r = 0; r < pCopyImageToBufferInfo->regionCount; r++) {
+ uint32_t mipLevel = pCopyImageToBufferInfo->pRegions[r].imageSubresource.mipLevel;
+ VkBufferImageCopy2 region = cmpInfo.getBufferImageCopy(pCopyImageToBufferInfo->pRegions[r]);
+ VkCopyImageToBufferInfo2 inf = *pCopyImageToBufferInfo;
+ inf.regionCount = 1;
+ inf.pRegions = &region;
+ inf.srcImage = cmpInfo.compressedMipmap(mipLevel);
+
+ vk->vkCmdCopyImageToBuffer2(commandBuffer, &inf);
+ }
+ }
+
+ void on_vkCmdCopyImage2KHR(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkCopyImageInfo2KHR* pCopyImageInfo) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* srcImg = android::base::find(mImageInfo, pCopyImageInfo->srcImage);
+ auto* dstImg = android::base::find(mImageInfo, pCopyImageInfo->dstImage);
+ if (!srcImg || !dstImg) return;
+
+ VkDevice device = srcImg->cmpInfo.device();
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return;
+
+ bool needEmulatedSrc = deviceInfo->needEmulatedDecompression(srcImg->cmpInfo);
+ bool needEmulatedDst = deviceInfo->needEmulatedDecompression(dstImg->cmpInfo);
+ if (!needEmulatedSrc && !needEmulatedDst) {
+ vk->vkCmdCopyImage2KHR(commandBuffer, pCopyImageInfo);
+ return;
+ }
+ VkImage srcImageMip = pCopyImageInfo->srcImage;
+ VkImage dstImageMip = pCopyImageInfo->dstImage;
+ for (uint32_t r = 0; r < pCopyImageInfo->regionCount; r++) {
+ if (needEmulatedSrc) {
+ srcImageMip = srcImg->cmpInfo.compressedMipmap(pCopyImageInfo->pRegions[r].srcSubresource.mipLevel);
+ }
+ if (needEmulatedDst) {
+ dstImageMip = dstImg->cmpInfo.compressedMipmap(pCopyImageInfo->pRegions[r].dstSubresource.mipLevel);
+ }
+
+ VkCopyImageInfo2KHR inf2 = *pCopyImageInfo;
+ inf2.regionCount = 1;
+ inf2.srcImage = srcImageMip;
+ inf2.dstImage = dstImageMip;
+
+ VkImageCopy2KHR region = CompressedImageInfo::getCompressedMipmapsImageCopy(
+ pCopyImageInfo->pRegions[r], srcImg->cmpInfo, dstImg->cmpInfo, needEmulatedSrc, needEmulatedDst);
+ inf2.pRegions = &region;
+
+ vk->vkCmdCopyImage2KHR(commandBuffer, &inf2);
+ }
+ }
+
+ void on_vkCmdCopyImageToBuffer2KHR(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* imageInfo = android::base::find(mImageInfo, pCopyImageToBufferInfo->srcImage);
+ auto* bufferInfo = android::base::find(mBufferInfo, pCopyImageToBufferInfo->dstBuffer);
+ if (!imageInfo || !bufferInfo) return;
+ auto* deviceInfo = android::base::find(mDeviceInfo, bufferInfo->device);
+ if (!deviceInfo) return;
+ CompressedImageInfo& cmpInfo = imageInfo->cmpInfo;
+ if (!deviceInfo->needEmulatedDecompression(cmpInfo)) {
+ vk->vkCmdCopyImageToBuffer2KHR(commandBuffer, pCopyImageToBufferInfo);
+ return;
+ }
+ for (uint32_t r = 0; r < pCopyImageToBufferInfo->regionCount; r++) {
+ uint32_t mipLevel = pCopyImageToBufferInfo->pRegions[r].imageSubresource.mipLevel;
+ VkBufferImageCopy2KHR region = cmpInfo.getBufferImageCopy(pCopyImageToBufferInfo->pRegions[r]);
+ VkCopyImageToBufferInfo2KHR inf = *pCopyImageToBufferInfo;
+ inf.regionCount = 1;
+ inf.pRegions = &region;
+ inf.srcImage = cmpInfo.compressedMipmap(mipLevel);
+
+ vk->vkCmdCopyImageToBuffer2KHR(commandBuffer, &inf);
+ }
+ }
+
+ void on_vkGetImageMemoryRequirements(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkImage image, VkMemoryRequirements* pMemoryRequirements) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ vk->vkGetImageMemoryRequirements(device, image, pMemoryRequirements);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ updateImageMemorySizeLocked(device, image, pMemoryRequirements);
+ }
+
+ void on_vkGetImageMemoryRequirements2(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkImageMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto physicalDevice = mDeviceToPhysicalDevice[device];
+ auto* physdevInfo = android::base::find(mPhysdevInfo, physicalDevice);
+ if (!physdevInfo) {
+ // If this fails, we crash, as we assume that the memory properties
+ // map should have the info.
+ // fprintf(stderr, "%s: Could not get image memory requirement for VkPhysicalDevice\n");
+ }
+
+ if ((physdevInfo->props.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
+ vk->vkGetImageMemoryRequirements2) {
+ vk->vkGetImageMemoryRequirements2(device, pInfo, pMemoryRequirements);
+ } else if (hasDeviceExtension(device, VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME)) {
+ vk->vkGetImageMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
+ } else {
+ if (pInfo->pNext) {
+ ERR("Warning: trying to use extension struct in VkMemoryRequirements2 without "
+ "having enabled the extension!");
+ }
+
+ vk->vkGetImageMemoryRequirements(device, pInfo->image,
+ &pMemoryRequirements->memoryRequirements);
+ }
+ updateImageMemorySizeLocked(device, pInfo->image, &pMemoryRequirements->memoryRequirements);
+ }
+
+ void on_vkGetBufferMemoryRequirements(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkBuffer buffer,
+ VkMemoryRequirements* pMemoryRequirements) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ vk->vkGetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
+ }
+
+ void on_vkGetBufferMemoryRequirements2(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkBufferMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* physicalDevice = android::base::find(mDeviceToPhysicalDevice, device);
+ if (!physicalDevice) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "No physical device available for " << device;
+ }
+
+ auto* physicalDeviceInfo = android::base::find(mPhysdevInfo, *physicalDevice);
+ if (!physicalDeviceInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "No physical device info available for " << *physicalDevice;
+ }
+
+ if ((physicalDeviceInfo->props.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) &&
+ vk->vkGetBufferMemoryRequirements2) {
+ vk->vkGetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements);
+ } else if (hasDeviceExtension(device, VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME)) {
+ vk->vkGetBufferMemoryRequirements2KHR(device, pInfo, pMemoryRequirements);
+ } else {
+ if (pInfo->pNext) {
+ ERR("Warning: trying to use extension struct in VkMemoryRequirements2 without "
+ "having enabled the extension!");
+ }
+
+ vk->vkGetBufferMemoryRequirements(device, pInfo->buffer,
+ &pMemoryRequirements->memoryRequirements);
+ }
+ }
+
+ void on_vkCmdCopyBufferToImage(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer, VkBuffer srcBuffer,
+ VkImage dstImage, VkImageLayout dstImageLayout,
+ uint32_t regionCount, const VkBufferImageCopy* pRegions,
+ const VkDecoderContext& context) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* imageInfo = android::base::find(mImageInfo, dstImage);
+ if (!imageInfo) return;
+ auto* bufferInfo = android::base::find(mBufferInfo, srcBuffer);
+ if (!bufferInfo) {
+ return;
+ }
+ VkDevice device = bufferInfo->device;
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) {
+ return;
+ }
+ if (!deviceInfo->needEmulatedDecompression(imageInfo->cmpInfo)) {
+ vk->vkCmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout,
+ regionCount, pRegions);
+ return;
+ }
+ auto* cmdBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (!cmdBufferInfo) {
+ return;
+ }
+ CompressedImageInfo& cmpInfo = imageInfo->cmpInfo;
+
+ for (uint32_t r = 0; r < regionCount; r++) {
+ uint32_t mipLevel = pRegions[r].imageSubresource.mipLevel;
+ VkBufferImageCopy region = cmpInfo.getBufferImageCopy(pRegions[r]);
+ vk->vkCmdCopyBufferToImage(commandBuffer, srcBuffer, cmpInfo.compressedMipmap(mipLevel),
+ dstImageLayout, 1, &region);
+ }
+
+ if (cmpInfo.canDecompressOnCpu()) {
+ // Get a pointer to the compressed image memory
+ const MemoryInfo* memoryInfo = android::base::find(mMemoryInfo, bufferInfo->memory);
+ if (!memoryInfo) {
+ WARN("ASTC CPU decompression: couldn't find mapped memory info");
+ return;
+ }
+ if (!memoryInfo->ptr) {
+ WARN("ASTC CPU decompression: VkBuffer memory isn't host-visible");
+ return;
+ }
+ uint8_t* astcData = (uint8_t*)(memoryInfo->ptr) + bufferInfo->memoryOffset;
+ cmpInfo.decompressOnCpu(commandBuffer, astcData, bufferInfo->size, dstImage,
+ dstImageLayout, regionCount, pRegions, context);
+ }
+ }
+
+ void on_vkCmdCopyBufferToImage2(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo,
+ const VkDecoderContext& context) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* imageInfo = android::base::find(mImageInfo, pCopyBufferToImageInfo->dstImage);
+ if (!imageInfo) return;
+ auto* bufferInfo = android::base::find(mBufferInfo, pCopyBufferToImageInfo->srcBuffer);
+ if (!bufferInfo) {
+ return;
+ }
+ VkDevice device = bufferInfo->device;
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) {
+ return;
+ }
+ if (!deviceInfo->needEmulatedDecompression(imageInfo->cmpInfo)) {
+ vk->vkCmdCopyBufferToImage2(commandBuffer, pCopyBufferToImageInfo);
+ return;
+ }
+ auto* cmdBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (!cmdBufferInfo) {
+ return;
+ }
+ CompressedImageInfo& cmpInfo = imageInfo->cmpInfo;
+
+ for (uint32_t r = 0; r < pCopyBufferToImageInfo->regionCount; r++) {
+ VkCopyBufferToImageInfo2 inf;
+ uint32_t mipLevel = pCopyBufferToImageInfo->pRegions[r].imageSubresource.mipLevel;
+ inf.dstImage = cmpInfo.compressedMipmap(mipLevel);
+ VkBufferImageCopy2 region = cmpInfo.getBufferImageCopy(pCopyBufferToImageInfo->pRegions[r]);
+ inf.regionCount = 1;
+ inf.pRegions = &region;
+
+ vk->vkCmdCopyBufferToImage2(commandBuffer, &inf);
+ }
+
+ if (cmpInfo.canDecompressOnCpu()) {
+ // Get a pointer to the compressed image memory
+ const MemoryInfo* memoryInfo = android::base::find(mMemoryInfo, bufferInfo->memory);
+ if (!memoryInfo) {
+ WARN("ASTC CPU decompression: couldn't find mapped memory info");
+ return;
+ }
+ if (!memoryInfo->ptr) {
+ WARN("ASTC CPU decompression: VkBuffer memory isn't host-visible");
+ return;
+ }
+ uint8_t* astcData = (uint8_t*)(memoryInfo->ptr) + bufferInfo->memoryOffset;
+
+ cmpInfo.decompressOnCpu(commandBuffer, astcData, bufferInfo->size, pCopyBufferToImageInfo, context);
+ }
+ }
+
+ void on_vkCmdCopyBufferToImage2KHR(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo,
+ const VkDecoderContext& context) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* imageInfo = android::base::find(mImageInfo, pCopyBufferToImageInfo->dstImage);
+ if (!imageInfo) return;
+ auto* bufferInfo = android::base::find(mBufferInfo, pCopyBufferToImageInfo->srcBuffer);
+ if (!bufferInfo) {
+ return;
+ }
+ VkDevice device = bufferInfo->device;
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) {
+ return;
+ }
+ if (!deviceInfo->needEmulatedDecompression(imageInfo->cmpInfo)) {
+ vk->vkCmdCopyBufferToImage2KHR(commandBuffer, pCopyBufferToImageInfo);
+ return;
+ }
+ auto* cmdBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (!cmdBufferInfo) {
+ return;
+ }
+ CompressedImageInfo& cmpInfo = imageInfo->cmpInfo;
+
+ for (uint32_t r = 0; r < pCopyBufferToImageInfo->regionCount; r++) {
+ VkCopyBufferToImageInfo2KHR inf;
+ uint32_t mipLevel = pCopyBufferToImageInfo->pRegions[r].imageSubresource.mipLevel;
+ inf.dstImage = cmpInfo.compressedMipmap(mipLevel);
+ VkBufferImageCopy2KHR region = cmpInfo.getBufferImageCopy(pCopyBufferToImageInfo->pRegions[r]);
+ inf.regionCount = 1;
+ inf.pRegions = &region;
+
+ vk->vkCmdCopyBufferToImage2KHR(commandBuffer, &inf);
+ }
+
+ if (cmpInfo.canDecompressOnCpu()) {
+ // Get a pointer to the compressed image memory
+ const MemoryInfo* memoryInfo = android::base::find(mMemoryInfo, bufferInfo->memory);
+ if (!memoryInfo) {
+ WARN("ASTC CPU decompression: couldn't find mapped memory info");
+ return;
+ }
+ if (!memoryInfo->ptr) {
+ WARN("ASTC CPU decompression: VkBuffer memory isn't host-visible");
+ return;
+ }
+ uint8_t* astcData = (uint8_t*)(memoryInfo->ptr) + bufferInfo->memoryOffset;
+
+ cmpInfo.decompressOnCpu(commandBuffer, astcData, bufferInfo->size, pCopyBufferToImageInfo, context);
+ }
+ }
+
+ inline void convertQueueFamilyForeignToExternal(uint32_t* queueFamilyIndexPtr) {
+ if (*queueFamilyIndexPtr == VK_QUEUE_FAMILY_FOREIGN_EXT) {
+ *queueFamilyIndexPtr = VK_QUEUE_FAMILY_EXTERNAL;
+ }
+ }
+
+ inline void convertQueueFamilyForeignToExternal_VkBufferMemoryBarrier(
+ VkBufferMemoryBarrier* barrier) {
+ convertQueueFamilyForeignToExternal(&barrier->srcQueueFamilyIndex);
+ convertQueueFamilyForeignToExternal(&barrier->dstQueueFamilyIndex);
+ }
+
+ inline void convertQueueFamilyForeignToExternal_VkImageMemoryBarrier(
+ VkImageMemoryBarrier* barrier) {
+ convertQueueFamilyForeignToExternal(&barrier->srcQueueFamilyIndex);
+ convertQueueFamilyForeignToExternal(&barrier->dstQueueFamilyIndex);
+ }
+
+ void on_vkCmdPipelineBarrier(android::base::BumpPool* pool, VkCommandBuffer boxed_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) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ for (uint32_t i = 0; i < bufferMemoryBarrierCount; ++i) {
+ convertQueueFamilyForeignToExternal_VkBufferMemoryBarrier(
+ ((VkBufferMemoryBarrier*)pBufferMemoryBarriers) + i);
+ }
+
+ for (uint32_t i = 0; i < imageMemoryBarrierCount; ++i) {
+ convertQueueFamilyForeignToExternal_VkImageMemoryBarrier(
+ ((VkImageMemoryBarrier*)pImageMemoryBarriers) + i);
+ }
+
+ if (imageMemoryBarrierCount == 0) {
+ vk->vkCmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags,
+ memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
+ pBufferMemoryBarriers, imageMemoryBarrierCount,
+ pImageMemoryBarriers);
+ return;
+ }
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ CommandBufferInfo* cmdBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (!cmdBufferInfo) return;
+
+ DeviceInfo* deviceInfo = android::base::find(mDeviceInfo, cmdBufferInfo->device);
+ if (!deviceInfo) return;
+
+ if (!deviceInfo->emulateTextureEtc2 && !deviceInfo->emulateTextureAstc) {
+ vk->vkCmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags,
+ memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
+ pBufferMemoryBarriers, imageMemoryBarrierCount,
+ pImageMemoryBarriers);
+ return;
+ }
+
+ // This is a compressed image. Handle decompression before calling vkCmdPipelineBarrier
+
+ std::vector<VkImageMemoryBarrier> imageBarriers;
+ bool needRebind = false;
+
+ for (uint32_t i = 0; i < imageMemoryBarrierCount; i++) {
+ const VkImageMemoryBarrier& srcBarrier = pImageMemoryBarriers[i];
+ auto* imageInfo = android::base::find(mImageInfo, srcBarrier.image);
+
+ // If the image doesn't need GPU decompression, nothing to do.
+ if (!imageInfo || !deviceInfo->needGpuDecompression(imageInfo->cmpInfo)) {
+ imageBarriers.push_back(srcBarrier);
+ continue;
+ }
+
+ // Otherwise, decompress the image, if we're going to read from it.
+ needRebind |= imageInfo->cmpInfo.decompressIfNeeded(
+ vk, commandBuffer, srcStageMask, dstStageMask, srcBarrier, imageBarriers);
+ }
+
+ if (needRebind && cmdBufferInfo->computePipeline) {
+ // Recover pipeline bindings
+ // TODO(gregschlom): instead of doing this here again and again after each image we
+ // decompress, could we do it once before calling vkCmdDispatch?
+ vk->vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE,
+ cmdBufferInfo->computePipeline);
+ if (!cmdBufferInfo->descriptorSets.empty()) {
+ vk->vkCmdBindDescriptorSets(
+ commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, cmdBufferInfo->descriptorLayout,
+ cmdBufferInfo->firstSet, cmdBufferInfo->descriptorSets.size(),
+ cmdBufferInfo->descriptorSets.data(), cmdBufferInfo->dynamicOffsets.size(),
+ cmdBufferInfo->dynamicOffsets.data());
+ }
+ }
+
+ // Apply the remaining barriers
+ if (memoryBarrierCount || bufferMemoryBarrierCount || !imageBarriers.empty()) {
+ vk->vkCmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags,
+ memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
+ pBufferMemoryBarriers, imageBarriers.size(),
+ imageBarriers.data());
+ }
+ }
+
+ bool mapHostVisibleMemoryToGuestPhysicalAddressLocked(VulkanDispatch* vk, VkDevice device,
+ VkDeviceMemory memory,
+ uint64_t physAddr) {
+ if (!feature_is_enabled(kFeature_GLDirectMem) &&
+ !feature_is_enabled(kFeature_VirtioGpuNext)) {
+ // fprintf(stderr, "%s: Tried to use direct mapping "
+ // "while GLDirectMem is not enabled!\n");
+ }
+
+ auto* info = android::base::find(mMemoryInfo, memory);
+ if (!info) return false;
+
+ info->guestPhysAddr = physAddr;
+
+ constexpr size_t kPageBits = 12;
+ constexpr size_t kPageSize = 1u << kPageBits;
+ constexpr size_t kPageOffsetMask = kPageSize - 1;
+
+ uintptr_t addr = reinterpret_cast<uintptr_t>(info->ptr);
+ uintptr_t pageOffset = addr & kPageOffsetMask;
+
+ info->pageAlignedHva = reinterpret_cast<void*>(addr - pageOffset);
+ info->sizeToPage = ((info->size + pageOffset + kPageSize - 1) >> kPageBits) << kPageBits;
+
+ if (mLogging) {
+ fprintf(stderr, "%s: map: %p, %p -> [0x%llx 0x%llx]\n", __func__, info->ptr,
+ info->pageAlignedHva, (unsigned long long)info->guestPhysAddr,
+ (unsigned long long)info->guestPhysAddr + info->sizeToPage);
+ }
+
+ info->directMapped = true;
+ uint64_t gpa = info->guestPhysAddr;
+ void* hva = info->pageAlignedHva;
+ size_t sizeToPage = info->sizeToPage;
+
+ AutoLock occupiedGpasLock(mOccupiedGpasLock);
+
+ auto* existingMemoryInfo = android::base::find(mOccupiedGpas, gpa);
+ if (existingMemoryInfo) {
+ fprintf(stderr, "%s: WARNING: already mapped gpa 0x%llx, replacing", __func__,
+ (unsigned long long)gpa);
+
+ get_emugl_vm_operations().unmapUserBackedRam(existingMemoryInfo->gpa,
+ existingMemoryInfo->sizeToPage);
+
+ mOccupiedGpas.erase(gpa);
+ }
+
+ get_emugl_vm_operations().mapUserBackedRam(gpa, hva, sizeToPage);
+
+ if (mVerbosePrints) {
+ fprintf(stderr, "VERBOSE:%s: registering gpa 0x%llx to mOccupiedGpas\n", __func__,
+ (unsigned long long)gpa);
+ }
+
+ mOccupiedGpas[gpa] = {
+ vk, device, memory, gpa, sizeToPage,
+ };
+
+ if (!mUseOldMemoryCleanupPath) {
+ get_emugl_address_space_device_control_ops().register_deallocation_callback(
+ this, gpa, [](void* thisPtr, uint64_t gpa) {
+ Impl* implPtr = (Impl*)thisPtr;
+ implPtr->unmapMemoryAtGpaIfExists(gpa);
+ });
+ }
+
+ return true;
+ }
+
+ // Only call this from the address space device deallocation operation's
+ // context, or it's possible that the guest/host view of which gpa's are
+ // occupied goes out of sync.
+ void unmapMemoryAtGpaIfExists(uint64_t gpa) {
+ AutoLock lock(mOccupiedGpasLock);
+
+ if (mVerbosePrints) {
+ fprintf(stderr, "VERBOSE:%s: deallocation callback for gpa 0x%llx\n", __func__,
+ (unsigned long long)gpa);
+ }
+
+ auto* existingMemoryInfo = android::base::find(mOccupiedGpas, gpa);
+ if (!existingMemoryInfo) return;
+
+ get_emugl_vm_operations().unmapUserBackedRam(existingMemoryInfo->gpa,
+ existingMemoryInfo->sizeToPage);
+
+ mOccupiedGpas.erase(gpa);
+ }
+
+ VkResult on_vkAllocateMemory(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkMemoryAllocateInfo* pAllocateInfo,
+ const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ auto* tInfo = RenderThreadInfoVk::get();
+
+ if (!pAllocateInfo) return VK_ERROR_INITIALIZATION_FAILED;
+
+ VkMemoryAllocateInfo localAllocInfo = vk_make_orphan_copy(*pAllocateInfo);
+ vk_struct_chain_iterator structChainIter = vk_make_chain_iterator(&localAllocInfo);
+
+ VkMemoryAllocateFlagsInfo allocFlagsInfo;
+ VkMemoryOpaqueCaptureAddressAllocateInfo opaqueCaptureAddressAllocInfo;
+
+ const VkMemoryAllocateFlagsInfo* allocFlagsInfoPtr =
+ vk_find_struct<VkMemoryAllocateFlagsInfo>(pAllocateInfo);
+ const VkMemoryOpaqueCaptureAddressAllocateInfo* opaqueCaptureAddressAllocInfoPtr =
+ vk_find_struct<VkMemoryOpaqueCaptureAddressAllocateInfo>(pAllocateInfo);
+
+ if (allocFlagsInfoPtr) {
+ allocFlagsInfo = *allocFlagsInfoPtr;
+ vk_append_struct(&structChainIter, &allocFlagsInfo);
+ }
+
+ if (opaqueCaptureAddressAllocInfoPtr) {
+ opaqueCaptureAddressAllocInfo = *opaqueCaptureAddressAllocInfoPtr;
+ vk_append_struct(&structChainIter, &opaqueCaptureAddressAllocInfo);
+ }
+
+ const VkMemoryDedicatedAllocateInfo* dedicatedAllocInfoPtr =
+ vk_find_struct<VkMemoryDedicatedAllocateInfo>(pAllocateInfo);
+ VkMemoryDedicatedAllocateInfo localDedicatedAllocInfo;
+
+ if (dedicatedAllocInfoPtr) {
+ localDedicatedAllocInfo = vk_make_orphan_copy(*dedicatedAllocInfoPtr);
+ }
+ if (!usingDirectMapping()) {
+ // We copy bytes 1 page at a time from the guest to the host
+ // if we are not using direct mapping. This means we can end up
+ // writing over memory we did not intend.
+ // E.g. swiftshader just allocated with malloc, which can have
+ // data stored between allocations.
+ #ifdef PAGE_SIZE
+ localAllocInfo.allocationSize += static_cast<VkDeviceSize>(PAGE_SIZE);
+ localAllocInfo.allocationSize &= ~static_cast<VkDeviceSize>(PAGE_SIZE - 1);
+ #elif defined(_WIN32)
+ localAllocInfo.allocationSize += static_cast<VkDeviceSize>(4096);
+ localAllocInfo.allocationSize &= ~static_cast<VkDeviceSize>(4095);
+ #else
+ localAllocInfo.allocationSize += static_cast<VkDeviceSize>(getpagesize());
+ localAllocInfo.allocationSize &= ~static_cast<VkDeviceSize>(getpagesize() - 1);
+ #endif
+ }
+ // 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 allocations during Buffer/ColorBuffer
+ // setup. Below checks if the underlying Buffer/ColorBuffer backing memory was
+ // originally created with a dedicated allocation.
+ bool shouldUseDedicatedAllocInfo = dedicatedAllocInfoPtr != nullptr;
+
+ const VkImportColorBufferGOOGLE* importCbInfoPtr =
+ vk_find_struct<VkImportColorBufferGOOGLE>(pAllocateInfo);
+ const VkImportBufferGOOGLE* importBufferInfoPtr =
+ vk_find_struct<VkImportBufferGOOGLE>(pAllocateInfo);
+
+ const VkCreateBlobGOOGLE* createBlobInfoPtr =
+ vk_find_struct<VkCreateBlobGOOGLE>(pAllocateInfo);
+
+#ifdef _WIN32
+ VkImportMemoryWin32HandleInfoKHR importInfo{
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR,
+ 0,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ VK_EXT_MEMORY_HANDLE_INVALID,
+ L"",
+ };
+#elif defined(__QNX__)
+ VkImportScreenBufferInfoQNX importInfo{
+ VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX,
+ 0,
+ VK_EXT_MEMORY_HANDLE_INVALID,
+ };
+#else
+ VkImportMemoryFdInfoKHR importInfo{
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR,
+ 0,
+ VK_EXT_MEMORY_HANDLE_TYPE_BIT,
+ VK_EXT_MEMORY_HANDLE_INVALID,
+ };
+#endif
+
+ void* mappedPtr = nullptr;
+ ManagedDescriptor externalMemoryHandle;
+ if (importCbInfoPtr) {
+ bool vulkanOnly = mGuestUsesAngle;
+
+ bool colorBufferMemoryUsesDedicatedAlloc = false;
+ if (!getColorBufferAllocationInfo(importCbInfoPtr->colorBuffer,
+ &localAllocInfo.allocationSize,
+ &localAllocInfo.memoryTypeIndex,
+ &colorBufferMemoryUsesDedicatedAlloc, &mappedPtr)) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Failed to get allocation info for ColorBuffer:"
+ << importCbInfoPtr->colorBuffer;
+ }
+
+ shouldUseDedicatedAllocInfo &= colorBufferMemoryUsesDedicatedAlloc;
+
+ if (!vulkanOnly) {
+ auto fb = FrameBuffer::getFB();
+ if (fb) {
+ fb->invalidateColorBufferForVk(importCbInfoPtr->colorBuffer);
+ }
+ }
+
+ if (m_emu->instanceSupportsExternalMemoryCapabilities) {
+ VK_EXT_MEMORY_HANDLE cbExtMemoryHandle =
+ getColorBufferExtMemoryHandle(importCbInfoPtr->colorBuffer);
+
+ if (cbExtMemoryHandle == VK_EXT_MEMORY_HANDLE_INVALID) {
+ fprintf(stderr,
+ "%s: VK_ERROR_OUT_OF_DEVICE_MEMORY: "
+ "colorBuffer 0x%x does not have Vulkan external memory backing\n",
+ __func__, importCbInfoPtr->colorBuffer);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+#if defined(__QNX__)
+ importInfo.buffer = cbExtMemoryHandle;
+#else
+ externalMemoryHandle = ManagedDescriptor(dupExternalMemory(cbExtMemoryHandle));
+
+#ifdef _WIN32
+ importInfo.handle = externalMemoryHandle.get().value_or(static_cast<HANDLE>(NULL));
+#else
+ importInfo.fd = externalMemoryHandle.get().value_or(-1);
+#endif
+#endif
+ vk_append_struct(&structChainIter, &importInfo);
+ }
+ }
+
+ if (importBufferInfoPtr) {
+ bool bufferMemoryUsesDedicatedAlloc = false;
+ if (!getBufferAllocationInfo(
+ importBufferInfoPtr->buffer, &localAllocInfo.allocationSize,
+ &localAllocInfo.memoryTypeIndex, &bufferMemoryUsesDedicatedAlloc)) {
+ ERR("Failed to get Buffer:%d allocation info.", importBufferInfoPtr->buffer);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+ shouldUseDedicatedAllocInfo &= bufferMemoryUsesDedicatedAlloc;
+
+ if (m_emu->instanceSupportsExternalMemoryCapabilities) {
+ VK_EXT_MEMORY_HANDLE bufferExtMemoryHandle =
+ getBufferExtMemoryHandle(importBufferInfoPtr->buffer);
+
+ if (bufferExtMemoryHandle == VK_EXT_MEMORY_HANDLE_INVALID) {
+ fprintf(stderr,
+ "%s: VK_ERROR_OUT_OF_DEVICE_MEMORY: "
+ "buffer 0x%x does not have Vulkan external memory "
+ "backing\n",
+ __func__, importBufferInfoPtr->buffer);
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+#if defined(__QNX__)
+ importInfo.buffer = bufferExtMemoryHandle;
+#else
+ bufferExtMemoryHandle = dupExternalMemory(bufferExtMemoryHandle);
+
+#ifdef _WIN32
+ importInfo.handle = bufferExtMemoryHandle;
+#else
+ importInfo.fd = bufferExtMemoryHandle;
+#endif
+#endif
+ vk_append_struct(&structChainIter, &importInfo);
+ }
+ }
+
+ VkMemoryPropertyFlags memoryPropertyFlags;
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* physdev = android::base::find(mDeviceToPhysicalDevice, device);
+ if (!physdev) {
+ // User app gave an invalid VkDevice, but we don't really want to crash here.
+ // We should allow invalid apps.
+ return VK_ERROR_DEVICE_LOST;
+ }
+
+ auto* physdevInfo = android::base::find(mPhysdevInfo, *physdev);
+ if (!physdevInfo) {
+ // If this fails, we crash, as we assume that the memory properties map should have
+ // the info.
+ fprintf(stderr, "Error: Could not get memory properties for VkPhysicalDevice\n");
+ }
+
+ // If the memory was allocated with a type index that corresponds
+ // to a memory type that is host visible, let's also map the entire
+ // thing.
+
+ // First, check validity of the user's type index.
+ if (localAllocInfo.memoryTypeIndex >= physdevInfo->memoryProperties.memoryTypeCount) {
+ // Continue allowing invalid behavior.
+ return VK_ERROR_INCOMPATIBLE_DRIVER;
+ }
+ memoryPropertyFlags =
+ physdevInfo->memoryProperties.memoryTypes[localAllocInfo.memoryTypeIndex]
+ .propertyFlags;
+ }
+
+ if (shouldUseDedicatedAllocInfo) {
+ vk_append_struct(&structChainIter, &localDedicatedAllocInfo);
+ }
+
+ VkExportMemoryAllocateInfo exportAllocate = {
+ .sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,
+ .pNext = NULL,
+ };
+
+#ifdef __unix__
+ exportAllocate.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
+#endif
+
+#ifdef __linux__
+ if (hasDeviceExtension(device, VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME)) {
+ exportAllocate.handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
+ }
+#endif
+
+#ifdef _WIN32
+ exportAllocate.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT;
+#endif
+
+ bool hostVisible = memoryPropertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+ if (hostVisible && feature_is_enabled(kFeature_ExternalBlob)) {
+ vk_append_struct(&structChainIter, &exportAllocate);
+ }
+
+ if (createBlobInfoPtr && createBlobInfoPtr->blobMem == STREAM_BLOB_MEM_GUEST &&
+ (createBlobInfoPtr->blobFlags & STREAM_BLOB_FLAG_CREATE_GUEST_HANDLE)) {
+ DescriptorType rawDescriptor;
+ auto descriptorInfoOpt =
+ BlobManager::get()->removeDescriptorInfo(tInfo->ctx_id, createBlobInfoPtr->blobId);
+ if (descriptorInfoOpt) {
+ auto rawDescriptorOpt = (*descriptorInfoOpt).descriptor.release();
+ if (rawDescriptorOpt) {
+ rawDescriptor = *rawDescriptorOpt;
+ } else {
+ ERR("Failed vkAllocateMemory: missing raw descriptor.");
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ } else {
+ ERR("Failed vkAllocateMemory: missing descriptor info.");
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+#if defined(__linux__)
+ importInfo.fd = rawDescriptor;
+#endif
+
+#ifdef __linux__
+ if (hasDeviceExtension(device, VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME)) {
+ importInfo.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
+ }
+#endif
+ vk_append_struct(&structChainIter, &importInfo);
+ }
+
+ VkImportMemoryHostPointerInfoEXT importHostInfo;
+ std::optional<SharedMemory> sharedMemory = std::nullopt;
+
+ // TODO(b/261222354): Make sure the feature exists when initializing sVkEmulation.
+ if (hostVisible && feature_is_enabled(kFeature_SystemBlob)) {
+ // Ensure size is page-aligned.
+ VkDeviceSize alignedSize = __ALIGN(localAllocInfo.allocationSize, kPageSizeforBlob);
+ if (alignedSize != localAllocInfo.allocationSize) {
+ ERR("Warning: Aligning allocation size from %llu to %llu",
+ static_cast<unsigned long long>(localAllocInfo.allocationSize),
+ static_cast<unsigned long long>(alignedSize));
+ }
+ localAllocInfo.allocationSize = alignedSize;
+
+ static std::atomic<uint64_t> uniqueShmemId = 0;
+ sharedMemory = SharedMemory("shared-memory-vk-" + std::to_string(uniqueShmemId++),
+ localAllocInfo.allocationSize);
+ int ret = sharedMemory->create(0600);
+ if (ret) {
+ ERR("Failed to create system-blob host-visible memory, error: %d", ret);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ mappedPtr = sharedMemory->get();
+ int mappedPtrAlignment = reinterpret_cast<uintptr_t>(mappedPtr) % kPageSizeforBlob;
+ if (mappedPtrAlignment != 0) {
+ ERR("Warning: Mapped shared memory pointer is not aligned to page size, alignment "
+ "is: %d",
+ mappedPtrAlignment);
+ }
+ importHostInfo = {.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT,
+ .pNext = NULL,
+ .handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT,
+ .pHostPointer = mappedPtr};
+ localAllocInfo.pNext = &importHostInfo;
+ }
+
+ VkResult result = vk->vkAllocateMemory(device, &localAllocInfo, pAllocator, pMemory);
+
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+#ifdef _WIN32
+ // Let ManagedDescriptor to close the underlying HANDLE when going out of scope. From the
+ // VkImportMemoryWin32HandleInfoKHR spec: Importing memory object payloads from Windows
+ // handles does not transfer ownership of the handle to the Vulkan implementation. For
+ // handle types defined as NT handles, the application must release handle ownership using
+ // the CloseHandle system call when the handle is no longer needed. For handle types defined
+ // as NT handles, the imported memory object holds a reference to its payload.
+#else
+ // Tell ManagedDescriptor not to close the underlying fd, because the ownership has already
+ // been transferred to the Vulkan implementation. From VkImportMemoryFdInfoKHR spec:
+ // Importing memory from a file descriptor transfers ownership of the file descriptor from
+ // the application to the Vulkan implementation. The application must not perform any
+ // operations on the file descriptor after a successful import. The imported memory object
+ // holds a reference to its payload.
+ externalMemoryHandle.release();
+#endif
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ mMemoryInfo[*pMemory] = MemoryInfo();
+ auto& memoryInfo = mMemoryInfo[*pMemory];
+ memoryInfo.size = localAllocInfo.allocationSize;
+ memoryInfo.device = device;
+ memoryInfo.memoryIndex = localAllocInfo.memoryTypeIndex;
+#if defined(__APPLE__) && defined(VK_MVK_moltenvk)
+ if (importCbInfoPtr && m_emu->instanceSupportsMoltenVK) {
+ memoryInfo.mtlTexture = getColorBufferMTLTexture(importCbInfoPtr->colorBuffer);
+ }
+#endif
+
+ if (importCbInfoPtr && !mGuestUsesAngle) {
+ memoryInfo.boundColorBuffer = importCbInfoPtr->colorBuffer;
+ }
+
+ if (!hostVisible) {
+ *pMemory = new_boxed_non_dispatchable_VkDeviceMemory(*pMemory);
+ return result;
+ }
+
+ if (memoryPropertyFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) {
+ memoryInfo.caching = MAP_CACHE_CACHED;
+ } else if (memoryPropertyFlags & VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD) {
+ memoryInfo.caching = MAP_CACHE_UNCACHED;
+ } else if (memoryPropertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) {
+ memoryInfo.caching = MAP_CACHE_WC;
+ }
+
+ VkInstance* instance = deviceToInstanceLocked(device);
+ InstanceInfo* instanceInfo = android::base::find(mInstanceInfo, *instance);
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+ // If gfxstream needs to be able to read from this memory, needToMap should be true.
+ // When external blobs are off, we always want to map HOST_VISIBLE memory. Because, we run
+ // in the same process as the guest.
+ // When external blobs are on, we want to map memory only if a workaround is using it in
+ // the gfxstream process. This happens when ASTC CPU emulation is on.
+ bool needToMap =
+ (!feature_is_enabled(kFeature_ExternalBlob) ||
+ (deviceInfo->useAstcCpuDecompression && deviceInfo->emulateTextureAstc)) &&
+ !createBlobInfoPtr;
+
+ // Some cases provide a mappedPtr, so we only map if we still don't have a pointer here.
+ if (!mappedPtr && needToMap) {
+ memoryInfo.needUnmap = true;
+ VkResult mapResult =
+ vk->vkMapMemory(device, *pMemory, 0, memoryInfo.size, 0, &memoryInfo.ptr);
+ if (mapResult != VK_SUCCESS) {
+ freeMemoryLocked(vk, device, *pMemory, pAllocator);
+ *pMemory = VK_NULL_HANDLE;
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+ } else {
+ // Since we didn't call vkMapMemory, unmapping is not needed (don't own mappedPtr).
+ memoryInfo.needUnmap = false;
+ memoryInfo.ptr = mappedPtr;
+
+ if (createBlobInfoPtr) {
+ memoryInfo.blobId = createBlobInfoPtr->blobId;
+ }
+
+ // Always assign the shared memory into memoryInfo. If it was used, then it will have
+ // ownership transferred.
+ memoryInfo.sharedMemory = std::exchange(sharedMemory, std::nullopt);
+ }
+
+ *pMemory = new_boxed_non_dispatchable_VkDeviceMemory(*pMemory);
+
+ return result;
+ }
+
+ void freeMemoryLocked(VulkanDispatch* vk, VkDevice device, VkDeviceMemory memory,
+ const VkAllocationCallbacks* pAllocator) {
+ auto* info = android::base::find(mMemoryInfo, memory);
+ if (!info) return; // Invalid usage.
+
+#ifdef __APPLE__
+ if (info->mtlTexture) {
+ CFRelease(info->mtlTexture);
+ info->mtlTexture = nullptr;
+ }
+#endif
+
+ if (info->directMapped) {
+ // if direct mapped, we leave it up to the guest address space driver
+ // to control the unmapping of kvm slot on the host side
+ // in order to avoid situations where
+ //
+ // 1. we try to unmap here and deadlock
+ //
+ // 2. unmapping at the wrong time (possibility of a parallel call
+ // to unmap vs. address space allocate and mapMemory leading to
+ // mapping the same gpa twice)
+ if (mUseOldMemoryCleanupPath) {
+ unmapMemoryAtGpaIfExists(info->guestPhysAddr);
+ }
+ }
+
+ if (info->virtioGpuMapped) {
+ if (mLogging) {
+ fprintf(stderr, "%s: unmap hostmem %p id 0x%llx\n", __func__, info->ptr,
+ (unsigned long long)info->hostmemId);
+ }
+ }
+
+ if (info->needUnmap && info->ptr) {
+ vk->vkUnmapMemory(device, memory);
+ }
+
+ vk->vkFreeMemory(device, memory, pAllocator);
+
+ mMemoryInfo.erase(memory);
+ }
+
+ void on_vkFreeMemory(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ if (!device || !vk) {
+ return;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ freeMemoryLocked(vk, device, memory, pAllocator);
+ }
+
+ VkResult on_vkMapMemory(android::base::BumpPool* pool, VkDevice, VkDeviceMemory memory,
+ VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags,
+ void** ppData) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ return on_vkMapMemoryLocked(0, memory, offset, size, flags, ppData);
+ }
+ VkResult on_vkMapMemoryLocked(VkDevice, VkDeviceMemory memory, VkDeviceSize offset,
+ VkDeviceSize size, VkMemoryMapFlags flags, void** ppData) {
+ auto* info = android::base::find(mMemoryInfo, memory);
+ if (!info || !info->ptr) return VK_ERROR_MEMORY_MAP_FAILED; // Invalid usage.
+
+ *ppData = (void*)((uint8_t*)info->ptr + offset);
+ return VK_SUCCESS;
+ }
+
+ void on_vkUnmapMemory(android::base::BumpPool* pool, VkDevice, VkDeviceMemory) {
+ // no-op; user-level mapping does not correspond
+ // to any operation here.
+ }
+
+ uint8_t* getMappedHostPointer(VkDeviceMemory memory) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* info = android::base::find(mMemoryInfo, memory);
+ if (!info) return nullptr;
+
+ return (uint8_t*)(info->ptr);
+ }
+
+ VkDeviceSize getDeviceMemorySize(VkDeviceMemory memory) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* info = android::base::find(mMemoryInfo, memory);
+ if (!info) return 0;
+
+ return info->size;
+ }
+
+ bool usingDirectMapping() const {
+ return feature_is_enabled(kFeature_GLDirectMem) ||
+ feature_is_enabled(kFeature_VirtioGpuNext);
+ }
+
+ HostFeatureSupport getHostFeatureSupport() const {
+ HostFeatureSupport res;
+
+ if (!m_vk) return res;
+
+ auto emu = getGlobalVkEmulation();
+
+ res.supportsVulkan = emu && emu->live;
+
+ if (!res.supportsVulkan) return res;
+
+ const auto& props = emu->deviceInfo.physdevProps;
+
+ res.supportsVulkan1_1 = props.apiVersion >= VK_API_VERSION_1_1;
+ res.useDeferredCommands = emu->useDeferredCommands;
+ res.useCreateResourcesWithRequirements = emu->useCreateResourcesWithRequirements;
+
+ res.apiVersion = props.apiVersion;
+ res.driverVersion = props.driverVersion;
+ res.deviceID = props.deviceID;
+ res.vendorID = props.vendorID;
+ return res;
+ }
+
+ bool hasInstanceExtension(VkInstance instance, const std::string& name) {
+ auto* info = android::base::find(mInstanceInfo, instance);
+ if (!info) return false;
+
+ for (const auto& enabledName : info->enabledExtensionNames) {
+ if (name == enabledName) return true;
+ }
+
+ return false;
+ }
+
+ bool hasDeviceExtension(VkDevice device, const std::string& name) {
+ auto* info = android::base::find(mDeviceInfo, device);
+ if (!info) return false;
+
+ for (const auto& enabledName : info->enabledExtensionNames) {
+ if (name == enabledName) return true;
+ }
+
+ return false;
+ }
+
+ // Returns whether a vector of VkExtensionProperties contains a particular extension
+ bool hasDeviceExtension(const std::vector<VkExtensionProperties>& properties,
+ const char* name) {
+ for (const auto& prop : properties) {
+ if (strcmp(prop.extensionName, name) == 0) return true;
+ }
+ return false;
+ }
+
+ // Convenience function to call vkEnumerateDeviceExtensionProperties and get the results as an
+ // std::vector
+ VkResult enumerateDeviceExtensionProperties(VulkanDispatch* vk, VkPhysicalDevice physicalDevice,
+ const char* pLayerName,
+ std::vector<VkExtensionProperties>& properties) {
+ uint32_t propertyCount = 0;
+ VkResult result = vk->vkEnumerateDeviceExtensionProperties(physicalDevice, pLayerName,
+ &propertyCount, nullptr);
+ if (result != VK_SUCCESS) return result;
+
+ properties.resize(propertyCount);
+ return vk->vkEnumerateDeviceExtensionProperties(physicalDevice, pLayerName, &propertyCount,
+ properties.data());
+ }
+
+ // VK_ANDROID_native_buffer
+ VkResult on_vkGetSwapchainGrallocUsageANDROID(android::base::BumpPool* pool, VkDevice,
+ VkFormat format, VkImageUsageFlags imageUsage,
+ int* grallocUsage) {
+ getGralloc0Usage(format, imageUsage, grallocUsage);
+ return VK_SUCCESS;
+ }
+
+ VkResult on_vkGetSwapchainGrallocUsage2ANDROID(
+ android::base::BumpPool* pool, VkDevice, VkFormat format, VkImageUsageFlags imageUsage,
+ VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, uint64_t* grallocConsumerUsage,
+ uint64_t* grallocProducerUsage) {
+ getGralloc1Usage(format, imageUsage, swapchainImageUsage, grallocConsumerUsage,
+ grallocProducerUsage);
+ return VK_SUCCESS;
+ }
+
+ VkResult on_vkAcquireImageANDROID(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkImage image, int nativeFenceFd, VkSemaphore semaphore,
+ VkFence fence) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* imageInfo = android::base::find(mImageInfo, image);
+ if (!imageInfo) {
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+
+ VkQueue defaultQueue;
+ uint32_t defaultQueueFamilyIndex;
+ Lock* defaultQueueLock;
+ if (!getDefaultQueueForDeviceLocked(device, &defaultQueue, &defaultQueueFamilyIndex,
+ &defaultQueueLock)) {
+ fprintf(stderr, "%s: cant get the default q\n", __func__);
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+
+ AndroidNativeBufferInfo* anbInfo = imageInfo->anbInfo.get();
+
+ return setAndroidNativeImageSemaphoreSignaled(vk, device, defaultQueue,
+ defaultQueueFamilyIndex, defaultQueueLock,
+ semaphore, fence, anbInfo);
+ }
+
+ VkResult on_vkQueueSignalReleaseImageANDROID(android::base::BumpPool* pool, VkQueue boxed_queue,
+ uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores, VkImage image,
+ int* pNativeFenceFd) {
+ auto queue = unbox_VkQueue(boxed_queue);
+ auto vk = dispatch_VkQueue(boxed_queue);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* queueInfo = android::base::find(mQueueInfo, queue);
+ if (!queueInfo) return VK_ERROR_INITIALIZATION_FAILED;
+
+ if (mRenderDocWithMultipleVkInstances) {
+ VkPhysicalDevice vkPhysicalDevice = mDeviceToPhysicalDevice.at(queueInfo->device);
+ VkInstance vkInstance = mPhysicalDeviceToInstance.at(vkPhysicalDevice);
+ mRenderDocWithMultipleVkInstances->onFrameDelimiter(vkInstance);
+ }
+
+ auto* imageInfo = android::base::find(mImageInfo, image);
+ auto anbInfo = imageInfo->anbInfo;
+
+ if (anbInfo->useVulkanNativeImage) {
+ // vkQueueSignalReleaseImageANDROID() is only called by the Android framework's
+ // implementation of vkQueuePresentKHR(). The guest application is responsible for
+ // transitioning the image layout of the image passed to vkQueuePresentKHR() to
+ // VK_IMAGE_LAYOUT_PRESENT_SRC_KHR before the call. If the host is using native
+ // Vulkan images where `image` is backed with the same memory as its ColorBuffer,
+ // then we need to update the tracked layout for that ColorBuffer.
+ setColorBufferCurrentLayout(anbInfo->colorBufferHandle,
+ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
+ }
+
+ return syncImageToColorBuffer(vk, queueInfo->queueFamilyIndex, queue, queueInfo->lock,
+ waitSemaphoreCount, pWaitSemaphores, pNativeFenceFd, anbInfo);
+ }
+
+ VkResult on_vkMapMemoryIntoAddressSpaceGOOGLE(android::base::BumpPool* pool,
+ VkDevice boxed_device, VkDeviceMemory memory,
+ uint64_t* pAddress) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ if (!feature_is_enabled(kFeature_GLDirectMem)) {
+ fprintf(stderr,
+ "FATAL: Tried to use direct mapping "
+ "while GLDirectMem is not enabled!\n");
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ if (mLogging) {
+ fprintf(stderr, "%s: deviceMemory: 0x%llx pAddress: 0x%llx\n", __func__,
+ (unsigned long long)memory, (unsigned long long)(*pAddress));
+ }
+
+ if (!mapHostVisibleMemoryToGuestPhysicalAddressLocked(vk, device, memory, *pAddress)) {
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ auto* info = android::base::find(mMemoryInfo, memory);
+ if (!info) return VK_ERROR_INITIALIZATION_FAILED;
+
+ *pAddress = (uint64_t)(uintptr_t)info->ptr;
+
+ return VK_SUCCESS;
+ }
+
+ VkResult vkGetBlobInternal(VkDevice boxed_device, VkDeviceMemory memory, uint64_t hostBlobId) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* tInfo = RenderThreadInfoVk::get();
+
+ auto* info = android::base::find(mMemoryInfo, memory);
+ if (!info) return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+ hostBlobId = (info->blobId && !hostBlobId) ? info->blobId : hostBlobId;
+
+ if (feature_is_enabled(kFeature_SystemBlob) && info->sharedMemory.has_value()) {
+ uint32_t handleType = STREAM_MEM_HANDLE_TYPE_SHM;
+ // We transfer ownership of the shared memory handle to the descriptor info.
+ // The memory itself is destroyed only when all processes unmap / release their
+ // handles.
+ BlobManager::get()->addDescriptorInfo(tInfo->ctx_id, hostBlobId,
+ info->sharedMemory->releaseHandle(), handleType,
+ info->caching, std::nullopt);
+ } else if (feature_is_enabled(kFeature_ExternalBlob)) {
+ VkResult result;
+ auto device = unbox_VkDevice(boxed_device);
+ DescriptorType handle;
+ uint32_t handleType;
+ struct VulkanInfo vulkanInfo = {
+ .memoryIndex = info->memoryIndex,
+ };
+ memcpy(vulkanInfo.deviceUUID, m_emu->deviceInfo.idProps.deviceUUID,
+ sizeof(vulkanInfo.deviceUUID));
+ memcpy(vulkanInfo.driverUUID, m_emu->deviceInfo.idProps.driverUUID,
+ sizeof(vulkanInfo.driverUUID));
+
+#ifdef __unix__
+ VkMemoryGetFdInfoKHR getFd = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR,
+ .pNext = nullptr,
+ .memory = memory,
+ .handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT,
+ };
+
+ handleType = STREAM_MEM_HANDLE_TYPE_OPAQUE_FD;
+#endif
+
+#ifdef __linux__
+ if (hasDeviceExtension(device, VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME)) {
+ getFd.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
+ handleType = STREAM_MEM_HANDLE_TYPE_DMABUF;
+ }
+#endif
+
+#ifdef __unix__
+ result = m_emu->deviceInfo.getMemoryHandleFunc(device, &getFd, &handle);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+#endif
+
+#ifdef _WIN32
+ VkMemoryGetWin32HandleInfoKHR getHandle = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR,
+ .pNext = nullptr,
+ .memory = memory,
+ .handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT,
+ };
+
+ handleType = STREAM_MEM_HANDLE_TYPE_OPAQUE_WIN32;
+
+ result = m_emu->deviceInfo.getMemoryHandleFunc(device, &getHandle, &handle);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+#endif
+
+ ManagedDescriptor managedHandle(handle);
+ BlobManager::get()->addDescriptorInfo(
+ tInfo->ctx_id, hostBlobId, std::move(managedHandle), handleType, info->caching,
+ std::optional<VulkanInfo>(vulkanInfo));
+ } else if (!info->needUnmap) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VkResult mapResult = vk->vkMapMemory(device, memory, 0, info->size, 0, &info->ptr);
+ if (mapResult != VK_SUCCESS) {
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
+
+ info->needUnmap = true;
+ }
+
+ if (info->needUnmap) {
+ uint64_t hva = (uint64_t)(uintptr_t)(info->ptr);
+ uint64_t size = (uint64_t)(uintptr_t)(info->size);
+
+ uint64_t alignedHva = hva & kPageMaskForBlob;
+ uint64_t alignedSize =
+ kPageSizeforBlob * ((size + kPageSizeforBlob - 1) / kPageSizeforBlob);
+
+ if (hva != alignedHva) {
+ ERR("Mapping non page-size (0x%" PRIx64
+ ") aligned host virtual address:%p "
+ "using the aligned host virtual address:%p. The underlying resources "
+ "using this blob may be corrupted/offset.",
+ kPageSizeforBlob, hva, alignedHva);
+ }
+
+ BlobManager::get()->addMapping(tInfo->ctx_id, hostBlobId, (void*)(uintptr_t)alignedHva,
+ info->caching);
+ info->virtioGpuMapped = true;
+ info->hostmemId = hostBlobId;
+ }
+
+ return VK_SUCCESS;
+ }
+
+ VkResult on_vkGetBlobGOOGLE(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDeviceMemory memory) {
+ return vkGetBlobInternal(boxed_device, memory, 0);
+ }
+
+ VkResult on_vkGetMemoryHostAddressInfoGOOGLE(android::base::BumpPool* pool,
+ VkDevice boxed_device, VkDeviceMemory memory,
+ uint64_t* pAddress, uint64_t* pSize,
+ uint64_t* pHostmemId) {
+ hostBlobId++;
+ *pHostmemId = hostBlobId;
+ return vkGetBlobInternal(boxed_device, memory, hostBlobId);
+ }
+
+ VkResult on_vkFreeMemorySyncGOOGLE(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDeviceMemory memory,
+ const VkAllocationCallbacks* pAllocator) {
+ on_vkFreeMemory(pool, boxed_device, memory, pAllocator);
+
+ return VK_SUCCESS;
+ }
+
+ VkResult on_vkAllocateCommandBuffers(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkCommandBufferAllocateInfo* pAllocateInfo,
+ VkCommandBuffer* pCommandBuffers) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VkResult result = vk->vkAllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
+
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return VK_ERROR_UNKNOWN;
+
+ for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) {
+ mCmdBufferInfo[pCommandBuffers[i]] = CommandBufferInfo();
+ mCmdBufferInfo[pCommandBuffers[i]].device = device;
+ mCmdBufferInfo[pCommandBuffers[i]].debugUtilsHelper = deviceInfo->debugUtilsHelper;
+ mCmdBufferInfo[pCommandBuffers[i]].cmdPool = pAllocateInfo->commandPool;
+ auto boxed = new_boxed_VkCommandBuffer(pCommandBuffers[i], vk,
+ false /* does not own dispatch */);
+ mCmdBufferInfo[pCommandBuffers[i]].boxed = boxed;
+ pCommandBuffers[i] = (VkCommandBuffer)boxed;
+ }
+ return result;
+ }
+
+ VkResult on_vkCreateCommandPool(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkCommandPoolCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkCommandPool* pCommandPool) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VkResult result = vk->vkCreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ mCmdPoolInfo[*pCommandPool] = CommandPoolInfo();
+ auto& cmdPoolInfo = mCmdPoolInfo[*pCommandPool];
+ cmdPoolInfo.device = device;
+
+ *pCommandPool = new_boxed_non_dispatchable_VkCommandPool(*pCommandPool);
+ cmdPoolInfo.boxed = *pCommandPool;
+
+ return result;
+ }
+
+ void on_vkDestroyCommandPool(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkCommandPool commandPool,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ vk->vkDestroyCommandPool(device, commandPool, pAllocator);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ const auto* cmdPoolInfo = android::base::find(mCmdPoolInfo, commandPool);
+ if (cmdPoolInfo) {
+ removeCommandBufferInfo(cmdPoolInfo->cmdBuffers);
+ mCmdPoolInfo.erase(commandPool);
+ }
+ }
+
+ VkResult on_vkResetCommandPool(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkCommandPool commandPool, VkCommandPoolResetFlags flags) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VkResult result = vk->vkResetCommandPool(device, commandPool, flags);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+ return result;
+ }
+
+ void on_vkCmdExecuteCommands(android::base::BumpPool* pool, VkCommandBuffer boxed_commandBuffer,
+ uint32_t commandBufferCount,
+ const VkCommandBuffer* pCommandBuffers) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ vk->vkCmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ CommandBufferInfo& cmdBuffer = mCmdBufferInfo[commandBuffer];
+ cmdBuffer.subCmds.insert(cmdBuffer.subCmds.end(), pCommandBuffers,
+ pCommandBuffers + commandBufferCount);
+ }
+
+ VkResult dispatchVkQueueSubmit(VulkanDispatch* vk, VkQueue unboxed_queue, uint32_t submitCount,
+ const VkSubmitInfo* pSubmits, VkFence fence) {
+ return vk->vkQueueSubmit(unboxed_queue, submitCount, pSubmits, fence);
+ }
+
+ VkResult dispatchVkQueueSubmit(VulkanDispatch* vk, VkQueue unboxed_queue, uint32_t submitCount,
+ const VkSubmitInfo2* pSubmits, VkFence fence) {
+ return vk->vkQueueSubmit2(unboxed_queue, submitCount, pSubmits, fence);
+ }
+
+ template <typename VkSubmitInfoType>
+ VkResult on_vkQueueSubmit(android::base::BumpPool* pool, VkQueue boxed_queue,
+ uint32_t submitCount, const VkSubmitInfoType* pSubmits,
+ VkFence fence) {
+ auto queue = unbox_VkQueue(boxed_queue);
+ auto vk = dispatch_VkQueue(boxed_queue);
+
+ Lock* ql;
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ {
+ auto* queueInfo = android::base::find(mQueueInfo, queue);
+ if (queueInfo) {
+ sBoxedHandleManager.processDelayedRemovesGlobalStateLocked(queueInfo->device);
+ }
+ }
+
+ for (uint32_t i = 0; i < submitCount; i++) {
+ executePreprocessRecursive(pSubmits[i]);
+ }
+
+ auto* queueInfo = android::base::find(mQueueInfo, queue);
+ if (!queueInfo) return VK_SUCCESS;
+ ql = queueInfo->lock;
+ }
+
+ AutoLock qlock(*ql);
+ auto result = dispatchVkQueueSubmit(vk, queue, submitCount, pSubmits, fence);
+
+ // After vkQueueSubmit is called, we can signal the conditional variable
+ // in FenceInfo, so that other threads (e.g. SyncThread) can call
+ // waitForFence() on this fence.
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* fenceInfo = android::base::find(mFenceInfo, fence);
+ if (fenceInfo) {
+ fenceInfo->state = FenceInfo::State::kWaitable;
+ fenceInfo->lock.lock();
+ fenceInfo->cv.signalAndUnlock(&fenceInfo->lock);
+ }
+ }
+
+ return result;
+ }
+
+ VkResult on_vkQueueWaitIdle(android::base::BumpPool* pool, VkQueue boxed_queue) {
+ auto queue = unbox_VkQueue(boxed_queue);
+ auto vk = dispatch_VkQueue(boxed_queue);
+
+ if (!queue) return VK_SUCCESS;
+
+ Lock* ql;
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* queueInfo = android::base::find(mQueueInfo, queue);
+ if (!queueInfo) return VK_SUCCESS;
+ ql = queueInfo->lock;
+ }
+
+ AutoLock qlock(*ql);
+ return vk->vkQueueWaitIdle(queue);
+ }
+
+ VkResult on_vkResetCommandBuffer(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ VkCommandBufferResetFlags flags) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ VkResult result = vk->vkResetCommandBuffer(commandBuffer, flags);
+ if (VK_SUCCESS == result) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto& bufferInfo = mCmdBufferInfo[commandBuffer];
+ bufferInfo.reset();
+ }
+ return result;
+ }
+
+ void on_vkFreeCommandBuffers(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkCommandPool commandPool, uint32_t commandBufferCount,
+ const VkCommandBuffer* pCommandBuffers) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ if (!device) return;
+ vk->vkFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ for (uint32_t i = 0; i < commandBufferCount; i++) {
+ const auto& cmdBufferInfoIt = mCmdBufferInfo.find(pCommandBuffers[i]);
+ if (cmdBufferInfoIt != mCmdBufferInfo.end()) {
+ const auto& cmdPoolInfoIt = mCmdPoolInfo.find(cmdBufferInfoIt->second.cmdPool);
+ if (cmdPoolInfoIt != mCmdPoolInfo.end()) {
+ cmdPoolInfoIt->second.cmdBuffers.erase(pCommandBuffers[i]);
+ }
+ // Done in decoder
+ // delete_VkCommandBuffer(cmdBufferInfoIt->second.boxed);
+ mCmdBufferInfo.erase(cmdBufferInfoIt);
+ }
+ }
+ }
+
+ void on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice boxed_physicalDevice,
+ const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+ VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
+ auto physicalDevice = unbox_VkPhysicalDevice(boxed_physicalDevice);
+
+ if (!physicalDevice) {
+ return;
+ }
+ // Cannot forward this call to driver because nVidia linux driver crahses on it.
+ switch (pExternalSemaphoreInfo->handleType) {
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT:
+ pExternalSemaphoreProperties->exportFromImportedHandleTypes =
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT;
+ pExternalSemaphoreProperties->compatibleHandleTypes =
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT;
+ pExternalSemaphoreProperties->externalSemaphoreFeatures =
+ VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT |
+ VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT;
+ return;
+ case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT:
+ pExternalSemaphoreProperties->exportFromImportedHandleTypes =
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT;
+ pExternalSemaphoreProperties->compatibleHandleTypes =
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT;
+ pExternalSemaphoreProperties->externalSemaphoreFeatures =
+ VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT |
+ VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT;
+ return;
+ default:
+ break;
+ }
+
+ pExternalSemaphoreProperties->exportFromImportedHandleTypes = 0;
+ pExternalSemaphoreProperties->compatibleHandleTypes = 0;
+ pExternalSemaphoreProperties->externalSemaphoreFeatures = 0;
+ }
+
+ VkResult on_vkCreateDescriptorUpdateTemplate(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ auto descriptorUpdateTemplateInfo = calcLinearizedDescriptorUpdateTemplateInfo(pCreateInfo);
+
+ VkResult res =
+ vk->vkCreateDescriptorUpdateTemplate(device, &descriptorUpdateTemplateInfo.createInfo,
+ pAllocator, pDescriptorUpdateTemplate);
+
+ if (res == VK_SUCCESS) {
+ registerDescriptorUpdateTemplate(*pDescriptorUpdateTemplate,
+ descriptorUpdateTemplateInfo);
+ *pDescriptorUpdateTemplate =
+ new_boxed_non_dispatchable_VkDescriptorUpdateTemplate(*pDescriptorUpdateTemplate);
+ }
+
+ return res;
+ }
+
+ VkResult on_vkCreateDescriptorUpdateTemplateKHR(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ auto descriptorUpdateTemplateInfo = calcLinearizedDescriptorUpdateTemplateInfo(pCreateInfo);
+
+ VkResult res = vk->vkCreateDescriptorUpdateTemplateKHR(
+ device, &descriptorUpdateTemplateInfo.createInfo, pAllocator,
+ pDescriptorUpdateTemplate);
+
+ if (res == VK_SUCCESS) {
+ registerDescriptorUpdateTemplate(*pDescriptorUpdateTemplate,
+ descriptorUpdateTemplateInfo);
+ *pDescriptorUpdateTemplate =
+ new_boxed_non_dispatchable_VkDescriptorUpdateTemplate(*pDescriptorUpdateTemplate);
+ }
+
+ return res;
+ }
+
+ void on_vkDestroyDescriptorUpdateTemplate(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ vk->vkDestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator);
+
+ unregisterDescriptorUpdateTemplate(descriptorUpdateTemplate);
+ }
+
+ void on_vkDestroyDescriptorUpdateTemplateKHR(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ vk->vkDestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator);
+
+ unregisterDescriptorUpdateTemplate(descriptorUpdateTemplate);
+ }
+
+ void on_vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+ android::base::BumpPool* pool, VkDevice boxed_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 device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* info = android::base::find(mDescriptorUpdateTemplateInfo, descriptorUpdateTemplate);
+ if (!info) return;
+
+ memcpy(info->data.data() + info->imageInfoStart, pImageInfos,
+ imageInfoCount * sizeof(VkDescriptorImageInfo));
+ memcpy(info->data.data() + info->bufferInfoStart, pBufferInfos,
+ bufferInfoCount * sizeof(VkDescriptorBufferInfo));
+ memcpy(info->data.data() + info->bufferViewStart, pBufferViews,
+ bufferViewCount * sizeof(VkBufferView));
+
+ vk->vkUpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate,
+ info->data.data());
+ }
+
+ void on_vkUpdateDescriptorSetWithTemplateSized2GOOGLE(
+ android::base::BumpPool* pool, VkDevice boxed_device, VkDescriptorSet descriptorSet,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount,
+ uint32_t bufferInfoCount, uint32_t bufferViewCount, uint32_t inlineUniformBlockCount,
+ const uint32_t* pImageInfoEntryIndices, const uint32_t* pBufferInfoEntryIndices,
+ const uint32_t* pBufferViewEntryIndices, const VkDescriptorImageInfo* pImageInfos,
+ const VkDescriptorBufferInfo* pBufferInfos, const VkBufferView* pBufferViews,
+ const uint8_t* pInlineUniformBlockData) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* info = android::base::find(mDescriptorUpdateTemplateInfo, descriptorUpdateTemplate);
+ if (!info) return;
+
+ memcpy(info->data.data() + info->imageInfoStart, pImageInfos,
+ imageInfoCount * sizeof(VkDescriptorImageInfo));
+ memcpy(info->data.data() + info->bufferInfoStart, pBufferInfos,
+ bufferInfoCount * sizeof(VkDescriptorBufferInfo));
+ memcpy(info->data.data() + info->bufferViewStart, pBufferViews,
+ bufferViewCount * sizeof(VkBufferView));
+ memcpy(info->data.data() + info->inlineUniformBlockStart, pInlineUniformBlockData,
+ inlineUniformBlockCount);
+
+ vk->vkUpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate,
+ info->data.data());
+ }
+
+ void hostSyncCommandBuffer(const char* tag, VkCommandBuffer boxed_commandBuffer,
+ uint32_t needHostSync, uint32_t sequenceNumber) {
+ auto nextDeadline = []() {
+ return android::base::getUnixTimeUs() + 10000; // 10 ms
+ };
+
+ auto timeoutDeadline = android::base::getUnixTimeUs() + 5000000; // 5 s
+
+ OrderMaintenanceInfo* order = ordmaint_VkCommandBuffer(boxed_commandBuffer);
+ if (!order) return;
+
+ AutoLock lock(order->lock);
+
+ if (needHostSync) {
+ while (
+ (sequenceNumber - __atomic_load_n(&order->sequenceNumber, __ATOMIC_ACQUIRE) != 1)) {
+ auto waitUntilUs = nextDeadline();
+ order->cv.timedWait(&order->lock, waitUntilUs);
+
+ if (timeoutDeadline < android::base::getUnixTimeUs()) {
+ break;
+ }
+ }
+ }
+
+ __atomic_store_n(&order->sequenceNumber, sequenceNumber, __ATOMIC_RELEASE);
+ order->cv.signal();
+ releaseOrderMaintInfo(order);
+ }
+
+ void on_vkCommandBufferHostSyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer, uint32_t needHostSync,
+ uint32_t sequenceNumber) {
+ this->hostSyncCommandBuffer("hostSync", commandBuffer, needHostSync, sequenceNumber);
+ }
+
+ void hostSyncQueue(const char* tag, VkQueue boxed_queue, uint32_t needHostSync,
+ uint32_t sequenceNumber) {
+ auto nextDeadline = []() {
+ return android::base::getUnixTimeUs() + 10000; // 10 ms
+ };
+
+ auto timeoutDeadline = android::base::getUnixTimeUs() + 5000000; // 5 s
+
+ OrderMaintenanceInfo* order = ordmaint_VkQueue(boxed_queue);
+ if (!order) return;
+
+ AutoLock lock(order->lock);
+
+ if (needHostSync) {
+ while (
+ (sequenceNumber - __atomic_load_n(&order->sequenceNumber, __ATOMIC_ACQUIRE) != 1)) {
+ auto waitUntilUs = nextDeadline();
+ order->cv.timedWait(&order->lock, waitUntilUs);
+
+ if (timeoutDeadline < android::base::getUnixTimeUs()) {
+ break;
+ }
+ }
+ }
+
+ __atomic_store_n(&order->sequenceNumber, sequenceNumber, __ATOMIC_RELEASE);
+ order->cv.signal();
+ releaseOrderMaintInfo(order);
+ }
+
+ void on_vkQueueHostSyncGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t needHostSync, uint32_t sequenceNumber) {
+ this->hostSyncQueue("hostSyncQueue", queue, needHostSync, sequenceNumber);
+ }
+
+ VkResult on_vkCreateImageWithRequirementsGOOGLE(android::base::BumpPool* pool,
+ VkDevice boxed_device,
+ const VkImageCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkImage* pImage,
+ VkMemoryRequirements* pMemoryRequirements) {
+ if (pMemoryRequirements) {
+ memset(pMemoryRequirements, 0, sizeof(*pMemoryRequirements));
+ }
+
+ VkResult imageCreateRes =
+ on_vkCreateImage(pool, boxed_device, pCreateInfo, pAllocator, pImage);
+
+ if (imageCreateRes != VK_SUCCESS) {
+ return imageCreateRes;
+ }
+
+ on_vkGetImageMemoryRequirements(pool, boxed_device, unbox_VkImage(*pImage),
+ pMemoryRequirements);
+
+ return imageCreateRes;
+ }
+
+ VkResult on_vkCreateBufferWithRequirementsGOOGLE(android::base::BumpPool* pool,
+ VkDevice boxed_device,
+ const VkBufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkBuffer* pBuffer,
+ VkMemoryRequirements* pMemoryRequirements) {
+ if (pMemoryRequirements) {
+ memset(pMemoryRequirements, 0, sizeof(*pMemoryRequirements));
+ }
+
+ VkResult bufferCreateRes =
+ on_vkCreateBuffer(pool, boxed_device, pCreateInfo, pAllocator, pBuffer);
+
+ if (bufferCreateRes != VK_SUCCESS) {
+ return bufferCreateRes;
+ }
+
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ vk->vkGetBufferMemoryRequirements(device, unbox_VkBuffer(*pBuffer), pMemoryRequirements);
+
+ return bufferCreateRes;
+ }
+
+ VkResult on_vkBeginCommandBuffer(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkCommandBufferBeginInfo* pBeginInfo,
+ const VkDecoderContext& context) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+ VkResult result = vk->vkBeginCommandBuffer(commandBuffer, pBeginInfo);
+
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* commandBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (!commandBufferInfo) return VK_ERROR_UNKNOWN;
+ commandBufferInfo->reset();
+
+ if (context.processName) {
+ commandBufferInfo->debugUtilsHelper.cmdBeginDebugLabel(commandBuffer, "Process %s",
+ context.processName);
+ }
+
+ return VK_SUCCESS;
+ }
+
+ VkResult on_vkBeginCommandBufferAsyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkCommandBufferBeginInfo* pBeginInfo,
+ const VkDecoderContext& context) {
+ return this->on_vkBeginCommandBuffer(pool, boxed_commandBuffer, pBeginInfo, context);
+ }
+
+ VkResult on_vkEndCommandBuffer(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkDecoderContext& context) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* commandBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (!commandBufferInfo) return VK_ERROR_UNKNOWN;
+
+ if (context.processName) {
+ commandBufferInfo->debugUtilsHelper.cmdEndDebugLabel(commandBuffer);
+ }
+
+ return vk->vkEndCommandBuffer(commandBuffer);
+ }
+
+ void on_vkEndCommandBufferAsyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ const VkDecoderContext& context) {
+ on_vkEndCommandBuffer(pool, boxed_commandBuffer, context);
+ }
+
+ void on_vkResetCommandBufferAsyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ VkCommandBufferResetFlags flags) {
+ on_vkResetCommandBuffer(pool, boxed_commandBuffer, flags);
+ }
+
+ void on_vkCmdBindPipeline(android::base::BumpPool* pool, VkCommandBuffer boxed_commandBuffer,
+ VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+ vk->vkCmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
+ if (pipelineBindPoint == VK_PIPELINE_BIND_POINT_COMPUTE) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* cmdBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (cmdBufferInfo) {
+ cmdBufferInfo->computePipeline = pipeline;
+ }
+ }
+ }
+
+ void on_vkCmdBindDescriptorSets(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer,
+ VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
+ uint32_t firstSet, uint32_t descriptorSetCount,
+ const VkDescriptorSet* pDescriptorSets,
+ uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+ vk->vkCmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet,
+ descriptorSetCount, pDescriptorSets, dynamicOffsetCount,
+ pDynamicOffsets);
+ if (pipelineBindPoint == VK_PIPELINE_BIND_POINT_COMPUTE) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto* cmdBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (cmdBufferInfo) {
+ cmdBufferInfo->descriptorLayout = layout;
+
+ if (descriptorSetCount) {
+ cmdBufferInfo->firstSet = firstSet;
+ cmdBufferInfo->descriptorSets.assign(pDescriptorSets,
+ pDescriptorSets + descriptorSetCount);
+ cmdBufferInfo->dynamicOffsets.assign(pDynamicOffsets,
+ pDynamicOffsets + dynamicOffsetCount);
+ }
+ }
+ }
+ }
+
+ VkResult on_vkCreateRenderPass(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkRenderPassCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkRenderPass* pRenderPass) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ VkRenderPassCreateInfo createInfo;
+ bool needReformat = false;
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (deviceInfo->emulateTextureEtc2 || deviceInfo->emulateTextureAstc) {
+ for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) {
+ if (deviceInfo->needEmulatedDecompression(pCreateInfo->pAttachments[i].format)) {
+ needReformat = true;
+ break;
+ }
+ }
+ }
+ std::vector<VkAttachmentDescription> attachments;
+ if (needReformat) {
+ createInfo = *pCreateInfo;
+ attachments.assign(pCreateInfo->pAttachments,
+ pCreateInfo->pAttachments + pCreateInfo->attachmentCount);
+ createInfo.pAttachments = attachments.data();
+ for (auto& attachment : attachments) {
+ attachment.format = CompressedImageInfo::getOutputFormat(attachment.format);
+ }
+ pCreateInfo = &createInfo;
+ }
+ VkResult res = vk->vkCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass);
+ if (res != VK_SUCCESS) {
+ return res;
+ }
+
+ auto& renderPassInfo = mRenderPassInfo[*pRenderPass];
+ renderPassInfo.device = device;
+
+ *pRenderPass = new_boxed_non_dispatchable_VkRenderPass(*pRenderPass);
+
+ return res;
+ }
+
+ VkResult on_vkCreateRenderPass2(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkRenderPassCreateInfo2* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkRenderPass* pRenderPass) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ VkResult res = vk->vkCreateRenderPass2(device, pCreateInfo, pAllocator, pRenderPass);
+ if (res != VK_SUCCESS) {
+ return res;
+ }
+
+ auto& renderPassInfo = mRenderPassInfo[*pRenderPass];
+ renderPassInfo.device = device;
+
+ *pRenderPass = new_boxed_non_dispatchable_VkRenderPass(*pRenderPass);
+
+ return res;
+ }
+
+ void destroyRenderPassLocked(VkDevice device, VulkanDispatch* deviceDispatch,
+ VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) {
+ deviceDispatch->vkDestroyRenderPass(device, renderPass, pAllocator);
+
+ mRenderPassInfo.erase(renderPass);
+ }
+
+ void on_vkDestroyRenderPass(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ destroyRenderPassLocked(device, deviceDispatch, renderPass, pAllocator);
+ }
+
+ void on_vkCmdCopyQueryPoolResults(android::base::BumpPool* pool,
+ VkCommandBuffer boxed_commandBuffer, VkQueryPool queryPool,
+ uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer,
+ VkDeviceSize dstOffset, VkDeviceSize stride,
+ VkQueryResultFlags flags) {
+ auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+ if (queryCount == 1 && stride == 0) {
+ // Some drivers don't seem to handle stride==0 very well.
+ // In fact, the spec does not say what should happen with stride==0.
+ // So we just use the largest stride possible.
+ stride = mBufferInfo[dstBuffer].size - dstOffset;
+ }
+ vk->vkCmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer,
+ dstOffset, stride, flags);
+ }
+
+ VkResult on_vkCreateFramebuffer(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkFramebufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkFramebuffer* pFramebuffer) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ VkResult result =
+ deviceDispatch->vkCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto& framebufferInfo = mFramebufferInfo[*pFramebuffer];
+ framebufferInfo.device = device;
+
+ *pFramebuffer = new_boxed_non_dispatchable_VkFramebuffer(*pFramebuffer);
+
+ return result;
+ }
+
+ void destroyFramebufferLocked(VkDevice device, VulkanDispatch* deviceDispatch,
+ VkFramebuffer framebuffer,
+ const VkAllocationCallbacks* pAllocator) {
+ deviceDispatch->vkDestroyFramebuffer(device, framebuffer, pAllocator);
+
+ mFramebufferInfo.erase(framebuffer);
+ }
+
+ void on_vkDestroyFramebuffer(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkFramebuffer framebuffer,
+ const VkAllocationCallbacks* pAllocator) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto deviceDispatch = dispatch_VkDevice(boxed_device);
+
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ destroyFramebufferLocked(device, deviceDispatch, framebuffer, pAllocator);
+ }
+
+ VkResult on_vkQueueBindSparse(android::base::BumpPool* pool, VkQueue boxed_queue,
+ uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo,
+ VkFence fence) {
+ // If pBindInfo contains VkTimelineSemaphoreSubmitInfo, then it's
+ // possible the host driver isn't equipped to deal with them yet. To
+ // work around this, send empty vkQueueSubmits before and after the
+ // call to vkQueueBindSparse that contain the right values for
+ // wait/signal semaphores and contains the user's
+ // VkTimelineSemaphoreSubmitInfo structure, following the *submission
+ // order* implied by the indices of pBindInfo.
+
+ // TODO: Detect if we are running on a driver that supports timeline
+ // semaphore signal/wait operations in vkQueueBindSparse
+ const bool needTimelineSubmitInfoWorkaround = true;
+ (void)needTimelineSubmitInfoWorkaround;
+
+ bool hasTimelineSemaphoreSubmitInfo = false;
+
+ for (uint32_t i = 0; i < bindInfoCount; ++i) {
+ const VkTimelineSemaphoreSubmitInfoKHR* tsSi =
+ vk_find_struct<VkTimelineSemaphoreSubmitInfoKHR>(pBindInfo + i);
+ if (tsSi) {
+ hasTimelineSemaphoreSubmitInfo = true;
+ }
+ }
+
+ auto queue = unbox_VkQueue(boxed_queue);
+ auto vk = dispatch_VkQueue(boxed_queue);
+
+ if (!hasTimelineSemaphoreSubmitInfo) {
+ (void)pool;
+ return vk->vkQueueBindSparse(queue, bindInfoCount, pBindInfo, fence);
+ } else {
+ std::vector<VkPipelineStageFlags> waitDstStageMasks;
+ VkTimelineSemaphoreSubmitInfoKHR currTsSi = {
+ VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO, 0, 0, nullptr, 0, nullptr,
+ };
+
+ VkSubmitInfo currSi = {
+ VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ &currTsSi,
+ 0,
+ nullptr,
+ nullptr,
+ 0,
+ nullptr, // No commands
+ 0,
+ nullptr,
+ };
+
+ VkBindSparseInfo currBi;
+
+ VkResult res;
+
+ for (uint32_t i = 0; i < bindInfoCount; ++i) {
+ const VkTimelineSemaphoreSubmitInfoKHR* tsSi =
+ vk_find_struct<VkTimelineSemaphoreSubmitInfoKHR>(pBindInfo + i);
+ if (!tsSi) {
+ res = vk->vkQueueBindSparse(queue, 1, pBindInfo + i, fence);
+ if (VK_SUCCESS != res) return res;
+ continue;
+ }
+
+ currTsSi.waitSemaphoreValueCount = tsSi->waitSemaphoreValueCount;
+ currTsSi.pWaitSemaphoreValues = tsSi->pWaitSemaphoreValues;
+ currTsSi.signalSemaphoreValueCount = 0;
+ currTsSi.pSignalSemaphoreValues = nullptr;
+
+ currSi.waitSemaphoreCount = pBindInfo[i].waitSemaphoreCount;
+ currSi.pWaitSemaphores = pBindInfo[i].pWaitSemaphores;
+ waitDstStageMasks.resize(pBindInfo[i].waitSemaphoreCount,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT);
+ currSi.pWaitDstStageMask = waitDstStageMasks.data();
+
+ currSi.signalSemaphoreCount = 0;
+ currSi.pSignalSemaphores = nullptr;
+
+ res = vk->vkQueueSubmit(queue, 1, &currSi, nullptr);
+ if (VK_SUCCESS != res) return res;
+
+ currBi = pBindInfo[i];
+
+ vk_struct_chain_remove(tsSi, &currBi);
+
+ currBi.waitSemaphoreCount = 0;
+ currBi.pWaitSemaphores = nullptr;
+ currBi.signalSemaphoreCount = 0;
+ currBi.pSignalSemaphores = nullptr;
+
+ res = vk->vkQueueBindSparse(queue, 1, &currBi, nullptr);
+ if (VK_SUCCESS != res) return res;
+
+ currTsSi.waitSemaphoreValueCount = 0;
+ currTsSi.pWaitSemaphoreValues = nullptr;
+ currTsSi.signalSemaphoreValueCount = tsSi->signalSemaphoreValueCount;
+ currTsSi.pSignalSemaphoreValues = tsSi->pSignalSemaphoreValues;
+
+ currSi.waitSemaphoreCount = 0;
+ currSi.pWaitSemaphores = nullptr;
+ currSi.signalSemaphoreCount = pBindInfo[i].signalSemaphoreCount;
+ currSi.pSignalSemaphores = pBindInfo[i].pSignalSemaphores;
+
+ res =
+ vk->vkQueueSubmit(queue, 1, &currSi, i == bindInfoCount - 1 ? fence : nullptr);
+ if (VK_SUCCESS != res) return res;
+ }
+
+ return VK_SUCCESS;
+ }
+ }
+
+ void on_vkGetLinearImageLayoutGOOGLE(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkFormat format, VkDeviceSize* pOffset,
+ VkDeviceSize* pRowPitchAlignment) {
+ if (mPerFormatLinearImageProperties.find(format) == mPerFormatLinearImageProperties.end()) {
+ VkDeviceSize offset = 0u;
+ VkDeviceSize rowPitchAlignment = UINT_MAX;
+
+ for (uint32_t width = 64; width <= 256; width++) {
+ LinearImageCreateInfo linearImageCreateInfo = {
+ .extent =
+ {
+ .width = width,
+ .height = 64,
+ .depth = 1,
+ },
+ .format = format,
+ .usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT,
+ };
+
+ VkDeviceSize currOffset = 0u;
+ VkDeviceSize currRowPitchAlignment = UINT_MAX;
+
+ VkImageCreateInfo defaultVkImageCreateInfo = linearImageCreateInfo.toDefaultVk();
+ on_vkGetLinearImageLayout2GOOGLE(pool, boxed_device, &defaultVkImageCreateInfo,
+ &currOffset, &currRowPitchAlignment);
+
+ offset = currOffset;
+ rowPitchAlignment = std::min(currRowPitchAlignment, rowPitchAlignment);
+ }
+ mPerFormatLinearImageProperties[format] = LinearImageProperties{
+ .offset = offset,
+ .rowPitchAlignment = rowPitchAlignment,
+ };
+ }
+
+ if (pOffset) {
+ *pOffset = mPerFormatLinearImageProperties[format].offset;
+ }
+ if (pRowPitchAlignment) {
+ *pRowPitchAlignment = mPerFormatLinearImageProperties[format].rowPitchAlignment;
+ }
+ }
+
+ void on_vkGetLinearImageLayout2GOOGLE(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkImageCreateInfo* pCreateInfo,
+ VkDeviceSize* pOffset, VkDeviceSize* pRowPitchAlignment) {
+ LinearImageCreateInfo linearImageCreateInfo = {
+ .extent = pCreateInfo->extent,
+ .format = pCreateInfo->format,
+ .usage = pCreateInfo->usage,
+ };
+ if (mLinearImageProperties.find(linearImageCreateInfo) == mLinearImageProperties.end()) {
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+
+ VkImageSubresource subresource = {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .mipLevel = 0,
+ .arrayLayer = 0,
+ };
+
+ VkImage image;
+ VkSubresourceLayout subresourceLayout;
+
+ VkImageCreateInfo defaultVkImageCreateInfo = linearImageCreateInfo.toDefaultVk();
+ VkResult result = vk->vkCreateImage(device, &defaultVkImageCreateInfo, nullptr, &image);
+ if (result != VK_SUCCESS) {
+ fprintf(stderr, "vkCreateImage failed. size: (%u x %u) result: %d\n",
+ linearImageCreateInfo.extent.width, linearImageCreateInfo.extent.height,
+ result);
+ return;
+ }
+ vk->vkGetImageSubresourceLayout(device, image, &subresource, &subresourceLayout);
+ vk->vkDestroyImage(device, image, nullptr);
+
+ VkDeviceSize offset = subresourceLayout.offset;
+ uint64_t rowPitch = subresourceLayout.rowPitch;
+ VkDeviceSize rowPitchAlignment = rowPitch & (~rowPitch + 1);
+
+ mLinearImageProperties[linearImageCreateInfo] = {
+ .offset = offset,
+ .rowPitchAlignment = rowPitchAlignment,
+ };
+ }
+
+ if (pOffset != nullptr) {
+ *pOffset = mLinearImageProperties[linearImageCreateInfo].offset;
+ }
+ if (pRowPitchAlignment != nullptr) {
+ *pRowPitchAlignment = mLinearImageProperties[linearImageCreateInfo].rowPitchAlignment;
+ }
+ }
+
+#include "VkSubDecoder.cpp"
+
+ void on_vkQueueFlushCommandsGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ VkCommandBuffer boxed_commandBuffer, VkDeviceSize dataSize,
+ const void* pData, const VkDecoderContext& context) {
+ (void)queue;
+
+ VkCommandBuffer commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
+ VulkanDispatch* vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+ VulkanMemReadingStream* readStream = readstream_VkCommandBuffer(boxed_commandBuffer);
+ subDecode(readStream, vk, boxed_commandBuffer, commandBuffer, dataSize, pData, context);
+ }
+
+ void on_vkQueueFlushCommandsFromAuxMemoryGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ VkCommandBuffer commandBuffer,
+ VkDeviceMemory deviceMemory,
+ VkDeviceSize dataOffset, VkDeviceSize dataSize,
+ const VkDecoderContext& context) {
+ // TODO : implement
+ }
+ VkDescriptorSet getOrAllocateDescriptorSetFromPoolAndId(VulkanDispatch* vk, VkDevice device,
+ VkDescriptorPool pool,
+ VkDescriptorSetLayout setLayout,
+ uint64_t poolId, uint32_t pendingAlloc,
+ bool* didAlloc) {
+ auto* poolInfo = android::base::find(mDescriptorPoolInfo, pool);
+ if (!poolInfo) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "descriptor pool " << pool << " not found ";
+ }
+
+ DispatchableHandleInfo<uint64_t>* setHandleInfo = sBoxedHandleManager.get(poolId);
+
+ if (setHandleInfo->underlying) {
+ if (pendingAlloc) {
+ VkDescriptorSet allocedSet;
+ vk->vkFreeDescriptorSets(device, pool, 1,
+ (VkDescriptorSet*)(&setHandleInfo->underlying));
+ VkDescriptorSetAllocateInfo dsAi = {
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, 0, pool, 1, &setLayout,
+ };
+ vk->vkAllocateDescriptorSets(device, &dsAi, &allocedSet);
+ setHandleInfo->underlying = (uint64_t)allocedSet;
+ initDescriptorSetInfoLocked(pool, setLayout, poolId, allocedSet);
+ *didAlloc = true;
+ return allocedSet;
+ } else {
+ *didAlloc = false;
+ return (VkDescriptorSet)(setHandleInfo->underlying);
+ }
+ } else {
+ if (pendingAlloc) {
+ VkDescriptorSet allocedSet;
+ VkDescriptorSetAllocateInfo dsAi = {
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, 0, pool, 1, &setLayout,
+ };
+ vk->vkAllocateDescriptorSets(device, &dsAi, &allocedSet);
+ setHandleInfo->underlying = (uint64_t)allocedSet;
+ initDescriptorSetInfoLocked(pool, setLayout, poolId, allocedSet);
+ *didAlloc = true;
+ return allocedSet;
+ } else {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "descriptor pool " << pool << " wanted to get set with id 0x" << std::hex
+ << poolId;
+ return nullptr;
+ }
+ }
+ }
+
+ void on_vkQueueCommitDescriptorSetUpdatesGOOGLE(
+ android::base::BumpPool* pool, VkQueue boxed_queue, uint32_t descriptorPoolCount,
+ const VkDescriptorPool* pDescriptorPools, uint32_t descriptorSetCount,
+ const VkDescriptorSetLayout* pDescriptorSetLayouts, const uint64_t* pDescriptorSetPoolIds,
+ const uint32_t* pDescriptorSetWhichPool, const uint32_t* pDescriptorSetPendingAllocation,
+ const uint32_t* pDescriptorWriteStartingIndices, uint32_t pendingDescriptorWriteCount,
+ const VkWriteDescriptorSet* pPendingDescriptorWrites) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ VkDevice device;
+
+ auto queue = unbox_VkQueue(boxed_queue);
+ auto vk = dispatch_VkQueue(boxed_queue);
+
+ auto* queueInfo = android::base::find(mQueueInfo, queue);
+ if (queueInfo) {
+ device = queueInfo->device;
+ } else {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "queue " << queue << "(boxed: " << boxed_queue << ") with no device registered";
+ }
+
+ std::vector<VkDescriptorSet> setsToUpdate(descriptorSetCount, nullptr);
+
+ bool didAlloc = false;
+
+ for (uint32_t i = 0; i < descriptorSetCount; ++i) {
+ uint64_t poolId = pDescriptorSetPoolIds[i];
+ uint32_t whichPool = pDescriptorSetWhichPool[i];
+ uint32_t pendingAlloc = pDescriptorSetPendingAllocation[i];
+ bool didAllocThisTime;
+ setsToUpdate[i] = getOrAllocateDescriptorSetFromPoolAndId(
+ vk, device, pDescriptorPools[whichPool], pDescriptorSetLayouts[i], poolId,
+ pendingAlloc, &didAllocThisTime);
+
+ if (didAllocThisTime) didAlloc = true;
+ }
+
+ if (didAlloc) {
+ std::vector<VkWriteDescriptorSet> writeDescriptorSetsForHostDriver(
+ pendingDescriptorWriteCount);
+ memcpy(writeDescriptorSetsForHostDriver.data(), pPendingDescriptorWrites,
+ pendingDescriptorWriteCount * sizeof(VkWriteDescriptorSet));
+
+ for (uint32_t i = 0; i < descriptorSetCount; ++i) {
+ uint32_t writeStartIndex = pDescriptorWriteStartingIndices[i];
+ uint32_t writeEndIndex;
+ if (i == descriptorSetCount - 1) {
+ writeEndIndex = pendingDescriptorWriteCount;
+ } else {
+ writeEndIndex = pDescriptorWriteStartingIndices[i + 1];
+ }
+
+ for (uint32_t j = writeStartIndex; j < writeEndIndex; ++j) {
+ writeDescriptorSetsForHostDriver[j].dstSet = setsToUpdate[i];
+ }
+ }
+ this->on_vkUpdateDescriptorSetsImpl(
+ pool, vk, device, (uint32_t)writeDescriptorSetsForHostDriver.size(),
+ writeDescriptorSetsForHostDriver.data(), 0, nullptr);
+ } else {
+ this->on_vkUpdateDescriptorSetsImpl(pool, vk, device, pendingDescriptorWriteCount,
+ pPendingDescriptorWrites, 0, nullptr);
+ }
+ }
+
+ void on_vkCollectDescriptorPoolIdsGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ VkDescriptorPool descriptorPool,
+ uint32_t* pPoolIdCount, uint64_t* pPoolIds) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ auto& info = mDescriptorPoolInfo[descriptorPool];
+ *pPoolIdCount = (uint32_t)info.poolIds.size();
+
+ if (pPoolIds) {
+ for (uint32_t i = 0; i < info.poolIds.size(); ++i) {
+ pPoolIds[i] = info.poolIds[i];
+ }
+ }
+ }
+
+ VkResult on_vkCreateSamplerYcbcrConversion(
+ android::base::BumpPool*, VkDevice boxed_device,
+ const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) {
+ if (m_emu->enableYcbcrEmulation && !m_emu->deviceInfo.supportsSamplerYcbcrConversion) {
+ *pYcbcrConversion = new_boxed_non_dispatchable_VkSamplerYcbcrConversion(
+ (VkSamplerYcbcrConversion)((uintptr_t)0xffff0000ull));
+ return VK_SUCCESS;
+ }
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ VkResult res =
+ vk->vkCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion);
+ if (res != VK_SUCCESS) {
+ return res;
+ }
+ *pYcbcrConversion = new_boxed_non_dispatchable_VkSamplerYcbcrConversion(*pYcbcrConversion);
+ return VK_SUCCESS;
+ }
+
+ void on_vkDestroySamplerYcbcrConversion(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkSamplerYcbcrConversion ycbcrConversion,
+ const VkAllocationCallbacks* pAllocator) {
+ if (m_emu->enableYcbcrEmulation && !m_emu->deviceInfo.supportsSamplerYcbcrConversion) {
+ return;
+ }
+ auto device = unbox_VkDevice(boxed_device);
+ auto vk = dispatch_VkDevice(boxed_device);
+ vk->vkDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator);
+ return;
+ }
+
+ void on_DeviceLost() { GFXSTREAM_ABORT(FatalError(VK_ERROR_DEVICE_LOST)); }
+
+ void DeviceLostHandler() {}
+
+ void on_CheckOutOfMemory(VkResult result, uint32_t opCode, const VkDecoderContext& context,
+ std::optional<uint64_t> allocationSize = std::nullopt) {
+ if (result == VK_ERROR_OUT_OF_HOST_MEMORY || result == VK_ERROR_OUT_OF_DEVICE_MEMORY ||
+ result == VK_ERROR_OUT_OF_POOL_MEMORY) {
+ context.metricsLogger->logMetricEvent(
+ MetricEventVulkanOutOfMemory{.vkResultCode = result,
+ .opCode = std::make_optional(opCode),
+ .allocationSize = allocationSize});
+ }
+ }
+
+ VkResult waitForFence(VkFence boxed_fence, uint64_t timeout) {
+ VkFence fence;
+ VkDevice device;
+ VulkanDispatch* vk;
+ StaticLock* fenceLock;
+ ConditionVariable* cv;
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ fence = unbox_VkFence(boxed_fence);
+ if (fence == VK_NULL_HANDLE || mFenceInfo.find(fence) == mFenceInfo.end()) {
+ // No fence, could be a semaphore.
+ // TODO: Async wait for semaphores
+ return VK_SUCCESS;
+ }
+
+ // Vulkan specs require fences of vkQueueSubmit to be *externally
+ // synchronized*, i.e. we cannot submit a queue while waiting for the
+ // fence in another thread. For threads that call this function, they
+ // have to wait until a vkQueueSubmit() using this fence is called
+ // before calling vkWaitForFences(). So we use a conditional variable
+ // and mutex for thread synchronization.
+ //
+ // See:
+ // https://www.khronos.org/registry/vulkan/specs/1.2/html/vkspec.html#fundamentals-threadingbehavior
+ // https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/519
+
+ device = mFenceInfo[fence].device;
+ vk = mFenceInfo[fence].vk;
+ fenceLock = &mFenceInfo[fence].lock;
+ cv = &mFenceInfo[fence].cv;
+ }
+
+ fenceLock->lock();
+ cv->wait(fenceLock, [this, fence] {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ if (mFenceInfo[fence].state == FenceInfo::State::kWaitable) {
+ mFenceInfo[fence].state = FenceInfo::State::kWaiting;
+ return true;
+ }
+ return false;
+ });
+ fenceLock->unlock();
+
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ if (mFenceInfo.find(fence) == mFenceInfo.end()) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Fence was destroyed before vkWaitForFences call.";
+ }
+ }
+
+ return vk->vkWaitForFences(device, /* fenceCount */ 1u, &fence,
+ /* waitAll */ false, timeout);
+ }
+
+ VkResult getFenceStatus(VkFence boxed_fence) {
+ VkDevice device;
+ VkFence fence;
+ VulkanDispatch* vk;
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ fence = unbox_VkFence(boxed_fence);
+ if (fence == VK_NULL_HANDLE || mFenceInfo.find(fence) == mFenceInfo.end()) {
+ // No fence, could be a semaphore.
+ // TODO: Async get status for semaphores
+ return VK_SUCCESS;
+ }
+
+ device = mFenceInfo[fence].device;
+ vk = mFenceInfo[fence].vk;
+ }
+
+ return vk->vkGetFenceStatus(device, fence);
+ }
+
+ AsyncResult registerQsriCallback(VkImage boxed_image, VkQsriTimeline::Callback callback) {
+ VkImage image;
+ std::shared_ptr<AndroidNativeBufferInfo> anbInfo;
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ image = unbox_VkImage(boxed_image);
+
+ if (mLogging) {
+ fprintf(stderr, "%s: for boxed image 0x%llx image %p\n", __func__,
+ (unsigned long long)boxed_image, image);
+ }
+
+ if (image == VK_NULL_HANDLE || mImageInfo.find(image) == mImageInfo.end()) {
+ // No image
+ return AsyncResult::FAIL_AND_CALLBACK_NOT_SCHEDULED;
+ }
+
+ anbInfo = mImageInfo[image].anbInfo; // shared ptr, take ref
+ }
+
+ if (!anbInfo) {
+ fprintf(stderr, "%s: warning: image %p doesn't ahve anb info\n", __func__, image);
+ return AsyncResult::FAIL_AND_CALLBACK_NOT_SCHEDULED;
+ }
+ if (!anbInfo->vk) {
+ fprintf(stderr, "%s:%p warning: image %p anb info not initialized\n", __func__,
+ anbInfo.get(), image);
+ return AsyncResult::FAIL_AND_CALLBACK_NOT_SCHEDULED;
+ }
+ // Could be null or mismatched image, check later
+ if (image != anbInfo->image) {
+ fprintf(stderr, "%s:%p warning: image %p anb info has wrong image: %p\n", __func__,
+ anbInfo.get(), image, anbInfo->image);
+ return AsyncResult::FAIL_AND_CALLBACK_NOT_SCHEDULED;
+ }
+
+ anbInfo->qsriTimeline->registerCallbackForNextPresentAndPoll(std::move(callback));
+
+ if (mLogging) {
+ fprintf(stderr, "%s:%p Done registering\n", __func__, anbInfo.get());
+ }
+ return AsyncResult::OK_AND_CALLBACK_SCHEDULED;
+ }
+
+#define GUEST_EXTERNAL_MEMORY_HANDLE_TYPES \
+ (VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID | \
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA)
+
+ // Transforms
+ // If adding a new transform here, please check if it needs to be used in VkDecoderTestDispatch
+
+ void transformImpl_VkExternalMemoryProperties_tohost(const VkExternalMemoryProperties* props,
+ uint32_t count) {
+ VkExternalMemoryProperties* mut = (VkExternalMemoryProperties*)props;
+ for (uint32_t i = 0; i < count; ++i) {
+ mut[i] = transformExternalMemoryProperties_tohost(mut[i]);
+ }
+ }
+ void transformImpl_VkExternalMemoryProperties_fromhost(const VkExternalMemoryProperties* props,
+ uint32_t count) {
+ VkExternalMemoryProperties* mut = (VkExternalMemoryProperties*)props;
+ for (uint32_t i = 0; i < count; ++i) {
+ mut[i] = transformExternalMemoryProperties_fromhost(mut[i],
+ GUEST_EXTERNAL_MEMORY_HANDLE_TYPES);
+ }
+ }
+
+ void transformImpl_VkImageCreateInfo_tohost(const VkImageCreateInfo* pImageCreateInfos,
+ uint32_t count) {
+ for (uint32_t i = 0; i < count; i++) {
+ VkImageCreateInfo& imageCreateInfo =
+ const_cast<VkImageCreateInfo&>(pImageCreateInfos[i]);
+ const VkExternalMemoryImageCreateInfo* pExternalMemoryImageCi =
+ vk_find_struct<VkExternalMemoryImageCreateInfo>(&imageCreateInfo);
+ bool importAndroidHardwareBuffer =
+ pExternalMemoryImageCi &&
+ (pExternalMemoryImageCi->handleTypes &
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID);
+ const VkNativeBufferANDROID* pNativeBufferANDROID =
+ vk_find_struct<VkNativeBufferANDROID>(&imageCreateInfo);
+
+ // If the VkImage is going to bind to a ColorBuffer, we have to make sure the VkImage
+ // that backs the ColorBuffer is created with identical parameters. From the spec: If
+ // two aliases are both images that were created with identical creation parameters,
+ // both were created with the VK_IMAGE_CREATE_ALIAS_BIT flag set, and both are bound
+ // identically to memory except for VkBindImageMemoryDeviceGroupInfo::pDeviceIndices and
+ // VkBindImageMemoryDeviceGroupInfo::pSplitInstanceBindRegions, then they interpret the
+ // contents of the memory in consistent ways, and data written to one alias can be read
+ // by the other alias. ... Aliases created by binding the same memory to resources in
+ // multiple Vulkan instances or external APIs using external memory handle export and
+ // import mechanisms interpret the contents of the memory in consistent ways, and data
+ // written to one alias can be read by the other alias. Otherwise, the aliases interpret
+ // the contents of the memory differently, ...
+ std::unique_ptr<VkImageCreateInfo> colorBufferVkImageCi = nullptr;
+ std::string importSource;
+ VkFormat resolvedFormat = VK_FORMAT_UNDEFINED;
+ // Use UNORM formats for SRGB format requests.
+ switch (imageCreateInfo.format) {
+ case VK_FORMAT_R8G8B8A8_SRGB:
+ resolvedFormat = VK_FORMAT_R8G8B8A8_UNORM;
+ break;
+ case VK_FORMAT_R8G8B8_SRGB:
+ resolvedFormat = VK_FORMAT_R8G8B8_UNORM;
+ break;
+ case VK_FORMAT_B8G8R8A8_SRGB:
+ resolvedFormat = VK_FORMAT_B8G8R8A8_UNORM;
+ break;
+ case VK_FORMAT_R8_SRGB:
+ resolvedFormat = VK_FORMAT_R8_UNORM;
+ break;
+ default:
+ resolvedFormat = imageCreateInfo.format;
+ }
+ if (importAndroidHardwareBuffer) {
+ // For AHardwareBufferImage binding, we can't know which ColorBuffer this
+ // to-be-created VkImage will bind to, so we try our best to infer the creation
+ // parameters.
+ colorBufferVkImageCi = generateColorBufferVkImageCreateInfo(
+ resolvedFormat, imageCreateInfo.extent.width, imageCreateInfo.extent.height,
+ imageCreateInfo.tiling);
+ importSource = "AHardwareBuffer";
+ } else if (pNativeBufferANDROID) {
+ // For native buffer binding, we can query the creation parameters from handle.
+ uint32_t cbHandle = *static_cast<const uint32_t*>(pNativeBufferANDROID->handle);
+ auto colorBufferInfo = getColorBufferInfo(cbHandle);
+ if (colorBufferInfo.handle == cbHandle) {
+ colorBufferVkImageCi =
+ std::make_unique<VkImageCreateInfo>(colorBufferInfo.imageCreateInfoShallow);
+ } else {
+ ERR("Unknown ColorBuffer handle: %" PRIu32 ".", cbHandle);
+ }
+ importSource = "NativeBufferANDROID";
+ }
+ if (!colorBufferVkImageCi) {
+ continue;
+ }
+ imageCreateInfo.format = resolvedFormat;
+ if (imageCreateInfo.flags & (~colorBufferVkImageCi->flags)) {
+ ERR("The VkImageCreateInfo to import %s contains unsupported VkImageCreateFlags. "
+ "All supported VkImageCreateFlags are %s, the input VkImageCreateInfo requires "
+ "support for %s.",
+ importSource.c_str(),
+ string_VkImageCreateFlags(colorBufferVkImageCi->flags).c_str(),
+ string_VkImageCreateFlags(imageCreateInfo.flags).c_str());
+ }
+ imageCreateInfo.flags |= colorBufferVkImageCi->flags;
+ if (imageCreateInfo.imageType != colorBufferVkImageCi->imageType) {
+ ERR("The VkImageCreateInfo to import %s has an unexpected VkImageType: %s, %s "
+ "expected.",
+ importSource.c_str(), string_VkImageType(imageCreateInfo.imageType),
+ string_VkImageType(colorBufferVkImageCi->imageType));
+ }
+ if (imageCreateInfo.extent.depth != colorBufferVkImageCi->extent.depth) {
+ ERR("The VkImageCreateInfo to import %s has an unexpected VkExtent::depth: %" PRIu32
+ ", %" PRIu32 " expected.",
+ importSource.c_str(), imageCreateInfo.extent.depth,
+ colorBufferVkImageCi->extent.depth);
+ }
+ if (imageCreateInfo.mipLevels != colorBufferVkImageCi->mipLevels) {
+ ERR("The VkImageCreateInfo to import %s has an unexpected mipLevels: %" PRIu32
+ ", %" PRIu32 " expected.",
+ importSource.c_str(), imageCreateInfo.mipLevels,
+ colorBufferVkImageCi->mipLevels);
+ }
+ if (imageCreateInfo.arrayLayers != colorBufferVkImageCi->arrayLayers) {
+ ERR("The VkImageCreateInfo to import %s has an unexpected arrayLayers: %" PRIu32
+ ", %" PRIu32 " expected.",
+ importSource.c_str(), imageCreateInfo.arrayLayers,
+ colorBufferVkImageCi->arrayLayers);
+ }
+ if (imageCreateInfo.samples != colorBufferVkImageCi->samples) {
+ ERR("The VkImageCreateInfo to import %s has an unexpected VkSampleCountFlagBits: "
+ "%s, %s expected.",
+ importSource.c_str(), string_VkSampleCountFlagBits(imageCreateInfo.samples),
+ string_VkSampleCountFlagBits(colorBufferVkImageCi->samples));
+ }
+ if (imageCreateInfo.usage & (~colorBufferVkImageCi->usage)) {
+ ERR("The VkImageCreateInfo to import %s contains unsupported VkImageUsageFlags. "
+ "All supported VkImageUsageFlags are %s, the input VkImageCreateInfo requires "
+ "support for %s.",
+ importSource.c_str(),
+ string_VkImageUsageFlags(colorBufferVkImageCi->usage).c_str(),
+ string_VkImageUsageFlags(imageCreateInfo.usage).c_str());
+ }
+ imageCreateInfo.usage |= colorBufferVkImageCi->usage;
+ // For the AndroidHardwareBuffer binding case VkImageCreateInfo::sharingMode isn't
+ // filled in generateColorBufferVkImageCreateInfo, and
+ // VkImageCreateInfo::{format,extent::{width, height}, tiling} are guaranteed to match.
+ if (importAndroidHardwareBuffer) {
+ continue;
+ }
+ if (resolvedFormat != colorBufferVkImageCi->format) {
+ ERR("The VkImageCreateInfo to import %s contains unexpected VkFormat: %s. %s "
+ "expected.",
+ importSource.c_str(), string_VkFormat(imageCreateInfo.format),
+ string_VkFormat(colorBufferVkImageCi->format));
+ }
+ if (imageCreateInfo.extent.width != colorBufferVkImageCi->extent.width) {
+ ERR("The VkImageCreateInfo to import %s contains unexpected VkExtent::width: "
+ "%" PRIu32 ". %" PRIu32 " expected.",
+ importSource.c_str(), imageCreateInfo.extent.width,
+ colorBufferVkImageCi->extent.width);
+ }
+ if (imageCreateInfo.extent.height != colorBufferVkImageCi->extent.height) {
+ ERR("The VkImageCreateInfo to import %s contains unexpected VkExtent::height: "
+ "%" PRIu32 ". %" PRIu32 " expected.",
+ importSource.c_str(), imageCreateInfo.extent.height,
+ colorBufferVkImageCi->extent.height);
+ }
+ if (imageCreateInfo.tiling != colorBufferVkImageCi->tiling) {
+ ERR("The VkImageCreateInfo to import %s contains unexpected VkImageTiling: %s. %s "
+ "expected.",
+ importSource.c_str(), string_VkImageTiling(imageCreateInfo.tiling),
+ string_VkImageTiling(colorBufferVkImageCi->tiling));
+ }
+ if (imageCreateInfo.sharingMode != colorBufferVkImageCi->sharingMode) {
+ ERR("The VkImageCreateInfo to import %s contains unexpected VkSharingMode: %s. %s "
+ "expected.",
+ importSource.c_str(), string_VkSharingMode(imageCreateInfo.sharingMode),
+ string_VkSharingMode(colorBufferVkImageCi->sharingMode));
+ }
+ }
+ }
+
+ void transformImpl_VkImageCreateInfo_fromhost(const VkImageCreateInfo*, uint32_t) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "Not yet implemented.";
+ }
+
+#define DEFINE_EXTERNAL_HANDLE_TYPE_TRANSFORM(type, field) \
+ void transformImpl_##type##_tohost(const type* props, uint32_t count) { \
+ type* mut = (type*)props; \
+ for (uint32_t i = 0; i < count; ++i) { \
+ mut[i].field = \
+ (VkExternalMemoryHandleTypeFlagBits)transformExternalMemoryHandleTypeFlags_tohost( \
+ mut[i].field); \
+ } \
+ } \
+ void transformImpl_##type##_fromhost(const type* props, uint32_t count) { \
+ type* mut = (type*)props; \
+ for (uint32_t i = 0; i < count; ++i) { \
+ mut[i].field = (VkExternalMemoryHandleTypeFlagBits) \
+ transformExternalMemoryHandleTypeFlags_fromhost( \
+ mut[i].field, GUEST_EXTERNAL_MEMORY_HANDLE_TYPES); \
+ } \
+ }
+
+#define DEFINE_EXTERNAL_MEMORY_PROPERTIES_TRANSFORM(type) \
+ void transformImpl_##type##_tohost(const type* props, uint32_t count) { \
+ type* mut = (type*)props; \
+ for (uint32_t i = 0; i < count; ++i) { \
+ mut[i].externalMemoryProperties = \
+ transformExternalMemoryProperties_tohost(mut[i].externalMemoryProperties); \
+ } \
+ } \
+ void transformImpl_##type##_fromhost(const type* props, uint32_t count) { \
+ type* mut = (type*)props; \
+ for (uint32_t i = 0; i < count; ++i) { \
+ mut[i].externalMemoryProperties = transformExternalMemoryProperties_fromhost( \
+ mut[i].externalMemoryProperties, GUEST_EXTERNAL_MEMORY_HANDLE_TYPES); \
+ } \
+ }
+
+ DEFINE_EXTERNAL_HANDLE_TYPE_TRANSFORM(VkPhysicalDeviceExternalImageFormatInfo, handleType)
+ DEFINE_EXTERNAL_HANDLE_TYPE_TRANSFORM(VkPhysicalDeviceExternalBufferInfo, handleType)
+ DEFINE_EXTERNAL_HANDLE_TYPE_TRANSFORM(VkExternalMemoryImageCreateInfo, handleTypes)
+ DEFINE_EXTERNAL_HANDLE_TYPE_TRANSFORM(VkExternalMemoryBufferCreateInfo, handleTypes)
+ DEFINE_EXTERNAL_HANDLE_TYPE_TRANSFORM(VkExportMemoryAllocateInfo, handleTypes)
+ DEFINE_EXTERNAL_MEMORY_PROPERTIES_TRANSFORM(VkExternalImageFormatProperties)
+ DEFINE_EXTERNAL_MEMORY_PROPERTIES_TRANSFORM(VkExternalBufferProperties)
+
+ uint64_t newGlobalHandle(const DispatchableHandleInfo<uint64_t>& item,
+ BoxedHandleTypeTag typeTag) {
+ if (!mCreatedHandlesForSnapshotLoad.empty() &&
+ (mCreatedHandlesForSnapshotLoad.size() - mCreatedHandlesForSnapshotLoadIndex > 0)) {
+ auto handle = mCreatedHandlesForSnapshotLoad[mCreatedHandlesForSnapshotLoadIndex];
+ VKDGS_LOG("use handle: %p", handle);
+ ++mCreatedHandlesForSnapshotLoadIndex;
+ auto res = sBoxedHandleManager.addFixed(handle, item, typeTag);
+ return res;
+ } else {
+ return sBoxedHandleManager.add(item, typeTag);
+ }
+ }
+
+#define DEFINE_BOXED_DISPATCHABLE_HANDLE_API_IMPL(type) \
+ type new_boxed_##type(type underlying, VulkanDispatch* dispatch, bool ownDispatch) { \
+ DispatchableHandleInfo<uint64_t> item; \
+ item.underlying = (uint64_t)underlying; \
+ item.dispatch = dispatch ? dispatch : new VulkanDispatch; \
+ item.ownDispatch = ownDispatch; \
+ item.ordMaintInfo = new OrderMaintenanceInfo; \
+ item.readStream = nullptr; \
+ auto res = (type)newGlobalHandle(item, Tag_##type); \
+ return res; \
+ } \
+ void delete_##type(type boxed) { \
+ if (!boxed) return; \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) return; \
+ releaseOrderMaintInfo(elt->ordMaintInfo); \
+ if (elt->readStream) { \
+ sReadStreamRegistry.push(elt->readStream); \
+ elt->readStream = nullptr; \
+ } \
+ sBoxedHandleManager.remove((uint64_t)boxed); \
+ } \
+ type unbox_##type(type boxed) { \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) return VK_NULL_HANDLE; \
+ return (type)elt->underlying; \
+ } \
+ OrderMaintenanceInfo* ordmaint_##type(type boxed) { \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) return 0; \
+ auto info = elt->ordMaintInfo; \
+ if (!info) return 0; \
+ acquireOrderMaintInfo(info); \
+ return info; \
+ } \
+ VulkanMemReadingStream* readstream_##type(type boxed) { \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) return 0; \
+ auto stream = elt->readStream; \
+ if (!stream) { \
+ stream = sReadStreamRegistry.pop(); \
+ elt->readStream = stream; \
+ } \
+ return stream; \
+ } \
+ type unboxed_to_boxed_##type(type unboxed) { \
+ AutoLock lock(sBoxedHandleManager.lock); \
+ return (type)sBoxedHandleManager.getBoxedFromUnboxedLocked((uint64_t)(uintptr_t)unboxed); \
+ } \
+ VulkanDispatch* dispatch_##type(type boxed) { \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) { \
+ fprintf(stderr, "%s: err not found boxed %p\n", __func__, boxed); \
+ return nullptr; \
+ } \
+ return elt->dispatch; \
+ }
+
+#define DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_API_IMPL(type) \
+ type new_boxed_non_dispatchable_##type(type underlying) { \
+ DispatchableHandleInfo<uint64_t> item; \
+ item.underlying = (uint64_t)underlying; \
+ auto res = (type)newGlobalHandle(item, Tag_##type); \
+ return res; \
+ } \
+ void delayed_delete_##type(type boxed, VkDevice device, std::function<void()> callback) { \
+ sBoxedHandleManager.removeDelayed((uint64_t)boxed, device, callback); \
+ } \
+ void delete_##type(type boxed) { sBoxedHandleManager.remove((uint64_t)boxed); } \
+ void set_boxed_non_dispatchable_##type(type boxed, type underlying) { \
+ DispatchableHandleInfo<uint64_t> item; \
+ item.underlying = (uint64_t)underlying; \
+ sBoxedHandleManager.addFixed((uint64_t)boxed, item, Tag_##type); \
+ } \
+ type unboxed_to_boxed_non_dispatchable_##type(type unboxed) { \
+ AutoLock lock(sBoxedHandleManager.lock); \
+ return (type)sBoxedHandleManager.getBoxedFromUnboxedLocked((uint64_t)(uintptr_t)unboxed); \
+ } \
+ type unbox_##type(type boxed) { \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) { \
+ if constexpr (!std::is_same_v<type, VkFence>) { \
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) \
+ << "Unbox " << boxed << " failed, not found."; \
+ } \
+ return VK_NULL_HANDLE; \
+ } \
+ return (type)elt->underlying; \
+ }
+
+ GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_DISPATCHABLE_HANDLE_API_IMPL)
+ GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_API_IMPL)
+
+ VkDecoderSnapshot* snapshot() { return &mSnapshot; }
+
+ private:
+ bool isEmulatedInstanceExtension(const char* name) const {
+ for (auto emulatedExt : kEmulatedInstanceExtensions) {
+ if (!strcmp(emulatedExt, name)) return true;
+ }
+ return false;
+ }
+
+ bool isEmulatedDeviceExtension(const char* name) const {
+ for (auto emulatedExt : kEmulatedDeviceExtensions) {
+ if (!strcmp(emulatedExt, name)) return true;
+ }
+ return false;
+ }
+
+ bool supportEmulatedCompressedImageFormatProperty(VkFormat compressedFormat, VkImageType type,
+ VkImageTiling tiling, VkImageUsageFlags usage,
+ VkImageCreateFlags flags) {
+ // BUG: 139193497
+ return !(usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) && !(type == VK_IMAGE_TYPE_1D);
+ }
+
+ std::vector<const char*> filteredDeviceExtensionNames(VulkanDispatch* vk,
+ VkPhysicalDevice physicalDevice,
+ uint32_t count,
+ const char* const* extNames) {
+ std::vector<const char*> res;
+ std::vector<VkExtensionProperties> properties;
+ VkResult result;
+
+ for (uint32_t i = 0; i < count; ++i) {
+ auto extName = extNames[i];
+ if (!isEmulatedDeviceExtension(extName)) {
+ res.push_back(extName);
+ continue;
+ }
+ }
+
+ result = enumerateDeviceExtensionProperties(vk, physicalDevice, nullptr, properties);
+ if (result != VK_SUCCESS) {
+ VKDGS_LOG("failed to enumerate device extensions");
+ return res;
+ }
+
+ if (hasDeviceExtension(properties, VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME)) {
+ res.push_back(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME);
+ }
+
+ if (hasDeviceExtension(properties, VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME)) {
+ res.push_back(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME);
+ }
+
+ if (hasDeviceExtension(properties, VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME)) {
+ res.push_back(VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME);
+ }
+
+ if (hasDeviceExtension(properties, VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME)) {
+ res.push_back(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME);
+ }
+
+ if (hasDeviceExtension(properties, VK_KHR_SWAPCHAIN_EXTENSION_NAME)) {
+ res.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
+ }
+
+#ifdef _WIN32
+ if (hasDeviceExtension(properties, VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME)) {
+ res.push_back(VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME);
+ }
+
+ if (hasDeviceExtension(properties, VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME)) {
+ res.push_back(VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME);
+ }
+#elif defined(__QNX__)
+ // Note: VK_QNX_external_memory_screen_buffer is not supported in API translation,
+ // decoding, etc. However, push name to indicate external memory support to guest
+ if (hasDeviceExtension(properties, VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME)) {
+ res.push_back(VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME);
+ }
+
+ if (hasDeviceExtension(properties, VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME)) {
+ res.push_back(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME);
+ }
+#elif __unix__
+ if (hasDeviceExtension(properties, VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME)) {
+ res.push_back(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME);
+ }
+
+ if (hasDeviceExtension(properties, VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME)) {
+ res.push_back(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME);
+ }
+#endif
+
+#ifdef __linux__
+ // A dma-buf is a Linux kernel construct, commonly used with open-source DRM drivers.
+ // See https://docs.kernel.org/driver-api/dma-buf.html for details.
+ if (hasDeviceExtension(properties, VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME)) {
+ res.push_back(VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME);
+ }
+#endif
+ return res;
+ }
+
+ std::vector<const char*> filteredInstanceExtensionNames(uint32_t count,
+ const char* const* extNames) {
+ std::vector<const char*> res;
+ for (uint32_t i = 0; i < count; ++i) {
+ auto extName = extNames[i];
+ if (!isEmulatedInstanceExtension(extName)) {
+ res.push_back(extName);
+ }
+ }
+
+ if (m_emu->instanceSupportsExternalMemoryCapabilities) {
+ res.push_back(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME);
+ }
+
+ if (m_emu->instanceSupportsExternalSemaphoreCapabilities) {
+ res.push_back(VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME);
+ }
+
+ if (m_emu->debugUtilsAvailableAndRequested) {
+ res.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
+ }
+
+ if (m_emu->instanceSupportsSurface) {
+ res.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
+ }
+
+ return res;
+ }
+
+ VkPhysicalDeviceMemoryProperties* memPropsOfDeviceLocked(VkDevice device) {
+ auto* physdev = android::base::find(mDeviceToPhysicalDevice, device);
+ if (!physdev) return nullptr;
+
+ auto* physdevInfo = android::base::find(mPhysdevInfo, *physdev);
+ if (!physdevInfo) return nullptr;
+
+ return &physdevInfo->memoryProperties;
+ }
+
+ bool getDefaultQueueForDeviceLocked(VkDevice device, VkQueue* queue, uint32_t* queueFamilyIndex,
+ Lock** queueLock) {
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return false;
+
+ auto zeroIt = deviceInfo->queues.find(0);
+ if (zeroIt == deviceInfo->queues.end() || zeroIt->second.empty()) {
+ // Get the first queue / queueFamilyIndex
+ // that does show up.
+ for (const auto& it : deviceInfo->queues) {
+ auto index = it.first;
+ for (auto& deviceQueue : it.second) {
+ *queue = deviceQueue;
+ *queueFamilyIndex = index;
+ *queueLock = mQueueInfo.at(deviceQueue).lock;
+ return true;
+ }
+ }
+ // Didn't find anything, fail.
+ return false;
+ } else {
+ // Use queue family index 0.
+ *queue = zeroIt->second[0];
+ *queueFamilyIndex = 0;
+ *queueLock = mQueueInfo.at(zeroIt->second[0]).lock;
+ return true;
+ }
+
+ return false;
+ }
+
+ void updateImageMemorySizeLocked(VkDevice device, VkImage image,
+ VkMemoryRequirements* pMemoryRequirements) {
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo->emulateTextureEtc2 && !deviceInfo->emulateTextureAstc) {
+ return;
+ }
+ auto* imageInfo = android::base::find(mImageInfo, image);
+ if (!imageInfo) return;
+ CompressedImageInfo& cmpInfo = imageInfo->cmpInfo;
+ if (!deviceInfo->needEmulatedDecompression(cmpInfo)) {
+ return;
+ }
+ *pMemoryRequirements = cmpInfo.getMemoryRequirements();
+ }
+
+ // Whether the VkInstance associated with this physical device was created by ANGLE
+ bool isAngleInstance(VkPhysicalDevice physicalDevice, VulkanDispatch* vk) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ VkInstance* instance = android::base::find(mPhysicalDeviceToInstance, physicalDevice);
+ if (!instance) return false;
+ InstanceInfo* instanceInfo = android::base::find(mInstanceInfo, *instance);
+ if (!instanceInfo) return false;
+ return instanceInfo->isAngle;
+ }
+
+ bool enableEmulatedEtc2(VkPhysicalDevice physicalDevice, VulkanDispatch* vk) {
+ if (!m_emu->enableEtc2Emulation) return false;
+
+ // Don't enable ETC2 emulation for ANGLE, let it do its own emulation.
+ return !isAngleInstance(physicalDevice, vk);
+ }
+
+ bool enableEmulatedAstc(VkPhysicalDevice physicalDevice, VulkanDispatch* vk) {
+ if (m_emu->astcLdrEmulationMode == AstcEmulationMode::Disabled) {
+ return false;
+ }
+
+ // Don't enable ASTC emulation for ANGLE, let it do its own emulation.
+ return !isAngleInstance(physicalDevice, vk);
+ }
+
+ bool needEmulatedEtc2(VkPhysicalDevice physicalDevice, VulkanDispatch* vk) {
+ if (!enableEmulatedEtc2(physicalDevice, vk)) {
+ return false;
+ }
+ VkPhysicalDeviceFeatures feature;
+ vk->vkGetPhysicalDeviceFeatures(physicalDevice, &feature);
+ return !feature.textureCompressionETC2;
+ }
+
+ bool needEmulatedAstc(VkPhysicalDevice physicalDevice, VulkanDispatch* vk) {
+ if (!enableEmulatedAstc(physicalDevice, vk)) {
+ return false;
+ }
+ VkPhysicalDeviceFeatures feature;
+ vk->vkGetPhysicalDeviceFeatures(physicalDevice, &feature);
+ return !feature.textureCompressionASTC_LDR;
+ }
+
+ bool supportsSwapchainMaintenance1(VkPhysicalDevice physicalDevice, VulkanDispatch* vk) {
+ bool hasGetPhysicalDeviceFeatures2 = false;
+ bool hasGetPhysicalDeviceFeatures2KHR = false;
+
+ {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* physdevInfo = android::base::find(mPhysdevInfo, physicalDevice);
+ if (!physdevInfo) {
+ return false;
+ }
+
+ auto instance = mPhysicalDeviceToInstance[physicalDevice];
+ auto* instanceInfo = android::base::find(mInstanceInfo, instance);
+ if (!instanceInfo) {
+ return false;
+ }
+
+ if (instanceInfo->apiVersion >= VK_MAKE_VERSION(1, 1, 0) &&
+ physdevInfo->props.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) {
+ hasGetPhysicalDeviceFeatures2 = true;
+ } else if (hasInstanceExtension(instance,
+ VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) {
+ hasGetPhysicalDeviceFeatures2KHR = true;
+ } else {
+ return false;
+ }
+ }
+
+ VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT swapchainMaintenance1Features = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT,
+ .pNext = nullptr,
+ .swapchainMaintenance1 = VK_FALSE,
+ };
+ VkPhysicalDeviceFeatures2 features2 = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
+ .pNext = &swapchainMaintenance1Features,
+ };
+ if (hasGetPhysicalDeviceFeatures2) {
+ vk->vkGetPhysicalDeviceFeatures2(physicalDevice, &features2);
+ } else if (hasGetPhysicalDeviceFeatures2KHR) {
+ vk->vkGetPhysicalDeviceFeatures2KHR(physicalDevice, &features2);
+ } else {
+ return false;
+ }
+
+ return swapchainMaintenance1Features.swapchainMaintenance1 == VK_TRUE;
+ }
+
+ bool isEmulatedCompressedTexture(VkFormat format, VkPhysicalDevice physicalDevice,
+ VulkanDispatch* vk) {
+ return (gfxstream::vk::isEtc2(format) && needEmulatedEtc2(physicalDevice, vk)) ||
+ (gfxstream::vk::isAstc(format) && needEmulatedAstc(physicalDevice, vk));
+ }
+
+ static const VkFormatFeatureFlags kEmulatedTextureBufferFeatureMask =
+ VK_FORMAT_FEATURE_TRANSFER_SRC_BIT | VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
+ VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
+
+ static const VkFormatFeatureFlags kEmulatedTextureOptimalTilingMask =
+ VK_FORMAT_FEATURE_TRANSFER_SRC_BIT | VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
+ VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT;
+
+ void maskFormatPropertiesForEmulatedTextures(VkFormatProperties* pFormatProp) {
+ pFormatProp->linearTilingFeatures &= kEmulatedTextureBufferFeatureMask;
+ pFormatProp->optimalTilingFeatures &= kEmulatedTextureOptimalTilingMask;
+ pFormatProp->bufferFeatures &= kEmulatedTextureBufferFeatureMask;
+ }
+
+ void maskFormatPropertiesForEmulatedTextures(VkFormatProperties2* pFormatProp) {
+ pFormatProp->formatProperties.linearTilingFeatures &= kEmulatedTextureBufferFeatureMask;
+ pFormatProp->formatProperties.optimalTilingFeatures &= kEmulatedTextureOptimalTilingMask;
+ pFormatProp->formatProperties.bufferFeatures &= kEmulatedTextureBufferFeatureMask;
+ }
+
+ void maskImageFormatPropertiesForEmulatedTextures(VkImageFormatProperties* pProperties) {
+ // dEQP-VK.api.info.image_format_properties.2d.optimal#etc2_r8g8b8_unorm_block
+ pProperties->sampleCounts &= VK_SAMPLE_COUNT_1_BIT;
+ }
+
+ template <class VkFormatProperties1or2>
+ void getPhysicalDeviceFormatPropertiesCore(
+ std::function<void(VkPhysicalDevice, VkFormat, VkFormatProperties1or2*)>
+ getPhysicalDeviceFormatPropertiesFunc,
+ VulkanDispatch* vk, VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties1or2* pFormatProperties) {
+ if (isEmulatedCompressedTexture(format, physicalDevice, vk)) {
+ getPhysicalDeviceFormatPropertiesFunc(
+ physicalDevice, CompressedImageInfo::getOutputFormat(format),
+ pFormatProperties);
+ maskFormatPropertiesForEmulatedTextures(pFormatProperties);
+ return;
+ }
+ getPhysicalDeviceFormatPropertiesFunc(physicalDevice, format, pFormatProperties);
+ }
+
+ void executePreprocessRecursive(int level, VkCommandBuffer cmdBuffer) {
+ auto* cmdBufferInfo = android::base::find(mCmdBufferInfo, cmdBuffer);
+ if (!cmdBufferInfo) return;
+ for (const auto& func : cmdBufferInfo->preprocessFuncs) {
+ func();
+ }
+ // TODO: fix
+ // for (const auto& subCmd : cmdBufferInfo->subCmds) {
+ // executePreprocessRecursive(level + 1, subCmd);
+ // }
+ }
+
+ void executePreprocessRecursive(const VkSubmitInfo& submit) {
+ for (uint32_t c = 0; c < submit.commandBufferCount; c++) {
+ executePreprocessRecursive(0, submit.pCommandBuffers[c]);
+ }
+ }
+
+ void executePreprocessRecursive(const VkSubmitInfo2& submit) {
+ for (uint32_t c = 0; c < submit.commandBufferInfoCount; c++) {
+ executePreprocessRecursive(0, submit.pCommandBufferInfos[c].commandBuffer);
+ }
+ }
+
+ template <typename VkHandleToInfoMap,
+ typename HandleType = typename std::decay_t<VkHandleToInfoMap>::key_type>
+ std::vector<HandleType> findDeviceObjects(VkDevice device, const VkHandleToInfoMap& map) {
+ std::vector<HandleType> objectsFromDevice;
+ for (const auto& [objectHandle, objectInfo] : map) {
+ if (objectInfo.device == device) {
+ objectsFromDevice.push_back(objectHandle);
+ }
+ }
+ return objectsFromDevice;
+ }
+
+ template <typename VkHandleToInfoMap, typename InfoMemberType,
+ typename HandleType = typename std::decay_t<VkHandleToInfoMap>::key_type,
+ typename InfoType = typename std::decay_t<VkHandleToInfoMap>::value_type>
+ std::vector<std::pair<HandleType, InfoMemberType>> findDeviceObjects(
+ VkDevice device, const VkHandleToInfoMap& map, InfoMemberType InfoType::*member) {
+ std::vector<std::pair<HandleType, InfoMemberType>> objectsFromDevice;
+ for (const auto& [objectHandle, objectInfo] : map) {
+ if (objectInfo.device == device) {
+ objectsFromDevice.emplace_back(objectHandle, objectInfo.*member);
+ }
+ }
+ return objectsFromDevice;
+ }
+
+ void teardownInstanceLocked(VkInstance instance) {
+ std::vector<VkDevice> devicesToDestroy;
+ std::vector<VulkanDispatch*> devicesToDestroyDispatches;
+
+ for (auto it : mDeviceToPhysicalDevice) {
+ auto* otherInstance = android::base::find(mPhysicalDeviceToInstance, it.second);
+ if (!otherInstance) continue;
+
+ if (instance == *otherInstance) {
+ devicesToDestroy.push_back(it.first);
+ devicesToDestroyDispatches.push_back(
+ dispatch_VkDevice(mDeviceInfo[it.first].boxed));
+ }
+ }
+
+ for (uint32_t i = 0; i < devicesToDestroy.size(); ++i) {
+ VkDevice deviceToDestroy = devicesToDestroy[i];
+ VulkanDispatch* deviceToDestroyDispatch = devicesToDestroyDispatches[i];
+
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1074600
+ // it's important to idle the device before destroying it!
+ deviceToDestroyDispatch->vkDeviceWaitIdle(deviceToDestroy);
+
+ for (auto semaphore : findDeviceObjects(deviceToDestroy, mSemaphoreInfo)) {
+ destroySemaphoreLocked(deviceToDestroy, deviceToDestroyDispatch, semaphore,
+ nullptr);
+ }
+
+ for (auto sampler : findDeviceObjects(deviceToDestroy, mSamplerInfo)) {
+ destroySamplerLocked(deviceToDestroy, deviceToDestroyDispatch, sampler, nullptr);
+ }
+
+ for (auto buffer : findDeviceObjects(deviceToDestroy, mBufferInfo)) {
+ deviceToDestroyDispatch->vkDestroyBuffer(deviceToDestroy, buffer, nullptr);
+ mBufferInfo.erase(buffer);
+ }
+
+ for (auto imageView : findDeviceObjects(deviceToDestroy, mImageViewInfo)) {
+ deviceToDestroyDispatch->vkDestroyImageView(deviceToDestroy, imageView, nullptr);
+ mImageViewInfo.erase(imageView);
+ }
+
+ for (auto image : findDeviceObjects(deviceToDestroy, mImageInfo)) {
+ destroyImageLocked(deviceToDestroy, deviceToDestroyDispatch, image, nullptr);
+ }
+
+ for (auto memory : findDeviceObjects(deviceToDestroy, mMemoryInfo)) {
+ freeMemoryLocked(deviceToDestroyDispatch, deviceToDestroy, memory, nullptr);
+ }
+
+ for (auto [commandBuffer, commandPool] :
+ findDeviceObjects(deviceToDestroy, mCmdBufferInfo, &CommandBufferInfo::cmdPool)) {
+ // The command buffer is freed with the vkDestroyCommandPool() below.
+ delete_VkCommandBuffer(unboxed_to_boxed_VkCommandBuffer(commandBuffer));
+ mCmdBufferInfo.erase(commandBuffer);
+ }
+
+ for (auto [commandPool, commandPoolBoxed] :
+ findDeviceObjects(deviceToDestroy, mCmdPoolInfo, &CommandPoolInfo::boxed)) {
+ deviceToDestroyDispatch->vkDestroyCommandPool(deviceToDestroy, commandPool,
+ nullptr);
+ delete_VkCommandPool(commandPoolBoxed);
+ mCmdPoolInfo.erase(commandPool);
+ }
+
+ for (auto [descriptorPool, descriptorPoolBoxed] : findDeviceObjects(
+ deviceToDestroy, mDescriptorPoolInfo, &DescriptorPoolInfo::boxed)) {
+ cleanupDescriptorPoolAllocedSetsLocked(descriptorPool, /*isDestroy=*/true);
+ deviceToDestroyDispatch->vkDestroyDescriptorPool(deviceToDestroy, descriptorPool,
+ nullptr);
+ delete_VkDescriptorPool(descriptorPoolBoxed);
+ mDescriptorPoolInfo.erase(descriptorPool);
+ }
+
+ for (auto [descriptorSetLayout, descriptorSetLayoutBoxed] : findDeviceObjects(
+ deviceToDestroy, mDescriptorSetLayoutInfo, &DescriptorSetLayoutInfo::boxed)) {
+ deviceToDestroyDispatch->vkDestroyDescriptorSetLayout(deviceToDestroy,
+ descriptorSetLayout, nullptr);
+ delete_VkDescriptorSetLayout(descriptorSetLayoutBoxed);
+ mDescriptorSetLayoutInfo.erase(descriptorSetLayout);
+ }
+
+ for (auto shaderModule : findDeviceObjects(deviceToDestroy, mShaderModuleInfo)) {
+ destroyShaderModuleLocked(deviceToDestroy, deviceToDestroyDispatch, shaderModule,
+ nullptr);
+ }
+
+ for (auto pipeline : findDeviceObjects(deviceToDestroy, mPipelineInfo)) {
+ destroyPipelineLocked(deviceToDestroy, deviceToDestroyDispatch, pipeline, nullptr);
+ }
+
+ for (auto pipelineCache : findDeviceObjects(deviceToDestroy, mPipelineCacheInfo)) {
+ destroyPipelineCacheLocked(deviceToDestroy, deviceToDestroyDispatch, pipelineCache,
+ nullptr);
+ }
+
+ for (auto framebuffer : findDeviceObjects(deviceToDestroy, mFramebufferInfo)) {
+ destroyFramebufferLocked(deviceToDestroy, deviceToDestroyDispatch, framebuffer,
+ nullptr);
+ }
+
+ for (auto renderPass : findDeviceObjects(deviceToDestroy, mRenderPassInfo)) {
+ destroyRenderPassLocked(deviceToDestroy, deviceToDestroyDispatch, renderPass,
+ nullptr);
+ }
+ }
+
+ for (VkDevice deviceToDestroy : devicesToDestroy) {
+ destroyDeviceLocked(deviceToDestroy, nullptr);
+ mDeviceInfo.erase(deviceToDestroy);
+ mDeviceToPhysicalDevice.erase(deviceToDestroy);
+ }
+
+ // TODO: Clean up the physical device info in `mPhysdevInfo` but we need to be careful
+ // as the Vulkan spec does not guarantee that the VkPhysicalDevice handles returned are
+ // unique per VkInstance.
+ }
+
+ typedef std::function<void()> PreprocessFunc;
+ struct CommandBufferInfo {
+ std::vector<PreprocessFunc> preprocessFuncs = {};
+ std::vector<VkCommandBuffer> subCmds = {};
+ VkDevice device = VK_NULL_HANDLE;
+ VkCommandPool cmdPool = VK_NULL_HANDLE;
+ VkCommandBuffer boxed = VK_NULL_HANDLE;
+ DebugUtilsHelper debugUtilsHelper = DebugUtilsHelper::withUtilsDisabled();
+
+ // Most recently bound compute pipeline and descriptor sets. We save it here so that we can
+ // restore it after doing emulated texture decompression.
+ VkPipeline computePipeline = VK_NULL_HANDLE;
+ uint32_t firstSet = 0;
+ VkPipelineLayout descriptorLayout = VK_NULL_HANDLE;
+ std::vector<VkDescriptorSet> descriptorSets;
+ std::vector<uint32_t> dynamicOffsets;
+
+ void reset() {
+ preprocessFuncs.clear();
+ subCmds.clear();
+ computePipeline = VK_NULL_HANDLE;
+ firstSet = 0;
+ descriptorLayout = VK_NULL_HANDLE;
+ descriptorSets.clear();
+ dynamicOffsets.clear();
+ }
+ };
+
+ struct CommandPoolInfo {
+ VkDevice device = VK_NULL_HANDLE;
+ VkCommandPool boxed = VK_NULL_HANDLE;
+ std::unordered_set<VkCommandBuffer> cmdBuffers = {};
+ };
+
+ void removeCommandBufferInfo(const std::unordered_set<VkCommandBuffer>& cmdBuffers) {
+ for (const auto& cmdBuffer : cmdBuffers) {
+ mCmdBufferInfo.erase(cmdBuffer);
+ }
+ }
+
+ 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);
+ }
+
+ struct DescriptorUpdateTemplateInfo {
+ VkDescriptorUpdateTemplateCreateInfo createInfo;
+ std::vector<VkDescriptorUpdateTemplateEntry> linearizedTemplateEntries;
+ // Preallocated pData
+ std::vector<uint8_t> data;
+ size_t imageInfoStart;
+ size_t bufferInfoStart;
+ size_t bufferViewStart;
+ size_t inlineUniformBlockStart;
+ };
+
+ DescriptorUpdateTemplateInfo calcLinearizedDescriptorUpdateTemplateInfo(
+ const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo) {
+ DescriptorUpdateTemplateInfo res;
+ res.createInfo = *pCreateInfo;
+
+ size_t numImageInfos = 0;
+ size_t numBufferInfos = 0;
+ size_t numBufferViews = 0;
+ size_t numInlineUniformBlocks = 0;
+
+ for (uint32_t i = 0; i < pCreateInfo->descriptorUpdateEntryCount; ++i) {
+ const auto& entry = pCreateInfo->pDescriptorUpdateEntries[i];
+ auto type = entry.descriptorType;
+ auto count = entry.descriptorCount;
+ if (isDescriptorTypeImageInfo(type)) {
+ numImageInfos += count;
+ } else if (isDescriptorTypeBufferInfo(type)) {
+ numBufferInfos += count;
+ } else if (isDescriptorTypeBufferView(type)) {
+ numBufferViews += count;
+ } else if (type == VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT) {
+ numInlineUniformBlocks += count;
+ } else {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "unknown descriptor type 0x" << std::hex << type;
+ }
+ }
+
+ size_t imageInfoBytes = numImageInfos * sizeof(VkDescriptorImageInfo);
+ size_t bufferInfoBytes = numBufferInfos * sizeof(VkDescriptorBufferInfo);
+ size_t bufferViewBytes = numBufferViews * sizeof(VkBufferView);
+ size_t inlineUniformBlockBytes = numInlineUniformBlocks;
+
+ res.data.resize(imageInfoBytes + bufferInfoBytes + bufferViewBytes +
+ inlineUniformBlockBytes);
+ res.imageInfoStart = 0;
+ res.bufferInfoStart = imageInfoBytes;
+ res.bufferViewStart = imageInfoBytes + bufferInfoBytes;
+ res.inlineUniformBlockStart = imageInfoBytes + bufferInfoBytes + bufferViewBytes;
+
+ size_t imageInfoCount = 0;
+ size_t bufferInfoCount = 0;
+ size_t bufferViewCount = 0;
+ size_t inlineUniformBlockCount = 0;
+
+ for (uint32_t i = 0; i < pCreateInfo->descriptorUpdateEntryCount; ++i) {
+ const auto& entry = pCreateInfo->pDescriptorUpdateEntries[i];
+ VkDescriptorUpdateTemplateEntry entryForHost = entry;
+
+ auto type = entry.descriptorType;
+
+ if (isDescriptorTypeImageInfo(type)) {
+ entryForHost.offset =
+ res.imageInfoStart + imageInfoCount * sizeof(VkDescriptorImageInfo);
+ entryForHost.stride = sizeof(VkDescriptorImageInfo);
+ ++imageInfoCount;
+ } else if (isDescriptorTypeBufferInfo(type)) {
+ entryForHost.offset =
+ res.bufferInfoStart + bufferInfoCount * sizeof(VkDescriptorBufferInfo);
+ entryForHost.stride = sizeof(VkDescriptorBufferInfo);
+ ++bufferInfoCount;
+ } else if (isDescriptorTypeBufferView(type)) {
+ entryForHost.offset = res.bufferViewStart + bufferViewCount * sizeof(VkBufferView);
+ entryForHost.stride = sizeof(VkBufferView);
+ ++bufferViewCount;
+ } else if (type == VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT) {
+ entryForHost.offset = res.inlineUniformBlockStart + inlineUniformBlockCount;
+ entryForHost.stride = 0;
+ inlineUniformBlockCount += entryForHost.descriptorCount;
+ } else {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "unknown descriptor type 0x" << std::hex << type;
+ }
+
+ res.linearizedTemplateEntries.push_back(entryForHost);
+ }
+
+ res.createInfo.pDescriptorUpdateEntries = res.linearizedTemplateEntries.data();
+
+ return res;
+ }
+
+ void registerDescriptorUpdateTemplate(VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+ const DescriptorUpdateTemplateInfo& info) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ mDescriptorUpdateTemplateInfo[descriptorUpdateTemplate] = info;
+ }
+
+ void unregisterDescriptorUpdateTemplate(VkDescriptorUpdateTemplate descriptorUpdateTemplate) {
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+ mDescriptorUpdateTemplateInfo.erase(descriptorUpdateTemplate);
+ }
+
+ // Returns the VkInstance associated with a VkDevice, or null if it's not found
+ VkInstance* deviceToInstanceLocked(VkDevice device) {
+ auto* physicalDevice = android::base::find(mDeviceToPhysicalDevice, device);
+ if (!physicalDevice) return nullptr;
+ return android::base::find(mPhysicalDeviceToInstance, *physicalDevice);
+ }
+
+ VulkanDispatch* m_vk;
+ VkEmulation* m_emu;
+ emugl::RenderDocWithMultipleVkInstances* mRenderDocWithMultipleVkInstances = nullptr;
+ bool mSnapshotsEnabled = false;
+ bool mVkCleanupEnabled = true;
+ bool mLogging = false;
+ bool mVerbosePrints = false;
+ bool mUseOldMemoryCleanupPath = false;
+ bool mGuestUsesAngle = false;
+
+ std::recursive_mutex mLock;
+
+ // We always map the whole size on host.
+ // This makes it much easier to implement
+ // the memory map API.
+ struct MemoryInfo {
+ // This indicates whether the VkDecoderGlobalState needs to clean up
+ // and unmap the mapped memory; only the owner of the mapped memory
+ // should call unmap.
+ bool needUnmap = false;
+ // When ptr is null, it means the VkDeviceMemory object
+ // was not allocated with the HOST_VISIBLE property.
+ void* ptr = nullptr;
+ VkDeviceSize size;
+ // GLDirectMem info
+ bool directMapped = false;
+ bool virtioGpuMapped = false;
+ uint32_t caching = 0;
+ uint64_t guestPhysAddr = 0;
+ void* pageAlignedHva = nullptr;
+ uint64_t sizeToPage = 0;
+ uint64_t hostmemId = 0;
+ VkDevice device = VK_NULL_HANDLE;
+ MTLTextureRef mtlTexture = nullptr;
+ uint32_t memoryIndex = 0;
+ // Set if the memory is backed by shared memory.
+ std::optional<SharedMemory> sharedMemory;
+
+ // virtio-gpu blobs
+ uint64_t blobId = 0;
+
+ // Color buffer, provided via vkAllocateMemory().
+ HandleType boundColorBuffer = 0;
+ };
+
+ struct InstanceInfo {
+ std::vector<std::string> enabledExtensionNames;
+ uint32_t apiVersion = VK_MAKE_VERSION(1, 0, 0);
+ VkInstance boxed = nullptr;
+ bool isAngle = false;
+ };
+
+ struct PhysicalDeviceInfo {
+ VkPhysicalDeviceProperties props;
+ VkPhysicalDeviceMemoryProperties memoryProperties;
+ std::vector<VkQueueFamilyProperties> queueFamilyProperties;
+ VkPhysicalDevice boxed = nullptr;
+ };
+
+ struct DeviceInfo {
+ std::unordered_map<uint32_t, std::vector<VkQueue>> queues;
+ std::vector<std::string> enabledExtensionNames;
+ bool emulateTextureEtc2 = false;
+ bool emulateTextureAstc = false;
+ bool useAstcCpuDecompression = false;
+ VkPhysicalDevice physicalDevice;
+ VkDevice boxed = nullptr;
+ DebugUtilsHelper debugUtilsHelper = DebugUtilsHelper::withUtilsDisabled();
+ std::unique_ptr<ExternalFencePool<VulkanDispatch>> externalFencePool = nullptr;
+ std::set<VkFormat> imageFormats = {}; // image formats used on this device
+ std::unique_ptr<GpuDecompressionPipelineManager> decompPipelines = nullptr;
+
+ // True if this is a compressed image that needs to be decompressed on the GPU (with our
+ // compute shader)
+ bool needGpuDecompression(const CompressedImageInfo& cmpInfo) {
+ return ((cmpInfo.isEtc2() && emulateTextureEtc2) ||
+ (cmpInfo.isAstc() && emulateTextureAstc && !useAstcCpuDecompression));
+ }
+ bool needEmulatedDecompression(const CompressedImageInfo& cmpInfo) {
+ return ((cmpInfo.isEtc2() && emulateTextureEtc2) ||
+ (cmpInfo.isAstc() && emulateTextureAstc));
+ }
+ bool needEmulatedDecompression(VkFormat format) {
+ return (gfxstream::vk::isEtc2(format) && emulateTextureEtc2) || (gfxstream::vk::isAstc(format) && emulateTextureAstc);
+ }
+ };
+
+ struct QueueInfo {
+ Lock* lock = nullptr;
+ VkDevice device;
+ uint32_t queueFamilyIndex;
+ VkQueue boxed = nullptr;
+ uint32_t sequenceNumber = 0;
+ };
+
+ struct BufferInfo {
+ VkDevice device;
+ VkDeviceMemory memory = 0;
+ VkDeviceSize memoryOffset = 0;
+ VkDeviceSize size;
+ };
+
+ struct ImageInfo {
+ VkDevice device;
+ VkImageCreateInfo imageCreateInfoShallow;
+ std::shared_ptr<AndroidNativeBufferInfo> anbInfo;
+ CompressedImageInfo cmpInfo;
+
+ // Color buffer, provided via vkAllocateMemory().
+ HandleType boundColorBuffer = 0;
+ };
+
+ struct ImageViewInfo {
+ VkDevice device;
+ bool needEmulatedAlpha = false;
+
+ // Color buffer, provided via vkAllocateMemory().
+ HandleType boundColorBuffer = 0;
+ };
+
+ struct SamplerInfo {
+ VkDevice device;
+ bool needEmulatedAlpha = false;
+ VkSamplerCreateInfo createInfo = {};
+ VkSampler emulatedborderSampler = VK_NULL_HANDLE;
+ android::base::BumpPool pool = android::base::BumpPool(256);
+ SamplerInfo() = default;
+ SamplerInfo& operator=(const SamplerInfo& other) {
+ deepcopy_VkSamplerCreateInfo(&pool, VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
+ &other.createInfo, &createInfo);
+ device = other.device;
+ needEmulatedAlpha = other.needEmulatedAlpha;
+ emulatedborderSampler = other.emulatedborderSampler;
+ return *this;
+ }
+ SamplerInfo(const SamplerInfo& other) { *this = other; }
+ SamplerInfo(SamplerInfo&& other) = delete;
+ SamplerInfo& operator=(SamplerInfo&& other) = delete;
+ };
+
+ struct FenceInfo {
+ VkDevice device = VK_NULL_HANDLE;
+ VkFence boxed = VK_NULL_HANDLE;
+ VulkanDispatch* vk = nullptr;
+
+ StaticLock lock;
+ android::base::ConditionVariable cv;
+
+ enum class State {
+ kWaitable,
+ kNotWaitable,
+ kWaiting,
+ };
+ State state = State::kNotWaitable;
+
+ bool external = false;
+ };
+
+ struct SemaphoreInfo {
+ VkDevice device;
+ int externalHandleId = 0;
+ VK_EXT_SYNC_HANDLE externalHandle = VK_EXT_SYNC_HANDLE_INVALID;
+ };
+
+ struct DescriptorSetLayoutInfo {
+ VkDevice device = 0;
+ VkDescriptorSetLayout boxed = 0;
+ VkDescriptorSetLayoutCreateInfo createInfo;
+ std::vector<VkDescriptorSetLayoutBinding> bindings;
+ };
+
+ struct DescriptorPoolInfo {
+ VkDevice device = 0;
+ VkDescriptorPool boxed = 0;
+ struct PoolState {
+ VkDescriptorType type;
+ uint32_t descriptorCount;
+ uint32_t used;
+ };
+
+ VkDescriptorPoolCreateInfo createInfo;
+ uint32_t maxSets;
+ uint32_t usedSets;
+ std::vector<PoolState> pools;
+
+ std::unordered_map<VkDescriptorSet, VkDescriptorSet> allocedSetsToBoxed;
+ std::vector<uint64_t> poolIds;
+ };
+
+ struct DescriptorSetInfo {
+ VkDescriptorPool pool;
+ std::vector<VkDescriptorSetLayoutBinding> bindings;
+ };
+
+ struct ShaderModuleInfo {
+ VkDevice device;
+ };
+
+ struct PipelineCacheInfo {
+ VkDevice device;
+ };
+
+ struct PipelineInfo {
+ VkDevice device;
+ };
+
+ struct RenderPassInfo {
+ VkDevice device;
+ };
+
+ struct FramebufferInfo {
+ VkDevice device;
+ };
+
+ bool isBindingFeasibleForAlloc(const DescriptorPoolInfo::PoolState& poolState,
+ const VkDescriptorSetLayoutBinding& binding) {
+ if (binding.descriptorCount && (poolState.type != binding.descriptorType)) {
+ return false;
+ }
+
+ uint32_t availDescriptorCount = poolState.descriptorCount - poolState.used;
+
+ if (availDescriptorCount < binding.descriptorCount) {
+ return false;
+ }
+
+ return true;
+ }
+
+ bool isBindingFeasibleForFree(const DescriptorPoolInfo::PoolState& poolState,
+ const VkDescriptorSetLayoutBinding& binding) {
+ if (poolState.type != binding.descriptorType) return false;
+ if (poolState.used < binding.descriptorCount) return false;
+ return true;
+ }
+
+ void allocBindingFeasible(const VkDescriptorSetLayoutBinding& binding,
+ DescriptorPoolInfo::PoolState& poolState) {
+ poolState.used += binding.descriptorCount;
+ }
+
+ void freeBindingFeasible(const VkDescriptorSetLayoutBinding& binding,
+ DescriptorPoolInfo::PoolState& poolState) {
+ poolState.used -= binding.descriptorCount;
+ }
+
+ VkResult validateDescriptorSetAllocLocked(const VkDescriptorSetAllocateInfo* pAllocateInfo) {
+ auto* poolInfo = android::base::find(mDescriptorPoolInfo, pAllocateInfo->descriptorPool);
+ if (!poolInfo) return VK_ERROR_INITIALIZATION_FAILED;
+
+ // Check the number of sets available.
+ auto setsAvailable = poolInfo->maxSets - poolInfo->usedSets;
+
+ if (setsAvailable < pAllocateInfo->descriptorSetCount) {
+ 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<DescriptorPoolInfo::PoolState> poolCopy = poolInfo->pools;
+
+ for (uint32_t i = 0; i < pAllocateInfo->descriptorSetCount; ++i) {
+ auto setLayoutInfo =
+ android::base::find(mDescriptorSetLayoutInfo, pAllocateInfo->pSetLayouts[i]);
+ if (!setLayoutInfo) return VK_ERROR_INITIALIZATION_FAILED;
+
+ for (const auto& binding : setLayoutInfo->bindings) {
+ bool success = false;
+ for (auto& pool : poolCopy) {
+ if (!isBindingFeasibleForAlloc(pool, binding)) continue;
+
+ success = true;
+ allocBindingFeasible(binding, pool);
+ break;
+ }
+
+ if (!success) {
+ return VK_ERROR_OUT_OF_POOL_MEMORY;
+ }
+ }
+ }
+ return VK_SUCCESS;
+ }
+
+ void applyDescriptorSetAllocationLocked(
+ DescriptorPoolInfo& poolInfo, const std::vector<VkDescriptorSetLayoutBinding>& bindings) {
+ ++poolInfo.usedSets;
+ for (const auto& binding : bindings) {
+ for (auto& pool : poolInfo.pools) {
+ if (!isBindingFeasibleForAlloc(pool, binding)) continue;
+ allocBindingFeasible(binding, pool);
+ break;
+ }
+ }
+ }
+
+ void removeDescriptorSetAllocationLocked(
+ DescriptorPoolInfo& poolInfo, const std::vector<VkDescriptorSetLayoutBinding>& bindings) {
+ --poolInfo.usedSets;
+ for (const auto& binding : bindings) {
+ for (auto& pool : poolInfo.pools) {
+ if (!isBindingFeasibleForFree(pool, binding)) continue;
+ freeBindingFeasible(binding, pool);
+ break;
+ }
+ }
+ }
+
+ template <class T>
+ class NonDispatchableHandleInfo {
+ public:
+ T underlying;
+ };
+
+ std::unordered_map<VkInstance, InstanceInfo> mInstanceInfo;
+ std::unordered_map<VkPhysicalDevice, PhysicalDeviceInfo> mPhysdevInfo;
+ std::unordered_map<VkDevice, DeviceInfo> mDeviceInfo;
+ std::unordered_map<VkImage, ImageInfo> mImageInfo;
+ std::unordered_map<VkImageView, ImageViewInfo> mImageViewInfo;
+ std::unordered_map<VkSampler, SamplerInfo> mSamplerInfo;
+ std::unordered_map<VkCommandBuffer, CommandBufferInfo> mCmdBufferInfo;
+ std::unordered_map<VkCommandPool, CommandPoolInfo> mCmdPoolInfo;
+ // TODO: release CommandBufferInfo when a command pool is reset/released
+
+ // Back-reference to the physical device associated with a particular
+ // VkDevice, and the VkDevice corresponding to a VkQueue.
+ std::unordered_map<VkDevice, VkPhysicalDevice> mDeviceToPhysicalDevice;
+ std::unordered_map<VkPhysicalDevice, VkInstance> mPhysicalDeviceToInstance;
+
+ std::unordered_map<VkQueue, QueueInfo> mQueueInfo;
+ std::unordered_map<VkBuffer, BufferInfo> mBufferInfo;
+
+ std::unordered_map<VkDeviceMemory, MemoryInfo> mMemoryInfo;
+
+ std::unordered_map<VkShaderModule, ShaderModuleInfo> mShaderModuleInfo;
+ std::unordered_map<VkPipelineCache, PipelineCacheInfo> mPipelineCacheInfo;
+ std::unordered_map<VkPipeline, PipelineInfo> mPipelineInfo;
+ std::unordered_map<VkRenderPass, RenderPassInfo> mRenderPassInfo;
+ std::unordered_map<VkFramebuffer, FramebufferInfo> mFramebufferInfo;
+
+ std::unordered_map<VkSemaphore, SemaphoreInfo> mSemaphoreInfo;
+ std::unordered_map<VkFence, FenceInfo> mFenceInfo;
+
+ std::unordered_map<VkDescriptorSetLayout, DescriptorSetLayoutInfo> mDescriptorSetLayoutInfo;
+ std::unordered_map<VkDescriptorPool, DescriptorPoolInfo> mDescriptorPoolInfo;
+ std::unordered_map<VkDescriptorSet, DescriptorSetInfo> mDescriptorSetInfo;
+
+#ifdef _WIN32
+ int mSemaphoreId = 1;
+ int genSemaphoreId() {
+ if (mSemaphoreId == -1) {
+ mSemaphoreId = 1;
+ }
+ int res = mSemaphoreId;
+ ++mSemaphoreId;
+ return res;
+ }
+ std::unordered_map<int, VkSemaphore> mExternalSemaphoresById;
+#endif
+ std::unordered_map<VkDescriptorUpdateTemplate, DescriptorUpdateTemplateInfo>
+ mDescriptorUpdateTemplateInfo;
+
+ VkDecoderSnapshot mSnapshot;
+
+ std::vector<uint64_t> mCreatedHandlesForSnapshotLoad;
+ size_t mCreatedHandlesForSnapshotLoadIndex = 0;
+
+ Lock mOccupiedGpasLock;
+ // Back-reference to the VkDeviceMemory that is occupying a particular
+ // guest physical address
+ struct OccupiedGpaInfo {
+ VulkanDispatch* vk;
+ VkDevice device;
+ VkDeviceMemory memory;
+ uint64_t gpa;
+ size_t sizeToPage;
+ };
+ std::unordered_map<uint64_t, OccupiedGpaInfo> mOccupiedGpas;
+
+ struct LinearImageCreateInfo {
+ VkExtent3D extent;
+ VkFormat format;
+ VkImageUsageFlags usage;
+
+ VkImageCreateInfo toDefaultVk() const {
+ return VkImageCreateInfo{
+ .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
+ .pNext = nullptr,
+ .flags = {},
+ .imageType = VK_IMAGE_TYPE_2D,
+ .format = format,
+ .extent = extent,
+ .mipLevels = 1,
+ .arrayLayers = 1,
+ .samples = VK_SAMPLE_COUNT_1_BIT,
+ .tiling = VK_IMAGE_TILING_LINEAR,
+ .usage = usage,
+ .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
+ .queueFamilyIndexCount = 0,
+ .pQueueFamilyIndices = nullptr,
+ .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
+ };
+ }
+
+ struct Hash {
+ std::size_t operator()(const LinearImageCreateInfo& ci) const {
+ std::size_t s = 0;
+ // Magic number used in boost::hash_combine().
+ constexpr size_t kHashMagic = 0x9e3779b9;
+ s ^= std::hash<uint32_t>{}(ci.extent.width) + kHashMagic + (s << 6) + (s >> 2);
+ s ^= std::hash<uint32_t>{}(ci.extent.height) + kHashMagic + (s << 6) + (s >> 2);
+ s ^= std::hash<uint32_t>{}(ci.extent.depth) + kHashMagic + (s << 6) + (s >> 2);
+ s ^= std::hash<VkFormat>{}(ci.format) + kHashMagic + (s << 6) + (s >> 2);
+ s ^= std::hash<VkImageUsageFlags>{}(ci.usage) + kHashMagic + (s << 6) + (s >> 2);
+ return s;
+ }
+ };
+ };
+
+ friend bool operator==(const LinearImageCreateInfo& a, const LinearImageCreateInfo& b) {
+ return a.extent.width == b.extent.width && a.extent.height == b.extent.height &&
+ a.extent.depth == b.extent.depth && a.format == b.format && a.usage == b.usage;
+ }
+
+ struct LinearImageProperties {
+ VkDeviceSize offset;
+ VkDeviceSize rowPitchAlignment;
+ };
+
+ // TODO(liyl): Remove after removing the old vkGetLinearImageLayoutGOOGLE.
+ std::unordered_map<VkFormat, LinearImageProperties> mPerFormatLinearImageProperties;
+
+ std::unordered_map<LinearImageCreateInfo, LinearImageProperties, LinearImageCreateInfo::Hash>
+ mLinearImageProperties;
+};
+
+VkDecoderGlobalState::VkDecoderGlobalState() : mImpl(new VkDecoderGlobalState::Impl()) {}
+
+VkDecoderGlobalState::~VkDecoderGlobalState() = default;
+
+static VkDecoderGlobalState* sGlobalDecoderState = nullptr;
+
+// static
+VkDecoderGlobalState* VkDecoderGlobalState::get() {
+ if (sGlobalDecoderState) return sGlobalDecoderState;
+ sGlobalDecoderState = new VkDecoderGlobalState;
+ return sGlobalDecoderState;
+}
+
+// static
+void VkDecoderGlobalState::reset() {
+ delete sGlobalDecoderState;
+ sGlobalDecoderState = nullptr;
+}
+
+// Snapshots
+bool VkDecoderGlobalState::snapshotsEnabled() const { return mImpl->snapshotsEnabled(); }
+
+bool VkDecoderGlobalState::vkCleanupEnabled() const { return mImpl->vkCleanupEnabled(); }
+
+void VkDecoderGlobalState::save(android::base::Stream* stream) { mImpl->save(stream); }
+
+void VkDecoderGlobalState::load(android::base::Stream* stream, GfxApiLogger& gfxLogger,
+ HealthMonitor<>* healthMonitor) {
+ mImpl->load(stream, gfxLogger, healthMonitor);
+}
+
+void VkDecoderGlobalState::lock() { mImpl->lock(); }
+
+void VkDecoderGlobalState::unlock() { mImpl->unlock(); }
+
+size_t VkDecoderGlobalState::setCreatedHandlesForSnapshotLoad(const unsigned char* buffer) {
+ return mImpl->setCreatedHandlesForSnapshotLoad(buffer);
+}
+
+void VkDecoderGlobalState::clearCreatedHandlesForSnapshotLoad() {
+ mImpl->clearCreatedHandlesForSnapshotLoad();
+}
+
+VkResult VkDecoderGlobalState::on_vkEnumerateInstanceVersion(android::base::BumpPool* pool,
+ uint32_t* pApiVersion) {
+ return mImpl->on_vkEnumerateInstanceVersion(pool, pApiVersion);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateInstance(android::base::BumpPool* pool,
+ const VkInstanceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkInstance* pInstance) {
+ return mImpl->on_vkCreateInstance(pool, pCreateInfo, pAllocator, pInstance);
+}
+
+void VkDecoderGlobalState::on_vkDestroyInstance(android::base::BumpPool* pool, VkInstance instance,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyInstance(pool, instance, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkEnumeratePhysicalDevices(android::base::BumpPool* pool,
+ VkInstance instance,
+ uint32_t* physicalDeviceCount,
+ VkPhysicalDevice* physicalDevices) {
+ return mImpl->on_vkEnumeratePhysicalDevices(pool, instance, physicalDeviceCount,
+ physicalDevices);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceFeatures(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures* pFeatures) {
+ mImpl->on_vkGetPhysicalDeviceFeatures(pool, physicalDevice, pFeatures);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceFeatures2(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures2* pFeatures) {
+ mImpl->on_vkGetPhysicalDeviceFeatures2(pool, physicalDevice, pFeatures);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceFeatures2KHR(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures2KHR* pFeatures) {
+ mImpl->on_vkGetPhysicalDeviceFeatures2(pool, physicalDevice, pFeatures);
+}
+
+VkResult VkDecoderGlobalState::on_vkGetPhysicalDeviceImageFormatProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice, VkFormat format,
+ VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
+ VkImageFormatProperties* pImageFormatProperties) {
+ return mImpl->on_vkGetPhysicalDeviceImageFormatProperties(
+ pool, physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
+}
+VkResult VkDecoderGlobalState::on_vkGetPhysicalDeviceImageFormatProperties2(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+ VkImageFormatProperties2* pImageFormatProperties) {
+ return mImpl->on_vkGetPhysicalDeviceImageFormatProperties2(
+ pool, physicalDevice, pImageFormatInfo, pImageFormatProperties);
+}
+VkResult VkDecoderGlobalState::on_vkGetPhysicalDeviceImageFormatProperties2KHR(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+ VkImageFormatProperties2* pImageFormatProperties) {
+ return mImpl->on_vkGetPhysicalDeviceImageFormatProperties2(
+ pool, physicalDevice, pImageFormatInfo, pImageFormatProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceFormatProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties* pFormatProperties) {
+ mImpl->on_vkGetPhysicalDeviceFormatProperties(pool, physicalDevice, format, pFormatProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceFormatProperties2(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties2* pFormatProperties) {
+ mImpl->on_vkGetPhysicalDeviceFormatProperties2(pool, physicalDevice, format, pFormatProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceFormatProperties2KHR(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties2* pFormatProperties) {
+ mImpl->on_vkGetPhysicalDeviceFormatProperties2(pool, physicalDevice, format, pFormatProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceProperties* pProperties) {
+ mImpl->on_vkGetPhysicalDeviceProperties(pool, physicalDevice, pProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceProperties2(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceProperties2* pProperties) {
+ mImpl->on_vkGetPhysicalDeviceProperties2(pool, physicalDevice, pProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceProperties2KHR(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceProperties2* pProperties) {
+ mImpl->on_vkGetPhysicalDeviceProperties2(pool, physicalDevice, pProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceMemoryProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
+ mImpl->on_vkGetPhysicalDeviceMemoryProperties(pool, physicalDevice, pMemoryProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceMemoryProperties2(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
+ mImpl->on_vkGetPhysicalDeviceMemoryProperties2(pool, physicalDevice, pMemoryProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceMemoryProperties2KHR(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
+ mImpl->on_vkGetPhysicalDeviceMemoryProperties2(pool, physicalDevice, pMemoryProperties);
+}
+
+VkResult VkDecoderGlobalState::on_vkEnumerateDeviceExtensionProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice, const char* pLayerName,
+ uint32_t* pPropertyCount, VkExtensionProperties* pProperties) {
+ return mImpl->on_vkEnumerateDeviceExtensionProperties(pool, physicalDevice, pLayerName,
+ pPropertyCount, pProperties);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateDevice(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ const VkDeviceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDevice* pDevice) {
+ return mImpl->on_vkCreateDevice(pool, physicalDevice, pCreateInfo, pAllocator, pDevice);
+}
+
+void VkDecoderGlobalState::on_vkGetDeviceQueue(android::base::BumpPool* pool, VkDevice device,
+ uint32_t queueFamilyIndex, uint32_t queueIndex,
+ VkQueue* pQueue) {
+ mImpl->on_vkGetDeviceQueue(pool, device, queueFamilyIndex, queueIndex, pQueue);
+}
+
+void VkDecoderGlobalState::on_vkGetDeviceQueue2(android::base::BumpPool* pool, VkDevice device,
+ const VkDeviceQueueInfo2* pQueueInfo,
+ VkQueue* pQueue) {
+ mImpl->on_vkGetDeviceQueue2(pool, device, pQueueInfo, pQueue);
+}
+
+void VkDecoderGlobalState::on_vkDestroyDevice(android::base::BumpPool* pool, VkDevice device,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyDevice(pool, device, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateBuffer(android::base::BumpPool* pool, VkDevice device,
+ const VkBufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkBuffer* pBuffer) {
+ return mImpl->on_vkCreateBuffer(pool, device, pCreateInfo, pAllocator, pBuffer);
+}
+
+void VkDecoderGlobalState::on_vkDestroyBuffer(android::base::BumpPool* pool, VkDevice device,
+ VkBuffer buffer,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyBuffer(pool, device, buffer, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkBindBufferMemory(android::base::BumpPool* pool, VkDevice device,
+ VkBuffer buffer, VkDeviceMemory memory,
+ VkDeviceSize memoryOffset) {
+ return mImpl->on_vkBindBufferMemory(pool, device, buffer, memory, memoryOffset);
+}
+
+VkResult VkDecoderGlobalState::on_vkBindBufferMemory2(android::base::BumpPool* pool,
+ VkDevice device, uint32_t bindInfoCount,
+ const VkBindBufferMemoryInfo* pBindInfos) {
+ return mImpl->on_vkBindBufferMemory2(pool, device, bindInfoCount, pBindInfos);
+}
+
+VkResult VkDecoderGlobalState::on_vkBindBufferMemory2KHR(android::base::BumpPool* pool,
+ VkDevice device, uint32_t bindInfoCount,
+ const VkBindBufferMemoryInfo* pBindInfos) {
+ return mImpl->on_vkBindBufferMemory2KHR(pool, device, bindInfoCount, pBindInfos);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateImage(android::base::BumpPool* pool, VkDevice device,
+ const VkImageCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkImage* pImage) {
+ return mImpl->on_vkCreateImage(pool, device, pCreateInfo, pAllocator, pImage);
+}
+
+void VkDecoderGlobalState::on_vkDestroyImage(android::base::BumpPool* pool, VkDevice device,
+ VkImage image,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyImage(pool, device, image, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkBindImageMemory(android::base::BumpPool* pool, VkDevice device,
+ VkImage image, VkDeviceMemory memory,
+ VkDeviceSize memoryOffset) {
+ return mImpl->on_vkBindImageMemory(pool, device, image, memory, memoryOffset);
+}
+
+VkResult VkDecoderGlobalState::on_vkBindImageMemory2(android::base::BumpPool* pool, VkDevice device,
+ uint32_t bindInfoCount,
+ const VkBindImageMemoryInfo* pBindInfos) {
+ return mImpl->on_vkBindImageMemory2(pool, device, bindInfoCount, pBindInfos);
+}
+
+VkResult VkDecoderGlobalState::on_vkBindImageMemory2KHR(android::base::BumpPool* pool,
+ VkDevice device, uint32_t bindInfoCount,
+ const VkBindImageMemoryInfo* pBindInfos) {
+ return mImpl->on_vkBindImageMemory2(pool, device, bindInfoCount, pBindInfos);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateImageView(android::base::BumpPool* pool, VkDevice device,
+ const VkImageViewCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkImageView* pView) {
+ return mImpl->on_vkCreateImageView(pool, device, pCreateInfo, pAllocator, pView);
+}
+
+void VkDecoderGlobalState::on_vkDestroyImageView(android::base::BumpPool* pool, VkDevice device,
+ VkImageView imageView,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyImageView(pool, device, imageView, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateSampler(android::base::BumpPool* pool, VkDevice device,
+ const VkSamplerCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkSampler* pSampler) {
+ return mImpl->on_vkCreateSampler(pool, device, pCreateInfo, pAllocator, pSampler);
+}
+
+void VkDecoderGlobalState::on_vkDestroySampler(android::base::BumpPool* pool, VkDevice device,
+ VkSampler sampler,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroySampler(pool, device, sampler, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateSemaphore(android::base::BumpPool* pool, VkDevice device,
+ const VkSemaphoreCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkSemaphore* pSemaphore) {
+ return mImpl->on_vkCreateSemaphore(pool, device, pCreateInfo, pAllocator, pSemaphore);
+}
+
+VkResult VkDecoderGlobalState::on_vkImportSemaphoreFdKHR(
+ android::base::BumpPool* pool, VkDevice device,
+ const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) {
+ return mImpl->on_vkImportSemaphoreFdKHR(pool, device, pImportSemaphoreFdInfo);
+}
+
+VkResult VkDecoderGlobalState::on_vkGetSemaphoreFdKHR(android::base::BumpPool* pool,
+ VkDevice device,
+ const VkSemaphoreGetFdInfoKHR* pGetFdInfo,
+ int* pFd) {
+ return mImpl->on_vkGetSemaphoreFdKHR(pool, device, pGetFdInfo, pFd);
+}
+
+void VkDecoderGlobalState::on_vkDestroySemaphore(android::base::BumpPool* pool, VkDevice device,
+ VkSemaphore semaphore,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroySemaphore(pool, device, semaphore, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateFence(android::base::BumpPool* pool, VkDevice device,
+ const VkFenceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkFence* pFence) {
+ return mImpl->on_vkCreateFence(pool, device, pCreateInfo, pAllocator, pFence);
+}
+
+VkResult VkDecoderGlobalState::on_vkResetFences(android::base::BumpPool* pool, VkDevice device,
+ uint32_t fenceCount, const VkFence* pFences) {
+ return mImpl->on_vkResetFences(pool, device, fenceCount, pFences);
+}
+
+void VkDecoderGlobalState::on_vkDestroyFence(android::base::BumpPool* pool, VkDevice device,
+ VkFence fence,
+ const VkAllocationCallbacks* pAllocator) {
+ return mImpl->on_vkDestroyFence(pool, device, fence, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateDescriptorSetLayout(
+ android::base::BumpPool* pool, VkDevice device,
+ const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+ VkDescriptorSetLayout* pSetLayout) {
+ return mImpl->on_vkCreateDescriptorSetLayout(pool, device, pCreateInfo, pAllocator, pSetLayout);
+}
+
+void VkDecoderGlobalState::on_vkDestroyDescriptorSetLayout(
+ android::base::BumpPool* pool, VkDevice device, VkDescriptorSetLayout descriptorSetLayout,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyDescriptorSetLayout(pool, device, descriptorSetLayout, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateDescriptorPool(
+ android::base::BumpPool* pool, VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool) {
+ return mImpl->on_vkCreateDescriptorPool(pool, device, pCreateInfo, pAllocator, pDescriptorPool);
+}
+
+void VkDecoderGlobalState::on_vkDestroyDescriptorPool(android::base::BumpPool* pool,
+ VkDevice device,
+ VkDescriptorPool descriptorPool,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyDescriptorPool(pool, device, descriptorPool, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkResetDescriptorPool(android::base::BumpPool* pool,
+ VkDevice device,
+ VkDescriptorPool descriptorPool,
+ VkDescriptorPoolResetFlags flags) {
+ return mImpl->on_vkResetDescriptorPool(pool, device, descriptorPool, flags);
+}
+
+VkResult VkDecoderGlobalState::on_vkAllocateDescriptorSets(
+ android::base::BumpPool* pool, VkDevice device,
+ const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets) {
+ return mImpl->on_vkAllocateDescriptorSets(pool, device, pAllocateInfo, pDescriptorSets);
+}
+
+VkResult VkDecoderGlobalState::on_vkFreeDescriptorSets(android::base::BumpPool* pool,
+ VkDevice device,
+ VkDescriptorPool descriptorPool,
+ uint32_t descriptorSetCount,
+ const VkDescriptorSet* pDescriptorSets) {
+ return mImpl->on_vkFreeDescriptorSets(pool, device, descriptorPool, descriptorSetCount,
+ pDescriptorSets);
+}
+
+void VkDecoderGlobalState::on_vkUpdateDescriptorSets(android::base::BumpPool* pool, VkDevice device,
+ uint32_t descriptorWriteCount,
+ const VkWriteDescriptorSet* pDescriptorWrites,
+ uint32_t descriptorCopyCount,
+ const VkCopyDescriptorSet* pDescriptorCopies) {
+ mImpl->on_vkUpdateDescriptorSets(pool, device, descriptorWriteCount, pDescriptorWrites,
+ descriptorCopyCount, pDescriptorCopies);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateShaderModule(android::base::BumpPool* pool,
+ VkDevice boxed_device,
+ const VkShaderModuleCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkShaderModule* pShaderModule) {
+ return mImpl->on_vkCreateShaderModule(pool, boxed_device, pCreateInfo, pAllocator,
+ pShaderModule);
+}
+
+void VkDecoderGlobalState::on_vkDestroyShaderModule(android::base::BumpPool* pool,
+ VkDevice boxed_device,
+ VkShaderModule shaderModule,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyShaderModule(pool, boxed_device, shaderModule, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreatePipelineCache(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+ VkPipelineCache* pPipelineCache) {
+ return mImpl->on_vkCreatePipelineCache(pool, boxed_device, pCreateInfo, pAllocator,
+ pPipelineCache);
+}
+
+void VkDecoderGlobalState::on_vkDestroyPipelineCache(android::base::BumpPool* pool,
+ VkDevice boxed_device,
+ VkPipelineCache pipelineCache,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyPipelineCache(pool, boxed_device, pipelineCache, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateGraphicsPipelines(
+ android::base::BumpPool* pool, VkDevice boxed_device, VkPipelineCache pipelineCache,
+ uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos,
+ const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) {
+ return mImpl->on_vkCreateGraphicsPipelines(pool, boxed_device, pipelineCache, createInfoCount,
+ pCreateInfos, pAllocator, pPipelines);
+}
+
+void VkDecoderGlobalState::on_vkDestroyPipeline(android::base::BumpPool* pool,
+ VkDevice boxed_device, VkPipeline pipeline,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyPipeline(pool, boxed_device, pipeline, pAllocator);
+}
+
+void VkDecoderGlobalState::on_vkCmdCopyBufferToImage(
+ android::base::BumpPool* pool, VkCommandBuffer commandBuffer, VkBuffer srcBuffer,
+ VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkBufferImageCopy* pRegions, const VkDecoderContext& context) {
+ mImpl->on_vkCmdCopyBufferToImage(pool, commandBuffer, srcBuffer, dstImage, dstImageLayout,
+ regionCount, pRegions, context);
+}
+
+void VkDecoderGlobalState::on_vkCmdCopyImage(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer, VkImage srcImage,
+ VkImageLayout srcImageLayout, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkImageCopy* pRegions) {
+ mImpl->on_vkCmdCopyImage(pool, commandBuffer, srcImage, srcImageLayout, dstImage,
+ dstImageLayout, regionCount, pRegions);
+}
+void VkDecoderGlobalState::on_vkCmdCopyImageToBuffer(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ VkImage srcImage, VkImageLayout srcImageLayout,
+ VkBuffer dstBuffer, uint32_t regionCount,
+ const VkBufferImageCopy* pRegions) {
+ mImpl->on_vkCmdCopyImageToBuffer(pool, commandBuffer, srcImage, srcImageLayout, dstBuffer,
+ regionCount, pRegions);
+}
+
+void VkDecoderGlobalState::on_vkCmdCopyBufferToImage2(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo,
+ const VkDecoderContext& context) {
+ mImpl->on_vkCmdCopyBufferToImage2(pool, commandBuffer, pCopyBufferToImageInfo, context);
+}
+
+void VkDecoderGlobalState::on_vkCmdCopyImage2(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageInfo2* pCopyImageInfo) {
+ mImpl->on_vkCmdCopyImage2(pool, commandBuffer, pCopyImageInfo);
+}
+
+void VkDecoderGlobalState::on_vkCmdCopyImageToBuffer2(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) {
+ mImpl->on_vkCmdCopyImageToBuffer2(pool, commandBuffer, pCopyImageToBufferInfo);
+}
+
+void VkDecoderGlobalState::on_vkCmdCopyBufferToImage2KHR(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo,
+ const VkDecoderContext& context) {
+ mImpl->on_vkCmdCopyBufferToImage2KHR(pool, commandBuffer, pCopyBufferToImageInfo, context);
+}
+
+void VkDecoderGlobalState::on_vkCmdCopyImage2KHR(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageInfo2KHR* pCopyImageInfo) {
+ mImpl->on_vkCmdCopyImage2KHR(pool, commandBuffer, pCopyImageInfo);
+}
+
+void VkDecoderGlobalState::on_vkCmdCopyImageToBuffer2KHR(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) {
+ mImpl->on_vkCmdCopyImageToBuffer2KHR(pool, commandBuffer, pCopyImageToBufferInfo);
+}
+
+void VkDecoderGlobalState::on_vkGetImageMemoryRequirements(
+ android::base::BumpPool* pool, VkDevice device, VkImage image,
+ VkMemoryRequirements* pMemoryRequirements) {
+ mImpl->on_vkGetImageMemoryRequirements(pool, device, image, pMemoryRequirements);
+}
+
+void VkDecoderGlobalState::on_vkGetImageMemoryRequirements2(
+ android::base::BumpPool* pool, VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements) {
+ mImpl->on_vkGetImageMemoryRequirements2(pool, device, pInfo, pMemoryRequirements);
+}
+
+void VkDecoderGlobalState::on_vkGetImageMemoryRequirements2KHR(
+ android::base::BumpPool* pool, VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements) {
+ mImpl->on_vkGetImageMemoryRequirements2(pool, device, pInfo, pMemoryRequirements);
+}
+
+void VkDecoderGlobalState::on_vkGetBufferMemoryRequirements(
+ android::base::BumpPool* pool, VkDevice device, VkBuffer buffer,
+ VkMemoryRequirements* pMemoryRequirements) {
+ mImpl->on_vkGetBufferMemoryRequirements(pool, device, buffer, pMemoryRequirements);
+}
+
+void VkDecoderGlobalState::on_vkGetBufferMemoryRequirements2(
+ android::base::BumpPool* pool, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements) {
+ mImpl->on_vkGetBufferMemoryRequirements2(pool, device, pInfo, pMemoryRequirements);
+}
+
+void VkDecoderGlobalState::on_vkGetBufferMemoryRequirements2KHR(
+ android::base::BumpPool* pool, VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements) {
+ mImpl->on_vkGetBufferMemoryRequirements2(pool, device, pInfo, pMemoryRequirements);
+}
+
+void VkDecoderGlobalState::on_vkCmdPipelineBarrier(
+ android::base::BumpPool* pool, 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(pool, commandBuffer, srcStageMask, dstStageMask, dependencyFlags,
+ memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
+ pBufferMemoryBarriers, imageMemoryBarrierCount,
+ pImageMemoryBarriers);
+}
+
+VkResult VkDecoderGlobalState::on_vkAllocateMemory(android::base::BumpPool* pool, VkDevice device,
+ const VkMemoryAllocateInfo* pAllocateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDeviceMemory* pMemory) {
+ return mImpl->on_vkAllocateMemory(pool, device, pAllocateInfo, pAllocator, pMemory);
+}
+
+void VkDecoderGlobalState::on_vkFreeMemory(android::base::BumpPool* pool, VkDevice device,
+ VkDeviceMemory memory,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkFreeMemory(pool, device, memory, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkMapMemory(android::base::BumpPool* pool, VkDevice device,
+ VkDeviceMemory memory, VkDeviceSize offset,
+ VkDeviceSize size, VkMemoryMapFlags flags,
+ void** ppData) {
+ return mImpl->on_vkMapMemory(pool, device, memory, offset, size, flags, ppData);
+}
+
+void VkDecoderGlobalState::on_vkUnmapMemory(android::base::BumpPool* pool, VkDevice device,
+ VkDeviceMemory memory) {
+ mImpl->on_vkUnmapMemory(pool, device, memory);
+}
+
+uint8_t* VkDecoderGlobalState::getMappedHostPointer(VkDeviceMemory memory) {
+ return mImpl->getMappedHostPointer(memory);
+}
+
+VkDeviceSize VkDecoderGlobalState::getDeviceMemorySize(VkDeviceMemory memory) {
+ return mImpl->getDeviceMemorySize(memory);
+}
+
+bool VkDecoderGlobalState::usingDirectMapping() const { return mImpl->usingDirectMapping(); }
+
+VkDecoderGlobalState::HostFeatureSupport VkDecoderGlobalState::getHostFeatureSupport() const {
+ return mImpl->getHostFeatureSupport();
+}
+
+// VK_ANDROID_native_buffer
+VkResult VkDecoderGlobalState::on_vkGetSwapchainGrallocUsageANDROID(android::base::BumpPool* pool,
+ VkDevice device,
+ VkFormat format,
+ VkImageUsageFlags imageUsage,
+ int* grallocUsage) {
+ return mImpl->on_vkGetSwapchainGrallocUsageANDROID(pool, device, format, imageUsage,
+ grallocUsage);
+}
+
+VkResult VkDecoderGlobalState::on_vkGetSwapchainGrallocUsage2ANDROID(
+ android::base::BumpPool* pool, VkDevice device, VkFormat format, VkImageUsageFlags imageUsage,
+ VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, uint64_t* grallocConsumerUsage,
+ uint64_t* grallocProducerUsage) {
+ return mImpl->on_vkGetSwapchainGrallocUsage2ANDROID(pool, device, format, imageUsage,
+ swapchainImageUsage, grallocConsumerUsage,
+ grallocProducerUsage);
+}
+
+VkResult VkDecoderGlobalState::on_vkAcquireImageANDROID(android::base::BumpPool* pool,
+ VkDevice device, VkImage image,
+ int nativeFenceFd, VkSemaphore semaphore,
+ VkFence fence) {
+ return mImpl->on_vkAcquireImageANDROID(pool, device, image, nativeFenceFd, semaphore, fence);
+}
+
+VkResult VkDecoderGlobalState::on_vkQueueSignalReleaseImageANDROID(
+ android::base::BumpPool* pool, VkQueue queue, uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores, VkImage image, int* pNativeFenceFd) {
+ return mImpl->on_vkQueueSignalReleaseImageANDROID(pool, queue, waitSemaphoreCount,
+ pWaitSemaphores, image, pNativeFenceFd);
+}
+
+// VK_GOOGLE_gfxstream
+VkResult VkDecoderGlobalState::on_vkMapMemoryIntoAddressSpaceGOOGLE(android::base::BumpPool* pool,
+ VkDevice device,
+ VkDeviceMemory memory,
+ uint64_t* pAddress) {
+ return mImpl->on_vkMapMemoryIntoAddressSpaceGOOGLE(pool, device, memory, pAddress);
+}
+
+VkResult VkDecoderGlobalState::on_vkGetMemoryHostAddressInfoGOOGLE(
+ android::base::BumpPool* pool, VkDevice device, VkDeviceMemory memory, uint64_t* pAddress,
+ uint64_t* pSize, uint64_t* pHostmemId) {
+ return mImpl->on_vkGetMemoryHostAddressInfoGOOGLE(pool, device, memory, pAddress, pSize,
+ pHostmemId);
+}
+
+VkResult VkDecoderGlobalState::on_vkGetBlobGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ VkDeviceMemory memory) {
+ return mImpl->on_vkGetBlobGOOGLE(pool, device, memory);
+}
+
+VkResult VkDecoderGlobalState::on_vkFreeMemorySyncGOOGLE(android::base::BumpPool* pool,
+ VkDevice device, VkDeviceMemory memory,
+ const VkAllocationCallbacks* pAllocator) {
+ return mImpl->on_vkFreeMemorySyncGOOGLE(pool, device, memory, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkAllocateCommandBuffers(
+ android::base::BumpPool* pool, VkDevice device,
+ const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers) {
+ return mImpl->on_vkAllocateCommandBuffers(pool, device, pAllocateInfo, pCommandBuffers);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateCommandPool(android::base::BumpPool* pool,
+ VkDevice device,
+ const VkCommandPoolCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkCommandPool* pCommandPool) {
+ return mImpl->on_vkCreateCommandPool(pool, device, pCreateInfo, pAllocator, pCommandPool);
+}
+
+void VkDecoderGlobalState::on_vkDestroyCommandPool(android::base::BumpPool* pool, VkDevice device,
+ VkCommandPool commandPool,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyCommandPool(pool, device, commandPool, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkResetCommandPool(android::base::BumpPool* pool, VkDevice device,
+ VkCommandPool commandPool,
+ VkCommandPoolResetFlags flags) {
+ return mImpl->on_vkResetCommandPool(pool, device, commandPool, flags);
+}
+
+void VkDecoderGlobalState::on_vkCmdExecuteCommands(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ uint32_t commandBufferCount,
+ const VkCommandBuffer* pCommandBuffers) {
+ return mImpl->on_vkCmdExecuteCommands(pool, commandBuffer, commandBufferCount, pCommandBuffers);
+}
+
+VkResult VkDecoderGlobalState::on_vkQueueSubmit(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t submitCount, const VkSubmitInfo* pSubmits,
+ VkFence fence) {
+ return mImpl->on_vkQueueSubmit(pool, queue, submitCount, pSubmits, fence);
+}
+
+VkResult VkDecoderGlobalState::on_vkQueueSubmit2(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t submitCount,
+ const VkSubmitInfo2* pSubmits, VkFence fence) {
+ return mImpl->on_vkQueueSubmit(pool, queue, submitCount, pSubmits, fence);
+}
+
+VkResult VkDecoderGlobalState::on_vkQueueWaitIdle(android::base::BumpPool* pool, VkQueue queue) {
+ return mImpl->on_vkQueueWaitIdle(pool, queue);
+}
+
+VkResult VkDecoderGlobalState::on_vkResetCommandBuffer(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ VkCommandBufferResetFlags flags) {
+ return mImpl->on_vkResetCommandBuffer(pool, commandBuffer, flags);
+}
+
+void VkDecoderGlobalState::on_vkFreeCommandBuffers(android::base::BumpPool* pool, VkDevice device,
+ VkCommandPool commandPool,
+ uint32_t commandBufferCount,
+ const VkCommandBuffer* pCommandBuffers) {
+ return mImpl->on_vkFreeCommandBuffers(pool, device, commandPool, commandBufferCount,
+ pCommandBuffers);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+ VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
+ return mImpl->on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+ pool, physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
+}
+
+void VkDecoderGlobalState::on_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+ VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {
+ return mImpl->on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+ pool, physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
+}
+
+// Descriptor update templates
+VkResult VkDecoderGlobalState::on_vkCreateDescriptorUpdateTemplate(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+ return mImpl->on_vkCreateDescriptorUpdateTemplate(pool, boxed_device, pCreateInfo, pAllocator,
+ pDescriptorUpdateTemplate);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateDescriptorUpdateTemplateKHR(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {
+ return mImpl->on_vkCreateDescriptorUpdateTemplateKHR(pool, boxed_device, pCreateInfo,
+ pAllocator, pDescriptorUpdateTemplate);
+}
+
+void VkDecoderGlobalState::on_vkDestroyDescriptorUpdateTemplate(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyDescriptorUpdateTemplate(pool, boxed_device, descriptorUpdateTemplate,
+ pAllocator);
+}
+
+void VkDecoderGlobalState::on_vkDestroyDescriptorUpdateTemplateKHR(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyDescriptorUpdateTemplateKHR(pool, boxed_device, descriptorUpdateTemplate,
+ pAllocator);
+}
+
+void VkDecoderGlobalState::on_vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+ android::base::BumpPool* pool, VkDevice boxed_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) {
+ mImpl->on_vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+ pool, boxed_device, descriptorSet, descriptorUpdateTemplate, imageInfoCount,
+ bufferInfoCount, bufferViewCount, pImageInfoEntryIndices, pBufferInfoEntryIndices,
+ pBufferViewEntryIndices, pImageInfos, pBufferInfos, pBufferViews);
+}
+
+void VkDecoderGlobalState::on_vkUpdateDescriptorSetWithTemplateSized2GOOGLE(
+ android::base::BumpPool* pool, VkDevice boxed_device, VkDescriptorSet descriptorSet,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount,
+ uint32_t bufferInfoCount, uint32_t bufferViewCount, uint32_t inlineUniformBlockCount,
+ const uint32_t* pImageInfoEntryIndices, const uint32_t* pBufferInfoEntryIndices,
+ const uint32_t* pBufferViewEntryIndices, const VkDescriptorImageInfo* pImageInfos,
+ const VkDescriptorBufferInfo* pBufferInfos, const VkBufferView* pBufferViews,
+ const uint8_t* pInlineUniformBlockData) {
+ mImpl->on_vkUpdateDescriptorSetWithTemplateSized2GOOGLE(
+ pool, boxed_device, descriptorSet, descriptorUpdateTemplate, imageInfoCount,
+ bufferInfoCount, bufferViewCount, inlineUniformBlockCount, pImageInfoEntryIndices,
+ pBufferInfoEntryIndices, pBufferViewEntryIndices, pImageInfos, pBufferInfos, pBufferViews,
+ pInlineUniformBlockData);
+}
+
+VkResult VkDecoderGlobalState::on_vkBeginCommandBuffer(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCommandBufferBeginInfo* pBeginInfo,
+ const VkDecoderContext& context) {
+ return mImpl->on_vkBeginCommandBuffer(pool, commandBuffer, pBeginInfo, context);
+}
+
+void VkDecoderGlobalState::on_vkBeginCommandBufferAsyncGOOGLE(
+ android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ const VkCommandBufferBeginInfo* pBeginInfo, const VkDecoderContext& context) {
+ mImpl->on_vkBeginCommandBuffer(pool, commandBuffer, pBeginInfo, context);
+}
+
+VkResult VkDecoderGlobalState::on_vkEndCommandBuffer(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkDecoderContext& context) {
+ return mImpl->on_vkEndCommandBuffer(pool, commandBuffer, context);
+}
+
+void VkDecoderGlobalState::on_vkEndCommandBufferAsyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkDecoderContext& context) {
+ mImpl->on_vkEndCommandBufferAsyncGOOGLE(pool, commandBuffer, context);
+}
+
+void VkDecoderGlobalState::on_vkResetCommandBufferAsyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ VkCommandBufferResetFlags flags) {
+ mImpl->on_vkResetCommandBufferAsyncGOOGLE(pool, commandBuffer, flags);
+}
+
+void VkDecoderGlobalState::on_vkCommandBufferHostSyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ uint32_t needHostSync,
+ uint32_t sequenceNumber) {
+ mImpl->hostSyncCommandBuffer("hostSync", commandBuffer, needHostSync, sequenceNumber);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateImageWithRequirementsGOOGLE(
+ android::base::BumpPool* pool, VkDevice device, const VkImageCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkImage* pImage,
+ VkMemoryRequirements* pMemoryRequirements) {
+ return mImpl->on_vkCreateImageWithRequirementsGOOGLE(pool, device, pCreateInfo, pAllocator,
+ pImage, pMemoryRequirements);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateBufferWithRequirementsGOOGLE(
+ android::base::BumpPool* pool, VkDevice device, const VkBufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer,
+ VkMemoryRequirements* pMemoryRequirements) {
+ return mImpl->on_vkCreateBufferWithRequirementsGOOGLE(pool, device, pCreateInfo, pAllocator,
+ pBuffer, pMemoryRequirements);
+}
+
+void VkDecoderGlobalState::on_vkCmdBindPipeline(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ VkPipelineBindPoint pipelineBindPoint,
+ VkPipeline pipeline) {
+ mImpl->on_vkCmdBindPipeline(pool, commandBuffer, pipelineBindPoint, pipeline);
+}
+
+void VkDecoderGlobalState::on_vkCmdBindDescriptorSets(
+ android::base::BumpPool* pool, 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(pool, commandBuffer, pipelineBindPoint, layout, firstSet,
+ descriptorSetCount, pDescriptorSets, dynamicOffsetCount,
+ pDynamicOffsets);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateRenderPass(android::base::BumpPool* pool,
+ VkDevice boxed_device,
+ const VkRenderPassCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkRenderPass* pRenderPass) {
+ return mImpl->on_vkCreateRenderPass(pool, boxed_device, pCreateInfo, pAllocator, pRenderPass);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateRenderPass2(android::base::BumpPool* pool,
+ VkDevice boxed_device,
+ const VkRenderPassCreateInfo2* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkRenderPass* pRenderPass) {
+ return mImpl->on_vkCreateRenderPass2(pool, boxed_device, pCreateInfo, pAllocator, pRenderPass);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateRenderPass2KHR(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkRenderPassCreateInfo2KHR* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+ VkRenderPass* pRenderPass) {
+ return mImpl->on_vkCreateRenderPass2(pool, boxed_device, pCreateInfo, pAllocator, pRenderPass);
+}
+
+void VkDecoderGlobalState::on_vkDestroyRenderPass(android::base::BumpPool* pool,
+ VkDevice boxed_device, VkRenderPass renderPass,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyRenderPass(pool, boxed_device, renderPass, pAllocator);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateFramebuffer(android::base::BumpPool* pool,
+ VkDevice boxed_device,
+ const VkFramebufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkFramebuffer* pFramebuffer) {
+ return mImpl->on_vkCreateFramebuffer(pool, boxed_device, pCreateInfo, pAllocator, pFramebuffer);
+}
+
+void VkDecoderGlobalState::on_vkDestroyFramebuffer(android::base::BumpPool* pool,
+ VkDevice boxed_device, VkFramebuffer framebuffer,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroyFramebuffer(pool, boxed_device, framebuffer, pAllocator);
+}
+
+void VkDecoderGlobalState::on_vkQueueHostSyncGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t needHostSync,
+ uint32_t sequenceNumber) {
+ mImpl->hostSyncQueue("hostSyncQueue", queue, needHostSync, sequenceNumber);
+}
+
+void VkDecoderGlobalState::on_vkCmdCopyQueryPoolResults(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ VkQueryPool queryPool, uint32_t firstQuery,
+ uint32_t queryCount, VkBuffer dstBuffer,
+ VkDeviceSize dstOffset, VkDeviceSize stride,
+ VkQueryResultFlags flags) {
+ mImpl->on_vkCmdCopyQueryPoolResults(pool, commandBuffer, queryPool, firstQuery, queryCount,
+ dstBuffer, dstOffset, stride, flags);
+}
+
+void VkDecoderGlobalState::on_vkQueueSubmitAsyncGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t submitCount,
+ const VkSubmitInfo* pSubmits,
+ VkFence fence) {
+ mImpl->on_vkQueueSubmit(pool, queue, submitCount, pSubmits, fence);
+}
+
+void VkDecoderGlobalState::on_vkQueueSubmitAsync2GOOGLE(android::base::BumpPool* pool,
+ VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfo2* pSubmits,
+ VkFence fence) {
+ mImpl->on_vkQueueSubmit(pool, queue, submitCount, pSubmits, fence);
+}
+
+void VkDecoderGlobalState::on_vkQueueWaitIdleAsyncGOOGLE(android::base::BumpPool* pool,
+ VkQueue queue) {
+ mImpl->on_vkQueueWaitIdle(pool, queue);
+}
+
+void VkDecoderGlobalState::on_vkQueueBindSparseAsyncGOOGLE(android::base::BumpPool* pool,
+ VkQueue queue, uint32_t bindInfoCount,
+ const VkBindSparseInfo* pBindInfo,
+ VkFence fence) {
+ mImpl->on_vkQueueBindSparse(pool, queue, bindInfoCount, pBindInfo, fence);
+}
+
+void VkDecoderGlobalState::on_vkGetLinearImageLayoutGOOGLE(android::base::BumpPool* pool,
+ VkDevice device, VkFormat format,
+ VkDeviceSize* pOffset,
+ VkDeviceSize* pRowPitchAlignment) {
+ mImpl->on_vkGetLinearImageLayoutGOOGLE(pool, device, format, pOffset, pRowPitchAlignment);
+}
+
+void VkDecoderGlobalState::on_vkGetLinearImageLayout2GOOGLE(android::base::BumpPool* pool,
+ VkDevice device,
+ const VkImageCreateInfo* pCreateInfo,
+ VkDeviceSize* pOffset,
+ VkDeviceSize* pRowPitchAlignment) {
+ mImpl->on_vkGetLinearImageLayout2GOOGLE(pool, device, pCreateInfo, pOffset, pRowPitchAlignment);
+}
+
+void VkDecoderGlobalState::on_vkQueueFlushCommandsGOOGLE(android::base::BumpPool* pool,
+ VkQueue queue,
+ VkCommandBuffer commandBuffer,
+ VkDeviceSize dataSize, const void* pData,
+ const VkDecoderContext& context) {
+ mImpl->on_vkQueueFlushCommandsGOOGLE(pool, queue, commandBuffer, dataSize, pData, context);
+}
+
+void VkDecoderGlobalState::on_vkQueueFlushCommandsFromAuxMemoryGOOGLE(
+ android::base::BumpPool* pool, VkQueue queue, VkCommandBuffer commandBuffer,
+ VkDeviceMemory deviceMemory, VkDeviceSize dataOffset, VkDeviceSize dataSize,
+ const VkDecoderContext& context) {
+ mImpl->on_vkQueueFlushCommandsFromAuxMemoryGOOGLE(pool, queue, commandBuffer, deviceMemory,
+ dataOffset, dataSize, context);
+}
+
+void VkDecoderGlobalState::on_vkQueueCommitDescriptorSetUpdatesGOOGLE(
+ android::base::BumpPool* pool, VkQueue queue, uint32_t descriptorPoolCount,
+ const VkDescriptorPool* pDescriptorPools, uint32_t descriptorSetCount,
+ const VkDescriptorSetLayout* pDescriptorSetLayouts, const uint64_t* pDescriptorSetPoolIds,
+ const uint32_t* pDescriptorSetWhichPool, const uint32_t* pDescriptorSetPendingAllocation,
+ const uint32_t* pDescriptorWriteStartingIndices, uint32_t pendingDescriptorWriteCount,
+ const VkWriteDescriptorSet* pPendingDescriptorWrites) {
+ mImpl->on_vkQueueCommitDescriptorSetUpdatesGOOGLE(
+ pool, queue, descriptorPoolCount, pDescriptorPools, descriptorSetCount,
+ pDescriptorSetLayouts, pDescriptorSetPoolIds, pDescriptorSetWhichPool,
+ pDescriptorSetPendingAllocation, pDescriptorWriteStartingIndices,
+ pendingDescriptorWriteCount, pPendingDescriptorWrites);
+}
+
+void VkDecoderGlobalState::on_vkCollectDescriptorPoolIdsGOOGLE(android::base::BumpPool* pool,
+ VkDevice device,
+ VkDescriptorPool descriptorPool,
+ uint32_t* pPoolIdCount,
+ uint64_t* pPoolIds) {
+ mImpl->on_vkCollectDescriptorPoolIdsGOOGLE(pool, device, descriptorPool, pPoolIdCount,
+ pPoolIds);
+}
+
+VkResult VkDecoderGlobalState::on_vkQueueBindSparse(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t bindInfoCount,
+ const VkBindSparseInfo* pBindInfo,
+ VkFence fence) {
+ return mImpl->on_vkQueueBindSparse(pool, queue, bindInfoCount, pBindInfo, fence);
+}
+
+void VkDecoderGlobalState::on_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(
+ android::base::BumpPool* pool, VkQueue queue, uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores, VkImage image) {
+ int fenceFd;
+ mImpl->on_vkQueueSignalReleaseImageANDROID(pool, queue, waitSemaphoreCount, pWaitSemaphores,
+ image, &fenceFd);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateSamplerYcbcrConversion(
+ android::base::BumpPool* pool, VkDevice device,
+ const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+ VkSamplerYcbcrConversion* pYcbcrConversion) {
+ return mImpl->on_vkCreateSamplerYcbcrConversion(pool, device, pCreateInfo, pAllocator,
+ pYcbcrConversion);
+}
+
+VkResult VkDecoderGlobalState::on_vkCreateSamplerYcbcrConversionKHR(
+ android::base::BumpPool* pool, VkDevice device,
+ const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator,
+ VkSamplerYcbcrConversion* pYcbcrConversion) {
+ return mImpl->on_vkCreateSamplerYcbcrConversion(pool, device, pCreateInfo, pAllocator,
+ pYcbcrConversion);
+}
+
+void VkDecoderGlobalState::on_vkDestroySamplerYcbcrConversion(
+ android::base::BumpPool* pool, VkDevice device, VkSamplerYcbcrConversion ycbcrConversion,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroySamplerYcbcrConversion(pool, device, ycbcrConversion, pAllocator);
+}
+
+void VkDecoderGlobalState::on_vkDestroySamplerYcbcrConversionKHR(
+ android::base::BumpPool* pool, VkDevice device, VkSamplerYcbcrConversion ycbcrConversion,
+ const VkAllocationCallbacks* pAllocator) {
+ mImpl->on_vkDestroySamplerYcbcrConversion(pool, device, ycbcrConversion, pAllocator);
+}
+
+void VkDecoderGlobalState::on_DeviceLost() { mImpl->on_DeviceLost(); }
+
+void VkDecoderGlobalState::DeviceLostHandler() { mImpl->DeviceLostHandler(); }
+
+void VkDecoderGlobalState::on_CheckOutOfMemory(VkResult result, uint32_t opCode,
+ const VkDecoderContext& context,
+ std::optional<uint64_t> allocationSize) {
+ mImpl->on_CheckOutOfMemory(result, opCode, context, allocationSize);
+}
+
+VkResult VkDecoderGlobalState::waitForFence(VkFence boxed_fence, uint64_t timeout) {
+ return mImpl->waitForFence(boxed_fence, timeout);
+}
+
+VkResult VkDecoderGlobalState::getFenceStatus(VkFence boxed_fence) {
+ return mImpl->getFenceStatus(boxed_fence);
+}
+
+AsyncResult VkDecoderGlobalState::registerQsriCallback(VkImage image,
+ VkQsriTimeline::Callback callback) {
+ return mImpl->registerQsriCallback(image, std::move(callback));
+}
+
+void VkDecoderGlobalState::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) {
+ // Not used currently
+ (void)memory;
+ (void)memoryCount;
+ (void)offset;
+ (void)offsetCount;
+ (void)size;
+ (void)sizeCount;
+ (void)typeIndex;
+ (void)typeIndexCount;
+ (void)typeBits;
+ (void)typeBitsCount;
+}
+
+void VkDecoderGlobalState::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) {
+ // Not used currently
+ (void)memory;
+ (void)memoryCount;
+ (void)offset;
+ (void)offsetCount;
+ (void)size;
+ (void)sizeCount;
+ (void)typeIndex;
+ (void)typeIndexCount;
+ (void)typeBits;
+ (void)typeBitsCount;
+}
+
+VkDecoderSnapshot* VkDecoderGlobalState::snapshot() { return mImpl->snapshot(); }
+
+#define DEFINE_TRANSFORMED_TYPE_IMPL(type) \
+ void VkDecoderGlobalState::transformImpl_##type##_tohost(const type* val, uint32_t count) { \
+ mImpl->transformImpl_##type##_tohost(val, count); \
+ } \
+ void VkDecoderGlobalState::transformImpl_##type##_fromhost(const type* val, uint32_t count) { \
+ mImpl->transformImpl_##type##_fromhost(val, count); \
+ }
+
+LIST_TRANSFORMED_TYPES(DEFINE_TRANSFORMED_TYPE_IMPL)
+
+#define DEFINE_BOXED_DISPATCHABLE_HANDLE_API_DEF(type) \
+ type VkDecoderGlobalState::new_boxed_##type(type underlying, VulkanDispatch* dispatch, \
+ bool ownDispatch) { \
+ return mImpl->new_boxed_##type(underlying, dispatch, ownDispatch); \
+ } \
+ void VkDecoderGlobalState::delete_##type(type boxed) { mImpl->delete_##type(boxed); } \
+ type VkDecoderGlobalState::unbox_##type(type boxed) { return mImpl->unbox_##type(boxed); } \
+ type VkDecoderGlobalState::unboxed_to_boxed_##type(type unboxed) { \
+ return mImpl->unboxed_to_boxed_##type(unboxed); \
+ } \
+ VulkanDispatch* VkDecoderGlobalState::dispatch_##type(type boxed) { \
+ return mImpl->dispatch_##type(boxed); \
+ }
+
+#define DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_API_DEF(type) \
+ type VkDecoderGlobalState::new_boxed_non_dispatchable_##type(type underlying) { \
+ return mImpl->new_boxed_non_dispatchable_##type(underlying); \
+ } \
+ void VkDecoderGlobalState::delete_##type(type boxed) { mImpl->delete_##type(boxed); } \
+ type VkDecoderGlobalState::unbox_##type(type boxed) { return mImpl->unbox_##type(boxed); } \
+ type VkDecoderGlobalState::unboxed_to_boxed_non_dispatchable_##type(type unboxed) { \
+ return mImpl->unboxed_to_boxed_non_dispatchable_##type(unboxed); \
+ }
+
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_DISPATCHABLE_HANDLE_API_DEF)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_API_DEF)
+
+#define DEFINE_BOXED_DISPATCHABLE_HANDLE_GLOBAL_API_DEF(type) \
+ type unbox_##type(type boxed) { \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) return VK_NULL_HANDLE; \
+ return (type)elt->underlying; \
+ } \
+ VulkanDispatch* dispatch_##type(type boxed) { \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) { \
+ fprintf(stderr, "%s: err not found boxed %p\n", __func__, boxed); \
+ return nullptr; \
+ } \
+ return elt->dispatch; \
+ } \
+ void delete_##type(type boxed) { \
+ if (!boxed) return; \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) return; \
+ releaseOrderMaintInfo(elt->ordMaintInfo); \
+ if (elt->readStream) { \
+ sReadStreamRegistry.push(elt->readStream); \
+ elt->readStream = nullptr; \
+ } \
+ sBoxedHandleManager.remove((uint64_t)boxed); \
+ } \
+ type unboxed_to_boxed_##type(type unboxed) { \
+ AutoLock lock(sBoxedHandleManager.lock); \
+ return (type)sBoxedHandleManager.getBoxedFromUnboxedLocked((uint64_t)(uintptr_t)unboxed); \
+ }
+
+#define DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_GLOBAL_API_DEF(type) \
+ type new_boxed_non_dispatchable_##type(type underlying) { \
+ return VkDecoderGlobalState::get()->new_boxed_non_dispatchable_##type(underlying); \
+ } \
+ void delete_##type(type boxed) { \
+ if (!boxed) return; \
+ sBoxedHandleManager.remove((uint64_t)boxed); \
+ } \
+ void delayed_delete_##type(type boxed, VkDevice device, std::function<void()> callback) { \
+ sBoxedHandleManager.removeDelayed((uint64_t)boxed, device, callback); \
+ } \
+ type unbox_##type(type boxed) { \
+ if (!boxed) return boxed; \
+ auto elt = sBoxedHandleManager.get((uint64_t)(uintptr_t)boxed); \
+ if (!elt) { \
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) \
+ << "Unbox " << boxed << " failed, not found."; \
+ return VK_NULL_HANDLE; \
+ } \
+ return (type)elt->underlying; \
+ } \
+ type unboxed_to_boxed_non_dispatchable_##type(type unboxed) { \
+ AutoLock lock(sBoxedHandleManager.lock); \
+ return (type)sBoxedHandleManager.getBoxedFromUnboxedLocked((uint64_t)(uintptr_t)unboxed); \
+ }
+
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_DISPATCHABLE_HANDLE_GLOBAL_API_DEF)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_GLOBAL_API_DEF)
+
+void BoxedHandleUnwrapAndDeletePreserveBoxedMapping::setup(android::base::BumpPool* pool,
+ uint64_t** bufPtr) {
+ mPool = pool;
+ mPreserveBufPtr = bufPtr;
+}
+
+void BoxedHandleUnwrapAndDeletePreserveBoxedMapping::allocPreserve(size_t count) {
+ *mPreserveBufPtr = (uint64_t*)mPool->alloc(count * sizeof(uint64_t));
+}
+
+#define BOXED_DISPATCHABLE_HANDLE_UNWRAP_AND_DELETE_PRESERVE_BOXED_IMPL(type_name) \
+ void BoxedHandleUnwrapAndDeletePreserveBoxedMapping::mapHandles_##type_name( \
+ type_name* handles, size_t count) { \
+ allocPreserve(count); \
+ for (size_t i = 0; i < count; ++i) { \
+ (*mPreserveBufPtr)[i] = (uint64_t)(handles[i]); \
+ if (handles[i]) { \
+ handles[i] = VkDecoderGlobalState::get()->unbox_##type_name(handles[i]); \
+ } else { \
+ handles[i] = (type_name) nullptr; \
+ }; \
+ } \
+ } \
+ void BoxedHandleUnwrapAndDeletePreserveBoxedMapping::mapHandles_##type_name##_u64( \
+ const type_name* handles, uint64_t* handle_u64s, size_t count) { \
+ allocPreserve(count); \
+ for (size_t i = 0; i < count; ++i) { \
+ (*mPreserveBufPtr)[i] = (uint64_t)(handle_u64s[i]); \
+ if (handles[i]) { \
+ handle_u64s[i] = \
+ (uint64_t)VkDecoderGlobalState::get()->unbox_##type_name(handles[i]); \
+ } else { \
+ handle_u64s[i] = 0; \
+ } \
+ } \
+ } \
+ void BoxedHandleUnwrapAndDeletePreserveBoxedMapping::mapHandles_u64_##type_name( \
+ const uint64_t* handle_u64s, type_name* handles, size_t count) { \
+ allocPreserve(count); \
+ for (size_t i = 0; i < count; ++i) { \
+ (*mPreserveBufPtr)[i] = (uint64_t)(handle_u64s[i]); \
+ if (handle_u64s[i]) { \
+ handles[i] = VkDecoderGlobalState::get()->unbox_##type_name( \
+ (type_name)(uintptr_t)handle_u64s[i]); \
+ } else { \
+ handles[i] = (type_name) nullptr; \
+ } \
+ } \
+ }
+
+#define BOXED_NON_DISPATCHABLE_HANDLE_UNWRAP_AND_DELETE_PRESERVE_BOXED_IMPL(type_name) \
+ void BoxedHandleUnwrapAndDeletePreserveBoxedMapping::mapHandles_##type_name( \
+ type_name* handles, size_t count) { \
+ allocPreserve(count); \
+ for (size_t i = 0; i < count; ++i) { \
+ (*mPreserveBufPtr)[i] = (uint64_t)(handles[i]); \
+ if (handles[i]) { \
+ auto boxed = handles[i]; \
+ handles[i] = VkDecoderGlobalState::get()->unbox_##type_name(handles[i]); \
+ delete_##type_name(boxed); \
+ } else { \
+ handles[i] = (type_name) nullptr; \
+ }; \
+ } \
+ } \
+ void BoxedHandleUnwrapAndDeletePreserveBoxedMapping::mapHandles_##type_name##_u64( \
+ const type_name* handles, uint64_t* handle_u64s, size_t count) { \
+ allocPreserve(count); \
+ for (size_t i = 0; i < count; ++i) { \
+ (*mPreserveBufPtr)[i] = (uint64_t)(handle_u64s[i]); \
+ if (handles[i]) { \
+ auto boxed = handles[i]; \
+ handle_u64s[i] = \
+ (uint64_t)VkDecoderGlobalState::get()->unbox_##type_name(handles[i]); \
+ delete_##type_name(boxed); \
+ } else { \
+ handle_u64s[i] = 0; \
+ } \
+ } \
+ } \
+ void BoxedHandleUnwrapAndDeletePreserveBoxedMapping::mapHandles_u64_##type_name( \
+ const uint64_t* handle_u64s, type_name* handles, size_t count) { \
+ allocPreserve(count); \
+ for (size_t i = 0; i < count; ++i) { \
+ (*mPreserveBufPtr)[i] = (uint64_t)(handle_u64s[i]); \
+ if (handle_u64s[i]) { \
+ auto boxed = (type_name)(uintptr_t)handle_u64s[i]; \
+ handles[i] = VkDecoderGlobalState::get()->unbox_##type_name( \
+ (type_name)(uintptr_t)handle_u64s[i]); \
+ delete_##type_name(boxed); \
+ } else { \
+ handles[i] = (type_name) nullptr; \
+ } \
+ } \
+ }
+
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(
+ BOXED_DISPATCHABLE_HANDLE_UNWRAP_AND_DELETE_PRESERVE_BOXED_IMPL)
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(
+ BOXED_NON_DISPATCHABLE_HANDLE_UNWRAP_AND_DELETE_PRESERVE_BOXED_IMPL)
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkDecoderGlobalState.h b/src/gfxstream/host/vulkan/VkDecoderGlobalState.h
new file mode 100644
index 00000000000..4b2d0dc43d3
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkDecoderGlobalState.h
@@ -0,0 +1,995 @@
+// 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.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+#include <memory>
+#include <optional>
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+#include "VkDecoderContext.h"
+#include "VkQsriTimeline.h"
+#include "VulkanDispatch.h"
+#include "VulkanHandleMapping.h"
+#include "aemu/base/AsyncResult.h"
+#include "aemu/base/HealthMonitor.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "goldfish_vk_private_defs.h"
+#include "cereal/common/goldfish_vk_transform.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "utils/GfxApiLogger.h"
+#include "vk_util.h"
+
+using android::base::AutoLock;
+using android::base::Lock;
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+using emugl::HealthMonitor;
+
+class VkDecoderSnapshot;
+
+namespace android {
+namespace base {
+class BumpPool;
+class Stream;
+} // namespace base
+} // namespace android
+
+namespace gfxstream {
+namespace vk {
+
+// Class for tracking host-side state. Currently we only care about
+// tracking VkDeviceMemory to make it easier to pass the right data
+// from mapped pointers to the guest, but this could get more stuff
+// added to it if for instance, we want to only expose a certain set
+// of physical device capabilities, or do snapshots.
+
+// This class may be autogenerated in the future.
+// Currently, it works by interfacing with VkDecoder calling on_<apicall>
+// functions.
+class VkDecoderGlobalState {
+ public:
+ VkDecoderGlobalState();
+ ~VkDecoderGlobalState();
+
+ // There should only be one instance of VkDecoderGlobalState per process
+ // Note: currently not thread-safe
+ static VkDecoderGlobalState* get();
+
+ // For testing only - destroys the global instance of VkDecoderGlobalState.
+ static void reset();
+
+ // Snapshot save/load
+ bool snapshotsEnabled() const;
+
+ // Whether to clean up VK instance.
+ // bug 149997534
+ bool vkCleanupEnabled() const;
+
+ void save(android::base::Stream* stream);
+ void load(android::base::Stream* stream, emugl::GfxApiLogger& gfxLogger,
+ emugl::HealthMonitor<>* healthMonitor);
+
+ // Lock/unlock of global state to serve as a global lock
+ void lock();
+ void unlock();
+
+ // Sets the current created handles for snapshot load
+ // which will override the effect of any new_boxed_*** calls.
+ // They are consumed in sequence.
+ // Returns number of bytes of |buffer|
+ // that have been consumed for this purpose.
+ size_t setCreatedHandlesForSnapshotLoad(const unsigned char* buffer);
+ void clearCreatedHandlesForSnapshotLoad();
+
+ VkResult on_vkEnumerateInstanceVersion(android::base::BumpPool* pool, uint32_t* pApiVersion);
+
+ // Fast way to get dispatch tables associated with a Vulkan object.
+ // VkInstance
+ // VkPhysicalDevice
+ // VkDevice
+ // VkQueue
+ // VkCommandBuffer
+
+ VkResult on_vkCreateInstance(android::base::BumpPool* pool,
+ const VkInstanceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkInstance* pInstance);
+
+ void on_vkDestroyInstance(android::base::BumpPool* pool, VkInstance instance,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkEnumeratePhysicalDevices(android::base::BumpPool* pool, VkInstance instance,
+ uint32_t* physicalDeviceCount,
+ VkPhysicalDevice* physicalDevices);
+
+ // Override features
+ void on_vkGetPhysicalDeviceFeatures(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures* pFeatures);
+ void on_vkGetPhysicalDeviceFeatures2(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures2* pFeatures);
+ void on_vkGetPhysicalDeviceFeatures2KHR(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceFeatures2* pFeatures);
+
+ // Override image format properties
+ VkResult on_vkGetPhysicalDeviceImageFormatProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice, VkFormat format,
+ VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
+ VkImageFormatProperties* pImageFormatProperties);
+ VkResult on_vkGetPhysicalDeviceImageFormatProperties2(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+ VkImageFormatProperties2* pImageFormatProperties);
+ VkResult on_vkGetPhysicalDeviceImageFormatProperties2KHR(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
+ VkImageFormatProperties2* pImageFormatProperties);
+
+ // Override format features
+ void on_vkGetPhysicalDeviceFormatProperties(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties* pFormatProperties);
+ void on_vkGetPhysicalDeviceFormatProperties2(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties2* pFormatProperties);
+ void on_vkGetPhysicalDeviceFormatProperties2KHR(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ VkFormat format,
+ VkFormatProperties2* pFormatProperties);
+
+ // Override API version
+ void on_vkGetPhysicalDeviceProperties(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceProperties* pProperties);
+ void on_vkGetPhysicalDeviceProperties2(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceProperties2* pProperties);
+ void on_vkGetPhysicalDeviceProperties2KHR(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceProperties2* pProperties);
+
+ // Override memory types advertised from host
+ //
+ void on_vkGetPhysicalDeviceMemoryProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceMemoryProperties* pMemoryProperties);
+ void on_vkGetPhysicalDeviceMemoryProperties2(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceMemoryProperties2* pMemoryProperties);
+ void on_vkGetPhysicalDeviceMemoryProperties2KHR(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceMemoryProperties2* pMemoryProperties);
+
+ // Override supported device extension lists
+ VkResult on_vkEnumerateDeviceExtensionProperties(android::base::BumpPool* pool,
+ VkPhysicalDevice physicalDevice,
+ const char* pLayerName,
+ uint32_t* pPropertyCount,
+ VkExtensionProperties* pProperties);
+
+ VkResult on_vkCreateDevice(android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ const VkDeviceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkDevice* pDevice);
+
+ void on_vkGetDeviceQueue(android::base::BumpPool* pool, VkDevice device,
+ uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue);
+
+ void on_vkGetDeviceQueue2(android::base::BumpPool* pool, VkDevice device,
+ const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue);
+
+ void on_vkDestroyDevice(android::base::BumpPool* pool, VkDevice device,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkCreateBuffer(android::base::BumpPool* pool, VkDevice device,
+ const VkBufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer);
+
+ void on_vkDestroyBuffer(android::base::BumpPool* pool, VkDevice device, VkBuffer buffer,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkBindBufferMemory(android::base::BumpPool* pool, VkDevice device, VkBuffer buffer,
+ VkDeviceMemory memory, VkDeviceSize memoryOffset);
+ VkResult on_vkBindBufferMemory2(android::base::BumpPool* pool, VkDevice device,
+ uint32_t bindInfoCount,
+ const VkBindBufferMemoryInfo* pBindInfos);
+ VkResult on_vkBindBufferMemory2KHR(android::base::BumpPool* pool, VkDevice device,
+ uint32_t bindInfoCount,
+ const VkBindBufferMemoryInfo* pBindInfos);
+
+ VkResult on_vkCreateImage(android::base::BumpPool* pool, VkDevice device,
+ const VkImageCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkImage* pImage);
+
+ void on_vkDestroyImage(android::base::BumpPool* pool, VkDevice device, VkImage image,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkBindImageMemory(android::base::BumpPool* pool, VkDevice device, VkImage image,
+ VkDeviceMemory memory, VkDeviceSize memoryOffset);
+ VkResult on_vkBindImageMemory2(android::base::BumpPool* pool, VkDevice device,
+ uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos);
+ VkResult on_vkBindImageMemory2KHR(android::base::BumpPool* pool, VkDevice device,
+ uint32_t bindInfoCount,
+ const VkBindImageMemoryInfo* pBindInfos);
+
+ VkResult on_vkCreateImageView(android::base::BumpPool* pool, VkDevice device,
+ const VkImageViewCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkImageView* pView);
+
+ void on_vkDestroyImageView(android::base::BumpPool* pool, VkDevice device,
+ VkImageView imageView, const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkCreateSampler(android::base::BumpPool* pool, VkDevice device,
+ const VkSamplerCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkSampler* pSampler);
+
+ void on_vkDestroySampler(android::base::BumpPool* pool, VkDevice device, VkSampler sampler,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkCreateDescriptorSetLayout(android::base::BumpPool* pool, VkDevice device,
+ const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorSetLayout* pSetLayout);
+
+ void on_vkDestroyDescriptorSetLayout(android::base::BumpPool* pool, VkDevice device,
+ VkDescriptorSetLayout descriptorSetLayout,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkCreateDescriptorPool(android::base::BumpPool* pool, VkDevice device,
+ const VkDescriptorPoolCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorPool* pDescriptorPool);
+
+ void on_vkDestroyDescriptorPool(android::base::BumpPool* pool, VkDevice device,
+ VkDescriptorPool descriptorPool,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkResetDescriptorPool(android::base::BumpPool* pool, VkDevice device,
+ VkDescriptorPool descriptorPool,
+ VkDescriptorPoolResetFlags flags);
+
+ VkResult on_vkAllocateDescriptorSets(android::base::BumpPool* pool, VkDevice device,
+ const VkDescriptorSetAllocateInfo* pAllocateInfo,
+ VkDescriptorSet* pDescriptorSets);
+
+ VkResult on_vkFreeDescriptorSets(android::base::BumpPool* pool, VkDevice device,
+ VkDescriptorPool descriptorPool, uint32_t descriptorSetCount,
+ const VkDescriptorSet* pDescriptorSets);
+
+ void on_vkUpdateDescriptorSets(android::base::BumpPool* pool, VkDevice device,
+ uint32_t descriptorWriteCount,
+ const VkWriteDescriptorSet* pDescriptorWrites,
+ uint32_t descriptorCopyCount,
+ const VkCopyDescriptorSet* pDescriptorCopies);
+
+ VkResult on_vkCreateShaderModule(android::base::BumpPool* pool, VkDevice device,
+ const VkShaderModuleCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkShaderModule* pShaderModule);
+
+ void on_vkDestroyShaderModule(android::base::BumpPool* pool, VkDevice device,
+ VkShaderModule shaderModule,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkCreatePipelineCache(android::base::BumpPool* pool, VkDevice device,
+ const VkPipelineCacheCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkPipelineCache* pPipelineCache);
+
+ void on_vkDestroyPipelineCache(android::base::BumpPool* pool, VkDevice device,
+ VkPipelineCache pipelineCache,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkCreateGraphicsPipelines(android::base::BumpPool* pool, VkDevice device,
+ VkPipelineCache pipelineCache, uint32_t createInfoCount,
+ const VkGraphicsPipelineCreateInfo* pCreateInfos,
+ const VkAllocationCallbacks* pAllocator,
+ VkPipeline* pPipelines);
+
+ void on_vkDestroyPipeline(android::base::BumpPool* pool, VkDevice device, VkPipeline pipeline,
+ const VkAllocationCallbacks* pAllocator);
+
+ void on_vkCmdCopyBufferToImage(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ VkBuffer srcBuffer, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkBufferImageCopy* pRegions,
+ const VkDecoderContext& context);
+
+ void on_vkCmdCopyImage(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkImageCopy* pRegions);
+ void on_vkCmdCopyImageToBuffer(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ VkImage srcImage, VkImageLayout srcImageLayout,
+ VkBuffer dstBuffer, uint32_t regionCount,
+ const VkBufferImageCopy* pRegions);
+
+ void on_vkCmdCopyBufferToImage2(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo,
+ const VkDecoderContext& context);
+
+ void on_vkCmdCopyImage2(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageInfo2* pCopyImageInfo);
+ void on_vkCmdCopyImageToBuffer2(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo);
+
+ void on_vkCmdCopyBufferToImage2KHR(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo,
+ const VkDecoderContext& context);
+
+ void on_vkCmdCopyImage2KHR(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageInfo2KHR* pCopyImageInfo);
+ void on_vkCmdCopyImageToBuffer2KHR(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo);
+
+ void on_vkGetImageMemoryRequirements(android::base::BumpPool* pool, VkDevice device,
+ VkImage image, VkMemoryRequirements* pMemoryRequirements);
+
+ void on_vkGetImageMemoryRequirements2(android::base::BumpPool* pool, VkDevice device,
+ const VkImageMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements);
+
+ void on_vkGetImageMemoryRequirements2KHR(android::base::BumpPool* pool, VkDevice device,
+ const VkImageMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements);
+
+ void on_vkGetBufferMemoryRequirements(android::base::BumpPool* pool, VkDevice device,
+ VkBuffer buffer,
+ VkMemoryRequirements* pMemoryRequirements);
+
+ void on_vkGetBufferMemoryRequirements2(android::base::BumpPool* pool, VkDevice device,
+ const VkBufferMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements);
+
+ void on_vkGetBufferMemoryRequirements2KHR(android::base::BumpPool* pool, VkDevice device,
+ const VkBufferMemoryRequirementsInfo2* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements);
+
+ void on_vkCmdPipelineBarrier(android::base::BumpPool* pool, 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);
+
+ // Do we need to wrap vk(Create|Destroy)Instance to
+ // update our maps of VkDevices? Spec suggests no:
+ // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkDestroyInstance.html
+ // Valid Usage
+ // All child objects created using instance
+ // must have been destroyed prior to destroying instance
+ //
+ // This suggests that we should emulate the invalid behavior by
+ // not destroying our own VkDevice maps on instance destruction.
+
+ VkResult on_vkAllocateMemory(android::base::BumpPool* pool, VkDevice device,
+ const VkMemoryAllocateInfo* pAllocateInfo,
+ const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory);
+
+ void on_vkFreeMemory(android::base::BumpPool* pool, VkDevice device, VkDeviceMemory memory,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkMapMemory(android::base::BumpPool* pool, VkDevice device, VkDeviceMemory memory,
+ VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags,
+ void** ppData);
+
+ void on_vkUnmapMemory(android::base::BumpPool* pool, VkDevice device, VkDeviceMemory memory);
+
+ uint8_t* getMappedHostPointer(VkDeviceMemory memory);
+ VkDeviceSize getDeviceMemorySize(VkDeviceMemory memory);
+ bool usingDirectMapping() const;
+
+ struct HostFeatureSupport {
+ bool supportsVulkan = false;
+ bool supportsVulkan1_1 = false;
+ bool useDeferredCommands = false;
+ bool useCreateResourcesWithRequirements = false;
+ uint32_t apiVersion = 0;
+ uint32_t driverVersion = 0;
+ uint32_t deviceID = 0;
+ uint32_t vendorID = 0;
+ };
+
+ HostFeatureSupport getHostFeatureSupport() const;
+
+ // VK_ANDROID_native_buffer
+ VkResult on_vkGetSwapchainGrallocUsageANDROID(android::base::BumpPool* pool, VkDevice device,
+ VkFormat format, VkImageUsageFlags imageUsage,
+ int* grallocUsage);
+ VkResult on_vkGetSwapchainGrallocUsage2ANDROID(
+ android::base::BumpPool* pool, VkDevice device, VkFormat format,
+ VkImageUsageFlags imageUsage, VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
+ uint64_t* grallocConsumerUsage, uint64_t* grallocProducerUsage);
+ VkResult on_vkAcquireImageANDROID(android::base::BumpPool* pool, VkDevice device, VkImage image,
+ int nativeFenceFd, VkSemaphore semaphore, VkFence fence);
+ VkResult on_vkQueueSignalReleaseImageANDROID(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores, VkImage image,
+ int* pNativeFenceFd);
+
+ // VK_GOOGLE_gfxstream
+ VkResult on_vkMapMemoryIntoAddressSpaceGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ VkDeviceMemory memory, uint64_t* pAddress);
+ VkResult on_vkGetMemoryHostAddressInfoGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ VkDeviceMemory memory, uint64_t* pAddress,
+ uint64_t* pSize, uint64_t* pHostmemId);
+ VkResult on_vkGetBlobGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ VkDeviceMemory memory);
+
+ VkResult on_vkFreeMemorySyncGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ VkDeviceMemory memory,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkAllocateCommandBuffers(android::base::BumpPool* pool, VkDevice device,
+ const VkCommandBufferAllocateInfo* pAllocateInfo,
+ VkCommandBuffer* pCommandBuffers);
+
+ void on_vkCmdExecuteCommands(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ uint32_t commandBufferCount,
+ const VkCommandBuffer* pCommandBuffers);
+
+ VkResult on_vkQueueSubmit(android::base::BumpPool* pool, VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfo* pSubmits, VkFence fence);
+
+ VkResult on_vkQueueSubmit2(android::base::BumpPool* pool, VkQueue queue, uint32_t submitCount,
+ const VkSubmitInfo2* pSubmits, VkFence fence);
+
+ VkResult on_vkQueueWaitIdle(android::base::BumpPool* pool, VkQueue queue);
+
+ VkResult on_vkResetCommandBuffer(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ VkCommandBufferResetFlags flags);
+
+ void on_vkFreeCommandBuffers(android::base::BumpPool* pool, VkDevice device,
+ VkCommandPool commandPool, uint32_t commandBufferCount,
+ const VkCommandBuffer* pCommandBuffers);
+
+ VkResult on_vkCreateCommandPool(android::base::BumpPool* pool, VkDevice device,
+ const VkCommandPoolCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkCommandPool* pCommandPool);
+
+ void on_vkDestroyCommandPool(android::base::BumpPool* pool, VkDevice device,
+ VkCommandPool commandPool,
+ const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkResetCommandPool(android::base::BumpPool* pool, VkDevice device,
+ VkCommandPool commandPool, VkCommandPoolResetFlags flags);
+
+ void on_vkGetPhysicalDeviceExternalSemaphoreProperties(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+ VkExternalSemaphoreProperties* pExternalSemaphoreProperties);
+
+ void on_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(
+ android::base::BumpPool* pool, VkPhysicalDevice physicalDevice,
+ const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
+ VkExternalSemaphoreProperties* pExternalSemaphoreProperties);
+
+ VkResult on_vkCreateSemaphore(android::base::BumpPool* pool, VkDevice device,
+ const VkSemaphoreCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore);
+ VkResult on_vkImportSemaphoreFdKHR(android::base::BumpPool* pool, VkDevice device,
+ const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo);
+ VkResult on_vkGetSemaphoreFdKHR(android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd);
+ void on_vkDestroySemaphore(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator);
+
+ VkResult on_vkCreateFence(android::base::BumpPool* pool, VkDevice device,
+ const VkFenceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkFence* pFence);
+ VkResult on_vkResetFences(android::base::BumpPool* pool, VkDevice device, uint32_t fenceCount,
+ const VkFence* pFences);
+ void on_vkDestroyFence(android::base::BumpPool* pool, VkDevice device, VkFence fence,
+ const VkAllocationCallbacks* pAllocator);
+
+ // Descriptor update templates
+ VkResult on_vkCreateDescriptorUpdateTemplate(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate);
+
+ VkResult on_vkCreateDescriptorUpdateTemplateKHR(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate);
+
+ void on_vkDestroyDescriptorUpdateTemplate(android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+ const VkAllocationCallbacks* pAllocator);
+
+ void on_vkDestroyDescriptorUpdateTemplateKHR(
+ android::base::BumpPool* pool, VkDevice boxed_device,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+ const VkAllocationCallbacks* pAllocator);
+
+ void on_vkUpdateDescriptorSetWithTemplateSizedGOOGLE(
+ android::base::BumpPool* pool, VkDevice boxed_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);
+
+ void on_vkUpdateDescriptorSetWithTemplateSized2GOOGLE(
+ android::base::BumpPool* pool, VkDevice boxed_device, VkDescriptorSet descriptorSet,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount,
+ uint32_t bufferInfoCount, uint32_t bufferViewCount, uint32_t inlineUniformBlockCount,
+ const uint32_t* pImageInfoEntryIndices, const uint32_t* pBufferInfoEntryIndices,
+ const uint32_t* pBufferViewEntryIndices, const VkDescriptorImageInfo* pImageInfos,
+ const VkDescriptorBufferInfo* pBufferInfos, const VkBufferView* pBufferViews,
+ const uint8_t* pInlineUniformBlockData);
+
+ VkResult on_vkBeginCommandBuffer(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ const VkCommandBufferBeginInfo* pBeginInfo,
+ const VkDecoderContext& context);
+ void on_vkBeginCommandBufferAsyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkCommandBufferBeginInfo* pBeginInfo,
+ const VkDecoderContext& context);
+ VkResult on_vkEndCommandBuffer(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ const VkDecoderContext& context);
+ void on_vkEndCommandBufferAsyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ const VkDecoderContext& context);
+ void on_vkResetCommandBufferAsyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer,
+ VkCommandBufferResetFlags flags);
+ void on_vkCommandBufferHostSyncGOOGLE(android::base::BumpPool* pool,
+ VkCommandBuffer commandBuffer, uint32_t needHostSync,
+ uint32_t sequenceNumber);
+
+ VkResult on_vkCreateImageWithRequirementsGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ const VkImageCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkImage* pImage,
+ VkMemoryRequirements* pMemoryRequirements);
+ VkResult on_vkCreateBufferWithRequirementsGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ const VkBufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkBuffer* pBuffer,
+ VkMemoryRequirements* pMemoryRequirements);
+
+ void on_vkCmdBindPipeline(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
+
+ void on_vkCmdBindDescriptorSets(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
+ uint32_t firstSet, uint32_t descriptorSetCount,
+ const VkDescriptorSet* pDescriptorSets,
+ uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets);
+
+ VkResult on_vkCreateRenderPass(android::base::BumpPool* pool, VkDevice device,
+ const VkRenderPassCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkRenderPass* pRenderPass);
+ VkResult on_vkCreateRenderPass2(android::base::BumpPool* pool, VkDevice device,
+ const VkRenderPassCreateInfo2* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkRenderPass* pRenderPass);
+ VkResult on_vkCreateRenderPass2KHR(android::base::BumpPool* pool, VkDevice device,
+ const VkRenderPassCreateInfo2KHR* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkRenderPass* pRenderPass);
+ void on_vkDestroyRenderPass(android::base::BumpPool* pool, VkDevice device,
+ VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator);
+ VkResult on_vkCreateFramebuffer(android::base::BumpPool* pool, VkDevice device,
+ const VkFramebufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkFramebuffer* pFramebuffer);
+ void on_vkDestroyFramebuffer(android::base::BumpPool* pool, VkDevice device,
+ VkFramebuffer framebuffer,
+ const VkAllocationCallbacks* pAllocator);
+
+ void on_vkCmdCopyQueryPoolResults(android::base::BumpPool* pool, VkCommandBuffer commandBuffer,
+ VkQueryPool queryPool, uint32_t firstQuery,
+ uint32_t queryCount, VkBuffer dstBuffer,
+ VkDeviceSize dstOffset, VkDeviceSize stride,
+ VkQueryResultFlags flags);
+
+ // VK_GOOGLE_gfxstream
+ void on_vkQueueHostSyncGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t needHostSync, uint32_t sequenceNumber);
+ void on_vkQueueSubmitAsyncGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t submitCount, const VkSubmitInfo* pSubmits,
+ VkFence fence);
+ void on_vkQueueSubmitAsync2GOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t submitCount, const VkSubmitInfo2* pSubmits,
+ VkFence fence);
+ void on_vkQueueWaitIdleAsyncGOOGLE(android::base::BumpPool* pool, VkQueue queue);
+ void on_vkQueueBindSparseAsyncGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo,
+ VkFence fence);
+
+ // VK_GOOGLE_gfxstream
+ void on_vkGetLinearImageLayoutGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ VkFormat format, VkDeviceSize* pOffset,
+ VkDeviceSize* pRowPitchAlignment);
+ void on_vkGetLinearImageLayout2GOOGLE(android::base::BumpPool* pool, VkDevice device,
+ const VkImageCreateInfo* pCreateInfo,
+ VkDeviceSize* pOffset, VkDeviceSize* pRowPitchAlignment);
+
+ // VK_GOOGLE_gfxstream
+ void on_vkQueueFlushCommandsGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ VkCommandBuffer commandBuffer, VkDeviceSize dataSize,
+ const void* pData, const VkDecoderContext& context);
+ void on_vkQueueFlushCommandsFromAuxMemoryGOOGLE(android::base::BumpPool* pool, VkQueue queue,
+ VkCommandBuffer commandBuffer,
+ VkDeviceMemory deviceMemory,
+ VkDeviceSize dataOffset, VkDeviceSize dataSize,
+ const VkDecoderContext& context);
+ void on_vkQueueCommitDescriptorSetUpdatesGOOGLE(
+ android::base::BumpPool* pool, VkQueue queue, uint32_t descriptorPoolCount,
+ const VkDescriptorPool* pDescriptorPools, uint32_t descriptorSetCount,
+ const VkDescriptorSetLayout* pDescriptorSetLayouts, const uint64_t* pDescriptorSetPoolIds,
+ const uint32_t* pDescriptorSetWhichPool, const uint32_t* pDescriptorSetPendingAllocation,
+ const uint32_t* pDescriptorWriteStartingIndices, uint32_t pendingDescriptorWriteCount,
+ const VkWriteDescriptorSet* pPendingDescriptorWrites);
+ void on_vkCollectDescriptorPoolIdsGOOGLE(android::base::BumpPool* pool, VkDevice device,
+ VkDescriptorPool descriptorPool,
+ uint32_t* pPoolIdCount, uint64_t* pPoolIds);
+ VkResult on_vkQueueBindSparse(android::base::BumpPool* pool, VkQueue queue,
+ uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo,
+ VkFence fence);
+ void on_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(android::base::BumpPool* pool,
+ VkQueue queue, uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores,
+ VkImage image);
+
+ VkResult on_vkCreateSamplerYcbcrConversion(
+ android::base::BumpPool* pool, VkDevice device,
+ const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion);
+ VkResult on_vkCreateSamplerYcbcrConversionKHR(
+ android::base::BumpPool* pool, VkDevice device,
+ const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion);
+ void on_vkDestroySamplerYcbcrConversion(android::base::BumpPool* pool, VkDevice device,
+ VkSamplerYcbcrConversion ycbcrConversion,
+ const VkAllocationCallbacks* pAllocator);
+ void on_vkDestroySamplerYcbcrConversionKHR(android::base::BumpPool* pool, VkDevice device,
+ VkSamplerYcbcrConversion ycbcrConversion,
+ const VkAllocationCallbacks* pAllocator);
+
+ void on_DeviceLost();
+
+ void DeviceLostHandler();
+
+ void on_CheckOutOfMemory(VkResult result, uint32_t opCode, const VkDecoderContext& context,
+ std::optional<uint64_t> allocationSize = std::nullopt);
+
+ // Fence waits
+ VkResult waitForFence(VkFence boxed_fence, uint64_t timeout);
+
+ VkResult getFenceStatus(VkFence boxed_fence);
+
+ // Wait for present (vkQueueSignalReleaseImageANDROID). This explicitly
+ // requires the image to be presented again versus how many times it's been
+ // presented so far, so it ends up incrementing a "target present count"
+ // for this image, and then waiting for the image to get vkQSRI'ed at least
+ // that many times.
+ AsyncResult registerQsriCallback(VkImage boxed_image, VkQsriTimeline::Callback callback);
+
+ // Transformations
+ 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);
+
+ // Snapshot access
+ VkDecoderSnapshot* snapshot();
+
+#define DEFINE_TRANSFORMED_TYPE_PROTOTYPE(type) \
+ void transformImpl_##type##_tohost(const type*, uint32_t); \
+ void transformImpl_##type##_fromhost(const type*, uint32_t);
+
+ LIST_TRANSFORMED_TYPES(DEFINE_TRANSFORMED_TYPE_PROTOTYPE)
+
+ // boxed handles
+#define DEFINE_BOXED_DISPATCHABLE_HANDLE_API_DECL(type) \
+ type new_boxed_##type(type underlying, VulkanDispatch* dispatch, bool ownDispatch); \
+ void delete_##type(type boxed); \
+ type unbox_##type(type boxed); \
+ type unboxed_to_boxed_##type(type boxed); \
+ VulkanDispatch* dispatch_##type(type boxed);
+
+#define DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_API_DECL(type) \
+ type new_boxed_non_dispatchable_##type(type underlying); \
+ void delete_##type(type boxed); \
+ type unbox_##type(type boxed); \
+ type unboxed_to_boxed_non_dispatchable_##type(type boxed);
+
+ GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_DISPATCHABLE_HANDLE_API_DECL)
+ GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_API_DECL)
+
+ private:
+ class Impl;
+ std::unique_ptr<Impl> mImpl;
+};
+
+#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 BOXED_DISPATCHABLE_UNWRAP_IMPL(type_name) \
+ MAKE_HANDLE_MAPPING_FOREACH( \
+ type_name, if (handles[i]) { handles[i] = m_state->unbox_##type_name(handles[i]); } else { \
+ handles[i] = (type_name) nullptr; \
+ }; \
+ , \
+ if (handles[i]) { \
+ handle_u64s[i] = (uint64_t)m_state->unbox_##type_name(handles[i]); \
+ } else { handle_u64s[i] = 0; }, \
+ if (handle_u64s[i]) { \
+ handles[i] = m_state->unbox_##type_name((type_name)(uintptr_t)handle_u64s[i]); \
+ } else { handles[i] = (type_name) nullptr; })
+
+#define BOXED_NON_DISPATCHABLE_UNWRAP_IMPL(type_name) \
+ MAKE_HANDLE_MAPPING_FOREACH( \
+ type_name, if (handles[i]) { handles[i] = m_state->unbox_##type_name(handles[i]); } else { \
+ handles[i] = (type_name) nullptr; \
+ }; \
+ , \
+ if (handles[i]) { \
+ handle_u64s[i] = (uint64_t)m_state->unbox_##type_name(handles[i]); \
+ } else { handle_u64s[i] = 0; }, \
+ if (handle_u64s[i]) { \
+ handles[i] = m_state->unbox_##type_name((type_name)(uintptr_t)handle_u64s[i]); \
+ } else { handles[i] = (type_name) nullptr; })
+
+class BoxedHandleUnwrapMapping : public VulkanHandleMapping {
+ public:
+ BoxedHandleUnwrapMapping(VkDecoderGlobalState* state) : VulkanHandleMapping(state) {}
+ virtual ~BoxedHandleUnwrapMapping() {}
+ GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(BOXED_DISPATCHABLE_UNWRAP_IMPL)
+ GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(BOXED_NON_DISPATCHABLE_UNWRAP_IMPL)
+};
+
+#define BOXED_DISPATCHABLE_WRAP_IMPL(type_name) \
+ MAKE_HANDLE_MAPPING_FOREACH( \
+ type_name, \
+ if (handles[i]) { handles[i] = m_state->unboxed_to_boxed_##type_name(handles[i]); } else { \
+ handles[i] = (type_name) nullptr; \
+ }; \
+ , \
+ if (handles[i]) { \
+ handle_u64s[i] = (uint64_t)m_state->unboxed_to_boxed_##type_name(handles[i]); \
+ } else { handle_u64s[i] = 0; }, \
+ if (handle_u64s[i]) { \
+ handles[i] = \
+ m_state->unboxed_to_boxed_##type_name((type_name)(uintptr_t)handle_u64s[i]); \
+ } else { handles[i] = (type_name) nullptr; })
+
+#define BOXED_NON_DISPATCHABLE_WRAP_IMPL(type_name) \
+ MAKE_HANDLE_MAPPING_FOREACH( \
+ type_name, \
+ if (handles[i]) { \
+ handles[i] = m_state->unboxed_to_boxed_non_dispatchable_##type_name(handles[i]); \
+ } else { handles[i] = (type_name) nullptr; }; \
+ , \
+ if (handles[i]) { \
+ handle_u64s[i] = \
+ (uint64_t)m_state->unboxed_to_boxed_non_dispatchable_##type_name(handles[i]); \
+ } else { handle_u64s[i] = 0; }, \
+ if (handle_u64s[i]) { \
+ handles[i] = m_state->unboxed_to_boxed_non_dispatchable_##type_name( \
+ (type_name)(uintptr_t)handle_u64s[i]); \
+ } else { handles[i] = (type_name) nullptr; })
+
+class BoxedHandleWrapMapping : public VulkanHandleMapping {
+ public:
+ BoxedHandleWrapMapping(VkDecoderGlobalState* state) : VulkanHandleMapping(state) {}
+ virtual ~BoxedHandleWrapMapping() {}
+ GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(BOXED_DISPATCHABLE_WRAP_IMPL)
+ GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(BOXED_NON_DISPATCHABLE_WRAP_IMPL)
+};
+
+// Not used, so we do not define.
+#define BOXED_DISPATCHABLE_CREATE_IMPL(type_name) \
+ MAKE_HANDLE_MAPPING_FOREACH(type_name, (void)handles[i], (void)handle_u64s[i], \
+ (void)handles[i];)
+
+// Not used, so we do not define.
+#define BOXED_DISPATCHABLE_DESTROY_IMPL(type_name) \
+ MAKE_HANDLE_MAPPING_FOREACH(type_name, (void)handles[i], (void)handle_u64s[i], \
+ (void)handles[i];)
+
+// We only use the create/destroy mappings for non dispatchable handles.
+#define BOXED_NON_DISPATCHABLE_CREATE_IMPL(type_name) \
+ MAKE_HANDLE_MAPPING_FOREACH( \
+ type_name, handles[i] = new_boxed_non_dispatchable_##type_name(handles[i]); \
+ , handle_u64s[i] = (uint64_t)new_boxed_non_dispatchable_##type_name(handles[i]), \
+ handles[i] = (type_name)new_boxed_non_dispatchable_##type_name( \
+ (type_name)(uintptr_t)handle_u64s[i]);)
+
+#define BOXED_NON_DISPATCHABLE_DESTROY_IMPL(type_name) \
+ MAKE_HANDLE_MAPPING_FOREACH(type_name, delete_##type_name(handles[i]), (void)handle_u64s[i]; \
+ delete_##type_name(handles[i]), (void)handles[i]; \
+ delete_##type_name((type_name)handle_u64s[i]))
+
+#define BOXED_NON_DISPATCHABLE_UNWRAP_AND_DELETE_IMPL(type_name) \
+ MAKE_HANDLE_MAPPING_FOREACH( \
+ type_name, \
+ if (handles[i]) { \
+ auto boxed = handles[i]; \
+ handles[i] = m_state->unbox_##type_name(handles[i]); \
+ delete_##type_name(boxed); \
+ } else { handles[i] = (type_name) nullptr; }; \
+ , \
+ if (handles[i]) { \
+ auto boxed = handles[i]; \
+ handle_u64s[i] = (uint64_t)m_state->unbox_##type_name(handles[i]); \
+ delete_##type_name(boxed); \
+ } else { handle_u64s[i] = 0; }, \
+ if (handle_u64s[i]) { \
+ auto boxed = (type_name)(uintptr_t)handle_u64s[i]; \
+ handles[i] = m_state->unbox_##type_name((type_name)(uintptr_t)handle_u64s[i]); \
+ delete_##type_name(boxed); \
+ } else { handles[i] = (type_name) nullptr; })
+
+class BoxedHandleCreateMapping : public VulkanHandleMapping {
+ public:
+ BoxedHandleCreateMapping(VkDecoderGlobalState* state) : VulkanHandleMapping(state) {}
+ virtual ~BoxedHandleCreateMapping() {}
+ GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(BOXED_DISPATCHABLE_CREATE_IMPL)
+ GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(BOXED_NON_DISPATCHABLE_CREATE_IMPL)
+};
+
+class BoxedHandleDestroyMapping : public VulkanHandleMapping {
+ public:
+ BoxedHandleDestroyMapping(VkDecoderGlobalState* state) : VulkanHandleMapping(state) {}
+ virtual ~BoxedHandleDestroyMapping() {}
+ GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(BOXED_DISPATCHABLE_DESTROY_IMPL)
+ GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(BOXED_NON_DISPATCHABLE_DESTROY_IMPL)
+};
+
+class BoxedHandleUnwrapAndDeleteMapping : public VulkanHandleMapping {
+ public:
+ BoxedHandleUnwrapAndDeleteMapping(VkDecoderGlobalState* state) : VulkanHandleMapping(state) {}
+ virtual ~BoxedHandleUnwrapAndDeleteMapping() {}
+ GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(BOXED_DISPATCHABLE_DESTROY_IMPL)
+ GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(BOXED_NON_DISPATCHABLE_UNWRAP_AND_DELETE_IMPL)
+};
+
+#define HANDLE_MAPPING_DECLS(type_name) \
+ void mapHandles_##type_name(type_name* handles, size_t count) override; \
+ void mapHandles_##type_name##_u64(const type_name* handles, uint64_t* handle_u64s, \
+ size_t count) override; \
+ void mapHandles_u64_##type_name(const uint64_t* handle_u64s, type_name* handles, size_t count) \
+ override;
+
+class BoxedHandleUnwrapAndDeletePreserveBoxedMapping : public VulkanHandleMapping {
+ public:
+ BoxedHandleUnwrapAndDeletePreserveBoxedMapping(VkDecoderGlobalState* state)
+ : VulkanHandleMapping(state) {}
+ void setup(android::base::BumpPool* pool, uint64_t** bufPtr);
+ virtual ~BoxedHandleUnwrapAndDeletePreserveBoxedMapping() {}
+
+ GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(HANDLE_MAPPING_DECLS)
+ GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(HANDLE_MAPPING_DECLS)
+
+ private:
+ void allocPreserve(size_t count);
+
+ android::base::BumpPool* mPool = nullptr;
+ uint64_t** mPreserveBufPtr = nullptr;
+};
+
+template <class TDispatch>
+class ExternalFencePool {
+ public:
+ ExternalFencePool(TDispatch* dispatch, VkDevice device)
+ : m_vk(dispatch), mDevice(device), mMaxSize(5) {}
+
+ ~ExternalFencePool() {
+ if (!mPool.empty()) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "External fence pool for device " << static_cast<void*>(mDevice)
+ << " destroyed but " << mPool.size() << " fences still not destroyed.";
+ }
+ }
+
+ void add(VkFence fence) {
+ AutoLock lock(mLock);
+ mPool.push_back(fence);
+ if (mPool.size() > mMaxSize) {
+ INFO("External fence pool for %p has increased to size %d", mDevice, mPool.size());
+ mMaxSize = mPool.size();
+ }
+ }
+
+ VkFence pop(const VkFenceCreateInfo* pCreateInfo) {
+ VkFence fence = VK_NULL_HANDLE;
+ {
+ AutoLock lock(mLock);
+ auto it = std::find_if(mPool.begin(), mPool.end(), [this](const VkFence& fence) {
+ VkResult status = m_vk->vkGetFenceStatus(mDevice, fence);
+ if (status != VK_SUCCESS) {
+ if (status != VK_NOT_READY) {
+ VK_CHECK(status);
+ }
+
+ // Status is valid, but fence is not yet signaled
+ return false;
+ }
+ return true;
+ });
+ if (it == mPool.end()) {
+ return VK_NULL_HANDLE;
+ }
+
+ fence = *it;
+ mPool.erase(it);
+ }
+
+ if (!(pCreateInfo->flags & VK_FENCE_CREATE_SIGNALED_BIT)) {
+ VK_CHECK(m_vk->vkResetFences(mDevice, 1, &fence));
+ }
+
+ return fence;
+ }
+
+ std::vector<VkFence> popAll() {
+ AutoLock lock(mLock);
+ std::vector<VkFence> popped = mPool;
+ mPool.clear();
+ return popped;
+ }
+
+ private:
+ TDispatch* m_vk;
+ VkDevice mDevice;
+ Lock mLock;
+ std::vector<VkFence> mPool;
+ int mMaxSize;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkDecoderGlobalState_unittest.cpp b/src/gfxstream/host/vulkan/VkDecoderGlobalState_unittest.cpp
new file mode 100644
index 00000000000..7126869bc23
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkDecoderGlobalState_unittest.cpp
@@ -0,0 +1,148 @@
+// 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 <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "VkDecoderGlobalState.cpp"
+
+#include "aemu/base/testing/TestUtils.h"
+
+namespace gfxstream {
+namespace vk {
+namespace {
+using ::testing::_;
+using ::testing::InSequence;
+using ::testing::MockFunction;
+using ::testing::Return;
+using ::testing::Test;
+using ::testing::UnorderedElementsAre;
+
+class VkDecoderGlobalStateExternalFenceTest : public Test {
+protected:
+ class MockDispatch {
+ public:
+ MOCK_METHOD(VkResult, vkGetFenceStatus, (VkDevice device, VkFence fence), ());
+ MOCK_METHOD(VkResult,
+ vkResetFences,
+ (VkDevice device, uint32_t numFences, const VkFence* fence),
+ ());
+ };
+
+ VkDecoderGlobalStateExternalFenceTest()
+ : mDevice(reinterpret_cast<VkDevice>(0x2222'0000)), mPool(&mMockDispatch, mDevice) {}
+
+ ~VkDecoderGlobalStateExternalFenceTest() {
+ mPool.popAll();
+ }
+
+ MockDispatch mMockDispatch;
+ VkDevice mDevice;
+ ExternalFencePool<MockDispatch> mPool;
+};
+
+using VkDecoderGlobalStateExternalFenceDeathTest = VkDecoderGlobalStateExternalFenceTest;
+
+TEST_F(VkDecoderGlobalStateExternalFenceTest, poolNoDeviceFences) {
+ VkFenceCreateInfo createInfo{
+ .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ .pNext = 0,
+ .flags = 0,
+ };
+ ASSERT_EQ(VK_NULL_HANDLE, mPool.pop(&createInfo));
+}
+
+TEST_F(VkDecoderGlobalStateExternalFenceTest, poolReuseSignalledFence) {
+ {
+ InSequence s;
+ EXPECT_CALL(mMockDispatch, vkGetFenceStatus(_, _)).WillOnce(Return(VK_SUCCESS));
+ EXPECT_CALL(mMockDispatch, vkResetFences(_, _, _)).WillOnce(Return(VK_SUCCESS));
+ }
+
+ VkFence fence = reinterpret_cast<VkFence>(0x1234'0000);
+ VkFenceCreateInfo createInfo{
+ .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ .pNext = 0,
+ .flags = 0,
+ };
+ mPool.add(fence);
+ VkFence reusedFence = mPool.pop(&createInfo);
+
+ ASSERT_EQ(fence, reusedFence);
+}
+
+TEST_F(VkDecoderGlobalStateExternalFenceTest, poolReuseSignalledFenceAsSignaled) {
+ {
+ InSequence s;
+ EXPECT_CALL(mMockDispatch, vkGetFenceStatus(_, _)).WillOnce(Return(VK_SUCCESS));
+ EXPECT_CALL(mMockDispatch, vkResetFences(_, _, _)).Times(0);
+ }
+
+ VkFence fence = reinterpret_cast<VkFence>(0x1234'0000);
+ VkFenceCreateInfo createInfo{
+ .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ .pNext = 0,
+ .flags = VK_FENCE_CREATE_SIGNALED_BIT,
+ };
+ mPool.add(fence);
+ VkFence reusedFence = mPool.pop(&createInfo);
+
+ ASSERT_EQ(fence, reusedFence);
+}
+
+TEST_F(VkDecoderGlobalStateExternalFenceTest, poolUnsignalledFence) {
+ {
+ InSequence s;
+ EXPECT_CALL(mMockDispatch, vkGetFenceStatus(_, _)).WillOnce(Return(VK_NOT_READY));
+ EXPECT_CALL(mMockDispatch, vkResetFences(_, _, _)).Times(0);
+ }
+
+ VkFence fence = reinterpret_cast<VkFence>(0x1234'0000);
+ VkFenceCreateInfo createInfo{
+ .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
+ .pNext = 0,
+ .flags = 0,
+ };
+ mPool.add(fence);
+
+ ASSERT_EQ(VK_NULL_HANDLE, mPool.pop(&createInfo));
+}
+
+TEST_F(VkDecoderGlobalStateExternalFenceTest, poolPopAll) {
+ VkFence fence1 = reinterpret_cast<VkFence>(0x1234'0000);
+ VkFence fence2 = reinterpret_cast<VkFence>(0x2234'0000);
+ VkFence fence3 = reinterpret_cast<VkFence>(0x3234'0000);
+ mPool.add(fence1);
+ mPool.add(fence2);
+ mPool.add(fence3);
+
+ std::vector<VkFence> result = mPool.popAll();
+ ASSERT_THAT(result, UnorderedElementsAre(fence1, fence2, fence3));
+}
+
+TEST_F(VkDecoderGlobalStateExternalFenceDeathTest, undestroyedFences) {
+ ASSERT_DEATH(
+ {
+ ExternalFencePool<MockDispatch> pool(&mMockDispatch, mDevice);
+ VkFence fence = reinterpret_cast<VkFence>(0x1234'0000);
+ pool.add(fence);
+ },
+ MatchesStdRegex(
+ "External fence pool for device 0000000022220000|0x22220000 destroyed but 1 "
+ "fences still not destroyed."));
+}
+
+} // namespace
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkFormatUtils.cpp b/src/gfxstream/host/vulkan/VkFormatUtils.cpp
new file mode 100644
index 00000000000..1259a6123c2
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkFormatUtils.cpp
@@ -0,0 +1,201 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "VkFormatUtils.h"
+
+#include <unordered_map>
+
+namespace gfxstream {
+namespace vk {
+#include "host-common/logging.h"
+#include "vulkan/vk_enum_string_helper.h"
+
+namespace {
+
+struct FormatPlaneLayout {
+ uint32_t horizontalSubsampling = 1;
+ uint32_t verticalSubsampling = 1;
+ uint32_t sampleIncrementBytes = 0;
+ VkImageAspectFlags aspectMask = 0;
+};
+
+struct FormatPlaneLayouts {
+ uint32_t horizontalAlignmentPixels = 1;
+ std::vector<FormatPlaneLayout> planeLayouts;
+};
+
+const std::unordered_map<VkFormat, FormatPlaneLayouts>& getFormatPlaneLayoutsMap() {
+ static const auto* kPlaneLayoutsMap = []() {
+ auto* map = new std::unordered_map<VkFormat, FormatPlaneLayouts>({
+ {VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16,
+ {
+ .horizontalAlignmentPixels = 2,
+ .planeLayouts =
+ {
+ {
+ .horizontalSubsampling = 1,
+ .verticalSubsampling = 1,
+ .sampleIncrementBytes = 2,
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_0_BIT,
+ },
+ {
+ .horizontalSubsampling = 2,
+ .verticalSubsampling = 2,
+ .sampleIncrementBytes = 4,
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_1_BIT,
+ },
+ },
+ }},
+ {VK_FORMAT_G8_B8R8_2PLANE_420_UNORM,
+ {
+ .horizontalAlignmentPixels = 2,
+ .planeLayouts =
+ {
+ {
+ .horizontalSubsampling = 1,
+ .verticalSubsampling = 1,
+ .sampleIncrementBytes = 1,
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_0_BIT,
+ },
+ {
+ .horizontalSubsampling = 2,
+ .verticalSubsampling = 2,
+ .sampleIncrementBytes = 2,
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_1_BIT,
+ },
+ },
+ }},
+ {VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
+ {
+ .horizontalAlignmentPixels = 32,
+ .planeLayouts =
+ {
+ {
+ .horizontalSubsampling = 1,
+ .verticalSubsampling = 1,
+ .sampleIncrementBytes = 1,
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_0_BIT,
+ },
+ {
+ .horizontalSubsampling = 2,
+ .verticalSubsampling = 2,
+ .sampleIncrementBytes = 1,
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_1_BIT,
+ },
+ {
+ .horizontalSubsampling = 2,
+ .verticalSubsampling = 2,
+ .sampleIncrementBytes = 1,
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_2_BIT,
+ },
+ },
+ }},
+ });
+
+#define ADD_SINGLE_PLANE_FORMAT_INFO(format, bpp) \
+ (*map)[format] = FormatPlaneLayouts{ \
+ .horizontalAlignmentPixels = 1, \
+ .planeLayouts = \
+ { \
+ { \
+ .horizontalSubsampling = 1, \
+ .verticalSubsampling = 1, \
+ .sampleIncrementBytes = bpp, \
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, \
+ }, \
+ }, \
+ };
+ LIST_VK_FORMATS_LINEAR(ADD_SINGLE_PLANE_FORMAT_INFO)
+#undef ADD_SINGLE_PLANE_FORMAT_INFO
+
+ return map;
+ }();
+ return *kPlaneLayoutsMap;
+}
+
+inline uint32_t alignToPower2(uint32_t val, uint32_t align) {
+ return (val + (align - 1)) & ~(align - 1);
+}
+
+} // namespace
+
+const FormatPlaneLayouts* getFormatPlaneLayouts(VkFormat format) {
+ const auto& formatPlaneLayoutsMap = getFormatPlaneLayoutsMap();
+
+ auto it = formatPlaneLayoutsMap.find(format);
+ if (it == formatPlaneLayoutsMap.end()) {
+ return nullptr;
+ }
+ return &it->second;
+}
+
+bool getFormatTransferInfo(VkFormat format, uint32_t width, uint32_t height,
+ VkDeviceSize* outStagingBufferCopySize,
+ std::vector<VkBufferImageCopy>* outBufferImageCopies) {
+ const FormatPlaneLayouts* formatInfo = getFormatPlaneLayouts(format);
+ if (formatInfo == nullptr) {
+ ERR("Unhandled format: %s", string_VkFormat(format));
+ return false;
+ }
+
+ const uint32_t alignedWidth = alignToPower2(width, formatInfo->horizontalAlignmentPixels);
+ const uint32_t alignedHeight = height;
+ uint32_t cumulativeOffset = 0;
+ uint32_t cumulativeSize = 0;
+ for (const FormatPlaneLayout& planeInfo : formatInfo->planeLayouts) {
+ const uint32_t planeOffset = cumulativeOffset;
+ const uint32_t planeWidth = alignedWidth / planeInfo.horizontalSubsampling;
+ const uint32_t planeHeight = alignedHeight / planeInfo.verticalSubsampling;
+ const uint32_t planeBpp = planeInfo.sampleIncrementBytes;
+ const uint32_t planeStrideTexels = planeWidth;
+ const uint32_t planeStrideBytes = planeStrideTexels * planeBpp;
+ const uint32_t planeSize = planeHeight * planeStrideBytes;
+ if (outBufferImageCopies) {
+ outBufferImageCopies->emplace_back(VkBufferImageCopy{
+ .bufferOffset = planeOffset,
+ .bufferRowLength = planeStrideTexels,
+ .bufferImageHeight = 0,
+ .imageSubresource =
+ {
+ .aspectMask = planeInfo.aspectMask,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ .imageOffset =
+ {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ },
+ .imageExtent =
+ {
+ .width = planeWidth,
+ .height = planeHeight,
+ .depth = 1,
+ },
+ });
+ }
+ cumulativeOffset += planeSize;
+ cumulativeSize += planeSize;
+ }
+ if (outStagingBufferCopySize) {
+ *outStagingBufferCopySize = cumulativeSize;
+ }
+
+ return true;
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkFormatUtils.h b/src/gfxstream/host/vulkan/VkFormatUtils.h
new file mode 100644
index 00000000000..d5799f6da03
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkFormatUtils.h
@@ -0,0 +1,377 @@
+// 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 expresso or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan_core.h>
+
+#include <vector>
+
+#include "host-common/logging.h"
+#include "vulkan/vk_enum_string_helper.h"
+
+namespace gfxstream {
+namespace vk {
+
+// Header library that captures common patterns when working with
+// Vulkan formats:
+// - Macros to iterate over categories of formats
+// - Add often-used parameters like the bytes per pixel and ASTC block size
+
+#define LIST_VK_FORMATS_LINEAR(f) \
+ f(VK_FORMAT_R4G4_UNORM_PACK8, 1) \
+ f(VK_FORMAT_R4G4B4A4_UNORM_PACK16, 2) \
+ f(VK_FORMAT_B4G4R4A4_UNORM_PACK16, 2) \
+ f(VK_FORMAT_R5G6B5_UNORM_PACK16, 2) \
+ f(VK_FORMAT_B5G6R5_UNORM_PACK16, 2) \
+ f(VK_FORMAT_R5G5B5A1_UNORM_PACK16, 2) \
+ f(VK_FORMAT_B5G5R5A1_UNORM_PACK16, 2) \
+ f(VK_FORMAT_A1R5G5B5_UNORM_PACK16, 2) \
+ f(VK_FORMAT_R8_UNORM, 1) \
+ f(VK_FORMAT_R8_SNORM, 1) \
+ f(VK_FORMAT_R8_USCALED, 1) \
+ f(VK_FORMAT_R8_SSCALED, 1) \
+ f(VK_FORMAT_R8_UINT, 1) \
+ f(VK_FORMAT_R8_SINT, 1) \
+ f(VK_FORMAT_R8_SRGB, 1) \
+ f(VK_FORMAT_R8G8_UNORM, 2) \
+ f(VK_FORMAT_R8G8_SNORM, 2) \
+ f(VK_FORMAT_R8G8_USCALED, 2) \
+ f(VK_FORMAT_R8G8_SSCALED, 2) \
+ f(VK_FORMAT_R8G8_UINT, 2) \
+ f(VK_FORMAT_R8G8_SINT, 2) \
+ f(VK_FORMAT_R8G8_SRGB, 2) \
+ f(VK_FORMAT_R8G8B8_UNORM, 3) \
+ f(VK_FORMAT_R8G8B8_SNORM, 3) \
+ f(VK_FORMAT_R8G8B8_USCALED, 3) \
+ f(VK_FORMAT_R8G8B8_SSCALED, 3) \
+ f(VK_FORMAT_R8G8B8_UINT, 3) \
+ f(VK_FORMAT_R8G8B8_SINT, 3) \
+ f(VK_FORMAT_R8G8B8_SRGB, 3) \
+ f(VK_FORMAT_B8G8R8_UNORM, 3) \
+ f(VK_FORMAT_B8G8R8_SNORM, 3) \
+ f(VK_FORMAT_B8G8R8_USCALED, 3) \
+ f(VK_FORMAT_B8G8R8_SSCALED, 3) \
+ f(VK_FORMAT_B8G8R8_UINT, 3) \
+ f(VK_FORMAT_B8G8R8_SINT, 3) \
+ f(VK_FORMAT_B8G8R8_SRGB, 3) \
+ f(VK_FORMAT_R8G8B8A8_UNORM, 4) \
+ f(VK_FORMAT_R8G8B8A8_SNORM, 4) \
+ f(VK_FORMAT_R8G8B8A8_USCALED, 4) \
+ f(VK_FORMAT_R8G8B8A8_SSCALED, 4) \
+ f(VK_FORMAT_R8G8B8A8_UINT, 4) \
+ f(VK_FORMAT_R8G8B8A8_SINT, 4) \
+ f(VK_FORMAT_R8G8B8A8_SRGB, 4) \
+ f(VK_FORMAT_B8G8R8A8_UNORM, 4) \
+ f(VK_FORMAT_B8G8R8A8_SNORM, 4) \
+ f(VK_FORMAT_B8G8R8A8_USCALED, 4) \
+ f(VK_FORMAT_B8G8R8A8_SSCALED, 4) \
+ f(VK_FORMAT_B8G8R8A8_UINT, 4) \
+ f(VK_FORMAT_B8G8R8A8_SINT, 4) \
+ f(VK_FORMAT_B8G8R8A8_SRGB, 4) \
+ f(VK_FORMAT_A8B8G8R8_UNORM_PACK32, 4) \
+ f(VK_FORMAT_A8B8G8R8_SNORM_PACK32, 4) \
+ f(VK_FORMAT_A8B8G8R8_USCALED_PACK32, 4) \
+ f(VK_FORMAT_A8B8G8R8_SSCALED_PACK32, 4) \
+ f(VK_FORMAT_A8B8G8R8_UINT_PACK32, 4) \
+ f(VK_FORMAT_A8B8G8R8_SINT_PACK32, 4) \
+ f(VK_FORMAT_A8B8G8R8_SRGB_PACK32, 4) \
+ f(VK_FORMAT_A2R10G10B10_UNORM_PACK32, 4) \
+ f(VK_FORMAT_A2R10G10B10_SNORM_PACK32, 4) \
+ f(VK_FORMAT_A2R10G10B10_USCALED_PACK32, 4) \
+ f(VK_FORMAT_A2R10G10B10_SSCALED_PACK32, 4) \
+ f(VK_FORMAT_A2R10G10B10_UINT_PACK32, 4) \
+ f(VK_FORMAT_A2R10G10B10_SINT_PACK32, 4) \
+ f(VK_FORMAT_A2B10G10R10_UNORM_PACK32, 4) \
+ f(VK_FORMAT_A2B10G10R10_SNORM_PACK32, 4) \
+ f(VK_FORMAT_A2B10G10R10_USCALED_PACK32, 4) \
+ f(VK_FORMAT_A2B10G10R10_SSCALED_PACK32, 4) \
+ f(VK_FORMAT_A2B10G10R10_UINT_PACK32, 4) \
+ f(VK_FORMAT_A2B10G10R10_SINT_PACK32, 4) \
+ f(VK_FORMAT_R16_UNORM, 2) \
+ f(VK_FORMAT_R16_SNORM, 2) \
+ f(VK_FORMAT_R16_USCALED, 2) \
+ f(VK_FORMAT_R16_SSCALED, 2) \
+ f(VK_FORMAT_R16_UINT, 2) \
+ f(VK_FORMAT_R16_SINT, 2) \
+ f(VK_FORMAT_R16_SFLOAT, 2) \
+ f(VK_FORMAT_R16G16_UNORM, 4) \
+ f(VK_FORMAT_R16G16_SNORM, 4) \
+ f(VK_FORMAT_R16G16_USCALED, 4) \
+ f(VK_FORMAT_R16G16_SSCALED, 4) \
+ f(VK_FORMAT_R16G16_UINT, 4) \
+ f(VK_FORMAT_R16G16_SINT, 4) \
+ f(VK_FORMAT_R16G16_SFLOAT, 4) \
+ f(VK_FORMAT_R16G16B16_UNORM, 6) \
+ f(VK_FORMAT_R16G16B16_SNORM, 6) \
+ f(VK_FORMAT_R16G16B16_USCALED, 6) \
+ f(VK_FORMAT_R16G16B16_SSCALED, 6) \
+ f(VK_FORMAT_R16G16B16_UINT, 6) \
+ f(VK_FORMAT_R16G16B16_SINT, 6) \
+ f(VK_FORMAT_R16G16B16_SFLOAT, 6) \
+ f(VK_FORMAT_R16G16B16A16_UNORM, 8) \
+ f(VK_FORMAT_R16G16B16A16_SNORM, 8) \
+ f(VK_FORMAT_R16G16B16A16_USCALED, 8) \
+ f(VK_FORMAT_R16G16B16A16_SSCALED, 8) \
+ f(VK_FORMAT_R16G16B16A16_UINT, 8) \
+ f(VK_FORMAT_R16G16B16A16_SINT, 8) \
+ f(VK_FORMAT_R16G16B16A16_SFLOAT, 8) \
+ f(VK_FORMAT_R32_UINT, 4) \
+ f(VK_FORMAT_R32_SINT, 4) \
+ f(VK_FORMAT_R32_SFLOAT, 4) \
+ f(VK_FORMAT_R32G32_UINT, 8) \
+ f(VK_FORMAT_R32G32_SINT, 8) \
+ f(VK_FORMAT_R32G32_SFLOAT, 8) \
+ f(VK_FORMAT_R32G32B32_UINT, 8) \
+ f(VK_FORMAT_R32G32B32_SINT, 8) \
+ f(VK_FORMAT_R32G32B32_SFLOAT, 8) \
+ f(VK_FORMAT_R32G32B32A32_UINT, 16) \
+ f(VK_FORMAT_R32G32B32A32_SINT, 16) \
+ f(VK_FORMAT_R32G32B32A32_SFLOAT, 16) \
+ f(VK_FORMAT_R64_UINT, 8) \
+ f(VK_FORMAT_R64_SINT, 8) \
+ f(VK_FORMAT_R64_SFLOAT, 8) \
+ f(VK_FORMAT_R64G64_UINT, 16) \
+ f(VK_FORMAT_R64G64_SINT, 16) \
+ f(VK_FORMAT_R64G64_SFLOAT, 16) \
+ f(VK_FORMAT_R64G64B64_UINT, 24) \
+ f(VK_FORMAT_R64G64B64_SINT, 24) \
+ f(VK_FORMAT_R64G64B64_SFLOAT, 24) \
+ f(VK_FORMAT_R64G64B64A64_UINT, 32) \
+ f(VK_FORMAT_R64G64B64A64_SINT, 32) \
+ f(VK_FORMAT_R64G64B64A64_SFLOAT, 32) \
+ f(VK_FORMAT_B10G11R11_UFLOAT_PACK32, 4) \
+ f(VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, 4) \
+ f(VK_FORMAT_D16_UNORM, 2) \
+ f(VK_FORMAT_X8_D24_UNORM_PACK32, 4) \
+ f(VK_FORMAT_D32_SFLOAT, 4) \
+ f(VK_FORMAT_S8_UINT, 1) \
+ f(VK_FORMAT_D16_UNORM_S8_UINT, 3) \
+ f(VK_FORMAT_D24_UNORM_S8_UINT, 4) \
+ f(VK_FORMAT_D32_SFLOAT_S8_UINT, 5) \
+ f(VK_FORMAT_R10X6_UNORM_PACK16, 2) \
+ f(VK_FORMAT_R10X6G10X6_UNORM_2PACK16, 4) \
+ f(VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, 8) \
+ f(VK_FORMAT_R12X4_UNORM_PACK16, 2) \
+ f(VK_FORMAT_R12X4G12X4_UNORM_2PACK16, 4) \
+ f(VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, 8)
+
+constexpr bool isEtc2(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
+ case VK_FORMAT_EAC_R11_UNORM_BLOCK:
+ case VK_FORMAT_EAC_R11_SNORM_BLOCK:
+ case VK_FORMAT_EAC_R11G11_UNORM_BLOCK:
+ case VK_FORMAT_EAC_R11G11_SNORM_BLOCK:
+ return true;
+ default:
+ return false;
+ }
+}
+
+// Note: this only returns true for ASTC LDR, not HDR.
+// TODO(gregschlom): Revisit our ASTC-related names if we decide to support HDR to make sure we
+// clearly distinguish between the two modes.
+constexpr bool isAstc(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
+ return true;
+ default:
+ return false;
+ }
+}
+
+constexpr bool isBc(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
+ case VK_FORMAT_BC1_RGB_SRGB_BLOCK:
+ case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
+ case VK_FORMAT_BC1_RGBA_SRGB_BLOCK:
+ case VK_FORMAT_BC2_UNORM_BLOCK:
+ case VK_FORMAT_BC2_SRGB_BLOCK:
+ case VK_FORMAT_BC3_UNORM_BLOCK:
+ case VK_FORMAT_BC3_SRGB_BLOCK:
+ case VK_FORMAT_BC4_UNORM_BLOCK:
+ case VK_FORMAT_BC4_SNORM_BLOCK:
+ case VK_FORMAT_BC5_UNORM_BLOCK:
+ case VK_FORMAT_BC5_SNORM_BLOCK:
+ case VK_FORMAT_BC6H_UFLOAT_BLOCK:
+ case VK_FORMAT_BC6H_SFLOAT_BLOCK:
+ case VK_FORMAT_BC7_UNORM_BLOCK:
+ case VK_FORMAT_BC7_SRGB_BLOCK:
+ return true;
+ default:
+ return false;
+ }
+}
+
+constexpr bool formatIsUInt(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_R8_UINT:
+ case VK_FORMAT_S8_UINT:
+ case VK_FORMAT_R8G8_UINT:
+ case VK_FORMAT_R8G8B8_UINT:
+ case VK_FORMAT_R8G8B8A8_UINT:
+ case VK_FORMAT_A8B8G8R8_UINT_PACK32:
+ case VK_FORMAT_A2B10G10R10_UINT_PACK32:
+ case VK_FORMAT_R16_UINT:
+ case VK_FORMAT_R16G16_UINT:
+ case VK_FORMAT_R16G16B16_UINT:
+ case VK_FORMAT_R16G16B16A16_UINT:
+ case VK_FORMAT_R32_UINT:
+ case VK_FORMAT_R32G32_UINT:
+ case VK_FORMAT_R32G32B32_UINT:
+ case VK_FORMAT_R32G32B32A32_UINT:
+ case VK_FORMAT_R64_UINT:
+ case VK_FORMAT_R64G64_UINT:
+ case VK_FORMAT_R64G64B64_UINT:
+ case VK_FORMAT_R64G64B64A64_UINT:
+ case VK_FORMAT_B8G8R8_UINT:
+ case VK_FORMAT_B8G8R8A8_UINT:
+ case VK_FORMAT_A2R10G10B10_UINT_PACK32:
+ return true;
+ default:
+ return false;
+ }
+}
+
+constexpr bool formatIsSInt(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_R8_SINT:
+ case VK_FORMAT_R8G8_SINT:
+ case VK_FORMAT_R8G8B8_SINT:
+ case VK_FORMAT_R8G8B8A8_SINT:
+ case VK_FORMAT_A8B8G8R8_SINT_PACK32:
+ case VK_FORMAT_A2B10G10R10_SINT_PACK32:
+ case VK_FORMAT_R16_SINT:
+ case VK_FORMAT_R16G16_SINT:
+ case VK_FORMAT_R16G16B16_SINT:
+ case VK_FORMAT_R16G16B16A16_SINT:
+ case VK_FORMAT_R32_SINT:
+ case VK_FORMAT_R32G32_SINT:
+ case VK_FORMAT_R32G32B32_SINT:
+ case VK_FORMAT_R32G32B32A32_SINT:
+ case VK_FORMAT_R64_SINT:
+ case VK_FORMAT_R64G64_SINT:
+ case VK_FORMAT_R64G64B64_SINT:
+ case VK_FORMAT_R64G64B64A64_SINT:
+ case VK_FORMAT_B8G8R8_SINT:
+ case VK_FORMAT_B8G8R8A8_SINT:
+ case VK_FORMAT_A2R10G10B10_SINT_PACK32:
+ return true;
+ default:
+ return false;
+ }
+}
+
+constexpr bool formatIsDepthOrStencil(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_D16_UNORM:
+ case VK_FORMAT_D16_UNORM_S8_UINT:
+ case VK_FORMAT_D24_UNORM_S8_UINT:
+ case VK_FORMAT_D32_SFLOAT:
+ case VK_FORMAT_D32_SFLOAT_S8_UINT:
+ case VK_FORMAT_S8_UINT:
+ case VK_FORMAT_X8_D24_UNORM_PACK32:
+ return true;
+ default:
+ return false;
+ }
+}
+
+constexpr bool formatRequiresSamplerYcbcrConversion(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_G8B8G8R8_422_UNORM:
+ case VK_FORMAT_B8G8R8G8_422_UNORM:
+ case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
+ case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
+ case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:
+ case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:
+ case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:
+ case VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:
+ case VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:
+ case VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:
+ case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:
+ case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:
+ case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:
+ case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:
+ case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:
+ case VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:
+ case VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:
+ case VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:
+ case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:
+ case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:
+ case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:
+ case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:
+ case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:
+ case VK_FORMAT_G16B16G16R16_422_UNORM:
+ case VK_FORMAT_B16G16R16G16_422_UNORM:
+ case VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:
+ case VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:
+ case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:
+ case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:
+ case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:
+#ifdef VK_EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION
+ case VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT:
+ case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT:
+ case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT:
+ case VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT:
+#endif
+ return true;
+ default:
+ return false;
+ }
+}
+
+// Returns the size in bytes needed to copy an image with the given format,
+// width, and height to a staging buffer and the VkBufferImageCopy-s needed
+// to copy from a staging buffer to destination VkImage.
+bool getFormatTransferInfo(VkFormat format, uint32_t width, uint32_t height,
+ VkDeviceSize* outStagingBufferCopySize,
+ std::vector<VkBufferImageCopy>* outBufferImageCopies);
+
+} // namespace vk
+} // namespace gfxstream
+
diff --git a/src/gfxstream/host/vulkan/VkFormatUtils_unittest.cpp b/src/gfxstream/host/vulkan/VkFormatUtils_unittest.cpp
new file mode 100644
index 00000000000..4ee58e7f2c6
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkFormatUtils_unittest.cpp
@@ -0,0 +1,264 @@
+// 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 <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "VkFormatUtils.h"
+
+namespace gfxstream {
+namespace vk {
+namespace {
+
+using ::testing::AllOf;
+using ::testing::ElementsAre;
+using ::testing::Eq;
+using ::testing::ExplainMatchResult;
+using ::testing::Field;
+using ::testing::IsFalse;
+using ::testing::IsTrue;
+
+MATCHER_P(EqsVkExtent3D, expected, "") {
+ return ExplainMatchResult(AllOf(Field("width", &VkExtent3D::width, Eq(expected.width)),
+ Field("height", &VkExtent3D::height, Eq(expected.height)),
+ Field("depth", &VkExtent3D::depth, Eq(expected.depth))),
+ arg, result_listener);
+}
+
+MATCHER_P(EqsVkImageSubresourceLayers, expected, "") {
+ return ExplainMatchResult(
+ AllOf(Field("aspectMask", &VkImageSubresourceLayers::aspectMask, Eq(expected.aspectMask)),
+ Field("mipLevel", &VkImageSubresourceLayers::mipLevel, Eq(expected.mipLevel)),
+ Field("baseArrayLayer", &VkImageSubresourceLayers::baseArrayLayer,
+ Eq(expected.baseArrayLayer)),
+ Field("layerCount", &VkImageSubresourceLayers::layerCount, Eq(expected.layerCount))),
+ arg, result_listener);
+}
+
+MATCHER_P(EqsVkOffset3D, expected, "") {
+ return ExplainMatchResult(AllOf(Field("x", &VkOffset3D::x, Eq(expected.x)),
+ Field("y", &VkOffset3D::y, Eq(expected.y)),
+ Field("z", &VkOffset3D::z, Eq(expected.z))),
+ arg, result_listener);
+}
+
+MATCHER_P(EqsVkBufferImageCopy, expected, "") {
+ return ExplainMatchResult(
+ AllOf(Field("bufferOffset", &VkBufferImageCopy::bufferOffset, Eq(expected.bufferOffset)),
+ Field("bufferRowLength", &VkBufferImageCopy::bufferRowLength,
+ Eq(expected.bufferRowLength)),
+ Field("bufferImageHeight", &VkBufferImageCopy::bufferImageHeight,
+ Eq(expected.bufferImageHeight)),
+ Field("imageSubresource", &VkBufferImageCopy::imageSubresource,
+ EqsVkImageSubresourceLayers(expected.imageSubresource)),
+ Field("imageOffset", &VkBufferImageCopy::imageOffset,
+ EqsVkOffset3D(expected.imageOffset)),
+ Field("imageExtent", &VkBufferImageCopy::imageExtent,
+ EqsVkExtent3D(expected.imageExtent))),
+ arg, result_listener);
+}
+
+TEST(VkFormatUtilsTest, GetTransferInfoInvalidFormat) {
+ const VkFormat format = VK_FORMAT_UNDEFINED;
+ const uint32_t width = 16;
+ const uint32_t height = 16;
+ ASSERT_THAT(getFormatTransferInfo(format, width, height, nullptr, nullptr), IsFalse());
+}
+
+TEST(VkFormatUtilsTest, GetTransferInfoRGBA) {
+ const VkFormat format = VK_FORMAT_R8G8B8A8_UNORM;
+ const uint32_t width = 16;
+ const uint32_t height = 16;
+
+ VkDeviceSize bufferCopySize;
+ std::vector<VkBufferImageCopy> bufferImageCopies;
+ ASSERT_THAT(getFormatTransferInfo(format, width, height, &bufferCopySize, &bufferImageCopies),
+ IsTrue());
+ EXPECT_THAT(bufferCopySize, Eq(1024));
+ ASSERT_THAT(bufferImageCopies, ElementsAre(EqsVkBufferImageCopy(VkBufferImageCopy{
+ .bufferOffset = 0,
+ .bufferRowLength = 16,
+ .bufferImageHeight = 0,
+ .imageSubresource =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ .imageOffset =
+ {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ },
+ .imageExtent =
+ {
+ .width = 16,
+ .height = 16,
+ .depth = 1,
+ },
+ })));
+}
+
+TEST(VkFormatUtilsTest, GetTransferInfoNV12OrNV21) {
+ const VkFormat format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
+ const uint32_t width = 16;
+ const uint32_t height = 16;
+
+ VkDeviceSize bufferCopySize;
+ std::vector<VkBufferImageCopy> bufferImageCopies;
+ ASSERT_THAT(getFormatTransferInfo(format, width, height, &bufferCopySize, &bufferImageCopies),
+ IsTrue());
+ EXPECT_THAT(bufferCopySize, Eq(384));
+ ASSERT_THAT(bufferImageCopies,
+ ElementsAre(EqsVkBufferImageCopy(VkBufferImageCopy{
+ .bufferOffset = 0,
+ .bufferRowLength = 16,
+ .bufferImageHeight = 0,
+ .imageSubresource =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_0_BIT,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ .imageOffset =
+ {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ },
+ .imageExtent =
+ {
+ .width = 16,
+ .height = 16,
+ .depth = 1,
+ },
+ }),
+ EqsVkBufferImageCopy(VkBufferImageCopy{
+ .bufferOffset = 256,
+ .bufferRowLength = 8,
+ .bufferImageHeight = 0,
+ .imageSubresource =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_1_BIT,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ .imageOffset =
+ {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ },
+ .imageExtent =
+ {
+ .width = 8,
+ .height = 8,
+ .depth = 1,
+ },
+ })));
+}
+
+TEST(VkFormatUtilsTest, GetTransferInfoYV12OrYV21) {
+ const VkFormat format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM;
+ const uint32_t width = 32;
+ const uint32_t height = 32;
+
+ VkDeviceSize bufferCopySize;
+ std::vector<VkBufferImageCopy> bufferImageCopies;
+ ASSERT_THAT(getFormatTransferInfo(format, width, height, &bufferCopySize, &bufferImageCopies),
+ IsTrue());
+ EXPECT_THAT(bufferCopySize, Eq(1536));
+ ASSERT_THAT(bufferImageCopies,
+ ElementsAre(EqsVkBufferImageCopy(VkBufferImageCopy{
+ .bufferOffset = 0,
+ .bufferRowLength = 32,
+ .bufferImageHeight = 0,
+ .imageSubresource =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_0_BIT,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ .imageOffset =
+ {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ },
+ .imageExtent =
+ {
+ .width = 32,
+ .height = 32,
+ .depth = 1,
+ },
+ }),
+ EqsVkBufferImageCopy(VkBufferImageCopy{
+ .bufferOffset = 1024,
+ .bufferRowLength = 16,
+ .bufferImageHeight = 0,
+ .imageSubresource =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_1_BIT,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ .imageOffset =
+ {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ },
+ .imageExtent =
+ {
+ .width = 16,
+ .height = 16,
+ .depth = 1,
+ },
+ }),
+ EqsVkBufferImageCopy(VkBufferImageCopy{
+ .bufferOffset = 1280,
+ .bufferRowLength = 16,
+ .bufferImageHeight = 0,
+ .imageSubresource =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_PLANE_2_BIT,
+ .mipLevel = 0,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ .imageOffset =
+ {
+ .x = 0,
+ .y = 0,
+ .z = 0,
+ },
+ .imageExtent =
+ {
+ .width = 16,
+ .height = 16,
+ .depth = 1,
+ },
+ })));
+}
+
+} // namespace
+} // namespace vk
+} // namespace gfxstream
+
diff --git a/src/gfxstream/host/vulkan/VkQsriTimeline.h b/src/gfxstream/host/vulkan/VkQsriTimeline.h
new file mode 100644
index 00000000000..e8a9526527f
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkQsriTimeline.h
@@ -0,0 +1,69 @@
+#ifndef VK_QSRI_TIMELINE_H
+#define VK_QSRI_TIMELINE_H
+
+#include <cstdint>
+#include <functional>
+#include <map>
+#include <mutex>
+#include <sstream>
+
+#include "host-common/logging.h"
+
+namespace gfxstream {
+namespace vk {
+
+class VkQsriTimeline {
+ public:
+ using Callback = std::function<void()>;
+
+ void signalNextPresentAndPoll() {
+ std::lock_guard<std::mutex> guard(mLock);
+ mPresentCount++;
+ pollLocked();
+ }
+
+ void registerCallbackForNextPresentAndPoll(Callback callback) {
+ std::lock_guard<std::mutex> guard(mLock);
+ uint64_t requestPresentCount = mRequestPresentCount;
+ mRequestPresentCount++;
+ mPendingCallbacks.emplace(requestPresentCount, std::move(callback));
+ pollLocked();
+ }
+
+ VkQsriTimeline() : mPresentCount(0), mRequestPresentCount(0) {}
+ ~VkQsriTimeline() {
+ std::lock_guard<std::mutex> guard(mLock);
+ if (mPendingCallbacks.empty()) {
+ return;
+ }
+ std::stringstream ss;
+ ss << mPendingCallbacks.size()
+ << " pending QSRI callbacks found when destroying the timeline, waiting for: ";
+ for (auto& [requiredPresentCount, callback] : mPendingCallbacks) {
+ callback();
+ ss << requiredPresentCount << ", ";
+ }
+ ss << "just call all of callbacks.";
+ ERR("%s", ss.str().c_str());
+ }
+
+ private:
+ std::map<uint64_t, Callback> mPendingCallbacks;
+ std::mutex mLock;
+ uint64_t mPresentCount;
+ uint64_t mRequestPresentCount;
+
+ void pollLocked() {
+ auto firstPendingCallback = mPendingCallbacks.lower_bound(mPresentCount);
+ for (auto readyCallback = mPendingCallbacks.begin(); readyCallback != firstPendingCallback;
+ readyCallback++) {
+ readyCallback->second();
+ }
+ mPendingCallbacks.erase(mPendingCallbacks.begin(), firstPendingCallback);
+ }
+};
+
+} // namespace vk
+} // namespace gfxstream
+
+#endif // VK_QSRI_TIMELINE_H \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/VkQsriTimeline_unittest.cpp b/src/gfxstream/host/vulkan/VkQsriTimeline_unittest.cpp
new file mode 100644
index 00000000000..3516c6af56a
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkQsriTimeline_unittest.cpp
@@ -0,0 +1,44 @@
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "VkQsriTimeline.h"
+
+namespace gfxstream {
+namespace vk {
+namespace {
+using ::testing::InSequence;
+using ::testing::MockFunction;
+
+TEST(VkQsriTImelineTest, signalFirstRegisterCallbackLater) {
+ MockFunction<void()> mockCallback1, mockCallback2;
+ VkQsriTimeline qsriTimeline;
+ {
+ InSequence s;
+ EXPECT_CALL(mockCallback1, Call()).Times(1);
+ EXPECT_CALL(mockCallback2, Call()).Times(1);
+ }
+ qsriTimeline.signalNextPresentAndPoll();
+ qsriTimeline.signalNextPresentAndPoll();
+ qsriTimeline.registerCallbackForNextPresentAndPoll(mockCallback1.AsStdFunction());
+ qsriTimeline.registerCallbackForNextPresentAndPoll(mockCallback2.AsStdFunction());
+}
+
+TEST(VkQsriTImelineTest, registerCallbackFirstSignalLater) {
+ MockFunction<void()> mockCallback1, mockCallback2, beforeSignal;
+ VkQsriTimeline qsriTimeline;
+ {
+ InSequence s;
+ EXPECT_CALL(beforeSignal, Call()).Times(1);
+ EXPECT_CALL(mockCallback1, Call()).Times(1);
+ EXPECT_CALL(mockCallback2, Call()).Times(1);
+ }
+ qsriTimeline.registerCallbackForNextPresentAndPoll(mockCallback1.AsStdFunction());
+ qsriTimeline.registerCallbackForNextPresentAndPoll(mockCallback2.AsStdFunction());
+ beforeSignal.Call();
+ qsriTimeline.signalNextPresentAndPoll();
+ qsriTimeline.signalNextPresentAndPoll();
+}
+
+} // namespace
+} // namespace vk
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/VkReconstruction.cpp b/src/gfxstream/host/vulkan/VkReconstruction.cpp
new file mode 100644
index 00000000000..5eee9018167
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkReconstruction.cpp
@@ -0,0 +1,483 @@
+// 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 "VkReconstruction.h"
+
+#include <string.h>
+
+#include <unordered_map>
+
+#include "FrameBuffer.h"
+#include "render-utils/IOStream.h"
+#include "VkDecoder.h"
+#include "aemu/base/containers/EntityManager.h"
+
+namespace gfxstream {
+namespace vk {
+
+#define DEBUG_RECONSTRUCTION 0
+
+#if DEBUG_RECONSTRUCTION
+
+#define DEBUG_RECON(fmt, ...) fprintf(stderr, "%s:%d " fmt "\n", __func__, __LINE__, ##__VA_ARGS__);
+
+#else
+
+#define DEBUG_RECON(fmt, ...)
+
+#endif
+
+VkReconstruction::VkReconstruction() = default;
+
+std::vector<uint64_t> typeTagSortedHandles(const std::vector<uint64_t>& handles) {
+ using EntityManagerTypeForHandles = android::base::EntityManager<32, 16, 16, int>;
+
+ std::vector<uint64_t> res = handles;
+
+ std::sort(res.begin(), res.end(), [](uint64_t lhs, uint64_t rhs) {
+ return EntityManagerTypeForHandles::getHandleType(lhs) <
+ EntityManagerTypeForHandles::getHandleType(rhs);
+ });
+
+ return res;
+}
+
+void VkReconstruction::save(android::base::Stream* stream) {
+ DEBUG_RECON("start")
+
+#if DEBUG_RECON
+ dump();
+#endif
+
+ std::unordered_map<uint64_t, uint64_t> backDeps;
+
+ mHandleReconstructions.forEachLiveComponent_const(
+ [&backDeps](bool live, uint64_t componentHandle, uint64_t entityHandle,
+ const HandleReconstruction& item) {
+ for (auto handle : item.childHandles) {
+ backDeps[handle] = entityHandle;
+ }
+ });
+
+ std::vector<uint64_t> topoOrder;
+
+ mHandleReconstructions.forEachLiveComponent_const(
+ [&topoOrder, &backDeps](bool live, uint64_t componentHandle, uint64_t entityHandle,
+ const HandleReconstruction& item) {
+ // Start with populating the roots
+ if (backDeps.find(entityHandle) == backDeps.end()) {
+ DEBUG_RECON("found root: 0x%llx", (unsigned long long)entityHandle);
+ topoOrder.push_back(entityHandle);
+ }
+ });
+
+ std::vector<uint64_t> next;
+
+ std::unordered_map<uint64_t, uint64_t> uniqApiRefsToTopoOrder;
+ std::unordered_map<uint64_t, std::vector<uint64_t>> uniqApiRefsByTopoOrder;
+ std::unordered_map<uint64_t, std::vector<uint64_t>> uniqApiRefsByTopoAndDependencyOrder;
+
+ size_t topoLevel = 0;
+
+ topoOrder = typeTagSortedHandles(topoOrder);
+
+ while (!topoOrder.empty()) {
+ next.clear();
+
+ for (auto handle : topoOrder) {
+ auto item = mHandleReconstructions.get(handle);
+ // item could have been deleted.
+ if (!item) {
+ continue;
+ }
+
+ for (auto apiHandle : item->apiRefs) {
+ if (uniqApiRefsToTopoOrder.find(apiHandle) == uniqApiRefsToTopoOrder.end()) {
+ DEBUG_RECON("level %zu: 0x%llx api ref: 0x%llx", topoLevel,
+ (unsigned long long)handle, (unsigned long long)apiHandle);
+ auto& refs = uniqApiRefsByTopoOrder[topoLevel];
+ refs.push_back(apiHandle);
+ }
+
+ uniqApiRefsToTopoOrder[apiHandle] = topoLevel;
+ }
+
+ for (auto childHandle : item->childHandles) {
+ next.push_back(childHandle);
+ }
+ }
+
+ next = typeTagSortedHandles(next);
+
+ topoOrder = next;
+ ++topoLevel;
+ }
+
+ uniqApiRefsByTopoOrder[topoLevel] = getOrderedUniqueModifyApis();
+ ++topoLevel;
+
+ size_t totalApiTraceSize = 0; // 4 bytes to store size of created handles
+
+ for (size_t i = 0; i < topoLevel; ++i) {
+ for (auto apiHandle : uniqApiRefsByTopoOrder[i]) {
+ auto item = mApiTrace.get(apiHandle);
+ totalApiTraceSize += 4; // opcode
+ totalApiTraceSize += 4; // buffer size of trace
+ totalApiTraceSize += item->traceBytes; // the actual trace
+ }
+ }
+
+ DEBUG_RECON("total api trace size: %zu", totalApiTraceSize);
+
+ std::vector<uint64_t> createdHandleBuffer;
+
+ for (size_t i = 0; i < topoLevel; ++i) {
+ for (auto apiHandle : uniqApiRefsByTopoOrder[i]) {
+ auto item = mApiTrace.get(apiHandle);
+ for (auto createdHandle : item->createdHandles) {
+ DEBUG_RECON("save handle: 0x%llx\n", createdHandle);
+ createdHandleBuffer.push_back(createdHandle);
+ }
+ }
+ }
+
+ std::vector<uint8_t> apiTraceBuffer;
+ apiTraceBuffer.resize(totalApiTraceSize);
+
+ uint8_t* apiTracePtr = apiTraceBuffer.data();
+
+ for (size_t i = 0; i < topoLevel; ++i) {
+ for (auto apiHandle : uniqApiRefsByTopoOrder[i]) {
+ auto item = mApiTrace.get(apiHandle);
+ // 4 bytes for opcode, and 4 bytes for saveBufferRaw's size field
+ memcpy(apiTracePtr, &item->opCode, sizeof(uint32_t));
+ apiTracePtr += 4;
+ uint32_t traceBytesForSnapshot = item->traceBytes + 8;
+ memcpy(apiTracePtr, &traceBytesForSnapshot,
+ sizeof(uint32_t)); // and 8 bytes for 'self' struct of { opcode, packetlen } as
+ // that is what decoder expects
+ apiTracePtr += 4;
+ memcpy(apiTracePtr, item->trace.data(), item->traceBytes);
+ apiTracePtr += item->traceBytes;
+ }
+ }
+
+ DEBUG_RECON("created handle buffer size: %zu trace: %zu", createdHandleBuffer.size(),
+ apiTraceBuffer.size());
+
+ android::base::saveBufferRaw(stream, (char*)(createdHandleBuffer.data()),
+ createdHandleBuffer.size() * sizeof(uint64_t));
+ android::base::saveBufferRaw(stream, (char*)(apiTraceBuffer.data()), apiTraceBuffer.size());
+}
+
+class TrivialStream : public IOStream {
+ public:
+ TrivialStream() : IOStream(4) {}
+ virtual ~TrivialStream() = default;
+
+ void* 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 commitBuffer(size_t size) {
+ if (size == 0) return 0;
+ return writeFully(m_buf, size);
+ }
+
+ int writeFully(const void* buf, size_t len) { return 0; }
+
+ const unsigned char* readFully(void* buf, size_t len) { return NULL; }
+
+ virtual void* getDmaForReading(uint64_t guest_paddr) { return nullptr; }
+ virtual void unlockDma(uint64_t guest_paddr) {}
+
+ protected:
+ virtual const unsigned char* readRaw(void* buf, size_t* inout_len) { return nullptr; }
+ virtual void onSave(android::base::Stream* stream) {}
+ virtual unsigned char* onLoad(android::base::Stream* stream) { return nullptr; }
+};
+
+void VkReconstruction::load(android::base::Stream* stream, emugl::GfxApiLogger& gfxLogger,
+ emugl::HealthMonitor<>* healthMonitor) {
+ DEBUG_RECON("start. assuming VkDecoderGlobalState has been cleared for loading already");
+ mApiTrace.clear();
+ mHandleReconstructions.clear();
+
+ std::vector<uint8_t> createdHandleBuffer;
+ std::vector<uint8_t> apiTraceBuffer;
+
+ android::base::loadBuffer(stream, &createdHandleBuffer);
+ android::base::loadBuffer(stream, &apiTraceBuffer);
+
+ DEBUG_RECON("created handle buffer size: %zu trace: %zu", createdHandleBuffer.size(),
+ apiTraceBuffer.size());
+
+ uint32_t createdHandleBufferSize = createdHandleBuffer.size();
+
+ mLoadedTrace.resize(4 + createdHandleBufferSize + apiTraceBuffer.size());
+
+ unsigned char* finalTraceData = (unsigned char*)(mLoadedTrace.data());
+
+ memcpy(finalTraceData, &createdHandleBufferSize, sizeof(uint32_t));
+ memcpy(finalTraceData + 4, createdHandleBuffer.data(), createdHandleBufferSize);
+ memcpy(finalTraceData + 4 + createdHandleBufferSize, apiTraceBuffer.data(),
+ apiTraceBuffer.size());
+
+ VkDecoder decoderForLoading;
+ // A decoder that is set for snapshot load will load up the created handles first,
+ // if any, allowing us to 'catch' the results as they are decoded.
+ decoderForLoading.setForSnapshotLoad(true);
+ TrivialStream trivialStream;
+
+ DEBUG_RECON("start decoding trace");
+
+ // TODO: This needs to be the puid seqno ptr
+ auto resources = ProcessResources::create();
+ VkDecoderContext context = {
+ .processName = nullptr,
+ .gfxApiLogger = &gfxLogger,
+ .healthMonitor = healthMonitor,
+ };
+ decoderForLoading.decode(mLoadedTrace.data(), mLoadedTrace.size(), &trivialStream, resources.get(),
+ context);
+
+ DEBUG_RECON("finished decoding trace");
+}
+
+VkReconstruction::ApiHandle VkReconstruction::createApiInfo() {
+ auto handle = mApiTrace.add(ApiInfo(), 1);
+ return handle;
+}
+
+void VkReconstruction::destroyApiInfo(VkReconstruction::ApiHandle h) {
+ auto item = mApiTrace.get(h);
+
+ if (!item) return;
+
+ item->traceBytes = 0;
+ item->createdHandles.clear();
+
+ mApiTrace.remove(h);
+}
+
+VkReconstruction::ApiInfo* VkReconstruction::getApiInfo(VkReconstruction::ApiHandle h) {
+ return mApiTrace.get(h);
+}
+
+void VkReconstruction::setApiTrace(VkReconstruction::ApiInfo* apiInfo, uint32_t opCode,
+ const uint8_t* traceBegin, size_t traceBytes) {
+ if (apiInfo->trace.size() < traceBytes) apiInfo->trace.resize(traceBytes);
+ apiInfo->opCode = opCode;
+ memcpy(apiInfo->trace.data(), traceBegin, traceBytes);
+ apiInfo->traceBytes = traceBytes;
+}
+
+void VkReconstruction::dump() {
+ fprintf(stderr, "%s: api trace dump\n", __func__);
+
+ size_t traceBytesTotal = 0;
+
+ mApiTrace.forEachLiveEntry_const(
+ [&traceBytesTotal](bool live, uint64_t handle, const ApiInfo& info) {
+ fprintf(stderr, "VkReconstruction::%s: api handle 0x%llx: %s\n", __func__,
+ (unsigned long long)handle, api_opcode_to_string(info.opCode));
+ traceBytesTotal += info.traceBytes;
+ });
+
+ mHandleReconstructions.forEachLiveComponent_const(
+ [this](bool live, uint64_t componentHandle, uint64_t entityHandle,
+ const HandleReconstruction& reconstruction) {
+ fprintf(stderr, "VkReconstruction::%s: %p handle 0x%llx api refs:\n", __func__, this,
+ (unsigned long long)entityHandle);
+ for (auto apiHandle : reconstruction.apiRefs) {
+ auto apiInfo = mApiTrace.get(apiHandle);
+ const char* apiName = apiInfo ? api_opcode_to_string(apiInfo->opCode) : "unalloced";
+ fprintf(stderr, "VkReconstruction::%s: 0x%llx: %s\n", __func__,
+ (unsigned long long)apiHandle, apiName);
+ for (auto createdHandle : apiInfo->createdHandles) {
+ fprintf(stderr, "VkReconstruction::%s: created 0x%llx\n", __func__,
+ (unsigned long long)createdHandle);
+ }
+ }
+ });
+
+ mHandleModifications.forEachLiveComponent_const([this](bool live, uint64_t componentHandle,
+ uint64_t entityHandle,
+ const HandleModification& modification) {
+ fprintf(stderr, "VkReconstruction::%s: mod: %p handle 0x%llx api refs:\n", __func__, this,
+ (unsigned long long)entityHandle);
+ for (auto apiHandle : modification.apiRefs) {
+ auto apiInfo = mApiTrace.get(apiHandle);
+ const char* apiName = apiInfo ? api_opcode_to_string(apiInfo->opCode) : "unalloced";
+ fprintf(stderr, "VkReconstruction::%s: mod: 0x%llx: %s\n", __func__,
+ (unsigned long long)apiHandle, apiName);
+ }
+ });
+
+ fprintf(stderr, "%s: total trace bytes: %zu\n", __func__, traceBytesTotal);
+}
+
+void VkReconstruction::addHandles(const uint64_t* toAdd, uint32_t count) {
+ if (!toAdd) return;
+
+ for (uint32_t i = 0; i < count; ++i) {
+ DEBUG_RECON("add 0x%llx", (unsigned long long)toAdd[i]);
+ mHandleReconstructions.add(toAdd[i], HandleReconstruction());
+ }
+}
+
+void VkReconstruction::removeHandles(const uint64_t* toRemove, uint32_t count) {
+ if (!toRemove) return;
+
+ forEachHandleDeleteApi(toRemove, count);
+
+ for (uint32_t i = 0; i < count; ++i) {
+ DEBUG_RECON("remove 0x%llx", (unsigned long long)toRemove[i]);
+ auto item = mHandleReconstructions.get(toRemove[i]);
+
+ if (!item) continue;
+
+ mHandleReconstructions.remove(toRemove[i]);
+
+ removeHandles(item->childHandles.data(), item->childHandles.size());
+
+ item->childHandles.clear();
+ }
+}
+
+void VkReconstruction::forEachHandleAddApi(const uint64_t* toProcess, uint32_t count,
+ uint64_t apiHandle) {
+ if (!toProcess) return;
+
+ for (uint32_t i = 0; i < count; ++i) {
+ auto item = mHandleReconstructions.get(toProcess[i]);
+
+ if (!item) continue;
+
+ item->apiRefs.push_back(apiHandle);
+ }
+}
+
+void VkReconstruction::forEachHandleDeleteApi(const uint64_t* toProcess, uint32_t count) {
+ if (!toProcess) return;
+
+ for (uint32_t i = 0; i < count; ++i) {
+ auto item = mHandleReconstructions.get(toProcess[i]);
+
+ if (!item) continue;
+
+ for (auto handle : item->apiRefs) {
+ destroyApiInfo(handle);
+ }
+
+ item->apiRefs.clear();
+
+ auto modifyItem = mHandleModifications.get(toProcess[i]);
+
+ if (!modifyItem) continue;
+
+ modifyItem->apiRefs.clear();
+ }
+}
+
+void VkReconstruction::addHandleDependency(const uint64_t* handles, uint32_t count,
+ uint64_t parentHandle) {
+ if (!handles) return;
+
+ auto item = mHandleReconstructions.get(parentHandle);
+
+ if (!item) return;
+
+ for (uint32_t i = 0; i < count; ++i) {
+ item->childHandles.push_back(handles[i]);
+ }
+}
+
+void VkReconstruction::setCreatedHandlesForApi(uint64_t apiHandle, const uint64_t* created,
+ uint32_t count) {
+ if (!created) return;
+
+ auto item = mApiTrace.get(apiHandle);
+
+ if (!item) return;
+
+ for (uint32_t i = 0; i < count; ++i) {
+ item->createdHandles.push_back(created[i]);
+ }
+}
+
+void VkReconstruction::forEachHandleAddModifyApi(const uint64_t* toProcess, uint32_t count,
+ uint64_t apiHandle) {
+ if (!toProcess) return;
+
+ for (uint32_t i = 0; i < count; ++i) {
+ mHandleModifications.add(toProcess[i], HandleModification());
+
+ auto item = mHandleModifications.get(toProcess[i]);
+
+ if (!item) continue;
+
+ item->apiRefs.push_back(apiHandle);
+ }
+}
+
+std::vector<uint64_t> VkReconstruction::getOrderedUniqueModifyApis() const {
+ std::vector<HandleModification> orderedModifies;
+
+ // Now add all handle modifications to the trace, ordered by the .order field.
+ mHandleModifications.forEachLiveComponent_const(
+ [&orderedModifies](bool live, uint64_t componentHandle, uint64_t entityHandle,
+ const HandleModification& mod) { orderedModifies.push_back(mod); });
+
+ // Sort by the |order| field for each modify API
+ // since it may be important to apply modifies in a particular
+ // order (e.g., when dealing with descriptor set updates
+ // or commands in a command buffer).
+ std::sort(orderedModifies.begin(), orderedModifies.end(),
+ [](const HandleModification& lhs, const HandleModification& rhs) {
+ return lhs.order < rhs.order;
+ });
+
+ std::unordered_set<uint64_t> usedModifyApis;
+ std::vector<uint64_t> orderedUniqueModifyApis;
+
+ for (const auto& mod : orderedModifies) {
+ for (auto apiRef : mod.apiRefs) {
+ if (usedModifyApis.find(apiRef) == usedModifyApis.end()) {
+ orderedUniqueModifyApis.push_back(apiRef);
+ usedModifyApis.insert(apiRef);
+ }
+ }
+ }
+
+ return orderedUniqueModifyApis;
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VkReconstruction.h b/src/gfxstream/host/vulkan/VkReconstruction.h
new file mode 100644
index 00000000000..beb58167e74
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VkReconstruction.h
@@ -0,0 +1,101 @@
+// 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.
+#pragma once
+
+#include "VulkanHandleMapping.h"
+#include "VulkanHandles.h"
+#include "aemu/base/containers/EntityManager.h"
+#include "aemu/base/HealthMonitor.h"
+#include "aemu/base/files/Stream.h"
+#include "common/goldfish_vk_marshaling.h"
+#include "utils/GfxApiLogger.h"
+
+namespace gfxstream {
+namespace vk {
+
+// A class that captures all important data structures for
+// reconstructing a Vulkan system state via trimmed API record and replay.
+class VkReconstruction {
+ public:
+ VkReconstruction();
+
+ void save(android::base::Stream* stream);
+ void load(android::base::Stream* stream, emugl::GfxApiLogger& gfxLogger,
+ emugl::HealthMonitor<>* healthMonitor);
+
+ struct ApiInfo {
+ // Fast
+ uint32_t opCode;
+ std::vector<uint8_t> trace;
+ size_t traceBytes = 0;
+ // Book-keeping for which handles were created by this API
+ std::vector<uint64_t> createdHandles;
+ };
+
+ using ApiTrace = android::base::EntityManager<32, 16, 16, ApiInfo>;
+ using ApiHandle = ApiTrace::EntityHandle;
+
+ struct HandleReconstruction {
+ std::vector<ApiHandle> apiRefs;
+ std::vector<uint64_t> childHandles;
+ };
+
+ using HandleReconstructions =
+ android::base::UnpackedComponentManager<32, 16, 16, HandleReconstruction>;
+
+ struct HandleModification {
+ std::vector<ApiHandle> apiRefs;
+ uint32_t order = 0;
+ };
+
+ using HandleModifications =
+ android::base::UnpackedComponentManager<32, 16, 16, HandleModification>;
+
+ ApiHandle createApiInfo();
+ void destroyApiInfo(ApiHandle h);
+
+ ApiInfo* getApiInfo(ApiHandle h);
+
+ void setApiTrace(ApiInfo* apiInfo, uint32_t opcode, const uint8_t* traceBegin,
+ size_t traceBytes);
+
+ void dump();
+
+ void addHandles(const uint64_t* toAdd, uint32_t count);
+ void removeHandles(const uint64_t* toRemove, uint32_t count);
+
+ void forEachHandleAddApi(const uint64_t* toProcess, uint32_t count, uint64_t apiHandle);
+ void forEachHandleDeleteApi(const uint64_t* toProcess, uint32_t count);
+
+ void addHandleDependency(const uint64_t* handles, uint32_t count, uint64_t parentHandle);
+
+ void setCreatedHandlesForApi(uint64_t apiHandle, const uint64_t* created, uint32_t count);
+
+ void forEachHandleAddModifyApi(const uint64_t* toProcess, uint32_t count, uint64_t apiHandle);
+
+ void setModifiedHandlesForApi(uint64_t apiHandle, const uint64_t* modified, uint32_t count);
+
+ private:
+ std::vector<uint64_t> getOrderedUniqueModifyApis() const;
+
+ ApiTrace mApiTrace;
+
+ HandleReconstructions mHandleReconstructions;
+ HandleModifications mHandleModifications;
+
+ std::vector<uint8_t> mLoadedTrace;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VulkanDispatch.cpp b/src/gfxstream/host/vulkan/VulkanDispatch.cpp
new file mode 100644
index 00000000000..7d2b6a5ee82
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VulkanDispatch.cpp
@@ -0,0 +1,376 @@
+// 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 "VulkanDispatch.h"
+
+#include "aemu/base/synchronization/Lock.h"
+#include "aemu/base/files/PathUtils.h"
+#include "aemu/base/SharedLibrary.h"
+#include "aemu/base/system/System.h"
+#include "host-common/misc.h"
+
+using android::base::AutoLock;
+using android::base::Lock;
+using android::base::pj;
+
+namespace gfxstream {
+namespace vk {
+
+static void setIcdPath(const std::string& path) {
+ if (android::base::pathExists(path.c_str())) {
+ // LOG(VERBOSE) << "setIcdPath: path exists: " << path;
+ } else {
+ // LOG(VERBOSE) << "setIcdPath: path doesn't exist: " << path;
+ }
+ android::base::setEnvironmentVariable("VK_ICD_FILENAMES", path);
+}
+
+static std::string icdJsonNameToProgramAndLauncherPaths(const std::string& icdFilename) {
+ std::string suffix = pj({"lib64", "vulkan", icdFilename});
+#if defined(_WIN32)
+ const char* sep = ";";
+#else
+ const char* sep = ":";
+#endif
+ return pj({android::base::getProgramDirectory(), suffix}) + sep +
+ pj({android::base::getLauncherDirectory(), suffix});
+}
+
+static const char* getTestIcdFilename() {
+#if defined(__APPLE__)
+ return "libvk_swiftshader.dylib";
+#elif defined(__linux__) || defined(__QNX__)
+ return "libvk_swiftshader.so";
+#elif defined(_WIN32) || defined(_MSC_VER)
+ return "vk_swiftshader.dll";
+#else
+#error Host operating system not supported
+#endif
+}
+
+static void initIcdPaths(bool forTesting) {
+ auto androidIcd = android::base::getEnvironmentVariable("ANDROID_EMU_VK_ICD");
+ if (androidIcd == "") {
+ // Rely on user to set VK_ICD_FILENAMES
+ return;
+ } else {
+ if (forTesting || androidIcd == "swiftshader") {
+ auto res = pj({android::base::getProgramDirectory(), "lib64", "vulkan"});
+ // LOG(VERBOSE) << "In test environment or ICD set to swiftshader, using "
+ // "Swiftshader ICD";
+ auto libPath = pj(
+ {android::base::getProgramDirectory(), "lib64", "vulkan", getTestIcdFilename()});
+ ;
+ if (android::base::pathExists(libPath.c_str())) {
+ // LOG(VERBOSE) << "Swiftshader library exists";
+ } else {
+ // LOG(VERBOSE) << "Swiftshader library doesn't exist, trying launcher path";
+ libPath = pj({android::base::getLauncherDirectory(), "lib64", "vulkan",
+ getTestIcdFilename()});
+ ;
+ if (android::base::pathExists(libPath.c_str())) {
+ // LOG(VERBOSE) << "Swiftshader library found in launcher path";
+ } else {
+ // LOG(VERBOSE) << "Swiftshader library not found in program nor launcher path";
+ }
+ }
+ setIcdPath(icdJsonNameToProgramAndLauncherPaths("vk_swiftshader_icd.json"));
+ android::base::setEnvironmentVariable("ANDROID_EMU_VK_ICD", "swiftshader");
+ } else {
+ // LOG(VERBOSE) << "Not in test environment. ICD (blank for default): ["
+ // << androidIcd << "]";
+ // Mac: Use MoltenVK by default unless GPU mode is set to swiftshader,
+ // and switch between that and gfx-rs libportability-icd depending on
+ // the environment variable setting.
+#ifdef __APPLE__
+ if (androidIcd == "portability") {
+ setIcdPath(icdJsonNameToProgramAndLauncherPaths("portability-macos.json"));
+ } else if (androidIcd == "portability-debug") {
+ setIcdPath(icdJsonNameToProgramAndLauncherPaths("portability-macos-debug.json"));
+ } else {
+ if (androidIcd == "swiftshader") {
+ setIcdPath(icdJsonNameToProgramAndLauncherPaths("vk_swiftshader_icd.json"));
+ android::base::setEnvironmentVariable("ANDROID_EMU_VK_ICD", "swiftshader");
+ } else {
+ setIcdPath(icdJsonNameToProgramAndLauncherPaths("MoltenVK_icd.json"));
+ android::base::setEnvironmentVariable("ANDROID_EMU_VK_ICD", "moltenvk");
+ }
+ }
+#else
+ // By default, on other platforms, just use whatever the system
+ // is packing.
+#endif
+ }
+ }
+}
+
+class SharedLibraries {
+ public:
+ explicit SharedLibraries(size_t sizeLimit = 1) : mSizeLimit(sizeLimit) {}
+
+ size_t size() const { return mLibs.size(); }
+
+ bool addLibrary(const std::string& path) {
+ if (size() >= mSizeLimit) {
+ fprintf(stderr, "cannot add library %s: full\n", path.c_str());
+ return false;
+ }
+
+ auto library = android::base::SharedLibrary::open(path.c_str());
+ if (library) {
+ mLibs.push_back(library);
+ fprintf(stderr, "added library %s\n", path.c_str());
+ return true;
+ } else {
+ fprintf(stderr, "cannot add library %s: failed\n", path.c_str());
+ return false;
+ }
+ }
+
+ bool addFirstAvailableLibrary(const std::vector<std::string>& possiblePaths) {
+ for (const std::string& possiblePath : possiblePaths) {
+ if (addLibrary(possiblePath)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ ~SharedLibraries() = default;
+
+ void* dlsym(const char* name) {
+ for (const auto& lib : mLibs) {
+ void* funcPtr = reinterpret_cast<void*>(lib->findSymbol(name));
+ if (funcPtr) {
+ return funcPtr;
+ }
+ }
+ return nullptr;
+ }
+
+ private:
+ size_t mSizeLimit;
+ std::vector<android::base::SharedLibrary*> mLibs;
+};
+
+static constexpr size_t getVulkanLibraryNumLimits() {
+ // macOS may have both Vulkan loader (for non MoltenVK-specific functions) and
+ // MoltenVK library (only for MoltenVK-specific vk...MVK functions) loaded at
+ // the same time. So there could be at most 2 libraries loaded. On other systems
+ // only one Vulkan loader is allowed.
+#ifdef __APPLE__
+ return 2;
+#else
+ return 1;
+#endif
+}
+
+class VulkanDispatchImpl {
+ public:
+ VulkanDispatchImpl() : mVulkanLibs(getVulkanLibraryNumLimits()) {}
+
+ void initialize(bool forTesting);
+
+ static std::vector<std::string> getPossibleLoaderPathBasenames() {
+#if defined(__APPLE__)
+ return std::vector<std::string>{"libvulkan.dylib"};
+#elif defined(__linux__)
+ // When running applications with Gfxstream as the Vulkan ICD, i.e. with
+ //
+ // App -> Vulkan Loader -> Gfxstream ICD -> Vulkan Loader -> Driver ICD
+ //
+ // Gfxstream needs to use a different nested loader library to avoid issues with
+ // conflating/deadlock with the first level loader. Detect that here and look for
+ // a "libvulkan_gfxstream" which can be generated with the provided
+ // scripts/build-nested-vulkan-loader.sh script.
+ const std::vector<std::string> nestedVulkanLoaderVars = {
+ "GFXSTREAM_VK_ADD_DRIVER_FILES",
+ "GFXSTREAM_VK_ADD_LAYER_PATH",
+ "GFXSTREAM_VK_DRIVER_FILES",
+ "GFXSTREAM_VK_ICD_FILENAMES",
+ "GFXSTREAM_VK_INSTANCE_LAYERS",
+ "GFXSTREAM_VK_LAYER_PATH",
+ "GFXSTREAM_VK_LAYER_PATH",
+ "GFXSTREAM_VK_LOADER_DEBUG",
+ "GFXSTREAM_VK_LOADER_DRIVERS_DISABLE",
+ "GFXSTREAM_VK_LOADER_DRIVERS_SELECT",
+ "GFXSTREAM_VK_LOADER_LAYERS_ALLOW",
+ "GFXSTREAM_VK_LOADER_LAYERS_DISABLE",
+ "GFXSTREAM_VK_LOADER_LAYERS_ENABLE",
+ };
+ bool usesNestedVulkanLoader = false;
+ for (const std::string& var : nestedVulkanLoaderVars) {
+ if (android::base::getEnvironmentVariable(var) != "") {
+ usesNestedVulkanLoader = true;
+ break;
+ }
+ }
+ if (usesNestedVulkanLoader) {
+ return std::vector<std::string>{
+ "libvulkan_gfxstream.so",
+ "libvulkan_gfxstream.so.1",
+ };
+ } else {
+ return std::vector<std::string>{
+ "libvulkan.so",
+ "libvulkan.so.1",
+ };
+ }
+
+#elif defined(_WIN32)
+ return std::vector<std::string>{"vulkan-1.dll"};
+#else
+#error "Unhandled platform in VulkanDispatchImpl."
+#endif
+ }
+
+ std::vector<std::string> getPossibleLoaderPaths() {
+ const std::string explicitPath =
+ android::base::getEnvironmentVariable("ANDROID_EMU_VK_LOADER_PATH");
+ if (!explicitPath.empty()) {
+ return {
+ explicitPath,
+ };
+ }
+
+ const std::vector<std::string> possibleBasenames =
+ getPossibleLoaderPathBasenames();
+
+ const std::string explicitIcd =
+ android::base::getEnvironmentVariable("ANDROID_EMU_VK_ICD");
+
+#ifdef _WIN32
+ constexpr const bool isWindows = true;
+#else
+ constexpr const bool isWindows = false;
+#endif
+ if (explicitIcd.empty() || isWindows) {
+ return possibleBasenames;
+ }
+
+ std::vector<std::string> possibleDirectories;
+
+ if (mForTesting || explicitIcd == "mock") {
+ possibleDirectories = {
+ pj({android::base::getProgramDirectory(), "testlib64"}),
+ pj({android::base::getLauncherDirectory(), "testlib64"}),
+ };
+ }
+
+ possibleDirectories.push_back(
+ pj({android::base::getProgramDirectory(), "lib64", "vulkan"}));
+ possibleDirectories.push_back(
+ pj({android::base::getLauncherDirectory(), "lib64", "vulkan"}));
+
+ std::vector<std::string> possiblePaths;
+ for (const std::string& possibleDirectory : possibleDirectories) {
+ for (const std::string& possibleBasename : possibleBasenames) {
+ possiblePaths.push_back(pj({possibleDirectory, possibleBasename}));
+ }
+ }
+ return possiblePaths;
+ }
+
+#ifdef __APPLE__
+ std::vector<std::string> getPossibleMoltenVkPaths() {
+ const std::string explicitPath =
+ android::base::getEnvironmentVariable("ANDROID_EMU_VK_LOADER_PATH");
+ if (!explicitPath.empty()) {
+ return {
+ explicitPath,
+ };
+ }
+
+ const std::string& customIcd = android::base::getEnvironmentVariable("ANDROID_EMU_VK_ICD");
+
+ // Skip loader when using MoltenVK as this gives us access to
+ // VK_MVK_moltenvk, which is required for external memory support.
+ if (!mForTesting && customIcd == "moltenvk") {
+ return {
+ pj({android::base::getProgramDirectory(), "lib64", "vulkan", "libMoltenVK.dylib"}),
+ pj({android::base::getLauncherDirectory(), "lib64", "vulkan", "libMoltenVK.dylib"}),
+ };
+ }
+
+ return {};
+ }
+#endif
+
+ void* dlopen() {
+ if (mVulkanLibs.size() == 0) {
+ mVulkanLibs.addFirstAvailableLibrary(getPossibleLoaderPaths());
+
+#ifdef __APPLE__
+ // On macOS it is possible that we are using MoltenVK as the
+ // ICD. In that case we need to add MoltenVK libraries to
+ // mSharedLibs to use MoltenVK-specific functions.
+ mVulkanLibs.addFirstAvailableLibrary(getPossibleMoltenVkPaths());
+#endif
+ }
+ return static_cast<void*>(&mVulkanLibs);
+ }
+
+ void* dlsym(void* lib, const char* name) {
+ return (void*)((SharedLibraries*)(lib))->dlsym(name);
+ }
+
+ VulkanDispatch* dispatch() { return &mDispatch; }
+
+ private:
+ Lock mLock;
+ bool mForTesting = false;
+ bool mInitialized = false;
+ VulkanDispatch mDispatch;
+ SharedLibraries mVulkanLibs;
+};
+
+VulkanDispatchImpl* sVulkanDispatchImpl() {
+ static VulkanDispatchImpl* impl = new VulkanDispatchImpl;
+ return impl;
+}
+
+static void* sVulkanDispatchDlOpen() { return sVulkanDispatchImpl()->dlopen(); }
+
+static void* sVulkanDispatchDlSym(void* lib, const char* sym) {
+ return sVulkanDispatchImpl()->dlsym(lib, sym);
+}
+
+void VulkanDispatchImpl::initialize(bool forTesting) {
+ AutoLock lock(mLock);
+
+ if (mInitialized) {
+ return;
+ }
+
+ mForTesting = forTesting;
+ initIcdPaths(mForTesting);
+
+ init_vulkan_dispatch_from_system_loader(sVulkanDispatchDlOpen, sVulkanDispatchDlSym,
+ &mDispatch);
+
+ mInitialized = true;
+}
+
+VulkanDispatch* vkDispatch(bool forTesting) {
+ sVulkanDispatchImpl()->initialize(forTesting);
+ return sVulkanDispatchImpl()->dispatch();
+}
+
+bool vkDispatchValid(const VulkanDispatch* vk) {
+ return vk->vkEnumerateInstanceExtensionProperties != nullptr ||
+ vk->vkGetInstanceProcAddr != nullptr || vk->vkGetDeviceProcAddr != nullptr;
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VulkanDispatch.h b/src/gfxstream/host/vulkan/VulkanDispatch.h
new file mode 100644
index 00000000000..2c393808969
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VulkanDispatch.h
@@ -0,0 +1,25 @@
+// 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_vk_dispatch.h"
+
+namespace gfxstream {
+namespace vk {
+
+VulkanDispatch* vkDispatch(bool forTesting = false);
+bool vkDispatchValid(const VulkanDispatch* vk);
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VulkanHandleMapping.cpp b/src/gfxstream/host/vulkan/VulkanHandleMapping.cpp
new file mode 100644
index 00000000000..1b5c6a6691e
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VulkanHandleMapping.cpp
@@ -0,0 +1,40 @@
+// 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 "VulkanHandleMapping.h"
+
+#include <vulkan/vulkan.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/src/gfxstream/host/vulkan/VulkanHandleMapping.h b/src/gfxstream/host/vulkan/VulkanHandleMapping.h
new file mode 100644
index 00000000000..2ea379f8bf5
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VulkanHandleMapping.h
@@ -0,0 +1,79 @@
+// 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 "VulkanDispatch.h"
+#include "VulkanHandles.h"
+
+namespace gfxstream {
+namespace vk {
+
+class VkDecoderGlobalState;
+
+class VulkanHandleMapping {
+ public:
+ VulkanHandleMapping(VkDecoderGlobalState* state) : m_state(state) {}
+ 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)
+ protected:
+ VkDecoderGlobalState* m_state;
+};
+
+class DefaultHandleMapping : public VulkanHandleMapping {
+ public:
+ DefaultHandleMapping() : VulkanHandleMapping(nullptr) {}
+ 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)
+};
+
+#define DEFINE_BOXED_DISPATCHABLE_HANDLE_GLOBAL_API_DECL(type) \
+ type unbox_##type(type boxed); \
+ type unboxed_to_boxed_##type(type boxed); \
+ void delete_##type(type boxed); \
+ VulkanDispatch* dispatch_##type(type boxed);
+
+GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_DISPATCHABLE_HANDLE_GLOBAL_API_DECL)
+
+#define DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_GLOBAL_API_DECL(type) \
+ type new_boxed_non_dispatchable_##type(type underlying); \
+ void delete_##type(type boxed); \
+ void delayed_delete_##type(type boxed, VkDevice device, std::function<void()> callback); \
+ void set_boxed_non_dispatchable_##type(type boxed, type underlying); \
+ type unbox_##type(type boxed); \
+ type unboxed_to_boxed_non_dispatchable_##type(type boxed);
+
+GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(DEFINE_BOXED_NON_DISPATCHABLE_HANDLE_GLOBAL_API_DECL)
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VulkanHandles.h b/src/gfxstream/host/vulkan/VulkanHandles.h
new file mode 100644
index 00000000000..d6578ec16ed
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VulkanHandles.h
@@ -0,0 +1,110 @@
+// 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>
+
+#define GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(f) \
+ f(VkInstance) \
+ f(VkPhysicalDevice) \
+ f(VkDevice) \
+ f(VkQueue) \
+ f(VkCommandBuffer)
+
+#define GOLDFISH_VK_LIST_TRIVIAL_NON_DISPATCHABLE_HANDLE_TYPES(f) \
+ f(VkBuffer) \
+ f(VkBufferView) \
+ f(VkImage) \
+ f(VkImageView) \
+ f(VkShaderModule) \
+ f(VkDescriptorPool) \
+ f(VkDescriptorSetLayout) \
+ f(VkDescriptorSet) \
+ f(VkSampler) \
+ f(VkPipeline) \
+ f(VkPipelineCache) \
+ f(VkPipelineLayout) \
+ f(VkRenderPass) \
+ f(VkFramebuffer) \
+ f(VkCommandPool) \
+ f(VkFence) \
+ f(VkSemaphore) \
+ f(VkEvent) \
+ f(VkQueryPool) \
+ f(VkSamplerYcbcrConversion) \
+ f(VkDescriptorUpdateTemplate) \
+ f(VkSurfaceKHR) \
+ f(VkSwapchainKHR) \
+ f(VkDisplayKHR) \
+ f(VkDisplayModeKHR) \
+ f(VkValidationCacheEXT) \
+ f(VkDebugReportCallbackEXT) \
+ f(VkDebugUtilsMessengerEXT) \
+ f(VkAccelerationStructureNV) \
+ f(VkIndirectCommandsLayoutNV) \
+ f(VkAccelerationStructureKHR) \
+ f(VkCuModuleNVX) \
+ f(VkCuFunctionNVX) \
+ f(VkMicromapEXT)
+
+#define GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(f) \
+ f(VkDeviceMemory) \
+ 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_HANDLE_TYPES_BY_STAGE(f) \
+ f(VkInstance) \
+ f(VkPhysicalDevice) \
+ f(VkDevice) \
+ f(VkQueue) \
+ f(VkBuffer) \
+ f(VkImage) \
+ f(VkDeviceMemory) \
+ f(VkBufferView) \
+ f(VkImageView) \
+ f(VkShaderModule) \
+ f(VkDescriptorSetLayout) \
+ f(VkDescriptorPool) \
+ f(VkDescriptorSet) \
+ f(VkSampler) \
+ f(VkSamplerYcbcrConversion) \
+ f(VkDescriptorUpdateTemplate) \
+ f(VkRenderPass) \
+ f(VkFramebuffer) \
+ f(VkPipelineLayout) \
+ f(VkPipelineCache) \
+ f(VkPipeline) \
+ f(VkFence) \
+ f(VkSemaphore) \
+ f(VkEvent) \
+ f(VkQueryPool) \
+ f(VkSurfaceKHR) \
+ f(VkSwapchainKHR) \
+ f(VkDisplayKHR) \
+ f(VkDisplayModeKHR) \
+ f(VkValidationCacheEXT) \
+ f(VkDebugReportCallbackEXT) \
+ f(VkDebugUtilsMessengerEXT) \
+ f(VkCommandPool) \
+ f(VkCommandBuffer) \
+ f(VkAccelerationStructureNV) \
+ f(VkIndirectCommandsLayoutNV) \
+ f(VkAccelerationStructureKHR) \
+ f(VkCuModuleNVX) \
+ f(VkCuFunctionNVX) \
+ f(VkMicromapEXT)
diff --git a/src/gfxstream/host/vulkan/VulkanStream.cpp b/src/gfxstream/host/vulkan/VulkanStream.cpp
new file mode 100644
index 00000000000..dc99c97cc51
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VulkanStream.cpp
@@ -0,0 +1,224 @@
+// 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 "VulkanStream.h"
+
+#include <inttypes.h>
+
+#include <vector>
+
+#include "render-utils/IOStream.h"
+#include "aemu/base/BumpPool.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/feature_control.h"
+
+namespace gfxstream {
+namespace vk {
+
+#define E(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+VulkanStream::VulkanStream(IOStream* stream) : mStream(stream) {
+ unsetHandleMapping();
+
+ if (feature_is_enabled(kFeature_VulkanNullOptionalStrings)) {
+ mFeatureBits |= VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT;
+ }
+ if (feature_is_enabled(kFeature_VulkanIgnoredHandles)) {
+ mFeatureBits |= VULKAN_STREAM_FEATURE_IGNORED_HANDLES_BIT;
+ }
+ if (feature_is_enabled(kFeature_VulkanShaderFloat16Int8)) {
+ mFeatureBits |= VULKAN_STREAM_FEATURE_SHADER_FLOAT16_INT8_BIT;
+ }
+}
+
+VulkanStream::~VulkanStream() = default;
+
+void VulkanStream::setStream(IOStream* stream) { mStream = stream; }
+
+bool VulkanStream::valid() { return true; }
+
+void VulkanStream::alloc(void** ptrAddr, size_t bytes) {
+ if (!bytes) {
+ *ptrAddr = nullptr;
+ return;
+ }
+
+ *ptrAddr = mPool.alloc(bytes);
+
+ if (!*ptrAddr) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "alloc failed. Wanted size: " << bytes;
+ }
+}
+
+void VulkanStream::loadStringInPlace(char** forOutput) {
+ size_t len = getBe32();
+
+ alloc((void**)forOutput, len + 1);
+
+ memset(*forOutput, 0x0, len + 1);
+
+ if (len > 0) read(*forOutput, len);
+}
+
+void VulkanStream::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 VulkanStream::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);
+
+ if (len == UINT32_MAX) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "VulkanStream can't allocate UINT32_MAX bytes";
+ }
+
+ alloc((void**)forOutput, len + 1);
+
+ if (len > 0) {
+ memcpy(*forOutput, *streamPtr, len);
+ *streamPtr += len;
+ }
+ (*forOutput)[len] = 0;
+}
+
+void VulkanStream::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 VulkanStream::read(void* buffer, size_t size) {
+ commitWrite();
+ if (!mStream->readFully(buffer, size)) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Could not read back " << size << " bytes";
+ }
+ return size;
+}
+
+size_t VulkanStream::remainingWriteBufferSize() const { return mWriteBuffer.size() - mWritePos; }
+
+ssize_t VulkanStream::bufferedWrite(const void* buffer, size_t size) {
+ if (size > remainingWriteBufferSize()) {
+ mWriteBuffer.resize((mWritePos + size) << 1);
+ }
+ memcpy(mWriteBuffer.data() + mWritePos, buffer, size);
+ mWritePos += size;
+ return size;
+}
+
+ssize_t VulkanStream::write(const void* buffer, size_t size) { return bufferedWrite(buffer, size); }
+
+void VulkanStream::commitWrite() {
+ if (!valid()) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Tried to commit write to vulkan pipe with invalid pipe!";
+ }
+
+ int written = mStream->writeFully(mWriteBuffer.data(), mWritePos);
+
+ if (written) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "Did not write exactly " << mWritePos << " bytes!";
+ }
+ mWritePos = 0;
+}
+
+void VulkanStream::clearPool() { mPool.freeAll(); }
+
+void VulkanStream::setHandleMapping(VulkanHandleMapping* mapping) {
+ mCurrentHandleMapping = mapping;
+}
+
+void VulkanStream::unsetHandleMapping() { mCurrentHandleMapping = &mDefaultHandleMapping; }
+
+VulkanHandleMapping* VulkanStream::handleMapping() const { return mCurrentHandleMapping; }
+
+uint32_t VulkanStream::getFeatureBits() const { return mFeatureBits; }
+
+android::base::BumpPool* VulkanStream::pool() { return &mPool; }
+
+VulkanMemReadingStream::VulkanMemReadingStream(uint8_t* start)
+ : VulkanStream(nullptr), mStart(start) {}
+
+VulkanMemReadingStream::~VulkanMemReadingStream() {}
+
+void VulkanMemReadingStream::setBuf(uint8_t* buf) {
+ mStart = buf;
+ mReadPos = 0;
+ resetTrace();
+}
+
+uint8_t* VulkanMemReadingStream::getBuf() { return mStart; }
+
+void VulkanMemReadingStream::setReadPos(uintptr_t pos) { mReadPos = pos; }
+
+ssize_t VulkanMemReadingStream::read(void* buffer, size_t size) {
+ memcpy(buffer, mStart + mReadPos, size);
+ mReadPos += size;
+ return size;
+}
+
+ssize_t VulkanMemReadingStream::write(const void* buffer, size_t size) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER))
+ << "VulkanMemReadingStream does not support writing";
+}
+
+uint8_t* VulkanMemReadingStream::beginTrace() {
+ resetTrace();
+ return mTraceStart;
+}
+
+size_t VulkanMemReadingStream::endTrace() {
+ uintptr_t current = (uintptr_t)(mStart + mReadPos);
+ size_t res = (size_t)(current - (uintptr_t)mTraceStart);
+ return res;
+}
+
+void VulkanMemReadingStream::resetTrace() { mTraceStart = mStart + mReadPos; }
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/VulkanStream.h b/src/gfxstream/host/vulkan/VulkanStream.h
new file mode 100644
index 00000000000..358432b1216
--- /dev/null
+++ b/src/gfxstream/host/vulkan/VulkanStream.h
@@ -0,0 +1,116 @@
+// 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 <inttypes.h>
+
+#include <memory>
+#include <vector>
+
+#include "VulkanHandleMapping.h"
+#include "aemu/base/BumpPool.h"
+#include "aemu/base/files/Stream.h"
+#include "aemu/base/files/StreamSerializing.h"
+#include "goldfish_vk_private_defs.h"
+
+#define E(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)
+
+namespace android {
+namespace base {
+class BumpPool;
+} // namespace base
+} // namespace android
+
+namespace gfxstream {
+class IOStream;
+} // namespace gfxstream
+
+namespace gfxstream {
+namespace vk {
+
+class VulkanStream : public android::base::Stream {
+ public:
+ VulkanStream(IOStream* stream);
+ ~VulkanStream();
+
+ void setStream(IOStream* stream);
+
+ // 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);
+
+ virtual ssize_t read(void* buffer, size_t size);
+ virtual ssize_t write(const void* buffer, size_t size);
+
+ void commitWrite();
+
+ // Frees everything that got alloc'ed.
+ void clearPool();
+
+ void setHandleMapping(VulkanHandleMapping* mapping);
+ void unsetHandleMapping();
+ VulkanHandleMapping* handleMapping() const;
+
+ uint32_t getFeatureBits() const;
+
+ android::base::BumpPool* pool();
+
+ private:
+ size_t remainingWriteBufferSize() const;
+ ssize_t bufferedWrite(const void* buffer, size_t size);
+ android::base::BumpPool mPool;
+ size_t mWritePos = 0;
+ std::vector<uint8_t> mWriteBuffer;
+ IOStream* mStream = nullptr;
+ DefaultHandleMapping mDefaultHandleMapping;
+ VulkanHandleMapping* mCurrentHandleMapping;
+ uint32_t mFeatureBits = 0;
+};
+
+class VulkanMemReadingStream : public VulkanStream {
+ public:
+ VulkanMemReadingStream(uint8_t* start);
+ ~VulkanMemReadingStream();
+
+ void setBuf(uint8_t* buf);
+ uint8_t* getBuf();
+ void setReadPos(uintptr_t pos);
+
+ ssize_t read(void* buffer, size_t size) override;
+ ssize_t write(const void* buffer, size_t size) override;
+
+ uint8_t* beginTrace();
+ size_t endTrace();
+
+ private:
+ void resetTrace();
+
+ uint8_t* mStart;
+ uint8_t* mTraceStart;
+ uintptr_t mReadPos = 0;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/cereal/CMakeLists.txt b/src/gfxstream/host/vulkan/cereal/CMakeLists.txt
new file mode 100644
index 00000000000..81f91d4c11b
--- /dev/null
+++ b/src/gfxstream/host/vulkan/cereal/CMakeLists.txt
@@ -0,0 +1,28 @@
+add_library(OpenglRender_vulkan_cereal
+ common/goldfish_vk_extension_structs.cpp
+ common/goldfish_vk_marshaling.cpp
+ common/goldfish_vk_reserved_marshaling.cpp
+ common/goldfish_vk_deepcopy.cpp
+ common/goldfish_vk_dispatch.cpp
+ common/goldfish_vk_transform.cpp )
+target_compile_definitions(OpenglRender_vulkan_cereal PRIVATE -DVK_GOOGLE_gfxstream)
+if (WIN32)
+ target_compile_definitions(OpenglRender_vulkan_cereal PRIVATE -DVK_USE_PLATFORM_WIN32_KHR)
+endif()
+target_link_libraries(
+ OpenglRender_vulkan_cereal
+ PUBLIC
+ aemu-base.headers
+ gfxstream_vulkan_headers
+ PRIVATE
+ gfxstream_utils.headers)
+
+target_include_directories(OpenglRender_vulkan_cereal
+ PUBLIC
+ .
+ PRIVATE
+ common/
+ ..
+ ../..
+ ../../../include)
+
diff --git a/src/gfxstream/host/vulkan/cereal/common/meson.build b/src/gfxstream/host/vulkan/cereal/common/meson.build
new file mode 100644
index 00000000000..ea2e5d26134
--- /dev/null
+++ b/src/gfxstream/host/vulkan/cereal/common/meson.build
@@ -0,0 +1,64 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+host_dec_path = meson.current_build_dir()
+output_host_path = meson.current_build_dir() + '/../'
+inc_cereal_common = include_directories('.')
+
+output = [
+ # Headers
+ 'goldfish_vk_extension_structs.h',
+ 'goldfish_vk_marshaling.h',
+ 'goldfish_vk_deepcopy.h',
+ 'goldfish_vk_dispatch.h',
+ 'goldfish_vk_transform.h',
+ 'VkDecoder.h',
+ 'VkDecoderSnapshot.h',
+ 'goldfish_vk_reserved_marshaling.h',
+ # Impl
+ 'goldfish_vk_extension_structs.cpp',
+ 'goldfish_vk_marshaling.cpp',
+ 'goldfish_vk_reserved_marshaling.cpp',
+ 'goldfish_vk_deepcopy.cpp',
+ 'goldfish_vk_dispatch.cpp',
+ 'goldfish_vk_transform.cpp',
+ 'VkDecoder.cpp',
+ 'VkDecoderSnapshot.cpp',
+]
+
+gfxstream_vk_autogen = custom_target(
+ 'gfxstream_vk_autogen',
+ output : output,
+ env: {'CEREAL_VARIANT' : 'host', 'GFXSTREAM_HOST_DECODER_DIR': host_dec_path, 'GFXSTREAM_OUTPUT_DIR' : output_host_path},
+ input: [genvk, vk_api_xml, vk_gfxstream_xml],
+ command: [prog_python, '@INPUT0@', '-registry', '@INPUT1@', '-registryGfxstream', '@INPUT2@',
+ 'cereal', '-o', output_host_path],
+)
+
+cereal_cpp_args = [
+ '-DVK_GFXSTREAM_STRUCTURE_TYPE_EXT',
+ '-DVK_GOOGLE_address_space',
+]
+
+if host_machine.system() == 'qnx'
+ cereal_cpp_args += '-DVK_USE_PLATFORM_SCREEN_QNX'
+endif
+
+lib_vulkan_cereal = static_library(
+ 'cereal',
+ gfxstream_vk_autogen,
+ cpp_args: cereal_cpp_args + gfxstream_host_args,
+ include_directories: [inc_cereal, inc_cereal_common, inc_stream_servers,
+ inc_vulkan_server, inc_utils, inc_include, inc_apigen_codec,
+ inc_gfxstream_include, inc_vulkan_headers, inc_root, inc_gl_host_common,
+ inc_renderdoc_external],
+ dependencies: [aemu_base_dep, aemu_common_dep, aemu_snapshot_dep],
+)
+
+dep_cereal_common = declare_dependency(
+ sources: [gfxstream_vk_autogen[0], gfxstream_vk_autogen[1], gfxstream_vk_autogen[2],
+ gfxstream_vk_autogen[3], gfxstream_vk_autogen[4], gfxstream_vk_autogen[5],
+ gfxstream_vk_autogen[6], gfxstream_vk_autogen[7]],
+ include_directories: lib_vulkan_cereal.private_dir_include(),
+ link_with: lib_vulkan_cereal,
+)
diff --git a/src/gfxstream/host/vulkan/cereal/goldfish_vk_private_defs.h b/src/gfxstream/host/vulkan/cereal/goldfish_vk_private_defs.h
new file mode 100644
index 00000000000..8ebc887b5a4
--- /dev/null
+++ b/src/gfxstream/host/vulkan/cereal/goldfish_vk_private_defs.h
@@ -0,0 +1,51 @@
+// 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>
+
+#ifdef __cplusplus
+#include <algorithm>
+#endif
+
+// We haven't updated our Vulkan headers with the version 8 of VK_ANDROID_native_buffer, but we have
+// implemented vkGetSwapchainGrallocUsage2ANDROID introduced in version 8 on the host which needs
+// this type. We should remove this definition once our Vulkan headers are updated to support that
+// version.
+typedef VkFlags VkSwapchainImageUsageFlagsANDROID;
+
+// 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/src/gfxstream/host/vulkan/cereal/meson.build b/src/gfxstream/host/vulkan/cereal/meson.build
new file mode 100644
index 00000000000..116c06b2fc1
--- /dev/null
+++ b/src/gfxstream/host/vulkan/cereal/meson.build
@@ -0,0 +1,4 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+inc_cereal = include_directories('.')
+subdir('common')
diff --git a/src/gfxstream/host/vulkan/cereal/vk_struct_id.h b/src/gfxstream/host/vulkan/cereal/vk_struct_id.h
new file mode 100644
index 00000000000..fc321ecebd0
--- /dev/null
+++ b/src/gfxstream/host/vulkan/cereal/vk_struct_id.h
@@ -0,0 +1,74 @@
+// 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 <vulkan/vulkan_core.h>
+#include "goldfish_vk_private_defs.h"
+
+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; };
+
+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);
+REGISTER_VK_STRUCT_ID(VkNativeBufferANDROID, VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID);
+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);
+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);
+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(VkImportBufferGOOGLE, VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE);
+REGISTER_VK_STRUCT_ID(VkCreateBlobGOOGLE, VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE);
+
+#ifdef _WIN32
+REGISTER_VK_STRUCT_ID(VkImportMemoryWin32HandleInfoKHR, VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR);
+#else
+REGISTER_VK_STRUCT_ID(VkImportMemoryFdInfoKHR, VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR);
+#endif
+
+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(VkExternalImageFormatProperties, VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES);
+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(VkPhysicalDeviceIDProperties, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceDriverProperties, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceDescriptorIndexingFeaturesEXT, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT);
+REGISTER_VK_STRUCT_ID(VkSemaphoreTypeCreateInfoKHR, VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR)
+REGISTER_VK_STRUCT_ID(VkTimelineSemaphoreSubmitInfoKHR, VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR)
+REGISTER_VK_STRUCT_ID(VkBindSparseInfo, VK_STRUCTURE_TYPE_BIND_SPARSE_INFO)
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceSamplerYcbcrConversionFeatures, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES)
+REGISTER_VK_STRUCT_ID(VkDeviceCreateInfo, VK_STRUCTURE_TYPE_DEVICE_CREATE_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(VkBindImageMemoryInfo, VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO);
+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);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT)
+
+#undef REGISTER_VK_STRUCT_ID
diff --git a/src/gfxstream/host/vulkan/emulated_textures/AstcTexture.cpp b/src/gfxstream/host/vulkan/emulated_textures/AstcTexture.cpp
new file mode 100644
index 00000000000..0749da2d19a
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/AstcTexture.cpp
@@ -0,0 +1,291 @@
+// 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 "AstcTexture.h"
+
+#include <atomic>
+#include <chrono>
+#include <cstring>
+#include <optional>
+#include <vector>
+
+#include "aemu/base/HealthMonitor.h"
+#include "host-common/logging.h"
+#include "host/vulkan/vk_util.h"
+
+namespace gfxstream {
+namespace vk {
+namespace {
+
+using std::chrono::milliseconds;
+
+// Print stats each time we decompress this many pixels:
+constexpr uint64_t kProcessedPixelsLogInterval = 10'000'000;
+
+std::atomic<uint64_t> pixels_processed = 0;
+std::atomic<uint64_t> ms_elapsed = 0;
+std::atomic<int64_t> bytes_used = 0;
+
+uint32_t mipmapSize(uint32_t size, uint32_t mipLevel) {
+ return std::max<uint32_t>(size >> mipLevel, 1);
+}
+
+bool isRegionValid(const VkBufferImageCopy& region, uint32_t width, uint32_t height) {
+ // TODO(gregschlom) deal with those cases. See details at:
+ // https://registry.khronos.org/vulkan/specs/1.0-extensions/html/chap20.html#copies-buffers-images-addressing
+ // https://stackoverflow.com/questions/46501832/vulkan-vkbufferimagecopy-for-partial-transfer
+
+ if (region.bufferRowLength != 0 || region.bufferImageHeight != 0) {
+ WARN("ASTC CPU decompression skipped: non-packed buffer");
+ return false;
+ }
+ if (region.imageOffset.x != 0 || region.imageOffset.y != 0) {
+ WARN("ASTC CPU decompression skipped: imageOffset is non-zero");
+ return false;
+ }
+ if (region.imageExtent.width != width || region.imageExtent.height != height) {
+ WARN("ASTC CPU decompression skipped: imageExtent is less than the entire image");
+ return false;
+ }
+ return true;
+}
+
+} // namespace
+
+AstcTexture::AstcTexture(VulkanDispatch* vk, VkDevice device, VkPhysicalDevice physicalDevice,
+ VkExtent3D imgSize, uint32_t blockWidth, uint32_t blockHeight,
+ AstcCpuDecompressor* decompressor)
+ : mVk(vk),
+ mDevice(device),
+ mPhysicalDevice(physicalDevice),
+ mImgSize(imgSize),
+ mBlockWidth(blockWidth),
+ mBlockHeight(blockHeight),
+ mDecompressor(decompressor) {}
+
+AstcTexture::~AstcTexture() { destroyVkBuffer(); }
+
+bool AstcTexture::canDecompressOnCpu() const { return mDecompressor->available(); }
+
+uint8_t* AstcTexture::createVkBufferAndMapMemory(size_t bufferSize) {
+ VkResult res;
+ mBufferSize = bufferSize; // Save the buffer size, for statistics purpose only
+ bytes_used += bufferSize;
+
+ if (mDecompBuffer || mDecompBufferMemory) {
+ WARN("ASTC CPU decompression failed: tried to decompress same image more than once.");
+ return nullptr;
+ }
+
+ VkBufferCreateInfo bufferInfo = {
+ .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
+ .size = bufferSize,
+ .usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
+ .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
+ };
+ res = mVk->vkCreateBuffer(mDevice, &bufferInfo, nullptr, &mDecompBuffer);
+ if (res != VK_SUCCESS) {
+ WARN("ASTC CPU decompression: vkCreateBuffer failed: %d", res);
+ mDecompBuffer = VK_NULL_HANDLE;
+ return nullptr;
+ }
+
+ VkMemoryRequirements memRequirements;
+ mVk->vkGetBufferMemoryRequirements(mDevice, mDecompBuffer, &memRequirements);
+
+ std::optional<uint32_t> memIndex = vk_util::findMemoryType(
+ mVk, mPhysicalDevice, memRequirements.memoryTypeBits,
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
+ VK_MEMORY_PROPERTY_HOST_CACHED_BIT);
+ if (!memIndex) {
+ // Do it again, but without VK_MEMORY_PROPERTY_HOST_CACHED_BIT this time
+ memIndex = vk_util::findMemoryType(
+ mVk, mPhysicalDevice, memRequirements.memoryTypeBits,
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
+ }
+ if (!memIndex) {
+ WARN("ASTC CPU decompression: no suitable memory type to decompress the image");
+ return nullptr;
+ }
+
+ VkMemoryAllocateInfo allocInfo = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ .allocationSize = memRequirements.size,
+ .memoryTypeIndex = *memIndex,
+ };
+ res = mVk->vkAllocateMemory(mDevice, &allocInfo, nullptr, &mDecompBufferMemory);
+ if (res != VK_SUCCESS) {
+ WARN("ASTC CPU decompression: vkAllocateMemory failed: %d", res);
+ mDecompBufferMemory = VK_NULL_HANDLE;
+ return nullptr;
+ }
+
+ res = mVk->vkBindBufferMemory(mDevice, mDecompBuffer, mDecompBufferMemory, 0);
+ if (res != VK_SUCCESS) {
+ WARN("ASTC CPU decompression: vkBindBufferMemory failed: %d", res);
+ return nullptr;
+ }
+
+ uint8_t* decompData;
+ res = mVk->vkMapMemory(mDevice, mDecompBufferMemory, 0, bufferSize, 0, (void**)&decompData);
+ if (res != VK_SUCCESS) {
+ WARN("ASTC CPU decompression: vkMapMemory failed: %d", res);
+ return nullptr;
+ }
+
+ return decompData;
+}
+
+void AstcTexture::destroyVkBuffer() {
+ bytes_used -= mBufferSize;
+ if (mVk && mDevice) {
+ mVk->vkDestroyBuffer(mDevice, mDecompBuffer, nullptr);
+ mVk->vkFreeMemory(mDevice, mDecompBufferMemory, nullptr);
+ mDecompBuffer = VK_NULL_HANDLE;
+ mDecompBufferMemory = VK_NULL_HANDLE;
+ }
+}
+
+template<typename T>
+void AstcTexture::on_vkCmdCopyBufferToImageImpl(VkCommandBuffer commandBuffer, uint8_t* srcAstcData,
+ size_t astcDataSize, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const T* pRegions,
+ const VkDecoderContext& context) {
+ auto watchdog =
+ WATCHDOG_BUILDER(context.healthMonitor, "AstcTexture::on_vkCmdCopyBufferToImageImpl").build();
+ auto start_time = std::chrono::steady_clock::now();
+ mSuccess = false;
+ size_t decompSize = 0; // How many bytes we need to hold the decompressed data
+
+ // Holds extra data about the region
+ struct RegionInfo {
+ uint32_t width; // actual width (ie: mipmap width)
+ uint32_t height; // actual height (ie: mipmap height)
+ uint32_t compressedSize; // size of ASTC data for that region
+ };
+
+ std::vector<RegionInfo> regionInfos;
+ regionInfos.reserve(regionCount);
+
+ // Make a copy of the regions and update the buffer offset of each to reflect the
+ // correct location of the decompressed data
+ std::vector<VkBufferImageCopy> decompRegions(regionCount);
+ for (size_t i = 0; i < regionCount; ++i) {
+ decompRegions[i] = VkBufferImageCopy {
+ pRegions[i].bufferOffset,
+ pRegions[i].bufferRowLength,
+ pRegions[i].bufferImageHeight,
+ pRegions[i].imageSubresource,
+ pRegions[i].imageOffset,
+ pRegions[i].imageExtent
+ };
+ }
+ for (auto& decompRegion : decompRegions) {
+ const uint32_t mipLevel = decompRegion.imageSubresource.mipLevel;
+ const uint32_t width = mipmapSize(mImgSize.width, mipLevel);
+ const uint32_t height = mipmapSize(mImgSize.height, mipLevel);
+ const uint32_t numAstcBlocks = ((width + mBlockWidth - 1) / mBlockWidth) *
+ ((height + mBlockHeight - 1) / mBlockHeight);
+ const uint32_t compressedSize = numAstcBlocks * 16;
+ // We haven't updated decompRegion.bufferOffset yet, so it's still the _compressed_ offset.
+ const uint32_t compressedDataOffset = decompRegion.bufferOffset;
+
+ // Do all the precondition checks
+ if (!isRegionValid(decompRegion, width, height)) return;
+ if (compressedDataOffset + compressedSize > astcDataSize) {
+ WARN("ASTC CPU decompression: data out of bounds. Offset: %llu, Size: %llu, Total %llu",
+ compressedDataOffset, compressedSize, astcDataSize);
+ return;
+ }
+
+ decompRegion.bufferOffset = decompSize;
+ decompSize += width * height * 4;
+ regionInfos.push_back({width, height, compressedSize});
+ }
+
+ // Create a new VkBuffer to hold the decompressed data
+ uint8_t* decompData = createVkBufferAndMapMemory(decompSize);
+ if (!decompData) {
+ destroyVkBuffer(); // The destructor would have done it anyway, but may as well do it early
+ return;
+ }
+
+ // Decompress each region
+ for (int i = 0; i < regionCount; i++) {
+ const auto& compRegion = pRegions[i];
+ const auto& decompRegion = decompRegions[i];
+ const auto& regionInfo = regionInfos[i];
+
+ int32_t status = mDecompressor->decompress(
+ regionInfo.width, regionInfo.height, mBlockWidth, mBlockHeight,
+ srcAstcData + compRegion.bufferOffset, regionInfo.compressedSize,
+ decompData + decompRegion.bufferOffset);
+
+ if (status != 0) {
+ WARN("ASTC CPU decompression failed: %s.", mDecompressor->getStatusString(status));
+ mVk->vkUnmapMemory(mDevice, mDecompBufferMemory);
+ destroyVkBuffer();
+ return;
+ }
+ }
+
+ mVk->vkUnmapMemory(mDevice, mDecompBufferMemory);
+
+ // Finally, actually copy the buffer to the image
+ mVk->vkCmdCopyBufferToImage(commandBuffer, mDecompBuffer, dstImage, dstImageLayout,
+ decompRegions.size(), decompRegions.data());
+
+ mSuccess = true;
+ auto end_time = std::chrono::steady_clock::now();
+
+ // Compute stats
+ pixels_processed += decompSize / 4;
+ ms_elapsed += std::chrono::duration_cast<milliseconds>(end_time - start_time).count();
+
+ uint64_t total_pixels = pixels_processed.load();
+ uint64_t total_time = ms_elapsed.load();
+
+ if (total_pixels >= kProcessedPixelsLogInterval && total_time > 0) {
+ pixels_processed.store(0);
+ ms_elapsed.store(0);
+ INFO("ASTC CPU decompression: %.2f Mpix in %.2f seconds (%.2f Mpix/s). Total mem: %.2f MB",
+ total_pixels / 1'000'000.0, total_time / 1000.0,
+ (float)total_pixels / total_time / 1000.0, bytes_used / 1000000.0);
+ }
+}
+
+void AstcTexture::on_vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, uint8_t* srcAstcData,
+ size_t astcDataSize, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkBufferImageCopy* pRegions,
+ const VkDecoderContext& context) {
+ on_vkCmdCopyBufferToImageImpl(commandBuffer, srcAstcData, astcDataSize, dstImage, dstImageLayout, regionCount, pRegions, context);
+}
+
+void AstcTexture::on_vkCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, uint8_t* srcAstcData,
+ size_t astcDataSize, const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo,
+ const VkDecoderContext& context) {
+ on_vkCmdCopyBufferToImageImpl(commandBuffer,
+ srcAstcData,
+ astcDataSize,
+ pCopyBufferToImageInfo->dstImage,
+ pCopyBufferToImageInfo->dstImageLayout,
+ pCopyBufferToImageInfo->regionCount,
+ pCopyBufferToImageInfo->pRegions,
+ context);
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/emulated_textures/AstcTexture.h b/src/gfxstream/host/vulkan/emulated_textures/AstcTexture.h
new file mode 100644
index 00000000000..7abc03d6623
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/AstcTexture.h
@@ -0,0 +1,74 @@
+// 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 "compressedTextureFormats/AstcCpuDecompressor.h"
+#include "host/vulkan/VkDecoderContext.h"
+#include "goldfish_vk_dispatch.h"
+#include "vulkan/vulkan.h"
+
+namespace gfxstream {
+namespace vk {
+
+// Holds the resources necessary to perform CPU ASTC decompression of a single texture.
+class AstcTexture {
+ public:
+ AstcTexture(VulkanDispatch* vk, VkDevice device, VkPhysicalDevice physicalDevice,
+ VkExtent3D imgSize, uint32_t blockWidth, uint32_t blockHeight,
+ AstcCpuDecompressor* decompressor);
+
+ ~AstcTexture();
+
+ // Whether we're able to decompress ASTC textures on the CPU
+ bool canDecompressOnCpu() const;
+
+ // Whether this texture was successfully decompressed on the CPU
+ bool successfullyDecompressed() const { return mSuccess; }
+
+ void on_vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, uint8_t* srcAstcData,
+ size_t astcDataSize, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkBufferImageCopy* pRegions,
+ const VkDecoderContext& context);
+ void on_vkCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, uint8_t* srcAstcData,
+ size_t astcDataSize, const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo,
+ const VkDecoderContext& context);
+
+ private:
+
+ template<typename T>
+ void on_vkCmdCopyBufferToImageImpl(VkCommandBuffer commandBuffer, uint8_t* srcAstcData,
+ size_t astcDataSize, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const T* pRegions,
+ const VkDecoderContext& context);
+
+ uint8_t* createVkBufferAndMapMemory(size_t bufferSize);
+ void destroyVkBuffer();
+
+ bool mSuccess = false; // true if the image was successfully decompressed
+ VulkanDispatch* mVk;
+ VkDevice mDevice;
+ VkPhysicalDevice mPhysicalDevice;
+ VkExtent3D mImgSize;
+ uint32_t mBlockWidth;
+ uint32_t mBlockHeight;
+ VkBuffer mDecompBuffer = VK_NULL_HANDLE; // VkBuffer of the decompressed image
+ VkDeviceMemory mDecompBufferMemory = VK_NULL_HANDLE; // Memory of the decompressed image
+ uint64_t mBufferSize = 0; // Size of the decompressed image
+ AstcCpuDecompressor* mDecompressor;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/emulated_textures/CMakeLists.txt b/src/gfxstream/host/vulkan/emulated_textures/CMakeLists.txt
new file mode 100644
index 00000000000..98c980a1ac3
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/CMakeLists.txt
@@ -0,0 +1,20 @@
+add_library(emulated_textures
+ "AstcTexture.cpp"
+ "CompressedImageInfo.cpp"
+ "GpuDecompressionPipeline.cpp"
+ )
+
+target_link_libraries(emulated_textures PUBLIC
+ OpenglRender_vulkan_cereal
+ aemu-base.headers
+ gfxstream_vulkan_headers
+ PRIVATE
+ gfxstream_utils.headers)
+
+target_include_directories(emulated_textures
+ PRIVATE
+ ${GFXSTREAM_REPO_ROOT}
+ ${GFXSTREAM_REPO_ROOT}/include
+ ${GFXSTREAM_REPO_ROOT}/host
+ ${GFXSTREAM_REPO_ROOT}/host/vulkan
+ ${GFXSTREAM_REPO_ROOT}/host/vulkan/cereal/common)
diff --git a/src/gfxstream/host/vulkan/emulated_textures/CompressedImageInfo.cpp b/src/gfxstream/host/vulkan/emulated_textures/CompressedImageInfo.cpp
new file mode 100644
index 00000000000..6e179b34f18
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/CompressedImageInfo.cpp
@@ -0,0 +1,814 @@
+// 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 "CompressedImageInfo.h"
+
+#include "aemu/base/ArraySize.h"
+#include "host/vulkan/VkFormatUtils.h"
+#include "host/vulkan/emulated_textures/shaders/DecompressionShaders.h"
+#include "host/vulkan/VkFormatUtils.h"
+#include "vulkan/vk_enum_string_helper.h"
+
+namespace gfxstream {
+namespace vk {
+namespace {
+
+using emugl::ABORT_REASON_OTHER;
+using emugl::FatalError;
+
+// Returns x / y, rounded up. E.g. ceil_div(7, 2) == 4
+// Note the potential integer overflow for large numbers.
+inline constexpr uint32_t ceil_div(uint32_t x, uint32_t y) { return (x + y - 1) / y; }
+
+VkImageView createDefaultImageView(VulkanDispatch* vk, VkDevice device, VkImage image,
+ VkFormat format, VkImageType imageType, uint32_t mipLevel,
+ uint32_t layerCount) {
+ VkImageViewCreateInfo imageViewInfo = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
+ .image = image,
+ .format = format,
+ .components = {VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY,
+ VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY},
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = mipLevel,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = layerCount,
+ },
+ };
+
+ switch (imageType) {
+ case VK_IMAGE_TYPE_1D:
+ imageViewInfo.viewType = VK_IMAGE_VIEW_TYPE_1D_ARRAY;
+ break;
+ case VK_IMAGE_TYPE_2D:
+ imageViewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
+ break;
+ case VK_IMAGE_TYPE_3D:
+ imageViewInfo.viewType = VK_IMAGE_VIEW_TYPE_3D;
+ break;
+ default:
+ imageViewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
+ break;
+ }
+ VkImageView imageView;
+ VkResult result = vk->vkCreateImageView(device, &imageViewInfo, nullptr, &imageView);
+ if (result != VK_SUCCESS) {
+ WARN("GPU decompression: createDefaultImageView failed: %d", result);
+ return VK_NULL_HANDLE;
+ }
+ return imageView;
+}
+
+VkExtent2D getBlockSize(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
+ case VK_FORMAT_EAC_R11_UNORM_BLOCK:
+ case VK_FORMAT_EAC_R11_SNORM_BLOCK:
+ case VK_FORMAT_EAC_R11G11_UNORM_BLOCK:
+ case VK_FORMAT_EAC_R11G11_SNORM_BLOCK:
+ return {4, 4};
+ case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
+ return {4, 4};
+ case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
+ return {5, 4};
+ case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
+ return {5, 5};
+ case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
+ return {6, 5};
+ case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
+ return {6, 6};
+ case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
+ return {8, 5};
+ case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
+ return {8, 6};
+ case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
+ return {8, 8};
+ case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
+ return {10, 5};
+ case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
+ return {10, 6};
+ case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
+ return {10, 8};
+ case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
+ return {10, 10};
+ case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
+ return {12, 10};
+ case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
+ return {12, 12};
+ default:
+ return {1, 1};
+ }
+}
+
+bool isReadableImageLayout(VkImageLayout layout) {
+ switch (layout) {
+ case VK_IMAGE_LAYOUT_GENERAL:
+ case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
+ case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
+ case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool isWritableImageLayout(VkImageLayout layout) {
+ switch (layout) {
+ case VK_IMAGE_LAYOUT_GENERAL:
+ case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:
+ return true;
+ default:
+ return false;
+ }
+}
+
+// Returns whether a given memory barrier puts the image in a layout where it can be read from.
+bool imageWillBecomeReadable(const VkImageMemoryBarrier& barrier) {
+ bool fromReadable = isReadableImageLayout(barrier.oldLayout);
+ bool toReadable = isReadableImageLayout(barrier.newLayout);
+ bool toWritable = isWritableImageLayout(barrier.newLayout);
+
+ // TODO(gregschlom) This doesn't take into account that the GENERAL layout is both readable and
+ // writable, so this warning could incorrectly trigger some times.
+ if (fromReadable && toWritable) {
+ WARN(
+ "Compressed image is being transitioned from readable (%s) to writable (%s). This may "
+ "lead to unexpected results.",
+ string_VkImageLayout(barrier.oldLayout), string_VkImageLayout(barrier.newLayout));
+ }
+
+ // If we're transitioning from UNDEFINED, the image content is undefined, so don't try to
+ // decompress it.
+ if (barrier.oldLayout == VK_IMAGE_LAYOUT_UNDEFINED) return false;
+
+ // TODO(gregschlom): Address the corner case of GENERAL, which is both readable and writable.
+ // For example, the image could be transitioned only once, from UNDEFINED to GENERAL.
+ // Currently, there is no way to perform decompression in this case.
+
+ return toReadable;
+}
+
+bool isCompressedFormat(VkFormat format) {
+ return gfxstream::vk::isAstc(format) || gfxstream::vk::isEtc2(format) ||
+ gfxstream::vk::isBc(format);
+}
+
+// Returns the format that the shader uses to write the output image
+VkFormat getShaderFormat(VkFormat outputFormat) {
+ switch (outputFormat) {
+ case VK_FORMAT_R16_UNORM:
+ case VK_FORMAT_R16_SNORM:
+ case VK_FORMAT_R16G16_UNORM:
+ case VK_FORMAT_R16G16_SNORM:
+ return outputFormat;
+ case VK_FORMAT_BC3_UNORM_BLOCK:
+ case VK_FORMAT_BC3_SRGB_BLOCK:
+ return VK_FORMAT_R32G32B32A32_UINT;
+ default:
+ return VK_FORMAT_R8G8B8A8_UINT;
+ }
+}
+
+// Returns the next memory offset on a given alignment.
+// Will divide by zero if alignment is zero.
+VkDeviceSize nextAlignedOffset(VkDeviceSize offset, VkDeviceSize alignment) {
+ return ceil_div(offset, alignment) * alignment;
+}
+
+// Check that the alignment is valid:
+// - sets the alignment to 1 if it's 0
+// - aborts if it's not a power of 2
+void checkValidAlignment(VkDeviceSize& n) {
+ if (n == 0) {
+ n = 1;
+ return;
+ }
+
+ // Check that the alignment is a power of 2
+ // http://www.graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
+ if ((n & (n - 1))) {
+ GFXSTREAM_ABORT(FatalError(ABORT_REASON_OTHER)) << "vkGetImageMemoryRequirements returned non-power-of-two alignment: " + std::to_string(n);
+ }
+}
+
+} // namespace
+
+CompressedImageInfo::CompressedImageInfo(VkDevice device) : mDevice(device) {}
+
+CompressedImageInfo::CompressedImageInfo(VkDevice device, const VkImageCreateInfo& createInfo,
+ GpuDecompressionPipelineManager* pipelineManager)
+ : mCompressedFormat(createInfo.format),
+ mOutputFormat(getOutputFormat(mCompressedFormat)),
+ mCompressedMipmapsFormat(getCompressedMipmapsFormat(mCompressedFormat)),
+ mImageType(createInfo.imageType),
+ mMipLevels(createInfo.mipLevels),
+ mExtent(createInfo.extent),
+ mBlock(getBlockSize(mCompressedFormat)),
+ mLayerCount(createInfo.arrayLayers),
+ mDevice(device),
+ mPipelineManager(pipelineManager) {}
+
+// static
+VkFormat CompressedImageInfo::getOutputFormat(VkFormat compFmt) {
+ switch (compFmt) {
+ case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:
+ return VK_FORMAT_R8G8B8A8_UNORM;
+ case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
+ return VK_FORMAT_R8G8B8A8_SRGB;
+ case VK_FORMAT_EAC_R11_UNORM_BLOCK:
+ return VK_FORMAT_R16_UNORM;
+ case VK_FORMAT_EAC_R11_SNORM_BLOCK:
+ return VK_FORMAT_R16_SNORM;
+ case VK_FORMAT_EAC_R11G11_UNORM_BLOCK:
+ return VK_FORMAT_R16G16_UNORM;
+ case VK_FORMAT_EAC_R11G11_SNORM_BLOCK:
+ return VK_FORMAT_R16G16_SNORM;
+ case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
+ return GpuDecompressionPipelineManager::astcDecoder() == AstcDecoder::NewBc3
+ ? VK_FORMAT_BC3_UNORM_BLOCK
+ : VK_FORMAT_R8G8B8A8_UNORM;
+ case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
+ return GpuDecompressionPipelineManager::astcDecoder() == AstcDecoder::NewBc3
+ ? VK_FORMAT_BC3_SRGB_BLOCK
+ : VK_FORMAT_R8G8B8A8_SRGB;
+ default:
+ return compFmt;
+ }
+}
+
+// static
+VkFormat CompressedImageInfo::getCompressedMipmapsFormat(VkFormat compFmt) {
+ switch (compFmt) {
+ case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
+ return VK_FORMAT_R16G16B16A16_UINT;
+ case VK_FORMAT_EAC_R11_UNORM_BLOCK:
+ case VK_FORMAT_EAC_R11_SNORM_BLOCK:
+ return VK_FORMAT_R32G32_UINT;
+ case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
+ case VK_FORMAT_EAC_R11G11_UNORM_BLOCK:
+ case VK_FORMAT_EAC_R11G11_SNORM_BLOCK:
+ case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
+ return VK_FORMAT_R32G32B32A32_UINT;
+ default:
+ return compFmt;
+ }
+}
+
+// static
+bool CompressedImageInfo::needEmulatedAlpha(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool CompressedImageInfo::isEtc2() const { return gfxstream::vk::isEtc2(mCompressedFormat); }
+
+bool CompressedImageInfo::isAstc() const { return gfxstream::vk::isAstc(mCompressedFormat); }
+
+VkImageCreateInfo CompressedImageInfo::getOutputCreateInfo(
+ const VkImageCreateInfo& createInfo) const {
+ VkImageCreateInfo result = createInfo;
+ result.format = mOutputFormat;
+
+ result.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT |
+ // Needed for ASTC->BC3 transcoding so that we can create a BC3 image with
+ // VK_IMAGE_USAGE_STORAGE_BIT
+ VK_IMAGE_CREATE_EXTENDED_USAGE_BIT;
+
+ if (!isCompressedFormat(mOutputFormat)) {
+ // Need to clear this flag since the application might have specified it, but it's invalid
+ // on non-compressed formats
+ result.flags &= ~VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT;
+ } else {
+ // Need to set this flag so that we can cast the output image into a non-compressed format
+ // so that the decompression shader can write to it.
+ result.flags |= VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT;
+ }
+
+ result.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
+ return result;
+}
+
+void CompressedImageInfo::createCompressedMipmapImages(VulkanDispatch* vk,
+ const VkImageCreateInfo& createInfo) {
+ if (!mCompressedMipmaps.empty()) {
+ return;
+ }
+
+ VkImageCreateInfo createInfoCopy = createInfo;
+ createInfoCopy.format = mCompressedMipmapsFormat;
+ // Note: if you change the flags here, you must also change both versions of
+ // on_vkGetPhysicalDeviceImageFormatProperties in VkDecoderGlobalState
+ // TODO(gregschlom): Remove duplicated logic.
+ createInfoCopy.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
+ createInfoCopy.flags &= ~VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT;
+ createInfoCopy.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
+ createInfoCopy.mipLevels = 1;
+
+ mCompressedMipmaps.resize(mMipLevels);
+ for (uint32_t i = 0; i < mMipLevels; ++i) {
+ createInfoCopy.extent = compressedMipmapExtent(i);
+ vk->vkCreateImage(mDevice, &createInfoCopy, nullptr, &mCompressedMipmaps[i]);
+ }
+
+ // Compute the memory requirements for all the images (output image + compressed mipmaps)
+
+ vk->vkGetImageMemoryRequirements(mDevice, mOutputImage, &mMemoryRequirements);
+ checkValidAlignment(mMemoryRequirements.alignment);
+ std::vector<VkMemoryRequirements> mipmapsMemReqs(mMipLevels);
+ for (size_t i = 0; i < mMipLevels; ++i) {
+ vk->vkGetImageMemoryRequirements(mDevice, mCompressedMipmaps[i], &mipmapsMemReqs[i]);
+ checkValidAlignment(mipmapsMemReqs[i].alignment);
+ }
+
+ for (const auto& r : mipmapsMemReqs) {
+ // What we want here is the least common multiple of all the alignments. However, since
+ // alignments are always powers of 2, the lcm is simply the largest value.
+ if (r.alignment > mMemoryRequirements.alignment) {
+ mMemoryRequirements.alignment = r.alignment;
+ }
+ mMemoryRequirements.memoryTypeBits &= r.memoryTypeBits;
+ }
+
+ // At this point, we have the following:
+ // - mMemoryRequirements.size is the size of the output image
+ // - mMemoryRequirements.alignment is the least common multiple of all alignments
+ // - mMemoryRequirements.memoryTypeBits is the intersection of all the memoryTypeBits
+ // Now, compute the offsets of each mipmap image as well as the total memory size we need.
+ mMipmapOffsets.resize(mMipLevels);
+ for (size_t i = 0; i < mMipLevels; ++i) {
+ // This works because the alignment we request is the lcm of all alignments
+ mMipmapOffsets[i] =
+ nextAlignedOffset(mMemoryRequirements.size, mipmapsMemReqs[i].alignment);
+ mMemoryRequirements.size = mMipmapOffsets[i] + mipmapsMemReqs[i].size;
+ }
+}
+
+void CompressedImageInfo::initAstcCpuDecompression(VulkanDispatch* vk,
+ VkPhysicalDevice physicalDevice) {
+ mAstcTexture = std::make_unique<AstcTexture>(vk, mDevice, physicalDevice, mExtent, mBlock.width,
+ mBlock.height, &AstcCpuDecompressor::get());
+}
+
+bool CompressedImageInfo::decompressIfNeeded(VulkanDispatch* vk, VkCommandBuffer commandBuffer,
+ VkPipelineStageFlags srcStageMask,
+ VkPipelineStageFlags dstStageMask,
+ const VkImageMemoryBarrier& targetBarrier,
+ std::vector<VkImageMemoryBarrier>& outputBarriers) {
+ std::vector<VkImageMemoryBarrier> imageBarriers = getImageBarriers(targetBarrier);
+
+ if (!imageWillBecomeReadable(targetBarrier)) {
+ // We're not going to read from the image, no need to decompress it.
+ // Apply the target barrier to the compressed mipmaps and the decompressed image.
+ outputBarriers.insert(outputBarriers.end(), imageBarriers.begin(), imageBarriers.end());
+ return false;
+ }
+
+ VkResult result = initializeDecompressionPipeline(vk, mDevice);
+ if (result != VK_SUCCESS) {
+ WARN("Failed to initialize pipeline for texture decompression");
+ return false;
+ }
+
+ // Transition the layout of all the compressed mipmaps so that the shader can read from them.
+ for (auto& barrier : imageBarriers) {
+ barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
+ barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
+ }
+
+ // Transition the layout of the output image so that we can write to it.
+ imageBarriers.back().srcAccessMask = 0;
+ imageBarriers.back().oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ imageBarriers.back().dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
+ imageBarriers.back().newLayout = VK_IMAGE_LAYOUT_GENERAL;
+
+ // Do the layout transitions
+ vk->vkCmdPipelineBarrier(commandBuffer, srcStageMask, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0,
+ 0, nullptr, 0, nullptr, imageBarriers.size(), imageBarriers.data());
+
+ // Run the decompression shader
+ decompress(vk, commandBuffer, getImageSubresourceRange(targetBarrier.subresourceRange));
+
+ // Finally, transition the layout of all images to match the target barrier.
+ for (auto& barrier : imageBarriers) {
+ barrier.srcAccessMask = VK_ACCESS_SHADER_READ_BIT;
+ barrier.oldLayout = VK_IMAGE_LAYOUT_GENERAL;
+ barrier.dstAccessMask = targetBarrier.dstAccessMask;
+ barrier.newLayout = targetBarrier.newLayout;
+ }
+ // (adjust the last barrier since it's for the output image)
+ imageBarriers.back().srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
+
+ // Do the layout transitions
+ vk->vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, dstStageMask, 0,
+ 0, nullptr, 0, nullptr, imageBarriers.size(), imageBarriers.data());
+
+ return true;
+}
+
+void CompressedImageInfo::decompressOnCpu(VkCommandBuffer commandBuffer, uint8_t* srcAstcData,
+ size_t astcDataSize, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkBufferImageCopy* pRegions,
+ const VkDecoderContext& context) {
+ mAstcTexture->on_vkCmdCopyBufferToImage(commandBuffer, srcAstcData, astcDataSize, dstImage,
+ dstImageLayout, regionCount, pRegions, context);
+}
+
+void CompressedImageInfo::decompressOnCpu(VkCommandBuffer commandBuffer, uint8_t* srcAstcData, size_t astcDataSize,
+ const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo, const VkDecoderContext& context) {
+ mAstcTexture->on_vkCmdCopyBufferToImage2(commandBuffer, srcAstcData, astcDataSize, pCopyBufferToImageInfo, context);
+}
+
+VkMemoryRequirements CompressedImageInfo::getMemoryRequirements() const {
+ return mMemoryRequirements;
+}
+
+VkResult CompressedImageInfo::bindCompressedMipmapsMemory(VulkanDispatch* vk, VkDeviceMemory memory,
+ VkDeviceSize memoryOffset) {
+ VkResult result = VK_SUCCESS;
+ for (size_t i = 0; i < mCompressedMipmaps.size(); i++) {
+ VkResult res = vk->vkBindImageMemory(mDevice, mCompressedMipmaps[i], memory,
+ memoryOffset + mMipmapOffsets[i]);
+ if (res != VK_SUCCESS) result = res;
+ }
+ return result;
+}
+
+VkBufferImageCopy CompressedImageInfo::getBufferImageCopy(
+ const VkBufferImageCopy& origRegion) const {
+ VkBufferImageCopy region = origRegion;
+ uint32_t mipLevel = region.imageSubresource.mipLevel;
+ region.imageSubresource.mipLevel = 0;
+ region.bufferRowLength /= mBlock.width;
+ region.bufferImageHeight /= mBlock.height;
+ region.imageOffset.x /= mBlock.width;
+ region.imageOffset.y /= mBlock.height;
+ region.imageExtent = compressedMipmapPortion(region.imageExtent, mipLevel);
+ return region;
+}
+
+VkBufferImageCopy2 CompressedImageInfo::getBufferImageCopy(
+ const VkBufferImageCopy2& origRegion) const {
+ VkBufferImageCopy2 region = origRegion;
+ uint32_t mipLevel = region.imageSubresource.mipLevel;
+ region.imageSubresource.mipLevel = 0;
+ region.bufferRowLength /= mBlock.width;
+ region.bufferImageHeight /= mBlock.height;
+ region.imageOffset.x /= mBlock.width;
+ region.imageOffset.y /= mBlock.height;
+ region.imageExtent = compressedMipmapPortion(region.imageExtent, mipLevel);
+ return region;
+}
+
+// static
+VkImageCopy CompressedImageInfo::getCompressedMipmapsImageCopy(const VkImageCopy& origRegion,
+ const CompressedImageInfo& srcImg,
+ const CompressedImageInfo& dstImg,
+ bool needEmulatedSrc,
+ bool needEmulatedDst) {
+ VkImageCopy region = origRegion;
+ if (needEmulatedSrc) {
+ uint32_t mipLevel = region.srcSubresource.mipLevel;
+ region.srcSubresource.mipLevel = 0;
+ region.srcOffset.x /= srcImg.mBlock.width;
+ region.srcOffset.y /= srcImg.mBlock.height;
+ region.extent = srcImg.compressedMipmapPortion(region.extent, mipLevel);
+ }
+ if (needEmulatedDst) {
+ region.dstSubresource.mipLevel = 0;
+ region.dstOffset.x /= dstImg.mBlock.width;
+ region.dstOffset.y /= dstImg.mBlock.height;
+ }
+ return region;
+}
+
+VkImageCopy2 CompressedImageInfo::getCompressedMipmapsImageCopy(const VkImageCopy2& origRegion,
+ const CompressedImageInfo& srcImg,
+ const CompressedImageInfo& dstImg,
+ bool needEmulatedSrc,
+ bool needEmulatedDst) {
+ VkImageCopy2 region = origRegion;
+ if (needEmulatedSrc) {
+ uint32_t mipLevel = region.srcSubresource.mipLevel;
+ region.srcSubresource.mipLevel = 0;
+ region.srcOffset.x /= srcImg.mBlock.width;
+ region.srcOffset.y /= srcImg.mBlock.height;
+ region.extent = srcImg.compressedMipmapPortion(region.extent, mipLevel);
+ }
+ if (needEmulatedDst) {
+ region.dstSubresource.mipLevel = 0;
+ region.dstOffset.x /= dstImg.mBlock.width;
+ region.dstOffset.y /= dstImg.mBlock.height;
+ }
+ return region;
+}
+
+void CompressedImageInfo::destroy(VulkanDispatch* vk) {
+ for (const auto& image : mCompressedMipmaps) {
+ vk->vkDestroyImage(mDevice, image, nullptr);
+ }
+ vk->vkDestroyDescriptorPool(mDevice, mDecompDescriptorPool, nullptr);
+ for (const auto& imageView : mCompressedMipmapsImageViews) {
+ vk->vkDestroyImageView(mDevice, imageView, nullptr);
+ }
+ for (const auto& imageView : mOutputImageViews) {
+ vk->vkDestroyImageView(mDevice, imageView, nullptr);
+ }
+ vk->vkDestroyImage(mDevice, mOutputImage, nullptr);
+}
+
+std::vector<VkImageMemoryBarrier> CompressedImageInfo::getImageBarriers(
+ const VkImageMemoryBarrier& srcBarrier) {
+ const VkImageSubresourceRange range = getImageSubresourceRange(srcBarrier.subresourceRange);
+
+ std::vector<VkImageMemoryBarrier> imageBarriers;
+ imageBarriers.reserve(range.levelCount + 1);
+
+ // Add the barriers for the compressed mipmaps
+ VkImageMemoryBarrier mipmapBarrier = srcBarrier;
+ mipmapBarrier.subresourceRange.baseMipLevel = 0;
+ mipmapBarrier.subresourceRange.levelCount = 1;
+ imageBarriers.insert(imageBarriers.begin(), range.levelCount, mipmapBarrier);
+ for (uint32_t j = 0; j < range.levelCount; j++) {
+ imageBarriers[j].image = mCompressedMipmaps[range.baseMipLevel + j];
+ }
+
+ // Add a barrier for the output image
+ imageBarriers.push_back(srcBarrier);
+ imageBarriers.back().image = mOutputImage;
+
+ return imageBarriers;
+}
+
+VkImageSubresourceRange CompressedImageInfo::getImageSubresourceRange(
+ const VkImageSubresourceRange& range) const {
+ VkImageSubresourceRange result = range;
+ if (result.levelCount == VK_REMAINING_MIP_LEVELS) {
+ result.levelCount = mMipLevels - range.baseMipLevel;
+ }
+ if (result.layerCount == VK_REMAINING_ARRAY_LAYERS) {
+ result.layerCount = mLayerCount - range.baseArrayLayer;
+ }
+ return result;
+}
+
+VkResult CompressedImageInfo::initializeDecompressionPipeline(VulkanDispatch* vk, VkDevice device) {
+ if (mDecompPipelineInitialized) {
+ return VK_SUCCESS;
+ }
+
+ mDecompPipeline = mPipelineManager->get(mCompressedFormat, mImageType);
+ if (mDecompPipeline == nullptr) {
+ ERR("Failed to initialize GPU decompression pipeline");
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+
+ VkDescriptorPoolSize poolSize = {
+ .type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+ .descriptorCount = 2 * mMipLevels,
+ };
+ VkDescriptorPoolCreateInfo dsPoolInfo = {
+ .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
+ .flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
+ .maxSets = mMipLevels,
+ .poolSizeCount = 1,
+ .pPoolSizes = &poolSize,
+ };
+ VkResult result =
+ vk->vkCreateDescriptorPool(device, &dsPoolInfo, nullptr, &mDecompDescriptorPool);
+ if (result != VK_SUCCESS) {
+ ERR("GPU decompression error. vkCreateDescriptorPool failed: %d", result);
+ return result;
+ }
+
+ std::vector<VkDescriptorSetLayout> layouts(mMipLevels, mDecompPipeline->descriptorSetLayout());
+
+ VkDescriptorSetAllocateInfo dsInfo = {
+ .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,
+ .descriptorPool = mDecompDescriptorPool,
+ .descriptorSetCount = mMipLevels,
+ .pSetLayouts = layouts.data(),
+ };
+ mDecompDescriptorSets.resize(mMipLevels);
+ result = vk->vkAllocateDescriptorSets(device, &dsInfo, mDecompDescriptorSets.data());
+ if (result != VK_SUCCESS) {
+ ERR("GPU decompression error. vkAllocateDescriptorSets failed: %d", result);
+ return result;
+ }
+
+ VkFormat shaderFormat = getShaderFormat(mOutputFormat);
+ mCompressedMipmapsImageViews.resize(mMipLevels);
+ mOutputImageViews.resize(mMipLevels);
+
+ VkDescriptorImageInfo compressedMipmapsDescriptorImageInfo = {.imageLayout =
+ VK_IMAGE_LAYOUT_GENERAL};
+ VkDescriptorImageInfo mDecompDescriptorImageInfo = {.imageLayout = VK_IMAGE_LAYOUT_GENERAL};
+ VkWriteDescriptorSet writeDescriptorSets[2] = {
+ {
+ .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+ .dstBinding = 0,
+ .descriptorCount = 1,
+ .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+ .pImageInfo = &compressedMipmapsDescriptorImageInfo,
+ },
+ {
+ .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
+ .dstBinding = 1,
+ .descriptorCount = 1,
+ .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+ .pImageInfo = &mDecompDescriptorImageInfo,
+ }};
+
+ for (uint32_t i = 0; i < mMipLevels; i++) {
+ mCompressedMipmapsImageViews[i] =
+ createDefaultImageView(vk, device, mCompressedMipmaps[i], mCompressedMipmapsFormat,
+ mImageType, 0, mLayerCount);
+ mOutputImageViews[i] = createDefaultImageView(vk, device, mOutputImage, shaderFormat,
+ mImageType, i, mLayerCount);
+ compressedMipmapsDescriptorImageInfo.imageView = mCompressedMipmapsImageViews[i];
+ mDecompDescriptorImageInfo.imageView = mOutputImageViews[i];
+ writeDescriptorSets[0].dstSet = mDecompDescriptorSets[i];
+ writeDescriptorSets[1].dstSet = mDecompDescriptorSets[i];
+ vk->vkUpdateDescriptorSets(device, 2, writeDescriptorSets, 0, nullptr);
+ }
+
+ mDecompPipelineInitialized = true;
+ return VK_SUCCESS;
+}
+
+void CompressedImageInfo::decompress(VulkanDispatch* vk, VkCommandBuffer commandBuffer,
+ const VkImageSubresourceRange& range) {
+ vk->vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE,
+ mDecompPipeline->pipeline());
+ uint32_t dispatchZ = mExtent.depth == 1 ? range.layerCount : mExtent.depth;
+ bool perPixel = false; // Whether the shader operates per compressed block or per pixel
+ if (isEtc2()) {
+ const Etc2PushConstant pushConstant = {
+ .compFormat = (uint32_t)mCompressedFormat,
+ .baseLayer = mExtent.depth == 1 ? range.baseArrayLayer : 0};
+ vk->vkCmdPushConstants(commandBuffer, mDecompPipeline->pipelineLayout(),
+ VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(pushConstant), &pushConstant);
+ } else if (isAstc()) {
+ uint32_t smallBlock = false;
+ switch (mCompressedFormat) {
+ case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
+ smallBlock = true;
+ break;
+ default:
+ break;
+ }
+ const AstcPushConstant pushConstant = {
+ .blockSize = {mBlock.width, mBlock.height},
+ .baseLayer = mExtent.depth == 1 ? range.baseArrayLayer : 0,
+ .smallBlock = smallBlock};
+ vk->vkCmdPushConstants(commandBuffer, mDecompPipeline->pipelineLayout(),
+ VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(pushConstant), &pushConstant);
+ // The old shader is per-block, the new shaders are per-pixel
+ perPixel = GpuDecompressionPipelineManager::astcDecoder() != AstcDecoder::Old;
+ }
+ for (uint32_t i = range.baseMipLevel; i < range.baseMipLevel + range.levelCount; i++) {
+ vk->vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE,
+ mDecompPipeline->pipelineLayout(), 0, 1,
+ mDecompDescriptorSets.data() + i, 0, nullptr);
+ VkExtent3D extent = perPixel ? mipmapExtent(i) : compressedMipmapExtent(i);
+ vk->vkCmdDispatch(commandBuffer, ceil_div(extent.width, 8), ceil_div(extent.height, 8),
+ dispatchZ);
+ }
+}
+
+VkExtent3D CompressedImageInfo::mipmapExtent(uint32_t level) const {
+ return {
+ .width = std::max<uint32_t>(mExtent.width >> level, 1),
+ .height = std::max<uint32_t>(mExtent.height >> level, 1),
+ .depth = std::max<uint32_t>(mExtent.depth >> level, 1),
+ };
+}
+
+VkExtent3D CompressedImageInfo::compressedMipmapExtent(uint32_t level) const {
+ VkExtent3D result = mipmapExtent(level);
+ result.width = ceil_div(result.width, mBlock.width);
+ result.height = ceil_div(result.height, mBlock.height);
+ return result;
+}
+
+VkExtent3D CompressedImageInfo::compressedMipmapPortion(const VkExtent3D& origExtent,
+ uint32_t level) const {
+ VkExtent3D maxExtent = compressedMipmapExtent(level);
+ return {
+ .width = std::min(ceil_div(origExtent.width, mBlock.width), maxExtent.width),
+ .height = std::min(ceil_div(origExtent.height, mBlock.height), maxExtent.height),
+ // TODO(gregschlom): this is correct for 2DArrays, but incorrect for 3D images. We should
+ // take the image type into account to do the right thing here. See also
+ // https://android-review.git.corp.google.com/c/device/generic/vulkan-cereal/+/2458549/comment/cfc7480f_912dd378/
+ .depth = origExtent.depth,
+ };
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/emulated_textures/CompressedImageInfo.h b/src/gfxstream/host/vulkan/emulated_textures/CompressedImageInfo.h
new file mode 100644
index 00000000000..c90f5481f21
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/CompressedImageInfo.h
@@ -0,0 +1,189 @@
+// 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 <cstdint>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "host/vulkan/emulated_textures/AstcTexture.h"
+#include "host/vulkan/emulated_textures/GpuDecompressionPipeline.h"
+#include "goldfish_vk_dispatch.h"
+#include "vulkan/vulkan.h"
+
+namespace gfxstream {
+namespace vk {
+
+class CompressedImageInfo {
+ public:
+ // Static methods
+
+ // Returns the format that this image will be converted to, if the original format isn't
+ // natively supported by the GPU.
+ static VkFormat getOutputFormat(VkFormat compFmt);
+
+ // Returns the image format used to store the compressed data. Each pixel in the compressed
+ // mipmaps will hold an entire compressed block.
+ static VkFormat getCompressedMipmapsFormat(VkFormat compFmt);
+
+ static bool needEmulatedAlpha(VkFormat format);
+
+ // Returns a VkImageCopy to copy to/from the compressed data
+ static VkImageCopy getCompressedMipmapsImageCopy(const VkImageCopy& origRegion,
+ const CompressedImageInfo& srcImg,
+ const CompressedImageInfo& dstImg,
+ bool needEmulatedSrc, bool needEmulatedDst);
+ static VkImageCopy2 getCompressedMipmapsImageCopy(const VkImageCopy2& origRegion,
+ const CompressedImageInfo& srcImg,
+ const CompressedImageInfo& dstImg,
+ bool needEmulatedSrc, bool needEmulatedDst);
+
+
+ // Constructors
+
+ // TODO(gregschlom) Delete these constructors once we switch to holding a
+ // std::unique_ptr<CompressedImageInfo>
+ CompressedImageInfo() = default;
+ explicit CompressedImageInfo(VkDevice device);
+
+ CompressedImageInfo(VkDevice device, const VkImageCreateInfo& createInfo,
+ GpuDecompressionPipelineManager* pipelineManager);
+
+ // Public methods
+
+ // Returns the VkImageCreateInfo needed to create the output image
+ VkImageCreateInfo getOutputCreateInfo(const VkImageCreateInfo& createInfo) const;
+
+ // Creates the compressed mipmap images, that is the VkImages holding the compressed data
+ void createCompressedMipmapImages(VulkanDispatch* vk, const VkImageCreateInfo& createInfo);
+
+ // Initializes the resources needed to perform CPU decompression of ASTC textures
+ void initAstcCpuDecompression(VulkanDispatch* vk, VkPhysicalDevice physicalDevice);
+
+ // Should be called when the guest calls vkCmdPipelineBarrier.
+ // This function checks if the image barrier transitions the compressed image to a layout where
+ // it will be read from, and if so, it decompresses the image.
+ //
+ // outputBarriers: any barrier that needs to be passed to the vkCmdPipelineBarrier call will be
+ // added to this vector.
+ // Returns whether image decompression happened.
+ // Note: the global lock must be held when calling this method, because we call into
+ // GpuDecompressionPipelineManager.
+ bool decompressIfNeeded(VulkanDispatch* vk, VkCommandBuffer commandBuffer,
+ VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask,
+ const VkImageMemoryBarrier& targetBarrier,
+ std::vector<VkImageMemoryBarrier>& outputBarriers);
+
+ void decompressOnCpu(VkCommandBuffer commandBuffer, uint8_t* srcAstcData, size_t astcDataSize,
+ VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkBufferImageCopy* pRegions, const VkDecoderContext& context);
+
+ void decompressOnCpu(VkCommandBuffer commandBuffer, uint8_t* srcAstcData, size_t astcDataSize,
+ const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo, const VkDecoderContext& context);
+
+ VkMemoryRequirements getMemoryRequirements() const;
+
+ VkResult bindCompressedMipmapsMemory(VulkanDispatch* vk, VkDeviceMemory memory,
+ VkDeviceSize memoryOffset);
+
+ // Given a VkBufferImageCopy object for the original image, returns a new
+ // VkBufferImageCopy that points to the same location in the compressed mipmap images.
+ VkBufferImageCopy getBufferImageCopy(const VkBufferImageCopy& origRegion) const;
+ VkBufferImageCopy2 getBufferImageCopy(const VkBufferImageCopy2& origRegion) const;
+
+ // Releases all the resources used by this class. It may no longer be used after calling this.
+ void destroy(VulkanDispatch* vk);
+
+ // Accessors
+
+ bool isEtc2() const;
+ bool isAstc() const;
+ VkDevice device() const { return mDevice; }
+ VkImage compressedMipmap(uint32_t level) { return mCompressedMipmaps[level]; }
+ VkImage outputImage() { return mOutputImage; }
+ void setOutputImage(VkImage image) { mOutputImage = image; }
+ bool canDecompressOnCpu() { return mAstcTexture != nullptr; }
+ bool successfullyDecompressedOnCpu() const {
+ return mAstcTexture && mAstcTexture->successfullyDecompressed();
+ }
+
+ private:
+ // Returns a vector of image barriers for the compressed mipmap images and the decompressed
+ // image.
+ std::vector<VkImageMemoryBarrier> getImageBarriers(const VkImageMemoryBarrier& srcBarrier);
+
+ VkImageSubresourceRange getImageSubresourceRange(const VkImageSubresourceRange& range) const;
+
+ // Initializes the compute shader pipeline to decompress the image.
+ // No-op if this was already called successfully.
+ VkResult initializeDecompressionPipeline(VulkanDispatch* vk, VkDevice device);
+
+ // Runs the decompression shader
+ void decompress(VulkanDispatch* vk, VkCommandBuffer commandBuffer,
+ const VkImageSubresourceRange& range);
+
+ // Returns the size of the image at a given mip level
+ VkExtent3D mipmapExtent(uint32_t level) const;
+ // Returns the size of the compressed mipmaps at a given mip level. This is mipmapExtent divided
+ // by the block size, and rounded up.
+ VkExtent3D compressedMipmapExtent(uint32_t level) const;
+ // Returns an extent into the compressed mipmaps. This divides the components of origExtent by
+ // the block size, and the result is clamped to not exceed the compressed mipmap size.
+ VkExtent3D compressedMipmapPortion(const VkExtent3D& origExtent, uint32_t level) const;
+
+ // Member variables
+
+ // The original compressed format of this image. E.g.: VK_FORMAT_ASTC_4x4_UNORM_BLOCK
+ VkFormat mCompressedFormat = VK_FORMAT_UNDEFINED;
+ // The format that we decompressed the image to. E.g.: VK_FORMAT_R8G8B8A8_UINT
+ VkFormat mOutputFormat = VK_FORMAT_UNDEFINED;
+ // The format that we use to store the compressed data, since the original compressed format
+ // isn't available. This holds one compressed block per pixel. E.g.: VK_FORMAT_R32G32B32A32_UINT
+ VkFormat mCompressedMipmapsFormat = VK_FORMAT_UNDEFINED;
+
+ VkImageType mImageType = VK_IMAGE_TYPE_MAX_ENUM;
+ uint32_t mMipLevels = 1; // Number of mip levels in the image
+ VkExtent3D mExtent = {}; // Size of the image
+ VkExtent2D mBlock = {1, 1}; // Size of the compressed blocks
+ uint32_t mLayerCount = 1;
+
+ VkDevice mDevice = VK_NULL_HANDLE;
+ VkImage mOutputImage = VK_NULL_HANDLE;
+
+ // Compressed data. Each mip level of the original image is stored as a separate VkImage, and
+ // each pixel in those images contains an entire compressed block.
+ std::vector<VkImage> mCompressedMipmaps;
+
+ // The memory offset that we will use for each compressed mipmap.
+ std::vector<VkDeviceSize> mMipmapOffsets;
+
+ VkMemoryRequirements mMemoryRequirements;
+
+ // Used to perform CPU decompression of ASTC textures. Null for non-ASTC images.
+ std::unique_ptr<AstcTexture> mAstcTexture = nullptr;
+
+ // Vulkan resources used by the decompression pipeline
+ GpuDecompressionPipelineManager* mPipelineManager = nullptr;
+ GpuDecompressionPipeline* mDecompPipeline = nullptr;
+ std::vector<VkDescriptorSet> mDecompDescriptorSets;
+ VkDescriptorPool mDecompDescriptorPool = VK_NULL_HANDLE;
+ std::vector<VkImageView> mCompressedMipmapsImageViews;
+ std::vector<VkImageView> mOutputImageViews;
+ bool mDecompPipelineInitialized = false;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/emulated_textures/GpuDecompressionPipeline.cpp b/src/gfxstream/host/vulkan/emulated_textures/GpuDecompressionPipeline.cpp
new file mode 100644
index 00000000000..cba5afc19c0
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/GpuDecompressionPipeline.cpp
@@ -0,0 +1,336 @@
+// Copyright 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 "GpuDecompressionPipeline.h"
+
+#include "host-common/logging.h"
+#include "host/vulkan/VkFormatUtils.h"
+#include "host/vulkan/emulated_textures/shaders/DecompressionShaders.h"
+#include "vulkan/vk_enum_string_helper.h"
+
+namespace gfxstream {
+namespace vk {
+
+namespace {
+
+// Which GPU decoder we use for ASTC textures.
+// Note: we currently only enable ASTC decompression for native vulkan apps, and we try CPU
+// decompression first, before falling back to GPU decompression.
+static AstcDecoder activeAstcDecoder = AstcDecoder::NewRgb;
+
+struct ShaderGroup {
+ ShaderData shader1D;
+ ShaderData shader2D;
+ ShaderData shader3D;
+};
+
+// Helper macro to declare the shader goups
+#define DECLARE_SHADER_GROUP(Format) \
+ constexpr ShaderGroup kShader##Format { \
+ .shader1D = {.code = decompression_shaders::Format##_1D, \
+ .size = sizeof(decompression_shaders::Format##_1D)}, \
+ .shader2D = {.code = decompression_shaders::Format##_2D, \
+ .size = sizeof(decompression_shaders::Format##_2D)}, \
+ .shader3D = {.code = decompression_shaders::Format##_3D, \
+ .size = sizeof(decompression_shaders::Format##_3D)}, \
+ }
+
+DECLARE_SHADER_GROUP(Astc);
+DECLARE_SHADER_GROUP(AstcToRgb);
+DECLARE_SHADER_GROUP(AstcToBc3);
+DECLARE_SHADER_GROUP(EacR11Snorm);
+DECLARE_SHADER_GROUP(EacR11Unorm);
+DECLARE_SHADER_GROUP(EacRG11Snorm);
+DECLARE_SHADER_GROUP(EacRG11Unorm);
+DECLARE_SHADER_GROUP(Etc2RGB8);
+DECLARE_SHADER_GROUP(Etc2RGBA8);
+
+#undef DECLARE_SHADER_GROUP
+
+// Returns the group of shaders that can decompress a given format, or null if none is found.
+const ShaderGroup* getShaderGroup(VkFormat format) {
+ switch (format) {
+ case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
+ case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
+ case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
+ switch (activeAstcDecoder) {
+ case AstcDecoder::Old:
+ return &kShaderAstc;
+ case AstcDecoder::NewRgb:
+ return &kShaderAstcToRgb;
+ case AstcDecoder::NewBc3:
+ return &kShaderAstcToBc3;
+ }
+ case VK_FORMAT_EAC_R11_SNORM_BLOCK:
+ return &kShaderEacR11Snorm;
+
+ case VK_FORMAT_EAC_R11_UNORM_BLOCK:
+ return &kShaderEacR11Unorm;
+
+ case VK_FORMAT_EAC_R11G11_SNORM_BLOCK:
+ return &kShaderEacRG11Snorm;
+
+ case VK_FORMAT_EAC_R11G11_UNORM_BLOCK:
+ return &kShaderEacRG11Unorm;
+
+ case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
+ return &kShaderEtc2RGB8;
+
+ case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:
+ case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
+ return &kShaderEtc2RGBA8;
+
+ default:
+ return nullptr;
+ }
+}
+
+// Returns the shader that can decompress a given image format and type
+const ShaderData* getDecompressionShader(VkFormat format, VkImageType imageType) {
+ const ShaderGroup* group = getShaderGroup(format);
+ if (!group) return nullptr;
+
+ switch (imageType) {
+ case VK_IMAGE_TYPE_1D:
+ return &group->shader1D;
+ case VK_IMAGE_TYPE_2D:
+ return &group->shader2D;
+ case VK_IMAGE_TYPE_3D:
+ return &group->shader3D;
+ default:
+ return nullptr;
+ }
+}
+
+const char* string_AstcDecoder(AstcDecoder decoder) {
+ switch (decoder) {
+ case AstcDecoder::Old:
+ return "Old";
+ case AstcDecoder::NewRgb:
+ return "NewRgb";
+ case AstcDecoder::NewBc3:
+ return "NewBc3";
+ }
+ return "Unknown";
+}
+
+} // namespace
+
+// static
+std::unique_ptr<GpuDecompressionPipeline> GpuDecompressionPipeline::create(
+ VulkanDispatch* vk, VkDevice device, VkFormat compressedFormat,
+ VkImageType imageType, VkDescriptorSetLayout descriptorSetLayout,
+ VkPipelineLayout pipelineLayout) {
+ auto pipeline = std::unique_ptr<GpuDecompressionPipeline>(new GpuDecompressionPipeline(
+ vk, device, compressedFormat, imageType, descriptorSetLayout, pipelineLayout));
+ if (!pipeline->initialize()) {
+ return nullptr;
+ }
+ return pipeline;
+}
+
+GpuDecompressionPipeline::GpuDecompressionPipeline(VulkanDispatch* vk, VkDevice device,
+ VkFormat compressedFormat, VkImageType imageType,
+ VkDescriptorSetLayout descriptorSetLayout,
+ VkPipelineLayout pipelineLayout)
+ : mVk(vk),
+ mDevice(device),
+ mCompressedFormat(compressedFormat),
+ mImageType(imageType),
+ mDescriptorSetLayout(descriptorSetLayout),
+ mPipelineLayout(pipelineLayout) {
+ INFO("Created GPU decompression pipeline for format %s %s. ASTC decoder: %s",
+ string_VkFormat(mCompressedFormat), string_VkImageType(imageType),
+ string_AstcDecoder(activeAstcDecoder));
+}
+
+bool GpuDecompressionPipeline::initialize() {
+ const ShaderData* shaderData = getDecompressionShader(mCompressedFormat, mImageType);
+ if (!shaderData) {
+ WARN("No decompression shader found for format %s and img type %s",
+ string_VkFormat(mCompressedFormat), string_VkImageType(mImageType));
+ return false;
+ }
+
+ VkShaderModuleCreateInfo shaderInfo = {
+ .sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
+ .codeSize = shaderData->size,
+ .pCode = shaderData->code,
+ };
+ VkShaderModule shader;
+ VkResult result = mVk->vkCreateShaderModule(mDevice, &shaderInfo, nullptr, &shader);
+ if (result != VK_SUCCESS) {
+ WARN("GPU decompression: error calling vkCreateShaderModule: %d", result);
+ return false;
+ }
+
+ VkComputePipelineCreateInfo computePipelineInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
+ .stage = {.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
+ .stage = VK_SHADER_STAGE_COMPUTE_BIT,
+ .module = shader,
+ .pName = "main"},
+ .layout = mPipelineLayout,
+ };
+ result = mVk->vkCreateComputePipelines(mDevice, nullptr, 1, &computePipelineInfo, nullptr,
+ &mPipeline);
+ mVk->vkDestroyShaderModule(mDevice, shader, nullptr);
+ if (result != VK_SUCCESS) {
+ WARN("GPU decompression: error calling vkCreateComputePipelines: %d", result);
+ return false;
+ }
+ return true;
+}
+
+GpuDecompressionPipeline::~GpuDecompressionPipeline() {
+ if (!mVk || !mDevice) return;
+ mVk->vkDestroyPipeline(mDevice, mPipeline, nullptr);
+}
+
+// static
+void GpuDecompressionPipelineManager::setAstcDecoder(AstcDecoder value) {
+ activeAstcDecoder = value;
+}
+AstcDecoder GpuDecompressionPipelineManager::astcDecoder() { return activeAstcDecoder; }
+
+GpuDecompressionPipelineManager::GpuDecompressionPipelineManager(VulkanDispatch* vk,
+ VkDevice device)
+ : mVk(vk), mDevice(device) {}
+
+GpuDecompressionPipeline* GpuDecompressionPipelineManager::get(VkFormat compressedFormat,
+ VkImageType imageType) {
+ auto& pipeline = mPipelines[getDecompressionShader(compressedFormat, imageType)];
+ if (!pipeline) {
+ VkDescriptorSetLayout descriptorSetLayout = getDescriptorSetLayout();
+ if (descriptorSetLayout == VK_NULL_HANDLE) return nullptr;
+
+ VkPipelineLayout pipelineLayout = getPipelineLayout(compressedFormat);
+ if (pipelineLayout == VK_NULL_HANDLE) return nullptr;
+
+ pipeline = GpuDecompressionPipeline::create(mVk, mDevice, compressedFormat, imageType,
+ descriptorSetLayout, pipelineLayout);
+ }
+ return pipeline.get();
+}
+
+VkDescriptorSetLayout GpuDecompressionPipelineManager::getDescriptorSetLayout() {
+ VkDescriptorSetLayoutBinding dsLayoutBindings[] = {
+ {
+ .binding = 0,
+ .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+ .descriptorCount = 1,
+ .stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
+ },
+ {
+ .binding = 1,
+ .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+ .descriptorCount = 1,
+ .stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
+ },
+ };
+ VkDescriptorSetLayoutCreateInfo dsLayoutInfo = {
+ .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+ .bindingCount = std::size(dsLayoutBindings),
+ .pBindings = dsLayoutBindings,
+ };
+ VkResult result =
+ mVk->vkCreateDescriptorSetLayout(mDevice, &dsLayoutInfo, nullptr, &mDescriptorSetLayout);
+ if (result != VK_SUCCESS) {
+ WARN("GPU decompression: error calling vkCreateDescriptorSetLayout: %d", result);
+ return VK_NULL_HANDLE;
+ }
+ return mDescriptorSetLayout;
+}
+
+VkPipelineLayout GpuDecompressionPipelineManager::getPipelineLayout(VkFormat format) {
+ VkPipelineLayout* pipelineLayout;
+ VkPushConstantRange pushConstant = {.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT};
+
+ if (isAstc(format)) {
+ pipelineLayout = &mAstcPipelineLayout;
+ pushConstant.size = sizeof(AstcPushConstant);
+ } else {
+ pipelineLayout = &mEtc2PipelineLayout;
+ pushConstant.size = sizeof(Etc2PushConstant);
+ }
+
+ VkPipelineLayoutCreateInfo pipelineLayoutInfo = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
+ .setLayoutCount = 1,
+ .pSetLayouts = &mDescriptorSetLayout,
+ .pushConstantRangeCount = 1,
+ .pPushConstantRanges = &pushConstant,
+ };
+ VkResult result =
+ mVk->vkCreatePipelineLayout(mDevice, &pipelineLayoutInfo, nullptr, pipelineLayout);
+ if (result != VK_SUCCESS) {
+ WARN("GPU decompression: error calling vkCreatePipelineLayout for format %s: %d",
+ string_VkFormat(format), result);
+ return VK_NULL_HANDLE;
+ }
+ return *pipelineLayout;
+}
+
+void GpuDecompressionPipelineManager::clear() {
+ mPipelines.clear();
+ if (mVk && mDevice) {
+ mVk->vkDestroyDescriptorSetLayout(mDevice, mDescriptorSetLayout, nullptr);
+ mVk->vkDestroyPipelineLayout(mDevice, mAstcPipelineLayout, nullptr);
+ mVk->vkDestroyPipelineLayout(mDevice, mEtc2PipelineLayout, nullptr);
+
+ mDescriptorSetLayout = VK_NULL_HANDLE;
+ mAstcPipelineLayout = VK_NULL_HANDLE;
+ mEtc2PipelineLayout = VK_NULL_HANDLE;
+ }
+}
+
+GpuDecompressionPipelineManager::~GpuDecompressionPipelineManager() {
+ if (!mPipelines.empty() || mDescriptorSetLayout != VK_NULL_HANDLE ||
+ mAstcPipelineLayout != VK_NULL_HANDLE || mEtc2PipelineLayout != VK_NULL_HANDLE) {
+ WARN(
+ "Resource leak: GpuDecompressionPipelineManager is being destroyed but clear() wasn't"
+ " called first");
+ }
+}
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/emulated_textures/GpuDecompressionPipeline.h b/src/gfxstream/host/vulkan/emulated_textures/GpuDecompressionPipeline.h
new file mode 100644
index 00000000000..878a9821578
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/GpuDecompressionPipeline.h
@@ -0,0 +1,130 @@
+// Copyright 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 <cstdint>
+#include <memory>
+#include <unordered_map>
+
+#include "goldfish_vk_dispatch.h"
+#include "vulkan/vulkan.h"
+
+namespace gfxstream {
+namespace vk {
+
+struct ShaderData {
+ const uint32_t* code; // Pointer to shader's compiled spir-v code
+ const size_t size; // size of the code in bytes
+};
+
+struct Etc2PushConstant {
+ uint32_t compFormat;
+ uint32_t baseLayer;
+};
+
+struct AstcPushConstant {
+ uint32_t blockSize[2];
+ uint32_t baseLayer;
+ uint32_t smallBlock;
+};
+
+// Holds the Vulkan resources for the GPU decompression pipeline of a given emulated texture format.
+// GpuDecompressionPipeline should be reused, use GpuDecompressionPipelineManager for that.
+class GpuDecompressionPipeline {
+ public:
+ // Factory method. Returns null if pipeline initialization failed.
+ static std::unique_ptr<GpuDecompressionPipeline> create(
+ VulkanDispatch* vk, VkDevice device, VkFormat compressedFormat,
+ VkImageType imageType, VkDescriptorSetLayout descriptorSetLayout,
+ VkPipelineLayout pipelineLayout);
+
+ // GpuDecompressionPipeline is neither copyable nor movable.
+ // This allows us to safely release Vulkan resources in the destructor
+ GpuDecompressionPipeline(const GpuDecompressionPipeline&) = delete;
+ GpuDecompressionPipeline& operator=(const GpuDecompressionPipeline&) = delete;
+
+ // Destructor, will release any Vulkan resource we hold
+ ~GpuDecompressionPipeline();
+
+ // Accessors
+ VkPipeline pipeline() const { return mPipeline; }
+ VkPipelineLayout pipelineLayout() const { return mPipelineLayout; }
+ VkDescriptorSetLayout descriptorSetLayout() const { return mDescriptorSetLayout; }
+
+ private:
+ GpuDecompressionPipeline(VulkanDispatch* vk, VkDevice device,
+ VkFormat compressedFormat, VkImageType imageType,
+ VkDescriptorSetLayout descriptorSetLayout,
+ VkPipelineLayout pipelineLayout);
+
+ // Initializes the compute shader pipeline
+ bool initialize();
+
+ // Member variables set in the constructor
+ VulkanDispatch* mVk;
+ VkDevice mDevice;
+ VkFormat mCompressedFormat;
+ VkImageType mImageType;
+ VkDescriptorSetLayout mDescriptorSetLayout;
+ VkPipelineLayout mPipelineLayout;
+
+ // Member variables set by initialize()
+ VkPipeline mPipeline = VK_NULL_HANDLE;
+};
+
+enum class AstcDecoder{Old, NewRgb, NewBc3};
+
+// Acts as a cache for GpuDecompressionPipeline objects
+// Currently no eviction strategy, but the maximum number of entries is bounded by the number of
+// compressed formats that we emulate.
+// Thread-safety: not thread safe. Access to members of this class must be synchronized externally.
+class GpuDecompressionPipelineManager {
+ public:
+ // TODO(gregschlom) remove this once we fully remove the old decoder
+ static void setAstcDecoder(AstcDecoder value);
+ static AstcDecoder astcDecoder();
+
+ GpuDecompressionPipelineManager(VulkanDispatch* vk, VkDevice device);
+
+ // Returns the cached pipeline for the decompression of a given image format and type.
+ // If the pipeline doesn't exist yet, it will be created and initialized.
+ // Returns null if initialization of the pipeline failed.
+ GpuDecompressionPipeline* get(VkFormat compressedFormat, VkImageType imageType);
+
+ // Erases everything from the cache
+ void clear();
+
+ ~GpuDecompressionPipelineManager();
+
+ // GpuDecompressionPipelineManager is neither copyable nor movable.
+ // This allows us to safely release Vulkan resources in the destructor
+ GpuDecompressionPipelineManager(const GpuDecompressionPipelineManager&) = delete;
+ GpuDecompressionPipelineManager& operator=(const GpuDecompressionPipelineManager&) = delete;
+
+ private:
+ VkDescriptorSetLayout getDescriptorSetLayout();
+ VkPipelineLayout getPipelineLayout(VkFormat format);
+
+ std::unordered_map<const ShaderData*, std::unique_ptr<GpuDecompressionPipeline>> mPipelines;
+
+ VulkanDispatch* mVk = nullptr;
+ VkDevice mDevice = VK_NULL_HANDLE;
+ VkDescriptorSetLayout mDescriptorSetLayout = VK_NULL_HANDLE;
+ VkPipelineLayout mAstcPipelineLayout = VK_NULL_HANDLE;
+ VkPipelineLayout mEtc2PipelineLayout = VK_NULL_HANDLE;
+};
+
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/emulated_textures/README.md b/src/gfxstream/host/vulkan/emulated_textures/README.md
new file mode 100644
index 00000000000..52e0b9a680e
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/README.md
@@ -0,0 +1,6 @@
+# Emulated Textures
+
+This directory contains code related to providing emulated support for compressed texture formats.
+
+For example, support for ASTC and ETC2 texture formats is the norm on mobile GPUs but is non-existent
+on desktop GPUs and needs to be emulated. \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/emulated_textures/meson.build b/src/gfxstream/host/vulkan/emulated_textures/meson.build
new file mode 100644
index 00000000000..eca6326cfa5
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/meson.build
@@ -0,0 +1,23 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_emulated_textures = files(
+ 'AstcTexture.cpp',
+ 'CompressedImageInfo.cpp',
+ 'GpuDecompressionPipeline.cpp',
+)
+
+emulated_texture_args = [
+ '-DVK_GFXSTREAM_STRUCTURE_TYPE_EXT'
+]
+
+lib_emulated_textures = static_library(
+ 'emulated_textures',
+ files_emulated_textures,
+ cpp_args: emulated_texture_args + gfxstream_host_args,
+ include_directories: [inc_utils, inc_root, inc_vulkan_headers, inc_vulkan_server,
+ inc_gfxstream_include, inc_include, inc_cereal,
+ inc_cereal_common, inc_stream_servers],
+ link_with: [lib_compressed_textures],
+ dependencies: [aemu_base_dep, aemu_common_dep, dep_cereal_common]
+)
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/Astc.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/Astc.comp
new file mode 100644
index 00000000000..7edadecc673
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/Astc.comp
@@ -0,0 +1,902 @@
+// 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.
+
+// For implementation details, please refer to:
+// https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_texture_compression_astc_hdr.txt
+
+// Please refer to this document for operator precendence (slightly different from C):
+// https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.html#operators
+
+#version 450
+#include "AstcUnquantMap.comp"
+#include "Common.comp"
+
+precision highp int;
+
+layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
+
+layout(push_constant) uniform ImageFormatBlock {
+ uvec2 blockSize;
+ uint baseLayer;
+ uint smallBlock;
+}
+u_pushConstant;
+
+layout(binding = 0, rgba32ui) readonly uniform WITH_TYPE(uimage) u_image0;
+layout(binding = 1, rgba8ui) writeonly uniform WITH_TYPE(uimage) u_image1;
+
+// HDR CEM: 2, 3, 7, 11, 14, 15
+
+const bool kHDRCEM[16] = {
+ false, false, true, true, false, false, false, true,
+ false, false, false, true, false, false, true, true,
+};
+
+// Encoding table for C.2.12
+
+const uint kTritEncodings[256][5] = {
+ {0, 0, 0, 0, 0}, {1, 0, 0, 0, 0}, {2, 0, 0, 0, 0}, {0, 0, 2, 0, 0}, {0, 1, 0, 0, 0},
+ {1, 1, 0, 0, 0}, {2, 1, 0, 0, 0}, {1, 0, 2, 0, 0}, {0, 2, 0, 0, 0}, {1, 2, 0, 0, 0},
+ {2, 2, 0, 0, 0}, {2, 0, 2, 0, 0}, {0, 2, 2, 0, 0}, {1, 2, 2, 0, 0}, {2, 2, 2, 0, 0},
+ {2, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {1, 0, 1, 0, 0}, {2, 0, 1, 0, 0}, {0, 1, 2, 0, 0},
+ {0, 1, 1, 0, 0}, {1, 1, 1, 0, 0}, {2, 1, 1, 0, 0}, {1, 1, 2, 0, 0}, {0, 2, 1, 0, 0},
+ {1, 2, 1, 0, 0}, {2, 2, 1, 0, 0}, {2, 1, 2, 0, 0}, {0, 0, 0, 2, 2}, {1, 0, 0, 2, 2},
+ {2, 0, 0, 2, 2}, {0, 0, 2, 2, 2}, {0, 0, 0, 1, 0}, {1, 0, 0, 1, 0}, {2, 0, 0, 1, 0},
+ {0, 0, 2, 1, 0}, {0, 1, 0, 1, 0}, {1, 1, 0, 1, 0}, {2, 1, 0, 1, 0}, {1, 0, 2, 1, 0},
+ {0, 2, 0, 1, 0}, {1, 2, 0, 1, 0}, {2, 2, 0, 1, 0}, {2, 0, 2, 1, 0}, {0, 2, 2, 1, 0},
+ {1, 2, 2, 1, 0}, {2, 2, 2, 1, 0}, {2, 0, 2, 1, 0}, {0, 0, 1, 1, 0}, {1, 0, 1, 1, 0},
+ {2, 0, 1, 1, 0}, {0, 1, 2, 1, 0}, {0, 1, 1, 1, 0}, {1, 1, 1, 1, 0}, {2, 1, 1, 1, 0},
+ {1, 1, 2, 1, 0}, {0, 2, 1, 1, 0}, {1, 2, 1, 1, 0}, {2, 2, 1, 1, 0}, {2, 1, 2, 1, 0},
+ {0, 1, 0, 2, 2}, {1, 1, 0, 2, 2}, {2, 1, 0, 2, 2}, {1, 0, 2, 2, 2}, {0, 0, 0, 2, 0},
+ {1, 0, 0, 2, 0}, {2, 0, 0, 2, 0}, {0, 0, 2, 2, 0}, {0, 1, 0, 2, 0}, {1, 1, 0, 2, 0},
+ {2, 1, 0, 2, 0}, {1, 0, 2, 2, 0}, {0, 2, 0, 2, 0}, {1, 2, 0, 2, 0}, {2, 2, 0, 2, 0},
+ {2, 0, 2, 2, 0}, {0, 2, 2, 2, 0}, {1, 2, 2, 2, 0}, {2, 2, 2, 2, 0}, {2, 0, 2, 2, 0},
+ {0, 0, 1, 2, 0}, {1, 0, 1, 2, 0}, {2, 0, 1, 2, 0}, {0, 1, 2, 2, 0}, {0, 1, 1, 2, 0},
+ {1, 1, 1, 2, 0}, {2, 1, 1, 2, 0}, {1, 1, 2, 2, 0}, {0, 2, 1, 2, 0}, {1, 2, 1, 2, 0},
+ {2, 2, 1, 2, 0}, {2, 1, 2, 2, 0}, {0, 2, 0, 2, 2}, {1, 2, 0, 2, 2}, {2, 2, 0, 2, 2},
+ {2, 0, 2, 2, 2}, {0, 0, 0, 0, 2}, {1, 0, 0, 0, 2}, {2, 0, 0, 0, 2}, {0, 0, 2, 0, 2},
+ {0, 1, 0, 0, 2}, {1, 1, 0, 0, 2}, {2, 1, 0, 0, 2}, {1, 0, 2, 0, 2}, {0, 2, 0, 0, 2},
+ {1, 2, 0, 0, 2}, {2, 2, 0, 0, 2}, {2, 0, 2, 0, 2}, {0, 2, 2, 0, 2}, {1, 2, 2, 0, 2},
+ {2, 2, 2, 0, 2}, {2, 0, 2, 0, 2}, {0, 0, 1, 0, 2}, {1, 0, 1, 0, 2}, {2, 0, 1, 0, 2},
+ {0, 1, 2, 0, 2}, {0, 1, 1, 0, 2}, {1, 1, 1, 0, 2}, {2, 1, 1, 0, 2}, {1, 1, 2, 0, 2},
+ {0, 2, 1, 0, 2}, {1, 2, 1, 0, 2}, {2, 2, 1, 0, 2}, {2, 1, 2, 0, 2}, {0, 2, 2, 2, 2},
+ {1, 2, 2, 2, 2}, {2, 2, 2, 2, 2}, {2, 0, 2, 2, 2}, {0, 0, 0, 0, 1}, {1, 0, 0, 0, 1},
+ {2, 0, 0, 0, 1}, {0, 0, 2, 0, 1}, {0, 1, 0, 0, 1}, {1, 1, 0, 0, 1}, {2, 1, 0, 0, 1},
+ {1, 0, 2, 0, 1}, {0, 2, 0, 0, 1}, {1, 2, 0, 0, 1}, {2, 2, 0, 0, 1}, {2, 0, 2, 0, 1},
+ {0, 2, 2, 0, 1}, {1, 2, 2, 0, 1}, {2, 2, 2, 0, 1}, {2, 0, 2, 0, 1}, {0, 0, 1, 0, 1},
+ {1, 0, 1, 0, 1}, {2, 0, 1, 0, 1}, {0, 1, 2, 0, 1}, {0, 1, 1, 0, 1}, {1, 1, 1, 0, 1},
+ {2, 1, 1, 0, 1}, {1, 1, 2, 0, 1}, {0, 2, 1, 0, 1}, {1, 2, 1, 0, 1}, {2, 2, 1, 0, 1},
+ {2, 1, 2, 0, 1}, {0, 0, 1, 2, 2}, {1, 0, 1, 2, 2}, {2, 0, 1, 2, 2}, {0, 1, 2, 2, 2},
+ {0, 0, 0, 1, 1}, {1, 0, 0, 1, 1}, {2, 0, 0, 1, 1}, {0, 0, 2, 1, 1}, {0, 1, 0, 1, 1},
+ {1, 1, 0, 1, 1}, {2, 1, 0, 1, 1}, {1, 0, 2, 1, 1}, {0, 2, 0, 1, 1}, {1, 2, 0, 1, 1},
+ {2, 2, 0, 1, 1}, {2, 0, 2, 1, 1}, {0, 2, 2, 1, 1}, {1, 2, 2, 1, 1}, {2, 2, 2, 1, 1},
+ {2, 0, 2, 1, 1}, {0, 0, 1, 1, 1}, {1, 0, 1, 1, 1}, {2, 0, 1, 1, 1}, {0, 1, 2, 1, 1},
+ {0, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {2, 1, 1, 1, 1}, {1, 1, 2, 1, 1}, {0, 2, 1, 1, 1},
+ {1, 2, 1, 1, 1}, {2, 2, 1, 1, 1}, {2, 1, 2, 1, 1}, {0, 1, 1, 2, 2}, {1, 1, 1, 2, 2},
+ {2, 1, 1, 2, 2}, {1, 1, 2, 2, 2}, {0, 0, 0, 2, 1}, {1, 0, 0, 2, 1}, {2, 0, 0, 2, 1},
+ {0, 0, 2, 2, 1}, {0, 1, 0, 2, 1}, {1, 1, 0, 2, 1}, {2, 1, 0, 2, 1}, {1, 0, 2, 2, 1},
+ {0, 2, 0, 2, 1}, {1, 2, 0, 2, 1}, {2, 2, 0, 2, 1}, {2, 0, 2, 2, 1}, {0, 2, 2, 2, 1},
+ {1, 2, 2, 2, 1}, {2, 2, 2, 2, 1}, {2, 0, 2, 2, 1}, {0, 0, 1, 2, 1}, {1, 0, 1, 2, 1},
+ {2, 0, 1, 2, 1}, {0, 1, 2, 2, 1}, {0, 1, 1, 2, 1}, {1, 1, 1, 2, 1}, {2, 1, 1, 2, 1},
+ {1, 1, 2, 2, 1}, {0, 2, 1, 2, 1}, {1, 2, 1, 2, 1}, {2, 2, 1, 2, 1}, {2, 1, 2, 2, 1},
+ {0, 2, 1, 2, 2}, {1, 2, 1, 2, 2}, {2, 2, 1, 2, 2}, {2, 1, 2, 2, 2}, {0, 0, 0, 1, 2},
+ {1, 0, 0, 1, 2}, {2, 0, 0, 1, 2}, {0, 0, 2, 1, 2}, {0, 1, 0, 1, 2}, {1, 1, 0, 1, 2},
+ {2, 1, 0, 1, 2}, {1, 0, 2, 1, 2}, {0, 2, 0, 1, 2}, {1, 2, 0, 1, 2}, {2, 2, 0, 1, 2},
+ {2, 0, 2, 1, 2}, {0, 2, 2, 1, 2}, {1, 2, 2, 1, 2}, {2, 2, 2, 1, 2}, {2, 0, 2, 1, 2},
+ {0, 0, 1, 1, 2}, {1, 0, 1, 1, 2}, {2, 0, 1, 1, 2}, {0, 1, 2, 1, 2}, {0, 1, 1, 1, 2},
+ {1, 1, 1, 1, 2}, {2, 1, 1, 1, 2}, {1, 1, 2, 1, 2}, {0, 2, 1, 1, 2}, {1, 2, 1, 1, 2},
+ {2, 2, 1, 1, 2}, {2, 1, 2, 1, 2}, {0, 2, 2, 2, 2}, {1, 2, 2, 2, 2}, {2, 2, 2, 2, 2},
+ {2, 1, 2, 2, 2},
+};
+
+const uint kQuintEncodings[128][3] = {
+ {0, 0, 0}, {1, 0, 0}, {2, 0, 0}, {3, 0, 0}, {4, 0, 0}, {0, 4, 0}, {4, 4, 0}, {4, 4, 4},
+ {0, 1, 0}, {1, 1, 0}, {2, 1, 0}, {3, 1, 0}, {4, 1, 0}, {1, 4, 0}, {4, 4, 1}, {4, 4, 4},
+ {0, 2, 0}, {1, 2, 0}, {2, 2, 0}, {3, 2, 0}, {4, 2, 0}, {2, 4, 0}, {4, 4, 2}, {4, 4, 4},
+ {0, 3, 0}, {1, 3, 0}, {2, 3, 0}, {3, 3, 0}, {4, 3, 0}, {3, 4, 0}, {4, 4, 3}, {4, 4, 4},
+ {0, 0, 1}, {1, 0, 1}, {2, 0, 1}, {3, 0, 1}, {4, 0, 1}, {0, 4, 1}, {4, 0, 4}, {0, 4, 4},
+ {0, 1, 1}, {1, 1, 1}, {2, 1, 1}, {3, 1, 1}, {4, 1, 1}, {1, 4, 1}, {4, 1, 4}, {1, 4, 4},
+ {0, 2, 1}, {1, 2, 1}, {2, 2, 1}, {3, 2, 1}, {4, 2, 1}, {2, 4, 1}, {4, 2, 4}, {2, 4, 4},
+ {0, 3, 1}, {1, 3, 1}, {2, 3, 1}, {3, 3, 1}, {4, 3, 1}, {3, 4, 1}, {4, 3, 4}, {3, 4, 4},
+ {0, 0, 2}, {1, 0, 2}, {2, 0, 2}, {3, 0, 2}, {4, 0, 2}, {0, 4, 2}, {2, 0, 4}, {3, 0, 4},
+ {0, 1, 2}, {1, 1, 2}, {2, 1, 2}, {3, 1, 2}, {4, 1, 2}, {1, 4, 2}, {2, 1, 4}, {3, 1, 4},
+ {0, 2, 2}, {1, 2, 2}, {2, 2, 2}, {3, 2, 2}, {4, 2, 2}, {2, 4, 2}, {2, 2, 4}, {3, 2, 4},
+ {0, 3, 2}, {1, 3, 2}, {2, 3, 2}, {3, 3, 2}, {4, 3, 2}, {3, 4, 2}, {2, 3, 4}, {3, 3, 4},
+ {0, 0, 3}, {1, 0, 3}, {2, 0, 3}, {3, 0, 3}, {4, 0, 3}, {0, 4, 3}, {0, 0, 4}, {1, 0, 4},
+ {0, 1, 3}, {1, 1, 3}, {2, 1, 3}, {3, 1, 3}, {4, 1, 3}, {1, 4, 3}, {0, 1, 4}, {1, 1, 4},
+ {0, 2, 3}, {1, 2, 3}, {2, 2, 3}, {3, 2, 3}, {4, 2, 3}, {2, 4, 3}, {0, 2, 4}, {1, 2, 4},
+ {0, 3, 3}, {1, 3, 3}, {2, 3, 3}, {3, 3, 3}, {4, 3, 3}, {3, 4, 3}, {0, 3, 4}, {1, 3, 4}};
+
+const int kRQuantParamTableLength = 19;
+// T, Q, B values in Table c.2.16, including binaries, in reversed order
+const uint kRQuantParamTable[kRQuantParamTableLength][3] = {
+ {0, 0, 8}, // 255
+ {1, 0, 6}, // 191
+ {0, 1, 5}, // 159
+ {0, 0, 7}, // 127
+ {1, 0, 5}, // 95
+ {0, 1, 4}, // 79
+ {0, 0, 6}, // 63
+ {1, 0, 4}, // 47
+ {0, 1, 3}, // 39
+ {0, 0, 5}, // 31
+ {1, 0, 3}, // 23
+ {0, 1, 2}, // 19
+ {0, 0, 4}, // 15
+ {1, 0, 2}, // 11
+ {0, 1, 1}, // 9
+ {0, 0, 3}, // 7
+ {1, 0, 1}, // 5
+ //{0, 1, 0}, // 4
+ {0, 0, 2}, // 3
+ //{1, 0, 0}, // 2
+ {0, 0, 1}, // 1
+};
+
+uint bit(uint u, int bit) { return (u >> bit) & 1; }
+
+uint bits128(uvec4 u, uint bitStart, uint bitCount) {
+ uint firstIdx = bitStart / 32;
+ uint firstOffset = bitStart % 32;
+ uint bitMask = (1 << bitCount) - 1;
+ if (firstIdx == ((bitStart + bitCount - 1) / 32)) {
+ return (u[3 - firstIdx] >> firstOffset) & bitMask;
+ } else {
+ uint firstCount = 32 - firstOffset;
+ uint ret = u[3 - firstIdx - 1] << firstCount;
+ ret |= ((u[3 - firstIdx] >> firstOffset) & ((1 << firstCount) - 1));
+ return ret & bitMask;
+ }
+}
+
+uint bits128fillZeros(uvec4 u, uint bitStart, uint bitEnd, uint bitCount) {
+ if (bitEnd <= bitStart) {
+ return 0;
+ }
+ return bits128(u, bitStart, min(bitEnd - bitStart, bitCount));
+}
+
+uint get_bit_count(uint num_vals, uint trits, uint quints, uint bits) {
+ // See section C.2.22 for the formula used here.
+ uint trit_bit_count = ((num_vals * 8 * trits) + 4) / 5;
+ uint quint_bit_count = ((num_vals * 7 * quints) + 2) / 3;
+ uint base_bit_count = num_vals * bits;
+ return trit_bit_count + quint_bit_count + base_bit_count;
+}
+
+void get_pack_size(uint trits, uint quints, uint bits, out uint pack, out uint packedSize) {
+ if (trits == 1) {
+ pack = 5;
+ packedSize = 8 + 5 * bits;
+ } else if (quints == 1) {
+ pack = 3;
+ packedSize = 7 + 3 * bits;
+ } else {
+ pack = 1;
+ packedSize = bits;
+ }
+}
+
+uint[5] decode_trit(uvec4 data, uint start, uint end, uint n) {
+ // We either have three quints or five trits
+ const int kNumVals = 5;
+ const int kInterleavedBits[5] = {2, 2, 1, 2, 1};
+
+ // Decode the block
+ uint m[kNumVals];
+ uint encoded = 0;
+ uint encoded_bits_read = 0;
+ for (int i = 0; i < kNumVals; ++i) {
+ m[i] = bits128fillZeros(data, start, end, n);
+ start += n;
+
+ uint encoded_bits = bits128fillZeros(data, start, end, kInterleavedBits[i]);
+ start += kInterleavedBits[i];
+ encoded |= encoded_bits << encoded_bits_read;
+ encoded_bits_read += kInterleavedBits[i];
+ }
+
+ uint[kNumVals] result;
+ for (int i = 0; i < kNumVals; ++i) {
+ result[i] = kTritEncodings[encoded][i] << n | m[i];
+ }
+ return result;
+}
+
+uint[3] decode_quint(uvec4 data, uint start, uint end, uint n) {
+ // We either have three quints or five trits
+ const int kNumVals = 3;
+ const int kInterleavedBits[3] = {3, 2, 2};
+
+ // Decode the block
+ uint m[kNumVals];
+ uint encoded = 0;
+ uint encoded_bits_read = 0;
+ uint bitMask = (1 << n) - 1;
+ for (int i = 0; i < kNumVals; ++i) {
+ m[i] = bits128fillZeros(data, start, end, n);
+ start += n;
+
+ uint encoded_bits = bits128fillZeros(data, start, end, kInterleavedBits[i]);
+ start += kInterleavedBits[i];
+ encoded |= encoded_bits << encoded_bits_read;
+ encoded_bits_read += kInterleavedBits[i];
+ }
+
+ uint[kNumVals] result;
+ for (int i = 0; i < kNumVals; ++i) {
+ result[i] = kQuintEncodings[encoded][i] << n | m[i];
+ }
+ return result;
+}
+
+uint get_v_count(uint cem) { return (cem / 4 + 1) * 2; }
+
+const uint kLDRLumaDirect = 0;
+const uint kLDRLumaBaseOffset = 1;
+const uint kHDRLumaLargeRange = 2;
+const uint kHDRLumaSmallRange = 3;
+const uint kLDRLumaAlphaDirect = 4;
+const uint kLDRLumaAlphaBaseOffset = 5;
+const uint kLDRRGBBaseScale = 6;
+const uint kHDRRGBBaseScale = 7;
+const uint kLDRRGBDirect = 8;
+const uint kLDRRGBBaseOffset = 9;
+const uint kLDRRGBBaseScaleTwoA = 10;
+const uint kHDRRGBDirect = 11;
+const uint kLDRRGBADirect = 12;
+const uint kLDRRGBABaseOffset = 13;
+const uint kHDRRGBDirectLDRAlpha = 14;
+const uint kHDRRGBDirectHDRAlpha = 15;
+
+void swap(inout ivec4 v1, inout ivec4 v2) {
+ ivec4 tmp = v1;
+ v1 = v2;
+ v2 = tmp;
+}
+
+void bit_transfer_signed(inout int a, inout int b) {
+ b >>= 1;
+ b |= (a & 0x80);
+ a >>= 1;
+ a &= 0x3F;
+ if ((a & 0x20) != 0) a -= 0x40;
+}
+
+void blue_contract(inout ivec4 val) {
+ val.r = (val.r + val.b) / 2;
+ val.g = (val.g + val.b) / 2;
+}
+
+void decode_ldr_for_mode(const uint[40] vals, uint start_idx, uint mode, out uvec4 c1,
+ out uvec4 c2) {
+ int v0 = int(vals[start_idx + 0]);
+ int v1 = int(vals[start_idx + 1]);
+ int v2 = int(vals[start_idx + 2]);
+ int v3 = int(vals[start_idx + 3]);
+ int v4 = int(vals[start_idx + 4]);
+ int v5 = int(vals[start_idx + 5]);
+ int v6 = int(vals[start_idx + 6]);
+ int v7 = int(vals[start_idx + 7]);
+ ivec4 endpoint_low_rgba;
+ ivec4 endpoint_high_rgba;
+ switch (mode) {
+ case kLDRLumaDirect: {
+ endpoint_low_rgba = ivec4(v0, v0, v0, 255);
+ endpoint_high_rgba = ivec4(v1, v1, v1, 255);
+ } break;
+
+ case kLDRLumaBaseOffset: {
+ const int l0 = (v0 >> 2) | (v1 & 0xC0);
+ const int l1 = min(l0 + (v1 & 0x3F), 0xFF);
+
+ endpoint_low_rgba = ivec4(l0, l0, l0, 255);
+ endpoint_high_rgba = ivec4(l1, l1, l1, 255);
+ } break;
+
+ case kLDRLumaAlphaDirect: {
+ endpoint_low_rgba = ivec4(v0, v0, v0, v2);
+ endpoint_high_rgba = ivec4(v1, v1, v1, v3);
+ } break;
+
+ case kLDRLumaAlphaBaseOffset: {
+ bit_transfer_signed(v1, v0);
+ bit_transfer_signed(v3, v2);
+
+ endpoint_low_rgba = clamp(ivec4(v0, v0, v0, v2), 0, 255);
+ const int high_luma = v0 + v1;
+ endpoint_high_rgba = clamp(ivec4(high_luma, high_luma, high_luma, v2 + v3), 0, 255);
+ } break;
+
+ case kLDRRGBBaseScale: {
+ endpoint_high_rgba = ivec4(v0, v1, v2, 255);
+ for (int i = 0; i < 3; ++i) {
+ const int x = endpoint_high_rgba[i];
+ endpoint_low_rgba[i] = (x * v3) >> 8;
+ }
+ endpoint_low_rgba[3] = 255;
+ } break;
+
+ case kLDRRGBDirect: {
+ const int s0 = v0 + v2 + v4;
+ const int s1 = v1 + v3 + v5;
+
+ endpoint_low_rgba = ivec4(v0, v2, v4, 255);
+ endpoint_high_rgba = ivec4(v1, v3, v5, 255);
+
+ if (s1 < s0) {
+ swap(endpoint_low_rgba, endpoint_high_rgba);
+ blue_contract(endpoint_low_rgba);
+ blue_contract(endpoint_high_rgba);
+ }
+ } break;
+
+ case kLDRRGBBaseOffset: {
+ bit_transfer_signed(v1, v0);
+ bit_transfer_signed(v3, v2);
+ bit_transfer_signed(v5, v4);
+
+ endpoint_low_rgba = ivec4(v0, v2, v4, 255);
+ endpoint_high_rgba = ivec4(v0 + v1, v2 + v3, v4 + v5, 255);
+
+ if (v1 + v3 + v5 < 0) {
+ swap(endpoint_low_rgba, endpoint_high_rgba);
+ blue_contract(endpoint_low_rgba);
+ blue_contract(endpoint_high_rgba);
+ }
+
+ endpoint_low_rgba = clamp(endpoint_low_rgba, 0, 255);
+ endpoint_high_rgba = clamp(endpoint_high_rgba, 0, 255);
+ } break;
+
+ case kLDRRGBBaseScaleTwoA: {
+ // Base
+ endpoint_low_rgba = endpoint_high_rgba = ivec4(v0, v1, v2, 255);
+
+ // Scale
+ endpoint_low_rgba = (endpoint_low_rgba * v3) >> 8;
+
+ // Two A
+ endpoint_low_rgba[3] = v4;
+ endpoint_high_rgba[3] = v5;
+ } break;
+
+ case kLDRRGBADirect: {
+ const uint s0 = v0 + v2 + v4;
+ const uint s1 = v1 + v3 + v5;
+
+ endpoint_low_rgba = ivec4(v0, v2, v4, v6);
+ endpoint_high_rgba = ivec4(v1, v3, v5, v7);
+
+ if (s1 < s0) {
+ swap(endpoint_low_rgba, endpoint_high_rgba);
+ blue_contract(endpoint_low_rgba);
+ blue_contract(endpoint_high_rgba);
+ }
+ } break;
+
+ case kLDRRGBABaseOffset: {
+ bit_transfer_signed(v1, v0);
+ bit_transfer_signed(v3, v2);
+ bit_transfer_signed(v5, v4);
+ bit_transfer_signed(v7, v6);
+
+ endpoint_low_rgba = ivec4(v0, v2, v4, v6);
+ endpoint_high_rgba = ivec4(v0 + v1, v2 + v3, v4 + v5, v6 + v7);
+
+ if (v1 + v3 + v5 < 0) {
+ swap(endpoint_low_rgba, endpoint_high_rgba);
+ blue_contract(endpoint_low_rgba);
+ blue_contract(endpoint_high_rgba);
+ }
+
+ endpoint_low_rgba = clamp(endpoint_low_rgba, 0, 255);
+ endpoint_high_rgba = clamp(endpoint_high_rgba, 0, 255);
+ } break;
+
+ default:
+ // Unimplemented color encoding.
+ // TODO(google): Is this the correct error handling?
+ endpoint_high_rgba = endpoint_low_rgba = ivec4(0, 0, 0, 0);
+ }
+ c1 = uvec4(endpoint_low_rgba);
+ c2 = uvec4(endpoint_high_rgba);
+}
+
+uint hash52(uint p) {
+ p ^= p >> 15;
+ p -= p << 17;
+ p += p << 7;
+ p += p << 4;
+ p ^= p >> 5;
+ p += p << 16;
+ p ^= p >> 7;
+ p ^= p >> 3;
+ p ^= p << 6;
+ p ^= p >> 17;
+ return p;
+}
+
+uint select_partition(uint seed, uint x, uint y, uint partitioncount) {
+ if (partitioncount == 1) {
+ return 0;
+ }
+ uint z = 0;
+ if (u_pushConstant.smallBlock != 0) {
+ x <<= 1;
+ y <<= 1;
+ }
+ seed += (partitioncount - 1) * 1024;
+ uint rnum = hash52(seed);
+ uint seed1 = rnum & 0xF;
+ uint seed2 = (rnum >> 4) & 0xF;
+ uint seed3 = (rnum >> 8) & 0xF;
+ uint seed4 = (rnum >> 12) & 0xF;
+ uint seed5 = (rnum >> 16) & 0xF;
+ uint seed6 = (rnum >> 20) & 0xF;
+ uint seed7 = (rnum >> 24) & 0xF;
+ uint seed8 = (rnum >> 28) & 0xF;
+ uint seed9 = (rnum >> 18) & 0xF;
+ uint seed10 = (rnum >> 22) & 0xF;
+ uint seed11 = (rnum >> 26) & 0xF;
+ uint seed12 = ((rnum >> 30) | (rnum << 2)) & 0xF;
+
+ seed1 *= seed1;
+ seed2 *= seed2;
+ seed3 *= seed3;
+ seed4 *= seed4;
+ seed5 *= seed5;
+ seed6 *= seed6;
+ seed7 *= seed7;
+ seed8 *= seed8;
+ seed9 *= seed9;
+ seed10 *= seed10;
+ seed11 *= seed11;
+ seed12 *= seed12;
+
+ uint sh1, sh2, sh3;
+ if ((seed & 1) != 0) {
+ sh1 = ((seed & 2) != 0 ? 4 : 5);
+ sh2 = (partitioncount == 3 ? 6 : 5);
+ } else {
+ sh1 = (partitioncount == 3 ? 6 : 5);
+ sh2 = ((seed & 2) != 0 ? 4 : 5);
+ }
+ sh3 = ((seed & 0x10) != 0) ? sh1 : sh2;
+
+ seed1 >>= sh1;
+ seed2 >>= sh2;
+ seed3 >>= sh1;
+ seed4 >>= sh2;
+ seed5 >>= sh1;
+ seed6 >>= sh2;
+ seed7 >>= sh1;
+ seed8 >>= sh2;
+ seed9 >>= sh3;
+ seed10 >>= sh3;
+ seed11 >>= sh3;
+ seed12 >>= sh3;
+
+ uint a = seed1 * x + seed2 * y + seed11 * z + (rnum >> 14);
+ uint b = seed3 * x + seed4 * y + seed12 * z + (rnum >> 10);
+ uint c = seed5 * x + seed6 * y + seed9 * z + (rnum >> 6);
+ uint d = seed7 * x + seed8 * y + seed10 * z + (rnum >> 2);
+
+ a &= 0x3F;
+ b &= 0x3F;
+ c &= 0x3F;
+ d &= 0x3F;
+
+ if (partitioncount < 4) d = 0;
+ if (partitioncount < 3) c = 0;
+
+ if (a >= b && a >= c && a >= d)
+ return 0;
+ else if (b >= c && b >= d)
+ return 1;
+ else if (c >= d)
+ return 2;
+ else
+ return 3;
+}
+
+uvec4[144] single_color_block(uvec4 color) {
+ uvec4 ret[144];
+ for (int h = 0; h < u_pushConstant.blockSize.y; h++) {
+ for (int w = 0; w < u_pushConstant.blockSize.x; w++) {
+ ret[h * u_pushConstant.blockSize.x + w] = color;
+ }
+ }
+ return ret;
+}
+
+uvec4[144] error_color_block() { return single_color_block(uvec4(0xff, 0, 0xff, 0xff)); }
+
+uvec4[144] astc_decode_block(const uvec4 u) {
+ uint d;
+ uint hdr;
+ uint b;
+ uint a;
+ uint r;
+ uint width;
+ uint height;
+ uvec4 cem;
+ uint weightGrid[120];
+ const uint u3 = u[3];
+ const uint b87 = u3 >> 7 & 3;
+ const uint b65 = u3 >> 5 & 3;
+ const uint b32 = u3 >> 2 & 3;
+ a = b65;
+ b = b87;
+ d = bit(u3, 10);
+ hdr = bit(u3, 9);
+ if ((u3 & 3) == 0) {
+ r = b32 << 1 | bit(u3, 4);
+ if (b87 == 0) {
+ width = 12;
+ height = a + 2;
+ } else if (b87 == 1) {
+ width = a + 2;
+ height = 12;
+ } else if (b87 == 3) {
+ if (b65 == 0) {
+ width = 6;
+ height = 10;
+ } else if (b65 == 1) {
+ width = 10;
+ height = 6;
+ } else if ((u3 & 0xDFF) == 0xDFC) {
+ // Void-extent
+ // In void extend, the last 12 bits should be
+ // 1 1 D 1 1 1 1 1 1 1 0 0
+ // Where D is the HDR bit
+
+ uvec4 color =
+ uvec4(u[1] >> 8 & 0xff, u[1] >> 24 & 0xff, u[0] >> 8 & 0xff, u[0] >> 24 & 0xff);
+ return single_color_block(color);
+ } else { // reserved
+ return error_color_block();
+ }
+ } else { // b87 == 2
+ b = u3 >> 9 & 3;
+ width = a + 6;
+ height = b + 6;
+ d = 0;
+ hdr = 0;
+ }
+ } else {
+ r = (u3 & 3) << 1 | bit(u3, 4);
+ if (b32 == 0) {
+ width = b + 4;
+ height = a + 2;
+ } else if (b32 == 1) {
+ width = b + 8;
+ height = a + 2;
+ } else if (b32 == 2) {
+ width = a + 2;
+ height = b + 8;
+ } else if (bit(u3, 8) == 0) {
+ width = a + 2;
+ height = (b & 1) + 6;
+ } else {
+ width = (b & 1) + 2;
+ height = a + 2;
+ }
+ }
+
+ if (width > u_pushConstant.blockSize.x || height > u_pushConstant.blockSize.y) {
+ return error_color_block();
+ }
+ // Decode weight
+ uint trits = 0;
+ uint quints = 0;
+ uint bits = 0;
+ const uint weightCounts = height * width * (d + 1);
+ const int kMaxNumWeights = 64;
+ if (kMaxNumWeights < weightCounts) {
+ return error_color_block();
+ }
+ {
+ if (hdr == 0) {
+ switch (r) {
+ case 2:
+ bits = 1;
+ break;
+ case 3:
+ trits = 1;
+ break;
+ case 4:
+ bits = 2;
+ break;
+ case 5:
+ quints = 1;
+ break;
+ case 6:
+ trits = 1;
+ bits = 1;
+ break;
+ case 7:
+ bits = 3;
+ break;
+ default:
+ return error_color_block();
+ }
+ } else {
+ switch (r) {
+ case 2:
+ bits = 1;
+ quints = 1;
+ break;
+ case 3:
+ trits = 1;
+ bits = 2;
+ break;
+ case 4:
+ bits = 4;
+ break;
+ case 5:
+ quints = 1;
+ bits = 2;
+ break;
+ case 6:
+ trits = 1;
+ bits = 3;
+ break;
+ case 7:
+ bits = 5;
+ break;
+ default:
+ return error_color_block();
+ }
+ }
+ uint packedSize = 0;
+ uint pack = 0;
+ get_pack_size(trits, quints, bits, pack, packedSize);
+ uint srcIdx = 0;
+ uint dstIdx = 0;
+ uvec4 uReversed = bitfieldReverse(u);
+ const uint weightBitCount = get_bit_count(weightCounts, trits, quints, bits);
+ const int kWeightGridMinBitLength = 24;
+ const int kWeightGridMaxBitLength = 96;
+ if (weightBitCount < kWeightGridMinBitLength || weightBitCount > kWeightGridMaxBitLength) {
+ return error_color_block();
+ }
+ uReversed = uvec4(uReversed[3], uReversed[2], uReversed[1], uReversed[0]);
+ const uint kUnquantBinMulTable[] = {0x3f, 0x15, 0x9, 0x4, 0x2, 0x1};
+ const uint kUnquantBinMovTable[] = {0x8, 0x8, 0x8, 0x2, 0x4, 0x8};
+ while (dstIdx < weightCounts) {
+ if (trits == 1) {
+ uint decoded[5] = decode_trit(uReversed, srcIdx, weightBitCount, bits);
+ // uint decoded[5] = {0, 0, 0, 0, 0};
+ for (int i = 0; i < 5; i++) {
+ weightGrid[dstIdx] =
+ kUnquantTritWeightMap[kUnquantTritWeightMapBitIdx[bits] + decoded[i]];
+ if (weightGrid[dstIdx] > 32) {
+ weightGrid[dstIdx] += 1;
+ }
+ dstIdx++;
+ if (dstIdx >= weightCounts) {
+ break;
+ }
+ }
+ } else if (quints == 1) {
+ uint decoded[3] = decode_quint(uReversed, srcIdx, weightBitCount, bits);
+ for (int i = 0; i < 3; i++) {
+ // TODO: handle overflow in the last
+ weightGrid[dstIdx] =
+ kUnquantQuintWeightMap[kUnquantQuintWeightMapBitIdx[bits] + decoded[i]];
+ if (weightGrid[dstIdx] > 32) {
+ weightGrid[dstIdx] += 1;
+ }
+ dstIdx++;
+ if (dstIdx >= weightCounts) {
+ break;
+ }
+ }
+ } else {
+ uint decodedRaw = bits128(uReversed, srcIdx, packedSize);
+ uint decoded = decodedRaw * kUnquantBinMulTable[bits - 1] |
+ decodedRaw >> kUnquantBinMovTable[bits - 1];
+ weightGrid[dstIdx] = decoded;
+ if (weightGrid[dstIdx] > 32) {
+ weightGrid[dstIdx] += 1;
+ }
+ dstIdx++;
+ }
+ srcIdx += packedSize;
+ }
+ }
+ uint partitionCount = (u3 >> 11 & 3) + 1;
+ if (d == 1 && partitionCount == 4) {
+ return error_color_block();
+ }
+ const uint weightStart = 128 - get_bit_count(weightCounts, trits, quints, bits);
+ uint dualPlaneStart = 0;
+ // Decode cem mode
+ if (partitionCount == 1) {
+ // Single-partition mode
+ cem[0] = u3 >> 13 & 0xf;
+ dualPlaneStart = weightStart - d * 2;
+ } else {
+ // Multi-partition mode
+ // Calculate CEM for all 4 partitions, even when partitionCount < 4
+ uint partMode = u3 >> 23 & 3;
+ const uint kExtraMBitsTable[4] = {0, 2, 5, 8};
+ const uint extraMBitCount = (partMode == 0) ? 0 : kExtraMBitsTable[partitionCount - 1];
+ const uint extraMStart = weightStart - extraMBitCount;
+ dualPlaneStart = extraMStart - d * 2;
+
+ if (partMode == 0) {
+ uint cem_all = u3 >> 25 & 0xf;
+ cem = uvec4(cem_all, cem_all, cem_all, cem_all);
+ } else {
+ uint cemBase = partMode - 1;
+ uvec4 cemHigh = cemBase + uvec4(bit(u3, 25), bit(u3, 26), bit(u3, 27), bit(u3, 28));
+ const uint extraM = bits128(u, extraMStart, extraMBitCount);
+ const uint kMainMBitsTable[4] = {0, 2, 1, 0};
+ const uint mainMBitCount = kMainMBitsTable[partitionCount - 1];
+ const uint m = extraM << mainMBitCount | ((u3 >> 27 & 3) >> (2 - mainMBitCount));
+ cem = cemHigh << 2 | uvec4(m & 3, m >> 2 & 3, m >> 4 & 3, m >> 6 & 3);
+ }
+ }
+ // Decode end points
+ uvec4 endPoints[4][2];
+ {
+ uint totalV = 0;
+ for (uint part = 0; part < partitionCount; part++) {
+ totalV += get_v_count(cem[part]);
+ }
+ const uint epStart = (partitionCount == 1) ? 17 : 29;
+ const uint totalAvailBits = dualPlaneStart - epStart;
+ if (totalAvailBits >= 128) {
+ // overflowed
+ return error_color_block();
+ }
+ uint epQuints = 0;
+ uint epTrits = 0;
+ uint epBits = 0;
+ uint i;
+ for (i = 0; i < kRQuantParamTableLength; i++) {
+ epTrits = kRQuantParamTable[i][0];
+ epQuints = kRQuantParamTable[i][1];
+ epBits = kRQuantParamTable[i][2];
+ if (get_bit_count(totalV, epTrits, epQuints, epBits) <= totalAvailBits) {
+ break;
+ }
+ }
+ if (i >= kRQuantParamTableLength) {
+ return error_color_block();
+ }
+
+ const uint epBitCount = get_bit_count(totalV, epTrits, epQuints, epBits);
+ const uint epEnd = epStart + epBitCount;
+ uint packedSize = 0;
+ uint pack = 0;
+ get_pack_size(epTrits, epQuints, epBits, pack, packedSize);
+
+ // Decode end point parameters into buffer
+ uint vBuffer[40];
+ uint srcIdx = epStart;
+ uint dstIdx = 0;
+ const uint kUnquantBinMulTable[8] = {0xff, 0x55, 0x24, 0x11, 0x8, 0x4, 0x2, 0x1};
+ const uint kUnquantBinMovTable[8] = {8, 8, 1, 8, 2, 4, 6, 8};
+ while (dstIdx < totalV) {
+ if (epTrits == 1) {
+ uint decoded[5] = decode_trit(u, srcIdx, epEnd, epBits);
+ for (int i = 0; i < 5; i++) {
+ vBuffer[dstIdx] =
+ kUnquantTritColorMap[kUnquantTritColorMapBitIdx[epBits] + decoded[i]];
+ dstIdx++;
+ if (dstIdx >= totalV) {
+ break;
+ }
+ }
+ } else if (epQuints == 1) {
+ uint decoded[3] = decode_quint(u, srcIdx, epEnd, epBits);
+ for (int i = 0; i < 3; i++) {
+ vBuffer[dstIdx] =
+ kUnquantQuintColorMap[kUnquantQuintColorMapBitIdx[epBits] + decoded[i]];
+ dstIdx++;
+ if (dstIdx >= totalV) {
+ break;
+ }
+ }
+ } else {
+ uint src = bits128(u, srcIdx, packedSize);
+ uint decoded =
+ src * kUnquantBinMulTable[epBits - 1] | src >> kUnquantBinMovTable[epBits - 1];
+ vBuffer[dstIdx] = decoded;
+ dstIdx++;
+ }
+ srcIdx += packedSize;
+ }
+ uint bufferIdx = 0;
+ for (uint part = 0; part < partitionCount; part++) {
+ // TODO: HDR support
+ decode_ldr_for_mode(vBuffer, bufferIdx, cem[part], endPoints[part][0],
+ endPoints[part][1]);
+ bufferIdx += get_v_count(cem[part]);
+ }
+ }
+ uvec4 ret[144];
+ {
+ uvec2 dst = (1024 + u_pushConstant.blockSize / 2) / (u_pushConstant.blockSize - 1);
+ uint dd = d + 1;
+ for (uint h = 0; h < u_pushConstant.blockSize.y; h++) {
+ for (uint w = 0; w < u_pushConstant.blockSize.x; w++) {
+ uint part = select_partition(u3 >> 13 & 1023, w, h, partitionCount);
+ if (kHDRCEM[cem[part]]) {
+ // HDR not supported
+ ret[h * u_pushConstant.blockSize.x + w] = uvec4(0xff, 0, 0xff, 0xff);
+ continue;
+ }
+ // Calculate weight
+ uvec2 st = uvec2(w, h);
+ uvec2 cst = dst * st;
+ uvec2 gst = (cst * (uvec2(width, height) - 1) + 32) >> 6;
+ uvec2 jst = gst >> 4;
+ uvec2 fst = gst & 0xf;
+ uint v0 = jst.x + jst.y * width;
+ uvec2 p00 = uvec2(weightGrid[v0 * dd], weightGrid[v0 * dd + 1]);
+ uvec2 p01 = uvec2(weightGrid[(v0 + 1) * dd], weightGrid[(v0 + 1) * dd + 1]);
+ uvec2 p10 = uvec2(weightGrid[(v0 + width) * dd], weightGrid[(v0 + width) * dd + 1]);
+ uvec2 p11 =
+ uvec2(weightGrid[(v0 + width + 1) * dd], weightGrid[(v0 + width + 1) * dd + 1]);
+ uint w11 = (fst.x * fst.y + 8) >> 4;
+ uint w10 = fst.y - w11;
+ uint w01 = fst.x - w11;
+ uint w00 = 16 - fst.x - fst.y + w11;
+ uvec2 i = (p00 * w00 + p01 * w01 + p10 * w10 + p11 * w11 + 8) >> 4;
+
+ uvec4 c0 = endPoints[part][0];
+ uvec4 c1 = endPoints[part][1];
+ uvec4 c = (c0 * (64 - i[0]) + c1 * i[0] + 32) / 64;
+ if (d == 1) {
+ uint ccs = bits128(u, dualPlaneStart, 2);
+ c[ccs] = (c0[ccs] * (64 - i[1]) + c1[ccs] * i[1] + 32) / 64;
+ }
+ ret[h * u_pushConstant.blockSize.x + w] = c;
+ }
+ }
+ }
+ return ret;
+}
+
+uint block_y_size_1DArray() { return 1; }
+
+uint block_y_size_2DArray() { return u_pushConstant.blockSize.y; }
+
+uint block_y_size_3D() { return u_pushConstant.blockSize.y; }
+
+uvec4 flip32(uvec4 a) {
+ return ((a & 0xff) << 24) | ((a & 0xff00) << 8) | ((a & 0xff0000) >> 8) |
+ ((a & 0xff000000) >> 24);
+}
+
+void main(void) {
+ ivec3 pos = ivec3(gl_GlobalInvocationID.xyz);
+ pos.z += int(u_pushConstant.baseLayer);
+ uvec4 srcBlock = uvec4(imageLoad(u_image0, WITH_TYPE(getPos)(pos)));
+ srcBlock = uvec4(srcBlock[3], srcBlock[2], srcBlock[1], srcBlock[0]);
+ uvec4[144] decompressed = astc_decode_block(srcBlock);
+
+ for (uint y = 0; y < WITH_TYPE(block_y_size_)(); y++) {
+ for (uint x = 0; x < u_pushConstant.blockSize.x; x++) {
+ imageStore(
+ u_image1,
+ WITH_TYPE(getPos)(ivec3(pos.xy * u_pushConstant.blockSize + ivec2(x, y), pos.z)),
+ decompressed[y * u_pushConstant.blockSize.x + x]);
+ }
+ }
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcDecompressor.glsl b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcDecompressor.glsl
new file mode 100644
index 00000000000..7f0b2a29fa8
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcDecompressor.glsl
@@ -0,0 +1,643 @@
+// Compute shader to perform ASTC decoding.
+//
+// Usage:
+// #include "AstcDecompressor.glsl"
+//
+// main() {
+// uvec4 astcBlock = ... // read an ASTC block
+// astcDecoderInitialize(astcBlock, blockSize);
+// uvec2 posInBlock = uvec2(0, 0); // which texel we want to decode in the block
+// uvec4 texel = astcDecodeTexel(pos);
+// }
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Please refer for the ASTC spec for all the details:
+// https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_texture_compression_astc_hdr.txt
+//
+//
+// Quick reminder of an ASTC block layout
+// --------------------------------------
+//
+// Each ASTC block is 128 bits. From top to bottom (from bit 127 to bit 0), we have:
+// 1. weight data (24 - 96 bits). Starts at bit 127 and grows down. (So it needs to be reversed)
+// 2. extra CEM data. 0 bits if only 1 partition OR if CEM selector value in bits [24:23] is 00,
+// otherwise 2, 5 or 8 bits for 2, 3, or 4 partitions respectively.
+// 3. color component selector (CCS) - 2 bits if dual plane is active, otherwise 0 bits.
+// 4. Color endpoint data - variable length
+// 5. CEM 4 bits if single partition, else 6 bits.
+// 6. partition seed 10 bits (13-22) - only if more than 1 partition
+// 7. partition count 2 bits (11-12)
+// 8. block mode 11 bits ( 0-10)
+//
+// Optimization ideas
+// ------------------
+//
+// 1. Use a uniform buffer instead of static arrays to load the tables in AstcLookupTables.glsl
+// 2. Investigate using SSBO or sampled image instead of storage image for the input.
+// 3. Make decodeTrit() / decodeQuint() return a pair of values, since we always need at least 2
+// 4. Look into which queue we use to run the shader, some GPUs may have a separate compute queue.
+// 5. Use a `shared` variable to share the block data and common block config, once we change the
+// local group size to match the block size.
+//
+// Missing features
+// ----------------
+//
+// 1. Make sure we cover all the cases where we should return the error color? See section C.2.24
+// Illegal Encodings for the full list.
+// 2. Add support for 3D slices.
+// 3. HDR support? Probably not worth it.
+
+#include "AstcLookupTables.glsl"
+
+const uvec4 kErrorColor = uvec4(255, 0, 255, 255); // beautiful magenta, as per the spec
+
+// Global variables ////////////////////////////////////////////////////////////////////////////////
+
+uvec4 astcBlock; // Full ASTC block data
+uvec2 blockSize; // Size of the ASTC block
+bool decodeError; // True if there's an error in the block.
+bool voidExtent; // True if void-extent block (all pixels are the same color)
+bool dualPlane; // True for dual plane blocks (a block with 2 sets of weights)
+uvec2 weightGridSize; // Width and height of the weight grid. Always <= blockSize.
+uint numWeights; // Number of weights
+uvec3 weightEncoding; // Number of trits (x), quints (y) and bits (z) to encode the weights.
+uint weightDataSize; // Size of the weight data in bits
+uint numPartitions; // Number of partitions (1-4)
+uint partitionSeed; // Determines which partition pattern we use (10 bits)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Returns the number of bits needed to encode `numVals` values using a given encoding.
+// encoding: number of trits (x), quints (y) and bits (z) used for the encoding.
+uint getEncodingSize(uint numVals, uvec3 encoding) {
+ // See section C.2.22.
+ uvec2 tqBits = (numVals * encoding.xy * uvec2(8, 7) + uvec2(4, 2)) / uvec2(5, 3);
+ return numVals * encoding.z + (tqBits.x + tqBits.y);
+}
+
+// This function sets all the global variables above
+void astcDecoderInitialize(uvec4 blockData, uvec2 blockSize_) {
+ astcBlock = blockData;
+ blockSize = blockSize_;
+ decodeError = false;
+
+ voidExtent = (astcBlock[3] & 0x1FF) == 0x1FC;
+ if (voidExtent) return;
+
+ const uint bits01 = bitfieldExtract(astcBlock[3], 0, 2);
+ const uint bits23 = bitfieldExtract(astcBlock[3], 2, 2);
+ const uint bit4 = bitfieldExtract(astcBlock[3], 4, 1);
+ const uint bits56 = bitfieldExtract(astcBlock[3], 5, 2);
+ const uint bits78 = bitfieldExtract(astcBlock[3], 7, 2);
+
+ uint r;
+ uint h = bitfieldExtract(astcBlock[3], 9, 1);
+ dualPlane = bool(bitfieldExtract(astcBlock[3], 10, 1));
+
+ // Refer to "Table C.2.8 - 2D Block Mode Layout"
+ if (bits01 == 0) {
+ r = bits23 << 1 | bit4;
+ switch (bits78) {
+ case 0:
+ weightGridSize = uvec2(12, bits56 + 2);
+ break;
+ case 1:
+ weightGridSize = uvec2(bits56 + 2, 12);
+ break;
+ case 2:
+ weightGridSize = uvec2(bits56 + 6, bitfieldExtract(astcBlock[3], 9, 2) + 6);
+ dualPlane = false;
+ h = 0;
+ break;
+ case 3:
+ if (bits56 == 0) {
+ weightGridSize = uvec2(6, 10);
+ } else if (bits56 == 1) {
+ weightGridSize = uvec2(10, 6);
+ } else {
+ decodeError = true;
+ return;
+ }
+ }
+ } else {
+ r = bits01 << 1 | bit4;
+ switch (bits23) {
+ case 0:
+ weightGridSize = uvec2(bits78 + 4, bits56 + 2);
+ break;
+ case 1:
+ weightGridSize = uvec2(bits78 + 8, bits56 + 2);
+ break;
+ case 2:
+ weightGridSize = uvec2(bits56 + 2, bits78 + 8);
+ break;
+ case 3:
+ if (bits78 >> 1 == 0) {
+ weightGridSize = uvec2(bits56 + 2, (bits78 & 1) + 6);
+ } else {
+ weightGridSize = uvec2((bits78 & 1) + 2, bits56 + 2);
+ }
+ }
+ }
+
+ if (any(greaterThan(weightGridSize, blockSize))) {
+ decodeError = true;
+ return;
+ }
+
+ // weigths
+ weightEncoding = kWeightEncodings[h << 3 | r];
+ numWeights = (weightGridSize.x * weightGridSize.y) << int(dualPlane);
+ weightDataSize = getEncodingSize(numWeights, weightEncoding);
+ if (weightDataSize < 24 || weightDataSize > 96 || numWeights > 64) {
+ decodeError = true;
+ return;
+ }
+
+ numPartitions = bitfieldExtract(astcBlock[3], 11, 2) + 1;
+ if (numPartitions > 1) {
+ partitionSeed = bitfieldExtract(astcBlock[3], 13, 10);
+ }
+
+ if (dualPlane && numPartitions == 4) {
+ decodeError = true;
+ return;
+ }
+}
+
+// Extracts a range of bits from a uvec4, treating it as a single 128-bit field.
+// offset: index of the first bit to extract (0-127).
+// numBits: number of bits to extract. (0-32). If numBits is 0, this returns 0.
+// Result is undefined if offset >= 128 or offset + numBits > 128
+uint extractBits(uvec4 data, uint offset, uint numBits) {
+ if (numBits == 0) return 0;
+
+ const uint i = 3 - offset / 32;
+ const uint j = 3 - (offset + numBits - 1) / 32;
+ const uint start = offset & 31;
+ if (i == j) {
+ // All the bits to extract are located on the same component of the vector
+ return bitfieldExtract(data[i], int(start), int(numBits));
+ } else {
+ uint numLowBits = 32 - start;
+ uint lowBits = bitfieldExtract(data[i], int(start), int(numLowBits));
+ uint highBits = bitfieldExtract(data[j], 0, int(numBits - numLowBits));
+ return (highBits << numLowBits) | lowBits;
+ }
+}
+
+// Returns the CEM, a number between 0 and 15 that determines how the endpoints are encoded.
+// Also sets a couple of output parameters:
+// - startOfExtraCem: bit position of the start of the extra CEM
+// - totalEndpoints: number of endpoints in the block, for all partitions.
+// - baseEndpointIndex: index of the first endpoint for this partition
+// Refer to "Section C.2.11 Color Endpoint Mode" for decoding details
+uint decodeCEM(uint partitionIndex, out uint startOfExtraCem, out uint totalEndpoints,
+ out uint baseEndpointIndex) {
+ if (numPartitions == 1) {
+ startOfExtraCem = 128 - weightDataSize;
+ const uint cem = bitfieldExtract(astcBlock[3], 13, 4);
+ totalEndpoints = 2 * (cem >> 2) + 2;
+ baseEndpointIndex = 0;
+ return cem;
+ } else {
+ const uint cemSelector = bitfieldExtract(astcBlock[3], 23, 2);
+ const uint baseCem = bitfieldExtract(astcBlock[3], 25, 4);
+
+ if (cemSelector == 0) {
+ // We're in the multi-partition, single CEM case
+ startOfExtraCem = 128 - weightDataSize;
+ const uint endpointsPerPartition = 2 * (baseCem >> 2) + 2;
+ totalEndpoints = endpointsPerPartition * numPartitions;
+ baseEndpointIndex = endpointsPerPartition * partitionIndex;
+ return baseCem;
+ } else {
+ // Refer to "Figure C.4" for the details of the encoding here.
+
+ // Size in bits of the extra CEM data, which is located right after the weight data.
+ const uint sizeOfExtraCem = 3 * numPartitions - 4;
+ startOfExtraCem = 128 - weightDataSize - sizeOfExtraCem;
+
+ // Extract the extra CEM data
+ const uint extraCem = extractBits(astcBlock, startOfExtraCem, sizeOfExtraCem);
+ const uint fullCem = extraCem << 4 | baseCem;
+
+ const uint mValue =
+ bitfieldExtract(fullCem, int(2 * partitionIndex + numPartitions), 2);
+ const uint cValues = bitfieldExtract(fullCem, 0, int(numPartitions));
+
+ // TODO(gregschlom): investigate whether a couple of small lookup tables would be more
+ // efficient here.
+ totalEndpoints = 2 * (cemSelector * numPartitions + bitCount(cValues));
+ baseEndpointIndex = 2 * (cemSelector * partitionIndex +
+ bitCount(bitfieldExtract(cValues, 0, int(partitionIndex))));
+ uint baseClass = cemSelector - 1 + bitfieldExtract(cValues, int(partitionIndex), 1);
+ return baseClass << 2 | mValue;
+ }
+ }
+}
+
+// Decodes a single trit within a block of 5.
+// offset: bit offset where the block of trits starts, within the 128 bits of data
+// numBits: how many bits are used to encode the LSB (0-6)
+// i: index of the trit within the block (0-4)
+// See section "C.2.12 Integer Sequence Encoding"
+uint decodeTrit(uvec4 data, uint offset, uint numBits, uint i) {
+ const int inumBits = int(numBits);
+
+ // In the largest encoding possible (1 trit + 6 bits), the block is 38 bits long (5 * 6 + 8).
+ // Since this wouldn't fit in 32 bits, we extract the low bits for the trit index 0 separately,
+ // this way we only need at most 4 * 6 + 8 = 32 bits, which fits perfectly.
+ const uint block = extractBits(data, offset + numBits, 4 * numBits + 8);
+
+ // Extract the 8 bits that encode the pack of 5 trits
+ // TODO(gregschlom): Optimization idea: if numbits == 0, then packedTrits = block. Worth doing?
+ const uint packedTrits = bitfieldExtract(block, 0, 2) |
+ bitfieldExtract(block, 1 * inumBits + 2, 2) << 2 |
+ bitfieldExtract(block, 2 * inumBits + 4, 1) << 4 |
+ bitfieldExtract(block, 3 * inumBits + 5, 2) << 5 |
+ bitfieldExtract(block, 4 * inumBits + 7, 1) << 7;
+
+ // Extract the LSB
+ uint lowBits;
+ if (i == 0) {
+ lowBits = extractBits(data, offset, numBits);
+ } else {
+ const int j = int(i) - 1;
+ const ivec4 deltas = {2, 4, 5, 7};
+ lowBits = bitfieldExtract(block, j * inumBits + deltas[j], inumBits);
+ }
+
+ const uint decoded = kTritEncodings[packedTrits];
+ return bitfieldExtract(decoded, 2 * int(i), 2) << numBits | lowBits;
+}
+
+// Decodes a single quint within a block of 3.
+// offset: bit offset where the block of quint starts, within the 128 bits of data
+// numBits: how many bits are used to encode the LSB (0-5)
+// i: index of the quint within the block (0-2)
+// See section "C.2.12 Integer Sequence Encoding"
+uint decodeQuint(uvec4 data, uint offset, uint numBits, uint i) {
+ const int inumBits = int(numBits);
+
+ // Note that we don't have the same size issue as trits (see above), since the largest encoding
+ // here is 1 quint and 5 bits, which is 3 * 5 + 7 = 22 bits long
+ const uint block = extractBits(data, offset, 3 * numBits + 7);
+
+ // Extract the 7 bits that encode the pack of 3 quints
+ const uint packedQuints = bitfieldExtract(block, inumBits, 3) |
+ bitfieldExtract(block, 2 * inumBits + 3, 2) << 3 |
+ bitfieldExtract(block, 3 * inumBits + 5, 2) << 5;
+
+ // Extract the LSB
+ const ivec3 deltas = {0, 3, 5};
+ const uint lowBits = bitfieldExtract(block, int(i) * inumBits + deltas[i], inumBits);
+
+ const uint decoded = kQuintEncodings[packedQuints];
+ return bitfieldExtract(decoded, 3 * int(i), 3) << numBits | lowBits;
+}
+
+uint decode1Weight(uvec4 weightData, uvec3 encoding, uint numWeights, uint index) {
+ if (index >= numWeights) return 0;
+
+ uint numBits = encoding.z;
+
+ if (encoding.x == 1) {
+ // 1 trit
+ uint offset = (index / 5) * (5 * numBits + 8);
+ uint w = decodeTrit(weightData, offset, numBits, index % 5);
+ return kUnquantTritWeightMap[3 * ((1 << numBits) - 1) + w];
+ } else if (encoding.y == 1) {
+ // 1 quint
+ uint offset = (index / 3) * (3 * numBits + 7);
+ uint w = decodeQuint(weightData, offset, numBits, index % 3);
+ return kUnquantQuintWeightMap[5 * ((1 << numBits) - 1) + w];
+ } else {
+ // only bits, no trits or quints. We can have between 1 and 6 bits.
+ uint offset = index * numBits;
+ uint w = extractBits(weightData, offset, numBits);
+
+ // The first number in the table is the multiplication factor: 63 / (2^numBits - 1)
+ // The second number is a shift factor to adjust when the previous result isn't an integer.
+ const uvec2 kUnquantTable[] = {{63, 8}, {21, 8}, {9, 8}, {4, 2}, {2, 4}, {1, 8}};
+ const uvec2 unquant = kUnquantTable[numBits - 1];
+ w = w * unquant.x | w >> unquant.y;
+ if (w > 32) w += 1;
+ return w;
+ }
+}
+
+uint interpolateWeights(uvec4 weightData, uvec3 encoding, uint numWeights, uint index,
+ uint gridWidth, uint stride, uint offset, uvec2 fractionalPart) {
+ uvec4 weightIndices = stride * (uvec4(index) + uvec4(0, 1, gridWidth, gridWidth + 1)) + offset;
+
+ // TODO(gregschlom): Optimization idea: instead of always decoding 4 weights, we could decode
+ // just what we need depending on whether fractionalPart.x and fractionalPart.y are 0
+ uvec4 weights = uvec4(decode1Weight(weightData, encoding, numWeights, weightIndices[0]),
+ decode1Weight(weightData, encoding, numWeights, weightIndices[1]),
+ decode1Weight(weightData, encoding, numWeights, weightIndices[2]),
+ decode1Weight(weightData, encoding, numWeights, weightIndices[3]));
+
+ uint w11 = (fractionalPart.x * fractionalPart.y + 8) >> 4;
+ uvec4 factors = uvec4(16 - fractionalPart.x - fractionalPart.y + w11, // w00
+ fractionalPart.x - w11, // w01
+ fractionalPart.y - w11, // w10
+ w11); // w11
+
+ return uint(dot(weights, factors) + 8) >> 4; // this is what the spec calls "effective weight"
+}
+
+uvec2 decodeWeights(uvec4 weightData, const uvec2 posInBlock) {
+ // Refer to "C.2.18 Weight Infill to interpolate between 4 grid points"
+
+ // TODO(gregschlom): The spec says: "since the block dimensions are constrained, these are
+ // easily looked up in a table." - Is it worth doing?
+ uvec2 scaleFactor = (1024 + blockSize / 2) / (blockSize - 1);
+
+ uvec2 homogeneousCoords = posInBlock * scaleFactor;
+ uvec2 gridCoords = (homogeneousCoords * (weightGridSize - 1) + 32) >> 6;
+ uvec2 integralPart = gridCoords >> 4;
+ uvec2 fractionalPart = gridCoords & 0xf;
+
+ uint gridWidth = weightGridSize.x;
+ uint v0 = integralPart.y * gridWidth + integralPart.x;
+
+ uvec2 weights = uvec2(0);
+ weights.x = interpolateWeights(weightData, weightEncoding, numWeights, v0, gridWidth,
+ 1 << int(dualPlane), 0, fractionalPart);
+ if (dualPlane) {
+ weights.y = interpolateWeights(weightData, weightEncoding, numWeights, v0, gridWidth, 2, 1,
+ fractionalPart);
+ }
+ return weights;
+}
+
+uint hash52(uint p) {
+ p ^= p >> 15;
+ p -= p << 17;
+ p += p << 7;
+ p += p << 4;
+ p ^= p >> 5;
+ p += p << 16;
+ p ^= p >> 7;
+ p ^= p >> 3;
+ p ^= p << 6;
+ p ^= p >> 17;
+ return p;
+}
+
+uint selectPartition(uint seed, uvec2 pos, uint numPartitions) {
+ if (numPartitions == 1) {
+ return 0;
+ }
+ if (blockSize.x * blockSize.y < 31) {
+ pos <<= 1;
+ }
+ seed = 1024 * numPartitions + (seed - 1024);
+ uint rnum = hash52(seed);
+ // TODO(gregschlom): micro-optimization: could repetedly halve the bits to extract them in 6
+ // calls to bitfieldExtract instead of 8.
+ uvec4 seedA = uvec4(bitfieldExtract(rnum, 0, 4), bitfieldExtract(rnum, 4, 4),
+ bitfieldExtract(rnum, 8, 4), bitfieldExtract(rnum, 12, 4));
+ uvec4 seedB = uvec4(bitfieldExtract(rnum, 16, 4), bitfieldExtract(rnum, 20, 4),
+ bitfieldExtract(rnum, 24, 4), bitfieldExtract(rnum, 28, 4));
+
+ seedA = seedA * seedA;
+ seedB = seedB * seedB;
+
+ uvec2 shifts1 = uvec2((seed & 2) != 0 ? 4 : 5, numPartitions == 3 ? 6 : 5);
+ uvec4 shifts2 = (seed & 1) != 0 ? shifts1.xyxy : shifts1.yxyx;
+
+ seedA >>= shifts2;
+ seedB >>= shifts2;
+
+ // Note: this could be implemented as matrix multiplication, but we'd have to use floats and I'm
+ // not sure if the values are always small enough to stay accurate.
+ uvec4 result =
+ uvec4(dot(seedA.xy, pos), dot(seedA.zw, pos), dot(seedB.xy, pos), dot(seedB.zw, pos)) +
+ (uvec4(rnum) >> uvec4(14, 10, 6, 2));
+
+ result &= uvec4(0x3F);
+
+ if (numPartitions == 2) {
+ result.zw = uvec2(0);
+ } else if (numPartitions == 3) {
+ result.w = 0;
+ }
+
+ // Return the index of the largest component in `result`
+ if (all(greaterThanEqual(uvec3(result.x), result.yzw))) {
+ return 0;
+ } else if (all(greaterThanEqual(uvec2(result.y), result.zw))) {
+ return 1;
+ } else if (result.z >= result.w) {
+ return 2;
+ } else {
+ return 3;
+ }
+}
+
+uvec3 getEndpointEncoding(uint availableEndpointBits, uint numEndpoints, out uint actualSize) {
+ // This implements the algorithm described in section "C.2.22 Data Size Determination"
+ // TODO(gregschlom): This could be implemented with a lookup table instead. Or we could use a
+ // binary search but not sure if worth it due to the extra cost of branching.
+ for (uint i = 0; i < kColorEncodings.length(); ++i) {
+ uvec3 encoding = kColorEncodings[i];
+ actualSize = getEncodingSize(numEndpoints, encoding);
+ if (actualSize <= availableEndpointBits) {
+ return encoding;
+ }
+ }
+ return uvec3(0); // this should never happen
+}
+
+ivec4 blueContract(ivec4 v) { return ivec4((v.r + v.b) >> 1, (v.g + v.b) >> 1, v.ba); }
+
+int sum(ivec3 v) { return v.x + v.y + v.z; }
+
+void bitTransferSigned(inout ivec4 a, inout ivec4 b) {
+ b >>= 1;
+ b |= a & 0x80;
+ a >>= 1;
+ a &= 0x3f;
+ // This is equivalent to: "if ((a & 0x20) != 0) a -= 0x40;" in the spec. It treats "a" as a
+ // 6-bit signed integer, converting it from (0, 63) to (-32, 31)
+ a = bitfieldExtract(a, 0, 6);
+}
+
+// Decodes the endpoints and writes them to ep0 and ep1.
+// vA: even-numbered values in the spec (ie: v0, v2, v4 and v6)
+// vB: odd-numbered values in the spec (ie: v1, v3, v5 and v7)
+// mode: the CEM (color endpoint mode)
+// Note: HDR modes are not supported.
+void decodeEndpoints(ivec4 vA, ivec4 vB, uint mode, out uvec4 ep0, out uvec4 ep1) {
+ switch (mode) {
+ case 0: // LDR luminance only, direct
+ ep0 = uvec4(vA.xxx, 255);
+ ep1 = uvec4(vB.xxx, 255);
+ return;
+
+ case 1: { // LDR luminance only, base + offset
+ const int l0 = (vA.x >> 2) | (vB.x & 0xC0);
+ const int l1 = min(l0 + (vB.x & 0x3F), 255);
+ ep0 = uvec4(uvec3(l0), 255);
+ ep1 = uvec4(uvec3(l1), 255);
+ return;
+ }
+
+ case 4: // LDR luminance + alpha, direct
+ ep0 = vA.xxxy;
+ ep1 = vB.xxxy;
+ return;
+
+ case 5: // LDR luminance + alpha, base + offset
+ bitTransferSigned(vB, vA);
+ ep0 = clamp(vA.xxxy, 0, 255);
+ ep1 = clamp(vA.xxxy + vB.xxxy, 0, 255);
+ return;
+
+ case 6: // LDR RGB, base + scale
+ ep1 = uvec4(vA.x, vB.x, vA.y, 255);
+ ep0 = uvec4((ep1.rgb * vB.y) >> 8, 255);
+ return;
+
+ case 10: // LDR RGB, base + scale, plus alphas
+ ep1 = uvec4(vA.x, vB.x, vA.y, vB.z);
+ ep0 = uvec4((ep1.rgb * vB.y) >> 8, vA.z);
+ return;
+
+ case 8: // LDR RGB, direct
+ vA.a = 255;
+ vB.a = 255;
+ case 12: // LDR RGBA, direct
+ if (sum(vB.rgb) >= sum(vA.rgb)) {
+ ep0 = vA;
+ ep1 = vB;
+ } else {
+ ep0 = blueContract(vB);
+ ep1 = blueContract(vA);
+ }
+ return;
+
+ case 9: // LDR RGB, base + offset
+ // We will end up with vA.a = 255 and vB.a = 0 after calling bitTransferSigned(vB, vA)
+ vA.a = 255;
+ vB.a = -128;
+ case 13: // LDR RGBA, base + offset
+ bitTransferSigned(vB, vA);
+ if (sum(vB.rgb) >= 0) {
+ ep0 = clamp(vA, 0, 255);
+ ep1 = clamp(vA + vB, 0, 255);
+ } else {
+ ep0 = clamp(blueContract(vA + vB), 0, 255);
+ ep1 = clamp(blueContract(vA), 0, 255);
+ }
+ return;
+
+ default:
+ // Unimplemented color encoding. (HDR)
+ ep0 = uvec4(0);
+ ep1 = uvec4(0);
+ }
+}
+
+uint decode1Endpoint(uvec4 data, uint startOffset, uint index, uvec3 encoding) {
+ uint numBits = encoding.z;
+
+ if (encoding.x == 1) {
+ // 1 trit
+ uint offset = (index / 5) * (5 * numBits + 8) + startOffset;
+ uint ep = decodeTrit(data, offset, numBits, index % 5);
+ return kUnquantTritColorMap[3 * ((1 << numBits) - 1) + ep];
+ } else if (encoding.y == 1) {
+ // 1 quint
+ uint offset = (index / 3) * (3 * numBits + 7) + startOffset;
+ uint ep = decodeQuint(data, offset, numBits, index % 3);
+ return kUnquantQuintColorMap[5 * ((1 << numBits) - 1) + ep];
+ } else {
+ // only bits, no trits or quints. We can have between 1 and 8 bits.
+ uint offset = index * numBits + startOffset;
+ uint w = extractBits(data, offset, numBits);
+ // The first number in the table is the multiplication factor. 255 / (2^numBits - 1)
+ // The second number is a shift factor to adjust when the previous result isn't an integer.
+ const uvec2 kUnquantTable[] = {{255, 8}, {85, 8}, {36, 1}, {17, 8},
+ {8, 2}, {4, 4}, {2, 6}, {1, 8}};
+ const uvec2 unquant = kUnquantTable[numBits - 1];
+ return w * unquant.x | w >> unquant.y;
+ }
+}
+
+// Creates a 128-bit mask with the lower n bits set to 1
+uvec4 buildBitmask(uint bits) {
+ ivec4 numBits = int(bits) - ivec4(96, 64, 32, 0);
+ uvec4 mask = (uvec4(1) << clamp(numBits, ivec4(0), ivec4(31))) - 1;
+ return mix(mask, uvec4(0xffffffffu), greaterThanEqual(uvec4(bits), uvec4(128, 96, 64, 32)));
+}
+
+// Main function to decode the texel at a given position in the block
+uvec4 astcDecodeTexel(const uvec2 posInBlock) {
+ if (decodeError) {
+ return kErrorColor;
+ }
+
+ if (voidExtent) {
+ return uvec4(bitfieldExtract(astcBlock[1], 8, 8), bitfieldExtract(astcBlock[1], 24, 8),
+ bitfieldExtract(astcBlock[0], 8, 8), bitfieldExtract(astcBlock[0], 24, 8));
+ }
+
+ const uvec4 weightData = bitfieldReverse(astcBlock.wzyx) & buildBitmask(weightDataSize);
+ const uvec2 weights = decodeWeights(weightData, posInBlock);
+
+ const uint partitionIndex = selectPartition(partitionSeed, posInBlock, numPartitions);
+
+ uint startOfExtraCem = 0;
+ uint totalEndpoints = 0;
+ uint baseEndpointIndex = 0;
+ uint cem = decodeCEM(partitionIndex, startOfExtraCem, totalEndpoints, baseEndpointIndex);
+
+ // Per spec, we must return the error color if we require more than 18 color endpoints
+ if (totalEndpoints > 18) {
+ return kErrorColor;
+ }
+
+ const uint endpointsStart = (numPartitions == 1) ? 17 : 29;
+ const uint endpointsEnd = -2 * int(dualPlane) + startOfExtraCem;
+ const uint availableEndpointBits = endpointsEnd - endpointsStart;
+ // TODO(gregschlom): Do we need this: if (availableEndpointBits >= 128) return kErrorColor;
+
+ uint actualEndpointBits;
+ const uvec3 endpointEncoding =
+ getEndpointEncoding(availableEndpointBits, totalEndpoints, actualEndpointBits);
+ // TODO(gregschlom): Do we need this: if (endpointEncoding == uvec3(0)) return kErrorColor;
+
+ // Number of endpoints pairs in this partition. (Between 1 and 4)
+ // This is the n field from "Table C.2.17 - Color Endpoint Modes" divided by two
+ const uint numEndpointPairs = (cem >> 2) + 1;
+
+ ivec4 vA = ivec4(0); // holds what the spec calls v0, v2, v4 and v6
+ ivec4 vB = ivec4(0); // holds what the spec calls v1, v3, v5 and v7
+
+ uvec4 epData = astcBlock & buildBitmask(endpointsStart + actualEndpointBits);
+
+ for (uint i = 0; i < numEndpointPairs; ++i) {
+ const uint epIdx = 2 * i + baseEndpointIndex;
+ vA[i] = int(decode1Endpoint(epData, endpointsStart, epIdx, endpointEncoding));
+ vB[i] = int(decode1Endpoint(epData, endpointsStart, epIdx + 1, endpointEncoding));
+ }
+
+ uvec4 ep0, ep1;
+ decodeEndpoints(vA, vB, cem, ep0, ep1);
+
+ uvec4 weightsPerChannel = uvec4(weights[0]);
+ if (dualPlane) {
+ uint ccs = extractBits(astcBlock, endpointsEnd, 2);
+ weightsPerChannel[ccs] = weights[1];
+ }
+
+ return (ep0 * (64 - weightsPerChannel) + ep1 * weightsPerChannel + 32) >> 6;
+
+ // TODO(gregschlom): Check section "C.2.19 Weight Application" - we're supposed to do something
+ // else here, depending on whether we're using sRGB or not. Currently we have a difference of up
+ // to 1 when compared against the reference decoder. Probably not worth trying to fix it though.
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcLookupTables.glsl b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcLookupTables.glsl
new file mode 100644
index 00000000000..250b8dcd34d
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcLookupTables.glsl
@@ -0,0 +1,128 @@
+// Lookup tables for the ASTC decoder
+
+// Number of trits, quints and bits that are used to encode the weights.
+// Refer to "Table C.2.7 - Weight Range Encodings"
+const uvec3 kWeightEncodings[] = {
+ {0, 0, 0}, {0, 0, 0}, {0, 0, 1}, {1, 0, 0}, {0, 0, 2}, {0, 1, 0}, {1, 0, 1}, {0, 0, 3},
+ {0, 0, 0}, {0, 0, 0}, {0, 1, 1}, {1, 0, 2}, {0, 0, 4}, {0, 1, 2}, {1, 0, 3}, {0, 0, 5},
+};
+
+// Number of trits, quints, and bits that we are used to encode the color endpoints, sorted from
+// largest to smallest. This is the data from "Table C.2.16", but with the addition of encodings
+// that use only bits.
+const uvec3 kColorEncodings[] = {
+ {0, 0, 8}, // 255
+ {1, 0, 6}, // 191
+ {0, 1, 5}, // 159
+ {0, 0, 7}, // 127
+ {1, 0, 5}, // 95
+ {0, 1, 4}, // 79
+ {0, 0, 6}, // 63
+ {1, 0, 4}, // 47
+ {0, 1, 3}, // 39
+ {0, 0, 5}, // 31
+ {1, 0, 3}, // 23
+ {0, 1, 2}, // 19
+ {0, 0, 4}, // 15
+ {1, 0, 2}, // 11
+ {0, 1, 1}, // 9
+ {0, 0, 3}, // 7
+ {1, 0, 1}, // 5
+ {0, 0, 2}, // 3
+ {0, 0, 1}, // 1
+};
+
+// Lookup table to decode a pack of 5 trits (encoded with 8 bits)
+// index: the 8 bits that make the pack of 5 trits
+// output: the values for the 5 trits, packed together using 2 bits each
+// Refer to "C.2.12 Integer Sequence Encoding"
+const uint kTritEncodings[256] = {
+ 0, 1, 2, 32, 4, 5, 6, 33, 8, 9, 10, 34, 40, 41, 42, 34, 16, 17, 18,
+ 36, 20, 21, 22, 37, 24, 25, 26, 38, 640, 641, 642, 672, 64, 65, 66, 96, 68, 69,
+ 70, 97, 72, 73, 74, 98, 104, 105, 106, 98, 80, 81, 82, 100, 84, 85, 86, 101, 88,
+ 89, 90, 102, 644, 645, 646, 673, 128, 129, 130, 160, 132, 133, 134, 161, 136, 137, 138, 162,
+ 168, 169, 170, 162, 144, 145, 146, 164, 148, 149, 150, 165, 152, 153, 154, 166, 648, 649, 650,
+ 674, 512, 513, 514, 544, 516, 517, 518, 545, 520, 521, 522, 546, 552, 553, 554, 546, 528, 529,
+ 530, 548, 532, 533, 534, 549, 536, 537, 538, 550, 680, 681, 682, 674, 256, 257, 258, 288, 260,
+ 261, 262, 289, 264, 265, 266, 290, 296, 297, 298, 290, 272, 273, 274, 292, 276, 277, 278, 293,
+ 280, 281, 282, 294, 656, 657, 658, 676, 320, 321, 322, 352, 324, 325, 326, 353, 328, 329, 330,
+ 354, 360, 361, 362, 354, 336, 337, 338, 356, 340, 341, 342, 357, 344, 345, 346, 358, 660, 661,
+ 662, 677, 384, 385, 386, 416, 388, 389, 390, 417, 392, 393, 394, 418, 424, 425, 426, 418, 400,
+ 401, 402, 420, 404, 405, 406, 421, 408, 409, 410, 422, 664, 665, 666, 678, 576, 577, 578, 608,
+ 580, 581, 582, 609, 584, 585, 586, 610, 616, 617, 618, 610, 592, 593, 594, 612, 596, 597, 598,
+ 613, 600, 601, 602, 614, 680, 681, 682, 678};
+
+// Lookup table to decode a pack of 3 quints (encoded with 7 bits)
+// index: the 7 bits that make the pack of 3 quints
+// output: the values for the 3 quints, packed together using 3 bits each
+// Refer to "C.2.12 Integer Sequence Encoding"
+const uint kQuintEncodings[128] = {
+ 0, 1, 2, 3, 4, 32, 36, 292, 8, 9, 10, 11, 12, 33, 100, 292, 16, 17, 18,
+ 19, 20, 34, 164, 292, 24, 25, 26, 27, 28, 35, 228, 292, 64, 65, 66, 67, 68, 96,
+ 260, 288, 72, 73, 74, 75, 76, 97, 268, 289, 80, 81, 82, 83, 84, 98, 276, 290, 88,
+ 89, 90, 91, 92, 99, 284, 291, 128, 129, 130, 131, 132, 160, 258, 259, 136, 137, 138, 139,
+ 140, 161, 266, 267, 144, 145, 146, 147, 148, 162, 274, 275, 152, 153, 154, 155, 156, 163, 282,
+ 283, 192, 193, 194, 195, 196, 224, 256, 257, 200, 201, 202, 203, 204, 225, 264, 265, 208, 209,
+ 210, 211, 212, 226, 272, 273, 216, 217, 218, 219, 220, 227, 280, 281};
+
+// Array to unquantize weights encoded with the trit + bits encoding.
+// Use `3 * (2^bits - 1) + trit` to find the index in this table.
+const uint kUnquantTritWeightMap[45] = {
+ 0, 32, 64, 0, 64, 12, 52, 25, 39, 0, 64, 17, 47, 5, 59, 23, 41, 11, 53, 28, 36, 0, 64,
+ 8, 56, 16, 48, 24, 40, 2, 62, 11, 53, 19, 45, 27, 37, 5, 59, 13, 51, 22, 42, 30, 34,
+};
+
+// Array to unquantize weights encoded with the quint + bits encoding.
+// Use `5 * (2^bits - 1) + quint` to find the index in this table.
+const uint kUnquantQuintWeightMap[35] = {
+ 0, 16, 32, 48, 64, 0, 64, 7, 57, 14, 50, 21, 43, 28, 36, 0, 64, 16,
+ 48, 3, 61, 19, 45, 6, 58, 23, 41, 9, 55, 26, 38, 13, 51, 29, 35,
+};
+
+// Array to unquantize color endpoint data encoded with the trit + bits encoding.
+// Use `3 * (2^bits - 1) + quint` to find the index in this table.
+const uint kUnquantTritColorMap[381] = {
+ 0, 0, 0, 0, 255, 51, 204, 102, 153, 0, 255, 69, 186, 23, 232, 92, 163, 46, 209,
+ 116, 139, 0, 255, 33, 222, 66, 189, 99, 156, 11, 244, 44, 211, 77, 178, 110, 145, 22,
+ 233, 55, 200, 88, 167, 121, 134, 0, 255, 16, 239, 32, 223, 48, 207, 65, 190, 81, 174,
+ 97, 158, 113, 142, 5, 250, 21, 234, 38, 217, 54, 201, 70, 185, 86, 169, 103, 152, 119,
+ 136, 11, 244, 27, 228, 43, 212, 59, 196, 76, 179, 92, 163, 108, 147, 124, 131, 0, 255,
+ 8, 247, 16, 239, 24, 231, 32, 223, 40, 215, 48, 207, 56, 199, 64, 191, 72, 183, 80,
+ 175, 88, 167, 96, 159, 104, 151, 112, 143, 120, 135, 2, 253, 10, 245, 18, 237, 26, 229,
+ 35, 220, 43, 212, 51, 204, 59, 196, 67, 188, 75, 180, 83, 172, 91, 164, 99, 156, 107,
+ 148, 115, 140, 123, 132, 5, 250, 13, 242, 21, 234, 29, 226, 37, 218, 45, 210, 53, 202,
+ 61, 194, 70, 185, 78, 177, 86, 169, 94, 161, 102, 153, 110, 145, 118, 137, 126, 129, 0,
+ 255, 4, 251, 8, 247, 12, 243, 16, 239, 20, 235, 24, 231, 28, 227, 32, 223, 36, 219,
+ 40, 215, 44, 211, 48, 207, 52, 203, 56, 199, 60, 195, 64, 191, 68, 187, 72, 183, 76,
+ 179, 80, 175, 84, 171, 88, 167, 92, 163, 96, 159, 100, 155, 104, 151, 108, 147, 112, 143,
+ 116, 139, 120, 135, 124, 131, 1, 254, 5, 250, 9, 246, 13, 242, 17, 238, 21, 234, 25,
+ 230, 29, 226, 33, 222, 37, 218, 41, 214, 45, 210, 49, 206, 53, 202, 57, 198, 61, 194,
+ 65, 190, 69, 186, 73, 182, 77, 178, 81, 174, 85, 170, 89, 166, 93, 162, 97, 158, 101,
+ 154, 105, 150, 109, 146, 113, 142, 117, 138, 121, 134, 125, 130, 2, 253, 6, 249, 10, 245,
+ 14, 241, 18, 237, 22, 233, 26, 229, 30, 225, 34, 221, 38, 217, 42, 213, 46, 209, 50,
+ 205, 54, 201, 58, 197, 62, 193, 66, 189, 70, 185, 74, 181, 78, 177, 82, 173, 86, 169,
+ 90, 165, 94, 161, 98, 157, 102, 153, 106, 149, 110, 145, 114, 141, 118, 137, 122, 133, 126,
+ 129,
+};
+
+// Array to unquantize color endpoint data encoded with the quint + bits encoding.
+// Use `5 * (2^bits - 1) + quint` to find the index in this table.
+const uint kUnquantQuintColorMap[315] = {
+ 0, 0, 0, 0, 0, 0, 255, 28, 227, 56, 199, 84, 171, 113, 142, 0, 255, 67, 188,
+ 13, 242, 80, 175, 27, 228, 94, 161, 40, 215, 107, 148, 54, 201, 121, 134, 0, 255, 32,
+ 223, 65, 190, 97, 158, 6, 249, 39, 216, 71, 184, 104, 151, 13, 242, 45, 210, 78, 177,
+ 110, 145, 19, 236, 52, 203, 84, 171, 117, 138, 26, 229, 58, 197, 91, 164, 123, 132, 0,
+ 255, 16, 239, 32, 223, 48, 207, 64, 191, 80, 175, 96, 159, 112, 143, 3, 252, 19, 236,
+ 35, 220, 51, 204, 67, 188, 83, 172, 100, 155, 116, 139, 6, 249, 22, 233, 38, 217, 54,
+ 201, 71, 184, 87, 168, 103, 152, 119, 136, 9, 246, 25, 230, 42, 213, 58, 197, 74, 181,
+ 90, 165, 106, 149, 122, 133, 13, 242, 29, 226, 45, 210, 61, 194, 77, 178, 93, 162, 109,
+ 146, 125, 130, 0, 255, 8, 247, 16, 239, 24, 231, 32, 223, 40, 215, 48, 207, 56, 199,
+ 64, 191, 72, 183, 80, 175, 88, 167, 96, 159, 104, 151, 112, 143, 120, 135, 1, 254, 9,
+ 246, 17, 238, 25, 230, 33, 222, 41, 214, 49, 206, 57, 198, 65, 190, 73, 182, 81, 174,
+ 89, 166, 97, 158, 105, 150, 113, 142, 121, 134, 3, 252, 11, 244, 19, 236, 27, 228, 35,
+ 220, 43, 212, 51, 204, 59, 196, 67, 188, 75, 180, 83, 172, 91, 164, 99, 156, 107, 148,
+ 115, 140, 123, 132, 4, 251, 12, 243, 20, 235, 28, 227, 36, 219, 44, 211, 52, 203, 60,
+ 195, 68, 187, 76, 179, 84, 171, 92, 163, 100, 155, 108, 147, 116, 139, 124, 131, 6, 249,
+ 14, 241, 22, 233, 30, 225, 38, 217, 46, 209, 54, 201, 62, 193, 70, 185, 78, 177, 86,
+ 169, 94, 161, 102, 153, 110, 145, 118, 137, 126, 129,
+};
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcNew.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcNew.comp
new file mode 100644
index 00000000000..7f0b2a29fa8
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcNew.comp
@@ -0,0 +1,643 @@
+// Compute shader to perform ASTC decoding.
+//
+// Usage:
+// #include "AstcDecompressor.glsl"
+//
+// main() {
+// uvec4 astcBlock = ... // read an ASTC block
+// astcDecoderInitialize(astcBlock, blockSize);
+// uvec2 posInBlock = uvec2(0, 0); // which texel we want to decode in the block
+// uvec4 texel = astcDecodeTexel(pos);
+// }
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Please refer for the ASTC spec for all the details:
+// https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_texture_compression_astc_hdr.txt
+//
+//
+// Quick reminder of an ASTC block layout
+// --------------------------------------
+//
+// Each ASTC block is 128 bits. From top to bottom (from bit 127 to bit 0), we have:
+// 1. weight data (24 - 96 bits). Starts at bit 127 and grows down. (So it needs to be reversed)
+// 2. extra CEM data. 0 bits if only 1 partition OR if CEM selector value in bits [24:23] is 00,
+// otherwise 2, 5 or 8 bits for 2, 3, or 4 partitions respectively.
+// 3. color component selector (CCS) - 2 bits if dual plane is active, otherwise 0 bits.
+// 4. Color endpoint data - variable length
+// 5. CEM 4 bits if single partition, else 6 bits.
+// 6. partition seed 10 bits (13-22) - only if more than 1 partition
+// 7. partition count 2 bits (11-12)
+// 8. block mode 11 bits ( 0-10)
+//
+// Optimization ideas
+// ------------------
+//
+// 1. Use a uniform buffer instead of static arrays to load the tables in AstcLookupTables.glsl
+// 2. Investigate using SSBO or sampled image instead of storage image for the input.
+// 3. Make decodeTrit() / decodeQuint() return a pair of values, since we always need at least 2
+// 4. Look into which queue we use to run the shader, some GPUs may have a separate compute queue.
+// 5. Use a `shared` variable to share the block data and common block config, once we change the
+// local group size to match the block size.
+//
+// Missing features
+// ----------------
+//
+// 1. Make sure we cover all the cases where we should return the error color? See section C.2.24
+// Illegal Encodings for the full list.
+// 2. Add support for 3D slices.
+// 3. HDR support? Probably not worth it.
+
+#include "AstcLookupTables.glsl"
+
+const uvec4 kErrorColor = uvec4(255, 0, 255, 255); // beautiful magenta, as per the spec
+
+// Global variables ////////////////////////////////////////////////////////////////////////////////
+
+uvec4 astcBlock; // Full ASTC block data
+uvec2 blockSize; // Size of the ASTC block
+bool decodeError; // True if there's an error in the block.
+bool voidExtent; // True if void-extent block (all pixels are the same color)
+bool dualPlane; // True for dual plane blocks (a block with 2 sets of weights)
+uvec2 weightGridSize; // Width and height of the weight grid. Always <= blockSize.
+uint numWeights; // Number of weights
+uvec3 weightEncoding; // Number of trits (x), quints (y) and bits (z) to encode the weights.
+uint weightDataSize; // Size of the weight data in bits
+uint numPartitions; // Number of partitions (1-4)
+uint partitionSeed; // Determines which partition pattern we use (10 bits)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Returns the number of bits needed to encode `numVals` values using a given encoding.
+// encoding: number of trits (x), quints (y) and bits (z) used for the encoding.
+uint getEncodingSize(uint numVals, uvec3 encoding) {
+ // See section C.2.22.
+ uvec2 tqBits = (numVals * encoding.xy * uvec2(8, 7) + uvec2(4, 2)) / uvec2(5, 3);
+ return numVals * encoding.z + (tqBits.x + tqBits.y);
+}
+
+// This function sets all the global variables above
+void astcDecoderInitialize(uvec4 blockData, uvec2 blockSize_) {
+ astcBlock = blockData;
+ blockSize = blockSize_;
+ decodeError = false;
+
+ voidExtent = (astcBlock[3] & 0x1FF) == 0x1FC;
+ if (voidExtent) return;
+
+ const uint bits01 = bitfieldExtract(astcBlock[3], 0, 2);
+ const uint bits23 = bitfieldExtract(astcBlock[3], 2, 2);
+ const uint bit4 = bitfieldExtract(astcBlock[3], 4, 1);
+ const uint bits56 = bitfieldExtract(astcBlock[3], 5, 2);
+ const uint bits78 = bitfieldExtract(astcBlock[3], 7, 2);
+
+ uint r;
+ uint h = bitfieldExtract(astcBlock[3], 9, 1);
+ dualPlane = bool(bitfieldExtract(astcBlock[3], 10, 1));
+
+ // Refer to "Table C.2.8 - 2D Block Mode Layout"
+ if (bits01 == 0) {
+ r = bits23 << 1 | bit4;
+ switch (bits78) {
+ case 0:
+ weightGridSize = uvec2(12, bits56 + 2);
+ break;
+ case 1:
+ weightGridSize = uvec2(bits56 + 2, 12);
+ break;
+ case 2:
+ weightGridSize = uvec2(bits56 + 6, bitfieldExtract(astcBlock[3], 9, 2) + 6);
+ dualPlane = false;
+ h = 0;
+ break;
+ case 3:
+ if (bits56 == 0) {
+ weightGridSize = uvec2(6, 10);
+ } else if (bits56 == 1) {
+ weightGridSize = uvec2(10, 6);
+ } else {
+ decodeError = true;
+ return;
+ }
+ }
+ } else {
+ r = bits01 << 1 | bit4;
+ switch (bits23) {
+ case 0:
+ weightGridSize = uvec2(bits78 + 4, bits56 + 2);
+ break;
+ case 1:
+ weightGridSize = uvec2(bits78 + 8, bits56 + 2);
+ break;
+ case 2:
+ weightGridSize = uvec2(bits56 + 2, bits78 + 8);
+ break;
+ case 3:
+ if (bits78 >> 1 == 0) {
+ weightGridSize = uvec2(bits56 + 2, (bits78 & 1) + 6);
+ } else {
+ weightGridSize = uvec2((bits78 & 1) + 2, bits56 + 2);
+ }
+ }
+ }
+
+ if (any(greaterThan(weightGridSize, blockSize))) {
+ decodeError = true;
+ return;
+ }
+
+ // weigths
+ weightEncoding = kWeightEncodings[h << 3 | r];
+ numWeights = (weightGridSize.x * weightGridSize.y) << int(dualPlane);
+ weightDataSize = getEncodingSize(numWeights, weightEncoding);
+ if (weightDataSize < 24 || weightDataSize > 96 || numWeights > 64) {
+ decodeError = true;
+ return;
+ }
+
+ numPartitions = bitfieldExtract(astcBlock[3], 11, 2) + 1;
+ if (numPartitions > 1) {
+ partitionSeed = bitfieldExtract(astcBlock[3], 13, 10);
+ }
+
+ if (dualPlane && numPartitions == 4) {
+ decodeError = true;
+ return;
+ }
+}
+
+// Extracts a range of bits from a uvec4, treating it as a single 128-bit field.
+// offset: index of the first bit to extract (0-127).
+// numBits: number of bits to extract. (0-32). If numBits is 0, this returns 0.
+// Result is undefined if offset >= 128 or offset + numBits > 128
+uint extractBits(uvec4 data, uint offset, uint numBits) {
+ if (numBits == 0) return 0;
+
+ const uint i = 3 - offset / 32;
+ const uint j = 3 - (offset + numBits - 1) / 32;
+ const uint start = offset & 31;
+ if (i == j) {
+ // All the bits to extract are located on the same component of the vector
+ return bitfieldExtract(data[i], int(start), int(numBits));
+ } else {
+ uint numLowBits = 32 - start;
+ uint lowBits = bitfieldExtract(data[i], int(start), int(numLowBits));
+ uint highBits = bitfieldExtract(data[j], 0, int(numBits - numLowBits));
+ return (highBits << numLowBits) | lowBits;
+ }
+}
+
+// Returns the CEM, a number between 0 and 15 that determines how the endpoints are encoded.
+// Also sets a couple of output parameters:
+// - startOfExtraCem: bit position of the start of the extra CEM
+// - totalEndpoints: number of endpoints in the block, for all partitions.
+// - baseEndpointIndex: index of the first endpoint for this partition
+// Refer to "Section C.2.11 Color Endpoint Mode" for decoding details
+uint decodeCEM(uint partitionIndex, out uint startOfExtraCem, out uint totalEndpoints,
+ out uint baseEndpointIndex) {
+ if (numPartitions == 1) {
+ startOfExtraCem = 128 - weightDataSize;
+ const uint cem = bitfieldExtract(astcBlock[3], 13, 4);
+ totalEndpoints = 2 * (cem >> 2) + 2;
+ baseEndpointIndex = 0;
+ return cem;
+ } else {
+ const uint cemSelector = bitfieldExtract(astcBlock[3], 23, 2);
+ const uint baseCem = bitfieldExtract(astcBlock[3], 25, 4);
+
+ if (cemSelector == 0) {
+ // We're in the multi-partition, single CEM case
+ startOfExtraCem = 128 - weightDataSize;
+ const uint endpointsPerPartition = 2 * (baseCem >> 2) + 2;
+ totalEndpoints = endpointsPerPartition * numPartitions;
+ baseEndpointIndex = endpointsPerPartition * partitionIndex;
+ return baseCem;
+ } else {
+ // Refer to "Figure C.4" for the details of the encoding here.
+
+ // Size in bits of the extra CEM data, which is located right after the weight data.
+ const uint sizeOfExtraCem = 3 * numPartitions - 4;
+ startOfExtraCem = 128 - weightDataSize - sizeOfExtraCem;
+
+ // Extract the extra CEM data
+ const uint extraCem = extractBits(astcBlock, startOfExtraCem, sizeOfExtraCem);
+ const uint fullCem = extraCem << 4 | baseCem;
+
+ const uint mValue =
+ bitfieldExtract(fullCem, int(2 * partitionIndex + numPartitions), 2);
+ const uint cValues = bitfieldExtract(fullCem, 0, int(numPartitions));
+
+ // TODO(gregschlom): investigate whether a couple of small lookup tables would be more
+ // efficient here.
+ totalEndpoints = 2 * (cemSelector * numPartitions + bitCount(cValues));
+ baseEndpointIndex = 2 * (cemSelector * partitionIndex +
+ bitCount(bitfieldExtract(cValues, 0, int(partitionIndex))));
+ uint baseClass = cemSelector - 1 + bitfieldExtract(cValues, int(partitionIndex), 1);
+ return baseClass << 2 | mValue;
+ }
+ }
+}
+
+// Decodes a single trit within a block of 5.
+// offset: bit offset where the block of trits starts, within the 128 bits of data
+// numBits: how many bits are used to encode the LSB (0-6)
+// i: index of the trit within the block (0-4)
+// See section "C.2.12 Integer Sequence Encoding"
+uint decodeTrit(uvec4 data, uint offset, uint numBits, uint i) {
+ const int inumBits = int(numBits);
+
+ // In the largest encoding possible (1 trit + 6 bits), the block is 38 bits long (5 * 6 + 8).
+ // Since this wouldn't fit in 32 bits, we extract the low bits for the trit index 0 separately,
+ // this way we only need at most 4 * 6 + 8 = 32 bits, which fits perfectly.
+ const uint block = extractBits(data, offset + numBits, 4 * numBits + 8);
+
+ // Extract the 8 bits that encode the pack of 5 trits
+ // TODO(gregschlom): Optimization idea: if numbits == 0, then packedTrits = block. Worth doing?
+ const uint packedTrits = bitfieldExtract(block, 0, 2) |
+ bitfieldExtract(block, 1 * inumBits + 2, 2) << 2 |
+ bitfieldExtract(block, 2 * inumBits + 4, 1) << 4 |
+ bitfieldExtract(block, 3 * inumBits + 5, 2) << 5 |
+ bitfieldExtract(block, 4 * inumBits + 7, 1) << 7;
+
+ // Extract the LSB
+ uint lowBits;
+ if (i == 0) {
+ lowBits = extractBits(data, offset, numBits);
+ } else {
+ const int j = int(i) - 1;
+ const ivec4 deltas = {2, 4, 5, 7};
+ lowBits = bitfieldExtract(block, j * inumBits + deltas[j], inumBits);
+ }
+
+ const uint decoded = kTritEncodings[packedTrits];
+ return bitfieldExtract(decoded, 2 * int(i), 2) << numBits | lowBits;
+}
+
+// Decodes a single quint within a block of 3.
+// offset: bit offset where the block of quint starts, within the 128 bits of data
+// numBits: how many bits are used to encode the LSB (0-5)
+// i: index of the quint within the block (0-2)
+// See section "C.2.12 Integer Sequence Encoding"
+uint decodeQuint(uvec4 data, uint offset, uint numBits, uint i) {
+ const int inumBits = int(numBits);
+
+ // Note that we don't have the same size issue as trits (see above), since the largest encoding
+ // here is 1 quint and 5 bits, which is 3 * 5 + 7 = 22 bits long
+ const uint block = extractBits(data, offset, 3 * numBits + 7);
+
+ // Extract the 7 bits that encode the pack of 3 quints
+ const uint packedQuints = bitfieldExtract(block, inumBits, 3) |
+ bitfieldExtract(block, 2 * inumBits + 3, 2) << 3 |
+ bitfieldExtract(block, 3 * inumBits + 5, 2) << 5;
+
+ // Extract the LSB
+ const ivec3 deltas = {0, 3, 5};
+ const uint lowBits = bitfieldExtract(block, int(i) * inumBits + deltas[i], inumBits);
+
+ const uint decoded = kQuintEncodings[packedQuints];
+ return bitfieldExtract(decoded, 3 * int(i), 3) << numBits | lowBits;
+}
+
+uint decode1Weight(uvec4 weightData, uvec3 encoding, uint numWeights, uint index) {
+ if (index >= numWeights) return 0;
+
+ uint numBits = encoding.z;
+
+ if (encoding.x == 1) {
+ // 1 trit
+ uint offset = (index / 5) * (5 * numBits + 8);
+ uint w = decodeTrit(weightData, offset, numBits, index % 5);
+ return kUnquantTritWeightMap[3 * ((1 << numBits) - 1) + w];
+ } else if (encoding.y == 1) {
+ // 1 quint
+ uint offset = (index / 3) * (3 * numBits + 7);
+ uint w = decodeQuint(weightData, offset, numBits, index % 3);
+ return kUnquantQuintWeightMap[5 * ((1 << numBits) - 1) + w];
+ } else {
+ // only bits, no trits or quints. We can have between 1 and 6 bits.
+ uint offset = index * numBits;
+ uint w = extractBits(weightData, offset, numBits);
+
+ // The first number in the table is the multiplication factor: 63 / (2^numBits - 1)
+ // The second number is a shift factor to adjust when the previous result isn't an integer.
+ const uvec2 kUnquantTable[] = {{63, 8}, {21, 8}, {9, 8}, {4, 2}, {2, 4}, {1, 8}};
+ const uvec2 unquant = kUnquantTable[numBits - 1];
+ w = w * unquant.x | w >> unquant.y;
+ if (w > 32) w += 1;
+ return w;
+ }
+}
+
+uint interpolateWeights(uvec4 weightData, uvec3 encoding, uint numWeights, uint index,
+ uint gridWidth, uint stride, uint offset, uvec2 fractionalPart) {
+ uvec4 weightIndices = stride * (uvec4(index) + uvec4(0, 1, gridWidth, gridWidth + 1)) + offset;
+
+ // TODO(gregschlom): Optimization idea: instead of always decoding 4 weights, we could decode
+ // just what we need depending on whether fractionalPart.x and fractionalPart.y are 0
+ uvec4 weights = uvec4(decode1Weight(weightData, encoding, numWeights, weightIndices[0]),
+ decode1Weight(weightData, encoding, numWeights, weightIndices[1]),
+ decode1Weight(weightData, encoding, numWeights, weightIndices[2]),
+ decode1Weight(weightData, encoding, numWeights, weightIndices[3]));
+
+ uint w11 = (fractionalPart.x * fractionalPart.y + 8) >> 4;
+ uvec4 factors = uvec4(16 - fractionalPart.x - fractionalPart.y + w11, // w00
+ fractionalPart.x - w11, // w01
+ fractionalPart.y - w11, // w10
+ w11); // w11
+
+ return uint(dot(weights, factors) + 8) >> 4; // this is what the spec calls "effective weight"
+}
+
+uvec2 decodeWeights(uvec4 weightData, const uvec2 posInBlock) {
+ // Refer to "C.2.18 Weight Infill to interpolate between 4 grid points"
+
+ // TODO(gregschlom): The spec says: "since the block dimensions are constrained, these are
+ // easily looked up in a table." - Is it worth doing?
+ uvec2 scaleFactor = (1024 + blockSize / 2) / (blockSize - 1);
+
+ uvec2 homogeneousCoords = posInBlock * scaleFactor;
+ uvec2 gridCoords = (homogeneousCoords * (weightGridSize - 1) + 32) >> 6;
+ uvec2 integralPart = gridCoords >> 4;
+ uvec2 fractionalPart = gridCoords & 0xf;
+
+ uint gridWidth = weightGridSize.x;
+ uint v0 = integralPart.y * gridWidth + integralPart.x;
+
+ uvec2 weights = uvec2(0);
+ weights.x = interpolateWeights(weightData, weightEncoding, numWeights, v0, gridWidth,
+ 1 << int(dualPlane), 0, fractionalPart);
+ if (dualPlane) {
+ weights.y = interpolateWeights(weightData, weightEncoding, numWeights, v0, gridWidth, 2, 1,
+ fractionalPart);
+ }
+ return weights;
+}
+
+uint hash52(uint p) {
+ p ^= p >> 15;
+ p -= p << 17;
+ p += p << 7;
+ p += p << 4;
+ p ^= p >> 5;
+ p += p << 16;
+ p ^= p >> 7;
+ p ^= p >> 3;
+ p ^= p << 6;
+ p ^= p >> 17;
+ return p;
+}
+
+uint selectPartition(uint seed, uvec2 pos, uint numPartitions) {
+ if (numPartitions == 1) {
+ return 0;
+ }
+ if (blockSize.x * blockSize.y < 31) {
+ pos <<= 1;
+ }
+ seed = 1024 * numPartitions + (seed - 1024);
+ uint rnum = hash52(seed);
+ // TODO(gregschlom): micro-optimization: could repetedly halve the bits to extract them in 6
+ // calls to bitfieldExtract instead of 8.
+ uvec4 seedA = uvec4(bitfieldExtract(rnum, 0, 4), bitfieldExtract(rnum, 4, 4),
+ bitfieldExtract(rnum, 8, 4), bitfieldExtract(rnum, 12, 4));
+ uvec4 seedB = uvec4(bitfieldExtract(rnum, 16, 4), bitfieldExtract(rnum, 20, 4),
+ bitfieldExtract(rnum, 24, 4), bitfieldExtract(rnum, 28, 4));
+
+ seedA = seedA * seedA;
+ seedB = seedB * seedB;
+
+ uvec2 shifts1 = uvec2((seed & 2) != 0 ? 4 : 5, numPartitions == 3 ? 6 : 5);
+ uvec4 shifts2 = (seed & 1) != 0 ? shifts1.xyxy : shifts1.yxyx;
+
+ seedA >>= shifts2;
+ seedB >>= shifts2;
+
+ // Note: this could be implemented as matrix multiplication, but we'd have to use floats and I'm
+ // not sure if the values are always small enough to stay accurate.
+ uvec4 result =
+ uvec4(dot(seedA.xy, pos), dot(seedA.zw, pos), dot(seedB.xy, pos), dot(seedB.zw, pos)) +
+ (uvec4(rnum) >> uvec4(14, 10, 6, 2));
+
+ result &= uvec4(0x3F);
+
+ if (numPartitions == 2) {
+ result.zw = uvec2(0);
+ } else if (numPartitions == 3) {
+ result.w = 0;
+ }
+
+ // Return the index of the largest component in `result`
+ if (all(greaterThanEqual(uvec3(result.x), result.yzw))) {
+ return 0;
+ } else if (all(greaterThanEqual(uvec2(result.y), result.zw))) {
+ return 1;
+ } else if (result.z >= result.w) {
+ return 2;
+ } else {
+ return 3;
+ }
+}
+
+uvec3 getEndpointEncoding(uint availableEndpointBits, uint numEndpoints, out uint actualSize) {
+ // This implements the algorithm described in section "C.2.22 Data Size Determination"
+ // TODO(gregschlom): This could be implemented with a lookup table instead. Or we could use a
+ // binary search but not sure if worth it due to the extra cost of branching.
+ for (uint i = 0; i < kColorEncodings.length(); ++i) {
+ uvec3 encoding = kColorEncodings[i];
+ actualSize = getEncodingSize(numEndpoints, encoding);
+ if (actualSize <= availableEndpointBits) {
+ return encoding;
+ }
+ }
+ return uvec3(0); // this should never happen
+}
+
+ivec4 blueContract(ivec4 v) { return ivec4((v.r + v.b) >> 1, (v.g + v.b) >> 1, v.ba); }
+
+int sum(ivec3 v) { return v.x + v.y + v.z; }
+
+void bitTransferSigned(inout ivec4 a, inout ivec4 b) {
+ b >>= 1;
+ b |= a & 0x80;
+ a >>= 1;
+ a &= 0x3f;
+ // This is equivalent to: "if ((a & 0x20) != 0) a -= 0x40;" in the spec. It treats "a" as a
+ // 6-bit signed integer, converting it from (0, 63) to (-32, 31)
+ a = bitfieldExtract(a, 0, 6);
+}
+
+// Decodes the endpoints and writes them to ep0 and ep1.
+// vA: even-numbered values in the spec (ie: v0, v2, v4 and v6)
+// vB: odd-numbered values in the spec (ie: v1, v3, v5 and v7)
+// mode: the CEM (color endpoint mode)
+// Note: HDR modes are not supported.
+void decodeEndpoints(ivec4 vA, ivec4 vB, uint mode, out uvec4 ep0, out uvec4 ep1) {
+ switch (mode) {
+ case 0: // LDR luminance only, direct
+ ep0 = uvec4(vA.xxx, 255);
+ ep1 = uvec4(vB.xxx, 255);
+ return;
+
+ case 1: { // LDR luminance only, base + offset
+ const int l0 = (vA.x >> 2) | (vB.x & 0xC0);
+ const int l1 = min(l0 + (vB.x & 0x3F), 255);
+ ep0 = uvec4(uvec3(l0), 255);
+ ep1 = uvec4(uvec3(l1), 255);
+ return;
+ }
+
+ case 4: // LDR luminance + alpha, direct
+ ep0 = vA.xxxy;
+ ep1 = vB.xxxy;
+ return;
+
+ case 5: // LDR luminance + alpha, base + offset
+ bitTransferSigned(vB, vA);
+ ep0 = clamp(vA.xxxy, 0, 255);
+ ep1 = clamp(vA.xxxy + vB.xxxy, 0, 255);
+ return;
+
+ case 6: // LDR RGB, base + scale
+ ep1 = uvec4(vA.x, vB.x, vA.y, 255);
+ ep0 = uvec4((ep1.rgb * vB.y) >> 8, 255);
+ return;
+
+ case 10: // LDR RGB, base + scale, plus alphas
+ ep1 = uvec4(vA.x, vB.x, vA.y, vB.z);
+ ep0 = uvec4((ep1.rgb * vB.y) >> 8, vA.z);
+ return;
+
+ case 8: // LDR RGB, direct
+ vA.a = 255;
+ vB.a = 255;
+ case 12: // LDR RGBA, direct
+ if (sum(vB.rgb) >= sum(vA.rgb)) {
+ ep0 = vA;
+ ep1 = vB;
+ } else {
+ ep0 = blueContract(vB);
+ ep1 = blueContract(vA);
+ }
+ return;
+
+ case 9: // LDR RGB, base + offset
+ // We will end up with vA.a = 255 and vB.a = 0 after calling bitTransferSigned(vB, vA)
+ vA.a = 255;
+ vB.a = -128;
+ case 13: // LDR RGBA, base + offset
+ bitTransferSigned(vB, vA);
+ if (sum(vB.rgb) >= 0) {
+ ep0 = clamp(vA, 0, 255);
+ ep1 = clamp(vA + vB, 0, 255);
+ } else {
+ ep0 = clamp(blueContract(vA + vB), 0, 255);
+ ep1 = clamp(blueContract(vA), 0, 255);
+ }
+ return;
+
+ default:
+ // Unimplemented color encoding. (HDR)
+ ep0 = uvec4(0);
+ ep1 = uvec4(0);
+ }
+}
+
+uint decode1Endpoint(uvec4 data, uint startOffset, uint index, uvec3 encoding) {
+ uint numBits = encoding.z;
+
+ if (encoding.x == 1) {
+ // 1 trit
+ uint offset = (index / 5) * (5 * numBits + 8) + startOffset;
+ uint ep = decodeTrit(data, offset, numBits, index % 5);
+ return kUnquantTritColorMap[3 * ((1 << numBits) - 1) + ep];
+ } else if (encoding.y == 1) {
+ // 1 quint
+ uint offset = (index / 3) * (3 * numBits + 7) + startOffset;
+ uint ep = decodeQuint(data, offset, numBits, index % 3);
+ return kUnquantQuintColorMap[5 * ((1 << numBits) - 1) + ep];
+ } else {
+ // only bits, no trits or quints. We can have between 1 and 8 bits.
+ uint offset = index * numBits + startOffset;
+ uint w = extractBits(data, offset, numBits);
+ // The first number in the table is the multiplication factor. 255 / (2^numBits - 1)
+ // The second number is a shift factor to adjust when the previous result isn't an integer.
+ const uvec2 kUnquantTable[] = {{255, 8}, {85, 8}, {36, 1}, {17, 8},
+ {8, 2}, {4, 4}, {2, 6}, {1, 8}};
+ const uvec2 unquant = kUnquantTable[numBits - 1];
+ return w * unquant.x | w >> unquant.y;
+ }
+}
+
+// Creates a 128-bit mask with the lower n bits set to 1
+uvec4 buildBitmask(uint bits) {
+ ivec4 numBits = int(bits) - ivec4(96, 64, 32, 0);
+ uvec4 mask = (uvec4(1) << clamp(numBits, ivec4(0), ivec4(31))) - 1;
+ return mix(mask, uvec4(0xffffffffu), greaterThanEqual(uvec4(bits), uvec4(128, 96, 64, 32)));
+}
+
+// Main function to decode the texel at a given position in the block
+uvec4 astcDecodeTexel(const uvec2 posInBlock) {
+ if (decodeError) {
+ return kErrorColor;
+ }
+
+ if (voidExtent) {
+ return uvec4(bitfieldExtract(astcBlock[1], 8, 8), bitfieldExtract(astcBlock[1], 24, 8),
+ bitfieldExtract(astcBlock[0], 8, 8), bitfieldExtract(astcBlock[0], 24, 8));
+ }
+
+ const uvec4 weightData = bitfieldReverse(astcBlock.wzyx) & buildBitmask(weightDataSize);
+ const uvec2 weights = decodeWeights(weightData, posInBlock);
+
+ const uint partitionIndex = selectPartition(partitionSeed, posInBlock, numPartitions);
+
+ uint startOfExtraCem = 0;
+ uint totalEndpoints = 0;
+ uint baseEndpointIndex = 0;
+ uint cem = decodeCEM(partitionIndex, startOfExtraCem, totalEndpoints, baseEndpointIndex);
+
+ // Per spec, we must return the error color if we require more than 18 color endpoints
+ if (totalEndpoints > 18) {
+ return kErrorColor;
+ }
+
+ const uint endpointsStart = (numPartitions == 1) ? 17 : 29;
+ const uint endpointsEnd = -2 * int(dualPlane) + startOfExtraCem;
+ const uint availableEndpointBits = endpointsEnd - endpointsStart;
+ // TODO(gregschlom): Do we need this: if (availableEndpointBits >= 128) return kErrorColor;
+
+ uint actualEndpointBits;
+ const uvec3 endpointEncoding =
+ getEndpointEncoding(availableEndpointBits, totalEndpoints, actualEndpointBits);
+ // TODO(gregschlom): Do we need this: if (endpointEncoding == uvec3(0)) return kErrorColor;
+
+ // Number of endpoints pairs in this partition. (Between 1 and 4)
+ // This is the n field from "Table C.2.17 - Color Endpoint Modes" divided by two
+ const uint numEndpointPairs = (cem >> 2) + 1;
+
+ ivec4 vA = ivec4(0); // holds what the spec calls v0, v2, v4 and v6
+ ivec4 vB = ivec4(0); // holds what the spec calls v1, v3, v5 and v7
+
+ uvec4 epData = astcBlock & buildBitmask(endpointsStart + actualEndpointBits);
+
+ for (uint i = 0; i < numEndpointPairs; ++i) {
+ const uint epIdx = 2 * i + baseEndpointIndex;
+ vA[i] = int(decode1Endpoint(epData, endpointsStart, epIdx, endpointEncoding));
+ vB[i] = int(decode1Endpoint(epData, endpointsStart, epIdx + 1, endpointEncoding));
+ }
+
+ uvec4 ep0, ep1;
+ decodeEndpoints(vA, vB, cem, ep0, ep1);
+
+ uvec4 weightsPerChannel = uvec4(weights[0]);
+ if (dualPlane) {
+ uint ccs = extractBits(astcBlock, endpointsEnd, 2);
+ weightsPerChannel[ccs] = weights[1];
+ }
+
+ return (ep0 * (64 - weightsPerChannel) + ep1 * weightsPerChannel + 32) >> 6;
+
+ // TODO(gregschlom): Check section "C.2.19 Weight Application" - we're supposed to do something
+ // else here, depending on whether we're using sRGB or not. Currently we have a difference of up
+ // to 1 when compared against the reference decoder. Probably not worth trying to fix it though.
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcToBc3.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcToBc3.comp
new file mode 100644
index 00000000000..a11bcac95ee
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcToBc3.comp
@@ -0,0 +1,260 @@
+// Compute shader to convert ASTC textures to BC3 (ie: BC1 for color + BC4 for alpha).
+//
+// A bit of history
+// ----------------
+//
+// The algorithm used here for BC1 compression has a long history. It was originally published by
+// Simon Brown for the Squish encoder:
+// https://www.sjbrown.co.uk/posts/dxt-compression-techniques/
+// https://github.com/svn2github/libsquish/blob/c763145a30512c10450954b7a2b5b3a2f9a94e00/rangefit.cpp#L33
+//
+// It was then rewritten and improved upon by Fabian "ryg" Giesen for the stb_dxt encoder:
+// https://github.com/GammaUNC/FasTC/blob/0f8cef65cf8f0fc5c58a2d06af3e0c3ad2374678/DXTEncoder/src/stb_dxt.h#L283
+// https://fgiesen.wordpress.com/2022/11/08/whats-that-magic-computation-in-stb__refineblock/
+//
+// That version then made it to many places, including ANGLE, first as a C++ version:
+// https://source.corp.google.com/android/external/angle/src/image_util/loadimage_etc.cpp;l=1073;bpv=0;bpt=0;rcl=90f88d3bc0d38ef5ec06ddaaef230db2d6e6fc02
+//
+// and then as a compute shader version upon which this shader is based:
+// http://cs/android/external/angle/src/libANGLE/renderer/vulkan/shaders/src/EtcToBc.comp;rcl=81e45c881c54a7737f6fce95097f6df2f94cd76f
+//
+//
+// Useful links to understand BC1 compression
+// ------------------------------------------
+//
+// http://www.ludicon.com/castano/blog/2022/11/bc1-compression-revisited/
+// https://github.com/castano/icbc
+// https://developer.download.nvidia.com/compute/cuda/1.1-Beta/x86_website/projects/dxtc/doc/cuda_dxtc.pdf
+// https://fgiesen.wordpress.com/2022/11/08/whats-that-magic-computation-in-stb__refineblock/
+// https://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/
+// https://bartwronski.com/2020/05/21/dimensionality-reduction-for-image-and-texture-set-compression/
+// https://core.ac.uk/download/pdf/210601023.pdf
+// https://github.com/microsoft/Xbox-ATG-Samples/blob/main/XDKSamples/Graphics/FastBlockCompress/Shaders/BlockCompress.hlsli
+// https://github.com/GammaUNC/FasTC/blob/0f8cef65cf8f0fc5c58a2d06af3e0c3ad2374678/DXTEncoder/src/stb_dxt.h
+// https://github.com/darksylinc/betsy/blob/master/bin/Data/bc1.glsl
+// https://github.com/GPUOpen-Tools/compressonator/blob/master/cmp_core/shaders/bc1_cmp.h
+//
+//
+// Optimization ideas
+// ------------------
+//
+// - Do the color refinement step from stb_dxt. This is probably the top priority. Currently, we
+// only do the PCA step and we use the min and max colors as the endpoints. We should instead see
+// if picking other endpoints on the PCA line would lead to better results.
+//
+// - Use dithering to improve quality. Betsy and FasTC encoders (links above) have examples.
+//
+// - Add a fast path for when all pixels are the same color (speed improvement)
+//
+// - Use BC1 instead of BC3 if the image doesn't contain semi-transparent pixels. We will need to
+// add a pre-processing step to determine if there are such pixels. Alternatively, it could be
+// done fairly efficiently as a post-processing step where we discard the BC4 data if all pixels
+// are opaque, however in that case it would only work for fully opaque image (ie: we wouldn't be
+// able to take advantage of BC1's punch-through alpha.
+//
+// To-do list
+// ---------------
+// - TODO(gregschlom): Check that the GPU has gl_SubgroupSize >= 16 before using this shader,
+// otherwise it will give wrong results.
+//
+// - TODO(gregschlom): Check if the results are correct for image sizes that aren't multiples of 4
+
+#version 450 core
+#include "AstcDecompressor.glsl"
+#include "Common.comp"
+
+// TODO(gregschlom): Check how widespread is support for these extensions.
+#extension GL_KHR_shader_subgroup_clustered : enable
+#extension GL_KHR_shader_subgroup_shuffle : enable
+
+// To maximize GPU utilization, we use a local workgroup size of 64 which is a multiple of the
+// subgroup size of both AMD and NVIDIA cards.
+layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
+
+// Using 2DArray textures for compatibility with the old ASTC decoder.
+// TODO(gregschlom): Once we have texture metrics, check if we want to keep supporting array text.
+layout(binding = 0, rgba32ui) readonly uniform WITH_TYPE(uimage) srcImage;
+layout(binding = 1, rgba32ui) writeonly uniform WITH_TYPE(uimage) dstImage;
+
+layout(push_constant) uniform imagInfo {
+ uvec2 blockSize;
+ uint baseLayer;
+ uint smallBlock; // TODO(gregschlom) Remove this once we remove the old decoder.
+}
+u_pushConstant;
+
+// Decodes an ASTC-encoded pixel at `texelPos` to RGBA
+uvec4 decodeRGBA(uvec2 texelPos, uint layer) {
+ uvec2 blockPos = texelPos / u_pushConstant.blockSize;
+ uvec2 posInBlock = texelPos % u_pushConstant.blockSize;
+
+ astcBlock = imageLoad(srcImage, WITH_TYPE(getPos)(ivec3(blockPos, layer))).wzyx;
+ astcDecoderInitialize(astcBlock, u_pushConstant.blockSize);
+ return astcDecodeTexel(posInBlock);
+}
+
+// Returns the 2-bit index of the BC1 color that's the closest to the input color.
+// color: the color that we want to approximate
+// maxEndpoint / minEndpoint: the BC1 endpoint values we've chosen
+uint getColorIndex(vec3 color, vec3 minEndpoint, vec3 maxEndpoint) {
+ // Project `color` on the line that goes between `minEndpoint` and `maxEndpoint`.
+ //
+ // TODO(gregschlom): this doesn't account for the fact that the color palette is actually
+ // quantisized as RGB565 instead of RGB8. A slower but potentially slightly higher quality
+ // approach would be to compute all 4 RGB565 colors in the palette, then find the closest one.
+ vec3 colorLine = maxEndpoint - minEndpoint;
+ float x = dot(color - minEndpoint, colorLine) / dot(colorLine, colorLine);
+
+ // x is now a float in [0, 1] indicating where `color` lies when projected on the line between
+ // the min and max endpoint. Remap x as an integer between 0 and 3.
+ int index = int(round(clamp(x * 3, 0, 3)));
+
+ // Finally, we need to convert to the somewhat unintuitive BC1 indexing scheme, where:
+ // 0 is maxEndpoint, 1 is minEndpoint, 2 is (1/3)*minEndpoint + (2/3)*maxEndpoint and 3 is
+ // (2/3)*minEndpoint + (1/3)*maxEndpoint. The lookup table for this is [1, 3, 2, 0], which we
+ // bit-pack into 8 bits.
+ //
+ // Alternatively, we could use this formula:
+ // `index = -index & 3; return index ^ uint(index < 2);` but the lookup table method is faster.
+ return bitfieldExtract(45u, index * 2, 2);
+}
+
+// Same as above, but for alpha values, using BC4's encoding scheme.
+uint getAlphaIndex(uint alpha, uint minAlpha, uint maxAlpha) {
+ float x = float(alpha - minAlpha) / float(maxAlpha - minAlpha);
+ int index = int(round(clamp(x * 7, 0, 7)));
+
+ // Like for getColorIndex, we need to remap the index according to BC4's indexing scheme, where
+ // 0 is maxAlpha, 1 is minAlpha, 2 is (1/7)*minAlpha + (6/7)*maxAlpha, etc...
+ // The lookup table for this is [1, 7, 6, 5, 4, 3, 2, 0], which we bit-pack into 32 bits using
+ // 4 bits for each value.
+ //
+ // Alternatively, we could use this formula:
+ // `index = -index & 7; return index ^ uint(index < 2);` but the lookup table method is faster.
+ return bitfieldExtract(36984433u, index * 4, 3);
+}
+
+// Computes the color endpoints using Principal Component Analysis to find the best fit line
+// through the colors in the 4x4 block.
+void computeEndpoints(uvec3 rgbColor, out uvec3 minEndpoint, out uvec3 maxEndpoint) {
+ // See the comment at the top of this file for more details on this algorithm.
+
+ uvec3 avgColor = subgroupClusteredAdd(rgbColor, 16) + 8 >> 4; // +8 to round to nearest.
+ uvec3 minColor = subgroupClusteredMin(rgbColor, 16);
+ uvec3 maxColor = subgroupClusteredMax(rgbColor, 16);
+
+ // Special case when all pixels are the same color
+ if (minColor == maxColor) {
+ minEndpoint = minColor;
+ maxEndpoint = minColor;
+ return;
+ }
+
+ // Compute the covariance matrix of the r, g and b channels. This is a 3x3 symmetric matrix.
+ // First compute the 6 unique covariance values:
+ ivec3 dx = ivec3(rgbColor) - ivec3(avgColor);
+ vec3 cov1 = subgroupClusteredAdd(dx.r * dx, 16); // cov(r,r), cov(r,g), cov(r,b)
+ vec3 cov2 = subgroupClusteredAdd(dx.ggb * dx.gbb, 16); // cov(g,g), cov(g,b), cov(b,b)
+
+ // Then build the matrix:
+ mat3 covMat = mat3(cov1, // rr, rg, rb
+ vec3(cov1.y, cov2.xy), // rg, gg, gb
+ vec3(cov1.z, cov2.yz)); // rb, gb, bb
+
+ // Find the principal axis via power iteration. (https://en.wikipedia.org/wiki/Power_iteration)
+ // 3 to 8 iterations are sufficient for a good approximation.
+ // Note: in theory, we're supposed to normalize the vector on each iteration, however we get
+ // significantly higher quality (and obviously faster performance) when not doing it.
+ // TODO(gregschlom): Investigate why that is the case.
+ vec3 principalAxis = covMat * (covMat * (covMat * (covMat * (maxColor - minColor))));
+
+ // Ensure all components are in the [-1,1] range.
+ // TODO(gregschlom): Investigate if we really need this. It doesn't make a lot of sense.
+ float magn = max(max(abs(principalAxis.r), abs(principalAxis.g)), abs(principalAxis.b));
+ principalAxis = (magn < 4.0) // If the magnitude is too small, default to luminance
+ ? vec3(0.299f, 0.587f, 0.114f) // Coefficients to convert RGB to luminance
+ : principalAxis / magn;
+
+ // Project the colors on the principal axis and pick the 2 colors at the extreme points as the
+ // endpoints.
+ float distance = dot(rgbColor, principalAxis);
+ float minDistance = subgroupClusteredMin(distance, 16);
+ float maxDistance = subgroupClusteredMax(distance, 16);
+
+ uvec2 indices = uvec2(distance == minDistance ? gl_SubgroupInvocationID : 0,
+ distance == maxDistance ? gl_SubgroupInvocationID : 0);
+ uvec2 minMaxIndex = subgroupClusteredMax(indices, 16);
+
+ // TODO(gregschlom): we're returning the original pixel colors instead of the projected colors.
+ // Investigate if we could increase quality by returning the projected colors.
+ minEndpoint = subgroupShuffle(rgbColor, minMaxIndex.x);
+ maxEndpoint = subgroupShuffle(rgbColor, minMaxIndex.y);
+}
+
+uvec2 encodeAlpha(uint value, uint texelId) {
+ uint minValue = subgroupClusteredMin(value, 16);
+ uint maxValue = subgroupClusteredMax(value, 16);
+
+ // Determine the alpha index (between 0 and 7)
+ uint index = (minValue != maxValue) ? getAlphaIndex(value, minValue, maxValue) : 0;
+
+ // Pack everything together into 64 bits. The first 3-bit index goes at bit 16, the next
+ // one at bit 19 and so on until the last one which goes at bit 61. The bottom 16 bits will
+ // contain the max and min value.
+ // Note: shifting a uint by more than 31 is UB, which is why we need the ternary operator here.
+ uvec2 mask = uvec2(texelId < 5 ? 0 : (index << 29) >> (-3 * texelId + 45),
+ texelId > 5 ? 0 : index << (3 * texelId + 16));
+ uvec2 packed = subgroupClusteredOr(mask, 16);
+ return uvec2((maxValue & 0xff) | ((minValue & 0xff) << 8) | packed[1], packed[0]);
+}
+
+uint packColorToRGB565(uvec3 color) {
+ uvec3 quant = uvec3(round(vec3(color) * vec3(31.0, 63.0, 31.0) / vec3(255.0)));
+ return (quant.r << 11) | (quant.g << 5) | quant.b;
+}
+
+void main() {
+ // We can't use gl_LocalInvocationID here because the spec doesn't make any guarantees as to how
+ // it will be mapped to gl_SubgroupInvocationID (See: https://stackoverflow.com/q/72451338/).
+ // And since we use subgroupClusteredXXX commands, we must ensure that any 16 consecutive
+ // subgroup invocation ids [16n, 16n+1..16n+15] map to the same 4x4 block in the input image.
+ // So instead of using gl_LocalInvocationID, we construct it from the subgroup ids.
+ // This is a number in the range [0, 63] since local group size is 64
+ uint localId = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
+
+ uint blockId = localId / 16; // [0-3] Id of the 4x4 block we're working on
+ uint texelId = localId % 16; // [0-15] Id of the texel within the 4x4 block
+
+ // Absolute coordinates in the input image
+ uvec2 texelCoord = 8 * gl_WorkGroupID.xy + uvec2(4 * (blockId & 0x1) + (texelId % 4),
+ 2 * (blockId & 0x2) + (texelId / 4));
+ // Layer, for array textures.
+ uint layer = u_pushConstant.baseLayer + gl_WorkGroupID.z;
+
+ uvec4 currentTexel = decodeRGBA(texelCoord, layer);
+
+ // Compute the color endpoints
+ uvec3 minEndpoint, maxEndpoint;
+ computeEndpoints(currentTexel.rgb, minEndpoint, maxEndpoint);
+ uvec2 endpoints = uvec2(packColorToRGB565(minEndpoint), packColorToRGB565(maxEndpoint));
+
+ // Find which of the 4 colors best matches the color of the current texel
+ uint index = 0;
+ if (endpoints.x != endpoints.y) {
+ index = getColorIndex(vec3(currentTexel.rgb), vec3(minEndpoint), vec3(maxEndpoint));
+ }
+ if (endpoints.x > endpoints.y) {
+ index ^= 1;
+ endpoints = endpoints.yx;
+ }
+
+ // Pack everything together.
+ uvec4 result;
+ result.rg = encodeAlpha(currentTexel.a, texelId);
+ result.b = endpoints.y | (endpoints.x << 16);
+ result.a = subgroupClusteredOr(index << (2 * texelId), 16);
+
+ if (texelId == 0) {
+ imageStore(dstImage, WITH_TYPE(getPos)(ivec3(texelCoord / 4, layer)), result);
+ }
+} \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcToRgb.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcToRgb.comp
new file mode 100644
index 00000000000..32acf610e10
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcToRgb.comp
@@ -0,0 +1,29 @@
+#version 450
+#include "AstcDecompressor.glsl"
+#include "Common.comp"
+
+precision highp int;
+
+layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
+
+layout(push_constant) uniform ImageFormatBlock {
+ uvec2 blockSize;
+ uint baseLayer;
+ uint smallBlock; // TODO(gregschlom) Remove this once we remove the old decoder.
+}
+u_pushConstant;
+
+layout(binding = 0, rgba32ui) readonly uniform WITH_TYPE(uimage) srcImage;
+layout(binding = 1, rgba8ui) writeonly uniform WITH_TYPE(uimage) dstImage;
+
+void main() {
+ uvec2 texelPos = gl_GlobalInvocationID.xy;
+ uint layer = u_pushConstant.baseLayer + gl_GlobalInvocationID.z;
+ uvec2 blockPos = texelPos / u_pushConstant.blockSize;
+ uvec2 posInBlock = texelPos % u_pushConstant.blockSize;
+
+ uvec4 astcBlock = imageLoad(srcImage, WITH_TYPE(getPos)(ivec3(blockPos, layer))).wzyx;
+ astcDecoderInitialize(astcBlock, u_pushConstant.blockSize);
+ uvec4 texel = astcDecodeTexel(posInBlock);
+ imageStore(dstImage, WITH_TYPE(getPos)(ivec3(texelPos, layer)), texel);
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcUnquantMap.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcUnquantMap.comp
new file mode 100644
index 00000000000..d685c555dc9
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/AstcUnquantMap.comp
@@ -0,0 +1,94 @@
+// 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.
+
+// For implementation details, please refer to:
+// https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_texture_compression_astc_hdr.txt
+
+// Please refer to this document for operator precendence (slightly different from C):
+// https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.html#operators
+
+const uint kUnquantTritWeightMapBitIdx[4] = {
+ 0,
+ 3,
+ 9,
+ 21,
+};
+
+const uint kUnquantTritWeightMap[45] = {
+ 0, 32, 63, 0, 63, 12, 51, 25, 38, 0, 63, 17, 46, 5, 58, 23, 40, 11, 52, 28, 35, 0, 63,
+ 8, 55, 16, 47, 24, 39, 2, 61, 11, 52, 19, 44, 27, 36, 5, 58, 13, 50, 22, 41, 30, 33,
+};
+
+const uint kUnquantQuintWeightMapBitIdx[3] = {
+ 0,
+ 5,
+ 15,
+};
+
+const uint kUnquantQuintWeightMap[35] = {
+ 0, 16, 32, 47, 63, 0, 63, 7, 56, 14, 49, 21, 42, 28, 35, 0, 63, 16,
+ 47, 3, 60, 19, 44, 6, 57, 23, 40, 9, 54, 26, 37, 13, 50, 29, 34,
+};
+
+const uint kUnquantTritColorMapBitIdx[7] = {
+ 0, 3, 9, 21, 45, 93, 189,
+};
+
+const uint kUnquantTritColorMap[381] = {
+ 0, 0, 0, 0, 255, 51, 204, 102, 153, 0, 255, 69, 186, 23, 232, 92, 163, 46, 209,
+ 116, 139, 0, 255, 33, 222, 66, 189, 99, 156, 11, 244, 44, 211, 77, 178, 110, 145, 22,
+ 233, 55, 200, 88, 167, 121, 134, 0, 255, 16, 239, 32, 223, 48, 207, 65, 190, 81, 174,
+ 97, 158, 113, 142, 5, 250, 21, 234, 38, 217, 54, 201, 70, 185, 86, 169, 103, 152, 119,
+ 136, 11, 244, 27, 228, 43, 212, 59, 196, 76, 179, 92, 163, 108, 147, 124, 131, 0, 255,
+ 8, 247, 16, 239, 24, 231, 32, 223, 40, 215, 48, 207, 56, 199, 64, 191, 72, 183, 80,
+ 175, 88, 167, 96, 159, 104, 151, 112, 143, 120, 135, 2, 253, 10, 245, 18, 237, 26, 229,
+ 35, 220, 43, 212, 51, 204, 59, 196, 67, 188, 75, 180, 83, 172, 91, 164, 99, 156, 107,
+ 148, 115, 140, 123, 132, 5, 250, 13, 242, 21, 234, 29, 226, 37, 218, 45, 210, 53, 202,
+ 61, 194, 70, 185, 78, 177, 86, 169, 94, 161, 102, 153, 110, 145, 118, 137, 126, 129, 0,
+ 255, 4, 251, 8, 247, 12, 243, 16, 239, 20, 235, 24, 231, 28, 227, 32, 223, 36, 219,
+ 40, 215, 44, 211, 48, 207, 52, 203, 56, 199, 60, 195, 64, 191, 68, 187, 72, 183, 76,
+ 179, 80, 175, 84, 171, 88, 167, 92, 163, 96, 159, 100, 155, 104, 151, 108, 147, 112, 143,
+ 116, 139, 120, 135, 124, 131, 1, 254, 5, 250, 9, 246, 13, 242, 17, 238, 21, 234, 25,
+ 230, 29, 226, 33, 222, 37, 218, 41, 214, 45, 210, 49, 206, 53, 202, 57, 198, 61, 194,
+ 65, 190, 69, 186, 73, 182, 77, 178, 81, 174, 85, 170, 89, 166, 93, 162, 97, 158, 101,
+ 154, 105, 150, 109, 146, 113, 142, 117, 138, 121, 134, 125, 130, 2, 253, 6, 249, 10, 245,
+ 14, 241, 18, 237, 22, 233, 26, 229, 30, 225, 34, 221, 38, 217, 42, 213, 46, 209, 50,
+ 205, 54, 201, 58, 197, 62, 193, 66, 189, 70, 185, 74, 181, 78, 177, 82, 173, 86, 169,
+ 90, 165, 94, 161, 98, 157, 102, 153, 106, 149, 110, 145, 114, 141, 118, 137, 122, 133, 126,
+ 129,
+};
+
+const uint kUnquantQuintColorMapBitIdx[6] = {
+ 0, 5, 15, 35, 75, 155,
+};
+
+const uint kUnquantQuintColorMap[315] = {
+ 0, 0, 0, 0, 0, 0, 255, 28, 227, 56, 199, 84, 171, 113, 142, 0, 255, 67, 188,
+ 13, 242, 80, 175, 27, 228, 94, 161, 40, 215, 107, 148, 54, 201, 121, 134, 0, 255, 32,
+ 223, 65, 190, 97, 158, 6, 249, 39, 216, 71, 184, 104, 151, 13, 242, 45, 210, 78, 177,
+ 110, 145, 19, 236, 52, 203, 84, 171, 117, 138, 26, 229, 58, 197, 91, 164, 123, 132, 0,
+ 255, 16, 239, 32, 223, 48, 207, 64, 191, 80, 175, 96, 159, 112, 143, 3, 252, 19, 236,
+ 35, 220, 51, 204, 67, 188, 83, 172, 100, 155, 116, 139, 6, 249, 22, 233, 38, 217, 54,
+ 201, 71, 184, 87, 168, 103, 152, 119, 136, 9, 246, 25, 230, 42, 213, 58, 197, 74, 181,
+ 90, 165, 106, 149, 122, 133, 13, 242, 29, 226, 45, 210, 61, 194, 77, 178, 93, 162, 109,
+ 146, 125, 130, 0, 255, 8, 247, 16, 239, 24, 231, 32, 223, 40, 215, 48, 207, 56, 199,
+ 64, 191, 72, 183, 80, 175, 88, 167, 96, 159, 104, 151, 112, 143, 120, 135, 1, 254, 9,
+ 246, 17, 238, 25, 230, 33, 222, 41, 214, 49, 206, 57, 198, 65, 190, 73, 182, 81, 174,
+ 89, 166, 97, 158, 105, 150, 113, 142, 121, 134, 3, 252, 11, 244, 19, 236, 27, 228, 35,
+ 220, 43, 212, 51, 204, 59, 196, 67, 188, 75, 180, 83, 172, 91, 164, 99, 156, 107, 148,
+ 115, 140, 123, 132, 4, 251, 12, 243, 20, 235, 28, 227, 36, 219, 44, 211, 52, 203, 60,
+ 195, 68, 187, 76, 179, 84, 171, 92, 163, 100, 155, 108, 147, 116, 139, 124, 131, 6, 249,
+ 14, 241, 22, 233, 30, 225, 38, 217, 46, 209, 54, 201, 62, 193, 70, 185, 78, 177, 86,
+ 169, 94, 161, 102, 153, 110, 145, 118, 137, 126, 129,
+};
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/Common.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/Common.comp
new file mode 100644
index 00000000000..774e1813fda
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/Common.comp
@@ -0,0 +1,46 @@
+// 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.
+
+// This file contains common code used by the image decompression shaders.
+
+// DIM is preprocessor macro set by the build script that determines whether the shader will
+// process 1D, 2D or 3D images
+#if DIM == 1
+#define IMG_TYPE 1DArray
+#elif DIM == 2
+#define IMG_TYPE 2DArray
+#elif DIM == 3
+#define IMG_TYPE 3D
+#else
+#error "Please set the `DIM` preprocessor macro to 1, 2 or 3. Example: glslc -DDIM=2"
+#endif
+
+// Concatenates 2 tokens while also performing macro replacement
+//
+// For example:
+// #define FOO world
+// CONCAT(hello, FOO)
+//
+// Becomes:
+// helloworld
+#define CONCAT_(x, y) x##y // concatenation
+#define CONCAT(x, y) CONCAT_(x, y) // macro replacement
+
+// Appends the correct image type ("1DArray", "2DArray", or "3D") to x
+#define WITH_TYPE(x) CONCAT(x, IMG_TYPE)
+
+// TODO(gregschlom): do we actually use 1DArray images?
+ivec2 getPos1DArray(ivec3 pos) { return pos.xz; }
+ivec3 getPos2DArray(ivec3 pos) { return pos; }
+ivec3 getPos3D(ivec3 pos) { return pos; } \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/DecompressionShaders.h b/src/gfxstream/host/vulkan/emulated_textures/shaders/DecompressionShaders.h
new file mode 100644
index 00000000000..060b92a89d7
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/DecompressionShaders.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.
+
+namespace gfxstream {
+namespace vk {
+namespace decompression_shaders {
+
+// Compiled code of the image decompression shaders
+//
+// We use `inline constexpr` here, as recommended in
+// https://abseil.io/tips/140#constants-in-header-files
+
+inline constexpr uint32_t AstcToBc3_1D[] = {
+#include "compiled/AstcToBc3_1D.inl"
+};
+inline constexpr uint32_t AstcToBc3_2D[] = {
+#include "compiled/AstcToBc3_2D.inl"
+};
+inline constexpr uint32_t AstcToBc3_3D[] = {
+#include "compiled/AstcToBc3_3D.inl"
+};
+inline constexpr uint32_t AstcToRgb_1D[] = {
+#include "compiled/AstcToRgb_1D.inl"
+};
+inline constexpr uint32_t AstcToRgb_2D[] = {
+#include "compiled/AstcToRgb_2D.inl"
+};
+inline constexpr uint32_t AstcToRgb_3D[] = {
+#include "compiled/AstcToRgb_3D.inl"
+};
+inline constexpr uint32_t Astc_1D[] = {
+#include "compiled/Astc_1D.inl"
+};
+inline constexpr uint32_t Astc_2D[] = {
+#include "compiled/Astc_2D.inl"
+};
+inline constexpr uint32_t Astc_3D[] = {
+#include "compiled/Astc_3D.inl"
+};
+inline constexpr uint32_t EacR11Snorm_1D[] = {
+#include "compiled/EacR11Snorm_1D.inl"
+};
+inline constexpr uint32_t EacR11Snorm_2D[] = {
+#include "compiled/EacR11Snorm_2D.inl"
+};
+inline constexpr uint32_t EacR11Snorm_3D[] = {
+#include "compiled/EacR11Snorm_3D.inl"
+};
+inline constexpr uint32_t EacR11Unorm_1D[] = {
+#include "compiled/EacR11Unorm_1D.inl"
+};
+inline constexpr uint32_t EacR11Unorm_2D[] = {
+#include "compiled/EacR11Unorm_2D.inl"
+};
+inline constexpr uint32_t EacR11Unorm_3D[] = {
+#include "compiled/EacR11Unorm_3D.inl"
+};
+inline constexpr uint32_t EacRG11Snorm_1D[] = {
+#include "compiled/EacRG11Snorm_1D.inl"
+};
+inline constexpr uint32_t EacRG11Snorm_2D[] = {
+#include "compiled/EacRG11Snorm_2D.inl"
+};
+inline constexpr uint32_t EacRG11Snorm_3D[] = {
+#include "compiled/EacRG11Snorm_3D.inl"
+};
+inline constexpr uint32_t EacRG11Unorm_1D[] = {
+#include "compiled/EacRG11Unorm_1D.inl"
+};
+inline constexpr uint32_t EacRG11Unorm_2D[] = {
+#include "compiled/EacRG11Unorm_2D.inl"
+};
+inline constexpr uint32_t EacRG11Unorm_3D[] = {
+#include "compiled/EacRG11Unorm_3D.inl"
+};
+inline constexpr uint32_t Etc2RGB8_1D[] = {
+#include "compiled/Etc2RGB8_1D.inl"
+};
+inline constexpr uint32_t Etc2RGB8_2D[] = {
+#include "compiled/Etc2RGB8_2D.inl"
+};
+inline constexpr uint32_t Etc2RGB8_3D[] = {
+#include "compiled/Etc2RGB8_3D.inl"
+};
+inline constexpr uint32_t Etc2RGBA8_1D[] = {
+#include "compiled/Etc2RGBA8_1D.inl"
+};
+inline constexpr uint32_t Etc2RGBA8_2D[] = {
+#include "compiled/Etc2RGBA8_2D.inl"
+};
+inline constexpr uint32_t Etc2RGBA8_3D[] = {
+#include "compiled/Etc2RGBA8_3D.inl"
+};
+
+} // namespace decompression_shaders
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/EacR11Snorm.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/EacR11Snorm.comp
new file mode 100644
index 00000000000..b765f8fea7b
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/EacR11Snorm.comp
@@ -0,0 +1,43 @@
+// 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.
+
+#version 450
+#include "Etc2ShaderLib.comp"
+
+layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
+
+layout(push_constant) uniform ImageFormatBlock {
+ uint compFormat;
+ uint baseLayer;
+}
+u_pushConstant;
+
+layout(binding = 0, rg32ui) readonly uniform WITH_TYPE(uimage) u_image0;
+layout(binding = 1, r16_snorm) writeonly uniform WITH_TYPE(image) u_image1;
+
+void main(void) {
+ ivec3 pos = ivec3(gl_GlobalInvocationID.xyz);
+ pos.z += int(u_pushConstant.baseLayer);
+ uvec4 srcBlock = imageLoad(u_image0, WITH_TYPE(getPos)(pos));
+
+ float[16] decompressed =
+ eac_decode_single_channel_block_float(flip32(srcBlock[0]), flip32(srcBlock[1]), true);
+
+ for (int y = 0; y < WITH_TYPE(BLOCK_Y_SIZE_); y++) {
+ for (int x = 0; x < 4; x++) {
+ imageStore(u_image1, WITH_TYPE(getPos)(ivec3(pos.xy * 4 + ivec2(x, y), pos.z)),
+ vec4(decompressed[y * 4 + x], 0, 0, 1));
+ }
+ }
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/EacR11Unorm.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/EacR11Unorm.comp
new file mode 100644
index 00000000000..b4a47736879
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/EacR11Unorm.comp
@@ -0,0 +1,43 @@
+// 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.
+
+#version 450
+#include "Etc2ShaderLib.comp"
+
+layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
+
+layout(push_constant) uniform ImageFormatBlock {
+ uint compFormat;
+ uint baseLayer;
+}
+u_pushConstant;
+
+layout(binding = 0, rg32ui) readonly uniform WITH_TYPE(uimage) u_image0;
+layout(binding = 1, r16) writeonly uniform WITH_TYPE(image) u_image1;
+
+void main(void) {
+ ivec3 pos = ivec3(gl_GlobalInvocationID.xyz);
+ pos.z += int(u_pushConstant.baseLayer);
+ uvec4 srcBlock = imageLoad(u_image0, WITH_TYPE(getPos)(pos));
+
+ float[16] decompressed =
+ eac_decode_single_channel_block_float(flip32(srcBlock[0]), flip32(srcBlock[1]), false);
+
+ for (int y = 0; y < WITH_TYPE(BLOCK_Y_SIZE_); y++) {
+ for (int x = 0; x < 4; x++) {
+ imageStore(u_image1, WITH_TYPE(getPos)(ivec3(pos.xy * 4 + ivec2(x, y), pos.z)),
+ vec4(decompressed[y * 4 + x], 0, 0, 1));
+ }
+ }
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/EacRG11Snorm.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/EacRG11Snorm.comp
new file mode 100644
index 00000000000..bd516c110a9
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/EacRG11Snorm.comp
@@ -0,0 +1,45 @@
+// 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.
+
+#version 450
+#include "Etc2ShaderLib.comp"
+
+layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
+
+layout(push_constant) uniform ImageFormatBlock {
+ uint compFormat;
+ uint baseLayer;
+}
+u_pushConstant;
+
+layout(binding = 0, rgba32ui) readonly uniform WITH_TYPE(uimage) u_image0;
+layout(binding = 1, rg16_snorm) writeonly uniform WITH_TYPE(image) u_image1;
+
+void main(void) {
+ ivec3 pos = ivec3(gl_GlobalInvocationID.xyz);
+ pos.z += int(u_pushConstant.baseLayer);
+ uvec4 srcBlock = imageLoad(u_image0, WITH_TYPE(getPos)(pos));
+
+ float[16] decompressedR =
+ eac_decode_single_channel_block_float(flip32(srcBlock[0]), flip32(srcBlock[1]), true);
+ float[16] decompressedG =
+ eac_decode_single_channel_block_float(flip32(srcBlock[2]), flip32(srcBlock[3]), true);
+
+ for (int y = 0; y < WITH_TYPE(BLOCK_Y_SIZE_); y++) {
+ for (int x = 0; x < 4; x++) {
+ imageStore(u_image1, WITH_TYPE(getPos)(ivec3(pos.xy * 4 + ivec2(x, y), pos.z)),
+ vec4(decompressedR[y * 4 + x], decompressedG[y * 4 + x], 0, 1));
+ }
+ }
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/EacRG11Unorm.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/EacRG11Unorm.comp
new file mode 100644
index 00000000000..1eb4c925174
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/EacRG11Unorm.comp
@@ -0,0 +1,46 @@
+// 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.
+
+#version 450
+#include "Etc2ShaderLib.comp"
+
+layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
+
+layout(push_constant) uniform ImageFormatBlock {
+ uint compFormat;
+ uint baseLayer;
+}
+u_pushConstant;
+
+layout(binding = 0, rgba32ui) readonly uniform WITH_TYPE(uimage) u_image0;
+layout(binding = 1, rg16) writeonly uniform WITH_TYPE(image) u_image1;
+
+void main(void) {
+ ivec3 pos = ivec3(gl_GlobalInvocationID.xyz);
+ pos.z += int(u_pushConstant.baseLayer);
+ uvec4 srcBlock = imageLoad(u_image0, WITH_TYPE(getPos)(pos));
+
+ float[16] decompressedR =
+ eac_decode_single_channel_block_float(flip32(srcBlock[0]), flip32(srcBlock[1]), false);
+
+ float[16] decompressedG =
+ eac_decode_single_channel_block_float(flip32(srcBlock[2]), flip32(srcBlock[3]), false);
+
+ for (int y = 0; y < WITH_TYPE(BLOCK_Y_SIZE_); y++) {
+ for (int x = 0; x < 4; x++) {
+ imageStore(u_image1, WITH_TYPE(getPos)(ivec3(pos.xy * 4 + ivec2(x, y), pos.z)),
+ vec4(decompressedR[y * 4 + x], decompressedG[y * 4 + x], 0, 1));
+ }
+ }
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2RGB8.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2RGB8.comp
new file mode 100644
index 00000000000..efc2f5118d8
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2RGB8.comp
@@ -0,0 +1,47 @@
+// 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.
+
+#version 450
+#include "Etc2ShaderLib.comp"
+
+layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
+
+layout(push_constant) uniform ImageFormatBlock {
+ uint compFormat;
+ uint baseLayer;
+}
+u_pushConstant;
+
+layout(binding = 0, rgba16ui) readonly uniform WITH_TYPE(uimage) u_image0;
+layout(binding = 1, rgba8ui) writeonly uniform WITH_TYPE(uimage) u_image1;
+
+void main(void) {
+ ivec3 pos = ivec3(gl_GlobalInvocationID.xyz);
+ pos.z += int(u_pushConstant.baseLayer);
+ ivec4 srcBlock = ivec4(imageLoad(u_image0, WITH_TYPE(getPos)(pos)));
+
+ bool isPunchthroughAlpha = (u_pushConstant.compFormat == VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK ||
+ u_pushConstant.compFormat == VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK);
+
+ ivec4[16] decompressed =
+ etc2_decode_rgb_block(constructUint32(srcBlock[0], srcBlock[1]),
+ constructUint32(srcBlock[2], srcBlock[3]), isPunchthroughAlpha);
+
+ for (int y = 0; y < WITH_TYPE(BLOCK_Y_SIZE_); y++) {
+ for (int x = 0; x < 4; x++) {
+ imageStore(u_image1, WITH_TYPE(getPos)(ivec3(pos.xy * 4 + ivec2(x, y), pos.z)),
+ decompressed[y * 4 + x]);
+ }
+ }
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2RGBA8.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2RGBA8.comp
new file mode 100644
index 00000000000..cd97e27de12
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2RGBA8.comp
@@ -0,0 +1,46 @@
+// 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.
+
+#version 450
+#include "Etc2ShaderLib.comp"
+
+layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
+
+layout(push_constant) uniform ImageFormatBlock {
+ uint compFormat;
+ uint baseLayer;
+}
+u_pushConstant;
+
+layout(binding = 0, rgba32ui) readonly uniform WITH_TYPE(uimage) u_image0;
+layout(binding = 1, rgba8ui) writeonly uniform WITH_TYPE(uimage) u_image1;
+
+void main(void) {
+ ivec3 pos = ivec3(gl_GlobalInvocationID.xyz);
+ pos.z += int(u_pushConstant.baseLayer);
+ uvec4 srcBlock = uvec4(imageLoad(u_image0, WITH_TYPE(getPos)(pos)));
+
+ uint[16] decompressedAlpha =
+ eac_decode_single_channel_block(flip32(srcBlock[0]), flip32(srcBlock[1]), false);
+
+ ivec4[16] decompressed =
+ etc2_decode_rgb_block(int(flip32(srcBlock[2])), int(flip32(srcBlock[3])), false);
+
+ for (int y = 0; y < WITH_TYPE(BLOCK_Y_SIZE_); y++) {
+ for (int x = 0; x < 4; x++) {
+ imageStore(u_image1, WITH_TYPE(getPos)(ivec3(pos.xy * 4 + ivec2(x, y), pos.z)),
+ ivec4(decompressed[y * 4 + x].rgb, decompressedAlpha[y * 4 + x]));
+ }
+ }
+}
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2ShaderLib.comp b/src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2ShaderLib.comp
new file mode 100644
index 00000000000..a62aef9e457
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/Etc2ShaderLib.comp
@@ -0,0 +1,367 @@
+// 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.
+
+#include "Common.comp"
+
+precision highp int;
+
+const uint VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147;
+const uint VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148;
+const uint VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149;
+const uint VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150;
+const uint VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151;
+const uint VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152;
+const uint VK_FORMAT_EAC_R11_UNORM_BLOCK = 153;
+const uint VK_FORMAT_EAC_R11_SNORM_BLOCK = 154;
+const uint VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155;
+const uint VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156;
+
+const int kLookup[8] = {0, 1, 2, 3, -4, -3, -2, -1};
+
+const ivec4 kRGBModifierTable[] = {
+ /* 0 */ {2, 8, -2, -8},
+ /* 1 */ {5, 17, -5, -17},
+ /* 2 */ {9, 29, -9, -29},
+ /* 3 */ {13, 42, -13, -42},
+ /* 4 */ {18, 60, -18, -60},
+ /* 5 */ {24, 80, -24, -80},
+ /* 6 */ {33, 106, -33, -106},
+ /* 7 */ {47, 183, -47, -183}};
+
+const ivec4 kRGBOpaqueModifierTable[] = {
+ /* 0 */ {0, 8, 0, -8},
+ /* 1 */ {0, 17, 0, -17},
+ /* 2 */ {0, 29, 0, -29},
+ /* 3 */ {0, 42, 0, -42},
+ /* 4 */ {0, 60, 0, -60},
+ /* 5 */ {0, 80, 0, -80},
+ /* 6 */ {0, 106, 0, -106},
+ /* 7 */ {0, 183, 0, -183}};
+
+const ivec4 kAlphaModifierTable[] = {
+ /* 0 */ {-3, -6, -9, -15}, {2, 5, 8, 14},
+ /* 1 */ {-3, -7, -10, -13}, {2, 6, 9, 12},
+ /* 2 */ {-2, -5, -8, -13}, {1, 4, 7, 12},
+ /* 3 */ {-2, -4, -6, -13}, {1, 3, 5, 12},
+ /* 4 */ {-3, -6, -8, -12}, {2, 5, 7, 11},
+ /* 5 */ {-3, -7, -9, -11}, {2, 6, 8, 10},
+ /* 6 */ {-4, -7, -8, -11}, {3, 6, 7, 10},
+ /* 7 */ {-3, -5, -8, -11}, {2, 4, 7, 10},
+ /* 8 */ {-2, -6, -8, -10}, {1, 5, 7, 9},
+ /* 9 */ {-2, -5, -8, -10}, {1, 4, 7, 9},
+ /* 10 */ {-2, -4, -8, -10}, {1, 3, 7, 9},
+ /* 11 */ {-2, -5, -7, -10}, {1, 4, 6, 9},
+ /* 12 */ {-3, -4, -7, -10}, {2, 3, 6, 9},
+ /* 13 */ {-1, -2, -3, -10}, {0, 1, 2, 9},
+ /* 14 */ {-4, -6, -8, -9}, {3, 5, 7, 8},
+ /* 15 */ {-3, -5, -7, -9}, {2, 4, 6, 8}};
+
+bool isOverflowed(uint base, uint diff) {
+ int val = int(0x1f & base) + kLookup[0x7 & diff];
+ return (val < 0) || (val >= 32);
+}
+
+uint convert4To8(uint b) {
+ uint c = b & 0xf;
+ return (c << 4) | c;
+}
+
+uint convert5To8(uint b) {
+ uint c = b & 0x1f;
+ return (c << 3) | (c >> 2);
+}
+
+uint convert6To8(uint b) {
+ uint c = b & 0x3f;
+ return (c << 2) | (c >> 4);
+}
+
+uint convert7To8(uint b) {
+ uint c = b & 0x7f;
+ return (c << 1) | (c >> 6);
+}
+
+uint convertDiff(uint base, uint diff) {
+ return convert5To8(uint(int(0x1f & base) + kLookup[0x7 & diff]));
+}
+
+int _clamp(int x) { return int(clamp(x, 0, 255)); }
+
+ivec3 _clamp(ivec3 x) { return ivec3(clamp(x, 0, 255)); }
+
+ivec4[16] etc2_T_H_index(ivec3[4] clrTable, uint low, bool isPunchthroughAlpha, bool opaque) {
+ ivec4 ret[16];
+ for (uint y = 0; y < 4; y++) {
+ for (uint x = 0; x < 4; x++) {
+ uint k = y + x * 4;
+ uint msb = (low >> (k + 15)) & 2;
+ uint lsb = (low >> k) & 1;
+ if (isPunchthroughAlpha && (!opaque) && (msb != 0) && (lsb == 0)) {
+ // rgba all 0
+ ret[y * 4 + x] = ivec4(0, 0, 0, 0);
+ } else {
+ uint offset = lsb | msb;
+ ret[y * 4 + x] = ivec4(clrTable[offset], 255);
+ }
+ }
+ }
+ return ret;
+}
+
+ivec4[16] etc2_decode_block_T(uint high, uint low, bool isPunchthroughAlpha, bool opaque) {
+ const int LUT[] = {3, 6, 11, 16, 23, 32, 41, 64};
+ int r1, r2, g1, g2, b1, b2;
+ r1 = int(convert4To8((((high >> 27) & 3) << 2) | ((high >> 24) & 3)));
+ g1 = int(convert4To8(high >> 20));
+ b1 = int(convert4To8(high >> 16));
+ r2 = int(convert4To8(high >> 12));
+ g2 = int(convert4To8(high >> 8));
+ b2 = int(convert4To8(high >> 4));
+ // 3 bits intense modifier
+ int intenseIdx = int((((high >> 2) & 3) << 1) | (high & 1));
+ int intenseMod = LUT[intenseIdx];
+ ivec3 clrTable[4];
+ clrTable[0] = ivec3(r1, g1, b1);
+ clrTable[1] = ivec3(_clamp(int(r2) + intenseMod), _clamp(int(g2) + intenseMod),
+ _clamp(int(b2) + intenseMod));
+ clrTable[2] = ivec3(r2, g2, b2);
+ clrTable[3] = ivec3(_clamp(int(r2) - intenseMod), _clamp(int(g2) - intenseMod),
+ _clamp(int(b2) - intenseMod));
+ return etc2_T_H_index(clrTable, low, isPunchthroughAlpha, opaque);
+}
+
+ivec4[16] etc2_decode_block_H(uint high, uint low, bool isPunchthroughAlpha, bool opaque) {
+ const int LUT[] = {3, 6, 11, 16, 23, 32, 41, 64};
+ ivec3 rgb1, rgb2;
+ rgb1.r = int(convert4To8(high >> 27));
+ rgb1.g = int(convert4To8(((high >> 24) << 1) | ((high >> 20) & 1)));
+ rgb1.b = int(convert4To8(((high >> 19) << 3) | ((high >> 15) & 7)));
+ rgb2.r = int(convert4To8(high >> 11));
+ rgb2.g = int(convert4To8(high >> 7));
+ rgb2.b = int(convert4To8(high >> 3));
+ // 3 bits intense modifier
+ uint intenseIdx = high & 4;
+ intenseIdx |= (high & 1) << 1;
+ intenseIdx |= uint(((rgb1.r << 16) | (rgb1.g << 8) | rgb1.b) >=
+ ((rgb2.r << 16) | (rgb2.g << 8) | rgb2.b));
+ int intenseMod = LUT[intenseIdx];
+ ivec3 clrTable[4];
+ clrTable[0] = _clamp(ivec3(rgb1) + intenseMod);
+ clrTable[1] = _clamp(ivec3(rgb1) - intenseMod);
+ clrTable[2] = _clamp(ivec3(rgb2) + intenseMod);
+ clrTable[3] = _clamp(ivec3(rgb2) - intenseMod);
+ return etc2_T_H_index(clrTable, low, isPunchthroughAlpha, opaque);
+}
+
+ivec4[16] etc2_decode_block_P(uint high, uint low, bool isPunchthroughAlpha) {
+ ivec3 rgbo, rgbh, rgbv;
+ rgbo.r = int(convert6To8(high >> 25));
+ rgbo.g = int(convert7To8(((high >> 24) << 6) | ((high >> 17) & 63)));
+ rgbo.b = int(convert6To8(((high >> 16) << 5) | (((high >> 11) & 3) << 3) | ((high >> 7) & 7)));
+ rgbh.r = int(convert6To8(((high >> 2) << 1) | (high & 1)));
+ rgbh.g = int(convert7To8(low >> 25));
+ rgbh.b = int(convert6To8(low >> 19));
+ rgbv.r = int(convert6To8(low >> 13));
+ rgbv.g = int(convert7To8(low >> 6));
+ rgbv.b = int(convert6To8(low));
+ ivec4 ret[16];
+ for (int i = 0; i < 16; i++) {
+ int y = i >> 2;
+ int x = i & 3;
+ ret[i] = ivec4(_clamp((x * (rgbh - rgbo) + y * (rgbv - rgbo) + 4 * rgbo + 2) >> 2), 255);
+ ret[i].a = 255;
+ }
+ return ret;
+}
+
+void decode_subblock(inout ivec4 pOut[16], int r, int g, int b, ivec4 table, uint low, bool second,
+ bool flipped, bool isPunchthroughAlpha, bool opaque) {
+ uint baseX = 0;
+ uint baseY = 0;
+ if (second) {
+ if (flipped) {
+ baseY = 2;
+ } else {
+ baseX = 2;
+ }
+ }
+ for (int i = 0; i < 8; i++) {
+ uint x, y;
+ if (flipped) {
+ x = baseX + (i >> 1);
+ y = baseY + (i & 1);
+ } else {
+ x = baseX + (i >> 2);
+ y = baseY + (i & 3);
+ }
+ uint k = y + (x * 4);
+ uint msb = ((low >> (k + 15)) & 2);
+ uint lsb = ((low >> k) & 1);
+ uint q = x + 4 * y;
+ if (isPunchthroughAlpha && (!opaque) && (msb != 0) && (lsb == 0)) {
+ // rgba all 0
+ pOut[q] = ivec4(0, 0, 0, 0);
+ } else {
+ uint offset = lsb | msb;
+ int delta = table[offset];
+ pOut[q] =
+ ivec4(_clamp(int(r) + delta), _clamp(int(g) + delta), _clamp(int(b) + delta), 255);
+ }
+ }
+}
+
+ivec4[16] allZeros() {
+ ivec4[16] ret;
+ for (int i = 0; i < 16; i++) {
+ ret[i] = ivec4(0);
+ }
+ return ret;
+}
+
+ivec4[16] etc2_decode_rgb_block(uint high, uint low, bool isPunchthroughAlpha) {
+ bool opaque = (((high >> 1) & 1) != 0);
+ int r1, r2, g1, g2, b1, b2;
+ if (isPunchthroughAlpha || ((high & 2) != 0)) {
+ // differntial
+ uint rBase = high >> 27;
+ uint gBase = high >> 19;
+ uint bBase = high >> 11;
+ if (isOverflowed(rBase, high >> 24)) {
+ return etc2_decode_block_T(high, low, isPunchthroughAlpha, opaque);
+ }
+ if (isOverflowed(gBase, high >> 16)) {
+ return etc2_decode_block_H(high, low, isPunchthroughAlpha, opaque);
+ }
+ if (isOverflowed(bBase, high >> 8)) {
+ return etc2_decode_block_P(high, low, isPunchthroughAlpha);
+ }
+ r1 = int(convert5To8(rBase));
+ r2 = int(convertDiff(rBase, high >> 24));
+ g1 = int(convert5To8(gBase));
+ g2 = int(convertDiff(gBase, high >> 16));
+ b1 = int(convert5To8(bBase));
+ b2 = int(convertDiff(bBase, high >> 8));
+ } else {
+ // not differential
+ r1 = int(convert4To8(high >> 28));
+ r2 = int(convert4To8(high >> 24));
+ g1 = int(convert4To8(high >> 20));
+ g2 = int(convert4To8(high >> 16));
+ b1 = int(convert4To8(high >> 12));
+ b2 = int(convert4To8(high >> 8));
+ }
+ uint tableIndexA = 7 & (high >> 5);
+ uint tableIndexB = 7 & (high >> 2);
+ ivec4 tableA;
+ ivec4 tableB;
+ if (opaque || !isPunchthroughAlpha) {
+ tableA = kRGBModifierTable[tableIndexA];
+ tableB = kRGBModifierTable[tableIndexB];
+ } else {
+ tableA = kRGBOpaqueModifierTable[tableIndexA];
+ tableB = kRGBOpaqueModifierTable[tableIndexB];
+ }
+ bool flipped = ((high & 1) != 0);
+ ivec4[16] ret;
+ decode_subblock(ret, r1, g1, b1, tableA, low, false, flipped, isPunchthroughAlpha, opaque);
+ decode_subblock(ret, r2, g2, b2, tableB, low, true, flipped, isPunchthroughAlpha, opaque);
+ return ret;
+}
+
+uint[16] eac_decode_single_channel_block(uint high, uint low, bool isSigned) {
+ int base_codeword = int(high >> 24);
+ base_codeword &= 255;
+ int multiplier = int(high >> 20);
+ multiplier &= 15;
+
+ uint tblIdx = ((high >> 16) & 15);
+ const ivec4 table0 = kAlphaModifierTable[tblIdx * 2];
+ const ivec4 table1 = kAlphaModifierTable[tblIdx * 2 + 1];
+ const uint p[16] = {
+ high >> 13, high >> 10, high >> 7, high >> 4, high >> 1, (high << 2) | (low >> 30),
+ low >> 27, low >> 24, low >> 21, low >> 18, low >> 15, low >> 12,
+ low >> 9, low >> 6, low >> 3, low};
+ uint result[16];
+ for (uint i = 0; i < 16; i++) {
+ // flip x, y in output
+ uint outIdx = (i % 4) * 4 + i / 4;
+
+ uint modifier = (p[i] & 7);
+ int modifierValue = ((modifier >= 4) ? table1[modifier - 4] : table0[modifier]);
+ int decoded = base_codeword + modifierValue * multiplier;
+ result[outIdx] = uint(_clamp(decoded));
+ }
+ return result;
+}
+
+float[16] eac_decode_single_channel_block_float(uint high, uint low, bool isSigned) {
+ int base_codeword = int(high >> 24);
+ if (isSigned) {
+ if (base_codeword >= 128) {
+ base_codeword -= 256;
+ }
+ if (base_codeword == -128) {
+ base_codeword = -127;
+ }
+ }
+ int multiplier = int(high >> 20);
+ multiplier &= 15;
+
+ uint tblIdx = ((high >> 16) & 15);
+ const ivec4 table0 = kAlphaModifierTable[tblIdx * 2];
+ const ivec4 table1 = kAlphaModifierTable[tblIdx * 2 + 1];
+ const uint p[16] = {
+ high >> 13, high >> 10, high >> 7, high >> 4, high >> 1, (high << 2) | (low >> 30),
+ low >> 27, low >> 24, low >> 21, low >> 18, low >> 15, low >> 12,
+ low >> 9, low >> 6, low >> 3, low};
+ float result[16];
+ for (uint i = 0; i < 16; i++) {
+ // flip x, y in output
+ uint outIdx = (i % 4) * 4 + i / 4;
+
+ uint modifier = (p[i] & 7);
+ int modifierValue = ((modifier >= 4) ? table1[modifier - 4] : table0[modifier]);
+ int decoded = base_codeword + modifierValue * multiplier;
+ decoded *= 8;
+ if (multiplier == 0) {
+ decoded += modifierValue;
+ }
+ if (isSigned) {
+ decoded = clamp(decoded, -1023, 1023);
+ result[outIdx] = float(decoded) / 1023.0;
+ } else {
+ decoded += 4;
+ decoded = clamp(decoded, 0, 2047);
+ result[outIdx] = float(decoded) / 2047.0;
+ }
+ }
+ return result;
+}
+
+uint constructUint32(uint a16, uint b16) {
+ uint a2 = (a16 & 0xff) << 8;
+ a2 |= (a16 >> 8) & 0xff;
+ uint b2 = (b16 & 0xff) << 8;
+ b2 |= (b16 >> 8) & 0xff;
+ return (a2 << 16) | b2;
+}
+
+uint flip32(uint a) {
+ return ((a & 0xff) << 24) | ((a & 0xff00) << 8) | ((a & 0xff0000) >> 8) |
+ ((a & 0xff000000) >> 24);
+}
+
+#define BLOCK_Y_SIZE_1DArray 1
+#define BLOCK_Y_SIZE_2DArray 4
+#define BLOCK_Y_SIZE_3D 4
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/build_shaders.py b/src/gfxstream/host/vulkan/emulated_textures/shaders/build_shaders.py
new file mode 100644
index 00000000000..ef24f34d89d
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/build_shaders.py
@@ -0,0 +1,72 @@
+# 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.
+
+import os
+
+# This script compiles the image decompression shaders.
+# glslc must be in the path for this script to work
+
+# The list of shaders to compile, without the .comp extension
+shaders = [
+ "Astc",
+ "AstcToRgb",
+ "AstcToBc3",
+ "EacR11Snorm",
+ "EacR11Unorm",
+ "EacRG11Snorm",
+ "EacRG11Unorm",
+ "Etc2RGB8",
+ "Etc2RGBA8",
+]
+
+# Template for the compilation command
+command = "glslc -DDIM={dim} --target-env=vulkan1.1 -mfmt=num {input} -o {output}"
+
+output_dir = "compiled"
+
+
+# Compiles a single shader
+# shader: shader name, without the .comp extension
+# dim: image dimension. Must be 1, 2 or 3 - for 1D, 2D and 3D respectively
+def compile(shader: str, dim: int):
+ input = "{}.comp".format(shader)
+ output = os.path.join(output_dir, "{}_{}D.inl".format(shader, dim))
+ cmd = command.format(dim=dim, input=input, output=output)
+ print("Executing: {}".format(cmd))
+ ret = os.system(cmd)
+ if ret != 0:
+ print("Compiling {} failed.".format(input))
+ exit(ret)
+
+
+def main():
+ # Set the current working directory where the script is located
+ os.chdir(os.path.dirname(os.path.realpath(__file__)))
+ print("Compiling shaders in", os.getcwd())
+
+ # Make sure the shaders are all properly formatted
+ ret = os.system("clang-format -i *.comp *.glsl")
+ if ret != 0:
+ print("Running clang-format failed. Make sure it is available in your PATH.")
+ exit(ret)
+
+ os.makedirs(output_dir, exist_ok=True)
+
+ for shader in shaders:
+ for dim in range(1, 4):
+ compile(shader, dim)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_1D.inl
new file mode 100644
index 00000000000..9dcfdfee0d9
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_1D.inl
@@ -0,0 +1,3574 @@
+0x07230203,0x00010300,0x000d000a,0x00000952,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x0000091d,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00080005,
+0x0000000d,0x45746567,0x646f636e,0x53676e69,
+0x28657a69,0x763b3175,0x003b3375,0x00040005,
+0x0000000b,0x566d756e,0x00736c61,0x00050005,
+0x0000000c,0x6f636e65,0x676e6964,0x00000000,
+0x00070005,0x0000000f,0x6f636564,0x6c426564,
+0x436b636f,0x69666e6f,0x00002867,0x00080005,
+0x00000017,0x72747865,0x42746361,0x28737469,
+0x3b347576,0x753b3175,0x00003b31,0x00040005,
+0x00000014,0x61746164,0x00000000,0x00040005,
+0x00000015,0x7366666f,0x00007465,0x00040005,
+0x00000016,0x426d756e,0x00737469,0x00080005,
+0x0000001e,0x6f636564,0x45436564,0x3175284d,
+0x3b31753b,0x753b3175,0x00003b31,0x00060005,
+0x0000001a,0x74726170,0x6f697469,0x646e496e,
+0x00007865,0x00060005,0x0000001b,0x72617473,
+0x45664f74,0x61727478,0x006d6543,0x00060005,
+0x0000001c,0x61746f74,0x646e456c,0x6e696f70,
+0x00007374,0x00070005,0x0000001d,0x65736162,
+0x70646e45,0x746e696f,0x65646e49,0x00000078,
+0x00090005,0x00000025,0x6f636564,0x72546564,
+0x76287469,0x753b3475,0x31753b31,0x3b31753b,
+0x00000000,0x00040005,0x00000021,0x61746164,
+0x00000000,0x00040005,0x00000022,0x7366666f,
+0x00007465,0x00040005,0x00000023,0x426d756e,
+0x00737469,0x00030005,0x00000024,0x00000069,
+0x00090005,0x0000002b,0x6f636564,0x75516564,
+0x28746e69,0x3b347576,0x753b3175,0x31753b31,
+0x0000003b,0x00040005,0x00000027,0x61746164,
+0x00000000,0x00040005,0x00000028,0x7366666f,
+0x00007465,0x00040005,0x00000029,0x426d756e,
+0x00737469,0x00030005,0x0000002a,0x00000069,
+0x000a0005,0x00000032,0x6f636564,0x57316564,
+0x68676965,0x75762874,0x75763b34,0x31753b33,
+0x3b31753b,0x00000000,0x00050005,0x0000002e,
+0x67696577,0x61447468,0x00006174,0x00050005,
+0x0000002f,0x6f636e65,0x676e6964,0x00000000,
+0x00050005,0x00000030,0x576d756e,0x68676965,
+0x00007374,0x00040005,0x00000031,0x65646e69,
+0x00000078,0x000e0005,0x0000003f,0x65746e69,
+0x6c6f7072,0x57657461,0x68676965,0x76287374,
+0x763b3475,0x753b3375,0x31753b31,0x3b31753b,
+0x753b3175,0x75763b31,0x00003b32,0x00050005,
+0x00000037,0x67696577,0x61447468,0x00006174,
+0x00050005,0x00000038,0x6f636e65,0x676e6964,
+0x00000000,0x00050005,0x00000039,0x576d756e,
+0x68676965,0x00007374,0x00040005,0x0000003a,
+0x65646e69,0x00000078,0x00050005,0x0000003b,
+0x64697267,0x74646957,0x00000068,0x00040005,
+0x0000003c,0x69727473,0x00006564,0x00040005,
+0x0000003d,0x7366666f,0x00007465,0x00060005,
+0x0000003e,0x63617266,0x6e6f6974,0x61506c61,
+0x00007472,0x00080005,0x00000044,0x6f636564,
+0x65576564,0x74686769,0x75762873,0x75763b34,
+0x00003b32,0x00050005,0x00000042,0x67696577,
+0x61447468,0x00006174,0x00050005,0x00000043,
+0x49736f70,0x6f6c426e,0x00006b63,0x00050005,
+0x00000048,0x68736168,0x75283235,0x00003b31,
+0x00030005,0x00000047,0x00000070,0x00090005,
+0x0000004e,0x656c6573,0x61507463,0x74697472,
+0x286e6f69,0x763b3175,0x753b3275,0x00003b31,
+0x00040005,0x0000004b,0x64656573,0x00000000,
+0x00030005,0x0000004c,0x00736f70,0x00060005,
+0x0000004d,0x506d756e,0x69747261,0x6e6f6974,
+0x00000073,0x000a0005,0x00000054,0x45746567,
+0x6f70646e,0x45746e69,0x646f636e,0x28676e69,
+0x753b3175,0x31753b31,0x0000003b,0x00080005,
+0x00000051,0x69617661,0x6c62616c,0x646e4565,
+0x6e696f70,0x74694274,0x00000073,0x00060005,
+0x00000052,0x456d756e,0x6f70646e,0x73746e69,
+0x00000000,0x00050005,0x00000053,0x75746361,
+0x69536c61,0x0000657a,0x00070005,0x0000005b,
+0x65756c62,0x746e6f43,0x74636172,0x34697628,
+0x0000003b,0x00030005,0x0000005a,0x00000076,
+0x00050005,0x00000061,0x286d7573,0x3b336976,
+0x00000000,0x00030005,0x00000060,0x00000076,
+0x00090005,0x00000066,0x54746962,0x736e6172,
+0x53726566,0x656e6769,0x69762864,0x69763b34,
+0x00003b34,0x00030005,0x00000064,0x00000061,
+0x00030005,0x00000065,0x00000062,0x000b0005,
+0x0000006e,0x6f636564,0x6e456564,0x696f7064,
+0x2873746e,0x3b346976,0x3b346976,0x763b3175,
+0x763b3475,0x003b3475,0x00030005,0x00000069,
+0x00004176,0x00030005,0x0000006a,0x00004276,
+0x00040005,0x0000006b,0x65646f6d,0x00000000,
+0x00030005,0x0000006c,0x00307065,0x00030005,
+0x0000006d,0x00317065,0x000a0005,0x00000075,
+0x6f636564,0x45316564,0x6f70646e,0x28746e69,
+0x3b347576,0x753b3175,0x75763b31,0x00003b33,
+0x00040005,0x00000071,0x61746164,0x00000000,
+0x00050005,0x00000072,0x72617473,0x66664f74,
+0x00746573,0x00040005,0x00000073,0x65646e69,
+0x00000078,0x00050005,0x00000074,0x6f636e65,
+0x676e6964,0x00000000,0x00070005,0x00000079,
+0x6c697562,0x74694264,0x6b73616d,0x3b317528,
+0x00000000,0x00040005,0x00000078,0x73746962,
+0x00000000,0x00080005,0x0000007d,0x63747361,
+0x6f636544,0x65546564,0x286c6578,0x3b327576,
+0x00000000,0x00050005,0x0000007c,0x49736f70,
+0x6f6c426e,0x00006b63,0x00070005,0x00000082,
+0x50746567,0x4431736f,0x61727241,0x69762879,
+0x00003b33,0x00030005,0x00000081,0x00736f70,
+0x00050005,0x00000086,0x6f636564,0x72456564,
+0x00726f72,0x00040005,0x00000088,0x69427174,
+0x00007374,0x00050005,0x000000a8,0x64696f76,
+0x65747845,0x0000746e,0x00050005,0x000000aa,
+0x63747361,0x636f6c42,0x0000006b,0x00040005,
+0x000000b6,0x73746962,0x00003130,0x00040005,
+0x000000bc,0x73746962,0x00003332,0x00040005,
+0x000000c0,0x34746962,0x00000000,0x00040005,
+0x000000c6,0x73746962,0x00003635,0x00040005,
+0x000000cb,0x73746962,0x00003837,0x00030005,
+0x000000d0,0x00000068,0x00050005,0x000000d5,
+0x6c617564,0x6e616c50,0x00000065,0x00030005,
+0x000000df,0x00000072,0x00060005,0x000000eb,
+0x67696577,0x72477468,0x69536469,0x0000657a,
+0x00070005,0x0000013f,0x67616d49,0x726f4665,
+0x4274616d,0x6b636f6c,0x00000000,0x00060006,
+0x0000013f,0x00000000,0x636f6c62,0x7a69536b,
+0x00000065,0x00060006,0x0000013f,0x00000001,
+0x65736162,0x6579614c,0x00000072,0x00060006,
+0x0000013f,0x00000002,0x6c616d73,0x6f6c426c,
+0x00006b63,0x00060005,0x00000141,0x75705f75,
+0x6f436873,0x6174736e,0x0000746e,0x00060005,
+0x0000014c,0x67696577,0x6e457468,0x69646f63,
+0x0000676e,0x00050005,0x00000163,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x00000166,
+0x576d756e,0x68676965,0x00007374,0x00060005,
+0x0000016f,0x67696577,0x61447468,0x69536174,
+0x0000657a,0x00040005,0x00000170,0x61726170,
+0x0000006d,0x00040005,0x00000172,0x61726170,
+0x0000006d,0x00060005,0x00000183,0x506d756e,
+0x69747261,0x6e6f6974,0x00000073,0x00060005,
+0x0000018d,0x74726170,0x6f697469,0x6565536e,
+0x00000064,0x00030005,0x0000019e,0x00000069,
+0x00030005,0x000001a3,0x0000006a,0x00040005,
+0x000001aa,0x72617473,0x00000074,0x00050005,
+0x000001bd,0x4c6d756e,0x6942776f,0x00007374,
+0x00040005,0x000001c0,0x42776f6c,0x00737469,
+0x00050005,0x000001c9,0x68676968,0x73746942,
+0x00000000,0x00030005,0x000001e0,0x006d6563,
+0x00050005,0x000001eb,0x536d6563,0x63656c65,
+0x00726f74,0x00040005,0x000001f0,0x65736162,
+0x006d6543,0x00080005,0x000001fb,0x70646e65,
+0x746e696f,0x72655073,0x74726150,0x6f697469,
+0x0000006e,0x00060005,0x00000209,0x657a6973,
+0x7845664f,0x43617274,0x00006d65,0x00050005,
+0x00000211,0x72747865,0x6d654361,0x00000000,
+0x00040005,0x00000212,0x61726170,0x0000006d,
+0x00040005,0x00000214,0x61726170,0x0000006d,
+0x00040005,0x00000216,0x61726170,0x0000006d,
+0x00040005,0x00000219,0x6c6c7566,0x006d6543,
+0x00040005,0x0000021e,0x6c61566d,0x00006575,
+0x00040005,0x00000226,0x6c615663,0x00736575,
+0x00050005,0x0000023e,0x65736162,0x73616c43,
+0x00000073,0x00050005,0x0000024d,0x6d756e69,
+0x73746942,0x00000000,0x00040005,0x00000250,
+0x636f6c62,0x0000006b,0x00040005,0x00000257,
+0x61726170,0x0000006d,0x00040005,0x00000259,
+0x61726170,0x0000006d,0x00040005,0x0000025a,
+0x61726170,0x0000006d,0x00050005,0x0000025c,
+0x6b636170,0x72546465,0x00737469,0x00040005,
+0x0000027f,0x42776f6c,0x00737469,0x00040005,
+0x00000280,0x61726170,0x0000006d,0x00040005,
+0x00000282,0x61726170,0x0000006d,0x00040005,
+0x00000284,0x61726170,0x0000006d,0x00030005,
+0x00000288,0x0000006a,0x00040005,0x00000296,
+0x6f636564,0x00646564,0x00050005,0x00000380,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x0000038e,0x6d756e69,0x73746942,0x00000000,
+0x00040005,0x00000391,0x636f6c62,0x0000006b,
+0x00040005,0x00000395,0x61726170,0x0000006d,
+0x00040005,0x00000397,0x61726170,0x0000006d,
+0x00040005,0x00000399,0x61726170,0x0000006d,
+0x00060005,0x0000039b,0x6b636170,0x75516465,
+0x73746e69,0x00000000,0x00040005,0x000003ad,
+0x42776f6c,0x00737469,0x00040005,0x000003b9,
+0x6f636564,0x00646564,0x00050005,0x000003f1,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000405,0x426d756e,0x00737469,0x00040005,
+0x0000040d,0x7366666f,0x00007465,0x00030005,
+0x00000414,0x00000077,0x00040005,0x00000417,
+0x61726170,0x0000006d,0x00040005,0x00000419,
+0x61726170,0x0000006d,0x00040005,0x0000041b,
+0x61726170,0x0000006d,0x00040005,0x0000041d,
+0x61726170,0x0000006d,0x00050005,0x00000436,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000440,0x7366666f,0x00007465,0x00030005,
+0x00000447,0x00000077,0x00040005,0x0000044a,
+0x61726170,0x0000006d,0x00040005,0x0000044c,
+0x61726170,0x0000006d,0x00040005,0x0000044e,
+0x61726170,0x0000006d,0x00040005,0x00000450,
+0x61726170,0x0000006d,0x00050005,0x00000464,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000469,0x7366666f,0x00007465,0x00030005,
+0x0000046d,0x00000077,0x00040005,0x0000046e,
+0x61726170,0x0000006d,0x00040005,0x00000470,
+0x61726170,0x0000006d,0x00040005,0x00000472,
+0x61726170,0x0000006d,0x00040005,0x00000475,
+0x75716e75,0x00746e61,0x00050005,0x00000481,
+0x65646e69,0x6c626178,0x00000065,0x00060005,
+0x00000496,0x67696577,0x6e497468,0x65636964,
+0x00000073,0x00040005,0x000004a4,0x67696577,
+0x00737468,0x00040005,0x000004a5,0x61726170,
+0x0000006d,0x00040005,0x000004a7,0x61726170,
+0x0000006d,0x00040005,0x000004a9,0x61726170,
+0x0000006d,0x00040005,0x000004ab,0x61726170,
+0x0000006d,0x00040005,0x000004af,0x61726170,
+0x0000006d,0x00040005,0x000004b1,0x61726170,
+0x0000006d,0x00040005,0x000004b3,0x61726170,
+0x0000006d,0x00040005,0x000004b5,0x61726170,
+0x0000006d,0x00040005,0x000004b9,0x61726170,
+0x0000006d,0x00040005,0x000004bb,0x61726170,
+0x0000006d,0x00040005,0x000004bd,0x61726170,
+0x0000006d,0x00040005,0x000004bf,0x61726170,
+0x0000006d,0x00040005,0x000004c3,0x61726170,
+0x0000006d,0x00040005,0x000004c5,0x61726170,
+0x0000006d,0x00040005,0x000004c7,0x61726170,
+0x0000006d,0x00040005,0x000004c9,0x61726170,
+0x0000006d,0x00030005,0x000004ce,0x00313177,
+0x00040005,0x000004d6,0x74636166,0x0073726f,
+0x00050005,0x000004f6,0x6c616373,0x63614665,
+0x00726f74,0x00070005,0x00000503,0x6f6d6f68,
+0x656e6567,0x4373756f,0x64726f6f,0x00000073,
+0x00050005,0x00000506,0x64697267,0x726f6f43,
+0x00007364,0x00060005,0x00000511,0x65746e69,
+0x6c617267,0x74726150,0x00000000,0x00060005,
+0x00000515,0x63617266,0x6e6f6974,0x61506c61,
+0x00007472,0x00050005,0x0000051a,0x64697267,
+0x74646957,0x00000068,0x00030005,0x0000051d,
+0x00003076,0x00040005,0x00000525,0x67696577,
+0x00737468,0x00040005,0x0000052b,0x61726170,
+0x0000006d,0x00040005,0x0000052d,0x61726170,
+0x0000006d,0x00040005,0x0000052f,0x61726170,
+0x0000006d,0x00040005,0x00000531,0x61726170,
+0x0000006d,0x00040005,0x00000533,0x61726170,
+0x0000006d,0x00040005,0x00000535,0x61726170,
+0x0000006d,0x00040005,0x00000536,0x61726170,
+0x0000006d,0x00040005,0x00000537,0x61726170,
+0x0000006d,0x00040005,0x0000053e,0x61726170,
+0x0000006d,0x00040005,0x00000540,0x61726170,
+0x0000006d,0x00040005,0x00000542,0x61726170,
+0x0000006d,0x00040005,0x00000544,0x61726170,
+0x0000006d,0x00040005,0x00000546,0x61726170,
+0x0000006d,0x00040005,0x00000548,0x61726170,
+0x0000006d,0x00040005,0x00000549,0x61726170,
+0x0000006d,0x00040005,0x0000054a,0x61726170,
+0x0000006d,0x00040005,0x00000592,0x6d756e72,
+0x00000000,0x00040005,0x00000593,0x61726170,
+0x0000006d,0x00040005,0x00000596,0x64656573,
+0x00000041,0x00040005,0x000005a2,0x64656573,
+0x00000042,0x00040005,0x000005b5,0x66696873,
+0x00317374,0x00040005,0x000005c0,0x66696873,
+0x00327374,0x00040005,0x000005d3,0x75736572,
+0x0000746c,0x00030005,0x0000062a,0x00000069,
+0x00050005,0x00000632,0x6f636e65,0x676e6964,
+0x00000000,0x00050005,0x00000640,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000643,
+0x61726170,0x0000006d,0x00040005,0x00000645,
+0x61726170,0x0000006d,0x00030005,0x0000069f,
+0x0000306c,0x00030005,0x000006a8,0x0000316c,
+0x00040005,0x000006c6,0x61726170,0x0000006d,
+0x00040005,0x000006c8,0x61726170,0x0000006d,
+0x00040005,0x00000715,0x61726170,0x0000006d,
+0x00040005,0x00000719,0x61726170,0x0000006d,
+0x00040005,0x00000725,0x61726170,0x0000006d,
+0x00040005,0x00000729,0x61726170,0x0000006d,
+0x00040005,0x00000731,0x61726170,0x0000006d,
+0x00040005,0x00000733,0x61726170,0x0000006d,
+0x00040005,0x00000738,0x61726170,0x0000006d,
+0x00040005,0x0000074f,0x61726170,0x0000006d,
+0x00040005,0x00000755,0x61726170,0x0000006d,
+0x00040005,0x0000075f,0x426d756e,0x00737469,
+0x00040005,0x00000767,0x7366666f,0x00007465,
+0x00030005,0x00000770,0x00007065,0x00040005,
+0x00000773,0x61726170,0x0000006d,0x00040005,
+0x00000775,0x61726170,0x0000006d,0x00040005,
+0x00000777,0x61726170,0x0000006d,0x00040005,
+0x00000779,0x61726170,0x0000006d,0x00050005,
+0x000007e1,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x000007eb,0x7366666f,0x00007465,
+0x00030005,0x000007f4,0x00007065,0x00040005,
+0x000007f7,0x61726170,0x0000006d,0x00040005,
+0x000007f9,0x61726170,0x0000006d,0x00040005,
+0x000007fb,0x61726170,0x0000006d,0x00040005,
+0x000007fd,0x61726170,0x0000006d,0x00050005,
+0x0000080f,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000814,0x7366666f,0x00007465,
+0x00030005,0x0000081a,0x00000077,0x00040005,
+0x0000081b,0x61726170,0x0000006d,0x00040005,
+0x0000081d,0x61726170,0x0000006d,0x00040005,
+0x0000081f,0x61726170,0x0000006d,0x00040005,
+0x00000822,0x75716e75,0x00746e61,0x00050005,
+0x0000082f,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x0000083d,0x426d756e,0x00737469,
+0x00040005,0x00000846,0x6b73616d,0x00000000,
+0x00050005,0x00000872,0x67696577,0x61447468,
+0x00006174,0x00040005,0x00000876,0x61726170,
+0x0000006d,0x00040005,0x0000087a,0x67696577,
+0x00737468,0x00040005,0x0000087b,0x61726170,
+0x0000006d,0x00060005,0x0000087e,0x74726170,
+0x6f697469,0x646e496e,0x00007865,0x00040005,
+0x0000087f,0x61726170,0x0000006d,0x00040005,
+0x00000881,0x61726170,0x0000006d,0x00040005,
+0x00000882,0x61726170,0x0000006d,0x00060005,
+0x00000885,0x72617473,0x45664f74,0x61727478,
+0x006d6543,0x00060005,0x00000886,0x61746f74,
+0x646e456c,0x6e696f70,0x00007374,0x00070005,
+0x00000887,0x65736162,0x70646e45,0x746e696f,
+0x65646e49,0x00000078,0x00030005,0x00000888,
+0x006d6563,0x00040005,0x00000889,0x61726170,
+0x0000006d,0x00040005,0x0000088b,0x61726170,
+0x0000006d,0x00040005,0x0000088c,0x61726170,
+0x0000006d,0x00040005,0x0000088d,0x61726170,
+0x0000006d,0x00060005,0x00000897,0x70646e65,
+0x746e696f,0x61745373,0x00007472,0x00060005,
+0x0000089d,0x70646e65,0x746e696f,0x646e4573,
+0x00000000,0x00080005,0x000008a5,0x69617661,
+0x6c62616c,0x646e4565,0x6e696f70,0x74694274,
+0x00000073,0x00070005,0x000008a9,0x70646e65,
+0x746e696f,0x6f636e45,0x676e6964,0x00000000,
+0x00070005,0x000008aa,0x75746361,0x6e456c61,
+0x696f7064,0x6942746e,0x00007374,0x00040005,
+0x000008ab,0x61726170,0x0000006d,0x00040005,
+0x000008ad,0x61726170,0x0000006d,0x00040005,
+0x000008af,0x61726170,0x0000006d,0x00070005,
+0x000008b2,0x456d756e,0x6f70646e,0x50746e69,
+0x73726961,0x00000000,0x00030005,0x000008b6,
+0x00004176,0x00030005,0x000008b7,0x00004276,
+0x00040005,0x000008b8,0x61447065,0x00006174,
+0x00040005,0x000008bd,0x61726170,0x0000006d,
+0x00030005,0x000008c0,0x00000069,0x00040005,
+0x000008c9,0x64497065,0x00000078,0x00040005,
+0x000008cf,0x61726170,0x0000006d,0x00040005,
+0x000008d1,0x61726170,0x0000006d,0x00040005,
+0x000008d3,0x61726170,0x0000006d,0x00040005,
+0x000008d5,0x61726170,0x0000006d,0x00040005,
+0x000008dd,0x61726170,0x0000006d,0x00040005,
+0x000008df,0x61726170,0x0000006d,0x00040005,
+0x000008e1,0x61726170,0x0000006d,0x00040005,
+0x000008e2,0x61726170,0x0000006d,0x00030005,
+0x000008e9,0x00307065,0x00030005,0x000008ea,
+0x00317065,0x00040005,0x000008eb,0x61726170,
+0x0000006d,0x00040005,0x000008ed,0x61726170,
+0x0000006d,0x00040005,0x000008ef,0x61726170,
+0x0000006d,0x00040005,0x000008f1,0x61726170,
+0x0000006d,0x00040005,0x000008f2,0x61726170,
+0x0000006d,0x00070005,0x000008f6,0x67696577,
+0x50737468,0x68437265,0x656e6e61,0x0000006c,
+0x00030005,0x000008fd,0x00736363,0x00040005,
+0x000008fe,0x61726170,0x0000006d,0x00040005,
+0x00000900,0x61726170,0x0000006d,0x00040005,
+0x00000902,0x61726170,0x0000006d,0x00050005,
+0x0000091b,0x65786574,0x736f506c,0x00000000,
+0x00080005,0x0000091d,0x475f6c67,0x61626f6c,
+0x766e496c,0x7461636f,0x496e6f69,0x00000044,
+0x00040005,0x00000920,0x6579616c,0x00000072,
+0x00050005,0x00000927,0x636f6c62,0x736f506b,
+0x00000000,0x00050005,0x0000092c,0x49736f70,
+0x6f6c426e,0x00006b63,0x00050005,0x00000933,
+0x49637273,0x6567616d,0x00000000,0x00040005,
+0x0000093c,0x61726170,0x0000006d,0x00040005,
+0x00000940,0x65786574,0x0000006c,0x00050005,
+0x00000945,0x49747364,0x6567616d,0x00000000,
+0x00040005,0x0000094e,0x61726170,0x0000006d,
+0x00050048,0x0000013f,0x00000000,0x00000023,
+0x00000000,0x00050048,0x0000013f,0x00000001,
+0x00000023,0x00000008,0x00050048,0x0000013f,
+0x00000002,0x00000023,0x0000000c,0x00030047,
+0x0000013f,0x00000002,0x00040047,0x0000091d,
+0x0000000b,0x0000001c,0x00040047,0x00000933,
+0x00000022,0x00000000,0x00040047,0x00000933,
+0x00000021,0x00000000,0x00030047,0x00000933,
+0x00000018,0x00040047,0x00000945,0x00000022,
+0x00000000,0x00040047,0x00000945,0x00000021,
+0x00000001,0x00030047,0x00000945,0x00000019,
+0x00040047,0x00000951,0x0000000b,0x00000019,
+0x00020013,0x00000002,0x00030021,0x00000003,
+0x00000002,0x00040015,0x00000006,0x00000020,
+0x00000000,0x00040020,0x00000007,0x00000007,
+0x00000006,0x00040017,0x00000008,0x00000006,
+0x00000003,0x00040020,0x00000009,0x00000007,
+0x00000008,0x00050021,0x0000000a,0x00000006,
+0x00000007,0x00000009,0x00040017,0x00000011,
+0x00000006,0x00000004,0x00040020,0x00000012,
+0x00000007,0x00000011,0x00060021,0x00000013,
+0x00000006,0x00000012,0x00000007,0x00000007,
+0x00070021,0x00000019,0x00000006,0x00000007,
+0x00000007,0x00000007,0x00000007,0x00070021,
+0x00000020,0x00000006,0x00000012,0x00000007,
+0x00000007,0x00000007,0x00070021,0x0000002d,
+0x00000006,0x00000012,0x00000009,0x00000007,
+0x00000007,0x00040017,0x00000034,0x00000006,
+0x00000002,0x00040020,0x00000035,0x00000007,
+0x00000034,0x000b0021,0x00000036,0x00000006,
+0x00000012,0x00000009,0x00000007,0x00000007,
+0x00000007,0x00000007,0x00000007,0x00000035,
+0x00050021,0x00000041,0x00000034,0x00000012,
+0x00000034,0x00040021,0x00000046,0x00000006,
+0x00000007,0x00060021,0x0000004a,0x00000006,
+0x00000007,0x00000035,0x00000007,0x00060021,
+0x00000050,0x00000008,0x00000007,0x00000007,
+0x00000007,0x00040015,0x00000056,0x00000020,
+0x00000001,0x00040017,0x00000057,0x00000056,
+0x00000004,0x00040020,0x00000058,0x00000007,
+0x00000057,0x00040021,0x00000059,0x00000057,
+0x00000058,0x00040017,0x0000005d,0x00000056,
+0x00000003,0x00040020,0x0000005e,0x00000007,
+0x0000005d,0x00040021,0x0000005f,0x00000056,
+0x0000005e,0x00050021,0x00000063,0x00000002,
+0x00000058,0x00000058,0x00080021,0x00000068,
+0x00000002,0x00000058,0x00000058,0x00000007,
+0x00000012,0x00000012,0x00070021,0x00000070,
+0x00000006,0x00000012,0x00000007,0x00000007,
+0x00000009,0x00040021,0x00000077,0x00000011,
+0x00000007,0x00040021,0x0000007b,0x00000011,
+0x00000034,0x00040017,0x0000007f,0x00000056,
+0x00000002,0x00040021,0x00000080,0x0000007f,
+0x0000005e,0x00020014,0x00000084,0x00040020,
+0x00000085,0x00000006,0x00000084,0x0004003b,
+0x00000085,0x00000086,0x00000006,0x0003002a,
+0x00000084,0x00000087,0x0004002b,0x00000006,
+0x0000008e,0x00000008,0x0004002b,0x00000006,
+0x0000008f,0x00000007,0x0005002c,0x00000034,
+0x00000090,0x0000008e,0x0000008f,0x0004002b,
+0x00000006,0x00000092,0x00000004,0x0004002b,
+0x00000006,0x00000093,0x00000002,0x0005002c,
+0x00000034,0x00000094,0x00000092,0x00000093,
+0x0004002b,0x00000006,0x00000096,0x00000005,
+0x0004002b,0x00000006,0x00000097,0x00000003,
+0x0005002c,0x00000034,0x00000098,0x00000096,
+0x00000097,0x0004002b,0x00000006,0x0000009e,
+0x00000000,0x0004002b,0x00000006,0x000000a1,
+0x00000001,0x0004003b,0x00000085,0x000000a8,
+0x00000006,0x00040020,0x000000a9,0x00000006,
+0x00000011,0x0004003b,0x000000a9,0x000000aa,
+0x00000006,0x00040020,0x000000ab,0x00000006,
+0x00000006,0x0004002b,0x00000006,0x000000ae,
+0x000001ff,0x0004002b,0x00000006,0x000000b0,
+0x000001fc,0x0004002b,0x00000056,0x000000b9,
+0x00000000,0x0004002b,0x00000056,0x000000ba,
+0x00000002,0x0004002b,0x00000056,0x000000c3,
+0x00000004,0x0004002b,0x00000056,0x000000c4,
+0x00000001,0x0004002b,0x00000056,0x000000c9,
+0x00000005,0x0004002b,0x00000056,0x000000ce,
+0x00000007,0x0004002b,0x00000056,0x000000d3,
+0x00000009,0x0004003b,0x00000085,0x000000d5,
+0x00000006,0x0004002b,0x00000056,0x000000d8,
+0x0000000a,0x00040020,0x000000ea,0x00000006,
+0x00000034,0x0004003b,0x000000ea,0x000000eb,
+0x00000006,0x0004002b,0x00000006,0x000000ec,
+0x0000000c,0x0004002b,0x00000006,0x000000f6,
+0x00000006,0x0004002b,0x00000006,0x00000102,
+0x0000000a,0x0005002c,0x00000034,0x00000103,
+0x000000f6,0x00000102,0x0005002c,0x00000034,
+0x00000109,0x00000102,0x000000f6,0x00030029,
+0x00000084,0x0000010b,0x0005001e,0x0000013f,
+0x00000034,0x00000006,0x00000006,0x00040020,
+0x00000140,0x00000009,0x0000013f,0x0004003b,
+0x00000140,0x00000141,0x00000009,0x00040020,
+0x00000142,0x00000009,0x00000034,0x00040017,
+0x00000145,0x00000084,0x00000002,0x00040020,
+0x0000014b,0x00000006,0x00000008,0x0004003b,
+0x0000014b,0x0000014c,0x00000006,0x0004002b,
+0x00000006,0x0000014d,0x00000010,0x0004001c,
+0x0000014e,0x00000008,0x0000014d,0x0006002c,
+0x00000008,0x0000014f,0x0000009e,0x0000009e,
+0x0000009e,0x0006002c,0x00000008,0x00000150,
+0x0000009e,0x0000009e,0x000000a1,0x0006002c,
+0x00000008,0x00000151,0x000000a1,0x0000009e,
+0x0000009e,0x0006002c,0x00000008,0x00000152,
+0x0000009e,0x0000009e,0x00000093,0x0006002c,
+0x00000008,0x00000153,0x0000009e,0x000000a1,
+0x0000009e,0x0006002c,0x00000008,0x00000154,
+0x000000a1,0x0000009e,0x000000a1,0x0006002c,
+0x00000008,0x00000155,0x0000009e,0x0000009e,
+0x00000097,0x0006002c,0x00000008,0x00000156,
+0x0000009e,0x000000a1,0x000000a1,0x0006002c,
+0x00000008,0x00000157,0x000000a1,0x0000009e,
+0x00000093,0x0006002c,0x00000008,0x00000158,
+0x0000009e,0x0000009e,0x00000092,0x0006002c,
+0x00000008,0x00000159,0x0000009e,0x000000a1,
+0x00000093,0x0006002c,0x00000008,0x0000015a,
+0x000000a1,0x0000009e,0x00000097,0x0006002c,
+0x00000008,0x0000015b,0x0000009e,0x0000009e,
+0x00000096,0x0013002c,0x0000014e,0x0000015c,
+0x0000014f,0x0000014f,0x00000150,0x00000151,
+0x00000152,0x00000153,0x00000154,0x00000155,
+0x0000014f,0x0000014f,0x00000156,0x00000157,
+0x00000158,0x00000159,0x0000015a,0x0000015b,
+0x0004002b,0x00000056,0x0000015e,0x00000003,
+0x00040020,0x00000162,0x00000007,0x0000014e,
+0x0004003b,0x000000ab,0x00000166,0x00000006,
+0x0004003b,0x000000ab,0x0000016f,0x00000006,
+0x0004002b,0x00000006,0x00000176,0x00000018,
+0x0004002b,0x00000006,0x00000179,0x00000060,
+0x0004002b,0x00000006,0x0000017d,0x00000040,
+0x0004003b,0x000000ab,0x00000183,0x00000006,
+0x0004002b,0x00000056,0x00000186,0x0000000b,
+0x0004003b,0x000000ab,0x0000018d,0x00000006,
+0x0004002b,0x00000056,0x00000190,0x0000000d,
+0x0004002b,0x00000006,0x000001a0,0x00000020,
+0x0004002b,0x00000006,0x000001ac,0x0000001f,
+0x0004002b,0x00000006,0x000001dd,0x00000080,
+0x0004002b,0x00000056,0x000001ee,0x00000017,
+0x0004002b,0x00000056,0x000001f3,0x00000019,
+0x00040020,0x0000024c,0x00000007,0x00000056,
+0x0007002c,0x00000057,0x00000290,0x000000ba,
+0x000000c3,0x000000c9,0x000000ce,0x0004002b,
+0x00000006,0x00000297,0x00000100,0x0004001c,
+0x00000298,0x00000006,0x00000297,0x0004002b,
+0x00000006,0x00000299,0x00000021,0x0004002b,
+0x00000006,0x0000029a,0x00000009,0x0004002b,
+0x00000006,0x0000029b,0x00000022,0x0004002b,
+0x00000006,0x0000029c,0x00000028,0x0004002b,
+0x00000006,0x0000029d,0x00000029,0x0004002b,
+0x00000006,0x0000029e,0x0000002a,0x0004002b,
+0x00000006,0x0000029f,0x00000011,0x0004002b,
+0x00000006,0x000002a0,0x00000012,0x0004002b,
+0x00000006,0x000002a1,0x00000024,0x0004002b,
+0x00000006,0x000002a2,0x00000014,0x0004002b,
+0x00000006,0x000002a3,0x00000015,0x0004002b,
+0x00000006,0x000002a4,0x00000016,0x0004002b,
+0x00000006,0x000002a5,0x00000025,0x0004002b,
+0x00000006,0x000002a6,0x00000019,0x0004002b,
+0x00000006,0x000002a7,0x0000001a,0x0004002b,
+0x00000006,0x000002a8,0x00000026,0x0004002b,
+0x00000006,0x000002a9,0x00000280,0x0004002b,
+0x00000006,0x000002aa,0x00000281,0x0004002b,
+0x00000006,0x000002ab,0x00000282,0x0004002b,
+0x00000006,0x000002ac,0x000002a0,0x0004002b,
+0x00000006,0x000002ad,0x00000041,0x0004002b,
+0x00000006,0x000002ae,0x00000042,0x0004002b,
+0x00000006,0x000002af,0x00000044,0x0004002b,
+0x00000006,0x000002b0,0x00000045,0x0004002b,
+0x00000006,0x000002b1,0x00000046,0x0004002b,
+0x00000006,0x000002b2,0x00000061,0x0004002b,
+0x00000006,0x000002b3,0x00000048,0x0004002b,
+0x00000006,0x000002b4,0x00000049,0x0004002b,
+0x00000006,0x000002b5,0x0000004a,0x0004002b,
+0x00000006,0x000002b6,0x00000062,0x0004002b,
+0x00000006,0x000002b7,0x00000068,0x0004002b,
+0x00000006,0x000002b8,0x00000069,0x0004002b,
+0x00000006,0x000002b9,0x0000006a,0x0004002b,
+0x00000006,0x000002ba,0x00000050,0x0004002b,
+0x00000006,0x000002bb,0x00000051,0x0004002b,
+0x00000006,0x000002bc,0x00000052,0x0004002b,
+0x00000006,0x000002bd,0x00000064,0x0004002b,
+0x00000006,0x000002be,0x00000054,0x0004002b,
+0x00000006,0x000002bf,0x00000055,0x0004002b,
+0x00000006,0x000002c0,0x00000056,0x0004002b,
+0x00000006,0x000002c1,0x00000065,0x0004002b,
+0x00000006,0x000002c2,0x00000058,0x0004002b,
+0x00000006,0x000002c3,0x00000059,0x0004002b,
+0x00000006,0x000002c4,0x0000005a,0x0004002b,
+0x00000006,0x000002c5,0x00000066,0x0004002b,
+0x00000006,0x000002c6,0x00000284,0x0004002b,
+0x00000006,0x000002c7,0x00000285,0x0004002b,
+0x00000006,0x000002c8,0x00000286,0x0004002b,
+0x00000006,0x000002c9,0x000002a1,0x0004002b,
+0x00000006,0x000002ca,0x00000081,0x0004002b,
+0x00000006,0x000002cb,0x00000082,0x0004002b,
+0x00000006,0x000002cc,0x000000a0,0x0004002b,
+0x00000006,0x000002cd,0x00000084,0x0004002b,
+0x00000006,0x000002ce,0x00000085,0x0004002b,
+0x00000006,0x000002cf,0x00000086,0x0004002b,
+0x00000006,0x000002d0,0x000000a1,0x0004002b,
+0x00000006,0x000002d1,0x00000088,0x0004002b,
+0x00000006,0x000002d2,0x00000089,0x0004002b,
+0x00000006,0x000002d3,0x0000008a,0x0004002b,
+0x00000006,0x000002d4,0x000000a2,0x0004002b,
+0x00000006,0x000002d5,0x000000a8,0x0004002b,
+0x00000006,0x000002d6,0x000000a9,0x0004002b,
+0x00000006,0x000002d7,0x000000aa,0x0004002b,
+0x00000006,0x000002d8,0x00000090,0x0004002b,
+0x00000006,0x000002d9,0x00000091,0x0004002b,
+0x00000006,0x000002da,0x00000092,0x0004002b,
+0x00000006,0x000002db,0x000000a4,0x0004002b,
+0x00000006,0x000002dc,0x00000094,0x0004002b,
+0x00000006,0x000002dd,0x00000095,0x0004002b,
+0x00000006,0x000002de,0x00000096,0x0004002b,
+0x00000006,0x000002df,0x000000a5,0x0004002b,
+0x00000006,0x000002e0,0x00000098,0x0004002b,
+0x00000006,0x000002e1,0x00000099,0x0004002b,
+0x00000006,0x000002e2,0x0000009a,0x0004002b,
+0x00000006,0x000002e3,0x000000a6,0x0004002b,
+0x00000006,0x000002e4,0x00000288,0x0004002b,
+0x00000006,0x000002e5,0x00000289,0x0004002b,
+0x00000006,0x000002e6,0x0000028a,0x0004002b,
+0x00000006,0x000002e7,0x000002a2,0x0004002b,
+0x00000006,0x000002e8,0x00000200,0x0004002b,
+0x00000006,0x000002e9,0x00000201,0x0004002b,
+0x00000006,0x000002ea,0x00000202,0x0004002b,
+0x00000006,0x000002eb,0x00000220,0x0004002b,
+0x00000006,0x000002ec,0x00000204,0x0004002b,
+0x00000006,0x000002ed,0x00000205,0x0004002b,
+0x00000006,0x000002ee,0x00000206,0x0004002b,
+0x00000006,0x000002ef,0x00000221,0x0004002b,
+0x00000006,0x000002f0,0x00000208,0x0004002b,
+0x00000006,0x000002f1,0x00000209,0x0004002b,
+0x00000006,0x000002f2,0x0000020a,0x0004002b,
+0x00000006,0x000002f3,0x00000222,0x0004002b,
+0x00000006,0x000002f4,0x00000228,0x0004002b,
+0x00000006,0x000002f5,0x00000229,0x0004002b,
+0x00000006,0x000002f6,0x0000022a,0x0004002b,
+0x00000006,0x000002f7,0x00000210,0x0004002b,
+0x00000006,0x000002f8,0x00000211,0x0004002b,
+0x00000006,0x000002f9,0x00000212,0x0004002b,
+0x00000006,0x000002fa,0x00000224,0x0004002b,
+0x00000006,0x000002fb,0x00000214,0x0004002b,
+0x00000006,0x000002fc,0x00000215,0x0004002b,
+0x00000006,0x000002fd,0x00000216,0x0004002b,
+0x00000006,0x000002fe,0x00000225,0x0004002b,
+0x00000006,0x000002ff,0x00000218,0x0004002b,
+0x00000006,0x00000300,0x00000219,0x0004002b,
+0x00000006,0x00000301,0x0000021a,0x0004002b,
+0x00000006,0x00000302,0x00000226,0x0004002b,
+0x00000006,0x00000303,0x000002a8,0x0004002b,
+0x00000006,0x00000304,0x000002a9,0x0004002b,
+0x00000006,0x00000305,0x000002aa,0x0004002b,
+0x00000006,0x00000306,0x00000101,0x0004002b,
+0x00000006,0x00000307,0x00000102,0x0004002b,
+0x00000006,0x00000308,0x00000120,0x0004002b,
+0x00000006,0x00000309,0x00000104,0x0004002b,
+0x00000006,0x0000030a,0x00000105,0x0004002b,
+0x00000006,0x0000030b,0x00000106,0x0004002b,
+0x00000006,0x0000030c,0x00000121,0x0004002b,
+0x00000006,0x0000030d,0x00000108,0x0004002b,
+0x00000006,0x0000030e,0x00000109,0x0004002b,
+0x00000006,0x0000030f,0x0000010a,0x0004002b,
+0x00000006,0x00000310,0x00000122,0x0004002b,
+0x00000006,0x00000311,0x00000128,0x0004002b,
+0x00000006,0x00000312,0x00000129,0x0004002b,
+0x00000006,0x00000313,0x0000012a,0x0004002b,
+0x00000006,0x00000314,0x00000110,0x0004002b,
+0x00000006,0x00000315,0x00000111,0x0004002b,
+0x00000006,0x00000316,0x00000112,0x0004002b,
+0x00000006,0x00000317,0x00000124,0x0004002b,
+0x00000006,0x00000318,0x00000114,0x0004002b,
+0x00000006,0x00000319,0x00000115,0x0004002b,
+0x00000006,0x0000031a,0x00000116,0x0004002b,
+0x00000006,0x0000031b,0x00000125,0x0004002b,
+0x00000006,0x0000031c,0x00000118,0x0004002b,
+0x00000006,0x0000031d,0x00000119,0x0004002b,
+0x00000006,0x0000031e,0x0000011a,0x0004002b,
+0x00000006,0x0000031f,0x00000126,0x0004002b,
+0x00000006,0x00000320,0x00000290,0x0004002b,
+0x00000006,0x00000321,0x00000291,0x0004002b,
+0x00000006,0x00000322,0x00000292,0x0004002b,
+0x00000006,0x00000323,0x000002a4,0x0004002b,
+0x00000006,0x00000324,0x00000140,0x0004002b,
+0x00000006,0x00000325,0x00000141,0x0004002b,
+0x00000006,0x00000326,0x00000142,0x0004002b,
+0x00000006,0x00000327,0x00000160,0x0004002b,
+0x00000006,0x00000328,0x00000144,0x0004002b,
+0x00000006,0x00000329,0x00000145,0x0004002b,
+0x00000006,0x0000032a,0x00000146,0x0004002b,
+0x00000006,0x0000032b,0x00000161,0x0004002b,
+0x00000006,0x0000032c,0x00000148,0x0004002b,
+0x00000006,0x0000032d,0x00000149,0x0004002b,
+0x00000006,0x0000032e,0x0000014a,0x0004002b,
+0x00000006,0x0000032f,0x00000162,0x0004002b,
+0x00000006,0x00000330,0x00000168,0x0004002b,
+0x00000006,0x00000331,0x00000169,0x0004002b,
+0x00000006,0x00000332,0x0000016a,0x0004002b,
+0x00000006,0x00000333,0x00000150,0x0004002b,
+0x00000006,0x00000334,0x00000151,0x0004002b,
+0x00000006,0x00000335,0x00000152,0x0004002b,
+0x00000006,0x00000336,0x00000164,0x0004002b,
+0x00000006,0x00000337,0x00000154,0x0004002b,
+0x00000006,0x00000338,0x00000155,0x0004002b,
+0x00000006,0x00000339,0x00000156,0x0004002b,
+0x00000006,0x0000033a,0x00000165,0x0004002b,
+0x00000006,0x0000033b,0x00000158,0x0004002b,
+0x00000006,0x0000033c,0x00000159,0x0004002b,
+0x00000006,0x0000033d,0x0000015a,0x0004002b,
+0x00000006,0x0000033e,0x00000166,0x0004002b,
+0x00000006,0x0000033f,0x00000294,0x0004002b,
+0x00000006,0x00000340,0x00000295,0x0004002b,
+0x00000006,0x00000341,0x00000296,0x0004002b,
+0x00000006,0x00000342,0x000002a5,0x0004002b,
+0x00000006,0x00000343,0x00000180,0x0004002b,
+0x00000006,0x00000344,0x00000181,0x0004002b,
+0x00000006,0x00000345,0x00000182,0x0004002b,
+0x00000006,0x00000346,0x000001a0,0x0004002b,
+0x00000006,0x00000347,0x00000184,0x0004002b,
+0x00000006,0x00000348,0x00000185,0x0004002b,
+0x00000006,0x00000349,0x00000186,0x0004002b,
+0x00000006,0x0000034a,0x000001a1,0x0004002b,
+0x00000006,0x0000034b,0x00000188,0x0004002b,
+0x00000006,0x0000034c,0x00000189,0x0004002b,
+0x00000006,0x0000034d,0x0000018a,0x0004002b,
+0x00000006,0x0000034e,0x000001a2,0x0004002b,
+0x00000006,0x0000034f,0x000001a8,0x0004002b,
+0x00000006,0x00000350,0x000001a9,0x0004002b,
+0x00000006,0x00000351,0x000001aa,0x0004002b,
+0x00000006,0x00000352,0x00000190,0x0004002b,
+0x00000006,0x00000353,0x00000191,0x0004002b,
+0x00000006,0x00000354,0x00000192,0x0004002b,
+0x00000006,0x00000355,0x000001a4,0x0004002b,
+0x00000006,0x00000356,0x00000194,0x0004002b,
+0x00000006,0x00000357,0x00000195,0x0004002b,
+0x00000006,0x00000358,0x00000196,0x0004002b,
+0x00000006,0x00000359,0x000001a5,0x0004002b,
+0x00000006,0x0000035a,0x00000198,0x0004002b,
+0x00000006,0x0000035b,0x00000199,0x0004002b,
+0x00000006,0x0000035c,0x0000019a,0x0004002b,
+0x00000006,0x0000035d,0x000001a6,0x0004002b,
+0x00000006,0x0000035e,0x00000298,0x0004002b,
+0x00000006,0x0000035f,0x00000299,0x0004002b,
+0x00000006,0x00000360,0x0000029a,0x0004002b,
+0x00000006,0x00000361,0x000002a6,0x0004002b,
+0x00000006,0x00000362,0x00000240,0x0004002b,
+0x00000006,0x00000363,0x00000241,0x0004002b,
+0x00000006,0x00000364,0x00000242,0x0004002b,
+0x00000006,0x00000365,0x00000260,0x0004002b,
+0x00000006,0x00000366,0x00000244,0x0004002b,
+0x00000006,0x00000367,0x00000245,0x0004002b,
+0x00000006,0x00000368,0x00000246,0x0004002b,
+0x00000006,0x00000369,0x00000261,0x0004002b,
+0x00000006,0x0000036a,0x00000248,0x0004002b,
+0x00000006,0x0000036b,0x00000249,0x0004002b,
+0x00000006,0x0000036c,0x0000024a,0x0004002b,
+0x00000006,0x0000036d,0x00000262,0x0004002b,
+0x00000006,0x0000036e,0x00000268,0x0004002b,
+0x00000006,0x0000036f,0x00000269,0x0004002b,
+0x00000006,0x00000370,0x0000026a,0x0004002b,
+0x00000006,0x00000371,0x00000250,0x0004002b,
+0x00000006,0x00000372,0x00000251,0x0004002b,
+0x00000006,0x00000373,0x00000252,0x0004002b,
+0x00000006,0x00000374,0x00000264,0x0004002b,
+0x00000006,0x00000375,0x00000254,0x0004002b,
+0x00000006,0x00000376,0x00000255,0x0004002b,
+0x00000006,0x00000377,0x00000256,0x0004002b,
+0x00000006,0x00000378,0x00000265,0x0004002b,
+0x00000006,0x00000379,0x00000258,0x0004002b,
+0x00000006,0x0000037a,0x00000259,0x0004002b,
+0x00000006,0x0000037b,0x0000025a,0x0004002b,
+0x00000006,0x0000037c,0x00000266,0x0103002c,
+0x00000298,0x0000037d,0x0000009e,0x000000a1,
+0x00000093,0x000001a0,0x00000092,0x00000096,
+0x000000f6,0x00000299,0x0000008e,0x0000029a,
+0x00000102,0x0000029b,0x0000029c,0x0000029d,
+0x0000029e,0x0000029b,0x0000014d,0x0000029f,
+0x000002a0,0x000002a1,0x000002a2,0x000002a3,
+0x000002a4,0x000002a5,0x00000176,0x000002a6,
+0x000002a7,0x000002a8,0x000002a9,0x000002aa,
+0x000002ab,0x000002ac,0x0000017d,0x000002ad,
+0x000002ae,0x00000179,0x000002af,0x000002b0,
+0x000002b1,0x000002b2,0x000002b3,0x000002b4,
+0x000002b5,0x000002b6,0x000002b7,0x000002b8,
+0x000002b9,0x000002b6,0x000002ba,0x000002bb,
+0x000002bc,0x000002bd,0x000002be,0x000002bf,
+0x000002c0,0x000002c1,0x000002c2,0x000002c3,
+0x000002c4,0x000002c5,0x000002c6,0x000002c7,
+0x000002c8,0x000002c9,0x000001dd,0x000002ca,
+0x000002cb,0x000002cc,0x000002cd,0x000002ce,
+0x000002cf,0x000002d0,0x000002d1,0x000002d2,
+0x000002d3,0x000002d4,0x000002d5,0x000002d6,
+0x000002d7,0x000002d4,0x000002d8,0x000002d9,
+0x000002da,0x000002db,0x000002dc,0x000002dd,
+0x000002de,0x000002df,0x000002e0,0x000002e1,
+0x000002e2,0x000002e3,0x000002e4,0x000002e5,
+0x000002e6,0x000002e7,0x000002e8,0x000002e9,
+0x000002ea,0x000002eb,0x000002ec,0x000002ed,
+0x000002ee,0x000002ef,0x000002f0,0x000002f1,
+0x000002f2,0x000002f3,0x000002f4,0x000002f5,
+0x000002f6,0x000002f3,0x000002f7,0x000002f8,
+0x000002f9,0x000002fa,0x000002fb,0x000002fc,
+0x000002fd,0x000002fe,0x000002ff,0x00000300,
+0x00000301,0x00000302,0x00000303,0x00000304,
+0x00000305,0x000002e7,0x00000297,0x00000306,
+0x00000307,0x00000308,0x00000309,0x0000030a,
+0x0000030b,0x0000030c,0x0000030d,0x0000030e,
+0x0000030f,0x00000310,0x00000311,0x00000312,
+0x00000313,0x00000310,0x00000314,0x00000315,
+0x00000316,0x00000317,0x00000318,0x00000319,
+0x0000031a,0x0000031b,0x0000031c,0x0000031d,
+0x0000031e,0x0000031f,0x00000320,0x00000321,
+0x00000322,0x00000323,0x00000324,0x00000325,
+0x00000326,0x00000327,0x00000328,0x00000329,
+0x0000032a,0x0000032b,0x0000032c,0x0000032d,
+0x0000032e,0x0000032f,0x00000330,0x00000331,
+0x00000332,0x0000032f,0x00000333,0x00000334,
+0x00000335,0x00000336,0x00000337,0x00000338,
+0x00000339,0x0000033a,0x0000033b,0x0000033c,
+0x0000033d,0x0000033e,0x0000033f,0x00000340,
+0x00000341,0x00000342,0x00000343,0x00000344,
+0x00000345,0x00000346,0x00000347,0x00000348,
+0x00000349,0x0000034a,0x0000034b,0x0000034c,
+0x0000034d,0x0000034e,0x0000034f,0x00000350,
+0x00000351,0x0000034e,0x00000352,0x00000353,
+0x00000354,0x00000355,0x00000356,0x00000357,
+0x00000358,0x00000359,0x0000035a,0x0000035b,
+0x0000035c,0x0000035d,0x0000035e,0x0000035f,
+0x00000360,0x00000361,0x00000362,0x00000363,
+0x00000364,0x00000365,0x00000366,0x00000367,
+0x00000368,0x00000369,0x0000036a,0x0000036b,
+0x0000036c,0x0000036d,0x0000036e,0x0000036f,
+0x00000370,0x0000036d,0x00000371,0x00000372,
+0x00000373,0x00000374,0x00000375,0x00000376,
+0x00000377,0x00000378,0x00000379,0x0000037a,
+0x0000037b,0x0000037c,0x00000303,0x00000304,
+0x00000305,0x00000361,0x00040020,0x0000037f,
+0x00000007,0x00000298,0x0006002c,0x0000005d,
+0x000003b3,0x000000b9,0x0000015e,0x000000c9,
+0x0004001c,0x000003ba,0x00000006,0x000001dd,
+0x0004002b,0x00000006,0x000003bb,0x0000000b,
+0x0004002b,0x00000006,0x000003bc,0x00000013,
+0x0004002b,0x00000006,0x000003bd,0x0000001b,
+0x0004002b,0x00000006,0x000003be,0x0000001c,
+0x0004002b,0x00000006,0x000003bf,0x00000023,
+0x0004002b,0x00000006,0x000003c0,0x000000e4,
+0x0004002b,0x00000006,0x000003c1,0x00000043,
+0x0004002b,0x00000006,0x000003c2,0x0000004b,
+0x0004002b,0x00000006,0x000003c3,0x0000004c,
+0x0004002b,0x00000006,0x000003c4,0x0000010c,
+0x0004002b,0x00000006,0x000003c5,0x00000053,
+0x0004002b,0x00000006,0x000003c6,0x0000005b,
+0x0004002b,0x00000006,0x000003c7,0x0000005c,
+0x0004002b,0x00000006,0x000003c8,0x00000063,
+0x0004002b,0x00000006,0x000003c9,0x0000011c,
+0x0004002b,0x00000006,0x000003ca,0x00000123,
+0x0004002b,0x00000006,0x000003cb,0x00000083,
+0x0004002b,0x00000006,0x000003cc,0x00000103,
+0x0004002b,0x00000006,0x000003cd,0x0000008b,
+0x0004002b,0x00000006,0x000003ce,0x0000008c,
+0x0004002b,0x00000006,0x000003cf,0x0000010b,
+0x0004002b,0x00000006,0x000003d0,0x00000093,
+0x0004002b,0x00000006,0x000003d1,0x00000113,
+0x0004002b,0x00000006,0x000003d2,0x0000009b,
+0x0004002b,0x00000006,0x000003d3,0x0000009c,
+0x0004002b,0x00000006,0x000003d4,0x000000a3,
+0x0004002b,0x00000006,0x000003d5,0x0000011b,
+0x0004002b,0x00000006,0x000003d6,0x000000c0,
+0x0004002b,0x00000006,0x000003d7,0x000000c1,
+0x0004002b,0x00000006,0x000003d8,0x000000c2,
+0x0004002b,0x00000006,0x000003d9,0x000000c3,
+0x0004002b,0x00000006,0x000003da,0x000000c4,
+0x0004002b,0x00000006,0x000003db,0x000000e0,
+0x0004002b,0x00000006,0x000003dc,0x000000c8,
+0x0004002b,0x00000006,0x000003dd,0x000000c9,
+0x0004002b,0x00000006,0x000003de,0x000000ca,
+0x0004002b,0x00000006,0x000003df,0x000000cb,
+0x0004002b,0x00000006,0x000003e0,0x000000cc,
+0x0004002b,0x00000006,0x000003e1,0x000000e1,
+0x0004002b,0x00000006,0x000003e2,0x000000d0,
+0x0004002b,0x00000006,0x000003e3,0x000000d1,
+0x0004002b,0x00000006,0x000003e4,0x000000d2,
+0x0004002b,0x00000006,0x000003e5,0x000000d3,
+0x0004002b,0x00000006,0x000003e6,0x000000d4,
+0x0004002b,0x00000006,0x000003e7,0x000000e2,
+0x0004002b,0x00000006,0x000003e8,0x000000d8,
+0x0004002b,0x00000006,0x000003e9,0x000000d9,
+0x0004002b,0x00000006,0x000003ea,0x000000da,
+0x0004002b,0x00000006,0x000003eb,0x000000db,
+0x0004002b,0x00000006,0x000003ec,0x000000dc,
+0x0004002b,0x00000006,0x000003ed,0x000000e3,
+0x0083002c,0x000003ba,0x000003ee,0x0000009e,
+0x000000a1,0x00000093,0x00000097,0x00000092,
+0x000001a0,0x000002a1,0x00000317,0x0000008e,
+0x0000029a,0x00000102,0x000003bb,0x000000ec,
+0x00000299,0x000002bd,0x00000317,0x0000014d,
+0x0000029f,0x000002a0,0x000003bc,0x000002a2,
+0x0000029b,0x000002db,0x00000317,0x00000176,
+0x000002a6,0x000002a7,0x000003bd,0x000003be,
+0x000003bf,0x000003c0,0x00000317,0x0000017d,
+0x000002ad,0x000002ae,0x000003c1,0x000002af,
+0x00000179,0x00000309,0x00000308,0x000002b3,
+0x000002b4,0x000002b5,0x000003c2,0x000003c3,
+0x000002b2,0x000003c4,0x0000030c,0x000002ba,
+0x000002bb,0x000002bc,0x000003c5,0x000002be,
+0x000002b6,0x00000318,0x00000310,0x000002c2,
+0x000002c3,0x000002c4,0x000003c6,0x000003c7,
+0x000003c8,0x000003c9,0x000003ca,0x000001dd,
+0x000002ca,0x000002cb,0x000003cb,0x000002cd,
+0x000002cc,0x00000307,0x000003cc,0x000002d1,
+0x000002d2,0x000002d3,0x000003cd,0x000003ce,
+0x000002d0,0x0000030f,0x000003cf,0x000002d8,
+0x000002d9,0x000002da,0x000003d0,0x000002dc,
+0x000002d4,0x00000316,0x000003d1,0x000002e0,
+0x000002e1,0x000002e2,0x000003d2,0x000003d3,
+0x000003d4,0x0000031e,0x000003d5,0x000003d6,
+0x000003d7,0x000003d8,0x000003d9,0x000003da,
+0x000003db,0x00000297,0x00000306,0x000003dc,
+0x000003dd,0x000003de,0x000003df,0x000003e0,
+0x000003e1,0x0000030d,0x0000030e,0x000003e2,
+0x000003e3,0x000003e4,0x000003e5,0x000003e6,
+0x000003e7,0x00000314,0x00000315,0x000003e8,
+0x000003e9,0x000003ea,0x000003eb,0x000003ec,
+0x000003ed,0x0000031c,0x0000031d,0x00040020,
+0x000003f0,0x00000007,0x000003ba,0x0004002b,
+0x00000006,0x0000041f,0x0000002d,0x0004001c,
+0x00000420,0x00000006,0x0000041f,0x0004002b,
+0x00000006,0x00000421,0x00000034,0x0004002b,
+0x00000006,0x00000422,0x00000027,0x0004002b,
+0x00000006,0x00000423,0x0000002f,0x0004002b,
+0x00000006,0x00000424,0x0000003b,0x0004002b,
+0x00000006,0x00000425,0x00000017,0x0004002b,
+0x00000006,0x00000426,0x00000035,0x0004002b,
+0x00000006,0x00000427,0x00000038,0x0004002b,
+0x00000006,0x00000428,0x00000030,0x0004002b,
+0x00000006,0x00000429,0x0000003e,0x0004002b,
+0x00000006,0x0000042a,0x0000000d,0x0004002b,
+0x00000006,0x0000042b,0x00000033,0x0004002b,
+0x00000006,0x0000042c,0x0000001e,0x0030002c,
+0x00000420,0x0000042d,0x0000009e,0x000001a0,
+0x0000017d,0x0000009e,0x0000017d,0x000000ec,
+0x00000421,0x000002a6,0x00000422,0x0000009e,
+0x0000017d,0x0000029f,0x00000423,0x00000096,
+0x00000424,0x00000425,0x0000029d,0x000003bb,
+0x00000426,0x000003be,0x000002a1,0x0000009e,
+0x0000017d,0x0000008e,0x00000427,0x0000014d,
+0x00000428,0x00000176,0x0000029c,0x00000093,
+0x00000429,0x000003bb,0x00000426,0x000003bc,
+0x0000041f,0x000003bd,0x000002a5,0x00000096,
+0x00000424,0x0000042a,0x0000042b,0x000002a4,
+0x0000029e,0x0000042c,0x0000029b,0x00040020,
+0x00000435,0x00000007,0x00000420,0x0004001c,
+0x00000452,0x00000006,0x000003bf,0x0004002b,
+0x00000006,0x00000453,0x00000039,0x0004002b,
+0x00000006,0x00000454,0x0000000e,0x0004002b,
+0x00000006,0x00000455,0x00000032,0x0004002b,
+0x00000006,0x00000456,0x0000002b,0x0004002b,
+0x00000006,0x00000457,0x0000003d,0x0004002b,
+0x00000006,0x00000458,0x0000003a,0x0004002b,
+0x00000006,0x00000459,0x00000037,0x0004002b,
+0x00000006,0x0000045a,0x0000001d,0x0026002c,
+0x00000452,0x0000045b,0x0000009e,0x0000014d,
+0x000001a0,0x00000428,0x0000017d,0x0000009e,
+0x0000017d,0x0000008f,0x00000453,0x00000454,
+0x00000455,0x000002a3,0x00000456,0x000003be,
+0x000002a1,0x0000009e,0x0000017d,0x0000014d,
+0x00000428,0x00000097,0x00000457,0x000003bc,
+0x0000041f,0x000000f6,0x00000458,0x00000425,
+0x0000029d,0x0000029a,0x00000459,0x000002a7,
+0x000002a8,0x0000042a,0x0000042b,0x0000045a,
+0x000003bf,0x00040020,0x00000463,0x00000007,
+0x00000452,0x0004001c,0x00000476,0x00000034,
+0x000000f6,0x0004002b,0x00000006,0x00000477,
+0x0000003f,0x0005002c,0x00000034,0x00000478,
+0x00000477,0x0000008e,0x0005002c,0x00000034,
+0x00000479,0x000002a3,0x0000008e,0x0005002c,
+0x00000034,0x0000047a,0x0000029a,0x0000008e,
+0x0005002c,0x00000034,0x0000047b,0x00000093,
+0x00000092,0x0005002c,0x00000034,0x0000047c,
+0x000000a1,0x0000008e,0x0009002c,0x00000476,
+0x0000047d,0x00000478,0x00000479,0x0000047a,
+0x00000094,0x0000047b,0x0000047c,0x00040020,
+0x00000480,0x00000007,0x00000476,0x00030016,
+0x000004ea,0x00000020,0x00040017,0x000004eb,
+0x000004ea,0x00000004,0x0004002b,0x000004ea,
+0x000004f0,0x41000000,0x0004002b,0x00000006,
+0x000004f7,0x00000400,0x0004002b,0x00000056,
+0x0000050e,0x00000006,0x0004002b,0x00000006,
+0x00000517,0x0000000f,0x0005002c,0x00000034,
+0x00000526,0x0000009e,0x0000009e,0x0004002b,
+0x00000056,0x00000552,0x0000000f,0x0004002b,
+0x00000056,0x00000557,0x00000011,0x0004002b,
+0x00000056,0x00000568,0x00000010,0x00040020,
+0x00000584,0x00000009,0x00000006,0x0004002b,
+0x00000056,0x0000059c,0x00000008,0x0004002b,
+0x00000056,0x0000059f,0x0000000c,0x0004002b,
+0x00000056,0x000005a6,0x00000014,0x0004002b,
+0x00000056,0x000005a9,0x00000018,0x0004002b,
+0x00000056,0x000005ac,0x0000001c,0x00040017,
+0x000005d6,0x000004ea,0x00000002,0x0007002c,
+0x00000011,0x000005f4,0x00000454,0x00000102,
+0x000000f6,0x00000093,0x0007002c,0x00000011,
+0x000005f7,0x00000477,0x00000477,0x00000477,
+0x00000477,0x00040017,0x0000060d,0x00000084,
+0x00000003,0x0004001c,0x00000633,0x00000008,
+0x000003bc,0x0006002c,0x00000008,0x00000634,
+0x0000009e,0x0000009e,0x0000008e,0x0006002c,
+0x00000008,0x00000635,0x000000a1,0x0000009e,
+0x000000f6,0x0006002c,0x00000008,0x00000636,
+0x0000009e,0x000000a1,0x00000096,0x0006002c,
+0x00000008,0x00000637,0x0000009e,0x0000009e,
+0x0000008f,0x0006002c,0x00000008,0x00000638,
+0x000000a1,0x0000009e,0x00000096,0x0006002c,
+0x00000008,0x00000639,0x0000009e,0x000000a1,
+0x00000092,0x0006002c,0x00000008,0x0000063a,
+0x0000009e,0x0000009e,0x000000f6,0x0006002c,
+0x00000008,0x0000063b,0x000000a1,0x0000009e,
+0x00000092,0x0006002c,0x00000008,0x0000063c,
+0x0000009e,0x000000a1,0x00000097,0x0016002c,
+0x00000633,0x0000063d,0x00000634,0x00000635,
+0x00000636,0x00000637,0x00000638,0x00000639,
+0x0000063a,0x0000063b,0x0000063c,0x0000015b,
+0x0000015a,0x00000159,0x00000158,0x00000157,
+0x00000156,0x00000155,0x00000154,0x00000152,
+0x00000150,0x00040020,0x0000063f,0x00000007,
+0x00000633,0x0004002b,0x00000056,0x00000674,
+0x00000080,0x0004002b,0x00000056,0x0000067c,
+0x0000003f,0x0004002b,0x00000006,0x00000692,
+0x000000ff,0x0004002b,0x00000056,0x000006a5,
+0x000000c0,0x0004002b,0x00000056,0x000006ae,
+0x000000ff,0x0004002b,0x00000056,0x0000072f,
+0xffffff80,0x0007002c,0x00000011,0x0000075d,
+0x0000009e,0x0000009e,0x0000009e,0x0000009e,
+0x0004002b,0x00000006,0x0000077b,0x0000017d,
+0x0004001c,0x0000077c,0x00000006,0x0000077b,
+0x0004002b,0x00000006,0x0000077d,0x000000ba,
+0x0004002b,0x00000006,0x0000077e,0x000000e8,
+0x0004002b,0x00000006,0x0000077f,0x0000002e,
+0x0004002b,0x00000006,0x00000780,0x00000074,
+0x0004002b,0x00000006,0x00000781,0x000000de,
+0x0004002b,0x00000006,0x00000782,0x000000bd,
+0x0004002b,0x00000006,0x00000783,0x000000f4,
+0x0004002b,0x00000006,0x00000784,0x0000002c,
+0x0004002b,0x00000006,0x00000785,0x0000004d,
+0x0004002b,0x00000006,0x00000786,0x000000b2,
+0x0004002b,0x00000006,0x00000787,0x0000006e,
+0x0004002b,0x00000006,0x00000788,0x000000e9,
+0x0004002b,0x00000006,0x00000789,0x000000a7,
+0x0004002b,0x00000006,0x0000078a,0x00000079,
+0x0004002b,0x00000006,0x0000078b,0x000000ef,
+0x0004002b,0x00000006,0x0000078c,0x000000df,
+0x0004002b,0x00000006,0x0000078d,0x000000cf,
+0x0004002b,0x00000006,0x0000078e,0x000000be,
+0x0004002b,0x00000006,0x0000078f,0x000000ae,
+0x0004002b,0x00000006,0x00000790,0x0000009e,
+0x0004002b,0x00000006,0x00000791,0x00000071,
+0x0004002b,0x00000006,0x00000792,0x0000008e,
+0x0004002b,0x00000006,0x00000793,0x000000fa,
+0x0004002b,0x00000006,0x00000794,0x000000ea,
+0x0004002b,0x00000006,0x00000795,0x00000036,
+0x0004002b,0x00000006,0x00000796,0x000000b9,
+0x0004002b,0x00000006,0x00000797,0x00000067,
+0x0004002b,0x00000006,0x00000798,0x00000077,
+0x0004002b,0x00000006,0x00000799,0x000000b3,
+0x0004002b,0x00000006,0x0000079a,0x0000006c,
+0x0004002b,0x00000006,0x0000079b,0x0000007c,
+0x0004002b,0x00000006,0x0000079c,0x000000f7,
+0x0004002b,0x00000006,0x0000079d,0x000000e7,
+0x0004002b,0x00000006,0x0000079e,0x000000d7,
+0x0004002b,0x00000006,0x0000079f,0x000000c7,
+0x0004002b,0x00000006,0x000007a0,0x000000bf,
+0x0004002b,0x00000006,0x000007a1,0x000000b7,
+0x0004002b,0x00000006,0x000007a2,0x000000af,
+0x0004002b,0x00000006,0x000007a3,0x0000009f,
+0x0004002b,0x00000006,0x000007a4,0x00000097,
+0x0004002b,0x00000006,0x000007a5,0x00000070,
+0x0004002b,0x00000006,0x000007a6,0x0000008f,
+0x0004002b,0x00000006,0x000007a7,0x00000078,
+0x0004002b,0x00000006,0x000007a8,0x00000087,
+0x0004002b,0x00000006,0x000007a9,0x000000fd,
+0x0004002b,0x00000006,0x000007aa,0x000000f5,
+0x0004002b,0x00000006,0x000007ab,0x000000ed,
+0x0004002b,0x00000006,0x000007ac,0x000000e5,
+0x0004002b,0x00000006,0x000007ad,0x000000bc,
+0x0004002b,0x00000006,0x000007ae,0x000000b4,
+0x0004002b,0x00000006,0x000007af,0x000000ac,
+0x0004002b,0x00000006,0x000007b0,0x0000006b,
+0x0004002b,0x00000006,0x000007b1,0x00000073,
+0x0004002b,0x00000006,0x000007b2,0x0000007b,
+0x0004002b,0x00000006,0x000007b3,0x000000f2,
+0x0004002b,0x00000006,0x000007b4,0x0000004e,
+0x0004002b,0x00000006,0x000007b5,0x000000b1,
+0x0004002b,0x00000006,0x000007b6,0x0000005e,
+0x0004002b,0x00000006,0x000007b7,0x00000076,
+0x0004002b,0x00000006,0x000007b8,0x0000007e,
+0x0004002b,0x00000006,0x000007b9,0x000000fb,
+0x0004002b,0x00000006,0x000007ba,0x000000f3,
+0x0004002b,0x00000006,0x000007bb,0x000000eb,
+0x0004002b,0x00000006,0x000007bc,0x0000003c,
+0x0004002b,0x00000006,0x000007bd,0x000000bb,
+0x0004002b,0x00000006,0x000007be,0x000000ab,
+0x0004002b,0x00000006,0x000007bf,0x000000fe,
+0x0004002b,0x00000006,0x000007c0,0x000000f6,
+0x0004002b,0x00000006,0x000007c1,0x000000ee,
+0x0004002b,0x00000006,0x000007c2,0x000000e6,
+0x0004002b,0x00000006,0x000007c3,0x000000d6,
+0x0004002b,0x00000006,0x000007c4,0x00000031,
+0x0004002b,0x00000006,0x000007c5,0x000000ce,
+0x0004002b,0x00000006,0x000007c6,0x000000c6,
+0x0004002b,0x00000006,0x000007c7,0x000000b6,
+0x0004002b,0x00000006,0x000007c8,0x0000005d,
+0x0004002b,0x00000006,0x000007c9,0x0000006d,
+0x0004002b,0x00000006,0x000007ca,0x00000075,
+0x0004002b,0x00000006,0x000007cb,0x0000007d,
+0x0004002b,0x00000006,0x000007cc,0x000000f9,
+0x0004002b,0x00000006,0x000007cd,0x000000f1,
+0x0004002b,0x00000006,0x000007ce,0x000000dd,
+0x0004002b,0x00000006,0x000007cf,0x000000d5,
+0x0004002b,0x00000006,0x000007d0,0x000000cd,
+0x0004002b,0x00000006,0x000007d1,0x000000c5,
+0x0004002b,0x00000006,0x000007d2,0x000000b5,
+0x0004002b,0x00000006,0x000007d3,0x000000ad,
+0x0004002b,0x00000006,0x000007d4,0x0000009d,
+0x0004002b,0x00000006,0x000007d5,0x00000072,
+0x0004002b,0x00000006,0x000007d6,0x0000008d,
+0x0004002b,0x00000006,0x000007d7,0x0000007a,
+0x0180002c,0x0000077c,0x000007d8,0x0000009e,
+0x0000009e,0x0000009e,0x0000009e,0x00000692,
+0x0000042b,0x000003e0,0x000002c5,0x000002e1,
+0x0000009e,0x00000692,0x000002b0,0x0000077d,
+0x00000425,0x0000077e,0x000003c7,0x000003d4,
+0x0000077f,0x000003e3,0x00000780,0x000003cd,
+0x0000009e,0x00000692,0x00000299,0x00000781,
+0x000002ae,0x00000782,0x000003c8,0x000003d3,
+0x000003bb,0x00000783,0x00000784,0x000003e5,
+0x00000785,0x00000786,0x00000787,0x000002d9,
+0x000002a4,0x00000788,0x00000459,0x000003dc,
+0x000002c2,0x00000789,0x0000078a,0x000002cf,
+0x0000009e,0x00000692,0x0000014d,0x0000078b,
+0x000001a0,0x0000078c,0x00000428,0x0000078d,
+0x000002ad,0x0000078e,0x000002bb,0x0000078f,
+0x000002b2,0x00000790,0x00000791,0x00000792,
+0x00000096,0x00000793,0x000002a3,0x00000794,
+0x000002a8,0x000003e9,0x00000795,0x000003dd,
+0x000002b1,0x00000796,0x000002c0,0x000002d6,
+0x00000797,0x000002e0,0x00000798,0x000002d1,
+0x000003bb,0x00000783,0x000003bd,0x000003c0,
+0x00000456,0x000003e6,0x00000424,0x000003da,
+0x000003c3,0x00000799,0x000003c7,0x000003d4,
+0x0000079a,0x000003d0,0x0000079b,0x000003cb,
+0x0000009e,0x00000692,0x0000008e,0x0000079c,
+0x0000014d,0x0000078b,0x00000176,0x0000079d,
+0x000001a0,0x0000078c,0x0000029c,0x0000079e,
+0x00000428,0x0000078d,0x00000427,0x0000079f,
+0x0000017d,0x000007a0,0x000002b3,0x000007a1,
+0x000002ba,0x000007a2,0x000002c2,0x00000789,
+0x00000179,0x000007a3,0x000002b7,0x000007a4,
+0x000007a5,0x000007a6,0x000007a7,0x000007a8,
+0x00000093,0x000007a9,0x00000102,0x000007aa,
+0x000002a0,0x000007ab,0x000002a7,0x000007ac,
+0x000003bf,0x000003ec,0x00000456,0x000003e6,
+0x0000042b,0x000003e0,0x00000424,0x000003da,
+0x000003c1,0x000007ad,0x000003c2,0x000007ae,
+0x000003c5,0x000007af,0x000003c6,0x000002db,
+0x000003c8,0x000003d3,0x000007b0,0x000002dc,
+0x000007b1,0x000003ce,0x000007b2,0x000002cd,
+0x00000096,0x00000793,0x0000042a,0x000007b3,
+0x000002a3,0x00000794,0x0000045a,0x000003e7,
+0x000002a5,0x000003ea,0x0000041f,0x000003e4,
+0x00000426,0x000003de,0x00000457,0x000003d8,
+0x000002b1,0x00000796,0x000007b4,0x000007b5,
+0x000002c0,0x000002d6,0x000007b6,0x000002d0,
+0x000002c5,0x000002e1,0x00000787,0x000002d9,
+0x000007b7,0x000002d2,0x000007b8,0x000002ca,
+0x0000009e,0x00000692,0x00000092,0x000007b9,
+0x0000008e,0x0000079c,0x000000ec,0x000007ba,
+0x0000014d,0x0000078b,0x000002a2,0x000007bb,
+0x00000176,0x0000079d,0x000003be,0x000003ed,
+0x000001a0,0x0000078c,0x000002a1,0x000003eb,
+0x0000029c,0x0000079e,0x00000784,0x000003e5,
+0x00000428,0x0000078d,0x00000421,0x000003df,
+0x00000427,0x0000079f,0x000007bc,0x000003d9,
+0x0000017d,0x000007a0,0x000002af,0x000007bd,
+0x000002b3,0x000007a1,0x000003c3,0x00000799,
+0x000002ba,0x000007a2,0x000002be,0x000007be,
+0x000002c2,0x00000789,0x000003c7,0x000003d4,
+0x00000179,0x000007a3,0x000002bd,0x000003d2,
+0x000002b7,0x000007a4,0x0000079a,0x000003d0,
+0x000007a5,0x000007a6,0x00000780,0x000003cd,
+0x000007a7,0x000007a8,0x0000079b,0x000003cb,
+0x000000a1,0x000007bf,0x00000096,0x00000793,
+0x0000029a,0x000007c0,0x0000042a,0x000007b3,
+0x0000029f,0x000007c1,0x000002a3,0x00000794,
+0x000002a6,0x000007c2,0x0000045a,0x000003e7,
+0x00000299,0x00000781,0x000002a5,0x000003ea,
+0x0000029d,0x000007c3,0x0000041f,0x000003e4,
+0x000007c4,0x000007c5,0x00000426,0x000003de,
+0x00000453,0x000007c6,0x00000457,0x000003d8,
+0x000002ad,0x0000078e,0x000002b0,0x0000077d,
+0x000002b4,0x000007c7,0x00000785,0x00000786,
+0x000002bb,0x0000078f,0x000002bf,0x000002d7,
+0x000002c3,0x000002e3,0x000007c8,0x000002d4,
+0x000002b2,0x00000790,0x000002c1,0x000002e2,
+0x000002b8,0x000002de,0x000007c9,0x000002da,
+0x00000791,0x00000792,0x000007ca,0x000002d3,
+0x0000078a,0x000002cf,0x000007cb,0x000002cb,
+0x00000093,0x000007a9,0x000000f6,0x000007cc,
+0x00000102,0x000007aa,0x00000454,0x000007cd,
+0x000002a0,0x000007ab,0x000002a4,0x00000788,
+0x000002a7,0x000007ac,0x0000042c,0x000003e1,
+0x0000029b,0x000007ce,0x000002a8,0x000003e9,
+0x0000029e,0x000007cf,0x0000077f,0x000003e3,
+0x00000455,0x000007d0,0x00000795,0x000003dd,
+0x00000458,0x000007d1,0x00000429,0x000003d7,
+0x000002ae,0x00000782,0x000002b1,0x00000796,
+0x000002b5,0x000007d2,0x000007b4,0x000007b5,
+0x000002bc,0x000007d3,0x000002c0,0x000002d6,
+0x000002c4,0x000002df,0x000007b6,0x000002d0,
+0x000002b6,0x000007d4,0x000002c5,0x000002e1,
+0x000002b9,0x000002dd,0x00000787,0x000002d9,
+0x000007d5,0x000007d6,0x000007b7,0x000002d2,
+0x000007d7,0x000002ce,0x000007b8,0x000002ca,
+0x00040020,0x000007e0,0x00000007,0x0000077c,
+0x0004002b,0x00000006,0x000007ff,0x0000013b,
+0x0004001c,0x00000800,0x00000006,0x000007ff,
+0x0004002b,0x00000006,0x00000801,0x00000047,
+0x0004002b,0x00000006,0x00000802,0x000000b8,
+0x0004002b,0x00000006,0x00000803,0x000000ec,
+0x0004002b,0x00000006,0x00000804,0x000000fc,
+0x0004002b,0x00000006,0x00000805,0x00000057,
+0x013e002c,0x00000800,0x00000806,0x0000009e,
+0x0000009e,0x0000009e,0x0000009e,0x0000009e,
+0x0000009e,0x00000692,0x000003be,0x000003ed,
+0x00000427,0x0000079f,0x000002be,0x000007be,
+0x00000791,0x00000792,0x0000009e,0x00000692,
+0x000003c1,0x000007ad,0x0000042a,0x000007b3,
+0x000002ba,0x000007a2,0x000003bd,0x000003c0,
+0x000007b6,0x000002d0,0x0000029c,0x0000079e,
+0x000007b0,0x000002dc,0x00000795,0x000003dd,
+0x0000078a,0x000002cf,0x0000009e,0x00000692,
+0x000001a0,0x0000078c,0x000002ad,0x0000078e,
+0x000002b2,0x00000790,0x000000f6,0x000007cc,
+0x00000422,0x000003e8,0x00000801,0x00000802,
+0x000002b7,0x000007a4,0x0000042a,0x000007b3,
+0x0000041f,0x000003e4,0x000007b4,0x000007b5,
+0x00000787,0x000002d9,0x000003bc,0x00000803,
+0x00000421,0x000003df,0x000002be,0x000007be,
+0x000007ca,0x000002d3,0x000002a7,0x000007ac,
+0x00000458,0x000007d1,0x000003c6,0x000002db,
+0x000007b2,0x000002cd,0x0000009e,0x00000692,
+0x0000014d,0x0000078b,0x000001a0,0x0000078c,
+0x00000428,0x0000078d,0x0000017d,0x000007a0,
+0x000002ba,0x000007a2,0x00000179,0x000007a3,
+0x000007a5,0x000007a6,0x00000097,0x00000804,
+0x000003bc,0x00000803,0x000003bf,0x000003ec,
+0x0000042b,0x000003e0,0x000003c1,0x000007ad,
+0x000003c5,0x000007af,0x000002bd,0x000003d2,
+0x00000780,0x000003cd,0x000000f6,0x000007cc,
+0x000002a4,0x00000788,0x000002a8,0x000003e9,
+0x00000795,0x000003dd,0x00000801,0x00000802,
+0x00000805,0x000002d5,0x00000797,0x000002e0,
+0x00000798,0x000002d1,0x0000029a,0x000007c0,
+0x000002a6,0x000007c2,0x0000029e,0x000007cf,
+0x00000458,0x000007d1,0x000002b5,0x000007d2,
+0x000002c4,0x000002df,0x000002b9,0x000002dd,
+0x000007d7,0x000002ce,0x0000042a,0x000007b3,
+0x0000045a,0x000003e7,0x0000041f,0x000003e4,
+0x00000457,0x000003d8,0x00000785,0x00000786,
+0x000007c8,0x000002d4,0x000007c9,0x000002da,
+0x000007cb,0x000002cb,0x0000009e,0x00000692,
+0x0000008e,0x0000079c,0x0000014d,0x0000078b,
+0x00000176,0x0000079d,0x000001a0,0x0000078c,
+0x0000029c,0x0000079e,0x00000428,0x0000078d,
+0x00000427,0x0000079f,0x0000017d,0x000007a0,
+0x000002b3,0x000007a1,0x000002ba,0x000007a2,
+0x000002c2,0x00000789,0x00000179,0x000007a3,
+0x000002b7,0x000007a4,0x000007a5,0x000007a6,
+0x000007a7,0x000007a8,0x000000a1,0x000007bf,
+0x0000029a,0x000007c0,0x0000029f,0x000007c1,
+0x000002a6,0x000007c2,0x00000299,0x00000781,
+0x0000029d,0x000007c3,0x000007c4,0x000007c5,
+0x00000453,0x000007c6,0x000002ad,0x0000078e,
+0x000002b4,0x000007c7,0x000002bb,0x0000078f,
+0x000002c3,0x000002e3,0x000002b2,0x00000790,
+0x000002b8,0x000002de,0x00000791,0x00000792,
+0x0000078a,0x000002cf,0x00000097,0x00000804,
+0x000003bb,0x00000783,0x000003bc,0x00000803,
+0x000003bd,0x000003c0,0x000003bf,0x000003ec,
+0x00000456,0x000003e6,0x0000042b,0x000003e0,
+0x00000424,0x000003da,0x000003c1,0x000007ad,
+0x000003c2,0x000007ae,0x000003c5,0x000007af,
+0x000003c6,0x000002db,0x000003c8,0x000003d3,
+0x000007b0,0x000002dc,0x000007b1,0x000003ce,
+0x000007b2,0x000002cd,0x00000092,0x000007b9,
+0x000000ec,0x000007ba,0x000002a2,0x000007bb,
+0x000003be,0x000003ed,0x000002a1,0x000003eb,
+0x00000784,0x000003e5,0x00000421,0x000003df,
+0x000007bc,0x000003d9,0x000002af,0x000007bd,
+0x000003c3,0x00000799,0x000002be,0x000007be,
+0x000003c7,0x000003d4,0x000002bd,0x000003d2,
+0x0000079a,0x000003d0,0x00000780,0x000003cd,
+0x0000079b,0x000003cb,0x000000f6,0x000007cc,
+0x00000454,0x000007cd,0x000002a4,0x00000788,
+0x0000042c,0x000003e1,0x000002a8,0x000003e9,
+0x0000077f,0x000003e3,0x00000795,0x000003dd,
+0x00000429,0x000003d7,0x000002b1,0x00000796,
+0x000007b4,0x000007b5,0x000002c0,0x000002d6,
+0x000007b6,0x000002d0,0x000002c5,0x000002e1,
+0x00000787,0x000002d9,0x000007b7,0x000002d2,
+0x000007b8,0x000002ca,0x00040020,0x0000080e,
+0x00000007,0x00000800,0x0004001c,0x00000823,
+0x00000034,0x0000008e,0x0005002c,0x00000034,
+0x00000824,0x00000692,0x0000008e,0x0005002c,
+0x00000034,0x00000825,0x000002bf,0x0000008e,
+0x0005002c,0x00000034,0x00000826,0x000002a1,
+0x000000a1,0x0005002c,0x00000034,0x00000827,
+0x0000029f,0x0000008e,0x0005002c,0x00000034,
+0x00000828,0x0000008e,0x00000093,0x0005002c,
+0x00000034,0x00000829,0x00000092,0x00000092,
+0x0005002c,0x00000034,0x0000082a,0x00000093,
+0x000000f6,0x000b002c,0x00000823,0x0000082b,
+0x00000824,0x00000825,0x00000826,0x00000827,
+0x00000828,0x00000829,0x0000082a,0x0000047c,
+0x00040020,0x0000082e,0x00000007,0x00000823,
+0x0004002b,0x00000056,0x00000840,0x00000060,
+0x0004002b,0x00000056,0x00000841,0x00000040,
+0x0004002b,0x00000056,0x00000842,0x00000020,
+0x0007002c,0x00000057,0x00000843,0x00000840,
+0x00000841,0x00000842,0x000000b9,0x0007002c,
+0x00000011,0x00000847,0x000000a1,0x000000a1,
+0x000000a1,0x000000a1,0x0007002c,0x00000057,
+0x00000849,0x000000b9,0x000000b9,0x000000b9,
+0x000000b9,0x0004002b,0x00000056,0x0000084a,
+0x0000001f,0x0007002c,0x00000057,0x0000084b,
+0x0000084a,0x0000084a,0x0000084a,0x0000084a,
+0x0004002b,0x00000006,0x00000851,0xffffffff,
+0x0007002c,0x00000011,0x00000852,0x00000851,
+0x00000851,0x00000851,0x00000851,0x0007002c,
+0x00000011,0x00000855,0x000001dd,0x00000179,
+0x0000017d,0x000001a0,0x00040017,0x00000856,
+0x00000084,0x00000004,0x0007002c,0x00000011,
+0x0000085f,0x00000692,0x0000009e,0x00000692,
+0x00000692,0x0004002b,0x00000056,0x0000089a,
+0x0000001d,0x0004002b,0x00000056,0x0000089e,
+0xfffffffe,0x00040020,0x0000091c,0x00000001,
+0x00000008,0x0004003b,0x0000091c,0x0000091d,
+0x00000001,0x00040020,0x00000923,0x00000001,
+0x00000006,0x00090019,0x00000931,0x00000006,
+0x00000000,0x00000000,0x00000001,0x00000000,
+0x00000002,0x0000001e,0x00040020,0x00000932,
+0x00000000,0x00000931,0x0004003b,0x00000932,
+0x00000933,0x00000000,0x00090019,0x00000943,
+0x00000006,0x00000000,0x00000000,0x00000001,
+0x00000000,0x00000002,0x00000020,0x00040020,
+0x00000944,0x00000000,0x00000943,0x0004003b,
+0x00000944,0x00000945,0x00000000,0x0006002c,
+0x00000008,0x00000951,0x0000008e,0x0000008e,
+0x000000a1,0x00050036,0x00000002,0x00000004,
+0x00000000,0x00000003,0x000200f8,0x00000005,
+0x0004003b,0x00000035,0x0000091b,0x00000007,
+0x0004003b,0x00000007,0x00000920,0x00000007,
+0x0004003b,0x00000035,0x00000927,0x00000007,
+0x0004003b,0x00000035,0x0000092c,0x00000007,
+0x0004003b,0x0000005e,0x0000093c,0x00000007,
+0x0004003b,0x00000012,0x00000940,0x00000007,
+0x0004003b,0x0000005e,0x0000094e,0x00000007,
+0x0003003e,0x00000086,0x00000087,0x0004003d,
+0x00000008,0x0000091e,0x0000091d,0x0007004f,
+0x00000034,0x0000091f,0x0000091e,0x0000091e,
+0x00000000,0x00000001,0x0003003e,0x0000091b,
+0x0000091f,0x00050041,0x00000584,0x00000921,
+0x00000141,0x000000c4,0x0004003d,0x00000006,
+0x00000922,0x00000921,0x00050041,0x00000923,
+0x00000924,0x0000091d,0x00000093,0x0004003d,
+0x00000006,0x00000925,0x00000924,0x00050080,
+0x00000006,0x00000926,0x00000922,0x00000925,
+0x0003003e,0x00000920,0x00000926,0x0004003d,
+0x00000034,0x00000928,0x0000091b,0x00050041,
+0x00000142,0x00000929,0x00000141,0x000000b9,
+0x0004003d,0x00000034,0x0000092a,0x00000929,
+0x00050086,0x00000034,0x0000092b,0x00000928,
+0x0000092a,0x0003003e,0x00000927,0x0000092b,
+0x0004003d,0x00000034,0x0000092d,0x0000091b,
+0x00050041,0x00000142,0x0000092e,0x00000141,
+0x000000b9,0x0004003d,0x00000034,0x0000092f,
+0x0000092e,0x00050089,0x00000034,0x00000930,
+0x0000092d,0x0000092f,0x0003003e,0x0000092c,
+0x00000930,0x0004003d,0x00000931,0x00000934,
+0x00000933,0x0004003d,0x00000034,0x00000935,
+0x00000927,0x0004007c,0x0000007f,0x00000936,
+0x00000935,0x0004003d,0x00000006,0x00000937,
+0x00000920,0x0004007c,0x00000056,0x00000938,
+0x00000937,0x00050051,0x00000056,0x00000939,
+0x00000936,0x00000000,0x00050051,0x00000056,
+0x0000093a,0x00000936,0x00000001,0x00060050,
+0x0000005d,0x0000093b,0x00000939,0x0000093a,
+0x00000938,0x0003003e,0x0000093c,0x0000093b,
+0x00050039,0x0000007f,0x0000093d,0x00000082,
+0x0000093c,0x00050062,0x00000011,0x0000093e,
+0x00000934,0x0000093d,0x0009004f,0x00000011,
+0x0000093f,0x0000093e,0x0000093e,0x00000003,
+0x00000002,0x00000001,0x00000000,0x0003003e,
+0x000000aa,0x0000093f,0x0004003d,0x00000034,
+0x00000941,0x0000092c,0x00050039,0x00000011,
+0x00000942,0x0000007d,0x00000941,0x0003003e,
+0x00000940,0x00000942,0x0004003d,0x00000943,
+0x00000946,0x00000945,0x0004003d,0x00000034,
+0x00000947,0x0000091b,0x0004007c,0x0000007f,
+0x00000948,0x00000947,0x0004003d,0x00000006,
+0x00000949,0x00000920,0x0004007c,0x00000056,
+0x0000094a,0x00000949,0x00050051,0x00000056,
+0x0000094b,0x00000948,0x00000000,0x00050051,
+0x00000056,0x0000094c,0x00000948,0x00000001,
+0x00060050,0x0000005d,0x0000094d,0x0000094b,
+0x0000094c,0x0000094a,0x0003003e,0x0000094e,
+0x0000094d,0x00050039,0x0000007f,0x0000094f,
+0x00000082,0x0000094e,0x0004003d,0x00000011,
+0x00000950,0x00000940,0x00040063,0x00000946,
+0x0000094f,0x00000950,0x000100fd,0x00010038,
+0x00050036,0x00000006,0x0000000d,0x00000000,
+0x0000000a,0x00030037,0x00000007,0x0000000b,
+0x00030037,0x00000009,0x0000000c,0x000200f8,
+0x0000000e,0x0004003b,0x00000035,0x00000088,
+0x00000007,0x0004003d,0x00000006,0x00000089,
+0x0000000b,0x0004003d,0x00000008,0x0000008a,
+0x0000000c,0x0007004f,0x00000034,0x0000008b,
+0x0000008a,0x0000008a,0x00000000,0x00000001,
+0x00050050,0x00000034,0x0000008c,0x00000089,
+0x00000089,0x00050084,0x00000034,0x0000008d,
+0x0000008c,0x0000008b,0x00050084,0x00000034,
+0x00000091,0x0000008d,0x00000090,0x00050080,
+0x00000034,0x00000095,0x00000091,0x00000094,
+0x00050086,0x00000034,0x00000099,0x00000095,
+0x00000098,0x0003003e,0x00000088,0x00000099,
+0x0004003d,0x00000006,0x0000009a,0x0000000b,
+0x00050041,0x00000007,0x0000009b,0x0000000c,
+0x00000093,0x0004003d,0x00000006,0x0000009c,
+0x0000009b,0x00050084,0x00000006,0x0000009d,
+0x0000009a,0x0000009c,0x00050041,0x00000007,
+0x0000009f,0x00000088,0x0000009e,0x0004003d,
+0x00000006,0x000000a0,0x0000009f,0x00050041,
+0x00000007,0x000000a2,0x00000088,0x000000a1,
+0x0004003d,0x00000006,0x000000a3,0x000000a2,
+0x00050080,0x00000006,0x000000a4,0x000000a0,
+0x000000a3,0x00050080,0x00000006,0x000000a5,
+0x0000009d,0x000000a4,0x000200fe,0x000000a5,
+0x00010038,0x00050036,0x00000002,0x0000000f,
+0x00000000,0x00000003,0x000200f8,0x00000010,
+0x0004003b,0x00000007,0x000000b6,0x00000007,
+0x0004003b,0x00000007,0x000000bc,0x00000007,
+0x0004003b,0x00000007,0x000000c0,0x00000007,
+0x0004003b,0x00000007,0x000000c6,0x00000007,
+0x0004003b,0x00000007,0x000000cb,0x00000007,
+0x0004003b,0x00000007,0x000000d0,0x00000007,
+0x0004003b,0x00000007,0x000000df,0x00000007,
+0x0004003b,0x00000162,0x00000163,0x00000007,
+0x0004003b,0x00000007,0x00000170,0x00000007,
+0x0004003b,0x00000009,0x00000172,0x00000007,
+0x00050041,0x000000ab,0x000000ac,0x000000aa,
+0x00000097,0x0004003d,0x00000006,0x000000ad,
+0x000000ac,0x000500c7,0x00000006,0x000000af,
+0x000000ad,0x000000ae,0x000500aa,0x00000084,
+0x000000b1,0x000000af,0x000000b0,0x0003003e,
+0x000000a8,0x000000b1,0x0004003d,0x00000084,
+0x000000b2,0x000000a8,0x000300f7,0x000000b4,
+0x00000000,0x000400fa,0x000000b2,0x000000b3,
+0x000000b4,0x000200f8,0x000000b3,0x000100fd,
+0x000200f8,0x000000b4,0x00050041,0x000000ab,
+0x000000b7,0x000000aa,0x00000097,0x0004003d,
+0x00000006,0x000000b8,0x000000b7,0x000600cb,
+0x00000006,0x000000bb,0x000000b8,0x000000b9,
+0x000000ba,0x0003003e,0x000000b6,0x000000bb,
+0x00050041,0x000000ab,0x000000bd,0x000000aa,
+0x00000097,0x0004003d,0x00000006,0x000000be,
+0x000000bd,0x000600cb,0x00000006,0x000000bf,
+0x000000be,0x000000ba,0x000000ba,0x0003003e,
+0x000000bc,0x000000bf,0x00050041,0x000000ab,
+0x000000c1,0x000000aa,0x00000097,0x0004003d,
+0x00000006,0x000000c2,0x000000c1,0x000600cb,
+0x00000006,0x000000c5,0x000000c2,0x000000c3,
+0x000000c4,0x0003003e,0x000000c0,0x000000c5,
+0x00050041,0x000000ab,0x000000c7,0x000000aa,
+0x00000097,0x0004003d,0x00000006,0x000000c8,
+0x000000c7,0x000600cb,0x00000006,0x000000ca,
+0x000000c8,0x000000c9,0x000000ba,0x0003003e,
+0x000000c6,0x000000ca,0x00050041,0x000000ab,
+0x000000cc,0x000000aa,0x00000097,0x0004003d,
+0x00000006,0x000000cd,0x000000cc,0x000600cb,
+0x00000006,0x000000cf,0x000000cd,0x000000ce,
+0x000000ba,0x0003003e,0x000000cb,0x000000cf,
+0x00050041,0x000000ab,0x000000d1,0x000000aa,
+0x00000097,0x0004003d,0x00000006,0x000000d2,
+0x000000d1,0x000600cb,0x00000006,0x000000d4,
+0x000000d2,0x000000d3,0x000000c4,0x0003003e,
+0x000000d0,0x000000d4,0x00050041,0x000000ab,
+0x000000d6,0x000000aa,0x00000097,0x0004003d,
+0x00000006,0x000000d7,0x000000d6,0x000600cb,
+0x00000006,0x000000d9,0x000000d7,0x000000d8,
+0x000000c4,0x000500ab,0x00000084,0x000000da,
+0x000000d9,0x0000009e,0x0003003e,0x000000d5,
+0x000000da,0x0004003d,0x00000006,0x000000db,
+0x000000b6,0x000500aa,0x00000084,0x000000dc,
+0x000000db,0x0000009e,0x000300f7,0x000000de,
+0x00000000,0x000400fa,0x000000dc,0x000000dd,
+0x0000010e,0x000200f8,0x000000dd,0x0004003d,
+0x00000006,0x000000e0,0x000000bc,0x000500c4,
+0x00000006,0x000000e1,0x000000e0,0x000000c4,
+0x0004003d,0x00000006,0x000000e2,0x000000c0,
+0x000500c5,0x00000006,0x000000e3,0x000000e1,
+0x000000e2,0x0003003e,0x000000df,0x000000e3,
+0x0004003d,0x00000006,0x000000e4,0x000000cb,
+0x000300f7,0x000000e9,0x00000000,0x000b00fb,
+0x000000e4,0x000000e9,0x00000000,0x000000e5,
+0x00000001,0x000000e6,0x00000002,0x000000e7,
+0x00000003,0x000000e8,0x000200f8,0x000000e5,
+0x0004003d,0x00000006,0x000000ed,0x000000c6,
+0x00050080,0x00000006,0x000000ee,0x000000ed,
+0x00000093,0x00050050,0x00000034,0x000000ef,
+0x000000ec,0x000000ee,0x0003003e,0x000000eb,
+0x000000ef,0x000200f9,0x000000e9,0x000200f8,
+0x000000e6,0x0004003d,0x00000006,0x000000f1,
+0x000000c6,0x00050080,0x00000006,0x000000f2,
+0x000000f1,0x00000093,0x00050050,0x00000034,
+0x000000f3,0x000000f2,0x000000ec,0x0003003e,
+0x000000eb,0x000000f3,0x000200f9,0x000000e9,
+0x000200f8,0x000000e7,0x0004003d,0x00000006,
+0x000000f5,0x000000c6,0x00050080,0x00000006,
+0x000000f7,0x000000f5,0x000000f6,0x00050041,
+0x000000ab,0x000000f8,0x000000aa,0x00000097,
+0x0004003d,0x00000006,0x000000f9,0x000000f8,
+0x000600cb,0x00000006,0x000000fa,0x000000f9,
+0x000000d3,0x000000ba,0x00050080,0x00000006,
+0x000000fb,0x000000fa,0x000000f6,0x00050050,
+0x00000034,0x000000fc,0x000000f7,0x000000fb,
+0x0003003e,0x000000eb,0x000000fc,0x0003003e,
+0x000000d5,0x00000087,0x0003003e,0x000000d0,
+0x0000009e,0x000200f9,0x000000e9,0x000200f8,
+0x000000e8,0x0004003d,0x00000006,0x000000fe,
+0x000000c6,0x000500aa,0x00000084,0x000000ff,
+0x000000fe,0x0000009e,0x000300f7,0x00000101,
+0x00000000,0x000400fa,0x000000ff,0x00000100,
+0x00000104,0x000200f8,0x00000100,0x0003003e,
+0x000000eb,0x00000103,0x000200f9,0x00000101,
+0x000200f8,0x00000104,0x0004003d,0x00000006,
+0x00000105,0x000000c6,0x000500aa,0x00000084,
+0x00000106,0x00000105,0x000000a1,0x000300f7,
+0x00000108,0x00000000,0x000400fa,0x00000106,
+0x00000107,0x0000010a,0x000200f8,0x00000107,
+0x0003003e,0x000000eb,0x00000109,0x000200f9,
+0x00000108,0x000200f8,0x0000010a,0x0003003e,
+0x00000086,0x0000010b,0x000100fd,0x000200f8,
+0x00000108,0x000200f9,0x00000101,0x000200f8,
+0x00000101,0x000200f9,0x000000e9,0x000200f8,
+0x000000e9,0x000200f9,0x000000de,0x000200f8,
+0x0000010e,0x0004003d,0x00000006,0x0000010f,
+0x000000b6,0x000500c4,0x00000006,0x00000110,
+0x0000010f,0x000000c4,0x0004003d,0x00000006,
+0x00000111,0x000000c0,0x000500c5,0x00000006,
+0x00000112,0x00000110,0x00000111,0x0003003e,
+0x000000df,0x00000112,0x0004003d,0x00000006,
+0x00000113,0x000000bc,0x000300f7,0x00000118,
+0x00000000,0x000b00fb,0x00000113,0x00000118,
+0x00000000,0x00000114,0x00000001,0x00000115,
+0x00000002,0x00000116,0x00000003,0x00000117,
+0x000200f8,0x00000114,0x0004003d,0x00000006,
+0x00000119,0x000000cb,0x00050080,0x00000006,
+0x0000011a,0x00000119,0x00000092,0x0004003d,
+0x00000006,0x0000011b,0x000000c6,0x00050080,
+0x00000006,0x0000011c,0x0000011b,0x00000093,
+0x00050050,0x00000034,0x0000011d,0x0000011a,
+0x0000011c,0x0003003e,0x000000eb,0x0000011d,
+0x000200f9,0x00000118,0x000200f8,0x00000115,
+0x0004003d,0x00000006,0x0000011f,0x000000cb,
+0x00050080,0x00000006,0x00000120,0x0000011f,
+0x0000008e,0x0004003d,0x00000006,0x00000121,
+0x000000c6,0x00050080,0x00000006,0x00000122,
+0x00000121,0x00000093,0x00050050,0x00000034,
+0x00000123,0x00000120,0x00000122,0x0003003e,
+0x000000eb,0x00000123,0x000200f9,0x00000118,
+0x000200f8,0x00000116,0x0004003d,0x00000006,
+0x00000125,0x000000c6,0x00050080,0x00000006,
+0x00000126,0x00000125,0x00000093,0x0004003d,
+0x00000006,0x00000127,0x000000cb,0x00050080,
+0x00000006,0x00000128,0x00000127,0x0000008e,
+0x00050050,0x00000034,0x00000129,0x00000126,
+0x00000128,0x0003003e,0x000000eb,0x00000129,
+0x000200f9,0x00000118,0x000200f8,0x00000117,
+0x0004003d,0x00000006,0x0000012b,0x000000cb,
+0x000500c2,0x00000006,0x0000012c,0x0000012b,
+0x000000c4,0x000500aa,0x00000084,0x0000012d,
+0x0000012c,0x0000009e,0x000300f7,0x0000012f,
+0x00000000,0x000400fa,0x0000012d,0x0000012e,
+0x00000136,0x000200f8,0x0000012e,0x0004003d,
+0x00000006,0x00000130,0x000000c6,0x00050080,
+0x00000006,0x00000131,0x00000130,0x00000093,
+0x0004003d,0x00000006,0x00000132,0x000000cb,
+0x000500c7,0x00000006,0x00000133,0x00000132,
+0x000000a1,0x00050080,0x00000006,0x00000134,
+0x00000133,0x000000f6,0x00050050,0x00000034,
+0x00000135,0x00000131,0x00000134,0x0003003e,
+0x000000eb,0x00000135,0x000200f9,0x0000012f,
+0x000200f8,0x00000136,0x0004003d,0x00000006,
+0x00000137,0x000000cb,0x000500c7,0x00000006,
+0x00000138,0x00000137,0x000000a1,0x00050080,
+0x00000006,0x00000139,0x00000138,0x00000093,
+0x0004003d,0x00000006,0x0000013a,0x000000c6,
+0x00050080,0x00000006,0x0000013b,0x0000013a,
+0x00000093,0x00050050,0x00000034,0x0000013c,
+0x00000139,0x0000013b,0x0003003e,0x000000eb,
+0x0000013c,0x000200f9,0x0000012f,0x000200f8,
+0x0000012f,0x000200f9,0x00000118,0x000200f8,
+0x00000118,0x000200f9,0x000000de,0x000200f8,
+0x000000de,0x0004003d,0x00000034,0x0000013e,
+0x000000eb,0x00050041,0x00000142,0x00000143,
+0x00000141,0x000000b9,0x0004003d,0x00000034,
+0x00000144,0x00000143,0x000500ac,0x00000145,
+0x00000146,0x0000013e,0x00000144,0x0004009a,
+0x00000084,0x00000147,0x00000146,0x000300f7,
+0x00000149,0x00000000,0x000400fa,0x00000147,
+0x00000148,0x00000149,0x000200f8,0x00000148,
+0x0003003e,0x00000086,0x0000010b,0x000100fd,
+0x000200f8,0x00000149,0x0004003d,0x00000006,
+0x0000015d,0x000000d0,0x000500c4,0x00000006,
+0x0000015f,0x0000015d,0x0000015e,0x0004003d,
+0x00000006,0x00000160,0x000000df,0x000500c5,
+0x00000006,0x00000161,0x0000015f,0x00000160,
+0x0003003e,0x00000163,0x0000015c,0x00050041,
+0x00000009,0x00000164,0x00000163,0x00000161,
+0x0004003d,0x00000008,0x00000165,0x00000164,
+0x0003003e,0x0000014c,0x00000165,0x00050041,
+0x000000ab,0x00000167,0x000000eb,0x0000009e,
+0x0004003d,0x00000006,0x00000168,0x00000167,
+0x00050041,0x000000ab,0x00000169,0x000000eb,
+0x000000a1,0x0004003d,0x00000006,0x0000016a,
+0x00000169,0x00050084,0x00000006,0x0000016b,
+0x00000168,0x0000016a,0x0004003d,0x00000084,
+0x0000016c,0x000000d5,0x000600a9,0x00000056,
+0x0000016d,0x0000016c,0x000000c4,0x000000b9,
+0x000500c4,0x00000006,0x0000016e,0x0000016b,
+0x0000016d,0x0003003e,0x00000166,0x0000016e,
+0x0004003d,0x00000006,0x00000171,0x00000166,
+0x0003003e,0x00000170,0x00000171,0x0004003d,
+0x00000008,0x00000173,0x0000014c,0x0003003e,
+0x00000172,0x00000173,0x00060039,0x00000006,
+0x00000174,0x0000000d,0x00000170,0x00000172,
+0x0003003e,0x0000016f,0x00000174,0x0004003d,
+0x00000006,0x00000175,0x0000016f,0x000500b0,
+0x00000084,0x00000177,0x00000175,0x00000176,
+0x0004003d,0x00000006,0x00000178,0x0000016f,
+0x000500ac,0x00000084,0x0000017a,0x00000178,
+0x00000179,0x000500a6,0x00000084,0x0000017b,
+0x00000177,0x0000017a,0x0004003d,0x00000006,
+0x0000017c,0x00000166,0x000500ac,0x00000084,
+0x0000017e,0x0000017c,0x0000017d,0x000500a6,
+0x00000084,0x0000017f,0x0000017b,0x0000017e,
+0x000300f7,0x00000181,0x00000000,0x000400fa,
+0x0000017f,0x00000180,0x00000181,0x000200f8,
+0x00000180,0x0003003e,0x00000086,0x0000010b,
+0x000100fd,0x000200f8,0x00000181,0x00050041,
+0x000000ab,0x00000184,0x000000aa,0x00000097,
+0x0004003d,0x00000006,0x00000185,0x00000184,
+0x000600cb,0x00000006,0x00000187,0x00000185,
+0x00000186,0x000000ba,0x00050080,0x00000006,
+0x00000188,0x00000187,0x000000a1,0x0003003e,
+0x00000183,0x00000188,0x0004003d,0x00000006,
+0x00000189,0x00000183,0x000500ac,0x00000084,
+0x0000018a,0x00000189,0x000000a1,0x000300f7,
+0x0000018c,0x00000000,0x000400fa,0x0000018a,
+0x0000018b,0x0000018c,0x000200f8,0x0000018b,
+0x00050041,0x000000ab,0x0000018e,0x000000aa,
+0x00000097,0x0004003d,0x00000006,0x0000018f,
+0x0000018e,0x000600cb,0x00000006,0x00000191,
+0x0000018f,0x00000190,0x000000d8,0x0003003e,
+0x0000018d,0x00000191,0x000200f9,0x0000018c,
+0x000200f8,0x0000018c,0x0004003d,0x00000084,
+0x00000192,0x000000d5,0x0004003d,0x00000006,
+0x00000193,0x00000183,0x000500aa,0x00000084,
+0x00000194,0x00000193,0x00000092,0x000500a7,
+0x00000084,0x00000195,0x00000192,0x00000194,
+0x000300f7,0x00000197,0x00000000,0x000400fa,
+0x00000195,0x00000196,0x00000197,0x000200f8,
+0x00000196,0x0003003e,0x00000086,0x0000010b,
+0x000100fd,0x000200f8,0x00000197,0x000100fd,
+0x00010038,0x00050036,0x00000006,0x00000017,
+0x00000000,0x00000013,0x00030037,0x00000012,
+0x00000014,0x00030037,0x00000007,0x00000015,
+0x00030037,0x00000007,0x00000016,0x000200f8,
+0x00000018,0x0004003b,0x00000007,0x0000019e,
+0x00000007,0x0004003b,0x00000007,0x000001a3,
+0x00000007,0x0004003b,0x00000007,0x000001aa,
+0x00000007,0x0004003b,0x00000007,0x000001bd,
+0x00000007,0x0004003b,0x00000007,0x000001c0,
+0x00000007,0x0004003b,0x00000007,0x000001c9,
+0x00000007,0x0004003d,0x00000006,0x00000199,
+0x00000016,0x000500aa,0x00000084,0x0000019a,
+0x00000199,0x0000009e,0x000300f7,0x0000019c,
+0x00000000,0x000400fa,0x0000019a,0x0000019b,
+0x0000019c,0x000200f8,0x0000019b,0x000200fe,
+0x0000009e,0x000200f8,0x0000019c,0x0004003d,
+0x00000006,0x0000019f,0x00000015,0x00050086,
+0x00000006,0x000001a1,0x0000019f,0x000001a0,
+0x00050082,0x00000006,0x000001a2,0x00000097,
+0x000001a1,0x0003003e,0x0000019e,0x000001a2,
+0x0004003d,0x00000006,0x000001a4,0x00000015,
+0x0004003d,0x00000006,0x000001a5,0x00000016,
+0x00050080,0x00000006,0x000001a6,0x000001a4,
+0x000001a5,0x00050082,0x00000006,0x000001a7,
+0x000001a6,0x000000a1,0x00050086,0x00000006,
+0x000001a8,0x000001a7,0x000001a0,0x00050082,
+0x00000006,0x000001a9,0x00000097,0x000001a8,
+0x0003003e,0x000001a3,0x000001a9,0x0004003d,
+0x00000006,0x000001ab,0x00000015,0x000500c7,
+0x00000006,0x000001ad,0x000001ab,0x000001ac,
+0x0003003e,0x000001aa,0x000001ad,0x0004003d,
+0x00000006,0x000001ae,0x0000019e,0x0004003d,
+0x00000006,0x000001af,0x000001a3,0x000500aa,
+0x00000084,0x000001b0,0x000001ae,0x000001af,
+0x000300f7,0x000001b2,0x00000000,0x000400fa,
+0x000001b0,0x000001b1,0x000001bc,0x000200f8,
+0x000001b1,0x0004003d,0x00000006,0x000001b3,
+0x0000019e,0x00050041,0x00000007,0x000001b4,
+0x00000014,0x000001b3,0x0004003d,0x00000006,
+0x000001b5,0x000001b4,0x0004003d,0x00000006,
+0x000001b6,0x000001aa,0x0004007c,0x00000056,
+0x000001b7,0x000001b6,0x0004003d,0x00000006,
+0x000001b8,0x00000016,0x0004007c,0x00000056,
+0x000001b9,0x000001b8,0x000600cb,0x00000006,
+0x000001ba,0x000001b5,0x000001b7,0x000001b9,
+0x000200fe,0x000001ba,0x000200f8,0x000001bc,
+0x0004003d,0x00000006,0x000001be,0x000001aa,
+0x00050082,0x00000006,0x000001bf,0x000001a0,
+0x000001be,0x0003003e,0x000001bd,0x000001bf,
+0x0004003d,0x00000006,0x000001c1,0x0000019e,
+0x00050041,0x00000007,0x000001c2,0x00000014,
+0x000001c1,0x0004003d,0x00000006,0x000001c3,
+0x000001c2,0x0004003d,0x00000006,0x000001c4,
+0x000001aa,0x0004007c,0x00000056,0x000001c5,
+0x000001c4,0x0004003d,0x00000006,0x000001c6,
+0x000001bd,0x0004007c,0x00000056,0x000001c7,
+0x000001c6,0x000600cb,0x00000006,0x000001c8,
+0x000001c3,0x000001c5,0x000001c7,0x0003003e,
+0x000001c0,0x000001c8,0x0004003d,0x00000006,
+0x000001ca,0x000001a3,0x00050041,0x00000007,
+0x000001cb,0x00000014,0x000001ca,0x0004003d,
+0x00000006,0x000001cc,0x000001cb,0x0004003d,
+0x00000006,0x000001cd,0x00000016,0x0004003d,
+0x00000006,0x000001ce,0x000001bd,0x00050082,
+0x00000006,0x000001cf,0x000001cd,0x000001ce,
+0x0004007c,0x00000056,0x000001d0,0x000001cf,
+0x000600cb,0x00000006,0x000001d1,0x000001cc,
+0x000000b9,0x000001d0,0x0003003e,0x000001c9,
+0x000001d1,0x0004003d,0x00000006,0x000001d2,
+0x000001c9,0x0004003d,0x00000006,0x000001d3,
+0x000001bd,0x000500c4,0x00000006,0x000001d4,
+0x000001d2,0x000001d3,0x0004003d,0x00000006,
+0x000001d5,0x000001c0,0x000500c5,0x00000006,
+0x000001d6,0x000001d4,0x000001d5,0x000200fe,
+0x000001d6,0x000200f8,0x000001b2,0x000100ff,
+0x00010038,0x00050036,0x00000006,0x0000001e,
+0x00000000,0x00000019,0x00030037,0x00000007,
+0x0000001a,0x00030037,0x00000007,0x0000001b,
+0x00030037,0x00000007,0x0000001c,0x00030037,
+0x00000007,0x0000001d,0x000200f8,0x0000001f,
+0x0004003b,0x00000007,0x000001e0,0x00000007,
+0x0004003b,0x00000007,0x000001eb,0x00000007,
+0x0004003b,0x00000007,0x000001f0,0x00000007,
+0x0004003b,0x00000007,0x000001fb,0x00000007,
+0x0004003b,0x00000007,0x00000209,0x00000007,
+0x0004003b,0x00000007,0x00000211,0x00000007,
+0x0004003b,0x00000012,0x00000212,0x00000007,
+0x0004003b,0x00000007,0x00000214,0x00000007,
+0x0004003b,0x00000007,0x00000216,0x00000007,
+0x0004003b,0x00000007,0x00000219,0x00000007,
+0x0004003b,0x00000007,0x0000021e,0x00000007,
+0x0004003b,0x00000007,0x00000226,0x00000007,
+0x0004003b,0x00000007,0x0000023e,0x00000007,
+0x0004003d,0x00000006,0x000001d9,0x00000183,
+0x000500aa,0x00000084,0x000001da,0x000001d9,
+0x000000a1,0x000300f7,0x000001dc,0x00000000,
+0x000400fa,0x000001da,0x000001db,0x000001ea,
+0x000200f8,0x000001db,0x0004003d,0x00000006,
+0x000001de,0x0000016f,0x00050082,0x00000006,
+0x000001df,0x000001dd,0x000001de,0x0003003e,
+0x0000001b,0x000001df,0x00050041,0x000000ab,
+0x000001e1,0x000000aa,0x00000097,0x0004003d,
+0x00000006,0x000001e2,0x000001e1,0x000600cb,
+0x00000006,0x000001e3,0x000001e2,0x00000190,
+0x000000c3,0x0003003e,0x000001e0,0x000001e3,
+0x0004003d,0x00000006,0x000001e4,0x000001e0,
+0x000500c2,0x00000006,0x000001e5,0x000001e4,
+0x000000ba,0x00050084,0x00000006,0x000001e6,
+0x00000093,0x000001e5,0x00050080,0x00000006,
+0x000001e7,0x000001e6,0x00000093,0x0003003e,
+0x0000001c,0x000001e7,0x0003003e,0x0000001d,
+0x0000009e,0x0004003d,0x00000006,0x000001e8,
+0x000001e0,0x000200fe,0x000001e8,0x000200f8,
+0x000001ea,0x00050041,0x000000ab,0x000001ec,
+0x000000aa,0x00000097,0x0004003d,0x00000006,
+0x000001ed,0x000001ec,0x000600cb,0x00000006,
+0x000001ef,0x000001ed,0x000001ee,0x000000ba,
+0x0003003e,0x000001eb,0x000001ef,0x00050041,
+0x000000ab,0x000001f1,0x000000aa,0x00000097,
+0x0004003d,0x00000006,0x000001f2,0x000001f1,
+0x000600cb,0x00000006,0x000001f4,0x000001f2,
+0x000001f3,0x000000c3,0x0003003e,0x000001f0,
+0x000001f4,0x0004003d,0x00000006,0x000001f5,
+0x000001eb,0x000500aa,0x00000084,0x000001f6,
+0x000001f5,0x0000009e,0x000300f7,0x000001f8,
+0x00000000,0x000400fa,0x000001f6,0x000001f7,
+0x00000208,0x000200f8,0x000001f7,0x0004003d,
+0x00000006,0x000001f9,0x0000016f,0x00050082,
+0x00000006,0x000001fa,0x000001dd,0x000001f9,
+0x0003003e,0x0000001b,0x000001fa,0x0004003d,
+0x00000006,0x000001fc,0x000001f0,0x000500c2,
+0x00000006,0x000001fd,0x000001fc,0x000000ba,
+0x00050084,0x00000006,0x000001fe,0x00000093,
+0x000001fd,0x00050080,0x00000006,0x000001ff,
+0x000001fe,0x00000093,0x0003003e,0x000001fb,
+0x000001ff,0x0004003d,0x00000006,0x00000200,
+0x000001fb,0x0004003d,0x00000006,0x00000201,
+0x00000183,0x00050084,0x00000006,0x00000202,
+0x00000200,0x00000201,0x0003003e,0x0000001c,
+0x00000202,0x0004003d,0x00000006,0x00000203,
+0x000001fb,0x0004003d,0x00000006,0x00000204,
+0x0000001a,0x00050084,0x00000006,0x00000205,
+0x00000203,0x00000204,0x0003003e,0x0000001d,
+0x00000205,0x0004003d,0x00000006,0x00000206,
+0x000001f0,0x000200fe,0x00000206,0x000200f8,
+0x00000208,0x0004003d,0x00000006,0x0000020a,
+0x00000183,0x00050084,0x00000006,0x0000020b,
+0x00000097,0x0000020a,0x00050082,0x00000006,
+0x0000020c,0x0000020b,0x00000092,0x0003003e,
+0x00000209,0x0000020c,0x0004003d,0x00000006,
+0x0000020d,0x0000016f,0x00050082,0x00000006,
+0x0000020e,0x000001dd,0x0000020d,0x0004003d,
+0x00000006,0x0000020f,0x00000209,0x00050082,
+0x00000006,0x00000210,0x0000020e,0x0000020f,
+0x0003003e,0x0000001b,0x00000210,0x0004003d,
+0x00000011,0x00000213,0x000000aa,0x0003003e,
+0x00000212,0x00000213,0x0004003d,0x00000006,
+0x00000215,0x0000001b,0x0003003e,0x00000214,
+0x00000215,0x0004003d,0x00000006,0x00000217,
+0x00000209,0x0003003e,0x00000216,0x00000217,
+0x00070039,0x00000006,0x00000218,0x00000017,
+0x00000212,0x00000214,0x00000216,0x0003003e,
+0x00000211,0x00000218,0x0004003d,0x00000006,
+0x0000021a,0x00000211,0x000500c4,0x00000006,
+0x0000021b,0x0000021a,0x000000c3,0x0004003d,
+0x00000006,0x0000021c,0x000001f0,0x000500c5,
+0x00000006,0x0000021d,0x0000021b,0x0000021c,
+0x0003003e,0x00000219,0x0000021d,0x0004003d,
+0x00000006,0x0000021f,0x00000219,0x0004003d,
+0x00000006,0x00000220,0x0000001a,0x00050084,
+0x00000006,0x00000221,0x00000093,0x00000220,
+0x0004003d,0x00000006,0x00000222,0x00000183,
+0x00050080,0x00000006,0x00000223,0x00000221,
+0x00000222,0x0004007c,0x00000056,0x00000224,
+0x00000223,0x000600cb,0x00000006,0x00000225,
+0x0000021f,0x00000224,0x000000ba,0x0003003e,
+0x0000021e,0x00000225,0x0004003d,0x00000006,
+0x00000227,0x00000219,0x0004003d,0x00000006,
+0x00000228,0x00000183,0x0004007c,0x00000056,
+0x00000229,0x00000228,0x000600cb,0x00000006,
+0x0000022a,0x00000227,0x000000b9,0x00000229,
+0x0003003e,0x00000226,0x0000022a,0x0004003d,
+0x00000006,0x0000022b,0x000001eb,0x0004003d,
+0x00000006,0x0000022c,0x00000183,0x00050084,
+0x00000006,0x0000022d,0x0000022b,0x0000022c,
+0x0004003d,0x00000006,0x0000022e,0x00000226,
+0x000400cd,0x00000056,0x0000022f,0x0000022e,
+0x0004007c,0x00000006,0x00000230,0x0000022f,
+0x00050080,0x00000006,0x00000231,0x0000022d,
+0x00000230,0x00050084,0x00000006,0x00000232,
+0x00000093,0x00000231,0x0003003e,0x0000001c,
+0x00000232,0x0004003d,0x00000006,0x00000233,
+0x000001eb,0x0004003d,0x00000006,0x00000234,
+0x0000001a,0x00050084,0x00000006,0x00000235,
+0x00000233,0x00000234,0x0004003d,0x00000006,
+0x00000236,0x00000226,0x0004003d,0x00000006,
+0x00000237,0x0000001a,0x0004007c,0x00000056,
+0x00000238,0x00000237,0x000600cb,0x00000006,
+0x00000239,0x00000236,0x000000b9,0x00000238,
+0x000400cd,0x00000056,0x0000023a,0x00000239,
+0x0004007c,0x00000006,0x0000023b,0x0000023a,
+0x00050080,0x00000006,0x0000023c,0x00000235,
+0x0000023b,0x00050084,0x00000006,0x0000023d,
+0x00000093,0x0000023c,0x0003003e,0x0000001d,
+0x0000023d,0x0004003d,0x00000006,0x0000023f,
+0x000001eb,0x00050082,0x00000006,0x00000240,
+0x0000023f,0x000000a1,0x0004003d,0x00000006,
+0x00000241,0x00000226,0x0004003d,0x00000006,
+0x00000242,0x0000001a,0x0004007c,0x00000056,
+0x00000243,0x00000242,0x000600cb,0x00000006,
+0x00000244,0x00000241,0x00000243,0x000000c4,
+0x00050080,0x00000006,0x00000245,0x00000240,
+0x00000244,0x0003003e,0x0000023e,0x00000245,
+0x0004003d,0x00000006,0x00000246,0x0000023e,
+0x000500c4,0x00000006,0x00000247,0x00000246,
+0x000000ba,0x0004003d,0x00000006,0x00000248,
+0x0000021e,0x000500c5,0x00000006,0x00000249,
+0x00000247,0x00000248,0x000200fe,0x00000249,
+0x000200f8,0x000001f8,0x000100ff,0x000200f8,
+0x000001dc,0x000100ff,0x00010038,0x00050036,
+0x00000006,0x00000025,0x00000000,0x00000020,
+0x00030037,0x00000012,0x00000021,0x00030037,
+0x00000007,0x00000022,0x00030037,0x00000007,
+0x00000023,0x00030037,0x00000007,0x00000024,
+0x000200f8,0x00000026,0x0004003b,0x0000024c,
+0x0000024d,0x00000007,0x0004003b,0x00000007,
+0x00000250,0x00000007,0x0004003b,0x00000012,
+0x00000257,0x00000007,0x0004003b,0x00000007,
+0x00000259,0x00000007,0x0004003b,0x00000007,
+0x0000025a,0x00000007,0x0004003b,0x00000007,
+0x0000025c,0x00000007,0x0004003b,0x00000007,
+0x0000027f,0x00000007,0x0004003b,0x00000012,
+0x00000280,0x00000007,0x0004003b,0x00000007,
+0x00000282,0x00000007,0x0004003b,0x00000007,
+0x00000284,0x00000007,0x0004003b,0x0000024c,
+0x00000288,0x00000007,0x0004003b,0x00000007,
+0x00000296,0x00000007,0x0004003b,0x0000037f,
+0x00000380,0x00000007,0x0004003d,0x00000006,
+0x0000024e,0x00000023,0x0004007c,0x00000056,
+0x0000024f,0x0000024e,0x0003003e,0x0000024d,
+0x0000024f,0x0004003d,0x00000006,0x00000251,
+0x00000022,0x0004003d,0x00000006,0x00000252,
+0x00000023,0x00050080,0x00000006,0x00000253,
+0x00000251,0x00000252,0x0004003d,0x00000006,
+0x00000254,0x00000023,0x00050084,0x00000006,
+0x00000255,0x00000092,0x00000254,0x00050080,
+0x00000006,0x00000256,0x00000255,0x0000008e,
+0x0004003d,0x00000011,0x00000258,0x00000021,
+0x0003003e,0x00000257,0x00000258,0x0003003e,
+0x00000259,0x00000253,0x0003003e,0x0000025a,
+0x00000256,0x00070039,0x00000006,0x0000025b,
+0x00000017,0x00000257,0x00000259,0x0000025a,
+0x0003003e,0x00000250,0x0000025b,0x0004003d,
+0x00000006,0x0000025d,0x00000250,0x000600cb,
+0x00000006,0x0000025e,0x0000025d,0x000000b9,
+0x000000ba,0x0004003d,0x00000006,0x0000025f,
+0x00000250,0x0004003d,0x00000056,0x00000260,
+0x0000024d,0x00050084,0x00000056,0x00000261,
+0x000000c4,0x00000260,0x00050080,0x00000056,
+0x00000262,0x00000261,0x000000ba,0x000600cb,
+0x00000006,0x00000263,0x0000025f,0x00000262,
+0x000000ba,0x000500c4,0x00000006,0x00000264,
+0x00000263,0x000000ba,0x000500c5,0x00000006,
+0x00000265,0x0000025e,0x00000264,0x0004003d,
+0x00000006,0x00000266,0x00000250,0x0004003d,
+0x00000056,0x00000267,0x0000024d,0x00050084,
+0x00000056,0x00000268,0x000000ba,0x00000267,
+0x00050080,0x00000056,0x00000269,0x00000268,
+0x000000c3,0x000600cb,0x00000006,0x0000026a,
+0x00000266,0x00000269,0x000000c4,0x000500c4,
+0x00000006,0x0000026b,0x0000026a,0x000000c3,
+0x000500c5,0x00000006,0x0000026c,0x00000265,
+0x0000026b,0x0004003d,0x00000006,0x0000026d,
+0x00000250,0x0004003d,0x00000056,0x0000026e,
+0x0000024d,0x00050084,0x00000056,0x0000026f,
+0x0000015e,0x0000026e,0x00050080,0x00000056,
+0x00000270,0x0000026f,0x000000c9,0x000600cb,
+0x00000006,0x00000271,0x0000026d,0x00000270,
+0x000000ba,0x000500c4,0x00000006,0x00000272,
+0x00000271,0x000000c9,0x000500c5,0x00000006,
+0x00000273,0x0000026c,0x00000272,0x0004003d,
+0x00000006,0x00000274,0x00000250,0x0004003d,
+0x00000056,0x00000275,0x0000024d,0x00050084,
+0x00000056,0x00000276,0x000000c3,0x00000275,
+0x00050080,0x00000056,0x00000277,0x00000276,
+0x000000ce,0x000600cb,0x00000006,0x00000278,
+0x00000274,0x00000277,0x000000c4,0x000500c4,
+0x00000006,0x00000279,0x00000278,0x000000ce,
+0x000500c5,0x00000006,0x0000027a,0x00000273,
+0x00000279,0x0003003e,0x0000025c,0x0000027a,
+0x0004003d,0x00000006,0x0000027b,0x00000024,
+0x000500aa,0x00000084,0x0000027c,0x0000027b,
+0x0000009e,0x000300f7,0x0000027e,0x00000000,
+0x000400fa,0x0000027c,0x0000027d,0x00000287,
+0x000200f8,0x0000027d,0x0004003d,0x00000011,
+0x00000281,0x00000021,0x0003003e,0x00000280,
+0x00000281,0x0004003d,0x00000006,0x00000283,
+0x00000022,0x0003003e,0x00000282,0x00000283,
+0x0004003d,0x00000006,0x00000285,0x00000023,
+0x0003003e,0x00000284,0x00000285,0x00070039,
+0x00000006,0x00000286,0x00000017,0x00000280,
+0x00000282,0x00000284,0x0003003e,0x0000027f,
+0x00000286,0x000200f9,0x0000027e,0x000200f8,
+0x00000287,0x0004003d,0x00000006,0x00000289,
+0x00000024,0x0004007c,0x00000056,0x0000028a,
+0x00000289,0x00050082,0x00000056,0x0000028b,
+0x0000028a,0x000000c4,0x0003003e,0x00000288,
+0x0000028b,0x0004003d,0x00000006,0x0000028c,
+0x00000250,0x0004003d,0x00000056,0x0000028d,
+0x00000288,0x0004003d,0x00000056,0x0000028e,
+0x0000024d,0x00050084,0x00000056,0x0000028f,
+0x0000028d,0x0000028e,0x0004003d,0x00000056,
+0x00000291,0x00000288,0x0005004d,0x00000056,
+0x00000292,0x00000290,0x00000291,0x00050080,
+0x00000056,0x00000293,0x0000028f,0x00000292,
+0x0004003d,0x00000056,0x00000294,0x0000024d,
+0x000600cb,0x00000006,0x00000295,0x0000028c,
+0x00000293,0x00000294,0x0003003e,0x0000027f,
+0x00000295,0x000200f9,0x0000027e,0x000200f8,
+0x0000027e,0x0004003d,0x00000006,0x0000037e,
+0x0000025c,0x0003003e,0x00000380,0x0000037d,
+0x00050041,0x00000007,0x00000381,0x00000380,
+0x0000037e,0x0004003d,0x00000006,0x00000382,
+0x00000381,0x0003003e,0x00000296,0x00000382,
+0x0004003d,0x00000006,0x00000383,0x00000296,
+0x0004003d,0x00000006,0x00000384,0x00000024,
+0x0004007c,0x00000056,0x00000385,0x00000384,
+0x00050084,0x00000056,0x00000386,0x000000ba,
+0x00000385,0x000600cb,0x00000006,0x00000387,
+0x00000383,0x00000386,0x000000ba,0x0004003d,
+0x00000006,0x00000388,0x00000023,0x000500c4,
+0x00000006,0x00000389,0x00000387,0x00000388,
+0x0004003d,0x00000006,0x0000038a,0x0000027f,
+0x000500c5,0x00000006,0x0000038b,0x00000389,
+0x0000038a,0x000200fe,0x0000038b,0x00010038,
+0x00050036,0x00000006,0x0000002b,0x00000000,
+0x00000020,0x00030037,0x00000012,0x00000027,
+0x00030037,0x00000007,0x00000028,0x00030037,
+0x00000007,0x00000029,0x00030037,0x00000007,
+0x0000002a,0x000200f8,0x0000002c,0x0004003b,
+0x0000024c,0x0000038e,0x00000007,0x0004003b,
+0x00000007,0x00000391,0x00000007,0x0004003b,
+0x00000012,0x00000395,0x00000007,0x0004003b,
+0x00000007,0x00000397,0x00000007,0x0004003b,
+0x00000007,0x00000399,0x00000007,0x0004003b,
+0x00000007,0x0000039b,0x00000007,0x0004003b,
+0x00000007,0x000003ad,0x00000007,0x0004003b,
+0x00000007,0x000003b9,0x00000007,0x0004003b,
+0x000003f0,0x000003f1,0x00000007,0x0004003d,
+0x00000006,0x0000038f,0x00000029,0x0004007c,
+0x00000056,0x00000390,0x0000038f,0x0003003e,
+0x0000038e,0x00000390,0x0004003d,0x00000006,
+0x00000392,0x00000029,0x00050084,0x00000006,
+0x00000393,0x00000097,0x00000392,0x00050080,
+0x00000006,0x00000394,0x00000393,0x0000008f,
+0x0004003d,0x00000011,0x00000396,0x00000027,
+0x0003003e,0x00000395,0x00000396,0x0004003d,
+0x00000006,0x00000398,0x00000028,0x0003003e,
+0x00000397,0x00000398,0x0003003e,0x00000399,
+0x00000394,0x00070039,0x00000006,0x0000039a,
+0x00000017,0x00000395,0x00000397,0x00000399,
+0x0003003e,0x00000391,0x0000039a,0x0004003d,
+0x00000006,0x0000039c,0x00000391,0x0004003d,
+0x00000056,0x0000039d,0x0000038e,0x000600cb,
+0x00000006,0x0000039e,0x0000039c,0x0000039d,
+0x0000015e,0x0004003d,0x00000006,0x0000039f,
+0x00000391,0x0004003d,0x00000056,0x000003a0,
+0x0000038e,0x00050084,0x00000056,0x000003a1,
+0x000000ba,0x000003a0,0x00050080,0x00000056,
+0x000003a2,0x000003a1,0x0000015e,0x000600cb,
+0x00000006,0x000003a3,0x0000039f,0x000003a2,
+0x000000ba,0x000500c4,0x00000006,0x000003a4,
+0x000003a3,0x0000015e,0x000500c5,0x00000006,
+0x000003a5,0x0000039e,0x000003a4,0x0004003d,
+0x00000006,0x000003a6,0x00000391,0x0004003d,
+0x00000056,0x000003a7,0x0000038e,0x00050084,
+0x00000056,0x000003a8,0x0000015e,0x000003a7,
+0x00050080,0x00000056,0x000003a9,0x000003a8,
+0x000000c9,0x000600cb,0x00000006,0x000003aa,
+0x000003a6,0x000003a9,0x000000ba,0x000500c4,
+0x00000006,0x000003ab,0x000003aa,0x000000c9,
+0x000500c5,0x00000006,0x000003ac,0x000003a5,
+0x000003ab,0x0003003e,0x0000039b,0x000003ac,
+0x0004003d,0x00000006,0x000003ae,0x00000391,
+0x0004003d,0x00000006,0x000003af,0x0000002a,
+0x0004007c,0x00000056,0x000003b0,0x000003af,
+0x0004003d,0x00000056,0x000003b1,0x0000038e,
+0x00050084,0x00000056,0x000003b2,0x000003b0,
+0x000003b1,0x0004003d,0x00000006,0x000003b4,
+0x0000002a,0x0005004d,0x00000056,0x000003b5,
+0x000003b3,0x000003b4,0x00050080,0x00000056,
+0x000003b6,0x000003b2,0x000003b5,0x0004003d,
+0x00000056,0x000003b7,0x0000038e,0x000600cb,
+0x00000006,0x000003b8,0x000003ae,0x000003b6,
+0x000003b7,0x0003003e,0x000003ad,0x000003b8,
+0x0004003d,0x00000006,0x000003ef,0x0000039b,
+0x0003003e,0x000003f1,0x000003ee,0x00050041,
+0x00000007,0x000003f2,0x000003f1,0x000003ef,
+0x0004003d,0x00000006,0x000003f3,0x000003f2,
+0x0003003e,0x000003b9,0x000003f3,0x0004003d,
+0x00000006,0x000003f4,0x000003b9,0x0004003d,
+0x00000006,0x000003f5,0x0000002a,0x0004007c,
+0x00000056,0x000003f6,0x000003f5,0x00050084,
+0x00000056,0x000003f7,0x0000015e,0x000003f6,
+0x000600cb,0x00000006,0x000003f8,0x000003f4,
+0x000003f7,0x0000015e,0x0004003d,0x00000006,
+0x000003f9,0x00000029,0x000500c4,0x00000006,
+0x000003fa,0x000003f8,0x000003f9,0x0004003d,
+0x00000006,0x000003fb,0x000003ad,0x000500c5,
+0x00000006,0x000003fc,0x000003fa,0x000003fb,
+0x000200fe,0x000003fc,0x00010038,0x00050036,
+0x00000006,0x00000032,0x00000000,0x0000002d,
+0x00030037,0x00000012,0x0000002e,0x00030037,
+0x00000009,0x0000002f,0x00030037,0x00000007,
+0x00000030,0x00030037,0x00000007,0x00000031,
+0x000200f8,0x00000033,0x0004003b,0x00000007,
+0x00000405,0x00000007,0x0004003b,0x00000007,
+0x0000040d,0x00000007,0x0004003b,0x00000007,
+0x00000414,0x00000007,0x0004003b,0x00000012,
+0x00000417,0x00000007,0x0004003b,0x00000007,
+0x00000419,0x00000007,0x0004003b,0x00000007,
+0x0000041b,0x00000007,0x0004003b,0x00000007,
+0x0000041d,0x00000007,0x0004003b,0x00000435,
+0x00000436,0x00000007,0x0004003b,0x00000007,
+0x00000440,0x00000007,0x0004003b,0x00000007,
+0x00000447,0x00000007,0x0004003b,0x00000012,
+0x0000044a,0x00000007,0x0004003b,0x00000007,
+0x0000044c,0x00000007,0x0004003b,0x00000007,
+0x0000044e,0x00000007,0x0004003b,0x00000007,
+0x00000450,0x00000007,0x0004003b,0x00000463,
+0x00000464,0x00000007,0x0004003b,0x00000007,
+0x00000469,0x00000007,0x0004003b,0x00000007,
+0x0000046d,0x00000007,0x0004003b,0x00000012,
+0x0000046e,0x00000007,0x0004003b,0x00000007,
+0x00000470,0x00000007,0x0004003b,0x00000007,
+0x00000472,0x00000007,0x0004003b,0x00000035,
+0x00000475,0x00000007,0x0004003b,0x00000480,
+0x00000481,0x00000007,0x0004003d,0x00000006,
+0x000003ff,0x00000031,0x0004003d,0x00000006,
+0x00000400,0x00000030,0x000500ae,0x00000084,
+0x00000401,0x000003ff,0x00000400,0x000300f7,
+0x00000403,0x00000000,0x000400fa,0x00000401,
+0x00000402,0x00000403,0x000200f8,0x00000402,
+0x000200fe,0x0000009e,0x000200f8,0x00000403,
+0x00050041,0x00000007,0x00000406,0x0000002f,
+0x00000093,0x0004003d,0x00000006,0x00000407,
+0x00000406,0x0003003e,0x00000405,0x00000407,
+0x00050041,0x00000007,0x00000408,0x0000002f,
+0x0000009e,0x0004003d,0x00000006,0x00000409,
+0x00000408,0x000500aa,0x00000084,0x0000040a,
+0x00000409,0x000000a1,0x000300f7,0x0000040c,
+0x00000000,0x000400fa,0x0000040a,0x0000040b,
+0x0000043a,0x000200f8,0x0000040b,0x0004003d,
+0x00000006,0x0000040e,0x00000031,0x00050086,
+0x00000006,0x0000040f,0x0000040e,0x00000096,
+0x0004003d,0x00000006,0x00000410,0x00000405,
+0x00050084,0x00000006,0x00000411,0x00000096,
+0x00000410,0x00050080,0x00000006,0x00000412,
+0x00000411,0x0000008e,0x00050084,0x00000006,
+0x00000413,0x0000040f,0x00000412,0x0003003e,
+0x0000040d,0x00000413,0x0004003d,0x00000006,
+0x00000415,0x00000031,0x00050089,0x00000006,
+0x00000416,0x00000415,0x00000096,0x0004003d,
+0x00000011,0x00000418,0x0000002e,0x0003003e,
+0x00000417,0x00000418,0x0004003d,0x00000006,
+0x0000041a,0x0000040d,0x0003003e,0x00000419,
+0x0000041a,0x0004003d,0x00000006,0x0000041c,
+0x00000405,0x0003003e,0x0000041b,0x0000041c,
+0x0003003e,0x0000041d,0x00000416,0x00080039,
+0x00000006,0x0000041e,0x00000025,0x00000417,
+0x00000419,0x0000041b,0x0000041d,0x0003003e,
+0x00000414,0x0000041e,0x0004003d,0x00000006,
+0x0000042e,0x00000405,0x000500c4,0x00000056,
+0x0000042f,0x000000c4,0x0000042e,0x00050082,
+0x00000056,0x00000430,0x0000042f,0x000000c4,
+0x00050084,0x00000056,0x00000431,0x0000015e,
+0x00000430,0x0004007c,0x00000006,0x00000432,
+0x00000431,0x0004003d,0x00000006,0x00000433,
+0x00000414,0x00050080,0x00000006,0x00000434,
+0x00000432,0x00000433,0x0003003e,0x00000436,
+0x0000042d,0x00050041,0x00000007,0x00000437,
+0x00000436,0x00000434,0x0004003d,0x00000006,
+0x00000438,0x00000437,0x000200fe,0x00000438,
+0x000200f8,0x0000043a,0x00050041,0x00000007,
+0x0000043b,0x0000002f,0x000000a1,0x0004003d,
+0x00000006,0x0000043c,0x0000043b,0x000500aa,
+0x00000084,0x0000043d,0x0000043c,0x000000a1,
+0x000300f7,0x0000043f,0x00000000,0x000400fa,
+0x0000043d,0x0000043e,0x00000468,0x000200f8,
+0x0000043e,0x0004003d,0x00000006,0x00000441,
+0x00000031,0x00050086,0x00000006,0x00000442,
+0x00000441,0x00000097,0x0004003d,0x00000006,
+0x00000443,0x00000405,0x00050084,0x00000006,
+0x00000444,0x00000097,0x00000443,0x00050080,
+0x00000006,0x00000445,0x00000444,0x0000008f,
+0x00050084,0x00000006,0x00000446,0x00000442,
+0x00000445,0x0003003e,0x00000440,0x00000446,
+0x0004003d,0x00000006,0x00000448,0x00000031,
+0x00050089,0x00000006,0x00000449,0x00000448,
+0x00000097,0x0004003d,0x00000011,0x0000044b,
+0x0000002e,0x0003003e,0x0000044a,0x0000044b,
+0x0004003d,0x00000006,0x0000044d,0x00000440,
+0x0003003e,0x0000044c,0x0000044d,0x0004003d,
+0x00000006,0x0000044f,0x00000405,0x0003003e,
+0x0000044e,0x0000044f,0x0003003e,0x00000450,
+0x00000449,0x00080039,0x00000006,0x00000451,
+0x0000002b,0x0000044a,0x0000044c,0x0000044e,
+0x00000450,0x0003003e,0x00000447,0x00000451,
+0x0004003d,0x00000006,0x0000045c,0x00000405,
+0x000500c4,0x00000056,0x0000045d,0x000000c4,
+0x0000045c,0x00050082,0x00000056,0x0000045e,
+0x0000045d,0x000000c4,0x00050084,0x00000056,
+0x0000045f,0x000000c9,0x0000045e,0x0004007c,
+0x00000006,0x00000460,0x0000045f,0x0004003d,
+0x00000006,0x00000461,0x00000447,0x00050080,
+0x00000006,0x00000462,0x00000460,0x00000461,
+0x0003003e,0x00000464,0x0000045b,0x00050041,
+0x00000007,0x00000465,0x00000464,0x00000462,
+0x0004003d,0x00000006,0x00000466,0x00000465,
+0x000200fe,0x00000466,0x000200f8,0x00000468,
+0x0004003d,0x00000006,0x0000046a,0x00000031,
+0x0004003d,0x00000006,0x0000046b,0x00000405,
+0x00050084,0x00000006,0x0000046c,0x0000046a,
+0x0000046b,0x0003003e,0x00000469,0x0000046c,
+0x0004003d,0x00000011,0x0000046f,0x0000002e,
+0x0003003e,0x0000046e,0x0000046f,0x0004003d,
+0x00000006,0x00000471,0x00000469,0x0003003e,
+0x00000470,0x00000471,0x0004003d,0x00000006,
+0x00000473,0x00000405,0x0003003e,0x00000472,
+0x00000473,0x00070039,0x00000006,0x00000474,
+0x00000017,0x0000046e,0x00000470,0x00000472,
+0x0003003e,0x0000046d,0x00000474,0x0004003d,
+0x00000006,0x0000047e,0x00000405,0x00050082,
+0x00000006,0x0000047f,0x0000047e,0x000000a1,
+0x0003003e,0x00000481,0x0000047d,0x00050041,
+0x00000035,0x00000482,0x00000481,0x0000047f,
+0x0004003d,0x00000034,0x00000483,0x00000482,
+0x0003003e,0x00000475,0x00000483,0x0004003d,
+0x00000006,0x00000484,0x0000046d,0x00050041,
+0x00000007,0x00000485,0x00000475,0x0000009e,
+0x0004003d,0x00000006,0x00000486,0x00000485,
+0x00050084,0x00000006,0x00000487,0x00000484,
+0x00000486,0x0004003d,0x00000006,0x00000488,
+0x0000046d,0x00050041,0x00000007,0x00000489,
+0x00000475,0x000000a1,0x0004003d,0x00000006,
+0x0000048a,0x00000489,0x000500c2,0x00000006,
+0x0000048b,0x00000488,0x0000048a,0x000500c5,
+0x00000006,0x0000048c,0x00000487,0x0000048b,
+0x0003003e,0x0000046d,0x0000048c,0x0004003d,
+0x00000006,0x0000048d,0x0000046d,0x000500ac,
+0x00000084,0x0000048e,0x0000048d,0x000001a0,
+0x000300f7,0x00000490,0x00000000,0x000400fa,
+0x0000048e,0x0000048f,0x00000490,0x000200f8,
+0x0000048f,0x0004003d,0x00000006,0x00000491,
+0x0000046d,0x00050080,0x00000006,0x00000492,
+0x00000491,0x000000a1,0x0003003e,0x0000046d,
+0x00000492,0x000200f9,0x00000490,0x000200f8,
+0x00000490,0x0004003d,0x00000006,0x00000493,
+0x0000046d,0x000200fe,0x00000493,0x000200f8,
+0x0000043f,0x000100ff,0x000200f8,0x0000040c,
+0x000100ff,0x00010038,0x00050036,0x00000006,
+0x0000003f,0x00000000,0x00000036,0x00030037,
+0x00000012,0x00000037,0x00030037,0x00000009,
+0x00000038,0x00030037,0x00000007,0x00000039,
+0x00030037,0x00000007,0x0000003a,0x00030037,
+0x00000007,0x0000003b,0x00030037,0x00000007,
+0x0000003c,0x00030037,0x00000007,0x0000003d,
+0x00030037,0x00000035,0x0000003e,0x000200f8,
+0x00000040,0x0004003b,0x00000012,0x00000496,
+0x00000007,0x0004003b,0x00000012,0x000004a4,
+0x00000007,0x0004003b,0x00000012,0x000004a5,
+0x00000007,0x0004003b,0x00000009,0x000004a7,
+0x00000007,0x0004003b,0x00000007,0x000004a9,
+0x00000007,0x0004003b,0x00000007,0x000004ab,
+0x00000007,0x0004003b,0x00000012,0x000004af,
+0x00000007,0x0004003b,0x00000009,0x000004b1,
+0x00000007,0x0004003b,0x00000007,0x000004b3,
+0x00000007,0x0004003b,0x00000007,0x000004b5,
+0x00000007,0x0004003b,0x00000012,0x000004b9,
+0x00000007,0x0004003b,0x00000009,0x000004bb,
+0x00000007,0x0004003b,0x00000007,0x000004bd,
+0x00000007,0x0004003b,0x00000007,0x000004bf,
+0x00000007,0x0004003b,0x00000012,0x000004c3,
+0x00000007,0x0004003b,0x00000009,0x000004c5,
+0x00000007,0x0004003b,0x00000007,0x000004c7,
+0x00000007,0x0004003b,0x00000007,0x000004c9,
+0x00000007,0x0004003b,0x00000007,0x000004ce,
+0x00000007,0x0004003b,0x00000012,0x000004d6,
+0x00000007,0x0004003d,0x00000006,0x00000497,
+0x0000003c,0x0004003d,0x00000006,0x00000498,
+0x0000003a,0x00070050,0x00000011,0x00000499,
+0x00000498,0x00000498,0x00000498,0x00000498,
+0x0004003d,0x00000006,0x0000049a,0x0000003b,
+0x0004003d,0x00000006,0x0000049b,0x0000003b,
+0x00050080,0x00000006,0x0000049c,0x0000049b,
+0x000000a1,0x00070050,0x00000011,0x0000049d,
+0x0000009e,0x000000a1,0x0000049a,0x0000049c,
+0x00050080,0x00000011,0x0000049e,0x00000499,
+0x0000049d,0x00070050,0x00000011,0x0000049f,
+0x00000497,0x00000497,0x00000497,0x00000497,
+0x00050084,0x00000011,0x000004a0,0x0000049f,
+0x0000049e,0x0004003d,0x00000006,0x000004a1,
+0x0000003d,0x00070050,0x00000011,0x000004a2,
+0x000004a1,0x000004a1,0x000004a1,0x000004a1,
+0x00050080,0x00000011,0x000004a3,0x000004a0,
+0x000004a2,0x0003003e,0x00000496,0x000004a3,
+0x0004003d,0x00000011,0x000004a6,0x00000037,
+0x0003003e,0x000004a5,0x000004a6,0x0004003d,
+0x00000008,0x000004a8,0x00000038,0x0003003e,
+0x000004a7,0x000004a8,0x0004003d,0x00000006,
+0x000004aa,0x00000039,0x0003003e,0x000004a9,
+0x000004aa,0x00050041,0x00000007,0x000004ac,
+0x00000496,0x0000009e,0x0004003d,0x00000006,
+0x000004ad,0x000004ac,0x0003003e,0x000004ab,
+0x000004ad,0x00080039,0x00000006,0x000004ae,
+0x00000032,0x000004a5,0x000004a7,0x000004a9,
+0x000004ab,0x0004003d,0x00000011,0x000004b0,
+0x00000037,0x0003003e,0x000004af,0x000004b0,
+0x0004003d,0x00000008,0x000004b2,0x00000038,
+0x0003003e,0x000004b1,0x000004b2,0x0004003d,
+0x00000006,0x000004b4,0x00000039,0x0003003e,
+0x000004b3,0x000004b4,0x00050041,0x00000007,
+0x000004b6,0x00000496,0x000000a1,0x0004003d,
+0x00000006,0x000004b7,0x000004b6,0x0003003e,
+0x000004b5,0x000004b7,0x00080039,0x00000006,
+0x000004b8,0x00000032,0x000004af,0x000004b1,
+0x000004b3,0x000004b5,0x0004003d,0x00000011,
+0x000004ba,0x00000037,0x0003003e,0x000004b9,
+0x000004ba,0x0004003d,0x00000008,0x000004bc,
+0x00000038,0x0003003e,0x000004bb,0x000004bc,
+0x0004003d,0x00000006,0x000004be,0x00000039,
+0x0003003e,0x000004bd,0x000004be,0x00050041,
+0x00000007,0x000004c0,0x00000496,0x00000093,
+0x0004003d,0x00000006,0x000004c1,0x000004c0,
+0x0003003e,0x000004bf,0x000004c1,0x00080039,
+0x00000006,0x000004c2,0x00000032,0x000004b9,
+0x000004bb,0x000004bd,0x000004bf,0x0004003d,
+0x00000011,0x000004c4,0x00000037,0x0003003e,
+0x000004c3,0x000004c4,0x0004003d,0x00000008,
+0x000004c6,0x00000038,0x0003003e,0x000004c5,
+0x000004c6,0x0004003d,0x00000006,0x000004c8,
+0x00000039,0x0003003e,0x000004c7,0x000004c8,
+0x00050041,0x00000007,0x000004ca,0x00000496,
+0x00000097,0x0004003d,0x00000006,0x000004cb,
+0x000004ca,0x0003003e,0x000004c9,0x000004cb,
+0x00080039,0x00000006,0x000004cc,0x00000032,
+0x000004c3,0x000004c5,0x000004c7,0x000004c9,
+0x00070050,0x00000011,0x000004cd,0x000004ae,
+0x000004b8,0x000004c2,0x000004cc,0x0003003e,
+0x000004a4,0x000004cd,0x00050041,0x00000007,
+0x000004cf,0x0000003e,0x0000009e,0x0004003d,
+0x00000006,0x000004d0,0x000004cf,0x00050041,
+0x00000007,0x000004d1,0x0000003e,0x000000a1,
+0x0004003d,0x00000006,0x000004d2,0x000004d1,
+0x00050084,0x00000006,0x000004d3,0x000004d0,
+0x000004d2,0x00050080,0x00000006,0x000004d4,
+0x000004d3,0x0000008e,0x000500c2,0x00000006,
+0x000004d5,0x000004d4,0x000000c3,0x0003003e,
+0x000004ce,0x000004d5,0x00050041,0x00000007,
+0x000004d7,0x0000003e,0x0000009e,0x0004003d,
+0x00000006,0x000004d8,0x000004d7,0x00050082,
+0x00000006,0x000004d9,0x0000014d,0x000004d8,
+0x00050041,0x00000007,0x000004da,0x0000003e,
+0x000000a1,0x0004003d,0x00000006,0x000004db,
+0x000004da,0x00050082,0x00000006,0x000004dc,
+0x000004d9,0x000004db,0x0004003d,0x00000006,
+0x000004dd,0x000004ce,0x00050080,0x00000006,
+0x000004de,0x000004dc,0x000004dd,0x00050041,
+0x00000007,0x000004df,0x0000003e,0x0000009e,
+0x0004003d,0x00000006,0x000004e0,0x000004df,
+0x0004003d,0x00000006,0x000004e1,0x000004ce,
+0x00050082,0x00000006,0x000004e2,0x000004e0,
+0x000004e1,0x00050041,0x00000007,0x000004e3,
+0x0000003e,0x000000a1,0x0004003d,0x00000006,
+0x000004e4,0x000004e3,0x0004003d,0x00000006,
+0x000004e5,0x000004ce,0x00050082,0x00000006,
+0x000004e6,0x000004e4,0x000004e5,0x0004003d,
+0x00000006,0x000004e7,0x000004ce,0x00070050,
+0x00000011,0x000004e8,0x000004de,0x000004e2,
+0x000004e6,0x000004e7,0x0003003e,0x000004d6,
+0x000004e8,0x0004003d,0x00000011,0x000004e9,
+0x000004a4,0x00040070,0x000004eb,0x000004ec,
+0x000004e9,0x0004003d,0x00000011,0x000004ed,
+0x000004d6,0x00040070,0x000004eb,0x000004ee,
+0x000004ed,0x00050094,0x000004ea,0x000004ef,
+0x000004ec,0x000004ee,0x00050081,0x000004ea,
+0x000004f1,0x000004ef,0x000004f0,0x0004006d,
+0x00000006,0x000004f2,0x000004f1,0x000500c2,
+0x00000006,0x000004f3,0x000004f2,0x000000c3,
+0x000200fe,0x000004f3,0x00010038,0x00050036,
+0x00000034,0x00000044,0x00000000,0x00000041,
+0x00030037,0x00000012,0x00000042,0x00030037,
+0x00000034,0x00000043,0x000200f8,0x00000045,
+0x0004003b,0x00000035,0x000004f6,0x00000007,
+0x0004003b,0x00000035,0x00000503,0x00000007,
+0x0004003b,0x00000035,0x00000506,0x00000007,
+0x0004003b,0x00000035,0x00000511,0x00000007,
+0x0004003b,0x00000035,0x00000515,0x00000007,
+0x0004003b,0x00000007,0x0000051a,0x00000007,
+0x0004003b,0x00000007,0x0000051d,0x00000007,
+0x0004003b,0x00000035,0x00000525,0x00000007,
+0x0004003b,0x00000012,0x0000052b,0x00000007,
+0x0004003b,0x00000009,0x0000052d,0x00000007,
+0x0004003b,0x00000007,0x0000052f,0x00000007,
+0x0004003b,0x00000007,0x00000531,0x00000007,
+0x0004003b,0x00000007,0x00000533,0x00000007,
+0x0004003b,0x00000007,0x00000535,0x00000007,
+0x0004003b,0x00000007,0x00000536,0x00000007,
+0x0004003b,0x00000035,0x00000537,0x00000007,
+0x0004003b,0x00000012,0x0000053e,0x00000007,
+0x0004003b,0x00000009,0x00000540,0x00000007,
+0x0004003b,0x00000007,0x00000542,0x00000007,
+0x0004003b,0x00000007,0x00000544,0x00000007,
+0x0004003b,0x00000007,0x00000546,0x00000007,
+0x0004003b,0x00000007,0x00000548,0x00000007,
+0x0004003b,0x00000007,0x00000549,0x00000007,
+0x0004003b,0x00000035,0x0000054a,0x00000007,
+0x00050041,0x00000142,0x000004f8,0x00000141,
+0x000000b9,0x0004003d,0x00000034,0x000004f9,
+0x000004f8,0x00050050,0x00000034,0x000004fa,
+0x00000093,0x00000093,0x00050086,0x00000034,
+0x000004fb,0x000004f9,0x000004fa,0x00050050,
+0x00000034,0x000004fc,0x000004f7,0x000004f7,
+0x00050080,0x00000034,0x000004fd,0x000004fc,
+0x000004fb,0x00050041,0x00000142,0x000004fe,
+0x00000141,0x000000b9,0x0004003d,0x00000034,
+0x000004ff,0x000004fe,0x00050050,0x00000034,
+0x00000500,0x000000a1,0x000000a1,0x00050082,
+0x00000034,0x00000501,0x000004ff,0x00000500,
+0x00050086,0x00000034,0x00000502,0x000004fd,
+0x00000501,0x0003003e,0x000004f6,0x00000502,
+0x0004003d,0x00000034,0x00000504,0x000004f6,
+0x00050084,0x00000034,0x00000505,0x00000043,
+0x00000504,0x0003003e,0x00000503,0x00000505,
+0x0004003d,0x00000034,0x00000507,0x00000503,
+0x0004003d,0x00000034,0x00000508,0x000000eb,
+0x00050050,0x00000034,0x00000509,0x000000a1,
+0x000000a1,0x00050082,0x00000034,0x0000050a,
+0x00000508,0x00000509,0x00050084,0x00000034,
+0x0000050b,0x00000507,0x0000050a,0x00050050,
+0x00000034,0x0000050c,0x000001a0,0x000001a0,
+0x00050080,0x00000034,0x0000050d,0x0000050b,
+0x0000050c,0x00050050,0x0000007f,0x0000050f,
+0x0000050e,0x0000050e,0x000500c2,0x00000034,
+0x00000510,0x0000050d,0x0000050f,0x0003003e,
+0x00000506,0x00000510,0x0004003d,0x00000034,
+0x00000512,0x00000506,0x00050050,0x0000007f,
+0x00000513,0x000000c3,0x000000c3,0x000500c2,
+0x00000034,0x00000514,0x00000512,0x00000513,
+0x0003003e,0x00000511,0x00000514,0x0004003d,
+0x00000034,0x00000516,0x00000506,0x00050050,
+0x00000034,0x00000518,0x00000517,0x00000517,
+0x000500c7,0x00000034,0x00000519,0x00000516,
+0x00000518,0x0003003e,0x00000515,0x00000519,
+0x00050041,0x000000ab,0x0000051b,0x000000eb,
+0x0000009e,0x0004003d,0x00000006,0x0000051c,
+0x0000051b,0x0003003e,0x0000051a,0x0000051c,
+0x00050041,0x00000007,0x0000051e,0x00000511,
+0x000000a1,0x0004003d,0x00000006,0x0000051f,
+0x0000051e,0x0004003d,0x00000006,0x00000520,
+0x0000051a,0x00050084,0x00000006,0x00000521,
+0x0000051f,0x00000520,0x00050041,0x00000007,
+0x00000522,0x00000511,0x0000009e,0x0004003d,
+0x00000006,0x00000523,0x00000522,0x00050080,
+0x00000006,0x00000524,0x00000521,0x00000523,
+0x0003003e,0x0000051d,0x00000524,0x0003003e,
+0x00000525,0x00000526,0x0004003d,0x00000084,
+0x00000527,0x000000d5,0x000600a9,0x00000056,
+0x00000528,0x00000527,0x000000c4,0x000000b9,
+0x000500c4,0x00000056,0x00000529,0x000000c4,
+0x00000528,0x0004007c,0x00000006,0x0000052a,
+0x00000529,0x0004003d,0x00000011,0x0000052c,
+0x00000042,0x0003003e,0x0000052b,0x0000052c,
+0x0004003d,0x00000008,0x0000052e,0x0000014c,
+0x0003003e,0x0000052d,0x0000052e,0x0004003d,
+0x00000006,0x00000530,0x00000166,0x0003003e,
+0x0000052f,0x00000530,0x0004003d,0x00000006,
+0x00000532,0x0000051d,0x0003003e,0x00000531,
+0x00000532,0x0004003d,0x00000006,0x00000534,
+0x0000051a,0x0003003e,0x00000533,0x00000534,
+0x0003003e,0x00000535,0x0000052a,0x0003003e,
+0x00000536,0x0000009e,0x0004003d,0x00000034,
+0x00000538,0x00000515,0x0003003e,0x00000537,
+0x00000538,0x000c0039,0x00000006,0x00000539,
+0x0000003f,0x0000052b,0x0000052d,0x0000052f,
+0x00000531,0x00000533,0x00000535,0x00000536,
+0x00000537,0x00050041,0x00000007,0x0000053a,
+0x00000525,0x0000009e,0x0003003e,0x0000053a,
+0x00000539,0x0004003d,0x00000084,0x0000053b,
+0x000000d5,0x000300f7,0x0000053d,0x00000000,
+0x000400fa,0x0000053b,0x0000053c,0x0000053d,
+0x000200f8,0x0000053c,0x0004003d,0x00000011,
+0x0000053f,0x00000042,0x0003003e,0x0000053e,
+0x0000053f,0x0004003d,0x00000008,0x00000541,
+0x0000014c,0x0003003e,0x00000540,0x00000541,
+0x0004003d,0x00000006,0x00000543,0x00000166,
+0x0003003e,0x00000542,0x00000543,0x0004003d,
+0x00000006,0x00000545,0x0000051d,0x0003003e,
+0x00000544,0x00000545,0x0004003d,0x00000006,
+0x00000547,0x0000051a,0x0003003e,0x00000546,
+0x00000547,0x0003003e,0x00000548,0x00000093,
+0x0003003e,0x00000549,0x000000a1,0x0004003d,
+0x00000034,0x0000054b,0x00000515,0x0003003e,
+0x0000054a,0x0000054b,0x000c0039,0x00000006,
+0x0000054c,0x0000003f,0x0000053e,0x00000540,
+0x00000542,0x00000544,0x00000546,0x00000548,
+0x00000549,0x0000054a,0x00050041,0x00000007,
+0x0000054d,0x00000525,0x000000a1,0x0003003e,
+0x0000054d,0x0000054c,0x000200f9,0x0000053d,
+0x000200f8,0x0000053d,0x0004003d,0x00000034,
+0x0000054e,0x00000525,0x000200fe,0x0000054e,
+0x00010038,0x00050036,0x00000006,0x00000048,
+0x00000000,0x00000046,0x00030037,0x00000007,
+0x00000047,0x000200f8,0x00000049,0x0004003d,
+0x00000006,0x00000551,0x00000047,0x000500c2,
+0x00000006,0x00000553,0x00000551,0x00000552,
+0x0004003d,0x00000006,0x00000554,0x00000047,
+0x000500c6,0x00000006,0x00000555,0x00000554,
+0x00000553,0x0003003e,0x00000047,0x00000555,
+0x0004003d,0x00000006,0x00000556,0x00000047,
+0x000500c4,0x00000006,0x00000558,0x00000556,
+0x00000557,0x0004003d,0x00000006,0x00000559,
+0x00000047,0x00050082,0x00000006,0x0000055a,
+0x00000559,0x00000558,0x0003003e,0x00000047,
+0x0000055a,0x0004003d,0x00000006,0x0000055b,
+0x00000047,0x000500c4,0x00000006,0x0000055c,
+0x0000055b,0x000000ce,0x0004003d,0x00000006,
+0x0000055d,0x00000047,0x00050080,0x00000006,
+0x0000055e,0x0000055d,0x0000055c,0x0003003e,
+0x00000047,0x0000055e,0x0004003d,0x00000006,
+0x0000055f,0x00000047,0x000500c4,0x00000006,
+0x00000560,0x0000055f,0x000000c3,0x0004003d,
+0x00000006,0x00000561,0x00000047,0x00050080,
+0x00000006,0x00000562,0x00000561,0x00000560,
+0x0003003e,0x00000047,0x00000562,0x0004003d,
+0x00000006,0x00000563,0x00000047,0x000500c2,
+0x00000006,0x00000564,0x00000563,0x000000c9,
+0x0004003d,0x00000006,0x00000565,0x00000047,
+0x000500c6,0x00000006,0x00000566,0x00000565,
+0x00000564,0x0003003e,0x00000047,0x00000566,
+0x0004003d,0x00000006,0x00000567,0x00000047,
+0x000500c4,0x00000006,0x00000569,0x00000567,
+0x00000568,0x0004003d,0x00000006,0x0000056a,
+0x00000047,0x00050080,0x00000006,0x0000056b,
+0x0000056a,0x00000569,0x0003003e,0x00000047,
+0x0000056b,0x0004003d,0x00000006,0x0000056c,
+0x00000047,0x000500c2,0x00000006,0x0000056d,
+0x0000056c,0x000000ce,0x0004003d,0x00000006,
+0x0000056e,0x00000047,0x000500c6,0x00000006,
+0x0000056f,0x0000056e,0x0000056d,0x0003003e,
+0x00000047,0x0000056f,0x0004003d,0x00000006,
+0x00000570,0x00000047,0x000500c2,0x00000006,
+0x00000571,0x00000570,0x0000015e,0x0004003d,
+0x00000006,0x00000572,0x00000047,0x000500c6,
+0x00000006,0x00000573,0x00000572,0x00000571,
+0x0003003e,0x00000047,0x00000573,0x0004003d,
+0x00000006,0x00000574,0x00000047,0x000500c4,
+0x00000006,0x00000575,0x00000574,0x0000050e,
+0x0004003d,0x00000006,0x00000576,0x00000047,
+0x000500c6,0x00000006,0x00000577,0x00000576,
+0x00000575,0x0003003e,0x00000047,0x00000577,
+0x0004003d,0x00000006,0x00000578,0x00000047,
+0x000500c2,0x00000006,0x00000579,0x00000578,
+0x00000557,0x0004003d,0x00000006,0x0000057a,
+0x00000047,0x000500c6,0x00000006,0x0000057b,
+0x0000057a,0x00000579,0x0003003e,0x00000047,
+0x0000057b,0x0004003d,0x00000006,0x0000057c,
+0x00000047,0x000200fe,0x0000057c,0x00010038,
+0x00050036,0x00000006,0x0000004e,0x00000000,
+0x0000004a,0x00030037,0x00000007,0x0000004b,
+0x00030037,0x00000035,0x0000004c,0x00030037,
+0x00000007,0x0000004d,0x000200f8,0x0000004f,
+0x0004003b,0x00000007,0x00000592,0x00000007,
+0x0004003b,0x00000007,0x00000593,0x00000007,
+0x0004003b,0x00000012,0x00000596,0x00000007,
+0x0004003b,0x00000012,0x000005a2,0x00000007,
+0x0004003b,0x00000035,0x000005b5,0x00000007,
+0x0004003b,0x00000012,0x000005c0,0x00000007,
+0x0004003b,0x00000012,0x000005c4,0x00000007,
+0x0004003b,0x00000012,0x000005d3,0x00000007,
+0x0004003d,0x00000006,0x0000057f,0x0000004d,
+0x000500aa,0x00000084,0x00000580,0x0000057f,
+0x000000a1,0x000300f7,0x00000582,0x00000000,
+0x000400fa,0x00000580,0x00000581,0x00000582,
+0x000200f8,0x00000581,0x000200fe,0x0000009e,
+0x000200f8,0x00000582,0x00050041,0x00000584,
+0x00000585,0x00000141,0x000000ba,0x0004003d,
+0x00000006,0x00000586,0x00000585,0x000500ab,
+0x00000084,0x00000587,0x00000586,0x0000009e,
+0x000300f7,0x00000589,0x00000000,0x000400fa,
+0x00000587,0x00000588,0x00000589,0x000200f8,
+0x00000588,0x0004003d,0x00000034,0x0000058a,
+0x0000004c,0x00050050,0x0000007f,0x0000058b,
+0x000000c4,0x000000c4,0x000500c4,0x00000034,
+0x0000058c,0x0000058a,0x0000058b,0x0003003e,
+0x0000004c,0x0000058c,0x000200f9,0x00000589,
+0x000200f8,0x00000589,0x0004003d,0x00000006,
+0x0000058d,0x0000004d,0x00050084,0x00000006,
+0x0000058e,0x000004f7,0x0000058d,0x0004003d,
+0x00000006,0x0000058f,0x0000004b,0x00050082,
+0x00000006,0x00000590,0x0000058f,0x000004f7,
+0x00050080,0x00000006,0x00000591,0x0000058e,
+0x00000590,0x0003003e,0x0000004b,0x00000591,
+0x0004003d,0x00000006,0x00000594,0x0000004b,
+0x0003003e,0x00000593,0x00000594,0x00050039,
+0x00000006,0x00000595,0x00000048,0x00000593,
+0x0003003e,0x00000592,0x00000595,0x0004003d,
+0x00000006,0x00000597,0x00000592,0x000600cb,
+0x00000006,0x00000598,0x00000597,0x000000b9,
+0x000000c3,0x0004003d,0x00000006,0x00000599,
+0x00000592,0x000600cb,0x00000006,0x0000059a,
+0x00000599,0x000000c3,0x000000c3,0x0004003d,
+0x00000006,0x0000059b,0x00000592,0x000600cb,
+0x00000006,0x0000059d,0x0000059b,0x0000059c,
+0x000000c3,0x0004003d,0x00000006,0x0000059e,
+0x00000592,0x000600cb,0x00000006,0x000005a0,
+0x0000059e,0x0000059f,0x000000c3,0x00070050,
+0x00000011,0x000005a1,0x00000598,0x0000059a,
+0x0000059d,0x000005a0,0x0003003e,0x00000596,
+0x000005a1,0x0004003d,0x00000006,0x000005a3,
+0x00000592,0x000600cb,0x00000006,0x000005a4,
+0x000005a3,0x00000568,0x000000c3,0x0004003d,
+0x00000006,0x000005a5,0x00000592,0x000600cb,
+0x00000006,0x000005a7,0x000005a5,0x000005a6,
+0x000000c3,0x0004003d,0x00000006,0x000005a8,
+0x00000592,0x000600cb,0x00000006,0x000005aa,
+0x000005a8,0x000005a9,0x000000c3,0x0004003d,
+0x00000006,0x000005ab,0x00000592,0x000600cb,
+0x00000006,0x000005ad,0x000005ab,0x000005ac,
+0x000000c3,0x00070050,0x00000011,0x000005ae,
+0x000005a4,0x000005a7,0x000005aa,0x000005ad,
+0x0003003e,0x000005a2,0x000005ae,0x0004003d,
+0x00000011,0x000005af,0x00000596,0x0004003d,
+0x00000011,0x000005b0,0x00000596,0x00050084,
+0x00000011,0x000005b1,0x000005af,0x000005b0,
+0x0003003e,0x00000596,0x000005b1,0x0004003d,
+0x00000011,0x000005b2,0x000005a2,0x0004003d,
+0x00000011,0x000005b3,0x000005a2,0x00050084,
+0x00000011,0x000005b4,0x000005b2,0x000005b3,
+0x0003003e,0x000005a2,0x000005b4,0x0004003d,
+0x00000006,0x000005b6,0x0000004b,0x000500c7,
+0x00000006,0x000005b7,0x000005b6,0x00000093,
+0x000500ab,0x00000084,0x000005b8,0x000005b7,
+0x0000009e,0x000600a9,0x00000056,0x000005b9,
+0x000005b8,0x000000c3,0x000000c9,0x0004007c,
+0x00000006,0x000005ba,0x000005b9,0x0004003d,
+0x00000006,0x000005bb,0x0000004d,0x000500aa,
+0x00000084,0x000005bc,0x000005bb,0x00000097,
+0x000600a9,0x00000056,0x000005bd,0x000005bc,
+0x0000050e,0x000000c9,0x0004007c,0x00000006,
+0x000005be,0x000005bd,0x00050050,0x00000034,
+0x000005bf,0x000005ba,0x000005be,0x0003003e,
+0x000005b5,0x000005bf,0x0004003d,0x00000006,
+0x000005c1,0x0000004b,0x000500c7,0x00000006,
+0x000005c2,0x000005c1,0x000000a1,0x000500ab,
+0x00000084,0x000005c3,0x000005c2,0x0000009e,
+0x000300f7,0x000005c6,0x00000000,0x000400fa,
+0x000005c3,0x000005c5,0x000005c9,0x000200f8,
+0x000005c5,0x0004003d,0x00000034,0x000005c7,
+0x000005b5,0x0009004f,0x00000011,0x000005c8,
+0x000005c7,0x000005c7,0x00000000,0x00000001,
+0x00000000,0x00000001,0x0003003e,0x000005c4,
+0x000005c8,0x000200f9,0x000005c6,0x000200f8,
+0x000005c9,0x0004003d,0x00000034,0x000005ca,
+0x000005b5,0x0009004f,0x00000011,0x000005cb,
+0x000005ca,0x000005ca,0x00000001,0x00000000,
+0x00000001,0x00000000,0x0003003e,0x000005c4,
+0x000005cb,0x000200f9,0x000005c6,0x000200f8,
+0x000005c6,0x0004003d,0x00000011,0x000005cc,
+0x000005c4,0x0003003e,0x000005c0,0x000005cc,
+0x0004003d,0x00000011,0x000005cd,0x000005c0,
+0x0004003d,0x00000011,0x000005ce,0x00000596,
+0x000500c2,0x00000011,0x000005cf,0x000005ce,
+0x000005cd,0x0003003e,0x00000596,0x000005cf,
+0x0004003d,0x00000011,0x000005d0,0x000005c0,
+0x0004003d,0x00000011,0x000005d1,0x000005a2,
+0x000500c2,0x00000011,0x000005d2,0x000005d1,
+0x000005d0,0x0003003e,0x000005a2,0x000005d2,
+0x0004003d,0x00000011,0x000005d4,0x00000596,
+0x0007004f,0x00000034,0x000005d5,0x000005d4,
+0x000005d4,0x00000000,0x00000001,0x00040070,
+0x000005d6,0x000005d7,0x000005d5,0x0004003d,
+0x00000034,0x000005d8,0x0000004c,0x00040070,
+0x000005d6,0x000005d9,0x000005d8,0x00050094,
+0x000004ea,0x000005da,0x000005d7,0x000005d9,
+0x0004006d,0x00000006,0x000005db,0x000005da,
+0x0004003d,0x00000011,0x000005dc,0x00000596,
+0x0007004f,0x00000034,0x000005dd,0x000005dc,
+0x000005dc,0x00000002,0x00000003,0x00040070,
+0x000005d6,0x000005de,0x000005dd,0x0004003d,
+0x00000034,0x000005df,0x0000004c,0x00040070,
+0x000005d6,0x000005e0,0x000005df,0x00050094,
+0x000004ea,0x000005e1,0x000005de,0x000005e0,
+0x0004006d,0x00000006,0x000005e2,0x000005e1,
+0x0004003d,0x00000011,0x000005e3,0x000005a2,
+0x0007004f,0x00000034,0x000005e4,0x000005e3,
+0x000005e3,0x00000000,0x00000001,0x00040070,
+0x000005d6,0x000005e5,0x000005e4,0x0004003d,
+0x00000034,0x000005e6,0x0000004c,0x00040070,
+0x000005d6,0x000005e7,0x000005e6,0x00050094,
+0x000004ea,0x000005e8,0x000005e5,0x000005e7,
+0x0004006d,0x00000006,0x000005e9,0x000005e8,
+0x0004003d,0x00000011,0x000005ea,0x000005a2,
+0x0007004f,0x00000034,0x000005eb,0x000005ea,
+0x000005ea,0x00000002,0x00000003,0x00040070,
+0x000005d6,0x000005ec,0x000005eb,0x0004003d,
+0x00000034,0x000005ed,0x0000004c,0x00040070,
+0x000005d6,0x000005ee,0x000005ed,0x00050094,
+0x000004ea,0x000005ef,0x000005ec,0x000005ee,
+0x0004006d,0x00000006,0x000005f0,0x000005ef,
+0x00070050,0x00000011,0x000005f1,0x000005db,
+0x000005e2,0x000005e9,0x000005f0,0x0004003d,
+0x00000006,0x000005f2,0x00000592,0x00070050,
+0x00000011,0x000005f3,0x000005f2,0x000005f2,
+0x000005f2,0x000005f2,0x000500c2,0x00000011,
+0x000005f5,0x000005f3,0x000005f4,0x00050080,
+0x00000011,0x000005f6,0x000005f1,0x000005f5,
+0x0003003e,0x000005d3,0x000005f6,0x0004003d,
+0x00000011,0x000005f8,0x000005d3,0x000500c7,
+0x00000011,0x000005f9,0x000005f8,0x000005f7,
+0x0003003e,0x000005d3,0x000005f9,0x0004003d,
+0x00000006,0x000005fa,0x0000004d,0x000500aa,
+0x00000084,0x000005fb,0x000005fa,0x00000093,
+0x000300f7,0x000005fd,0x00000000,0x000400fa,
+0x000005fb,0x000005fc,0x00000602,0x000200f8,
+0x000005fc,0x00050041,0x00000007,0x000005fe,
+0x000005d3,0x00000093,0x00050051,0x00000006,
+0x000005ff,0x00000526,0x00000000,0x0003003e,
+0x000005fe,0x000005ff,0x00050041,0x00000007,
+0x00000600,0x000005d3,0x00000097,0x00050051,
+0x00000006,0x00000601,0x00000526,0x00000001,
+0x0003003e,0x00000600,0x00000601,0x000200f9,
+0x000005fd,0x000200f8,0x00000602,0x0004003d,
+0x00000006,0x00000603,0x0000004d,0x000500aa,
+0x00000084,0x00000604,0x00000603,0x00000097,
+0x000300f7,0x00000606,0x00000000,0x000400fa,
+0x00000604,0x00000605,0x00000606,0x000200f8,
+0x00000605,0x00050041,0x00000007,0x00000607,
+0x000005d3,0x00000097,0x0003003e,0x00000607,
+0x0000009e,0x000200f9,0x00000606,0x000200f8,
+0x00000606,0x000200f9,0x000005fd,0x000200f8,
+0x000005fd,0x00050041,0x00000007,0x00000608,
+0x000005d3,0x0000009e,0x0004003d,0x00000006,
+0x00000609,0x00000608,0x00060050,0x00000008,
+0x0000060a,0x00000609,0x00000609,0x00000609,
+0x0004003d,0x00000011,0x0000060b,0x000005d3,
+0x0008004f,0x00000008,0x0000060c,0x0000060b,
+0x0000060b,0x00000001,0x00000002,0x00000003,
+0x000500ae,0x0000060d,0x0000060e,0x0000060a,
+0x0000060c,0x0004009b,0x00000084,0x0000060f,
+0x0000060e,0x000300f7,0x00000611,0x00000000,
+0x000400fa,0x0000060f,0x00000610,0x00000613,
+0x000200f8,0x00000610,0x000200fe,0x0000009e,
+0x000200f8,0x00000613,0x00050041,0x00000007,
+0x00000614,0x000005d3,0x000000a1,0x0004003d,
+0x00000006,0x00000615,0x00000614,0x00050050,
+0x00000034,0x00000616,0x00000615,0x00000615,
+0x0004003d,0x00000011,0x00000617,0x000005d3,
+0x0007004f,0x00000034,0x00000618,0x00000617,
+0x00000617,0x00000002,0x00000003,0x000500ae,
+0x00000145,0x00000619,0x00000616,0x00000618,
+0x0004009b,0x00000084,0x0000061a,0x00000619,
+0x000300f7,0x0000061c,0x00000000,0x000400fa,
+0x0000061a,0x0000061b,0x0000061e,0x000200f8,
+0x0000061b,0x000200fe,0x000000a1,0x000200f8,
+0x0000061e,0x00050041,0x00000007,0x0000061f,
+0x000005d3,0x00000093,0x0004003d,0x00000006,
+0x00000620,0x0000061f,0x00050041,0x00000007,
+0x00000621,0x000005d3,0x00000097,0x0004003d,
+0x00000006,0x00000622,0x00000621,0x000500ae,
+0x00000084,0x00000623,0x00000620,0x00000622,
+0x000300f7,0x00000625,0x00000000,0x000400fa,
+0x00000623,0x00000624,0x00000627,0x000200f8,
+0x00000624,0x000200fe,0x00000093,0x000200f8,
+0x00000627,0x000200fe,0x00000097,0x000200f8,
+0x00000625,0x000100ff,0x000200f8,0x0000061c,
+0x000100ff,0x000200f8,0x00000611,0x000100ff,
+0x00010038,0x00050036,0x00000008,0x00000054,
+0x00000000,0x00000050,0x00030037,0x00000007,
+0x00000051,0x00030037,0x00000007,0x00000052,
+0x00030037,0x00000007,0x00000053,0x000200f8,
+0x00000055,0x0004003b,0x00000007,0x0000062a,
+0x00000007,0x0004003b,0x00000009,0x00000632,
+0x00000007,0x0004003b,0x0000063f,0x00000640,
+0x00000007,0x0004003b,0x00000007,0x00000643,
+0x00000007,0x0004003b,0x00000009,0x00000645,
+0x00000007,0x0003003e,0x0000062a,0x0000009e,
+0x000200f9,0x0000062b,0x000200f8,0x0000062b,
+0x000400f6,0x0000062d,0x0000062e,0x00000000,
+0x000200f9,0x0000062f,0x000200f8,0x0000062f,
+0x0004003d,0x00000006,0x00000630,0x0000062a,
+0x000500b0,0x00000084,0x00000631,0x00000630,
+0x000003bc,0x000400fa,0x00000631,0x0000062c,
+0x0000062d,0x000200f8,0x0000062c,0x0004003d,
+0x00000006,0x0000063e,0x0000062a,0x0003003e,
+0x00000640,0x0000063d,0x00050041,0x00000009,
+0x00000641,0x00000640,0x0000063e,0x0004003d,
+0x00000008,0x00000642,0x00000641,0x0003003e,
+0x00000632,0x00000642,0x0004003d,0x00000006,
+0x00000644,0x00000052,0x0003003e,0x00000643,
+0x00000644,0x0004003d,0x00000008,0x00000646,
+0x00000632,0x0003003e,0x00000645,0x00000646,
+0x00060039,0x00000006,0x00000647,0x0000000d,
+0x00000643,0x00000645,0x0003003e,0x00000053,
+0x00000647,0x0004003d,0x00000006,0x00000648,
+0x00000053,0x0004003d,0x00000006,0x00000649,
+0x00000051,0x000500b2,0x00000084,0x0000064a,
+0x00000648,0x00000649,0x000300f7,0x0000064c,
+0x00000000,0x000400fa,0x0000064a,0x0000064b,
+0x0000064c,0x000200f8,0x0000064b,0x0004003d,
+0x00000008,0x0000064d,0x00000632,0x000200fe,
+0x0000064d,0x000200f8,0x0000064c,0x000200f9,
+0x0000062e,0x000200f8,0x0000062e,0x0004003d,
+0x00000006,0x0000064f,0x0000062a,0x00050080,
+0x00000006,0x00000650,0x0000064f,0x000000c4,
+0x0003003e,0x0000062a,0x00000650,0x000200f9,
+0x0000062b,0x000200f8,0x0000062d,0x000200fe,
+0x0000014f,0x00010038,0x00050036,0x00000057,
+0x0000005b,0x00000000,0x00000059,0x00030037,
+0x00000058,0x0000005a,0x000200f8,0x0000005c,
+0x00050041,0x0000024c,0x00000653,0x0000005a,
+0x0000009e,0x0004003d,0x00000056,0x00000654,
+0x00000653,0x00050041,0x0000024c,0x00000655,
+0x0000005a,0x00000093,0x0004003d,0x00000056,
+0x00000656,0x00000655,0x00050080,0x00000056,
+0x00000657,0x00000654,0x00000656,0x000500c3,
+0x00000056,0x00000658,0x00000657,0x000000c4,
+0x00050041,0x0000024c,0x00000659,0x0000005a,
+0x000000a1,0x0004003d,0x00000056,0x0000065a,
+0x00000659,0x00050041,0x0000024c,0x0000065b,
+0x0000005a,0x00000093,0x0004003d,0x00000056,
+0x0000065c,0x0000065b,0x00050080,0x00000056,
+0x0000065d,0x0000065a,0x0000065c,0x000500c3,
+0x00000056,0x0000065e,0x0000065d,0x000000c4,
+0x0004003d,0x00000057,0x0000065f,0x0000005a,
+0x0007004f,0x0000007f,0x00000660,0x0000065f,
+0x0000065f,0x00000002,0x00000003,0x00050051,
+0x00000056,0x00000661,0x00000660,0x00000000,
+0x00050051,0x00000056,0x00000662,0x00000660,
+0x00000001,0x00070050,0x00000057,0x00000663,
+0x00000658,0x0000065e,0x00000661,0x00000662,
+0x000200fe,0x00000663,0x00010038,0x00050036,
+0x00000056,0x00000061,0x00000000,0x0000005f,
+0x00030037,0x0000005e,0x00000060,0x000200f8,
+0x00000062,0x00050041,0x0000024c,0x00000666,
+0x00000060,0x0000009e,0x0004003d,0x00000056,
+0x00000667,0x00000666,0x00050041,0x0000024c,
+0x00000668,0x00000060,0x000000a1,0x0004003d,
+0x00000056,0x00000669,0x00000668,0x00050080,
+0x00000056,0x0000066a,0x00000667,0x00000669,
+0x00050041,0x0000024c,0x0000066b,0x00000060,
+0x00000093,0x0004003d,0x00000056,0x0000066c,
+0x0000066b,0x00050080,0x00000056,0x0000066d,
+0x0000066a,0x0000066c,0x000200fe,0x0000066d,
+0x00010038,0x00050036,0x00000002,0x00000066,
+0x00000000,0x00000063,0x00030037,0x00000058,
+0x00000064,0x00030037,0x00000058,0x00000065,
+0x000200f8,0x00000067,0x0004003d,0x00000057,
+0x00000670,0x00000065,0x00070050,0x00000057,
+0x00000671,0x000000c4,0x000000c4,0x000000c4,
+0x000000c4,0x000500c3,0x00000057,0x00000672,
+0x00000670,0x00000671,0x0003003e,0x00000065,
+0x00000672,0x0004003d,0x00000057,0x00000673,
+0x00000064,0x00070050,0x00000057,0x00000675,
+0x00000674,0x00000674,0x00000674,0x00000674,
+0x000500c7,0x00000057,0x00000676,0x00000673,
+0x00000675,0x0004003d,0x00000057,0x00000677,
+0x00000065,0x000500c5,0x00000057,0x00000678,
+0x00000677,0x00000676,0x0003003e,0x00000065,
+0x00000678,0x0004003d,0x00000057,0x00000679,
+0x00000064,0x00070050,0x00000057,0x0000067a,
+0x000000c4,0x000000c4,0x000000c4,0x000000c4,
+0x000500c3,0x00000057,0x0000067b,0x00000679,
+0x0000067a,0x0003003e,0x00000064,0x0000067b,
+0x0004003d,0x00000057,0x0000067d,0x00000064,
+0x00070050,0x00000057,0x0000067e,0x0000067c,
+0x0000067c,0x0000067c,0x0000067c,0x000500c7,
+0x00000057,0x0000067f,0x0000067d,0x0000067e,
+0x0003003e,0x00000064,0x0000067f,0x0004003d,
+0x00000057,0x00000680,0x00000064,0x000600ca,
+0x00000057,0x00000681,0x00000680,0x000000b9,
+0x0000050e,0x0003003e,0x00000064,0x00000681,
+0x000100fd,0x00010038,0x00050036,0x00000002,
+0x0000006e,0x00000000,0x00000068,0x00030037,
+0x00000058,0x00000069,0x00030037,0x00000058,
+0x0000006a,0x00030037,0x00000007,0x0000006b,
+0x00030037,0x00000012,0x0000006c,0x00030037,
+0x00000012,0x0000006d,0x000200f8,0x0000006f,
+0x0004003b,0x0000024c,0x0000069f,0x00000007,
+0x0004003b,0x0000024c,0x000006a8,0x00000007,
+0x0004003b,0x00000058,0x000006c6,0x00000007,
+0x0004003b,0x00000058,0x000006c8,0x00000007,
+0x0004003b,0x0000005e,0x00000715,0x00000007,
+0x0004003b,0x0000005e,0x00000719,0x00000007,
+0x0004003b,0x00000058,0x00000725,0x00000007,
+0x0004003b,0x00000058,0x00000729,0x00000007,
+0x0004003b,0x00000058,0x00000731,0x00000007,
+0x0004003b,0x00000058,0x00000733,0x00000007,
+0x0004003b,0x0000005e,0x00000738,0x00000007,
+0x0004003b,0x00000058,0x0000074f,0x00000007,
+0x0004003b,0x00000058,0x00000755,0x00000007,
+0x0004003d,0x00000006,0x00000682,0x0000006b,
+0x000300f7,0x0000068e,0x00000000,0x001700fb,
+0x00000682,0x0000068d,0x00000000,0x00000683,
+0x00000001,0x00000684,0x00000004,0x00000685,
+0x00000005,0x00000686,0x00000006,0x00000687,
+0x0000000a,0x00000688,0x00000008,0x00000689,
+0x0000000c,0x0000068a,0x00000009,0x0000068b,
+0x0000000d,0x0000068c,0x000200f8,0x0000068d,
+0x0003003e,0x0000006c,0x0000075d,0x0003003e,
+0x0000006d,0x0000075d,0x000200f9,0x0000068e,
+0x000200f8,0x00000683,0x0004003d,0x00000057,
+0x0000068f,0x00000069,0x0008004f,0x0000005d,
+0x00000690,0x0000068f,0x0000068f,0x00000000,
+0x00000000,0x00000000,0x0004007c,0x00000008,
+0x00000691,0x00000690,0x00050051,0x00000006,
+0x00000693,0x00000691,0x00000000,0x00050051,
+0x00000006,0x00000694,0x00000691,0x00000001,
+0x00050051,0x00000006,0x00000695,0x00000691,
+0x00000002,0x00070050,0x00000011,0x00000696,
+0x00000693,0x00000694,0x00000695,0x00000692,
+0x0003003e,0x0000006c,0x00000696,0x0004003d,
+0x00000057,0x00000697,0x0000006a,0x0008004f,
+0x0000005d,0x00000698,0x00000697,0x00000697,
+0x00000000,0x00000000,0x00000000,0x0004007c,
+0x00000008,0x00000699,0x00000698,0x00050051,
+0x00000006,0x0000069a,0x00000699,0x00000000,
+0x00050051,0x00000006,0x0000069b,0x00000699,
+0x00000001,0x00050051,0x00000006,0x0000069c,
+0x00000699,0x00000002,0x00070050,0x00000011,
+0x0000069d,0x0000069a,0x0000069b,0x0000069c,
+0x00000692,0x0003003e,0x0000006d,0x0000069d,
+0x000100fd,0x000200f8,0x00000684,0x00050041,
+0x0000024c,0x000006a0,0x00000069,0x0000009e,
+0x0004003d,0x00000056,0x000006a1,0x000006a0,
+0x000500c3,0x00000056,0x000006a2,0x000006a1,
+0x000000ba,0x00050041,0x0000024c,0x000006a3,
+0x0000006a,0x0000009e,0x0004003d,0x00000056,
+0x000006a4,0x000006a3,0x000500c7,0x00000056,
+0x000006a6,0x000006a4,0x000006a5,0x000500c5,
+0x00000056,0x000006a7,0x000006a2,0x000006a6,
+0x0003003e,0x0000069f,0x000006a7,0x0004003d,
+0x00000056,0x000006a9,0x0000069f,0x00050041,
+0x0000024c,0x000006aa,0x0000006a,0x0000009e,
+0x0004003d,0x00000056,0x000006ab,0x000006aa,
+0x000500c7,0x00000056,0x000006ac,0x000006ab,
+0x0000067c,0x00050080,0x00000056,0x000006ad,
+0x000006a9,0x000006ac,0x0007000c,0x00000056,
+0x000006af,0x00000001,0x00000027,0x000006ad,
+0x000006ae,0x0003003e,0x000006a8,0x000006af,
+0x0004003d,0x00000056,0x000006b0,0x0000069f,
+0x0004007c,0x00000006,0x000006b1,0x000006b0,
+0x00060050,0x00000008,0x000006b2,0x000006b1,
+0x000006b1,0x000006b1,0x00050051,0x00000006,
+0x000006b3,0x000006b2,0x00000000,0x00050051,
+0x00000006,0x000006b4,0x000006b2,0x00000001,
+0x00050051,0x00000006,0x000006b5,0x000006b2,
+0x00000002,0x00070050,0x00000011,0x000006b6,
+0x000006b3,0x000006b4,0x000006b5,0x00000692,
+0x0003003e,0x0000006c,0x000006b6,0x0004003d,
+0x00000056,0x000006b7,0x000006a8,0x0004007c,
+0x00000006,0x000006b8,0x000006b7,0x00060050,
+0x00000008,0x000006b9,0x000006b8,0x000006b8,
+0x000006b8,0x00050051,0x00000006,0x000006ba,
+0x000006b9,0x00000000,0x00050051,0x00000006,
+0x000006bb,0x000006b9,0x00000001,0x00050051,
+0x00000006,0x000006bc,0x000006b9,0x00000002,
+0x00070050,0x00000011,0x000006bd,0x000006ba,
+0x000006bb,0x000006bc,0x00000692,0x0003003e,
+0x0000006d,0x000006bd,0x000100fd,0x000200f8,
+0x00000685,0x0004003d,0x00000057,0x000006bf,
+0x00000069,0x0009004f,0x00000057,0x000006c0,
+0x000006bf,0x000006bf,0x00000000,0x00000000,
+0x00000000,0x00000001,0x0004007c,0x00000011,
+0x000006c1,0x000006c0,0x0003003e,0x0000006c,
+0x000006c1,0x0004003d,0x00000057,0x000006c2,
+0x0000006a,0x0009004f,0x00000057,0x000006c3,
+0x000006c2,0x000006c2,0x00000000,0x00000000,
+0x00000000,0x00000001,0x0004007c,0x00000011,
+0x000006c4,0x000006c3,0x0003003e,0x0000006d,
+0x000006c4,0x000100fd,0x000200f8,0x00000686,
+0x0004003d,0x00000057,0x000006c7,0x0000006a,
+0x0003003e,0x000006c6,0x000006c7,0x0004003d,
+0x00000057,0x000006c9,0x00000069,0x0003003e,
+0x000006c8,0x000006c9,0x00060039,0x00000002,
+0x000006ca,0x00000066,0x000006c6,0x000006c8,
+0x0004003d,0x00000057,0x000006cb,0x000006c6,
+0x0003003e,0x0000006a,0x000006cb,0x0004003d,
+0x00000057,0x000006cc,0x000006c8,0x0003003e,
+0x00000069,0x000006cc,0x0004003d,0x00000057,
+0x000006cd,0x00000069,0x0009004f,0x00000057,
+0x000006ce,0x000006cd,0x000006cd,0x00000000,
+0x00000000,0x00000000,0x00000001,0x00070050,
+0x00000057,0x000006cf,0x000000b9,0x000000b9,
+0x000000b9,0x000000b9,0x00070050,0x00000057,
+0x000006d0,0x000006ae,0x000006ae,0x000006ae,
+0x000006ae,0x0008000c,0x00000057,0x000006d1,
+0x00000001,0x0000002d,0x000006ce,0x000006cf,
+0x000006d0,0x0004007c,0x00000011,0x000006d2,
+0x000006d1,0x0003003e,0x0000006c,0x000006d2,
+0x0004003d,0x00000057,0x000006d3,0x00000069,
+0x0009004f,0x00000057,0x000006d4,0x000006d3,
+0x000006d3,0x00000000,0x00000000,0x00000000,
+0x00000001,0x0004003d,0x00000057,0x000006d5,
+0x0000006a,0x0009004f,0x00000057,0x000006d6,
+0x000006d5,0x000006d5,0x00000000,0x00000000,
+0x00000000,0x00000001,0x00050080,0x00000057,
+0x000006d7,0x000006d4,0x000006d6,0x00070050,
+0x00000057,0x000006d8,0x000000b9,0x000000b9,
+0x000000b9,0x000000b9,0x00070050,0x00000057,
+0x000006d9,0x000006ae,0x000006ae,0x000006ae,
+0x000006ae,0x0008000c,0x00000057,0x000006da,
+0x00000001,0x0000002d,0x000006d7,0x000006d8,
+0x000006d9,0x0004007c,0x00000011,0x000006db,
+0x000006da,0x0003003e,0x0000006d,0x000006db,
+0x000100fd,0x000200f8,0x00000687,0x00050041,
+0x0000024c,0x000006dd,0x00000069,0x0000009e,
+0x0004003d,0x00000056,0x000006de,0x000006dd,
+0x0004007c,0x00000006,0x000006df,0x000006de,
+0x00050041,0x0000024c,0x000006e0,0x0000006a,
+0x0000009e,0x0004003d,0x00000056,0x000006e1,
+0x000006e0,0x0004007c,0x00000006,0x000006e2,
+0x000006e1,0x00050041,0x0000024c,0x000006e3,
+0x00000069,0x000000a1,0x0004003d,0x00000056,
+0x000006e4,0x000006e3,0x0004007c,0x00000006,
+0x000006e5,0x000006e4,0x00070050,0x00000011,
+0x000006e6,0x000006df,0x000006e2,0x000006e5,
+0x00000692,0x0003003e,0x0000006d,0x000006e6,
+0x0004003d,0x00000011,0x000006e7,0x0000006d,
+0x0008004f,0x00000008,0x000006e8,0x000006e7,
+0x000006e7,0x00000000,0x00000001,0x00000002,
+0x00050041,0x0000024c,0x000006e9,0x0000006a,
+0x000000a1,0x0004003d,0x00000056,0x000006ea,
+0x000006e9,0x0004007c,0x00000006,0x000006eb,
+0x000006ea,0x00060050,0x00000008,0x000006ec,
+0x000006eb,0x000006eb,0x000006eb,0x00050084,
+0x00000008,0x000006ed,0x000006e8,0x000006ec,
+0x00060050,0x0000005d,0x000006ee,0x0000059c,
+0x0000059c,0x0000059c,0x000500c2,0x00000008,
+0x000006ef,0x000006ed,0x000006ee,0x00050051,
+0x00000006,0x000006f0,0x000006ef,0x00000000,
+0x00050051,0x00000006,0x000006f1,0x000006ef,
+0x00000001,0x00050051,0x00000006,0x000006f2,
+0x000006ef,0x00000002,0x00070050,0x00000011,
+0x000006f3,0x000006f0,0x000006f1,0x000006f2,
+0x00000692,0x0003003e,0x0000006c,0x000006f3,
+0x000100fd,0x000200f8,0x00000688,0x00050041,
+0x0000024c,0x000006f5,0x00000069,0x0000009e,
+0x0004003d,0x00000056,0x000006f6,0x000006f5,
+0x0004007c,0x00000006,0x000006f7,0x000006f6,
+0x00050041,0x0000024c,0x000006f8,0x0000006a,
+0x0000009e,0x0004003d,0x00000056,0x000006f9,
+0x000006f8,0x0004007c,0x00000006,0x000006fa,
+0x000006f9,0x00050041,0x0000024c,0x000006fb,
+0x00000069,0x000000a1,0x0004003d,0x00000056,
+0x000006fc,0x000006fb,0x0004007c,0x00000006,
+0x000006fd,0x000006fc,0x00050041,0x0000024c,
+0x000006fe,0x0000006a,0x00000093,0x0004003d,
+0x00000056,0x000006ff,0x000006fe,0x0004007c,
+0x00000006,0x00000700,0x000006ff,0x00070050,
+0x00000011,0x00000701,0x000006f7,0x000006fa,
+0x000006fd,0x00000700,0x0003003e,0x0000006d,
+0x00000701,0x0004003d,0x00000011,0x00000702,
+0x0000006d,0x0008004f,0x00000008,0x00000703,
+0x00000702,0x00000702,0x00000000,0x00000001,
+0x00000002,0x00050041,0x0000024c,0x00000704,
+0x0000006a,0x000000a1,0x0004003d,0x00000056,
+0x00000705,0x00000704,0x0004007c,0x00000006,
+0x00000706,0x00000705,0x00060050,0x00000008,
+0x00000707,0x00000706,0x00000706,0x00000706,
+0x00050084,0x00000008,0x00000708,0x00000703,
+0x00000707,0x00060050,0x0000005d,0x00000709,
+0x0000059c,0x0000059c,0x0000059c,0x000500c2,
+0x00000008,0x0000070a,0x00000708,0x00000709,
+0x00050041,0x0000024c,0x0000070b,0x00000069,
+0x00000093,0x0004003d,0x00000056,0x0000070c,
+0x0000070b,0x0004007c,0x00000006,0x0000070d,
+0x0000070c,0x00050051,0x00000006,0x0000070e,
+0x0000070a,0x00000000,0x00050051,0x00000006,
+0x0000070f,0x0000070a,0x00000001,0x00050051,
+0x00000006,0x00000710,0x0000070a,0x00000002,
+0x00070050,0x00000011,0x00000711,0x0000070e,
+0x0000070f,0x00000710,0x0000070d,0x0003003e,
+0x0000006c,0x00000711,0x000100fd,0x000200f8,
+0x00000689,0x00050041,0x0000024c,0x00000713,
+0x00000069,0x00000097,0x0003003e,0x00000713,
+0x000006ae,0x00050041,0x0000024c,0x00000714,
+0x0000006a,0x00000097,0x0003003e,0x00000714,
+0x000006ae,0x000200f9,0x0000068a,0x000200f8,
+0x0000068a,0x0004003d,0x00000057,0x00000716,
+0x0000006a,0x0008004f,0x0000005d,0x00000717,
+0x00000716,0x00000716,0x00000000,0x00000001,
+0x00000002,0x0003003e,0x00000715,0x00000717,
+0x00050039,0x00000056,0x00000718,0x00000061,
+0x00000715,0x0004003d,0x00000057,0x0000071a,
+0x00000069,0x0008004f,0x0000005d,0x0000071b,
+0x0000071a,0x0000071a,0x00000000,0x00000001,
+0x00000002,0x0003003e,0x00000719,0x0000071b,
+0x00050039,0x00000056,0x0000071c,0x00000061,
+0x00000719,0x000500af,0x00000084,0x0000071d,
+0x00000718,0x0000071c,0x000300f7,0x0000071f,
+0x00000000,0x000400fa,0x0000071d,0x0000071e,
+0x00000724,0x000200f8,0x0000071e,0x0004003d,
+0x00000057,0x00000720,0x00000069,0x0004007c,
+0x00000011,0x00000721,0x00000720,0x0003003e,
+0x0000006c,0x00000721,0x0004003d,0x00000057,
+0x00000722,0x0000006a,0x0004007c,0x00000011,
+0x00000723,0x00000722,0x0003003e,0x0000006d,
+0x00000723,0x000200f9,0x0000071f,0x000200f8,
+0x00000724,0x0004003d,0x00000057,0x00000726,
+0x0000006a,0x0003003e,0x00000725,0x00000726,
+0x00050039,0x00000057,0x00000727,0x0000005b,
+0x00000725,0x0004007c,0x00000011,0x00000728,
+0x00000727,0x0003003e,0x0000006c,0x00000728,
+0x0004003d,0x00000057,0x0000072a,0x00000069,
+0x0003003e,0x00000729,0x0000072a,0x00050039,
+0x00000057,0x0000072b,0x0000005b,0x00000729,
+0x0004007c,0x00000011,0x0000072c,0x0000072b,
+0x0003003e,0x0000006d,0x0000072c,0x000200f9,
+0x0000071f,0x000200f8,0x0000071f,0x000100fd,
+0x000200f8,0x0000068b,0x00050041,0x0000024c,
+0x0000072e,0x00000069,0x00000097,0x0003003e,
+0x0000072e,0x000006ae,0x00050041,0x0000024c,
+0x00000730,0x0000006a,0x00000097,0x0003003e,
+0x00000730,0x0000072f,0x000200f9,0x0000068c,
+0x000200f8,0x0000068c,0x0004003d,0x00000057,
+0x00000732,0x0000006a,0x0003003e,0x00000731,
+0x00000732,0x0004003d,0x00000057,0x00000734,
+0x00000069,0x0003003e,0x00000733,0x00000734,
+0x00060039,0x00000002,0x00000735,0x00000066,
+0x00000731,0x00000733,0x0004003d,0x00000057,
+0x00000736,0x00000731,0x0003003e,0x0000006a,
+0x00000736,0x0004003d,0x00000057,0x00000737,
+0x00000733,0x0003003e,0x00000069,0x00000737,
+0x0004003d,0x00000057,0x00000739,0x0000006a,
+0x0008004f,0x0000005d,0x0000073a,0x00000739,
+0x00000739,0x00000000,0x00000001,0x00000002,
+0x0003003e,0x00000738,0x0000073a,0x00050039,
+0x00000056,0x0000073b,0x00000061,0x00000738,
+0x000500af,0x00000084,0x0000073c,0x0000073b,
+0x000000b9,0x000300f7,0x0000073e,0x00000000,
+0x000400fa,0x0000073c,0x0000073d,0x0000074b,
+0x000200f8,0x0000073d,0x0004003d,0x00000057,
+0x0000073f,0x00000069,0x00070050,0x00000057,
+0x00000740,0x000000b9,0x000000b9,0x000000b9,
+0x000000b9,0x00070050,0x00000057,0x00000741,
+0x000006ae,0x000006ae,0x000006ae,0x000006ae,
+0x0008000c,0x00000057,0x00000742,0x00000001,
+0x0000002d,0x0000073f,0x00000740,0x00000741,
+0x0004007c,0x00000011,0x00000743,0x00000742,
+0x0003003e,0x0000006c,0x00000743,0x0004003d,
+0x00000057,0x00000744,0x00000069,0x0004003d,
+0x00000057,0x00000745,0x0000006a,0x00050080,
+0x00000057,0x00000746,0x00000744,0x00000745,
+0x00070050,0x00000057,0x00000747,0x000000b9,
+0x000000b9,0x000000b9,0x000000b9,0x00070050,
+0x00000057,0x00000748,0x000006ae,0x000006ae,
+0x000006ae,0x000006ae,0x0008000c,0x00000057,
+0x00000749,0x00000001,0x0000002d,0x00000746,
+0x00000747,0x00000748,0x0004007c,0x00000011,
+0x0000074a,0x00000749,0x0003003e,0x0000006d,
+0x0000074a,0x000200f9,0x0000073e,0x000200f8,
+0x0000074b,0x0004003d,0x00000057,0x0000074c,
+0x00000069,0x0004003d,0x00000057,0x0000074d,
+0x0000006a,0x00050080,0x00000057,0x0000074e,
+0x0000074c,0x0000074d,0x0003003e,0x0000074f,
+0x0000074e,0x00050039,0x00000057,0x00000750,
+0x0000005b,0x0000074f,0x00070050,0x00000057,
+0x00000751,0x000000b9,0x000000b9,0x000000b9,
+0x000000b9,0x00070050,0x00000057,0x00000752,
+0x000006ae,0x000006ae,0x000006ae,0x000006ae,
+0x0008000c,0x00000057,0x00000753,0x00000001,
+0x0000002d,0x00000750,0x00000751,0x00000752,
+0x0004007c,0x00000011,0x00000754,0x00000753,
+0x0003003e,0x0000006c,0x00000754,0x0004003d,
+0x00000057,0x00000756,0x00000069,0x0003003e,
+0x00000755,0x00000756,0x00050039,0x00000057,
+0x00000757,0x0000005b,0x00000755,0x00070050,
+0x00000057,0x00000758,0x000000b9,0x000000b9,
+0x000000b9,0x000000b9,0x00070050,0x00000057,
+0x00000759,0x000006ae,0x000006ae,0x000006ae,
+0x000006ae,0x0008000c,0x00000057,0x0000075a,
+0x00000001,0x0000002d,0x00000757,0x00000758,
+0x00000759,0x0004007c,0x00000011,0x0000075b,
+0x0000075a,0x0003003e,0x0000006d,0x0000075b,
+0x000200f9,0x0000073e,0x000200f8,0x0000073e,
+0x000100fd,0x000200f8,0x0000068e,0x000100fd,
+0x00010038,0x00050036,0x00000006,0x00000075,
+0x00000000,0x00000070,0x00030037,0x00000012,
+0x00000071,0x00030037,0x00000007,0x00000072,
+0x00030037,0x00000007,0x00000073,0x00030037,
+0x00000009,0x00000074,0x000200f8,0x00000076,
+0x0004003b,0x00000007,0x0000075f,0x00000007,
+0x0004003b,0x00000007,0x00000767,0x00000007,
+0x0004003b,0x00000007,0x00000770,0x00000007,
+0x0004003b,0x00000012,0x00000773,0x00000007,
+0x0004003b,0x00000007,0x00000775,0x00000007,
+0x0004003b,0x00000007,0x00000777,0x00000007,
+0x0004003b,0x00000007,0x00000779,0x00000007,
+0x0004003b,0x000007e0,0x000007e1,0x00000007,
+0x0004003b,0x00000007,0x000007eb,0x00000007,
+0x0004003b,0x00000007,0x000007f4,0x00000007,
+0x0004003b,0x00000012,0x000007f7,0x00000007,
+0x0004003b,0x00000007,0x000007f9,0x00000007,
+0x0004003b,0x00000007,0x000007fb,0x00000007,
+0x0004003b,0x00000007,0x000007fd,0x00000007,
+0x0004003b,0x0000080e,0x0000080f,0x00000007,
+0x0004003b,0x00000007,0x00000814,0x00000007,
+0x0004003b,0x00000007,0x0000081a,0x00000007,
+0x0004003b,0x00000012,0x0000081b,0x00000007,
+0x0004003b,0x00000007,0x0000081d,0x00000007,
+0x0004003b,0x00000007,0x0000081f,0x00000007,
+0x0004003b,0x00000035,0x00000822,0x00000007,
+0x0004003b,0x0000082e,0x0000082f,0x00000007,
+0x00050041,0x00000007,0x00000760,0x00000074,
+0x00000093,0x0004003d,0x00000006,0x00000761,
+0x00000760,0x0003003e,0x0000075f,0x00000761,
+0x00050041,0x00000007,0x00000762,0x00000074,
+0x0000009e,0x0004003d,0x00000006,0x00000763,
+0x00000762,0x000500aa,0x00000084,0x00000764,
+0x00000763,0x000000a1,0x000300f7,0x00000766,
+0x00000000,0x000400fa,0x00000764,0x00000765,
+0x000007e5,0x000200f8,0x00000765,0x0004003d,
+0x00000006,0x00000768,0x00000073,0x00050086,
+0x00000006,0x00000769,0x00000768,0x00000096,
+0x0004003d,0x00000006,0x0000076a,0x0000075f,
+0x00050084,0x00000006,0x0000076b,0x00000096,
+0x0000076a,0x00050080,0x00000006,0x0000076c,
+0x0000076b,0x0000008e,0x00050084,0x00000006,
+0x0000076d,0x00000769,0x0000076c,0x0004003d,
+0x00000006,0x0000076e,0x00000072,0x00050080,
+0x00000006,0x0000076f,0x0000076d,0x0000076e,
+0x0003003e,0x00000767,0x0000076f,0x0004003d,
+0x00000006,0x00000771,0x00000073,0x00050089,
+0x00000006,0x00000772,0x00000771,0x00000096,
+0x0004003d,0x00000011,0x00000774,0x00000071,
+0x0003003e,0x00000773,0x00000774,0x0004003d,
+0x00000006,0x00000776,0x00000767,0x0003003e,
+0x00000775,0x00000776,0x0004003d,0x00000006,
+0x00000778,0x0000075f,0x0003003e,0x00000777,
+0x00000778,0x0003003e,0x00000779,0x00000772,
+0x00080039,0x00000006,0x0000077a,0x00000025,
+0x00000773,0x00000775,0x00000777,0x00000779,
+0x0003003e,0x00000770,0x0000077a,0x0004003d,
+0x00000006,0x000007d9,0x0000075f,0x000500c4,
+0x00000056,0x000007da,0x000000c4,0x000007d9,
+0x00050082,0x00000056,0x000007db,0x000007da,
+0x000000c4,0x00050084,0x00000056,0x000007dc,
+0x0000015e,0x000007db,0x0004007c,0x00000006,
+0x000007dd,0x000007dc,0x0004003d,0x00000006,
+0x000007de,0x00000770,0x00050080,0x00000006,
+0x000007df,0x000007dd,0x000007de,0x0003003e,
+0x000007e1,0x000007d8,0x00050041,0x00000007,
+0x000007e2,0x000007e1,0x000007df,0x0004003d,
+0x00000006,0x000007e3,0x000007e2,0x000200fe,
+0x000007e3,0x000200f8,0x000007e5,0x00050041,
+0x00000007,0x000007e6,0x00000074,0x000000a1,
+0x0004003d,0x00000006,0x000007e7,0x000007e6,
+0x000500aa,0x00000084,0x000007e8,0x000007e7,
+0x000000a1,0x000300f7,0x000007ea,0x00000000,
+0x000400fa,0x000007e8,0x000007e9,0x00000813,
+0x000200f8,0x000007e9,0x0004003d,0x00000006,
+0x000007ec,0x00000073,0x00050086,0x00000006,
+0x000007ed,0x000007ec,0x00000097,0x0004003d,
+0x00000006,0x000007ee,0x0000075f,0x00050084,
+0x00000006,0x000007ef,0x00000097,0x000007ee,
+0x00050080,0x00000006,0x000007f0,0x000007ef,
+0x0000008f,0x00050084,0x00000006,0x000007f1,
+0x000007ed,0x000007f0,0x0004003d,0x00000006,
+0x000007f2,0x00000072,0x00050080,0x00000006,
+0x000007f3,0x000007f1,0x000007f2,0x0003003e,
+0x000007eb,0x000007f3,0x0004003d,0x00000006,
+0x000007f5,0x00000073,0x00050089,0x00000006,
+0x000007f6,0x000007f5,0x00000097,0x0004003d,
+0x00000011,0x000007f8,0x00000071,0x0003003e,
+0x000007f7,0x000007f8,0x0004003d,0x00000006,
+0x000007fa,0x000007eb,0x0003003e,0x000007f9,
+0x000007fa,0x0004003d,0x00000006,0x000007fc,
+0x0000075f,0x0003003e,0x000007fb,0x000007fc,
+0x0003003e,0x000007fd,0x000007f6,0x00080039,
+0x00000006,0x000007fe,0x0000002b,0x000007f7,
+0x000007f9,0x000007fb,0x000007fd,0x0003003e,
+0x000007f4,0x000007fe,0x0004003d,0x00000006,
+0x00000807,0x0000075f,0x000500c4,0x00000056,
+0x00000808,0x000000c4,0x00000807,0x00050082,
+0x00000056,0x00000809,0x00000808,0x000000c4,
+0x00050084,0x00000056,0x0000080a,0x000000c9,
+0x00000809,0x0004007c,0x00000006,0x0000080b,
+0x0000080a,0x0004003d,0x00000006,0x0000080c,
+0x000007f4,0x00050080,0x00000006,0x0000080d,
+0x0000080b,0x0000080c,0x0003003e,0x0000080f,
+0x00000806,0x00050041,0x00000007,0x00000810,
+0x0000080f,0x0000080d,0x0004003d,0x00000006,
+0x00000811,0x00000810,0x000200fe,0x00000811,
+0x000200f8,0x00000813,0x0004003d,0x00000006,
+0x00000815,0x00000073,0x0004003d,0x00000006,
+0x00000816,0x0000075f,0x00050084,0x00000006,
+0x00000817,0x00000815,0x00000816,0x0004003d,
+0x00000006,0x00000818,0x00000072,0x00050080,
+0x00000006,0x00000819,0x00000817,0x00000818,
+0x0003003e,0x00000814,0x00000819,0x0004003d,
+0x00000011,0x0000081c,0x00000071,0x0003003e,
+0x0000081b,0x0000081c,0x0004003d,0x00000006,
+0x0000081e,0x00000814,0x0003003e,0x0000081d,
+0x0000081e,0x0004003d,0x00000006,0x00000820,
+0x0000075f,0x0003003e,0x0000081f,0x00000820,
+0x00070039,0x00000006,0x00000821,0x00000017,
+0x0000081b,0x0000081d,0x0000081f,0x0003003e,
+0x0000081a,0x00000821,0x0004003d,0x00000006,
+0x0000082c,0x0000075f,0x00050082,0x00000006,
+0x0000082d,0x0000082c,0x000000a1,0x0003003e,
+0x0000082f,0x0000082b,0x00050041,0x00000035,
+0x00000830,0x0000082f,0x0000082d,0x0004003d,
+0x00000034,0x00000831,0x00000830,0x0003003e,
+0x00000822,0x00000831,0x0004003d,0x00000006,
+0x00000832,0x0000081a,0x00050041,0x00000007,
+0x00000833,0x00000822,0x0000009e,0x0004003d,
+0x00000006,0x00000834,0x00000833,0x00050084,
+0x00000006,0x00000835,0x00000832,0x00000834,
+0x0004003d,0x00000006,0x00000836,0x0000081a,
+0x00050041,0x00000007,0x00000837,0x00000822,
+0x000000a1,0x0004003d,0x00000006,0x00000838,
+0x00000837,0x000500c2,0x00000006,0x00000839,
+0x00000836,0x00000838,0x000500c5,0x00000006,
+0x0000083a,0x00000835,0x00000839,0x000200fe,
+0x0000083a,0x000200f8,0x000007ea,0x000100ff,
+0x000200f8,0x00000766,0x000100ff,0x00010038,
+0x00050036,0x00000011,0x00000079,0x00000000,
+0x00000077,0x00030037,0x00000007,0x00000078,
+0x000200f8,0x0000007a,0x0004003b,0x00000058,
+0x0000083d,0x00000007,0x0004003b,0x00000012,
+0x00000846,0x00000007,0x0004003d,0x00000006,
+0x0000083e,0x00000078,0x0004007c,0x00000056,
+0x0000083f,0x0000083e,0x00070050,0x00000057,
+0x00000844,0x0000083f,0x0000083f,0x0000083f,
+0x0000083f,0x00050082,0x00000057,0x00000845,
+0x00000844,0x00000843,0x0003003e,0x0000083d,
+0x00000845,0x0004003d,0x00000057,0x00000848,
+0x0000083d,0x0008000c,0x00000057,0x0000084c,
+0x00000001,0x0000002d,0x00000848,0x00000849,
+0x0000084b,0x000500c4,0x00000011,0x0000084d,
+0x00000847,0x0000084c,0x00070050,0x00000011,
+0x0000084e,0x000000a1,0x000000a1,0x000000a1,
+0x000000a1,0x00050082,0x00000011,0x0000084f,
+0x0000084d,0x0000084e,0x0003003e,0x00000846,
+0x0000084f,0x0004003d,0x00000011,0x00000850,
+0x00000846,0x0004003d,0x00000006,0x00000853,
+0x00000078,0x00070050,0x00000011,0x00000854,
+0x00000853,0x00000853,0x00000853,0x00000853,
+0x000500ae,0x00000856,0x00000857,0x00000854,
+0x00000855,0x000600a9,0x00000011,0x00000858,
+0x00000857,0x00000852,0x00000850,0x000200fe,
+0x00000858,0x00010038,0x00050036,0x00000011,
+0x0000007d,0x00000000,0x0000007b,0x00030037,
+0x00000034,0x0000007c,0x000200f8,0x0000007e,
+0x0004003b,0x00000012,0x00000872,0x00000007,
+0x0004003b,0x00000007,0x00000876,0x00000007,
+0x0004003b,0x00000035,0x0000087a,0x00000007,
+0x0004003b,0x00000012,0x0000087b,0x00000007,
+0x0004003b,0x00000007,0x0000087e,0x00000007,
+0x0004003b,0x00000007,0x0000087f,0x00000007,
+0x0004003b,0x00000035,0x00000881,0x00000007,
+0x0004003b,0x00000007,0x00000882,0x00000007,
+0x0004003b,0x00000007,0x00000885,0x00000007,
+0x0004003b,0x00000007,0x00000886,0x00000007,
+0x0004003b,0x00000007,0x00000887,0x00000007,
+0x0004003b,0x00000007,0x00000888,0x00000007,
+0x0004003b,0x00000007,0x00000889,0x00000007,
+0x0004003b,0x00000007,0x0000088b,0x00000007,
+0x0004003b,0x00000007,0x0000088c,0x00000007,
+0x0004003b,0x00000007,0x0000088d,0x00000007,
+0x0004003b,0x00000007,0x00000897,0x00000007,
+0x0004003b,0x00000007,0x0000089d,0x00000007,
+0x0004003b,0x00000007,0x000008a5,0x00000007,
+0x0004003b,0x00000009,0x000008a9,0x00000007,
+0x0004003b,0x00000007,0x000008aa,0x00000007,
+0x0004003b,0x00000007,0x000008ab,0x00000007,
+0x0004003b,0x00000007,0x000008ad,0x00000007,
+0x0004003b,0x00000007,0x000008af,0x00000007,
+0x0004003b,0x00000007,0x000008b2,0x00000007,
+0x0004003b,0x00000058,0x000008b6,0x00000007,
+0x0004003b,0x00000058,0x000008b7,0x00000007,
+0x0004003b,0x00000012,0x000008b8,0x00000007,
+0x0004003b,0x00000007,0x000008bd,0x00000007,
+0x0004003b,0x00000007,0x000008c0,0x00000007,
+0x0004003b,0x00000007,0x000008c9,0x00000007,
+0x0004003b,0x00000012,0x000008cf,0x00000007,
+0x0004003b,0x00000007,0x000008d1,0x00000007,
+0x0004003b,0x00000007,0x000008d3,0x00000007,
+0x0004003b,0x00000009,0x000008d5,0x00000007,
+0x0004003b,0x00000012,0x000008dd,0x00000007,
+0x0004003b,0x00000007,0x000008df,0x00000007,
+0x0004003b,0x00000007,0x000008e1,0x00000007,
+0x0004003b,0x00000009,0x000008e2,0x00000007,
+0x0004003b,0x00000012,0x000008e9,0x00000007,
+0x0004003b,0x00000012,0x000008ea,0x00000007,
+0x0004003b,0x00000058,0x000008eb,0x00000007,
+0x0004003b,0x00000058,0x000008ed,0x00000007,
+0x0004003b,0x00000007,0x000008ef,0x00000007,
+0x0004003b,0x00000012,0x000008f1,0x00000007,
+0x0004003b,0x00000012,0x000008f2,0x00000007,
+0x0004003b,0x00000012,0x000008f6,0x00000007,
+0x0004003b,0x00000007,0x000008fd,0x00000007,
+0x0004003b,0x00000012,0x000008fe,0x00000007,
+0x0004003b,0x00000007,0x00000900,0x00000007,
+0x0004003b,0x00000007,0x00000902,0x00000007,
+0x00040039,0x00000002,0x0000085b,0x0000000f,
+0x0004003d,0x00000084,0x0000085c,0x00000086,
+0x000300f7,0x0000085e,0x00000000,0x000400fa,
+0x0000085c,0x0000085d,0x0000085e,0x000200f8,
+0x0000085d,0x000200fe,0x0000085f,0x000200f8,
+0x0000085e,0x0004003d,0x00000084,0x00000861,
+0x000000a8,0x000300f7,0x00000863,0x00000000,
+0x000400fa,0x00000861,0x00000862,0x00000863,
+0x000200f8,0x00000862,0x00050041,0x000000ab,
+0x00000864,0x000000aa,0x000000a1,0x0004003d,
+0x00000006,0x00000865,0x00000864,0x000600cb,
+0x00000006,0x00000866,0x00000865,0x0000059c,
+0x0000059c,0x00050041,0x000000ab,0x00000867,
+0x000000aa,0x000000a1,0x0004003d,0x00000006,
+0x00000868,0x00000867,0x000600cb,0x00000006,
+0x00000869,0x00000868,0x000005a9,0x0000059c,
+0x00050041,0x000000ab,0x0000086a,0x000000aa,
+0x0000009e,0x0004003d,0x00000006,0x0000086b,
+0x0000086a,0x000600cb,0x00000006,0x0000086c,
+0x0000086b,0x0000059c,0x0000059c,0x00050041,
+0x000000ab,0x0000086d,0x000000aa,0x0000009e,
+0x0004003d,0x00000006,0x0000086e,0x0000086d,
+0x000600cb,0x00000006,0x0000086f,0x0000086e,
+0x000005a9,0x0000059c,0x00070050,0x00000011,
+0x00000870,0x00000866,0x00000869,0x0000086c,
+0x0000086f,0x000200fe,0x00000870,0x000200f8,
+0x00000863,0x0004003d,0x00000011,0x00000873,
+0x000000aa,0x0009004f,0x00000011,0x00000874,
+0x00000873,0x00000873,0x00000003,0x00000002,
+0x00000001,0x00000000,0x000400cc,0x00000011,
+0x00000875,0x00000874,0x0004003d,0x00000006,
+0x00000877,0x0000016f,0x0003003e,0x00000876,
+0x00000877,0x00050039,0x00000011,0x00000878,
+0x00000079,0x00000876,0x000500c7,0x00000011,
+0x00000879,0x00000875,0x00000878,0x0003003e,
+0x00000872,0x00000879,0x0004003d,0x00000011,
+0x0000087c,0x00000872,0x0003003e,0x0000087b,
+0x0000087c,0x00060039,0x00000034,0x0000087d,
+0x00000044,0x0000087b,0x0000007c,0x0003003e,
+0x0000087a,0x0000087d,0x0004003d,0x00000006,
+0x00000880,0x0000018d,0x0003003e,0x0000087f,
+0x00000880,0x0003003e,0x00000881,0x0000007c,
+0x0004003d,0x00000006,0x00000883,0x00000183,
+0x0003003e,0x00000882,0x00000883,0x00070039,
+0x00000006,0x00000884,0x0000004e,0x0000087f,
+0x00000881,0x00000882,0x0003003e,0x0000087e,
+0x00000884,0x0003003e,0x00000885,0x0000009e,
+0x0003003e,0x00000886,0x0000009e,0x0003003e,
+0x00000887,0x0000009e,0x0004003d,0x00000006,
+0x0000088a,0x0000087e,0x0003003e,0x00000889,
+0x0000088a,0x00080039,0x00000006,0x0000088e,
+0x0000001e,0x00000889,0x0000088b,0x0000088c,
+0x0000088d,0x0004003d,0x00000006,0x0000088f,
+0x0000088b,0x0003003e,0x00000885,0x0000088f,
+0x0004003d,0x00000006,0x00000890,0x0000088c,
+0x0003003e,0x00000886,0x00000890,0x0004003d,
+0x00000006,0x00000891,0x0000088d,0x0003003e,
+0x00000887,0x00000891,0x0003003e,0x00000888,
+0x0000088e,0x0004003d,0x00000006,0x00000892,
+0x00000886,0x000500ac,0x00000084,0x00000893,
+0x00000892,0x000002a0,0x000300f7,0x00000895,
+0x00000000,0x000400fa,0x00000893,0x00000894,
+0x00000895,0x000200f8,0x00000894,0x000200fe,
+0x0000085f,0x000200f8,0x00000895,0x0004003d,
+0x00000006,0x00000898,0x00000183,0x000500aa,
+0x00000084,0x00000899,0x00000898,0x000000a1,
+0x000600a9,0x00000056,0x0000089b,0x00000899,
+0x00000557,0x0000089a,0x0004007c,0x00000006,
+0x0000089c,0x0000089b,0x0003003e,0x00000897,
+0x0000089c,0x0004003d,0x00000084,0x0000089f,
+0x000000d5,0x000600a9,0x00000056,0x000008a0,
+0x0000089f,0x000000c4,0x000000b9,0x00050084,
+0x00000056,0x000008a1,0x0000089e,0x000008a0,
+0x0004007c,0x00000006,0x000008a2,0x000008a1,
+0x0004003d,0x00000006,0x000008a3,0x00000885,
+0x00050080,0x00000006,0x000008a4,0x000008a2,
+0x000008a3,0x0003003e,0x0000089d,0x000008a4,
+0x0004003d,0x00000006,0x000008a6,0x0000089d,
+0x0004003d,0x00000006,0x000008a7,0x00000897,
+0x00050082,0x00000006,0x000008a8,0x000008a6,
+0x000008a7,0x0003003e,0x000008a5,0x000008a8,
+0x0004003d,0x00000006,0x000008ac,0x000008a5,
+0x0003003e,0x000008ab,0x000008ac,0x0004003d,
+0x00000006,0x000008ae,0x00000886,0x0003003e,
+0x000008ad,0x000008ae,0x00070039,0x00000008,
+0x000008b0,0x00000054,0x000008ab,0x000008ad,
+0x000008af,0x0004003d,0x00000006,0x000008b1,
+0x000008af,0x0003003e,0x000008aa,0x000008b1,
+0x0003003e,0x000008a9,0x000008b0,0x0004003d,
+0x00000006,0x000008b3,0x00000888,0x000500c2,
+0x00000006,0x000008b4,0x000008b3,0x000000ba,
+0x00050080,0x00000006,0x000008b5,0x000008b4,
+0x000000a1,0x0003003e,0x000008b2,0x000008b5,
+0x0003003e,0x000008b6,0x00000849,0x0003003e,
+0x000008b7,0x00000849,0x0004003d,0x00000011,
+0x000008b9,0x000000aa,0x0004003d,0x00000006,
+0x000008ba,0x00000897,0x0004003d,0x00000006,
+0x000008bb,0x000008aa,0x00050080,0x00000006,
+0x000008bc,0x000008ba,0x000008bb,0x0003003e,
+0x000008bd,0x000008bc,0x00050039,0x00000011,
+0x000008be,0x00000079,0x000008bd,0x000500c7,
+0x00000011,0x000008bf,0x000008b9,0x000008be,
+0x0003003e,0x000008b8,0x000008bf,0x0003003e,
+0x000008c0,0x0000009e,0x000200f9,0x000008c1,
+0x000200f8,0x000008c1,0x000400f6,0x000008c3,
+0x000008c4,0x00000000,0x000200f9,0x000008c5,
+0x000200f8,0x000008c5,0x0004003d,0x00000006,
+0x000008c6,0x000008c0,0x0004003d,0x00000006,
+0x000008c7,0x000008b2,0x000500b0,0x00000084,
+0x000008c8,0x000008c6,0x000008c7,0x000400fa,
+0x000008c8,0x000008c2,0x000008c3,0x000200f8,
+0x000008c2,0x0004003d,0x00000006,0x000008ca,
+0x000008c0,0x00050084,0x00000006,0x000008cb,
+0x00000093,0x000008ca,0x0004003d,0x00000006,
+0x000008cc,0x00000887,0x00050080,0x00000006,
+0x000008cd,0x000008cb,0x000008cc,0x0003003e,
+0x000008c9,0x000008cd,0x0004003d,0x00000006,
+0x000008ce,0x000008c0,0x0004003d,0x00000011,
+0x000008d0,0x000008b8,0x0003003e,0x000008cf,
+0x000008d0,0x0004003d,0x00000006,0x000008d2,
+0x00000897,0x0003003e,0x000008d1,0x000008d2,
+0x0004003d,0x00000006,0x000008d4,0x000008c9,
+0x0003003e,0x000008d3,0x000008d4,0x0004003d,
+0x00000008,0x000008d6,0x000008a9,0x0003003e,
+0x000008d5,0x000008d6,0x00080039,0x00000006,
+0x000008d7,0x00000075,0x000008cf,0x000008d1,
+0x000008d3,0x000008d5,0x0004007c,0x00000056,
+0x000008d8,0x000008d7,0x00050041,0x0000024c,
+0x000008d9,0x000008b6,0x000008ce,0x0003003e,
+0x000008d9,0x000008d8,0x0004003d,0x00000006,
+0x000008da,0x000008c0,0x0004003d,0x00000006,
+0x000008db,0x000008c9,0x00050080,0x00000006,
+0x000008dc,0x000008db,0x000000a1,0x0004003d,
+0x00000011,0x000008de,0x000008b8,0x0003003e,
+0x000008dd,0x000008de,0x0004003d,0x00000006,
+0x000008e0,0x00000897,0x0003003e,0x000008df,
+0x000008e0,0x0003003e,0x000008e1,0x000008dc,
+0x0004003d,0x00000008,0x000008e3,0x000008a9,
+0x0003003e,0x000008e2,0x000008e3,0x00080039,
+0x00000006,0x000008e4,0x00000075,0x000008dd,
+0x000008df,0x000008e1,0x000008e2,0x0004007c,
+0x00000056,0x000008e5,0x000008e4,0x00050041,
+0x0000024c,0x000008e6,0x000008b7,0x000008da,
+0x0003003e,0x000008e6,0x000008e5,0x000200f9,
+0x000008c4,0x000200f8,0x000008c4,0x0004003d,
+0x00000006,0x000008e7,0x000008c0,0x00050080,
+0x00000006,0x000008e8,0x000008e7,0x000000c4,
+0x0003003e,0x000008c0,0x000008e8,0x000200f9,
+0x000008c1,0x000200f8,0x000008c3,0x0004003d,
+0x00000057,0x000008ec,0x000008b6,0x0003003e,
+0x000008eb,0x000008ec,0x0004003d,0x00000057,
+0x000008ee,0x000008b7,0x0003003e,0x000008ed,
+0x000008ee,0x0004003d,0x00000006,0x000008f0,
+0x00000888,0x0003003e,0x000008ef,0x000008f0,
+0x00090039,0x00000002,0x000008f3,0x0000006e,
+0x000008eb,0x000008ed,0x000008ef,0x000008f1,
+0x000008f2,0x0004003d,0x00000011,0x000008f4,
+0x000008f1,0x0003003e,0x000008e9,0x000008f4,
+0x0004003d,0x00000011,0x000008f5,0x000008f2,
+0x0003003e,0x000008ea,0x000008f5,0x00050041,
+0x00000007,0x000008f7,0x0000087a,0x0000009e,
+0x0004003d,0x00000006,0x000008f8,0x000008f7,
+0x00070050,0x00000011,0x000008f9,0x000008f8,
+0x000008f8,0x000008f8,0x000008f8,0x0003003e,
+0x000008f6,0x000008f9,0x0004003d,0x00000084,
+0x000008fa,0x000000d5,0x000300f7,0x000008fc,
+0x00000000,0x000400fa,0x000008fa,0x000008fb,
+0x000008fc,0x000200f8,0x000008fb,0x0004003d,
+0x00000011,0x000008ff,0x000000aa,0x0003003e,
+0x000008fe,0x000008ff,0x0004003d,0x00000006,
+0x00000901,0x0000089d,0x0003003e,0x00000900,
+0x00000901,0x0003003e,0x00000902,0x00000093,
+0x00070039,0x00000006,0x00000903,0x00000017,
+0x000008fe,0x00000900,0x00000902,0x0003003e,
+0x000008fd,0x00000903,0x0004003d,0x00000006,
+0x00000904,0x000008fd,0x00050041,0x00000007,
+0x00000905,0x0000087a,0x000000a1,0x0004003d,
+0x00000006,0x00000906,0x00000905,0x00050041,
+0x00000007,0x00000907,0x000008f6,0x00000904,
+0x0003003e,0x00000907,0x00000906,0x000200f9,
+0x000008fc,0x000200f8,0x000008fc,0x0004003d,
+0x00000011,0x00000908,0x000008e9,0x0004003d,
+0x00000011,0x00000909,0x000008f6,0x00070050,
+0x00000011,0x0000090a,0x0000017d,0x0000017d,
+0x0000017d,0x0000017d,0x00050082,0x00000011,
+0x0000090b,0x0000090a,0x00000909,0x00050084,
+0x00000011,0x0000090c,0x00000908,0x0000090b,
+0x0004003d,0x00000011,0x0000090d,0x000008ea,
+0x0004003d,0x00000011,0x0000090e,0x000008f6,
+0x00050084,0x00000011,0x0000090f,0x0000090d,
+0x0000090e,0x00050080,0x00000011,0x00000910,
+0x0000090c,0x0000090f,0x00070050,0x00000011,
+0x00000911,0x000001a0,0x000001a0,0x000001a0,
+0x000001a0,0x00050080,0x00000011,0x00000912,
+0x00000910,0x00000911,0x00070050,0x00000057,
+0x00000913,0x0000050e,0x0000050e,0x0000050e,
+0x0000050e,0x000500c2,0x00000011,0x00000914,
+0x00000912,0x00000913,0x000200fe,0x00000914,
+0x00010038,0x00050036,0x0000007f,0x00000082,
+0x00000000,0x00000080,0x00030037,0x0000005e,
+0x00000081,0x000200f8,0x00000083,0x0004003d,
+0x0000005d,0x00000917,0x00000081,0x0007004f,
+0x0000007f,0x00000918,0x00000917,0x00000917,
+0x00000000,0x00000002,0x000200fe,0x00000918,
+0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_2D.inl
new file mode 100644
index 00000000000..ea09a2d3901
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_2D.inl
@@ -0,0 +1,3571 @@
+0x07230203,0x00010300,0x000d000a,0x00000951,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x0000091c,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00080005,0x0000000d,0x45746567,
+0x646f636e,0x53676e69,0x28657a69,0x763b3175,
+0x003b3375,0x00040005,0x0000000b,0x566d756e,
+0x00736c61,0x00050005,0x0000000c,0x6f636e65,
+0x676e6964,0x00000000,0x00070005,0x0000000f,
+0x6f636564,0x6c426564,0x436b636f,0x69666e6f,
+0x00002867,0x00080005,0x00000017,0x72747865,
+0x42746361,0x28737469,0x3b347576,0x753b3175,
+0x00003b31,0x00040005,0x00000014,0x61746164,
+0x00000000,0x00040005,0x00000015,0x7366666f,
+0x00007465,0x00040005,0x00000016,0x426d756e,
+0x00737469,0x00080005,0x0000001e,0x6f636564,
+0x45436564,0x3175284d,0x3b31753b,0x753b3175,
+0x00003b31,0x00060005,0x0000001a,0x74726170,
+0x6f697469,0x646e496e,0x00007865,0x00060005,
+0x0000001b,0x72617473,0x45664f74,0x61727478,
+0x006d6543,0x00060005,0x0000001c,0x61746f74,
+0x646e456c,0x6e696f70,0x00007374,0x00070005,
+0x0000001d,0x65736162,0x70646e45,0x746e696f,
+0x65646e49,0x00000078,0x00090005,0x00000025,
+0x6f636564,0x72546564,0x76287469,0x753b3475,
+0x31753b31,0x3b31753b,0x00000000,0x00040005,
+0x00000021,0x61746164,0x00000000,0x00040005,
+0x00000022,0x7366666f,0x00007465,0x00040005,
+0x00000023,0x426d756e,0x00737469,0x00030005,
+0x00000024,0x00000069,0x00090005,0x0000002b,
+0x6f636564,0x75516564,0x28746e69,0x3b347576,
+0x753b3175,0x31753b31,0x0000003b,0x00040005,
+0x00000027,0x61746164,0x00000000,0x00040005,
+0x00000028,0x7366666f,0x00007465,0x00040005,
+0x00000029,0x426d756e,0x00737469,0x00030005,
+0x0000002a,0x00000069,0x000a0005,0x00000032,
+0x6f636564,0x57316564,0x68676965,0x75762874,
+0x75763b34,0x31753b33,0x3b31753b,0x00000000,
+0x00050005,0x0000002e,0x67696577,0x61447468,
+0x00006174,0x00050005,0x0000002f,0x6f636e65,
+0x676e6964,0x00000000,0x00050005,0x00000030,
+0x576d756e,0x68676965,0x00007374,0x00040005,
+0x00000031,0x65646e69,0x00000078,0x000e0005,
+0x0000003f,0x65746e69,0x6c6f7072,0x57657461,
+0x68676965,0x76287374,0x763b3475,0x753b3375,
+0x31753b31,0x3b31753b,0x753b3175,0x75763b31,
+0x00003b32,0x00050005,0x00000037,0x67696577,
+0x61447468,0x00006174,0x00050005,0x00000038,
+0x6f636e65,0x676e6964,0x00000000,0x00050005,
+0x00000039,0x576d756e,0x68676965,0x00007374,
+0x00040005,0x0000003a,0x65646e69,0x00000078,
+0x00050005,0x0000003b,0x64697267,0x74646957,
+0x00000068,0x00040005,0x0000003c,0x69727473,
+0x00006564,0x00040005,0x0000003d,0x7366666f,
+0x00007465,0x00060005,0x0000003e,0x63617266,
+0x6e6f6974,0x61506c61,0x00007472,0x00080005,
+0x00000044,0x6f636564,0x65576564,0x74686769,
+0x75762873,0x75763b34,0x00003b32,0x00050005,
+0x00000042,0x67696577,0x61447468,0x00006174,
+0x00050005,0x00000043,0x49736f70,0x6f6c426e,
+0x00006b63,0x00050005,0x00000048,0x68736168,
+0x75283235,0x00003b31,0x00030005,0x00000047,
+0x00000070,0x00090005,0x0000004e,0x656c6573,
+0x61507463,0x74697472,0x286e6f69,0x763b3175,
+0x753b3275,0x00003b31,0x00040005,0x0000004b,
+0x64656573,0x00000000,0x00030005,0x0000004c,
+0x00736f70,0x00060005,0x0000004d,0x506d756e,
+0x69747261,0x6e6f6974,0x00000073,0x000a0005,
+0x00000054,0x45746567,0x6f70646e,0x45746e69,
+0x646f636e,0x28676e69,0x753b3175,0x31753b31,
+0x0000003b,0x00080005,0x00000051,0x69617661,
+0x6c62616c,0x646e4565,0x6e696f70,0x74694274,
+0x00000073,0x00060005,0x00000052,0x456d756e,
+0x6f70646e,0x73746e69,0x00000000,0x00050005,
+0x00000053,0x75746361,0x69536c61,0x0000657a,
+0x00070005,0x0000005b,0x65756c62,0x746e6f43,
+0x74636172,0x34697628,0x0000003b,0x00030005,
+0x0000005a,0x00000076,0x00050005,0x00000061,
+0x286d7573,0x3b336976,0x00000000,0x00030005,
+0x00000060,0x00000076,0x00090005,0x00000066,
+0x54746962,0x736e6172,0x53726566,0x656e6769,
+0x69762864,0x69763b34,0x00003b34,0x00030005,
+0x00000064,0x00000061,0x00030005,0x00000065,
+0x00000062,0x000b0005,0x0000006e,0x6f636564,
+0x6e456564,0x696f7064,0x2873746e,0x3b346976,
+0x3b346976,0x763b3175,0x763b3475,0x003b3475,
+0x00030005,0x00000069,0x00004176,0x00030005,
+0x0000006a,0x00004276,0x00040005,0x0000006b,
+0x65646f6d,0x00000000,0x00030005,0x0000006c,
+0x00307065,0x00030005,0x0000006d,0x00317065,
+0x000a0005,0x00000075,0x6f636564,0x45316564,
+0x6f70646e,0x28746e69,0x3b347576,0x753b3175,
+0x75763b31,0x00003b33,0x00040005,0x00000071,
+0x61746164,0x00000000,0x00050005,0x00000072,
+0x72617473,0x66664f74,0x00746573,0x00040005,
+0x00000073,0x65646e69,0x00000078,0x00050005,
+0x00000074,0x6f636e65,0x676e6964,0x00000000,
+0x00070005,0x00000079,0x6c697562,0x74694264,
+0x6b73616d,0x3b317528,0x00000000,0x00040005,
+0x00000078,0x73746962,0x00000000,0x00080005,
+0x0000007d,0x63747361,0x6f636544,0x65546564,
+0x286c6578,0x3b327576,0x00000000,0x00050005,
+0x0000007c,0x49736f70,0x6f6c426e,0x00006b63,
+0x00070005,0x00000081,0x50746567,0x4432736f,
+0x61727241,0x69762879,0x00003b33,0x00030005,
+0x00000080,0x00736f70,0x00050005,0x00000085,
+0x6f636564,0x72456564,0x00726f72,0x00040005,
+0x00000087,0x69427174,0x00007374,0x00050005,
+0x000000a7,0x64696f76,0x65747845,0x0000746e,
+0x00050005,0x000000a9,0x63747361,0x636f6c42,
+0x0000006b,0x00040005,0x000000b5,0x73746962,
+0x00003130,0x00040005,0x000000bb,0x73746962,
+0x00003332,0x00040005,0x000000bf,0x34746962,
+0x00000000,0x00040005,0x000000c5,0x73746962,
+0x00003635,0x00040005,0x000000ca,0x73746962,
+0x00003837,0x00030005,0x000000cf,0x00000068,
+0x00050005,0x000000d4,0x6c617564,0x6e616c50,
+0x00000065,0x00030005,0x000000de,0x00000072,
+0x00060005,0x000000ea,0x67696577,0x72477468,
+0x69536469,0x0000657a,0x00070005,0x0000013e,
+0x67616d49,0x726f4665,0x4274616d,0x6b636f6c,
+0x00000000,0x00060006,0x0000013e,0x00000000,
+0x636f6c62,0x7a69536b,0x00000065,0x00060006,
+0x0000013e,0x00000001,0x65736162,0x6579614c,
+0x00000072,0x00060006,0x0000013e,0x00000002,
+0x6c616d73,0x6f6c426c,0x00006b63,0x00060005,
+0x00000140,0x75705f75,0x6f436873,0x6174736e,
+0x0000746e,0x00060005,0x0000014b,0x67696577,
+0x6e457468,0x69646f63,0x0000676e,0x00050005,
+0x00000162,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000165,0x576d756e,0x68676965,
+0x00007374,0x00060005,0x0000016e,0x67696577,
+0x61447468,0x69536174,0x0000657a,0x00040005,
+0x0000016f,0x61726170,0x0000006d,0x00040005,
+0x00000171,0x61726170,0x0000006d,0x00060005,
+0x00000182,0x506d756e,0x69747261,0x6e6f6974,
+0x00000073,0x00060005,0x0000018c,0x74726170,
+0x6f697469,0x6565536e,0x00000064,0x00030005,
+0x0000019d,0x00000069,0x00030005,0x000001a2,
+0x0000006a,0x00040005,0x000001a9,0x72617473,
+0x00000074,0x00050005,0x000001bc,0x4c6d756e,
+0x6942776f,0x00007374,0x00040005,0x000001bf,
+0x42776f6c,0x00737469,0x00050005,0x000001c8,
+0x68676968,0x73746942,0x00000000,0x00030005,
+0x000001df,0x006d6563,0x00050005,0x000001ea,
+0x536d6563,0x63656c65,0x00726f74,0x00040005,
+0x000001ef,0x65736162,0x006d6543,0x00080005,
+0x000001fa,0x70646e65,0x746e696f,0x72655073,
+0x74726150,0x6f697469,0x0000006e,0x00060005,
+0x00000208,0x657a6973,0x7845664f,0x43617274,
+0x00006d65,0x00050005,0x00000210,0x72747865,
+0x6d654361,0x00000000,0x00040005,0x00000211,
+0x61726170,0x0000006d,0x00040005,0x00000213,
+0x61726170,0x0000006d,0x00040005,0x00000215,
+0x61726170,0x0000006d,0x00040005,0x00000218,
+0x6c6c7566,0x006d6543,0x00040005,0x0000021d,
+0x6c61566d,0x00006575,0x00040005,0x00000225,
+0x6c615663,0x00736575,0x00050005,0x0000023d,
+0x65736162,0x73616c43,0x00000073,0x00050005,
+0x0000024c,0x6d756e69,0x73746942,0x00000000,
+0x00040005,0x0000024f,0x636f6c62,0x0000006b,
+0x00040005,0x00000256,0x61726170,0x0000006d,
+0x00040005,0x00000258,0x61726170,0x0000006d,
+0x00040005,0x00000259,0x61726170,0x0000006d,
+0x00050005,0x0000025b,0x6b636170,0x72546465,
+0x00737469,0x00040005,0x0000027e,0x42776f6c,
+0x00737469,0x00040005,0x0000027f,0x61726170,
+0x0000006d,0x00040005,0x00000281,0x61726170,
+0x0000006d,0x00040005,0x00000283,0x61726170,
+0x0000006d,0x00030005,0x00000287,0x0000006a,
+0x00040005,0x00000295,0x6f636564,0x00646564,
+0x00050005,0x0000037f,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x0000038d,0x6d756e69,
+0x73746942,0x00000000,0x00040005,0x00000390,
+0x636f6c62,0x0000006b,0x00040005,0x00000394,
+0x61726170,0x0000006d,0x00040005,0x00000396,
+0x61726170,0x0000006d,0x00040005,0x00000398,
+0x61726170,0x0000006d,0x00060005,0x0000039a,
+0x6b636170,0x75516465,0x73746e69,0x00000000,
+0x00040005,0x000003ac,0x42776f6c,0x00737469,
+0x00040005,0x000003b8,0x6f636564,0x00646564,
+0x00050005,0x000003f0,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000404,0x426d756e,
+0x00737469,0x00040005,0x0000040c,0x7366666f,
+0x00007465,0x00030005,0x00000413,0x00000077,
+0x00040005,0x00000416,0x61726170,0x0000006d,
+0x00040005,0x00000418,0x61726170,0x0000006d,
+0x00040005,0x0000041a,0x61726170,0x0000006d,
+0x00040005,0x0000041c,0x61726170,0x0000006d,
+0x00050005,0x00000435,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x0000043f,0x7366666f,
+0x00007465,0x00030005,0x00000446,0x00000077,
+0x00040005,0x00000449,0x61726170,0x0000006d,
+0x00040005,0x0000044b,0x61726170,0x0000006d,
+0x00040005,0x0000044d,0x61726170,0x0000006d,
+0x00040005,0x0000044f,0x61726170,0x0000006d,
+0x00050005,0x00000463,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000468,0x7366666f,
+0x00007465,0x00030005,0x0000046c,0x00000077,
+0x00040005,0x0000046d,0x61726170,0x0000006d,
+0x00040005,0x0000046f,0x61726170,0x0000006d,
+0x00040005,0x00000471,0x61726170,0x0000006d,
+0x00040005,0x00000474,0x75716e75,0x00746e61,
+0x00050005,0x00000480,0x65646e69,0x6c626178,
+0x00000065,0x00060005,0x00000495,0x67696577,
+0x6e497468,0x65636964,0x00000073,0x00040005,
+0x000004a3,0x67696577,0x00737468,0x00040005,
+0x000004a4,0x61726170,0x0000006d,0x00040005,
+0x000004a6,0x61726170,0x0000006d,0x00040005,
+0x000004a8,0x61726170,0x0000006d,0x00040005,
+0x000004aa,0x61726170,0x0000006d,0x00040005,
+0x000004ae,0x61726170,0x0000006d,0x00040005,
+0x000004b0,0x61726170,0x0000006d,0x00040005,
+0x000004b2,0x61726170,0x0000006d,0x00040005,
+0x000004b4,0x61726170,0x0000006d,0x00040005,
+0x000004b8,0x61726170,0x0000006d,0x00040005,
+0x000004ba,0x61726170,0x0000006d,0x00040005,
+0x000004bc,0x61726170,0x0000006d,0x00040005,
+0x000004be,0x61726170,0x0000006d,0x00040005,
+0x000004c2,0x61726170,0x0000006d,0x00040005,
+0x000004c4,0x61726170,0x0000006d,0x00040005,
+0x000004c6,0x61726170,0x0000006d,0x00040005,
+0x000004c8,0x61726170,0x0000006d,0x00030005,
+0x000004cd,0x00313177,0x00040005,0x000004d5,
+0x74636166,0x0073726f,0x00050005,0x000004f5,
+0x6c616373,0x63614665,0x00726f74,0x00070005,
+0x00000502,0x6f6d6f68,0x656e6567,0x4373756f,
+0x64726f6f,0x00000073,0x00050005,0x00000505,
+0x64697267,0x726f6f43,0x00007364,0x00060005,
+0x00000511,0x65746e69,0x6c617267,0x74726150,
+0x00000000,0x00060005,0x00000515,0x63617266,
+0x6e6f6974,0x61506c61,0x00007472,0x00050005,
+0x0000051a,0x64697267,0x74646957,0x00000068,
+0x00030005,0x0000051d,0x00003076,0x00040005,
+0x00000525,0x67696577,0x00737468,0x00040005,
+0x0000052b,0x61726170,0x0000006d,0x00040005,
+0x0000052d,0x61726170,0x0000006d,0x00040005,
+0x0000052f,0x61726170,0x0000006d,0x00040005,
+0x00000531,0x61726170,0x0000006d,0x00040005,
+0x00000533,0x61726170,0x0000006d,0x00040005,
+0x00000535,0x61726170,0x0000006d,0x00040005,
+0x00000536,0x61726170,0x0000006d,0x00040005,
+0x00000537,0x61726170,0x0000006d,0x00040005,
+0x0000053e,0x61726170,0x0000006d,0x00040005,
+0x00000540,0x61726170,0x0000006d,0x00040005,
+0x00000542,0x61726170,0x0000006d,0x00040005,
+0x00000544,0x61726170,0x0000006d,0x00040005,
+0x00000546,0x61726170,0x0000006d,0x00040005,
+0x00000548,0x61726170,0x0000006d,0x00040005,
+0x00000549,0x61726170,0x0000006d,0x00040005,
+0x0000054a,0x61726170,0x0000006d,0x00040005,
+0x00000592,0x6d756e72,0x00000000,0x00040005,
+0x00000593,0x61726170,0x0000006d,0x00040005,
+0x00000596,0x64656573,0x00000041,0x00040005,
+0x000005a2,0x64656573,0x00000042,0x00040005,
+0x000005b5,0x66696873,0x00317374,0x00040005,
+0x000005c0,0x66696873,0x00327374,0x00040005,
+0x000005d3,0x75736572,0x0000746c,0x00030005,
+0x0000062a,0x00000069,0x00050005,0x00000632,
+0x6f636e65,0x676e6964,0x00000000,0x00050005,
+0x00000640,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000643,0x61726170,0x0000006d,
+0x00040005,0x00000645,0x61726170,0x0000006d,
+0x00030005,0x0000069f,0x0000306c,0x00030005,
+0x000006a8,0x0000316c,0x00040005,0x000006c6,
+0x61726170,0x0000006d,0x00040005,0x000006c8,
+0x61726170,0x0000006d,0x00040005,0x00000715,
+0x61726170,0x0000006d,0x00040005,0x00000719,
+0x61726170,0x0000006d,0x00040005,0x00000725,
+0x61726170,0x0000006d,0x00040005,0x00000729,
+0x61726170,0x0000006d,0x00040005,0x00000731,
+0x61726170,0x0000006d,0x00040005,0x00000733,
+0x61726170,0x0000006d,0x00040005,0x00000738,
+0x61726170,0x0000006d,0x00040005,0x0000074f,
+0x61726170,0x0000006d,0x00040005,0x00000755,
+0x61726170,0x0000006d,0x00040005,0x0000075f,
+0x426d756e,0x00737469,0x00040005,0x00000767,
+0x7366666f,0x00007465,0x00030005,0x00000770,
+0x00007065,0x00040005,0x00000773,0x61726170,
+0x0000006d,0x00040005,0x00000775,0x61726170,
+0x0000006d,0x00040005,0x00000777,0x61726170,
+0x0000006d,0x00040005,0x00000779,0x61726170,
+0x0000006d,0x00050005,0x000007e1,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x000007eb,
+0x7366666f,0x00007465,0x00030005,0x000007f4,
+0x00007065,0x00040005,0x000007f7,0x61726170,
+0x0000006d,0x00040005,0x000007f9,0x61726170,
+0x0000006d,0x00040005,0x000007fb,0x61726170,
+0x0000006d,0x00040005,0x000007fd,0x61726170,
+0x0000006d,0x00050005,0x0000080f,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000814,
+0x7366666f,0x00007465,0x00030005,0x0000081a,
+0x00000077,0x00040005,0x0000081b,0x61726170,
+0x0000006d,0x00040005,0x0000081d,0x61726170,
+0x0000006d,0x00040005,0x0000081f,0x61726170,
+0x0000006d,0x00040005,0x00000822,0x75716e75,
+0x00746e61,0x00050005,0x0000082f,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000083d,
+0x426d756e,0x00737469,0x00040005,0x00000846,
+0x6b73616d,0x00000000,0x00050005,0x00000872,
+0x67696577,0x61447468,0x00006174,0x00040005,
+0x00000876,0x61726170,0x0000006d,0x00040005,
+0x0000087a,0x67696577,0x00737468,0x00040005,
+0x0000087b,0x61726170,0x0000006d,0x00060005,
+0x0000087e,0x74726170,0x6f697469,0x646e496e,
+0x00007865,0x00040005,0x0000087f,0x61726170,
+0x0000006d,0x00040005,0x00000881,0x61726170,
+0x0000006d,0x00040005,0x00000882,0x61726170,
+0x0000006d,0x00060005,0x00000885,0x72617473,
+0x45664f74,0x61727478,0x006d6543,0x00060005,
+0x00000886,0x61746f74,0x646e456c,0x6e696f70,
+0x00007374,0x00070005,0x00000887,0x65736162,
+0x70646e45,0x746e696f,0x65646e49,0x00000078,
+0x00030005,0x00000888,0x006d6563,0x00040005,
+0x00000889,0x61726170,0x0000006d,0x00040005,
+0x0000088b,0x61726170,0x0000006d,0x00040005,
+0x0000088c,0x61726170,0x0000006d,0x00040005,
+0x0000088d,0x61726170,0x0000006d,0x00060005,
+0x00000897,0x70646e65,0x746e696f,0x61745373,
+0x00007472,0x00060005,0x0000089d,0x70646e65,
+0x746e696f,0x646e4573,0x00000000,0x00080005,
+0x000008a5,0x69617661,0x6c62616c,0x646e4565,
+0x6e696f70,0x74694274,0x00000073,0x00070005,
+0x000008a9,0x70646e65,0x746e696f,0x6f636e45,
+0x676e6964,0x00000000,0x00070005,0x000008aa,
+0x75746361,0x6e456c61,0x696f7064,0x6942746e,
+0x00007374,0x00040005,0x000008ab,0x61726170,
+0x0000006d,0x00040005,0x000008ad,0x61726170,
+0x0000006d,0x00040005,0x000008af,0x61726170,
+0x0000006d,0x00070005,0x000008b2,0x456d756e,
+0x6f70646e,0x50746e69,0x73726961,0x00000000,
+0x00030005,0x000008b6,0x00004176,0x00030005,
+0x000008b7,0x00004276,0x00040005,0x000008b8,
+0x61447065,0x00006174,0x00040005,0x000008bd,
+0x61726170,0x0000006d,0x00030005,0x000008c0,
+0x00000069,0x00040005,0x000008c9,0x64497065,
+0x00000078,0x00040005,0x000008cf,0x61726170,
+0x0000006d,0x00040005,0x000008d1,0x61726170,
+0x0000006d,0x00040005,0x000008d3,0x61726170,
+0x0000006d,0x00040005,0x000008d5,0x61726170,
+0x0000006d,0x00040005,0x000008dd,0x61726170,
+0x0000006d,0x00040005,0x000008df,0x61726170,
+0x0000006d,0x00040005,0x000008e1,0x61726170,
+0x0000006d,0x00040005,0x000008e2,0x61726170,
+0x0000006d,0x00030005,0x000008e9,0x00307065,
+0x00030005,0x000008ea,0x00317065,0x00040005,
+0x000008eb,0x61726170,0x0000006d,0x00040005,
+0x000008ed,0x61726170,0x0000006d,0x00040005,
+0x000008ef,0x61726170,0x0000006d,0x00040005,
+0x000008f1,0x61726170,0x0000006d,0x00040005,
+0x000008f2,0x61726170,0x0000006d,0x00070005,
+0x000008f6,0x67696577,0x50737468,0x68437265,
+0x656e6e61,0x0000006c,0x00030005,0x000008fd,
+0x00736363,0x00040005,0x000008fe,0x61726170,
+0x0000006d,0x00040005,0x00000900,0x61726170,
+0x0000006d,0x00040005,0x00000902,0x61726170,
+0x0000006d,0x00050005,0x0000091a,0x65786574,
+0x736f506c,0x00000000,0x00080005,0x0000091c,
+0x475f6c67,0x61626f6c,0x766e496c,0x7461636f,
+0x496e6f69,0x00000044,0x00040005,0x0000091f,
+0x6579616c,0x00000072,0x00050005,0x00000926,
+0x636f6c62,0x736f506b,0x00000000,0x00050005,
+0x0000092b,0x49736f70,0x6f6c426e,0x00006b63,
+0x00050005,0x00000932,0x49637273,0x6567616d,
+0x00000000,0x00040005,0x0000093b,0x61726170,
+0x0000006d,0x00040005,0x0000093f,0x65786574,
+0x0000006c,0x00050005,0x00000944,0x49747364,
+0x6567616d,0x00000000,0x00040005,0x0000094d,
+0x61726170,0x0000006d,0x00050048,0x0000013e,
+0x00000000,0x00000023,0x00000000,0x00050048,
+0x0000013e,0x00000001,0x00000023,0x00000008,
+0x00050048,0x0000013e,0x00000002,0x00000023,
+0x0000000c,0x00030047,0x0000013e,0x00000002,
+0x00040047,0x0000091c,0x0000000b,0x0000001c,
+0x00040047,0x00000932,0x00000022,0x00000000,
+0x00040047,0x00000932,0x00000021,0x00000000,
+0x00030047,0x00000932,0x00000018,0x00040047,
+0x00000944,0x00000022,0x00000000,0x00040047,
+0x00000944,0x00000021,0x00000001,0x00030047,
+0x00000944,0x00000019,0x00040047,0x00000950,
+0x0000000b,0x00000019,0x00020013,0x00000002,
+0x00030021,0x00000003,0x00000002,0x00040015,
+0x00000006,0x00000020,0x00000000,0x00040020,
+0x00000007,0x00000007,0x00000006,0x00040017,
+0x00000008,0x00000006,0x00000003,0x00040020,
+0x00000009,0x00000007,0x00000008,0x00050021,
+0x0000000a,0x00000006,0x00000007,0x00000009,
+0x00040017,0x00000011,0x00000006,0x00000004,
+0x00040020,0x00000012,0x00000007,0x00000011,
+0x00060021,0x00000013,0x00000006,0x00000012,
+0x00000007,0x00000007,0x00070021,0x00000019,
+0x00000006,0x00000007,0x00000007,0x00000007,
+0x00000007,0x00070021,0x00000020,0x00000006,
+0x00000012,0x00000007,0x00000007,0x00000007,
+0x00070021,0x0000002d,0x00000006,0x00000012,
+0x00000009,0x00000007,0x00000007,0x00040017,
+0x00000034,0x00000006,0x00000002,0x00040020,
+0x00000035,0x00000007,0x00000034,0x000b0021,
+0x00000036,0x00000006,0x00000012,0x00000009,
+0x00000007,0x00000007,0x00000007,0x00000007,
+0x00000007,0x00000035,0x00050021,0x00000041,
+0x00000034,0x00000012,0x00000034,0x00040021,
+0x00000046,0x00000006,0x00000007,0x00060021,
+0x0000004a,0x00000006,0x00000007,0x00000035,
+0x00000007,0x00060021,0x00000050,0x00000008,
+0x00000007,0x00000007,0x00000007,0x00040015,
+0x00000056,0x00000020,0x00000001,0x00040017,
+0x00000057,0x00000056,0x00000004,0x00040020,
+0x00000058,0x00000007,0x00000057,0x00040021,
+0x00000059,0x00000057,0x00000058,0x00040017,
+0x0000005d,0x00000056,0x00000003,0x00040020,
+0x0000005e,0x00000007,0x0000005d,0x00040021,
+0x0000005f,0x00000056,0x0000005e,0x00050021,
+0x00000063,0x00000002,0x00000058,0x00000058,
+0x00080021,0x00000068,0x00000002,0x00000058,
+0x00000058,0x00000007,0x00000012,0x00000012,
+0x00070021,0x00000070,0x00000006,0x00000012,
+0x00000007,0x00000007,0x00000009,0x00040021,
+0x00000077,0x00000011,0x00000007,0x00040021,
+0x0000007b,0x00000011,0x00000034,0x00040021,
+0x0000007f,0x0000005d,0x0000005e,0x00020014,
+0x00000083,0x00040020,0x00000084,0x00000006,
+0x00000083,0x0004003b,0x00000084,0x00000085,
+0x00000006,0x0003002a,0x00000083,0x00000086,
+0x0004002b,0x00000006,0x0000008d,0x00000008,
+0x0004002b,0x00000006,0x0000008e,0x00000007,
+0x0005002c,0x00000034,0x0000008f,0x0000008d,
+0x0000008e,0x0004002b,0x00000006,0x00000091,
+0x00000004,0x0004002b,0x00000006,0x00000092,
+0x00000002,0x0005002c,0x00000034,0x00000093,
+0x00000091,0x00000092,0x0004002b,0x00000006,
+0x00000095,0x00000005,0x0004002b,0x00000006,
+0x00000096,0x00000003,0x0005002c,0x00000034,
+0x00000097,0x00000095,0x00000096,0x0004002b,
+0x00000006,0x0000009d,0x00000000,0x0004002b,
+0x00000006,0x000000a0,0x00000001,0x0004003b,
+0x00000084,0x000000a7,0x00000006,0x00040020,
+0x000000a8,0x00000006,0x00000011,0x0004003b,
+0x000000a8,0x000000a9,0x00000006,0x00040020,
+0x000000aa,0x00000006,0x00000006,0x0004002b,
+0x00000006,0x000000ad,0x000001ff,0x0004002b,
+0x00000006,0x000000af,0x000001fc,0x0004002b,
+0x00000056,0x000000b8,0x00000000,0x0004002b,
+0x00000056,0x000000b9,0x00000002,0x0004002b,
+0x00000056,0x000000c2,0x00000004,0x0004002b,
+0x00000056,0x000000c3,0x00000001,0x0004002b,
+0x00000056,0x000000c8,0x00000005,0x0004002b,
+0x00000056,0x000000cd,0x00000007,0x0004002b,
+0x00000056,0x000000d2,0x00000009,0x0004003b,
+0x00000084,0x000000d4,0x00000006,0x0004002b,
+0x00000056,0x000000d7,0x0000000a,0x00040020,
+0x000000e9,0x00000006,0x00000034,0x0004003b,
+0x000000e9,0x000000ea,0x00000006,0x0004002b,
+0x00000006,0x000000eb,0x0000000c,0x0004002b,
+0x00000006,0x000000f5,0x00000006,0x0004002b,
+0x00000006,0x00000101,0x0000000a,0x0005002c,
+0x00000034,0x00000102,0x000000f5,0x00000101,
+0x0005002c,0x00000034,0x00000108,0x00000101,
+0x000000f5,0x00030029,0x00000083,0x0000010a,
+0x0005001e,0x0000013e,0x00000034,0x00000006,
+0x00000006,0x00040020,0x0000013f,0x00000009,
+0x0000013e,0x0004003b,0x0000013f,0x00000140,
+0x00000009,0x00040020,0x00000141,0x00000009,
+0x00000034,0x00040017,0x00000144,0x00000083,
+0x00000002,0x00040020,0x0000014a,0x00000006,
+0x00000008,0x0004003b,0x0000014a,0x0000014b,
+0x00000006,0x0004002b,0x00000006,0x0000014c,
+0x00000010,0x0004001c,0x0000014d,0x00000008,
+0x0000014c,0x0006002c,0x00000008,0x0000014e,
+0x0000009d,0x0000009d,0x0000009d,0x0006002c,
+0x00000008,0x0000014f,0x0000009d,0x0000009d,
+0x000000a0,0x0006002c,0x00000008,0x00000150,
+0x000000a0,0x0000009d,0x0000009d,0x0006002c,
+0x00000008,0x00000151,0x0000009d,0x0000009d,
+0x00000092,0x0006002c,0x00000008,0x00000152,
+0x0000009d,0x000000a0,0x0000009d,0x0006002c,
+0x00000008,0x00000153,0x000000a0,0x0000009d,
+0x000000a0,0x0006002c,0x00000008,0x00000154,
+0x0000009d,0x0000009d,0x00000096,0x0006002c,
+0x00000008,0x00000155,0x0000009d,0x000000a0,
+0x000000a0,0x0006002c,0x00000008,0x00000156,
+0x000000a0,0x0000009d,0x00000092,0x0006002c,
+0x00000008,0x00000157,0x0000009d,0x0000009d,
+0x00000091,0x0006002c,0x00000008,0x00000158,
+0x0000009d,0x000000a0,0x00000092,0x0006002c,
+0x00000008,0x00000159,0x000000a0,0x0000009d,
+0x00000096,0x0006002c,0x00000008,0x0000015a,
+0x0000009d,0x0000009d,0x00000095,0x0013002c,
+0x0000014d,0x0000015b,0x0000014e,0x0000014e,
+0x0000014f,0x00000150,0x00000151,0x00000152,
+0x00000153,0x00000154,0x0000014e,0x0000014e,
+0x00000155,0x00000156,0x00000157,0x00000158,
+0x00000159,0x0000015a,0x0004002b,0x00000056,
+0x0000015d,0x00000003,0x00040020,0x00000161,
+0x00000007,0x0000014d,0x0004003b,0x000000aa,
+0x00000165,0x00000006,0x0004003b,0x000000aa,
+0x0000016e,0x00000006,0x0004002b,0x00000006,
+0x00000175,0x00000018,0x0004002b,0x00000006,
+0x00000178,0x00000060,0x0004002b,0x00000006,
+0x0000017c,0x00000040,0x0004003b,0x000000aa,
+0x00000182,0x00000006,0x0004002b,0x00000056,
+0x00000185,0x0000000b,0x0004003b,0x000000aa,
+0x0000018c,0x00000006,0x0004002b,0x00000056,
+0x0000018f,0x0000000d,0x0004002b,0x00000006,
+0x0000019f,0x00000020,0x0004002b,0x00000006,
+0x000001ab,0x0000001f,0x0004002b,0x00000006,
+0x000001dc,0x00000080,0x0004002b,0x00000056,
+0x000001ed,0x00000017,0x0004002b,0x00000056,
+0x000001f2,0x00000019,0x00040020,0x0000024b,
+0x00000007,0x00000056,0x0007002c,0x00000057,
+0x0000028f,0x000000b9,0x000000c2,0x000000c8,
+0x000000cd,0x0004002b,0x00000006,0x00000296,
+0x00000100,0x0004001c,0x00000297,0x00000006,
+0x00000296,0x0004002b,0x00000006,0x00000298,
+0x00000021,0x0004002b,0x00000006,0x00000299,
+0x00000009,0x0004002b,0x00000006,0x0000029a,
+0x00000022,0x0004002b,0x00000006,0x0000029b,
+0x00000028,0x0004002b,0x00000006,0x0000029c,
+0x00000029,0x0004002b,0x00000006,0x0000029d,
+0x0000002a,0x0004002b,0x00000006,0x0000029e,
+0x00000011,0x0004002b,0x00000006,0x0000029f,
+0x00000012,0x0004002b,0x00000006,0x000002a0,
+0x00000024,0x0004002b,0x00000006,0x000002a1,
+0x00000014,0x0004002b,0x00000006,0x000002a2,
+0x00000015,0x0004002b,0x00000006,0x000002a3,
+0x00000016,0x0004002b,0x00000006,0x000002a4,
+0x00000025,0x0004002b,0x00000006,0x000002a5,
+0x00000019,0x0004002b,0x00000006,0x000002a6,
+0x0000001a,0x0004002b,0x00000006,0x000002a7,
+0x00000026,0x0004002b,0x00000006,0x000002a8,
+0x00000280,0x0004002b,0x00000006,0x000002a9,
+0x00000281,0x0004002b,0x00000006,0x000002aa,
+0x00000282,0x0004002b,0x00000006,0x000002ab,
+0x000002a0,0x0004002b,0x00000006,0x000002ac,
+0x00000041,0x0004002b,0x00000006,0x000002ad,
+0x00000042,0x0004002b,0x00000006,0x000002ae,
+0x00000044,0x0004002b,0x00000006,0x000002af,
+0x00000045,0x0004002b,0x00000006,0x000002b0,
+0x00000046,0x0004002b,0x00000006,0x000002b1,
+0x00000061,0x0004002b,0x00000006,0x000002b2,
+0x00000048,0x0004002b,0x00000006,0x000002b3,
+0x00000049,0x0004002b,0x00000006,0x000002b4,
+0x0000004a,0x0004002b,0x00000006,0x000002b5,
+0x00000062,0x0004002b,0x00000006,0x000002b6,
+0x00000068,0x0004002b,0x00000006,0x000002b7,
+0x00000069,0x0004002b,0x00000006,0x000002b8,
+0x0000006a,0x0004002b,0x00000006,0x000002b9,
+0x00000050,0x0004002b,0x00000006,0x000002ba,
+0x00000051,0x0004002b,0x00000006,0x000002bb,
+0x00000052,0x0004002b,0x00000006,0x000002bc,
+0x00000064,0x0004002b,0x00000006,0x000002bd,
+0x00000054,0x0004002b,0x00000006,0x000002be,
+0x00000055,0x0004002b,0x00000006,0x000002bf,
+0x00000056,0x0004002b,0x00000006,0x000002c0,
+0x00000065,0x0004002b,0x00000006,0x000002c1,
+0x00000058,0x0004002b,0x00000006,0x000002c2,
+0x00000059,0x0004002b,0x00000006,0x000002c3,
+0x0000005a,0x0004002b,0x00000006,0x000002c4,
+0x00000066,0x0004002b,0x00000006,0x000002c5,
+0x00000284,0x0004002b,0x00000006,0x000002c6,
+0x00000285,0x0004002b,0x00000006,0x000002c7,
+0x00000286,0x0004002b,0x00000006,0x000002c8,
+0x000002a1,0x0004002b,0x00000006,0x000002c9,
+0x00000081,0x0004002b,0x00000006,0x000002ca,
+0x00000082,0x0004002b,0x00000006,0x000002cb,
+0x000000a0,0x0004002b,0x00000006,0x000002cc,
+0x00000084,0x0004002b,0x00000006,0x000002cd,
+0x00000085,0x0004002b,0x00000006,0x000002ce,
+0x00000086,0x0004002b,0x00000006,0x000002cf,
+0x000000a1,0x0004002b,0x00000006,0x000002d0,
+0x00000088,0x0004002b,0x00000006,0x000002d1,
+0x00000089,0x0004002b,0x00000006,0x000002d2,
+0x0000008a,0x0004002b,0x00000006,0x000002d3,
+0x000000a2,0x0004002b,0x00000006,0x000002d4,
+0x000000a8,0x0004002b,0x00000006,0x000002d5,
+0x000000a9,0x0004002b,0x00000006,0x000002d6,
+0x000000aa,0x0004002b,0x00000006,0x000002d7,
+0x00000090,0x0004002b,0x00000006,0x000002d8,
+0x00000091,0x0004002b,0x00000006,0x000002d9,
+0x00000092,0x0004002b,0x00000006,0x000002da,
+0x000000a4,0x0004002b,0x00000006,0x000002db,
+0x00000094,0x0004002b,0x00000006,0x000002dc,
+0x00000095,0x0004002b,0x00000006,0x000002dd,
+0x00000096,0x0004002b,0x00000006,0x000002de,
+0x000000a5,0x0004002b,0x00000006,0x000002df,
+0x00000098,0x0004002b,0x00000006,0x000002e0,
+0x00000099,0x0004002b,0x00000006,0x000002e1,
+0x0000009a,0x0004002b,0x00000006,0x000002e2,
+0x000000a6,0x0004002b,0x00000006,0x000002e3,
+0x00000288,0x0004002b,0x00000006,0x000002e4,
+0x00000289,0x0004002b,0x00000006,0x000002e5,
+0x0000028a,0x0004002b,0x00000006,0x000002e6,
+0x000002a2,0x0004002b,0x00000006,0x000002e7,
+0x00000200,0x0004002b,0x00000006,0x000002e8,
+0x00000201,0x0004002b,0x00000006,0x000002e9,
+0x00000202,0x0004002b,0x00000006,0x000002ea,
+0x00000220,0x0004002b,0x00000006,0x000002eb,
+0x00000204,0x0004002b,0x00000006,0x000002ec,
+0x00000205,0x0004002b,0x00000006,0x000002ed,
+0x00000206,0x0004002b,0x00000006,0x000002ee,
+0x00000221,0x0004002b,0x00000006,0x000002ef,
+0x00000208,0x0004002b,0x00000006,0x000002f0,
+0x00000209,0x0004002b,0x00000006,0x000002f1,
+0x0000020a,0x0004002b,0x00000006,0x000002f2,
+0x00000222,0x0004002b,0x00000006,0x000002f3,
+0x00000228,0x0004002b,0x00000006,0x000002f4,
+0x00000229,0x0004002b,0x00000006,0x000002f5,
+0x0000022a,0x0004002b,0x00000006,0x000002f6,
+0x00000210,0x0004002b,0x00000006,0x000002f7,
+0x00000211,0x0004002b,0x00000006,0x000002f8,
+0x00000212,0x0004002b,0x00000006,0x000002f9,
+0x00000224,0x0004002b,0x00000006,0x000002fa,
+0x00000214,0x0004002b,0x00000006,0x000002fb,
+0x00000215,0x0004002b,0x00000006,0x000002fc,
+0x00000216,0x0004002b,0x00000006,0x000002fd,
+0x00000225,0x0004002b,0x00000006,0x000002fe,
+0x00000218,0x0004002b,0x00000006,0x000002ff,
+0x00000219,0x0004002b,0x00000006,0x00000300,
+0x0000021a,0x0004002b,0x00000006,0x00000301,
+0x00000226,0x0004002b,0x00000006,0x00000302,
+0x000002a8,0x0004002b,0x00000006,0x00000303,
+0x000002a9,0x0004002b,0x00000006,0x00000304,
+0x000002aa,0x0004002b,0x00000006,0x00000305,
+0x00000101,0x0004002b,0x00000006,0x00000306,
+0x00000102,0x0004002b,0x00000006,0x00000307,
+0x00000120,0x0004002b,0x00000006,0x00000308,
+0x00000104,0x0004002b,0x00000006,0x00000309,
+0x00000105,0x0004002b,0x00000006,0x0000030a,
+0x00000106,0x0004002b,0x00000006,0x0000030b,
+0x00000121,0x0004002b,0x00000006,0x0000030c,
+0x00000108,0x0004002b,0x00000006,0x0000030d,
+0x00000109,0x0004002b,0x00000006,0x0000030e,
+0x0000010a,0x0004002b,0x00000006,0x0000030f,
+0x00000122,0x0004002b,0x00000006,0x00000310,
+0x00000128,0x0004002b,0x00000006,0x00000311,
+0x00000129,0x0004002b,0x00000006,0x00000312,
+0x0000012a,0x0004002b,0x00000006,0x00000313,
+0x00000110,0x0004002b,0x00000006,0x00000314,
+0x00000111,0x0004002b,0x00000006,0x00000315,
+0x00000112,0x0004002b,0x00000006,0x00000316,
+0x00000124,0x0004002b,0x00000006,0x00000317,
+0x00000114,0x0004002b,0x00000006,0x00000318,
+0x00000115,0x0004002b,0x00000006,0x00000319,
+0x00000116,0x0004002b,0x00000006,0x0000031a,
+0x00000125,0x0004002b,0x00000006,0x0000031b,
+0x00000118,0x0004002b,0x00000006,0x0000031c,
+0x00000119,0x0004002b,0x00000006,0x0000031d,
+0x0000011a,0x0004002b,0x00000006,0x0000031e,
+0x00000126,0x0004002b,0x00000006,0x0000031f,
+0x00000290,0x0004002b,0x00000006,0x00000320,
+0x00000291,0x0004002b,0x00000006,0x00000321,
+0x00000292,0x0004002b,0x00000006,0x00000322,
+0x000002a4,0x0004002b,0x00000006,0x00000323,
+0x00000140,0x0004002b,0x00000006,0x00000324,
+0x00000141,0x0004002b,0x00000006,0x00000325,
+0x00000142,0x0004002b,0x00000006,0x00000326,
+0x00000160,0x0004002b,0x00000006,0x00000327,
+0x00000144,0x0004002b,0x00000006,0x00000328,
+0x00000145,0x0004002b,0x00000006,0x00000329,
+0x00000146,0x0004002b,0x00000006,0x0000032a,
+0x00000161,0x0004002b,0x00000006,0x0000032b,
+0x00000148,0x0004002b,0x00000006,0x0000032c,
+0x00000149,0x0004002b,0x00000006,0x0000032d,
+0x0000014a,0x0004002b,0x00000006,0x0000032e,
+0x00000162,0x0004002b,0x00000006,0x0000032f,
+0x00000168,0x0004002b,0x00000006,0x00000330,
+0x00000169,0x0004002b,0x00000006,0x00000331,
+0x0000016a,0x0004002b,0x00000006,0x00000332,
+0x00000150,0x0004002b,0x00000006,0x00000333,
+0x00000151,0x0004002b,0x00000006,0x00000334,
+0x00000152,0x0004002b,0x00000006,0x00000335,
+0x00000164,0x0004002b,0x00000006,0x00000336,
+0x00000154,0x0004002b,0x00000006,0x00000337,
+0x00000155,0x0004002b,0x00000006,0x00000338,
+0x00000156,0x0004002b,0x00000006,0x00000339,
+0x00000165,0x0004002b,0x00000006,0x0000033a,
+0x00000158,0x0004002b,0x00000006,0x0000033b,
+0x00000159,0x0004002b,0x00000006,0x0000033c,
+0x0000015a,0x0004002b,0x00000006,0x0000033d,
+0x00000166,0x0004002b,0x00000006,0x0000033e,
+0x00000294,0x0004002b,0x00000006,0x0000033f,
+0x00000295,0x0004002b,0x00000006,0x00000340,
+0x00000296,0x0004002b,0x00000006,0x00000341,
+0x000002a5,0x0004002b,0x00000006,0x00000342,
+0x00000180,0x0004002b,0x00000006,0x00000343,
+0x00000181,0x0004002b,0x00000006,0x00000344,
+0x00000182,0x0004002b,0x00000006,0x00000345,
+0x000001a0,0x0004002b,0x00000006,0x00000346,
+0x00000184,0x0004002b,0x00000006,0x00000347,
+0x00000185,0x0004002b,0x00000006,0x00000348,
+0x00000186,0x0004002b,0x00000006,0x00000349,
+0x000001a1,0x0004002b,0x00000006,0x0000034a,
+0x00000188,0x0004002b,0x00000006,0x0000034b,
+0x00000189,0x0004002b,0x00000006,0x0000034c,
+0x0000018a,0x0004002b,0x00000006,0x0000034d,
+0x000001a2,0x0004002b,0x00000006,0x0000034e,
+0x000001a8,0x0004002b,0x00000006,0x0000034f,
+0x000001a9,0x0004002b,0x00000006,0x00000350,
+0x000001aa,0x0004002b,0x00000006,0x00000351,
+0x00000190,0x0004002b,0x00000006,0x00000352,
+0x00000191,0x0004002b,0x00000006,0x00000353,
+0x00000192,0x0004002b,0x00000006,0x00000354,
+0x000001a4,0x0004002b,0x00000006,0x00000355,
+0x00000194,0x0004002b,0x00000006,0x00000356,
+0x00000195,0x0004002b,0x00000006,0x00000357,
+0x00000196,0x0004002b,0x00000006,0x00000358,
+0x000001a5,0x0004002b,0x00000006,0x00000359,
+0x00000198,0x0004002b,0x00000006,0x0000035a,
+0x00000199,0x0004002b,0x00000006,0x0000035b,
+0x0000019a,0x0004002b,0x00000006,0x0000035c,
+0x000001a6,0x0004002b,0x00000006,0x0000035d,
+0x00000298,0x0004002b,0x00000006,0x0000035e,
+0x00000299,0x0004002b,0x00000006,0x0000035f,
+0x0000029a,0x0004002b,0x00000006,0x00000360,
+0x000002a6,0x0004002b,0x00000006,0x00000361,
+0x00000240,0x0004002b,0x00000006,0x00000362,
+0x00000241,0x0004002b,0x00000006,0x00000363,
+0x00000242,0x0004002b,0x00000006,0x00000364,
+0x00000260,0x0004002b,0x00000006,0x00000365,
+0x00000244,0x0004002b,0x00000006,0x00000366,
+0x00000245,0x0004002b,0x00000006,0x00000367,
+0x00000246,0x0004002b,0x00000006,0x00000368,
+0x00000261,0x0004002b,0x00000006,0x00000369,
+0x00000248,0x0004002b,0x00000006,0x0000036a,
+0x00000249,0x0004002b,0x00000006,0x0000036b,
+0x0000024a,0x0004002b,0x00000006,0x0000036c,
+0x00000262,0x0004002b,0x00000006,0x0000036d,
+0x00000268,0x0004002b,0x00000006,0x0000036e,
+0x00000269,0x0004002b,0x00000006,0x0000036f,
+0x0000026a,0x0004002b,0x00000006,0x00000370,
+0x00000250,0x0004002b,0x00000006,0x00000371,
+0x00000251,0x0004002b,0x00000006,0x00000372,
+0x00000252,0x0004002b,0x00000006,0x00000373,
+0x00000264,0x0004002b,0x00000006,0x00000374,
+0x00000254,0x0004002b,0x00000006,0x00000375,
+0x00000255,0x0004002b,0x00000006,0x00000376,
+0x00000256,0x0004002b,0x00000006,0x00000377,
+0x00000265,0x0004002b,0x00000006,0x00000378,
+0x00000258,0x0004002b,0x00000006,0x00000379,
+0x00000259,0x0004002b,0x00000006,0x0000037a,
+0x0000025a,0x0004002b,0x00000006,0x0000037b,
+0x00000266,0x0103002c,0x00000297,0x0000037c,
+0x0000009d,0x000000a0,0x00000092,0x0000019f,
+0x00000091,0x00000095,0x000000f5,0x00000298,
+0x0000008d,0x00000299,0x00000101,0x0000029a,
+0x0000029b,0x0000029c,0x0000029d,0x0000029a,
+0x0000014c,0x0000029e,0x0000029f,0x000002a0,
+0x000002a1,0x000002a2,0x000002a3,0x000002a4,
+0x00000175,0x000002a5,0x000002a6,0x000002a7,
+0x000002a8,0x000002a9,0x000002aa,0x000002ab,
+0x0000017c,0x000002ac,0x000002ad,0x00000178,
+0x000002ae,0x000002af,0x000002b0,0x000002b1,
+0x000002b2,0x000002b3,0x000002b4,0x000002b5,
+0x000002b6,0x000002b7,0x000002b8,0x000002b5,
+0x000002b9,0x000002ba,0x000002bb,0x000002bc,
+0x000002bd,0x000002be,0x000002bf,0x000002c0,
+0x000002c1,0x000002c2,0x000002c3,0x000002c4,
+0x000002c5,0x000002c6,0x000002c7,0x000002c8,
+0x000001dc,0x000002c9,0x000002ca,0x000002cb,
+0x000002cc,0x000002cd,0x000002ce,0x000002cf,
+0x000002d0,0x000002d1,0x000002d2,0x000002d3,
+0x000002d4,0x000002d5,0x000002d6,0x000002d3,
+0x000002d7,0x000002d8,0x000002d9,0x000002da,
+0x000002db,0x000002dc,0x000002dd,0x000002de,
+0x000002df,0x000002e0,0x000002e1,0x000002e2,
+0x000002e3,0x000002e4,0x000002e5,0x000002e6,
+0x000002e7,0x000002e8,0x000002e9,0x000002ea,
+0x000002eb,0x000002ec,0x000002ed,0x000002ee,
+0x000002ef,0x000002f0,0x000002f1,0x000002f2,
+0x000002f3,0x000002f4,0x000002f5,0x000002f2,
+0x000002f6,0x000002f7,0x000002f8,0x000002f9,
+0x000002fa,0x000002fb,0x000002fc,0x000002fd,
+0x000002fe,0x000002ff,0x00000300,0x00000301,
+0x00000302,0x00000303,0x00000304,0x000002e6,
+0x00000296,0x00000305,0x00000306,0x00000307,
+0x00000308,0x00000309,0x0000030a,0x0000030b,
+0x0000030c,0x0000030d,0x0000030e,0x0000030f,
+0x00000310,0x00000311,0x00000312,0x0000030f,
+0x00000313,0x00000314,0x00000315,0x00000316,
+0x00000317,0x00000318,0x00000319,0x0000031a,
+0x0000031b,0x0000031c,0x0000031d,0x0000031e,
+0x0000031f,0x00000320,0x00000321,0x00000322,
+0x00000323,0x00000324,0x00000325,0x00000326,
+0x00000327,0x00000328,0x00000329,0x0000032a,
+0x0000032b,0x0000032c,0x0000032d,0x0000032e,
+0x0000032f,0x00000330,0x00000331,0x0000032e,
+0x00000332,0x00000333,0x00000334,0x00000335,
+0x00000336,0x00000337,0x00000338,0x00000339,
+0x0000033a,0x0000033b,0x0000033c,0x0000033d,
+0x0000033e,0x0000033f,0x00000340,0x00000341,
+0x00000342,0x00000343,0x00000344,0x00000345,
+0x00000346,0x00000347,0x00000348,0x00000349,
+0x0000034a,0x0000034b,0x0000034c,0x0000034d,
+0x0000034e,0x0000034f,0x00000350,0x0000034d,
+0x00000351,0x00000352,0x00000353,0x00000354,
+0x00000355,0x00000356,0x00000357,0x00000358,
+0x00000359,0x0000035a,0x0000035b,0x0000035c,
+0x0000035d,0x0000035e,0x0000035f,0x00000360,
+0x00000361,0x00000362,0x00000363,0x00000364,
+0x00000365,0x00000366,0x00000367,0x00000368,
+0x00000369,0x0000036a,0x0000036b,0x0000036c,
+0x0000036d,0x0000036e,0x0000036f,0x0000036c,
+0x00000370,0x00000371,0x00000372,0x00000373,
+0x00000374,0x00000375,0x00000376,0x00000377,
+0x00000378,0x00000379,0x0000037a,0x0000037b,
+0x00000302,0x00000303,0x00000304,0x00000360,
+0x00040020,0x0000037e,0x00000007,0x00000297,
+0x0006002c,0x0000005d,0x000003b2,0x000000b8,
+0x0000015d,0x000000c8,0x0004001c,0x000003b9,
+0x00000006,0x000001dc,0x0004002b,0x00000006,
+0x000003ba,0x0000000b,0x0004002b,0x00000006,
+0x000003bb,0x00000013,0x0004002b,0x00000006,
+0x000003bc,0x0000001b,0x0004002b,0x00000006,
+0x000003bd,0x0000001c,0x0004002b,0x00000006,
+0x000003be,0x00000023,0x0004002b,0x00000006,
+0x000003bf,0x000000e4,0x0004002b,0x00000006,
+0x000003c0,0x00000043,0x0004002b,0x00000006,
+0x000003c1,0x0000004b,0x0004002b,0x00000006,
+0x000003c2,0x0000004c,0x0004002b,0x00000006,
+0x000003c3,0x0000010c,0x0004002b,0x00000006,
+0x000003c4,0x00000053,0x0004002b,0x00000006,
+0x000003c5,0x0000005b,0x0004002b,0x00000006,
+0x000003c6,0x0000005c,0x0004002b,0x00000006,
+0x000003c7,0x00000063,0x0004002b,0x00000006,
+0x000003c8,0x0000011c,0x0004002b,0x00000006,
+0x000003c9,0x00000123,0x0004002b,0x00000006,
+0x000003ca,0x00000083,0x0004002b,0x00000006,
+0x000003cb,0x00000103,0x0004002b,0x00000006,
+0x000003cc,0x0000008b,0x0004002b,0x00000006,
+0x000003cd,0x0000008c,0x0004002b,0x00000006,
+0x000003ce,0x0000010b,0x0004002b,0x00000006,
+0x000003cf,0x00000093,0x0004002b,0x00000006,
+0x000003d0,0x00000113,0x0004002b,0x00000006,
+0x000003d1,0x0000009b,0x0004002b,0x00000006,
+0x000003d2,0x0000009c,0x0004002b,0x00000006,
+0x000003d3,0x000000a3,0x0004002b,0x00000006,
+0x000003d4,0x0000011b,0x0004002b,0x00000006,
+0x000003d5,0x000000c0,0x0004002b,0x00000006,
+0x000003d6,0x000000c1,0x0004002b,0x00000006,
+0x000003d7,0x000000c2,0x0004002b,0x00000006,
+0x000003d8,0x000000c3,0x0004002b,0x00000006,
+0x000003d9,0x000000c4,0x0004002b,0x00000006,
+0x000003da,0x000000e0,0x0004002b,0x00000006,
+0x000003db,0x000000c8,0x0004002b,0x00000006,
+0x000003dc,0x000000c9,0x0004002b,0x00000006,
+0x000003dd,0x000000ca,0x0004002b,0x00000006,
+0x000003de,0x000000cb,0x0004002b,0x00000006,
+0x000003df,0x000000cc,0x0004002b,0x00000006,
+0x000003e0,0x000000e1,0x0004002b,0x00000006,
+0x000003e1,0x000000d0,0x0004002b,0x00000006,
+0x000003e2,0x000000d1,0x0004002b,0x00000006,
+0x000003e3,0x000000d2,0x0004002b,0x00000006,
+0x000003e4,0x000000d3,0x0004002b,0x00000006,
+0x000003e5,0x000000d4,0x0004002b,0x00000006,
+0x000003e6,0x000000e2,0x0004002b,0x00000006,
+0x000003e7,0x000000d8,0x0004002b,0x00000006,
+0x000003e8,0x000000d9,0x0004002b,0x00000006,
+0x000003e9,0x000000da,0x0004002b,0x00000006,
+0x000003ea,0x000000db,0x0004002b,0x00000006,
+0x000003eb,0x000000dc,0x0004002b,0x00000006,
+0x000003ec,0x000000e3,0x0083002c,0x000003b9,
+0x000003ed,0x0000009d,0x000000a0,0x00000092,
+0x00000096,0x00000091,0x0000019f,0x000002a0,
+0x00000316,0x0000008d,0x00000299,0x00000101,
+0x000003ba,0x000000eb,0x00000298,0x000002bc,
+0x00000316,0x0000014c,0x0000029e,0x0000029f,
+0x000003bb,0x000002a1,0x0000029a,0x000002da,
+0x00000316,0x00000175,0x000002a5,0x000002a6,
+0x000003bc,0x000003bd,0x000003be,0x000003bf,
+0x00000316,0x0000017c,0x000002ac,0x000002ad,
+0x000003c0,0x000002ae,0x00000178,0x00000308,
+0x00000307,0x000002b2,0x000002b3,0x000002b4,
+0x000003c1,0x000003c2,0x000002b1,0x000003c3,
+0x0000030b,0x000002b9,0x000002ba,0x000002bb,
+0x000003c4,0x000002bd,0x000002b5,0x00000317,
+0x0000030f,0x000002c1,0x000002c2,0x000002c3,
+0x000003c5,0x000003c6,0x000003c7,0x000003c8,
+0x000003c9,0x000001dc,0x000002c9,0x000002ca,
+0x000003ca,0x000002cc,0x000002cb,0x00000306,
+0x000003cb,0x000002d0,0x000002d1,0x000002d2,
+0x000003cc,0x000003cd,0x000002cf,0x0000030e,
+0x000003ce,0x000002d7,0x000002d8,0x000002d9,
+0x000003cf,0x000002db,0x000002d3,0x00000315,
+0x000003d0,0x000002df,0x000002e0,0x000002e1,
+0x000003d1,0x000003d2,0x000003d3,0x0000031d,
+0x000003d4,0x000003d5,0x000003d6,0x000003d7,
+0x000003d8,0x000003d9,0x000003da,0x00000296,
+0x00000305,0x000003db,0x000003dc,0x000003dd,
+0x000003de,0x000003df,0x000003e0,0x0000030c,
+0x0000030d,0x000003e1,0x000003e2,0x000003e3,
+0x000003e4,0x000003e5,0x000003e6,0x00000313,
+0x00000314,0x000003e7,0x000003e8,0x000003e9,
+0x000003ea,0x000003eb,0x000003ec,0x0000031b,
+0x0000031c,0x00040020,0x000003ef,0x00000007,
+0x000003b9,0x0004002b,0x00000006,0x0000041e,
+0x0000002d,0x0004001c,0x0000041f,0x00000006,
+0x0000041e,0x0004002b,0x00000006,0x00000420,
+0x00000034,0x0004002b,0x00000006,0x00000421,
+0x00000027,0x0004002b,0x00000006,0x00000422,
+0x0000002f,0x0004002b,0x00000006,0x00000423,
+0x0000003b,0x0004002b,0x00000006,0x00000424,
+0x00000017,0x0004002b,0x00000006,0x00000425,
+0x00000035,0x0004002b,0x00000006,0x00000426,
+0x00000038,0x0004002b,0x00000006,0x00000427,
+0x00000030,0x0004002b,0x00000006,0x00000428,
+0x0000003e,0x0004002b,0x00000006,0x00000429,
+0x0000000d,0x0004002b,0x00000006,0x0000042a,
+0x00000033,0x0004002b,0x00000006,0x0000042b,
+0x0000001e,0x0030002c,0x0000041f,0x0000042c,
+0x0000009d,0x0000019f,0x0000017c,0x0000009d,
+0x0000017c,0x000000eb,0x00000420,0x000002a5,
+0x00000421,0x0000009d,0x0000017c,0x0000029e,
+0x00000422,0x00000095,0x00000423,0x00000424,
+0x0000029c,0x000003ba,0x00000425,0x000003bd,
+0x000002a0,0x0000009d,0x0000017c,0x0000008d,
+0x00000426,0x0000014c,0x00000427,0x00000175,
+0x0000029b,0x00000092,0x00000428,0x000003ba,
+0x00000425,0x000003bb,0x0000041e,0x000003bc,
+0x000002a4,0x00000095,0x00000423,0x00000429,
+0x0000042a,0x000002a3,0x0000029d,0x0000042b,
+0x0000029a,0x00040020,0x00000434,0x00000007,
+0x0000041f,0x0004001c,0x00000451,0x00000006,
+0x000003be,0x0004002b,0x00000006,0x00000452,
+0x00000039,0x0004002b,0x00000006,0x00000453,
+0x0000000e,0x0004002b,0x00000006,0x00000454,
+0x00000032,0x0004002b,0x00000006,0x00000455,
+0x0000002b,0x0004002b,0x00000006,0x00000456,
+0x0000003d,0x0004002b,0x00000006,0x00000457,
+0x0000003a,0x0004002b,0x00000006,0x00000458,
+0x00000037,0x0004002b,0x00000006,0x00000459,
+0x0000001d,0x0026002c,0x00000451,0x0000045a,
+0x0000009d,0x0000014c,0x0000019f,0x00000427,
+0x0000017c,0x0000009d,0x0000017c,0x0000008e,
+0x00000452,0x00000453,0x00000454,0x000002a2,
+0x00000455,0x000003bd,0x000002a0,0x0000009d,
+0x0000017c,0x0000014c,0x00000427,0x00000096,
+0x00000456,0x000003bb,0x0000041e,0x000000f5,
+0x00000457,0x00000424,0x0000029c,0x00000299,
+0x00000458,0x000002a6,0x000002a7,0x00000429,
+0x0000042a,0x00000459,0x000003be,0x00040020,
+0x00000462,0x00000007,0x00000451,0x0004001c,
+0x00000475,0x00000034,0x000000f5,0x0004002b,
+0x00000006,0x00000476,0x0000003f,0x0005002c,
+0x00000034,0x00000477,0x00000476,0x0000008d,
+0x0005002c,0x00000034,0x00000478,0x000002a2,
+0x0000008d,0x0005002c,0x00000034,0x00000479,
+0x00000299,0x0000008d,0x0005002c,0x00000034,
+0x0000047a,0x00000092,0x00000091,0x0005002c,
+0x00000034,0x0000047b,0x000000a0,0x0000008d,
+0x0009002c,0x00000475,0x0000047c,0x00000477,
+0x00000478,0x00000479,0x00000093,0x0000047a,
+0x0000047b,0x00040020,0x0000047f,0x00000007,
+0x00000475,0x00030016,0x000004e9,0x00000020,
+0x00040017,0x000004ea,0x000004e9,0x00000004,
+0x0004002b,0x000004e9,0x000004ef,0x41000000,
+0x0004002b,0x00000006,0x000004f6,0x00000400,
+0x0004002b,0x00000056,0x0000050d,0x00000006,
+0x00040017,0x0000050e,0x00000056,0x00000002,
+0x0004002b,0x00000006,0x00000517,0x0000000f,
+0x0005002c,0x00000034,0x00000526,0x0000009d,
+0x0000009d,0x0004002b,0x00000056,0x00000552,
+0x0000000f,0x0004002b,0x00000056,0x00000557,
+0x00000011,0x0004002b,0x00000056,0x00000568,
+0x00000010,0x00040020,0x00000584,0x00000009,
+0x00000006,0x0004002b,0x00000056,0x0000059c,
+0x00000008,0x0004002b,0x00000056,0x0000059f,
+0x0000000c,0x0004002b,0x00000056,0x000005a6,
+0x00000014,0x0004002b,0x00000056,0x000005a9,
+0x00000018,0x0004002b,0x00000056,0x000005ac,
+0x0000001c,0x00040017,0x000005d6,0x000004e9,
+0x00000002,0x0007002c,0x00000011,0x000005f4,
+0x00000453,0x00000101,0x000000f5,0x00000092,
+0x0007002c,0x00000011,0x000005f7,0x00000476,
+0x00000476,0x00000476,0x00000476,0x00040017,
+0x0000060d,0x00000083,0x00000003,0x0004001c,
+0x00000633,0x00000008,0x000003bb,0x0006002c,
+0x00000008,0x00000634,0x0000009d,0x0000009d,
+0x0000008d,0x0006002c,0x00000008,0x00000635,
+0x000000a0,0x0000009d,0x000000f5,0x0006002c,
+0x00000008,0x00000636,0x0000009d,0x000000a0,
+0x00000095,0x0006002c,0x00000008,0x00000637,
+0x0000009d,0x0000009d,0x0000008e,0x0006002c,
+0x00000008,0x00000638,0x000000a0,0x0000009d,
+0x00000095,0x0006002c,0x00000008,0x00000639,
+0x0000009d,0x000000a0,0x00000091,0x0006002c,
+0x00000008,0x0000063a,0x0000009d,0x0000009d,
+0x000000f5,0x0006002c,0x00000008,0x0000063b,
+0x000000a0,0x0000009d,0x00000091,0x0006002c,
+0x00000008,0x0000063c,0x0000009d,0x000000a0,
+0x00000096,0x0016002c,0x00000633,0x0000063d,
+0x00000634,0x00000635,0x00000636,0x00000637,
+0x00000638,0x00000639,0x0000063a,0x0000063b,
+0x0000063c,0x0000015a,0x00000159,0x00000158,
+0x00000157,0x00000156,0x00000155,0x00000154,
+0x00000153,0x00000151,0x0000014f,0x00040020,
+0x0000063f,0x00000007,0x00000633,0x0004002b,
+0x00000056,0x00000674,0x00000080,0x0004002b,
+0x00000056,0x0000067c,0x0000003f,0x0004002b,
+0x00000006,0x00000692,0x000000ff,0x0004002b,
+0x00000056,0x000006a5,0x000000c0,0x0004002b,
+0x00000056,0x000006ae,0x000000ff,0x0004002b,
+0x00000056,0x0000072f,0xffffff80,0x0007002c,
+0x00000011,0x0000075d,0x0000009d,0x0000009d,
+0x0000009d,0x0000009d,0x0004002b,0x00000006,
+0x0000077b,0x0000017d,0x0004001c,0x0000077c,
+0x00000006,0x0000077b,0x0004002b,0x00000006,
+0x0000077d,0x000000ba,0x0004002b,0x00000006,
+0x0000077e,0x000000e8,0x0004002b,0x00000006,
+0x0000077f,0x0000002e,0x0004002b,0x00000006,
+0x00000780,0x00000074,0x0004002b,0x00000006,
+0x00000781,0x000000de,0x0004002b,0x00000006,
+0x00000782,0x000000bd,0x0004002b,0x00000006,
+0x00000783,0x000000f4,0x0004002b,0x00000006,
+0x00000784,0x0000002c,0x0004002b,0x00000006,
+0x00000785,0x0000004d,0x0004002b,0x00000006,
+0x00000786,0x000000b2,0x0004002b,0x00000006,
+0x00000787,0x0000006e,0x0004002b,0x00000006,
+0x00000788,0x000000e9,0x0004002b,0x00000006,
+0x00000789,0x000000a7,0x0004002b,0x00000006,
+0x0000078a,0x00000079,0x0004002b,0x00000006,
+0x0000078b,0x000000ef,0x0004002b,0x00000006,
+0x0000078c,0x000000df,0x0004002b,0x00000006,
+0x0000078d,0x000000cf,0x0004002b,0x00000006,
+0x0000078e,0x000000be,0x0004002b,0x00000006,
+0x0000078f,0x000000ae,0x0004002b,0x00000006,
+0x00000790,0x0000009e,0x0004002b,0x00000006,
+0x00000791,0x00000071,0x0004002b,0x00000006,
+0x00000792,0x0000008e,0x0004002b,0x00000006,
+0x00000793,0x000000fa,0x0004002b,0x00000006,
+0x00000794,0x000000ea,0x0004002b,0x00000006,
+0x00000795,0x00000036,0x0004002b,0x00000006,
+0x00000796,0x000000b9,0x0004002b,0x00000006,
+0x00000797,0x00000067,0x0004002b,0x00000006,
+0x00000798,0x00000077,0x0004002b,0x00000006,
+0x00000799,0x000000b3,0x0004002b,0x00000006,
+0x0000079a,0x0000006c,0x0004002b,0x00000006,
+0x0000079b,0x0000007c,0x0004002b,0x00000006,
+0x0000079c,0x000000f7,0x0004002b,0x00000006,
+0x0000079d,0x000000e7,0x0004002b,0x00000006,
+0x0000079e,0x000000d7,0x0004002b,0x00000006,
+0x0000079f,0x000000c7,0x0004002b,0x00000006,
+0x000007a0,0x000000bf,0x0004002b,0x00000006,
+0x000007a1,0x000000b7,0x0004002b,0x00000006,
+0x000007a2,0x000000af,0x0004002b,0x00000006,
+0x000007a3,0x0000009f,0x0004002b,0x00000006,
+0x000007a4,0x00000097,0x0004002b,0x00000006,
+0x000007a5,0x00000070,0x0004002b,0x00000006,
+0x000007a6,0x0000008f,0x0004002b,0x00000006,
+0x000007a7,0x00000078,0x0004002b,0x00000006,
+0x000007a8,0x00000087,0x0004002b,0x00000006,
+0x000007a9,0x000000fd,0x0004002b,0x00000006,
+0x000007aa,0x000000f5,0x0004002b,0x00000006,
+0x000007ab,0x000000ed,0x0004002b,0x00000006,
+0x000007ac,0x000000e5,0x0004002b,0x00000006,
+0x000007ad,0x000000bc,0x0004002b,0x00000006,
+0x000007ae,0x000000b4,0x0004002b,0x00000006,
+0x000007af,0x000000ac,0x0004002b,0x00000006,
+0x000007b0,0x0000006b,0x0004002b,0x00000006,
+0x000007b1,0x00000073,0x0004002b,0x00000006,
+0x000007b2,0x0000007b,0x0004002b,0x00000006,
+0x000007b3,0x000000f2,0x0004002b,0x00000006,
+0x000007b4,0x0000004e,0x0004002b,0x00000006,
+0x000007b5,0x000000b1,0x0004002b,0x00000006,
+0x000007b6,0x0000005e,0x0004002b,0x00000006,
+0x000007b7,0x00000076,0x0004002b,0x00000006,
+0x000007b8,0x0000007e,0x0004002b,0x00000006,
+0x000007b9,0x000000fb,0x0004002b,0x00000006,
+0x000007ba,0x000000f3,0x0004002b,0x00000006,
+0x000007bb,0x000000eb,0x0004002b,0x00000006,
+0x000007bc,0x0000003c,0x0004002b,0x00000006,
+0x000007bd,0x000000bb,0x0004002b,0x00000006,
+0x000007be,0x000000ab,0x0004002b,0x00000006,
+0x000007bf,0x000000fe,0x0004002b,0x00000006,
+0x000007c0,0x000000f6,0x0004002b,0x00000006,
+0x000007c1,0x000000ee,0x0004002b,0x00000006,
+0x000007c2,0x000000e6,0x0004002b,0x00000006,
+0x000007c3,0x000000d6,0x0004002b,0x00000006,
+0x000007c4,0x00000031,0x0004002b,0x00000006,
+0x000007c5,0x000000ce,0x0004002b,0x00000006,
+0x000007c6,0x000000c6,0x0004002b,0x00000006,
+0x000007c7,0x000000b6,0x0004002b,0x00000006,
+0x000007c8,0x0000005d,0x0004002b,0x00000006,
+0x000007c9,0x0000006d,0x0004002b,0x00000006,
+0x000007ca,0x00000075,0x0004002b,0x00000006,
+0x000007cb,0x0000007d,0x0004002b,0x00000006,
+0x000007cc,0x000000f9,0x0004002b,0x00000006,
+0x000007cd,0x000000f1,0x0004002b,0x00000006,
+0x000007ce,0x000000dd,0x0004002b,0x00000006,
+0x000007cf,0x000000d5,0x0004002b,0x00000006,
+0x000007d0,0x000000cd,0x0004002b,0x00000006,
+0x000007d1,0x000000c5,0x0004002b,0x00000006,
+0x000007d2,0x000000b5,0x0004002b,0x00000006,
+0x000007d3,0x000000ad,0x0004002b,0x00000006,
+0x000007d4,0x0000009d,0x0004002b,0x00000006,
+0x000007d5,0x00000072,0x0004002b,0x00000006,
+0x000007d6,0x0000008d,0x0004002b,0x00000006,
+0x000007d7,0x0000007a,0x0180002c,0x0000077c,
+0x000007d8,0x0000009d,0x0000009d,0x0000009d,
+0x0000009d,0x00000692,0x0000042a,0x000003df,
+0x000002c4,0x000002e0,0x0000009d,0x00000692,
+0x000002af,0x0000077d,0x00000424,0x0000077e,
+0x000003c6,0x000003d3,0x0000077f,0x000003e2,
+0x00000780,0x000003cc,0x0000009d,0x00000692,
+0x00000298,0x00000781,0x000002ad,0x00000782,
+0x000003c7,0x000003d2,0x000003ba,0x00000783,
+0x00000784,0x000003e4,0x00000785,0x00000786,
+0x00000787,0x000002d8,0x000002a3,0x00000788,
+0x00000458,0x000003db,0x000002c1,0x00000789,
+0x0000078a,0x000002ce,0x0000009d,0x00000692,
+0x0000014c,0x0000078b,0x0000019f,0x0000078c,
+0x00000427,0x0000078d,0x000002ac,0x0000078e,
+0x000002ba,0x0000078f,0x000002b1,0x00000790,
+0x00000791,0x00000792,0x00000095,0x00000793,
+0x000002a2,0x00000794,0x000002a7,0x000003e8,
+0x00000795,0x000003dc,0x000002b0,0x00000796,
+0x000002bf,0x000002d5,0x00000797,0x000002df,
+0x00000798,0x000002d0,0x000003ba,0x00000783,
+0x000003bc,0x000003bf,0x00000455,0x000003e5,
+0x00000423,0x000003d9,0x000003c2,0x00000799,
+0x000003c6,0x000003d3,0x0000079a,0x000003cf,
+0x0000079b,0x000003ca,0x0000009d,0x00000692,
+0x0000008d,0x0000079c,0x0000014c,0x0000078b,
+0x00000175,0x0000079d,0x0000019f,0x0000078c,
+0x0000029b,0x0000079e,0x00000427,0x0000078d,
+0x00000426,0x0000079f,0x0000017c,0x000007a0,
+0x000002b2,0x000007a1,0x000002b9,0x000007a2,
+0x000002c1,0x00000789,0x00000178,0x000007a3,
+0x000002b6,0x000007a4,0x000007a5,0x000007a6,
+0x000007a7,0x000007a8,0x00000092,0x000007a9,
+0x00000101,0x000007aa,0x0000029f,0x000007ab,
+0x000002a6,0x000007ac,0x000003be,0x000003eb,
+0x00000455,0x000003e5,0x0000042a,0x000003df,
+0x00000423,0x000003d9,0x000003c0,0x000007ad,
+0x000003c1,0x000007ae,0x000003c4,0x000007af,
+0x000003c5,0x000002da,0x000003c7,0x000003d2,
+0x000007b0,0x000002db,0x000007b1,0x000003cd,
+0x000007b2,0x000002cc,0x00000095,0x00000793,
+0x00000429,0x000007b3,0x000002a2,0x00000794,
+0x00000459,0x000003e6,0x000002a4,0x000003e9,
+0x0000041e,0x000003e3,0x00000425,0x000003dd,
+0x00000456,0x000003d7,0x000002b0,0x00000796,
+0x000007b4,0x000007b5,0x000002bf,0x000002d5,
+0x000007b6,0x000002cf,0x000002c4,0x000002e0,
+0x00000787,0x000002d8,0x000007b7,0x000002d1,
+0x000007b8,0x000002c9,0x0000009d,0x00000692,
+0x00000091,0x000007b9,0x0000008d,0x0000079c,
+0x000000eb,0x000007ba,0x0000014c,0x0000078b,
+0x000002a1,0x000007bb,0x00000175,0x0000079d,
+0x000003bd,0x000003ec,0x0000019f,0x0000078c,
+0x000002a0,0x000003ea,0x0000029b,0x0000079e,
+0x00000784,0x000003e4,0x00000427,0x0000078d,
+0x00000420,0x000003de,0x00000426,0x0000079f,
+0x000007bc,0x000003d8,0x0000017c,0x000007a0,
+0x000002ae,0x000007bd,0x000002b2,0x000007a1,
+0x000003c2,0x00000799,0x000002b9,0x000007a2,
+0x000002bd,0x000007be,0x000002c1,0x00000789,
+0x000003c6,0x000003d3,0x00000178,0x000007a3,
+0x000002bc,0x000003d1,0x000002b6,0x000007a4,
+0x0000079a,0x000003cf,0x000007a5,0x000007a6,
+0x00000780,0x000003cc,0x000007a7,0x000007a8,
+0x0000079b,0x000003ca,0x000000a0,0x000007bf,
+0x00000095,0x00000793,0x00000299,0x000007c0,
+0x00000429,0x000007b3,0x0000029e,0x000007c1,
+0x000002a2,0x00000794,0x000002a5,0x000007c2,
+0x00000459,0x000003e6,0x00000298,0x00000781,
+0x000002a4,0x000003e9,0x0000029c,0x000007c3,
+0x0000041e,0x000003e3,0x000007c4,0x000007c5,
+0x00000425,0x000003dd,0x00000452,0x000007c6,
+0x00000456,0x000003d7,0x000002ac,0x0000078e,
+0x000002af,0x0000077d,0x000002b3,0x000007c7,
+0x00000785,0x00000786,0x000002ba,0x0000078f,
+0x000002be,0x000002d6,0x000002c2,0x000002e2,
+0x000007c8,0x000002d3,0x000002b1,0x00000790,
+0x000002c0,0x000002e1,0x000002b7,0x000002dd,
+0x000007c9,0x000002d9,0x00000791,0x00000792,
+0x000007ca,0x000002d2,0x0000078a,0x000002ce,
+0x000007cb,0x000002ca,0x00000092,0x000007a9,
+0x000000f5,0x000007cc,0x00000101,0x000007aa,
+0x00000453,0x000007cd,0x0000029f,0x000007ab,
+0x000002a3,0x00000788,0x000002a6,0x000007ac,
+0x0000042b,0x000003e0,0x0000029a,0x000007ce,
+0x000002a7,0x000003e8,0x0000029d,0x000007cf,
+0x0000077f,0x000003e2,0x00000454,0x000007d0,
+0x00000795,0x000003dc,0x00000457,0x000007d1,
+0x00000428,0x000003d6,0x000002ad,0x00000782,
+0x000002b0,0x00000796,0x000002b4,0x000007d2,
+0x000007b4,0x000007b5,0x000002bb,0x000007d3,
+0x000002bf,0x000002d5,0x000002c3,0x000002de,
+0x000007b6,0x000002cf,0x000002b5,0x000007d4,
+0x000002c4,0x000002e0,0x000002b8,0x000002dc,
+0x00000787,0x000002d8,0x000007d5,0x000007d6,
+0x000007b7,0x000002d1,0x000007d7,0x000002cd,
+0x000007b8,0x000002c9,0x00040020,0x000007e0,
+0x00000007,0x0000077c,0x0004002b,0x00000006,
+0x000007ff,0x0000013b,0x0004001c,0x00000800,
+0x00000006,0x000007ff,0x0004002b,0x00000006,
+0x00000801,0x00000047,0x0004002b,0x00000006,
+0x00000802,0x000000b8,0x0004002b,0x00000006,
+0x00000803,0x000000ec,0x0004002b,0x00000006,
+0x00000804,0x000000fc,0x0004002b,0x00000006,
+0x00000805,0x00000057,0x013e002c,0x00000800,
+0x00000806,0x0000009d,0x0000009d,0x0000009d,
+0x0000009d,0x0000009d,0x0000009d,0x00000692,
+0x000003bd,0x000003ec,0x00000426,0x0000079f,
+0x000002bd,0x000007be,0x00000791,0x00000792,
+0x0000009d,0x00000692,0x000003c0,0x000007ad,
+0x00000429,0x000007b3,0x000002b9,0x000007a2,
+0x000003bc,0x000003bf,0x000007b6,0x000002cf,
+0x0000029b,0x0000079e,0x000007b0,0x000002db,
+0x00000795,0x000003dc,0x0000078a,0x000002ce,
+0x0000009d,0x00000692,0x0000019f,0x0000078c,
+0x000002ac,0x0000078e,0x000002b1,0x00000790,
+0x000000f5,0x000007cc,0x00000421,0x000003e7,
+0x00000801,0x00000802,0x000002b6,0x000007a4,
+0x00000429,0x000007b3,0x0000041e,0x000003e3,
+0x000007b4,0x000007b5,0x00000787,0x000002d8,
+0x000003bb,0x00000803,0x00000420,0x000003de,
+0x000002bd,0x000007be,0x000007ca,0x000002d2,
+0x000002a6,0x000007ac,0x00000457,0x000007d1,
+0x000003c5,0x000002da,0x000007b2,0x000002cc,
+0x0000009d,0x00000692,0x0000014c,0x0000078b,
+0x0000019f,0x0000078c,0x00000427,0x0000078d,
+0x0000017c,0x000007a0,0x000002b9,0x000007a2,
+0x00000178,0x000007a3,0x000007a5,0x000007a6,
+0x00000096,0x00000804,0x000003bb,0x00000803,
+0x000003be,0x000003eb,0x0000042a,0x000003df,
+0x000003c0,0x000007ad,0x000003c4,0x000007af,
+0x000002bc,0x000003d1,0x00000780,0x000003cc,
+0x000000f5,0x000007cc,0x000002a3,0x00000788,
+0x000002a7,0x000003e8,0x00000795,0x000003dc,
+0x00000801,0x00000802,0x00000805,0x000002d4,
+0x00000797,0x000002df,0x00000798,0x000002d0,
+0x00000299,0x000007c0,0x000002a5,0x000007c2,
+0x0000029d,0x000007cf,0x00000457,0x000007d1,
+0x000002b4,0x000007d2,0x000002c3,0x000002de,
+0x000002b8,0x000002dc,0x000007d7,0x000002cd,
+0x00000429,0x000007b3,0x00000459,0x000003e6,
+0x0000041e,0x000003e3,0x00000456,0x000003d7,
+0x00000785,0x00000786,0x000007c8,0x000002d3,
+0x000007c9,0x000002d9,0x000007cb,0x000002ca,
+0x0000009d,0x00000692,0x0000008d,0x0000079c,
+0x0000014c,0x0000078b,0x00000175,0x0000079d,
+0x0000019f,0x0000078c,0x0000029b,0x0000079e,
+0x00000427,0x0000078d,0x00000426,0x0000079f,
+0x0000017c,0x000007a0,0x000002b2,0x000007a1,
+0x000002b9,0x000007a2,0x000002c1,0x00000789,
+0x00000178,0x000007a3,0x000002b6,0x000007a4,
+0x000007a5,0x000007a6,0x000007a7,0x000007a8,
+0x000000a0,0x000007bf,0x00000299,0x000007c0,
+0x0000029e,0x000007c1,0x000002a5,0x000007c2,
+0x00000298,0x00000781,0x0000029c,0x000007c3,
+0x000007c4,0x000007c5,0x00000452,0x000007c6,
+0x000002ac,0x0000078e,0x000002b3,0x000007c7,
+0x000002ba,0x0000078f,0x000002c2,0x000002e2,
+0x000002b1,0x00000790,0x000002b7,0x000002dd,
+0x00000791,0x00000792,0x0000078a,0x000002ce,
+0x00000096,0x00000804,0x000003ba,0x00000783,
+0x000003bb,0x00000803,0x000003bc,0x000003bf,
+0x000003be,0x000003eb,0x00000455,0x000003e5,
+0x0000042a,0x000003df,0x00000423,0x000003d9,
+0x000003c0,0x000007ad,0x000003c1,0x000007ae,
+0x000003c4,0x000007af,0x000003c5,0x000002da,
+0x000003c7,0x000003d2,0x000007b0,0x000002db,
+0x000007b1,0x000003cd,0x000007b2,0x000002cc,
+0x00000091,0x000007b9,0x000000eb,0x000007ba,
+0x000002a1,0x000007bb,0x000003bd,0x000003ec,
+0x000002a0,0x000003ea,0x00000784,0x000003e4,
+0x00000420,0x000003de,0x000007bc,0x000003d8,
+0x000002ae,0x000007bd,0x000003c2,0x00000799,
+0x000002bd,0x000007be,0x000003c6,0x000003d3,
+0x000002bc,0x000003d1,0x0000079a,0x000003cf,
+0x00000780,0x000003cc,0x0000079b,0x000003ca,
+0x000000f5,0x000007cc,0x00000453,0x000007cd,
+0x000002a3,0x00000788,0x0000042b,0x000003e0,
+0x000002a7,0x000003e8,0x0000077f,0x000003e2,
+0x00000795,0x000003dc,0x00000428,0x000003d6,
+0x000002b0,0x00000796,0x000007b4,0x000007b5,
+0x000002bf,0x000002d5,0x000007b6,0x000002cf,
+0x000002c4,0x000002e0,0x00000787,0x000002d8,
+0x000007b7,0x000002d1,0x000007b8,0x000002c9,
+0x00040020,0x0000080e,0x00000007,0x00000800,
+0x0004001c,0x00000823,0x00000034,0x0000008d,
+0x0005002c,0x00000034,0x00000824,0x00000692,
+0x0000008d,0x0005002c,0x00000034,0x00000825,
+0x000002be,0x0000008d,0x0005002c,0x00000034,
+0x00000826,0x000002a0,0x000000a0,0x0005002c,
+0x00000034,0x00000827,0x0000029e,0x0000008d,
+0x0005002c,0x00000034,0x00000828,0x0000008d,
+0x00000092,0x0005002c,0x00000034,0x00000829,
+0x00000091,0x00000091,0x0005002c,0x00000034,
+0x0000082a,0x00000092,0x000000f5,0x000b002c,
+0x00000823,0x0000082b,0x00000824,0x00000825,
+0x00000826,0x00000827,0x00000828,0x00000829,
+0x0000082a,0x0000047b,0x00040020,0x0000082e,
+0x00000007,0x00000823,0x0004002b,0x00000056,
+0x00000840,0x00000060,0x0004002b,0x00000056,
+0x00000841,0x00000040,0x0004002b,0x00000056,
+0x00000842,0x00000020,0x0007002c,0x00000057,
+0x00000843,0x00000840,0x00000841,0x00000842,
+0x000000b8,0x0007002c,0x00000011,0x00000847,
+0x000000a0,0x000000a0,0x000000a0,0x000000a0,
+0x0007002c,0x00000057,0x00000849,0x000000b8,
+0x000000b8,0x000000b8,0x000000b8,0x0004002b,
+0x00000056,0x0000084a,0x0000001f,0x0007002c,
+0x00000057,0x0000084b,0x0000084a,0x0000084a,
+0x0000084a,0x0000084a,0x0004002b,0x00000006,
+0x00000851,0xffffffff,0x0007002c,0x00000011,
+0x00000852,0x00000851,0x00000851,0x00000851,
+0x00000851,0x0007002c,0x00000011,0x00000855,
+0x000001dc,0x00000178,0x0000017c,0x0000019f,
+0x00040017,0x00000856,0x00000083,0x00000004,
+0x0007002c,0x00000011,0x0000085f,0x00000692,
+0x0000009d,0x00000692,0x00000692,0x0004002b,
+0x00000056,0x0000089a,0x0000001d,0x0004002b,
+0x00000056,0x0000089e,0xfffffffe,0x00040020,
+0x0000091b,0x00000001,0x00000008,0x0004003b,
+0x0000091b,0x0000091c,0x00000001,0x00040020,
+0x00000922,0x00000001,0x00000006,0x00090019,
+0x00000930,0x00000006,0x00000001,0x00000000,
+0x00000001,0x00000000,0x00000002,0x0000001e,
+0x00040020,0x00000931,0x00000000,0x00000930,
+0x0004003b,0x00000931,0x00000932,0x00000000,
+0x00090019,0x00000942,0x00000006,0x00000001,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x00000020,0x00040020,0x00000943,0x00000000,
+0x00000942,0x0004003b,0x00000943,0x00000944,
+0x00000000,0x0006002c,0x00000008,0x00000950,
+0x0000008d,0x0000008d,0x000000a0,0x00050036,
+0x00000002,0x00000004,0x00000000,0x00000003,
+0x000200f8,0x00000005,0x0004003b,0x00000035,
+0x0000091a,0x00000007,0x0004003b,0x00000007,
+0x0000091f,0x00000007,0x0004003b,0x00000035,
+0x00000926,0x00000007,0x0004003b,0x00000035,
+0x0000092b,0x00000007,0x0004003b,0x0000005e,
+0x0000093b,0x00000007,0x0004003b,0x00000012,
+0x0000093f,0x00000007,0x0004003b,0x0000005e,
+0x0000094d,0x00000007,0x0003003e,0x00000085,
+0x00000086,0x0004003d,0x00000008,0x0000091d,
+0x0000091c,0x0007004f,0x00000034,0x0000091e,
+0x0000091d,0x0000091d,0x00000000,0x00000001,
+0x0003003e,0x0000091a,0x0000091e,0x00050041,
+0x00000584,0x00000920,0x00000140,0x000000c3,
+0x0004003d,0x00000006,0x00000921,0x00000920,
+0x00050041,0x00000922,0x00000923,0x0000091c,
+0x00000092,0x0004003d,0x00000006,0x00000924,
+0x00000923,0x00050080,0x00000006,0x00000925,
+0x00000921,0x00000924,0x0003003e,0x0000091f,
+0x00000925,0x0004003d,0x00000034,0x00000927,
+0x0000091a,0x00050041,0x00000141,0x00000928,
+0x00000140,0x000000b8,0x0004003d,0x00000034,
+0x00000929,0x00000928,0x00050086,0x00000034,
+0x0000092a,0x00000927,0x00000929,0x0003003e,
+0x00000926,0x0000092a,0x0004003d,0x00000034,
+0x0000092c,0x0000091a,0x00050041,0x00000141,
+0x0000092d,0x00000140,0x000000b8,0x0004003d,
+0x00000034,0x0000092e,0x0000092d,0x00050089,
+0x00000034,0x0000092f,0x0000092c,0x0000092e,
+0x0003003e,0x0000092b,0x0000092f,0x0004003d,
+0x00000930,0x00000933,0x00000932,0x0004003d,
+0x00000034,0x00000934,0x00000926,0x0004007c,
+0x0000050e,0x00000935,0x00000934,0x0004003d,
+0x00000006,0x00000936,0x0000091f,0x0004007c,
+0x00000056,0x00000937,0x00000936,0x00050051,
+0x00000056,0x00000938,0x00000935,0x00000000,
+0x00050051,0x00000056,0x00000939,0x00000935,
+0x00000001,0x00060050,0x0000005d,0x0000093a,
+0x00000938,0x00000939,0x00000937,0x0003003e,
+0x0000093b,0x0000093a,0x00050039,0x0000005d,
+0x0000093c,0x00000081,0x0000093b,0x00050062,
+0x00000011,0x0000093d,0x00000933,0x0000093c,
+0x0009004f,0x00000011,0x0000093e,0x0000093d,
+0x0000093d,0x00000003,0x00000002,0x00000001,
+0x00000000,0x0003003e,0x000000a9,0x0000093e,
+0x0004003d,0x00000034,0x00000940,0x0000092b,
+0x00050039,0x00000011,0x00000941,0x0000007d,
+0x00000940,0x0003003e,0x0000093f,0x00000941,
+0x0004003d,0x00000942,0x00000945,0x00000944,
+0x0004003d,0x00000034,0x00000946,0x0000091a,
+0x0004007c,0x0000050e,0x00000947,0x00000946,
+0x0004003d,0x00000006,0x00000948,0x0000091f,
+0x0004007c,0x00000056,0x00000949,0x00000948,
+0x00050051,0x00000056,0x0000094a,0x00000947,
+0x00000000,0x00050051,0x00000056,0x0000094b,
+0x00000947,0x00000001,0x00060050,0x0000005d,
+0x0000094c,0x0000094a,0x0000094b,0x00000949,
+0x0003003e,0x0000094d,0x0000094c,0x00050039,
+0x0000005d,0x0000094e,0x00000081,0x0000094d,
+0x0004003d,0x00000011,0x0000094f,0x0000093f,
+0x00040063,0x00000945,0x0000094e,0x0000094f,
+0x000100fd,0x00010038,0x00050036,0x00000006,
+0x0000000d,0x00000000,0x0000000a,0x00030037,
+0x00000007,0x0000000b,0x00030037,0x00000009,
+0x0000000c,0x000200f8,0x0000000e,0x0004003b,
+0x00000035,0x00000087,0x00000007,0x0004003d,
+0x00000006,0x00000088,0x0000000b,0x0004003d,
+0x00000008,0x00000089,0x0000000c,0x0007004f,
+0x00000034,0x0000008a,0x00000089,0x00000089,
+0x00000000,0x00000001,0x00050050,0x00000034,
+0x0000008b,0x00000088,0x00000088,0x00050084,
+0x00000034,0x0000008c,0x0000008b,0x0000008a,
+0x00050084,0x00000034,0x00000090,0x0000008c,
+0x0000008f,0x00050080,0x00000034,0x00000094,
+0x00000090,0x00000093,0x00050086,0x00000034,
+0x00000098,0x00000094,0x00000097,0x0003003e,
+0x00000087,0x00000098,0x0004003d,0x00000006,
+0x00000099,0x0000000b,0x00050041,0x00000007,
+0x0000009a,0x0000000c,0x00000092,0x0004003d,
+0x00000006,0x0000009b,0x0000009a,0x00050084,
+0x00000006,0x0000009c,0x00000099,0x0000009b,
+0x00050041,0x00000007,0x0000009e,0x00000087,
+0x0000009d,0x0004003d,0x00000006,0x0000009f,
+0x0000009e,0x00050041,0x00000007,0x000000a1,
+0x00000087,0x000000a0,0x0004003d,0x00000006,
+0x000000a2,0x000000a1,0x00050080,0x00000006,
+0x000000a3,0x0000009f,0x000000a2,0x00050080,
+0x00000006,0x000000a4,0x0000009c,0x000000a3,
+0x000200fe,0x000000a4,0x00010038,0x00050036,
+0x00000002,0x0000000f,0x00000000,0x00000003,
+0x000200f8,0x00000010,0x0004003b,0x00000007,
+0x000000b5,0x00000007,0x0004003b,0x00000007,
+0x000000bb,0x00000007,0x0004003b,0x00000007,
+0x000000bf,0x00000007,0x0004003b,0x00000007,
+0x000000c5,0x00000007,0x0004003b,0x00000007,
+0x000000ca,0x00000007,0x0004003b,0x00000007,
+0x000000cf,0x00000007,0x0004003b,0x00000007,
+0x000000de,0x00000007,0x0004003b,0x00000161,
+0x00000162,0x00000007,0x0004003b,0x00000007,
+0x0000016f,0x00000007,0x0004003b,0x00000009,
+0x00000171,0x00000007,0x00050041,0x000000aa,
+0x000000ab,0x000000a9,0x00000096,0x0004003d,
+0x00000006,0x000000ac,0x000000ab,0x000500c7,
+0x00000006,0x000000ae,0x000000ac,0x000000ad,
+0x000500aa,0x00000083,0x000000b0,0x000000ae,
+0x000000af,0x0003003e,0x000000a7,0x000000b0,
+0x0004003d,0x00000083,0x000000b1,0x000000a7,
+0x000300f7,0x000000b3,0x00000000,0x000400fa,
+0x000000b1,0x000000b2,0x000000b3,0x000200f8,
+0x000000b2,0x000100fd,0x000200f8,0x000000b3,
+0x00050041,0x000000aa,0x000000b6,0x000000a9,
+0x00000096,0x0004003d,0x00000006,0x000000b7,
+0x000000b6,0x000600cb,0x00000006,0x000000ba,
+0x000000b7,0x000000b8,0x000000b9,0x0003003e,
+0x000000b5,0x000000ba,0x00050041,0x000000aa,
+0x000000bc,0x000000a9,0x00000096,0x0004003d,
+0x00000006,0x000000bd,0x000000bc,0x000600cb,
+0x00000006,0x000000be,0x000000bd,0x000000b9,
+0x000000b9,0x0003003e,0x000000bb,0x000000be,
+0x00050041,0x000000aa,0x000000c0,0x000000a9,
+0x00000096,0x0004003d,0x00000006,0x000000c1,
+0x000000c0,0x000600cb,0x00000006,0x000000c4,
+0x000000c1,0x000000c2,0x000000c3,0x0003003e,
+0x000000bf,0x000000c4,0x00050041,0x000000aa,
+0x000000c6,0x000000a9,0x00000096,0x0004003d,
+0x00000006,0x000000c7,0x000000c6,0x000600cb,
+0x00000006,0x000000c9,0x000000c7,0x000000c8,
+0x000000b9,0x0003003e,0x000000c5,0x000000c9,
+0x00050041,0x000000aa,0x000000cb,0x000000a9,
+0x00000096,0x0004003d,0x00000006,0x000000cc,
+0x000000cb,0x000600cb,0x00000006,0x000000ce,
+0x000000cc,0x000000cd,0x000000b9,0x0003003e,
+0x000000ca,0x000000ce,0x00050041,0x000000aa,
+0x000000d0,0x000000a9,0x00000096,0x0004003d,
+0x00000006,0x000000d1,0x000000d0,0x000600cb,
+0x00000006,0x000000d3,0x000000d1,0x000000d2,
+0x000000c3,0x0003003e,0x000000cf,0x000000d3,
+0x00050041,0x000000aa,0x000000d5,0x000000a9,
+0x00000096,0x0004003d,0x00000006,0x000000d6,
+0x000000d5,0x000600cb,0x00000006,0x000000d8,
+0x000000d6,0x000000d7,0x000000c3,0x000500ab,
+0x00000083,0x000000d9,0x000000d8,0x0000009d,
+0x0003003e,0x000000d4,0x000000d9,0x0004003d,
+0x00000006,0x000000da,0x000000b5,0x000500aa,
+0x00000083,0x000000db,0x000000da,0x0000009d,
+0x000300f7,0x000000dd,0x00000000,0x000400fa,
+0x000000db,0x000000dc,0x0000010d,0x000200f8,
+0x000000dc,0x0004003d,0x00000006,0x000000df,
+0x000000bb,0x000500c4,0x00000006,0x000000e0,
+0x000000df,0x000000c3,0x0004003d,0x00000006,
+0x000000e1,0x000000bf,0x000500c5,0x00000006,
+0x000000e2,0x000000e0,0x000000e1,0x0003003e,
+0x000000de,0x000000e2,0x0004003d,0x00000006,
+0x000000e3,0x000000ca,0x000300f7,0x000000e8,
+0x00000000,0x000b00fb,0x000000e3,0x000000e8,
+0x00000000,0x000000e4,0x00000001,0x000000e5,
+0x00000002,0x000000e6,0x00000003,0x000000e7,
+0x000200f8,0x000000e4,0x0004003d,0x00000006,
+0x000000ec,0x000000c5,0x00050080,0x00000006,
+0x000000ed,0x000000ec,0x00000092,0x00050050,
+0x00000034,0x000000ee,0x000000eb,0x000000ed,
+0x0003003e,0x000000ea,0x000000ee,0x000200f9,
+0x000000e8,0x000200f8,0x000000e5,0x0004003d,
+0x00000006,0x000000f0,0x000000c5,0x00050080,
+0x00000006,0x000000f1,0x000000f0,0x00000092,
+0x00050050,0x00000034,0x000000f2,0x000000f1,
+0x000000eb,0x0003003e,0x000000ea,0x000000f2,
+0x000200f9,0x000000e8,0x000200f8,0x000000e6,
+0x0004003d,0x00000006,0x000000f4,0x000000c5,
+0x00050080,0x00000006,0x000000f6,0x000000f4,
+0x000000f5,0x00050041,0x000000aa,0x000000f7,
+0x000000a9,0x00000096,0x0004003d,0x00000006,
+0x000000f8,0x000000f7,0x000600cb,0x00000006,
+0x000000f9,0x000000f8,0x000000d2,0x000000b9,
+0x00050080,0x00000006,0x000000fa,0x000000f9,
+0x000000f5,0x00050050,0x00000034,0x000000fb,
+0x000000f6,0x000000fa,0x0003003e,0x000000ea,
+0x000000fb,0x0003003e,0x000000d4,0x00000086,
+0x0003003e,0x000000cf,0x0000009d,0x000200f9,
+0x000000e8,0x000200f8,0x000000e7,0x0004003d,
+0x00000006,0x000000fd,0x000000c5,0x000500aa,
+0x00000083,0x000000fe,0x000000fd,0x0000009d,
+0x000300f7,0x00000100,0x00000000,0x000400fa,
+0x000000fe,0x000000ff,0x00000103,0x000200f8,
+0x000000ff,0x0003003e,0x000000ea,0x00000102,
+0x000200f9,0x00000100,0x000200f8,0x00000103,
+0x0004003d,0x00000006,0x00000104,0x000000c5,
+0x000500aa,0x00000083,0x00000105,0x00000104,
+0x000000a0,0x000300f7,0x00000107,0x00000000,
+0x000400fa,0x00000105,0x00000106,0x00000109,
+0x000200f8,0x00000106,0x0003003e,0x000000ea,
+0x00000108,0x000200f9,0x00000107,0x000200f8,
+0x00000109,0x0003003e,0x00000085,0x0000010a,
+0x000100fd,0x000200f8,0x00000107,0x000200f9,
+0x00000100,0x000200f8,0x00000100,0x000200f9,
+0x000000e8,0x000200f8,0x000000e8,0x000200f9,
+0x000000dd,0x000200f8,0x0000010d,0x0004003d,
+0x00000006,0x0000010e,0x000000b5,0x000500c4,
+0x00000006,0x0000010f,0x0000010e,0x000000c3,
+0x0004003d,0x00000006,0x00000110,0x000000bf,
+0x000500c5,0x00000006,0x00000111,0x0000010f,
+0x00000110,0x0003003e,0x000000de,0x00000111,
+0x0004003d,0x00000006,0x00000112,0x000000bb,
+0x000300f7,0x00000117,0x00000000,0x000b00fb,
+0x00000112,0x00000117,0x00000000,0x00000113,
+0x00000001,0x00000114,0x00000002,0x00000115,
+0x00000003,0x00000116,0x000200f8,0x00000113,
+0x0004003d,0x00000006,0x00000118,0x000000ca,
+0x00050080,0x00000006,0x00000119,0x00000118,
+0x00000091,0x0004003d,0x00000006,0x0000011a,
+0x000000c5,0x00050080,0x00000006,0x0000011b,
+0x0000011a,0x00000092,0x00050050,0x00000034,
+0x0000011c,0x00000119,0x0000011b,0x0003003e,
+0x000000ea,0x0000011c,0x000200f9,0x00000117,
+0x000200f8,0x00000114,0x0004003d,0x00000006,
+0x0000011e,0x000000ca,0x00050080,0x00000006,
+0x0000011f,0x0000011e,0x0000008d,0x0004003d,
+0x00000006,0x00000120,0x000000c5,0x00050080,
+0x00000006,0x00000121,0x00000120,0x00000092,
+0x00050050,0x00000034,0x00000122,0x0000011f,
+0x00000121,0x0003003e,0x000000ea,0x00000122,
+0x000200f9,0x00000117,0x000200f8,0x00000115,
+0x0004003d,0x00000006,0x00000124,0x000000c5,
+0x00050080,0x00000006,0x00000125,0x00000124,
+0x00000092,0x0004003d,0x00000006,0x00000126,
+0x000000ca,0x00050080,0x00000006,0x00000127,
+0x00000126,0x0000008d,0x00050050,0x00000034,
+0x00000128,0x00000125,0x00000127,0x0003003e,
+0x000000ea,0x00000128,0x000200f9,0x00000117,
+0x000200f8,0x00000116,0x0004003d,0x00000006,
+0x0000012a,0x000000ca,0x000500c2,0x00000006,
+0x0000012b,0x0000012a,0x000000c3,0x000500aa,
+0x00000083,0x0000012c,0x0000012b,0x0000009d,
+0x000300f7,0x0000012e,0x00000000,0x000400fa,
+0x0000012c,0x0000012d,0x00000135,0x000200f8,
+0x0000012d,0x0004003d,0x00000006,0x0000012f,
+0x000000c5,0x00050080,0x00000006,0x00000130,
+0x0000012f,0x00000092,0x0004003d,0x00000006,
+0x00000131,0x000000ca,0x000500c7,0x00000006,
+0x00000132,0x00000131,0x000000a0,0x00050080,
+0x00000006,0x00000133,0x00000132,0x000000f5,
+0x00050050,0x00000034,0x00000134,0x00000130,
+0x00000133,0x0003003e,0x000000ea,0x00000134,
+0x000200f9,0x0000012e,0x000200f8,0x00000135,
+0x0004003d,0x00000006,0x00000136,0x000000ca,
+0x000500c7,0x00000006,0x00000137,0x00000136,
+0x000000a0,0x00050080,0x00000006,0x00000138,
+0x00000137,0x00000092,0x0004003d,0x00000006,
+0x00000139,0x000000c5,0x00050080,0x00000006,
+0x0000013a,0x00000139,0x00000092,0x00050050,
+0x00000034,0x0000013b,0x00000138,0x0000013a,
+0x0003003e,0x000000ea,0x0000013b,0x000200f9,
+0x0000012e,0x000200f8,0x0000012e,0x000200f9,
+0x00000117,0x000200f8,0x00000117,0x000200f9,
+0x000000dd,0x000200f8,0x000000dd,0x0004003d,
+0x00000034,0x0000013d,0x000000ea,0x00050041,
+0x00000141,0x00000142,0x00000140,0x000000b8,
+0x0004003d,0x00000034,0x00000143,0x00000142,
+0x000500ac,0x00000144,0x00000145,0x0000013d,
+0x00000143,0x0004009a,0x00000083,0x00000146,
+0x00000145,0x000300f7,0x00000148,0x00000000,
+0x000400fa,0x00000146,0x00000147,0x00000148,
+0x000200f8,0x00000147,0x0003003e,0x00000085,
+0x0000010a,0x000100fd,0x000200f8,0x00000148,
+0x0004003d,0x00000006,0x0000015c,0x000000cf,
+0x000500c4,0x00000006,0x0000015e,0x0000015c,
+0x0000015d,0x0004003d,0x00000006,0x0000015f,
+0x000000de,0x000500c5,0x00000006,0x00000160,
+0x0000015e,0x0000015f,0x0003003e,0x00000162,
+0x0000015b,0x00050041,0x00000009,0x00000163,
+0x00000162,0x00000160,0x0004003d,0x00000008,
+0x00000164,0x00000163,0x0003003e,0x0000014b,
+0x00000164,0x00050041,0x000000aa,0x00000166,
+0x000000ea,0x0000009d,0x0004003d,0x00000006,
+0x00000167,0x00000166,0x00050041,0x000000aa,
+0x00000168,0x000000ea,0x000000a0,0x0004003d,
+0x00000006,0x00000169,0x00000168,0x00050084,
+0x00000006,0x0000016a,0x00000167,0x00000169,
+0x0004003d,0x00000083,0x0000016b,0x000000d4,
+0x000600a9,0x00000056,0x0000016c,0x0000016b,
+0x000000c3,0x000000b8,0x000500c4,0x00000006,
+0x0000016d,0x0000016a,0x0000016c,0x0003003e,
+0x00000165,0x0000016d,0x0004003d,0x00000006,
+0x00000170,0x00000165,0x0003003e,0x0000016f,
+0x00000170,0x0004003d,0x00000008,0x00000172,
+0x0000014b,0x0003003e,0x00000171,0x00000172,
+0x00060039,0x00000006,0x00000173,0x0000000d,
+0x0000016f,0x00000171,0x0003003e,0x0000016e,
+0x00000173,0x0004003d,0x00000006,0x00000174,
+0x0000016e,0x000500b0,0x00000083,0x00000176,
+0x00000174,0x00000175,0x0004003d,0x00000006,
+0x00000177,0x0000016e,0x000500ac,0x00000083,
+0x00000179,0x00000177,0x00000178,0x000500a6,
+0x00000083,0x0000017a,0x00000176,0x00000179,
+0x0004003d,0x00000006,0x0000017b,0x00000165,
+0x000500ac,0x00000083,0x0000017d,0x0000017b,
+0x0000017c,0x000500a6,0x00000083,0x0000017e,
+0x0000017a,0x0000017d,0x000300f7,0x00000180,
+0x00000000,0x000400fa,0x0000017e,0x0000017f,
+0x00000180,0x000200f8,0x0000017f,0x0003003e,
+0x00000085,0x0000010a,0x000100fd,0x000200f8,
+0x00000180,0x00050041,0x000000aa,0x00000183,
+0x000000a9,0x00000096,0x0004003d,0x00000006,
+0x00000184,0x00000183,0x000600cb,0x00000006,
+0x00000186,0x00000184,0x00000185,0x000000b9,
+0x00050080,0x00000006,0x00000187,0x00000186,
+0x000000a0,0x0003003e,0x00000182,0x00000187,
+0x0004003d,0x00000006,0x00000188,0x00000182,
+0x000500ac,0x00000083,0x00000189,0x00000188,
+0x000000a0,0x000300f7,0x0000018b,0x00000000,
+0x000400fa,0x00000189,0x0000018a,0x0000018b,
+0x000200f8,0x0000018a,0x00050041,0x000000aa,
+0x0000018d,0x000000a9,0x00000096,0x0004003d,
+0x00000006,0x0000018e,0x0000018d,0x000600cb,
+0x00000006,0x00000190,0x0000018e,0x0000018f,
+0x000000d7,0x0003003e,0x0000018c,0x00000190,
+0x000200f9,0x0000018b,0x000200f8,0x0000018b,
+0x0004003d,0x00000083,0x00000191,0x000000d4,
+0x0004003d,0x00000006,0x00000192,0x00000182,
+0x000500aa,0x00000083,0x00000193,0x00000192,
+0x00000091,0x000500a7,0x00000083,0x00000194,
+0x00000191,0x00000193,0x000300f7,0x00000196,
+0x00000000,0x000400fa,0x00000194,0x00000195,
+0x00000196,0x000200f8,0x00000195,0x0003003e,
+0x00000085,0x0000010a,0x000100fd,0x000200f8,
+0x00000196,0x000100fd,0x00010038,0x00050036,
+0x00000006,0x00000017,0x00000000,0x00000013,
+0x00030037,0x00000012,0x00000014,0x00030037,
+0x00000007,0x00000015,0x00030037,0x00000007,
+0x00000016,0x000200f8,0x00000018,0x0004003b,
+0x00000007,0x0000019d,0x00000007,0x0004003b,
+0x00000007,0x000001a2,0x00000007,0x0004003b,
+0x00000007,0x000001a9,0x00000007,0x0004003b,
+0x00000007,0x000001bc,0x00000007,0x0004003b,
+0x00000007,0x000001bf,0x00000007,0x0004003b,
+0x00000007,0x000001c8,0x00000007,0x0004003d,
+0x00000006,0x00000198,0x00000016,0x000500aa,
+0x00000083,0x00000199,0x00000198,0x0000009d,
+0x000300f7,0x0000019b,0x00000000,0x000400fa,
+0x00000199,0x0000019a,0x0000019b,0x000200f8,
+0x0000019a,0x000200fe,0x0000009d,0x000200f8,
+0x0000019b,0x0004003d,0x00000006,0x0000019e,
+0x00000015,0x00050086,0x00000006,0x000001a0,
+0x0000019e,0x0000019f,0x00050082,0x00000006,
+0x000001a1,0x00000096,0x000001a0,0x0003003e,
+0x0000019d,0x000001a1,0x0004003d,0x00000006,
+0x000001a3,0x00000015,0x0004003d,0x00000006,
+0x000001a4,0x00000016,0x00050080,0x00000006,
+0x000001a5,0x000001a3,0x000001a4,0x00050082,
+0x00000006,0x000001a6,0x000001a5,0x000000a0,
+0x00050086,0x00000006,0x000001a7,0x000001a6,
+0x0000019f,0x00050082,0x00000006,0x000001a8,
+0x00000096,0x000001a7,0x0003003e,0x000001a2,
+0x000001a8,0x0004003d,0x00000006,0x000001aa,
+0x00000015,0x000500c7,0x00000006,0x000001ac,
+0x000001aa,0x000001ab,0x0003003e,0x000001a9,
+0x000001ac,0x0004003d,0x00000006,0x000001ad,
+0x0000019d,0x0004003d,0x00000006,0x000001ae,
+0x000001a2,0x000500aa,0x00000083,0x000001af,
+0x000001ad,0x000001ae,0x000300f7,0x000001b1,
+0x00000000,0x000400fa,0x000001af,0x000001b0,
+0x000001bb,0x000200f8,0x000001b0,0x0004003d,
+0x00000006,0x000001b2,0x0000019d,0x00050041,
+0x00000007,0x000001b3,0x00000014,0x000001b2,
+0x0004003d,0x00000006,0x000001b4,0x000001b3,
+0x0004003d,0x00000006,0x000001b5,0x000001a9,
+0x0004007c,0x00000056,0x000001b6,0x000001b5,
+0x0004003d,0x00000006,0x000001b7,0x00000016,
+0x0004007c,0x00000056,0x000001b8,0x000001b7,
+0x000600cb,0x00000006,0x000001b9,0x000001b4,
+0x000001b6,0x000001b8,0x000200fe,0x000001b9,
+0x000200f8,0x000001bb,0x0004003d,0x00000006,
+0x000001bd,0x000001a9,0x00050082,0x00000006,
+0x000001be,0x0000019f,0x000001bd,0x0003003e,
+0x000001bc,0x000001be,0x0004003d,0x00000006,
+0x000001c0,0x0000019d,0x00050041,0x00000007,
+0x000001c1,0x00000014,0x000001c0,0x0004003d,
+0x00000006,0x000001c2,0x000001c1,0x0004003d,
+0x00000006,0x000001c3,0x000001a9,0x0004007c,
+0x00000056,0x000001c4,0x000001c3,0x0004003d,
+0x00000006,0x000001c5,0x000001bc,0x0004007c,
+0x00000056,0x000001c6,0x000001c5,0x000600cb,
+0x00000006,0x000001c7,0x000001c2,0x000001c4,
+0x000001c6,0x0003003e,0x000001bf,0x000001c7,
+0x0004003d,0x00000006,0x000001c9,0x000001a2,
+0x00050041,0x00000007,0x000001ca,0x00000014,
+0x000001c9,0x0004003d,0x00000006,0x000001cb,
+0x000001ca,0x0004003d,0x00000006,0x000001cc,
+0x00000016,0x0004003d,0x00000006,0x000001cd,
+0x000001bc,0x00050082,0x00000006,0x000001ce,
+0x000001cc,0x000001cd,0x0004007c,0x00000056,
+0x000001cf,0x000001ce,0x000600cb,0x00000006,
+0x000001d0,0x000001cb,0x000000b8,0x000001cf,
+0x0003003e,0x000001c8,0x000001d0,0x0004003d,
+0x00000006,0x000001d1,0x000001c8,0x0004003d,
+0x00000006,0x000001d2,0x000001bc,0x000500c4,
+0x00000006,0x000001d3,0x000001d1,0x000001d2,
+0x0004003d,0x00000006,0x000001d4,0x000001bf,
+0x000500c5,0x00000006,0x000001d5,0x000001d3,
+0x000001d4,0x000200fe,0x000001d5,0x000200f8,
+0x000001b1,0x000100ff,0x00010038,0x00050036,
+0x00000006,0x0000001e,0x00000000,0x00000019,
+0x00030037,0x00000007,0x0000001a,0x00030037,
+0x00000007,0x0000001b,0x00030037,0x00000007,
+0x0000001c,0x00030037,0x00000007,0x0000001d,
+0x000200f8,0x0000001f,0x0004003b,0x00000007,
+0x000001df,0x00000007,0x0004003b,0x00000007,
+0x000001ea,0x00000007,0x0004003b,0x00000007,
+0x000001ef,0x00000007,0x0004003b,0x00000007,
+0x000001fa,0x00000007,0x0004003b,0x00000007,
+0x00000208,0x00000007,0x0004003b,0x00000007,
+0x00000210,0x00000007,0x0004003b,0x00000012,
+0x00000211,0x00000007,0x0004003b,0x00000007,
+0x00000213,0x00000007,0x0004003b,0x00000007,
+0x00000215,0x00000007,0x0004003b,0x00000007,
+0x00000218,0x00000007,0x0004003b,0x00000007,
+0x0000021d,0x00000007,0x0004003b,0x00000007,
+0x00000225,0x00000007,0x0004003b,0x00000007,
+0x0000023d,0x00000007,0x0004003d,0x00000006,
+0x000001d8,0x00000182,0x000500aa,0x00000083,
+0x000001d9,0x000001d8,0x000000a0,0x000300f7,
+0x000001db,0x00000000,0x000400fa,0x000001d9,
+0x000001da,0x000001e9,0x000200f8,0x000001da,
+0x0004003d,0x00000006,0x000001dd,0x0000016e,
+0x00050082,0x00000006,0x000001de,0x000001dc,
+0x000001dd,0x0003003e,0x0000001b,0x000001de,
+0x00050041,0x000000aa,0x000001e0,0x000000a9,
+0x00000096,0x0004003d,0x00000006,0x000001e1,
+0x000001e0,0x000600cb,0x00000006,0x000001e2,
+0x000001e1,0x0000018f,0x000000c2,0x0003003e,
+0x000001df,0x000001e2,0x0004003d,0x00000006,
+0x000001e3,0x000001df,0x000500c2,0x00000006,
+0x000001e4,0x000001e3,0x000000b9,0x00050084,
+0x00000006,0x000001e5,0x00000092,0x000001e4,
+0x00050080,0x00000006,0x000001e6,0x000001e5,
+0x00000092,0x0003003e,0x0000001c,0x000001e6,
+0x0003003e,0x0000001d,0x0000009d,0x0004003d,
+0x00000006,0x000001e7,0x000001df,0x000200fe,
+0x000001e7,0x000200f8,0x000001e9,0x00050041,
+0x000000aa,0x000001eb,0x000000a9,0x00000096,
+0x0004003d,0x00000006,0x000001ec,0x000001eb,
+0x000600cb,0x00000006,0x000001ee,0x000001ec,
+0x000001ed,0x000000b9,0x0003003e,0x000001ea,
+0x000001ee,0x00050041,0x000000aa,0x000001f0,
+0x000000a9,0x00000096,0x0004003d,0x00000006,
+0x000001f1,0x000001f0,0x000600cb,0x00000006,
+0x000001f3,0x000001f1,0x000001f2,0x000000c2,
+0x0003003e,0x000001ef,0x000001f3,0x0004003d,
+0x00000006,0x000001f4,0x000001ea,0x000500aa,
+0x00000083,0x000001f5,0x000001f4,0x0000009d,
+0x000300f7,0x000001f7,0x00000000,0x000400fa,
+0x000001f5,0x000001f6,0x00000207,0x000200f8,
+0x000001f6,0x0004003d,0x00000006,0x000001f8,
+0x0000016e,0x00050082,0x00000006,0x000001f9,
+0x000001dc,0x000001f8,0x0003003e,0x0000001b,
+0x000001f9,0x0004003d,0x00000006,0x000001fb,
+0x000001ef,0x000500c2,0x00000006,0x000001fc,
+0x000001fb,0x000000b9,0x00050084,0x00000006,
+0x000001fd,0x00000092,0x000001fc,0x00050080,
+0x00000006,0x000001fe,0x000001fd,0x00000092,
+0x0003003e,0x000001fa,0x000001fe,0x0004003d,
+0x00000006,0x000001ff,0x000001fa,0x0004003d,
+0x00000006,0x00000200,0x00000182,0x00050084,
+0x00000006,0x00000201,0x000001ff,0x00000200,
+0x0003003e,0x0000001c,0x00000201,0x0004003d,
+0x00000006,0x00000202,0x000001fa,0x0004003d,
+0x00000006,0x00000203,0x0000001a,0x00050084,
+0x00000006,0x00000204,0x00000202,0x00000203,
+0x0003003e,0x0000001d,0x00000204,0x0004003d,
+0x00000006,0x00000205,0x000001ef,0x000200fe,
+0x00000205,0x000200f8,0x00000207,0x0004003d,
+0x00000006,0x00000209,0x00000182,0x00050084,
+0x00000006,0x0000020a,0x00000096,0x00000209,
+0x00050082,0x00000006,0x0000020b,0x0000020a,
+0x00000091,0x0003003e,0x00000208,0x0000020b,
+0x0004003d,0x00000006,0x0000020c,0x0000016e,
+0x00050082,0x00000006,0x0000020d,0x000001dc,
+0x0000020c,0x0004003d,0x00000006,0x0000020e,
+0x00000208,0x00050082,0x00000006,0x0000020f,
+0x0000020d,0x0000020e,0x0003003e,0x0000001b,
+0x0000020f,0x0004003d,0x00000011,0x00000212,
+0x000000a9,0x0003003e,0x00000211,0x00000212,
+0x0004003d,0x00000006,0x00000214,0x0000001b,
+0x0003003e,0x00000213,0x00000214,0x0004003d,
+0x00000006,0x00000216,0x00000208,0x0003003e,
+0x00000215,0x00000216,0x00070039,0x00000006,
+0x00000217,0x00000017,0x00000211,0x00000213,
+0x00000215,0x0003003e,0x00000210,0x00000217,
+0x0004003d,0x00000006,0x00000219,0x00000210,
+0x000500c4,0x00000006,0x0000021a,0x00000219,
+0x000000c2,0x0004003d,0x00000006,0x0000021b,
+0x000001ef,0x000500c5,0x00000006,0x0000021c,
+0x0000021a,0x0000021b,0x0003003e,0x00000218,
+0x0000021c,0x0004003d,0x00000006,0x0000021e,
+0x00000218,0x0004003d,0x00000006,0x0000021f,
+0x0000001a,0x00050084,0x00000006,0x00000220,
+0x00000092,0x0000021f,0x0004003d,0x00000006,
+0x00000221,0x00000182,0x00050080,0x00000006,
+0x00000222,0x00000220,0x00000221,0x0004007c,
+0x00000056,0x00000223,0x00000222,0x000600cb,
+0x00000006,0x00000224,0x0000021e,0x00000223,
+0x000000b9,0x0003003e,0x0000021d,0x00000224,
+0x0004003d,0x00000006,0x00000226,0x00000218,
+0x0004003d,0x00000006,0x00000227,0x00000182,
+0x0004007c,0x00000056,0x00000228,0x00000227,
+0x000600cb,0x00000006,0x00000229,0x00000226,
+0x000000b8,0x00000228,0x0003003e,0x00000225,
+0x00000229,0x0004003d,0x00000006,0x0000022a,
+0x000001ea,0x0004003d,0x00000006,0x0000022b,
+0x00000182,0x00050084,0x00000006,0x0000022c,
+0x0000022a,0x0000022b,0x0004003d,0x00000006,
+0x0000022d,0x00000225,0x000400cd,0x00000056,
+0x0000022e,0x0000022d,0x0004007c,0x00000006,
+0x0000022f,0x0000022e,0x00050080,0x00000006,
+0x00000230,0x0000022c,0x0000022f,0x00050084,
+0x00000006,0x00000231,0x00000092,0x00000230,
+0x0003003e,0x0000001c,0x00000231,0x0004003d,
+0x00000006,0x00000232,0x000001ea,0x0004003d,
+0x00000006,0x00000233,0x0000001a,0x00050084,
+0x00000006,0x00000234,0x00000232,0x00000233,
+0x0004003d,0x00000006,0x00000235,0x00000225,
+0x0004003d,0x00000006,0x00000236,0x0000001a,
+0x0004007c,0x00000056,0x00000237,0x00000236,
+0x000600cb,0x00000006,0x00000238,0x00000235,
+0x000000b8,0x00000237,0x000400cd,0x00000056,
+0x00000239,0x00000238,0x0004007c,0x00000006,
+0x0000023a,0x00000239,0x00050080,0x00000006,
+0x0000023b,0x00000234,0x0000023a,0x00050084,
+0x00000006,0x0000023c,0x00000092,0x0000023b,
+0x0003003e,0x0000001d,0x0000023c,0x0004003d,
+0x00000006,0x0000023e,0x000001ea,0x00050082,
+0x00000006,0x0000023f,0x0000023e,0x000000a0,
+0x0004003d,0x00000006,0x00000240,0x00000225,
+0x0004003d,0x00000006,0x00000241,0x0000001a,
+0x0004007c,0x00000056,0x00000242,0x00000241,
+0x000600cb,0x00000006,0x00000243,0x00000240,
+0x00000242,0x000000c3,0x00050080,0x00000006,
+0x00000244,0x0000023f,0x00000243,0x0003003e,
+0x0000023d,0x00000244,0x0004003d,0x00000006,
+0x00000245,0x0000023d,0x000500c4,0x00000006,
+0x00000246,0x00000245,0x000000b9,0x0004003d,
+0x00000006,0x00000247,0x0000021d,0x000500c5,
+0x00000006,0x00000248,0x00000246,0x00000247,
+0x000200fe,0x00000248,0x000200f8,0x000001f7,
+0x000100ff,0x000200f8,0x000001db,0x000100ff,
+0x00010038,0x00050036,0x00000006,0x00000025,
+0x00000000,0x00000020,0x00030037,0x00000012,
+0x00000021,0x00030037,0x00000007,0x00000022,
+0x00030037,0x00000007,0x00000023,0x00030037,
+0x00000007,0x00000024,0x000200f8,0x00000026,
+0x0004003b,0x0000024b,0x0000024c,0x00000007,
+0x0004003b,0x00000007,0x0000024f,0x00000007,
+0x0004003b,0x00000012,0x00000256,0x00000007,
+0x0004003b,0x00000007,0x00000258,0x00000007,
+0x0004003b,0x00000007,0x00000259,0x00000007,
+0x0004003b,0x00000007,0x0000025b,0x00000007,
+0x0004003b,0x00000007,0x0000027e,0x00000007,
+0x0004003b,0x00000012,0x0000027f,0x00000007,
+0x0004003b,0x00000007,0x00000281,0x00000007,
+0x0004003b,0x00000007,0x00000283,0x00000007,
+0x0004003b,0x0000024b,0x00000287,0x00000007,
+0x0004003b,0x00000007,0x00000295,0x00000007,
+0x0004003b,0x0000037e,0x0000037f,0x00000007,
+0x0004003d,0x00000006,0x0000024d,0x00000023,
+0x0004007c,0x00000056,0x0000024e,0x0000024d,
+0x0003003e,0x0000024c,0x0000024e,0x0004003d,
+0x00000006,0x00000250,0x00000022,0x0004003d,
+0x00000006,0x00000251,0x00000023,0x00050080,
+0x00000006,0x00000252,0x00000250,0x00000251,
+0x0004003d,0x00000006,0x00000253,0x00000023,
+0x00050084,0x00000006,0x00000254,0x00000091,
+0x00000253,0x00050080,0x00000006,0x00000255,
+0x00000254,0x0000008d,0x0004003d,0x00000011,
+0x00000257,0x00000021,0x0003003e,0x00000256,
+0x00000257,0x0003003e,0x00000258,0x00000252,
+0x0003003e,0x00000259,0x00000255,0x00070039,
+0x00000006,0x0000025a,0x00000017,0x00000256,
+0x00000258,0x00000259,0x0003003e,0x0000024f,
+0x0000025a,0x0004003d,0x00000006,0x0000025c,
+0x0000024f,0x000600cb,0x00000006,0x0000025d,
+0x0000025c,0x000000b8,0x000000b9,0x0004003d,
+0x00000006,0x0000025e,0x0000024f,0x0004003d,
+0x00000056,0x0000025f,0x0000024c,0x00050084,
+0x00000056,0x00000260,0x000000c3,0x0000025f,
+0x00050080,0x00000056,0x00000261,0x00000260,
+0x000000b9,0x000600cb,0x00000006,0x00000262,
+0x0000025e,0x00000261,0x000000b9,0x000500c4,
+0x00000006,0x00000263,0x00000262,0x000000b9,
+0x000500c5,0x00000006,0x00000264,0x0000025d,
+0x00000263,0x0004003d,0x00000006,0x00000265,
+0x0000024f,0x0004003d,0x00000056,0x00000266,
+0x0000024c,0x00050084,0x00000056,0x00000267,
+0x000000b9,0x00000266,0x00050080,0x00000056,
+0x00000268,0x00000267,0x000000c2,0x000600cb,
+0x00000006,0x00000269,0x00000265,0x00000268,
+0x000000c3,0x000500c4,0x00000006,0x0000026a,
+0x00000269,0x000000c2,0x000500c5,0x00000006,
+0x0000026b,0x00000264,0x0000026a,0x0004003d,
+0x00000006,0x0000026c,0x0000024f,0x0004003d,
+0x00000056,0x0000026d,0x0000024c,0x00050084,
+0x00000056,0x0000026e,0x0000015d,0x0000026d,
+0x00050080,0x00000056,0x0000026f,0x0000026e,
+0x000000c8,0x000600cb,0x00000006,0x00000270,
+0x0000026c,0x0000026f,0x000000b9,0x000500c4,
+0x00000006,0x00000271,0x00000270,0x000000c8,
+0x000500c5,0x00000006,0x00000272,0x0000026b,
+0x00000271,0x0004003d,0x00000006,0x00000273,
+0x0000024f,0x0004003d,0x00000056,0x00000274,
+0x0000024c,0x00050084,0x00000056,0x00000275,
+0x000000c2,0x00000274,0x00050080,0x00000056,
+0x00000276,0x00000275,0x000000cd,0x000600cb,
+0x00000006,0x00000277,0x00000273,0x00000276,
+0x000000c3,0x000500c4,0x00000006,0x00000278,
+0x00000277,0x000000cd,0x000500c5,0x00000006,
+0x00000279,0x00000272,0x00000278,0x0003003e,
+0x0000025b,0x00000279,0x0004003d,0x00000006,
+0x0000027a,0x00000024,0x000500aa,0x00000083,
+0x0000027b,0x0000027a,0x0000009d,0x000300f7,
+0x0000027d,0x00000000,0x000400fa,0x0000027b,
+0x0000027c,0x00000286,0x000200f8,0x0000027c,
+0x0004003d,0x00000011,0x00000280,0x00000021,
+0x0003003e,0x0000027f,0x00000280,0x0004003d,
+0x00000006,0x00000282,0x00000022,0x0003003e,
+0x00000281,0x00000282,0x0004003d,0x00000006,
+0x00000284,0x00000023,0x0003003e,0x00000283,
+0x00000284,0x00070039,0x00000006,0x00000285,
+0x00000017,0x0000027f,0x00000281,0x00000283,
+0x0003003e,0x0000027e,0x00000285,0x000200f9,
+0x0000027d,0x000200f8,0x00000286,0x0004003d,
+0x00000006,0x00000288,0x00000024,0x0004007c,
+0x00000056,0x00000289,0x00000288,0x00050082,
+0x00000056,0x0000028a,0x00000289,0x000000c3,
+0x0003003e,0x00000287,0x0000028a,0x0004003d,
+0x00000006,0x0000028b,0x0000024f,0x0004003d,
+0x00000056,0x0000028c,0x00000287,0x0004003d,
+0x00000056,0x0000028d,0x0000024c,0x00050084,
+0x00000056,0x0000028e,0x0000028c,0x0000028d,
+0x0004003d,0x00000056,0x00000290,0x00000287,
+0x0005004d,0x00000056,0x00000291,0x0000028f,
+0x00000290,0x00050080,0x00000056,0x00000292,
+0x0000028e,0x00000291,0x0004003d,0x00000056,
+0x00000293,0x0000024c,0x000600cb,0x00000006,
+0x00000294,0x0000028b,0x00000292,0x00000293,
+0x0003003e,0x0000027e,0x00000294,0x000200f9,
+0x0000027d,0x000200f8,0x0000027d,0x0004003d,
+0x00000006,0x0000037d,0x0000025b,0x0003003e,
+0x0000037f,0x0000037c,0x00050041,0x00000007,
+0x00000380,0x0000037f,0x0000037d,0x0004003d,
+0x00000006,0x00000381,0x00000380,0x0003003e,
+0x00000295,0x00000381,0x0004003d,0x00000006,
+0x00000382,0x00000295,0x0004003d,0x00000006,
+0x00000383,0x00000024,0x0004007c,0x00000056,
+0x00000384,0x00000383,0x00050084,0x00000056,
+0x00000385,0x000000b9,0x00000384,0x000600cb,
+0x00000006,0x00000386,0x00000382,0x00000385,
+0x000000b9,0x0004003d,0x00000006,0x00000387,
+0x00000023,0x000500c4,0x00000006,0x00000388,
+0x00000386,0x00000387,0x0004003d,0x00000006,
+0x00000389,0x0000027e,0x000500c5,0x00000006,
+0x0000038a,0x00000388,0x00000389,0x000200fe,
+0x0000038a,0x00010038,0x00050036,0x00000006,
+0x0000002b,0x00000000,0x00000020,0x00030037,
+0x00000012,0x00000027,0x00030037,0x00000007,
+0x00000028,0x00030037,0x00000007,0x00000029,
+0x00030037,0x00000007,0x0000002a,0x000200f8,
+0x0000002c,0x0004003b,0x0000024b,0x0000038d,
+0x00000007,0x0004003b,0x00000007,0x00000390,
+0x00000007,0x0004003b,0x00000012,0x00000394,
+0x00000007,0x0004003b,0x00000007,0x00000396,
+0x00000007,0x0004003b,0x00000007,0x00000398,
+0x00000007,0x0004003b,0x00000007,0x0000039a,
+0x00000007,0x0004003b,0x00000007,0x000003ac,
+0x00000007,0x0004003b,0x00000007,0x000003b8,
+0x00000007,0x0004003b,0x000003ef,0x000003f0,
+0x00000007,0x0004003d,0x00000006,0x0000038e,
+0x00000029,0x0004007c,0x00000056,0x0000038f,
+0x0000038e,0x0003003e,0x0000038d,0x0000038f,
+0x0004003d,0x00000006,0x00000391,0x00000029,
+0x00050084,0x00000006,0x00000392,0x00000096,
+0x00000391,0x00050080,0x00000006,0x00000393,
+0x00000392,0x0000008e,0x0004003d,0x00000011,
+0x00000395,0x00000027,0x0003003e,0x00000394,
+0x00000395,0x0004003d,0x00000006,0x00000397,
+0x00000028,0x0003003e,0x00000396,0x00000397,
+0x0003003e,0x00000398,0x00000393,0x00070039,
+0x00000006,0x00000399,0x00000017,0x00000394,
+0x00000396,0x00000398,0x0003003e,0x00000390,
+0x00000399,0x0004003d,0x00000006,0x0000039b,
+0x00000390,0x0004003d,0x00000056,0x0000039c,
+0x0000038d,0x000600cb,0x00000006,0x0000039d,
+0x0000039b,0x0000039c,0x0000015d,0x0004003d,
+0x00000006,0x0000039e,0x00000390,0x0004003d,
+0x00000056,0x0000039f,0x0000038d,0x00050084,
+0x00000056,0x000003a0,0x000000b9,0x0000039f,
+0x00050080,0x00000056,0x000003a1,0x000003a0,
+0x0000015d,0x000600cb,0x00000006,0x000003a2,
+0x0000039e,0x000003a1,0x000000b9,0x000500c4,
+0x00000006,0x000003a3,0x000003a2,0x0000015d,
+0x000500c5,0x00000006,0x000003a4,0x0000039d,
+0x000003a3,0x0004003d,0x00000006,0x000003a5,
+0x00000390,0x0004003d,0x00000056,0x000003a6,
+0x0000038d,0x00050084,0x00000056,0x000003a7,
+0x0000015d,0x000003a6,0x00050080,0x00000056,
+0x000003a8,0x000003a7,0x000000c8,0x000600cb,
+0x00000006,0x000003a9,0x000003a5,0x000003a8,
+0x000000b9,0x000500c4,0x00000006,0x000003aa,
+0x000003a9,0x000000c8,0x000500c5,0x00000006,
+0x000003ab,0x000003a4,0x000003aa,0x0003003e,
+0x0000039a,0x000003ab,0x0004003d,0x00000006,
+0x000003ad,0x00000390,0x0004003d,0x00000006,
+0x000003ae,0x0000002a,0x0004007c,0x00000056,
+0x000003af,0x000003ae,0x0004003d,0x00000056,
+0x000003b0,0x0000038d,0x00050084,0x00000056,
+0x000003b1,0x000003af,0x000003b0,0x0004003d,
+0x00000006,0x000003b3,0x0000002a,0x0005004d,
+0x00000056,0x000003b4,0x000003b2,0x000003b3,
+0x00050080,0x00000056,0x000003b5,0x000003b1,
+0x000003b4,0x0004003d,0x00000056,0x000003b6,
+0x0000038d,0x000600cb,0x00000006,0x000003b7,
+0x000003ad,0x000003b5,0x000003b6,0x0003003e,
+0x000003ac,0x000003b7,0x0004003d,0x00000006,
+0x000003ee,0x0000039a,0x0003003e,0x000003f0,
+0x000003ed,0x00050041,0x00000007,0x000003f1,
+0x000003f0,0x000003ee,0x0004003d,0x00000006,
+0x000003f2,0x000003f1,0x0003003e,0x000003b8,
+0x000003f2,0x0004003d,0x00000006,0x000003f3,
+0x000003b8,0x0004003d,0x00000006,0x000003f4,
+0x0000002a,0x0004007c,0x00000056,0x000003f5,
+0x000003f4,0x00050084,0x00000056,0x000003f6,
+0x0000015d,0x000003f5,0x000600cb,0x00000006,
+0x000003f7,0x000003f3,0x000003f6,0x0000015d,
+0x0004003d,0x00000006,0x000003f8,0x00000029,
+0x000500c4,0x00000006,0x000003f9,0x000003f7,
+0x000003f8,0x0004003d,0x00000006,0x000003fa,
+0x000003ac,0x000500c5,0x00000006,0x000003fb,
+0x000003f9,0x000003fa,0x000200fe,0x000003fb,
+0x00010038,0x00050036,0x00000006,0x00000032,
+0x00000000,0x0000002d,0x00030037,0x00000012,
+0x0000002e,0x00030037,0x00000009,0x0000002f,
+0x00030037,0x00000007,0x00000030,0x00030037,
+0x00000007,0x00000031,0x000200f8,0x00000033,
+0x0004003b,0x00000007,0x00000404,0x00000007,
+0x0004003b,0x00000007,0x0000040c,0x00000007,
+0x0004003b,0x00000007,0x00000413,0x00000007,
+0x0004003b,0x00000012,0x00000416,0x00000007,
+0x0004003b,0x00000007,0x00000418,0x00000007,
+0x0004003b,0x00000007,0x0000041a,0x00000007,
+0x0004003b,0x00000007,0x0000041c,0x00000007,
+0x0004003b,0x00000434,0x00000435,0x00000007,
+0x0004003b,0x00000007,0x0000043f,0x00000007,
+0x0004003b,0x00000007,0x00000446,0x00000007,
+0x0004003b,0x00000012,0x00000449,0x00000007,
+0x0004003b,0x00000007,0x0000044b,0x00000007,
+0x0004003b,0x00000007,0x0000044d,0x00000007,
+0x0004003b,0x00000007,0x0000044f,0x00000007,
+0x0004003b,0x00000462,0x00000463,0x00000007,
+0x0004003b,0x00000007,0x00000468,0x00000007,
+0x0004003b,0x00000007,0x0000046c,0x00000007,
+0x0004003b,0x00000012,0x0000046d,0x00000007,
+0x0004003b,0x00000007,0x0000046f,0x00000007,
+0x0004003b,0x00000007,0x00000471,0x00000007,
+0x0004003b,0x00000035,0x00000474,0x00000007,
+0x0004003b,0x0000047f,0x00000480,0x00000007,
+0x0004003d,0x00000006,0x000003fe,0x00000031,
+0x0004003d,0x00000006,0x000003ff,0x00000030,
+0x000500ae,0x00000083,0x00000400,0x000003fe,
+0x000003ff,0x000300f7,0x00000402,0x00000000,
+0x000400fa,0x00000400,0x00000401,0x00000402,
+0x000200f8,0x00000401,0x000200fe,0x0000009d,
+0x000200f8,0x00000402,0x00050041,0x00000007,
+0x00000405,0x0000002f,0x00000092,0x0004003d,
+0x00000006,0x00000406,0x00000405,0x0003003e,
+0x00000404,0x00000406,0x00050041,0x00000007,
+0x00000407,0x0000002f,0x0000009d,0x0004003d,
+0x00000006,0x00000408,0x00000407,0x000500aa,
+0x00000083,0x00000409,0x00000408,0x000000a0,
+0x000300f7,0x0000040b,0x00000000,0x000400fa,
+0x00000409,0x0000040a,0x00000439,0x000200f8,
+0x0000040a,0x0004003d,0x00000006,0x0000040d,
+0x00000031,0x00050086,0x00000006,0x0000040e,
+0x0000040d,0x00000095,0x0004003d,0x00000006,
+0x0000040f,0x00000404,0x00050084,0x00000006,
+0x00000410,0x00000095,0x0000040f,0x00050080,
+0x00000006,0x00000411,0x00000410,0x0000008d,
+0x00050084,0x00000006,0x00000412,0x0000040e,
+0x00000411,0x0003003e,0x0000040c,0x00000412,
+0x0004003d,0x00000006,0x00000414,0x00000031,
+0x00050089,0x00000006,0x00000415,0x00000414,
+0x00000095,0x0004003d,0x00000011,0x00000417,
+0x0000002e,0x0003003e,0x00000416,0x00000417,
+0x0004003d,0x00000006,0x00000419,0x0000040c,
+0x0003003e,0x00000418,0x00000419,0x0004003d,
+0x00000006,0x0000041b,0x00000404,0x0003003e,
+0x0000041a,0x0000041b,0x0003003e,0x0000041c,
+0x00000415,0x00080039,0x00000006,0x0000041d,
+0x00000025,0x00000416,0x00000418,0x0000041a,
+0x0000041c,0x0003003e,0x00000413,0x0000041d,
+0x0004003d,0x00000006,0x0000042d,0x00000404,
+0x000500c4,0x00000056,0x0000042e,0x000000c3,
+0x0000042d,0x00050082,0x00000056,0x0000042f,
+0x0000042e,0x000000c3,0x00050084,0x00000056,
+0x00000430,0x0000015d,0x0000042f,0x0004007c,
+0x00000006,0x00000431,0x00000430,0x0004003d,
+0x00000006,0x00000432,0x00000413,0x00050080,
+0x00000006,0x00000433,0x00000431,0x00000432,
+0x0003003e,0x00000435,0x0000042c,0x00050041,
+0x00000007,0x00000436,0x00000435,0x00000433,
+0x0004003d,0x00000006,0x00000437,0x00000436,
+0x000200fe,0x00000437,0x000200f8,0x00000439,
+0x00050041,0x00000007,0x0000043a,0x0000002f,
+0x000000a0,0x0004003d,0x00000006,0x0000043b,
+0x0000043a,0x000500aa,0x00000083,0x0000043c,
+0x0000043b,0x000000a0,0x000300f7,0x0000043e,
+0x00000000,0x000400fa,0x0000043c,0x0000043d,
+0x00000467,0x000200f8,0x0000043d,0x0004003d,
+0x00000006,0x00000440,0x00000031,0x00050086,
+0x00000006,0x00000441,0x00000440,0x00000096,
+0x0004003d,0x00000006,0x00000442,0x00000404,
+0x00050084,0x00000006,0x00000443,0x00000096,
+0x00000442,0x00050080,0x00000006,0x00000444,
+0x00000443,0x0000008e,0x00050084,0x00000006,
+0x00000445,0x00000441,0x00000444,0x0003003e,
+0x0000043f,0x00000445,0x0004003d,0x00000006,
+0x00000447,0x00000031,0x00050089,0x00000006,
+0x00000448,0x00000447,0x00000096,0x0004003d,
+0x00000011,0x0000044a,0x0000002e,0x0003003e,
+0x00000449,0x0000044a,0x0004003d,0x00000006,
+0x0000044c,0x0000043f,0x0003003e,0x0000044b,
+0x0000044c,0x0004003d,0x00000006,0x0000044e,
+0x00000404,0x0003003e,0x0000044d,0x0000044e,
+0x0003003e,0x0000044f,0x00000448,0x00080039,
+0x00000006,0x00000450,0x0000002b,0x00000449,
+0x0000044b,0x0000044d,0x0000044f,0x0003003e,
+0x00000446,0x00000450,0x0004003d,0x00000006,
+0x0000045b,0x00000404,0x000500c4,0x00000056,
+0x0000045c,0x000000c3,0x0000045b,0x00050082,
+0x00000056,0x0000045d,0x0000045c,0x000000c3,
+0x00050084,0x00000056,0x0000045e,0x000000c8,
+0x0000045d,0x0004007c,0x00000006,0x0000045f,
+0x0000045e,0x0004003d,0x00000006,0x00000460,
+0x00000446,0x00050080,0x00000006,0x00000461,
+0x0000045f,0x00000460,0x0003003e,0x00000463,
+0x0000045a,0x00050041,0x00000007,0x00000464,
+0x00000463,0x00000461,0x0004003d,0x00000006,
+0x00000465,0x00000464,0x000200fe,0x00000465,
+0x000200f8,0x00000467,0x0004003d,0x00000006,
+0x00000469,0x00000031,0x0004003d,0x00000006,
+0x0000046a,0x00000404,0x00050084,0x00000006,
+0x0000046b,0x00000469,0x0000046a,0x0003003e,
+0x00000468,0x0000046b,0x0004003d,0x00000011,
+0x0000046e,0x0000002e,0x0003003e,0x0000046d,
+0x0000046e,0x0004003d,0x00000006,0x00000470,
+0x00000468,0x0003003e,0x0000046f,0x00000470,
+0x0004003d,0x00000006,0x00000472,0x00000404,
+0x0003003e,0x00000471,0x00000472,0x00070039,
+0x00000006,0x00000473,0x00000017,0x0000046d,
+0x0000046f,0x00000471,0x0003003e,0x0000046c,
+0x00000473,0x0004003d,0x00000006,0x0000047d,
+0x00000404,0x00050082,0x00000006,0x0000047e,
+0x0000047d,0x000000a0,0x0003003e,0x00000480,
+0x0000047c,0x00050041,0x00000035,0x00000481,
+0x00000480,0x0000047e,0x0004003d,0x00000034,
+0x00000482,0x00000481,0x0003003e,0x00000474,
+0x00000482,0x0004003d,0x00000006,0x00000483,
+0x0000046c,0x00050041,0x00000007,0x00000484,
+0x00000474,0x0000009d,0x0004003d,0x00000006,
+0x00000485,0x00000484,0x00050084,0x00000006,
+0x00000486,0x00000483,0x00000485,0x0004003d,
+0x00000006,0x00000487,0x0000046c,0x00050041,
+0x00000007,0x00000488,0x00000474,0x000000a0,
+0x0004003d,0x00000006,0x00000489,0x00000488,
+0x000500c2,0x00000006,0x0000048a,0x00000487,
+0x00000489,0x000500c5,0x00000006,0x0000048b,
+0x00000486,0x0000048a,0x0003003e,0x0000046c,
+0x0000048b,0x0004003d,0x00000006,0x0000048c,
+0x0000046c,0x000500ac,0x00000083,0x0000048d,
+0x0000048c,0x0000019f,0x000300f7,0x0000048f,
+0x00000000,0x000400fa,0x0000048d,0x0000048e,
+0x0000048f,0x000200f8,0x0000048e,0x0004003d,
+0x00000006,0x00000490,0x0000046c,0x00050080,
+0x00000006,0x00000491,0x00000490,0x000000a0,
+0x0003003e,0x0000046c,0x00000491,0x000200f9,
+0x0000048f,0x000200f8,0x0000048f,0x0004003d,
+0x00000006,0x00000492,0x0000046c,0x000200fe,
+0x00000492,0x000200f8,0x0000043e,0x000100ff,
+0x000200f8,0x0000040b,0x000100ff,0x00010038,
+0x00050036,0x00000006,0x0000003f,0x00000000,
+0x00000036,0x00030037,0x00000012,0x00000037,
+0x00030037,0x00000009,0x00000038,0x00030037,
+0x00000007,0x00000039,0x00030037,0x00000007,
+0x0000003a,0x00030037,0x00000007,0x0000003b,
+0x00030037,0x00000007,0x0000003c,0x00030037,
+0x00000007,0x0000003d,0x00030037,0x00000035,
+0x0000003e,0x000200f8,0x00000040,0x0004003b,
+0x00000012,0x00000495,0x00000007,0x0004003b,
+0x00000012,0x000004a3,0x00000007,0x0004003b,
+0x00000012,0x000004a4,0x00000007,0x0004003b,
+0x00000009,0x000004a6,0x00000007,0x0004003b,
+0x00000007,0x000004a8,0x00000007,0x0004003b,
+0x00000007,0x000004aa,0x00000007,0x0004003b,
+0x00000012,0x000004ae,0x00000007,0x0004003b,
+0x00000009,0x000004b0,0x00000007,0x0004003b,
+0x00000007,0x000004b2,0x00000007,0x0004003b,
+0x00000007,0x000004b4,0x00000007,0x0004003b,
+0x00000012,0x000004b8,0x00000007,0x0004003b,
+0x00000009,0x000004ba,0x00000007,0x0004003b,
+0x00000007,0x000004bc,0x00000007,0x0004003b,
+0x00000007,0x000004be,0x00000007,0x0004003b,
+0x00000012,0x000004c2,0x00000007,0x0004003b,
+0x00000009,0x000004c4,0x00000007,0x0004003b,
+0x00000007,0x000004c6,0x00000007,0x0004003b,
+0x00000007,0x000004c8,0x00000007,0x0004003b,
+0x00000007,0x000004cd,0x00000007,0x0004003b,
+0x00000012,0x000004d5,0x00000007,0x0004003d,
+0x00000006,0x00000496,0x0000003c,0x0004003d,
+0x00000006,0x00000497,0x0000003a,0x00070050,
+0x00000011,0x00000498,0x00000497,0x00000497,
+0x00000497,0x00000497,0x0004003d,0x00000006,
+0x00000499,0x0000003b,0x0004003d,0x00000006,
+0x0000049a,0x0000003b,0x00050080,0x00000006,
+0x0000049b,0x0000049a,0x000000a0,0x00070050,
+0x00000011,0x0000049c,0x0000009d,0x000000a0,
+0x00000499,0x0000049b,0x00050080,0x00000011,
+0x0000049d,0x00000498,0x0000049c,0x00070050,
+0x00000011,0x0000049e,0x00000496,0x00000496,
+0x00000496,0x00000496,0x00050084,0x00000011,
+0x0000049f,0x0000049e,0x0000049d,0x0004003d,
+0x00000006,0x000004a0,0x0000003d,0x00070050,
+0x00000011,0x000004a1,0x000004a0,0x000004a0,
+0x000004a0,0x000004a0,0x00050080,0x00000011,
+0x000004a2,0x0000049f,0x000004a1,0x0003003e,
+0x00000495,0x000004a2,0x0004003d,0x00000011,
+0x000004a5,0x00000037,0x0003003e,0x000004a4,
+0x000004a5,0x0004003d,0x00000008,0x000004a7,
+0x00000038,0x0003003e,0x000004a6,0x000004a7,
+0x0004003d,0x00000006,0x000004a9,0x00000039,
+0x0003003e,0x000004a8,0x000004a9,0x00050041,
+0x00000007,0x000004ab,0x00000495,0x0000009d,
+0x0004003d,0x00000006,0x000004ac,0x000004ab,
+0x0003003e,0x000004aa,0x000004ac,0x00080039,
+0x00000006,0x000004ad,0x00000032,0x000004a4,
+0x000004a6,0x000004a8,0x000004aa,0x0004003d,
+0x00000011,0x000004af,0x00000037,0x0003003e,
+0x000004ae,0x000004af,0x0004003d,0x00000008,
+0x000004b1,0x00000038,0x0003003e,0x000004b0,
+0x000004b1,0x0004003d,0x00000006,0x000004b3,
+0x00000039,0x0003003e,0x000004b2,0x000004b3,
+0x00050041,0x00000007,0x000004b5,0x00000495,
+0x000000a0,0x0004003d,0x00000006,0x000004b6,
+0x000004b5,0x0003003e,0x000004b4,0x000004b6,
+0x00080039,0x00000006,0x000004b7,0x00000032,
+0x000004ae,0x000004b0,0x000004b2,0x000004b4,
+0x0004003d,0x00000011,0x000004b9,0x00000037,
+0x0003003e,0x000004b8,0x000004b9,0x0004003d,
+0x00000008,0x000004bb,0x00000038,0x0003003e,
+0x000004ba,0x000004bb,0x0004003d,0x00000006,
+0x000004bd,0x00000039,0x0003003e,0x000004bc,
+0x000004bd,0x00050041,0x00000007,0x000004bf,
+0x00000495,0x00000092,0x0004003d,0x00000006,
+0x000004c0,0x000004bf,0x0003003e,0x000004be,
+0x000004c0,0x00080039,0x00000006,0x000004c1,
+0x00000032,0x000004b8,0x000004ba,0x000004bc,
+0x000004be,0x0004003d,0x00000011,0x000004c3,
+0x00000037,0x0003003e,0x000004c2,0x000004c3,
+0x0004003d,0x00000008,0x000004c5,0x00000038,
+0x0003003e,0x000004c4,0x000004c5,0x0004003d,
+0x00000006,0x000004c7,0x00000039,0x0003003e,
+0x000004c6,0x000004c7,0x00050041,0x00000007,
+0x000004c9,0x00000495,0x00000096,0x0004003d,
+0x00000006,0x000004ca,0x000004c9,0x0003003e,
+0x000004c8,0x000004ca,0x00080039,0x00000006,
+0x000004cb,0x00000032,0x000004c2,0x000004c4,
+0x000004c6,0x000004c8,0x00070050,0x00000011,
+0x000004cc,0x000004ad,0x000004b7,0x000004c1,
+0x000004cb,0x0003003e,0x000004a3,0x000004cc,
+0x00050041,0x00000007,0x000004ce,0x0000003e,
+0x0000009d,0x0004003d,0x00000006,0x000004cf,
+0x000004ce,0x00050041,0x00000007,0x000004d0,
+0x0000003e,0x000000a0,0x0004003d,0x00000006,
+0x000004d1,0x000004d0,0x00050084,0x00000006,
+0x000004d2,0x000004cf,0x000004d1,0x00050080,
+0x00000006,0x000004d3,0x000004d2,0x0000008d,
+0x000500c2,0x00000006,0x000004d4,0x000004d3,
+0x000000c2,0x0003003e,0x000004cd,0x000004d4,
+0x00050041,0x00000007,0x000004d6,0x0000003e,
+0x0000009d,0x0004003d,0x00000006,0x000004d7,
+0x000004d6,0x00050082,0x00000006,0x000004d8,
+0x0000014c,0x000004d7,0x00050041,0x00000007,
+0x000004d9,0x0000003e,0x000000a0,0x0004003d,
+0x00000006,0x000004da,0x000004d9,0x00050082,
+0x00000006,0x000004db,0x000004d8,0x000004da,
+0x0004003d,0x00000006,0x000004dc,0x000004cd,
+0x00050080,0x00000006,0x000004dd,0x000004db,
+0x000004dc,0x00050041,0x00000007,0x000004de,
+0x0000003e,0x0000009d,0x0004003d,0x00000006,
+0x000004df,0x000004de,0x0004003d,0x00000006,
+0x000004e0,0x000004cd,0x00050082,0x00000006,
+0x000004e1,0x000004df,0x000004e0,0x00050041,
+0x00000007,0x000004e2,0x0000003e,0x000000a0,
+0x0004003d,0x00000006,0x000004e3,0x000004e2,
+0x0004003d,0x00000006,0x000004e4,0x000004cd,
+0x00050082,0x00000006,0x000004e5,0x000004e3,
+0x000004e4,0x0004003d,0x00000006,0x000004e6,
+0x000004cd,0x00070050,0x00000011,0x000004e7,
+0x000004dd,0x000004e1,0x000004e5,0x000004e6,
+0x0003003e,0x000004d5,0x000004e7,0x0004003d,
+0x00000011,0x000004e8,0x000004a3,0x00040070,
+0x000004ea,0x000004eb,0x000004e8,0x0004003d,
+0x00000011,0x000004ec,0x000004d5,0x00040070,
+0x000004ea,0x000004ed,0x000004ec,0x00050094,
+0x000004e9,0x000004ee,0x000004eb,0x000004ed,
+0x00050081,0x000004e9,0x000004f0,0x000004ee,
+0x000004ef,0x0004006d,0x00000006,0x000004f1,
+0x000004f0,0x000500c2,0x00000006,0x000004f2,
+0x000004f1,0x000000c2,0x000200fe,0x000004f2,
+0x00010038,0x00050036,0x00000034,0x00000044,
+0x00000000,0x00000041,0x00030037,0x00000012,
+0x00000042,0x00030037,0x00000034,0x00000043,
+0x000200f8,0x00000045,0x0004003b,0x00000035,
+0x000004f5,0x00000007,0x0004003b,0x00000035,
+0x00000502,0x00000007,0x0004003b,0x00000035,
+0x00000505,0x00000007,0x0004003b,0x00000035,
+0x00000511,0x00000007,0x0004003b,0x00000035,
+0x00000515,0x00000007,0x0004003b,0x00000007,
+0x0000051a,0x00000007,0x0004003b,0x00000007,
+0x0000051d,0x00000007,0x0004003b,0x00000035,
+0x00000525,0x00000007,0x0004003b,0x00000012,
+0x0000052b,0x00000007,0x0004003b,0x00000009,
+0x0000052d,0x00000007,0x0004003b,0x00000007,
+0x0000052f,0x00000007,0x0004003b,0x00000007,
+0x00000531,0x00000007,0x0004003b,0x00000007,
+0x00000533,0x00000007,0x0004003b,0x00000007,
+0x00000535,0x00000007,0x0004003b,0x00000007,
+0x00000536,0x00000007,0x0004003b,0x00000035,
+0x00000537,0x00000007,0x0004003b,0x00000012,
+0x0000053e,0x00000007,0x0004003b,0x00000009,
+0x00000540,0x00000007,0x0004003b,0x00000007,
+0x00000542,0x00000007,0x0004003b,0x00000007,
+0x00000544,0x00000007,0x0004003b,0x00000007,
+0x00000546,0x00000007,0x0004003b,0x00000007,
+0x00000548,0x00000007,0x0004003b,0x00000007,
+0x00000549,0x00000007,0x0004003b,0x00000035,
+0x0000054a,0x00000007,0x00050041,0x00000141,
+0x000004f7,0x00000140,0x000000b8,0x0004003d,
+0x00000034,0x000004f8,0x000004f7,0x00050050,
+0x00000034,0x000004f9,0x00000092,0x00000092,
+0x00050086,0x00000034,0x000004fa,0x000004f8,
+0x000004f9,0x00050050,0x00000034,0x000004fb,
+0x000004f6,0x000004f6,0x00050080,0x00000034,
+0x000004fc,0x000004fb,0x000004fa,0x00050041,
+0x00000141,0x000004fd,0x00000140,0x000000b8,
+0x0004003d,0x00000034,0x000004fe,0x000004fd,
+0x00050050,0x00000034,0x000004ff,0x000000a0,
+0x000000a0,0x00050082,0x00000034,0x00000500,
+0x000004fe,0x000004ff,0x00050086,0x00000034,
+0x00000501,0x000004fc,0x00000500,0x0003003e,
+0x000004f5,0x00000501,0x0004003d,0x00000034,
+0x00000503,0x000004f5,0x00050084,0x00000034,
+0x00000504,0x00000043,0x00000503,0x0003003e,
+0x00000502,0x00000504,0x0004003d,0x00000034,
+0x00000506,0x00000502,0x0004003d,0x00000034,
+0x00000507,0x000000ea,0x00050050,0x00000034,
+0x00000508,0x000000a0,0x000000a0,0x00050082,
+0x00000034,0x00000509,0x00000507,0x00000508,
+0x00050084,0x00000034,0x0000050a,0x00000506,
+0x00000509,0x00050050,0x00000034,0x0000050b,
+0x0000019f,0x0000019f,0x00050080,0x00000034,
+0x0000050c,0x0000050a,0x0000050b,0x00050050,
+0x0000050e,0x0000050f,0x0000050d,0x0000050d,
+0x000500c2,0x00000034,0x00000510,0x0000050c,
+0x0000050f,0x0003003e,0x00000505,0x00000510,
+0x0004003d,0x00000034,0x00000512,0x00000505,
+0x00050050,0x0000050e,0x00000513,0x000000c2,
+0x000000c2,0x000500c2,0x00000034,0x00000514,
+0x00000512,0x00000513,0x0003003e,0x00000511,
+0x00000514,0x0004003d,0x00000034,0x00000516,
+0x00000505,0x00050050,0x00000034,0x00000518,
+0x00000517,0x00000517,0x000500c7,0x00000034,
+0x00000519,0x00000516,0x00000518,0x0003003e,
+0x00000515,0x00000519,0x00050041,0x000000aa,
+0x0000051b,0x000000ea,0x0000009d,0x0004003d,
+0x00000006,0x0000051c,0x0000051b,0x0003003e,
+0x0000051a,0x0000051c,0x00050041,0x00000007,
+0x0000051e,0x00000511,0x000000a0,0x0004003d,
+0x00000006,0x0000051f,0x0000051e,0x0004003d,
+0x00000006,0x00000520,0x0000051a,0x00050084,
+0x00000006,0x00000521,0x0000051f,0x00000520,
+0x00050041,0x00000007,0x00000522,0x00000511,
+0x0000009d,0x0004003d,0x00000006,0x00000523,
+0x00000522,0x00050080,0x00000006,0x00000524,
+0x00000521,0x00000523,0x0003003e,0x0000051d,
+0x00000524,0x0003003e,0x00000525,0x00000526,
+0x0004003d,0x00000083,0x00000527,0x000000d4,
+0x000600a9,0x00000056,0x00000528,0x00000527,
+0x000000c3,0x000000b8,0x000500c4,0x00000056,
+0x00000529,0x000000c3,0x00000528,0x0004007c,
+0x00000006,0x0000052a,0x00000529,0x0004003d,
+0x00000011,0x0000052c,0x00000042,0x0003003e,
+0x0000052b,0x0000052c,0x0004003d,0x00000008,
+0x0000052e,0x0000014b,0x0003003e,0x0000052d,
+0x0000052e,0x0004003d,0x00000006,0x00000530,
+0x00000165,0x0003003e,0x0000052f,0x00000530,
+0x0004003d,0x00000006,0x00000532,0x0000051d,
+0x0003003e,0x00000531,0x00000532,0x0004003d,
+0x00000006,0x00000534,0x0000051a,0x0003003e,
+0x00000533,0x00000534,0x0003003e,0x00000535,
+0x0000052a,0x0003003e,0x00000536,0x0000009d,
+0x0004003d,0x00000034,0x00000538,0x00000515,
+0x0003003e,0x00000537,0x00000538,0x000c0039,
+0x00000006,0x00000539,0x0000003f,0x0000052b,
+0x0000052d,0x0000052f,0x00000531,0x00000533,
+0x00000535,0x00000536,0x00000537,0x00050041,
+0x00000007,0x0000053a,0x00000525,0x0000009d,
+0x0003003e,0x0000053a,0x00000539,0x0004003d,
+0x00000083,0x0000053b,0x000000d4,0x000300f7,
+0x0000053d,0x00000000,0x000400fa,0x0000053b,
+0x0000053c,0x0000053d,0x000200f8,0x0000053c,
+0x0004003d,0x00000011,0x0000053f,0x00000042,
+0x0003003e,0x0000053e,0x0000053f,0x0004003d,
+0x00000008,0x00000541,0x0000014b,0x0003003e,
+0x00000540,0x00000541,0x0004003d,0x00000006,
+0x00000543,0x00000165,0x0003003e,0x00000542,
+0x00000543,0x0004003d,0x00000006,0x00000545,
+0x0000051d,0x0003003e,0x00000544,0x00000545,
+0x0004003d,0x00000006,0x00000547,0x0000051a,
+0x0003003e,0x00000546,0x00000547,0x0003003e,
+0x00000548,0x00000092,0x0003003e,0x00000549,
+0x000000a0,0x0004003d,0x00000034,0x0000054b,
+0x00000515,0x0003003e,0x0000054a,0x0000054b,
+0x000c0039,0x00000006,0x0000054c,0x0000003f,
+0x0000053e,0x00000540,0x00000542,0x00000544,
+0x00000546,0x00000548,0x00000549,0x0000054a,
+0x00050041,0x00000007,0x0000054d,0x00000525,
+0x000000a0,0x0003003e,0x0000054d,0x0000054c,
+0x000200f9,0x0000053d,0x000200f8,0x0000053d,
+0x0004003d,0x00000034,0x0000054e,0x00000525,
+0x000200fe,0x0000054e,0x00010038,0x00050036,
+0x00000006,0x00000048,0x00000000,0x00000046,
+0x00030037,0x00000007,0x00000047,0x000200f8,
+0x00000049,0x0004003d,0x00000006,0x00000551,
+0x00000047,0x000500c2,0x00000006,0x00000553,
+0x00000551,0x00000552,0x0004003d,0x00000006,
+0x00000554,0x00000047,0x000500c6,0x00000006,
+0x00000555,0x00000554,0x00000553,0x0003003e,
+0x00000047,0x00000555,0x0004003d,0x00000006,
+0x00000556,0x00000047,0x000500c4,0x00000006,
+0x00000558,0x00000556,0x00000557,0x0004003d,
+0x00000006,0x00000559,0x00000047,0x00050082,
+0x00000006,0x0000055a,0x00000559,0x00000558,
+0x0003003e,0x00000047,0x0000055a,0x0004003d,
+0x00000006,0x0000055b,0x00000047,0x000500c4,
+0x00000006,0x0000055c,0x0000055b,0x000000cd,
+0x0004003d,0x00000006,0x0000055d,0x00000047,
+0x00050080,0x00000006,0x0000055e,0x0000055d,
+0x0000055c,0x0003003e,0x00000047,0x0000055e,
+0x0004003d,0x00000006,0x0000055f,0x00000047,
+0x000500c4,0x00000006,0x00000560,0x0000055f,
+0x000000c2,0x0004003d,0x00000006,0x00000561,
+0x00000047,0x00050080,0x00000006,0x00000562,
+0x00000561,0x00000560,0x0003003e,0x00000047,
+0x00000562,0x0004003d,0x00000006,0x00000563,
+0x00000047,0x000500c2,0x00000006,0x00000564,
+0x00000563,0x000000c8,0x0004003d,0x00000006,
+0x00000565,0x00000047,0x000500c6,0x00000006,
+0x00000566,0x00000565,0x00000564,0x0003003e,
+0x00000047,0x00000566,0x0004003d,0x00000006,
+0x00000567,0x00000047,0x000500c4,0x00000006,
+0x00000569,0x00000567,0x00000568,0x0004003d,
+0x00000006,0x0000056a,0x00000047,0x00050080,
+0x00000006,0x0000056b,0x0000056a,0x00000569,
+0x0003003e,0x00000047,0x0000056b,0x0004003d,
+0x00000006,0x0000056c,0x00000047,0x000500c2,
+0x00000006,0x0000056d,0x0000056c,0x000000cd,
+0x0004003d,0x00000006,0x0000056e,0x00000047,
+0x000500c6,0x00000006,0x0000056f,0x0000056e,
+0x0000056d,0x0003003e,0x00000047,0x0000056f,
+0x0004003d,0x00000006,0x00000570,0x00000047,
+0x000500c2,0x00000006,0x00000571,0x00000570,
+0x0000015d,0x0004003d,0x00000006,0x00000572,
+0x00000047,0x000500c6,0x00000006,0x00000573,
+0x00000572,0x00000571,0x0003003e,0x00000047,
+0x00000573,0x0004003d,0x00000006,0x00000574,
+0x00000047,0x000500c4,0x00000006,0x00000575,
+0x00000574,0x0000050d,0x0004003d,0x00000006,
+0x00000576,0x00000047,0x000500c6,0x00000006,
+0x00000577,0x00000576,0x00000575,0x0003003e,
+0x00000047,0x00000577,0x0004003d,0x00000006,
+0x00000578,0x00000047,0x000500c2,0x00000006,
+0x00000579,0x00000578,0x00000557,0x0004003d,
+0x00000006,0x0000057a,0x00000047,0x000500c6,
+0x00000006,0x0000057b,0x0000057a,0x00000579,
+0x0003003e,0x00000047,0x0000057b,0x0004003d,
+0x00000006,0x0000057c,0x00000047,0x000200fe,
+0x0000057c,0x00010038,0x00050036,0x00000006,
+0x0000004e,0x00000000,0x0000004a,0x00030037,
+0x00000007,0x0000004b,0x00030037,0x00000035,
+0x0000004c,0x00030037,0x00000007,0x0000004d,
+0x000200f8,0x0000004f,0x0004003b,0x00000007,
+0x00000592,0x00000007,0x0004003b,0x00000007,
+0x00000593,0x00000007,0x0004003b,0x00000012,
+0x00000596,0x00000007,0x0004003b,0x00000012,
+0x000005a2,0x00000007,0x0004003b,0x00000035,
+0x000005b5,0x00000007,0x0004003b,0x00000012,
+0x000005c0,0x00000007,0x0004003b,0x00000012,
+0x000005c4,0x00000007,0x0004003b,0x00000012,
+0x000005d3,0x00000007,0x0004003d,0x00000006,
+0x0000057f,0x0000004d,0x000500aa,0x00000083,
+0x00000580,0x0000057f,0x000000a0,0x000300f7,
+0x00000582,0x00000000,0x000400fa,0x00000580,
+0x00000581,0x00000582,0x000200f8,0x00000581,
+0x000200fe,0x0000009d,0x000200f8,0x00000582,
+0x00050041,0x00000584,0x00000585,0x00000140,
+0x000000b9,0x0004003d,0x00000006,0x00000586,
+0x00000585,0x000500ab,0x00000083,0x00000587,
+0x00000586,0x0000009d,0x000300f7,0x00000589,
+0x00000000,0x000400fa,0x00000587,0x00000588,
+0x00000589,0x000200f8,0x00000588,0x0004003d,
+0x00000034,0x0000058a,0x0000004c,0x00050050,
+0x0000050e,0x0000058b,0x000000c3,0x000000c3,
+0x000500c4,0x00000034,0x0000058c,0x0000058a,
+0x0000058b,0x0003003e,0x0000004c,0x0000058c,
+0x000200f9,0x00000589,0x000200f8,0x00000589,
+0x0004003d,0x00000006,0x0000058d,0x0000004d,
+0x00050084,0x00000006,0x0000058e,0x000004f6,
+0x0000058d,0x0004003d,0x00000006,0x0000058f,
+0x0000004b,0x00050082,0x00000006,0x00000590,
+0x0000058f,0x000004f6,0x00050080,0x00000006,
+0x00000591,0x0000058e,0x00000590,0x0003003e,
+0x0000004b,0x00000591,0x0004003d,0x00000006,
+0x00000594,0x0000004b,0x0003003e,0x00000593,
+0x00000594,0x00050039,0x00000006,0x00000595,
+0x00000048,0x00000593,0x0003003e,0x00000592,
+0x00000595,0x0004003d,0x00000006,0x00000597,
+0x00000592,0x000600cb,0x00000006,0x00000598,
+0x00000597,0x000000b8,0x000000c2,0x0004003d,
+0x00000006,0x00000599,0x00000592,0x000600cb,
+0x00000006,0x0000059a,0x00000599,0x000000c2,
+0x000000c2,0x0004003d,0x00000006,0x0000059b,
+0x00000592,0x000600cb,0x00000006,0x0000059d,
+0x0000059b,0x0000059c,0x000000c2,0x0004003d,
+0x00000006,0x0000059e,0x00000592,0x000600cb,
+0x00000006,0x000005a0,0x0000059e,0x0000059f,
+0x000000c2,0x00070050,0x00000011,0x000005a1,
+0x00000598,0x0000059a,0x0000059d,0x000005a0,
+0x0003003e,0x00000596,0x000005a1,0x0004003d,
+0x00000006,0x000005a3,0x00000592,0x000600cb,
+0x00000006,0x000005a4,0x000005a3,0x00000568,
+0x000000c2,0x0004003d,0x00000006,0x000005a5,
+0x00000592,0x000600cb,0x00000006,0x000005a7,
+0x000005a5,0x000005a6,0x000000c2,0x0004003d,
+0x00000006,0x000005a8,0x00000592,0x000600cb,
+0x00000006,0x000005aa,0x000005a8,0x000005a9,
+0x000000c2,0x0004003d,0x00000006,0x000005ab,
+0x00000592,0x000600cb,0x00000006,0x000005ad,
+0x000005ab,0x000005ac,0x000000c2,0x00070050,
+0x00000011,0x000005ae,0x000005a4,0x000005a7,
+0x000005aa,0x000005ad,0x0003003e,0x000005a2,
+0x000005ae,0x0004003d,0x00000011,0x000005af,
+0x00000596,0x0004003d,0x00000011,0x000005b0,
+0x00000596,0x00050084,0x00000011,0x000005b1,
+0x000005af,0x000005b0,0x0003003e,0x00000596,
+0x000005b1,0x0004003d,0x00000011,0x000005b2,
+0x000005a2,0x0004003d,0x00000011,0x000005b3,
+0x000005a2,0x00050084,0x00000011,0x000005b4,
+0x000005b2,0x000005b3,0x0003003e,0x000005a2,
+0x000005b4,0x0004003d,0x00000006,0x000005b6,
+0x0000004b,0x000500c7,0x00000006,0x000005b7,
+0x000005b6,0x00000092,0x000500ab,0x00000083,
+0x000005b8,0x000005b7,0x0000009d,0x000600a9,
+0x00000056,0x000005b9,0x000005b8,0x000000c2,
+0x000000c8,0x0004007c,0x00000006,0x000005ba,
+0x000005b9,0x0004003d,0x00000006,0x000005bb,
+0x0000004d,0x000500aa,0x00000083,0x000005bc,
+0x000005bb,0x00000096,0x000600a9,0x00000056,
+0x000005bd,0x000005bc,0x0000050d,0x000000c8,
+0x0004007c,0x00000006,0x000005be,0x000005bd,
+0x00050050,0x00000034,0x000005bf,0x000005ba,
+0x000005be,0x0003003e,0x000005b5,0x000005bf,
+0x0004003d,0x00000006,0x000005c1,0x0000004b,
+0x000500c7,0x00000006,0x000005c2,0x000005c1,
+0x000000a0,0x000500ab,0x00000083,0x000005c3,
+0x000005c2,0x0000009d,0x000300f7,0x000005c6,
+0x00000000,0x000400fa,0x000005c3,0x000005c5,
+0x000005c9,0x000200f8,0x000005c5,0x0004003d,
+0x00000034,0x000005c7,0x000005b5,0x0009004f,
+0x00000011,0x000005c8,0x000005c7,0x000005c7,
+0x00000000,0x00000001,0x00000000,0x00000001,
+0x0003003e,0x000005c4,0x000005c8,0x000200f9,
+0x000005c6,0x000200f8,0x000005c9,0x0004003d,
+0x00000034,0x000005ca,0x000005b5,0x0009004f,
+0x00000011,0x000005cb,0x000005ca,0x000005ca,
+0x00000001,0x00000000,0x00000001,0x00000000,
+0x0003003e,0x000005c4,0x000005cb,0x000200f9,
+0x000005c6,0x000200f8,0x000005c6,0x0004003d,
+0x00000011,0x000005cc,0x000005c4,0x0003003e,
+0x000005c0,0x000005cc,0x0004003d,0x00000011,
+0x000005cd,0x000005c0,0x0004003d,0x00000011,
+0x000005ce,0x00000596,0x000500c2,0x00000011,
+0x000005cf,0x000005ce,0x000005cd,0x0003003e,
+0x00000596,0x000005cf,0x0004003d,0x00000011,
+0x000005d0,0x000005c0,0x0004003d,0x00000011,
+0x000005d1,0x000005a2,0x000500c2,0x00000011,
+0x000005d2,0x000005d1,0x000005d0,0x0003003e,
+0x000005a2,0x000005d2,0x0004003d,0x00000011,
+0x000005d4,0x00000596,0x0007004f,0x00000034,
+0x000005d5,0x000005d4,0x000005d4,0x00000000,
+0x00000001,0x00040070,0x000005d6,0x000005d7,
+0x000005d5,0x0004003d,0x00000034,0x000005d8,
+0x0000004c,0x00040070,0x000005d6,0x000005d9,
+0x000005d8,0x00050094,0x000004e9,0x000005da,
+0x000005d7,0x000005d9,0x0004006d,0x00000006,
+0x000005db,0x000005da,0x0004003d,0x00000011,
+0x000005dc,0x00000596,0x0007004f,0x00000034,
+0x000005dd,0x000005dc,0x000005dc,0x00000002,
+0x00000003,0x00040070,0x000005d6,0x000005de,
+0x000005dd,0x0004003d,0x00000034,0x000005df,
+0x0000004c,0x00040070,0x000005d6,0x000005e0,
+0x000005df,0x00050094,0x000004e9,0x000005e1,
+0x000005de,0x000005e0,0x0004006d,0x00000006,
+0x000005e2,0x000005e1,0x0004003d,0x00000011,
+0x000005e3,0x000005a2,0x0007004f,0x00000034,
+0x000005e4,0x000005e3,0x000005e3,0x00000000,
+0x00000001,0x00040070,0x000005d6,0x000005e5,
+0x000005e4,0x0004003d,0x00000034,0x000005e6,
+0x0000004c,0x00040070,0x000005d6,0x000005e7,
+0x000005e6,0x00050094,0x000004e9,0x000005e8,
+0x000005e5,0x000005e7,0x0004006d,0x00000006,
+0x000005e9,0x000005e8,0x0004003d,0x00000011,
+0x000005ea,0x000005a2,0x0007004f,0x00000034,
+0x000005eb,0x000005ea,0x000005ea,0x00000002,
+0x00000003,0x00040070,0x000005d6,0x000005ec,
+0x000005eb,0x0004003d,0x00000034,0x000005ed,
+0x0000004c,0x00040070,0x000005d6,0x000005ee,
+0x000005ed,0x00050094,0x000004e9,0x000005ef,
+0x000005ec,0x000005ee,0x0004006d,0x00000006,
+0x000005f0,0x000005ef,0x00070050,0x00000011,
+0x000005f1,0x000005db,0x000005e2,0x000005e9,
+0x000005f0,0x0004003d,0x00000006,0x000005f2,
+0x00000592,0x00070050,0x00000011,0x000005f3,
+0x000005f2,0x000005f2,0x000005f2,0x000005f2,
+0x000500c2,0x00000011,0x000005f5,0x000005f3,
+0x000005f4,0x00050080,0x00000011,0x000005f6,
+0x000005f1,0x000005f5,0x0003003e,0x000005d3,
+0x000005f6,0x0004003d,0x00000011,0x000005f8,
+0x000005d3,0x000500c7,0x00000011,0x000005f9,
+0x000005f8,0x000005f7,0x0003003e,0x000005d3,
+0x000005f9,0x0004003d,0x00000006,0x000005fa,
+0x0000004d,0x000500aa,0x00000083,0x000005fb,
+0x000005fa,0x00000092,0x000300f7,0x000005fd,
+0x00000000,0x000400fa,0x000005fb,0x000005fc,
+0x00000602,0x000200f8,0x000005fc,0x00050041,
+0x00000007,0x000005fe,0x000005d3,0x00000092,
+0x00050051,0x00000006,0x000005ff,0x00000526,
+0x00000000,0x0003003e,0x000005fe,0x000005ff,
+0x00050041,0x00000007,0x00000600,0x000005d3,
+0x00000096,0x00050051,0x00000006,0x00000601,
+0x00000526,0x00000001,0x0003003e,0x00000600,
+0x00000601,0x000200f9,0x000005fd,0x000200f8,
+0x00000602,0x0004003d,0x00000006,0x00000603,
+0x0000004d,0x000500aa,0x00000083,0x00000604,
+0x00000603,0x00000096,0x000300f7,0x00000606,
+0x00000000,0x000400fa,0x00000604,0x00000605,
+0x00000606,0x000200f8,0x00000605,0x00050041,
+0x00000007,0x00000607,0x000005d3,0x00000096,
+0x0003003e,0x00000607,0x0000009d,0x000200f9,
+0x00000606,0x000200f8,0x00000606,0x000200f9,
+0x000005fd,0x000200f8,0x000005fd,0x00050041,
+0x00000007,0x00000608,0x000005d3,0x0000009d,
+0x0004003d,0x00000006,0x00000609,0x00000608,
+0x00060050,0x00000008,0x0000060a,0x00000609,
+0x00000609,0x00000609,0x0004003d,0x00000011,
+0x0000060b,0x000005d3,0x0008004f,0x00000008,
+0x0000060c,0x0000060b,0x0000060b,0x00000001,
+0x00000002,0x00000003,0x000500ae,0x0000060d,
+0x0000060e,0x0000060a,0x0000060c,0x0004009b,
+0x00000083,0x0000060f,0x0000060e,0x000300f7,
+0x00000611,0x00000000,0x000400fa,0x0000060f,
+0x00000610,0x00000613,0x000200f8,0x00000610,
+0x000200fe,0x0000009d,0x000200f8,0x00000613,
+0x00050041,0x00000007,0x00000614,0x000005d3,
+0x000000a0,0x0004003d,0x00000006,0x00000615,
+0x00000614,0x00050050,0x00000034,0x00000616,
+0x00000615,0x00000615,0x0004003d,0x00000011,
+0x00000617,0x000005d3,0x0007004f,0x00000034,
+0x00000618,0x00000617,0x00000617,0x00000002,
+0x00000003,0x000500ae,0x00000144,0x00000619,
+0x00000616,0x00000618,0x0004009b,0x00000083,
+0x0000061a,0x00000619,0x000300f7,0x0000061c,
+0x00000000,0x000400fa,0x0000061a,0x0000061b,
+0x0000061e,0x000200f8,0x0000061b,0x000200fe,
+0x000000a0,0x000200f8,0x0000061e,0x00050041,
+0x00000007,0x0000061f,0x000005d3,0x00000092,
+0x0004003d,0x00000006,0x00000620,0x0000061f,
+0x00050041,0x00000007,0x00000621,0x000005d3,
+0x00000096,0x0004003d,0x00000006,0x00000622,
+0x00000621,0x000500ae,0x00000083,0x00000623,
+0x00000620,0x00000622,0x000300f7,0x00000625,
+0x00000000,0x000400fa,0x00000623,0x00000624,
+0x00000627,0x000200f8,0x00000624,0x000200fe,
+0x00000092,0x000200f8,0x00000627,0x000200fe,
+0x00000096,0x000200f8,0x00000625,0x000100ff,
+0x000200f8,0x0000061c,0x000100ff,0x000200f8,
+0x00000611,0x000100ff,0x00010038,0x00050036,
+0x00000008,0x00000054,0x00000000,0x00000050,
+0x00030037,0x00000007,0x00000051,0x00030037,
+0x00000007,0x00000052,0x00030037,0x00000007,
+0x00000053,0x000200f8,0x00000055,0x0004003b,
+0x00000007,0x0000062a,0x00000007,0x0004003b,
+0x00000009,0x00000632,0x00000007,0x0004003b,
+0x0000063f,0x00000640,0x00000007,0x0004003b,
+0x00000007,0x00000643,0x00000007,0x0004003b,
+0x00000009,0x00000645,0x00000007,0x0003003e,
+0x0000062a,0x0000009d,0x000200f9,0x0000062b,
+0x000200f8,0x0000062b,0x000400f6,0x0000062d,
+0x0000062e,0x00000000,0x000200f9,0x0000062f,
+0x000200f8,0x0000062f,0x0004003d,0x00000006,
+0x00000630,0x0000062a,0x000500b0,0x00000083,
+0x00000631,0x00000630,0x000003bb,0x000400fa,
+0x00000631,0x0000062c,0x0000062d,0x000200f8,
+0x0000062c,0x0004003d,0x00000006,0x0000063e,
+0x0000062a,0x0003003e,0x00000640,0x0000063d,
+0x00050041,0x00000009,0x00000641,0x00000640,
+0x0000063e,0x0004003d,0x00000008,0x00000642,
+0x00000641,0x0003003e,0x00000632,0x00000642,
+0x0004003d,0x00000006,0x00000644,0x00000052,
+0x0003003e,0x00000643,0x00000644,0x0004003d,
+0x00000008,0x00000646,0x00000632,0x0003003e,
+0x00000645,0x00000646,0x00060039,0x00000006,
+0x00000647,0x0000000d,0x00000643,0x00000645,
+0x0003003e,0x00000053,0x00000647,0x0004003d,
+0x00000006,0x00000648,0x00000053,0x0004003d,
+0x00000006,0x00000649,0x00000051,0x000500b2,
+0x00000083,0x0000064a,0x00000648,0x00000649,
+0x000300f7,0x0000064c,0x00000000,0x000400fa,
+0x0000064a,0x0000064b,0x0000064c,0x000200f8,
+0x0000064b,0x0004003d,0x00000008,0x0000064d,
+0x00000632,0x000200fe,0x0000064d,0x000200f8,
+0x0000064c,0x000200f9,0x0000062e,0x000200f8,
+0x0000062e,0x0004003d,0x00000006,0x0000064f,
+0x0000062a,0x00050080,0x00000006,0x00000650,
+0x0000064f,0x000000c3,0x0003003e,0x0000062a,
+0x00000650,0x000200f9,0x0000062b,0x000200f8,
+0x0000062d,0x000200fe,0x0000014e,0x00010038,
+0x00050036,0x00000057,0x0000005b,0x00000000,
+0x00000059,0x00030037,0x00000058,0x0000005a,
+0x000200f8,0x0000005c,0x00050041,0x0000024b,
+0x00000653,0x0000005a,0x0000009d,0x0004003d,
+0x00000056,0x00000654,0x00000653,0x00050041,
+0x0000024b,0x00000655,0x0000005a,0x00000092,
+0x0004003d,0x00000056,0x00000656,0x00000655,
+0x00050080,0x00000056,0x00000657,0x00000654,
+0x00000656,0x000500c3,0x00000056,0x00000658,
+0x00000657,0x000000c3,0x00050041,0x0000024b,
+0x00000659,0x0000005a,0x000000a0,0x0004003d,
+0x00000056,0x0000065a,0x00000659,0x00050041,
+0x0000024b,0x0000065b,0x0000005a,0x00000092,
+0x0004003d,0x00000056,0x0000065c,0x0000065b,
+0x00050080,0x00000056,0x0000065d,0x0000065a,
+0x0000065c,0x000500c3,0x00000056,0x0000065e,
+0x0000065d,0x000000c3,0x0004003d,0x00000057,
+0x0000065f,0x0000005a,0x0007004f,0x0000050e,
+0x00000660,0x0000065f,0x0000065f,0x00000002,
+0x00000003,0x00050051,0x00000056,0x00000661,
+0x00000660,0x00000000,0x00050051,0x00000056,
+0x00000662,0x00000660,0x00000001,0x00070050,
+0x00000057,0x00000663,0x00000658,0x0000065e,
+0x00000661,0x00000662,0x000200fe,0x00000663,
+0x00010038,0x00050036,0x00000056,0x00000061,
+0x00000000,0x0000005f,0x00030037,0x0000005e,
+0x00000060,0x000200f8,0x00000062,0x00050041,
+0x0000024b,0x00000666,0x00000060,0x0000009d,
+0x0004003d,0x00000056,0x00000667,0x00000666,
+0x00050041,0x0000024b,0x00000668,0x00000060,
+0x000000a0,0x0004003d,0x00000056,0x00000669,
+0x00000668,0x00050080,0x00000056,0x0000066a,
+0x00000667,0x00000669,0x00050041,0x0000024b,
+0x0000066b,0x00000060,0x00000092,0x0004003d,
+0x00000056,0x0000066c,0x0000066b,0x00050080,
+0x00000056,0x0000066d,0x0000066a,0x0000066c,
+0x000200fe,0x0000066d,0x00010038,0x00050036,
+0x00000002,0x00000066,0x00000000,0x00000063,
+0x00030037,0x00000058,0x00000064,0x00030037,
+0x00000058,0x00000065,0x000200f8,0x00000067,
+0x0004003d,0x00000057,0x00000670,0x00000065,
+0x00070050,0x00000057,0x00000671,0x000000c3,
+0x000000c3,0x000000c3,0x000000c3,0x000500c3,
+0x00000057,0x00000672,0x00000670,0x00000671,
+0x0003003e,0x00000065,0x00000672,0x0004003d,
+0x00000057,0x00000673,0x00000064,0x00070050,
+0x00000057,0x00000675,0x00000674,0x00000674,
+0x00000674,0x00000674,0x000500c7,0x00000057,
+0x00000676,0x00000673,0x00000675,0x0004003d,
+0x00000057,0x00000677,0x00000065,0x000500c5,
+0x00000057,0x00000678,0x00000677,0x00000676,
+0x0003003e,0x00000065,0x00000678,0x0004003d,
+0x00000057,0x00000679,0x00000064,0x00070050,
+0x00000057,0x0000067a,0x000000c3,0x000000c3,
+0x000000c3,0x000000c3,0x000500c3,0x00000057,
+0x0000067b,0x00000679,0x0000067a,0x0003003e,
+0x00000064,0x0000067b,0x0004003d,0x00000057,
+0x0000067d,0x00000064,0x00070050,0x00000057,
+0x0000067e,0x0000067c,0x0000067c,0x0000067c,
+0x0000067c,0x000500c7,0x00000057,0x0000067f,
+0x0000067d,0x0000067e,0x0003003e,0x00000064,
+0x0000067f,0x0004003d,0x00000057,0x00000680,
+0x00000064,0x000600ca,0x00000057,0x00000681,
+0x00000680,0x000000b8,0x0000050d,0x0003003e,
+0x00000064,0x00000681,0x000100fd,0x00010038,
+0x00050036,0x00000002,0x0000006e,0x00000000,
+0x00000068,0x00030037,0x00000058,0x00000069,
+0x00030037,0x00000058,0x0000006a,0x00030037,
+0x00000007,0x0000006b,0x00030037,0x00000012,
+0x0000006c,0x00030037,0x00000012,0x0000006d,
+0x000200f8,0x0000006f,0x0004003b,0x0000024b,
+0x0000069f,0x00000007,0x0004003b,0x0000024b,
+0x000006a8,0x00000007,0x0004003b,0x00000058,
+0x000006c6,0x00000007,0x0004003b,0x00000058,
+0x000006c8,0x00000007,0x0004003b,0x0000005e,
+0x00000715,0x00000007,0x0004003b,0x0000005e,
+0x00000719,0x00000007,0x0004003b,0x00000058,
+0x00000725,0x00000007,0x0004003b,0x00000058,
+0x00000729,0x00000007,0x0004003b,0x00000058,
+0x00000731,0x00000007,0x0004003b,0x00000058,
+0x00000733,0x00000007,0x0004003b,0x0000005e,
+0x00000738,0x00000007,0x0004003b,0x00000058,
+0x0000074f,0x00000007,0x0004003b,0x00000058,
+0x00000755,0x00000007,0x0004003d,0x00000006,
+0x00000682,0x0000006b,0x000300f7,0x0000068e,
+0x00000000,0x001700fb,0x00000682,0x0000068d,
+0x00000000,0x00000683,0x00000001,0x00000684,
+0x00000004,0x00000685,0x00000005,0x00000686,
+0x00000006,0x00000687,0x0000000a,0x00000688,
+0x00000008,0x00000689,0x0000000c,0x0000068a,
+0x00000009,0x0000068b,0x0000000d,0x0000068c,
+0x000200f8,0x0000068d,0x0003003e,0x0000006c,
+0x0000075d,0x0003003e,0x0000006d,0x0000075d,
+0x000200f9,0x0000068e,0x000200f8,0x00000683,
+0x0004003d,0x00000057,0x0000068f,0x00000069,
+0x0008004f,0x0000005d,0x00000690,0x0000068f,
+0x0000068f,0x00000000,0x00000000,0x00000000,
+0x0004007c,0x00000008,0x00000691,0x00000690,
+0x00050051,0x00000006,0x00000693,0x00000691,
+0x00000000,0x00050051,0x00000006,0x00000694,
+0x00000691,0x00000001,0x00050051,0x00000006,
+0x00000695,0x00000691,0x00000002,0x00070050,
+0x00000011,0x00000696,0x00000693,0x00000694,
+0x00000695,0x00000692,0x0003003e,0x0000006c,
+0x00000696,0x0004003d,0x00000057,0x00000697,
+0x0000006a,0x0008004f,0x0000005d,0x00000698,
+0x00000697,0x00000697,0x00000000,0x00000000,
+0x00000000,0x0004007c,0x00000008,0x00000699,
+0x00000698,0x00050051,0x00000006,0x0000069a,
+0x00000699,0x00000000,0x00050051,0x00000006,
+0x0000069b,0x00000699,0x00000001,0x00050051,
+0x00000006,0x0000069c,0x00000699,0x00000002,
+0x00070050,0x00000011,0x0000069d,0x0000069a,
+0x0000069b,0x0000069c,0x00000692,0x0003003e,
+0x0000006d,0x0000069d,0x000100fd,0x000200f8,
+0x00000684,0x00050041,0x0000024b,0x000006a0,
+0x00000069,0x0000009d,0x0004003d,0x00000056,
+0x000006a1,0x000006a0,0x000500c3,0x00000056,
+0x000006a2,0x000006a1,0x000000b9,0x00050041,
+0x0000024b,0x000006a3,0x0000006a,0x0000009d,
+0x0004003d,0x00000056,0x000006a4,0x000006a3,
+0x000500c7,0x00000056,0x000006a6,0x000006a4,
+0x000006a5,0x000500c5,0x00000056,0x000006a7,
+0x000006a2,0x000006a6,0x0003003e,0x0000069f,
+0x000006a7,0x0004003d,0x00000056,0x000006a9,
+0x0000069f,0x00050041,0x0000024b,0x000006aa,
+0x0000006a,0x0000009d,0x0004003d,0x00000056,
+0x000006ab,0x000006aa,0x000500c7,0x00000056,
+0x000006ac,0x000006ab,0x0000067c,0x00050080,
+0x00000056,0x000006ad,0x000006a9,0x000006ac,
+0x0007000c,0x00000056,0x000006af,0x00000001,
+0x00000027,0x000006ad,0x000006ae,0x0003003e,
+0x000006a8,0x000006af,0x0004003d,0x00000056,
+0x000006b0,0x0000069f,0x0004007c,0x00000006,
+0x000006b1,0x000006b0,0x00060050,0x00000008,
+0x000006b2,0x000006b1,0x000006b1,0x000006b1,
+0x00050051,0x00000006,0x000006b3,0x000006b2,
+0x00000000,0x00050051,0x00000006,0x000006b4,
+0x000006b2,0x00000001,0x00050051,0x00000006,
+0x000006b5,0x000006b2,0x00000002,0x00070050,
+0x00000011,0x000006b6,0x000006b3,0x000006b4,
+0x000006b5,0x00000692,0x0003003e,0x0000006c,
+0x000006b6,0x0004003d,0x00000056,0x000006b7,
+0x000006a8,0x0004007c,0x00000006,0x000006b8,
+0x000006b7,0x00060050,0x00000008,0x000006b9,
+0x000006b8,0x000006b8,0x000006b8,0x00050051,
+0x00000006,0x000006ba,0x000006b9,0x00000000,
+0x00050051,0x00000006,0x000006bb,0x000006b9,
+0x00000001,0x00050051,0x00000006,0x000006bc,
+0x000006b9,0x00000002,0x00070050,0x00000011,
+0x000006bd,0x000006ba,0x000006bb,0x000006bc,
+0x00000692,0x0003003e,0x0000006d,0x000006bd,
+0x000100fd,0x000200f8,0x00000685,0x0004003d,
+0x00000057,0x000006bf,0x00000069,0x0009004f,
+0x00000057,0x000006c0,0x000006bf,0x000006bf,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x0004007c,0x00000011,0x000006c1,0x000006c0,
+0x0003003e,0x0000006c,0x000006c1,0x0004003d,
+0x00000057,0x000006c2,0x0000006a,0x0009004f,
+0x00000057,0x000006c3,0x000006c2,0x000006c2,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x0004007c,0x00000011,0x000006c4,0x000006c3,
+0x0003003e,0x0000006d,0x000006c4,0x000100fd,
+0x000200f8,0x00000686,0x0004003d,0x00000057,
+0x000006c7,0x0000006a,0x0003003e,0x000006c6,
+0x000006c7,0x0004003d,0x00000057,0x000006c9,
+0x00000069,0x0003003e,0x000006c8,0x000006c9,
+0x00060039,0x00000002,0x000006ca,0x00000066,
+0x000006c6,0x000006c8,0x0004003d,0x00000057,
+0x000006cb,0x000006c6,0x0003003e,0x0000006a,
+0x000006cb,0x0004003d,0x00000057,0x000006cc,
+0x000006c8,0x0003003e,0x00000069,0x000006cc,
+0x0004003d,0x00000057,0x000006cd,0x00000069,
+0x0009004f,0x00000057,0x000006ce,0x000006cd,
+0x000006cd,0x00000000,0x00000000,0x00000000,
+0x00000001,0x00070050,0x00000057,0x000006cf,
+0x000000b8,0x000000b8,0x000000b8,0x000000b8,
+0x00070050,0x00000057,0x000006d0,0x000006ae,
+0x000006ae,0x000006ae,0x000006ae,0x0008000c,
+0x00000057,0x000006d1,0x00000001,0x0000002d,
+0x000006ce,0x000006cf,0x000006d0,0x0004007c,
+0x00000011,0x000006d2,0x000006d1,0x0003003e,
+0x0000006c,0x000006d2,0x0004003d,0x00000057,
+0x000006d3,0x00000069,0x0009004f,0x00000057,
+0x000006d4,0x000006d3,0x000006d3,0x00000000,
+0x00000000,0x00000000,0x00000001,0x0004003d,
+0x00000057,0x000006d5,0x0000006a,0x0009004f,
+0x00000057,0x000006d6,0x000006d5,0x000006d5,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x00050080,0x00000057,0x000006d7,0x000006d4,
+0x000006d6,0x00070050,0x00000057,0x000006d8,
+0x000000b8,0x000000b8,0x000000b8,0x000000b8,
+0x00070050,0x00000057,0x000006d9,0x000006ae,
+0x000006ae,0x000006ae,0x000006ae,0x0008000c,
+0x00000057,0x000006da,0x00000001,0x0000002d,
+0x000006d7,0x000006d8,0x000006d9,0x0004007c,
+0x00000011,0x000006db,0x000006da,0x0003003e,
+0x0000006d,0x000006db,0x000100fd,0x000200f8,
+0x00000687,0x00050041,0x0000024b,0x000006dd,
+0x00000069,0x0000009d,0x0004003d,0x00000056,
+0x000006de,0x000006dd,0x0004007c,0x00000006,
+0x000006df,0x000006de,0x00050041,0x0000024b,
+0x000006e0,0x0000006a,0x0000009d,0x0004003d,
+0x00000056,0x000006e1,0x000006e0,0x0004007c,
+0x00000006,0x000006e2,0x000006e1,0x00050041,
+0x0000024b,0x000006e3,0x00000069,0x000000a0,
+0x0004003d,0x00000056,0x000006e4,0x000006e3,
+0x0004007c,0x00000006,0x000006e5,0x000006e4,
+0x00070050,0x00000011,0x000006e6,0x000006df,
+0x000006e2,0x000006e5,0x00000692,0x0003003e,
+0x0000006d,0x000006e6,0x0004003d,0x00000011,
+0x000006e7,0x0000006d,0x0008004f,0x00000008,
+0x000006e8,0x000006e7,0x000006e7,0x00000000,
+0x00000001,0x00000002,0x00050041,0x0000024b,
+0x000006e9,0x0000006a,0x000000a0,0x0004003d,
+0x00000056,0x000006ea,0x000006e9,0x0004007c,
+0x00000006,0x000006eb,0x000006ea,0x00060050,
+0x00000008,0x000006ec,0x000006eb,0x000006eb,
+0x000006eb,0x00050084,0x00000008,0x000006ed,
+0x000006e8,0x000006ec,0x00060050,0x0000005d,
+0x000006ee,0x0000059c,0x0000059c,0x0000059c,
+0x000500c2,0x00000008,0x000006ef,0x000006ed,
+0x000006ee,0x00050051,0x00000006,0x000006f0,
+0x000006ef,0x00000000,0x00050051,0x00000006,
+0x000006f1,0x000006ef,0x00000001,0x00050051,
+0x00000006,0x000006f2,0x000006ef,0x00000002,
+0x00070050,0x00000011,0x000006f3,0x000006f0,
+0x000006f1,0x000006f2,0x00000692,0x0003003e,
+0x0000006c,0x000006f3,0x000100fd,0x000200f8,
+0x00000688,0x00050041,0x0000024b,0x000006f5,
+0x00000069,0x0000009d,0x0004003d,0x00000056,
+0x000006f6,0x000006f5,0x0004007c,0x00000006,
+0x000006f7,0x000006f6,0x00050041,0x0000024b,
+0x000006f8,0x0000006a,0x0000009d,0x0004003d,
+0x00000056,0x000006f9,0x000006f8,0x0004007c,
+0x00000006,0x000006fa,0x000006f9,0x00050041,
+0x0000024b,0x000006fb,0x00000069,0x000000a0,
+0x0004003d,0x00000056,0x000006fc,0x000006fb,
+0x0004007c,0x00000006,0x000006fd,0x000006fc,
+0x00050041,0x0000024b,0x000006fe,0x0000006a,
+0x00000092,0x0004003d,0x00000056,0x000006ff,
+0x000006fe,0x0004007c,0x00000006,0x00000700,
+0x000006ff,0x00070050,0x00000011,0x00000701,
+0x000006f7,0x000006fa,0x000006fd,0x00000700,
+0x0003003e,0x0000006d,0x00000701,0x0004003d,
+0x00000011,0x00000702,0x0000006d,0x0008004f,
+0x00000008,0x00000703,0x00000702,0x00000702,
+0x00000000,0x00000001,0x00000002,0x00050041,
+0x0000024b,0x00000704,0x0000006a,0x000000a0,
+0x0004003d,0x00000056,0x00000705,0x00000704,
+0x0004007c,0x00000006,0x00000706,0x00000705,
+0x00060050,0x00000008,0x00000707,0x00000706,
+0x00000706,0x00000706,0x00050084,0x00000008,
+0x00000708,0x00000703,0x00000707,0x00060050,
+0x0000005d,0x00000709,0x0000059c,0x0000059c,
+0x0000059c,0x000500c2,0x00000008,0x0000070a,
+0x00000708,0x00000709,0x00050041,0x0000024b,
+0x0000070b,0x00000069,0x00000092,0x0004003d,
+0x00000056,0x0000070c,0x0000070b,0x0004007c,
+0x00000006,0x0000070d,0x0000070c,0x00050051,
+0x00000006,0x0000070e,0x0000070a,0x00000000,
+0x00050051,0x00000006,0x0000070f,0x0000070a,
+0x00000001,0x00050051,0x00000006,0x00000710,
+0x0000070a,0x00000002,0x00070050,0x00000011,
+0x00000711,0x0000070e,0x0000070f,0x00000710,
+0x0000070d,0x0003003e,0x0000006c,0x00000711,
+0x000100fd,0x000200f8,0x00000689,0x00050041,
+0x0000024b,0x00000713,0x00000069,0x00000096,
+0x0003003e,0x00000713,0x000006ae,0x00050041,
+0x0000024b,0x00000714,0x0000006a,0x00000096,
+0x0003003e,0x00000714,0x000006ae,0x000200f9,
+0x0000068a,0x000200f8,0x0000068a,0x0004003d,
+0x00000057,0x00000716,0x0000006a,0x0008004f,
+0x0000005d,0x00000717,0x00000716,0x00000716,
+0x00000000,0x00000001,0x00000002,0x0003003e,
+0x00000715,0x00000717,0x00050039,0x00000056,
+0x00000718,0x00000061,0x00000715,0x0004003d,
+0x00000057,0x0000071a,0x00000069,0x0008004f,
+0x0000005d,0x0000071b,0x0000071a,0x0000071a,
+0x00000000,0x00000001,0x00000002,0x0003003e,
+0x00000719,0x0000071b,0x00050039,0x00000056,
+0x0000071c,0x00000061,0x00000719,0x000500af,
+0x00000083,0x0000071d,0x00000718,0x0000071c,
+0x000300f7,0x0000071f,0x00000000,0x000400fa,
+0x0000071d,0x0000071e,0x00000724,0x000200f8,
+0x0000071e,0x0004003d,0x00000057,0x00000720,
+0x00000069,0x0004007c,0x00000011,0x00000721,
+0x00000720,0x0003003e,0x0000006c,0x00000721,
+0x0004003d,0x00000057,0x00000722,0x0000006a,
+0x0004007c,0x00000011,0x00000723,0x00000722,
+0x0003003e,0x0000006d,0x00000723,0x000200f9,
+0x0000071f,0x000200f8,0x00000724,0x0004003d,
+0x00000057,0x00000726,0x0000006a,0x0003003e,
+0x00000725,0x00000726,0x00050039,0x00000057,
+0x00000727,0x0000005b,0x00000725,0x0004007c,
+0x00000011,0x00000728,0x00000727,0x0003003e,
+0x0000006c,0x00000728,0x0004003d,0x00000057,
+0x0000072a,0x00000069,0x0003003e,0x00000729,
+0x0000072a,0x00050039,0x00000057,0x0000072b,
+0x0000005b,0x00000729,0x0004007c,0x00000011,
+0x0000072c,0x0000072b,0x0003003e,0x0000006d,
+0x0000072c,0x000200f9,0x0000071f,0x000200f8,
+0x0000071f,0x000100fd,0x000200f8,0x0000068b,
+0x00050041,0x0000024b,0x0000072e,0x00000069,
+0x00000096,0x0003003e,0x0000072e,0x000006ae,
+0x00050041,0x0000024b,0x00000730,0x0000006a,
+0x00000096,0x0003003e,0x00000730,0x0000072f,
+0x000200f9,0x0000068c,0x000200f8,0x0000068c,
+0x0004003d,0x00000057,0x00000732,0x0000006a,
+0x0003003e,0x00000731,0x00000732,0x0004003d,
+0x00000057,0x00000734,0x00000069,0x0003003e,
+0x00000733,0x00000734,0x00060039,0x00000002,
+0x00000735,0x00000066,0x00000731,0x00000733,
+0x0004003d,0x00000057,0x00000736,0x00000731,
+0x0003003e,0x0000006a,0x00000736,0x0004003d,
+0x00000057,0x00000737,0x00000733,0x0003003e,
+0x00000069,0x00000737,0x0004003d,0x00000057,
+0x00000739,0x0000006a,0x0008004f,0x0000005d,
+0x0000073a,0x00000739,0x00000739,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x00000738,
+0x0000073a,0x00050039,0x00000056,0x0000073b,
+0x00000061,0x00000738,0x000500af,0x00000083,
+0x0000073c,0x0000073b,0x000000b8,0x000300f7,
+0x0000073e,0x00000000,0x000400fa,0x0000073c,
+0x0000073d,0x0000074b,0x000200f8,0x0000073d,
+0x0004003d,0x00000057,0x0000073f,0x00000069,
+0x00070050,0x00000057,0x00000740,0x000000b8,
+0x000000b8,0x000000b8,0x000000b8,0x00070050,
+0x00000057,0x00000741,0x000006ae,0x000006ae,
+0x000006ae,0x000006ae,0x0008000c,0x00000057,
+0x00000742,0x00000001,0x0000002d,0x0000073f,
+0x00000740,0x00000741,0x0004007c,0x00000011,
+0x00000743,0x00000742,0x0003003e,0x0000006c,
+0x00000743,0x0004003d,0x00000057,0x00000744,
+0x00000069,0x0004003d,0x00000057,0x00000745,
+0x0000006a,0x00050080,0x00000057,0x00000746,
+0x00000744,0x00000745,0x00070050,0x00000057,
+0x00000747,0x000000b8,0x000000b8,0x000000b8,
+0x000000b8,0x00070050,0x00000057,0x00000748,
+0x000006ae,0x000006ae,0x000006ae,0x000006ae,
+0x0008000c,0x00000057,0x00000749,0x00000001,
+0x0000002d,0x00000746,0x00000747,0x00000748,
+0x0004007c,0x00000011,0x0000074a,0x00000749,
+0x0003003e,0x0000006d,0x0000074a,0x000200f9,
+0x0000073e,0x000200f8,0x0000074b,0x0004003d,
+0x00000057,0x0000074c,0x00000069,0x0004003d,
+0x00000057,0x0000074d,0x0000006a,0x00050080,
+0x00000057,0x0000074e,0x0000074c,0x0000074d,
+0x0003003e,0x0000074f,0x0000074e,0x00050039,
+0x00000057,0x00000750,0x0000005b,0x0000074f,
+0x00070050,0x00000057,0x00000751,0x000000b8,
+0x000000b8,0x000000b8,0x000000b8,0x00070050,
+0x00000057,0x00000752,0x000006ae,0x000006ae,
+0x000006ae,0x000006ae,0x0008000c,0x00000057,
+0x00000753,0x00000001,0x0000002d,0x00000750,
+0x00000751,0x00000752,0x0004007c,0x00000011,
+0x00000754,0x00000753,0x0003003e,0x0000006c,
+0x00000754,0x0004003d,0x00000057,0x00000756,
+0x00000069,0x0003003e,0x00000755,0x00000756,
+0x00050039,0x00000057,0x00000757,0x0000005b,
+0x00000755,0x00070050,0x00000057,0x00000758,
+0x000000b8,0x000000b8,0x000000b8,0x000000b8,
+0x00070050,0x00000057,0x00000759,0x000006ae,
+0x000006ae,0x000006ae,0x000006ae,0x0008000c,
+0x00000057,0x0000075a,0x00000001,0x0000002d,
+0x00000757,0x00000758,0x00000759,0x0004007c,
+0x00000011,0x0000075b,0x0000075a,0x0003003e,
+0x0000006d,0x0000075b,0x000200f9,0x0000073e,
+0x000200f8,0x0000073e,0x000100fd,0x000200f8,
+0x0000068e,0x000100fd,0x00010038,0x00050036,
+0x00000006,0x00000075,0x00000000,0x00000070,
+0x00030037,0x00000012,0x00000071,0x00030037,
+0x00000007,0x00000072,0x00030037,0x00000007,
+0x00000073,0x00030037,0x00000009,0x00000074,
+0x000200f8,0x00000076,0x0004003b,0x00000007,
+0x0000075f,0x00000007,0x0004003b,0x00000007,
+0x00000767,0x00000007,0x0004003b,0x00000007,
+0x00000770,0x00000007,0x0004003b,0x00000012,
+0x00000773,0x00000007,0x0004003b,0x00000007,
+0x00000775,0x00000007,0x0004003b,0x00000007,
+0x00000777,0x00000007,0x0004003b,0x00000007,
+0x00000779,0x00000007,0x0004003b,0x000007e0,
+0x000007e1,0x00000007,0x0004003b,0x00000007,
+0x000007eb,0x00000007,0x0004003b,0x00000007,
+0x000007f4,0x00000007,0x0004003b,0x00000012,
+0x000007f7,0x00000007,0x0004003b,0x00000007,
+0x000007f9,0x00000007,0x0004003b,0x00000007,
+0x000007fb,0x00000007,0x0004003b,0x00000007,
+0x000007fd,0x00000007,0x0004003b,0x0000080e,
+0x0000080f,0x00000007,0x0004003b,0x00000007,
+0x00000814,0x00000007,0x0004003b,0x00000007,
+0x0000081a,0x00000007,0x0004003b,0x00000012,
+0x0000081b,0x00000007,0x0004003b,0x00000007,
+0x0000081d,0x00000007,0x0004003b,0x00000007,
+0x0000081f,0x00000007,0x0004003b,0x00000035,
+0x00000822,0x00000007,0x0004003b,0x0000082e,
+0x0000082f,0x00000007,0x00050041,0x00000007,
+0x00000760,0x00000074,0x00000092,0x0004003d,
+0x00000006,0x00000761,0x00000760,0x0003003e,
+0x0000075f,0x00000761,0x00050041,0x00000007,
+0x00000762,0x00000074,0x0000009d,0x0004003d,
+0x00000006,0x00000763,0x00000762,0x000500aa,
+0x00000083,0x00000764,0x00000763,0x000000a0,
+0x000300f7,0x00000766,0x00000000,0x000400fa,
+0x00000764,0x00000765,0x000007e5,0x000200f8,
+0x00000765,0x0004003d,0x00000006,0x00000768,
+0x00000073,0x00050086,0x00000006,0x00000769,
+0x00000768,0x00000095,0x0004003d,0x00000006,
+0x0000076a,0x0000075f,0x00050084,0x00000006,
+0x0000076b,0x00000095,0x0000076a,0x00050080,
+0x00000006,0x0000076c,0x0000076b,0x0000008d,
+0x00050084,0x00000006,0x0000076d,0x00000769,
+0x0000076c,0x0004003d,0x00000006,0x0000076e,
+0x00000072,0x00050080,0x00000006,0x0000076f,
+0x0000076d,0x0000076e,0x0003003e,0x00000767,
+0x0000076f,0x0004003d,0x00000006,0x00000771,
+0x00000073,0x00050089,0x00000006,0x00000772,
+0x00000771,0x00000095,0x0004003d,0x00000011,
+0x00000774,0x00000071,0x0003003e,0x00000773,
+0x00000774,0x0004003d,0x00000006,0x00000776,
+0x00000767,0x0003003e,0x00000775,0x00000776,
+0x0004003d,0x00000006,0x00000778,0x0000075f,
+0x0003003e,0x00000777,0x00000778,0x0003003e,
+0x00000779,0x00000772,0x00080039,0x00000006,
+0x0000077a,0x00000025,0x00000773,0x00000775,
+0x00000777,0x00000779,0x0003003e,0x00000770,
+0x0000077a,0x0004003d,0x00000006,0x000007d9,
+0x0000075f,0x000500c4,0x00000056,0x000007da,
+0x000000c3,0x000007d9,0x00050082,0x00000056,
+0x000007db,0x000007da,0x000000c3,0x00050084,
+0x00000056,0x000007dc,0x0000015d,0x000007db,
+0x0004007c,0x00000006,0x000007dd,0x000007dc,
+0x0004003d,0x00000006,0x000007de,0x00000770,
+0x00050080,0x00000006,0x000007df,0x000007dd,
+0x000007de,0x0003003e,0x000007e1,0x000007d8,
+0x00050041,0x00000007,0x000007e2,0x000007e1,
+0x000007df,0x0004003d,0x00000006,0x000007e3,
+0x000007e2,0x000200fe,0x000007e3,0x000200f8,
+0x000007e5,0x00050041,0x00000007,0x000007e6,
+0x00000074,0x000000a0,0x0004003d,0x00000006,
+0x000007e7,0x000007e6,0x000500aa,0x00000083,
+0x000007e8,0x000007e7,0x000000a0,0x000300f7,
+0x000007ea,0x00000000,0x000400fa,0x000007e8,
+0x000007e9,0x00000813,0x000200f8,0x000007e9,
+0x0004003d,0x00000006,0x000007ec,0x00000073,
+0x00050086,0x00000006,0x000007ed,0x000007ec,
+0x00000096,0x0004003d,0x00000006,0x000007ee,
+0x0000075f,0x00050084,0x00000006,0x000007ef,
+0x00000096,0x000007ee,0x00050080,0x00000006,
+0x000007f0,0x000007ef,0x0000008e,0x00050084,
+0x00000006,0x000007f1,0x000007ed,0x000007f0,
+0x0004003d,0x00000006,0x000007f2,0x00000072,
+0x00050080,0x00000006,0x000007f3,0x000007f1,
+0x000007f2,0x0003003e,0x000007eb,0x000007f3,
+0x0004003d,0x00000006,0x000007f5,0x00000073,
+0x00050089,0x00000006,0x000007f6,0x000007f5,
+0x00000096,0x0004003d,0x00000011,0x000007f8,
+0x00000071,0x0003003e,0x000007f7,0x000007f8,
+0x0004003d,0x00000006,0x000007fa,0x000007eb,
+0x0003003e,0x000007f9,0x000007fa,0x0004003d,
+0x00000006,0x000007fc,0x0000075f,0x0003003e,
+0x000007fb,0x000007fc,0x0003003e,0x000007fd,
+0x000007f6,0x00080039,0x00000006,0x000007fe,
+0x0000002b,0x000007f7,0x000007f9,0x000007fb,
+0x000007fd,0x0003003e,0x000007f4,0x000007fe,
+0x0004003d,0x00000006,0x00000807,0x0000075f,
+0x000500c4,0x00000056,0x00000808,0x000000c3,
+0x00000807,0x00050082,0x00000056,0x00000809,
+0x00000808,0x000000c3,0x00050084,0x00000056,
+0x0000080a,0x000000c8,0x00000809,0x0004007c,
+0x00000006,0x0000080b,0x0000080a,0x0004003d,
+0x00000006,0x0000080c,0x000007f4,0x00050080,
+0x00000006,0x0000080d,0x0000080b,0x0000080c,
+0x0003003e,0x0000080f,0x00000806,0x00050041,
+0x00000007,0x00000810,0x0000080f,0x0000080d,
+0x0004003d,0x00000006,0x00000811,0x00000810,
+0x000200fe,0x00000811,0x000200f8,0x00000813,
+0x0004003d,0x00000006,0x00000815,0x00000073,
+0x0004003d,0x00000006,0x00000816,0x0000075f,
+0x00050084,0x00000006,0x00000817,0x00000815,
+0x00000816,0x0004003d,0x00000006,0x00000818,
+0x00000072,0x00050080,0x00000006,0x00000819,
+0x00000817,0x00000818,0x0003003e,0x00000814,
+0x00000819,0x0004003d,0x00000011,0x0000081c,
+0x00000071,0x0003003e,0x0000081b,0x0000081c,
+0x0004003d,0x00000006,0x0000081e,0x00000814,
+0x0003003e,0x0000081d,0x0000081e,0x0004003d,
+0x00000006,0x00000820,0x0000075f,0x0003003e,
+0x0000081f,0x00000820,0x00070039,0x00000006,
+0x00000821,0x00000017,0x0000081b,0x0000081d,
+0x0000081f,0x0003003e,0x0000081a,0x00000821,
+0x0004003d,0x00000006,0x0000082c,0x0000075f,
+0x00050082,0x00000006,0x0000082d,0x0000082c,
+0x000000a0,0x0003003e,0x0000082f,0x0000082b,
+0x00050041,0x00000035,0x00000830,0x0000082f,
+0x0000082d,0x0004003d,0x00000034,0x00000831,
+0x00000830,0x0003003e,0x00000822,0x00000831,
+0x0004003d,0x00000006,0x00000832,0x0000081a,
+0x00050041,0x00000007,0x00000833,0x00000822,
+0x0000009d,0x0004003d,0x00000006,0x00000834,
+0x00000833,0x00050084,0x00000006,0x00000835,
+0x00000832,0x00000834,0x0004003d,0x00000006,
+0x00000836,0x0000081a,0x00050041,0x00000007,
+0x00000837,0x00000822,0x000000a0,0x0004003d,
+0x00000006,0x00000838,0x00000837,0x000500c2,
+0x00000006,0x00000839,0x00000836,0x00000838,
+0x000500c5,0x00000006,0x0000083a,0x00000835,
+0x00000839,0x000200fe,0x0000083a,0x000200f8,
+0x000007ea,0x000100ff,0x000200f8,0x00000766,
+0x000100ff,0x00010038,0x00050036,0x00000011,
+0x00000079,0x00000000,0x00000077,0x00030037,
+0x00000007,0x00000078,0x000200f8,0x0000007a,
+0x0004003b,0x00000058,0x0000083d,0x00000007,
+0x0004003b,0x00000012,0x00000846,0x00000007,
+0x0004003d,0x00000006,0x0000083e,0x00000078,
+0x0004007c,0x00000056,0x0000083f,0x0000083e,
+0x00070050,0x00000057,0x00000844,0x0000083f,
+0x0000083f,0x0000083f,0x0000083f,0x00050082,
+0x00000057,0x00000845,0x00000844,0x00000843,
+0x0003003e,0x0000083d,0x00000845,0x0004003d,
+0x00000057,0x00000848,0x0000083d,0x0008000c,
+0x00000057,0x0000084c,0x00000001,0x0000002d,
+0x00000848,0x00000849,0x0000084b,0x000500c4,
+0x00000011,0x0000084d,0x00000847,0x0000084c,
+0x00070050,0x00000011,0x0000084e,0x000000a0,
+0x000000a0,0x000000a0,0x000000a0,0x00050082,
+0x00000011,0x0000084f,0x0000084d,0x0000084e,
+0x0003003e,0x00000846,0x0000084f,0x0004003d,
+0x00000011,0x00000850,0x00000846,0x0004003d,
+0x00000006,0x00000853,0x00000078,0x00070050,
+0x00000011,0x00000854,0x00000853,0x00000853,
+0x00000853,0x00000853,0x000500ae,0x00000856,
+0x00000857,0x00000854,0x00000855,0x000600a9,
+0x00000011,0x00000858,0x00000857,0x00000852,
+0x00000850,0x000200fe,0x00000858,0x00010038,
+0x00050036,0x00000011,0x0000007d,0x00000000,
+0x0000007b,0x00030037,0x00000034,0x0000007c,
+0x000200f8,0x0000007e,0x0004003b,0x00000012,
+0x00000872,0x00000007,0x0004003b,0x00000007,
+0x00000876,0x00000007,0x0004003b,0x00000035,
+0x0000087a,0x00000007,0x0004003b,0x00000012,
+0x0000087b,0x00000007,0x0004003b,0x00000007,
+0x0000087e,0x00000007,0x0004003b,0x00000007,
+0x0000087f,0x00000007,0x0004003b,0x00000035,
+0x00000881,0x00000007,0x0004003b,0x00000007,
+0x00000882,0x00000007,0x0004003b,0x00000007,
+0x00000885,0x00000007,0x0004003b,0x00000007,
+0x00000886,0x00000007,0x0004003b,0x00000007,
+0x00000887,0x00000007,0x0004003b,0x00000007,
+0x00000888,0x00000007,0x0004003b,0x00000007,
+0x00000889,0x00000007,0x0004003b,0x00000007,
+0x0000088b,0x00000007,0x0004003b,0x00000007,
+0x0000088c,0x00000007,0x0004003b,0x00000007,
+0x0000088d,0x00000007,0x0004003b,0x00000007,
+0x00000897,0x00000007,0x0004003b,0x00000007,
+0x0000089d,0x00000007,0x0004003b,0x00000007,
+0x000008a5,0x00000007,0x0004003b,0x00000009,
+0x000008a9,0x00000007,0x0004003b,0x00000007,
+0x000008aa,0x00000007,0x0004003b,0x00000007,
+0x000008ab,0x00000007,0x0004003b,0x00000007,
+0x000008ad,0x00000007,0x0004003b,0x00000007,
+0x000008af,0x00000007,0x0004003b,0x00000007,
+0x000008b2,0x00000007,0x0004003b,0x00000058,
+0x000008b6,0x00000007,0x0004003b,0x00000058,
+0x000008b7,0x00000007,0x0004003b,0x00000012,
+0x000008b8,0x00000007,0x0004003b,0x00000007,
+0x000008bd,0x00000007,0x0004003b,0x00000007,
+0x000008c0,0x00000007,0x0004003b,0x00000007,
+0x000008c9,0x00000007,0x0004003b,0x00000012,
+0x000008cf,0x00000007,0x0004003b,0x00000007,
+0x000008d1,0x00000007,0x0004003b,0x00000007,
+0x000008d3,0x00000007,0x0004003b,0x00000009,
+0x000008d5,0x00000007,0x0004003b,0x00000012,
+0x000008dd,0x00000007,0x0004003b,0x00000007,
+0x000008df,0x00000007,0x0004003b,0x00000007,
+0x000008e1,0x00000007,0x0004003b,0x00000009,
+0x000008e2,0x00000007,0x0004003b,0x00000012,
+0x000008e9,0x00000007,0x0004003b,0x00000012,
+0x000008ea,0x00000007,0x0004003b,0x00000058,
+0x000008eb,0x00000007,0x0004003b,0x00000058,
+0x000008ed,0x00000007,0x0004003b,0x00000007,
+0x000008ef,0x00000007,0x0004003b,0x00000012,
+0x000008f1,0x00000007,0x0004003b,0x00000012,
+0x000008f2,0x00000007,0x0004003b,0x00000012,
+0x000008f6,0x00000007,0x0004003b,0x00000007,
+0x000008fd,0x00000007,0x0004003b,0x00000012,
+0x000008fe,0x00000007,0x0004003b,0x00000007,
+0x00000900,0x00000007,0x0004003b,0x00000007,
+0x00000902,0x00000007,0x00040039,0x00000002,
+0x0000085b,0x0000000f,0x0004003d,0x00000083,
+0x0000085c,0x00000085,0x000300f7,0x0000085e,
+0x00000000,0x000400fa,0x0000085c,0x0000085d,
+0x0000085e,0x000200f8,0x0000085d,0x000200fe,
+0x0000085f,0x000200f8,0x0000085e,0x0004003d,
+0x00000083,0x00000861,0x000000a7,0x000300f7,
+0x00000863,0x00000000,0x000400fa,0x00000861,
+0x00000862,0x00000863,0x000200f8,0x00000862,
+0x00050041,0x000000aa,0x00000864,0x000000a9,
+0x000000a0,0x0004003d,0x00000006,0x00000865,
+0x00000864,0x000600cb,0x00000006,0x00000866,
+0x00000865,0x0000059c,0x0000059c,0x00050041,
+0x000000aa,0x00000867,0x000000a9,0x000000a0,
+0x0004003d,0x00000006,0x00000868,0x00000867,
+0x000600cb,0x00000006,0x00000869,0x00000868,
+0x000005a9,0x0000059c,0x00050041,0x000000aa,
+0x0000086a,0x000000a9,0x0000009d,0x0004003d,
+0x00000006,0x0000086b,0x0000086a,0x000600cb,
+0x00000006,0x0000086c,0x0000086b,0x0000059c,
+0x0000059c,0x00050041,0x000000aa,0x0000086d,
+0x000000a9,0x0000009d,0x0004003d,0x00000006,
+0x0000086e,0x0000086d,0x000600cb,0x00000006,
+0x0000086f,0x0000086e,0x000005a9,0x0000059c,
+0x00070050,0x00000011,0x00000870,0x00000866,
+0x00000869,0x0000086c,0x0000086f,0x000200fe,
+0x00000870,0x000200f8,0x00000863,0x0004003d,
+0x00000011,0x00000873,0x000000a9,0x0009004f,
+0x00000011,0x00000874,0x00000873,0x00000873,
+0x00000003,0x00000002,0x00000001,0x00000000,
+0x000400cc,0x00000011,0x00000875,0x00000874,
+0x0004003d,0x00000006,0x00000877,0x0000016e,
+0x0003003e,0x00000876,0x00000877,0x00050039,
+0x00000011,0x00000878,0x00000079,0x00000876,
+0x000500c7,0x00000011,0x00000879,0x00000875,
+0x00000878,0x0003003e,0x00000872,0x00000879,
+0x0004003d,0x00000011,0x0000087c,0x00000872,
+0x0003003e,0x0000087b,0x0000087c,0x00060039,
+0x00000034,0x0000087d,0x00000044,0x0000087b,
+0x0000007c,0x0003003e,0x0000087a,0x0000087d,
+0x0004003d,0x00000006,0x00000880,0x0000018c,
+0x0003003e,0x0000087f,0x00000880,0x0003003e,
+0x00000881,0x0000007c,0x0004003d,0x00000006,
+0x00000883,0x00000182,0x0003003e,0x00000882,
+0x00000883,0x00070039,0x00000006,0x00000884,
+0x0000004e,0x0000087f,0x00000881,0x00000882,
+0x0003003e,0x0000087e,0x00000884,0x0003003e,
+0x00000885,0x0000009d,0x0003003e,0x00000886,
+0x0000009d,0x0003003e,0x00000887,0x0000009d,
+0x0004003d,0x00000006,0x0000088a,0x0000087e,
+0x0003003e,0x00000889,0x0000088a,0x00080039,
+0x00000006,0x0000088e,0x0000001e,0x00000889,
+0x0000088b,0x0000088c,0x0000088d,0x0004003d,
+0x00000006,0x0000088f,0x0000088b,0x0003003e,
+0x00000885,0x0000088f,0x0004003d,0x00000006,
+0x00000890,0x0000088c,0x0003003e,0x00000886,
+0x00000890,0x0004003d,0x00000006,0x00000891,
+0x0000088d,0x0003003e,0x00000887,0x00000891,
+0x0003003e,0x00000888,0x0000088e,0x0004003d,
+0x00000006,0x00000892,0x00000886,0x000500ac,
+0x00000083,0x00000893,0x00000892,0x0000029f,
+0x000300f7,0x00000895,0x00000000,0x000400fa,
+0x00000893,0x00000894,0x00000895,0x000200f8,
+0x00000894,0x000200fe,0x0000085f,0x000200f8,
+0x00000895,0x0004003d,0x00000006,0x00000898,
+0x00000182,0x000500aa,0x00000083,0x00000899,
+0x00000898,0x000000a0,0x000600a9,0x00000056,
+0x0000089b,0x00000899,0x00000557,0x0000089a,
+0x0004007c,0x00000006,0x0000089c,0x0000089b,
+0x0003003e,0x00000897,0x0000089c,0x0004003d,
+0x00000083,0x0000089f,0x000000d4,0x000600a9,
+0x00000056,0x000008a0,0x0000089f,0x000000c3,
+0x000000b8,0x00050084,0x00000056,0x000008a1,
+0x0000089e,0x000008a0,0x0004007c,0x00000006,
+0x000008a2,0x000008a1,0x0004003d,0x00000006,
+0x000008a3,0x00000885,0x00050080,0x00000006,
+0x000008a4,0x000008a2,0x000008a3,0x0003003e,
+0x0000089d,0x000008a4,0x0004003d,0x00000006,
+0x000008a6,0x0000089d,0x0004003d,0x00000006,
+0x000008a7,0x00000897,0x00050082,0x00000006,
+0x000008a8,0x000008a6,0x000008a7,0x0003003e,
+0x000008a5,0x000008a8,0x0004003d,0x00000006,
+0x000008ac,0x000008a5,0x0003003e,0x000008ab,
+0x000008ac,0x0004003d,0x00000006,0x000008ae,
+0x00000886,0x0003003e,0x000008ad,0x000008ae,
+0x00070039,0x00000008,0x000008b0,0x00000054,
+0x000008ab,0x000008ad,0x000008af,0x0004003d,
+0x00000006,0x000008b1,0x000008af,0x0003003e,
+0x000008aa,0x000008b1,0x0003003e,0x000008a9,
+0x000008b0,0x0004003d,0x00000006,0x000008b3,
+0x00000888,0x000500c2,0x00000006,0x000008b4,
+0x000008b3,0x000000b9,0x00050080,0x00000006,
+0x000008b5,0x000008b4,0x000000a0,0x0003003e,
+0x000008b2,0x000008b5,0x0003003e,0x000008b6,
+0x00000849,0x0003003e,0x000008b7,0x00000849,
+0x0004003d,0x00000011,0x000008b9,0x000000a9,
+0x0004003d,0x00000006,0x000008ba,0x00000897,
+0x0004003d,0x00000006,0x000008bb,0x000008aa,
+0x00050080,0x00000006,0x000008bc,0x000008ba,
+0x000008bb,0x0003003e,0x000008bd,0x000008bc,
+0x00050039,0x00000011,0x000008be,0x00000079,
+0x000008bd,0x000500c7,0x00000011,0x000008bf,
+0x000008b9,0x000008be,0x0003003e,0x000008b8,
+0x000008bf,0x0003003e,0x000008c0,0x0000009d,
+0x000200f9,0x000008c1,0x000200f8,0x000008c1,
+0x000400f6,0x000008c3,0x000008c4,0x00000000,
+0x000200f9,0x000008c5,0x000200f8,0x000008c5,
+0x0004003d,0x00000006,0x000008c6,0x000008c0,
+0x0004003d,0x00000006,0x000008c7,0x000008b2,
+0x000500b0,0x00000083,0x000008c8,0x000008c6,
+0x000008c7,0x000400fa,0x000008c8,0x000008c2,
+0x000008c3,0x000200f8,0x000008c2,0x0004003d,
+0x00000006,0x000008ca,0x000008c0,0x00050084,
+0x00000006,0x000008cb,0x00000092,0x000008ca,
+0x0004003d,0x00000006,0x000008cc,0x00000887,
+0x00050080,0x00000006,0x000008cd,0x000008cb,
+0x000008cc,0x0003003e,0x000008c9,0x000008cd,
+0x0004003d,0x00000006,0x000008ce,0x000008c0,
+0x0004003d,0x00000011,0x000008d0,0x000008b8,
+0x0003003e,0x000008cf,0x000008d0,0x0004003d,
+0x00000006,0x000008d2,0x00000897,0x0003003e,
+0x000008d1,0x000008d2,0x0004003d,0x00000006,
+0x000008d4,0x000008c9,0x0003003e,0x000008d3,
+0x000008d4,0x0004003d,0x00000008,0x000008d6,
+0x000008a9,0x0003003e,0x000008d5,0x000008d6,
+0x00080039,0x00000006,0x000008d7,0x00000075,
+0x000008cf,0x000008d1,0x000008d3,0x000008d5,
+0x0004007c,0x00000056,0x000008d8,0x000008d7,
+0x00050041,0x0000024b,0x000008d9,0x000008b6,
+0x000008ce,0x0003003e,0x000008d9,0x000008d8,
+0x0004003d,0x00000006,0x000008da,0x000008c0,
+0x0004003d,0x00000006,0x000008db,0x000008c9,
+0x00050080,0x00000006,0x000008dc,0x000008db,
+0x000000a0,0x0004003d,0x00000011,0x000008de,
+0x000008b8,0x0003003e,0x000008dd,0x000008de,
+0x0004003d,0x00000006,0x000008e0,0x00000897,
+0x0003003e,0x000008df,0x000008e0,0x0003003e,
+0x000008e1,0x000008dc,0x0004003d,0x00000008,
+0x000008e3,0x000008a9,0x0003003e,0x000008e2,
+0x000008e3,0x00080039,0x00000006,0x000008e4,
+0x00000075,0x000008dd,0x000008df,0x000008e1,
+0x000008e2,0x0004007c,0x00000056,0x000008e5,
+0x000008e4,0x00050041,0x0000024b,0x000008e6,
+0x000008b7,0x000008da,0x0003003e,0x000008e6,
+0x000008e5,0x000200f9,0x000008c4,0x000200f8,
+0x000008c4,0x0004003d,0x00000006,0x000008e7,
+0x000008c0,0x00050080,0x00000006,0x000008e8,
+0x000008e7,0x000000c3,0x0003003e,0x000008c0,
+0x000008e8,0x000200f9,0x000008c1,0x000200f8,
+0x000008c3,0x0004003d,0x00000057,0x000008ec,
+0x000008b6,0x0003003e,0x000008eb,0x000008ec,
+0x0004003d,0x00000057,0x000008ee,0x000008b7,
+0x0003003e,0x000008ed,0x000008ee,0x0004003d,
+0x00000006,0x000008f0,0x00000888,0x0003003e,
+0x000008ef,0x000008f0,0x00090039,0x00000002,
+0x000008f3,0x0000006e,0x000008eb,0x000008ed,
+0x000008ef,0x000008f1,0x000008f2,0x0004003d,
+0x00000011,0x000008f4,0x000008f1,0x0003003e,
+0x000008e9,0x000008f4,0x0004003d,0x00000011,
+0x000008f5,0x000008f2,0x0003003e,0x000008ea,
+0x000008f5,0x00050041,0x00000007,0x000008f7,
+0x0000087a,0x0000009d,0x0004003d,0x00000006,
+0x000008f8,0x000008f7,0x00070050,0x00000011,
+0x000008f9,0x000008f8,0x000008f8,0x000008f8,
+0x000008f8,0x0003003e,0x000008f6,0x000008f9,
+0x0004003d,0x00000083,0x000008fa,0x000000d4,
+0x000300f7,0x000008fc,0x00000000,0x000400fa,
+0x000008fa,0x000008fb,0x000008fc,0x000200f8,
+0x000008fb,0x0004003d,0x00000011,0x000008ff,
+0x000000a9,0x0003003e,0x000008fe,0x000008ff,
+0x0004003d,0x00000006,0x00000901,0x0000089d,
+0x0003003e,0x00000900,0x00000901,0x0003003e,
+0x00000902,0x00000092,0x00070039,0x00000006,
+0x00000903,0x00000017,0x000008fe,0x00000900,
+0x00000902,0x0003003e,0x000008fd,0x00000903,
+0x0004003d,0x00000006,0x00000904,0x000008fd,
+0x00050041,0x00000007,0x00000905,0x0000087a,
+0x000000a0,0x0004003d,0x00000006,0x00000906,
+0x00000905,0x00050041,0x00000007,0x00000907,
+0x000008f6,0x00000904,0x0003003e,0x00000907,
+0x00000906,0x000200f9,0x000008fc,0x000200f8,
+0x000008fc,0x0004003d,0x00000011,0x00000908,
+0x000008e9,0x0004003d,0x00000011,0x00000909,
+0x000008f6,0x00070050,0x00000011,0x0000090a,
+0x0000017c,0x0000017c,0x0000017c,0x0000017c,
+0x00050082,0x00000011,0x0000090b,0x0000090a,
+0x00000909,0x00050084,0x00000011,0x0000090c,
+0x00000908,0x0000090b,0x0004003d,0x00000011,
+0x0000090d,0x000008ea,0x0004003d,0x00000011,
+0x0000090e,0x000008f6,0x00050084,0x00000011,
+0x0000090f,0x0000090d,0x0000090e,0x00050080,
+0x00000011,0x00000910,0x0000090c,0x0000090f,
+0x00070050,0x00000011,0x00000911,0x0000019f,
+0x0000019f,0x0000019f,0x0000019f,0x00050080,
+0x00000011,0x00000912,0x00000910,0x00000911,
+0x00070050,0x00000057,0x00000913,0x0000050d,
+0x0000050d,0x0000050d,0x0000050d,0x000500c2,
+0x00000011,0x00000914,0x00000912,0x00000913,
+0x000200fe,0x00000914,0x00010038,0x00050036,
+0x0000005d,0x00000081,0x00000000,0x0000007f,
+0x00030037,0x0000005e,0x00000080,0x000200f8,
+0x00000082,0x0004003d,0x0000005d,0x00000917,
+0x00000080,0x000200fe,0x00000917,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_3D.inl
new file mode 100644
index 00000000000..db884aa98e9
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcNew_3D.inl
@@ -0,0 +1,3571 @@
+0x07230203,0x00010300,0x000d000a,0x00000951,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x0000091c,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00080005,0x0000000d,0x45746567,
+0x646f636e,0x53676e69,0x28657a69,0x763b3175,
+0x003b3375,0x00040005,0x0000000b,0x566d756e,
+0x00736c61,0x00050005,0x0000000c,0x6f636e65,
+0x676e6964,0x00000000,0x00070005,0x0000000f,
+0x6f636564,0x6c426564,0x436b636f,0x69666e6f,
+0x00002867,0x00080005,0x00000017,0x72747865,
+0x42746361,0x28737469,0x3b347576,0x753b3175,
+0x00003b31,0x00040005,0x00000014,0x61746164,
+0x00000000,0x00040005,0x00000015,0x7366666f,
+0x00007465,0x00040005,0x00000016,0x426d756e,
+0x00737469,0x00080005,0x0000001e,0x6f636564,
+0x45436564,0x3175284d,0x3b31753b,0x753b3175,
+0x00003b31,0x00060005,0x0000001a,0x74726170,
+0x6f697469,0x646e496e,0x00007865,0x00060005,
+0x0000001b,0x72617473,0x45664f74,0x61727478,
+0x006d6543,0x00060005,0x0000001c,0x61746f74,
+0x646e456c,0x6e696f70,0x00007374,0x00070005,
+0x0000001d,0x65736162,0x70646e45,0x746e696f,
+0x65646e49,0x00000078,0x00090005,0x00000025,
+0x6f636564,0x72546564,0x76287469,0x753b3475,
+0x31753b31,0x3b31753b,0x00000000,0x00040005,
+0x00000021,0x61746164,0x00000000,0x00040005,
+0x00000022,0x7366666f,0x00007465,0x00040005,
+0x00000023,0x426d756e,0x00737469,0x00030005,
+0x00000024,0x00000069,0x00090005,0x0000002b,
+0x6f636564,0x75516564,0x28746e69,0x3b347576,
+0x753b3175,0x31753b31,0x0000003b,0x00040005,
+0x00000027,0x61746164,0x00000000,0x00040005,
+0x00000028,0x7366666f,0x00007465,0x00040005,
+0x00000029,0x426d756e,0x00737469,0x00030005,
+0x0000002a,0x00000069,0x000a0005,0x00000032,
+0x6f636564,0x57316564,0x68676965,0x75762874,
+0x75763b34,0x31753b33,0x3b31753b,0x00000000,
+0x00050005,0x0000002e,0x67696577,0x61447468,
+0x00006174,0x00050005,0x0000002f,0x6f636e65,
+0x676e6964,0x00000000,0x00050005,0x00000030,
+0x576d756e,0x68676965,0x00007374,0x00040005,
+0x00000031,0x65646e69,0x00000078,0x000e0005,
+0x0000003f,0x65746e69,0x6c6f7072,0x57657461,
+0x68676965,0x76287374,0x763b3475,0x753b3375,
+0x31753b31,0x3b31753b,0x753b3175,0x75763b31,
+0x00003b32,0x00050005,0x00000037,0x67696577,
+0x61447468,0x00006174,0x00050005,0x00000038,
+0x6f636e65,0x676e6964,0x00000000,0x00050005,
+0x00000039,0x576d756e,0x68676965,0x00007374,
+0x00040005,0x0000003a,0x65646e69,0x00000078,
+0x00050005,0x0000003b,0x64697267,0x74646957,
+0x00000068,0x00040005,0x0000003c,0x69727473,
+0x00006564,0x00040005,0x0000003d,0x7366666f,
+0x00007465,0x00060005,0x0000003e,0x63617266,
+0x6e6f6974,0x61506c61,0x00007472,0x00080005,
+0x00000044,0x6f636564,0x65576564,0x74686769,
+0x75762873,0x75763b34,0x00003b32,0x00050005,
+0x00000042,0x67696577,0x61447468,0x00006174,
+0x00050005,0x00000043,0x49736f70,0x6f6c426e,
+0x00006b63,0x00050005,0x00000048,0x68736168,
+0x75283235,0x00003b31,0x00030005,0x00000047,
+0x00000070,0x00090005,0x0000004e,0x656c6573,
+0x61507463,0x74697472,0x286e6f69,0x763b3175,
+0x753b3275,0x00003b31,0x00040005,0x0000004b,
+0x64656573,0x00000000,0x00030005,0x0000004c,
+0x00736f70,0x00060005,0x0000004d,0x506d756e,
+0x69747261,0x6e6f6974,0x00000073,0x000a0005,
+0x00000054,0x45746567,0x6f70646e,0x45746e69,
+0x646f636e,0x28676e69,0x753b3175,0x31753b31,
+0x0000003b,0x00080005,0x00000051,0x69617661,
+0x6c62616c,0x646e4565,0x6e696f70,0x74694274,
+0x00000073,0x00060005,0x00000052,0x456d756e,
+0x6f70646e,0x73746e69,0x00000000,0x00050005,
+0x00000053,0x75746361,0x69536c61,0x0000657a,
+0x00070005,0x0000005b,0x65756c62,0x746e6f43,
+0x74636172,0x34697628,0x0000003b,0x00030005,
+0x0000005a,0x00000076,0x00050005,0x00000061,
+0x286d7573,0x3b336976,0x00000000,0x00030005,
+0x00000060,0x00000076,0x00090005,0x00000066,
+0x54746962,0x736e6172,0x53726566,0x656e6769,
+0x69762864,0x69763b34,0x00003b34,0x00030005,
+0x00000064,0x00000061,0x00030005,0x00000065,
+0x00000062,0x000b0005,0x0000006e,0x6f636564,
+0x6e456564,0x696f7064,0x2873746e,0x3b346976,
+0x3b346976,0x763b3175,0x763b3475,0x003b3475,
+0x00030005,0x00000069,0x00004176,0x00030005,
+0x0000006a,0x00004276,0x00040005,0x0000006b,
+0x65646f6d,0x00000000,0x00030005,0x0000006c,
+0x00307065,0x00030005,0x0000006d,0x00317065,
+0x000a0005,0x00000075,0x6f636564,0x45316564,
+0x6f70646e,0x28746e69,0x3b347576,0x753b3175,
+0x75763b31,0x00003b33,0x00040005,0x00000071,
+0x61746164,0x00000000,0x00050005,0x00000072,
+0x72617473,0x66664f74,0x00746573,0x00040005,
+0x00000073,0x65646e69,0x00000078,0x00050005,
+0x00000074,0x6f636e65,0x676e6964,0x00000000,
+0x00070005,0x00000079,0x6c697562,0x74694264,
+0x6b73616d,0x3b317528,0x00000000,0x00040005,
+0x00000078,0x73746962,0x00000000,0x00080005,
+0x0000007d,0x63747361,0x6f636544,0x65546564,
+0x286c6578,0x3b327576,0x00000000,0x00050005,
+0x0000007c,0x49736f70,0x6f6c426e,0x00006b63,
+0x00060005,0x00000081,0x50746567,0x4433736f,
+0x33697628,0x0000003b,0x00030005,0x00000080,
+0x00736f70,0x00050005,0x00000085,0x6f636564,
+0x72456564,0x00726f72,0x00040005,0x00000087,
+0x69427174,0x00007374,0x00050005,0x000000a7,
+0x64696f76,0x65747845,0x0000746e,0x00050005,
+0x000000a9,0x63747361,0x636f6c42,0x0000006b,
+0x00040005,0x000000b5,0x73746962,0x00003130,
+0x00040005,0x000000bb,0x73746962,0x00003332,
+0x00040005,0x000000bf,0x34746962,0x00000000,
+0x00040005,0x000000c5,0x73746962,0x00003635,
+0x00040005,0x000000ca,0x73746962,0x00003837,
+0x00030005,0x000000cf,0x00000068,0x00050005,
+0x000000d4,0x6c617564,0x6e616c50,0x00000065,
+0x00030005,0x000000de,0x00000072,0x00060005,
+0x000000ea,0x67696577,0x72477468,0x69536469,
+0x0000657a,0x00070005,0x0000013e,0x67616d49,
+0x726f4665,0x4274616d,0x6b636f6c,0x00000000,
+0x00060006,0x0000013e,0x00000000,0x636f6c62,
+0x7a69536b,0x00000065,0x00060006,0x0000013e,
+0x00000001,0x65736162,0x6579614c,0x00000072,
+0x00060006,0x0000013e,0x00000002,0x6c616d73,
+0x6f6c426c,0x00006b63,0x00060005,0x00000140,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00060005,0x0000014b,0x67696577,0x6e457468,
+0x69646f63,0x0000676e,0x00050005,0x00000162,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000165,0x576d756e,0x68676965,0x00007374,
+0x00060005,0x0000016e,0x67696577,0x61447468,
+0x69536174,0x0000657a,0x00040005,0x0000016f,
+0x61726170,0x0000006d,0x00040005,0x00000171,
+0x61726170,0x0000006d,0x00060005,0x00000182,
+0x506d756e,0x69747261,0x6e6f6974,0x00000073,
+0x00060005,0x0000018c,0x74726170,0x6f697469,
+0x6565536e,0x00000064,0x00030005,0x0000019d,
+0x00000069,0x00030005,0x000001a2,0x0000006a,
+0x00040005,0x000001a9,0x72617473,0x00000074,
+0x00050005,0x000001bc,0x4c6d756e,0x6942776f,
+0x00007374,0x00040005,0x000001bf,0x42776f6c,
+0x00737469,0x00050005,0x000001c8,0x68676968,
+0x73746942,0x00000000,0x00030005,0x000001df,
+0x006d6563,0x00050005,0x000001ea,0x536d6563,
+0x63656c65,0x00726f74,0x00040005,0x000001ef,
+0x65736162,0x006d6543,0x00080005,0x000001fa,
+0x70646e65,0x746e696f,0x72655073,0x74726150,
+0x6f697469,0x0000006e,0x00060005,0x00000208,
+0x657a6973,0x7845664f,0x43617274,0x00006d65,
+0x00050005,0x00000210,0x72747865,0x6d654361,
+0x00000000,0x00040005,0x00000211,0x61726170,
+0x0000006d,0x00040005,0x00000213,0x61726170,
+0x0000006d,0x00040005,0x00000215,0x61726170,
+0x0000006d,0x00040005,0x00000218,0x6c6c7566,
+0x006d6543,0x00040005,0x0000021d,0x6c61566d,
+0x00006575,0x00040005,0x00000225,0x6c615663,
+0x00736575,0x00050005,0x0000023d,0x65736162,
+0x73616c43,0x00000073,0x00050005,0x0000024c,
+0x6d756e69,0x73746942,0x00000000,0x00040005,
+0x0000024f,0x636f6c62,0x0000006b,0x00040005,
+0x00000256,0x61726170,0x0000006d,0x00040005,
+0x00000258,0x61726170,0x0000006d,0x00040005,
+0x00000259,0x61726170,0x0000006d,0x00050005,
+0x0000025b,0x6b636170,0x72546465,0x00737469,
+0x00040005,0x0000027e,0x42776f6c,0x00737469,
+0x00040005,0x0000027f,0x61726170,0x0000006d,
+0x00040005,0x00000281,0x61726170,0x0000006d,
+0x00040005,0x00000283,0x61726170,0x0000006d,
+0x00030005,0x00000287,0x0000006a,0x00040005,
+0x00000295,0x6f636564,0x00646564,0x00050005,
+0x0000037f,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x0000038d,0x6d756e69,0x73746942,
+0x00000000,0x00040005,0x00000390,0x636f6c62,
+0x0000006b,0x00040005,0x00000394,0x61726170,
+0x0000006d,0x00040005,0x00000396,0x61726170,
+0x0000006d,0x00040005,0x00000398,0x61726170,
+0x0000006d,0x00060005,0x0000039a,0x6b636170,
+0x75516465,0x73746e69,0x00000000,0x00040005,
+0x000003ac,0x42776f6c,0x00737469,0x00040005,
+0x000003b8,0x6f636564,0x00646564,0x00050005,
+0x000003f0,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000404,0x426d756e,0x00737469,
+0x00040005,0x0000040c,0x7366666f,0x00007465,
+0x00030005,0x00000413,0x00000077,0x00040005,
+0x00000416,0x61726170,0x0000006d,0x00040005,
+0x00000418,0x61726170,0x0000006d,0x00040005,
+0x0000041a,0x61726170,0x0000006d,0x00040005,
+0x0000041c,0x61726170,0x0000006d,0x00050005,
+0x00000435,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x0000043f,0x7366666f,0x00007465,
+0x00030005,0x00000446,0x00000077,0x00040005,
+0x00000449,0x61726170,0x0000006d,0x00040005,
+0x0000044b,0x61726170,0x0000006d,0x00040005,
+0x0000044d,0x61726170,0x0000006d,0x00040005,
+0x0000044f,0x61726170,0x0000006d,0x00050005,
+0x00000463,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000468,0x7366666f,0x00007465,
+0x00030005,0x0000046c,0x00000077,0x00040005,
+0x0000046d,0x61726170,0x0000006d,0x00040005,
+0x0000046f,0x61726170,0x0000006d,0x00040005,
+0x00000471,0x61726170,0x0000006d,0x00040005,
+0x00000474,0x75716e75,0x00746e61,0x00050005,
+0x00000480,0x65646e69,0x6c626178,0x00000065,
+0x00060005,0x00000495,0x67696577,0x6e497468,
+0x65636964,0x00000073,0x00040005,0x000004a3,
+0x67696577,0x00737468,0x00040005,0x000004a4,
+0x61726170,0x0000006d,0x00040005,0x000004a6,
+0x61726170,0x0000006d,0x00040005,0x000004a8,
+0x61726170,0x0000006d,0x00040005,0x000004aa,
+0x61726170,0x0000006d,0x00040005,0x000004ae,
+0x61726170,0x0000006d,0x00040005,0x000004b0,
+0x61726170,0x0000006d,0x00040005,0x000004b2,
+0x61726170,0x0000006d,0x00040005,0x000004b4,
+0x61726170,0x0000006d,0x00040005,0x000004b8,
+0x61726170,0x0000006d,0x00040005,0x000004ba,
+0x61726170,0x0000006d,0x00040005,0x000004bc,
+0x61726170,0x0000006d,0x00040005,0x000004be,
+0x61726170,0x0000006d,0x00040005,0x000004c2,
+0x61726170,0x0000006d,0x00040005,0x000004c4,
+0x61726170,0x0000006d,0x00040005,0x000004c6,
+0x61726170,0x0000006d,0x00040005,0x000004c8,
+0x61726170,0x0000006d,0x00030005,0x000004cd,
+0x00313177,0x00040005,0x000004d5,0x74636166,
+0x0073726f,0x00050005,0x000004f5,0x6c616373,
+0x63614665,0x00726f74,0x00070005,0x00000502,
+0x6f6d6f68,0x656e6567,0x4373756f,0x64726f6f,
+0x00000073,0x00050005,0x00000505,0x64697267,
+0x726f6f43,0x00007364,0x00060005,0x00000511,
+0x65746e69,0x6c617267,0x74726150,0x00000000,
+0x00060005,0x00000515,0x63617266,0x6e6f6974,
+0x61506c61,0x00007472,0x00050005,0x0000051a,
+0x64697267,0x74646957,0x00000068,0x00030005,
+0x0000051d,0x00003076,0x00040005,0x00000525,
+0x67696577,0x00737468,0x00040005,0x0000052b,
+0x61726170,0x0000006d,0x00040005,0x0000052d,
+0x61726170,0x0000006d,0x00040005,0x0000052f,
+0x61726170,0x0000006d,0x00040005,0x00000531,
+0x61726170,0x0000006d,0x00040005,0x00000533,
+0x61726170,0x0000006d,0x00040005,0x00000535,
+0x61726170,0x0000006d,0x00040005,0x00000536,
+0x61726170,0x0000006d,0x00040005,0x00000537,
+0x61726170,0x0000006d,0x00040005,0x0000053e,
+0x61726170,0x0000006d,0x00040005,0x00000540,
+0x61726170,0x0000006d,0x00040005,0x00000542,
+0x61726170,0x0000006d,0x00040005,0x00000544,
+0x61726170,0x0000006d,0x00040005,0x00000546,
+0x61726170,0x0000006d,0x00040005,0x00000548,
+0x61726170,0x0000006d,0x00040005,0x00000549,
+0x61726170,0x0000006d,0x00040005,0x0000054a,
+0x61726170,0x0000006d,0x00040005,0x00000592,
+0x6d756e72,0x00000000,0x00040005,0x00000593,
+0x61726170,0x0000006d,0x00040005,0x00000596,
+0x64656573,0x00000041,0x00040005,0x000005a2,
+0x64656573,0x00000042,0x00040005,0x000005b5,
+0x66696873,0x00317374,0x00040005,0x000005c0,
+0x66696873,0x00327374,0x00040005,0x000005d3,
+0x75736572,0x0000746c,0x00030005,0x0000062a,
+0x00000069,0x00050005,0x00000632,0x6f636e65,
+0x676e6964,0x00000000,0x00050005,0x00000640,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000643,0x61726170,0x0000006d,0x00040005,
+0x00000645,0x61726170,0x0000006d,0x00030005,
+0x0000069f,0x0000306c,0x00030005,0x000006a8,
+0x0000316c,0x00040005,0x000006c6,0x61726170,
+0x0000006d,0x00040005,0x000006c8,0x61726170,
+0x0000006d,0x00040005,0x00000715,0x61726170,
+0x0000006d,0x00040005,0x00000719,0x61726170,
+0x0000006d,0x00040005,0x00000725,0x61726170,
+0x0000006d,0x00040005,0x00000729,0x61726170,
+0x0000006d,0x00040005,0x00000731,0x61726170,
+0x0000006d,0x00040005,0x00000733,0x61726170,
+0x0000006d,0x00040005,0x00000738,0x61726170,
+0x0000006d,0x00040005,0x0000074f,0x61726170,
+0x0000006d,0x00040005,0x00000755,0x61726170,
+0x0000006d,0x00040005,0x0000075f,0x426d756e,
+0x00737469,0x00040005,0x00000767,0x7366666f,
+0x00007465,0x00030005,0x00000770,0x00007065,
+0x00040005,0x00000773,0x61726170,0x0000006d,
+0x00040005,0x00000775,0x61726170,0x0000006d,
+0x00040005,0x00000777,0x61726170,0x0000006d,
+0x00040005,0x00000779,0x61726170,0x0000006d,
+0x00050005,0x000007e1,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x000007eb,0x7366666f,
+0x00007465,0x00030005,0x000007f4,0x00007065,
+0x00040005,0x000007f7,0x61726170,0x0000006d,
+0x00040005,0x000007f9,0x61726170,0x0000006d,
+0x00040005,0x000007fb,0x61726170,0x0000006d,
+0x00040005,0x000007fd,0x61726170,0x0000006d,
+0x00050005,0x0000080f,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000814,0x7366666f,
+0x00007465,0x00030005,0x0000081a,0x00000077,
+0x00040005,0x0000081b,0x61726170,0x0000006d,
+0x00040005,0x0000081d,0x61726170,0x0000006d,
+0x00040005,0x0000081f,0x61726170,0x0000006d,
+0x00040005,0x00000822,0x75716e75,0x00746e61,
+0x00050005,0x0000082f,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x0000083d,0x426d756e,
+0x00737469,0x00040005,0x00000846,0x6b73616d,
+0x00000000,0x00050005,0x00000872,0x67696577,
+0x61447468,0x00006174,0x00040005,0x00000876,
+0x61726170,0x0000006d,0x00040005,0x0000087a,
+0x67696577,0x00737468,0x00040005,0x0000087b,
+0x61726170,0x0000006d,0x00060005,0x0000087e,
+0x74726170,0x6f697469,0x646e496e,0x00007865,
+0x00040005,0x0000087f,0x61726170,0x0000006d,
+0x00040005,0x00000881,0x61726170,0x0000006d,
+0x00040005,0x00000882,0x61726170,0x0000006d,
+0x00060005,0x00000885,0x72617473,0x45664f74,
+0x61727478,0x006d6543,0x00060005,0x00000886,
+0x61746f74,0x646e456c,0x6e696f70,0x00007374,
+0x00070005,0x00000887,0x65736162,0x70646e45,
+0x746e696f,0x65646e49,0x00000078,0x00030005,
+0x00000888,0x006d6563,0x00040005,0x00000889,
+0x61726170,0x0000006d,0x00040005,0x0000088b,
+0x61726170,0x0000006d,0x00040005,0x0000088c,
+0x61726170,0x0000006d,0x00040005,0x0000088d,
+0x61726170,0x0000006d,0x00060005,0x00000897,
+0x70646e65,0x746e696f,0x61745373,0x00007472,
+0x00060005,0x0000089d,0x70646e65,0x746e696f,
+0x646e4573,0x00000000,0x00080005,0x000008a5,
+0x69617661,0x6c62616c,0x646e4565,0x6e696f70,
+0x74694274,0x00000073,0x00070005,0x000008a9,
+0x70646e65,0x746e696f,0x6f636e45,0x676e6964,
+0x00000000,0x00070005,0x000008aa,0x75746361,
+0x6e456c61,0x696f7064,0x6942746e,0x00007374,
+0x00040005,0x000008ab,0x61726170,0x0000006d,
+0x00040005,0x000008ad,0x61726170,0x0000006d,
+0x00040005,0x000008af,0x61726170,0x0000006d,
+0x00070005,0x000008b2,0x456d756e,0x6f70646e,
+0x50746e69,0x73726961,0x00000000,0x00030005,
+0x000008b6,0x00004176,0x00030005,0x000008b7,
+0x00004276,0x00040005,0x000008b8,0x61447065,
+0x00006174,0x00040005,0x000008bd,0x61726170,
+0x0000006d,0x00030005,0x000008c0,0x00000069,
+0x00040005,0x000008c9,0x64497065,0x00000078,
+0x00040005,0x000008cf,0x61726170,0x0000006d,
+0x00040005,0x000008d1,0x61726170,0x0000006d,
+0x00040005,0x000008d3,0x61726170,0x0000006d,
+0x00040005,0x000008d5,0x61726170,0x0000006d,
+0x00040005,0x000008dd,0x61726170,0x0000006d,
+0x00040005,0x000008df,0x61726170,0x0000006d,
+0x00040005,0x000008e1,0x61726170,0x0000006d,
+0x00040005,0x000008e2,0x61726170,0x0000006d,
+0x00030005,0x000008e9,0x00307065,0x00030005,
+0x000008ea,0x00317065,0x00040005,0x000008eb,
+0x61726170,0x0000006d,0x00040005,0x000008ed,
+0x61726170,0x0000006d,0x00040005,0x000008ef,
+0x61726170,0x0000006d,0x00040005,0x000008f1,
+0x61726170,0x0000006d,0x00040005,0x000008f2,
+0x61726170,0x0000006d,0x00070005,0x000008f6,
+0x67696577,0x50737468,0x68437265,0x656e6e61,
+0x0000006c,0x00030005,0x000008fd,0x00736363,
+0x00040005,0x000008fe,0x61726170,0x0000006d,
+0x00040005,0x00000900,0x61726170,0x0000006d,
+0x00040005,0x00000902,0x61726170,0x0000006d,
+0x00050005,0x0000091a,0x65786574,0x736f506c,
+0x00000000,0x00080005,0x0000091c,0x475f6c67,
+0x61626f6c,0x766e496c,0x7461636f,0x496e6f69,
+0x00000044,0x00040005,0x0000091f,0x6579616c,
+0x00000072,0x00050005,0x00000926,0x636f6c62,
+0x736f506b,0x00000000,0x00050005,0x0000092b,
+0x49736f70,0x6f6c426e,0x00006b63,0x00050005,
+0x00000932,0x49637273,0x6567616d,0x00000000,
+0x00040005,0x0000093b,0x61726170,0x0000006d,
+0x00040005,0x0000093f,0x65786574,0x0000006c,
+0x00050005,0x00000944,0x49747364,0x6567616d,
+0x00000000,0x00040005,0x0000094d,0x61726170,
+0x0000006d,0x00050048,0x0000013e,0x00000000,
+0x00000023,0x00000000,0x00050048,0x0000013e,
+0x00000001,0x00000023,0x00000008,0x00050048,
+0x0000013e,0x00000002,0x00000023,0x0000000c,
+0x00030047,0x0000013e,0x00000002,0x00040047,
+0x0000091c,0x0000000b,0x0000001c,0x00040047,
+0x00000932,0x00000022,0x00000000,0x00040047,
+0x00000932,0x00000021,0x00000000,0x00030047,
+0x00000932,0x00000018,0x00040047,0x00000944,
+0x00000022,0x00000000,0x00040047,0x00000944,
+0x00000021,0x00000001,0x00030047,0x00000944,
+0x00000019,0x00040047,0x00000950,0x0000000b,
+0x00000019,0x00020013,0x00000002,0x00030021,
+0x00000003,0x00000002,0x00040015,0x00000006,
+0x00000020,0x00000000,0x00040020,0x00000007,
+0x00000007,0x00000006,0x00040017,0x00000008,
+0x00000006,0x00000003,0x00040020,0x00000009,
+0x00000007,0x00000008,0x00050021,0x0000000a,
+0x00000006,0x00000007,0x00000009,0x00040017,
+0x00000011,0x00000006,0x00000004,0x00040020,
+0x00000012,0x00000007,0x00000011,0x00060021,
+0x00000013,0x00000006,0x00000012,0x00000007,
+0x00000007,0x00070021,0x00000019,0x00000006,
+0x00000007,0x00000007,0x00000007,0x00000007,
+0x00070021,0x00000020,0x00000006,0x00000012,
+0x00000007,0x00000007,0x00000007,0x00070021,
+0x0000002d,0x00000006,0x00000012,0x00000009,
+0x00000007,0x00000007,0x00040017,0x00000034,
+0x00000006,0x00000002,0x00040020,0x00000035,
+0x00000007,0x00000034,0x000b0021,0x00000036,
+0x00000006,0x00000012,0x00000009,0x00000007,
+0x00000007,0x00000007,0x00000007,0x00000007,
+0x00000035,0x00050021,0x00000041,0x00000034,
+0x00000012,0x00000034,0x00040021,0x00000046,
+0x00000006,0x00000007,0x00060021,0x0000004a,
+0x00000006,0x00000007,0x00000035,0x00000007,
+0x00060021,0x00000050,0x00000008,0x00000007,
+0x00000007,0x00000007,0x00040015,0x00000056,
+0x00000020,0x00000001,0x00040017,0x00000057,
+0x00000056,0x00000004,0x00040020,0x00000058,
+0x00000007,0x00000057,0x00040021,0x00000059,
+0x00000057,0x00000058,0x00040017,0x0000005d,
+0x00000056,0x00000003,0x00040020,0x0000005e,
+0x00000007,0x0000005d,0x00040021,0x0000005f,
+0x00000056,0x0000005e,0x00050021,0x00000063,
+0x00000002,0x00000058,0x00000058,0x00080021,
+0x00000068,0x00000002,0x00000058,0x00000058,
+0x00000007,0x00000012,0x00000012,0x00070021,
+0x00000070,0x00000006,0x00000012,0x00000007,
+0x00000007,0x00000009,0x00040021,0x00000077,
+0x00000011,0x00000007,0x00040021,0x0000007b,
+0x00000011,0x00000034,0x00040021,0x0000007f,
+0x0000005d,0x0000005e,0x00020014,0x00000083,
+0x00040020,0x00000084,0x00000006,0x00000083,
+0x0004003b,0x00000084,0x00000085,0x00000006,
+0x0003002a,0x00000083,0x00000086,0x0004002b,
+0x00000006,0x0000008d,0x00000008,0x0004002b,
+0x00000006,0x0000008e,0x00000007,0x0005002c,
+0x00000034,0x0000008f,0x0000008d,0x0000008e,
+0x0004002b,0x00000006,0x00000091,0x00000004,
+0x0004002b,0x00000006,0x00000092,0x00000002,
+0x0005002c,0x00000034,0x00000093,0x00000091,
+0x00000092,0x0004002b,0x00000006,0x00000095,
+0x00000005,0x0004002b,0x00000006,0x00000096,
+0x00000003,0x0005002c,0x00000034,0x00000097,
+0x00000095,0x00000096,0x0004002b,0x00000006,
+0x0000009d,0x00000000,0x0004002b,0x00000006,
+0x000000a0,0x00000001,0x0004003b,0x00000084,
+0x000000a7,0x00000006,0x00040020,0x000000a8,
+0x00000006,0x00000011,0x0004003b,0x000000a8,
+0x000000a9,0x00000006,0x00040020,0x000000aa,
+0x00000006,0x00000006,0x0004002b,0x00000006,
+0x000000ad,0x000001ff,0x0004002b,0x00000006,
+0x000000af,0x000001fc,0x0004002b,0x00000056,
+0x000000b8,0x00000000,0x0004002b,0x00000056,
+0x000000b9,0x00000002,0x0004002b,0x00000056,
+0x000000c2,0x00000004,0x0004002b,0x00000056,
+0x000000c3,0x00000001,0x0004002b,0x00000056,
+0x000000c8,0x00000005,0x0004002b,0x00000056,
+0x000000cd,0x00000007,0x0004002b,0x00000056,
+0x000000d2,0x00000009,0x0004003b,0x00000084,
+0x000000d4,0x00000006,0x0004002b,0x00000056,
+0x000000d7,0x0000000a,0x00040020,0x000000e9,
+0x00000006,0x00000034,0x0004003b,0x000000e9,
+0x000000ea,0x00000006,0x0004002b,0x00000006,
+0x000000eb,0x0000000c,0x0004002b,0x00000006,
+0x000000f5,0x00000006,0x0004002b,0x00000006,
+0x00000101,0x0000000a,0x0005002c,0x00000034,
+0x00000102,0x000000f5,0x00000101,0x0005002c,
+0x00000034,0x00000108,0x00000101,0x000000f5,
+0x00030029,0x00000083,0x0000010a,0x0005001e,
+0x0000013e,0x00000034,0x00000006,0x00000006,
+0x00040020,0x0000013f,0x00000009,0x0000013e,
+0x0004003b,0x0000013f,0x00000140,0x00000009,
+0x00040020,0x00000141,0x00000009,0x00000034,
+0x00040017,0x00000144,0x00000083,0x00000002,
+0x00040020,0x0000014a,0x00000006,0x00000008,
+0x0004003b,0x0000014a,0x0000014b,0x00000006,
+0x0004002b,0x00000006,0x0000014c,0x00000010,
+0x0004001c,0x0000014d,0x00000008,0x0000014c,
+0x0006002c,0x00000008,0x0000014e,0x0000009d,
+0x0000009d,0x0000009d,0x0006002c,0x00000008,
+0x0000014f,0x0000009d,0x0000009d,0x000000a0,
+0x0006002c,0x00000008,0x00000150,0x000000a0,
+0x0000009d,0x0000009d,0x0006002c,0x00000008,
+0x00000151,0x0000009d,0x0000009d,0x00000092,
+0x0006002c,0x00000008,0x00000152,0x0000009d,
+0x000000a0,0x0000009d,0x0006002c,0x00000008,
+0x00000153,0x000000a0,0x0000009d,0x000000a0,
+0x0006002c,0x00000008,0x00000154,0x0000009d,
+0x0000009d,0x00000096,0x0006002c,0x00000008,
+0x00000155,0x0000009d,0x000000a0,0x000000a0,
+0x0006002c,0x00000008,0x00000156,0x000000a0,
+0x0000009d,0x00000092,0x0006002c,0x00000008,
+0x00000157,0x0000009d,0x0000009d,0x00000091,
+0x0006002c,0x00000008,0x00000158,0x0000009d,
+0x000000a0,0x00000092,0x0006002c,0x00000008,
+0x00000159,0x000000a0,0x0000009d,0x00000096,
+0x0006002c,0x00000008,0x0000015a,0x0000009d,
+0x0000009d,0x00000095,0x0013002c,0x0000014d,
+0x0000015b,0x0000014e,0x0000014e,0x0000014f,
+0x00000150,0x00000151,0x00000152,0x00000153,
+0x00000154,0x0000014e,0x0000014e,0x00000155,
+0x00000156,0x00000157,0x00000158,0x00000159,
+0x0000015a,0x0004002b,0x00000056,0x0000015d,
+0x00000003,0x00040020,0x00000161,0x00000007,
+0x0000014d,0x0004003b,0x000000aa,0x00000165,
+0x00000006,0x0004003b,0x000000aa,0x0000016e,
+0x00000006,0x0004002b,0x00000006,0x00000175,
+0x00000018,0x0004002b,0x00000006,0x00000178,
+0x00000060,0x0004002b,0x00000006,0x0000017c,
+0x00000040,0x0004003b,0x000000aa,0x00000182,
+0x00000006,0x0004002b,0x00000056,0x00000185,
+0x0000000b,0x0004003b,0x000000aa,0x0000018c,
+0x00000006,0x0004002b,0x00000056,0x0000018f,
+0x0000000d,0x0004002b,0x00000006,0x0000019f,
+0x00000020,0x0004002b,0x00000006,0x000001ab,
+0x0000001f,0x0004002b,0x00000006,0x000001dc,
+0x00000080,0x0004002b,0x00000056,0x000001ed,
+0x00000017,0x0004002b,0x00000056,0x000001f2,
+0x00000019,0x00040020,0x0000024b,0x00000007,
+0x00000056,0x0007002c,0x00000057,0x0000028f,
+0x000000b9,0x000000c2,0x000000c8,0x000000cd,
+0x0004002b,0x00000006,0x00000296,0x00000100,
+0x0004001c,0x00000297,0x00000006,0x00000296,
+0x0004002b,0x00000006,0x00000298,0x00000021,
+0x0004002b,0x00000006,0x00000299,0x00000009,
+0x0004002b,0x00000006,0x0000029a,0x00000022,
+0x0004002b,0x00000006,0x0000029b,0x00000028,
+0x0004002b,0x00000006,0x0000029c,0x00000029,
+0x0004002b,0x00000006,0x0000029d,0x0000002a,
+0x0004002b,0x00000006,0x0000029e,0x00000011,
+0x0004002b,0x00000006,0x0000029f,0x00000012,
+0x0004002b,0x00000006,0x000002a0,0x00000024,
+0x0004002b,0x00000006,0x000002a1,0x00000014,
+0x0004002b,0x00000006,0x000002a2,0x00000015,
+0x0004002b,0x00000006,0x000002a3,0x00000016,
+0x0004002b,0x00000006,0x000002a4,0x00000025,
+0x0004002b,0x00000006,0x000002a5,0x00000019,
+0x0004002b,0x00000006,0x000002a6,0x0000001a,
+0x0004002b,0x00000006,0x000002a7,0x00000026,
+0x0004002b,0x00000006,0x000002a8,0x00000280,
+0x0004002b,0x00000006,0x000002a9,0x00000281,
+0x0004002b,0x00000006,0x000002aa,0x00000282,
+0x0004002b,0x00000006,0x000002ab,0x000002a0,
+0x0004002b,0x00000006,0x000002ac,0x00000041,
+0x0004002b,0x00000006,0x000002ad,0x00000042,
+0x0004002b,0x00000006,0x000002ae,0x00000044,
+0x0004002b,0x00000006,0x000002af,0x00000045,
+0x0004002b,0x00000006,0x000002b0,0x00000046,
+0x0004002b,0x00000006,0x000002b1,0x00000061,
+0x0004002b,0x00000006,0x000002b2,0x00000048,
+0x0004002b,0x00000006,0x000002b3,0x00000049,
+0x0004002b,0x00000006,0x000002b4,0x0000004a,
+0x0004002b,0x00000006,0x000002b5,0x00000062,
+0x0004002b,0x00000006,0x000002b6,0x00000068,
+0x0004002b,0x00000006,0x000002b7,0x00000069,
+0x0004002b,0x00000006,0x000002b8,0x0000006a,
+0x0004002b,0x00000006,0x000002b9,0x00000050,
+0x0004002b,0x00000006,0x000002ba,0x00000051,
+0x0004002b,0x00000006,0x000002bb,0x00000052,
+0x0004002b,0x00000006,0x000002bc,0x00000064,
+0x0004002b,0x00000006,0x000002bd,0x00000054,
+0x0004002b,0x00000006,0x000002be,0x00000055,
+0x0004002b,0x00000006,0x000002bf,0x00000056,
+0x0004002b,0x00000006,0x000002c0,0x00000065,
+0x0004002b,0x00000006,0x000002c1,0x00000058,
+0x0004002b,0x00000006,0x000002c2,0x00000059,
+0x0004002b,0x00000006,0x000002c3,0x0000005a,
+0x0004002b,0x00000006,0x000002c4,0x00000066,
+0x0004002b,0x00000006,0x000002c5,0x00000284,
+0x0004002b,0x00000006,0x000002c6,0x00000285,
+0x0004002b,0x00000006,0x000002c7,0x00000286,
+0x0004002b,0x00000006,0x000002c8,0x000002a1,
+0x0004002b,0x00000006,0x000002c9,0x00000081,
+0x0004002b,0x00000006,0x000002ca,0x00000082,
+0x0004002b,0x00000006,0x000002cb,0x000000a0,
+0x0004002b,0x00000006,0x000002cc,0x00000084,
+0x0004002b,0x00000006,0x000002cd,0x00000085,
+0x0004002b,0x00000006,0x000002ce,0x00000086,
+0x0004002b,0x00000006,0x000002cf,0x000000a1,
+0x0004002b,0x00000006,0x000002d0,0x00000088,
+0x0004002b,0x00000006,0x000002d1,0x00000089,
+0x0004002b,0x00000006,0x000002d2,0x0000008a,
+0x0004002b,0x00000006,0x000002d3,0x000000a2,
+0x0004002b,0x00000006,0x000002d4,0x000000a8,
+0x0004002b,0x00000006,0x000002d5,0x000000a9,
+0x0004002b,0x00000006,0x000002d6,0x000000aa,
+0x0004002b,0x00000006,0x000002d7,0x00000090,
+0x0004002b,0x00000006,0x000002d8,0x00000091,
+0x0004002b,0x00000006,0x000002d9,0x00000092,
+0x0004002b,0x00000006,0x000002da,0x000000a4,
+0x0004002b,0x00000006,0x000002db,0x00000094,
+0x0004002b,0x00000006,0x000002dc,0x00000095,
+0x0004002b,0x00000006,0x000002dd,0x00000096,
+0x0004002b,0x00000006,0x000002de,0x000000a5,
+0x0004002b,0x00000006,0x000002df,0x00000098,
+0x0004002b,0x00000006,0x000002e0,0x00000099,
+0x0004002b,0x00000006,0x000002e1,0x0000009a,
+0x0004002b,0x00000006,0x000002e2,0x000000a6,
+0x0004002b,0x00000006,0x000002e3,0x00000288,
+0x0004002b,0x00000006,0x000002e4,0x00000289,
+0x0004002b,0x00000006,0x000002e5,0x0000028a,
+0x0004002b,0x00000006,0x000002e6,0x000002a2,
+0x0004002b,0x00000006,0x000002e7,0x00000200,
+0x0004002b,0x00000006,0x000002e8,0x00000201,
+0x0004002b,0x00000006,0x000002e9,0x00000202,
+0x0004002b,0x00000006,0x000002ea,0x00000220,
+0x0004002b,0x00000006,0x000002eb,0x00000204,
+0x0004002b,0x00000006,0x000002ec,0x00000205,
+0x0004002b,0x00000006,0x000002ed,0x00000206,
+0x0004002b,0x00000006,0x000002ee,0x00000221,
+0x0004002b,0x00000006,0x000002ef,0x00000208,
+0x0004002b,0x00000006,0x000002f0,0x00000209,
+0x0004002b,0x00000006,0x000002f1,0x0000020a,
+0x0004002b,0x00000006,0x000002f2,0x00000222,
+0x0004002b,0x00000006,0x000002f3,0x00000228,
+0x0004002b,0x00000006,0x000002f4,0x00000229,
+0x0004002b,0x00000006,0x000002f5,0x0000022a,
+0x0004002b,0x00000006,0x000002f6,0x00000210,
+0x0004002b,0x00000006,0x000002f7,0x00000211,
+0x0004002b,0x00000006,0x000002f8,0x00000212,
+0x0004002b,0x00000006,0x000002f9,0x00000224,
+0x0004002b,0x00000006,0x000002fa,0x00000214,
+0x0004002b,0x00000006,0x000002fb,0x00000215,
+0x0004002b,0x00000006,0x000002fc,0x00000216,
+0x0004002b,0x00000006,0x000002fd,0x00000225,
+0x0004002b,0x00000006,0x000002fe,0x00000218,
+0x0004002b,0x00000006,0x000002ff,0x00000219,
+0x0004002b,0x00000006,0x00000300,0x0000021a,
+0x0004002b,0x00000006,0x00000301,0x00000226,
+0x0004002b,0x00000006,0x00000302,0x000002a8,
+0x0004002b,0x00000006,0x00000303,0x000002a9,
+0x0004002b,0x00000006,0x00000304,0x000002aa,
+0x0004002b,0x00000006,0x00000305,0x00000101,
+0x0004002b,0x00000006,0x00000306,0x00000102,
+0x0004002b,0x00000006,0x00000307,0x00000120,
+0x0004002b,0x00000006,0x00000308,0x00000104,
+0x0004002b,0x00000006,0x00000309,0x00000105,
+0x0004002b,0x00000006,0x0000030a,0x00000106,
+0x0004002b,0x00000006,0x0000030b,0x00000121,
+0x0004002b,0x00000006,0x0000030c,0x00000108,
+0x0004002b,0x00000006,0x0000030d,0x00000109,
+0x0004002b,0x00000006,0x0000030e,0x0000010a,
+0x0004002b,0x00000006,0x0000030f,0x00000122,
+0x0004002b,0x00000006,0x00000310,0x00000128,
+0x0004002b,0x00000006,0x00000311,0x00000129,
+0x0004002b,0x00000006,0x00000312,0x0000012a,
+0x0004002b,0x00000006,0x00000313,0x00000110,
+0x0004002b,0x00000006,0x00000314,0x00000111,
+0x0004002b,0x00000006,0x00000315,0x00000112,
+0x0004002b,0x00000006,0x00000316,0x00000124,
+0x0004002b,0x00000006,0x00000317,0x00000114,
+0x0004002b,0x00000006,0x00000318,0x00000115,
+0x0004002b,0x00000006,0x00000319,0x00000116,
+0x0004002b,0x00000006,0x0000031a,0x00000125,
+0x0004002b,0x00000006,0x0000031b,0x00000118,
+0x0004002b,0x00000006,0x0000031c,0x00000119,
+0x0004002b,0x00000006,0x0000031d,0x0000011a,
+0x0004002b,0x00000006,0x0000031e,0x00000126,
+0x0004002b,0x00000006,0x0000031f,0x00000290,
+0x0004002b,0x00000006,0x00000320,0x00000291,
+0x0004002b,0x00000006,0x00000321,0x00000292,
+0x0004002b,0x00000006,0x00000322,0x000002a4,
+0x0004002b,0x00000006,0x00000323,0x00000140,
+0x0004002b,0x00000006,0x00000324,0x00000141,
+0x0004002b,0x00000006,0x00000325,0x00000142,
+0x0004002b,0x00000006,0x00000326,0x00000160,
+0x0004002b,0x00000006,0x00000327,0x00000144,
+0x0004002b,0x00000006,0x00000328,0x00000145,
+0x0004002b,0x00000006,0x00000329,0x00000146,
+0x0004002b,0x00000006,0x0000032a,0x00000161,
+0x0004002b,0x00000006,0x0000032b,0x00000148,
+0x0004002b,0x00000006,0x0000032c,0x00000149,
+0x0004002b,0x00000006,0x0000032d,0x0000014a,
+0x0004002b,0x00000006,0x0000032e,0x00000162,
+0x0004002b,0x00000006,0x0000032f,0x00000168,
+0x0004002b,0x00000006,0x00000330,0x00000169,
+0x0004002b,0x00000006,0x00000331,0x0000016a,
+0x0004002b,0x00000006,0x00000332,0x00000150,
+0x0004002b,0x00000006,0x00000333,0x00000151,
+0x0004002b,0x00000006,0x00000334,0x00000152,
+0x0004002b,0x00000006,0x00000335,0x00000164,
+0x0004002b,0x00000006,0x00000336,0x00000154,
+0x0004002b,0x00000006,0x00000337,0x00000155,
+0x0004002b,0x00000006,0x00000338,0x00000156,
+0x0004002b,0x00000006,0x00000339,0x00000165,
+0x0004002b,0x00000006,0x0000033a,0x00000158,
+0x0004002b,0x00000006,0x0000033b,0x00000159,
+0x0004002b,0x00000006,0x0000033c,0x0000015a,
+0x0004002b,0x00000006,0x0000033d,0x00000166,
+0x0004002b,0x00000006,0x0000033e,0x00000294,
+0x0004002b,0x00000006,0x0000033f,0x00000295,
+0x0004002b,0x00000006,0x00000340,0x00000296,
+0x0004002b,0x00000006,0x00000341,0x000002a5,
+0x0004002b,0x00000006,0x00000342,0x00000180,
+0x0004002b,0x00000006,0x00000343,0x00000181,
+0x0004002b,0x00000006,0x00000344,0x00000182,
+0x0004002b,0x00000006,0x00000345,0x000001a0,
+0x0004002b,0x00000006,0x00000346,0x00000184,
+0x0004002b,0x00000006,0x00000347,0x00000185,
+0x0004002b,0x00000006,0x00000348,0x00000186,
+0x0004002b,0x00000006,0x00000349,0x000001a1,
+0x0004002b,0x00000006,0x0000034a,0x00000188,
+0x0004002b,0x00000006,0x0000034b,0x00000189,
+0x0004002b,0x00000006,0x0000034c,0x0000018a,
+0x0004002b,0x00000006,0x0000034d,0x000001a2,
+0x0004002b,0x00000006,0x0000034e,0x000001a8,
+0x0004002b,0x00000006,0x0000034f,0x000001a9,
+0x0004002b,0x00000006,0x00000350,0x000001aa,
+0x0004002b,0x00000006,0x00000351,0x00000190,
+0x0004002b,0x00000006,0x00000352,0x00000191,
+0x0004002b,0x00000006,0x00000353,0x00000192,
+0x0004002b,0x00000006,0x00000354,0x000001a4,
+0x0004002b,0x00000006,0x00000355,0x00000194,
+0x0004002b,0x00000006,0x00000356,0x00000195,
+0x0004002b,0x00000006,0x00000357,0x00000196,
+0x0004002b,0x00000006,0x00000358,0x000001a5,
+0x0004002b,0x00000006,0x00000359,0x00000198,
+0x0004002b,0x00000006,0x0000035a,0x00000199,
+0x0004002b,0x00000006,0x0000035b,0x0000019a,
+0x0004002b,0x00000006,0x0000035c,0x000001a6,
+0x0004002b,0x00000006,0x0000035d,0x00000298,
+0x0004002b,0x00000006,0x0000035e,0x00000299,
+0x0004002b,0x00000006,0x0000035f,0x0000029a,
+0x0004002b,0x00000006,0x00000360,0x000002a6,
+0x0004002b,0x00000006,0x00000361,0x00000240,
+0x0004002b,0x00000006,0x00000362,0x00000241,
+0x0004002b,0x00000006,0x00000363,0x00000242,
+0x0004002b,0x00000006,0x00000364,0x00000260,
+0x0004002b,0x00000006,0x00000365,0x00000244,
+0x0004002b,0x00000006,0x00000366,0x00000245,
+0x0004002b,0x00000006,0x00000367,0x00000246,
+0x0004002b,0x00000006,0x00000368,0x00000261,
+0x0004002b,0x00000006,0x00000369,0x00000248,
+0x0004002b,0x00000006,0x0000036a,0x00000249,
+0x0004002b,0x00000006,0x0000036b,0x0000024a,
+0x0004002b,0x00000006,0x0000036c,0x00000262,
+0x0004002b,0x00000006,0x0000036d,0x00000268,
+0x0004002b,0x00000006,0x0000036e,0x00000269,
+0x0004002b,0x00000006,0x0000036f,0x0000026a,
+0x0004002b,0x00000006,0x00000370,0x00000250,
+0x0004002b,0x00000006,0x00000371,0x00000251,
+0x0004002b,0x00000006,0x00000372,0x00000252,
+0x0004002b,0x00000006,0x00000373,0x00000264,
+0x0004002b,0x00000006,0x00000374,0x00000254,
+0x0004002b,0x00000006,0x00000375,0x00000255,
+0x0004002b,0x00000006,0x00000376,0x00000256,
+0x0004002b,0x00000006,0x00000377,0x00000265,
+0x0004002b,0x00000006,0x00000378,0x00000258,
+0x0004002b,0x00000006,0x00000379,0x00000259,
+0x0004002b,0x00000006,0x0000037a,0x0000025a,
+0x0004002b,0x00000006,0x0000037b,0x00000266,
+0x0103002c,0x00000297,0x0000037c,0x0000009d,
+0x000000a0,0x00000092,0x0000019f,0x00000091,
+0x00000095,0x000000f5,0x00000298,0x0000008d,
+0x00000299,0x00000101,0x0000029a,0x0000029b,
+0x0000029c,0x0000029d,0x0000029a,0x0000014c,
+0x0000029e,0x0000029f,0x000002a0,0x000002a1,
+0x000002a2,0x000002a3,0x000002a4,0x00000175,
+0x000002a5,0x000002a6,0x000002a7,0x000002a8,
+0x000002a9,0x000002aa,0x000002ab,0x0000017c,
+0x000002ac,0x000002ad,0x00000178,0x000002ae,
+0x000002af,0x000002b0,0x000002b1,0x000002b2,
+0x000002b3,0x000002b4,0x000002b5,0x000002b6,
+0x000002b7,0x000002b8,0x000002b5,0x000002b9,
+0x000002ba,0x000002bb,0x000002bc,0x000002bd,
+0x000002be,0x000002bf,0x000002c0,0x000002c1,
+0x000002c2,0x000002c3,0x000002c4,0x000002c5,
+0x000002c6,0x000002c7,0x000002c8,0x000001dc,
+0x000002c9,0x000002ca,0x000002cb,0x000002cc,
+0x000002cd,0x000002ce,0x000002cf,0x000002d0,
+0x000002d1,0x000002d2,0x000002d3,0x000002d4,
+0x000002d5,0x000002d6,0x000002d3,0x000002d7,
+0x000002d8,0x000002d9,0x000002da,0x000002db,
+0x000002dc,0x000002dd,0x000002de,0x000002df,
+0x000002e0,0x000002e1,0x000002e2,0x000002e3,
+0x000002e4,0x000002e5,0x000002e6,0x000002e7,
+0x000002e8,0x000002e9,0x000002ea,0x000002eb,
+0x000002ec,0x000002ed,0x000002ee,0x000002ef,
+0x000002f0,0x000002f1,0x000002f2,0x000002f3,
+0x000002f4,0x000002f5,0x000002f2,0x000002f6,
+0x000002f7,0x000002f8,0x000002f9,0x000002fa,
+0x000002fb,0x000002fc,0x000002fd,0x000002fe,
+0x000002ff,0x00000300,0x00000301,0x00000302,
+0x00000303,0x00000304,0x000002e6,0x00000296,
+0x00000305,0x00000306,0x00000307,0x00000308,
+0x00000309,0x0000030a,0x0000030b,0x0000030c,
+0x0000030d,0x0000030e,0x0000030f,0x00000310,
+0x00000311,0x00000312,0x0000030f,0x00000313,
+0x00000314,0x00000315,0x00000316,0x00000317,
+0x00000318,0x00000319,0x0000031a,0x0000031b,
+0x0000031c,0x0000031d,0x0000031e,0x0000031f,
+0x00000320,0x00000321,0x00000322,0x00000323,
+0x00000324,0x00000325,0x00000326,0x00000327,
+0x00000328,0x00000329,0x0000032a,0x0000032b,
+0x0000032c,0x0000032d,0x0000032e,0x0000032f,
+0x00000330,0x00000331,0x0000032e,0x00000332,
+0x00000333,0x00000334,0x00000335,0x00000336,
+0x00000337,0x00000338,0x00000339,0x0000033a,
+0x0000033b,0x0000033c,0x0000033d,0x0000033e,
+0x0000033f,0x00000340,0x00000341,0x00000342,
+0x00000343,0x00000344,0x00000345,0x00000346,
+0x00000347,0x00000348,0x00000349,0x0000034a,
+0x0000034b,0x0000034c,0x0000034d,0x0000034e,
+0x0000034f,0x00000350,0x0000034d,0x00000351,
+0x00000352,0x00000353,0x00000354,0x00000355,
+0x00000356,0x00000357,0x00000358,0x00000359,
+0x0000035a,0x0000035b,0x0000035c,0x0000035d,
+0x0000035e,0x0000035f,0x00000360,0x00000361,
+0x00000362,0x00000363,0x00000364,0x00000365,
+0x00000366,0x00000367,0x00000368,0x00000369,
+0x0000036a,0x0000036b,0x0000036c,0x0000036d,
+0x0000036e,0x0000036f,0x0000036c,0x00000370,
+0x00000371,0x00000372,0x00000373,0x00000374,
+0x00000375,0x00000376,0x00000377,0x00000378,
+0x00000379,0x0000037a,0x0000037b,0x00000302,
+0x00000303,0x00000304,0x00000360,0x00040020,
+0x0000037e,0x00000007,0x00000297,0x0006002c,
+0x0000005d,0x000003b2,0x000000b8,0x0000015d,
+0x000000c8,0x0004001c,0x000003b9,0x00000006,
+0x000001dc,0x0004002b,0x00000006,0x000003ba,
+0x0000000b,0x0004002b,0x00000006,0x000003bb,
+0x00000013,0x0004002b,0x00000006,0x000003bc,
+0x0000001b,0x0004002b,0x00000006,0x000003bd,
+0x0000001c,0x0004002b,0x00000006,0x000003be,
+0x00000023,0x0004002b,0x00000006,0x000003bf,
+0x000000e4,0x0004002b,0x00000006,0x000003c0,
+0x00000043,0x0004002b,0x00000006,0x000003c1,
+0x0000004b,0x0004002b,0x00000006,0x000003c2,
+0x0000004c,0x0004002b,0x00000006,0x000003c3,
+0x0000010c,0x0004002b,0x00000006,0x000003c4,
+0x00000053,0x0004002b,0x00000006,0x000003c5,
+0x0000005b,0x0004002b,0x00000006,0x000003c6,
+0x0000005c,0x0004002b,0x00000006,0x000003c7,
+0x00000063,0x0004002b,0x00000006,0x000003c8,
+0x0000011c,0x0004002b,0x00000006,0x000003c9,
+0x00000123,0x0004002b,0x00000006,0x000003ca,
+0x00000083,0x0004002b,0x00000006,0x000003cb,
+0x00000103,0x0004002b,0x00000006,0x000003cc,
+0x0000008b,0x0004002b,0x00000006,0x000003cd,
+0x0000008c,0x0004002b,0x00000006,0x000003ce,
+0x0000010b,0x0004002b,0x00000006,0x000003cf,
+0x00000093,0x0004002b,0x00000006,0x000003d0,
+0x00000113,0x0004002b,0x00000006,0x000003d1,
+0x0000009b,0x0004002b,0x00000006,0x000003d2,
+0x0000009c,0x0004002b,0x00000006,0x000003d3,
+0x000000a3,0x0004002b,0x00000006,0x000003d4,
+0x0000011b,0x0004002b,0x00000006,0x000003d5,
+0x000000c0,0x0004002b,0x00000006,0x000003d6,
+0x000000c1,0x0004002b,0x00000006,0x000003d7,
+0x000000c2,0x0004002b,0x00000006,0x000003d8,
+0x000000c3,0x0004002b,0x00000006,0x000003d9,
+0x000000c4,0x0004002b,0x00000006,0x000003da,
+0x000000e0,0x0004002b,0x00000006,0x000003db,
+0x000000c8,0x0004002b,0x00000006,0x000003dc,
+0x000000c9,0x0004002b,0x00000006,0x000003dd,
+0x000000ca,0x0004002b,0x00000006,0x000003de,
+0x000000cb,0x0004002b,0x00000006,0x000003df,
+0x000000cc,0x0004002b,0x00000006,0x000003e0,
+0x000000e1,0x0004002b,0x00000006,0x000003e1,
+0x000000d0,0x0004002b,0x00000006,0x000003e2,
+0x000000d1,0x0004002b,0x00000006,0x000003e3,
+0x000000d2,0x0004002b,0x00000006,0x000003e4,
+0x000000d3,0x0004002b,0x00000006,0x000003e5,
+0x000000d4,0x0004002b,0x00000006,0x000003e6,
+0x000000e2,0x0004002b,0x00000006,0x000003e7,
+0x000000d8,0x0004002b,0x00000006,0x000003e8,
+0x000000d9,0x0004002b,0x00000006,0x000003e9,
+0x000000da,0x0004002b,0x00000006,0x000003ea,
+0x000000db,0x0004002b,0x00000006,0x000003eb,
+0x000000dc,0x0004002b,0x00000006,0x000003ec,
+0x000000e3,0x0083002c,0x000003b9,0x000003ed,
+0x0000009d,0x000000a0,0x00000092,0x00000096,
+0x00000091,0x0000019f,0x000002a0,0x00000316,
+0x0000008d,0x00000299,0x00000101,0x000003ba,
+0x000000eb,0x00000298,0x000002bc,0x00000316,
+0x0000014c,0x0000029e,0x0000029f,0x000003bb,
+0x000002a1,0x0000029a,0x000002da,0x00000316,
+0x00000175,0x000002a5,0x000002a6,0x000003bc,
+0x000003bd,0x000003be,0x000003bf,0x00000316,
+0x0000017c,0x000002ac,0x000002ad,0x000003c0,
+0x000002ae,0x00000178,0x00000308,0x00000307,
+0x000002b2,0x000002b3,0x000002b4,0x000003c1,
+0x000003c2,0x000002b1,0x000003c3,0x0000030b,
+0x000002b9,0x000002ba,0x000002bb,0x000003c4,
+0x000002bd,0x000002b5,0x00000317,0x0000030f,
+0x000002c1,0x000002c2,0x000002c3,0x000003c5,
+0x000003c6,0x000003c7,0x000003c8,0x000003c9,
+0x000001dc,0x000002c9,0x000002ca,0x000003ca,
+0x000002cc,0x000002cb,0x00000306,0x000003cb,
+0x000002d0,0x000002d1,0x000002d2,0x000003cc,
+0x000003cd,0x000002cf,0x0000030e,0x000003ce,
+0x000002d7,0x000002d8,0x000002d9,0x000003cf,
+0x000002db,0x000002d3,0x00000315,0x000003d0,
+0x000002df,0x000002e0,0x000002e1,0x000003d1,
+0x000003d2,0x000003d3,0x0000031d,0x000003d4,
+0x000003d5,0x000003d6,0x000003d7,0x000003d8,
+0x000003d9,0x000003da,0x00000296,0x00000305,
+0x000003db,0x000003dc,0x000003dd,0x000003de,
+0x000003df,0x000003e0,0x0000030c,0x0000030d,
+0x000003e1,0x000003e2,0x000003e3,0x000003e4,
+0x000003e5,0x000003e6,0x00000313,0x00000314,
+0x000003e7,0x000003e8,0x000003e9,0x000003ea,
+0x000003eb,0x000003ec,0x0000031b,0x0000031c,
+0x00040020,0x000003ef,0x00000007,0x000003b9,
+0x0004002b,0x00000006,0x0000041e,0x0000002d,
+0x0004001c,0x0000041f,0x00000006,0x0000041e,
+0x0004002b,0x00000006,0x00000420,0x00000034,
+0x0004002b,0x00000006,0x00000421,0x00000027,
+0x0004002b,0x00000006,0x00000422,0x0000002f,
+0x0004002b,0x00000006,0x00000423,0x0000003b,
+0x0004002b,0x00000006,0x00000424,0x00000017,
+0x0004002b,0x00000006,0x00000425,0x00000035,
+0x0004002b,0x00000006,0x00000426,0x00000038,
+0x0004002b,0x00000006,0x00000427,0x00000030,
+0x0004002b,0x00000006,0x00000428,0x0000003e,
+0x0004002b,0x00000006,0x00000429,0x0000000d,
+0x0004002b,0x00000006,0x0000042a,0x00000033,
+0x0004002b,0x00000006,0x0000042b,0x0000001e,
+0x0030002c,0x0000041f,0x0000042c,0x0000009d,
+0x0000019f,0x0000017c,0x0000009d,0x0000017c,
+0x000000eb,0x00000420,0x000002a5,0x00000421,
+0x0000009d,0x0000017c,0x0000029e,0x00000422,
+0x00000095,0x00000423,0x00000424,0x0000029c,
+0x000003ba,0x00000425,0x000003bd,0x000002a0,
+0x0000009d,0x0000017c,0x0000008d,0x00000426,
+0x0000014c,0x00000427,0x00000175,0x0000029b,
+0x00000092,0x00000428,0x000003ba,0x00000425,
+0x000003bb,0x0000041e,0x000003bc,0x000002a4,
+0x00000095,0x00000423,0x00000429,0x0000042a,
+0x000002a3,0x0000029d,0x0000042b,0x0000029a,
+0x00040020,0x00000434,0x00000007,0x0000041f,
+0x0004001c,0x00000451,0x00000006,0x000003be,
+0x0004002b,0x00000006,0x00000452,0x00000039,
+0x0004002b,0x00000006,0x00000453,0x0000000e,
+0x0004002b,0x00000006,0x00000454,0x00000032,
+0x0004002b,0x00000006,0x00000455,0x0000002b,
+0x0004002b,0x00000006,0x00000456,0x0000003d,
+0x0004002b,0x00000006,0x00000457,0x0000003a,
+0x0004002b,0x00000006,0x00000458,0x00000037,
+0x0004002b,0x00000006,0x00000459,0x0000001d,
+0x0026002c,0x00000451,0x0000045a,0x0000009d,
+0x0000014c,0x0000019f,0x00000427,0x0000017c,
+0x0000009d,0x0000017c,0x0000008e,0x00000452,
+0x00000453,0x00000454,0x000002a2,0x00000455,
+0x000003bd,0x000002a0,0x0000009d,0x0000017c,
+0x0000014c,0x00000427,0x00000096,0x00000456,
+0x000003bb,0x0000041e,0x000000f5,0x00000457,
+0x00000424,0x0000029c,0x00000299,0x00000458,
+0x000002a6,0x000002a7,0x00000429,0x0000042a,
+0x00000459,0x000003be,0x00040020,0x00000462,
+0x00000007,0x00000451,0x0004001c,0x00000475,
+0x00000034,0x000000f5,0x0004002b,0x00000006,
+0x00000476,0x0000003f,0x0005002c,0x00000034,
+0x00000477,0x00000476,0x0000008d,0x0005002c,
+0x00000034,0x00000478,0x000002a2,0x0000008d,
+0x0005002c,0x00000034,0x00000479,0x00000299,
+0x0000008d,0x0005002c,0x00000034,0x0000047a,
+0x00000092,0x00000091,0x0005002c,0x00000034,
+0x0000047b,0x000000a0,0x0000008d,0x0009002c,
+0x00000475,0x0000047c,0x00000477,0x00000478,
+0x00000479,0x00000093,0x0000047a,0x0000047b,
+0x00040020,0x0000047f,0x00000007,0x00000475,
+0x00030016,0x000004e9,0x00000020,0x00040017,
+0x000004ea,0x000004e9,0x00000004,0x0004002b,
+0x000004e9,0x000004ef,0x41000000,0x0004002b,
+0x00000006,0x000004f6,0x00000400,0x0004002b,
+0x00000056,0x0000050d,0x00000006,0x00040017,
+0x0000050e,0x00000056,0x00000002,0x0004002b,
+0x00000006,0x00000517,0x0000000f,0x0005002c,
+0x00000034,0x00000526,0x0000009d,0x0000009d,
+0x0004002b,0x00000056,0x00000552,0x0000000f,
+0x0004002b,0x00000056,0x00000557,0x00000011,
+0x0004002b,0x00000056,0x00000568,0x00000010,
+0x00040020,0x00000584,0x00000009,0x00000006,
+0x0004002b,0x00000056,0x0000059c,0x00000008,
+0x0004002b,0x00000056,0x0000059f,0x0000000c,
+0x0004002b,0x00000056,0x000005a6,0x00000014,
+0x0004002b,0x00000056,0x000005a9,0x00000018,
+0x0004002b,0x00000056,0x000005ac,0x0000001c,
+0x00040017,0x000005d6,0x000004e9,0x00000002,
+0x0007002c,0x00000011,0x000005f4,0x00000453,
+0x00000101,0x000000f5,0x00000092,0x0007002c,
+0x00000011,0x000005f7,0x00000476,0x00000476,
+0x00000476,0x00000476,0x00040017,0x0000060d,
+0x00000083,0x00000003,0x0004001c,0x00000633,
+0x00000008,0x000003bb,0x0006002c,0x00000008,
+0x00000634,0x0000009d,0x0000009d,0x0000008d,
+0x0006002c,0x00000008,0x00000635,0x000000a0,
+0x0000009d,0x000000f5,0x0006002c,0x00000008,
+0x00000636,0x0000009d,0x000000a0,0x00000095,
+0x0006002c,0x00000008,0x00000637,0x0000009d,
+0x0000009d,0x0000008e,0x0006002c,0x00000008,
+0x00000638,0x000000a0,0x0000009d,0x00000095,
+0x0006002c,0x00000008,0x00000639,0x0000009d,
+0x000000a0,0x00000091,0x0006002c,0x00000008,
+0x0000063a,0x0000009d,0x0000009d,0x000000f5,
+0x0006002c,0x00000008,0x0000063b,0x000000a0,
+0x0000009d,0x00000091,0x0006002c,0x00000008,
+0x0000063c,0x0000009d,0x000000a0,0x00000096,
+0x0016002c,0x00000633,0x0000063d,0x00000634,
+0x00000635,0x00000636,0x00000637,0x00000638,
+0x00000639,0x0000063a,0x0000063b,0x0000063c,
+0x0000015a,0x00000159,0x00000158,0x00000157,
+0x00000156,0x00000155,0x00000154,0x00000153,
+0x00000151,0x0000014f,0x00040020,0x0000063f,
+0x00000007,0x00000633,0x0004002b,0x00000056,
+0x00000674,0x00000080,0x0004002b,0x00000056,
+0x0000067c,0x0000003f,0x0004002b,0x00000006,
+0x00000692,0x000000ff,0x0004002b,0x00000056,
+0x000006a5,0x000000c0,0x0004002b,0x00000056,
+0x000006ae,0x000000ff,0x0004002b,0x00000056,
+0x0000072f,0xffffff80,0x0007002c,0x00000011,
+0x0000075d,0x0000009d,0x0000009d,0x0000009d,
+0x0000009d,0x0004002b,0x00000006,0x0000077b,
+0x0000017d,0x0004001c,0x0000077c,0x00000006,
+0x0000077b,0x0004002b,0x00000006,0x0000077d,
+0x000000ba,0x0004002b,0x00000006,0x0000077e,
+0x000000e8,0x0004002b,0x00000006,0x0000077f,
+0x0000002e,0x0004002b,0x00000006,0x00000780,
+0x00000074,0x0004002b,0x00000006,0x00000781,
+0x000000de,0x0004002b,0x00000006,0x00000782,
+0x000000bd,0x0004002b,0x00000006,0x00000783,
+0x000000f4,0x0004002b,0x00000006,0x00000784,
+0x0000002c,0x0004002b,0x00000006,0x00000785,
+0x0000004d,0x0004002b,0x00000006,0x00000786,
+0x000000b2,0x0004002b,0x00000006,0x00000787,
+0x0000006e,0x0004002b,0x00000006,0x00000788,
+0x000000e9,0x0004002b,0x00000006,0x00000789,
+0x000000a7,0x0004002b,0x00000006,0x0000078a,
+0x00000079,0x0004002b,0x00000006,0x0000078b,
+0x000000ef,0x0004002b,0x00000006,0x0000078c,
+0x000000df,0x0004002b,0x00000006,0x0000078d,
+0x000000cf,0x0004002b,0x00000006,0x0000078e,
+0x000000be,0x0004002b,0x00000006,0x0000078f,
+0x000000ae,0x0004002b,0x00000006,0x00000790,
+0x0000009e,0x0004002b,0x00000006,0x00000791,
+0x00000071,0x0004002b,0x00000006,0x00000792,
+0x0000008e,0x0004002b,0x00000006,0x00000793,
+0x000000fa,0x0004002b,0x00000006,0x00000794,
+0x000000ea,0x0004002b,0x00000006,0x00000795,
+0x00000036,0x0004002b,0x00000006,0x00000796,
+0x000000b9,0x0004002b,0x00000006,0x00000797,
+0x00000067,0x0004002b,0x00000006,0x00000798,
+0x00000077,0x0004002b,0x00000006,0x00000799,
+0x000000b3,0x0004002b,0x00000006,0x0000079a,
+0x0000006c,0x0004002b,0x00000006,0x0000079b,
+0x0000007c,0x0004002b,0x00000006,0x0000079c,
+0x000000f7,0x0004002b,0x00000006,0x0000079d,
+0x000000e7,0x0004002b,0x00000006,0x0000079e,
+0x000000d7,0x0004002b,0x00000006,0x0000079f,
+0x000000c7,0x0004002b,0x00000006,0x000007a0,
+0x000000bf,0x0004002b,0x00000006,0x000007a1,
+0x000000b7,0x0004002b,0x00000006,0x000007a2,
+0x000000af,0x0004002b,0x00000006,0x000007a3,
+0x0000009f,0x0004002b,0x00000006,0x000007a4,
+0x00000097,0x0004002b,0x00000006,0x000007a5,
+0x00000070,0x0004002b,0x00000006,0x000007a6,
+0x0000008f,0x0004002b,0x00000006,0x000007a7,
+0x00000078,0x0004002b,0x00000006,0x000007a8,
+0x00000087,0x0004002b,0x00000006,0x000007a9,
+0x000000fd,0x0004002b,0x00000006,0x000007aa,
+0x000000f5,0x0004002b,0x00000006,0x000007ab,
+0x000000ed,0x0004002b,0x00000006,0x000007ac,
+0x000000e5,0x0004002b,0x00000006,0x000007ad,
+0x000000bc,0x0004002b,0x00000006,0x000007ae,
+0x000000b4,0x0004002b,0x00000006,0x000007af,
+0x000000ac,0x0004002b,0x00000006,0x000007b0,
+0x0000006b,0x0004002b,0x00000006,0x000007b1,
+0x00000073,0x0004002b,0x00000006,0x000007b2,
+0x0000007b,0x0004002b,0x00000006,0x000007b3,
+0x000000f2,0x0004002b,0x00000006,0x000007b4,
+0x0000004e,0x0004002b,0x00000006,0x000007b5,
+0x000000b1,0x0004002b,0x00000006,0x000007b6,
+0x0000005e,0x0004002b,0x00000006,0x000007b7,
+0x00000076,0x0004002b,0x00000006,0x000007b8,
+0x0000007e,0x0004002b,0x00000006,0x000007b9,
+0x000000fb,0x0004002b,0x00000006,0x000007ba,
+0x000000f3,0x0004002b,0x00000006,0x000007bb,
+0x000000eb,0x0004002b,0x00000006,0x000007bc,
+0x0000003c,0x0004002b,0x00000006,0x000007bd,
+0x000000bb,0x0004002b,0x00000006,0x000007be,
+0x000000ab,0x0004002b,0x00000006,0x000007bf,
+0x000000fe,0x0004002b,0x00000006,0x000007c0,
+0x000000f6,0x0004002b,0x00000006,0x000007c1,
+0x000000ee,0x0004002b,0x00000006,0x000007c2,
+0x000000e6,0x0004002b,0x00000006,0x000007c3,
+0x000000d6,0x0004002b,0x00000006,0x000007c4,
+0x00000031,0x0004002b,0x00000006,0x000007c5,
+0x000000ce,0x0004002b,0x00000006,0x000007c6,
+0x000000c6,0x0004002b,0x00000006,0x000007c7,
+0x000000b6,0x0004002b,0x00000006,0x000007c8,
+0x0000005d,0x0004002b,0x00000006,0x000007c9,
+0x0000006d,0x0004002b,0x00000006,0x000007ca,
+0x00000075,0x0004002b,0x00000006,0x000007cb,
+0x0000007d,0x0004002b,0x00000006,0x000007cc,
+0x000000f9,0x0004002b,0x00000006,0x000007cd,
+0x000000f1,0x0004002b,0x00000006,0x000007ce,
+0x000000dd,0x0004002b,0x00000006,0x000007cf,
+0x000000d5,0x0004002b,0x00000006,0x000007d0,
+0x000000cd,0x0004002b,0x00000006,0x000007d1,
+0x000000c5,0x0004002b,0x00000006,0x000007d2,
+0x000000b5,0x0004002b,0x00000006,0x000007d3,
+0x000000ad,0x0004002b,0x00000006,0x000007d4,
+0x0000009d,0x0004002b,0x00000006,0x000007d5,
+0x00000072,0x0004002b,0x00000006,0x000007d6,
+0x0000008d,0x0004002b,0x00000006,0x000007d7,
+0x0000007a,0x0180002c,0x0000077c,0x000007d8,
+0x0000009d,0x0000009d,0x0000009d,0x0000009d,
+0x00000692,0x0000042a,0x000003df,0x000002c4,
+0x000002e0,0x0000009d,0x00000692,0x000002af,
+0x0000077d,0x00000424,0x0000077e,0x000003c6,
+0x000003d3,0x0000077f,0x000003e2,0x00000780,
+0x000003cc,0x0000009d,0x00000692,0x00000298,
+0x00000781,0x000002ad,0x00000782,0x000003c7,
+0x000003d2,0x000003ba,0x00000783,0x00000784,
+0x000003e4,0x00000785,0x00000786,0x00000787,
+0x000002d8,0x000002a3,0x00000788,0x00000458,
+0x000003db,0x000002c1,0x00000789,0x0000078a,
+0x000002ce,0x0000009d,0x00000692,0x0000014c,
+0x0000078b,0x0000019f,0x0000078c,0x00000427,
+0x0000078d,0x000002ac,0x0000078e,0x000002ba,
+0x0000078f,0x000002b1,0x00000790,0x00000791,
+0x00000792,0x00000095,0x00000793,0x000002a2,
+0x00000794,0x000002a7,0x000003e8,0x00000795,
+0x000003dc,0x000002b0,0x00000796,0x000002bf,
+0x000002d5,0x00000797,0x000002df,0x00000798,
+0x000002d0,0x000003ba,0x00000783,0x000003bc,
+0x000003bf,0x00000455,0x000003e5,0x00000423,
+0x000003d9,0x000003c2,0x00000799,0x000003c6,
+0x000003d3,0x0000079a,0x000003cf,0x0000079b,
+0x000003ca,0x0000009d,0x00000692,0x0000008d,
+0x0000079c,0x0000014c,0x0000078b,0x00000175,
+0x0000079d,0x0000019f,0x0000078c,0x0000029b,
+0x0000079e,0x00000427,0x0000078d,0x00000426,
+0x0000079f,0x0000017c,0x000007a0,0x000002b2,
+0x000007a1,0x000002b9,0x000007a2,0x000002c1,
+0x00000789,0x00000178,0x000007a3,0x000002b6,
+0x000007a4,0x000007a5,0x000007a6,0x000007a7,
+0x000007a8,0x00000092,0x000007a9,0x00000101,
+0x000007aa,0x0000029f,0x000007ab,0x000002a6,
+0x000007ac,0x000003be,0x000003eb,0x00000455,
+0x000003e5,0x0000042a,0x000003df,0x00000423,
+0x000003d9,0x000003c0,0x000007ad,0x000003c1,
+0x000007ae,0x000003c4,0x000007af,0x000003c5,
+0x000002da,0x000003c7,0x000003d2,0x000007b0,
+0x000002db,0x000007b1,0x000003cd,0x000007b2,
+0x000002cc,0x00000095,0x00000793,0x00000429,
+0x000007b3,0x000002a2,0x00000794,0x00000459,
+0x000003e6,0x000002a4,0x000003e9,0x0000041e,
+0x000003e3,0x00000425,0x000003dd,0x00000456,
+0x000003d7,0x000002b0,0x00000796,0x000007b4,
+0x000007b5,0x000002bf,0x000002d5,0x000007b6,
+0x000002cf,0x000002c4,0x000002e0,0x00000787,
+0x000002d8,0x000007b7,0x000002d1,0x000007b8,
+0x000002c9,0x0000009d,0x00000692,0x00000091,
+0x000007b9,0x0000008d,0x0000079c,0x000000eb,
+0x000007ba,0x0000014c,0x0000078b,0x000002a1,
+0x000007bb,0x00000175,0x0000079d,0x000003bd,
+0x000003ec,0x0000019f,0x0000078c,0x000002a0,
+0x000003ea,0x0000029b,0x0000079e,0x00000784,
+0x000003e4,0x00000427,0x0000078d,0x00000420,
+0x000003de,0x00000426,0x0000079f,0x000007bc,
+0x000003d8,0x0000017c,0x000007a0,0x000002ae,
+0x000007bd,0x000002b2,0x000007a1,0x000003c2,
+0x00000799,0x000002b9,0x000007a2,0x000002bd,
+0x000007be,0x000002c1,0x00000789,0x000003c6,
+0x000003d3,0x00000178,0x000007a3,0x000002bc,
+0x000003d1,0x000002b6,0x000007a4,0x0000079a,
+0x000003cf,0x000007a5,0x000007a6,0x00000780,
+0x000003cc,0x000007a7,0x000007a8,0x0000079b,
+0x000003ca,0x000000a0,0x000007bf,0x00000095,
+0x00000793,0x00000299,0x000007c0,0x00000429,
+0x000007b3,0x0000029e,0x000007c1,0x000002a2,
+0x00000794,0x000002a5,0x000007c2,0x00000459,
+0x000003e6,0x00000298,0x00000781,0x000002a4,
+0x000003e9,0x0000029c,0x000007c3,0x0000041e,
+0x000003e3,0x000007c4,0x000007c5,0x00000425,
+0x000003dd,0x00000452,0x000007c6,0x00000456,
+0x000003d7,0x000002ac,0x0000078e,0x000002af,
+0x0000077d,0x000002b3,0x000007c7,0x00000785,
+0x00000786,0x000002ba,0x0000078f,0x000002be,
+0x000002d6,0x000002c2,0x000002e2,0x000007c8,
+0x000002d3,0x000002b1,0x00000790,0x000002c0,
+0x000002e1,0x000002b7,0x000002dd,0x000007c9,
+0x000002d9,0x00000791,0x00000792,0x000007ca,
+0x000002d2,0x0000078a,0x000002ce,0x000007cb,
+0x000002ca,0x00000092,0x000007a9,0x000000f5,
+0x000007cc,0x00000101,0x000007aa,0x00000453,
+0x000007cd,0x0000029f,0x000007ab,0x000002a3,
+0x00000788,0x000002a6,0x000007ac,0x0000042b,
+0x000003e0,0x0000029a,0x000007ce,0x000002a7,
+0x000003e8,0x0000029d,0x000007cf,0x0000077f,
+0x000003e2,0x00000454,0x000007d0,0x00000795,
+0x000003dc,0x00000457,0x000007d1,0x00000428,
+0x000003d6,0x000002ad,0x00000782,0x000002b0,
+0x00000796,0x000002b4,0x000007d2,0x000007b4,
+0x000007b5,0x000002bb,0x000007d3,0x000002bf,
+0x000002d5,0x000002c3,0x000002de,0x000007b6,
+0x000002cf,0x000002b5,0x000007d4,0x000002c4,
+0x000002e0,0x000002b8,0x000002dc,0x00000787,
+0x000002d8,0x000007d5,0x000007d6,0x000007b7,
+0x000002d1,0x000007d7,0x000002cd,0x000007b8,
+0x000002c9,0x00040020,0x000007e0,0x00000007,
+0x0000077c,0x0004002b,0x00000006,0x000007ff,
+0x0000013b,0x0004001c,0x00000800,0x00000006,
+0x000007ff,0x0004002b,0x00000006,0x00000801,
+0x00000047,0x0004002b,0x00000006,0x00000802,
+0x000000b8,0x0004002b,0x00000006,0x00000803,
+0x000000ec,0x0004002b,0x00000006,0x00000804,
+0x000000fc,0x0004002b,0x00000006,0x00000805,
+0x00000057,0x013e002c,0x00000800,0x00000806,
+0x0000009d,0x0000009d,0x0000009d,0x0000009d,
+0x0000009d,0x0000009d,0x00000692,0x000003bd,
+0x000003ec,0x00000426,0x0000079f,0x000002bd,
+0x000007be,0x00000791,0x00000792,0x0000009d,
+0x00000692,0x000003c0,0x000007ad,0x00000429,
+0x000007b3,0x000002b9,0x000007a2,0x000003bc,
+0x000003bf,0x000007b6,0x000002cf,0x0000029b,
+0x0000079e,0x000007b0,0x000002db,0x00000795,
+0x000003dc,0x0000078a,0x000002ce,0x0000009d,
+0x00000692,0x0000019f,0x0000078c,0x000002ac,
+0x0000078e,0x000002b1,0x00000790,0x000000f5,
+0x000007cc,0x00000421,0x000003e7,0x00000801,
+0x00000802,0x000002b6,0x000007a4,0x00000429,
+0x000007b3,0x0000041e,0x000003e3,0x000007b4,
+0x000007b5,0x00000787,0x000002d8,0x000003bb,
+0x00000803,0x00000420,0x000003de,0x000002bd,
+0x000007be,0x000007ca,0x000002d2,0x000002a6,
+0x000007ac,0x00000457,0x000007d1,0x000003c5,
+0x000002da,0x000007b2,0x000002cc,0x0000009d,
+0x00000692,0x0000014c,0x0000078b,0x0000019f,
+0x0000078c,0x00000427,0x0000078d,0x0000017c,
+0x000007a0,0x000002b9,0x000007a2,0x00000178,
+0x000007a3,0x000007a5,0x000007a6,0x00000096,
+0x00000804,0x000003bb,0x00000803,0x000003be,
+0x000003eb,0x0000042a,0x000003df,0x000003c0,
+0x000007ad,0x000003c4,0x000007af,0x000002bc,
+0x000003d1,0x00000780,0x000003cc,0x000000f5,
+0x000007cc,0x000002a3,0x00000788,0x000002a7,
+0x000003e8,0x00000795,0x000003dc,0x00000801,
+0x00000802,0x00000805,0x000002d4,0x00000797,
+0x000002df,0x00000798,0x000002d0,0x00000299,
+0x000007c0,0x000002a5,0x000007c2,0x0000029d,
+0x000007cf,0x00000457,0x000007d1,0x000002b4,
+0x000007d2,0x000002c3,0x000002de,0x000002b8,
+0x000002dc,0x000007d7,0x000002cd,0x00000429,
+0x000007b3,0x00000459,0x000003e6,0x0000041e,
+0x000003e3,0x00000456,0x000003d7,0x00000785,
+0x00000786,0x000007c8,0x000002d3,0x000007c9,
+0x000002d9,0x000007cb,0x000002ca,0x0000009d,
+0x00000692,0x0000008d,0x0000079c,0x0000014c,
+0x0000078b,0x00000175,0x0000079d,0x0000019f,
+0x0000078c,0x0000029b,0x0000079e,0x00000427,
+0x0000078d,0x00000426,0x0000079f,0x0000017c,
+0x000007a0,0x000002b2,0x000007a1,0x000002b9,
+0x000007a2,0x000002c1,0x00000789,0x00000178,
+0x000007a3,0x000002b6,0x000007a4,0x000007a5,
+0x000007a6,0x000007a7,0x000007a8,0x000000a0,
+0x000007bf,0x00000299,0x000007c0,0x0000029e,
+0x000007c1,0x000002a5,0x000007c2,0x00000298,
+0x00000781,0x0000029c,0x000007c3,0x000007c4,
+0x000007c5,0x00000452,0x000007c6,0x000002ac,
+0x0000078e,0x000002b3,0x000007c7,0x000002ba,
+0x0000078f,0x000002c2,0x000002e2,0x000002b1,
+0x00000790,0x000002b7,0x000002dd,0x00000791,
+0x00000792,0x0000078a,0x000002ce,0x00000096,
+0x00000804,0x000003ba,0x00000783,0x000003bb,
+0x00000803,0x000003bc,0x000003bf,0x000003be,
+0x000003eb,0x00000455,0x000003e5,0x0000042a,
+0x000003df,0x00000423,0x000003d9,0x000003c0,
+0x000007ad,0x000003c1,0x000007ae,0x000003c4,
+0x000007af,0x000003c5,0x000002da,0x000003c7,
+0x000003d2,0x000007b0,0x000002db,0x000007b1,
+0x000003cd,0x000007b2,0x000002cc,0x00000091,
+0x000007b9,0x000000eb,0x000007ba,0x000002a1,
+0x000007bb,0x000003bd,0x000003ec,0x000002a0,
+0x000003ea,0x00000784,0x000003e4,0x00000420,
+0x000003de,0x000007bc,0x000003d8,0x000002ae,
+0x000007bd,0x000003c2,0x00000799,0x000002bd,
+0x000007be,0x000003c6,0x000003d3,0x000002bc,
+0x000003d1,0x0000079a,0x000003cf,0x00000780,
+0x000003cc,0x0000079b,0x000003ca,0x000000f5,
+0x000007cc,0x00000453,0x000007cd,0x000002a3,
+0x00000788,0x0000042b,0x000003e0,0x000002a7,
+0x000003e8,0x0000077f,0x000003e2,0x00000795,
+0x000003dc,0x00000428,0x000003d6,0x000002b0,
+0x00000796,0x000007b4,0x000007b5,0x000002bf,
+0x000002d5,0x000007b6,0x000002cf,0x000002c4,
+0x000002e0,0x00000787,0x000002d8,0x000007b7,
+0x000002d1,0x000007b8,0x000002c9,0x00040020,
+0x0000080e,0x00000007,0x00000800,0x0004001c,
+0x00000823,0x00000034,0x0000008d,0x0005002c,
+0x00000034,0x00000824,0x00000692,0x0000008d,
+0x0005002c,0x00000034,0x00000825,0x000002be,
+0x0000008d,0x0005002c,0x00000034,0x00000826,
+0x000002a0,0x000000a0,0x0005002c,0x00000034,
+0x00000827,0x0000029e,0x0000008d,0x0005002c,
+0x00000034,0x00000828,0x0000008d,0x00000092,
+0x0005002c,0x00000034,0x00000829,0x00000091,
+0x00000091,0x0005002c,0x00000034,0x0000082a,
+0x00000092,0x000000f5,0x000b002c,0x00000823,
+0x0000082b,0x00000824,0x00000825,0x00000826,
+0x00000827,0x00000828,0x00000829,0x0000082a,
+0x0000047b,0x00040020,0x0000082e,0x00000007,
+0x00000823,0x0004002b,0x00000056,0x00000840,
+0x00000060,0x0004002b,0x00000056,0x00000841,
+0x00000040,0x0004002b,0x00000056,0x00000842,
+0x00000020,0x0007002c,0x00000057,0x00000843,
+0x00000840,0x00000841,0x00000842,0x000000b8,
+0x0007002c,0x00000011,0x00000847,0x000000a0,
+0x000000a0,0x000000a0,0x000000a0,0x0007002c,
+0x00000057,0x00000849,0x000000b8,0x000000b8,
+0x000000b8,0x000000b8,0x0004002b,0x00000056,
+0x0000084a,0x0000001f,0x0007002c,0x00000057,
+0x0000084b,0x0000084a,0x0000084a,0x0000084a,
+0x0000084a,0x0004002b,0x00000006,0x00000851,
+0xffffffff,0x0007002c,0x00000011,0x00000852,
+0x00000851,0x00000851,0x00000851,0x00000851,
+0x0007002c,0x00000011,0x00000855,0x000001dc,
+0x00000178,0x0000017c,0x0000019f,0x00040017,
+0x00000856,0x00000083,0x00000004,0x0007002c,
+0x00000011,0x0000085f,0x00000692,0x0000009d,
+0x00000692,0x00000692,0x0004002b,0x00000056,
+0x0000089a,0x0000001d,0x0004002b,0x00000056,
+0x0000089e,0xfffffffe,0x00040020,0x0000091b,
+0x00000001,0x00000008,0x0004003b,0x0000091b,
+0x0000091c,0x00000001,0x00040020,0x00000922,
+0x00000001,0x00000006,0x00090019,0x00000930,
+0x00000006,0x00000002,0x00000000,0x00000000,
+0x00000000,0x00000002,0x0000001e,0x00040020,
+0x00000931,0x00000000,0x00000930,0x0004003b,
+0x00000931,0x00000932,0x00000000,0x00090019,
+0x00000942,0x00000006,0x00000002,0x00000000,
+0x00000000,0x00000000,0x00000002,0x00000020,
+0x00040020,0x00000943,0x00000000,0x00000942,
+0x0004003b,0x00000943,0x00000944,0x00000000,
+0x0006002c,0x00000008,0x00000950,0x0000008d,
+0x0000008d,0x000000a0,0x00050036,0x00000002,
+0x00000004,0x00000000,0x00000003,0x000200f8,
+0x00000005,0x0004003b,0x00000035,0x0000091a,
+0x00000007,0x0004003b,0x00000007,0x0000091f,
+0x00000007,0x0004003b,0x00000035,0x00000926,
+0x00000007,0x0004003b,0x00000035,0x0000092b,
+0x00000007,0x0004003b,0x0000005e,0x0000093b,
+0x00000007,0x0004003b,0x00000012,0x0000093f,
+0x00000007,0x0004003b,0x0000005e,0x0000094d,
+0x00000007,0x0003003e,0x00000085,0x00000086,
+0x0004003d,0x00000008,0x0000091d,0x0000091c,
+0x0007004f,0x00000034,0x0000091e,0x0000091d,
+0x0000091d,0x00000000,0x00000001,0x0003003e,
+0x0000091a,0x0000091e,0x00050041,0x00000584,
+0x00000920,0x00000140,0x000000c3,0x0004003d,
+0x00000006,0x00000921,0x00000920,0x00050041,
+0x00000922,0x00000923,0x0000091c,0x00000092,
+0x0004003d,0x00000006,0x00000924,0x00000923,
+0x00050080,0x00000006,0x00000925,0x00000921,
+0x00000924,0x0003003e,0x0000091f,0x00000925,
+0x0004003d,0x00000034,0x00000927,0x0000091a,
+0x00050041,0x00000141,0x00000928,0x00000140,
+0x000000b8,0x0004003d,0x00000034,0x00000929,
+0x00000928,0x00050086,0x00000034,0x0000092a,
+0x00000927,0x00000929,0x0003003e,0x00000926,
+0x0000092a,0x0004003d,0x00000034,0x0000092c,
+0x0000091a,0x00050041,0x00000141,0x0000092d,
+0x00000140,0x000000b8,0x0004003d,0x00000034,
+0x0000092e,0x0000092d,0x00050089,0x00000034,
+0x0000092f,0x0000092c,0x0000092e,0x0003003e,
+0x0000092b,0x0000092f,0x0004003d,0x00000930,
+0x00000933,0x00000932,0x0004003d,0x00000034,
+0x00000934,0x00000926,0x0004007c,0x0000050e,
+0x00000935,0x00000934,0x0004003d,0x00000006,
+0x00000936,0x0000091f,0x0004007c,0x00000056,
+0x00000937,0x00000936,0x00050051,0x00000056,
+0x00000938,0x00000935,0x00000000,0x00050051,
+0x00000056,0x00000939,0x00000935,0x00000001,
+0x00060050,0x0000005d,0x0000093a,0x00000938,
+0x00000939,0x00000937,0x0003003e,0x0000093b,
+0x0000093a,0x00050039,0x0000005d,0x0000093c,
+0x00000081,0x0000093b,0x00050062,0x00000011,
+0x0000093d,0x00000933,0x0000093c,0x0009004f,
+0x00000011,0x0000093e,0x0000093d,0x0000093d,
+0x00000003,0x00000002,0x00000001,0x00000000,
+0x0003003e,0x000000a9,0x0000093e,0x0004003d,
+0x00000034,0x00000940,0x0000092b,0x00050039,
+0x00000011,0x00000941,0x0000007d,0x00000940,
+0x0003003e,0x0000093f,0x00000941,0x0004003d,
+0x00000942,0x00000945,0x00000944,0x0004003d,
+0x00000034,0x00000946,0x0000091a,0x0004007c,
+0x0000050e,0x00000947,0x00000946,0x0004003d,
+0x00000006,0x00000948,0x0000091f,0x0004007c,
+0x00000056,0x00000949,0x00000948,0x00050051,
+0x00000056,0x0000094a,0x00000947,0x00000000,
+0x00050051,0x00000056,0x0000094b,0x00000947,
+0x00000001,0x00060050,0x0000005d,0x0000094c,
+0x0000094a,0x0000094b,0x00000949,0x0003003e,
+0x0000094d,0x0000094c,0x00050039,0x0000005d,
+0x0000094e,0x00000081,0x0000094d,0x0004003d,
+0x00000011,0x0000094f,0x0000093f,0x00040063,
+0x00000945,0x0000094e,0x0000094f,0x000100fd,
+0x00010038,0x00050036,0x00000006,0x0000000d,
+0x00000000,0x0000000a,0x00030037,0x00000007,
+0x0000000b,0x00030037,0x00000009,0x0000000c,
+0x000200f8,0x0000000e,0x0004003b,0x00000035,
+0x00000087,0x00000007,0x0004003d,0x00000006,
+0x00000088,0x0000000b,0x0004003d,0x00000008,
+0x00000089,0x0000000c,0x0007004f,0x00000034,
+0x0000008a,0x00000089,0x00000089,0x00000000,
+0x00000001,0x00050050,0x00000034,0x0000008b,
+0x00000088,0x00000088,0x00050084,0x00000034,
+0x0000008c,0x0000008b,0x0000008a,0x00050084,
+0x00000034,0x00000090,0x0000008c,0x0000008f,
+0x00050080,0x00000034,0x00000094,0x00000090,
+0x00000093,0x00050086,0x00000034,0x00000098,
+0x00000094,0x00000097,0x0003003e,0x00000087,
+0x00000098,0x0004003d,0x00000006,0x00000099,
+0x0000000b,0x00050041,0x00000007,0x0000009a,
+0x0000000c,0x00000092,0x0004003d,0x00000006,
+0x0000009b,0x0000009a,0x00050084,0x00000006,
+0x0000009c,0x00000099,0x0000009b,0x00050041,
+0x00000007,0x0000009e,0x00000087,0x0000009d,
+0x0004003d,0x00000006,0x0000009f,0x0000009e,
+0x00050041,0x00000007,0x000000a1,0x00000087,
+0x000000a0,0x0004003d,0x00000006,0x000000a2,
+0x000000a1,0x00050080,0x00000006,0x000000a3,
+0x0000009f,0x000000a2,0x00050080,0x00000006,
+0x000000a4,0x0000009c,0x000000a3,0x000200fe,
+0x000000a4,0x00010038,0x00050036,0x00000002,
+0x0000000f,0x00000000,0x00000003,0x000200f8,
+0x00000010,0x0004003b,0x00000007,0x000000b5,
+0x00000007,0x0004003b,0x00000007,0x000000bb,
+0x00000007,0x0004003b,0x00000007,0x000000bf,
+0x00000007,0x0004003b,0x00000007,0x000000c5,
+0x00000007,0x0004003b,0x00000007,0x000000ca,
+0x00000007,0x0004003b,0x00000007,0x000000cf,
+0x00000007,0x0004003b,0x00000007,0x000000de,
+0x00000007,0x0004003b,0x00000161,0x00000162,
+0x00000007,0x0004003b,0x00000007,0x0000016f,
+0x00000007,0x0004003b,0x00000009,0x00000171,
+0x00000007,0x00050041,0x000000aa,0x000000ab,
+0x000000a9,0x00000096,0x0004003d,0x00000006,
+0x000000ac,0x000000ab,0x000500c7,0x00000006,
+0x000000ae,0x000000ac,0x000000ad,0x000500aa,
+0x00000083,0x000000b0,0x000000ae,0x000000af,
+0x0003003e,0x000000a7,0x000000b0,0x0004003d,
+0x00000083,0x000000b1,0x000000a7,0x000300f7,
+0x000000b3,0x00000000,0x000400fa,0x000000b1,
+0x000000b2,0x000000b3,0x000200f8,0x000000b2,
+0x000100fd,0x000200f8,0x000000b3,0x00050041,
+0x000000aa,0x000000b6,0x000000a9,0x00000096,
+0x0004003d,0x00000006,0x000000b7,0x000000b6,
+0x000600cb,0x00000006,0x000000ba,0x000000b7,
+0x000000b8,0x000000b9,0x0003003e,0x000000b5,
+0x000000ba,0x00050041,0x000000aa,0x000000bc,
+0x000000a9,0x00000096,0x0004003d,0x00000006,
+0x000000bd,0x000000bc,0x000600cb,0x00000006,
+0x000000be,0x000000bd,0x000000b9,0x000000b9,
+0x0003003e,0x000000bb,0x000000be,0x00050041,
+0x000000aa,0x000000c0,0x000000a9,0x00000096,
+0x0004003d,0x00000006,0x000000c1,0x000000c0,
+0x000600cb,0x00000006,0x000000c4,0x000000c1,
+0x000000c2,0x000000c3,0x0003003e,0x000000bf,
+0x000000c4,0x00050041,0x000000aa,0x000000c6,
+0x000000a9,0x00000096,0x0004003d,0x00000006,
+0x000000c7,0x000000c6,0x000600cb,0x00000006,
+0x000000c9,0x000000c7,0x000000c8,0x000000b9,
+0x0003003e,0x000000c5,0x000000c9,0x00050041,
+0x000000aa,0x000000cb,0x000000a9,0x00000096,
+0x0004003d,0x00000006,0x000000cc,0x000000cb,
+0x000600cb,0x00000006,0x000000ce,0x000000cc,
+0x000000cd,0x000000b9,0x0003003e,0x000000ca,
+0x000000ce,0x00050041,0x000000aa,0x000000d0,
+0x000000a9,0x00000096,0x0004003d,0x00000006,
+0x000000d1,0x000000d0,0x000600cb,0x00000006,
+0x000000d3,0x000000d1,0x000000d2,0x000000c3,
+0x0003003e,0x000000cf,0x000000d3,0x00050041,
+0x000000aa,0x000000d5,0x000000a9,0x00000096,
+0x0004003d,0x00000006,0x000000d6,0x000000d5,
+0x000600cb,0x00000006,0x000000d8,0x000000d6,
+0x000000d7,0x000000c3,0x000500ab,0x00000083,
+0x000000d9,0x000000d8,0x0000009d,0x0003003e,
+0x000000d4,0x000000d9,0x0004003d,0x00000006,
+0x000000da,0x000000b5,0x000500aa,0x00000083,
+0x000000db,0x000000da,0x0000009d,0x000300f7,
+0x000000dd,0x00000000,0x000400fa,0x000000db,
+0x000000dc,0x0000010d,0x000200f8,0x000000dc,
+0x0004003d,0x00000006,0x000000df,0x000000bb,
+0x000500c4,0x00000006,0x000000e0,0x000000df,
+0x000000c3,0x0004003d,0x00000006,0x000000e1,
+0x000000bf,0x000500c5,0x00000006,0x000000e2,
+0x000000e0,0x000000e1,0x0003003e,0x000000de,
+0x000000e2,0x0004003d,0x00000006,0x000000e3,
+0x000000ca,0x000300f7,0x000000e8,0x00000000,
+0x000b00fb,0x000000e3,0x000000e8,0x00000000,
+0x000000e4,0x00000001,0x000000e5,0x00000002,
+0x000000e6,0x00000003,0x000000e7,0x000200f8,
+0x000000e4,0x0004003d,0x00000006,0x000000ec,
+0x000000c5,0x00050080,0x00000006,0x000000ed,
+0x000000ec,0x00000092,0x00050050,0x00000034,
+0x000000ee,0x000000eb,0x000000ed,0x0003003e,
+0x000000ea,0x000000ee,0x000200f9,0x000000e8,
+0x000200f8,0x000000e5,0x0004003d,0x00000006,
+0x000000f0,0x000000c5,0x00050080,0x00000006,
+0x000000f1,0x000000f0,0x00000092,0x00050050,
+0x00000034,0x000000f2,0x000000f1,0x000000eb,
+0x0003003e,0x000000ea,0x000000f2,0x000200f9,
+0x000000e8,0x000200f8,0x000000e6,0x0004003d,
+0x00000006,0x000000f4,0x000000c5,0x00050080,
+0x00000006,0x000000f6,0x000000f4,0x000000f5,
+0x00050041,0x000000aa,0x000000f7,0x000000a9,
+0x00000096,0x0004003d,0x00000006,0x000000f8,
+0x000000f7,0x000600cb,0x00000006,0x000000f9,
+0x000000f8,0x000000d2,0x000000b9,0x00050080,
+0x00000006,0x000000fa,0x000000f9,0x000000f5,
+0x00050050,0x00000034,0x000000fb,0x000000f6,
+0x000000fa,0x0003003e,0x000000ea,0x000000fb,
+0x0003003e,0x000000d4,0x00000086,0x0003003e,
+0x000000cf,0x0000009d,0x000200f9,0x000000e8,
+0x000200f8,0x000000e7,0x0004003d,0x00000006,
+0x000000fd,0x000000c5,0x000500aa,0x00000083,
+0x000000fe,0x000000fd,0x0000009d,0x000300f7,
+0x00000100,0x00000000,0x000400fa,0x000000fe,
+0x000000ff,0x00000103,0x000200f8,0x000000ff,
+0x0003003e,0x000000ea,0x00000102,0x000200f9,
+0x00000100,0x000200f8,0x00000103,0x0004003d,
+0x00000006,0x00000104,0x000000c5,0x000500aa,
+0x00000083,0x00000105,0x00000104,0x000000a0,
+0x000300f7,0x00000107,0x00000000,0x000400fa,
+0x00000105,0x00000106,0x00000109,0x000200f8,
+0x00000106,0x0003003e,0x000000ea,0x00000108,
+0x000200f9,0x00000107,0x000200f8,0x00000109,
+0x0003003e,0x00000085,0x0000010a,0x000100fd,
+0x000200f8,0x00000107,0x000200f9,0x00000100,
+0x000200f8,0x00000100,0x000200f9,0x000000e8,
+0x000200f8,0x000000e8,0x000200f9,0x000000dd,
+0x000200f8,0x0000010d,0x0004003d,0x00000006,
+0x0000010e,0x000000b5,0x000500c4,0x00000006,
+0x0000010f,0x0000010e,0x000000c3,0x0004003d,
+0x00000006,0x00000110,0x000000bf,0x000500c5,
+0x00000006,0x00000111,0x0000010f,0x00000110,
+0x0003003e,0x000000de,0x00000111,0x0004003d,
+0x00000006,0x00000112,0x000000bb,0x000300f7,
+0x00000117,0x00000000,0x000b00fb,0x00000112,
+0x00000117,0x00000000,0x00000113,0x00000001,
+0x00000114,0x00000002,0x00000115,0x00000003,
+0x00000116,0x000200f8,0x00000113,0x0004003d,
+0x00000006,0x00000118,0x000000ca,0x00050080,
+0x00000006,0x00000119,0x00000118,0x00000091,
+0x0004003d,0x00000006,0x0000011a,0x000000c5,
+0x00050080,0x00000006,0x0000011b,0x0000011a,
+0x00000092,0x00050050,0x00000034,0x0000011c,
+0x00000119,0x0000011b,0x0003003e,0x000000ea,
+0x0000011c,0x000200f9,0x00000117,0x000200f8,
+0x00000114,0x0004003d,0x00000006,0x0000011e,
+0x000000ca,0x00050080,0x00000006,0x0000011f,
+0x0000011e,0x0000008d,0x0004003d,0x00000006,
+0x00000120,0x000000c5,0x00050080,0x00000006,
+0x00000121,0x00000120,0x00000092,0x00050050,
+0x00000034,0x00000122,0x0000011f,0x00000121,
+0x0003003e,0x000000ea,0x00000122,0x000200f9,
+0x00000117,0x000200f8,0x00000115,0x0004003d,
+0x00000006,0x00000124,0x000000c5,0x00050080,
+0x00000006,0x00000125,0x00000124,0x00000092,
+0x0004003d,0x00000006,0x00000126,0x000000ca,
+0x00050080,0x00000006,0x00000127,0x00000126,
+0x0000008d,0x00050050,0x00000034,0x00000128,
+0x00000125,0x00000127,0x0003003e,0x000000ea,
+0x00000128,0x000200f9,0x00000117,0x000200f8,
+0x00000116,0x0004003d,0x00000006,0x0000012a,
+0x000000ca,0x000500c2,0x00000006,0x0000012b,
+0x0000012a,0x000000c3,0x000500aa,0x00000083,
+0x0000012c,0x0000012b,0x0000009d,0x000300f7,
+0x0000012e,0x00000000,0x000400fa,0x0000012c,
+0x0000012d,0x00000135,0x000200f8,0x0000012d,
+0x0004003d,0x00000006,0x0000012f,0x000000c5,
+0x00050080,0x00000006,0x00000130,0x0000012f,
+0x00000092,0x0004003d,0x00000006,0x00000131,
+0x000000ca,0x000500c7,0x00000006,0x00000132,
+0x00000131,0x000000a0,0x00050080,0x00000006,
+0x00000133,0x00000132,0x000000f5,0x00050050,
+0x00000034,0x00000134,0x00000130,0x00000133,
+0x0003003e,0x000000ea,0x00000134,0x000200f9,
+0x0000012e,0x000200f8,0x00000135,0x0004003d,
+0x00000006,0x00000136,0x000000ca,0x000500c7,
+0x00000006,0x00000137,0x00000136,0x000000a0,
+0x00050080,0x00000006,0x00000138,0x00000137,
+0x00000092,0x0004003d,0x00000006,0x00000139,
+0x000000c5,0x00050080,0x00000006,0x0000013a,
+0x00000139,0x00000092,0x00050050,0x00000034,
+0x0000013b,0x00000138,0x0000013a,0x0003003e,
+0x000000ea,0x0000013b,0x000200f9,0x0000012e,
+0x000200f8,0x0000012e,0x000200f9,0x00000117,
+0x000200f8,0x00000117,0x000200f9,0x000000dd,
+0x000200f8,0x000000dd,0x0004003d,0x00000034,
+0x0000013d,0x000000ea,0x00050041,0x00000141,
+0x00000142,0x00000140,0x000000b8,0x0004003d,
+0x00000034,0x00000143,0x00000142,0x000500ac,
+0x00000144,0x00000145,0x0000013d,0x00000143,
+0x0004009a,0x00000083,0x00000146,0x00000145,
+0x000300f7,0x00000148,0x00000000,0x000400fa,
+0x00000146,0x00000147,0x00000148,0x000200f8,
+0x00000147,0x0003003e,0x00000085,0x0000010a,
+0x000100fd,0x000200f8,0x00000148,0x0004003d,
+0x00000006,0x0000015c,0x000000cf,0x000500c4,
+0x00000006,0x0000015e,0x0000015c,0x0000015d,
+0x0004003d,0x00000006,0x0000015f,0x000000de,
+0x000500c5,0x00000006,0x00000160,0x0000015e,
+0x0000015f,0x0003003e,0x00000162,0x0000015b,
+0x00050041,0x00000009,0x00000163,0x00000162,
+0x00000160,0x0004003d,0x00000008,0x00000164,
+0x00000163,0x0003003e,0x0000014b,0x00000164,
+0x00050041,0x000000aa,0x00000166,0x000000ea,
+0x0000009d,0x0004003d,0x00000006,0x00000167,
+0x00000166,0x00050041,0x000000aa,0x00000168,
+0x000000ea,0x000000a0,0x0004003d,0x00000006,
+0x00000169,0x00000168,0x00050084,0x00000006,
+0x0000016a,0x00000167,0x00000169,0x0004003d,
+0x00000083,0x0000016b,0x000000d4,0x000600a9,
+0x00000056,0x0000016c,0x0000016b,0x000000c3,
+0x000000b8,0x000500c4,0x00000006,0x0000016d,
+0x0000016a,0x0000016c,0x0003003e,0x00000165,
+0x0000016d,0x0004003d,0x00000006,0x00000170,
+0x00000165,0x0003003e,0x0000016f,0x00000170,
+0x0004003d,0x00000008,0x00000172,0x0000014b,
+0x0003003e,0x00000171,0x00000172,0x00060039,
+0x00000006,0x00000173,0x0000000d,0x0000016f,
+0x00000171,0x0003003e,0x0000016e,0x00000173,
+0x0004003d,0x00000006,0x00000174,0x0000016e,
+0x000500b0,0x00000083,0x00000176,0x00000174,
+0x00000175,0x0004003d,0x00000006,0x00000177,
+0x0000016e,0x000500ac,0x00000083,0x00000179,
+0x00000177,0x00000178,0x000500a6,0x00000083,
+0x0000017a,0x00000176,0x00000179,0x0004003d,
+0x00000006,0x0000017b,0x00000165,0x000500ac,
+0x00000083,0x0000017d,0x0000017b,0x0000017c,
+0x000500a6,0x00000083,0x0000017e,0x0000017a,
+0x0000017d,0x000300f7,0x00000180,0x00000000,
+0x000400fa,0x0000017e,0x0000017f,0x00000180,
+0x000200f8,0x0000017f,0x0003003e,0x00000085,
+0x0000010a,0x000100fd,0x000200f8,0x00000180,
+0x00050041,0x000000aa,0x00000183,0x000000a9,
+0x00000096,0x0004003d,0x00000006,0x00000184,
+0x00000183,0x000600cb,0x00000006,0x00000186,
+0x00000184,0x00000185,0x000000b9,0x00050080,
+0x00000006,0x00000187,0x00000186,0x000000a0,
+0x0003003e,0x00000182,0x00000187,0x0004003d,
+0x00000006,0x00000188,0x00000182,0x000500ac,
+0x00000083,0x00000189,0x00000188,0x000000a0,
+0x000300f7,0x0000018b,0x00000000,0x000400fa,
+0x00000189,0x0000018a,0x0000018b,0x000200f8,
+0x0000018a,0x00050041,0x000000aa,0x0000018d,
+0x000000a9,0x00000096,0x0004003d,0x00000006,
+0x0000018e,0x0000018d,0x000600cb,0x00000006,
+0x00000190,0x0000018e,0x0000018f,0x000000d7,
+0x0003003e,0x0000018c,0x00000190,0x000200f9,
+0x0000018b,0x000200f8,0x0000018b,0x0004003d,
+0x00000083,0x00000191,0x000000d4,0x0004003d,
+0x00000006,0x00000192,0x00000182,0x000500aa,
+0x00000083,0x00000193,0x00000192,0x00000091,
+0x000500a7,0x00000083,0x00000194,0x00000191,
+0x00000193,0x000300f7,0x00000196,0x00000000,
+0x000400fa,0x00000194,0x00000195,0x00000196,
+0x000200f8,0x00000195,0x0003003e,0x00000085,
+0x0000010a,0x000100fd,0x000200f8,0x00000196,
+0x000100fd,0x00010038,0x00050036,0x00000006,
+0x00000017,0x00000000,0x00000013,0x00030037,
+0x00000012,0x00000014,0x00030037,0x00000007,
+0x00000015,0x00030037,0x00000007,0x00000016,
+0x000200f8,0x00000018,0x0004003b,0x00000007,
+0x0000019d,0x00000007,0x0004003b,0x00000007,
+0x000001a2,0x00000007,0x0004003b,0x00000007,
+0x000001a9,0x00000007,0x0004003b,0x00000007,
+0x000001bc,0x00000007,0x0004003b,0x00000007,
+0x000001bf,0x00000007,0x0004003b,0x00000007,
+0x000001c8,0x00000007,0x0004003d,0x00000006,
+0x00000198,0x00000016,0x000500aa,0x00000083,
+0x00000199,0x00000198,0x0000009d,0x000300f7,
+0x0000019b,0x00000000,0x000400fa,0x00000199,
+0x0000019a,0x0000019b,0x000200f8,0x0000019a,
+0x000200fe,0x0000009d,0x000200f8,0x0000019b,
+0x0004003d,0x00000006,0x0000019e,0x00000015,
+0x00050086,0x00000006,0x000001a0,0x0000019e,
+0x0000019f,0x00050082,0x00000006,0x000001a1,
+0x00000096,0x000001a0,0x0003003e,0x0000019d,
+0x000001a1,0x0004003d,0x00000006,0x000001a3,
+0x00000015,0x0004003d,0x00000006,0x000001a4,
+0x00000016,0x00050080,0x00000006,0x000001a5,
+0x000001a3,0x000001a4,0x00050082,0x00000006,
+0x000001a6,0x000001a5,0x000000a0,0x00050086,
+0x00000006,0x000001a7,0x000001a6,0x0000019f,
+0x00050082,0x00000006,0x000001a8,0x00000096,
+0x000001a7,0x0003003e,0x000001a2,0x000001a8,
+0x0004003d,0x00000006,0x000001aa,0x00000015,
+0x000500c7,0x00000006,0x000001ac,0x000001aa,
+0x000001ab,0x0003003e,0x000001a9,0x000001ac,
+0x0004003d,0x00000006,0x000001ad,0x0000019d,
+0x0004003d,0x00000006,0x000001ae,0x000001a2,
+0x000500aa,0x00000083,0x000001af,0x000001ad,
+0x000001ae,0x000300f7,0x000001b1,0x00000000,
+0x000400fa,0x000001af,0x000001b0,0x000001bb,
+0x000200f8,0x000001b0,0x0004003d,0x00000006,
+0x000001b2,0x0000019d,0x00050041,0x00000007,
+0x000001b3,0x00000014,0x000001b2,0x0004003d,
+0x00000006,0x000001b4,0x000001b3,0x0004003d,
+0x00000006,0x000001b5,0x000001a9,0x0004007c,
+0x00000056,0x000001b6,0x000001b5,0x0004003d,
+0x00000006,0x000001b7,0x00000016,0x0004007c,
+0x00000056,0x000001b8,0x000001b7,0x000600cb,
+0x00000006,0x000001b9,0x000001b4,0x000001b6,
+0x000001b8,0x000200fe,0x000001b9,0x000200f8,
+0x000001bb,0x0004003d,0x00000006,0x000001bd,
+0x000001a9,0x00050082,0x00000006,0x000001be,
+0x0000019f,0x000001bd,0x0003003e,0x000001bc,
+0x000001be,0x0004003d,0x00000006,0x000001c0,
+0x0000019d,0x00050041,0x00000007,0x000001c1,
+0x00000014,0x000001c0,0x0004003d,0x00000006,
+0x000001c2,0x000001c1,0x0004003d,0x00000006,
+0x000001c3,0x000001a9,0x0004007c,0x00000056,
+0x000001c4,0x000001c3,0x0004003d,0x00000006,
+0x000001c5,0x000001bc,0x0004007c,0x00000056,
+0x000001c6,0x000001c5,0x000600cb,0x00000006,
+0x000001c7,0x000001c2,0x000001c4,0x000001c6,
+0x0003003e,0x000001bf,0x000001c7,0x0004003d,
+0x00000006,0x000001c9,0x000001a2,0x00050041,
+0x00000007,0x000001ca,0x00000014,0x000001c9,
+0x0004003d,0x00000006,0x000001cb,0x000001ca,
+0x0004003d,0x00000006,0x000001cc,0x00000016,
+0x0004003d,0x00000006,0x000001cd,0x000001bc,
+0x00050082,0x00000006,0x000001ce,0x000001cc,
+0x000001cd,0x0004007c,0x00000056,0x000001cf,
+0x000001ce,0x000600cb,0x00000006,0x000001d0,
+0x000001cb,0x000000b8,0x000001cf,0x0003003e,
+0x000001c8,0x000001d0,0x0004003d,0x00000006,
+0x000001d1,0x000001c8,0x0004003d,0x00000006,
+0x000001d2,0x000001bc,0x000500c4,0x00000006,
+0x000001d3,0x000001d1,0x000001d2,0x0004003d,
+0x00000006,0x000001d4,0x000001bf,0x000500c5,
+0x00000006,0x000001d5,0x000001d3,0x000001d4,
+0x000200fe,0x000001d5,0x000200f8,0x000001b1,
+0x000100ff,0x00010038,0x00050036,0x00000006,
+0x0000001e,0x00000000,0x00000019,0x00030037,
+0x00000007,0x0000001a,0x00030037,0x00000007,
+0x0000001b,0x00030037,0x00000007,0x0000001c,
+0x00030037,0x00000007,0x0000001d,0x000200f8,
+0x0000001f,0x0004003b,0x00000007,0x000001df,
+0x00000007,0x0004003b,0x00000007,0x000001ea,
+0x00000007,0x0004003b,0x00000007,0x000001ef,
+0x00000007,0x0004003b,0x00000007,0x000001fa,
+0x00000007,0x0004003b,0x00000007,0x00000208,
+0x00000007,0x0004003b,0x00000007,0x00000210,
+0x00000007,0x0004003b,0x00000012,0x00000211,
+0x00000007,0x0004003b,0x00000007,0x00000213,
+0x00000007,0x0004003b,0x00000007,0x00000215,
+0x00000007,0x0004003b,0x00000007,0x00000218,
+0x00000007,0x0004003b,0x00000007,0x0000021d,
+0x00000007,0x0004003b,0x00000007,0x00000225,
+0x00000007,0x0004003b,0x00000007,0x0000023d,
+0x00000007,0x0004003d,0x00000006,0x000001d8,
+0x00000182,0x000500aa,0x00000083,0x000001d9,
+0x000001d8,0x000000a0,0x000300f7,0x000001db,
+0x00000000,0x000400fa,0x000001d9,0x000001da,
+0x000001e9,0x000200f8,0x000001da,0x0004003d,
+0x00000006,0x000001dd,0x0000016e,0x00050082,
+0x00000006,0x000001de,0x000001dc,0x000001dd,
+0x0003003e,0x0000001b,0x000001de,0x00050041,
+0x000000aa,0x000001e0,0x000000a9,0x00000096,
+0x0004003d,0x00000006,0x000001e1,0x000001e0,
+0x000600cb,0x00000006,0x000001e2,0x000001e1,
+0x0000018f,0x000000c2,0x0003003e,0x000001df,
+0x000001e2,0x0004003d,0x00000006,0x000001e3,
+0x000001df,0x000500c2,0x00000006,0x000001e4,
+0x000001e3,0x000000b9,0x00050084,0x00000006,
+0x000001e5,0x00000092,0x000001e4,0x00050080,
+0x00000006,0x000001e6,0x000001e5,0x00000092,
+0x0003003e,0x0000001c,0x000001e6,0x0003003e,
+0x0000001d,0x0000009d,0x0004003d,0x00000006,
+0x000001e7,0x000001df,0x000200fe,0x000001e7,
+0x000200f8,0x000001e9,0x00050041,0x000000aa,
+0x000001eb,0x000000a9,0x00000096,0x0004003d,
+0x00000006,0x000001ec,0x000001eb,0x000600cb,
+0x00000006,0x000001ee,0x000001ec,0x000001ed,
+0x000000b9,0x0003003e,0x000001ea,0x000001ee,
+0x00050041,0x000000aa,0x000001f0,0x000000a9,
+0x00000096,0x0004003d,0x00000006,0x000001f1,
+0x000001f0,0x000600cb,0x00000006,0x000001f3,
+0x000001f1,0x000001f2,0x000000c2,0x0003003e,
+0x000001ef,0x000001f3,0x0004003d,0x00000006,
+0x000001f4,0x000001ea,0x000500aa,0x00000083,
+0x000001f5,0x000001f4,0x0000009d,0x000300f7,
+0x000001f7,0x00000000,0x000400fa,0x000001f5,
+0x000001f6,0x00000207,0x000200f8,0x000001f6,
+0x0004003d,0x00000006,0x000001f8,0x0000016e,
+0x00050082,0x00000006,0x000001f9,0x000001dc,
+0x000001f8,0x0003003e,0x0000001b,0x000001f9,
+0x0004003d,0x00000006,0x000001fb,0x000001ef,
+0x000500c2,0x00000006,0x000001fc,0x000001fb,
+0x000000b9,0x00050084,0x00000006,0x000001fd,
+0x00000092,0x000001fc,0x00050080,0x00000006,
+0x000001fe,0x000001fd,0x00000092,0x0003003e,
+0x000001fa,0x000001fe,0x0004003d,0x00000006,
+0x000001ff,0x000001fa,0x0004003d,0x00000006,
+0x00000200,0x00000182,0x00050084,0x00000006,
+0x00000201,0x000001ff,0x00000200,0x0003003e,
+0x0000001c,0x00000201,0x0004003d,0x00000006,
+0x00000202,0x000001fa,0x0004003d,0x00000006,
+0x00000203,0x0000001a,0x00050084,0x00000006,
+0x00000204,0x00000202,0x00000203,0x0003003e,
+0x0000001d,0x00000204,0x0004003d,0x00000006,
+0x00000205,0x000001ef,0x000200fe,0x00000205,
+0x000200f8,0x00000207,0x0004003d,0x00000006,
+0x00000209,0x00000182,0x00050084,0x00000006,
+0x0000020a,0x00000096,0x00000209,0x00050082,
+0x00000006,0x0000020b,0x0000020a,0x00000091,
+0x0003003e,0x00000208,0x0000020b,0x0004003d,
+0x00000006,0x0000020c,0x0000016e,0x00050082,
+0x00000006,0x0000020d,0x000001dc,0x0000020c,
+0x0004003d,0x00000006,0x0000020e,0x00000208,
+0x00050082,0x00000006,0x0000020f,0x0000020d,
+0x0000020e,0x0003003e,0x0000001b,0x0000020f,
+0x0004003d,0x00000011,0x00000212,0x000000a9,
+0x0003003e,0x00000211,0x00000212,0x0004003d,
+0x00000006,0x00000214,0x0000001b,0x0003003e,
+0x00000213,0x00000214,0x0004003d,0x00000006,
+0x00000216,0x00000208,0x0003003e,0x00000215,
+0x00000216,0x00070039,0x00000006,0x00000217,
+0x00000017,0x00000211,0x00000213,0x00000215,
+0x0003003e,0x00000210,0x00000217,0x0004003d,
+0x00000006,0x00000219,0x00000210,0x000500c4,
+0x00000006,0x0000021a,0x00000219,0x000000c2,
+0x0004003d,0x00000006,0x0000021b,0x000001ef,
+0x000500c5,0x00000006,0x0000021c,0x0000021a,
+0x0000021b,0x0003003e,0x00000218,0x0000021c,
+0x0004003d,0x00000006,0x0000021e,0x00000218,
+0x0004003d,0x00000006,0x0000021f,0x0000001a,
+0x00050084,0x00000006,0x00000220,0x00000092,
+0x0000021f,0x0004003d,0x00000006,0x00000221,
+0x00000182,0x00050080,0x00000006,0x00000222,
+0x00000220,0x00000221,0x0004007c,0x00000056,
+0x00000223,0x00000222,0x000600cb,0x00000006,
+0x00000224,0x0000021e,0x00000223,0x000000b9,
+0x0003003e,0x0000021d,0x00000224,0x0004003d,
+0x00000006,0x00000226,0x00000218,0x0004003d,
+0x00000006,0x00000227,0x00000182,0x0004007c,
+0x00000056,0x00000228,0x00000227,0x000600cb,
+0x00000006,0x00000229,0x00000226,0x000000b8,
+0x00000228,0x0003003e,0x00000225,0x00000229,
+0x0004003d,0x00000006,0x0000022a,0x000001ea,
+0x0004003d,0x00000006,0x0000022b,0x00000182,
+0x00050084,0x00000006,0x0000022c,0x0000022a,
+0x0000022b,0x0004003d,0x00000006,0x0000022d,
+0x00000225,0x000400cd,0x00000056,0x0000022e,
+0x0000022d,0x0004007c,0x00000006,0x0000022f,
+0x0000022e,0x00050080,0x00000006,0x00000230,
+0x0000022c,0x0000022f,0x00050084,0x00000006,
+0x00000231,0x00000092,0x00000230,0x0003003e,
+0x0000001c,0x00000231,0x0004003d,0x00000006,
+0x00000232,0x000001ea,0x0004003d,0x00000006,
+0x00000233,0x0000001a,0x00050084,0x00000006,
+0x00000234,0x00000232,0x00000233,0x0004003d,
+0x00000006,0x00000235,0x00000225,0x0004003d,
+0x00000006,0x00000236,0x0000001a,0x0004007c,
+0x00000056,0x00000237,0x00000236,0x000600cb,
+0x00000006,0x00000238,0x00000235,0x000000b8,
+0x00000237,0x000400cd,0x00000056,0x00000239,
+0x00000238,0x0004007c,0x00000006,0x0000023a,
+0x00000239,0x00050080,0x00000006,0x0000023b,
+0x00000234,0x0000023a,0x00050084,0x00000006,
+0x0000023c,0x00000092,0x0000023b,0x0003003e,
+0x0000001d,0x0000023c,0x0004003d,0x00000006,
+0x0000023e,0x000001ea,0x00050082,0x00000006,
+0x0000023f,0x0000023e,0x000000a0,0x0004003d,
+0x00000006,0x00000240,0x00000225,0x0004003d,
+0x00000006,0x00000241,0x0000001a,0x0004007c,
+0x00000056,0x00000242,0x00000241,0x000600cb,
+0x00000006,0x00000243,0x00000240,0x00000242,
+0x000000c3,0x00050080,0x00000006,0x00000244,
+0x0000023f,0x00000243,0x0003003e,0x0000023d,
+0x00000244,0x0004003d,0x00000006,0x00000245,
+0x0000023d,0x000500c4,0x00000006,0x00000246,
+0x00000245,0x000000b9,0x0004003d,0x00000006,
+0x00000247,0x0000021d,0x000500c5,0x00000006,
+0x00000248,0x00000246,0x00000247,0x000200fe,
+0x00000248,0x000200f8,0x000001f7,0x000100ff,
+0x000200f8,0x000001db,0x000100ff,0x00010038,
+0x00050036,0x00000006,0x00000025,0x00000000,
+0x00000020,0x00030037,0x00000012,0x00000021,
+0x00030037,0x00000007,0x00000022,0x00030037,
+0x00000007,0x00000023,0x00030037,0x00000007,
+0x00000024,0x000200f8,0x00000026,0x0004003b,
+0x0000024b,0x0000024c,0x00000007,0x0004003b,
+0x00000007,0x0000024f,0x00000007,0x0004003b,
+0x00000012,0x00000256,0x00000007,0x0004003b,
+0x00000007,0x00000258,0x00000007,0x0004003b,
+0x00000007,0x00000259,0x00000007,0x0004003b,
+0x00000007,0x0000025b,0x00000007,0x0004003b,
+0x00000007,0x0000027e,0x00000007,0x0004003b,
+0x00000012,0x0000027f,0x00000007,0x0004003b,
+0x00000007,0x00000281,0x00000007,0x0004003b,
+0x00000007,0x00000283,0x00000007,0x0004003b,
+0x0000024b,0x00000287,0x00000007,0x0004003b,
+0x00000007,0x00000295,0x00000007,0x0004003b,
+0x0000037e,0x0000037f,0x00000007,0x0004003d,
+0x00000006,0x0000024d,0x00000023,0x0004007c,
+0x00000056,0x0000024e,0x0000024d,0x0003003e,
+0x0000024c,0x0000024e,0x0004003d,0x00000006,
+0x00000250,0x00000022,0x0004003d,0x00000006,
+0x00000251,0x00000023,0x00050080,0x00000006,
+0x00000252,0x00000250,0x00000251,0x0004003d,
+0x00000006,0x00000253,0x00000023,0x00050084,
+0x00000006,0x00000254,0x00000091,0x00000253,
+0x00050080,0x00000006,0x00000255,0x00000254,
+0x0000008d,0x0004003d,0x00000011,0x00000257,
+0x00000021,0x0003003e,0x00000256,0x00000257,
+0x0003003e,0x00000258,0x00000252,0x0003003e,
+0x00000259,0x00000255,0x00070039,0x00000006,
+0x0000025a,0x00000017,0x00000256,0x00000258,
+0x00000259,0x0003003e,0x0000024f,0x0000025a,
+0x0004003d,0x00000006,0x0000025c,0x0000024f,
+0x000600cb,0x00000006,0x0000025d,0x0000025c,
+0x000000b8,0x000000b9,0x0004003d,0x00000006,
+0x0000025e,0x0000024f,0x0004003d,0x00000056,
+0x0000025f,0x0000024c,0x00050084,0x00000056,
+0x00000260,0x000000c3,0x0000025f,0x00050080,
+0x00000056,0x00000261,0x00000260,0x000000b9,
+0x000600cb,0x00000006,0x00000262,0x0000025e,
+0x00000261,0x000000b9,0x000500c4,0x00000006,
+0x00000263,0x00000262,0x000000b9,0x000500c5,
+0x00000006,0x00000264,0x0000025d,0x00000263,
+0x0004003d,0x00000006,0x00000265,0x0000024f,
+0x0004003d,0x00000056,0x00000266,0x0000024c,
+0x00050084,0x00000056,0x00000267,0x000000b9,
+0x00000266,0x00050080,0x00000056,0x00000268,
+0x00000267,0x000000c2,0x000600cb,0x00000006,
+0x00000269,0x00000265,0x00000268,0x000000c3,
+0x000500c4,0x00000006,0x0000026a,0x00000269,
+0x000000c2,0x000500c5,0x00000006,0x0000026b,
+0x00000264,0x0000026a,0x0004003d,0x00000006,
+0x0000026c,0x0000024f,0x0004003d,0x00000056,
+0x0000026d,0x0000024c,0x00050084,0x00000056,
+0x0000026e,0x0000015d,0x0000026d,0x00050080,
+0x00000056,0x0000026f,0x0000026e,0x000000c8,
+0x000600cb,0x00000006,0x00000270,0x0000026c,
+0x0000026f,0x000000b9,0x000500c4,0x00000006,
+0x00000271,0x00000270,0x000000c8,0x000500c5,
+0x00000006,0x00000272,0x0000026b,0x00000271,
+0x0004003d,0x00000006,0x00000273,0x0000024f,
+0x0004003d,0x00000056,0x00000274,0x0000024c,
+0x00050084,0x00000056,0x00000275,0x000000c2,
+0x00000274,0x00050080,0x00000056,0x00000276,
+0x00000275,0x000000cd,0x000600cb,0x00000006,
+0x00000277,0x00000273,0x00000276,0x000000c3,
+0x000500c4,0x00000006,0x00000278,0x00000277,
+0x000000cd,0x000500c5,0x00000006,0x00000279,
+0x00000272,0x00000278,0x0003003e,0x0000025b,
+0x00000279,0x0004003d,0x00000006,0x0000027a,
+0x00000024,0x000500aa,0x00000083,0x0000027b,
+0x0000027a,0x0000009d,0x000300f7,0x0000027d,
+0x00000000,0x000400fa,0x0000027b,0x0000027c,
+0x00000286,0x000200f8,0x0000027c,0x0004003d,
+0x00000011,0x00000280,0x00000021,0x0003003e,
+0x0000027f,0x00000280,0x0004003d,0x00000006,
+0x00000282,0x00000022,0x0003003e,0x00000281,
+0x00000282,0x0004003d,0x00000006,0x00000284,
+0x00000023,0x0003003e,0x00000283,0x00000284,
+0x00070039,0x00000006,0x00000285,0x00000017,
+0x0000027f,0x00000281,0x00000283,0x0003003e,
+0x0000027e,0x00000285,0x000200f9,0x0000027d,
+0x000200f8,0x00000286,0x0004003d,0x00000006,
+0x00000288,0x00000024,0x0004007c,0x00000056,
+0x00000289,0x00000288,0x00050082,0x00000056,
+0x0000028a,0x00000289,0x000000c3,0x0003003e,
+0x00000287,0x0000028a,0x0004003d,0x00000006,
+0x0000028b,0x0000024f,0x0004003d,0x00000056,
+0x0000028c,0x00000287,0x0004003d,0x00000056,
+0x0000028d,0x0000024c,0x00050084,0x00000056,
+0x0000028e,0x0000028c,0x0000028d,0x0004003d,
+0x00000056,0x00000290,0x00000287,0x0005004d,
+0x00000056,0x00000291,0x0000028f,0x00000290,
+0x00050080,0x00000056,0x00000292,0x0000028e,
+0x00000291,0x0004003d,0x00000056,0x00000293,
+0x0000024c,0x000600cb,0x00000006,0x00000294,
+0x0000028b,0x00000292,0x00000293,0x0003003e,
+0x0000027e,0x00000294,0x000200f9,0x0000027d,
+0x000200f8,0x0000027d,0x0004003d,0x00000006,
+0x0000037d,0x0000025b,0x0003003e,0x0000037f,
+0x0000037c,0x00050041,0x00000007,0x00000380,
+0x0000037f,0x0000037d,0x0004003d,0x00000006,
+0x00000381,0x00000380,0x0003003e,0x00000295,
+0x00000381,0x0004003d,0x00000006,0x00000382,
+0x00000295,0x0004003d,0x00000006,0x00000383,
+0x00000024,0x0004007c,0x00000056,0x00000384,
+0x00000383,0x00050084,0x00000056,0x00000385,
+0x000000b9,0x00000384,0x000600cb,0x00000006,
+0x00000386,0x00000382,0x00000385,0x000000b9,
+0x0004003d,0x00000006,0x00000387,0x00000023,
+0x000500c4,0x00000006,0x00000388,0x00000386,
+0x00000387,0x0004003d,0x00000006,0x00000389,
+0x0000027e,0x000500c5,0x00000006,0x0000038a,
+0x00000388,0x00000389,0x000200fe,0x0000038a,
+0x00010038,0x00050036,0x00000006,0x0000002b,
+0x00000000,0x00000020,0x00030037,0x00000012,
+0x00000027,0x00030037,0x00000007,0x00000028,
+0x00030037,0x00000007,0x00000029,0x00030037,
+0x00000007,0x0000002a,0x000200f8,0x0000002c,
+0x0004003b,0x0000024b,0x0000038d,0x00000007,
+0x0004003b,0x00000007,0x00000390,0x00000007,
+0x0004003b,0x00000012,0x00000394,0x00000007,
+0x0004003b,0x00000007,0x00000396,0x00000007,
+0x0004003b,0x00000007,0x00000398,0x00000007,
+0x0004003b,0x00000007,0x0000039a,0x00000007,
+0x0004003b,0x00000007,0x000003ac,0x00000007,
+0x0004003b,0x00000007,0x000003b8,0x00000007,
+0x0004003b,0x000003ef,0x000003f0,0x00000007,
+0x0004003d,0x00000006,0x0000038e,0x00000029,
+0x0004007c,0x00000056,0x0000038f,0x0000038e,
+0x0003003e,0x0000038d,0x0000038f,0x0004003d,
+0x00000006,0x00000391,0x00000029,0x00050084,
+0x00000006,0x00000392,0x00000096,0x00000391,
+0x00050080,0x00000006,0x00000393,0x00000392,
+0x0000008e,0x0004003d,0x00000011,0x00000395,
+0x00000027,0x0003003e,0x00000394,0x00000395,
+0x0004003d,0x00000006,0x00000397,0x00000028,
+0x0003003e,0x00000396,0x00000397,0x0003003e,
+0x00000398,0x00000393,0x00070039,0x00000006,
+0x00000399,0x00000017,0x00000394,0x00000396,
+0x00000398,0x0003003e,0x00000390,0x00000399,
+0x0004003d,0x00000006,0x0000039b,0x00000390,
+0x0004003d,0x00000056,0x0000039c,0x0000038d,
+0x000600cb,0x00000006,0x0000039d,0x0000039b,
+0x0000039c,0x0000015d,0x0004003d,0x00000006,
+0x0000039e,0x00000390,0x0004003d,0x00000056,
+0x0000039f,0x0000038d,0x00050084,0x00000056,
+0x000003a0,0x000000b9,0x0000039f,0x00050080,
+0x00000056,0x000003a1,0x000003a0,0x0000015d,
+0x000600cb,0x00000006,0x000003a2,0x0000039e,
+0x000003a1,0x000000b9,0x000500c4,0x00000006,
+0x000003a3,0x000003a2,0x0000015d,0x000500c5,
+0x00000006,0x000003a4,0x0000039d,0x000003a3,
+0x0004003d,0x00000006,0x000003a5,0x00000390,
+0x0004003d,0x00000056,0x000003a6,0x0000038d,
+0x00050084,0x00000056,0x000003a7,0x0000015d,
+0x000003a6,0x00050080,0x00000056,0x000003a8,
+0x000003a7,0x000000c8,0x000600cb,0x00000006,
+0x000003a9,0x000003a5,0x000003a8,0x000000b9,
+0x000500c4,0x00000006,0x000003aa,0x000003a9,
+0x000000c8,0x000500c5,0x00000006,0x000003ab,
+0x000003a4,0x000003aa,0x0003003e,0x0000039a,
+0x000003ab,0x0004003d,0x00000006,0x000003ad,
+0x00000390,0x0004003d,0x00000006,0x000003ae,
+0x0000002a,0x0004007c,0x00000056,0x000003af,
+0x000003ae,0x0004003d,0x00000056,0x000003b0,
+0x0000038d,0x00050084,0x00000056,0x000003b1,
+0x000003af,0x000003b0,0x0004003d,0x00000006,
+0x000003b3,0x0000002a,0x0005004d,0x00000056,
+0x000003b4,0x000003b2,0x000003b3,0x00050080,
+0x00000056,0x000003b5,0x000003b1,0x000003b4,
+0x0004003d,0x00000056,0x000003b6,0x0000038d,
+0x000600cb,0x00000006,0x000003b7,0x000003ad,
+0x000003b5,0x000003b6,0x0003003e,0x000003ac,
+0x000003b7,0x0004003d,0x00000006,0x000003ee,
+0x0000039a,0x0003003e,0x000003f0,0x000003ed,
+0x00050041,0x00000007,0x000003f1,0x000003f0,
+0x000003ee,0x0004003d,0x00000006,0x000003f2,
+0x000003f1,0x0003003e,0x000003b8,0x000003f2,
+0x0004003d,0x00000006,0x000003f3,0x000003b8,
+0x0004003d,0x00000006,0x000003f4,0x0000002a,
+0x0004007c,0x00000056,0x000003f5,0x000003f4,
+0x00050084,0x00000056,0x000003f6,0x0000015d,
+0x000003f5,0x000600cb,0x00000006,0x000003f7,
+0x000003f3,0x000003f6,0x0000015d,0x0004003d,
+0x00000006,0x000003f8,0x00000029,0x000500c4,
+0x00000006,0x000003f9,0x000003f7,0x000003f8,
+0x0004003d,0x00000006,0x000003fa,0x000003ac,
+0x000500c5,0x00000006,0x000003fb,0x000003f9,
+0x000003fa,0x000200fe,0x000003fb,0x00010038,
+0x00050036,0x00000006,0x00000032,0x00000000,
+0x0000002d,0x00030037,0x00000012,0x0000002e,
+0x00030037,0x00000009,0x0000002f,0x00030037,
+0x00000007,0x00000030,0x00030037,0x00000007,
+0x00000031,0x000200f8,0x00000033,0x0004003b,
+0x00000007,0x00000404,0x00000007,0x0004003b,
+0x00000007,0x0000040c,0x00000007,0x0004003b,
+0x00000007,0x00000413,0x00000007,0x0004003b,
+0x00000012,0x00000416,0x00000007,0x0004003b,
+0x00000007,0x00000418,0x00000007,0x0004003b,
+0x00000007,0x0000041a,0x00000007,0x0004003b,
+0x00000007,0x0000041c,0x00000007,0x0004003b,
+0x00000434,0x00000435,0x00000007,0x0004003b,
+0x00000007,0x0000043f,0x00000007,0x0004003b,
+0x00000007,0x00000446,0x00000007,0x0004003b,
+0x00000012,0x00000449,0x00000007,0x0004003b,
+0x00000007,0x0000044b,0x00000007,0x0004003b,
+0x00000007,0x0000044d,0x00000007,0x0004003b,
+0x00000007,0x0000044f,0x00000007,0x0004003b,
+0x00000462,0x00000463,0x00000007,0x0004003b,
+0x00000007,0x00000468,0x00000007,0x0004003b,
+0x00000007,0x0000046c,0x00000007,0x0004003b,
+0x00000012,0x0000046d,0x00000007,0x0004003b,
+0x00000007,0x0000046f,0x00000007,0x0004003b,
+0x00000007,0x00000471,0x00000007,0x0004003b,
+0x00000035,0x00000474,0x00000007,0x0004003b,
+0x0000047f,0x00000480,0x00000007,0x0004003d,
+0x00000006,0x000003fe,0x00000031,0x0004003d,
+0x00000006,0x000003ff,0x00000030,0x000500ae,
+0x00000083,0x00000400,0x000003fe,0x000003ff,
+0x000300f7,0x00000402,0x00000000,0x000400fa,
+0x00000400,0x00000401,0x00000402,0x000200f8,
+0x00000401,0x000200fe,0x0000009d,0x000200f8,
+0x00000402,0x00050041,0x00000007,0x00000405,
+0x0000002f,0x00000092,0x0004003d,0x00000006,
+0x00000406,0x00000405,0x0003003e,0x00000404,
+0x00000406,0x00050041,0x00000007,0x00000407,
+0x0000002f,0x0000009d,0x0004003d,0x00000006,
+0x00000408,0x00000407,0x000500aa,0x00000083,
+0x00000409,0x00000408,0x000000a0,0x000300f7,
+0x0000040b,0x00000000,0x000400fa,0x00000409,
+0x0000040a,0x00000439,0x000200f8,0x0000040a,
+0x0004003d,0x00000006,0x0000040d,0x00000031,
+0x00050086,0x00000006,0x0000040e,0x0000040d,
+0x00000095,0x0004003d,0x00000006,0x0000040f,
+0x00000404,0x00050084,0x00000006,0x00000410,
+0x00000095,0x0000040f,0x00050080,0x00000006,
+0x00000411,0x00000410,0x0000008d,0x00050084,
+0x00000006,0x00000412,0x0000040e,0x00000411,
+0x0003003e,0x0000040c,0x00000412,0x0004003d,
+0x00000006,0x00000414,0x00000031,0x00050089,
+0x00000006,0x00000415,0x00000414,0x00000095,
+0x0004003d,0x00000011,0x00000417,0x0000002e,
+0x0003003e,0x00000416,0x00000417,0x0004003d,
+0x00000006,0x00000419,0x0000040c,0x0003003e,
+0x00000418,0x00000419,0x0004003d,0x00000006,
+0x0000041b,0x00000404,0x0003003e,0x0000041a,
+0x0000041b,0x0003003e,0x0000041c,0x00000415,
+0x00080039,0x00000006,0x0000041d,0x00000025,
+0x00000416,0x00000418,0x0000041a,0x0000041c,
+0x0003003e,0x00000413,0x0000041d,0x0004003d,
+0x00000006,0x0000042d,0x00000404,0x000500c4,
+0x00000056,0x0000042e,0x000000c3,0x0000042d,
+0x00050082,0x00000056,0x0000042f,0x0000042e,
+0x000000c3,0x00050084,0x00000056,0x00000430,
+0x0000015d,0x0000042f,0x0004007c,0x00000006,
+0x00000431,0x00000430,0x0004003d,0x00000006,
+0x00000432,0x00000413,0x00050080,0x00000006,
+0x00000433,0x00000431,0x00000432,0x0003003e,
+0x00000435,0x0000042c,0x00050041,0x00000007,
+0x00000436,0x00000435,0x00000433,0x0004003d,
+0x00000006,0x00000437,0x00000436,0x000200fe,
+0x00000437,0x000200f8,0x00000439,0x00050041,
+0x00000007,0x0000043a,0x0000002f,0x000000a0,
+0x0004003d,0x00000006,0x0000043b,0x0000043a,
+0x000500aa,0x00000083,0x0000043c,0x0000043b,
+0x000000a0,0x000300f7,0x0000043e,0x00000000,
+0x000400fa,0x0000043c,0x0000043d,0x00000467,
+0x000200f8,0x0000043d,0x0004003d,0x00000006,
+0x00000440,0x00000031,0x00050086,0x00000006,
+0x00000441,0x00000440,0x00000096,0x0004003d,
+0x00000006,0x00000442,0x00000404,0x00050084,
+0x00000006,0x00000443,0x00000096,0x00000442,
+0x00050080,0x00000006,0x00000444,0x00000443,
+0x0000008e,0x00050084,0x00000006,0x00000445,
+0x00000441,0x00000444,0x0003003e,0x0000043f,
+0x00000445,0x0004003d,0x00000006,0x00000447,
+0x00000031,0x00050089,0x00000006,0x00000448,
+0x00000447,0x00000096,0x0004003d,0x00000011,
+0x0000044a,0x0000002e,0x0003003e,0x00000449,
+0x0000044a,0x0004003d,0x00000006,0x0000044c,
+0x0000043f,0x0003003e,0x0000044b,0x0000044c,
+0x0004003d,0x00000006,0x0000044e,0x00000404,
+0x0003003e,0x0000044d,0x0000044e,0x0003003e,
+0x0000044f,0x00000448,0x00080039,0x00000006,
+0x00000450,0x0000002b,0x00000449,0x0000044b,
+0x0000044d,0x0000044f,0x0003003e,0x00000446,
+0x00000450,0x0004003d,0x00000006,0x0000045b,
+0x00000404,0x000500c4,0x00000056,0x0000045c,
+0x000000c3,0x0000045b,0x00050082,0x00000056,
+0x0000045d,0x0000045c,0x000000c3,0x00050084,
+0x00000056,0x0000045e,0x000000c8,0x0000045d,
+0x0004007c,0x00000006,0x0000045f,0x0000045e,
+0x0004003d,0x00000006,0x00000460,0x00000446,
+0x00050080,0x00000006,0x00000461,0x0000045f,
+0x00000460,0x0003003e,0x00000463,0x0000045a,
+0x00050041,0x00000007,0x00000464,0x00000463,
+0x00000461,0x0004003d,0x00000006,0x00000465,
+0x00000464,0x000200fe,0x00000465,0x000200f8,
+0x00000467,0x0004003d,0x00000006,0x00000469,
+0x00000031,0x0004003d,0x00000006,0x0000046a,
+0x00000404,0x00050084,0x00000006,0x0000046b,
+0x00000469,0x0000046a,0x0003003e,0x00000468,
+0x0000046b,0x0004003d,0x00000011,0x0000046e,
+0x0000002e,0x0003003e,0x0000046d,0x0000046e,
+0x0004003d,0x00000006,0x00000470,0x00000468,
+0x0003003e,0x0000046f,0x00000470,0x0004003d,
+0x00000006,0x00000472,0x00000404,0x0003003e,
+0x00000471,0x00000472,0x00070039,0x00000006,
+0x00000473,0x00000017,0x0000046d,0x0000046f,
+0x00000471,0x0003003e,0x0000046c,0x00000473,
+0x0004003d,0x00000006,0x0000047d,0x00000404,
+0x00050082,0x00000006,0x0000047e,0x0000047d,
+0x000000a0,0x0003003e,0x00000480,0x0000047c,
+0x00050041,0x00000035,0x00000481,0x00000480,
+0x0000047e,0x0004003d,0x00000034,0x00000482,
+0x00000481,0x0003003e,0x00000474,0x00000482,
+0x0004003d,0x00000006,0x00000483,0x0000046c,
+0x00050041,0x00000007,0x00000484,0x00000474,
+0x0000009d,0x0004003d,0x00000006,0x00000485,
+0x00000484,0x00050084,0x00000006,0x00000486,
+0x00000483,0x00000485,0x0004003d,0x00000006,
+0x00000487,0x0000046c,0x00050041,0x00000007,
+0x00000488,0x00000474,0x000000a0,0x0004003d,
+0x00000006,0x00000489,0x00000488,0x000500c2,
+0x00000006,0x0000048a,0x00000487,0x00000489,
+0x000500c5,0x00000006,0x0000048b,0x00000486,
+0x0000048a,0x0003003e,0x0000046c,0x0000048b,
+0x0004003d,0x00000006,0x0000048c,0x0000046c,
+0x000500ac,0x00000083,0x0000048d,0x0000048c,
+0x0000019f,0x000300f7,0x0000048f,0x00000000,
+0x000400fa,0x0000048d,0x0000048e,0x0000048f,
+0x000200f8,0x0000048e,0x0004003d,0x00000006,
+0x00000490,0x0000046c,0x00050080,0x00000006,
+0x00000491,0x00000490,0x000000a0,0x0003003e,
+0x0000046c,0x00000491,0x000200f9,0x0000048f,
+0x000200f8,0x0000048f,0x0004003d,0x00000006,
+0x00000492,0x0000046c,0x000200fe,0x00000492,
+0x000200f8,0x0000043e,0x000100ff,0x000200f8,
+0x0000040b,0x000100ff,0x00010038,0x00050036,
+0x00000006,0x0000003f,0x00000000,0x00000036,
+0x00030037,0x00000012,0x00000037,0x00030037,
+0x00000009,0x00000038,0x00030037,0x00000007,
+0x00000039,0x00030037,0x00000007,0x0000003a,
+0x00030037,0x00000007,0x0000003b,0x00030037,
+0x00000007,0x0000003c,0x00030037,0x00000007,
+0x0000003d,0x00030037,0x00000035,0x0000003e,
+0x000200f8,0x00000040,0x0004003b,0x00000012,
+0x00000495,0x00000007,0x0004003b,0x00000012,
+0x000004a3,0x00000007,0x0004003b,0x00000012,
+0x000004a4,0x00000007,0x0004003b,0x00000009,
+0x000004a6,0x00000007,0x0004003b,0x00000007,
+0x000004a8,0x00000007,0x0004003b,0x00000007,
+0x000004aa,0x00000007,0x0004003b,0x00000012,
+0x000004ae,0x00000007,0x0004003b,0x00000009,
+0x000004b0,0x00000007,0x0004003b,0x00000007,
+0x000004b2,0x00000007,0x0004003b,0x00000007,
+0x000004b4,0x00000007,0x0004003b,0x00000012,
+0x000004b8,0x00000007,0x0004003b,0x00000009,
+0x000004ba,0x00000007,0x0004003b,0x00000007,
+0x000004bc,0x00000007,0x0004003b,0x00000007,
+0x000004be,0x00000007,0x0004003b,0x00000012,
+0x000004c2,0x00000007,0x0004003b,0x00000009,
+0x000004c4,0x00000007,0x0004003b,0x00000007,
+0x000004c6,0x00000007,0x0004003b,0x00000007,
+0x000004c8,0x00000007,0x0004003b,0x00000007,
+0x000004cd,0x00000007,0x0004003b,0x00000012,
+0x000004d5,0x00000007,0x0004003d,0x00000006,
+0x00000496,0x0000003c,0x0004003d,0x00000006,
+0x00000497,0x0000003a,0x00070050,0x00000011,
+0x00000498,0x00000497,0x00000497,0x00000497,
+0x00000497,0x0004003d,0x00000006,0x00000499,
+0x0000003b,0x0004003d,0x00000006,0x0000049a,
+0x0000003b,0x00050080,0x00000006,0x0000049b,
+0x0000049a,0x000000a0,0x00070050,0x00000011,
+0x0000049c,0x0000009d,0x000000a0,0x00000499,
+0x0000049b,0x00050080,0x00000011,0x0000049d,
+0x00000498,0x0000049c,0x00070050,0x00000011,
+0x0000049e,0x00000496,0x00000496,0x00000496,
+0x00000496,0x00050084,0x00000011,0x0000049f,
+0x0000049e,0x0000049d,0x0004003d,0x00000006,
+0x000004a0,0x0000003d,0x00070050,0x00000011,
+0x000004a1,0x000004a0,0x000004a0,0x000004a0,
+0x000004a0,0x00050080,0x00000011,0x000004a2,
+0x0000049f,0x000004a1,0x0003003e,0x00000495,
+0x000004a2,0x0004003d,0x00000011,0x000004a5,
+0x00000037,0x0003003e,0x000004a4,0x000004a5,
+0x0004003d,0x00000008,0x000004a7,0x00000038,
+0x0003003e,0x000004a6,0x000004a7,0x0004003d,
+0x00000006,0x000004a9,0x00000039,0x0003003e,
+0x000004a8,0x000004a9,0x00050041,0x00000007,
+0x000004ab,0x00000495,0x0000009d,0x0004003d,
+0x00000006,0x000004ac,0x000004ab,0x0003003e,
+0x000004aa,0x000004ac,0x00080039,0x00000006,
+0x000004ad,0x00000032,0x000004a4,0x000004a6,
+0x000004a8,0x000004aa,0x0004003d,0x00000011,
+0x000004af,0x00000037,0x0003003e,0x000004ae,
+0x000004af,0x0004003d,0x00000008,0x000004b1,
+0x00000038,0x0003003e,0x000004b0,0x000004b1,
+0x0004003d,0x00000006,0x000004b3,0x00000039,
+0x0003003e,0x000004b2,0x000004b3,0x00050041,
+0x00000007,0x000004b5,0x00000495,0x000000a0,
+0x0004003d,0x00000006,0x000004b6,0x000004b5,
+0x0003003e,0x000004b4,0x000004b6,0x00080039,
+0x00000006,0x000004b7,0x00000032,0x000004ae,
+0x000004b0,0x000004b2,0x000004b4,0x0004003d,
+0x00000011,0x000004b9,0x00000037,0x0003003e,
+0x000004b8,0x000004b9,0x0004003d,0x00000008,
+0x000004bb,0x00000038,0x0003003e,0x000004ba,
+0x000004bb,0x0004003d,0x00000006,0x000004bd,
+0x00000039,0x0003003e,0x000004bc,0x000004bd,
+0x00050041,0x00000007,0x000004bf,0x00000495,
+0x00000092,0x0004003d,0x00000006,0x000004c0,
+0x000004bf,0x0003003e,0x000004be,0x000004c0,
+0x00080039,0x00000006,0x000004c1,0x00000032,
+0x000004b8,0x000004ba,0x000004bc,0x000004be,
+0x0004003d,0x00000011,0x000004c3,0x00000037,
+0x0003003e,0x000004c2,0x000004c3,0x0004003d,
+0x00000008,0x000004c5,0x00000038,0x0003003e,
+0x000004c4,0x000004c5,0x0004003d,0x00000006,
+0x000004c7,0x00000039,0x0003003e,0x000004c6,
+0x000004c7,0x00050041,0x00000007,0x000004c9,
+0x00000495,0x00000096,0x0004003d,0x00000006,
+0x000004ca,0x000004c9,0x0003003e,0x000004c8,
+0x000004ca,0x00080039,0x00000006,0x000004cb,
+0x00000032,0x000004c2,0x000004c4,0x000004c6,
+0x000004c8,0x00070050,0x00000011,0x000004cc,
+0x000004ad,0x000004b7,0x000004c1,0x000004cb,
+0x0003003e,0x000004a3,0x000004cc,0x00050041,
+0x00000007,0x000004ce,0x0000003e,0x0000009d,
+0x0004003d,0x00000006,0x000004cf,0x000004ce,
+0x00050041,0x00000007,0x000004d0,0x0000003e,
+0x000000a0,0x0004003d,0x00000006,0x000004d1,
+0x000004d0,0x00050084,0x00000006,0x000004d2,
+0x000004cf,0x000004d1,0x00050080,0x00000006,
+0x000004d3,0x000004d2,0x0000008d,0x000500c2,
+0x00000006,0x000004d4,0x000004d3,0x000000c2,
+0x0003003e,0x000004cd,0x000004d4,0x00050041,
+0x00000007,0x000004d6,0x0000003e,0x0000009d,
+0x0004003d,0x00000006,0x000004d7,0x000004d6,
+0x00050082,0x00000006,0x000004d8,0x0000014c,
+0x000004d7,0x00050041,0x00000007,0x000004d9,
+0x0000003e,0x000000a0,0x0004003d,0x00000006,
+0x000004da,0x000004d9,0x00050082,0x00000006,
+0x000004db,0x000004d8,0x000004da,0x0004003d,
+0x00000006,0x000004dc,0x000004cd,0x00050080,
+0x00000006,0x000004dd,0x000004db,0x000004dc,
+0x00050041,0x00000007,0x000004de,0x0000003e,
+0x0000009d,0x0004003d,0x00000006,0x000004df,
+0x000004de,0x0004003d,0x00000006,0x000004e0,
+0x000004cd,0x00050082,0x00000006,0x000004e1,
+0x000004df,0x000004e0,0x00050041,0x00000007,
+0x000004e2,0x0000003e,0x000000a0,0x0004003d,
+0x00000006,0x000004e3,0x000004e2,0x0004003d,
+0x00000006,0x000004e4,0x000004cd,0x00050082,
+0x00000006,0x000004e5,0x000004e3,0x000004e4,
+0x0004003d,0x00000006,0x000004e6,0x000004cd,
+0x00070050,0x00000011,0x000004e7,0x000004dd,
+0x000004e1,0x000004e5,0x000004e6,0x0003003e,
+0x000004d5,0x000004e7,0x0004003d,0x00000011,
+0x000004e8,0x000004a3,0x00040070,0x000004ea,
+0x000004eb,0x000004e8,0x0004003d,0x00000011,
+0x000004ec,0x000004d5,0x00040070,0x000004ea,
+0x000004ed,0x000004ec,0x00050094,0x000004e9,
+0x000004ee,0x000004eb,0x000004ed,0x00050081,
+0x000004e9,0x000004f0,0x000004ee,0x000004ef,
+0x0004006d,0x00000006,0x000004f1,0x000004f0,
+0x000500c2,0x00000006,0x000004f2,0x000004f1,
+0x000000c2,0x000200fe,0x000004f2,0x00010038,
+0x00050036,0x00000034,0x00000044,0x00000000,
+0x00000041,0x00030037,0x00000012,0x00000042,
+0x00030037,0x00000034,0x00000043,0x000200f8,
+0x00000045,0x0004003b,0x00000035,0x000004f5,
+0x00000007,0x0004003b,0x00000035,0x00000502,
+0x00000007,0x0004003b,0x00000035,0x00000505,
+0x00000007,0x0004003b,0x00000035,0x00000511,
+0x00000007,0x0004003b,0x00000035,0x00000515,
+0x00000007,0x0004003b,0x00000007,0x0000051a,
+0x00000007,0x0004003b,0x00000007,0x0000051d,
+0x00000007,0x0004003b,0x00000035,0x00000525,
+0x00000007,0x0004003b,0x00000012,0x0000052b,
+0x00000007,0x0004003b,0x00000009,0x0000052d,
+0x00000007,0x0004003b,0x00000007,0x0000052f,
+0x00000007,0x0004003b,0x00000007,0x00000531,
+0x00000007,0x0004003b,0x00000007,0x00000533,
+0x00000007,0x0004003b,0x00000007,0x00000535,
+0x00000007,0x0004003b,0x00000007,0x00000536,
+0x00000007,0x0004003b,0x00000035,0x00000537,
+0x00000007,0x0004003b,0x00000012,0x0000053e,
+0x00000007,0x0004003b,0x00000009,0x00000540,
+0x00000007,0x0004003b,0x00000007,0x00000542,
+0x00000007,0x0004003b,0x00000007,0x00000544,
+0x00000007,0x0004003b,0x00000007,0x00000546,
+0x00000007,0x0004003b,0x00000007,0x00000548,
+0x00000007,0x0004003b,0x00000007,0x00000549,
+0x00000007,0x0004003b,0x00000035,0x0000054a,
+0x00000007,0x00050041,0x00000141,0x000004f7,
+0x00000140,0x000000b8,0x0004003d,0x00000034,
+0x000004f8,0x000004f7,0x00050050,0x00000034,
+0x000004f9,0x00000092,0x00000092,0x00050086,
+0x00000034,0x000004fa,0x000004f8,0x000004f9,
+0x00050050,0x00000034,0x000004fb,0x000004f6,
+0x000004f6,0x00050080,0x00000034,0x000004fc,
+0x000004fb,0x000004fa,0x00050041,0x00000141,
+0x000004fd,0x00000140,0x000000b8,0x0004003d,
+0x00000034,0x000004fe,0x000004fd,0x00050050,
+0x00000034,0x000004ff,0x000000a0,0x000000a0,
+0x00050082,0x00000034,0x00000500,0x000004fe,
+0x000004ff,0x00050086,0x00000034,0x00000501,
+0x000004fc,0x00000500,0x0003003e,0x000004f5,
+0x00000501,0x0004003d,0x00000034,0x00000503,
+0x000004f5,0x00050084,0x00000034,0x00000504,
+0x00000043,0x00000503,0x0003003e,0x00000502,
+0x00000504,0x0004003d,0x00000034,0x00000506,
+0x00000502,0x0004003d,0x00000034,0x00000507,
+0x000000ea,0x00050050,0x00000034,0x00000508,
+0x000000a0,0x000000a0,0x00050082,0x00000034,
+0x00000509,0x00000507,0x00000508,0x00050084,
+0x00000034,0x0000050a,0x00000506,0x00000509,
+0x00050050,0x00000034,0x0000050b,0x0000019f,
+0x0000019f,0x00050080,0x00000034,0x0000050c,
+0x0000050a,0x0000050b,0x00050050,0x0000050e,
+0x0000050f,0x0000050d,0x0000050d,0x000500c2,
+0x00000034,0x00000510,0x0000050c,0x0000050f,
+0x0003003e,0x00000505,0x00000510,0x0004003d,
+0x00000034,0x00000512,0x00000505,0x00050050,
+0x0000050e,0x00000513,0x000000c2,0x000000c2,
+0x000500c2,0x00000034,0x00000514,0x00000512,
+0x00000513,0x0003003e,0x00000511,0x00000514,
+0x0004003d,0x00000034,0x00000516,0x00000505,
+0x00050050,0x00000034,0x00000518,0x00000517,
+0x00000517,0x000500c7,0x00000034,0x00000519,
+0x00000516,0x00000518,0x0003003e,0x00000515,
+0x00000519,0x00050041,0x000000aa,0x0000051b,
+0x000000ea,0x0000009d,0x0004003d,0x00000006,
+0x0000051c,0x0000051b,0x0003003e,0x0000051a,
+0x0000051c,0x00050041,0x00000007,0x0000051e,
+0x00000511,0x000000a0,0x0004003d,0x00000006,
+0x0000051f,0x0000051e,0x0004003d,0x00000006,
+0x00000520,0x0000051a,0x00050084,0x00000006,
+0x00000521,0x0000051f,0x00000520,0x00050041,
+0x00000007,0x00000522,0x00000511,0x0000009d,
+0x0004003d,0x00000006,0x00000523,0x00000522,
+0x00050080,0x00000006,0x00000524,0x00000521,
+0x00000523,0x0003003e,0x0000051d,0x00000524,
+0x0003003e,0x00000525,0x00000526,0x0004003d,
+0x00000083,0x00000527,0x000000d4,0x000600a9,
+0x00000056,0x00000528,0x00000527,0x000000c3,
+0x000000b8,0x000500c4,0x00000056,0x00000529,
+0x000000c3,0x00000528,0x0004007c,0x00000006,
+0x0000052a,0x00000529,0x0004003d,0x00000011,
+0x0000052c,0x00000042,0x0003003e,0x0000052b,
+0x0000052c,0x0004003d,0x00000008,0x0000052e,
+0x0000014b,0x0003003e,0x0000052d,0x0000052e,
+0x0004003d,0x00000006,0x00000530,0x00000165,
+0x0003003e,0x0000052f,0x00000530,0x0004003d,
+0x00000006,0x00000532,0x0000051d,0x0003003e,
+0x00000531,0x00000532,0x0004003d,0x00000006,
+0x00000534,0x0000051a,0x0003003e,0x00000533,
+0x00000534,0x0003003e,0x00000535,0x0000052a,
+0x0003003e,0x00000536,0x0000009d,0x0004003d,
+0x00000034,0x00000538,0x00000515,0x0003003e,
+0x00000537,0x00000538,0x000c0039,0x00000006,
+0x00000539,0x0000003f,0x0000052b,0x0000052d,
+0x0000052f,0x00000531,0x00000533,0x00000535,
+0x00000536,0x00000537,0x00050041,0x00000007,
+0x0000053a,0x00000525,0x0000009d,0x0003003e,
+0x0000053a,0x00000539,0x0004003d,0x00000083,
+0x0000053b,0x000000d4,0x000300f7,0x0000053d,
+0x00000000,0x000400fa,0x0000053b,0x0000053c,
+0x0000053d,0x000200f8,0x0000053c,0x0004003d,
+0x00000011,0x0000053f,0x00000042,0x0003003e,
+0x0000053e,0x0000053f,0x0004003d,0x00000008,
+0x00000541,0x0000014b,0x0003003e,0x00000540,
+0x00000541,0x0004003d,0x00000006,0x00000543,
+0x00000165,0x0003003e,0x00000542,0x00000543,
+0x0004003d,0x00000006,0x00000545,0x0000051d,
+0x0003003e,0x00000544,0x00000545,0x0004003d,
+0x00000006,0x00000547,0x0000051a,0x0003003e,
+0x00000546,0x00000547,0x0003003e,0x00000548,
+0x00000092,0x0003003e,0x00000549,0x000000a0,
+0x0004003d,0x00000034,0x0000054b,0x00000515,
+0x0003003e,0x0000054a,0x0000054b,0x000c0039,
+0x00000006,0x0000054c,0x0000003f,0x0000053e,
+0x00000540,0x00000542,0x00000544,0x00000546,
+0x00000548,0x00000549,0x0000054a,0x00050041,
+0x00000007,0x0000054d,0x00000525,0x000000a0,
+0x0003003e,0x0000054d,0x0000054c,0x000200f9,
+0x0000053d,0x000200f8,0x0000053d,0x0004003d,
+0x00000034,0x0000054e,0x00000525,0x000200fe,
+0x0000054e,0x00010038,0x00050036,0x00000006,
+0x00000048,0x00000000,0x00000046,0x00030037,
+0x00000007,0x00000047,0x000200f8,0x00000049,
+0x0004003d,0x00000006,0x00000551,0x00000047,
+0x000500c2,0x00000006,0x00000553,0x00000551,
+0x00000552,0x0004003d,0x00000006,0x00000554,
+0x00000047,0x000500c6,0x00000006,0x00000555,
+0x00000554,0x00000553,0x0003003e,0x00000047,
+0x00000555,0x0004003d,0x00000006,0x00000556,
+0x00000047,0x000500c4,0x00000006,0x00000558,
+0x00000556,0x00000557,0x0004003d,0x00000006,
+0x00000559,0x00000047,0x00050082,0x00000006,
+0x0000055a,0x00000559,0x00000558,0x0003003e,
+0x00000047,0x0000055a,0x0004003d,0x00000006,
+0x0000055b,0x00000047,0x000500c4,0x00000006,
+0x0000055c,0x0000055b,0x000000cd,0x0004003d,
+0x00000006,0x0000055d,0x00000047,0x00050080,
+0x00000006,0x0000055e,0x0000055d,0x0000055c,
+0x0003003e,0x00000047,0x0000055e,0x0004003d,
+0x00000006,0x0000055f,0x00000047,0x000500c4,
+0x00000006,0x00000560,0x0000055f,0x000000c2,
+0x0004003d,0x00000006,0x00000561,0x00000047,
+0x00050080,0x00000006,0x00000562,0x00000561,
+0x00000560,0x0003003e,0x00000047,0x00000562,
+0x0004003d,0x00000006,0x00000563,0x00000047,
+0x000500c2,0x00000006,0x00000564,0x00000563,
+0x000000c8,0x0004003d,0x00000006,0x00000565,
+0x00000047,0x000500c6,0x00000006,0x00000566,
+0x00000565,0x00000564,0x0003003e,0x00000047,
+0x00000566,0x0004003d,0x00000006,0x00000567,
+0x00000047,0x000500c4,0x00000006,0x00000569,
+0x00000567,0x00000568,0x0004003d,0x00000006,
+0x0000056a,0x00000047,0x00050080,0x00000006,
+0x0000056b,0x0000056a,0x00000569,0x0003003e,
+0x00000047,0x0000056b,0x0004003d,0x00000006,
+0x0000056c,0x00000047,0x000500c2,0x00000006,
+0x0000056d,0x0000056c,0x000000cd,0x0004003d,
+0x00000006,0x0000056e,0x00000047,0x000500c6,
+0x00000006,0x0000056f,0x0000056e,0x0000056d,
+0x0003003e,0x00000047,0x0000056f,0x0004003d,
+0x00000006,0x00000570,0x00000047,0x000500c2,
+0x00000006,0x00000571,0x00000570,0x0000015d,
+0x0004003d,0x00000006,0x00000572,0x00000047,
+0x000500c6,0x00000006,0x00000573,0x00000572,
+0x00000571,0x0003003e,0x00000047,0x00000573,
+0x0004003d,0x00000006,0x00000574,0x00000047,
+0x000500c4,0x00000006,0x00000575,0x00000574,
+0x0000050d,0x0004003d,0x00000006,0x00000576,
+0x00000047,0x000500c6,0x00000006,0x00000577,
+0x00000576,0x00000575,0x0003003e,0x00000047,
+0x00000577,0x0004003d,0x00000006,0x00000578,
+0x00000047,0x000500c2,0x00000006,0x00000579,
+0x00000578,0x00000557,0x0004003d,0x00000006,
+0x0000057a,0x00000047,0x000500c6,0x00000006,
+0x0000057b,0x0000057a,0x00000579,0x0003003e,
+0x00000047,0x0000057b,0x0004003d,0x00000006,
+0x0000057c,0x00000047,0x000200fe,0x0000057c,
+0x00010038,0x00050036,0x00000006,0x0000004e,
+0x00000000,0x0000004a,0x00030037,0x00000007,
+0x0000004b,0x00030037,0x00000035,0x0000004c,
+0x00030037,0x00000007,0x0000004d,0x000200f8,
+0x0000004f,0x0004003b,0x00000007,0x00000592,
+0x00000007,0x0004003b,0x00000007,0x00000593,
+0x00000007,0x0004003b,0x00000012,0x00000596,
+0x00000007,0x0004003b,0x00000012,0x000005a2,
+0x00000007,0x0004003b,0x00000035,0x000005b5,
+0x00000007,0x0004003b,0x00000012,0x000005c0,
+0x00000007,0x0004003b,0x00000012,0x000005c4,
+0x00000007,0x0004003b,0x00000012,0x000005d3,
+0x00000007,0x0004003d,0x00000006,0x0000057f,
+0x0000004d,0x000500aa,0x00000083,0x00000580,
+0x0000057f,0x000000a0,0x000300f7,0x00000582,
+0x00000000,0x000400fa,0x00000580,0x00000581,
+0x00000582,0x000200f8,0x00000581,0x000200fe,
+0x0000009d,0x000200f8,0x00000582,0x00050041,
+0x00000584,0x00000585,0x00000140,0x000000b9,
+0x0004003d,0x00000006,0x00000586,0x00000585,
+0x000500ab,0x00000083,0x00000587,0x00000586,
+0x0000009d,0x000300f7,0x00000589,0x00000000,
+0x000400fa,0x00000587,0x00000588,0x00000589,
+0x000200f8,0x00000588,0x0004003d,0x00000034,
+0x0000058a,0x0000004c,0x00050050,0x0000050e,
+0x0000058b,0x000000c3,0x000000c3,0x000500c4,
+0x00000034,0x0000058c,0x0000058a,0x0000058b,
+0x0003003e,0x0000004c,0x0000058c,0x000200f9,
+0x00000589,0x000200f8,0x00000589,0x0004003d,
+0x00000006,0x0000058d,0x0000004d,0x00050084,
+0x00000006,0x0000058e,0x000004f6,0x0000058d,
+0x0004003d,0x00000006,0x0000058f,0x0000004b,
+0x00050082,0x00000006,0x00000590,0x0000058f,
+0x000004f6,0x00050080,0x00000006,0x00000591,
+0x0000058e,0x00000590,0x0003003e,0x0000004b,
+0x00000591,0x0004003d,0x00000006,0x00000594,
+0x0000004b,0x0003003e,0x00000593,0x00000594,
+0x00050039,0x00000006,0x00000595,0x00000048,
+0x00000593,0x0003003e,0x00000592,0x00000595,
+0x0004003d,0x00000006,0x00000597,0x00000592,
+0x000600cb,0x00000006,0x00000598,0x00000597,
+0x000000b8,0x000000c2,0x0004003d,0x00000006,
+0x00000599,0x00000592,0x000600cb,0x00000006,
+0x0000059a,0x00000599,0x000000c2,0x000000c2,
+0x0004003d,0x00000006,0x0000059b,0x00000592,
+0x000600cb,0x00000006,0x0000059d,0x0000059b,
+0x0000059c,0x000000c2,0x0004003d,0x00000006,
+0x0000059e,0x00000592,0x000600cb,0x00000006,
+0x000005a0,0x0000059e,0x0000059f,0x000000c2,
+0x00070050,0x00000011,0x000005a1,0x00000598,
+0x0000059a,0x0000059d,0x000005a0,0x0003003e,
+0x00000596,0x000005a1,0x0004003d,0x00000006,
+0x000005a3,0x00000592,0x000600cb,0x00000006,
+0x000005a4,0x000005a3,0x00000568,0x000000c2,
+0x0004003d,0x00000006,0x000005a5,0x00000592,
+0x000600cb,0x00000006,0x000005a7,0x000005a5,
+0x000005a6,0x000000c2,0x0004003d,0x00000006,
+0x000005a8,0x00000592,0x000600cb,0x00000006,
+0x000005aa,0x000005a8,0x000005a9,0x000000c2,
+0x0004003d,0x00000006,0x000005ab,0x00000592,
+0x000600cb,0x00000006,0x000005ad,0x000005ab,
+0x000005ac,0x000000c2,0x00070050,0x00000011,
+0x000005ae,0x000005a4,0x000005a7,0x000005aa,
+0x000005ad,0x0003003e,0x000005a2,0x000005ae,
+0x0004003d,0x00000011,0x000005af,0x00000596,
+0x0004003d,0x00000011,0x000005b0,0x00000596,
+0x00050084,0x00000011,0x000005b1,0x000005af,
+0x000005b0,0x0003003e,0x00000596,0x000005b1,
+0x0004003d,0x00000011,0x000005b2,0x000005a2,
+0x0004003d,0x00000011,0x000005b3,0x000005a2,
+0x00050084,0x00000011,0x000005b4,0x000005b2,
+0x000005b3,0x0003003e,0x000005a2,0x000005b4,
+0x0004003d,0x00000006,0x000005b6,0x0000004b,
+0x000500c7,0x00000006,0x000005b7,0x000005b6,
+0x00000092,0x000500ab,0x00000083,0x000005b8,
+0x000005b7,0x0000009d,0x000600a9,0x00000056,
+0x000005b9,0x000005b8,0x000000c2,0x000000c8,
+0x0004007c,0x00000006,0x000005ba,0x000005b9,
+0x0004003d,0x00000006,0x000005bb,0x0000004d,
+0x000500aa,0x00000083,0x000005bc,0x000005bb,
+0x00000096,0x000600a9,0x00000056,0x000005bd,
+0x000005bc,0x0000050d,0x000000c8,0x0004007c,
+0x00000006,0x000005be,0x000005bd,0x00050050,
+0x00000034,0x000005bf,0x000005ba,0x000005be,
+0x0003003e,0x000005b5,0x000005bf,0x0004003d,
+0x00000006,0x000005c1,0x0000004b,0x000500c7,
+0x00000006,0x000005c2,0x000005c1,0x000000a0,
+0x000500ab,0x00000083,0x000005c3,0x000005c2,
+0x0000009d,0x000300f7,0x000005c6,0x00000000,
+0x000400fa,0x000005c3,0x000005c5,0x000005c9,
+0x000200f8,0x000005c5,0x0004003d,0x00000034,
+0x000005c7,0x000005b5,0x0009004f,0x00000011,
+0x000005c8,0x000005c7,0x000005c7,0x00000000,
+0x00000001,0x00000000,0x00000001,0x0003003e,
+0x000005c4,0x000005c8,0x000200f9,0x000005c6,
+0x000200f8,0x000005c9,0x0004003d,0x00000034,
+0x000005ca,0x000005b5,0x0009004f,0x00000011,
+0x000005cb,0x000005ca,0x000005ca,0x00000001,
+0x00000000,0x00000001,0x00000000,0x0003003e,
+0x000005c4,0x000005cb,0x000200f9,0x000005c6,
+0x000200f8,0x000005c6,0x0004003d,0x00000011,
+0x000005cc,0x000005c4,0x0003003e,0x000005c0,
+0x000005cc,0x0004003d,0x00000011,0x000005cd,
+0x000005c0,0x0004003d,0x00000011,0x000005ce,
+0x00000596,0x000500c2,0x00000011,0x000005cf,
+0x000005ce,0x000005cd,0x0003003e,0x00000596,
+0x000005cf,0x0004003d,0x00000011,0x000005d0,
+0x000005c0,0x0004003d,0x00000011,0x000005d1,
+0x000005a2,0x000500c2,0x00000011,0x000005d2,
+0x000005d1,0x000005d0,0x0003003e,0x000005a2,
+0x000005d2,0x0004003d,0x00000011,0x000005d4,
+0x00000596,0x0007004f,0x00000034,0x000005d5,
+0x000005d4,0x000005d4,0x00000000,0x00000001,
+0x00040070,0x000005d6,0x000005d7,0x000005d5,
+0x0004003d,0x00000034,0x000005d8,0x0000004c,
+0x00040070,0x000005d6,0x000005d9,0x000005d8,
+0x00050094,0x000004e9,0x000005da,0x000005d7,
+0x000005d9,0x0004006d,0x00000006,0x000005db,
+0x000005da,0x0004003d,0x00000011,0x000005dc,
+0x00000596,0x0007004f,0x00000034,0x000005dd,
+0x000005dc,0x000005dc,0x00000002,0x00000003,
+0x00040070,0x000005d6,0x000005de,0x000005dd,
+0x0004003d,0x00000034,0x000005df,0x0000004c,
+0x00040070,0x000005d6,0x000005e0,0x000005df,
+0x00050094,0x000004e9,0x000005e1,0x000005de,
+0x000005e0,0x0004006d,0x00000006,0x000005e2,
+0x000005e1,0x0004003d,0x00000011,0x000005e3,
+0x000005a2,0x0007004f,0x00000034,0x000005e4,
+0x000005e3,0x000005e3,0x00000000,0x00000001,
+0x00040070,0x000005d6,0x000005e5,0x000005e4,
+0x0004003d,0x00000034,0x000005e6,0x0000004c,
+0x00040070,0x000005d6,0x000005e7,0x000005e6,
+0x00050094,0x000004e9,0x000005e8,0x000005e5,
+0x000005e7,0x0004006d,0x00000006,0x000005e9,
+0x000005e8,0x0004003d,0x00000011,0x000005ea,
+0x000005a2,0x0007004f,0x00000034,0x000005eb,
+0x000005ea,0x000005ea,0x00000002,0x00000003,
+0x00040070,0x000005d6,0x000005ec,0x000005eb,
+0x0004003d,0x00000034,0x000005ed,0x0000004c,
+0x00040070,0x000005d6,0x000005ee,0x000005ed,
+0x00050094,0x000004e9,0x000005ef,0x000005ec,
+0x000005ee,0x0004006d,0x00000006,0x000005f0,
+0x000005ef,0x00070050,0x00000011,0x000005f1,
+0x000005db,0x000005e2,0x000005e9,0x000005f0,
+0x0004003d,0x00000006,0x000005f2,0x00000592,
+0x00070050,0x00000011,0x000005f3,0x000005f2,
+0x000005f2,0x000005f2,0x000005f2,0x000500c2,
+0x00000011,0x000005f5,0x000005f3,0x000005f4,
+0x00050080,0x00000011,0x000005f6,0x000005f1,
+0x000005f5,0x0003003e,0x000005d3,0x000005f6,
+0x0004003d,0x00000011,0x000005f8,0x000005d3,
+0x000500c7,0x00000011,0x000005f9,0x000005f8,
+0x000005f7,0x0003003e,0x000005d3,0x000005f9,
+0x0004003d,0x00000006,0x000005fa,0x0000004d,
+0x000500aa,0x00000083,0x000005fb,0x000005fa,
+0x00000092,0x000300f7,0x000005fd,0x00000000,
+0x000400fa,0x000005fb,0x000005fc,0x00000602,
+0x000200f8,0x000005fc,0x00050041,0x00000007,
+0x000005fe,0x000005d3,0x00000092,0x00050051,
+0x00000006,0x000005ff,0x00000526,0x00000000,
+0x0003003e,0x000005fe,0x000005ff,0x00050041,
+0x00000007,0x00000600,0x000005d3,0x00000096,
+0x00050051,0x00000006,0x00000601,0x00000526,
+0x00000001,0x0003003e,0x00000600,0x00000601,
+0x000200f9,0x000005fd,0x000200f8,0x00000602,
+0x0004003d,0x00000006,0x00000603,0x0000004d,
+0x000500aa,0x00000083,0x00000604,0x00000603,
+0x00000096,0x000300f7,0x00000606,0x00000000,
+0x000400fa,0x00000604,0x00000605,0x00000606,
+0x000200f8,0x00000605,0x00050041,0x00000007,
+0x00000607,0x000005d3,0x00000096,0x0003003e,
+0x00000607,0x0000009d,0x000200f9,0x00000606,
+0x000200f8,0x00000606,0x000200f9,0x000005fd,
+0x000200f8,0x000005fd,0x00050041,0x00000007,
+0x00000608,0x000005d3,0x0000009d,0x0004003d,
+0x00000006,0x00000609,0x00000608,0x00060050,
+0x00000008,0x0000060a,0x00000609,0x00000609,
+0x00000609,0x0004003d,0x00000011,0x0000060b,
+0x000005d3,0x0008004f,0x00000008,0x0000060c,
+0x0000060b,0x0000060b,0x00000001,0x00000002,
+0x00000003,0x000500ae,0x0000060d,0x0000060e,
+0x0000060a,0x0000060c,0x0004009b,0x00000083,
+0x0000060f,0x0000060e,0x000300f7,0x00000611,
+0x00000000,0x000400fa,0x0000060f,0x00000610,
+0x00000613,0x000200f8,0x00000610,0x000200fe,
+0x0000009d,0x000200f8,0x00000613,0x00050041,
+0x00000007,0x00000614,0x000005d3,0x000000a0,
+0x0004003d,0x00000006,0x00000615,0x00000614,
+0x00050050,0x00000034,0x00000616,0x00000615,
+0x00000615,0x0004003d,0x00000011,0x00000617,
+0x000005d3,0x0007004f,0x00000034,0x00000618,
+0x00000617,0x00000617,0x00000002,0x00000003,
+0x000500ae,0x00000144,0x00000619,0x00000616,
+0x00000618,0x0004009b,0x00000083,0x0000061a,
+0x00000619,0x000300f7,0x0000061c,0x00000000,
+0x000400fa,0x0000061a,0x0000061b,0x0000061e,
+0x000200f8,0x0000061b,0x000200fe,0x000000a0,
+0x000200f8,0x0000061e,0x00050041,0x00000007,
+0x0000061f,0x000005d3,0x00000092,0x0004003d,
+0x00000006,0x00000620,0x0000061f,0x00050041,
+0x00000007,0x00000621,0x000005d3,0x00000096,
+0x0004003d,0x00000006,0x00000622,0x00000621,
+0x000500ae,0x00000083,0x00000623,0x00000620,
+0x00000622,0x000300f7,0x00000625,0x00000000,
+0x000400fa,0x00000623,0x00000624,0x00000627,
+0x000200f8,0x00000624,0x000200fe,0x00000092,
+0x000200f8,0x00000627,0x000200fe,0x00000096,
+0x000200f8,0x00000625,0x000100ff,0x000200f8,
+0x0000061c,0x000100ff,0x000200f8,0x00000611,
+0x000100ff,0x00010038,0x00050036,0x00000008,
+0x00000054,0x00000000,0x00000050,0x00030037,
+0x00000007,0x00000051,0x00030037,0x00000007,
+0x00000052,0x00030037,0x00000007,0x00000053,
+0x000200f8,0x00000055,0x0004003b,0x00000007,
+0x0000062a,0x00000007,0x0004003b,0x00000009,
+0x00000632,0x00000007,0x0004003b,0x0000063f,
+0x00000640,0x00000007,0x0004003b,0x00000007,
+0x00000643,0x00000007,0x0004003b,0x00000009,
+0x00000645,0x00000007,0x0003003e,0x0000062a,
+0x0000009d,0x000200f9,0x0000062b,0x000200f8,
+0x0000062b,0x000400f6,0x0000062d,0x0000062e,
+0x00000000,0x000200f9,0x0000062f,0x000200f8,
+0x0000062f,0x0004003d,0x00000006,0x00000630,
+0x0000062a,0x000500b0,0x00000083,0x00000631,
+0x00000630,0x000003bb,0x000400fa,0x00000631,
+0x0000062c,0x0000062d,0x000200f8,0x0000062c,
+0x0004003d,0x00000006,0x0000063e,0x0000062a,
+0x0003003e,0x00000640,0x0000063d,0x00050041,
+0x00000009,0x00000641,0x00000640,0x0000063e,
+0x0004003d,0x00000008,0x00000642,0x00000641,
+0x0003003e,0x00000632,0x00000642,0x0004003d,
+0x00000006,0x00000644,0x00000052,0x0003003e,
+0x00000643,0x00000644,0x0004003d,0x00000008,
+0x00000646,0x00000632,0x0003003e,0x00000645,
+0x00000646,0x00060039,0x00000006,0x00000647,
+0x0000000d,0x00000643,0x00000645,0x0003003e,
+0x00000053,0x00000647,0x0004003d,0x00000006,
+0x00000648,0x00000053,0x0004003d,0x00000006,
+0x00000649,0x00000051,0x000500b2,0x00000083,
+0x0000064a,0x00000648,0x00000649,0x000300f7,
+0x0000064c,0x00000000,0x000400fa,0x0000064a,
+0x0000064b,0x0000064c,0x000200f8,0x0000064b,
+0x0004003d,0x00000008,0x0000064d,0x00000632,
+0x000200fe,0x0000064d,0x000200f8,0x0000064c,
+0x000200f9,0x0000062e,0x000200f8,0x0000062e,
+0x0004003d,0x00000006,0x0000064f,0x0000062a,
+0x00050080,0x00000006,0x00000650,0x0000064f,
+0x000000c3,0x0003003e,0x0000062a,0x00000650,
+0x000200f9,0x0000062b,0x000200f8,0x0000062d,
+0x000200fe,0x0000014e,0x00010038,0x00050036,
+0x00000057,0x0000005b,0x00000000,0x00000059,
+0x00030037,0x00000058,0x0000005a,0x000200f8,
+0x0000005c,0x00050041,0x0000024b,0x00000653,
+0x0000005a,0x0000009d,0x0004003d,0x00000056,
+0x00000654,0x00000653,0x00050041,0x0000024b,
+0x00000655,0x0000005a,0x00000092,0x0004003d,
+0x00000056,0x00000656,0x00000655,0x00050080,
+0x00000056,0x00000657,0x00000654,0x00000656,
+0x000500c3,0x00000056,0x00000658,0x00000657,
+0x000000c3,0x00050041,0x0000024b,0x00000659,
+0x0000005a,0x000000a0,0x0004003d,0x00000056,
+0x0000065a,0x00000659,0x00050041,0x0000024b,
+0x0000065b,0x0000005a,0x00000092,0x0004003d,
+0x00000056,0x0000065c,0x0000065b,0x00050080,
+0x00000056,0x0000065d,0x0000065a,0x0000065c,
+0x000500c3,0x00000056,0x0000065e,0x0000065d,
+0x000000c3,0x0004003d,0x00000057,0x0000065f,
+0x0000005a,0x0007004f,0x0000050e,0x00000660,
+0x0000065f,0x0000065f,0x00000002,0x00000003,
+0x00050051,0x00000056,0x00000661,0x00000660,
+0x00000000,0x00050051,0x00000056,0x00000662,
+0x00000660,0x00000001,0x00070050,0x00000057,
+0x00000663,0x00000658,0x0000065e,0x00000661,
+0x00000662,0x000200fe,0x00000663,0x00010038,
+0x00050036,0x00000056,0x00000061,0x00000000,
+0x0000005f,0x00030037,0x0000005e,0x00000060,
+0x000200f8,0x00000062,0x00050041,0x0000024b,
+0x00000666,0x00000060,0x0000009d,0x0004003d,
+0x00000056,0x00000667,0x00000666,0x00050041,
+0x0000024b,0x00000668,0x00000060,0x000000a0,
+0x0004003d,0x00000056,0x00000669,0x00000668,
+0x00050080,0x00000056,0x0000066a,0x00000667,
+0x00000669,0x00050041,0x0000024b,0x0000066b,
+0x00000060,0x00000092,0x0004003d,0x00000056,
+0x0000066c,0x0000066b,0x00050080,0x00000056,
+0x0000066d,0x0000066a,0x0000066c,0x000200fe,
+0x0000066d,0x00010038,0x00050036,0x00000002,
+0x00000066,0x00000000,0x00000063,0x00030037,
+0x00000058,0x00000064,0x00030037,0x00000058,
+0x00000065,0x000200f8,0x00000067,0x0004003d,
+0x00000057,0x00000670,0x00000065,0x00070050,
+0x00000057,0x00000671,0x000000c3,0x000000c3,
+0x000000c3,0x000000c3,0x000500c3,0x00000057,
+0x00000672,0x00000670,0x00000671,0x0003003e,
+0x00000065,0x00000672,0x0004003d,0x00000057,
+0x00000673,0x00000064,0x00070050,0x00000057,
+0x00000675,0x00000674,0x00000674,0x00000674,
+0x00000674,0x000500c7,0x00000057,0x00000676,
+0x00000673,0x00000675,0x0004003d,0x00000057,
+0x00000677,0x00000065,0x000500c5,0x00000057,
+0x00000678,0x00000677,0x00000676,0x0003003e,
+0x00000065,0x00000678,0x0004003d,0x00000057,
+0x00000679,0x00000064,0x00070050,0x00000057,
+0x0000067a,0x000000c3,0x000000c3,0x000000c3,
+0x000000c3,0x000500c3,0x00000057,0x0000067b,
+0x00000679,0x0000067a,0x0003003e,0x00000064,
+0x0000067b,0x0004003d,0x00000057,0x0000067d,
+0x00000064,0x00070050,0x00000057,0x0000067e,
+0x0000067c,0x0000067c,0x0000067c,0x0000067c,
+0x000500c7,0x00000057,0x0000067f,0x0000067d,
+0x0000067e,0x0003003e,0x00000064,0x0000067f,
+0x0004003d,0x00000057,0x00000680,0x00000064,
+0x000600ca,0x00000057,0x00000681,0x00000680,
+0x000000b8,0x0000050d,0x0003003e,0x00000064,
+0x00000681,0x000100fd,0x00010038,0x00050036,
+0x00000002,0x0000006e,0x00000000,0x00000068,
+0x00030037,0x00000058,0x00000069,0x00030037,
+0x00000058,0x0000006a,0x00030037,0x00000007,
+0x0000006b,0x00030037,0x00000012,0x0000006c,
+0x00030037,0x00000012,0x0000006d,0x000200f8,
+0x0000006f,0x0004003b,0x0000024b,0x0000069f,
+0x00000007,0x0004003b,0x0000024b,0x000006a8,
+0x00000007,0x0004003b,0x00000058,0x000006c6,
+0x00000007,0x0004003b,0x00000058,0x000006c8,
+0x00000007,0x0004003b,0x0000005e,0x00000715,
+0x00000007,0x0004003b,0x0000005e,0x00000719,
+0x00000007,0x0004003b,0x00000058,0x00000725,
+0x00000007,0x0004003b,0x00000058,0x00000729,
+0x00000007,0x0004003b,0x00000058,0x00000731,
+0x00000007,0x0004003b,0x00000058,0x00000733,
+0x00000007,0x0004003b,0x0000005e,0x00000738,
+0x00000007,0x0004003b,0x00000058,0x0000074f,
+0x00000007,0x0004003b,0x00000058,0x00000755,
+0x00000007,0x0004003d,0x00000006,0x00000682,
+0x0000006b,0x000300f7,0x0000068e,0x00000000,
+0x001700fb,0x00000682,0x0000068d,0x00000000,
+0x00000683,0x00000001,0x00000684,0x00000004,
+0x00000685,0x00000005,0x00000686,0x00000006,
+0x00000687,0x0000000a,0x00000688,0x00000008,
+0x00000689,0x0000000c,0x0000068a,0x00000009,
+0x0000068b,0x0000000d,0x0000068c,0x000200f8,
+0x0000068d,0x0003003e,0x0000006c,0x0000075d,
+0x0003003e,0x0000006d,0x0000075d,0x000200f9,
+0x0000068e,0x000200f8,0x00000683,0x0004003d,
+0x00000057,0x0000068f,0x00000069,0x0008004f,
+0x0000005d,0x00000690,0x0000068f,0x0000068f,
+0x00000000,0x00000000,0x00000000,0x0004007c,
+0x00000008,0x00000691,0x00000690,0x00050051,
+0x00000006,0x00000693,0x00000691,0x00000000,
+0x00050051,0x00000006,0x00000694,0x00000691,
+0x00000001,0x00050051,0x00000006,0x00000695,
+0x00000691,0x00000002,0x00070050,0x00000011,
+0x00000696,0x00000693,0x00000694,0x00000695,
+0x00000692,0x0003003e,0x0000006c,0x00000696,
+0x0004003d,0x00000057,0x00000697,0x0000006a,
+0x0008004f,0x0000005d,0x00000698,0x00000697,
+0x00000697,0x00000000,0x00000000,0x00000000,
+0x0004007c,0x00000008,0x00000699,0x00000698,
+0x00050051,0x00000006,0x0000069a,0x00000699,
+0x00000000,0x00050051,0x00000006,0x0000069b,
+0x00000699,0x00000001,0x00050051,0x00000006,
+0x0000069c,0x00000699,0x00000002,0x00070050,
+0x00000011,0x0000069d,0x0000069a,0x0000069b,
+0x0000069c,0x00000692,0x0003003e,0x0000006d,
+0x0000069d,0x000100fd,0x000200f8,0x00000684,
+0x00050041,0x0000024b,0x000006a0,0x00000069,
+0x0000009d,0x0004003d,0x00000056,0x000006a1,
+0x000006a0,0x000500c3,0x00000056,0x000006a2,
+0x000006a1,0x000000b9,0x00050041,0x0000024b,
+0x000006a3,0x0000006a,0x0000009d,0x0004003d,
+0x00000056,0x000006a4,0x000006a3,0x000500c7,
+0x00000056,0x000006a6,0x000006a4,0x000006a5,
+0x000500c5,0x00000056,0x000006a7,0x000006a2,
+0x000006a6,0x0003003e,0x0000069f,0x000006a7,
+0x0004003d,0x00000056,0x000006a9,0x0000069f,
+0x00050041,0x0000024b,0x000006aa,0x0000006a,
+0x0000009d,0x0004003d,0x00000056,0x000006ab,
+0x000006aa,0x000500c7,0x00000056,0x000006ac,
+0x000006ab,0x0000067c,0x00050080,0x00000056,
+0x000006ad,0x000006a9,0x000006ac,0x0007000c,
+0x00000056,0x000006af,0x00000001,0x00000027,
+0x000006ad,0x000006ae,0x0003003e,0x000006a8,
+0x000006af,0x0004003d,0x00000056,0x000006b0,
+0x0000069f,0x0004007c,0x00000006,0x000006b1,
+0x000006b0,0x00060050,0x00000008,0x000006b2,
+0x000006b1,0x000006b1,0x000006b1,0x00050051,
+0x00000006,0x000006b3,0x000006b2,0x00000000,
+0x00050051,0x00000006,0x000006b4,0x000006b2,
+0x00000001,0x00050051,0x00000006,0x000006b5,
+0x000006b2,0x00000002,0x00070050,0x00000011,
+0x000006b6,0x000006b3,0x000006b4,0x000006b5,
+0x00000692,0x0003003e,0x0000006c,0x000006b6,
+0x0004003d,0x00000056,0x000006b7,0x000006a8,
+0x0004007c,0x00000006,0x000006b8,0x000006b7,
+0x00060050,0x00000008,0x000006b9,0x000006b8,
+0x000006b8,0x000006b8,0x00050051,0x00000006,
+0x000006ba,0x000006b9,0x00000000,0x00050051,
+0x00000006,0x000006bb,0x000006b9,0x00000001,
+0x00050051,0x00000006,0x000006bc,0x000006b9,
+0x00000002,0x00070050,0x00000011,0x000006bd,
+0x000006ba,0x000006bb,0x000006bc,0x00000692,
+0x0003003e,0x0000006d,0x000006bd,0x000100fd,
+0x000200f8,0x00000685,0x0004003d,0x00000057,
+0x000006bf,0x00000069,0x0009004f,0x00000057,
+0x000006c0,0x000006bf,0x000006bf,0x00000000,
+0x00000000,0x00000000,0x00000001,0x0004007c,
+0x00000011,0x000006c1,0x000006c0,0x0003003e,
+0x0000006c,0x000006c1,0x0004003d,0x00000057,
+0x000006c2,0x0000006a,0x0009004f,0x00000057,
+0x000006c3,0x000006c2,0x000006c2,0x00000000,
+0x00000000,0x00000000,0x00000001,0x0004007c,
+0x00000011,0x000006c4,0x000006c3,0x0003003e,
+0x0000006d,0x000006c4,0x000100fd,0x000200f8,
+0x00000686,0x0004003d,0x00000057,0x000006c7,
+0x0000006a,0x0003003e,0x000006c6,0x000006c7,
+0x0004003d,0x00000057,0x000006c9,0x00000069,
+0x0003003e,0x000006c8,0x000006c9,0x00060039,
+0x00000002,0x000006ca,0x00000066,0x000006c6,
+0x000006c8,0x0004003d,0x00000057,0x000006cb,
+0x000006c6,0x0003003e,0x0000006a,0x000006cb,
+0x0004003d,0x00000057,0x000006cc,0x000006c8,
+0x0003003e,0x00000069,0x000006cc,0x0004003d,
+0x00000057,0x000006cd,0x00000069,0x0009004f,
+0x00000057,0x000006ce,0x000006cd,0x000006cd,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x00070050,0x00000057,0x000006cf,0x000000b8,
+0x000000b8,0x000000b8,0x000000b8,0x00070050,
+0x00000057,0x000006d0,0x000006ae,0x000006ae,
+0x000006ae,0x000006ae,0x0008000c,0x00000057,
+0x000006d1,0x00000001,0x0000002d,0x000006ce,
+0x000006cf,0x000006d0,0x0004007c,0x00000011,
+0x000006d2,0x000006d1,0x0003003e,0x0000006c,
+0x000006d2,0x0004003d,0x00000057,0x000006d3,
+0x00000069,0x0009004f,0x00000057,0x000006d4,
+0x000006d3,0x000006d3,0x00000000,0x00000000,
+0x00000000,0x00000001,0x0004003d,0x00000057,
+0x000006d5,0x0000006a,0x0009004f,0x00000057,
+0x000006d6,0x000006d5,0x000006d5,0x00000000,
+0x00000000,0x00000000,0x00000001,0x00050080,
+0x00000057,0x000006d7,0x000006d4,0x000006d6,
+0x00070050,0x00000057,0x000006d8,0x000000b8,
+0x000000b8,0x000000b8,0x000000b8,0x00070050,
+0x00000057,0x000006d9,0x000006ae,0x000006ae,
+0x000006ae,0x000006ae,0x0008000c,0x00000057,
+0x000006da,0x00000001,0x0000002d,0x000006d7,
+0x000006d8,0x000006d9,0x0004007c,0x00000011,
+0x000006db,0x000006da,0x0003003e,0x0000006d,
+0x000006db,0x000100fd,0x000200f8,0x00000687,
+0x00050041,0x0000024b,0x000006dd,0x00000069,
+0x0000009d,0x0004003d,0x00000056,0x000006de,
+0x000006dd,0x0004007c,0x00000006,0x000006df,
+0x000006de,0x00050041,0x0000024b,0x000006e0,
+0x0000006a,0x0000009d,0x0004003d,0x00000056,
+0x000006e1,0x000006e0,0x0004007c,0x00000006,
+0x000006e2,0x000006e1,0x00050041,0x0000024b,
+0x000006e3,0x00000069,0x000000a0,0x0004003d,
+0x00000056,0x000006e4,0x000006e3,0x0004007c,
+0x00000006,0x000006e5,0x000006e4,0x00070050,
+0x00000011,0x000006e6,0x000006df,0x000006e2,
+0x000006e5,0x00000692,0x0003003e,0x0000006d,
+0x000006e6,0x0004003d,0x00000011,0x000006e7,
+0x0000006d,0x0008004f,0x00000008,0x000006e8,
+0x000006e7,0x000006e7,0x00000000,0x00000001,
+0x00000002,0x00050041,0x0000024b,0x000006e9,
+0x0000006a,0x000000a0,0x0004003d,0x00000056,
+0x000006ea,0x000006e9,0x0004007c,0x00000006,
+0x000006eb,0x000006ea,0x00060050,0x00000008,
+0x000006ec,0x000006eb,0x000006eb,0x000006eb,
+0x00050084,0x00000008,0x000006ed,0x000006e8,
+0x000006ec,0x00060050,0x0000005d,0x000006ee,
+0x0000059c,0x0000059c,0x0000059c,0x000500c2,
+0x00000008,0x000006ef,0x000006ed,0x000006ee,
+0x00050051,0x00000006,0x000006f0,0x000006ef,
+0x00000000,0x00050051,0x00000006,0x000006f1,
+0x000006ef,0x00000001,0x00050051,0x00000006,
+0x000006f2,0x000006ef,0x00000002,0x00070050,
+0x00000011,0x000006f3,0x000006f0,0x000006f1,
+0x000006f2,0x00000692,0x0003003e,0x0000006c,
+0x000006f3,0x000100fd,0x000200f8,0x00000688,
+0x00050041,0x0000024b,0x000006f5,0x00000069,
+0x0000009d,0x0004003d,0x00000056,0x000006f6,
+0x000006f5,0x0004007c,0x00000006,0x000006f7,
+0x000006f6,0x00050041,0x0000024b,0x000006f8,
+0x0000006a,0x0000009d,0x0004003d,0x00000056,
+0x000006f9,0x000006f8,0x0004007c,0x00000006,
+0x000006fa,0x000006f9,0x00050041,0x0000024b,
+0x000006fb,0x00000069,0x000000a0,0x0004003d,
+0x00000056,0x000006fc,0x000006fb,0x0004007c,
+0x00000006,0x000006fd,0x000006fc,0x00050041,
+0x0000024b,0x000006fe,0x0000006a,0x00000092,
+0x0004003d,0x00000056,0x000006ff,0x000006fe,
+0x0004007c,0x00000006,0x00000700,0x000006ff,
+0x00070050,0x00000011,0x00000701,0x000006f7,
+0x000006fa,0x000006fd,0x00000700,0x0003003e,
+0x0000006d,0x00000701,0x0004003d,0x00000011,
+0x00000702,0x0000006d,0x0008004f,0x00000008,
+0x00000703,0x00000702,0x00000702,0x00000000,
+0x00000001,0x00000002,0x00050041,0x0000024b,
+0x00000704,0x0000006a,0x000000a0,0x0004003d,
+0x00000056,0x00000705,0x00000704,0x0004007c,
+0x00000006,0x00000706,0x00000705,0x00060050,
+0x00000008,0x00000707,0x00000706,0x00000706,
+0x00000706,0x00050084,0x00000008,0x00000708,
+0x00000703,0x00000707,0x00060050,0x0000005d,
+0x00000709,0x0000059c,0x0000059c,0x0000059c,
+0x000500c2,0x00000008,0x0000070a,0x00000708,
+0x00000709,0x00050041,0x0000024b,0x0000070b,
+0x00000069,0x00000092,0x0004003d,0x00000056,
+0x0000070c,0x0000070b,0x0004007c,0x00000006,
+0x0000070d,0x0000070c,0x00050051,0x00000006,
+0x0000070e,0x0000070a,0x00000000,0x00050051,
+0x00000006,0x0000070f,0x0000070a,0x00000001,
+0x00050051,0x00000006,0x00000710,0x0000070a,
+0x00000002,0x00070050,0x00000011,0x00000711,
+0x0000070e,0x0000070f,0x00000710,0x0000070d,
+0x0003003e,0x0000006c,0x00000711,0x000100fd,
+0x000200f8,0x00000689,0x00050041,0x0000024b,
+0x00000713,0x00000069,0x00000096,0x0003003e,
+0x00000713,0x000006ae,0x00050041,0x0000024b,
+0x00000714,0x0000006a,0x00000096,0x0003003e,
+0x00000714,0x000006ae,0x000200f9,0x0000068a,
+0x000200f8,0x0000068a,0x0004003d,0x00000057,
+0x00000716,0x0000006a,0x0008004f,0x0000005d,
+0x00000717,0x00000716,0x00000716,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x00000715,
+0x00000717,0x00050039,0x00000056,0x00000718,
+0x00000061,0x00000715,0x0004003d,0x00000057,
+0x0000071a,0x00000069,0x0008004f,0x0000005d,
+0x0000071b,0x0000071a,0x0000071a,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x00000719,
+0x0000071b,0x00050039,0x00000056,0x0000071c,
+0x00000061,0x00000719,0x000500af,0x00000083,
+0x0000071d,0x00000718,0x0000071c,0x000300f7,
+0x0000071f,0x00000000,0x000400fa,0x0000071d,
+0x0000071e,0x00000724,0x000200f8,0x0000071e,
+0x0004003d,0x00000057,0x00000720,0x00000069,
+0x0004007c,0x00000011,0x00000721,0x00000720,
+0x0003003e,0x0000006c,0x00000721,0x0004003d,
+0x00000057,0x00000722,0x0000006a,0x0004007c,
+0x00000011,0x00000723,0x00000722,0x0003003e,
+0x0000006d,0x00000723,0x000200f9,0x0000071f,
+0x000200f8,0x00000724,0x0004003d,0x00000057,
+0x00000726,0x0000006a,0x0003003e,0x00000725,
+0x00000726,0x00050039,0x00000057,0x00000727,
+0x0000005b,0x00000725,0x0004007c,0x00000011,
+0x00000728,0x00000727,0x0003003e,0x0000006c,
+0x00000728,0x0004003d,0x00000057,0x0000072a,
+0x00000069,0x0003003e,0x00000729,0x0000072a,
+0x00050039,0x00000057,0x0000072b,0x0000005b,
+0x00000729,0x0004007c,0x00000011,0x0000072c,
+0x0000072b,0x0003003e,0x0000006d,0x0000072c,
+0x000200f9,0x0000071f,0x000200f8,0x0000071f,
+0x000100fd,0x000200f8,0x0000068b,0x00050041,
+0x0000024b,0x0000072e,0x00000069,0x00000096,
+0x0003003e,0x0000072e,0x000006ae,0x00050041,
+0x0000024b,0x00000730,0x0000006a,0x00000096,
+0x0003003e,0x00000730,0x0000072f,0x000200f9,
+0x0000068c,0x000200f8,0x0000068c,0x0004003d,
+0x00000057,0x00000732,0x0000006a,0x0003003e,
+0x00000731,0x00000732,0x0004003d,0x00000057,
+0x00000734,0x00000069,0x0003003e,0x00000733,
+0x00000734,0x00060039,0x00000002,0x00000735,
+0x00000066,0x00000731,0x00000733,0x0004003d,
+0x00000057,0x00000736,0x00000731,0x0003003e,
+0x0000006a,0x00000736,0x0004003d,0x00000057,
+0x00000737,0x00000733,0x0003003e,0x00000069,
+0x00000737,0x0004003d,0x00000057,0x00000739,
+0x0000006a,0x0008004f,0x0000005d,0x0000073a,
+0x00000739,0x00000739,0x00000000,0x00000001,
+0x00000002,0x0003003e,0x00000738,0x0000073a,
+0x00050039,0x00000056,0x0000073b,0x00000061,
+0x00000738,0x000500af,0x00000083,0x0000073c,
+0x0000073b,0x000000b8,0x000300f7,0x0000073e,
+0x00000000,0x000400fa,0x0000073c,0x0000073d,
+0x0000074b,0x000200f8,0x0000073d,0x0004003d,
+0x00000057,0x0000073f,0x00000069,0x00070050,
+0x00000057,0x00000740,0x000000b8,0x000000b8,
+0x000000b8,0x000000b8,0x00070050,0x00000057,
+0x00000741,0x000006ae,0x000006ae,0x000006ae,
+0x000006ae,0x0008000c,0x00000057,0x00000742,
+0x00000001,0x0000002d,0x0000073f,0x00000740,
+0x00000741,0x0004007c,0x00000011,0x00000743,
+0x00000742,0x0003003e,0x0000006c,0x00000743,
+0x0004003d,0x00000057,0x00000744,0x00000069,
+0x0004003d,0x00000057,0x00000745,0x0000006a,
+0x00050080,0x00000057,0x00000746,0x00000744,
+0x00000745,0x00070050,0x00000057,0x00000747,
+0x000000b8,0x000000b8,0x000000b8,0x000000b8,
+0x00070050,0x00000057,0x00000748,0x000006ae,
+0x000006ae,0x000006ae,0x000006ae,0x0008000c,
+0x00000057,0x00000749,0x00000001,0x0000002d,
+0x00000746,0x00000747,0x00000748,0x0004007c,
+0x00000011,0x0000074a,0x00000749,0x0003003e,
+0x0000006d,0x0000074a,0x000200f9,0x0000073e,
+0x000200f8,0x0000074b,0x0004003d,0x00000057,
+0x0000074c,0x00000069,0x0004003d,0x00000057,
+0x0000074d,0x0000006a,0x00050080,0x00000057,
+0x0000074e,0x0000074c,0x0000074d,0x0003003e,
+0x0000074f,0x0000074e,0x00050039,0x00000057,
+0x00000750,0x0000005b,0x0000074f,0x00070050,
+0x00000057,0x00000751,0x000000b8,0x000000b8,
+0x000000b8,0x000000b8,0x00070050,0x00000057,
+0x00000752,0x000006ae,0x000006ae,0x000006ae,
+0x000006ae,0x0008000c,0x00000057,0x00000753,
+0x00000001,0x0000002d,0x00000750,0x00000751,
+0x00000752,0x0004007c,0x00000011,0x00000754,
+0x00000753,0x0003003e,0x0000006c,0x00000754,
+0x0004003d,0x00000057,0x00000756,0x00000069,
+0x0003003e,0x00000755,0x00000756,0x00050039,
+0x00000057,0x00000757,0x0000005b,0x00000755,
+0x00070050,0x00000057,0x00000758,0x000000b8,
+0x000000b8,0x000000b8,0x000000b8,0x00070050,
+0x00000057,0x00000759,0x000006ae,0x000006ae,
+0x000006ae,0x000006ae,0x0008000c,0x00000057,
+0x0000075a,0x00000001,0x0000002d,0x00000757,
+0x00000758,0x00000759,0x0004007c,0x00000011,
+0x0000075b,0x0000075a,0x0003003e,0x0000006d,
+0x0000075b,0x000200f9,0x0000073e,0x000200f8,
+0x0000073e,0x000100fd,0x000200f8,0x0000068e,
+0x000100fd,0x00010038,0x00050036,0x00000006,
+0x00000075,0x00000000,0x00000070,0x00030037,
+0x00000012,0x00000071,0x00030037,0x00000007,
+0x00000072,0x00030037,0x00000007,0x00000073,
+0x00030037,0x00000009,0x00000074,0x000200f8,
+0x00000076,0x0004003b,0x00000007,0x0000075f,
+0x00000007,0x0004003b,0x00000007,0x00000767,
+0x00000007,0x0004003b,0x00000007,0x00000770,
+0x00000007,0x0004003b,0x00000012,0x00000773,
+0x00000007,0x0004003b,0x00000007,0x00000775,
+0x00000007,0x0004003b,0x00000007,0x00000777,
+0x00000007,0x0004003b,0x00000007,0x00000779,
+0x00000007,0x0004003b,0x000007e0,0x000007e1,
+0x00000007,0x0004003b,0x00000007,0x000007eb,
+0x00000007,0x0004003b,0x00000007,0x000007f4,
+0x00000007,0x0004003b,0x00000012,0x000007f7,
+0x00000007,0x0004003b,0x00000007,0x000007f9,
+0x00000007,0x0004003b,0x00000007,0x000007fb,
+0x00000007,0x0004003b,0x00000007,0x000007fd,
+0x00000007,0x0004003b,0x0000080e,0x0000080f,
+0x00000007,0x0004003b,0x00000007,0x00000814,
+0x00000007,0x0004003b,0x00000007,0x0000081a,
+0x00000007,0x0004003b,0x00000012,0x0000081b,
+0x00000007,0x0004003b,0x00000007,0x0000081d,
+0x00000007,0x0004003b,0x00000007,0x0000081f,
+0x00000007,0x0004003b,0x00000035,0x00000822,
+0x00000007,0x0004003b,0x0000082e,0x0000082f,
+0x00000007,0x00050041,0x00000007,0x00000760,
+0x00000074,0x00000092,0x0004003d,0x00000006,
+0x00000761,0x00000760,0x0003003e,0x0000075f,
+0x00000761,0x00050041,0x00000007,0x00000762,
+0x00000074,0x0000009d,0x0004003d,0x00000006,
+0x00000763,0x00000762,0x000500aa,0x00000083,
+0x00000764,0x00000763,0x000000a0,0x000300f7,
+0x00000766,0x00000000,0x000400fa,0x00000764,
+0x00000765,0x000007e5,0x000200f8,0x00000765,
+0x0004003d,0x00000006,0x00000768,0x00000073,
+0x00050086,0x00000006,0x00000769,0x00000768,
+0x00000095,0x0004003d,0x00000006,0x0000076a,
+0x0000075f,0x00050084,0x00000006,0x0000076b,
+0x00000095,0x0000076a,0x00050080,0x00000006,
+0x0000076c,0x0000076b,0x0000008d,0x00050084,
+0x00000006,0x0000076d,0x00000769,0x0000076c,
+0x0004003d,0x00000006,0x0000076e,0x00000072,
+0x00050080,0x00000006,0x0000076f,0x0000076d,
+0x0000076e,0x0003003e,0x00000767,0x0000076f,
+0x0004003d,0x00000006,0x00000771,0x00000073,
+0x00050089,0x00000006,0x00000772,0x00000771,
+0x00000095,0x0004003d,0x00000011,0x00000774,
+0x00000071,0x0003003e,0x00000773,0x00000774,
+0x0004003d,0x00000006,0x00000776,0x00000767,
+0x0003003e,0x00000775,0x00000776,0x0004003d,
+0x00000006,0x00000778,0x0000075f,0x0003003e,
+0x00000777,0x00000778,0x0003003e,0x00000779,
+0x00000772,0x00080039,0x00000006,0x0000077a,
+0x00000025,0x00000773,0x00000775,0x00000777,
+0x00000779,0x0003003e,0x00000770,0x0000077a,
+0x0004003d,0x00000006,0x000007d9,0x0000075f,
+0x000500c4,0x00000056,0x000007da,0x000000c3,
+0x000007d9,0x00050082,0x00000056,0x000007db,
+0x000007da,0x000000c3,0x00050084,0x00000056,
+0x000007dc,0x0000015d,0x000007db,0x0004007c,
+0x00000006,0x000007dd,0x000007dc,0x0004003d,
+0x00000006,0x000007de,0x00000770,0x00050080,
+0x00000006,0x000007df,0x000007dd,0x000007de,
+0x0003003e,0x000007e1,0x000007d8,0x00050041,
+0x00000007,0x000007e2,0x000007e1,0x000007df,
+0x0004003d,0x00000006,0x000007e3,0x000007e2,
+0x000200fe,0x000007e3,0x000200f8,0x000007e5,
+0x00050041,0x00000007,0x000007e6,0x00000074,
+0x000000a0,0x0004003d,0x00000006,0x000007e7,
+0x000007e6,0x000500aa,0x00000083,0x000007e8,
+0x000007e7,0x000000a0,0x000300f7,0x000007ea,
+0x00000000,0x000400fa,0x000007e8,0x000007e9,
+0x00000813,0x000200f8,0x000007e9,0x0004003d,
+0x00000006,0x000007ec,0x00000073,0x00050086,
+0x00000006,0x000007ed,0x000007ec,0x00000096,
+0x0004003d,0x00000006,0x000007ee,0x0000075f,
+0x00050084,0x00000006,0x000007ef,0x00000096,
+0x000007ee,0x00050080,0x00000006,0x000007f0,
+0x000007ef,0x0000008e,0x00050084,0x00000006,
+0x000007f1,0x000007ed,0x000007f0,0x0004003d,
+0x00000006,0x000007f2,0x00000072,0x00050080,
+0x00000006,0x000007f3,0x000007f1,0x000007f2,
+0x0003003e,0x000007eb,0x000007f3,0x0004003d,
+0x00000006,0x000007f5,0x00000073,0x00050089,
+0x00000006,0x000007f6,0x000007f5,0x00000096,
+0x0004003d,0x00000011,0x000007f8,0x00000071,
+0x0003003e,0x000007f7,0x000007f8,0x0004003d,
+0x00000006,0x000007fa,0x000007eb,0x0003003e,
+0x000007f9,0x000007fa,0x0004003d,0x00000006,
+0x000007fc,0x0000075f,0x0003003e,0x000007fb,
+0x000007fc,0x0003003e,0x000007fd,0x000007f6,
+0x00080039,0x00000006,0x000007fe,0x0000002b,
+0x000007f7,0x000007f9,0x000007fb,0x000007fd,
+0x0003003e,0x000007f4,0x000007fe,0x0004003d,
+0x00000006,0x00000807,0x0000075f,0x000500c4,
+0x00000056,0x00000808,0x000000c3,0x00000807,
+0x00050082,0x00000056,0x00000809,0x00000808,
+0x000000c3,0x00050084,0x00000056,0x0000080a,
+0x000000c8,0x00000809,0x0004007c,0x00000006,
+0x0000080b,0x0000080a,0x0004003d,0x00000006,
+0x0000080c,0x000007f4,0x00050080,0x00000006,
+0x0000080d,0x0000080b,0x0000080c,0x0003003e,
+0x0000080f,0x00000806,0x00050041,0x00000007,
+0x00000810,0x0000080f,0x0000080d,0x0004003d,
+0x00000006,0x00000811,0x00000810,0x000200fe,
+0x00000811,0x000200f8,0x00000813,0x0004003d,
+0x00000006,0x00000815,0x00000073,0x0004003d,
+0x00000006,0x00000816,0x0000075f,0x00050084,
+0x00000006,0x00000817,0x00000815,0x00000816,
+0x0004003d,0x00000006,0x00000818,0x00000072,
+0x00050080,0x00000006,0x00000819,0x00000817,
+0x00000818,0x0003003e,0x00000814,0x00000819,
+0x0004003d,0x00000011,0x0000081c,0x00000071,
+0x0003003e,0x0000081b,0x0000081c,0x0004003d,
+0x00000006,0x0000081e,0x00000814,0x0003003e,
+0x0000081d,0x0000081e,0x0004003d,0x00000006,
+0x00000820,0x0000075f,0x0003003e,0x0000081f,
+0x00000820,0x00070039,0x00000006,0x00000821,
+0x00000017,0x0000081b,0x0000081d,0x0000081f,
+0x0003003e,0x0000081a,0x00000821,0x0004003d,
+0x00000006,0x0000082c,0x0000075f,0x00050082,
+0x00000006,0x0000082d,0x0000082c,0x000000a0,
+0x0003003e,0x0000082f,0x0000082b,0x00050041,
+0x00000035,0x00000830,0x0000082f,0x0000082d,
+0x0004003d,0x00000034,0x00000831,0x00000830,
+0x0003003e,0x00000822,0x00000831,0x0004003d,
+0x00000006,0x00000832,0x0000081a,0x00050041,
+0x00000007,0x00000833,0x00000822,0x0000009d,
+0x0004003d,0x00000006,0x00000834,0x00000833,
+0x00050084,0x00000006,0x00000835,0x00000832,
+0x00000834,0x0004003d,0x00000006,0x00000836,
+0x0000081a,0x00050041,0x00000007,0x00000837,
+0x00000822,0x000000a0,0x0004003d,0x00000006,
+0x00000838,0x00000837,0x000500c2,0x00000006,
+0x00000839,0x00000836,0x00000838,0x000500c5,
+0x00000006,0x0000083a,0x00000835,0x00000839,
+0x000200fe,0x0000083a,0x000200f8,0x000007ea,
+0x000100ff,0x000200f8,0x00000766,0x000100ff,
+0x00010038,0x00050036,0x00000011,0x00000079,
+0x00000000,0x00000077,0x00030037,0x00000007,
+0x00000078,0x000200f8,0x0000007a,0x0004003b,
+0x00000058,0x0000083d,0x00000007,0x0004003b,
+0x00000012,0x00000846,0x00000007,0x0004003d,
+0x00000006,0x0000083e,0x00000078,0x0004007c,
+0x00000056,0x0000083f,0x0000083e,0x00070050,
+0x00000057,0x00000844,0x0000083f,0x0000083f,
+0x0000083f,0x0000083f,0x00050082,0x00000057,
+0x00000845,0x00000844,0x00000843,0x0003003e,
+0x0000083d,0x00000845,0x0004003d,0x00000057,
+0x00000848,0x0000083d,0x0008000c,0x00000057,
+0x0000084c,0x00000001,0x0000002d,0x00000848,
+0x00000849,0x0000084b,0x000500c4,0x00000011,
+0x0000084d,0x00000847,0x0000084c,0x00070050,
+0x00000011,0x0000084e,0x000000a0,0x000000a0,
+0x000000a0,0x000000a0,0x00050082,0x00000011,
+0x0000084f,0x0000084d,0x0000084e,0x0003003e,
+0x00000846,0x0000084f,0x0004003d,0x00000011,
+0x00000850,0x00000846,0x0004003d,0x00000006,
+0x00000853,0x00000078,0x00070050,0x00000011,
+0x00000854,0x00000853,0x00000853,0x00000853,
+0x00000853,0x000500ae,0x00000856,0x00000857,
+0x00000854,0x00000855,0x000600a9,0x00000011,
+0x00000858,0x00000857,0x00000852,0x00000850,
+0x000200fe,0x00000858,0x00010038,0x00050036,
+0x00000011,0x0000007d,0x00000000,0x0000007b,
+0x00030037,0x00000034,0x0000007c,0x000200f8,
+0x0000007e,0x0004003b,0x00000012,0x00000872,
+0x00000007,0x0004003b,0x00000007,0x00000876,
+0x00000007,0x0004003b,0x00000035,0x0000087a,
+0x00000007,0x0004003b,0x00000012,0x0000087b,
+0x00000007,0x0004003b,0x00000007,0x0000087e,
+0x00000007,0x0004003b,0x00000007,0x0000087f,
+0x00000007,0x0004003b,0x00000035,0x00000881,
+0x00000007,0x0004003b,0x00000007,0x00000882,
+0x00000007,0x0004003b,0x00000007,0x00000885,
+0x00000007,0x0004003b,0x00000007,0x00000886,
+0x00000007,0x0004003b,0x00000007,0x00000887,
+0x00000007,0x0004003b,0x00000007,0x00000888,
+0x00000007,0x0004003b,0x00000007,0x00000889,
+0x00000007,0x0004003b,0x00000007,0x0000088b,
+0x00000007,0x0004003b,0x00000007,0x0000088c,
+0x00000007,0x0004003b,0x00000007,0x0000088d,
+0x00000007,0x0004003b,0x00000007,0x00000897,
+0x00000007,0x0004003b,0x00000007,0x0000089d,
+0x00000007,0x0004003b,0x00000007,0x000008a5,
+0x00000007,0x0004003b,0x00000009,0x000008a9,
+0x00000007,0x0004003b,0x00000007,0x000008aa,
+0x00000007,0x0004003b,0x00000007,0x000008ab,
+0x00000007,0x0004003b,0x00000007,0x000008ad,
+0x00000007,0x0004003b,0x00000007,0x000008af,
+0x00000007,0x0004003b,0x00000007,0x000008b2,
+0x00000007,0x0004003b,0x00000058,0x000008b6,
+0x00000007,0x0004003b,0x00000058,0x000008b7,
+0x00000007,0x0004003b,0x00000012,0x000008b8,
+0x00000007,0x0004003b,0x00000007,0x000008bd,
+0x00000007,0x0004003b,0x00000007,0x000008c0,
+0x00000007,0x0004003b,0x00000007,0x000008c9,
+0x00000007,0x0004003b,0x00000012,0x000008cf,
+0x00000007,0x0004003b,0x00000007,0x000008d1,
+0x00000007,0x0004003b,0x00000007,0x000008d3,
+0x00000007,0x0004003b,0x00000009,0x000008d5,
+0x00000007,0x0004003b,0x00000012,0x000008dd,
+0x00000007,0x0004003b,0x00000007,0x000008df,
+0x00000007,0x0004003b,0x00000007,0x000008e1,
+0x00000007,0x0004003b,0x00000009,0x000008e2,
+0x00000007,0x0004003b,0x00000012,0x000008e9,
+0x00000007,0x0004003b,0x00000012,0x000008ea,
+0x00000007,0x0004003b,0x00000058,0x000008eb,
+0x00000007,0x0004003b,0x00000058,0x000008ed,
+0x00000007,0x0004003b,0x00000007,0x000008ef,
+0x00000007,0x0004003b,0x00000012,0x000008f1,
+0x00000007,0x0004003b,0x00000012,0x000008f2,
+0x00000007,0x0004003b,0x00000012,0x000008f6,
+0x00000007,0x0004003b,0x00000007,0x000008fd,
+0x00000007,0x0004003b,0x00000012,0x000008fe,
+0x00000007,0x0004003b,0x00000007,0x00000900,
+0x00000007,0x0004003b,0x00000007,0x00000902,
+0x00000007,0x00040039,0x00000002,0x0000085b,
+0x0000000f,0x0004003d,0x00000083,0x0000085c,
+0x00000085,0x000300f7,0x0000085e,0x00000000,
+0x000400fa,0x0000085c,0x0000085d,0x0000085e,
+0x000200f8,0x0000085d,0x000200fe,0x0000085f,
+0x000200f8,0x0000085e,0x0004003d,0x00000083,
+0x00000861,0x000000a7,0x000300f7,0x00000863,
+0x00000000,0x000400fa,0x00000861,0x00000862,
+0x00000863,0x000200f8,0x00000862,0x00050041,
+0x000000aa,0x00000864,0x000000a9,0x000000a0,
+0x0004003d,0x00000006,0x00000865,0x00000864,
+0x000600cb,0x00000006,0x00000866,0x00000865,
+0x0000059c,0x0000059c,0x00050041,0x000000aa,
+0x00000867,0x000000a9,0x000000a0,0x0004003d,
+0x00000006,0x00000868,0x00000867,0x000600cb,
+0x00000006,0x00000869,0x00000868,0x000005a9,
+0x0000059c,0x00050041,0x000000aa,0x0000086a,
+0x000000a9,0x0000009d,0x0004003d,0x00000006,
+0x0000086b,0x0000086a,0x000600cb,0x00000006,
+0x0000086c,0x0000086b,0x0000059c,0x0000059c,
+0x00050041,0x000000aa,0x0000086d,0x000000a9,
+0x0000009d,0x0004003d,0x00000006,0x0000086e,
+0x0000086d,0x000600cb,0x00000006,0x0000086f,
+0x0000086e,0x000005a9,0x0000059c,0x00070050,
+0x00000011,0x00000870,0x00000866,0x00000869,
+0x0000086c,0x0000086f,0x000200fe,0x00000870,
+0x000200f8,0x00000863,0x0004003d,0x00000011,
+0x00000873,0x000000a9,0x0009004f,0x00000011,
+0x00000874,0x00000873,0x00000873,0x00000003,
+0x00000002,0x00000001,0x00000000,0x000400cc,
+0x00000011,0x00000875,0x00000874,0x0004003d,
+0x00000006,0x00000877,0x0000016e,0x0003003e,
+0x00000876,0x00000877,0x00050039,0x00000011,
+0x00000878,0x00000079,0x00000876,0x000500c7,
+0x00000011,0x00000879,0x00000875,0x00000878,
+0x0003003e,0x00000872,0x00000879,0x0004003d,
+0x00000011,0x0000087c,0x00000872,0x0003003e,
+0x0000087b,0x0000087c,0x00060039,0x00000034,
+0x0000087d,0x00000044,0x0000087b,0x0000007c,
+0x0003003e,0x0000087a,0x0000087d,0x0004003d,
+0x00000006,0x00000880,0x0000018c,0x0003003e,
+0x0000087f,0x00000880,0x0003003e,0x00000881,
+0x0000007c,0x0004003d,0x00000006,0x00000883,
+0x00000182,0x0003003e,0x00000882,0x00000883,
+0x00070039,0x00000006,0x00000884,0x0000004e,
+0x0000087f,0x00000881,0x00000882,0x0003003e,
+0x0000087e,0x00000884,0x0003003e,0x00000885,
+0x0000009d,0x0003003e,0x00000886,0x0000009d,
+0x0003003e,0x00000887,0x0000009d,0x0004003d,
+0x00000006,0x0000088a,0x0000087e,0x0003003e,
+0x00000889,0x0000088a,0x00080039,0x00000006,
+0x0000088e,0x0000001e,0x00000889,0x0000088b,
+0x0000088c,0x0000088d,0x0004003d,0x00000006,
+0x0000088f,0x0000088b,0x0003003e,0x00000885,
+0x0000088f,0x0004003d,0x00000006,0x00000890,
+0x0000088c,0x0003003e,0x00000886,0x00000890,
+0x0004003d,0x00000006,0x00000891,0x0000088d,
+0x0003003e,0x00000887,0x00000891,0x0003003e,
+0x00000888,0x0000088e,0x0004003d,0x00000006,
+0x00000892,0x00000886,0x000500ac,0x00000083,
+0x00000893,0x00000892,0x0000029f,0x000300f7,
+0x00000895,0x00000000,0x000400fa,0x00000893,
+0x00000894,0x00000895,0x000200f8,0x00000894,
+0x000200fe,0x0000085f,0x000200f8,0x00000895,
+0x0004003d,0x00000006,0x00000898,0x00000182,
+0x000500aa,0x00000083,0x00000899,0x00000898,
+0x000000a0,0x000600a9,0x00000056,0x0000089b,
+0x00000899,0x00000557,0x0000089a,0x0004007c,
+0x00000006,0x0000089c,0x0000089b,0x0003003e,
+0x00000897,0x0000089c,0x0004003d,0x00000083,
+0x0000089f,0x000000d4,0x000600a9,0x00000056,
+0x000008a0,0x0000089f,0x000000c3,0x000000b8,
+0x00050084,0x00000056,0x000008a1,0x0000089e,
+0x000008a0,0x0004007c,0x00000006,0x000008a2,
+0x000008a1,0x0004003d,0x00000006,0x000008a3,
+0x00000885,0x00050080,0x00000006,0x000008a4,
+0x000008a2,0x000008a3,0x0003003e,0x0000089d,
+0x000008a4,0x0004003d,0x00000006,0x000008a6,
+0x0000089d,0x0004003d,0x00000006,0x000008a7,
+0x00000897,0x00050082,0x00000006,0x000008a8,
+0x000008a6,0x000008a7,0x0003003e,0x000008a5,
+0x000008a8,0x0004003d,0x00000006,0x000008ac,
+0x000008a5,0x0003003e,0x000008ab,0x000008ac,
+0x0004003d,0x00000006,0x000008ae,0x00000886,
+0x0003003e,0x000008ad,0x000008ae,0x00070039,
+0x00000008,0x000008b0,0x00000054,0x000008ab,
+0x000008ad,0x000008af,0x0004003d,0x00000006,
+0x000008b1,0x000008af,0x0003003e,0x000008aa,
+0x000008b1,0x0003003e,0x000008a9,0x000008b0,
+0x0004003d,0x00000006,0x000008b3,0x00000888,
+0x000500c2,0x00000006,0x000008b4,0x000008b3,
+0x000000b9,0x00050080,0x00000006,0x000008b5,
+0x000008b4,0x000000a0,0x0003003e,0x000008b2,
+0x000008b5,0x0003003e,0x000008b6,0x00000849,
+0x0003003e,0x000008b7,0x00000849,0x0004003d,
+0x00000011,0x000008b9,0x000000a9,0x0004003d,
+0x00000006,0x000008ba,0x00000897,0x0004003d,
+0x00000006,0x000008bb,0x000008aa,0x00050080,
+0x00000006,0x000008bc,0x000008ba,0x000008bb,
+0x0003003e,0x000008bd,0x000008bc,0x00050039,
+0x00000011,0x000008be,0x00000079,0x000008bd,
+0x000500c7,0x00000011,0x000008bf,0x000008b9,
+0x000008be,0x0003003e,0x000008b8,0x000008bf,
+0x0003003e,0x000008c0,0x0000009d,0x000200f9,
+0x000008c1,0x000200f8,0x000008c1,0x000400f6,
+0x000008c3,0x000008c4,0x00000000,0x000200f9,
+0x000008c5,0x000200f8,0x000008c5,0x0004003d,
+0x00000006,0x000008c6,0x000008c0,0x0004003d,
+0x00000006,0x000008c7,0x000008b2,0x000500b0,
+0x00000083,0x000008c8,0x000008c6,0x000008c7,
+0x000400fa,0x000008c8,0x000008c2,0x000008c3,
+0x000200f8,0x000008c2,0x0004003d,0x00000006,
+0x000008ca,0x000008c0,0x00050084,0x00000006,
+0x000008cb,0x00000092,0x000008ca,0x0004003d,
+0x00000006,0x000008cc,0x00000887,0x00050080,
+0x00000006,0x000008cd,0x000008cb,0x000008cc,
+0x0003003e,0x000008c9,0x000008cd,0x0004003d,
+0x00000006,0x000008ce,0x000008c0,0x0004003d,
+0x00000011,0x000008d0,0x000008b8,0x0003003e,
+0x000008cf,0x000008d0,0x0004003d,0x00000006,
+0x000008d2,0x00000897,0x0003003e,0x000008d1,
+0x000008d2,0x0004003d,0x00000006,0x000008d4,
+0x000008c9,0x0003003e,0x000008d3,0x000008d4,
+0x0004003d,0x00000008,0x000008d6,0x000008a9,
+0x0003003e,0x000008d5,0x000008d6,0x00080039,
+0x00000006,0x000008d7,0x00000075,0x000008cf,
+0x000008d1,0x000008d3,0x000008d5,0x0004007c,
+0x00000056,0x000008d8,0x000008d7,0x00050041,
+0x0000024b,0x000008d9,0x000008b6,0x000008ce,
+0x0003003e,0x000008d9,0x000008d8,0x0004003d,
+0x00000006,0x000008da,0x000008c0,0x0004003d,
+0x00000006,0x000008db,0x000008c9,0x00050080,
+0x00000006,0x000008dc,0x000008db,0x000000a0,
+0x0004003d,0x00000011,0x000008de,0x000008b8,
+0x0003003e,0x000008dd,0x000008de,0x0004003d,
+0x00000006,0x000008e0,0x00000897,0x0003003e,
+0x000008df,0x000008e0,0x0003003e,0x000008e1,
+0x000008dc,0x0004003d,0x00000008,0x000008e3,
+0x000008a9,0x0003003e,0x000008e2,0x000008e3,
+0x00080039,0x00000006,0x000008e4,0x00000075,
+0x000008dd,0x000008df,0x000008e1,0x000008e2,
+0x0004007c,0x00000056,0x000008e5,0x000008e4,
+0x00050041,0x0000024b,0x000008e6,0x000008b7,
+0x000008da,0x0003003e,0x000008e6,0x000008e5,
+0x000200f9,0x000008c4,0x000200f8,0x000008c4,
+0x0004003d,0x00000006,0x000008e7,0x000008c0,
+0x00050080,0x00000006,0x000008e8,0x000008e7,
+0x000000c3,0x0003003e,0x000008c0,0x000008e8,
+0x000200f9,0x000008c1,0x000200f8,0x000008c3,
+0x0004003d,0x00000057,0x000008ec,0x000008b6,
+0x0003003e,0x000008eb,0x000008ec,0x0004003d,
+0x00000057,0x000008ee,0x000008b7,0x0003003e,
+0x000008ed,0x000008ee,0x0004003d,0x00000006,
+0x000008f0,0x00000888,0x0003003e,0x000008ef,
+0x000008f0,0x00090039,0x00000002,0x000008f3,
+0x0000006e,0x000008eb,0x000008ed,0x000008ef,
+0x000008f1,0x000008f2,0x0004003d,0x00000011,
+0x000008f4,0x000008f1,0x0003003e,0x000008e9,
+0x000008f4,0x0004003d,0x00000011,0x000008f5,
+0x000008f2,0x0003003e,0x000008ea,0x000008f5,
+0x00050041,0x00000007,0x000008f7,0x0000087a,
+0x0000009d,0x0004003d,0x00000006,0x000008f8,
+0x000008f7,0x00070050,0x00000011,0x000008f9,
+0x000008f8,0x000008f8,0x000008f8,0x000008f8,
+0x0003003e,0x000008f6,0x000008f9,0x0004003d,
+0x00000083,0x000008fa,0x000000d4,0x000300f7,
+0x000008fc,0x00000000,0x000400fa,0x000008fa,
+0x000008fb,0x000008fc,0x000200f8,0x000008fb,
+0x0004003d,0x00000011,0x000008ff,0x000000a9,
+0x0003003e,0x000008fe,0x000008ff,0x0004003d,
+0x00000006,0x00000901,0x0000089d,0x0003003e,
+0x00000900,0x00000901,0x0003003e,0x00000902,
+0x00000092,0x00070039,0x00000006,0x00000903,
+0x00000017,0x000008fe,0x00000900,0x00000902,
+0x0003003e,0x000008fd,0x00000903,0x0004003d,
+0x00000006,0x00000904,0x000008fd,0x00050041,
+0x00000007,0x00000905,0x0000087a,0x000000a0,
+0x0004003d,0x00000006,0x00000906,0x00000905,
+0x00050041,0x00000007,0x00000907,0x000008f6,
+0x00000904,0x0003003e,0x00000907,0x00000906,
+0x000200f9,0x000008fc,0x000200f8,0x000008fc,
+0x0004003d,0x00000011,0x00000908,0x000008e9,
+0x0004003d,0x00000011,0x00000909,0x000008f6,
+0x00070050,0x00000011,0x0000090a,0x0000017c,
+0x0000017c,0x0000017c,0x0000017c,0x00050082,
+0x00000011,0x0000090b,0x0000090a,0x00000909,
+0x00050084,0x00000011,0x0000090c,0x00000908,
+0x0000090b,0x0004003d,0x00000011,0x0000090d,
+0x000008ea,0x0004003d,0x00000011,0x0000090e,
+0x000008f6,0x00050084,0x00000011,0x0000090f,
+0x0000090d,0x0000090e,0x00050080,0x00000011,
+0x00000910,0x0000090c,0x0000090f,0x00070050,
+0x00000011,0x00000911,0x0000019f,0x0000019f,
+0x0000019f,0x0000019f,0x00050080,0x00000011,
+0x00000912,0x00000910,0x00000911,0x00070050,
+0x00000057,0x00000913,0x0000050d,0x0000050d,
+0x0000050d,0x0000050d,0x000500c2,0x00000011,
+0x00000914,0x00000912,0x00000913,0x000200fe,
+0x00000914,0x00010038,0x00050036,0x0000005d,
+0x00000081,0x00000000,0x0000007f,0x00030037,
+0x0000005e,0x00000080,0x000200f8,0x00000082,
+0x0004003d,0x0000005d,0x00000917,0x00000080,
+0x000200fe,0x00000917,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_1D.inl
new file mode 100644
index 00000000000..1ef3c4e4aaa
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_1D.inl
@@ -0,0 +1,4249 @@
+0x07230203,0x00010300,0x000d000a,0x00000b16,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x00020011,0x0000003d,0x00020011,
+0x00000041,0x00020011,0x00000043,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0009000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x00000a1c,0x00000a8c,0x00000a8e,
+0x00000a9b,0x00060010,0x00000004,0x00000011,
+0x00000040,0x00000001,0x00000001,0x00030003,
+0x00000002,0x000001c2,0x000a0004,0x475f4c47,
+0x4c474f4f,0x70635f45,0x74735f70,0x5f656c79,
+0x656e696c,0x7269645f,0x69746365,0x00006576,
+0x00080004,0x475f4c47,0x4c474f4f,0x6e695f45,
+0x64756c63,0x69645f65,0x74636572,0x00657669,
+0x00090004,0x4b5f4c47,0x735f5248,0x65646168,
+0x75735f72,0x6f726762,0x625f7075,0x63697361,
+0x00000000,0x000a0004,0x4b5f4c47,0x735f5248,
+0x65646168,0x75735f72,0x6f726762,0x635f7075,
+0x7473756c,0x64657265,0x00000000,0x00090004,
+0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,
+0x6f726762,0x735f7075,0x66667568,0x0000656c,
+0x00040005,0x00000004,0x6e69616d,0x00000000,
+0x00080005,0x0000000d,0x45746567,0x646f636e,
+0x53676e69,0x28657a69,0x763b3175,0x003b3375,
+0x00040005,0x0000000b,0x566d756e,0x00736c61,
+0x00050005,0x0000000c,0x6f636e65,0x676e6964,
+0x00000000,0x000a0005,0x00000016,0x63747361,
+0x6f636544,0x49726564,0x6974696e,0x7a696c61,
+0x75762865,0x75763b34,0x00003b32,0x00050005,
+0x00000014,0x636f6c62,0x7461446b,0x00000061,
+0x00050005,0x00000015,0x636f6c62,0x7a69536b,
+0x00005f65,0x00080005,0x0000001c,0x72747865,
+0x42746361,0x28737469,0x3b347576,0x753b3175,
+0x00003b31,0x00040005,0x00000019,0x61746164,
+0x00000000,0x00040005,0x0000001a,0x7366666f,
+0x00007465,0x00040005,0x0000001b,0x426d756e,
+0x00737469,0x00080005,0x00000023,0x6f636564,
+0x45436564,0x3175284d,0x3b31753b,0x753b3175,
+0x00003b31,0x00060005,0x0000001f,0x74726170,
+0x6f697469,0x646e496e,0x00007865,0x00060005,
+0x00000020,0x72617473,0x45664f74,0x61727478,
+0x006d6543,0x00060005,0x00000021,0x61746f74,
+0x646e456c,0x6e696f70,0x00007374,0x00070005,
+0x00000022,0x65736162,0x70646e45,0x746e696f,
+0x65646e49,0x00000078,0x00090005,0x0000002a,
+0x6f636564,0x72546564,0x76287469,0x753b3475,
+0x31753b31,0x3b31753b,0x00000000,0x00040005,
+0x00000026,0x61746164,0x00000000,0x00040005,
+0x00000027,0x7366666f,0x00007465,0x00040005,
+0x00000028,0x426d756e,0x00737469,0x00030005,
+0x00000029,0x00000069,0x00090005,0x00000030,
+0x6f636564,0x75516564,0x28746e69,0x3b347576,
+0x753b3175,0x31753b31,0x0000003b,0x00040005,
+0x0000002c,0x61746164,0x00000000,0x00040005,
+0x0000002d,0x7366666f,0x00007465,0x00040005,
+0x0000002e,0x426d756e,0x00737469,0x00030005,
+0x0000002f,0x00000069,0x000a0005,0x00000037,
+0x6f636564,0x57316564,0x68676965,0x75762874,
+0x75763b34,0x31753b33,0x3b31753b,0x00000000,
+0x00050005,0x00000033,0x67696577,0x61447468,
+0x00006174,0x00050005,0x00000034,0x6f636e65,
+0x676e6964,0x00000000,0x00050005,0x00000035,
+0x576d756e,0x68676965,0x00007374,0x00040005,
+0x00000036,0x65646e69,0x00000078,0x000e0005,
+0x00000042,0x65746e69,0x6c6f7072,0x57657461,
+0x68676965,0x76287374,0x763b3475,0x753b3375,
+0x31753b31,0x3b31753b,0x753b3175,0x75763b31,
+0x00003b32,0x00050005,0x0000003a,0x67696577,
+0x61447468,0x00006174,0x00050005,0x0000003b,
+0x6f636e65,0x676e6964,0x00000000,0x00050005,
+0x0000003c,0x576d756e,0x68676965,0x00007374,
+0x00040005,0x0000003d,0x65646e69,0x00000078,
+0x00050005,0x0000003e,0x64697267,0x74646957,
+0x00000068,0x00040005,0x0000003f,0x69727473,
+0x00006564,0x00040005,0x00000040,0x7366666f,
+0x00007465,0x00060005,0x00000041,0x63617266,
+0x6e6f6974,0x61506c61,0x00007472,0x00080005,
+0x00000047,0x6f636564,0x65576564,0x74686769,
+0x75762873,0x75763b34,0x00003b32,0x00050005,
+0x00000045,0x67696577,0x61447468,0x00006174,
+0x00050005,0x00000046,0x49736f70,0x6f6c426e,
+0x00006b63,0x00050005,0x0000004b,0x68736168,
+0x75283235,0x00003b31,0x00030005,0x0000004a,
+0x00000070,0x00090005,0x00000051,0x656c6573,
+0x61507463,0x74697472,0x286e6f69,0x763b3175,
+0x753b3275,0x00003b31,0x00040005,0x0000004e,
+0x64656573,0x00000000,0x00030005,0x0000004f,
+0x00736f70,0x00060005,0x00000050,0x506d756e,
+0x69747261,0x6e6f6974,0x00000073,0x000a0005,
+0x00000057,0x45746567,0x6f70646e,0x45746e69,
+0x646f636e,0x28676e69,0x753b3175,0x31753b31,
+0x0000003b,0x00080005,0x00000054,0x69617661,
+0x6c62616c,0x646e4565,0x6e696f70,0x74694274,
+0x00000073,0x00060005,0x00000055,0x456d756e,
+0x6f70646e,0x73746e69,0x00000000,0x00050005,
+0x00000056,0x75746361,0x69536c61,0x0000657a,
+0x00070005,0x0000005e,0x65756c62,0x746e6f43,
+0x74636172,0x34697628,0x0000003b,0x00030005,
+0x0000005d,0x00000076,0x00050005,0x00000064,
+0x286d7573,0x3b336976,0x00000000,0x00030005,
+0x00000063,0x00000076,0x00090005,0x00000069,
+0x54746962,0x736e6172,0x53726566,0x656e6769,
+0x69762864,0x69763b34,0x00003b34,0x00030005,
+0x00000067,0x00000061,0x00030005,0x00000068,
+0x00000062,0x000b0005,0x00000071,0x6f636564,
+0x6e456564,0x696f7064,0x2873746e,0x3b346976,
+0x3b346976,0x763b3175,0x763b3475,0x003b3475,
+0x00030005,0x0000006c,0x00004176,0x00030005,
+0x0000006d,0x00004276,0x00040005,0x0000006e,
+0x65646f6d,0x00000000,0x00030005,0x0000006f,
+0x00307065,0x00030005,0x00000070,0x00317065,
+0x000a0005,0x00000078,0x6f636564,0x45316564,
+0x6f70646e,0x28746e69,0x3b347576,0x753b3175,
+0x75763b31,0x00003b33,0x00040005,0x00000074,
+0x61746164,0x00000000,0x00050005,0x00000075,
+0x72617473,0x66664f74,0x00746573,0x00040005,
+0x00000076,0x65646e69,0x00000078,0x00050005,
+0x00000077,0x6f636e65,0x676e6964,0x00000000,
+0x00070005,0x0000007c,0x6c697562,0x74694264,
+0x6b73616d,0x3b317528,0x00000000,0x00040005,
+0x0000007b,0x73746962,0x00000000,0x00080005,
+0x00000080,0x63747361,0x6f636544,0x65546564,
+0x286c6578,0x3b327576,0x00000000,0x00050005,
+0x0000007f,0x49736f70,0x6f6c426e,0x00006b63,
+0x00070005,0x00000085,0x50746567,0x4431736f,
+0x61727241,0x69762879,0x00003b33,0x00030005,
+0x00000084,0x00736f70,0x00070005,0x0000008a,
+0x6f636564,0x47526564,0x76284142,0x753b3275,
+0x00003b31,0x00050005,0x00000088,0x65786574,
+0x736f506c,0x00000000,0x00040005,0x00000089,
+0x6579616c,0x00000072,0x00090005,0x00000093,
+0x43746567,0x726f6c6f,0x65646e49,0x66762878,
+0x66763b33,0x66763b33,0x00003b33,0x00040005,
+0x00000090,0x6f6c6f63,0x00000072,0x00050005,
+0x00000091,0x456e696d,0x6f70646e,0x00746e69,
+0x00050005,0x00000092,0x4578616d,0x6f70646e,
+0x00746e69,0x00080005,0x00000099,0x41746567,
+0x6168706c,0x65646e49,0x31752878,0x3b31753b,
+0x003b3175,0x00040005,0x00000096,0x68706c61,
+0x00000061,0x00050005,0x00000097,0x416e696d,
+0x6168706c,0x00000000,0x00050005,0x00000098,
+0x4178616d,0x6168706c,0x00000000,0x000a0005,
+0x0000009f,0x706d6f63,0x45657475,0x6f70646e,
+0x73746e69,0x33757628,0x3375763b,0x3375763b,
+0x0000003b,0x00050005,0x0000009c,0x43626772,
+0x726f6c6f,0x00000000,0x00050005,0x0000009d,
+0x456e696d,0x6f70646e,0x00746e69,0x00050005,
+0x0000009e,0x4578616d,0x6f70646e,0x00746e69,
+0x00070005,0x000000a4,0x6f636e65,0x6c416564,
+0x28616870,0x753b3175,0x00003b31,0x00040005,
+0x000000a2,0x756c6176,0x00000065,0x00040005,
+0x000000a3,0x65786574,0x0064496c,0x00080005,
+0x000000a8,0x6b636170,0x6f6c6f43,0x526f5472,
+0x36354247,0x75762835,0x00003b33,0x00040005,
+0x000000a7,0x6f6c6f63,0x00000072,0x00040005,
+0x000000aa,0x69427174,0x00007374,0x00050005,
+0x000000cb,0x63747361,0x636f6c42,0x0000006b,
+0x00050005,0x000000ce,0x636f6c62,0x7a69536b,
+0x00000065,0x00050005,0x000000d2,0x6f636564,
+0x72456564,0x00726f72,0x00050005,0x000000d4,
+0x64696f76,0x65747845,0x0000746e,0x00040005,
+0x000000e0,0x73746962,0x00003130,0x00040005,
+0x000000e6,0x73746962,0x00003332,0x00040005,
+0x000000ea,0x34746962,0x00000000,0x00040005,
+0x000000f0,0x73746962,0x00003635,0x00040005,
+0x000000f5,0x73746962,0x00003837,0x00030005,
+0x000000fa,0x00000068,0x00050005,0x000000ff,
+0x6c617564,0x6e616c50,0x00000065,0x00030005,
+0x00000109,0x00000072,0x00060005,0x00000114,
+0x67696577,0x72477468,0x69536469,0x0000657a,
+0x00060005,0x00000170,0x67696577,0x6e457468,
+0x69646f63,0x0000676e,0x00050005,0x00000187,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x0000018a,0x576d756e,0x68676965,0x00007374,
+0x00060005,0x00000193,0x67696577,0x61447468,
+0x69536174,0x0000657a,0x00040005,0x00000194,
+0x61726170,0x0000006d,0x00040005,0x00000196,
+0x61726170,0x0000006d,0x00060005,0x000001a7,
+0x506d756e,0x69747261,0x6e6f6974,0x00000073,
+0x00060005,0x000001b1,0x74726170,0x6f697469,
+0x6565536e,0x00000064,0x00030005,0x000001c2,
+0x00000069,0x00030005,0x000001c7,0x0000006a,
+0x00040005,0x000001ce,0x72617473,0x00000074,
+0x00050005,0x000001e1,0x4c6d756e,0x6942776f,
+0x00007374,0x00040005,0x000001e4,0x42776f6c,
+0x00737469,0x00050005,0x000001ed,0x68676968,
+0x73746942,0x00000000,0x00030005,0x00000204,
+0x006d6563,0x00050005,0x0000020f,0x536d6563,
+0x63656c65,0x00726f74,0x00040005,0x00000214,
+0x65736162,0x006d6543,0x00080005,0x0000021f,
+0x70646e65,0x746e696f,0x72655073,0x74726150,
+0x6f697469,0x0000006e,0x00060005,0x0000022d,
+0x657a6973,0x7845664f,0x43617274,0x00006d65,
+0x00050005,0x00000235,0x72747865,0x6d654361,
+0x00000000,0x00040005,0x00000236,0x61726170,
+0x0000006d,0x00040005,0x00000238,0x61726170,
+0x0000006d,0x00040005,0x0000023a,0x61726170,
+0x0000006d,0x00040005,0x0000023d,0x6c6c7566,
+0x006d6543,0x00040005,0x00000242,0x6c61566d,
+0x00006575,0x00040005,0x0000024a,0x6c615663,
+0x00736575,0x00050005,0x00000262,0x65736162,
+0x73616c43,0x00000073,0x00050005,0x00000271,
+0x6d756e69,0x73746942,0x00000000,0x00040005,
+0x00000274,0x636f6c62,0x0000006b,0x00040005,
+0x0000027b,0x61726170,0x0000006d,0x00040005,
+0x0000027d,0x61726170,0x0000006d,0x00040005,
+0x0000027e,0x61726170,0x0000006d,0x00050005,
+0x00000280,0x6b636170,0x72546465,0x00737469,
+0x00040005,0x000002a3,0x42776f6c,0x00737469,
+0x00040005,0x000002a4,0x61726170,0x0000006d,
+0x00040005,0x000002a6,0x61726170,0x0000006d,
+0x00040005,0x000002a8,0x61726170,0x0000006d,
+0x00030005,0x000002ac,0x0000006a,0x00040005,
+0x000002ba,0x6f636564,0x00646564,0x00050005,
+0x000003a4,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x000003b2,0x6d756e69,0x73746942,
+0x00000000,0x00040005,0x000003b5,0x636f6c62,
+0x0000006b,0x00040005,0x000003b9,0x61726170,
+0x0000006d,0x00040005,0x000003bb,0x61726170,
+0x0000006d,0x00040005,0x000003bd,0x61726170,
+0x0000006d,0x00060005,0x000003bf,0x6b636170,
+0x75516465,0x73746e69,0x00000000,0x00040005,
+0x000003d1,0x42776f6c,0x00737469,0x00040005,
+0x000003dd,0x6f636564,0x00646564,0x00050005,
+0x00000415,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000429,0x426d756e,0x00737469,
+0x00040005,0x00000431,0x7366666f,0x00007465,
+0x00030005,0x00000438,0x00000077,0x00040005,
+0x0000043b,0x61726170,0x0000006d,0x00040005,
+0x0000043d,0x61726170,0x0000006d,0x00040005,
+0x0000043f,0x61726170,0x0000006d,0x00040005,
+0x00000441,0x61726170,0x0000006d,0x00050005,
+0x0000045a,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000464,0x7366666f,0x00007465,
+0x00030005,0x0000046b,0x00000077,0x00040005,
+0x0000046e,0x61726170,0x0000006d,0x00040005,
+0x00000470,0x61726170,0x0000006d,0x00040005,
+0x00000472,0x61726170,0x0000006d,0x00040005,
+0x00000474,0x61726170,0x0000006d,0x00050005,
+0x00000488,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x0000048d,0x7366666f,0x00007465,
+0x00030005,0x00000491,0x00000077,0x00040005,
+0x00000492,0x61726170,0x0000006d,0x00040005,
+0x00000494,0x61726170,0x0000006d,0x00040005,
+0x00000496,0x61726170,0x0000006d,0x00040005,
+0x00000499,0x75716e75,0x00746e61,0x00050005,
+0x000004a5,0x65646e69,0x6c626178,0x00000065,
+0x00060005,0x000004ba,0x67696577,0x6e497468,
+0x65636964,0x00000073,0x00040005,0x000004c8,
+0x67696577,0x00737468,0x00040005,0x000004c9,
+0x61726170,0x0000006d,0x00040005,0x000004cb,
+0x61726170,0x0000006d,0x00040005,0x000004cd,
+0x61726170,0x0000006d,0x00040005,0x000004cf,
+0x61726170,0x0000006d,0x00040005,0x000004d3,
+0x61726170,0x0000006d,0x00040005,0x000004d5,
+0x61726170,0x0000006d,0x00040005,0x000004d7,
+0x61726170,0x0000006d,0x00040005,0x000004d9,
+0x61726170,0x0000006d,0x00040005,0x000004dd,
+0x61726170,0x0000006d,0x00040005,0x000004df,
+0x61726170,0x0000006d,0x00040005,0x000004e1,
+0x61726170,0x0000006d,0x00040005,0x000004e3,
+0x61726170,0x0000006d,0x00040005,0x000004e7,
+0x61726170,0x0000006d,0x00040005,0x000004e9,
+0x61726170,0x0000006d,0x00040005,0x000004eb,
+0x61726170,0x0000006d,0x00040005,0x000004ed,
+0x61726170,0x0000006d,0x00030005,0x000004f2,
+0x00313177,0x00040005,0x000004fa,0x74636166,
+0x0073726f,0x00050005,0x00000519,0x6c616373,
+0x63614665,0x00726f74,0x00070005,0x00000524,
+0x6f6d6f68,0x656e6567,0x4373756f,0x64726f6f,
+0x00000073,0x00050005,0x00000527,0x64697267,
+0x726f6f43,0x00007364,0x00060005,0x00000532,
+0x65746e69,0x6c617267,0x74726150,0x00000000,
+0x00060005,0x00000536,0x63617266,0x6e6f6974,
+0x61506c61,0x00007472,0x00050005,0x0000053b,
+0x64697267,0x74646957,0x00000068,0x00030005,
+0x0000053e,0x00003076,0x00040005,0x00000546,
+0x67696577,0x00737468,0x00040005,0x0000054c,
+0x61726170,0x0000006d,0x00040005,0x0000054e,
+0x61726170,0x0000006d,0x00040005,0x00000550,
+0x61726170,0x0000006d,0x00040005,0x00000552,
+0x61726170,0x0000006d,0x00040005,0x00000554,
+0x61726170,0x0000006d,0x00040005,0x00000556,
+0x61726170,0x0000006d,0x00040005,0x00000557,
+0x61726170,0x0000006d,0x00040005,0x00000558,
+0x61726170,0x0000006d,0x00040005,0x0000055f,
+0x61726170,0x0000006d,0x00040005,0x00000561,
+0x61726170,0x0000006d,0x00040005,0x00000563,
+0x61726170,0x0000006d,0x00040005,0x00000565,
+0x61726170,0x0000006d,0x00040005,0x00000567,
+0x61726170,0x0000006d,0x00040005,0x00000569,
+0x61726170,0x0000006d,0x00040005,0x0000056a,
+0x61726170,0x0000006d,0x00040005,0x0000056b,
+0x61726170,0x0000006d,0x00040005,0x000005b5,
+0x6d756e72,0x00000000,0x00040005,0x000005b6,
+0x61726170,0x0000006d,0x00040005,0x000005b9,
+0x64656573,0x00000041,0x00040005,0x000005c5,
+0x64656573,0x00000042,0x00040005,0x000005d8,
+0x66696873,0x00317374,0x00040005,0x000005e3,
+0x66696873,0x00327374,0x00040005,0x000005f6,
+0x75736572,0x0000746c,0x00030005,0x0000064d,
+0x00000069,0x00050005,0x00000655,0x6f636e65,
+0x676e6964,0x00000000,0x00050005,0x00000663,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000666,0x61726170,0x0000006d,0x00040005,
+0x00000668,0x61726170,0x0000006d,0x00030005,
+0x000006c2,0x0000306c,0x00030005,0x000006cb,
+0x0000316c,0x00040005,0x000006e9,0x61726170,
+0x0000006d,0x00040005,0x000006eb,0x61726170,
+0x0000006d,0x00040005,0x00000738,0x61726170,
+0x0000006d,0x00040005,0x0000073c,0x61726170,
+0x0000006d,0x00040005,0x00000748,0x61726170,
+0x0000006d,0x00040005,0x0000074c,0x61726170,
+0x0000006d,0x00040005,0x00000754,0x61726170,
+0x0000006d,0x00040005,0x00000756,0x61726170,
+0x0000006d,0x00040005,0x0000075b,0x61726170,
+0x0000006d,0x00040005,0x00000772,0x61726170,
+0x0000006d,0x00040005,0x00000778,0x61726170,
+0x0000006d,0x00040005,0x00000782,0x426d756e,
+0x00737469,0x00040005,0x0000078a,0x7366666f,
+0x00007465,0x00030005,0x00000793,0x00007065,
+0x00040005,0x00000796,0x61726170,0x0000006d,
+0x00040005,0x00000798,0x61726170,0x0000006d,
+0x00040005,0x0000079a,0x61726170,0x0000006d,
+0x00040005,0x0000079c,0x61726170,0x0000006d,
+0x00050005,0x00000804,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x0000080e,0x7366666f,
+0x00007465,0x00030005,0x00000817,0x00007065,
+0x00040005,0x0000081a,0x61726170,0x0000006d,
+0x00040005,0x0000081c,0x61726170,0x0000006d,
+0x00040005,0x0000081e,0x61726170,0x0000006d,
+0x00040005,0x00000820,0x61726170,0x0000006d,
+0x00050005,0x00000832,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000837,0x7366666f,
+0x00007465,0x00030005,0x0000083d,0x00000077,
+0x00040005,0x0000083e,0x61726170,0x0000006d,
+0x00040005,0x00000840,0x61726170,0x0000006d,
+0x00040005,0x00000842,0x61726170,0x0000006d,
+0x00040005,0x00000845,0x75716e75,0x00746e61,
+0x00050005,0x00000852,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000860,0x426d756e,
+0x00737469,0x00040005,0x00000869,0x6b73616d,
+0x00000000,0x00050005,0x00000894,0x67696577,
+0x61447468,0x00006174,0x00040005,0x00000898,
+0x61726170,0x0000006d,0x00040005,0x0000089c,
+0x67696577,0x00737468,0x00040005,0x0000089d,
+0x61726170,0x0000006d,0x00060005,0x000008a0,
+0x74726170,0x6f697469,0x646e496e,0x00007865,
+0x00040005,0x000008a1,0x61726170,0x0000006d,
+0x00040005,0x000008a3,0x61726170,0x0000006d,
+0x00040005,0x000008a4,0x61726170,0x0000006d,
+0x00060005,0x000008a7,0x72617473,0x45664f74,
+0x61727478,0x006d6543,0x00060005,0x000008a8,
+0x61746f74,0x646e456c,0x6e696f70,0x00007374,
+0x00070005,0x000008a9,0x65736162,0x70646e45,
+0x746e696f,0x65646e49,0x00000078,0x00030005,
+0x000008aa,0x006d6563,0x00040005,0x000008ab,
+0x61726170,0x0000006d,0x00040005,0x000008ad,
+0x61726170,0x0000006d,0x00040005,0x000008ae,
+0x61726170,0x0000006d,0x00040005,0x000008af,
+0x61726170,0x0000006d,0x00060005,0x000008b9,
+0x70646e65,0x746e696f,0x61745373,0x00007472,
+0x00060005,0x000008bf,0x70646e65,0x746e696f,
+0x646e4573,0x00000000,0x00080005,0x000008c7,
+0x69617661,0x6c62616c,0x646e4565,0x6e696f70,
+0x74694274,0x00000073,0x00070005,0x000008cb,
+0x70646e65,0x746e696f,0x6f636e45,0x676e6964,
+0x00000000,0x00070005,0x000008cc,0x75746361,
+0x6e456c61,0x696f7064,0x6942746e,0x00007374,
+0x00040005,0x000008cd,0x61726170,0x0000006d,
+0x00040005,0x000008cf,0x61726170,0x0000006d,
+0x00040005,0x000008d1,0x61726170,0x0000006d,
+0x00070005,0x000008d4,0x456d756e,0x6f70646e,
+0x50746e69,0x73726961,0x00000000,0x00030005,
+0x000008d8,0x00004176,0x00030005,0x000008d9,
+0x00004276,0x00040005,0x000008da,0x61447065,
+0x00006174,0x00040005,0x000008df,0x61726170,
+0x0000006d,0x00030005,0x000008e2,0x00000069,
+0x00040005,0x000008eb,0x64497065,0x00000078,
+0x00040005,0x000008f1,0x61726170,0x0000006d,
+0x00040005,0x000008f3,0x61726170,0x0000006d,
+0x00040005,0x000008f5,0x61726170,0x0000006d,
+0x00040005,0x000008f7,0x61726170,0x0000006d,
+0x00040005,0x000008ff,0x61726170,0x0000006d,
+0x00040005,0x00000901,0x61726170,0x0000006d,
+0x00040005,0x00000903,0x61726170,0x0000006d,
+0x00040005,0x00000904,0x61726170,0x0000006d,
+0x00030005,0x0000090b,0x00307065,0x00030005,
+0x0000090c,0x00317065,0x00040005,0x0000090d,
+0x61726170,0x0000006d,0x00040005,0x0000090f,
+0x61726170,0x0000006d,0x00040005,0x00000911,
+0x61726170,0x0000006d,0x00040005,0x00000913,
+0x61726170,0x0000006d,0x00040005,0x00000914,
+0x61726170,0x0000006d,0x00070005,0x00000918,
+0x67696577,0x50737468,0x68437265,0x656e6e61,
+0x0000006c,0x00030005,0x0000091f,0x00736363,
+0x00040005,0x00000920,0x61726170,0x0000006d,
+0x00040005,0x00000922,0x61726170,0x0000006d,
+0x00040005,0x00000924,0x61726170,0x0000006d,
+0x00050005,0x0000093d,0x636f6c62,0x736f506b,
+0x00000000,0x00050005,0x0000093f,0x67616d69,
+0x6f666e49,0x00000000,0x00060006,0x0000093f,
+0x00000000,0x636f6c62,0x7a69536b,0x00000065,
+0x00060006,0x0000093f,0x00000001,0x65736162,
+0x6579614c,0x00000072,0x00060006,0x0000093f,
+0x00000002,0x6c616d73,0x6f6c426c,0x00006b63,
+0x00060005,0x00000941,0x75705f75,0x6f436873,
+0x6174736e,0x0000746e,0x00050005,0x00000946,
+0x49736f70,0x6f6c426e,0x00006b63,0x00050005,
+0x0000094d,0x49637273,0x6567616d,0x00000000,
+0x00040005,0x00000956,0x61726170,0x0000006d,
+0x00040005,0x0000095a,0x61726170,0x0000006d,
+0x00040005,0x0000095c,0x61726170,0x0000006d,
+0x00050005,0x00000964,0x6f6c6f63,0x6e694c72,
+0x00000065,0x00030005,0x00000969,0x00000078,
+0x00040005,0x00000973,0x65646e69,0x00000078,
+0x00030005,0x00000980,0x00000078,0x00040005,
+0x0000098a,0x65646e69,0x00000078,0x00050005,
+0x00000997,0x43677661,0x726f6c6f,0x00000000,
+0x00050005,0x0000099e,0x436e696d,0x726f6c6f,
+0x00000000,0x00050005,0x000009a1,0x4378616d,
+0x726f6c6f,0x00000000,0x00030005,0x000009ad,
+0x00007864,0x00040005,0x000009b3,0x31766f63,
+0x00000000,0x00040005,0x000009bb,0x32766f63,
+0x00000000,0x00040005,0x000009c5,0x4d766f63,
+0x00007461,0x00060005,0x000009e3,0x6e697270,
+0x61706963,0x6978416c,0x00000073,0x00040005,
+0x000009f0,0x6e67616d,0x00000000,0x00050005,
+0x00000a0c,0x74736964,0x65636e61,0x00000000,
+0x00050005,0x00000a11,0x446e696d,0x61747369,
+0x0065636e,0x00050005,0x00000a14,0x4478616d,
+0x61747369,0x0065636e,0x00040005,0x00000a17,
+0x69646e69,0x00736563,0x00080005,0x00000a1c,
+0x535f6c67,0x72676275,0x4970756f,0x636f766e,
+0x6f697461,0x0044496e,0x00050005,0x00000a25,
+0x4d6e696d,0x6e497861,0x00786564,0x00050005,
+0x00000a30,0x566e696d,0x65756c61,0x00000000,
+0x00050005,0x00000a33,0x5678616d,0x65756c61,
+0x00000000,0x00040005,0x00000a36,0x65646e69,
+0x00000078,0x00040005,0x00000a3d,0x61726170,
+0x0000006d,0x00040005,0x00000a3f,0x61726170,
+0x0000006d,0x00040005,0x00000a41,0x61726170,
+0x0000006d,0x00040005,0x00000a46,0x6b73616d,
+0x00000000,0x00040005,0x00000a62,0x6b636170,
+0x00006465,0x00040005,0x00000a73,0x6e617571,
+0x00000074,0x00040005,0x00000a8b,0x61636f6c,
+0x0064496c,0x00060005,0x00000a8c,0x535f6c67,
+0x72676275,0x4970756f,0x00000044,0x00060005,
+0x00000a8e,0x535f6c67,0x72676275,0x5370756f,
+0x00657a69,0x00040005,0x00000a93,0x636f6c62,
+0x0064496b,0x00040005,0x00000a96,0x65786574,
+0x0064496c,0x00050005,0x00000a99,0x65786574,
+0x6f6f436c,0x00006472,0x00060005,0x00000a9b,
+0x575f6c67,0x476b726f,0x70756f72,0x00004449,
+0x00040005,0x00000aae,0x6579616c,0x00000072,
+0x00060005,0x00000ab5,0x72727563,0x54746e65,
+0x6c657865,0x00000000,0x00040005,0x00000ab6,
+0x61726170,0x0000006d,0x00040005,0x00000ab8,
+0x61726170,0x0000006d,0x00050005,0x00000abb,
+0x456e696d,0x6f70646e,0x00746e69,0x00050005,
+0x00000abc,0x4578616d,0x6f70646e,0x00746e69,
+0x00040005,0x00000abd,0x61726170,0x0000006d,
+0x00040005,0x00000ac0,0x61726170,0x0000006d,
+0x00040005,0x00000ac1,0x61726170,0x0000006d,
+0x00050005,0x00000ac5,0x70646e65,0x746e696f,
+0x00000073,0x00040005,0x00000ac6,0x61726170,
+0x0000006d,0x00040005,0x00000ac9,0x61726170,
+0x0000006d,0x00040005,0x00000acd,0x65646e69,
+0x00000078,0x00040005,0x00000adc,0x61726170,
+0x0000006d,0x00040005,0x00000add,0x61726170,
+0x0000006d,0x00040005,0x00000ade,0x61726170,
+0x0000006d,0x00040005,0x00000aeb,0x75736572,
+0x0000746c,0x00040005,0x00000aec,0x61726170,
+0x0000006d,0x00040005,0x00000aef,0x61726170,
+0x0000006d,0x00050005,0x00000b07,0x49747364,
+0x6567616d,0x00000000,0x00040005,0x00000b12,
+0x61726170,0x0000006d,0x00050048,0x0000093f,
+0x00000000,0x00000023,0x00000000,0x00050048,
+0x0000093f,0x00000001,0x00000023,0x00000008,
+0x00050048,0x0000093f,0x00000002,0x00000023,
+0x0000000c,0x00030047,0x0000093f,0x00000002,
+0x00040047,0x0000094d,0x00000022,0x00000000,
+0x00040047,0x0000094d,0x00000021,0x00000000,
+0x00030047,0x0000094d,0x00000018,0x00030047,
+0x00000a1c,0x00000000,0x00040047,0x00000a1c,
+0x0000000b,0x00000029,0x00030047,0x00000a1d,
+0x00000000,0x00030047,0x00000a22,0x00000000,
+0x00030047,0x00000a24,0x00000000,0x00040047,
+0x00000a8c,0x0000000b,0x00000028,0x00030047,
+0x00000a8e,0x00000000,0x00040047,0x00000a8e,
+0x0000000b,0x00000024,0x00030047,0x00000a8f,
+0x00000000,0x00030047,0x00000a91,0x00000000,
+0x00040047,0x00000a9b,0x0000000b,0x0000001a,
+0x00040047,0x00000b07,0x00000022,0x00000000,
+0x00040047,0x00000b07,0x00000021,0x00000001,
+0x00030047,0x00000b07,0x00000019,0x00040047,
+0x00000b15,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000000,
+0x00040020,0x00000007,0x00000007,0x00000006,
+0x00040017,0x00000008,0x00000006,0x00000003,
+0x00040020,0x00000009,0x00000007,0x00000008,
+0x00050021,0x0000000a,0x00000006,0x00000007,
+0x00000009,0x00040017,0x0000000f,0x00000006,
+0x00000004,0x00040020,0x00000010,0x00000007,
+0x0000000f,0x00040017,0x00000011,0x00000006,
+0x00000002,0x00040020,0x00000012,0x00000007,
+0x00000011,0x00050021,0x00000013,0x00000002,
+0x00000010,0x00000012,0x00060021,0x00000018,
+0x00000006,0x00000010,0x00000007,0x00000007,
+0x00070021,0x0000001e,0x00000006,0x00000007,
+0x00000007,0x00000007,0x00000007,0x00070021,
+0x00000025,0x00000006,0x00000010,0x00000007,
+0x00000007,0x00000007,0x00070021,0x00000032,
+0x00000006,0x00000010,0x00000009,0x00000007,
+0x00000007,0x000b0021,0x00000039,0x00000006,
+0x00000010,0x00000009,0x00000007,0x00000007,
+0x00000007,0x00000007,0x00000007,0x00000012,
+0x00050021,0x00000044,0x00000011,0x00000010,
+0x00000011,0x00040021,0x00000049,0x00000006,
+0x00000007,0x00060021,0x0000004d,0x00000006,
+0x00000007,0x00000012,0x00000007,0x00060021,
+0x00000053,0x00000008,0x00000007,0x00000007,
+0x00000007,0x00040015,0x00000059,0x00000020,
+0x00000001,0x00040017,0x0000005a,0x00000059,
+0x00000004,0x00040020,0x0000005b,0x00000007,
+0x0000005a,0x00040021,0x0000005c,0x0000005a,
+0x0000005b,0x00040017,0x00000060,0x00000059,
+0x00000003,0x00040020,0x00000061,0x00000007,
+0x00000060,0x00040021,0x00000062,0x00000059,
+0x00000061,0x00050021,0x00000066,0x00000002,
+0x0000005b,0x0000005b,0x00080021,0x0000006b,
+0x00000002,0x0000005b,0x0000005b,0x00000007,
+0x00000010,0x00000010,0x00070021,0x00000073,
+0x00000006,0x00000010,0x00000007,0x00000007,
+0x00000009,0x00040021,0x0000007a,0x0000000f,
+0x00000007,0x00040021,0x0000007e,0x0000000f,
+0x00000011,0x00040017,0x00000082,0x00000059,
+0x00000002,0x00040021,0x00000083,0x00000082,
+0x00000061,0x00050021,0x00000087,0x0000000f,
+0x00000012,0x00000007,0x00030016,0x0000008c,
+0x00000020,0x00040017,0x0000008d,0x0000008c,
+0x00000003,0x00040020,0x0000008e,0x00000007,
+0x0000008d,0x00060021,0x0000008f,0x00000006,
+0x0000008e,0x0000008e,0x0000008e,0x00060021,
+0x00000095,0x00000006,0x00000007,0x00000007,
+0x00000007,0x00060021,0x0000009b,0x00000002,
+0x00000009,0x00000009,0x00000009,0x00050021,
+0x000000a1,0x00000011,0x00000007,0x00000007,
+0x00040021,0x000000a6,0x00000006,0x00000009,
+0x0004002b,0x00000006,0x000000b0,0x00000008,
+0x0004002b,0x00000006,0x000000b1,0x00000007,
+0x0005002c,0x00000011,0x000000b2,0x000000b0,
+0x000000b1,0x0004002b,0x00000006,0x000000b4,
+0x00000004,0x0004002b,0x00000006,0x000000b5,
+0x00000002,0x0005002c,0x00000011,0x000000b6,
+0x000000b4,0x000000b5,0x0004002b,0x00000006,
+0x000000b8,0x00000005,0x0004002b,0x00000006,
+0x000000b9,0x00000003,0x0005002c,0x00000011,
+0x000000ba,0x000000b8,0x000000b9,0x0004002b,
+0x00000006,0x000000c0,0x00000000,0x0004002b,
+0x00000006,0x000000c3,0x00000001,0x00040020,
+0x000000ca,0x00000006,0x0000000f,0x0004003b,
+0x000000ca,0x000000cb,0x00000006,0x00040020,
+0x000000cd,0x00000006,0x00000011,0x0004003b,
+0x000000cd,0x000000ce,0x00000006,0x00020014,
+0x000000d0,0x00040020,0x000000d1,0x00000006,
+0x000000d0,0x0004003b,0x000000d1,0x000000d2,
+0x00000006,0x0003002a,0x000000d0,0x000000d3,
+0x0004003b,0x000000d1,0x000000d4,0x00000006,
+0x00040020,0x000000d5,0x00000006,0x00000006,
+0x0004002b,0x00000006,0x000000d8,0x000001ff,
+0x0004002b,0x00000006,0x000000da,0x000001fc,
+0x0004002b,0x00000059,0x000000e3,0x00000000,
+0x0004002b,0x00000059,0x000000e4,0x00000002,
+0x0004002b,0x00000059,0x000000ed,0x00000004,
+0x0004002b,0x00000059,0x000000ee,0x00000001,
+0x0004002b,0x00000059,0x000000f3,0x00000005,
+0x0004002b,0x00000059,0x000000f8,0x00000007,
+0x0004002b,0x00000059,0x000000fd,0x00000009,
+0x0004003b,0x000000d1,0x000000ff,0x00000006,
+0x0004002b,0x00000059,0x00000102,0x0000000a,
+0x0004003b,0x000000cd,0x00000114,0x00000006,
+0x0004002b,0x00000006,0x00000115,0x0000000c,
+0x0004002b,0x00000006,0x0000011f,0x00000006,
+0x0004002b,0x00000006,0x0000012b,0x0000000a,
+0x0005002c,0x00000011,0x0000012c,0x0000011f,
+0x0000012b,0x0005002c,0x00000011,0x00000132,
+0x0000012b,0x0000011f,0x00030029,0x000000d0,
+0x00000134,0x00040017,0x00000169,0x000000d0,
+0x00000002,0x00040020,0x0000016f,0x00000006,
+0x00000008,0x0004003b,0x0000016f,0x00000170,
+0x00000006,0x0004002b,0x00000006,0x00000171,
+0x00000010,0x0004001c,0x00000172,0x00000008,
+0x00000171,0x0006002c,0x00000008,0x00000173,
+0x000000c0,0x000000c0,0x000000c0,0x0006002c,
+0x00000008,0x00000174,0x000000c0,0x000000c0,
+0x000000c3,0x0006002c,0x00000008,0x00000175,
+0x000000c3,0x000000c0,0x000000c0,0x0006002c,
+0x00000008,0x00000176,0x000000c0,0x000000c0,
+0x000000b5,0x0006002c,0x00000008,0x00000177,
+0x000000c0,0x000000c3,0x000000c0,0x0006002c,
+0x00000008,0x00000178,0x000000c3,0x000000c0,
+0x000000c3,0x0006002c,0x00000008,0x00000179,
+0x000000c0,0x000000c0,0x000000b9,0x0006002c,
+0x00000008,0x0000017a,0x000000c0,0x000000c3,
+0x000000c3,0x0006002c,0x00000008,0x0000017b,
+0x000000c3,0x000000c0,0x000000b5,0x0006002c,
+0x00000008,0x0000017c,0x000000c0,0x000000c0,
+0x000000b4,0x0006002c,0x00000008,0x0000017d,
+0x000000c0,0x000000c3,0x000000b5,0x0006002c,
+0x00000008,0x0000017e,0x000000c3,0x000000c0,
+0x000000b9,0x0006002c,0x00000008,0x0000017f,
+0x000000c0,0x000000c0,0x000000b8,0x0013002c,
+0x00000172,0x00000180,0x00000173,0x00000173,
+0x00000174,0x00000175,0x00000176,0x00000177,
+0x00000178,0x00000179,0x00000173,0x00000173,
+0x0000017a,0x0000017b,0x0000017c,0x0000017d,
+0x0000017e,0x0000017f,0x0004002b,0x00000059,
+0x00000182,0x00000003,0x00040020,0x00000186,
+0x00000007,0x00000172,0x0004003b,0x000000d5,
+0x0000018a,0x00000006,0x0004003b,0x000000d5,
+0x00000193,0x00000006,0x0004002b,0x00000006,
+0x0000019a,0x00000018,0x0004002b,0x00000006,
+0x0000019d,0x00000060,0x0004002b,0x00000006,
+0x000001a1,0x00000040,0x0004003b,0x000000d5,
+0x000001a7,0x00000006,0x0004002b,0x00000059,
+0x000001aa,0x0000000b,0x0004003b,0x000000d5,
+0x000001b1,0x00000006,0x0004002b,0x00000059,
+0x000001b4,0x0000000d,0x0004002b,0x00000006,
+0x000001c4,0x00000020,0x0004002b,0x00000006,
+0x000001d0,0x0000001f,0x0004002b,0x00000006,
+0x00000201,0x00000080,0x0004002b,0x00000059,
+0x00000212,0x00000017,0x0004002b,0x00000059,
+0x00000217,0x00000019,0x00040020,0x00000270,
+0x00000007,0x00000059,0x0007002c,0x0000005a,
+0x000002b4,0x000000e4,0x000000ed,0x000000f3,
+0x000000f8,0x0004002b,0x00000006,0x000002bb,
+0x00000100,0x0004001c,0x000002bc,0x00000006,
+0x000002bb,0x0004002b,0x00000006,0x000002bd,
+0x00000021,0x0004002b,0x00000006,0x000002be,
+0x00000009,0x0004002b,0x00000006,0x000002bf,
+0x00000022,0x0004002b,0x00000006,0x000002c0,
+0x00000028,0x0004002b,0x00000006,0x000002c1,
+0x00000029,0x0004002b,0x00000006,0x000002c2,
+0x0000002a,0x0004002b,0x00000006,0x000002c3,
+0x00000011,0x0004002b,0x00000006,0x000002c4,
+0x00000012,0x0004002b,0x00000006,0x000002c5,
+0x00000024,0x0004002b,0x00000006,0x000002c6,
+0x00000014,0x0004002b,0x00000006,0x000002c7,
+0x00000015,0x0004002b,0x00000006,0x000002c8,
+0x00000016,0x0004002b,0x00000006,0x000002c9,
+0x00000025,0x0004002b,0x00000006,0x000002ca,
+0x00000019,0x0004002b,0x00000006,0x000002cb,
+0x0000001a,0x0004002b,0x00000006,0x000002cc,
+0x00000026,0x0004002b,0x00000006,0x000002cd,
+0x00000280,0x0004002b,0x00000006,0x000002ce,
+0x00000281,0x0004002b,0x00000006,0x000002cf,
+0x00000282,0x0004002b,0x00000006,0x000002d0,
+0x000002a0,0x0004002b,0x00000006,0x000002d1,
+0x00000041,0x0004002b,0x00000006,0x000002d2,
+0x00000042,0x0004002b,0x00000006,0x000002d3,
+0x00000044,0x0004002b,0x00000006,0x000002d4,
+0x00000045,0x0004002b,0x00000006,0x000002d5,
+0x00000046,0x0004002b,0x00000006,0x000002d6,
+0x00000061,0x0004002b,0x00000006,0x000002d7,
+0x00000048,0x0004002b,0x00000006,0x000002d8,
+0x00000049,0x0004002b,0x00000006,0x000002d9,
+0x0000004a,0x0004002b,0x00000006,0x000002da,
+0x00000062,0x0004002b,0x00000006,0x000002db,
+0x00000068,0x0004002b,0x00000006,0x000002dc,
+0x00000069,0x0004002b,0x00000006,0x000002dd,
+0x0000006a,0x0004002b,0x00000006,0x000002de,
+0x00000050,0x0004002b,0x00000006,0x000002df,
+0x00000051,0x0004002b,0x00000006,0x000002e0,
+0x00000052,0x0004002b,0x00000006,0x000002e1,
+0x00000064,0x0004002b,0x00000006,0x000002e2,
+0x00000054,0x0004002b,0x00000006,0x000002e3,
+0x00000055,0x0004002b,0x00000006,0x000002e4,
+0x00000056,0x0004002b,0x00000006,0x000002e5,
+0x00000065,0x0004002b,0x00000006,0x000002e6,
+0x00000058,0x0004002b,0x00000006,0x000002e7,
+0x00000059,0x0004002b,0x00000006,0x000002e8,
+0x0000005a,0x0004002b,0x00000006,0x000002e9,
+0x00000066,0x0004002b,0x00000006,0x000002ea,
+0x00000284,0x0004002b,0x00000006,0x000002eb,
+0x00000285,0x0004002b,0x00000006,0x000002ec,
+0x00000286,0x0004002b,0x00000006,0x000002ed,
+0x000002a1,0x0004002b,0x00000006,0x000002ee,
+0x00000081,0x0004002b,0x00000006,0x000002ef,
+0x00000082,0x0004002b,0x00000006,0x000002f0,
+0x000000a0,0x0004002b,0x00000006,0x000002f1,
+0x00000084,0x0004002b,0x00000006,0x000002f2,
+0x00000085,0x0004002b,0x00000006,0x000002f3,
+0x00000086,0x0004002b,0x00000006,0x000002f4,
+0x000000a1,0x0004002b,0x00000006,0x000002f5,
+0x00000088,0x0004002b,0x00000006,0x000002f6,
+0x00000089,0x0004002b,0x00000006,0x000002f7,
+0x0000008a,0x0004002b,0x00000006,0x000002f8,
+0x000000a2,0x0004002b,0x00000006,0x000002f9,
+0x000000a8,0x0004002b,0x00000006,0x000002fa,
+0x000000a9,0x0004002b,0x00000006,0x000002fb,
+0x000000aa,0x0004002b,0x00000006,0x000002fc,
+0x00000090,0x0004002b,0x00000006,0x000002fd,
+0x00000091,0x0004002b,0x00000006,0x000002fe,
+0x00000092,0x0004002b,0x00000006,0x000002ff,
+0x000000a4,0x0004002b,0x00000006,0x00000300,
+0x00000094,0x0004002b,0x00000006,0x00000301,
+0x00000095,0x0004002b,0x00000006,0x00000302,
+0x00000096,0x0004002b,0x00000006,0x00000303,
+0x000000a5,0x0004002b,0x00000006,0x00000304,
+0x00000098,0x0004002b,0x00000006,0x00000305,
+0x00000099,0x0004002b,0x00000006,0x00000306,
+0x0000009a,0x0004002b,0x00000006,0x00000307,
+0x000000a6,0x0004002b,0x00000006,0x00000308,
+0x00000288,0x0004002b,0x00000006,0x00000309,
+0x00000289,0x0004002b,0x00000006,0x0000030a,
+0x0000028a,0x0004002b,0x00000006,0x0000030b,
+0x000002a2,0x0004002b,0x00000006,0x0000030c,
+0x00000200,0x0004002b,0x00000006,0x0000030d,
+0x00000201,0x0004002b,0x00000006,0x0000030e,
+0x00000202,0x0004002b,0x00000006,0x0000030f,
+0x00000220,0x0004002b,0x00000006,0x00000310,
+0x00000204,0x0004002b,0x00000006,0x00000311,
+0x00000205,0x0004002b,0x00000006,0x00000312,
+0x00000206,0x0004002b,0x00000006,0x00000313,
+0x00000221,0x0004002b,0x00000006,0x00000314,
+0x00000208,0x0004002b,0x00000006,0x00000315,
+0x00000209,0x0004002b,0x00000006,0x00000316,
+0x0000020a,0x0004002b,0x00000006,0x00000317,
+0x00000222,0x0004002b,0x00000006,0x00000318,
+0x00000228,0x0004002b,0x00000006,0x00000319,
+0x00000229,0x0004002b,0x00000006,0x0000031a,
+0x0000022a,0x0004002b,0x00000006,0x0000031b,
+0x00000210,0x0004002b,0x00000006,0x0000031c,
+0x00000211,0x0004002b,0x00000006,0x0000031d,
+0x00000212,0x0004002b,0x00000006,0x0000031e,
+0x00000224,0x0004002b,0x00000006,0x0000031f,
+0x00000214,0x0004002b,0x00000006,0x00000320,
+0x00000215,0x0004002b,0x00000006,0x00000321,
+0x00000216,0x0004002b,0x00000006,0x00000322,
+0x00000225,0x0004002b,0x00000006,0x00000323,
+0x00000218,0x0004002b,0x00000006,0x00000324,
+0x00000219,0x0004002b,0x00000006,0x00000325,
+0x0000021a,0x0004002b,0x00000006,0x00000326,
+0x00000226,0x0004002b,0x00000006,0x00000327,
+0x000002a8,0x0004002b,0x00000006,0x00000328,
+0x000002a9,0x0004002b,0x00000006,0x00000329,
+0x000002aa,0x0004002b,0x00000006,0x0000032a,
+0x00000101,0x0004002b,0x00000006,0x0000032b,
+0x00000102,0x0004002b,0x00000006,0x0000032c,
+0x00000120,0x0004002b,0x00000006,0x0000032d,
+0x00000104,0x0004002b,0x00000006,0x0000032e,
+0x00000105,0x0004002b,0x00000006,0x0000032f,
+0x00000106,0x0004002b,0x00000006,0x00000330,
+0x00000121,0x0004002b,0x00000006,0x00000331,
+0x00000108,0x0004002b,0x00000006,0x00000332,
+0x00000109,0x0004002b,0x00000006,0x00000333,
+0x0000010a,0x0004002b,0x00000006,0x00000334,
+0x00000122,0x0004002b,0x00000006,0x00000335,
+0x00000128,0x0004002b,0x00000006,0x00000336,
+0x00000129,0x0004002b,0x00000006,0x00000337,
+0x0000012a,0x0004002b,0x00000006,0x00000338,
+0x00000110,0x0004002b,0x00000006,0x00000339,
+0x00000111,0x0004002b,0x00000006,0x0000033a,
+0x00000112,0x0004002b,0x00000006,0x0000033b,
+0x00000124,0x0004002b,0x00000006,0x0000033c,
+0x00000114,0x0004002b,0x00000006,0x0000033d,
+0x00000115,0x0004002b,0x00000006,0x0000033e,
+0x00000116,0x0004002b,0x00000006,0x0000033f,
+0x00000125,0x0004002b,0x00000006,0x00000340,
+0x00000118,0x0004002b,0x00000006,0x00000341,
+0x00000119,0x0004002b,0x00000006,0x00000342,
+0x0000011a,0x0004002b,0x00000006,0x00000343,
+0x00000126,0x0004002b,0x00000006,0x00000344,
+0x00000290,0x0004002b,0x00000006,0x00000345,
+0x00000291,0x0004002b,0x00000006,0x00000346,
+0x00000292,0x0004002b,0x00000006,0x00000347,
+0x000002a4,0x0004002b,0x00000006,0x00000348,
+0x00000140,0x0004002b,0x00000006,0x00000349,
+0x00000141,0x0004002b,0x00000006,0x0000034a,
+0x00000142,0x0004002b,0x00000006,0x0000034b,
+0x00000160,0x0004002b,0x00000006,0x0000034c,
+0x00000144,0x0004002b,0x00000006,0x0000034d,
+0x00000145,0x0004002b,0x00000006,0x0000034e,
+0x00000146,0x0004002b,0x00000006,0x0000034f,
+0x00000161,0x0004002b,0x00000006,0x00000350,
+0x00000148,0x0004002b,0x00000006,0x00000351,
+0x00000149,0x0004002b,0x00000006,0x00000352,
+0x0000014a,0x0004002b,0x00000006,0x00000353,
+0x00000162,0x0004002b,0x00000006,0x00000354,
+0x00000168,0x0004002b,0x00000006,0x00000355,
+0x00000169,0x0004002b,0x00000006,0x00000356,
+0x0000016a,0x0004002b,0x00000006,0x00000357,
+0x00000150,0x0004002b,0x00000006,0x00000358,
+0x00000151,0x0004002b,0x00000006,0x00000359,
+0x00000152,0x0004002b,0x00000006,0x0000035a,
+0x00000164,0x0004002b,0x00000006,0x0000035b,
+0x00000154,0x0004002b,0x00000006,0x0000035c,
+0x00000155,0x0004002b,0x00000006,0x0000035d,
+0x00000156,0x0004002b,0x00000006,0x0000035e,
+0x00000165,0x0004002b,0x00000006,0x0000035f,
+0x00000158,0x0004002b,0x00000006,0x00000360,
+0x00000159,0x0004002b,0x00000006,0x00000361,
+0x0000015a,0x0004002b,0x00000006,0x00000362,
+0x00000166,0x0004002b,0x00000006,0x00000363,
+0x00000294,0x0004002b,0x00000006,0x00000364,
+0x00000295,0x0004002b,0x00000006,0x00000365,
+0x00000296,0x0004002b,0x00000006,0x00000366,
+0x000002a5,0x0004002b,0x00000006,0x00000367,
+0x00000180,0x0004002b,0x00000006,0x00000368,
+0x00000181,0x0004002b,0x00000006,0x00000369,
+0x00000182,0x0004002b,0x00000006,0x0000036a,
+0x000001a0,0x0004002b,0x00000006,0x0000036b,
+0x00000184,0x0004002b,0x00000006,0x0000036c,
+0x00000185,0x0004002b,0x00000006,0x0000036d,
+0x00000186,0x0004002b,0x00000006,0x0000036e,
+0x000001a1,0x0004002b,0x00000006,0x0000036f,
+0x00000188,0x0004002b,0x00000006,0x00000370,
+0x00000189,0x0004002b,0x00000006,0x00000371,
+0x0000018a,0x0004002b,0x00000006,0x00000372,
+0x000001a2,0x0004002b,0x00000006,0x00000373,
+0x000001a8,0x0004002b,0x00000006,0x00000374,
+0x000001a9,0x0004002b,0x00000006,0x00000375,
+0x000001aa,0x0004002b,0x00000006,0x00000376,
+0x00000190,0x0004002b,0x00000006,0x00000377,
+0x00000191,0x0004002b,0x00000006,0x00000378,
+0x00000192,0x0004002b,0x00000006,0x00000379,
+0x000001a4,0x0004002b,0x00000006,0x0000037a,
+0x00000194,0x0004002b,0x00000006,0x0000037b,
+0x00000195,0x0004002b,0x00000006,0x0000037c,
+0x00000196,0x0004002b,0x00000006,0x0000037d,
+0x000001a5,0x0004002b,0x00000006,0x0000037e,
+0x00000198,0x0004002b,0x00000006,0x0000037f,
+0x00000199,0x0004002b,0x00000006,0x00000380,
+0x0000019a,0x0004002b,0x00000006,0x00000381,
+0x000001a6,0x0004002b,0x00000006,0x00000382,
+0x00000298,0x0004002b,0x00000006,0x00000383,
+0x00000299,0x0004002b,0x00000006,0x00000384,
+0x0000029a,0x0004002b,0x00000006,0x00000385,
+0x000002a6,0x0004002b,0x00000006,0x00000386,
+0x00000240,0x0004002b,0x00000006,0x00000387,
+0x00000241,0x0004002b,0x00000006,0x00000388,
+0x00000242,0x0004002b,0x00000006,0x00000389,
+0x00000260,0x0004002b,0x00000006,0x0000038a,
+0x00000244,0x0004002b,0x00000006,0x0000038b,
+0x00000245,0x0004002b,0x00000006,0x0000038c,
+0x00000246,0x0004002b,0x00000006,0x0000038d,
+0x00000261,0x0004002b,0x00000006,0x0000038e,
+0x00000248,0x0004002b,0x00000006,0x0000038f,
+0x00000249,0x0004002b,0x00000006,0x00000390,
+0x0000024a,0x0004002b,0x00000006,0x00000391,
+0x00000262,0x0004002b,0x00000006,0x00000392,
+0x00000268,0x0004002b,0x00000006,0x00000393,
+0x00000269,0x0004002b,0x00000006,0x00000394,
+0x0000026a,0x0004002b,0x00000006,0x00000395,
+0x00000250,0x0004002b,0x00000006,0x00000396,
+0x00000251,0x0004002b,0x00000006,0x00000397,
+0x00000252,0x0004002b,0x00000006,0x00000398,
+0x00000264,0x0004002b,0x00000006,0x00000399,
+0x00000254,0x0004002b,0x00000006,0x0000039a,
+0x00000255,0x0004002b,0x00000006,0x0000039b,
+0x00000256,0x0004002b,0x00000006,0x0000039c,
+0x00000265,0x0004002b,0x00000006,0x0000039d,
+0x00000258,0x0004002b,0x00000006,0x0000039e,
+0x00000259,0x0004002b,0x00000006,0x0000039f,
+0x0000025a,0x0004002b,0x00000006,0x000003a0,
+0x00000266,0x0103002c,0x000002bc,0x000003a1,
+0x000000c0,0x000000c3,0x000000b5,0x000001c4,
+0x000000b4,0x000000b8,0x0000011f,0x000002bd,
+0x000000b0,0x000002be,0x0000012b,0x000002bf,
+0x000002c0,0x000002c1,0x000002c2,0x000002bf,
+0x00000171,0x000002c3,0x000002c4,0x000002c5,
+0x000002c6,0x000002c7,0x000002c8,0x000002c9,
+0x0000019a,0x000002ca,0x000002cb,0x000002cc,
+0x000002cd,0x000002ce,0x000002cf,0x000002d0,
+0x000001a1,0x000002d1,0x000002d2,0x0000019d,
+0x000002d3,0x000002d4,0x000002d5,0x000002d6,
+0x000002d7,0x000002d8,0x000002d9,0x000002da,
+0x000002db,0x000002dc,0x000002dd,0x000002da,
+0x000002de,0x000002df,0x000002e0,0x000002e1,
+0x000002e2,0x000002e3,0x000002e4,0x000002e5,
+0x000002e6,0x000002e7,0x000002e8,0x000002e9,
+0x000002ea,0x000002eb,0x000002ec,0x000002ed,
+0x00000201,0x000002ee,0x000002ef,0x000002f0,
+0x000002f1,0x000002f2,0x000002f3,0x000002f4,
+0x000002f5,0x000002f6,0x000002f7,0x000002f8,
+0x000002f9,0x000002fa,0x000002fb,0x000002f8,
+0x000002fc,0x000002fd,0x000002fe,0x000002ff,
+0x00000300,0x00000301,0x00000302,0x00000303,
+0x00000304,0x00000305,0x00000306,0x00000307,
+0x00000308,0x00000309,0x0000030a,0x0000030b,
+0x0000030c,0x0000030d,0x0000030e,0x0000030f,
+0x00000310,0x00000311,0x00000312,0x00000313,
+0x00000314,0x00000315,0x00000316,0x00000317,
+0x00000318,0x00000319,0x0000031a,0x00000317,
+0x0000031b,0x0000031c,0x0000031d,0x0000031e,
+0x0000031f,0x00000320,0x00000321,0x00000322,
+0x00000323,0x00000324,0x00000325,0x00000326,
+0x00000327,0x00000328,0x00000329,0x0000030b,
+0x000002bb,0x0000032a,0x0000032b,0x0000032c,
+0x0000032d,0x0000032e,0x0000032f,0x00000330,
+0x00000331,0x00000332,0x00000333,0x00000334,
+0x00000335,0x00000336,0x00000337,0x00000334,
+0x00000338,0x00000339,0x0000033a,0x0000033b,
+0x0000033c,0x0000033d,0x0000033e,0x0000033f,
+0x00000340,0x00000341,0x00000342,0x00000343,
+0x00000344,0x00000345,0x00000346,0x00000347,
+0x00000348,0x00000349,0x0000034a,0x0000034b,
+0x0000034c,0x0000034d,0x0000034e,0x0000034f,
+0x00000350,0x00000351,0x00000352,0x00000353,
+0x00000354,0x00000355,0x00000356,0x00000353,
+0x00000357,0x00000358,0x00000359,0x0000035a,
+0x0000035b,0x0000035c,0x0000035d,0x0000035e,
+0x0000035f,0x00000360,0x00000361,0x00000362,
+0x00000363,0x00000364,0x00000365,0x00000366,
+0x00000367,0x00000368,0x00000369,0x0000036a,
+0x0000036b,0x0000036c,0x0000036d,0x0000036e,
+0x0000036f,0x00000370,0x00000371,0x00000372,
+0x00000373,0x00000374,0x00000375,0x00000372,
+0x00000376,0x00000377,0x00000378,0x00000379,
+0x0000037a,0x0000037b,0x0000037c,0x0000037d,
+0x0000037e,0x0000037f,0x00000380,0x00000381,
+0x00000382,0x00000383,0x00000384,0x00000385,
+0x00000386,0x00000387,0x00000388,0x00000389,
+0x0000038a,0x0000038b,0x0000038c,0x0000038d,
+0x0000038e,0x0000038f,0x00000390,0x00000391,
+0x00000392,0x00000393,0x00000394,0x00000391,
+0x00000395,0x00000396,0x00000397,0x00000398,
+0x00000399,0x0000039a,0x0000039b,0x0000039c,
+0x0000039d,0x0000039e,0x0000039f,0x000003a0,
+0x00000327,0x00000328,0x00000329,0x00000385,
+0x00040020,0x000003a3,0x00000007,0x000002bc,
+0x0006002c,0x00000060,0x000003d7,0x000000e3,
+0x00000182,0x000000f3,0x0004001c,0x000003de,
+0x00000006,0x00000201,0x0004002b,0x00000006,
+0x000003df,0x0000000b,0x0004002b,0x00000006,
+0x000003e0,0x00000013,0x0004002b,0x00000006,
+0x000003e1,0x0000001b,0x0004002b,0x00000006,
+0x000003e2,0x0000001c,0x0004002b,0x00000006,
+0x000003e3,0x00000023,0x0004002b,0x00000006,
+0x000003e4,0x000000e4,0x0004002b,0x00000006,
+0x000003e5,0x00000043,0x0004002b,0x00000006,
+0x000003e6,0x0000004b,0x0004002b,0x00000006,
+0x000003e7,0x0000004c,0x0004002b,0x00000006,
+0x000003e8,0x0000010c,0x0004002b,0x00000006,
+0x000003e9,0x00000053,0x0004002b,0x00000006,
+0x000003ea,0x0000005b,0x0004002b,0x00000006,
+0x000003eb,0x0000005c,0x0004002b,0x00000006,
+0x000003ec,0x00000063,0x0004002b,0x00000006,
+0x000003ed,0x0000011c,0x0004002b,0x00000006,
+0x000003ee,0x00000123,0x0004002b,0x00000006,
+0x000003ef,0x00000083,0x0004002b,0x00000006,
+0x000003f0,0x00000103,0x0004002b,0x00000006,
+0x000003f1,0x0000008b,0x0004002b,0x00000006,
+0x000003f2,0x0000008c,0x0004002b,0x00000006,
+0x000003f3,0x0000010b,0x0004002b,0x00000006,
+0x000003f4,0x00000093,0x0004002b,0x00000006,
+0x000003f5,0x00000113,0x0004002b,0x00000006,
+0x000003f6,0x0000009b,0x0004002b,0x00000006,
+0x000003f7,0x0000009c,0x0004002b,0x00000006,
+0x000003f8,0x000000a3,0x0004002b,0x00000006,
+0x000003f9,0x0000011b,0x0004002b,0x00000006,
+0x000003fa,0x000000c0,0x0004002b,0x00000006,
+0x000003fb,0x000000c1,0x0004002b,0x00000006,
+0x000003fc,0x000000c2,0x0004002b,0x00000006,
+0x000003fd,0x000000c3,0x0004002b,0x00000006,
+0x000003fe,0x000000c4,0x0004002b,0x00000006,
+0x000003ff,0x000000e0,0x0004002b,0x00000006,
+0x00000400,0x000000c8,0x0004002b,0x00000006,
+0x00000401,0x000000c9,0x0004002b,0x00000006,
+0x00000402,0x000000ca,0x0004002b,0x00000006,
+0x00000403,0x000000cb,0x0004002b,0x00000006,
+0x00000404,0x000000cc,0x0004002b,0x00000006,
+0x00000405,0x000000e1,0x0004002b,0x00000006,
+0x00000406,0x000000d0,0x0004002b,0x00000006,
+0x00000407,0x000000d1,0x0004002b,0x00000006,
+0x00000408,0x000000d2,0x0004002b,0x00000006,
+0x00000409,0x000000d3,0x0004002b,0x00000006,
+0x0000040a,0x000000d4,0x0004002b,0x00000006,
+0x0000040b,0x000000e2,0x0004002b,0x00000006,
+0x0000040c,0x000000d8,0x0004002b,0x00000006,
+0x0000040d,0x000000d9,0x0004002b,0x00000006,
+0x0000040e,0x000000da,0x0004002b,0x00000006,
+0x0000040f,0x000000db,0x0004002b,0x00000006,
+0x00000410,0x000000dc,0x0004002b,0x00000006,
+0x00000411,0x000000e3,0x0083002c,0x000003de,
+0x00000412,0x000000c0,0x000000c3,0x000000b5,
+0x000000b9,0x000000b4,0x000001c4,0x000002c5,
+0x0000033b,0x000000b0,0x000002be,0x0000012b,
+0x000003df,0x00000115,0x000002bd,0x000002e1,
+0x0000033b,0x00000171,0x000002c3,0x000002c4,
+0x000003e0,0x000002c6,0x000002bf,0x000002ff,
+0x0000033b,0x0000019a,0x000002ca,0x000002cb,
+0x000003e1,0x000003e2,0x000003e3,0x000003e4,
+0x0000033b,0x000001a1,0x000002d1,0x000002d2,
+0x000003e5,0x000002d3,0x0000019d,0x0000032d,
+0x0000032c,0x000002d7,0x000002d8,0x000002d9,
+0x000003e6,0x000003e7,0x000002d6,0x000003e8,
+0x00000330,0x000002de,0x000002df,0x000002e0,
+0x000003e9,0x000002e2,0x000002da,0x0000033c,
+0x00000334,0x000002e6,0x000002e7,0x000002e8,
+0x000003ea,0x000003eb,0x000003ec,0x000003ed,
+0x000003ee,0x00000201,0x000002ee,0x000002ef,
+0x000003ef,0x000002f1,0x000002f0,0x0000032b,
+0x000003f0,0x000002f5,0x000002f6,0x000002f7,
+0x000003f1,0x000003f2,0x000002f4,0x00000333,
+0x000003f3,0x000002fc,0x000002fd,0x000002fe,
+0x000003f4,0x00000300,0x000002f8,0x0000033a,
+0x000003f5,0x00000304,0x00000305,0x00000306,
+0x000003f6,0x000003f7,0x000003f8,0x00000342,
+0x000003f9,0x000003fa,0x000003fb,0x000003fc,
+0x000003fd,0x000003fe,0x000003ff,0x000002bb,
+0x0000032a,0x00000400,0x00000401,0x00000402,
+0x00000403,0x00000404,0x00000405,0x00000331,
+0x00000332,0x00000406,0x00000407,0x00000408,
+0x00000409,0x0000040a,0x0000040b,0x00000338,
+0x00000339,0x0000040c,0x0000040d,0x0000040e,
+0x0000040f,0x00000410,0x00000411,0x00000340,
+0x00000341,0x00040020,0x00000414,0x00000007,
+0x000003de,0x0004002b,0x00000006,0x00000443,
+0x0000002d,0x0004001c,0x00000444,0x00000006,
+0x00000443,0x0004002b,0x00000006,0x00000445,
+0x00000034,0x0004002b,0x00000006,0x00000446,
+0x00000027,0x0004002b,0x00000006,0x00000447,
+0x0000002f,0x0004002b,0x00000006,0x00000448,
+0x0000003b,0x0004002b,0x00000006,0x00000449,
+0x00000017,0x0004002b,0x00000006,0x0000044a,
+0x00000035,0x0004002b,0x00000006,0x0000044b,
+0x00000038,0x0004002b,0x00000006,0x0000044c,
+0x00000030,0x0004002b,0x00000006,0x0000044d,
+0x0000003e,0x0004002b,0x00000006,0x0000044e,
+0x0000000d,0x0004002b,0x00000006,0x0000044f,
+0x00000033,0x0004002b,0x00000006,0x00000450,
+0x0000001e,0x0030002c,0x00000444,0x00000451,
+0x000000c0,0x000001c4,0x000001a1,0x000000c0,
+0x000001a1,0x00000115,0x00000445,0x000002ca,
+0x00000446,0x000000c0,0x000001a1,0x000002c3,
+0x00000447,0x000000b8,0x00000448,0x00000449,
+0x000002c1,0x000003df,0x0000044a,0x000003e2,
+0x000002c5,0x000000c0,0x000001a1,0x000000b0,
+0x0000044b,0x00000171,0x0000044c,0x0000019a,
+0x000002c0,0x000000b5,0x0000044d,0x000003df,
+0x0000044a,0x000003e0,0x00000443,0x000003e1,
+0x000002c9,0x000000b8,0x00000448,0x0000044e,
+0x0000044f,0x000002c8,0x000002c2,0x00000450,
+0x000002bf,0x00040020,0x00000459,0x00000007,
+0x00000444,0x0004001c,0x00000476,0x00000006,
+0x000003e3,0x0004002b,0x00000006,0x00000477,
+0x00000039,0x0004002b,0x00000006,0x00000478,
+0x0000000e,0x0004002b,0x00000006,0x00000479,
+0x00000032,0x0004002b,0x00000006,0x0000047a,
+0x0000002b,0x0004002b,0x00000006,0x0000047b,
+0x0000003d,0x0004002b,0x00000006,0x0000047c,
+0x0000003a,0x0004002b,0x00000006,0x0000047d,
+0x00000037,0x0004002b,0x00000006,0x0000047e,
+0x0000001d,0x0026002c,0x00000476,0x0000047f,
+0x000000c0,0x00000171,0x000001c4,0x0000044c,
+0x000001a1,0x000000c0,0x000001a1,0x000000b1,
+0x00000477,0x00000478,0x00000479,0x000002c7,
+0x0000047a,0x000003e2,0x000002c5,0x000000c0,
+0x000001a1,0x00000171,0x0000044c,0x000000b9,
+0x0000047b,0x000003e0,0x00000443,0x0000011f,
+0x0000047c,0x00000449,0x000002c1,0x000002be,
+0x0000047d,0x000002cb,0x000002cc,0x0000044e,
+0x0000044f,0x0000047e,0x000003e3,0x00040020,
+0x00000487,0x00000007,0x00000476,0x0004001c,
+0x0000049a,0x00000011,0x0000011f,0x0004002b,
+0x00000006,0x0000049b,0x0000003f,0x0005002c,
+0x00000011,0x0000049c,0x0000049b,0x000000b0,
+0x0005002c,0x00000011,0x0000049d,0x000002c7,
+0x000000b0,0x0005002c,0x00000011,0x0000049e,
+0x000002be,0x000000b0,0x0005002c,0x00000011,
+0x0000049f,0x000000b5,0x000000b4,0x0005002c,
+0x00000011,0x000004a0,0x000000c3,0x000000b0,
+0x0009002c,0x0000049a,0x000004a1,0x0000049c,
+0x0000049d,0x0000049e,0x000000b6,0x0000049f,
+0x000004a0,0x00040020,0x000004a4,0x00000007,
+0x0000049a,0x00040017,0x0000050e,0x0000008c,
+0x00000004,0x0004002b,0x0000008c,0x00000513,
+0x41000000,0x0004002b,0x00000006,0x0000051a,
+0x00000400,0x0004002b,0x00000059,0x0000052f,
+0x00000006,0x0004002b,0x00000006,0x00000538,
+0x0000000f,0x0005002c,0x00000011,0x00000547,
+0x000000c0,0x000000c0,0x0004002b,0x00000059,
+0x00000573,0x0000000f,0x0004002b,0x00000059,
+0x00000578,0x00000011,0x0004002b,0x00000059,
+0x00000589,0x00000010,0x0004002b,0x00000059,
+0x000005bf,0x00000008,0x0004002b,0x00000059,
+0x000005c2,0x0000000c,0x0004002b,0x00000059,
+0x000005c9,0x00000014,0x0004002b,0x00000059,
+0x000005cc,0x00000018,0x0004002b,0x00000059,
+0x000005cf,0x0000001c,0x00040017,0x000005f9,
+0x0000008c,0x00000002,0x0007002c,0x0000000f,
+0x00000617,0x00000478,0x0000012b,0x0000011f,
+0x000000b5,0x0007002c,0x0000000f,0x0000061a,
+0x0000049b,0x0000049b,0x0000049b,0x0000049b,
+0x00040017,0x00000630,0x000000d0,0x00000003,
+0x0004001c,0x00000656,0x00000008,0x000003e0,
+0x0006002c,0x00000008,0x00000657,0x000000c0,
+0x000000c0,0x000000b0,0x0006002c,0x00000008,
+0x00000658,0x000000c3,0x000000c0,0x0000011f,
+0x0006002c,0x00000008,0x00000659,0x000000c0,
+0x000000c3,0x000000b8,0x0006002c,0x00000008,
+0x0000065a,0x000000c0,0x000000c0,0x000000b1,
+0x0006002c,0x00000008,0x0000065b,0x000000c3,
+0x000000c0,0x000000b8,0x0006002c,0x00000008,
+0x0000065c,0x000000c0,0x000000c3,0x000000b4,
+0x0006002c,0x00000008,0x0000065d,0x000000c0,
+0x000000c0,0x0000011f,0x0006002c,0x00000008,
+0x0000065e,0x000000c3,0x000000c0,0x000000b4,
+0x0006002c,0x00000008,0x0000065f,0x000000c0,
+0x000000c3,0x000000b9,0x0016002c,0x00000656,
+0x00000660,0x00000657,0x00000658,0x00000659,
+0x0000065a,0x0000065b,0x0000065c,0x0000065d,
+0x0000065e,0x0000065f,0x0000017f,0x0000017e,
+0x0000017d,0x0000017c,0x0000017b,0x0000017a,
+0x00000179,0x00000178,0x00000176,0x00000174,
+0x00040020,0x00000662,0x00000007,0x00000656,
+0x0004002b,0x00000059,0x00000697,0x00000080,
+0x0004002b,0x00000059,0x0000069f,0x0000003f,
+0x0004002b,0x00000006,0x000006b5,0x000000ff,
+0x0004002b,0x00000059,0x000006c8,0x000000c0,
+0x0004002b,0x00000059,0x000006d1,0x000000ff,
+0x0004002b,0x00000059,0x00000752,0xffffff80,
+0x0007002c,0x0000000f,0x00000780,0x000000c0,
+0x000000c0,0x000000c0,0x000000c0,0x0004002b,
+0x00000006,0x0000079e,0x0000017d,0x0004001c,
+0x0000079f,0x00000006,0x0000079e,0x0004002b,
+0x00000006,0x000007a0,0x000000ba,0x0004002b,
+0x00000006,0x000007a1,0x000000e8,0x0004002b,
+0x00000006,0x000007a2,0x0000002e,0x0004002b,
+0x00000006,0x000007a3,0x00000074,0x0004002b,
+0x00000006,0x000007a4,0x000000de,0x0004002b,
+0x00000006,0x000007a5,0x000000bd,0x0004002b,
+0x00000006,0x000007a6,0x000000f4,0x0004002b,
+0x00000006,0x000007a7,0x0000002c,0x0004002b,
+0x00000006,0x000007a8,0x0000004d,0x0004002b,
+0x00000006,0x000007a9,0x000000b2,0x0004002b,
+0x00000006,0x000007aa,0x0000006e,0x0004002b,
+0x00000006,0x000007ab,0x000000e9,0x0004002b,
+0x00000006,0x000007ac,0x000000a7,0x0004002b,
+0x00000006,0x000007ad,0x00000079,0x0004002b,
+0x00000006,0x000007ae,0x000000ef,0x0004002b,
+0x00000006,0x000007af,0x000000df,0x0004002b,
+0x00000006,0x000007b0,0x000000cf,0x0004002b,
+0x00000006,0x000007b1,0x000000be,0x0004002b,
+0x00000006,0x000007b2,0x000000ae,0x0004002b,
+0x00000006,0x000007b3,0x0000009e,0x0004002b,
+0x00000006,0x000007b4,0x00000071,0x0004002b,
+0x00000006,0x000007b5,0x0000008e,0x0004002b,
+0x00000006,0x000007b6,0x000000fa,0x0004002b,
+0x00000006,0x000007b7,0x000000ea,0x0004002b,
+0x00000006,0x000007b8,0x00000036,0x0004002b,
+0x00000006,0x000007b9,0x000000b9,0x0004002b,
+0x00000006,0x000007ba,0x00000067,0x0004002b,
+0x00000006,0x000007bb,0x00000077,0x0004002b,
+0x00000006,0x000007bc,0x000000b3,0x0004002b,
+0x00000006,0x000007bd,0x0000006c,0x0004002b,
+0x00000006,0x000007be,0x0000007c,0x0004002b,
+0x00000006,0x000007bf,0x000000f7,0x0004002b,
+0x00000006,0x000007c0,0x000000e7,0x0004002b,
+0x00000006,0x000007c1,0x000000d7,0x0004002b,
+0x00000006,0x000007c2,0x000000c7,0x0004002b,
+0x00000006,0x000007c3,0x000000bf,0x0004002b,
+0x00000006,0x000007c4,0x000000b7,0x0004002b,
+0x00000006,0x000007c5,0x000000af,0x0004002b,
+0x00000006,0x000007c6,0x0000009f,0x0004002b,
+0x00000006,0x000007c7,0x00000097,0x0004002b,
+0x00000006,0x000007c8,0x00000070,0x0004002b,
+0x00000006,0x000007c9,0x0000008f,0x0004002b,
+0x00000006,0x000007ca,0x00000078,0x0004002b,
+0x00000006,0x000007cb,0x00000087,0x0004002b,
+0x00000006,0x000007cc,0x000000fd,0x0004002b,
+0x00000006,0x000007cd,0x000000f5,0x0004002b,
+0x00000006,0x000007ce,0x000000ed,0x0004002b,
+0x00000006,0x000007cf,0x000000e5,0x0004002b,
+0x00000006,0x000007d0,0x000000bc,0x0004002b,
+0x00000006,0x000007d1,0x000000b4,0x0004002b,
+0x00000006,0x000007d2,0x000000ac,0x0004002b,
+0x00000006,0x000007d3,0x0000006b,0x0004002b,
+0x00000006,0x000007d4,0x00000073,0x0004002b,
+0x00000006,0x000007d5,0x0000007b,0x0004002b,
+0x00000006,0x000007d6,0x000000f2,0x0004002b,
+0x00000006,0x000007d7,0x0000004e,0x0004002b,
+0x00000006,0x000007d8,0x000000b1,0x0004002b,
+0x00000006,0x000007d9,0x0000005e,0x0004002b,
+0x00000006,0x000007da,0x00000076,0x0004002b,
+0x00000006,0x000007db,0x0000007e,0x0004002b,
+0x00000006,0x000007dc,0x000000fb,0x0004002b,
+0x00000006,0x000007dd,0x000000f3,0x0004002b,
+0x00000006,0x000007de,0x000000eb,0x0004002b,
+0x00000006,0x000007df,0x0000003c,0x0004002b,
+0x00000006,0x000007e0,0x000000bb,0x0004002b,
+0x00000006,0x000007e1,0x000000ab,0x0004002b,
+0x00000006,0x000007e2,0x000000fe,0x0004002b,
+0x00000006,0x000007e3,0x000000f6,0x0004002b,
+0x00000006,0x000007e4,0x000000ee,0x0004002b,
+0x00000006,0x000007e5,0x000000e6,0x0004002b,
+0x00000006,0x000007e6,0x000000d6,0x0004002b,
+0x00000006,0x000007e7,0x00000031,0x0004002b,
+0x00000006,0x000007e8,0x000000ce,0x0004002b,
+0x00000006,0x000007e9,0x000000c6,0x0004002b,
+0x00000006,0x000007ea,0x000000b6,0x0004002b,
+0x00000006,0x000007eb,0x0000005d,0x0004002b,
+0x00000006,0x000007ec,0x0000006d,0x0004002b,
+0x00000006,0x000007ed,0x00000075,0x0004002b,
+0x00000006,0x000007ee,0x0000007d,0x0004002b,
+0x00000006,0x000007ef,0x000000f9,0x0004002b,
+0x00000006,0x000007f0,0x000000f1,0x0004002b,
+0x00000006,0x000007f1,0x000000dd,0x0004002b,
+0x00000006,0x000007f2,0x000000d5,0x0004002b,
+0x00000006,0x000007f3,0x000000cd,0x0004002b,
+0x00000006,0x000007f4,0x000000c5,0x0004002b,
+0x00000006,0x000007f5,0x000000b5,0x0004002b,
+0x00000006,0x000007f6,0x000000ad,0x0004002b,
+0x00000006,0x000007f7,0x0000009d,0x0004002b,
+0x00000006,0x000007f8,0x00000072,0x0004002b,
+0x00000006,0x000007f9,0x0000008d,0x0004002b,
+0x00000006,0x000007fa,0x0000007a,0x0180002c,
+0x0000079f,0x000007fb,0x000000c0,0x000000c0,
+0x000000c0,0x000000c0,0x000006b5,0x0000044f,
+0x00000404,0x000002e9,0x00000305,0x000000c0,
+0x000006b5,0x000002d4,0x000007a0,0x00000449,
+0x000007a1,0x000003eb,0x000003f8,0x000007a2,
+0x00000407,0x000007a3,0x000003f1,0x000000c0,
+0x000006b5,0x000002bd,0x000007a4,0x000002d2,
+0x000007a5,0x000003ec,0x000003f7,0x000003df,
+0x000007a6,0x000007a7,0x00000409,0x000007a8,
+0x000007a9,0x000007aa,0x000002fd,0x000002c8,
+0x000007ab,0x0000047d,0x00000400,0x000002e6,
+0x000007ac,0x000007ad,0x000002f3,0x000000c0,
+0x000006b5,0x00000171,0x000007ae,0x000001c4,
+0x000007af,0x0000044c,0x000007b0,0x000002d1,
+0x000007b1,0x000002df,0x000007b2,0x000002d6,
+0x000007b3,0x000007b4,0x000007b5,0x000000b8,
+0x000007b6,0x000002c7,0x000007b7,0x000002cc,
+0x0000040d,0x000007b8,0x00000401,0x000002d5,
+0x000007b9,0x000002e4,0x000002fa,0x000007ba,
+0x00000304,0x000007bb,0x000002f5,0x000003df,
+0x000007a6,0x000003e1,0x000003e4,0x0000047a,
+0x0000040a,0x00000448,0x000003fe,0x000003e7,
+0x000007bc,0x000003eb,0x000003f8,0x000007bd,
+0x000003f4,0x000007be,0x000003ef,0x000000c0,
+0x000006b5,0x000000b0,0x000007bf,0x00000171,
+0x000007ae,0x0000019a,0x000007c0,0x000001c4,
+0x000007af,0x000002c0,0x000007c1,0x0000044c,
+0x000007b0,0x0000044b,0x000007c2,0x000001a1,
+0x000007c3,0x000002d7,0x000007c4,0x000002de,
+0x000007c5,0x000002e6,0x000007ac,0x0000019d,
+0x000007c6,0x000002db,0x000007c7,0x000007c8,
+0x000007c9,0x000007ca,0x000007cb,0x000000b5,
+0x000007cc,0x0000012b,0x000007cd,0x000002c4,
+0x000007ce,0x000002cb,0x000007cf,0x000003e3,
+0x00000410,0x0000047a,0x0000040a,0x0000044f,
+0x00000404,0x00000448,0x000003fe,0x000003e5,
+0x000007d0,0x000003e6,0x000007d1,0x000003e9,
+0x000007d2,0x000003ea,0x000002ff,0x000003ec,
+0x000003f7,0x000007d3,0x00000300,0x000007d4,
+0x000003f2,0x000007d5,0x000002f1,0x000000b8,
+0x000007b6,0x0000044e,0x000007d6,0x000002c7,
+0x000007b7,0x0000047e,0x0000040b,0x000002c9,
+0x0000040e,0x00000443,0x00000408,0x0000044a,
+0x00000402,0x0000047b,0x000003fc,0x000002d5,
+0x000007b9,0x000007d7,0x000007d8,0x000002e4,
+0x000002fa,0x000007d9,0x000002f4,0x000002e9,
+0x00000305,0x000007aa,0x000002fd,0x000007da,
+0x000002f6,0x000007db,0x000002ee,0x000000c0,
+0x000006b5,0x000000b4,0x000007dc,0x000000b0,
+0x000007bf,0x00000115,0x000007dd,0x00000171,
+0x000007ae,0x000002c6,0x000007de,0x0000019a,
+0x000007c0,0x000003e2,0x00000411,0x000001c4,
+0x000007af,0x000002c5,0x0000040f,0x000002c0,
+0x000007c1,0x000007a7,0x00000409,0x0000044c,
+0x000007b0,0x00000445,0x00000403,0x0000044b,
+0x000007c2,0x000007df,0x000003fd,0x000001a1,
+0x000007c3,0x000002d3,0x000007e0,0x000002d7,
+0x000007c4,0x000003e7,0x000007bc,0x000002de,
+0x000007c5,0x000002e2,0x000007e1,0x000002e6,
+0x000007ac,0x000003eb,0x000003f8,0x0000019d,
+0x000007c6,0x000002e1,0x000003f6,0x000002db,
+0x000007c7,0x000007bd,0x000003f4,0x000007c8,
+0x000007c9,0x000007a3,0x000003f1,0x000007ca,
+0x000007cb,0x000007be,0x000003ef,0x000000c3,
+0x000007e2,0x000000b8,0x000007b6,0x000002be,
+0x000007e3,0x0000044e,0x000007d6,0x000002c3,
+0x000007e4,0x000002c7,0x000007b7,0x000002ca,
+0x000007e5,0x0000047e,0x0000040b,0x000002bd,
+0x000007a4,0x000002c9,0x0000040e,0x000002c1,
+0x000007e6,0x00000443,0x00000408,0x000007e7,
+0x000007e8,0x0000044a,0x00000402,0x00000477,
+0x000007e9,0x0000047b,0x000003fc,0x000002d1,
+0x000007b1,0x000002d4,0x000007a0,0x000002d8,
+0x000007ea,0x000007a8,0x000007a9,0x000002df,
+0x000007b2,0x000002e3,0x000002fb,0x000002e7,
+0x00000307,0x000007eb,0x000002f8,0x000002d6,
+0x000007b3,0x000002e5,0x00000306,0x000002dc,
+0x00000302,0x000007ec,0x000002fe,0x000007b4,
+0x000007b5,0x000007ed,0x000002f7,0x000007ad,
+0x000002f3,0x000007ee,0x000002ef,0x000000b5,
+0x000007cc,0x0000011f,0x000007ef,0x0000012b,
+0x000007cd,0x00000478,0x000007f0,0x000002c4,
+0x000007ce,0x000002c8,0x000007ab,0x000002cb,
+0x000007cf,0x00000450,0x00000405,0x000002bf,
+0x000007f1,0x000002cc,0x0000040d,0x000002c2,
+0x000007f2,0x000007a2,0x00000407,0x00000479,
+0x000007f3,0x000007b8,0x00000401,0x0000047c,
+0x000007f4,0x0000044d,0x000003fb,0x000002d2,
+0x000007a5,0x000002d5,0x000007b9,0x000002d9,
+0x000007f5,0x000007d7,0x000007d8,0x000002e0,
+0x000007f6,0x000002e4,0x000002fa,0x000002e8,
+0x00000303,0x000007d9,0x000002f4,0x000002da,
+0x000007f7,0x000002e9,0x00000305,0x000002dd,
+0x00000301,0x000007aa,0x000002fd,0x000007f8,
+0x000007f9,0x000007da,0x000002f6,0x000007fa,
+0x000002f2,0x000007db,0x000002ee,0x00040020,
+0x00000803,0x00000007,0x0000079f,0x0004002b,
+0x00000006,0x00000822,0x0000013b,0x0004001c,
+0x00000823,0x00000006,0x00000822,0x0004002b,
+0x00000006,0x00000824,0x00000047,0x0004002b,
+0x00000006,0x00000825,0x000000b8,0x0004002b,
+0x00000006,0x00000826,0x000000ec,0x0004002b,
+0x00000006,0x00000827,0x000000fc,0x0004002b,
+0x00000006,0x00000828,0x00000057,0x013e002c,
+0x00000823,0x00000829,0x000000c0,0x000000c0,
+0x000000c0,0x000000c0,0x000000c0,0x000000c0,
+0x000006b5,0x000003e2,0x00000411,0x0000044b,
+0x000007c2,0x000002e2,0x000007e1,0x000007b4,
+0x000007b5,0x000000c0,0x000006b5,0x000003e5,
+0x000007d0,0x0000044e,0x000007d6,0x000002de,
+0x000007c5,0x000003e1,0x000003e4,0x000007d9,
+0x000002f4,0x000002c0,0x000007c1,0x000007d3,
+0x00000300,0x000007b8,0x00000401,0x000007ad,
+0x000002f3,0x000000c0,0x000006b5,0x000001c4,
+0x000007af,0x000002d1,0x000007b1,0x000002d6,
+0x000007b3,0x0000011f,0x000007ef,0x00000446,
+0x0000040c,0x00000824,0x00000825,0x000002db,
+0x000007c7,0x0000044e,0x000007d6,0x00000443,
+0x00000408,0x000007d7,0x000007d8,0x000007aa,
+0x000002fd,0x000003e0,0x00000826,0x00000445,
+0x00000403,0x000002e2,0x000007e1,0x000007ed,
+0x000002f7,0x000002cb,0x000007cf,0x0000047c,
+0x000007f4,0x000003ea,0x000002ff,0x000007d5,
+0x000002f1,0x000000c0,0x000006b5,0x00000171,
+0x000007ae,0x000001c4,0x000007af,0x0000044c,
+0x000007b0,0x000001a1,0x000007c3,0x000002de,
+0x000007c5,0x0000019d,0x000007c6,0x000007c8,
+0x000007c9,0x000000b9,0x00000827,0x000003e0,
+0x00000826,0x000003e3,0x00000410,0x0000044f,
+0x00000404,0x000003e5,0x000007d0,0x000003e9,
+0x000007d2,0x000002e1,0x000003f6,0x000007a3,
+0x000003f1,0x0000011f,0x000007ef,0x000002c8,
+0x000007ab,0x000002cc,0x0000040d,0x000007b8,
+0x00000401,0x00000824,0x00000825,0x00000828,
+0x000002f9,0x000007ba,0x00000304,0x000007bb,
+0x000002f5,0x000002be,0x000007e3,0x000002ca,
+0x000007e5,0x000002c2,0x000007f2,0x0000047c,
+0x000007f4,0x000002d9,0x000007f5,0x000002e8,
+0x00000303,0x000002dd,0x00000301,0x000007fa,
+0x000002f2,0x0000044e,0x000007d6,0x0000047e,
+0x0000040b,0x00000443,0x00000408,0x0000047b,
+0x000003fc,0x000007a8,0x000007a9,0x000007eb,
+0x000002f8,0x000007ec,0x000002fe,0x000007ee,
+0x000002ef,0x000000c0,0x000006b5,0x000000b0,
+0x000007bf,0x00000171,0x000007ae,0x0000019a,
+0x000007c0,0x000001c4,0x000007af,0x000002c0,
+0x000007c1,0x0000044c,0x000007b0,0x0000044b,
+0x000007c2,0x000001a1,0x000007c3,0x000002d7,
+0x000007c4,0x000002de,0x000007c5,0x000002e6,
+0x000007ac,0x0000019d,0x000007c6,0x000002db,
+0x000007c7,0x000007c8,0x000007c9,0x000007ca,
+0x000007cb,0x000000c3,0x000007e2,0x000002be,
+0x000007e3,0x000002c3,0x000007e4,0x000002ca,
+0x000007e5,0x000002bd,0x000007a4,0x000002c1,
+0x000007e6,0x000007e7,0x000007e8,0x00000477,
+0x000007e9,0x000002d1,0x000007b1,0x000002d8,
+0x000007ea,0x000002df,0x000007b2,0x000002e7,
+0x00000307,0x000002d6,0x000007b3,0x000002dc,
+0x00000302,0x000007b4,0x000007b5,0x000007ad,
+0x000002f3,0x000000b9,0x00000827,0x000003df,
+0x000007a6,0x000003e0,0x00000826,0x000003e1,
+0x000003e4,0x000003e3,0x00000410,0x0000047a,
+0x0000040a,0x0000044f,0x00000404,0x00000448,
+0x000003fe,0x000003e5,0x000007d0,0x000003e6,
+0x000007d1,0x000003e9,0x000007d2,0x000003ea,
+0x000002ff,0x000003ec,0x000003f7,0x000007d3,
+0x00000300,0x000007d4,0x000003f2,0x000007d5,
+0x000002f1,0x000000b4,0x000007dc,0x00000115,
+0x000007dd,0x000002c6,0x000007de,0x000003e2,
+0x00000411,0x000002c5,0x0000040f,0x000007a7,
+0x00000409,0x00000445,0x00000403,0x000007df,
+0x000003fd,0x000002d3,0x000007e0,0x000003e7,
+0x000007bc,0x000002e2,0x000007e1,0x000003eb,
+0x000003f8,0x000002e1,0x000003f6,0x000007bd,
+0x000003f4,0x000007a3,0x000003f1,0x000007be,
+0x000003ef,0x0000011f,0x000007ef,0x00000478,
+0x000007f0,0x000002c8,0x000007ab,0x00000450,
+0x00000405,0x000002cc,0x0000040d,0x000007a2,
+0x00000407,0x000007b8,0x00000401,0x0000044d,
+0x000003fb,0x000002d5,0x000007b9,0x000007d7,
+0x000007d8,0x000002e4,0x000002fa,0x000007d9,
+0x000002f4,0x000002e9,0x00000305,0x000007aa,
+0x000002fd,0x000007da,0x000002f6,0x000007db,
+0x000002ee,0x00040020,0x00000831,0x00000007,
+0x00000823,0x0004001c,0x00000846,0x00000011,
+0x000000b0,0x0005002c,0x00000011,0x00000847,
+0x000006b5,0x000000b0,0x0005002c,0x00000011,
+0x00000848,0x000002e3,0x000000b0,0x0005002c,
+0x00000011,0x00000849,0x000002c5,0x000000c3,
+0x0005002c,0x00000011,0x0000084a,0x000002c3,
+0x000000b0,0x0005002c,0x00000011,0x0000084b,
+0x000000b0,0x000000b5,0x0005002c,0x00000011,
+0x0000084c,0x000000b4,0x000000b4,0x0005002c,
+0x00000011,0x0000084d,0x000000b5,0x0000011f,
+0x000b002c,0x00000846,0x0000084e,0x00000847,
+0x00000848,0x00000849,0x0000084a,0x0000084b,
+0x0000084c,0x0000084d,0x000004a0,0x00040020,
+0x00000851,0x00000007,0x00000846,0x0004002b,
+0x00000059,0x00000863,0x00000060,0x0004002b,
+0x00000059,0x00000864,0x00000040,0x0004002b,
+0x00000059,0x00000865,0x00000020,0x0007002c,
+0x0000005a,0x00000866,0x00000863,0x00000864,
+0x00000865,0x000000e3,0x0007002c,0x0000000f,
+0x0000086a,0x000000c3,0x000000c3,0x000000c3,
+0x000000c3,0x0007002c,0x0000005a,0x0000086c,
+0x000000e3,0x000000e3,0x000000e3,0x000000e3,
+0x0004002b,0x00000059,0x0000086d,0x0000001f,
+0x0007002c,0x0000005a,0x0000086e,0x0000086d,
+0x0000086d,0x0000086d,0x0000086d,0x0004002b,
+0x00000006,0x00000874,0xffffffff,0x0007002c,
+0x0000000f,0x00000875,0x00000874,0x00000874,
+0x00000874,0x00000874,0x0007002c,0x0000000f,
+0x00000878,0x00000201,0x0000019d,0x000001a1,
+0x000001c4,0x00040017,0x00000879,0x000000d0,
+0x00000004,0x0007002c,0x0000000f,0x00000881,
+0x000006b5,0x000000c0,0x000006b5,0x000006b5,
+0x0004002b,0x00000059,0x000008bc,0x0000001d,
+0x0004002b,0x00000059,0x000008c0,0xfffffffe,
+0x0005001e,0x0000093f,0x00000011,0x00000006,
+0x00000006,0x00040020,0x00000940,0x00000009,
+0x0000093f,0x0004003b,0x00000940,0x00000941,
+0x00000009,0x00040020,0x00000942,0x00000009,
+0x00000011,0x00090019,0x0000094b,0x00000006,
+0x00000000,0x00000000,0x00000001,0x00000000,
+0x00000002,0x0000001e,0x00040020,0x0000094c,
+0x00000000,0x0000094b,0x0004003b,0x0000094c,
+0x0000094d,0x00000000,0x00040020,0x00000968,
+0x00000007,0x0000008c,0x0004002b,0x0000008c,
+0x00000975,0x40400000,0x0004002b,0x0000008c,
+0x00000977,0x00000000,0x0004002b,0x0000008c,
+0x0000098c,0x40e00000,0x0004002b,0x00000006,
+0x00000991,0x02345671,0x00040018,0x000009c3,
+0x0000008d,0x00000003,0x00040020,0x000009c4,
+0x00000007,0x000009c3,0x0004002b,0x0000008c,
+0x000009d5,0x3f800000,0x0004002b,0x0000008c,
+0x000009fd,0x40800000,0x0004002b,0x0000008c,
+0x00000a02,0x3e991687,0x0004002b,0x0000008c,
+0x00000a03,0x3f1645a2,0x0004002b,0x0000008c,
+0x00000a04,0x3de978d5,0x0006002c,0x0000008d,
+0x00000a05,0x00000a02,0x00000a03,0x00000a04,
+0x00040020,0x00000a1b,0x00000001,0x00000006,
+0x0004003b,0x00000a1b,0x00000a1c,0x00000001,
+0x0004002b,0x00000006,0x00000a4f,0xfffffffd,
+0x0004002b,0x0000008c,0x00000a76,0x41f80000,
+0x0004002b,0x0000008c,0x00000a77,0x427c0000,
+0x0006002c,0x0000008d,0x00000a78,0x00000a76,
+0x00000a77,0x00000a76,0x0004002b,0x0000008c,
+0x00000a7a,0x437f0000,0x0006002c,0x0000008d,
+0x00000a7b,0x00000a7a,0x00000a7a,0x00000a7a,
+0x0004003b,0x00000a1b,0x00000a8c,0x00000001,
+0x0004003b,0x00000a1b,0x00000a8e,0x00000001,
+0x00040020,0x00000a9a,0x00000001,0x00000008,
+0x0004003b,0x00000a9a,0x00000a9b,0x00000001,
+0x00040020,0x00000aaf,0x00000009,0x00000006,
+0x0004003b,0x0000094c,0x00000b07,0x00000000,
+0x0006002c,0x00000008,0x00000b15,0x000001a1,
+0x000000c3,0x000000c3,0x00050036,0x00000002,
+0x00000004,0x00000000,0x00000003,0x000200f8,
+0x00000005,0x0004003b,0x00000007,0x00000a8b,
+0x00000007,0x0004003b,0x00000007,0x00000a93,
+0x00000007,0x0004003b,0x00000007,0x00000a96,
+0x00000007,0x0004003b,0x00000012,0x00000a99,
+0x00000007,0x0004003b,0x00000007,0x00000aae,
+0x00000007,0x0004003b,0x00000010,0x00000ab5,
+0x00000007,0x0004003b,0x00000012,0x00000ab6,
+0x00000007,0x0004003b,0x00000007,0x00000ab8,
+0x00000007,0x0004003b,0x00000009,0x00000abb,
+0x00000007,0x0004003b,0x00000009,0x00000abc,
+0x00000007,0x0004003b,0x00000009,0x00000abd,
+0x00000007,0x0004003b,0x00000009,0x00000ac0,
+0x00000007,0x0004003b,0x00000009,0x00000ac1,
+0x00000007,0x0004003b,0x00000012,0x00000ac5,
+0x00000007,0x0004003b,0x00000009,0x00000ac6,
+0x00000007,0x0004003b,0x00000009,0x00000ac9,
+0x00000007,0x0004003b,0x00000007,0x00000acd,
+0x00000007,0x0004003b,0x0000008e,0x00000adc,
+0x00000007,0x0004003b,0x0000008e,0x00000add,
+0x00000007,0x0004003b,0x0000008e,0x00000ade,
+0x00000007,0x0004003b,0x00000010,0x00000aeb,
+0x00000007,0x0004003b,0x00000007,0x00000aec,
+0x00000007,0x0004003b,0x00000007,0x00000aef,
+0x00000007,0x0004003b,0x00000061,0x00000b12,
+0x00000007,0x0004003d,0x00000006,0x00000a8d,
+0x00000a8c,0x0004003d,0x00000006,0x00000a8f,
+0x00000a8e,0x00050084,0x00000006,0x00000a90,
+0x00000a8d,0x00000a8f,0x0004003d,0x00000006,
+0x00000a91,0x00000a1c,0x00050080,0x00000006,
+0x00000a92,0x00000a90,0x00000a91,0x0003003e,
+0x00000a8b,0x00000a92,0x0004003d,0x00000006,
+0x00000a94,0x00000a8b,0x00050086,0x00000006,
+0x00000a95,0x00000a94,0x00000171,0x0003003e,
+0x00000a93,0x00000a95,0x0004003d,0x00000006,
+0x00000a97,0x00000a8b,0x00050089,0x00000006,
+0x00000a98,0x00000a97,0x00000171,0x0003003e,
+0x00000a96,0x00000a98,0x0004003d,0x00000008,
+0x00000a9c,0x00000a9b,0x0007004f,0x00000011,
+0x00000a9d,0x00000a9c,0x00000a9c,0x00000000,
+0x00000001,0x00050050,0x00000011,0x00000a9e,
+0x000000b0,0x000000b0,0x00050084,0x00000011,
+0x00000a9f,0x00000a9e,0x00000a9d,0x0004003d,
+0x00000006,0x00000aa0,0x00000a93,0x000500c7,
+0x00000006,0x00000aa1,0x00000aa0,0x000000c3,
+0x00050084,0x00000006,0x00000aa2,0x000000b4,
+0x00000aa1,0x0004003d,0x00000006,0x00000aa3,
+0x00000a96,0x00050089,0x00000006,0x00000aa4,
+0x00000aa3,0x000000b4,0x00050080,0x00000006,
+0x00000aa5,0x00000aa2,0x00000aa4,0x0004003d,
+0x00000006,0x00000aa6,0x00000a93,0x000500c7,
+0x00000006,0x00000aa7,0x00000aa6,0x000000b5,
+0x00050084,0x00000006,0x00000aa8,0x000000b5,
+0x00000aa7,0x0004003d,0x00000006,0x00000aa9,
+0x00000a96,0x00050086,0x00000006,0x00000aaa,
+0x00000aa9,0x000000b4,0x00050080,0x00000006,
+0x00000aab,0x00000aa8,0x00000aaa,0x00050050,
+0x00000011,0x00000aac,0x00000aa5,0x00000aab,
+0x00050080,0x00000011,0x00000aad,0x00000a9f,
+0x00000aac,0x0003003e,0x00000a99,0x00000aad,
+0x00050041,0x00000aaf,0x00000ab0,0x00000941,
+0x000000ee,0x0004003d,0x00000006,0x00000ab1,
+0x00000ab0,0x00050041,0x00000a1b,0x00000ab2,
+0x00000a9b,0x000000b5,0x0004003d,0x00000006,
+0x00000ab3,0x00000ab2,0x00050080,0x00000006,
+0x00000ab4,0x00000ab1,0x00000ab3,0x0003003e,
+0x00000aae,0x00000ab4,0x0004003d,0x00000011,
+0x00000ab7,0x00000a99,0x0003003e,0x00000ab6,
+0x00000ab7,0x0004003d,0x00000006,0x00000ab9,
+0x00000aae,0x0003003e,0x00000ab8,0x00000ab9,
+0x00060039,0x0000000f,0x00000aba,0x0000008a,
+0x00000ab6,0x00000ab8,0x0003003e,0x00000ab5,
+0x00000aba,0x0004003d,0x0000000f,0x00000abe,
+0x00000ab5,0x0008004f,0x00000008,0x00000abf,
+0x00000abe,0x00000abe,0x00000000,0x00000001,
+0x00000002,0x0003003e,0x00000abd,0x00000abf,
+0x00070039,0x00000002,0x00000ac2,0x0000009f,
+0x00000abd,0x00000ac0,0x00000ac1,0x0004003d,
+0x00000008,0x00000ac3,0x00000ac0,0x0003003e,
+0x00000abb,0x00000ac3,0x0004003d,0x00000008,
+0x00000ac4,0x00000ac1,0x0003003e,0x00000abc,
+0x00000ac4,0x0004003d,0x00000008,0x00000ac7,
+0x00000abb,0x0003003e,0x00000ac6,0x00000ac7,
+0x00050039,0x00000006,0x00000ac8,0x000000a8,
+0x00000ac6,0x0004003d,0x00000008,0x00000aca,
+0x00000abc,0x0003003e,0x00000ac9,0x00000aca,
+0x00050039,0x00000006,0x00000acb,0x000000a8,
+0x00000ac9,0x00050050,0x00000011,0x00000acc,
+0x00000ac8,0x00000acb,0x0003003e,0x00000ac5,
+0x00000acc,0x0003003e,0x00000acd,0x000000c0,
+0x00050041,0x00000007,0x00000ace,0x00000ac5,
+0x000000c0,0x0004003d,0x00000006,0x00000acf,
+0x00000ace,0x00050041,0x00000007,0x00000ad0,
+0x00000ac5,0x000000c3,0x0004003d,0x00000006,
+0x00000ad1,0x00000ad0,0x000500ab,0x000000d0,
+0x00000ad2,0x00000acf,0x00000ad1,0x000300f7,
+0x00000ad4,0x00000000,0x000400fa,0x00000ad2,
+0x00000ad3,0x00000ad4,0x000200f8,0x00000ad3,
+0x0004003d,0x0000000f,0x00000ad5,0x00000ab5,
+0x0008004f,0x00000008,0x00000ad6,0x00000ad5,
+0x00000ad5,0x00000000,0x00000001,0x00000002,
+0x00040070,0x0000008d,0x00000ad7,0x00000ad6,
+0x0004003d,0x00000008,0x00000ad8,0x00000abb,
+0x00040070,0x0000008d,0x00000ad9,0x00000ad8,
+0x0004003d,0x00000008,0x00000ada,0x00000abc,
+0x00040070,0x0000008d,0x00000adb,0x00000ada,
+0x0003003e,0x00000adc,0x00000ad7,0x0003003e,
+0x00000add,0x00000ad9,0x0003003e,0x00000ade,
+0x00000adb,0x00070039,0x00000006,0x00000adf,
+0x00000093,0x00000adc,0x00000add,0x00000ade,
+0x0003003e,0x00000acd,0x00000adf,0x000200f9,
+0x00000ad4,0x000200f8,0x00000ad4,0x00050041,
+0x00000007,0x00000ae0,0x00000ac5,0x000000c0,
+0x0004003d,0x00000006,0x00000ae1,0x00000ae0,
+0x00050041,0x00000007,0x00000ae2,0x00000ac5,
+0x000000c3,0x0004003d,0x00000006,0x00000ae3,
+0x00000ae2,0x000500ac,0x000000d0,0x00000ae4,
+0x00000ae1,0x00000ae3,0x000300f7,0x00000ae6,
+0x00000000,0x000400fa,0x00000ae4,0x00000ae5,
+0x00000ae6,0x000200f8,0x00000ae5,0x0004003d,
+0x00000006,0x00000ae7,0x00000acd,0x000500c6,
+0x00000006,0x00000ae8,0x00000ae7,0x000000c3,
+0x0003003e,0x00000acd,0x00000ae8,0x0004003d,
+0x00000011,0x00000ae9,0x00000ac5,0x0007004f,
+0x00000011,0x00000aea,0x00000ae9,0x00000ae9,
+0x00000001,0x00000000,0x0003003e,0x00000ac5,
+0x00000aea,0x000200f9,0x00000ae6,0x000200f8,
+0x00000ae6,0x00050041,0x00000007,0x00000aed,
+0x00000ab5,0x000000b9,0x0004003d,0x00000006,
+0x00000aee,0x00000aed,0x0003003e,0x00000aec,
+0x00000aee,0x0004003d,0x00000006,0x00000af0,
+0x00000a96,0x0003003e,0x00000aef,0x00000af0,
+0x00060039,0x00000011,0x00000af1,0x000000a4,
+0x00000aec,0x00000aef,0x00050041,0x00000007,
+0x00000af2,0x00000aeb,0x000000c0,0x00050051,
+0x00000006,0x00000af3,0x00000af1,0x00000000,
+0x0003003e,0x00000af2,0x00000af3,0x00050041,
+0x00000007,0x00000af4,0x00000aeb,0x000000c3,
+0x00050051,0x00000006,0x00000af5,0x00000af1,
+0x00000001,0x0003003e,0x00000af4,0x00000af5,
+0x00050041,0x00000007,0x00000af6,0x00000ac5,
+0x000000c3,0x0004003d,0x00000006,0x00000af7,
+0x00000af6,0x00050041,0x00000007,0x00000af8,
+0x00000ac5,0x000000c0,0x0004003d,0x00000006,
+0x00000af9,0x00000af8,0x000500c4,0x00000006,
+0x00000afa,0x00000af9,0x00000589,0x000500c5,
+0x00000006,0x00000afb,0x00000af7,0x00000afa,
+0x00050041,0x00000007,0x00000afc,0x00000aeb,
+0x000000b5,0x0003003e,0x00000afc,0x00000afb,
+0x0004003d,0x00000006,0x00000afd,0x00000acd,
+0x0004003d,0x00000006,0x00000afe,0x00000a96,
+0x00050084,0x00000006,0x00000aff,0x000000b5,
+0x00000afe,0x000500c4,0x00000006,0x00000b00,
+0x00000afd,0x00000aff,0x00070168,0x00000006,
+0x00000b01,0x000000b9,0x00000003,0x00000b00,
+0x00000171,0x00050041,0x00000007,0x00000b02,
+0x00000aeb,0x000000b9,0x0003003e,0x00000b02,
+0x00000b01,0x0004003d,0x00000006,0x00000b03,
+0x00000a96,0x000500aa,0x000000d0,0x00000b04,
+0x00000b03,0x000000c0,0x000300f7,0x00000b06,
+0x00000000,0x000400fa,0x00000b04,0x00000b05,
+0x00000b06,0x000200f8,0x00000b05,0x0004003d,
+0x0000094b,0x00000b08,0x00000b07,0x0004003d,
+0x00000011,0x00000b09,0x00000a99,0x00050050,
+0x00000011,0x00000b0a,0x000000b4,0x000000b4,
+0x00050086,0x00000011,0x00000b0b,0x00000b09,
+0x00000b0a,0x0004007c,0x00000082,0x00000b0c,
+0x00000b0b,0x0004003d,0x00000006,0x00000b0d,
+0x00000aae,0x0004007c,0x00000059,0x00000b0e,
+0x00000b0d,0x00050051,0x00000059,0x00000b0f,
+0x00000b0c,0x00000000,0x00050051,0x00000059,
+0x00000b10,0x00000b0c,0x00000001,0x00060050,
+0x00000060,0x00000b11,0x00000b0f,0x00000b10,
+0x00000b0e,0x0003003e,0x00000b12,0x00000b11,
+0x00050039,0x00000082,0x00000b13,0x00000085,
+0x00000b12,0x0004003d,0x0000000f,0x00000b14,
+0x00000aeb,0x00040063,0x00000b08,0x00000b13,
+0x00000b14,0x000200f9,0x00000b06,0x000200f8,
+0x00000b06,0x000100fd,0x00010038,0x00050036,
+0x00000006,0x0000000d,0x00000000,0x0000000a,
+0x00030037,0x00000007,0x0000000b,0x00030037,
+0x00000009,0x0000000c,0x000200f8,0x0000000e,
+0x0004003b,0x00000012,0x000000aa,0x00000007,
+0x0004003d,0x00000006,0x000000ab,0x0000000b,
+0x0004003d,0x00000008,0x000000ac,0x0000000c,
+0x0007004f,0x00000011,0x000000ad,0x000000ac,
+0x000000ac,0x00000000,0x00000001,0x00050050,
+0x00000011,0x000000ae,0x000000ab,0x000000ab,
+0x00050084,0x00000011,0x000000af,0x000000ae,
+0x000000ad,0x00050084,0x00000011,0x000000b3,
+0x000000af,0x000000b2,0x00050080,0x00000011,
+0x000000b7,0x000000b3,0x000000b6,0x00050086,
+0x00000011,0x000000bb,0x000000b7,0x000000ba,
+0x0003003e,0x000000aa,0x000000bb,0x0004003d,
+0x00000006,0x000000bc,0x0000000b,0x00050041,
+0x00000007,0x000000bd,0x0000000c,0x000000b5,
+0x0004003d,0x00000006,0x000000be,0x000000bd,
+0x00050084,0x00000006,0x000000bf,0x000000bc,
+0x000000be,0x00050041,0x00000007,0x000000c1,
+0x000000aa,0x000000c0,0x0004003d,0x00000006,
+0x000000c2,0x000000c1,0x00050041,0x00000007,
+0x000000c4,0x000000aa,0x000000c3,0x0004003d,
+0x00000006,0x000000c5,0x000000c4,0x00050080,
+0x00000006,0x000000c6,0x000000c2,0x000000c5,
+0x00050080,0x00000006,0x000000c7,0x000000bf,
+0x000000c6,0x000200fe,0x000000c7,0x00010038,
+0x00050036,0x00000002,0x00000016,0x00000000,
+0x00000013,0x00030037,0x00000010,0x00000014,
+0x00030037,0x00000012,0x00000015,0x000200f8,
+0x00000017,0x0004003b,0x00000007,0x000000e0,
+0x00000007,0x0004003b,0x00000007,0x000000e6,
+0x00000007,0x0004003b,0x00000007,0x000000ea,
+0x00000007,0x0004003b,0x00000007,0x000000f0,
+0x00000007,0x0004003b,0x00000007,0x000000f5,
+0x00000007,0x0004003b,0x00000007,0x000000fa,
+0x00000007,0x0004003b,0x00000007,0x00000109,
+0x00000007,0x0004003b,0x00000186,0x00000187,
+0x00000007,0x0004003b,0x00000007,0x00000194,
+0x00000007,0x0004003b,0x00000009,0x00000196,
+0x00000007,0x0004003d,0x0000000f,0x000000cc,
+0x00000014,0x0003003e,0x000000cb,0x000000cc,
+0x0004003d,0x00000011,0x000000cf,0x00000015,
+0x0003003e,0x000000ce,0x000000cf,0x0003003e,
+0x000000d2,0x000000d3,0x00050041,0x000000d5,
+0x000000d6,0x000000cb,0x000000b9,0x0004003d,
+0x00000006,0x000000d7,0x000000d6,0x000500c7,
+0x00000006,0x000000d9,0x000000d7,0x000000d8,
+0x000500aa,0x000000d0,0x000000db,0x000000d9,
+0x000000da,0x0003003e,0x000000d4,0x000000db,
+0x0004003d,0x000000d0,0x000000dc,0x000000d4,
+0x000300f7,0x000000de,0x00000000,0x000400fa,
+0x000000dc,0x000000dd,0x000000de,0x000200f8,
+0x000000dd,0x000100fd,0x000200f8,0x000000de,
+0x00050041,0x000000d5,0x000000e1,0x000000cb,
+0x000000b9,0x0004003d,0x00000006,0x000000e2,
+0x000000e1,0x000600cb,0x00000006,0x000000e5,
+0x000000e2,0x000000e3,0x000000e4,0x0003003e,
+0x000000e0,0x000000e5,0x00050041,0x000000d5,
+0x000000e7,0x000000cb,0x000000b9,0x0004003d,
+0x00000006,0x000000e8,0x000000e7,0x000600cb,
+0x00000006,0x000000e9,0x000000e8,0x000000e4,
+0x000000e4,0x0003003e,0x000000e6,0x000000e9,
+0x00050041,0x000000d5,0x000000eb,0x000000cb,
+0x000000b9,0x0004003d,0x00000006,0x000000ec,
+0x000000eb,0x000600cb,0x00000006,0x000000ef,
+0x000000ec,0x000000ed,0x000000ee,0x0003003e,
+0x000000ea,0x000000ef,0x00050041,0x000000d5,
+0x000000f1,0x000000cb,0x000000b9,0x0004003d,
+0x00000006,0x000000f2,0x000000f1,0x000600cb,
+0x00000006,0x000000f4,0x000000f2,0x000000f3,
+0x000000e4,0x0003003e,0x000000f0,0x000000f4,
+0x00050041,0x000000d5,0x000000f6,0x000000cb,
+0x000000b9,0x0004003d,0x00000006,0x000000f7,
+0x000000f6,0x000600cb,0x00000006,0x000000f9,
+0x000000f7,0x000000f8,0x000000e4,0x0003003e,
+0x000000f5,0x000000f9,0x00050041,0x000000d5,
+0x000000fb,0x000000cb,0x000000b9,0x0004003d,
+0x00000006,0x000000fc,0x000000fb,0x000600cb,
+0x00000006,0x000000fe,0x000000fc,0x000000fd,
+0x000000ee,0x0003003e,0x000000fa,0x000000fe,
+0x00050041,0x000000d5,0x00000100,0x000000cb,
+0x000000b9,0x0004003d,0x00000006,0x00000101,
+0x00000100,0x000600cb,0x00000006,0x00000103,
+0x00000101,0x00000102,0x000000ee,0x000500ab,
+0x000000d0,0x00000104,0x00000103,0x000000c0,
+0x0003003e,0x000000ff,0x00000104,0x0004003d,
+0x00000006,0x00000105,0x000000e0,0x000500aa,
+0x000000d0,0x00000106,0x00000105,0x000000c0,
+0x000300f7,0x00000108,0x00000000,0x000400fa,
+0x00000106,0x00000107,0x00000137,0x000200f8,
+0x00000107,0x0004003d,0x00000006,0x0000010a,
+0x000000e6,0x000500c4,0x00000006,0x0000010b,
+0x0000010a,0x000000ee,0x0004003d,0x00000006,
+0x0000010c,0x000000ea,0x000500c5,0x00000006,
+0x0000010d,0x0000010b,0x0000010c,0x0003003e,
+0x00000109,0x0000010d,0x0004003d,0x00000006,
+0x0000010e,0x000000f5,0x000300f7,0x00000113,
+0x00000000,0x000b00fb,0x0000010e,0x00000113,
+0x00000000,0x0000010f,0x00000001,0x00000110,
+0x00000002,0x00000111,0x00000003,0x00000112,
+0x000200f8,0x0000010f,0x0004003d,0x00000006,
+0x00000116,0x000000f0,0x00050080,0x00000006,
+0x00000117,0x00000116,0x000000b5,0x00050050,
+0x00000011,0x00000118,0x00000115,0x00000117,
+0x0003003e,0x00000114,0x00000118,0x000200f9,
+0x00000113,0x000200f8,0x00000110,0x0004003d,
+0x00000006,0x0000011a,0x000000f0,0x00050080,
+0x00000006,0x0000011b,0x0000011a,0x000000b5,
+0x00050050,0x00000011,0x0000011c,0x0000011b,
+0x00000115,0x0003003e,0x00000114,0x0000011c,
+0x000200f9,0x00000113,0x000200f8,0x00000111,
+0x0004003d,0x00000006,0x0000011e,0x000000f0,
+0x00050080,0x00000006,0x00000120,0x0000011e,
+0x0000011f,0x00050041,0x000000d5,0x00000121,
+0x000000cb,0x000000b9,0x0004003d,0x00000006,
+0x00000122,0x00000121,0x000600cb,0x00000006,
+0x00000123,0x00000122,0x000000fd,0x000000e4,
+0x00050080,0x00000006,0x00000124,0x00000123,
+0x0000011f,0x00050050,0x00000011,0x00000125,
+0x00000120,0x00000124,0x0003003e,0x00000114,
+0x00000125,0x0003003e,0x000000ff,0x000000d3,
+0x0003003e,0x000000fa,0x000000c0,0x000200f9,
+0x00000113,0x000200f8,0x00000112,0x0004003d,
+0x00000006,0x00000127,0x000000f0,0x000500aa,
+0x000000d0,0x00000128,0x00000127,0x000000c0,
+0x000300f7,0x0000012a,0x00000000,0x000400fa,
+0x00000128,0x00000129,0x0000012d,0x000200f8,
+0x00000129,0x0003003e,0x00000114,0x0000012c,
+0x000200f9,0x0000012a,0x000200f8,0x0000012d,
+0x0004003d,0x00000006,0x0000012e,0x000000f0,
+0x000500aa,0x000000d0,0x0000012f,0x0000012e,
+0x000000c3,0x000300f7,0x00000131,0x00000000,
+0x000400fa,0x0000012f,0x00000130,0x00000133,
+0x000200f8,0x00000130,0x0003003e,0x00000114,
+0x00000132,0x000200f9,0x00000131,0x000200f8,
+0x00000133,0x0003003e,0x000000d2,0x00000134,
+0x000100fd,0x000200f8,0x00000131,0x000200f9,
+0x0000012a,0x000200f8,0x0000012a,0x000200f9,
+0x00000113,0x000200f8,0x00000113,0x000200f9,
+0x00000108,0x000200f8,0x00000137,0x0004003d,
+0x00000006,0x00000138,0x000000e0,0x000500c4,
+0x00000006,0x00000139,0x00000138,0x000000ee,
+0x0004003d,0x00000006,0x0000013a,0x000000ea,
+0x000500c5,0x00000006,0x0000013b,0x00000139,
+0x0000013a,0x0003003e,0x00000109,0x0000013b,
+0x0004003d,0x00000006,0x0000013c,0x000000e6,
+0x000300f7,0x00000141,0x00000000,0x000b00fb,
+0x0000013c,0x00000141,0x00000000,0x0000013d,
+0x00000001,0x0000013e,0x00000002,0x0000013f,
+0x00000003,0x00000140,0x000200f8,0x0000013d,
+0x0004003d,0x00000006,0x00000142,0x000000f5,
+0x00050080,0x00000006,0x00000143,0x00000142,
+0x000000b4,0x0004003d,0x00000006,0x00000144,
+0x000000f0,0x00050080,0x00000006,0x00000145,
+0x00000144,0x000000b5,0x00050050,0x00000011,
+0x00000146,0x00000143,0x00000145,0x0003003e,
+0x00000114,0x00000146,0x000200f9,0x00000141,
+0x000200f8,0x0000013e,0x0004003d,0x00000006,
+0x00000148,0x000000f5,0x00050080,0x00000006,
+0x00000149,0x00000148,0x000000b0,0x0004003d,
+0x00000006,0x0000014a,0x000000f0,0x00050080,
+0x00000006,0x0000014b,0x0000014a,0x000000b5,
+0x00050050,0x00000011,0x0000014c,0x00000149,
+0x0000014b,0x0003003e,0x00000114,0x0000014c,
+0x000200f9,0x00000141,0x000200f8,0x0000013f,
+0x0004003d,0x00000006,0x0000014e,0x000000f0,
+0x00050080,0x00000006,0x0000014f,0x0000014e,
+0x000000b5,0x0004003d,0x00000006,0x00000150,
+0x000000f5,0x00050080,0x00000006,0x00000151,
+0x00000150,0x000000b0,0x00050050,0x00000011,
+0x00000152,0x0000014f,0x00000151,0x0003003e,
+0x00000114,0x00000152,0x000200f9,0x00000141,
+0x000200f8,0x00000140,0x0004003d,0x00000006,
+0x00000154,0x000000f5,0x000500c2,0x00000006,
+0x00000155,0x00000154,0x000000ee,0x000500aa,
+0x000000d0,0x00000156,0x00000155,0x000000c0,
+0x000300f7,0x00000158,0x00000000,0x000400fa,
+0x00000156,0x00000157,0x0000015f,0x000200f8,
+0x00000157,0x0004003d,0x00000006,0x00000159,
+0x000000f0,0x00050080,0x00000006,0x0000015a,
+0x00000159,0x000000b5,0x0004003d,0x00000006,
+0x0000015b,0x000000f5,0x000500c7,0x00000006,
+0x0000015c,0x0000015b,0x000000c3,0x00050080,
+0x00000006,0x0000015d,0x0000015c,0x0000011f,
+0x00050050,0x00000011,0x0000015e,0x0000015a,
+0x0000015d,0x0003003e,0x00000114,0x0000015e,
+0x000200f9,0x00000158,0x000200f8,0x0000015f,
+0x0004003d,0x00000006,0x00000160,0x000000f5,
+0x000500c7,0x00000006,0x00000161,0x00000160,
+0x000000c3,0x00050080,0x00000006,0x00000162,
+0x00000161,0x000000b5,0x0004003d,0x00000006,
+0x00000163,0x000000f0,0x00050080,0x00000006,
+0x00000164,0x00000163,0x000000b5,0x00050050,
+0x00000011,0x00000165,0x00000162,0x00000164,
+0x0003003e,0x00000114,0x00000165,0x000200f9,
+0x00000158,0x000200f8,0x00000158,0x000200f9,
+0x00000141,0x000200f8,0x00000141,0x000200f9,
+0x00000108,0x000200f8,0x00000108,0x0004003d,
+0x00000011,0x00000167,0x00000114,0x0004003d,
+0x00000011,0x00000168,0x000000ce,0x000500ac,
+0x00000169,0x0000016a,0x00000167,0x00000168,
+0x0004009a,0x000000d0,0x0000016b,0x0000016a,
+0x000300f7,0x0000016d,0x00000000,0x000400fa,
+0x0000016b,0x0000016c,0x0000016d,0x000200f8,
+0x0000016c,0x0003003e,0x000000d2,0x00000134,
+0x000100fd,0x000200f8,0x0000016d,0x0004003d,
+0x00000006,0x00000181,0x000000fa,0x000500c4,
+0x00000006,0x00000183,0x00000181,0x00000182,
+0x0004003d,0x00000006,0x00000184,0x00000109,
+0x000500c5,0x00000006,0x00000185,0x00000183,
+0x00000184,0x0003003e,0x00000187,0x00000180,
+0x00050041,0x00000009,0x00000188,0x00000187,
+0x00000185,0x0004003d,0x00000008,0x00000189,
+0x00000188,0x0003003e,0x00000170,0x00000189,
+0x00050041,0x000000d5,0x0000018b,0x00000114,
+0x000000c0,0x0004003d,0x00000006,0x0000018c,
+0x0000018b,0x00050041,0x000000d5,0x0000018d,
+0x00000114,0x000000c3,0x0004003d,0x00000006,
+0x0000018e,0x0000018d,0x00050084,0x00000006,
+0x0000018f,0x0000018c,0x0000018e,0x0004003d,
+0x000000d0,0x00000190,0x000000ff,0x000600a9,
+0x00000059,0x00000191,0x00000190,0x000000ee,
+0x000000e3,0x000500c4,0x00000006,0x00000192,
+0x0000018f,0x00000191,0x0003003e,0x0000018a,
+0x00000192,0x0004003d,0x00000006,0x00000195,
+0x0000018a,0x0003003e,0x00000194,0x00000195,
+0x0004003d,0x00000008,0x00000197,0x00000170,
+0x0003003e,0x00000196,0x00000197,0x00060039,
+0x00000006,0x00000198,0x0000000d,0x00000194,
+0x00000196,0x0003003e,0x00000193,0x00000198,
+0x0004003d,0x00000006,0x00000199,0x00000193,
+0x000500b0,0x000000d0,0x0000019b,0x00000199,
+0x0000019a,0x0004003d,0x00000006,0x0000019c,
+0x00000193,0x000500ac,0x000000d0,0x0000019e,
+0x0000019c,0x0000019d,0x000500a6,0x000000d0,
+0x0000019f,0x0000019b,0x0000019e,0x0004003d,
+0x00000006,0x000001a0,0x0000018a,0x000500ac,
+0x000000d0,0x000001a2,0x000001a0,0x000001a1,
+0x000500a6,0x000000d0,0x000001a3,0x0000019f,
+0x000001a2,0x000300f7,0x000001a5,0x00000000,
+0x000400fa,0x000001a3,0x000001a4,0x000001a5,
+0x000200f8,0x000001a4,0x0003003e,0x000000d2,
+0x00000134,0x000100fd,0x000200f8,0x000001a5,
+0x00050041,0x000000d5,0x000001a8,0x000000cb,
+0x000000b9,0x0004003d,0x00000006,0x000001a9,
+0x000001a8,0x000600cb,0x00000006,0x000001ab,
+0x000001a9,0x000001aa,0x000000e4,0x00050080,
+0x00000006,0x000001ac,0x000001ab,0x000000c3,
+0x0003003e,0x000001a7,0x000001ac,0x0004003d,
+0x00000006,0x000001ad,0x000001a7,0x000500ac,
+0x000000d0,0x000001ae,0x000001ad,0x000000c3,
+0x000300f7,0x000001b0,0x00000000,0x000400fa,
+0x000001ae,0x000001af,0x000001b0,0x000200f8,
+0x000001af,0x00050041,0x000000d5,0x000001b2,
+0x000000cb,0x000000b9,0x0004003d,0x00000006,
+0x000001b3,0x000001b2,0x000600cb,0x00000006,
+0x000001b5,0x000001b3,0x000001b4,0x00000102,
+0x0003003e,0x000001b1,0x000001b5,0x000200f9,
+0x000001b0,0x000200f8,0x000001b0,0x0004003d,
+0x000000d0,0x000001b6,0x000000ff,0x0004003d,
+0x00000006,0x000001b7,0x000001a7,0x000500aa,
+0x000000d0,0x000001b8,0x000001b7,0x000000b4,
+0x000500a7,0x000000d0,0x000001b9,0x000001b6,
+0x000001b8,0x000300f7,0x000001bb,0x00000000,
+0x000400fa,0x000001b9,0x000001ba,0x000001bb,
+0x000200f8,0x000001ba,0x0003003e,0x000000d2,
+0x00000134,0x000100fd,0x000200f8,0x000001bb,
+0x000100fd,0x00010038,0x00050036,0x00000006,
+0x0000001c,0x00000000,0x00000018,0x00030037,
+0x00000010,0x00000019,0x00030037,0x00000007,
+0x0000001a,0x00030037,0x00000007,0x0000001b,
+0x000200f8,0x0000001d,0x0004003b,0x00000007,
+0x000001c2,0x00000007,0x0004003b,0x00000007,
+0x000001c7,0x00000007,0x0004003b,0x00000007,
+0x000001ce,0x00000007,0x0004003b,0x00000007,
+0x000001e1,0x00000007,0x0004003b,0x00000007,
+0x000001e4,0x00000007,0x0004003b,0x00000007,
+0x000001ed,0x00000007,0x0004003d,0x00000006,
+0x000001bd,0x0000001b,0x000500aa,0x000000d0,
+0x000001be,0x000001bd,0x000000c0,0x000300f7,
+0x000001c0,0x00000000,0x000400fa,0x000001be,
+0x000001bf,0x000001c0,0x000200f8,0x000001bf,
+0x000200fe,0x000000c0,0x000200f8,0x000001c0,
+0x0004003d,0x00000006,0x000001c3,0x0000001a,
+0x00050086,0x00000006,0x000001c5,0x000001c3,
+0x000001c4,0x00050082,0x00000006,0x000001c6,
+0x000000b9,0x000001c5,0x0003003e,0x000001c2,
+0x000001c6,0x0004003d,0x00000006,0x000001c8,
+0x0000001a,0x0004003d,0x00000006,0x000001c9,
+0x0000001b,0x00050080,0x00000006,0x000001ca,
+0x000001c8,0x000001c9,0x00050082,0x00000006,
+0x000001cb,0x000001ca,0x000000c3,0x00050086,
+0x00000006,0x000001cc,0x000001cb,0x000001c4,
+0x00050082,0x00000006,0x000001cd,0x000000b9,
+0x000001cc,0x0003003e,0x000001c7,0x000001cd,
+0x0004003d,0x00000006,0x000001cf,0x0000001a,
+0x000500c7,0x00000006,0x000001d1,0x000001cf,
+0x000001d0,0x0003003e,0x000001ce,0x000001d1,
+0x0004003d,0x00000006,0x000001d2,0x000001c2,
+0x0004003d,0x00000006,0x000001d3,0x000001c7,
+0x000500aa,0x000000d0,0x000001d4,0x000001d2,
+0x000001d3,0x000300f7,0x000001d6,0x00000000,
+0x000400fa,0x000001d4,0x000001d5,0x000001e0,
+0x000200f8,0x000001d5,0x0004003d,0x00000006,
+0x000001d7,0x000001c2,0x00050041,0x00000007,
+0x000001d8,0x00000019,0x000001d7,0x0004003d,
+0x00000006,0x000001d9,0x000001d8,0x0004003d,
+0x00000006,0x000001da,0x000001ce,0x0004007c,
+0x00000059,0x000001db,0x000001da,0x0004003d,
+0x00000006,0x000001dc,0x0000001b,0x0004007c,
+0x00000059,0x000001dd,0x000001dc,0x000600cb,
+0x00000006,0x000001de,0x000001d9,0x000001db,
+0x000001dd,0x000200fe,0x000001de,0x000200f8,
+0x000001e0,0x0004003d,0x00000006,0x000001e2,
+0x000001ce,0x00050082,0x00000006,0x000001e3,
+0x000001c4,0x000001e2,0x0003003e,0x000001e1,
+0x000001e3,0x0004003d,0x00000006,0x000001e5,
+0x000001c2,0x00050041,0x00000007,0x000001e6,
+0x00000019,0x000001e5,0x0004003d,0x00000006,
+0x000001e7,0x000001e6,0x0004003d,0x00000006,
+0x000001e8,0x000001ce,0x0004007c,0x00000059,
+0x000001e9,0x000001e8,0x0004003d,0x00000006,
+0x000001ea,0x000001e1,0x0004007c,0x00000059,
+0x000001eb,0x000001ea,0x000600cb,0x00000006,
+0x000001ec,0x000001e7,0x000001e9,0x000001eb,
+0x0003003e,0x000001e4,0x000001ec,0x0004003d,
+0x00000006,0x000001ee,0x000001c7,0x00050041,
+0x00000007,0x000001ef,0x00000019,0x000001ee,
+0x0004003d,0x00000006,0x000001f0,0x000001ef,
+0x0004003d,0x00000006,0x000001f1,0x0000001b,
+0x0004003d,0x00000006,0x000001f2,0x000001e1,
+0x00050082,0x00000006,0x000001f3,0x000001f1,
+0x000001f2,0x0004007c,0x00000059,0x000001f4,
+0x000001f3,0x000600cb,0x00000006,0x000001f5,
+0x000001f0,0x000000e3,0x000001f4,0x0003003e,
+0x000001ed,0x000001f5,0x0004003d,0x00000006,
+0x000001f6,0x000001ed,0x0004003d,0x00000006,
+0x000001f7,0x000001e1,0x000500c4,0x00000006,
+0x000001f8,0x000001f6,0x000001f7,0x0004003d,
+0x00000006,0x000001f9,0x000001e4,0x000500c5,
+0x00000006,0x000001fa,0x000001f8,0x000001f9,
+0x000200fe,0x000001fa,0x000200f8,0x000001d6,
+0x000100ff,0x00010038,0x00050036,0x00000006,
+0x00000023,0x00000000,0x0000001e,0x00030037,
+0x00000007,0x0000001f,0x00030037,0x00000007,
+0x00000020,0x00030037,0x00000007,0x00000021,
+0x00030037,0x00000007,0x00000022,0x000200f8,
+0x00000024,0x0004003b,0x00000007,0x00000204,
+0x00000007,0x0004003b,0x00000007,0x0000020f,
+0x00000007,0x0004003b,0x00000007,0x00000214,
+0x00000007,0x0004003b,0x00000007,0x0000021f,
+0x00000007,0x0004003b,0x00000007,0x0000022d,
+0x00000007,0x0004003b,0x00000007,0x00000235,
+0x00000007,0x0004003b,0x00000010,0x00000236,
+0x00000007,0x0004003b,0x00000007,0x00000238,
+0x00000007,0x0004003b,0x00000007,0x0000023a,
+0x00000007,0x0004003b,0x00000007,0x0000023d,
+0x00000007,0x0004003b,0x00000007,0x00000242,
+0x00000007,0x0004003b,0x00000007,0x0000024a,
+0x00000007,0x0004003b,0x00000007,0x00000262,
+0x00000007,0x0004003d,0x00000006,0x000001fd,
+0x000001a7,0x000500aa,0x000000d0,0x000001fe,
+0x000001fd,0x000000c3,0x000300f7,0x00000200,
+0x00000000,0x000400fa,0x000001fe,0x000001ff,
+0x0000020e,0x000200f8,0x000001ff,0x0004003d,
+0x00000006,0x00000202,0x00000193,0x00050082,
+0x00000006,0x00000203,0x00000201,0x00000202,
+0x0003003e,0x00000020,0x00000203,0x00050041,
+0x000000d5,0x00000205,0x000000cb,0x000000b9,
+0x0004003d,0x00000006,0x00000206,0x00000205,
+0x000600cb,0x00000006,0x00000207,0x00000206,
+0x000001b4,0x000000ed,0x0003003e,0x00000204,
+0x00000207,0x0004003d,0x00000006,0x00000208,
+0x00000204,0x000500c2,0x00000006,0x00000209,
+0x00000208,0x000000e4,0x00050084,0x00000006,
+0x0000020a,0x000000b5,0x00000209,0x00050080,
+0x00000006,0x0000020b,0x0000020a,0x000000b5,
+0x0003003e,0x00000021,0x0000020b,0x0003003e,
+0x00000022,0x000000c0,0x0004003d,0x00000006,
+0x0000020c,0x00000204,0x000200fe,0x0000020c,
+0x000200f8,0x0000020e,0x00050041,0x000000d5,
+0x00000210,0x000000cb,0x000000b9,0x0004003d,
+0x00000006,0x00000211,0x00000210,0x000600cb,
+0x00000006,0x00000213,0x00000211,0x00000212,
+0x000000e4,0x0003003e,0x0000020f,0x00000213,
+0x00050041,0x000000d5,0x00000215,0x000000cb,
+0x000000b9,0x0004003d,0x00000006,0x00000216,
+0x00000215,0x000600cb,0x00000006,0x00000218,
+0x00000216,0x00000217,0x000000ed,0x0003003e,
+0x00000214,0x00000218,0x0004003d,0x00000006,
+0x00000219,0x0000020f,0x000500aa,0x000000d0,
+0x0000021a,0x00000219,0x000000c0,0x000300f7,
+0x0000021c,0x00000000,0x000400fa,0x0000021a,
+0x0000021b,0x0000022c,0x000200f8,0x0000021b,
+0x0004003d,0x00000006,0x0000021d,0x00000193,
+0x00050082,0x00000006,0x0000021e,0x00000201,
+0x0000021d,0x0003003e,0x00000020,0x0000021e,
+0x0004003d,0x00000006,0x00000220,0x00000214,
+0x000500c2,0x00000006,0x00000221,0x00000220,
+0x000000e4,0x00050084,0x00000006,0x00000222,
+0x000000b5,0x00000221,0x00050080,0x00000006,
+0x00000223,0x00000222,0x000000b5,0x0003003e,
+0x0000021f,0x00000223,0x0004003d,0x00000006,
+0x00000224,0x0000021f,0x0004003d,0x00000006,
+0x00000225,0x000001a7,0x00050084,0x00000006,
+0x00000226,0x00000224,0x00000225,0x0003003e,
+0x00000021,0x00000226,0x0004003d,0x00000006,
+0x00000227,0x0000021f,0x0004003d,0x00000006,
+0x00000228,0x0000001f,0x00050084,0x00000006,
+0x00000229,0x00000227,0x00000228,0x0003003e,
+0x00000022,0x00000229,0x0004003d,0x00000006,
+0x0000022a,0x00000214,0x000200fe,0x0000022a,
+0x000200f8,0x0000022c,0x0004003d,0x00000006,
+0x0000022e,0x000001a7,0x00050084,0x00000006,
+0x0000022f,0x000000b9,0x0000022e,0x00050082,
+0x00000006,0x00000230,0x0000022f,0x000000b4,
+0x0003003e,0x0000022d,0x00000230,0x0004003d,
+0x00000006,0x00000231,0x00000193,0x00050082,
+0x00000006,0x00000232,0x00000201,0x00000231,
+0x0004003d,0x00000006,0x00000233,0x0000022d,
+0x00050082,0x00000006,0x00000234,0x00000232,
+0x00000233,0x0003003e,0x00000020,0x00000234,
+0x0004003d,0x0000000f,0x00000237,0x000000cb,
+0x0003003e,0x00000236,0x00000237,0x0004003d,
+0x00000006,0x00000239,0x00000020,0x0003003e,
+0x00000238,0x00000239,0x0004003d,0x00000006,
+0x0000023b,0x0000022d,0x0003003e,0x0000023a,
+0x0000023b,0x00070039,0x00000006,0x0000023c,
+0x0000001c,0x00000236,0x00000238,0x0000023a,
+0x0003003e,0x00000235,0x0000023c,0x0004003d,
+0x00000006,0x0000023e,0x00000235,0x000500c4,
+0x00000006,0x0000023f,0x0000023e,0x000000ed,
+0x0004003d,0x00000006,0x00000240,0x00000214,
+0x000500c5,0x00000006,0x00000241,0x0000023f,
+0x00000240,0x0003003e,0x0000023d,0x00000241,
+0x0004003d,0x00000006,0x00000243,0x0000023d,
+0x0004003d,0x00000006,0x00000244,0x0000001f,
+0x00050084,0x00000006,0x00000245,0x000000b5,
+0x00000244,0x0004003d,0x00000006,0x00000246,
+0x000001a7,0x00050080,0x00000006,0x00000247,
+0x00000245,0x00000246,0x0004007c,0x00000059,
+0x00000248,0x00000247,0x000600cb,0x00000006,
+0x00000249,0x00000243,0x00000248,0x000000e4,
+0x0003003e,0x00000242,0x00000249,0x0004003d,
+0x00000006,0x0000024b,0x0000023d,0x0004003d,
+0x00000006,0x0000024c,0x000001a7,0x0004007c,
+0x00000059,0x0000024d,0x0000024c,0x000600cb,
+0x00000006,0x0000024e,0x0000024b,0x000000e3,
+0x0000024d,0x0003003e,0x0000024a,0x0000024e,
+0x0004003d,0x00000006,0x0000024f,0x0000020f,
+0x0004003d,0x00000006,0x00000250,0x000001a7,
+0x00050084,0x00000006,0x00000251,0x0000024f,
+0x00000250,0x0004003d,0x00000006,0x00000252,
+0x0000024a,0x000400cd,0x00000059,0x00000253,
+0x00000252,0x0004007c,0x00000006,0x00000254,
+0x00000253,0x00050080,0x00000006,0x00000255,
+0x00000251,0x00000254,0x00050084,0x00000006,
+0x00000256,0x000000b5,0x00000255,0x0003003e,
+0x00000021,0x00000256,0x0004003d,0x00000006,
+0x00000257,0x0000020f,0x0004003d,0x00000006,
+0x00000258,0x0000001f,0x00050084,0x00000006,
+0x00000259,0x00000257,0x00000258,0x0004003d,
+0x00000006,0x0000025a,0x0000024a,0x0004003d,
+0x00000006,0x0000025b,0x0000001f,0x0004007c,
+0x00000059,0x0000025c,0x0000025b,0x000600cb,
+0x00000006,0x0000025d,0x0000025a,0x000000e3,
+0x0000025c,0x000400cd,0x00000059,0x0000025e,
+0x0000025d,0x0004007c,0x00000006,0x0000025f,
+0x0000025e,0x00050080,0x00000006,0x00000260,
+0x00000259,0x0000025f,0x00050084,0x00000006,
+0x00000261,0x000000b5,0x00000260,0x0003003e,
+0x00000022,0x00000261,0x0004003d,0x00000006,
+0x00000263,0x0000020f,0x00050082,0x00000006,
+0x00000264,0x00000263,0x000000c3,0x0004003d,
+0x00000006,0x00000265,0x0000024a,0x0004003d,
+0x00000006,0x00000266,0x0000001f,0x0004007c,
+0x00000059,0x00000267,0x00000266,0x000600cb,
+0x00000006,0x00000268,0x00000265,0x00000267,
+0x000000ee,0x00050080,0x00000006,0x00000269,
+0x00000264,0x00000268,0x0003003e,0x00000262,
+0x00000269,0x0004003d,0x00000006,0x0000026a,
+0x00000262,0x000500c4,0x00000006,0x0000026b,
+0x0000026a,0x000000e4,0x0004003d,0x00000006,
+0x0000026c,0x00000242,0x000500c5,0x00000006,
+0x0000026d,0x0000026b,0x0000026c,0x000200fe,
+0x0000026d,0x000200f8,0x0000021c,0x000100ff,
+0x000200f8,0x00000200,0x000100ff,0x00010038,
+0x00050036,0x00000006,0x0000002a,0x00000000,
+0x00000025,0x00030037,0x00000010,0x00000026,
+0x00030037,0x00000007,0x00000027,0x00030037,
+0x00000007,0x00000028,0x00030037,0x00000007,
+0x00000029,0x000200f8,0x0000002b,0x0004003b,
+0x00000270,0x00000271,0x00000007,0x0004003b,
+0x00000007,0x00000274,0x00000007,0x0004003b,
+0x00000010,0x0000027b,0x00000007,0x0004003b,
+0x00000007,0x0000027d,0x00000007,0x0004003b,
+0x00000007,0x0000027e,0x00000007,0x0004003b,
+0x00000007,0x00000280,0x00000007,0x0004003b,
+0x00000007,0x000002a3,0x00000007,0x0004003b,
+0x00000010,0x000002a4,0x00000007,0x0004003b,
+0x00000007,0x000002a6,0x00000007,0x0004003b,
+0x00000007,0x000002a8,0x00000007,0x0004003b,
+0x00000270,0x000002ac,0x00000007,0x0004003b,
+0x00000007,0x000002ba,0x00000007,0x0004003b,
+0x000003a3,0x000003a4,0x00000007,0x0004003d,
+0x00000006,0x00000272,0x00000028,0x0004007c,
+0x00000059,0x00000273,0x00000272,0x0003003e,
+0x00000271,0x00000273,0x0004003d,0x00000006,
+0x00000275,0x00000027,0x0004003d,0x00000006,
+0x00000276,0x00000028,0x00050080,0x00000006,
+0x00000277,0x00000275,0x00000276,0x0004003d,
+0x00000006,0x00000278,0x00000028,0x00050084,
+0x00000006,0x00000279,0x000000b4,0x00000278,
+0x00050080,0x00000006,0x0000027a,0x00000279,
+0x000000b0,0x0004003d,0x0000000f,0x0000027c,
+0x00000026,0x0003003e,0x0000027b,0x0000027c,
+0x0003003e,0x0000027d,0x00000277,0x0003003e,
+0x0000027e,0x0000027a,0x00070039,0x00000006,
+0x0000027f,0x0000001c,0x0000027b,0x0000027d,
+0x0000027e,0x0003003e,0x00000274,0x0000027f,
+0x0004003d,0x00000006,0x00000281,0x00000274,
+0x000600cb,0x00000006,0x00000282,0x00000281,
+0x000000e3,0x000000e4,0x0004003d,0x00000006,
+0x00000283,0x00000274,0x0004003d,0x00000059,
+0x00000284,0x00000271,0x00050084,0x00000059,
+0x00000285,0x000000ee,0x00000284,0x00050080,
+0x00000059,0x00000286,0x00000285,0x000000e4,
+0x000600cb,0x00000006,0x00000287,0x00000283,
+0x00000286,0x000000e4,0x000500c4,0x00000006,
+0x00000288,0x00000287,0x000000e4,0x000500c5,
+0x00000006,0x00000289,0x00000282,0x00000288,
+0x0004003d,0x00000006,0x0000028a,0x00000274,
+0x0004003d,0x00000059,0x0000028b,0x00000271,
+0x00050084,0x00000059,0x0000028c,0x000000e4,
+0x0000028b,0x00050080,0x00000059,0x0000028d,
+0x0000028c,0x000000ed,0x000600cb,0x00000006,
+0x0000028e,0x0000028a,0x0000028d,0x000000ee,
+0x000500c4,0x00000006,0x0000028f,0x0000028e,
+0x000000ed,0x000500c5,0x00000006,0x00000290,
+0x00000289,0x0000028f,0x0004003d,0x00000006,
+0x00000291,0x00000274,0x0004003d,0x00000059,
+0x00000292,0x00000271,0x00050084,0x00000059,
+0x00000293,0x00000182,0x00000292,0x00050080,
+0x00000059,0x00000294,0x00000293,0x000000f3,
+0x000600cb,0x00000006,0x00000295,0x00000291,
+0x00000294,0x000000e4,0x000500c4,0x00000006,
+0x00000296,0x00000295,0x000000f3,0x000500c5,
+0x00000006,0x00000297,0x00000290,0x00000296,
+0x0004003d,0x00000006,0x00000298,0x00000274,
+0x0004003d,0x00000059,0x00000299,0x00000271,
+0x00050084,0x00000059,0x0000029a,0x000000ed,
+0x00000299,0x00050080,0x00000059,0x0000029b,
+0x0000029a,0x000000f8,0x000600cb,0x00000006,
+0x0000029c,0x00000298,0x0000029b,0x000000ee,
+0x000500c4,0x00000006,0x0000029d,0x0000029c,
+0x000000f8,0x000500c5,0x00000006,0x0000029e,
+0x00000297,0x0000029d,0x0003003e,0x00000280,
+0x0000029e,0x0004003d,0x00000006,0x0000029f,
+0x00000029,0x000500aa,0x000000d0,0x000002a0,
+0x0000029f,0x000000c0,0x000300f7,0x000002a2,
+0x00000000,0x000400fa,0x000002a0,0x000002a1,
+0x000002ab,0x000200f8,0x000002a1,0x0004003d,
+0x0000000f,0x000002a5,0x00000026,0x0003003e,
+0x000002a4,0x000002a5,0x0004003d,0x00000006,
+0x000002a7,0x00000027,0x0003003e,0x000002a6,
+0x000002a7,0x0004003d,0x00000006,0x000002a9,
+0x00000028,0x0003003e,0x000002a8,0x000002a9,
+0x00070039,0x00000006,0x000002aa,0x0000001c,
+0x000002a4,0x000002a6,0x000002a8,0x0003003e,
+0x000002a3,0x000002aa,0x000200f9,0x000002a2,
+0x000200f8,0x000002ab,0x0004003d,0x00000006,
+0x000002ad,0x00000029,0x0004007c,0x00000059,
+0x000002ae,0x000002ad,0x00050082,0x00000059,
+0x000002af,0x000002ae,0x000000ee,0x0003003e,
+0x000002ac,0x000002af,0x0004003d,0x00000006,
+0x000002b0,0x00000274,0x0004003d,0x00000059,
+0x000002b1,0x000002ac,0x0004003d,0x00000059,
+0x000002b2,0x00000271,0x00050084,0x00000059,
+0x000002b3,0x000002b1,0x000002b2,0x0004003d,
+0x00000059,0x000002b5,0x000002ac,0x0005004d,
+0x00000059,0x000002b6,0x000002b4,0x000002b5,
+0x00050080,0x00000059,0x000002b7,0x000002b3,
+0x000002b6,0x0004003d,0x00000059,0x000002b8,
+0x00000271,0x000600cb,0x00000006,0x000002b9,
+0x000002b0,0x000002b7,0x000002b8,0x0003003e,
+0x000002a3,0x000002b9,0x000200f9,0x000002a2,
+0x000200f8,0x000002a2,0x0004003d,0x00000006,
+0x000003a2,0x00000280,0x0003003e,0x000003a4,
+0x000003a1,0x00050041,0x00000007,0x000003a5,
+0x000003a4,0x000003a2,0x0004003d,0x00000006,
+0x000003a6,0x000003a5,0x0003003e,0x000002ba,
+0x000003a6,0x0004003d,0x00000006,0x000003a7,
+0x000002ba,0x0004003d,0x00000006,0x000003a8,
+0x00000029,0x0004007c,0x00000059,0x000003a9,
+0x000003a8,0x00050084,0x00000059,0x000003aa,
+0x000000e4,0x000003a9,0x000600cb,0x00000006,
+0x000003ab,0x000003a7,0x000003aa,0x000000e4,
+0x0004003d,0x00000006,0x000003ac,0x00000028,
+0x000500c4,0x00000006,0x000003ad,0x000003ab,
+0x000003ac,0x0004003d,0x00000006,0x000003ae,
+0x000002a3,0x000500c5,0x00000006,0x000003af,
+0x000003ad,0x000003ae,0x000200fe,0x000003af,
+0x00010038,0x00050036,0x00000006,0x00000030,
+0x00000000,0x00000025,0x00030037,0x00000010,
+0x0000002c,0x00030037,0x00000007,0x0000002d,
+0x00030037,0x00000007,0x0000002e,0x00030037,
+0x00000007,0x0000002f,0x000200f8,0x00000031,
+0x0004003b,0x00000270,0x000003b2,0x00000007,
+0x0004003b,0x00000007,0x000003b5,0x00000007,
+0x0004003b,0x00000010,0x000003b9,0x00000007,
+0x0004003b,0x00000007,0x000003bb,0x00000007,
+0x0004003b,0x00000007,0x000003bd,0x00000007,
+0x0004003b,0x00000007,0x000003bf,0x00000007,
+0x0004003b,0x00000007,0x000003d1,0x00000007,
+0x0004003b,0x00000007,0x000003dd,0x00000007,
+0x0004003b,0x00000414,0x00000415,0x00000007,
+0x0004003d,0x00000006,0x000003b3,0x0000002e,
+0x0004007c,0x00000059,0x000003b4,0x000003b3,
+0x0003003e,0x000003b2,0x000003b4,0x0004003d,
+0x00000006,0x000003b6,0x0000002e,0x00050084,
+0x00000006,0x000003b7,0x000000b9,0x000003b6,
+0x00050080,0x00000006,0x000003b8,0x000003b7,
+0x000000b1,0x0004003d,0x0000000f,0x000003ba,
+0x0000002c,0x0003003e,0x000003b9,0x000003ba,
+0x0004003d,0x00000006,0x000003bc,0x0000002d,
+0x0003003e,0x000003bb,0x000003bc,0x0003003e,
+0x000003bd,0x000003b8,0x00070039,0x00000006,
+0x000003be,0x0000001c,0x000003b9,0x000003bb,
+0x000003bd,0x0003003e,0x000003b5,0x000003be,
+0x0004003d,0x00000006,0x000003c0,0x000003b5,
+0x0004003d,0x00000059,0x000003c1,0x000003b2,
+0x000600cb,0x00000006,0x000003c2,0x000003c0,
+0x000003c1,0x00000182,0x0004003d,0x00000006,
+0x000003c3,0x000003b5,0x0004003d,0x00000059,
+0x000003c4,0x000003b2,0x00050084,0x00000059,
+0x000003c5,0x000000e4,0x000003c4,0x00050080,
+0x00000059,0x000003c6,0x000003c5,0x00000182,
+0x000600cb,0x00000006,0x000003c7,0x000003c3,
+0x000003c6,0x000000e4,0x000500c4,0x00000006,
+0x000003c8,0x000003c7,0x00000182,0x000500c5,
+0x00000006,0x000003c9,0x000003c2,0x000003c8,
+0x0004003d,0x00000006,0x000003ca,0x000003b5,
+0x0004003d,0x00000059,0x000003cb,0x000003b2,
+0x00050084,0x00000059,0x000003cc,0x00000182,
+0x000003cb,0x00050080,0x00000059,0x000003cd,
+0x000003cc,0x000000f3,0x000600cb,0x00000006,
+0x000003ce,0x000003ca,0x000003cd,0x000000e4,
+0x000500c4,0x00000006,0x000003cf,0x000003ce,
+0x000000f3,0x000500c5,0x00000006,0x000003d0,
+0x000003c9,0x000003cf,0x0003003e,0x000003bf,
+0x000003d0,0x0004003d,0x00000006,0x000003d2,
+0x000003b5,0x0004003d,0x00000006,0x000003d3,
+0x0000002f,0x0004007c,0x00000059,0x000003d4,
+0x000003d3,0x0004003d,0x00000059,0x000003d5,
+0x000003b2,0x00050084,0x00000059,0x000003d6,
+0x000003d4,0x000003d5,0x0004003d,0x00000006,
+0x000003d8,0x0000002f,0x0005004d,0x00000059,
+0x000003d9,0x000003d7,0x000003d8,0x00050080,
+0x00000059,0x000003da,0x000003d6,0x000003d9,
+0x0004003d,0x00000059,0x000003db,0x000003b2,
+0x000600cb,0x00000006,0x000003dc,0x000003d2,
+0x000003da,0x000003db,0x0003003e,0x000003d1,
+0x000003dc,0x0004003d,0x00000006,0x00000413,
+0x000003bf,0x0003003e,0x00000415,0x00000412,
+0x00050041,0x00000007,0x00000416,0x00000415,
+0x00000413,0x0004003d,0x00000006,0x00000417,
+0x00000416,0x0003003e,0x000003dd,0x00000417,
+0x0004003d,0x00000006,0x00000418,0x000003dd,
+0x0004003d,0x00000006,0x00000419,0x0000002f,
+0x0004007c,0x00000059,0x0000041a,0x00000419,
+0x00050084,0x00000059,0x0000041b,0x00000182,
+0x0000041a,0x000600cb,0x00000006,0x0000041c,
+0x00000418,0x0000041b,0x00000182,0x0004003d,
+0x00000006,0x0000041d,0x0000002e,0x000500c4,
+0x00000006,0x0000041e,0x0000041c,0x0000041d,
+0x0004003d,0x00000006,0x0000041f,0x000003d1,
+0x000500c5,0x00000006,0x00000420,0x0000041e,
+0x0000041f,0x000200fe,0x00000420,0x00010038,
+0x00050036,0x00000006,0x00000037,0x00000000,
+0x00000032,0x00030037,0x00000010,0x00000033,
+0x00030037,0x00000009,0x00000034,0x00030037,
+0x00000007,0x00000035,0x00030037,0x00000007,
+0x00000036,0x000200f8,0x00000038,0x0004003b,
+0x00000007,0x00000429,0x00000007,0x0004003b,
+0x00000007,0x00000431,0x00000007,0x0004003b,
+0x00000007,0x00000438,0x00000007,0x0004003b,
+0x00000010,0x0000043b,0x00000007,0x0004003b,
+0x00000007,0x0000043d,0x00000007,0x0004003b,
+0x00000007,0x0000043f,0x00000007,0x0004003b,
+0x00000007,0x00000441,0x00000007,0x0004003b,
+0x00000459,0x0000045a,0x00000007,0x0004003b,
+0x00000007,0x00000464,0x00000007,0x0004003b,
+0x00000007,0x0000046b,0x00000007,0x0004003b,
+0x00000010,0x0000046e,0x00000007,0x0004003b,
+0x00000007,0x00000470,0x00000007,0x0004003b,
+0x00000007,0x00000472,0x00000007,0x0004003b,
+0x00000007,0x00000474,0x00000007,0x0004003b,
+0x00000487,0x00000488,0x00000007,0x0004003b,
+0x00000007,0x0000048d,0x00000007,0x0004003b,
+0x00000007,0x00000491,0x00000007,0x0004003b,
+0x00000010,0x00000492,0x00000007,0x0004003b,
+0x00000007,0x00000494,0x00000007,0x0004003b,
+0x00000007,0x00000496,0x00000007,0x0004003b,
+0x00000012,0x00000499,0x00000007,0x0004003b,
+0x000004a4,0x000004a5,0x00000007,0x0004003d,
+0x00000006,0x00000423,0x00000036,0x0004003d,
+0x00000006,0x00000424,0x00000035,0x000500ae,
+0x000000d0,0x00000425,0x00000423,0x00000424,
+0x000300f7,0x00000427,0x00000000,0x000400fa,
+0x00000425,0x00000426,0x00000427,0x000200f8,
+0x00000426,0x000200fe,0x000000c0,0x000200f8,
+0x00000427,0x00050041,0x00000007,0x0000042a,
+0x00000034,0x000000b5,0x0004003d,0x00000006,
+0x0000042b,0x0000042a,0x0003003e,0x00000429,
+0x0000042b,0x00050041,0x00000007,0x0000042c,
+0x00000034,0x000000c0,0x0004003d,0x00000006,
+0x0000042d,0x0000042c,0x000500aa,0x000000d0,
+0x0000042e,0x0000042d,0x000000c3,0x000300f7,
+0x00000430,0x00000000,0x000400fa,0x0000042e,
+0x0000042f,0x0000045e,0x000200f8,0x0000042f,
+0x0004003d,0x00000006,0x00000432,0x00000036,
+0x00050086,0x00000006,0x00000433,0x00000432,
+0x000000b8,0x0004003d,0x00000006,0x00000434,
+0x00000429,0x00050084,0x00000006,0x00000435,
+0x000000b8,0x00000434,0x00050080,0x00000006,
+0x00000436,0x00000435,0x000000b0,0x00050084,
+0x00000006,0x00000437,0x00000433,0x00000436,
+0x0003003e,0x00000431,0x00000437,0x0004003d,
+0x00000006,0x00000439,0x00000036,0x00050089,
+0x00000006,0x0000043a,0x00000439,0x000000b8,
+0x0004003d,0x0000000f,0x0000043c,0x00000033,
+0x0003003e,0x0000043b,0x0000043c,0x0004003d,
+0x00000006,0x0000043e,0x00000431,0x0003003e,
+0x0000043d,0x0000043e,0x0004003d,0x00000006,
+0x00000440,0x00000429,0x0003003e,0x0000043f,
+0x00000440,0x0003003e,0x00000441,0x0000043a,
+0x00080039,0x00000006,0x00000442,0x0000002a,
+0x0000043b,0x0000043d,0x0000043f,0x00000441,
+0x0003003e,0x00000438,0x00000442,0x0004003d,
+0x00000006,0x00000452,0x00000429,0x000500c4,
+0x00000059,0x00000453,0x000000ee,0x00000452,
+0x00050082,0x00000059,0x00000454,0x00000453,
+0x000000ee,0x00050084,0x00000059,0x00000455,
+0x00000182,0x00000454,0x0004007c,0x00000006,
+0x00000456,0x00000455,0x0004003d,0x00000006,
+0x00000457,0x00000438,0x00050080,0x00000006,
+0x00000458,0x00000456,0x00000457,0x0003003e,
+0x0000045a,0x00000451,0x00050041,0x00000007,
+0x0000045b,0x0000045a,0x00000458,0x0004003d,
+0x00000006,0x0000045c,0x0000045b,0x000200fe,
+0x0000045c,0x000200f8,0x0000045e,0x00050041,
+0x00000007,0x0000045f,0x00000034,0x000000c3,
+0x0004003d,0x00000006,0x00000460,0x0000045f,
+0x000500aa,0x000000d0,0x00000461,0x00000460,
+0x000000c3,0x000300f7,0x00000463,0x00000000,
+0x000400fa,0x00000461,0x00000462,0x0000048c,
+0x000200f8,0x00000462,0x0004003d,0x00000006,
+0x00000465,0x00000036,0x00050086,0x00000006,
+0x00000466,0x00000465,0x000000b9,0x0004003d,
+0x00000006,0x00000467,0x00000429,0x00050084,
+0x00000006,0x00000468,0x000000b9,0x00000467,
+0x00050080,0x00000006,0x00000469,0x00000468,
+0x000000b1,0x00050084,0x00000006,0x0000046a,
+0x00000466,0x00000469,0x0003003e,0x00000464,
+0x0000046a,0x0004003d,0x00000006,0x0000046c,
+0x00000036,0x00050089,0x00000006,0x0000046d,
+0x0000046c,0x000000b9,0x0004003d,0x0000000f,
+0x0000046f,0x00000033,0x0003003e,0x0000046e,
+0x0000046f,0x0004003d,0x00000006,0x00000471,
+0x00000464,0x0003003e,0x00000470,0x00000471,
+0x0004003d,0x00000006,0x00000473,0x00000429,
+0x0003003e,0x00000472,0x00000473,0x0003003e,
+0x00000474,0x0000046d,0x00080039,0x00000006,
+0x00000475,0x00000030,0x0000046e,0x00000470,
+0x00000472,0x00000474,0x0003003e,0x0000046b,
+0x00000475,0x0004003d,0x00000006,0x00000480,
+0x00000429,0x000500c4,0x00000059,0x00000481,
+0x000000ee,0x00000480,0x00050082,0x00000059,
+0x00000482,0x00000481,0x000000ee,0x00050084,
+0x00000059,0x00000483,0x000000f3,0x00000482,
+0x0004007c,0x00000006,0x00000484,0x00000483,
+0x0004003d,0x00000006,0x00000485,0x0000046b,
+0x00050080,0x00000006,0x00000486,0x00000484,
+0x00000485,0x0003003e,0x00000488,0x0000047f,
+0x00050041,0x00000007,0x00000489,0x00000488,
+0x00000486,0x0004003d,0x00000006,0x0000048a,
+0x00000489,0x000200fe,0x0000048a,0x000200f8,
+0x0000048c,0x0004003d,0x00000006,0x0000048e,
+0x00000036,0x0004003d,0x00000006,0x0000048f,
+0x00000429,0x00050084,0x00000006,0x00000490,
+0x0000048e,0x0000048f,0x0003003e,0x0000048d,
+0x00000490,0x0004003d,0x0000000f,0x00000493,
+0x00000033,0x0003003e,0x00000492,0x00000493,
+0x0004003d,0x00000006,0x00000495,0x0000048d,
+0x0003003e,0x00000494,0x00000495,0x0004003d,
+0x00000006,0x00000497,0x00000429,0x0003003e,
+0x00000496,0x00000497,0x00070039,0x00000006,
+0x00000498,0x0000001c,0x00000492,0x00000494,
+0x00000496,0x0003003e,0x00000491,0x00000498,
+0x0004003d,0x00000006,0x000004a2,0x00000429,
+0x00050082,0x00000006,0x000004a3,0x000004a2,
+0x000000c3,0x0003003e,0x000004a5,0x000004a1,
+0x00050041,0x00000012,0x000004a6,0x000004a5,
+0x000004a3,0x0004003d,0x00000011,0x000004a7,
+0x000004a6,0x0003003e,0x00000499,0x000004a7,
+0x0004003d,0x00000006,0x000004a8,0x00000491,
+0x00050041,0x00000007,0x000004a9,0x00000499,
+0x000000c0,0x0004003d,0x00000006,0x000004aa,
+0x000004a9,0x00050084,0x00000006,0x000004ab,
+0x000004a8,0x000004aa,0x0004003d,0x00000006,
+0x000004ac,0x00000491,0x00050041,0x00000007,
+0x000004ad,0x00000499,0x000000c3,0x0004003d,
+0x00000006,0x000004ae,0x000004ad,0x000500c2,
+0x00000006,0x000004af,0x000004ac,0x000004ae,
+0x000500c5,0x00000006,0x000004b0,0x000004ab,
+0x000004af,0x0003003e,0x00000491,0x000004b0,
+0x0004003d,0x00000006,0x000004b1,0x00000491,
+0x000500ac,0x000000d0,0x000004b2,0x000004b1,
+0x000001c4,0x000300f7,0x000004b4,0x00000000,
+0x000400fa,0x000004b2,0x000004b3,0x000004b4,
+0x000200f8,0x000004b3,0x0004003d,0x00000006,
+0x000004b5,0x00000491,0x00050080,0x00000006,
+0x000004b6,0x000004b5,0x000000c3,0x0003003e,
+0x00000491,0x000004b6,0x000200f9,0x000004b4,
+0x000200f8,0x000004b4,0x0004003d,0x00000006,
+0x000004b7,0x00000491,0x000200fe,0x000004b7,
+0x000200f8,0x00000463,0x000100ff,0x000200f8,
+0x00000430,0x000100ff,0x00010038,0x00050036,
+0x00000006,0x00000042,0x00000000,0x00000039,
+0x00030037,0x00000010,0x0000003a,0x00030037,
+0x00000009,0x0000003b,0x00030037,0x00000007,
+0x0000003c,0x00030037,0x00000007,0x0000003d,
+0x00030037,0x00000007,0x0000003e,0x00030037,
+0x00000007,0x0000003f,0x00030037,0x00000007,
+0x00000040,0x00030037,0x00000012,0x00000041,
+0x000200f8,0x00000043,0x0004003b,0x00000010,
+0x000004ba,0x00000007,0x0004003b,0x00000010,
+0x000004c8,0x00000007,0x0004003b,0x00000010,
+0x000004c9,0x00000007,0x0004003b,0x00000009,
+0x000004cb,0x00000007,0x0004003b,0x00000007,
+0x000004cd,0x00000007,0x0004003b,0x00000007,
+0x000004cf,0x00000007,0x0004003b,0x00000010,
+0x000004d3,0x00000007,0x0004003b,0x00000009,
+0x000004d5,0x00000007,0x0004003b,0x00000007,
+0x000004d7,0x00000007,0x0004003b,0x00000007,
+0x000004d9,0x00000007,0x0004003b,0x00000010,
+0x000004dd,0x00000007,0x0004003b,0x00000009,
+0x000004df,0x00000007,0x0004003b,0x00000007,
+0x000004e1,0x00000007,0x0004003b,0x00000007,
+0x000004e3,0x00000007,0x0004003b,0x00000010,
+0x000004e7,0x00000007,0x0004003b,0x00000009,
+0x000004e9,0x00000007,0x0004003b,0x00000007,
+0x000004eb,0x00000007,0x0004003b,0x00000007,
+0x000004ed,0x00000007,0x0004003b,0x00000007,
+0x000004f2,0x00000007,0x0004003b,0x00000010,
+0x000004fa,0x00000007,0x0004003d,0x00000006,
+0x000004bb,0x0000003f,0x0004003d,0x00000006,
+0x000004bc,0x0000003d,0x00070050,0x0000000f,
+0x000004bd,0x000004bc,0x000004bc,0x000004bc,
+0x000004bc,0x0004003d,0x00000006,0x000004be,
+0x0000003e,0x0004003d,0x00000006,0x000004bf,
+0x0000003e,0x00050080,0x00000006,0x000004c0,
+0x000004bf,0x000000c3,0x00070050,0x0000000f,
+0x000004c1,0x000000c0,0x000000c3,0x000004be,
+0x000004c0,0x00050080,0x0000000f,0x000004c2,
+0x000004bd,0x000004c1,0x00070050,0x0000000f,
+0x000004c3,0x000004bb,0x000004bb,0x000004bb,
+0x000004bb,0x00050084,0x0000000f,0x000004c4,
+0x000004c3,0x000004c2,0x0004003d,0x00000006,
+0x000004c5,0x00000040,0x00070050,0x0000000f,
+0x000004c6,0x000004c5,0x000004c5,0x000004c5,
+0x000004c5,0x00050080,0x0000000f,0x000004c7,
+0x000004c4,0x000004c6,0x0003003e,0x000004ba,
+0x000004c7,0x0004003d,0x0000000f,0x000004ca,
+0x0000003a,0x0003003e,0x000004c9,0x000004ca,
+0x0004003d,0x00000008,0x000004cc,0x0000003b,
+0x0003003e,0x000004cb,0x000004cc,0x0004003d,
+0x00000006,0x000004ce,0x0000003c,0x0003003e,
+0x000004cd,0x000004ce,0x00050041,0x00000007,
+0x000004d0,0x000004ba,0x000000c0,0x0004003d,
+0x00000006,0x000004d1,0x000004d0,0x0003003e,
+0x000004cf,0x000004d1,0x00080039,0x00000006,
+0x000004d2,0x00000037,0x000004c9,0x000004cb,
+0x000004cd,0x000004cf,0x0004003d,0x0000000f,
+0x000004d4,0x0000003a,0x0003003e,0x000004d3,
+0x000004d4,0x0004003d,0x00000008,0x000004d6,
+0x0000003b,0x0003003e,0x000004d5,0x000004d6,
+0x0004003d,0x00000006,0x000004d8,0x0000003c,
+0x0003003e,0x000004d7,0x000004d8,0x00050041,
+0x00000007,0x000004da,0x000004ba,0x000000c3,
+0x0004003d,0x00000006,0x000004db,0x000004da,
+0x0003003e,0x000004d9,0x000004db,0x00080039,
+0x00000006,0x000004dc,0x00000037,0x000004d3,
+0x000004d5,0x000004d7,0x000004d9,0x0004003d,
+0x0000000f,0x000004de,0x0000003a,0x0003003e,
+0x000004dd,0x000004de,0x0004003d,0x00000008,
+0x000004e0,0x0000003b,0x0003003e,0x000004df,
+0x000004e0,0x0004003d,0x00000006,0x000004e2,
+0x0000003c,0x0003003e,0x000004e1,0x000004e2,
+0x00050041,0x00000007,0x000004e4,0x000004ba,
+0x000000b5,0x0004003d,0x00000006,0x000004e5,
+0x000004e4,0x0003003e,0x000004e3,0x000004e5,
+0x00080039,0x00000006,0x000004e6,0x00000037,
+0x000004dd,0x000004df,0x000004e1,0x000004e3,
+0x0004003d,0x0000000f,0x000004e8,0x0000003a,
+0x0003003e,0x000004e7,0x000004e8,0x0004003d,
+0x00000008,0x000004ea,0x0000003b,0x0003003e,
+0x000004e9,0x000004ea,0x0004003d,0x00000006,
+0x000004ec,0x0000003c,0x0003003e,0x000004eb,
+0x000004ec,0x00050041,0x00000007,0x000004ee,
+0x000004ba,0x000000b9,0x0004003d,0x00000006,
+0x000004ef,0x000004ee,0x0003003e,0x000004ed,
+0x000004ef,0x00080039,0x00000006,0x000004f0,
+0x00000037,0x000004e7,0x000004e9,0x000004eb,
+0x000004ed,0x00070050,0x0000000f,0x000004f1,
+0x000004d2,0x000004dc,0x000004e6,0x000004f0,
+0x0003003e,0x000004c8,0x000004f1,0x00050041,
+0x00000007,0x000004f3,0x00000041,0x000000c0,
+0x0004003d,0x00000006,0x000004f4,0x000004f3,
+0x00050041,0x00000007,0x000004f5,0x00000041,
+0x000000c3,0x0004003d,0x00000006,0x000004f6,
+0x000004f5,0x00050084,0x00000006,0x000004f7,
+0x000004f4,0x000004f6,0x00050080,0x00000006,
+0x000004f8,0x000004f7,0x000000b0,0x000500c2,
+0x00000006,0x000004f9,0x000004f8,0x000000ed,
+0x0003003e,0x000004f2,0x000004f9,0x00050041,
+0x00000007,0x000004fb,0x00000041,0x000000c0,
+0x0004003d,0x00000006,0x000004fc,0x000004fb,
+0x00050082,0x00000006,0x000004fd,0x00000171,
+0x000004fc,0x00050041,0x00000007,0x000004fe,
+0x00000041,0x000000c3,0x0004003d,0x00000006,
+0x000004ff,0x000004fe,0x00050082,0x00000006,
+0x00000500,0x000004fd,0x000004ff,0x0004003d,
+0x00000006,0x00000501,0x000004f2,0x00050080,
+0x00000006,0x00000502,0x00000500,0x00000501,
+0x00050041,0x00000007,0x00000503,0x00000041,
+0x000000c0,0x0004003d,0x00000006,0x00000504,
+0x00000503,0x0004003d,0x00000006,0x00000505,
+0x000004f2,0x00050082,0x00000006,0x00000506,
+0x00000504,0x00000505,0x00050041,0x00000007,
+0x00000507,0x00000041,0x000000c3,0x0004003d,
+0x00000006,0x00000508,0x00000507,0x0004003d,
+0x00000006,0x00000509,0x000004f2,0x00050082,
+0x00000006,0x0000050a,0x00000508,0x00000509,
+0x0004003d,0x00000006,0x0000050b,0x000004f2,
+0x00070050,0x0000000f,0x0000050c,0x00000502,
+0x00000506,0x0000050a,0x0000050b,0x0003003e,
+0x000004fa,0x0000050c,0x0004003d,0x0000000f,
+0x0000050d,0x000004c8,0x00040070,0x0000050e,
+0x0000050f,0x0000050d,0x0004003d,0x0000000f,
+0x00000510,0x000004fa,0x00040070,0x0000050e,
+0x00000511,0x00000510,0x00050094,0x0000008c,
+0x00000512,0x0000050f,0x00000511,0x00050081,
+0x0000008c,0x00000514,0x00000512,0x00000513,
+0x0004006d,0x00000006,0x00000515,0x00000514,
+0x000500c2,0x00000006,0x00000516,0x00000515,
+0x000000ed,0x000200fe,0x00000516,0x00010038,
+0x00050036,0x00000011,0x00000047,0x00000000,
+0x00000044,0x00030037,0x00000010,0x00000045,
+0x00030037,0x00000011,0x00000046,0x000200f8,
+0x00000048,0x0004003b,0x00000012,0x00000519,
+0x00000007,0x0004003b,0x00000012,0x00000524,
+0x00000007,0x0004003b,0x00000012,0x00000527,
+0x00000007,0x0004003b,0x00000012,0x00000532,
+0x00000007,0x0004003b,0x00000012,0x00000536,
+0x00000007,0x0004003b,0x00000007,0x0000053b,
+0x00000007,0x0004003b,0x00000007,0x0000053e,
+0x00000007,0x0004003b,0x00000012,0x00000546,
+0x00000007,0x0004003b,0x00000010,0x0000054c,
+0x00000007,0x0004003b,0x00000009,0x0000054e,
+0x00000007,0x0004003b,0x00000007,0x00000550,
+0x00000007,0x0004003b,0x00000007,0x00000552,
+0x00000007,0x0004003b,0x00000007,0x00000554,
+0x00000007,0x0004003b,0x00000007,0x00000556,
+0x00000007,0x0004003b,0x00000007,0x00000557,
+0x00000007,0x0004003b,0x00000012,0x00000558,
+0x00000007,0x0004003b,0x00000010,0x0000055f,
+0x00000007,0x0004003b,0x00000009,0x00000561,
+0x00000007,0x0004003b,0x00000007,0x00000563,
+0x00000007,0x0004003b,0x00000007,0x00000565,
+0x00000007,0x0004003b,0x00000007,0x00000567,
+0x00000007,0x0004003b,0x00000007,0x00000569,
+0x00000007,0x0004003b,0x00000007,0x0000056a,
+0x00000007,0x0004003b,0x00000012,0x0000056b,
+0x00000007,0x0004003d,0x00000011,0x0000051b,
+0x000000ce,0x00050050,0x00000011,0x0000051c,
+0x000000b5,0x000000b5,0x00050086,0x00000011,
+0x0000051d,0x0000051b,0x0000051c,0x00050050,
+0x00000011,0x0000051e,0x0000051a,0x0000051a,
+0x00050080,0x00000011,0x0000051f,0x0000051e,
+0x0000051d,0x0004003d,0x00000011,0x00000520,
+0x000000ce,0x00050050,0x00000011,0x00000521,
+0x000000c3,0x000000c3,0x00050082,0x00000011,
+0x00000522,0x00000520,0x00000521,0x00050086,
+0x00000011,0x00000523,0x0000051f,0x00000522,
+0x0003003e,0x00000519,0x00000523,0x0004003d,
+0x00000011,0x00000525,0x00000519,0x00050084,
+0x00000011,0x00000526,0x00000046,0x00000525,
+0x0003003e,0x00000524,0x00000526,0x0004003d,
+0x00000011,0x00000528,0x00000524,0x0004003d,
+0x00000011,0x00000529,0x00000114,0x00050050,
+0x00000011,0x0000052a,0x000000c3,0x000000c3,
+0x00050082,0x00000011,0x0000052b,0x00000529,
+0x0000052a,0x00050084,0x00000011,0x0000052c,
+0x00000528,0x0000052b,0x00050050,0x00000011,
+0x0000052d,0x000001c4,0x000001c4,0x00050080,
+0x00000011,0x0000052e,0x0000052c,0x0000052d,
+0x00050050,0x00000082,0x00000530,0x0000052f,
+0x0000052f,0x000500c2,0x00000011,0x00000531,
+0x0000052e,0x00000530,0x0003003e,0x00000527,
+0x00000531,0x0004003d,0x00000011,0x00000533,
+0x00000527,0x00050050,0x00000082,0x00000534,
+0x000000ed,0x000000ed,0x000500c2,0x00000011,
+0x00000535,0x00000533,0x00000534,0x0003003e,
+0x00000532,0x00000535,0x0004003d,0x00000011,
+0x00000537,0x00000527,0x00050050,0x00000011,
+0x00000539,0x00000538,0x00000538,0x000500c7,
+0x00000011,0x0000053a,0x00000537,0x00000539,
+0x0003003e,0x00000536,0x0000053a,0x00050041,
+0x000000d5,0x0000053c,0x00000114,0x000000c0,
+0x0004003d,0x00000006,0x0000053d,0x0000053c,
+0x0003003e,0x0000053b,0x0000053d,0x00050041,
+0x00000007,0x0000053f,0x00000532,0x000000c3,
+0x0004003d,0x00000006,0x00000540,0x0000053f,
+0x0004003d,0x00000006,0x00000541,0x0000053b,
+0x00050084,0x00000006,0x00000542,0x00000540,
+0x00000541,0x00050041,0x00000007,0x00000543,
+0x00000532,0x000000c0,0x0004003d,0x00000006,
+0x00000544,0x00000543,0x00050080,0x00000006,
+0x00000545,0x00000542,0x00000544,0x0003003e,
+0x0000053e,0x00000545,0x0003003e,0x00000546,
+0x00000547,0x0004003d,0x000000d0,0x00000548,
+0x000000ff,0x000600a9,0x00000059,0x00000549,
+0x00000548,0x000000ee,0x000000e3,0x000500c4,
+0x00000059,0x0000054a,0x000000ee,0x00000549,
+0x0004007c,0x00000006,0x0000054b,0x0000054a,
+0x0004003d,0x0000000f,0x0000054d,0x00000045,
+0x0003003e,0x0000054c,0x0000054d,0x0004003d,
+0x00000008,0x0000054f,0x00000170,0x0003003e,
+0x0000054e,0x0000054f,0x0004003d,0x00000006,
+0x00000551,0x0000018a,0x0003003e,0x00000550,
+0x00000551,0x0004003d,0x00000006,0x00000553,
+0x0000053e,0x0003003e,0x00000552,0x00000553,
+0x0004003d,0x00000006,0x00000555,0x0000053b,
+0x0003003e,0x00000554,0x00000555,0x0003003e,
+0x00000556,0x0000054b,0x0003003e,0x00000557,
+0x000000c0,0x0004003d,0x00000011,0x00000559,
+0x00000536,0x0003003e,0x00000558,0x00000559,
+0x000c0039,0x00000006,0x0000055a,0x00000042,
+0x0000054c,0x0000054e,0x00000550,0x00000552,
+0x00000554,0x00000556,0x00000557,0x00000558,
+0x00050041,0x00000007,0x0000055b,0x00000546,
+0x000000c0,0x0003003e,0x0000055b,0x0000055a,
+0x0004003d,0x000000d0,0x0000055c,0x000000ff,
+0x000300f7,0x0000055e,0x00000000,0x000400fa,
+0x0000055c,0x0000055d,0x0000055e,0x000200f8,
+0x0000055d,0x0004003d,0x0000000f,0x00000560,
+0x00000045,0x0003003e,0x0000055f,0x00000560,
+0x0004003d,0x00000008,0x00000562,0x00000170,
+0x0003003e,0x00000561,0x00000562,0x0004003d,
+0x00000006,0x00000564,0x0000018a,0x0003003e,
+0x00000563,0x00000564,0x0004003d,0x00000006,
+0x00000566,0x0000053e,0x0003003e,0x00000565,
+0x00000566,0x0004003d,0x00000006,0x00000568,
+0x0000053b,0x0003003e,0x00000567,0x00000568,
+0x0003003e,0x00000569,0x000000b5,0x0003003e,
+0x0000056a,0x000000c3,0x0004003d,0x00000011,
+0x0000056c,0x00000536,0x0003003e,0x0000056b,
+0x0000056c,0x000c0039,0x00000006,0x0000056d,
+0x00000042,0x0000055f,0x00000561,0x00000563,
+0x00000565,0x00000567,0x00000569,0x0000056a,
+0x0000056b,0x00050041,0x00000007,0x0000056e,
+0x00000546,0x000000c3,0x0003003e,0x0000056e,
+0x0000056d,0x000200f9,0x0000055e,0x000200f8,
+0x0000055e,0x0004003d,0x00000011,0x0000056f,
+0x00000546,0x000200fe,0x0000056f,0x00010038,
+0x00050036,0x00000006,0x0000004b,0x00000000,
+0x00000049,0x00030037,0x00000007,0x0000004a,
+0x000200f8,0x0000004c,0x0004003d,0x00000006,
+0x00000572,0x0000004a,0x000500c2,0x00000006,
+0x00000574,0x00000572,0x00000573,0x0004003d,
+0x00000006,0x00000575,0x0000004a,0x000500c6,
+0x00000006,0x00000576,0x00000575,0x00000574,
+0x0003003e,0x0000004a,0x00000576,0x0004003d,
+0x00000006,0x00000577,0x0000004a,0x000500c4,
+0x00000006,0x00000579,0x00000577,0x00000578,
+0x0004003d,0x00000006,0x0000057a,0x0000004a,
+0x00050082,0x00000006,0x0000057b,0x0000057a,
+0x00000579,0x0003003e,0x0000004a,0x0000057b,
+0x0004003d,0x00000006,0x0000057c,0x0000004a,
+0x000500c4,0x00000006,0x0000057d,0x0000057c,
+0x000000f8,0x0004003d,0x00000006,0x0000057e,
+0x0000004a,0x00050080,0x00000006,0x0000057f,
+0x0000057e,0x0000057d,0x0003003e,0x0000004a,
+0x0000057f,0x0004003d,0x00000006,0x00000580,
+0x0000004a,0x000500c4,0x00000006,0x00000581,
+0x00000580,0x000000ed,0x0004003d,0x00000006,
+0x00000582,0x0000004a,0x00050080,0x00000006,
+0x00000583,0x00000582,0x00000581,0x0003003e,
+0x0000004a,0x00000583,0x0004003d,0x00000006,
+0x00000584,0x0000004a,0x000500c2,0x00000006,
+0x00000585,0x00000584,0x000000f3,0x0004003d,
+0x00000006,0x00000586,0x0000004a,0x000500c6,
+0x00000006,0x00000587,0x00000586,0x00000585,
+0x0003003e,0x0000004a,0x00000587,0x0004003d,
+0x00000006,0x00000588,0x0000004a,0x000500c4,
+0x00000006,0x0000058a,0x00000588,0x00000589,
+0x0004003d,0x00000006,0x0000058b,0x0000004a,
+0x00050080,0x00000006,0x0000058c,0x0000058b,
+0x0000058a,0x0003003e,0x0000004a,0x0000058c,
+0x0004003d,0x00000006,0x0000058d,0x0000004a,
+0x000500c2,0x00000006,0x0000058e,0x0000058d,
+0x000000f8,0x0004003d,0x00000006,0x0000058f,
+0x0000004a,0x000500c6,0x00000006,0x00000590,
+0x0000058f,0x0000058e,0x0003003e,0x0000004a,
+0x00000590,0x0004003d,0x00000006,0x00000591,
+0x0000004a,0x000500c2,0x00000006,0x00000592,
+0x00000591,0x00000182,0x0004003d,0x00000006,
+0x00000593,0x0000004a,0x000500c6,0x00000006,
+0x00000594,0x00000593,0x00000592,0x0003003e,
+0x0000004a,0x00000594,0x0004003d,0x00000006,
+0x00000595,0x0000004a,0x000500c4,0x00000006,
+0x00000596,0x00000595,0x0000052f,0x0004003d,
+0x00000006,0x00000597,0x0000004a,0x000500c6,
+0x00000006,0x00000598,0x00000597,0x00000596,
+0x0003003e,0x0000004a,0x00000598,0x0004003d,
+0x00000006,0x00000599,0x0000004a,0x000500c2,
+0x00000006,0x0000059a,0x00000599,0x00000578,
+0x0004003d,0x00000006,0x0000059b,0x0000004a,
+0x000500c6,0x00000006,0x0000059c,0x0000059b,
+0x0000059a,0x0003003e,0x0000004a,0x0000059c,
+0x0004003d,0x00000006,0x0000059d,0x0000004a,
+0x000200fe,0x0000059d,0x00010038,0x00050036,
+0x00000006,0x00000051,0x00000000,0x0000004d,
+0x00030037,0x00000007,0x0000004e,0x00030037,
+0x00000012,0x0000004f,0x00030037,0x00000007,
+0x00000050,0x000200f8,0x00000052,0x0004003b,
+0x00000007,0x000005b5,0x00000007,0x0004003b,
+0x00000007,0x000005b6,0x00000007,0x0004003b,
+0x00000010,0x000005b9,0x00000007,0x0004003b,
+0x00000010,0x000005c5,0x00000007,0x0004003b,
+0x00000012,0x000005d8,0x00000007,0x0004003b,
+0x00000010,0x000005e3,0x00000007,0x0004003b,
+0x00000010,0x000005e7,0x00000007,0x0004003b,
+0x00000010,0x000005f6,0x00000007,0x0004003d,
+0x00000006,0x000005a0,0x00000050,0x000500aa,
+0x000000d0,0x000005a1,0x000005a0,0x000000c3,
+0x000300f7,0x000005a3,0x00000000,0x000400fa,
+0x000005a1,0x000005a2,0x000005a3,0x000200f8,
+0x000005a2,0x000200fe,0x000000c0,0x000200f8,
+0x000005a3,0x00050041,0x000000d5,0x000005a5,
+0x000000ce,0x000000c0,0x0004003d,0x00000006,
+0x000005a6,0x000005a5,0x00050041,0x000000d5,
+0x000005a7,0x000000ce,0x000000c3,0x0004003d,
+0x00000006,0x000005a8,0x000005a7,0x00050084,
+0x00000006,0x000005a9,0x000005a6,0x000005a8,
+0x000500b0,0x000000d0,0x000005aa,0x000005a9,
+0x000001d0,0x000300f7,0x000005ac,0x00000000,
+0x000400fa,0x000005aa,0x000005ab,0x000005ac,
+0x000200f8,0x000005ab,0x0004003d,0x00000011,
+0x000005ad,0x0000004f,0x00050050,0x00000082,
+0x000005ae,0x000000ee,0x000000ee,0x000500c4,
+0x00000011,0x000005af,0x000005ad,0x000005ae,
+0x0003003e,0x0000004f,0x000005af,0x000200f9,
+0x000005ac,0x000200f8,0x000005ac,0x0004003d,
+0x00000006,0x000005b0,0x00000050,0x00050084,
+0x00000006,0x000005b1,0x0000051a,0x000005b0,
+0x0004003d,0x00000006,0x000005b2,0x0000004e,
+0x00050082,0x00000006,0x000005b3,0x000005b2,
+0x0000051a,0x00050080,0x00000006,0x000005b4,
+0x000005b1,0x000005b3,0x0003003e,0x0000004e,
+0x000005b4,0x0004003d,0x00000006,0x000005b7,
+0x0000004e,0x0003003e,0x000005b6,0x000005b7,
+0x00050039,0x00000006,0x000005b8,0x0000004b,
+0x000005b6,0x0003003e,0x000005b5,0x000005b8,
+0x0004003d,0x00000006,0x000005ba,0x000005b5,
+0x000600cb,0x00000006,0x000005bb,0x000005ba,
+0x000000e3,0x000000ed,0x0004003d,0x00000006,
+0x000005bc,0x000005b5,0x000600cb,0x00000006,
+0x000005bd,0x000005bc,0x000000ed,0x000000ed,
+0x0004003d,0x00000006,0x000005be,0x000005b5,
+0x000600cb,0x00000006,0x000005c0,0x000005be,
+0x000005bf,0x000000ed,0x0004003d,0x00000006,
+0x000005c1,0x000005b5,0x000600cb,0x00000006,
+0x000005c3,0x000005c1,0x000005c2,0x000000ed,
+0x00070050,0x0000000f,0x000005c4,0x000005bb,
+0x000005bd,0x000005c0,0x000005c3,0x0003003e,
+0x000005b9,0x000005c4,0x0004003d,0x00000006,
+0x000005c6,0x000005b5,0x000600cb,0x00000006,
+0x000005c7,0x000005c6,0x00000589,0x000000ed,
+0x0004003d,0x00000006,0x000005c8,0x000005b5,
+0x000600cb,0x00000006,0x000005ca,0x000005c8,
+0x000005c9,0x000000ed,0x0004003d,0x00000006,
+0x000005cb,0x000005b5,0x000600cb,0x00000006,
+0x000005cd,0x000005cb,0x000005cc,0x000000ed,
+0x0004003d,0x00000006,0x000005ce,0x000005b5,
+0x000600cb,0x00000006,0x000005d0,0x000005ce,
+0x000005cf,0x000000ed,0x00070050,0x0000000f,
+0x000005d1,0x000005c7,0x000005ca,0x000005cd,
+0x000005d0,0x0003003e,0x000005c5,0x000005d1,
+0x0004003d,0x0000000f,0x000005d2,0x000005b9,
+0x0004003d,0x0000000f,0x000005d3,0x000005b9,
+0x00050084,0x0000000f,0x000005d4,0x000005d2,
+0x000005d3,0x0003003e,0x000005b9,0x000005d4,
+0x0004003d,0x0000000f,0x000005d5,0x000005c5,
+0x0004003d,0x0000000f,0x000005d6,0x000005c5,
+0x00050084,0x0000000f,0x000005d7,0x000005d5,
+0x000005d6,0x0003003e,0x000005c5,0x000005d7,
+0x0004003d,0x00000006,0x000005d9,0x0000004e,
+0x000500c7,0x00000006,0x000005da,0x000005d9,
+0x000000b5,0x000500ab,0x000000d0,0x000005db,
+0x000005da,0x000000c0,0x000600a9,0x00000059,
+0x000005dc,0x000005db,0x000000ed,0x000000f3,
+0x0004007c,0x00000006,0x000005dd,0x000005dc,
+0x0004003d,0x00000006,0x000005de,0x00000050,
+0x000500aa,0x000000d0,0x000005df,0x000005de,
+0x000000b9,0x000600a9,0x00000059,0x000005e0,
+0x000005df,0x0000052f,0x000000f3,0x0004007c,
+0x00000006,0x000005e1,0x000005e0,0x00050050,
+0x00000011,0x000005e2,0x000005dd,0x000005e1,
+0x0003003e,0x000005d8,0x000005e2,0x0004003d,
+0x00000006,0x000005e4,0x0000004e,0x000500c7,
+0x00000006,0x000005e5,0x000005e4,0x000000c3,
+0x000500ab,0x000000d0,0x000005e6,0x000005e5,
+0x000000c0,0x000300f7,0x000005e9,0x00000000,
+0x000400fa,0x000005e6,0x000005e8,0x000005ec,
+0x000200f8,0x000005e8,0x0004003d,0x00000011,
+0x000005ea,0x000005d8,0x0009004f,0x0000000f,
+0x000005eb,0x000005ea,0x000005ea,0x00000000,
+0x00000001,0x00000000,0x00000001,0x0003003e,
+0x000005e7,0x000005eb,0x000200f9,0x000005e9,
+0x000200f8,0x000005ec,0x0004003d,0x00000011,
+0x000005ed,0x000005d8,0x0009004f,0x0000000f,
+0x000005ee,0x000005ed,0x000005ed,0x00000001,
+0x00000000,0x00000001,0x00000000,0x0003003e,
+0x000005e7,0x000005ee,0x000200f9,0x000005e9,
+0x000200f8,0x000005e9,0x0004003d,0x0000000f,
+0x000005ef,0x000005e7,0x0003003e,0x000005e3,
+0x000005ef,0x0004003d,0x0000000f,0x000005f0,
+0x000005e3,0x0004003d,0x0000000f,0x000005f1,
+0x000005b9,0x000500c2,0x0000000f,0x000005f2,
+0x000005f1,0x000005f0,0x0003003e,0x000005b9,
+0x000005f2,0x0004003d,0x0000000f,0x000005f3,
+0x000005e3,0x0004003d,0x0000000f,0x000005f4,
+0x000005c5,0x000500c2,0x0000000f,0x000005f5,
+0x000005f4,0x000005f3,0x0003003e,0x000005c5,
+0x000005f5,0x0004003d,0x0000000f,0x000005f7,
+0x000005b9,0x0007004f,0x00000011,0x000005f8,
+0x000005f7,0x000005f7,0x00000000,0x00000001,
+0x00040070,0x000005f9,0x000005fa,0x000005f8,
+0x0004003d,0x00000011,0x000005fb,0x0000004f,
+0x00040070,0x000005f9,0x000005fc,0x000005fb,
+0x00050094,0x0000008c,0x000005fd,0x000005fa,
+0x000005fc,0x0004006d,0x00000006,0x000005fe,
+0x000005fd,0x0004003d,0x0000000f,0x000005ff,
+0x000005b9,0x0007004f,0x00000011,0x00000600,
+0x000005ff,0x000005ff,0x00000002,0x00000003,
+0x00040070,0x000005f9,0x00000601,0x00000600,
+0x0004003d,0x00000011,0x00000602,0x0000004f,
+0x00040070,0x000005f9,0x00000603,0x00000602,
+0x00050094,0x0000008c,0x00000604,0x00000601,
+0x00000603,0x0004006d,0x00000006,0x00000605,
+0x00000604,0x0004003d,0x0000000f,0x00000606,
+0x000005c5,0x0007004f,0x00000011,0x00000607,
+0x00000606,0x00000606,0x00000000,0x00000001,
+0x00040070,0x000005f9,0x00000608,0x00000607,
+0x0004003d,0x00000011,0x00000609,0x0000004f,
+0x00040070,0x000005f9,0x0000060a,0x00000609,
+0x00050094,0x0000008c,0x0000060b,0x00000608,
+0x0000060a,0x0004006d,0x00000006,0x0000060c,
+0x0000060b,0x0004003d,0x0000000f,0x0000060d,
+0x000005c5,0x0007004f,0x00000011,0x0000060e,
+0x0000060d,0x0000060d,0x00000002,0x00000003,
+0x00040070,0x000005f9,0x0000060f,0x0000060e,
+0x0004003d,0x00000011,0x00000610,0x0000004f,
+0x00040070,0x000005f9,0x00000611,0x00000610,
+0x00050094,0x0000008c,0x00000612,0x0000060f,
+0x00000611,0x0004006d,0x00000006,0x00000613,
+0x00000612,0x00070050,0x0000000f,0x00000614,
+0x000005fe,0x00000605,0x0000060c,0x00000613,
+0x0004003d,0x00000006,0x00000615,0x000005b5,
+0x00070050,0x0000000f,0x00000616,0x00000615,
+0x00000615,0x00000615,0x00000615,0x000500c2,
+0x0000000f,0x00000618,0x00000616,0x00000617,
+0x00050080,0x0000000f,0x00000619,0x00000614,
+0x00000618,0x0003003e,0x000005f6,0x00000619,
+0x0004003d,0x0000000f,0x0000061b,0x000005f6,
+0x000500c7,0x0000000f,0x0000061c,0x0000061b,
+0x0000061a,0x0003003e,0x000005f6,0x0000061c,
+0x0004003d,0x00000006,0x0000061d,0x00000050,
+0x000500aa,0x000000d0,0x0000061e,0x0000061d,
+0x000000b5,0x000300f7,0x00000620,0x00000000,
+0x000400fa,0x0000061e,0x0000061f,0x00000625,
+0x000200f8,0x0000061f,0x00050041,0x00000007,
+0x00000621,0x000005f6,0x000000b5,0x00050051,
+0x00000006,0x00000622,0x00000547,0x00000000,
+0x0003003e,0x00000621,0x00000622,0x00050041,
+0x00000007,0x00000623,0x000005f6,0x000000b9,
+0x00050051,0x00000006,0x00000624,0x00000547,
+0x00000001,0x0003003e,0x00000623,0x00000624,
+0x000200f9,0x00000620,0x000200f8,0x00000625,
+0x0004003d,0x00000006,0x00000626,0x00000050,
+0x000500aa,0x000000d0,0x00000627,0x00000626,
+0x000000b9,0x000300f7,0x00000629,0x00000000,
+0x000400fa,0x00000627,0x00000628,0x00000629,
+0x000200f8,0x00000628,0x00050041,0x00000007,
+0x0000062a,0x000005f6,0x000000b9,0x0003003e,
+0x0000062a,0x000000c0,0x000200f9,0x00000629,
+0x000200f8,0x00000629,0x000200f9,0x00000620,
+0x000200f8,0x00000620,0x00050041,0x00000007,
+0x0000062b,0x000005f6,0x000000c0,0x0004003d,
+0x00000006,0x0000062c,0x0000062b,0x00060050,
+0x00000008,0x0000062d,0x0000062c,0x0000062c,
+0x0000062c,0x0004003d,0x0000000f,0x0000062e,
+0x000005f6,0x0008004f,0x00000008,0x0000062f,
+0x0000062e,0x0000062e,0x00000001,0x00000002,
+0x00000003,0x000500ae,0x00000630,0x00000631,
+0x0000062d,0x0000062f,0x0004009b,0x000000d0,
+0x00000632,0x00000631,0x000300f7,0x00000634,
+0x00000000,0x000400fa,0x00000632,0x00000633,
+0x00000636,0x000200f8,0x00000633,0x000200fe,
+0x000000c0,0x000200f8,0x00000636,0x00050041,
+0x00000007,0x00000637,0x000005f6,0x000000c3,
+0x0004003d,0x00000006,0x00000638,0x00000637,
+0x00050050,0x00000011,0x00000639,0x00000638,
+0x00000638,0x0004003d,0x0000000f,0x0000063a,
+0x000005f6,0x0007004f,0x00000011,0x0000063b,
+0x0000063a,0x0000063a,0x00000002,0x00000003,
+0x000500ae,0x00000169,0x0000063c,0x00000639,
+0x0000063b,0x0004009b,0x000000d0,0x0000063d,
+0x0000063c,0x000300f7,0x0000063f,0x00000000,
+0x000400fa,0x0000063d,0x0000063e,0x00000641,
+0x000200f8,0x0000063e,0x000200fe,0x000000c3,
+0x000200f8,0x00000641,0x00050041,0x00000007,
+0x00000642,0x000005f6,0x000000b5,0x0004003d,
+0x00000006,0x00000643,0x00000642,0x00050041,
+0x00000007,0x00000644,0x000005f6,0x000000b9,
+0x0004003d,0x00000006,0x00000645,0x00000644,
+0x000500ae,0x000000d0,0x00000646,0x00000643,
+0x00000645,0x000300f7,0x00000648,0x00000000,
+0x000400fa,0x00000646,0x00000647,0x0000064a,
+0x000200f8,0x00000647,0x000200fe,0x000000b5,
+0x000200f8,0x0000064a,0x000200fe,0x000000b9,
+0x000200f8,0x00000648,0x000100ff,0x000200f8,
+0x0000063f,0x000100ff,0x000200f8,0x00000634,
+0x000100ff,0x00010038,0x00050036,0x00000008,
+0x00000057,0x00000000,0x00000053,0x00030037,
+0x00000007,0x00000054,0x00030037,0x00000007,
+0x00000055,0x00030037,0x00000007,0x00000056,
+0x000200f8,0x00000058,0x0004003b,0x00000007,
+0x0000064d,0x00000007,0x0004003b,0x00000009,
+0x00000655,0x00000007,0x0004003b,0x00000662,
+0x00000663,0x00000007,0x0004003b,0x00000007,
+0x00000666,0x00000007,0x0004003b,0x00000009,
+0x00000668,0x00000007,0x0003003e,0x0000064d,
+0x000000c0,0x000200f9,0x0000064e,0x000200f8,
+0x0000064e,0x000400f6,0x00000650,0x00000651,
+0x00000000,0x000200f9,0x00000652,0x000200f8,
+0x00000652,0x0004003d,0x00000006,0x00000653,
+0x0000064d,0x000500b0,0x000000d0,0x00000654,
+0x00000653,0x000003e0,0x000400fa,0x00000654,
+0x0000064f,0x00000650,0x000200f8,0x0000064f,
+0x0004003d,0x00000006,0x00000661,0x0000064d,
+0x0003003e,0x00000663,0x00000660,0x00050041,
+0x00000009,0x00000664,0x00000663,0x00000661,
+0x0004003d,0x00000008,0x00000665,0x00000664,
+0x0003003e,0x00000655,0x00000665,0x0004003d,
+0x00000006,0x00000667,0x00000055,0x0003003e,
+0x00000666,0x00000667,0x0004003d,0x00000008,
+0x00000669,0x00000655,0x0003003e,0x00000668,
+0x00000669,0x00060039,0x00000006,0x0000066a,
+0x0000000d,0x00000666,0x00000668,0x0003003e,
+0x00000056,0x0000066a,0x0004003d,0x00000006,
+0x0000066b,0x00000056,0x0004003d,0x00000006,
+0x0000066c,0x00000054,0x000500b2,0x000000d0,
+0x0000066d,0x0000066b,0x0000066c,0x000300f7,
+0x0000066f,0x00000000,0x000400fa,0x0000066d,
+0x0000066e,0x0000066f,0x000200f8,0x0000066e,
+0x0004003d,0x00000008,0x00000670,0x00000655,
+0x000200fe,0x00000670,0x000200f8,0x0000066f,
+0x000200f9,0x00000651,0x000200f8,0x00000651,
+0x0004003d,0x00000006,0x00000672,0x0000064d,
+0x00050080,0x00000006,0x00000673,0x00000672,
+0x000000ee,0x0003003e,0x0000064d,0x00000673,
+0x000200f9,0x0000064e,0x000200f8,0x00000650,
+0x000200fe,0x00000173,0x00010038,0x00050036,
+0x0000005a,0x0000005e,0x00000000,0x0000005c,
+0x00030037,0x0000005b,0x0000005d,0x000200f8,
+0x0000005f,0x00050041,0x00000270,0x00000676,
+0x0000005d,0x000000c0,0x0004003d,0x00000059,
+0x00000677,0x00000676,0x00050041,0x00000270,
+0x00000678,0x0000005d,0x000000b5,0x0004003d,
+0x00000059,0x00000679,0x00000678,0x00050080,
+0x00000059,0x0000067a,0x00000677,0x00000679,
+0x000500c3,0x00000059,0x0000067b,0x0000067a,
+0x000000ee,0x00050041,0x00000270,0x0000067c,
+0x0000005d,0x000000c3,0x0004003d,0x00000059,
+0x0000067d,0x0000067c,0x00050041,0x00000270,
+0x0000067e,0x0000005d,0x000000b5,0x0004003d,
+0x00000059,0x0000067f,0x0000067e,0x00050080,
+0x00000059,0x00000680,0x0000067d,0x0000067f,
+0x000500c3,0x00000059,0x00000681,0x00000680,
+0x000000ee,0x0004003d,0x0000005a,0x00000682,
+0x0000005d,0x0007004f,0x00000082,0x00000683,
+0x00000682,0x00000682,0x00000002,0x00000003,
+0x00050051,0x00000059,0x00000684,0x00000683,
+0x00000000,0x00050051,0x00000059,0x00000685,
+0x00000683,0x00000001,0x00070050,0x0000005a,
+0x00000686,0x0000067b,0x00000681,0x00000684,
+0x00000685,0x000200fe,0x00000686,0x00010038,
+0x00050036,0x00000059,0x00000064,0x00000000,
+0x00000062,0x00030037,0x00000061,0x00000063,
+0x000200f8,0x00000065,0x00050041,0x00000270,
+0x00000689,0x00000063,0x000000c0,0x0004003d,
+0x00000059,0x0000068a,0x00000689,0x00050041,
+0x00000270,0x0000068b,0x00000063,0x000000c3,
+0x0004003d,0x00000059,0x0000068c,0x0000068b,
+0x00050080,0x00000059,0x0000068d,0x0000068a,
+0x0000068c,0x00050041,0x00000270,0x0000068e,
+0x00000063,0x000000b5,0x0004003d,0x00000059,
+0x0000068f,0x0000068e,0x00050080,0x00000059,
+0x00000690,0x0000068d,0x0000068f,0x000200fe,
+0x00000690,0x00010038,0x00050036,0x00000002,
+0x00000069,0x00000000,0x00000066,0x00030037,
+0x0000005b,0x00000067,0x00030037,0x0000005b,
+0x00000068,0x000200f8,0x0000006a,0x0004003d,
+0x0000005a,0x00000693,0x00000068,0x00070050,
+0x0000005a,0x00000694,0x000000ee,0x000000ee,
+0x000000ee,0x000000ee,0x000500c3,0x0000005a,
+0x00000695,0x00000693,0x00000694,0x0003003e,
+0x00000068,0x00000695,0x0004003d,0x0000005a,
+0x00000696,0x00000067,0x00070050,0x0000005a,
+0x00000698,0x00000697,0x00000697,0x00000697,
+0x00000697,0x000500c7,0x0000005a,0x00000699,
+0x00000696,0x00000698,0x0004003d,0x0000005a,
+0x0000069a,0x00000068,0x000500c5,0x0000005a,
+0x0000069b,0x0000069a,0x00000699,0x0003003e,
+0x00000068,0x0000069b,0x0004003d,0x0000005a,
+0x0000069c,0x00000067,0x00070050,0x0000005a,
+0x0000069d,0x000000ee,0x000000ee,0x000000ee,
+0x000000ee,0x000500c3,0x0000005a,0x0000069e,
+0x0000069c,0x0000069d,0x0003003e,0x00000067,
+0x0000069e,0x0004003d,0x0000005a,0x000006a0,
+0x00000067,0x00070050,0x0000005a,0x000006a1,
+0x0000069f,0x0000069f,0x0000069f,0x0000069f,
+0x000500c7,0x0000005a,0x000006a2,0x000006a0,
+0x000006a1,0x0003003e,0x00000067,0x000006a2,
+0x0004003d,0x0000005a,0x000006a3,0x00000067,
+0x000600ca,0x0000005a,0x000006a4,0x000006a3,
+0x000000e3,0x0000052f,0x0003003e,0x00000067,
+0x000006a4,0x000100fd,0x00010038,0x00050036,
+0x00000002,0x00000071,0x00000000,0x0000006b,
+0x00030037,0x0000005b,0x0000006c,0x00030037,
+0x0000005b,0x0000006d,0x00030037,0x00000007,
+0x0000006e,0x00030037,0x00000010,0x0000006f,
+0x00030037,0x00000010,0x00000070,0x000200f8,
+0x00000072,0x0004003b,0x00000270,0x000006c2,
+0x00000007,0x0004003b,0x00000270,0x000006cb,
+0x00000007,0x0004003b,0x0000005b,0x000006e9,
+0x00000007,0x0004003b,0x0000005b,0x000006eb,
+0x00000007,0x0004003b,0x00000061,0x00000738,
+0x00000007,0x0004003b,0x00000061,0x0000073c,
+0x00000007,0x0004003b,0x0000005b,0x00000748,
+0x00000007,0x0004003b,0x0000005b,0x0000074c,
+0x00000007,0x0004003b,0x0000005b,0x00000754,
+0x00000007,0x0004003b,0x0000005b,0x00000756,
+0x00000007,0x0004003b,0x00000061,0x0000075b,
+0x00000007,0x0004003b,0x0000005b,0x00000772,
+0x00000007,0x0004003b,0x0000005b,0x00000778,
+0x00000007,0x0004003d,0x00000006,0x000006a5,
+0x0000006e,0x000300f7,0x000006b1,0x00000000,
+0x001700fb,0x000006a5,0x000006b0,0x00000000,
+0x000006a6,0x00000001,0x000006a7,0x00000004,
+0x000006a8,0x00000005,0x000006a9,0x00000006,
+0x000006aa,0x0000000a,0x000006ab,0x00000008,
+0x000006ac,0x0000000c,0x000006ad,0x00000009,
+0x000006ae,0x0000000d,0x000006af,0x000200f8,
+0x000006b0,0x0003003e,0x0000006f,0x00000780,
+0x0003003e,0x00000070,0x00000780,0x000200f9,
+0x000006b1,0x000200f8,0x000006a6,0x0004003d,
+0x0000005a,0x000006b2,0x0000006c,0x0008004f,
+0x00000060,0x000006b3,0x000006b2,0x000006b2,
+0x00000000,0x00000000,0x00000000,0x0004007c,
+0x00000008,0x000006b4,0x000006b3,0x00050051,
+0x00000006,0x000006b6,0x000006b4,0x00000000,
+0x00050051,0x00000006,0x000006b7,0x000006b4,
+0x00000001,0x00050051,0x00000006,0x000006b8,
+0x000006b4,0x00000002,0x00070050,0x0000000f,
+0x000006b9,0x000006b6,0x000006b7,0x000006b8,
+0x000006b5,0x0003003e,0x0000006f,0x000006b9,
+0x0004003d,0x0000005a,0x000006ba,0x0000006d,
+0x0008004f,0x00000060,0x000006bb,0x000006ba,
+0x000006ba,0x00000000,0x00000000,0x00000000,
+0x0004007c,0x00000008,0x000006bc,0x000006bb,
+0x00050051,0x00000006,0x000006bd,0x000006bc,
+0x00000000,0x00050051,0x00000006,0x000006be,
+0x000006bc,0x00000001,0x00050051,0x00000006,
+0x000006bf,0x000006bc,0x00000002,0x00070050,
+0x0000000f,0x000006c0,0x000006bd,0x000006be,
+0x000006bf,0x000006b5,0x0003003e,0x00000070,
+0x000006c0,0x000100fd,0x000200f8,0x000006a7,
+0x00050041,0x00000270,0x000006c3,0x0000006c,
+0x000000c0,0x0004003d,0x00000059,0x000006c4,
+0x000006c3,0x000500c3,0x00000059,0x000006c5,
+0x000006c4,0x000000e4,0x00050041,0x00000270,
+0x000006c6,0x0000006d,0x000000c0,0x0004003d,
+0x00000059,0x000006c7,0x000006c6,0x000500c7,
+0x00000059,0x000006c9,0x000006c7,0x000006c8,
+0x000500c5,0x00000059,0x000006ca,0x000006c5,
+0x000006c9,0x0003003e,0x000006c2,0x000006ca,
+0x0004003d,0x00000059,0x000006cc,0x000006c2,
+0x00050041,0x00000270,0x000006cd,0x0000006d,
+0x000000c0,0x0004003d,0x00000059,0x000006ce,
+0x000006cd,0x000500c7,0x00000059,0x000006cf,
+0x000006ce,0x0000069f,0x00050080,0x00000059,
+0x000006d0,0x000006cc,0x000006cf,0x0007000c,
+0x00000059,0x000006d2,0x00000001,0x00000027,
+0x000006d0,0x000006d1,0x0003003e,0x000006cb,
+0x000006d2,0x0004003d,0x00000059,0x000006d3,
+0x000006c2,0x0004007c,0x00000006,0x000006d4,
+0x000006d3,0x00060050,0x00000008,0x000006d5,
+0x000006d4,0x000006d4,0x000006d4,0x00050051,
+0x00000006,0x000006d6,0x000006d5,0x00000000,
+0x00050051,0x00000006,0x000006d7,0x000006d5,
+0x00000001,0x00050051,0x00000006,0x000006d8,
+0x000006d5,0x00000002,0x00070050,0x0000000f,
+0x000006d9,0x000006d6,0x000006d7,0x000006d8,
+0x000006b5,0x0003003e,0x0000006f,0x000006d9,
+0x0004003d,0x00000059,0x000006da,0x000006cb,
+0x0004007c,0x00000006,0x000006db,0x000006da,
+0x00060050,0x00000008,0x000006dc,0x000006db,
+0x000006db,0x000006db,0x00050051,0x00000006,
+0x000006dd,0x000006dc,0x00000000,0x00050051,
+0x00000006,0x000006de,0x000006dc,0x00000001,
+0x00050051,0x00000006,0x000006df,0x000006dc,
+0x00000002,0x00070050,0x0000000f,0x000006e0,
+0x000006dd,0x000006de,0x000006df,0x000006b5,
+0x0003003e,0x00000070,0x000006e0,0x000100fd,
+0x000200f8,0x000006a8,0x0004003d,0x0000005a,
+0x000006e2,0x0000006c,0x0009004f,0x0000005a,
+0x000006e3,0x000006e2,0x000006e2,0x00000000,
+0x00000000,0x00000000,0x00000001,0x0004007c,
+0x0000000f,0x000006e4,0x000006e3,0x0003003e,
+0x0000006f,0x000006e4,0x0004003d,0x0000005a,
+0x000006e5,0x0000006d,0x0009004f,0x0000005a,
+0x000006e6,0x000006e5,0x000006e5,0x00000000,
+0x00000000,0x00000000,0x00000001,0x0004007c,
+0x0000000f,0x000006e7,0x000006e6,0x0003003e,
+0x00000070,0x000006e7,0x000100fd,0x000200f8,
+0x000006a9,0x0004003d,0x0000005a,0x000006ea,
+0x0000006d,0x0003003e,0x000006e9,0x000006ea,
+0x0004003d,0x0000005a,0x000006ec,0x0000006c,
+0x0003003e,0x000006eb,0x000006ec,0x00060039,
+0x00000002,0x000006ed,0x00000069,0x000006e9,
+0x000006eb,0x0004003d,0x0000005a,0x000006ee,
+0x000006e9,0x0003003e,0x0000006d,0x000006ee,
+0x0004003d,0x0000005a,0x000006ef,0x000006eb,
+0x0003003e,0x0000006c,0x000006ef,0x0004003d,
+0x0000005a,0x000006f0,0x0000006c,0x0009004f,
+0x0000005a,0x000006f1,0x000006f0,0x000006f0,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x00070050,0x0000005a,0x000006f2,0x000000e3,
+0x000000e3,0x000000e3,0x000000e3,0x00070050,
+0x0000005a,0x000006f3,0x000006d1,0x000006d1,
+0x000006d1,0x000006d1,0x0008000c,0x0000005a,
+0x000006f4,0x00000001,0x0000002d,0x000006f1,
+0x000006f2,0x000006f3,0x0004007c,0x0000000f,
+0x000006f5,0x000006f4,0x0003003e,0x0000006f,
+0x000006f5,0x0004003d,0x0000005a,0x000006f6,
+0x0000006c,0x0009004f,0x0000005a,0x000006f7,
+0x000006f6,0x000006f6,0x00000000,0x00000000,
+0x00000000,0x00000001,0x0004003d,0x0000005a,
+0x000006f8,0x0000006d,0x0009004f,0x0000005a,
+0x000006f9,0x000006f8,0x000006f8,0x00000000,
+0x00000000,0x00000000,0x00000001,0x00050080,
+0x0000005a,0x000006fa,0x000006f7,0x000006f9,
+0x00070050,0x0000005a,0x000006fb,0x000000e3,
+0x000000e3,0x000000e3,0x000000e3,0x00070050,
+0x0000005a,0x000006fc,0x000006d1,0x000006d1,
+0x000006d1,0x000006d1,0x0008000c,0x0000005a,
+0x000006fd,0x00000001,0x0000002d,0x000006fa,
+0x000006fb,0x000006fc,0x0004007c,0x0000000f,
+0x000006fe,0x000006fd,0x0003003e,0x00000070,
+0x000006fe,0x000100fd,0x000200f8,0x000006aa,
+0x00050041,0x00000270,0x00000700,0x0000006c,
+0x000000c0,0x0004003d,0x00000059,0x00000701,
+0x00000700,0x0004007c,0x00000006,0x00000702,
+0x00000701,0x00050041,0x00000270,0x00000703,
+0x0000006d,0x000000c0,0x0004003d,0x00000059,
+0x00000704,0x00000703,0x0004007c,0x00000006,
+0x00000705,0x00000704,0x00050041,0x00000270,
+0x00000706,0x0000006c,0x000000c3,0x0004003d,
+0x00000059,0x00000707,0x00000706,0x0004007c,
+0x00000006,0x00000708,0x00000707,0x00070050,
+0x0000000f,0x00000709,0x00000702,0x00000705,
+0x00000708,0x000006b5,0x0003003e,0x00000070,
+0x00000709,0x0004003d,0x0000000f,0x0000070a,
+0x00000070,0x0008004f,0x00000008,0x0000070b,
+0x0000070a,0x0000070a,0x00000000,0x00000001,
+0x00000002,0x00050041,0x00000270,0x0000070c,
+0x0000006d,0x000000c3,0x0004003d,0x00000059,
+0x0000070d,0x0000070c,0x0004007c,0x00000006,
+0x0000070e,0x0000070d,0x00060050,0x00000008,
+0x0000070f,0x0000070e,0x0000070e,0x0000070e,
+0x00050084,0x00000008,0x00000710,0x0000070b,
+0x0000070f,0x00060050,0x00000060,0x00000711,
+0x000005bf,0x000005bf,0x000005bf,0x000500c2,
+0x00000008,0x00000712,0x00000710,0x00000711,
+0x00050051,0x00000006,0x00000713,0x00000712,
+0x00000000,0x00050051,0x00000006,0x00000714,
+0x00000712,0x00000001,0x00050051,0x00000006,
+0x00000715,0x00000712,0x00000002,0x00070050,
+0x0000000f,0x00000716,0x00000713,0x00000714,
+0x00000715,0x000006b5,0x0003003e,0x0000006f,
+0x00000716,0x000100fd,0x000200f8,0x000006ab,
+0x00050041,0x00000270,0x00000718,0x0000006c,
+0x000000c0,0x0004003d,0x00000059,0x00000719,
+0x00000718,0x0004007c,0x00000006,0x0000071a,
+0x00000719,0x00050041,0x00000270,0x0000071b,
+0x0000006d,0x000000c0,0x0004003d,0x00000059,
+0x0000071c,0x0000071b,0x0004007c,0x00000006,
+0x0000071d,0x0000071c,0x00050041,0x00000270,
+0x0000071e,0x0000006c,0x000000c3,0x0004003d,
+0x00000059,0x0000071f,0x0000071e,0x0004007c,
+0x00000006,0x00000720,0x0000071f,0x00050041,
+0x00000270,0x00000721,0x0000006d,0x000000b5,
+0x0004003d,0x00000059,0x00000722,0x00000721,
+0x0004007c,0x00000006,0x00000723,0x00000722,
+0x00070050,0x0000000f,0x00000724,0x0000071a,
+0x0000071d,0x00000720,0x00000723,0x0003003e,
+0x00000070,0x00000724,0x0004003d,0x0000000f,
+0x00000725,0x00000070,0x0008004f,0x00000008,
+0x00000726,0x00000725,0x00000725,0x00000000,
+0x00000001,0x00000002,0x00050041,0x00000270,
+0x00000727,0x0000006d,0x000000c3,0x0004003d,
+0x00000059,0x00000728,0x00000727,0x0004007c,
+0x00000006,0x00000729,0x00000728,0x00060050,
+0x00000008,0x0000072a,0x00000729,0x00000729,
+0x00000729,0x00050084,0x00000008,0x0000072b,
+0x00000726,0x0000072a,0x00060050,0x00000060,
+0x0000072c,0x000005bf,0x000005bf,0x000005bf,
+0x000500c2,0x00000008,0x0000072d,0x0000072b,
+0x0000072c,0x00050041,0x00000270,0x0000072e,
+0x0000006c,0x000000b5,0x0004003d,0x00000059,
+0x0000072f,0x0000072e,0x0004007c,0x00000006,
+0x00000730,0x0000072f,0x00050051,0x00000006,
+0x00000731,0x0000072d,0x00000000,0x00050051,
+0x00000006,0x00000732,0x0000072d,0x00000001,
+0x00050051,0x00000006,0x00000733,0x0000072d,
+0x00000002,0x00070050,0x0000000f,0x00000734,
+0x00000731,0x00000732,0x00000733,0x00000730,
+0x0003003e,0x0000006f,0x00000734,0x000100fd,
+0x000200f8,0x000006ac,0x00050041,0x00000270,
+0x00000736,0x0000006c,0x000000b9,0x0003003e,
+0x00000736,0x000006d1,0x00050041,0x00000270,
+0x00000737,0x0000006d,0x000000b9,0x0003003e,
+0x00000737,0x000006d1,0x000200f9,0x000006ad,
+0x000200f8,0x000006ad,0x0004003d,0x0000005a,
+0x00000739,0x0000006d,0x0008004f,0x00000060,
+0x0000073a,0x00000739,0x00000739,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x00000738,
+0x0000073a,0x00050039,0x00000059,0x0000073b,
+0x00000064,0x00000738,0x0004003d,0x0000005a,
+0x0000073d,0x0000006c,0x0008004f,0x00000060,
+0x0000073e,0x0000073d,0x0000073d,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x0000073c,
+0x0000073e,0x00050039,0x00000059,0x0000073f,
+0x00000064,0x0000073c,0x000500af,0x000000d0,
+0x00000740,0x0000073b,0x0000073f,0x000300f7,
+0x00000742,0x00000000,0x000400fa,0x00000740,
+0x00000741,0x00000747,0x000200f8,0x00000741,
+0x0004003d,0x0000005a,0x00000743,0x0000006c,
+0x0004007c,0x0000000f,0x00000744,0x00000743,
+0x0003003e,0x0000006f,0x00000744,0x0004003d,
+0x0000005a,0x00000745,0x0000006d,0x0004007c,
+0x0000000f,0x00000746,0x00000745,0x0003003e,
+0x00000070,0x00000746,0x000200f9,0x00000742,
+0x000200f8,0x00000747,0x0004003d,0x0000005a,
+0x00000749,0x0000006d,0x0003003e,0x00000748,
+0x00000749,0x00050039,0x0000005a,0x0000074a,
+0x0000005e,0x00000748,0x0004007c,0x0000000f,
+0x0000074b,0x0000074a,0x0003003e,0x0000006f,
+0x0000074b,0x0004003d,0x0000005a,0x0000074d,
+0x0000006c,0x0003003e,0x0000074c,0x0000074d,
+0x00050039,0x0000005a,0x0000074e,0x0000005e,
+0x0000074c,0x0004007c,0x0000000f,0x0000074f,
+0x0000074e,0x0003003e,0x00000070,0x0000074f,
+0x000200f9,0x00000742,0x000200f8,0x00000742,
+0x000100fd,0x000200f8,0x000006ae,0x00050041,
+0x00000270,0x00000751,0x0000006c,0x000000b9,
+0x0003003e,0x00000751,0x000006d1,0x00050041,
+0x00000270,0x00000753,0x0000006d,0x000000b9,
+0x0003003e,0x00000753,0x00000752,0x000200f9,
+0x000006af,0x000200f8,0x000006af,0x0004003d,
+0x0000005a,0x00000755,0x0000006d,0x0003003e,
+0x00000754,0x00000755,0x0004003d,0x0000005a,
+0x00000757,0x0000006c,0x0003003e,0x00000756,
+0x00000757,0x00060039,0x00000002,0x00000758,
+0x00000069,0x00000754,0x00000756,0x0004003d,
+0x0000005a,0x00000759,0x00000754,0x0003003e,
+0x0000006d,0x00000759,0x0004003d,0x0000005a,
+0x0000075a,0x00000756,0x0003003e,0x0000006c,
+0x0000075a,0x0004003d,0x0000005a,0x0000075c,
+0x0000006d,0x0008004f,0x00000060,0x0000075d,
+0x0000075c,0x0000075c,0x00000000,0x00000001,
+0x00000002,0x0003003e,0x0000075b,0x0000075d,
+0x00050039,0x00000059,0x0000075e,0x00000064,
+0x0000075b,0x000500af,0x000000d0,0x0000075f,
+0x0000075e,0x000000e3,0x000300f7,0x00000761,
+0x00000000,0x000400fa,0x0000075f,0x00000760,
+0x0000076e,0x000200f8,0x00000760,0x0004003d,
+0x0000005a,0x00000762,0x0000006c,0x00070050,
+0x0000005a,0x00000763,0x000000e3,0x000000e3,
+0x000000e3,0x000000e3,0x00070050,0x0000005a,
+0x00000764,0x000006d1,0x000006d1,0x000006d1,
+0x000006d1,0x0008000c,0x0000005a,0x00000765,
+0x00000001,0x0000002d,0x00000762,0x00000763,
+0x00000764,0x0004007c,0x0000000f,0x00000766,
+0x00000765,0x0003003e,0x0000006f,0x00000766,
+0x0004003d,0x0000005a,0x00000767,0x0000006c,
+0x0004003d,0x0000005a,0x00000768,0x0000006d,
+0x00050080,0x0000005a,0x00000769,0x00000767,
+0x00000768,0x00070050,0x0000005a,0x0000076a,
+0x000000e3,0x000000e3,0x000000e3,0x000000e3,
+0x00070050,0x0000005a,0x0000076b,0x000006d1,
+0x000006d1,0x000006d1,0x000006d1,0x0008000c,
+0x0000005a,0x0000076c,0x00000001,0x0000002d,
+0x00000769,0x0000076a,0x0000076b,0x0004007c,
+0x0000000f,0x0000076d,0x0000076c,0x0003003e,
+0x00000070,0x0000076d,0x000200f9,0x00000761,
+0x000200f8,0x0000076e,0x0004003d,0x0000005a,
+0x0000076f,0x0000006c,0x0004003d,0x0000005a,
+0x00000770,0x0000006d,0x00050080,0x0000005a,
+0x00000771,0x0000076f,0x00000770,0x0003003e,
+0x00000772,0x00000771,0x00050039,0x0000005a,
+0x00000773,0x0000005e,0x00000772,0x00070050,
+0x0000005a,0x00000774,0x000000e3,0x000000e3,
+0x000000e3,0x000000e3,0x00070050,0x0000005a,
+0x00000775,0x000006d1,0x000006d1,0x000006d1,
+0x000006d1,0x0008000c,0x0000005a,0x00000776,
+0x00000001,0x0000002d,0x00000773,0x00000774,
+0x00000775,0x0004007c,0x0000000f,0x00000777,
+0x00000776,0x0003003e,0x0000006f,0x00000777,
+0x0004003d,0x0000005a,0x00000779,0x0000006c,
+0x0003003e,0x00000778,0x00000779,0x00050039,
+0x0000005a,0x0000077a,0x0000005e,0x00000778,
+0x00070050,0x0000005a,0x0000077b,0x000000e3,
+0x000000e3,0x000000e3,0x000000e3,0x00070050,
+0x0000005a,0x0000077c,0x000006d1,0x000006d1,
+0x000006d1,0x000006d1,0x0008000c,0x0000005a,
+0x0000077d,0x00000001,0x0000002d,0x0000077a,
+0x0000077b,0x0000077c,0x0004007c,0x0000000f,
+0x0000077e,0x0000077d,0x0003003e,0x00000070,
+0x0000077e,0x000200f9,0x00000761,0x000200f8,
+0x00000761,0x000100fd,0x000200f8,0x000006b1,
+0x000100fd,0x00010038,0x00050036,0x00000006,
+0x00000078,0x00000000,0x00000073,0x00030037,
+0x00000010,0x00000074,0x00030037,0x00000007,
+0x00000075,0x00030037,0x00000007,0x00000076,
+0x00030037,0x00000009,0x00000077,0x000200f8,
+0x00000079,0x0004003b,0x00000007,0x00000782,
+0x00000007,0x0004003b,0x00000007,0x0000078a,
+0x00000007,0x0004003b,0x00000007,0x00000793,
+0x00000007,0x0004003b,0x00000010,0x00000796,
+0x00000007,0x0004003b,0x00000007,0x00000798,
+0x00000007,0x0004003b,0x00000007,0x0000079a,
+0x00000007,0x0004003b,0x00000007,0x0000079c,
+0x00000007,0x0004003b,0x00000803,0x00000804,
+0x00000007,0x0004003b,0x00000007,0x0000080e,
+0x00000007,0x0004003b,0x00000007,0x00000817,
+0x00000007,0x0004003b,0x00000010,0x0000081a,
+0x00000007,0x0004003b,0x00000007,0x0000081c,
+0x00000007,0x0004003b,0x00000007,0x0000081e,
+0x00000007,0x0004003b,0x00000007,0x00000820,
+0x00000007,0x0004003b,0x00000831,0x00000832,
+0x00000007,0x0004003b,0x00000007,0x00000837,
+0x00000007,0x0004003b,0x00000007,0x0000083d,
+0x00000007,0x0004003b,0x00000010,0x0000083e,
+0x00000007,0x0004003b,0x00000007,0x00000840,
+0x00000007,0x0004003b,0x00000007,0x00000842,
+0x00000007,0x0004003b,0x00000012,0x00000845,
+0x00000007,0x0004003b,0x00000851,0x00000852,
+0x00000007,0x00050041,0x00000007,0x00000783,
+0x00000077,0x000000b5,0x0004003d,0x00000006,
+0x00000784,0x00000783,0x0003003e,0x00000782,
+0x00000784,0x00050041,0x00000007,0x00000785,
+0x00000077,0x000000c0,0x0004003d,0x00000006,
+0x00000786,0x00000785,0x000500aa,0x000000d0,
+0x00000787,0x00000786,0x000000c3,0x000300f7,
+0x00000789,0x00000000,0x000400fa,0x00000787,
+0x00000788,0x00000808,0x000200f8,0x00000788,
+0x0004003d,0x00000006,0x0000078b,0x00000076,
+0x00050086,0x00000006,0x0000078c,0x0000078b,
+0x000000b8,0x0004003d,0x00000006,0x0000078d,
+0x00000782,0x00050084,0x00000006,0x0000078e,
+0x000000b8,0x0000078d,0x00050080,0x00000006,
+0x0000078f,0x0000078e,0x000000b0,0x00050084,
+0x00000006,0x00000790,0x0000078c,0x0000078f,
+0x0004003d,0x00000006,0x00000791,0x00000075,
+0x00050080,0x00000006,0x00000792,0x00000790,
+0x00000791,0x0003003e,0x0000078a,0x00000792,
+0x0004003d,0x00000006,0x00000794,0x00000076,
+0x00050089,0x00000006,0x00000795,0x00000794,
+0x000000b8,0x0004003d,0x0000000f,0x00000797,
+0x00000074,0x0003003e,0x00000796,0x00000797,
+0x0004003d,0x00000006,0x00000799,0x0000078a,
+0x0003003e,0x00000798,0x00000799,0x0004003d,
+0x00000006,0x0000079b,0x00000782,0x0003003e,
+0x0000079a,0x0000079b,0x0003003e,0x0000079c,
+0x00000795,0x00080039,0x00000006,0x0000079d,
+0x0000002a,0x00000796,0x00000798,0x0000079a,
+0x0000079c,0x0003003e,0x00000793,0x0000079d,
+0x0004003d,0x00000006,0x000007fc,0x00000782,
+0x000500c4,0x00000059,0x000007fd,0x000000ee,
+0x000007fc,0x00050082,0x00000059,0x000007fe,
+0x000007fd,0x000000ee,0x00050084,0x00000059,
+0x000007ff,0x00000182,0x000007fe,0x0004007c,
+0x00000006,0x00000800,0x000007ff,0x0004003d,
+0x00000006,0x00000801,0x00000793,0x00050080,
+0x00000006,0x00000802,0x00000800,0x00000801,
+0x0003003e,0x00000804,0x000007fb,0x00050041,
+0x00000007,0x00000805,0x00000804,0x00000802,
+0x0004003d,0x00000006,0x00000806,0x00000805,
+0x000200fe,0x00000806,0x000200f8,0x00000808,
+0x00050041,0x00000007,0x00000809,0x00000077,
+0x000000c3,0x0004003d,0x00000006,0x0000080a,
+0x00000809,0x000500aa,0x000000d0,0x0000080b,
+0x0000080a,0x000000c3,0x000300f7,0x0000080d,
+0x00000000,0x000400fa,0x0000080b,0x0000080c,
+0x00000836,0x000200f8,0x0000080c,0x0004003d,
+0x00000006,0x0000080f,0x00000076,0x00050086,
+0x00000006,0x00000810,0x0000080f,0x000000b9,
+0x0004003d,0x00000006,0x00000811,0x00000782,
+0x00050084,0x00000006,0x00000812,0x000000b9,
+0x00000811,0x00050080,0x00000006,0x00000813,
+0x00000812,0x000000b1,0x00050084,0x00000006,
+0x00000814,0x00000810,0x00000813,0x0004003d,
+0x00000006,0x00000815,0x00000075,0x00050080,
+0x00000006,0x00000816,0x00000814,0x00000815,
+0x0003003e,0x0000080e,0x00000816,0x0004003d,
+0x00000006,0x00000818,0x00000076,0x00050089,
+0x00000006,0x00000819,0x00000818,0x000000b9,
+0x0004003d,0x0000000f,0x0000081b,0x00000074,
+0x0003003e,0x0000081a,0x0000081b,0x0004003d,
+0x00000006,0x0000081d,0x0000080e,0x0003003e,
+0x0000081c,0x0000081d,0x0004003d,0x00000006,
+0x0000081f,0x00000782,0x0003003e,0x0000081e,
+0x0000081f,0x0003003e,0x00000820,0x00000819,
+0x00080039,0x00000006,0x00000821,0x00000030,
+0x0000081a,0x0000081c,0x0000081e,0x00000820,
+0x0003003e,0x00000817,0x00000821,0x0004003d,
+0x00000006,0x0000082a,0x00000782,0x000500c4,
+0x00000059,0x0000082b,0x000000ee,0x0000082a,
+0x00050082,0x00000059,0x0000082c,0x0000082b,
+0x000000ee,0x00050084,0x00000059,0x0000082d,
+0x000000f3,0x0000082c,0x0004007c,0x00000006,
+0x0000082e,0x0000082d,0x0004003d,0x00000006,
+0x0000082f,0x00000817,0x00050080,0x00000006,
+0x00000830,0x0000082e,0x0000082f,0x0003003e,
+0x00000832,0x00000829,0x00050041,0x00000007,
+0x00000833,0x00000832,0x00000830,0x0004003d,
+0x00000006,0x00000834,0x00000833,0x000200fe,
+0x00000834,0x000200f8,0x00000836,0x0004003d,
+0x00000006,0x00000838,0x00000076,0x0004003d,
+0x00000006,0x00000839,0x00000782,0x00050084,
+0x00000006,0x0000083a,0x00000838,0x00000839,
+0x0004003d,0x00000006,0x0000083b,0x00000075,
+0x00050080,0x00000006,0x0000083c,0x0000083a,
+0x0000083b,0x0003003e,0x00000837,0x0000083c,
+0x0004003d,0x0000000f,0x0000083f,0x00000074,
+0x0003003e,0x0000083e,0x0000083f,0x0004003d,
+0x00000006,0x00000841,0x00000837,0x0003003e,
+0x00000840,0x00000841,0x0004003d,0x00000006,
+0x00000843,0x00000782,0x0003003e,0x00000842,
+0x00000843,0x00070039,0x00000006,0x00000844,
+0x0000001c,0x0000083e,0x00000840,0x00000842,
+0x0003003e,0x0000083d,0x00000844,0x0004003d,
+0x00000006,0x0000084f,0x00000782,0x00050082,
+0x00000006,0x00000850,0x0000084f,0x000000c3,
+0x0003003e,0x00000852,0x0000084e,0x00050041,
+0x00000012,0x00000853,0x00000852,0x00000850,
+0x0004003d,0x00000011,0x00000854,0x00000853,
+0x0003003e,0x00000845,0x00000854,0x0004003d,
+0x00000006,0x00000855,0x0000083d,0x00050041,
+0x00000007,0x00000856,0x00000845,0x000000c0,
+0x0004003d,0x00000006,0x00000857,0x00000856,
+0x00050084,0x00000006,0x00000858,0x00000855,
+0x00000857,0x0004003d,0x00000006,0x00000859,
+0x0000083d,0x00050041,0x00000007,0x0000085a,
+0x00000845,0x000000c3,0x0004003d,0x00000006,
+0x0000085b,0x0000085a,0x000500c2,0x00000006,
+0x0000085c,0x00000859,0x0000085b,0x000500c5,
+0x00000006,0x0000085d,0x00000858,0x0000085c,
+0x000200fe,0x0000085d,0x000200f8,0x0000080d,
+0x000100ff,0x000200f8,0x00000789,0x000100ff,
+0x00010038,0x00050036,0x0000000f,0x0000007c,
+0x00000000,0x0000007a,0x00030037,0x00000007,
+0x0000007b,0x000200f8,0x0000007d,0x0004003b,
+0x0000005b,0x00000860,0x00000007,0x0004003b,
+0x00000010,0x00000869,0x00000007,0x0004003d,
+0x00000006,0x00000861,0x0000007b,0x0004007c,
+0x00000059,0x00000862,0x00000861,0x00070050,
+0x0000005a,0x00000867,0x00000862,0x00000862,
+0x00000862,0x00000862,0x00050082,0x0000005a,
+0x00000868,0x00000867,0x00000866,0x0003003e,
+0x00000860,0x00000868,0x0004003d,0x0000005a,
+0x0000086b,0x00000860,0x0008000c,0x0000005a,
+0x0000086f,0x00000001,0x0000002d,0x0000086b,
+0x0000086c,0x0000086e,0x000500c4,0x0000000f,
+0x00000870,0x0000086a,0x0000086f,0x00070050,
+0x0000000f,0x00000871,0x000000c3,0x000000c3,
+0x000000c3,0x000000c3,0x00050082,0x0000000f,
+0x00000872,0x00000870,0x00000871,0x0003003e,
+0x00000869,0x00000872,0x0004003d,0x0000000f,
+0x00000873,0x00000869,0x0004003d,0x00000006,
+0x00000876,0x0000007b,0x00070050,0x0000000f,
+0x00000877,0x00000876,0x00000876,0x00000876,
+0x00000876,0x000500ae,0x00000879,0x0000087a,
+0x00000877,0x00000878,0x000600a9,0x0000000f,
+0x0000087b,0x0000087a,0x00000875,0x00000873,
+0x000200fe,0x0000087b,0x00010038,0x00050036,
+0x0000000f,0x00000080,0x00000000,0x0000007e,
+0x00030037,0x00000011,0x0000007f,0x000200f8,
+0x00000081,0x0004003b,0x00000010,0x00000894,
+0x00000007,0x0004003b,0x00000007,0x00000898,
+0x00000007,0x0004003b,0x00000012,0x0000089c,
+0x00000007,0x0004003b,0x00000010,0x0000089d,
+0x00000007,0x0004003b,0x00000007,0x000008a0,
+0x00000007,0x0004003b,0x00000007,0x000008a1,
+0x00000007,0x0004003b,0x00000012,0x000008a3,
+0x00000007,0x0004003b,0x00000007,0x000008a4,
+0x00000007,0x0004003b,0x00000007,0x000008a7,
+0x00000007,0x0004003b,0x00000007,0x000008a8,
+0x00000007,0x0004003b,0x00000007,0x000008a9,
+0x00000007,0x0004003b,0x00000007,0x000008aa,
+0x00000007,0x0004003b,0x00000007,0x000008ab,
+0x00000007,0x0004003b,0x00000007,0x000008ad,
+0x00000007,0x0004003b,0x00000007,0x000008ae,
+0x00000007,0x0004003b,0x00000007,0x000008af,
+0x00000007,0x0004003b,0x00000007,0x000008b9,
+0x00000007,0x0004003b,0x00000007,0x000008bf,
+0x00000007,0x0004003b,0x00000007,0x000008c7,
+0x00000007,0x0004003b,0x00000009,0x000008cb,
+0x00000007,0x0004003b,0x00000007,0x000008cc,
+0x00000007,0x0004003b,0x00000007,0x000008cd,
+0x00000007,0x0004003b,0x00000007,0x000008cf,
+0x00000007,0x0004003b,0x00000007,0x000008d1,
+0x00000007,0x0004003b,0x00000007,0x000008d4,
+0x00000007,0x0004003b,0x0000005b,0x000008d8,
+0x00000007,0x0004003b,0x0000005b,0x000008d9,
+0x00000007,0x0004003b,0x00000010,0x000008da,
+0x00000007,0x0004003b,0x00000007,0x000008df,
+0x00000007,0x0004003b,0x00000007,0x000008e2,
+0x00000007,0x0004003b,0x00000007,0x000008eb,
+0x00000007,0x0004003b,0x00000010,0x000008f1,
+0x00000007,0x0004003b,0x00000007,0x000008f3,
+0x00000007,0x0004003b,0x00000007,0x000008f5,
+0x00000007,0x0004003b,0x00000009,0x000008f7,
+0x00000007,0x0004003b,0x00000010,0x000008ff,
+0x00000007,0x0004003b,0x00000007,0x00000901,
+0x00000007,0x0004003b,0x00000007,0x00000903,
+0x00000007,0x0004003b,0x00000009,0x00000904,
+0x00000007,0x0004003b,0x00000010,0x0000090b,
+0x00000007,0x0004003b,0x00000010,0x0000090c,
+0x00000007,0x0004003b,0x0000005b,0x0000090d,
+0x00000007,0x0004003b,0x0000005b,0x0000090f,
+0x00000007,0x0004003b,0x00000007,0x00000911,
+0x00000007,0x0004003b,0x00000010,0x00000913,
+0x00000007,0x0004003b,0x00000010,0x00000914,
+0x00000007,0x0004003b,0x00000010,0x00000918,
+0x00000007,0x0004003b,0x00000007,0x0000091f,
+0x00000007,0x0004003b,0x00000010,0x00000920,
+0x00000007,0x0004003b,0x00000007,0x00000922,
+0x00000007,0x0004003b,0x00000007,0x00000924,
+0x00000007,0x0004003d,0x000000d0,0x0000087e,
+0x000000d2,0x000300f7,0x00000880,0x00000000,
+0x000400fa,0x0000087e,0x0000087f,0x00000880,
+0x000200f8,0x0000087f,0x000200fe,0x00000881,
+0x000200f8,0x00000880,0x0004003d,0x000000d0,
+0x00000883,0x000000d4,0x000300f7,0x00000885,
+0x00000000,0x000400fa,0x00000883,0x00000884,
+0x00000885,0x000200f8,0x00000884,0x00050041,
+0x000000d5,0x00000886,0x000000cb,0x000000c3,
+0x0004003d,0x00000006,0x00000887,0x00000886,
+0x000600cb,0x00000006,0x00000888,0x00000887,
+0x000005bf,0x000005bf,0x00050041,0x000000d5,
+0x00000889,0x000000cb,0x000000c3,0x0004003d,
+0x00000006,0x0000088a,0x00000889,0x000600cb,
+0x00000006,0x0000088b,0x0000088a,0x000005cc,
+0x000005bf,0x00050041,0x000000d5,0x0000088c,
+0x000000cb,0x000000c0,0x0004003d,0x00000006,
+0x0000088d,0x0000088c,0x000600cb,0x00000006,
+0x0000088e,0x0000088d,0x000005bf,0x000005bf,
+0x00050041,0x000000d5,0x0000088f,0x000000cb,
+0x000000c0,0x0004003d,0x00000006,0x00000890,
+0x0000088f,0x000600cb,0x00000006,0x00000891,
+0x00000890,0x000005cc,0x000005bf,0x00070050,
+0x0000000f,0x00000892,0x00000888,0x0000088b,
+0x0000088e,0x00000891,0x000200fe,0x00000892,
+0x000200f8,0x00000885,0x0004003d,0x0000000f,
+0x00000895,0x000000cb,0x0009004f,0x0000000f,
+0x00000896,0x00000895,0x00000895,0x00000003,
+0x00000002,0x00000001,0x00000000,0x000400cc,
+0x0000000f,0x00000897,0x00000896,0x0004003d,
+0x00000006,0x00000899,0x00000193,0x0003003e,
+0x00000898,0x00000899,0x00050039,0x0000000f,
+0x0000089a,0x0000007c,0x00000898,0x000500c7,
+0x0000000f,0x0000089b,0x00000897,0x0000089a,
+0x0003003e,0x00000894,0x0000089b,0x0004003d,
+0x0000000f,0x0000089e,0x00000894,0x0003003e,
+0x0000089d,0x0000089e,0x00060039,0x00000011,
+0x0000089f,0x00000047,0x0000089d,0x0000007f,
+0x0003003e,0x0000089c,0x0000089f,0x0004003d,
+0x00000006,0x000008a2,0x000001b1,0x0003003e,
+0x000008a1,0x000008a2,0x0003003e,0x000008a3,
+0x0000007f,0x0004003d,0x00000006,0x000008a5,
+0x000001a7,0x0003003e,0x000008a4,0x000008a5,
+0x00070039,0x00000006,0x000008a6,0x00000051,
+0x000008a1,0x000008a3,0x000008a4,0x0003003e,
+0x000008a0,0x000008a6,0x0003003e,0x000008a7,
+0x000000c0,0x0003003e,0x000008a8,0x000000c0,
+0x0003003e,0x000008a9,0x000000c0,0x0004003d,
+0x00000006,0x000008ac,0x000008a0,0x0003003e,
+0x000008ab,0x000008ac,0x00080039,0x00000006,
+0x000008b0,0x00000023,0x000008ab,0x000008ad,
+0x000008ae,0x000008af,0x0004003d,0x00000006,
+0x000008b1,0x000008ad,0x0003003e,0x000008a7,
+0x000008b1,0x0004003d,0x00000006,0x000008b2,
+0x000008ae,0x0003003e,0x000008a8,0x000008b2,
+0x0004003d,0x00000006,0x000008b3,0x000008af,
+0x0003003e,0x000008a9,0x000008b3,0x0003003e,
+0x000008aa,0x000008b0,0x0004003d,0x00000006,
+0x000008b4,0x000008a8,0x000500ac,0x000000d0,
+0x000008b5,0x000008b4,0x000002c4,0x000300f7,
+0x000008b7,0x00000000,0x000400fa,0x000008b5,
+0x000008b6,0x000008b7,0x000200f8,0x000008b6,
+0x000200fe,0x00000881,0x000200f8,0x000008b7,
+0x0004003d,0x00000006,0x000008ba,0x000001a7,
+0x000500aa,0x000000d0,0x000008bb,0x000008ba,
+0x000000c3,0x000600a9,0x00000059,0x000008bd,
+0x000008bb,0x00000578,0x000008bc,0x0004007c,
+0x00000006,0x000008be,0x000008bd,0x0003003e,
+0x000008b9,0x000008be,0x0004003d,0x000000d0,
+0x000008c1,0x000000ff,0x000600a9,0x00000059,
+0x000008c2,0x000008c1,0x000000ee,0x000000e3,
+0x00050084,0x00000059,0x000008c3,0x000008c0,
+0x000008c2,0x0004007c,0x00000006,0x000008c4,
+0x000008c3,0x0004003d,0x00000006,0x000008c5,
+0x000008a7,0x00050080,0x00000006,0x000008c6,
+0x000008c4,0x000008c5,0x0003003e,0x000008bf,
+0x000008c6,0x0004003d,0x00000006,0x000008c8,
+0x000008bf,0x0004003d,0x00000006,0x000008c9,
+0x000008b9,0x00050082,0x00000006,0x000008ca,
+0x000008c8,0x000008c9,0x0003003e,0x000008c7,
+0x000008ca,0x0004003d,0x00000006,0x000008ce,
+0x000008c7,0x0003003e,0x000008cd,0x000008ce,
+0x0004003d,0x00000006,0x000008d0,0x000008a8,
+0x0003003e,0x000008cf,0x000008d0,0x00070039,
+0x00000008,0x000008d2,0x00000057,0x000008cd,
+0x000008cf,0x000008d1,0x0004003d,0x00000006,
+0x000008d3,0x000008d1,0x0003003e,0x000008cc,
+0x000008d3,0x0003003e,0x000008cb,0x000008d2,
+0x0004003d,0x00000006,0x000008d5,0x000008aa,
+0x000500c2,0x00000006,0x000008d6,0x000008d5,
+0x000000e4,0x00050080,0x00000006,0x000008d7,
+0x000008d6,0x000000c3,0x0003003e,0x000008d4,
+0x000008d7,0x0003003e,0x000008d8,0x0000086c,
+0x0003003e,0x000008d9,0x0000086c,0x0004003d,
+0x0000000f,0x000008db,0x000000cb,0x0004003d,
+0x00000006,0x000008dc,0x000008b9,0x0004003d,
+0x00000006,0x000008dd,0x000008cc,0x00050080,
+0x00000006,0x000008de,0x000008dc,0x000008dd,
+0x0003003e,0x000008df,0x000008de,0x00050039,
+0x0000000f,0x000008e0,0x0000007c,0x000008df,
+0x000500c7,0x0000000f,0x000008e1,0x000008db,
+0x000008e0,0x0003003e,0x000008da,0x000008e1,
+0x0003003e,0x000008e2,0x000000c0,0x000200f9,
+0x000008e3,0x000200f8,0x000008e3,0x000400f6,
+0x000008e5,0x000008e6,0x00000000,0x000200f9,
+0x000008e7,0x000200f8,0x000008e7,0x0004003d,
+0x00000006,0x000008e8,0x000008e2,0x0004003d,
+0x00000006,0x000008e9,0x000008d4,0x000500b0,
+0x000000d0,0x000008ea,0x000008e8,0x000008e9,
+0x000400fa,0x000008ea,0x000008e4,0x000008e5,
+0x000200f8,0x000008e4,0x0004003d,0x00000006,
+0x000008ec,0x000008e2,0x00050084,0x00000006,
+0x000008ed,0x000000b5,0x000008ec,0x0004003d,
+0x00000006,0x000008ee,0x000008a9,0x00050080,
+0x00000006,0x000008ef,0x000008ed,0x000008ee,
+0x0003003e,0x000008eb,0x000008ef,0x0004003d,
+0x00000006,0x000008f0,0x000008e2,0x0004003d,
+0x0000000f,0x000008f2,0x000008da,0x0003003e,
+0x000008f1,0x000008f2,0x0004003d,0x00000006,
+0x000008f4,0x000008b9,0x0003003e,0x000008f3,
+0x000008f4,0x0004003d,0x00000006,0x000008f6,
+0x000008eb,0x0003003e,0x000008f5,0x000008f6,
+0x0004003d,0x00000008,0x000008f8,0x000008cb,
+0x0003003e,0x000008f7,0x000008f8,0x00080039,
+0x00000006,0x000008f9,0x00000078,0x000008f1,
+0x000008f3,0x000008f5,0x000008f7,0x0004007c,
+0x00000059,0x000008fa,0x000008f9,0x00050041,
+0x00000270,0x000008fb,0x000008d8,0x000008f0,
+0x0003003e,0x000008fb,0x000008fa,0x0004003d,
+0x00000006,0x000008fc,0x000008e2,0x0004003d,
+0x00000006,0x000008fd,0x000008eb,0x00050080,
+0x00000006,0x000008fe,0x000008fd,0x000000c3,
+0x0004003d,0x0000000f,0x00000900,0x000008da,
+0x0003003e,0x000008ff,0x00000900,0x0004003d,
+0x00000006,0x00000902,0x000008b9,0x0003003e,
+0x00000901,0x00000902,0x0003003e,0x00000903,
+0x000008fe,0x0004003d,0x00000008,0x00000905,
+0x000008cb,0x0003003e,0x00000904,0x00000905,
+0x00080039,0x00000006,0x00000906,0x00000078,
+0x000008ff,0x00000901,0x00000903,0x00000904,
+0x0004007c,0x00000059,0x00000907,0x00000906,
+0x00050041,0x00000270,0x00000908,0x000008d9,
+0x000008fc,0x0003003e,0x00000908,0x00000907,
+0x000200f9,0x000008e6,0x000200f8,0x000008e6,
+0x0004003d,0x00000006,0x00000909,0x000008e2,
+0x00050080,0x00000006,0x0000090a,0x00000909,
+0x000000ee,0x0003003e,0x000008e2,0x0000090a,
+0x000200f9,0x000008e3,0x000200f8,0x000008e5,
+0x0004003d,0x0000005a,0x0000090e,0x000008d8,
+0x0003003e,0x0000090d,0x0000090e,0x0004003d,
+0x0000005a,0x00000910,0x000008d9,0x0003003e,
+0x0000090f,0x00000910,0x0004003d,0x00000006,
+0x00000912,0x000008aa,0x0003003e,0x00000911,
+0x00000912,0x00090039,0x00000002,0x00000915,
+0x00000071,0x0000090d,0x0000090f,0x00000911,
+0x00000913,0x00000914,0x0004003d,0x0000000f,
+0x00000916,0x00000913,0x0003003e,0x0000090b,
+0x00000916,0x0004003d,0x0000000f,0x00000917,
+0x00000914,0x0003003e,0x0000090c,0x00000917,
+0x00050041,0x00000007,0x00000919,0x0000089c,
+0x000000c0,0x0004003d,0x00000006,0x0000091a,
+0x00000919,0x00070050,0x0000000f,0x0000091b,
+0x0000091a,0x0000091a,0x0000091a,0x0000091a,
+0x0003003e,0x00000918,0x0000091b,0x0004003d,
+0x000000d0,0x0000091c,0x000000ff,0x000300f7,
+0x0000091e,0x00000000,0x000400fa,0x0000091c,
+0x0000091d,0x0000091e,0x000200f8,0x0000091d,
+0x0004003d,0x0000000f,0x00000921,0x000000cb,
+0x0003003e,0x00000920,0x00000921,0x0004003d,
+0x00000006,0x00000923,0x000008bf,0x0003003e,
+0x00000922,0x00000923,0x0003003e,0x00000924,
+0x000000b5,0x00070039,0x00000006,0x00000925,
+0x0000001c,0x00000920,0x00000922,0x00000924,
+0x0003003e,0x0000091f,0x00000925,0x0004003d,
+0x00000006,0x00000926,0x0000091f,0x00050041,
+0x00000007,0x00000927,0x0000089c,0x000000c3,
+0x0004003d,0x00000006,0x00000928,0x00000927,
+0x00050041,0x00000007,0x00000929,0x00000918,
+0x00000926,0x0003003e,0x00000929,0x00000928,
+0x000200f9,0x0000091e,0x000200f8,0x0000091e,
+0x0004003d,0x0000000f,0x0000092a,0x0000090b,
+0x0004003d,0x0000000f,0x0000092b,0x00000918,
+0x00070050,0x0000000f,0x0000092c,0x000001a1,
+0x000001a1,0x000001a1,0x000001a1,0x00050082,
+0x0000000f,0x0000092d,0x0000092c,0x0000092b,
+0x00050084,0x0000000f,0x0000092e,0x0000092a,
+0x0000092d,0x0004003d,0x0000000f,0x0000092f,
+0x0000090c,0x0004003d,0x0000000f,0x00000930,
+0x00000918,0x00050084,0x0000000f,0x00000931,
+0x0000092f,0x00000930,0x00050080,0x0000000f,
+0x00000932,0x0000092e,0x00000931,0x00070050,
+0x0000000f,0x00000933,0x000001c4,0x000001c4,
+0x000001c4,0x000001c4,0x00050080,0x0000000f,
+0x00000934,0x00000932,0x00000933,0x00070050,
+0x0000005a,0x00000935,0x0000052f,0x0000052f,
+0x0000052f,0x0000052f,0x000500c2,0x0000000f,
+0x00000936,0x00000934,0x00000935,0x000200fe,
+0x00000936,0x00010038,0x00050036,0x00000082,
+0x00000085,0x00000000,0x00000083,0x00030037,
+0x00000061,0x00000084,0x000200f8,0x00000086,
+0x0004003d,0x00000060,0x00000939,0x00000084,
+0x0007004f,0x00000082,0x0000093a,0x00000939,
+0x00000939,0x00000000,0x00000002,0x000200fe,
+0x0000093a,0x00010038,0x00050036,0x0000000f,
+0x0000008a,0x00000000,0x00000087,0x00030037,
+0x00000012,0x00000088,0x00030037,0x00000007,
+0x00000089,0x000200f8,0x0000008b,0x0004003b,
+0x00000012,0x0000093d,0x00000007,0x0004003b,
+0x00000012,0x00000946,0x00000007,0x0004003b,
+0x00000061,0x00000956,0x00000007,0x0004003b,
+0x00000010,0x0000095a,0x00000007,0x0004003b,
+0x00000012,0x0000095c,0x00000007,0x0004003d,
+0x00000011,0x0000093e,0x00000088,0x00050041,
+0x00000942,0x00000943,0x00000941,0x000000e3,
+0x0004003d,0x00000011,0x00000944,0x00000943,
+0x00050086,0x00000011,0x00000945,0x0000093e,
+0x00000944,0x0003003e,0x0000093d,0x00000945,
+0x0004003d,0x00000011,0x00000947,0x00000088,
+0x00050041,0x00000942,0x00000948,0x00000941,
+0x000000e3,0x0004003d,0x00000011,0x00000949,
+0x00000948,0x00050089,0x00000011,0x0000094a,
+0x00000947,0x00000949,0x0003003e,0x00000946,
+0x0000094a,0x0004003d,0x0000094b,0x0000094e,
+0x0000094d,0x0004003d,0x00000011,0x0000094f,
+0x0000093d,0x0004007c,0x00000082,0x00000950,
+0x0000094f,0x0004003d,0x00000006,0x00000951,
+0x00000089,0x0004007c,0x00000059,0x00000952,
+0x00000951,0x00050051,0x00000059,0x00000953,
+0x00000950,0x00000000,0x00050051,0x00000059,
+0x00000954,0x00000950,0x00000001,0x00060050,
+0x00000060,0x00000955,0x00000953,0x00000954,
+0x00000952,0x0003003e,0x00000956,0x00000955,
+0x00050039,0x00000082,0x00000957,0x00000085,
+0x00000956,0x00050062,0x0000000f,0x00000958,
+0x0000094e,0x00000957,0x0009004f,0x0000000f,
+0x00000959,0x00000958,0x00000958,0x00000003,
+0x00000002,0x00000001,0x00000000,0x0003003e,
+0x000000cb,0x00000959,0x0004003d,0x0000000f,
+0x0000095b,0x000000cb,0x0003003e,0x0000095a,
+0x0000095b,0x00050041,0x00000942,0x0000095d,
+0x00000941,0x000000e3,0x0004003d,0x00000011,
+0x0000095e,0x0000095d,0x0003003e,0x0000095c,
+0x0000095e,0x00060039,0x00000002,0x0000095f,
+0x00000016,0x0000095a,0x0000095c,0x0004003d,
+0x00000011,0x00000960,0x00000946,0x00050039,
+0x0000000f,0x00000961,0x00000080,0x00000960,
+0x000200fe,0x00000961,0x00010038,0x00050036,
+0x00000006,0x00000093,0x00000000,0x0000008f,
+0x00030037,0x0000008e,0x00000090,0x00030037,
+0x0000008e,0x00000091,0x00030037,0x0000008e,
+0x00000092,0x000200f8,0x00000094,0x0004003b,
+0x0000008e,0x00000964,0x00000007,0x0004003b,
+0x00000968,0x00000969,0x00000007,0x0004003b,
+0x00000270,0x00000973,0x00000007,0x0004003d,
+0x0000008d,0x00000965,0x00000092,0x0004003d,
+0x0000008d,0x00000966,0x00000091,0x00050083,
+0x0000008d,0x00000967,0x00000965,0x00000966,
+0x0003003e,0x00000964,0x00000967,0x0004003d,
+0x0000008d,0x0000096a,0x00000090,0x0004003d,
+0x0000008d,0x0000096b,0x00000091,0x00050083,
+0x0000008d,0x0000096c,0x0000096a,0x0000096b,
+0x0004003d,0x0000008d,0x0000096d,0x00000964,
+0x00050094,0x0000008c,0x0000096e,0x0000096c,
+0x0000096d,0x0004003d,0x0000008d,0x0000096f,
+0x00000964,0x0004003d,0x0000008d,0x00000970,
+0x00000964,0x00050094,0x0000008c,0x00000971,
+0x0000096f,0x00000970,0x00050088,0x0000008c,
+0x00000972,0x0000096e,0x00000971,0x0003003e,
+0x00000969,0x00000972,0x0004003d,0x0000008c,
+0x00000974,0x00000969,0x00050085,0x0000008c,
+0x00000976,0x00000974,0x00000975,0x0008000c,
+0x0000008c,0x00000978,0x00000001,0x0000002b,
+0x00000976,0x00000977,0x00000975,0x0006000c,
+0x0000008c,0x00000979,0x00000001,0x00000001,
+0x00000978,0x0004006e,0x00000059,0x0000097a,
+0x00000979,0x0003003e,0x00000973,0x0000097a,
+0x0004003d,0x00000059,0x0000097b,0x00000973,
+0x00050084,0x00000059,0x0000097c,0x0000097b,
+0x000000e4,0x000600cb,0x00000006,0x0000097d,
+0x00000443,0x0000097c,0x000000e4,0x000200fe,
+0x0000097d,0x00010038,0x00050036,0x00000006,
+0x00000099,0x00000000,0x00000095,0x00030037,
+0x00000007,0x00000096,0x00030037,0x00000007,
+0x00000097,0x00030037,0x00000007,0x00000098,
+0x000200f8,0x0000009a,0x0004003b,0x00000968,
+0x00000980,0x00000007,0x0004003b,0x00000270,
+0x0000098a,0x00000007,0x0004003d,0x00000006,
+0x00000981,0x00000096,0x0004003d,0x00000006,
+0x00000982,0x00000097,0x00050082,0x00000006,
+0x00000983,0x00000981,0x00000982,0x00040070,
+0x0000008c,0x00000984,0x00000983,0x0004003d,
+0x00000006,0x00000985,0x00000098,0x0004003d,
+0x00000006,0x00000986,0x00000097,0x00050082,
+0x00000006,0x00000987,0x00000985,0x00000986,
+0x00040070,0x0000008c,0x00000988,0x00000987,
+0x00050088,0x0000008c,0x00000989,0x00000984,
+0x00000988,0x0003003e,0x00000980,0x00000989,
+0x0004003d,0x0000008c,0x0000098b,0x00000980,
+0x00050085,0x0000008c,0x0000098d,0x0000098b,
+0x0000098c,0x0008000c,0x0000008c,0x0000098e,
+0x00000001,0x0000002b,0x0000098d,0x00000977,
+0x0000098c,0x0006000c,0x0000008c,0x0000098f,
+0x00000001,0x00000001,0x0000098e,0x0004006e,
+0x00000059,0x00000990,0x0000098f,0x0003003e,
+0x0000098a,0x00000990,0x0004003d,0x00000059,
+0x00000992,0x0000098a,0x00050084,0x00000059,
+0x00000993,0x00000992,0x000000ed,0x000600cb,
+0x00000006,0x00000994,0x00000991,0x00000993,
+0x00000182,0x000200fe,0x00000994,0x00010038,
+0x00050036,0x00000002,0x0000009f,0x00000000,
+0x0000009b,0x00030037,0x00000009,0x0000009c,
+0x00030037,0x00000009,0x0000009d,0x00030037,
+0x00000009,0x0000009e,0x000200f8,0x000000a0,
+0x0004003b,0x00000009,0x00000997,0x00000007,
+0x0004003b,0x00000009,0x0000099e,0x00000007,
+0x0004003b,0x00000009,0x000009a1,0x00000007,
+0x0004003b,0x00000061,0x000009ad,0x00000007,
+0x0004003b,0x0000008e,0x000009b3,0x00000007,
+0x0004003b,0x0000008e,0x000009bb,0x00000007,
+0x0004003b,0x000009c4,0x000009c5,0x00000007,
+0x0004003b,0x0000008e,0x000009e3,0x00000007,
+0x0004003b,0x00000968,0x000009f0,0x00000007,
+0x0004003b,0x0000008e,0x000009ff,0x00000007,
+0x0004003b,0x00000968,0x00000a0c,0x00000007,
+0x0004003b,0x00000968,0x00000a11,0x00000007,
+0x0004003b,0x00000968,0x00000a14,0x00000007,
+0x0004003b,0x00000012,0x00000a17,0x00000007,
+0x0004003b,0x00000012,0x00000a25,0x00000007,
+0x0004003d,0x00000008,0x00000998,0x0000009c,
+0x0007015d,0x00000008,0x00000999,0x000000b9,
+0x00000003,0x00000998,0x00000171,0x00060050,
+0x00000008,0x0000099a,0x000000b0,0x000000b0,
+0x000000b0,0x00050080,0x00000008,0x0000099b,
+0x00000999,0x0000099a,0x00060050,0x00000060,
+0x0000099c,0x000000ed,0x000000ed,0x000000ed,
+0x000500c2,0x00000008,0x0000099d,0x0000099b,
+0x0000099c,0x0003003e,0x00000997,0x0000099d,
+0x0004003d,0x00000008,0x0000099f,0x0000009c,
+0x00070162,0x00000008,0x000009a0,0x000000b9,
+0x00000003,0x0000099f,0x00000171,0x0003003e,
+0x0000099e,0x000009a0,0x0004003d,0x00000008,
+0x000009a2,0x0000009c,0x00070165,0x00000008,
+0x000009a3,0x000000b9,0x00000003,0x000009a2,
+0x00000171,0x0003003e,0x000009a1,0x000009a3,
+0x0004003d,0x00000008,0x000009a4,0x0000099e,
+0x0004003d,0x00000008,0x000009a5,0x000009a1,
+0x000500aa,0x00000630,0x000009a6,0x000009a4,
+0x000009a5,0x0004009b,0x000000d0,0x000009a7,
+0x000009a6,0x000300f7,0x000009a9,0x00000000,
+0x000400fa,0x000009a7,0x000009a8,0x000009a9,
+0x000200f8,0x000009a8,0x0004003d,0x00000008,
+0x000009aa,0x0000099e,0x0003003e,0x0000009d,
+0x000009aa,0x0004003d,0x00000008,0x000009ab,
+0x0000099e,0x0003003e,0x0000009e,0x000009ab,
+0x000100fd,0x000200f8,0x000009a9,0x0004003d,
+0x00000008,0x000009ae,0x0000009c,0x0004007c,
+0x00000060,0x000009af,0x000009ae,0x0004003d,
+0x00000008,0x000009b0,0x00000997,0x0004007c,
+0x00000060,0x000009b1,0x000009b0,0x00050082,
+0x00000060,0x000009b2,0x000009af,0x000009b1,
+0x0003003e,0x000009ad,0x000009b2,0x00050041,
+0x00000270,0x000009b4,0x000009ad,0x000000c0,
+0x0004003d,0x00000059,0x000009b5,0x000009b4,
+0x0004003d,0x00000060,0x000009b6,0x000009ad,
+0x00060050,0x00000060,0x000009b7,0x000009b5,
+0x000009b5,0x000009b5,0x00050084,0x00000060,
+0x000009b8,0x000009b7,0x000009b6,0x0007015d,
+0x00000060,0x000009b9,0x000000b9,0x00000003,
+0x000009b8,0x00000171,0x0004006f,0x0000008d,
+0x000009ba,0x000009b9,0x0003003e,0x000009b3,
+0x000009ba,0x0004003d,0x00000060,0x000009bc,
+0x000009ad,0x0008004f,0x00000060,0x000009bd,
+0x000009bc,0x000009bc,0x00000001,0x00000001,
+0x00000002,0x0004003d,0x00000060,0x000009be,
+0x000009ad,0x0008004f,0x00000060,0x000009bf,
+0x000009be,0x000009be,0x00000001,0x00000002,
+0x00000002,0x00050084,0x00000060,0x000009c0,
+0x000009bd,0x000009bf,0x0007015d,0x00000060,
+0x000009c1,0x000000b9,0x00000003,0x000009c0,
+0x00000171,0x0004006f,0x0000008d,0x000009c2,
+0x000009c1,0x0003003e,0x000009bb,0x000009c2,
+0x0004003d,0x0000008d,0x000009c6,0x000009b3,
+0x00050041,0x00000968,0x000009c7,0x000009b3,
+0x000000c3,0x0004003d,0x0000008c,0x000009c8,
+0x000009c7,0x0004003d,0x0000008d,0x000009c9,
+0x000009bb,0x0007004f,0x000005f9,0x000009ca,
+0x000009c9,0x000009c9,0x00000000,0x00000001,
+0x00050051,0x0000008c,0x000009cb,0x000009ca,
+0x00000000,0x00050051,0x0000008c,0x000009cc,
+0x000009ca,0x00000001,0x00060050,0x0000008d,
+0x000009cd,0x000009c8,0x000009cb,0x000009cc,
+0x00050041,0x00000968,0x000009ce,0x000009b3,
+0x000000b5,0x0004003d,0x0000008c,0x000009cf,
+0x000009ce,0x0004003d,0x0000008d,0x000009d0,
+0x000009bb,0x0007004f,0x000005f9,0x000009d1,
+0x000009d0,0x000009d0,0x00000001,0x00000002,
+0x00050051,0x0000008c,0x000009d2,0x000009d1,
+0x00000000,0x00050051,0x0000008c,0x000009d3,
+0x000009d1,0x00000001,0x00060050,0x0000008d,
+0x000009d4,0x000009cf,0x000009d2,0x000009d3,
+0x00050051,0x0000008c,0x000009d6,0x000009c6,
+0x00000000,0x00050051,0x0000008c,0x000009d7,
+0x000009c6,0x00000001,0x00050051,0x0000008c,
+0x000009d8,0x000009c6,0x00000002,0x00050051,
+0x0000008c,0x000009d9,0x000009cd,0x00000000,
+0x00050051,0x0000008c,0x000009da,0x000009cd,
+0x00000001,0x00050051,0x0000008c,0x000009db,
+0x000009cd,0x00000002,0x00050051,0x0000008c,
+0x000009dc,0x000009d4,0x00000000,0x00050051,
+0x0000008c,0x000009dd,0x000009d4,0x00000001,
+0x00050051,0x0000008c,0x000009de,0x000009d4,
+0x00000002,0x00060050,0x0000008d,0x000009df,
+0x000009d6,0x000009d7,0x000009d8,0x00060050,
+0x0000008d,0x000009e0,0x000009d9,0x000009da,
+0x000009db,0x00060050,0x0000008d,0x000009e1,
+0x000009dc,0x000009dd,0x000009de,0x00060050,
+0x000009c3,0x000009e2,0x000009df,0x000009e0,
+0x000009e1,0x0003003e,0x000009c5,0x000009e2,
+0x0004003d,0x000009c3,0x000009e4,0x000009c5,
+0x0004003d,0x000009c3,0x000009e5,0x000009c5,
+0x0004003d,0x000009c3,0x000009e6,0x000009c5,
+0x0004003d,0x000009c3,0x000009e7,0x000009c5,
+0x0004003d,0x00000008,0x000009e8,0x000009a1,
+0x0004003d,0x00000008,0x000009e9,0x0000099e,
+0x00050082,0x00000008,0x000009ea,0x000009e8,
+0x000009e9,0x00040070,0x0000008d,0x000009eb,
+0x000009ea,0x00050091,0x0000008d,0x000009ec,
+0x000009e7,0x000009eb,0x00050091,0x0000008d,
+0x000009ed,0x000009e6,0x000009ec,0x00050091,
+0x0000008d,0x000009ee,0x000009e5,0x000009ed,
+0x00050091,0x0000008d,0x000009ef,0x000009e4,
+0x000009ee,0x0003003e,0x000009e3,0x000009ef,
+0x00050041,0x00000968,0x000009f1,0x000009e3,
+0x000000c0,0x0004003d,0x0000008c,0x000009f2,
+0x000009f1,0x0006000c,0x0000008c,0x000009f3,
+0x00000001,0x00000004,0x000009f2,0x00050041,
+0x00000968,0x000009f4,0x000009e3,0x000000c3,
+0x0004003d,0x0000008c,0x000009f5,0x000009f4,
+0x0006000c,0x0000008c,0x000009f6,0x00000001,
+0x00000004,0x000009f5,0x0007000c,0x0000008c,
+0x000009f7,0x00000001,0x00000028,0x000009f3,
+0x000009f6,0x00050041,0x00000968,0x000009f8,
+0x000009e3,0x000000b5,0x0004003d,0x0000008c,
+0x000009f9,0x000009f8,0x0006000c,0x0000008c,
+0x000009fa,0x00000001,0x00000004,0x000009f9,
+0x0007000c,0x0000008c,0x000009fb,0x00000001,
+0x00000028,0x000009f7,0x000009fa,0x0003003e,
+0x000009f0,0x000009fb,0x0004003d,0x0000008c,
+0x000009fc,0x000009f0,0x000500b8,0x000000d0,
+0x000009fe,0x000009fc,0x000009fd,0x000300f7,
+0x00000a01,0x00000000,0x000400fa,0x000009fe,
+0x00000a00,0x00000a06,0x000200f8,0x00000a00,
+0x0003003e,0x000009ff,0x00000a05,0x000200f9,
+0x00000a01,0x000200f8,0x00000a06,0x0004003d,
+0x0000008d,0x00000a07,0x000009e3,0x0004003d,
+0x0000008c,0x00000a08,0x000009f0,0x00060050,
+0x0000008d,0x00000a09,0x00000a08,0x00000a08,
+0x00000a08,0x00050088,0x0000008d,0x00000a0a,
+0x00000a07,0x00000a09,0x0003003e,0x000009ff,
+0x00000a0a,0x000200f9,0x00000a01,0x000200f8,
+0x00000a01,0x0004003d,0x0000008d,0x00000a0b,
+0x000009ff,0x0003003e,0x000009e3,0x00000a0b,
+0x0004003d,0x00000008,0x00000a0d,0x0000009c,
+0x00040070,0x0000008d,0x00000a0e,0x00000a0d,
+0x0004003d,0x0000008d,0x00000a0f,0x000009e3,
+0x00050094,0x0000008c,0x00000a10,0x00000a0e,
+0x00000a0f,0x0003003e,0x00000a0c,0x00000a10,
+0x0004003d,0x0000008c,0x00000a12,0x00000a0c,
+0x00070163,0x0000008c,0x00000a13,0x000000b9,
+0x00000003,0x00000a12,0x00000171,0x0003003e,
+0x00000a11,0x00000a13,0x0004003d,0x0000008c,
+0x00000a15,0x00000a0c,0x00070166,0x0000008c,
+0x00000a16,0x000000b9,0x00000003,0x00000a15,
+0x00000171,0x0003003e,0x00000a14,0x00000a16,
+0x0004003d,0x0000008c,0x00000a18,0x00000a0c,
+0x0004003d,0x0000008c,0x00000a19,0x00000a11,
+0x000500b4,0x000000d0,0x00000a1a,0x00000a18,
+0x00000a19,0x0004003d,0x00000006,0x00000a1d,
+0x00000a1c,0x000600a9,0x00000006,0x00000a1e,
+0x00000a1a,0x00000a1d,0x000000c0,0x0004003d,
+0x0000008c,0x00000a1f,0x00000a0c,0x0004003d,
+0x0000008c,0x00000a20,0x00000a14,0x000500b4,
+0x000000d0,0x00000a21,0x00000a1f,0x00000a20,
+0x0004003d,0x00000006,0x00000a22,0x00000a1c,
+0x000600a9,0x00000006,0x00000a23,0x00000a21,
+0x00000a22,0x000000c0,0x00050050,0x00000011,
+0x00000a24,0x00000a1e,0x00000a23,0x0003003e,
+0x00000a17,0x00000a24,0x0004003d,0x00000011,
+0x00000a26,0x00000a17,0x00070165,0x00000011,
+0x00000a27,0x000000b9,0x00000003,0x00000a26,
+0x00000171,0x0003003e,0x00000a25,0x00000a27,
+0x0004003d,0x00000008,0x00000a28,0x0000009c,
+0x00050041,0x00000007,0x00000a29,0x00000a25,
+0x000000c0,0x0004003d,0x00000006,0x00000a2a,
+0x00000a29,0x00060159,0x00000008,0x00000a2b,
+0x000000b9,0x00000a28,0x00000a2a,0x0003003e,
+0x0000009d,0x00000a2b,0x0004003d,0x00000008,
+0x00000a2c,0x0000009c,0x00050041,0x00000007,
+0x00000a2d,0x00000a25,0x000000c3,0x0004003d,
+0x00000006,0x00000a2e,0x00000a2d,0x00060159,
+0x00000008,0x00000a2f,0x000000b9,0x00000a2c,
+0x00000a2e,0x0003003e,0x0000009e,0x00000a2f,
+0x000100fd,0x00010038,0x00050036,0x00000011,
+0x000000a4,0x00000000,0x000000a1,0x00030037,
+0x00000007,0x000000a2,0x00030037,0x00000007,
+0x000000a3,0x000200f8,0x000000a5,0x0004003b,
+0x00000007,0x00000a30,0x00000007,0x0004003b,
+0x00000007,0x00000a33,0x00000007,0x0004003b,
+0x00000007,0x00000a36,0x00000007,0x0004003b,
+0x00000007,0x00000a3a,0x00000007,0x0004003b,
+0x00000007,0x00000a3d,0x00000007,0x0004003b,
+0x00000007,0x00000a3f,0x00000007,0x0004003b,
+0x00000007,0x00000a41,0x00000007,0x0004003b,
+0x00000012,0x00000a46,0x00000007,0x0004003b,
+0x00000007,0x00000a49,0x00000007,0x0004003b,
+0x00000007,0x00000a57,0x00000007,0x0004003b,
+0x00000012,0x00000a62,0x00000007,0x0004003d,
+0x00000006,0x00000a31,0x000000a2,0x00070162,
+0x00000006,0x00000a32,0x000000b9,0x00000003,
+0x00000a31,0x00000171,0x0003003e,0x00000a30,
+0x00000a32,0x0004003d,0x00000006,0x00000a34,
+0x000000a2,0x00070165,0x00000006,0x00000a35,
+0x000000b9,0x00000003,0x00000a34,0x00000171,
+0x0003003e,0x00000a33,0x00000a35,0x0004003d,
+0x00000006,0x00000a37,0x00000a30,0x0004003d,
+0x00000006,0x00000a38,0x00000a33,0x000500ab,
+0x000000d0,0x00000a39,0x00000a37,0x00000a38,
+0x000300f7,0x00000a3c,0x00000000,0x000400fa,
+0x00000a39,0x00000a3b,0x00000a44,0x000200f8,
+0x00000a3b,0x0004003d,0x00000006,0x00000a3e,
+0x000000a2,0x0003003e,0x00000a3d,0x00000a3e,
+0x0004003d,0x00000006,0x00000a40,0x00000a30,
+0x0003003e,0x00000a3f,0x00000a40,0x0004003d,
+0x00000006,0x00000a42,0x00000a33,0x0003003e,
+0x00000a41,0x00000a42,0x00070039,0x00000006,
+0x00000a43,0x00000099,0x00000a3d,0x00000a3f,
+0x00000a41,0x0003003e,0x00000a3a,0x00000a43,
+0x000200f9,0x00000a3c,0x000200f8,0x00000a44,
+0x0003003e,0x00000a3a,0x000000c0,0x000200f9,
+0x00000a3c,0x000200f8,0x00000a3c,0x0004003d,
+0x00000006,0x00000a45,0x00000a3a,0x0003003e,
+0x00000a36,0x00000a45,0x0004003d,0x00000006,
+0x00000a47,0x000000a3,0x000500b0,0x000000d0,
+0x00000a48,0x00000a47,0x000000b8,0x000300f7,
+0x00000a4b,0x00000000,0x000400fa,0x00000a48,
+0x00000a4a,0x00000a4c,0x000200f8,0x00000a4a,
+0x0003003e,0x00000a49,0x000000c0,0x000200f9,
+0x00000a4b,0x000200f8,0x00000a4c,0x0004003d,
+0x00000006,0x00000a4d,0x00000a36,0x000500c4,
+0x00000006,0x00000a4e,0x00000a4d,0x000008bc,
+0x0004003d,0x00000006,0x00000a50,0x000000a3,
+0x00050084,0x00000006,0x00000a51,0x00000a4f,
+0x00000a50,0x00050080,0x00000006,0x00000a52,
+0x00000a51,0x00000443,0x000500c2,0x00000006,
+0x00000a53,0x00000a4e,0x00000a52,0x0003003e,
+0x00000a49,0x00000a53,0x000200f9,0x00000a4b,
+0x000200f8,0x00000a4b,0x0004003d,0x00000006,
+0x00000a54,0x00000a49,0x0004003d,0x00000006,
+0x00000a55,0x000000a3,0x000500ac,0x000000d0,
+0x00000a56,0x00000a55,0x000000b8,0x000300f7,
+0x00000a59,0x00000000,0x000400fa,0x00000a56,
+0x00000a58,0x00000a5a,0x000200f8,0x00000a58,
+0x0003003e,0x00000a57,0x000000c0,0x000200f9,
+0x00000a59,0x000200f8,0x00000a5a,0x0004003d,
+0x00000006,0x00000a5b,0x00000a36,0x0004003d,
+0x00000006,0x00000a5c,0x000000a3,0x00050084,
+0x00000006,0x00000a5d,0x000000b9,0x00000a5c,
+0x00050080,0x00000006,0x00000a5e,0x00000a5d,
+0x00000171,0x000500c4,0x00000006,0x00000a5f,
+0x00000a5b,0x00000a5e,0x0003003e,0x00000a57,
+0x00000a5f,0x000200f9,0x00000a59,0x000200f8,
+0x00000a59,0x0004003d,0x00000006,0x00000a60,
+0x00000a57,0x00050050,0x00000011,0x00000a61,
+0x00000a54,0x00000a60,0x0003003e,0x00000a46,
+0x00000a61,0x0004003d,0x00000011,0x00000a63,
+0x00000a46,0x00070168,0x00000011,0x00000a64,
+0x000000b9,0x00000003,0x00000a63,0x00000171,
+0x0003003e,0x00000a62,0x00000a64,0x0004003d,
+0x00000006,0x00000a65,0x00000a33,0x000500c7,
+0x00000006,0x00000a66,0x00000a65,0x000006b5,
+0x0004003d,0x00000006,0x00000a67,0x00000a30,
+0x000500c7,0x00000006,0x00000a68,0x00000a67,
+0x000006b5,0x000500c4,0x00000006,0x00000a69,
+0x00000a68,0x000005bf,0x000500c5,0x00000006,
+0x00000a6a,0x00000a66,0x00000a69,0x00050041,
+0x00000007,0x00000a6b,0x00000a62,0x000000c3,
+0x0004003d,0x00000006,0x00000a6c,0x00000a6b,
+0x000500c5,0x00000006,0x00000a6d,0x00000a6a,
+0x00000a6c,0x00050041,0x00000007,0x00000a6e,
+0x00000a62,0x000000c0,0x0004003d,0x00000006,
+0x00000a6f,0x00000a6e,0x00050050,0x00000011,
+0x00000a70,0x00000a6d,0x00000a6f,0x000200fe,
+0x00000a70,0x00010038,0x00050036,0x00000006,
+0x000000a8,0x00000000,0x000000a6,0x00030037,
+0x00000009,0x000000a7,0x000200f8,0x000000a9,
+0x0004003b,0x00000009,0x00000a73,0x00000007,
+0x0004003d,0x00000008,0x00000a74,0x000000a7,
+0x00040070,0x0000008d,0x00000a75,0x00000a74,
+0x00050085,0x0000008d,0x00000a79,0x00000a75,
+0x00000a78,0x00050088,0x0000008d,0x00000a7c,
+0x00000a79,0x00000a7b,0x0006000c,0x0000008d,
+0x00000a7d,0x00000001,0x00000001,0x00000a7c,
+0x0004006d,0x00000008,0x00000a7e,0x00000a7d,
+0x0003003e,0x00000a73,0x00000a7e,0x00050041,
+0x00000007,0x00000a7f,0x00000a73,0x000000c0,
+0x0004003d,0x00000006,0x00000a80,0x00000a7f,
+0x000500c4,0x00000006,0x00000a81,0x00000a80,
+0x000001aa,0x00050041,0x00000007,0x00000a82,
+0x00000a73,0x000000c3,0x0004003d,0x00000006,
+0x00000a83,0x00000a82,0x000500c4,0x00000006,
+0x00000a84,0x00000a83,0x000000f3,0x000500c5,
+0x00000006,0x00000a85,0x00000a81,0x00000a84,
+0x00050041,0x00000007,0x00000a86,0x00000a73,
+0x000000b5,0x0004003d,0x00000006,0x00000a87,
+0x00000a86,0x000500c5,0x00000006,0x00000a88,
+0x00000a85,0x00000a87,0x000200fe,0x00000a88,
+0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_2D.inl
new file mode 100644
index 00000000000..d9bf0ad6a6e
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_2D.inl
@@ -0,0 +1,4246 @@
+0x07230203,0x00010300,0x000d000a,0x00000b15,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000003d,0x00020011,0x00000041,0x00020011,
+0x00000043,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0009000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000a1b,
+0x00000a8b,0x00000a8d,0x00000a9a,0x00060010,
+0x00000004,0x00000011,0x00000040,0x00000001,
+0x00000001,0x00030003,0x00000002,0x000001c2,
+0x000a0004,0x475f4c47,0x4c474f4f,0x70635f45,
+0x74735f70,0x5f656c79,0x656e696c,0x7269645f,
+0x69746365,0x00006576,0x00080004,0x475f4c47,
+0x4c474f4f,0x6e695f45,0x64756c63,0x69645f65,
+0x74636572,0x00657669,0x00090004,0x4b5f4c47,
+0x735f5248,0x65646168,0x75735f72,0x6f726762,
+0x625f7075,0x63697361,0x00000000,0x000a0004,
+0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,
+0x6f726762,0x635f7075,0x7473756c,0x64657265,
+0x00000000,0x00090004,0x4b5f4c47,0x735f5248,
+0x65646168,0x75735f72,0x6f726762,0x735f7075,
+0x66667568,0x0000656c,0x00040005,0x00000004,
+0x6e69616d,0x00000000,0x00080005,0x0000000d,
+0x45746567,0x646f636e,0x53676e69,0x28657a69,
+0x763b3175,0x003b3375,0x00040005,0x0000000b,
+0x566d756e,0x00736c61,0x00050005,0x0000000c,
+0x6f636e65,0x676e6964,0x00000000,0x000a0005,
+0x00000016,0x63747361,0x6f636544,0x49726564,
+0x6974696e,0x7a696c61,0x75762865,0x75763b34,
+0x00003b32,0x00050005,0x00000014,0x636f6c62,
+0x7461446b,0x00000061,0x00050005,0x00000015,
+0x636f6c62,0x7a69536b,0x00005f65,0x00080005,
+0x0000001c,0x72747865,0x42746361,0x28737469,
+0x3b347576,0x753b3175,0x00003b31,0x00040005,
+0x00000019,0x61746164,0x00000000,0x00040005,
+0x0000001a,0x7366666f,0x00007465,0x00040005,
+0x0000001b,0x426d756e,0x00737469,0x00080005,
+0x00000023,0x6f636564,0x45436564,0x3175284d,
+0x3b31753b,0x753b3175,0x00003b31,0x00060005,
+0x0000001f,0x74726170,0x6f697469,0x646e496e,
+0x00007865,0x00060005,0x00000020,0x72617473,
+0x45664f74,0x61727478,0x006d6543,0x00060005,
+0x00000021,0x61746f74,0x646e456c,0x6e696f70,
+0x00007374,0x00070005,0x00000022,0x65736162,
+0x70646e45,0x746e696f,0x65646e49,0x00000078,
+0x00090005,0x0000002a,0x6f636564,0x72546564,
+0x76287469,0x753b3475,0x31753b31,0x3b31753b,
+0x00000000,0x00040005,0x00000026,0x61746164,
+0x00000000,0x00040005,0x00000027,0x7366666f,
+0x00007465,0x00040005,0x00000028,0x426d756e,
+0x00737469,0x00030005,0x00000029,0x00000069,
+0x00090005,0x00000030,0x6f636564,0x75516564,
+0x28746e69,0x3b347576,0x753b3175,0x31753b31,
+0x0000003b,0x00040005,0x0000002c,0x61746164,
+0x00000000,0x00040005,0x0000002d,0x7366666f,
+0x00007465,0x00040005,0x0000002e,0x426d756e,
+0x00737469,0x00030005,0x0000002f,0x00000069,
+0x000a0005,0x00000037,0x6f636564,0x57316564,
+0x68676965,0x75762874,0x75763b34,0x31753b33,
+0x3b31753b,0x00000000,0x00050005,0x00000033,
+0x67696577,0x61447468,0x00006174,0x00050005,
+0x00000034,0x6f636e65,0x676e6964,0x00000000,
+0x00050005,0x00000035,0x576d756e,0x68676965,
+0x00007374,0x00040005,0x00000036,0x65646e69,
+0x00000078,0x000e0005,0x00000042,0x65746e69,
+0x6c6f7072,0x57657461,0x68676965,0x76287374,
+0x763b3475,0x753b3375,0x31753b31,0x3b31753b,
+0x753b3175,0x75763b31,0x00003b32,0x00050005,
+0x0000003a,0x67696577,0x61447468,0x00006174,
+0x00050005,0x0000003b,0x6f636e65,0x676e6964,
+0x00000000,0x00050005,0x0000003c,0x576d756e,
+0x68676965,0x00007374,0x00040005,0x0000003d,
+0x65646e69,0x00000078,0x00050005,0x0000003e,
+0x64697267,0x74646957,0x00000068,0x00040005,
+0x0000003f,0x69727473,0x00006564,0x00040005,
+0x00000040,0x7366666f,0x00007465,0x00060005,
+0x00000041,0x63617266,0x6e6f6974,0x61506c61,
+0x00007472,0x00080005,0x00000047,0x6f636564,
+0x65576564,0x74686769,0x75762873,0x75763b34,
+0x00003b32,0x00050005,0x00000045,0x67696577,
+0x61447468,0x00006174,0x00050005,0x00000046,
+0x49736f70,0x6f6c426e,0x00006b63,0x00050005,
+0x0000004b,0x68736168,0x75283235,0x00003b31,
+0x00030005,0x0000004a,0x00000070,0x00090005,
+0x00000051,0x656c6573,0x61507463,0x74697472,
+0x286e6f69,0x763b3175,0x753b3275,0x00003b31,
+0x00040005,0x0000004e,0x64656573,0x00000000,
+0x00030005,0x0000004f,0x00736f70,0x00060005,
+0x00000050,0x506d756e,0x69747261,0x6e6f6974,
+0x00000073,0x000a0005,0x00000057,0x45746567,
+0x6f70646e,0x45746e69,0x646f636e,0x28676e69,
+0x753b3175,0x31753b31,0x0000003b,0x00080005,
+0x00000054,0x69617661,0x6c62616c,0x646e4565,
+0x6e696f70,0x74694274,0x00000073,0x00060005,
+0x00000055,0x456d756e,0x6f70646e,0x73746e69,
+0x00000000,0x00050005,0x00000056,0x75746361,
+0x69536c61,0x0000657a,0x00070005,0x0000005e,
+0x65756c62,0x746e6f43,0x74636172,0x34697628,
+0x0000003b,0x00030005,0x0000005d,0x00000076,
+0x00050005,0x00000064,0x286d7573,0x3b336976,
+0x00000000,0x00030005,0x00000063,0x00000076,
+0x00090005,0x00000069,0x54746962,0x736e6172,
+0x53726566,0x656e6769,0x69762864,0x69763b34,
+0x00003b34,0x00030005,0x00000067,0x00000061,
+0x00030005,0x00000068,0x00000062,0x000b0005,
+0x00000071,0x6f636564,0x6e456564,0x696f7064,
+0x2873746e,0x3b346976,0x3b346976,0x763b3175,
+0x763b3475,0x003b3475,0x00030005,0x0000006c,
+0x00004176,0x00030005,0x0000006d,0x00004276,
+0x00040005,0x0000006e,0x65646f6d,0x00000000,
+0x00030005,0x0000006f,0x00307065,0x00030005,
+0x00000070,0x00317065,0x000a0005,0x00000078,
+0x6f636564,0x45316564,0x6f70646e,0x28746e69,
+0x3b347576,0x753b3175,0x75763b31,0x00003b33,
+0x00040005,0x00000074,0x61746164,0x00000000,
+0x00050005,0x00000075,0x72617473,0x66664f74,
+0x00746573,0x00040005,0x00000076,0x65646e69,
+0x00000078,0x00050005,0x00000077,0x6f636e65,
+0x676e6964,0x00000000,0x00070005,0x0000007c,
+0x6c697562,0x74694264,0x6b73616d,0x3b317528,
+0x00000000,0x00040005,0x0000007b,0x73746962,
+0x00000000,0x00080005,0x00000080,0x63747361,
+0x6f636544,0x65546564,0x286c6578,0x3b327576,
+0x00000000,0x00050005,0x0000007f,0x49736f70,
+0x6f6c426e,0x00006b63,0x00070005,0x00000084,
+0x50746567,0x4432736f,0x61727241,0x69762879,
+0x00003b33,0x00030005,0x00000083,0x00736f70,
+0x00070005,0x00000089,0x6f636564,0x47526564,
+0x76284142,0x753b3275,0x00003b31,0x00050005,
+0x00000087,0x65786574,0x736f506c,0x00000000,
+0x00040005,0x00000088,0x6579616c,0x00000072,
+0x00090005,0x00000092,0x43746567,0x726f6c6f,
+0x65646e49,0x66762878,0x66763b33,0x66763b33,
+0x00003b33,0x00040005,0x0000008f,0x6f6c6f63,
+0x00000072,0x00050005,0x00000090,0x456e696d,
+0x6f70646e,0x00746e69,0x00050005,0x00000091,
+0x4578616d,0x6f70646e,0x00746e69,0x00080005,
+0x00000098,0x41746567,0x6168706c,0x65646e49,
+0x31752878,0x3b31753b,0x003b3175,0x00040005,
+0x00000095,0x68706c61,0x00000061,0x00050005,
+0x00000096,0x416e696d,0x6168706c,0x00000000,
+0x00050005,0x00000097,0x4178616d,0x6168706c,
+0x00000000,0x000a0005,0x0000009e,0x706d6f63,
+0x45657475,0x6f70646e,0x73746e69,0x33757628,
+0x3375763b,0x3375763b,0x0000003b,0x00050005,
+0x0000009b,0x43626772,0x726f6c6f,0x00000000,
+0x00050005,0x0000009c,0x456e696d,0x6f70646e,
+0x00746e69,0x00050005,0x0000009d,0x4578616d,
+0x6f70646e,0x00746e69,0x00070005,0x000000a3,
+0x6f636e65,0x6c416564,0x28616870,0x753b3175,
+0x00003b31,0x00040005,0x000000a1,0x756c6176,
+0x00000065,0x00040005,0x000000a2,0x65786574,
+0x0064496c,0x00080005,0x000000a7,0x6b636170,
+0x6f6c6f43,0x526f5472,0x36354247,0x75762835,
+0x00003b33,0x00040005,0x000000a6,0x6f6c6f63,
+0x00000072,0x00040005,0x000000a9,0x69427174,
+0x00007374,0x00050005,0x000000ca,0x63747361,
+0x636f6c42,0x0000006b,0x00050005,0x000000cd,
+0x636f6c62,0x7a69536b,0x00000065,0x00050005,
+0x000000d1,0x6f636564,0x72456564,0x00726f72,
+0x00050005,0x000000d3,0x64696f76,0x65747845,
+0x0000746e,0x00040005,0x000000df,0x73746962,
+0x00003130,0x00040005,0x000000e5,0x73746962,
+0x00003332,0x00040005,0x000000e9,0x34746962,
+0x00000000,0x00040005,0x000000ef,0x73746962,
+0x00003635,0x00040005,0x000000f4,0x73746962,
+0x00003837,0x00030005,0x000000f9,0x00000068,
+0x00050005,0x000000fe,0x6c617564,0x6e616c50,
+0x00000065,0x00030005,0x00000108,0x00000072,
+0x00060005,0x00000113,0x67696577,0x72477468,
+0x69536469,0x0000657a,0x00060005,0x0000016f,
+0x67696577,0x6e457468,0x69646f63,0x0000676e,
+0x00050005,0x00000186,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000189,0x576d756e,
+0x68676965,0x00007374,0x00060005,0x00000192,
+0x67696577,0x61447468,0x69536174,0x0000657a,
+0x00040005,0x00000193,0x61726170,0x0000006d,
+0x00040005,0x00000195,0x61726170,0x0000006d,
+0x00060005,0x000001a6,0x506d756e,0x69747261,
+0x6e6f6974,0x00000073,0x00060005,0x000001b0,
+0x74726170,0x6f697469,0x6565536e,0x00000064,
+0x00030005,0x000001c1,0x00000069,0x00030005,
+0x000001c6,0x0000006a,0x00040005,0x000001cd,
+0x72617473,0x00000074,0x00050005,0x000001e0,
+0x4c6d756e,0x6942776f,0x00007374,0x00040005,
+0x000001e3,0x42776f6c,0x00737469,0x00050005,
+0x000001ec,0x68676968,0x73746942,0x00000000,
+0x00030005,0x00000203,0x006d6563,0x00050005,
+0x0000020e,0x536d6563,0x63656c65,0x00726f74,
+0x00040005,0x00000213,0x65736162,0x006d6543,
+0x00080005,0x0000021e,0x70646e65,0x746e696f,
+0x72655073,0x74726150,0x6f697469,0x0000006e,
+0x00060005,0x0000022c,0x657a6973,0x7845664f,
+0x43617274,0x00006d65,0x00050005,0x00000234,
+0x72747865,0x6d654361,0x00000000,0x00040005,
+0x00000235,0x61726170,0x0000006d,0x00040005,
+0x00000237,0x61726170,0x0000006d,0x00040005,
+0x00000239,0x61726170,0x0000006d,0x00040005,
+0x0000023c,0x6c6c7566,0x006d6543,0x00040005,
+0x00000241,0x6c61566d,0x00006575,0x00040005,
+0x00000249,0x6c615663,0x00736575,0x00050005,
+0x00000261,0x65736162,0x73616c43,0x00000073,
+0x00050005,0x00000270,0x6d756e69,0x73746942,
+0x00000000,0x00040005,0x00000273,0x636f6c62,
+0x0000006b,0x00040005,0x0000027a,0x61726170,
+0x0000006d,0x00040005,0x0000027c,0x61726170,
+0x0000006d,0x00040005,0x0000027d,0x61726170,
+0x0000006d,0x00050005,0x0000027f,0x6b636170,
+0x72546465,0x00737469,0x00040005,0x000002a2,
+0x42776f6c,0x00737469,0x00040005,0x000002a3,
+0x61726170,0x0000006d,0x00040005,0x000002a5,
+0x61726170,0x0000006d,0x00040005,0x000002a7,
+0x61726170,0x0000006d,0x00030005,0x000002ab,
+0x0000006a,0x00040005,0x000002b9,0x6f636564,
+0x00646564,0x00050005,0x000003a3,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x000003b1,
+0x6d756e69,0x73746942,0x00000000,0x00040005,
+0x000003b4,0x636f6c62,0x0000006b,0x00040005,
+0x000003b8,0x61726170,0x0000006d,0x00040005,
+0x000003ba,0x61726170,0x0000006d,0x00040005,
+0x000003bc,0x61726170,0x0000006d,0x00060005,
+0x000003be,0x6b636170,0x75516465,0x73746e69,
+0x00000000,0x00040005,0x000003d0,0x42776f6c,
+0x00737469,0x00040005,0x000003dc,0x6f636564,
+0x00646564,0x00050005,0x00000414,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000428,
+0x426d756e,0x00737469,0x00040005,0x00000430,
+0x7366666f,0x00007465,0x00030005,0x00000437,
+0x00000077,0x00040005,0x0000043a,0x61726170,
+0x0000006d,0x00040005,0x0000043c,0x61726170,
+0x0000006d,0x00040005,0x0000043e,0x61726170,
+0x0000006d,0x00040005,0x00000440,0x61726170,
+0x0000006d,0x00050005,0x00000459,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000463,
+0x7366666f,0x00007465,0x00030005,0x0000046a,
+0x00000077,0x00040005,0x0000046d,0x61726170,
+0x0000006d,0x00040005,0x0000046f,0x61726170,
+0x0000006d,0x00040005,0x00000471,0x61726170,
+0x0000006d,0x00040005,0x00000473,0x61726170,
+0x0000006d,0x00050005,0x00000487,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000048c,
+0x7366666f,0x00007465,0x00030005,0x00000490,
+0x00000077,0x00040005,0x00000491,0x61726170,
+0x0000006d,0x00040005,0x00000493,0x61726170,
+0x0000006d,0x00040005,0x00000495,0x61726170,
+0x0000006d,0x00040005,0x00000498,0x75716e75,
+0x00746e61,0x00050005,0x000004a4,0x65646e69,
+0x6c626178,0x00000065,0x00060005,0x000004b9,
+0x67696577,0x6e497468,0x65636964,0x00000073,
+0x00040005,0x000004c7,0x67696577,0x00737468,
+0x00040005,0x000004c8,0x61726170,0x0000006d,
+0x00040005,0x000004ca,0x61726170,0x0000006d,
+0x00040005,0x000004cc,0x61726170,0x0000006d,
+0x00040005,0x000004ce,0x61726170,0x0000006d,
+0x00040005,0x000004d2,0x61726170,0x0000006d,
+0x00040005,0x000004d4,0x61726170,0x0000006d,
+0x00040005,0x000004d6,0x61726170,0x0000006d,
+0x00040005,0x000004d8,0x61726170,0x0000006d,
+0x00040005,0x000004dc,0x61726170,0x0000006d,
+0x00040005,0x000004de,0x61726170,0x0000006d,
+0x00040005,0x000004e0,0x61726170,0x0000006d,
+0x00040005,0x000004e2,0x61726170,0x0000006d,
+0x00040005,0x000004e6,0x61726170,0x0000006d,
+0x00040005,0x000004e8,0x61726170,0x0000006d,
+0x00040005,0x000004ea,0x61726170,0x0000006d,
+0x00040005,0x000004ec,0x61726170,0x0000006d,
+0x00030005,0x000004f1,0x00313177,0x00040005,
+0x000004f9,0x74636166,0x0073726f,0x00050005,
+0x00000518,0x6c616373,0x63614665,0x00726f74,
+0x00070005,0x00000523,0x6f6d6f68,0x656e6567,
+0x4373756f,0x64726f6f,0x00000073,0x00050005,
+0x00000526,0x64697267,0x726f6f43,0x00007364,
+0x00060005,0x00000532,0x65746e69,0x6c617267,
+0x74726150,0x00000000,0x00060005,0x00000536,
+0x63617266,0x6e6f6974,0x61506c61,0x00007472,
+0x00050005,0x0000053b,0x64697267,0x74646957,
+0x00000068,0x00030005,0x0000053e,0x00003076,
+0x00040005,0x00000546,0x67696577,0x00737468,
+0x00040005,0x0000054c,0x61726170,0x0000006d,
+0x00040005,0x0000054e,0x61726170,0x0000006d,
+0x00040005,0x00000550,0x61726170,0x0000006d,
+0x00040005,0x00000552,0x61726170,0x0000006d,
+0x00040005,0x00000554,0x61726170,0x0000006d,
+0x00040005,0x00000556,0x61726170,0x0000006d,
+0x00040005,0x00000557,0x61726170,0x0000006d,
+0x00040005,0x00000558,0x61726170,0x0000006d,
+0x00040005,0x0000055f,0x61726170,0x0000006d,
+0x00040005,0x00000561,0x61726170,0x0000006d,
+0x00040005,0x00000563,0x61726170,0x0000006d,
+0x00040005,0x00000565,0x61726170,0x0000006d,
+0x00040005,0x00000567,0x61726170,0x0000006d,
+0x00040005,0x00000569,0x61726170,0x0000006d,
+0x00040005,0x0000056a,0x61726170,0x0000006d,
+0x00040005,0x0000056b,0x61726170,0x0000006d,
+0x00040005,0x000005b5,0x6d756e72,0x00000000,
+0x00040005,0x000005b6,0x61726170,0x0000006d,
+0x00040005,0x000005b9,0x64656573,0x00000041,
+0x00040005,0x000005c5,0x64656573,0x00000042,
+0x00040005,0x000005d8,0x66696873,0x00317374,
+0x00040005,0x000005e3,0x66696873,0x00327374,
+0x00040005,0x000005f6,0x75736572,0x0000746c,
+0x00030005,0x0000064d,0x00000069,0x00050005,
+0x00000655,0x6f636e65,0x676e6964,0x00000000,
+0x00050005,0x00000663,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000666,0x61726170,
+0x0000006d,0x00040005,0x00000668,0x61726170,
+0x0000006d,0x00030005,0x000006c2,0x0000306c,
+0x00030005,0x000006cb,0x0000316c,0x00040005,
+0x000006e9,0x61726170,0x0000006d,0x00040005,
+0x000006eb,0x61726170,0x0000006d,0x00040005,
+0x00000738,0x61726170,0x0000006d,0x00040005,
+0x0000073c,0x61726170,0x0000006d,0x00040005,
+0x00000748,0x61726170,0x0000006d,0x00040005,
+0x0000074c,0x61726170,0x0000006d,0x00040005,
+0x00000754,0x61726170,0x0000006d,0x00040005,
+0x00000756,0x61726170,0x0000006d,0x00040005,
+0x0000075b,0x61726170,0x0000006d,0x00040005,
+0x00000772,0x61726170,0x0000006d,0x00040005,
+0x00000778,0x61726170,0x0000006d,0x00040005,
+0x00000782,0x426d756e,0x00737469,0x00040005,
+0x0000078a,0x7366666f,0x00007465,0x00030005,
+0x00000793,0x00007065,0x00040005,0x00000796,
+0x61726170,0x0000006d,0x00040005,0x00000798,
+0x61726170,0x0000006d,0x00040005,0x0000079a,
+0x61726170,0x0000006d,0x00040005,0x0000079c,
+0x61726170,0x0000006d,0x00050005,0x00000804,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x0000080e,0x7366666f,0x00007465,0x00030005,
+0x00000817,0x00007065,0x00040005,0x0000081a,
+0x61726170,0x0000006d,0x00040005,0x0000081c,
+0x61726170,0x0000006d,0x00040005,0x0000081e,
+0x61726170,0x0000006d,0x00040005,0x00000820,
+0x61726170,0x0000006d,0x00050005,0x00000832,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000837,0x7366666f,0x00007465,0x00030005,
+0x0000083d,0x00000077,0x00040005,0x0000083e,
+0x61726170,0x0000006d,0x00040005,0x00000840,
+0x61726170,0x0000006d,0x00040005,0x00000842,
+0x61726170,0x0000006d,0x00040005,0x00000845,
+0x75716e75,0x00746e61,0x00050005,0x00000852,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000860,0x426d756e,0x00737469,0x00040005,
+0x00000869,0x6b73616d,0x00000000,0x00050005,
+0x00000894,0x67696577,0x61447468,0x00006174,
+0x00040005,0x00000898,0x61726170,0x0000006d,
+0x00040005,0x0000089c,0x67696577,0x00737468,
+0x00040005,0x0000089d,0x61726170,0x0000006d,
+0x00060005,0x000008a0,0x74726170,0x6f697469,
+0x646e496e,0x00007865,0x00040005,0x000008a1,
+0x61726170,0x0000006d,0x00040005,0x000008a3,
+0x61726170,0x0000006d,0x00040005,0x000008a4,
+0x61726170,0x0000006d,0x00060005,0x000008a7,
+0x72617473,0x45664f74,0x61727478,0x006d6543,
+0x00060005,0x000008a8,0x61746f74,0x646e456c,
+0x6e696f70,0x00007374,0x00070005,0x000008a9,
+0x65736162,0x70646e45,0x746e696f,0x65646e49,
+0x00000078,0x00030005,0x000008aa,0x006d6563,
+0x00040005,0x000008ab,0x61726170,0x0000006d,
+0x00040005,0x000008ad,0x61726170,0x0000006d,
+0x00040005,0x000008ae,0x61726170,0x0000006d,
+0x00040005,0x000008af,0x61726170,0x0000006d,
+0x00060005,0x000008b9,0x70646e65,0x746e696f,
+0x61745373,0x00007472,0x00060005,0x000008bf,
+0x70646e65,0x746e696f,0x646e4573,0x00000000,
+0x00080005,0x000008c7,0x69617661,0x6c62616c,
+0x646e4565,0x6e696f70,0x74694274,0x00000073,
+0x00070005,0x000008cb,0x70646e65,0x746e696f,
+0x6f636e45,0x676e6964,0x00000000,0x00070005,
+0x000008cc,0x75746361,0x6e456c61,0x696f7064,
+0x6942746e,0x00007374,0x00040005,0x000008cd,
+0x61726170,0x0000006d,0x00040005,0x000008cf,
+0x61726170,0x0000006d,0x00040005,0x000008d1,
+0x61726170,0x0000006d,0x00070005,0x000008d4,
+0x456d756e,0x6f70646e,0x50746e69,0x73726961,
+0x00000000,0x00030005,0x000008d8,0x00004176,
+0x00030005,0x000008d9,0x00004276,0x00040005,
+0x000008da,0x61447065,0x00006174,0x00040005,
+0x000008df,0x61726170,0x0000006d,0x00030005,
+0x000008e2,0x00000069,0x00040005,0x000008eb,
+0x64497065,0x00000078,0x00040005,0x000008f1,
+0x61726170,0x0000006d,0x00040005,0x000008f3,
+0x61726170,0x0000006d,0x00040005,0x000008f5,
+0x61726170,0x0000006d,0x00040005,0x000008f7,
+0x61726170,0x0000006d,0x00040005,0x000008ff,
+0x61726170,0x0000006d,0x00040005,0x00000901,
+0x61726170,0x0000006d,0x00040005,0x00000903,
+0x61726170,0x0000006d,0x00040005,0x00000904,
+0x61726170,0x0000006d,0x00030005,0x0000090b,
+0x00307065,0x00030005,0x0000090c,0x00317065,
+0x00040005,0x0000090d,0x61726170,0x0000006d,
+0x00040005,0x0000090f,0x61726170,0x0000006d,
+0x00040005,0x00000911,0x61726170,0x0000006d,
+0x00040005,0x00000913,0x61726170,0x0000006d,
+0x00040005,0x00000914,0x61726170,0x0000006d,
+0x00070005,0x00000918,0x67696577,0x50737468,
+0x68437265,0x656e6e61,0x0000006c,0x00030005,
+0x0000091f,0x00736363,0x00040005,0x00000920,
+0x61726170,0x0000006d,0x00040005,0x00000922,
+0x61726170,0x0000006d,0x00040005,0x00000924,
+0x61726170,0x0000006d,0x00050005,0x0000093c,
+0x636f6c62,0x736f506b,0x00000000,0x00050005,
+0x0000093e,0x67616d69,0x6f666e49,0x00000000,
+0x00060006,0x0000093e,0x00000000,0x636f6c62,
+0x7a69536b,0x00000065,0x00060006,0x0000093e,
+0x00000001,0x65736162,0x6579614c,0x00000072,
+0x00060006,0x0000093e,0x00000002,0x6c616d73,
+0x6f6c426c,0x00006b63,0x00060005,0x00000940,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00050005,0x00000945,0x49736f70,0x6f6c426e,
+0x00006b63,0x00050005,0x0000094c,0x49637273,
+0x6567616d,0x00000000,0x00040005,0x00000955,
+0x61726170,0x0000006d,0x00040005,0x00000959,
+0x61726170,0x0000006d,0x00040005,0x0000095b,
+0x61726170,0x0000006d,0x00050005,0x00000963,
+0x6f6c6f63,0x6e694c72,0x00000065,0x00030005,
+0x00000968,0x00000078,0x00040005,0x00000972,
+0x65646e69,0x00000078,0x00030005,0x0000097f,
+0x00000078,0x00040005,0x00000989,0x65646e69,
+0x00000078,0x00050005,0x00000996,0x43677661,
+0x726f6c6f,0x00000000,0x00050005,0x0000099d,
+0x436e696d,0x726f6c6f,0x00000000,0x00050005,
+0x000009a0,0x4378616d,0x726f6c6f,0x00000000,
+0x00030005,0x000009ac,0x00007864,0x00040005,
+0x000009b2,0x31766f63,0x00000000,0x00040005,
+0x000009ba,0x32766f63,0x00000000,0x00040005,
+0x000009c4,0x4d766f63,0x00007461,0x00060005,
+0x000009e2,0x6e697270,0x61706963,0x6978416c,
+0x00000073,0x00040005,0x000009ef,0x6e67616d,
+0x00000000,0x00050005,0x00000a0b,0x74736964,
+0x65636e61,0x00000000,0x00050005,0x00000a10,
+0x446e696d,0x61747369,0x0065636e,0x00050005,
+0x00000a13,0x4478616d,0x61747369,0x0065636e,
+0x00040005,0x00000a16,0x69646e69,0x00736563,
+0x00080005,0x00000a1b,0x535f6c67,0x72676275,
+0x4970756f,0x636f766e,0x6f697461,0x0044496e,
+0x00050005,0x00000a24,0x4d6e696d,0x6e497861,
+0x00786564,0x00050005,0x00000a2f,0x566e696d,
+0x65756c61,0x00000000,0x00050005,0x00000a32,
+0x5678616d,0x65756c61,0x00000000,0x00040005,
+0x00000a35,0x65646e69,0x00000078,0x00040005,
+0x00000a3c,0x61726170,0x0000006d,0x00040005,
+0x00000a3e,0x61726170,0x0000006d,0x00040005,
+0x00000a40,0x61726170,0x0000006d,0x00040005,
+0x00000a45,0x6b73616d,0x00000000,0x00040005,
+0x00000a61,0x6b636170,0x00006465,0x00040005,
+0x00000a72,0x6e617571,0x00000074,0x00040005,
+0x00000a8a,0x61636f6c,0x0064496c,0x00060005,
+0x00000a8b,0x535f6c67,0x72676275,0x4970756f,
+0x00000044,0x00060005,0x00000a8d,0x535f6c67,
+0x72676275,0x5370756f,0x00657a69,0x00040005,
+0x00000a92,0x636f6c62,0x0064496b,0x00040005,
+0x00000a95,0x65786574,0x0064496c,0x00050005,
+0x00000a98,0x65786574,0x6f6f436c,0x00006472,
+0x00060005,0x00000a9a,0x575f6c67,0x476b726f,
+0x70756f72,0x00004449,0x00040005,0x00000aad,
+0x6579616c,0x00000072,0x00060005,0x00000ab4,
+0x72727563,0x54746e65,0x6c657865,0x00000000,
+0x00040005,0x00000ab5,0x61726170,0x0000006d,
+0x00040005,0x00000ab7,0x61726170,0x0000006d,
+0x00050005,0x00000aba,0x456e696d,0x6f70646e,
+0x00746e69,0x00050005,0x00000abb,0x4578616d,
+0x6f70646e,0x00746e69,0x00040005,0x00000abc,
+0x61726170,0x0000006d,0x00040005,0x00000abf,
+0x61726170,0x0000006d,0x00040005,0x00000ac0,
+0x61726170,0x0000006d,0x00050005,0x00000ac4,
+0x70646e65,0x746e696f,0x00000073,0x00040005,
+0x00000ac5,0x61726170,0x0000006d,0x00040005,
+0x00000ac8,0x61726170,0x0000006d,0x00040005,
+0x00000acc,0x65646e69,0x00000078,0x00040005,
+0x00000adb,0x61726170,0x0000006d,0x00040005,
+0x00000adc,0x61726170,0x0000006d,0x00040005,
+0x00000add,0x61726170,0x0000006d,0x00040005,
+0x00000aea,0x75736572,0x0000746c,0x00040005,
+0x00000aeb,0x61726170,0x0000006d,0x00040005,
+0x00000aee,0x61726170,0x0000006d,0x00050005,
+0x00000b06,0x49747364,0x6567616d,0x00000000,
+0x00040005,0x00000b11,0x61726170,0x0000006d,
+0x00050048,0x0000093e,0x00000000,0x00000023,
+0x00000000,0x00050048,0x0000093e,0x00000001,
+0x00000023,0x00000008,0x00050048,0x0000093e,
+0x00000002,0x00000023,0x0000000c,0x00030047,
+0x0000093e,0x00000002,0x00040047,0x0000094c,
+0x00000022,0x00000000,0x00040047,0x0000094c,
+0x00000021,0x00000000,0x00030047,0x0000094c,
+0x00000018,0x00030047,0x00000a1b,0x00000000,
+0x00040047,0x00000a1b,0x0000000b,0x00000029,
+0x00030047,0x00000a1c,0x00000000,0x00030047,
+0x00000a21,0x00000000,0x00030047,0x00000a23,
+0x00000000,0x00040047,0x00000a8b,0x0000000b,
+0x00000028,0x00030047,0x00000a8d,0x00000000,
+0x00040047,0x00000a8d,0x0000000b,0x00000024,
+0x00030047,0x00000a8e,0x00000000,0x00030047,
+0x00000a90,0x00000000,0x00040047,0x00000a9a,
+0x0000000b,0x0000001a,0x00040047,0x00000b06,
+0x00000022,0x00000000,0x00040047,0x00000b06,
+0x00000021,0x00000001,0x00030047,0x00000b06,
+0x00000019,0x00040047,0x00000b14,0x0000000b,
+0x00000019,0x00020013,0x00000002,0x00030021,
+0x00000003,0x00000002,0x00040015,0x00000006,
+0x00000020,0x00000000,0x00040020,0x00000007,
+0x00000007,0x00000006,0x00040017,0x00000008,
+0x00000006,0x00000003,0x00040020,0x00000009,
+0x00000007,0x00000008,0x00050021,0x0000000a,
+0x00000006,0x00000007,0x00000009,0x00040017,
+0x0000000f,0x00000006,0x00000004,0x00040020,
+0x00000010,0x00000007,0x0000000f,0x00040017,
+0x00000011,0x00000006,0x00000002,0x00040020,
+0x00000012,0x00000007,0x00000011,0x00050021,
+0x00000013,0x00000002,0x00000010,0x00000012,
+0x00060021,0x00000018,0x00000006,0x00000010,
+0x00000007,0x00000007,0x00070021,0x0000001e,
+0x00000006,0x00000007,0x00000007,0x00000007,
+0x00000007,0x00070021,0x00000025,0x00000006,
+0x00000010,0x00000007,0x00000007,0x00000007,
+0x00070021,0x00000032,0x00000006,0x00000010,
+0x00000009,0x00000007,0x00000007,0x000b0021,
+0x00000039,0x00000006,0x00000010,0x00000009,
+0x00000007,0x00000007,0x00000007,0x00000007,
+0x00000007,0x00000012,0x00050021,0x00000044,
+0x00000011,0x00000010,0x00000011,0x00040021,
+0x00000049,0x00000006,0x00000007,0x00060021,
+0x0000004d,0x00000006,0x00000007,0x00000012,
+0x00000007,0x00060021,0x00000053,0x00000008,
+0x00000007,0x00000007,0x00000007,0x00040015,
+0x00000059,0x00000020,0x00000001,0x00040017,
+0x0000005a,0x00000059,0x00000004,0x00040020,
+0x0000005b,0x00000007,0x0000005a,0x00040021,
+0x0000005c,0x0000005a,0x0000005b,0x00040017,
+0x00000060,0x00000059,0x00000003,0x00040020,
+0x00000061,0x00000007,0x00000060,0x00040021,
+0x00000062,0x00000059,0x00000061,0x00050021,
+0x00000066,0x00000002,0x0000005b,0x0000005b,
+0x00080021,0x0000006b,0x00000002,0x0000005b,
+0x0000005b,0x00000007,0x00000010,0x00000010,
+0x00070021,0x00000073,0x00000006,0x00000010,
+0x00000007,0x00000007,0x00000009,0x00040021,
+0x0000007a,0x0000000f,0x00000007,0x00040021,
+0x0000007e,0x0000000f,0x00000011,0x00040021,
+0x00000082,0x00000060,0x00000061,0x00050021,
+0x00000086,0x0000000f,0x00000012,0x00000007,
+0x00030016,0x0000008b,0x00000020,0x00040017,
+0x0000008c,0x0000008b,0x00000003,0x00040020,
+0x0000008d,0x00000007,0x0000008c,0x00060021,
+0x0000008e,0x00000006,0x0000008d,0x0000008d,
+0x0000008d,0x00060021,0x00000094,0x00000006,
+0x00000007,0x00000007,0x00000007,0x00060021,
+0x0000009a,0x00000002,0x00000009,0x00000009,
+0x00000009,0x00050021,0x000000a0,0x00000011,
+0x00000007,0x00000007,0x00040021,0x000000a5,
+0x00000006,0x00000009,0x0004002b,0x00000006,
+0x000000af,0x00000008,0x0004002b,0x00000006,
+0x000000b0,0x00000007,0x0005002c,0x00000011,
+0x000000b1,0x000000af,0x000000b0,0x0004002b,
+0x00000006,0x000000b3,0x00000004,0x0004002b,
+0x00000006,0x000000b4,0x00000002,0x0005002c,
+0x00000011,0x000000b5,0x000000b3,0x000000b4,
+0x0004002b,0x00000006,0x000000b7,0x00000005,
+0x0004002b,0x00000006,0x000000b8,0x00000003,
+0x0005002c,0x00000011,0x000000b9,0x000000b7,
+0x000000b8,0x0004002b,0x00000006,0x000000bf,
+0x00000000,0x0004002b,0x00000006,0x000000c2,
+0x00000001,0x00040020,0x000000c9,0x00000006,
+0x0000000f,0x0004003b,0x000000c9,0x000000ca,
+0x00000006,0x00040020,0x000000cc,0x00000006,
+0x00000011,0x0004003b,0x000000cc,0x000000cd,
+0x00000006,0x00020014,0x000000cf,0x00040020,
+0x000000d0,0x00000006,0x000000cf,0x0004003b,
+0x000000d0,0x000000d1,0x00000006,0x0003002a,
+0x000000cf,0x000000d2,0x0004003b,0x000000d0,
+0x000000d3,0x00000006,0x00040020,0x000000d4,
+0x00000006,0x00000006,0x0004002b,0x00000006,
+0x000000d7,0x000001ff,0x0004002b,0x00000006,
+0x000000d9,0x000001fc,0x0004002b,0x00000059,
+0x000000e2,0x00000000,0x0004002b,0x00000059,
+0x000000e3,0x00000002,0x0004002b,0x00000059,
+0x000000ec,0x00000004,0x0004002b,0x00000059,
+0x000000ed,0x00000001,0x0004002b,0x00000059,
+0x000000f2,0x00000005,0x0004002b,0x00000059,
+0x000000f7,0x00000007,0x0004002b,0x00000059,
+0x000000fc,0x00000009,0x0004003b,0x000000d0,
+0x000000fe,0x00000006,0x0004002b,0x00000059,
+0x00000101,0x0000000a,0x0004003b,0x000000cc,
+0x00000113,0x00000006,0x0004002b,0x00000006,
+0x00000114,0x0000000c,0x0004002b,0x00000006,
+0x0000011e,0x00000006,0x0004002b,0x00000006,
+0x0000012a,0x0000000a,0x0005002c,0x00000011,
+0x0000012b,0x0000011e,0x0000012a,0x0005002c,
+0x00000011,0x00000131,0x0000012a,0x0000011e,
+0x00030029,0x000000cf,0x00000133,0x00040017,
+0x00000168,0x000000cf,0x00000002,0x00040020,
+0x0000016e,0x00000006,0x00000008,0x0004003b,
+0x0000016e,0x0000016f,0x00000006,0x0004002b,
+0x00000006,0x00000170,0x00000010,0x0004001c,
+0x00000171,0x00000008,0x00000170,0x0006002c,
+0x00000008,0x00000172,0x000000bf,0x000000bf,
+0x000000bf,0x0006002c,0x00000008,0x00000173,
+0x000000bf,0x000000bf,0x000000c2,0x0006002c,
+0x00000008,0x00000174,0x000000c2,0x000000bf,
+0x000000bf,0x0006002c,0x00000008,0x00000175,
+0x000000bf,0x000000bf,0x000000b4,0x0006002c,
+0x00000008,0x00000176,0x000000bf,0x000000c2,
+0x000000bf,0x0006002c,0x00000008,0x00000177,
+0x000000c2,0x000000bf,0x000000c2,0x0006002c,
+0x00000008,0x00000178,0x000000bf,0x000000bf,
+0x000000b8,0x0006002c,0x00000008,0x00000179,
+0x000000bf,0x000000c2,0x000000c2,0x0006002c,
+0x00000008,0x0000017a,0x000000c2,0x000000bf,
+0x000000b4,0x0006002c,0x00000008,0x0000017b,
+0x000000bf,0x000000bf,0x000000b3,0x0006002c,
+0x00000008,0x0000017c,0x000000bf,0x000000c2,
+0x000000b4,0x0006002c,0x00000008,0x0000017d,
+0x000000c2,0x000000bf,0x000000b8,0x0006002c,
+0x00000008,0x0000017e,0x000000bf,0x000000bf,
+0x000000b7,0x0013002c,0x00000171,0x0000017f,
+0x00000172,0x00000172,0x00000173,0x00000174,
+0x00000175,0x00000176,0x00000177,0x00000178,
+0x00000172,0x00000172,0x00000179,0x0000017a,
+0x0000017b,0x0000017c,0x0000017d,0x0000017e,
+0x0004002b,0x00000059,0x00000181,0x00000003,
+0x00040020,0x00000185,0x00000007,0x00000171,
+0x0004003b,0x000000d4,0x00000189,0x00000006,
+0x0004003b,0x000000d4,0x00000192,0x00000006,
+0x0004002b,0x00000006,0x00000199,0x00000018,
+0x0004002b,0x00000006,0x0000019c,0x00000060,
+0x0004002b,0x00000006,0x000001a0,0x00000040,
+0x0004003b,0x000000d4,0x000001a6,0x00000006,
+0x0004002b,0x00000059,0x000001a9,0x0000000b,
+0x0004003b,0x000000d4,0x000001b0,0x00000006,
+0x0004002b,0x00000059,0x000001b3,0x0000000d,
+0x0004002b,0x00000006,0x000001c3,0x00000020,
+0x0004002b,0x00000006,0x000001cf,0x0000001f,
+0x0004002b,0x00000006,0x00000200,0x00000080,
+0x0004002b,0x00000059,0x00000211,0x00000017,
+0x0004002b,0x00000059,0x00000216,0x00000019,
+0x00040020,0x0000026f,0x00000007,0x00000059,
+0x0007002c,0x0000005a,0x000002b3,0x000000e3,
+0x000000ec,0x000000f2,0x000000f7,0x0004002b,
+0x00000006,0x000002ba,0x00000100,0x0004001c,
+0x000002bb,0x00000006,0x000002ba,0x0004002b,
+0x00000006,0x000002bc,0x00000021,0x0004002b,
+0x00000006,0x000002bd,0x00000009,0x0004002b,
+0x00000006,0x000002be,0x00000022,0x0004002b,
+0x00000006,0x000002bf,0x00000028,0x0004002b,
+0x00000006,0x000002c0,0x00000029,0x0004002b,
+0x00000006,0x000002c1,0x0000002a,0x0004002b,
+0x00000006,0x000002c2,0x00000011,0x0004002b,
+0x00000006,0x000002c3,0x00000012,0x0004002b,
+0x00000006,0x000002c4,0x00000024,0x0004002b,
+0x00000006,0x000002c5,0x00000014,0x0004002b,
+0x00000006,0x000002c6,0x00000015,0x0004002b,
+0x00000006,0x000002c7,0x00000016,0x0004002b,
+0x00000006,0x000002c8,0x00000025,0x0004002b,
+0x00000006,0x000002c9,0x00000019,0x0004002b,
+0x00000006,0x000002ca,0x0000001a,0x0004002b,
+0x00000006,0x000002cb,0x00000026,0x0004002b,
+0x00000006,0x000002cc,0x00000280,0x0004002b,
+0x00000006,0x000002cd,0x00000281,0x0004002b,
+0x00000006,0x000002ce,0x00000282,0x0004002b,
+0x00000006,0x000002cf,0x000002a0,0x0004002b,
+0x00000006,0x000002d0,0x00000041,0x0004002b,
+0x00000006,0x000002d1,0x00000042,0x0004002b,
+0x00000006,0x000002d2,0x00000044,0x0004002b,
+0x00000006,0x000002d3,0x00000045,0x0004002b,
+0x00000006,0x000002d4,0x00000046,0x0004002b,
+0x00000006,0x000002d5,0x00000061,0x0004002b,
+0x00000006,0x000002d6,0x00000048,0x0004002b,
+0x00000006,0x000002d7,0x00000049,0x0004002b,
+0x00000006,0x000002d8,0x0000004a,0x0004002b,
+0x00000006,0x000002d9,0x00000062,0x0004002b,
+0x00000006,0x000002da,0x00000068,0x0004002b,
+0x00000006,0x000002db,0x00000069,0x0004002b,
+0x00000006,0x000002dc,0x0000006a,0x0004002b,
+0x00000006,0x000002dd,0x00000050,0x0004002b,
+0x00000006,0x000002de,0x00000051,0x0004002b,
+0x00000006,0x000002df,0x00000052,0x0004002b,
+0x00000006,0x000002e0,0x00000064,0x0004002b,
+0x00000006,0x000002e1,0x00000054,0x0004002b,
+0x00000006,0x000002e2,0x00000055,0x0004002b,
+0x00000006,0x000002e3,0x00000056,0x0004002b,
+0x00000006,0x000002e4,0x00000065,0x0004002b,
+0x00000006,0x000002e5,0x00000058,0x0004002b,
+0x00000006,0x000002e6,0x00000059,0x0004002b,
+0x00000006,0x000002e7,0x0000005a,0x0004002b,
+0x00000006,0x000002e8,0x00000066,0x0004002b,
+0x00000006,0x000002e9,0x00000284,0x0004002b,
+0x00000006,0x000002ea,0x00000285,0x0004002b,
+0x00000006,0x000002eb,0x00000286,0x0004002b,
+0x00000006,0x000002ec,0x000002a1,0x0004002b,
+0x00000006,0x000002ed,0x00000081,0x0004002b,
+0x00000006,0x000002ee,0x00000082,0x0004002b,
+0x00000006,0x000002ef,0x000000a0,0x0004002b,
+0x00000006,0x000002f0,0x00000084,0x0004002b,
+0x00000006,0x000002f1,0x00000085,0x0004002b,
+0x00000006,0x000002f2,0x00000086,0x0004002b,
+0x00000006,0x000002f3,0x000000a1,0x0004002b,
+0x00000006,0x000002f4,0x00000088,0x0004002b,
+0x00000006,0x000002f5,0x00000089,0x0004002b,
+0x00000006,0x000002f6,0x0000008a,0x0004002b,
+0x00000006,0x000002f7,0x000000a2,0x0004002b,
+0x00000006,0x000002f8,0x000000a8,0x0004002b,
+0x00000006,0x000002f9,0x000000a9,0x0004002b,
+0x00000006,0x000002fa,0x000000aa,0x0004002b,
+0x00000006,0x000002fb,0x00000090,0x0004002b,
+0x00000006,0x000002fc,0x00000091,0x0004002b,
+0x00000006,0x000002fd,0x00000092,0x0004002b,
+0x00000006,0x000002fe,0x000000a4,0x0004002b,
+0x00000006,0x000002ff,0x00000094,0x0004002b,
+0x00000006,0x00000300,0x00000095,0x0004002b,
+0x00000006,0x00000301,0x00000096,0x0004002b,
+0x00000006,0x00000302,0x000000a5,0x0004002b,
+0x00000006,0x00000303,0x00000098,0x0004002b,
+0x00000006,0x00000304,0x00000099,0x0004002b,
+0x00000006,0x00000305,0x0000009a,0x0004002b,
+0x00000006,0x00000306,0x000000a6,0x0004002b,
+0x00000006,0x00000307,0x00000288,0x0004002b,
+0x00000006,0x00000308,0x00000289,0x0004002b,
+0x00000006,0x00000309,0x0000028a,0x0004002b,
+0x00000006,0x0000030a,0x000002a2,0x0004002b,
+0x00000006,0x0000030b,0x00000200,0x0004002b,
+0x00000006,0x0000030c,0x00000201,0x0004002b,
+0x00000006,0x0000030d,0x00000202,0x0004002b,
+0x00000006,0x0000030e,0x00000220,0x0004002b,
+0x00000006,0x0000030f,0x00000204,0x0004002b,
+0x00000006,0x00000310,0x00000205,0x0004002b,
+0x00000006,0x00000311,0x00000206,0x0004002b,
+0x00000006,0x00000312,0x00000221,0x0004002b,
+0x00000006,0x00000313,0x00000208,0x0004002b,
+0x00000006,0x00000314,0x00000209,0x0004002b,
+0x00000006,0x00000315,0x0000020a,0x0004002b,
+0x00000006,0x00000316,0x00000222,0x0004002b,
+0x00000006,0x00000317,0x00000228,0x0004002b,
+0x00000006,0x00000318,0x00000229,0x0004002b,
+0x00000006,0x00000319,0x0000022a,0x0004002b,
+0x00000006,0x0000031a,0x00000210,0x0004002b,
+0x00000006,0x0000031b,0x00000211,0x0004002b,
+0x00000006,0x0000031c,0x00000212,0x0004002b,
+0x00000006,0x0000031d,0x00000224,0x0004002b,
+0x00000006,0x0000031e,0x00000214,0x0004002b,
+0x00000006,0x0000031f,0x00000215,0x0004002b,
+0x00000006,0x00000320,0x00000216,0x0004002b,
+0x00000006,0x00000321,0x00000225,0x0004002b,
+0x00000006,0x00000322,0x00000218,0x0004002b,
+0x00000006,0x00000323,0x00000219,0x0004002b,
+0x00000006,0x00000324,0x0000021a,0x0004002b,
+0x00000006,0x00000325,0x00000226,0x0004002b,
+0x00000006,0x00000326,0x000002a8,0x0004002b,
+0x00000006,0x00000327,0x000002a9,0x0004002b,
+0x00000006,0x00000328,0x000002aa,0x0004002b,
+0x00000006,0x00000329,0x00000101,0x0004002b,
+0x00000006,0x0000032a,0x00000102,0x0004002b,
+0x00000006,0x0000032b,0x00000120,0x0004002b,
+0x00000006,0x0000032c,0x00000104,0x0004002b,
+0x00000006,0x0000032d,0x00000105,0x0004002b,
+0x00000006,0x0000032e,0x00000106,0x0004002b,
+0x00000006,0x0000032f,0x00000121,0x0004002b,
+0x00000006,0x00000330,0x00000108,0x0004002b,
+0x00000006,0x00000331,0x00000109,0x0004002b,
+0x00000006,0x00000332,0x0000010a,0x0004002b,
+0x00000006,0x00000333,0x00000122,0x0004002b,
+0x00000006,0x00000334,0x00000128,0x0004002b,
+0x00000006,0x00000335,0x00000129,0x0004002b,
+0x00000006,0x00000336,0x0000012a,0x0004002b,
+0x00000006,0x00000337,0x00000110,0x0004002b,
+0x00000006,0x00000338,0x00000111,0x0004002b,
+0x00000006,0x00000339,0x00000112,0x0004002b,
+0x00000006,0x0000033a,0x00000124,0x0004002b,
+0x00000006,0x0000033b,0x00000114,0x0004002b,
+0x00000006,0x0000033c,0x00000115,0x0004002b,
+0x00000006,0x0000033d,0x00000116,0x0004002b,
+0x00000006,0x0000033e,0x00000125,0x0004002b,
+0x00000006,0x0000033f,0x00000118,0x0004002b,
+0x00000006,0x00000340,0x00000119,0x0004002b,
+0x00000006,0x00000341,0x0000011a,0x0004002b,
+0x00000006,0x00000342,0x00000126,0x0004002b,
+0x00000006,0x00000343,0x00000290,0x0004002b,
+0x00000006,0x00000344,0x00000291,0x0004002b,
+0x00000006,0x00000345,0x00000292,0x0004002b,
+0x00000006,0x00000346,0x000002a4,0x0004002b,
+0x00000006,0x00000347,0x00000140,0x0004002b,
+0x00000006,0x00000348,0x00000141,0x0004002b,
+0x00000006,0x00000349,0x00000142,0x0004002b,
+0x00000006,0x0000034a,0x00000160,0x0004002b,
+0x00000006,0x0000034b,0x00000144,0x0004002b,
+0x00000006,0x0000034c,0x00000145,0x0004002b,
+0x00000006,0x0000034d,0x00000146,0x0004002b,
+0x00000006,0x0000034e,0x00000161,0x0004002b,
+0x00000006,0x0000034f,0x00000148,0x0004002b,
+0x00000006,0x00000350,0x00000149,0x0004002b,
+0x00000006,0x00000351,0x0000014a,0x0004002b,
+0x00000006,0x00000352,0x00000162,0x0004002b,
+0x00000006,0x00000353,0x00000168,0x0004002b,
+0x00000006,0x00000354,0x00000169,0x0004002b,
+0x00000006,0x00000355,0x0000016a,0x0004002b,
+0x00000006,0x00000356,0x00000150,0x0004002b,
+0x00000006,0x00000357,0x00000151,0x0004002b,
+0x00000006,0x00000358,0x00000152,0x0004002b,
+0x00000006,0x00000359,0x00000164,0x0004002b,
+0x00000006,0x0000035a,0x00000154,0x0004002b,
+0x00000006,0x0000035b,0x00000155,0x0004002b,
+0x00000006,0x0000035c,0x00000156,0x0004002b,
+0x00000006,0x0000035d,0x00000165,0x0004002b,
+0x00000006,0x0000035e,0x00000158,0x0004002b,
+0x00000006,0x0000035f,0x00000159,0x0004002b,
+0x00000006,0x00000360,0x0000015a,0x0004002b,
+0x00000006,0x00000361,0x00000166,0x0004002b,
+0x00000006,0x00000362,0x00000294,0x0004002b,
+0x00000006,0x00000363,0x00000295,0x0004002b,
+0x00000006,0x00000364,0x00000296,0x0004002b,
+0x00000006,0x00000365,0x000002a5,0x0004002b,
+0x00000006,0x00000366,0x00000180,0x0004002b,
+0x00000006,0x00000367,0x00000181,0x0004002b,
+0x00000006,0x00000368,0x00000182,0x0004002b,
+0x00000006,0x00000369,0x000001a0,0x0004002b,
+0x00000006,0x0000036a,0x00000184,0x0004002b,
+0x00000006,0x0000036b,0x00000185,0x0004002b,
+0x00000006,0x0000036c,0x00000186,0x0004002b,
+0x00000006,0x0000036d,0x000001a1,0x0004002b,
+0x00000006,0x0000036e,0x00000188,0x0004002b,
+0x00000006,0x0000036f,0x00000189,0x0004002b,
+0x00000006,0x00000370,0x0000018a,0x0004002b,
+0x00000006,0x00000371,0x000001a2,0x0004002b,
+0x00000006,0x00000372,0x000001a8,0x0004002b,
+0x00000006,0x00000373,0x000001a9,0x0004002b,
+0x00000006,0x00000374,0x000001aa,0x0004002b,
+0x00000006,0x00000375,0x00000190,0x0004002b,
+0x00000006,0x00000376,0x00000191,0x0004002b,
+0x00000006,0x00000377,0x00000192,0x0004002b,
+0x00000006,0x00000378,0x000001a4,0x0004002b,
+0x00000006,0x00000379,0x00000194,0x0004002b,
+0x00000006,0x0000037a,0x00000195,0x0004002b,
+0x00000006,0x0000037b,0x00000196,0x0004002b,
+0x00000006,0x0000037c,0x000001a5,0x0004002b,
+0x00000006,0x0000037d,0x00000198,0x0004002b,
+0x00000006,0x0000037e,0x00000199,0x0004002b,
+0x00000006,0x0000037f,0x0000019a,0x0004002b,
+0x00000006,0x00000380,0x000001a6,0x0004002b,
+0x00000006,0x00000381,0x00000298,0x0004002b,
+0x00000006,0x00000382,0x00000299,0x0004002b,
+0x00000006,0x00000383,0x0000029a,0x0004002b,
+0x00000006,0x00000384,0x000002a6,0x0004002b,
+0x00000006,0x00000385,0x00000240,0x0004002b,
+0x00000006,0x00000386,0x00000241,0x0004002b,
+0x00000006,0x00000387,0x00000242,0x0004002b,
+0x00000006,0x00000388,0x00000260,0x0004002b,
+0x00000006,0x00000389,0x00000244,0x0004002b,
+0x00000006,0x0000038a,0x00000245,0x0004002b,
+0x00000006,0x0000038b,0x00000246,0x0004002b,
+0x00000006,0x0000038c,0x00000261,0x0004002b,
+0x00000006,0x0000038d,0x00000248,0x0004002b,
+0x00000006,0x0000038e,0x00000249,0x0004002b,
+0x00000006,0x0000038f,0x0000024a,0x0004002b,
+0x00000006,0x00000390,0x00000262,0x0004002b,
+0x00000006,0x00000391,0x00000268,0x0004002b,
+0x00000006,0x00000392,0x00000269,0x0004002b,
+0x00000006,0x00000393,0x0000026a,0x0004002b,
+0x00000006,0x00000394,0x00000250,0x0004002b,
+0x00000006,0x00000395,0x00000251,0x0004002b,
+0x00000006,0x00000396,0x00000252,0x0004002b,
+0x00000006,0x00000397,0x00000264,0x0004002b,
+0x00000006,0x00000398,0x00000254,0x0004002b,
+0x00000006,0x00000399,0x00000255,0x0004002b,
+0x00000006,0x0000039a,0x00000256,0x0004002b,
+0x00000006,0x0000039b,0x00000265,0x0004002b,
+0x00000006,0x0000039c,0x00000258,0x0004002b,
+0x00000006,0x0000039d,0x00000259,0x0004002b,
+0x00000006,0x0000039e,0x0000025a,0x0004002b,
+0x00000006,0x0000039f,0x00000266,0x0103002c,
+0x000002bb,0x000003a0,0x000000bf,0x000000c2,
+0x000000b4,0x000001c3,0x000000b3,0x000000b7,
+0x0000011e,0x000002bc,0x000000af,0x000002bd,
+0x0000012a,0x000002be,0x000002bf,0x000002c0,
+0x000002c1,0x000002be,0x00000170,0x000002c2,
+0x000002c3,0x000002c4,0x000002c5,0x000002c6,
+0x000002c7,0x000002c8,0x00000199,0x000002c9,
+0x000002ca,0x000002cb,0x000002cc,0x000002cd,
+0x000002ce,0x000002cf,0x000001a0,0x000002d0,
+0x000002d1,0x0000019c,0x000002d2,0x000002d3,
+0x000002d4,0x000002d5,0x000002d6,0x000002d7,
+0x000002d8,0x000002d9,0x000002da,0x000002db,
+0x000002dc,0x000002d9,0x000002dd,0x000002de,
+0x000002df,0x000002e0,0x000002e1,0x000002e2,
+0x000002e3,0x000002e4,0x000002e5,0x000002e6,
+0x000002e7,0x000002e8,0x000002e9,0x000002ea,
+0x000002eb,0x000002ec,0x00000200,0x000002ed,
+0x000002ee,0x000002ef,0x000002f0,0x000002f1,
+0x000002f2,0x000002f3,0x000002f4,0x000002f5,
+0x000002f6,0x000002f7,0x000002f8,0x000002f9,
+0x000002fa,0x000002f7,0x000002fb,0x000002fc,
+0x000002fd,0x000002fe,0x000002ff,0x00000300,
+0x00000301,0x00000302,0x00000303,0x00000304,
+0x00000305,0x00000306,0x00000307,0x00000308,
+0x00000309,0x0000030a,0x0000030b,0x0000030c,
+0x0000030d,0x0000030e,0x0000030f,0x00000310,
+0x00000311,0x00000312,0x00000313,0x00000314,
+0x00000315,0x00000316,0x00000317,0x00000318,
+0x00000319,0x00000316,0x0000031a,0x0000031b,
+0x0000031c,0x0000031d,0x0000031e,0x0000031f,
+0x00000320,0x00000321,0x00000322,0x00000323,
+0x00000324,0x00000325,0x00000326,0x00000327,
+0x00000328,0x0000030a,0x000002ba,0x00000329,
+0x0000032a,0x0000032b,0x0000032c,0x0000032d,
+0x0000032e,0x0000032f,0x00000330,0x00000331,
+0x00000332,0x00000333,0x00000334,0x00000335,
+0x00000336,0x00000333,0x00000337,0x00000338,
+0x00000339,0x0000033a,0x0000033b,0x0000033c,
+0x0000033d,0x0000033e,0x0000033f,0x00000340,
+0x00000341,0x00000342,0x00000343,0x00000344,
+0x00000345,0x00000346,0x00000347,0x00000348,
+0x00000349,0x0000034a,0x0000034b,0x0000034c,
+0x0000034d,0x0000034e,0x0000034f,0x00000350,
+0x00000351,0x00000352,0x00000353,0x00000354,
+0x00000355,0x00000352,0x00000356,0x00000357,
+0x00000358,0x00000359,0x0000035a,0x0000035b,
+0x0000035c,0x0000035d,0x0000035e,0x0000035f,
+0x00000360,0x00000361,0x00000362,0x00000363,
+0x00000364,0x00000365,0x00000366,0x00000367,
+0x00000368,0x00000369,0x0000036a,0x0000036b,
+0x0000036c,0x0000036d,0x0000036e,0x0000036f,
+0x00000370,0x00000371,0x00000372,0x00000373,
+0x00000374,0x00000371,0x00000375,0x00000376,
+0x00000377,0x00000378,0x00000379,0x0000037a,
+0x0000037b,0x0000037c,0x0000037d,0x0000037e,
+0x0000037f,0x00000380,0x00000381,0x00000382,
+0x00000383,0x00000384,0x00000385,0x00000386,
+0x00000387,0x00000388,0x00000389,0x0000038a,
+0x0000038b,0x0000038c,0x0000038d,0x0000038e,
+0x0000038f,0x00000390,0x00000391,0x00000392,
+0x00000393,0x00000390,0x00000394,0x00000395,
+0x00000396,0x00000397,0x00000398,0x00000399,
+0x0000039a,0x0000039b,0x0000039c,0x0000039d,
+0x0000039e,0x0000039f,0x00000326,0x00000327,
+0x00000328,0x00000384,0x00040020,0x000003a2,
+0x00000007,0x000002bb,0x0006002c,0x00000060,
+0x000003d6,0x000000e2,0x00000181,0x000000f2,
+0x0004001c,0x000003dd,0x00000006,0x00000200,
+0x0004002b,0x00000006,0x000003de,0x0000000b,
+0x0004002b,0x00000006,0x000003df,0x00000013,
+0x0004002b,0x00000006,0x000003e0,0x0000001b,
+0x0004002b,0x00000006,0x000003e1,0x0000001c,
+0x0004002b,0x00000006,0x000003e2,0x00000023,
+0x0004002b,0x00000006,0x000003e3,0x000000e4,
+0x0004002b,0x00000006,0x000003e4,0x00000043,
+0x0004002b,0x00000006,0x000003e5,0x0000004b,
+0x0004002b,0x00000006,0x000003e6,0x0000004c,
+0x0004002b,0x00000006,0x000003e7,0x0000010c,
+0x0004002b,0x00000006,0x000003e8,0x00000053,
+0x0004002b,0x00000006,0x000003e9,0x0000005b,
+0x0004002b,0x00000006,0x000003ea,0x0000005c,
+0x0004002b,0x00000006,0x000003eb,0x00000063,
+0x0004002b,0x00000006,0x000003ec,0x0000011c,
+0x0004002b,0x00000006,0x000003ed,0x00000123,
+0x0004002b,0x00000006,0x000003ee,0x00000083,
+0x0004002b,0x00000006,0x000003ef,0x00000103,
+0x0004002b,0x00000006,0x000003f0,0x0000008b,
+0x0004002b,0x00000006,0x000003f1,0x0000008c,
+0x0004002b,0x00000006,0x000003f2,0x0000010b,
+0x0004002b,0x00000006,0x000003f3,0x00000093,
+0x0004002b,0x00000006,0x000003f4,0x00000113,
+0x0004002b,0x00000006,0x000003f5,0x0000009b,
+0x0004002b,0x00000006,0x000003f6,0x0000009c,
+0x0004002b,0x00000006,0x000003f7,0x000000a3,
+0x0004002b,0x00000006,0x000003f8,0x0000011b,
+0x0004002b,0x00000006,0x000003f9,0x000000c0,
+0x0004002b,0x00000006,0x000003fa,0x000000c1,
+0x0004002b,0x00000006,0x000003fb,0x000000c2,
+0x0004002b,0x00000006,0x000003fc,0x000000c3,
+0x0004002b,0x00000006,0x000003fd,0x000000c4,
+0x0004002b,0x00000006,0x000003fe,0x000000e0,
+0x0004002b,0x00000006,0x000003ff,0x000000c8,
+0x0004002b,0x00000006,0x00000400,0x000000c9,
+0x0004002b,0x00000006,0x00000401,0x000000ca,
+0x0004002b,0x00000006,0x00000402,0x000000cb,
+0x0004002b,0x00000006,0x00000403,0x000000cc,
+0x0004002b,0x00000006,0x00000404,0x000000e1,
+0x0004002b,0x00000006,0x00000405,0x000000d0,
+0x0004002b,0x00000006,0x00000406,0x000000d1,
+0x0004002b,0x00000006,0x00000407,0x000000d2,
+0x0004002b,0x00000006,0x00000408,0x000000d3,
+0x0004002b,0x00000006,0x00000409,0x000000d4,
+0x0004002b,0x00000006,0x0000040a,0x000000e2,
+0x0004002b,0x00000006,0x0000040b,0x000000d8,
+0x0004002b,0x00000006,0x0000040c,0x000000d9,
+0x0004002b,0x00000006,0x0000040d,0x000000da,
+0x0004002b,0x00000006,0x0000040e,0x000000db,
+0x0004002b,0x00000006,0x0000040f,0x000000dc,
+0x0004002b,0x00000006,0x00000410,0x000000e3,
+0x0083002c,0x000003dd,0x00000411,0x000000bf,
+0x000000c2,0x000000b4,0x000000b8,0x000000b3,
+0x000001c3,0x000002c4,0x0000033a,0x000000af,
+0x000002bd,0x0000012a,0x000003de,0x00000114,
+0x000002bc,0x000002e0,0x0000033a,0x00000170,
+0x000002c2,0x000002c3,0x000003df,0x000002c5,
+0x000002be,0x000002fe,0x0000033a,0x00000199,
+0x000002c9,0x000002ca,0x000003e0,0x000003e1,
+0x000003e2,0x000003e3,0x0000033a,0x000001a0,
+0x000002d0,0x000002d1,0x000003e4,0x000002d2,
+0x0000019c,0x0000032c,0x0000032b,0x000002d6,
+0x000002d7,0x000002d8,0x000003e5,0x000003e6,
+0x000002d5,0x000003e7,0x0000032f,0x000002dd,
+0x000002de,0x000002df,0x000003e8,0x000002e1,
+0x000002d9,0x0000033b,0x00000333,0x000002e5,
+0x000002e6,0x000002e7,0x000003e9,0x000003ea,
+0x000003eb,0x000003ec,0x000003ed,0x00000200,
+0x000002ed,0x000002ee,0x000003ee,0x000002f0,
+0x000002ef,0x0000032a,0x000003ef,0x000002f4,
+0x000002f5,0x000002f6,0x000003f0,0x000003f1,
+0x000002f3,0x00000332,0x000003f2,0x000002fb,
+0x000002fc,0x000002fd,0x000003f3,0x000002ff,
+0x000002f7,0x00000339,0x000003f4,0x00000303,
+0x00000304,0x00000305,0x000003f5,0x000003f6,
+0x000003f7,0x00000341,0x000003f8,0x000003f9,
+0x000003fa,0x000003fb,0x000003fc,0x000003fd,
+0x000003fe,0x000002ba,0x00000329,0x000003ff,
+0x00000400,0x00000401,0x00000402,0x00000403,
+0x00000404,0x00000330,0x00000331,0x00000405,
+0x00000406,0x00000407,0x00000408,0x00000409,
+0x0000040a,0x00000337,0x00000338,0x0000040b,
+0x0000040c,0x0000040d,0x0000040e,0x0000040f,
+0x00000410,0x0000033f,0x00000340,0x00040020,
+0x00000413,0x00000007,0x000003dd,0x0004002b,
+0x00000006,0x00000442,0x0000002d,0x0004001c,
+0x00000443,0x00000006,0x00000442,0x0004002b,
+0x00000006,0x00000444,0x00000034,0x0004002b,
+0x00000006,0x00000445,0x00000027,0x0004002b,
+0x00000006,0x00000446,0x0000002f,0x0004002b,
+0x00000006,0x00000447,0x0000003b,0x0004002b,
+0x00000006,0x00000448,0x00000017,0x0004002b,
+0x00000006,0x00000449,0x00000035,0x0004002b,
+0x00000006,0x0000044a,0x00000038,0x0004002b,
+0x00000006,0x0000044b,0x00000030,0x0004002b,
+0x00000006,0x0000044c,0x0000003e,0x0004002b,
+0x00000006,0x0000044d,0x0000000d,0x0004002b,
+0x00000006,0x0000044e,0x00000033,0x0004002b,
+0x00000006,0x0000044f,0x0000001e,0x0030002c,
+0x00000443,0x00000450,0x000000bf,0x000001c3,
+0x000001a0,0x000000bf,0x000001a0,0x00000114,
+0x00000444,0x000002c9,0x00000445,0x000000bf,
+0x000001a0,0x000002c2,0x00000446,0x000000b7,
+0x00000447,0x00000448,0x000002c0,0x000003de,
+0x00000449,0x000003e1,0x000002c4,0x000000bf,
+0x000001a0,0x000000af,0x0000044a,0x00000170,
+0x0000044b,0x00000199,0x000002bf,0x000000b4,
+0x0000044c,0x000003de,0x00000449,0x000003df,
+0x00000442,0x000003e0,0x000002c8,0x000000b7,
+0x00000447,0x0000044d,0x0000044e,0x000002c7,
+0x000002c1,0x0000044f,0x000002be,0x00040020,
+0x00000458,0x00000007,0x00000443,0x0004001c,
+0x00000475,0x00000006,0x000003e2,0x0004002b,
+0x00000006,0x00000476,0x00000039,0x0004002b,
+0x00000006,0x00000477,0x0000000e,0x0004002b,
+0x00000006,0x00000478,0x00000032,0x0004002b,
+0x00000006,0x00000479,0x0000002b,0x0004002b,
+0x00000006,0x0000047a,0x0000003d,0x0004002b,
+0x00000006,0x0000047b,0x0000003a,0x0004002b,
+0x00000006,0x0000047c,0x00000037,0x0004002b,
+0x00000006,0x0000047d,0x0000001d,0x0026002c,
+0x00000475,0x0000047e,0x000000bf,0x00000170,
+0x000001c3,0x0000044b,0x000001a0,0x000000bf,
+0x000001a0,0x000000b0,0x00000476,0x00000477,
+0x00000478,0x000002c6,0x00000479,0x000003e1,
+0x000002c4,0x000000bf,0x000001a0,0x00000170,
+0x0000044b,0x000000b8,0x0000047a,0x000003df,
+0x00000442,0x0000011e,0x0000047b,0x00000448,
+0x000002c0,0x000002bd,0x0000047c,0x000002ca,
+0x000002cb,0x0000044d,0x0000044e,0x0000047d,
+0x000003e2,0x00040020,0x00000486,0x00000007,
+0x00000475,0x0004001c,0x00000499,0x00000011,
+0x0000011e,0x0004002b,0x00000006,0x0000049a,
+0x0000003f,0x0005002c,0x00000011,0x0000049b,
+0x0000049a,0x000000af,0x0005002c,0x00000011,
+0x0000049c,0x000002c6,0x000000af,0x0005002c,
+0x00000011,0x0000049d,0x000002bd,0x000000af,
+0x0005002c,0x00000011,0x0000049e,0x000000b4,
+0x000000b3,0x0005002c,0x00000011,0x0000049f,
+0x000000c2,0x000000af,0x0009002c,0x00000499,
+0x000004a0,0x0000049b,0x0000049c,0x0000049d,
+0x000000b5,0x0000049e,0x0000049f,0x00040020,
+0x000004a3,0x00000007,0x00000499,0x00040017,
+0x0000050d,0x0000008b,0x00000004,0x0004002b,
+0x0000008b,0x00000512,0x41000000,0x0004002b,
+0x00000006,0x00000519,0x00000400,0x0004002b,
+0x00000059,0x0000052e,0x00000006,0x00040017,
+0x0000052f,0x00000059,0x00000002,0x0004002b,
+0x00000006,0x00000538,0x0000000f,0x0005002c,
+0x00000011,0x00000547,0x000000bf,0x000000bf,
+0x0004002b,0x00000059,0x00000573,0x0000000f,
+0x0004002b,0x00000059,0x00000578,0x00000011,
+0x0004002b,0x00000059,0x00000589,0x00000010,
+0x0004002b,0x00000059,0x000005bf,0x00000008,
+0x0004002b,0x00000059,0x000005c2,0x0000000c,
+0x0004002b,0x00000059,0x000005c9,0x00000014,
+0x0004002b,0x00000059,0x000005cc,0x00000018,
+0x0004002b,0x00000059,0x000005cf,0x0000001c,
+0x00040017,0x000005f9,0x0000008b,0x00000002,
+0x0007002c,0x0000000f,0x00000617,0x00000477,
+0x0000012a,0x0000011e,0x000000b4,0x0007002c,
+0x0000000f,0x0000061a,0x0000049a,0x0000049a,
+0x0000049a,0x0000049a,0x00040017,0x00000630,
+0x000000cf,0x00000003,0x0004001c,0x00000656,
+0x00000008,0x000003df,0x0006002c,0x00000008,
+0x00000657,0x000000bf,0x000000bf,0x000000af,
+0x0006002c,0x00000008,0x00000658,0x000000c2,
+0x000000bf,0x0000011e,0x0006002c,0x00000008,
+0x00000659,0x000000bf,0x000000c2,0x000000b7,
+0x0006002c,0x00000008,0x0000065a,0x000000bf,
+0x000000bf,0x000000b0,0x0006002c,0x00000008,
+0x0000065b,0x000000c2,0x000000bf,0x000000b7,
+0x0006002c,0x00000008,0x0000065c,0x000000bf,
+0x000000c2,0x000000b3,0x0006002c,0x00000008,
+0x0000065d,0x000000bf,0x000000bf,0x0000011e,
+0x0006002c,0x00000008,0x0000065e,0x000000c2,
+0x000000bf,0x000000b3,0x0006002c,0x00000008,
+0x0000065f,0x000000bf,0x000000c2,0x000000b8,
+0x0016002c,0x00000656,0x00000660,0x00000657,
+0x00000658,0x00000659,0x0000065a,0x0000065b,
+0x0000065c,0x0000065d,0x0000065e,0x0000065f,
+0x0000017e,0x0000017d,0x0000017c,0x0000017b,
+0x0000017a,0x00000179,0x00000178,0x00000177,
+0x00000175,0x00000173,0x00040020,0x00000662,
+0x00000007,0x00000656,0x0004002b,0x00000059,
+0x00000697,0x00000080,0x0004002b,0x00000059,
+0x0000069f,0x0000003f,0x0004002b,0x00000006,
+0x000006b5,0x000000ff,0x0004002b,0x00000059,
+0x000006c8,0x000000c0,0x0004002b,0x00000059,
+0x000006d1,0x000000ff,0x0004002b,0x00000059,
+0x00000752,0xffffff80,0x0007002c,0x0000000f,
+0x00000780,0x000000bf,0x000000bf,0x000000bf,
+0x000000bf,0x0004002b,0x00000006,0x0000079e,
+0x0000017d,0x0004001c,0x0000079f,0x00000006,
+0x0000079e,0x0004002b,0x00000006,0x000007a0,
+0x000000ba,0x0004002b,0x00000006,0x000007a1,
+0x000000e8,0x0004002b,0x00000006,0x000007a2,
+0x0000002e,0x0004002b,0x00000006,0x000007a3,
+0x00000074,0x0004002b,0x00000006,0x000007a4,
+0x000000de,0x0004002b,0x00000006,0x000007a5,
+0x000000bd,0x0004002b,0x00000006,0x000007a6,
+0x000000f4,0x0004002b,0x00000006,0x000007a7,
+0x0000002c,0x0004002b,0x00000006,0x000007a8,
+0x0000004d,0x0004002b,0x00000006,0x000007a9,
+0x000000b2,0x0004002b,0x00000006,0x000007aa,
+0x0000006e,0x0004002b,0x00000006,0x000007ab,
+0x000000e9,0x0004002b,0x00000006,0x000007ac,
+0x000000a7,0x0004002b,0x00000006,0x000007ad,
+0x00000079,0x0004002b,0x00000006,0x000007ae,
+0x000000ef,0x0004002b,0x00000006,0x000007af,
+0x000000df,0x0004002b,0x00000006,0x000007b0,
+0x000000cf,0x0004002b,0x00000006,0x000007b1,
+0x000000be,0x0004002b,0x00000006,0x000007b2,
+0x000000ae,0x0004002b,0x00000006,0x000007b3,
+0x0000009e,0x0004002b,0x00000006,0x000007b4,
+0x00000071,0x0004002b,0x00000006,0x000007b5,
+0x0000008e,0x0004002b,0x00000006,0x000007b6,
+0x000000fa,0x0004002b,0x00000006,0x000007b7,
+0x000000ea,0x0004002b,0x00000006,0x000007b8,
+0x00000036,0x0004002b,0x00000006,0x000007b9,
+0x000000b9,0x0004002b,0x00000006,0x000007ba,
+0x00000067,0x0004002b,0x00000006,0x000007bb,
+0x00000077,0x0004002b,0x00000006,0x000007bc,
+0x000000b3,0x0004002b,0x00000006,0x000007bd,
+0x0000006c,0x0004002b,0x00000006,0x000007be,
+0x0000007c,0x0004002b,0x00000006,0x000007bf,
+0x000000f7,0x0004002b,0x00000006,0x000007c0,
+0x000000e7,0x0004002b,0x00000006,0x000007c1,
+0x000000d7,0x0004002b,0x00000006,0x000007c2,
+0x000000c7,0x0004002b,0x00000006,0x000007c3,
+0x000000bf,0x0004002b,0x00000006,0x000007c4,
+0x000000b7,0x0004002b,0x00000006,0x000007c5,
+0x000000af,0x0004002b,0x00000006,0x000007c6,
+0x0000009f,0x0004002b,0x00000006,0x000007c7,
+0x00000097,0x0004002b,0x00000006,0x000007c8,
+0x00000070,0x0004002b,0x00000006,0x000007c9,
+0x0000008f,0x0004002b,0x00000006,0x000007ca,
+0x00000078,0x0004002b,0x00000006,0x000007cb,
+0x00000087,0x0004002b,0x00000006,0x000007cc,
+0x000000fd,0x0004002b,0x00000006,0x000007cd,
+0x000000f5,0x0004002b,0x00000006,0x000007ce,
+0x000000ed,0x0004002b,0x00000006,0x000007cf,
+0x000000e5,0x0004002b,0x00000006,0x000007d0,
+0x000000bc,0x0004002b,0x00000006,0x000007d1,
+0x000000b4,0x0004002b,0x00000006,0x000007d2,
+0x000000ac,0x0004002b,0x00000006,0x000007d3,
+0x0000006b,0x0004002b,0x00000006,0x000007d4,
+0x00000073,0x0004002b,0x00000006,0x000007d5,
+0x0000007b,0x0004002b,0x00000006,0x000007d6,
+0x000000f2,0x0004002b,0x00000006,0x000007d7,
+0x0000004e,0x0004002b,0x00000006,0x000007d8,
+0x000000b1,0x0004002b,0x00000006,0x000007d9,
+0x0000005e,0x0004002b,0x00000006,0x000007da,
+0x00000076,0x0004002b,0x00000006,0x000007db,
+0x0000007e,0x0004002b,0x00000006,0x000007dc,
+0x000000fb,0x0004002b,0x00000006,0x000007dd,
+0x000000f3,0x0004002b,0x00000006,0x000007de,
+0x000000eb,0x0004002b,0x00000006,0x000007df,
+0x0000003c,0x0004002b,0x00000006,0x000007e0,
+0x000000bb,0x0004002b,0x00000006,0x000007e1,
+0x000000ab,0x0004002b,0x00000006,0x000007e2,
+0x000000fe,0x0004002b,0x00000006,0x000007e3,
+0x000000f6,0x0004002b,0x00000006,0x000007e4,
+0x000000ee,0x0004002b,0x00000006,0x000007e5,
+0x000000e6,0x0004002b,0x00000006,0x000007e6,
+0x000000d6,0x0004002b,0x00000006,0x000007e7,
+0x00000031,0x0004002b,0x00000006,0x000007e8,
+0x000000ce,0x0004002b,0x00000006,0x000007e9,
+0x000000c6,0x0004002b,0x00000006,0x000007ea,
+0x000000b6,0x0004002b,0x00000006,0x000007eb,
+0x0000005d,0x0004002b,0x00000006,0x000007ec,
+0x0000006d,0x0004002b,0x00000006,0x000007ed,
+0x00000075,0x0004002b,0x00000006,0x000007ee,
+0x0000007d,0x0004002b,0x00000006,0x000007ef,
+0x000000f9,0x0004002b,0x00000006,0x000007f0,
+0x000000f1,0x0004002b,0x00000006,0x000007f1,
+0x000000dd,0x0004002b,0x00000006,0x000007f2,
+0x000000d5,0x0004002b,0x00000006,0x000007f3,
+0x000000cd,0x0004002b,0x00000006,0x000007f4,
+0x000000c5,0x0004002b,0x00000006,0x000007f5,
+0x000000b5,0x0004002b,0x00000006,0x000007f6,
+0x000000ad,0x0004002b,0x00000006,0x000007f7,
+0x0000009d,0x0004002b,0x00000006,0x000007f8,
+0x00000072,0x0004002b,0x00000006,0x000007f9,
+0x0000008d,0x0004002b,0x00000006,0x000007fa,
+0x0000007a,0x0180002c,0x0000079f,0x000007fb,
+0x000000bf,0x000000bf,0x000000bf,0x000000bf,
+0x000006b5,0x0000044e,0x00000403,0x000002e8,
+0x00000304,0x000000bf,0x000006b5,0x000002d3,
+0x000007a0,0x00000448,0x000007a1,0x000003ea,
+0x000003f7,0x000007a2,0x00000406,0x000007a3,
+0x000003f0,0x000000bf,0x000006b5,0x000002bc,
+0x000007a4,0x000002d1,0x000007a5,0x000003eb,
+0x000003f6,0x000003de,0x000007a6,0x000007a7,
+0x00000408,0x000007a8,0x000007a9,0x000007aa,
+0x000002fc,0x000002c7,0x000007ab,0x0000047c,
+0x000003ff,0x000002e5,0x000007ac,0x000007ad,
+0x000002f2,0x000000bf,0x000006b5,0x00000170,
+0x000007ae,0x000001c3,0x000007af,0x0000044b,
+0x000007b0,0x000002d0,0x000007b1,0x000002de,
+0x000007b2,0x000002d5,0x000007b3,0x000007b4,
+0x000007b5,0x000000b7,0x000007b6,0x000002c6,
+0x000007b7,0x000002cb,0x0000040c,0x000007b8,
+0x00000400,0x000002d4,0x000007b9,0x000002e3,
+0x000002f9,0x000007ba,0x00000303,0x000007bb,
+0x000002f4,0x000003de,0x000007a6,0x000003e0,
+0x000003e3,0x00000479,0x00000409,0x00000447,
+0x000003fd,0x000003e6,0x000007bc,0x000003ea,
+0x000003f7,0x000007bd,0x000003f3,0x000007be,
+0x000003ee,0x000000bf,0x000006b5,0x000000af,
+0x000007bf,0x00000170,0x000007ae,0x00000199,
+0x000007c0,0x000001c3,0x000007af,0x000002bf,
+0x000007c1,0x0000044b,0x000007b0,0x0000044a,
+0x000007c2,0x000001a0,0x000007c3,0x000002d6,
+0x000007c4,0x000002dd,0x000007c5,0x000002e5,
+0x000007ac,0x0000019c,0x000007c6,0x000002da,
+0x000007c7,0x000007c8,0x000007c9,0x000007ca,
+0x000007cb,0x000000b4,0x000007cc,0x0000012a,
+0x000007cd,0x000002c3,0x000007ce,0x000002ca,
+0x000007cf,0x000003e2,0x0000040f,0x00000479,
+0x00000409,0x0000044e,0x00000403,0x00000447,
+0x000003fd,0x000003e4,0x000007d0,0x000003e5,
+0x000007d1,0x000003e8,0x000007d2,0x000003e9,
+0x000002fe,0x000003eb,0x000003f6,0x000007d3,
+0x000002ff,0x000007d4,0x000003f1,0x000007d5,
+0x000002f0,0x000000b7,0x000007b6,0x0000044d,
+0x000007d6,0x000002c6,0x000007b7,0x0000047d,
+0x0000040a,0x000002c8,0x0000040d,0x00000442,
+0x00000407,0x00000449,0x00000401,0x0000047a,
+0x000003fb,0x000002d4,0x000007b9,0x000007d7,
+0x000007d8,0x000002e3,0x000002f9,0x000007d9,
+0x000002f3,0x000002e8,0x00000304,0x000007aa,
+0x000002fc,0x000007da,0x000002f5,0x000007db,
+0x000002ed,0x000000bf,0x000006b5,0x000000b3,
+0x000007dc,0x000000af,0x000007bf,0x00000114,
+0x000007dd,0x00000170,0x000007ae,0x000002c5,
+0x000007de,0x00000199,0x000007c0,0x000003e1,
+0x00000410,0x000001c3,0x000007af,0x000002c4,
+0x0000040e,0x000002bf,0x000007c1,0x000007a7,
+0x00000408,0x0000044b,0x000007b0,0x00000444,
+0x00000402,0x0000044a,0x000007c2,0x000007df,
+0x000003fc,0x000001a0,0x000007c3,0x000002d2,
+0x000007e0,0x000002d6,0x000007c4,0x000003e6,
+0x000007bc,0x000002dd,0x000007c5,0x000002e1,
+0x000007e1,0x000002e5,0x000007ac,0x000003ea,
+0x000003f7,0x0000019c,0x000007c6,0x000002e0,
+0x000003f5,0x000002da,0x000007c7,0x000007bd,
+0x000003f3,0x000007c8,0x000007c9,0x000007a3,
+0x000003f0,0x000007ca,0x000007cb,0x000007be,
+0x000003ee,0x000000c2,0x000007e2,0x000000b7,
+0x000007b6,0x000002bd,0x000007e3,0x0000044d,
+0x000007d6,0x000002c2,0x000007e4,0x000002c6,
+0x000007b7,0x000002c9,0x000007e5,0x0000047d,
+0x0000040a,0x000002bc,0x000007a4,0x000002c8,
+0x0000040d,0x000002c0,0x000007e6,0x00000442,
+0x00000407,0x000007e7,0x000007e8,0x00000449,
+0x00000401,0x00000476,0x000007e9,0x0000047a,
+0x000003fb,0x000002d0,0x000007b1,0x000002d3,
+0x000007a0,0x000002d7,0x000007ea,0x000007a8,
+0x000007a9,0x000002de,0x000007b2,0x000002e2,
+0x000002fa,0x000002e6,0x00000306,0x000007eb,
+0x000002f7,0x000002d5,0x000007b3,0x000002e4,
+0x00000305,0x000002db,0x00000301,0x000007ec,
+0x000002fd,0x000007b4,0x000007b5,0x000007ed,
+0x000002f6,0x000007ad,0x000002f2,0x000007ee,
+0x000002ee,0x000000b4,0x000007cc,0x0000011e,
+0x000007ef,0x0000012a,0x000007cd,0x00000477,
+0x000007f0,0x000002c3,0x000007ce,0x000002c7,
+0x000007ab,0x000002ca,0x000007cf,0x0000044f,
+0x00000404,0x000002be,0x000007f1,0x000002cb,
+0x0000040c,0x000002c1,0x000007f2,0x000007a2,
+0x00000406,0x00000478,0x000007f3,0x000007b8,
+0x00000400,0x0000047b,0x000007f4,0x0000044c,
+0x000003fa,0x000002d1,0x000007a5,0x000002d4,
+0x000007b9,0x000002d8,0x000007f5,0x000007d7,
+0x000007d8,0x000002df,0x000007f6,0x000002e3,
+0x000002f9,0x000002e7,0x00000302,0x000007d9,
+0x000002f3,0x000002d9,0x000007f7,0x000002e8,
+0x00000304,0x000002dc,0x00000300,0x000007aa,
+0x000002fc,0x000007f8,0x000007f9,0x000007da,
+0x000002f5,0x000007fa,0x000002f1,0x000007db,
+0x000002ed,0x00040020,0x00000803,0x00000007,
+0x0000079f,0x0004002b,0x00000006,0x00000822,
+0x0000013b,0x0004001c,0x00000823,0x00000006,
+0x00000822,0x0004002b,0x00000006,0x00000824,
+0x00000047,0x0004002b,0x00000006,0x00000825,
+0x000000b8,0x0004002b,0x00000006,0x00000826,
+0x000000ec,0x0004002b,0x00000006,0x00000827,
+0x000000fc,0x0004002b,0x00000006,0x00000828,
+0x00000057,0x013e002c,0x00000823,0x00000829,
+0x000000bf,0x000000bf,0x000000bf,0x000000bf,
+0x000000bf,0x000000bf,0x000006b5,0x000003e1,
+0x00000410,0x0000044a,0x000007c2,0x000002e1,
+0x000007e1,0x000007b4,0x000007b5,0x000000bf,
+0x000006b5,0x000003e4,0x000007d0,0x0000044d,
+0x000007d6,0x000002dd,0x000007c5,0x000003e0,
+0x000003e3,0x000007d9,0x000002f3,0x000002bf,
+0x000007c1,0x000007d3,0x000002ff,0x000007b8,
+0x00000400,0x000007ad,0x000002f2,0x000000bf,
+0x000006b5,0x000001c3,0x000007af,0x000002d0,
+0x000007b1,0x000002d5,0x000007b3,0x0000011e,
+0x000007ef,0x00000445,0x0000040b,0x00000824,
+0x00000825,0x000002da,0x000007c7,0x0000044d,
+0x000007d6,0x00000442,0x00000407,0x000007d7,
+0x000007d8,0x000007aa,0x000002fc,0x000003df,
+0x00000826,0x00000444,0x00000402,0x000002e1,
+0x000007e1,0x000007ed,0x000002f6,0x000002ca,
+0x000007cf,0x0000047b,0x000007f4,0x000003e9,
+0x000002fe,0x000007d5,0x000002f0,0x000000bf,
+0x000006b5,0x00000170,0x000007ae,0x000001c3,
+0x000007af,0x0000044b,0x000007b0,0x000001a0,
+0x000007c3,0x000002dd,0x000007c5,0x0000019c,
+0x000007c6,0x000007c8,0x000007c9,0x000000b8,
+0x00000827,0x000003df,0x00000826,0x000003e2,
+0x0000040f,0x0000044e,0x00000403,0x000003e4,
+0x000007d0,0x000003e8,0x000007d2,0x000002e0,
+0x000003f5,0x000007a3,0x000003f0,0x0000011e,
+0x000007ef,0x000002c7,0x000007ab,0x000002cb,
+0x0000040c,0x000007b8,0x00000400,0x00000824,
+0x00000825,0x00000828,0x000002f8,0x000007ba,
+0x00000303,0x000007bb,0x000002f4,0x000002bd,
+0x000007e3,0x000002c9,0x000007e5,0x000002c1,
+0x000007f2,0x0000047b,0x000007f4,0x000002d8,
+0x000007f5,0x000002e7,0x00000302,0x000002dc,
+0x00000300,0x000007fa,0x000002f1,0x0000044d,
+0x000007d6,0x0000047d,0x0000040a,0x00000442,
+0x00000407,0x0000047a,0x000003fb,0x000007a8,
+0x000007a9,0x000007eb,0x000002f7,0x000007ec,
+0x000002fd,0x000007ee,0x000002ee,0x000000bf,
+0x000006b5,0x000000af,0x000007bf,0x00000170,
+0x000007ae,0x00000199,0x000007c0,0x000001c3,
+0x000007af,0x000002bf,0x000007c1,0x0000044b,
+0x000007b0,0x0000044a,0x000007c2,0x000001a0,
+0x000007c3,0x000002d6,0x000007c4,0x000002dd,
+0x000007c5,0x000002e5,0x000007ac,0x0000019c,
+0x000007c6,0x000002da,0x000007c7,0x000007c8,
+0x000007c9,0x000007ca,0x000007cb,0x000000c2,
+0x000007e2,0x000002bd,0x000007e3,0x000002c2,
+0x000007e4,0x000002c9,0x000007e5,0x000002bc,
+0x000007a4,0x000002c0,0x000007e6,0x000007e7,
+0x000007e8,0x00000476,0x000007e9,0x000002d0,
+0x000007b1,0x000002d7,0x000007ea,0x000002de,
+0x000007b2,0x000002e6,0x00000306,0x000002d5,
+0x000007b3,0x000002db,0x00000301,0x000007b4,
+0x000007b5,0x000007ad,0x000002f2,0x000000b8,
+0x00000827,0x000003de,0x000007a6,0x000003df,
+0x00000826,0x000003e0,0x000003e3,0x000003e2,
+0x0000040f,0x00000479,0x00000409,0x0000044e,
+0x00000403,0x00000447,0x000003fd,0x000003e4,
+0x000007d0,0x000003e5,0x000007d1,0x000003e8,
+0x000007d2,0x000003e9,0x000002fe,0x000003eb,
+0x000003f6,0x000007d3,0x000002ff,0x000007d4,
+0x000003f1,0x000007d5,0x000002f0,0x000000b3,
+0x000007dc,0x00000114,0x000007dd,0x000002c5,
+0x000007de,0x000003e1,0x00000410,0x000002c4,
+0x0000040e,0x000007a7,0x00000408,0x00000444,
+0x00000402,0x000007df,0x000003fc,0x000002d2,
+0x000007e0,0x000003e6,0x000007bc,0x000002e1,
+0x000007e1,0x000003ea,0x000003f7,0x000002e0,
+0x000003f5,0x000007bd,0x000003f3,0x000007a3,
+0x000003f0,0x000007be,0x000003ee,0x0000011e,
+0x000007ef,0x00000477,0x000007f0,0x000002c7,
+0x000007ab,0x0000044f,0x00000404,0x000002cb,
+0x0000040c,0x000007a2,0x00000406,0x000007b8,
+0x00000400,0x0000044c,0x000003fa,0x000002d4,
+0x000007b9,0x000007d7,0x000007d8,0x000002e3,
+0x000002f9,0x000007d9,0x000002f3,0x000002e8,
+0x00000304,0x000007aa,0x000002fc,0x000007da,
+0x000002f5,0x000007db,0x000002ed,0x00040020,
+0x00000831,0x00000007,0x00000823,0x0004001c,
+0x00000846,0x00000011,0x000000af,0x0005002c,
+0x00000011,0x00000847,0x000006b5,0x000000af,
+0x0005002c,0x00000011,0x00000848,0x000002e2,
+0x000000af,0x0005002c,0x00000011,0x00000849,
+0x000002c4,0x000000c2,0x0005002c,0x00000011,
+0x0000084a,0x000002c2,0x000000af,0x0005002c,
+0x00000011,0x0000084b,0x000000af,0x000000b4,
+0x0005002c,0x00000011,0x0000084c,0x000000b3,
+0x000000b3,0x0005002c,0x00000011,0x0000084d,
+0x000000b4,0x0000011e,0x000b002c,0x00000846,
+0x0000084e,0x00000847,0x00000848,0x00000849,
+0x0000084a,0x0000084b,0x0000084c,0x0000084d,
+0x0000049f,0x00040020,0x00000851,0x00000007,
+0x00000846,0x0004002b,0x00000059,0x00000863,
+0x00000060,0x0004002b,0x00000059,0x00000864,
+0x00000040,0x0004002b,0x00000059,0x00000865,
+0x00000020,0x0007002c,0x0000005a,0x00000866,
+0x00000863,0x00000864,0x00000865,0x000000e2,
+0x0007002c,0x0000000f,0x0000086a,0x000000c2,
+0x000000c2,0x000000c2,0x000000c2,0x0007002c,
+0x0000005a,0x0000086c,0x000000e2,0x000000e2,
+0x000000e2,0x000000e2,0x0004002b,0x00000059,
+0x0000086d,0x0000001f,0x0007002c,0x0000005a,
+0x0000086e,0x0000086d,0x0000086d,0x0000086d,
+0x0000086d,0x0004002b,0x00000006,0x00000874,
+0xffffffff,0x0007002c,0x0000000f,0x00000875,
+0x00000874,0x00000874,0x00000874,0x00000874,
+0x0007002c,0x0000000f,0x00000878,0x00000200,
+0x0000019c,0x000001a0,0x000001c3,0x00040017,
+0x00000879,0x000000cf,0x00000004,0x0007002c,
+0x0000000f,0x00000881,0x000006b5,0x000000bf,
+0x000006b5,0x000006b5,0x0004002b,0x00000059,
+0x000008bc,0x0000001d,0x0004002b,0x00000059,
+0x000008c0,0xfffffffe,0x0005001e,0x0000093e,
+0x00000011,0x00000006,0x00000006,0x00040020,
+0x0000093f,0x00000009,0x0000093e,0x0004003b,
+0x0000093f,0x00000940,0x00000009,0x00040020,
+0x00000941,0x00000009,0x00000011,0x00090019,
+0x0000094a,0x00000006,0x00000001,0x00000000,
+0x00000001,0x00000000,0x00000002,0x0000001e,
+0x00040020,0x0000094b,0x00000000,0x0000094a,
+0x0004003b,0x0000094b,0x0000094c,0x00000000,
+0x00040020,0x00000967,0x00000007,0x0000008b,
+0x0004002b,0x0000008b,0x00000974,0x40400000,
+0x0004002b,0x0000008b,0x00000976,0x00000000,
+0x0004002b,0x0000008b,0x0000098b,0x40e00000,
+0x0004002b,0x00000006,0x00000990,0x02345671,
+0x00040018,0x000009c2,0x0000008c,0x00000003,
+0x00040020,0x000009c3,0x00000007,0x000009c2,
+0x0004002b,0x0000008b,0x000009d4,0x3f800000,
+0x0004002b,0x0000008b,0x000009fc,0x40800000,
+0x0004002b,0x0000008b,0x00000a01,0x3e991687,
+0x0004002b,0x0000008b,0x00000a02,0x3f1645a2,
+0x0004002b,0x0000008b,0x00000a03,0x3de978d5,
+0x0006002c,0x0000008c,0x00000a04,0x00000a01,
+0x00000a02,0x00000a03,0x00040020,0x00000a1a,
+0x00000001,0x00000006,0x0004003b,0x00000a1a,
+0x00000a1b,0x00000001,0x0004002b,0x00000006,
+0x00000a4e,0xfffffffd,0x0004002b,0x0000008b,
+0x00000a75,0x41f80000,0x0004002b,0x0000008b,
+0x00000a76,0x427c0000,0x0006002c,0x0000008c,
+0x00000a77,0x00000a75,0x00000a76,0x00000a75,
+0x0004002b,0x0000008b,0x00000a79,0x437f0000,
+0x0006002c,0x0000008c,0x00000a7a,0x00000a79,
+0x00000a79,0x00000a79,0x0004003b,0x00000a1a,
+0x00000a8b,0x00000001,0x0004003b,0x00000a1a,
+0x00000a8d,0x00000001,0x00040020,0x00000a99,
+0x00000001,0x00000008,0x0004003b,0x00000a99,
+0x00000a9a,0x00000001,0x00040020,0x00000aae,
+0x00000009,0x00000006,0x0004003b,0x0000094b,
+0x00000b06,0x00000000,0x0006002c,0x00000008,
+0x00000b14,0x000001a0,0x000000c2,0x000000c2,
+0x00050036,0x00000002,0x00000004,0x00000000,
+0x00000003,0x000200f8,0x00000005,0x0004003b,
+0x00000007,0x00000a8a,0x00000007,0x0004003b,
+0x00000007,0x00000a92,0x00000007,0x0004003b,
+0x00000007,0x00000a95,0x00000007,0x0004003b,
+0x00000012,0x00000a98,0x00000007,0x0004003b,
+0x00000007,0x00000aad,0x00000007,0x0004003b,
+0x00000010,0x00000ab4,0x00000007,0x0004003b,
+0x00000012,0x00000ab5,0x00000007,0x0004003b,
+0x00000007,0x00000ab7,0x00000007,0x0004003b,
+0x00000009,0x00000aba,0x00000007,0x0004003b,
+0x00000009,0x00000abb,0x00000007,0x0004003b,
+0x00000009,0x00000abc,0x00000007,0x0004003b,
+0x00000009,0x00000abf,0x00000007,0x0004003b,
+0x00000009,0x00000ac0,0x00000007,0x0004003b,
+0x00000012,0x00000ac4,0x00000007,0x0004003b,
+0x00000009,0x00000ac5,0x00000007,0x0004003b,
+0x00000009,0x00000ac8,0x00000007,0x0004003b,
+0x00000007,0x00000acc,0x00000007,0x0004003b,
+0x0000008d,0x00000adb,0x00000007,0x0004003b,
+0x0000008d,0x00000adc,0x00000007,0x0004003b,
+0x0000008d,0x00000add,0x00000007,0x0004003b,
+0x00000010,0x00000aea,0x00000007,0x0004003b,
+0x00000007,0x00000aeb,0x00000007,0x0004003b,
+0x00000007,0x00000aee,0x00000007,0x0004003b,
+0x00000061,0x00000b11,0x00000007,0x0004003d,
+0x00000006,0x00000a8c,0x00000a8b,0x0004003d,
+0x00000006,0x00000a8e,0x00000a8d,0x00050084,
+0x00000006,0x00000a8f,0x00000a8c,0x00000a8e,
+0x0004003d,0x00000006,0x00000a90,0x00000a1b,
+0x00050080,0x00000006,0x00000a91,0x00000a8f,
+0x00000a90,0x0003003e,0x00000a8a,0x00000a91,
+0x0004003d,0x00000006,0x00000a93,0x00000a8a,
+0x00050086,0x00000006,0x00000a94,0x00000a93,
+0x00000170,0x0003003e,0x00000a92,0x00000a94,
+0x0004003d,0x00000006,0x00000a96,0x00000a8a,
+0x00050089,0x00000006,0x00000a97,0x00000a96,
+0x00000170,0x0003003e,0x00000a95,0x00000a97,
+0x0004003d,0x00000008,0x00000a9b,0x00000a9a,
+0x0007004f,0x00000011,0x00000a9c,0x00000a9b,
+0x00000a9b,0x00000000,0x00000001,0x00050050,
+0x00000011,0x00000a9d,0x000000af,0x000000af,
+0x00050084,0x00000011,0x00000a9e,0x00000a9d,
+0x00000a9c,0x0004003d,0x00000006,0x00000a9f,
+0x00000a92,0x000500c7,0x00000006,0x00000aa0,
+0x00000a9f,0x000000c2,0x00050084,0x00000006,
+0x00000aa1,0x000000b3,0x00000aa0,0x0004003d,
+0x00000006,0x00000aa2,0x00000a95,0x00050089,
+0x00000006,0x00000aa3,0x00000aa2,0x000000b3,
+0x00050080,0x00000006,0x00000aa4,0x00000aa1,
+0x00000aa3,0x0004003d,0x00000006,0x00000aa5,
+0x00000a92,0x000500c7,0x00000006,0x00000aa6,
+0x00000aa5,0x000000b4,0x00050084,0x00000006,
+0x00000aa7,0x000000b4,0x00000aa6,0x0004003d,
+0x00000006,0x00000aa8,0x00000a95,0x00050086,
+0x00000006,0x00000aa9,0x00000aa8,0x000000b3,
+0x00050080,0x00000006,0x00000aaa,0x00000aa7,
+0x00000aa9,0x00050050,0x00000011,0x00000aab,
+0x00000aa4,0x00000aaa,0x00050080,0x00000011,
+0x00000aac,0x00000a9e,0x00000aab,0x0003003e,
+0x00000a98,0x00000aac,0x00050041,0x00000aae,
+0x00000aaf,0x00000940,0x000000ed,0x0004003d,
+0x00000006,0x00000ab0,0x00000aaf,0x00050041,
+0x00000a1a,0x00000ab1,0x00000a9a,0x000000b4,
+0x0004003d,0x00000006,0x00000ab2,0x00000ab1,
+0x00050080,0x00000006,0x00000ab3,0x00000ab0,
+0x00000ab2,0x0003003e,0x00000aad,0x00000ab3,
+0x0004003d,0x00000011,0x00000ab6,0x00000a98,
+0x0003003e,0x00000ab5,0x00000ab6,0x0004003d,
+0x00000006,0x00000ab8,0x00000aad,0x0003003e,
+0x00000ab7,0x00000ab8,0x00060039,0x0000000f,
+0x00000ab9,0x00000089,0x00000ab5,0x00000ab7,
+0x0003003e,0x00000ab4,0x00000ab9,0x0004003d,
+0x0000000f,0x00000abd,0x00000ab4,0x0008004f,
+0x00000008,0x00000abe,0x00000abd,0x00000abd,
+0x00000000,0x00000001,0x00000002,0x0003003e,
+0x00000abc,0x00000abe,0x00070039,0x00000002,
+0x00000ac1,0x0000009e,0x00000abc,0x00000abf,
+0x00000ac0,0x0004003d,0x00000008,0x00000ac2,
+0x00000abf,0x0003003e,0x00000aba,0x00000ac2,
+0x0004003d,0x00000008,0x00000ac3,0x00000ac0,
+0x0003003e,0x00000abb,0x00000ac3,0x0004003d,
+0x00000008,0x00000ac6,0x00000aba,0x0003003e,
+0x00000ac5,0x00000ac6,0x00050039,0x00000006,
+0x00000ac7,0x000000a7,0x00000ac5,0x0004003d,
+0x00000008,0x00000ac9,0x00000abb,0x0003003e,
+0x00000ac8,0x00000ac9,0x00050039,0x00000006,
+0x00000aca,0x000000a7,0x00000ac8,0x00050050,
+0x00000011,0x00000acb,0x00000ac7,0x00000aca,
+0x0003003e,0x00000ac4,0x00000acb,0x0003003e,
+0x00000acc,0x000000bf,0x00050041,0x00000007,
+0x00000acd,0x00000ac4,0x000000bf,0x0004003d,
+0x00000006,0x00000ace,0x00000acd,0x00050041,
+0x00000007,0x00000acf,0x00000ac4,0x000000c2,
+0x0004003d,0x00000006,0x00000ad0,0x00000acf,
+0x000500ab,0x000000cf,0x00000ad1,0x00000ace,
+0x00000ad0,0x000300f7,0x00000ad3,0x00000000,
+0x000400fa,0x00000ad1,0x00000ad2,0x00000ad3,
+0x000200f8,0x00000ad2,0x0004003d,0x0000000f,
+0x00000ad4,0x00000ab4,0x0008004f,0x00000008,
+0x00000ad5,0x00000ad4,0x00000ad4,0x00000000,
+0x00000001,0x00000002,0x00040070,0x0000008c,
+0x00000ad6,0x00000ad5,0x0004003d,0x00000008,
+0x00000ad7,0x00000aba,0x00040070,0x0000008c,
+0x00000ad8,0x00000ad7,0x0004003d,0x00000008,
+0x00000ad9,0x00000abb,0x00040070,0x0000008c,
+0x00000ada,0x00000ad9,0x0003003e,0x00000adb,
+0x00000ad6,0x0003003e,0x00000adc,0x00000ad8,
+0x0003003e,0x00000add,0x00000ada,0x00070039,
+0x00000006,0x00000ade,0x00000092,0x00000adb,
+0x00000adc,0x00000add,0x0003003e,0x00000acc,
+0x00000ade,0x000200f9,0x00000ad3,0x000200f8,
+0x00000ad3,0x00050041,0x00000007,0x00000adf,
+0x00000ac4,0x000000bf,0x0004003d,0x00000006,
+0x00000ae0,0x00000adf,0x00050041,0x00000007,
+0x00000ae1,0x00000ac4,0x000000c2,0x0004003d,
+0x00000006,0x00000ae2,0x00000ae1,0x000500ac,
+0x000000cf,0x00000ae3,0x00000ae0,0x00000ae2,
+0x000300f7,0x00000ae5,0x00000000,0x000400fa,
+0x00000ae3,0x00000ae4,0x00000ae5,0x000200f8,
+0x00000ae4,0x0004003d,0x00000006,0x00000ae6,
+0x00000acc,0x000500c6,0x00000006,0x00000ae7,
+0x00000ae6,0x000000c2,0x0003003e,0x00000acc,
+0x00000ae7,0x0004003d,0x00000011,0x00000ae8,
+0x00000ac4,0x0007004f,0x00000011,0x00000ae9,
+0x00000ae8,0x00000ae8,0x00000001,0x00000000,
+0x0003003e,0x00000ac4,0x00000ae9,0x000200f9,
+0x00000ae5,0x000200f8,0x00000ae5,0x00050041,
+0x00000007,0x00000aec,0x00000ab4,0x000000b8,
+0x0004003d,0x00000006,0x00000aed,0x00000aec,
+0x0003003e,0x00000aeb,0x00000aed,0x0004003d,
+0x00000006,0x00000aef,0x00000a95,0x0003003e,
+0x00000aee,0x00000aef,0x00060039,0x00000011,
+0x00000af0,0x000000a3,0x00000aeb,0x00000aee,
+0x00050041,0x00000007,0x00000af1,0x00000aea,
+0x000000bf,0x00050051,0x00000006,0x00000af2,
+0x00000af0,0x00000000,0x0003003e,0x00000af1,
+0x00000af2,0x00050041,0x00000007,0x00000af3,
+0x00000aea,0x000000c2,0x00050051,0x00000006,
+0x00000af4,0x00000af0,0x00000001,0x0003003e,
+0x00000af3,0x00000af4,0x00050041,0x00000007,
+0x00000af5,0x00000ac4,0x000000c2,0x0004003d,
+0x00000006,0x00000af6,0x00000af5,0x00050041,
+0x00000007,0x00000af7,0x00000ac4,0x000000bf,
+0x0004003d,0x00000006,0x00000af8,0x00000af7,
+0x000500c4,0x00000006,0x00000af9,0x00000af8,
+0x00000589,0x000500c5,0x00000006,0x00000afa,
+0x00000af6,0x00000af9,0x00050041,0x00000007,
+0x00000afb,0x00000aea,0x000000b4,0x0003003e,
+0x00000afb,0x00000afa,0x0004003d,0x00000006,
+0x00000afc,0x00000acc,0x0004003d,0x00000006,
+0x00000afd,0x00000a95,0x00050084,0x00000006,
+0x00000afe,0x000000b4,0x00000afd,0x000500c4,
+0x00000006,0x00000aff,0x00000afc,0x00000afe,
+0x00070168,0x00000006,0x00000b00,0x000000b8,
+0x00000003,0x00000aff,0x00000170,0x00050041,
+0x00000007,0x00000b01,0x00000aea,0x000000b8,
+0x0003003e,0x00000b01,0x00000b00,0x0004003d,
+0x00000006,0x00000b02,0x00000a95,0x000500aa,
+0x000000cf,0x00000b03,0x00000b02,0x000000bf,
+0x000300f7,0x00000b05,0x00000000,0x000400fa,
+0x00000b03,0x00000b04,0x00000b05,0x000200f8,
+0x00000b04,0x0004003d,0x0000094a,0x00000b07,
+0x00000b06,0x0004003d,0x00000011,0x00000b08,
+0x00000a98,0x00050050,0x00000011,0x00000b09,
+0x000000b3,0x000000b3,0x00050086,0x00000011,
+0x00000b0a,0x00000b08,0x00000b09,0x0004007c,
+0x0000052f,0x00000b0b,0x00000b0a,0x0004003d,
+0x00000006,0x00000b0c,0x00000aad,0x0004007c,
+0x00000059,0x00000b0d,0x00000b0c,0x00050051,
+0x00000059,0x00000b0e,0x00000b0b,0x00000000,
+0x00050051,0x00000059,0x00000b0f,0x00000b0b,
+0x00000001,0x00060050,0x00000060,0x00000b10,
+0x00000b0e,0x00000b0f,0x00000b0d,0x0003003e,
+0x00000b11,0x00000b10,0x00050039,0x00000060,
+0x00000b12,0x00000084,0x00000b11,0x0004003d,
+0x0000000f,0x00000b13,0x00000aea,0x00040063,
+0x00000b07,0x00000b12,0x00000b13,0x000200f9,
+0x00000b05,0x000200f8,0x00000b05,0x000100fd,
+0x00010038,0x00050036,0x00000006,0x0000000d,
+0x00000000,0x0000000a,0x00030037,0x00000007,
+0x0000000b,0x00030037,0x00000009,0x0000000c,
+0x000200f8,0x0000000e,0x0004003b,0x00000012,
+0x000000a9,0x00000007,0x0004003d,0x00000006,
+0x000000aa,0x0000000b,0x0004003d,0x00000008,
+0x000000ab,0x0000000c,0x0007004f,0x00000011,
+0x000000ac,0x000000ab,0x000000ab,0x00000000,
+0x00000001,0x00050050,0x00000011,0x000000ad,
+0x000000aa,0x000000aa,0x00050084,0x00000011,
+0x000000ae,0x000000ad,0x000000ac,0x00050084,
+0x00000011,0x000000b2,0x000000ae,0x000000b1,
+0x00050080,0x00000011,0x000000b6,0x000000b2,
+0x000000b5,0x00050086,0x00000011,0x000000ba,
+0x000000b6,0x000000b9,0x0003003e,0x000000a9,
+0x000000ba,0x0004003d,0x00000006,0x000000bb,
+0x0000000b,0x00050041,0x00000007,0x000000bc,
+0x0000000c,0x000000b4,0x0004003d,0x00000006,
+0x000000bd,0x000000bc,0x00050084,0x00000006,
+0x000000be,0x000000bb,0x000000bd,0x00050041,
+0x00000007,0x000000c0,0x000000a9,0x000000bf,
+0x0004003d,0x00000006,0x000000c1,0x000000c0,
+0x00050041,0x00000007,0x000000c3,0x000000a9,
+0x000000c2,0x0004003d,0x00000006,0x000000c4,
+0x000000c3,0x00050080,0x00000006,0x000000c5,
+0x000000c1,0x000000c4,0x00050080,0x00000006,
+0x000000c6,0x000000be,0x000000c5,0x000200fe,
+0x000000c6,0x00010038,0x00050036,0x00000002,
+0x00000016,0x00000000,0x00000013,0x00030037,
+0x00000010,0x00000014,0x00030037,0x00000012,
+0x00000015,0x000200f8,0x00000017,0x0004003b,
+0x00000007,0x000000df,0x00000007,0x0004003b,
+0x00000007,0x000000e5,0x00000007,0x0004003b,
+0x00000007,0x000000e9,0x00000007,0x0004003b,
+0x00000007,0x000000ef,0x00000007,0x0004003b,
+0x00000007,0x000000f4,0x00000007,0x0004003b,
+0x00000007,0x000000f9,0x00000007,0x0004003b,
+0x00000007,0x00000108,0x00000007,0x0004003b,
+0x00000185,0x00000186,0x00000007,0x0004003b,
+0x00000007,0x00000193,0x00000007,0x0004003b,
+0x00000009,0x00000195,0x00000007,0x0004003d,
+0x0000000f,0x000000cb,0x00000014,0x0003003e,
+0x000000ca,0x000000cb,0x0004003d,0x00000011,
+0x000000ce,0x00000015,0x0003003e,0x000000cd,
+0x000000ce,0x0003003e,0x000000d1,0x000000d2,
+0x00050041,0x000000d4,0x000000d5,0x000000ca,
+0x000000b8,0x0004003d,0x00000006,0x000000d6,
+0x000000d5,0x000500c7,0x00000006,0x000000d8,
+0x000000d6,0x000000d7,0x000500aa,0x000000cf,
+0x000000da,0x000000d8,0x000000d9,0x0003003e,
+0x000000d3,0x000000da,0x0004003d,0x000000cf,
+0x000000db,0x000000d3,0x000300f7,0x000000dd,
+0x00000000,0x000400fa,0x000000db,0x000000dc,
+0x000000dd,0x000200f8,0x000000dc,0x000100fd,
+0x000200f8,0x000000dd,0x00050041,0x000000d4,
+0x000000e0,0x000000ca,0x000000b8,0x0004003d,
+0x00000006,0x000000e1,0x000000e0,0x000600cb,
+0x00000006,0x000000e4,0x000000e1,0x000000e2,
+0x000000e3,0x0003003e,0x000000df,0x000000e4,
+0x00050041,0x000000d4,0x000000e6,0x000000ca,
+0x000000b8,0x0004003d,0x00000006,0x000000e7,
+0x000000e6,0x000600cb,0x00000006,0x000000e8,
+0x000000e7,0x000000e3,0x000000e3,0x0003003e,
+0x000000e5,0x000000e8,0x00050041,0x000000d4,
+0x000000ea,0x000000ca,0x000000b8,0x0004003d,
+0x00000006,0x000000eb,0x000000ea,0x000600cb,
+0x00000006,0x000000ee,0x000000eb,0x000000ec,
+0x000000ed,0x0003003e,0x000000e9,0x000000ee,
+0x00050041,0x000000d4,0x000000f0,0x000000ca,
+0x000000b8,0x0004003d,0x00000006,0x000000f1,
+0x000000f0,0x000600cb,0x00000006,0x000000f3,
+0x000000f1,0x000000f2,0x000000e3,0x0003003e,
+0x000000ef,0x000000f3,0x00050041,0x000000d4,
+0x000000f5,0x000000ca,0x000000b8,0x0004003d,
+0x00000006,0x000000f6,0x000000f5,0x000600cb,
+0x00000006,0x000000f8,0x000000f6,0x000000f7,
+0x000000e3,0x0003003e,0x000000f4,0x000000f8,
+0x00050041,0x000000d4,0x000000fa,0x000000ca,
+0x000000b8,0x0004003d,0x00000006,0x000000fb,
+0x000000fa,0x000600cb,0x00000006,0x000000fd,
+0x000000fb,0x000000fc,0x000000ed,0x0003003e,
+0x000000f9,0x000000fd,0x00050041,0x000000d4,
+0x000000ff,0x000000ca,0x000000b8,0x0004003d,
+0x00000006,0x00000100,0x000000ff,0x000600cb,
+0x00000006,0x00000102,0x00000100,0x00000101,
+0x000000ed,0x000500ab,0x000000cf,0x00000103,
+0x00000102,0x000000bf,0x0003003e,0x000000fe,
+0x00000103,0x0004003d,0x00000006,0x00000104,
+0x000000df,0x000500aa,0x000000cf,0x00000105,
+0x00000104,0x000000bf,0x000300f7,0x00000107,
+0x00000000,0x000400fa,0x00000105,0x00000106,
+0x00000136,0x000200f8,0x00000106,0x0004003d,
+0x00000006,0x00000109,0x000000e5,0x000500c4,
+0x00000006,0x0000010a,0x00000109,0x000000ed,
+0x0004003d,0x00000006,0x0000010b,0x000000e9,
+0x000500c5,0x00000006,0x0000010c,0x0000010a,
+0x0000010b,0x0003003e,0x00000108,0x0000010c,
+0x0004003d,0x00000006,0x0000010d,0x000000f4,
+0x000300f7,0x00000112,0x00000000,0x000b00fb,
+0x0000010d,0x00000112,0x00000000,0x0000010e,
+0x00000001,0x0000010f,0x00000002,0x00000110,
+0x00000003,0x00000111,0x000200f8,0x0000010e,
+0x0004003d,0x00000006,0x00000115,0x000000ef,
+0x00050080,0x00000006,0x00000116,0x00000115,
+0x000000b4,0x00050050,0x00000011,0x00000117,
+0x00000114,0x00000116,0x0003003e,0x00000113,
+0x00000117,0x000200f9,0x00000112,0x000200f8,
+0x0000010f,0x0004003d,0x00000006,0x00000119,
+0x000000ef,0x00050080,0x00000006,0x0000011a,
+0x00000119,0x000000b4,0x00050050,0x00000011,
+0x0000011b,0x0000011a,0x00000114,0x0003003e,
+0x00000113,0x0000011b,0x000200f9,0x00000112,
+0x000200f8,0x00000110,0x0004003d,0x00000006,
+0x0000011d,0x000000ef,0x00050080,0x00000006,
+0x0000011f,0x0000011d,0x0000011e,0x00050041,
+0x000000d4,0x00000120,0x000000ca,0x000000b8,
+0x0004003d,0x00000006,0x00000121,0x00000120,
+0x000600cb,0x00000006,0x00000122,0x00000121,
+0x000000fc,0x000000e3,0x00050080,0x00000006,
+0x00000123,0x00000122,0x0000011e,0x00050050,
+0x00000011,0x00000124,0x0000011f,0x00000123,
+0x0003003e,0x00000113,0x00000124,0x0003003e,
+0x000000fe,0x000000d2,0x0003003e,0x000000f9,
+0x000000bf,0x000200f9,0x00000112,0x000200f8,
+0x00000111,0x0004003d,0x00000006,0x00000126,
+0x000000ef,0x000500aa,0x000000cf,0x00000127,
+0x00000126,0x000000bf,0x000300f7,0x00000129,
+0x00000000,0x000400fa,0x00000127,0x00000128,
+0x0000012c,0x000200f8,0x00000128,0x0003003e,
+0x00000113,0x0000012b,0x000200f9,0x00000129,
+0x000200f8,0x0000012c,0x0004003d,0x00000006,
+0x0000012d,0x000000ef,0x000500aa,0x000000cf,
+0x0000012e,0x0000012d,0x000000c2,0x000300f7,
+0x00000130,0x00000000,0x000400fa,0x0000012e,
+0x0000012f,0x00000132,0x000200f8,0x0000012f,
+0x0003003e,0x00000113,0x00000131,0x000200f9,
+0x00000130,0x000200f8,0x00000132,0x0003003e,
+0x000000d1,0x00000133,0x000100fd,0x000200f8,
+0x00000130,0x000200f9,0x00000129,0x000200f8,
+0x00000129,0x000200f9,0x00000112,0x000200f8,
+0x00000112,0x000200f9,0x00000107,0x000200f8,
+0x00000136,0x0004003d,0x00000006,0x00000137,
+0x000000df,0x000500c4,0x00000006,0x00000138,
+0x00000137,0x000000ed,0x0004003d,0x00000006,
+0x00000139,0x000000e9,0x000500c5,0x00000006,
+0x0000013a,0x00000138,0x00000139,0x0003003e,
+0x00000108,0x0000013a,0x0004003d,0x00000006,
+0x0000013b,0x000000e5,0x000300f7,0x00000140,
+0x00000000,0x000b00fb,0x0000013b,0x00000140,
+0x00000000,0x0000013c,0x00000001,0x0000013d,
+0x00000002,0x0000013e,0x00000003,0x0000013f,
+0x000200f8,0x0000013c,0x0004003d,0x00000006,
+0x00000141,0x000000f4,0x00050080,0x00000006,
+0x00000142,0x00000141,0x000000b3,0x0004003d,
+0x00000006,0x00000143,0x000000ef,0x00050080,
+0x00000006,0x00000144,0x00000143,0x000000b4,
+0x00050050,0x00000011,0x00000145,0x00000142,
+0x00000144,0x0003003e,0x00000113,0x00000145,
+0x000200f9,0x00000140,0x000200f8,0x0000013d,
+0x0004003d,0x00000006,0x00000147,0x000000f4,
+0x00050080,0x00000006,0x00000148,0x00000147,
+0x000000af,0x0004003d,0x00000006,0x00000149,
+0x000000ef,0x00050080,0x00000006,0x0000014a,
+0x00000149,0x000000b4,0x00050050,0x00000011,
+0x0000014b,0x00000148,0x0000014a,0x0003003e,
+0x00000113,0x0000014b,0x000200f9,0x00000140,
+0x000200f8,0x0000013e,0x0004003d,0x00000006,
+0x0000014d,0x000000ef,0x00050080,0x00000006,
+0x0000014e,0x0000014d,0x000000b4,0x0004003d,
+0x00000006,0x0000014f,0x000000f4,0x00050080,
+0x00000006,0x00000150,0x0000014f,0x000000af,
+0x00050050,0x00000011,0x00000151,0x0000014e,
+0x00000150,0x0003003e,0x00000113,0x00000151,
+0x000200f9,0x00000140,0x000200f8,0x0000013f,
+0x0004003d,0x00000006,0x00000153,0x000000f4,
+0x000500c2,0x00000006,0x00000154,0x00000153,
+0x000000ed,0x000500aa,0x000000cf,0x00000155,
+0x00000154,0x000000bf,0x000300f7,0x00000157,
+0x00000000,0x000400fa,0x00000155,0x00000156,
+0x0000015e,0x000200f8,0x00000156,0x0004003d,
+0x00000006,0x00000158,0x000000ef,0x00050080,
+0x00000006,0x00000159,0x00000158,0x000000b4,
+0x0004003d,0x00000006,0x0000015a,0x000000f4,
+0x000500c7,0x00000006,0x0000015b,0x0000015a,
+0x000000c2,0x00050080,0x00000006,0x0000015c,
+0x0000015b,0x0000011e,0x00050050,0x00000011,
+0x0000015d,0x00000159,0x0000015c,0x0003003e,
+0x00000113,0x0000015d,0x000200f9,0x00000157,
+0x000200f8,0x0000015e,0x0004003d,0x00000006,
+0x0000015f,0x000000f4,0x000500c7,0x00000006,
+0x00000160,0x0000015f,0x000000c2,0x00050080,
+0x00000006,0x00000161,0x00000160,0x000000b4,
+0x0004003d,0x00000006,0x00000162,0x000000ef,
+0x00050080,0x00000006,0x00000163,0x00000162,
+0x000000b4,0x00050050,0x00000011,0x00000164,
+0x00000161,0x00000163,0x0003003e,0x00000113,
+0x00000164,0x000200f9,0x00000157,0x000200f8,
+0x00000157,0x000200f9,0x00000140,0x000200f8,
+0x00000140,0x000200f9,0x00000107,0x000200f8,
+0x00000107,0x0004003d,0x00000011,0x00000166,
+0x00000113,0x0004003d,0x00000011,0x00000167,
+0x000000cd,0x000500ac,0x00000168,0x00000169,
+0x00000166,0x00000167,0x0004009a,0x000000cf,
+0x0000016a,0x00000169,0x000300f7,0x0000016c,
+0x00000000,0x000400fa,0x0000016a,0x0000016b,
+0x0000016c,0x000200f8,0x0000016b,0x0003003e,
+0x000000d1,0x00000133,0x000100fd,0x000200f8,
+0x0000016c,0x0004003d,0x00000006,0x00000180,
+0x000000f9,0x000500c4,0x00000006,0x00000182,
+0x00000180,0x00000181,0x0004003d,0x00000006,
+0x00000183,0x00000108,0x000500c5,0x00000006,
+0x00000184,0x00000182,0x00000183,0x0003003e,
+0x00000186,0x0000017f,0x00050041,0x00000009,
+0x00000187,0x00000186,0x00000184,0x0004003d,
+0x00000008,0x00000188,0x00000187,0x0003003e,
+0x0000016f,0x00000188,0x00050041,0x000000d4,
+0x0000018a,0x00000113,0x000000bf,0x0004003d,
+0x00000006,0x0000018b,0x0000018a,0x00050041,
+0x000000d4,0x0000018c,0x00000113,0x000000c2,
+0x0004003d,0x00000006,0x0000018d,0x0000018c,
+0x00050084,0x00000006,0x0000018e,0x0000018b,
+0x0000018d,0x0004003d,0x000000cf,0x0000018f,
+0x000000fe,0x000600a9,0x00000059,0x00000190,
+0x0000018f,0x000000ed,0x000000e2,0x000500c4,
+0x00000006,0x00000191,0x0000018e,0x00000190,
+0x0003003e,0x00000189,0x00000191,0x0004003d,
+0x00000006,0x00000194,0x00000189,0x0003003e,
+0x00000193,0x00000194,0x0004003d,0x00000008,
+0x00000196,0x0000016f,0x0003003e,0x00000195,
+0x00000196,0x00060039,0x00000006,0x00000197,
+0x0000000d,0x00000193,0x00000195,0x0003003e,
+0x00000192,0x00000197,0x0004003d,0x00000006,
+0x00000198,0x00000192,0x000500b0,0x000000cf,
+0x0000019a,0x00000198,0x00000199,0x0004003d,
+0x00000006,0x0000019b,0x00000192,0x000500ac,
+0x000000cf,0x0000019d,0x0000019b,0x0000019c,
+0x000500a6,0x000000cf,0x0000019e,0x0000019a,
+0x0000019d,0x0004003d,0x00000006,0x0000019f,
+0x00000189,0x000500ac,0x000000cf,0x000001a1,
+0x0000019f,0x000001a0,0x000500a6,0x000000cf,
+0x000001a2,0x0000019e,0x000001a1,0x000300f7,
+0x000001a4,0x00000000,0x000400fa,0x000001a2,
+0x000001a3,0x000001a4,0x000200f8,0x000001a3,
+0x0003003e,0x000000d1,0x00000133,0x000100fd,
+0x000200f8,0x000001a4,0x00050041,0x000000d4,
+0x000001a7,0x000000ca,0x000000b8,0x0004003d,
+0x00000006,0x000001a8,0x000001a7,0x000600cb,
+0x00000006,0x000001aa,0x000001a8,0x000001a9,
+0x000000e3,0x00050080,0x00000006,0x000001ab,
+0x000001aa,0x000000c2,0x0003003e,0x000001a6,
+0x000001ab,0x0004003d,0x00000006,0x000001ac,
+0x000001a6,0x000500ac,0x000000cf,0x000001ad,
+0x000001ac,0x000000c2,0x000300f7,0x000001af,
+0x00000000,0x000400fa,0x000001ad,0x000001ae,
+0x000001af,0x000200f8,0x000001ae,0x00050041,
+0x000000d4,0x000001b1,0x000000ca,0x000000b8,
+0x0004003d,0x00000006,0x000001b2,0x000001b1,
+0x000600cb,0x00000006,0x000001b4,0x000001b2,
+0x000001b3,0x00000101,0x0003003e,0x000001b0,
+0x000001b4,0x000200f9,0x000001af,0x000200f8,
+0x000001af,0x0004003d,0x000000cf,0x000001b5,
+0x000000fe,0x0004003d,0x00000006,0x000001b6,
+0x000001a6,0x000500aa,0x000000cf,0x000001b7,
+0x000001b6,0x000000b3,0x000500a7,0x000000cf,
+0x000001b8,0x000001b5,0x000001b7,0x000300f7,
+0x000001ba,0x00000000,0x000400fa,0x000001b8,
+0x000001b9,0x000001ba,0x000200f8,0x000001b9,
+0x0003003e,0x000000d1,0x00000133,0x000100fd,
+0x000200f8,0x000001ba,0x000100fd,0x00010038,
+0x00050036,0x00000006,0x0000001c,0x00000000,
+0x00000018,0x00030037,0x00000010,0x00000019,
+0x00030037,0x00000007,0x0000001a,0x00030037,
+0x00000007,0x0000001b,0x000200f8,0x0000001d,
+0x0004003b,0x00000007,0x000001c1,0x00000007,
+0x0004003b,0x00000007,0x000001c6,0x00000007,
+0x0004003b,0x00000007,0x000001cd,0x00000007,
+0x0004003b,0x00000007,0x000001e0,0x00000007,
+0x0004003b,0x00000007,0x000001e3,0x00000007,
+0x0004003b,0x00000007,0x000001ec,0x00000007,
+0x0004003d,0x00000006,0x000001bc,0x0000001b,
+0x000500aa,0x000000cf,0x000001bd,0x000001bc,
+0x000000bf,0x000300f7,0x000001bf,0x00000000,
+0x000400fa,0x000001bd,0x000001be,0x000001bf,
+0x000200f8,0x000001be,0x000200fe,0x000000bf,
+0x000200f8,0x000001bf,0x0004003d,0x00000006,
+0x000001c2,0x0000001a,0x00050086,0x00000006,
+0x000001c4,0x000001c2,0x000001c3,0x00050082,
+0x00000006,0x000001c5,0x000000b8,0x000001c4,
+0x0003003e,0x000001c1,0x000001c5,0x0004003d,
+0x00000006,0x000001c7,0x0000001a,0x0004003d,
+0x00000006,0x000001c8,0x0000001b,0x00050080,
+0x00000006,0x000001c9,0x000001c7,0x000001c8,
+0x00050082,0x00000006,0x000001ca,0x000001c9,
+0x000000c2,0x00050086,0x00000006,0x000001cb,
+0x000001ca,0x000001c3,0x00050082,0x00000006,
+0x000001cc,0x000000b8,0x000001cb,0x0003003e,
+0x000001c6,0x000001cc,0x0004003d,0x00000006,
+0x000001ce,0x0000001a,0x000500c7,0x00000006,
+0x000001d0,0x000001ce,0x000001cf,0x0003003e,
+0x000001cd,0x000001d0,0x0004003d,0x00000006,
+0x000001d1,0x000001c1,0x0004003d,0x00000006,
+0x000001d2,0x000001c6,0x000500aa,0x000000cf,
+0x000001d3,0x000001d1,0x000001d2,0x000300f7,
+0x000001d5,0x00000000,0x000400fa,0x000001d3,
+0x000001d4,0x000001df,0x000200f8,0x000001d4,
+0x0004003d,0x00000006,0x000001d6,0x000001c1,
+0x00050041,0x00000007,0x000001d7,0x00000019,
+0x000001d6,0x0004003d,0x00000006,0x000001d8,
+0x000001d7,0x0004003d,0x00000006,0x000001d9,
+0x000001cd,0x0004007c,0x00000059,0x000001da,
+0x000001d9,0x0004003d,0x00000006,0x000001db,
+0x0000001b,0x0004007c,0x00000059,0x000001dc,
+0x000001db,0x000600cb,0x00000006,0x000001dd,
+0x000001d8,0x000001da,0x000001dc,0x000200fe,
+0x000001dd,0x000200f8,0x000001df,0x0004003d,
+0x00000006,0x000001e1,0x000001cd,0x00050082,
+0x00000006,0x000001e2,0x000001c3,0x000001e1,
+0x0003003e,0x000001e0,0x000001e2,0x0004003d,
+0x00000006,0x000001e4,0x000001c1,0x00050041,
+0x00000007,0x000001e5,0x00000019,0x000001e4,
+0x0004003d,0x00000006,0x000001e6,0x000001e5,
+0x0004003d,0x00000006,0x000001e7,0x000001cd,
+0x0004007c,0x00000059,0x000001e8,0x000001e7,
+0x0004003d,0x00000006,0x000001e9,0x000001e0,
+0x0004007c,0x00000059,0x000001ea,0x000001e9,
+0x000600cb,0x00000006,0x000001eb,0x000001e6,
+0x000001e8,0x000001ea,0x0003003e,0x000001e3,
+0x000001eb,0x0004003d,0x00000006,0x000001ed,
+0x000001c6,0x00050041,0x00000007,0x000001ee,
+0x00000019,0x000001ed,0x0004003d,0x00000006,
+0x000001ef,0x000001ee,0x0004003d,0x00000006,
+0x000001f0,0x0000001b,0x0004003d,0x00000006,
+0x000001f1,0x000001e0,0x00050082,0x00000006,
+0x000001f2,0x000001f0,0x000001f1,0x0004007c,
+0x00000059,0x000001f3,0x000001f2,0x000600cb,
+0x00000006,0x000001f4,0x000001ef,0x000000e2,
+0x000001f3,0x0003003e,0x000001ec,0x000001f4,
+0x0004003d,0x00000006,0x000001f5,0x000001ec,
+0x0004003d,0x00000006,0x000001f6,0x000001e0,
+0x000500c4,0x00000006,0x000001f7,0x000001f5,
+0x000001f6,0x0004003d,0x00000006,0x000001f8,
+0x000001e3,0x000500c5,0x00000006,0x000001f9,
+0x000001f7,0x000001f8,0x000200fe,0x000001f9,
+0x000200f8,0x000001d5,0x000100ff,0x00010038,
+0x00050036,0x00000006,0x00000023,0x00000000,
+0x0000001e,0x00030037,0x00000007,0x0000001f,
+0x00030037,0x00000007,0x00000020,0x00030037,
+0x00000007,0x00000021,0x00030037,0x00000007,
+0x00000022,0x000200f8,0x00000024,0x0004003b,
+0x00000007,0x00000203,0x00000007,0x0004003b,
+0x00000007,0x0000020e,0x00000007,0x0004003b,
+0x00000007,0x00000213,0x00000007,0x0004003b,
+0x00000007,0x0000021e,0x00000007,0x0004003b,
+0x00000007,0x0000022c,0x00000007,0x0004003b,
+0x00000007,0x00000234,0x00000007,0x0004003b,
+0x00000010,0x00000235,0x00000007,0x0004003b,
+0x00000007,0x00000237,0x00000007,0x0004003b,
+0x00000007,0x00000239,0x00000007,0x0004003b,
+0x00000007,0x0000023c,0x00000007,0x0004003b,
+0x00000007,0x00000241,0x00000007,0x0004003b,
+0x00000007,0x00000249,0x00000007,0x0004003b,
+0x00000007,0x00000261,0x00000007,0x0004003d,
+0x00000006,0x000001fc,0x000001a6,0x000500aa,
+0x000000cf,0x000001fd,0x000001fc,0x000000c2,
+0x000300f7,0x000001ff,0x00000000,0x000400fa,
+0x000001fd,0x000001fe,0x0000020d,0x000200f8,
+0x000001fe,0x0004003d,0x00000006,0x00000201,
+0x00000192,0x00050082,0x00000006,0x00000202,
+0x00000200,0x00000201,0x0003003e,0x00000020,
+0x00000202,0x00050041,0x000000d4,0x00000204,
+0x000000ca,0x000000b8,0x0004003d,0x00000006,
+0x00000205,0x00000204,0x000600cb,0x00000006,
+0x00000206,0x00000205,0x000001b3,0x000000ec,
+0x0003003e,0x00000203,0x00000206,0x0004003d,
+0x00000006,0x00000207,0x00000203,0x000500c2,
+0x00000006,0x00000208,0x00000207,0x000000e3,
+0x00050084,0x00000006,0x00000209,0x000000b4,
+0x00000208,0x00050080,0x00000006,0x0000020a,
+0x00000209,0x000000b4,0x0003003e,0x00000021,
+0x0000020a,0x0003003e,0x00000022,0x000000bf,
+0x0004003d,0x00000006,0x0000020b,0x00000203,
+0x000200fe,0x0000020b,0x000200f8,0x0000020d,
+0x00050041,0x000000d4,0x0000020f,0x000000ca,
+0x000000b8,0x0004003d,0x00000006,0x00000210,
+0x0000020f,0x000600cb,0x00000006,0x00000212,
+0x00000210,0x00000211,0x000000e3,0x0003003e,
+0x0000020e,0x00000212,0x00050041,0x000000d4,
+0x00000214,0x000000ca,0x000000b8,0x0004003d,
+0x00000006,0x00000215,0x00000214,0x000600cb,
+0x00000006,0x00000217,0x00000215,0x00000216,
+0x000000ec,0x0003003e,0x00000213,0x00000217,
+0x0004003d,0x00000006,0x00000218,0x0000020e,
+0x000500aa,0x000000cf,0x00000219,0x00000218,
+0x000000bf,0x000300f7,0x0000021b,0x00000000,
+0x000400fa,0x00000219,0x0000021a,0x0000022b,
+0x000200f8,0x0000021a,0x0004003d,0x00000006,
+0x0000021c,0x00000192,0x00050082,0x00000006,
+0x0000021d,0x00000200,0x0000021c,0x0003003e,
+0x00000020,0x0000021d,0x0004003d,0x00000006,
+0x0000021f,0x00000213,0x000500c2,0x00000006,
+0x00000220,0x0000021f,0x000000e3,0x00050084,
+0x00000006,0x00000221,0x000000b4,0x00000220,
+0x00050080,0x00000006,0x00000222,0x00000221,
+0x000000b4,0x0003003e,0x0000021e,0x00000222,
+0x0004003d,0x00000006,0x00000223,0x0000021e,
+0x0004003d,0x00000006,0x00000224,0x000001a6,
+0x00050084,0x00000006,0x00000225,0x00000223,
+0x00000224,0x0003003e,0x00000021,0x00000225,
+0x0004003d,0x00000006,0x00000226,0x0000021e,
+0x0004003d,0x00000006,0x00000227,0x0000001f,
+0x00050084,0x00000006,0x00000228,0x00000226,
+0x00000227,0x0003003e,0x00000022,0x00000228,
+0x0004003d,0x00000006,0x00000229,0x00000213,
+0x000200fe,0x00000229,0x000200f8,0x0000022b,
+0x0004003d,0x00000006,0x0000022d,0x000001a6,
+0x00050084,0x00000006,0x0000022e,0x000000b8,
+0x0000022d,0x00050082,0x00000006,0x0000022f,
+0x0000022e,0x000000b3,0x0003003e,0x0000022c,
+0x0000022f,0x0004003d,0x00000006,0x00000230,
+0x00000192,0x00050082,0x00000006,0x00000231,
+0x00000200,0x00000230,0x0004003d,0x00000006,
+0x00000232,0x0000022c,0x00050082,0x00000006,
+0x00000233,0x00000231,0x00000232,0x0003003e,
+0x00000020,0x00000233,0x0004003d,0x0000000f,
+0x00000236,0x000000ca,0x0003003e,0x00000235,
+0x00000236,0x0004003d,0x00000006,0x00000238,
+0x00000020,0x0003003e,0x00000237,0x00000238,
+0x0004003d,0x00000006,0x0000023a,0x0000022c,
+0x0003003e,0x00000239,0x0000023a,0x00070039,
+0x00000006,0x0000023b,0x0000001c,0x00000235,
+0x00000237,0x00000239,0x0003003e,0x00000234,
+0x0000023b,0x0004003d,0x00000006,0x0000023d,
+0x00000234,0x000500c4,0x00000006,0x0000023e,
+0x0000023d,0x000000ec,0x0004003d,0x00000006,
+0x0000023f,0x00000213,0x000500c5,0x00000006,
+0x00000240,0x0000023e,0x0000023f,0x0003003e,
+0x0000023c,0x00000240,0x0004003d,0x00000006,
+0x00000242,0x0000023c,0x0004003d,0x00000006,
+0x00000243,0x0000001f,0x00050084,0x00000006,
+0x00000244,0x000000b4,0x00000243,0x0004003d,
+0x00000006,0x00000245,0x000001a6,0x00050080,
+0x00000006,0x00000246,0x00000244,0x00000245,
+0x0004007c,0x00000059,0x00000247,0x00000246,
+0x000600cb,0x00000006,0x00000248,0x00000242,
+0x00000247,0x000000e3,0x0003003e,0x00000241,
+0x00000248,0x0004003d,0x00000006,0x0000024a,
+0x0000023c,0x0004003d,0x00000006,0x0000024b,
+0x000001a6,0x0004007c,0x00000059,0x0000024c,
+0x0000024b,0x000600cb,0x00000006,0x0000024d,
+0x0000024a,0x000000e2,0x0000024c,0x0003003e,
+0x00000249,0x0000024d,0x0004003d,0x00000006,
+0x0000024e,0x0000020e,0x0004003d,0x00000006,
+0x0000024f,0x000001a6,0x00050084,0x00000006,
+0x00000250,0x0000024e,0x0000024f,0x0004003d,
+0x00000006,0x00000251,0x00000249,0x000400cd,
+0x00000059,0x00000252,0x00000251,0x0004007c,
+0x00000006,0x00000253,0x00000252,0x00050080,
+0x00000006,0x00000254,0x00000250,0x00000253,
+0x00050084,0x00000006,0x00000255,0x000000b4,
+0x00000254,0x0003003e,0x00000021,0x00000255,
+0x0004003d,0x00000006,0x00000256,0x0000020e,
+0x0004003d,0x00000006,0x00000257,0x0000001f,
+0x00050084,0x00000006,0x00000258,0x00000256,
+0x00000257,0x0004003d,0x00000006,0x00000259,
+0x00000249,0x0004003d,0x00000006,0x0000025a,
+0x0000001f,0x0004007c,0x00000059,0x0000025b,
+0x0000025a,0x000600cb,0x00000006,0x0000025c,
+0x00000259,0x000000e2,0x0000025b,0x000400cd,
+0x00000059,0x0000025d,0x0000025c,0x0004007c,
+0x00000006,0x0000025e,0x0000025d,0x00050080,
+0x00000006,0x0000025f,0x00000258,0x0000025e,
+0x00050084,0x00000006,0x00000260,0x000000b4,
+0x0000025f,0x0003003e,0x00000022,0x00000260,
+0x0004003d,0x00000006,0x00000262,0x0000020e,
+0x00050082,0x00000006,0x00000263,0x00000262,
+0x000000c2,0x0004003d,0x00000006,0x00000264,
+0x00000249,0x0004003d,0x00000006,0x00000265,
+0x0000001f,0x0004007c,0x00000059,0x00000266,
+0x00000265,0x000600cb,0x00000006,0x00000267,
+0x00000264,0x00000266,0x000000ed,0x00050080,
+0x00000006,0x00000268,0x00000263,0x00000267,
+0x0003003e,0x00000261,0x00000268,0x0004003d,
+0x00000006,0x00000269,0x00000261,0x000500c4,
+0x00000006,0x0000026a,0x00000269,0x000000e3,
+0x0004003d,0x00000006,0x0000026b,0x00000241,
+0x000500c5,0x00000006,0x0000026c,0x0000026a,
+0x0000026b,0x000200fe,0x0000026c,0x000200f8,
+0x0000021b,0x000100ff,0x000200f8,0x000001ff,
+0x000100ff,0x00010038,0x00050036,0x00000006,
+0x0000002a,0x00000000,0x00000025,0x00030037,
+0x00000010,0x00000026,0x00030037,0x00000007,
+0x00000027,0x00030037,0x00000007,0x00000028,
+0x00030037,0x00000007,0x00000029,0x000200f8,
+0x0000002b,0x0004003b,0x0000026f,0x00000270,
+0x00000007,0x0004003b,0x00000007,0x00000273,
+0x00000007,0x0004003b,0x00000010,0x0000027a,
+0x00000007,0x0004003b,0x00000007,0x0000027c,
+0x00000007,0x0004003b,0x00000007,0x0000027d,
+0x00000007,0x0004003b,0x00000007,0x0000027f,
+0x00000007,0x0004003b,0x00000007,0x000002a2,
+0x00000007,0x0004003b,0x00000010,0x000002a3,
+0x00000007,0x0004003b,0x00000007,0x000002a5,
+0x00000007,0x0004003b,0x00000007,0x000002a7,
+0x00000007,0x0004003b,0x0000026f,0x000002ab,
+0x00000007,0x0004003b,0x00000007,0x000002b9,
+0x00000007,0x0004003b,0x000003a2,0x000003a3,
+0x00000007,0x0004003d,0x00000006,0x00000271,
+0x00000028,0x0004007c,0x00000059,0x00000272,
+0x00000271,0x0003003e,0x00000270,0x00000272,
+0x0004003d,0x00000006,0x00000274,0x00000027,
+0x0004003d,0x00000006,0x00000275,0x00000028,
+0x00050080,0x00000006,0x00000276,0x00000274,
+0x00000275,0x0004003d,0x00000006,0x00000277,
+0x00000028,0x00050084,0x00000006,0x00000278,
+0x000000b3,0x00000277,0x00050080,0x00000006,
+0x00000279,0x00000278,0x000000af,0x0004003d,
+0x0000000f,0x0000027b,0x00000026,0x0003003e,
+0x0000027a,0x0000027b,0x0003003e,0x0000027c,
+0x00000276,0x0003003e,0x0000027d,0x00000279,
+0x00070039,0x00000006,0x0000027e,0x0000001c,
+0x0000027a,0x0000027c,0x0000027d,0x0003003e,
+0x00000273,0x0000027e,0x0004003d,0x00000006,
+0x00000280,0x00000273,0x000600cb,0x00000006,
+0x00000281,0x00000280,0x000000e2,0x000000e3,
+0x0004003d,0x00000006,0x00000282,0x00000273,
+0x0004003d,0x00000059,0x00000283,0x00000270,
+0x00050084,0x00000059,0x00000284,0x000000ed,
+0x00000283,0x00050080,0x00000059,0x00000285,
+0x00000284,0x000000e3,0x000600cb,0x00000006,
+0x00000286,0x00000282,0x00000285,0x000000e3,
+0x000500c4,0x00000006,0x00000287,0x00000286,
+0x000000e3,0x000500c5,0x00000006,0x00000288,
+0x00000281,0x00000287,0x0004003d,0x00000006,
+0x00000289,0x00000273,0x0004003d,0x00000059,
+0x0000028a,0x00000270,0x00050084,0x00000059,
+0x0000028b,0x000000e3,0x0000028a,0x00050080,
+0x00000059,0x0000028c,0x0000028b,0x000000ec,
+0x000600cb,0x00000006,0x0000028d,0x00000289,
+0x0000028c,0x000000ed,0x000500c4,0x00000006,
+0x0000028e,0x0000028d,0x000000ec,0x000500c5,
+0x00000006,0x0000028f,0x00000288,0x0000028e,
+0x0004003d,0x00000006,0x00000290,0x00000273,
+0x0004003d,0x00000059,0x00000291,0x00000270,
+0x00050084,0x00000059,0x00000292,0x00000181,
+0x00000291,0x00050080,0x00000059,0x00000293,
+0x00000292,0x000000f2,0x000600cb,0x00000006,
+0x00000294,0x00000290,0x00000293,0x000000e3,
+0x000500c4,0x00000006,0x00000295,0x00000294,
+0x000000f2,0x000500c5,0x00000006,0x00000296,
+0x0000028f,0x00000295,0x0004003d,0x00000006,
+0x00000297,0x00000273,0x0004003d,0x00000059,
+0x00000298,0x00000270,0x00050084,0x00000059,
+0x00000299,0x000000ec,0x00000298,0x00050080,
+0x00000059,0x0000029a,0x00000299,0x000000f7,
+0x000600cb,0x00000006,0x0000029b,0x00000297,
+0x0000029a,0x000000ed,0x000500c4,0x00000006,
+0x0000029c,0x0000029b,0x000000f7,0x000500c5,
+0x00000006,0x0000029d,0x00000296,0x0000029c,
+0x0003003e,0x0000027f,0x0000029d,0x0004003d,
+0x00000006,0x0000029e,0x00000029,0x000500aa,
+0x000000cf,0x0000029f,0x0000029e,0x000000bf,
+0x000300f7,0x000002a1,0x00000000,0x000400fa,
+0x0000029f,0x000002a0,0x000002aa,0x000200f8,
+0x000002a0,0x0004003d,0x0000000f,0x000002a4,
+0x00000026,0x0003003e,0x000002a3,0x000002a4,
+0x0004003d,0x00000006,0x000002a6,0x00000027,
+0x0003003e,0x000002a5,0x000002a6,0x0004003d,
+0x00000006,0x000002a8,0x00000028,0x0003003e,
+0x000002a7,0x000002a8,0x00070039,0x00000006,
+0x000002a9,0x0000001c,0x000002a3,0x000002a5,
+0x000002a7,0x0003003e,0x000002a2,0x000002a9,
+0x000200f9,0x000002a1,0x000200f8,0x000002aa,
+0x0004003d,0x00000006,0x000002ac,0x00000029,
+0x0004007c,0x00000059,0x000002ad,0x000002ac,
+0x00050082,0x00000059,0x000002ae,0x000002ad,
+0x000000ed,0x0003003e,0x000002ab,0x000002ae,
+0x0004003d,0x00000006,0x000002af,0x00000273,
+0x0004003d,0x00000059,0x000002b0,0x000002ab,
+0x0004003d,0x00000059,0x000002b1,0x00000270,
+0x00050084,0x00000059,0x000002b2,0x000002b0,
+0x000002b1,0x0004003d,0x00000059,0x000002b4,
+0x000002ab,0x0005004d,0x00000059,0x000002b5,
+0x000002b3,0x000002b4,0x00050080,0x00000059,
+0x000002b6,0x000002b2,0x000002b5,0x0004003d,
+0x00000059,0x000002b7,0x00000270,0x000600cb,
+0x00000006,0x000002b8,0x000002af,0x000002b6,
+0x000002b7,0x0003003e,0x000002a2,0x000002b8,
+0x000200f9,0x000002a1,0x000200f8,0x000002a1,
+0x0004003d,0x00000006,0x000003a1,0x0000027f,
+0x0003003e,0x000003a3,0x000003a0,0x00050041,
+0x00000007,0x000003a4,0x000003a3,0x000003a1,
+0x0004003d,0x00000006,0x000003a5,0x000003a4,
+0x0003003e,0x000002b9,0x000003a5,0x0004003d,
+0x00000006,0x000003a6,0x000002b9,0x0004003d,
+0x00000006,0x000003a7,0x00000029,0x0004007c,
+0x00000059,0x000003a8,0x000003a7,0x00050084,
+0x00000059,0x000003a9,0x000000e3,0x000003a8,
+0x000600cb,0x00000006,0x000003aa,0x000003a6,
+0x000003a9,0x000000e3,0x0004003d,0x00000006,
+0x000003ab,0x00000028,0x000500c4,0x00000006,
+0x000003ac,0x000003aa,0x000003ab,0x0004003d,
+0x00000006,0x000003ad,0x000002a2,0x000500c5,
+0x00000006,0x000003ae,0x000003ac,0x000003ad,
+0x000200fe,0x000003ae,0x00010038,0x00050036,
+0x00000006,0x00000030,0x00000000,0x00000025,
+0x00030037,0x00000010,0x0000002c,0x00030037,
+0x00000007,0x0000002d,0x00030037,0x00000007,
+0x0000002e,0x00030037,0x00000007,0x0000002f,
+0x000200f8,0x00000031,0x0004003b,0x0000026f,
+0x000003b1,0x00000007,0x0004003b,0x00000007,
+0x000003b4,0x00000007,0x0004003b,0x00000010,
+0x000003b8,0x00000007,0x0004003b,0x00000007,
+0x000003ba,0x00000007,0x0004003b,0x00000007,
+0x000003bc,0x00000007,0x0004003b,0x00000007,
+0x000003be,0x00000007,0x0004003b,0x00000007,
+0x000003d0,0x00000007,0x0004003b,0x00000007,
+0x000003dc,0x00000007,0x0004003b,0x00000413,
+0x00000414,0x00000007,0x0004003d,0x00000006,
+0x000003b2,0x0000002e,0x0004007c,0x00000059,
+0x000003b3,0x000003b2,0x0003003e,0x000003b1,
+0x000003b3,0x0004003d,0x00000006,0x000003b5,
+0x0000002e,0x00050084,0x00000006,0x000003b6,
+0x000000b8,0x000003b5,0x00050080,0x00000006,
+0x000003b7,0x000003b6,0x000000b0,0x0004003d,
+0x0000000f,0x000003b9,0x0000002c,0x0003003e,
+0x000003b8,0x000003b9,0x0004003d,0x00000006,
+0x000003bb,0x0000002d,0x0003003e,0x000003ba,
+0x000003bb,0x0003003e,0x000003bc,0x000003b7,
+0x00070039,0x00000006,0x000003bd,0x0000001c,
+0x000003b8,0x000003ba,0x000003bc,0x0003003e,
+0x000003b4,0x000003bd,0x0004003d,0x00000006,
+0x000003bf,0x000003b4,0x0004003d,0x00000059,
+0x000003c0,0x000003b1,0x000600cb,0x00000006,
+0x000003c1,0x000003bf,0x000003c0,0x00000181,
+0x0004003d,0x00000006,0x000003c2,0x000003b4,
+0x0004003d,0x00000059,0x000003c3,0x000003b1,
+0x00050084,0x00000059,0x000003c4,0x000000e3,
+0x000003c3,0x00050080,0x00000059,0x000003c5,
+0x000003c4,0x00000181,0x000600cb,0x00000006,
+0x000003c6,0x000003c2,0x000003c5,0x000000e3,
+0x000500c4,0x00000006,0x000003c7,0x000003c6,
+0x00000181,0x000500c5,0x00000006,0x000003c8,
+0x000003c1,0x000003c7,0x0004003d,0x00000006,
+0x000003c9,0x000003b4,0x0004003d,0x00000059,
+0x000003ca,0x000003b1,0x00050084,0x00000059,
+0x000003cb,0x00000181,0x000003ca,0x00050080,
+0x00000059,0x000003cc,0x000003cb,0x000000f2,
+0x000600cb,0x00000006,0x000003cd,0x000003c9,
+0x000003cc,0x000000e3,0x000500c4,0x00000006,
+0x000003ce,0x000003cd,0x000000f2,0x000500c5,
+0x00000006,0x000003cf,0x000003c8,0x000003ce,
+0x0003003e,0x000003be,0x000003cf,0x0004003d,
+0x00000006,0x000003d1,0x000003b4,0x0004003d,
+0x00000006,0x000003d2,0x0000002f,0x0004007c,
+0x00000059,0x000003d3,0x000003d2,0x0004003d,
+0x00000059,0x000003d4,0x000003b1,0x00050084,
+0x00000059,0x000003d5,0x000003d3,0x000003d4,
+0x0004003d,0x00000006,0x000003d7,0x0000002f,
+0x0005004d,0x00000059,0x000003d8,0x000003d6,
+0x000003d7,0x00050080,0x00000059,0x000003d9,
+0x000003d5,0x000003d8,0x0004003d,0x00000059,
+0x000003da,0x000003b1,0x000600cb,0x00000006,
+0x000003db,0x000003d1,0x000003d9,0x000003da,
+0x0003003e,0x000003d0,0x000003db,0x0004003d,
+0x00000006,0x00000412,0x000003be,0x0003003e,
+0x00000414,0x00000411,0x00050041,0x00000007,
+0x00000415,0x00000414,0x00000412,0x0004003d,
+0x00000006,0x00000416,0x00000415,0x0003003e,
+0x000003dc,0x00000416,0x0004003d,0x00000006,
+0x00000417,0x000003dc,0x0004003d,0x00000006,
+0x00000418,0x0000002f,0x0004007c,0x00000059,
+0x00000419,0x00000418,0x00050084,0x00000059,
+0x0000041a,0x00000181,0x00000419,0x000600cb,
+0x00000006,0x0000041b,0x00000417,0x0000041a,
+0x00000181,0x0004003d,0x00000006,0x0000041c,
+0x0000002e,0x000500c4,0x00000006,0x0000041d,
+0x0000041b,0x0000041c,0x0004003d,0x00000006,
+0x0000041e,0x000003d0,0x000500c5,0x00000006,
+0x0000041f,0x0000041d,0x0000041e,0x000200fe,
+0x0000041f,0x00010038,0x00050036,0x00000006,
+0x00000037,0x00000000,0x00000032,0x00030037,
+0x00000010,0x00000033,0x00030037,0x00000009,
+0x00000034,0x00030037,0x00000007,0x00000035,
+0x00030037,0x00000007,0x00000036,0x000200f8,
+0x00000038,0x0004003b,0x00000007,0x00000428,
+0x00000007,0x0004003b,0x00000007,0x00000430,
+0x00000007,0x0004003b,0x00000007,0x00000437,
+0x00000007,0x0004003b,0x00000010,0x0000043a,
+0x00000007,0x0004003b,0x00000007,0x0000043c,
+0x00000007,0x0004003b,0x00000007,0x0000043e,
+0x00000007,0x0004003b,0x00000007,0x00000440,
+0x00000007,0x0004003b,0x00000458,0x00000459,
+0x00000007,0x0004003b,0x00000007,0x00000463,
+0x00000007,0x0004003b,0x00000007,0x0000046a,
+0x00000007,0x0004003b,0x00000010,0x0000046d,
+0x00000007,0x0004003b,0x00000007,0x0000046f,
+0x00000007,0x0004003b,0x00000007,0x00000471,
+0x00000007,0x0004003b,0x00000007,0x00000473,
+0x00000007,0x0004003b,0x00000486,0x00000487,
+0x00000007,0x0004003b,0x00000007,0x0000048c,
+0x00000007,0x0004003b,0x00000007,0x00000490,
+0x00000007,0x0004003b,0x00000010,0x00000491,
+0x00000007,0x0004003b,0x00000007,0x00000493,
+0x00000007,0x0004003b,0x00000007,0x00000495,
+0x00000007,0x0004003b,0x00000012,0x00000498,
+0x00000007,0x0004003b,0x000004a3,0x000004a4,
+0x00000007,0x0004003d,0x00000006,0x00000422,
+0x00000036,0x0004003d,0x00000006,0x00000423,
+0x00000035,0x000500ae,0x000000cf,0x00000424,
+0x00000422,0x00000423,0x000300f7,0x00000426,
+0x00000000,0x000400fa,0x00000424,0x00000425,
+0x00000426,0x000200f8,0x00000425,0x000200fe,
+0x000000bf,0x000200f8,0x00000426,0x00050041,
+0x00000007,0x00000429,0x00000034,0x000000b4,
+0x0004003d,0x00000006,0x0000042a,0x00000429,
+0x0003003e,0x00000428,0x0000042a,0x00050041,
+0x00000007,0x0000042b,0x00000034,0x000000bf,
+0x0004003d,0x00000006,0x0000042c,0x0000042b,
+0x000500aa,0x000000cf,0x0000042d,0x0000042c,
+0x000000c2,0x000300f7,0x0000042f,0x00000000,
+0x000400fa,0x0000042d,0x0000042e,0x0000045d,
+0x000200f8,0x0000042e,0x0004003d,0x00000006,
+0x00000431,0x00000036,0x00050086,0x00000006,
+0x00000432,0x00000431,0x000000b7,0x0004003d,
+0x00000006,0x00000433,0x00000428,0x00050084,
+0x00000006,0x00000434,0x000000b7,0x00000433,
+0x00050080,0x00000006,0x00000435,0x00000434,
+0x000000af,0x00050084,0x00000006,0x00000436,
+0x00000432,0x00000435,0x0003003e,0x00000430,
+0x00000436,0x0004003d,0x00000006,0x00000438,
+0x00000036,0x00050089,0x00000006,0x00000439,
+0x00000438,0x000000b7,0x0004003d,0x0000000f,
+0x0000043b,0x00000033,0x0003003e,0x0000043a,
+0x0000043b,0x0004003d,0x00000006,0x0000043d,
+0x00000430,0x0003003e,0x0000043c,0x0000043d,
+0x0004003d,0x00000006,0x0000043f,0x00000428,
+0x0003003e,0x0000043e,0x0000043f,0x0003003e,
+0x00000440,0x00000439,0x00080039,0x00000006,
+0x00000441,0x0000002a,0x0000043a,0x0000043c,
+0x0000043e,0x00000440,0x0003003e,0x00000437,
+0x00000441,0x0004003d,0x00000006,0x00000451,
+0x00000428,0x000500c4,0x00000059,0x00000452,
+0x000000ed,0x00000451,0x00050082,0x00000059,
+0x00000453,0x00000452,0x000000ed,0x00050084,
+0x00000059,0x00000454,0x00000181,0x00000453,
+0x0004007c,0x00000006,0x00000455,0x00000454,
+0x0004003d,0x00000006,0x00000456,0x00000437,
+0x00050080,0x00000006,0x00000457,0x00000455,
+0x00000456,0x0003003e,0x00000459,0x00000450,
+0x00050041,0x00000007,0x0000045a,0x00000459,
+0x00000457,0x0004003d,0x00000006,0x0000045b,
+0x0000045a,0x000200fe,0x0000045b,0x000200f8,
+0x0000045d,0x00050041,0x00000007,0x0000045e,
+0x00000034,0x000000c2,0x0004003d,0x00000006,
+0x0000045f,0x0000045e,0x000500aa,0x000000cf,
+0x00000460,0x0000045f,0x000000c2,0x000300f7,
+0x00000462,0x00000000,0x000400fa,0x00000460,
+0x00000461,0x0000048b,0x000200f8,0x00000461,
+0x0004003d,0x00000006,0x00000464,0x00000036,
+0x00050086,0x00000006,0x00000465,0x00000464,
+0x000000b8,0x0004003d,0x00000006,0x00000466,
+0x00000428,0x00050084,0x00000006,0x00000467,
+0x000000b8,0x00000466,0x00050080,0x00000006,
+0x00000468,0x00000467,0x000000b0,0x00050084,
+0x00000006,0x00000469,0x00000465,0x00000468,
+0x0003003e,0x00000463,0x00000469,0x0004003d,
+0x00000006,0x0000046b,0x00000036,0x00050089,
+0x00000006,0x0000046c,0x0000046b,0x000000b8,
+0x0004003d,0x0000000f,0x0000046e,0x00000033,
+0x0003003e,0x0000046d,0x0000046e,0x0004003d,
+0x00000006,0x00000470,0x00000463,0x0003003e,
+0x0000046f,0x00000470,0x0004003d,0x00000006,
+0x00000472,0x00000428,0x0003003e,0x00000471,
+0x00000472,0x0003003e,0x00000473,0x0000046c,
+0x00080039,0x00000006,0x00000474,0x00000030,
+0x0000046d,0x0000046f,0x00000471,0x00000473,
+0x0003003e,0x0000046a,0x00000474,0x0004003d,
+0x00000006,0x0000047f,0x00000428,0x000500c4,
+0x00000059,0x00000480,0x000000ed,0x0000047f,
+0x00050082,0x00000059,0x00000481,0x00000480,
+0x000000ed,0x00050084,0x00000059,0x00000482,
+0x000000f2,0x00000481,0x0004007c,0x00000006,
+0x00000483,0x00000482,0x0004003d,0x00000006,
+0x00000484,0x0000046a,0x00050080,0x00000006,
+0x00000485,0x00000483,0x00000484,0x0003003e,
+0x00000487,0x0000047e,0x00050041,0x00000007,
+0x00000488,0x00000487,0x00000485,0x0004003d,
+0x00000006,0x00000489,0x00000488,0x000200fe,
+0x00000489,0x000200f8,0x0000048b,0x0004003d,
+0x00000006,0x0000048d,0x00000036,0x0004003d,
+0x00000006,0x0000048e,0x00000428,0x00050084,
+0x00000006,0x0000048f,0x0000048d,0x0000048e,
+0x0003003e,0x0000048c,0x0000048f,0x0004003d,
+0x0000000f,0x00000492,0x00000033,0x0003003e,
+0x00000491,0x00000492,0x0004003d,0x00000006,
+0x00000494,0x0000048c,0x0003003e,0x00000493,
+0x00000494,0x0004003d,0x00000006,0x00000496,
+0x00000428,0x0003003e,0x00000495,0x00000496,
+0x00070039,0x00000006,0x00000497,0x0000001c,
+0x00000491,0x00000493,0x00000495,0x0003003e,
+0x00000490,0x00000497,0x0004003d,0x00000006,
+0x000004a1,0x00000428,0x00050082,0x00000006,
+0x000004a2,0x000004a1,0x000000c2,0x0003003e,
+0x000004a4,0x000004a0,0x00050041,0x00000012,
+0x000004a5,0x000004a4,0x000004a2,0x0004003d,
+0x00000011,0x000004a6,0x000004a5,0x0003003e,
+0x00000498,0x000004a6,0x0004003d,0x00000006,
+0x000004a7,0x00000490,0x00050041,0x00000007,
+0x000004a8,0x00000498,0x000000bf,0x0004003d,
+0x00000006,0x000004a9,0x000004a8,0x00050084,
+0x00000006,0x000004aa,0x000004a7,0x000004a9,
+0x0004003d,0x00000006,0x000004ab,0x00000490,
+0x00050041,0x00000007,0x000004ac,0x00000498,
+0x000000c2,0x0004003d,0x00000006,0x000004ad,
+0x000004ac,0x000500c2,0x00000006,0x000004ae,
+0x000004ab,0x000004ad,0x000500c5,0x00000006,
+0x000004af,0x000004aa,0x000004ae,0x0003003e,
+0x00000490,0x000004af,0x0004003d,0x00000006,
+0x000004b0,0x00000490,0x000500ac,0x000000cf,
+0x000004b1,0x000004b0,0x000001c3,0x000300f7,
+0x000004b3,0x00000000,0x000400fa,0x000004b1,
+0x000004b2,0x000004b3,0x000200f8,0x000004b2,
+0x0004003d,0x00000006,0x000004b4,0x00000490,
+0x00050080,0x00000006,0x000004b5,0x000004b4,
+0x000000c2,0x0003003e,0x00000490,0x000004b5,
+0x000200f9,0x000004b3,0x000200f8,0x000004b3,
+0x0004003d,0x00000006,0x000004b6,0x00000490,
+0x000200fe,0x000004b6,0x000200f8,0x00000462,
+0x000100ff,0x000200f8,0x0000042f,0x000100ff,
+0x00010038,0x00050036,0x00000006,0x00000042,
+0x00000000,0x00000039,0x00030037,0x00000010,
+0x0000003a,0x00030037,0x00000009,0x0000003b,
+0x00030037,0x00000007,0x0000003c,0x00030037,
+0x00000007,0x0000003d,0x00030037,0x00000007,
+0x0000003e,0x00030037,0x00000007,0x0000003f,
+0x00030037,0x00000007,0x00000040,0x00030037,
+0x00000012,0x00000041,0x000200f8,0x00000043,
+0x0004003b,0x00000010,0x000004b9,0x00000007,
+0x0004003b,0x00000010,0x000004c7,0x00000007,
+0x0004003b,0x00000010,0x000004c8,0x00000007,
+0x0004003b,0x00000009,0x000004ca,0x00000007,
+0x0004003b,0x00000007,0x000004cc,0x00000007,
+0x0004003b,0x00000007,0x000004ce,0x00000007,
+0x0004003b,0x00000010,0x000004d2,0x00000007,
+0x0004003b,0x00000009,0x000004d4,0x00000007,
+0x0004003b,0x00000007,0x000004d6,0x00000007,
+0x0004003b,0x00000007,0x000004d8,0x00000007,
+0x0004003b,0x00000010,0x000004dc,0x00000007,
+0x0004003b,0x00000009,0x000004de,0x00000007,
+0x0004003b,0x00000007,0x000004e0,0x00000007,
+0x0004003b,0x00000007,0x000004e2,0x00000007,
+0x0004003b,0x00000010,0x000004e6,0x00000007,
+0x0004003b,0x00000009,0x000004e8,0x00000007,
+0x0004003b,0x00000007,0x000004ea,0x00000007,
+0x0004003b,0x00000007,0x000004ec,0x00000007,
+0x0004003b,0x00000007,0x000004f1,0x00000007,
+0x0004003b,0x00000010,0x000004f9,0x00000007,
+0x0004003d,0x00000006,0x000004ba,0x0000003f,
+0x0004003d,0x00000006,0x000004bb,0x0000003d,
+0x00070050,0x0000000f,0x000004bc,0x000004bb,
+0x000004bb,0x000004bb,0x000004bb,0x0004003d,
+0x00000006,0x000004bd,0x0000003e,0x0004003d,
+0x00000006,0x000004be,0x0000003e,0x00050080,
+0x00000006,0x000004bf,0x000004be,0x000000c2,
+0x00070050,0x0000000f,0x000004c0,0x000000bf,
+0x000000c2,0x000004bd,0x000004bf,0x00050080,
+0x0000000f,0x000004c1,0x000004bc,0x000004c0,
+0x00070050,0x0000000f,0x000004c2,0x000004ba,
+0x000004ba,0x000004ba,0x000004ba,0x00050084,
+0x0000000f,0x000004c3,0x000004c2,0x000004c1,
+0x0004003d,0x00000006,0x000004c4,0x00000040,
+0x00070050,0x0000000f,0x000004c5,0x000004c4,
+0x000004c4,0x000004c4,0x000004c4,0x00050080,
+0x0000000f,0x000004c6,0x000004c3,0x000004c5,
+0x0003003e,0x000004b9,0x000004c6,0x0004003d,
+0x0000000f,0x000004c9,0x0000003a,0x0003003e,
+0x000004c8,0x000004c9,0x0004003d,0x00000008,
+0x000004cb,0x0000003b,0x0003003e,0x000004ca,
+0x000004cb,0x0004003d,0x00000006,0x000004cd,
+0x0000003c,0x0003003e,0x000004cc,0x000004cd,
+0x00050041,0x00000007,0x000004cf,0x000004b9,
+0x000000bf,0x0004003d,0x00000006,0x000004d0,
+0x000004cf,0x0003003e,0x000004ce,0x000004d0,
+0x00080039,0x00000006,0x000004d1,0x00000037,
+0x000004c8,0x000004ca,0x000004cc,0x000004ce,
+0x0004003d,0x0000000f,0x000004d3,0x0000003a,
+0x0003003e,0x000004d2,0x000004d3,0x0004003d,
+0x00000008,0x000004d5,0x0000003b,0x0003003e,
+0x000004d4,0x000004d5,0x0004003d,0x00000006,
+0x000004d7,0x0000003c,0x0003003e,0x000004d6,
+0x000004d7,0x00050041,0x00000007,0x000004d9,
+0x000004b9,0x000000c2,0x0004003d,0x00000006,
+0x000004da,0x000004d9,0x0003003e,0x000004d8,
+0x000004da,0x00080039,0x00000006,0x000004db,
+0x00000037,0x000004d2,0x000004d4,0x000004d6,
+0x000004d8,0x0004003d,0x0000000f,0x000004dd,
+0x0000003a,0x0003003e,0x000004dc,0x000004dd,
+0x0004003d,0x00000008,0x000004df,0x0000003b,
+0x0003003e,0x000004de,0x000004df,0x0004003d,
+0x00000006,0x000004e1,0x0000003c,0x0003003e,
+0x000004e0,0x000004e1,0x00050041,0x00000007,
+0x000004e3,0x000004b9,0x000000b4,0x0004003d,
+0x00000006,0x000004e4,0x000004e3,0x0003003e,
+0x000004e2,0x000004e4,0x00080039,0x00000006,
+0x000004e5,0x00000037,0x000004dc,0x000004de,
+0x000004e0,0x000004e2,0x0004003d,0x0000000f,
+0x000004e7,0x0000003a,0x0003003e,0x000004e6,
+0x000004e7,0x0004003d,0x00000008,0x000004e9,
+0x0000003b,0x0003003e,0x000004e8,0x000004e9,
+0x0004003d,0x00000006,0x000004eb,0x0000003c,
+0x0003003e,0x000004ea,0x000004eb,0x00050041,
+0x00000007,0x000004ed,0x000004b9,0x000000b8,
+0x0004003d,0x00000006,0x000004ee,0x000004ed,
+0x0003003e,0x000004ec,0x000004ee,0x00080039,
+0x00000006,0x000004ef,0x00000037,0x000004e6,
+0x000004e8,0x000004ea,0x000004ec,0x00070050,
+0x0000000f,0x000004f0,0x000004d1,0x000004db,
+0x000004e5,0x000004ef,0x0003003e,0x000004c7,
+0x000004f0,0x00050041,0x00000007,0x000004f2,
+0x00000041,0x000000bf,0x0004003d,0x00000006,
+0x000004f3,0x000004f2,0x00050041,0x00000007,
+0x000004f4,0x00000041,0x000000c2,0x0004003d,
+0x00000006,0x000004f5,0x000004f4,0x00050084,
+0x00000006,0x000004f6,0x000004f3,0x000004f5,
+0x00050080,0x00000006,0x000004f7,0x000004f6,
+0x000000af,0x000500c2,0x00000006,0x000004f8,
+0x000004f7,0x000000ec,0x0003003e,0x000004f1,
+0x000004f8,0x00050041,0x00000007,0x000004fa,
+0x00000041,0x000000bf,0x0004003d,0x00000006,
+0x000004fb,0x000004fa,0x00050082,0x00000006,
+0x000004fc,0x00000170,0x000004fb,0x00050041,
+0x00000007,0x000004fd,0x00000041,0x000000c2,
+0x0004003d,0x00000006,0x000004fe,0x000004fd,
+0x00050082,0x00000006,0x000004ff,0x000004fc,
+0x000004fe,0x0004003d,0x00000006,0x00000500,
+0x000004f1,0x00050080,0x00000006,0x00000501,
+0x000004ff,0x00000500,0x00050041,0x00000007,
+0x00000502,0x00000041,0x000000bf,0x0004003d,
+0x00000006,0x00000503,0x00000502,0x0004003d,
+0x00000006,0x00000504,0x000004f1,0x00050082,
+0x00000006,0x00000505,0x00000503,0x00000504,
+0x00050041,0x00000007,0x00000506,0x00000041,
+0x000000c2,0x0004003d,0x00000006,0x00000507,
+0x00000506,0x0004003d,0x00000006,0x00000508,
+0x000004f1,0x00050082,0x00000006,0x00000509,
+0x00000507,0x00000508,0x0004003d,0x00000006,
+0x0000050a,0x000004f1,0x00070050,0x0000000f,
+0x0000050b,0x00000501,0x00000505,0x00000509,
+0x0000050a,0x0003003e,0x000004f9,0x0000050b,
+0x0004003d,0x0000000f,0x0000050c,0x000004c7,
+0x00040070,0x0000050d,0x0000050e,0x0000050c,
+0x0004003d,0x0000000f,0x0000050f,0x000004f9,
+0x00040070,0x0000050d,0x00000510,0x0000050f,
+0x00050094,0x0000008b,0x00000511,0x0000050e,
+0x00000510,0x00050081,0x0000008b,0x00000513,
+0x00000511,0x00000512,0x0004006d,0x00000006,
+0x00000514,0x00000513,0x000500c2,0x00000006,
+0x00000515,0x00000514,0x000000ec,0x000200fe,
+0x00000515,0x00010038,0x00050036,0x00000011,
+0x00000047,0x00000000,0x00000044,0x00030037,
+0x00000010,0x00000045,0x00030037,0x00000011,
+0x00000046,0x000200f8,0x00000048,0x0004003b,
+0x00000012,0x00000518,0x00000007,0x0004003b,
+0x00000012,0x00000523,0x00000007,0x0004003b,
+0x00000012,0x00000526,0x00000007,0x0004003b,
+0x00000012,0x00000532,0x00000007,0x0004003b,
+0x00000012,0x00000536,0x00000007,0x0004003b,
+0x00000007,0x0000053b,0x00000007,0x0004003b,
+0x00000007,0x0000053e,0x00000007,0x0004003b,
+0x00000012,0x00000546,0x00000007,0x0004003b,
+0x00000010,0x0000054c,0x00000007,0x0004003b,
+0x00000009,0x0000054e,0x00000007,0x0004003b,
+0x00000007,0x00000550,0x00000007,0x0004003b,
+0x00000007,0x00000552,0x00000007,0x0004003b,
+0x00000007,0x00000554,0x00000007,0x0004003b,
+0x00000007,0x00000556,0x00000007,0x0004003b,
+0x00000007,0x00000557,0x00000007,0x0004003b,
+0x00000012,0x00000558,0x00000007,0x0004003b,
+0x00000010,0x0000055f,0x00000007,0x0004003b,
+0x00000009,0x00000561,0x00000007,0x0004003b,
+0x00000007,0x00000563,0x00000007,0x0004003b,
+0x00000007,0x00000565,0x00000007,0x0004003b,
+0x00000007,0x00000567,0x00000007,0x0004003b,
+0x00000007,0x00000569,0x00000007,0x0004003b,
+0x00000007,0x0000056a,0x00000007,0x0004003b,
+0x00000012,0x0000056b,0x00000007,0x0004003d,
+0x00000011,0x0000051a,0x000000cd,0x00050050,
+0x00000011,0x0000051b,0x000000b4,0x000000b4,
+0x00050086,0x00000011,0x0000051c,0x0000051a,
+0x0000051b,0x00050050,0x00000011,0x0000051d,
+0x00000519,0x00000519,0x00050080,0x00000011,
+0x0000051e,0x0000051d,0x0000051c,0x0004003d,
+0x00000011,0x0000051f,0x000000cd,0x00050050,
+0x00000011,0x00000520,0x000000c2,0x000000c2,
+0x00050082,0x00000011,0x00000521,0x0000051f,
+0x00000520,0x00050086,0x00000011,0x00000522,
+0x0000051e,0x00000521,0x0003003e,0x00000518,
+0x00000522,0x0004003d,0x00000011,0x00000524,
+0x00000518,0x00050084,0x00000011,0x00000525,
+0x00000046,0x00000524,0x0003003e,0x00000523,
+0x00000525,0x0004003d,0x00000011,0x00000527,
+0x00000523,0x0004003d,0x00000011,0x00000528,
+0x00000113,0x00050050,0x00000011,0x00000529,
+0x000000c2,0x000000c2,0x00050082,0x00000011,
+0x0000052a,0x00000528,0x00000529,0x00050084,
+0x00000011,0x0000052b,0x00000527,0x0000052a,
+0x00050050,0x00000011,0x0000052c,0x000001c3,
+0x000001c3,0x00050080,0x00000011,0x0000052d,
+0x0000052b,0x0000052c,0x00050050,0x0000052f,
+0x00000530,0x0000052e,0x0000052e,0x000500c2,
+0x00000011,0x00000531,0x0000052d,0x00000530,
+0x0003003e,0x00000526,0x00000531,0x0004003d,
+0x00000011,0x00000533,0x00000526,0x00050050,
+0x0000052f,0x00000534,0x000000ec,0x000000ec,
+0x000500c2,0x00000011,0x00000535,0x00000533,
+0x00000534,0x0003003e,0x00000532,0x00000535,
+0x0004003d,0x00000011,0x00000537,0x00000526,
+0x00050050,0x00000011,0x00000539,0x00000538,
+0x00000538,0x000500c7,0x00000011,0x0000053a,
+0x00000537,0x00000539,0x0003003e,0x00000536,
+0x0000053a,0x00050041,0x000000d4,0x0000053c,
+0x00000113,0x000000bf,0x0004003d,0x00000006,
+0x0000053d,0x0000053c,0x0003003e,0x0000053b,
+0x0000053d,0x00050041,0x00000007,0x0000053f,
+0x00000532,0x000000c2,0x0004003d,0x00000006,
+0x00000540,0x0000053f,0x0004003d,0x00000006,
+0x00000541,0x0000053b,0x00050084,0x00000006,
+0x00000542,0x00000540,0x00000541,0x00050041,
+0x00000007,0x00000543,0x00000532,0x000000bf,
+0x0004003d,0x00000006,0x00000544,0x00000543,
+0x00050080,0x00000006,0x00000545,0x00000542,
+0x00000544,0x0003003e,0x0000053e,0x00000545,
+0x0003003e,0x00000546,0x00000547,0x0004003d,
+0x000000cf,0x00000548,0x000000fe,0x000600a9,
+0x00000059,0x00000549,0x00000548,0x000000ed,
+0x000000e2,0x000500c4,0x00000059,0x0000054a,
+0x000000ed,0x00000549,0x0004007c,0x00000006,
+0x0000054b,0x0000054a,0x0004003d,0x0000000f,
+0x0000054d,0x00000045,0x0003003e,0x0000054c,
+0x0000054d,0x0004003d,0x00000008,0x0000054f,
+0x0000016f,0x0003003e,0x0000054e,0x0000054f,
+0x0004003d,0x00000006,0x00000551,0x00000189,
+0x0003003e,0x00000550,0x00000551,0x0004003d,
+0x00000006,0x00000553,0x0000053e,0x0003003e,
+0x00000552,0x00000553,0x0004003d,0x00000006,
+0x00000555,0x0000053b,0x0003003e,0x00000554,
+0x00000555,0x0003003e,0x00000556,0x0000054b,
+0x0003003e,0x00000557,0x000000bf,0x0004003d,
+0x00000011,0x00000559,0x00000536,0x0003003e,
+0x00000558,0x00000559,0x000c0039,0x00000006,
+0x0000055a,0x00000042,0x0000054c,0x0000054e,
+0x00000550,0x00000552,0x00000554,0x00000556,
+0x00000557,0x00000558,0x00050041,0x00000007,
+0x0000055b,0x00000546,0x000000bf,0x0003003e,
+0x0000055b,0x0000055a,0x0004003d,0x000000cf,
+0x0000055c,0x000000fe,0x000300f7,0x0000055e,
+0x00000000,0x000400fa,0x0000055c,0x0000055d,
+0x0000055e,0x000200f8,0x0000055d,0x0004003d,
+0x0000000f,0x00000560,0x00000045,0x0003003e,
+0x0000055f,0x00000560,0x0004003d,0x00000008,
+0x00000562,0x0000016f,0x0003003e,0x00000561,
+0x00000562,0x0004003d,0x00000006,0x00000564,
+0x00000189,0x0003003e,0x00000563,0x00000564,
+0x0004003d,0x00000006,0x00000566,0x0000053e,
+0x0003003e,0x00000565,0x00000566,0x0004003d,
+0x00000006,0x00000568,0x0000053b,0x0003003e,
+0x00000567,0x00000568,0x0003003e,0x00000569,
+0x000000b4,0x0003003e,0x0000056a,0x000000c2,
+0x0004003d,0x00000011,0x0000056c,0x00000536,
+0x0003003e,0x0000056b,0x0000056c,0x000c0039,
+0x00000006,0x0000056d,0x00000042,0x0000055f,
+0x00000561,0x00000563,0x00000565,0x00000567,
+0x00000569,0x0000056a,0x0000056b,0x00050041,
+0x00000007,0x0000056e,0x00000546,0x000000c2,
+0x0003003e,0x0000056e,0x0000056d,0x000200f9,
+0x0000055e,0x000200f8,0x0000055e,0x0004003d,
+0x00000011,0x0000056f,0x00000546,0x000200fe,
+0x0000056f,0x00010038,0x00050036,0x00000006,
+0x0000004b,0x00000000,0x00000049,0x00030037,
+0x00000007,0x0000004a,0x000200f8,0x0000004c,
+0x0004003d,0x00000006,0x00000572,0x0000004a,
+0x000500c2,0x00000006,0x00000574,0x00000572,
+0x00000573,0x0004003d,0x00000006,0x00000575,
+0x0000004a,0x000500c6,0x00000006,0x00000576,
+0x00000575,0x00000574,0x0003003e,0x0000004a,
+0x00000576,0x0004003d,0x00000006,0x00000577,
+0x0000004a,0x000500c4,0x00000006,0x00000579,
+0x00000577,0x00000578,0x0004003d,0x00000006,
+0x0000057a,0x0000004a,0x00050082,0x00000006,
+0x0000057b,0x0000057a,0x00000579,0x0003003e,
+0x0000004a,0x0000057b,0x0004003d,0x00000006,
+0x0000057c,0x0000004a,0x000500c4,0x00000006,
+0x0000057d,0x0000057c,0x000000f7,0x0004003d,
+0x00000006,0x0000057e,0x0000004a,0x00050080,
+0x00000006,0x0000057f,0x0000057e,0x0000057d,
+0x0003003e,0x0000004a,0x0000057f,0x0004003d,
+0x00000006,0x00000580,0x0000004a,0x000500c4,
+0x00000006,0x00000581,0x00000580,0x000000ec,
+0x0004003d,0x00000006,0x00000582,0x0000004a,
+0x00050080,0x00000006,0x00000583,0x00000582,
+0x00000581,0x0003003e,0x0000004a,0x00000583,
+0x0004003d,0x00000006,0x00000584,0x0000004a,
+0x000500c2,0x00000006,0x00000585,0x00000584,
+0x000000f2,0x0004003d,0x00000006,0x00000586,
+0x0000004a,0x000500c6,0x00000006,0x00000587,
+0x00000586,0x00000585,0x0003003e,0x0000004a,
+0x00000587,0x0004003d,0x00000006,0x00000588,
+0x0000004a,0x000500c4,0x00000006,0x0000058a,
+0x00000588,0x00000589,0x0004003d,0x00000006,
+0x0000058b,0x0000004a,0x00050080,0x00000006,
+0x0000058c,0x0000058b,0x0000058a,0x0003003e,
+0x0000004a,0x0000058c,0x0004003d,0x00000006,
+0x0000058d,0x0000004a,0x000500c2,0x00000006,
+0x0000058e,0x0000058d,0x000000f7,0x0004003d,
+0x00000006,0x0000058f,0x0000004a,0x000500c6,
+0x00000006,0x00000590,0x0000058f,0x0000058e,
+0x0003003e,0x0000004a,0x00000590,0x0004003d,
+0x00000006,0x00000591,0x0000004a,0x000500c2,
+0x00000006,0x00000592,0x00000591,0x00000181,
+0x0004003d,0x00000006,0x00000593,0x0000004a,
+0x000500c6,0x00000006,0x00000594,0x00000593,
+0x00000592,0x0003003e,0x0000004a,0x00000594,
+0x0004003d,0x00000006,0x00000595,0x0000004a,
+0x000500c4,0x00000006,0x00000596,0x00000595,
+0x0000052e,0x0004003d,0x00000006,0x00000597,
+0x0000004a,0x000500c6,0x00000006,0x00000598,
+0x00000597,0x00000596,0x0003003e,0x0000004a,
+0x00000598,0x0004003d,0x00000006,0x00000599,
+0x0000004a,0x000500c2,0x00000006,0x0000059a,
+0x00000599,0x00000578,0x0004003d,0x00000006,
+0x0000059b,0x0000004a,0x000500c6,0x00000006,
+0x0000059c,0x0000059b,0x0000059a,0x0003003e,
+0x0000004a,0x0000059c,0x0004003d,0x00000006,
+0x0000059d,0x0000004a,0x000200fe,0x0000059d,
+0x00010038,0x00050036,0x00000006,0x00000051,
+0x00000000,0x0000004d,0x00030037,0x00000007,
+0x0000004e,0x00030037,0x00000012,0x0000004f,
+0x00030037,0x00000007,0x00000050,0x000200f8,
+0x00000052,0x0004003b,0x00000007,0x000005b5,
+0x00000007,0x0004003b,0x00000007,0x000005b6,
+0x00000007,0x0004003b,0x00000010,0x000005b9,
+0x00000007,0x0004003b,0x00000010,0x000005c5,
+0x00000007,0x0004003b,0x00000012,0x000005d8,
+0x00000007,0x0004003b,0x00000010,0x000005e3,
+0x00000007,0x0004003b,0x00000010,0x000005e7,
+0x00000007,0x0004003b,0x00000010,0x000005f6,
+0x00000007,0x0004003d,0x00000006,0x000005a0,
+0x00000050,0x000500aa,0x000000cf,0x000005a1,
+0x000005a0,0x000000c2,0x000300f7,0x000005a3,
+0x00000000,0x000400fa,0x000005a1,0x000005a2,
+0x000005a3,0x000200f8,0x000005a2,0x000200fe,
+0x000000bf,0x000200f8,0x000005a3,0x00050041,
+0x000000d4,0x000005a5,0x000000cd,0x000000bf,
+0x0004003d,0x00000006,0x000005a6,0x000005a5,
+0x00050041,0x000000d4,0x000005a7,0x000000cd,
+0x000000c2,0x0004003d,0x00000006,0x000005a8,
+0x000005a7,0x00050084,0x00000006,0x000005a9,
+0x000005a6,0x000005a8,0x000500b0,0x000000cf,
+0x000005aa,0x000005a9,0x000001cf,0x000300f7,
+0x000005ac,0x00000000,0x000400fa,0x000005aa,
+0x000005ab,0x000005ac,0x000200f8,0x000005ab,
+0x0004003d,0x00000011,0x000005ad,0x0000004f,
+0x00050050,0x0000052f,0x000005ae,0x000000ed,
+0x000000ed,0x000500c4,0x00000011,0x000005af,
+0x000005ad,0x000005ae,0x0003003e,0x0000004f,
+0x000005af,0x000200f9,0x000005ac,0x000200f8,
+0x000005ac,0x0004003d,0x00000006,0x000005b0,
+0x00000050,0x00050084,0x00000006,0x000005b1,
+0x00000519,0x000005b0,0x0004003d,0x00000006,
+0x000005b2,0x0000004e,0x00050082,0x00000006,
+0x000005b3,0x000005b2,0x00000519,0x00050080,
+0x00000006,0x000005b4,0x000005b1,0x000005b3,
+0x0003003e,0x0000004e,0x000005b4,0x0004003d,
+0x00000006,0x000005b7,0x0000004e,0x0003003e,
+0x000005b6,0x000005b7,0x00050039,0x00000006,
+0x000005b8,0x0000004b,0x000005b6,0x0003003e,
+0x000005b5,0x000005b8,0x0004003d,0x00000006,
+0x000005ba,0x000005b5,0x000600cb,0x00000006,
+0x000005bb,0x000005ba,0x000000e2,0x000000ec,
+0x0004003d,0x00000006,0x000005bc,0x000005b5,
+0x000600cb,0x00000006,0x000005bd,0x000005bc,
+0x000000ec,0x000000ec,0x0004003d,0x00000006,
+0x000005be,0x000005b5,0x000600cb,0x00000006,
+0x000005c0,0x000005be,0x000005bf,0x000000ec,
+0x0004003d,0x00000006,0x000005c1,0x000005b5,
+0x000600cb,0x00000006,0x000005c3,0x000005c1,
+0x000005c2,0x000000ec,0x00070050,0x0000000f,
+0x000005c4,0x000005bb,0x000005bd,0x000005c0,
+0x000005c3,0x0003003e,0x000005b9,0x000005c4,
+0x0004003d,0x00000006,0x000005c6,0x000005b5,
+0x000600cb,0x00000006,0x000005c7,0x000005c6,
+0x00000589,0x000000ec,0x0004003d,0x00000006,
+0x000005c8,0x000005b5,0x000600cb,0x00000006,
+0x000005ca,0x000005c8,0x000005c9,0x000000ec,
+0x0004003d,0x00000006,0x000005cb,0x000005b5,
+0x000600cb,0x00000006,0x000005cd,0x000005cb,
+0x000005cc,0x000000ec,0x0004003d,0x00000006,
+0x000005ce,0x000005b5,0x000600cb,0x00000006,
+0x000005d0,0x000005ce,0x000005cf,0x000000ec,
+0x00070050,0x0000000f,0x000005d1,0x000005c7,
+0x000005ca,0x000005cd,0x000005d0,0x0003003e,
+0x000005c5,0x000005d1,0x0004003d,0x0000000f,
+0x000005d2,0x000005b9,0x0004003d,0x0000000f,
+0x000005d3,0x000005b9,0x00050084,0x0000000f,
+0x000005d4,0x000005d2,0x000005d3,0x0003003e,
+0x000005b9,0x000005d4,0x0004003d,0x0000000f,
+0x000005d5,0x000005c5,0x0004003d,0x0000000f,
+0x000005d6,0x000005c5,0x00050084,0x0000000f,
+0x000005d7,0x000005d5,0x000005d6,0x0003003e,
+0x000005c5,0x000005d7,0x0004003d,0x00000006,
+0x000005d9,0x0000004e,0x000500c7,0x00000006,
+0x000005da,0x000005d9,0x000000b4,0x000500ab,
+0x000000cf,0x000005db,0x000005da,0x000000bf,
+0x000600a9,0x00000059,0x000005dc,0x000005db,
+0x000000ec,0x000000f2,0x0004007c,0x00000006,
+0x000005dd,0x000005dc,0x0004003d,0x00000006,
+0x000005de,0x00000050,0x000500aa,0x000000cf,
+0x000005df,0x000005de,0x000000b8,0x000600a9,
+0x00000059,0x000005e0,0x000005df,0x0000052e,
+0x000000f2,0x0004007c,0x00000006,0x000005e1,
+0x000005e0,0x00050050,0x00000011,0x000005e2,
+0x000005dd,0x000005e1,0x0003003e,0x000005d8,
+0x000005e2,0x0004003d,0x00000006,0x000005e4,
+0x0000004e,0x000500c7,0x00000006,0x000005e5,
+0x000005e4,0x000000c2,0x000500ab,0x000000cf,
+0x000005e6,0x000005e5,0x000000bf,0x000300f7,
+0x000005e9,0x00000000,0x000400fa,0x000005e6,
+0x000005e8,0x000005ec,0x000200f8,0x000005e8,
+0x0004003d,0x00000011,0x000005ea,0x000005d8,
+0x0009004f,0x0000000f,0x000005eb,0x000005ea,
+0x000005ea,0x00000000,0x00000001,0x00000000,
+0x00000001,0x0003003e,0x000005e7,0x000005eb,
+0x000200f9,0x000005e9,0x000200f8,0x000005ec,
+0x0004003d,0x00000011,0x000005ed,0x000005d8,
+0x0009004f,0x0000000f,0x000005ee,0x000005ed,
+0x000005ed,0x00000001,0x00000000,0x00000001,
+0x00000000,0x0003003e,0x000005e7,0x000005ee,
+0x000200f9,0x000005e9,0x000200f8,0x000005e9,
+0x0004003d,0x0000000f,0x000005ef,0x000005e7,
+0x0003003e,0x000005e3,0x000005ef,0x0004003d,
+0x0000000f,0x000005f0,0x000005e3,0x0004003d,
+0x0000000f,0x000005f1,0x000005b9,0x000500c2,
+0x0000000f,0x000005f2,0x000005f1,0x000005f0,
+0x0003003e,0x000005b9,0x000005f2,0x0004003d,
+0x0000000f,0x000005f3,0x000005e3,0x0004003d,
+0x0000000f,0x000005f4,0x000005c5,0x000500c2,
+0x0000000f,0x000005f5,0x000005f4,0x000005f3,
+0x0003003e,0x000005c5,0x000005f5,0x0004003d,
+0x0000000f,0x000005f7,0x000005b9,0x0007004f,
+0x00000011,0x000005f8,0x000005f7,0x000005f7,
+0x00000000,0x00000001,0x00040070,0x000005f9,
+0x000005fa,0x000005f8,0x0004003d,0x00000011,
+0x000005fb,0x0000004f,0x00040070,0x000005f9,
+0x000005fc,0x000005fb,0x00050094,0x0000008b,
+0x000005fd,0x000005fa,0x000005fc,0x0004006d,
+0x00000006,0x000005fe,0x000005fd,0x0004003d,
+0x0000000f,0x000005ff,0x000005b9,0x0007004f,
+0x00000011,0x00000600,0x000005ff,0x000005ff,
+0x00000002,0x00000003,0x00040070,0x000005f9,
+0x00000601,0x00000600,0x0004003d,0x00000011,
+0x00000602,0x0000004f,0x00040070,0x000005f9,
+0x00000603,0x00000602,0x00050094,0x0000008b,
+0x00000604,0x00000601,0x00000603,0x0004006d,
+0x00000006,0x00000605,0x00000604,0x0004003d,
+0x0000000f,0x00000606,0x000005c5,0x0007004f,
+0x00000011,0x00000607,0x00000606,0x00000606,
+0x00000000,0x00000001,0x00040070,0x000005f9,
+0x00000608,0x00000607,0x0004003d,0x00000011,
+0x00000609,0x0000004f,0x00040070,0x000005f9,
+0x0000060a,0x00000609,0x00050094,0x0000008b,
+0x0000060b,0x00000608,0x0000060a,0x0004006d,
+0x00000006,0x0000060c,0x0000060b,0x0004003d,
+0x0000000f,0x0000060d,0x000005c5,0x0007004f,
+0x00000011,0x0000060e,0x0000060d,0x0000060d,
+0x00000002,0x00000003,0x00040070,0x000005f9,
+0x0000060f,0x0000060e,0x0004003d,0x00000011,
+0x00000610,0x0000004f,0x00040070,0x000005f9,
+0x00000611,0x00000610,0x00050094,0x0000008b,
+0x00000612,0x0000060f,0x00000611,0x0004006d,
+0x00000006,0x00000613,0x00000612,0x00070050,
+0x0000000f,0x00000614,0x000005fe,0x00000605,
+0x0000060c,0x00000613,0x0004003d,0x00000006,
+0x00000615,0x000005b5,0x00070050,0x0000000f,
+0x00000616,0x00000615,0x00000615,0x00000615,
+0x00000615,0x000500c2,0x0000000f,0x00000618,
+0x00000616,0x00000617,0x00050080,0x0000000f,
+0x00000619,0x00000614,0x00000618,0x0003003e,
+0x000005f6,0x00000619,0x0004003d,0x0000000f,
+0x0000061b,0x000005f6,0x000500c7,0x0000000f,
+0x0000061c,0x0000061b,0x0000061a,0x0003003e,
+0x000005f6,0x0000061c,0x0004003d,0x00000006,
+0x0000061d,0x00000050,0x000500aa,0x000000cf,
+0x0000061e,0x0000061d,0x000000b4,0x000300f7,
+0x00000620,0x00000000,0x000400fa,0x0000061e,
+0x0000061f,0x00000625,0x000200f8,0x0000061f,
+0x00050041,0x00000007,0x00000621,0x000005f6,
+0x000000b4,0x00050051,0x00000006,0x00000622,
+0x00000547,0x00000000,0x0003003e,0x00000621,
+0x00000622,0x00050041,0x00000007,0x00000623,
+0x000005f6,0x000000b8,0x00050051,0x00000006,
+0x00000624,0x00000547,0x00000001,0x0003003e,
+0x00000623,0x00000624,0x000200f9,0x00000620,
+0x000200f8,0x00000625,0x0004003d,0x00000006,
+0x00000626,0x00000050,0x000500aa,0x000000cf,
+0x00000627,0x00000626,0x000000b8,0x000300f7,
+0x00000629,0x00000000,0x000400fa,0x00000627,
+0x00000628,0x00000629,0x000200f8,0x00000628,
+0x00050041,0x00000007,0x0000062a,0x000005f6,
+0x000000b8,0x0003003e,0x0000062a,0x000000bf,
+0x000200f9,0x00000629,0x000200f8,0x00000629,
+0x000200f9,0x00000620,0x000200f8,0x00000620,
+0x00050041,0x00000007,0x0000062b,0x000005f6,
+0x000000bf,0x0004003d,0x00000006,0x0000062c,
+0x0000062b,0x00060050,0x00000008,0x0000062d,
+0x0000062c,0x0000062c,0x0000062c,0x0004003d,
+0x0000000f,0x0000062e,0x000005f6,0x0008004f,
+0x00000008,0x0000062f,0x0000062e,0x0000062e,
+0x00000001,0x00000002,0x00000003,0x000500ae,
+0x00000630,0x00000631,0x0000062d,0x0000062f,
+0x0004009b,0x000000cf,0x00000632,0x00000631,
+0x000300f7,0x00000634,0x00000000,0x000400fa,
+0x00000632,0x00000633,0x00000636,0x000200f8,
+0x00000633,0x000200fe,0x000000bf,0x000200f8,
+0x00000636,0x00050041,0x00000007,0x00000637,
+0x000005f6,0x000000c2,0x0004003d,0x00000006,
+0x00000638,0x00000637,0x00050050,0x00000011,
+0x00000639,0x00000638,0x00000638,0x0004003d,
+0x0000000f,0x0000063a,0x000005f6,0x0007004f,
+0x00000011,0x0000063b,0x0000063a,0x0000063a,
+0x00000002,0x00000003,0x000500ae,0x00000168,
+0x0000063c,0x00000639,0x0000063b,0x0004009b,
+0x000000cf,0x0000063d,0x0000063c,0x000300f7,
+0x0000063f,0x00000000,0x000400fa,0x0000063d,
+0x0000063e,0x00000641,0x000200f8,0x0000063e,
+0x000200fe,0x000000c2,0x000200f8,0x00000641,
+0x00050041,0x00000007,0x00000642,0x000005f6,
+0x000000b4,0x0004003d,0x00000006,0x00000643,
+0x00000642,0x00050041,0x00000007,0x00000644,
+0x000005f6,0x000000b8,0x0004003d,0x00000006,
+0x00000645,0x00000644,0x000500ae,0x000000cf,
+0x00000646,0x00000643,0x00000645,0x000300f7,
+0x00000648,0x00000000,0x000400fa,0x00000646,
+0x00000647,0x0000064a,0x000200f8,0x00000647,
+0x000200fe,0x000000b4,0x000200f8,0x0000064a,
+0x000200fe,0x000000b8,0x000200f8,0x00000648,
+0x000100ff,0x000200f8,0x0000063f,0x000100ff,
+0x000200f8,0x00000634,0x000100ff,0x00010038,
+0x00050036,0x00000008,0x00000057,0x00000000,
+0x00000053,0x00030037,0x00000007,0x00000054,
+0x00030037,0x00000007,0x00000055,0x00030037,
+0x00000007,0x00000056,0x000200f8,0x00000058,
+0x0004003b,0x00000007,0x0000064d,0x00000007,
+0x0004003b,0x00000009,0x00000655,0x00000007,
+0x0004003b,0x00000662,0x00000663,0x00000007,
+0x0004003b,0x00000007,0x00000666,0x00000007,
+0x0004003b,0x00000009,0x00000668,0x00000007,
+0x0003003e,0x0000064d,0x000000bf,0x000200f9,
+0x0000064e,0x000200f8,0x0000064e,0x000400f6,
+0x00000650,0x00000651,0x00000000,0x000200f9,
+0x00000652,0x000200f8,0x00000652,0x0004003d,
+0x00000006,0x00000653,0x0000064d,0x000500b0,
+0x000000cf,0x00000654,0x00000653,0x000003df,
+0x000400fa,0x00000654,0x0000064f,0x00000650,
+0x000200f8,0x0000064f,0x0004003d,0x00000006,
+0x00000661,0x0000064d,0x0003003e,0x00000663,
+0x00000660,0x00050041,0x00000009,0x00000664,
+0x00000663,0x00000661,0x0004003d,0x00000008,
+0x00000665,0x00000664,0x0003003e,0x00000655,
+0x00000665,0x0004003d,0x00000006,0x00000667,
+0x00000055,0x0003003e,0x00000666,0x00000667,
+0x0004003d,0x00000008,0x00000669,0x00000655,
+0x0003003e,0x00000668,0x00000669,0x00060039,
+0x00000006,0x0000066a,0x0000000d,0x00000666,
+0x00000668,0x0003003e,0x00000056,0x0000066a,
+0x0004003d,0x00000006,0x0000066b,0x00000056,
+0x0004003d,0x00000006,0x0000066c,0x00000054,
+0x000500b2,0x000000cf,0x0000066d,0x0000066b,
+0x0000066c,0x000300f7,0x0000066f,0x00000000,
+0x000400fa,0x0000066d,0x0000066e,0x0000066f,
+0x000200f8,0x0000066e,0x0004003d,0x00000008,
+0x00000670,0x00000655,0x000200fe,0x00000670,
+0x000200f8,0x0000066f,0x000200f9,0x00000651,
+0x000200f8,0x00000651,0x0004003d,0x00000006,
+0x00000672,0x0000064d,0x00050080,0x00000006,
+0x00000673,0x00000672,0x000000ed,0x0003003e,
+0x0000064d,0x00000673,0x000200f9,0x0000064e,
+0x000200f8,0x00000650,0x000200fe,0x00000172,
+0x00010038,0x00050036,0x0000005a,0x0000005e,
+0x00000000,0x0000005c,0x00030037,0x0000005b,
+0x0000005d,0x000200f8,0x0000005f,0x00050041,
+0x0000026f,0x00000676,0x0000005d,0x000000bf,
+0x0004003d,0x00000059,0x00000677,0x00000676,
+0x00050041,0x0000026f,0x00000678,0x0000005d,
+0x000000b4,0x0004003d,0x00000059,0x00000679,
+0x00000678,0x00050080,0x00000059,0x0000067a,
+0x00000677,0x00000679,0x000500c3,0x00000059,
+0x0000067b,0x0000067a,0x000000ed,0x00050041,
+0x0000026f,0x0000067c,0x0000005d,0x000000c2,
+0x0004003d,0x00000059,0x0000067d,0x0000067c,
+0x00050041,0x0000026f,0x0000067e,0x0000005d,
+0x000000b4,0x0004003d,0x00000059,0x0000067f,
+0x0000067e,0x00050080,0x00000059,0x00000680,
+0x0000067d,0x0000067f,0x000500c3,0x00000059,
+0x00000681,0x00000680,0x000000ed,0x0004003d,
+0x0000005a,0x00000682,0x0000005d,0x0007004f,
+0x0000052f,0x00000683,0x00000682,0x00000682,
+0x00000002,0x00000003,0x00050051,0x00000059,
+0x00000684,0x00000683,0x00000000,0x00050051,
+0x00000059,0x00000685,0x00000683,0x00000001,
+0x00070050,0x0000005a,0x00000686,0x0000067b,
+0x00000681,0x00000684,0x00000685,0x000200fe,
+0x00000686,0x00010038,0x00050036,0x00000059,
+0x00000064,0x00000000,0x00000062,0x00030037,
+0x00000061,0x00000063,0x000200f8,0x00000065,
+0x00050041,0x0000026f,0x00000689,0x00000063,
+0x000000bf,0x0004003d,0x00000059,0x0000068a,
+0x00000689,0x00050041,0x0000026f,0x0000068b,
+0x00000063,0x000000c2,0x0004003d,0x00000059,
+0x0000068c,0x0000068b,0x00050080,0x00000059,
+0x0000068d,0x0000068a,0x0000068c,0x00050041,
+0x0000026f,0x0000068e,0x00000063,0x000000b4,
+0x0004003d,0x00000059,0x0000068f,0x0000068e,
+0x00050080,0x00000059,0x00000690,0x0000068d,
+0x0000068f,0x000200fe,0x00000690,0x00010038,
+0x00050036,0x00000002,0x00000069,0x00000000,
+0x00000066,0x00030037,0x0000005b,0x00000067,
+0x00030037,0x0000005b,0x00000068,0x000200f8,
+0x0000006a,0x0004003d,0x0000005a,0x00000693,
+0x00000068,0x00070050,0x0000005a,0x00000694,
+0x000000ed,0x000000ed,0x000000ed,0x000000ed,
+0x000500c3,0x0000005a,0x00000695,0x00000693,
+0x00000694,0x0003003e,0x00000068,0x00000695,
+0x0004003d,0x0000005a,0x00000696,0x00000067,
+0x00070050,0x0000005a,0x00000698,0x00000697,
+0x00000697,0x00000697,0x00000697,0x000500c7,
+0x0000005a,0x00000699,0x00000696,0x00000698,
+0x0004003d,0x0000005a,0x0000069a,0x00000068,
+0x000500c5,0x0000005a,0x0000069b,0x0000069a,
+0x00000699,0x0003003e,0x00000068,0x0000069b,
+0x0004003d,0x0000005a,0x0000069c,0x00000067,
+0x00070050,0x0000005a,0x0000069d,0x000000ed,
+0x000000ed,0x000000ed,0x000000ed,0x000500c3,
+0x0000005a,0x0000069e,0x0000069c,0x0000069d,
+0x0003003e,0x00000067,0x0000069e,0x0004003d,
+0x0000005a,0x000006a0,0x00000067,0x00070050,
+0x0000005a,0x000006a1,0x0000069f,0x0000069f,
+0x0000069f,0x0000069f,0x000500c7,0x0000005a,
+0x000006a2,0x000006a0,0x000006a1,0x0003003e,
+0x00000067,0x000006a2,0x0004003d,0x0000005a,
+0x000006a3,0x00000067,0x000600ca,0x0000005a,
+0x000006a4,0x000006a3,0x000000e2,0x0000052e,
+0x0003003e,0x00000067,0x000006a4,0x000100fd,
+0x00010038,0x00050036,0x00000002,0x00000071,
+0x00000000,0x0000006b,0x00030037,0x0000005b,
+0x0000006c,0x00030037,0x0000005b,0x0000006d,
+0x00030037,0x00000007,0x0000006e,0x00030037,
+0x00000010,0x0000006f,0x00030037,0x00000010,
+0x00000070,0x000200f8,0x00000072,0x0004003b,
+0x0000026f,0x000006c2,0x00000007,0x0004003b,
+0x0000026f,0x000006cb,0x00000007,0x0004003b,
+0x0000005b,0x000006e9,0x00000007,0x0004003b,
+0x0000005b,0x000006eb,0x00000007,0x0004003b,
+0x00000061,0x00000738,0x00000007,0x0004003b,
+0x00000061,0x0000073c,0x00000007,0x0004003b,
+0x0000005b,0x00000748,0x00000007,0x0004003b,
+0x0000005b,0x0000074c,0x00000007,0x0004003b,
+0x0000005b,0x00000754,0x00000007,0x0004003b,
+0x0000005b,0x00000756,0x00000007,0x0004003b,
+0x00000061,0x0000075b,0x00000007,0x0004003b,
+0x0000005b,0x00000772,0x00000007,0x0004003b,
+0x0000005b,0x00000778,0x00000007,0x0004003d,
+0x00000006,0x000006a5,0x0000006e,0x000300f7,
+0x000006b1,0x00000000,0x001700fb,0x000006a5,
+0x000006b0,0x00000000,0x000006a6,0x00000001,
+0x000006a7,0x00000004,0x000006a8,0x00000005,
+0x000006a9,0x00000006,0x000006aa,0x0000000a,
+0x000006ab,0x00000008,0x000006ac,0x0000000c,
+0x000006ad,0x00000009,0x000006ae,0x0000000d,
+0x000006af,0x000200f8,0x000006b0,0x0003003e,
+0x0000006f,0x00000780,0x0003003e,0x00000070,
+0x00000780,0x000200f9,0x000006b1,0x000200f8,
+0x000006a6,0x0004003d,0x0000005a,0x000006b2,
+0x0000006c,0x0008004f,0x00000060,0x000006b3,
+0x000006b2,0x000006b2,0x00000000,0x00000000,
+0x00000000,0x0004007c,0x00000008,0x000006b4,
+0x000006b3,0x00050051,0x00000006,0x000006b6,
+0x000006b4,0x00000000,0x00050051,0x00000006,
+0x000006b7,0x000006b4,0x00000001,0x00050051,
+0x00000006,0x000006b8,0x000006b4,0x00000002,
+0x00070050,0x0000000f,0x000006b9,0x000006b6,
+0x000006b7,0x000006b8,0x000006b5,0x0003003e,
+0x0000006f,0x000006b9,0x0004003d,0x0000005a,
+0x000006ba,0x0000006d,0x0008004f,0x00000060,
+0x000006bb,0x000006ba,0x000006ba,0x00000000,
+0x00000000,0x00000000,0x0004007c,0x00000008,
+0x000006bc,0x000006bb,0x00050051,0x00000006,
+0x000006bd,0x000006bc,0x00000000,0x00050051,
+0x00000006,0x000006be,0x000006bc,0x00000001,
+0x00050051,0x00000006,0x000006bf,0x000006bc,
+0x00000002,0x00070050,0x0000000f,0x000006c0,
+0x000006bd,0x000006be,0x000006bf,0x000006b5,
+0x0003003e,0x00000070,0x000006c0,0x000100fd,
+0x000200f8,0x000006a7,0x00050041,0x0000026f,
+0x000006c3,0x0000006c,0x000000bf,0x0004003d,
+0x00000059,0x000006c4,0x000006c3,0x000500c3,
+0x00000059,0x000006c5,0x000006c4,0x000000e3,
+0x00050041,0x0000026f,0x000006c6,0x0000006d,
+0x000000bf,0x0004003d,0x00000059,0x000006c7,
+0x000006c6,0x000500c7,0x00000059,0x000006c9,
+0x000006c7,0x000006c8,0x000500c5,0x00000059,
+0x000006ca,0x000006c5,0x000006c9,0x0003003e,
+0x000006c2,0x000006ca,0x0004003d,0x00000059,
+0x000006cc,0x000006c2,0x00050041,0x0000026f,
+0x000006cd,0x0000006d,0x000000bf,0x0004003d,
+0x00000059,0x000006ce,0x000006cd,0x000500c7,
+0x00000059,0x000006cf,0x000006ce,0x0000069f,
+0x00050080,0x00000059,0x000006d0,0x000006cc,
+0x000006cf,0x0007000c,0x00000059,0x000006d2,
+0x00000001,0x00000027,0x000006d0,0x000006d1,
+0x0003003e,0x000006cb,0x000006d2,0x0004003d,
+0x00000059,0x000006d3,0x000006c2,0x0004007c,
+0x00000006,0x000006d4,0x000006d3,0x00060050,
+0x00000008,0x000006d5,0x000006d4,0x000006d4,
+0x000006d4,0x00050051,0x00000006,0x000006d6,
+0x000006d5,0x00000000,0x00050051,0x00000006,
+0x000006d7,0x000006d5,0x00000001,0x00050051,
+0x00000006,0x000006d8,0x000006d5,0x00000002,
+0x00070050,0x0000000f,0x000006d9,0x000006d6,
+0x000006d7,0x000006d8,0x000006b5,0x0003003e,
+0x0000006f,0x000006d9,0x0004003d,0x00000059,
+0x000006da,0x000006cb,0x0004007c,0x00000006,
+0x000006db,0x000006da,0x00060050,0x00000008,
+0x000006dc,0x000006db,0x000006db,0x000006db,
+0x00050051,0x00000006,0x000006dd,0x000006dc,
+0x00000000,0x00050051,0x00000006,0x000006de,
+0x000006dc,0x00000001,0x00050051,0x00000006,
+0x000006df,0x000006dc,0x00000002,0x00070050,
+0x0000000f,0x000006e0,0x000006dd,0x000006de,
+0x000006df,0x000006b5,0x0003003e,0x00000070,
+0x000006e0,0x000100fd,0x000200f8,0x000006a8,
+0x0004003d,0x0000005a,0x000006e2,0x0000006c,
+0x0009004f,0x0000005a,0x000006e3,0x000006e2,
+0x000006e2,0x00000000,0x00000000,0x00000000,
+0x00000001,0x0004007c,0x0000000f,0x000006e4,
+0x000006e3,0x0003003e,0x0000006f,0x000006e4,
+0x0004003d,0x0000005a,0x000006e5,0x0000006d,
+0x0009004f,0x0000005a,0x000006e6,0x000006e5,
+0x000006e5,0x00000000,0x00000000,0x00000000,
+0x00000001,0x0004007c,0x0000000f,0x000006e7,
+0x000006e6,0x0003003e,0x00000070,0x000006e7,
+0x000100fd,0x000200f8,0x000006a9,0x0004003d,
+0x0000005a,0x000006ea,0x0000006d,0x0003003e,
+0x000006e9,0x000006ea,0x0004003d,0x0000005a,
+0x000006ec,0x0000006c,0x0003003e,0x000006eb,
+0x000006ec,0x00060039,0x00000002,0x000006ed,
+0x00000069,0x000006e9,0x000006eb,0x0004003d,
+0x0000005a,0x000006ee,0x000006e9,0x0003003e,
+0x0000006d,0x000006ee,0x0004003d,0x0000005a,
+0x000006ef,0x000006eb,0x0003003e,0x0000006c,
+0x000006ef,0x0004003d,0x0000005a,0x000006f0,
+0x0000006c,0x0009004f,0x0000005a,0x000006f1,
+0x000006f0,0x000006f0,0x00000000,0x00000000,
+0x00000000,0x00000001,0x00070050,0x0000005a,
+0x000006f2,0x000000e2,0x000000e2,0x000000e2,
+0x000000e2,0x00070050,0x0000005a,0x000006f3,
+0x000006d1,0x000006d1,0x000006d1,0x000006d1,
+0x0008000c,0x0000005a,0x000006f4,0x00000001,
+0x0000002d,0x000006f1,0x000006f2,0x000006f3,
+0x0004007c,0x0000000f,0x000006f5,0x000006f4,
+0x0003003e,0x0000006f,0x000006f5,0x0004003d,
+0x0000005a,0x000006f6,0x0000006c,0x0009004f,
+0x0000005a,0x000006f7,0x000006f6,0x000006f6,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x0004003d,0x0000005a,0x000006f8,0x0000006d,
+0x0009004f,0x0000005a,0x000006f9,0x000006f8,
+0x000006f8,0x00000000,0x00000000,0x00000000,
+0x00000001,0x00050080,0x0000005a,0x000006fa,
+0x000006f7,0x000006f9,0x00070050,0x0000005a,
+0x000006fb,0x000000e2,0x000000e2,0x000000e2,
+0x000000e2,0x00070050,0x0000005a,0x000006fc,
+0x000006d1,0x000006d1,0x000006d1,0x000006d1,
+0x0008000c,0x0000005a,0x000006fd,0x00000001,
+0x0000002d,0x000006fa,0x000006fb,0x000006fc,
+0x0004007c,0x0000000f,0x000006fe,0x000006fd,
+0x0003003e,0x00000070,0x000006fe,0x000100fd,
+0x000200f8,0x000006aa,0x00050041,0x0000026f,
+0x00000700,0x0000006c,0x000000bf,0x0004003d,
+0x00000059,0x00000701,0x00000700,0x0004007c,
+0x00000006,0x00000702,0x00000701,0x00050041,
+0x0000026f,0x00000703,0x0000006d,0x000000bf,
+0x0004003d,0x00000059,0x00000704,0x00000703,
+0x0004007c,0x00000006,0x00000705,0x00000704,
+0x00050041,0x0000026f,0x00000706,0x0000006c,
+0x000000c2,0x0004003d,0x00000059,0x00000707,
+0x00000706,0x0004007c,0x00000006,0x00000708,
+0x00000707,0x00070050,0x0000000f,0x00000709,
+0x00000702,0x00000705,0x00000708,0x000006b5,
+0x0003003e,0x00000070,0x00000709,0x0004003d,
+0x0000000f,0x0000070a,0x00000070,0x0008004f,
+0x00000008,0x0000070b,0x0000070a,0x0000070a,
+0x00000000,0x00000001,0x00000002,0x00050041,
+0x0000026f,0x0000070c,0x0000006d,0x000000c2,
+0x0004003d,0x00000059,0x0000070d,0x0000070c,
+0x0004007c,0x00000006,0x0000070e,0x0000070d,
+0x00060050,0x00000008,0x0000070f,0x0000070e,
+0x0000070e,0x0000070e,0x00050084,0x00000008,
+0x00000710,0x0000070b,0x0000070f,0x00060050,
+0x00000060,0x00000711,0x000005bf,0x000005bf,
+0x000005bf,0x000500c2,0x00000008,0x00000712,
+0x00000710,0x00000711,0x00050051,0x00000006,
+0x00000713,0x00000712,0x00000000,0x00050051,
+0x00000006,0x00000714,0x00000712,0x00000001,
+0x00050051,0x00000006,0x00000715,0x00000712,
+0x00000002,0x00070050,0x0000000f,0x00000716,
+0x00000713,0x00000714,0x00000715,0x000006b5,
+0x0003003e,0x0000006f,0x00000716,0x000100fd,
+0x000200f8,0x000006ab,0x00050041,0x0000026f,
+0x00000718,0x0000006c,0x000000bf,0x0004003d,
+0x00000059,0x00000719,0x00000718,0x0004007c,
+0x00000006,0x0000071a,0x00000719,0x00050041,
+0x0000026f,0x0000071b,0x0000006d,0x000000bf,
+0x0004003d,0x00000059,0x0000071c,0x0000071b,
+0x0004007c,0x00000006,0x0000071d,0x0000071c,
+0x00050041,0x0000026f,0x0000071e,0x0000006c,
+0x000000c2,0x0004003d,0x00000059,0x0000071f,
+0x0000071e,0x0004007c,0x00000006,0x00000720,
+0x0000071f,0x00050041,0x0000026f,0x00000721,
+0x0000006d,0x000000b4,0x0004003d,0x00000059,
+0x00000722,0x00000721,0x0004007c,0x00000006,
+0x00000723,0x00000722,0x00070050,0x0000000f,
+0x00000724,0x0000071a,0x0000071d,0x00000720,
+0x00000723,0x0003003e,0x00000070,0x00000724,
+0x0004003d,0x0000000f,0x00000725,0x00000070,
+0x0008004f,0x00000008,0x00000726,0x00000725,
+0x00000725,0x00000000,0x00000001,0x00000002,
+0x00050041,0x0000026f,0x00000727,0x0000006d,
+0x000000c2,0x0004003d,0x00000059,0x00000728,
+0x00000727,0x0004007c,0x00000006,0x00000729,
+0x00000728,0x00060050,0x00000008,0x0000072a,
+0x00000729,0x00000729,0x00000729,0x00050084,
+0x00000008,0x0000072b,0x00000726,0x0000072a,
+0x00060050,0x00000060,0x0000072c,0x000005bf,
+0x000005bf,0x000005bf,0x000500c2,0x00000008,
+0x0000072d,0x0000072b,0x0000072c,0x00050041,
+0x0000026f,0x0000072e,0x0000006c,0x000000b4,
+0x0004003d,0x00000059,0x0000072f,0x0000072e,
+0x0004007c,0x00000006,0x00000730,0x0000072f,
+0x00050051,0x00000006,0x00000731,0x0000072d,
+0x00000000,0x00050051,0x00000006,0x00000732,
+0x0000072d,0x00000001,0x00050051,0x00000006,
+0x00000733,0x0000072d,0x00000002,0x00070050,
+0x0000000f,0x00000734,0x00000731,0x00000732,
+0x00000733,0x00000730,0x0003003e,0x0000006f,
+0x00000734,0x000100fd,0x000200f8,0x000006ac,
+0x00050041,0x0000026f,0x00000736,0x0000006c,
+0x000000b8,0x0003003e,0x00000736,0x000006d1,
+0x00050041,0x0000026f,0x00000737,0x0000006d,
+0x000000b8,0x0003003e,0x00000737,0x000006d1,
+0x000200f9,0x000006ad,0x000200f8,0x000006ad,
+0x0004003d,0x0000005a,0x00000739,0x0000006d,
+0x0008004f,0x00000060,0x0000073a,0x00000739,
+0x00000739,0x00000000,0x00000001,0x00000002,
+0x0003003e,0x00000738,0x0000073a,0x00050039,
+0x00000059,0x0000073b,0x00000064,0x00000738,
+0x0004003d,0x0000005a,0x0000073d,0x0000006c,
+0x0008004f,0x00000060,0x0000073e,0x0000073d,
+0x0000073d,0x00000000,0x00000001,0x00000002,
+0x0003003e,0x0000073c,0x0000073e,0x00050039,
+0x00000059,0x0000073f,0x00000064,0x0000073c,
+0x000500af,0x000000cf,0x00000740,0x0000073b,
+0x0000073f,0x000300f7,0x00000742,0x00000000,
+0x000400fa,0x00000740,0x00000741,0x00000747,
+0x000200f8,0x00000741,0x0004003d,0x0000005a,
+0x00000743,0x0000006c,0x0004007c,0x0000000f,
+0x00000744,0x00000743,0x0003003e,0x0000006f,
+0x00000744,0x0004003d,0x0000005a,0x00000745,
+0x0000006d,0x0004007c,0x0000000f,0x00000746,
+0x00000745,0x0003003e,0x00000070,0x00000746,
+0x000200f9,0x00000742,0x000200f8,0x00000747,
+0x0004003d,0x0000005a,0x00000749,0x0000006d,
+0x0003003e,0x00000748,0x00000749,0x00050039,
+0x0000005a,0x0000074a,0x0000005e,0x00000748,
+0x0004007c,0x0000000f,0x0000074b,0x0000074a,
+0x0003003e,0x0000006f,0x0000074b,0x0004003d,
+0x0000005a,0x0000074d,0x0000006c,0x0003003e,
+0x0000074c,0x0000074d,0x00050039,0x0000005a,
+0x0000074e,0x0000005e,0x0000074c,0x0004007c,
+0x0000000f,0x0000074f,0x0000074e,0x0003003e,
+0x00000070,0x0000074f,0x000200f9,0x00000742,
+0x000200f8,0x00000742,0x000100fd,0x000200f8,
+0x000006ae,0x00050041,0x0000026f,0x00000751,
+0x0000006c,0x000000b8,0x0003003e,0x00000751,
+0x000006d1,0x00050041,0x0000026f,0x00000753,
+0x0000006d,0x000000b8,0x0003003e,0x00000753,
+0x00000752,0x000200f9,0x000006af,0x000200f8,
+0x000006af,0x0004003d,0x0000005a,0x00000755,
+0x0000006d,0x0003003e,0x00000754,0x00000755,
+0x0004003d,0x0000005a,0x00000757,0x0000006c,
+0x0003003e,0x00000756,0x00000757,0x00060039,
+0x00000002,0x00000758,0x00000069,0x00000754,
+0x00000756,0x0004003d,0x0000005a,0x00000759,
+0x00000754,0x0003003e,0x0000006d,0x00000759,
+0x0004003d,0x0000005a,0x0000075a,0x00000756,
+0x0003003e,0x0000006c,0x0000075a,0x0004003d,
+0x0000005a,0x0000075c,0x0000006d,0x0008004f,
+0x00000060,0x0000075d,0x0000075c,0x0000075c,
+0x00000000,0x00000001,0x00000002,0x0003003e,
+0x0000075b,0x0000075d,0x00050039,0x00000059,
+0x0000075e,0x00000064,0x0000075b,0x000500af,
+0x000000cf,0x0000075f,0x0000075e,0x000000e2,
+0x000300f7,0x00000761,0x00000000,0x000400fa,
+0x0000075f,0x00000760,0x0000076e,0x000200f8,
+0x00000760,0x0004003d,0x0000005a,0x00000762,
+0x0000006c,0x00070050,0x0000005a,0x00000763,
+0x000000e2,0x000000e2,0x000000e2,0x000000e2,
+0x00070050,0x0000005a,0x00000764,0x000006d1,
+0x000006d1,0x000006d1,0x000006d1,0x0008000c,
+0x0000005a,0x00000765,0x00000001,0x0000002d,
+0x00000762,0x00000763,0x00000764,0x0004007c,
+0x0000000f,0x00000766,0x00000765,0x0003003e,
+0x0000006f,0x00000766,0x0004003d,0x0000005a,
+0x00000767,0x0000006c,0x0004003d,0x0000005a,
+0x00000768,0x0000006d,0x00050080,0x0000005a,
+0x00000769,0x00000767,0x00000768,0x00070050,
+0x0000005a,0x0000076a,0x000000e2,0x000000e2,
+0x000000e2,0x000000e2,0x00070050,0x0000005a,
+0x0000076b,0x000006d1,0x000006d1,0x000006d1,
+0x000006d1,0x0008000c,0x0000005a,0x0000076c,
+0x00000001,0x0000002d,0x00000769,0x0000076a,
+0x0000076b,0x0004007c,0x0000000f,0x0000076d,
+0x0000076c,0x0003003e,0x00000070,0x0000076d,
+0x000200f9,0x00000761,0x000200f8,0x0000076e,
+0x0004003d,0x0000005a,0x0000076f,0x0000006c,
+0x0004003d,0x0000005a,0x00000770,0x0000006d,
+0x00050080,0x0000005a,0x00000771,0x0000076f,
+0x00000770,0x0003003e,0x00000772,0x00000771,
+0x00050039,0x0000005a,0x00000773,0x0000005e,
+0x00000772,0x00070050,0x0000005a,0x00000774,
+0x000000e2,0x000000e2,0x000000e2,0x000000e2,
+0x00070050,0x0000005a,0x00000775,0x000006d1,
+0x000006d1,0x000006d1,0x000006d1,0x0008000c,
+0x0000005a,0x00000776,0x00000001,0x0000002d,
+0x00000773,0x00000774,0x00000775,0x0004007c,
+0x0000000f,0x00000777,0x00000776,0x0003003e,
+0x0000006f,0x00000777,0x0004003d,0x0000005a,
+0x00000779,0x0000006c,0x0003003e,0x00000778,
+0x00000779,0x00050039,0x0000005a,0x0000077a,
+0x0000005e,0x00000778,0x00070050,0x0000005a,
+0x0000077b,0x000000e2,0x000000e2,0x000000e2,
+0x000000e2,0x00070050,0x0000005a,0x0000077c,
+0x000006d1,0x000006d1,0x000006d1,0x000006d1,
+0x0008000c,0x0000005a,0x0000077d,0x00000001,
+0x0000002d,0x0000077a,0x0000077b,0x0000077c,
+0x0004007c,0x0000000f,0x0000077e,0x0000077d,
+0x0003003e,0x00000070,0x0000077e,0x000200f9,
+0x00000761,0x000200f8,0x00000761,0x000100fd,
+0x000200f8,0x000006b1,0x000100fd,0x00010038,
+0x00050036,0x00000006,0x00000078,0x00000000,
+0x00000073,0x00030037,0x00000010,0x00000074,
+0x00030037,0x00000007,0x00000075,0x00030037,
+0x00000007,0x00000076,0x00030037,0x00000009,
+0x00000077,0x000200f8,0x00000079,0x0004003b,
+0x00000007,0x00000782,0x00000007,0x0004003b,
+0x00000007,0x0000078a,0x00000007,0x0004003b,
+0x00000007,0x00000793,0x00000007,0x0004003b,
+0x00000010,0x00000796,0x00000007,0x0004003b,
+0x00000007,0x00000798,0x00000007,0x0004003b,
+0x00000007,0x0000079a,0x00000007,0x0004003b,
+0x00000007,0x0000079c,0x00000007,0x0004003b,
+0x00000803,0x00000804,0x00000007,0x0004003b,
+0x00000007,0x0000080e,0x00000007,0x0004003b,
+0x00000007,0x00000817,0x00000007,0x0004003b,
+0x00000010,0x0000081a,0x00000007,0x0004003b,
+0x00000007,0x0000081c,0x00000007,0x0004003b,
+0x00000007,0x0000081e,0x00000007,0x0004003b,
+0x00000007,0x00000820,0x00000007,0x0004003b,
+0x00000831,0x00000832,0x00000007,0x0004003b,
+0x00000007,0x00000837,0x00000007,0x0004003b,
+0x00000007,0x0000083d,0x00000007,0x0004003b,
+0x00000010,0x0000083e,0x00000007,0x0004003b,
+0x00000007,0x00000840,0x00000007,0x0004003b,
+0x00000007,0x00000842,0x00000007,0x0004003b,
+0x00000012,0x00000845,0x00000007,0x0004003b,
+0x00000851,0x00000852,0x00000007,0x00050041,
+0x00000007,0x00000783,0x00000077,0x000000b4,
+0x0004003d,0x00000006,0x00000784,0x00000783,
+0x0003003e,0x00000782,0x00000784,0x00050041,
+0x00000007,0x00000785,0x00000077,0x000000bf,
+0x0004003d,0x00000006,0x00000786,0x00000785,
+0x000500aa,0x000000cf,0x00000787,0x00000786,
+0x000000c2,0x000300f7,0x00000789,0x00000000,
+0x000400fa,0x00000787,0x00000788,0x00000808,
+0x000200f8,0x00000788,0x0004003d,0x00000006,
+0x0000078b,0x00000076,0x00050086,0x00000006,
+0x0000078c,0x0000078b,0x000000b7,0x0004003d,
+0x00000006,0x0000078d,0x00000782,0x00050084,
+0x00000006,0x0000078e,0x000000b7,0x0000078d,
+0x00050080,0x00000006,0x0000078f,0x0000078e,
+0x000000af,0x00050084,0x00000006,0x00000790,
+0x0000078c,0x0000078f,0x0004003d,0x00000006,
+0x00000791,0x00000075,0x00050080,0x00000006,
+0x00000792,0x00000790,0x00000791,0x0003003e,
+0x0000078a,0x00000792,0x0004003d,0x00000006,
+0x00000794,0x00000076,0x00050089,0x00000006,
+0x00000795,0x00000794,0x000000b7,0x0004003d,
+0x0000000f,0x00000797,0x00000074,0x0003003e,
+0x00000796,0x00000797,0x0004003d,0x00000006,
+0x00000799,0x0000078a,0x0003003e,0x00000798,
+0x00000799,0x0004003d,0x00000006,0x0000079b,
+0x00000782,0x0003003e,0x0000079a,0x0000079b,
+0x0003003e,0x0000079c,0x00000795,0x00080039,
+0x00000006,0x0000079d,0x0000002a,0x00000796,
+0x00000798,0x0000079a,0x0000079c,0x0003003e,
+0x00000793,0x0000079d,0x0004003d,0x00000006,
+0x000007fc,0x00000782,0x000500c4,0x00000059,
+0x000007fd,0x000000ed,0x000007fc,0x00050082,
+0x00000059,0x000007fe,0x000007fd,0x000000ed,
+0x00050084,0x00000059,0x000007ff,0x00000181,
+0x000007fe,0x0004007c,0x00000006,0x00000800,
+0x000007ff,0x0004003d,0x00000006,0x00000801,
+0x00000793,0x00050080,0x00000006,0x00000802,
+0x00000800,0x00000801,0x0003003e,0x00000804,
+0x000007fb,0x00050041,0x00000007,0x00000805,
+0x00000804,0x00000802,0x0004003d,0x00000006,
+0x00000806,0x00000805,0x000200fe,0x00000806,
+0x000200f8,0x00000808,0x00050041,0x00000007,
+0x00000809,0x00000077,0x000000c2,0x0004003d,
+0x00000006,0x0000080a,0x00000809,0x000500aa,
+0x000000cf,0x0000080b,0x0000080a,0x000000c2,
+0x000300f7,0x0000080d,0x00000000,0x000400fa,
+0x0000080b,0x0000080c,0x00000836,0x000200f8,
+0x0000080c,0x0004003d,0x00000006,0x0000080f,
+0x00000076,0x00050086,0x00000006,0x00000810,
+0x0000080f,0x000000b8,0x0004003d,0x00000006,
+0x00000811,0x00000782,0x00050084,0x00000006,
+0x00000812,0x000000b8,0x00000811,0x00050080,
+0x00000006,0x00000813,0x00000812,0x000000b0,
+0x00050084,0x00000006,0x00000814,0x00000810,
+0x00000813,0x0004003d,0x00000006,0x00000815,
+0x00000075,0x00050080,0x00000006,0x00000816,
+0x00000814,0x00000815,0x0003003e,0x0000080e,
+0x00000816,0x0004003d,0x00000006,0x00000818,
+0x00000076,0x00050089,0x00000006,0x00000819,
+0x00000818,0x000000b8,0x0004003d,0x0000000f,
+0x0000081b,0x00000074,0x0003003e,0x0000081a,
+0x0000081b,0x0004003d,0x00000006,0x0000081d,
+0x0000080e,0x0003003e,0x0000081c,0x0000081d,
+0x0004003d,0x00000006,0x0000081f,0x00000782,
+0x0003003e,0x0000081e,0x0000081f,0x0003003e,
+0x00000820,0x00000819,0x00080039,0x00000006,
+0x00000821,0x00000030,0x0000081a,0x0000081c,
+0x0000081e,0x00000820,0x0003003e,0x00000817,
+0x00000821,0x0004003d,0x00000006,0x0000082a,
+0x00000782,0x000500c4,0x00000059,0x0000082b,
+0x000000ed,0x0000082a,0x00050082,0x00000059,
+0x0000082c,0x0000082b,0x000000ed,0x00050084,
+0x00000059,0x0000082d,0x000000f2,0x0000082c,
+0x0004007c,0x00000006,0x0000082e,0x0000082d,
+0x0004003d,0x00000006,0x0000082f,0x00000817,
+0x00050080,0x00000006,0x00000830,0x0000082e,
+0x0000082f,0x0003003e,0x00000832,0x00000829,
+0x00050041,0x00000007,0x00000833,0x00000832,
+0x00000830,0x0004003d,0x00000006,0x00000834,
+0x00000833,0x000200fe,0x00000834,0x000200f8,
+0x00000836,0x0004003d,0x00000006,0x00000838,
+0x00000076,0x0004003d,0x00000006,0x00000839,
+0x00000782,0x00050084,0x00000006,0x0000083a,
+0x00000838,0x00000839,0x0004003d,0x00000006,
+0x0000083b,0x00000075,0x00050080,0x00000006,
+0x0000083c,0x0000083a,0x0000083b,0x0003003e,
+0x00000837,0x0000083c,0x0004003d,0x0000000f,
+0x0000083f,0x00000074,0x0003003e,0x0000083e,
+0x0000083f,0x0004003d,0x00000006,0x00000841,
+0x00000837,0x0003003e,0x00000840,0x00000841,
+0x0004003d,0x00000006,0x00000843,0x00000782,
+0x0003003e,0x00000842,0x00000843,0x00070039,
+0x00000006,0x00000844,0x0000001c,0x0000083e,
+0x00000840,0x00000842,0x0003003e,0x0000083d,
+0x00000844,0x0004003d,0x00000006,0x0000084f,
+0x00000782,0x00050082,0x00000006,0x00000850,
+0x0000084f,0x000000c2,0x0003003e,0x00000852,
+0x0000084e,0x00050041,0x00000012,0x00000853,
+0x00000852,0x00000850,0x0004003d,0x00000011,
+0x00000854,0x00000853,0x0003003e,0x00000845,
+0x00000854,0x0004003d,0x00000006,0x00000855,
+0x0000083d,0x00050041,0x00000007,0x00000856,
+0x00000845,0x000000bf,0x0004003d,0x00000006,
+0x00000857,0x00000856,0x00050084,0x00000006,
+0x00000858,0x00000855,0x00000857,0x0004003d,
+0x00000006,0x00000859,0x0000083d,0x00050041,
+0x00000007,0x0000085a,0x00000845,0x000000c2,
+0x0004003d,0x00000006,0x0000085b,0x0000085a,
+0x000500c2,0x00000006,0x0000085c,0x00000859,
+0x0000085b,0x000500c5,0x00000006,0x0000085d,
+0x00000858,0x0000085c,0x000200fe,0x0000085d,
+0x000200f8,0x0000080d,0x000100ff,0x000200f8,
+0x00000789,0x000100ff,0x00010038,0x00050036,
+0x0000000f,0x0000007c,0x00000000,0x0000007a,
+0x00030037,0x00000007,0x0000007b,0x000200f8,
+0x0000007d,0x0004003b,0x0000005b,0x00000860,
+0x00000007,0x0004003b,0x00000010,0x00000869,
+0x00000007,0x0004003d,0x00000006,0x00000861,
+0x0000007b,0x0004007c,0x00000059,0x00000862,
+0x00000861,0x00070050,0x0000005a,0x00000867,
+0x00000862,0x00000862,0x00000862,0x00000862,
+0x00050082,0x0000005a,0x00000868,0x00000867,
+0x00000866,0x0003003e,0x00000860,0x00000868,
+0x0004003d,0x0000005a,0x0000086b,0x00000860,
+0x0008000c,0x0000005a,0x0000086f,0x00000001,
+0x0000002d,0x0000086b,0x0000086c,0x0000086e,
+0x000500c4,0x0000000f,0x00000870,0x0000086a,
+0x0000086f,0x00070050,0x0000000f,0x00000871,
+0x000000c2,0x000000c2,0x000000c2,0x000000c2,
+0x00050082,0x0000000f,0x00000872,0x00000870,
+0x00000871,0x0003003e,0x00000869,0x00000872,
+0x0004003d,0x0000000f,0x00000873,0x00000869,
+0x0004003d,0x00000006,0x00000876,0x0000007b,
+0x00070050,0x0000000f,0x00000877,0x00000876,
+0x00000876,0x00000876,0x00000876,0x000500ae,
+0x00000879,0x0000087a,0x00000877,0x00000878,
+0x000600a9,0x0000000f,0x0000087b,0x0000087a,
+0x00000875,0x00000873,0x000200fe,0x0000087b,
+0x00010038,0x00050036,0x0000000f,0x00000080,
+0x00000000,0x0000007e,0x00030037,0x00000011,
+0x0000007f,0x000200f8,0x00000081,0x0004003b,
+0x00000010,0x00000894,0x00000007,0x0004003b,
+0x00000007,0x00000898,0x00000007,0x0004003b,
+0x00000012,0x0000089c,0x00000007,0x0004003b,
+0x00000010,0x0000089d,0x00000007,0x0004003b,
+0x00000007,0x000008a0,0x00000007,0x0004003b,
+0x00000007,0x000008a1,0x00000007,0x0004003b,
+0x00000012,0x000008a3,0x00000007,0x0004003b,
+0x00000007,0x000008a4,0x00000007,0x0004003b,
+0x00000007,0x000008a7,0x00000007,0x0004003b,
+0x00000007,0x000008a8,0x00000007,0x0004003b,
+0x00000007,0x000008a9,0x00000007,0x0004003b,
+0x00000007,0x000008aa,0x00000007,0x0004003b,
+0x00000007,0x000008ab,0x00000007,0x0004003b,
+0x00000007,0x000008ad,0x00000007,0x0004003b,
+0x00000007,0x000008ae,0x00000007,0x0004003b,
+0x00000007,0x000008af,0x00000007,0x0004003b,
+0x00000007,0x000008b9,0x00000007,0x0004003b,
+0x00000007,0x000008bf,0x00000007,0x0004003b,
+0x00000007,0x000008c7,0x00000007,0x0004003b,
+0x00000009,0x000008cb,0x00000007,0x0004003b,
+0x00000007,0x000008cc,0x00000007,0x0004003b,
+0x00000007,0x000008cd,0x00000007,0x0004003b,
+0x00000007,0x000008cf,0x00000007,0x0004003b,
+0x00000007,0x000008d1,0x00000007,0x0004003b,
+0x00000007,0x000008d4,0x00000007,0x0004003b,
+0x0000005b,0x000008d8,0x00000007,0x0004003b,
+0x0000005b,0x000008d9,0x00000007,0x0004003b,
+0x00000010,0x000008da,0x00000007,0x0004003b,
+0x00000007,0x000008df,0x00000007,0x0004003b,
+0x00000007,0x000008e2,0x00000007,0x0004003b,
+0x00000007,0x000008eb,0x00000007,0x0004003b,
+0x00000010,0x000008f1,0x00000007,0x0004003b,
+0x00000007,0x000008f3,0x00000007,0x0004003b,
+0x00000007,0x000008f5,0x00000007,0x0004003b,
+0x00000009,0x000008f7,0x00000007,0x0004003b,
+0x00000010,0x000008ff,0x00000007,0x0004003b,
+0x00000007,0x00000901,0x00000007,0x0004003b,
+0x00000007,0x00000903,0x00000007,0x0004003b,
+0x00000009,0x00000904,0x00000007,0x0004003b,
+0x00000010,0x0000090b,0x00000007,0x0004003b,
+0x00000010,0x0000090c,0x00000007,0x0004003b,
+0x0000005b,0x0000090d,0x00000007,0x0004003b,
+0x0000005b,0x0000090f,0x00000007,0x0004003b,
+0x00000007,0x00000911,0x00000007,0x0004003b,
+0x00000010,0x00000913,0x00000007,0x0004003b,
+0x00000010,0x00000914,0x00000007,0x0004003b,
+0x00000010,0x00000918,0x00000007,0x0004003b,
+0x00000007,0x0000091f,0x00000007,0x0004003b,
+0x00000010,0x00000920,0x00000007,0x0004003b,
+0x00000007,0x00000922,0x00000007,0x0004003b,
+0x00000007,0x00000924,0x00000007,0x0004003d,
+0x000000cf,0x0000087e,0x000000d1,0x000300f7,
+0x00000880,0x00000000,0x000400fa,0x0000087e,
+0x0000087f,0x00000880,0x000200f8,0x0000087f,
+0x000200fe,0x00000881,0x000200f8,0x00000880,
+0x0004003d,0x000000cf,0x00000883,0x000000d3,
+0x000300f7,0x00000885,0x00000000,0x000400fa,
+0x00000883,0x00000884,0x00000885,0x000200f8,
+0x00000884,0x00050041,0x000000d4,0x00000886,
+0x000000ca,0x000000c2,0x0004003d,0x00000006,
+0x00000887,0x00000886,0x000600cb,0x00000006,
+0x00000888,0x00000887,0x000005bf,0x000005bf,
+0x00050041,0x000000d4,0x00000889,0x000000ca,
+0x000000c2,0x0004003d,0x00000006,0x0000088a,
+0x00000889,0x000600cb,0x00000006,0x0000088b,
+0x0000088a,0x000005cc,0x000005bf,0x00050041,
+0x000000d4,0x0000088c,0x000000ca,0x000000bf,
+0x0004003d,0x00000006,0x0000088d,0x0000088c,
+0x000600cb,0x00000006,0x0000088e,0x0000088d,
+0x000005bf,0x000005bf,0x00050041,0x000000d4,
+0x0000088f,0x000000ca,0x000000bf,0x0004003d,
+0x00000006,0x00000890,0x0000088f,0x000600cb,
+0x00000006,0x00000891,0x00000890,0x000005cc,
+0x000005bf,0x00070050,0x0000000f,0x00000892,
+0x00000888,0x0000088b,0x0000088e,0x00000891,
+0x000200fe,0x00000892,0x000200f8,0x00000885,
+0x0004003d,0x0000000f,0x00000895,0x000000ca,
+0x0009004f,0x0000000f,0x00000896,0x00000895,
+0x00000895,0x00000003,0x00000002,0x00000001,
+0x00000000,0x000400cc,0x0000000f,0x00000897,
+0x00000896,0x0004003d,0x00000006,0x00000899,
+0x00000192,0x0003003e,0x00000898,0x00000899,
+0x00050039,0x0000000f,0x0000089a,0x0000007c,
+0x00000898,0x000500c7,0x0000000f,0x0000089b,
+0x00000897,0x0000089a,0x0003003e,0x00000894,
+0x0000089b,0x0004003d,0x0000000f,0x0000089e,
+0x00000894,0x0003003e,0x0000089d,0x0000089e,
+0x00060039,0x00000011,0x0000089f,0x00000047,
+0x0000089d,0x0000007f,0x0003003e,0x0000089c,
+0x0000089f,0x0004003d,0x00000006,0x000008a2,
+0x000001b0,0x0003003e,0x000008a1,0x000008a2,
+0x0003003e,0x000008a3,0x0000007f,0x0004003d,
+0x00000006,0x000008a5,0x000001a6,0x0003003e,
+0x000008a4,0x000008a5,0x00070039,0x00000006,
+0x000008a6,0x00000051,0x000008a1,0x000008a3,
+0x000008a4,0x0003003e,0x000008a0,0x000008a6,
+0x0003003e,0x000008a7,0x000000bf,0x0003003e,
+0x000008a8,0x000000bf,0x0003003e,0x000008a9,
+0x000000bf,0x0004003d,0x00000006,0x000008ac,
+0x000008a0,0x0003003e,0x000008ab,0x000008ac,
+0x00080039,0x00000006,0x000008b0,0x00000023,
+0x000008ab,0x000008ad,0x000008ae,0x000008af,
+0x0004003d,0x00000006,0x000008b1,0x000008ad,
+0x0003003e,0x000008a7,0x000008b1,0x0004003d,
+0x00000006,0x000008b2,0x000008ae,0x0003003e,
+0x000008a8,0x000008b2,0x0004003d,0x00000006,
+0x000008b3,0x000008af,0x0003003e,0x000008a9,
+0x000008b3,0x0003003e,0x000008aa,0x000008b0,
+0x0004003d,0x00000006,0x000008b4,0x000008a8,
+0x000500ac,0x000000cf,0x000008b5,0x000008b4,
+0x000002c3,0x000300f7,0x000008b7,0x00000000,
+0x000400fa,0x000008b5,0x000008b6,0x000008b7,
+0x000200f8,0x000008b6,0x000200fe,0x00000881,
+0x000200f8,0x000008b7,0x0004003d,0x00000006,
+0x000008ba,0x000001a6,0x000500aa,0x000000cf,
+0x000008bb,0x000008ba,0x000000c2,0x000600a9,
+0x00000059,0x000008bd,0x000008bb,0x00000578,
+0x000008bc,0x0004007c,0x00000006,0x000008be,
+0x000008bd,0x0003003e,0x000008b9,0x000008be,
+0x0004003d,0x000000cf,0x000008c1,0x000000fe,
+0x000600a9,0x00000059,0x000008c2,0x000008c1,
+0x000000ed,0x000000e2,0x00050084,0x00000059,
+0x000008c3,0x000008c0,0x000008c2,0x0004007c,
+0x00000006,0x000008c4,0x000008c3,0x0004003d,
+0x00000006,0x000008c5,0x000008a7,0x00050080,
+0x00000006,0x000008c6,0x000008c4,0x000008c5,
+0x0003003e,0x000008bf,0x000008c6,0x0004003d,
+0x00000006,0x000008c8,0x000008bf,0x0004003d,
+0x00000006,0x000008c9,0x000008b9,0x00050082,
+0x00000006,0x000008ca,0x000008c8,0x000008c9,
+0x0003003e,0x000008c7,0x000008ca,0x0004003d,
+0x00000006,0x000008ce,0x000008c7,0x0003003e,
+0x000008cd,0x000008ce,0x0004003d,0x00000006,
+0x000008d0,0x000008a8,0x0003003e,0x000008cf,
+0x000008d0,0x00070039,0x00000008,0x000008d2,
+0x00000057,0x000008cd,0x000008cf,0x000008d1,
+0x0004003d,0x00000006,0x000008d3,0x000008d1,
+0x0003003e,0x000008cc,0x000008d3,0x0003003e,
+0x000008cb,0x000008d2,0x0004003d,0x00000006,
+0x000008d5,0x000008aa,0x000500c2,0x00000006,
+0x000008d6,0x000008d5,0x000000e3,0x00050080,
+0x00000006,0x000008d7,0x000008d6,0x000000c2,
+0x0003003e,0x000008d4,0x000008d7,0x0003003e,
+0x000008d8,0x0000086c,0x0003003e,0x000008d9,
+0x0000086c,0x0004003d,0x0000000f,0x000008db,
+0x000000ca,0x0004003d,0x00000006,0x000008dc,
+0x000008b9,0x0004003d,0x00000006,0x000008dd,
+0x000008cc,0x00050080,0x00000006,0x000008de,
+0x000008dc,0x000008dd,0x0003003e,0x000008df,
+0x000008de,0x00050039,0x0000000f,0x000008e0,
+0x0000007c,0x000008df,0x000500c7,0x0000000f,
+0x000008e1,0x000008db,0x000008e0,0x0003003e,
+0x000008da,0x000008e1,0x0003003e,0x000008e2,
+0x000000bf,0x000200f9,0x000008e3,0x000200f8,
+0x000008e3,0x000400f6,0x000008e5,0x000008e6,
+0x00000000,0x000200f9,0x000008e7,0x000200f8,
+0x000008e7,0x0004003d,0x00000006,0x000008e8,
+0x000008e2,0x0004003d,0x00000006,0x000008e9,
+0x000008d4,0x000500b0,0x000000cf,0x000008ea,
+0x000008e8,0x000008e9,0x000400fa,0x000008ea,
+0x000008e4,0x000008e5,0x000200f8,0x000008e4,
+0x0004003d,0x00000006,0x000008ec,0x000008e2,
+0x00050084,0x00000006,0x000008ed,0x000000b4,
+0x000008ec,0x0004003d,0x00000006,0x000008ee,
+0x000008a9,0x00050080,0x00000006,0x000008ef,
+0x000008ed,0x000008ee,0x0003003e,0x000008eb,
+0x000008ef,0x0004003d,0x00000006,0x000008f0,
+0x000008e2,0x0004003d,0x0000000f,0x000008f2,
+0x000008da,0x0003003e,0x000008f1,0x000008f2,
+0x0004003d,0x00000006,0x000008f4,0x000008b9,
+0x0003003e,0x000008f3,0x000008f4,0x0004003d,
+0x00000006,0x000008f6,0x000008eb,0x0003003e,
+0x000008f5,0x000008f6,0x0004003d,0x00000008,
+0x000008f8,0x000008cb,0x0003003e,0x000008f7,
+0x000008f8,0x00080039,0x00000006,0x000008f9,
+0x00000078,0x000008f1,0x000008f3,0x000008f5,
+0x000008f7,0x0004007c,0x00000059,0x000008fa,
+0x000008f9,0x00050041,0x0000026f,0x000008fb,
+0x000008d8,0x000008f0,0x0003003e,0x000008fb,
+0x000008fa,0x0004003d,0x00000006,0x000008fc,
+0x000008e2,0x0004003d,0x00000006,0x000008fd,
+0x000008eb,0x00050080,0x00000006,0x000008fe,
+0x000008fd,0x000000c2,0x0004003d,0x0000000f,
+0x00000900,0x000008da,0x0003003e,0x000008ff,
+0x00000900,0x0004003d,0x00000006,0x00000902,
+0x000008b9,0x0003003e,0x00000901,0x00000902,
+0x0003003e,0x00000903,0x000008fe,0x0004003d,
+0x00000008,0x00000905,0x000008cb,0x0003003e,
+0x00000904,0x00000905,0x00080039,0x00000006,
+0x00000906,0x00000078,0x000008ff,0x00000901,
+0x00000903,0x00000904,0x0004007c,0x00000059,
+0x00000907,0x00000906,0x00050041,0x0000026f,
+0x00000908,0x000008d9,0x000008fc,0x0003003e,
+0x00000908,0x00000907,0x000200f9,0x000008e6,
+0x000200f8,0x000008e6,0x0004003d,0x00000006,
+0x00000909,0x000008e2,0x00050080,0x00000006,
+0x0000090a,0x00000909,0x000000ed,0x0003003e,
+0x000008e2,0x0000090a,0x000200f9,0x000008e3,
+0x000200f8,0x000008e5,0x0004003d,0x0000005a,
+0x0000090e,0x000008d8,0x0003003e,0x0000090d,
+0x0000090e,0x0004003d,0x0000005a,0x00000910,
+0x000008d9,0x0003003e,0x0000090f,0x00000910,
+0x0004003d,0x00000006,0x00000912,0x000008aa,
+0x0003003e,0x00000911,0x00000912,0x00090039,
+0x00000002,0x00000915,0x00000071,0x0000090d,
+0x0000090f,0x00000911,0x00000913,0x00000914,
+0x0004003d,0x0000000f,0x00000916,0x00000913,
+0x0003003e,0x0000090b,0x00000916,0x0004003d,
+0x0000000f,0x00000917,0x00000914,0x0003003e,
+0x0000090c,0x00000917,0x00050041,0x00000007,
+0x00000919,0x0000089c,0x000000bf,0x0004003d,
+0x00000006,0x0000091a,0x00000919,0x00070050,
+0x0000000f,0x0000091b,0x0000091a,0x0000091a,
+0x0000091a,0x0000091a,0x0003003e,0x00000918,
+0x0000091b,0x0004003d,0x000000cf,0x0000091c,
+0x000000fe,0x000300f7,0x0000091e,0x00000000,
+0x000400fa,0x0000091c,0x0000091d,0x0000091e,
+0x000200f8,0x0000091d,0x0004003d,0x0000000f,
+0x00000921,0x000000ca,0x0003003e,0x00000920,
+0x00000921,0x0004003d,0x00000006,0x00000923,
+0x000008bf,0x0003003e,0x00000922,0x00000923,
+0x0003003e,0x00000924,0x000000b4,0x00070039,
+0x00000006,0x00000925,0x0000001c,0x00000920,
+0x00000922,0x00000924,0x0003003e,0x0000091f,
+0x00000925,0x0004003d,0x00000006,0x00000926,
+0x0000091f,0x00050041,0x00000007,0x00000927,
+0x0000089c,0x000000c2,0x0004003d,0x00000006,
+0x00000928,0x00000927,0x00050041,0x00000007,
+0x00000929,0x00000918,0x00000926,0x0003003e,
+0x00000929,0x00000928,0x000200f9,0x0000091e,
+0x000200f8,0x0000091e,0x0004003d,0x0000000f,
+0x0000092a,0x0000090b,0x0004003d,0x0000000f,
+0x0000092b,0x00000918,0x00070050,0x0000000f,
+0x0000092c,0x000001a0,0x000001a0,0x000001a0,
+0x000001a0,0x00050082,0x0000000f,0x0000092d,
+0x0000092c,0x0000092b,0x00050084,0x0000000f,
+0x0000092e,0x0000092a,0x0000092d,0x0004003d,
+0x0000000f,0x0000092f,0x0000090c,0x0004003d,
+0x0000000f,0x00000930,0x00000918,0x00050084,
+0x0000000f,0x00000931,0x0000092f,0x00000930,
+0x00050080,0x0000000f,0x00000932,0x0000092e,
+0x00000931,0x00070050,0x0000000f,0x00000933,
+0x000001c3,0x000001c3,0x000001c3,0x000001c3,
+0x00050080,0x0000000f,0x00000934,0x00000932,
+0x00000933,0x00070050,0x0000005a,0x00000935,
+0x0000052e,0x0000052e,0x0000052e,0x0000052e,
+0x000500c2,0x0000000f,0x00000936,0x00000934,
+0x00000935,0x000200fe,0x00000936,0x00010038,
+0x00050036,0x00000060,0x00000084,0x00000000,
+0x00000082,0x00030037,0x00000061,0x00000083,
+0x000200f8,0x00000085,0x0004003d,0x00000060,
+0x00000939,0x00000083,0x000200fe,0x00000939,
+0x00010038,0x00050036,0x0000000f,0x00000089,
+0x00000000,0x00000086,0x00030037,0x00000012,
+0x00000087,0x00030037,0x00000007,0x00000088,
+0x000200f8,0x0000008a,0x0004003b,0x00000012,
+0x0000093c,0x00000007,0x0004003b,0x00000012,
+0x00000945,0x00000007,0x0004003b,0x00000061,
+0x00000955,0x00000007,0x0004003b,0x00000010,
+0x00000959,0x00000007,0x0004003b,0x00000012,
+0x0000095b,0x00000007,0x0004003d,0x00000011,
+0x0000093d,0x00000087,0x00050041,0x00000941,
+0x00000942,0x00000940,0x000000e2,0x0004003d,
+0x00000011,0x00000943,0x00000942,0x00050086,
+0x00000011,0x00000944,0x0000093d,0x00000943,
+0x0003003e,0x0000093c,0x00000944,0x0004003d,
+0x00000011,0x00000946,0x00000087,0x00050041,
+0x00000941,0x00000947,0x00000940,0x000000e2,
+0x0004003d,0x00000011,0x00000948,0x00000947,
+0x00050089,0x00000011,0x00000949,0x00000946,
+0x00000948,0x0003003e,0x00000945,0x00000949,
+0x0004003d,0x0000094a,0x0000094d,0x0000094c,
+0x0004003d,0x00000011,0x0000094e,0x0000093c,
+0x0004007c,0x0000052f,0x0000094f,0x0000094e,
+0x0004003d,0x00000006,0x00000950,0x00000088,
+0x0004007c,0x00000059,0x00000951,0x00000950,
+0x00050051,0x00000059,0x00000952,0x0000094f,
+0x00000000,0x00050051,0x00000059,0x00000953,
+0x0000094f,0x00000001,0x00060050,0x00000060,
+0x00000954,0x00000952,0x00000953,0x00000951,
+0x0003003e,0x00000955,0x00000954,0x00050039,
+0x00000060,0x00000956,0x00000084,0x00000955,
+0x00050062,0x0000000f,0x00000957,0x0000094d,
+0x00000956,0x0009004f,0x0000000f,0x00000958,
+0x00000957,0x00000957,0x00000003,0x00000002,
+0x00000001,0x00000000,0x0003003e,0x000000ca,
+0x00000958,0x0004003d,0x0000000f,0x0000095a,
+0x000000ca,0x0003003e,0x00000959,0x0000095a,
+0x00050041,0x00000941,0x0000095c,0x00000940,
+0x000000e2,0x0004003d,0x00000011,0x0000095d,
+0x0000095c,0x0003003e,0x0000095b,0x0000095d,
+0x00060039,0x00000002,0x0000095e,0x00000016,
+0x00000959,0x0000095b,0x0004003d,0x00000011,
+0x0000095f,0x00000945,0x00050039,0x0000000f,
+0x00000960,0x00000080,0x0000095f,0x000200fe,
+0x00000960,0x00010038,0x00050036,0x00000006,
+0x00000092,0x00000000,0x0000008e,0x00030037,
+0x0000008d,0x0000008f,0x00030037,0x0000008d,
+0x00000090,0x00030037,0x0000008d,0x00000091,
+0x000200f8,0x00000093,0x0004003b,0x0000008d,
+0x00000963,0x00000007,0x0004003b,0x00000967,
+0x00000968,0x00000007,0x0004003b,0x0000026f,
+0x00000972,0x00000007,0x0004003d,0x0000008c,
+0x00000964,0x00000091,0x0004003d,0x0000008c,
+0x00000965,0x00000090,0x00050083,0x0000008c,
+0x00000966,0x00000964,0x00000965,0x0003003e,
+0x00000963,0x00000966,0x0004003d,0x0000008c,
+0x00000969,0x0000008f,0x0004003d,0x0000008c,
+0x0000096a,0x00000090,0x00050083,0x0000008c,
+0x0000096b,0x00000969,0x0000096a,0x0004003d,
+0x0000008c,0x0000096c,0x00000963,0x00050094,
+0x0000008b,0x0000096d,0x0000096b,0x0000096c,
+0x0004003d,0x0000008c,0x0000096e,0x00000963,
+0x0004003d,0x0000008c,0x0000096f,0x00000963,
+0x00050094,0x0000008b,0x00000970,0x0000096e,
+0x0000096f,0x00050088,0x0000008b,0x00000971,
+0x0000096d,0x00000970,0x0003003e,0x00000968,
+0x00000971,0x0004003d,0x0000008b,0x00000973,
+0x00000968,0x00050085,0x0000008b,0x00000975,
+0x00000973,0x00000974,0x0008000c,0x0000008b,
+0x00000977,0x00000001,0x0000002b,0x00000975,
+0x00000976,0x00000974,0x0006000c,0x0000008b,
+0x00000978,0x00000001,0x00000001,0x00000977,
+0x0004006e,0x00000059,0x00000979,0x00000978,
+0x0003003e,0x00000972,0x00000979,0x0004003d,
+0x00000059,0x0000097a,0x00000972,0x00050084,
+0x00000059,0x0000097b,0x0000097a,0x000000e3,
+0x000600cb,0x00000006,0x0000097c,0x00000442,
+0x0000097b,0x000000e3,0x000200fe,0x0000097c,
+0x00010038,0x00050036,0x00000006,0x00000098,
+0x00000000,0x00000094,0x00030037,0x00000007,
+0x00000095,0x00030037,0x00000007,0x00000096,
+0x00030037,0x00000007,0x00000097,0x000200f8,
+0x00000099,0x0004003b,0x00000967,0x0000097f,
+0x00000007,0x0004003b,0x0000026f,0x00000989,
+0x00000007,0x0004003d,0x00000006,0x00000980,
+0x00000095,0x0004003d,0x00000006,0x00000981,
+0x00000096,0x00050082,0x00000006,0x00000982,
+0x00000980,0x00000981,0x00040070,0x0000008b,
+0x00000983,0x00000982,0x0004003d,0x00000006,
+0x00000984,0x00000097,0x0004003d,0x00000006,
+0x00000985,0x00000096,0x00050082,0x00000006,
+0x00000986,0x00000984,0x00000985,0x00040070,
+0x0000008b,0x00000987,0x00000986,0x00050088,
+0x0000008b,0x00000988,0x00000983,0x00000987,
+0x0003003e,0x0000097f,0x00000988,0x0004003d,
+0x0000008b,0x0000098a,0x0000097f,0x00050085,
+0x0000008b,0x0000098c,0x0000098a,0x0000098b,
+0x0008000c,0x0000008b,0x0000098d,0x00000001,
+0x0000002b,0x0000098c,0x00000976,0x0000098b,
+0x0006000c,0x0000008b,0x0000098e,0x00000001,
+0x00000001,0x0000098d,0x0004006e,0x00000059,
+0x0000098f,0x0000098e,0x0003003e,0x00000989,
+0x0000098f,0x0004003d,0x00000059,0x00000991,
+0x00000989,0x00050084,0x00000059,0x00000992,
+0x00000991,0x000000ec,0x000600cb,0x00000006,
+0x00000993,0x00000990,0x00000992,0x00000181,
+0x000200fe,0x00000993,0x00010038,0x00050036,
+0x00000002,0x0000009e,0x00000000,0x0000009a,
+0x00030037,0x00000009,0x0000009b,0x00030037,
+0x00000009,0x0000009c,0x00030037,0x00000009,
+0x0000009d,0x000200f8,0x0000009f,0x0004003b,
+0x00000009,0x00000996,0x00000007,0x0004003b,
+0x00000009,0x0000099d,0x00000007,0x0004003b,
+0x00000009,0x000009a0,0x00000007,0x0004003b,
+0x00000061,0x000009ac,0x00000007,0x0004003b,
+0x0000008d,0x000009b2,0x00000007,0x0004003b,
+0x0000008d,0x000009ba,0x00000007,0x0004003b,
+0x000009c3,0x000009c4,0x00000007,0x0004003b,
+0x0000008d,0x000009e2,0x00000007,0x0004003b,
+0x00000967,0x000009ef,0x00000007,0x0004003b,
+0x0000008d,0x000009fe,0x00000007,0x0004003b,
+0x00000967,0x00000a0b,0x00000007,0x0004003b,
+0x00000967,0x00000a10,0x00000007,0x0004003b,
+0x00000967,0x00000a13,0x00000007,0x0004003b,
+0x00000012,0x00000a16,0x00000007,0x0004003b,
+0x00000012,0x00000a24,0x00000007,0x0004003d,
+0x00000008,0x00000997,0x0000009b,0x0007015d,
+0x00000008,0x00000998,0x000000b8,0x00000003,
+0x00000997,0x00000170,0x00060050,0x00000008,
+0x00000999,0x000000af,0x000000af,0x000000af,
+0x00050080,0x00000008,0x0000099a,0x00000998,
+0x00000999,0x00060050,0x00000060,0x0000099b,
+0x000000ec,0x000000ec,0x000000ec,0x000500c2,
+0x00000008,0x0000099c,0x0000099a,0x0000099b,
+0x0003003e,0x00000996,0x0000099c,0x0004003d,
+0x00000008,0x0000099e,0x0000009b,0x00070162,
+0x00000008,0x0000099f,0x000000b8,0x00000003,
+0x0000099e,0x00000170,0x0003003e,0x0000099d,
+0x0000099f,0x0004003d,0x00000008,0x000009a1,
+0x0000009b,0x00070165,0x00000008,0x000009a2,
+0x000000b8,0x00000003,0x000009a1,0x00000170,
+0x0003003e,0x000009a0,0x000009a2,0x0004003d,
+0x00000008,0x000009a3,0x0000099d,0x0004003d,
+0x00000008,0x000009a4,0x000009a0,0x000500aa,
+0x00000630,0x000009a5,0x000009a3,0x000009a4,
+0x0004009b,0x000000cf,0x000009a6,0x000009a5,
+0x000300f7,0x000009a8,0x00000000,0x000400fa,
+0x000009a6,0x000009a7,0x000009a8,0x000200f8,
+0x000009a7,0x0004003d,0x00000008,0x000009a9,
+0x0000099d,0x0003003e,0x0000009c,0x000009a9,
+0x0004003d,0x00000008,0x000009aa,0x0000099d,
+0x0003003e,0x0000009d,0x000009aa,0x000100fd,
+0x000200f8,0x000009a8,0x0004003d,0x00000008,
+0x000009ad,0x0000009b,0x0004007c,0x00000060,
+0x000009ae,0x000009ad,0x0004003d,0x00000008,
+0x000009af,0x00000996,0x0004007c,0x00000060,
+0x000009b0,0x000009af,0x00050082,0x00000060,
+0x000009b1,0x000009ae,0x000009b0,0x0003003e,
+0x000009ac,0x000009b1,0x00050041,0x0000026f,
+0x000009b3,0x000009ac,0x000000bf,0x0004003d,
+0x00000059,0x000009b4,0x000009b3,0x0004003d,
+0x00000060,0x000009b5,0x000009ac,0x00060050,
+0x00000060,0x000009b6,0x000009b4,0x000009b4,
+0x000009b4,0x00050084,0x00000060,0x000009b7,
+0x000009b6,0x000009b5,0x0007015d,0x00000060,
+0x000009b8,0x000000b8,0x00000003,0x000009b7,
+0x00000170,0x0004006f,0x0000008c,0x000009b9,
+0x000009b8,0x0003003e,0x000009b2,0x000009b9,
+0x0004003d,0x00000060,0x000009bb,0x000009ac,
+0x0008004f,0x00000060,0x000009bc,0x000009bb,
+0x000009bb,0x00000001,0x00000001,0x00000002,
+0x0004003d,0x00000060,0x000009bd,0x000009ac,
+0x0008004f,0x00000060,0x000009be,0x000009bd,
+0x000009bd,0x00000001,0x00000002,0x00000002,
+0x00050084,0x00000060,0x000009bf,0x000009bc,
+0x000009be,0x0007015d,0x00000060,0x000009c0,
+0x000000b8,0x00000003,0x000009bf,0x00000170,
+0x0004006f,0x0000008c,0x000009c1,0x000009c0,
+0x0003003e,0x000009ba,0x000009c1,0x0004003d,
+0x0000008c,0x000009c5,0x000009b2,0x00050041,
+0x00000967,0x000009c6,0x000009b2,0x000000c2,
+0x0004003d,0x0000008b,0x000009c7,0x000009c6,
+0x0004003d,0x0000008c,0x000009c8,0x000009ba,
+0x0007004f,0x000005f9,0x000009c9,0x000009c8,
+0x000009c8,0x00000000,0x00000001,0x00050051,
+0x0000008b,0x000009ca,0x000009c9,0x00000000,
+0x00050051,0x0000008b,0x000009cb,0x000009c9,
+0x00000001,0x00060050,0x0000008c,0x000009cc,
+0x000009c7,0x000009ca,0x000009cb,0x00050041,
+0x00000967,0x000009cd,0x000009b2,0x000000b4,
+0x0004003d,0x0000008b,0x000009ce,0x000009cd,
+0x0004003d,0x0000008c,0x000009cf,0x000009ba,
+0x0007004f,0x000005f9,0x000009d0,0x000009cf,
+0x000009cf,0x00000001,0x00000002,0x00050051,
+0x0000008b,0x000009d1,0x000009d0,0x00000000,
+0x00050051,0x0000008b,0x000009d2,0x000009d0,
+0x00000001,0x00060050,0x0000008c,0x000009d3,
+0x000009ce,0x000009d1,0x000009d2,0x00050051,
+0x0000008b,0x000009d5,0x000009c5,0x00000000,
+0x00050051,0x0000008b,0x000009d6,0x000009c5,
+0x00000001,0x00050051,0x0000008b,0x000009d7,
+0x000009c5,0x00000002,0x00050051,0x0000008b,
+0x000009d8,0x000009cc,0x00000000,0x00050051,
+0x0000008b,0x000009d9,0x000009cc,0x00000001,
+0x00050051,0x0000008b,0x000009da,0x000009cc,
+0x00000002,0x00050051,0x0000008b,0x000009db,
+0x000009d3,0x00000000,0x00050051,0x0000008b,
+0x000009dc,0x000009d3,0x00000001,0x00050051,
+0x0000008b,0x000009dd,0x000009d3,0x00000002,
+0x00060050,0x0000008c,0x000009de,0x000009d5,
+0x000009d6,0x000009d7,0x00060050,0x0000008c,
+0x000009df,0x000009d8,0x000009d9,0x000009da,
+0x00060050,0x0000008c,0x000009e0,0x000009db,
+0x000009dc,0x000009dd,0x00060050,0x000009c2,
+0x000009e1,0x000009de,0x000009df,0x000009e0,
+0x0003003e,0x000009c4,0x000009e1,0x0004003d,
+0x000009c2,0x000009e3,0x000009c4,0x0004003d,
+0x000009c2,0x000009e4,0x000009c4,0x0004003d,
+0x000009c2,0x000009e5,0x000009c4,0x0004003d,
+0x000009c2,0x000009e6,0x000009c4,0x0004003d,
+0x00000008,0x000009e7,0x000009a0,0x0004003d,
+0x00000008,0x000009e8,0x0000099d,0x00050082,
+0x00000008,0x000009e9,0x000009e7,0x000009e8,
+0x00040070,0x0000008c,0x000009ea,0x000009e9,
+0x00050091,0x0000008c,0x000009eb,0x000009e6,
+0x000009ea,0x00050091,0x0000008c,0x000009ec,
+0x000009e5,0x000009eb,0x00050091,0x0000008c,
+0x000009ed,0x000009e4,0x000009ec,0x00050091,
+0x0000008c,0x000009ee,0x000009e3,0x000009ed,
+0x0003003e,0x000009e2,0x000009ee,0x00050041,
+0x00000967,0x000009f0,0x000009e2,0x000000bf,
+0x0004003d,0x0000008b,0x000009f1,0x000009f0,
+0x0006000c,0x0000008b,0x000009f2,0x00000001,
+0x00000004,0x000009f1,0x00050041,0x00000967,
+0x000009f3,0x000009e2,0x000000c2,0x0004003d,
+0x0000008b,0x000009f4,0x000009f3,0x0006000c,
+0x0000008b,0x000009f5,0x00000001,0x00000004,
+0x000009f4,0x0007000c,0x0000008b,0x000009f6,
+0x00000001,0x00000028,0x000009f2,0x000009f5,
+0x00050041,0x00000967,0x000009f7,0x000009e2,
+0x000000b4,0x0004003d,0x0000008b,0x000009f8,
+0x000009f7,0x0006000c,0x0000008b,0x000009f9,
+0x00000001,0x00000004,0x000009f8,0x0007000c,
+0x0000008b,0x000009fa,0x00000001,0x00000028,
+0x000009f6,0x000009f9,0x0003003e,0x000009ef,
+0x000009fa,0x0004003d,0x0000008b,0x000009fb,
+0x000009ef,0x000500b8,0x000000cf,0x000009fd,
+0x000009fb,0x000009fc,0x000300f7,0x00000a00,
+0x00000000,0x000400fa,0x000009fd,0x000009ff,
+0x00000a05,0x000200f8,0x000009ff,0x0003003e,
+0x000009fe,0x00000a04,0x000200f9,0x00000a00,
+0x000200f8,0x00000a05,0x0004003d,0x0000008c,
+0x00000a06,0x000009e2,0x0004003d,0x0000008b,
+0x00000a07,0x000009ef,0x00060050,0x0000008c,
+0x00000a08,0x00000a07,0x00000a07,0x00000a07,
+0x00050088,0x0000008c,0x00000a09,0x00000a06,
+0x00000a08,0x0003003e,0x000009fe,0x00000a09,
+0x000200f9,0x00000a00,0x000200f8,0x00000a00,
+0x0004003d,0x0000008c,0x00000a0a,0x000009fe,
+0x0003003e,0x000009e2,0x00000a0a,0x0004003d,
+0x00000008,0x00000a0c,0x0000009b,0x00040070,
+0x0000008c,0x00000a0d,0x00000a0c,0x0004003d,
+0x0000008c,0x00000a0e,0x000009e2,0x00050094,
+0x0000008b,0x00000a0f,0x00000a0d,0x00000a0e,
+0x0003003e,0x00000a0b,0x00000a0f,0x0004003d,
+0x0000008b,0x00000a11,0x00000a0b,0x00070163,
+0x0000008b,0x00000a12,0x000000b8,0x00000003,
+0x00000a11,0x00000170,0x0003003e,0x00000a10,
+0x00000a12,0x0004003d,0x0000008b,0x00000a14,
+0x00000a0b,0x00070166,0x0000008b,0x00000a15,
+0x000000b8,0x00000003,0x00000a14,0x00000170,
+0x0003003e,0x00000a13,0x00000a15,0x0004003d,
+0x0000008b,0x00000a17,0x00000a0b,0x0004003d,
+0x0000008b,0x00000a18,0x00000a10,0x000500b4,
+0x000000cf,0x00000a19,0x00000a17,0x00000a18,
+0x0004003d,0x00000006,0x00000a1c,0x00000a1b,
+0x000600a9,0x00000006,0x00000a1d,0x00000a19,
+0x00000a1c,0x000000bf,0x0004003d,0x0000008b,
+0x00000a1e,0x00000a0b,0x0004003d,0x0000008b,
+0x00000a1f,0x00000a13,0x000500b4,0x000000cf,
+0x00000a20,0x00000a1e,0x00000a1f,0x0004003d,
+0x00000006,0x00000a21,0x00000a1b,0x000600a9,
+0x00000006,0x00000a22,0x00000a20,0x00000a21,
+0x000000bf,0x00050050,0x00000011,0x00000a23,
+0x00000a1d,0x00000a22,0x0003003e,0x00000a16,
+0x00000a23,0x0004003d,0x00000011,0x00000a25,
+0x00000a16,0x00070165,0x00000011,0x00000a26,
+0x000000b8,0x00000003,0x00000a25,0x00000170,
+0x0003003e,0x00000a24,0x00000a26,0x0004003d,
+0x00000008,0x00000a27,0x0000009b,0x00050041,
+0x00000007,0x00000a28,0x00000a24,0x000000bf,
+0x0004003d,0x00000006,0x00000a29,0x00000a28,
+0x00060159,0x00000008,0x00000a2a,0x000000b8,
+0x00000a27,0x00000a29,0x0003003e,0x0000009c,
+0x00000a2a,0x0004003d,0x00000008,0x00000a2b,
+0x0000009b,0x00050041,0x00000007,0x00000a2c,
+0x00000a24,0x000000c2,0x0004003d,0x00000006,
+0x00000a2d,0x00000a2c,0x00060159,0x00000008,
+0x00000a2e,0x000000b8,0x00000a2b,0x00000a2d,
+0x0003003e,0x0000009d,0x00000a2e,0x000100fd,
+0x00010038,0x00050036,0x00000011,0x000000a3,
+0x00000000,0x000000a0,0x00030037,0x00000007,
+0x000000a1,0x00030037,0x00000007,0x000000a2,
+0x000200f8,0x000000a4,0x0004003b,0x00000007,
+0x00000a2f,0x00000007,0x0004003b,0x00000007,
+0x00000a32,0x00000007,0x0004003b,0x00000007,
+0x00000a35,0x00000007,0x0004003b,0x00000007,
+0x00000a39,0x00000007,0x0004003b,0x00000007,
+0x00000a3c,0x00000007,0x0004003b,0x00000007,
+0x00000a3e,0x00000007,0x0004003b,0x00000007,
+0x00000a40,0x00000007,0x0004003b,0x00000012,
+0x00000a45,0x00000007,0x0004003b,0x00000007,
+0x00000a48,0x00000007,0x0004003b,0x00000007,
+0x00000a56,0x00000007,0x0004003b,0x00000012,
+0x00000a61,0x00000007,0x0004003d,0x00000006,
+0x00000a30,0x000000a1,0x00070162,0x00000006,
+0x00000a31,0x000000b8,0x00000003,0x00000a30,
+0x00000170,0x0003003e,0x00000a2f,0x00000a31,
+0x0004003d,0x00000006,0x00000a33,0x000000a1,
+0x00070165,0x00000006,0x00000a34,0x000000b8,
+0x00000003,0x00000a33,0x00000170,0x0003003e,
+0x00000a32,0x00000a34,0x0004003d,0x00000006,
+0x00000a36,0x00000a2f,0x0004003d,0x00000006,
+0x00000a37,0x00000a32,0x000500ab,0x000000cf,
+0x00000a38,0x00000a36,0x00000a37,0x000300f7,
+0x00000a3b,0x00000000,0x000400fa,0x00000a38,
+0x00000a3a,0x00000a43,0x000200f8,0x00000a3a,
+0x0004003d,0x00000006,0x00000a3d,0x000000a1,
+0x0003003e,0x00000a3c,0x00000a3d,0x0004003d,
+0x00000006,0x00000a3f,0x00000a2f,0x0003003e,
+0x00000a3e,0x00000a3f,0x0004003d,0x00000006,
+0x00000a41,0x00000a32,0x0003003e,0x00000a40,
+0x00000a41,0x00070039,0x00000006,0x00000a42,
+0x00000098,0x00000a3c,0x00000a3e,0x00000a40,
+0x0003003e,0x00000a39,0x00000a42,0x000200f9,
+0x00000a3b,0x000200f8,0x00000a43,0x0003003e,
+0x00000a39,0x000000bf,0x000200f9,0x00000a3b,
+0x000200f8,0x00000a3b,0x0004003d,0x00000006,
+0x00000a44,0x00000a39,0x0003003e,0x00000a35,
+0x00000a44,0x0004003d,0x00000006,0x00000a46,
+0x000000a2,0x000500b0,0x000000cf,0x00000a47,
+0x00000a46,0x000000b7,0x000300f7,0x00000a4a,
+0x00000000,0x000400fa,0x00000a47,0x00000a49,
+0x00000a4b,0x000200f8,0x00000a49,0x0003003e,
+0x00000a48,0x000000bf,0x000200f9,0x00000a4a,
+0x000200f8,0x00000a4b,0x0004003d,0x00000006,
+0x00000a4c,0x00000a35,0x000500c4,0x00000006,
+0x00000a4d,0x00000a4c,0x000008bc,0x0004003d,
+0x00000006,0x00000a4f,0x000000a2,0x00050084,
+0x00000006,0x00000a50,0x00000a4e,0x00000a4f,
+0x00050080,0x00000006,0x00000a51,0x00000a50,
+0x00000442,0x000500c2,0x00000006,0x00000a52,
+0x00000a4d,0x00000a51,0x0003003e,0x00000a48,
+0x00000a52,0x000200f9,0x00000a4a,0x000200f8,
+0x00000a4a,0x0004003d,0x00000006,0x00000a53,
+0x00000a48,0x0004003d,0x00000006,0x00000a54,
+0x000000a2,0x000500ac,0x000000cf,0x00000a55,
+0x00000a54,0x000000b7,0x000300f7,0x00000a58,
+0x00000000,0x000400fa,0x00000a55,0x00000a57,
+0x00000a59,0x000200f8,0x00000a57,0x0003003e,
+0x00000a56,0x000000bf,0x000200f9,0x00000a58,
+0x000200f8,0x00000a59,0x0004003d,0x00000006,
+0x00000a5a,0x00000a35,0x0004003d,0x00000006,
+0x00000a5b,0x000000a2,0x00050084,0x00000006,
+0x00000a5c,0x000000b8,0x00000a5b,0x00050080,
+0x00000006,0x00000a5d,0x00000a5c,0x00000170,
+0x000500c4,0x00000006,0x00000a5e,0x00000a5a,
+0x00000a5d,0x0003003e,0x00000a56,0x00000a5e,
+0x000200f9,0x00000a58,0x000200f8,0x00000a58,
+0x0004003d,0x00000006,0x00000a5f,0x00000a56,
+0x00050050,0x00000011,0x00000a60,0x00000a53,
+0x00000a5f,0x0003003e,0x00000a45,0x00000a60,
+0x0004003d,0x00000011,0x00000a62,0x00000a45,
+0x00070168,0x00000011,0x00000a63,0x000000b8,
+0x00000003,0x00000a62,0x00000170,0x0003003e,
+0x00000a61,0x00000a63,0x0004003d,0x00000006,
+0x00000a64,0x00000a32,0x000500c7,0x00000006,
+0x00000a65,0x00000a64,0x000006b5,0x0004003d,
+0x00000006,0x00000a66,0x00000a2f,0x000500c7,
+0x00000006,0x00000a67,0x00000a66,0x000006b5,
+0x000500c4,0x00000006,0x00000a68,0x00000a67,
+0x000005bf,0x000500c5,0x00000006,0x00000a69,
+0x00000a65,0x00000a68,0x00050041,0x00000007,
+0x00000a6a,0x00000a61,0x000000c2,0x0004003d,
+0x00000006,0x00000a6b,0x00000a6a,0x000500c5,
+0x00000006,0x00000a6c,0x00000a69,0x00000a6b,
+0x00050041,0x00000007,0x00000a6d,0x00000a61,
+0x000000bf,0x0004003d,0x00000006,0x00000a6e,
+0x00000a6d,0x00050050,0x00000011,0x00000a6f,
+0x00000a6c,0x00000a6e,0x000200fe,0x00000a6f,
+0x00010038,0x00050036,0x00000006,0x000000a7,
+0x00000000,0x000000a5,0x00030037,0x00000009,
+0x000000a6,0x000200f8,0x000000a8,0x0004003b,
+0x00000009,0x00000a72,0x00000007,0x0004003d,
+0x00000008,0x00000a73,0x000000a6,0x00040070,
+0x0000008c,0x00000a74,0x00000a73,0x00050085,
+0x0000008c,0x00000a78,0x00000a74,0x00000a77,
+0x00050088,0x0000008c,0x00000a7b,0x00000a78,
+0x00000a7a,0x0006000c,0x0000008c,0x00000a7c,
+0x00000001,0x00000001,0x00000a7b,0x0004006d,
+0x00000008,0x00000a7d,0x00000a7c,0x0003003e,
+0x00000a72,0x00000a7d,0x00050041,0x00000007,
+0x00000a7e,0x00000a72,0x000000bf,0x0004003d,
+0x00000006,0x00000a7f,0x00000a7e,0x000500c4,
+0x00000006,0x00000a80,0x00000a7f,0x000001a9,
+0x00050041,0x00000007,0x00000a81,0x00000a72,
+0x000000c2,0x0004003d,0x00000006,0x00000a82,
+0x00000a81,0x000500c4,0x00000006,0x00000a83,
+0x00000a82,0x000000f2,0x000500c5,0x00000006,
+0x00000a84,0x00000a80,0x00000a83,0x00050041,
+0x00000007,0x00000a85,0x00000a72,0x000000b4,
+0x0004003d,0x00000006,0x00000a86,0x00000a85,
+0x000500c5,0x00000006,0x00000a87,0x00000a84,
+0x00000a86,0x000200fe,0x00000a87,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_3D.inl
new file mode 100644
index 00000000000..dcee0e2c2c9
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToBc3_3D.inl
@@ -0,0 +1,4246 @@
+0x07230203,0x00010300,0x000d000a,0x00000b15,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000003d,0x00020011,0x00000041,0x00020011,
+0x00000043,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0009000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000a1b,
+0x00000a8b,0x00000a8d,0x00000a9a,0x00060010,
+0x00000004,0x00000011,0x00000040,0x00000001,
+0x00000001,0x00030003,0x00000002,0x000001c2,
+0x000a0004,0x475f4c47,0x4c474f4f,0x70635f45,
+0x74735f70,0x5f656c79,0x656e696c,0x7269645f,
+0x69746365,0x00006576,0x00080004,0x475f4c47,
+0x4c474f4f,0x6e695f45,0x64756c63,0x69645f65,
+0x74636572,0x00657669,0x00090004,0x4b5f4c47,
+0x735f5248,0x65646168,0x75735f72,0x6f726762,
+0x625f7075,0x63697361,0x00000000,0x000a0004,
+0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,
+0x6f726762,0x635f7075,0x7473756c,0x64657265,
+0x00000000,0x00090004,0x4b5f4c47,0x735f5248,
+0x65646168,0x75735f72,0x6f726762,0x735f7075,
+0x66667568,0x0000656c,0x00040005,0x00000004,
+0x6e69616d,0x00000000,0x00080005,0x0000000d,
+0x45746567,0x646f636e,0x53676e69,0x28657a69,
+0x763b3175,0x003b3375,0x00040005,0x0000000b,
+0x566d756e,0x00736c61,0x00050005,0x0000000c,
+0x6f636e65,0x676e6964,0x00000000,0x000a0005,
+0x00000016,0x63747361,0x6f636544,0x49726564,
+0x6974696e,0x7a696c61,0x75762865,0x75763b34,
+0x00003b32,0x00050005,0x00000014,0x636f6c62,
+0x7461446b,0x00000061,0x00050005,0x00000015,
+0x636f6c62,0x7a69536b,0x00005f65,0x00080005,
+0x0000001c,0x72747865,0x42746361,0x28737469,
+0x3b347576,0x753b3175,0x00003b31,0x00040005,
+0x00000019,0x61746164,0x00000000,0x00040005,
+0x0000001a,0x7366666f,0x00007465,0x00040005,
+0x0000001b,0x426d756e,0x00737469,0x00080005,
+0x00000023,0x6f636564,0x45436564,0x3175284d,
+0x3b31753b,0x753b3175,0x00003b31,0x00060005,
+0x0000001f,0x74726170,0x6f697469,0x646e496e,
+0x00007865,0x00060005,0x00000020,0x72617473,
+0x45664f74,0x61727478,0x006d6543,0x00060005,
+0x00000021,0x61746f74,0x646e456c,0x6e696f70,
+0x00007374,0x00070005,0x00000022,0x65736162,
+0x70646e45,0x746e696f,0x65646e49,0x00000078,
+0x00090005,0x0000002a,0x6f636564,0x72546564,
+0x76287469,0x753b3475,0x31753b31,0x3b31753b,
+0x00000000,0x00040005,0x00000026,0x61746164,
+0x00000000,0x00040005,0x00000027,0x7366666f,
+0x00007465,0x00040005,0x00000028,0x426d756e,
+0x00737469,0x00030005,0x00000029,0x00000069,
+0x00090005,0x00000030,0x6f636564,0x75516564,
+0x28746e69,0x3b347576,0x753b3175,0x31753b31,
+0x0000003b,0x00040005,0x0000002c,0x61746164,
+0x00000000,0x00040005,0x0000002d,0x7366666f,
+0x00007465,0x00040005,0x0000002e,0x426d756e,
+0x00737469,0x00030005,0x0000002f,0x00000069,
+0x000a0005,0x00000037,0x6f636564,0x57316564,
+0x68676965,0x75762874,0x75763b34,0x31753b33,
+0x3b31753b,0x00000000,0x00050005,0x00000033,
+0x67696577,0x61447468,0x00006174,0x00050005,
+0x00000034,0x6f636e65,0x676e6964,0x00000000,
+0x00050005,0x00000035,0x576d756e,0x68676965,
+0x00007374,0x00040005,0x00000036,0x65646e69,
+0x00000078,0x000e0005,0x00000042,0x65746e69,
+0x6c6f7072,0x57657461,0x68676965,0x76287374,
+0x763b3475,0x753b3375,0x31753b31,0x3b31753b,
+0x753b3175,0x75763b31,0x00003b32,0x00050005,
+0x0000003a,0x67696577,0x61447468,0x00006174,
+0x00050005,0x0000003b,0x6f636e65,0x676e6964,
+0x00000000,0x00050005,0x0000003c,0x576d756e,
+0x68676965,0x00007374,0x00040005,0x0000003d,
+0x65646e69,0x00000078,0x00050005,0x0000003e,
+0x64697267,0x74646957,0x00000068,0x00040005,
+0x0000003f,0x69727473,0x00006564,0x00040005,
+0x00000040,0x7366666f,0x00007465,0x00060005,
+0x00000041,0x63617266,0x6e6f6974,0x61506c61,
+0x00007472,0x00080005,0x00000047,0x6f636564,
+0x65576564,0x74686769,0x75762873,0x75763b34,
+0x00003b32,0x00050005,0x00000045,0x67696577,
+0x61447468,0x00006174,0x00050005,0x00000046,
+0x49736f70,0x6f6c426e,0x00006b63,0x00050005,
+0x0000004b,0x68736168,0x75283235,0x00003b31,
+0x00030005,0x0000004a,0x00000070,0x00090005,
+0x00000051,0x656c6573,0x61507463,0x74697472,
+0x286e6f69,0x763b3175,0x753b3275,0x00003b31,
+0x00040005,0x0000004e,0x64656573,0x00000000,
+0x00030005,0x0000004f,0x00736f70,0x00060005,
+0x00000050,0x506d756e,0x69747261,0x6e6f6974,
+0x00000073,0x000a0005,0x00000057,0x45746567,
+0x6f70646e,0x45746e69,0x646f636e,0x28676e69,
+0x753b3175,0x31753b31,0x0000003b,0x00080005,
+0x00000054,0x69617661,0x6c62616c,0x646e4565,
+0x6e696f70,0x74694274,0x00000073,0x00060005,
+0x00000055,0x456d756e,0x6f70646e,0x73746e69,
+0x00000000,0x00050005,0x00000056,0x75746361,
+0x69536c61,0x0000657a,0x00070005,0x0000005e,
+0x65756c62,0x746e6f43,0x74636172,0x34697628,
+0x0000003b,0x00030005,0x0000005d,0x00000076,
+0x00050005,0x00000064,0x286d7573,0x3b336976,
+0x00000000,0x00030005,0x00000063,0x00000076,
+0x00090005,0x00000069,0x54746962,0x736e6172,
+0x53726566,0x656e6769,0x69762864,0x69763b34,
+0x00003b34,0x00030005,0x00000067,0x00000061,
+0x00030005,0x00000068,0x00000062,0x000b0005,
+0x00000071,0x6f636564,0x6e456564,0x696f7064,
+0x2873746e,0x3b346976,0x3b346976,0x763b3175,
+0x763b3475,0x003b3475,0x00030005,0x0000006c,
+0x00004176,0x00030005,0x0000006d,0x00004276,
+0x00040005,0x0000006e,0x65646f6d,0x00000000,
+0x00030005,0x0000006f,0x00307065,0x00030005,
+0x00000070,0x00317065,0x000a0005,0x00000078,
+0x6f636564,0x45316564,0x6f70646e,0x28746e69,
+0x3b347576,0x753b3175,0x75763b31,0x00003b33,
+0x00040005,0x00000074,0x61746164,0x00000000,
+0x00050005,0x00000075,0x72617473,0x66664f74,
+0x00746573,0x00040005,0x00000076,0x65646e69,
+0x00000078,0x00050005,0x00000077,0x6f636e65,
+0x676e6964,0x00000000,0x00070005,0x0000007c,
+0x6c697562,0x74694264,0x6b73616d,0x3b317528,
+0x00000000,0x00040005,0x0000007b,0x73746962,
+0x00000000,0x00080005,0x00000080,0x63747361,
+0x6f636544,0x65546564,0x286c6578,0x3b327576,
+0x00000000,0x00050005,0x0000007f,0x49736f70,
+0x6f6c426e,0x00006b63,0x00060005,0x00000084,
+0x50746567,0x4433736f,0x33697628,0x0000003b,
+0x00030005,0x00000083,0x00736f70,0x00070005,
+0x00000089,0x6f636564,0x47526564,0x76284142,
+0x753b3275,0x00003b31,0x00050005,0x00000087,
+0x65786574,0x736f506c,0x00000000,0x00040005,
+0x00000088,0x6579616c,0x00000072,0x00090005,
+0x00000092,0x43746567,0x726f6c6f,0x65646e49,
+0x66762878,0x66763b33,0x66763b33,0x00003b33,
+0x00040005,0x0000008f,0x6f6c6f63,0x00000072,
+0x00050005,0x00000090,0x456e696d,0x6f70646e,
+0x00746e69,0x00050005,0x00000091,0x4578616d,
+0x6f70646e,0x00746e69,0x00080005,0x00000098,
+0x41746567,0x6168706c,0x65646e49,0x31752878,
+0x3b31753b,0x003b3175,0x00040005,0x00000095,
+0x68706c61,0x00000061,0x00050005,0x00000096,
+0x416e696d,0x6168706c,0x00000000,0x00050005,
+0x00000097,0x4178616d,0x6168706c,0x00000000,
+0x000a0005,0x0000009e,0x706d6f63,0x45657475,
+0x6f70646e,0x73746e69,0x33757628,0x3375763b,
+0x3375763b,0x0000003b,0x00050005,0x0000009b,
+0x43626772,0x726f6c6f,0x00000000,0x00050005,
+0x0000009c,0x456e696d,0x6f70646e,0x00746e69,
+0x00050005,0x0000009d,0x4578616d,0x6f70646e,
+0x00746e69,0x00070005,0x000000a3,0x6f636e65,
+0x6c416564,0x28616870,0x753b3175,0x00003b31,
+0x00040005,0x000000a1,0x756c6176,0x00000065,
+0x00040005,0x000000a2,0x65786574,0x0064496c,
+0x00080005,0x000000a7,0x6b636170,0x6f6c6f43,
+0x526f5472,0x36354247,0x75762835,0x00003b33,
+0x00040005,0x000000a6,0x6f6c6f63,0x00000072,
+0x00040005,0x000000a9,0x69427174,0x00007374,
+0x00050005,0x000000ca,0x63747361,0x636f6c42,
+0x0000006b,0x00050005,0x000000cd,0x636f6c62,
+0x7a69536b,0x00000065,0x00050005,0x000000d1,
+0x6f636564,0x72456564,0x00726f72,0x00050005,
+0x000000d3,0x64696f76,0x65747845,0x0000746e,
+0x00040005,0x000000df,0x73746962,0x00003130,
+0x00040005,0x000000e5,0x73746962,0x00003332,
+0x00040005,0x000000e9,0x34746962,0x00000000,
+0x00040005,0x000000ef,0x73746962,0x00003635,
+0x00040005,0x000000f4,0x73746962,0x00003837,
+0x00030005,0x000000f9,0x00000068,0x00050005,
+0x000000fe,0x6c617564,0x6e616c50,0x00000065,
+0x00030005,0x00000108,0x00000072,0x00060005,
+0x00000113,0x67696577,0x72477468,0x69536469,
+0x0000657a,0x00060005,0x0000016f,0x67696577,
+0x6e457468,0x69646f63,0x0000676e,0x00050005,
+0x00000186,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000189,0x576d756e,0x68676965,
+0x00007374,0x00060005,0x00000192,0x67696577,
+0x61447468,0x69536174,0x0000657a,0x00040005,
+0x00000193,0x61726170,0x0000006d,0x00040005,
+0x00000195,0x61726170,0x0000006d,0x00060005,
+0x000001a6,0x506d756e,0x69747261,0x6e6f6974,
+0x00000073,0x00060005,0x000001b0,0x74726170,
+0x6f697469,0x6565536e,0x00000064,0x00030005,
+0x000001c1,0x00000069,0x00030005,0x000001c6,
+0x0000006a,0x00040005,0x000001cd,0x72617473,
+0x00000074,0x00050005,0x000001e0,0x4c6d756e,
+0x6942776f,0x00007374,0x00040005,0x000001e3,
+0x42776f6c,0x00737469,0x00050005,0x000001ec,
+0x68676968,0x73746942,0x00000000,0x00030005,
+0x00000203,0x006d6563,0x00050005,0x0000020e,
+0x536d6563,0x63656c65,0x00726f74,0x00040005,
+0x00000213,0x65736162,0x006d6543,0x00080005,
+0x0000021e,0x70646e65,0x746e696f,0x72655073,
+0x74726150,0x6f697469,0x0000006e,0x00060005,
+0x0000022c,0x657a6973,0x7845664f,0x43617274,
+0x00006d65,0x00050005,0x00000234,0x72747865,
+0x6d654361,0x00000000,0x00040005,0x00000235,
+0x61726170,0x0000006d,0x00040005,0x00000237,
+0x61726170,0x0000006d,0x00040005,0x00000239,
+0x61726170,0x0000006d,0x00040005,0x0000023c,
+0x6c6c7566,0x006d6543,0x00040005,0x00000241,
+0x6c61566d,0x00006575,0x00040005,0x00000249,
+0x6c615663,0x00736575,0x00050005,0x00000261,
+0x65736162,0x73616c43,0x00000073,0x00050005,
+0x00000270,0x6d756e69,0x73746942,0x00000000,
+0x00040005,0x00000273,0x636f6c62,0x0000006b,
+0x00040005,0x0000027a,0x61726170,0x0000006d,
+0x00040005,0x0000027c,0x61726170,0x0000006d,
+0x00040005,0x0000027d,0x61726170,0x0000006d,
+0x00050005,0x0000027f,0x6b636170,0x72546465,
+0x00737469,0x00040005,0x000002a2,0x42776f6c,
+0x00737469,0x00040005,0x000002a3,0x61726170,
+0x0000006d,0x00040005,0x000002a5,0x61726170,
+0x0000006d,0x00040005,0x000002a7,0x61726170,
+0x0000006d,0x00030005,0x000002ab,0x0000006a,
+0x00040005,0x000002b9,0x6f636564,0x00646564,
+0x00050005,0x000003a3,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x000003b1,0x6d756e69,
+0x73746942,0x00000000,0x00040005,0x000003b4,
+0x636f6c62,0x0000006b,0x00040005,0x000003b8,
+0x61726170,0x0000006d,0x00040005,0x000003ba,
+0x61726170,0x0000006d,0x00040005,0x000003bc,
+0x61726170,0x0000006d,0x00060005,0x000003be,
+0x6b636170,0x75516465,0x73746e69,0x00000000,
+0x00040005,0x000003d0,0x42776f6c,0x00737469,
+0x00040005,0x000003dc,0x6f636564,0x00646564,
+0x00050005,0x00000414,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000428,0x426d756e,
+0x00737469,0x00040005,0x00000430,0x7366666f,
+0x00007465,0x00030005,0x00000437,0x00000077,
+0x00040005,0x0000043a,0x61726170,0x0000006d,
+0x00040005,0x0000043c,0x61726170,0x0000006d,
+0x00040005,0x0000043e,0x61726170,0x0000006d,
+0x00040005,0x00000440,0x61726170,0x0000006d,
+0x00050005,0x00000459,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000463,0x7366666f,
+0x00007465,0x00030005,0x0000046a,0x00000077,
+0x00040005,0x0000046d,0x61726170,0x0000006d,
+0x00040005,0x0000046f,0x61726170,0x0000006d,
+0x00040005,0x00000471,0x61726170,0x0000006d,
+0x00040005,0x00000473,0x61726170,0x0000006d,
+0x00050005,0x00000487,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x0000048c,0x7366666f,
+0x00007465,0x00030005,0x00000490,0x00000077,
+0x00040005,0x00000491,0x61726170,0x0000006d,
+0x00040005,0x00000493,0x61726170,0x0000006d,
+0x00040005,0x00000495,0x61726170,0x0000006d,
+0x00040005,0x00000498,0x75716e75,0x00746e61,
+0x00050005,0x000004a4,0x65646e69,0x6c626178,
+0x00000065,0x00060005,0x000004b9,0x67696577,
+0x6e497468,0x65636964,0x00000073,0x00040005,
+0x000004c7,0x67696577,0x00737468,0x00040005,
+0x000004c8,0x61726170,0x0000006d,0x00040005,
+0x000004ca,0x61726170,0x0000006d,0x00040005,
+0x000004cc,0x61726170,0x0000006d,0x00040005,
+0x000004ce,0x61726170,0x0000006d,0x00040005,
+0x000004d2,0x61726170,0x0000006d,0x00040005,
+0x000004d4,0x61726170,0x0000006d,0x00040005,
+0x000004d6,0x61726170,0x0000006d,0x00040005,
+0x000004d8,0x61726170,0x0000006d,0x00040005,
+0x000004dc,0x61726170,0x0000006d,0x00040005,
+0x000004de,0x61726170,0x0000006d,0x00040005,
+0x000004e0,0x61726170,0x0000006d,0x00040005,
+0x000004e2,0x61726170,0x0000006d,0x00040005,
+0x000004e6,0x61726170,0x0000006d,0x00040005,
+0x000004e8,0x61726170,0x0000006d,0x00040005,
+0x000004ea,0x61726170,0x0000006d,0x00040005,
+0x000004ec,0x61726170,0x0000006d,0x00030005,
+0x000004f1,0x00313177,0x00040005,0x000004f9,
+0x74636166,0x0073726f,0x00050005,0x00000518,
+0x6c616373,0x63614665,0x00726f74,0x00070005,
+0x00000523,0x6f6d6f68,0x656e6567,0x4373756f,
+0x64726f6f,0x00000073,0x00050005,0x00000526,
+0x64697267,0x726f6f43,0x00007364,0x00060005,
+0x00000532,0x65746e69,0x6c617267,0x74726150,
+0x00000000,0x00060005,0x00000536,0x63617266,
+0x6e6f6974,0x61506c61,0x00007472,0x00050005,
+0x0000053b,0x64697267,0x74646957,0x00000068,
+0x00030005,0x0000053e,0x00003076,0x00040005,
+0x00000546,0x67696577,0x00737468,0x00040005,
+0x0000054c,0x61726170,0x0000006d,0x00040005,
+0x0000054e,0x61726170,0x0000006d,0x00040005,
+0x00000550,0x61726170,0x0000006d,0x00040005,
+0x00000552,0x61726170,0x0000006d,0x00040005,
+0x00000554,0x61726170,0x0000006d,0x00040005,
+0x00000556,0x61726170,0x0000006d,0x00040005,
+0x00000557,0x61726170,0x0000006d,0x00040005,
+0x00000558,0x61726170,0x0000006d,0x00040005,
+0x0000055f,0x61726170,0x0000006d,0x00040005,
+0x00000561,0x61726170,0x0000006d,0x00040005,
+0x00000563,0x61726170,0x0000006d,0x00040005,
+0x00000565,0x61726170,0x0000006d,0x00040005,
+0x00000567,0x61726170,0x0000006d,0x00040005,
+0x00000569,0x61726170,0x0000006d,0x00040005,
+0x0000056a,0x61726170,0x0000006d,0x00040005,
+0x0000056b,0x61726170,0x0000006d,0x00040005,
+0x000005b5,0x6d756e72,0x00000000,0x00040005,
+0x000005b6,0x61726170,0x0000006d,0x00040005,
+0x000005b9,0x64656573,0x00000041,0x00040005,
+0x000005c5,0x64656573,0x00000042,0x00040005,
+0x000005d8,0x66696873,0x00317374,0x00040005,
+0x000005e3,0x66696873,0x00327374,0x00040005,
+0x000005f6,0x75736572,0x0000746c,0x00030005,
+0x0000064d,0x00000069,0x00050005,0x00000655,
+0x6f636e65,0x676e6964,0x00000000,0x00050005,
+0x00000663,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000666,0x61726170,0x0000006d,
+0x00040005,0x00000668,0x61726170,0x0000006d,
+0x00030005,0x000006c2,0x0000306c,0x00030005,
+0x000006cb,0x0000316c,0x00040005,0x000006e9,
+0x61726170,0x0000006d,0x00040005,0x000006eb,
+0x61726170,0x0000006d,0x00040005,0x00000738,
+0x61726170,0x0000006d,0x00040005,0x0000073c,
+0x61726170,0x0000006d,0x00040005,0x00000748,
+0x61726170,0x0000006d,0x00040005,0x0000074c,
+0x61726170,0x0000006d,0x00040005,0x00000754,
+0x61726170,0x0000006d,0x00040005,0x00000756,
+0x61726170,0x0000006d,0x00040005,0x0000075b,
+0x61726170,0x0000006d,0x00040005,0x00000772,
+0x61726170,0x0000006d,0x00040005,0x00000778,
+0x61726170,0x0000006d,0x00040005,0x00000782,
+0x426d756e,0x00737469,0x00040005,0x0000078a,
+0x7366666f,0x00007465,0x00030005,0x00000793,
+0x00007065,0x00040005,0x00000796,0x61726170,
+0x0000006d,0x00040005,0x00000798,0x61726170,
+0x0000006d,0x00040005,0x0000079a,0x61726170,
+0x0000006d,0x00040005,0x0000079c,0x61726170,
+0x0000006d,0x00050005,0x00000804,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000080e,
+0x7366666f,0x00007465,0x00030005,0x00000817,
+0x00007065,0x00040005,0x0000081a,0x61726170,
+0x0000006d,0x00040005,0x0000081c,0x61726170,
+0x0000006d,0x00040005,0x0000081e,0x61726170,
+0x0000006d,0x00040005,0x00000820,0x61726170,
+0x0000006d,0x00050005,0x00000832,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000837,
+0x7366666f,0x00007465,0x00030005,0x0000083d,
+0x00000077,0x00040005,0x0000083e,0x61726170,
+0x0000006d,0x00040005,0x00000840,0x61726170,
+0x0000006d,0x00040005,0x00000842,0x61726170,
+0x0000006d,0x00040005,0x00000845,0x75716e75,
+0x00746e61,0x00050005,0x00000852,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000860,
+0x426d756e,0x00737469,0x00040005,0x00000869,
+0x6b73616d,0x00000000,0x00050005,0x00000894,
+0x67696577,0x61447468,0x00006174,0x00040005,
+0x00000898,0x61726170,0x0000006d,0x00040005,
+0x0000089c,0x67696577,0x00737468,0x00040005,
+0x0000089d,0x61726170,0x0000006d,0x00060005,
+0x000008a0,0x74726170,0x6f697469,0x646e496e,
+0x00007865,0x00040005,0x000008a1,0x61726170,
+0x0000006d,0x00040005,0x000008a3,0x61726170,
+0x0000006d,0x00040005,0x000008a4,0x61726170,
+0x0000006d,0x00060005,0x000008a7,0x72617473,
+0x45664f74,0x61727478,0x006d6543,0x00060005,
+0x000008a8,0x61746f74,0x646e456c,0x6e696f70,
+0x00007374,0x00070005,0x000008a9,0x65736162,
+0x70646e45,0x746e696f,0x65646e49,0x00000078,
+0x00030005,0x000008aa,0x006d6563,0x00040005,
+0x000008ab,0x61726170,0x0000006d,0x00040005,
+0x000008ad,0x61726170,0x0000006d,0x00040005,
+0x000008ae,0x61726170,0x0000006d,0x00040005,
+0x000008af,0x61726170,0x0000006d,0x00060005,
+0x000008b9,0x70646e65,0x746e696f,0x61745373,
+0x00007472,0x00060005,0x000008bf,0x70646e65,
+0x746e696f,0x646e4573,0x00000000,0x00080005,
+0x000008c7,0x69617661,0x6c62616c,0x646e4565,
+0x6e696f70,0x74694274,0x00000073,0x00070005,
+0x000008cb,0x70646e65,0x746e696f,0x6f636e45,
+0x676e6964,0x00000000,0x00070005,0x000008cc,
+0x75746361,0x6e456c61,0x696f7064,0x6942746e,
+0x00007374,0x00040005,0x000008cd,0x61726170,
+0x0000006d,0x00040005,0x000008cf,0x61726170,
+0x0000006d,0x00040005,0x000008d1,0x61726170,
+0x0000006d,0x00070005,0x000008d4,0x456d756e,
+0x6f70646e,0x50746e69,0x73726961,0x00000000,
+0x00030005,0x000008d8,0x00004176,0x00030005,
+0x000008d9,0x00004276,0x00040005,0x000008da,
+0x61447065,0x00006174,0x00040005,0x000008df,
+0x61726170,0x0000006d,0x00030005,0x000008e2,
+0x00000069,0x00040005,0x000008eb,0x64497065,
+0x00000078,0x00040005,0x000008f1,0x61726170,
+0x0000006d,0x00040005,0x000008f3,0x61726170,
+0x0000006d,0x00040005,0x000008f5,0x61726170,
+0x0000006d,0x00040005,0x000008f7,0x61726170,
+0x0000006d,0x00040005,0x000008ff,0x61726170,
+0x0000006d,0x00040005,0x00000901,0x61726170,
+0x0000006d,0x00040005,0x00000903,0x61726170,
+0x0000006d,0x00040005,0x00000904,0x61726170,
+0x0000006d,0x00030005,0x0000090b,0x00307065,
+0x00030005,0x0000090c,0x00317065,0x00040005,
+0x0000090d,0x61726170,0x0000006d,0x00040005,
+0x0000090f,0x61726170,0x0000006d,0x00040005,
+0x00000911,0x61726170,0x0000006d,0x00040005,
+0x00000913,0x61726170,0x0000006d,0x00040005,
+0x00000914,0x61726170,0x0000006d,0x00070005,
+0x00000918,0x67696577,0x50737468,0x68437265,
+0x656e6e61,0x0000006c,0x00030005,0x0000091f,
+0x00736363,0x00040005,0x00000920,0x61726170,
+0x0000006d,0x00040005,0x00000922,0x61726170,
+0x0000006d,0x00040005,0x00000924,0x61726170,
+0x0000006d,0x00050005,0x0000093c,0x636f6c62,
+0x736f506b,0x00000000,0x00050005,0x0000093e,
+0x67616d69,0x6f666e49,0x00000000,0x00060006,
+0x0000093e,0x00000000,0x636f6c62,0x7a69536b,
+0x00000065,0x00060006,0x0000093e,0x00000001,
+0x65736162,0x6579614c,0x00000072,0x00060006,
+0x0000093e,0x00000002,0x6c616d73,0x6f6c426c,
+0x00006b63,0x00060005,0x00000940,0x75705f75,
+0x6f436873,0x6174736e,0x0000746e,0x00050005,
+0x00000945,0x49736f70,0x6f6c426e,0x00006b63,
+0x00050005,0x0000094c,0x49637273,0x6567616d,
+0x00000000,0x00040005,0x00000955,0x61726170,
+0x0000006d,0x00040005,0x00000959,0x61726170,
+0x0000006d,0x00040005,0x0000095b,0x61726170,
+0x0000006d,0x00050005,0x00000963,0x6f6c6f63,
+0x6e694c72,0x00000065,0x00030005,0x00000968,
+0x00000078,0x00040005,0x00000972,0x65646e69,
+0x00000078,0x00030005,0x0000097f,0x00000078,
+0x00040005,0x00000989,0x65646e69,0x00000078,
+0x00050005,0x00000996,0x43677661,0x726f6c6f,
+0x00000000,0x00050005,0x0000099d,0x436e696d,
+0x726f6c6f,0x00000000,0x00050005,0x000009a0,
+0x4378616d,0x726f6c6f,0x00000000,0x00030005,
+0x000009ac,0x00007864,0x00040005,0x000009b2,
+0x31766f63,0x00000000,0x00040005,0x000009ba,
+0x32766f63,0x00000000,0x00040005,0x000009c4,
+0x4d766f63,0x00007461,0x00060005,0x000009e2,
+0x6e697270,0x61706963,0x6978416c,0x00000073,
+0x00040005,0x000009ef,0x6e67616d,0x00000000,
+0x00050005,0x00000a0b,0x74736964,0x65636e61,
+0x00000000,0x00050005,0x00000a10,0x446e696d,
+0x61747369,0x0065636e,0x00050005,0x00000a13,
+0x4478616d,0x61747369,0x0065636e,0x00040005,
+0x00000a16,0x69646e69,0x00736563,0x00080005,
+0x00000a1b,0x535f6c67,0x72676275,0x4970756f,
+0x636f766e,0x6f697461,0x0044496e,0x00050005,
+0x00000a24,0x4d6e696d,0x6e497861,0x00786564,
+0x00050005,0x00000a2f,0x566e696d,0x65756c61,
+0x00000000,0x00050005,0x00000a32,0x5678616d,
+0x65756c61,0x00000000,0x00040005,0x00000a35,
+0x65646e69,0x00000078,0x00040005,0x00000a3c,
+0x61726170,0x0000006d,0x00040005,0x00000a3e,
+0x61726170,0x0000006d,0x00040005,0x00000a40,
+0x61726170,0x0000006d,0x00040005,0x00000a45,
+0x6b73616d,0x00000000,0x00040005,0x00000a61,
+0x6b636170,0x00006465,0x00040005,0x00000a72,
+0x6e617571,0x00000074,0x00040005,0x00000a8a,
+0x61636f6c,0x0064496c,0x00060005,0x00000a8b,
+0x535f6c67,0x72676275,0x4970756f,0x00000044,
+0x00060005,0x00000a8d,0x535f6c67,0x72676275,
+0x5370756f,0x00657a69,0x00040005,0x00000a92,
+0x636f6c62,0x0064496b,0x00040005,0x00000a95,
+0x65786574,0x0064496c,0x00050005,0x00000a98,
+0x65786574,0x6f6f436c,0x00006472,0x00060005,
+0x00000a9a,0x575f6c67,0x476b726f,0x70756f72,
+0x00004449,0x00040005,0x00000aad,0x6579616c,
+0x00000072,0x00060005,0x00000ab4,0x72727563,
+0x54746e65,0x6c657865,0x00000000,0x00040005,
+0x00000ab5,0x61726170,0x0000006d,0x00040005,
+0x00000ab7,0x61726170,0x0000006d,0x00050005,
+0x00000aba,0x456e696d,0x6f70646e,0x00746e69,
+0x00050005,0x00000abb,0x4578616d,0x6f70646e,
+0x00746e69,0x00040005,0x00000abc,0x61726170,
+0x0000006d,0x00040005,0x00000abf,0x61726170,
+0x0000006d,0x00040005,0x00000ac0,0x61726170,
+0x0000006d,0x00050005,0x00000ac4,0x70646e65,
+0x746e696f,0x00000073,0x00040005,0x00000ac5,
+0x61726170,0x0000006d,0x00040005,0x00000ac8,
+0x61726170,0x0000006d,0x00040005,0x00000acc,
+0x65646e69,0x00000078,0x00040005,0x00000adb,
+0x61726170,0x0000006d,0x00040005,0x00000adc,
+0x61726170,0x0000006d,0x00040005,0x00000add,
+0x61726170,0x0000006d,0x00040005,0x00000aea,
+0x75736572,0x0000746c,0x00040005,0x00000aeb,
+0x61726170,0x0000006d,0x00040005,0x00000aee,
+0x61726170,0x0000006d,0x00050005,0x00000b06,
+0x49747364,0x6567616d,0x00000000,0x00040005,
+0x00000b11,0x61726170,0x0000006d,0x00050048,
+0x0000093e,0x00000000,0x00000023,0x00000000,
+0x00050048,0x0000093e,0x00000001,0x00000023,
+0x00000008,0x00050048,0x0000093e,0x00000002,
+0x00000023,0x0000000c,0x00030047,0x0000093e,
+0x00000002,0x00040047,0x0000094c,0x00000022,
+0x00000000,0x00040047,0x0000094c,0x00000021,
+0x00000000,0x00030047,0x0000094c,0x00000018,
+0x00030047,0x00000a1b,0x00000000,0x00040047,
+0x00000a1b,0x0000000b,0x00000029,0x00030047,
+0x00000a1c,0x00000000,0x00030047,0x00000a21,
+0x00000000,0x00030047,0x00000a23,0x00000000,
+0x00040047,0x00000a8b,0x0000000b,0x00000028,
+0x00030047,0x00000a8d,0x00000000,0x00040047,
+0x00000a8d,0x0000000b,0x00000024,0x00030047,
+0x00000a8e,0x00000000,0x00030047,0x00000a90,
+0x00000000,0x00040047,0x00000a9a,0x0000000b,
+0x0000001a,0x00040047,0x00000b06,0x00000022,
+0x00000000,0x00040047,0x00000b06,0x00000021,
+0x00000001,0x00030047,0x00000b06,0x00000019,
+0x00040047,0x00000b14,0x0000000b,0x00000019,
+0x00020013,0x00000002,0x00030021,0x00000003,
+0x00000002,0x00040015,0x00000006,0x00000020,
+0x00000000,0x00040020,0x00000007,0x00000007,
+0x00000006,0x00040017,0x00000008,0x00000006,
+0x00000003,0x00040020,0x00000009,0x00000007,
+0x00000008,0x00050021,0x0000000a,0x00000006,
+0x00000007,0x00000009,0x00040017,0x0000000f,
+0x00000006,0x00000004,0x00040020,0x00000010,
+0x00000007,0x0000000f,0x00040017,0x00000011,
+0x00000006,0x00000002,0x00040020,0x00000012,
+0x00000007,0x00000011,0x00050021,0x00000013,
+0x00000002,0x00000010,0x00000012,0x00060021,
+0x00000018,0x00000006,0x00000010,0x00000007,
+0x00000007,0x00070021,0x0000001e,0x00000006,
+0x00000007,0x00000007,0x00000007,0x00000007,
+0x00070021,0x00000025,0x00000006,0x00000010,
+0x00000007,0x00000007,0x00000007,0x00070021,
+0x00000032,0x00000006,0x00000010,0x00000009,
+0x00000007,0x00000007,0x000b0021,0x00000039,
+0x00000006,0x00000010,0x00000009,0x00000007,
+0x00000007,0x00000007,0x00000007,0x00000007,
+0x00000012,0x00050021,0x00000044,0x00000011,
+0x00000010,0x00000011,0x00040021,0x00000049,
+0x00000006,0x00000007,0x00060021,0x0000004d,
+0x00000006,0x00000007,0x00000012,0x00000007,
+0x00060021,0x00000053,0x00000008,0x00000007,
+0x00000007,0x00000007,0x00040015,0x00000059,
+0x00000020,0x00000001,0x00040017,0x0000005a,
+0x00000059,0x00000004,0x00040020,0x0000005b,
+0x00000007,0x0000005a,0x00040021,0x0000005c,
+0x0000005a,0x0000005b,0x00040017,0x00000060,
+0x00000059,0x00000003,0x00040020,0x00000061,
+0x00000007,0x00000060,0x00040021,0x00000062,
+0x00000059,0x00000061,0x00050021,0x00000066,
+0x00000002,0x0000005b,0x0000005b,0x00080021,
+0x0000006b,0x00000002,0x0000005b,0x0000005b,
+0x00000007,0x00000010,0x00000010,0x00070021,
+0x00000073,0x00000006,0x00000010,0x00000007,
+0x00000007,0x00000009,0x00040021,0x0000007a,
+0x0000000f,0x00000007,0x00040021,0x0000007e,
+0x0000000f,0x00000011,0x00040021,0x00000082,
+0x00000060,0x00000061,0x00050021,0x00000086,
+0x0000000f,0x00000012,0x00000007,0x00030016,
+0x0000008b,0x00000020,0x00040017,0x0000008c,
+0x0000008b,0x00000003,0x00040020,0x0000008d,
+0x00000007,0x0000008c,0x00060021,0x0000008e,
+0x00000006,0x0000008d,0x0000008d,0x0000008d,
+0x00060021,0x00000094,0x00000006,0x00000007,
+0x00000007,0x00000007,0x00060021,0x0000009a,
+0x00000002,0x00000009,0x00000009,0x00000009,
+0x00050021,0x000000a0,0x00000011,0x00000007,
+0x00000007,0x00040021,0x000000a5,0x00000006,
+0x00000009,0x0004002b,0x00000006,0x000000af,
+0x00000008,0x0004002b,0x00000006,0x000000b0,
+0x00000007,0x0005002c,0x00000011,0x000000b1,
+0x000000af,0x000000b0,0x0004002b,0x00000006,
+0x000000b3,0x00000004,0x0004002b,0x00000006,
+0x000000b4,0x00000002,0x0005002c,0x00000011,
+0x000000b5,0x000000b3,0x000000b4,0x0004002b,
+0x00000006,0x000000b7,0x00000005,0x0004002b,
+0x00000006,0x000000b8,0x00000003,0x0005002c,
+0x00000011,0x000000b9,0x000000b7,0x000000b8,
+0x0004002b,0x00000006,0x000000bf,0x00000000,
+0x0004002b,0x00000006,0x000000c2,0x00000001,
+0x00040020,0x000000c9,0x00000006,0x0000000f,
+0x0004003b,0x000000c9,0x000000ca,0x00000006,
+0x00040020,0x000000cc,0x00000006,0x00000011,
+0x0004003b,0x000000cc,0x000000cd,0x00000006,
+0x00020014,0x000000cf,0x00040020,0x000000d0,
+0x00000006,0x000000cf,0x0004003b,0x000000d0,
+0x000000d1,0x00000006,0x0003002a,0x000000cf,
+0x000000d2,0x0004003b,0x000000d0,0x000000d3,
+0x00000006,0x00040020,0x000000d4,0x00000006,
+0x00000006,0x0004002b,0x00000006,0x000000d7,
+0x000001ff,0x0004002b,0x00000006,0x000000d9,
+0x000001fc,0x0004002b,0x00000059,0x000000e2,
+0x00000000,0x0004002b,0x00000059,0x000000e3,
+0x00000002,0x0004002b,0x00000059,0x000000ec,
+0x00000004,0x0004002b,0x00000059,0x000000ed,
+0x00000001,0x0004002b,0x00000059,0x000000f2,
+0x00000005,0x0004002b,0x00000059,0x000000f7,
+0x00000007,0x0004002b,0x00000059,0x000000fc,
+0x00000009,0x0004003b,0x000000d0,0x000000fe,
+0x00000006,0x0004002b,0x00000059,0x00000101,
+0x0000000a,0x0004003b,0x000000cc,0x00000113,
+0x00000006,0x0004002b,0x00000006,0x00000114,
+0x0000000c,0x0004002b,0x00000006,0x0000011e,
+0x00000006,0x0004002b,0x00000006,0x0000012a,
+0x0000000a,0x0005002c,0x00000011,0x0000012b,
+0x0000011e,0x0000012a,0x0005002c,0x00000011,
+0x00000131,0x0000012a,0x0000011e,0x00030029,
+0x000000cf,0x00000133,0x00040017,0x00000168,
+0x000000cf,0x00000002,0x00040020,0x0000016e,
+0x00000006,0x00000008,0x0004003b,0x0000016e,
+0x0000016f,0x00000006,0x0004002b,0x00000006,
+0x00000170,0x00000010,0x0004001c,0x00000171,
+0x00000008,0x00000170,0x0006002c,0x00000008,
+0x00000172,0x000000bf,0x000000bf,0x000000bf,
+0x0006002c,0x00000008,0x00000173,0x000000bf,
+0x000000bf,0x000000c2,0x0006002c,0x00000008,
+0x00000174,0x000000c2,0x000000bf,0x000000bf,
+0x0006002c,0x00000008,0x00000175,0x000000bf,
+0x000000bf,0x000000b4,0x0006002c,0x00000008,
+0x00000176,0x000000bf,0x000000c2,0x000000bf,
+0x0006002c,0x00000008,0x00000177,0x000000c2,
+0x000000bf,0x000000c2,0x0006002c,0x00000008,
+0x00000178,0x000000bf,0x000000bf,0x000000b8,
+0x0006002c,0x00000008,0x00000179,0x000000bf,
+0x000000c2,0x000000c2,0x0006002c,0x00000008,
+0x0000017a,0x000000c2,0x000000bf,0x000000b4,
+0x0006002c,0x00000008,0x0000017b,0x000000bf,
+0x000000bf,0x000000b3,0x0006002c,0x00000008,
+0x0000017c,0x000000bf,0x000000c2,0x000000b4,
+0x0006002c,0x00000008,0x0000017d,0x000000c2,
+0x000000bf,0x000000b8,0x0006002c,0x00000008,
+0x0000017e,0x000000bf,0x000000bf,0x000000b7,
+0x0013002c,0x00000171,0x0000017f,0x00000172,
+0x00000172,0x00000173,0x00000174,0x00000175,
+0x00000176,0x00000177,0x00000178,0x00000172,
+0x00000172,0x00000179,0x0000017a,0x0000017b,
+0x0000017c,0x0000017d,0x0000017e,0x0004002b,
+0x00000059,0x00000181,0x00000003,0x00040020,
+0x00000185,0x00000007,0x00000171,0x0004003b,
+0x000000d4,0x00000189,0x00000006,0x0004003b,
+0x000000d4,0x00000192,0x00000006,0x0004002b,
+0x00000006,0x00000199,0x00000018,0x0004002b,
+0x00000006,0x0000019c,0x00000060,0x0004002b,
+0x00000006,0x000001a0,0x00000040,0x0004003b,
+0x000000d4,0x000001a6,0x00000006,0x0004002b,
+0x00000059,0x000001a9,0x0000000b,0x0004003b,
+0x000000d4,0x000001b0,0x00000006,0x0004002b,
+0x00000059,0x000001b3,0x0000000d,0x0004002b,
+0x00000006,0x000001c3,0x00000020,0x0004002b,
+0x00000006,0x000001cf,0x0000001f,0x0004002b,
+0x00000006,0x00000200,0x00000080,0x0004002b,
+0x00000059,0x00000211,0x00000017,0x0004002b,
+0x00000059,0x00000216,0x00000019,0x00040020,
+0x0000026f,0x00000007,0x00000059,0x0007002c,
+0x0000005a,0x000002b3,0x000000e3,0x000000ec,
+0x000000f2,0x000000f7,0x0004002b,0x00000006,
+0x000002ba,0x00000100,0x0004001c,0x000002bb,
+0x00000006,0x000002ba,0x0004002b,0x00000006,
+0x000002bc,0x00000021,0x0004002b,0x00000006,
+0x000002bd,0x00000009,0x0004002b,0x00000006,
+0x000002be,0x00000022,0x0004002b,0x00000006,
+0x000002bf,0x00000028,0x0004002b,0x00000006,
+0x000002c0,0x00000029,0x0004002b,0x00000006,
+0x000002c1,0x0000002a,0x0004002b,0x00000006,
+0x000002c2,0x00000011,0x0004002b,0x00000006,
+0x000002c3,0x00000012,0x0004002b,0x00000006,
+0x000002c4,0x00000024,0x0004002b,0x00000006,
+0x000002c5,0x00000014,0x0004002b,0x00000006,
+0x000002c6,0x00000015,0x0004002b,0x00000006,
+0x000002c7,0x00000016,0x0004002b,0x00000006,
+0x000002c8,0x00000025,0x0004002b,0x00000006,
+0x000002c9,0x00000019,0x0004002b,0x00000006,
+0x000002ca,0x0000001a,0x0004002b,0x00000006,
+0x000002cb,0x00000026,0x0004002b,0x00000006,
+0x000002cc,0x00000280,0x0004002b,0x00000006,
+0x000002cd,0x00000281,0x0004002b,0x00000006,
+0x000002ce,0x00000282,0x0004002b,0x00000006,
+0x000002cf,0x000002a0,0x0004002b,0x00000006,
+0x000002d0,0x00000041,0x0004002b,0x00000006,
+0x000002d1,0x00000042,0x0004002b,0x00000006,
+0x000002d2,0x00000044,0x0004002b,0x00000006,
+0x000002d3,0x00000045,0x0004002b,0x00000006,
+0x000002d4,0x00000046,0x0004002b,0x00000006,
+0x000002d5,0x00000061,0x0004002b,0x00000006,
+0x000002d6,0x00000048,0x0004002b,0x00000006,
+0x000002d7,0x00000049,0x0004002b,0x00000006,
+0x000002d8,0x0000004a,0x0004002b,0x00000006,
+0x000002d9,0x00000062,0x0004002b,0x00000006,
+0x000002da,0x00000068,0x0004002b,0x00000006,
+0x000002db,0x00000069,0x0004002b,0x00000006,
+0x000002dc,0x0000006a,0x0004002b,0x00000006,
+0x000002dd,0x00000050,0x0004002b,0x00000006,
+0x000002de,0x00000051,0x0004002b,0x00000006,
+0x000002df,0x00000052,0x0004002b,0x00000006,
+0x000002e0,0x00000064,0x0004002b,0x00000006,
+0x000002e1,0x00000054,0x0004002b,0x00000006,
+0x000002e2,0x00000055,0x0004002b,0x00000006,
+0x000002e3,0x00000056,0x0004002b,0x00000006,
+0x000002e4,0x00000065,0x0004002b,0x00000006,
+0x000002e5,0x00000058,0x0004002b,0x00000006,
+0x000002e6,0x00000059,0x0004002b,0x00000006,
+0x000002e7,0x0000005a,0x0004002b,0x00000006,
+0x000002e8,0x00000066,0x0004002b,0x00000006,
+0x000002e9,0x00000284,0x0004002b,0x00000006,
+0x000002ea,0x00000285,0x0004002b,0x00000006,
+0x000002eb,0x00000286,0x0004002b,0x00000006,
+0x000002ec,0x000002a1,0x0004002b,0x00000006,
+0x000002ed,0x00000081,0x0004002b,0x00000006,
+0x000002ee,0x00000082,0x0004002b,0x00000006,
+0x000002ef,0x000000a0,0x0004002b,0x00000006,
+0x000002f0,0x00000084,0x0004002b,0x00000006,
+0x000002f1,0x00000085,0x0004002b,0x00000006,
+0x000002f2,0x00000086,0x0004002b,0x00000006,
+0x000002f3,0x000000a1,0x0004002b,0x00000006,
+0x000002f4,0x00000088,0x0004002b,0x00000006,
+0x000002f5,0x00000089,0x0004002b,0x00000006,
+0x000002f6,0x0000008a,0x0004002b,0x00000006,
+0x000002f7,0x000000a2,0x0004002b,0x00000006,
+0x000002f8,0x000000a8,0x0004002b,0x00000006,
+0x000002f9,0x000000a9,0x0004002b,0x00000006,
+0x000002fa,0x000000aa,0x0004002b,0x00000006,
+0x000002fb,0x00000090,0x0004002b,0x00000006,
+0x000002fc,0x00000091,0x0004002b,0x00000006,
+0x000002fd,0x00000092,0x0004002b,0x00000006,
+0x000002fe,0x000000a4,0x0004002b,0x00000006,
+0x000002ff,0x00000094,0x0004002b,0x00000006,
+0x00000300,0x00000095,0x0004002b,0x00000006,
+0x00000301,0x00000096,0x0004002b,0x00000006,
+0x00000302,0x000000a5,0x0004002b,0x00000006,
+0x00000303,0x00000098,0x0004002b,0x00000006,
+0x00000304,0x00000099,0x0004002b,0x00000006,
+0x00000305,0x0000009a,0x0004002b,0x00000006,
+0x00000306,0x000000a6,0x0004002b,0x00000006,
+0x00000307,0x00000288,0x0004002b,0x00000006,
+0x00000308,0x00000289,0x0004002b,0x00000006,
+0x00000309,0x0000028a,0x0004002b,0x00000006,
+0x0000030a,0x000002a2,0x0004002b,0x00000006,
+0x0000030b,0x00000200,0x0004002b,0x00000006,
+0x0000030c,0x00000201,0x0004002b,0x00000006,
+0x0000030d,0x00000202,0x0004002b,0x00000006,
+0x0000030e,0x00000220,0x0004002b,0x00000006,
+0x0000030f,0x00000204,0x0004002b,0x00000006,
+0x00000310,0x00000205,0x0004002b,0x00000006,
+0x00000311,0x00000206,0x0004002b,0x00000006,
+0x00000312,0x00000221,0x0004002b,0x00000006,
+0x00000313,0x00000208,0x0004002b,0x00000006,
+0x00000314,0x00000209,0x0004002b,0x00000006,
+0x00000315,0x0000020a,0x0004002b,0x00000006,
+0x00000316,0x00000222,0x0004002b,0x00000006,
+0x00000317,0x00000228,0x0004002b,0x00000006,
+0x00000318,0x00000229,0x0004002b,0x00000006,
+0x00000319,0x0000022a,0x0004002b,0x00000006,
+0x0000031a,0x00000210,0x0004002b,0x00000006,
+0x0000031b,0x00000211,0x0004002b,0x00000006,
+0x0000031c,0x00000212,0x0004002b,0x00000006,
+0x0000031d,0x00000224,0x0004002b,0x00000006,
+0x0000031e,0x00000214,0x0004002b,0x00000006,
+0x0000031f,0x00000215,0x0004002b,0x00000006,
+0x00000320,0x00000216,0x0004002b,0x00000006,
+0x00000321,0x00000225,0x0004002b,0x00000006,
+0x00000322,0x00000218,0x0004002b,0x00000006,
+0x00000323,0x00000219,0x0004002b,0x00000006,
+0x00000324,0x0000021a,0x0004002b,0x00000006,
+0x00000325,0x00000226,0x0004002b,0x00000006,
+0x00000326,0x000002a8,0x0004002b,0x00000006,
+0x00000327,0x000002a9,0x0004002b,0x00000006,
+0x00000328,0x000002aa,0x0004002b,0x00000006,
+0x00000329,0x00000101,0x0004002b,0x00000006,
+0x0000032a,0x00000102,0x0004002b,0x00000006,
+0x0000032b,0x00000120,0x0004002b,0x00000006,
+0x0000032c,0x00000104,0x0004002b,0x00000006,
+0x0000032d,0x00000105,0x0004002b,0x00000006,
+0x0000032e,0x00000106,0x0004002b,0x00000006,
+0x0000032f,0x00000121,0x0004002b,0x00000006,
+0x00000330,0x00000108,0x0004002b,0x00000006,
+0x00000331,0x00000109,0x0004002b,0x00000006,
+0x00000332,0x0000010a,0x0004002b,0x00000006,
+0x00000333,0x00000122,0x0004002b,0x00000006,
+0x00000334,0x00000128,0x0004002b,0x00000006,
+0x00000335,0x00000129,0x0004002b,0x00000006,
+0x00000336,0x0000012a,0x0004002b,0x00000006,
+0x00000337,0x00000110,0x0004002b,0x00000006,
+0x00000338,0x00000111,0x0004002b,0x00000006,
+0x00000339,0x00000112,0x0004002b,0x00000006,
+0x0000033a,0x00000124,0x0004002b,0x00000006,
+0x0000033b,0x00000114,0x0004002b,0x00000006,
+0x0000033c,0x00000115,0x0004002b,0x00000006,
+0x0000033d,0x00000116,0x0004002b,0x00000006,
+0x0000033e,0x00000125,0x0004002b,0x00000006,
+0x0000033f,0x00000118,0x0004002b,0x00000006,
+0x00000340,0x00000119,0x0004002b,0x00000006,
+0x00000341,0x0000011a,0x0004002b,0x00000006,
+0x00000342,0x00000126,0x0004002b,0x00000006,
+0x00000343,0x00000290,0x0004002b,0x00000006,
+0x00000344,0x00000291,0x0004002b,0x00000006,
+0x00000345,0x00000292,0x0004002b,0x00000006,
+0x00000346,0x000002a4,0x0004002b,0x00000006,
+0x00000347,0x00000140,0x0004002b,0x00000006,
+0x00000348,0x00000141,0x0004002b,0x00000006,
+0x00000349,0x00000142,0x0004002b,0x00000006,
+0x0000034a,0x00000160,0x0004002b,0x00000006,
+0x0000034b,0x00000144,0x0004002b,0x00000006,
+0x0000034c,0x00000145,0x0004002b,0x00000006,
+0x0000034d,0x00000146,0x0004002b,0x00000006,
+0x0000034e,0x00000161,0x0004002b,0x00000006,
+0x0000034f,0x00000148,0x0004002b,0x00000006,
+0x00000350,0x00000149,0x0004002b,0x00000006,
+0x00000351,0x0000014a,0x0004002b,0x00000006,
+0x00000352,0x00000162,0x0004002b,0x00000006,
+0x00000353,0x00000168,0x0004002b,0x00000006,
+0x00000354,0x00000169,0x0004002b,0x00000006,
+0x00000355,0x0000016a,0x0004002b,0x00000006,
+0x00000356,0x00000150,0x0004002b,0x00000006,
+0x00000357,0x00000151,0x0004002b,0x00000006,
+0x00000358,0x00000152,0x0004002b,0x00000006,
+0x00000359,0x00000164,0x0004002b,0x00000006,
+0x0000035a,0x00000154,0x0004002b,0x00000006,
+0x0000035b,0x00000155,0x0004002b,0x00000006,
+0x0000035c,0x00000156,0x0004002b,0x00000006,
+0x0000035d,0x00000165,0x0004002b,0x00000006,
+0x0000035e,0x00000158,0x0004002b,0x00000006,
+0x0000035f,0x00000159,0x0004002b,0x00000006,
+0x00000360,0x0000015a,0x0004002b,0x00000006,
+0x00000361,0x00000166,0x0004002b,0x00000006,
+0x00000362,0x00000294,0x0004002b,0x00000006,
+0x00000363,0x00000295,0x0004002b,0x00000006,
+0x00000364,0x00000296,0x0004002b,0x00000006,
+0x00000365,0x000002a5,0x0004002b,0x00000006,
+0x00000366,0x00000180,0x0004002b,0x00000006,
+0x00000367,0x00000181,0x0004002b,0x00000006,
+0x00000368,0x00000182,0x0004002b,0x00000006,
+0x00000369,0x000001a0,0x0004002b,0x00000006,
+0x0000036a,0x00000184,0x0004002b,0x00000006,
+0x0000036b,0x00000185,0x0004002b,0x00000006,
+0x0000036c,0x00000186,0x0004002b,0x00000006,
+0x0000036d,0x000001a1,0x0004002b,0x00000006,
+0x0000036e,0x00000188,0x0004002b,0x00000006,
+0x0000036f,0x00000189,0x0004002b,0x00000006,
+0x00000370,0x0000018a,0x0004002b,0x00000006,
+0x00000371,0x000001a2,0x0004002b,0x00000006,
+0x00000372,0x000001a8,0x0004002b,0x00000006,
+0x00000373,0x000001a9,0x0004002b,0x00000006,
+0x00000374,0x000001aa,0x0004002b,0x00000006,
+0x00000375,0x00000190,0x0004002b,0x00000006,
+0x00000376,0x00000191,0x0004002b,0x00000006,
+0x00000377,0x00000192,0x0004002b,0x00000006,
+0x00000378,0x000001a4,0x0004002b,0x00000006,
+0x00000379,0x00000194,0x0004002b,0x00000006,
+0x0000037a,0x00000195,0x0004002b,0x00000006,
+0x0000037b,0x00000196,0x0004002b,0x00000006,
+0x0000037c,0x000001a5,0x0004002b,0x00000006,
+0x0000037d,0x00000198,0x0004002b,0x00000006,
+0x0000037e,0x00000199,0x0004002b,0x00000006,
+0x0000037f,0x0000019a,0x0004002b,0x00000006,
+0x00000380,0x000001a6,0x0004002b,0x00000006,
+0x00000381,0x00000298,0x0004002b,0x00000006,
+0x00000382,0x00000299,0x0004002b,0x00000006,
+0x00000383,0x0000029a,0x0004002b,0x00000006,
+0x00000384,0x000002a6,0x0004002b,0x00000006,
+0x00000385,0x00000240,0x0004002b,0x00000006,
+0x00000386,0x00000241,0x0004002b,0x00000006,
+0x00000387,0x00000242,0x0004002b,0x00000006,
+0x00000388,0x00000260,0x0004002b,0x00000006,
+0x00000389,0x00000244,0x0004002b,0x00000006,
+0x0000038a,0x00000245,0x0004002b,0x00000006,
+0x0000038b,0x00000246,0x0004002b,0x00000006,
+0x0000038c,0x00000261,0x0004002b,0x00000006,
+0x0000038d,0x00000248,0x0004002b,0x00000006,
+0x0000038e,0x00000249,0x0004002b,0x00000006,
+0x0000038f,0x0000024a,0x0004002b,0x00000006,
+0x00000390,0x00000262,0x0004002b,0x00000006,
+0x00000391,0x00000268,0x0004002b,0x00000006,
+0x00000392,0x00000269,0x0004002b,0x00000006,
+0x00000393,0x0000026a,0x0004002b,0x00000006,
+0x00000394,0x00000250,0x0004002b,0x00000006,
+0x00000395,0x00000251,0x0004002b,0x00000006,
+0x00000396,0x00000252,0x0004002b,0x00000006,
+0x00000397,0x00000264,0x0004002b,0x00000006,
+0x00000398,0x00000254,0x0004002b,0x00000006,
+0x00000399,0x00000255,0x0004002b,0x00000006,
+0x0000039a,0x00000256,0x0004002b,0x00000006,
+0x0000039b,0x00000265,0x0004002b,0x00000006,
+0x0000039c,0x00000258,0x0004002b,0x00000006,
+0x0000039d,0x00000259,0x0004002b,0x00000006,
+0x0000039e,0x0000025a,0x0004002b,0x00000006,
+0x0000039f,0x00000266,0x0103002c,0x000002bb,
+0x000003a0,0x000000bf,0x000000c2,0x000000b4,
+0x000001c3,0x000000b3,0x000000b7,0x0000011e,
+0x000002bc,0x000000af,0x000002bd,0x0000012a,
+0x000002be,0x000002bf,0x000002c0,0x000002c1,
+0x000002be,0x00000170,0x000002c2,0x000002c3,
+0x000002c4,0x000002c5,0x000002c6,0x000002c7,
+0x000002c8,0x00000199,0x000002c9,0x000002ca,
+0x000002cb,0x000002cc,0x000002cd,0x000002ce,
+0x000002cf,0x000001a0,0x000002d0,0x000002d1,
+0x0000019c,0x000002d2,0x000002d3,0x000002d4,
+0x000002d5,0x000002d6,0x000002d7,0x000002d8,
+0x000002d9,0x000002da,0x000002db,0x000002dc,
+0x000002d9,0x000002dd,0x000002de,0x000002df,
+0x000002e0,0x000002e1,0x000002e2,0x000002e3,
+0x000002e4,0x000002e5,0x000002e6,0x000002e7,
+0x000002e8,0x000002e9,0x000002ea,0x000002eb,
+0x000002ec,0x00000200,0x000002ed,0x000002ee,
+0x000002ef,0x000002f0,0x000002f1,0x000002f2,
+0x000002f3,0x000002f4,0x000002f5,0x000002f6,
+0x000002f7,0x000002f8,0x000002f9,0x000002fa,
+0x000002f7,0x000002fb,0x000002fc,0x000002fd,
+0x000002fe,0x000002ff,0x00000300,0x00000301,
+0x00000302,0x00000303,0x00000304,0x00000305,
+0x00000306,0x00000307,0x00000308,0x00000309,
+0x0000030a,0x0000030b,0x0000030c,0x0000030d,
+0x0000030e,0x0000030f,0x00000310,0x00000311,
+0x00000312,0x00000313,0x00000314,0x00000315,
+0x00000316,0x00000317,0x00000318,0x00000319,
+0x00000316,0x0000031a,0x0000031b,0x0000031c,
+0x0000031d,0x0000031e,0x0000031f,0x00000320,
+0x00000321,0x00000322,0x00000323,0x00000324,
+0x00000325,0x00000326,0x00000327,0x00000328,
+0x0000030a,0x000002ba,0x00000329,0x0000032a,
+0x0000032b,0x0000032c,0x0000032d,0x0000032e,
+0x0000032f,0x00000330,0x00000331,0x00000332,
+0x00000333,0x00000334,0x00000335,0x00000336,
+0x00000333,0x00000337,0x00000338,0x00000339,
+0x0000033a,0x0000033b,0x0000033c,0x0000033d,
+0x0000033e,0x0000033f,0x00000340,0x00000341,
+0x00000342,0x00000343,0x00000344,0x00000345,
+0x00000346,0x00000347,0x00000348,0x00000349,
+0x0000034a,0x0000034b,0x0000034c,0x0000034d,
+0x0000034e,0x0000034f,0x00000350,0x00000351,
+0x00000352,0x00000353,0x00000354,0x00000355,
+0x00000352,0x00000356,0x00000357,0x00000358,
+0x00000359,0x0000035a,0x0000035b,0x0000035c,
+0x0000035d,0x0000035e,0x0000035f,0x00000360,
+0x00000361,0x00000362,0x00000363,0x00000364,
+0x00000365,0x00000366,0x00000367,0x00000368,
+0x00000369,0x0000036a,0x0000036b,0x0000036c,
+0x0000036d,0x0000036e,0x0000036f,0x00000370,
+0x00000371,0x00000372,0x00000373,0x00000374,
+0x00000371,0x00000375,0x00000376,0x00000377,
+0x00000378,0x00000379,0x0000037a,0x0000037b,
+0x0000037c,0x0000037d,0x0000037e,0x0000037f,
+0x00000380,0x00000381,0x00000382,0x00000383,
+0x00000384,0x00000385,0x00000386,0x00000387,
+0x00000388,0x00000389,0x0000038a,0x0000038b,
+0x0000038c,0x0000038d,0x0000038e,0x0000038f,
+0x00000390,0x00000391,0x00000392,0x00000393,
+0x00000390,0x00000394,0x00000395,0x00000396,
+0x00000397,0x00000398,0x00000399,0x0000039a,
+0x0000039b,0x0000039c,0x0000039d,0x0000039e,
+0x0000039f,0x00000326,0x00000327,0x00000328,
+0x00000384,0x00040020,0x000003a2,0x00000007,
+0x000002bb,0x0006002c,0x00000060,0x000003d6,
+0x000000e2,0x00000181,0x000000f2,0x0004001c,
+0x000003dd,0x00000006,0x00000200,0x0004002b,
+0x00000006,0x000003de,0x0000000b,0x0004002b,
+0x00000006,0x000003df,0x00000013,0x0004002b,
+0x00000006,0x000003e0,0x0000001b,0x0004002b,
+0x00000006,0x000003e1,0x0000001c,0x0004002b,
+0x00000006,0x000003e2,0x00000023,0x0004002b,
+0x00000006,0x000003e3,0x000000e4,0x0004002b,
+0x00000006,0x000003e4,0x00000043,0x0004002b,
+0x00000006,0x000003e5,0x0000004b,0x0004002b,
+0x00000006,0x000003e6,0x0000004c,0x0004002b,
+0x00000006,0x000003e7,0x0000010c,0x0004002b,
+0x00000006,0x000003e8,0x00000053,0x0004002b,
+0x00000006,0x000003e9,0x0000005b,0x0004002b,
+0x00000006,0x000003ea,0x0000005c,0x0004002b,
+0x00000006,0x000003eb,0x00000063,0x0004002b,
+0x00000006,0x000003ec,0x0000011c,0x0004002b,
+0x00000006,0x000003ed,0x00000123,0x0004002b,
+0x00000006,0x000003ee,0x00000083,0x0004002b,
+0x00000006,0x000003ef,0x00000103,0x0004002b,
+0x00000006,0x000003f0,0x0000008b,0x0004002b,
+0x00000006,0x000003f1,0x0000008c,0x0004002b,
+0x00000006,0x000003f2,0x0000010b,0x0004002b,
+0x00000006,0x000003f3,0x00000093,0x0004002b,
+0x00000006,0x000003f4,0x00000113,0x0004002b,
+0x00000006,0x000003f5,0x0000009b,0x0004002b,
+0x00000006,0x000003f6,0x0000009c,0x0004002b,
+0x00000006,0x000003f7,0x000000a3,0x0004002b,
+0x00000006,0x000003f8,0x0000011b,0x0004002b,
+0x00000006,0x000003f9,0x000000c0,0x0004002b,
+0x00000006,0x000003fa,0x000000c1,0x0004002b,
+0x00000006,0x000003fb,0x000000c2,0x0004002b,
+0x00000006,0x000003fc,0x000000c3,0x0004002b,
+0x00000006,0x000003fd,0x000000c4,0x0004002b,
+0x00000006,0x000003fe,0x000000e0,0x0004002b,
+0x00000006,0x000003ff,0x000000c8,0x0004002b,
+0x00000006,0x00000400,0x000000c9,0x0004002b,
+0x00000006,0x00000401,0x000000ca,0x0004002b,
+0x00000006,0x00000402,0x000000cb,0x0004002b,
+0x00000006,0x00000403,0x000000cc,0x0004002b,
+0x00000006,0x00000404,0x000000e1,0x0004002b,
+0x00000006,0x00000405,0x000000d0,0x0004002b,
+0x00000006,0x00000406,0x000000d1,0x0004002b,
+0x00000006,0x00000407,0x000000d2,0x0004002b,
+0x00000006,0x00000408,0x000000d3,0x0004002b,
+0x00000006,0x00000409,0x000000d4,0x0004002b,
+0x00000006,0x0000040a,0x000000e2,0x0004002b,
+0x00000006,0x0000040b,0x000000d8,0x0004002b,
+0x00000006,0x0000040c,0x000000d9,0x0004002b,
+0x00000006,0x0000040d,0x000000da,0x0004002b,
+0x00000006,0x0000040e,0x000000db,0x0004002b,
+0x00000006,0x0000040f,0x000000dc,0x0004002b,
+0x00000006,0x00000410,0x000000e3,0x0083002c,
+0x000003dd,0x00000411,0x000000bf,0x000000c2,
+0x000000b4,0x000000b8,0x000000b3,0x000001c3,
+0x000002c4,0x0000033a,0x000000af,0x000002bd,
+0x0000012a,0x000003de,0x00000114,0x000002bc,
+0x000002e0,0x0000033a,0x00000170,0x000002c2,
+0x000002c3,0x000003df,0x000002c5,0x000002be,
+0x000002fe,0x0000033a,0x00000199,0x000002c9,
+0x000002ca,0x000003e0,0x000003e1,0x000003e2,
+0x000003e3,0x0000033a,0x000001a0,0x000002d0,
+0x000002d1,0x000003e4,0x000002d2,0x0000019c,
+0x0000032c,0x0000032b,0x000002d6,0x000002d7,
+0x000002d8,0x000003e5,0x000003e6,0x000002d5,
+0x000003e7,0x0000032f,0x000002dd,0x000002de,
+0x000002df,0x000003e8,0x000002e1,0x000002d9,
+0x0000033b,0x00000333,0x000002e5,0x000002e6,
+0x000002e7,0x000003e9,0x000003ea,0x000003eb,
+0x000003ec,0x000003ed,0x00000200,0x000002ed,
+0x000002ee,0x000003ee,0x000002f0,0x000002ef,
+0x0000032a,0x000003ef,0x000002f4,0x000002f5,
+0x000002f6,0x000003f0,0x000003f1,0x000002f3,
+0x00000332,0x000003f2,0x000002fb,0x000002fc,
+0x000002fd,0x000003f3,0x000002ff,0x000002f7,
+0x00000339,0x000003f4,0x00000303,0x00000304,
+0x00000305,0x000003f5,0x000003f6,0x000003f7,
+0x00000341,0x000003f8,0x000003f9,0x000003fa,
+0x000003fb,0x000003fc,0x000003fd,0x000003fe,
+0x000002ba,0x00000329,0x000003ff,0x00000400,
+0x00000401,0x00000402,0x00000403,0x00000404,
+0x00000330,0x00000331,0x00000405,0x00000406,
+0x00000407,0x00000408,0x00000409,0x0000040a,
+0x00000337,0x00000338,0x0000040b,0x0000040c,
+0x0000040d,0x0000040e,0x0000040f,0x00000410,
+0x0000033f,0x00000340,0x00040020,0x00000413,
+0x00000007,0x000003dd,0x0004002b,0x00000006,
+0x00000442,0x0000002d,0x0004001c,0x00000443,
+0x00000006,0x00000442,0x0004002b,0x00000006,
+0x00000444,0x00000034,0x0004002b,0x00000006,
+0x00000445,0x00000027,0x0004002b,0x00000006,
+0x00000446,0x0000002f,0x0004002b,0x00000006,
+0x00000447,0x0000003b,0x0004002b,0x00000006,
+0x00000448,0x00000017,0x0004002b,0x00000006,
+0x00000449,0x00000035,0x0004002b,0x00000006,
+0x0000044a,0x00000038,0x0004002b,0x00000006,
+0x0000044b,0x00000030,0x0004002b,0x00000006,
+0x0000044c,0x0000003e,0x0004002b,0x00000006,
+0x0000044d,0x0000000d,0x0004002b,0x00000006,
+0x0000044e,0x00000033,0x0004002b,0x00000006,
+0x0000044f,0x0000001e,0x0030002c,0x00000443,
+0x00000450,0x000000bf,0x000001c3,0x000001a0,
+0x000000bf,0x000001a0,0x00000114,0x00000444,
+0x000002c9,0x00000445,0x000000bf,0x000001a0,
+0x000002c2,0x00000446,0x000000b7,0x00000447,
+0x00000448,0x000002c0,0x000003de,0x00000449,
+0x000003e1,0x000002c4,0x000000bf,0x000001a0,
+0x000000af,0x0000044a,0x00000170,0x0000044b,
+0x00000199,0x000002bf,0x000000b4,0x0000044c,
+0x000003de,0x00000449,0x000003df,0x00000442,
+0x000003e0,0x000002c8,0x000000b7,0x00000447,
+0x0000044d,0x0000044e,0x000002c7,0x000002c1,
+0x0000044f,0x000002be,0x00040020,0x00000458,
+0x00000007,0x00000443,0x0004001c,0x00000475,
+0x00000006,0x000003e2,0x0004002b,0x00000006,
+0x00000476,0x00000039,0x0004002b,0x00000006,
+0x00000477,0x0000000e,0x0004002b,0x00000006,
+0x00000478,0x00000032,0x0004002b,0x00000006,
+0x00000479,0x0000002b,0x0004002b,0x00000006,
+0x0000047a,0x0000003d,0x0004002b,0x00000006,
+0x0000047b,0x0000003a,0x0004002b,0x00000006,
+0x0000047c,0x00000037,0x0004002b,0x00000006,
+0x0000047d,0x0000001d,0x0026002c,0x00000475,
+0x0000047e,0x000000bf,0x00000170,0x000001c3,
+0x0000044b,0x000001a0,0x000000bf,0x000001a0,
+0x000000b0,0x00000476,0x00000477,0x00000478,
+0x000002c6,0x00000479,0x000003e1,0x000002c4,
+0x000000bf,0x000001a0,0x00000170,0x0000044b,
+0x000000b8,0x0000047a,0x000003df,0x00000442,
+0x0000011e,0x0000047b,0x00000448,0x000002c0,
+0x000002bd,0x0000047c,0x000002ca,0x000002cb,
+0x0000044d,0x0000044e,0x0000047d,0x000003e2,
+0x00040020,0x00000486,0x00000007,0x00000475,
+0x0004001c,0x00000499,0x00000011,0x0000011e,
+0x0004002b,0x00000006,0x0000049a,0x0000003f,
+0x0005002c,0x00000011,0x0000049b,0x0000049a,
+0x000000af,0x0005002c,0x00000011,0x0000049c,
+0x000002c6,0x000000af,0x0005002c,0x00000011,
+0x0000049d,0x000002bd,0x000000af,0x0005002c,
+0x00000011,0x0000049e,0x000000b4,0x000000b3,
+0x0005002c,0x00000011,0x0000049f,0x000000c2,
+0x000000af,0x0009002c,0x00000499,0x000004a0,
+0x0000049b,0x0000049c,0x0000049d,0x000000b5,
+0x0000049e,0x0000049f,0x00040020,0x000004a3,
+0x00000007,0x00000499,0x00040017,0x0000050d,
+0x0000008b,0x00000004,0x0004002b,0x0000008b,
+0x00000512,0x41000000,0x0004002b,0x00000006,
+0x00000519,0x00000400,0x0004002b,0x00000059,
+0x0000052e,0x00000006,0x00040017,0x0000052f,
+0x00000059,0x00000002,0x0004002b,0x00000006,
+0x00000538,0x0000000f,0x0005002c,0x00000011,
+0x00000547,0x000000bf,0x000000bf,0x0004002b,
+0x00000059,0x00000573,0x0000000f,0x0004002b,
+0x00000059,0x00000578,0x00000011,0x0004002b,
+0x00000059,0x00000589,0x00000010,0x0004002b,
+0x00000059,0x000005bf,0x00000008,0x0004002b,
+0x00000059,0x000005c2,0x0000000c,0x0004002b,
+0x00000059,0x000005c9,0x00000014,0x0004002b,
+0x00000059,0x000005cc,0x00000018,0x0004002b,
+0x00000059,0x000005cf,0x0000001c,0x00040017,
+0x000005f9,0x0000008b,0x00000002,0x0007002c,
+0x0000000f,0x00000617,0x00000477,0x0000012a,
+0x0000011e,0x000000b4,0x0007002c,0x0000000f,
+0x0000061a,0x0000049a,0x0000049a,0x0000049a,
+0x0000049a,0x00040017,0x00000630,0x000000cf,
+0x00000003,0x0004001c,0x00000656,0x00000008,
+0x000003df,0x0006002c,0x00000008,0x00000657,
+0x000000bf,0x000000bf,0x000000af,0x0006002c,
+0x00000008,0x00000658,0x000000c2,0x000000bf,
+0x0000011e,0x0006002c,0x00000008,0x00000659,
+0x000000bf,0x000000c2,0x000000b7,0x0006002c,
+0x00000008,0x0000065a,0x000000bf,0x000000bf,
+0x000000b0,0x0006002c,0x00000008,0x0000065b,
+0x000000c2,0x000000bf,0x000000b7,0x0006002c,
+0x00000008,0x0000065c,0x000000bf,0x000000c2,
+0x000000b3,0x0006002c,0x00000008,0x0000065d,
+0x000000bf,0x000000bf,0x0000011e,0x0006002c,
+0x00000008,0x0000065e,0x000000c2,0x000000bf,
+0x000000b3,0x0006002c,0x00000008,0x0000065f,
+0x000000bf,0x000000c2,0x000000b8,0x0016002c,
+0x00000656,0x00000660,0x00000657,0x00000658,
+0x00000659,0x0000065a,0x0000065b,0x0000065c,
+0x0000065d,0x0000065e,0x0000065f,0x0000017e,
+0x0000017d,0x0000017c,0x0000017b,0x0000017a,
+0x00000179,0x00000178,0x00000177,0x00000175,
+0x00000173,0x00040020,0x00000662,0x00000007,
+0x00000656,0x0004002b,0x00000059,0x00000697,
+0x00000080,0x0004002b,0x00000059,0x0000069f,
+0x0000003f,0x0004002b,0x00000006,0x000006b5,
+0x000000ff,0x0004002b,0x00000059,0x000006c8,
+0x000000c0,0x0004002b,0x00000059,0x000006d1,
+0x000000ff,0x0004002b,0x00000059,0x00000752,
+0xffffff80,0x0007002c,0x0000000f,0x00000780,
+0x000000bf,0x000000bf,0x000000bf,0x000000bf,
+0x0004002b,0x00000006,0x0000079e,0x0000017d,
+0x0004001c,0x0000079f,0x00000006,0x0000079e,
+0x0004002b,0x00000006,0x000007a0,0x000000ba,
+0x0004002b,0x00000006,0x000007a1,0x000000e8,
+0x0004002b,0x00000006,0x000007a2,0x0000002e,
+0x0004002b,0x00000006,0x000007a3,0x00000074,
+0x0004002b,0x00000006,0x000007a4,0x000000de,
+0x0004002b,0x00000006,0x000007a5,0x000000bd,
+0x0004002b,0x00000006,0x000007a6,0x000000f4,
+0x0004002b,0x00000006,0x000007a7,0x0000002c,
+0x0004002b,0x00000006,0x000007a8,0x0000004d,
+0x0004002b,0x00000006,0x000007a9,0x000000b2,
+0x0004002b,0x00000006,0x000007aa,0x0000006e,
+0x0004002b,0x00000006,0x000007ab,0x000000e9,
+0x0004002b,0x00000006,0x000007ac,0x000000a7,
+0x0004002b,0x00000006,0x000007ad,0x00000079,
+0x0004002b,0x00000006,0x000007ae,0x000000ef,
+0x0004002b,0x00000006,0x000007af,0x000000df,
+0x0004002b,0x00000006,0x000007b0,0x000000cf,
+0x0004002b,0x00000006,0x000007b1,0x000000be,
+0x0004002b,0x00000006,0x000007b2,0x000000ae,
+0x0004002b,0x00000006,0x000007b3,0x0000009e,
+0x0004002b,0x00000006,0x000007b4,0x00000071,
+0x0004002b,0x00000006,0x000007b5,0x0000008e,
+0x0004002b,0x00000006,0x000007b6,0x000000fa,
+0x0004002b,0x00000006,0x000007b7,0x000000ea,
+0x0004002b,0x00000006,0x000007b8,0x00000036,
+0x0004002b,0x00000006,0x000007b9,0x000000b9,
+0x0004002b,0x00000006,0x000007ba,0x00000067,
+0x0004002b,0x00000006,0x000007bb,0x00000077,
+0x0004002b,0x00000006,0x000007bc,0x000000b3,
+0x0004002b,0x00000006,0x000007bd,0x0000006c,
+0x0004002b,0x00000006,0x000007be,0x0000007c,
+0x0004002b,0x00000006,0x000007bf,0x000000f7,
+0x0004002b,0x00000006,0x000007c0,0x000000e7,
+0x0004002b,0x00000006,0x000007c1,0x000000d7,
+0x0004002b,0x00000006,0x000007c2,0x000000c7,
+0x0004002b,0x00000006,0x000007c3,0x000000bf,
+0x0004002b,0x00000006,0x000007c4,0x000000b7,
+0x0004002b,0x00000006,0x000007c5,0x000000af,
+0x0004002b,0x00000006,0x000007c6,0x0000009f,
+0x0004002b,0x00000006,0x000007c7,0x00000097,
+0x0004002b,0x00000006,0x000007c8,0x00000070,
+0x0004002b,0x00000006,0x000007c9,0x0000008f,
+0x0004002b,0x00000006,0x000007ca,0x00000078,
+0x0004002b,0x00000006,0x000007cb,0x00000087,
+0x0004002b,0x00000006,0x000007cc,0x000000fd,
+0x0004002b,0x00000006,0x000007cd,0x000000f5,
+0x0004002b,0x00000006,0x000007ce,0x000000ed,
+0x0004002b,0x00000006,0x000007cf,0x000000e5,
+0x0004002b,0x00000006,0x000007d0,0x000000bc,
+0x0004002b,0x00000006,0x000007d1,0x000000b4,
+0x0004002b,0x00000006,0x000007d2,0x000000ac,
+0x0004002b,0x00000006,0x000007d3,0x0000006b,
+0x0004002b,0x00000006,0x000007d4,0x00000073,
+0x0004002b,0x00000006,0x000007d5,0x0000007b,
+0x0004002b,0x00000006,0x000007d6,0x000000f2,
+0x0004002b,0x00000006,0x000007d7,0x0000004e,
+0x0004002b,0x00000006,0x000007d8,0x000000b1,
+0x0004002b,0x00000006,0x000007d9,0x0000005e,
+0x0004002b,0x00000006,0x000007da,0x00000076,
+0x0004002b,0x00000006,0x000007db,0x0000007e,
+0x0004002b,0x00000006,0x000007dc,0x000000fb,
+0x0004002b,0x00000006,0x000007dd,0x000000f3,
+0x0004002b,0x00000006,0x000007de,0x000000eb,
+0x0004002b,0x00000006,0x000007df,0x0000003c,
+0x0004002b,0x00000006,0x000007e0,0x000000bb,
+0x0004002b,0x00000006,0x000007e1,0x000000ab,
+0x0004002b,0x00000006,0x000007e2,0x000000fe,
+0x0004002b,0x00000006,0x000007e3,0x000000f6,
+0x0004002b,0x00000006,0x000007e4,0x000000ee,
+0x0004002b,0x00000006,0x000007e5,0x000000e6,
+0x0004002b,0x00000006,0x000007e6,0x000000d6,
+0x0004002b,0x00000006,0x000007e7,0x00000031,
+0x0004002b,0x00000006,0x000007e8,0x000000ce,
+0x0004002b,0x00000006,0x000007e9,0x000000c6,
+0x0004002b,0x00000006,0x000007ea,0x000000b6,
+0x0004002b,0x00000006,0x000007eb,0x0000005d,
+0x0004002b,0x00000006,0x000007ec,0x0000006d,
+0x0004002b,0x00000006,0x000007ed,0x00000075,
+0x0004002b,0x00000006,0x000007ee,0x0000007d,
+0x0004002b,0x00000006,0x000007ef,0x000000f9,
+0x0004002b,0x00000006,0x000007f0,0x000000f1,
+0x0004002b,0x00000006,0x000007f1,0x000000dd,
+0x0004002b,0x00000006,0x000007f2,0x000000d5,
+0x0004002b,0x00000006,0x000007f3,0x000000cd,
+0x0004002b,0x00000006,0x000007f4,0x000000c5,
+0x0004002b,0x00000006,0x000007f5,0x000000b5,
+0x0004002b,0x00000006,0x000007f6,0x000000ad,
+0x0004002b,0x00000006,0x000007f7,0x0000009d,
+0x0004002b,0x00000006,0x000007f8,0x00000072,
+0x0004002b,0x00000006,0x000007f9,0x0000008d,
+0x0004002b,0x00000006,0x000007fa,0x0000007a,
+0x0180002c,0x0000079f,0x000007fb,0x000000bf,
+0x000000bf,0x000000bf,0x000000bf,0x000006b5,
+0x0000044e,0x00000403,0x000002e8,0x00000304,
+0x000000bf,0x000006b5,0x000002d3,0x000007a0,
+0x00000448,0x000007a1,0x000003ea,0x000003f7,
+0x000007a2,0x00000406,0x000007a3,0x000003f0,
+0x000000bf,0x000006b5,0x000002bc,0x000007a4,
+0x000002d1,0x000007a5,0x000003eb,0x000003f6,
+0x000003de,0x000007a6,0x000007a7,0x00000408,
+0x000007a8,0x000007a9,0x000007aa,0x000002fc,
+0x000002c7,0x000007ab,0x0000047c,0x000003ff,
+0x000002e5,0x000007ac,0x000007ad,0x000002f2,
+0x000000bf,0x000006b5,0x00000170,0x000007ae,
+0x000001c3,0x000007af,0x0000044b,0x000007b0,
+0x000002d0,0x000007b1,0x000002de,0x000007b2,
+0x000002d5,0x000007b3,0x000007b4,0x000007b5,
+0x000000b7,0x000007b6,0x000002c6,0x000007b7,
+0x000002cb,0x0000040c,0x000007b8,0x00000400,
+0x000002d4,0x000007b9,0x000002e3,0x000002f9,
+0x000007ba,0x00000303,0x000007bb,0x000002f4,
+0x000003de,0x000007a6,0x000003e0,0x000003e3,
+0x00000479,0x00000409,0x00000447,0x000003fd,
+0x000003e6,0x000007bc,0x000003ea,0x000003f7,
+0x000007bd,0x000003f3,0x000007be,0x000003ee,
+0x000000bf,0x000006b5,0x000000af,0x000007bf,
+0x00000170,0x000007ae,0x00000199,0x000007c0,
+0x000001c3,0x000007af,0x000002bf,0x000007c1,
+0x0000044b,0x000007b0,0x0000044a,0x000007c2,
+0x000001a0,0x000007c3,0x000002d6,0x000007c4,
+0x000002dd,0x000007c5,0x000002e5,0x000007ac,
+0x0000019c,0x000007c6,0x000002da,0x000007c7,
+0x000007c8,0x000007c9,0x000007ca,0x000007cb,
+0x000000b4,0x000007cc,0x0000012a,0x000007cd,
+0x000002c3,0x000007ce,0x000002ca,0x000007cf,
+0x000003e2,0x0000040f,0x00000479,0x00000409,
+0x0000044e,0x00000403,0x00000447,0x000003fd,
+0x000003e4,0x000007d0,0x000003e5,0x000007d1,
+0x000003e8,0x000007d2,0x000003e9,0x000002fe,
+0x000003eb,0x000003f6,0x000007d3,0x000002ff,
+0x000007d4,0x000003f1,0x000007d5,0x000002f0,
+0x000000b7,0x000007b6,0x0000044d,0x000007d6,
+0x000002c6,0x000007b7,0x0000047d,0x0000040a,
+0x000002c8,0x0000040d,0x00000442,0x00000407,
+0x00000449,0x00000401,0x0000047a,0x000003fb,
+0x000002d4,0x000007b9,0x000007d7,0x000007d8,
+0x000002e3,0x000002f9,0x000007d9,0x000002f3,
+0x000002e8,0x00000304,0x000007aa,0x000002fc,
+0x000007da,0x000002f5,0x000007db,0x000002ed,
+0x000000bf,0x000006b5,0x000000b3,0x000007dc,
+0x000000af,0x000007bf,0x00000114,0x000007dd,
+0x00000170,0x000007ae,0x000002c5,0x000007de,
+0x00000199,0x000007c0,0x000003e1,0x00000410,
+0x000001c3,0x000007af,0x000002c4,0x0000040e,
+0x000002bf,0x000007c1,0x000007a7,0x00000408,
+0x0000044b,0x000007b0,0x00000444,0x00000402,
+0x0000044a,0x000007c2,0x000007df,0x000003fc,
+0x000001a0,0x000007c3,0x000002d2,0x000007e0,
+0x000002d6,0x000007c4,0x000003e6,0x000007bc,
+0x000002dd,0x000007c5,0x000002e1,0x000007e1,
+0x000002e5,0x000007ac,0x000003ea,0x000003f7,
+0x0000019c,0x000007c6,0x000002e0,0x000003f5,
+0x000002da,0x000007c7,0x000007bd,0x000003f3,
+0x000007c8,0x000007c9,0x000007a3,0x000003f0,
+0x000007ca,0x000007cb,0x000007be,0x000003ee,
+0x000000c2,0x000007e2,0x000000b7,0x000007b6,
+0x000002bd,0x000007e3,0x0000044d,0x000007d6,
+0x000002c2,0x000007e4,0x000002c6,0x000007b7,
+0x000002c9,0x000007e5,0x0000047d,0x0000040a,
+0x000002bc,0x000007a4,0x000002c8,0x0000040d,
+0x000002c0,0x000007e6,0x00000442,0x00000407,
+0x000007e7,0x000007e8,0x00000449,0x00000401,
+0x00000476,0x000007e9,0x0000047a,0x000003fb,
+0x000002d0,0x000007b1,0x000002d3,0x000007a0,
+0x000002d7,0x000007ea,0x000007a8,0x000007a9,
+0x000002de,0x000007b2,0x000002e2,0x000002fa,
+0x000002e6,0x00000306,0x000007eb,0x000002f7,
+0x000002d5,0x000007b3,0x000002e4,0x00000305,
+0x000002db,0x00000301,0x000007ec,0x000002fd,
+0x000007b4,0x000007b5,0x000007ed,0x000002f6,
+0x000007ad,0x000002f2,0x000007ee,0x000002ee,
+0x000000b4,0x000007cc,0x0000011e,0x000007ef,
+0x0000012a,0x000007cd,0x00000477,0x000007f0,
+0x000002c3,0x000007ce,0x000002c7,0x000007ab,
+0x000002ca,0x000007cf,0x0000044f,0x00000404,
+0x000002be,0x000007f1,0x000002cb,0x0000040c,
+0x000002c1,0x000007f2,0x000007a2,0x00000406,
+0x00000478,0x000007f3,0x000007b8,0x00000400,
+0x0000047b,0x000007f4,0x0000044c,0x000003fa,
+0x000002d1,0x000007a5,0x000002d4,0x000007b9,
+0x000002d8,0x000007f5,0x000007d7,0x000007d8,
+0x000002df,0x000007f6,0x000002e3,0x000002f9,
+0x000002e7,0x00000302,0x000007d9,0x000002f3,
+0x000002d9,0x000007f7,0x000002e8,0x00000304,
+0x000002dc,0x00000300,0x000007aa,0x000002fc,
+0x000007f8,0x000007f9,0x000007da,0x000002f5,
+0x000007fa,0x000002f1,0x000007db,0x000002ed,
+0x00040020,0x00000803,0x00000007,0x0000079f,
+0x0004002b,0x00000006,0x00000822,0x0000013b,
+0x0004001c,0x00000823,0x00000006,0x00000822,
+0x0004002b,0x00000006,0x00000824,0x00000047,
+0x0004002b,0x00000006,0x00000825,0x000000b8,
+0x0004002b,0x00000006,0x00000826,0x000000ec,
+0x0004002b,0x00000006,0x00000827,0x000000fc,
+0x0004002b,0x00000006,0x00000828,0x00000057,
+0x013e002c,0x00000823,0x00000829,0x000000bf,
+0x000000bf,0x000000bf,0x000000bf,0x000000bf,
+0x000000bf,0x000006b5,0x000003e1,0x00000410,
+0x0000044a,0x000007c2,0x000002e1,0x000007e1,
+0x000007b4,0x000007b5,0x000000bf,0x000006b5,
+0x000003e4,0x000007d0,0x0000044d,0x000007d6,
+0x000002dd,0x000007c5,0x000003e0,0x000003e3,
+0x000007d9,0x000002f3,0x000002bf,0x000007c1,
+0x000007d3,0x000002ff,0x000007b8,0x00000400,
+0x000007ad,0x000002f2,0x000000bf,0x000006b5,
+0x000001c3,0x000007af,0x000002d0,0x000007b1,
+0x000002d5,0x000007b3,0x0000011e,0x000007ef,
+0x00000445,0x0000040b,0x00000824,0x00000825,
+0x000002da,0x000007c7,0x0000044d,0x000007d6,
+0x00000442,0x00000407,0x000007d7,0x000007d8,
+0x000007aa,0x000002fc,0x000003df,0x00000826,
+0x00000444,0x00000402,0x000002e1,0x000007e1,
+0x000007ed,0x000002f6,0x000002ca,0x000007cf,
+0x0000047b,0x000007f4,0x000003e9,0x000002fe,
+0x000007d5,0x000002f0,0x000000bf,0x000006b5,
+0x00000170,0x000007ae,0x000001c3,0x000007af,
+0x0000044b,0x000007b0,0x000001a0,0x000007c3,
+0x000002dd,0x000007c5,0x0000019c,0x000007c6,
+0x000007c8,0x000007c9,0x000000b8,0x00000827,
+0x000003df,0x00000826,0x000003e2,0x0000040f,
+0x0000044e,0x00000403,0x000003e4,0x000007d0,
+0x000003e8,0x000007d2,0x000002e0,0x000003f5,
+0x000007a3,0x000003f0,0x0000011e,0x000007ef,
+0x000002c7,0x000007ab,0x000002cb,0x0000040c,
+0x000007b8,0x00000400,0x00000824,0x00000825,
+0x00000828,0x000002f8,0x000007ba,0x00000303,
+0x000007bb,0x000002f4,0x000002bd,0x000007e3,
+0x000002c9,0x000007e5,0x000002c1,0x000007f2,
+0x0000047b,0x000007f4,0x000002d8,0x000007f5,
+0x000002e7,0x00000302,0x000002dc,0x00000300,
+0x000007fa,0x000002f1,0x0000044d,0x000007d6,
+0x0000047d,0x0000040a,0x00000442,0x00000407,
+0x0000047a,0x000003fb,0x000007a8,0x000007a9,
+0x000007eb,0x000002f7,0x000007ec,0x000002fd,
+0x000007ee,0x000002ee,0x000000bf,0x000006b5,
+0x000000af,0x000007bf,0x00000170,0x000007ae,
+0x00000199,0x000007c0,0x000001c3,0x000007af,
+0x000002bf,0x000007c1,0x0000044b,0x000007b0,
+0x0000044a,0x000007c2,0x000001a0,0x000007c3,
+0x000002d6,0x000007c4,0x000002dd,0x000007c5,
+0x000002e5,0x000007ac,0x0000019c,0x000007c6,
+0x000002da,0x000007c7,0x000007c8,0x000007c9,
+0x000007ca,0x000007cb,0x000000c2,0x000007e2,
+0x000002bd,0x000007e3,0x000002c2,0x000007e4,
+0x000002c9,0x000007e5,0x000002bc,0x000007a4,
+0x000002c0,0x000007e6,0x000007e7,0x000007e8,
+0x00000476,0x000007e9,0x000002d0,0x000007b1,
+0x000002d7,0x000007ea,0x000002de,0x000007b2,
+0x000002e6,0x00000306,0x000002d5,0x000007b3,
+0x000002db,0x00000301,0x000007b4,0x000007b5,
+0x000007ad,0x000002f2,0x000000b8,0x00000827,
+0x000003de,0x000007a6,0x000003df,0x00000826,
+0x000003e0,0x000003e3,0x000003e2,0x0000040f,
+0x00000479,0x00000409,0x0000044e,0x00000403,
+0x00000447,0x000003fd,0x000003e4,0x000007d0,
+0x000003e5,0x000007d1,0x000003e8,0x000007d2,
+0x000003e9,0x000002fe,0x000003eb,0x000003f6,
+0x000007d3,0x000002ff,0x000007d4,0x000003f1,
+0x000007d5,0x000002f0,0x000000b3,0x000007dc,
+0x00000114,0x000007dd,0x000002c5,0x000007de,
+0x000003e1,0x00000410,0x000002c4,0x0000040e,
+0x000007a7,0x00000408,0x00000444,0x00000402,
+0x000007df,0x000003fc,0x000002d2,0x000007e0,
+0x000003e6,0x000007bc,0x000002e1,0x000007e1,
+0x000003ea,0x000003f7,0x000002e0,0x000003f5,
+0x000007bd,0x000003f3,0x000007a3,0x000003f0,
+0x000007be,0x000003ee,0x0000011e,0x000007ef,
+0x00000477,0x000007f0,0x000002c7,0x000007ab,
+0x0000044f,0x00000404,0x000002cb,0x0000040c,
+0x000007a2,0x00000406,0x000007b8,0x00000400,
+0x0000044c,0x000003fa,0x000002d4,0x000007b9,
+0x000007d7,0x000007d8,0x000002e3,0x000002f9,
+0x000007d9,0x000002f3,0x000002e8,0x00000304,
+0x000007aa,0x000002fc,0x000007da,0x000002f5,
+0x000007db,0x000002ed,0x00040020,0x00000831,
+0x00000007,0x00000823,0x0004001c,0x00000846,
+0x00000011,0x000000af,0x0005002c,0x00000011,
+0x00000847,0x000006b5,0x000000af,0x0005002c,
+0x00000011,0x00000848,0x000002e2,0x000000af,
+0x0005002c,0x00000011,0x00000849,0x000002c4,
+0x000000c2,0x0005002c,0x00000011,0x0000084a,
+0x000002c2,0x000000af,0x0005002c,0x00000011,
+0x0000084b,0x000000af,0x000000b4,0x0005002c,
+0x00000011,0x0000084c,0x000000b3,0x000000b3,
+0x0005002c,0x00000011,0x0000084d,0x000000b4,
+0x0000011e,0x000b002c,0x00000846,0x0000084e,
+0x00000847,0x00000848,0x00000849,0x0000084a,
+0x0000084b,0x0000084c,0x0000084d,0x0000049f,
+0x00040020,0x00000851,0x00000007,0x00000846,
+0x0004002b,0x00000059,0x00000863,0x00000060,
+0x0004002b,0x00000059,0x00000864,0x00000040,
+0x0004002b,0x00000059,0x00000865,0x00000020,
+0x0007002c,0x0000005a,0x00000866,0x00000863,
+0x00000864,0x00000865,0x000000e2,0x0007002c,
+0x0000000f,0x0000086a,0x000000c2,0x000000c2,
+0x000000c2,0x000000c2,0x0007002c,0x0000005a,
+0x0000086c,0x000000e2,0x000000e2,0x000000e2,
+0x000000e2,0x0004002b,0x00000059,0x0000086d,
+0x0000001f,0x0007002c,0x0000005a,0x0000086e,
+0x0000086d,0x0000086d,0x0000086d,0x0000086d,
+0x0004002b,0x00000006,0x00000874,0xffffffff,
+0x0007002c,0x0000000f,0x00000875,0x00000874,
+0x00000874,0x00000874,0x00000874,0x0007002c,
+0x0000000f,0x00000878,0x00000200,0x0000019c,
+0x000001a0,0x000001c3,0x00040017,0x00000879,
+0x000000cf,0x00000004,0x0007002c,0x0000000f,
+0x00000881,0x000006b5,0x000000bf,0x000006b5,
+0x000006b5,0x0004002b,0x00000059,0x000008bc,
+0x0000001d,0x0004002b,0x00000059,0x000008c0,
+0xfffffffe,0x0005001e,0x0000093e,0x00000011,
+0x00000006,0x00000006,0x00040020,0x0000093f,
+0x00000009,0x0000093e,0x0004003b,0x0000093f,
+0x00000940,0x00000009,0x00040020,0x00000941,
+0x00000009,0x00000011,0x00090019,0x0000094a,
+0x00000006,0x00000002,0x00000000,0x00000000,
+0x00000000,0x00000002,0x0000001e,0x00040020,
+0x0000094b,0x00000000,0x0000094a,0x0004003b,
+0x0000094b,0x0000094c,0x00000000,0x00040020,
+0x00000967,0x00000007,0x0000008b,0x0004002b,
+0x0000008b,0x00000974,0x40400000,0x0004002b,
+0x0000008b,0x00000976,0x00000000,0x0004002b,
+0x0000008b,0x0000098b,0x40e00000,0x0004002b,
+0x00000006,0x00000990,0x02345671,0x00040018,
+0x000009c2,0x0000008c,0x00000003,0x00040020,
+0x000009c3,0x00000007,0x000009c2,0x0004002b,
+0x0000008b,0x000009d4,0x3f800000,0x0004002b,
+0x0000008b,0x000009fc,0x40800000,0x0004002b,
+0x0000008b,0x00000a01,0x3e991687,0x0004002b,
+0x0000008b,0x00000a02,0x3f1645a2,0x0004002b,
+0x0000008b,0x00000a03,0x3de978d5,0x0006002c,
+0x0000008c,0x00000a04,0x00000a01,0x00000a02,
+0x00000a03,0x00040020,0x00000a1a,0x00000001,
+0x00000006,0x0004003b,0x00000a1a,0x00000a1b,
+0x00000001,0x0004002b,0x00000006,0x00000a4e,
+0xfffffffd,0x0004002b,0x0000008b,0x00000a75,
+0x41f80000,0x0004002b,0x0000008b,0x00000a76,
+0x427c0000,0x0006002c,0x0000008c,0x00000a77,
+0x00000a75,0x00000a76,0x00000a75,0x0004002b,
+0x0000008b,0x00000a79,0x437f0000,0x0006002c,
+0x0000008c,0x00000a7a,0x00000a79,0x00000a79,
+0x00000a79,0x0004003b,0x00000a1a,0x00000a8b,
+0x00000001,0x0004003b,0x00000a1a,0x00000a8d,
+0x00000001,0x00040020,0x00000a99,0x00000001,
+0x00000008,0x0004003b,0x00000a99,0x00000a9a,
+0x00000001,0x00040020,0x00000aae,0x00000009,
+0x00000006,0x0004003b,0x0000094b,0x00000b06,
+0x00000000,0x0006002c,0x00000008,0x00000b14,
+0x000001a0,0x000000c2,0x000000c2,0x00050036,
+0x00000002,0x00000004,0x00000000,0x00000003,
+0x000200f8,0x00000005,0x0004003b,0x00000007,
+0x00000a8a,0x00000007,0x0004003b,0x00000007,
+0x00000a92,0x00000007,0x0004003b,0x00000007,
+0x00000a95,0x00000007,0x0004003b,0x00000012,
+0x00000a98,0x00000007,0x0004003b,0x00000007,
+0x00000aad,0x00000007,0x0004003b,0x00000010,
+0x00000ab4,0x00000007,0x0004003b,0x00000012,
+0x00000ab5,0x00000007,0x0004003b,0x00000007,
+0x00000ab7,0x00000007,0x0004003b,0x00000009,
+0x00000aba,0x00000007,0x0004003b,0x00000009,
+0x00000abb,0x00000007,0x0004003b,0x00000009,
+0x00000abc,0x00000007,0x0004003b,0x00000009,
+0x00000abf,0x00000007,0x0004003b,0x00000009,
+0x00000ac0,0x00000007,0x0004003b,0x00000012,
+0x00000ac4,0x00000007,0x0004003b,0x00000009,
+0x00000ac5,0x00000007,0x0004003b,0x00000009,
+0x00000ac8,0x00000007,0x0004003b,0x00000007,
+0x00000acc,0x00000007,0x0004003b,0x0000008d,
+0x00000adb,0x00000007,0x0004003b,0x0000008d,
+0x00000adc,0x00000007,0x0004003b,0x0000008d,
+0x00000add,0x00000007,0x0004003b,0x00000010,
+0x00000aea,0x00000007,0x0004003b,0x00000007,
+0x00000aeb,0x00000007,0x0004003b,0x00000007,
+0x00000aee,0x00000007,0x0004003b,0x00000061,
+0x00000b11,0x00000007,0x0004003d,0x00000006,
+0x00000a8c,0x00000a8b,0x0004003d,0x00000006,
+0x00000a8e,0x00000a8d,0x00050084,0x00000006,
+0x00000a8f,0x00000a8c,0x00000a8e,0x0004003d,
+0x00000006,0x00000a90,0x00000a1b,0x00050080,
+0x00000006,0x00000a91,0x00000a8f,0x00000a90,
+0x0003003e,0x00000a8a,0x00000a91,0x0004003d,
+0x00000006,0x00000a93,0x00000a8a,0x00050086,
+0x00000006,0x00000a94,0x00000a93,0x00000170,
+0x0003003e,0x00000a92,0x00000a94,0x0004003d,
+0x00000006,0x00000a96,0x00000a8a,0x00050089,
+0x00000006,0x00000a97,0x00000a96,0x00000170,
+0x0003003e,0x00000a95,0x00000a97,0x0004003d,
+0x00000008,0x00000a9b,0x00000a9a,0x0007004f,
+0x00000011,0x00000a9c,0x00000a9b,0x00000a9b,
+0x00000000,0x00000001,0x00050050,0x00000011,
+0x00000a9d,0x000000af,0x000000af,0x00050084,
+0x00000011,0x00000a9e,0x00000a9d,0x00000a9c,
+0x0004003d,0x00000006,0x00000a9f,0x00000a92,
+0x000500c7,0x00000006,0x00000aa0,0x00000a9f,
+0x000000c2,0x00050084,0x00000006,0x00000aa1,
+0x000000b3,0x00000aa0,0x0004003d,0x00000006,
+0x00000aa2,0x00000a95,0x00050089,0x00000006,
+0x00000aa3,0x00000aa2,0x000000b3,0x00050080,
+0x00000006,0x00000aa4,0x00000aa1,0x00000aa3,
+0x0004003d,0x00000006,0x00000aa5,0x00000a92,
+0x000500c7,0x00000006,0x00000aa6,0x00000aa5,
+0x000000b4,0x00050084,0x00000006,0x00000aa7,
+0x000000b4,0x00000aa6,0x0004003d,0x00000006,
+0x00000aa8,0x00000a95,0x00050086,0x00000006,
+0x00000aa9,0x00000aa8,0x000000b3,0x00050080,
+0x00000006,0x00000aaa,0x00000aa7,0x00000aa9,
+0x00050050,0x00000011,0x00000aab,0x00000aa4,
+0x00000aaa,0x00050080,0x00000011,0x00000aac,
+0x00000a9e,0x00000aab,0x0003003e,0x00000a98,
+0x00000aac,0x00050041,0x00000aae,0x00000aaf,
+0x00000940,0x000000ed,0x0004003d,0x00000006,
+0x00000ab0,0x00000aaf,0x00050041,0x00000a1a,
+0x00000ab1,0x00000a9a,0x000000b4,0x0004003d,
+0x00000006,0x00000ab2,0x00000ab1,0x00050080,
+0x00000006,0x00000ab3,0x00000ab0,0x00000ab2,
+0x0003003e,0x00000aad,0x00000ab3,0x0004003d,
+0x00000011,0x00000ab6,0x00000a98,0x0003003e,
+0x00000ab5,0x00000ab6,0x0004003d,0x00000006,
+0x00000ab8,0x00000aad,0x0003003e,0x00000ab7,
+0x00000ab8,0x00060039,0x0000000f,0x00000ab9,
+0x00000089,0x00000ab5,0x00000ab7,0x0003003e,
+0x00000ab4,0x00000ab9,0x0004003d,0x0000000f,
+0x00000abd,0x00000ab4,0x0008004f,0x00000008,
+0x00000abe,0x00000abd,0x00000abd,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x00000abc,
+0x00000abe,0x00070039,0x00000002,0x00000ac1,
+0x0000009e,0x00000abc,0x00000abf,0x00000ac0,
+0x0004003d,0x00000008,0x00000ac2,0x00000abf,
+0x0003003e,0x00000aba,0x00000ac2,0x0004003d,
+0x00000008,0x00000ac3,0x00000ac0,0x0003003e,
+0x00000abb,0x00000ac3,0x0004003d,0x00000008,
+0x00000ac6,0x00000aba,0x0003003e,0x00000ac5,
+0x00000ac6,0x00050039,0x00000006,0x00000ac7,
+0x000000a7,0x00000ac5,0x0004003d,0x00000008,
+0x00000ac9,0x00000abb,0x0003003e,0x00000ac8,
+0x00000ac9,0x00050039,0x00000006,0x00000aca,
+0x000000a7,0x00000ac8,0x00050050,0x00000011,
+0x00000acb,0x00000ac7,0x00000aca,0x0003003e,
+0x00000ac4,0x00000acb,0x0003003e,0x00000acc,
+0x000000bf,0x00050041,0x00000007,0x00000acd,
+0x00000ac4,0x000000bf,0x0004003d,0x00000006,
+0x00000ace,0x00000acd,0x00050041,0x00000007,
+0x00000acf,0x00000ac4,0x000000c2,0x0004003d,
+0x00000006,0x00000ad0,0x00000acf,0x000500ab,
+0x000000cf,0x00000ad1,0x00000ace,0x00000ad0,
+0x000300f7,0x00000ad3,0x00000000,0x000400fa,
+0x00000ad1,0x00000ad2,0x00000ad3,0x000200f8,
+0x00000ad2,0x0004003d,0x0000000f,0x00000ad4,
+0x00000ab4,0x0008004f,0x00000008,0x00000ad5,
+0x00000ad4,0x00000ad4,0x00000000,0x00000001,
+0x00000002,0x00040070,0x0000008c,0x00000ad6,
+0x00000ad5,0x0004003d,0x00000008,0x00000ad7,
+0x00000aba,0x00040070,0x0000008c,0x00000ad8,
+0x00000ad7,0x0004003d,0x00000008,0x00000ad9,
+0x00000abb,0x00040070,0x0000008c,0x00000ada,
+0x00000ad9,0x0003003e,0x00000adb,0x00000ad6,
+0x0003003e,0x00000adc,0x00000ad8,0x0003003e,
+0x00000add,0x00000ada,0x00070039,0x00000006,
+0x00000ade,0x00000092,0x00000adb,0x00000adc,
+0x00000add,0x0003003e,0x00000acc,0x00000ade,
+0x000200f9,0x00000ad3,0x000200f8,0x00000ad3,
+0x00050041,0x00000007,0x00000adf,0x00000ac4,
+0x000000bf,0x0004003d,0x00000006,0x00000ae0,
+0x00000adf,0x00050041,0x00000007,0x00000ae1,
+0x00000ac4,0x000000c2,0x0004003d,0x00000006,
+0x00000ae2,0x00000ae1,0x000500ac,0x000000cf,
+0x00000ae3,0x00000ae0,0x00000ae2,0x000300f7,
+0x00000ae5,0x00000000,0x000400fa,0x00000ae3,
+0x00000ae4,0x00000ae5,0x000200f8,0x00000ae4,
+0x0004003d,0x00000006,0x00000ae6,0x00000acc,
+0x000500c6,0x00000006,0x00000ae7,0x00000ae6,
+0x000000c2,0x0003003e,0x00000acc,0x00000ae7,
+0x0004003d,0x00000011,0x00000ae8,0x00000ac4,
+0x0007004f,0x00000011,0x00000ae9,0x00000ae8,
+0x00000ae8,0x00000001,0x00000000,0x0003003e,
+0x00000ac4,0x00000ae9,0x000200f9,0x00000ae5,
+0x000200f8,0x00000ae5,0x00050041,0x00000007,
+0x00000aec,0x00000ab4,0x000000b8,0x0004003d,
+0x00000006,0x00000aed,0x00000aec,0x0003003e,
+0x00000aeb,0x00000aed,0x0004003d,0x00000006,
+0x00000aef,0x00000a95,0x0003003e,0x00000aee,
+0x00000aef,0x00060039,0x00000011,0x00000af0,
+0x000000a3,0x00000aeb,0x00000aee,0x00050041,
+0x00000007,0x00000af1,0x00000aea,0x000000bf,
+0x00050051,0x00000006,0x00000af2,0x00000af0,
+0x00000000,0x0003003e,0x00000af1,0x00000af2,
+0x00050041,0x00000007,0x00000af3,0x00000aea,
+0x000000c2,0x00050051,0x00000006,0x00000af4,
+0x00000af0,0x00000001,0x0003003e,0x00000af3,
+0x00000af4,0x00050041,0x00000007,0x00000af5,
+0x00000ac4,0x000000c2,0x0004003d,0x00000006,
+0x00000af6,0x00000af5,0x00050041,0x00000007,
+0x00000af7,0x00000ac4,0x000000bf,0x0004003d,
+0x00000006,0x00000af8,0x00000af7,0x000500c4,
+0x00000006,0x00000af9,0x00000af8,0x00000589,
+0x000500c5,0x00000006,0x00000afa,0x00000af6,
+0x00000af9,0x00050041,0x00000007,0x00000afb,
+0x00000aea,0x000000b4,0x0003003e,0x00000afb,
+0x00000afa,0x0004003d,0x00000006,0x00000afc,
+0x00000acc,0x0004003d,0x00000006,0x00000afd,
+0x00000a95,0x00050084,0x00000006,0x00000afe,
+0x000000b4,0x00000afd,0x000500c4,0x00000006,
+0x00000aff,0x00000afc,0x00000afe,0x00070168,
+0x00000006,0x00000b00,0x000000b8,0x00000003,
+0x00000aff,0x00000170,0x00050041,0x00000007,
+0x00000b01,0x00000aea,0x000000b8,0x0003003e,
+0x00000b01,0x00000b00,0x0004003d,0x00000006,
+0x00000b02,0x00000a95,0x000500aa,0x000000cf,
+0x00000b03,0x00000b02,0x000000bf,0x000300f7,
+0x00000b05,0x00000000,0x000400fa,0x00000b03,
+0x00000b04,0x00000b05,0x000200f8,0x00000b04,
+0x0004003d,0x0000094a,0x00000b07,0x00000b06,
+0x0004003d,0x00000011,0x00000b08,0x00000a98,
+0x00050050,0x00000011,0x00000b09,0x000000b3,
+0x000000b3,0x00050086,0x00000011,0x00000b0a,
+0x00000b08,0x00000b09,0x0004007c,0x0000052f,
+0x00000b0b,0x00000b0a,0x0004003d,0x00000006,
+0x00000b0c,0x00000aad,0x0004007c,0x00000059,
+0x00000b0d,0x00000b0c,0x00050051,0x00000059,
+0x00000b0e,0x00000b0b,0x00000000,0x00050051,
+0x00000059,0x00000b0f,0x00000b0b,0x00000001,
+0x00060050,0x00000060,0x00000b10,0x00000b0e,
+0x00000b0f,0x00000b0d,0x0003003e,0x00000b11,
+0x00000b10,0x00050039,0x00000060,0x00000b12,
+0x00000084,0x00000b11,0x0004003d,0x0000000f,
+0x00000b13,0x00000aea,0x00040063,0x00000b07,
+0x00000b12,0x00000b13,0x000200f9,0x00000b05,
+0x000200f8,0x00000b05,0x000100fd,0x00010038,
+0x00050036,0x00000006,0x0000000d,0x00000000,
+0x0000000a,0x00030037,0x00000007,0x0000000b,
+0x00030037,0x00000009,0x0000000c,0x000200f8,
+0x0000000e,0x0004003b,0x00000012,0x000000a9,
+0x00000007,0x0004003d,0x00000006,0x000000aa,
+0x0000000b,0x0004003d,0x00000008,0x000000ab,
+0x0000000c,0x0007004f,0x00000011,0x000000ac,
+0x000000ab,0x000000ab,0x00000000,0x00000001,
+0x00050050,0x00000011,0x000000ad,0x000000aa,
+0x000000aa,0x00050084,0x00000011,0x000000ae,
+0x000000ad,0x000000ac,0x00050084,0x00000011,
+0x000000b2,0x000000ae,0x000000b1,0x00050080,
+0x00000011,0x000000b6,0x000000b2,0x000000b5,
+0x00050086,0x00000011,0x000000ba,0x000000b6,
+0x000000b9,0x0003003e,0x000000a9,0x000000ba,
+0x0004003d,0x00000006,0x000000bb,0x0000000b,
+0x00050041,0x00000007,0x000000bc,0x0000000c,
+0x000000b4,0x0004003d,0x00000006,0x000000bd,
+0x000000bc,0x00050084,0x00000006,0x000000be,
+0x000000bb,0x000000bd,0x00050041,0x00000007,
+0x000000c0,0x000000a9,0x000000bf,0x0004003d,
+0x00000006,0x000000c1,0x000000c0,0x00050041,
+0x00000007,0x000000c3,0x000000a9,0x000000c2,
+0x0004003d,0x00000006,0x000000c4,0x000000c3,
+0x00050080,0x00000006,0x000000c5,0x000000c1,
+0x000000c4,0x00050080,0x00000006,0x000000c6,
+0x000000be,0x000000c5,0x000200fe,0x000000c6,
+0x00010038,0x00050036,0x00000002,0x00000016,
+0x00000000,0x00000013,0x00030037,0x00000010,
+0x00000014,0x00030037,0x00000012,0x00000015,
+0x000200f8,0x00000017,0x0004003b,0x00000007,
+0x000000df,0x00000007,0x0004003b,0x00000007,
+0x000000e5,0x00000007,0x0004003b,0x00000007,
+0x000000e9,0x00000007,0x0004003b,0x00000007,
+0x000000ef,0x00000007,0x0004003b,0x00000007,
+0x000000f4,0x00000007,0x0004003b,0x00000007,
+0x000000f9,0x00000007,0x0004003b,0x00000007,
+0x00000108,0x00000007,0x0004003b,0x00000185,
+0x00000186,0x00000007,0x0004003b,0x00000007,
+0x00000193,0x00000007,0x0004003b,0x00000009,
+0x00000195,0x00000007,0x0004003d,0x0000000f,
+0x000000cb,0x00000014,0x0003003e,0x000000ca,
+0x000000cb,0x0004003d,0x00000011,0x000000ce,
+0x00000015,0x0003003e,0x000000cd,0x000000ce,
+0x0003003e,0x000000d1,0x000000d2,0x00050041,
+0x000000d4,0x000000d5,0x000000ca,0x000000b8,
+0x0004003d,0x00000006,0x000000d6,0x000000d5,
+0x000500c7,0x00000006,0x000000d8,0x000000d6,
+0x000000d7,0x000500aa,0x000000cf,0x000000da,
+0x000000d8,0x000000d9,0x0003003e,0x000000d3,
+0x000000da,0x0004003d,0x000000cf,0x000000db,
+0x000000d3,0x000300f7,0x000000dd,0x00000000,
+0x000400fa,0x000000db,0x000000dc,0x000000dd,
+0x000200f8,0x000000dc,0x000100fd,0x000200f8,
+0x000000dd,0x00050041,0x000000d4,0x000000e0,
+0x000000ca,0x000000b8,0x0004003d,0x00000006,
+0x000000e1,0x000000e0,0x000600cb,0x00000006,
+0x000000e4,0x000000e1,0x000000e2,0x000000e3,
+0x0003003e,0x000000df,0x000000e4,0x00050041,
+0x000000d4,0x000000e6,0x000000ca,0x000000b8,
+0x0004003d,0x00000006,0x000000e7,0x000000e6,
+0x000600cb,0x00000006,0x000000e8,0x000000e7,
+0x000000e3,0x000000e3,0x0003003e,0x000000e5,
+0x000000e8,0x00050041,0x000000d4,0x000000ea,
+0x000000ca,0x000000b8,0x0004003d,0x00000006,
+0x000000eb,0x000000ea,0x000600cb,0x00000006,
+0x000000ee,0x000000eb,0x000000ec,0x000000ed,
+0x0003003e,0x000000e9,0x000000ee,0x00050041,
+0x000000d4,0x000000f0,0x000000ca,0x000000b8,
+0x0004003d,0x00000006,0x000000f1,0x000000f0,
+0x000600cb,0x00000006,0x000000f3,0x000000f1,
+0x000000f2,0x000000e3,0x0003003e,0x000000ef,
+0x000000f3,0x00050041,0x000000d4,0x000000f5,
+0x000000ca,0x000000b8,0x0004003d,0x00000006,
+0x000000f6,0x000000f5,0x000600cb,0x00000006,
+0x000000f8,0x000000f6,0x000000f7,0x000000e3,
+0x0003003e,0x000000f4,0x000000f8,0x00050041,
+0x000000d4,0x000000fa,0x000000ca,0x000000b8,
+0x0004003d,0x00000006,0x000000fb,0x000000fa,
+0x000600cb,0x00000006,0x000000fd,0x000000fb,
+0x000000fc,0x000000ed,0x0003003e,0x000000f9,
+0x000000fd,0x00050041,0x000000d4,0x000000ff,
+0x000000ca,0x000000b8,0x0004003d,0x00000006,
+0x00000100,0x000000ff,0x000600cb,0x00000006,
+0x00000102,0x00000100,0x00000101,0x000000ed,
+0x000500ab,0x000000cf,0x00000103,0x00000102,
+0x000000bf,0x0003003e,0x000000fe,0x00000103,
+0x0004003d,0x00000006,0x00000104,0x000000df,
+0x000500aa,0x000000cf,0x00000105,0x00000104,
+0x000000bf,0x000300f7,0x00000107,0x00000000,
+0x000400fa,0x00000105,0x00000106,0x00000136,
+0x000200f8,0x00000106,0x0004003d,0x00000006,
+0x00000109,0x000000e5,0x000500c4,0x00000006,
+0x0000010a,0x00000109,0x000000ed,0x0004003d,
+0x00000006,0x0000010b,0x000000e9,0x000500c5,
+0x00000006,0x0000010c,0x0000010a,0x0000010b,
+0x0003003e,0x00000108,0x0000010c,0x0004003d,
+0x00000006,0x0000010d,0x000000f4,0x000300f7,
+0x00000112,0x00000000,0x000b00fb,0x0000010d,
+0x00000112,0x00000000,0x0000010e,0x00000001,
+0x0000010f,0x00000002,0x00000110,0x00000003,
+0x00000111,0x000200f8,0x0000010e,0x0004003d,
+0x00000006,0x00000115,0x000000ef,0x00050080,
+0x00000006,0x00000116,0x00000115,0x000000b4,
+0x00050050,0x00000011,0x00000117,0x00000114,
+0x00000116,0x0003003e,0x00000113,0x00000117,
+0x000200f9,0x00000112,0x000200f8,0x0000010f,
+0x0004003d,0x00000006,0x00000119,0x000000ef,
+0x00050080,0x00000006,0x0000011a,0x00000119,
+0x000000b4,0x00050050,0x00000011,0x0000011b,
+0x0000011a,0x00000114,0x0003003e,0x00000113,
+0x0000011b,0x000200f9,0x00000112,0x000200f8,
+0x00000110,0x0004003d,0x00000006,0x0000011d,
+0x000000ef,0x00050080,0x00000006,0x0000011f,
+0x0000011d,0x0000011e,0x00050041,0x000000d4,
+0x00000120,0x000000ca,0x000000b8,0x0004003d,
+0x00000006,0x00000121,0x00000120,0x000600cb,
+0x00000006,0x00000122,0x00000121,0x000000fc,
+0x000000e3,0x00050080,0x00000006,0x00000123,
+0x00000122,0x0000011e,0x00050050,0x00000011,
+0x00000124,0x0000011f,0x00000123,0x0003003e,
+0x00000113,0x00000124,0x0003003e,0x000000fe,
+0x000000d2,0x0003003e,0x000000f9,0x000000bf,
+0x000200f9,0x00000112,0x000200f8,0x00000111,
+0x0004003d,0x00000006,0x00000126,0x000000ef,
+0x000500aa,0x000000cf,0x00000127,0x00000126,
+0x000000bf,0x000300f7,0x00000129,0x00000000,
+0x000400fa,0x00000127,0x00000128,0x0000012c,
+0x000200f8,0x00000128,0x0003003e,0x00000113,
+0x0000012b,0x000200f9,0x00000129,0x000200f8,
+0x0000012c,0x0004003d,0x00000006,0x0000012d,
+0x000000ef,0x000500aa,0x000000cf,0x0000012e,
+0x0000012d,0x000000c2,0x000300f7,0x00000130,
+0x00000000,0x000400fa,0x0000012e,0x0000012f,
+0x00000132,0x000200f8,0x0000012f,0x0003003e,
+0x00000113,0x00000131,0x000200f9,0x00000130,
+0x000200f8,0x00000132,0x0003003e,0x000000d1,
+0x00000133,0x000100fd,0x000200f8,0x00000130,
+0x000200f9,0x00000129,0x000200f8,0x00000129,
+0x000200f9,0x00000112,0x000200f8,0x00000112,
+0x000200f9,0x00000107,0x000200f8,0x00000136,
+0x0004003d,0x00000006,0x00000137,0x000000df,
+0x000500c4,0x00000006,0x00000138,0x00000137,
+0x000000ed,0x0004003d,0x00000006,0x00000139,
+0x000000e9,0x000500c5,0x00000006,0x0000013a,
+0x00000138,0x00000139,0x0003003e,0x00000108,
+0x0000013a,0x0004003d,0x00000006,0x0000013b,
+0x000000e5,0x000300f7,0x00000140,0x00000000,
+0x000b00fb,0x0000013b,0x00000140,0x00000000,
+0x0000013c,0x00000001,0x0000013d,0x00000002,
+0x0000013e,0x00000003,0x0000013f,0x000200f8,
+0x0000013c,0x0004003d,0x00000006,0x00000141,
+0x000000f4,0x00050080,0x00000006,0x00000142,
+0x00000141,0x000000b3,0x0004003d,0x00000006,
+0x00000143,0x000000ef,0x00050080,0x00000006,
+0x00000144,0x00000143,0x000000b4,0x00050050,
+0x00000011,0x00000145,0x00000142,0x00000144,
+0x0003003e,0x00000113,0x00000145,0x000200f9,
+0x00000140,0x000200f8,0x0000013d,0x0004003d,
+0x00000006,0x00000147,0x000000f4,0x00050080,
+0x00000006,0x00000148,0x00000147,0x000000af,
+0x0004003d,0x00000006,0x00000149,0x000000ef,
+0x00050080,0x00000006,0x0000014a,0x00000149,
+0x000000b4,0x00050050,0x00000011,0x0000014b,
+0x00000148,0x0000014a,0x0003003e,0x00000113,
+0x0000014b,0x000200f9,0x00000140,0x000200f8,
+0x0000013e,0x0004003d,0x00000006,0x0000014d,
+0x000000ef,0x00050080,0x00000006,0x0000014e,
+0x0000014d,0x000000b4,0x0004003d,0x00000006,
+0x0000014f,0x000000f4,0x00050080,0x00000006,
+0x00000150,0x0000014f,0x000000af,0x00050050,
+0x00000011,0x00000151,0x0000014e,0x00000150,
+0x0003003e,0x00000113,0x00000151,0x000200f9,
+0x00000140,0x000200f8,0x0000013f,0x0004003d,
+0x00000006,0x00000153,0x000000f4,0x000500c2,
+0x00000006,0x00000154,0x00000153,0x000000ed,
+0x000500aa,0x000000cf,0x00000155,0x00000154,
+0x000000bf,0x000300f7,0x00000157,0x00000000,
+0x000400fa,0x00000155,0x00000156,0x0000015e,
+0x000200f8,0x00000156,0x0004003d,0x00000006,
+0x00000158,0x000000ef,0x00050080,0x00000006,
+0x00000159,0x00000158,0x000000b4,0x0004003d,
+0x00000006,0x0000015a,0x000000f4,0x000500c7,
+0x00000006,0x0000015b,0x0000015a,0x000000c2,
+0x00050080,0x00000006,0x0000015c,0x0000015b,
+0x0000011e,0x00050050,0x00000011,0x0000015d,
+0x00000159,0x0000015c,0x0003003e,0x00000113,
+0x0000015d,0x000200f9,0x00000157,0x000200f8,
+0x0000015e,0x0004003d,0x00000006,0x0000015f,
+0x000000f4,0x000500c7,0x00000006,0x00000160,
+0x0000015f,0x000000c2,0x00050080,0x00000006,
+0x00000161,0x00000160,0x000000b4,0x0004003d,
+0x00000006,0x00000162,0x000000ef,0x00050080,
+0x00000006,0x00000163,0x00000162,0x000000b4,
+0x00050050,0x00000011,0x00000164,0x00000161,
+0x00000163,0x0003003e,0x00000113,0x00000164,
+0x000200f9,0x00000157,0x000200f8,0x00000157,
+0x000200f9,0x00000140,0x000200f8,0x00000140,
+0x000200f9,0x00000107,0x000200f8,0x00000107,
+0x0004003d,0x00000011,0x00000166,0x00000113,
+0x0004003d,0x00000011,0x00000167,0x000000cd,
+0x000500ac,0x00000168,0x00000169,0x00000166,
+0x00000167,0x0004009a,0x000000cf,0x0000016a,
+0x00000169,0x000300f7,0x0000016c,0x00000000,
+0x000400fa,0x0000016a,0x0000016b,0x0000016c,
+0x000200f8,0x0000016b,0x0003003e,0x000000d1,
+0x00000133,0x000100fd,0x000200f8,0x0000016c,
+0x0004003d,0x00000006,0x00000180,0x000000f9,
+0x000500c4,0x00000006,0x00000182,0x00000180,
+0x00000181,0x0004003d,0x00000006,0x00000183,
+0x00000108,0x000500c5,0x00000006,0x00000184,
+0x00000182,0x00000183,0x0003003e,0x00000186,
+0x0000017f,0x00050041,0x00000009,0x00000187,
+0x00000186,0x00000184,0x0004003d,0x00000008,
+0x00000188,0x00000187,0x0003003e,0x0000016f,
+0x00000188,0x00050041,0x000000d4,0x0000018a,
+0x00000113,0x000000bf,0x0004003d,0x00000006,
+0x0000018b,0x0000018a,0x00050041,0x000000d4,
+0x0000018c,0x00000113,0x000000c2,0x0004003d,
+0x00000006,0x0000018d,0x0000018c,0x00050084,
+0x00000006,0x0000018e,0x0000018b,0x0000018d,
+0x0004003d,0x000000cf,0x0000018f,0x000000fe,
+0x000600a9,0x00000059,0x00000190,0x0000018f,
+0x000000ed,0x000000e2,0x000500c4,0x00000006,
+0x00000191,0x0000018e,0x00000190,0x0003003e,
+0x00000189,0x00000191,0x0004003d,0x00000006,
+0x00000194,0x00000189,0x0003003e,0x00000193,
+0x00000194,0x0004003d,0x00000008,0x00000196,
+0x0000016f,0x0003003e,0x00000195,0x00000196,
+0x00060039,0x00000006,0x00000197,0x0000000d,
+0x00000193,0x00000195,0x0003003e,0x00000192,
+0x00000197,0x0004003d,0x00000006,0x00000198,
+0x00000192,0x000500b0,0x000000cf,0x0000019a,
+0x00000198,0x00000199,0x0004003d,0x00000006,
+0x0000019b,0x00000192,0x000500ac,0x000000cf,
+0x0000019d,0x0000019b,0x0000019c,0x000500a6,
+0x000000cf,0x0000019e,0x0000019a,0x0000019d,
+0x0004003d,0x00000006,0x0000019f,0x00000189,
+0x000500ac,0x000000cf,0x000001a1,0x0000019f,
+0x000001a0,0x000500a6,0x000000cf,0x000001a2,
+0x0000019e,0x000001a1,0x000300f7,0x000001a4,
+0x00000000,0x000400fa,0x000001a2,0x000001a3,
+0x000001a4,0x000200f8,0x000001a3,0x0003003e,
+0x000000d1,0x00000133,0x000100fd,0x000200f8,
+0x000001a4,0x00050041,0x000000d4,0x000001a7,
+0x000000ca,0x000000b8,0x0004003d,0x00000006,
+0x000001a8,0x000001a7,0x000600cb,0x00000006,
+0x000001aa,0x000001a8,0x000001a9,0x000000e3,
+0x00050080,0x00000006,0x000001ab,0x000001aa,
+0x000000c2,0x0003003e,0x000001a6,0x000001ab,
+0x0004003d,0x00000006,0x000001ac,0x000001a6,
+0x000500ac,0x000000cf,0x000001ad,0x000001ac,
+0x000000c2,0x000300f7,0x000001af,0x00000000,
+0x000400fa,0x000001ad,0x000001ae,0x000001af,
+0x000200f8,0x000001ae,0x00050041,0x000000d4,
+0x000001b1,0x000000ca,0x000000b8,0x0004003d,
+0x00000006,0x000001b2,0x000001b1,0x000600cb,
+0x00000006,0x000001b4,0x000001b2,0x000001b3,
+0x00000101,0x0003003e,0x000001b0,0x000001b4,
+0x000200f9,0x000001af,0x000200f8,0x000001af,
+0x0004003d,0x000000cf,0x000001b5,0x000000fe,
+0x0004003d,0x00000006,0x000001b6,0x000001a6,
+0x000500aa,0x000000cf,0x000001b7,0x000001b6,
+0x000000b3,0x000500a7,0x000000cf,0x000001b8,
+0x000001b5,0x000001b7,0x000300f7,0x000001ba,
+0x00000000,0x000400fa,0x000001b8,0x000001b9,
+0x000001ba,0x000200f8,0x000001b9,0x0003003e,
+0x000000d1,0x00000133,0x000100fd,0x000200f8,
+0x000001ba,0x000100fd,0x00010038,0x00050036,
+0x00000006,0x0000001c,0x00000000,0x00000018,
+0x00030037,0x00000010,0x00000019,0x00030037,
+0x00000007,0x0000001a,0x00030037,0x00000007,
+0x0000001b,0x000200f8,0x0000001d,0x0004003b,
+0x00000007,0x000001c1,0x00000007,0x0004003b,
+0x00000007,0x000001c6,0x00000007,0x0004003b,
+0x00000007,0x000001cd,0x00000007,0x0004003b,
+0x00000007,0x000001e0,0x00000007,0x0004003b,
+0x00000007,0x000001e3,0x00000007,0x0004003b,
+0x00000007,0x000001ec,0x00000007,0x0004003d,
+0x00000006,0x000001bc,0x0000001b,0x000500aa,
+0x000000cf,0x000001bd,0x000001bc,0x000000bf,
+0x000300f7,0x000001bf,0x00000000,0x000400fa,
+0x000001bd,0x000001be,0x000001bf,0x000200f8,
+0x000001be,0x000200fe,0x000000bf,0x000200f8,
+0x000001bf,0x0004003d,0x00000006,0x000001c2,
+0x0000001a,0x00050086,0x00000006,0x000001c4,
+0x000001c2,0x000001c3,0x00050082,0x00000006,
+0x000001c5,0x000000b8,0x000001c4,0x0003003e,
+0x000001c1,0x000001c5,0x0004003d,0x00000006,
+0x000001c7,0x0000001a,0x0004003d,0x00000006,
+0x000001c8,0x0000001b,0x00050080,0x00000006,
+0x000001c9,0x000001c7,0x000001c8,0x00050082,
+0x00000006,0x000001ca,0x000001c9,0x000000c2,
+0x00050086,0x00000006,0x000001cb,0x000001ca,
+0x000001c3,0x00050082,0x00000006,0x000001cc,
+0x000000b8,0x000001cb,0x0003003e,0x000001c6,
+0x000001cc,0x0004003d,0x00000006,0x000001ce,
+0x0000001a,0x000500c7,0x00000006,0x000001d0,
+0x000001ce,0x000001cf,0x0003003e,0x000001cd,
+0x000001d0,0x0004003d,0x00000006,0x000001d1,
+0x000001c1,0x0004003d,0x00000006,0x000001d2,
+0x000001c6,0x000500aa,0x000000cf,0x000001d3,
+0x000001d1,0x000001d2,0x000300f7,0x000001d5,
+0x00000000,0x000400fa,0x000001d3,0x000001d4,
+0x000001df,0x000200f8,0x000001d4,0x0004003d,
+0x00000006,0x000001d6,0x000001c1,0x00050041,
+0x00000007,0x000001d7,0x00000019,0x000001d6,
+0x0004003d,0x00000006,0x000001d8,0x000001d7,
+0x0004003d,0x00000006,0x000001d9,0x000001cd,
+0x0004007c,0x00000059,0x000001da,0x000001d9,
+0x0004003d,0x00000006,0x000001db,0x0000001b,
+0x0004007c,0x00000059,0x000001dc,0x000001db,
+0x000600cb,0x00000006,0x000001dd,0x000001d8,
+0x000001da,0x000001dc,0x000200fe,0x000001dd,
+0x000200f8,0x000001df,0x0004003d,0x00000006,
+0x000001e1,0x000001cd,0x00050082,0x00000006,
+0x000001e2,0x000001c3,0x000001e1,0x0003003e,
+0x000001e0,0x000001e2,0x0004003d,0x00000006,
+0x000001e4,0x000001c1,0x00050041,0x00000007,
+0x000001e5,0x00000019,0x000001e4,0x0004003d,
+0x00000006,0x000001e6,0x000001e5,0x0004003d,
+0x00000006,0x000001e7,0x000001cd,0x0004007c,
+0x00000059,0x000001e8,0x000001e7,0x0004003d,
+0x00000006,0x000001e9,0x000001e0,0x0004007c,
+0x00000059,0x000001ea,0x000001e9,0x000600cb,
+0x00000006,0x000001eb,0x000001e6,0x000001e8,
+0x000001ea,0x0003003e,0x000001e3,0x000001eb,
+0x0004003d,0x00000006,0x000001ed,0x000001c6,
+0x00050041,0x00000007,0x000001ee,0x00000019,
+0x000001ed,0x0004003d,0x00000006,0x000001ef,
+0x000001ee,0x0004003d,0x00000006,0x000001f0,
+0x0000001b,0x0004003d,0x00000006,0x000001f1,
+0x000001e0,0x00050082,0x00000006,0x000001f2,
+0x000001f0,0x000001f1,0x0004007c,0x00000059,
+0x000001f3,0x000001f2,0x000600cb,0x00000006,
+0x000001f4,0x000001ef,0x000000e2,0x000001f3,
+0x0003003e,0x000001ec,0x000001f4,0x0004003d,
+0x00000006,0x000001f5,0x000001ec,0x0004003d,
+0x00000006,0x000001f6,0x000001e0,0x000500c4,
+0x00000006,0x000001f7,0x000001f5,0x000001f6,
+0x0004003d,0x00000006,0x000001f8,0x000001e3,
+0x000500c5,0x00000006,0x000001f9,0x000001f7,
+0x000001f8,0x000200fe,0x000001f9,0x000200f8,
+0x000001d5,0x000100ff,0x00010038,0x00050036,
+0x00000006,0x00000023,0x00000000,0x0000001e,
+0x00030037,0x00000007,0x0000001f,0x00030037,
+0x00000007,0x00000020,0x00030037,0x00000007,
+0x00000021,0x00030037,0x00000007,0x00000022,
+0x000200f8,0x00000024,0x0004003b,0x00000007,
+0x00000203,0x00000007,0x0004003b,0x00000007,
+0x0000020e,0x00000007,0x0004003b,0x00000007,
+0x00000213,0x00000007,0x0004003b,0x00000007,
+0x0000021e,0x00000007,0x0004003b,0x00000007,
+0x0000022c,0x00000007,0x0004003b,0x00000007,
+0x00000234,0x00000007,0x0004003b,0x00000010,
+0x00000235,0x00000007,0x0004003b,0x00000007,
+0x00000237,0x00000007,0x0004003b,0x00000007,
+0x00000239,0x00000007,0x0004003b,0x00000007,
+0x0000023c,0x00000007,0x0004003b,0x00000007,
+0x00000241,0x00000007,0x0004003b,0x00000007,
+0x00000249,0x00000007,0x0004003b,0x00000007,
+0x00000261,0x00000007,0x0004003d,0x00000006,
+0x000001fc,0x000001a6,0x000500aa,0x000000cf,
+0x000001fd,0x000001fc,0x000000c2,0x000300f7,
+0x000001ff,0x00000000,0x000400fa,0x000001fd,
+0x000001fe,0x0000020d,0x000200f8,0x000001fe,
+0x0004003d,0x00000006,0x00000201,0x00000192,
+0x00050082,0x00000006,0x00000202,0x00000200,
+0x00000201,0x0003003e,0x00000020,0x00000202,
+0x00050041,0x000000d4,0x00000204,0x000000ca,
+0x000000b8,0x0004003d,0x00000006,0x00000205,
+0x00000204,0x000600cb,0x00000006,0x00000206,
+0x00000205,0x000001b3,0x000000ec,0x0003003e,
+0x00000203,0x00000206,0x0004003d,0x00000006,
+0x00000207,0x00000203,0x000500c2,0x00000006,
+0x00000208,0x00000207,0x000000e3,0x00050084,
+0x00000006,0x00000209,0x000000b4,0x00000208,
+0x00050080,0x00000006,0x0000020a,0x00000209,
+0x000000b4,0x0003003e,0x00000021,0x0000020a,
+0x0003003e,0x00000022,0x000000bf,0x0004003d,
+0x00000006,0x0000020b,0x00000203,0x000200fe,
+0x0000020b,0x000200f8,0x0000020d,0x00050041,
+0x000000d4,0x0000020f,0x000000ca,0x000000b8,
+0x0004003d,0x00000006,0x00000210,0x0000020f,
+0x000600cb,0x00000006,0x00000212,0x00000210,
+0x00000211,0x000000e3,0x0003003e,0x0000020e,
+0x00000212,0x00050041,0x000000d4,0x00000214,
+0x000000ca,0x000000b8,0x0004003d,0x00000006,
+0x00000215,0x00000214,0x000600cb,0x00000006,
+0x00000217,0x00000215,0x00000216,0x000000ec,
+0x0003003e,0x00000213,0x00000217,0x0004003d,
+0x00000006,0x00000218,0x0000020e,0x000500aa,
+0x000000cf,0x00000219,0x00000218,0x000000bf,
+0x000300f7,0x0000021b,0x00000000,0x000400fa,
+0x00000219,0x0000021a,0x0000022b,0x000200f8,
+0x0000021a,0x0004003d,0x00000006,0x0000021c,
+0x00000192,0x00050082,0x00000006,0x0000021d,
+0x00000200,0x0000021c,0x0003003e,0x00000020,
+0x0000021d,0x0004003d,0x00000006,0x0000021f,
+0x00000213,0x000500c2,0x00000006,0x00000220,
+0x0000021f,0x000000e3,0x00050084,0x00000006,
+0x00000221,0x000000b4,0x00000220,0x00050080,
+0x00000006,0x00000222,0x00000221,0x000000b4,
+0x0003003e,0x0000021e,0x00000222,0x0004003d,
+0x00000006,0x00000223,0x0000021e,0x0004003d,
+0x00000006,0x00000224,0x000001a6,0x00050084,
+0x00000006,0x00000225,0x00000223,0x00000224,
+0x0003003e,0x00000021,0x00000225,0x0004003d,
+0x00000006,0x00000226,0x0000021e,0x0004003d,
+0x00000006,0x00000227,0x0000001f,0x00050084,
+0x00000006,0x00000228,0x00000226,0x00000227,
+0x0003003e,0x00000022,0x00000228,0x0004003d,
+0x00000006,0x00000229,0x00000213,0x000200fe,
+0x00000229,0x000200f8,0x0000022b,0x0004003d,
+0x00000006,0x0000022d,0x000001a6,0x00050084,
+0x00000006,0x0000022e,0x000000b8,0x0000022d,
+0x00050082,0x00000006,0x0000022f,0x0000022e,
+0x000000b3,0x0003003e,0x0000022c,0x0000022f,
+0x0004003d,0x00000006,0x00000230,0x00000192,
+0x00050082,0x00000006,0x00000231,0x00000200,
+0x00000230,0x0004003d,0x00000006,0x00000232,
+0x0000022c,0x00050082,0x00000006,0x00000233,
+0x00000231,0x00000232,0x0003003e,0x00000020,
+0x00000233,0x0004003d,0x0000000f,0x00000236,
+0x000000ca,0x0003003e,0x00000235,0x00000236,
+0x0004003d,0x00000006,0x00000238,0x00000020,
+0x0003003e,0x00000237,0x00000238,0x0004003d,
+0x00000006,0x0000023a,0x0000022c,0x0003003e,
+0x00000239,0x0000023a,0x00070039,0x00000006,
+0x0000023b,0x0000001c,0x00000235,0x00000237,
+0x00000239,0x0003003e,0x00000234,0x0000023b,
+0x0004003d,0x00000006,0x0000023d,0x00000234,
+0x000500c4,0x00000006,0x0000023e,0x0000023d,
+0x000000ec,0x0004003d,0x00000006,0x0000023f,
+0x00000213,0x000500c5,0x00000006,0x00000240,
+0x0000023e,0x0000023f,0x0003003e,0x0000023c,
+0x00000240,0x0004003d,0x00000006,0x00000242,
+0x0000023c,0x0004003d,0x00000006,0x00000243,
+0x0000001f,0x00050084,0x00000006,0x00000244,
+0x000000b4,0x00000243,0x0004003d,0x00000006,
+0x00000245,0x000001a6,0x00050080,0x00000006,
+0x00000246,0x00000244,0x00000245,0x0004007c,
+0x00000059,0x00000247,0x00000246,0x000600cb,
+0x00000006,0x00000248,0x00000242,0x00000247,
+0x000000e3,0x0003003e,0x00000241,0x00000248,
+0x0004003d,0x00000006,0x0000024a,0x0000023c,
+0x0004003d,0x00000006,0x0000024b,0x000001a6,
+0x0004007c,0x00000059,0x0000024c,0x0000024b,
+0x000600cb,0x00000006,0x0000024d,0x0000024a,
+0x000000e2,0x0000024c,0x0003003e,0x00000249,
+0x0000024d,0x0004003d,0x00000006,0x0000024e,
+0x0000020e,0x0004003d,0x00000006,0x0000024f,
+0x000001a6,0x00050084,0x00000006,0x00000250,
+0x0000024e,0x0000024f,0x0004003d,0x00000006,
+0x00000251,0x00000249,0x000400cd,0x00000059,
+0x00000252,0x00000251,0x0004007c,0x00000006,
+0x00000253,0x00000252,0x00050080,0x00000006,
+0x00000254,0x00000250,0x00000253,0x00050084,
+0x00000006,0x00000255,0x000000b4,0x00000254,
+0x0003003e,0x00000021,0x00000255,0x0004003d,
+0x00000006,0x00000256,0x0000020e,0x0004003d,
+0x00000006,0x00000257,0x0000001f,0x00050084,
+0x00000006,0x00000258,0x00000256,0x00000257,
+0x0004003d,0x00000006,0x00000259,0x00000249,
+0x0004003d,0x00000006,0x0000025a,0x0000001f,
+0x0004007c,0x00000059,0x0000025b,0x0000025a,
+0x000600cb,0x00000006,0x0000025c,0x00000259,
+0x000000e2,0x0000025b,0x000400cd,0x00000059,
+0x0000025d,0x0000025c,0x0004007c,0x00000006,
+0x0000025e,0x0000025d,0x00050080,0x00000006,
+0x0000025f,0x00000258,0x0000025e,0x00050084,
+0x00000006,0x00000260,0x000000b4,0x0000025f,
+0x0003003e,0x00000022,0x00000260,0x0004003d,
+0x00000006,0x00000262,0x0000020e,0x00050082,
+0x00000006,0x00000263,0x00000262,0x000000c2,
+0x0004003d,0x00000006,0x00000264,0x00000249,
+0x0004003d,0x00000006,0x00000265,0x0000001f,
+0x0004007c,0x00000059,0x00000266,0x00000265,
+0x000600cb,0x00000006,0x00000267,0x00000264,
+0x00000266,0x000000ed,0x00050080,0x00000006,
+0x00000268,0x00000263,0x00000267,0x0003003e,
+0x00000261,0x00000268,0x0004003d,0x00000006,
+0x00000269,0x00000261,0x000500c4,0x00000006,
+0x0000026a,0x00000269,0x000000e3,0x0004003d,
+0x00000006,0x0000026b,0x00000241,0x000500c5,
+0x00000006,0x0000026c,0x0000026a,0x0000026b,
+0x000200fe,0x0000026c,0x000200f8,0x0000021b,
+0x000100ff,0x000200f8,0x000001ff,0x000100ff,
+0x00010038,0x00050036,0x00000006,0x0000002a,
+0x00000000,0x00000025,0x00030037,0x00000010,
+0x00000026,0x00030037,0x00000007,0x00000027,
+0x00030037,0x00000007,0x00000028,0x00030037,
+0x00000007,0x00000029,0x000200f8,0x0000002b,
+0x0004003b,0x0000026f,0x00000270,0x00000007,
+0x0004003b,0x00000007,0x00000273,0x00000007,
+0x0004003b,0x00000010,0x0000027a,0x00000007,
+0x0004003b,0x00000007,0x0000027c,0x00000007,
+0x0004003b,0x00000007,0x0000027d,0x00000007,
+0x0004003b,0x00000007,0x0000027f,0x00000007,
+0x0004003b,0x00000007,0x000002a2,0x00000007,
+0x0004003b,0x00000010,0x000002a3,0x00000007,
+0x0004003b,0x00000007,0x000002a5,0x00000007,
+0x0004003b,0x00000007,0x000002a7,0x00000007,
+0x0004003b,0x0000026f,0x000002ab,0x00000007,
+0x0004003b,0x00000007,0x000002b9,0x00000007,
+0x0004003b,0x000003a2,0x000003a3,0x00000007,
+0x0004003d,0x00000006,0x00000271,0x00000028,
+0x0004007c,0x00000059,0x00000272,0x00000271,
+0x0003003e,0x00000270,0x00000272,0x0004003d,
+0x00000006,0x00000274,0x00000027,0x0004003d,
+0x00000006,0x00000275,0x00000028,0x00050080,
+0x00000006,0x00000276,0x00000274,0x00000275,
+0x0004003d,0x00000006,0x00000277,0x00000028,
+0x00050084,0x00000006,0x00000278,0x000000b3,
+0x00000277,0x00050080,0x00000006,0x00000279,
+0x00000278,0x000000af,0x0004003d,0x0000000f,
+0x0000027b,0x00000026,0x0003003e,0x0000027a,
+0x0000027b,0x0003003e,0x0000027c,0x00000276,
+0x0003003e,0x0000027d,0x00000279,0x00070039,
+0x00000006,0x0000027e,0x0000001c,0x0000027a,
+0x0000027c,0x0000027d,0x0003003e,0x00000273,
+0x0000027e,0x0004003d,0x00000006,0x00000280,
+0x00000273,0x000600cb,0x00000006,0x00000281,
+0x00000280,0x000000e2,0x000000e3,0x0004003d,
+0x00000006,0x00000282,0x00000273,0x0004003d,
+0x00000059,0x00000283,0x00000270,0x00050084,
+0x00000059,0x00000284,0x000000ed,0x00000283,
+0x00050080,0x00000059,0x00000285,0x00000284,
+0x000000e3,0x000600cb,0x00000006,0x00000286,
+0x00000282,0x00000285,0x000000e3,0x000500c4,
+0x00000006,0x00000287,0x00000286,0x000000e3,
+0x000500c5,0x00000006,0x00000288,0x00000281,
+0x00000287,0x0004003d,0x00000006,0x00000289,
+0x00000273,0x0004003d,0x00000059,0x0000028a,
+0x00000270,0x00050084,0x00000059,0x0000028b,
+0x000000e3,0x0000028a,0x00050080,0x00000059,
+0x0000028c,0x0000028b,0x000000ec,0x000600cb,
+0x00000006,0x0000028d,0x00000289,0x0000028c,
+0x000000ed,0x000500c4,0x00000006,0x0000028e,
+0x0000028d,0x000000ec,0x000500c5,0x00000006,
+0x0000028f,0x00000288,0x0000028e,0x0004003d,
+0x00000006,0x00000290,0x00000273,0x0004003d,
+0x00000059,0x00000291,0x00000270,0x00050084,
+0x00000059,0x00000292,0x00000181,0x00000291,
+0x00050080,0x00000059,0x00000293,0x00000292,
+0x000000f2,0x000600cb,0x00000006,0x00000294,
+0x00000290,0x00000293,0x000000e3,0x000500c4,
+0x00000006,0x00000295,0x00000294,0x000000f2,
+0x000500c5,0x00000006,0x00000296,0x0000028f,
+0x00000295,0x0004003d,0x00000006,0x00000297,
+0x00000273,0x0004003d,0x00000059,0x00000298,
+0x00000270,0x00050084,0x00000059,0x00000299,
+0x000000ec,0x00000298,0x00050080,0x00000059,
+0x0000029a,0x00000299,0x000000f7,0x000600cb,
+0x00000006,0x0000029b,0x00000297,0x0000029a,
+0x000000ed,0x000500c4,0x00000006,0x0000029c,
+0x0000029b,0x000000f7,0x000500c5,0x00000006,
+0x0000029d,0x00000296,0x0000029c,0x0003003e,
+0x0000027f,0x0000029d,0x0004003d,0x00000006,
+0x0000029e,0x00000029,0x000500aa,0x000000cf,
+0x0000029f,0x0000029e,0x000000bf,0x000300f7,
+0x000002a1,0x00000000,0x000400fa,0x0000029f,
+0x000002a0,0x000002aa,0x000200f8,0x000002a0,
+0x0004003d,0x0000000f,0x000002a4,0x00000026,
+0x0003003e,0x000002a3,0x000002a4,0x0004003d,
+0x00000006,0x000002a6,0x00000027,0x0003003e,
+0x000002a5,0x000002a6,0x0004003d,0x00000006,
+0x000002a8,0x00000028,0x0003003e,0x000002a7,
+0x000002a8,0x00070039,0x00000006,0x000002a9,
+0x0000001c,0x000002a3,0x000002a5,0x000002a7,
+0x0003003e,0x000002a2,0x000002a9,0x000200f9,
+0x000002a1,0x000200f8,0x000002aa,0x0004003d,
+0x00000006,0x000002ac,0x00000029,0x0004007c,
+0x00000059,0x000002ad,0x000002ac,0x00050082,
+0x00000059,0x000002ae,0x000002ad,0x000000ed,
+0x0003003e,0x000002ab,0x000002ae,0x0004003d,
+0x00000006,0x000002af,0x00000273,0x0004003d,
+0x00000059,0x000002b0,0x000002ab,0x0004003d,
+0x00000059,0x000002b1,0x00000270,0x00050084,
+0x00000059,0x000002b2,0x000002b0,0x000002b1,
+0x0004003d,0x00000059,0x000002b4,0x000002ab,
+0x0005004d,0x00000059,0x000002b5,0x000002b3,
+0x000002b4,0x00050080,0x00000059,0x000002b6,
+0x000002b2,0x000002b5,0x0004003d,0x00000059,
+0x000002b7,0x00000270,0x000600cb,0x00000006,
+0x000002b8,0x000002af,0x000002b6,0x000002b7,
+0x0003003e,0x000002a2,0x000002b8,0x000200f9,
+0x000002a1,0x000200f8,0x000002a1,0x0004003d,
+0x00000006,0x000003a1,0x0000027f,0x0003003e,
+0x000003a3,0x000003a0,0x00050041,0x00000007,
+0x000003a4,0x000003a3,0x000003a1,0x0004003d,
+0x00000006,0x000003a5,0x000003a4,0x0003003e,
+0x000002b9,0x000003a5,0x0004003d,0x00000006,
+0x000003a6,0x000002b9,0x0004003d,0x00000006,
+0x000003a7,0x00000029,0x0004007c,0x00000059,
+0x000003a8,0x000003a7,0x00050084,0x00000059,
+0x000003a9,0x000000e3,0x000003a8,0x000600cb,
+0x00000006,0x000003aa,0x000003a6,0x000003a9,
+0x000000e3,0x0004003d,0x00000006,0x000003ab,
+0x00000028,0x000500c4,0x00000006,0x000003ac,
+0x000003aa,0x000003ab,0x0004003d,0x00000006,
+0x000003ad,0x000002a2,0x000500c5,0x00000006,
+0x000003ae,0x000003ac,0x000003ad,0x000200fe,
+0x000003ae,0x00010038,0x00050036,0x00000006,
+0x00000030,0x00000000,0x00000025,0x00030037,
+0x00000010,0x0000002c,0x00030037,0x00000007,
+0x0000002d,0x00030037,0x00000007,0x0000002e,
+0x00030037,0x00000007,0x0000002f,0x000200f8,
+0x00000031,0x0004003b,0x0000026f,0x000003b1,
+0x00000007,0x0004003b,0x00000007,0x000003b4,
+0x00000007,0x0004003b,0x00000010,0x000003b8,
+0x00000007,0x0004003b,0x00000007,0x000003ba,
+0x00000007,0x0004003b,0x00000007,0x000003bc,
+0x00000007,0x0004003b,0x00000007,0x000003be,
+0x00000007,0x0004003b,0x00000007,0x000003d0,
+0x00000007,0x0004003b,0x00000007,0x000003dc,
+0x00000007,0x0004003b,0x00000413,0x00000414,
+0x00000007,0x0004003d,0x00000006,0x000003b2,
+0x0000002e,0x0004007c,0x00000059,0x000003b3,
+0x000003b2,0x0003003e,0x000003b1,0x000003b3,
+0x0004003d,0x00000006,0x000003b5,0x0000002e,
+0x00050084,0x00000006,0x000003b6,0x000000b8,
+0x000003b5,0x00050080,0x00000006,0x000003b7,
+0x000003b6,0x000000b0,0x0004003d,0x0000000f,
+0x000003b9,0x0000002c,0x0003003e,0x000003b8,
+0x000003b9,0x0004003d,0x00000006,0x000003bb,
+0x0000002d,0x0003003e,0x000003ba,0x000003bb,
+0x0003003e,0x000003bc,0x000003b7,0x00070039,
+0x00000006,0x000003bd,0x0000001c,0x000003b8,
+0x000003ba,0x000003bc,0x0003003e,0x000003b4,
+0x000003bd,0x0004003d,0x00000006,0x000003bf,
+0x000003b4,0x0004003d,0x00000059,0x000003c0,
+0x000003b1,0x000600cb,0x00000006,0x000003c1,
+0x000003bf,0x000003c0,0x00000181,0x0004003d,
+0x00000006,0x000003c2,0x000003b4,0x0004003d,
+0x00000059,0x000003c3,0x000003b1,0x00050084,
+0x00000059,0x000003c4,0x000000e3,0x000003c3,
+0x00050080,0x00000059,0x000003c5,0x000003c4,
+0x00000181,0x000600cb,0x00000006,0x000003c6,
+0x000003c2,0x000003c5,0x000000e3,0x000500c4,
+0x00000006,0x000003c7,0x000003c6,0x00000181,
+0x000500c5,0x00000006,0x000003c8,0x000003c1,
+0x000003c7,0x0004003d,0x00000006,0x000003c9,
+0x000003b4,0x0004003d,0x00000059,0x000003ca,
+0x000003b1,0x00050084,0x00000059,0x000003cb,
+0x00000181,0x000003ca,0x00050080,0x00000059,
+0x000003cc,0x000003cb,0x000000f2,0x000600cb,
+0x00000006,0x000003cd,0x000003c9,0x000003cc,
+0x000000e3,0x000500c4,0x00000006,0x000003ce,
+0x000003cd,0x000000f2,0x000500c5,0x00000006,
+0x000003cf,0x000003c8,0x000003ce,0x0003003e,
+0x000003be,0x000003cf,0x0004003d,0x00000006,
+0x000003d1,0x000003b4,0x0004003d,0x00000006,
+0x000003d2,0x0000002f,0x0004007c,0x00000059,
+0x000003d3,0x000003d2,0x0004003d,0x00000059,
+0x000003d4,0x000003b1,0x00050084,0x00000059,
+0x000003d5,0x000003d3,0x000003d4,0x0004003d,
+0x00000006,0x000003d7,0x0000002f,0x0005004d,
+0x00000059,0x000003d8,0x000003d6,0x000003d7,
+0x00050080,0x00000059,0x000003d9,0x000003d5,
+0x000003d8,0x0004003d,0x00000059,0x000003da,
+0x000003b1,0x000600cb,0x00000006,0x000003db,
+0x000003d1,0x000003d9,0x000003da,0x0003003e,
+0x000003d0,0x000003db,0x0004003d,0x00000006,
+0x00000412,0x000003be,0x0003003e,0x00000414,
+0x00000411,0x00050041,0x00000007,0x00000415,
+0x00000414,0x00000412,0x0004003d,0x00000006,
+0x00000416,0x00000415,0x0003003e,0x000003dc,
+0x00000416,0x0004003d,0x00000006,0x00000417,
+0x000003dc,0x0004003d,0x00000006,0x00000418,
+0x0000002f,0x0004007c,0x00000059,0x00000419,
+0x00000418,0x00050084,0x00000059,0x0000041a,
+0x00000181,0x00000419,0x000600cb,0x00000006,
+0x0000041b,0x00000417,0x0000041a,0x00000181,
+0x0004003d,0x00000006,0x0000041c,0x0000002e,
+0x000500c4,0x00000006,0x0000041d,0x0000041b,
+0x0000041c,0x0004003d,0x00000006,0x0000041e,
+0x000003d0,0x000500c5,0x00000006,0x0000041f,
+0x0000041d,0x0000041e,0x000200fe,0x0000041f,
+0x00010038,0x00050036,0x00000006,0x00000037,
+0x00000000,0x00000032,0x00030037,0x00000010,
+0x00000033,0x00030037,0x00000009,0x00000034,
+0x00030037,0x00000007,0x00000035,0x00030037,
+0x00000007,0x00000036,0x000200f8,0x00000038,
+0x0004003b,0x00000007,0x00000428,0x00000007,
+0x0004003b,0x00000007,0x00000430,0x00000007,
+0x0004003b,0x00000007,0x00000437,0x00000007,
+0x0004003b,0x00000010,0x0000043a,0x00000007,
+0x0004003b,0x00000007,0x0000043c,0x00000007,
+0x0004003b,0x00000007,0x0000043e,0x00000007,
+0x0004003b,0x00000007,0x00000440,0x00000007,
+0x0004003b,0x00000458,0x00000459,0x00000007,
+0x0004003b,0x00000007,0x00000463,0x00000007,
+0x0004003b,0x00000007,0x0000046a,0x00000007,
+0x0004003b,0x00000010,0x0000046d,0x00000007,
+0x0004003b,0x00000007,0x0000046f,0x00000007,
+0x0004003b,0x00000007,0x00000471,0x00000007,
+0x0004003b,0x00000007,0x00000473,0x00000007,
+0x0004003b,0x00000486,0x00000487,0x00000007,
+0x0004003b,0x00000007,0x0000048c,0x00000007,
+0x0004003b,0x00000007,0x00000490,0x00000007,
+0x0004003b,0x00000010,0x00000491,0x00000007,
+0x0004003b,0x00000007,0x00000493,0x00000007,
+0x0004003b,0x00000007,0x00000495,0x00000007,
+0x0004003b,0x00000012,0x00000498,0x00000007,
+0x0004003b,0x000004a3,0x000004a4,0x00000007,
+0x0004003d,0x00000006,0x00000422,0x00000036,
+0x0004003d,0x00000006,0x00000423,0x00000035,
+0x000500ae,0x000000cf,0x00000424,0x00000422,
+0x00000423,0x000300f7,0x00000426,0x00000000,
+0x000400fa,0x00000424,0x00000425,0x00000426,
+0x000200f8,0x00000425,0x000200fe,0x000000bf,
+0x000200f8,0x00000426,0x00050041,0x00000007,
+0x00000429,0x00000034,0x000000b4,0x0004003d,
+0x00000006,0x0000042a,0x00000429,0x0003003e,
+0x00000428,0x0000042a,0x00050041,0x00000007,
+0x0000042b,0x00000034,0x000000bf,0x0004003d,
+0x00000006,0x0000042c,0x0000042b,0x000500aa,
+0x000000cf,0x0000042d,0x0000042c,0x000000c2,
+0x000300f7,0x0000042f,0x00000000,0x000400fa,
+0x0000042d,0x0000042e,0x0000045d,0x000200f8,
+0x0000042e,0x0004003d,0x00000006,0x00000431,
+0x00000036,0x00050086,0x00000006,0x00000432,
+0x00000431,0x000000b7,0x0004003d,0x00000006,
+0x00000433,0x00000428,0x00050084,0x00000006,
+0x00000434,0x000000b7,0x00000433,0x00050080,
+0x00000006,0x00000435,0x00000434,0x000000af,
+0x00050084,0x00000006,0x00000436,0x00000432,
+0x00000435,0x0003003e,0x00000430,0x00000436,
+0x0004003d,0x00000006,0x00000438,0x00000036,
+0x00050089,0x00000006,0x00000439,0x00000438,
+0x000000b7,0x0004003d,0x0000000f,0x0000043b,
+0x00000033,0x0003003e,0x0000043a,0x0000043b,
+0x0004003d,0x00000006,0x0000043d,0x00000430,
+0x0003003e,0x0000043c,0x0000043d,0x0004003d,
+0x00000006,0x0000043f,0x00000428,0x0003003e,
+0x0000043e,0x0000043f,0x0003003e,0x00000440,
+0x00000439,0x00080039,0x00000006,0x00000441,
+0x0000002a,0x0000043a,0x0000043c,0x0000043e,
+0x00000440,0x0003003e,0x00000437,0x00000441,
+0x0004003d,0x00000006,0x00000451,0x00000428,
+0x000500c4,0x00000059,0x00000452,0x000000ed,
+0x00000451,0x00050082,0x00000059,0x00000453,
+0x00000452,0x000000ed,0x00050084,0x00000059,
+0x00000454,0x00000181,0x00000453,0x0004007c,
+0x00000006,0x00000455,0x00000454,0x0004003d,
+0x00000006,0x00000456,0x00000437,0x00050080,
+0x00000006,0x00000457,0x00000455,0x00000456,
+0x0003003e,0x00000459,0x00000450,0x00050041,
+0x00000007,0x0000045a,0x00000459,0x00000457,
+0x0004003d,0x00000006,0x0000045b,0x0000045a,
+0x000200fe,0x0000045b,0x000200f8,0x0000045d,
+0x00050041,0x00000007,0x0000045e,0x00000034,
+0x000000c2,0x0004003d,0x00000006,0x0000045f,
+0x0000045e,0x000500aa,0x000000cf,0x00000460,
+0x0000045f,0x000000c2,0x000300f7,0x00000462,
+0x00000000,0x000400fa,0x00000460,0x00000461,
+0x0000048b,0x000200f8,0x00000461,0x0004003d,
+0x00000006,0x00000464,0x00000036,0x00050086,
+0x00000006,0x00000465,0x00000464,0x000000b8,
+0x0004003d,0x00000006,0x00000466,0x00000428,
+0x00050084,0x00000006,0x00000467,0x000000b8,
+0x00000466,0x00050080,0x00000006,0x00000468,
+0x00000467,0x000000b0,0x00050084,0x00000006,
+0x00000469,0x00000465,0x00000468,0x0003003e,
+0x00000463,0x00000469,0x0004003d,0x00000006,
+0x0000046b,0x00000036,0x00050089,0x00000006,
+0x0000046c,0x0000046b,0x000000b8,0x0004003d,
+0x0000000f,0x0000046e,0x00000033,0x0003003e,
+0x0000046d,0x0000046e,0x0004003d,0x00000006,
+0x00000470,0x00000463,0x0003003e,0x0000046f,
+0x00000470,0x0004003d,0x00000006,0x00000472,
+0x00000428,0x0003003e,0x00000471,0x00000472,
+0x0003003e,0x00000473,0x0000046c,0x00080039,
+0x00000006,0x00000474,0x00000030,0x0000046d,
+0x0000046f,0x00000471,0x00000473,0x0003003e,
+0x0000046a,0x00000474,0x0004003d,0x00000006,
+0x0000047f,0x00000428,0x000500c4,0x00000059,
+0x00000480,0x000000ed,0x0000047f,0x00050082,
+0x00000059,0x00000481,0x00000480,0x000000ed,
+0x00050084,0x00000059,0x00000482,0x000000f2,
+0x00000481,0x0004007c,0x00000006,0x00000483,
+0x00000482,0x0004003d,0x00000006,0x00000484,
+0x0000046a,0x00050080,0x00000006,0x00000485,
+0x00000483,0x00000484,0x0003003e,0x00000487,
+0x0000047e,0x00050041,0x00000007,0x00000488,
+0x00000487,0x00000485,0x0004003d,0x00000006,
+0x00000489,0x00000488,0x000200fe,0x00000489,
+0x000200f8,0x0000048b,0x0004003d,0x00000006,
+0x0000048d,0x00000036,0x0004003d,0x00000006,
+0x0000048e,0x00000428,0x00050084,0x00000006,
+0x0000048f,0x0000048d,0x0000048e,0x0003003e,
+0x0000048c,0x0000048f,0x0004003d,0x0000000f,
+0x00000492,0x00000033,0x0003003e,0x00000491,
+0x00000492,0x0004003d,0x00000006,0x00000494,
+0x0000048c,0x0003003e,0x00000493,0x00000494,
+0x0004003d,0x00000006,0x00000496,0x00000428,
+0x0003003e,0x00000495,0x00000496,0x00070039,
+0x00000006,0x00000497,0x0000001c,0x00000491,
+0x00000493,0x00000495,0x0003003e,0x00000490,
+0x00000497,0x0004003d,0x00000006,0x000004a1,
+0x00000428,0x00050082,0x00000006,0x000004a2,
+0x000004a1,0x000000c2,0x0003003e,0x000004a4,
+0x000004a0,0x00050041,0x00000012,0x000004a5,
+0x000004a4,0x000004a2,0x0004003d,0x00000011,
+0x000004a6,0x000004a5,0x0003003e,0x00000498,
+0x000004a6,0x0004003d,0x00000006,0x000004a7,
+0x00000490,0x00050041,0x00000007,0x000004a8,
+0x00000498,0x000000bf,0x0004003d,0x00000006,
+0x000004a9,0x000004a8,0x00050084,0x00000006,
+0x000004aa,0x000004a7,0x000004a9,0x0004003d,
+0x00000006,0x000004ab,0x00000490,0x00050041,
+0x00000007,0x000004ac,0x00000498,0x000000c2,
+0x0004003d,0x00000006,0x000004ad,0x000004ac,
+0x000500c2,0x00000006,0x000004ae,0x000004ab,
+0x000004ad,0x000500c5,0x00000006,0x000004af,
+0x000004aa,0x000004ae,0x0003003e,0x00000490,
+0x000004af,0x0004003d,0x00000006,0x000004b0,
+0x00000490,0x000500ac,0x000000cf,0x000004b1,
+0x000004b0,0x000001c3,0x000300f7,0x000004b3,
+0x00000000,0x000400fa,0x000004b1,0x000004b2,
+0x000004b3,0x000200f8,0x000004b2,0x0004003d,
+0x00000006,0x000004b4,0x00000490,0x00050080,
+0x00000006,0x000004b5,0x000004b4,0x000000c2,
+0x0003003e,0x00000490,0x000004b5,0x000200f9,
+0x000004b3,0x000200f8,0x000004b3,0x0004003d,
+0x00000006,0x000004b6,0x00000490,0x000200fe,
+0x000004b6,0x000200f8,0x00000462,0x000100ff,
+0x000200f8,0x0000042f,0x000100ff,0x00010038,
+0x00050036,0x00000006,0x00000042,0x00000000,
+0x00000039,0x00030037,0x00000010,0x0000003a,
+0x00030037,0x00000009,0x0000003b,0x00030037,
+0x00000007,0x0000003c,0x00030037,0x00000007,
+0x0000003d,0x00030037,0x00000007,0x0000003e,
+0x00030037,0x00000007,0x0000003f,0x00030037,
+0x00000007,0x00000040,0x00030037,0x00000012,
+0x00000041,0x000200f8,0x00000043,0x0004003b,
+0x00000010,0x000004b9,0x00000007,0x0004003b,
+0x00000010,0x000004c7,0x00000007,0x0004003b,
+0x00000010,0x000004c8,0x00000007,0x0004003b,
+0x00000009,0x000004ca,0x00000007,0x0004003b,
+0x00000007,0x000004cc,0x00000007,0x0004003b,
+0x00000007,0x000004ce,0x00000007,0x0004003b,
+0x00000010,0x000004d2,0x00000007,0x0004003b,
+0x00000009,0x000004d4,0x00000007,0x0004003b,
+0x00000007,0x000004d6,0x00000007,0x0004003b,
+0x00000007,0x000004d8,0x00000007,0x0004003b,
+0x00000010,0x000004dc,0x00000007,0x0004003b,
+0x00000009,0x000004de,0x00000007,0x0004003b,
+0x00000007,0x000004e0,0x00000007,0x0004003b,
+0x00000007,0x000004e2,0x00000007,0x0004003b,
+0x00000010,0x000004e6,0x00000007,0x0004003b,
+0x00000009,0x000004e8,0x00000007,0x0004003b,
+0x00000007,0x000004ea,0x00000007,0x0004003b,
+0x00000007,0x000004ec,0x00000007,0x0004003b,
+0x00000007,0x000004f1,0x00000007,0x0004003b,
+0x00000010,0x000004f9,0x00000007,0x0004003d,
+0x00000006,0x000004ba,0x0000003f,0x0004003d,
+0x00000006,0x000004bb,0x0000003d,0x00070050,
+0x0000000f,0x000004bc,0x000004bb,0x000004bb,
+0x000004bb,0x000004bb,0x0004003d,0x00000006,
+0x000004bd,0x0000003e,0x0004003d,0x00000006,
+0x000004be,0x0000003e,0x00050080,0x00000006,
+0x000004bf,0x000004be,0x000000c2,0x00070050,
+0x0000000f,0x000004c0,0x000000bf,0x000000c2,
+0x000004bd,0x000004bf,0x00050080,0x0000000f,
+0x000004c1,0x000004bc,0x000004c0,0x00070050,
+0x0000000f,0x000004c2,0x000004ba,0x000004ba,
+0x000004ba,0x000004ba,0x00050084,0x0000000f,
+0x000004c3,0x000004c2,0x000004c1,0x0004003d,
+0x00000006,0x000004c4,0x00000040,0x00070050,
+0x0000000f,0x000004c5,0x000004c4,0x000004c4,
+0x000004c4,0x000004c4,0x00050080,0x0000000f,
+0x000004c6,0x000004c3,0x000004c5,0x0003003e,
+0x000004b9,0x000004c6,0x0004003d,0x0000000f,
+0x000004c9,0x0000003a,0x0003003e,0x000004c8,
+0x000004c9,0x0004003d,0x00000008,0x000004cb,
+0x0000003b,0x0003003e,0x000004ca,0x000004cb,
+0x0004003d,0x00000006,0x000004cd,0x0000003c,
+0x0003003e,0x000004cc,0x000004cd,0x00050041,
+0x00000007,0x000004cf,0x000004b9,0x000000bf,
+0x0004003d,0x00000006,0x000004d0,0x000004cf,
+0x0003003e,0x000004ce,0x000004d0,0x00080039,
+0x00000006,0x000004d1,0x00000037,0x000004c8,
+0x000004ca,0x000004cc,0x000004ce,0x0004003d,
+0x0000000f,0x000004d3,0x0000003a,0x0003003e,
+0x000004d2,0x000004d3,0x0004003d,0x00000008,
+0x000004d5,0x0000003b,0x0003003e,0x000004d4,
+0x000004d5,0x0004003d,0x00000006,0x000004d7,
+0x0000003c,0x0003003e,0x000004d6,0x000004d7,
+0x00050041,0x00000007,0x000004d9,0x000004b9,
+0x000000c2,0x0004003d,0x00000006,0x000004da,
+0x000004d9,0x0003003e,0x000004d8,0x000004da,
+0x00080039,0x00000006,0x000004db,0x00000037,
+0x000004d2,0x000004d4,0x000004d6,0x000004d8,
+0x0004003d,0x0000000f,0x000004dd,0x0000003a,
+0x0003003e,0x000004dc,0x000004dd,0x0004003d,
+0x00000008,0x000004df,0x0000003b,0x0003003e,
+0x000004de,0x000004df,0x0004003d,0x00000006,
+0x000004e1,0x0000003c,0x0003003e,0x000004e0,
+0x000004e1,0x00050041,0x00000007,0x000004e3,
+0x000004b9,0x000000b4,0x0004003d,0x00000006,
+0x000004e4,0x000004e3,0x0003003e,0x000004e2,
+0x000004e4,0x00080039,0x00000006,0x000004e5,
+0x00000037,0x000004dc,0x000004de,0x000004e0,
+0x000004e2,0x0004003d,0x0000000f,0x000004e7,
+0x0000003a,0x0003003e,0x000004e6,0x000004e7,
+0x0004003d,0x00000008,0x000004e9,0x0000003b,
+0x0003003e,0x000004e8,0x000004e9,0x0004003d,
+0x00000006,0x000004eb,0x0000003c,0x0003003e,
+0x000004ea,0x000004eb,0x00050041,0x00000007,
+0x000004ed,0x000004b9,0x000000b8,0x0004003d,
+0x00000006,0x000004ee,0x000004ed,0x0003003e,
+0x000004ec,0x000004ee,0x00080039,0x00000006,
+0x000004ef,0x00000037,0x000004e6,0x000004e8,
+0x000004ea,0x000004ec,0x00070050,0x0000000f,
+0x000004f0,0x000004d1,0x000004db,0x000004e5,
+0x000004ef,0x0003003e,0x000004c7,0x000004f0,
+0x00050041,0x00000007,0x000004f2,0x00000041,
+0x000000bf,0x0004003d,0x00000006,0x000004f3,
+0x000004f2,0x00050041,0x00000007,0x000004f4,
+0x00000041,0x000000c2,0x0004003d,0x00000006,
+0x000004f5,0x000004f4,0x00050084,0x00000006,
+0x000004f6,0x000004f3,0x000004f5,0x00050080,
+0x00000006,0x000004f7,0x000004f6,0x000000af,
+0x000500c2,0x00000006,0x000004f8,0x000004f7,
+0x000000ec,0x0003003e,0x000004f1,0x000004f8,
+0x00050041,0x00000007,0x000004fa,0x00000041,
+0x000000bf,0x0004003d,0x00000006,0x000004fb,
+0x000004fa,0x00050082,0x00000006,0x000004fc,
+0x00000170,0x000004fb,0x00050041,0x00000007,
+0x000004fd,0x00000041,0x000000c2,0x0004003d,
+0x00000006,0x000004fe,0x000004fd,0x00050082,
+0x00000006,0x000004ff,0x000004fc,0x000004fe,
+0x0004003d,0x00000006,0x00000500,0x000004f1,
+0x00050080,0x00000006,0x00000501,0x000004ff,
+0x00000500,0x00050041,0x00000007,0x00000502,
+0x00000041,0x000000bf,0x0004003d,0x00000006,
+0x00000503,0x00000502,0x0004003d,0x00000006,
+0x00000504,0x000004f1,0x00050082,0x00000006,
+0x00000505,0x00000503,0x00000504,0x00050041,
+0x00000007,0x00000506,0x00000041,0x000000c2,
+0x0004003d,0x00000006,0x00000507,0x00000506,
+0x0004003d,0x00000006,0x00000508,0x000004f1,
+0x00050082,0x00000006,0x00000509,0x00000507,
+0x00000508,0x0004003d,0x00000006,0x0000050a,
+0x000004f1,0x00070050,0x0000000f,0x0000050b,
+0x00000501,0x00000505,0x00000509,0x0000050a,
+0x0003003e,0x000004f9,0x0000050b,0x0004003d,
+0x0000000f,0x0000050c,0x000004c7,0x00040070,
+0x0000050d,0x0000050e,0x0000050c,0x0004003d,
+0x0000000f,0x0000050f,0x000004f9,0x00040070,
+0x0000050d,0x00000510,0x0000050f,0x00050094,
+0x0000008b,0x00000511,0x0000050e,0x00000510,
+0x00050081,0x0000008b,0x00000513,0x00000511,
+0x00000512,0x0004006d,0x00000006,0x00000514,
+0x00000513,0x000500c2,0x00000006,0x00000515,
+0x00000514,0x000000ec,0x000200fe,0x00000515,
+0x00010038,0x00050036,0x00000011,0x00000047,
+0x00000000,0x00000044,0x00030037,0x00000010,
+0x00000045,0x00030037,0x00000011,0x00000046,
+0x000200f8,0x00000048,0x0004003b,0x00000012,
+0x00000518,0x00000007,0x0004003b,0x00000012,
+0x00000523,0x00000007,0x0004003b,0x00000012,
+0x00000526,0x00000007,0x0004003b,0x00000012,
+0x00000532,0x00000007,0x0004003b,0x00000012,
+0x00000536,0x00000007,0x0004003b,0x00000007,
+0x0000053b,0x00000007,0x0004003b,0x00000007,
+0x0000053e,0x00000007,0x0004003b,0x00000012,
+0x00000546,0x00000007,0x0004003b,0x00000010,
+0x0000054c,0x00000007,0x0004003b,0x00000009,
+0x0000054e,0x00000007,0x0004003b,0x00000007,
+0x00000550,0x00000007,0x0004003b,0x00000007,
+0x00000552,0x00000007,0x0004003b,0x00000007,
+0x00000554,0x00000007,0x0004003b,0x00000007,
+0x00000556,0x00000007,0x0004003b,0x00000007,
+0x00000557,0x00000007,0x0004003b,0x00000012,
+0x00000558,0x00000007,0x0004003b,0x00000010,
+0x0000055f,0x00000007,0x0004003b,0x00000009,
+0x00000561,0x00000007,0x0004003b,0x00000007,
+0x00000563,0x00000007,0x0004003b,0x00000007,
+0x00000565,0x00000007,0x0004003b,0x00000007,
+0x00000567,0x00000007,0x0004003b,0x00000007,
+0x00000569,0x00000007,0x0004003b,0x00000007,
+0x0000056a,0x00000007,0x0004003b,0x00000012,
+0x0000056b,0x00000007,0x0004003d,0x00000011,
+0x0000051a,0x000000cd,0x00050050,0x00000011,
+0x0000051b,0x000000b4,0x000000b4,0x00050086,
+0x00000011,0x0000051c,0x0000051a,0x0000051b,
+0x00050050,0x00000011,0x0000051d,0x00000519,
+0x00000519,0x00050080,0x00000011,0x0000051e,
+0x0000051d,0x0000051c,0x0004003d,0x00000011,
+0x0000051f,0x000000cd,0x00050050,0x00000011,
+0x00000520,0x000000c2,0x000000c2,0x00050082,
+0x00000011,0x00000521,0x0000051f,0x00000520,
+0x00050086,0x00000011,0x00000522,0x0000051e,
+0x00000521,0x0003003e,0x00000518,0x00000522,
+0x0004003d,0x00000011,0x00000524,0x00000518,
+0x00050084,0x00000011,0x00000525,0x00000046,
+0x00000524,0x0003003e,0x00000523,0x00000525,
+0x0004003d,0x00000011,0x00000527,0x00000523,
+0x0004003d,0x00000011,0x00000528,0x00000113,
+0x00050050,0x00000011,0x00000529,0x000000c2,
+0x000000c2,0x00050082,0x00000011,0x0000052a,
+0x00000528,0x00000529,0x00050084,0x00000011,
+0x0000052b,0x00000527,0x0000052a,0x00050050,
+0x00000011,0x0000052c,0x000001c3,0x000001c3,
+0x00050080,0x00000011,0x0000052d,0x0000052b,
+0x0000052c,0x00050050,0x0000052f,0x00000530,
+0x0000052e,0x0000052e,0x000500c2,0x00000011,
+0x00000531,0x0000052d,0x00000530,0x0003003e,
+0x00000526,0x00000531,0x0004003d,0x00000011,
+0x00000533,0x00000526,0x00050050,0x0000052f,
+0x00000534,0x000000ec,0x000000ec,0x000500c2,
+0x00000011,0x00000535,0x00000533,0x00000534,
+0x0003003e,0x00000532,0x00000535,0x0004003d,
+0x00000011,0x00000537,0x00000526,0x00050050,
+0x00000011,0x00000539,0x00000538,0x00000538,
+0x000500c7,0x00000011,0x0000053a,0x00000537,
+0x00000539,0x0003003e,0x00000536,0x0000053a,
+0x00050041,0x000000d4,0x0000053c,0x00000113,
+0x000000bf,0x0004003d,0x00000006,0x0000053d,
+0x0000053c,0x0003003e,0x0000053b,0x0000053d,
+0x00050041,0x00000007,0x0000053f,0x00000532,
+0x000000c2,0x0004003d,0x00000006,0x00000540,
+0x0000053f,0x0004003d,0x00000006,0x00000541,
+0x0000053b,0x00050084,0x00000006,0x00000542,
+0x00000540,0x00000541,0x00050041,0x00000007,
+0x00000543,0x00000532,0x000000bf,0x0004003d,
+0x00000006,0x00000544,0x00000543,0x00050080,
+0x00000006,0x00000545,0x00000542,0x00000544,
+0x0003003e,0x0000053e,0x00000545,0x0003003e,
+0x00000546,0x00000547,0x0004003d,0x000000cf,
+0x00000548,0x000000fe,0x000600a9,0x00000059,
+0x00000549,0x00000548,0x000000ed,0x000000e2,
+0x000500c4,0x00000059,0x0000054a,0x000000ed,
+0x00000549,0x0004007c,0x00000006,0x0000054b,
+0x0000054a,0x0004003d,0x0000000f,0x0000054d,
+0x00000045,0x0003003e,0x0000054c,0x0000054d,
+0x0004003d,0x00000008,0x0000054f,0x0000016f,
+0x0003003e,0x0000054e,0x0000054f,0x0004003d,
+0x00000006,0x00000551,0x00000189,0x0003003e,
+0x00000550,0x00000551,0x0004003d,0x00000006,
+0x00000553,0x0000053e,0x0003003e,0x00000552,
+0x00000553,0x0004003d,0x00000006,0x00000555,
+0x0000053b,0x0003003e,0x00000554,0x00000555,
+0x0003003e,0x00000556,0x0000054b,0x0003003e,
+0x00000557,0x000000bf,0x0004003d,0x00000011,
+0x00000559,0x00000536,0x0003003e,0x00000558,
+0x00000559,0x000c0039,0x00000006,0x0000055a,
+0x00000042,0x0000054c,0x0000054e,0x00000550,
+0x00000552,0x00000554,0x00000556,0x00000557,
+0x00000558,0x00050041,0x00000007,0x0000055b,
+0x00000546,0x000000bf,0x0003003e,0x0000055b,
+0x0000055a,0x0004003d,0x000000cf,0x0000055c,
+0x000000fe,0x000300f7,0x0000055e,0x00000000,
+0x000400fa,0x0000055c,0x0000055d,0x0000055e,
+0x000200f8,0x0000055d,0x0004003d,0x0000000f,
+0x00000560,0x00000045,0x0003003e,0x0000055f,
+0x00000560,0x0004003d,0x00000008,0x00000562,
+0x0000016f,0x0003003e,0x00000561,0x00000562,
+0x0004003d,0x00000006,0x00000564,0x00000189,
+0x0003003e,0x00000563,0x00000564,0x0004003d,
+0x00000006,0x00000566,0x0000053e,0x0003003e,
+0x00000565,0x00000566,0x0004003d,0x00000006,
+0x00000568,0x0000053b,0x0003003e,0x00000567,
+0x00000568,0x0003003e,0x00000569,0x000000b4,
+0x0003003e,0x0000056a,0x000000c2,0x0004003d,
+0x00000011,0x0000056c,0x00000536,0x0003003e,
+0x0000056b,0x0000056c,0x000c0039,0x00000006,
+0x0000056d,0x00000042,0x0000055f,0x00000561,
+0x00000563,0x00000565,0x00000567,0x00000569,
+0x0000056a,0x0000056b,0x00050041,0x00000007,
+0x0000056e,0x00000546,0x000000c2,0x0003003e,
+0x0000056e,0x0000056d,0x000200f9,0x0000055e,
+0x000200f8,0x0000055e,0x0004003d,0x00000011,
+0x0000056f,0x00000546,0x000200fe,0x0000056f,
+0x00010038,0x00050036,0x00000006,0x0000004b,
+0x00000000,0x00000049,0x00030037,0x00000007,
+0x0000004a,0x000200f8,0x0000004c,0x0004003d,
+0x00000006,0x00000572,0x0000004a,0x000500c2,
+0x00000006,0x00000574,0x00000572,0x00000573,
+0x0004003d,0x00000006,0x00000575,0x0000004a,
+0x000500c6,0x00000006,0x00000576,0x00000575,
+0x00000574,0x0003003e,0x0000004a,0x00000576,
+0x0004003d,0x00000006,0x00000577,0x0000004a,
+0x000500c4,0x00000006,0x00000579,0x00000577,
+0x00000578,0x0004003d,0x00000006,0x0000057a,
+0x0000004a,0x00050082,0x00000006,0x0000057b,
+0x0000057a,0x00000579,0x0003003e,0x0000004a,
+0x0000057b,0x0004003d,0x00000006,0x0000057c,
+0x0000004a,0x000500c4,0x00000006,0x0000057d,
+0x0000057c,0x000000f7,0x0004003d,0x00000006,
+0x0000057e,0x0000004a,0x00050080,0x00000006,
+0x0000057f,0x0000057e,0x0000057d,0x0003003e,
+0x0000004a,0x0000057f,0x0004003d,0x00000006,
+0x00000580,0x0000004a,0x000500c4,0x00000006,
+0x00000581,0x00000580,0x000000ec,0x0004003d,
+0x00000006,0x00000582,0x0000004a,0x00050080,
+0x00000006,0x00000583,0x00000582,0x00000581,
+0x0003003e,0x0000004a,0x00000583,0x0004003d,
+0x00000006,0x00000584,0x0000004a,0x000500c2,
+0x00000006,0x00000585,0x00000584,0x000000f2,
+0x0004003d,0x00000006,0x00000586,0x0000004a,
+0x000500c6,0x00000006,0x00000587,0x00000586,
+0x00000585,0x0003003e,0x0000004a,0x00000587,
+0x0004003d,0x00000006,0x00000588,0x0000004a,
+0x000500c4,0x00000006,0x0000058a,0x00000588,
+0x00000589,0x0004003d,0x00000006,0x0000058b,
+0x0000004a,0x00050080,0x00000006,0x0000058c,
+0x0000058b,0x0000058a,0x0003003e,0x0000004a,
+0x0000058c,0x0004003d,0x00000006,0x0000058d,
+0x0000004a,0x000500c2,0x00000006,0x0000058e,
+0x0000058d,0x000000f7,0x0004003d,0x00000006,
+0x0000058f,0x0000004a,0x000500c6,0x00000006,
+0x00000590,0x0000058f,0x0000058e,0x0003003e,
+0x0000004a,0x00000590,0x0004003d,0x00000006,
+0x00000591,0x0000004a,0x000500c2,0x00000006,
+0x00000592,0x00000591,0x00000181,0x0004003d,
+0x00000006,0x00000593,0x0000004a,0x000500c6,
+0x00000006,0x00000594,0x00000593,0x00000592,
+0x0003003e,0x0000004a,0x00000594,0x0004003d,
+0x00000006,0x00000595,0x0000004a,0x000500c4,
+0x00000006,0x00000596,0x00000595,0x0000052e,
+0x0004003d,0x00000006,0x00000597,0x0000004a,
+0x000500c6,0x00000006,0x00000598,0x00000597,
+0x00000596,0x0003003e,0x0000004a,0x00000598,
+0x0004003d,0x00000006,0x00000599,0x0000004a,
+0x000500c2,0x00000006,0x0000059a,0x00000599,
+0x00000578,0x0004003d,0x00000006,0x0000059b,
+0x0000004a,0x000500c6,0x00000006,0x0000059c,
+0x0000059b,0x0000059a,0x0003003e,0x0000004a,
+0x0000059c,0x0004003d,0x00000006,0x0000059d,
+0x0000004a,0x000200fe,0x0000059d,0x00010038,
+0x00050036,0x00000006,0x00000051,0x00000000,
+0x0000004d,0x00030037,0x00000007,0x0000004e,
+0x00030037,0x00000012,0x0000004f,0x00030037,
+0x00000007,0x00000050,0x000200f8,0x00000052,
+0x0004003b,0x00000007,0x000005b5,0x00000007,
+0x0004003b,0x00000007,0x000005b6,0x00000007,
+0x0004003b,0x00000010,0x000005b9,0x00000007,
+0x0004003b,0x00000010,0x000005c5,0x00000007,
+0x0004003b,0x00000012,0x000005d8,0x00000007,
+0x0004003b,0x00000010,0x000005e3,0x00000007,
+0x0004003b,0x00000010,0x000005e7,0x00000007,
+0x0004003b,0x00000010,0x000005f6,0x00000007,
+0x0004003d,0x00000006,0x000005a0,0x00000050,
+0x000500aa,0x000000cf,0x000005a1,0x000005a0,
+0x000000c2,0x000300f7,0x000005a3,0x00000000,
+0x000400fa,0x000005a1,0x000005a2,0x000005a3,
+0x000200f8,0x000005a2,0x000200fe,0x000000bf,
+0x000200f8,0x000005a3,0x00050041,0x000000d4,
+0x000005a5,0x000000cd,0x000000bf,0x0004003d,
+0x00000006,0x000005a6,0x000005a5,0x00050041,
+0x000000d4,0x000005a7,0x000000cd,0x000000c2,
+0x0004003d,0x00000006,0x000005a8,0x000005a7,
+0x00050084,0x00000006,0x000005a9,0x000005a6,
+0x000005a8,0x000500b0,0x000000cf,0x000005aa,
+0x000005a9,0x000001cf,0x000300f7,0x000005ac,
+0x00000000,0x000400fa,0x000005aa,0x000005ab,
+0x000005ac,0x000200f8,0x000005ab,0x0004003d,
+0x00000011,0x000005ad,0x0000004f,0x00050050,
+0x0000052f,0x000005ae,0x000000ed,0x000000ed,
+0x000500c4,0x00000011,0x000005af,0x000005ad,
+0x000005ae,0x0003003e,0x0000004f,0x000005af,
+0x000200f9,0x000005ac,0x000200f8,0x000005ac,
+0x0004003d,0x00000006,0x000005b0,0x00000050,
+0x00050084,0x00000006,0x000005b1,0x00000519,
+0x000005b0,0x0004003d,0x00000006,0x000005b2,
+0x0000004e,0x00050082,0x00000006,0x000005b3,
+0x000005b2,0x00000519,0x00050080,0x00000006,
+0x000005b4,0x000005b1,0x000005b3,0x0003003e,
+0x0000004e,0x000005b4,0x0004003d,0x00000006,
+0x000005b7,0x0000004e,0x0003003e,0x000005b6,
+0x000005b7,0x00050039,0x00000006,0x000005b8,
+0x0000004b,0x000005b6,0x0003003e,0x000005b5,
+0x000005b8,0x0004003d,0x00000006,0x000005ba,
+0x000005b5,0x000600cb,0x00000006,0x000005bb,
+0x000005ba,0x000000e2,0x000000ec,0x0004003d,
+0x00000006,0x000005bc,0x000005b5,0x000600cb,
+0x00000006,0x000005bd,0x000005bc,0x000000ec,
+0x000000ec,0x0004003d,0x00000006,0x000005be,
+0x000005b5,0x000600cb,0x00000006,0x000005c0,
+0x000005be,0x000005bf,0x000000ec,0x0004003d,
+0x00000006,0x000005c1,0x000005b5,0x000600cb,
+0x00000006,0x000005c3,0x000005c1,0x000005c2,
+0x000000ec,0x00070050,0x0000000f,0x000005c4,
+0x000005bb,0x000005bd,0x000005c0,0x000005c3,
+0x0003003e,0x000005b9,0x000005c4,0x0004003d,
+0x00000006,0x000005c6,0x000005b5,0x000600cb,
+0x00000006,0x000005c7,0x000005c6,0x00000589,
+0x000000ec,0x0004003d,0x00000006,0x000005c8,
+0x000005b5,0x000600cb,0x00000006,0x000005ca,
+0x000005c8,0x000005c9,0x000000ec,0x0004003d,
+0x00000006,0x000005cb,0x000005b5,0x000600cb,
+0x00000006,0x000005cd,0x000005cb,0x000005cc,
+0x000000ec,0x0004003d,0x00000006,0x000005ce,
+0x000005b5,0x000600cb,0x00000006,0x000005d0,
+0x000005ce,0x000005cf,0x000000ec,0x00070050,
+0x0000000f,0x000005d1,0x000005c7,0x000005ca,
+0x000005cd,0x000005d0,0x0003003e,0x000005c5,
+0x000005d1,0x0004003d,0x0000000f,0x000005d2,
+0x000005b9,0x0004003d,0x0000000f,0x000005d3,
+0x000005b9,0x00050084,0x0000000f,0x000005d4,
+0x000005d2,0x000005d3,0x0003003e,0x000005b9,
+0x000005d4,0x0004003d,0x0000000f,0x000005d5,
+0x000005c5,0x0004003d,0x0000000f,0x000005d6,
+0x000005c5,0x00050084,0x0000000f,0x000005d7,
+0x000005d5,0x000005d6,0x0003003e,0x000005c5,
+0x000005d7,0x0004003d,0x00000006,0x000005d9,
+0x0000004e,0x000500c7,0x00000006,0x000005da,
+0x000005d9,0x000000b4,0x000500ab,0x000000cf,
+0x000005db,0x000005da,0x000000bf,0x000600a9,
+0x00000059,0x000005dc,0x000005db,0x000000ec,
+0x000000f2,0x0004007c,0x00000006,0x000005dd,
+0x000005dc,0x0004003d,0x00000006,0x000005de,
+0x00000050,0x000500aa,0x000000cf,0x000005df,
+0x000005de,0x000000b8,0x000600a9,0x00000059,
+0x000005e0,0x000005df,0x0000052e,0x000000f2,
+0x0004007c,0x00000006,0x000005e1,0x000005e0,
+0x00050050,0x00000011,0x000005e2,0x000005dd,
+0x000005e1,0x0003003e,0x000005d8,0x000005e2,
+0x0004003d,0x00000006,0x000005e4,0x0000004e,
+0x000500c7,0x00000006,0x000005e5,0x000005e4,
+0x000000c2,0x000500ab,0x000000cf,0x000005e6,
+0x000005e5,0x000000bf,0x000300f7,0x000005e9,
+0x00000000,0x000400fa,0x000005e6,0x000005e8,
+0x000005ec,0x000200f8,0x000005e8,0x0004003d,
+0x00000011,0x000005ea,0x000005d8,0x0009004f,
+0x0000000f,0x000005eb,0x000005ea,0x000005ea,
+0x00000000,0x00000001,0x00000000,0x00000001,
+0x0003003e,0x000005e7,0x000005eb,0x000200f9,
+0x000005e9,0x000200f8,0x000005ec,0x0004003d,
+0x00000011,0x000005ed,0x000005d8,0x0009004f,
+0x0000000f,0x000005ee,0x000005ed,0x000005ed,
+0x00000001,0x00000000,0x00000001,0x00000000,
+0x0003003e,0x000005e7,0x000005ee,0x000200f9,
+0x000005e9,0x000200f8,0x000005e9,0x0004003d,
+0x0000000f,0x000005ef,0x000005e7,0x0003003e,
+0x000005e3,0x000005ef,0x0004003d,0x0000000f,
+0x000005f0,0x000005e3,0x0004003d,0x0000000f,
+0x000005f1,0x000005b9,0x000500c2,0x0000000f,
+0x000005f2,0x000005f1,0x000005f0,0x0003003e,
+0x000005b9,0x000005f2,0x0004003d,0x0000000f,
+0x000005f3,0x000005e3,0x0004003d,0x0000000f,
+0x000005f4,0x000005c5,0x000500c2,0x0000000f,
+0x000005f5,0x000005f4,0x000005f3,0x0003003e,
+0x000005c5,0x000005f5,0x0004003d,0x0000000f,
+0x000005f7,0x000005b9,0x0007004f,0x00000011,
+0x000005f8,0x000005f7,0x000005f7,0x00000000,
+0x00000001,0x00040070,0x000005f9,0x000005fa,
+0x000005f8,0x0004003d,0x00000011,0x000005fb,
+0x0000004f,0x00040070,0x000005f9,0x000005fc,
+0x000005fb,0x00050094,0x0000008b,0x000005fd,
+0x000005fa,0x000005fc,0x0004006d,0x00000006,
+0x000005fe,0x000005fd,0x0004003d,0x0000000f,
+0x000005ff,0x000005b9,0x0007004f,0x00000011,
+0x00000600,0x000005ff,0x000005ff,0x00000002,
+0x00000003,0x00040070,0x000005f9,0x00000601,
+0x00000600,0x0004003d,0x00000011,0x00000602,
+0x0000004f,0x00040070,0x000005f9,0x00000603,
+0x00000602,0x00050094,0x0000008b,0x00000604,
+0x00000601,0x00000603,0x0004006d,0x00000006,
+0x00000605,0x00000604,0x0004003d,0x0000000f,
+0x00000606,0x000005c5,0x0007004f,0x00000011,
+0x00000607,0x00000606,0x00000606,0x00000000,
+0x00000001,0x00040070,0x000005f9,0x00000608,
+0x00000607,0x0004003d,0x00000011,0x00000609,
+0x0000004f,0x00040070,0x000005f9,0x0000060a,
+0x00000609,0x00050094,0x0000008b,0x0000060b,
+0x00000608,0x0000060a,0x0004006d,0x00000006,
+0x0000060c,0x0000060b,0x0004003d,0x0000000f,
+0x0000060d,0x000005c5,0x0007004f,0x00000011,
+0x0000060e,0x0000060d,0x0000060d,0x00000002,
+0x00000003,0x00040070,0x000005f9,0x0000060f,
+0x0000060e,0x0004003d,0x00000011,0x00000610,
+0x0000004f,0x00040070,0x000005f9,0x00000611,
+0x00000610,0x00050094,0x0000008b,0x00000612,
+0x0000060f,0x00000611,0x0004006d,0x00000006,
+0x00000613,0x00000612,0x00070050,0x0000000f,
+0x00000614,0x000005fe,0x00000605,0x0000060c,
+0x00000613,0x0004003d,0x00000006,0x00000615,
+0x000005b5,0x00070050,0x0000000f,0x00000616,
+0x00000615,0x00000615,0x00000615,0x00000615,
+0x000500c2,0x0000000f,0x00000618,0x00000616,
+0x00000617,0x00050080,0x0000000f,0x00000619,
+0x00000614,0x00000618,0x0003003e,0x000005f6,
+0x00000619,0x0004003d,0x0000000f,0x0000061b,
+0x000005f6,0x000500c7,0x0000000f,0x0000061c,
+0x0000061b,0x0000061a,0x0003003e,0x000005f6,
+0x0000061c,0x0004003d,0x00000006,0x0000061d,
+0x00000050,0x000500aa,0x000000cf,0x0000061e,
+0x0000061d,0x000000b4,0x000300f7,0x00000620,
+0x00000000,0x000400fa,0x0000061e,0x0000061f,
+0x00000625,0x000200f8,0x0000061f,0x00050041,
+0x00000007,0x00000621,0x000005f6,0x000000b4,
+0x00050051,0x00000006,0x00000622,0x00000547,
+0x00000000,0x0003003e,0x00000621,0x00000622,
+0x00050041,0x00000007,0x00000623,0x000005f6,
+0x000000b8,0x00050051,0x00000006,0x00000624,
+0x00000547,0x00000001,0x0003003e,0x00000623,
+0x00000624,0x000200f9,0x00000620,0x000200f8,
+0x00000625,0x0004003d,0x00000006,0x00000626,
+0x00000050,0x000500aa,0x000000cf,0x00000627,
+0x00000626,0x000000b8,0x000300f7,0x00000629,
+0x00000000,0x000400fa,0x00000627,0x00000628,
+0x00000629,0x000200f8,0x00000628,0x00050041,
+0x00000007,0x0000062a,0x000005f6,0x000000b8,
+0x0003003e,0x0000062a,0x000000bf,0x000200f9,
+0x00000629,0x000200f8,0x00000629,0x000200f9,
+0x00000620,0x000200f8,0x00000620,0x00050041,
+0x00000007,0x0000062b,0x000005f6,0x000000bf,
+0x0004003d,0x00000006,0x0000062c,0x0000062b,
+0x00060050,0x00000008,0x0000062d,0x0000062c,
+0x0000062c,0x0000062c,0x0004003d,0x0000000f,
+0x0000062e,0x000005f6,0x0008004f,0x00000008,
+0x0000062f,0x0000062e,0x0000062e,0x00000001,
+0x00000002,0x00000003,0x000500ae,0x00000630,
+0x00000631,0x0000062d,0x0000062f,0x0004009b,
+0x000000cf,0x00000632,0x00000631,0x000300f7,
+0x00000634,0x00000000,0x000400fa,0x00000632,
+0x00000633,0x00000636,0x000200f8,0x00000633,
+0x000200fe,0x000000bf,0x000200f8,0x00000636,
+0x00050041,0x00000007,0x00000637,0x000005f6,
+0x000000c2,0x0004003d,0x00000006,0x00000638,
+0x00000637,0x00050050,0x00000011,0x00000639,
+0x00000638,0x00000638,0x0004003d,0x0000000f,
+0x0000063a,0x000005f6,0x0007004f,0x00000011,
+0x0000063b,0x0000063a,0x0000063a,0x00000002,
+0x00000003,0x000500ae,0x00000168,0x0000063c,
+0x00000639,0x0000063b,0x0004009b,0x000000cf,
+0x0000063d,0x0000063c,0x000300f7,0x0000063f,
+0x00000000,0x000400fa,0x0000063d,0x0000063e,
+0x00000641,0x000200f8,0x0000063e,0x000200fe,
+0x000000c2,0x000200f8,0x00000641,0x00050041,
+0x00000007,0x00000642,0x000005f6,0x000000b4,
+0x0004003d,0x00000006,0x00000643,0x00000642,
+0x00050041,0x00000007,0x00000644,0x000005f6,
+0x000000b8,0x0004003d,0x00000006,0x00000645,
+0x00000644,0x000500ae,0x000000cf,0x00000646,
+0x00000643,0x00000645,0x000300f7,0x00000648,
+0x00000000,0x000400fa,0x00000646,0x00000647,
+0x0000064a,0x000200f8,0x00000647,0x000200fe,
+0x000000b4,0x000200f8,0x0000064a,0x000200fe,
+0x000000b8,0x000200f8,0x00000648,0x000100ff,
+0x000200f8,0x0000063f,0x000100ff,0x000200f8,
+0x00000634,0x000100ff,0x00010038,0x00050036,
+0x00000008,0x00000057,0x00000000,0x00000053,
+0x00030037,0x00000007,0x00000054,0x00030037,
+0x00000007,0x00000055,0x00030037,0x00000007,
+0x00000056,0x000200f8,0x00000058,0x0004003b,
+0x00000007,0x0000064d,0x00000007,0x0004003b,
+0x00000009,0x00000655,0x00000007,0x0004003b,
+0x00000662,0x00000663,0x00000007,0x0004003b,
+0x00000007,0x00000666,0x00000007,0x0004003b,
+0x00000009,0x00000668,0x00000007,0x0003003e,
+0x0000064d,0x000000bf,0x000200f9,0x0000064e,
+0x000200f8,0x0000064e,0x000400f6,0x00000650,
+0x00000651,0x00000000,0x000200f9,0x00000652,
+0x000200f8,0x00000652,0x0004003d,0x00000006,
+0x00000653,0x0000064d,0x000500b0,0x000000cf,
+0x00000654,0x00000653,0x000003df,0x000400fa,
+0x00000654,0x0000064f,0x00000650,0x000200f8,
+0x0000064f,0x0004003d,0x00000006,0x00000661,
+0x0000064d,0x0003003e,0x00000663,0x00000660,
+0x00050041,0x00000009,0x00000664,0x00000663,
+0x00000661,0x0004003d,0x00000008,0x00000665,
+0x00000664,0x0003003e,0x00000655,0x00000665,
+0x0004003d,0x00000006,0x00000667,0x00000055,
+0x0003003e,0x00000666,0x00000667,0x0004003d,
+0x00000008,0x00000669,0x00000655,0x0003003e,
+0x00000668,0x00000669,0x00060039,0x00000006,
+0x0000066a,0x0000000d,0x00000666,0x00000668,
+0x0003003e,0x00000056,0x0000066a,0x0004003d,
+0x00000006,0x0000066b,0x00000056,0x0004003d,
+0x00000006,0x0000066c,0x00000054,0x000500b2,
+0x000000cf,0x0000066d,0x0000066b,0x0000066c,
+0x000300f7,0x0000066f,0x00000000,0x000400fa,
+0x0000066d,0x0000066e,0x0000066f,0x000200f8,
+0x0000066e,0x0004003d,0x00000008,0x00000670,
+0x00000655,0x000200fe,0x00000670,0x000200f8,
+0x0000066f,0x000200f9,0x00000651,0x000200f8,
+0x00000651,0x0004003d,0x00000006,0x00000672,
+0x0000064d,0x00050080,0x00000006,0x00000673,
+0x00000672,0x000000ed,0x0003003e,0x0000064d,
+0x00000673,0x000200f9,0x0000064e,0x000200f8,
+0x00000650,0x000200fe,0x00000172,0x00010038,
+0x00050036,0x0000005a,0x0000005e,0x00000000,
+0x0000005c,0x00030037,0x0000005b,0x0000005d,
+0x000200f8,0x0000005f,0x00050041,0x0000026f,
+0x00000676,0x0000005d,0x000000bf,0x0004003d,
+0x00000059,0x00000677,0x00000676,0x00050041,
+0x0000026f,0x00000678,0x0000005d,0x000000b4,
+0x0004003d,0x00000059,0x00000679,0x00000678,
+0x00050080,0x00000059,0x0000067a,0x00000677,
+0x00000679,0x000500c3,0x00000059,0x0000067b,
+0x0000067a,0x000000ed,0x00050041,0x0000026f,
+0x0000067c,0x0000005d,0x000000c2,0x0004003d,
+0x00000059,0x0000067d,0x0000067c,0x00050041,
+0x0000026f,0x0000067e,0x0000005d,0x000000b4,
+0x0004003d,0x00000059,0x0000067f,0x0000067e,
+0x00050080,0x00000059,0x00000680,0x0000067d,
+0x0000067f,0x000500c3,0x00000059,0x00000681,
+0x00000680,0x000000ed,0x0004003d,0x0000005a,
+0x00000682,0x0000005d,0x0007004f,0x0000052f,
+0x00000683,0x00000682,0x00000682,0x00000002,
+0x00000003,0x00050051,0x00000059,0x00000684,
+0x00000683,0x00000000,0x00050051,0x00000059,
+0x00000685,0x00000683,0x00000001,0x00070050,
+0x0000005a,0x00000686,0x0000067b,0x00000681,
+0x00000684,0x00000685,0x000200fe,0x00000686,
+0x00010038,0x00050036,0x00000059,0x00000064,
+0x00000000,0x00000062,0x00030037,0x00000061,
+0x00000063,0x000200f8,0x00000065,0x00050041,
+0x0000026f,0x00000689,0x00000063,0x000000bf,
+0x0004003d,0x00000059,0x0000068a,0x00000689,
+0x00050041,0x0000026f,0x0000068b,0x00000063,
+0x000000c2,0x0004003d,0x00000059,0x0000068c,
+0x0000068b,0x00050080,0x00000059,0x0000068d,
+0x0000068a,0x0000068c,0x00050041,0x0000026f,
+0x0000068e,0x00000063,0x000000b4,0x0004003d,
+0x00000059,0x0000068f,0x0000068e,0x00050080,
+0x00000059,0x00000690,0x0000068d,0x0000068f,
+0x000200fe,0x00000690,0x00010038,0x00050036,
+0x00000002,0x00000069,0x00000000,0x00000066,
+0x00030037,0x0000005b,0x00000067,0x00030037,
+0x0000005b,0x00000068,0x000200f8,0x0000006a,
+0x0004003d,0x0000005a,0x00000693,0x00000068,
+0x00070050,0x0000005a,0x00000694,0x000000ed,
+0x000000ed,0x000000ed,0x000000ed,0x000500c3,
+0x0000005a,0x00000695,0x00000693,0x00000694,
+0x0003003e,0x00000068,0x00000695,0x0004003d,
+0x0000005a,0x00000696,0x00000067,0x00070050,
+0x0000005a,0x00000698,0x00000697,0x00000697,
+0x00000697,0x00000697,0x000500c7,0x0000005a,
+0x00000699,0x00000696,0x00000698,0x0004003d,
+0x0000005a,0x0000069a,0x00000068,0x000500c5,
+0x0000005a,0x0000069b,0x0000069a,0x00000699,
+0x0003003e,0x00000068,0x0000069b,0x0004003d,
+0x0000005a,0x0000069c,0x00000067,0x00070050,
+0x0000005a,0x0000069d,0x000000ed,0x000000ed,
+0x000000ed,0x000000ed,0x000500c3,0x0000005a,
+0x0000069e,0x0000069c,0x0000069d,0x0003003e,
+0x00000067,0x0000069e,0x0004003d,0x0000005a,
+0x000006a0,0x00000067,0x00070050,0x0000005a,
+0x000006a1,0x0000069f,0x0000069f,0x0000069f,
+0x0000069f,0x000500c7,0x0000005a,0x000006a2,
+0x000006a0,0x000006a1,0x0003003e,0x00000067,
+0x000006a2,0x0004003d,0x0000005a,0x000006a3,
+0x00000067,0x000600ca,0x0000005a,0x000006a4,
+0x000006a3,0x000000e2,0x0000052e,0x0003003e,
+0x00000067,0x000006a4,0x000100fd,0x00010038,
+0x00050036,0x00000002,0x00000071,0x00000000,
+0x0000006b,0x00030037,0x0000005b,0x0000006c,
+0x00030037,0x0000005b,0x0000006d,0x00030037,
+0x00000007,0x0000006e,0x00030037,0x00000010,
+0x0000006f,0x00030037,0x00000010,0x00000070,
+0x000200f8,0x00000072,0x0004003b,0x0000026f,
+0x000006c2,0x00000007,0x0004003b,0x0000026f,
+0x000006cb,0x00000007,0x0004003b,0x0000005b,
+0x000006e9,0x00000007,0x0004003b,0x0000005b,
+0x000006eb,0x00000007,0x0004003b,0x00000061,
+0x00000738,0x00000007,0x0004003b,0x00000061,
+0x0000073c,0x00000007,0x0004003b,0x0000005b,
+0x00000748,0x00000007,0x0004003b,0x0000005b,
+0x0000074c,0x00000007,0x0004003b,0x0000005b,
+0x00000754,0x00000007,0x0004003b,0x0000005b,
+0x00000756,0x00000007,0x0004003b,0x00000061,
+0x0000075b,0x00000007,0x0004003b,0x0000005b,
+0x00000772,0x00000007,0x0004003b,0x0000005b,
+0x00000778,0x00000007,0x0004003d,0x00000006,
+0x000006a5,0x0000006e,0x000300f7,0x000006b1,
+0x00000000,0x001700fb,0x000006a5,0x000006b0,
+0x00000000,0x000006a6,0x00000001,0x000006a7,
+0x00000004,0x000006a8,0x00000005,0x000006a9,
+0x00000006,0x000006aa,0x0000000a,0x000006ab,
+0x00000008,0x000006ac,0x0000000c,0x000006ad,
+0x00000009,0x000006ae,0x0000000d,0x000006af,
+0x000200f8,0x000006b0,0x0003003e,0x0000006f,
+0x00000780,0x0003003e,0x00000070,0x00000780,
+0x000200f9,0x000006b1,0x000200f8,0x000006a6,
+0x0004003d,0x0000005a,0x000006b2,0x0000006c,
+0x0008004f,0x00000060,0x000006b3,0x000006b2,
+0x000006b2,0x00000000,0x00000000,0x00000000,
+0x0004007c,0x00000008,0x000006b4,0x000006b3,
+0x00050051,0x00000006,0x000006b6,0x000006b4,
+0x00000000,0x00050051,0x00000006,0x000006b7,
+0x000006b4,0x00000001,0x00050051,0x00000006,
+0x000006b8,0x000006b4,0x00000002,0x00070050,
+0x0000000f,0x000006b9,0x000006b6,0x000006b7,
+0x000006b8,0x000006b5,0x0003003e,0x0000006f,
+0x000006b9,0x0004003d,0x0000005a,0x000006ba,
+0x0000006d,0x0008004f,0x00000060,0x000006bb,
+0x000006ba,0x000006ba,0x00000000,0x00000000,
+0x00000000,0x0004007c,0x00000008,0x000006bc,
+0x000006bb,0x00050051,0x00000006,0x000006bd,
+0x000006bc,0x00000000,0x00050051,0x00000006,
+0x000006be,0x000006bc,0x00000001,0x00050051,
+0x00000006,0x000006bf,0x000006bc,0x00000002,
+0x00070050,0x0000000f,0x000006c0,0x000006bd,
+0x000006be,0x000006bf,0x000006b5,0x0003003e,
+0x00000070,0x000006c0,0x000100fd,0x000200f8,
+0x000006a7,0x00050041,0x0000026f,0x000006c3,
+0x0000006c,0x000000bf,0x0004003d,0x00000059,
+0x000006c4,0x000006c3,0x000500c3,0x00000059,
+0x000006c5,0x000006c4,0x000000e3,0x00050041,
+0x0000026f,0x000006c6,0x0000006d,0x000000bf,
+0x0004003d,0x00000059,0x000006c7,0x000006c6,
+0x000500c7,0x00000059,0x000006c9,0x000006c7,
+0x000006c8,0x000500c5,0x00000059,0x000006ca,
+0x000006c5,0x000006c9,0x0003003e,0x000006c2,
+0x000006ca,0x0004003d,0x00000059,0x000006cc,
+0x000006c2,0x00050041,0x0000026f,0x000006cd,
+0x0000006d,0x000000bf,0x0004003d,0x00000059,
+0x000006ce,0x000006cd,0x000500c7,0x00000059,
+0x000006cf,0x000006ce,0x0000069f,0x00050080,
+0x00000059,0x000006d0,0x000006cc,0x000006cf,
+0x0007000c,0x00000059,0x000006d2,0x00000001,
+0x00000027,0x000006d0,0x000006d1,0x0003003e,
+0x000006cb,0x000006d2,0x0004003d,0x00000059,
+0x000006d3,0x000006c2,0x0004007c,0x00000006,
+0x000006d4,0x000006d3,0x00060050,0x00000008,
+0x000006d5,0x000006d4,0x000006d4,0x000006d4,
+0x00050051,0x00000006,0x000006d6,0x000006d5,
+0x00000000,0x00050051,0x00000006,0x000006d7,
+0x000006d5,0x00000001,0x00050051,0x00000006,
+0x000006d8,0x000006d5,0x00000002,0x00070050,
+0x0000000f,0x000006d9,0x000006d6,0x000006d7,
+0x000006d8,0x000006b5,0x0003003e,0x0000006f,
+0x000006d9,0x0004003d,0x00000059,0x000006da,
+0x000006cb,0x0004007c,0x00000006,0x000006db,
+0x000006da,0x00060050,0x00000008,0x000006dc,
+0x000006db,0x000006db,0x000006db,0x00050051,
+0x00000006,0x000006dd,0x000006dc,0x00000000,
+0x00050051,0x00000006,0x000006de,0x000006dc,
+0x00000001,0x00050051,0x00000006,0x000006df,
+0x000006dc,0x00000002,0x00070050,0x0000000f,
+0x000006e0,0x000006dd,0x000006de,0x000006df,
+0x000006b5,0x0003003e,0x00000070,0x000006e0,
+0x000100fd,0x000200f8,0x000006a8,0x0004003d,
+0x0000005a,0x000006e2,0x0000006c,0x0009004f,
+0x0000005a,0x000006e3,0x000006e2,0x000006e2,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x0004007c,0x0000000f,0x000006e4,0x000006e3,
+0x0003003e,0x0000006f,0x000006e4,0x0004003d,
+0x0000005a,0x000006e5,0x0000006d,0x0009004f,
+0x0000005a,0x000006e6,0x000006e5,0x000006e5,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x0004007c,0x0000000f,0x000006e7,0x000006e6,
+0x0003003e,0x00000070,0x000006e7,0x000100fd,
+0x000200f8,0x000006a9,0x0004003d,0x0000005a,
+0x000006ea,0x0000006d,0x0003003e,0x000006e9,
+0x000006ea,0x0004003d,0x0000005a,0x000006ec,
+0x0000006c,0x0003003e,0x000006eb,0x000006ec,
+0x00060039,0x00000002,0x000006ed,0x00000069,
+0x000006e9,0x000006eb,0x0004003d,0x0000005a,
+0x000006ee,0x000006e9,0x0003003e,0x0000006d,
+0x000006ee,0x0004003d,0x0000005a,0x000006ef,
+0x000006eb,0x0003003e,0x0000006c,0x000006ef,
+0x0004003d,0x0000005a,0x000006f0,0x0000006c,
+0x0009004f,0x0000005a,0x000006f1,0x000006f0,
+0x000006f0,0x00000000,0x00000000,0x00000000,
+0x00000001,0x00070050,0x0000005a,0x000006f2,
+0x000000e2,0x000000e2,0x000000e2,0x000000e2,
+0x00070050,0x0000005a,0x000006f3,0x000006d1,
+0x000006d1,0x000006d1,0x000006d1,0x0008000c,
+0x0000005a,0x000006f4,0x00000001,0x0000002d,
+0x000006f1,0x000006f2,0x000006f3,0x0004007c,
+0x0000000f,0x000006f5,0x000006f4,0x0003003e,
+0x0000006f,0x000006f5,0x0004003d,0x0000005a,
+0x000006f6,0x0000006c,0x0009004f,0x0000005a,
+0x000006f7,0x000006f6,0x000006f6,0x00000000,
+0x00000000,0x00000000,0x00000001,0x0004003d,
+0x0000005a,0x000006f8,0x0000006d,0x0009004f,
+0x0000005a,0x000006f9,0x000006f8,0x000006f8,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x00050080,0x0000005a,0x000006fa,0x000006f7,
+0x000006f9,0x00070050,0x0000005a,0x000006fb,
+0x000000e2,0x000000e2,0x000000e2,0x000000e2,
+0x00070050,0x0000005a,0x000006fc,0x000006d1,
+0x000006d1,0x000006d1,0x000006d1,0x0008000c,
+0x0000005a,0x000006fd,0x00000001,0x0000002d,
+0x000006fa,0x000006fb,0x000006fc,0x0004007c,
+0x0000000f,0x000006fe,0x000006fd,0x0003003e,
+0x00000070,0x000006fe,0x000100fd,0x000200f8,
+0x000006aa,0x00050041,0x0000026f,0x00000700,
+0x0000006c,0x000000bf,0x0004003d,0x00000059,
+0x00000701,0x00000700,0x0004007c,0x00000006,
+0x00000702,0x00000701,0x00050041,0x0000026f,
+0x00000703,0x0000006d,0x000000bf,0x0004003d,
+0x00000059,0x00000704,0x00000703,0x0004007c,
+0x00000006,0x00000705,0x00000704,0x00050041,
+0x0000026f,0x00000706,0x0000006c,0x000000c2,
+0x0004003d,0x00000059,0x00000707,0x00000706,
+0x0004007c,0x00000006,0x00000708,0x00000707,
+0x00070050,0x0000000f,0x00000709,0x00000702,
+0x00000705,0x00000708,0x000006b5,0x0003003e,
+0x00000070,0x00000709,0x0004003d,0x0000000f,
+0x0000070a,0x00000070,0x0008004f,0x00000008,
+0x0000070b,0x0000070a,0x0000070a,0x00000000,
+0x00000001,0x00000002,0x00050041,0x0000026f,
+0x0000070c,0x0000006d,0x000000c2,0x0004003d,
+0x00000059,0x0000070d,0x0000070c,0x0004007c,
+0x00000006,0x0000070e,0x0000070d,0x00060050,
+0x00000008,0x0000070f,0x0000070e,0x0000070e,
+0x0000070e,0x00050084,0x00000008,0x00000710,
+0x0000070b,0x0000070f,0x00060050,0x00000060,
+0x00000711,0x000005bf,0x000005bf,0x000005bf,
+0x000500c2,0x00000008,0x00000712,0x00000710,
+0x00000711,0x00050051,0x00000006,0x00000713,
+0x00000712,0x00000000,0x00050051,0x00000006,
+0x00000714,0x00000712,0x00000001,0x00050051,
+0x00000006,0x00000715,0x00000712,0x00000002,
+0x00070050,0x0000000f,0x00000716,0x00000713,
+0x00000714,0x00000715,0x000006b5,0x0003003e,
+0x0000006f,0x00000716,0x000100fd,0x000200f8,
+0x000006ab,0x00050041,0x0000026f,0x00000718,
+0x0000006c,0x000000bf,0x0004003d,0x00000059,
+0x00000719,0x00000718,0x0004007c,0x00000006,
+0x0000071a,0x00000719,0x00050041,0x0000026f,
+0x0000071b,0x0000006d,0x000000bf,0x0004003d,
+0x00000059,0x0000071c,0x0000071b,0x0004007c,
+0x00000006,0x0000071d,0x0000071c,0x00050041,
+0x0000026f,0x0000071e,0x0000006c,0x000000c2,
+0x0004003d,0x00000059,0x0000071f,0x0000071e,
+0x0004007c,0x00000006,0x00000720,0x0000071f,
+0x00050041,0x0000026f,0x00000721,0x0000006d,
+0x000000b4,0x0004003d,0x00000059,0x00000722,
+0x00000721,0x0004007c,0x00000006,0x00000723,
+0x00000722,0x00070050,0x0000000f,0x00000724,
+0x0000071a,0x0000071d,0x00000720,0x00000723,
+0x0003003e,0x00000070,0x00000724,0x0004003d,
+0x0000000f,0x00000725,0x00000070,0x0008004f,
+0x00000008,0x00000726,0x00000725,0x00000725,
+0x00000000,0x00000001,0x00000002,0x00050041,
+0x0000026f,0x00000727,0x0000006d,0x000000c2,
+0x0004003d,0x00000059,0x00000728,0x00000727,
+0x0004007c,0x00000006,0x00000729,0x00000728,
+0x00060050,0x00000008,0x0000072a,0x00000729,
+0x00000729,0x00000729,0x00050084,0x00000008,
+0x0000072b,0x00000726,0x0000072a,0x00060050,
+0x00000060,0x0000072c,0x000005bf,0x000005bf,
+0x000005bf,0x000500c2,0x00000008,0x0000072d,
+0x0000072b,0x0000072c,0x00050041,0x0000026f,
+0x0000072e,0x0000006c,0x000000b4,0x0004003d,
+0x00000059,0x0000072f,0x0000072e,0x0004007c,
+0x00000006,0x00000730,0x0000072f,0x00050051,
+0x00000006,0x00000731,0x0000072d,0x00000000,
+0x00050051,0x00000006,0x00000732,0x0000072d,
+0x00000001,0x00050051,0x00000006,0x00000733,
+0x0000072d,0x00000002,0x00070050,0x0000000f,
+0x00000734,0x00000731,0x00000732,0x00000733,
+0x00000730,0x0003003e,0x0000006f,0x00000734,
+0x000100fd,0x000200f8,0x000006ac,0x00050041,
+0x0000026f,0x00000736,0x0000006c,0x000000b8,
+0x0003003e,0x00000736,0x000006d1,0x00050041,
+0x0000026f,0x00000737,0x0000006d,0x000000b8,
+0x0003003e,0x00000737,0x000006d1,0x000200f9,
+0x000006ad,0x000200f8,0x000006ad,0x0004003d,
+0x0000005a,0x00000739,0x0000006d,0x0008004f,
+0x00000060,0x0000073a,0x00000739,0x00000739,
+0x00000000,0x00000001,0x00000002,0x0003003e,
+0x00000738,0x0000073a,0x00050039,0x00000059,
+0x0000073b,0x00000064,0x00000738,0x0004003d,
+0x0000005a,0x0000073d,0x0000006c,0x0008004f,
+0x00000060,0x0000073e,0x0000073d,0x0000073d,
+0x00000000,0x00000001,0x00000002,0x0003003e,
+0x0000073c,0x0000073e,0x00050039,0x00000059,
+0x0000073f,0x00000064,0x0000073c,0x000500af,
+0x000000cf,0x00000740,0x0000073b,0x0000073f,
+0x000300f7,0x00000742,0x00000000,0x000400fa,
+0x00000740,0x00000741,0x00000747,0x000200f8,
+0x00000741,0x0004003d,0x0000005a,0x00000743,
+0x0000006c,0x0004007c,0x0000000f,0x00000744,
+0x00000743,0x0003003e,0x0000006f,0x00000744,
+0x0004003d,0x0000005a,0x00000745,0x0000006d,
+0x0004007c,0x0000000f,0x00000746,0x00000745,
+0x0003003e,0x00000070,0x00000746,0x000200f9,
+0x00000742,0x000200f8,0x00000747,0x0004003d,
+0x0000005a,0x00000749,0x0000006d,0x0003003e,
+0x00000748,0x00000749,0x00050039,0x0000005a,
+0x0000074a,0x0000005e,0x00000748,0x0004007c,
+0x0000000f,0x0000074b,0x0000074a,0x0003003e,
+0x0000006f,0x0000074b,0x0004003d,0x0000005a,
+0x0000074d,0x0000006c,0x0003003e,0x0000074c,
+0x0000074d,0x00050039,0x0000005a,0x0000074e,
+0x0000005e,0x0000074c,0x0004007c,0x0000000f,
+0x0000074f,0x0000074e,0x0003003e,0x00000070,
+0x0000074f,0x000200f9,0x00000742,0x000200f8,
+0x00000742,0x000100fd,0x000200f8,0x000006ae,
+0x00050041,0x0000026f,0x00000751,0x0000006c,
+0x000000b8,0x0003003e,0x00000751,0x000006d1,
+0x00050041,0x0000026f,0x00000753,0x0000006d,
+0x000000b8,0x0003003e,0x00000753,0x00000752,
+0x000200f9,0x000006af,0x000200f8,0x000006af,
+0x0004003d,0x0000005a,0x00000755,0x0000006d,
+0x0003003e,0x00000754,0x00000755,0x0004003d,
+0x0000005a,0x00000757,0x0000006c,0x0003003e,
+0x00000756,0x00000757,0x00060039,0x00000002,
+0x00000758,0x00000069,0x00000754,0x00000756,
+0x0004003d,0x0000005a,0x00000759,0x00000754,
+0x0003003e,0x0000006d,0x00000759,0x0004003d,
+0x0000005a,0x0000075a,0x00000756,0x0003003e,
+0x0000006c,0x0000075a,0x0004003d,0x0000005a,
+0x0000075c,0x0000006d,0x0008004f,0x00000060,
+0x0000075d,0x0000075c,0x0000075c,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x0000075b,
+0x0000075d,0x00050039,0x00000059,0x0000075e,
+0x00000064,0x0000075b,0x000500af,0x000000cf,
+0x0000075f,0x0000075e,0x000000e2,0x000300f7,
+0x00000761,0x00000000,0x000400fa,0x0000075f,
+0x00000760,0x0000076e,0x000200f8,0x00000760,
+0x0004003d,0x0000005a,0x00000762,0x0000006c,
+0x00070050,0x0000005a,0x00000763,0x000000e2,
+0x000000e2,0x000000e2,0x000000e2,0x00070050,
+0x0000005a,0x00000764,0x000006d1,0x000006d1,
+0x000006d1,0x000006d1,0x0008000c,0x0000005a,
+0x00000765,0x00000001,0x0000002d,0x00000762,
+0x00000763,0x00000764,0x0004007c,0x0000000f,
+0x00000766,0x00000765,0x0003003e,0x0000006f,
+0x00000766,0x0004003d,0x0000005a,0x00000767,
+0x0000006c,0x0004003d,0x0000005a,0x00000768,
+0x0000006d,0x00050080,0x0000005a,0x00000769,
+0x00000767,0x00000768,0x00070050,0x0000005a,
+0x0000076a,0x000000e2,0x000000e2,0x000000e2,
+0x000000e2,0x00070050,0x0000005a,0x0000076b,
+0x000006d1,0x000006d1,0x000006d1,0x000006d1,
+0x0008000c,0x0000005a,0x0000076c,0x00000001,
+0x0000002d,0x00000769,0x0000076a,0x0000076b,
+0x0004007c,0x0000000f,0x0000076d,0x0000076c,
+0x0003003e,0x00000070,0x0000076d,0x000200f9,
+0x00000761,0x000200f8,0x0000076e,0x0004003d,
+0x0000005a,0x0000076f,0x0000006c,0x0004003d,
+0x0000005a,0x00000770,0x0000006d,0x00050080,
+0x0000005a,0x00000771,0x0000076f,0x00000770,
+0x0003003e,0x00000772,0x00000771,0x00050039,
+0x0000005a,0x00000773,0x0000005e,0x00000772,
+0x00070050,0x0000005a,0x00000774,0x000000e2,
+0x000000e2,0x000000e2,0x000000e2,0x00070050,
+0x0000005a,0x00000775,0x000006d1,0x000006d1,
+0x000006d1,0x000006d1,0x0008000c,0x0000005a,
+0x00000776,0x00000001,0x0000002d,0x00000773,
+0x00000774,0x00000775,0x0004007c,0x0000000f,
+0x00000777,0x00000776,0x0003003e,0x0000006f,
+0x00000777,0x0004003d,0x0000005a,0x00000779,
+0x0000006c,0x0003003e,0x00000778,0x00000779,
+0x00050039,0x0000005a,0x0000077a,0x0000005e,
+0x00000778,0x00070050,0x0000005a,0x0000077b,
+0x000000e2,0x000000e2,0x000000e2,0x000000e2,
+0x00070050,0x0000005a,0x0000077c,0x000006d1,
+0x000006d1,0x000006d1,0x000006d1,0x0008000c,
+0x0000005a,0x0000077d,0x00000001,0x0000002d,
+0x0000077a,0x0000077b,0x0000077c,0x0004007c,
+0x0000000f,0x0000077e,0x0000077d,0x0003003e,
+0x00000070,0x0000077e,0x000200f9,0x00000761,
+0x000200f8,0x00000761,0x000100fd,0x000200f8,
+0x000006b1,0x000100fd,0x00010038,0x00050036,
+0x00000006,0x00000078,0x00000000,0x00000073,
+0x00030037,0x00000010,0x00000074,0x00030037,
+0x00000007,0x00000075,0x00030037,0x00000007,
+0x00000076,0x00030037,0x00000009,0x00000077,
+0x000200f8,0x00000079,0x0004003b,0x00000007,
+0x00000782,0x00000007,0x0004003b,0x00000007,
+0x0000078a,0x00000007,0x0004003b,0x00000007,
+0x00000793,0x00000007,0x0004003b,0x00000010,
+0x00000796,0x00000007,0x0004003b,0x00000007,
+0x00000798,0x00000007,0x0004003b,0x00000007,
+0x0000079a,0x00000007,0x0004003b,0x00000007,
+0x0000079c,0x00000007,0x0004003b,0x00000803,
+0x00000804,0x00000007,0x0004003b,0x00000007,
+0x0000080e,0x00000007,0x0004003b,0x00000007,
+0x00000817,0x00000007,0x0004003b,0x00000010,
+0x0000081a,0x00000007,0x0004003b,0x00000007,
+0x0000081c,0x00000007,0x0004003b,0x00000007,
+0x0000081e,0x00000007,0x0004003b,0x00000007,
+0x00000820,0x00000007,0x0004003b,0x00000831,
+0x00000832,0x00000007,0x0004003b,0x00000007,
+0x00000837,0x00000007,0x0004003b,0x00000007,
+0x0000083d,0x00000007,0x0004003b,0x00000010,
+0x0000083e,0x00000007,0x0004003b,0x00000007,
+0x00000840,0x00000007,0x0004003b,0x00000007,
+0x00000842,0x00000007,0x0004003b,0x00000012,
+0x00000845,0x00000007,0x0004003b,0x00000851,
+0x00000852,0x00000007,0x00050041,0x00000007,
+0x00000783,0x00000077,0x000000b4,0x0004003d,
+0x00000006,0x00000784,0x00000783,0x0003003e,
+0x00000782,0x00000784,0x00050041,0x00000007,
+0x00000785,0x00000077,0x000000bf,0x0004003d,
+0x00000006,0x00000786,0x00000785,0x000500aa,
+0x000000cf,0x00000787,0x00000786,0x000000c2,
+0x000300f7,0x00000789,0x00000000,0x000400fa,
+0x00000787,0x00000788,0x00000808,0x000200f8,
+0x00000788,0x0004003d,0x00000006,0x0000078b,
+0x00000076,0x00050086,0x00000006,0x0000078c,
+0x0000078b,0x000000b7,0x0004003d,0x00000006,
+0x0000078d,0x00000782,0x00050084,0x00000006,
+0x0000078e,0x000000b7,0x0000078d,0x00050080,
+0x00000006,0x0000078f,0x0000078e,0x000000af,
+0x00050084,0x00000006,0x00000790,0x0000078c,
+0x0000078f,0x0004003d,0x00000006,0x00000791,
+0x00000075,0x00050080,0x00000006,0x00000792,
+0x00000790,0x00000791,0x0003003e,0x0000078a,
+0x00000792,0x0004003d,0x00000006,0x00000794,
+0x00000076,0x00050089,0x00000006,0x00000795,
+0x00000794,0x000000b7,0x0004003d,0x0000000f,
+0x00000797,0x00000074,0x0003003e,0x00000796,
+0x00000797,0x0004003d,0x00000006,0x00000799,
+0x0000078a,0x0003003e,0x00000798,0x00000799,
+0x0004003d,0x00000006,0x0000079b,0x00000782,
+0x0003003e,0x0000079a,0x0000079b,0x0003003e,
+0x0000079c,0x00000795,0x00080039,0x00000006,
+0x0000079d,0x0000002a,0x00000796,0x00000798,
+0x0000079a,0x0000079c,0x0003003e,0x00000793,
+0x0000079d,0x0004003d,0x00000006,0x000007fc,
+0x00000782,0x000500c4,0x00000059,0x000007fd,
+0x000000ed,0x000007fc,0x00050082,0x00000059,
+0x000007fe,0x000007fd,0x000000ed,0x00050084,
+0x00000059,0x000007ff,0x00000181,0x000007fe,
+0x0004007c,0x00000006,0x00000800,0x000007ff,
+0x0004003d,0x00000006,0x00000801,0x00000793,
+0x00050080,0x00000006,0x00000802,0x00000800,
+0x00000801,0x0003003e,0x00000804,0x000007fb,
+0x00050041,0x00000007,0x00000805,0x00000804,
+0x00000802,0x0004003d,0x00000006,0x00000806,
+0x00000805,0x000200fe,0x00000806,0x000200f8,
+0x00000808,0x00050041,0x00000007,0x00000809,
+0x00000077,0x000000c2,0x0004003d,0x00000006,
+0x0000080a,0x00000809,0x000500aa,0x000000cf,
+0x0000080b,0x0000080a,0x000000c2,0x000300f7,
+0x0000080d,0x00000000,0x000400fa,0x0000080b,
+0x0000080c,0x00000836,0x000200f8,0x0000080c,
+0x0004003d,0x00000006,0x0000080f,0x00000076,
+0x00050086,0x00000006,0x00000810,0x0000080f,
+0x000000b8,0x0004003d,0x00000006,0x00000811,
+0x00000782,0x00050084,0x00000006,0x00000812,
+0x000000b8,0x00000811,0x00050080,0x00000006,
+0x00000813,0x00000812,0x000000b0,0x00050084,
+0x00000006,0x00000814,0x00000810,0x00000813,
+0x0004003d,0x00000006,0x00000815,0x00000075,
+0x00050080,0x00000006,0x00000816,0x00000814,
+0x00000815,0x0003003e,0x0000080e,0x00000816,
+0x0004003d,0x00000006,0x00000818,0x00000076,
+0x00050089,0x00000006,0x00000819,0x00000818,
+0x000000b8,0x0004003d,0x0000000f,0x0000081b,
+0x00000074,0x0003003e,0x0000081a,0x0000081b,
+0x0004003d,0x00000006,0x0000081d,0x0000080e,
+0x0003003e,0x0000081c,0x0000081d,0x0004003d,
+0x00000006,0x0000081f,0x00000782,0x0003003e,
+0x0000081e,0x0000081f,0x0003003e,0x00000820,
+0x00000819,0x00080039,0x00000006,0x00000821,
+0x00000030,0x0000081a,0x0000081c,0x0000081e,
+0x00000820,0x0003003e,0x00000817,0x00000821,
+0x0004003d,0x00000006,0x0000082a,0x00000782,
+0x000500c4,0x00000059,0x0000082b,0x000000ed,
+0x0000082a,0x00050082,0x00000059,0x0000082c,
+0x0000082b,0x000000ed,0x00050084,0x00000059,
+0x0000082d,0x000000f2,0x0000082c,0x0004007c,
+0x00000006,0x0000082e,0x0000082d,0x0004003d,
+0x00000006,0x0000082f,0x00000817,0x00050080,
+0x00000006,0x00000830,0x0000082e,0x0000082f,
+0x0003003e,0x00000832,0x00000829,0x00050041,
+0x00000007,0x00000833,0x00000832,0x00000830,
+0x0004003d,0x00000006,0x00000834,0x00000833,
+0x000200fe,0x00000834,0x000200f8,0x00000836,
+0x0004003d,0x00000006,0x00000838,0x00000076,
+0x0004003d,0x00000006,0x00000839,0x00000782,
+0x00050084,0x00000006,0x0000083a,0x00000838,
+0x00000839,0x0004003d,0x00000006,0x0000083b,
+0x00000075,0x00050080,0x00000006,0x0000083c,
+0x0000083a,0x0000083b,0x0003003e,0x00000837,
+0x0000083c,0x0004003d,0x0000000f,0x0000083f,
+0x00000074,0x0003003e,0x0000083e,0x0000083f,
+0x0004003d,0x00000006,0x00000841,0x00000837,
+0x0003003e,0x00000840,0x00000841,0x0004003d,
+0x00000006,0x00000843,0x00000782,0x0003003e,
+0x00000842,0x00000843,0x00070039,0x00000006,
+0x00000844,0x0000001c,0x0000083e,0x00000840,
+0x00000842,0x0003003e,0x0000083d,0x00000844,
+0x0004003d,0x00000006,0x0000084f,0x00000782,
+0x00050082,0x00000006,0x00000850,0x0000084f,
+0x000000c2,0x0003003e,0x00000852,0x0000084e,
+0x00050041,0x00000012,0x00000853,0x00000852,
+0x00000850,0x0004003d,0x00000011,0x00000854,
+0x00000853,0x0003003e,0x00000845,0x00000854,
+0x0004003d,0x00000006,0x00000855,0x0000083d,
+0x00050041,0x00000007,0x00000856,0x00000845,
+0x000000bf,0x0004003d,0x00000006,0x00000857,
+0x00000856,0x00050084,0x00000006,0x00000858,
+0x00000855,0x00000857,0x0004003d,0x00000006,
+0x00000859,0x0000083d,0x00050041,0x00000007,
+0x0000085a,0x00000845,0x000000c2,0x0004003d,
+0x00000006,0x0000085b,0x0000085a,0x000500c2,
+0x00000006,0x0000085c,0x00000859,0x0000085b,
+0x000500c5,0x00000006,0x0000085d,0x00000858,
+0x0000085c,0x000200fe,0x0000085d,0x000200f8,
+0x0000080d,0x000100ff,0x000200f8,0x00000789,
+0x000100ff,0x00010038,0x00050036,0x0000000f,
+0x0000007c,0x00000000,0x0000007a,0x00030037,
+0x00000007,0x0000007b,0x000200f8,0x0000007d,
+0x0004003b,0x0000005b,0x00000860,0x00000007,
+0x0004003b,0x00000010,0x00000869,0x00000007,
+0x0004003d,0x00000006,0x00000861,0x0000007b,
+0x0004007c,0x00000059,0x00000862,0x00000861,
+0x00070050,0x0000005a,0x00000867,0x00000862,
+0x00000862,0x00000862,0x00000862,0x00050082,
+0x0000005a,0x00000868,0x00000867,0x00000866,
+0x0003003e,0x00000860,0x00000868,0x0004003d,
+0x0000005a,0x0000086b,0x00000860,0x0008000c,
+0x0000005a,0x0000086f,0x00000001,0x0000002d,
+0x0000086b,0x0000086c,0x0000086e,0x000500c4,
+0x0000000f,0x00000870,0x0000086a,0x0000086f,
+0x00070050,0x0000000f,0x00000871,0x000000c2,
+0x000000c2,0x000000c2,0x000000c2,0x00050082,
+0x0000000f,0x00000872,0x00000870,0x00000871,
+0x0003003e,0x00000869,0x00000872,0x0004003d,
+0x0000000f,0x00000873,0x00000869,0x0004003d,
+0x00000006,0x00000876,0x0000007b,0x00070050,
+0x0000000f,0x00000877,0x00000876,0x00000876,
+0x00000876,0x00000876,0x000500ae,0x00000879,
+0x0000087a,0x00000877,0x00000878,0x000600a9,
+0x0000000f,0x0000087b,0x0000087a,0x00000875,
+0x00000873,0x000200fe,0x0000087b,0x00010038,
+0x00050036,0x0000000f,0x00000080,0x00000000,
+0x0000007e,0x00030037,0x00000011,0x0000007f,
+0x000200f8,0x00000081,0x0004003b,0x00000010,
+0x00000894,0x00000007,0x0004003b,0x00000007,
+0x00000898,0x00000007,0x0004003b,0x00000012,
+0x0000089c,0x00000007,0x0004003b,0x00000010,
+0x0000089d,0x00000007,0x0004003b,0x00000007,
+0x000008a0,0x00000007,0x0004003b,0x00000007,
+0x000008a1,0x00000007,0x0004003b,0x00000012,
+0x000008a3,0x00000007,0x0004003b,0x00000007,
+0x000008a4,0x00000007,0x0004003b,0x00000007,
+0x000008a7,0x00000007,0x0004003b,0x00000007,
+0x000008a8,0x00000007,0x0004003b,0x00000007,
+0x000008a9,0x00000007,0x0004003b,0x00000007,
+0x000008aa,0x00000007,0x0004003b,0x00000007,
+0x000008ab,0x00000007,0x0004003b,0x00000007,
+0x000008ad,0x00000007,0x0004003b,0x00000007,
+0x000008ae,0x00000007,0x0004003b,0x00000007,
+0x000008af,0x00000007,0x0004003b,0x00000007,
+0x000008b9,0x00000007,0x0004003b,0x00000007,
+0x000008bf,0x00000007,0x0004003b,0x00000007,
+0x000008c7,0x00000007,0x0004003b,0x00000009,
+0x000008cb,0x00000007,0x0004003b,0x00000007,
+0x000008cc,0x00000007,0x0004003b,0x00000007,
+0x000008cd,0x00000007,0x0004003b,0x00000007,
+0x000008cf,0x00000007,0x0004003b,0x00000007,
+0x000008d1,0x00000007,0x0004003b,0x00000007,
+0x000008d4,0x00000007,0x0004003b,0x0000005b,
+0x000008d8,0x00000007,0x0004003b,0x0000005b,
+0x000008d9,0x00000007,0x0004003b,0x00000010,
+0x000008da,0x00000007,0x0004003b,0x00000007,
+0x000008df,0x00000007,0x0004003b,0x00000007,
+0x000008e2,0x00000007,0x0004003b,0x00000007,
+0x000008eb,0x00000007,0x0004003b,0x00000010,
+0x000008f1,0x00000007,0x0004003b,0x00000007,
+0x000008f3,0x00000007,0x0004003b,0x00000007,
+0x000008f5,0x00000007,0x0004003b,0x00000009,
+0x000008f7,0x00000007,0x0004003b,0x00000010,
+0x000008ff,0x00000007,0x0004003b,0x00000007,
+0x00000901,0x00000007,0x0004003b,0x00000007,
+0x00000903,0x00000007,0x0004003b,0x00000009,
+0x00000904,0x00000007,0x0004003b,0x00000010,
+0x0000090b,0x00000007,0x0004003b,0x00000010,
+0x0000090c,0x00000007,0x0004003b,0x0000005b,
+0x0000090d,0x00000007,0x0004003b,0x0000005b,
+0x0000090f,0x00000007,0x0004003b,0x00000007,
+0x00000911,0x00000007,0x0004003b,0x00000010,
+0x00000913,0x00000007,0x0004003b,0x00000010,
+0x00000914,0x00000007,0x0004003b,0x00000010,
+0x00000918,0x00000007,0x0004003b,0x00000007,
+0x0000091f,0x00000007,0x0004003b,0x00000010,
+0x00000920,0x00000007,0x0004003b,0x00000007,
+0x00000922,0x00000007,0x0004003b,0x00000007,
+0x00000924,0x00000007,0x0004003d,0x000000cf,
+0x0000087e,0x000000d1,0x000300f7,0x00000880,
+0x00000000,0x000400fa,0x0000087e,0x0000087f,
+0x00000880,0x000200f8,0x0000087f,0x000200fe,
+0x00000881,0x000200f8,0x00000880,0x0004003d,
+0x000000cf,0x00000883,0x000000d3,0x000300f7,
+0x00000885,0x00000000,0x000400fa,0x00000883,
+0x00000884,0x00000885,0x000200f8,0x00000884,
+0x00050041,0x000000d4,0x00000886,0x000000ca,
+0x000000c2,0x0004003d,0x00000006,0x00000887,
+0x00000886,0x000600cb,0x00000006,0x00000888,
+0x00000887,0x000005bf,0x000005bf,0x00050041,
+0x000000d4,0x00000889,0x000000ca,0x000000c2,
+0x0004003d,0x00000006,0x0000088a,0x00000889,
+0x000600cb,0x00000006,0x0000088b,0x0000088a,
+0x000005cc,0x000005bf,0x00050041,0x000000d4,
+0x0000088c,0x000000ca,0x000000bf,0x0004003d,
+0x00000006,0x0000088d,0x0000088c,0x000600cb,
+0x00000006,0x0000088e,0x0000088d,0x000005bf,
+0x000005bf,0x00050041,0x000000d4,0x0000088f,
+0x000000ca,0x000000bf,0x0004003d,0x00000006,
+0x00000890,0x0000088f,0x000600cb,0x00000006,
+0x00000891,0x00000890,0x000005cc,0x000005bf,
+0x00070050,0x0000000f,0x00000892,0x00000888,
+0x0000088b,0x0000088e,0x00000891,0x000200fe,
+0x00000892,0x000200f8,0x00000885,0x0004003d,
+0x0000000f,0x00000895,0x000000ca,0x0009004f,
+0x0000000f,0x00000896,0x00000895,0x00000895,
+0x00000003,0x00000002,0x00000001,0x00000000,
+0x000400cc,0x0000000f,0x00000897,0x00000896,
+0x0004003d,0x00000006,0x00000899,0x00000192,
+0x0003003e,0x00000898,0x00000899,0x00050039,
+0x0000000f,0x0000089a,0x0000007c,0x00000898,
+0x000500c7,0x0000000f,0x0000089b,0x00000897,
+0x0000089a,0x0003003e,0x00000894,0x0000089b,
+0x0004003d,0x0000000f,0x0000089e,0x00000894,
+0x0003003e,0x0000089d,0x0000089e,0x00060039,
+0x00000011,0x0000089f,0x00000047,0x0000089d,
+0x0000007f,0x0003003e,0x0000089c,0x0000089f,
+0x0004003d,0x00000006,0x000008a2,0x000001b0,
+0x0003003e,0x000008a1,0x000008a2,0x0003003e,
+0x000008a3,0x0000007f,0x0004003d,0x00000006,
+0x000008a5,0x000001a6,0x0003003e,0x000008a4,
+0x000008a5,0x00070039,0x00000006,0x000008a6,
+0x00000051,0x000008a1,0x000008a3,0x000008a4,
+0x0003003e,0x000008a0,0x000008a6,0x0003003e,
+0x000008a7,0x000000bf,0x0003003e,0x000008a8,
+0x000000bf,0x0003003e,0x000008a9,0x000000bf,
+0x0004003d,0x00000006,0x000008ac,0x000008a0,
+0x0003003e,0x000008ab,0x000008ac,0x00080039,
+0x00000006,0x000008b0,0x00000023,0x000008ab,
+0x000008ad,0x000008ae,0x000008af,0x0004003d,
+0x00000006,0x000008b1,0x000008ad,0x0003003e,
+0x000008a7,0x000008b1,0x0004003d,0x00000006,
+0x000008b2,0x000008ae,0x0003003e,0x000008a8,
+0x000008b2,0x0004003d,0x00000006,0x000008b3,
+0x000008af,0x0003003e,0x000008a9,0x000008b3,
+0x0003003e,0x000008aa,0x000008b0,0x0004003d,
+0x00000006,0x000008b4,0x000008a8,0x000500ac,
+0x000000cf,0x000008b5,0x000008b4,0x000002c3,
+0x000300f7,0x000008b7,0x00000000,0x000400fa,
+0x000008b5,0x000008b6,0x000008b7,0x000200f8,
+0x000008b6,0x000200fe,0x00000881,0x000200f8,
+0x000008b7,0x0004003d,0x00000006,0x000008ba,
+0x000001a6,0x000500aa,0x000000cf,0x000008bb,
+0x000008ba,0x000000c2,0x000600a9,0x00000059,
+0x000008bd,0x000008bb,0x00000578,0x000008bc,
+0x0004007c,0x00000006,0x000008be,0x000008bd,
+0x0003003e,0x000008b9,0x000008be,0x0004003d,
+0x000000cf,0x000008c1,0x000000fe,0x000600a9,
+0x00000059,0x000008c2,0x000008c1,0x000000ed,
+0x000000e2,0x00050084,0x00000059,0x000008c3,
+0x000008c0,0x000008c2,0x0004007c,0x00000006,
+0x000008c4,0x000008c3,0x0004003d,0x00000006,
+0x000008c5,0x000008a7,0x00050080,0x00000006,
+0x000008c6,0x000008c4,0x000008c5,0x0003003e,
+0x000008bf,0x000008c6,0x0004003d,0x00000006,
+0x000008c8,0x000008bf,0x0004003d,0x00000006,
+0x000008c9,0x000008b9,0x00050082,0x00000006,
+0x000008ca,0x000008c8,0x000008c9,0x0003003e,
+0x000008c7,0x000008ca,0x0004003d,0x00000006,
+0x000008ce,0x000008c7,0x0003003e,0x000008cd,
+0x000008ce,0x0004003d,0x00000006,0x000008d0,
+0x000008a8,0x0003003e,0x000008cf,0x000008d0,
+0x00070039,0x00000008,0x000008d2,0x00000057,
+0x000008cd,0x000008cf,0x000008d1,0x0004003d,
+0x00000006,0x000008d3,0x000008d1,0x0003003e,
+0x000008cc,0x000008d3,0x0003003e,0x000008cb,
+0x000008d2,0x0004003d,0x00000006,0x000008d5,
+0x000008aa,0x000500c2,0x00000006,0x000008d6,
+0x000008d5,0x000000e3,0x00050080,0x00000006,
+0x000008d7,0x000008d6,0x000000c2,0x0003003e,
+0x000008d4,0x000008d7,0x0003003e,0x000008d8,
+0x0000086c,0x0003003e,0x000008d9,0x0000086c,
+0x0004003d,0x0000000f,0x000008db,0x000000ca,
+0x0004003d,0x00000006,0x000008dc,0x000008b9,
+0x0004003d,0x00000006,0x000008dd,0x000008cc,
+0x00050080,0x00000006,0x000008de,0x000008dc,
+0x000008dd,0x0003003e,0x000008df,0x000008de,
+0x00050039,0x0000000f,0x000008e0,0x0000007c,
+0x000008df,0x000500c7,0x0000000f,0x000008e1,
+0x000008db,0x000008e0,0x0003003e,0x000008da,
+0x000008e1,0x0003003e,0x000008e2,0x000000bf,
+0x000200f9,0x000008e3,0x000200f8,0x000008e3,
+0x000400f6,0x000008e5,0x000008e6,0x00000000,
+0x000200f9,0x000008e7,0x000200f8,0x000008e7,
+0x0004003d,0x00000006,0x000008e8,0x000008e2,
+0x0004003d,0x00000006,0x000008e9,0x000008d4,
+0x000500b0,0x000000cf,0x000008ea,0x000008e8,
+0x000008e9,0x000400fa,0x000008ea,0x000008e4,
+0x000008e5,0x000200f8,0x000008e4,0x0004003d,
+0x00000006,0x000008ec,0x000008e2,0x00050084,
+0x00000006,0x000008ed,0x000000b4,0x000008ec,
+0x0004003d,0x00000006,0x000008ee,0x000008a9,
+0x00050080,0x00000006,0x000008ef,0x000008ed,
+0x000008ee,0x0003003e,0x000008eb,0x000008ef,
+0x0004003d,0x00000006,0x000008f0,0x000008e2,
+0x0004003d,0x0000000f,0x000008f2,0x000008da,
+0x0003003e,0x000008f1,0x000008f2,0x0004003d,
+0x00000006,0x000008f4,0x000008b9,0x0003003e,
+0x000008f3,0x000008f4,0x0004003d,0x00000006,
+0x000008f6,0x000008eb,0x0003003e,0x000008f5,
+0x000008f6,0x0004003d,0x00000008,0x000008f8,
+0x000008cb,0x0003003e,0x000008f7,0x000008f8,
+0x00080039,0x00000006,0x000008f9,0x00000078,
+0x000008f1,0x000008f3,0x000008f5,0x000008f7,
+0x0004007c,0x00000059,0x000008fa,0x000008f9,
+0x00050041,0x0000026f,0x000008fb,0x000008d8,
+0x000008f0,0x0003003e,0x000008fb,0x000008fa,
+0x0004003d,0x00000006,0x000008fc,0x000008e2,
+0x0004003d,0x00000006,0x000008fd,0x000008eb,
+0x00050080,0x00000006,0x000008fe,0x000008fd,
+0x000000c2,0x0004003d,0x0000000f,0x00000900,
+0x000008da,0x0003003e,0x000008ff,0x00000900,
+0x0004003d,0x00000006,0x00000902,0x000008b9,
+0x0003003e,0x00000901,0x00000902,0x0003003e,
+0x00000903,0x000008fe,0x0004003d,0x00000008,
+0x00000905,0x000008cb,0x0003003e,0x00000904,
+0x00000905,0x00080039,0x00000006,0x00000906,
+0x00000078,0x000008ff,0x00000901,0x00000903,
+0x00000904,0x0004007c,0x00000059,0x00000907,
+0x00000906,0x00050041,0x0000026f,0x00000908,
+0x000008d9,0x000008fc,0x0003003e,0x00000908,
+0x00000907,0x000200f9,0x000008e6,0x000200f8,
+0x000008e6,0x0004003d,0x00000006,0x00000909,
+0x000008e2,0x00050080,0x00000006,0x0000090a,
+0x00000909,0x000000ed,0x0003003e,0x000008e2,
+0x0000090a,0x000200f9,0x000008e3,0x000200f8,
+0x000008e5,0x0004003d,0x0000005a,0x0000090e,
+0x000008d8,0x0003003e,0x0000090d,0x0000090e,
+0x0004003d,0x0000005a,0x00000910,0x000008d9,
+0x0003003e,0x0000090f,0x00000910,0x0004003d,
+0x00000006,0x00000912,0x000008aa,0x0003003e,
+0x00000911,0x00000912,0x00090039,0x00000002,
+0x00000915,0x00000071,0x0000090d,0x0000090f,
+0x00000911,0x00000913,0x00000914,0x0004003d,
+0x0000000f,0x00000916,0x00000913,0x0003003e,
+0x0000090b,0x00000916,0x0004003d,0x0000000f,
+0x00000917,0x00000914,0x0003003e,0x0000090c,
+0x00000917,0x00050041,0x00000007,0x00000919,
+0x0000089c,0x000000bf,0x0004003d,0x00000006,
+0x0000091a,0x00000919,0x00070050,0x0000000f,
+0x0000091b,0x0000091a,0x0000091a,0x0000091a,
+0x0000091a,0x0003003e,0x00000918,0x0000091b,
+0x0004003d,0x000000cf,0x0000091c,0x000000fe,
+0x000300f7,0x0000091e,0x00000000,0x000400fa,
+0x0000091c,0x0000091d,0x0000091e,0x000200f8,
+0x0000091d,0x0004003d,0x0000000f,0x00000921,
+0x000000ca,0x0003003e,0x00000920,0x00000921,
+0x0004003d,0x00000006,0x00000923,0x000008bf,
+0x0003003e,0x00000922,0x00000923,0x0003003e,
+0x00000924,0x000000b4,0x00070039,0x00000006,
+0x00000925,0x0000001c,0x00000920,0x00000922,
+0x00000924,0x0003003e,0x0000091f,0x00000925,
+0x0004003d,0x00000006,0x00000926,0x0000091f,
+0x00050041,0x00000007,0x00000927,0x0000089c,
+0x000000c2,0x0004003d,0x00000006,0x00000928,
+0x00000927,0x00050041,0x00000007,0x00000929,
+0x00000918,0x00000926,0x0003003e,0x00000929,
+0x00000928,0x000200f9,0x0000091e,0x000200f8,
+0x0000091e,0x0004003d,0x0000000f,0x0000092a,
+0x0000090b,0x0004003d,0x0000000f,0x0000092b,
+0x00000918,0x00070050,0x0000000f,0x0000092c,
+0x000001a0,0x000001a0,0x000001a0,0x000001a0,
+0x00050082,0x0000000f,0x0000092d,0x0000092c,
+0x0000092b,0x00050084,0x0000000f,0x0000092e,
+0x0000092a,0x0000092d,0x0004003d,0x0000000f,
+0x0000092f,0x0000090c,0x0004003d,0x0000000f,
+0x00000930,0x00000918,0x00050084,0x0000000f,
+0x00000931,0x0000092f,0x00000930,0x00050080,
+0x0000000f,0x00000932,0x0000092e,0x00000931,
+0x00070050,0x0000000f,0x00000933,0x000001c3,
+0x000001c3,0x000001c3,0x000001c3,0x00050080,
+0x0000000f,0x00000934,0x00000932,0x00000933,
+0x00070050,0x0000005a,0x00000935,0x0000052e,
+0x0000052e,0x0000052e,0x0000052e,0x000500c2,
+0x0000000f,0x00000936,0x00000934,0x00000935,
+0x000200fe,0x00000936,0x00010038,0x00050036,
+0x00000060,0x00000084,0x00000000,0x00000082,
+0x00030037,0x00000061,0x00000083,0x000200f8,
+0x00000085,0x0004003d,0x00000060,0x00000939,
+0x00000083,0x000200fe,0x00000939,0x00010038,
+0x00050036,0x0000000f,0x00000089,0x00000000,
+0x00000086,0x00030037,0x00000012,0x00000087,
+0x00030037,0x00000007,0x00000088,0x000200f8,
+0x0000008a,0x0004003b,0x00000012,0x0000093c,
+0x00000007,0x0004003b,0x00000012,0x00000945,
+0x00000007,0x0004003b,0x00000061,0x00000955,
+0x00000007,0x0004003b,0x00000010,0x00000959,
+0x00000007,0x0004003b,0x00000012,0x0000095b,
+0x00000007,0x0004003d,0x00000011,0x0000093d,
+0x00000087,0x00050041,0x00000941,0x00000942,
+0x00000940,0x000000e2,0x0004003d,0x00000011,
+0x00000943,0x00000942,0x00050086,0x00000011,
+0x00000944,0x0000093d,0x00000943,0x0003003e,
+0x0000093c,0x00000944,0x0004003d,0x00000011,
+0x00000946,0x00000087,0x00050041,0x00000941,
+0x00000947,0x00000940,0x000000e2,0x0004003d,
+0x00000011,0x00000948,0x00000947,0x00050089,
+0x00000011,0x00000949,0x00000946,0x00000948,
+0x0003003e,0x00000945,0x00000949,0x0004003d,
+0x0000094a,0x0000094d,0x0000094c,0x0004003d,
+0x00000011,0x0000094e,0x0000093c,0x0004007c,
+0x0000052f,0x0000094f,0x0000094e,0x0004003d,
+0x00000006,0x00000950,0x00000088,0x0004007c,
+0x00000059,0x00000951,0x00000950,0x00050051,
+0x00000059,0x00000952,0x0000094f,0x00000000,
+0x00050051,0x00000059,0x00000953,0x0000094f,
+0x00000001,0x00060050,0x00000060,0x00000954,
+0x00000952,0x00000953,0x00000951,0x0003003e,
+0x00000955,0x00000954,0x00050039,0x00000060,
+0x00000956,0x00000084,0x00000955,0x00050062,
+0x0000000f,0x00000957,0x0000094d,0x00000956,
+0x0009004f,0x0000000f,0x00000958,0x00000957,
+0x00000957,0x00000003,0x00000002,0x00000001,
+0x00000000,0x0003003e,0x000000ca,0x00000958,
+0x0004003d,0x0000000f,0x0000095a,0x000000ca,
+0x0003003e,0x00000959,0x0000095a,0x00050041,
+0x00000941,0x0000095c,0x00000940,0x000000e2,
+0x0004003d,0x00000011,0x0000095d,0x0000095c,
+0x0003003e,0x0000095b,0x0000095d,0x00060039,
+0x00000002,0x0000095e,0x00000016,0x00000959,
+0x0000095b,0x0004003d,0x00000011,0x0000095f,
+0x00000945,0x00050039,0x0000000f,0x00000960,
+0x00000080,0x0000095f,0x000200fe,0x00000960,
+0x00010038,0x00050036,0x00000006,0x00000092,
+0x00000000,0x0000008e,0x00030037,0x0000008d,
+0x0000008f,0x00030037,0x0000008d,0x00000090,
+0x00030037,0x0000008d,0x00000091,0x000200f8,
+0x00000093,0x0004003b,0x0000008d,0x00000963,
+0x00000007,0x0004003b,0x00000967,0x00000968,
+0x00000007,0x0004003b,0x0000026f,0x00000972,
+0x00000007,0x0004003d,0x0000008c,0x00000964,
+0x00000091,0x0004003d,0x0000008c,0x00000965,
+0x00000090,0x00050083,0x0000008c,0x00000966,
+0x00000964,0x00000965,0x0003003e,0x00000963,
+0x00000966,0x0004003d,0x0000008c,0x00000969,
+0x0000008f,0x0004003d,0x0000008c,0x0000096a,
+0x00000090,0x00050083,0x0000008c,0x0000096b,
+0x00000969,0x0000096a,0x0004003d,0x0000008c,
+0x0000096c,0x00000963,0x00050094,0x0000008b,
+0x0000096d,0x0000096b,0x0000096c,0x0004003d,
+0x0000008c,0x0000096e,0x00000963,0x0004003d,
+0x0000008c,0x0000096f,0x00000963,0x00050094,
+0x0000008b,0x00000970,0x0000096e,0x0000096f,
+0x00050088,0x0000008b,0x00000971,0x0000096d,
+0x00000970,0x0003003e,0x00000968,0x00000971,
+0x0004003d,0x0000008b,0x00000973,0x00000968,
+0x00050085,0x0000008b,0x00000975,0x00000973,
+0x00000974,0x0008000c,0x0000008b,0x00000977,
+0x00000001,0x0000002b,0x00000975,0x00000976,
+0x00000974,0x0006000c,0x0000008b,0x00000978,
+0x00000001,0x00000001,0x00000977,0x0004006e,
+0x00000059,0x00000979,0x00000978,0x0003003e,
+0x00000972,0x00000979,0x0004003d,0x00000059,
+0x0000097a,0x00000972,0x00050084,0x00000059,
+0x0000097b,0x0000097a,0x000000e3,0x000600cb,
+0x00000006,0x0000097c,0x00000442,0x0000097b,
+0x000000e3,0x000200fe,0x0000097c,0x00010038,
+0x00050036,0x00000006,0x00000098,0x00000000,
+0x00000094,0x00030037,0x00000007,0x00000095,
+0x00030037,0x00000007,0x00000096,0x00030037,
+0x00000007,0x00000097,0x000200f8,0x00000099,
+0x0004003b,0x00000967,0x0000097f,0x00000007,
+0x0004003b,0x0000026f,0x00000989,0x00000007,
+0x0004003d,0x00000006,0x00000980,0x00000095,
+0x0004003d,0x00000006,0x00000981,0x00000096,
+0x00050082,0x00000006,0x00000982,0x00000980,
+0x00000981,0x00040070,0x0000008b,0x00000983,
+0x00000982,0x0004003d,0x00000006,0x00000984,
+0x00000097,0x0004003d,0x00000006,0x00000985,
+0x00000096,0x00050082,0x00000006,0x00000986,
+0x00000984,0x00000985,0x00040070,0x0000008b,
+0x00000987,0x00000986,0x00050088,0x0000008b,
+0x00000988,0x00000983,0x00000987,0x0003003e,
+0x0000097f,0x00000988,0x0004003d,0x0000008b,
+0x0000098a,0x0000097f,0x00050085,0x0000008b,
+0x0000098c,0x0000098a,0x0000098b,0x0008000c,
+0x0000008b,0x0000098d,0x00000001,0x0000002b,
+0x0000098c,0x00000976,0x0000098b,0x0006000c,
+0x0000008b,0x0000098e,0x00000001,0x00000001,
+0x0000098d,0x0004006e,0x00000059,0x0000098f,
+0x0000098e,0x0003003e,0x00000989,0x0000098f,
+0x0004003d,0x00000059,0x00000991,0x00000989,
+0x00050084,0x00000059,0x00000992,0x00000991,
+0x000000ec,0x000600cb,0x00000006,0x00000993,
+0x00000990,0x00000992,0x00000181,0x000200fe,
+0x00000993,0x00010038,0x00050036,0x00000002,
+0x0000009e,0x00000000,0x0000009a,0x00030037,
+0x00000009,0x0000009b,0x00030037,0x00000009,
+0x0000009c,0x00030037,0x00000009,0x0000009d,
+0x000200f8,0x0000009f,0x0004003b,0x00000009,
+0x00000996,0x00000007,0x0004003b,0x00000009,
+0x0000099d,0x00000007,0x0004003b,0x00000009,
+0x000009a0,0x00000007,0x0004003b,0x00000061,
+0x000009ac,0x00000007,0x0004003b,0x0000008d,
+0x000009b2,0x00000007,0x0004003b,0x0000008d,
+0x000009ba,0x00000007,0x0004003b,0x000009c3,
+0x000009c4,0x00000007,0x0004003b,0x0000008d,
+0x000009e2,0x00000007,0x0004003b,0x00000967,
+0x000009ef,0x00000007,0x0004003b,0x0000008d,
+0x000009fe,0x00000007,0x0004003b,0x00000967,
+0x00000a0b,0x00000007,0x0004003b,0x00000967,
+0x00000a10,0x00000007,0x0004003b,0x00000967,
+0x00000a13,0x00000007,0x0004003b,0x00000012,
+0x00000a16,0x00000007,0x0004003b,0x00000012,
+0x00000a24,0x00000007,0x0004003d,0x00000008,
+0x00000997,0x0000009b,0x0007015d,0x00000008,
+0x00000998,0x000000b8,0x00000003,0x00000997,
+0x00000170,0x00060050,0x00000008,0x00000999,
+0x000000af,0x000000af,0x000000af,0x00050080,
+0x00000008,0x0000099a,0x00000998,0x00000999,
+0x00060050,0x00000060,0x0000099b,0x000000ec,
+0x000000ec,0x000000ec,0x000500c2,0x00000008,
+0x0000099c,0x0000099a,0x0000099b,0x0003003e,
+0x00000996,0x0000099c,0x0004003d,0x00000008,
+0x0000099e,0x0000009b,0x00070162,0x00000008,
+0x0000099f,0x000000b8,0x00000003,0x0000099e,
+0x00000170,0x0003003e,0x0000099d,0x0000099f,
+0x0004003d,0x00000008,0x000009a1,0x0000009b,
+0x00070165,0x00000008,0x000009a2,0x000000b8,
+0x00000003,0x000009a1,0x00000170,0x0003003e,
+0x000009a0,0x000009a2,0x0004003d,0x00000008,
+0x000009a3,0x0000099d,0x0004003d,0x00000008,
+0x000009a4,0x000009a0,0x000500aa,0x00000630,
+0x000009a5,0x000009a3,0x000009a4,0x0004009b,
+0x000000cf,0x000009a6,0x000009a5,0x000300f7,
+0x000009a8,0x00000000,0x000400fa,0x000009a6,
+0x000009a7,0x000009a8,0x000200f8,0x000009a7,
+0x0004003d,0x00000008,0x000009a9,0x0000099d,
+0x0003003e,0x0000009c,0x000009a9,0x0004003d,
+0x00000008,0x000009aa,0x0000099d,0x0003003e,
+0x0000009d,0x000009aa,0x000100fd,0x000200f8,
+0x000009a8,0x0004003d,0x00000008,0x000009ad,
+0x0000009b,0x0004007c,0x00000060,0x000009ae,
+0x000009ad,0x0004003d,0x00000008,0x000009af,
+0x00000996,0x0004007c,0x00000060,0x000009b0,
+0x000009af,0x00050082,0x00000060,0x000009b1,
+0x000009ae,0x000009b0,0x0003003e,0x000009ac,
+0x000009b1,0x00050041,0x0000026f,0x000009b3,
+0x000009ac,0x000000bf,0x0004003d,0x00000059,
+0x000009b4,0x000009b3,0x0004003d,0x00000060,
+0x000009b5,0x000009ac,0x00060050,0x00000060,
+0x000009b6,0x000009b4,0x000009b4,0x000009b4,
+0x00050084,0x00000060,0x000009b7,0x000009b6,
+0x000009b5,0x0007015d,0x00000060,0x000009b8,
+0x000000b8,0x00000003,0x000009b7,0x00000170,
+0x0004006f,0x0000008c,0x000009b9,0x000009b8,
+0x0003003e,0x000009b2,0x000009b9,0x0004003d,
+0x00000060,0x000009bb,0x000009ac,0x0008004f,
+0x00000060,0x000009bc,0x000009bb,0x000009bb,
+0x00000001,0x00000001,0x00000002,0x0004003d,
+0x00000060,0x000009bd,0x000009ac,0x0008004f,
+0x00000060,0x000009be,0x000009bd,0x000009bd,
+0x00000001,0x00000002,0x00000002,0x00050084,
+0x00000060,0x000009bf,0x000009bc,0x000009be,
+0x0007015d,0x00000060,0x000009c0,0x000000b8,
+0x00000003,0x000009bf,0x00000170,0x0004006f,
+0x0000008c,0x000009c1,0x000009c0,0x0003003e,
+0x000009ba,0x000009c1,0x0004003d,0x0000008c,
+0x000009c5,0x000009b2,0x00050041,0x00000967,
+0x000009c6,0x000009b2,0x000000c2,0x0004003d,
+0x0000008b,0x000009c7,0x000009c6,0x0004003d,
+0x0000008c,0x000009c8,0x000009ba,0x0007004f,
+0x000005f9,0x000009c9,0x000009c8,0x000009c8,
+0x00000000,0x00000001,0x00050051,0x0000008b,
+0x000009ca,0x000009c9,0x00000000,0x00050051,
+0x0000008b,0x000009cb,0x000009c9,0x00000001,
+0x00060050,0x0000008c,0x000009cc,0x000009c7,
+0x000009ca,0x000009cb,0x00050041,0x00000967,
+0x000009cd,0x000009b2,0x000000b4,0x0004003d,
+0x0000008b,0x000009ce,0x000009cd,0x0004003d,
+0x0000008c,0x000009cf,0x000009ba,0x0007004f,
+0x000005f9,0x000009d0,0x000009cf,0x000009cf,
+0x00000001,0x00000002,0x00050051,0x0000008b,
+0x000009d1,0x000009d0,0x00000000,0x00050051,
+0x0000008b,0x000009d2,0x000009d0,0x00000001,
+0x00060050,0x0000008c,0x000009d3,0x000009ce,
+0x000009d1,0x000009d2,0x00050051,0x0000008b,
+0x000009d5,0x000009c5,0x00000000,0x00050051,
+0x0000008b,0x000009d6,0x000009c5,0x00000001,
+0x00050051,0x0000008b,0x000009d7,0x000009c5,
+0x00000002,0x00050051,0x0000008b,0x000009d8,
+0x000009cc,0x00000000,0x00050051,0x0000008b,
+0x000009d9,0x000009cc,0x00000001,0x00050051,
+0x0000008b,0x000009da,0x000009cc,0x00000002,
+0x00050051,0x0000008b,0x000009db,0x000009d3,
+0x00000000,0x00050051,0x0000008b,0x000009dc,
+0x000009d3,0x00000001,0x00050051,0x0000008b,
+0x000009dd,0x000009d3,0x00000002,0x00060050,
+0x0000008c,0x000009de,0x000009d5,0x000009d6,
+0x000009d7,0x00060050,0x0000008c,0x000009df,
+0x000009d8,0x000009d9,0x000009da,0x00060050,
+0x0000008c,0x000009e0,0x000009db,0x000009dc,
+0x000009dd,0x00060050,0x000009c2,0x000009e1,
+0x000009de,0x000009df,0x000009e0,0x0003003e,
+0x000009c4,0x000009e1,0x0004003d,0x000009c2,
+0x000009e3,0x000009c4,0x0004003d,0x000009c2,
+0x000009e4,0x000009c4,0x0004003d,0x000009c2,
+0x000009e5,0x000009c4,0x0004003d,0x000009c2,
+0x000009e6,0x000009c4,0x0004003d,0x00000008,
+0x000009e7,0x000009a0,0x0004003d,0x00000008,
+0x000009e8,0x0000099d,0x00050082,0x00000008,
+0x000009e9,0x000009e7,0x000009e8,0x00040070,
+0x0000008c,0x000009ea,0x000009e9,0x00050091,
+0x0000008c,0x000009eb,0x000009e6,0x000009ea,
+0x00050091,0x0000008c,0x000009ec,0x000009e5,
+0x000009eb,0x00050091,0x0000008c,0x000009ed,
+0x000009e4,0x000009ec,0x00050091,0x0000008c,
+0x000009ee,0x000009e3,0x000009ed,0x0003003e,
+0x000009e2,0x000009ee,0x00050041,0x00000967,
+0x000009f0,0x000009e2,0x000000bf,0x0004003d,
+0x0000008b,0x000009f1,0x000009f0,0x0006000c,
+0x0000008b,0x000009f2,0x00000001,0x00000004,
+0x000009f1,0x00050041,0x00000967,0x000009f3,
+0x000009e2,0x000000c2,0x0004003d,0x0000008b,
+0x000009f4,0x000009f3,0x0006000c,0x0000008b,
+0x000009f5,0x00000001,0x00000004,0x000009f4,
+0x0007000c,0x0000008b,0x000009f6,0x00000001,
+0x00000028,0x000009f2,0x000009f5,0x00050041,
+0x00000967,0x000009f7,0x000009e2,0x000000b4,
+0x0004003d,0x0000008b,0x000009f8,0x000009f7,
+0x0006000c,0x0000008b,0x000009f9,0x00000001,
+0x00000004,0x000009f8,0x0007000c,0x0000008b,
+0x000009fa,0x00000001,0x00000028,0x000009f6,
+0x000009f9,0x0003003e,0x000009ef,0x000009fa,
+0x0004003d,0x0000008b,0x000009fb,0x000009ef,
+0x000500b8,0x000000cf,0x000009fd,0x000009fb,
+0x000009fc,0x000300f7,0x00000a00,0x00000000,
+0x000400fa,0x000009fd,0x000009ff,0x00000a05,
+0x000200f8,0x000009ff,0x0003003e,0x000009fe,
+0x00000a04,0x000200f9,0x00000a00,0x000200f8,
+0x00000a05,0x0004003d,0x0000008c,0x00000a06,
+0x000009e2,0x0004003d,0x0000008b,0x00000a07,
+0x000009ef,0x00060050,0x0000008c,0x00000a08,
+0x00000a07,0x00000a07,0x00000a07,0x00050088,
+0x0000008c,0x00000a09,0x00000a06,0x00000a08,
+0x0003003e,0x000009fe,0x00000a09,0x000200f9,
+0x00000a00,0x000200f8,0x00000a00,0x0004003d,
+0x0000008c,0x00000a0a,0x000009fe,0x0003003e,
+0x000009e2,0x00000a0a,0x0004003d,0x00000008,
+0x00000a0c,0x0000009b,0x00040070,0x0000008c,
+0x00000a0d,0x00000a0c,0x0004003d,0x0000008c,
+0x00000a0e,0x000009e2,0x00050094,0x0000008b,
+0x00000a0f,0x00000a0d,0x00000a0e,0x0003003e,
+0x00000a0b,0x00000a0f,0x0004003d,0x0000008b,
+0x00000a11,0x00000a0b,0x00070163,0x0000008b,
+0x00000a12,0x000000b8,0x00000003,0x00000a11,
+0x00000170,0x0003003e,0x00000a10,0x00000a12,
+0x0004003d,0x0000008b,0x00000a14,0x00000a0b,
+0x00070166,0x0000008b,0x00000a15,0x000000b8,
+0x00000003,0x00000a14,0x00000170,0x0003003e,
+0x00000a13,0x00000a15,0x0004003d,0x0000008b,
+0x00000a17,0x00000a0b,0x0004003d,0x0000008b,
+0x00000a18,0x00000a10,0x000500b4,0x000000cf,
+0x00000a19,0x00000a17,0x00000a18,0x0004003d,
+0x00000006,0x00000a1c,0x00000a1b,0x000600a9,
+0x00000006,0x00000a1d,0x00000a19,0x00000a1c,
+0x000000bf,0x0004003d,0x0000008b,0x00000a1e,
+0x00000a0b,0x0004003d,0x0000008b,0x00000a1f,
+0x00000a13,0x000500b4,0x000000cf,0x00000a20,
+0x00000a1e,0x00000a1f,0x0004003d,0x00000006,
+0x00000a21,0x00000a1b,0x000600a9,0x00000006,
+0x00000a22,0x00000a20,0x00000a21,0x000000bf,
+0x00050050,0x00000011,0x00000a23,0x00000a1d,
+0x00000a22,0x0003003e,0x00000a16,0x00000a23,
+0x0004003d,0x00000011,0x00000a25,0x00000a16,
+0x00070165,0x00000011,0x00000a26,0x000000b8,
+0x00000003,0x00000a25,0x00000170,0x0003003e,
+0x00000a24,0x00000a26,0x0004003d,0x00000008,
+0x00000a27,0x0000009b,0x00050041,0x00000007,
+0x00000a28,0x00000a24,0x000000bf,0x0004003d,
+0x00000006,0x00000a29,0x00000a28,0x00060159,
+0x00000008,0x00000a2a,0x000000b8,0x00000a27,
+0x00000a29,0x0003003e,0x0000009c,0x00000a2a,
+0x0004003d,0x00000008,0x00000a2b,0x0000009b,
+0x00050041,0x00000007,0x00000a2c,0x00000a24,
+0x000000c2,0x0004003d,0x00000006,0x00000a2d,
+0x00000a2c,0x00060159,0x00000008,0x00000a2e,
+0x000000b8,0x00000a2b,0x00000a2d,0x0003003e,
+0x0000009d,0x00000a2e,0x000100fd,0x00010038,
+0x00050036,0x00000011,0x000000a3,0x00000000,
+0x000000a0,0x00030037,0x00000007,0x000000a1,
+0x00030037,0x00000007,0x000000a2,0x000200f8,
+0x000000a4,0x0004003b,0x00000007,0x00000a2f,
+0x00000007,0x0004003b,0x00000007,0x00000a32,
+0x00000007,0x0004003b,0x00000007,0x00000a35,
+0x00000007,0x0004003b,0x00000007,0x00000a39,
+0x00000007,0x0004003b,0x00000007,0x00000a3c,
+0x00000007,0x0004003b,0x00000007,0x00000a3e,
+0x00000007,0x0004003b,0x00000007,0x00000a40,
+0x00000007,0x0004003b,0x00000012,0x00000a45,
+0x00000007,0x0004003b,0x00000007,0x00000a48,
+0x00000007,0x0004003b,0x00000007,0x00000a56,
+0x00000007,0x0004003b,0x00000012,0x00000a61,
+0x00000007,0x0004003d,0x00000006,0x00000a30,
+0x000000a1,0x00070162,0x00000006,0x00000a31,
+0x000000b8,0x00000003,0x00000a30,0x00000170,
+0x0003003e,0x00000a2f,0x00000a31,0x0004003d,
+0x00000006,0x00000a33,0x000000a1,0x00070165,
+0x00000006,0x00000a34,0x000000b8,0x00000003,
+0x00000a33,0x00000170,0x0003003e,0x00000a32,
+0x00000a34,0x0004003d,0x00000006,0x00000a36,
+0x00000a2f,0x0004003d,0x00000006,0x00000a37,
+0x00000a32,0x000500ab,0x000000cf,0x00000a38,
+0x00000a36,0x00000a37,0x000300f7,0x00000a3b,
+0x00000000,0x000400fa,0x00000a38,0x00000a3a,
+0x00000a43,0x000200f8,0x00000a3a,0x0004003d,
+0x00000006,0x00000a3d,0x000000a1,0x0003003e,
+0x00000a3c,0x00000a3d,0x0004003d,0x00000006,
+0x00000a3f,0x00000a2f,0x0003003e,0x00000a3e,
+0x00000a3f,0x0004003d,0x00000006,0x00000a41,
+0x00000a32,0x0003003e,0x00000a40,0x00000a41,
+0x00070039,0x00000006,0x00000a42,0x00000098,
+0x00000a3c,0x00000a3e,0x00000a40,0x0003003e,
+0x00000a39,0x00000a42,0x000200f9,0x00000a3b,
+0x000200f8,0x00000a43,0x0003003e,0x00000a39,
+0x000000bf,0x000200f9,0x00000a3b,0x000200f8,
+0x00000a3b,0x0004003d,0x00000006,0x00000a44,
+0x00000a39,0x0003003e,0x00000a35,0x00000a44,
+0x0004003d,0x00000006,0x00000a46,0x000000a2,
+0x000500b0,0x000000cf,0x00000a47,0x00000a46,
+0x000000b7,0x000300f7,0x00000a4a,0x00000000,
+0x000400fa,0x00000a47,0x00000a49,0x00000a4b,
+0x000200f8,0x00000a49,0x0003003e,0x00000a48,
+0x000000bf,0x000200f9,0x00000a4a,0x000200f8,
+0x00000a4b,0x0004003d,0x00000006,0x00000a4c,
+0x00000a35,0x000500c4,0x00000006,0x00000a4d,
+0x00000a4c,0x000008bc,0x0004003d,0x00000006,
+0x00000a4f,0x000000a2,0x00050084,0x00000006,
+0x00000a50,0x00000a4e,0x00000a4f,0x00050080,
+0x00000006,0x00000a51,0x00000a50,0x00000442,
+0x000500c2,0x00000006,0x00000a52,0x00000a4d,
+0x00000a51,0x0003003e,0x00000a48,0x00000a52,
+0x000200f9,0x00000a4a,0x000200f8,0x00000a4a,
+0x0004003d,0x00000006,0x00000a53,0x00000a48,
+0x0004003d,0x00000006,0x00000a54,0x000000a2,
+0x000500ac,0x000000cf,0x00000a55,0x00000a54,
+0x000000b7,0x000300f7,0x00000a58,0x00000000,
+0x000400fa,0x00000a55,0x00000a57,0x00000a59,
+0x000200f8,0x00000a57,0x0003003e,0x00000a56,
+0x000000bf,0x000200f9,0x00000a58,0x000200f8,
+0x00000a59,0x0004003d,0x00000006,0x00000a5a,
+0x00000a35,0x0004003d,0x00000006,0x00000a5b,
+0x000000a2,0x00050084,0x00000006,0x00000a5c,
+0x000000b8,0x00000a5b,0x00050080,0x00000006,
+0x00000a5d,0x00000a5c,0x00000170,0x000500c4,
+0x00000006,0x00000a5e,0x00000a5a,0x00000a5d,
+0x0003003e,0x00000a56,0x00000a5e,0x000200f9,
+0x00000a58,0x000200f8,0x00000a58,0x0004003d,
+0x00000006,0x00000a5f,0x00000a56,0x00050050,
+0x00000011,0x00000a60,0x00000a53,0x00000a5f,
+0x0003003e,0x00000a45,0x00000a60,0x0004003d,
+0x00000011,0x00000a62,0x00000a45,0x00070168,
+0x00000011,0x00000a63,0x000000b8,0x00000003,
+0x00000a62,0x00000170,0x0003003e,0x00000a61,
+0x00000a63,0x0004003d,0x00000006,0x00000a64,
+0x00000a32,0x000500c7,0x00000006,0x00000a65,
+0x00000a64,0x000006b5,0x0004003d,0x00000006,
+0x00000a66,0x00000a2f,0x000500c7,0x00000006,
+0x00000a67,0x00000a66,0x000006b5,0x000500c4,
+0x00000006,0x00000a68,0x00000a67,0x000005bf,
+0x000500c5,0x00000006,0x00000a69,0x00000a65,
+0x00000a68,0x00050041,0x00000007,0x00000a6a,
+0x00000a61,0x000000c2,0x0004003d,0x00000006,
+0x00000a6b,0x00000a6a,0x000500c5,0x00000006,
+0x00000a6c,0x00000a69,0x00000a6b,0x00050041,
+0x00000007,0x00000a6d,0x00000a61,0x000000bf,
+0x0004003d,0x00000006,0x00000a6e,0x00000a6d,
+0x00050050,0x00000011,0x00000a6f,0x00000a6c,
+0x00000a6e,0x000200fe,0x00000a6f,0x00010038,
+0x00050036,0x00000006,0x000000a7,0x00000000,
+0x000000a5,0x00030037,0x00000009,0x000000a6,
+0x000200f8,0x000000a8,0x0004003b,0x00000009,
+0x00000a72,0x00000007,0x0004003d,0x00000008,
+0x00000a73,0x000000a6,0x00040070,0x0000008c,
+0x00000a74,0x00000a73,0x00050085,0x0000008c,
+0x00000a78,0x00000a74,0x00000a77,0x00050088,
+0x0000008c,0x00000a7b,0x00000a78,0x00000a7a,
+0x0006000c,0x0000008c,0x00000a7c,0x00000001,
+0x00000001,0x00000a7b,0x0004006d,0x00000008,
+0x00000a7d,0x00000a7c,0x0003003e,0x00000a72,
+0x00000a7d,0x00050041,0x00000007,0x00000a7e,
+0x00000a72,0x000000bf,0x0004003d,0x00000006,
+0x00000a7f,0x00000a7e,0x000500c4,0x00000006,
+0x00000a80,0x00000a7f,0x000001a9,0x00050041,
+0x00000007,0x00000a81,0x00000a72,0x000000c2,
+0x0004003d,0x00000006,0x00000a82,0x00000a81,
+0x000500c4,0x00000006,0x00000a83,0x00000a82,
+0x000000f2,0x000500c5,0x00000006,0x00000a84,
+0x00000a80,0x00000a83,0x00050041,0x00000007,
+0x00000a85,0x00000a72,0x000000b4,0x0004003d,
+0x00000006,0x00000a86,0x00000a85,0x000500c5,
+0x00000006,0x00000a87,0x00000a84,0x00000a86,
+0x000200fe,0x00000a87,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_1D.inl
new file mode 100644
index 00000000000..f4b49672f0a
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_1D.inl
@@ -0,0 +1,3597 @@
+0x07230203,0x00010300,0x000d000a,0x0000095e,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x0000091d,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00080005,
+0x0000000d,0x45746567,0x646f636e,0x53676e69,
+0x28657a69,0x763b3175,0x003b3375,0x00040005,
+0x0000000b,0x566d756e,0x00736c61,0x00050005,
+0x0000000c,0x6f636e65,0x676e6964,0x00000000,
+0x000a0005,0x00000016,0x63747361,0x6f636544,
+0x49726564,0x6974696e,0x7a696c61,0x75762865,
+0x75763b34,0x00003b32,0x00050005,0x00000014,
+0x636f6c62,0x7461446b,0x00000061,0x00050005,
+0x00000015,0x636f6c62,0x7a69536b,0x00005f65,
+0x00080005,0x0000001c,0x72747865,0x42746361,
+0x28737469,0x3b347576,0x753b3175,0x00003b31,
+0x00040005,0x00000019,0x61746164,0x00000000,
+0x00040005,0x0000001a,0x7366666f,0x00007465,
+0x00040005,0x0000001b,0x426d756e,0x00737469,
+0x00080005,0x00000023,0x6f636564,0x45436564,
+0x3175284d,0x3b31753b,0x753b3175,0x00003b31,
+0x00060005,0x0000001f,0x74726170,0x6f697469,
+0x646e496e,0x00007865,0x00060005,0x00000020,
+0x72617473,0x45664f74,0x61727478,0x006d6543,
+0x00060005,0x00000021,0x61746f74,0x646e456c,
+0x6e696f70,0x00007374,0x00070005,0x00000022,
+0x65736162,0x70646e45,0x746e696f,0x65646e49,
+0x00000078,0x00090005,0x0000002a,0x6f636564,
+0x72546564,0x76287469,0x753b3475,0x31753b31,
+0x3b31753b,0x00000000,0x00040005,0x00000026,
+0x61746164,0x00000000,0x00040005,0x00000027,
+0x7366666f,0x00007465,0x00040005,0x00000028,
+0x426d756e,0x00737469,0x00030005,0x00000029,
+0x00000069,0x00090005,0x00000030,0x6f636564,
+0x75516564,0x28746e69,0x3b347576,0x753b3175,
+0x31753b31,0x0000003b,0x00040005,0x0000002c,
+0x61746164,0x00000000,0x00040005,0x0000002d,
+0x7366666f,0x00007465,0x00040005,0x0000002e,
+0x426d756e,0x00737469,0x00030005,0x0000002f,
+0x00000069,0x000a0005,0x00000037,0x6f636564,
+0x57316564,0x68676965,0x75762874,0x75763b34,
+0x31753b33,0x3b31753b,0x00000000,0x00050005,
+0x00000033,0x67696577,0x61447468,0x00006174,
+0x00050005,0x00000034,0x6f636e65,0x676e6964,
+0x00000000,0x00050005,0x00000035,0x576d756e,
+0x68676965,0x00007374,0x00040005,0x00000036,
+0x65646e69,0x00000078,0x000e0005,0x00000042,
+0x65746e69,0x6c6f7072,0x57657461,0x68676965,
+0x76287374,0x763b3475,0x753b3375,0x31753b31,
+0x3b31753b,0x753b3175,0x75763b31,0x00003b32,
+0x00050005,0x0000003a,0x67696577,0x61447468,
+0x00006174,0x00050005,0x0000003b,0x6f636e65,
+0x676e6964,0x00000000,0x00050005,0x0000003c,
+0x576d756e,0x68676965,0x00007374,0x00040005,
+0x0000003d,0x65646e69,0x00000078,0x00050005,
+0x0000003e,0x64697267,0x74646957,0x00000068,
+0x00040005,0x0000003f,0x69727473,0x00006564,
+0x00040005,0x00000040,0x7366666f,0x00007465,
+0x00060005,0x00000041,0x63617266,0x6e6f6974,
+0x61506c61,0x00007472,0x00080005,0x00000047,
+0x6f636564,0x65576564,0x74686769,0x75762873,
+0x75763b34,0x00003b32,0x00050005,0x00000045,
+0x67696577,0x61447468,0x00006174,0x00050005,
+0x00000046,0x49736f70,0x6f6c426e,0x00006b63,
+0x00050005,0x0000004b,0x68736168,0x75283235,
+0x00003b31,0x00030005,0x0000004a,0x00000070,
+0x00090005,0x00000051,0x656c6573,0x61507463,
+0x74697472,0x286e6f69,0x763b3175,0x753b3275,
+0x00003b31,0x00040005,0x0000004e,0x64656573,
+0x00000000,0x00030005,0x0000004f,0x00736f70,
+0x00060005,0x00000050,0x506d756e,0x69747261,
+0x6e6f6974,0x00000073,0x000a0005,0x00000057,
+0x45746567,0x6f70646e,0x45746e69,0x646f636e,
+0x28676e69,0x753b3175,0x31753b31,0x0000003b,
+0x00080005,0x00000054,0x69617661,0x6c62616c,
+0x646e4565,0x6e696f70,0x74694274,0x00000073,
+0x00060005,0x00000055,0x456d756e,0x6f70646e,
+0x73746e69,0x00000000,0x00050005,0x00000056,
+0x75746361,0x69536c61,0x0000657a,0x00070005,
+0x0000005e,0x65756c62,0x746e6f43,0x74636172,
+0x34697628,0x0000003b,0x00030005,0x0000005d,
+0x00000076,0x00050005,0x00000064,0x286d7573,
+0x3b336976,0x00000000,0x00030005,0x00000063,
+0x00000076,0x00090005,0x00000069,0x54746962,
+0x736e6172,0x53726566,0x656e6769,0x69762864,
+0x69763b34,0x00003b34,0x00030005,0x00000067,
+0x00000061,0x00030005,0x00000068,0x00000062,
+0x000b0005,0x00000071,0x6f636564,0x6e456564,
+0x696f7064,0x2873746e,0x3b346976,0x3b346976,
+0x763b3175,0x763b3475,0x003b3475,0x00030005,
+0x0000006c,0x00004176,0x00030005,0x0000006d,
+0x00004276,0x00040005,0x0000006e,0x65646f6d,
+0x00000000,0x00030005,0x0000006f,0x00307065,
+0x00030005,0x00000070,0x00317065,0x000a0005,
+0x00000078,0x6f636564,0x45316564,0x6f70646e,
+0x28746e69,0x3b347576,0x753b3175,0x75763b31,
+0x00003b33,0x00040005,0x00000074,0x61746164,
+0x00000000,0x00050005,0x00000075,0x72617473,
+0x66664f74,0x00746573,0x00040005,0x00000076,
+0x65646e69,0x00000078,0x00050005,0x00000077,
+0x6f636e65,0x676e6964,0x00000000,0x00070005,
+0x0000007c,0x6c697562,0x74694264,0x6b73616d,
+0x3b317528,0x00000000,0x00040005,0x0000007b,
+0x73746962,0x00000000,0x00080005,0x00000080,
+0x63747361,0x6f636544,0x65546564,0x286c6578,
+0x3b327576,0x00000000,0x00050005,0x0000007f,
+0x49736f70,0x6f6c426e,0x00006b63,0x00070005,
+0x00000085,0x50746567,0x4431736f,0x61727241,
+0x69762879,0x00003b33,0x00030005,0x00000084,
+0x00736f70,0x00040005,0x00000087,0x69427174,
+0x00007374,0x00050005,0x000000a8,0x63747361,
+0x636f6c42,0x0000006b,0x00050005,0x000000ab,
+0x636f6c62,0x7a69536b,0x00000065,0x00050005,
+0x000000af,0x6f636564,0x72456564,0x00726f72,
+0x00050005,0x000000b1,0x64696f76,0x65747845,
+0x0000746e,0x00040005,0x000000bd,0x73746962,
+0x00003130,0x00040005,0x000000c3,0x73746962,
+0x00003332,0x00040005,0x000000c7,0x34746962,
+0x00000000,0x00040005,0x000000cd,0x73746962,
+0x00003635,0x00040005,0x000000d2,0x73746962,
+0x00003837,0x00030005,0x000000d7,0x00000068,
+0x00050005,0x000000dc,0x6c617564,0x6e616c50,
+0x00000065,0x00030005,0x000000e6,0x00000072,
+0x00060005,0x000000f1,0x67696577,0x72477468,
+0x69536469,0x0000657a,0x00060005,0x0000014d,
+0x67696577,0x6e457468,0x69646f63,0x0000676e,
+0x00050005,0x00000164,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000167,0x576d756e,
+0x68676965,0x00007374,0x00060005,0x00000170,
+0x67696577,0x61447468,0x69536174,0x0000657a,
+0x00040005,0x00000171,0x61726170,0x0000006d,
+0x00040005,0x00000173,0x61726170,0x0000006d,
+0x00060005,0x00000184,0x506d756e,0x69747261,
+0x6e6f6974,0x00000073,0x00060005,0x0000018e,
+0x74726170,0x6f697469,0x6565536e,0x00000064,
+0x00030005,0x0000019f,0x00000069,0x00030005,
+0x000001a4,0x0000006a,0x00040005,0x000001ab,
+0x72617473,0x00000074,0x00050005,0x000001be,
+0x4c6d756e,0x6942776f,0x00007374,0x00040005,
+0x000001c1,0x42776f6c,0x00737469,0x00050005,
+0x000001ca,0x68676968,0x73746942,0x00000000,
+0x00030005,0x000001e1,0x006d6563,0x00050005,
+0x000001ec,0x536d6563,0x63656c65,0x00726f74,
+0x00040005,0x000001f1,0x65736162,0x006d6543,
+0x00080005,0x000001fc,0x70646e65,0x746e696f,
+0x72655073,0x74726150,0x6f697469,0x0000006e,
+0x00060005,0x0000020a,0x657a6973,0x7845664f,
+0x43617274,0x00006d65,0x00050005,0x00000212,
+0x72747865,0x6d654361,0x00000000,0x00040005,
+0x00000213,0x61726170,0x0000006d,0x00040005,
+0x00000215,0x61726170,0x0000006d,0x00040005,
+0x00000217,0x61726170,0x0000006d,0x00040005,
+0x0000021a,0x6c6c7566,0x006d6543,0x00040005,
+0x0000021f,0x6c61566d,0x00006575,0x00040005,
+0x00000227,0x6c615663,0x00736575,0x00050005,
+0x0000023f,0x65736162,0x73616c43,0x00000073,
+0x00050005,0x0000024e,0x6d756e69,0x73746942,
+0x00000000,0x00040005,0x00000251,0x636f6c62,
+0x0000006b,0x00040005,0x00000258,0x61726170,
+0x0000006d,0x00040005,0x0000025a,0x61726170,
+0x0000006d,0x00040005,0x0000025b,0x61726170,
+0x0000006d,0x00050005,0x0000025d,0x6b636170,
+0x72546465,0x00737469,0x00040005,0x00000280,
+0x42776f6c,0x00737469,0x00040005,0x00000281,
+0x61726170,0x0000006d,0x00040005,0x00000283,
+0x61726170,0x0000006d,0x00040005,0x00000285,
+0x61726170,0x0000006d,0x00030005,0x00000289,
+0x0000006a,0x00040005,0x00000297,0x6f636564,
+0x00646564,0x00050005,0x00000381,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x0000038f,
+0x6d756e69,0x73746942,0x00000000,0x00040005,
+0x00000392,0x636f6c62,0x0000006b,0x00040005,
+0x00000396,0x61726170,0x0000006d,0x00040005,
+0x00000398,0x61726170,0x0000006d,0x00040005,
+0x0000039a,0x61726170,0x0000006d,0x00060005,
+0x0000039c,0x6b636170,0x75516465,0x73746e69,
+0x00000000,0x00040005,0x000003ae,0x42776f6c,
+0x00737469,0x00040005,0x000003ba,0x6f636564,
+0x00646564,0x00050005,0x000003f2,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000406,
+0x426d756e,0x00737469,0x00040005,0x0000040e,
+0x7366666f,0x00007465,0x00030005,0x00000415,
+0x00000077,0x00040005,0x00000418,0x61726170,
+0x0000006d,0x00040005,0x0000041a,0x61726170,
+0x0000006d,0x00040005,0x0000041c,0x61726170,
+0x0000006d,0x00040005,0x0000041e,0x61726170,
+0x0000006d,0x00050005,0x00000437,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000441,
+0x7366666f,0x00007465,0x00030005,0x00000448,
+0x00000077,0x00040005,0x0000044b,0x61726170,
+0x0000006d,0x00040005,0x0000044d,0x61726170,
+0x0000006d,0x00040005,0x0000044f,0x61726170,
+0x0000006d,0x00040005,0x00000451,0x61726170,
+0x0000006d,0x00050005,0x00000465,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000046a,
+0x7366666f,0x00007465,0x00030005,0x0000046e,
+0x00000077,0x00040005,0x0000046f,0x61726170,
+0x0000006d,0x00040005,0x00000471,0x61726170,
+0x0000006d,0x00040005,0x00000473,0x61726170,
+0x0000006d,0x00040005,0x00000476,0x75716e75,
+0x00746e61,0x00050005,0x00000482,0x65646e69,
+0x6c626178,0x00000065,0x00060005,0x00000497,
+0x67696577,0x6e497468,0x65636964,0x00000073,
+0x00040005,0x000004a5,0x67696577,0x00737468,
+0x00040005,0x000004a6,0x61726170,0x0000006d,
+0x00040005,0x000004a8,0x61726170,0x0000006d,
+0x00040005,0x000004aa,0x61726170,0x0000006d,
+0x00040005,0x000004ac,0x61726170,0x0000006d,
+0x00040005,0x000004b0,0x61726170,0x0000006d,
+0x00040005,0x000004b2,0x61726170,0x0000006d,
+0x00040005,0x000004b4,0x61726170,0x0000006d,
+0x00040005,0x000004b6,0x61726170,0x0000006d,
+0x00040005,0x000004ba,0x61726170,0x0000006d,
+0x00040005,0x000004bc,0x61726170,0x0000006d,
+0x00040005,0x000004be,0x61726170,0x0000006d,
+0x00040005,0x000004c0,0x61726170,0x0000006d,
+0x00040005,0x000004c4,0x61726170,0x0000006d,
+0x00040005,0x000004c6,0x61726170,0x0000006d,
+0x00040005,0x000004c8,0x61726170,0x0000006d,
+0x00040005,0x000004ca,0x61726170,0x0000006d,
+0x00030005,0x000004cf,0x00313177,0x00040005,
+0x000004d7,0x74636166,0x0073726f,0x00050005,
+0x000004f7,0x6c616373,0x63614665,0x00726f74,
+0x00070005,0x00000502,0x6f6d6f68,0x656e6567,
+0x4373756f,0x64726f6f,0x00000073,0x00050005,
+0x00000505,0x64697267,0x726f6f43,0x00007364,
+0x00060005,0x00000510,0x65746e69,0x6c617267,
+0x74726150,0x00000000,0x00060005,0x00000514,
+0x63617266,0x6e6f6974,0x61506c61,0x00007472,
+0x00050005,0x00000519,0x64697267,0x74646957,
+0x00000068,0x00030005,0x0000051c,0x00003076,
+0x00040005,0x00000524,0x67696577,0x00737468,
+0x00040005,0x0000052a,0x61726170,0x0000006d,
+0x00040005,0x0000052c,0x61726170,0x0000006d,
+0x00040005,0x0000052e,0x61726170,0x0000006d,
+0x00040005,0x00000530,0x61726170,0x0000006d,
+0x00040005,0x00000532,0x61726170,0x0000006d,
+0x00040005,0x00000534,0x61726170,0x0000006d,
+0x00040005,0x00000535,0x61726170,0x0000006d,
+0x00040005,0x00000536,0x61726170,0x0000006d,
+0x00040005,0x0000053d,0x61726170,0x0000006d,
+0x00040005,0x0000053f,0x61726170,0x0000006d,
+0x00040005,0x00000541,0x61726170,0x0000006d,
+0x00040005,0x00000543,0x61726170,0x0000006d,
+0x00040005,0x00000545,0x61726170,0x0000006d,
+0x00040005,0x00000547,0x61726170,0x0000006d,
+0x00040005,0x00000548,0x61726170,0x0000006d,
+0x00040005,0x00000549,0x61726170,0x0000006d,
+0x00040005,0x00000593,0x6d756e72,0x00000000,
+0x00040005,0x00000594,0x61726170,0x0000006d,
+0x00040005,0x00000597,0x64656573,0x00000041,
+0x00040005,0x000005a3,0x64656573,0x00000042,
+0x00040005,0x000005b6,0x66696873,0x00317374,
+0x00040005,0x000005c1,0x66696873,0x00327374,
+0x00040005,0x000005d4,0x75736572,0x0000746c,
+0x00030005,0x0000062b,0x00000069,0x00050005,
+0x00000633,0x6f636e65,0x676e6964,0x00000000,
+0x00050005,0x00000641,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000644,0x61726170,
+0x0000006d,0x00040005,0x00000646,0x61726170,
+0x0000006d,0x00030005,0x000006a0,0x0000306c,
+0x00030005,0x000006a9,0x0000316c,0x00040005,
+0x000006c7,0x61726170,0x0000006d,0x00040005,
+0x000006c9,0x61726170,0x0000006d,0x00040005,
+0x00000716,0x61726170,0x0000006d,0x00040005,
+0x0000071a,0x61726170,0x0000006d,0x00040005,
+0x00000726,0x61726170,0x0000006d,0x00040005,
+0x0000072a,0x61726170,0x0000006d,0x00040005,
+0x00000732,0x61726170,0x0000006d,0x00040005,
+0x00000734,0x61726170,0x0000006d,0x00040005,
+0x00000739,0x61726170,0x0000006d,0x00040005,
+0x00000750,0x61726170,0x0000006d,0x00040005,
+0x00000756,0x61726170,0x0000006d,0x00040005,
+0x00000760,0x426d756e,0x00737469,0x00040005,
+0x00000768,0x7366666f,0x00007465,0x00030005,
+0x00000771,0x00007065,0x00040005,0x00000774,
+0x61726170,0x0000006d,0x00040005,0x00000776,
+0x61726170,0x0000006d,0x00040005,0x00000778,
+0x61726170,0x0000006d,0x00040005,0x0000077a,
+0x61726170,0x0000006d,0x00050005,0x000007e2,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x000007ec,0x7366666f,0x00007465,0x00030005,
+0x000007f5,0x00007065,0x00040005,0x000007f8,
+0x61726170,0x0000006d,0x00040005,0x000007fa,
+0x61726170,0x0000006d,0x00040005,0x000007fc,
+0x61726170,0x0000006d,0x00040005,0x000007fe,
+0x61726170,0x0000006d,0x00050005,0x00000810,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000815,0x7366666f,0x00007465,0x00030005,
+0x0000081b,0x00000077,0x00040005,0x0000081c,
+0x61726170,0x0000006d,0x00040005,0x0000081e,
+0x61726170,0x0000006d,0x00040005,0x00000820,
+0x61726170,0x0000006d,0x00040005,0x00000823,
+0x75716e75,0x00746e61,0x00050005,0x00000830,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x0000083e,0x426d756e,0x00737469,0x00040005,
+0x00000847,0x6b73616d,0x00000000,0x00050005,
+0x00000872,0x67696577,0x61447468,0x00006174,
+0x00040005,0x00000876,0x61726170,0x0000006d,
+0x00040005,0x0000087a,0x67696577,0x00737468,
+0x00040005,0x0000087b,0x61726170,0x0000006d,
+0x00060005,0x0000087e,0x74726170,0x6f697469,
+0x646e496e,0x00007865,0x00040005,0x0000087f,
+0x61726170,0x0000006d,0x00040005,0x00000881,
+0x61726170,0x0000006d,0x00040005,0x00000882,
+0x61726170,0x0000006d,0x00060005,0x00000885,
+0x72617473,0x45664f74,0x61727478,0x006d6543,
+0x00060005,0x00000886,0x61746f74,0x646e456c,
+0x6e696f70,0x00007374,0x00070005,0x00000887,
+0x65736162,0x70646e45,0x746e696f,0x65646e49,
+0x00000078,0x00030005,0x00000888,0x006d6563,
+0x00040005,0x00000889,0x61726170,0x0000006d,
+0x00040005,0x0000088b,0x61726170,0x0000006d,
+0x00040005,0x0000088c,0x61726170,0x0000006d,
+0x00040005,0x0000088d,0x61726170,0x0000006d,
+0x00060005,0x00000897,0x70646e65,0x746e696f,
+0x61745373,0x00007472,0x00060005,0x0000089d,
+0x70646e65,0x746e696f,0x646e4573,0x00000000,
+0x00080005,0x000008a5,0x69617661,0x6c62616c,
+0x646e4565,0x6e696f70,0x74694274,0x00000073,
+0x00070005,0x000008a9,0x70646e65,0x746e696f,
+0x6f636e45,0x676e6964,0x00000000,0x00070005,
+0x000008aa,0x75746361,0x6e456c61,0x696f7064,
+0x6942746e,0x00007374,0x00040005,0x000008ab,
+0x61726170,0x0000006d,0x00040005,0x000008ad,
+0x61726170,0x0000006d,0x00040005,0x000008af,
+0x61726170,0x0000006d,0x00070005,0x000008b2,
+0x456d756e,0x6f70646e,0x50746e69,0x73726961,
+0x00000000,0x00030005,0x000008b6,0x00004176,
+0x00030005,0x000008b7,0x00004276,0x00040005,
+0x000008b8,0x61447065,0x00006174,0x00040005,
+0x000008bd,0x61726170,0x0000006d,0x00030005,
+0x000008c0,0x00000069,0x00040005,0x000008c9,
+0x64497065,0x00000078,0x00040005,0x000008cf,
+0x61726170,0x0000006d,0x00040005,0x000008d1,
+0x61726170,0x0000006d,0x00040005,0x000008d3,
+0x61726170,0x0000006d,0x00040005,0x000008d5,
+0x61726170,0x0000006d,0x00040005,0x000008dd,
+0x61726170,0x0000006d,0x00040005,0x000008df,
+0x61726170,0x0000006d,0x00040005,0x000008e1,
+0x61726170,0x0000006d,0x00040005,0x000008e2,
+0x61726170,0x0000006d,0x00030005,0x000008e9,
+0x00307065,0x00030005,0x000008ea,0x00317065,
+0x00040005,0x000008eb,0x61726170,0x0000006d,
+0x00040005,0x000008ed,0x61726170,0x0000006d,
+0x00040005,0x000008ef,0x61726170,0x0000006d,
+0x00040005,0x000008f1,0x61726170,0x0000006d,
+0x00040005,0x000008f2,0x61726170,0x0000006d,
+0x00070005,0x000008f6,0x67696577,0x50737468,
+0x68437265,0x656e6e61,0x0000006c,0x00030005,
+0x000008fd,0x00736363,0x00040005,0x000008fe,
+0x61726170,0x0000006d,0x00040005,0x00000900,
+0x61726170,0x0000006d,0x00040005,0x00000902,
+0x61726170,0x0000006d,0x00050005,0x0000091b,
+0x65786574,0x736f506c,0x00000000,0x00080005,
+0x0000091d,0x475f6c67,0x61626f6c,0x766e496c,
+0x7461636f,0x496e6f69,0x00000044,0x00040005,
+0x00000920,0x6579616c,0x00000072,0x00070005,
+0x00000921,0x67616d49,0x726f4665,0x4274616d,
+0x6b636f6c,0x00000000,0x00060006,0x00000921,
+0x00000000,0x636f6c62,0x7a69536b,0x00000065,
+0x00060006,0x00000921,0x00000001,0x65736162,
+0x6579614c,0x00000072,0x00060006,0x00000921,
+0x00000002,0x6c616d73,0x6f6c426c,0x00006b63,
+0x00060005,0x00000923,0x75705f75,0x6f436873,
+0x6174736e,0x0000746e,0x00050005,0x0000092b,
+0x636f6c62,0x736f506b,0x00000000,0x00050005,
+0x00000931,0x49736f70,0x6f6c426e,0x00006b63,
+0x00050005,0x00000936,0x63747361,0x636f6c42,
+0x0000006b,0x00050005,0x00000939,0x49637273,
+0x6567616d,0x00000000,0x00040005,0x00000942,
+0x61726170,0x0000006d,0x00040005,0x00000946,
+0x61726170,0x0000006d,0x00040005,0x00000948,
+0x61726170,0x0000006d,0x00040005,0x0000094c,
+0x65786574,0x0000006c,0x00050005,0x00000951,
+0x49747364,0x6567616d,0x00000000,0x00040005,
+0x0000095a,0x61726170,0x0000006d,0x00040047,
+0x0000091d,0x0000000b,0x0000001c,0x00050048,
+0x00000921,0x00000000,0x00000023,0x00000000,
+0x00050048,0x00000921,0x00000001,0x00000023,
+0x00000008,0x00050048,0x00000921,0x00000002,
+0x00000023,0x0000000c,0x00030047,0x00000921,
+0x00000002,0x00040047,0x00000939,0x00000022,
+0x00000000,0x00040047,0x00000939,0x00000021,
+0x00000000,0x00030047,0x00000939,0x00000018,
+0x00040047,0x00000951,0x00000022,0x00000000,
+0x00040047,0x00000951,0x00000021,0x00000001,
+0x00030047,0x00000951,0x00000019,0x00040047,
+0x0000095d,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000000,
+0x00040020,0x00000007,0x00000007,0x00000006,
+0x00040017,0x00000008,0x00000006,0x00000003,
+0x00040020,0x00000009,0x00000007,0x00000008,
+0x00050021,0x0000000a,0x00000006,0x00000007,
+0x00000009,0x00040017,0x0000000f,0x00000006,
+0x00000004,0x00040020,0x00000010,0x00000007,
+0x0000000f,0x00040017,0x00000011,0x00000006,
+0x00000002,0x00040020,0x00000012,0x00000007,
+0x00000011,0x00050021,0x00000013,0x00000002,
+0x00000010,0x00000012,0x00060021,0x00000018,
+0x00000006,0x00000010,0x00000007,0x00000007,
+0x00070021,0x0000001e,0x00000006,0x00000007,
+0x00000007,0x00000007,0x00000007,0x00070021,
+0x00000025,0x00000006,0x00000010,0x00000007,
+0x00000007,0x00000007,0x00070021,0x00000032,
+0x00000006,0x00000010,0x00000009,0x00000007,
+0x00000007,0x000b0021,0x00000039,0x00000006,
+0x00000010,0x00000009,0x00000007,0x00000007,
+0x00000007,0x00000007,0x00000007,0x00000012,
+0x00050021,0x00000044,0x00000011,0x00000010,
+0x00000011,0x00040021,0x00000049,0x00000006,
+0x00000007,0x00060021,0x0000004d,0x00000006,
+0x00000007,0x00000012,0x00000007,0x00060021,
+0x00000053,0x00000008,0x00000007,0x00000007,
+0x00000007,0x00040015,0x00000059,0x00000020,
+0x00000001,0x00040017,0x0000005a,0x00000059,
+0x00000004,0x00040020,0x0000005b,0x00000007,
+0x0000005a,0x00040021,0x0000005c,0x0000005a,
+0x0000005b,0x00040017,0x00000060,0x00000059,
+0x00000003,0x00040020,0x00000061,0x00000007,
+0x00000060,0x00040021,0x00000062,0x00000059,
+0x00000061,0x00050021,0x00000066,0x00000002,
+0x0000005b,0x0000005b,0x00080021,0x0000006b,
+0x00000002,0x0000005b,0x0000005b,0x00000007,
+0x00000010,0x00000010,0x00070021,0x00000073,
+0x00000006,0x00000010,0x00000007,0x00000007,
+0x00000009,0x00040021,0x0000007a,0x0000000f,
+0x00000007,0x00040021,0x0000007e,0x0000000f,
+0x00000011,0x00040017,0x00000082,0x00000059,
+0x00000002,0x00040021,0x00000083,0x00000082,
+0x00000061,0x0004002b,0x00000006,0x0000008d,
+0x00000008,0x0004002b,0x00000006,0x0000008e,
+0x00000007,0x0005002c,0x00000011,0x0000008f,
+0x0000008d,0x0000008e,0x0004002b,0x00000006,
+0x00000091,0x00000004,0x0004002b,0x00000006,
+0x00000092,0x00000002,0x0005002c,0x00000011,
+0x00000093,0x00000091,0x00000092,0x0004002b,
+0x00000006,0x00000095,0x00000005,0x0004002b,
+0x00000006,0x00000096,0x00000003,0x0005002c,
+0x00000011,0x00000097,0x00000095,0x00000096,
+0x0004002b,0x00000006,0x0000009d,0x00000000,
+0x0004002b,0x00000006,0x000000a0,0x00000001,
+0x00040020,0x000000a7,0x00000006,0x0000000f,
+0x0004003b,0x000000a7,0x000000a8,0x00000006,
+0x00040020,0x000000aa,0x00000006,0x00000011,
+0x0004003b,0x000000aa,0x000000ab,0x00000006,
+0x00020014,0x000000ad,0x00040020,0x000000ae,
+0x00000006,0x000000ad,0x0004003b,0x000000ae,
+0x000000af,0x00000006,0x0003002a,0x000000ad,
+0x000000b0,0x0004003b,0x000000ae,0x000000b1,
+0x00000006,0x00040020,0x000000b2,0x00000006,
+0x00000006,0x0004002b,0x00000006,0x000000b5,
+0x000001ff,0x0004002b,0x00000006,0x000000b7,
+0x000001fc,0x0004002b,0x00000059,0x000000c0,
+0x00000000,0x0004002b,0x00000059,0x000000c1,
+0x00000002,0x0004002b,0x00000059,0x000000ca,
+0x00000004,0x0004002b,0x00000059,0x000000cb,
+0x00000001,0x0004002b,0x00000059,0x000000d0,
+0x00000005,0x0004002b,0x00000059,0x000000d5,
+0x00000007,0x0004002b,0x00000059,0x000000da,
+0x00000009,0x0004003b,0x000000ae,0x000000dc,
+0x00000006,0x0004002b,0x00000059,0x000000df,
+0x0000000a,0x0004003b,0x000000aa,0x000000f1,
+0x00000006,0x0004002b,0x00000006,0x000000f2,
+0x0000000c,0x0004002b,0x00000006,0x000000fc,
+0x00000006,0x0004002b,0x00000006,0x00000108,
+0x0000000a,0x0005002c,0x00000011,0x00000109,
+0x000000fc,0x00000108,0x0005002c,0x00000011,
+0x0000010f,0x00000108,0x000000fc,0x00030029,
+0x000000ad,0x00000111,0x00040017,0x00000146,
+0x000000ad,0x00000002,0x00040020,0x0000014c,
+0x00000006,0x00000008,0x0004003b,0x0000014c,
+0x0000014d,0x00000006,0x0004002b,0x00000006,
+0x0000014e,0x00000010,0x0004001c,0x0000014f,
+0x00000008,0x0000014e,0x0006002c,0x00000008,
+0x00000150,0x0000009d,0x0000009d,0x0000009d,
+0x0006002c,0x00000008,0x00000151,0x0000009d,
+0x0000009d,0x000000a0,0x0006002c,0x00000008,
+0x00000152,0x000000a0,0x0000009d,0x0000009d,
+0x0006002c,0x00000008,0x00000153,0x0000009d,
+0x0000009d,0x00000092,0x0006002c,0x00000008,
+0x00000154,0x0000009d,0x000000a0,0x0000009d,
+0x0006002c,0x00000008,0x00000155,0x000000a0,
+0x0000009d,0x000000a0,0x0006002c,0x00000008,
+0x00000156,0x0000009d,0x0000009d,0x00000096,
+0x0006002c,0x00000008,0x00000157,0x0000009d,
+0x000000a0,0x000000a0,0x0006002c,0x00000008,
+0x00000158,0x000000a0,0x0000009d,0x00000092,
+0x0006002c,0x00000008,0x00000159,0x0000009d,
+0x0000009d,0x00000091,0x0006002c,0x00000008,
+0x0000015a,0x0000009d,0x000000a0,0x00000092,
+0x0006002c,0x00000008,0x0000015b,0x000000a0,
+0x0000009d,0x00000096,0x0006002c,0x00000008,
+0x0000015c,0x0000009d,0x0000009d,0x00000095,
+0x0013002c,0x0000014f,0x0000015d,0x00000150,
+0x00000150,0x00000151,0x00000152,0x00000153,
+0x00000154,0x00000155,0x00000156,0x00000150,
+0x00000150,0x00000157,0x00000158,0x00000159,
+0x0000015a,0x0000015b,0x0000015c,0x0004002b,
+0x00000059,0x0000015f,0x00000003,0x00040020,
+0x00000163,0x00000007,0x0000014f,0x0004003b,
+0x000000b2,0x00000167,0x00000006,0x0004003b,
+0x000000b2,0x00000170,0x00000006,0x0004002b,
+0x00000006,0x00000177,0x00000018,0x0004002b,
+0x00000006,0x0000017a,0x00000060,0x0004002b,
+0x00000006,0x0000017e,0x00000040,0x0004003b,
+0x000000b2,0x00000184,0x00000006,0x0004002b,
+0x00000059,0x00000187,0x0000000b,0x0004003b,
+0x000000b2,0x0000018e,0x00000006,0x0004002b,
+0x00000059,0x00000191,0x0000000d,0x0004002b,
+0x00000006,0x000001a1,0x00000020,0x0004002b,
+0x00000006,0x000001ad,0x0000001f,0x0004002b,
+0x00000006,0x000001de,0x00000080,0x0004002b,
+0x00000059,0x000001ef,0x00000017,0x0004002b,
+0x00000059,0x000001f4,0x00000019,0x00040020,
+0x0000024d,0x00000007,0x00000059,0x0007002c,
+0x0000005a,0x00000291,0x000000c1,0x000000ca,
+0x000000d0,0x000000d5,0x0004002b,0x00000006,
+0x00000298,0x00000100,0x0004001c,0x00000299,
+0x00000006,0x00000298,0x0004002b,0x00000006,
+0x0000029a,0x00000021,0x0004002b,0x00000006,
+0x0000029b,0x00000009,0x0004002b,0x00000006,
+0x0000029c,0x00000022,0x0004002b,0x00000006,
+0x0000029d,0x00000028,0x0004002b,0x00000006,
+0x0000029e,0x00000029,0x0004002b,0x00000006,
+0x0000029f,0x0000002a,0x0004002b,0x00000006,
+0x000002a0,0x00000011,0x0004002b,0x00000006,
+0x000002a1,0x00000012,0x0004002b,0x00000006,
+0x000002a2,0x00000024,0x0004002b,0x00000006,
+0x000002a3,0x00000014,0x0004002b,0x00000006,
+0x000002a4,0x00000015,0x0004002b,0x00000006,
+0x000002a5,0x00000016,0x0004002b,0x00000006,
+0x000002a6,0x00000025,0x0004002b,0x00000006,
+0x000002a7,0x00000019,0x0004002b,0x00000006,
+0x000002a8,0x0000001a,0x0004002b,0x00000006,
+0x000002a9,0x00000026,0x0004002b,0x00000006,
+0x000002aa,0x00000280,0x0004002b,0x00000006,
+0x000002ab,0x00000281,0x0004002b,0x00000006,
+0x000002ac,0x00000282,0x0004002b,0x00000006,
+0x000002ad,0x000002a0,0x0004002b,0x00000006,
+0x000002ae,0x00000041,0x0004002b,0x00000006,
+0x000002af,0x00000042,0x0004002b,0x00000006,
+0x000002b0,0x00000044,0x0004002b,0x00000006,
+0x000002b1,0x00000045,0x0004002b,0x00000006,
+0x000002b2,0x00000046,0x0004002b,0x00000006,
+0x000002b3,0x00000061,0x0004002b,0x00000006,
+0x000002b4,0x00000048,0x0004002b,0x00000006,
+0x000002b5,0x00000049,0x0004002b,0x00000006,
+0x000002b6,0x0000004a,0x0004002b,0x00000006,
+0x000002b7,0x00000062,0x0004002b,0x00000006,
+0x000002b8,0x00000068,0x0004002b,0x00000006,
+0x000002b9,0x00000069,0x0004002b,0x00000006,
+0x000002ba,0x0000006a,0x0004002b,0x00000006,
+0x000002bb,0x00000050,0x0004002b,0x00000006,
+0x000002bc,0x00000051,0x0004002b,0x00000006,
+0x000002bd,0x00000052,0x0004002b,0x00000006,
+0x000002be,0x00000064,0x0004002b,0x00000006,
+0x000002bf,0x00000054,0x0004002b,0x00000006,
+0x000002c0,0x00000055,0x0004002b,0x00000006,
+0x000002c1,0x00000056,0x0004002b,0x00000006,
+0x000002c2,0x00000065,0x0004002b,0x00000006,
+0x000002c3,0x00000058,0x0004002b,0x00000006,
+0x000002c4,0x00000059,0x0004002b,0x00000006,
+0x000002c5,0x0000005a,0x0004002b,0x00000006,
+0x000002c6,0x00000066,0x0004002b,0x00000006,
+0x000002c7,0x00000284,0x0004002b,0x00000006,
+0x000002c8,0x00000285,0x0004002b,0x00000006,
+0x000002c9,0x00000286,0x0004002b,0x00000006,
+0x000002ca,0x000002a1,0x0004002b,0x00000006,
+0x000002cb,0x00000081,0x0004002b,0x00000006,
+0x000002cc,0x00000082,0x0004002b,0x00000006,
+0x000002cd,0x000000a0,0x0004002b,0x00000006,
+0x000002ce,0x00000084,0x0004002b,0x00000006,
+0x000002cf,0x00000085,0x0004002b,0x00000006,
+0x000002d0,0x00000086,0x0004002b,0x00000006,
+0x000002d1,0x000000a1,0x0004002b,0x00000006,
+0x000002d2,0x00000088,0x0004002b,0x00000006,
+0x000002d3,0x00000089,0x0004002b,0x00000006,
+0x000002d4,0x0000008a,0x0004002b,0x00000006,
+0x000002d5,0x000000a2,0x0004002b,0x00000006,
+0x000002d6,0x000000a8,0x0004002b,0x00000006,
+0x000002d7,0x000000a9,0x0004002b,0x00000006,
+0x000002d8,0x000000aa,0x0004002b,0x00000006,
+0x000002d9,0x00000090,0x0004002b,0x00000006,
+0x000002da,0x00000091,0x0004002b,0x00000006,
+0x000002db,0x00000092,0x0004002b,0x00000006,
+0x000002dc,0x000000a4,0x0004002b,0x00000006,
+0x000002dd,0x00000094,0x0004002b,0x00000006,
+0x000002de,0x00000095,0x0004002b,0x00000006,
+0x000002df,0x00000096,0x0004002b,0x00000006,
+0x000002e0,0x000000a5,0x0004002b,0x00000006,
+0x000002e1,0x00000098,0x0004002b,0x00000006,
+0x000002e2,0x00000099,0x0004002b,0x00000006,
+0x000002e3,0x0000009a,0x0004002b,0x00000006,
+0x000002e4,0x000000a6,0x0004002b,0x00000006,
+0x000002e5,0x00000288,0x0004002b,0x00000006,
+0x000002e6,0x00000289,0x0004002b,0x00000006,
+0x000002e7,0x0000028a,0x0004002b,0x00000006,
+0x000002e8,0x000002a2,0x0004002b,0x00000006,
+0x000002e9,0x00000200,0x0004002b,0x00000006,
+0x000002ea,0x00000201,0x0004002b,0x00000006,
+0x000002eb,0x00000202,0x0004002b,0x00000006,
+0x000002ec,0x00000220,0x0004002b,0x00000006,
+0x000002ed,0x00000204,0x0004002b,0x00000006,
+0x000002ee,0x00000205,0x0004002b,0x00000006,
+0x000002ef,0x00000206,0x0004002b,0x00000006,
+0x000002f0,0x00000221,0x0004002b,0x00000006,
+0x000002f1,0x00000208,0x0004002b,0x00000006,
+0x000002f2,0x00000209,0x0004002b,0x00000006,
+0x000002f3,0x0000020a,0x0004002b,0x00000006,
+0x000002f4,0x00000222,0x0004002b,0x00000006,
+0x000002f5,0x00000228,0x0004002b,0x00000006,
+0x000002f6,0x00000229,0x0004002b,0x00000006,
+0x000002f7,0x0000022a,0x0004002b,0x00000006,
+0x000002f8,0x00000210,0x0004002b,0x00000006,
+0x000002f9,0x00000211,0x0004002b,0x00000006,
+0x000002fa,0x00000212,0x0004002b,0x00000006,
+0x000002fb,0x00000224,0x0004002b,0x00000006,
+0x000002fc,0x00000214,0x0004002b,0x00000006,
+0x000002fd,0x00000215,0x0004002b,0x00000006,
+0x000002fe,0x00000216,0x0004002b,0x00000006,
+0x000002ff,0x00000225,0x0004002b,0x00000006,
+0x00000300,0x00000218,0x0004002b,0x00000006,
+0x00000301,0x00000219,0x0004002b,0x00000006,
+0x00000302,0x0000021a,0x0004002b,0x00000006,
+0x00000303,0x00000226,0x0004002b,0x00000006,
+0x00000304,0x000002a8,0x0004002b,0x00000006,
+0x00000305,0x000002a9,0x0004002b,0x00000006,
+0x00000306,0x000002aa,0x0004002b,0x00000006,
+0x00000307,0x00000101,0x0004002b,0x00000006,
+0x00000308,0x00000102,0x0004002b,0x00000006,
+0x00000309,0x00000120,0x0004002b,0x00000006,
+0x0000030a,0x00000104,0x0004002b,0x00000006,
+0x0000030b,0x00000105,0x0004002b,0x00000006,
+0x0000030c,0x00000106,0x0004002b,0x00000006,
+0x0000030d,0x00000121,0x0004002b,0x00000006,
+0x0000030e,0x00000108,0x0004002b,0x00000006,
+0x0000030f,0x00000109,0x0004002b,0x00000006,
+0x00000310,0x0000010a,0x0004002b,0x00000006,
+0x00000311,0x00000122,0x0004002b,0x00000006,
+0x00000312,0x00000128,0x0004002b,0x00000006,
+0x00000313,0x00000129,0x0004002b,0x00000006,
+0x00000314,0x0000012a,0x0004002b,0x00000006,
+0x00000315,0x00000110,0x0004002b,0x00000006,
+0x00000316,0x00000111,0x0004002b,0x00000006,
+0x00000317,0x00000112,0x0004002b,0x00000006,
+0x00000318,0x00000124,0x0004002b,0x00000006,
+0x00000319,0x00000114,0x0004002b,0x00000006,
+0x0000031a,0x00000115,0x0004002b,0x00000006,
+0x0000031b,0x00000116,0x0004002b,0x00000006,
+0x0000031c,0x00000125,0x0004002b,0x00000006,
+0x0000031d,0x00000118,0x0004002b,0x00000006,
+0x0000031e,0x00000119,0x0004002b,0x00000006,
+0x0000031f,0x0000011a,0x0004002b,0x00000006,
+0x00000320,0x00000126,0x0004002b,0x00000006,
+0x00000321,0x00000290,0x0004002b,0x00000006,
+0x00000322,0x00000291,0x0004002b,0x00000006,
+0x00000323,0x00000292,0x0004002b,0x00000006,
+0x00000324,0x000002a4,0x0004002b,0x00000006,
+0x00000325,0x00000140,0x0004002b,0x00000006,
+0x00000326,0x00000141,0x0004002b,0x00000006,
+0x00000327,0x00000142,0x0004002b,0x00000006,
+0x00000328,0x00000160,0x0004002b,0x00000006,
+0x00000329,0x00000144,0x0004002b,0x00000006,
+0x0000032a,0x00000145,0x0004002b,0x00000006,
+0x0000032b,0x00000146,0x0004002b,0x00000006,
+0x0000032c,0x00000161,0x0004002b,0x00000006,
+0x0000032d,0x00000148,0x0004002b,0x00000006,
+0x0000032e,0x00000149,0x0004002b,0x00000006,
+0x0000032f,0x0000014a,0x0004002b,0x00000006,
+0x00000330,0x00000162,0x0004002b,0x00000006,
+0x00000331,0x00000168,0x0004002b,0x00000006,
+0x00000332,0x00000169,0x0004002b,0x00000006,
+0x00000333,0x0000016a,0x0004002b,0x00000006,
+0x00000334,0x00000150,0x0004002b,0x00000006,
+0x00000335,0x00000151,0x0004002b,0x00000006,
+0x00000336,0x00000152,0x0004002b,0x00000006,
+0x00000337,0x00000164,0x0004002b,0x00000006,
+0x00000338,0x00000154,0x0004002b,0x00000006,
+0x00000339,0x00000155,0x0004002b,0x00000006,
+0x0000033a,0x00000156,0x0004002b,0x00000006,
+0x0000033b,0x00000165,0x0004002b,0x00000006,
+0x0000033c,0x00000158,0x0004002b,0x00000006,
+0x0000033d,0x00000159,0x0004002b,0x00000006,
+0x0000033e,0x0000015a,0x0004002b,0x00000006,
+0x0000033f,0x00000166,0x0004002b,0x00000006,
+0x00000340,0x00000294,0x0004002b,0x00000006,
+0x00000341,0x00000295,0x0004002b,0x00000006,
+0x00000342,0x00000296,0x0004002b,0x00000006,
+0x00000343,0x000002a5,0x0004002b,0x00000006,
+0x00000344,0x00000180,0x0004002b,0x00000006,
+0x00000345,0x00000181,0x0004002b,0x00000006,
+0x00000346,0x00000182,0x0004002b,0x00000006,
+0x00000347,0x000001a0,0x0004002b,0x00000006,
+0x00000348,0x00000184,0x0004002b,0x00000006,
+0x00000349,0x00000185,0x0004002b,0x00000006,
+0x0000034a,0x00000186,0x0004002b,0x00000006,
+0x0000034b,0x000001a1,0x0004002b,0x00000006,
+0x0000034c,0x00000188,0x0004002b,0x00000006,
+0x0000034d,0x00000189,0x0004002b,0x00000006,
+0x0000034e,0x0000018a,0x0004002b,0x00000006,
+0x0000034f,0x000001a2,0x0004002b,0x00000006,
+0x00000350,0x000001a8,0x0004002b,0x00000006,
+0x00000351,0x000001a9,0x0004002b,0x00000006,
+0x00000352,0x000001aa,0x0004002b,0x00000006,
+0x00000353,0x00000190,0x0004002b,0x00000006,
+0x00000354,0x00000191,0x0004002b,0x00000006,
+0x00000355,0x00000192,0x0004002b,0x00000006,
+0x00000356,0x000001a4,0x0004002b,0x00000006,
+0x00000357,0x00000194,0x0004002b,0x00000006,
+0x00000358,0x00000195,0x0004002b,0x00000006,
+0x00000359,0x00000196,0x0004002b,0x00000006,
+0x0000035a,0x000001a5,0x0004002b,0x00000006,
+0x0000035b,0x00000198,0x0004002b,0x00000006,
+0x0000035c,0x00000199,0x0004002b,0x00000006,
+0x0000035d,0x0000019a,0x0004002b,0x00000006,
+0x0000035e,0x000001a6,0x0004002b,0x00000006,
+0x0000035f,0x00000298,0x0004002b,0x00000006,
+0x00000360,0x00000299,0x0004002b,0x00000006,
+0x00000361,0x0000029a,0x0004002b,0x00000006,
+0x00000362,0x000002a6,0x0004002b,0x00000006,
+0x00000363,0x00000240,0x0004002b,0x00000006,
+0x00000364,0x00000241,0x0004002b,0x00000006,
+0x00000365,0x00000242,0x0004002b,0x00000006,
+0x00000366,0x00000260,0x0004002b,0x00000006,
+0x00000367,0x00000244,0x0004002b,0x00000006,
+0x00000368,0x00000245,0x0004002b,0x00000006,
+0x00000369,0x00000246,0x0004002b,0x00000006,
+0x0000036a,0x00000261,0x0004002b,0x00000006,
+0x0000036b,0x00000248,0x0004002b,0x00000006,
+0x0000036c,0x00000249,0x0004002b,0x00000006,
+0x0000036d,0x0000024a,0x0004002b,0x00000006,
+0x0000036e,0x00000262,0x0004002b,0x00000006,
+0x0000036f,0x00000268,0x0004002b,0x00000006,
+0x00000370,0x00000269,0x0004002b,0x00000006,
+0x00000371,0x0000026a,0x0004002b,0x00000006,
+0x00000372,0x00000250,0x0004002b,0x00000006,
+0x00000373,0x00000251,0x0004002b,0x00000006,
+0x00000374,0x00000252,0x0004002b,0x00000006,
+0x00000375,0x00000264,0x0004002b,0x00000006,
+0x00000376,0x00000254,0x0004002b,0x00000006,
+0x00000377,0x00000255,0x0004002b,0x00000006,
+0x00000378,0x00000256,0x0004002b,0x00000006,
+0x00000379,0x00000265,0x0004002b,0x00000006,
+0x0000037a,0x00000258,0x0004002b,0x00000006,
+0x0000037b,0x00000259,0x0004002b,0x00000006,
+0x0000037c,0x0000025a,0x0004002b,0x00000006,
+0x0000037d,0x00000266,0x0103002c,0x00000299,
+0x0000037e,0x0000009d,0x000000a0,0x00000092,
+0x000001a1,0x00000091,0x00000095,0x000000fc,
+0x0000029a,0x0000008d,0x0000029b,0x00000108,
+0x0000029c,0x0000029d,0x0000029e,0x0000029f,
+0x0000029c,0x0000014e,0x000002a0,0x000002a1,
+0x000002a2,0x000002a3,0x000002a4,0x000002a5,
+0x000002a6,0x00000177,0x000002a7,0x000002a8,
+0x000002a9,0x000002aa,0x000002ab,0x000002ac,
+0x000002ad,0x0000017e,0x000002ae,0x000002af,
+0x0000017a,0x000002b0,0x000002b1,0x000002b2,
+0x000002b3,0x000002b4,0x000002b5,0x000002b6,
+0x000002b7,0x000002b8,0x000002b9,0x000002ba,
+0x000002b7,0x000002bb,0x000002bc,0x000002bd,
+0x000002be,0x000002bf,0x000002c0,0x000002c1,
+0x000002c2,0x000002c3,0x000002c4,0x000002c5,
+0x000002c6,0x000002c7,0x000002c8,0x000002c9,
+0x000002ca,0x000001de,0x000002cb,0x000002cc,
+0x000002cd,0x000002ce,0x000002cf,0x000002d0,
+0x000002d1,0x000002d2,0x000002d3,0x000002d4,
+0x000002d5,0x000002d6,0x000002d7,0x000002d8,
+0x000002d5,0x000002d9,0x000002da,0x000002db,
+0x000002dc,0x000002dd,0x000002de,0x000002df,
+0x000002e0,0x000002e1,0x000002e2,0x000002e3,
+0x000002e4,0x000002e5,0x000002e6,0x000002e7,
+0x000002e8,0x000002e9,0x000002ea,0x000002eb,
+0x000002ec,0x000002ed,0x000002ee,0x000002ef,
+0x000002f0,0x000002f1,0x000002f2,0x000002f3,
+0x000002f4,0x000002f5,0x000002f6,0x000002f7,
+0x000002f4,0x000002f8,0x000002f9,0x000002fa,
+0x000002fb,0x000002fc,0x000002fd,0x000002fe,
+0x000002ff,0x00000300,0x00000301,0x00000302,
+0x00000303,0x00000304,0x00000305,0x00000306,
+0x000002e8,0x00000298,0x00000307,0x00000308,
+0x00000309,0x0000030a,0x0000030b,0x0000030c,
+0x0000030d,0x0000030e,0x0000030f,0x00000310,
+0x00000311,0x00000312,0x00000313,0x00000314,
+0x00000311,0x00000315,0x00000316,0x00000317,
+0x00000318,0x00000319,0x0000031a,0x0000031b,
+0x0000031c,0x0000031d,0x0000031e,0x0000031f,
+0x00000320,0x00000321,0x00000322,0x00000323,
+0x00000324,0x00000325,0x00000326,0x00000327,
+0x00000328,0x00000329,0x0000032a,0x0000032b,
+0x0000032c,0x0000032d,0x0000032e,0x0000032f,
+0x00000330,0x00000331,0x00000332,0x00000333,
+0x00000330,0x00000334,0x00000335,0x00000336,
+0x00000337,0x00000338,0x00000339,0x0000033a,
+0x0000033b,0x0000033c,0x0000033d,0x0000033e,
+0x0000033f,0x00000340,0x00000341,0x00000342,
+0x00000343,0x00000344,0x00000345,0x00000346,
+0x00000347,0x00000348,0x00000349,0x0000034a,
+0x0000034b,0x0000034c,0x0000034d,0x0000034e,
+0x0000034f,0x00000350,0x00000351,0x00000352,
+0x0000034f,0x00000353,0x00000354,0x00000355,
+0x00000356,0x00000357,0x00000358,0x00000359,
+0x0000035a,0x0000035b,0x0000035c,0x0000035d,
+0x0000035e,0x0000035f,0x00000360,0x00000361,
+0x00000362,0x00000363,0x00000364,0x00000365,
+0x00000366,0x00000367,0x00000368,0x00000369,
+0x0000036a,0x0000036b,0x0000036c,0x0000036d,
+0x0000036e,0x0000036f,0x00000370,0x00000371,
+0x0000036e,0x00000372,0x00000373,0x00000374,
+0x00000375,0x00000376,0x00000377,0x00000378,
+0x00000379,0x0000037a,0x0000037b,0x0000037c,
+0x0000037d,0x00000304,0x00000305,0x00000306,
+0x00000362,0x00040020,0x00000380,0x00000007,
+0x00000299,0x0006002c,0x00000060,0x000003b4,
+0x000000c0,0x0000015f,0x000000d0,0x0004001c,
+0x000003bb,0x00000006,0x000001de,0x0004002b,
+0x00000006,0x000003bc,0x0000000b,0x0004002b,
+0x00000006,0x000003bd,0x00000013,0x0004002b,
+0x00000006,0x000003be,0x0000001b,0x0004002b,
+0x00000006,0x000003bf,0x0000001c,0x0004002b,
+0x00000006,0x000003c0,0x00000023,0x0004002b,
+0x00000006,0x000003c1,0x000000e4,0x0004002b,
+0x00000006,0x000003c2,0x00000043,0x0004002b,
+0x00000006,0x000003c3,0x0000004b,0x0004002b,
+0x00000006,0x000003c4,0x0000004c,0x0004002b,
+0x00000006,0x000003c5,0x0000010c,0x0004002b,
+0x00000006,0x000003c6,0x00000053,0x0004002b,
+0x00000006,0x000003c7,0x0000005b,0x0004002b,
+0x00000006,0x000003c8,0x0000005c,0x0004002b,
+0x00000006,0x000003c9,0x00000063,0x0004002b,
+0x00000006,0x000003ca,0x0000011c,0x0004002b,
+0x00000006,0x000003cb,0x00000123,0x0004002b,
+0x00000006,0x000003cc,0x00000083,0x0004002b,
+0x00000006,0x000003cd,0x00000103,0x0004002b,
+0x00000006,0x000003ce,0x0000008b,0x0004002b,
+0x00000006,0x000003cf,0x0000008c,0x0004002b,
+0x00000006,0x000003d0,0x0000010b,0x0004002b,
+0x00000006,0x000003d1,0x00000093,0x0004002b,
+0x00000006,0x000003d2,0x00000113,0x0004002b,
+0x00000006,0x000003d3,0x0000009b,0x0004002b,
+0x00000006,0x000003d4,0x0000009c,0x0004002b,
+0x00000006,0x000003d5,0x000000a3,0x0004002b,
+0x00000006,0x000003d6,0x0000011b,0x0004002b,
+0x00000006,0x000003d7,0x000000c0,0x0004002b,
+0x00000006,0x000003d8,0x000000c1,0x0004002b,
+0x00000006,0x000003d9,0x000000c2,0x0004002b,
+0x00000006,0x000003da,0x000000c3,0x0004002b,
+0x00000006,0x000003db,0x000000c4,0x0004002b,
+0x00000006,0x000003dc,0x000000e0,0x0004002b,
+0x00000006,0x000003dd,0x000000c8,0x0004002b,
+0x00000006,0x000003de,0x000000c9,0x0004002b,
+0x00000006,0x000003df,0x000000ca,0x0004002b,
+0x00000006,0x000003e0,0x000000cb,0x0004002b,
+0x00000006,0x000003e1,0x000000cc,0x0004002b,
+0x00000006,0x000003e2,0x000000e1,0x0004002b,
+0x00000006,0x000003e3,0x000000d0,0x0004002b,
+0x00000006,0x000003e4,0x000000d1,0x0004002b,
+0x00000006,0x000003e5,0x000000d2,0x0004002b,
+0x00000006,0x000003e6,0x000000d3,0x0004002b,
+0x00000006,0x000003e7,0x000000d4,0x0004002b,
+0x00000006,0x000003e8,0x000000e2,0x0004002b,
+0x00000006,0x000003e9,0x000000d8,0x0004002b,
+0x00000006,0x000003ea,0x000000d9,0x0004002b,
+0x00000006,0x000003eb,0x000000da,0x0004002b,
+0x00000006,0x000003ec,0x000000db,0x0004002b,
+0x00000006,0x000003ed,0x000000dc,0x0004002b,
+0x00000006,0x000003ee,0x000000e3,0x0083002c,
+0x000003bb,0x000003ef,0x0000009d,0x000000a0,
+0x00000092,0x00000096,0x00000091,0x000001a1,
+0x000002a2,0x00000318,0x0000008d,0x0000029b,
+0x00000108,0x000003bc,0x000000f2,0x0000029a,
+0x000002be,0x00000318,0x0000014e,0x000002a0,
+0x000002a1,0x000003bd,0x000002a3,0x0000029c,
+0x000002dc,0x00000318,0x00000177,0x000002a7,
+0x000002a8,0x000003be,0x000003bf,0x000003c0,
+0x000003c1,0x00000318,0x0000017e,0x000002ae,
+0x000002af,0x000003c2,0x000002b0,0x0000017a,
+0x0000030a,0x00000309,0x000002b4,0x000002b5,
+0x000002b6,0x000003c3,0x000003c4,0x000002b3,
+0x000003c5,0x0000030d,0x000002bb,0x000002bc,
+0x000002bd,0x000003c6,0x000002bf,0x000002b7,
+0x00000319,0x00000311,0x000002c3,0x000002c4,
+0x000002c5,0x000003c7,0x000003c8,0x000003c9,
+0x000003ca,0x000003cb,0x000001de,0x000002cb,
+0x000002cc,0x000003cc,0x000002ce,0x000002cd,
+0x00000308,0x000003cd,0x000002d2,0x000002d3,
+0x000002d4,0x000003ce,0x000003cf,0x000002d1,
+0x00000310,0x000003d0,0x000002d9,0x000002da,
+0x000002db,0x000003d1,0x000002dd,0x000002d5,
+0x00000317,0x000003d2,0x000002e1,0x000002e2,
+0x000002e3,0x000003d3,0x000003d4,0x000003d5,
+0x0000031f,0x000003d6,0x000003d7,0x000003d8,
+0x000003d9,0x000003da,0x000003db,0x000003dc,
+0x00000298,0x00000307,0x000003dd,0x000003de,
+0x000003df,0x000003e0,0x000003e1,0x000003e2,
+0x0000030e,0x0000030f,0x000003e3,0x000003e4,
+0x000003e5,0x000003e6,0x000003e7,0x000003e8,
+0x00000315,0x00000316,0x000003e9,0x000003ea,
+0x000003eb,0x000003ec,0x000003ed,0x000003ee,
+0x0000031d,0x0000031e,0x00040020,0x000003f1,
+0x00000007,0x000003bb,0x0004002b,0x00000006,
+0x00000420,0x0000002d,0x0004001c,0x00000421,
+0x00000006,0x00000420,0x0004002b,0x00000006,
+0x00000422,0x00000034,0x0004002b,0x00000006,
+0x00000423,0x00000027,0x0004002b,0x00000006,
+0x00000424,0x0000002f,0x0004002b,0x00000006,
+0x00000425,0x0000003b,0x0004002b,0x00000006,
+0x00000426,0x00000017,0x0004002b,0x00000006,
+0x00000427,0x00000035,0x0004002b,0x00000006,
+0x00000428,0x00000038,0x0004002b,0x00000006,
+0x00000429,0x00000030,0x0004002b,0x00000006,
+0x0000042a,0x0000003e,0x0004002b,0x00000006,
+0x0000042b,0x0000000d,0x0004002b,0x00000006,
+0x0000042c,0x00000033,0x0004002b,0x00000006,
+0x0000042d,0x0000001e,0x0030002c,0x00000421,
+0x0000042e,0x0000009d,0x000001a1,0x0000017e,
+0x0000009d,0x0000017e,0x000000f2,0x00000422,
+0x000002a7,0x00000423,0x0000009d,0x0000017e,
+0x000002a0,0x00000424,0x00000095,0x00000425,
+0x00000426,0x0000029e,0x000003bc,0x00000427,
+0x000003bf,0x000002a2,0x0000009d,0x0000017e,
+0x0000008d,0x00000428,0x0000014e,0x00000429,
+0x00000177,0x0000029d,0x00000092,0x0000042a,
+0x000003bc,0x00000427,0x000003bd,0x00000420,
+0x000003be,0x000002a6,0x00000095,0x00000425,
+0x0000042b,0x0000042c,0x000002a5,0x0000029f,
+0x0000042d,0x0000029c,0x00040020,0x00000436,
+0x00000007,0x00000421,0x0004001c,0x00000453,
+0x00000006,0x000003c0,0x0004002b,0x00000006,
+0x00000454,0x00000039,0x0004002b,0x00000006,
+0x00000455,0x0000000e,0x0004002b,0x00000006,
+0x00000456,0x00000032,0x0004002b,0x00000006,
+0x00000457,0x0000002b,0x0004002b,0x00000006,
+0x00000458,0x0000003d,0x0004002b,0x00000006,
+0x00000459,0x0000003a,0x0004002b,0x00000006,
+0x0000045a,0x00000037,0x0004002b,0x00000006,
+0x0000045b,0x0000001d,0x0026002c,0x00000453,
+0x0000045c,0x0000009d,0x0000014e,0x000001a1,
+0x00000429,0x0000017e,0x0000009d,0x0000017e,
+0x0000008e,0x00000454,0x00000455,0x00000456,
+0x000002a4,0x00000457,0x000003bf,0x000002a2,
+0x0000009d,0x0000017e,0x0000014e,0x00000429,
+0x00000096,0x00000458,0x000003bd,0x00000420,
+0x000000fc,0x00000459,0x00000426,0x0000029e,
+0x0000029b,0x0000045a,0x000002a8,0x000002a9,
+0x0000042b,0x0000042c,0x0000045b,0x000003c0,
+0x00040020,0x00000464,0x00000007,0x00000453,
+0x0004001c,0x00000477,0x00000011,0x000000fc,
+0x0004002b,0x00000006,0x00000478,0x0000003f,
+0x0005002c,0x00000011,0x00000479,0x00000478,
+0x0000008d,0x0005002c,0x00000011,0x0000047a,
+0x000002a4,0x0000008d,0x0005002c,0x00000011,
+0x0000047b,0x0000029b,0x0000008d,0x0005002c,
+0x00000011,0x0000047c,0x00000092,0x00000091,
+0x0005002c,0x00000011,0x0000047d,0x000000a0,
+0x0000008d,0x0009002c,0x00000477,0x0000047e,
+0x00000479,0x0000047a,0x0000047b,0x00000093,
+0x0000047c,0x0000047d,0x00040020,0x00000481,
+0x00000007,0x00000477,0x00030016,0x000004eb,
+0x00000020,0x00040017,0x000004ec,0x000004eb,
+0x00000004,0x0004002b,0x000004eb,0x000004f1,
+0x41000000,0x0004002b,0x00000006,0x000004f8,
+0x00000400,0x0004002b,0x00000059,0x0000050d,
+0x00000006,0x0004002b,0x00000006,0x00000516,
+0x0000000f,0x0005002c,0x00000011,0x00000525,
+0x0000009d,0x0000009d,0x0004002b,0x00000059,
+0x00000551,0x0000000f,0x0004002b,0x00000059,
+0x00000556,0x00000011,0x0004002b,0x00000059,
+0x00000567,0x00000010,0x0004002b,0x00000059,
+0x0000059d,0x00000008,0x0004002b,0x00000059,
+0x000005a0,0x0000000c,0x0004002b,0x00000059,
+0x000005a7,0x00000014,0x0004002b,0x00000059,
+0x000005aa,0x00000018,0x0004002b,0x00000059,
+0x000005ad,0x0000001c,0x00040017,0x000005d7,
+0x000004eb,0x00000002,0x0007002c,0x0000000f,
+0x000005f5,0x00000455,0x00000108,0x000000fc,
+0x00000092,0x0007002c,0x0000000f,0x000005f8,
+0x00000478,0x00000478,0x00000478,0x00000478,
+0x00040017,0x0000060e,0x000000ad,0x00000003,
+0x0004001c,0x00000634,0x00000008,0x000003bd,
+0x0006002c,0x00000008,0x00000635,0x0000009d,
+0x0000009d,0x0000008d,0x0006002c,0x00000008,
+0x00000636,0x000000a0,0x0000009d,0x000000fc,
+0x0006002c,0x00000008,0x00000637,0x0000009d,
+0x000000a0,0x00000095,0x0006002c,0x00000008,
+0x00000638,0x0000009d,0x0000009d,0x0000008e,
+0x0006002c,0x00000008,0x00000639,0x000000a0,
+0x0000009d,0x00000095,0x0006002c,0x00000008,
+0x0000063a,0x0000009d,0x000000a0,0x00000091,
+0x0006002c,0x00000008,0x0000063b,0x0000009d,
+0x0000009d,0x000000fc,0x0006002c,0x00000008,
+0x0000063c,0x000000a0,0x0000009d,0x00000091,
+0x0006002c,0x00000008,0x0000063d,0x0000009d,
+0x000000a0,0x00000096,0x0016002c,0x00000634,
+0x0000063e,0x00000635,0x00000636,0x00000637,
+0x00000638,0x00000639,0x0000063a,0x0000063b,
+0x0000063c,0x0000063d,0x0000015c,0x0000015b,
+0x0000015a,0x00000159,0x00000158,0x00000157,
+0x00000156,0x00000155,0x00000153,0x00000151,
+0x00040020,0x00000640,0x00000007,0x00000634,
+0x0004002b,0x00000059,0x00000675,0x00000080,
+0x0004002b,0x00000059,0x0000067d,0x0000003f,
+0x0004002b,0x00000006,0x00000693,0x000000ff,
+0x0004002b,0x00000059,0x000006a6,0x000000c0,
+0x0004002b,0x00000059,0x000006af,0x000000ff,
+0x0004002b,0x00000059,0x00000730,0xffffff80,
+0x0007002c,0x0000000f,0x0000075e,0x0000009d,
+0x0000009d,0x0000009d,0x0000009d,0x0004002b,
+0x00000006,0x0000077c,0x0000017d,0x0004001c,
+0x0000077d,0x00000006,0x0000077c,0x0004002b,
+0x00000006,0x0000077e,0x000000ba,0x0004002b,
+0x00000006,0x0000077f,0x000000e8,0x0004002b,
+0x00000006,0x00000780,0x0000002e,0x0004002b,
+0x00000006,0x00000781,0x00000074,0x0004002b,
+0x00000006,0x00000782,0x000000de,0x0004002b,
+0x00000006,0x00000783,0x000000bd,0x0004002b,
+0x00000006,0x00000784,0x000000f4,0x0004002b,
+0x00000006,0x00000785,0x0000002c,0x0004002b,
+0x00000006,0x00000786,0x0000004d,0x0004002b,
+0x00000006,0x00000787,0x000000b2,0x0004002b,
+0x00000006,0x00000788,0x0000006e,0x0004002b,
+0x00000006,0x00000789,0x000000e9,0x0004002b,
+0x00000006,0x0000078a,0x000000a7,0x0004002b,
+0x00000006,0x0000078b,0x00000079,0x0004002b,
+0x00000006,0x0000078c,0x000000ef,0x0004002b,
+0x00000006,0x0000078d,0x000000df,0x0004002b,
+0x00000006,0x0000078e,0x000000cf,0x0004002b,
+0x00000006,0x0000078f,0x000000be,0x0004002b,
+0x00000006,0x00000790,0x000000ae,0x0004002b,
+0x00000006,0x00000791,0x0000009e,0x0004002b,
+0x00000006,0x00000792,0x00000071,0x0004002b,
+0x00000006,0x00000793,0x0000008e,0x0004002b,
+0x00000006,0x00000794,0x000000fa,0x0004002b,
+0x00000006,0x00000795,0x000000ea,0x0004002b,
+0x00000006,0x00000796,0x00000036,0x0004002b,
+0x00000006,0x00000797,0x000000b9,0x0004002b,
+0x00000006,0x00000798,0x00000067,0x0004002b,
+0x00000006,0x00000799,0x00000077,0x0004002b,
+0x00000006,0x0000079a,0x000000b3,0x0004002b,
+0x00000006,0x0000079b,0x0000006c,0x0004002b,
+0x00000006,0x0000079c,0x0000007c,0x0004002b,
+0x00000006,0x0000079d,0x000000f7,0x0004002b,
+0x00000006,0x0000079e,0x000000e7,0x0004002b,
+0x00000006,0x0000079f,0x000000d7,0x0004002b,
+0x00000006,0x000007a0,0x000000c7,0x0004002b,
+0x00000006,0x000007a1,0x000000bf,0x0004002b,
+0x00000006,0x000007a2,0x000000b7,0x0004002b,
+0x00000006,0x000007a3,0x000000af,0x0004002b,
+0x00000006,0x000007a4,0x0000009f,0x0004002b,
+0x00000006,0x000007a5,0x00000097,0x0004002b,
+0x00000006,0x000007a6,0x00000070,0x0004002b,
+0x00000006,0x000007a7,0x0000008f,0x0004002b,
+0x00000006,0x000007a8,0x00000078,0x0004002b,
+0x00000006,0x000007a9,0x00000087,0x0004002b,
+0x00000006,0x000007aa,0x000000fd,0x0004002b,
+0x00000006,0x000007ab,0x000000f5,0x0004002b,
+0x00000006,0x000007ac,0x000000ed,0x0004002b,
+0x00000006,0x000007ad,0x000000e5,0x0004002b,
+0x00000006,0x000007ae,0x000000bc,0x0004002b,
+0x00000006,0x000007af,0x000000b4,0x0004002b,
+0x00000006,0x000007b0,0x000000ac,0x0004002b,
+0x00000006,0x000007b1,0x0000006b,0x0004002b,
+0x00000006,0x000007b2,0x00000073,0x0004002b,
+0x00000006,0x000007b3,0x0000007b,0x0004002b,
+0x00000006,0x000007b4,0x000000f2,0x0004002b,
+0x00000006,0x000007b5,0x0000004e,0x0004002b,
+0x00000006,0x000007b6,0x000000b1,0x0004002b,
+0x00000006,0x000007b7,0x0000005e,0x0004002b,
+0x00000006,0x000007b8,0x00000076,0x0004002b,
+0x00000006,0x000007b9,0x0000007e,0x0004002b,
+0x00000006,0x000007ba,0x000000fb,0x0004002b,
+0x00000006,0x000007bb,0x000000f3,0x0004002b,
+0x00000006,0x000007bc,0x000000eb,0x0004002b,
+0x00000006,0x000007bd,0x0000003c,0x0004002b,
+0x00000006,0x000007be,0x000000bb,0x0004002b,
+0x00000006,0x000007bf,0x000000ab,0x0004002b,
+0x00000006,0x000007c0,0x000000fe,0x0004002b,
+0x00000006,0x000007c1,0x000000f6,0x0004002b,
+0x00000006,0x000007c2,0x000000ee,0x0004002b,
+0x00000006,0x000007c3,0x000000e6,0x0004002b,
+0x00000006,0x000007c4,0x000000d6,0x0004002b,
+0x00000006,0x000007c5,0x00000031,0x0004002b,
+0x00000006,0x000007c6,0x000000ce,0x0004002b,
+0x00000006,0x000007c7,0x000000c6,0x0004002b,
+0x00000006,0x000007c8,0x000000b6,0x0004002b,
+0x00000006,0x000007c9,0x0000005d,0x0004002b,
+0x00000006,0x000007ca,0x0000006d,0x0004002b,
+0x00000006,0x000007cb,0x00000075,0x0004002b,
+0x00000006,0x000007cc,0x0000007d,0x0004002b,
+0x00000006,0x000007cd,0x000000f9,0x0004002b,
+0x00000006,0x000007ce,0x000000f1,0x0004002b,
+0x00000006,0x000007cf,0x000000dd,0x0004002b,
+0x00000006,0x000007d0,0x000000d5,0x0004002b,
+0x00000006,0x000007d1,0x000000cd,0x0004002b,
+0x00000006,0x000007d2,0x000000c5,0x0004002b,
+0x00000006,0x000007d3,0x000000b5,0x0004002b,
+0x00000006,0x000007d4,0x000000ad,0x0004002b,
+0x00000006,0x000007d5,0x0000009d,0x0004002b,
+0x00000006,0x000007d6,0x00000072,0x0004002b,
+0x00000006,0x000007d7,0x0000008d,0x0004002b,
+0x00000006,0x000007d8,0x0000007a,0x0180002c,
+0x0000077d,0x000007d9,0x0000009d,0x0000009d,
+0x0000009d,0x0000009d,0x00000693,0x0000042c,
+0x000003e1,0x000002c6,0x000002e2,0x0000009d,
+0x00000693,0x000002b1,0x0000077e,0x00000426,
+0x0000077f,0x000003c8,0x000003d5,0x00000780,
+0x000003e4,0x00000781,0x000003ce,0x0000009d,
+0x00000693,0x0000029a,0x00000782,0x000002af,
+0x00000783,0x000003c9,0x000003d4,0x000003bc,
+0x00000784,0x00000785,0x000003e6,0x00000786,
+0x00000787,0x00000788,0x000002da,0x000002a5,
+0x00000789,0x0000045a,0x000003dd,0x000002c3,
+0x0000078a,0x0000078b,0x000002d0,0x0000009d,
+0x00000693,0x0000014e,0x0000078c,0x000001a1,
+0x0000078d,0x00000429,0x0000078e,0x000002ae,
+0x0000078f,0x000002bc,0x00000790,0x000002b3,
+0x00000791,0x00000792,0x00000793,0x00000095,
+0x00000794,0x000002a4,0x00000795,0x000002a9,
+0x000003ea,0x00000796,0x000003de,0x000002b2,
+0x00000797,0x000002c1,0x000002d7,0x00000798,
+0x000002e1,0x00000799,0x000002d2,0x000003bc,
+0x00000784,0x000003be,0x000003c1,0x00000457,
+0x000003e7,0x00000425,0x000003db,0x000003c4,
+0x0000079a,0x000003c8,0x000003d5,0x0000079b,
+0x000003d1,0x0000079c,0x000003cc,0x0000009d,
+0x00000693,0x0000008d,0x0000079d,0x0000014e,
+0x0000078c,0x00000177,0x0000079e,0x000001a1,
+0x0000078d,0x0000029d,0x0000079f,0x00000429,
+0x0000078e,0x00000428,0x000007a0,0x0000017e,
+0x000007a1,0x000002b4,0x000007a2,0x000002bb,
+0x000007a3,0x000002c3,0x0000078a,0x0000017a,
+0x000007a4,0x000002b8,0x000007a5,0x000007a6,
+0x000007a7,0x000007a8,0x000007a9,0x00000092,
+0x000007aa,0x00000108,0x000007ab,0x000002a1,
+0x000007ac,0x000002a8,0x000007ad,0x000003c0,
+0x000003ed,0x00000457,0x000003e7,0x0000042c,
+0x000003e1,0x00000425,0x000003db,0x000003c2,
+0x000007ae,0x000003c3,0x000007af,0x000003c6,
+0x000007b0,0x000003c7,0x000002dc,0x000003c9,
+0x000003d4,0x000007b1,0x000002dd,0x000007b2,
+0x000003cf,0x000007b3,0x000002ce,0x00000095,
+0x00000794,0x0000042b,0x000007b4,0x000002a4,
+0x00000795,0x0000045b,0x000003e8,0x000002a6,
+0x000003eb,0x00000420,0x000003e5,0x00000427,
+0x000003df,0x00000458,0x000003d9,0x000002b2,
+0x00000797,0x000007b5,0x000007b6,0x000002c1,
+0x000002d7,0x000007b7,0x000002d1,0x000002c6,
+0x000002e2,0x00000788,0x000002da,0x000007b8,
+0x000002d3,0x000007b9,0x000002cb,0x0000009d,
+0x00000693,0x00000091,0x000007ba,0x0000008d,
+0x0000079d,0x000000f2,0x000007bb,0x0000014e,
+0x0000078c,0x000002a3,0x000007bc,0x00000177,
+0x0000079e,0x000003bf,0x000003ee,0x000001a1,
+0x0000078d,0x000002a2,0x000003ec,0x0000029d,
+0x0000079f,0x00000785,0x000003e6,0x00000429,
+0x0000078e,0x00000422,0x000003e0,0x00000428,
+0x000007a0,0x000007bd,0x000003da,0x0000017e,
+0x000007a1,0x000002b0,0x000007be,0x000002b4,
+0x000007a2,0x000003c4,0x0000079a,0x000002bb,
+0x000007a3,0x000002bf,0x000007bf,0x000002c3,
+0x0000078a,0x000003c8,0x000003d5,0x0000017a,
+0x000007a4,0x000002be,0x000003d3,0x000002b8,
+0x000007a5,0x0000079b,0x000003d1,0x000007a6,
+0x000007a7,0x00000781,0x000003ce,0x000007a8,
+0x000007a9,0x0000079c,0x000003cc,0x000000a0,
+0x000007c0,0x00000095,0x00000794,0x0000029b,
+0x000007c1,0x0000042b,0x000007b4,0x000002a0,
+0x000007c2,0x000002a4,0x00000795,0x000002a7,
+0x000007c3,0x0000045b,0x000003e8,0x0000029a,
+0x00000782,0x000002a6,0x000003eb,0x0000029e,
+0x000007c4,0x00000420,0x000003e5,0x000007c5,
+0x000007c6,0x00000427,0x000003df,0x00000454,
+0x000007c7,0x00000458,0x000003d9,0x000002ae,
+0x0000078f,0x000002b1,0x0000077e,0x000002b5,
+0x000007c8,0x00000786,0x00000787,0x000002bc,
+0x00000790,0x000002c0,0x000002d8,0x000002c4,
+0x000002e4,0x000007c9,0x000002d5,0x000002b3,
+0x00000791,0x000002c2,0x000002e3,0x000002b9,
+0x000002df,0x000007ca,0x000002db,0x00000792,
+0x00000793,0x000007cb,0x000002d4,0x0000078b,
+0x000002d0,0x000007cc,0x000002cc,0x00000092,
+0x000007aa,0x000000fc,0x000007cd,0x00000108,
+0x000007ab,0x00000455,0x000007ce,0x000002a1,
+0x000007ac,0x000002a5,0x00000789,0x000002a8,
+0x000007ad,0x0000042d,0x000003e2,0x0000029c,
+0x000007cf,0x000002a9,0x000003ea,0x0000029f,
+0x000007d0,0x00000780,0x000003e4,0x00000456,
+0x000007d1,0x00000796,0x000003de,0x00000459,
+0x000007d2,0x0000042a,0x000003d8,0x000002af,
+0x00000783,0x000002b2,0x00000797,0x000002b6,
+0x000007d3,0x000007b5,0x000007b6,0x000002bd,
+0x000007d4,0x000002c1,0x000002d7,0x000002c5,
+0x000002e0,0x000007b7,0x000002d1,0x000002b7,
+0x000007d5,0x000002c6,0x000002e2,0x000002ba,
+0x000002de,0x00000788,0x000002da,0x000007d6,
+0x000007d7,0x000007b8,0x000002d3,0x000007d8,
+0x000002cf,0x000007b9,0x000002cb,0x00040020,
+0x000007e1,0x00000007,0x0000077d,0x0004002b,
+0x00000006,0x00000800,0x0000013b,0x0004001c,
+0x00000801,0x00000006,0x00000800,0x0004002b,
+0x00000006,0x00000802,0x00000047,0x0004002b,
+0x00000006,0x00000803,0x000000b8,0x0004002b,
+0x00000006,0x00000804,0x000000ec,0x0004002b,
+0x00000006,0x00000805,0x000000fc,0x0004002b,
+0x00000006,0x00000806,0x00000057,0x013e002c,
+0x00000801,0x00000807,0x0000009d,0x0000009d,
+0x0000009d,0x0000009d,0x0000009d,0x0000009d,
+0x00000693,0x000003bf,0x000003ee,0x00000428,
+0x000007a0,0x000002bf,0x000007bf,0x00000792,
+0x00000793,0x0000009d,0x00000693,0x000003c2,
+0x000007ae,0x0000042b,0x000007b4,0x000002bb,
+0x000007a3,0x000003be,0x000003c1,0x000007b7,
+0x000002d1,0x0000029d,0x0000079f,0x000007b1,
+0x000002dd,0x00000796,0x000003de,0x0000078b,
+0x000002d0,0x0000009d,0x00000693,0x000001a1,
+0x0000078d,0x000002ae,0x0000078f,0x000002b3,
+0x00000791,0x000000fc,0x000007cd,0x00000423,
+0x000003e9,0x00000802,0x00000803,0x000002b8,
+0x000007a5,0x0000042b,0x000007b4,0x00000420,
+0x000003e5,0x000007b5,0x000007b6,0x00000788,
+0x000002da,0x000003bd,0x00000804,0x00000422,
+0x000003e0,0x000002bf,0x000007bf,0x000007cb,
+0x000002d4,0x000002a8,0x000007ad,0x00000459,
+0x000007d2,0x000003c7,0x000002dc,0x000007b3,
+0x000002ce,0x0000009d,0x00000693,0x0000014e,
+0x0000078c,0x000001a1,0x0000078d,0x00000429,
+0x0000078e,0x0000017e,0x000007a1,0x000002bb,
+0x000007a3,0x0000017a,0x000007a4,0x000007a6,
+0x000007a7,0x00000096,0x00000805,0x000003bd,
+0x00000804,0x000003c0,0x000003ed,0x0000042c,
+0x000003e1,0x000003c2,0x000007ae,0x000003c6,
+0x000007b0,0x000002be,0x000003d3,0x00000781,
+0x000003ce,0x000000fc,0x000007cd,0x000002a5,
+0x00000789,0x000002a9,0x000003ea,0x00000796,
+0x000003de,0x00000802,0x00000803,0x00000806,
+0x000002d6,0x00000798,0x000002e1,0x00000799,
+0x000002d2,0x0000029b,0x000007c1,0x000002a7,
+0x000007c3,0x0000029f,0x000007d0,0x00000459,
+0x000007d2,0x000002b6,0x000007d3,0x000002c5,
+0x000002e0,0x000002ba,0x000002de,0x000007d8,
+0x000002cf,0x0000042b,0x000007b4,0x0000045b,
+0x000003e8,0x00000420,0x000003e5,0x00000458,
+0x000003d9,0x00000786,0x00000787,0x000007c9,
+0x000002d5,0x000007ca,0x000002db,0x000007cc,
+0x000002cc,0x0000009d,0x00000693,0x0000008d,
+0x0000079d,0x0000014e,0x0000078c,0x00000177,
+0x0000079e,0x000001a1,0x0000078d,0x0000029d,
+0x0000079f,0x00000429,0x0000078e,0x00000428,
+0x000007a0,0x0000017e,0x000007a1,0x000002b4,
+0x000007a2,0x000002bb,0x000007a3,0x000002c3,
+0x0000078a,0x0000017a,0x000007a4,0x000002b8,
+0x000007a5,0x000007a6,0x000007a7,0x000007a8,
+0x000007a9,0x000000a0,0x000007c0,0x0000029b,
+0x000007c1,0x000002a0,0x000007c2,0x000002a7,
+0x000007c3,0x0000029a,0x00000782,0x0000029e,
+0x000007c4,0x000007c5,0x000007c6,0x00000454,
+0x000007c7,0x000002ae,0x0000078f,0x000002b5,
+0x000007c8,0x000002bc,0x00000790,0x000002c4,
+0x000002e4,0x000002b3,0x00000791,0x000002b9,
+0x000002df,0x00000792,0x00000793,0x0000078b,
+0x000002d0,0x00000096,0x00000805,0x000003bc,
+0x00000784,0x000003bd,0x00000804,0x000003be,
+0x000003c1,0x000003c0,0x000003ed,0x00000457,
+0x000003e7,0x0000042c,0x000003e1,0x00000425,
+0x000003db,0x000003c2,0x000007ae,0x000003c3,
+0x000007af,0x000003c6,0x000007b0,0x000003c7,
+0x000002dc,0x000003c9,0x000003d4,0x000007b1,
+0x000002dd,0x000007b2,0x000003cf,0x000007b3,
+0x000002ce,0x00000091,0x000007ba,0x000000f2,
+0x000007bb,0x000002a3,0x000007bc,0x000003bf,
+0x000003ee,0x000002a2,0x000003ec,0x00000785,
+0x000003e6,0x00000422,0x000003e0,0x000007bd,
+0x000003da,0x000002b0,0x000007be,0x000003c4,
+0x0000079a,0x000002bf,0x000007bf,0x000003c8,
+0x000003d5,0x000002be,0x000003d3,0x0000079b,
+0x000003d1,0x00000781,0x000003ce,0x0000079c,
+0x000003cc,0x000000fc,0x000007cd,0x00000455,
+0x000007ce,0x000002a5,0x00000789,0x0000042d,
+0x000003e2,0x000002a9,0x000003ea,0x00000780,
+0x000003e4,0x00000796,0x000003de,0x0000042a,
+0x000003d8,0x000002b2,0x00000797,0x000007b5,
+0x000007b6,0x000002c1,0x000002d7,0x000007b7,
+0x000002d1,0x000002c6,0x000002e2,0x00000788,
+0x000002da,0x000007b8,0x000002d3,0x000007b9,
+0x000002cb,0x00040020,0x0000080f,0x00000007,
+0x00000801,0x0004001c,0x00000824,0x00000011,
+0x0000008d,0x0005002c,0x00000011,0x00000825,
+0x00000693,0x0000008d,0x0005002c,0x00000011,
+0x00000826,0x000002c0,0x0000008d,0x0005002c,
+0x00000011,0x00000827,0x000002a2,0x000000a0,
+0x0005002c,0x00000011,0x00000828,0x000002a0,
+0x0000008d,0x0005002c,0x00000011,0x00000829,
+0x0000008d,0x00000092,0x0005002c,0x00000011,
+0x0000082a,0x00000091,0x00000091,0x0005002c,
+0x00000011,0x0000082b,0x00000092,0x000000fc,
+0x000b002c,0x00000824,0x0000082c,0x00000825,
+0x00000826,0x00000827,0x00000828,0x00000829,
+0x0000082a,0x0000082b,0x0000047d,0x00040020,
+0x0000082f,0x00000007,0x00000824,0x0004002b,
+0x00000059,0x00000841,0x00000060,0x0004002b,
+0x00000059,0x00000842,0x00000040,0x0004002b,
+0x00000059,0x00000843,0x00000020,0x0007002c,
+0x0000005a,0x00000844,0x00000841,0x00000842,
+0x00000843,0x000000c0,0x0007002c,0x0000000f,
+0x00000848,0x000000a0,0x000000a0,0x000000a0,
+0x000000a0,0x0007002c,0x0000005a,0x0000084a,
+0x000000c0,0x000000c0,0x000000c0,0x000000c0,
+0x0004002b,0x00000059,0x0000084b,0x0000001f,
+0x0007002c,0x0000005a,0x0000084c,0x0000084b,
+0x0000084b,0x0000084b,0x0000084b,0x0004002b,
+0x00000006,0x00000852,0xffffffff,0x0007002c,
+0x0000000f,0x00000853,0x00000852,0x00000852,
+0x00000852,0x00000852,0x0007002c,0x0000000f,
+0x00000856,0x000001de,0x0000017a,0x0000017e,
+0x000001a1,0x00040017,0x00000857,0x000000ad,
+0x00000004,0x0007002c,0x0000000f,0x0000085f,
+0x00000693,0x0000009d,0x00000693,0x00000693,
+0x0004002b,0x00000059,0x0000089a,0x0000001d,
+0x0004002b,0x00000059,0x0000089e,0xfffffffe,
+0x00040020,0x0000091c,0x00000001,0x00000008,
+0x0004003b,0x0000091c,0x0000091d,0x00000001,
+0x0005001e,0x00000921,0x00000011,0x00000006,
+0x00000006,0x00040020,0x00000922,0x00000009,
+0x00000921,0x0004003b,0x00000922,0x00000923,
+0x00000009,0x00040020,0x00000924,0x00000009,
+0x00000006,0x00040020,0x00000927,0x00000001,
+0x00000006,0x00040020,0x0000092d,0x00000009,
+0x00000011,0x00090019,0x00000937,0x00000006,
+0x00000000,0x00000000,0x00000001,0x00000000,
+0x00000002,0x0000001e,0x00040020,0x00000938,
+0x00000000,0x00000937,0x0004003b,0x00000938,
+0x00000939,0x00000000,0x00090019,0x0000094f,
+0x00000006,0x00000000,0x00000000,0x00000001,
+0x00000000,0x00000002,0x00000020,0x00040020,
+0x00000950,0x00000000,0x0000094f,0x0004003b,
+0x00000950,0x00000951,0x00000000,0x0006002c,
+0x00000008,0x0000095d,0x0000008d,0x0000008d,
+0x000000a0,0x00050036,0x00000002,0x00000004,
+0x00000000,0x00000003,0x000200f8,0x00000005,
+0x0004003b,0x00000012,0x0000091b,0x00000007,
+0x0004003b,0x00000007,0x00000920,0x00000007,
+0x0004003b,0x00000012,0x0000092b,0x00000007,
+0x0004003b,0x00000012,0x00000931,0x00000007,
+0x0004003b,0x00000010,0x00000936,0x00000007,
+0x0004003b,0x00000061,0x00000942,0x00000007,
+0x0004003b,0x00000010,0x00000946,0x00000007,
+0x0004003b,0x00000012,0x00000948,0x00000007,
+0x0004003b,0x00000010,0x0000094c,0x00000007,
+0x0004003b,0x00000061,0x0000095a,0x00000007,
+0x0004003d,0x00000008,0x0000091e,0x0000091d,
+0x0007004f,0x00000011,0x0000091f,0x0000091e,
+0x0000091e,0x00000000,0x00000001,0x0003003e,
+0x0000091b,0x0000091f,0x00050041,0x00000924,
+0x00000925,0x00000923,0x000000cb,0x0004003d,
+0x00000006,0x00000926,0x00000925,0x00050041,
+0x00000927,0x00000928,0x0000091d,0x00000092,
+0x0004003d,0x00000006,0x00000929,0x00000928,
+0x00050080,0x00000006,0x0000092a,0x00000926,
+0x00000929,0x0003003e,0x00000920,0x0000092a,
+0x0004003d,0x00000011,0x0000092c,0x0000091b,
+0x00050041,0x0000092d,0x0000092e,0x00000923,
+0x000000c0,0x0004003d,0x00000011,0x0000092f,
+0x0000092e,0x00050086,0x00000011,0x00000930,
+0x0000092c,0x0000092f,0x0003003e,0x0000092b,
+0x00000930,0x0004003d,0x00000011,0x00000932,
+0x0000091b,0x00050041,0x0000092d,0x00000933,
+0x00000923,0x000000c0,0x0004003d,0x00000011,
+0x00000934,0x00000933,0x00050089,0x00000011,
+0x00000935,0x00000932,0x00000934,0x0003003e,
+0x00000931,0x00000935,0x0004003d,0x00000937,
+0x0000093a,0x00000939,0x0004003d,0x00000011,
+0x0000093b,0x0000092b,0x0004007c,0x00000082,
+0x0000093c,0x0000093b,0x0004003d,0x00000006,
+0x0000093d,0x00000920,0x0004007c,0x00000059,
+0x0000093e,0x0000093d,0x00050051,0x00000059,
+0x0000093f,0x0000093c,0x00000000,0x00050051,
+0x00000059,0x00000940,0x0000093c,0x00000001,
+0x00060050,0x00000060,0x00000941,0x0000093f,
+0x00000940,0x0000093e,0x0003003e,0x00000942,
+0x00000941,0x00050039,0x00000082,0x00000943,
+0x00000085,0x00000942,0x00050062,0x0000000f,
+0x00000944,0x0000093a,0x00000943,0x0009004f,
+0x0000000f,0x00000945,0x00000944,0x00000944,
+0x00000003,0x00000002,0x00000001,0x00000000,
+0x0003003e,0x00000936,0x00000945,0x0004003d,
+0x0000000f,0x00000947,0x00000936,0x0003003e,
+0x00000946,0x00000947,0x00050041,0x0000092d,
+0x00000949,0x00000923,0x000000c0,0x0004003d,
+0x00000011,0x0000094a,0x00000949,0x0003003e,
+0x00000948,0x0000094a,0x00060039,0x00000002,
+0x0000094b,0x00000016,0x00000946,0x00000948,
+0x0004003d,0x00000011,0x0000094d,0x00000931,
+0x00050039,0x0000000f,0x0000094e,0x00000080,
+0x0000094d,0x0003003e,0x0000094c,0x0000094e,
+0x0004003d,0x0000094f,0x00000952,0x00000951,
+0x0004003d,0x00000011,0x00000953,0x0000091b,
+0x0004007c,0x00000082,0x00000954,0x00000953,
+0x0004003d,0x00000006,0x00000955,0x00000920,
+0x0004007c,0x00000059,0x00000956,0x00000955,
+0x00050051,0x00000059,0x00000957,0x00000954,
+0x00000000,0x00050051,0x00000059,0x00000958,
+0x00000954,0x00000001,0x00060050,0x00000060,
+0x00000959,0x00000957,0x00000958,0x00000956,
+0x0003003e,0x0000095a,0x00000959,0x00050039,
+0x00000082,0x0000095b,0x00000085,0x0000095a,
+0x0004003d,0x0000000f,0x0000095c,0x0000094c,
+0x00040063,0x00000952,0x0000095b,0x0000095c,
+0x000100fd,0x00010038,0x00050036,0x00000006,
+0x0000000d,0x00000000,0x0000000a,0x00030037,
+0x00000007,0x0000000b,0x00030037,0x00000009,
+0x0000000c,0x000200f8,0x0000000e,0x0004003b,
+0x00000012,0x00000087,0x00000007,0x0004003d,
+0x00000006,0x00000088,0x0000000b,0x0004003d,
+0x00000008,0x00000089,0x0000000c,0x0007004f,
+0x00000011,0x0000008a,0x00000089,0x00000089,
+0x00000000,0x00000001,0x00050050,0x00000011,
+0x0000008b,0x00000088,0x00000088,0x00050084,
+0x00000011,0x0000008c,0x0000008b,0x0000008a,
+0x00050084,0x00000011,0x00000090,0x0000008c,
+0x0000008f,0x00050080,0x00000011,0x00000094,
+0x00000090,0x00000093,0x00050086,0x00000011,
+0x00000098,0x00000094,0x00000097,0x0003003e,
+0x00000087,0x00000098,0x0004003d,0x00000006,
+0x00000099,0x0000000b,0x00050041,0x00000007,
+0x0000009a,0x0000000c,0x00000092,0x0004003d,
+0x00000006,0x0000009b,0x0000009a,0x00050084,
+0x00000006,0x0000009c,0x00000099,0x0000009b,
+0x00050041,0x00000007,0x0000009e,0x00000087,
+0x0000009d,0x0004003d,0x00000006,0x0000009f,
+0x0000009e,0x00050041,0x00000007,0x000000a1,
+0x00000087,0x000000a0,0x0004003d,0x00000006,
+0x000000a2,0x000000a1,0x00050080,0x00000006,
+0x000000a3,0x0000009f,0x000000a2,0x00050080,
+0x00000006,0x000000a4,0x0000009c,0x000000a3,
+0x000200fe,0x000000a4,0x00010038,0x00050036,
+0x00000002,0x00000016,0x00000000,0x00000013,
+0x00030037,0x00000010,0x00000014,0x00030037,
+0x00000012,0x00000015,0x000200f8,0x00000017,
+0x0004003b,0x00000007,0x000000bd,0x00000007,
+0x0004003b,0x00000007,0x000000c3,0x00000007,
+0x0004003b,0x00000007,0x000000c7,0x00000007,
+0x0004003b,0x00000007,0x000000cd,0x00000007,
+0x0004003b,0x00000007,0x000000d2,0x00000007,
+0x0004003b,0x00000007,0x000000d7,0x00000007,
+0x0004003b,0x00000007,0x000000e6,0x00000007,
+0x0004003b,0x00000163,0x00000164,0x00000007,
+0x0004003b,0x00000007,0x00000171,0x00000007,
+0x0004003b,0x00000009,0x00000173,0x00000007,
+0x0004003d,0x0000000f,0x000000a9,0x00000014,
+0x0003003e,0x000000a8,0x000000a9,0x0004003d,
+0x00000011,0x000000ac,0x00000015,0x0003003e,
+0x000000ab,0x000000ac,0x0003003e,0x000000af,
+0x000000b0,0x00050041,0x000000b2,0x000000b3,
+0x000000a8,0x00000096,0x0004003d,0x00000006,
+0x000000b4,0x000000b3,0x000500c7,0x00000006,
+0x000000b6,0x000000b4,0x000000b5,0x000500aa,
+0x000000ad,0x000000b8,0x000000b6,0x000000b7,
+0x0003003e,0x000000b1,0x000000b8,0x0004003d,
+0x000000ad,0x000000b9,0x000000b1,0x000300f7,
+0x000000bb,0x00000000,0x000400fa,0x000000b9,
+0x000000ba,0x000000bb,0x000200f8,0x000000ba,
+0x000100fd,0x000200f8,0x000000bb,0x00050041,
+0x000000b2,0x000000be,0x000000a8,0x00000096,
+0x0004003d,0x00000006,0x000000bf,0x000000be,
+0x000600cb,0x00000006,0x000000c2,0x000000bf,
+0x000000c0,0x000000c1,0x0003003e,0x000000bd,
+0x000000c2,0x00050041,0x000000b2,0x000000c4,
+0x000000a8,0x00000096,0x0004003d,0x00000006,
+0x000000c5,0x000000c4,0x000600cb,0x00000006,
+0x000000c6,0x000000c5,0x000000c1,0x000000c1,
+0x0003003e,0x000000c3,0x000000c6,0x00050041,
+0x000000b2,0x000000c8,0x000000a8,0x00000096,
+0x0004003d,0x00000006,0x000000c9,0x000000c8,
+0x000600cb,0x00000006,0x000000cc,0x000000c9,
+0x000000ca,0x000000cb,0x0003003e,0x000000c7,
+0x000000cc,0x00050041,0x000000b2,0x000000ce,
+0x000000a8,0x00000096,0x0004003d,0x00000006,
+0x000000cf,0x000000ce,0x000600cb,0x00000006,
+0x000000d1,0x000000cf,0x000000d0,0x000000c1,
+0x0003003e,0x000000cd,0x000000d1,0x00050041,
+0x000000b2,0x000000d3,0x000000a8,0x00000096,
+0x0004003d,0x00000006,0x000000d4,0x000000d3,
+0x000600cb,0x00000006,0x000000d6,0x000000d4,
+0x000000d5,0x000000c1,0x0003003e,0x000000d2,
+0x000000d6,0x00050041,0x000000b2,0x000000d8,
+0x000000a8,0x00000096,0x0004003d,0x00000006,
+0x000000d9,0x000000d8,0x000600cb,0x00000006,
+0x000000db,0x000000d9,0x000000da,0x000000cb,
+0x0003003e,0x000000d7,0x000000db,0x00050041,
+0x000000b2,0x000000dd,0x000000a8,0x00000096,
+0x0004003d,0x00000006,0x000000de,0x000000dd,
+0x000600cb,0x00000006,0x000000e0,0x000000de,
+0x000000df,0x000000cb,0x000500ab,0x000000ad,
+0x000000e1,0x000000e0,0x0000009d,0x0003003e,
+0x000000dc,0x000000e1,0x0004003d,0x00000006,
+0x000000e2,0x000000bd,0x000500aa,0x000000ad,
+0x000000e3,0x000000e2,0x0000009d,0x000300f7,
+0x000000e5,0x00000000,0x000400fa,0x000000e3,
+0x000000e4,0x00000114,0x000200f8,0x000000e4,
+0x0004003d,0x00000006,0x000000e7,0x000000c3,
+0x000500c4,0x00000006,0x000000e8,0x000000e7,
+0x000000cb,0x0004003d,0x00000006,0x000000e9,
+0x000000c7,0x000500c5,0x00000006,0x000000ea,
+0x000000e8,0x000000e9,0x0003003e,0x000000e6,
+0x000000ea,0x0004003d,0x00000006,0x000000eb,
+0x000000d2,0x000300f7,0x000000f0,0x00000000,
+0x000b00fb,0x000000eb,0x000000f0,0x00000000,
+0x000000ec,0x00000001,0x000000ed,0x00000002,
+0x000000ee,0x00000003,0x000000ef,0x000200f8,
+0x000000ec,0x0004003d,0x00000006,0x000000f3,
+0x000000cd,0x00050080,0x00000006,0x000000f4,
+0x000000f3,0x00000092,0x00050050,0x00000011,
+0x000000f5,0x000000f2,0x000000f4,0x0003003e,
+0x000000f1,0x000000f5,0x000200f9,0x000000f0,
+0x000200f8,0x000000ed,0x0004003d,0x00000006,
+0x000000f7,0x000000cd,0x00050080,0x00000006,
+0x000000f8,0x000000f7,0x00000092,0x00050050,
+0x00000011,0x000000f9,0x000000f8,0x000000f2,
+0x0003003e,0x000000f1,0x000000f9,0x000200f9,
+0x000000f0,0x000200f8,0x000000ee,0x0004003d,
+0x00000006,0x000000fb,0x000000cd,0x00050080,
+0x00000006,0x000000fd,0x000000fb,0x000000fc,
+0x00050041,0x000000b2,0x000000fe,0x000000a8,
+0x00000096,0x0004003d,0x00000006,0x000000ff,
+0x000000fe,0x000600cb,0x00000006,0x00000100,
+0x000000ff,0x000000da,0x000000c1,0x00050080,
+0x00000006,0x00000101,0x00000100,0x000000fc,
+0x00050050,0x00000011,0x00000102,0x000000fd,
+0x00000101,0x0003003e,0x000000f1,0x00000102,
+0x0003003e,0x000000dc,0x000000b0,0x0003003e,
+0x000000d7,0x0000009d,0x000200f9,0x000000f0,
+0x000200f8,0x000000ef,0x0004003d,0x00000006,
+0x00000104,0x000000cd,0x000500aa,0x000000ad,
+0x00000105,0x00000104,0x0000009d,0x000300f7,
+0x00000107,0x00000000,0x000400fa,0x00000105,
+0x00000106,0x0000010a,0x000200f8,0x00000106,
+0x0003003e,0x000000f1,0x00000109,0x000200f9,
+0x00000107,0x000200f8,0x0000010a,0x0004003d,
+0x00000006,0x0000010b,0x000000cd,0x000500aa,
+0x000000ad,0x0000010c,0x0000010b,0x000000a0,
+0x000300f7,0x0000010e,0x00000000,0x000400fa,
+0x0000010c,0x0000010d,0x00000110,0x000200f8,
+0x0000010d,0x0003003e,0x000000f1,0x0000010f,
+0x000200f9,0x0000010e,0x000200f8,0x00000110,
+0x0003003e,0x000000af,0x00000111,0x000100fd,
+0x000200f8,0x0000010e,0x000200f9,0x00000107,
+0x000200f8,0x00000107,0x000200f9,0x000000f0,
+0x000200f8,0x000000f0,0x000200f9,0x000000e5,
+0x000200f8,0x00000114,0x0004003d,0x00000006,
+0x00000115,0x000000bd,0x000500c4,0x00000006,
+0x00000116,0x00000115,0x000000cb,0x0004003d,
+0x00000006,0x00000117,0x000000c7,0x000500c5,
+0x00000006,0x00000118,0x00000116,0x00000117,
+0x0003003e,0x000000e6,0x00000118,0x0004003d,
+0x00000006,0x00000119,0x000000c3,0x000300f7,
+0x0000011e,0x00000000,0x000b00fb,0x00000119,
+0x0000011e,0x00000000,0x0000011a,0x00000001,
+0x0000011b,0x00000002,0x0000011c,0x00000003,
+0x0000011d,0x000200f8,0x0000011a,0x0004003d,
+0x00000006,0x0000011f,0x000000d2,0x00050080,
+0x00000006,0x00000120,0x0000011f,0x00000091,
+0x0004003d,0x00000006,0x00000121,0x000000cd,
+0x00050080,0x00000006,0x00000122,0x00000121,
+0x00000092,0x00050050,0x00000011,0x00000123,
+0x00000120,0x00000122,0x0003003e,0x000000f1,
+0x00000123,0x000200f9,0x0000011e,0x000200f8,
+0x0000011b,0x0004003d,0x00000006,0x00000125,
+0x000000d2,0x00050080,0x00000006,0x00000126,
+0x00000125,0x0000008d,0x0004003d,0x00000006,
+0x00000127,0x000000cd,0x00050080,0x00000006,
+0x00000128,0x00000127,0x00000092,0x00050050,
+0x00000011,0x00000129,0x00000126,0x00000128,
+0x0003003e,0x000000f1,0x00000129,0x000200f9,
+0x0000011e,0x000200f8,0x0000011c,0x0004003d,
+0x00000006,0x0000012b,0x000000cd,0x00050080,
+0x00000006,0x0000012c,0x0000012b,0x00000092,
+0x0004003d,0x00000006,0x0000012d,0x000000d2,
+0x00050080,0x00000006,0x0000012e,0x0000012d,
+0x0000008d,0x00050050,0x00000011,0x0000012f,
+0x0000012c,0x0000012e,0x0003003e,0x000000f1,
+0x0000012f,0x000200f9,0x0000011e,0x000200f8,
+0x0000011d,0x0004003d,0x00000006,0x00000131,
+0x000000d2,0x000500c2,0x00000006,0x00000132,
+0x00000131,0x000000cb,0x000500aa,0x000000ad,
+0x00000133,0x00000132,0x0000009d,0x000300f7,
+0x00000135,0x00000000,0x000400fa,0x00000133,
+0x00000134,0x0000013c,0x000200f8,0x00000134,
+0x0004003d,0x00000006,0x00000136,0x000000cd,
+0x00050080,0x00000006,0x00000137,0x00000136,
+0x00000092,0x0004003d,0x00000006,0x00000138,
+0x000000d2,0x000500c7,0x00000006,0x00000139,
+0x00000138,0x000000a0,0x00050080,0x00000006,
+0x0000013a,0x00000139,0x000000fc,0x00050050,
+0x00000011,0x0000013b,0x00000137,0x0000013a,
+0x0003003e,0x000000f1,0x0000013b,0x000200f9,
+0x00000135,0x000200f8,0x0000013c,0x0004003d,
+0x00000006,0x0000013d,0x000000d2,0x000500c7,
+0x00000006,0x0000013e,0x0000013d,0x000000a0,
+0x00050080,0x00000006,0x0000013f,0x0000013e,
+0x00000092,0x0004003d,0x00000006,0x00000140,
+0x000000cd,0x00050080,0x00000006,0x00000141,
+0x00000140,0x00000092,0x00050050,0x00000011,
+0x00000142,0x0000013f,0x00000141,0x0003003e,
+0x000000f1,0x00000142,0x000200f9,0x00000135,
+0x000200f8,0x00000135,0x000200f9,0x0000011e,
+0x000200f8,0x0000011e,0x000200f9,0x000000e5,
+0x000200f8,0x000000e5,0x0004003d,0x00000011,
+0x00000144,0x000000f1,0x0004003d,0x00000011,
+0x00000145,0x000000ab,0x000500ac,0x00000146,
+0x00000147,0x00000144,0x00000145,0x0004009a,
+0x000000ad,0x00000148,0x00000147,0x000300f7,
+0x0000014a,0x00000000,0x000400fa,0x00000148,
+0x00000149,0x0000014a,0x000200f8,0x00000149,
+0x0003003e,0x000000af,0x00000111,0x000100fd,
+0x000200f8,0x0000014a,0x0004003d,0x00000006,
+0x0000015e,0x000000d7,0x000500c4,0x00000006,
+0x00000160,0x0000015e,0x0000015f,0x0004003d,
+0x00000006,0x00000161,0x000000e6,0x000500c5,
+0x00000006,0x00000162,0x00000160,0x00000161,
+0x0003003e,0x00000164,0x0000015d,0x00050041,
+0x00000009,0x00000165,0x00000164,0x00000162,
+0x0004003d,0x00000008,0x00000166,0x00000165,
+0x0003003e,0x0000014d,0x00000166,0x00050041,
+0x000000b2,0x00000168,0x000000f1,0x0000009d,
+0x0004003d,0x00000006,0x00000169,0x00000168,
+0x00050041,0x000000b2,0x0000016a,0x000000f1,
+0x000000a0,0x0004003d,0x00000006,0x0000016b,
+0x0000016a,0x00050084,0x00000006,0x0000016c,
+0x00000169,0x0000016b,0x0004003d,0x000000ad,
+0x0000016d,0x000000dc,0x000600a9,0x00000059,
+0x0000016e,0x0000016d,0x000000cb,0x000000c0,
+0x000500c4,0x00000006,0x0000016f,0x0000016c,
+0x0000016e,0x0003003e,0x00000167,0x0000016f,
+0x0004003d,0x00000006,0x00000172,0x00000167,
+0x0003003e,0x00000171,0x00000172,0x0004003d,
+0x00000008,0x00000174,0x0000014d,0x0003003e,
+0x00000173,0x00000174,0x00060039,0x00000006,
+0x00000175,0x0000000d,0x00000171,0x00000173,
+0x0003003e,0x00000170,0x00000175,0x0004003d,
+0x00000006,0x00000176,0x00000170,0x000500b0,
+0x000000ad,0x00000178,0x00000176,0x00000177,
+0x0004003d,0x00000006,0x00000179,0x00000170,
+0x000500ac,0x000000ad,0x0000017b,0x00000179,
+0x0000017a,0x000500a6,0x000000ad,0x0000017c,
+0x00000178,0x0000017b,0x0004003d,0x00000006,
+0x0000017d,0x00000167,0x000500ac,0x000000ad,
+0x0000017f,0x0000017d,0x0000017e,0x000500a6,
+0x000000ad,0x00000180,0x0000017c,0x0000017f,
+0x000300f7,0x00000182,0x00000000,0x000400fa,
+0x00000180,0x00000181,0x00000182,0x000200f8,
+0x00000181,0x0003003e,0x000000af,0x00000111,
+0x000100fd,0x000200f8,0x00000182,0x00050041,
+0x000000b2,0x00000185,0x000000a8,0x00000096,
+0x0004003d,0x00000006,0x00000186,0x00000185,
+0x000600cb,0x00000006,0x00000188,0x00000186,
+0x00000187,0x000000c1,0x00050080,0x00000006,
+0x00000189,0x00000188,0x000000a0,0x0003003e,
+0x00000184,0x00000189,0x0004003d,0x00000006,
+0x0000018a,0x00000184,0x000500ac,0x000000ad,
+0x0000018b,0x0000018a,0x000000a0,0x000300f7,
+0x0000018d,0x00000000,0x000400fa,0x0000018b,
+0x0000018c,0x0000018d,0x000200f8,0x0000018c,
+0x00050041,0x000000b2,0x0000018f,0x000000a8,
+0x00000096,0x0004003d,0x00000006,0x00000190,
+0x0000018f,0x000600cb,0x00000006,0x00000192,
+0x00000190,0x00000191,0x000000df,0x0003003e,
+0x0000018e,0x00000192,0x000200f9,0x0000018d,
+0x000200f8,0x0000018d,0x0004003d,0x000000ad,
+0x00000193,0x000000dc,0x0004003d,0x00000006,
+0x00000194,0x00000184,0x000500aa,0x000000ad,
+0x00000195,0x00000194,0x00000091,0x000500a7,
+0x000000ad,0x00000196,0x00000193,0x00000195,
+0x000300f7,0x00000198,0x00000000,0x000400fa,
+0x00000196,0x00000197,0x00000198,0x000200f8,
+0x00000197,0x0003003e,0x000000af,0x00000111,
+0x000100fd,0x000200f8,0x00000198,0x000100fd,
+0x00010038,0x00050036,0x00000006,0x0000001c,
+0x00000000,0x00000018,0x00030037,0x00000010,
+0x00000019,0x00030037,0x00000007,0x0000001a,
+0x00030037,0x00000007,0x0000001b,0x000200f8,
+0x0000001d,0x0004003b,0x00000007,0x0000019f,
+0x00000007,0x0004003b,0x00000007,0x000001a4,
+0x00000007,0x0004003b,0x00000007,0x000001ab,
+0x00000007,0x0004003b,0x00000007,0x000001be,
+0x00000007,0x0004003b,0x00000007,0x000001c1,
+0x00000007,0x0004003b,0x00000007,0x000001ca,
+0x00000007,0x0004003d,0x00000006,0x0000019a,
+0x0000001b,0x000500aa,0x000000ad,0x0000019b,
+0x0000019a,0x0000009d,0x000300f7,0x0000019d,
+0x00000000,0x000400fa,0x0000019b,0x0000019c,
+0x0000019d,0x000200f8,0x0000019c,0x000200fe,
+0x0000009d,0x000200f8,0x0000019d,0x0004003d,
+0x00000006,0x000001a0,0x0000001a,0x00050086,
+0x00000006,0x000001a2,0x000001a0,0x000001a1,
+0x00050082,0x00000006,0x000001a3,0x00000096,
+0x000001a2,0x0003003e,0x0000019f,0x000001a3,
+0x0004003d,0x00000006,0x000001a5,0x0000001a,
+0x0004003d,0x00000006,0x000001a6,0x0000001b,
+0x00050080,0x00000006,0x000001a7,0x000001a5,
+0x000001a6,0x00050082,0x00000006,0x000001a8,
+0x000001a7,0x000000a0,0x00050086,0x00000006,
+0x000001a9,0x000001a8,0x000001a1,0x00050082,
+0x00000006,0x000001aa,0x00000096,0x000001a9,
+0x0003003e,0x000001a4,0x000001aa,0x0004003d,
+0x00000006,0x000001ac,0x0000001a,0x000500c7,
+0x00000006,0x000001ae,0x000001ac,0x000001ad,
+0x0003003e,0x000001ab,0x000001ae,0x0004003d,
+0x00000006,0x000001af,0x0000019f,0x0004003d,
+0x00000006,0x000001b0,0x000001a4,0x000500aa,
+0x000000ad,0x000001b1,0x000001af,0x000001b0,
+0x000300f7,0x000001b3,0x00000000,0x000400fa,
+0x000001b1,0x000001b2,0x000001bd,0x000200f8,
+0x000001b2,0x0004003d,0x00000006,0x000001b4,
+0x0000019f,0x00050041,0x00000007,0x000001b5,
+0x00000019,0x000001b4,0x0004003d,0x00000006,
+0x000001b6,0x000001b5,0x0004003d,0x00000006,
+0x000001b7,0x000001ab,0x0004007c,0x00000059,
+0x000001b8,0x000001b7,0x0004003d,0x00000006,
+0x000001b9,0x0000001b,0x0004007c,0x00000059,
+0x000001ba,0x000001b9,0x000600cb,0x00000006,
+0x000001bb,0x000001b6,0x000001b8,0x000001ba,
+0x000200fe,0x000001bb,0x000200f8,0x000001bd,
+0x0004003d,0x00000006,0x000001bf,0x000001ab,
+0x00050082,0x00000006,0x000001c0,0x000001a1,
+0x000001bf,0x0003003e,0x000001be,0x000001c0,
+0x0004003d,0x00000006,0x000001c2,0x0000019f,
+0x00050041,0x00000007,0x000001c3,0x00000019,
+0x000001c2,0x0004003d,0x00000006,0x000001c4,
+0x000001c3,0x0004003d,0x00000006,0x000001c5,
+0x000001ab,0x0004007c,0x00000059,0x000001c6,
+0x000001c5,0x0004003d,0x00000006,0x000001c7,
+0x000001be,0x0004007c,0x00000059,0x000001c8,
+0x000001c7,0x000600cb,0x00000006,0x000001c9,
+0x000001c4,0x000001c6,0x000001c8,0x0003003e,
+0x000001c1,0x000001c9,0x0004003d,0x00000006,
+0x000001cb,0x000001a4,0x00050041,0x00000007,
+0x000001cc,0x00000019,0x000001cb,0x0004003d,
+0x00000006,0x000001cd,0x000001cc,0x0004003d,
+0x00000006,0x000001ce,0x0000001b,0x0004003d,
+0x00000006,0x000001cf,0x000001be,0x00050082,
+0x00000006,0x000001d0,0x000001ce,0x000001cf,
+0x0004007c,0x00000059,0x000001d1,0x000001d0,
+0x000600cb,0x00000006,0x000001d2,0x000001cd,
+0x000000c0,0x000001d1,0x0003003e,0x000001ca,
+0x000001d2,0x0004003d,0x00000006,0x000001d3,
+0x000001ca,0x0004003d,0x00000006,0x000001d4,
+0x000001be,0x000500c4,0x00000006,0x000001d5,
+0x000001d3,0x000001d4,0x0004003d,0x00000006,
+0x000001d6,0x000001c1,0x000500c5,0x00000006,
+0x000001d7,0x000001d5,0x000001d6,0x000200fe,
+0x000001d7,0x000200f8,0x000001b3,0x000100ff,
+0x00010038,0x00050036,0x00000006,0x00000023,
+0x00000000,0x0000001e,0x00030037,0x00000007,
+0x0000001f,0x00030037,0x00000007,0x00000020,
+0x00030037,0x00000007,0x00000021,0x00030037,
+0x00000007,0x00000022,0x000200f8,0x00000024,
+0x0004003b,0x00000007,0x000001e1,0x00000007,
+0x0004003b,0x00000007,0x000001ec,0x00000007,
+0x0004003b,0x00000007,0x000001f1,0x00000007,
+0x0004003b,0x00000007,0x000001fc,0x00000007,
+0x0004003b,0x00000007,0x0000020a,0x00000007,
+0x0004003b,0x00000007,0x00000212,0x00000007,
+0x0004003b,0x00000010,0x00000213,0x00000007,
+0x0004003b,0x00000007,0x00000215,0x00000007,
+0x0004003b,0x00000007,0x00000217,0x00000007,
+0x0004003b,0x00000007,0x0000021a,0x00000007,
+0x0004003b,0x00000007,0x0000021f,0x00000007,
+0x0004003b,0x00000007,0x00000227,0x00000007,
+0x0004003b,0x00000007,0x0000023f,0x00000007,
+0x0004003d,0x00000006,0x000001da,0x00000184,
+0x000500aa,0x000000ad,0x000001db,0x000001da,
+0x000000a0,0x000300f7,0x000001dd,0x00000000,
+0x000400fa,0x000001db,0x000001dc,0x000001eb,
+0x000200f8,0x000001dc,0x0004003d,0x00000006,
+0x000001df,0x00000170,0x00050082,0x00000006,
+0x000001e0,0x000001de,0x000001df,0x0003003e,
+0x00000020,0x000001e0,0x00050041,0x000000b2,
+0x000001e2,0x000000a8,0x00000096,0x0004003d,
+0x00000006,0x000001e3,0x000001e2,0x000600cb,
+0x00000006,0x000001e4,0x000001e3,0x00000191,
+0x000000ca,0x0003003e,0x000001e1,0x000001e4,
+0x0004003d,0x00000006,0x000001e5,0x000001e1,
+0x000500c2,0x00000006,0x000001e6,0x000001e5,
+0x000000c1,0x00050084,0x00000006,0x000001e7,
+0x00000092,0x000001e6,0x00050080,0x00000006,
+0x000001e8,0x000001e7,0x00000092,0x0003003e,
+0x00000021,0x000001e8,0x0003003e,0x00000022,
+0x0000009d,0x0004003d,0x00000006,0x000001e9,
+0x000001e1,0x000200fe,0x000001e9,0x000200f8,
+0x000001eb,0x00050041,0x000000b2,0x000001ed,
+0x000000a8,0x00000096,0x0004003d,0x00000006,
+0x000001ee,0x000001ed,0x000600cb,0x00000006,
+0x000001f0,0x000001ee,0x000001ef,0x000000c1,
+0x0003003e,0x000001ec,0x000001f0,0x00050041,
+0x000000b2,0x000001f2,0x000000a8,0x00000096,
+0x0004003d,0x00000006,0x000001f3,0x000001f2,
+0x000600cb,0x00000006,0x000001f5,0x000001f3,
+0x000001f4,0x000000ca,0x0003003e,0x000001f1,
+0x000001f5,0x0004003d,0x00000006,0x000001f6,
+0x000001ec,0x000500aa,0x000000ad,0x000001f7,
+0x000001f6,0x0000009d,0x000300f7,0x000001f9,
+0x00000000,0x000400fa,0x000001f7,0x000001f8,
+0x00000209,0x000200f8,0x000001f8,0x0004003d,
+0x00000006,0x000001fa,0x00000170,0x00050082,
+0x00000006,0x000001fb,0x000001de,0x000001fa,
+0x0003003e,0x00000020,0x000001fb,0x0004003d,
+0x00000006,0x000001fd,0x000001f1,0x000500c2,
+0x00000006,0x000001fe,0x000001fd,0x000000c1,
+0x00050084,0x00000006,0x000001ff,0x00000092,
+0x000001fe,0x00050080,0x00000006,0x00000200,
+0x000001ff,0x00000092,0x0003003e,0x000001fc,
+0x00000200,0x0004003d,0x00000006,0x00000201,
+0x000001fc,0x0004003d,0x00000006,0x00000202,
+0x00000184,0x00050084,0x00000006,0x00000203,
+0x00000201,0x00000202,0x0003003e,0x00000021,
+0x00000203,0x0004003d,0x00000006,0x00000204,
+0x000001fc,0x0004003d,0x00000006,0x00000205,
+0x0000001f,0x00050084,0x00000006,0x00000206,
+0x00000204,0x00000205,0x0003003e,0x00000022,
+0x00000206,0x0004003d,0x00000006,0x00000207,
+0x000001f1,0x000200fe,0x00000207,0x000200f8,
+0x00000209,0x0004003d,0x00000006,0x0000020b,
+0x00000184,0x00050084,0x00000006,0x0000020c,
+0x00000096,0x0000020b,0x00050082,0x00000006,
+0x0000020d,0x0000020c,0x00000091,0x0003003e,
+0x0000020a,0x0000020d,0x0004003d,0x00000006,
+0x0000020e,0x00000170,0x00050082,0x00000006,
+0x0000020f,0x000001de,0x0000020e,0x0004003d,
+0x00000006,0x00000210,0x0000020a,0x00050082,
+0x00000006,0x00000211,0x0000020f,0x00000210,
+0x0003003e,0x00000020,0x00000211,0x0004003d,
+0x0000000f,0x00000214,0x000000a8,0x0003003e,
+0x00000213,0x00000214,0x0004003d,0x00000006,
+0x00000216,0x00000020,0x0003003e,0x00000215,
+0x00000216,0x0004003d,0x00000006,0x00000218,
+0x0000020a,0x0003003e,0x00000217,0x00000218,
+0x00070039,0x00000006,0x00000219,0x0000001c,
+0x00000213,0x00000215,0x00000217,0x0003003e,
+0x00000212,0x00000219,0x0004003d,0x00000006,
+0x0000021b,0x00000212,0x000500c4,0x00000006,
+0x0000021c,0x0000021b,0x000000ca,0x0004003d,
+0x00000006,0x0000021d,0x000001f1,0x000500c5,
+0x00000006,0x0000021e,0x0000021c,0x0000021d,
+0x0003003e,0x0000021a,0x0000021e,0x0004003d,
+0x00000006,0x00000220,0x0000021a,0x0004003d,
+0x00000006,0x00000221,0x0000001f,0x00050084,
+0x00000006,0x00000222,0x00000092,0x00000221,
+0x0004003d,0x00000006,0x00000223,0x00000184,
+0x00050080,0x00000006,0x00000224,0x00000222,
+0x00000223,0x0004007c,0x00000059,0x00000225,
+0x00000224,0x000600cb,0x00000006,0x00000226,
+0x00000220,0x00000225,0x000000c1,0x0003003e,
+0x0000021f,0x00000226,0x0004003d,0x00000006,
+0x00000228,0x0000021a,0x0004003d,0x00000006,
+0x00000229,0x00000184,0x0004007c,0x00000059,
+0x0000022a,0x00000229,0x000600cb,0x00000006,
+0x0000022b,0x00000228,0x000000c0,0x0000022a,
+0x0003003e,0x00000227,0x0000022b,0x0004003d,
+0x00000006,0x0000022c,0x000001ec,0x0004003d,
+0x00000006,0x0000022d,0x00000184,0x00050084,
+0x00000006,0x0000022e,0x0000022c,0x0000022d,
+0x0004003d,0x00000006,0x0000022f,0x00000227,
+0x000400cd,0x00000059,0x00000230,0x0000022f,
+0x0004007c,0x00000006,0x00000231,0x00000230,
+0x00050080,0x00000006,0x00000232,0x0000022e,
+0x00000231,0x00050084,0x00000006,0x00000233,
+0x00000092,0x00000232,0x0003003e,0x00000021,
+0x00000233,0x0004003d,0x00000006,0x00000234,
+0x000001ec,0x0004003d,0x00000006,0x00000235,
+0x0000001f,0x00050084,0x00000006,0x00000236,
+0x00000234,0x00000235,0x0004003d,0x00000006,
+0x00000237,0x00000227,0x0004003d,0x00000006,
+0x00000238,0x0000001f,0x0004007c,0x00000059,
+0x00000239,0x00000238,0x000600cb,0x00000006,
+0x0000023a,0x00000237,0x000000c0,0x00000239,
+0x000400cd,0x00000059,0x0000023b,0x0000023a,
+0x0004007c,0x00000006,0x0000023c,0x0000023b,
+0x00050080,0x00000006,0x0000023d,0x00000236,
+0x0000023c,0x00050084,0x00000006,0x0000023e,
+0x00000092,0x0000023d,0x0003003e,0x00000022,
+0x0000023e,0x0004003d,0x00000006,0x00000240,
+0x000001ec,0x00050082,0x00000006,0x00000241,
+0x00000240,0x000000a0,0x0004003d,0x00000006,
+0x00000242,0x00000227,0x0004003d,0x00000006,
+0x00000243,0x0000001f,0x0004007c,0x00000059,
+0x00000244,0x00000243,0x000600cb,0x00000006,
+0x00000245,0x00000242,0x00000244,0x000000cb,
+0x00050080,0x00000006,0x00000246,0x00000241,
+0x00000245,0x0003003e,0x0000023f,0x00000246,
+0x0004003d,0x00000006,0x00000247,0x0000023f,
+0x000500c4,0x00000006,0x00000248,0x00000247,
+0x000000c1,0x0004003d,0x00000006,0x00000249,
+0x0000021f,0x000500c5,0x00000006,0x0000024a,
+0x00000248,0x00000249,0x000200fe,0x0000024a,
+0x000200f8,0x000001f9,0x000100ff,0x000200f8,
+0x000001dd,0x000100ff,0x00010038,0x00050036,
+0x00000006,0x0000002a,0x00000000,0x00000025,
+0x00030037,0x00000010,0x00000026,0x00030037,
+0x00000007,0x00000027,0x00030037,0x00000007,
+0x00000028,0x00030037,0x00000007,0x00000029,
+0x000200f8,0x0000002b,0x0004003b,0x0000024d,
+0x0000024e,0x00000007,0x0004003b,0x00000007,
+0x00000251,0x00000007,0x0004003b,0x00000010,
+0x00000258,0x00000007,0x0004003b,0x00000007,
+0x0000025a,0x00000007,0x0004003b,0x00000007,
+0x0000025b,0x00000007,0x0004003b,0x00000007,
+0x0000025d,0x00000007,0x0004003b,0x00000007,
+0x00000280,0x00000007,0x0004003b,0x00000010,
+0x00000281,0x00000007,0x0004003b,0x00000007,
+0x00000283,0x00000007,0x0004003b,0x00000007,
+0x00000285,0x00000007,0x0004003b,0x0000024d,
+0x00000289,0x00000007,0x0004003b,0x00000007,
+0x00000297,0x00000007,0x0004003b,0x00000380,
+0x00000381,0x00000007,0x0004003d,0x00000006,
+0x0000024f,0x00000028,0x0004007c,0x00000059,
+0x00000250,0x0000024f,0x0003003e,0x0000024e,
+0x00000250,0x0004003d,0x00000006,0x00000252,
+0x00000027,0x0004003d,0x00000006,0x00000253,
+0x00000028,0x00050080,0x00000006,0x00000254,
+0x00000252,0x00000253,0x0004003d,0x00000006,
+0x00000255,0x00000028,0x00050084,0x00000006,
+0x00000256,0x00000091,0x00000255,0x00050080,
+0x00000006,0x00000257,0x00000256,0x0000008d,
+0x0004003d,0x0000000f,0x00000259,0x00000026,
+0x0003003e,0x00000258,0x00000259,0x0003003e,
+0x0000025a,0x00000254,0x0003003e,0x0000025b,
+0x00000257,0x00070039,0x00000006,0x0000025c,
+0x0000001c,0x00000258,0x0000025a,0x0000025b,
+0x0003003e,0x00000251,0x0000025c,0x0004003d,
+0x00000006,0x0000025e,0x00000251,0x000600cb,
+0x00000006,0x0000025f,0x0000025e,0x000000c0,
+0x000000c1,0x0004003d,0x00000006,0x00000260,
+0x00000251,0x0004003d,0x00000059,0x00000261,
+0x0000024e,0x00050084,0x00000059,0x00000262,
+0x000000cb,0x00000261,0x00050080,0x00000059,
+0x00000263,0x00000262,0x000000c1,0x000600cb,
+0x00000006,0x00000264,0x00000260,0x00000263,
+0x000000c1,0x000500c4,0x00000006,0x00000265,
+0x00000264,0x000000c1,0x000500c5,0x00000006,
+0x00000266,0x0000025f,0x00000265,0x0004003d,
+0x00000006,0x00000267,0x00000251,0x0004003d,
+0x00000059,0x00000268,0x0000024e,0x00050084,
+0x00000059,0x00000269,0x000000c1,0x00000268,
+0x00050080,0x00000059,0x0000026a,0x00000269,
+0x000000ca,0x000600cb,0x00000006,0x0000026b,
+0x00000267,0x0000026a,0x000000cb,0x000500c4,
+0x00000006,0x0000026c,0x0000026b,0x000000ca,
+0x000500c5,0x00000006,0x0000026d,0x00000266,
+0x0000026c,0x0004003d,0x00000006,0x0000026e,
+0x00000251,0x0004003d,0x00000059,0x0000026f,
+0x0000024e,0x00050084,0x00000059,0x00000270,
+0x0000015f,0x0000026f,0x00050080,0x00000059,
+0x00000271,0x00000270,0x000000d0,0x000600cb,
+0x00000006,0x00000272,0x0000026e,0x00000271,
+0x000000c1,0x000500c4,0x00000006,0x00000273,
+0x00000272,0x000000d0,0x000500c5,0x00000006,
+0x00000274,0x0000026d,0x00000273,0x0004003d,
+0x00000006,0x00000275,0x00000251,0x0004003d,
+0x00000059,0x00000276,0x0000024e,0x00050084,
+0x00000059,0x00000277,0x000000ca,0x00000276,
+0x00050080,0x00000059,0x00000278,0x00000277,
+0x000000d5,0x000600cb,0x00000006,0x00000279,
+0x00000275,0x00000278,0x000000cb,0x000500c4,
+0x00000006,0x0000027a,0x00000279,0x000000d5,
+0x000500c5,0x00000006,0x0000027b,0x00000274,
+0x0000027a,0x0003003e,0x0000025d,0x0000027b,
+0x0004003d,0x00000006,0x0000027c,0x00000029,
+0x000500aa,0x000000ad,0x0000027d,0x0000027c,
+0x0000009d,0x000300f7,0x0000027f,0x00000000,
+0x000400fa,0x0000027d,0x0000027e,0x00000288,
+0x000200f8,0x0000027e,0x0004003d,0x0000000f,
+0x00000282,0x00000026,0x0003003e,0x00000281,
+0x00000282,0x0004003d,0x00000006,0x00000284,
+0x00000027,0x0003003e,0x00000283,0x00000284,
+0x0004003d,0x00000006,0x00000286,0x00000028,
+0x0003003e,0x00000285,0x00000286,0x00070039,
+0x00000006,0x00000287,0x0000001c,0x00000281,
+0x00000283,0x00000285,0x0003003e,0x00000280,
+0x00000287,0x000200f9,0x0000027f,0x000200f8,
+0x00000288,0x0004003d,0x00000006,0x0000028a,
+0x00000029,0x0004007c,0x00000059,0x0000028b,
+0x0000028a,0x00050082,0x00000059,0x0000028c,
+0x0000028b,0x000000cb,0x0003003e,0x00000289,
+0x0000028c,0x0004003d,0x00000006,0x0000028d,
+0x00000251,0x0004003d,0x00000059,0x0000028e,
+0x00000289,0x0004003d,0x00000059,0x0000028f,
+0x0000024e,0x00050084,0x00000059,0x00000290,
+0x0000028e,0x0000028f,0x0004003d,0x00000059,
+0x00000292,0x00000289,0x0005004d,0x00000059,
+0x00000293,0x00000291,0x00000292,0x00050080,
+0x00000059,0x00000294,0x00000290,0x00000293,
+0x0004003d,0x00000059,0x00000295,0x0000024e,
+0x000600cb,0x00000006,0x00000296,0x0000028d,
+0x00000294,0x00000295,0x0003003e,0x00000280,
+0x00000296,0x000200f9,0x0000027f,0x000200f8,
+0x0000027f,0x0004003d,0x00000006,0x0000037f,
+0x0000025d,0x0003003e,0x00000381,0x0000037e,
+0x00050041,0x00000007,0x00000382,0x00000381,
+0x0000037f,0x0004003d,0x00000006,0x00000383,
+0x00000382,0x0003003e,0x00000297,0x00000383,
+0x0004003d,0x00000006,0x00000384,0x00000297,
+0x0004003d,0x00000006,0x00000385,0x00000029,
+0x0004007c,0x00000059,0x00000386,0x00000385,
+0x00050084,0x00000059,0x00000387,0x000000c1,
+0x00000386,0x000600cb,0x00000006,0x00000388,
+0x00000384,0x00000387,0x000000c1,0x0004003d,
+0x00000006,0x00000389,0x00000028,0x000500c4,
+0x00000006,0x0000038a,0x00000388,0x00000389,
+0x0004003d,0x00000006,0x0000038b,0x00000280,
+0x000500c5,0x00000006,0x0000038c,0x0000038a,
+0x0000038b,0x000200fe,0x0000038c,0x00010038,
+0x00050036,0x00000006,0x00000030,0x00000000,
+0x00000025,0x00030037,0x00000010,0x0000002c,
+0x00030037,0x00000007,0x0000002d,0x00030037,
+0x00000007,0x0000002e,0x00030037,0x00000007,
+0x0000002f,0x000200f8,0x00000031,0x0004003b,
+0x0000024d,0x0000038f,0x00000007,0x0004003b,
+0x00000007,0x00000392,0x00000007,0x0004003b,
+0x00000010,0x00000396,0x00000007,0x0004003b,
+0x00000007,0x00000398,0x00000007,0x0004003b,
+0x00000007,0x0000039a,0x00000007,0x0004003b,
+0x00000007,0x0000039c,0x00000007,0x0004003b,
+0x00000007,0x000003ae,0x00000007,0x0004003b,
+0x00000007,0x000003ba,0x00000007,0x0004003b,
+0x000003f1,0x000003f2,0x00000007,0x0004003d,
+0x00000006,0x00000390,0x0000002e,0x0004007c,
+0x00000059,0x00000391,0x00000390,0x0003003e,
+0x0000038f,0x00000391,0x0004003d,0x00000006,
+0x00000393,0x0000002e,0x00050084,0x00000006,
+0x00000394,0x00000096,0x00000393,0x00050080,
+0x00000006,0x00000395,0x00000394,0x0000008e,
+0x0004003d,0x0000000f,0x00000397,0x0000002c,
+0x0003003e,0x00000396,0x00000397,0x0004003d,
+0x00000006,0x00000399,0x0000002d,0x0003003e,
+0x00000398,0x00000399,0x0003003e,0x0000039a,
+0x00000395,0x00070039,0x00000006,0x0000039b,
+0x0000001c,0x00000396,0x00000398,0x0000039a,
+0x0003003e,0x00000392,0x0000039b,0x0004003d,
+0x00000006,0x0000039d,0x00000392,0x0004003d,
+0x00000059,0x0000039e,0x0000038f,0x000600cb,
+0x00000006,0x0000039f,0x0000039d,0x0000039e,
+0x0000015f,0x0004003d,0x00000006,0x000003a0,
+0x00000392,0x0004003d,0x00000059,0x000003a1,
+0x0000038f,0x00050084,0x00000059,0x000003a2,
+0x000000c1,0x000003a1,0x00050080,0x00000059,
+0x000003a3,0x000003a2,0x0000015f,0x000600cb,
+0x00000006,0x000003a4,0x000003a0,0x000003a3,
+0x000000c1,0x000500c4,0x00000006,0x000003a5,
+0x000003a4,0x0000015f,0x000500c5,0x00000006,
+0x000003a6,0x0000039f,0x000003a5,0x0004003d,
+0x00000006,0x000003a7,0x00000392,0x0004003d,
+0x00000059,0x000003a8,0x0000038f,0x00050084,
+0x00000059,0x000003a9,0x0000015f,0x000003a8,
+0x00050080,0x00000059,0x000003aa,0x000003a9,
+0x000000d0,0x000600cb,0x00000006,0x000003ab,
+0x000003a7,0x000003aa,0x000000c1,0x000500c4,
+0x00000006,0x000003ac,0x000003ab,0x000000d0,
+0x000500c5,0x00000006,0x000003ad,0x000003a6,
+0x000003ac,0x0003003e,0x0000039c,0x000003ad,
+0x0004003d,0x00000006,0x000003af,0x00000392,
+0x0004003d,0x00000006,0x000003b0,0x0000002f,
+0x0004007c,0x00000059,0x000003b1,0x000003b0,
+0x0004003d,0x00000059,0x000003b2,0x0000038f,
+0x00050084,0x00000059,0x000003b3,0x000003b1,
+0x000003b2,0x0004003d,0x00000006,0x000003b5,
+0x0000002f,0x0005004d,0x00000059,0x000003b6,
+0x000003b4,0x000003b5,0x00050080,0x00000059,
+0x000003b7,0x000003b3,0x000003b6,0x0004003d,
+0x00000059,0x000003b8,0x0000038f,0x000600cb,
+0x00000006,0x000003b9,0x000003af,0x000003b7,
+0x000003b8,0x0003003e,0x000003ae,0x000003b9,
+0x0004003d,0x00000006,0x000003f0,0x0000039c,
+0x0003003e,0x000003f2,0x000003ef,0x00050041,
+0x00000007,0x000003f3,0x000003f2,0x000003f0,
+0x0004003d,0x00000006,0x000003f4,0x000003f3,
+0x0003003e,0x000003ba,0x000003f4,0x0004003d,
+0x00000006,0x000003f5,0x000003ba,0x0004003d,
+0x00000006,0x000003f6,0x0000002f,0x0004007c,
+0x00000059,0x000003f7,0x000003f6,0x00050084,
+0x00000059,0x000003f8,0x0000015f,0x000003f7,
+0x000600cb,0x00000006,0x000003f9,0x000003f5,
+0x000003f8,0x0000015f,0x0004003d,0x00000006,
+0x000003fa,0x0000002e,0x000500c4,0x00000006,
+0x000003fb,0x000003f9,0x000003fa,0x0004003d,
+0x00000006,0x000003fc,0x000003ae,0x000500c5,
+0x00000006,0x000003fd,0x000003fb,0x000003fc,
+0x000200fe,0x000003fd,0x00010038,0x00050036,
+0x00000006,0x00000037,0x00000000,0x00000032,
+0x00030037,0x00000010,0x00000033,0x00030037,
+0x00000009,0x00000034,0x00030037,0x00000007,
+0x00000035,0x00030037,0x00000007,0x00000036,
+0x000200f8,0x00000038,0x0004003b,0x00000007,
+0x00000406,0x00000007,0x0004003b,0x00000007,
+0x0000040e,0x00000007,0x0004003b,0x00000007,
+0x00000415,0x00000007,0x0004003b,0x00000010,
+0x00000418,0x00000007,0x0004003b,0x00000007,
+0x0000041a,0x00000007,0x0004003b,0x00000007,
+0x0000041c,0x00000007,0x0004003b,0x00000007,
+0x0000041e,0x00000007,0x0004003b,0x00000436,
+0x00000437,0x00000007,0x0004003b,0x00000007,
+0x00000441,0x00000007,0x0004003b,0x00000007,
+0x00000448,0x00000007,0x0004003b,0x00000010,
+0x0000044b,0x00000007,0x0004003b,0x00000007,
+0x0000044d,0x00000007,0x0004003b,0x00000007,
+0x0000044f,0x00000007,0x0004003b,0x00000007,
+0x00000451,0x00000007,0x0004003b,0x00000464,
+0x00000465,0x00000007,0x0004003b,0x00000007,
+0x0000046a,0x00000007,0x0004003b,0x00000007,
+0x0000046e,0x00000007,0x0004003b,0x00000010,
+0x0000046f,0x00000007,0x0004003b,0x00000007,
+0x00000471,0x00000007,0x0004003b,0x00000007,
+0x00000473,0x00000007,0x0004003b,0x00000012,
+0x00000476,0x00000007,0x0004003b,0x00000481,
+0x00000482,0x00000007,0x0004003d,0x00000006,
+0x00000400,0x00000036,0x0004003d,0x00000006,
+0x00000401,0x00000035,0x000500ae,0x000000ad,
+0x00000402,0x00000400,0x00000401,0x000300f7,
+0x00000404,0x00000000,0x000400fa,0x00000402,
+0x00000403,0x00000404,0x000200f8,0x00000403,
+0x000200fe,0x0000009d,0x000200f8,0x00000404,
+0x00050041,0x00000007,0x00000407,0x00000034,
+0x00000092,0x0004003d,0x00000006,0x00000408,
+0x00000407,0x0003003e,0x00000406,0x00000408,
+0x00050041,0x00000007,0x00000409,0x00000034,
+0x0000009d,0x0004003d,0x00000006,0x0000040a,
+0x00000409,0x000500aa,0x000000ad,0x0000040b,
+0x0000040a,0x000000a0,0x000300f7,0x0000040d,
+0x00000000,0x000400fa,0x0000040b,0x0000040c,
+0x0000043b,0x000200f8,0x0000040c,0x0004003d,
+0x00000006,0x0000040f,0x00000036,0x00050086,
+0x00000006,0x00000410,0x0000040f,0x00000095,
+0x0004003d,0x00000006,0x00000411,0x00000406,
+0x00050084,0x00000006,0x00000412,0x00000095,
+0x00000411,0x00050080,0x00000006,0x00000413,
+0x00000412,0x0000008d,0x00050084,0x00000006,
+0x00000414,0x00000410,0x00000413,0x0003003e,
+0x0000040e,0x00000414,0x0004003d,0x00000006,
+0x00000416,0x00000036,0x00050089,0x00000006,
+0x00000417,0x00000416,0x00000095,0x0004003d,
+0x0000000f,0x00000419,0x00000033,0x0003003e,
+0x00000418,0x00000419,0x0004003d,0x00000006,
+0x0000041b,0x0000040e,0x0003003e,0x0000041a,
+0x0000041b,0x0004003d,0x00000006,0x0000041d,
+0x00000406,0x0003003e,0x0000041c,0x0000041d,
+0x0003003e,0x0000041e,0x00000417,0x00080039,
+0x00000006,0x0000041f,0x0000002a,0x00000418,
+0x0000041a,0x0000041c,0x0000041e,0x0003003e,
+0x00000415,0x0000041f,0x0004003d,0x00000006,
+0x0000042f,0x00000406,0x000500c4,0x00000059,
+0x00000430,0x000000cb,0x0000042f,0x00050082,
+0x00000059,0x00000431,0x00000430,0x000000cb,
+0x00050084,0x00000059,0x00000432,0x0000015f,
+0x00000431,0x0004007c,0x00000006,0x00000433,
+0x00000432,0x0004003d,0x00000006,0x00000434,
+0x00000415,0x00050080,0x00000006,0x00000435,
+0x00000433,0x00000434,0x0003003e,0x00000437,
+0x0000042e,0x00050041,0x00000007,0x00000438,
+0x00000437,0x00000435,0x0004003d,0x00000006,
+0x00000439,0x00000438,0x000200fe,0x00000439,
+0x000200f8,0x0000043b,0x00050041,0x00000007,
+0x0000043c,0x00000034,0x000000a0,0x0004003d,
+0x00000006,0x0000043d,0x0000043c,0x000500aa,
+0x000000ad,0x0000043e,0x0000043d,0x000000a0,
+0x000300f7,0x00000440,0x00000000,0x000400fa,
+0x0000043e,0x0000043f,0x00000469,0x000200f8,
+0x0000043f,0x0004003d,0x00000006,0x00000442,
+0x00000036,0x00050086,0x00000006,0x00000443,
+0x00000442,0x00000096,0x0004003d,0x00000006,
+0x00000444,0x00000406,0x00050084,0x00000006,
+0x00000445,0x00000096,0x00000444,0x00050080,
+0x00000006,0x00000446,0x00000445,0x0000008e,
+0x00050084,0x00000006,0x00000447,0x00000443,
+0x00000446,0x0003003e,0x00000441,0x00000447,
+0x0004003d,0x00000006,0x00000449,0x00000036,
+0x00050089,0x00000006,0x0000044a,0x00000449,
+0x00000096,0x0004003d,0x0000000f,0x0000044c,
+0x00000033,0x0003003e,0x0000044b,0x0000044c,
+0x0004003d,0x00000006,0x0000044e,0x00000441,
+0x0003003e,0x0000044d,0x0000044e,0x0004003d,
+0x00000006,0x00000450,0x00000406,0x0003003e,
+0x0000044f,0x00000450,0x0003003e,0x00000451,
+0x0000044a,0x00080039,0x00000006,0x00000452,
+0x00000030,0x0000044b,0x0000044d,0x0000044f,
+0x00000451,0x0003003e,0x00000448,0x00000452,
+0x0004003d,0x00000006,0x0000045d,0x00000406,
+0x000500c4,0x00000059,0x0000045e,0x000000cb,
+0x0000045d,0x00050082,0x00000059,0x0000045f,
+0x0000045e,0x000000cb,0x00050084,0x00000059,
+0x00000460,0x000000d0,0x0000045f,0x0004007c,
+0x00000006,0x00000461,0x00000460,0x0004003d,
+0x00000006,0x00000462,0x00000448,0x00050080,
+0x00000006,0x00000463,0x00000461,0x00000462,
+0x0003003e,0x00000465,0x0000045c,0x00050041,
+0x00000007,0x00000466,0x00000465,0x00000463,
+0x0004003d,0x00000006,0x00000467,0x00000466,
+0x000200fe,0x00000467,0x000200f8,0x00000469,
+0x0004003d,0x00000006,0x0000046b,0x00000036,
+0x0004003d,0x00000006,0x0000046c,0x00000406,
+0x00050084,0x00000006,0x0000046d,0x0000046b,
+0x0000046c,0x0003003e,0x0000046a,0x0000046d,
+0x0004003d,0x0000000f,0x00000470,0x00000033,
+0x0003003e,0x0000046f,0x00000470,0x0004003d,
+0x00000006,0x00000472,0x0000046a,0x0003003e,
+0x00000471,0x00000472,0x0004003d,0x00000006,
+0x00000474,0x00000406,0x0003003e,0x00000473,
+0x00000474,0x00070039,0x00000006,0x00000475,
+0x0000001c,0x0000046f,0x00000471,0x00000473,
+0x0003003e,0x0000046e,0x00000475,0x0004003d,
+0x00000006,0x0000047f,0x00000406,0x00050082,
+0x00000006,0x00000480,0x0000047f,0x000000a0,
+0x0003003e,0x00000482,0x0000047e,0x00050041,
+0x00000012,0x00000483,0x00000482,0x00000480,
+0x0004003d,0x00000011,0x00000484,0x00000483,
+0x0003003e,0x00000476,0x00000484,0x0004003d,
+0x00000006,0x00000485,0x0000046e,0x00050041,
+0x00000007,0x00000486,0x00000476,0x0000009d,
+0x0004003d,0x00000006,0x00000487,0x00000486,
+0x00050084,0x00000006,0x00000488,0x00000485,
+0x00000487,0x0004003d,0x00000006,0x00000489,
+0x0000046e,0x00050041,0x00000007,0x0000048a,
+0x00000476,0x000000a0,0x0004003d,0x00000006,
+0x0000048b,0x0000048a,0x000500c2,0x00000006,
+0x0000048c,0x00000489,0x0000048b,0x000500c5,
+0x00000006,0x0000048d,0x00000488,0x0000048c,
+0x0003003e,0x0000046e,0x0000048d,0x0004003d,
+0x00000006,0x0000048e,0x0000046e,0x000500ac,
+0x000000ad,0x0000048f,0x0000048e,0x000001a1,
+0x000300f7,0x00000491,0x00000000,0x000400fa,
+0x0000048f,0x00000490,0x00000491,0x000200f8,
+0x00000490,0x0004003d,0x00000006,0x00000492,
+0x0000046e,0x00050080,0x00000006,0x00000493,
+0x00000492,0x000000a0,0x0003003e,0x0000046e,
+0x00000493,0x000200f9,0x00000491,0x000200f8,
+0x00000491,0x0004003d,0x00000006,0x00000494,
+0x0000046e,0x000200fe,0x00000494,0x000200f8,
+0x00000440,0x000100ff,0x000200f8,0x0000040d,
+0x000100ff,0x00010038,0x00050036,0x00000006,
+0x00000042,0x00000000,0x00000039,0x00030037,
+0x00000010,0x0000003a,0x00030037,0x00000009,
+0x0000003b,0x00030037,0x00000007,0x0000003c,
+0x00030037,0x00000007,0x0000003d,0x00030037,
+0x00000007,0x0000003e,0x00030037,0x00000007,
+0x0000003f,0x00030037,0x00000007,0x00000040,
+0x00030037,0x00000012,0x00000041,0x000200f8,
+0x00000043,0x0004003b,0x00000010,0x00000497,
+0x00000007,0x0004003b,0x00000010,0x000004a5,
+0x00000007,0x0004003b,0x00000010,0x000004a6,
+0x00000007,0x0004003b,0x00000009,0x000004a8,
+0x00000007,0x0004003b,0x00000007,0x000004aa,
+0x00000007,0x0004003b,0x00000007,0x000004ac,
+0x00000007,0x0004003b,0x00000010,0x000004b0,
+0x00000007,0x0004003b,0x00000009,0x000004b2,
+0x00000007,0x0004003b,0x00000007,0x000004b4,
+0x00000007,0x0004003b,0x00000007,0x000004b6,
+0x00000007,0x0004003b,0x00000010,0x000004ba,
+0x00000007,0x0004003b,0x00000009,0x000004bc,
+0x00000007,0x0004003b,0x00000007,0x000004be,
+0x00000007,0x0004003b,0x00000007,0x000004c0,
+0x00000007,0x0004003b,0x00000010,0x000004c4,
+0x00000007,0x0004003b,0x00000009,0x000004c6,
+0x00000007,0x0004003b,0x00000007,0x000004c8,
+0x00000007,0x0004003b,0x00000007,0x000004ca,
+0x00000007,0x0004003b,0x00000007,0x000004cf,
+0x00000007,0x0004003b,0x00000010,0x000004d7,
+0x00000007,0x0004003d,0x00000006,0x00000498,
+0x0000003f,0x0004003d,0x00000006,0x00000499,
+0x0000003d,0x00070050,0x0000000f,0x0000049a,
+0x00000499,0x00000499,0x00000499,0x00000499,
+0x0004003d,0x00000006,0x0000049b,0x0000003e,
+0x0004003d,0x00000006,0x0000049c,0x0000003e,
+0x00050080,0x00000006,0x0000049d,0x0000049c,
+0x000000a0,0x00070050,0x0000000f,0x0000049e,
+0x0000009d,0x000000a0,0x0000049b,0x0000049d,
+0x00050080,0x0000000f,0x0000049f,0x0000049a,
+0x0000049e,0x00070050,0x0000000f,0x000004a0,
+0x00000498,0x00000498,0x00000498,0x00000498,
+0x00050084,0x0000000f,0x000004a1,0x000004a0,
+0x0000049f,0x0004003d,0x00000006,0x000004a2,
+0x00000040,0x00070050,0x0000000f,0x000004a3,
+0x000004a2,0x000004a2,0x000004a2,0x000004a2,
+0x00050080,0x0000000f,0x000004a4,0x000004a1,
+0x000004a3,0x0003003e,0x00000497,0x000004a4,
+0x0004003d,0x0000000f,0x000004a7,0x0000003a,
+0x0003003e,0x000004a6,0x000004a7,0x0004003d,
+0x00000008,0x000004a9,0x0000003b,0x0003003e,
+0x000004a8,0x000004a9,0x0004003d,0x00000006,
+0x000004ab,0x0000003c,0x0003003e,0x000004aa,
+0x000004ab,0x00050041,0x00000007,0x000004ad,
+0x00000497,0x0000009d,0x0004003d,0x00000006,
+0x000004ae,0x000004ad,0x0003003e,0x000004ac,
+0x000004ae,0x00080039,0x00000006,0x000004af,
+0x00000037,0x000004a6,0x000004a8,0x000004aa,
+0x000004ac,0x0004003d,0x0000000f,0x000004b1,
+0x0000003a,0x0003003e,0x000004b0,0x000004b1,
+0x0004003d,0x00000008,0x000004b3,0x0000003b,
+0x0003003e,0x000004b2,0x000004b3,0x0004003d,
+0x00000006,0x000004b5,0x0000003c,0x0003003e,
+0x000004b4,0x000004b5,0x00050041,0x00000007,
+0x000004b7,0x00000497,0x000000a0,0x0004003d,
+0x00000006,0x000004b8,0x000004b7,0x0003003e,
+0x000004b6,0x000004b8,0x00080039,0x00000006,
+0x000004b9,0x00000037,0x000004b0,0x000004b2,
+0x000004b4,0x000004b6,0x0004003d,0x0000000f,
+0x000004bb,0x0000003a,0x0003003e,0x000004ba,
+0x000004bb,0x0004003d,0x00000008,0x000004bd,
+0x0000003b,0x0003003e,0x000004bc,0x000004bd,
+0x0004003d,0x00000006,0x000004bf,0x0000003c,
+0x0003003e,0x000004be,0x000004bf,0x00050041,
+0x00000007,0x000004c1,0x00000497,0x00000092,
+0x0004003d,0x00000006,0x000004c2,0x000004c1,
+0x0003003e,0x000004c0,0x000004c2,0x00080039,
+0x00000006,0x000004c3,0x00000037,0x000004ba,
+0x000004bc,0x000004be,0x000004c0,0x0004003d,
+0x0000000f,0x000004c5,0x0000003a,0x0003003e,
+0x000004c4,0x000004c5,0x0004003d,0x00000008,
+0x000004c7,0x0000003b,0x0003003e,0x000004c6,
+0x000004c7,0x0004003d,0x00000006,0x000004c9,
+0x0000003c,0x0003003e,0x000004c8,0x000004c9,
+0x00050041,0x00000007,0x000004cb,0x00000497,
+0x00000096,0x0004003d,0x00000006,0x000004cc,
+0x000004cb,0x0003003e,0x000004ca,0x000004cc,
+0x00080039,0x00000006,0x000004cd,0x00000037,
+0x000004c4,0x000004c6,0x000004c8,0x000004ca,
+0x00070050,0x0000000f,0x000004ce,0x000004af,
+0x000004b9,0x000004c3,0x000004cd,0x0003003e,
+0x000004a5,0x000004ce,0x00050041,0x00000007,
+0x000004d0,0x00000041,0x0000009d,0x0004003d,
+0x00000006,0x000004d1,0x000004d0,0x00050041,
+0x00000007,0x000004d2,0x00000041,0x000000a0,
+0x0004003d,0x00000006,0x000004d3,0x000004d2,
+0x00050084,0x00000006,0x000004d4,0x000004d1,
+0x000004d3,0x00050080,0x00000006,0x000004d5,
+0x000004d4,0x0000008d,0x000500c2,0x00000006,
+0x000004d6,0x000004d5,0x000000ca,0x0003003e,
+0x000004cf,0x000004d6,0x00050041,0x00000007,
+0x000004d8,0x00000041,0x0000009d,0x0004003d,
+0x00000006,0x000004d9,0x000004d8,0x00050082,
+0x00000006,0x000004da,0x0000014e,0x000004d9,
+0x00050041,0x00000007,0x000004db,0x00000041,
+0x000000a0,0x0004003d,0x00000006,0x000004dc,
+0x000004db,0x00050082,0x00000006,0x000004dd,
+0x000004da,0x000004dc,0x0004003d,0x00000006,
+0x000004de,0x000004cf,0x00050080,0x00000006,
+0x000004df,0x000004dd,0x000004de,0x00050041,
+0x00000007,0x000004e0,0x00000041,0x0000009d,
+0x0004003d,0x00000006,0x000004e1,0x000004e0,
+0x0004003d,0x00000006,0x000004e2,0x000004cf,
+0x00050082,0x00000006,0x000004e3,0x000004e1,
+0x000004e2,0x00050041,0x00000007,0x000004e4,
+0x00000041,0x000000a0,0x0004003d,0x00000006,
+0x000004e5,0x000004e4,0x0004003d,0x00000006,
+0x000004e6,0x000004cf,0x00050082,0x00000006,
+0x000004e7,0x000004e5,0x000004e6,0x0004003d,
+0x00000006,0x000004e8,0x000004cf,0x00070050,
+0x0000000f,0x000004e9,0x000004df,0x000004e3,
+0x000004e7,0x000004e8,0x0003003e,0x000004d7,
+0x000004e9,0x0004003d,0x0000000f,0x000004ea,
+0x000004a5,0x00040070,0x000004ec,0x000004ed,
+0x000004ea,0x0004003d,0x0000000f,0x000004ee,
+0x000004d7,0x00040070,0x000004ec,0x000004ef,
+0x000004ee,0x00050094,0x000004eb,0x000004f0,
+0x000004ed,0x000004ef,0x00050081,0x000004eb,
+0x000004f2,0x000004f0,0x000004f1,0x0004006d,
+0x00000006,0x000004f3,0x000004f2,0x000500c2,
+0x00000006,0x000004f4,0x000004f3,0x000000ca,
+0x000200fe,0x000004f4,0x00010038,0x00050036,
+0x00000011,0x00000047,0x00000000,0x00000044,
+0x00030037,0x00000010,0x00000045,0x00030037,
+0x00000011,0x00000046,0x000200f8,0x00000048,
+0x0004003b,0x00000012,0x000004f7,0x00000007,
+0x0004003b,0x00000012,0x00000502,0x00000007,
+0x0004003b,0x00000012,0x00000505,0x00000007,
+0x0004003b,0x00000012,0x00000510,0x00000007,
+0x0004003b,0x00000012,0x00000514,0x00000007,
+0x0004003b,0x00000007,0x00000519,0x00000007,
+0x0004003b,0x00000007,0x0000051c,0x00000007,
+0x0004003b,0x00000012,0x00000524,0x00000007,
+0x0004003b,0x00000010,0x0000052a,0x00000007,
+0x0004003b,0x00000009,0x0000052c,0x00000007,
+0x0004003b,0x00000007,0x0000052e,0x00000007,
+0x0004003b,0x00000007,0x00000530,0x00000007,
+0x0004003b,0x00000007,0x00000532,0x00000007,
+0x0004003b,0x00000007,0x00000534,0x00000007,
+0x0004003b,0x00000007,0x00000535,0x00000007,
+0x0004003b,0x00000012,0x00000536,0x00000007,
+0x0004003b,0x00000010,0x0000053d,0x00000007,
+0x0004003b,0x00000009,0x0000053f,0x00000007,
+0x0004003b,0x00000007,0x00000541,0x00000007,
+0x0004003b,0x00000007,0x00000543,0x00000007,
+0x0004003b,0x00000007,0x00000545,0x00000007,
+0x0004003b,0x00000007,0x00000547,0x00000007,
+0x0004003b,0x00000007,0x00000548,0x00000007,
+0x0004003b,0x00000012,0x00000549,0x00000007,
+0x0004003d,0x00000011,0x000004f9,0x000000ab,
+0x00050050,0x00000011,0x000004fa,0x00000092,
+0x00000092,0x00050086,0x00000011,0x000004fb,
+0x000004f9,0x000004fa,0x00050050,0x00000011,
+0x000004fc,0x000004f8,0x000004f8,0x00050080,
+0x00000011,0x000004fd,0x000004fc,0x000004fb,
+0x0004003d,0x00000011,0x000004fe,0x000000ab,
+0x00050050,0x00000011,0x000004ff,0x000000a0,
+0x000000a0,0x00050082,0x00000011,0x00000500,
+0x000004fe,0x000004ff,0x00050086,0x00000011,
+0x00000501,0x000004fd,0x00000500,0x0003003e,
+0x000004f7,0x00000501,0x0004003d,0x00000011,
+0x00000503,0x000004f7,0x00050084,0x00000011,
+0x00000504,0x00000046,0x00000503,0x0003003e,
+0x00000502,0x00000504,0x0004003d,0x00000011,
+0x00000506,0x00000502,0x0004003d,0x00000011,
+0x00000507,0x000000f1,0x00050050,0x00000011,
+0x00000508,0x000000a0,0x000000a0,0x00050082,
+0x00000011,0x00000509,0x00000507,0x00000508,
+0x00050084,0x00000011,0x0000050a,0x00000506,
+0x00000509,0x00050050,0x00000011,0x0000050b,
+0x000001a1,0x000001a1,0x00050080,0x00000011,
+0x0000050c,0x0000050a,0x0000050b,0x00050050,
+0x00000082,0x0000050e,0x0000050d,0x0000050d,
+0x000500c2,0x00000011,0x0000050f,0x0000050c,
+0x0000050e,0x0003003e,0x00000505,0x0000050f,
+0x0004003d,0x00000011,0x00000511,0x00000505,
+0x00050050,0x00000082,0x00000512,0x000000ca,
+0x000000ca,0x000500c2,0x00000011,0x00000513,
+0x00000511,0x00000512,0x0003003e,0x00000510,
+0x00000513,0x0004003d,0x00000011,0x00000515,
+0x00000505,0x00050050,0x00000011,0x00000517,
+0x00000516,0x00000516,0x000500c7,0x00000011,
+0x00000518,0x00000515,0x00000517,0x0003003e,
+0x00000514,0x00000518,0x00050041,0x000000b2,
+0x0000051a,0x000000f1,0x0000009d,0x0004003d,
+0x00000006,0x0000051b,0x0000051a,0x0003003e,
+0x00000519,0x0000051b,0x00050041,0x00000007,
+0x0000051d,0x00000510,0x000000a0,0x0004003d,
+0x00000006,0x0000051e,0x0000051d,0x0004003d,
+0x00000006,0x0000051f,0x00000519,0x00050084,
+0x00000006,0x00000520,0x0000051e,0x0000051f,
+0x00050041,0x00000007,0x00000521,0x00000510,
+0x0000009d,0x0004003d,0x00000006,0x00000522,
+0x00000521,0x00050080,0x00000006,0x00000523,
+0x00000520,0x00000522,0x0003003e,0x0000051c,
+0x00000523,0x0003003e,0x00000524,0x00000525,
+0x0004003d,0x000000ad,0x00000526,0x000000dc,
+0x000600a9,0x00000059,0x00000527,0x00000526,
+0x000000cb,0x000000c0,0x000500c4,0x00000059,
+0x00000528,0x000000cb,0x00000527,0x0004007c,
+0x00000006,0x00000529,0x00000528,0x0004003d,
+0x0000000f,0x0000052b,0x00000045,0x0003003e,
+0x0000052a,0x0000052b,0x0004003d,0x00000008,
+0x0000052d,0x0000014d,0x0003003e,0x0000052c,
+0x0000052d,0x0004003d,0x00000006,0x0000052f,
+0x00000167,0x0003003e,0x0000052e,0x0000052f,
+0x0004003d,0x00000006,0x00000531,0x0000051c,
+0x0003003e,0x00000530,0x00000531,0x0004003d,
+0x00000006,0x00000533,0x00000519,0x0003003e,
+0x00000532,0x00000533,0x0003003e,0x00000534,
+0x00000529,0x0003003e,0x00000535,0x0000009d,
+0x0004003d,0x00000011,0x00000537,0x00000514,
+0x0003003e,0x00000536,0x00000537,0x000c0039,
+0x00000006,0x00000538,0x00000042,0x0000052a,
+0x0000052c,0x0000052e,0x00000530,0x00000532,
+0x00000534,0x00000535,0x00000536,0x00050041,
+0x00000007,0x00000539,0x00000524,0x0000009d,
+0x0003003e,0x00000539,0x00000538,0x0004003d,
+0x000000ad,0x0000053a,0x000000dc,0x000300f7,
+0x0000053c,0x00000000,0x000400fa,0x0000053a,
+0x0000053b,0x0000053c,0x000200f8,0x0000053b,
+0x0004003d,0x0000000f,0x0000053e,0x00000045,
+0x0003003e,0x0000053d,0x0000053e,0x0004003d,
+0x00000008,0x00000540,0x0000014d,0x0003003e,
+0x0000053f,0x00000540,0x0004003d,0x00000006,
+0x00000542,0x00000167,0x0003003e,0x00000541,
+0x00000542,0x0004003d,0x00000006,0x00000544,
+0x0000051c,0x0003003e,0x00000543,0x00000544,
+0x0004003d,0x00000006,0x00000546,0x00000519,
+0x0003003e,0x00000545,0x00000546,0x0003003e,
+0x00000547,0x00000092,0x0003003e,0x00000548,
+0x000000a0,0x0004003d,0x00000011,0x0000054a,
+0x00000514,0x0003003e,0x00000549,0x0000054a,
+0x000c0039,0x00000006,0x0000054b,0x00000042,
+0x0000053d,0x0000053f,0x00000541,0x00000543,
+0x00000545,0x00000547,0x00000548,0x00000549,
+0x00050041,0x00000007,0x0000054c,0x00000524,
+0x000000a0,0x0003003e,0x0000054c,0x0000054b,
+0x000200f9,0x0000053c,0x000200f8,0x0000053c,
+0x0004003d,0x00000011,0x0000054d,0x00000524,
+0x000200fe,0x0000054d,0x00010038,0x00050036,
+0x00000006,0x0000004b,0x00000000,0x00000049,
+0x00030037,0x00000007,0x0000004a,0x000200f8,
+0x0000004c,0x0004003d,0x00000006,0x00000550,
+0x0000004a,0x000500c2,0x00000006,0x00000552,
+0x00000550,0x00000551,0x0004003d,0x00000006,
+0x00000553,0x0000004a,0x000500c6,0x00000006,
+0x00000554,0x00000553,0x00000552,0x0003003e,
+0x0000004a,0x00000554,0x0004003d,0x00000006,
+0x00000555,0x0000004a,0x000500c4,0x00000006,
+0x00000557,0x00000555,0x00000556,0x0004003d,
+0x00000006,0x00000558,0x0000004a,0x00050082,
+0x00000006,0x00000559,0x00000558,0x00000557,
+0x0003003e,0x0000004a,0x00000559,0x0004003d,
+0x00000006,0x0000055a,0x0000004a,0x000500c4,
+0x00000006,0x0000055b,0x0000055a,0x000000d5,
+0x0004003d,0x00000006,0x0000055c,0x0000004a,
+0x00050080,0x00000006,0x0000055d,0x0000055c,
+0x0000055b,0x0003003e,0x0000004a,0x0000055d,
+0x0004003d,0x00000006,0x0000055e,0x0000004a,
+0x000500c4,0x00000006,0x0000055f,0x0000055e,
+0x000000ca,0x0004003d,0x00000006,0x00000560,
+0x0000004a,0x00050080,0x00000006,0x00000561,
+0x00000560,0x0000055f,0x0003003e,0x0000004a,
+0x00000561,0x0004003d,0x00000006,0x00000562,
+0x0000004a,0x000500c2,0x00000006,0x00000563,
+0x00000562,0x000000d0,0x0004003d,0x00000006,
+0x00000564,0x0000004a,0x000500c6,0x00000006,
+0x00000565,0x00000564,0x00000563,0x0003003e,
+0x0000004a,0x00000565,0x0004003d,0x00000006,
+0x00000566,0x0000004a,0x000500c4,0x00000006,
+0x00000568,0x00000566,0x00000567,0x0004003d,
+0x00000006,0x00000569,0x0000004a,0x00050080,
+0x00000006,0x0000056a,0x00000569,0x00000568,
+0x0003003e,0x0000004a,0x0000056a,0x0004003d,
+0x00000006,0x0000056b,0x0000004a,0x000500c2,
+0x00000006,0x0000056c,0x0000056b,0x000000d5,
+0x0004003d,0x00000006,0x0000056d,0x0000004a,
+0x000500c6,0x00000006,0x0000056e,0x0000056d,
+0x0000056c,0x0003003e,0x0000004a,0x0000056e,
+0x0004003d,0x00000006,0x0000056f,0x0000004a,
+0x000500c2,0x00000006,0x00000570,0x0000056f,
+0x0000015f,0x0004003d,0x00000006,0x00000571,
+0x0000004a,0x000500c6,0x00000006,0x00000572,
+0x00000571,0x00000570,0x0003003e,0x0000004a,
+0x00000572,0x0004003d,0x00000006,0x00000573,
+0x0000004a,0x000500c4,0x00000006,0x00000574,
+0x00000573,0x0000050d,0x0004003d,0x00000006,
+0x00000575,0x0000004a,0x000500c6,0x00000006,
+0x00000576,0x00000575,0x00000574,0x0003003e,
+0x0000004a,0x00000576,0x0004003d,0x00000006,
+0x00000577,0x0000004a,0x000500c2,0x00000006,
+0x00000578,0x00000577,0x00000556,0x0004003d,
+0x00000006,0x00000579,0x0000004a,0x000500c6,
+0x00000006,0x0000057a,0x00000579,0x00000578,
+0x0003003e,0x0000004a,0x0000057a,0x0004003d,
+0x00000006,0x0000057b,0x0000004a,0x000200fe,
+0x0000057b,0x00010038,0x00050036,0x00000006,
+0x00000051,0x00000000,0x0000004d,0x00030037,
+0x00000007,0x0000004e,0x00030037,0x00000012,
+0x0000004f,0x00030037,0x00000007,0x00000050,
+0x000200f8,0x00000052,0x0004003b,0x00000007,
+0x00000593,0x00000007,0x0004003b,0x00000007,
+0x00000594,0x00000007,0x0004003b,0x00000010,
+0x00000597,0x00000007,0x0004003b,0x00000010,
+0x000005a3,0x00000007,0x0004003b,0x00000012,
+0x000005b6,0x00000007,0x0004003b,0x00000010,
+0x000005c1,0x00000007,0x0004003b,0x00000010,
+0x000005c5,0x00000007,0x0004003b,0x00000010,
+0x000005d4,0x00000007,0x0004003d,0x00000006,
+0x0000057e,0x00000050,0x000500aa,0x000000ad,
+0x0000057f,0x0000057e,0x000000a0,0x000300f7,
+0x00000581,0x00000000,0x000400fa,0x0000057f,
+0x00000580,0x00000581,0x000200f8,0x00000580,
+0x000200fe,0x0000009d,0x000200f8,0x00000581,
+0x00050041,0x000000b2,0x00000583,0x000000ab,
+0x0000009d,0x0004003d,0x00000006,0x00000584,
+0x00000583,0x00050041,0x000000b2,0x00000585,
+0x000000ab,0x000000a0,0x0004003d,0x00000006,
+0x00000586,0x00000585,0x00050084,0x00000006,
+0x00000587,0x00000584,0x00000586,0x000500b0,
+0x000000ad,0x00000588,0x00000587,0x000001ad,
+0x000300f7,0x0000058a,0x00000000,0x000400fa,
+0x00000588,0x00000589,0x0000058a,0x000200f8,
+0x00000589,0x0004003d,0x00000011,0x0000058b,
+0x0000004f,0x00050050,0x00000082,0x0000058c,
+0x000000cb,0x000000cb,0x000500c4,0x00000011,
+0x0000058d,0x0000058b,0x0000058c,0x0003003e,
+0x0000004f,0x0000058d,0x000200f9,0x0000058a,
+0x000200f8,0x0000058a,0x0004003d,0x00000006,
+0x0000058e,0x00000050,0x00050084,0x00000006,
+0x0000058f,0x000004f8,0x0000058e,0x0004003d,
+0x00000006,0x00000590,0x0000004e,0x00050082,
+0x00000006,0x00000591,0x00000590,0x000004f8,
+0x00050080,0x00000006,0x00000592,0x0000058f,
+0x00000591,0x0003003e,0x0000004e,0x00000592,
+0x0004003d,0x00000006,0x00000595,0x0000004e,
+0x0003003e,0x00000594,0x00000595,0x00050039,
+0x00000006,0x00000596,0x0000004b,0x00000594,
+0x0003003e,0x00000593,0x00000596,0x0004003d,
+0x00000006,0x00000598,0x00000593,0x000600cb,
+0x00000006,0x00000599,0x00000598,0x000000c0,
+0x000000ca,0x0004003d,0x00000006,0x0000059a,
+0x00000593,0x000600cb,0x00000006,0x0000059b,
+0x0000059a,0x000000ca,0x000000ca,0x0004003d,
+0x00000006,0x0000059c,0x00000593,0x000600cb,
+0x00000006,0x0000059e,0x0000059c,0x0000059d,
+0x000000ca,0x0004003d,0x00000006,0x0000059f,
+0x00000593,0x000600cb,0x00000006,0x000005a1,
+0x0000059f,0x000005a0,0x000000ca,0x00070050,
+0x0000000f,0x000005a2,0x00000599,0x0000059b,
+0x0000059e,0x000005a1,0x0003003e,0x00000597,
+0x000005a2,0x0004003d,0x00000006,0x000005a4,
+0x00000593,0x000600cb,0x00000006,0x000005a5,
+0x000005a4,0x00000567,0x000000ca,0x0004003d,
+0x00000006,0x000005a6,0x00000593,0x000600cb,
+0x00000006,0x000005a8,0x000005a6,0x000005a7,
+0x000000ca,0x0004003d,0x00000006,0x000005a9,
+0x00000593,0x000600cb,0x00000006,0x000005ab,
+0x000005a9,0x000005aa,0x000000ca,0x0004003d,
+0x00000006,0x000005ac,0x00000593,0x000600cb,
+0x00000006,0x000005ae,0x000005ac,0x000005ad,
+0x000000ca,0x00070050,0x0000000f,0x000005af,
+0x000005a5,0x000005a8,0x000005ab,0x000005ae,
+0x0003003e,0x000005a3,0x000005af,0x0004003d,
+0x0000000f,0x000005b0,0x00000597,0x0004003d,
+0x0000000f,0x000005b1,0x00000597,0x00050084,
+0x0000000f,0x000005b2,0x000005b0,0x000005b1,
+0x0003003e,0x00000597,0x000005b2,0x0004003d,
+0x0000000f,0x000005b3,0x000005a3,0x0004003d,
+0x0000000f,0x000005b4,0x000005a3,0x00050084,
+0x0000000f,0x000005b5,0x000005b3,0x000005b4,
+0x0003003e,0x000005a3,0x000005b5,0x0004003d,
+0x00000006,0x000005b7,0x0000004e,0x000500c7,
+0x00000006,0x000005b8,0x000005b7,0x00000092,
+0x000500ab,0x000000ad,0x000005b9,0x000005b8,
+0x0000009d,0x000600a9,0x00000059,0x000005ba,
+0x000005b9,0x000000ca,0x000000d0,0x0004007c,
+0x00000006,0x000005bb,0x000005ba,0x0004003d,
+0x00000006,0x000005bc,0x00000050,0x000500aa,
+0x000000ad,0x000005bd,0x000005bc,0x00000096,
+0x000600a9,0x00000059,0x000005be,0x000005bd,
+0x0000050d,0x000000d0,0x0004007c,0x00000006,
+0x000005bf,0x000005be,0x00050050,0x00000011,
+0x000005c0,0x000005bb,0x000005bf,0x0003003e,
+0x000005b6,0x000005c0,0x0004003d,0x00000006,
+0x000005c2,0x0000004e,0x000500c7,0x00000006,
+0x000005c3,0x000005c2,0x000000a0,0x000500ab,
+0x000000ad,0x000005c4,0x000005c3,0x0000009d,
+0x000300f7,0x000005c7,0x00000000,0x000400fa,
+0x000005c4,0x000005c6,0x000005ca,0x000200f8,
+0x000005c6,0x0004003d,0x00000011,0x000005c8,
+0x000005b6,0x0009004f,0x0000000f,0x000005c9,
+0x000005c8,0x000005c8,0x00000000,0x00000001,
+0x00000000,0x00000001,0x0003003e,0x000005c5,
+0x000005c9,0x000200f9,0x000005c7,0x000200f8,
+0x000005ca,0x0004003d,0x00000011,0x000005cb,
+0x000005b6,0x0009004f,0x0000000f,0x000005cc,
+0x000005cb,0x000005cb,0x00000001,0x00000000,
+0x00000001,0x00000000,0x0003003e,0x000005c5,
+0x000005cc,0x000200f9,0x000005c7,0x000200f8,
+0x000005c7,0x0004003d,0x0000000f,0x000005cd,
+0x000005c5,0x0003003e,0x000005c1,0x000005cd,
+0x0004003d,0x0000000f,0x000005ce,0x000005c1,
+0x0004003d,0x0000000f,0x000005cf,0x00000597,
+0x000500c2,0x0000000f,0x000005d0,0x000005cf,
+0x000005ce,0x0003003e,0x00000597,0x000005d0,
+0x0004003d,0x0000000f,0x000005d1,0x000005c1,
+0x0004003d,0x0000000f,0x000005d2,0x000005a3,
+0x000500c2,0x0000000f,0x000005d3,0x000005d2,
+0x000005d1,0x0003003e,0x000005a3,0x000005d3,
+0x0004003d,0x0000000f,0x000005d5,0x00000597,
+0x0007004f,0x00000011,0x000005d6,0x000005d5,
+0x000005d5,0x00000000,0x00000001,0x00040070,
+0x000005d7,0x000005d8,0x000005d6,0x0004003d,
+0x00000011,0x000005d9,0x0000004f,0x00040070,
+0x000005d7,0x000005da,0x000005d9,0x00050094,
+0x000004eb,0x000005db,0x000005d8,0x000005da,
+0x0004006d,0x00000006,0x000005dc,0x000005db,
+0x0004003d,0x0000000f,0x000005dd,0x00000597,
+0x0007004f,0x00000011,0x000005de,0x000005dd,
+0x000005dd,0x00000002,0x00000003,0x00040070,
+0x000005d7,0x000005df,0x000005de,0x0004003d,
+0x00000011,0x000005e0,0x0000004f,0x00040070,
+0x000005d7,0x000005e1,0x000005e0,0x00050094,
+0x000004eb,0x000005e2,0x000005df,0x000005e1,
+0x0004006d,0x00000006,0x000005e3,0x000005e2,
+0x0004003d,0x0000000f,0x000005e4,0x000005a3,
+0x0007004f,0x00000011,0x000005e5,0x000005e4,
+0x000005e4,0x00000000,0x00000001,0x00040070,
+0x000005d7,0x000005e6,0x000005e5,0x0004003d,
+0x00000011,0x000005e7,0x0000004f,0x00040070,
+0x000005d7,0x000005e8,0x000005e7,0x00050094,
+0x000004eb,0x000005e9,0x000005e6,0x000005e8,
+0x0004006d,0x00000006,0x000005ea,0x000005e9,
+0x0004003d,0x0000000f,0x000005eb,0x000005a3,
+0x0007004f,0x00000011,0x000005ec,0x000005eb,
+0x000005eb,0x00000002,0x00000003,0x00040070,
+0x000005d7,0x000005ed,0x000005ec,0x0004003d,
+0x00000011,0x000005ee,0x0000004f,0x00040070,
+0x000005d7,0x000005ef,0x000005ee,0x00050094,
+0x000004eb,0x000005f0,0x000005ed,0x000005ef,
+0x0004006d,0x00000006,0x000005f1,0x000005f0,
+0x00070050,0x0000000f,0x000005f2,0x000005dc,
+0x000005e3,0x000005ea,0x000005f1,0x0004003d,
+0x00000006,0x000005f3,0x00000593,0x00070050,
+0x0000000f,0x000005f4,0x000005f3,0x000005f3,
+0x000005f3,0x000005f3,0x000500c2,0x0000000f,
+0x000005f6,0x000005f4,0x000005f5,0x00050080,
+0x0000000f,0x000005f7,0x000005f2,0x000005f6,
+0x0003003e,0x000005d4,0x000005f7,0x0004003d,
+0x0000000f,0x000005f9,0x000005d4,0x000500c7,
+0x0000000f,0x000005fa,0x000005f9,0x000005f8,
+0x0003003e,0x000005d4,0x000005fa,0x0004003d,
+0x00000006,0x000005fb,0x00000050,0x000500aa,
+0x000000ad,0x000005fc,0x000005fb,0x00000092,
+0x000300f7,0x000005fe,0x00000000,0x000400fa,
+0x000005fc,0x000005fd,0x00000603,0x000200f8,
+0x000005fd,0x00050041,0x00000007,0x000005ff,
+0x000005d4,0x00000092,0x00050051,0x00000006,
+0x00000600,0x00000525,0x00000000,0x0003003e,
+0x000005ff,0x00000600,0x00050041,0x00000007,
+0x00000601,0x000005d4,0x00000096,0x00050051,
+0x00000006,0x00000602,0x00000525,0x00000001,
+0x0003003e,0x00000601,0x00000602,0x000200f9,
+0x000005fe,0x000200f8,0x00000603,0x0004003d,
+0x00000006,0x00000604,0x00000050,0x000500aa,
+0x000000ad,0x00000605,0x00000604,0x00000096,
+0x000300f7,0x00000607,0x00000000,0x000400fa,
+0x00000605,0x00000606,0x00000607,0x000200f8,
+0x00000606,0x00050041,0x00000007,0x00000608,
+0x000005d4,0x00000096,0x0003003e,0x00000608,
+0x0000009d,0x000200f9,0x00000607,0x000200f8,
+0x00000607,0x000200f9,0x000005fe,0x000200f8,
+0x000005fe,0x00050041,0x00000007,0x00000609,
+0x000005d4,0x0000009d,0x0004003d,0x00000006,
+0x0000060a,0x00000609,0x00060050,0x00000008,
+0x0000060b,0x0000060a,0x0000060a,0x0000060a,
+0x0004003d,0x0000000f,0x0000060c,0x000005d4,
+0x0008004f,0x00000008,0x0000060d,0x0000060c,
+0x0000060c,0x00000001,0x00000002,0x00000003,
+0x000500ae,0x0000060e,0x0000060f,0x0000060b,
+0x0000060d,0x0004009b,0x000000ad,0x00000610,
+0x0000060f,0x000300f7,0x00000612,0x00000000,
+0x000400fa,0x00000610,0x00000611,0x00000614,
+0x000200f8,0x00000611,0x000200fe,0x0000009d,
+0x000200f8,0x00000614,0x00050041,0x00000007,
+0x00000615,0x000005d4,0x000000a0,0x0004003d,
+0x00000006,0x00000616,0x00000615,0x00050050,
+0x00000011,0x00000617,0x00000616,0x00000616,
+0x0004003d,0x0000000f,0x00000618,0x000005d4,
+0x0007004f,0x00000011,0x00000619,0x00000618,
+0x00000618,0x00000002,0x00000003,0x000500ae,
+0x00000146,0x0000061a,0x00000617,0x00000619,
+0x0004009b,0x000000ad,0x0000061b,0x0000061a,
+0x000300f7,0x0000061d,0x00000000,0x000400fa,
+0x0000061b,0x0000061c,0x0000061f,0x000200f8,
+0x0000061c,0x000200fe,0x000000a0,0x000200f8,
+0x0000061f,0x00050041,0x00000007,0x00000620,
+0x000005d4,0x00000092,0x0004003d,0x00000006,
+0x00000621,0x00000620,0x00050041,0x00000007,
+0x00000622,0x000005d4,0x00000096,0x0004003d,
+0x00000006,0x00000623,0x00000622,0x000500ae,
+0x000000ad,0x00000624,0x00000621,0x00000623,
+0x000300f7,0x00000626,0x00000000,0x000400fa,
+0x00000624,0x00000625,0x00000628,0x000200f8,
+0x00000625,0x000200fe,0x00000092,0x000200f8,
+0x00000628,0x000200fe,0x00000096,0x000200f8,
+0x00000626,0x000100ff,0x000200f8,0x0000061d,
+0x000100ff,0x000200f8,0x00000612,0x000100ff,
+0x00010038,0x00050036,0x00000008,0x00000057,
+0x00000000,0x00000053,0x00030037,0x00000007,
+0x00000054,0x00030037,0x00000007,0x00000055,
+0x00030037,0x00000007,0x00000056,0x000200f8,
+0x00000058,0x0004003b,0x00000007,0x0000062b,
+0x00000007,0x0004003b,0x00000009,0x00000633,
+0x00000007,0x0004003b,0x00000640,0x00000641,
+0x00000007,0x0004003b,0x00000007,0x00000644,
+0x00000007,0x0004003b,0x00000009,0x00000646,
+0x00000007,0x0003003e,0x0000062b,0x0000009d,
+0x000200f9,0x0000062c,0x000200f8,0x0000062c,
+0x000400f6,0x0000062e,0x0000062f,0x00000000,
+0x000200f9,0x00000630,0x000200f8,0x00000630,
+0x0004003d,0x00000006,0x00000631,0x0000062b,
+0x000500b0,0x000000ad,0x00000632,0x00000631,
+0x000003bd,0x000400fa,0x00000632,0x0000062d,
+0x0000062e,0x000200f8,0x0000062d,0x0004003d,
+0x00000006,0x0000063f,0x0000062b,0x0003003e,
+0x00000641,0x0000063e,0x00050041,0x00000009,
+0x00000642,0x00000641,0x0000063f,0x0004003d,
+0x00000008,0x00000643,0x00000642,0x0003003e,
+0x00000633,0x00000643,0x0004003d,0x00000006,
+0x00000645,0x00000055,0x0003003e,0x00000644,
+0x00000645,0x0004003d,0x00000008,0x00000647,
+0x00000633,0x0003003e,0x00000646,0x00000647,
+0x00060039,0x00000006,0x00000648,0x0000000d,
+0x00000644,0x00000646,0x0003003e,0x00000056,
+0x00000648,0x0004003d,0x00000006,0x00000649,
+0x00000056,0x0004003d,0x00000006,0x0000064a,
+0x00000054,0x000500b2,0x000000ad,0x0000064b,
+0x00000649,0x0000064a,0x000300f7,0x0000064d,
+0x00000000,0x000400fa,0x0000064b,0x0000064c,
+0x0000064d,0x000200f8,0x0000064c,0x0004003d,
+0x00000008,0x0000064e,0x00000633,0x000200fe,
+0x0000064e,0x000200f8,0x0000064d,0x000200f9,
+0x0000062f,0x000200f8,0x0000062f,0x0004003d,
+0x00000006,0x00000650,0x0000062b,0x00050080,
+0x00000006,0x00000651,0x00000650,0x000000cb,
+0x0003003e,0x0000062b,0x00000651,0x000200f9,
+0x0000062c,0x000200f8,0x0000062e,0x000200fe,
+0x00000150,0x00010038,0x00050036,0x0000005a,
+0x0000005e,0x00000000,0x0000005c,0x00030037,
+0x0000005b,0x0000005d,0x000200f8,0x0000005f,
+0x00050041,0x0000024d,0x00000654,0x0000005d,
+0x0000009d,0x0004003d,0x00000059,0x00000655,
+0x00000654,0x00050041,0x0000024d,0x00000656,
+0x0000005d,0x00000092,0x0004003d,0x00000059,
+0x00000657,0x00000656,0x00050080,0x00000059,
+0x00000658,0x00000655,0x00000657,0x000500c3,
+0x00000059,0x00000659,0x00000658,0x000000cb,
+0x00050041,0x0000024d,0x0000065a,0x0000005d,
+0x000000a0,0x0004003d,0x00000059,0x0000065b,
+0x0000065a,0x00050041,0x0000024d,0x0000065c,
+0x0000005d,0x00000092,0x0004003d,0x00000059,
+0x0000065d,0x0000065c,0x00050080,0x00000059,
+0x0000065e,0x0000065b,0x0000065d,0x000500c3,
+0x00000059,0x0000065f,0x0000065e,0x000000cb,
+0x0004003d,0x0000005a,0x00000660,0x0000005d,
+0x0007004f,0x00000082,0x00000661,0x00000660,
+0x00000660,0x00000002,0x00000003,0x00050051,
+0x00000059,0x00000662,0x00000661,0x00000000,
+0x00050051,0x00000059,0x00000663,0x00000661,
+0x00000001,0x00070050,0x0000005a,0x00000664,
+0x00000659,0x0000065f,0x00000662,0x00000663,
+0x000200fe,0x00000664,0x00010038,0x00050036,
+0x00000059,0x00000064,0x00000000,0x00000062,
+0x00030037,0x00000061,0x00000063,0x000200f8,
+0x00000065,0x00050041,0x0000024d,0x00000667,
+0x00000063,0x0000009d,0x0004003d,0x00000059,
+0x00000668,0x00000667,0x00050041,0x0000024d,
+0x00000669,0x00000063,0x000000a0,0x0004003d,
+0x00000059,0x0000066a,0x00000669,0x00050080,
+0x00000059,0x0000066b,0x00000668,0x0000066a,
+0x00050041,0x0000024d,0x0000066c,0x00000063,
+0x00000092,0x0004003d,0x00000059,0x0000066d,
+0x0000066c,0x00050080,0x00000059,0x0000066e,
+0x0000066b,0x0000066d,0x000200fe,0x0000066e,
+0x00010038,0x00050036,0x00000002,0x00000069,
+0x00000000,0x00000066,0x00030037,0x0000005b,
+0x00000067,0x00030037,0x0000005b,0x00000068,
+0x000200f8,0x0000006a,0x0004003d,0x0000005a,
+0x00000671,0x00000068,0x00070050,0x0000005a,
+0x00000672,0x000000cb,0x000000cb,0x000000cb,
+0x000000cb,0x000500c3,0x0000005a,0x00000673,
+0x00000671,0x00000672,0x0003003e,0x00000068,
+0x00000673,0x0004003d,0x0000005a,0x00000674,
+0x00000067,0x00070050,0x0000005a,0x00000676,
+0x00000675,0x00000675,0x00000675,0x00000675,
+0x000500c7,0x0000005a,0x00000677,0x00000674,
+0x00000676,0x0004003d,0x0000005a,0x00000678,
+0x00000068,0x000500c5,0x0000005a,0x00000679,
+0x00000678,0x00000677,0x0003003e,0x00000068,
+0x00000679,0x0004003d,0x0000005a,0x0000067a,
+0x00000067,0x00070050,0x0000005a,0x0000067b,
+0x000000cb,0x000000cb,0x000000cb,0x000000cb,
+0x000500c3,0x0000005a,0x0000067c,0x0000067a,
+0x0000067b,0x0003003e,0x00000067,0x0000067c,
+0x0004003d,0x0000005a,0x0000067e,0x00000067,
+0x00070050,0x0000005a,0x0000067f,0x0000067d,
+0x0000067d,0x0000067d,0x0000067d,0x000500c7,
+0x0000005a,0x00000680,0x0000067e,0x0000067f,
+0x0003003e,0x00000067,0x00000680,0x0004003d,
+0x0000005a,0x00000681,0x00000067,0x000600ca,
+0x0000005a,0x00000682,0x00000681,0x000000c0,
+0x0000050d,0x0003003e,0x00000067,0x00000682,
+0x000100fd,0x00010038,0x00050036,0x00000002,
+0x00000071,0x00000000,0x0000006b,0x00030037,
+0x0000005b,0x0000006c,0x00030037,0x0000005b,
+0x0000006d,0x00030037,0x00000007,0x0000006e,
+0x00030037,0x00000010,0x0000006f,0x00030037,
+0x00000010,0x00000070,0x000200f8,0x00000072,
+0x0004003b,0x0000024d,0x000006a0,0x00000007,
+0x0004003b,0x0000024d,0x000006a9,0x00000007,
+0x0004003b,0x0000005b,0x000006c7,0x00000007,
+0x0004003b,0x0000005b,0x000006c9,0x00000007,
+0x0004003b,0x00000061,0x00000716,0x00000007,
+0x0004003b,0x00000061,0x0000071a,0x00000007,
+0x0004003b,0x0000005b,0x00000726,0x00000007,
+0x0004003b,0x0000005b,0x0000072a,0x00000007,
+0x0004003b,0x0000005b,0x00000732,0x00000007,
+0x0004003b,0x0000005b,0x00000734,0x00000007,
+0x0004003b,0x00000061,0x00000739,0x00000007,
+0x0004003b,0x0000005b,0x00000750,0x00000007,
+0x0004003b,0x0000005b,0x00000756,0x00000007,
+0x0004003d,0x00000006,0x00000683,0x0000006e,
+0x000300f7,0x0000068f,0x00000000,0x001700fb,
+0x00000683,0x0000068e,0x00000000,0x00000684,
+0x00000001,0x00000685,0x00000004,0x00000686,
+0x00000005,0x00000687,0x00000006,0x00000688,
+0x0000000a,0x00000689,0x00000008,0x0000068a,
+0x0000000c,0x0000068b,0x00000009,0x0000068c,
+0x0000000d,0x0000068d,0x000200f8,0x0000068e,
+0x0003003e,0x0000006f,0x0000075e,0x0003003e,
+0x00000070,0x0000075e,0x000200f9,0x0000068f,
+0x000200f8,0x00000684,0x0004003d,0x0000005a,
+0x00000690,0x0000006c,0x0008004f,0x00000060,
+0x00000691,0x00000690,0x00000690,0x00000000,
+0x00000000,0x00000000,0x0004007c,0x00000008,
+0x00000692,0x00000691,0x00050051,0x00000006,
+0x00000694,0x00000692,0x00000000,0x00050051,
+0x00000006,0x00000695,0x00000692,0x00000001,
+0x00050051,0x00000006,0x00000696,0x00000692,
+0x00000002,0x00070050,0x0000000f,0x00000697,
+0x00000694,0x00000695,0x00000696,0x00000693,
+0x0003003e,0x0000006f,0x00000697,0x0004003d,
+0x0000005a,0x00000698,0x0000006d,0x0008004f,
+0x00000060,0x00000699,0x00000698,0x00000698,
+0x00000000,0x00000000,0x00000000,0x0004007c,
+0x00000008,0x0000069a,0x00000699,0x00050051,
+0x00000006,0x0000069b,0x0000069a,0x00000000,
+0x00050051,0x00000006,0x0000069c,0x0000069a,
+0x00000001,0x00050051,0x00000006,0x0000069d,
+0x0000069a,0x00000002,0x00070050,0x0000000f,
+0x0000069e,0x0000069b,0x0000069c,0x0000069d,
+0x00000693,0x0003003e,0x00000070,0x0000069e,
+0x000100fd,0x000200f8,0x00000685,0x00050041,
+0x0000024d,0x000006a1,0x0000006c,0x0000009d,
+0x0004003d,0x00000059,0x000006a2,0x000006a1,
+0x000500c3,0x00000059,0x000006a3,0x000006a2,
+0x000000c1,0x00050041,0x0000024d,0x000006a4,
+0x0000006d,0x0000009d,0x0004003d,0x00000059,
+0x000006a5,0x000006a4,0x000500c7,0x00000059,
+0x000006a7,0x000006a5,0x000006a6,0x000500c5,
+0x00000059,0x000006a8,0x000006a3,0x000006a7,
+0x0003003e,0x000006a0,0x000006a8,0x0004003d,
+0x00000059,0x000006aa,0x000006a0,0x00050041,
+0x0000024d,0x000006ab,0x0000006d,0x0000009d,
+0x0004003d,0x00000059,0x000006ac,0x000006ab,
+0x000500c7,0x00000059,0x000006ad,0x000006ac,
+0x0000067d,0x00050080,0x00000059,0x000006ae,
+0x000006aa,0x000006ad,0x0007000c,0x00000059,
+0x000006b0,0x00000001,0x00000027,0x000006ae,
+0x000006af,0x0003003e,0x000006a9,0x000006b0,
+0x0004003d,0x00000059,0x000006b1,0x000006a0,
+0x0004007c,0x00000006,0x000006b2,0x000006b1,
+0x00060050,0x00000008,0x000006b3,0x000006b2,
+0x000006b2,0x000006b2,0x00050051,0x00000006,
+0x000006b4,0x000006b3,0x00000000,0x00050051,
+0x00000006,0x000006b5,0x000006b3,0x00000001,
+0x00050051,0x00000006,0x000006b6,0x000006b3,
+0x00000002,0x00070050,0x0000000f,0x000006b7,
+0x000006b4,0x000006b5,0x000006b6,0x00000693,
+0x0003003e,0x0000006f,0x000006b7,0x0004003d,
+0x00000059,0x000006b8,0x000006a9,0x0004007c,
+0x00000006,0x000006b9,0x000006b8,0x00060050,
+0x00000008,0x000006ba,0x000006b9,0x000006b9,
+0x000006b9,0x00050051,0x00000006,0x000006bb,
+0x000006ba,0x00000000,0x00050051,0x00000006,
+0x000006bc,0x000006ba,0x00000001,0x00050051,
+0x00000006,0x000006bd,0x000006ba,0x00000002,
+0x00070050,0x0000000f,0x000006be,0x000006bb,
+0x000006bc,0x000006bd,0x00000693,0x0003003e,
+0x00000070,0x000006be,0x000100fd,0x000200f8,
+0x00000686,0x0004003d,0x0000005a,0x000006c0,
+0x0000006c,0x0009004f,0x0000005a,0x000006c1,
+0x000006c0,0x000006c0,0x00000000,0x00000000,
+0x00000000,0x00000001,0x0004007c,0x0000000f,
+0x000006c2,0x000006c1,0x0003003e,0x0000006f,
+0x000006c2,0x0004003d,0x0000005a,0x000006c3,
+0x0000006d,0x0009004f,0x0000005a,0x000006c4,
+0x000006c3,0x000006c3,0x00000000,0x00000000,
+0x00000000,0x00000001,0x0004007c,0x0000000f,
+0x000006c5,0x000006c4,0x0003003e,0x00000070,
+0x000006c5,0x000100fd,0x000200f8,0x00000687,
+0x0004003d,0x0000005a,0x000006c8,0x0000006d,
+0x0003003e,0x000006c7,0x000006c8,0x0004003d,
+0x0000005a,0x000006ca,0x0000006c,0x0003003e,
+0x000006c9,0x000006ca,0x00060039,0x00000002,
+0x000006cb,0x00000069,0x000006c7,0x000006c9,
+0x0004003d,0x0000005a,0x000006cc,0x000006c7,
+0x0003003e,0x0000006d,0x000006cc,0x0004003d,
+0x0000005a,0x000006cd,0x000006c9,0x0003003e,
+0x0000006c,0x000006cd,0x0004003d,0x0000005a,
+0x000006ce,0x0000006c,0x0009004f,0x0000005a,
+0x000006cf,0x000006ce,0x000006ce,0x00000000,
+0x00000000,0x00000000,0x00000001,0x00070050,
+0x0000005a,0x000006d0,0x000000c0,0x000000c0,
+0x000000c0,0x000000c0,0x00070050,0x0000005a,
+0x000006d1,0x000006af,0x000006af,0x000006af,
+0x000006af,0x0008000c,0x0000005a,0x000006d2,
+0x00000001,0x0000002d,0x000006cf,0x000006d0,
+0x000006d1,0x0004007c,0x0000000f,0x000006d3,
+0x000006d2,0x0003003e,0x0000006f,0x000006d3,
+0x0004003d,0x0000005a,0x000006d4,0x0000006c,
+0x0009004f,0x0000005a,0x000006d5,0x000006d4,
+0x000006d4,0x00000000,0x00000000,0x00000000,
+0x00000001,0x0004003d,0x0000005a,0x000006d6,
+0x0000006d,0x0009004f,0x0000005a,0x000006d7,
+0x000006d6,0x000006d6,0x00000000,0x00000000,
+0x00000000,0x00000001,0x00050080,0x0000005a,
+0x000006d8,0x000006d5,0x000006d7,0x00070050,
+0x0000005a,0x000006d9,0x000000c0,0x000000c0,
+0x000000c0,0x000000c0,0x00070050,0x0000005a,
+0x000006da,0x000006af,0x000006af,0x000006af,
+0x000006af,0x0008000c,0x0000005a,0x000006db,
+0x00000001,0x0000002d,0x000006d8,0x000006d9,
+0x000006da,0x0004007c,0x0000000f,0x000006dc,
+0x000006db,0x0003003e,0x00000070,0x000006dc,
+0x000100fd,0x000200f8,0x00000688,0x00050041,
+0x0000024d,0x000006de,0x0000006c,0x0000009d,
+0x0004003d,0x00000059,0x000006df,0x000006de,
+0x0004007c,0x00000006,0x000006e0,0x000006df,
+0x00050041,0x0000024d,0x000006e1,0x0000006d,
+0x0000009d,0x0004003d,0x00000059,0x000006e2,
+0x000006e1,0x0004007c,0x00000006,0x000006e3,
+0x000006e2,0x00050041,0x0000024d,0x000006e4,
+0x0000006c,0x000000a0,0x0004003d,0x00000059,
+0x000006e5,0x000006e4,0x0004007c,0x00000006,
+0x000006e6,0x000006e5,0x00070050,0x0000000f,
+0x000006e7,0x000006e0,0x000006e3,0x000006e6,
+0x00000693,0x0003003e,0x00000070,0x000006e7,
+0x0004003d,0x0000000f,0x000006e8,0x00000070,
+0x0008004f,0x00000008,0x000006e9,0x000006e8,
+0x000006e8,0x00000000,0x00000001,0x00000002,
+0x00050041,0x0000024d,0x000006ea,0x0000006d,
+0x000000a0,0x0004003d,0x00000059,0x000006eb,
+0x000006ea,0x0004007c,0x00000006,0x000006ec,
+0x000006eb,0x00060050,0x00000008,0x000006ed,
+0x000006ec,0x000006ec,0x000006ec,0x00050084,
+0x00000008,0x000006ee,0x000006e9,0x000006ed,
+0x00060050,0x00000060,0x000006ef,0x0000059d,
+0x0000059d,0x0000059d,0x000500c2,0x00000008,
+0x000006f0,0x000006ee,0x000006ef,0x00050051,
+0x00000006,0x000006f1,0x000006f0,0x00000000,
+0x00050051,0x00000006,0x000006f2,0x000006f0,
+0x00000001,0x00050051,0x00000006,0x000006f3,
+0x000006f0,0x00000002,0x00070050,0x0000000f,
+0x000006f4,0x000006f1,0x000006f2,0x000006f3,
+0x00000693,0x0003003e,0x0000006f,0x000006f4,
+0x000100fd,0x000200f8,0x00000689,0x00050041,
+0x0000024d,0x000006f6,0x0000006c,0x0000009d,
+0x0004003d,0x00000059,0x000006f7,0x000006f6,
+0x0004007c,0x00000006,0x000006f8,0x000006f7,
+0x00050041,0x0000024d,0x000006f9,0x0000006d,
+0x0000009d,0x0004003d,0x00000059,0x000006fa,
+0x000006f9,0x0004007c,0x00000006,0x000006fb,
+0x000006fa,0x00050041,0x0000024d,0x000006fc,
+0x0000006c,0x000000a0,0x0004003d,0x00000059,
+0x000006fd,0x000006fc,0x0004007c,0x00000006,
+0x000006fe,0x000006fd,0x00050041,0x0000024d,
+0x000006ff,0x0000006d,0x00000092,0x0004003d,
+0x00000059,0x00000700,0x000006ff,0x0004007c,
+0x00000006,0x00000701,0x00000700,0x00070050,
+0x0000000f,0x00000702,0x000006f8,0x000006fb,
+0x000006fe,0x00000701,0x0003003e,0x00000070,
+0x00000702,0x0004003d,0x0000000f,0x00000703,
+0x00000070,0x0008004f,0x00000008,0x00000704,
+0x00000703,0x00000703,0x00000000,0x00000001,
+0x00000002,0x00050041,0x0000024d,0x00000705,
+0x0000006d,0x000000a0,0x0004003d,0x00000059,
+0x00000706,0x00000705,0x0004007c,0x00000006,
+0x00000707,0x00000706,0x00060050,0x00000008,
+0x00000708,0x00000707,0x00000707,0x00000707,
+0x00050084,0x00000008,0x00000709,0x00000704,
+0x00000708,0x00060050,0x00000060,0x0000070a,
+0x0000059d,0x0000059d,0x0000059d,0x000500c2,
+0x00000008,0x0000070b,0x00000709,0x0000070a,
+0x00050041,0x0000024d,0x0000070c,0x0000006c,
+0x00000092,0x0004003d,0x00000059,0x0000070d,
+0x0000070c,0x0004007c,0x00000006,0x0000070e,
+0x0000070d,0x00050051,0x00000006,0x0000070f,
+0x0000070b,0x00000000,0x00050051,0x00000006,
+0x00000710,0x0000070b,0x00000001,0x00050051,
+0x00000006,0x00000711,0x0000070b,0x00000002,
+0x00070050,0x0000000f,0x00000712,0x0000070f,
+0x00000710,0x00000711,0x0000070e,0x0003003e,
+0x0000006f,0x00000712,0x000100fd,0x000200f8,
+0x0000068a,0x00050041,0x0000024d,0x00000714,
+0x0000006c,0x00000096,0x0003003e,0x00000714,
+0x000006af,0x00050041,0x0000024d,0x00000715,
+0x0000006d,0x00000096,0x0003003e,0x00000715,
+0x000006af,0x000200f9,0x0000068b,0x000200f8,
+0x0000068b,0x0004003d,0x0000005a,0x00000717,
+0x0000006d,0x0008004f,0x00000060,0x00000718,
+0x00000717,0x00000717,0x00000000,0x00000001,
+0x00000002,0x0003003e,0x00000716,0x00000718,
+0x00050039,0x00000059,0x00000719,0x00000064,
+0x00000716,0x0004003d,0x0000005a,0x0000071b,
+0x0000006c,0x0008004f,0x00000060,0x0000071c,
+0x0000071b,0x0000071b,0x00000000,0x00000001,
+0x00000002,0x0003003e,0x0000071a,0x0000071c,
+0x00050039,0x00000059,0x0000071d,0x00000064,
+0x0000071a,0x000500af,0x000000ad,0x0000071e,
+0x00000719,0x0000071d,0x000300f7,0x00000720,
+0x00000000,0x000400fa,0x0000071e,0x0000071f,
+0x00000725,0x000200f8,0x0000071f,0x0004003d,
+0x0000005a,0x00000721,0x0000006c,0x0004007c,
+0x0000000f,0x00000722,0x00000721,0x0003003e,
+0x0000006f,0x00000722,0x0004003d,0x0000005a,
+0x00000723,0x0000006d,0x0004007c,0x0000000f,
+0x00000724,0x00000723,0x0003003e,0x00000070,
+0x00000724,0x000200f9,0x00000720,0x000200f8,
+0x00000725,0x0004003d,0x0000005a,0x00000727,
+0x0000006d,0x0003003e,0x00000726,0x00000727,
+0x00050039,0x0000005a,0x00000728,0x0000005e,
+0x00000726,0x0004007c,0x0000000f,0x00000729,
+0x00000728,0x0003003e,0x0000006f,0x00000729,
+0x0004003d,0x0000005a,0x0000072b,0x0000006c,
+0x0003003e,0x0000072a,0x0000072b,0x00050039,
+0x0000005a,0x0000072c,0x0000005e,0x0000072a,
+0x0004007c,0x0000000f,0x0000072d,0x0000072c,
+0x0003003e,0x00000070,0x0000072d,0x000200f9,
+0x00000720,0x000200f8,0x00000720,0x000100fd,
+0x000200f8,0x0000068c,0x00050041,0x0000024d,
+0x0000072f,0x0000006c,0x00000096,0x0003003e,
+0x0000072f,0x000006af,0x00050041,0x0000024d,
+0x00000731,0x0000006d,0x00000096,0x0003003e,
+0x00000731,0x00000730,0x000200f9,0x0000068d,
+0x000200f8,0x0000068d,0x0004003d,0x0000005a,
+0x00000733,0x0000006d,0x0003003e,0x00000732,
+0x00000733,0x0004003d,0x0000005a,0x00000735,
+0x0000006c,0x0003003e,0x00000734,0x00000735,
+0x00060039,0x00000002,0x00000736,0x00000069,
+0x00000732,0x00000734,0x0004003d,0x0000005a,
+0x00000737,0x00000732,0x0003003e,0x0000006d,
+0x00000737,0x0004003d,0x0000005a,0x00000738,
+0x00000734,0x0003003e,0x0000006c,0x00000738,
+0x0004003d,0x0000005a,0x0000073a,0x0000006d,
+0x0008004f,0x00000060,0x0000073b,0x0000073a,
+0x0000073a,0x00000000,0x00000001,0x00000002,
+0x0003003e,0x00000739,0x0000073b,0x00050039,
+0x00000059,0x0000073c,0x00000064,0x00000739,
+0x000500af,0x000000ad,0x0000073d,0x0000073c,
+0x000000c0,0x000300f7,0x0000073f,0x00000000,
+0x000400fa,0x0000073d,0x0000073e,0x0000074c,
+0x000200f8,0x0000073e,0x0004003d,0x0000005a,
+0x00000740,0x0000006c,0x00070050,0x0000005a,
+0x00000741,0x000000c0,0x000000c0,0x000000c0,
+0x000000c0,0x00070050,0x0000005a,0x00000742,
+0x000006af,0x000006af,0x000006af,0x000006af,
+0x0008000c,0x0000005a,0x00000743,0x00000001,
+0x0000002d,0x00000740,0x00000741,0x00000742,
+0x0004007c,0x0000000f,0x00000744,0x00000743,
+0x0003003e,0x0000006f,0x00000744,0x0004003d,
+0x0000005a,0x00000745,0x0000006c,0x0004003d,
+0x0000005a,0x00000746,0x0000006d,0x00050080,
+0x0000005a,0x00000747,0x00000745,0x00000746,
+0x00070050,0x0000005a,0x00000748,0x000000c0,
+0x000000c0,0x000000c0,0x000000c0,0x00070050,
+0x0000005a,0x00000749,0x000006af,0x000006af,
+0x000006af,0x000006af,0x0008000c,0x0000005a,
+0x0000074a,0x00000001,0x0000002d,0x00000747,
+0x00000748,0x00000749,0x0004007c,0x0000000f,
+0x0000074b,0x0000074a,0x0003003e,0x00000070,
+0x0000074b,0x000200f9,0x0000073f,0x000200f8,
+0x0000074c,0x0004003d,0x0000005a,0x0000074d,
+0x0000006c,0x0004003d,0x0000005a,0x0000074e,
+0x0000006d,0x00050080,0x0000005a,0x0000074f,
+0x0000074d,0x0000074e,0x0003003e,0x00000750,
+0x0000074f,0x00050039,0x0000005a,0x00000751,
+0x0000005e,0x00000750,0x00070050,0x0000005a,
+0x00000752,0x000000c0,0x000000c0,0x000000c0,
+0x000000c0,0x00070050,0x0000005a,0x00000753,
+0x000006af,0x000006af,0x000006af,0x000006af,
+0x0008000c,0x0000005a,0x00000754,0x00000001,
+0x0000002d,0x00000751,0x00000752,0x00000753,
+0x0004007c,0x0000000f,0x00000755,0x00000754,
+0x0003003e,0x0000006f,0x00000755,0x0004003d,
+0x0000005a,0x00000757,0x0000006c,0x0003003e,
+0x00000756,0x00000757,0x00050039,0x0000005a,
+0x00000758,0x0000005e,0x00000756,0x00070050,
+0x0000005a,0x00000759,0x000000c0,0x000000c0,
+0x000000c0,0x000000c0,0x00070050,0x0000005a,
+0x0000075a,0x000006af,0x000006af,0x000006af,
+0x000006af,0x0008000c,0x0000005a,0x0000075b,
+0x00000001,0x0000002d,0x00000758,0x00000759,
+0x0000075a,0x0004007c,0x0000000f,0x0000075c,
+0x0000075b,0x0003003e,0x00000070,0x0000075c,
+0x000200f9,0x0000073f,0x000200f8,0x0000073f,
+0x000100fd,0x000200f8,0x0000068f,0x000100fd,
+0x00010038,0x00050036,0x00000006,0x00000078,
+0x00000000,0x00000073,0x00030037,0x00000010,
+0x00000074,0x00030037,0x00000007,0x00000075,
+0x00030037,0x00000007,0x00000076,0x00030037,
+0x00000009,0x00000077,0x000200f8,0x00000079,
+0x0004003b,0x00000007,0x00000760,0x00000007,
+0x0004003b,0x00000007,0x00000768,0x00000007,
+0x0004003b,0x00000007,0x00000771,0x00000007,
+0x0004003b,0x00000010,0x00000774,0x00000007,
+0x0004003b,0x00000007,0x00000776,0x00000007,
+0x0004003b,0x00000007,0x00000778,0x00000007,
+0x0004003b,0x00000007,0x0000077a,0x00000007,
+0x0004003b,0x000007e1,0x000007e2,0x00000007,
+0x0004003b,0x00000007,0x000007ec,0x00000007,
+0x0004003b,0x00000007,0x000007f5,0x00000007,
+0x0004003b,0x00000010,0x000007f8,0x00000007,
+0x0004003b,0x00000007,0x000007fa,0x00000007,
+0x0004003b,0x00000007,0x000007fc,0x00000007,
+0x0004003b,0x00000007,0x000007fe,0x00000007,
+0x0004003b,0x0000080f,0x00000810,0x00000007,
+0x0004003b,0x00000007,0x00000815,0x00000007,
+0x0004003b,0x00000007,0x0000081b,0x00000007,
+0x0004003b,0x00000010,0x0000081c,0x00000007,
+0x0004003b,0x00000007,0x0000081e,0x00000007,
+0x0004003b,0x00000007,0x00000820,0x00000007,
+0x0004003b,0x00000012,0x00000823,0x00000007,
+0x0004003b,0x0000082f,0x00000830,0x00000007,
+0x00050041,0x00000007,0x00000761,0x00000077,
+0x00000092,0x0004003d,0x00000006,0x00000762,
+0x00000761,0x0003003e,0x00000760,0x00000762,
+0x00050041,0x00000007,0x00000763,0x00000077,
+0x0000009d,0x0004003d,0x00000006,0x00000764,
+0x00000763,0x000500aa,0x000000ad,0x00000765,
+0x00000764,0x000000a0,0x000300f7,0x00000767,
+0x00000000,0x000400fa,0x00000765,0x00000766,
+0x000007e6,0x000200f8,0x00000766,0x0004003d,
+0x00000006,0x00000769,0x00000076,0x00050086,
+0x00000006,0x0000076a,0x00000769,0x00000095,
+0x0004003d,0x00000006,0x0000076b,0x00000760,
+0x00050084,0x00000006,0x0000076c,0x00000095,
+0x0000076b,0x00050080,0x00000006,0x0000076d,
+0x0000076c,0x0000008d,0x00050084,0x00000006,
+0x0000076e,0x0000076a,0x0000076d,0x0004003d,
+0x00000006,0x0000076f,0x00000075,0x00050080,
+0x00000006,0x00000770,0x0000076e,0x0000076f,
+0x0003003e,0x00000768,0x00000770,0x0004003d,
+0x00000006,0x00000772,0x00000076,0x00050089,
+0x00000006,0x00000773,0x00000772,0x00000095,
+0x0004003d,0x0000000f,0x00000775,0x00000074,
+0x0003003e,0x00000774,0x00000775,0x0004003d,
+0x00000006,0x00000777,0x00000768,0x0003003e,
+0x00000776,0x00000777,0x0004003d,0x00000006,
+0x00000779,0x00000760,0x0003003e,0x00000778,
+0x00000779,0x0003003e,0x0000077a,0x00000773,
+0x00080039,0x00000006,0x0000077b,0x0000002a,
+0x00000774,0x00000776,0x00000778,0x0000077a,
+0x0003003e,0x00000771,0x0000077b,0x0004003d,
+0x00000006,0x000007da,0x00000760,0x000500c4,
+0x00000059,0x000007db,0x000000cb,0x000007da,
+0x00050082,0x00000059,0x000007dc,0x000007db,
+0x000000cb,0x00050084,0x00000059,0x000007dd,
+0x0000015f,0x000007dc,0x0004007c,0x00000006,
+0x000007de,0x000007dd,0x0004003d,0x00000006,
+0x000007df,0x00000771,0x00050080,0x00000006,
+0x000007e0,0x000007de,0x000007df,0x0003003e,
+0x000007e2,0x000007d9,0x00050041,0x00000007,
+0x000007e3,0x000007e2,0x000007e0,0x0004003d,
+0x00000006,0x000007e4,0x000007e3,0x000200fe,
+0x000007e4,0x000200f8,0x000007e6,0x00050041,
+0x00000007,0x000007e7,0x00000077,0x000000a0,
+0x0004003d,0x00000006,0x000007e8,0x000007e7,
+0x000500aa,0x000000ad,0x000007e9,0x000007e8,
+0x000000a0,0x000300f7,0x000007eb,0x00000000,
+0x000400fa,0x000007e9,0x000007ea,0x00000814,
+0x000200f8,0x000007ea,0x0004003d,0x00000006,
+0x000007ed,0x00000076,0x00050086,0x00000006,
+0x000007ee,0x000007ed,0x00000096,0x0004003d,
+0x00000006,0x000007ef,0x00000760,0x00050084,
+0x00000006,0x000007f0,0x00000096,0x000007ef,
+0x00050080,0x00000006,0x000007f1,0x000007f0,
+0x0000008e,0x00050084,0x00000006,0x000007f2,
+0x000007ee,0x000007f1,0x0004003d,0x00000006,
+0x000007f3,0x00000075,0x00050080,0x00000006,
+0x000007f4,0x000007f2,0x000007f3,0x0003003e,
+0x000007ec,0x000007f4,0x0004003d,0x00000006,
+0x000007f6,0x00000076,0x00050089,0x00000006,
+0x000007f7,0x000007f6,0x00000096,0x0004003d,
+0x0000000f,0x000007f9,0x00000074,0x0003003e,
+0x000007f8,0x000007f9,0x0004003d,0x00000006,
+0x000007fb,0x000007ec,0x0003003e,0x000007fa,
+0x000007fb,0x0004003d,0x00000006,0x000007fd,
+0x00000760,0x0003003e,0x000007fc,0x000007fd,
+0x0003003e,0x000007fe,0x000007f7,0x00080039,
+0x00000006,0x000007ff,0x00000030,0x000007f8,
+0x000007fa,0x000007fc,0x000007fe,0x0003003e,
+0x000007f5,0x000007ff,0x0004003d,0x00000006,
+0x00000808,0x00000760,0x000500c4,0x00000059,
+0x00000809,0x000000cb,0x00000808,0x00050082,
+0x00000059,0x0000080a,0x00000809,0x000000cb,
+0x00050084,0x00000059,0x0000080b,0x000000d0,
+0x0000080a,0x0004007c,0x00000006,0x0000080c,
+0x0000080b,0x0004003d,0x00000006,0x0000080d,
+0x000007f5,0x00050080,0x00000006,0x0000080e,
+0x0000080c,0x0000080d,0x0003003e,0x00000810,
+0x00000807,0x00050041,0x00000007,0x00000811,
+0x00000810,0x0000080e,0x0004003d,0x00000006,
+0x00000812,0x00000811,0x000200fe,0x00000812,
+0x000200f8,0x00000814,0x0004003d,0x00000006,
+0x00000816,0x00000076,0x0004003d,0x00000006,
+0x00000817,0x00000760,0x00050084,0x00000006,
+0x00000818,0x00000816,0x00000817,0x0004003d,
+0x00000006,0x00000819,0x00000075,0x00050080,
+0x00000006,0x0000081a,0x00000818,0x00000819,
+0x0003003e,0x00000815,0x0000081a,0x0004003d,
+0x0000000f,0x0000081d,0x00000074,0x0003003e,
+0x0000081c,0x0000081d,0x0004003d,0x00000006,
+0x0000081f,0x00000815,0x0003003e,0x0000081e,
+0x0000081f,0x0004003d,0x00000006,0x00000821,
+0x00000760,0x0003003e,0x00000820,0x00000821,
+0x00070039,0x00000006,0x00000822,0x0000001c,
+0x0000081c,0x0000081e,0x00000820,0x0003003e,
+0x0000081b,0x00000822,0x0004003d,0x00000006,
+0x0000082d,0x00000760,0x00050082,0x00000006,
+0x0000082e,0x0000082d,0x000000a0,0x0003003e,
+0x00000830,0x0000082c,0x00050041,0x00000012,
+0x00000831,0x00000830,0x0000082e,0x0004003d,
+0x00000011,0x00000832,0x00000831,0x0003003e,
+0x00000823,0x00000832,0x0004003d,0x00000006,
+0x00000833,0x0000081b,0x00050041,0x00000007,
+0x00000834,0x00000823,0x0000009d,0x0004003d,
+0x00000006,0x00000835,0x00000834,0x00050084,
+0x00000006,0x00000836,0x00000833,0x00000835,
+0x0004003d,0x00000006,0x00000837,0x0000081b,
+0x00050041,0x00000007,0x00000838,0x00000823,
+0x000000a0,0x0004003d,0x00000006,0x00000839,
+0x00000838,0x000500c2,0x00000006,0x0000083a,
+0x00000837,0x00000839,0x000500c5,0x00000006,
+0x0000083b,0x00000836,0x0000083a,0x000200fe,
+0x0000083b,0x000200f8,0x000007eb,0x000100ff,
+0x000200f8,0x00000767,0x000100ff,0x00010038,
+0x00050036,0x0000000f,0x0000007c,0x00000000,
+0x0000007a,0x00030037,0x00000007,0x0000007b,
+0x000200f8,0x0000007d,0x0004003b,0x0000005b,
+0x0000083e,0x00000007,0x0004003b,0x00000010,
+0x00000847,0x00000007,0x0004003d,0x00000006,
+0x0000083f,0x0000007b,0x0004007c,0x00000059,
+0x00000840,0x0000083f,0x00070050,0x0000005a,
+0x00000845,0x00000840,0x00000840,0x00000840,
+0x00000840,0x00050082,0x0000005a,0x00000846,
+0x00000845,0x00000844,0x0003003e,0x0000083e,
+0x00000846,0x0004003d,0x0000005a,0x00000849,
+0x0000083e,0x0008000c,0x0000005a,0x0000084d,
+0x00000001,0x0000002d,0x00000849,0x0000084a,
+0x0000084c,0x000500c4,0x0000000f,0x0000084e,
+0x00000848,0x0000084d,0x00070050,0x0000000f,
+0x0000084f,0x000000a0,0x000000a0,0x000000a0,
+0x000000a0,0x00050082,0x0000000f,0x00000850,
+0x0000084e,0x0000084f,0x0003003e,0x00000847,
+0x00000850,0x0004003d,0x0000000f,0x00000851,
+0x00000847,0x0004003d,0x00000006,0x00000854,
+0x0000007b,0x00070050,0x0000000f,0x00000855,
+0x00000854,0x00000854,0x00000854,0x00000854,
+0x000500ae,0x00000857,0x00000858,0x00000855,
+0x00000856,0x000600a9,0x0000000f,0x00000859,
+0x00000858,0x00000853,0x00000851,0x000200fe,
+0x00000859,0x00010038,0x00050036,0x0000000f,
+0x00000080,0x00000000,0x0000007e,0x00030037,
+0x00000011,0x0000007f,0x000200f8,0x00000081,
+0x0004003b,0x00000010,0x00000872,0x00000007,
+0x0004003b,0x00000007,0x00000876,0x00000007,
+0x0004003b,0x00000012,0x0000087a,0x00000007,
+0x0004003b,0x00000010,0x0000087b,0x00000007,
+0x0004003b,0x00000007,0x0000087e,0x00000007,
+0x0004003b,0x00000007,0x0000087f,0x00000007,
+0x0004003b,0x00000012,0x00000881,0x00000007,
+0x0004003b,0x00000007,0x00000882,0x00000007,
+0x0004003b,0x00000007,0x00000885,0x00000007,
+0x0004003b,0x00000007,0x00000886,0x00000007,
+0x0004003b,0x00000007,0x00000887,0x00000007,
+0x0004003b,0x00000007,0x00000888,0x00000007,
+0x0004003b,0x00000007,0x00000889,0x00000007,
+0x0004003b,0x00000007,0x0000088b,0x00000007,
+0x0004003b,0x00000007,0x0000088c,0x00000007,
+0x0004003b,0x00000007,0x0000088d,0x00000007,
+0x0004003b,0x00000007,0x00000897,0x00000007,
+0x0004003b,0x00000007,0x0000089d,0x00000007,
+0x0004003b,0x00000007,0x000008a5,0x00000007,
+0x0004003b,0x00000009,0x000008a9,0x00000007,
+0x0004003b,0x00000007,0x000008aa,0x00000007,
+0x0004003b,0x00000007,0x000008ab,0x00000007,
+0x0004003b,0x00000007,0x000008ad,0x00000007,
+0x0004003b,0x00000007,0x000008af,0x00000007,
+0x0004003b,0x00000007,0x000008b2,0x00000007,
+0x0004003b,0x0000005b,0x000008b6,0x00000007,
+0x0004003b,0x0000005b,0x000008b7,0x00000007,
+0x0004003b,0x00000010,0x000008b8,0x00000007,
+0x0004003b,0x00000007,0x000008bd,0x00000007,
+0x0004003b,0x00000007,0x000008c0,0x00000007,
+0x0004003b,0x00000007,0x000008c9,0x00000007,
+0x0004003b,0x00000010,0x000008cf,0x00000007,
+0x0004003b,0x00000007,0x000008d1,0x00000007,
+0x0004003b,0x00000007,0x000008d3,0x00000007,
+0x0004003b,0x00000009,0x000008d5,0x00000007,
+0x0004003b,0x00000010,0x000008dd,0x00000007,
+0x0004003b,0x00000007,0x000008df,0x00000007,
+0x0004003b,0x00000007,0x000008e1,0x00000007,
+0x0004003b,0x00000009,0x000008e2,0x00000007,
+0x0004003b,0x00000010,0x000008e9,0x00000007,
+0x0004003b,0x00000010,0x000008ea,0x00000007,
+0x0004003b,0x0000005b,0x000008eb,0x00000007,
+0x0004003b,0x0000005b,0x000008ed,0x00000007,
+0x0004003b,0x00000007,0x000008ef,0x00000007,
+0x0004003b,0x00000010,0x000008f1,0x00000007,
+0x0004003b,0x00000010,0x000008f2,0x00000007,
+0x0004003b,0x00000010,0x000008f6,0x00000007,
+0x0004003b,0x00000007,0x000008fd,0x00000007,
+0x0004003b,0x00000010,0x000008fe,0x00000007,
+0x0004003b,0x00000007,0x00000900,0x00000007,
+0x0004003b,0x00000007,0x00000902,0x00000007,
+0x0004003d,0x000000ad,0x0000085c,0x000000af,
+0x000300f7,0x0000085e,0x00000000,0x000400fa,
+0x0000085c,0x0000085d,0x0000085e,0x000200f8,
+0x0000085d,0x000200fe,0x0000085f,0x000200f8,
+0x0000085e,0x0004003d,0x000000ad,0x00000861,
+0x000000b1,0x000300f7,0x00000863,0x00000000,
+0x000400fa,0x00000861,0x00000862,0x00000863,
+0x000200f8,0x00000862,0x00050041,0x000000b2,
+0x00000864,0x000000a8,0x000000a0,0x0004003d,
+0x00000006,0x00000865,0x00000864,0x000600cb,
+0x00000006,0x00000866,0x00000865,0x0000059d,
+0x0000059d,0x00050041,0x000000b2,0x00000867,
+0x000000a8,0x000000a0,0x0004003d,0x00000006,
+0x00000868,0x00000867,0x000600cb,0x00000006,
+0x00000869,0x00000868,0x000005aa,0x0000059d,
+0x00050041,0x000000b2,0x0000086a,0x000000a8,
+0x0000009d,0x0004003d,0x00000006,0x0000086b,
+0x0000086a,0x000600cb,0x00000006,0x0000086c,
+0x0000086b,0x0000059d,0x0000059d,0x00050041,
+0x000000b2,0x0000086d,0x000000a8,0x0000009d,
+0x0004003d,0x00000006,0x0000086e,0x0000086d,
+0x000600cb,0x00000006,0x0000086f,0x0000086e,
+0x000005aa,0x0000059d,0x00070050,0x0000000f,
+0x00000870,0x00000866,0x00000869,0x0000086c,
+0x0000086f,0x000200fe,0x00000870,0x000200f8,
+0x00000863,0x0004003d,0x0000000f,0x00000873,
+0x000000a8,0x0009004f,0x0000000f,0x00000874,
+0x00000873,0x00000873,0x00000003,0x00000002,
+0x00000001,0x00000000,0x000400cc,0x0000000f,
+0x00000875,0x00000874,0x0004003d,0x00000006,
+0x00000877,0x00000170,0x0003003e,0x00000876,
+0x00000877,0x00050039,0x0000000f,0x00000878,
+0x0000007c,0x00000876,0x000500c7,0x0000000f,
+0x00000879,0x00000875,0x00000878,0x0003003e,
+0x00000872,0x00000879,0x0004003d,0x0000000f,
+0x0000087c,0x00000872,0x0003003e,0x0000087b,
+0x0000087c,0x00060039,0x00000011,0x0000087d,
+0x00000047,0x0000087b,0x0000007f,0x0003003e,
+0x0000087a,0x0000087d,0x0004003d,0x00000006,
+0x00000880,0x0000018e,0x0003003e,0x0000087f,
+0x00000880,0x0003003e,0x00000881,0x0000007f,
+0x0004003d,0x00000006,0x00000883,0x00000184,
+0x0003003e,0x00000882,0x00000883,0x00070039,
+0x00000006,0x00000884,0x00000051,0x0000087f,
+0x00000881,0x00000882,0x0003003e,0x0000087e,
+0x00000884,0x0003003e,0x00000885,0x0000009d,
+0x0003003e,0x00000886,0x0000009d,0x0003003e,
+0x00000887,0x0000009d,0x0004003d,0x00000006,
+0x0000088a,0x0000087e,0x0003003e,0x00000889,
+0x0000088a,0x00080039,0x00000006,0x0000088e,
+0x00000023,0x00000889,0x0000088b,0x0000088c,
+0x0000088d,0x0004003d,0x00000006,0x0000088f,
+0x0000088b,0x0003003e,0x00000885,0x0000088f,
+0x0004003d,0x00000006,0x00000890,0x0000088c,
+0x0003003e,0x00000886,0x00000890,0x0004003d,
+0x00000006,0x00000891,0x0000088d,0x0003003e,
+0x00000887,0x00000891,0x0003003e,0x00000888,
+0x0000088e,0x0004003d,0x00000006,0x00000892,
+0x00000886,0x000500ac,0x000000ad,0x00000893,
+0x00000892,0x000002a1,0x000300f7,0x00000895,
+0x00000000,0x000400fa,0x00000893,0x00000894,
+0x00000895,0x000200f8,0x00000894,0x000200fe,
+0x0000085f,0x000200f8,0x00000895,0x0004003d,
+0x00000006,0x00000898,0x00000184,0x000500aa,
+0x000000ad,0x00000899,0x00000898,0x000000a0,
+0x000600a9,0x00000059,0x0000089b,0x00000899,
+0x00000556,0x0000089a,0x0004007c,0x00000006,
+0x0000089c,0x0000089b,0x0003003e,0x00000897,
+0x0000089c,0x0004003d,0x000000ad,0x0000089f,
+0x000000dc,0x000600a9,0x00000059,0x000008a0,
+0x0000089f,0x000000cb,0x000000c0,0x00050084,
+0x00000059,0x000008a1,0x0000089e,0x000008a0,
+0x0004007c,0x00000006,0x000008a2,0x000008a1,
+0x0004003d,0x00000006,0x000008a3,0x00000885,
+0x00050080,0x00000006,0x000008a4,0x000008a2,
+0x000008a3,0x0003003e,0x0000089d,0x000008a4,
+0x0004003d,0x00000006,0x000008a6,0x0000089d,
+0x0004003d,0x00000006,0x000008a7,0x00000897,
+0x00050082,0x00000006,0x000008a8,0x000008a6,
+0x000008a7,0x0003003e,0x000008a5,0x000008a8,
+0x0004003d,0x00000006,0x000008ac,0x000008a5,
+0x0003003e,0x000008ab,0x000008ac,0x0004003d,
+0x00000006,0x000008ae,0x00000886,0x0003003e,
+0x000008ad,0x000008ae,0x00070039,0x00000008,
+0x000008b0,0x00000057,0x000008ab,0x000008ad,
+0x000008af,0x0004003d,0x00000006,0x000008b1,
+0x000008af,0x0003003e,0x000008aa,0x000008b1,
+0x0003003e,0x000008a9,0x000008b0,0x0004003d,
+0x00000006,0x000008b3,0x00000888,0x000500c2,
+0x00000006,0x000008b4,0x000008b3,0x000000c1,
+0x00050080,0x00000006,0x000008b5,0x000008b4,
+0x000000a0,0x0003003e,0x000008b2,0x000008b5,
+0x0003003e,0x000008b6,0x0000084a,0x0003003e,
+0x000008b7,0x0000084a,0x0004003d,0x0000000f,
+0x000008b9,0x000000a8,0x0004003d,0x00000006,
+0x000008ba,0x00000897,0x0004003d,0x00000006,
+0x000008bb,0x000008aa,0x00050080,0x00000006,
+0x000008bc,0x000008ba,0x000008bb,0x0003003e,
+0x000008bd,0x000008bc,0x00050039,0x0000000f,
+0x000008be,0x0000007c,0x000008bd,0x000500c7,
+0x0000000f,0x000008bf,0x000008b9,0x000008be,
+0x0003003e,0x000008b8,0x000008bf,0x0003003e,
+0x000008c0,0x0000009d,0x000200f9,0x000008c1,
+0x000200f8,0x000008c1,0x000400f6,0x000008c3,
+0x000008c4,0x00000000,0x000200f9,0x000008c5,
+0x000200f8,0x000008c5,0x0004003d,0x00000006,
+0x000008c6,0x000008c0,0x0004003d,0x00000006,
+0x000008c7,0x000008b2,0x000500b0,0x000000ad,
+0x000008c8,0x000008c6,0x000008c7,0x000400fa,
+0x000008c8,0x000008c2,0x000008c3,0x000200f8,
+0x000008c2,0x0004003d,0x00000006,0x000008ca,
+0x000008c0,0x00050084,0x00000006,0x000008cb,
+0x00000092,0x000008ca,0x0004003d,0x00000006,
+0x000008cc,0x00000887,0x00050080,0x00000006,
+0x000008cd,0x000008cb,0x000008cc,0x0003003e,
+0x000008c9,0x000008cd,0x0004003d,0x00000006,
+0x000008ce,0x000008c0,0x0004003d,0x0000000f,
+0x000008d0,0x000008b8,0x0003003e,0x000008cf,
+0x000008d0,0x0004003d,0x00000006,0x000008d2,
+0x00000897,0x0003003e,0x000008d1,0x000008d2,
+0x0004003d,0x00000006,0x000008d4,0x000008c9,
+0x0003003e,0x000008d3,0x000008d4,0x0004003d,
+0x00000008,0x000008d6,0x000008a9,0x0003003e,
+0x000008d5,0x000008d6,0x00080039,0x00000006,
+0x000008d7,0x00000078,0x000008cf,0x000008d1,
+0x000008d3,0x000008d5,0x0004007c,0x00000059,
+0x000008d8,0x000008d7,0x00050041,0x0000024d,
+0x000008d9,0x000008b6,0x000008ce,0x0003003e,
+0x000008d9,0x000008d8,0x0004003d,0x00000006,
+0x000008da,0x000008c0,0x0004003d,0x00000006,
+0x000008db,0x000008c9,0x00050080,0x00000006,
+0x000008dc,0x000008db,0x000000a0,0x0004003d,
+0x0000000f,0x000008de,0x000008b8,0x0003003e,
+0x000008dd,0x000008de,0x0004003d,0x00000006,
+0x000008e0,0x00000897,0x0003003e,0x000008df,
+0x000008e0,0x0003003e,0x000008e1,0x000008dc,
+0x0004003d,0x00000008,0x000008e3,0x000008a9,
+0x0003003e,0x000008e2,0x000008e3,0x00080039,
+0x00000006,0x000008e4,0x00000078,0x000008dd,
+0x000008df,0x000008e1,0x000008e2,0x0004007c,
+0x00000059,0x000008e5,0x000008e4,0x00050041,
+0x0000024d,0x000008e6,0x000008b7,0x000008da,
+0x0003003e,0x000008e6,0x000008e5,0x000200f9,
+0x000008c4,0x000200f8,0x000008c4,0x0004003d,
+0x00000006,0x000008e7,0x000008c0,0x00050080,
+0x00000006,0x000008e8,0x000008e7,0x000000cb,
+0x0003003e,0x000008c0,0x000008e8,0x000200f9,
+0x000008c1,0x000200f8,0x000008c3,0x0004003d,
+0x0000005a,0x000008ec,0x000008b6,0x0003003e,
+0x000008eb,0x000008ec,0x0004003d,0x0000005a,
+0x000008ee,0x000008b7,0x0003003e,0x000008ed,
+0x000008ee,0x0004003d,0x00000006,0x000008f0,
+0x00000888,0x0003003e,0x000008ef,0x000008f0,
+0x00090039,0x00000002,0x000008f3,0x00000071,
+0x000008eb,0x000008ed,0x000008ef,0x000008f1,
+0x000008f2,0x0004003d,0x0000000f,0x000008f4,
+0x000008f1,0x0003003e,0x000008e9,0x000008f4,
+0x0004003d,0x0000000f,0x000008f5,0x000008f2,
+0x0003003e,0x000008ea,0x000008f5,0x00050041,
+0x00000007,0x000008f7,0x0000087a,0x0000009d,
+0x0004003d,0x00000006,0x000008f8,0x000008f7,
+0x00070050,0x0000000f,0x000008f9,0x000008f8,
+0x000008f8,0x000008f8,0x000008f8,0x0003003e,
+0x000008f6,0x000008f9,0x0004003d,0x000000ad,
+0x000008fa,0x000000dc,0x000300f7,0x000008fc,
+0x00000000,0x000400fa,0x000008fa,0x000008fb,
+0x000008fc,0x000200f8,0x000008fb,0x0004003d,
+0x0000000f,0x000008ff,0x000000a8,0x0003003e,
+0x000008fe,0x000008ff,0x0004003d,0x00000006,
+0x00000901,0x0000089d,0x0003003e,0x00000900,
+0x00000901,0x0003003e,0x00000902,0x00000092,
+0x00070039,0x00000006,0x00000903,0x0000001c,
+0x000008fe,0x00000900,0x00000902,0x0003003e,
+0x000008fd,0x00000903,0x0004003d,0x00000006,
+0x00000904,0x000008fd,0x00050041,0x00000007,
+0x00000905,0x0000087a,0x000000a0,0x0004003d,
+0x00000006,0x00000906,0x00000905,0x00050041,
+0x00000007,0x00000907,0x000008f6,0x00000904,
+0x0003003e,0x00000907,0x00000906,0x000200f9,
+0x000008fc,0x000200f8,0x000008fc,0x0004003d,
+0x0000000f,0x00000908,0x000008e9,0x0004003d,
+0x0000000f,0x00000909,0x000008f6,0x00070050,
+0x0000000f,0x0000090a,0x0000017e,0x0000017e,
+0x0000017e,0x0000017e,0x00050082,0x0000000f,
+0x0000090b,0x0000090a,0x00000909,0x00050084,
+0x0000000f,0x0000090c,0x00000908,0x0000090b,
+0x0004003d,0x0000000f,0x0000090d,0x000008ea,
+0x0004003d,0x0000000f,0x0000090e,0x000008f6,
+0x00050084,0x0000000f,0x0000090f,0x0000090d,
+0x0000090e,0x00050080,0x0000000f,0x00000910,
+0x0000090c,0x0000090f,0x00070050,0x0000000f,
+0x00000911,0x000001a1,0x000001a1,0x000001a1,
+0x000001a1,0x00050080,0x0000000f,0x00000912,
+0x00000910,0x00000911,0x00070050,0x0000005a,
+0x00000913,0x0000050d,0x0000050d,0x0000050d,
+0x0000050d,0x000500c2,0x0000000f,0x00000914,
+0x00000912,0x00000913,0x000200fe,0x00000914,
+0x00010038,0x00050036,0x00000082,0x00000085,
+0x00000000,0x00000083,0x00030037,0x00000061,
+0x00000084,0x000200f8,0x00000086,0x0004003d,
+0x00000060,0x00000917,0x00000084,0x0007004f,
+0x00000082,0x00000918,0x00000917,0x00000917,
+0x00000000,0x00000002,0x000200fe,0x00000918,
+0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_2D.inl
new file mode 100644
index 00000000000..f23b04f1297
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_2D.inl
@@ -0,0 +1,3594 @@
+0x07230203,0x00010300,0x000d000a,0x0000095d,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x0000091c,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00080005,0x0000000d,0x45746567,
+0x646f636e,0x53676e69,0x28657a69,0x763b3175,
+0x003b3375,0x00040005,0x0000000b,0x566d756e,
+0x00736c61,0x00050005,0x0000000c,0x6f636e65,
+0x676e6964,0x00000000,0x000a0005,0x00000016,
+0x63747361,0x6f636544,0x49726564,0x6974696e,
+0x7a696c61,0x75762865,0x75763b34,0x00003b32,
+0x00050005,0x00000014,0x636f6c62,0x7461446b,
+0x00000061,0x00050005,0x00000015,0x636f6c62,
+0x7a69536b,0x00005f65,0x00080005,0x0000001c,
+0x72747865,0x42746361,0x28737469,0x3b347576,
+0x753b3175,0x00003b31,0x00040005,0x00000019,
+0x61746164,0x00000000,0x00040005,0x0000001a,
+0x7366666f,0x00007465,0x00040005,0x0000001b,
+0x426d756e,0x00737469,0x00080005,0x00000023,
+0x6f636564,0x45436564,0x3175284d,0x3b31753b,
+0x753b3175,0x00003b31,0x00060005,0x0000001f,
+0x74726170,0x6f697469,0x646e496e,0x00007865,
+0x00060005,0x00000020,0x72617473,0x45664f74,
+0x61727478,0x006d6543,0x00060005,0x00000021,
+0x61746f74,0x646e456c,0x6e696f70,0x00007374,
+0x00070005,0x00000022,0x65736162,0x70646e45,
+0x746e696f,0x65646e49,0x00000078,0x00090005,
+0x0000002a,0x6f636564,0x72546564,0x76287469,
+0x753b3475,0x31753b31,0x3b31753b,0x00000000,
+0x00040005,0x00000026,0x61746164,0x00000000,
+0x00040005,0x00000027,0x7366666f,0x00007465,
+0x00040005,0x00000028,0x426d756e,0x00737469,
+0x00030005,0x00000029,0x00000069,0x00090005,
+0x00000030,0x6f636564,0x75516564,0x28746e69,
+0x3b347576,0x753b3175,0x31753b31,0x0000003b,
+0x00040005,0x0000002c,0x61746164,0x00000000,
+0x00040005,0x0000002d,0x7366666f,0x00007465,
+0x00040005,0x0000002e,0x426d756e,0x00737469,
+0x00030005,0x0000002f,0x00000069,0x000a0005,
+0x00000037,0x6f636564,0x57316564,0x68676965,
+0x75762874,0x75763b34,0x31753b33,0x3b31753b,
+0x00000000,0x00050005,0x00000033,0x67696577,
+0x61447468,0x00006174,0x00050005,0x00000034,
+0x6f636e65,0x676e6964,0x00000000,0x00050005,
+0x00000035,0x576d756e,0x68676965,0x00007374,
+0x00040005,0x00000036,0x65646e69,0x00000078,
+0x000e0005,0x00000042,0x65746e69,0x6c6f7072,
+0x57657461,0x68676965,0x76287374,0x763b3475,
+0x753b3375,0x31753b31,0x3b31753b,0x753b3175,
+0x75763b31,0x00003b32,0x00050005,0x0000003a,
+0x67696577,0x61447468,0x00006174,0x00050005,
+0x0000003b,0x6f636e65,0x676e6964,0x00000000,
+0x00050005,0x0000003c,0x576d756e,0x68676965,
+0x00007374,0x00040005,0x0000003d,0x65646e69,
+0x00000078,0x00050005,0x0000003e,0x64697267,
+0x74646957,0x00000068,0x00040005,0x0000003f,
+0x69727473,0x00006564,0x00040005,0x00000040,
+0x7366666f,0x00007465,0x00060005,0x00000041,
+0x63617266,0x6e6f6974,0x61506c61,0x00007472,
+0x00080005,0x00000047,0x6f636564,0x65576564,
+0x74686769,0x75762873,0x75763b34,0x00003b32,
+0x00050005,0x00000045,0x67696577,0x61447468,
+0x00006174,0x00050005,0x00000046,0x49736f70,
+0x6f6c426e,0x00006b63,0x00050005,0x0000004b,
+0x68736168,0x75283235,0x00003b31,0x00030005,
+0x0000004a,0x00000070,0x00090005,0x00000051,
+0x656c6573,0x61507463,0x74697472,0x286e6f69,
+0x763b3175,0x753b3275,0x00003b31,0x00040005,
+0x0000004e,0x64656573,0x00000000,0x00030005,
+0x0000004f,0x00736f70,0x00060005,0x00000050,
+0x506d756e,0x69747261,0x6e6f6974,0x00000073,
+0x000a0005,0x00000057,0x45746567,0x6f70646e,
+0x45746e69,0x646f636e,0x28676e69,0x753b3175,
+0x31753b31,0x0000003b,0x00080005,0x00000054,
+0x69617661,0x6c62616c,0x646e4565,0x6e696f70,
+0x74694274,0x00000073,0x00060005,0x00000055,
+0x456d756e,0x6f70646e,0x73746e69,0x00000000,
+0x00050005,0x00000056,0x75746361,0x69536c61,
+0x0000657a,0x00070005,0x0000005e,0x65756c62,
+0x746e6f43,0x74636172,0x34697628,0x0000003b,
+0x00030005,0x0000005d,0x00000076,0x00050005,
+0x00000064,0x286d7573,0x3b336976,0x00000000,
+0x00030005,0x00000063,0x00000076,0x00090005,
+0x00000069,0x54746962,0x736e6172,0x53726566,
+0x656e6769,0x69762864,0x69763b34,0x00003b34,
+0x00030005,0x00000067,0x00000061,0x00030005,
+0x00000068,0x00000062,0x000b0005,0x00000071,
+0x6f636564,0x6e456564,0x696f7064,0x2873746e,
+0x3b346976,0x3b346976,0x763b3175,0x763b3475,
+0x003b3475,0x00030005,0x0000006c,0x00004176,
+0x00030005,0x0000006d,0x00004276,0x00040005,
+0x0000006e,0x65646f6d,0x00000000,0x00030005,
+0x0000006f,0x00307065,0x00030005,0x00000070,
+0x00317065,0x000a0005,0x00000078,0x6f636564,
+0x45316564,0x6f70646e,0x28746e69,0x3b347576,
+0x753b3175,0x75763b31,0x00003b33,0x00040005,
+0x00000074,0x61746164,0x00000000,0x00050005,
+0x00000075,0x72617473,0x66664f74,0x00746573,
+0x00040005,0x00000076,0x65646e69,0x00000078,
+0x00050005,0x00000077,0x6f636e65,0x676e6964,
+0x00000000,0x00070005,0x0000007c,0x6c697562,
+0x74694264,0x6b73616d,0x3b317528,0x00000000,
+0x00040005,0x0000007b,0x73746962,0x00000000,
+0x00080005,0x00000080,0x63747361,0x6f636544,
+0x65546564,0x286c6578,0x3b327576,0x00000000,
+0x00050005,0x0000007f,0x49736f70,0x6f6c426e,
+0x00006b63,0x00070005,0x00000084,0x50746567,
+0x4432736f,0x61727241,0x69762879,0x00003b33,
+0x00030005,0x00000083,0x00736f70,0x00040005,
+0x00000086,0x69427174,0x00007374,0x00050005,
+0x000000a7,0x63747361,0x636f6c42,0x0000006b,
+0x00050005,0x000000aa,0x636f6c62,0x7a69536b,
+0x00000065,0x00050005,0x000000ae,0x6f636564,
+0x72456564,0x00726f72,0x00050005,0x000000b0,
+0x64696f76,0x65747845,0x0000746e,0x00040005,
+0x000000bc,0x73746962,0x00003130,0x00040005,
+0x000000c2,0x73746962,0x00003332,0x00040005,
+0x000000c6,0x34746962,0x00000000,0x00040005,
+0x000000cc,0x73746962,0x00003635,0x00040005,
+0x000000d1,0x73746962,0x00003837,0x00030005,
+0x000000d6,0x00000068,0x00050005,0x000000db,
+0x6c617564,0x6e616c50,0x00000065,0x00030005,
+0x000000e5,0x00000072,0x00060005,0x000000f0,
+0x67696577,0x72477468,0x69536469,0x0000657a,
+0x00060005,0x0000014c,0x67696577,0x6e457468,
+0x69646f63,0x0000676e,0x00050005,0x00000163,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000166,0x576d756e,0x68676965,0x00007374,
+0x00060005,0x0000016f,0x67696577,0x61447468,
+0x69536174,0x0000657a,0x00040005,0x00000170,
+0x61726170,0x0000006d,0x00040005,0x00000172,
+0x61726170,0x0000006d,0x00060005,0x00000183,
+0x506d756e,0x69747261,0x6e6f6974,0x00000073,
+0x00060005,0x0000018d,0x74726170,0x6f697469,
+0x6565536e,0x00000064,0x00030005,0x0000019e,
+0x00000069,0x00030005,0x000001a3,0x0000006a,
+0x00040005,0x000001aa,0x72617473,0x00000074,
+0x00050005,0x000001bd,0x4c6d756e,0x6942776f,
+0x00007374,0x00040005,0x000001c0,0x42776f6c,
+0x00737469,0x00050005,0x000001c9,0x68676968,
+0x73746942,0x00000000,0x00030005,0x000001e0,
+0x006d6563,0x00050005,0x000001eb,0x536d6563,
+0x63656c65,0x00726f74,0x00040005,0x000001f0,
+0x65736162,0x006d6543,0x00080005,0x000001fb,
+0x70646e65,0x746e696f,0x72655073,0x74726150,
+0x6f697469,0x0000006e,0x00060005,0x00000209,
+0x657a6973,0x7845664f,0x43617274,0x00006d65,
+0x00050005,0x00000211,0x72747865,0x6d654361,
+0x00000000,0x00040005,0x00000212,0x61726170,
+0x0000006d,0x00040005,0x00000214,0x61726170,
+0x0000006d,0x00040005,0x00000216,0x61726170,
+0x0000006d,0x00040005,0x00000219,0x6c6c7566,
+0x006d6543,0x00040005,0x0000021e,0x6c61566d,
+0x00006575,0x00040005,0x00000226,0x6c615663,
+0x00736575,0x00050005,0x0000023e,0x65736162,
+0x73616c43,0x00000073,0x00050005,0x0000024d,
+0x6d756e69,0x73746942,0x00000000,0x00040005,
+0x00000250,0x636f6c62,0x0000006b,0x00040005,
+0x00000257,0x61726170,0x0000006d,0x00040005,
+0x00000259,0x61726170,0x0000006d,0x00040005,
+0x0000025a,0x61726170,0x0000006d,0x00050005,
+0x0000025c,0x6b636170,0x72546465,0x00737469,
+0x00040005,0x0000027f,0x42776f6c,0x00737469,
+0x00040005,0x00000280,0x61726170,0x0000006d,
+0x00040005,0x00000282,0x61726170,0x0000006d,
+0x00040005,0x00000284,0x61726170,0x0000006d,
+0x00030005,0x00000288,0x0000006a,0x00040005,
+0x00000296,0x6f636564,0x00646564,0x00050005,
+0x00000380,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x0000038e,0x6d756e69,0x73746942,
+0x00000000,0x00040005,0x00000391,0x636f6c62,
+0x0000006b,0x00040005,0x00000395,0x61726170,
+0x0000006d,0x00040005,0x00000397,0x61726170,
+0x0000006d,0x00040005,0x00000399,0x61726170,
+0x0000006d,0x00060005,0x0000039b,0x6b636170,
+0x75516465,0x73746e69,0x00000000,0x00040005,
+0x000003ad,0x42776f6c,0x00737469,0x00040005,
+0x000003b9,0x6f636564,0x00646564,0x00050005,
+0x000003f1,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000405,0x426d756e,0x00737469,
+0x00040005,0x0000040d,0x7366666f,0x00007465,
+0x00030005,0x00000414,0x00000077,0x00040005,
+0x00000417,0x61726170,0x0000006d,0x00040005,
+0x00000419,0x61726170,0x0000006d,0x00040005,
+0x0000041b,0x61726170,0x0000006d,0x00040005,
+0x0000041d,0x61726170,0x0000006d,0x00050005,
+0x00000436,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000440,0x7366666f,0x00007465,
+0x00030005,0x00000447,0x00000077,0x00040005,
+0x0000044a,0x61726170,0x0000006d,0x00040005,
+0x0000044c,0x61726170,0x0000006d,0x00040005,
+0x0000044e,0x61726170,0x0000006d,0x00040005,
+0x00000450,0x61726170,0x0000006d,0x00050005,
+0x00000464,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000469,0x7366666f,0x00007465,
+0x00030005,0x0000046d,0x00000077,0x00040005,
+0x0000046e,0x61726170,0x0000006d,0x00040005,
+0x00000470,0x61726170,0x0000006d,0x00040005,
+0x00000472,0x61726170,0x0000006d,0x00040005,
+0x00000475,0x75716e75,0x00746e61,0x00050005,
+0x00000481,0x65646e69,0x6c626178,0x00000065,
+0x00060005,0x00000496,0x67696577,0x6e497468,
+0x65636964,0x00000073,0x00040005,0x000004a4,
+0x67696577,0x00737468,0x00040005,0x000004a5,
+0x61726170,0x0000006d,0x00040005,0x000004a7,
+0x61726170,0x0000006d,0x00040005,0x000004a9,
+0x61726170,0x0000006d,0x00040005,0x000004ab,
+0x61726170,0x0000006d,0x00040005,0x000004af,
+0x61726170,0x0000006d,0x00040005,0x000004b1,
+0x61726170,0x0000006d,0x00040005,0x000004b3,
+0x61726170,0x0000006d,0x00040005,0x000004b5,
+0x61726170,0x0000006d,0x00040005,0x000004b9,
+0x61726170,0x0000006d,0x00040005,0x000004bb,
+0x61726170,0x0000006d,0x00040005,0x000004bd,
+0x61726170,0x0000006d,0x00040005,0x000004bf,
+0x61726170,0x0000006d,0x00040005,0x000004c3,
+0x61726170,0x0000006d,0x00040005,0x000004c5,
+0x61726170,0x0000006d,0x00040005,0x000004c7,
+0x61726170,0x0000006d,0x00040005,0x000004c9,
+0x61726170,0x0000006d,0x00030005,0x000004ce,
+0x00313177,0x00040005,0x000004d6,0x74636166,
+0x0073726f,0x00050005,0x000004f6,0x6c616373,
+0x63614665,0x00726f74,0x00070005,0x00000501,
+0x6f6d6f68,0x656e6567,0x4373756f,0x64726f6f,
+0x00000073,0x00050005,0x00000504,0x64697267,
+0x726f6f43,0x00007364,0x00060005,0x00000510,
+0x65746e69,0x6c617267,0x74726150,0x00000000,
+0x00060005,0x00000514,0x63617266,0x6e6f6974,
+0x61506c61,0x00007472,0x00050005,0x00000519,
+0x64697267,0x74646957,0x00000068,0x00030005,
+0x0000051c,0x00003076,0x00040005,0x00000524,
+0x67696577,0x00737468,0x00040005,0x0000052a,
+0x61726170,0x0000006d,0x00040005,0x0000052c,
+0x61726170,0x0000006d,0x00040005,0x0000052e,
+0x61726170,0x0000006d,0x00040005,0x00000530,
+0x61726170,0x0000006d,0x00040005,0x00000532,
+0x61726170,0x0000006d,0x00040005,0x00000534,
+0x61726170,0x0000006d,0x00040005,0x00000535,
+0x61726170,0x0000006d,0x00040005,0x00000536,
+0x61726170,0x0000006d,0x00040005,0x0000053d,
+0x61726170,0x0000006d,0x00040005,0x0000053f,
+0x61726170,0x0000006d,0x00040005,0x00000541,
+0x61726170,0x0000006d,0x00040005,0x00000543,
+0x61726170,0x0000006d,0x00040005,0x00000545,
+0x61726170,0x0000006d,0x00040005,0x00000547,
+0x61726170,0x0000006d,0x00040005,0x00000548,
+0x61726170,0x0000006d,0x00040005,0x00000549,
+0x61726170,0x0000006d,0x00040005,0x00000593,
+0x6d756e72,0x00000000,0x00040005,0x00000594,
+0x61726170,0x0000006d,0x00040005,0x00000597,
+0x64656573,0x00000041,0x00040005,0x000005a3,
+0x64656573,0x00000042,0x00040005,0x000005b6,
+0x66696873,0x00317374,0x00040005,0x000005c1,
+0x66696873,0x00327374,0x00040005,0x000005d4,
+0x75736572,0x0000746c,0x00030005,0x0000062b,
+0x00000069,0x00050005,0x00000633,0x6f636e65,
+0x676e6964,0x00000000,0x00050005,0x00000641,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000644,0x61726170,0x0000006d,0x00040005,
+0x00000646,0x61726170,0x0000006d,0x00030005,
+0x000006a0,0x0000306c,0x00030005,0x000006a9,
+0x0000316c,0x00040005,0x000006c7,0x61726170,
+0x0000006d,0x00040005,0x000006c9,0x61726170,
+0x0000006d,0x00040005,0x00000716,0x61726170,
+0x0000006d,0x00040005,0x0000071a,0x61726170,
+0x0000006d,0x00040005,0x00000726,0x61726170,
+0x0000006d,0x00040005,0x0000072a,0x61726170,
+0x0000006d,0x00040005,0x00000732,0x61726170,
+0x0000006d,0x00040005,0x00000734,0x61726170,
+0x0000006d,0x00040005,0x00000739,0x61726170,
+0x0000006d,0x00040005,0x00000750,0x61726170,
+0x0000006d,0x00040005,0x00000756,0x61726170,
+0x0000006d,0x00040005,0x00000760,0x426d756e,
+0x00737469,0x00040005,0x00000768,0x7366666f,
+0x00007465,0x00030005,0x00000771,0x00007065,
+0x00040005,0x00000774,0x61726170,0x0000006d,
+0x00040005,0x00000776,0x61726170,0x0000006d,
+0x00040005,0x00000778,0x61726170,0x0000006d,
+0x00040005,0x0000077a,0x61726170,0x0000006d,
+0x00050005,0x000007e2,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x000007ec,0x7366666f,
+0x00007465,0x00030005,0x000007f5,0x00007065,
+0x00040005,0x000007f8,0x61726170,0x0000006d,
+0x00040005,0x000007fa,0x61726170,0x0000006d,
+0x00040005,0x000007fc,0x61726170,0x0000006d,
+0x00040005,0x000007fe,0x61726170,0x0000006d,
+0x00050005,0x00000810,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000815,0x7366666f,
+0x00007465,0x00030005,0x0000081b,0x00000077,
+0x00040005,0x0000081c,0x61726170,0x0000006d,
+0x00040005,0x0000081e,0x61726170,0x0000006d,
+0x00040005,0x00000820,0x61726170,0x0000006d,
+0x00040005,0x00000823,0x75716e75,0x00746e61,
+0x00050005,0x00000830,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x0000083e,0x426d756e,
+0x00737469,0x00040005,0x00000847,0x6b73616d,
+0x00000000,0x00050005,0x00000872,0x67696577,
+0x61447468,0x00006174,0x00040005,0x00000876,
+0x61726170,0x0000006d,0x00040005,0x0000087a,
+0x67696577,0x00737468,0x00040005,0x0000087b,
+0x61726170,0x0000006d,0x00060005,0x0000087e,
+0x74726170,0x6f697469,0x646e496e,0x00007865,
+0x00040005,0x0000087f,0x61726170,0x0000006d,
+0x00040005,0x00000881,0x61726170,0x0000006d,
+0x00040005,0x00000882,0x61726170,0x0000006d,
+0x00060005,0x00000885,0x72617473,0x45664f74,
+0x61727478,0x006d6543,0x00060005,0x00000886,
+0x61746f74,0x646e456c,0x6e696f70,0x00007374,
+0x00070005,0x00000887,0x65736162,0x70646e45,
+0x746e696f,0x65646e49,0x00000078,0x00030005,
+0x00000888,0x006d6563,0x00040005,0x00000889,
+0x61726170,0x0000006d,0x00040005,0x0000088b,
+0x61726170,0x0000006d,0x00040005,0x0000088c,
+0x61726170,0x0000006d,0x00040005,0x0000088d,
+0x61726170,0x0000006d,0x00060005,0x00000897,
+0x70646e65,0x746e696f,0x61745373,0x00007472,
+0x00060005,0x0000089d,0x70646e65,0x746e696f,
+0x646e4573,0x00000000,0x00080005,0x000008a5,
+0x69617661,0x6c62616c,0x646e4565,0x6e696f70,
+0x74694274,0x00000073,0x00070005,0x000008a9,
+0x70646e65,0x746e696f,0x6f636e45,0x676e6964,
+0x00000000,0x00070005,0x000008aa,0x75746361,
+0x6e456c61,0x696f7064,0x6942746e,0x00007374,
+0x00040005,0x000008ab,0x61726170,0x0000006d,
+0x00040005,0x000008ad,0x61726170,0x0000006d,
+0x00040005,0x000008af,0x61726170,0x0000006d,
+0x00070005,0x000008b2,0x456d756e,0x6f70646e,
+0x50746e69,0x73726961,0x00000000,0x00030005,
+0x000008b6,0x00004176,0x00030005,0x000008b7,
+0x00004276,0x00040005,0x000008b8,0x61447065,
+0x00006174,0x00040005,0x000008bd,0x61726170,
+0x0000006d,0x00030005,0x000008c0,0x00000069,
+0x00040005,0x000008c9,0x64497065,0x00000078,
+0x00040005,0x000008cf,0x61726170,0x0000006d,
+0x00040005,0x000008d1,0x61726170,0x0000006d,
+0x00040005,0x000008d3,0x61726170,0x0000006d,
+0x00040005,0x000008d5,0x61726170,0x0000006d,
+0x00040005,0x000008dd,0x61726170,0x0000006d,
+0x00040005,0x000008df,0x61726170,0x0000006d,
+0x00040005,0x000008e1,0x61726170,0x0000006d,
+0x00040005,0x000008e2,0x61726170,0x0000006d,
+0x00030005,0x000008e9,0x00307065,0x00030005,
+0x000008ea,0x00317065,0x00040005,0x000008eb,
+0x61726170,0x0000006d,0x00040005,0x000008ed,
+0x61726170,0x0000006d,0x00040005,0x000008ef,
+0x61726170,0x0000006d,0x00040005,0x000008f1,
+0x61726170,0x0000006d,0x00040005,0x000008f2,
+0x61726170,0x0000006d,0x00070005,0x000008f6,
+0x67696577,0x50737468,0x68437265,0x656e6e61,
+0x0000006c,0x00030005,0x000008fd,0x00736363,
+0x00040005,0x000008fe,0x61726170,0x0000006d,
+0x00040005,0x00000900,0x61726170,0x0000006d,
+0x00040005,0x00000902,0x61726170,0x0000006d,
+0x00050005,0x0000091a,0x65786574,0x736f506c,
+0x00000000,0x00080005,0x0000091c,0x475f6c67,
+0x61626f6c,0x766e496c,0x7461636f,0x496e6f69,
+0x00000044,0x00040005,0x0000091f,0x6579616c,
+0x00000072,0x00070005,0x00000920,0x67616d49,
+0x726f4665,0x4274616d,0x6b636f6c,0x00000000,
+0x00060006,0x00000920,0x00000000,0x636f6c62,
+0x7a69536b,0x00000065,0x00060006,0x00000920,
+0x00000001,0x65736162,0x6579614c,0x00000072,
+0x00060006,0x00000920,0x00000002,0x6c616d73,
+0x6f6c426c,0x00006b63,0x00060005,0x00000922,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00050005,0x0000092a,0x636f6c62,0x736f506b,
+0x00000000,0x00050005,0x00000930,0x49736f70,
+0x6f6c426e,0x00006b63,0x00050005,0x00000935,
+0x63747361,0x636f6c42,0x0000006b,0x00050005,
+0x00000938,0x49637273,0x6567616d,0x00000000,
+0x00040005,0x00000941,0x61726170,0x0000006d,
+0x00040005,0x00000945,0x61726170,0x0000006d,
+0x00040005,0x00000947,0x61726170,0x0000006d,
+0x00040005,0x0000094b,0x65786574,0x0000006c,
+0x00050005,0x00000950,0x49747364,0x6567616d,
+0x00000000,0x00040005,0x00000959,0x61726170,
+0x0000006d,0x00040047,0x0000091c,0x0000000b,
+0x0000001c,0x00050048,0x00000920,0x00000000,
+0x00000023,0x00000000,0x00050048,0x00000920,
+0x00000001,0x00000023,0x00000008,0x00050048,
+0x00000920,0x00000002,0x00000023,0x0000000c,
+0x00030047,0x00000920,0x00000002,0x00040047,
+0x00000938,0x00000022,0x00000000,0x00040047,
+0x00000938,0x00000021,0x00000000,0x00030047,
+0x00000938,0x00000018,0x00040047,0x00000950,
+0x00000022,0x00000000,0x00040047,0x00000950,
+0x00000021,0x00000001,0x00030047,0x00000950,
+0x00000019,0x00040047,0x0000095c,0x0000000b,
+0x00000019,0x00020013,0x00000002,0x00030021,
+0x00000003,0x00000002,0x00040015,0x00000006,
+0x00000020,0x00000000,0x00040020,0x00000007,
+0x00000007,0x00000006,0x00040017,0x00000008,
+0x00000006,0x00000003,0x00040020,0x00000009,
+0x00000007,0x00000008,0x00050021,0x0000000a,
+0x00000006,0x00000007,0x00000009,0x00040017,
+0x0000000f,0x00000006,0x00000004,0x00040020,
+0x00000010,0x00000007,0x0000000f,0x00040017,
+0x00000011,0x00000006,0x00000002,0x00040020,
+0x00000012,0x00000007,0x00000011,0x00050021,
+0x00000013,0x00000002,0x00000010,0x00000012,
+0x00060021,0x00000018,0x00000006,0x00000010,
+0x00000007,0x00000007,0x00070021,0x0000001e,
+0x00000006,0x00000007,0x00000007,0x00000007,
+0x00000007,0x00070021,0x00000025,0x00000006,
+0x00000010,0x00000007,0x00000007,0x00000007,
+0x00070021,0x00000032,0x00000006,0x00000010,
+0x00000009,0x00000007,0x00000007,0x000b0021,
+0x00000039,0x00000006,0x00000010,0x00000009,
+0x00000007,0x00000007,0x00000007,0x00000007,
+0x00000007,0x00000012,0x00050021,0x00000044,
+0x00000011,0x00000010,0x00000011,0x00040021,
+0x00000049,0x00000006,0x00000007,0x00060021,
+0x0000004d,0x00000006,0x00000007,0x00000012,
+0x00000007,0x00060021,0x00000053,0x00000008,
+0x00000007,0x00000007,0x00000007,0x00040015,
+0x00000059,0x00000020,0x00000001,0x00040017,
+0x0000005a,0x00000059,0x00000004,0x00040020,
+0x0000005b,0x00000007,0x0000005a,0x00040021,
+0x0000005c,0x0000005a,0x0000005b,0x00040017,
+0x00000060,0x00000059,0x00000003,0x00040020,
+0x00000061,0x00000007,0x00000060,0x00040021,
+0x00000062,0x00000059,0x00000061,0x00050021,
+0x00000066,0x00000002,0x0000005b,0x0000005b,
+0x00080021,0x0000006b,0x00000002,0x0000005b,
+0x0000005b,0x00000007,0x00000010,0x00000010,
+0x00070021,0x00000073,0x00000006,0x00000010,
+0x00000007,0x00000007,0x00000009,0x00040021,
+0x0000007a,0x0000000f,0x00000007,0x00040021,
+0x0000007e,0x0000000f,0x00000011,0x00040021,
+0x00000082,0x00000060,0x00000061,0x0004002b,
+0x00000006,0x0000008c,0x00000008,0x0004002b,
+0x00000006,0x0000008d,0x00000007,0x0005002c,
+0x00000011,0x0000008e,0x0000008c,0x0000008d,
+0x0004002b,0x00000006,0x00000090,0x00000004,
+0x0004002b,0x00000006,0x00000091,0x00000002,
+0x0005002c,0x00000011,0x00000092,0x00000090,
+0x00000091,0x0004002b,0x00000006,0x00000094,
+0x00000005,0x0004002b,0x00000006,0x00000095,
+0x00000003,0x0005002c,0x00000011,0x00000096,
+0x00000094,0x00000095,0x0004002b,0x00000006,
+0x0000009c,0x00000000,0x0004002b,0x00000006,
+0x0000009f,0x00000001,0x00040020,0x000000a6,
+0x00000006,0x0000000f,0x0004003b,0x000000a6,
+0x000000a7,0x00000006,0x00040020,0x000000a9,
+0x00000006,0x00000011,0x0004003b,0x000000a9,
+0x000000aa,0x00000006,0x00020014,0x000000ac,
+0x00040020,0x000000ad,0x00000006,0x000000ac,
+0x0004003b,0x000000ad,0x000000ae,0x00000006,
+0x0003002a,0x000000ac,0x000000af,0x0004003b,
+0x000000ad,0x000000b0,0x00000006,0x00040020,
+0x000000b1,0x00000006,0x00000006,0x0004002b,
+0x00000006,0x000000b4,0x000001ff,0x0004002b,
+0x00000006,0x000000b6,0x000001fc,0x0004002b,
+0x00000059,0x000000bf,0x00000000,0x0004002b,
+0x00000059,0x000000c0,0x00000002,0x0004002b,
+0x00000059,0x000000c9,0x00000004,0x0004002b,
+0x00000059,0x000000ca,0x00000001,0x0004002b,
+0x00000059,0x000000cf,0x00000005,0x0004002b,
+0x00000059,0x000000d4,0x00000007,0x0004002b,
+0x00000059,0x000000d9,0x00000009,0x0004003b,
+0x000000ad,0x000000db,0x00000006,0x0004002b,
+0x00000059,0x000000de,0x0000000a,0x0004003b,
+0x000000a9,0x000000f0,0x00000006,0x0004002b,
+0x00000006,0x000000f1,0x0000000c,0x0004002b,
+0x00000006,0x000000fb,0x00000006,0x0004002b,
+0x00000006,0x00000107,0x0000000a,0x0005002c,
+0x00000011,0x00000108,0x000000fb,0x00000107,
+0x0005002c,0x00000011,0x0000010e,0x00000107,
+0x000000fb,0x00030029,0x000000ac,0x00000110,
+0x00040017,0x00000145,0x000000ac,0x00000002,
+0x00040020,0x0000014b,0x00000006,0x00000008,
+0x0004003b,0x0000014b,0x0000014c,0x00000006,
+0x0004002b,0x00000006,0x0000014d,0x00000010,
+0x0004001c,0x0000014e,0x00000008,0x0000014d,
+0x0006002c,0x00000008,0x0000014f,0x0000009c,
+0x0000009c,0x0000009c,0x0006002c,0x00000008,
+0x00000150,0x0000009c,0x0000009c,0x0000009f,
+0x0006002c,0x00000008,0x00000151,0x0000009f,
+0x0000009c,0x0000009c,0x0006002c,0x00000008,
+0x00000152,0x0000009c,0x0000009c,0x00000091,
+0x0006002c,0x00000008,0x00000153,0x0000009c,
+0x0000009f,0x0000009c,0x0006002c,0x00000008,
+0x00000154,0x0000009f,0x0000009c,0x0000009f,
+0x0006002c,0x00000008,0x00000155,0x0000009c,
+0x0000009c,0x00000095,0x0006002c,0x00000008,
+0x00000156,0x0000009c,0x0000009f,0x0000009f,
+0x0006002c,0x00000008,0x00000157,0x0000009f,
+0x0000009c,0x00000091,0x0006002c,0x00000008,
+0x00000158,0x0000009c,0x0000009c,0x00000090,
+0x0006002c,0x00000008,0x00000159,0x0000009c,
+0x0000009f,0x00000091,0x0006002c,0x00000008,
+0x0000015a,0x0000009f,0x0000009c,0x00000095,
+0x0006002c,0x00000008,0x0000015b,0x0000009c,
+0x0000009c,0x00000094,0x0013002c,0x0000014e,
+0x0000015c,0x0000014f,0x0000014f,0x00000150,
+0x00000151,0x00000152,0x00000153,0x00000154,
+0x00000155,0x0000014f,0x0000014f,0x00000156,
+0x00000157,0x00000158,0x00000159,0x0000015a,
+0x0000015b,0x0004002b,0x00000059,0x0000015e,
+0x00000003,0x00040020,0x00000162,0x00000007,
+0x0000014e,0x0004003b,0x000000b1,0x00000166,
+0x00000006,0x0004003b,0x000000b1,0x0000016f,
+0x00000006,0x0004002b,0x00000006,0x00000176,
+0x00000018,0x0004002b,0x00000006,0x00000179,
+0x00000060,0x0004002b,0x00000006,0x0000017d,
+0x00000040,0x0004003b,0x000000b1,0x00000183,
+0x00000006,0x0004002b,0x00000059,0x00000186,
+0x0000000b,0x0004003b,0x000000b1,0x0000018d,
+0x00000006,0x0004002b,0x00000059,0x00000190,
+0x0000000d,0x0004002b,0x00000006,0x000001a0,
+0x00000020,0x0004002b,0x00000006,0x000001ac,
+0x0000001f,0x0004002b,0x00000006,0x000001dd,
+0x00000080,0x0004002b,0x00000059,0x000001ee,
+0x00000017,0x0004002b,0x00000059,0x000001f3,
+0x00000019,0x00040020,0x0000024c,0x00000007,
+0x00000059,0x0007002c,0x0000005a,0x00000290,
+0x000000c0,0x000000c9,0x000000cf,0x000000d4,
+0x0004002b,0x00000006,0x00000297,0x00000100,
+0x0004001c,0x00000298,0x00000006,0x00000297,
+0x0004002b,0x00000006,0x00000299,0x00000021,
+0x0004002b,0x00000006,0x0000029a,0x00000009,
+0x0004002b,0x00000006,0x0000029b,0x00000022,
+0x0004002b,0x00000006,0x0000029c,0x00000028,
+0x0004002b,0x00000006,0x0000029d,0x00000029,
+0x0004002b,0x00000006,0x0000029e,0x0000002a,
+0x0004002b,0x00000006,0x0000029f,0x00000011,
+0x0004002b,0x00000006,0x000002a0,0x00000012,
+0x0004002b,0x00000006,0x000002a1,0x00000024,
+0x0004002b,0x00000006,0x000002a2,0x00000014,
+0x0004002b,0x00000006,0x000002a3,0x00000015,
+0x0004002b,0x00000006,0x000002a4,0x00000016,
+0x0004002b,0x00000006,0x000002a5,0x00000025,
+0x0004002b,0x00000006,0x000002a6,0x00000019,
+0x0004002b,0x00000006,0x000002a7,0x0000001a,
+0x0004002b,0x00000006,0x000002a8,0x00000026,
+0x0004002b,0x00000006,0x000002a9,0x00000280,
+0x0004002b,0x00000006,0x000002aa,0x00000281,
+0x0004002b,0x00000006,0x000002ab,0x00000282,
+0x0004002b,0x00000006,0x000002ac,0x000002a0,
+0x0004002b,0x00000006,0x000002ad,0x00000041,
+0x0004002b,0x00000006,0x000002ae,0x00000042,
+0x0004002b,0x00000006,0x000002af,0x00000044,
+0x0004002b,0x00000006,0x000002b0,0x00000045,
+0x0004002b,0x00000006,0x000002b1,0x00000046,
+0x0004002b,0x00000006,0x000002b2,0x00000061,
+0x0004002b,0x00000006,0x000002b3,0x00000048,
+0x0004002b,0x00000006,0x000002b4,0x00000049,
+0x0004002b,0x00000006,0x000002b5,0x0000004a,
+0x0004002b,0x00000006,0x000002b6,0x00000062,
+0x0004002b,0x00000006,0x000002b7,0x00000068,
+0x0004002b,0x00000006,0x000002b8,0x00000069,
+0x0004002b,0x00000006,0x000002b9,0x0000006a,
+0x0004002b,0x00000006,0x000002ba,0x00000050,
+0x0004002b,0x00000006,0x000002bb,0x00000051,
+0x0004002b,0x00000006,0x000002bc,0x00000052,
+0x0004002b,0x00000006,0x000002bd,0x00000064,
+0x0004002b,0x00000006,0x000002be,0x00000054,
+0x0004002b,0x00000006,0x000002bf,0x00000055,
+0x0004002b,0x00000006,0x000002c0,0x00000056,
+0x0004002b,0x00000006,0x000002c1,0x00000065,
+0x0004002b,0x00000006,0x000002c2,0x00000058,
+0x0004002b,0x00000006,0x000002c3,0x00000059,
+0x0004002b,0x00000006,0x000002c4,0x0000005a,
+0x0004002b,0x00000006,0x000002c5,0x00000066,
+0x0004002b,0x00000006,0x000002c6,0x00000284,
+0x0004002b,0x00000006,0x000002c7,0x00000285,
+0x0004002b,0x00000006,0x000002c8,0x00000286,
+0x0004002b,0x00000006,0x000002c9,0x000002a1,
+0x0004002b,0x00000006,0x000002ca,0x00000081,
+0x0004002b,0x00000006,0x000002cb,0x00000082,
+0x0004002b,0x00000006,0x000002cc,0x000000a0,
+0x0004002b,0x00000006,0x000002cd,0x00000084,
+0x0004002b,0x00000006,0x000002ce,0x00000085,
+0x0004002b,0x00000006,0x000002cf,0x00000086,
+0x0004002b,0x00000006,0x000002d0,0x000000a1,
+0x0004002b,0x00000006,0x000002d1,0x00000088,
+0x0004002b,0x00000006,0x000002d2,0x00000089,
+0x0004002b,0x00000006,0x000002d3,0x0000008a,
+0x0004002b,0x00000006,0x000002d4,0x000000a2,
+0x0004002b,0x00000006,0x000002d5,0x000000a8,
+0x0004002b,0x00000006,0x000002d6,0x000000a9,
+0x0004002b,0x00000006,0x000002d7,0x000000aa,
+0x0004002b,0x00000006,0x000002d8,0x00000090,
+0x0004002b,0x00000006,0x000002d9,0x00000091,
+0x0004002b,0x00000006,0x000002da,0x00000092,
+0x0004002b,0x00000006,0x000002db,0x000000a4,
+0x0004002b,0x00000006,0x000002dc,0x00000094,
+0x0004002b,0x00000006,0x000002dd,0x00000095,
+0x0004002b,0x00000006,0x000002de,0x00000096,
+0x0004002b,0x00000006,0x000002df,0x000000a5,
+0x0004002b,0x00000006,0x000002e0,0x00000098,
+0x0004002b,0x00000006,0x000002e1,0x00000099,
+0x0004002b,0x00000006,0x000002e2,0x0000009a,
+0x0004002b,0x00000006,0x000002e3,0x000000a6,
+0x0004002b,0x00000006,0x000002e4,0x00000288,
+0x0004002b,0x00000006,0x000002e5,0x00000289,
+0x0004002b,0x00000006,0x000002e6,0x0000028a,
+0x0004002b,0x00000006,0x000002e7,0x000002a2,
+0x0004002b,0x00000006,0x000002e8,0x00000200,
+0x0004002b,0x00000006,0x000002e9,0x00000201,
+0x0004002b,0x00000006,0x000002ea,0x00000202,
+0x0004002b,0x00000006,0x000002eb,0x00000220,
+0x0004002b,0x00000006,0x000002ec,0x00000204,
+0x0004002b,0x00000006,0x000002ed,0x00000205,
+0x0004002b,0x00000006,0x000002ee,0x00000206,
+0x0004002b,0x00000006,0x000002ef,0x00000221,
+0x0004002b,0x00000006,0x000002f0,0x00000208,
+0x0004002b,0x00000006,0x000002f1,0x00000209,
+0x0004002b,0x00000006,0x000002f2,0x0000020a,
+0x0004002b,0x00000006,0x000002f3,0x00000222,
+0x0004002b,0x00000006,0x000002f4,0x00000228,
+0x0004002b,0x00000006,0x000002f5,0x00000229,
+0x0004002b,0x00000006,0x000002f6,0x0000022a,
+0x0004002b,0x00000006,0x000002f7,0x00000210,
+0x0004002b,0x00000006,0x000002f8,0x00000211,
+0x0004002b,0x00000006,0x000002f9,0x00000212,
+0x0004002b,0x00000006,0x000002fa,0x00000224,
+0x0004002b,0x00000006,0x000002fb,0x00000214,
+0x0004002b,0x00000006,0x000002fc,0x00000215,
+0x0004002b,0x00000006,0x000002fd,0x00000216,
+0x0004002b,0x00000006,0x000002fe,0x00000225,
+0x0004002b,0x00000006,0x000002ff,0x00000218,
+0x0004002b,0x00000006,0x00000300,0x00000219,
+0x0004002b,0x00000006,0x00000301,0x0000021a,
+0x0004002b,0x00000006,0x00000302,0x00000226,
+0x0004002b,0x00000006,0x00000303,0x000002a8,
+0x0004002b,0x00000006,0x00000304,0x000002a9,
+0x0004002b,0x00000006,0x00000305,0x000002aa,
+0x0004002b,0x00000006,0x00000306,0x00000101,
+0x0004002b,0x00000006,0x00000307,0x00000102,
+0x0004002b,0x00000006,0x00000308,0x00000120,
+0x0004002b,0x00000006,0x00000309,0x00000104,
+0x0004002b,0x00000006,0x0000030a,0x00000105,
+0x0004002b,0x00000006,0x0000030b,0x00000106,
+0x0004002b,0x00000006,0x0000030c,0x00000121,
+0x0004002b,0x00000006,0x0000030d,0x00000108,
+0x0004002b,0x00000006,0x0000030e,0x00000109,
+0x0004002b,0x00000006,0x0000030f,0x0000010a,
+0x0004002b,0x00000006,0x00000310,0x00000122,
+0x0004002b,0x00000006,0x00000311,0x00000128,
+0x0004002b,0x00000006,0x00000312,0x00000129,
+0x0004002b,0x00000006,0x00000313,0x0000012a,
+0x0004002b,0x00000006,0x00000314,0x00000110,
+0x0004002b,0x00000006,0x00000315,0x00000111,
+0x0004002b,0x00000006,0x00000316,0x00000112,
+0x0004002b,0x00000006,0x00000317,0x00000124,
+0x0004002b,0x00000006,0x00000318,0x00000114,
+0x0004002b,0x00000006,0x00000319,0x00000115,
+0x0004002b,0x00000006,0x0000031a,0x00000116,
+0x0004002b,0x00000006,0x0000031b,0x00000125,
+0x0004002b,0x00000006,0x0000031c,0x00000118,
+0x0004002b,0x00000006,0x0000031d,0x00000119,
+0x0004002b,0x00000006,0x0000031e,0x0000011a,
+0x0004002b,0x00000006,0x0000031f,0x00000126,
+0x0004002b,0x00000006,0x00000320,0x00000290,
+0x0004002b,0x00000006,0x00000321,0x00000291,
+0x0004002b,0x00000006,0x00000322,0x00000292,
+0x0004002b,0x00000006,0x00000323,0x000002a4,
+0x0004002b,0x00000006,0x00000324,0x00000140,
+0x0004002b,0x00000006,0x00000325,0x00000141,
+0x0004002b,0x00000006,0x00000326,0x00000142,
+0x0004002b,0x00000006,0x00000327,0x00000160,
+0x0004002b,0x00000006,0x00000328,0x00000144,
+0x0004002b,0x00000006,0x00000329,0x00000145,
+0x0004002b,0x00000006,0x0000032a,0x00000146,
+0x0004002b,0x00000006,0x0000032b,0x00000161,
+0x0004002b,0x00000006,0x0000032c,0x00000148,
+0x0004002b,0x00000006,0x0000032d,0x00000149,
+0x0004002b,0x00000006,0x0000032e,0x0000014a,
+0x0004002b,0x00000006,0x0000032f,0x00000162,
+0x0004002b,0x00000006,0x00000330,0x00000168,
+0x0004002b,0x00000006,0x00000331,0x00000169,
+0x0004002b,0x00000006,0x00000332,0x0000016a,
+0x0004002b,0x00000006,0x00000333,0x00000150,
+0x0004002b,0x00000006,0x00000334,0x00000151,
+0x0004002b,0x00000006,0x00000335,0x00000152,
+0x0004002b,0x00000006,0x00000336,0x00000164,
+0x0004002b,0x00000006,0x00000337,0x00000154,
+0x0004002b,0x00000006,0x00000338,0x00000155,
+0x0004002b,0x00000006,0x00000339,0x00000156,
+0x0004002b,0x00000006,0x0000033a,0x00000165,
+0x0004002b,0x00000006,0x0000033b,0x00000158,
+0x0004002b,0x00000006,0x0000033c,0x00000159,
+0x0004002b,0x00000006,0x0000033d,0x0000015a,
+0x0004002b,0x00000006,0x0000033e,0x00000166,
+0x0004002b,0x00000006,0x0000033f,0x00000294,
+0x0004002b,0x00000006,0x00000340,0x00000295,
+0x0004002b,0x00000006,0x00000341,0x00000296,
+0x0004002b,0x00000006,0x00000342,0x000002a5,
+0x0004002b,0x00000006,0x00000343,0x00000180,
+0x0004002b,0x00000006,0x00000344,0x00000181,
+0x0004002b,0x00000006,0x00000345,0x00000182,
+0x0004002b,0x00000006,0x00000346,0x000001a0,
+0x0004002b,0x00000006,0x00000347,0x00000184,
+0x0004002b,0x00000006,0x00000348,0x00000185,
+0x0004002b,0x00000006,0x00000349,0x00000186,
+0x0004002b,0x00000006,0x0000034a,0x000001a1,
+0x0004002b,0x00000006,0x0000034b,0x00000188,
+0x0004002b,0x00000006,0x0000034c,0x00000189,
+0x0004002b,0x00000006,0x0000034d,0x0000018a,
+0x0004002b,0x00000006,0x0000034e,0x000001a2,
+0x0004002b,0x00000006,0x0000034f,0x000001a8,
+0x0004002b,0x00000006,0x00000350,0x000001a9,
+0x0004002b,0x00000006,0x00000351,0x000001aa,
+0x0004002b,0x00000006,0x00000352,0x00000190,
+0x0004002b,0x00000006,0x00000353,0x00000191,
+0x0004002b,0x00000006,0x00000354,0x00000192,
+0x0004002b,0x00000006,0x00000355,0x000001a4,
+0x0004002b,0x00000006,0x00000356,0x00000194,
+0x0004002b,0x00000006,0x00000357,0x00000195,
+0x0004002b,0x00000006,0x00000358,0x00000196,
+0x0004002b,0x00000006,0x00000359,0x000001a5,
+0x0004002b,0x00000006,0x0000035a,0x00000198,
+0x0004002b,0x00000006,0x0000035b,0x00000199,
+0x0004002b,0x00000006,0x0000035c,0x0000019a,
+0x0004002b,0x00000006,0x0000035d,0x000001a6,
+0x0004002b,0x00000006,0x0000035e,0x00000298,
+0x0004002b,0x00000006,0x0000035f,0x00000299,
+0x0004002b,0x00000006,0x00000360,0x0000029a,
+0x0004002b,0x00000006,0x00000361,0x000002a6,
+0x0004002b,0x00000006,0x00000362,0x00000240,
+0x0004002b,0x00000006,0x00000363,0x00000241,
+0x0004002b,0x00000006,0x00000364,0x00000242,
+0x0004002b,0x00000006,0x00000365,0x00000260,
+0x0004002b,0x00000006,0x00000366,0x00000244,
+0x0004002b,0x00000006,0x00000367,0x00000245,
+0x0004002b,0x00000006,0x00000368,0x00000246,
+0x0004002b,0x00000006,0x00000369,0x00000261,
+0x0004002b,0x00000006,0x0000036a,0x00000248,
+0x0004002b,0x00000006,0x0000036b,0x00000249,
+0x0004002b,0x00000006,0x0000036c,0x0000024a,
+0x0004002b,0x00000006,0x0000036d,0x00000262,
+0x0004002b,0x00000006,0x0000036e,0x00000268,
+0x0004002b,0x00000006,0x0000036f,0x00000269,
+0x0004002b,0x00000006,0x00000370,0x0000026a,
+0x0004002b,0x00000006,0x00000371,0x00000250,
+0x0004002b,0x00000006,0x00000372,0x00000251,
+0x0004002b,0x00000006,0x00000373,0x00000252,
+0x0004002b,0x00000006,0x00000374,0x00000264,
+0x0004002b,0x00000006,0x00000375,0x00000254,
+0x0004002b,0x00000006,0x00000376,0x00000255,
+0x0004002b,0x00000006,0x00000377,0x00000256,
+0x0004002b,0x00000006,0x00000378,0x00000265,
+0x0004002b,0x00000006,0x00000379,0x00000258,
+0x0004002b,0x00000006,0x0000037a,0x00000259,
+0x0004002b,0x00000006,0x0000037b,0x0000025a,
+0x0004002b,0x00000006,0x0000037c,0x00000266,
+0x0103002c,0x00000298,0x0000037d,0x0000009c,
+0x0000009f,0x00000091,0x000001a0,0x00000090,
+0x00000094,0x000000fb,0x00000299,0x0000008c,
+0x0000029a,0x00000107,0x0000029b,0x0000029c,
+0x0000029d,0x0000029e,0x0000029b,0x0000014d,
+0x0000029f,0x000002a0,0x000002a1,0x000002a2,
+0x000002a3,0x000002a4,0x000002a5,0x00000176,
+0x000002a6,0x000002a7,0x000002a8,0x000002a9,
+0x000002aa,0x000002ab,0x000002ac,0x0000017d,
+0x000002ad,0x000002ae,0x00000179,0x000002af,
+0x000002b0,0x000002b1,0x000002b2,0x000002b3,
+0x000002b4,0x000002b5,0x000002b6,0x000002b7,
+0x000002b8,0x000002b9,0x000002b6,0x000002ba,
+0x000002bb,0x000002bc,0x000002bd,0x000002be,
+0x000002bf,0x000002c0,0x000002c1,0x000002c2,
+0x000002c3,0x000002c4,0x000002c5,0x000002c6,
+0x000002c7,0x000002c8,0x000002c9,0x000001dd,
+0x000002ca,0x000002cb,0x000002cc,0x000002cd,
+0x000002ce,0x000002cf,0x000002d0,0x000002d1,
+0x000002d2,0x000002d3,0x000002d4,0x000002d5,
+0x000002d6,0x000002d7,0x000002d4,0x000002d8,
+0x000002d9,0x000002da,0x000002db,0x000002dc,
+0x000002dd,0x000002de,0x000002df,0x000002e0,
+0x000002e1,0x000002e2,0x000002e3,0x000002e4,
+0x000002e5,0x000002e6,0x000002e7,0x000002e8,
+0x000002e9,0x000002ea,0x000002eb,0x000002ec,
+0x000002ed,0x000002ee,0x000002ef,0x000002f0,
+0x000002f1,0x000002f2,0x000002f3,0x000002f4,
+0x000002f5,0x000002f6,0x000002f3,0x000002f7,
+0x000002f8,0x000002f9,0x000002fa,0x000002fb,
+0x000002fc,0x000002fd,0x000002fe,0x000002ff,
+0x00000300,0x00000301,0x00000302,0x00000303,
+0x00000304,0x00000305,0x000002e7,0x00000297,
+0x00000306,0x00000307,0x00000308,0x00000309,
+0x0000030a,0x0000030b,0x0000030c,0x0000030d,
+0x0000030e,0x0000030f,0x00000310,0x00000311,
+0x00000312,0x00000313,0x00000310,0x00000314,
+0x00000315,0x00000316,0x00000317,0x00000318,
+0x00000319,0x0000031a,0x0000031b,0x0000031c,
+0x0000031d,0x0000031e,0x0000031f,0x00000320,
+0x00000321,0x00000322,0x00000323,0x00000324,
+0x00000325,0x00000326,0x00000327,0x00000328,
+0x00000329,0x0000032a,0x0000032b,0x0000032c,
+0x0000032d,0x0000032e,0x0000032f,0x00000330,
+0x00000331,0x00000332,0x0000032f,0x00000333,
+0x00000334,0x00000335,0x00000336,0x00000337,
+0x00000338,0x00000339,0x0000033a,0x0000033b,
+0x0000033c,0x0000033d,0x0000033e,0x0000033f,
+0x00000340,0x00000341,0x00000342,0x00000343,
+0x00000344,0x00000345,0x00000346,0x00000347,
+0x00000348,0x00000349,0x0000034a,0x0000034b,
+0x0000034c,0x0000034d,0x0000034e,0x0000034f,
+0x00000350,0x00000351,0x0000034e,0x00000352,
+0x00000353,0x00000354,0x00000355,0x00000356,
+0x00000357,0x00000358,0x00000359,0x0000035a,
+0x0000035b,0x0000035c,0x0000035d,0x0000035e,
+0x0000035f,0x00000360,0x00000361,0x00000362,
+0x00000363,0x00000364,0x00000365,0x00000366,
+0x00000367,0x00000368,0x00000369,0x0000036a,
+0x0000036b,0x0000036c,0x0000036d,0x0000036e,
+0x0000036f,0x00000370,0x0000036d,0x00000371,
+0x00000372,0x00000373,0x00000374,0x00000375,
+0x00000376,0x00000377,0x00000378,0x00000379,
+0x0000037a,0x0000037b,0x0000037c,0x00000303,
+0x00000304,0x00000305,0x00000361,0x00040020,
+0x0000037f,0x00000007,0x00000298,0x0006002c,
+0x00000060,0x000003b3,0x000000bf,0x0000015e,
+0x000000cf,0x0004001c,0x000003ba,0x00000006,
+0x000001dd,0x0004002b,0x00000006,0x000003bb,
+0x0000000b,0x0004002b,0x00000006,0x000003bc,
+0x00000013,0x0004002b,0x00000006,0x000003bd,
+0x0000001b,0x0004002b,0x00000006,0x000003be,
+0x0000001c,0x0004002b,0x00000006,0x000003bf,
+0x00000023,0x0004002b,0x00000006,0x000003c0,
+0x000000e4,0x0004002b,0x00000006,0x000003c1,
+0x00000043,0x0004002b,0x00000006,0x000003c2,
+0x0000004b,0x0004002b,0x00000006,0x000003c3,
+0x0000004c,0x0004002b,0x00000006,0x000003c4,
+0x0000010c,0x0004002b,0x00000006,0x000003c5,
+0x00000053,0x0004002b,0x00000006,0x000003c6,
+0x0000005b,0x0004002b,0x00000006,0x000003c7,
+0x0000005c,0x0004002b,0x00000006,0x000003c8,
+0x00000063,0x0004002b,0x00000006,0x000003c9,
+0x0000011c,0x0004002b,0x00000006,0x000003ca,
+0x00000123,0x0004002b,0x00000006,0x000003cb,
+0x00000083,0x0004002b,0x00000006,0x000003cc,
+0x00000103,0x0004002b,0x00000006,0x000003cd,
+0x0000008b,0x0004002b,0x00000006,0x000003ce,
+0x0000008c,0x0004002b,0x00000006,0x000003cf,
+0x0000010b,0x0004002b,0x00000006,0x000003d0,
+0x00000093,0x0004002b,0x00000006,0x000003d1,
+0x00000113,0x0004002b,0x00000006,0x000003d2,
+0x0000009b,0x0004002b,0x00000006,0x000003d3,
+0x0000009c,0x0004002b,0x00000006,0x000003d4,
+0x000000a3,0x0004002b,0x00000006,0x000003d5,
+0x0000011b,0x0004002b,0x00000006,0x000003d6,
+0x000000c0,0x0004002b,0x00000006,0x000003d7,
+0x000000c1,0x0004002b,0x00000006,0x000003d8,
+0x000000c2,0x0004002b,0x00000006,0x000003d9,
+0x000000c3,0x0004002b,0x00000006,0x000003da,
+0x000000c4,0x0004002b,0x00000006,0x000003db,
+0x000000e0,0x0004002b,0x00000006,0x000003dc,
+0x000000c8,0x0004002b,0x00000006,0x000003dd,
+0x000000c9,0x0004002b,0x00000006,0x000003de,
+0x000000ca,0x0004002b,0x00000006,0x000003df,
+0x000000cb,0x0004002b,0x00000006,0x000003e0,
+0x000000cc,0x0004002b,0x00000006,0x000003e1,
+0x000000e1,0x0004002b,0x00000006,0x000003e2,
+0x000000d0,0x0004002b,0x00000006,0x000003e3,
+0x000000d1,0x0004002b,0x00000006,0x000003e4,
+0x000000d2,0x0004002b,0x00000006,0x000003e5,
+0x000000d3,0x0004002b,0x00000006,0x000003e6,
+0x000000d4,0x0004002b,0x00000006,0x000003e7,
+0x000000e2,0x0004002b,0x00000006,0x000003e8,
+0x000000d8,0x0004002b,0x00000006,0x000003e9,
+0x000000d9,0x0004002b,0x00000006,0x000003ea,
+0x000000da,0x0004002b,0x00000006,0x000003eb,
+0x000000db,0x0004002b,0x00000006,0x000003ec,
+0x000000dc,0x0004002b,0x00000006,0x000003ed,
+0x000000e3,0x0083002c,0x000003ba,0x000003ee,
+0x0000009c,0x0000009f,0x00000091,0x00000095,
+0x00000090,0x000001a0,0x000002a1,0x00000317,
+0x0000008c,0x0000029a,0x00000107,0x000003bb,
+0x000000f1,0x00000299,0x000002bd,0x00000317,
+0x0000014d,0x0000029f,0x000002a0,0x000003bc,
+0x000002a2,0x0000029b,0x000002db,0x00000317,
+0x00000176,0x000002a6,0x000002a7,0x000003bd,
+0x000003be,0x000003bf,0x000003c0,0x00000317,
+0x0000017d,0x000002ad,0x000002ae,0x000003c1,
+0x000002af,0x00000179,0x00000309,0x00000308,
+0x000002b3,0x000002b4,0x000002b5,0x000003c2,
+0x000003c3,0x000002b2,0x000003c4,0x0000030c,
+0x000002ba,0x000002bb,0x000002bc,0x000003c5,
+0x000002be,0x000002b6,0x00000318,0x00000310,
+0x000002c2,0x000002c3,0x000002c4,0x000003c6,
+0x000003c7,0x000003c8,0x000003c9,0x000003ca,
+0x000001dd,0x000002ca,0x000002cb,0x000003cb,
+0x000002cd,0x000002cc,0x00000307,0x000003cc,
+0x000002d1,0x000002d2,0x000002d3,0x000003cd,
+0x000003ce,0x000002d0,0x0000030f,0x000003cf,
+0x000002d8,0x000002d9,0x000002da,0x000003d0,
+0x000002dc,0x000002d4,0x00000316,0x000003d1,
+0x000002e0,0x000002e1,0x000002e2,0x000003d2,
+0x000003d3,0x000003d4,0x0000031e,0x000003d5,
+0x000003d6,0x000003d7,0x000003d8,0x000003d9,
+0x000003da,0x000003db,0x00000297,0x00000306,
+0x000003dc,0x000003dd,0x000003de,0x000003df,
+0x000003e0,0x000003e1,0x0000030d,0x0000030e,
+0x000003e2,0x000003e3,0x000003e4,0x000003e5,
+0x000003e6,0x000003e7,0x00000314,0x00000315,
+0x000003e8,0x000003e9,0x000003ea,0x000003eb,
+0x000003ec,0x000003ed,0x0000031c,0x0000031d,
+0x00040020,0x000003f0,0x00000007,0x000003ba,
+0x0004002b,0x00000006,0x0000041f,0x0000002d,
+0x0004001c,0x00000420,0x00000006,0x0000041f,
+0x0004002b,0x00000006,0x00000421,0x00000034,
+0x0004002b,0x00000006,0x00000422,0x00000027,
+0x0004002b,0x00000006,0x00000423,0x0000002f,
+0x0004002b,0x00000006,0x00000424,0x0000003b,
+0x0004002b,0x00000006,0x00000425,0x00000017,
+0x0004002b,0x00000006,0x00000426,0x00000035,
+0x0004002b,0x00000006,0x00000427,0x00000038,
+0x0004002b,0x00000006,0x00000428,0x00000030,
+0x0004002b,0x00000006,0x00000429,0x0000003e,
+0x0004002b,0x00000006,0x0000042a,0x0000000d,
+0x0004002b,0x00000006,0x0000042b,0x00000033,
+0x0004002b,0x00000006,0x0000042c,0x0000001e,
+0x0030002c,0x00000420,0x0000042d,0x0000009c,
+0x000001a0,0x0000017d,0x0000009c,0x0000017d,
+0x000000f1,0x00000421,0x000002a6,0x00000422,
+0x0000009c,0x0000017d,0x0000029f,0x00000423,
+0x00000094,0x00000424,0x00000425,0x0000029d,
+0x000003bb,0x00000426,0x000003be,0x000002a1,
+0x0000009c,0x0000017d,0x0000008c,0x00000427,
+0x0000014d,0x00000428,0x00000176,0x0000029c,
+0x00000091,0x00000429,0x000003bb,0x00000426,
+0x000003bc,0x0000041f,0x000003bd,0x000002a5,
+0x00000094,0x00000424,0x0000042a,0x0000042b,
+0x000002a4,0x0000029e,0x0000042c,0x0000029b,
+0x00040020,0x00000435,0x00000007,0x00000420,
+0x0004001c,0x00000452,0x00000006,0x000003bf,
+0x0004002b,0x00000006,0x00000453,0x00000039,
+0x0004002b,0x00000006,0x00000454,0x0000000e,
+0x0004002b,0x00000006,0x00000455,0x00000032,
+0x0004002b,0x00000006,0x00000456,0x0000002b,
+0x0004002b,0x00000006,0x00000457,0x0000003d,
+0x0004002b,0x00000006,0x00000458,0x0000003a,
+0x0004002b,0x00000006,0x00000459,0x00000037,
+0x0004002b,0x00000006,0x0000045a,0x0000001d,
+0x0026002c,0x00000452,0x0000045b,0x0000009c,
+0x0000014d,0x000001a0,0x00000428,0x0000017d,
+0x0000009c,0x0000017d,0x0000008d,0x00000453,
+0x00000454,0x00000455,0x000002a3,0x00000456,
+0x000003be,0x000002a1,0x0000009c,0x0000017d,
+0x0000014d,0x00000428,0x00000095,0x00000457,
+0x000003bc,0x0000041f,0x000000fb,0x00000458,
+0x00000425,0x0000029d,0x0000029a,0x00000459,
+0x000002a7,0x000002a8,0x0000042a,0x0000042b,
+0x0000045a,0x000003bf,0x00040020,0x00000463,
+0x00000007,0x00000452,0x0004001c,0x00000476,
+0x00000011,0x000000fb,0x0004002b,0x00000006,
+0x00000477,0x0000003f,0x0005002c,0x00000011,
+0x00000478,0x00000477,0x0000008c,0x0005002c,
+0x00000011,0x00000479,0x000002a3,0x0000008c,
+0x0005002c,0x00000011,0x0000047a,0x0000029a,
+0x0000008c,0x0005002c,0x00000011,0x0000047b,
+0x00000091,0x00000090,0x0005002c,0x00000011,
+0x0000047c,0x0000009f,0x0000008c,0x0009002c,
+0x00000476,0x0000047d,0x00000478,0x00000479,
+0x0000047a,0x00000092,0x0000047b,0x0000047c,
+0x00040020,0x00000480,0x00000007,0x00000476,
+0x00030016,0x000004ea,0x00000020,0x00040017,
+0x000004eb,0x000004ea,0x00000004,0x0004002b,
+0x000004ea,0x000004f0,0x41000000,0x0004002b,
+0x00000006,0x000004f7,0x00000400,0x0004002b,
+0x00000059,0x0000050c,0x00000006,0x00040017,
+0x0000050d,0x00000059,0x00000002,0x0004002b,
+0x00000006,0x00000516,0x0000000f,0x0005002c,
+0x00000011,0x00000525,0x0000009c,0x0000009c,
+0x0004002b,0x00000059,0x00000551,0x0000000f,
+0x0004002b,0x00000059,0x00000556,0x00000011,
+0x0004002b,0x00000059,0x00000567,0x00000010,
+0x0004002b,0x00000059,0x0000059d,0x00000008,
+0x0004002b,0x00000059,0x000005a0,0x0000000c,
+0x0004002b,0x00000059,0x000005a7,0x00000014,
+0x0004002b,0x00000059,0x000005aa,0x00000018,
+0x0004002b,0x00000059,0x000005ad,0x0000001c,
+0x00040017,0x000005d7,0x000004ea,0x00000002,
+0x0007002c,0x0000000f,0x000005f5,0x00000454,
+0x00000107,0x000000fb,0x00000091,0x0007002c,
+0x0000000f,0x000005f8,0x00000477,0x00000477,
+0x00000477,0x00000477,0x00040017,0x0000060e,
+0x000000ac,0x00000003,0x0004001c,0x00000634,
+0x00000008,0x000003bc,0x0006002c,0x00000008,
+0x00000635,0x0000009c,0x0000009c,0x0000008c,
+0x0006002c,0x00000008,0x00000636,0x0000009f,
+0x0000009c,0x000000fb,0x0006002c,0x00000008,
+0x00000637,0x0000009c,0x0000009f,0x00000094,
+0x0006002c,0x00000008,0x00000638,0x0000009c,
+0x0000009c,0x0000008d,0x0006002c,0x00000008,
+0x00000639,0x0000009f,0x0000009c,0x00000094,
+0x0006002c,0x00000008,0x0000063a,0x0000009c,
+0x0000009f,0x00000090,0x0006002c,0x00000008,
+0x0000063b,0x0000009c,0x0000009c,0x000000fb,
+0x0006002c,0x00000008,0x0000063c,0x0000009f,
+0x0000009c,0x00000090,0x0006002c,0x00000008,
+0x0000063d,0x0000009c,0x0000009f,0x00000095,
+0x0016002c,0x00000634,0x0000063e,0x00000635,
+0x00000636,0x00000637,0x00000638,0x00000639,
+0x0000063a,0x0000063b,0x0000063c,0x0000063d,
+0x0000015b,0x0000015a,0x00000159,0x00000158,
+0x00000157,0x00000156,0x00000155,0x00000154,
+0x00000152,0x00000150,0x00040020,0x00000640,
+0x00000007,0x00000634,0x0004002b,0x00000059,
+0x00000675,0x00000080,0x0004002b,0x00000059,
+0x0000067d,0x0000003f,0x0004002b,0x00000006,
+0x00000693,0x000000ff,0x0004002b,0x00000059,
+0x000006a6,0x000000c0,0x0004002b,0x00000059,
+0x000006af,0x000000ff,0x0004002b,0x00000059,
+0x00000730,0xffffff80,0x0007002c,0x0000000f,
+0x0000075e,0x0000009c,0x0000009c,0x0000009c,
+0x0000009c,0x0004002b,0x00000006,0x0000077c,
+0x0000017d,0x0004001c,0x0000077d,0x00000006,
+0x0000077c,0x0004002b,0x00000006,0x0000077e,
+0x000000ba,0x0004002b,0x00000006,0x0000077f,
+0x000000e8,0x0004002b,0x00000006,0x00000780,
+0x0000002e,0x0004002b,0x00000006,0x00000781,
+0x00000074,0x0004002b,0x00000006,0x00000782,
+0x000000de,0x0004002b,0x00000006,0x00000783,
+0x000000bd,0x0004002b,0x00000006,0x00000784,
+0x000000f4,0x0004002b,0x00000006,0x00000785,
+0x0000002c,0x0004002b,0x00000006,0x00000786,
+0x0000004d,0x0004002b,0x00000006,0x00000787,
+0x000000b2,0x0004002b,0x00000006,0x00000788,
+0x0000006e,0x0004002b,0x00000006,0x00000789,
+0x000000e9,0x0004002b,0x00000006,0x0000078a,
+0x000000a7,0x0004002b,0x00000006,0x0000078b,
+0x00000079,0x0004002b,0x00000006,0x0000078c,
+0x000000ef,0x0004002b,0x00000006,0x0000078d,
+0x000000df,0x0004002b,0x00000006,0x0000078e,
+0x000000cf,0x0004002b,0x00000006,0x0000078f,
+0x000000be,0x0004002b,0x00000006,0x00000790,
+0x000000ae,0x0004002b,0x00000006,0x00000791,
+0x0000009e,0x0004002b,0x00000006,0x00000792,
+0x00000071,0x0004002b,0x00000006,0x00000793,
+0x0000008e,0x0004002b,0x00000006,0x00000794,
+0x000000fa,0x0004002b,0x00000006,0x00000795,
+0x000000ea,0x0004002b,0x00000006,0x00000796,
+0x00000036,0x0004002b,0x00000006,0x00000797,
+0x000000b9,0x0004002b,0x00000006,0x00000798,
+0x00000067,0x0004002b,0x00000006,0x00000799,
+0x00000077,0x0004002b,0x00000006,0x0000079a,
+0x000000b3,0x0004002b,0x00000006,0x0000079b,
+0x0000006c,0x0004002b,0x00000006,0x0000079c,
+0x0000007c,0x0004002b,0x00000006,0x0000079d,
+0x000000f7,0x0004002b,0x00000006,0x0000079e,
+0x000000e7,0x0004002b,0x00000006,0x0000079f,
+0x000000d7,0x0004002b,0x00000006,0x000007a0,
+0x000000c7,0x0004002b,0x00000006,0x000007a1,
+0x000000bf,0x0004002b,0x00000006,0x000007a2,
+0x000000b7,0x0004002b,0x00000006,0x000007a3,
+0x000000af,0x0004002b,0x00000006,0x000007a4,
+0x0000009f,0x0004002b,0x00000006,0x000007a5,
+0x00000097,0x0004002b,0x00000006,0x000007a6,
+0x00000070,0x0004002b,0x00000006,0x000007a7,
+0x0000008f,0x0004002b,0x00000006,0x000007a8,
+0x00000078,0x0004002b,0x00000006,0x000007a9,
+0x00000087,0x0004002b,0x00000006,0x000007aa,
+0x000000fd,0x0004002b,0x00000006,0x000007ab,
+0x000000f5,0x0004002b,0x00000006,0x000007ac,
+0x000000ed,0x0004002b,0x00000006,0x000007ad,
+0x000000e5,0x0004002b,0x00000006,0x000007ae,
+0x000000bc,0x0004002b,0x00000006,0x000007af,
+0x000000b4,0x0004002b,0x00000006,0x000007b0,
+0x000000ac,0x0004002b,0x00000006,0x000007b1,
+0x0000006b,0x0004002b,0x00000006,0x000007b2,
+0x00000073,0x0004002b,0x00000006,0x000007b3,
+0x0000007b,0x0004002b,0x00000006,0x000007b4,
+0x000000f2,0x0004002b,0x00000006,0x000007b5,
+0x0000004e,0x0004002b,0x00000006,0x000007b6,
+0x000000b1,0x0004002b,0x00000006,0x000007b7,
+0x0000005e,0x0004002b,0x00000006,0x000007b8,
+0x00000076,0x0004002b,0x00000006,0x000007b9,
+0x0000007e,0x0004002b,0x00000006,0x000007ba,
+0x000000fb,0x0004002b,0x00000006,0x000007bb,
+0x000000f3,0x0004002b,0x00000006,0x000007bc,
+0x000000eb,0x0004002b,0x00000006,0x000007bd,
+0x0000003c,0x0004002b,0x00000006,0x000007be,
+0x000000bb,0x0004002b,0x00000006,0x000007bf,
+0x000000ab,0x0004002b,0x00000006,0x000007c0,
+0x000000fe,0x0004002b,0x00000006,0x000007c1,
+0x000000f6,0x0004002b,0x00000006,0x000007c2,
+0x000000ee,0x0004002b,0x00000006,0x000007c3,
+0x000000e6,0x0004002b,0x00000006,0x000007c4,
+0x000000d6,0x0004002b,0x00000006,0x000007c5,
+0x00000031,0x0004002b,0x00000006,0x000007c6,
+0x000000ce,0x0004002b,0x00000006,0x000007c7,
+0x000000c6,0x0004002b,0x00000006,0x000007c8,
+0x000000b6,0x0004002b,0x00000006,0x000007c9,
+0x0000005d,0x0004002b,0x00000006,0x000007ca,
+0x0000006d,0x0004002b,0x00000006,0x000007cb,
+0x00000075,0x0004002b,0x00000006,0x000007cc,
+0x0000007d,0x0004002b,0x00000006,0x000007cd,
+0x000000f9,0x0004002b,0x00000006,0x000007ce,
+0x000000f1,0x0004002b,0x00000006,0x000007cf,
+0x000000dd,0x0004002b,0x00000006,0x000007d0,
+0x000000d5,0x0004002b,0x00000006,0x000007d1,
+0x000000cd,0x0004002b,0x00000006,0x000007d2,
+0x000000c5,0x0004002b,0x00000006,0x000007d3,
+0x000000b5,0x0004002b,0x00000006,0x000007d4,
+0x000000ad,0x0004002b,0x00000006,0x000007d5,
+0x0000009d,0x0004002b,0x00000006,0x000007d6,
+0x00000072,0x0004002b,0x00000006,0x000007d7,
+0x0000008d,0x0004002b,0x00000006,0x000007d8,
+0x0000007a,0x0180002c,0x0000077d,0x000007d9,
+0x0000009c,0x0000009c,0x0000009c,0x0000009c,
+0x00000693,0x0000042b,0x000003e0,0x000002c5,
+0x000002e1,0x0000009c,0x00000693,0x000002b0,
+0x0000077e,0x00000425,0x0000077f,0x000003c7,
+0x000003d4,0x00000780,0x000003e3,0x00000781,
+0x000003cd,0x0000009c,0x00000693,0x00000299,
+0x00000782,0x000002ae,0x00000783,0x000003c8,
+0x000003d3,0x000003bb,0x00000784,0x00000785,
+0x000003e5,0x00000786,0x00000787,0x00000788,
+0x000002d9,0x000002a4,0x00000789,0x00000459,
+0x000003dc,0x000002c2,0x0000078a,0x0000078b,
+0x000002cf,0x0000009c,0x00000693,0x0000014d,
+0x0000078c,0x000001a0,0x0000078d,0x00000428,
+0x0000078e,0x000002ad,0x0000078f,0x000002bb,
+0x00000790,0x000002b2,0x00000791,0x00000792,
+0x00000793,0x00000094,0x00000794,0x000002a3,
+0x00000795,0x000002a8,0x000003e9,0x00000796,
+0x000003dd,0x000002b1,0x00000797,0x000002c0,
+0x000002d6,0x00000798,0x000002e0,0x00000799,
+0x000002d1,0x000003bb,0x00000784,0x000003bd,
+0x000003c0,0x00000456,0x000003e6,0x00000424,
+0x000003da,0x000003c3,0x0000079a,0x000003c7,
+0x000003d4,0x0000079b,0x000003d0,0x0000079c,
+0x000003cb,0x0000009c,0x00000693,0x0000008c,
+0x0000079d,0x0000014d,0x0000078c,0x00000176,
+0x0000079e,0x000001a0,0x0000078d,0x0000029c,
+0x0000079f,0x00000428,0x0000078e,0x00000427,
+0x000007a0,0x0000017d,0x000007a1,0x000002b3,
+0x000007a2,0x000002ba,0x000007a3,0x000002c2,
+0x0000078a,0x00000179,0x000007a4,0x000002b7,
+0x000007a5,0x000007a6,0x000007a7,0x000007a8,
+0x000007a9,0x00000091,0x000007aa,0x00000107,
+0x000007ab,0x000002a0,0x000007ac,0x000002a7,
+0x000007ad,0x000003bf,0x000003ec,0x00000456,
+0x000003e6,0x0000042b,0x000003e0,0x00000424,
+0x000003da,0x000003c1,0x000007ae,0x000003c2,
+0x000007af,0x000003c5,0x000007b0,0x000003c6,
+0x000002db,0x000003c8,0x000003d3,0x000007b1,
+0x000002dc,0x000007b2,0x000003ce,0x000007b3,
+0x000002cd,0x00000094,0x00000794,0x0000042a,
+0x000007b4,0x000002a3,0x00000795,0x0000045a,
+0x000003e7,0x000002a5,0x000003ea,0x0000041f,
+0x000003e4,0x00000426,0x000003de,0x00000457,
+0x000003d8,0x000002b1,0x00000797,0x000007b5,
+0x000007b6,0x000002c0,0x000002d6,0x000007b7,
+0x000002d0,0x000002c5,0x000002e1,0x00000788,
+0x000002d9,0x000007b8,0x000002d2,0x000007b9,
+0x000002ca,0x0000009c,0x00000693,0x00000090,
+0x000007ba,0x0000008c,0x0000079d,0x000000f1,
+0x000007bb,0x0000014d,0x0000078c,0x000002a2,
+0x000007bc,0x00000176,0x0000079e,0x000003be,
+0x000003ed,0x000001a0,0x0000078d,0x000002a1,
+0x000003eb,0x0000029c,0x0000079f,0x00000785,
+0x000003e5,0x00000428,0x0000078e,0x00000421,
+0x000003df,0x00000427,0x000007a0,0x000007bd,
+0x000003d9,0x0000017d,0x000007a1,0x000002af,
+0x000007be,0x000002b3,0x000007a2,0x000003c3,
+0x0000079a,0x000002ba,0x000007a3,0x000002be,
+0x000007bf,0x000002c2,0x0000078a,0x000003c7,
+0x000003d4,0x00000179,0x000007a4,0x000002bd,
+0x000003d2,0x000002b7,0x000007a5,0x0000079b,
+0x000003d0,0x000007a6,0x000007a7,0x00000781,
+0x000003cd,0x000007a8,0x000007a9,0x0000079c,
+0x000003cb,0x0000009f,0x000007c0,0x00000094,
+0x00000794,0x0000029a,0x000007c1,0x0000042a,
+0x000007b4,0x0000029f,0x000007c2,0x000002a3,
+0x00000795,0x000002a6,0x000007c3,0x0000045a,
+0x000003e7,0x00000299,0x00000782,0x000002a5,
+0x000003ea,0x0000029d,0x000007c4,0x0000041f,
+0x000003e4,0x000007c5,0x000007c6,0x00000426,
+0x000003de,0x00000453,0x000007c7,0x00000457,
+0x000003d8,0x000002ad,0x0000078f,0x000002b0,
+0x0000077e,0x000002b4,0x000007c8,0x00000786,
+0x00000787,0x000002bb,0x00000790,0x000002bf,
+0x000002d7,0x000002c3,0x000002e3,0x000007c9,
+0x000002d4,0x000002b2,0x00000791,0x000002c1,
+0x000002e2,0x000002b8,0x000002de,0x000007ca,
+0x000002da,0x00000792,0x00000793,0x000007cb,
+0x000002d3,0x0000078b,0x000002cf,0x000007cc,
+0x000002cb,0x00000091,0x000007aa,0x000000fb,
+0x000007cd,0x00000107,0x000007ab,0x00000454,
+0x000007ce,0x000002a0,0x000007ac,0x000002a4,
+0x00000789,0x000002a7,0x000007ad,0x0000042c,
+0x000003e1,0x0000029b,0x000007cf,0x000002a8,
+0x000003e9,0x0000029e,0x000007d0,0x00000780,
+0x000003e3,0x00000455,0x000007d1,0x00000796,
+0x000003dd,0x00000458,0x000007d2,0x00000429,
+0x000003d7,0x000002ae,0x00000783,0x000002b1,
+0x00000797,0x000002b5,0x000007d3,0x000007b5,
+0x000007b6,0x000002bc,0x000007d4,0x000002c0,
+0x000002d6,0x000002c4,0x000002df,0x000007b7,
+0x000002d0,0x000002b6,0x000007d5,0x000002c5,
+0x000002e1,0x000002b9,0x000002dd,0x00000788,
+0x000002d9,0x000007d6,0x000007d7,0x000007b8,
+0x000002d2,0x000007d8,0x000002ce,0x000007b9,
+0x000002ca,0x00040020,0x000007e1,0x00000007,
+0x0000077d,0x0004002b,0x00000006,0x00000800,
+0x0000013b,0x0004001c,0x00000801,0x00000006,
+0x00000800,0x0004002b,0x00000006,0x00000802,
+0x00000047,0x0004002b,0x00000006,0x00000803,
+0x000000b8,0x0004002b,0x00000006,0x00000804,
+0x000000ec,0x0004002b,0x00000006,0x00000805,
+0x000000fc,0x0004002b,0x00000006,0x00000806,
+0x00000057,0x013e002c,0x00000801,0x00000807,
+0x0000009c,0x0000009c,0x0000009c,0x0000009c,
+0x0000009c,0x0000009c,0x00000693,0x000003be,
+0x000003ed,0x00000427,0x000007a0,0x000002be,
+0x000007bf,0x00000792,0x00000793,0x0000009c,
+0x00000693,0x000003c1,0x000007ae,0x0000042a,
+0x000007b4,0x000002ba,0x000007a3,0x000003bd,
+0x000003c0,0x000007b7,0x000002d0,0x0000029c,
+0x0000079f,0x000007b1,0x000002dc,0x00000796,
+0x000003dd,0x0000078b,0x000002cf,0x0000009c,
+0x00000693,0x000001a0,0x0000078d,0x000002ad,
+0x0000078f,0x000002b2,0x00000791,0x000000fb,
+0x000007cd,0x00000422,0x000003e8,0x00000802,
+0x00000803,0x000002b7,0x000007a5,0x0000042a,
+0x000007b4,0x0000041f,0x000003e4,0x000007b5,
+0x000007b6,0x00000788,0x000002d9,0x000003bc,
+0x00000804,0x00000421,0x000003df,0x000002be,
+0x000007bf,0x000007cb,0x000002d3,0x000002a7,
+0x000007ad,0x00000458,0x000007d2,0x000003c6,
+0x000002db,0x000007b3,0x000002cd,0x0000009c,
+0x00000693,0x0000014d,0x0000078c,0x000001a0,
+0x0000078d,0x00000428,0x0000078e,0x0000017d,
+0x000007a1,0x000002ba,0x000007a3,0x00000179,
+0x000007a4,0x000007a6,0x000007a7,0x00000095,
+0x00000805,0x000003bc,0x00000804,0x000003bf,
+0x000003ec,0x0000042b,0x000003e0,0x000003c1,
+0x000007ae,0x000003c5,0x000007b0,0x000002bd,
+0x000003d2,0x00000781,0x000003cd,0x000000fb,
+0x000007cd,0x000002a4,0x00000789,0x000002a8,
+0x000003e9,0x00000796,0x000003dd,0x00000802,
+0x00000803,0x00000806,0x000002d5,0x00000798,
+0x000002e0,0x00000799,0x000002d1,0x0000029a,
+0x000007c1,0x000002a6,0x000007c3,0x0000029e,
+0x000007d0,0x00000458,0x000007d2,0x000002b5,
+0x000007d3,0x000002c4,0x000002df,0x000002b9,
+0x000002dd,0x000007d8,0x000002ce,0x0000042a,
+0x000007b4,0x0000045a,0x000003e7,0x0000041f,
+0x000003e4,0x00000457,0x000003d8,0x00000786,
+0x00000787,0x000007c9,0x000002d4,0x000007ca,
+0x000002da,0x000007cc,0x000002cb,0x0000009c,
+0x00000693,0x0000008c,0x0000079d,0x0000014d,
+0x0000078c,0x00000176,0x0000079e,0x000001a0,
+0x0000078d,0x0000029c,0x0000079f,0x00000428,
+0x0000078e,0x00000427,0x000007a0,0x0000017d,
+0x000007a1,0x000002b3,0x000007a2,0x000002ba,
+0x000007a3,0x000002c2,0x0000078a,0x00000179,
+0x000007a4,0x000002b7,0x000007a5,0x000007a6,
+0x000007a7,0x000007a8,0x000007a9,0x0000009f,
+0x000007c0,0x0000029a,0x000007c1,0x0000029f,
+0x000007c2,0x000002a6,0x000007c3,0x00000299,
+0x00000782,0x0000029d,0x000007c4,0x000007c5,
+0x000007c6,0x00000453,0x000007c7,0x000002ad,
+0x0000078f,0x000002b4,0x000007c8,0x000002bb,
+0x00000790,0x000002c3,0x000002e3,0x000002b2,
+0x00000791,0x000002b8,0x000002de,0x00000792,
+0x00000793,0x0000078b,0x000002cf,0x00000095,
+0x00000805,0x000003bb,0x00000784,0x000003bc,
+0x00000804,0x000003bd,0x000003c0,0x000003bf,
+0x000003ec,0x00000456,0x000003e6,0x0000042b,
+0x000003e0,0x00000424,0x000003da,0x000003c1,
+0x000007ae,0x000003c2,0x000007af,0x000003c5,
+0x000007b0,0x000003c6,0x000002db,0x000003c8,
+0x000003d3,0x000007b1,0x000002dc,0x000007b2,
+0x000003ce,0x000007b3,0x000002cd,0x00000090,
+0x000007ba,0x000000f1,0x000007bb,0x000002a2,
+0x000007bc,0x000003be,0x000003ed,0x000002a1,
+0x000003eb,0x00000785,0x000003e5,0x00000421,
+0x000003df,0x000007bd,0x000003d9,0x000002af,
+0x000007be,0x000003c3,0x0000079a,0x000002be,
+0x000007bf,0x000003c7,0x000003d4,0x000002bd,
+0x000003d2,0x0000079b,0x000003d0,0x00000781,
+0x000003cd,0x0000079c,0x000003cb,0x000000fb,
+0x000007cd,0x00000454,0x000007ce,0x000002a4,
+0x00000789,0x0000042c,0x000003e1,0x000002a8,
+0x000003e9,0x00000780,0x000003e3,0x00000796,
+0x000003dd,0x00000429,0x000003d7,0x000002b1,
+0x00000797,0x000007b5,0x000007b6,0x000002c0,
+0x000002d6,0x000007b7,0x000002d0,0x000002c5,
+0x000002e1,0x00000788,0x000002d9,0x000007b8,
+0x000002d2,0x000007b9,0x000002ca,0x00040020,
+0x0000080f,0x00000007,0x00000801,0x0004001c,
+0x00000824,0x00000011,0x0000008c,0x0005002c,
+0x00000011,0x00000825,0x00000693,0x0000008c,
+0x0005002c,0x00000011,0x00000826,0x000002bf,
+0x0000008c,0x0005002c,0x00000011,0x00000827,
+0x000002a1,0x0000009f,0x0005002c,0x00000011,
+0x00000828,0x0000029f,0x0000008c,0x0005002c,
+0x00000011,0x00000829,0x0000008c,0x00000091,
+0x0005002c,0x00000011,0x0000082a,0x00000090,
+0x00000090,0x0005002c,0x00000011,0x0000082b,
+0x00000091,0x000000fb,0x000b002c,0x00000824,
+0x0000082c,0x00000825,0x00000826,0x00000827,
+0x00000828,0x00000829,0x0000082a,0x0000082b,
+0x0000047c,0x00040020,0x0000082f,0x00000007,
+0x00000824,0x0004002b,0x00000059,0x00000841,
+0x00000060,0x0004002b,0x00000059,0x00000842,
+0x00000040,0x0004002b,0x00000059,0x00000843,
+0x00000020,0x0007002c,0x0000005a,0x00000844,
+0x00000841,0x00000842,0x00000843,0x000000bf,
+0x0007002c,0x0000000f,0x00000848,0x0000009f,
+0x0000009f,0x0000009f,0x0000009f,0x0007002c,
+0x0000005a,0x0000084a,0x000000bf,0x000000bf,
+0x000000bf,0x000000bf,0x0004002b,0x00000059,
+0x0000084b,0x0000001f,0x0007002c,0x0000005a,
+0x0000084c,0x0000084b,0x0000084b,0x0000084b,
+0x0000084b,0x0004002b,0x00000006,0x00000852,
+0xffffffff,0x0007002c,0x0000000f,0x00000853,
+0x00000852,0x00000852,0x00000852,0x00000852,
+0x0007002c,0x0000000f,0x00000856,0x000001dd,
+0x00000179,0x0000017d,0x000001a0,0x00040017,
+0x00000857,0x000000ac,0x00000004,0x0007002c,
+0x0000000f,0x0000085f,0x00000693,0x0000009c,
+0x00000693,0x00000693,0x0004002b,0x00000059,
+0x0000089a,0x0000001d,0x0004002b,0x00000059,
+0x0000089e,0xfffffffe,0x00040020,0x0000091b,
+0x00000001,0x00000008,0x0004003b,0x0000091b,
+0x0000091c,0x00000001,0x0005001e,0x00000920,
+0x00000011,0x00000006,0x00000006,0x00040020,
+0x00000921,0x00000009,0x00000920,0x0004003b,
+0x00000921,0x00000922,0x00000009,0x00040020,
+0x00000923,0x00000009,0x00000006,0x00040020,
+0x00000926,0x00000001,0x00000006,0x00040020,
+0x0000092c,0x00000009,0x00000011,0x00090019,
+0x00000936,0x00000006,0x00000001,0x00000000,
+0x00000001,0x00000000,0x00000002,0x0000001e,
+0x00040020,0x00000937,0x00000000,0x00000936,
+0x0004003b,0x00000937,0x00000938,0x00000000,
+0x00090019,0x0000094e,0x00000006,0x00000001,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x00000020,0x00040020,0x0000094f,0x00000000,
+0x0000094e,0x0004003b,0x0000094f,0x00000950,
+0x00000000,0x0006002c,0x00000008,0x0000095c,
+0x0000008c,0x0000008c,0x0000009f,0x00050036,
+0x00000002,0x00000004,0x00000000,0x00000003,
+0x000200f8,0x00000005,0x0004003b,0x00000012,
+0x0000091a,0x00000007,0x0004003b,0x00000007,
+0x0000091f,0x00000007,0x0004003b,0x00000012,
+0x0000092a,0x00000007,0x0004003b,0x00000012,
+0x00000930,0x00000007,0x0004003b,0x00000010,
+0x00000935,0x00000007,0x0004003b,0x00000061,
+0x00000941,0x00000007,0x0004003b,0x00000010,
+0x00000945,0x00000007,0x0004003b,0x00000012,
+0x00000947,0x00000007,0x0004003b,0x00000010,
+0x0000094b,0x00000007,0x0004003b,0x00000061,
+0x00000959,0x00000007,0x0004003d,0x00000008,
+0x0000091d,0x0000091c,0x0007004f,0x00000011,
+0x0000091e,0x0000091d,0x0000091d,0x00000000,
+0x00000001,0x0003003e,0x0000091a,0x0000091e,
+0x00050041,0x00000923,0x00000924,0x00000922,
+0x000000ca,0x0004003d,0x00000006,0x00000925,
+0x00000924,0x00050041,0x00000926,0x00000927,
+0x0000091c,0x00000091,0x0004003d,0x00000006,
+0x00000928,0x00000927,0x00050080,0x00000006,
+0x00000929,0x00000925,0x00000928,0x0003003e,
+0x0000091f,0x00000929,0x0004003d,0x00000011,
+0x0000092b,0x0000091a,0x00050041,0x0000092c,
+0x0000092d,0x00000922,0x000000bf,0x0004003d,
+0x00000011,0x0000092e,0x0000092d,0x00050086,
+0x00000011,0x0000092f,0x0000092b,0x0000092e,
+0x0003003e,0x0000092a,0x0000092f,0x0004003d,
+0x00000011,0x00000931,0x0000091a,0x00050041,
+0x0000092c,0x00000932,0x00000922,0x000000bf,
+0x0004003d,0x00000011,0x00000933,0x00000932,
+0x00050089,0x00000011,0x00000934,0x00000931,
+0x00000933,0x0003003e,0x00000930,0x00000934,
+0x0004003d,0x00000936,0x00000939,0x00000938,
+0x0004003d,0x00000011,0x0000093a,0x0000092a,
+0x0004007c,0x0000050d,0x0000093b,0x0000093a,
+0x0004003d,0x00000006,0x0000093c,0x0000091f,
+0x0004007c,0x00000059,0x0000093d,0x0000093c,
+0x00050051,0x00000059,0x0000093e,0x0000093b,
+0x00000000,0x00050051,0x00000059,0x0000093f,
+0x0000093b,0x00000001,0x00060050,0x00000060,
+0x00000940,0x0000093e,0x0000093f,0x0000093d,
+0x0003003e,0x00000941,0x00000940,0x00050039,
+0x00000060,0x00000942,0x00000084,0x00000941,
+0x00050062,0x0000000f,0x00000943,0x00000939,
+0x00000942,0x0009004f,0x0000000f,0x00000944,
+0x00000943,0x00000943,0x00000003,0x00000002,
+0x00000001,0x00000000,0x0003003e,0x00000935,
+0x00000944,0x0004003d,0x0000000f,0x00000946,
+0x00000935,0x0003003e,0x00000945,0x00000946,
+0x00050041,0x0000092c,0x00000948,0x00000922,
+0x000000bf,0x0004003d,0x00000011,0x00000949,
+0x00000948,0x0003003e,0x00000947,0x00000949,
+0x00060039,0x00000002,0x0000094a,0x00000016,
+0x00000945,0x00000947,0x0004003d,0x00000011,
+0x0000094c,0x00000930,0x00050039,0x0000000f,
+0x0000094d,0x00000080,0x0000094c,0x0003003e,
+0x0000094b,0x0000094d,0x0004003d,0x0000094e,
+0x00000951,0x00000950,0x0004003d,0x00000011,
+0x00000952,0x0000091a,0x0004007c,0x0000050d,
+0x00000953,0x00000952,0x0004003d,0x00000006,
+0x00000954,0x0000091f,0x0004007c,0x00000059,
+0x00000955,0x00000954,0x00050051,0x00000059,
+0x00000956,0x00000953,0x00000000,0x00050051,
+0x00000059,0x00000957,0x00000953,0x00000001,
+0x00060050,0x00000060,0x00000958,0x00000956,
+0x00000957,0x00000955,0x0003003e,0x00000959,
+0x00000958,0x00050039,0x00000060,0x0000095a,
+0x00000084,0x00000959,0x0004003d,0x0000000f,
+0x0000095b,0x0000094b,0x00040063,0x00000951,
+0x0000095a,0x0000095b,0x000100fd,0x00010038,
+0x00050036,0x00000006,0x0000000d,0x00000000,
+0x0000000a,0x00030037,0x00000007,0x0000000b,
+0x00030037,0x00000009,0x0000000c,0x000200f8,
+0x0000000e,0x0004003b,0x00000012,0x00000086,
+0x00000007,0x0004003d,0x00000006,0x00000087,
+0x0000000b,0x0004003d,0x00000008,0x00000088,
+0x0000000c,0x0007004f,0x00000011,0x00000089,
+0x00000088,0x00000088,0x00000000,0x00000001,
+0x00050050,0x00000011,0x0000008a,0x00000087,
+0x00000087,0x00050084,0x00000011,0x0000008b,
+0x0000008a,0x00000089,0x00050084,0x00000011,
+0x0000008f,0x0000008b,0x0000008e,0x00050080,
+0x00000011,0x00000093,0x0000008f,0x00000092,
+0x00050086,0x00000011,0x00000097,0x00000093,
+0x00000096,0x0003003e,0x00000086,0x00000097,
+0x0004003d,0x00000006,0x00000098,0x0000000b,
+0x00050041,0x00000007,0x00000099,0x0000000c,
+0x00000091,0x0004003d,0x00000006,0x0000009a,
+0x00000099,0x00050084,0x00000006,0x0000009b,
+0x00000098,0x0000009a,0x00050041,0x00000007,
+0x0000009d,0x00000086,0x0000009c,0x0004003d,
+0x00000006,0x0000009e,0x0000009d,0x00050041,
+0x00000007,0x000000a0,0x00000086,0x0000009f,
+0x0004003d,0x00000006,0x000000a1,0x000000a0,
+0x00050080,0x00000006,0x000000a2,0x0000009e,
+0x000000a1,0x00050080,0x00000006,0x000000a3,
+0x0000009b,0x000000a2,0x000200fe,0x000000a3,
+0x00010038,0x00050036,0x00000002,0x00000016,
+0x00000000,0x00000013,0x00030037,0x00000010,
+0x00000014,0x00030037,0x00000012,0x00000015,
+0x000200f8,0x00000017,0x0004003b,0x00000007,
+0x000000bc,0x00000007,0x0004003b,0x00000007,
+0x000000c2,0x00000007,0x0004003b,0x00000007,
+0x000000c6,0x00000007,0x0004003b,0x00000007,
+0x000000cc,0x00000007,0x0004003b,0x00000007,
+0x000000d1,0x00000007,0x0004003b,0x00000007,
+0x000000d6,0x00000007,0x0004003b,0x00000007,
+0x000000e5,0x00000007,0x0004003b,0x00000162,
+0x00000163,0x00000007,0x0004003b,0x00000007,
+0x00000170,0x00000007,0x0004003b,0x00000009,
+0x00000172,0x00000007,0x0004003d,0x0000000f,
+0x000000a8,0x00000014,0x0003003e,0x000000a7,
+0x000000a8,0x0004003d,0x00000011,0x000000ab,
+0x00000015,0x0003003e,0x000000aa,0x000000ab,
+0x0003003e,0x000000ae,0x000000af,0x00050041,
+0x000000b1,0x000000b2,0x000000a7,0x00000095,
+0x0004003d,0x00000006,0x000000b3,0x000000b2,
+0x000500c7,0x00000006,0x000000b5,0x000000b3,
+0x000000b4,0x000500aa,0x000000ac,0x000000b7,
+0x000000b5,0x000000b6,0x0003003e,0x000000b0,
+0x000000b7,0x0004003d,0x000000ac,0x000000b8,
+0x000000b0,0x000300f7,0x000000ba,0x00000000,
+0x000400fa,0x000000b8,0x000000b9,0x000000ba,
+0x000200f8,0x000000b9,0x000100fd,0x000200f8,
+0x000000ba,0x00050041,0x000000b1,0x000000bd,
+0x000000a7,0x00000095,0x0004003d,0x00000006,
+0x000000be,0x000000bd,0x000600cb,0x00000006,
+0x000000c1,0x000000be,0x000000bf,0x000000c0,
+0x0003003e,0x000000bc,0x000000c1,0x00050041,
+0x000000b1,0x000000c3,0x000000a7,0x00000095,
+0x0004003d,0x00000006,0x000000c4,0x000000c3,
+0x000600cb,0x00000006,0x000000c5,0x000000c4,
+0x000000c0,0x000000c0,0x0003003e,0x000000c2,
+0x000000c5,0x00050041,0x000000b1,0x000000c7,
+0x000000a7,0x00000095,0x0004003d,0x00000006,
+0x000000c8,0x000000c7,0x000600cb,0x00000006,
+0x000000cb,0x000000c8,0x000000c9,0x000000ca,
+0x0003003e,0x000000c6,0x000000cb,0x00050041,
+0x000000b1,0x000000cd,0x000000a7,0x00000095,
+0x0004003d,0x00000006,0x000000ce,0x000000cd,
+0x000600cb,0x00000006,0x000000d0,0x000000ce,
+0x000000cf,0x000000c0,0x0003003e,0x000000cc,
+0x000000d0,0x00050041,0x000000b1,0x000000d2,
+0x000000a7,0x00000095,0x0004003d,0x00000006,
+0x000000d3,0x000000d2,0x000600cb,0x00000006,
+0x000000d5,0x000000d3,0x000000d4,0x000000c0,
+0x0003003e,0x000000d1,0x000000d5,0x00050041,
+0x000000b1,0x000000d7,0x000000a7,0x00000095,
+0x0004003d,0x00000006,0x000000d8,0x000000d7,
+0x000600cb,0x00000006,0x000000da,0x000000d8,
+0x000000d9,0x000000ca,0x0003003e,0x000000d6,
+0x000000da,0x00050041,0x000000b1,0x000000dc,
+0x000000a7,0x00000095,0x0004003d,0x00000006,
+0x000000dd,0x000000dc,0x000600cb,0x00000006,
+0x000000df,0x000000dd,0x000000de,0x000000ca,
+0x000500ab,0x000000ac,0x000000e0,0x000000df,
+0x0000009c,0x0003003e,0x000000db,0x000000e0,
+0x0004003d,0x00000006,0x000000e1,0x000000bc,
+0x000500aa,0x000000ac,0x000000e2,0x000000e1,
+0x0000009c,0x000300f7,0x000000e4,0x00000000,
+0x000400fa,0x000000e2,0x000000e3,0x00000113,
+0x000200f8,0x000000e3,0x0004003d,0x00000006,
+0x000000e6,0x000000c2,0x000500c4,0x00000006,
+0x000000e7,0x000000e6,0x000000ca,0x0004003d,
+0x00000006,0x000000e8,0x000000c6,0x000500c5,
+0x00000006,0x000000e9,0x000000e7,0x000000e8,
+0x0003003e,0x000000e5,0x000000e9,0x0004003d,
+0x00000006,0x000000ea,0x000000d1,0x000300f7,
+0x000000ef,0x00000000,0x000b00fb,0x000000ea,
+0x000000ef,0x00000000,0x000000eb,0x00000001,
+0x000000ec,0x00000002,0x000000ed,0x00000003,
+0x000000ee,0x000200f8,0x000000eb,0x0004003d,
+0x00000006,0x000000f2,0x000000cc,0x00050080,
+0x00000006,0x000000f3,0x000000f2,0x00000091,
+0x00050050,0x00000011,0x000000f4,0x000000f1,
+0x000000f3,0x0003003e,0x000000f0,0x000000f4,
+0x000200f9,0x000000ef,0x000200f8,0x000000ec,
+0x0004003d,0x00000006,0x000000f6,0x000000cc,
+0x00050080,0x00000006,0x000000f7,0x000000f6,
+0x00000091,0x00050050,0x00000011,0x000000f8,
+0x000000f7,0x000000f1,0x0003003e,0x000000f0,
+0x000000f8,0x000200f9,0x000000ef,0x000200f8,
+0x000000ed,0x0004003d,0x00000006,0x000000fa,
+0x000000cc,0x00050080,0x00000006,0x000000fc,
+0x000000fa,0x000000fb,0x00050041,0x000000b1,
+0x000000fd,0x000000a7,0x00000095,0x0004003d,
+0x00000006,0x000000fe,0x000000fd,0x000600cb,
+0x00000006,0x000000ff,0x000000fe,0x000000d9,
+0x000000c0,0x00050080,0x00000006,0x00000100,
+0x000000ff,0x000000fb,0x00050050,0x00000011,
+0x00000101,0x000000fc,0x00000100,0x0003003e,
+0x000000f0,0x00000101,0x0003003e,0x000000db,
+0x000000af,0x0003003e,0x000000d6,0x0000009c,
+0x000200f9,0x000000ef,0x000200f8,0x000000ee,
+0x0004003d,0x00000006,0x00000103,0x000000cc,
+0x000500aa,0x000000ac,0x00000104,0x00000103,
+0x0000009c,0x000300f7,0x00000106,0x00000000,
+0x000400fa,0x00000104,0x00000105,0x00000109,
+0x000200f8,0x00000105,0x0003003e,0x000000f0,
+0x00000108,0x000200f9,0x00000106,0x000200f8,
+0x00000109,0x0004003d,0x00000006,0x0000010a,
+0x000000cc,0x000500aa,0x000000ac,0x0000010b,
+0x0000010a,0x0000009f,0x000300f7,0x0000010d,
+0x00000000,0x000400fa,0x0000010b,0x0000010c,
+0x0000010f,0x000200f8,0x0000010c,0x0003003e,
+0x000000f0,0x0000010e,0x000200f9,0x0000010d,
+0x000200f8,0x0000010f,0x0003003e,0x000000ae,
+0x00000110,0x000100fd,0x000200f8,0x0000010d,
+0x000200f9,0x00000106,0x000200f8,0x00000106,
+0x000200f9,0x000000ef,0x000200f8,0x000000ef,
+0x000200f9,0x000000e4,0x000200f8,0x00000113,
+0x0004003d,0x00000006,0x00000114,0x000000bc,
+0x000500c4,0x00000006,0x00000115,0x00000114,
+0x000000ca,0x0004003d,0x00000006,0x00000116,
+0x000000c6,0x000500c5,0x00000006,0x00000117,
+0x00000115,0x00000116,0x0003003e,0x000000e5,
+0x00000117,0x0004003d,0x00000006,0x00000118,
+0x000000c2,0x000300f7,0x0000011d,0x00000000,
+0x000b00fb,0x00000118,0x0000011d,0x00000000,
+0x00000119,0x00000001,0x0000011a,0x00000002,
+0x0000011b,0x00000003,0x0000011c,0x000200f8,
+0x00000119,0x0004003d,0x00000006,0x0000011e,
+0x000000d1,0x00050080,0x00000006,0x0000011f,
+0x0000011e,0x00000090,0x0004003d,0x00000006,
+0x00000120,0x000000cc,0x00050080,0x00000006,
+0x00000121,0x00000120,0x00000091,0x00050050,
+0x00000011,0x00000122,0x0000011f,0x00000121,
+0x0003003e,0x000000f0,0x00000122,0x000200f9,
+0x0000011d,0x000200f8,0x0000011a,0x0004003d,
+0x00000006,0x00000124,0x000000d1,0x00050080,
+0x00000006,0x00000125,0x00000124,0x0000008c,
+0x0004003d,0x00000006,0x00000126,0x000000cc,
+0x00050080,0x00000006,0x00000127,0x00000126,
+0x00000091,0x00050050,0x00000011,0x00000128,
+0x00000125,0x00000127,0x0003003e,0x000000f0,
+0x00000128,0x000200f9,0x0000011d,0x000200f8,
+0x0000011b,0x0004003d,0x00000006,0x0000012a,
+0x000000cc,0x00050080,0x00000006,0x0000012b,
+0x0000012a,0x00000091,0x0004003d,0x00000006,
+0x0000012c,0x000000d1,0x00050080,0x00000006,
+0x0000012d,0x0000012c,0x0000008c,0x00050050,
+0x00000011,0x0000012e,0x0000012b,0x0000012d,
+0x0003003e,0x000000f0,0x0000012e,0x000200f9,
+0x0000011d,0x000200f8,0x0000011c,0x0004003d,
+0x00000006,0x00000130,0x000000d1,0x000500c2,
+0x00000006,0x00000131,0x00000130,0x000000ca,
+0x000500aa,0x000000ac,0x00000132,0x00000131,
+0x0000009c,0x000300f7,0x00000134,0x00000000,
+0x000400fa,0x00000132,0x00000133,0x0000013b,
+0x000200f8,0x00000133,0x0004003d,0x00000006,
+0x00000135,0x000000cc,0x00050080,0x00000006,
+0x00000136,0x00000135,0x00000091,0x0004003d,
+0x00000006,0x00000137,0x000000d1,0x000500c7,
+0x00000006,0x00000138,0x00000137,0x0000009f,
+0x00050080,0x00000006,0x00000139,0x00000138,
+0x000000fb,0x00050050,0x00000011,0x0000013a,
+0x00000136,0x00000139,0x0003003e,0x000000f0,
+0x0000013a,0x000200f9,0x00000134,0x000200f8,
+0x0000013b,0x0004003d,0x00000006,0x0000013c,
+0x000000d1,0x000500c7,0x00000006,0x0000013d,
+0x0000013c,0x0000009f,0x00050080,0x00000006,
+0x0000013e,0x0000013d,0x00000091,0x0004003d,
+0x00000006,0x0000013f,0x000000cc,0x00050080,
+0x00000006,0x00000140,0x0000013f,0x00000091,
+0x00050050,0x00000011,0x00000141,0x0000013e,
+0x00000140,0x0003003e,0x000000f0,0x00000141,
+0x000200f9,0x00000134,0x000200f8,0x00000134,
+0x000200f9,0x0000011d,0x000200f8,0x0000011d,
+0x000200f9,0x000000e4,0x000200f8,0x000000e4,
+0x0004003d,0x00000011,0x00000143,0x000000f0,
+0x0004003d,0x00000011,0x00000144,0x000000aa,
+0x000500ac,0x00000145,0x00000146,0x00000143,
+0x00000144,0x0004009a,0x000000ac,0x00000147,
+0x00000146,0x000300f7,0x00000149,0x00000000,
+0x000400fa,0x00000147,0x00000148,0x00000149,
+0x000200f8,0x00000148,0x0003003e,0x000000ae,
+0x00000110,0x000100fd,0x000200f8,0x00000149,
+0x0004003d,0x00000006,0x0000015d,0x000000d6,
+0x000500c4,0x00000006,0x0000015f,0x0000015d,
+0x0000015e,0x0004003d,0x00000006,0x00000160,
+0x000000e5,0x000500c5,0x00000006,0x00000161,
+0x0000015f,0x00000160,0x0003003e,0x00000163,
+0x0000015c,0x00050041,0x00000009,0x00000164,
+0x00000163,0x00000161,0x0004003d,0x00000008,
+0x00000165,0x00000164,0x0003003e,0x0000014c,
+0x00000165,0x00050041,0x000000b1,0x00000167,
+0x000000f0,0x0000009c,0x0004003d,0x00000006,
+0x00000168,0x00000167,0x00050041,0x000000b1,
+0x00000169,0x000000f0,0x0000009f,0x0004003d,
+0x00000006,0x0000016a,0x00000169,0x00050084,
+0x00000006,0x0000016b,0x00000168,0x0000016a,
+0x0004003d,0x000000ac,0x0000016c,0x000000db,
+0x000600a9,0x00000059,0x0000016d,0x0000016c,
+0x000000ca,0x000000bf,0x000500c4,0x00000006,
+0x0000016e,0x0000016b,0x0000016d,0x0003003e,
+0x00000166,0x0000016e,0x0004003d,0x00000006,
+0x00000171,0x00000166,0x0003003e,0x00000170,
+0x00000171,0x0004003d,0x00000008,0x00000173,
+0x0000014c,0x0003003e,0x00000172,0x00000173,
+0x00060039,0x00000006,0x00000174,0x0000000d,
+0x00000170,0x00000172,0x0003003e,0x0000016f,
+0x00000174,0x0004003d,0x00000006,0x00000175,
+0x0000016f,0x000500b0,0x000000ac,0x00000177,
+0x00000175,0x00000176,0x0004003d,0x00000006,
+0x00000178,0x0000016f,0x000500ac,0x000000ac,
+0x0000017a,0x00000178,0x00000179,0x000500a6,
+0x000000ac,0x0000017b,0x00000177,0x0000017a,
+0x0004003d,0x00000006,0x0000017c,0x00000166,
+0x000500ac,0x000000ac,0x0000017e,0x0000017c,
+0x0000017d,0x000500a6,0x000000ac,0x0000017f,
+0x0000017b,0x0000017e,0x000300f7,0x00000181,
+0x00000000,0x000400fa,0x0000017f,0x00000180,
+0x00000181,0x000200f8,0x00000180,0x0003003e,
+0x000000ae,0x00000110,0x000100fd,0x000200f8,
+0x00000181,0x00050041,0x000000b1,0x00000184,
+0x000000a7,0x00000095,0x0004003d,0x00000006,
+0x00000185,0x00000184,0x000600cb,0x00000006,
+0x00000187,0x00000185,0x00000186,0x000000c0,
+0x00050080,0x00000006,0x00000188,0x00000187,
+0x0000009f,0x0003003e,0x00000183,0x00000188,
+0x0004003d,0x00000006,0x00000189,0x00000183,
+0x000500ac,0x000000ac,0x0000018a,0x00000189,
+0x0000009f,0x000300f7,0x0000018c,0x00000000,
+0x000400fa,0x0000018a,0x0000018b,0x0000018c,
+0x000200f8,0x0000018b,0x00050041,0x000000b1,
+0x0000018e,0x000000a7,0x00000095,0x0004003d,
+0x00000006,0x0000018f,0x0000018e,0x000600cb,
+0x00000006,0x00000191,0x0000018f,0x00000190,
+0x000000de,0x0003003e,0x0000018d,0x00000191,
+0x000200f9,0x0000018c,0x000200f8,0x0000018c,
+0x0004003d,0x000000ac,0x00000192,0x000000db,
+0x0004003d,0x00000006,0x00000193,0x00000183,
+0x000500aa,0x000000ac,0x00000194,0x00000193,
+0x00000090,0x000500a7,0x000000ac,0x00000195,
+0x00000192,0x00000194,0x000300f7,0x00000197,
+0x00000000,0x000400fa,0x00000195,0x00000196,
+0x00000197,0x000200f8,0x00000196,0x0003003e,
+0x000000ae,0x00000110,0x000100fd,0x000200f8,
+0x00000197,0x000100fd,0x00010038,0x00050036,
+0x00000006,0x0000001c,0x00000000,0x00000018,
+0x00030037,0x00000010,0x00000019,0x00030037,
+0x00000007,0x0000001a,0x00030037,0x00000007,
+0x0000001b,0x000200f8,0x0000001d,0x0004003b,
+0x00000007,0x0000019e,0x00000007,0x0004003b,
+0x00000007,0x000001a3,0x00000007,0x0004003b,
+0x00000007,0x000001aa,0x00000007,0x0004003b,
+0x00000007,0x000001bd,0x00000007,0x0004003b,
+0x00000007,0x000001c0,0x00000007,0x0004003b,
+0x00000007,0x000001c9,0x00000007,0x0004003d,
+0x00000006,0x00000199,0x0000001b,0x000500aa,
+0x000000ac,0x0000019a,0x00000199,0x0000009c,
+0x000300f7,0x0000019c,0x00000000,0x000400fa,
+0x0000019a,0x0000019b,0x0000019c,0x000200f8,
+0x0000019b,0x000200fe,0x0000009c,0x000200f8,
+0x0000019c,0x0004003d,0x00000006,0x0000019f,
+0x0000001a,0x00050086,0x00000006,0x000001a1,
+0x0000019f,0x000001a0,0x00050082,0x00000006,
+0x000001a2,0x00000095,0x000001a1,0x0003003e,
+0x0000019e,0x000001a2,0x0004003d,0x00000006,
+0x000001a4,0x0000001a,0x0004003d,0x00000006,
+0x000001a5,0x0000001b,0x00050080,0x00000006,
+0x000001a6,0x000001a4,0x000001a5,0x00050082,
+0x00000006,0x000001a7,0x000001a6,0x0000009f,
+0x00050086,0x00000006,0x000001a8,0x000001a7,
+0x000001a0,0x00050082,0x00000006,0x000001a9,
+0x00000095,0x000001a8,0x0003003e,0x000001a3,
+0x000001a9,0x0004003d,0x00000006,0x000001ab,
+0x0000001a,0x000500c7,0x00000006,0x000001ad,
+0x000001ab,0x000001ac,0x0003003e,0x000001aa,
+0x000001ad,0x0004003d,0x00000006,0x000001ae,
+0x0000019e,0x0004003d,0x00000006,0x000001af,
+0x000001a3,0x000500aa,0x000000ac,0x000001b0,
+0x000001ae,0x000001af,0x000300f7,0x000001b2,
+0x00000000,0x000400fa,0x000001b0,0x000001b1,
+0x000001bc,0x000200f8,0x000001b1,0x0004003d,
+0x00000006,0x000001b3,0x0000019e,0x00050041,
+0x00000007,0x000001b4,0x00000019,0x000001b3,
+0x0004003d,0x00000006,0x000001b5,0x000001b4,
+0x0004003d,0x00000006,0x000001b6,0x000001aa,
+0x0004007c,0x00000059,0x000001b7,0x000001b6,
+0x0004003d,0x00000006,0x000001b8,0x0000001b,
+0x0004007c,0x00000059,0x000001b9,0x000001b8,
+0x000600cb,0x00000006,0x000001ba,0x000001b5,
+0x000001b7,0x000001b9,0x000200fe,0x000001ba,
+0x000200f8,0x000001bc,0x0004003d,0x00000006,
+0x000001be,0x000001aa,0x00050082,0x00000006,
+0x000001bf,0x000001a0,0x000001be,0x0003003e,
+0x000001bd,0x000001bf,0x0004003d,0x00000006,
+0x000001c1,0x0000019e,0x00050041,0x00000007,
+0x000001c2,0x00000019,0x000001c1,0x0004003d,
+0x00000006,0x000001c3,0x000001c2,0x0004003d,
+0x00000006,0x000001c4,0x000001aa,0x0004007c,
+0x00000059,0x000001c5,0x000001c4,0x0004003d,
+0x00000006,0x000001c6,0x000001bd,0x0004007c,
+0x00000059,0x000001c7,0x000001c6,0x000600cb,
+0x00000006,0x000001c8,0x000001c3,0x000001c5,
+0x000001c7,0x0003003e,0x000001c0,0x000001c8,
+0x0004003d,0x00000006,0x000001ca,0x000001a3,
+0x00050041,0x00000007,0x000001cb,0x00000019,
+0x000001ca,0x0004003d,0x00000006,0x000001cc,
+0x000001cb,0x0004003d,0x00000006,0x000001cd,
+0x0000001b,0x0004003d,0x00000006,0x000001ce,
+0x000001bd,0x00050082,0x00000006,0x000001cf,
+0x000001cd,0x000001ce,0x0004007c,0x00000059,
+0x000001d0,0x000001cf,0x000600cb,0x00000006,
+0x000001d1,0x000001cc,0x000000bf,0x000001d0,
+0x0003003e,0x000001c9,0x000001d1,0x0004003d,
+0x00000006,0x000001d2,0x000001c9,0x0004003d,
+0x00000006,0x000001d3,0x000001bd,0x000500c4,
+0x00000006,0x000001d4,0x000001d2,0x000001d3,
+0x0004003d,0x00000006,0x000001d5,0x000001c0,
+0x000500c5,0x00000006,0x000001d6,0x000001d4,
+0x000001d5,0x000200fe,0x000001d6,0x000200f8,
+0x000001b2,0x000100ff,0x00010038,0x00050036,
+0x00000006,0x00000023,0x00000000,0x0000001e,
+0x00030037,0x00000007,0x0000001f,0x00030037,
+0x00000007,0x00000020,0x00030037,0x00000007,
+0x00000021,0x00030037,0x00000007,0x00000022,
+0x000200f8,0x00000024,0x0004003b,0x00000007,
+0x000001e0,0x00000007,0x0004003b,0x00000007,
+0x000001eb,0x00000007,0x0004003b,0x00000007,
+0x000001f0,0x00000007,0x0004003b,0x00000007,
+0x000001fb,0x00000007,0x0004003b,0x00000007,
+0x00000209,0x00000007,0x0004003b,0x00000007,
+0x00000211,0x00000007,0x0004003b,0x00000010,
+0x00000212,0x00000007,0x0004003b,0x00000007,
+0x00000214,0x00000007,0x0004003b,0x00000007,
+0x00000216,0x00000007,0x0004003b,0x00000007,
+0x00000219,0x00000007,0x0004003b,0x00000007,
+0x0000021e,0x00000007,0x0004003b,0x00000007,
+0x00000226,0x00000007,0x0004003b,0x00000007,
+0x0000023e,0x00000007,0x0004003d,0x00000006,
+0x000001d9,0x00000183,0x000500aa,0x000000ac,
+0x000001da,0x000001d9,0x0000009f,0x000300f7,
+0x000001dc,0x00000000,0x000400fa,0x000001da,
+0x000001db,0x000001ea,0x000200f8,0x000001db,
+0x0004003d,0x00000006,0x000001de,0x0000016f,
+0x00050082,0x00000006,0x000001df,0x000001dd,
+0x000001de,0x0003003e,0x00000020,0x000001df,
+0x00050041,0x000000b1,0x000001e1,0x000000a7,
+0x00000095,0x0004003d,0x00000006,0x000001e2,
+0x000001e1,0x000600cb,0x00000006,0x000001e3,
+0x000001e2,0x00000190,0x000000c9,0x0003003e,
+0x000001e0,0x000001e3,0x0004003d,0x00000006,
+0x000001e4,0x000001e0,0x000500c2,0x00000006,
+0x000001e5,0x000001e4,0x000000c0,0x00050084,
+0x00000006,0x000001e6,0x00000091,0x000001e5,
+0x00050080,0x00000006,0x000001e7,0x000001e6,
+0x00000091,0x0003003e,0x00000021,0x000001e7,
+0x0003003e,0x00000022,0x0000009c,0x0004003d,
+0x00000006,0x000001e8,0x000001e0,0x000200fe,
+0x000001e8,0x000200f8,0x000001ea,0x00050041,
+0x000000b1,0x000001ec,0x000000a7,0x00000095,
+0x0004003d,0x00000006,0x000001ed,0x000001ec,
+0x000600cb,0x00000006,0x000001ef,0x000001ed,
+0x000001ee,0x000000c0,0x0003003e,0x000001eb,
+0x000001ef,0x00050041,0x000000b1,0x000001f1,
+0x000000a7,0x00000095,0x0004003d,0x00000006,
+0x000001f2,0x000001f1,0x000600cb,0x00000006,
+0x000001f4,0x000001f2,0x000001f3,0x000000c9,
+0x0003003e,0x000001f0,0x000001f4,0x0004003d,
+0x00000006,0x000001f5,0x000001eb,0x000500aa,
+0x000000ac,0x000001f6,0x000001f5,0x0000009c,
+0x000300f7,0x000001f8,0x00000000,0x000400fa,
+0x000001f6,0x000001f7,0x00000208,0x000200f8,
+0x000001f7,0x0004003d,0x00000006,0x000001f9,
+0x0000016f,0x00050082,0x00000006,0x000001fa,
+0x000001dd,0x000001f9,0x0003003e,0x00000020,
+0x000001fa,0x0004003d,0x00000006,0x000001fc,
+0x000001f0,0x000500c2,0x00000006,0x000001fd,
+0x000001fc,0x000000c0,0x00050084,0x00000006,
+0x000001fe,0x00000091,0x000001fd,0x00050080,
+0x00000006,0x000001ff,0x000001fe,0x00000091,
+0x0003003e,0x000001fb,0x000001ff,0x0004003d,
+0x00000006,0x00000200,0x000001fb,0x0004003d,
+0x00000006,0x00000201,0x00000183,0x00050084,
+0x00000006,0x00000202,0x00000200,0x00000201,
+0x0003003e,0x00000021,0x00000202,0x0004003d,
+0x00000006,0x00000203,0x000001fb,0x0004003d,
+0x00000006,0x00000204,0x0000001f,0x00050084,
+0x00000006,0x00000205,0x00000203,0x00000204,
+0x0003003e,0x00000022,0x00000205,0x0004003d,
+0x00000006,0x00000206,0x000001f0,0x000200fe,
+0x00000206,0x000200f8,0x00000208,0x0004003d,
+0x00000006,0x0000020a,0x00000183,0x00050084,
+0x00000006,0x0000020b,0x00000095,0x0000020a,
+0x00050082,0x00000006,0x0000020c,0x0000020b,
+0x00000090,0x0003003e,0x00000209,0x0000020c,
+0x0004003d,0x00000006,0x0000020d,0x0000016f,
+0x00050082,0x00000006,0x0000020e,0x000001dd,
+0x0000020d,0x0004003d,0x00000006,0x0000020f,
+0x00000209,0x00050082,0x00000006,0x00000210,
+0x0000020e,0x0000020f,0x0003003e,0x00000020,
+0x00000210,0x0004003d,0x0000000f,0x00000213,
+0x000000a7,0x0003003e,0x00000212,0x00000213,
+0x0004003d,0x00000006,0x00000215,0x00000020,
+0x0003003e,0x00000214,0x00000215,0x0004003d,
+0x00000006,0x00000217,0x00000209,0x0003003e,
+0x00000216,0x00000217,0x00070039,0x00000006,
+0x00000218,0x0000001c,0x00000212,0x00000214,
+0x00000216,0x0003003e,0x00000211,0x00000218,
+0x0004003d,0x00000006,0x0000021a,0x00000211,
+0x000500c4,0x00000006,0x0000021b,0x0000021a,
+0x000000c9,0x0004003d,0x00000006,0x0000021c,
+0x000001f0,0x000500c5,0x00000006,0x0000021d,
+0x0000021b,0x0000021c,0x0003003e,0x00000219,
+0x0000021d,0x0004003d,0x00000006,0x0000021f,
+0x00000219,0x0004003d,0x00000006,0x00000220,
+0x0000001f,0x00050084,0x00000006,0x00000221,
+0x00000091,0x00000220,0x0004003d,0x00000006,
+0x00000222,0x00000183,0x00050080,0x00000006,
+0x00000223,0x00000221,0x00000222,0x0004007c,
+0x00000059,0x00000224,0x00000223,0x000600cb,
+0x00000006,0x00000225,0x0000021f,0x00000224,
+0x000000c0,0x0003003e,0x0000021e,0x00000225,
+0x0004003d,0x00000006,0x00000227,0x00000219,
+0x0004003d,0x00000006,0x00000228,0x00000183,
+0x0004007c,0x00000059,0x00000229,0x00000228,
+0x000600cb,0x00000006,0x0000022a,0x00000227,
+0x000000bf,0x00000229,0x0003003e,0x00000226,
+0x0000022a,0x0004003d,0x00000006,0x0000022b,
+0x000001eb,0x0004003d,0x00000006,0x0000022c,
+0x00000183,0x00050084,0x00000006,0x0000022d,
+0x0000022b,0x0000022c,0x0004003d,0x00000006,
+0x0000022e,0x00000226,0x000400cd,0x00000059,
+0x0000022f,0x0000022e,0x0004007c,0x00000006,
+0x00000230,0x0000022f,0x00050080,0x00000006,
+0x00000231,0x0000022d,0x00000230,0x00050084,
+0x00000006,0x00000232,0x00000091,0x00000231,
+0x0003003e,0x00000021,0x00000232,0x0004003d,
+0x00000006,0x00000233,0x000001eb,0x0004003d,
+0x00000006,0x00000234,0x0000001f,0x00050084,
+0x00000006,0x00000235,0x00000233,0x00000234,
+0x0004003d,0x00000006,0x00000236,0x00000226,
+0x0004003d,0x00000006,0x00000237,0x0000001f,
+0x0004007c,0x00000059,0x00000238,0x00000237,
+0x000600cb,0x00000006,0x00000239,0x00000236,
+0x000000bf,0x00000238,0x000400cd,0x00000059,
+0x0000023a,0x00000239,0x0004007c,0x00000006,
+0x0000023b,0x0000023a,0x00050080,0x00000006,
+0x0000023c,0x00000235,0x0000023b,0x00050084,
+0x00000006,0x0000023d,0x00000091,0x0000023c,
+0x0003003e,0x00000022,0x0000023d,0x0004003d,
+0x00000006,0x0000023f,0x000001eb,0x00050082,
+0x00000006,0x00000240,0x0000023f,0x0000009f,
+0x0004003d,0x00000006,0x00000241,0x00000226,
+0x0004003d,0x00000006,0x00000242,0x0000001f,
+0x0004007c,0x00000059,0x00000243,0x00000242,
+0x000600cb,0x00000006,0x00000244,0x00000241,
+0x00000243,0x000000ca,0x00050080,0x00000006,
+0x00000245,0x00000240,0x00000244,0x0003003e,
+0x0000023e,0x00000245,0x0004003d,0x00000006,
+0x00000246,0x0000023e,0x000500c4,0x00000006,
+0x00000247,0x00000246,0x000000c0,0x0004003d,
+0x00000006,0x00000248,0x0000021e,0x000500c5,
+0x00000006,0x00000249,0x00000247,0x00000248,
+0x000200fe,0x00000249,0x000200f8,0x000001f8,
+0x000100ff,0x000200f8,0x000001dc,0x000100ff,
+0x00010038,0x00050036,0x00000006,0x0000002a,
+0x00000000,0x00000025,0x00030037,0x00000010,
+0x00000026,0x00030037,0x00000007,0x00000027,
+0x00030037,0x00000007,0x00000028,0x00030037,
+0x00000007,0x00000029,0x000200f8,0x0000002b,
+0x0004003b,0x0000024c,0x0000024d,0x00000007,
+0x0004003b,0x00000007,0x00000250,0x00000007,
+0x0004003b,0x00000010,0x00000257,0x00000007,
+0x0004003b,0x00000007,0x00000259,0x00000007,
+0x0004003b,0x00000007,0x0000025a,0x00000007,
+0x0004003b,0x00000007,0x0000025c,0x00000007,
+0x0004003b,0x00000007,0x0000027f,0x00000007,
+0x0004003b,0x00000010,0x00000280,0x00000007,
+0x0004003b,0x00000007,0x00000282,0x00000007,
+0x0004003b,0x00000007,0x00000284,0x00000007,
+0x0004003b,0x0000024c,0x00000288,0x00000007,
+0x0004003b,0x00000007,0x00000296,0x00000007,
+0x0004003b,0x0000037f,0x00000380,0x00000007,
+0x0004003d,0x00000006,0x0000024e,0x00000028,
+0x0004007c,0x00000059,0x0000024f,0x0000024e,
+0x0003003e,0x0000024d,0x0000024f,0x0004003d,
+0x00000006,0x00000251,0x00000027,0x0004003d,
+0x00000006,0x00000252,0x00000028,0x00050080,
+0x00000006,0x00000253,0x00000251,0x00000252,
+0x0004003d,0x00000006,0x00000254,0x00000028,
+0x00050084,0x00000006,0x00000255,0x00000090,
+0x00000254,0x00050080,0x00000006,0x00000256,
+0x00000255,0x0000008c,0x0004003d,0x0000000f,
+0x00000258,0x00000026,0x0003003e,0x00000257,
+0x00000258,0x0003003e,0x00000259,0x00000253,
+0x0003003e,0x0000025a,0x00000256,0x00070039,
+0x00000006,0x0000025b,0x0000001c,0x00000257,
+0x00000259,0x0000025a,0x0003003e,0x00000250,
+0x0000025b,0x0004003d,0x00000006,0x0000025d,
+0x00000250,0x000600cb,0x00000006,0x0000025e,
+0x0000025d,0x000000bf,0x000000c0,0x0004003d,
+0x00000006,0x0000025f,0x00000250,0x0004003d,
+0x00000059,0x00000260,0x0000024d,0x00050084,
+0x00000059,0x00000261,0x000000ca,0x00000260,
+0x00050080,0x00000059,0x00000262,0x00000261,
+0x000000c0,0x000600cb,0x00000006,0x00000263,
+0x0000025f,0x00000262,0x000000c0,0x000500c4,
+0x00000006,0x00000264,0x00000263,0x000000c0,
+0x000500c5,0x00000006,0x00000265,0x0000025e,
+0x00000264,0x0004003d,0x00000006,0x00000266,
+0x00000250,0x0004003d,0x00000059,0x00000267,
+0x0000024d,0x00050084,0x00000059,0x00000268,
+0x000000c0,0x00000267,0x00050080,0x00000059,
+0x00000269,0x00000268,0x000000c9,0x000600cb,
+0x00000006,0x0000026a,0x00000266,0x00000269,
+0x000000ca,0x000500c4,0x00000006,0x0000026b,
+0x0000026a,0x000000c9,0x000500c5,0x00000006,
+0x0000026c,0x00000265,0x0000026b,0x0004003d,
+0x00000006,0x0000026d,0x00000250,0x0004003d,
+0x00000059,0x0000026e,0x0000024d,0x00050084,
+0x00000059,0x0000026f,0x0000015e,0x0000026e,
+0x00050080,0x00000059,0x00000270,0x0000026f,
+0x000000cf,0x000600cb,0x00000006,0x00000271,
+0x0000026d,0x00000270,0x000000c0,0x000500c4,
+0x00000006,0x00000272,0x00000271,0x000000cf,
+0x000500c5,0x00000006,0x00000273,0x0000026c,
+0x00000272,0x0004003d,0x00000006,0x00000274,
+0x00000250,0x0004003d,0x00000059,0x00000275,
+0x0000024d,0x00050084,0x00000059,0x00000276,
+0x000000c9,0x00000275,0x00050080,0x00000059,
+0x00000277,0x00000276,0x000000d4,0x000600cb,
+0x00000006,0x00000278,0x00000274,0x00000277,
+0x000000ca,0x000500c4,0x00000006,0x00000279,
+0x00000278,0x000000d4,0x000500c5,0x00000006,
+0x0000027a,0x00000273,0x00000279,0x0003003e,
+0x0000025c,0x0000027a,0x0004003d,0x00000006,
+0x0000027b,0x00000029,0x000500aa,0x000000ac,
+0x0000027c,0x0000027b,0x0000009c,0x000300f7,
+0x0000027e,0x00000000,0x000400fa,0x0000027c,
+0x0000027d,0x00000287,0x000200f8,0x0000027d,
+0x0004003d,0x0000000f,0x00000281,0x00000026,
+0x0003003e,0x00000280,0x00000281,0x0004003d,
+0x00000006,0x00000283,0x00000027,0x0003003e,
+0x00000282,0x00000283,0x0004003d,0x00000006,
+0x00000285,0x00000028,0x0003003e,0x00000284,
+0x00000285,0x00070039,0x00000006,0x00000286,
+0x0000001c,0x00000280,0x00000282,0x00000284,
+0x0003003e,0x0000027f,0x00000286,0x000200f9,
+0x0000027e,0x000200f8,0x00000287,0x0004003d,
+0x00000006,0x00000289,0x00000029,0x0004007c,
+0x00000059,0x0000028a,0x00000289,0x00050082,
+0x00000059,0x0000028b,0x0000028a,0x000000ca,
+0x0003003e,0x00000288,0x0000028b,0x0004003d,
+0x00000006,0x0000028c,0x00000250,0x0004003d,
+0x00000059,0x0000028d,0x00000288,0x0004003d,
+0x00000059,0x0000028e,0x0000024d,0x00050084,
+0x00000059,0x0000028f,0x0000028d,0x0000028e,
+0x0004003d,0x00000059,0x00000291,0x00000288,
+0x0005004d,0x00000059,0x00000292,0x00000290,
+0x00000291,0x00050080,0x00000059,0x00000293,
+0x0000028f,0x00000292,0x0004003d,0x00000059,
+0x00000294,0x0000024d,0x000600cb,0x00000006,
+0x00000295,0x0000028c,0x00000293,0x00000294,
+0x0003003e,0x0000027f,0x00000295,0x000200f9,
+0x0000027e,0x000200f8,0x0000027e,0x0004003d,
+0x00000006,0x0000037e,0x0000025c,0x0003003e,
+0x00000380,0x0000037d,0x00050041,0x00000007,
+0x00000381,0x00000380,0x0000037e,0x0004003d,
+0x00000006,0x00000382,0x00000381,0x0003003e,
+0x00000296,0x00000382,0x0004003d,0x00000006,
+0x00000383,0x00000296,0x0004003d,0x00000006,
+0x00000384,0x00000029,0x0004007c,0x00000059,
+0x00000385,0x00000384,0x00050084,0x00000059,
+0x00000386,0x000000c0,0x00000385,0x000600cb,
+0x00000006,0x00000387,0x00000383,0x00000386,
+0x000000c0,0x0004003d,0x00000006,0x00000388,
+0x00000028,0x000500c4,0x00000006,0x00000389,
+0x00000387,0x00000388,0x0004003d,0x00000006,
+0x0000038a,0x0000027f,0x000500c5,0x00000006,
+0x0000038b,0x00000389,0x0000038a,0x000200fe,
+0x0000038b,0x00010038,0x00050036,0x00000006,
+0x00000030,0x00000000,0x00000025,0x00030037,
+0x00000010,0x0000002c,0x00030037,0x00000007,
+0x0000002d,0x00030037,0x00000007,0x0000002e,
+0x00030037,0x00000007,0x0000002f,0x000200f8,
+0x00000031,0x0004003b,0x0000024c,0x0000038e,
+0x00000007,0x0004003b,0x00000007,0x00000391,
+0x00000007,0x0004003b,0x00000010,0x00000395,
+0x00000007,0x0004003b,0x00000007,0x00000397,
+0x00000007,0x0004003b,0x00000007,0x00000399,
+0x00000007,0x0004003b,0x00000007,0x0000039b,
+0x00000007,0x0004003b,0x00000007,0x000003ad,
+0x00000007,0x0004003b,0x00000007,0x000003b9,
+0x00000007,0x0004003b,0x000003f0,0x000003f1,
+0x00000007,0x0004003d,0x00000006,0x0000038f,
+0x0000002e,0x0004007c,0x00000059,0x00000390,
+0x0000038f,0x0003003e,0x0000038e,0x00000390,
+0x0004003d,0x00000006,0x00000392,0x0000002e,
+0x00050084,0x00000006,0x00000393,0x00000095,
+0x00000392,0x00050080,0x00000006,0x00000394,
+0x00000393,0x0000008d,0x0004003d,0x0000000f,
+0x00000396,0x0000002c,0x0003003e,0x00000395,
+0x00000396,0x0004003d,0x00000006,0x00000398,
+0x0000002d,0x0003003e,0x00000397,0x00000398,
+0x0003003e,0x00000399,0x00000394,0x00070039,
+0x00000006,0x0000039a,0x0000001c,0x00000395,
+0x00000397,0x00000399,0x0003003e,0x00000391,
+0x0000039a,0x0004003d,0x00000006,0x0000039c,
+0x00000391,0x0004003d,0x00000059,0x0000039d,
+0x0000038e,0x000600cb,0x00000006,0x0000039e,
+0x0000039c,0x0000039d,0x0000015e,0x0004003d,
+0x00000006,0x0000039f,0x00000391,0x0004003d,
+0x00000059,0x000003a0,0x0000038e,0x00050084,
+0x00000059,0x000003a1,0x000000c0,0x000003a0,
+0x00050080,0x00000059,0x000003a2,0x000003a1,
+0x0000015e,0x000600cb,0x00000006,0x000003a3,
+0x0000039f,0x000003a2,0x000000c0,0x000500c4,
+0x00000006,0x000003a4,0x000003a3,0x0000015e,
+0x000500c5,0x00000006,0x000003a5,0x0000039e,
+0x000003a4,0x0004003d,0x00000006,0x000003a6,
+0x00000391,0x0004003d,0x00000059,0x000003a7,
+0x0000038e,0x00050084,0x00000059,0x000003a8,
+0x0000015e,0x000003a7,0x00050080,0x00000059,
+0x000003a9,0x000003a8,0x000000cf,0x000600cb,
+0x00000006,0x000003aa,0x000003a6,0x000003a9,
+0x000000c0,0x000500c4,0x00000006,0x000003ab,
+0x000003aa,0x000000cf,0x000500c5,0x00000006,
+0x000003ac,0x000003a5,0x000003ab,0x0003003e,
+0x0000039b,0x000003ac,0x0004003d,0x00000006,
+0x000003ae,0x00000391,0x0004003d,0x00000006,
+0x000003af,0x0000002f,0x0004007c,0x00000059,
+0x000003b0,0x000003af,0x0004003d,0x00000059,
+0x000003b1,0x0000038e,0x00050084,0x00000059,
+0x000003b2,0x000003b0,0x000003b1,0x0004003d,
+0x00000006,0x000003b4,0x0000002f,0x0005004d,
+0x00000059,0x000003b5,0x000003b3,0x000003b4,
+0x00050080,0x00000059,0x000003b6,0x000003b2,
+0x000003b5,0x0004003d,0x00000059,0x000003b7,
+0x0000038e,0x000600cb,0x00000006,0x000003b8,
+0x000003ae,0x000003b6,0x000003b7,0x0003003e,
+0x000003ad,0x000003b8,0x0004003d,0x00000006,
+0x000003ef,0x0000039b,0x0003003e,0x000003f1,
+0x000003ee,0x00050041,0x00000007,0x000003f2,
+0x000003f1,0x000003ef,0x0004003d,0x00000006,
+0x000003f3,0x000003f2,0x0003003e,0x000003b9,
+0x000003f3,0x0004003d,0x00000006,0x000003f4,
+0x000003b9,0x0004003d,0x00000006,0x000003f5,
+0x0000002f,0x0004007c,0x00000059,0x000003f6,
+0x000003f5,0x00050084,0x00000059,0x000003f7,
+0x0000015e,0x000003f6,0x000600cb,0x00000006,
+0x000003f8,0x000003f4,0x000003f7,0x0000015e,
+0x0004003d,0x00000006,0x000003f9,0x0000002e,
+0x000500c4,0x00000006,0x000003fa,0x000003f8,
+0x000003f9,0x0004003d,0x00000006,0x000003fb,
+0x000003ad,0x000500c5,0x00000006,0x000003fc,
+0x000003fa,0x000003fb,0x000200fe,0x000003fc,
+0x00010038,0x00050036,0x00000006,0x00000037,
+0x00000000,0x00000032,0x00030037,0x00000010,
+0x00000033,0x00030037,0x00000009,0x00000034,
+0x00030037,0x00000007,0x00000035,0x00030037,
+0x00000007,0x00000036,0x000200f8,0x00000038,
+0x0004003b,0x00000007,0x00000405,0x00000007,
+0x0004003b,0x00000007,0x0000040d,0x00000007,
+0x0004003b,0x00000007,0x00000414,0x00000007,
+0x0004003b,0x00000010,0x00000417,0x00000007,
+0x0004003b,0x00000007,0x00000419,0x00000007,
+0x0004003b,0x00000007,0x0000041b,0x00000007,
+0x0004003b,0x00000007,0x0000041d,0x00000007,
+0x0004003b,0x00000435,0x00000436,0x00000007,
+0x0004003b,0x00000007,0x00000440,0x00000007,
+0x0004003b,0x00000007,0x00000447,0x00000007,
+0x0004003b,0x00000010,0x0000044a,0x00000007,
+0x0004003b,0x00000007,0x0000044c,0x00000007,
+0x0004003b,0x00000007,0x0000044e,0x00000007,
+0x0004003b,0x00000007,0x00000450,0x00000007,
+0x0004003b,0x00000463,0x00000464,0x00000007,
+0x0004003b,0x00000007,0x00000469,0x00000007,
+0x0004003b,0x00000007,0x0000046d,0x00000007,
+0x0004003b,0x00000010,0x0000046e,0x00000007,
+0x0004003b,0x00000007,0x00000470,0x00000007,
+0x0004003b,0x00000007,0x00000472,0x00000007,
+0x0004003b,0x00000012,0x00000475,0x00000007,
+0x0004003b,0x00000480,0x00000481,0x00000007,
+0x0004003d,0x00000006,0x000003ff,0x00000036,
+0x0004003d,0x00000006,0x00000400,0x00000035,
+0x000500ae,0x000000ac,0x00000401,0x000003ff,
+0x00000400,0x000300f7,0x00000403,0x00000000,
+0x000400fa,0x00000401,0x00000402,0x00000403,
+0x000200f8,0x00000402,0x000200fe,0x0000009c,
+0x000200f8,0x00000403,0x00050041,0x00000007,
+0x00000406,0x00000034,0x00000091,0x0004003d,
+0x00000006,0x00000407,0x00000406,0x0003003e,
+0x00000405,0x00000407,0x00050041,0x00000007,
+0x00000408,0x00000034,0x0000009c,0x0004003d,
+0x00000006,0x00000409,0x00000408,0x000500aa,
+0x000000ac,0x0000040a,0x00000409,0x0000009f,
+0x000300f7,0x0000040c,0x00000000,0x000400fa,
+0x0000040a,0x0000040b,0x0000043a,0x000200f8,
+0x0000040b,0x0004003d,0x00000006,0x0000040e,
+0x00000036,0x00050086,0x00000006,0x0000040f,
+0x0000040e,0x00000094,0x0004003d,0x00000006,
+0x00000410,0x00000405,0x00050084,0x00000006,
+0x00000411,0x00000094,0x00000410,0x00050080,
+0x00000006,0x00000412,0x00000411,0x0000008c,
+0x00050084,0x00000006,0x00000413,0x0000040f,
+0x00000412,0x0003003e,0x0000040d,0x00000413,
+0x0004003d,0x00000006,0x00000415,0x00000036,
+0x00050089,0x00000006,0x00000416,0x00000415,
+0x00000094,0x0004003d,0x0000000f,0x00000418,
+0x00000033,0x0003003e,0x00000417,0x00000418,
+0x0004003d,0x00000006,0x0000041a,0x0000040d,
+0x0003003e,0x00000419,0x0000041a,0x0004003d,
+0x00000006,0x0000041c,0x00000405,0x0003003e,
+0x0000041b,0x0000041c,0x0003003e,0x0000041d,
+0x00000416,0x00080039,0x00000006,0x0000041e,
+0x0000002a,0x00000417,0x00000419,0x0000041b,
+0x0000041d,0x0003003e,0x00000414,0x0000041e,
+0x0004003d,0x00000006,0x0000042e,0x00000405,
+0x000500c4,0x00000059,0x0000042f,0x000000ca,
+0x0000042e,0x00050082,0x00000059,0x00000430,
+0x0000042f,0x000000ca,0x00050084,0x00000059,
+0x00000431,0x0000015e,0x00000430,0x0004007c,
+0x00000006,0x00000432,0x00000431,0x0004003d,
+0x00000006,0x00000433,0x00000414,0x00050080,
+0x00000006,0x00000434,0x00000432,0x00000433,
+0x0003003e,0x00000436,0x0000042d,0x00050041,
+0x00000007,0x00000437,0x00000436,0x00000434,
+0x0004003d,0x00000006,0x00000438,0x00000437,
+0x000200fe,0x00000438,0x000200f8,0x0000043a,
+0x00050041,0x00000007,0x0000043b,0x00000034,
+0x0000009f,0x0004003d,0x00000006,0x0000043c,
+0x0000043b,0x000500aa,0x000000ac,0x0000043d,
+0x0000043c,0x0000009f,0x000300f7,0x0000043f,
+0x00000000,0x000400fa,0x0000043d,0x0000043e,
+0x00000468,0x000200f8,0x0000043e,0x0004003d,
+0x00000006,0x00000441,0x00000036,0x00050086,
+0x00000006,0x00000442,0x00000441,0x00000095,
+0x0004003d,0x00000006,0x00000443,0x00000405,
+0x00050084,0x00000006,0x00000444,0x00000095,
+0x00000443,0x00050080,0x00000006,0x00000445,
+0x00000444,0x0000008d,0x00050084,0x00000006,
+0x00000446,0x00000442,0x00000445,0x0003003e,
+0x00000440,0x00000446,0x0004003d,0x00000006,
+0x00000448,0x00000036,0x00050089,0x00000006,
+0x00000449,0x00000448,0x00000095,0x0004003d,
+0x0000000f,0x0000044b,0x00000033,0x0003003e,
+0x0000044a,0x0000044b,0x0004003d,0x00000006,
+0x0000044d,0x00000440,0x0003003e,0x0000044c,
+0x0000044d,0x0004003d,0x00000006,0x0000044f,
+0x00000405,0x0003003e,0x0000044e,0x0000044f,
+0x0003003e,0x00000450,0x00000449,0x00080039,
+0x00000006,0x00000451,0x00000030,0x0000044a,
+0x0000044c,0x0000044e,0x00000450,0x0003003e,
+0x00000447,0x00000451,0x0004003d,0x00000006,
+0x0000045c,0x00000405,0x000500c4,0x00000059,
+0x0000045d,0x000000ca,0x0000045c,0x00050082,
+0x00000059,0x0000045e,0x0000045d,0x000000ca,
+0x00050084,0x00000059,0x0000045f,0x000000cf,
+0x0000045e,0x0004007c,0x00000006,0x00000460,
+0x0000045f,0x0004003d,0x00000006,0x00000461,
+0x00000447,0x00050080,0x00000006,0x00000462,
+0x00000460,0x00000461,0x0003003e,0x00000464,
+0x0000045b,0x00050041,0x00000007,0x00000465,
+0x00000464,0x00000462,0x0004003d,0x00000006,
+0x00000466,0x00000465,0x000200fe,0x00000466,
+0x000200f8,0x00000468,0x0004003d,0x00000006,
+0x0000046a,0x00000036,0x0004003d,0x00000006,
+0x0000046b,0x00000405,0x00050084,0x00000006,
+0x0000046c,0x0000046a,0x0000046b,0x0003003e,
+0x00000469,0x0000046c,0x0004003d,0x0000000f,
+0x0000046f,0x00000033,0x0003003e,0x0000046e,
+0x0000046f,0x0004003d,0x00000006,0x00000471,
+0x00000469,0x0003003e,0x00000470,0x00000471,
+0x0004003d,0x00000006,0x00000473,0x00000405,
+0x0003003e,0x00000472,0x00000473,0x00070039,
+0x00000006,0x00000474,0x0000001c,0x0000046e,
+0x00000470,0x00000472,0x0003003e,0x0000046d,
+0x00000474,0x0004003d,0x00000006,0x0000047e,
+0x00000405,0x00050082,0x00000006,0x0000047f,
+0x0000047e,0x0000009f,0x0003003e,0x00000481,
+0x0000047d,0x00050041,0x00000012,0x00000482,
+0x00000481,0x0000047f,0x0004003d,0x00000011,
+0x00000483,0x00000482,0x0003003e,0x00000475,
+0x00000483,0x0004003d,0x00000006,0x00000484,
+0x0000046d,0x00050041,0x00000007,0x00000485,
+0x00000475,0x0000009c,0x0004003d,0x00000006,
+0x00000486,0x00000485,0x00050084,0x00000006,
+0x00000487,0x00000484,0x00000486,0x0004003d,
+0x00000006,0x00000488,0x0000046d,0x00050041,
+0x00000007,0x00000489,0x00000475,0x0000009f,
+0x0004003d,0x00000006,0x0000048a,0x00000489,
+0x000500c2,0x00000006,0x0000048b,0x00000488,
+0x0000048a,0x000500c5,0x00000006,0x0000048c,
+0x00000487,0x0000048b,0x0003003e,0x0000046d,
+0x0000048c,0x0004003d,0x00000006,0x0000048d,
+0x0000046d,0x000500ac,0x000000ac,0x0000048e,
+0x0000048d,0x000001a0,0x000300f7,0x00000490,
+0x00000000,0x000400fa,0x0000048e,0x0000048f,
+0x00000490,0x000200f8,0x0000048f,0x0004003d,
+0x00000006,0x00000491,0x0000046d,0x00050080,
+0x00000006,0x00000492,0x00000491,0x0000009f,
+0x0003003e,0x0000046d,0x00000492,0x000200f9,
+0x00000490,0x000200f8,0x00000490,0x0004003d,
+0x00000006,0x00000493,0x0000046d,0x000200fe,
+0x00000493,0x000200f8,0x0000043f,0x000100ff,
+0x000200f8,0x0000040c,0x000100ff,0x00010038,
+0x00050036,0x00000006,0x00000042,0x00000000,
+0x00000039,0x00030037,0x00000010,0x0000003a,
+0x00030037,0x00000009,0x0000003b,0x00030037,
+0x00000007,0x0000003c,0x00030037,0x00000007,
+0x0000003d,0x00030037,0x00000007,0x0000003e,
+0x00030037,0x00000007,0x0000003f,0x00030037,
+0x00000007,0x00000040,0x00030037,0x00000012,
+0x00000041,0x000200f8,0x00000043,0x0004003b,
+0x00000010,0x00000496,0x00000007,0x0004003b,
+0x00000010,0x000004a4,0x00000007,0x0004003b,
+0x00000010,0x000004a5,0x00000007,0x0004003b,
+0x00000009,0x000004a7,0x00000007,0x0004003b,
+0x00000007,0x000004a9,0x00000007,0x0004003b,
+0x00000007,0x000004ab,0x00000007,0x0004003b,
+0x00000010,0x000004af,0x00000007,0x0004003b,
+0x00000009,0x000004b1,0x00000007,0x0004003b,
+0x00000007,0x000004b3,0x00000007,0x0004003b,
+0x00000007,0x000004b5,0x00000007,0x0004003b,
+0x00000010,0x000004b9,0x00000007,0x0004003b,
+0x00000009,0x000004bb,0x00000007,0x0004003b,
+0x00000007,0x000004bd,0x00000007,0x0004003b,
+0x00000007,0x000004bf,0x00000007,0x0004003b,
+0x00000010,0x000004c3,0x00000007,0x0004003b,
+0x00000009,0x000004c5,0x00000007,0x0004003b,
+0x00000007,0x000004c7,0x00000007,0x0004003b,
+0x00000007,0x000004c9,0x00000007,0x0004003b,
+0x00000007,0x000004ce,0x00000007,0x0004003b,
+0x00000010,0x000004d6,0x00000007,0x0004003d,
+0x00000006,0x00000497,0x0000003f,0x0004003d,
+0x00000006,0x00000498,0x0000003d,0x00070050,
+0x0000000f,0x00000499,0x00000498,0x00000498,
+0x00000498,0x00000498,0x0004003d,0x00000006,
+0x0000049a,0x0000003e,0x0004003d,0x00000006,
+0x0000049b,0x0000003e,0x00050080,0x00000006,
+0x0000049c,0x0000049b,0x0000009f,0x00070050,
+0x0000000f,0x0000049d,0x0000009c,0x0000009f,
+0x0000049a,0x0000049c,0x00050080,0x0000000f,
+0x0000049e,0x00000499,0x0000049d,0x00070050,
+0x0000000f,0x0000049f,0x00000497,0x00000497,
+0x00000497,0x00000497,0x00050084,0x0000000f,
+0x000004a0,0x0000049f,0x0000049e,0x0004003d,
+0x00000006,0x000004a1,0x00000040,0x00070050,
+0x0000000f,0x000004a2,0x000004a1,0x000004a1,
+0x000004a1,0x000004a1,0x00050080,0x0000000f,
+0x000004a3,0x000004a0,0x000004a2,0x0003003e,
+0x00000496,0x000004a3,0x0004003d,0x0000000f,
+0x000004a6,0x0000003a,0x0003003e,0x000004a5,
+0x000004a6,0x0004003d,0x00000008,0x000004a8,
+0x0000003b,0x0003003e,0x000004a7,0x000004a8,
+0x0004003d,0x00000006,0x000004aa,0x0000003c,
+0x0003003e,0x000004a9,0x000004aa,0x00050041,
+0x00000007,0x000004ac,0x00000496,0x0000009c,
+0x0004003d,0x00000006,0x000004ad,0x000004ac,
+0x0003003e,0x000004ab,0x000004ad,0x00080039,
+0x00000006,0x000004ae,0x00000037,0x000004a5,
+0x000004a7,0x000004a9,0x000004ab,0x0004003d,
+0x0000000f,0x000004b0,0x0000003a,0x0003003e,
+0x000004af,0x000004b0,0x0004003d,0x00000008,
+0x000004b2,0x0000003b,0x0003003e,0x000004b1,
+0x000004b2,0x0004003d,0x00000006,0x000004b4,
+0x0000003c,0x0003003e,0x000004b3,0x000004b4,
+0x00050041,0x00000007,0x000004b6,0x00000496,
+0x0000009f,0x0004003d,0x00000006,0x000004b7,
+0x000004b6,0x0003003e,0x000004b5,0x000004b7,
+0x00080039,0x00000006,0x000004b8,0x00000037,
+0x000004af,0x000004b1,0x000004b3,0x000004b5,
+0x0004003d,0x0000000f,0x000004ba,0x0000003a,
+0x0003003e,0x000004b9,0x000004ba,0x0004003d,
+0x00000008,0x000004bc,0x0000003b,0x0003003e,
+0x000004bb,0x000004bc,0x0004003d,0x00000006,
+0x000004be,0x0000003c,0x0003003e,0x000004bd,
+0x000004be,0x00050041,0x00000007,0x000004c0,
+0x00000496,0x00000091,0x0004003d,0x00000006,
+0x000004c1,0x000004c0,0x0003003e,0x000004bf,
+0x000004c1,0x00080039,0x00000006,0x000004c2,
+0x00000037,0x000004b9,0x000004bb,0x000004bd,
+0x000004bf,0x0004003d,0x0000000f,0x000004c4,
+0x0000003a,0x0003003e,0x000004c3,0x000004c4,
+0x0004003d,0x00000008,0x000004c6,0x0000003b,
+0x0003003e,0x000004c5,0x000004c6,0x0004003d,
+0x00000006,0x000004c8,0x0000003c,0x0003003e,
+0x000004c7,0x000004c8,0x00050041,0x00000007,
+0x000004ca,0x00000496,0x00000095,0x0004003d,
+0x00000006,0x000004cb,0x000004ca,0x0003003e,
+0x000004c9,0x000004cb,0x00080039,0x00000006,
+0x000004cc,0x00000037,0x000004c3,0x000004c5,
+0x000004c7,0x000004c9,0x00070050,0x0000000f,
+0x000004cd,0x000004ae,0x000004b8,0x000004c2,
+0x000004cc,0x0003003e,0x000004a4,0x000004cd,
+0x00050041,0x00000007,0x000004cf,0x00000041,
+0x0000009c,0x0004003d,0x00000006,0x000004d0,
+0x000004cf,0x00050041,0x00000007,0x000004d1,
+0x00000041,0x0000009f,0x0004003d,0x00000006,
+0x000004d2,0x000004d1,0x00050084,0x00000006,
+0x000004d3,0x000004d0,0x000004d2,0x00050080,
+0x00000006,0x000004d4,0x000004d3,0x0000008c,
+0x000500c2,0x00000006,0x000004d5,0x000004d4,
+0x000000c9,0x0003003e,0x000004ce,0x000004d5,
+0x00050041,0x00000007,0x000004d7,0x00000041,
+0x0000009c,0x0004003d,0x00000006,0x000004d8,
+0x000004d7,0x00050082,0x00000006,0x000004d9,
+0x0000014d,0x000004d8,0x00050041,0x00000007,
+0x000004da,0x00000041,0x0000009f,0x0004003d,
+0x00000006,0x000004db,0x000004da,0x00050082,
+0x00000006,0x000004dc,0x000004d9,0x000004db,
+0x0004003d,0x00000006,0x000004dd,0x000004ce,
+0x00050080,0x00000006,0x000004de,0x000004dc,
+0x000004dd,0x00050041,0x00000007,0x000004df,
+0x00000041,0x0000009c,0x0004003d,0x00000006,
+0x000004e0,0x000004df,0x0004003d,0x00000006,
+0x000004e1,0x000004ce,0x00050082,0x00000006,
+0x000004e2,0x000004e0,0x000004e1,0x00050041,
+0x00000007,0x000004e3,0x00000041,0x0000009f,
+0x0004003d,0x00000006,0x000004e4,0x000004e3,
+0x0004003d,0x00000006,0x000004e5,0x000004ce,
+0x00050082,0x00000006,0x000004e6,0x000004e4,
+0x000004e5,0x0004003d,0x00000006,0x000004e7,
+0x000004ce,0x00070050,0x0000000f,0x000004e8,
+0x000004de,0x000004e2,0x000004e6,0x000004e7,
+0x0003003e,0x000004d6,0x000004e8,0x0004003d,
+0x0000000f,0x000004e9,0x000004a4,0x00040070,
+0x000004eb,0x000004ec,0x000004e9,0x0004003d,
+0x0000000f,0x000004ed,0x000004d6,0x00040070,
+0x000004eb,0x000004ee,0x000004ed,0x00050094,
+0x000004ea,0x000004ef,0x000004ec,0x000004ee,
+0x00050081,0x000004ea,0x000004f1,0x000004ef,
+0x000004f0,0x0004006d,0x00000006,0x000004f2,
+0x000004f1,0x000500c2,0x00000006,0x000004f3,
+0x000004f2,0x000000c9,0x000200fe,0x000004f3,
+0x00010038,0x00050036,0x00000011,0x00000047,
+0x00000000,0x00000044,0x00030037,0x00000010,
+0x00000045,0x00030037,0x00000011,0x00000046,
+0x000200f8,0x00000048,0x0004003b,0x00000012,
+0x000004f6,0x00000007,0x0004003b,0x00000012,
+0x00000501,0x00000007,0x0004003b,0x00000012,
+0x00000504,0x00000007,0x0004003b,0x00000012,
+0x00000510,0x00000007,0x0004003b,0x00000012,
+0x00000514,0x00000007,0x0004003b,0x00000007,
+0x00000519,0x00000007,0x0004003b,0x00000007,
+0x0000051c,0x00000007,0x0004003b,0x00000012,
+0x00000524,0x00000007,0x0004003b,0x00000010,
+0x0000052a,0x00000007,0x0004003b,0x00000009,
+0x0000052c,0x00000007,0x0004003b,0x00000007,
+0x0000052e,0x00000007,0x0004003b,0x00000007,
+0x00000530,0x00000007,0x0004003b,0x00000007,
+0x00000532,0x00000007,0x0004003b,0x00000007,
+0x00000534,0x00000007,0x0004003b,0x00000007,
+0x00000535,0x00000007,0x0004003b,0x00000012,
+0x00000536,0x00000007,0x0004003b,0x00000010,
+0x0000053d,0x00000007,0x0004003b,0x00000009,
+0x0000053f,0x00000007,0x0004003b,0x00000007,
+0x00000541,0x00000007,0x0004003b,0x00000007,
+0x00000543,0x00000007,0x0004003b,0x00000007,
+0x00000545,0x00000007,0x0004003b,0x00000007,
+0x00000547,0x00000007,0x0004003b,0x00000007,
+0x00000548,0x00000007,0x0004003b,0x00000012,
+0x00000549,0x00000007,0x0004003d,0x00000011,
+0x000004f8,0x000000aa,0x00050050,0x00000011,
+0x000004f9,0x00000091,0x00000091,0x00050086,
+0x00000011,0x000004fa,0x000004f8,0x000004f9,
+0x00050050,0x00000011,0x000004fb,0x000004f7,
+0x000004f7,0x00050080,0x00000011,0x000004fc,
+0x000004fb,0x000004fa,0x0004003d,0x00000011,
+0x000004fd,0x000000aa,0x00050050,0x00000011,
+0x000004fe,0x0000009f,0x0000009f,0x00050082,
+0x00000011,0x000004ff,0x000004fd,0x000004fe,
+0x00050086,0x00000011,0x00000500,0x000004fc,
+0x000004ff,0x0003003e,0x000004f6,0x00000500,
+0x0004003d,0x00000011,0x00000502,0x000004f6,
+0x00050084,0x00000011,0x00000503,0x00000046,
+0x00000502,0x0003003e,0x00000501,0x00000503,
+0x0004003d,0x00000011,0x00000505,0x00000501,
+0x0004003d,0x00000011,0x00000506,0x000000f0,
+0x00050050,0x00000011,0x00000507,0x0000009f,
+0x0000009f,0x00050082,0x00000011,0x00000508,
+0x00000506,0x00000507,0x00050084,0x00000011,
+0x00000509,0x00000505,0x00000508,0x00050050,
+0x00000011,0x0000050a,0x000001a0,0x000001a0,
+0x00050080,0x00000011,0x0000050b,0x00000509,
+0x0000050a,0x00050050,0x0000050d,0x0000050e,
+0x0000050c,0x0000050c,0x000500c2,0x00000011,
+0x0000050f,0x0000050b,0x0000050e,0x0003003e,
+0x00000504,0x0000050f,0x0004003d,0x00000011,
+0x00000511,0x00000504,0x00050050,0x0000050d,
+0x00000512,0x000000c9,0x000000c9,0x000500c2,
+0x00000011,0x00000513,0x00000511,0x00000512,
+0x0003003e,0x00000510,0x00000513,0x0004003d,
+0x00000011,0x00000515,0x00000504,0x00050050,
+0x00000011,0x00000517,0x00000516,0x00000516,
+0x000500c7,0x00000011,0x00000518,0x00000515,
+0x00000517,0x0003003e,0x00000514,0x00000518,
+0x00050041,0x000000b1,0x0000051a,0x000000f0,
+0x0000009c,0x0004003d,0x00000006,0x0000051b,
+0x0000051a,0x0003003e,0x00000519,0x0000051b,
+0x00050041,0x00000007,0x0000051d,0x00000510,
+0x0000009f,0x0004003d,0x00000006,0x0000051e,
+0x0000051d,0x0004003d,0x00000006,0x0000051f,
+0x00000519,0x00050084,0x00000006,0x00000520,
+0x0000051e,0x0000051f,0x00050041,0x00000007,
+0x00000521,0x00000510,0x0000009c,0x0004003d,
+0x00000006,0x00000522,0x00000521,0x00050080,
+0x00000006,0x00000523,0x00000520,0x00000522,
+0x0003003e,0x0000051c,0x00000523,0x0003003e,
+0x00000524,0x00000525,0x0004003d,0x000000ac,
+0x00000526,0x000000db,0x000600a9,0x00000059,
+0x00000527,0x00000526,0x000000ca,0x000000bf,
+0x000500c4,0x00000059,0x00000528,0x000000ca,
+0x00000527,0x0004007c,0x00000006,0x00000529,
+0x00000528,0x0004003d,0x0000000f,0x0000052b,
+0x00000045,0x0003003e,0x0000052a,0x0000052b,
+0x0004003d,0x00000008,0x0000052d,0x0000014c,
+0x0003003e,0x0000052c,0x0000052d,0x0004003d,
+0x00000006,0x0000052f,0x00000166,0x0003003e,
+0x0000052e,0x0000052f,0x0004003d,0x00000006,
+0x00000531,0x0000051c,0x0003003e,0x00000530,
+0x00000531,0x0004003d,0x00000006,0x00000533,
+0x00000519,0x0003003e,0x00000532,0x00000533,
+0x0003003e,0x00000534,0x00000529,0x0003003e,
+0x00000535,0x0000009c,0x0004003d,0x00000011,
+0x00000537,0x00000514,0x0003003e,0x00000536,
+0x00000537,0x000c0039,0x00000006,0x00000538,
+0x00000042,0x0000052a,0x0000052c,0x0000052e,
+0x00000530,0x00000532,0x00000534,0x00000535,
+0x00000536,0x00050041,0x00000007,0x00000539,
+0x00000524,0x0000009c,0x0003003e,0x00000539,
+0x00000538,0x0004003d,0x000000ac,0x0000053a,
+0x000000db,0x000300f7,0x0000053c,0x00000000,
+0x000400fa,0x0000053a,0x0000053b,0x0000053c,
+0x000200f8,0x0000053b,0x0004003d,0x0000000f,
+0x0000053e,0x00000045,0x0003003e,0x0000053d,
+0x0000053e,0x0004003d,0x00000008,0x00000540,
+0x0000014c,0x0003003e,0x0000053f,0x00000540,
+0x0004003d,0x00000006,0x00000542,0x00000166,
+0x0003003e,0x00000541,0x00000542,0x0004003d,
+0x00000006,0x00000544,0x0000051c,0x0003003e,
+0x00000543,0x00000544,0x0004003d,0x00000006,
+0x00000546,0x00000519,0x0003003e,0x00000545,
+0x00000546,0x0003003e,0x00000547,0x00000091,
+0x0003003e,0x00000548,0x0000009f,0x0004003d,
+0x00000011,0x0000054a,0x00000514,0x0003003e,
+0x00000549,0x0000054a,0x000c0039,0x00000006,
+0x0000054b,0x00000042,0x0000053d,0x0000053f,
+0x00000541,0x00000543,0x00000545,0x00000547,
+0x00000548,0x00000549,0x00050041,0x00000007,
+0x0000054c,0x00000524,0x0000009f,0x0003003e,
+0x0000054c,0x0000054b,0x000200f9,0x0000053c,
+0x000200f8,0x0000053c,0x0004003d,0x00000011,
+0x0000054d,0x00000524,0x000200fe,0x0000054d,
+0x00010038,0x00050036,0x00000006,0x0000004b,
+0x00000000,0x00000049,0x00030037,0x00000007,
+0x0000004a,0x000200f8,0x0000004c,0x0004003d,
+0x00000006,0x00000550,0x0000004a,0x000500c2,
+0x00000006,0x00000552,0x00000550,0x00000551,
+0x0004003d,0x00000006,0x00000553,0x0000004a,
+0x000500c6,0x00000006,0x00000554,0x00000553,
+0x00000552,0x0003003e,0x0000004a,0x00000554,
+0x0004003d,0x00000006,0x00000555,0x0000004a,
+0x000500c4,0x00000006,0x00000557,0x00000555,
+0x00000556,0x0004003d,0x00000006,0x00000558,
+0x0000004a,0x00050082,0x00000006,0x00000559,
+0x00000558,0x00000557,0x0003003e,0x0000004a,
+0x00000559,0x0004003d,0x00000006,0x0000055a,
+0x0000004a,0x000500c4,0x00000006,0x0000055b,
+0x0000055a,0x000000d4,0x0004003d,0x00000006,
+0x0000055c,0x0000004a,0x00050080,0x00000006,
+0x0000055d,0x0000055c,0x0000055b,0x0003003e,
+0x0000004a,0x0000055d,0x0004003d,0x00000006,
+0x0000055e,0x0000004a,0x000500c4,0x00000006,
+0x0000055f,0x0000055e,0x000000c9,0x0004003d,
+0x00000006,0x00000560,0x0000004a,0x00050080,
+0x00000006,0x00000561,0x00000560,0x0000055f,
+0x0003003e,0x0000004a,0x00000561,0x0004003d,
+0x00000006,0x00000562,0x0000004a,0x000500c2,
+0x00000006,0x00000563,0x00000562,0x000000cf,
+0x0004003d,0x00000006,0x00000564,0x0000004a,
+0x000500c6,0x00000006,0x00000565,0x00000564,
+0x00000563,0x0003003e,0x0000004a,0x00000565,
+0x0004003d,0x00000006,0x00000566,0x0000004a,
+0x000500c4,0x00000006,0x00000568,0x00000566,
+0x00000567,0x0004003d,0x00000006,0x00000569,
+0x0000004a,0x00050080,0x00000006,0x0000056a,
+0x00000569,0x00000568,0x0003003e,0x0000004a,
+0x0000056a,0x0004003d,0x00000006,0x0000056b,
+0x0000004a,0x000500c2,0x00000006,0x0000056c,
+0x0000056b,0x000000d4,0x0004003d,0x00000006,
+0x0000056d,0x0000004a,0x000500c6,0x00000006,
+0x0000056e,0x0000056d,0x0000056c,0x0003003e,
+0x0000004a,0x0000056e,0x0004003d,0x00000006,
+0x0000056f,0x0000004a,0x000500c2,0x00000006,
+0x00000570,0x0000056f,0x0000015e,0x0004003d,
+0x00000006,0x00000571,0x0000004a,0x000500c6,
+0x00000006,0x00000572,0x00000571,0x00000570,
+0x0003003e,0x0000004a,0x00000572,0x0004003d,
+0x00000006,0x00000573,0x0000004a,0x000500c4,
+0x00000006,0x00000574,0x00000573,0x0000050c,
+0x0004003d,0x00000006,0x00000575,0x0000004a,
+0x000500c6,0x00000006,0x00000576,0x00000575,
+0x00000574,0x0003003e,0x0000004a,0x00000576,
+0x0004003d,0x00000006,0x00000577,0x0000004a,
+0x000500c2,0x00000006,0x00000578,0x00000577,
+0x00000556,0x0004003d,0x00000006,0x00000579,
+0x0000004a,0x000500c6,0x00000006,0x0000057a,
+0x00000579,0x00000578,0x0003003e,0x0000004a,
+0x0000057a,0x0004003d,0x00000006,0x0000057b,
+0x0000004a,0x000200fe,0x0000057b,0x00010038,
+0x00050036,0x00000006,0x00000051,0x00000000,
+0x0000004d,0x00030037,0x00000007,0x0000004e,
+0x00030037,0x00000012,0x0000004f,0x00030037,
+0x00000007,0x00000050,0x000200f8,0x00000052,
+0x0004003b,0x00000007,0x00000593,0x00000007,
+0x0004003b,0x00000007,0x00000594,0x00000007,
+0x0004003b,0x00000010,0x00000597,0x00000007,
+0x0004003b,0x00000010,0x000005a3,0x00000007,
+0x0004003b,0x00000012,0x000005b6,0x00000007,
+0x0004003b,0x00000010,0x000005c1,0x00000007,
+0x0004003b,0x00000010,0x000005c5,0x00000007,
+0x0004003b,0x00000010,0x000005d4,0x00000007,
+0x0004003d,0x00000006,0x0000057e,0x00000050,
+0x000500aa,0x000000ac,0x0000057f,0x0000057e,
+0x0000009f,0x000300f7,0x00000581,0x00000000,
+0x000400fa,0x0000057f,0x00000580,0x00000581,
+0x000200f8,0x00000580,0x000200fe,0x0000009c,
+0x000200f8,0x00000581,0x00050041,0x000000b1,
+0x00000583,0x000000aa,0x0000009c,0x0004003d,
+0x00000006,0x00000584,0x00000583,0x00050041,
+0x000000b1,0x00000585,0x000000aa,0x0000009f,
+0x0004003d,0x00000006,0x00000586,0x00000585,
+0x00050084,0x00000006,0x00000587,0x00000584,
+0x00000586,0x000500b0,0x000000ac,0x00000588,
+0x00000587,0x000001ac,0x000300f7,0x0000058a,
+0x00000000,0x000400fa,0x00000588,0x00000589,
+0x0000058a,0x000200f8,0x00000589,0x0004003d,
+0x00000011,0x0000058b,0x0000004f,0x00050050,
+0x0000050d,0x0000058c,0x000000ca,0x000000ca,
+0x000500c4,0x00000011,0x0000058d,0x0000058b,
+0x0000058c,0x0003003e,0x0000004f,0x0000058d,
+0x000200f9,0x0000058a,0x000200f8,0x0000058a,
+0x0004003d,0x00000006,0x0000058e,0x00000050,
+0x00050084,0x00000006,0x0000058f,0x000004f7,
+0x0000058e,0x0004003d,0x00000006,0x00000590,
+0x0000004e,0x00050082,0x00000006,0x00000591,
+0x00000590,0x000004f7,0x00050080,0x00000006,
+0x00000592,0x0000058f,0x00000591,0x0003003e,
+0x0000004e,0x00000592,0x0004003d,0x00000006,
+0x00000595,0x0000004e,0x0003003e,0x00000594,
+0x00000595,0x00050039,0x00000006,0x00000596,
+0x0000004b,0x00000594,0x0003003e,0x00000593,
+0x00000596,0x0004003d,0x00000006,0x00000598,
+0x00000593,0x000600cb,0x00000006,0x00000599,
+0x00000598,0x000000bf,0x000000c9,0x0004003d,
+0x00000006,0x0000059a,0x00000593,0x000600cb,
+0x00000006,0x0000059b,0x0000059a,0x000000c9,
+0x000000c9,0x0004003d,0x00000006,0x0000059c,
+0x00000593,0x000600cb,0x00000006,0x0000059e,
+0x0000059c,0x0000059d,0x000000c9,0x0004003d,
+0x00000006,0x0000059f,0x00000593,0x000600cb,
+0x00000006,0x000005a1,0x0000059f,0x000005a0,
+0x000000c9,0x00070050,0x0000000f,0x000005a2,
+0x00000599,0x0000059b,0x0000059e,0x000005a1,
+0x0003003e,0x00000597,0x000005a2,0x0004003d,
+0x00000006,0x000005a4,0x00000593,0x000600cb,
+0x00000006,0x000005a5,0x000005a4,0x00000567,
+0x000000c9,0x0004003d,0x00000006,0x000005a6,
+0x00000593,0x000600cb,0x00000006,0x000005a8,
+0x000005a6,0x000005a7,0x000000c9,0x0004003d,
+0x00000006,0x000005a9,0x00000593,0x000600cb,
+0x00000006,0x000005ab,0x000005a9,0x000005aa,
+0x000000c9,0x0004003d,0x00000006,0x000005ac,
+0x00000593,0x000600cb,0x00000006,0x000005ae,
+0x000005ac,0x000005ad,0x000000c9,0x00070050,
+0x0000000f,0x000005af,0x000005a5,0x000005a8,
+0x000005ab,0x000005ae,0x0003003e,0x000005a3,
+0x000005af,0x0004003d,0x0000000f,0x000005b0,
+0x00000597,0x0004003d,0x0000000f,0x000005b1,
+0x00000597,0x00050084,0x0000000f,0x000005b2,
+0x000005b0,0x000005b1,0x0003003e,0x00000597,
+0x000005b2,0x0004003d,0x0000000f,0x000005b3,
+0x000005a3,0x0004003d,0x0000000f,0x000005b4,
+0x000005a3,0x00050084,0x0000000f,0x000005b5,
+0x000005b3,0x000005b4,0x0003003e,0x000005a3,
+0x000005b5,0x0004003d,0x00000006,0x000005b7,
+0x0000004e,0x000500c7,0x00000006,0x000005b8,
+0x000005b7,0x00000091,0x000500ab,0x000000ac,
+0x000005b9,0x000005b8,0x0000009c,0x000600a9,
+0x00000059,0x000005ba,0x000005b9,0x000000c9,
+0x000000cf,0x0004007c,0x00000006,0x000005bb,
+0x000005ba,0x0004003d,0x00000006,0x000005bc,
+0x00000050,0x000500aa,0x000000ac,0x000005bd,
+0x000005bc,0x00000095,0x000600a9,0x00000059,
+0x000005be,0x000005bd,0x0000050c,0x000000cf,
+0x0004007c,0x00000006,0x000005bf,0x000005be,
+0x00050050,0x00000011,0x000005c0,0x000005bb,
+0x000005bf,0x0003003e,0x000005b6,0x000005c0,
+0x0004003d,0x00000006,0x000005c2,0x0000004e,
+0x000500c7,0x00000006,0x000005c3,0x000005c2,
+0x0000009f,0x000500ab,0x000000ac,0x000005c4,
+0x000005c3,0x0000009c,0x000300f7,0x000005c7,
+0x00000000,0x000400fa,0x000005c4,0x000005c6,
+0x000005ca,0x000200f8,0x000005c6,0x0004003d,
+0x00000011,0x000005c8,0x000005b6,0x0009004f,
+0x0000000f,0x000005c9,0x000005c8,0x000005c8,
+0x00000000,0x00000001,0x00000000,0x00000001,
+0x0003003e,0x000005c5,0x000005c9,0x000200f9,
+0x000005c7,0x000200f8,0x000005ca,0x0004003d,
+0x00000011,0x000005cb,0x000005b6,0x0009004f,
+0x0000000f,0x000005cc,0x000005cb,0x000005cb,
+0x00000001,0x00000000,0x00000001,0x00000000,
+0x0003003e,0x000005c5,0x000005cc,0x000200f9,
+0x000005c7,0x000200f8,0x000005c7,0x0004003d,
+0x0000000f,0x000005cd,0x000005c5,0x0003003e,
+0x000005c1,0x000005cd,0x0004003d,0x0000000f,
+0x000005ce,0x000005c1,0x0004003d,0x0000000f,
+0x000005cf,0x00000597,0x000500c2,0x0000000f,
+0x000005d0,0x000005cf,0x000005ce,0x0003003e,
+0x00000597,0x000005d0,0x0004003d,0x0000000f,
+0x000005d1,0x000005c1,0x0004003d,0x0000000f,
+0x000005d2,0x000005a3,0x000500c2,0x0000000f,
+0x000005d3,0x000005d2,0x000005d1,0x0003003e,
+0x000005a3,0x000005d3,0x0004003d,0x0000000f,
+0x000005d5,0x00000597,0x0007004f,0x00000011,
+0x000005d6,0x000005d5,0x000005d5,0x00000000,
+0x00000001,0x00040070,0x000005d7,0x000005d8,
+0x000005d6,0x0004003d,0x00000011,0x000005d9,
+0x0000004f,0x00040070,0x000005d7,0x000005da,
+0x000005d9,0x00050094,0x000004ea,0x000005db,
+0x000005d8,0x000005da,0x0004006d,0x00000006,
+0x000005dc,0x000005db,0x0004003d,0x0000000f,
+0x000005dd,0x00000597,0x0007004f,0x00000011,
+0x000005de,0x000005dd,0x000005dd,0x00000002,
+0x00000003,0x00040070,0x000005d7,0x000005df,
+0x000005de,0x0004003d,0x00000011,0x000005e0,
+0x0000004f,0x00040070,0x000005d7,0x000005e1,
+0x000005e0,0x00050094,0x000004ea,0x000005e2,
+0x000005df,0x000005e1,0x0004006d,0x00000006,
+0x000005e3,0x000005e2,0x0004003d,0x0000000f,
+0x000005e4,0x000005a3,0x0007004f,0x00000011,
+0x000005e5,0x000005e4,0x000005e4,0x00000000,
+0x00000001,0x00040070,0x000005d7,0x000005e6,
+0x000005e5,0x0004003d,0x00000011,0x000005e7,
+0x0000004f,0x00040070,0x000005d7,0x000005e8,
+0x000005e7,0x00050094,0x000004ea,0x000005e9,
+0x000005e6,0x000005e8,0x0004006d,0x00000006,
+0x000005ea,0x000005e9,0x0004003d,0x0000000f,
+0x000005eb,0x000005a3,0x0007004f,0x00000011,
+0x000005ec,0x000005eb,0x000005eb,0x00000002,
+0x00000003,0x00040070,0x000005d7,0x000005ed,
+0x000005ec,0x0004003d,0x00000011,0x000005ee,
+0x0000004f,0x00040070,0x000005d7,0x000005ef,
+0x000005ee,0x00050094,0x000004ea,0x000005f0,
+0x000005ed,0x000005ef,0x0004006d,0x00000006,
+0x000005f1,0x000005f0,0x00070050,0x0000000f,
+0x000005f2,0x000005dc,0x000005e3,0x000005ea,
+0x000005f1,0x0004003d,0x00000006,0x000005f3,
+0x00000593,0x00070050,0x0000000f,0x000005f4,
+0x000005f3,0x000005f3,0x000005f3,0x000005f3,
+0x000500c2,0x0000000f,0x000005f6,0x000005f4,
+0x000005f5,0x00050080,0x0000000f,0x000005f7,
+0x000005f2,0x000005f6,0x0003003e,0x000005d4,
+0x000005f7,0x0004003d,0x0000000f,0x000005f9,
+0x000005d4,0x000500c7,0x0000000f,0x000005fa,
+0x000005f9,0x000005f8,0x0003003e,0x000005d4,
+0x000005fa,0x0004003d,0x00000006,0x000005fb,
+0x00000050,0x000500aa,0x000000ac,0x000005fc,
+0x000005fb,0x00000091,0x000300f7,0x000005fe,
+0x00000000,0x000400fa,0x000005fc,0x000005fd,
+0x00000603,0x000200f8,0x000005fd,0x00050041,
+0x00000007,0x000005ff,0x000005d4,0x00000091,
+0x00050051,0x00000006,0x00000600,0x00000525,
+0x00000000,0x0003003e,0x000005ff,0x00000600,
+0x00050041,0x00000007,0x00000601,0x000005d4,
+0x00000095,0x00050051,0x00000006,0x00000602,
+0x00000525,0x00000001,0x0003003e,0x00000601,
+0x00000602,0x000200f9,0x000005fe,0x000200f8,
+0x00000603,0x0004003d,0x00000006,0x00000604,
+0x00000050,0x000500aa,0x000000ac,0x00000605,
+0x00000604,0x00000095,0x000300f7,0x00000607,
+0x00000000,0x000400fa,0x00000605,0x00000606,
+0x00000607,0x000200f8,0x00000606,0x00050041,
+0x00000007,0x00000608,0x000005d4,0x00000095,
+0x0003003e,0x00000608,0x0000009c,0x000200f9,
+0x00000607,0x000200f8,0x00000607,0x000200f9,
+0x000005fe,0x000200f8,0x000005fe,0x00050041,
+0x00000007,0x00000609,0x000005d4,0x0000009c,
+0x0004003d,0x00000006,0x0000060a,0x00000609,
+0x00060050,0x00000008,0x0000060b,0x0000060a,
+0x0000060a,0x0000060a,0x0004003d,0x0000000f,
+0x0000060c,0x000005d4,0x0008004f,0x00000008,
+0x0000060d,0x0000060c,0x0000060c,0x00000001,
+0x00000002,0x00000003,0x000500ae,0x0000060e,
+0x0000060f,0x0000060b,0x0000060d,0x0004009b,
+0x000000ac,0x00000610,0x0000060f,0x000300f7,
+0x00000612,0x00000000,0x000400fa,0x00000610,
+0x00000611,0x00000614,0x000200f8,0x00000611,
+0x000200fe,0x0000009c,0x000200f8,0x00000614,
+0x00050041,0x00000007,0x00000615,0x000005d4,
+0x0000009f,0x0004003d,0x00000006,0x00000616,
+0x00000615,0x00050050,0x00000011,0x00000617,
+0x00000616,0x00000616,0x0004003d,0x0000000f,
+0x00000618,0x000005d4,0x0007004f,0x00000011,
+0x00000619,0x00000618,0x00000618,0x00000002,
+0x00000003,0x000500ae,0x00000145,0x0000061a,
+0x00000617,0x00000619,0x0004009b,0x000000ac,
+0x0000061b,0x0000061a,0x000300f7,0x0000061d,
+0x00000000,0x000400fa,0x0000061b,0x0000061c,
+0x0000061f,0x000200f8,0x0000061c,0x000200fe,
+0x0000009f,0x000200f8,0x0000061f,0x00050041,
+0x00000007,0x00000620,0x000005d4,0x00000091,
+0x0004003d,0x00000006,0x00000621,0x00000620,
+0x00050041,0x00000007,0x00000622,0x000005d4,
+0x00000095,0x0004003d,0x00000006,0x00000623,
+0x00000622,0x000500ae,0x000000ac,0x00000624,
+0x00000621,0x00000623,0x000300f7,0x00000626,
+0x00000000,0x000400fa,0x00000624,0x00000625,
+0x00000628,0x000200f8,0x00000625,0x000200fe,
+0x00000091,0x000200f8,0x00000628,0x000200fe,
+0x00000095,0x000200f8,0x00000626,0x000100ff,
+0x000200f8,0x0000061d,0x000100ff,0x000200f8,
+0x00000612,0x000100ff,0x00010038,0x00050036,
+0x00000008,0x00000057,0x00000000,0x00000053,
+0x00030037,0x00000007,0x00000054,0x00030037,
+0x00000007,0x00000055,0x00030037,0x00000007,
+0x00000056,0x000200f8,0x00000058,0x0004003b,
+0x00000007,0x0000062b,0x00000007,0x0004003b,
+0x00000009,0x00000633,0x00000007,0x0004003b,
+0x00000640,0x00000641,0x00000007,0x0004003b,
+0x00000007,0x00000644,0x00000007,0x0004003b,
+0x00000009,0x00000646,0x00000007,0x0003003e,
+0x0000062b,0x0000009c,0x000200f9,0x0000062c,
+0x000200f8,0x0000062c,0x000400f6,0x0000062e,
+0x0000062f,0x00000000,0x000200f9,0x00000630,
+0x000200f8,0x00000630,0x0004003d,0x00000006,
+0x00000631,0x0000062b,0x000500b0,0x000000ac,
+0x00000632,0x00000631,0x000003bc,0x000400fa,
+0x00000632,0x0000062d,0x0000062e,0x000200f8,
+0x0000062d,0x0004003d,0x00000006,0x0000063f,
+0x0000062b,0x0003003e,0x00000641,0x0000063e,
+0x00050041,0x00000009,0x00000642,0x00000641,
+0x0000063f,0x0004003d,0x00000008,0x00000643,
+0x00000642,0x0003003e,0x00000633,0x00000643,
+0x0004003d,0x00000006,0x00000645,0x00000055,
+0x0003003e,0x00000644,0x00000645,0x0004003d,
+0x00000008,0x00000647,0x00000633,0x0003003e,
+0x00000646,0x00000647,0x00060039,0x00000006,
+0x00000648,0x0000000d,0x00000644,0x00000646,
+0x0003003e,0x00000056,0x00000648,0x0004003d,
+0x00000006,0x00000649,0x00000056,0x0004003d,
+0x00000006,0x0000064a,0x00000054,0x000500b2,
+0x000000ac,0x0000064b,0x00000649,0x0000064a,
+0x000300f7,0x0000064d,0x00000000,0x000400fa,
+0x0000064b,0x0000064c,0x0000064d,0x000200f8,
+0x0000064c,0x0004003d,0x00000008,0x0000064e,
+0x00000633,0x000200fe,0x0000064e,0x000200f8,
+0x0000064d,0x000200f9,0x0000062f,0x000200f8,
+0x0000062f,0x0004003d,0x00000006,0x00000650,
+0x0000062b,0x00050080,0x00000006,0x00000651,
+0x00000650,0x000000ca,0x0003003e,0x0000062b,
+0x00000651,0x000200f9,0x0000062c,0x000200f8,
+0x0000062e,0x000200fe,0x0000014f,0x00010038,
+0x00050036,0x0000005a,0x0000005e,0x00000000,
+0x0000005c,0x00030037,0x0000005b,0x0000005d,
+0x000200f8,0x0000005f,0x00050041,0x0000024c,
+0x00000654,0x0000005d,0x0000009c,0x0004003d,
+0x00000059,0x00000655,0x00000654,0x00050041,
+0x0000024c,0x00000656,0x0000005d,0x00000091,
+0x0004003d,0x00000059,0x00000657,0x00000656,
+0x00050080,0x00000059,0x00000658,0x00000655,
+0x00000657,0x000500c3,0x00000059,0x00000659,
+0x00000658,0x000000ca,0x00050041,0x0000024c,
+0x0000065a,0x0000005d,0x0000009f,0x0004003d,
+0x00000059,0x0000065b,0x0000065a,0x00050041,
+0x0000024c,0x0000065c,0x0000005d,0x00000091,
+0x0004003d,0x00000059,0x0000065d,0x0000065c,
+0x00050080,0x00000059,0x0000065e,0x0000065b,
+0x0000065d,0x000500c3,0x00000059,0x0000065f,
+0x0000065e,0x000000ca,0x0004003d,0x0000005a,
+0x00000660,0x0000005d,0x0007004f,0x0000050d,
+0x00000661,0x00000660,0x00000660,0x00000002,
+0x00000003,0x00050051,0x00000059,0x00000662,
+0x00000661,0x00000000,0x00050051,0x00000059,
+0x00000663,0x00000661,0x00000001,0x00070050,
+0x0000005a,0x00000664,0x00000659,0x0000065f,
+0x00000662,0x00000663,0x000200fe,0x00000664,
+0x00010038,0x00050036,0x00000059,0x00000064,
+0x00000000,0x00000062,0x00030037,0x00000061,
+0x00000063,0x000200f8,0x00000065,0x00050041,
+0x0000024c,0x00000667,0x00000063,0x0000009c,
+0x0004003d,0x00000059,0x00000668,0x00000667,
+0x00050041,0x0000024c,0x00000669,0x00000063,
+0x0000009f,0x0004003d,0x00000059,0x0000066a,
+0x00000669,0x00050080,0x00000059,0x0000066b,
+0x00000668,0x0000066a,0x00050041,0x0000024c,
+0x0000066c,0x00000063,0x00000091,0x0004003d,
+0x00000059,0x0000066d,0x0000066c,0x00050080,
+0x00000059,0x0000066e,0x0000066b,0x0000066d,
+0x000200fe,0x0000066e,0x00010038,0x00050036,
+0x00000002,0x00000069,0x00000000,0x00000066,
+0x00030037,0x0000005b,0x00000067,0x00030037,
+0x0000005b,0x00000068,0x000200f8,0x0000006a,
+0x0004003d,0x0000005a,0x00000671,0x00000068,
+0x00070050,0x0000005a,0x00000672,0x000000ca,
+0x000000ca,0x000000ca,0x000000ca,0x000500c3,
+0x0000005a,0x00000673,0x00000671,0x00000672,
+0x0003003e,0x00000068,0x00000673,0x0004003d,
+0x0000005a,0x00000674,0x00000067,0x00070050,
+0x0000005a,0x00000676,0x00000675,0x00000675,
+0x00000675,0x00000675,0x000500c7,0x0000005a,
+0x00000677,0x00000674,0x00000676,0x0004003d,
+0x0000005a,0x00000678,0x00000068,0x000500c5,
+0x0000005a,0x00000679,0x00000678,0x00000677,
+0x0003003e,0x00000068,0x00000679,0x0004003d,
+0x0000005a,0x0000067a,0x00000067,0x00070050,
+0x0000005a,0x0000067b,0x000000ca,0x000000ca,
+0x000000ca,0x000000ca,0x000500c3,0x0000005a,
+0x0000067c,0x0000067a,0x0000067b,0x0003003e,
+0x00000067,0x0000067c,0x0004003d,0x0000005a,
+0x0000067e,0x00000067,0x00070050,0x0000005a,
+0x0000067f,0x0000067d,0x0000067d,0x0000067d,
+0x0000067d,0x000500c7,0x0000005a,0x00000680,
+0x0000067e,0x0000067f,0x0003003e,0x00000067,
+0x00000680,0x0004003d,0x0000005a,0x00000681,
+0x00000067,0x000600ca,0x0000005a,0x00000682,
+0x00000681,0x000000bf,0x0000050c,0x0003003e,
+0x00000067,0x00000682,0x000100fd,0x00010038,
+0x00050036,0x00000002,0x00000071,0x00000000,
+0x0000006b,0x00030037,0x0000005b,0x0000006c,
+0x00030037,0x0000005b,0x0000006d,0x00030037,
+0x00000007,0x0000006e,0x00030037,0x00000010,
+0x0000006f,0x00030037,0x00000010,0x00000070,
+0x000200f8,0x00000072,0x0004003b,0x0000024c,
+0x000006a0,0x00000007,0x0004003b,0x0000024c,
+0x000006a9,0x00000007,0x0004003b,0x0000005b,
+0x000006c7,0x00000007,0x0004003b,0x0000005b,
+0x000006c9,0x00000007,0x0004003b,0x00000061,
+0x00000716,0x00000007,0x0004003b,0x00000061,
+0x0000071a,0x00000007,0x0004003b,0x0000005b,
+0x00000726,0x00000007,0x0004003b,0x0000005b,
+0x0000072a,0x00000007,0x0004003b,0x0000005b,
+0x00000732,0x00000007,0x0004003b,0x0000005b,
+0x00000734,0x00000007,0x0004003b,0x00000061,
+0x00000739,0x00000007,0x0004003b,0x0000005b,
+0x00000750,0x00000007,0x0004003b,0x0000005b,
+0x00000756,0x00000007,0x0004003d,0x00000006,
+0x00000683,0x0000006e,0x000300f7,0x0000068f,
+0x00000000,0x001700fb,0x00000683,0x0000068e,
+0x00000000,0x00000684,0x00000001,0x00000685,
+0x00000004,0x00000686,0x00000005,0x00000687,
+0x00000006,0x00000688,0x0000000a,0x00000689,
+0x00000008,0x0000068a,0x0000000c,0x0000068b,
+0x00000009,0x0000068c,0x0000000d,0x0000068d,
+0x000200f8,0x0000068e,0x0003003e,0x0000006f,
+0x0000075e,0x0003003e,0x00000070,0x0000075e,
+0x000200f9,0x0000068f,0x000200f8,0x00000684,
+0x0004003d,0x0000005a,0x00000690,0x0000006c,
+0x0008004f,0x00000060,0x00000691,0x00000690,
+0x00000690,0x00000000,0x00000000,0x00000000,
+0x0004007c,0x00000008,0x00000692,0x00000691,
+0x00050051,0x00000006,0x00000694,0x00000692,
+0x00000000,0x00050051,0x00000006,0x00000695,
+0x00000692,0x00000001,0x00050051,0x00000006,
+0x00000696,0x00000692,0x00000002,0x00070050,
+0x0000000f,0x00000697,0x00000694,0x00000695,
+0x00000696,0x00000693,0x0003003e,0x0000006f,
+0x00000697,0x0004003d,0x0000005a,0x00000698,
+0x0000006d,0x0008004f,0x00000060,0x00000699,
+0x00000698,0x00000698,0x00000000,0x00000000,
+0x00000000,0x0004007c,0x00000008,0x0000069a,
+0x00000699,0x00050051,0x00000006,0x0000069b,
+0x0000069a,0x00000000,0x00050051,0x00000006,
+0x0000069c,0x0000069a,0x00000001,0x00050051,
+0x00000006,0x0000069d,0x0000069a,0x00000002,
+0x00070050,0x0000000f,0x0000069e,0x0000069b,
+0x0000069c,0x0000069d,0x00000693,0x0003003e,
+0x00000070,0x0000069e,0x000100fd,0x000200f8,
+0x00000685,0x00050041,0x0000024c,0x000006a1,
+0x0000006c,0x0000009c,0x0004003d,0x00000059,
+0x000006a2,0x000006a1,0x000500c3,0x00000059,
+0x000006a3,0x000006a2,0x000000c0,0x00050041,
+0x0000024c,0x000006a4,0x0000006d,0x0000009c,
+0x0004003d,0x00000059,0x000006a5,0x000006a4,
+0x000500c7,0x00000059,0x000006a7,0x000006a5,
+0x000006a6,0x000500c5,0x00000059,0x000006a8,
+0x000006a3,0x000006a7,0x0003003e,0x000006a0,
+0x000006a8,0x0004003d,0x00000059,0x000006aa,
+0x000006a0,0x00050041,0x0000024c,0x000006ab,
+0x0000006d,0x0000009c,0x0004003d,0x00000059,
+0x000006ac,0x000006ab,0x000500c7,0x00000059,
+0x000006ad,0x000006ac,0x0000067d,0x00050080,
+0x00000059,0x000006ae,0x000006aa,0x000006ad,
+0x0007000c,0x00000059,0x000006b0,0x00000001,
+0x00000027,0x000006ae,0x000006af,0x0003003e,
+0x000006a9,0x000006b0,0x0004003d,0x00000059,
+0x000006b1,0x000006a0,0x0004007c,0x00000006,
+0x000006b2,0x000006b1,0x00060050,0x00000008,
+0x000006b3,0x000006b2,0x000006b2,0x000006b2,
+0x00050051,0x00000006,0x000006b4,0x000006b3,
+0x00000000,0x00050051,0x00000006,0x000006b5,
+0x000006b3,0x00000001,0x00050051,0x00000006,
+0x000006b6,0x000006b3,0x00000002,0x00070050,
+0x0000000f,0x000006b7,0x000006b4,0x000006b5,
+0x000006b6,0x00000693,0x0003003e,0x0000006f,
+0x000006b7,0x0004003d,0x00000059,0x000006b8,
+0x000006a9,0x0004007c,0x00000006,0x000006b9,
+0x000006b8,0x00060050,0x00000008,0x000006ba,
+0x000006b9,0x000006b9,0x000006b9,0x00050051,
+0x00000006,0x000006bb,0x000006ba,0x00000000,
+0x00050051,0x00000006,0x000006bc,0x000006ba,
+0x00000001,0x00050051,0x00000006,0x000006bd,
+0x000006ba,0x00000002,0x00070050,0x0000000f,
+0x000006be,0x000006bb,0x000006bc,0x000006bd,
+0x00000693,0x0003003e,0x00000070,0x000006be,
+0x000100fd,0x000200f8,0x00000686,0x0004003d,
+0x0000005a,0x000006c0,0x0000006c,0x0009004f,
+0x0000005a,0x000006c1,0x000006c0,0x000006c0,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x0004007c,0x0000000f,0x000006c2,0x000006c1,
+0x0003003e,0x0000006f,0x000006c2,0x0004003d,
+0x0000005a,0x000006c3,0x0000006d,0x0009004f,
+0x0000005a,0x000006c4,0x000006c3,0x000006c3,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x0004007c,0x0000000f,0x000006c5,0x000006c4,
+0x0003003e,0x00000070,0x000006c5,0x000100fd,
+0x000200f8,0x00000687,0x0004003d,0x0000005a,
+0x000006c8,0x0000006d,0x0003003e,0x000006c7,
+0x000006c8,0x0004003d,0x0000005a,0x000006ca,
+0x0000006c,0x0003003e,0x000006c9,0x000006ca,
+0x00060039,0x00000002,0x000006cb,0x00000069,
+0x000006c7,0x000006c9,0x0004003d,0x0000005a,
+0x000006cc,0x000006c7,0x0003003e,0x0000006d,
+0x000006cc,0x0004003d,0x0000005a,0x000006cd,
+0x000006c9,0x0003003e,0x0000006c,0x000006cd,
+0x0004003d,0x0000005a,0x000006ce,0x0000006c,
+0x0009004f,0x0000005a,0x000006cf,0x000006ce,
+0x000006ce,0x00000000,0x00000000,0x00000000,
+0x00000001,0x00070050,0x0000005a,0x000006d0,
+0x000000bf,0x000000bf,0x000000bf,0x000000bf,
+0x00070050,0x0000005a,0x000006d1,0x000006af,
+0x000006af,0x000006af,0x000006af,0x0008000c,
+0x0000005a,0x000006d2,0x00000001,0x0000002d,
+0x000006cf,0x000006d0,0x000006d1,0x0004007c,
+0x0000000f,0x000006d3,0x000006d2,0x0003003e,
+0x0000006f,0x000006d3,0x0004003d,0x0000005a,
+0x000006d4,0x0000006c,0x0009004f,0x0000005a,
+0x000006d5,0x000006d4,0x000006d4,0x00000000,
+0x00000000,0x00000000,0x00000001,0x0004003d,
+0x0000005a,0x000006d6,0x0000006d,0x0009004f,
+0x0000005a,0x000006d7,0x000006d6,0x000006d6,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x00050080,0x0000005a,0x000006d8,0x000006d5,
+0x000006d7,0x00070050,0x0000005a,0x000006d9,
+0x000000bf,0x000000bf,0x000000bf,0x000000bf,
+0x00070050,0x0000005a,0x000006da,0x000006af,
+0x000006af,0x000006af,0x000006af,0x0008000c,
+0x0000005a,0x000006db,0x00000001,0x0000002d,
+0x000006d8,0x000006d9,0x000006da,0x0004007c,
+0x0000000f,0x000006dc,0x000006db,0x0003003e,
+0x00000070,0x000006dc,0x000100fd,0x000200f8,
+0x00000688,0x00050041,0x0000024c,0x000006de,
+0x0000006c,0x0000009c,0x0004003d,0x00000059,
+0x000006df,0x000006de,0x0004007c,0x00000006,
+0x000006e0,0x000006df,0x00050041,0x0000024c,
+0x000006e1,0x0000006d,0x0000009c,0x0004003d,
+0x00000059,0x000006e2,0x000006e1,0x0004007c,
+0x00000006,0x000006e3,0x000006e2,0x00050041,
+0x0000024c,0x000006e4,0x0000006c,0x0000009f,
+0x0004003d,0x00000059,0x000006e5,0x000006e4,
+0x0004007c,0x00000006,0x000006e6,0x000006e5,
+0x00070050,0x0000000f,0x000006e7,0x000006e0,
+0x000006e3,0x000006e6,0x00000693,0x0003003e,
+0x00000070,0x000006e7,0x0004003d,0x0000000f,
+0x000006e8,0x00000070,0x0008004f,0x00000008,
+0x000006e9,0x000006e8,0x000006e8,0x00000000,
+0x00000001,0x00000002,0x00050041,0x0000024c,
+0x000006ea,0x0000006d,0x0000009f,0x0004003d,
+0x00000059,0x000006eb,0x000006ea,0x0004007c,
+0x00000006,0x000006ec,0x000006eb,0x00060050,
+0x00000008,0x000006ed,0x000006ec,0x000006ec,
+0x000006ec,0x00050084,0x00000008,0x000006ee,
+0x000006e9,0x000006ed,0x00060050,0x00000060,
+0x000006ef,0x0000059d,0x0000059d,0x0000059d,
+0x000500c2,0x00000008,0x000006f0,0x000006ee,
+0x000006ef,0x00050051,0x00000006,0x000006f1,
+0x000006f0,0x00000000,0x00050051,0x00000006,
+0x000006f2,0x000006f0,0x00000001,0x00050051,
+0x00000006,0x000006f3,0x000006f0,0x00000002,
+0x00070050,0x0000000f,0x000006f4,0x000006f1,
+0x000006f2,0x000006f3,0x00000693,0x0003003e,
+0x0000006f,0x000006f4,0x000100fd,0x000200f8,
+0x00000689,0x00050041,0x0000024c,0x000006f6,
+0x0000006c,0x0000009c,0x0004003d,0x00000059,
+0x000006f7,0x000006f6,0x0004007c,0x00000006,
+0x000006f8,0x000006f7,0x00050041,0x0000024c,
+0x000006f9,0x0000006d,0x0000009c,0x0004003d,
+0x00000059,0x000006fa,0x000006f9,0x0004007c,
+0x00000006,0x000006fb,0x000006fa,0x00050041,
+0x0000024c,0x000006fc,0x0000006c,0x0000009f,
+0x0004003d,0x00000059,0x000006fd,0x000006fc,
+0x0004007c,0x00000006,0x000006fe,0x000006fd,
+0x00050041,0x0000024c,0x000006ff,0x0000006d,
+0x00000091,0x0004003d,0x00000059,0x00000700,
+0x000006ff,0x0004007c,0x00000006,0x00000701,
+0x00000700,0x00070050,0x0000000f,0x00000702,
+0x000006f8,0x000006fb,0x000006fe,0x00000701,
+0x0003003e,0x00000070,0x00000702,0x0004003d,
+0x0000000f,0x00000703,0x00000070,0x0008004f,
+0x00000008,0x00000704,0x00000703,0x00000703,
+0x00000000,0x00000001,0x00000002,0x00050041,
+0x0000024c,0x00000705,0x0000006d,0x0000009f,
+0x0004003d,0x00000059,0x00000706,0x00000705,
+0x0004007c,0x00000006,0x00000707,0x00000706,
+0x00060050,0x00000008,0x00000708,0x00000707,
+0x00000707,0x00000707,0x00050084,0x00000008,
+0x00000709,0x00000704,0x00000708,0x00060050,
+0x00000060,0x0000070a,0x0000059d,0x0000059d,
+0x0000059d,0x000500c2,0x00000008,0x0000070b,
+0x00000709,0x0000070a,0x00050041,0x0000024c,
+0x0000070c,0x0000006c,0x00000091,0x0004003d,
+0x00000059,0x0000070d,0x0000070c,0x0004007c,
+0x00000006,0x0000070e,0x0000070d,0x00050051,
+0x00000006,0x0000070f,0x0000070b,0x00000000,
+0x00050051,0x00000006,0x00000710,0x0000070b,
+0x00000001,0x00050051,0x00000006,0x00000711,
+0x0000070b,0x00000002,0x00070050,0x0000000f,
+0x00000712,0x0000070f,0x00000710,0x00000711,
+0x0000070e,0x0003003e,0x0000006f,0x00000712,
+0x000100fd,0x000200f8,0x0000068a,0x00050041,
+0x0000024c,0x00000714,0x0000006c,0x00000095,
+0x0003003e,0x00000714,0x000006af,0x00050041,
+0x0000024c,0x00000715,0x0000006d,0x00000095,
+0x0003003e,0x00000715,0x000006af,0x000200f9,
+0x0000068b,0x000200f8,0x0000068b,0x0004003d,
+0x0000005a,0x00000717,0x0000006d,0x0008004f,
+0x00000060,0x00000718,0x00000717,0x00000717,
+0x00000000,0x00000001,0x00000002,0x0003003e,
+0x00000716,0x00000718,0x00050039,0x00000059,
+0x00000719,0x00000064,0x00000716,0x0004003d,
+0x0000005a,0x0000071b,0x0000006c,0x0008004f,
+0x00000060,0x0000071c,0x0000071b,0x0000071b,
+0x00000000,0x00000001,0x00000002,0x0003003e,
+0x0000071a,0x0000071c,0x00050039,0x00000059,
+0x0000071d,0x00000064,0x0000071a,0x000500af,
+0x000000ac,0x0000071e,0x00000719,0x0000071d,
+0x000300f7,0x00000720,0x00000000,0x000400fa,
+0x0000071e,0x0000071f,0x00000725,0x000200f8,
+0x0000071f,0x0004003d,0x0000005a,0x00000721,
+0x0000006c,0x0004007c,0x0000000f,0x00000722,
+0x00000721,0x0003003e,0x0000006f,0x00000722,
+0x0004003d,0x0000005a,0x00000723,0x0000006d,
+0x0004007c,0x0000000f,0x00000724,0x00000723,
+0x0003003e,0x00000070,0x00000724,0x000200f9,
+0x00000720,0x000200f8,0x00000725,0x0004003d,
+0x0000005a,0x00000727,0x0000006d,0x0003003e,
+0x00000726,0x00000727,0x00050039,0x0000005a,
+0x00000728,0x0000005e,0x00000726,0x0004007c,
+0x0000000f,0x00000729,0x00000728,0x0003003e,
+0x0000006f,0x00000729,0x0004003d,0x0000005a,
+0x0000072b,0x0000006c,0x0003003e,0x0000072a,
+0x0000072b,0x00050039,0x0000005a,0x0000072c,
+0x0000005e,0x0000072a,0x0004007c,0x0000000f,
+0x0000072d,0x0000072c,0x0003003e,0x00000070,
+0x0000072d,0x000200f9,0x00000720,0x000200f8,
+0x00000720,0x000100fd,0x000200f8,0x0000068c,
+0x00050041,0x0000024c,0x0000072f,0x0000006c,
+0x00000095,0x0003003e,0x0000072f,0x000006af,
+0x00050041,0x0000024c,0x00000731,0x0000006d,
+0x00000095,0x0003003e,0x00000731,0x00000730,
+0x000200f9,0x0000068d,0x000200f8,0x0000068d,
+0x0004003d,0x0000005a,0x00000733,0x0000006d,
+0x0003003e,0x00000732,0x00000733,0x0004003d,
+0x0000005a,0x00000735,0x0000006c,0x0003003e,
+0x00000734,0x00000735,0x00060039,0x00000002,
+0x00000736,0x00000069,0x00000732,0x00000734,
+0x0004003d,0x0000005a,0x00000737,0x00000732,
+0x0003003e,0x0000006d,0x00000737,0x0004003d,
+0x0000005a,0x00000738,0x00000734,0x0003003e,
+0x0000006c,0x00000738,0x0004003d,0x0000005a,
+0x0000073a,0x0000006d,0x0008004f,0x00000060,
+0x0000073b,0x0000073a,0x0000073a,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x00000739,
+0x0000073b,0x00050039,0x00000059,0x0000073c,
+0x00000064,0x00000739,0x000500af,0x000000ac,
+0x0000073d,0x0000073c,0x000000bf,0x000300f7,
+0x0000073f,0x00000000,0x000400fa,0x0000073d,
+0x0000073e,0x0000074c,0x000200f8,0x0000073e,
+0x0004003d,0x0000005a,0x00000740,0x0000006c,
+0x00070050,0x0000005a,0x00000741,0x000000bf,
+0x000000bf,0x000000bf,0x000000bf,0x00070050,
+0x0000005a,0x00000742,0x000006af,0x000006af,
+0x000006af,0x000006af,0x0008000c,0x0000005a,
+0x00000743,0x00000001,0x0000002d,0x00000740,
+0x00000741,0x00000742,0x0004007c,0x0000000f,
+0x00000744,0x00000743,0x0003003e,0x0000006f,
+0x00000744,0x0004003d,0x0000005a,0x00000745,
+0x0000006c,0x0004003d,0x0000005a,0x00000746,
+0x0000006d,0x00050080,0x0000005a,0x00000747,
+0x00000745,0x00000746,0x00070050,0x0000005a,
+0x00000748,0x000000bf,0x000000bf,0x000000bf,
+0x000000bf,0x00070050,0x0000005a,0x00000749,
+0x000006af,0x000006af,0x000006af,0x000006af,
+0x0008000c,0x0000005a,0x0000074a,0x00000001,
+0x0000002d,0x00000747,0x00000748,0x00000749,
+0x0004007c,0x0000000f,0x0000074b,0x0000074a,
+0x0003003e,0x00000070,0x0000074b,0x000200f9,
+0x0000073f,0x000200f8,0x0000074c,0x0004003d,
+0x0000005a,0x0000074d,0x0000006c,0x0004003d,
+0x0000005a,0x0000074e,0x0000006d,0x00050080,
+0x0000005a,0x0000074f,0x0000074d,0x0000074e,
+0x0003003e,0x00000750,0x0000074f,0x00050039,
+0x0000005a,0x00000751,0x0000005e,0x00000750,
+0x00070050,0x0000005a,0x00000752,0x000000bf,
+0x000000bf,0x000000bf,0x000000bf,0x00070050,
+0x0000005a,0x00000753,0x000006af,0x000006af,
+0x000006af,0x000006af,0x0008000c,0x0000005a,
+0x00000754,0x00000001,0x0000002d,0x00000751,
+0x00000752,0x00000753,0x0004007c,0x0000000f,
+0x00000755,0x00000754,0x0003003e,0x0000006f,
+0x00000755,0x0004003d,0x0000005a,0x00000757,
+0x0000006c,0x0003003e,0x00000756,0x00000757,
+0x00050039,0x0000005a,0x00000758,0x0000005e,
+0x00000756,0x00070050,0x0000005a,0x00000759,
+0x000000bf,0x000000bf,0x000000bf,0x000000bf,
+0x00070050,0x0000005a,0x0000075a,0x000006af,
+0x000006af,0x000006af,0x000006af,0x0008000c,
+0x0000005a,0x0000075b,0x00000001,0x0000002d,
+0x00000758,0x00000759,0x0000075a,0x0004007c,
+0x0000000f,0x0000075c,0x0000075b,0x0003003e,
+0x00000070,0x0000075c,0x000200f9,0x0000073f,
+0x000200f8,0x0000073f,0x000100fd,0x000200f8,
+0x0000068f,0x000100fd,0x00010038,0x00050036,
+0x00000006,0x00000078,0x00000000,0x00000073,
+0x00030037,0x00000010,0x00000074,0x00030037,
+0x00000007,0x00000075,0x00030037,0x00000007,
+0x00000076,0x00030037,0x00000009,0x00000077,
+0x000200f8,0x00000079,0x0004003b,0x00000007,
+0x00000760,0x00000007,0x0004003b,0x00000007,
+0x00000768,0x00000007,0x0004003b,0x00000007,
+0x00000771,0x00000007,0x0004003b,0x00000010,
+0x00000774,0x00000007,0x0004003b,0x00000007,
+0x00000776,0x00000007,0x0004003b,0x00000007,
+0x00000778,0x00000007,0x0004003b,0x00000007,
+0x0000077a,0x00000007,0x0004003b,0x000007e1,
+0x000007e2,0x00000007,0x0004003b,0x00000007,
+0x000007ec,0x00000007,0x0004003b,0x00000007,
+0x000007f5,0x00000007,0x0004003b,0x00000010,
+0x000007f8,0x00000007,0x0004003b,0x00000007,
+0x000007fa,0x00000007,0x0004003b,0x00000007,
+0x000007fc,0x00000007,0x0004003b,0x00000007,
+0x000007fe,0x00000007,0x0004003b,0x0000080f,
+0x00000810,0x00000007,0x0004003b,0x00000007,
+0x00000815,0x00000007,0x0004003b,0x00000007,
+0x0000081b,0x00000007,0x0004003b,0x00000010,
+0x0000081c,0x00000007,0x0004003b,0x00000007,
+0x0000081e,0x00000007,0x0004003b,0x00000007,
+0x00000820,0x00000007,0x0004003b,0x00000012,
+0x00000823,0x00000007,0x0004003b,0x0000082f,
+0x00000830,0x00000007,0x00050041,0x00000007,
+0x00000761,0x00000077,0x00000091,0x0004003d,
+0x00000006,0x00000762,0x00000761,0x0003003e,
+0x00000760,0x00000762,0x00050041,0x00000007,
+0x00000763,0x00000077,0x0000009c,0x0004003d,
+0x00000006,0x00000764,0x00000763,0x000500aa,
+0x000000ac,0x00000765,0x00000764,0x0000009f,
+0x000300f7,0x00000767,0x00000000,0x000400fa,
+0x00000765,0x00000766,0x000007e6,0x000200f8,
+0x00000766,0x0004003d,0x00000006,0x00000769,
+0x00000076,0x00050086,0x00000006,0x0000076a,
+0x00000769,0x00000094,0x0004003d,0x00000006,
+0x0000076b,0x00000760,0x00050084,0x00000006,
+0x0000076c,0x00000094,0x0000076b,0x00050080,
+0x00000006,0x0000076d,0x0000076c,0x0000008c,
+0x00050084,0x00000006,0x0000076e,0x0000076a,
+0x0000076d,0x0004003d,0x00000006,0x0000076f,
+0x00000075,0x00050080,0x00000006,0x00000770,
+0x0000076e,0x0000076f,0x0003003e,0x00000768,
+0x00000770,0x0004003d,0x00000006,0x00000772,
+0x00000076,0x00050089,0x00000006,0x00000773,
+0x00000772,0x00000094,0x0004003d,0x0000000f,
+0x00000775,0x00000074,0x0003003e,0x00000774,
+0x00000775,0x0004003d,0x00000006,0x00000777,
+0x00000768,0x0003003e,0x00000776,0x00000777,
+0x0004003d,0x00000006,0x00000779,0x00000760,
+0x0003003e,0x00000778,0x00000779,0x0003003e,
+0x0000077a,0x00000773,0x00080039,0x00000006,
+0x0000077b,0x0000002a,0x00000774,0x00000776,
+0x00000778,0x0000077a,0x0003003e,0x00000771,
+0x0000077b,0x0004003d,0x00000006,0x000007da,
+0x00000760,0x000500c4,0x00000059,0x000007db,
+0x000000ca,0x000007da,0x00050082,0x00000059,
+0x000007dc,0x000007db,0x000000ca,0x00050084,
+0x00000059,0x000007dd,0x0000015e,0x000007dc,
+0x0004007c,0x00000006,0x000007de,0x000007dd,
+0x0004003d,0x00000006,0x000007df,0x00000771,
+0x00050080,0x00000006,0x000007e0,0x000007de,
+0x000007df,0x0003003e,0x000007e2,0x000007d9,
+0x00050041,0x00000007,0x000007e3,0x000007e2,
+0x000007e0,0x0004003d,0x00000006,0x000007e4,
+0x000007e3,0x000200fe,0x000007e4,0x000200f8,
+0x000007e6,0x00050041,0x00000007,0x000007e7,
+0x00000077,0x0000009f,0x0004003d,0x00000006,
+0x000007e8,0x000007e7,0x000500aa,0x000000ac,
+0x000007e9,0x000007e8,0x0000009f,0x000300f7,
+0x000007eb,0x00000000,0x000400fa,0x000007e9,
+0x000007ea,0x00000814,0x000200f8,0x000007ea,
+0x0004003d,0x00000006,0x000007ed,0x00000076,
+0x00050086,0x00000006,0x000007ee,0x000007ed,
+0x00000095,0x0004003d,0x00000006,0x000007ef,
+0x00000760,0x00050084,0x00000006,0x000007f0,
+0x00000095,0x000007ef,0x00050080,0x00000006,
+0x000007f1,0x000007f0,0x0000008d,0x00050084,
+0x00000006,0x000007f2,0x000007ee,0x000007f1,
+0x0004003d,0x00000006,0x000007f3,0x00000075,
+0x00050080,0x00000006,0x000007f4,0x000007f2,
+0x000007f3,0x0003003e,0x000007ec,0x000007f4,
+0x0004003d,0x00000006,0x000007f6,0x00000076,
+0x00050089,0x00000006,0x000007f7,0x000007f6,
+0x00000095,0x0004003d,0x0000000f,0x000007f9,
+0x00000074,0x0003003e,0x000007f8,0x000007f9,
+0x0004003d,0x00000006,0x000007fb,0x000007ec,
+0x0003003e,0x000007fa,0x000007fb,0x0004003d,
+0x00000006,0x000007fd,0x00000760,0x0003003e,
+0x000007fc,0x000007fd,0x0003003e,0x000007fe,
+0x000007f7,0x00080039,0x00000006,0x000007ff,
+0x00000030,0x000007f8,0x000007fa,0x000007fc,
+0x000007fe,0x0003003e,0x000007f5,0x000007ff,
+0x0004003d,0x00000006,0x00000808,0x00000760,
+0x000500c4,0x00000059,0x00000809,0x000000ca,
+0x00000808,0x00050082,0x00000059,0x0000080a,
+0x00000809,0x000000ca,0x00050084,0x00000059,
+0x0000080b,0x000000cf,0x0000080a,0x0004007c,
+0x00000006,0x0000080c,0x0000080b,0x0004003d,
+0x00000006,0x0000080d,0x000007f5,0x00050080,
+0x00000006,0x0000080e,0x0000080c,0x0000080d,
+0x0003003e,0x00000810,0x00000807,0x00050041,
+0x00000007,0x00000811,0x00000810,0x0000080e,
+0x0004003d,0x00000006,0x00000812,0x00000811,
+0x000200fe,0x00000812,0x000200f8,0x00000814,
+0x0004003d,0x00000006,0x00000816,0x00000076,
+0x0004003d,0x00000006,0x00000817,0x00000760,
+0x00050084,0x00000006,0x00000818,0x00000816,
+0x00000817,0x0004003d,0x00000006,0x00000819,
+0x00000075,0x00050080,0x00000006,0x0000081a,
+0x00000818,0x00000819,0x0003003e,0x00000815,
+0x0000081a,0x0004003d,0x0000000f,0x0000081d,
+0x00000074,0x0003003e,0x0000081c,0x0000081d,
+0x0004003d,0x00000006,0x0000081f,0x00000815,
+0x0003003e,0x0000081e,0x0000081f,0x0004003d,
+0x00000006,0x00000821,0x00000760,0x0003003e,
+0x00000820,0x00000821,0x00070039,0x00000006,
+0x00000822,0x0000001c,0x0000081c,0x0000081e,
+0x00000820,0x0003003e,0x0000081b,0x00000822,
+0x0004003d,0x00000006,0x0000082d,0x00000760,
+0x00050082,0x00000006,0x0000082e,0x0000082d,
+0x0000009f,0x0003003e,0x00000830,0x0000082c,
+0x00050041,0x00000012,0x00000831,0x00000830,
+0x0000082e,0x0004003d,0x00000011,0x00000832,
+0x00000831,0x0003003e,0x00000823,0x00000832,
+0x0004003d,0x00000006,0x00000833,0x0000081b,
+0x00050041,0x00000007,0x00000834,0x00000823,
+0x0000009c,0x0004003d,0x00000006,0x00000835,
+0x00000834,0x00050084,0x00000006,0x00000836,
+0x00000833,0x00000835,0x0004003d,0x00000006,
+0x00000837,0x0000081b,0x00050041,0x00000007,
+0x00000838,0x00000823,0x0000009f,0x0004003d,
+0x00000006,0x00000839,0x00000838,0x000500c2,
+0x00000006,0x0000083a,0x00000837,0x00000839,
+0x000500c5,0x00000006,0x0000083b,0x00000836,
+0x0000083a,0x000200fe,0x0000083b,0x000200f8,
+0x000007eb,0x000100ff,0x000200f8,0x00000767,
+0x000100ff,0x00010038,0x00050036,0x0000000f,
+0x0000007c,0x00000000,0x0000007a,0x00030037,
+0x00000007,0x0000007b,0x000200f8,0x0000007d,
+0x0004003b,0x0000005b,0x0000083e,0x00000007,
+0x0004003b,0x00000010,0x00000847,0x00000007,
+0x0004003d,0x00000006,0x0000083f,0x0000007b,
+0x0004007c,0x00000059,0x00000840,0x0000083f,
+0x00070050,0x0000005a,0x00000845,0x00000840,
+0x00000840,0x00000840,0x00000840,0x00050082,
+0x0000005a,0x00000846,0x00000845,0x00000844,
+0x0003003e,0x0000083e,0x00000846,0x0004003d,
+0x0000005a,0x00000849,0x0000083e,0x0008000c,
+0x0000005a,0x0000084d,0x00000001,0x0000002d,
+0x00000849,0x0000084a,0x0000084c,0x000500c4,
+0x0000000f,0x0000084e,0x00000848,0x0000084d,
+0x00070050,0x0000000f,0x0000084f,0x0000009f,
+0x0000009f,0x0000009f,0x0000009f,0x00050082,
+0x0000000f,0x00000850,0x0000084e,0x0000084f,
+0x0003003e,0x00000847,0x00000850,0x0004003d,
+0x0000000f,0x00000851,0x00000847,0x0004003d,
+0x00000006,0x00000854,0x0000007b,0x00070050,
+0x0000000f,0x00000855,0x00000854,0x00000854,
+0x00000854,0x00000854,0x000500ae,0x00000857,
+0x00000858,0x00000855,0x00000856,0x000600a9,
+0x0000000f,0x00000859,0x00000858,0x00000853,
+0x00000851,0x000200fe,0x00000859,0x00010038,
+0x00050036,0x0000000f,0x00000080,0x00000000,
+0x0000007e,0x00030037,0x00000011,0x0000007f,
+0x000200f8,0x00000081,0x0004003b,0x00000010,
+0x00000872,0x00000007,0x0004003b,0x00000007,
+0x00000876,0x00000007,0x0004003b,0x00000012,
+0x0000087a,0x00000007,0x0004003b,0x00000010,
+0x0000087b,0x00000007,0x0004003b,0x00000007,
+0x0000087e,0x00000007,0x0004003b,0x00000007,
+0x0000087f,0x00000007,0x0004003b,0x00000012,
+0x00000881,0x00000007,0x0004003b,0x00000007,
+0x00000882,0x00000007,0x0004003b,0x00000007,
+0x00000885,0x00000007,0x0004003b,0x00000007,
+0x00000886,0x00000007,0x0004003b,0x00000007,
+0x00000887,0x00000007,0x0004003b,0x00000007,
+0x00000888,0x00000007,0x0004003b,0x00000007,
+0x00000889,0x00000007,0x0004003b,0x00000007,
+0x0000088b,0x00000007,0x0004003b,0x00000007,
+0x0000088c,0x00000007,0x0004003b,0x00000007,
+0x0000088d,0x00000007,0x0004003b,0x00000007,
+0x00000897,0x00000007,0x0004003b,0x00000007,
+0x0000089d,0x00000007,0x0004003b,0x00000007,
+0x000008a5,0x00000007,0x0004003b,0x00000009,
+0x000008a9,0x00000007,0x0004003b,0x00000007,
+0x000008aa,0x00000007,0x0004003b,0x00000007,
+0x000008ab,0x00000007,0x0004003b,0x00000007,
+0x000008ad,0x00000007,0x0004003b,0x00000007,
+0x000008af,0x00000007,0x0004003b,0x00000007,
+0x000008b2,0x00000007,0x0004003b,0x0000005b,
+0x000008b6,0x00000007,0x0004003b,0x0000005b,
+0x000008b7,0x00000007,0x0004003b,0x00000010,
+0x000008b8,0x00000007,0x0004003b,0x00000007,
+0x000008bd,0x00000007,0x0004003b,0x00000007,
+0x000008c0,0x00000007,0x0004003b,0x00000007,
+0x000008c9,0x00000007,0x0004003b,0x00000010,
+0x000008cf,0x00000007,0x0004003b,0x00000007,
+0x000008d1,0x00000007,0x0004003b,0x00000007,
+0x000008d3,0x00000007,0x0004003b,0x00000009,
+0x000008d5,0x00000007,0x0004003b,0x00000010,
+0x000008dd,0x00000007,0x0004003b,0x00000007,
+0x000008df,0x00000007,0x0004003b,0x00000007,
+0x000008e1,0x00000007,0x0004003b,0x00000009,
+0x000008e2,0x00000007,0x0004003b,0x00000010,
+0x000008e9,0x00000007,0x0004003b,0x00000010,
+0x000008ea,0x00000007,0x0004003b,0x0000005b,
+0x000008eb,0x00000007,0x0004003b,0x0000005b,
+0x000008ed,0x00000007,0x0004003b,0x00000007,
+0x000008ef,0x00000007,0x0004003b,0x00000010,
+0x000008f1,0x00000007,0x0004003b,0x00000010,
+0x000008f2,0x00000007,0x0004003b,0x00000010,
+0x000008f6,0x00000007,0x0004003b,0x00000007,
+0x000008fd,0x00000007,0x0004003b,0x00000010,
+0x000008fe,0x00000007,0x0004003b,0x00000007,
+0x00000900,0x00000007,0x0004003b,0x00000007,
+0x00000902,0x00000007,0x0004003d,0x000000ac,
+0x0000085c,0x000000ae,0x000300f7,0x0000085e,
+0x00000000,0x000400fa,0x0000085c,0x0000085d,
+0x0000085e,0x000200f8,0x0000085d,0x000200fe,
+0x0000085f,0x000200f8,0x0000085e,0x0004003d,
+0x000000ac,0x00000861,0x000000b0,0x000300f7,
+0x00000863,0x00000000,0x000400fa,0x00000861,
+0x00000862,0x00000863,0x000200f8,0x00000862,
+0x00050041,0x000000b1,0x00000864,0x000000a7,
+0x0000009f,0x0004003d,0x00000006,0x00000865,
+0x00000864,0x000600cb,0x00000006,0x00000866,
+0x00000865,0x0000059d,0x0000059d,0x00050041,
+0x000000b1,0x00000867,0x000000a7,0x0000009f,
+0x0004003d,0x00000006,0x00000868,0x00000867,
+0x000600cb,0x00000006,0x00000869,0x00000868,
+0x000005aa,0x0000059d,0x00050041,0x000000b1,
+0x0000086a,0x000000a7,0x0000009c,0x0004003d,
+0x00000006,0x0000086b,0x0000086a,0x000600cb,
+0x00000006,0x0000086c,0x0000086b,0x0000059d,
+0x0000059d,0x00050041,0x000000b1,0x0000086d,
+0x000000a7,0x0000009c,0x0004003d,0x00000006,
+0x0000086e,0x0000086d,0x000600cb,0x00000006,
+0x0000086f,0x0000086e,0x000005aa,0x0000059d,
+0x00070050,0x0000000f,0x00000870,0x00000866,
+0x00000869,0x0000086c,0x0000086f,0x000200fe,
+0x00000870,0x000200f8,0x00000863,0x0004003d,
+0x0000000f,0x00000873,0x000000a7,0x0009004f,
+0x0000000f,0x00000874,0x00000873,0x00000873,
+0x00000003,0x00000002,0x00000001,0x00000000,
+0x000400cc,0x0000000f,0x00000875,0x00000874,
+0x0004003d,0x00000006,0x00000877,0x0000016f,
+0x0003003e,0x00000876,0x00000877,0x00050039,
+0x0000000f,0x00000878,0x0000007c,0x00000876,
+0x000500c7,0x0000000f,0x00000879,0x00000875,
+0x00000878,0x0003003e,0x00000872,0x00000879,
+0x0004003d,0x0000000f,0x0000087c,0x00000872,
+0x0003003e,0x0000087b,0x0000087c,0x00060039,
+0x00000011,0x0000087d,0x00000047,0x0000087b,
+0x0000007f,0x0003003e,0x0000087a,0x0000087d,
+0x0004003d,0x00000006,0x00000880,0x0000018d,
+0x0003003e,0x0000087f,0x00000880,0x0003003e,
+0x00000881,0x0000007f,0x0004003d,0x00000006,
+0x00000883,0x00000183,0x0003003e,0x00000882,
+0x00000883,0x00070039,0x00000006,0x00000884,
+0x00000051,0x0000087f,0x00000881,0x00000882,
+0x0003003e,0x0000087e,0x00000884,0x0003003e,
+0x00000885,0x0000009c,0x0003003e,0x00000886,
+0x0000009c,0x0003003e,0x00000887,0x0000009c,
+0x0004003d,0x00000006,0x0000088a,0x0000087e,
+0x0003003e,0x00000889,0x0000088a,0x00080039,
+0x00000006,0x0000088e,0x00000023,0x00000889,
+0x0000088b,0x0000088c,0x0000088d,0x0004003d,
+0x00000006,0x0000088f,0x0000088b,0x0003003e,
+0x00000885,0x0000088f,0x0004003d,0x00000006,
+0x00000890,0x0000088c,0x0003003e,0x00000886,
+0x00000890,0x0004003d,0x00000006,0x00000891,
+0x0000088d,0x0003003e,0x00000887,0x00000891,
+0x0003003e,0x00000888,0x0000088e,0x0004003d,
+0x00000006,0x00000892,0x00000886,0x000500ac,
+0x000000ac,0x00000893,0x00000892,0x000002a0,
+0x000300f7,0x00000895,0x00000000,0x000400fa,
+0x00000893,0x00000894,0x00000895,0x000200f8,
+0x00000894,0x000200fe,0x0000085f,0x000200f8,
+0x00000895,0x0004003d,0x00000006,0x00000898,
+0x00000183,0x000500aa,0x000000ac,0x00000899,
+0x00000898,0x0000009f,0x000600a9,0x00000059,
+0x0000089b,0x00000899,0x00000556,0x0000089a,
+0x0004007c,0x00000006,0x0000089c,0x0000089b,
+0x0003003e,0x00000897,0x0000089c,0x0004003d,
+0x000000ac,0x0000089f,0x000000db,0x000600a9,
+0x00000059,0x000008a0,0x0000089f,0x000000ca,
+0x000000bf,0x00050084,0x00000059,0x000008a1,
+0x0000089e,0x000008a0,0x0004007c,0x00000006,
+0x000008a2,0x000008a1,0x0004003d,0x00000006,
+0x000008a3,0x00000885,0x00050080,0x00000006,
+0x000008a4,0x000008a2,0x000008a3,0x0003003e,
+0x0000089d,0x000008a4,0x0004003d,0x00000006,
+0x000008a6,0x0000089d,0x0004003d,0x00000006,
+0x000008a7,0x00000897,0x00050082,0x00000006,
+0x000008a8,0x000008a6,0x000008a7,0x0003003e,
+0x000008a5,0x000008a8,0x0004003d,0x00000006,
+0x000008ac,0x000008a5,0x0003003e,0x000008ab,
+0x000008ac,0x0004003d,0x00000006,0x000008ae,
+0x00000886,0x0003003e,0x000008ad,0x000008ae,
+0x00070039,0x00000008,0x000008b0,0x00000057,
+0x000008ab,0x000008ad,0x000008af,0x0004003d,
+0x00000006,0x000008b1,0x000008af,0x0003003e,
+0x000008aa,0x000008b1,0x0003003e,0x000008a9,
+0x000008b0,0x0004003d,0x00000006,0x000008b3,
+0x00000888,0x000500c2,0x00000006,0x000008b4,
+0x000008b3,0x000000c0,0x00050080,0x00000006,
+0x000008b5,0x000008b4,0x0000009f,0x0003003e,
+0x000008b2,0x000008b5,0x0003003e,0x000008b6,
+0x0000084a,0x0003003e,0x000008b7,0x0000084a,
+0x0004003d,0x0000000f,0x000008b9,0x000000a7,
+0x0004003d,0x00000006,0x000008ba,0x00000897,
+0x0004003d,0x00000006,0x000008bb,0x000008aa,
+0x00050080,0x00000006,0x000008bc,0x000008ba,
+0x000008bb,0x0003003e,0x000008bd,0x000008bc,
+0x00050039,0x0000000f,0x000008be,0x0000007c,
+0x000008bd,0x000500c7,0x0000000f,0x000008bf,
+0x000008b9,0x000008be,0x0003003e,0x000008b8,
+0x000008bf,0x0003003e,0x000008c0,0x0000009c,
+0x000200f9,0x000008c1,0x000200f8,0x000008c1,
+0x000400f6,0x000008c3,0x000008c4,0x00000000,
+0x000200f9,0x000008c5,0x000200f8,0x000008c5,
+0x0004003d,0x00000006,0x000008c6,0x000008c0,
+0x0004003d,0x00000006,0x000008c7,0x000008b2,
+0x000500b0,0x000000ac,0x000008c8,0x000008c6,
+0x000008c7,0x000400fa,0x000008c8,0x000008c2,
+0x000008c3,0x000200f8,0x000008c2,0x0004003d,
+0x00000006,0x000008ca,0x000008c0,0x00050084,
+0x00000006,0x000008cb,0x00000091,0x000008ca,
+0x0004003d,0x00000006,0x000008cc,0x00000887,
+0x00050080,0x00000006,0x000008cd,0x000008cb,
+0x000008cc,0x0003003e,0x000008c9,0x000008cd,
+0x0004003d,0x00000006,0x000008ce,0x000008c0,
+0x0004003d,0x0000000f,0x000008d0,0x000008b8,
+0x0003003e,0x000008cf,0x000008d0,0x0004003d,
+0x00000006,0x000008d2,0x00000897,0x0003003e,
+0x000008d1,0x000008d2,0x0004003d,0x00000006,
+0x000008d4,0x000008c9,0x0003003e,0x000008d3,
+0x000008d4,0x0004003d,0x00000008,0x000008d6,
+0x000008a9,0x0003003e,0x000008d5,0x000008d6,
+0x00080039,0x00000006,0x000008d7,0x00000078,
+0x000008cf,0x000008d1,0x000008d3,0x000008d5,
+0x0004007c,0x00000059,0x000008d8,0x000008d7,
+0x00050041,0x0000024c,0x000008d9,0x000008b6,
+0x000008ce,0x0003003e,0x000008d9,0x000008d8,
+0x0004003d,0x00000006,0x000008da,0x000008c0,
+0x0004003d,0x00000006,0x000008db,0x000008c9,
+0x00050080,0x00000006,0x000008dc,0x000008db,
+0x0000009f,0x0004003d,0x0000000f,0x000008de,
+0x000008b8,0x0003003e,0x000008dd,0x000008de,
+0x0004003d,0x00000006,0x000008e0,0x00000897,
+0x0003003e,0x000008df,0x000008e0,0x0003003e,
+0x000008e1,0x000008dc,0x0004003d,0x00000008,
+0x000008e3,0x000008a9,0x0003003e,0x000008e2,
+0x000008e3,0x00080039,0x00000006,0x000008e4,
+0x00000078,0x000008dd,0x000008df,0x000008e1,
+0x000008e2,0x0004007c,0x00000059,0x000008e5,
+0x000008e4,0x00050041,0x0000024c,0x000008e6,
+0x000008b7,0x000008da,0x0003003e,0x000008e6,
+0x000008e5,0x000200f9,0x000008c4,0x000200f8,
+0x000008c4,0x0004003d,0x00000006,0x000008e7,
+0x000008c0,0x00050080,0x00000006,0x000008e8,
+0x000008e7,0x000000ca,0x0003003e,0x000008c0,
+0x000008e8,0x000200f9,0x000008c1,0x000200f8,
+0x000008c3,0x0004003d,0x0000005a,0x000008ec,
+0x000008b6,0x0003003e,0x000008eb,0x000008ec,
+0x0004003d,0x0000005a,0x000008ee,0x000008b7,
+0x0003003e,0x000008ed,0x000008ee,0x0004003d,
+0x00000006,0x000008f0,0x00000888,0x0003003e,
+0x000008ef,0x000008f0,0x00090039,0x00000002,
+0x000008f3,0x00000071,0x000008eb,0x000008ed,
+0x000008ef,0x000008f1,0x000008f2,0x0004003d,
+0x0000000f,0x000008f4,0x000008f1,0x0003003e,
+0x000008e9,0x000008f4,0x0004003d,0x0000000f,
+0x000008f5,0x000008f2,0x0003003e,0x000008ea,
+0x000008f5,0x00050041,0x00000007,0x000008f7,
+0x0000087a,0x0000009c,0x0004003d,0x00000006,
+0x000008f8,0x000008f7,0x00070050,0x0000000f,
+0x000008f9,0x000008f8,0x000008f8,0x000008f8,
+0x000008f8,0x0003003e,0x000008f6,0x000008f9,
+0x0004003d,0x000000ac,0x000008fa,0x000000db,
+0x000300f7,0x000008fc,0x00000000,0x000400fa,
+0x000008fa,0x000008fb,0x000008fc,0x000200f8,
+0x000008fb,0x0004003d,0x0000000f,0x000008ff,
+0x000000a7,0x0003003e,0x000008fe,0x000008ff,
+0x0004003d,0x00000006,0x00000901,0x0000089d,
+0x0003003e,0x00000900,0x00000901,0x0003003e,
+0x00000902,0x00000091,0x00070039,0x00000006,
+0x00000903,0x0000001c,0x000008fe,0x00000900,
+0x00000902,0x0003003e,0x000008fd,0x00000903,
+0x0004003d,0x00000006,0x00000904,0x000008fd,
+0x00050041,0x00000007,0x00000905,0x0000087a,
+0x0000009f,0x0004003d,0x00000006,0x00000906,
+0x00000905,0x00050041,0x00000007,0x00000907,
+0x000008f6,0x00000904,0x0003003e,0x00000907,
+0x00000906,0x000200f9,0x000008fc,0x000200f8,
+0x000008fc,0x0004003d,0x0000000f,0x00000908,
+0x000008e9,0x0004003d,0x0000000f,0x00000909,
+0x000008f6,0x00070050,0x0000000f,0x0000090a,
+0x0000017d,0x0000017d,0x0000017d,0x0000017d,
+0x00050082,0x0000000f,0x0000090b,0x0000090a,
+0x00000909,0x00050084,0x0000000f,0x0000090c,
+0x00000908,0x0000090b,0x0004003d,0x0000000f,
+0x0000090d,0x000008ea,0x0004003d,0x0000000f,
+0x0000090e,0x000008f6,0x00050084,0x0000000f,
+0x0000090f,0x0000090d,0x0000090e,0x00050080,
+0x0000000f,0x00000910,0x0000090c,0x0000090f,
+0x00070050,0x0000000f,0x00000911,0x000001a0,
+0x000001a0,0x000001a0,0x000001a0,0x00050080,
+0x0000000f,0x00000912,0x00000910,0x00000911,
+0x00070050,0x0000005a,0x00000913,0x0000050c,
+0x0000050c,0x0000050c,0x0000050c,0x000500c2,
+0x0000000f,0x00000914,0x00000912,0x00000913,
+0x000200fe,0x00000914,0x00010038,0x00050036,
+0x00000060,0x00000084,0x00000000,0x00000082,
+0x00030037,0x00000061,0x00000083,0x000200f8,
+0x00000085,0x0004003d,0x00000060,0x00000917,
+0x00000083,0x000200fe,0x00000917,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_3D.inl
new file mode 100644
index 00000000000..2f04f38a4c1
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/AstcToRgb_3D.inl
@@ -0,0 +1,3594 @@
+0x07230203,0x00010300,0x000d000a,0x0000095d,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x0000091c,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00080005,0x0000000d,0x45746567,
+0x646f636e,0x53676e69,0x28657a69,0x763b3175,
+0x003b3375,0x00040005,0x0000000b,0x566d756e,
+0x00736c61,0x00050005,0x0000000c,0x6f636e65,
+0x676e6964,0x00000000,0x000a0005,0x00000016,
+0x63747361,0x6f636544,0x49726564,0x6974696e,
+0x7a696c61,0x75762865,0x75763b34,0x00003b32,
+0x00050005,0x00000014,0x636f6c62,0x7461446b,
+0x00000061,0x00050005,0x00000015,0x636f6c62,
+0x7a69536b,0x00005f65,0x00080005,0x0000001c,
+0x72747865,0x42746361,0x28737469,0x3b347576,
+0x753b3175,0x00003b31,0x00040005,0x00000019,
+0x61746164,0x00000000,0x00040005,0x0000001a,
+0x7366666f,0x00007465,0x00040005,0x0000001b,
+0x426d756e,0x00737469,0x00080005,0x00000023,
+0x6f636564,0x45436564,0x3175284d,0x3b31753b,
+0x753b3175,0x00003b31,0x00060005,0x0000001f,
+0x74726170,0x6f697469,0x646e496e,0x00007865,
+0x00060005,0x00000020,0x72617473,0x45664f74,
+0x61727478,0x006d6543,0x00060005,0x00000021,
+0x61746f74,0x646e456c,0x6e696f70,0x00007374,
+0x00070005,0x00000022,0x65736162,0x70646e45,
+0x746e696f,0x65646e49,0x00000078,0x00090005,
+0x0000002a,0x6f636564,0x72546564,0x76287469,
+0x753b3475,0x31753b31,0x3b31753b,0x00000000,
+0x00040005,0x00000026,0x61746164,0x00000000,
+0x00040005,0x00000027,0x7366666f,0x00007465,
+0x00040005,0x00000028,0x426d756e,0x00737469,
+0x00030005,0x00000029,0x00000069,0x00090005,
+0x00000030,0x6f636564,0x75516564,0x28746e69,
+0x3b347576,0x753b3175,0x31753b31,0x0000003b,
+0x00040005,0x0000002c,0x61746164,0x00000000,
+0x00040005,0x0000002d,0x7366666f,0x00007465,
+0x00040005,0x0000002e,0x426d756e,0x00737469,
+0x00030005,0x0000002f,0x00000069,0x000a0005,
+0x00000037,0x6f636564,0x57316564,0x68676965,
+0x75762874,0x75763b34,0x31753b33,0x3b31753b,
+0x00000000,0x00050005,0x00000033,0x67696577,
+0x61447468,0x00006174,0x00050005,0x00000034,
+0x6f636e65,0x676e6964,0x00000000,0x00050005,
+0x00000035,0x576d756e,0x68676965,0x00007374,
+0x00040005,0x00000036,0x65646e69,0x00000078,
+0x000e0005,0x00000042,0x65746e69,0x6c6f7072,
+0x57657461,0x68676965,0x76287374,0x763b3475,
+0x753b3375,0x31753b31,0x3b31753b,0x753b3175,
+0x75763b31,0x00003b32,0x00050005,0x0000003a,
+0x67696577,0x61447468,0x00006174,0x00050005,
+0x0000003b,0x6f636e65,0x676e6964,0x00000000,
+0x00050005,0x0000003c,0x576d756e,0x68676965,
+0x00007374,0x00040005,0x0000003d,0x65646e69,
+0x00000078,0x00050005,0x0000003e,0x64697267,
+0x74646957,0x00000068,0x00040005,0x0000003f,
+0x69727473,0x00006564,0x00040005,0x00000040,
+0x7366666f,0x00007465,0x00060005,0x00000041,
+0x63617266,0x6e6f6974,0x61506c61,0x00007472,
+0x00080005,0x00000047,0x6f636564,0x65576564,
+0x74686769,0x75762873,0x75763b34,0x00003b32,
+0x00050005,0x00000045,0x67696577,0x61447468,
+0x00006174,0x00050005,0x00000046,0x49736f70,
+0x6f6c426e,0x00006b63,0x00050005,0x0000004b,
+0x68736168,0x75283235,0x00003b31,0x00030005,
+0x0000004a,0x00000070,0x00090005,0x00000051,
+0x656c6573,0x61507463,0x74697472,0x286e6f69,
+0x763b3175,0x753b3275,0x00003b31,0x00040005,
+0x0000004e,0x64656573,0x00000000,0x00030005,
+0x0000004f,0x00736f70,0x00060005,0x00000050,
+0x506d756e,0x69747261,0x6e6f6974,0x00000073,
+0x000a0005,0x00000057,0x45746567,0x6f70646e,
+0x45746e69,0x646f636e,0x28676e69,0x753b3175,
+0x31753b31,0x0000003b,0x00080005,0x00000054,
+0x69617661,0x6c62616c,0x646e4565,0x6e696f70,
+0x74694274,0x00000073,0x00060005,0x00000055,
+0x456d756e,0x6f70646e,0x73746e69,0x00000000,
+0x00050005,0x00000056,0x75746361,0x69536c61,
+0x0000657a,0x00070005,0x0000005e,0x65756c62,
+0x746e6f43,0x74636172,0x34697628,0x0000003b,
+0x00030005,0x0000005d,0x00000076,0x00050005,
+0x00000064,0x286d7573,0x3b336976,0x00000000,
+0x00030005,0x00000063,0x00000076,0x00090005,
+0x00000069,0x54746962,0x736e6172,0x53726566,
+0x656e6769,0x69762864,0x69763b34,0x00003b34,
+0x00030005,0x00000067,0x00000061,0x00030005,
+0x00000068,0x00000062,0x000b0005,0x00000071,
+0x6f636564,0x6e456564,0x696f7064,0x2873746e,
+0x3b346976,0x3b346976,0x763b3175,0x763b3475,
+0x003b3475,0x00030005,0x0000006c,0x00004176,
+0x00030005,0x0000006d,0x00004276,0x00040005,
+0x0000006e,0x65646f6d,0x00000000,0x00030005,
+0x0000006f,0x00307065,0x00030005,0x00000070,
+0x00317065,0x000a0005,0x00000078,0x6f636564,
+0x45316564,0x6f70646e,0x28746e69,0x3b347576,
+0x753b3175,0x75763b31,0x00003b33,0x00040005,
+0x00000074,0x61746164,0x00000000,0x00050005,
+0x00000075,0x72617473,0x66664f74,0x00746573,
+0x00040005,0x00000076,0x65646e69,0x00000078,
+0x00050005,0x00000077,0x6f636e65,0x676e6964,
+0x00000000,0x00070005,0x0000007c,0x6c697562,
+0x74694264,0x6b73616d,0x3b317528,0x00000000,
+0x00040005,0x0000007b,0x73746962,0x00000000,
+0x00080005,0x00000080,0x63747361,0x6f636544,
+0x65546564,0x286c6578,0x3b327576,0x00000000,
+0x00050005,0x0000007f,0x49736f70,0x6f6c426e,
+0x00006b63,0x00060005,0x00000084,0x50746567,
+0x4433736f,0x33697628,0x0000003b,0x00030005,
+0x00000083,0x00736f70,0x00040005,0x00000086,
+0x69427174,0x00007374,0x00050005,0x000000a7,
+0x63747361,0x636f6c42,0x0000006b,0x00050005,
+0x000000aa,0x636f6c62,0x7a69536b,0x00000065,
+0x00050005,0x000000ae,0x6f636564,0x72456564,
+0x00726f72,0x00050005,0x000000b0,0x64696f76,
+0x65747845,0x0000746e,0x00040005,0x000000bc,
+0x73746962,0x00003130,0x00040005,0x000000c2,
+0x73746962,0x00003332,0x00040005,0x000000c6,
+0x34746962,0x00000000,0x00040005,0x000000cc,
+0x73746962,0x00003635,0x00040005,0x000000d1,
+0x73746962,0x00003837,0x00030005,0x000000d6,
+0x00000068,0x00050005,0x000000db,0x6c617564,
+0x6e616c50,0x00000065,0x00030005,0x000000e5,
+0x00000072,0x00060005,0x000000f0,0x67696577,
+0x72477468,0x69536469,0x0000657a,0x00060005,
+0x0000014c,0x67696577,0x6e457468,0x69646f63,
+0x0000676e,0x00050005,0x00000163,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x00000166,
+0x576d756e,0x68676965,0x00007374,0x00060005,
+0x0000016f,0x67696577,0x61447468,0x69536174,
+0x0000657a,0x00040005,0x00000170,0x61726170,
+0x0000006d,0x00040005,0x00000172,0x61726170,
+0x0000006d,0x00060005,0x00000183,0x506d756e,
+0x69747261,0x6e6f6974,0x00000073,0x00060005,
+0x0000018d,0x74726170,0x6f697469,0x6565536e,
+0x00000064,0x00030005,0x0000019e,0x00000069,
+0x00030005,0x000001a3,0x0000006a,0x00040005,
+0x000001aa,0x72617473,0x00000074,0x00050005,
+0x000001bd,0x4c6d756e,0x6942776f,0x00007374,
+0x00040005,0x000001c0,0x42776f6c,0x00737469,
+0x00050005,0x000001c9,0x68676968,0x73746942,
+0x00000000,0x00030005,0x000001e0,0x006d6563,
+0x00050005,0x000001eb,0x536d6563,0x63656c65,
+0x00726f74,0x00040005,0x000001f0,0x65736162,
+0x006d6543,0x00080005,0x000001fb,0x70646e65,
+0x746e696f,0x72655073,0x74726150,0x6f697469,
+0x0000006e,0x00060005,0x00000209,0x657a6973,
+0x7845664f,0x43617274,0x00006d65,0x00050005,
+0x00000211,0x72747865,0x6d654361,0x00000000,
+0x00040005,0x00000212,0x61726170,0x0000006d,
+0x00040005,0x00000214,0x61726170,0x0000006d,
+0x00040005,0x00000216,0x61726170,0x0000006d,
+0x00040005,0x00000219,0x6c6c7566,0x006d6543,
+0x00040005,0x0000021e,0x6c61566d,0x00006575,
+0x00040005,0x00000226,0x6c615663,0x00736575,
+0x00050005,0x0000023e,0x65736162,0x73616c43,
+0x00000073,0x00050005,0x0000024d,0x6d756e69,
+0x73746942,0x00000000,0x00040005,0x00000250,
+0x636f6c62,0x0000006b,0x00040005,0x00000257,
+0x61726170,0x0000006d,0x00040005,0x00000259,
+0x61726170,0x0000006d,0x00040005,0x0000025a,
+0x61726170,0x0000006d,0x00050005,0x0000025c,
+0x6b636170,0x72546465,0x00737469,0x00040005,
+0x0000027f,0x42776f6c,0x00737469,0x00040005,
+0x00000280,0x61726170,0x0000006d,0x00040005,
+0x00000282,0x61726170,0x0000006d,0x00040005,
+0x00000284,0x61726170,0x0000006d,0x00030005,
+0x00000288,0x0000006a,0x00040005,0x00000296,
+0x6f636564,0x00646564,0x00050005,0x00000380,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x0000038e,0x6d756e69,0x73746942,0x00000000,
+0x00040005,0x00000391,0x636f6c62,0x0000006b,
+0x00040005,0x00000395,0x61726170,0x0000006d,
+0x00040005,0x00000397,0x61726170,0x0000006d,
+0x00040005,0x00000399,0x61726170,0x0000006d,
+0x00060005,0x0000039b,0x6b636170,0x75516465,
+0x73746e69,0x00000000,0x00040005,0x000003ad,
+0x42776f6c,0x00737469,0x00040005,0x000003b9,
+0x6f636564,0x00646564,0x00050005,0x000003f1,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000405,0x426d756e,0x00737469,0x00040005,
+0x0000040d,0x7366666f,0x00007465,0x00030005,
+0x00000414,0x00000077,0x00040005,0x00000417,
+0x61726170,0x0000006d,0x00040005,0x00000419,
+0x61726170,0x0000006d,0x00040005,0x0000041b,
+0x61726170,0x0000006d,0x00040005,0x0000041d,
+0x61726170,0x0000006d,0x00050005,0x00000436,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000440,0x7366666f,0x00007465,0x00030005,
+0x00000447,0x00000077,0x00040005,0x0000044a,
+0x61726170,0x0000006d,0x00040005,0x0000044c,
+0x61726170,0x0000006d,0x00040005,0x0000044e,
+0x61726170,0x0000006d,0x00040005,0x00000450,
+0x61726170,0x0000006d,0x00050005,0x00000464,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000469,0x7366666f,0x00007465,0x00030005,
+0x0000046d,0x00000077,0x00040005,0x0000046e,
+0x61726170,0x0000006d,0x00040005,0x00000470,
+0x61726170,0x0000006d,0x00040005,0x00000472,
+0x61726170,0x0000006d,0x00040005,0x00000475,
+0x75716e75,0x00746e61,0x00050005,0x00000481,
+0x65646e69,0x6c626178,0x00000065,0x00060005,
+0x00000496,0x67696577,0x6e497468,0x65636964,
+0x00000073,0x00040005,0x000004a4,0x67696577,
+0x00737468,0x00040005,0x000004a5,0x61726170,
+0x0000006d,0x00040005,0x000004a7,0x61726170,
+0x0000006d,0x00040005,0x000004a9,0x61726170,
+0x0000006d,0x00040005,0x000004ab,0x61726170,
+0x0000006d,0x00040005,0x000004af,0x61726170,
+0x0000006d,0x00040005,0x000004b1,0x61726170,
+0x0000006d,0x00040005,0x000004b3,0x61726170,
+0x0000006d,0x00040005,0x000004b5,0x61726170,
+0x0000006d,0x00040005,0x000004b9,0x61726170,
+0x0000006d,0x00040005,0x000004bb,0x61726170,
+0x0000006d,0x00040005,0x000004bd,0x61726170,
+0x0000006d,0x00040005,0x000004bf,0x61726170,
+0x0000006d,0x00040005,0x000004c3,0x61726170,
+0x0000006d,0x00040005,0x000004c5,0x61726170,
+0x0000006d,0x00040005,0x000004c7,0x61726170,
+0x0000006d,0x00040005,0x000004c9,0x61726170,
+0x0000006d,0x00030005,0x000004ce,0x00313177,
+0x00040005,0x000004d6,0x74636166,0x0073726f,
+0x00050005,0x000004f6,0x6c616373,0x63614665,
+0x00726f74,0x00070005,0x00000501,0x6f6d6f68,
+0x656e6567,0x4373756f,0x64726f6f,0x00000073,
+0x00050005,0x00000504,0x64697267,0x726f6f43,
+0x00007364,0x00060005,0x00000510,0x65746e69,
+0x6c617267,0x74726150,0x00000000,0x00060005,
+0x00000514,0x63617266,0x6e6f6974,0x61506c61,
+0x00007472,0x00050005,0x00000519,0x64697267,
+0x74646957,0x00000068,0x00030005,0x0000051c,
+0x00003076,0x00040005,0x00000524,0x67696577,
+0x00737468,0x00040005,0x0000052a,0x61726170,
+0x0000006d,0x00040005,0x0000052c,0x61726170,
+0x0000006d,0x00040005,0x0000052e,0x61726170,
+0x0000006d,0x00040005,0x00000530,0x61726170,
+0x0000006d,0x00040005,0x00000532,0x61726170,
+0x0000006d,0x00040005,0x00000534,0x61726170,
+0x0000006d,0x00040005,0x00000535,0x61726170,
+0x0000006d,0x00040005,0x00000536,0x61726170,
+0x0000006d,0x00040005,0x0000053d,0x61726170,
+0x0000006d,0x00040005,0x0000053f,0x61726170,
+0x0000006d,0x00040005,0x00000541,0x61726170,
+0x0000006d,0x00040005,0x00000543,0x61726170,
+0x0000006d,0x00040005,0x00000545,0x61726170,
+0x0000006d,0x00040005,0x00000547,0x61726170,
+0x0000006d,0x00040005,0x00000548,0x61726170,
+0x0000006d,0x00040005,0x00000549,0x61726170,
+0x0000006d,0x00040005,0x00000593,0x6d756e72,
+0x00000000,0x00040005,0x00000594,0x61726170,
+0x0000006d,0x00040005,0x00000597,0x64656573,
+0x00000041,0x00040005,0x000005a3,0x64656573,
+0x00000042,0x00040005,0x000005b6,0x66696873,
+0x00317374,0x00040005,0x000005c1,0x66696873,
+0x00327374,0x00040005,0x000005d4,0x75736572,
+0x0000746c,0x00030005,0x0000062b,0x00000069,
+0x00050005,0x00000633,0x6f636e65,0x676e6964,
+0x00000000,0x00050005,0x00000641,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000644,
+0x61726170,0x0000006d,0x00040005,0x00000646,
+0x61726170,0x0000006d,0x00030005,0x000006a0,
+0x0000306c,0x00030005,0x000006a9,0x0000316c,
+0x00040005,0x000006c7,0x61726170,0x0000006d,
+0x00040005,0x000006c9,0x61726170,0x0000006d,
+0x00040005,0x00000716,0x61726170,0x0000006d,
+0x00040005,0x0000071a,0x61726170,0x0000006d,
+0x00040005,0x00000726,0x61726170,0x0000006d,
+0x00040005,0x0000072a,0x61726170,0x0000006d,
+0x00040005,0x00000732,0x61726170,0x0000006d,
+0x00040005,0x00000734,0x61726170,0x0000006d,
+0x00040005,0x00000739,0x61726170,0x0000006d,
+0x00040005,0x00000750,0x61726170,0x0000006d,
+0x00040005,0x00000756,0x61726170,0x0000006d,
+0x00040005,0x00000760,0x426d756e,0x00737469,
+0x00040005,0x00000768,0x7366666f,0x00007465,
+0x00030005,0x00000771,0x00007065,0x00040005,
+0x00000774,0x61726170,0x0000006d,0x00040005,
+0x00000776,0x61726170,0x0000006d,0x00040005,
+0x00000778,0x61726170,0x0000006d,0x00040005,
+0x0000077a,0x61726170,0x0000006d,0x00050005,
+0x000007e2,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x000007ec,0x7366666f,0x00007465,
+0x00030005,0x000007f5,0x00007065,0x00040005,
+0x000007f8,0x61726170,0x0000006d,0x00040005,
+0x000007fa,0x61726170,0x0000006d,0x00040005,
+0x000007fc,0x61726170,0x0000006d,0x00040005,
+0x000007fe,0x61726170,0x0000006d,0x00050005,
+0x00000810,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000815,0x7366666f,0x00007465,
+0x00030005,0x0000081b,0x00000077,0x00040005,
+0x0000081c,0x61726170,0x0000006d,0x00040005,
+0x0000081e,0x61726170,0x0000006d,0x00040005,
+0x00000820,0x61726170,0x0000006d,0x00040005,
+0x00000823,0x75716e75,0x00746e61,0x00050005,
+0x00000830,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x0000083e,0x426d756e,0x00737469,
+0x00040005,0x00000847,0x6b73616d,0x00000000,
+0x00050005,0x00000872,0x67696577,0x61447468,
+0x00006174,0x00040005,0x00000876,0x61726170,
+0x0000006d,0x00040005,0x0000087a,0x67696577,
+0x00737468,0x00040005,0x0000087b,0x61726170,
+0x0000006d,0x00060005,0x0000087e,0x74726170,
+0x6f697469,0x646e496e,0x00007865,0x00040005,
+0x0000087f,0x61726170,0x0000006d,0x00040005,
+0x00000881,0x61726170,0x0000006d,0x00040005,
+0x00000882,0x61726170,0x0000006d,0x00060005,
+0x00000885,0x72617473,0x45664f74,0x61727478,
+0x006d6543,0x00060005,0x00000886,0x61746f74,
+0x646e456c,0x6e696f70,0x00007374,0x00070005,
+0x00000887,0x65736162,0x70646e45,0x746e696f,
+0x65646e49,0x00000078,0x00030005,0x00000888,
+0x006d6563,0x00040005,0x00000889,0x61726170,
+0x0000006d,0x00040005,0x0000088b,0x61726170,
+0x0000006d,0x00040005,0x0000088c,0x61726170,
+0x0000006d,0x00040005,0x0000088d,0x61726170,
+0x0000006d,0x00060005,0x00000897,0x70646e65,
+0x746e696f,0x61745373,0x00007472,0x00060005,
+0x0000089d,0x70646e65,0x746e696f,0x646e4573,
+0x00000000,0x00080005,0x000008a5,0x69617661,
+0x6c62616c,0x646e4565,0x6e696f70,0x74694274,
+0x00000073,0x00070005,0x000008a9,0x70646e65,
+0x746e696f,0x6f636e45,0x676e6964,0x00000000,
+0x00070005,0x000008aa,0x75746361,0x6e456c61,
+0x696f7064,0x6942746e,0x00007374,0x00040005,
+0x000008ab,0x61726170,0x0000006d,0x00040005,
+0x000008ad,0x61726170,0x0000006d,0x00040005,
+0x000008af,0x61726170,0x0000006d,0x00070005,
+0x000008b2,0x456d756e,0x6f70646e,0x50746e69,
+0x73726961,0x00000000,0x00030005,0x000008b6,
+0x00004176,0x00030005,0x000008b7,0x00004276,
+0x00040005,0x000008b8,0x61447065,0x00006174,
+0x00040005,0x000008bd,0x61726170,0x0000006d,
+0x00030005,0x000008c0,0x00000069,0x00040005,
+0x000008c9,0x64497065,0x00000078,0x00040005,
+0x000008cf,0x61726170,0x0000006d,0x00040005,
+0x000008d1,0x61726170,0x0000006d,0x00040005,
+0x000008d3,0x61726170,0x0000006d,0x00040005,
+0x000008d5,0x61726170,0x0000006d,0x00040005,
+0x000008dd,0x61726170,0x0000006d,0x00040005,
+0x000008df,0x61726170,0x0000006d,0x00040005,
+0x000008e1,0x61726170,0x0000006d,0x00040005,
+0x000008e2,0x61726170,0x0000006d,0x00030005,
+0x000008e9,0x00307065,0x00030005,0x000008ea,
+0x00317065,0x00040005,0x000008eb,0x61726170,
+0x0000006d,0x00040005,0x000008ed,0x61726170,
+0x0000006d,0x00040005,0x000008ef,0x61726170,
+0x0000006d,0x00040005,0x000008f1,0x61726170,
+0x0000006d,0x00040005,0x000008f2,0x61726170,
+0x0000006d,0x00070005,0x000008f6,0x67696577,
+0x50737468,0x68437265,0x656e6e61,0x0000006c,
+0x00030005,0x000008fd,0x00736363,0x00040005,
+0x000008fe,0x61726170,0x0000006d,0x00040005,
+0x00000900,0x61726170,0x0000006d,0x00040005,
+0x00000902,0x61726170,0x0000006d,0x00050005,
+0x0000091a,0x65786574,0x736f506c,0x00000000,
+0x00080005,0x0000091c,0x475f6c67,0x61626f6c,
+0x766e496c,0x7461636f,0x496e6f69,0x00000044,
+0x00040005,0x0000091f,0x6579616c,0x00000072,
+0x00070005,0x00000920,0x67616d49,0x726f4665,
+0x4274616d,0x6b636f6c,0x00000000,0x00060006,
+0x00000920,0x00000000,0x636f6c62,0x7a69536b,
+0x00000065,0x00060006,0x00000920,0x00000001,
+0x65736162,0x6579614c,0x00000072,0x00060006,
+0x00000920,0x00000002,0x6c616d73,0x6f6c426c,
+0x00006b63,0x00060005,0x00000922,0x75705f75,
+0x6f436873,0x6174736e,0x0000746e,0x00050005,
+0x0000092a,0x636f6c62,0x736f506b,0x00000000,
+0x00050005,0x00000930,0x49736f70,0x6f6c426e,
+0x00006b63,0x00050005,0x00000935,0x63747361,
+0x636f6c42,0x0000006b,0x00050005,0x00000938,
+0x49637273,0x6567616d,0x00000000,0x00040005,
+0x00000941,0x61726170,0x0000006d,0x00040005,
+0x00000945,0x61726170,0x0000006d,0x00040005,
+0x00000947,0x61726170,0x0000006d,0x00040005,
+0x0000094b,0x65786574,0x0000006c,0x00050005,
+0x00000950,0x49747364,0x6567616d,0x00000000,
+0x00040005,0x00000959,0x61726170,0x0000006d,
+0x00040047,0x0000091c,0x0000000b,0x0000001c,
+0x00050048,0x00000920,0x00000000,0x00000023,
+0x00000000,0x00050048,0x00000920,0x00000001,
+0x00000023,0x00000008,0x00050048,0x00000920,
+0x00000002,0x00000023,0x0000000c,0x00030047,
+0x00000920,0x00000002,0x00040047,0x00000938,
+0x00000022,0x00000000,0x00040047,0x00000938,
+0x00000021,0x00000000,0x00030047,0x00000938,
+0x00000018,0x00040047,0x00000950,0x00000022,
+0x00000000,0x00040047,0x00000950,0x00000021,
+0x00000001,0x00030047,0x00000950,0x00000019,
+0x00040047,0x0000095c,0x0000000b,0x00000019,
+0x00020013,0x00000002,0x00030021,0x00000003,
+0x00000002,0x00040015,0x00000006,0x00000020,
+0x00000000,0x00040020,0x00000007,0x00000007,
+0x00000006,0x00040017,0x00000008,0x00000006,
+0x00000003,0x00040020,0x00000009,0x00000007,
+0x00000008,0x00050021,0x0000000a,0x00000006,
+0x00000007,0x00000009,0x00040017,0x0000000f,
+0x00000006,0x00000004,0x00040020,0x00000010,
+0x00000007,0x0000000f,0x00040017,0x00000011,
+0x00000006,0x00000002,0x00040020,0x00000012,
+0x00000007,0x00000011,0x00050021,0x00000013,
+0x00000002,0x00000010,0x00000012,0x00060021,
+0x00000018,0x00000006,0x00000010,0x00000007,
+0x00000007,0x00070021,0x0000001e,0x00000006,
+0x00000007,0x00000007,0x00000007,0x00000007,
+0x00070021,0x00000025,0x00000006,0x00000010,
+0x00000007,0x00000007,0x00000007,0x00070021,
+0x00000032,0x00000006,0x00000010,0x00000009,
+0x00000007,0x00000007,0x000b0021,0x00000039,
+0x00000006,0x00000010,0x00000009,0x00000007,
+0x00000007,0x00000007,0x00000007,0x00000007,
+0x00000012,0x00050021,0x00000044,0x00000011,
+0x00000010,0x00000011,0x00040021,0x00000049,
+0x00000006,0x00000007,0x00060021,0x0000004d,
+0x00000006,0x00000007,0x00000012,0x00000007,
+0x00060021,0x00000053,0x00000008,0x00000007,
+0x00000007,0x00000007,0x00040015,0x00000059,
+0x00000020,0x00000001,0x00040017,0x0000005a,
+0x00000059,0x00000004,0x00040020,0x0000005b,
+0x00000007,0x0000005a,0x00040021,0x0000005c,
+0x0000005a,0x0000005b,0x00040017,0x00000060,
+0x00000059,0x00000003,0x00040020,0x00000061,
+0x00000007,0x00000060,0x00040021,0x00000062,
+0x00000059,0x00000061,0x00050021,0x00000066,
+0x00000002,0x0000005b,0x0000005b,0x00080021,
+0x0000006b,0x00000002,0x0000005b,0x0000005b,
+0x00000007,0x00000010,0x00000010,0x00070021,
+0x00000073,0x00000006,0x00000010,0x00000007,
+0x00000007,0x00000009,0x00040021,0x0000007a,
+0x0000000f,0x00000007,0x00040021,0x0000007e,
+0x0000000f,0x00000011,0x00040021,0x00000082,
+0x00000060,0x00000061,0x0004002b,0x00000006,
+0x0000008c,0x00000008,0x0004002b,0x00000006,
+0x0000008d,0x00000007,0x0005002c,0x00000011,
+0x0000008e,0x0000008c,0x0000008d,0x0004002b,
+0x00000006,0x00000090,0x00000004,0x0004002b,
+0x00000006,0x00000091,0x00000002,0x0005002c,
+0x00000011,0x00000092,0x00000090,0x00000091,
+0x0004002b,0x00000006,0x00000094,0x00000005,
+0x0004002b,0x00000006,0x00000095,0x00000003,
+0x0005002c,0x00000011,0x00000096,0x00000094,
+0x00000095,0x0004002b,0x00000006,0x0000009c,
+0x00000000,0x0004002b,0x00000006,0x0000009f,
+0x00000001,0x00040020,0x000000a6,0x00000006,
+0x0000000f,0x0004003b,0x000000a6,0x000000a7,
+0x00000006,0x00040020,0x000000a9,0x00000006,
+0x00000011,0x0004003b,0x000000a9,0x000000aa,
+0x00000006,0x00020014,0x000000ac,0x00040020,
+0x000000ad,0x00000006,0x000000ac,0x0004003b,
+0x000000ad,0x000000ae,0x00000006,0x0003002a,
+0x000000ac,0x000000af,0x0004003b,0x000000ad,
+0x000000b0,0x00000006,0x00040020,0x000000b1,
+0x00000006,0x00000006,0x0004002b,0x00000006,
+0x000000b4,0x000001ff,0x0004002b,0x00000006,
+0x000000b6,0x000001fc,0x0004002b,0x00000059,
+0x000000bf,0x00000000,0x0004002b,0x00000059,
+0x000000c0,0x00000002,0x0004002b,0x00000059,
+0x000000c9,0x00000004,0x0004002b,0x00000059,
+0x000000ca,0x00000001,0x0004002b,0x00000059,
+0x000000cf,0x00000005,0x0004002b,0x00000059,
+0x000000d4,0x00000007,0x0004002b,0x00000059,
+0x000000d9,0x00000009,0x0004003b,0x000000ad,
+0x000000db,0x00000006,0x0004002b,0x00000059,
+0x000000de,0x0000000a,0x0004003b,0x000000a9,
+0x000000f0,0x00000006,0x0004002b,0x00000006,
+0x000000f1,0x0000000c,0x0004002b,0x00000006,
+0x000000fb,0x00000006,0x0004002b,0x00000006,
+0x00000107,0x0000000a,0x0005002c,0x00000011,
+0x00000108,0x000000fb,0x00000107,0x0005002c,
+0x00000011,0x0000010e,0x00000107,0x000000fb,
+0x00030029,0x000000ac,0x00000110,0x00040017,
+0x00000145,0x000000ac,0x00000002,0x00040020,
+0x0000014b,0x00000006,0x00000008,0x0004003b,
+0x0000014b,0x0000014c,0x00000006,0x0004002b,
+0x00000006,0x0000014d,0x00000010,0x0004001c,
+0x0000014e,0x00000008,0x0000014d,0x0006002c,
+0x00000008,0x0000014f,0x0000009c,0x0000009c,
+0x0000009c,0x0006002c,0x00000008,0x00000150,
+0x0000009c,0x0000009c,0x0000009f,0x0006002c,
+0x00000008,0x00000151,0x0000009f,0x0000009c,
+0x0000009c,0x0006002c,0x00000008,0x00000152,
+0x0000009c,0x0000009c,0x00000091,0x0006002c,
+0x00000008,0x00000153,0x0000009c,0x0000009f,
+0x0000009c,0x0006002c,0x00000008,0x00000154,
+0x0000009f,0x0000009c,0x0000009f,0x0006002c,
+0x00000008,0x00000155,0x0000009c,0x0000009c,
+0x00000095,0x0006002c,0x00000008,0x00000156,
+0x0000009c,0x0000009f,0x0000009f,0x0006002c,
+0x00000008,0x00000157,0x0000009f,0x0000009c,
+0x00000091,0x0006002c,0x00000008,0x00000158,
+0x0000009c,0x0000009c,0x00000090,0x0006002c,
+0x00000008,0x00000159,0x0000009c,0x0000009f,
+0x00000091,0x0006002c,0x00000008,0x0000015a,
+0x0000009f,0x0000009c,0x00000095,0x0006002c,
+0x00000008,0x0000015b,0x0000009c,0x0000009c,
+0x00000094,0x0013002c,0x0000014e,0x0000015c,
+0x0000014f,0x0000014f,0x00000150,0x00000151,
+0x00000152,0x00000153,0x00000154,0x00000155,
+0x0000014f,0x0000014f,0x00000156,0x00000157,
+0x00000158,0x00000159,0x0000015a,0x0000015b,
+0x0004002b,0x00000059,0x0000015e,0x00000003,
+0x00040020,0x00000162,0x00000007,0x0000014e,
+0x0004003b,0x000000b1,0x00000166,0x00000006,
+0x0004003b,0x000000b1,0x0000016f,0x00000006,
+0x0004002b,0x00000006,0x00000176,0x00000018,
+0x0004002b,0x00000006,0x00000179,0x00000060,
+0x0004002b,0x00000006,0x0000017d,0x00000040,
+0x0004003b,0x000000b1,0x00000183,0x00000006,
+0x0004002b,0x00000059,0x00000186,0x0000000b,
+0x0004003b,0x000000b1,0x0000018d,0x00000006,
+0x0004002b,0x00000059,0x00000190,0x0000000d,
+0x0004002b,0x00000006,0x000001a0,0x00000020,
+0x0004002b,0x00000006,0x000001ac,0x0000001f,
+0x0004002b,0x00000006,0x000001dd,0x00000080,
+0x0004002b,0x00000059,0x000001ee,0x00000017,
+0x0004002b,0x00000059,0x000001f3,0x00000019,
+0x00040020,0x0000024c,0x00000007,0x00000059,
+0x0007002c,0x0000005a,0x00000290,0x000000c0,
+0x000000c9,0x000000cf,0x000000d4,0x0004002b,
+0x00000006,0x00000297,0x00000100,0x0004001c,
+0x00000298,0x00000006,0x00000297,0x0004002b,
+0x00000006,0x00000299,0x00000021,0x0004002b,
+0x00000006,0x0000029a,0x00000009,0x0004002b,
+0x00000006,0x0000029b,0x00000022,0x0004002b,
+0x00000006,0x0000029c,0x00000028,0x0004002b,
+0x00000006,0x0000029d,0x00000029,0x0004002b,
+0x00000006,0x0000029e,0x0000002a,0x0004002b,
+0x00000006,0x0000029f,0x00000011,0x0004002b,
+0x00000006,0x000002a0,0x00000012,0x0004002b,
+0x00000006,0x000002a1,0x00000024,0x0004002b,
+0x00000006,0x000002a2,0x00000014,0x0004002b,
+0x00000006,0x000002a3,0x00000015,0x0004002b,
+0x00000006,0x000002a4,0x00000016,0x0004002b,
+0x00000006,0x000002a5,0x00000025,0x0004002b,
+0x00000006,0x000002a6,0x00000019,0x0004002b,
+0x00000006,0x000002a7,0x0000001a,0x0004002b,
+0x00000006,0x000002a8,0x00000026,0x0004002b,
+0x00000006,0x000002a9,0x00000280,0x0004002b,
+0x00000006,0x000002aa,0x00000281,0x0004002b,
+0x00000006,0x000002ab,0x00000282,0x0004002b,
+0x00000006,0x000002ac,0x000002a0,0x0004002b,
+0x00000006,0x000002ad,0x00000041,0x0004002b,
+0x00000006,0x000002ae,0x00000042,0x0004002b,
+0x00000006,0x000002af,0x00000044,0x0004002b,
+0x00000006,0x000002b0,0x00000045,0x0004002b,
+0x00000006,0x000002b1,0x00000046,0x0004002b,
+0x00000006,0x000002b2,0x00000061,0x0004002b,
+0x00000006,0x000002b3,0x00000048,0x0004002b,
+0x00000006,0x000002b4,0x00000049,0x0004002b,
+0x00000006,0x000002b5,0x0000004a,0x0004002b,
+0x00000006,0x000002b6,0x00000062,0x0004002b,
+0x00000006,0x000002b7,0x00000068,0x0004002b,
+0x00000006,0x000002b8,0x00000069,0x0004002b,
+0x00000006,0x000002b9,0x0000006a,0x0004002b,
+0x00000006,0x000002ba,0x00000050,0x0004002b,
+0x00000006,0x000002bb,0x00000051,0x0004002b,
+0x00000006,0x000002bc,0x00000052,0x0004002b,
+0x00000006,0x000002bd,0x00000064,0x0004002b,
+0x00000006,0x000002be,0x00000054,0x0004002b,
+0x00000006,0x000002bf,0x00000055,0x0004002b,
+0x00000006,0x000002c0,0x00000056,0x0004002b,
+0x00000006,0x000002c1,0x00000065,0x0004002b,
+0x00000006,0x000002c2,0x00000058,0x0004002b,
+0x00000006,0x000002c3,0x00000059,0x0004002b,
+0x00000006,0x000002c4,0x0000005a,0x0004002b,
+0x00000006,0x000002c5,0x00000066,0x0004002b,
+0x00000006,0x000002c6,0x00000284,0x0004002b,
+0x00000006,0x000002c7,0x00000285,0x0004002b,
+0x00000006,0x000002c8,0x00000286,0x0004002b,
+0x00000006,0x000002c9,0x000002a1,0x0004002b,
+0x00000006,0x000002ca,0x00000081,0x0004002b,
+0x00000006,0x000002cb,0x00000082,0x0004002b,
+0x00000006,0x000002cc,0x000000a0,0x0004002b,
+0x00000006,0x000002cd,0x00000084,0x0004002b,
+0x00000006,0x000002ce,0x00000085,0x0004002b,
+0x00000006,0x000002cf,0x00000086,0x0004002b,
+0x00000006,0x000002d0,0x000000a1,0x0004002b,
+0x00000006,0x000002d1,0x00000088,0x0004002b,
+0x00000006,0x000002d2,0x00000089,0x0004002b,
+0x00000006,0x000002d3,0x0000008a,0x0004002b,
+0x00000006,0x000002d4,0x000000a2,0x0004002b,
+0x00000006,0x000002d5,0x000000a8,0x0004002b,
+0x00000006,0x000002d6,0x000000a9,0x0004002b,
+0x00000006,0x000002d7,0x000000aa,0x0004002b,
+0x00000006,0x000002d8,0x00000090,0x0004002b,
+0x00000006,0x000002d9,0x00000091,0x0004002b,
+0x00000006,0x000002da,0x00000092,0x0004002b,
+0x00000006,0x000002db,0x000000a4,0x0004002b,
+0x00000006,0x000002dc,0x00000094,0x0004002b,
+0x00000006,0x000002dd,0x00000095,0x0004002b,
+0x00000006,0x000002de,0x00000096,0x0004002b,
+0x00000006,0x000002df,0x000000a5,0x0004002b,
+0x00000006,0x000002e0,0x00000098,0x0004002b,
+0x00000006,0x000002e1,0x00000099,0x0004002b,
+0x00000006,0x000002e2,0x0000009a,0x0004002b,
+0x00000006,0x000002e3,0x000000a6,0x0004002b,
+0x00000006,0x000002e4,0x00000288,0x0004002b,
+0x00000006,0x000002e5,0x00000289,0x0004002b,
+0x00000006,0x000002e6,0x0000028a,0x0004002b,
+0x00000006,0x000002e7,0x000002a2,0x0004002b,
+0x00000006,0x000002e8,0x00000200,0x0004002b,
+0x00000006,0x000002e9,0x00000201,0x0004002b,
+0x00000006,0x000002ea,0x00000202,0x0004002b,
+0x00000006,0x000002eb,0x00000220,0x0004002b,
+0x00000006,0x000002ec,0x00000204,0x0004002b,
+0x00000006,0x000002ed,0x00000205,0x0004002b,
+0x00000006,0x000002ee,0x00000206,0x0004002b,
+0x00000006,0x000002ef,0x00000221,0x0004002b,
+0x00000006,0x000002f0,0x00000208,0x0004002b,
+0x00000006,0x000002f1,0x00000209,0x0004002b,
+0x00000006,0x000002f2,0x0000020a,0x0004002b,
+0x00000006,0x000002f3,0x00000222,0x0004002b,
+0x00000006,0x000002f4,0x00000228,0x0004002b,
+0x00000006,0x000002f5,0x00000229,0x0004002b,
+0x00000006,0x000002f6,0x0000022a,0x0004002b,
+0x00000006,0x000002f7,0x00000210,0x0004002b,
+0x00000006,0x000002f8,0x00000211,0x0004002b,
+0x00000006,0x000002f9,0x00000212,0x0004002b,
+0x00000006,0x000002fa,0x00000224,0x0004002b,
+0x00000006,0x000002fb,0x00000214,0x0004002b,
+0x00000006,0x000002fc,0x00000215,0x0004002b,
+0x00000006,0x000002fd,0x00000216,0x0004002b,
+0x00000006,0x000002fe,0x00000225,0x0004002b,
+0x00000006,0x000002ff,0x00000218,0x0004002b,
+0x00000006,0x00000300,0x00000219,0x0004002b,
+0x00000006,0x00000301,0x0000021a,0x0004002b,
+0x00000006,0x00000302,0x00000226,0x0004002b,
+0x00000006,0x00000303,0x000002a8,0x0004002b,
+0x00000006,0x00000304,0x000002a9,0x0004002b,
+0x00000006,0x00000305,0x000002aa,0x0004002b,
+0x00000006,0x00000306,0x00000101,0x0004002b,
+0x00000006,0x00000307,0x00000102,0x0004002b,
+0x00000006,0x00000308,0x00000120,0x0004002b,
+0x00000006,0x00000309,0x00000104,0x0004002b,
+0x00000006,0x0000030a,0x00000105,0x0004002b,
+0x00000006,0x0000030b,0x00000106,0x0004002b,
+0x00000006,0x0000030c,0x00000121,0x0004002b,
+0x00000006,0x0000030d,0x00000108,0x0004002b,
+0x00000006,0x0000030e,0x00000109,0x0004002b,
+0x00000006,0x0000030f,0x0000010a,0x0004002b,
+0x00000006,0x00000310,0x00000122,0x0004002b,
+0x00000006,0x00000311,0x00000128,0x0004002b,
+0x00000006,0x00000312,0x00000129,0x0004002b,
+0x00000006,0x00000313,0x0000012a,0x0004002b,
+0x00000006,0x00000314,0x00000110,0x0004002b,
+0x00000006,0x00000315,0x00000111,0x0004002b,
+0x00000006,0x00000316,0x00000112,0x0004002b,
+0x00000006,0x00000317,0x00000124,0x0004002b,
+0x00000006,0x00000318,0x00000114,0x0004002b,
+0x00000006,0x00000319,0x00000115,0x0004002b,
+0x00000006,0x0000031a,0x00000116,0x0004002b,
+0x00000006,0x0000031b,0x00000125,0x0004002b,
+0x00000006,0x0000031c,0x00000118,0x0004002b,
+0x00000006,0x0000031d,0x00000119,0x0004002b,
+0x00000006,0x0000031e,0x0000011a,0x0004002b,
+0x00000006,0x0000031f,0x00000126,0x0004002b,
+0x00000006,0x00000320,0x00000290,0x0004002b,
+0x00000006,0x00000321,0x00000291,0x0004002b,
+0x00000006,0x00000322,0x00000292,0x0004002b,
+0x00000006,0x00000323,0x000002a4,0x0004002b,
+0x00000006,0x00000324,0x00000140,0x0004002b,
+0x00000006,0x00000325,0x00000141,0x0004002b,
+0x00000006,0x00000326,0x00000142,0x0004002b,
+0x00000006,0x00000327,0x00000160,0x0004002b,
+0x00000006,0x00000328,0x00000144,0x0004002b,
+0x00000006,0x00000329,0x00000145,0x0004002b,
+0x00000006,0x0000032a,0x00000146,0x0004002b,
+0x00000006,0x0000032b,0x00000161,0x0004002b,
+0x00000006,0x0000032c,0x00000148,0x0004002b,
+0x00000006,0x0000032d,0x00000149,0x0004002b,
+0x00000006,0x0000032e,0x0000014a,0x0004002b,
+0x00000006,0x0000032f,0x00000162,0x0004002b,
+0x00000006,0x00000330,0x00000168,0x0004002b,
+0x00000006,0x00000331,0x00000169,0x0004002b,
+0x00000006,0x00000332,0x0000016a,0x0004002b,
+0x00000006,0x00000333,0x00000150,0x0004002b,
+0x00000006,0x00000334,0x00000151,0x0004002b,
+0x00000006,0x00000335,0x00000152,0x0004002b,
+0x00000006,0x00000336,0x00000164,0x0004002b,
+0x00000006,0x00000337,0x00000154,0x0004002b,
+0x00000006,0x00000338,0x00000155,0x0004002b,
+0x00000006,0x00000339,0x00000156,0x0004002b,
+0x00000006,0x0000033a,0x00000165,0x0004002b,
+0x00000006,0x0000033b,0x00000158,0x0004002b,
+0x00000006,0x0000033c,0x00000159,0x0004002b,
+0x00000006,0x0000033d,0x0000015a,0x0004002b,
+0x00000006,0x0000033e,0x00000166,0x0004002b,
+0x00000006,0x0000033f,0x00000294,0x0004002b,
+0x00000006,0x00000340,0x00000295,0x0004002b,
+0x00000006,0x00000341,0x00000296,0x0004002b,
+0x00000006,0x00000342,0x000002a5,0x0004002b,
+0x00000006,0x00000343,0x00000180,0x0004002b,
+0x00000006,0x00000344,0x00000181,0x0004002b,
+0x00000006,0x00000345,0x00000182,0x0004002b,
+0x00000006,0x00000346,0x000001a0,0x0004002b,
+0x00000006,0x00000347,0x00000184,0x0004002b,
+0x00000006,0x00000348,0x00000185,0x0004002b,
+0x00000006,0x00000349,0x00000186,0x0004002b,
+0x00000006,0x0000034a,0x000001a1,0x0004002b,
+0x00000006,0x0000034b,0x00000188,0x0004002b,
+0x00000006,0x0000034c,0x00000189,0x0004002b,
+0x00000006,0x0000034d,0x0000018a,0x0004002b,
+0x00000006,0x0000034e,0x000001a2,0x0004002b,
+0x00000006,0x0000034f,0x000001a8,0x0004002b,
+0x00000006,0x00000350,0x000001a9,0x0004002b,
+0x00000006,0x00000351,0x000001aa,0x0004002b,
+0x00000006,0x00000352,0x00000190,0x0004002b,
+0x00000006,0x00000353,0x00000191,0x0004002b,
+0x00000006,0x00000354,0x00000192,0x0004002b,
+0x00000006,0x00000355,0x000001a4,0x0004002b,
+0x00000006,0x00000356,0x00000194,0x0004002b,
+0x00000006,0x00000357,0x00000195,0x0004002b,
+0x00000006,0x00000358,0x00000196,0x0004002b,
+0x00000006,0x00000359,0x000001a5,0x0004002b,
+0x00000006,0x0000035a,0x00000198,0x0004002b,
+0x00000006,0x0000035b,0x00000199,0x0004002b,
+0x00000006,0x0000035c,0x0000019a,0x0004002b,
+0x00000006,0x0000035d,0x000001a6,0x0004002b,
+0x00000006,0x0000035e,0x00000298,0x0004002b,
+0x00000006,0x0000035f,0x00000299,0x0004002b,
+0x00000006,0x00000360,0x0000029a,0x0004002b,
+0x00000006,0x00000361,0x000002a6,0x0004002b,
+0x00000006,0x00000362,0x00000240,0x0004002b,
+0x00000006,0x00000363,0x00000241,0x0004002b,
+0x00000006,0x00000364,0x00000242,0x0004002b,
+0x00000006,0x00000365,0x00000260,0x0004002b,
+0x00000006,0x00000366,0x00000244,0x0004002b,
+0x00000006,0x00000367,0x00000245,0x0004002b,
+0x00000006,0x00000368,0x00000246,0x0004002b,
+0x00000006,0x00000369,0x00000261,0x0004002b,
+0x00000006,0x0000036a,0x00000248,0x0004002b,
+0x00000006,0x0000036b,0x00000249,0x0004002b,
+0x00000006,0x0000036c,0x0000024a,0x0004002b,
+0x00000006,0x0000036d,0x00000262,0x0004002b,
+0x00000006,0x0000036e,0x00000268,0x0004002b,
+0x00000006,0x0000036f,0x00000269,0x0004002b,
+0x00000006,0x00000370,0x0000026a,0x0004002b,
+0x00000006,0x00000371,0x00000250,0x0004002b,
+0x00000006,0x00000372,0x00000251,0x0004002b,
+0x00000006,0x00000373,0x00000252,0x0004002b,
+0x00000006,0x00000374,0x00000264,0x0004002b,
+0x00000006,0x00000375,0x00000254,0x0004002b,
+0x00000006,0x00000376,0x00000255,0x0004002b,
+0x00000006,0x00000377,0x00000256,0x0004002b,
+0x00000006,0x00000378,0x00000265,0x0004002b,
+0x00000006,0x00000379,0x00000258,0x0004002b,
+0x00000006,0x0000037a,0x00000259,0x0004002b,
+0x00000006,0x0000037b,0x0000025a,0x0004002b,
+0x00000006,0x0000037c,0x00000266,0x0103002c,
+0x00000298,0x0000037d,0x0000009c,0x0000009f,
+0x00000091,0x000001a0,0x00000090,0x00000094,
+0x000000fb,0x00000299,0x0000008c,0x0000029a,
+0x00000107,0x0000029b,0x0000029c,0x0000029d,
+0x0000029e,0x0000029b,0x0000014d,0x0000029f,
+0x000002a0,0x000002a1,0x000002a2,0x000002a3,
+0x000002a4,0x000002a5,0x00000176,0x000002a6,
+0x000002a7,0x000002a8,0x000002a9,0x000002aa,
+0x000002ab,0x000002ac,0x0000017d,0x000002ad,
+0x000002ae,0x00000179,0x000002af,0x000002b0,
+0x000002b1,0x000002b2,0x000002b3,0x000002b4,
+0x000002b5,0x000002b6,0x000002b7,0x000002b8,
+0x000002b9,0x000002b6,0x000002ba,0x000002bb,
+0x000002bc,0x000002bd,0x000002be,0x000002bf,
+0x000002c0,0x000002c1,0x000002c2,0x000002c3,
+0x000002c4,0x000002c5,0x000002c6,0x000002c7,
+0x000002c8,0x000002c9,0x000001dd,0x000002ca,
+0x000002cb,0x000002cc,0x000002cd,0x000002ce,
+0x000002cf,0x000002d0,0x000002d1,0x000002d2,
+0x000002d3,0x000002d4,0x000002d5,0x000002d6,
+0x000002d7,0x000002d4,0x000002d8,0x000002d9,
+0x000002da,0x000002db,0x000002dc,0x000002dd,
+0x000002de,0x000002df,0x000002e0,0x000002e1,
+0x000002e2,0x000002e3,0x000002e4,0x000002e5,
+0x000002e6,0x000002e7,0x000002e8,0x000002e9,
+0x000002ea,0x000002eb,0x000002ec,0x000002ed,
+0x000002ee,0x000002ef,0x000002f0,0x000002f1,
+0x000002f2,0x000002f3,0x000002f4,0x000002f5,
+0x000002f6,0x000002f3,0x000002f7,0x000002f8,
+0x000002f9,0x000002fa,0x000002fb,0x000002fc,
+0x000002fd,0x000002fe,0x000002ff,0x00000300,
+0x00000301,0x00000302,0x00000303,0x00000304,
+0x00000305,0x000002e7,0x00000297,0x00000306,
+0x00000307,0x00000308,0x00000309,0x0000030a,
+0x0000030b,0x0000030c,0x0000030d,0x0000030e,
+0x0000030f,0x00000310,0x00000311,0x00000312,
+0x00000313,0x00000310,0x00000314,0x00000315,
+0x00000316,0x00000317,0x00000318,0x00000319,
+0x0000031a,0x0000031b,0x0000031c,0x0000031d,
+0x0000031e,0x0000031f,0x00000320,0x00000321,
+0x00000322,0x00000323,0x00000324,0x00000325,
+0x00000326,0x00000327,0x00000328,0x00000329,
+0x0000032a,0x0000032b,0x0000032c,0x0000032d,
+0x0000032e,0x0000032f,0x00000330,0x00000331,
+0x00000332,0x0000032f,0x00000333,0x00000334,
+0x00000335,0x00000336,0x00000337,0x00000338,
+0x00000339,0x0000033a,0x0000033b,0x0000033c,
+0x0000033d,0x0000033e,0x0000033f,0x00000340,
+0x00000341,0x00000342,0x00000343,0x00000344,
+0x00000345,0x00000346,0x00000347,0x00000348,
+0x00000349,0x0000034a,0x0000034b,0x0000034c,
+0x0000034d,0x0000034e,0x0000034f,0x00000350,
+0x00000351,0x0000034e,0x00000352,0x00000353,
+0x00000354,0x00000355,0x00000356,0x00000357,
+0x00000358,0x00000359,0x0000035a,0x0000035b,
+0x0000035c,0x0000035d,0x0000035e,0x0000035f,
+0x00000360,0x00000361,0x00000362,0x00000363,
+0x00000364,0x00000365,0x00000366,0x00000367,
+0x00000368,0x00000369,0x0000036a,0x0000036b,
+0x0000036c,0x0000036d,0x0000036e,0x0000036f,
+0x00000370,0x0000036d,0x00000371,0x00000372,
+0x00000373,0x00000374,0x00000375,0x00000376,
+0x00000377,0x00000378,0x00000379,0x0000037a,
+0x0000037b,0x0000037c,0x00000303,0x00000304,
+0x00000305,0x00000361,0x00040020,0x0000037f,
+0x00000007,0x00000298,0x0006002c,0x00000060,
+0x000003b3,0x000000bf,0x0000015e,0x000000cf,
+0x0004001c,0x000003ba,0x00000006,0x000001dd,
+0x0004002b,0x00000006,0x000003bb,0x0000000b,
+0x0004002b,0x00000006,0x000003bc,0x00000013,
+0x0004002b,0x00000006,0x000003bd,0x0000001b,
+0x0004002b,0x00000006,0x000003be,0x0000001c,
+0x0004002b,0x00000006,0x000003bf,0x00000023,
+0x0004002b,0x00000006,0x000003c0,0x000000e4,
+0x0004002b,0x00000006,0x000003c1,0x00000043,
+0x0004002b,0x00000006,0x000003c2,0x0000004b,
+0x0004002b,0x00000006,0x000003c3,0x0000004c,
+0x0004002b,0x00000006,0x000003c4,0x0000010c,
+0x0004002b,0x00000006,0x000003c5,0x00000053,
+0x0004002b,0x00000006,0x000003c6,0x0000005b,
+0x0004002b,0x00000006,0x000003c7,0x0000005c,
+0x0004002b,0x00000006,0x000003c8,0x00000063,
+0x0004002b,0x00000006,0x000003c9,0x0000011c,
+0x0004002b,0x00000006,0x000003ca,0x00000123,
+0x0004002b,0x00000006,0x000003cb,0x00000083,
+0x0004002b,0x00000006,0x000003cc,0x00000103,
+0x0004002b,0x00000006,0x000003cd,0x0000008b,
+0x0004002b,0x00000006,0x000003ce,0x0000008c,
+0x0004002b,0x00000006,0x000003cf,0x0000010b,
+0x0004002b,0x00000006,0x000003d0,0x00000093,
+0x0004002b,0x00000006,0x000003d1,0x00000113,
+0x0004002b,0x00000006,0x000003d2,0x0000009b,
+0x0004002b,0x00000006,0x000003d3,0x0000009c,
+0x0004002b,0x00000006,0x000003d4,0x000000a3,
+0x0004002b,0x00000006,0x000003d5,0x0000011b,
+0x0004002b,0x00000006,0x000003d6,0x000000c0,
+0x0004002b,0x00000006,0x000003d7,0x000000c1,
+0x0004002b,0x00000006,0x000003d8,0x000000c2,
+0x0004002b,0x00000006,0x000003d9,0x000000c3,
+0x0004002b,0x00000006,0x000003da,0x000000c4,
+0x0004002b,0x00000006,0x000003db,0x000000e0,
+0x0004002b,0x00000006,0x000003dc,0x000000c8,
+0x0004002b,0x00000006,0x000003dd,0x000000c9,
+0x0004002b,0x00000006,0x000003de,0x000000ca,
+0x0004002b,0x00000006,0x000003df,0x000000cb,
+0x0004002b,0x00000006,0x000003e0,0x000000cc,
+0x0004002b,0x00000006,0x000003e1,0x000000e1,
+0x0004002b,0x00000006,0x000003e2,0x000000d0,
+0x0004002b,0x00000006,0x000003e3,0x000000d1,
+0x0004002b,0x00000006,0x000003e4,0x000000d2,
+0x0004002b,0x00000006,0x000003e5,0x000000d3,
+0x0004002b,0x00000006,0x000003e6,0x000000d4,
+0x0004002b,0x00000006,0x000003e7,0x000000e2,
+0x0004002b,0x00000006,0x000003e8,0x000000d8,
+0x0004002b,0x00000006,0x000003e9,0x000000d9,
+0x0004002b,0x00000006,0x000003ea,0x000000da,
+0x0004002b,0x00000006,0x000003eb,0x000000db,
+0x0004002b,0x00000006,0x000003ec,0x000000dc,
+0x0004002b,0x00000006,0x000003ed,0x000000e3,
+0x0083002c,0x000003ba,0x000003ee,0x0000009c,
+0x0000009f,0x00000091,0x00000095,0x00000090,
+0x000001a0,0x000002a1,0x00000317,0x0000008c,
+0x0000029a,0x00000107,0x000003bb,0x000000f1,
+0x00000299,0x000002bd,0x00000317,0x0000014d,
+0x0000029f,0x000002a0,0x000003bc,0x000002a2,
+0x0000029b,0x000002db,0x00000317,0x00000176,
+0x000002a6,0x000002a7,0x000003bd,0x000003be,
+0x000003bf,0x000003c0,0x00000317,0x0000017d,
+0x000002ad,0x000002ae,0x000003c1,0x000002af,
+0x00000179,0x00000309,0x00000308,0x000002b3,
+0x000002b4,0x000002b5,0x000003c2,0x000003c3,
+0x000002b2,0x000003c4,0x0000030c,0x000002ba,
+0x000002bb,0x000002bc,0x000003c5,0x000002be,
+0x000002b6,0x00000318,0x00000310,0x000002c2,
+0x000002c3,0x000002c4,0x000003c6,0x000003c7,
+0x000003c8,0x000003c9,0x000003ca,0x000001dd,
+0x000002ca,0x000002cb,0x000003cb,0x000002cd,
+0x000002cc,0x00000307,0x000003cc,0x000002d1,
+0x000002d2,0x000002d3,0x000003cd,0x000003ce,
+0x000002d0,0x0000030f,0x000003cf,0x000002d8,
+0x000002d9,0x000002da,0x000003d0,0x000002dc,
+0x000002d4,0x00000316,0x000003d1,0x000002e0,
+0x000002e1,0x000002e2,0x000003d2,0x000003d3,
+0x000003d4,0x0000031e,0x000003d5,0x000003d6,
+0x000003d7,0x000003d8,0x000003d9,0x000003da,
+0x000003db,0x00000297,0x00000306,0x000003dc,
+0x000003dd,0x000003de,0x000003df,0x000003e0,
+0x000003e1,0x0000030d,0x0000030e,0x000003e2,
+0x000003e3,0x000003e4,0x000003e5,0x000003e6,
+0x000003e7,0x00000314,0x00000315,0x000003e8,
+0x000003e9,0x000003ea,0x000003eb,0x000003ec,
+0x000003ed,0x0000031c,0x0000031d,0x00040020,
+0x000003f0,0x00000007,0x000003ba,0x0004002b,
+0x00000006,0x0000041f,0x0000002d,0x0004001c,
+0x00000420,0x00000006,0x0000041f,0x0004002b,
+0x00000006,0x00000421,0x00000034,0x0004002b,
+0x00000006,0x00000422,0x00000027,0x0004002b,
+0x00000006,0x00000423,0x0000002f,0x0004002b,
+0x00000006,0x00000424,0x0000003b,0x0004002b,
+0x00000006,0x00000425,0x00000017,0x0004002b,
+0x00000006,0x00000426,0x00000035,0x0004002b,
+0x00000006,0x00000427,0x00000038,0x0004002b,
+0x00000006,0x00000428,0x00000030,0x0004002b,
+0x00000006,0x00000429,0x0000003e,0x0004002b,
+0x00000006,0x0000042a,0x0000000d,0x0004002b,
+0x00000006,0x0000042b,0x00000033,0x0004002b,
+0x00000006,0x0000042c,0x0000001e,0x0030002c,
+0x00000420,0x0000042d,0x0000009c,0x000001a0,
+0x0000017d,0x0000009c,0x0000017d,0x000000f1,
+0x00000421,0x000002a6,0x00000422,0x0000009c,
+0x0000017d,0x0000029f,0x00000423,0x00000094,
+0x00000424,0x00000425,0x0000029d,0x000003bb,
+0x00000426,0x000003be,0x000002a1,0x0000009c,
+0x0000017d,0x0000008c,0x00000427,0x0000014d,
+0x00000428,0x00000176,0x0000029c,0x00000091,
+0x00000429,0x000003bb,0x00000426,0x000003bc,
+0x0000041f,0x000003bd,0x000002a5,0x00000094,
+0x00000424,0x0000042a,0x0000042b,0x000002a4,
+0x0000029e,0x0000042c,0x0000029b,0x00040020,
+0x00000435,0x00000007,0x00000420,0x0004001c,
+0x00000452,0x00000006,0x000003bf,0x0004002b,
+0x00000006,0x00000453,0x00000039,0x0004002b,
+0x00000006,0x00000454,0x0000000e,0x0004002b,
+0x00000006,0x00000455,0x00000032,0x0004002b,
+0x00000006,0x00000456,0x0000002b,0x0004002b,
+0x00000006,0x00000457,0x0000003d,0x0004002b,
+0x00000006,0x00000458,0x0000003a,0x0004002b,
+0x00000006,0x00000459,0x00000037,0x0004002b,
+0x00000006,0x0000045a,0x0000001d,0x0026002c,
+0x00000452,0x0000045b,0x0000009c,0x0000014d,
+0x000001a0,0x00000428,0x0000017d,0x0000009c,
+0x0000017d,0x0000008d,0x00000453,0x00000454,
+0x00000455,0x000002a3,0x00000456,0x000003be,
+0x000002a1,0x0000009c,0x0000017d,0x0000014d,
+0x00000428,0x00000095,0x00000457,0x000003bc,
+0x0000041f,0x000000fb,0x00000458,0x00000425,
+0x0000029d,0x0000029a,0x00000459,0x000002a7,
+0x000002a8,0x0000042a,0x0000042b,0x0000045a,
+0x000003bf,0x00040020,0x00000463,0x00000007,
+0x00000452,0x0004001c,0x00000476,0x00000011,
+0x000000fb,0x0004002b,0x00000006,0x00000477,
+0x0000003f,0x0005002c,0x00000011,0x00000478,
+0x00000477,0x0000008c,0x0005002c,0x00000011,
+0x00000479,0x000002a3,0x0000008c,0x0005002c,
+0x00000011,0x0000047a,0x0000029a,0x0000008c,
+0x0005002c,0x00000011,0x0000047b,0x00000091,
+0x00000090,0x0005002c,0x00000011,0x0000047c,
+0x0000009f,0x0000008c,0x0009002c,0x00000476,
+0x0000047d,0x00000478,0x00000479,0x0000047a,
+0x00000092,0x0000047b,0x0000047c,0x00040020,
+0x00000480,0x00000007,0x00000476,0x00030016,
+0x000004ea,0x00000020,0x00040017,0x000004eb,
+0x000004ea,0x00000004,0x0004002b,0x000004ea,
+0x000004f0,0x41000000,0x0004002b,0x00000006,
+0x000004f7,0x00000400,0x0004002b,0x00000059,
+0x0000050c,0x00000006,0x00040017,0x0000050d,
+0x00000059,0x00000002,0x0004002b,0x00000006,
+0x00000516,0x0000000f,0x0005002c,0x00000011,
+0x00000525,0x0000009c,0x0000009c,0x0004002b,
+0x00000059,0x00000551,0x0000000f,0x0004002b,
+0x00000059,0x00000556,0x00000011,0x0004002b,
+0x00000059,0x00000567,0x00000010,0x0004002b,
+0x00000059,0x0000059d,0x00000008,0x0004002b,
+0x00000059,0x000005a0,0x0000000c,0x0004002b,
+0x00000059,0x000005a7,0x00000014,0x0004002b,
+0x00000059,0x000005aa,0x00000018,0x0004002b,
+0x00000059,0x000005ad,0x0000001c,0x00040017,
+0x000005d7,0x000004ea,0x00000002,0x0007002c,
+0x0000000f,0x000005f5,0x00000454,0x00000107,
+0x000000fb,0x00000091,0x0007002c,0x0000000f,
+0x000005f8,0x00000477,0x00000477,0x00000477,
+0x00000477,0x00040017,0x0000060e,0x000000ac,
+0x00000003,0x0004001c,0x00000634,0x00000008,
+0x000003bc,0x0006002c,0x00000008,0x00000635,
+0x0000009c,0x0000009c,0x0000008c,0x0006002c,
+0x00000008,0x00000636,0x0000009f,0x0000009c,
+0x000000fb,0x0006002c,0x00000008,0x00000637,
+0x0000009c,0x0000009f,0x00000094,0x0006002c,
+0x00000008,0x00000638,0x0000009c,0x0000009c,
+0x0000008d,0x0006002c,0x00000008,0x00000639,
+0x0000009f,0x0000009c,0x00000094,0x0006002c,
+0x00000008,0x0000063a,0x0000009c,0x0000009f,
+0x00000090,0x0006002c,0x00000008,0x0000063b,
+0x0000009c,0x0000009c,0x000000fb,0x0006002c,
+0x00000008,0x0000063c,0x0000009f,0x0000009c,
+0x00000090,0x0006002c,0x00000008,0x0000063d,
+0x0000009c,0x0000009f,0x00000095,0x0016002c,
+0x00000634,0x0000063e,0x00000635,0x00000636,
+0x00000637,0x00000638,0x00000639,0x0000063a,
+0x0000063b,0x0000063c,0x0000063d,0x0000015b,
+0x0000015a,0x00000159,0x00000158,0x00000157,
+0x00000156,0x00000155,0x00000154,0x00000152,
+0x00000150,0x00040020,0x00000640,0x00000007,
+0x00000634,0x0004002b,0x00000059,0x00000675,
+0x00000080,0x0004002b,0x00000059,0x0000067d,
+0x0000003f,0x0004002b,0x00000006,0x00000693,
+0x000000ff,0x0004002b,0x00000059,0x000006a6,
+0x000000c0,0x0004002b,0x00000059,0x000006af,
+0x000000ff,0x0004002b,0x00000059,0x00000730,
+0xffffff80,0x0007002c,0x0000000f,0x0000075e,
+0x0000009c,0x0000009c,0x0000009c,0x0000009c,
+0x0004002b,0x00000006,0x0000077c,0x0000017d,
+0x0004001c,0x0000077d,0x00000006,0x0000077c,
+0x0004002b,0x00000006,0x0000077e,0x000000ba,
+0x0004002b,0x00000006,0x0000077f,0x000000e8,
+0x0004002b,0x00000006,0x00000780,0x0000002e,
+0x0004002b,0x00000006,0x00000781,0x00000074,
+0x0004002b,0x00000006,0x00000782,0x000000de,
+0x0004002b,0x00000006,0x00000783,0x000000bd,
+0x0004002b,0x00000006,0x00000784,0x000000f4,
+0x0004002b,0x00000006,0x00000785,0x0000002c,
+0x0004002b,0x00000006,0x00000786,0x0000004d,
+0x0004002b,0x00000006,0x00000787,0x000000b2,
+0x0004002b,0x00000006,0x00000788,0x0000006e,
+0x0004002b,0x00000006,0x00000789,0x000000e9,
+0x0004002b,0x00000006,0x0000078a,0x000000a7,
+0x0004002b,0x00000006,0x0000078b,0x00000079,
+0x0004002b,0x00000006,0x0000078c,0x000000ef,
+0x0004002b,0x00000006,0x0000078d,0x000000df,
+0x0004002b,0x00000006,0x0000078e,0x000000cf,
+0x0004002b,0x00000006,0x0000078f,0x000000be,
+0x0004002b,0x00000006,0x00000790,0x000000ae,
+0x0004002b,0x00000006,0x00000791,0x0000009e,
+0x0004002b,0x00000006,0x00000792,0x00000071,
+0x0004002b,0x00000006,0x00000793,0x0000008e,
+0x0004002b,0x00000006,0x00000794,0x000000fa,
+0x0004002b,0x00000006,0x00000795,0x000000ea,
+0x0004002b,0x00000006,0x00000796,0x00000036,
+0x0004002b,0x00000006,0x00000797,0x000000b9,
+0x0004002b,0x00000006,0x00000798,0x00000067,
+0x0004002b,0x00000006,0x00000799,0x00000077,
+0x0004002b,0x00000006,0x0000079a,0x000000b3,
+0x0004002b,0x00000006,0x0000079b,0x0000006c,
+0x0004002b,0x00000006,0x0000079c,0x0000007c,
+0x0004002b,0x00000006,0x0000079d,0x000000f7,
+0x0004002b,0x00000006,0x0000079e,0x000000e7,
+0x0004002b,0x00000006,0x0000079f,0x000000d7,
+0x0004002b,0x00000006,0x000007a0,0x000000c7,
+0x0004002b,0x00000006,0x000007a1,0x000000bf,
+0x0004002b,0x00000006,0x000007a2,0x000000b7,
+0x0004002b,0x00000006,0x000007a3,0x000000af,
+0x0004002b,0x00000006,0x000007a4,0x0000009f,
+0x0004002b,0x00000006,0x000007a5,0x00000097,
+0x0004002b,0x00000006,0x000007a6,0x00000070,
+0x0004002b,0x00000006,0x000007a7,0x0000008f,
+0x0004002b,0x00000006,0x000007a8,0x00000078,
+0x0004002b,0x00000006,0x000007a9,0x00000087,
+0x0004002b,0x00000006,0x000007aa,0x000000fd,
+0x0004002b,0x00000006,0x000007ab,0x000000f5,
+0x0004002b,0x00000006,0x000007ac,0x000000ed,
+0x0004002b,0x00000006,0x000007ad,0x000000e5,
+0x0004002b,0x00000006,0x000007ae,0x000000bc,
+0x0004002b,0x00000006,0x000007af,0x000000b4,
+0x0004002b,0x00000006,0x000007b0,0x000000ac,
+0x0004002b,0x00000006,0x000007b1,0x0000006b,
+0x0004002b,0x00000006,0x000007b2,0x00000073,
+0x0004002b,0x00000006,0x000007b3,0x0000007b,
+0x0004002b,0x00000006,0x000007b4,0x000000f2,
+0x0004002b,0x00000006,0x000007b5,0x0000004e,
+0x0004002b,0x00000006,0x000007b6,0x000000b1,
+0x0004002b,0x00000006,0x000007b7,0x0000005e,
+0x0004002b,0x00000006,0x000007b8,0x00000076,
+0x0004002b,0x00000006,0x000007b9,0x0000007e,
+0x0004002b,0x00000006,0x000007ba,0x000000fb,
+0x0004002b,0x00000006,0x000007bb,0x000000f3,
+0x0004002b,0x00000006,0x000007bc,0x000000eb,
+0x0004002b,0x00000006,0x000007bd,0x0000003c,
+0x0004002b,0x00000006,0x000007be,0x000000bb,
+0x0004002b,0x00000006,0x000007bf,0x000000ab,
+0x0004002b,0x00000006,0x000007c0,0x000000fe,
+0x0004002b,0x00000006,0x000007c1,0x000000f6,
+0x0004002b,0x00000006,0x000007c2,0x000000ee,
+0x0004002b,0x00000006,0x000007c3,0x000000e6,
+0x0004002b,0x00000006,0x000007c4,0x000000d6,
+0x0004002b,0x00000006,0x000007c5,0x00000031,
+0x0004002b,0x00000006,0x000007c6,0x000000ce,
+0x0004002b,0x00000006,0x000007c7,0x000000c6,
+0x0004002b,0x00000006,0x000007c8,0x000000b6,
+0x0004002b,0x00000006,0x000007c9,0x0000005d,
+0x0004002b,0x00000006,0x000007ca,0x0000006d,
+0x0004002b,0x00000006,0x000007cb,0x00000075,
+0x0004002b,0x00000006,0x000007cc,0x0000007d,
+0x0004002b,0x00000006,0x000007cd,0x000000f9,
+0x0004002b,0x00000006,0x000007ce,0x000000f1,
+0x0004002b,0x00000006,0x000007cf,0x000000dd,
+0x0004002b,0x00000006,0x000007d0,0x000000d5,
+0x0004002b,0x00000006,0x000007d1,0x000000cd,
+0x0004002b,0x00000006,0x000007d2,0x000000c5,
+0x0004002b,0x00000006,0x000007d3,0x000000b5,
+0x0004002b,0x00000006,0x000007d4,0x000000ad,
+0x0004002b,0x00000006,0x000007d5,0x0000009d,
+0x0004002b,0x00000006,0x000007d6,0x00000072,
+0x0004002b,0x00000006,0x000007d7,0x0000008d,
+0x0004002b,0x00000006,0x000007d8,0x0000007a,
+0x0180002c,0x0000077d,0x000007d9,0x0000009c,
+0x0000009c,0x0000009c,0x0000009c,0x00000693,
+0x0000042b,0x000003e0,0x000002c5,0x000002e1,
+0x0000009c,0x00000693,0x000002b0,0x0000077e,
+0x00000425,0x0000077f,0x000003c7,0x000003d4,
+0x00000780,0x000003e3,0x00000781,0x000003cd,
+0x0000009c,0x00000693,0x00000299,0x00000782,
+0x000002ae,0x00000783,0x000003c8,0x000003d3,
+0x000003bb,0x00000784,0x00000785,0x000003e5,
+0x00000786,0x00000787,0x00000788,0x000002d9,
+0x000002a4,0x00000789,0x00000459,0x000003dc,
+0x000002c2,0x0000078a,0x0000078b,0x000002cf,
+0x0000009c,0x00000693,0x0000014d,0x0000078c,
+0x000001a0,0x0000078d,0x00000428,0x0000078e,
+0x000002ad,0x0000078f,0x000002bb,0x00000790,
+0x000002b2,0x00000791,0x00000792,0x00000793,
+0x00000094,0x00000794,0x000002a3,0x00000795,
+0x000002a8,0x000003e9,0x00000796,0x000003dd,
+0x000002b1,0x00000797,0x000002c0,0x000002d6,
+0x00000798,0x000002e0,0x00000799,0x000002d1,
+0x000003bb,0x00000784,0x000003bd,0x000003c0,
+0x00000456,0x000003e6,0x00000424,0x000003da,
+0x000003c3,0x0000079a,0x000003c7,0x000003d4,
+0x0000079b,0x000003d0,0x0000079c,0x000003cb,
+0x0000009c,0x00000693,0x0000008c,0x0000079d,
+0x0000014d,0x0000078c,0x00000176,0x0000079e,
+0x000001a0,0x0000078d,0x0000029c,0x0000079f,
+0x00000428,0x0000078e,0x00000427,0x000007a0,
+0x0000017d,0x000007a1,0x000002b3,0x000007a2,
+0x000002ba,0x000007a3,0x000002c2,0x0000078a,
+0x00000179,0x000007a4,0x000002b7,0x000007a5,
+0x000007a6,0x000007a7,0x000007a8,0x000007a9,
+0x00000091,0x000007aa,0x00000107,0x000007ab,
+0x000002a0,0x000007ac,0x000002a7,0x000007ad,
+0x000003bf,0x000003ec,0x00000456,0x000003e6,
+0x0000042b,0x000003e0,0x00000424,0x000003da,
+0x000003c1,0x000007ae,0x000003c2,0x000007af,
+0x000003c5,0x000007b0,0x000003c6,0x000002db,
+0x000003c8,0x000003d3,0x000007b1,0x000002dc,
+0x000007b2,0x000003ce,0x000007b3,0x000002cd,
+0x00000094,0x00000794,0x0000042a,0x000007b4,
+0x000002a3,0x00000795,0x0000045a,0x000003e7,
+0x000002a5,0x000003ea,0x0000041f,0x000003e4,
+0x00000426,0x000003de,0x00000457,0x000003d8,
+0x000002b1,0x00000797,0x000007b5,0x000007b6,
+0x000002c0,0x000002d6,0x000007b7,0x000002d0,
+0x000002c5,0x000002e1,0x00000788,0x000002d9,
+0x000007b8,0x000002d2,0x000007b9,0x000002ca,
+0x0000009c,0x00000693,0x00000090,0x000007ba,
+0x0000008c,0x0000079d,0x000000f1,0x000007bb,
+0x0000014d,0x0000078c,0x000002a2,0x000007bc,
+0x00000176,0x0000079e,0x000003be,0x000003ed,
+0x000001a0,0x0000078d,0x000002a1,0x000003eb,
+0x0000029c,0x0000079f,0x00000785,0x000003e5,
+0x00000428,0x0000078e,0x00000421,0x000003df,
+0x00000427,0x000007a0,0x000007bd,0x000003d9,
+0x0000017d,0x000007a1,0x000002af,0x000007be,
+0x000002b3,0x000007a2,0x000003c3,0x0000079a,
+0x000002ba,0x000007a3,0x000002be,0x000007bf,
+0x000002c2,0x0000078a,0x000003c7,0x000003d4,
+0x00000179,0x000007a4,0x000002bd,0x000003d2,
+0x000002b7,0x000007a5,0x0000079b,0x000003d0,
+0x000007a6,0x000007a7,0x00000781,0x000003cd,
+0x000007a8,0x000007a9,0x0000079c,0x000003cb,
+0x0000009f,0x000007c0,0x00000094,0x00000794,
+0x0000029a,0x000007c1,0x0000042a,0x000007b4,
+0x0000029f,0x000007c2,0x000002a3,0x00000795,
+0x000002a6,0x000007c3,0x0000045a,0x000003e7,
+0x00000299,0x00000782,0x000002a5,0x000003ea,
+0x0000029d,0x000007c4,0x0000041f,0x000003e4,
+0x000007c5,0x000007c6,0x00000426,0x000003de,
+0x00000453,0x000007c7,0x00000457,0x000003d8,
+0x000002ad,0x0000078f,0x000002b0,0x0000077e,
+0x000002b4,0x000007c8,0x00000786,0x00000787,
+0x000002bb,0x00000790,0x000002bf,0x000002d7,
+0x000002c3,0x000002e3,0x000007c9,0x000002d4,
+0x000002b2,0x00000791,0x000002c1,0x000002e2,
+0x000002b8,0x000002de,0x000007ca,0x000002da,
+0x00000792,0x00000793,0x000007cb,0x000002d3,
+0x0000078b,0x000002cf,0x000007cc,0x000002cb,
+0x00000091,0x000007aa,0x000000fb,0x000007cd,
+0x00000107,0x000007ab,0x00000454,0x000007ce,
+0x000002a0,0x000007ac,0x000002a4,0x00000789,
+0x000002a7,0x000007ad,0x0000042c,0x000003e1,
+0x0000029b,0x000007cf,0x000002a8,0x000003e9,
+0x0000029e,0x000007d0,0x00000780,0x000003e3,
+0x00000455,0x000007d1,0x00000796,0x000003dd,
+0x00000458,0x000007d2,0x00000429,0x000003d7,
+0x000002ae,0x00000783,0x000002b1,0x00000797,
+0x000002b5,0x000007d3,0x000007b5,0x000007b6,
+0x000002bc,0x000007d4,0x000002c0,0x000002d6,
+0x000002c4,0x000002df,0x000007b7,0x000002d0,
+0x000002b6,0x000007d5,0x000002c5,0x000002e1,
+0x000002b9,0x000002dd,0x00000788,0x000002d9,
+0x000007d6,0x000007d7,0x000007b8,0x000002d2,
+0x000007d8,0x000002ce,0x000007b9,0x000002ca,
+0x00040020,0x000007e1,0x00000007,0x0000077d,
+0x0004002b,0x00000006,0x00000800,0x0000013b,
+0x0004001c,0x00000801,0x00000006,0x00000800,
+0x0004002b,0x00000006,0x00000802,0x00000047,
+0x0004002b,0x00000006,0x00000803,0x000000b8,
+0x0004002b,0x00000006,0x00000804,0x000000ec,
+0x0004002b,0x00000006,0x00000805,0x000000fc,
+0x0004002b,0x00000006,0x00000806,0x00000057,
+0x013e002c,0x00000801,0x00000807,0x0000009c,
+0x0000009c,0x0000009c,0x0000009c,0x0000009c,
+0x0000009c,0x00000693,0x000003be,0x000003ed,
+0x00000427,0x000007a0,0x000002be,0x000007bf,
+0x00000792,0x00000793,0x0000009c,0x00000693,
+0x000003c1,0x000007ae,0x0000042a,0x000007b4,
+0x000002ba,0x000007a3,0x000003bd,0x000003c0,
+0x000007b7,0x000002d0,0x0000029c,0x0000079f,
+0x000007b1,0x000002dc,0x00000796,0x000003dd,
+0x0000078b,0x000002cf,0x0000009c,0x00000693,
+0x000001a0,0x0000078d,0x000002ad,0x0000078f,
+0x000002b2,0x00000791,0x000000fb,0x000007cd,
+0x00000422,0x000003e8,0x00000802,0x00000803,
+0x000002b7,0x000007a5,0x0000042a,0x000007b4,
+0x0000041f,0x000003e4,0x000007b5,0x000007b6,
+0x00000788,0x000002d9,0x000003bc,0x00000804,
+0x00000421,0x000003df,0x000002be,0x000007bf,
+0x000007cb,0x000002d3,0x000002a7,0x000007ad,
+0x00000458,0x000007d2,0x000003c6,0x000002db,
+0x000007b3,0x000002cd,0x0000009c,0x00000693,
+0x0000014d,0x0000078c,0x000001a0,0x0000078d,
+0x00000428,0x0000078e,0x0000017d,0x000007a1,
+0x000002ba,0x000007a3,0x00000179,0x000007a4,
+0x000007a6,0x000007a7,0x00000095,0x00000805,
+0x000003bc,0x00000804,0x000003bf,0x000003ec,
+0x0000042b,0x000003e0,0x000003c1,0x000007ae,
+0x000003c5,0x000007b0,0x000002bd,0x000003d2,
+0x00000781,0x000003cd,0x000000fb,0x000007cd,
+0x000002a4,0x00000789,0x000002a8,0x000003e9,
+0x00000796,0x000003dd,0x00000802,0x00000803,
+0x00000806,0x000002d5,0x00000798,0x000002e0,
+0x00000799,0x000002d1,0x0000029a,0x000007c1,
+0x000002a6,0x000007c3,0x0000029e,0x000007d0,
+0x00000458,0x000007d2,0x000002b5,0x000007d3,
+0x000002c4,0x000002df,0x000002b9,0x000002dd,
+0x000007d8,0x000002ce,0x0000042a,0x000007b4,
+0x0000045a,0x000003e7,0x0000041f,0x000003e4,
+0x00000457,0x000003d8,0x00000786,0x00000787,
+0x000007c9,0x000002d4,0x000007ca,0x000002da,
+0x000007cc,0x000002cb,0x0000009c,0x00000693,
+0x0000008c,0x0000079d,0x0000014d,0x0000078c,
+0x00000176,0x0000079e,0x000001a0,0x0000078d,
+0x0000029c,0x0000079f,0x00000428,0x0000078e,
+0x00000427,0x000007a0,0x0000017d,0x000007a1,
+0x000002b3,0x000007a2,0x000002ba,0x000007a3,
+0x000002c2,0x0000078a,0x00000179,0x000007a4,
+0x000002b7,0x000007a5,0x000007a6,0x000007a7,
+0x000007a8,0x000007a9,0x0000009f,0x000007c0,
+0x0000029a,0x000007c1,0x0000029f,0x000007c2,
+0x000002a6,0x000007c3,0x00000299,0x00000782,
+0x0000029d,0x000007c4,0x000007c5,0x000007c6,
+0x00000453,0x000007c7,0x000002ad,0x0000078f,
+0x000002b4,0x000007c8,0x000002bb,0x00000790,
+0x000002c3,0x000002e3,0x000002b2,0x00000791,
+0x000002b8,0x000002de,0x00000792,0x00000793,
+0x0000078b,0x000002cf,0x00000095,0x00000805,
+0x000003bb,0x00000784,0x000003bc,0x00000804,
+0x000003bd,0x000003c0,0x000003bf,0x000003ec,
+0x00000456,0x000003e6,0x0000042b,0x000003e0,
+0x00000424,0x000003da,0x000003c1,0x000007ae,
+0x000003c2,0x000007af,0x000003c5,0x000007b0,
+0x000003c6,0x000002db,0x000003c8,0x000003d3,
+0x000007b1,0x000002dc,0x000007b2,0x000003ce,
+0x000007b3,0x000002cd,0x00000090,0x000007ba,
+0x000000f1,0x000007bb,0x000002a2,0x000007bc,
+0x000003be,0x000003ed,0x000002a1,0x000003eb,
+0x00000785,0x000003e5,0x00000421,0x000003df,
+0x000007bd,0x000003d9,0x000002af,0x000007be,
+0x000003c3,0x0000079a,0x000002be,0x000007bf,
+0x000003c7,0x000003d4,0x000002bd,0x000003d2,
+0x0000079b,0x000003d0,0x00000781,0x000003cd,
+0x0000079c,0x000003cb,0x000000fb,0x000007cd,
+0x00000454,0x000007ce,0x000002a4,0x00000789,
+0x0000042c,0x000003e1,0x000002a8,0x000003e9,
+0x00000780,0x000003e3,0x00000796,0x000003dd,
+0x00000429,0x000003d7,0x000002b1,0x00000797,
+0x000007b5,0x000007b6,0x000002c0,0x000002d6,
+0x000007b7,0x000002d0,0x000002c5,0x000002e1,
+0x00000788,0x000002d9,0x000007b8,0x000002d2,
+0x000007b9,0x000002ca,0x00040020,0x0000080f,
+0x00000007,0x00000801,0x0004001c,0x00000824,
+0x00000011,0x0000008c,0x0005002c,0x00000011,
+0x00000825,0x00000693,0x0000008c,0x0005002c,
+0x00000011,0x00000826,0x000002bf,0x0000008c,
+0x0005002c,0x00000011,0x00000827,0x000002a1,
+0x0000009f,0x0005002c,0x00000011,0x00000828,
+0x0000029f,0x0000008c,0x0005002c,0x00000011,
+0x00000829,0x0000008c,0x00000091,0x0005002c,
+0x00000011,0x0000082a,0x00000090,0x00000090,
+0x0005002c,0x00000011,0x0000082b,0x00000091,
+0x000000fb,0x000b002c,0x00000824,0x0000082c,
+0x00000825,0x00000826,0x00000827,0x00000828,
+0x00000829,0x0000082a,0x0000082b,0x0000047c,
+0x00040020,0x0000082f,0x00000007,0x00000824,
+0x0004002b,0x00000059,0x00000841,0x00000060,
+0x0004002b,0x00000059,0x00000842,0x00000040,
+0x0004002b,0x00000059,0x00000843,0x00000020,
+0x0007002c,0x0000005a,0x00000844,0x00000841,
+0x00000842,0x00000843,0x000000bf,0x0007002c,
+0x0000000f,0x00000848,0x0000009f,0x0000009f,
+0x0000009f,0x0000009f,0x0007002c,0x0000005a,
+0x0000084a,0x000000bf,0x000000bf,0x000000bf,
+0x000000bf,0x0004002b,0x00000059,0x0000084b,
+0x0000001f,0x0007002c,0x0000005a,0x0000084c,
+0x0000084b,0x0000084b,0x0000084b,0x0000084b,
+0x0004002b,0x00000006,0x00000852,0xffffffff,
+0x0007002c,0x0000000f,0x00000853,0x00000852,
+0x00000852,0x00000852,0x00000852,0x0007002c,
+0x0000000f,0x00000856,0x000001dd,0x00000179,
+0x0000017d,0x000001a0,0x00040017,0x00000857,
+0x000000ac,0x00000004,0x0007002c,0x0000000f,
+0x0000085f,0x00000693,0x0000009c,0x00000693,
+0x00000693,0x0004002b,0x00000059,0x0000089a,
+0x0000001d,0x0004002b,0x00000059,0x0000089e,
+0xfffffffe,0x00040020,0x0000091b,0x00000001,
+0x00000008,0x0004003b,0x0000091b,0x0000091c,
+0x00000001,0x0005001e,0x00000920,0x00000011,
+0x00000006,0x00000006,0x00040020,0x00000921,
+0x00000009,0x00000920,0x0004003b,0x00000921,
+0x00000922,0x00000009,0x00040020,0x00000923,
+0x00000009,0x00000006,0x00040020,0x00000926,
+0x00000001,0x00000006,0x00040020,0x0000092c,
+0x00000009,0x00000011,0x00090019,0x00000936,
+0x00000006,0x00000002,0x00000000,0x00000000,
+0x00000000,0x00000002,0x0000001e,0x00040020,
+0x00000937,0x00000000,0x00000936,0x0004003b,
+0x00000937,0x00000938,0x00000000,0x00090019,
+0x0000094e,0x00000006,0x00000002,0x00000000,
+0x00000000,0x00000000,0x00000002,0x00000020,
+0x00040020,0x0000094f,0x00000000,0x0000094e,
+0x0004003b,0x0000094f,0x00000950,0x00000000,
+0x0006002c,0x00000008,0x0000095c,0x0000008c,
+0x0000008c,0x0000009f,0x00050036,0x00000002,
+0x00000004,0x00000000,0x00000003,0x000200f8,
+0x00000005,0x0004003b,0x00000012,0x0000091a,
+0x00000007,0x0004003b,0x00000007,0x0000091f,
+0x00000007,0x0004003b,0x00000012,0x0000092a,
+0x00000007,0x0004003b,0x00000012,0x00000930,
+0x00000007,0x0004003b,0x00000010,0x00000935,
+0x00000007,0x0004003b,0x00000061,0x00000941,
+0x00000007,0x0004003b,0x00000010,0x00000945,
+0x00000007,0x0004003b,0x00000012,0x00000947,
+0x00000007,0x0004003b,0x00000010,0x0000094b,
+0x00000007,0x0004003b,0x00000061,0x00000959,
+0x00000007,0x0004003d,0x00000008,0x0000091d,
+0x0000091c,0x0007004f,0x00000011,0x0000091e,
+0x0000091d,0x0000091d,0x00000000,0x00000001,
+0x0003003e,0x0000091a,0x0000091e,0x00050041,
+0x00000923,0x00000924,0x00000922,0x000000ca,
+0x0004003d,0x00000006,0x00000925,0x00000924,
+0x00050041,0x00000926,0x00000927,0x0000091c,
+0x00000091,0x0004003d,0x00000006,0x00000928,
+0x00000927,0x00050080,0x00000006,0x00000929,
+0x00000925,0x00000928,0x0003003e,0x0000091f,
+0x00000929,0x0004003d,0x00000011,0x0000092b,
+0x0000091a,0x00050041,0x0000092c,0x0000092d,
+0x00000922,0x000000bf,0x0004003d,0x00000011,
+0x0000092e,0x0000092d,0x00050086,0x00000011,
+0x0000092f,0x0000092b,0x0000092e,0x0003003e,
+0x0000092a,0x0000092f,0x0004003d,0x00000011,
+0x00000931,0x0000091a,0x00050041,0x0000092c,
+0x00000932,0x00000922,0x000000bf,0x0004003d,
+0x00000011,0x00000933,0x00000932,0x00050089,
+0x00000011,0x00000934,0x00000931,0x00000933,
+0x0003003e,0x00000930,0x00000934,0x0004003d,
+0x00000936,0x00000939,0x00000938,0x0004003d,
+0x00000011,0x0000093a,0x0000092a,0x0004007c,
+0x0000050d,0x0000093b,0x0000093a,0x0004003d,
+0x00000006,0x0000093c,0x0000091f,0x0004007c,
+0x00000059,0x0000093d,0x0000093c,0x00050051,
+0x00000059,0x0000093e,0x0000093b,0x00000000,
+0x00050051,0x00000059,0x0000093f,0x0000093b,
+0x00000001,0x00060050,0x00000060,0x00000940,
+0x0000093e,0x0000093f,0x0000093d,0x0003003e,
+0x00000941,0x00000940,0x00050039,0x00000060,
+0x00000942,0x00000084,0x00000941,0x00050062,
+0x0000000f,0x00000943,0x00000939,0x00000942,
+0x0009004f,0x0000000f,0x00000944,0x00000943,
+0x00000943,0x00000003,0x00000002,0x00000001,
+0x00000000,0x0003003e,0x00000935,0x00000944,
+0x0004003d,0x0000000f,0x00000946,0x00000935,
+0x0003003e,0x00000945,0x00000946,0x00050041,
+0x0000092c,0x00000948,0x00000922,0x000000bf,
+0x0004003d,0x00000011,0x00000949,0x00000948,
+0x0003003e,0x00000947,0x00000949,0x00060039,
+0x00000002,0x0000094a,0x00000016,0x00000945,
+0x00000947,0x0004003d,0x00000011,0x0000094c,
+0x00000930,0x00050039,0x0000000f,0x0000094d,
+0x00000080,0x0000094c,0x0003003e,0x0000094b,
+0x0000094d,0x0004003d,0x0000094e,0x00000951,
+0x00000950,0x0004003d,0x00000011,0x00000952,
+0x0000091a,0x0004007c,0x0000050d,0x00000953,
+0x00000952,0x0004003d,0x00000006,0x00000954,
+0x0000091f,0x0004007c,0x00000059,0x00000955,
+0x00000954,0x00050051,0x00000059,0x00000956,
+0x00000953,0x00000000,0x00050051,0x00000059,
+0x00000957,0x00000953,0x00000001,0x00060050,
+0x00000060,0x00000958,0x00000956,0x00000957,
+0x00000955,0x0003003e,0x00000959,0x00000958,
+0x00050039,0x00000060,0x0000095a,0x00000084,
+0x00000959,0x0004003d,0x0000000f,0x0000095b,
+0x0000094b,0x00040063,0x00000951,0x0000095a,
+0x0000095b,0x000100fd,0x00010038,0x00050036,
+0x00000006,0x0000000d,0x00000000,0x0000000a,
+0x00030037,0x00000007,0x0000000b,0x00030037,
+0x00000009,0x0000000c,0x000200f8,0x0000000e,
+0x0004003b,0x00000012,0x00000086,0x00000007,
+0x0004003d,0x00000006,0x00000087,0x0000000b,
+0x0004003d,0x00000008,0x00000088,0x0000000c,
+0x0007004f,0x00000011,0x00000089,0x00000088,
+0x00000088,0x00000000,0x00000001,0x00050050,
+0x00000011,0x0000008a,0x00000087,0x00000087,
+0x00050084,0x00000011,0x0000008b,0x0000008a,
+0x00000089,0x00050084,0x00000011,0x0000008f,
+0x0000008b,0x0000008e,0x00050080,0x00000011,
+0x00000093,0x0000008f,0x00000092,0x00050086,
+0x00000011,0x00000097,0x00000093,0x00000096,
+0x0003003e,0x00000086,0x00000097,0x0004003d,
+0x00000006,0x00000098,0x0000000b,0x00050041,
+0x00000007,0x00000099,0x0000000c,0x00000091,
+0x0004003d,0x00000006,0x0000009a,0x00000099,
+0x00050084,0x00000006,0x0000009b,0x00000098,
+0x0000009a,0x00050041,0x00000007,0x0000009d,
+0x00000086,0x0000009c,0x0004003d,0x00000006,
+0x0000009e,0x0000009d,0x00050041,0x00000007,
+0x000000a0,0x00000086,0x0000009f,0x0004003d,
+0x00000006,0x000000a1,0x000000a0,0x00050080,
+0x00000006,0x000000a2,0x0000009e,0x000000a1,
+0x00050080,0x00000006,0x000000a3,0x0000009b,
+0x000000a2,0x000200fe,0x000000a3,0x00010038,
+0x00050036,0x00000002,0x00000016,0x00000000,
+0x00000013,0x00030037,0x00000010,0x00000014,
+0x00030037,0x00000012,0x00000015,0x000200f8,
+0x00000017,0x0004003b,0x00000007,0x000000bc,
+0x00000007,0x0004003b,0x00000007,0x000000c2,
+0x00000007,0x0004003b,0x00000007,0x000000c6,
+0x00000007,0x0004003b,0x00000007,0x000000cc,
+0x00000007,0x0004003b,0x00000007,0x000000d1,
+0x00000007,0x0004003b,0x00000007,0x000000d6,
+0x00000007,0x0004003b,0x00000007,0x000000e5,
+0x00000007,0x0004003b,0x00000162,0x00000163,
+0x00000007,0x0004003b,0x00000007,0x00000170,
+0x00000007,0x0004003b,0x00000009,0x00000172,
+0x00000007,0x0004003d,0x0000000f,0x000000a8,
+0x00000014,0x0003003e,0x000000a7,0x000000a8,
+0x0004003d,0x00000011,0x000000ab,0x00000015,
+0x0003003e,0x000000aa,0x000000ab,0x0003003e,
+0x000000ae,0x000000af,0x00050041,0x000000b1,
+0x000000b2,0x000000a7,0x00000095,0x0004003d,
+0x00000006,0x000000b3,0x000000b2,0x000500c7,
+0x00000006,0x000000b5,0x000000b3,0x000000b4,
+0x000500aa,0x000000ac,0x000000b7,0x000000b5,
+0x000000b6,0x0003003e,0x000000b0,0x000000b7,
+0x0004003d,0x000000ac,0x000000b8,0x000000b0,
+0x000300f7,0x000000ba,0x00000000,0x000400fa,
+0x000000b8,0x000000b9,0x000000ba,0x000200f8,
+0x000000b9,0x000100fd,0x000200f8,0x000000ba,
+0x00050041,0x000000b1,0x000000bd,0x000000a7,
+0x00000095,0x0004003d,0x00000006,0x000000be,
+0x000000bd,0x000600cb,0x00000006,0x000000c1,
+0x000000be,0x000000bf,0x000000c0,0x0003003e,
+0x000000bc,0x000000c1,0x00050041,0x000000b1,
+0x000000c3,0x000000a7,0x00000095,0x0004003d,
+0x00000006,0x000000c4,0x000000c3,0x000600cb,
+0x00000006,0x000000c5,0x000000c4,0x000000c0,
+0x000000c0,0x0003003e,0x000000c2,0x000000c5,
+0x00050041,0x000000b1,0x000000c7,0x000000a7,
+0x00000095,0x0004003d,0x00000006,0x000000c8,
+0x000000c7,0x000600cb,0x00000006,0x000000cb,
+0x000000c8,0x000000c9,0x000000ca,0x0003003e,
+0x000000c6,0x000000cb,0x00050041,0x000000b1,
+0x000000cd,0x000000a7,0x00000095,0x0004003d,
+0x00000006,0x000000ce,0x000000cd,0x000600cb,
+0x00000006,0x000000d0,0x000000ce,0x000000cf,
+0x000000c0,0x0003003e,0x000000cc,0x000000d0,
+0x00050041,0x000000b1,0x000000d2,0x000000a7,
+0x00000095,0x0004003d,0x00000006,0x000000d3,
+0x000000d2,0x000600cb,0x00000006,0x000000d5,
+0x000000d3,0x000000d4,0x000000c0,0x0003003e,
+0x000000d1,0x000000d5,0x00050041,0x000000b1,
+0x000000d7,0x000000a7,0x00000095,0x0004003d,
+0x00000006,0x000000d8,0x000000d7,0x000600cb,
+0x00000006,0x000000da,0x000000d8,0x000000d9,
+0x000000ca,0x0003003e,0x000000d6,0x000000da,
+0x00050041,0x000000b1,0x000000dc,0x000000a7,
+0x00000095,0x0004003d,0x00000006,0x000000dd,
+0x000000dc,0x000600cb,0x00000006,0x000000df,
+0x000000dd,0x000000de,0x000000ca,0x000500ab,
+0x000000ac,0x000000e0,0x000000df,0x0000009c,
+0x0003003e,0x000000db,0x000000e0,0x0004003d,
+0x00000006,0x000000e1,0x000000bc,0x000500aa,
+0x000000ac,0x000000e2,0x000000e1,0x0000009c,
+0x000300f7,0x000000e4,0x00000000,0x000400fa,
+0x000000e2,0x000000e3,0x00000113,0x000200f8,
+0x000000e3,0x0004003d,0x00000006,0x000000e6,
+0x000000c2,0x000500c4,0x00000006,0x000000e7,
+0x000000e6,0x000000ca,0x0004003d,0x00000006,
+0x000000e8,0x000000c6,0x000500c5,0x00000006,
+0x000000e9,0x000000e7,0x000000e8,0x0003003e,
+0x000000e5,0x000000e9,0x0004003d,0x00000006,
+0x000000ea,0x000000d1,0x000300f7,0x000000ef,
+0x00000000,0x000b00fb,0x000000ea,0x000000ef,
+0x00000000,0x000000eb,0x00000001,0x000000ec,
+0x00000002,0x000000ed,0x00000003,0x000000ee,
+0x000200f8,0x000000eb,0x0004003d,0x00000006,
+0x000000f2,0x000000cc,0x00050080,0x00000006,
+0x000000f3,0x000000f2,0x00000091,0x00050050,
+0x00000011,0x000000f4,0x000000f1,0x000000f3,
+0x0003003e,0x000000f0,0x000000f4,0x000200f9,
+0x000000ef,0x000200f8,0x000000ec,0x0004003d,
+0x00000006,0x000000f6,0x000000cc,0x00050080,
+0x00000006,0x000000f7,0x000000f6,0x00000091,
+0x00050050,0x00000011,0x000000f8,0x000000f7,
+0x000000f1,0x0003003e,0x000000f0,0x000000f8,
+0x000200f9,0x000000ef,0x000200f8,0x000000ed,
+0x0004003d,0x00000006,0x000000fa,0x000000cc,
+0x00050080,0x00000006,0x000000fc,0x000000fa,
+0x000000fb,0x00050041,0x000000b1,0x000000fd,
+0x000000a7,0x00000095,0x0004003d,0x00000006,
+0x000000fe,0x000000fd,0x000600cb,0x00000006,
+0x000000ff,0x000000fe,0x000000d9,0x000000c0,
+0x00050080,0x00000006,0x00000100,0x000000ff,
+0x000000fb,0x00050050,0x00000011,0x00000101,
+0x000000fc,0x00000100,0x0003003e,0x000000f0,
+0x00000101,0x0003003e,0x000000db,0x000000af,
+0x0003003e,0x000000d6,0x0000009c,0x000200f9,
+0x000000ef,0x000200f8,0x000000ee,0x0004003d,
+0x00000006,0x00000103,0x000000cc,0x000500aa,
+0x000000ac,0x00000104,0x00000103,0x0000009c,
+0x000300f7,0x00000106,0x00000000,0x000400fa,
+0x00000104,0x00000105,0x00000109,0x000200f8,
+0x00000105,0x0003003e,0x000000f0,0x00000108,
+0x000200f9,0x00000106,0x000200f8,0x00000109,
+0x0004003d,0x00000006,0x0000010a,0x000000cc,
+0x000500aa,0x000000ac,0x0000010b,0x0000010a,
+0x0000009f,0x000300f7,0x0000010d,0x00000000,
+0x000400fa,0x0000010b,0x0000010c,0x0000010f,
+0x000200f8,0x0000010c,0x0003003e,0x000000f0,
+0x0000010e,0x000200f9,0x0000010d,0x000200f8,
+0x0000010f,0x0003003e,0x000000ae,0x00000110,
+0x000100fd,0x000200f8,0x0000010d,0x000200f9,
+0x00000106,0x000200f8,0x00000106,0x000200f9,
+0x000000ef,0x000200f8,0x000000ef,0x000200f9,
+0x000000e4,0x000200f8,0x00000113,0x0004003d,
+0x00000006,0x00000114,0x000000bc,0x000500c4,
+0x00000006,0x00000115,0x00000114,0x000000ca,
+0x0004003d,0x00000006,0x00000116,0x000000c6,
+0x000500c5,0x00000006,0x00000117,0x00000115,
+0x00000116,0x0003003e,0x000000e5,0x00000117,
+0x0004003d,0x00000006,0x00000118,0x000000c2,
+0x000300f7,0x0000011d,0x00000000,0x000b00fb,
+0x00000118,0x0000011d,0x00000000,0x00000119,
+0x00000001,0x0000011a,0x00000002,0x0000011b,
+0x00000003,0x0000011c,0x000200f8,0x00000119,
+0x0004003d,0x00000006,0x0000011e,0x000000d1,
+0x00050080,0x00000006,0x0000011f,0x0000011e,
+0x00000090,0x0004003d,0x00000006,0x00000120,
+0x000000cc,0x00050080,0x00000006,0x00000121,
+0x00000120,0x00000091,0x00050050,0x00000011,
+0x00000122,0x0000011f,0x00000121,0x0003003e,
+0x000000f0,0x00000122,0x000200f9,0x0000011d,
+0x000200f8,0x0000011a,0x0004003d,0x00000006,
+0x00000124,0x000000d1,0x00050080,0x00000006,
+0x00000125,0x00000124,0x0000008c,0x0004003d,
+0x00000006,0x00000126,0x000000cc,0x00050080,
+0x00000006,0x00000127,0x00000126,0x00000091,
+0x00050050,0x00000011,0x00000128,0x00000125,
+0x00000127,0x0003003e,0x000000f0,0x00000128,
+0x000200f9,0x0000011d,0x000200f8,0x0000011b,
+0x0004003d,0x00000006,0x0000012a,0x000000cc,
+0x00050080,0x00000006,0x0000012b,0x0000012a,
+0x00000091,0x0004003d,0x00000006,0x0000012c,
+0x000000d1,0x00050080,0x00000006,0x0000012d,
+0x0000012c,0x0000008c,0x00050050,0x00000011,
+0x0000012e,0x0000012b,0x0000012d,0x0003003e,
+0x000000f0,0x0000012e,0x000200f9,0x0000011d,
+0x000200f8,0x0000011c,0x0004003d,0x00000006,
+0x00000130,0x000000d1,0x000500c2,0x00000006,
+0x00000131,0x00000130,0x000000ca,0x000500aa,
+0x000000ac,0x00000132,0x00000131,0x0000009c,
+0x000300f7,0x00000134,0x00000000,0x000400fa,
+0x00000132,0x00000133,0x0000013b,0x000200f8,
+0x00000133,0x0004003d,0x00000006,0x00000135,
+0x000000cc,0x00050080,0x00000006,0x00000136,
+0x00000135,0x00000091,0x0004003d,0x00000006,
+0x00000137,0x000000d1,0x000500c7,0x00000006,
+0x00000138,0x00000137,0x0000009f,0x00050080,
+0x00000006,0x00000139,0x00000138,0x000000fb,
+0x00050050,0x00000011,0x0000013a,0x00000136,
+0x00000139,0x0003003e,0x000000f0,0x0000013a,
+0x000200f9,0x00000134,0x000200f8,0x0000013b,
+0x0004003d,0x00000006,0x0000013c,0x000000d1,
+0x000500c7,0x00000006,0x0000013d,0x0000013c,
+0x0000009f,0x00050080,0x00000006,0x0000013e,
+0x0000013d,0x00000091,0x0004003d,0x00000006,
+0x0000013f,0x000000cc,0x00050080,0x00000006,
+0x00000140,0x0000013f,0x00000091,0x00050050,
+0x00000011,0x00000141,0x0000013e,0x00000140,
+0x0003003e,0x000000f0,0x00000141,0x000200f9,
+0x00000134,0x000200f8,0x00000134,0x000200f9,
+0x0000011d,0x000200f8,0x0000011d,0x000200f9,
+0x000000e4,0x000200f8,0x000000e4,0x0004003d,
+0x00000011,0x00000143,0x000000f0,0x0004003d,
+0x00000011,0x00000144,0x000000aa,0x000500ac,
+0x00000145,0x00000146,0x00000143,0x00000144,
+0x0004009a,0x000000ac,0x00000147,0x00000146,
+0x000300f7,0x00000149,0x00000000,0x000400fa,
+0x00000147,0x00000148,0x00000149,0x000200f8,
+0x00000148,0x0003003e,0x000000ae,0x00000110,
+0x000100fd,0x000200f8,0x00000149,0x0004003d,
+0x00000006,0x0000015d,0x000000d6,0x000500c4,
+0x00000006,0x0000015f,0x0000015d,0x0000015e,
+0x0004003d,0x00000006,0x00000160,0x000000e5,
+0x000500c5,0x00000006,0x00000161,0x0000015f,
+0x00000160,0x0003003e,0x00000163,0x0000015c,
+0x00050041,0x00000009,0x00000164,0x00000163,
+0x00000161,0x0004003d,0x00000008,0x00000165,
+0x00000164,0x0003003e,0x0000014c,0x00000165,
+0x00050041,0x000000b1,0x00000167,0x000000f0,
+0x0000009c,0x0004003d,0x00000006,0x00000168,
+0x00000167,0x00050041,0x000000b1,0x00000169,
+0x000000f0,0x0000009f,0x0004003d,0x00000006,
+0x0000016a,0x00000169,0x00050084,0x00000006,
+0x0000016b,0x00000168,0x0000016a,0x0004003d,
+0x000000ac,0x0000016c,0x000000db,0x000600a9,
+0x00000059,0x0000016d,0x0000016c,0x000000ca,
+0x000000bf,0x000500c4,0x00000006,0x0000016e,
+0x0000016b,0x0000016d,0x0003003e,0x00000166,
+0x0000016e,0x0004003d,0x00000006,0x00000171,
+0x00000166,0x0003003e,0x00000170,0x00000171,
+0x0004003d,0x00000008,0x00000173,0x0000014c,
+0x0003003e,0x00000172,0x00000173,0x00060039,
+0x00000006,0x00000174,0x0000000d,0x00000170,
+0x00000172,0x0003003e,0x0000016f,0x00000174,
+0x0004003d,0x00000006,0x00000175,0x0000016f,
+0x000500b0,0x000000ac,0x00000177,0x00000175,
+0x00000176,0x0004003d,0x00000006,0x00000178,
+0x0000016f,0x000500ac,0x000000ac,0x0000017a,
+0x00000178,0x00000179,0x000500a6,0x000000ac,
+0x0000017b,0x00000177,0x0000017a,0x0004003d,
+0x00000006,0x0000017c,0x00000166,0x000500ac,
+0x000000ac,0x0000017e,0x0000017c,0x0000017d,
+0x000500a6,0x000000ac,0x0000017f,0x0000017b,
+0x0000017e,0x000300f7,0x00000181,0x00000000,
+0x000400fa,0x0000017f,0x00000180,0x00000181,
+0x000200f8,0x00000180,0x0003003e,0x000000ae,
+0x00000110,0x000100fd,0x000200f8,0x00000181,
+0x00050041,0x000000b1,0x00000184,0x000000a7,
+0x00000095,0x0004003d,0x00000006,0x00000185,
+0x00000184,0x000600cb,0x00000006,0x00000187,
+0x00000185,0x00000186,0x000000c0,0x00050080,
+0x00000006,0x00000188,0x00000187,0x0000009f,
+0x0003003e,0x00000183,0x00000188,0x0004003d,
+0x00000006,0x00000189,0x00000183,0x000500ac,
+0x000000ac,0x0000018a,0x00000189,0x0000009f,
+0x000300f7,0x0000018c,0x00000000,0x000400fa,
+0x0000018a,0x0000018b,0x0000018c,0x000200f8,
+0x0000018b,0x00050041,0x000000b1,0x0000018e,
+0x000000a7,0x00000095,0x0004003d,0x00000006,
+0x0000018f,0x0000018e,0x000600cb,0x00000006,
+0x00000191,0x0000018f,0x00000190,0x000000de,
+0x0003003e,0x0000018d,0x00000191,0x000200f9,
+0x0000018c,0x000200f8,0x0000018c,0x0004003d,
+0x000000ac,0x00000192,0x000000db,0x0004003d,
+0x00000006,0x00000193,0x00000183,0x000500aa,
+0x000000ac,0x00000194,0x00000193,0x00000090,
+0x000500a7,0x000000ac,0x00000195,0x00000192,
+0x00000194,0x000300f7,0x00000197,0x00000000,
+0x000400fa,0x00000195,0x00000196,0x00000197,
+0x000200f8,0x00000196,0x0003003e,0x000000ae,
+0x00000110,0x000100fd,0x000200f8,0x00000197,
+0x000100fd,0x00010038,0x00050036,0x00000006,
+0x0000001c,0x00000000,0x00000018,0x00030037,
+0x00000010,0x00000019,0x00030037,0x00000007,
+0x0000001a,0x00030037,0x00000007,0x0000001b,
+0x000200f8,0x0000001d,0x0004003b,0x00000007,
+0x0000019e,0x00000007,0x0004003b,0x00000007,
+0x000001a3,0x00000007,0x0004003b,0x00000007,
+0x000001aa,0x00000007,0x0004003b,0x00000007,
+0x000001bd,0x00000007,0x0004003b,0x00000007,
+0x000001c0,0x00000007,0x0004003b,0x00000007,
+0x000001c9,0x00000007,0x0004003d,0x00000006,
+0x00000199,0x0000001b,0x000500aa,0x000000ac,
+0x0000019a,0x00000199,0x0000009c,0x000300f7,
+0x0000019c,0x00000000,0x000400fa,0x0000019a,
+0x0000019b,0x0000019c,0x000200f8,0x0000019b,
+0x000200fe,0x0000009c,0x000200f8,0x0000019c,
+0x0004003d,0x00000006,0x0000019f,0x0000001a,
+0x00050086,0x00000006,0x000001a1,0x0000019f,
+0x000001a0,0x00050082,0x00000006,0x000001a2,
+0x00000095,0x000001a1,0x0003003e,0x0000019e,
+0x000001a2,0x0004003d,0x00000006,0x000001a4,
+0x0000001a,0x0004003d,0x00000006,0x000001a5,
+0x0000001b,0x00050080,0x00000006,0x000001a6,
+0x000001a4,0x000001a5,0x00050082,0x00000006,
+0x000001a7,0x000001a6,0x0000009f,0x00050086,
+0x00000006,0x000001a8,0x000001a7,0x000001a0,
+0x00050082,0x00000006,0x000001a9,0x00000095,
+0x000001a8,0x0003003e,0x000001a3,0x000001a9,
+0x0004003d,0x00000006,0x000001ab,0x0000001a,
+0x000500c7,0x00000006,0x000001ad,0x000001ab,
+0x000001ac,0x0003003e,0x000001aa,0x000001ad,
+0x0004003d,0x00000006,0x000001ae,0x0000019e,
+0x0004003d,0x00000006,0x000001af,0x000001a3,
+0x000500aa,0x000000ac,0x000001b0,0x000001ae,
+0x000001af,0x000300f7,0x000001b2,0x00000000,
+0x000400fa,0x000001b0,0x000001b1,0x000001bc,
+0x000200f8,0x000001b1,0x0004003d,0x00000006,
+0x000001b3,0x0000019e,0x00050041,0x00000007,
+0x000001b4,0x00000019,0x000001b3,0x0004003d,
+0x00000006,0x000001b5,0x000001b4,0x0004003d,
+0x00000006,0x000001b6,0x000001aa,0x0004007c,
+0x00000059,0x000001b7,0x000001b6,0x0004003d,
+0x00000006,0x000001b8,0x0000001b,0x0004007c,
+0x00000059,0x000001b9,0x000001b8,0x000600cb,
+0x00000006,0x000001ba,0x000001b5,0x000001b7,
+0x000001b9,0x000200fe,0x000001ba,0x000200f8,
+0x000001bc,0x0004003d,0x00000006,0x000001be,
+0x000001aa,0x00050082,0x00000006,0x000001bf,
+0x000001a0,0x000001be,0x0003003e,0x000001bd,
+0x000001bf,0x0004003d,0x00000006,0x000001c1,
+0x0000019e,0x00050041,0x00000007,0x000001c2,
+0x00000019,0x000001c1,0x0004003d,0x00000006,
+0x000001c3,0x000001c2,0x0004003d,0x00000006,
+0x000001c4,0x000001aa,0x0004007c,0x00000059,
+0x000001c5,0x000001c4,0x0004003d,0x00000006,
+0x000001c6,0x000001bd,0x0004007c,0x00000059,
+0x000001c7,0x000001c6,0x000600cb,0x00000006,
+0x000001c8,0x000001c3,0x000001c5,0x000001c7,
+0x0003003e,0x000001c0,0x000001c8,0x0004003d,
+0x00000006,0x000001ca,0x000001a3,0x00050041,
+0x00000007,0x000001cb,0x00000019,0x000001ca,
+0x0004003d,0x00000006,0x000001cc,0x000001cb,
+0x0004003d,0x00000006,0x000001cd,0x0000001b,
+0x0004003d,0x00000006,0x000001ce,0x000001bd,
+0x00050082,0x00000006,0x000001cf,0x000001cd,
+0x000001ce,0x0004007c,0x00000059,0x000001d0,
+0x000001cf,0x000600cb,0x00000006,0x000001d1,
+0x000001cc,0x000000bf,0x000001d0,0x0003003e,
+0x000001c9,0x000001d1,0x0004003d,0x00000006,
+0x000001d2,0x000001c9,0x0004003d,0x00000006,
+0x000001d3,0x000001bd,0x000500c4,0x00000006,
+0x000001d4,0x000001d2,0x000001d3,0x0004003d,
+0x00000006,0x000001d5,0x000001c0,0x000500c5,
+0x00000006,0x000001d6,0x000001d4,0x000001d5,
+0x000200fe,0x000001d6,0x000200f8,0x000001b2,
+0x000100ff,0x00010038,0x00050036,0x00000006,
+0x00000023,0x00000000,0x0000001e,0x00030037,
+0x00000007,0x0000001f,0x00030037,0x00000007,
+0x00000020,0x00030037,0x00000007,0x00000021,
+0x00030037,0x00000007,0x00000022,0x000200f8,
+0x00000024,0x0004003b,0x00000007,0x000001e0,
+0x00000007,0x0004003b,0x00000007,0x000001eb,
+0x00000007,0x0004003b,0x00000007,0x000001f0,
+0x00000007,0x0004003b,0x00000007,0x000001fb,
+0x00000007,0x0004003b,0x00000007,0x00000209,
+0x00000007,0x0004003b,0x00000007,0x00000211,
+0x00000007,0x0004003b,0x00000010,0x00000212,
+0x00000007,0x0004003b,0x00000007,0x00000214,
+0x00000007,0x0004003b,0x00000007,0x00000216,
+0x00000007,0x0004003b,0x00000007,0x00000219,
+0x00000007,0x0004003b,0x00000007,0x0000021e,
+0x00000007,0x0004003b,0x00000007,0x00000226,
+0x00000007,0x0004003b,0x00000007,0x0000023e,
+0x00000007,0x0004003d,0x00000006,0x000001d9,
+0x00000183,0x000500aa,0x000000ac,0x000001da,
+0x000001d9,0x0000009f,0x000300f7,0x000001dc,
+0x00000000,0x000400fa,0x000001da,0x000001db,
+0x000001ea,0x000200f8,0x000001db,0x0004003d,
+0x00000006,0x000001de,0x0000016f,0x00050082,
+0x00000006,0x000001df,0x000001dd,0x000001de,
+0x0003003e,0x00000020,0x000001df,0x00050041,
+0x000000b1,0x000001e1,0x000000a7,0x00000095,
+0x0004003d,0x00000006,0x000001e2,0x000001e1,
+0x000600cb,0x00000006,0x000001e3,0x000001e2,
+0x00000190,0x000000c9,0x0003003e,0x000001e0,
+0x000001e3,0x0004003d,0x00000006,0x000001e4,
+0x000001e0,0x000500c2,0x00000006,0x000001e5,
+0x000001e4,0x000000c0,0x00050084,0x00000006,
+0x000001e6,0x00000091,0x000001e5,0x00050080,
+0x00000006,0x000001e7,0x000001e6,0x00000091,
+0x0003003e,0x00000021,0x000001e7,0x0003003e,
+0x00000022,0x0000009c,0x0004003d,0x00000006,
+0x000001e8,0x000001e0,0x000200fe,0x000001e8,
+0x000200f8,0x000001ea,0x00050041,0x000000b1,
+0x000001ec,0x000000a7,0x00000095,0x0004003d,
+0x00000006,0x000001ed,0x000001ec,0x000600cb,
+0x00000006,0x000001ef,0x000001ed,0x000001ee,
+0x000000c0,0x0003003e,0x000001eb,0x000001ef,
+0x00050041,0x000000b1,0x000001f1,0x000000a7,
+0x00000095,0x0004003d,0x00000006,0x000001f2,
+0x000001f1,0x000600cb,0x00000006,0x000001f4,
+0x000001f2,0x000001f3,0x000000c9,0x0003003e,
+0x000001f0,0x000001f4,0x0004003d,0x00000006,
+0x000001f5,0x000001eb,0x000500aa,0x000000ac,
+0x000001f6,0x000001f5,0x0000009c,0x000300f7,
+0x000001f8,0x00000000,0x000400fa,0x000001f6,
+0x000001f7,0x00000208,0x000200f8,0x000001f7,
+0x0004003d,0x00000006,0x000001f9,0x0000016f,
+0x00050082,0x00000006,0x000001fa,0x000001dd,
+0x000001f9,0x0003003e,0x00000020,0x000001fa,
+0x0004003d,0x00000006,0x000001fc,0x000001f0,
+0x000500c2,0x00000006,0x000001fd,0x000001fc,
+0x000000c0,0x00050084,0x00000006,0x000001fe,
+0x00000091,0x000001fd,0x00050080,0x00000006,
+0x000001ff,0x000001fe,0x00000091,0x0003003e,
+0x000001fb,0x000001ff,0x0004003d,0x00000006,
+0x00000200,0x000001fb,0x0004003d,0x00000006,
+0x00000201,0x00000183,0x00050084,0x00000006,
+0x00000202,0x00000200,0x00000201,0x0003003e,
+0x00000021,0x00000202,0x0004003d,0x00000006,
+0x00000203,0x000001fb,0x0004003d,0x00000006,
+0x00000204,0x0000001f,0x00050084,0x00000006,
+0x00000205,0x00000203,0x00000204,0x0003003e,
+0x00000022,0x00000205,0x0004003d,0x00000006,
+0x00000206,0x000001f0,0x000200fe,0x00000206,
+0x000200f8,0x00000208,0x0004003d,0x00000006,
+0x0000020a,0x00000183,0x00050084,0x00000006,
+0x0000020b,0x00000095,0x0000020a,0x00050082,
+0x00000006,0x0000020c,0x0000020b,0x00000090,
+0x0003003e,0x00000209,0x0000020c,0x0004003d,
+0x00000006,0x0000020d,0x0000016f,0x00050082,
+0x00000006,0x0000020e,0x000001dd,0x0000020d,
+0x0004003d,0x00000006,0x0000020f,0x00000209,
+0x00050082,0x00000006,0x00000210,0x0000020e,
+0x0000020f,0x0003003e,0x00000020,0x00000210,
+0x0004003d,0x0000000f,0x00000213,0x000000a7,
+0x0003003e,0x00000212,0x00000213,0x0004003d,
+0x00000006,0x00000215,0x00000020,0x0003003e,
+0x00000214,0x00000215,0x0004003d,0x00000006,
+0x00000217,0x00000209,0x0003003e,0x00000216,
+0x00000217,0x00070039,0x00000006,0x00000218,
+0x0000001c,0x00000212,0x00000214,0x00000216,
+0x0003003e,0x00000211,0x00000218,0x0004003d,
+0x00000006,0x0000021a,0x00000211,0x000500c4,
+0x00000006,0x0000021b,0x0000021a,0x000000c9,
+0x0004003d,0x00000006,0x0000021c,0x000001f0,
+0x000500c5,0x00000006,0x0000021d,0x0000021b,
+0x0000021c,0x0003003e,0x00000219,0x0000021d,
+0x0004003d,0x00000006,0x0000021f,0x00000219,
+0x0004003d,0x00000006,0x00000220,0x0000001f,
+0x00050084,0x00000006,0x00000221,0x00000091,
+0x00000220,0x0004003d,0x00000006,0x00000222,
+0x00000183,0x00050080,0x00000006,0x00000223,
+0x00000221,0x00000222,0x0004007c,0x00000059,
+0x00000224,0x00000223,0x000600cb,0x00000006,
+0x00000225,0x0000021f,0x00000224,0x000000c0,
+0x0003003e,0x0000021e,0x00000225,0x0004003d,
+0x00000006,0x00000227,0x00000219,0x0004003d,
+0x00000006,0x00000228,0x00000183,0x0004007c,
+0x00000059,0x00000229,0x00000228,0x000600cb,
+0x00000006,0x0000022a,0x00000227,0x000000bf,
+0x00000229,0x0003003e,0x00000226,0x0000022a,
+0x0004003d,0x00000006,0x0000022b,0x000001eb,
+0x0004003d,0x00000006,0x0000022c,0x00000183,
+0x00050084,0x00000006,0x0000022d,0x0000022b,
+0x0000022c,0x0004003d,0x00000006,0x0000022e,
+0x00000226,0x000400cd,0x00000059,0x0000022f,
+0x0000022e,0x0004007c,0x00000006,0x00000230,
+0x0000022f,0x00050080,0x00000006,0x00000231,
+0x0000022d,0x00000230,0x00050084,0x00000006,
+0x00000232,0x00000091,0x00000231,0x0003003e,
+0x00000021,0x00000232,0x0004003d,0x00000006,
+0x00000233,0x000001eb,0x0004003d,0x00000006,
+0x00000234,0x0000001f,0x00050084,0x00000006,
+0x00000235,0x00000233,0x00000234,0x0004003d,
+0x00000006,0x00000236,0x00000226,0x0004003d,
+0x00000006,0x00000237,0x0000001f,0x0004007c,
+0x00000059,0x00000238,0x00000237,0x000600cb,
+0x00000006,0x00000239,0x00000236,0x000000bf,
+0x00000238,0x000400cd,0x00000059,0x0000023a,
+0x00000239,0x0004007c,0x00000006,0x0000023b,
+0x0000023a,0x00050080,0x00000006,0x0000023c,
+0x00000235,0x0000023b,0x00050084,0x00000006,
+0x0000023d,0x00000091,0x0000023c,0x0003003e,
+0x00000022,0x0000023d,0x0004003d,0x00000006,
+0x0000023f,0x000001eb,0x00050082,0x00000006,
+0x00000240,0x0000023f,0x0000009f,0x0004003d,
+0x00000006,0x00000241,0x00000226,0x0004003d,
+0x00000006,0x00000242,0x0000001f,0x0004007c,
+0x00000059,0x00000243,0x00000242,0x000600cb,
+0x00000006,0x00000244,0x00000241,0x00000243,
+0x000000ca,0x00050080,0x00000006,0x00000245,
+0x00000240,0x00000244,0x0003003e,0x0000023e,
+0x00000245,0x0004003d,0x00000006,0x00000246,
+0x0000023e,0x000500c4,0x00000006,0x00000247,
+0x00000246,0x000000c0,0x0004003d,0x00000006,
+0x00000248,0x0000021e,0x000500c5,0x00000006,
+0x00000249,0x00000247,0x00000248,0x000200fe,
+0x00000249,0x000200f8,0x000001f8,0x000100ff,
+0x000200f8,0x000001dc,0x000100ff,0x00010038,
+0x00050036,0x00000006,0x0000002a,0x00000000,
+0x00000025,0x00030037,0x00000010,0x00000026,
+0x00030037,0x00000007,0x00000027,0x00030037,
+0x00000007,0x00000028,0x00030037,0x00000007,
+0x00000029,0x000200f8,0x0000002b,0x0004003b,
+0x0000024c,0x0000024d,0x00000007,0x0004003b,
+0x00000007,0x00000250,0x00000007,0x0004003b,
+0x00000010,0x00000257,0x00000007,0x0004003b,
+0x00000007,0x00000259,0x00000007,0x0004003b,
+0x00000007,0x0000025a,0x00000007,0x0004003b,
+0x00000007,0x0000025c,0x00000007,0x0004003b,
+0x00000007,0x0000027f,0x00000007,0x0004003b,
+0x00000010,0x00000280,0x00000007,0x0004003b,
+0x00000007,0x00000282,0x00000007,0x0004003b,
+0x00000007,0x00000284,0x00000007,0x0004003b,
+0x0000024c,0x00000288,0x00000007,0x0004003b,
+0x00000007,0x00000296,0x00000007,0x0004003b,
+0x0000037f,0x00000380,0x00000007,0x0004003d,
+0x00000006,0x0000024e,0x00000028,0x0004007c,
+0x00000059,0x0000024f,0x0000024e,0x0003003e,
+0x0000024d,0x0000024f,0x0004003d,0x00000006,
+0x00000251,0x00000027,0x0004003d,0x00000006,
+0x00000252,0x00000028,0x00050080,0x00000006,
+0x00000253,0x00000251,0x00000252,0x0004003d,
+0x00000006,0x00000254,0x00000028,0x00050084,
+0x00000006,0x00000255,0x00000090,0x00000254,
+0x00050080,0x00000006,0x00000256,0x00000255,
+0x0000008c,0x0004003d,0x0000000f,0x00000258,
+0x00000026,0x0003003e,0x00000257,0x00000258,
+0x0003003e,0x00000259,0x00000253,0x0003003e,
+0x0000025a,0x00000256,0x00070039,0x00000006,
+0x0000025b,0x0000001c,0x00000257,0x00000259,
+0x0000025a,0x0003003e,0x00000250,0x0000025b,
+0x0004003d,0x00000006,0x0000025d,0x00000250,
+0x000600cb,0x00000006,0x0000025e,0x0000025d,
+0x000000bf,0x000000c0,0x0004003d,0x00000006,
+0x0000025f,0x00000250,0x0004003d,0x00000059,
+0x00000260,0x0000024d,0x00050084,0x00000059,
+0x00000261,0x000000ca,0x00000260,0x00050080,
+0x00000059,0x00000262,0x00000261,0x000000c0,
+0x000600cb,0x00000006,0x00000263,0x0000025f,
+0x00000262,0x000000c0,0x000500c4,0x00000006,
+0x00000264,0x00000263,0x000000c0,0x000500c5,
+0x00000006,0x00000265,0x0000025e,0x00000264,
+0x0004003d,0x00000006,0x00000266,0x00000250,
+0x0004003d,0x00000059,0x00000267,0x0000024d,
+0x00050084,0x00000059,0x00000268,0x000000c0,
+0x00000267,0x00050080,0x00000059,0x00000269,
+0x00000268,0x000000c9,0x000600cb,0x00000006,
+0x0000026a,0x00000266,0x00000269,0x000000ca,
+0x000500c4,0x00000006,0x0000026b,0x0000026a,
+0x000000c9,0x000500c5,0x00000006,0x0000026c,
+0x00000265,0x0000026b,0x0004003d,0x00000006,
+0x0000026d,0x00000250,0x0004003d,0x00000059,
+0x0000026e,0x0000024d,0x00050084,0x00000059,
+0x0000026f,0x0000015e,0x0000026e,0x00050080,
+0x00000059,0x00000270,0x0000026f,0x000000cf,
+0x000600cb,0x00000006,0x00000271,0x0000026d,
+0x00000270,0x000000c0,0x000500c4,0x00000006,
+0x00000272,0x00000271,0x000000cf,0x000500c5,
+0x00000006,0x00000273,0x0000026c,0x00000272,
+0x0004003d,0x00000006,0x00000274,0x00000250,
+0x0004003d,0x00000059,0x00000275,0x0000024d,
+0x00050084,0x00000059,0x00000276,0x000000c9,
+0x00000275,0x00050080,0x00000059,0x00000277,
+0x00000276,0x000000d4,0x000600cb,0x00000006,
+0x00000278,0x00000274,0x00000277,0x000000ca,
+0x000500c4,0x00000006,0x00000279,0x00000278,
+0x000000d4,0x000500c5,0x00000006,0x0000027a,
+0x00000273,0x00000279,0x0003003e,0x0000025c,
+0x0000027a,0x0004003d,0x00000006,0x0000027b,
+0x00000029,0x000500aa,0x000000ac,0x0000027c,
+0x0000027b,0x0000009c,0x000300f7,0x0000027e,
+0x00000000,0x000400fa,0x0000027c,0x0000027d,
+0x00000287,0x000200f8,0x0000027d,0x0004003d,
+0x0000000f,0x00000281,0x00000026,0x0003003e,
+0x00000280,0x00000281,0x0004003d,0x00000006,
+0x00000283,0x00000027,0x0003003e,0x00000282,
+0x00000283,0x0004003d,0x00000006,0x00000285,
+0x00000028,0x0003003e,0x00000284,0x00000285,
+0x00070039,0x00000006,0x00000286,0x0000001c,
+0x00000280,0x00000282,0x00000284,0x0003003e,
+0x0000027f,0x00000286,0x000200f9,0x0000027e,
+0x000200f8,0x00000287,0x0004003d,0x00000006,
+0x00000289,0x00000029,0x0004007c,0x00000059,
+0x0000028a,0x00000289,0x00050082,0x00000059,
+0x0000028b,0x0000028a,0x000000ca,0x0003003e,
+0x00000288,0x0000028b,0x0004003d,0x00000006,
+0x0000028c,0x00000250,0x0004003d,0x00000059,
+0x0000028d,0x00000288,0x0004003d,0x00000059,
+0x0000028e,0x0000024d,0x00050084,0x00000059,
+0x0000028f,0x0000028d,0x0000028e,0x0004003d,
+0x00000059,0x00000291,0x00000288,0x0005004d,
+0x00000059,0x00000292,0x00000290,0x00000291,
+0x00050080,0x00000059,0x00000293,0x0000028f,
+0x00000292,0x0004003d,0x00000059,0x00000294,
+0x0000024d,0x000600cb,0x00000006,0x00000295,
+0x0000028c,0x00000293,0x00000294,0x0003003e,
+0x0000027f,0x00000295,0x000200f9,0x0000027e,
+0x000200f8,0x0000027e,0x0004003d,0x00000006,
+0x0000037e,0x0000025c,0x0003003e,0x00000380,
+0x0000037d,0x00050041,0x00000007,0x00000381,
+0x00000380,0x0000037e,0x0004003d,0x00000006,
+0x00000382,0x00000381,0x0003003e,0x00000296,
+0x00000382,0x0004003d,0x00000006,0x00000383,
+0x00000296,0x0004003d,0x00000006,0x00000384,
+0x00000029,0x0004007c,0x00000059,0x00000385,
+0x00000384,0x00050084,0x00000059,0x00000386,
+0x000000c0,0x00000385,0x000600cb,0x00000006,
+0x00000387,0x00000383,0x00000386,0x000000c0,
+0x0004003d,0x00000006,0x00000388,0x00000028,
+0x000500c4,0x00000006,0x00000389,0x00000387,
+0x00000388,0x0004003d,0x00000006,0x0000038a,
+0x0000027f,0x000500c5,0x00000006,0x0000038b,
+0x00000389,0x0000038a,0x000200fe,0x0000038b,
+0x00010038,0x00050036,0x00000006,0x00000030,
+0x00000000,0x00000025,0x00030037,0x00000010,
+0x0000002c,0x00030037,0x00000007,0x0000002d,
+0x00030037,0x00000007,0x0000002e,0x00030037,
+0x00000007,0x0000002f,0x000200f8,0x00000031,
+0x0004003b,0x0000024c,0x0000038e,0x00000007,
+0x0004003b,0x00000007,0x00000391,0x00000007,
+0x0004003b,0x00000010,0x00000395,0x00000007,
+0x0004003b,0x00000007,0x00000397,0x00000007,
+0x0004003b,0x00000007,0x00000399,0x00000007,
+0x0004003b,0x00000007,0x0000039b,0x00000007,
+0x0004003b,0x00000007,0x000003ad,0x00000007,
+0x0004003b,0x00000007,0x000003b9,0x00000007,
+0x0004003b,0x000003f0,0x000003f1,0x00000007,
+0x0004003d,0x00000006,0x0000038f,0x0000002e,
+0x0004007c,0x00000059,0x00000390,0x0000038f,
+0x0003003e,0x0000038e,0x00000390,0x0004003d,
+0x00000006,0x00000392,0x0000002e,0x00050084,
+0x00000006,0x00000393,0x00000095,0x00000392,
+0x00050080,0x00000006,0x00000394,0x00000393,
+0x0000008d,0x0004003d,0x0000000f,0x00000396,
+0x0000002c,0x0003003e,0x00000395,0x00000396,
+0x0004003d,0x00000006,0x00000398,0x0000002d,
+0x0003003e,0x00000397,0x00000398,0x0003003e,
+0x00000399,0x00000394,0x00070039,0x00000006,
+0x0000039a,0x0000001c,0x00000395,0x00000397,
+0x00000399,0x0003003e,0x00000391,0x0000039a,
+0x0004003d,0x00000006,0x0000039c,0x00000391,
+0x0004003d,0x00000059,0x0000039d,0x0000038e,
+0x000600cb,0x00000006,0x0000039e,0x0000039c,
+0x0000039d,0x0000015e,0x0004003d,0x00000006,
+0x0000039f,0x00000391,0x0004003d,0x00000059,
+0x000003a0,0x0000038e,0x00050084,0x00000059,
+0x000003a1,0x000000c0,0x000003a0,0x00050080,
+0x00000059,0x000003a2,0x000003a1,0x0000015e,
+0x000600cb,0x00000006,0x000003a3,0x0000039f,
+0x000003a2,0x000000c0,0x000500c4,0x00000006,
+0x000003a4,0x000003a3,0x0000015e,0x000500c5,
+0x00000006,0x000003a5,0x0000039e,0x000003a4,
+0x0004003d,0x00000006,0x000003a6,0x00000391,
+0x0004003d,0x00000059,0x000003a7,0x0000038e,
+0x00050084,0x00000059,0x000003a8,0x0000015e,
+0x000003a7,0x00050080,0x00000059,0x000003a9,
+0x000003a8,0x000000cf,0x000600cb,0x00000006,
+0x000003aa,0x000003a6,0x000003a9,0x000000c0,
+0x000500c4,0x00000006,0x000003ab,0x000003aa,
+0x000000cf,0x000500c5,0x00000006,0x000003ac,
+0x000003a5,0x000003ab,0x0003003e,0x0000039b,
+0x000003ac,0x0004003d,0x00000006,0x000003ae,
+0x00000391,0x0004003d,0x00000006,0x000003af,
+0x0000002f,0x0004007c,0x00000059,0x000003b0,
+0x000003af,0x0004003d,0x00000059,0x000003b1,
+0x0000038e,0x00050084,0x00000059,0x000003b2,
+0x000003b0,0x000003b1,0x0004003d,0x00000006,
+0x000003b4,0x0000002f,0x0005004d,0x00000059,
+0x000003b5,0x000003b3,0x000003b4,0x00050080,
+0x00000059,0x000003b6,0x000003b2,0x000003b5,
+0x0004003d,0x00000059,0x000003b7,0x0000038e,
+0x000600cb,0x00000006,0x000003b8,0x000003ae,
+0x000003b6,0x000003b7,0x0003003e,0x000003ad,
+0x000003b8,0x0004003d,0x00000006,0x000003ef,
+0x0000039b,0x0003003e,0x000003f1,0x000003ee,
+0x00050041,0x00000007,0x000003f2,0x000003f1,
+0x000003ef,0x0004003d,0x00000006,0x000003f3,
+0x000003f2,0x0003003e,0x000003b9,0x000003f3,
+0x0004003d,0x00000006,0x000003f4,0x000003b9,
+0x0004003d,0x00000006,0x000003f5,0x0000002f,
+0x0004007c,0x00000059,0x000003f6,0x000003f5,
+0x00050084,0x00000059,0x000003f7,0x0000015e,
+0x000003f6,0x000600cb,0x00000006,0x000003f8,
+0x000003f4,0x000003f7,0x0000015e,0x0004003d,
+0x00000006,0x000003f9,0x0000002e,0x000500c4,
+0x00000006,0x000003fa,0x000003f8,0x000003f9,
+0x0004003d,0x00000006,0x000003fb,0x000003ad,
+0x000500c5,0x00000006,0x000003fc,0x000003fa,
+0x000003fb,0x000200fe,0x000003fc,0x00010038,
+0x00050036,0x00000006,0x00000037,0x00000000,
+0x00000032,0x00030037,0x00000010,0x00000033,
+0x00030037,0x00000009,0x00000034,0x00030037,
+0x00000007,0x00000035,0x00030037,0x00000007,
+0x00000036,0x000200f8,0x00000038,0x0004003b,
+0x00000007,0x00000405,0x00000007,0x0004003b,
+0x00000007,0x0000040d,0x00000007,0x0004003b,
+0x00000007,0x00000414,0x00000007,0x0004003b,
+0x00000010,0x00000417,0x00000007,0x0004003b,
+0x00000007,0x00000419,0x00000007,0x0004003b,
+0x00000007,0x0000041b,0x00000007,0x0004003b,
+0x00000007,0x0000041d,0x00000007,0x0004003b,
+0x00000435,0x00000436,0x00000007,0x0004003b,
+0x00000007,0x00000440,0x00000007,0x0004003b,
+0x00000007,0x00000447,0x00000007,0x0004003b,
+0x00000010,0x0000044a,0x00000007,0x0004003b,
+0x00000007,0x0000044c,0x00000007,0x0004003b,
+0x00000007,0x0000044e,0x00000007,0x0004003b,
+0x00000007,0x00000450,0x00000007,0x0004003b,
+0x00000463,0x00000464,0x00000007,0x0004003b,
+0x00000007,0x00000469,0x00000007,0x0004003b,
+0x00000007,0x0000046d,0x00000007,0x0004003b,
+0x00000010,0x0000046e,0x00000007,0x0004003b,
+0x00000007,0x00000470,0x00000007,0x0004003b,
+0x00000007,0x00000472,0x00000007,0x0004003b,
+0x00000012,0x00000475,0x00000007,0x0004003b,
+0x00000480,0x00000481,0x00000007,0x0004003d,
+0x00000006,0x000003ff,0x00000036,0x0004003d,
+0x00000006,0x00000400,0x00000035,0x000500ae,
+0x000000ac,0x00000401,0x000003ff,0x00000400,
+0x000300f7,0x00000403,0x00000000,0x000400fa,
+0x00000401,0x00000402,0x00000403,0x000200f8,
+0x00000402,0x000200fe,0x0000009c,0x000200f8,
+0x00000403,0x00050041,0x00000007,0x00000406,
+0x00000034,0x00000091,0x0004003d,0x00000006,
+0x00000407,0x00000406,0x0003003e,0x00000405,
+0x00000407,0x00050041,0x00000007,0x00000408,
+0x00000034,0x0000009c,0x0004003d,0x00000006,
+0x00000409,0x00000408,0x000500aa,0x000000ac,
+0x0000040a,0x00000409,0x0000009f,0x000300f7,
+0x0000040c,0x00000000,0x000400fa,0x0000040a,
+0x0000040b,0x0000043a,0x000200f8,0x0000040b,
+0x0004003d,0x00000006,0x0000040e,0x00000036,
+0x00050086,0x00000006,0x0000040f,0x0000040e,
+0x00000094,0x0004003d,0x00000006,0x00000410,
+0x00000405,0x00050084,0x00000006,0x00000411,
+0x00000094,0x00000410,0x00050080,0x00000006,
+0x00000412,0x00000411,0x0000008c,0x00050084,
+0x00000006,0x00000413,0x0000040f,0x00000412,
+0x0003003e,0x0000040d,0x00000413,0x0004003d,
+0x00000006,0x00000415,0x00000036,0x00050089,
+0x00000006,0x00000416,0x00000415,0x00000094,
+0x0004003d,0x0000000f,0x00000418,0x00000033,
+0x0003003e,0x00000417,0x00000418,0x0004003d,
+0x00000006,0x0000041a,0x0000040d,0x0003003e,
+0x00000419,0x0000041a,0x0004003d,0x00000006,
+0x0000041c,0x00000405,0x0003003e,0x0000041b,
+0x0000041c,0x0003003e,0x0000041d,0x00000416,
+0x00080039,0x00000006,0x0000041e,0x0000002a,
+0x00000417,0x00000419,0x0000041b,0x0000041d,
+0x0003003e,0x00000414,0x0000041e,0x0004003d,
+0x00000006,0x0000042e,0x00000405,0x000500c4,
+0x00000059,0x0000042f,0x000000ca,0x0000042e,
+0x00050082,0x00000059,0x00000430,0x0000042f,
+0x000000ca,0x00050084,0x00000059,0x00000431,
+0x0000015e,0x00000430,0x0004007c,0x00000006,
+0x00000432,0x00000431,0x0004003d,0x00000006,
+0x00000433,0x00000414,0x00050080,0x00000006,
+0x00000434,0x00000432,0x00000433,0x0003003e,
+0x00000436,0x0000042d,0x00050041,0x00000007,
+0x00000437,0x00000436,0x00000434,0x0004003d,
+0x00000006,0x00000438,0x00000437,0x000200fe,
+0x00000438,0x000200f8,0x0000043a,0x00050041,
+0x00000007,0x0000043b,0x00000034,0x0000009f,
+0x0004003d,0x00000006,0x0000043c,0x0000043b,
+0x000500aa,0x000000ac,0x0000043d,0x0000043c,
+0x0000009f,0x000300f7,0x0000043f,0x00000000,
+0x000400fa,0x0000043d,0x0000043e,0x00000468,
+0x000200f8,0x0000043e,0x0004003d,0x00000006,
+0x00000441,0x00000036,0x00050086,0x00000006,
+0x00000442,0x00000441,0x00000095,0x0004003d,
+0x00000006,0x00000443,0x00000405,0x00050084,
+0x00000006,0x00000444,0x00000095,0x00000443,
+0x00050080,0x00000006,0x00000445,0x00000444,
+0x0000008d,0x00050084,0x00000006,0x00000446,
+0x00000442,0x00000445,0x0003003e,0x00000440,
+0x00000446,0x0004003d,0x00000006,0x00000448,
+0x00000036,0x00050089,0x00000006,0x00000449,
+0x00000448,0x00000095,0x0004003d,0x0000000f,
+0x0000044b,0x00000033,0x0003003e,0x0000044a,
+0x0000044b,0x0004003d,0x00000006,0x0000044d,
+0x00000440,0x0003003e,0x0000044c,0x0000044d,
+0x0004003d,0x00000006,0x0000044f,0x00000405,
+0x0003003e,0x0000044e,0x0000044f,0x0003003e,
+0x00000450,0x00000449,0x00080039,0x00000006,
+0x00000451,0x00000030,0x0000044a,0x0000044c,
+0x0000044e,0x00000450,0x0003003e,0x00000447,
+0x00000451,0x0004003d,0x00000006,0x0000045c,
+0x00000405,0x000500c4,0x00000059,0x0000045d,
+0x000000ca,0x0000045c,0x00050082,0x00000059,
+0x0000045e,0x0000045d,0x000000ca,0x00050084,
+0x00000059,0x0000045f,0x000000cf,0x0000045e,
+0x0004007c,0x00000006,0x00000460,0x0000045f,
+0x0004003d,0x00000006,0x00000461,0x00000447,
+0x00050080,0x00000006,0x00000462,0x00000460,
+0x00000461,0x0003003e,0x00000464,0x0000045b,
+0x00050041,0x00000007,0x00000465,0x00000464,
+0x00000462,0x0004003d,0x00000006,0x00000466,
+0x00000465,0x000200fe,0x00000466,0x000200f8,
+0x00000468,0x0004003d,0x00000006,0x0000046a,
+0x00000036,0x0004003d,0x00000006,0x0000046b,
+0x00000405,0x00050084,0x00000006,0x0000046c,
+0x0000046a,0x0000046b,0x0003003e,0x00000469,
+0x0000046c,0x0004003d,0x0000000f,0x0000046f,
+0x00000033,0x0003003e,0x0000046e,0x0000046f,
+0x0004003d,0x00000006,0x00000471,0x00000469,
+0x0003003e,0x00000470,0x00000471,0x0004003d,
+0x00000006,0x00000473,0x00000405,0x0003003e,
+0x00000472,0x00000473,0x00070039,0x00000006,
+0x00000474,0x0000001c,0x0000046e,0x00000470,
+0x00000472,0x0003003e,0x0000046d,0x00000474,
+0x0004003d,0x00000006,0x0000047e,0x00000405,
+0x00050082,0x00000006,0x0000047f,0x0000047e,
+0x0000009f,0x0003003e,0x00000481,0x0000047d,
+0x00050041,0x00000012,0x00000482,0x00000481,
+0x0000047f,0x0004003d,0x00000011,0x00000483,
+0x00000482,0x0003003e,0x00000475,0x00000483,
+0x0004003d,0x00000006,0x00000484,0x0000046d,
+0x00050041,0x00000007,0x00000485,0x00000475,
+0x0000009c,0x0004003d,0x00000006,0x00000486,
+0x00000485,0x00050084,0x00000006,0x00000487,
+0x00000484,0x00000486,0x0004003d,0x00000006,
+0x00000488,0x0000046d,0x00050041,0x00000007,
+0x00000489,0x00000475,0x0000009f,0x0004003d,
+0x00000006,0x0000048a,0x00000489,0x000500c2,
+0x00000006,0x0000048b,0x00000488,0x0000048a,
+0x000500c5,0x00000006,0x0000048c,0x00000487,
+0x0000048b,0x0003003e,0x0000046d,0x0000048c,
+0x0004003d,0x00000006,0x0000048d,0x0000046d,
+0x000500ac,0x000000ac,0x0000048e,0x0000048d,
+0x000001a0,0x000300f7,0x00000490,0x00000000,
+0x000400fa,0x0000048e,0x0000048f,0x00000490,
+0x000200f8,0x0000048f,0x0004003d,0x00000006,
+0x00000491,0x0000046d,0x00050080,0x00000006,
+0x00000492,0x00000491,0x0000009f,0x0003003e,
+0x0000046d,0x00000492,0x000200f9,0x00000490,
+0x000200f8,0x00000490,0x0004003d,0x00000006,
+0x00000493,0x0000046d,0x000200fe,0x00000493,
+0x000200f8,0x0000043f,0x000100ff,0x000200f8,
+0x0000040c,0x000100ff,0x00010038,0x00050036,
+0x00000006,0x00000042,0x00000000,0x00000039,
+0x00030037,0x00000010,0x0000003a,0x00030037,
+0x00000009,0x0000003b,0x00030037,0x00000007,
+0x0000003c,0x00030037,0x00000007,0x0000003d,
+0x00030037,0x00000007,0x0000003e,0x00030037,
+0x00000007,0x0000003f,0x00030037,0x00000007,
+0x00000040,0x00030037,0x00000012,0x00000041,
+0x000200f8,0x00000043,0x0004003b,0x00000010,
+0x00000496,0x00000007,0x0004003b,0x00000010,
+0x000004a4,0x00000007,0x0004003b,0x00000010,
+0x000004a5,0x00000007,0x0004003b,0x00000009,
+0x000004a7,0x00000007,0x0004003b,0x00000007,
+0x000004a9,0x00000007,0x0004003b,0x00000007,
+0x000004ab,0x00000007,0x0004003b,0x00000010,
+0x000004af,0x00000007,0x0004003b,0x00000009,
+0x000004b1,0x00000007,0x0004003b,0x00000007,
+0x000004b3,0x00000007,0x0004003b,0x00000007,
+0x000004b5,0x00000007,0x0004003b,0x00000010,
+0x000004b9,0x00000007,0x0004003b,0x00000009,
+0x000004bb,0x00000007,0x0004003b,0x00000007,
+0x000004bd,0x00000007,0x0004003b,0x00000007,
+0x000004bf,0x00000007,0x0004003b,0x00000010,
+0x000004c3,0x00000007,0x0004003b,0x00000009,
+0x000004c5,0x00000007,0x0004003b,0x00000007,
+0x000004c7,0x00000007,0x0004003b,0x00000007,
+0x000004c9,0x00000007,0x0004003b,0x00000007,
+0x000004ce,0x00000007,0x0004003b,0x00000010,
+0x000004d6,0x00000007,0x0004003d,0x00000006,
+0x00000497,0x0000003f,0x0004003d,0x00000006,
+0x00000498,0x0000003d,0x00070050,0x0000000f,
+0x00000499,0x00000498,0x00000498,0x00000498,
+0x00000498,0x0004003d,0x00000006,0x0000049a,
+0x0000003e,0x0004003d,0x00000006,0x0000049b,
+0x0000003e,0x00050080,0x00000006,0x0000049c,
+0x0000049b,0x0000009f,0x00070050,0x0000000f,
+0x0000049d,0x0000009c,0x0000009f,0x0000049a,
+0x0000049c,0x00050080,0x0000000f,0x0000049e,
+0x00000499,0x0000049d,0x00070050,0x0000000f,
+0x0000049f,0x00000497,0x00000497,0x00000497,
+0x00000497,0x00050084,0x0000000f,0x000004a0,
+0x0000049f,0x0000049e,0x0004003d,0x00000006,
+0x000004a1,0x00000040,0x00070050,0x0000000f,
+0x000004a2,0x000004a1,0x000004a1,0x000004a1,
+0x000004a1,0x00050080,0x0000000f,0x000004a3,
+0x000004a0,0x000004a2,0x0003003e,0x00000496,
+0x000004a3,0x0004003d,0x0000000f,0x000004a6,
+0x0000003a,0x0003003e,0x000004a5,0x000004a6,
+0x0004003d,0x00000008,0x000004a8,0x0000003b,
+0x0003003e,0x000004a7,0x000004a8,0x0004003d,
+0x00000006,0x000004aa,0x0000003c,0x0003003e,
+0x000004a9,0x000004aa,0x00050041,0x00000007,
+0x000004ac,0x00000496,0x0000009c,0x0004003d,
+0x00000006,0x000004ad,0x000004ac,0x0003003e,
+0x000004ab,0x000004ad,0x00080039,0x00000006,
+0x000004ae,0x00000037,0x000004a5,0x000004a7,
+0x000004a9,0x000004ab,0x0004003d,0x0000000f,
+0x000004b0,0x0000003a,0x0003003e,0x000004af,
+0x000004b0,0x0004003d,0x00000008,0x000004b2,
+0x0000003b,0x0003003e,0x000004b1,0x000004b2,
+0x0004003d,0x00000006,0x000004b4,0x0000003c,
+0x0003003e,0x000004b3,0x000004b4,0x00050041,
+0x00000007,0x000004b6,0x00000496,0x0000009f,
+0x0004003d,0x00000006,0x000004b7,0x000004b6,
+0x0003003e,0x000004b5,0x000004b7,0x00080039,
+0x00000006,0x000004b8,0x00000037,0x000004af,
+0x000004b1,0x000004b3,0x000004b5,0x0004003d,
+0x0000000f,0x000004ba,0x0000003a,0x0003003e,
+0x000004b9,0x000004ba,0x0004003d,0x00000008,
+0x000004bc,0x0000003b,0x0003003e,0x000004bb,
+0x000004bc,0x0004003d,0x00000006,0x000004be,
+0x0000003c,0x0003003e,0x000004bd,0x000004be,
+0x00050041,0x00000007,0x000004c0,0x00000496,
+0x00000091,0x0004003d,0x00000006,0x000004c1,
+0x000004c0,0x0003003e,0x000004bf,0x000004c1,
+0x00080039,0x00000006,0x000004c2,0x00000037,
+0x000004b9,0x000004bb,0x000004bd,0x000004bf,
+0x0004003d,0x0000000f,0x000004c4,0x0000003a,
+0x0003003e,0x000004c3,0x000004c4,0x0004003d,
+0x00000008,0x000004c6,0x0000003b,0x0003003e,
+0x000004c5,0x000004c6,0x0004003d,0x00000006,
+0x000004c8,0x0000003c,0x0003003e,0x000004c7,
+0x000004c8,0x00050041,0x00000007,0x000004ca,
+0x00000496,0x00000095,0x0004003d,0x00000006,
+0x000004cb,0x000004ca,0x0003003e,0x000004c9,
+0x000004cb,0x00080039,0x00000006,0x000004cc,
+0x00000037,0x000004c3,0x000004c5,0x000004c7,
+0x000004c9,0x00070050,0x0000000f,0x000004cd,
+0x000004ae,0x000004b8,0x000004c2,0x000004cc,
+0x0003003e,0x000004a4,0x000004cd,0x00050041,
+0x00000007,0x000004cf,0x00000041,0x0000009c,
+0x0004003d,0x00000006,0x000004d0,0x000004cf,
+0x00050041,0x00000007,0x000004d1,0x00000041,
+0x0000009f,0x0004003d,0x00000006,0x000004d2,
+0x000004d1,0x00050084,0x00000006,0x000004d3,
+0x000004d0,0x000004d2,0x00050080,0x00000006,
+0x000004d4,0x000004d3,0x0000008c,0x000500c2,
+0x00000006,0x000004d5,0x000004d4,0x000000c9,
+0x0003003e,0x000004ce,0x000004d5,0x00050041,
+0x00000007,0x000004d7,0x00000041,0x0000009c,
+0x0004003d,0x00000006,0x000004d8,0x000004d7,
+0x00050082,0x00000006,0x000004d9,0x0000014d,
+0x000004d8,0x00050041,0x00000007,0x000004da,
+0x00000041,0x0000009f,0x0004003d,0x00000006,
+0x000004db,0x000004da,0x00050082,0x00000006,
+0x000004dc,0x000004d9,0x000004db,0x0004003d,
+0x00000006,0x000004dd,0x000004ce,0x00050080,
+0x00000006,0x000004de,0x000004dc,0x000004dd,
+0x00050041,0x00000007,0x000004df,0x00000041,
+0x0000009c,0x0004003d,0x00000006,0x000004e0,
+0x000004df,0x0004003d,0x00000006,0x000004e1,
+0x000004ce,0x00050082,0x00000006,0x000004e2,
+0x000004e0,0x000004e1,0x00050041,0x00000007,
+0x000004e3,0x00000041,0x0000009f,0x0004003d,
+0x00000006,0x000004e4,0x000004e3,0x0004003d,
+0x00000006,0x000004e5,0x000004ce,0x00050082,
+0x00000006,0x000004e6,0x000004e4,0x000004e5,
+0x0004003d,0x00000006,0x000004e7,0x000004ce,
+0x00070050,0x0000000f,0x000004e8,0x000004de,
+0x000004e2,0x000004e6,0x000004e7,0x0003003e,
+0x000004d6,0x000004e8,0x0004003d,0x0000000f,
+0x000004e9,0x000004a4,0x00040070,0x000004eb,
+0x000004ec,0x000004e9,0x0004003d,0x0000000f,
+0x000004ed,0x000004d6,0x00040070,0x000004eb,
+0x000004ee,0x000004ed,0x00050094,0x000004ea,
+0x000004ef,0x000004ec,0x000004ee,0x00050081,
+0x000004ea,0x000004f1,0x000004ef,0x000004f0,
+0x0004006d,0x00000006,0x000004f2,0x000004f1,
+0x000500c2,0x00000006,0x000004f3,0x000004f2,
+0x000000c9,0x000200fe,0x000004f3,0x00010038,
+0x00050036,0x00000011,0x00000047,0x00000000,
+0x00000044,0x00030037,0x00000010,0x00000045,
+0x00030037,0x00000011,0x00000046,0x000200f8,
+0x00000048,0x0004003b,0x00000012,0x000004f6,
+0x00000007,0x0004003b,0x00000012,0x00000501,
+0x00000007,0x0004003b,0x00000012,0x00000504,
+0x00000007,0x0004003b,0x00000012,0x00000510,
+0x00000007,0x0004003b,0x00000012,0x00000514,
+0x00000007,0x0004003b,0x00000007,0x00000519,
+0x00000007,0x0004003b,0x00000007,0x0000051c,
+0x00000007,0x0004003b,0x00000012,0x00000524,
+0x00000007,0x0004003b,0x00000010,0x0000052a,
+0x00000007,0x0004003b,0x00000009,0x0000052c,
+0x00000007,0x0004003b,0x00000007,0x0000052e,
+0x00000007,0x0004003b,0x00000007,0x00000530,
+0x00000007,0x0004003b,0x00000007,0x00000532,
+0x00000007,0x0004003b,0x00000007,0x00000534,
+0x00000007,0x0004003b,0x00000007,0x00000535,
+0x00000007,0x0004003b,0x00000012,0x00000536,
+0x00000007,0x0004003b,0x00000010,0x0000053d,
+0x00000007,0x0004003b,0x00000009,0x0000053f,
+0x00000007,0x0004003b,0x00000007,0x00000541,
+0x00000007,0x0004003b,0x00000007,0x00000543,
+0x00000007,0x0004003b,0x00000007,0x00000545,
+0x00000007,0x0004003b,0x00000007,0x00000547,
+0x00000007,0x0004003b,0x00000007,0x00000548,
+0x00000007,0x0004003b,0x00000012,0x00000549,
+0x00000007,0x0004003d,0x00000011,0x000004f8,
+0x000000aa,0x00050050,0x00000011,0x000004f9,
+0x00000091,0x00000091,0x00050086,0x00000011,
+0x000004fa,0x000004f8,0x000004f9,0x00050050,
+0x00000011,0x000004fb,0x000004f7,0x000004f7,
+0x00050080,0x00000011,0x000004fc,0x000004fb,
+0x000004fa,0x0004003d,0x00000011,0x000004fd,
+0x000000aa,0x00050050,0x00000011,0x000004fe,
+0x0000009f,0x0000009f,0x00050082,0x00000011,
+0x000004ff,0x000004fd,0x000004fe,0x00050086,
+0x00000011,0x00000500,0x000004fc,0x000004ff,
+0x0003003e,0x000004f6,0x00000500,0x0004003d,
+0x00000011,0x00000502,0x000004f6,0x00050084,
+0x00000011,0x00000503,0x00000046,0x00000502,
+0x0003003e,0x00000501,0x00000503,0x0004003d,
+0x00000011,0x00000505,0x00000501,0x0004003d,
+0x00000011,0x00000506,0x000000f0,0x00050050,
+0x00000011,0x00000507,0x0000009f,0x0000009f,
+0x00050082,0x00000011,0x00000508,0x00000506,
+0x00000507,0x00050084,0x00000011,0x00000509,
+0x00000505,0x00000508,0x00050050,0x00000011,
+0x0000050a,0x000001a0,0x000001a0,0x00050080,
+0x00000011,0x0000050b,0x00000509,0x0000050a,
+0x00050050,0x0000050d,0x0000050e,0x0000050c,
+0x0000050c,0x000500c2,0x00000011,0x0000050f,
+0x0000050b,0x0000050e,0x0003003e,0x00000504,
+0x0000050f,0x0004003d,0x00000011,0x00000511,
+0x00000504,0x00050050,0x0000050d,0x00000512,
+0x000000c9,0x000000c9,0x000500c2,0x00000011,
+0x00000513,0x00000511,0x00000512,0x0003003e,
+0x00000510,0x00000513,0x0004003d,0x00000011,
+0x00000515,0x00000504,0x00050050,0x00000011,
+0x00000517,0x00000516,0x00000516,0x000500c7,
+0x00000011,0x00000518,0x00000515,0x00000517,
+0x0003003e,0x00000514,0x00000518,0x00050041,
+0x000000b1,0x0000051a,0x000000f0,0x0000009c,
+0x0004003d,0x00000006,0x0000051b,0x0000051a,
+0x0003003e,0x00000519,0x0000051b,0x00050041,
+0x00000007,0x0000051d,0x00000510,0x0000009f,
+0x0004003d,0x00000006,0x0000051e,0x0000051d,
+0x0004003d,0x00000006,0x0000051f,0x00000519,
+0x00050084,0x00000006,0x00000520,0x0000051e,
+0x0000051f,0x00050041,0x00000007,0x00000521,
+0x00000510,0x0000009c,0x0004003d,0x00000006,
+0x00000522,0x00000521,0x00050080,0x00000006,
+0x00000523,0x00000520,0x00000522,0x0003003e,
+0x0000051c,0x00000523,0x0003003e,0x00000524,
+0x00000525,0x0004003d,0x000000ac,0x00000526,
+0x000000db,0x000600a9,0x00000059,0x00000527,
+0x00000526,0x000000ca,0x000000bf,0x000500c4,
+0x00000059,0x00000528,0x000000ca,0x00000527,
+0x0004007c,0x00000006,0x00000529,0x00000528,
+0x0004003d,0x0000000f,0x0000052b,0x00000045,
+0x0003003e,0x0000052a,0x0000052b,0x0004003d,
+0x00000008,0x0000052d,0x0000014c,0x0003003e,
+0x0000052c,0x0000052d,0x0004003d,0x00000006,
+0x0000052f,0x00000166,0x0003003e,0x0000052e,
+0x0000052f,0x0004003d,0x00000006,0x00000531,
+0x0000051c,0x0003003e,0x00000530,0x00000531,
+0x0004003d,0x00000006,0x00000533,0x00000519,
+0x0003003e,0x00000532,0x00000533,0x0003003e,
+0x00000534,0x00000529,0x0003003e,0x00000535,
+0x0000009c,0x0004003d,0x00000011,0x00000537,
+0x00000514,0x0003003e,0x00000536,0x00000537,
+0x000c0039,0x00000006,0x00000538,0x00000042,
+0x0000052a,0x0000052c,0x0000052e,0x00000530,
+0x00000532,0x00000534,0x00000535,0x00000536,
+0x00050041,0x00000007,0x00000539,0x00000524,
+0x0000009c,0x0003003e,0x00000539,0x00000538,
+0x0004003d,0x000000ac,0x0000053a,0x000000db,
+0x000300f7,0x0000053c,0x00000000,0x000400fa,
+0x0000053a,0x0000053b,0x0000053c,0x000200f8,
+0x0000053b,0x0004003d,0x0000000f,0x0000053e,
+0x00000045,0x0003003e,0x0000053d,0x0000053e,
+0x0004003d,0x00000008,0x00000540,0x0000014c,
+0x0003003e,0x0000053f,0x00000540,0x0004003d,
+0x00000006,0x00000542,0x00000166,0x0003003e,
+0x00000541,0x00000542,0x0004003d,0x00000006,
+0x00000544,0x0000051c,0x0003003e,0x00000543,
+0x00000544,0x0004003d,0x00000006,0x00000546,
+0x00000519,0x0003003e,0x00000545,0x00000546,
+0x0003003e,0x00000547,0x00000091,0x0003003e,
+0x00000548,0x0000009f,0x0004003d,0x00000011,
+0x0000054a,0x00000514,0x0003003e,0x00000549,
+0x0000054a,0x000c0039,0x00000006,0x0000054b,
+0x00000042,0x0000053d,0x0000053f,0x00000541,
+0x00000543,0x00000545,0x00000547,0x00000548,
+0x00000549,0x00050041,0x00000007,0x0000054c,
+0x00000524,0x0000009f,0x0003003e,0x0000054c,
+0x0000054b,0x000200f9,0x0000053c,0x000200f8,
+0x0000053c,0x0004003d,0x00000011,0x0000054d,
+0x00000524,0x000200fe,0x0000054d,0x00010038,
+0x00050036,0x00000006,0x0000004b,0x00000000,
+0x00000049,0x00030037,0x00000007,0x0000004a,
+0x000200f8,0x0000004c,0x0004003d,0x00000006,
+0x00000550,0x0000004a,0x000500c2,0x00000006,
+0x00000552,0x00000550,0x00000551,0x0004003d,
+0x00000006,0x00000553,0x0000004a,0x000500c6,
+0x00000006,0x00000554,0x00000553,0x00000552,
+0x0003003e,0x0000004a,0x00000554,0x0004003d,
+0x00000006,0x00000555,0x0000004a,0x000500c4,
+0x00000006,0x00000557,0x00000555,0x00000556,
+0x0004003d,0x00000006,0x00000558,0x0000004a,
+0x00050082,0x00000006,0x00000559,0x00000558,
+0x00000557,0x0003003e,0x0000004a,0x00000559,
+0x0004003d,0x00000006,0x0000055a,0x0000004a,
+0x000500c4,0x00000006,0x0000055b,0x0000055a,
+0x000000d4,0x0004003d,0x00000006,0x0000055c,
+0x0000004a,0x00050080,0x00000006,0x0000055d,
+0x0000055c,0x0000055b,0x0003003e,0x0000004a,
+0x0000055d,0x0004003d,0x00000006,0x0000055e,
+0x0000004a,0x000500c4,0x00000006,0x0000055f,
+0x0000055e,0x000000c9,0x0004003d,0x00000006,
+0x00000560,0x0000004a,0x00050080,0x00000006,
+0x00000561,0x00000560,0x0000055f,0x0003003e,
+0x0000004a,0x00000561,0x0004003d,0x00000006,
+0x00000562,0x0000004a,0x000500c2,0x00000006,
+0x00000563,0x00000562,0x000000cf,0x0004003d,
+0x00000006,0x00000564,0x0000004a,0x000500c6,
+0x00000006,0x00000565,0x00000564,0x00000563,
+0x0003003e,0x0000004a,0x00000565,0x0004003d,
+0x00000006,0x00000566,0x0000004a,0x000500c4,
+0x00000006,0x00000568,0x00000566,0x00000567,
+0x0004003d,0x00000006,0x00000569,0x0000004a,
+0x00050080,0x00000006,0x0000056a,0x00000569,
+0x00000568,0x0003003e,0x0000004a,0x0000056a,
+0x0004003d,0x00000006,0x0000056b,0x0000004a,
+0x000500c2,0x00000006,0x0000056c,0x0000056b,
+0x000000d4,0x0004003d,0x00000006,0x0000056d,
+0x0000004a,0x000500c6,0x00000006,0x0000056e,
+0x0000056d,0x0000056c,0x0003003e,0x0000004a,
+0x0000056e,0x0004003d,0x00000006,0x0000056f,
+0x0000004a,0x000500c2,0x00000006,0x00000570,
+0x0000056f,0x0000015e,0x0004003d,0x00000006,
+0x00000571,0x0000004a,0x000500c6,0x00000006,
+0x00000572,0x00000571,0x00000570,0x0003003e,
+0x0000004a,0x00000572,0x0004003d,0x00000006,
+0x00000573,0x0000004a,0x000500c4,0x00000006,
+0x00000574,0x00000573,0x0000050c,0x0004003d,
+0x00000006,0x00000575,0x0000004a,0x000500c6,
+0x00000006,0x00000576,0x00000575,0x00000574,
+0x0003003e,0x0000004a,0x00000576,0x0004003d,
+0x00000006,0x00000577,0x0000004a,0x000500c2,
+0x00000006,0x00000578,0x00000577,0x00000556,
+0x0004003d,0x00000006,0x00000579,0x0000004a,
+0x000500c6,0x00000006,0x0000057a,0x00000579,
+0x00000578,0x0003003e,0x0000004a,0x0000057a,
+0x0004003d,0x00000006,0x0000057b,0x0000004a,
+0x000200fe,0x0000057b,0x00010038,0x00050036,
+0x00000006,0x00000051,0x00000000,0x0000004d,
+0x00030037,0x00000007,0x0000004e,0x00030037,
+0x00000012,0x0000004f,0x00030037,0x00000007,
+0x00000050,0x000200f8,0x00000052,0x0004003b,
+0x00000007,0x00000593,0x00000007,0x0004003b,
+0x00000007,0x00000594,0x00000007,0x0004003b,
+0x00000010,0x00000597,0x00000007,0x0004003b,
+0x00000010,0x000005a3,0x00000007,0x0004003b,
+0x00000012,0x000005b6,0x00000007,0x0004003b,
+0x00000010,0x000005c1,0x00000007,0x0004003b,
+0x00000010,0x000005c5,0x00000007,0x0004003b,
+0x00000010,0x000005d4,0x00000007,0x0004003d,
+0x00000006,0x0000057e,0x00000050,0x000500aa,
+0x000000ac,0x0000057f,0x0000057e,0x0000009f,
+0x000300f7,0x00000581,0x00000000,0x000400fa,
+0x0000057f,0x00000580,0x00000581,0x000200f8,
+0x00000580,0x000200fe,0x0000009c,0x000200f8,
+0x00000581,0x00050041,0x000000b1,0x00000583,
+0x000000aa,0x0000009c,0x0004003d,0x00000006,
+0x00000584,0x00000583,0x00050041,0x000000b1,
+0x00000585,0x000000aa,0x0000009f,0x0004003d,
+0x00000006,0x00000586,0x00000585,0x00050084,
+0x00000006,0x00000587,0x00000584,0x00000586,
+0x000500b0,0x000000ac,0x00000588,0x00000587,
+0x000001ac,0x000300f7,0x0000058a,0x00000000,
+0x000400fa,0x00000588,0x00000589,0x0000058a,
+0x000200f8,0x00000589,0x0004003d,0x00000011,
+0x0000058b,0x0000004f,0x00050050,0x0000050d,
+0x0000058c,0x000000ca,0x000000ca,0x000500c4,
+0x00000011,0x0000058d,0x0000058b,0x0000058c,
+0x0003003e,0x0000004f,0x0000058d,0x000200f9,
+0x0000058a,0x000200f8,0x0000058a,0x0004003d,
+0x00000006,0x0000058e,0x00000050,0x00050084,
+0x00000006,0x0000058f,0x000004f7,0x0000058e,
+0x0004003d,0x00000006,0x00000590,0x0000004e,
+0x00050082,0x00000006,0x00000591,0x00000590,
+0x000004f7,0x00050080,0x00000006,0x00000592,
+0x0000058f,0x00000591,0x0003003e,0x0000004e,
+0x00000592,0x0004003d,0x00000006,0x00000595,
+0x0000004e,0x0003003e,0x00000594,0x00000595,
+0x00050039,0x00000006,0x00000596,0x0000004b,
+0x00000594,0x0003003e,0x00000593,0x00000596,
+0x0004003d,0x00000006,0x00000598,0x00000593,
+0x000600cb,0x00000006,0x00000599,0x00000598,
+0x000000bf,0x000000c9,0x0004003d,0x00000006,
+0x0000059a,0x00000593,0x000600cb,0x00000006,
+0x0000059b,0x0000059a,0x000000c9,0x000000c9,
+0x0004003d,0x00000006,0x0000059c,0x00000593,
+0x000600cb,0x00000006,0x0000059e,0x0000059c,
+0x0000059d,0x000000c9,0x0004003d,0x00000006,
+0x0000059f,0x00000593,0x000600cb,0x00000006,
+0x000005a1,0x0000059f,0x000005a0,0x000000c9,
+0x00070050,0x0000000f,0x000005a2,0x00000599,
+0x0000059b,0x0000059e,0x000005a1,0x0003003e,
+0x00000597,0x000005a2,0x0004003d,0x00000006,
+0x000005a4,0x00000593,0x000600cb,0x00000006,
+0x000005a5,0x000005a4,0x00000567,0x000000c9,
+0x0004003d,0x00000006,0x000005a6,0x00000593,
+0x000600cb,0x00000006,0x000005a8,0x000005a6,
+0x000005a7,0x000000c9,0x0004003d,0x00000006,
+0x000005a9,0x00000593,0x000600cb,0x00000006,
+0x000005ab,0x000005a9,0x000005aa,0x000000c9,
+0x0004003d,0x00000006,0x000005ac,0x00000593,
+0x000600cb,0x00000006,0x000005ae,0x000005ac,
+0x000005ad,0x000000c9,0x00070050,0x0000000f,
+0x000005af,0x000005a5,0x000005a8,0x000005ab,
+0x000005ae,0x0003003e,0x000005a3,0x000005af,
+0x0004003d,0x0000000f,0x000005b0,0x00000597,
+0x0004003d,0x0000000f,0x000005b1,0x00000597,
+0x00050084,0x0000000f,0x000005b2,0x000005b0,
+0x000005b1,0x0003003e,0x00000597,0x000005b2,
+0x0004003d,0x0000000f,0x000005b3,0x000005a3,
+0x0004003d,0x0000000f,0x000005b4,0x000005a3,
+0x00050084,0x0000000f,0x000005b5,0x000005b3,
+0x000005b4,0x0003003e,0x000005a3,0x000005b5,
+0x0004003d,0x00000006,0x000005b7,0x0000004e,
+0x000500c7,0x00000006,0x000005b8,0x000005b7,
+0x00000091,0x000500ab,0x000000ac,0x000005b9,
+0x000005b8,0x0000009c,0x000600a9,0x00000059,
+0x000005ba,0x000005b9,0x000000c9,0x000000cf,
+0x0004007c,0x00000006,0x000005bb,0x000005ba,
+0x0004003d,0x00000006,0x000005bc,0x00000050,
+0x000500aa,0x000000ac,0x000005bd,0x000005bc,
+0x00000095,0x000600a9,0x00000059,0x000005be,
+0x000005bd,0x0000050c,0x000000cf,0x0004007c,
+0x00000006,0x000005bf,0x000005be,0x00050050,
+0x00000011,0x000005c0,0x000005bb,0x000005bf,
+0x0003003e,0x000005b6,0x000005c0,0x0004003d,
+0x00000006,0x000005c2,0x0000004e,0x000500c7,
+0x00000006,0x000005c3,0x000005c2,0x0000009f,
+0x000500ab,0x000000ac,0x000005c4,0x000005c3,
+0x0000009c,0x000300f7,0x000005c7,0x00000000,
+0x000400fa,0x000005c4,0x000005c6,0x000005ca,
+0x000200f8,0x000005c6,0x0004003d,0x00000011,
+0x000005c8,0x000005b6,0x0009004f,0x0000000f,
+0x000005c9,0x000005c8,0x000005c8,0x00000000,
+0x00000001,0x00000000,0x00000001,0x0003003e,
+0x000005c5,0x000005c9,0x000200f9,0x000005c7,
+0x000200f8,0x000005ca,0x0004003d,0x00000011,
+0x000005cb,0x000005b6,0x0009004f,0x0000000f,
+0x000005cc,0x000005cb,0x000005cb,0x00000001,
+0x00000000,0x00000001,0x00000000,0x0003003e,
+0x000005c5,0x000005cc,0x000200f9,0x000005c7,
+0x000200f8,0x000005c7,0x0004003d,0x0000000f,
+0x000005cd,0x000005c5,0x0003003e,0x000005c1,
+0x000005cd,0x0004003d,0x0000000f,0x000005ce,
+0x000005c1,0x0004003d,0x0000000f,0x000005cf,
+0x00000597,0x000500c2,0x0000000f,0x000005d0,
+0x000005cf,0x000005ce,0x0003003e,0x00000597,
+0x000005d0,0x0004003d,0x0000000f,0x000005d1,
+0x000005c1,0x0004003d,0x0000000f,0x000005d2,
+0x000005a3,0x000500c2,0x0000000f,0x000005d3,
+0x000005d2,0x000005d1,0x0003003e,0x000005a3,
+0x000005d3,0x0004003d,0x0000000f,0x000005d5,
+0x00000597,0x0007004f,0x00000011,0x000005d6,
+0x000005d5,0x000005d5,0x00000000,0x00000001,
+0x00040070,0x000005d7,0x000005d8,0x000005d6,
+0x0004003d,0x00000011,0x000005d9,0x0000004f,
+0x00040070,0x000005d7,0x000005da,0x000005d9,
+0x00050094,0x000004ea,0x000005db,0x000005d8,
+0x000005da,0x0004006d,0x00000006,0x000005dc,
+0x000005db,0x0004003d,0x0000000f,0x000005dd,
+0x00000597,0x0007004f,0x00000011,0x000005de,
+0x000005dd,0x000005dd,0x00000002,0x00000003,
+0x00040070,0x000005d7,0x000005df,0x000005de,
+0x0004003d,0x00000011,0x000005e0,0x0000004f,
+0x00040070,0x000005d7,0x000005e1,0x000005e0,
+0x00050094,0x000004ea,0x000005e2,0x000005df,
+0x000005e1,0x0004006d,0x00000006,0x000005e3,
+0x000005e2,0x0004003d,0x0000000f,0x000005e4,
+0x000005a3,0x0007004f,0x00000011,0x000005e5,
+0x000005e4,0x000005e4,0x00000000,0x00000001,
+0x00040070,0x000005d7,0x000005e6,0x000005e5,
+0x0004003d,0x00000011,0x000005e7,0x0000004f,
+0x00040070,0x000005d7,0x000005e8,0x000005e7,
+0x00050094,0x000004ea,0x000005e9,0x000005e6,
+0x000005e8,0x0004006d,0x00000006,0x000005ea,
+0x000005e9,0x0004003d,0x0000000f,0x000005eb,
+0x000005a3,0x0007004f,0x00000011,0x000005ec,
+0x000005eb,0x000005eb,0x00000002,0x00000003,
+0x00040070,0x000005d7,0x000005ed,0x000005ec,
+0x0004003d,0x00000011,0x000005ee,0x0000004f,
+0x00040070,0x000005d7,0x000005ef,0x000005ee,
+0x00050094,0x000004ea,0x000005f0,0x000005ed,
+0x000005ef,0x0004006d,0x00000006,0x000005f1,
+0x000005f0,0x00070050,0x0000000f,0x000005f2,
+0x000005dc,0x000005e3,0x000005ea,0x000005f1,
+0x0004003d,0x00000006,0x000005f3,0x00000593,
+0x00070050,0x0000000f,0x000005f4,0x000005f3,
+0x000005f3,0x000005f3,0x000005f3,0x000500c2,
+0x0000000f,0x000005f6,0x000005f4,0x000005f5,
+0x00050080,0x0000000f,0x000005f7,0x000005f2,
+0x000005f6,0x0003003e,0x000005d4,0x000005f7,
+0x0004003d,0x0000000f,0x000005f9,0x000005d4,
+0x000500c7,0x0000000f,0x000005fa,0x000005f9,
+0x000005f8,0x0003003e,0x000005d4,0x000005fa,
+0x0004003d,0x00000006,0x000005fb,0x00000050,
+0x000500aa,0x000000ac,0x000005fc,0x000005fb,
+0x00000091,0x000300f7,0x000005fe,0x00000000,
+0x000400fa,0x000005fc,0x000005fd,0x00000603,
+0x000200f8,0x000005fd,0x00050041,0x00000007,
+0x000005ff,0x000005d4,0x00000091,0x00050051,
+0x00000006,0x00000600,0x00000525,0x00000000,
+0x0003003e,0x000005ff,0x00000600,0x00050041,
+0x00000007,0x00000601,0x000005d4,0x00000095,
+0x00050051,0x00000006,0x00000602,0x00000525,
+0x00000001,0x0003003e,0x00000601,0x00000602,
+0x000200f9,0x000005fe,0x000200f8,0x00000603,
+0x0004003d,0x00000006,0x00000604,0x00000050,
+0x000500aa,0x000000ac,0x00000605,0x00000604,
+0x00000095,0x000300f7,0x00000607,0x00000000,
+0x000400fa,0x00000605,0x00000606,0x00000607,
+0x000200f8,0x00000606,0x00050041,0x00000007,
+0x00000608,0x000005d4,0x00000095,0x0003003e,
+0x00000608,0x0000009c,0x000200f9,0x00000607,
+0x000200f8,0x00000607,0x000200f9,0x000005fe,
+0x000200f8,0x000005fe,0x00050041,0x00000007,
+0x00000609,0x000005d4,0x0000009c,0x0004003d,
+0x00000006,0x0000060a,0x00000609,0x00060050,
+0x00000008,0x0000060b,0x0000060a,0x0000060a,
+0x0000060a,0x0004003d,0x0000000f,0x0000060c,
+0x000005d4,0x0008004f,0x00000008,0x0000060d,
+0x0000060c,0x0000060c,0x00000001,0x00000002,
+0x00000003,0x000500ae,0x0000060e,0x0000060f,
+0x0000060b,0x0000060d,0x0004009b,0x000000ac,
+0x00000610,0x0000060f,0x000300f7,0x00000612,
+0x00000000,0x000400fa,0x00000610,0x00000611,
+0x00000614,0x000200f8,0x00000611,0x000200fe,
+0x0000009c,0x000200f8,0x00000614,0x00050041,
+0x00000007,0x00000615,0x000005d4,0x0000009f,
+0x0004003d,0x00000006,0x00000616,0x00000615,
+0x00050050,0x00000011,0x00000617,0x00000616,
+0x00000616,0x0004003d,0x0000000f,0x00000618,
+0x000005d4,0x0007004f,0x00000011,0x00000619,
+0x00000618,0x00000618,0x00000002,0x00000003,
+0x000500ae,0x00000145,0x0000061a,0x00000617,
+0x00000619,0x0004009b,0x000000ac,0x0000061b,
+0x0000061a,0x000300f7,0x0000061d,0x00000000,
+0x000400fa,0x0000061b,0x0000061c,0x0000061f,
+0x000200f8,0x0000061c,0x000200fe,0x0000009f,
+0x000200f8,0x0000061f,0x00050041,0x00000007,
+0x00000620,0x000005d4,0x00000091,0x0004003d,
+0x00000006,0x00000621,0x00000620,0x00050041,
+0x00000007,0x00000622,0x000005d4,0x00000095,
+0x0004003d,0x00000006,0x00000623,0x00000622,
+0x000500ae,0x000000ac,0x00000624,0x00000621,
+0x00000623,0x000300f7,0x00000626,0x00000000,
+0x000400fa,0x00000624,0x00000625,0x00000628,
+0x000200f8,0x00000625,0x000200fe,0x00000091,
+0x000200f8,0x00000628,0x000200fe,0x00000095,
+0x000200f8,0x00000626,0x000100ff,0x000200f8,
+0x0000061d,0x000100ff,0x000200f8,0x00000612,
+0x000100ff,0x00010038,0x00050036,0x00000008,
+0x00000057,0x00000000,0x00000053,0x00030037,
+0x00000007,0x00000054,0x00030037,0x00000007,
+0x00000055,0x00030037,0x00000007,0x00000056,
+0x000200f8,0x00000058,0x0004003b,0x00000007,
+0x0000062b,0x00000007,0x0004003b,0x00000009,
+0x00000633,0x00000007,0x0004003b,0x00000640,
+0x00000641,0x00000007,0x0004003b,0x00000007,
+0x00000644,0x00000007,0x0004003b,0x00000009,
+0x00000646,0x00000007,0x0003003e,0x0000062b,
+0x0000009c,0x000200f9,0x0000062c,0x000200f8,
+0x0000062c,0x000400f6,0x0000062e,0x0000062f,
+0x00000000,0x000200f9,0x00000630,0x000200f8,
+0x00000630,0x0004003d,0x00000006,0x00000631,
+0x0000062b,0x000500b0,0x000000ac,0x00000632,
+0x00000631,0x000003bc,0x000400fa,0x00000632,
+0x0000062d,0x0000062e,0x000200f8,0x0000062d,
+0x0004003d,0x00000006,0x0000063f,0x0000062b,
+0x0003003e,0x00000641,0x0000063e,0x00050041,
+0x00000009,0x00000642,0x00000641,0x0000063f,
+0x0004003d,0x00000008,0x00000643,0x00000642,
+0x0003003e,0x00000633,0x00000643,0x0004003d,
+0x00000006,0x00000645,0x00000055,0x0003003e,
+0x00000644,0x00000645,0x0004003d,0x00000008,
+0x00000647,0x00000633,0x0003003e,0x00000646,
+0x00000647,0x00060039,0x00000006,0x00000648,
+0x0000000d,0x00000644,0x00000646,0x0003003e,
+0x00000056,0x00000648,0x0004003d,0x00000006,
+0x00000649,0x00000056,0x0004003d,0x00000006,
+0x0000064a,0x00000054,0x000500b2,0x000000ac,
+0x0000064b,0x00000649,0x0000064a,0x000300f7,
+0x0000064d,0x00000000,0x000400fa,0x0000064b,
+0x0000064c,0x0000064d,0x000200f8,0x0000064c,
+0x0004003d,0x00000008,0x0000064e,0x00000633,
+0x000200fe,0x0000064e,0x000200f8,0x0000064d,
+0x000200f9,0x0000062f,0x000200f8,0x0000062f,
+0x0004003d,0x00000006,0x00000650,0x0000062b,
+0x00050080,0x00000006,0x00000651,0x00000650,
+0x000000ca,0x0003003e,0x0000062b,0x00000651,
+0x000200f9,0x0000062c,0x000200f8,0x0000062e,
+0x000200fe,0x0000014f,0x00010038,0x00050036,
+0x0000005a,0x0000005e,0x00000000,0x0000005c,
+0x00030037,0x0000005b,0x0000005d,0x000200f8,
+0x0000005f,0x00050041,0x0000024c,0x00000654,
+0x0000005d,0x0000009c,0x0004003d,0x00000059,
+0x00000655,0x00000654,0x00050041,0x0000024c,
+0x00000656,0x0000005d,0x00000091,0x0004003d,
+0x00000059,0x00000657,0x00000656,0x00050080,
+0x00000059,0x00000658,0x00000655,0x00000657,
+0x000500c3,0x00000059,0x00000659,0x00000658,
+0x000000ca,0x00050041,0x0000024c,0x0000065a,
+0x0000005d,0x0000009f,0x0004003d,0x00000059,
+0x0000065b,0x0000065a,0x00050041,0x0000024c,
+0x0000065c,0x0000005d,0x00000091,0x0004003d,
+0x00000059,0x0000065d,0x0000065c,0x00050080,
+0x00000059,0x0000065e,0x0000065b,0x0000065d,
+0x000500c3,0x00000059,0x0000065f,0x0000065e,
+0x000000ca,0x0004003d,0x0000005a,0x00000660,
+0x0000005d,0x0007004f,0x0000050d,0x00000661,
+0x00000660,0x00000660,0x00000002,0x00000003,
+0x00050051,0x00000059,0x00000662,0x00000661,
+0x00000000,0x00050051,0x00000059,0x00000663,
+0x00000661,0x00000001,0x00070050,0x0000005a,
+0x00000664,0x00000659,0x0000065f,0x00000662,
+0x00000663,0x000200fe,0x00000664,0x00010038,
+0x00050036,0x00000059,0x00000064,0x00000000,
+0x00000062,0x00030037,0x00000061,0x00000063,
+0x000200f8,0x00000065,0x00050041,0x0000024c,
+0x00000667,0x00000063,0x0000009c,0x0004003d,
+0x00000059,0x00000668,0x00000667,0x00050041,
+0x0000024c,0x00000669,0x00000063,0x0000009f,
+0x0004003d,0x00000059,0x0000066a,0x00000669,
+0x00050080,0x00000059,0x0000066b,0x00000668,
+0x0000066a,0x00050041,0x0000024c,0x0000066c,
+0x00000063,0x00000091,0x0004003d,0x00000059,
+0x0000066d,0x0000066c,0x00050080,0x00000059,
+0x0000066e,0x0000066b,0x0000066d,0x000200fe,
+0x0000066e,0x00010038,0x00050036,0x00000002,
+0x00000069,0x00000000,0x00000066,0x00030037,
+0x0000005b,0x00000067,0x00030037,0x0000005b,
+0x00000068,0x000200f8,0x0000006a,0x0004003d,
+0x0000005a,0x00000671,0x00000068,0x00070050,
+0x0000005a,0x00000672,0x000000ca,0x000000ca,
+0x000000ca,0x000000ca,0x000500c3,0x0000005a,
+0x00000673,0x00000671,0x00000672,0x0003003e,
+0x00000068,0x00000673,0x0004003d,0x0000005a,
+0x00000674,0x00000067,0x00070050,0x0000005a,
+0x00000676,0x00000675,0x00000675,0x00000675,
+0x00000675,0x000500c7,0x0000005a,0x00000677,
+0x00000674,0x00000676,0x0004003d,0x0000005a,
+0x00000678,0x00000068,0x000500c5,0x0000005a,
+0x00000679,0x00000678,0x00000677,0x0003003e,
+0x00000068,0x00000679,0x0004003d,0x0000005a,
+0x0000067a,0x00000067,0x00070050,0x0000005a,
+0x0000067b,0x000000ca,0x000000ca,0x000000ca,
+0x000000ca,0x000500c3,0x0000005a,0x0000067c,
+0x0000067a,0x0000067b,0x0003003e,0x00000067,
+0x0000067c,0x0004003d,0x0000005a,0x0000067e,
+0x00000067,0x00070050,0x0000005a,0x0000067f,
+0x0000067d,0x0000067d,0x0000067d,0x0000067d,
+0x000500c7,0x0000005a,0x00000680,0x0000067e,
+0x0000067f,0x0003003e,0x00000067,0x00000680,
+0x0004003d,0x0000005a,0x00000681,0x00000067,
+0x000600ca,0x0000005a,0x00000682,0x00000681,
+0x000000bf,0x0000050c,0x0003003e,0x00000067,
+0x00000682,0x000100fd,0x00010038,0x00050036,
+0x00000002,0x00000071,0x00000000,0x0000006b,
+0x00030037,0x0000005b,0x0000006c,0x00030037,
+0x0000005b,0x0000006d,0x00030037,0x00000007,
+0x0000006e,0x00030037,0x00000010,0x0000006f,
+0x00030037,0x00000010,0x00000070,0x000200f8,
+0x00000072,0x0004003b,0x0000024c,0x000006a0,
+0x00000007,0x0004003b,0x0000024c,0x000006a9,
+0x00000007,0x0004003b,0x0000005b,0x000006c7,
+0x00000007,0x0004003b,0x0000005b,0x000006c9,
+0x00000007,0x0004003b,0x00000061,0x00000716,
+0x00000007,0x0004003b,0x00000061,0x0000071a,
+0x00000007,0x0004003b,0x0000005b,0x00000726,
+0x00000007,0x0004003b,0x0000005b,0x0000072a,
+0x00000007,0x0004003b,0x0000005b,0x00000732,
+0x00000007,0x0004003b,0x0000005b,0x00000734,
+0x00000007,0x0004003b,0x00000061,0x00000739,
+0x00000007,0x0004003b,0x0000005b,0x00000750,
+0x00000007,0x0004003b,0x0000005b,0x00000756,
+0x00000007,0x0004003d,0x00000006,0x00000683,
+0x0000006e,0x000300f7,0x0000068f,0x00000000,
+0x001700fb,0x00000683,0x0000068e,0x00000000,
+0x00000684,0x00000001,0x00000685,0x00000004,
+0x00000686,0x00000005,0x00000687,0x00000006,
+0x00000688,0x0000000a,0x00000689,0x00000008,
+0x0000068a,0x0000000c,0x0000068b,0x00000009,
+0x0000068c,0x0000000d,0x0000068d,0x000200f8,
+0x0000068e,0x0003003e,0x0000006f,0x0000075e,
+0x0003003e,0x00000070,0x0000075e,0x000200f9,
+0x0000068f,0x000200f8,0x00000684,0x0004003d,
+0x0000005a,0x00000690,0x0000006c,0x0008004f,
+0x00000060,0x00000691,0x00000690,0x00000690,
+0x00000000,0x00000000,0x00000000,0x0004007c,
+0x00000008,0x00000692,0x00000691,0x00050051,
+0x00000006,0x00000694,0x00000692,0x00000000,
+0x00050051,0x00000006,0x00000695,0x00000692,
+0x00000001,0x00050051,0x00000006,0x00000696,
+0x00000692,0x00000002,0x00070050,0x0000000f,
+0x00000697,0x00000694,0x00000695,0x00000696,
+0x00000693,0x0003003e,0x0000006f,0x00000697,
+0x0004003d,0x0000005a,0x00000698,0x0000006d,
+0x0008004f,0x00000060,0x00000699,0x00000698,
+0x00000698,0x00000000,0x00000000,0x00000000,
+0x0004007c,0x00000008,0x0000069a,0x00000699,
+0x00050051,0x00000006,0x0000069b,0x0000069a,
+0x00000000,0x00050051,0x00000006,0x0000069c,
+0x0000069a,0x00000001,0x00050051,0x00000006,
+0x0000069d,0x0000069a,0x00000002,0x00070050,
+0x0000000f,0x0000069e,0x0000069b,0x0000069c,
+0x0000069d,0x00000693,0x0003003e,0x00000070,
+0x0000069e,0x000100fd,0x000200f8,0x00000685,
+0x00050041,0x0000024c,0x000006a1,0x0000006c,
+0x0000009c,0x0004003d,0x00000059,0x000006a2,
+0x000006a1,0x000500c3,0x00000059,0x000006a3,
+0x000006a2,0x000000c0,0x00050041,0x0000024c,
+0x000006a4,0x0000006d,0x0000009c,0x0004003d,
+0x00000059,0x000006a5,0x000006a4,0x000500c7,
+0x00000059,0x000006a7,0x000006a5,0x000006a6,
+0x000500c5,0x00000059,0x000006a8,0x000006a3,
+0x000006a7,0x0003003e,0x000006a0,0x000006a8,
+0x0004003d,0x00000059,0x000006aa,0x000006a0,
+0x00050041,0x0000024c,0x000006ab,0x0000006d,
+0x0000009c,0x0004003d,0x00000059,0x000006ac,
+0x000006ab,0x000500c7,0x00000059,0x000006ad,
+0x000006ac,0x0000067d,0x00050080,0x00000059,
+0x000006ae,0x000006aa,0x000006ad,0x0007000c,
+0x00000059,0x000006b0,0x00000001,0x00000027,
+0x000006ae,0x000006af,0x0003003e,0x000006a9,
+0x000006b0,0x0004003d,0x00000059,0x000006b1,
+0x000006a0,0x0004007c,0x00000006,0x000006b2,
+0x000006b1,0x00060050,0x00000008,0x000006b3,
+0x000006b2,0x000006b2,0x000006b2,0x00050051,
+0x00000006,0x000006b4,0x000006b3,0x00000000,
+0x00050051,0x00000006,0x000006b5,0x000006b3,
+0x00000001,0x00050051,0x00000006,0x000006b6,
+0x000006b3,0x00000002,0x00070050,0x0000000f,
+0x000006b7,0x000006b4,0x000006b5,0x000006b6,
+0x00000693,0x0003003e,0x0000006f,0x000006b7,
+0x0004003d,0x00000059,0x000006b8,0x000006a9,
+0x0004007c,0x00000006,0x000006b9,0x000006b8,
+0x00060050,0x00000008,0x000006ba,0x000006b9,
+0x000006b9,0x000006b9,0x00050051,0x00000006,
+0x000006bb,0x000006ba,0x00000000,0x00050051,
+0x00000006,0x000006bc,0x000006ba,0x00000001,
+0x00050051,0x00000006,0x000006bd,0x000006ba,
+0x00000002,0x00070050,0x0000000f,0x000006be,
+0x000006bb,0x000006bc,0x000006bd,0x00000693,
+0x0003003e,0x00000070,0x000006be,0x000100fd,
+0x000200f8,0x00000686,0x0004003d,0x0000005a,
+0x000006c0,0x0000006c,0x0009004f,0x0000005a,
+0x000006c1,0x000006c0,0x000006c0,0x00000000,
+0x00000000,0x00000000,0x00000001,0x0004007c,
+0x0000000f,0x000006c2,0x000006c1,0x0003003e,
+0x0000006f,0x000006c2,0x0004003d,0x0000005a,
+0x000006c3,0x0000006d,0x0009004f,0x0000005a,
+0x000006c4,0x000006c3,0x000006c3,0x00000000,
+0x00000000,0x00000000,0x00000001,0x0004007c,
+0x0000000f,0x000006c5,0x000006c4,0x0003003e,
+0x00000070,0x000006c5,0x000100fd,0x000200f8,
+0x00000687,0x0004003d,0x0000005a,0x000006c8,
+0x0000006d,0x0003003e,0x000006c7,0x000006c8,
+0x0004003d,0x0000005a,0x000006ca,0x0000006c,
+0x0003003e,0x000006c9,0x000006ca,0x00060039,
+0x00000002,0x000006cb,0x00000069,0x000006c7,
+0x000006c9,0x0004003d,0x0000005a,0x000006cc,
+0x000006c7,0x0003003e,0x0000006d,0x000006cc,
+0x0004003d,0x0000005a,0x000006cd,0x000006c9,
+0x0003003e,0x0000006c,0x000006cd,0x0004003d,
+0x0000005a,0x000006ce,0x0000006c,0x0009004f,
+0x0000005a,0x000006cf,0x000006ce,0x000006ce,
+0x00000000,0x00000000,0x00000000,0x00000001,
+0x00070050,0x0000005a,0x000006d0,0x000000bf,
+0x000000bf,0x000000bf,0x000000bf,0x00070050,
+0x0000005a,0x000006d1,0x000006af,0x000006af,
+0x000006af,0x000006af,0x0008000c,0x0000005a,
+0x000006d2,0x00000001,0x0000002d,0x000006cf,
+0x000006d0,0x000006d1,0x0004007c,0x0000000f,
+0x000006d3,0x000006d2,0x0003003e,0x0000006f,
+0x000006d3,0x0004003d,0x0000005a,0x000006d4,
+0x0000006c,0x0009004f,0x0000005a,0x000006d5,
+0x000006d4,0x000006d4,0x00000000,0x00000000,
+0x00000000,0x00000001,0x0004003d,0x0000005a,
+0x000006d6,0x0000006d,0x0009004f,0x0000005a,
+0x000006d7,0x000006d6,0x000006d6,0x00000000,
+0x00000000,0x00000000,0x00000001,0x00050080,
+0x0000005a,0x000006d8,0x000006d5,0x000006d7,
+0x00070050,0x0000005a,0x000006d9,0x000000bf,
+0x000000bf,0x000000bf,0x000000bf,0x00070050,
+0x0000005a,0x000006da,0x000006af,0x000006af,
+0x000006af,0x000006af,0x0008000c,0x0000005a,
+0x000006db,0x00000001,0x0000002d,0x000006d8,
+0x000006d9,0x000006da,0x0004007c,0x0000000f,
+0x000006dc,0x000006db,0x0003003e,0x00000070,
+0x000006dc,0x000100fd,0x000200f8,0x00000688,
+0x00050041,0x0000024c,0x000006de,0x0000006c,
+0x0000009c,0x0004003d,0x00000059,0x000006df,
+0x000006de,0x0004007c,0x00000006,0x000006e0,
+0x000006df,0x00050041,0x0000024c,0x000006e1,
+0x0000006d,0x0000009c,0x0004003d,0x00000059,
+0x000006e2,0x000006e1,0x0004007c,0x00000006,
+0x000006e3,0x000006e2,0x00050041,0x0000024c,
+0x000006e4,0x0000006c,0x0000009f,0x0004003d,
+0x00000059,0x000006e5,0x000006e4,0x0004007c,
+0x00000006,0x000006e6,0x000006e5,0x00070050,
+0x0000000f,0x000006e7,0x000006e0,0x000006e3,
+0x000006e6,0x00000693,0x0003003e,0x00000070,
+0x000006e7,0x0004003d,0x0000000f,0x000006e8,
+0x00000070,0x0008004f,0x00000008,0x000006e9,
+0x000006e8,0x000006e8,0x00000000,0x00000001,
+0x00000002,0x00050041,0x0000024c,0x000006ea,
+0x0000006d,0x0000009f,0x0004003d,0x00000059,
+0x000006eb,0x000006ea,0x0004007c,0x00000006,
+0x000006ec,0x000006eb,0x00060050,0x00000008,
+0x000006ed,0x000006ec,0x000006ec,0x000006ec,
+0x00050084,0x00000008,0x000006ee,0x000006e9,
+0x000006ed,0x00060050,0x00000060,0x000006ef,
+0x0000059d,0x0000059d,0x0000059d,0x000500c2,
+0x00000008,0x000006f0,0x000006ee,0x000006ef,
+0x00050051,0x00000006,0x000006f1,0x000006f0,
+0x00000000,0x00050051,0x00000006,0x000006f2,
+0x000006f0,0x00000001,0x00050051,0x00000006,
+0x000006f3,0x000006f0,0x00000002,0x00070050,
+0x0000000f,0x000006f4,0x000006f1,0x000006f2,
+0x000006f3,0x00000693,0x0003003e,0x0000006f,
+0x000006f4,0x000100fd,0x000200f8,0x00000689,
+0x00050041,0x0000024c,0x000006f6,0x0000006c,
+0x0000009c,0x0004003d,0x00000059,0x000006f7,
+0x000006f6,0x0004007c,0x00000006,0x000006f8,
+0x000006f7,0x00050041,0x0000024c,0x000006f9,
+0x0000006d,0x0000009c,0x0004003d,0x00000059,
+0x000006fa,0x000006f9,0x0004007c,0x00000006,
+0x000006fb,0x000006fa,0x00050041,0x0000024c,
+0x000006fc,0x0000006c,0x0000009f,0x0004003d,
+0x00000059,0x000006fd,0x000006fc,0x0004007c,
+0x00000006,0x000006fe,0x000006fd,0x00050041,
+0x0000024c,0x000006ff,0x0000006d,0x00000091,
+0x0004003d,0x00000059,0x00000700,0x000006ff,
+0x0004007c,0x00000006,0x00000701,0x00000700,
+0x00070050,0x0000000f,0x00000702,0x000006f8,
+0x000006fb,0x000006fe,0x00000701,0x0003003e,
+0x00000070,0x00000702,0x0004003d,0x0000000f,
+0x00000703,0x00000070,0x0008004f,0x00000008,
+0x00000704,0x00000703,0x00000703,0x00000000,
+0x00000001,0x00000002,0x00050041,0x0000024c,
+0x00000705,0x0000006d,0x0000009f,0x0004003d,
+0x00000059,0x00000706,0x00000705,0x0004007c,
+0x00000006,0x00000707,0x00000706,0x00060050,
+0x00000008,0x00000708,0x00000707,0x00000707,
+0x00000707,0x00050084,0x00000008,0x00000709,
+0x00000704,0x00000708,0x00060050,0x00000060,
+0x0000070a,0x0000059d,0x0000059d,0x0000059d,
+0x000500c2,0x00000008,0x0000070b,0x00000709,
+0x0000070a,0x00050041,0x0000024c,0x0000070c,
+0x0000006c,0x00000091,0x0004003d,0x00000059,
+0x0000070d,0x0000070c,0x0004007c,0x00000006,
+0x0000070e,0x0000070d,0x00050051,0x00000006,
+0x0000070f,0x0000070b,0x00000000,0x00050051,
+0x00000006,0x00000710,0x0000070b,0x00000001,
+0x00050051,0x00000006,0x00000711,0x0000070b,
+0x00000002,0x00070050,0x0000000f,0x00000712,
+0x0000070f,0x00000710,0x00000711,0x0000070e,
+0x0003003e,0x0000006f,0x00000712,0x000100fd,
+0x000200f8,0x0000068a,0x00050041,0x0000024c,
+0x00000714,0x0000006c,0x00000095,0x0003003e,
+0x00000714,0x000006af,0x00050041,0x0000024c,
+0x00000715,0x0000006d,0x00000095,0x0003003e,
+0x00000715,0x000006af,0x000200f9,0x0000068b,
+0x000200f8,0x0000068b,0x0004003d,0x0000005a,
+0x00000717,0x0000006d,0x0008004f,0x00000060,
+0x00000718,0x00000717,0x00000717,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x00000716,
+0x00000718,0x00050039,0x00000059,0x00000719,
+0x00000064,0x00000716,0x0004003d,0x0000005a,
+0x0000071b,0x0000006c,0x0008004f,0x00000060,
+0x0000071c,0x0000071b,0x0000071b,0x00000000,
+0x00000001,0x00000002,0x0003003e,0x0000071a,
+0x0000071c,0x00050039,0x00000059,0x0000071d,
+0x00000064,0x0000071a,0x000500af,0x000000ac,
+0x0000071e,0x00000719,0x0000071d,0x000300f7,
+0x00000720,0x00000000,0x000400fa,0x0000071e,
+0x0000071f,0x00000725,0x000200f8,0x0000071f,
+0x0004003d,0x0000005a,0x00000721,0x0000006c,
+0x0004007c,0x0000000f,0x00000722,0x00000721,
+0x0003003e,0x0000006f,0x00000722,0x0004003d,
+0x0000005a,0x00000723,0x0000006d,0x0004007c,
+0x0000000f,0x00000724,0x00000723,0x0003003e,
+0x00000070,0x00000724,0x000200f9,0x00000720,
+0x000200f8,0x00000725,0x0004003d,0x0000005a,
+0x00000727,0x0000006d,0x0003003e,0x00000726,
+0x00000727,0x00050039,0x0000005a,0x00000728,
+0x0000005e,0x00000726,0x0004007c,0x0000000f,
+0x00000729,0x00000728,0x0003003e,0x0000006f,
+0x00000729,0x0004003d,0x0000005a,0x0000072b,
+0x0000006c,0x0003003e,0x0000072a,0x0000072b,
+0x00050039,0x0000005a,0x0000072c,0x0000005e,
+0x0000072a,0x0004007c,0x0000000f,0x0000072d,
+0x0000072c,0x0003003e,0x00000070,0x0000072d,
+0x000200f9,0x00000720,0x000200f8,0x00000720,
+0x000100fd,0x000200f8,0x0000068c,0x00050041,
+0x0000024c,0x0000072f,0x0000006c,0x00000095,
+0x0003003e,0x0000072f,0x000006af,0x00050041,
+0x0000024c,0x00000731,0x0000006d,0x00000095,
+0x0003003e,0x00000731,0x00000730,0x000200f9,
+0x0000068d,0x000200f8,0x0000068d,0x0004003d,
+0x0000005a,0x00000733,0x0000006d,0x0003003e,
+0x00000732,0x00000733,0x0004003d,0x0000005a,
+0x00000735,0x0000006c,0x0003003e,0x00000734,
+0x00000735,0x00060039,0x00000002,0x00000736,
+0x00000069,0x00000732,0x00000734,0x0004003d,
+0x0000005a,0x00000737,0x00000732,0x0003003e,
+0x0000006d,0x00000737,0x0004003d,0x0000005a,
+0x00000738,0x00000734,0x0003003e,0x0000006c,
+0x00000738,0x0004003d,0x0000005a,0x0000073a,
+0x0000006d,0x0008004f,0x00000060,0x0000073b,
+0x0000073a,0x0000073a,0x00000000,0x00000001,
+0x00000002,0x0003003e,0x00000739,0x0000073b,
+0x00050039,0x00000059,0x0000073c,0x00000064,
+0x00000739,0x000500af,0x000000ac,0x0000073d,
+0x0000073c,0x000000bf,0x000300f7,0x0000073f,
+0x00000000,0x000400fa,0x0000073d,0x0000073e,
+0x0000074c,0x000200f8,0x0000073e,0x0004003d,
+0x0000005a,0x00000740,0x0000006c,0x00070050,
+0x0000005a,0x00000741,0x000000bf,0x000000bf,
+0x000000bf,0x000000bf,0x00070050,0x0000005a,
+0x00000742,0x000006af,0x000006af,0x000006af,
+0x000006af,0x0008000c,0x0000005a,0x00000743,
+0x00000001,0x0000002d,0x00000740,0x00000741,
+0x00000742,0x0004007c,0x0000000f,0x00000744,
+0x00000743,0x0003003e,0x0000006f,0x00000744,
+0x0004003d,0x0000005a,0x00000745,0x0000006c,
+0x0004003d,0x0000005a,0x00000746,0x0000006d,
+0x00050080,0x0000005a,0x00000747,0x00000745,
+0x00000746,0x00070050,0x0000005a,0x00000748,
+0x000000bf,0x000000bf,0x000000bf,0x000000bf,
+0x00070050,0x0000005a,0x00000749,0x000006af,
+0x000006af,0x000006af,0x000006af,0x0008000c,
+0x0000005a,0x0000074a,0x00000001,0x0000002d,
+0x00000747,0x00000748,0x00000749,0x0004007c,
+0x0000000f,0x0000074b,0x0000074a,0x0003003e,
+0x00000070,0x0000074b,0x000200f9,0x0000073f,
+0x000200f8,0x0000074c,0x0004003d,0x0000005a,
+0x0000074d,0x0000006c,0x0004003d,0x0000005a,
+0x0000074e,0x0000006d,0x00050080,0x0000005a,
+0x0000074f,0x0000074d,0x0000074e,0x0003003e,
+0x00000750,0x0000074f,0x00050039,0x0000005a,
+0x00000751,0x0000005e,0x00000750,0x00070050,
+0x0000005a,0x00000752,0x000000bf,0x000000bf,
+0x000000bf,0x000000bf,0x00070050,0x0000005a,
+0x00000753,0x000006af,0x000006af,0x000006af,
+0x000006af,0x0008000c,0x0000005a,0x00000754,
+0x00000001,0x0000002d,0x00000751,0x00000752,
+0x00000753,0x0004007c,0x0000000f,0x00000755,
+0x00000754,0x0003003e,0x0000006f,0x00000755,
+0x0004003d,0x0000005a,0x00000757,0x0000006c,
+0x0003003e,0x00000756,0x00000757,0x00050039,
+0x0000005a,0x00000758,0x0000005e,0x00000756,
+0x00070050,0x0000005a,0x00000759,0x000000bf,
+0x000000bf,0x000000bf,0x000000bf,0x00070050,
+0x0000005a,0x0000075a,0x000006af,0x000006af,
+0x000006af,0x000006af,0x0008000c,0x0000005a,
+0x0000075b,0x00000001,0x0000002d,0x00000758,
+0x00000759,0x0000075a,0x0004007c,0x0000000f,
+0x0000075c,0x0000075b,0x0003003e,0x00000070,
+0x0000075c,0x000200f9,0x0000073f,0x000200f8,
+0x0000073f,0x000100fd,0x000200f8,0x0000068f,
+0x000100fd,0x00010038,0x00050036,0x00000006,
+0x00000078,0x00000000,0x00000073,0x00030037,
+0x00000010,0x00000074,0x00030037,0x00000007,
+0x00000075,0x00030037,0x00000007,0x00000076,
+0x00030037,0x00000009,0x00000077,0x000200f8,
+0x00000079,0x0004003b,0x00000007,0x00000760,
+0x00000007,0x0004003b,0x00000007,0x00000768,
+0x00000007,0x0004003b,0x00000007,0x00000771,
+0x00000007,0x0004003b,0x00000010,0x00000774,
+0x00000007,0x0004003b,0x00000007,0x00000776,
+0x00000007,0x0004003b,0x00000007,0x00000778,
+0x00000007,0x0004003b,0x00000007,0x0000077a,
+0x00000007,0x0004003b,0x000007e1,0x000007e2,
+0x00000007,0x0004003b,0x00000007,0x000007ec,
+0x00000007,0x0004003b,0x00000007,0x000007f5,
+0x00000007,0x0004003b,0x00000010,0x000007f8,
+0x00000007,0x0004003b,0x00000007,0x000007fa,
+0x00000007,0x0004003b,0x00000007,0x000007fc,
+0x00000007,0x0004003b,0x00000007,0x000007fe,
+0x00000007,0x0004003b,0x0000080f,0x00000810,
+0x00000007,0x0004003b,0x00000007,0x00000815,
+0x00000007,0x0004003b,0x00000007,0x0000081b,
+0x00000007,0x0004003b,0x00000010,0x0000081c,
+0x00000007,0x0004003b,0x00000007,0x0000081e,
+0x00000007,0x0004003b,0x00000007,0x00000820,
+0x00000007,0x0004003b,0x00000012,0x00000823,
+0x00000007,0x0004003b,0x0000082f,0x00000830,
+0x00000007,0x00050041,0x00000007,0x00000761,
+0x00000077,0x00000091,0x0004003d,0x00000006,
+0x00000762,0x00000761,0x0003003e,0x00000760,
+0x00000762,0x00050041,0x00000007,0x00000763,
+0x00000077,0x0000009c,0x0004003d,0x00000006,
+0x00000764,0x00000763,0x000500aa,0x000000ac,
+0x00000765,0x00000764,0x0000009f,0x000300f7,
+0x00000767,0x00000000,0x000400fa,0x00000765,
+0x00000766,0x000007e6,0x000200f8,0x00000766,
+0x0004003d,0x00000006,0x00000769,0x00000076,
+0x00050086,0x00000006,0x0000076a,0x00000769,
+0x00000094,0x0004003d,0x00000006,0x0000076b,
+0x00000760,0x00050084,0x00000006,0x0000076c,
+0x00000094,0x0000076b,0x00050080,0x00000006,
+0x0000076d,0x0000076c,0x0000008c,0x00050084,
+0x00000006,0x0000076e,0x0000076a,0x0000076d,
+0x0004003d,0x00000006,0x0000076f,0x00000075,
+0x00050080,0x00000006,0x00000770,0x0000076e,
+0x0000076f,0x0003003e,0x00000768,0x00000770,
+0x0004003d,0x00000006,0x00000772,0x00000076,
+0x00050089,0x00000006,0x00000773,0x00000772,
+0x00000094,0x0004003d,0x0000000f,0x00000775,
+0x00000074,0x0003003e,0x00000774,0x00000775,
+0x0004003d,0x00000006,0x00000777,0x00000768,
+0x0003003e,0x00000776,0x00000777,0x0004003d,
+0x00000006,0x00000779,0x00000760,0x0003003e,
+0x00000778,0x00000779,0x0003003e,0x0000077a,
+0x00000773,0x00080039,0x00000006,0x0000077b,
+0x0000002a,0x00000774,0x00000776,0x00000778,
+0x0000077a,0x0003003e,0x00000771,0x0000077b,
+0x0004003d,0x00000006,0x000007da,0x00000760,
+0x000500c4,0x00000059,0x000007db,0x000000ca,
+0x000007da,0x00050082,0x00000059,0x000007dc,
+0x000007db,0x000000ca,0x00050084,0x00000059,
+0x000007dd,0x0000015e,0x000007dc,0x0004007c,
+0x00000006,0x000007de,0x000007dd,0x0004003d,
+0x00000006,0x000007df,0x00000771,0x00050080,
+0x00000006,0x000007e0,0x000007de,0x000007df,
+0x0003003e,0x000007e2,0x000007d9,0x00050041,
+0x00000007,0x000007e3,0x000007e2,0x000007e0,
+0x0004003d,0x00000006,0x000007e4,0x000007e3,
+0x000200fe,0x000007e4,0x000200f8,0x000007e6,
+0x00050041,0x00000007,0x000007e7,0x00000077,
+0x0000009f,0x0004003d,0x00000006,0x000007e8,
+0x000007e7,0x000500aa,0x000000ac,0x000007e9,
+0x000007e8,0x0000009f,0x000300f7,0x000007eb,
+0x00000000,0x000400fa,0x000007e9,0x000007ea,
+0x00000814,0x000200f8,0x000007ea,0x0004003d,
+0x00000006,0x000007ed,0x00000076,0x00050086,
+0x00000006,0x000007ee,0x000007ed,0x00000095,
+0x0004003d,0x00000006,0x000007ef,0x00000760,
+0x00050084,0x00000006,0x000007f0,0x00000095,
+0x000007ef,0x00050080,0x00000006,0x000007f1,
+0x000007f0,0x0000008d,0x00050084,0x00000006,
+0x000007f2,0x000007ee,0x000007f1,0x0004003d,
+0x00000006,0x000007f3,0x00000075,0x00050080,
+0x00000006,0x000007f4,0x000007f2,0x000007f3,
+0x0003003e,0x000007ec,0x000007f4,0x0004003d,
+0x00000006,0x000007f6,0x00000076,0x00050089,
+0x00000006,0x000007f7,0x000007f6,0x00000095,
+0x0004003d,0x0000000f,0x000007f9,0x00000074,
+0x0003003e,0x000007f8,0x000007f9,0x0004003d,
+0x00000006,0x000007fb,0x000007ec,0x0003003e,
+0x000007fa,0x000007fb,0x0004003d,0x00000006,
+0x000007fd,0x00000760,0x0003003e,0x000007fc,
+0x000007fd,0x0003003e,0x000007fe,0x000007f7,
+0x00080039,0x00000006,0x000007ff,0x00000030,
+0x000007f8,0x000007fa,0x000007fc,0x000007fe,
+0x0003003e,0x000007f5,0x000007ff,0x0004003d,
+0x00000006,0x00000808,0x00000760,0x000500c4,
+0x00000059,0x00000809,0x000000ca,0x00000808,
+0x00050082,0x00000059,0x0000080a,0x00000809,
+0x000000ca,0x00050084,0x00000059,0x0000080b,
+0x000000cf,0x0000080a,0x0004007c,0x00000006,
+0x0000080c,0x0000080b,0x0004003d,0x00000006,
+0x0000080d,0x000007f5,0x00050080,0x00000006,
+0x0000080e,0x0000080c,0x0000080d,0x0003003e,
+0x00000810,0x00000807,0x00050041,0x00000007,
+0x00000811,0x00000810,0x0000080e,0x0004003d,
+0x00000006,0x00000812,0x00000811,0x000200fe,
+0x00000812,0x000200f8,0x00000814,0x0004003d,
+0x00000006,0x00000816,0x00000076,0x0004003d,
+0x00000006,0x00000817,0x00000760,0x00050084,
+0x00000006,0x00000818,0x00000816,0x00000817,
+0x0004003d,0x00000006,0x00000819,0x00000075,
+0x00050080,0x00000006,0x0000081a,0x00000818,
+0x00000819,0x0003003e,0x00000815,0x0000081a,
+0x0004003d,0x0000000f,0x0000081d,0x00000074,
+0x0003003e,0x0000081c,0x0000081d,0x0004003d,
+0x00000006,0x0000081f,0x00000815,0x0003003e,
+0x0000081e,0x0000081f,0x0004003d,0x00000006,
+0x00000821,0x00000760,0x0003003e,0x00000820,
+0x00000821,0x00070039,0x00000006,0x00000822,
+0x0000001c,0x0000081c,0x0000081e,0x00000820,
+0x0003003e,0x0000081b,0x00000822,0x0004003d,
+0x00000006,0x0000082d,0x00000760,0x00050082,
+0x00000006,0x0000082e,0x0000082d,0x0000009f,
+0x0003003e,0x00000830,0x0000082c,0x00050041,
+0x00000012,0x00000831,0x00000830,0x0000082e,
+0x0004003d,0x00000011,0x00000832,0x00000831,
+0x0003003e,0x00000823,0x00000832,0x0004003d,
+0x00000006,0x00000833,0x0000081b,0x00050041,
+0x00000007,0x00000834,0x00000823,0x0000009c,
+0x0004003d,0x00000006,0x00000835,0x00000834,
+0x00050084,0x00000006,0x00000836,0x00000833,
+0x00000835,0x0004003d,0x00000006,0x00000837,
+0x0000081b,0x00050041,0x00000007,0x00000838,
+0x00000823,0x0000009f,0x0004003d,0x00000006,
+0x00000839,0x00000838,0x000500c2,0x00000006,
+0x0000083a,0x00000837,0x00000839,0x000500c5,
+0x00000006,0x0000083b,0x00000836,0x0000083a,
+0x000200fe,0x0000083b,0x000200f8,0x000007eb,
+0x000100ff,0x000200f8,0x00000767,0x000100ff,
+0x00010038,0x00050036,0x0000000f,0x0000007c,
+0x00000000,0x0000007a,0x00030037,0x00000007,
+0x0000007b,0x000200f8,0x0000007d,0x0004003b,
+0x0000005b,0x0000083e,0x00000007,0x0004003b,
+0x00000010,0x00000847,0x00000007,0x0004003d,
+0x00000006,0x0000083f,0x0000007b,0x0004007c,
+0x00000059,0x00000840,0x0000083f,0x00070050,
+0x0000005a,0x00000845,0x00000840,0x00000840,
+0x00000840,0x00000840,0x00050082,0x0000005a,
+0x00000846,0x00000845,0x00000844,0x0003003e,
+0x0000083e,0x00000846,0x0004003d,0x0000005a,
+0x00000849,0x0000083e,0x0008000c,0x0000005a,
+0x0000084d,0x00000001,0x0000002d,0x00000849,
+0x0000084a,0x0000084c,0x000500c4,0x0000000f,
+0x0000084e,0x00000848,0x0000084d,0x00070050,
+0x0000000f,0x0000084f,0x0000009f,0x0000009f,
+0x0000009f,0x0000009f,0x00050082,0x0000000f,
+0x00000850,0x0000084e,0x0000084f,0x0003003e,
+0x00000847,0x00000850,0x0004003d,0x0000000f,
+0x00000851,0x00000847,0x0004003d,0x00000006,
+0x00000854,0x0000007b,0x00070050,0x0000000f,
+0x00000855,0x00000854,0x00000854,0x00000854,
+0x00000854,0x000500ae,0x00000857,0x00000858,
+0x00000855,0x00000856,0x000600a9,0x0000000f,
+0x00000859,0x00000858,0x00000853,0x00000851,
+0x000200fe,0x00000859,0x00010038,0x00050036,
+0x0000000f,0x00000080,0x00000000,0x0000007e,
+0x00030037,0x00000011,0x0000007f,0x000200f8,
+0x00000081,0x0004003b,0x00000010,0x00000872,
+0x00000007,0x0004003b,0x00000007,0x00000876,
+0x00000007,0x0004003b,0x00000012,0x0000087a,
+0x00000007,0x0004003b,0x00000010,0x0000087b,
+0x00000007,0x0004003b,0x00000007,0x0000087e,
+0x00000007,0x0004003b,0x00000007,0x0000087f,
+0x00000007,0x0004003b,0x00000012,0x00000881,
+0x00000007,0x0004003b,0x00000007,0x00000882,
+0x00000007,0x0004003b,0x00000007,0x00000885,
+0x00000007,0x0004003b,0x00000007,0x00000886,
+0x00000007,0x0004003b,0x00000007,0x00000887,
+0x00000007,0x0004003b,0x00000007,0x00000888,
+0x00000007,0x0004003b,0x00000007,0x00000889,
+0x00000007,0x0004003b,0x00000007,0x0000088b,
+0x00000007,0x0004003b,0x00000007,0x0000088c,
+0x00000007,0x0004003b,0x00000007,0x0000088d,
+0x00000007,0x0004003b,0x00000007,0x00000897,
+0x00000007,0x0004003b,0x00000007,0x0000089d,
+0x00000007,0x0004003b,0x00000007,0x000008a5,
+0x00000007,0x0004003b,0x00000009,0x000008a9,
+0x00000007,0x0004003b,0x00000007,0x000008aa,
+0x00000007,0x0004003b,0x00000007,0x000008ab,
+0x00000007,0x0004003b,0x00000007,0x000008ad,
+0x00000007,0x0004003b,0x00000007,0x000008af,
+0x00000007,0x0004003b,0x00000007,0x000008b2,
+0x00000007,0x0004003b,0x0000005b,0x000008b6,
+0x00000007,0x0004003b,0x0000005b,0x000008b7,
+0x00000007,0x0004003b,0x00000010,0x000008b8,
+0x00000007,0x0004003b,0x00000007,0x000008bd,
+0x00000007,0x0004003b,0x00000007,0x000008c0,
+0x00000007,0x0004003b,0x00000007,0x000008c9,
+0x00000007,0x0004003b,0x00000010,0x000008cf,
+0x00000007,0x0004003b,0x00000007,0x000008d1,
+0x00000007,0x0004003b,0x00000007,0x000008d3,
+0x00000007,0x0004003b,0x00000009,0x000008d5,
+0x00000007,0x0004003b,0x00000010,0x000008dd,
+0x00000007,0x0004003b,0x00000007,0x000008df,
+0x00000007,0x0004003b,0x00000007,0x000008e1,
+0x00000007,0x0004003b,0x00000009,0x000008e2,
+0x00000007,0x0004003b,0x00000010,0x000008e9,
+0x00000007,0x0004003b,0x00000010,0x000008ea,
+0x00000007,0x0004003b,0x0000005b,0x000008eb,
+0x00000007,0x0004003b,0x0000005b,0x000008ed,
+0x00000007,0x0004003b,0x00000007,0x000008ef,
+0x00000007,0x0004003b,0x00000010,0x000008f1,
+0x00000007,0x0004003b,0x00000010,0x000008f2,
+0x00000007,0x0004003b,0x00000010,0x000008f6,
+0x00000007,0x0004003b,0x00000007,0x000008fd,
+0x00000007,0x0004003b,0x00000010,0x000008fe,
+0x00000007,0x0004003b,0x00000007,0x00000900,
+0x00000007,0x0004003b,0x00000007,0x00000902,
+0x00000007,0x0004003d,0x000000ac,0x0000085c,
+0x000000ae,0x000300f7,0x0000085e,0x00000000,
+0x000400fa,0x0000085c,0x0000085d,0x0000085e,
+0x000200f8,0x0000085d,0x000200fe,0x0000085f,
+0x000200f8,0x0000085e,0x0004003d,0x000000ac,
+0x00000861,0x000000b0,0x000300f7,0x00000863,
+0x00000000,0x000400fa,0x00000861,0x00000862,
+0x00000863,0x000200f8,0x00000862,0x00050041,
+0x000000b1,0x00000864,0x000000a7,0x0000009f,
+0x0004003d,0x00000006,0x00000865,0x00000864,
+0x000600cb,0x00000006,0x00000866,0x00000865,
+0x0000059d,0x0000059d,0x00050041,0x000000b1,
+0x00000867,0x000000a7,0x0000009f,0x0004003d,
+0x00000006,0x00000868,0x00000867,0x000600cb,
+0x00000006,0x00000869,0x00000868,0x000005aa,
+0x0000059d,0x00050041,0x000000b1,0x0000086a,
+0x000000a7,0x0000009c,0x0004003d,0x00000006,
+0x0000086b,0x0000086a,0x000600cb,0x00000006,
+0x0000086c,0x0000086b,0x0000059d,0x0000059d,
+0x00050041,0x000000b1,0x0000086d,0x000000a7,
+0x0000009c,0x0004003d,0x00000006,0x0000086e,
+0x0000086d,0x000600cb,0x00000006,0x0000086f,
+0x0000086e,0x000005aa,0x0000059d,0x00070050,
+0x0000000f,0x00000870,0x00000866,0x00000869,
+0x0000086c,0x0000086f,0x000200fe,0x00000870,
+0x000200f8,0x00000863,0x0004003d,0x0000000f,
+0x00000873,0x000000a7,0x0009004f,0x0000000f,
+0x00000874,0x00000873,0x00000873,0x00000003,
+0x00000002,0x00000001,0x00000000,0x000400cc,
+0x0000000f,0x00000875,0x00000874,0x0004003d,
+0x00000006,0x00000877,0x0000016f,0x0003003e,
+0x00000876,0x00000877,0x00050039,0x0000000f,
+0x00000878,0x0000007c,0x00000876,0x000500c7,
+0x0000000f,0x00000879,0x00000875,0x00000878,
+0x0003003e,0x00000872,0x00000879,0x0004003d,
+0x0000000f,0x0000087c,0x00000872,0x0003003e,
+0x0000087b,0x0000087c,0x00060039,0x00000011,
+0x0000087d,0x00000047,0x0000087b,0x0000007f,
+0x0003003e,0x0000087a,0x0000087d,0x0004003d,
+0x00000006,0x00000880,0x0000018d,0x0003003e,
+0x0000087f,0x00000880,0x0003003e,0x00000881,
+0x0000007f,0x0004003d,0x00000006,0x00000883,
+0x00000183,0x0003003e,0x00000882,0x00000883,
+0x00070039,0x00000006,0x00000884,0x00000051,
+0x0000087f,0x00000881,0x00000882,0x0003003e,
+0x0000087e,0x00000884,0x0003003e,0x00000885,
+0x0000009c,0x0003003e,0x00000886,0x0000009c,
+0x0003003e,0x00000887,0x0000009c,0x0004003d,
+0x00000006,0x0000088a,0x0000087e,0x0003003e,
+0x00000889,0x0000088a,0x00080039,0x00000006,
+0x0000088e,0x00000023,0x00000889,0x0000088b,
+0x0000088c,0x0000088d,0x0004003d,0x00000006,
+0x0000088f,0x0000088b,0x0003003e,0x00000885,
+0x0000088f,0x0004003d,0x00000006,0x00000890,
+0x0000088c,0x0003003e,0x00000886,0x00000890,
+0x0004003d,0x00000006,0x00000891,0x0000088d,
+0x0003003e,0x00000887,0x00000891,0x0003003e,
+0x00000888,0x0000088e,0x0004003d,0x00000006,
+0x00000892,0x00000886,0x000500ac,0x000000ac,
+0x00000893,0x00000892,0x000002a0,0x000300f7,
+0x00000895,0x00000000,0x000400fa,0x00000893,
+0x00000894,0x00000895,0x000200f8,0x00000894,
+0x000200fe,0x0000085f,0x000200f8,0x00000895,
+0x0004003d,0x00000006,0x00000898,0x00000183,
+0x000500aa,0x000000ac,0x00000899,0x00000898,
+0x0000009f,0x000600a9,0x00000059,0x0000089b,
+0x00000899,0x00000556,0x0000089a,0x0004007c,
+0x00000006,0x0000089c,0x0000089b,0x0003003e,
+0x00000897,0x0000089c,0x0004003d,0x000000ac,
+0x0000089f,0x000000db,0x000600a9,0x00000059,
+0x000008a0,0x0000089f,0x000000ca,0x000000bf,
+0x00050084,0x00000059,0x000008a1,0x0000089e,
+0x000008a0,0x0004007c,0x00000006,0x000008a2,
+0x000008a1,0x0004003d,0x00000006,0x000008a3,
+0x00000885,0x00050080,0x00000006,0x000008a4,
+0x000008a2,0x000008a3,0x0003003e,0x0000089d,
+0x000008a4,0x0004003d,0x00000006,0x000008a6,
+0x0000089d,0x0004003d,0x00000006,0x000008a7,
+0x00000897,0x00050082,0x00000006,0x000008a8,
+0x000008a6,0x000008a7,0x0003003e,0x000008a5,
+0x000008a8,0x0004003d,0x00000006,0x000008ac,
+0x000008a5,0x0003003e,0x000008ab,0x000008ac,
+0x0004003d,0x00000006,0x000008ae,0x00000886,
+0x0003003e,0x000008ad,0x000008ae,0x00070039,
+0x00000008,0x000008b0,0x00000057,0x000008ab,
+0x000008ad,0x000008af,0x0004003d,0x00000006,
+0x000008b1,0x000008af,0x0003003e,0x000008aa,
+0x000008b1,0x0003003e,0x000008a9,0x000008b0,
+0x0004003d,0x00000006,0x000008b3,0x00000888,
+0x000500c2,0x00000006,0x000008b4,0x000008b3,
+0x000000c0,0x00050080,0x00000006,0x000008b5,
+0x000008b4,0x0000009f,0x0003003e,0x000008b2,
+0x000008b5,0x0003003e,0x000008b6,0x0000084a,
+0x0003003e,0x000008b7,0x0000084a,0x0004003d,
+0x0000000f,0x000008b9,0x000000a7,0x0004003d,
+0x00000006,0x000008ba,0x00000897,0x0004003d,
+0x00000006,0x000008bb,0x000008aa,0x00050080,
+0x00000006,0x000008bc,0x000008ba,0x000008bb,
+0x0003003e,0x000008bd,0x000008bc,0x00050039,
+0x0000000f,0x000008be,0x0000007c,0x000008bd,
+0x000500c7,0x0000000f,0x000008bf,0x000008b9,
+0x000008be,0x0003003e,0x000008b8,0x000008bf,
+0x0003003e,0x000008c0,0x0000009c,0x000200f9,
+0x000008c1,0x000200f8,0x000008c1,0x000400f6,
+0x000008c3,0x000008c4,0x00000000,0x000200f9,
+0x000008c5,0x000200f8,0x000008c5,0x0004003d,
+0x00000006,0x000008c6,0x000008c0,0x0004003d,
+0x00000006,0x000008c7,0x000008b2,0x000500b0,
+0x000000ac,0x000008c8,0x000008c6,0x000008c7,
+0x000400fa,0x000008c8,0x000008c2,0x000008c3,
+0x000200f8,0x000008c2,0x0004003d,0x00000006,
+0x000008ca,0x000008c0,0x00050084,0x00000006,
+0x000008cb,0x00000091,0x000008ca,0x0004003d,
+0x00000006,0x000008cc,0x00000887,0x00050080,
+0x00000006,0x000008cd,0x000008cb,0x000008cc,
+0x0003003e,0x000008c9,0x000008cd,0x0004003d,
+0x00000006,0x000008ce,0x000008c0,0x0004003d,
+0x0000000f,0x000008d0,0x000008b8,0x0003003e,
+0x000008cf,0x000008d0,0x0004003d,0x00000006,
+0x000008d2,0x00000897,0x0003003e,0x000008d1,
+0x000008d2,0x0004003d,0x00000006,0x000008d4,
+0x000008c9,0x0003003e,0x000008d3,0x000008d4,
+0x0004003d,0x00000008,0x000008d6,0x000008a9,
+0x0003003e,0x000008d5,0x000008d6,0x00080039,
+0x00000006,0x000008d7,0x00000078,0x000008cf,
+0x000008d1,0x000008d3,0x000008d5,0x0004007c,
+0x00000059,0x000008d8,0x000008d7,0x00050041,
+0x0000024c,0x000008d9,0x000008b6,0x000008ce,
+0x0003003e,0x000008d9,0x000008d8,0x0004003d,
+0x00000006,0x000008da,0x000008c0,0x0004003d,
+0x00000006,0x000008db,0x000008c9,0x00050080,
+0x00000006,0x000008dc,0x000008db,0x0000009f,
+0x0004003d,0x0000000f,0x000008de,0x000008b8,
+0x0003003e,0x000008dd,0x000008de,0x0004003d,
+0x00000006,0x000008e0,0x00000897,0x0003003e,
+0x000008df,0x000008e0,0x0003003e,0x000008e1,
+0x000008dc,0x0004003d,0x00000008,0x000008e3,
+0x000008a9,0x0003003e,0x000008e2,0x000008e3,
+0x00080039,0x00000006,0x000008e4,0x00000078,
+0x000008dd,0x000008df,0x000008e1,0x000008e2,
+0x0004007c,0x00000059,0x000008e5,0x000008e4,
+0x00050041,0x0000024c,0x000008e6,0x000008b7,
+0x000008da,0x0003003e,0x000008e6,0x000008e5,
+0x000200f9,0x000008c4,0x000200f8,0x000008c4,
+0x0004003d,0x00000006,0x000008e7,0x000008c0,
+0x00050080,0x00000006,0x000008e8,0x000008e7,
+0x000000ca,0x0003003e,0x000008c0,0x000008e8,
+0x000200f9,0x000008c1,0x000200f8,0x000008c3,
+0x0004003d,0x0000005a,0x000008ec,0x000008b6,
+0x0003003e,0x000008eb,0x000008ec,0x0004003d,
+0x0000005a,0x000008ee,0x000008b7,0x0003003e,
+0x000008ed,0x000008ee,0x0004003d,0x00000006,
+0x000008f0,0x00000888,0x0003003e,0x000008ef,
+0x000008f0,0x00090039,0x00000002,0x000008f3,
+0x00000071,0x000008eb,0x000008ed,0x000008ef,
+0x000008f1,0x000008f2,0x0004003d,0x0000000f,
+0x000008f4,0x000008f1,0x0003003e,0x000008e9,
+0x000008f4,0x0004003d,0x0000000f,0x000008f5,
+0x000008f2,0x0003003e,0x000008ea,0x000008f5,
+0x00050041,0x00000007,0x000008f7,0x0000087a,
+0x0000009c,0x0004003d,0x00000006,0x000008f8,
+0x000008f7,0x00070050,0x0000000f,0x000008f9,
+0x000008f8,0x000008f8,0x000008f8,0x000008f8,
+0x0003003e,0x000008f6,0x000008f9,0x0004003d,
+0x000000ac,0x000008fa,0x000000db,0x000300f7,
+0x000008fc,0x00000000,0x000400fa,0x000008fa,
+0x000008fb,0x000008fc,0x000200f8,0x000008fb,
+0x0004003d,0x0000000f,0x000008ff,0x000000a7,
+0x0003003e,0x000008fe,0x000008ff,0x0004003d,
+0x00000006,0x00000901,0x0000089d,0x0003003e,
+0x00000900,0x00000901,0x0003003e,0x00000902,
+0x00000091,0x00070039,0x00000006,0x00000903,
+0x0000001c,0x000008fe,0x00000900,0x00000902,
+0x0003003e,0x000008fd,0x00000903,0x0004003d,
+0x00000006,0x00000904,0x000008fd,0x00050041,
+0x00000007,0x00000905,0x0000087a,0x0000009f,
+0x0004003d,0x00000006,0x00000906,0x00000905,
+0x00050041,0x00000007,0x00000907,0x000008f6,
+0x00000904,0x0003003e,0x00000907,0x00000906,
+0x000200f9,0x000008fc,0x000200f8,0x000008fc,
+0x0004003d,0x0000000f,0x00000908,0x000008e9,
+0x0004003d,0x0000000f,0x00000909,0x000008f6,
+0x00070050,0x0000000f,0x0000090a,0x0000017d,
+0x0000017d,0x0000017d,0x0000017d,0x00050082,
+0x0000000f,0x0000090b,0x0000090a,0x00000909,
+0x00050084,0x0000000f,0x0000090c,0x00000908,
+0x0000090b,0x0004003d,0x0000000f,0x0000090d,
+0x000008ea,0x0004003d,0x0000000f,0x0000090e,
+0x000008f6,0x00050084,0x0000000f,0x0000090f,
+0x0000090d,0x0000090e,0x00050080,0x0000000f,
+0x00000910,0x0000090c,0x0000090f,0x00070050,
+0x0000000f,0x00000911,0x000001a0,0x000001a0,
+0x000001a0,0x000001a0,0x00050080,0x0000000f,
+0x00000912,0x00000910,0x00000911,0x00070050,
+0x0000005a,0x00000913,0x0000050c,0x0000050c,
+0x0000050c,0x0000050c,0x000500c2,0x0000000f,
+0x00000914,0x00000912,0x00000913,0x000200fe,
+0x00000914,0x00010038,0x00050036,0x00000060,
+0x00000084,0x00000000,0x00000082,0x00030037,
+0x00000061,0x00000083,0x000200f8,0x00000085,
+0x0004003d,0x00000060,0x00000917,0x00000083,
+0x000200fe,0x00000917,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_1D.inl
new file mode 100644
index 00000000000..3f8f328eba1
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_1D.inl
@@ -0,0 +1,5037 @@
+0x07230203,0x00010300,0x000d000a,0x00000cb0,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000c52,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00070005,
+0x0000000c,0x50746567,0x4431736f,0x61727241,
+0x69762879,0x00003b33,0x00030005,0x0000000b,
+0x00736f70,0x00050005,0x00000014,0x28746962,
+0x693b3175,0x00003b31,0x00030005,0x00000012,
+0x00000075,0x00030005,0x00000013,0x00746962,
+0x00070005,0x0000001c,0x73746962,0x28383231,
+0x3b347576,0x753b3175,0x00003b31,0x00030005,
+0x00000019,0x00000075,0x00050005,0x0000001a,
+0x53746962,0x74726174,0x00000000,0x00050005,
+0x0000001b,0x43746962,0x746e756f,0x00000000,
+0x000a0005,0x00000023,0x73746962,0x66383231,
+0x5a6c6c69,0x736f7265,0x34757628,0x3b31753b,
+0x753b3175,0x00003b31,0x00030005,0x0000001f,
+0x00000075,0x00050005,0x00000020,0x53746962,
+0x74726174,0x00000000,0x00040005,0x00000021,
+0x45746962,0x0000646e,0x00050005,0x00000022,
+0x43746962,0x746e756f,0x00000000,0x00090005,
+0x0000002a,0x5f746567,0x5f746962,0x6e756f63,
+0x31752874,0x3b31753b,0x753b3175,0x00003b31,
+0x00050005,0x00000026,0x5f6d756e,0x736c6176,
+0x00000000,0x00040005,0x00000027,0x74697274,
+0x00000073,0x00040005,0x00000028,0x6e697571,
+0x00007374,0x00040005,0x00000029,0x73746962,
+0x00000000,0x000a0005,0x00000032,0x5f746567,
+0x6b636170,0x7a69735f,0x31752865,0x3b31753b,
+0x753b3175,0x31753b31,0x0000003b,0x00040005,
+0x0000002d,0x74697274,0x00000073,0x00040005,
+0x0000002e,0x6e697571,0x00007374,0x00040005,
+0x0000002f,0x73746962,0x00000000,0x00040005,
+0x00000030,0x6b636170,0x00000000,0x00050005,
+0x00000031,0x6b636170,0x69536465,0x0000657a,
+0x00090005,0x0000003b,0x6f636564,0x745f6564,
+0x28746972,0x3b347576,0x753b3175,0x31753b31,
+0x0000003b,0x00040005,0x00000037,0x61746164,
+0x00000000,0x00040005,0x00000038,0x72617473,
+0x00000074,0x00030005,0x00000039,0x00646e65,
+0x00030005,0x0000003a,0x0000006e,0x00090005,
+0x00000044,0x6f636564,0x715f6564,0x746e6975,
+0x34757628,0x3b31753b,0x753b3175,0x00003b31,
+0x00040005,0x00000040,0x61746164,0x00000000,
+0x00040005,0x00000041,0x72617473,0x00000074,
+0x00030005,0x00000042,0x00646e65,0x00030005,
+0x00000043,0x0000006e,0x00060005,0x00000048,
+0x5f746567,0x6f635f76,0x28746e75,0x003b3175,
+0x00030005,0x00000047,0x006d6563,0x00060005,
+0x0000004f,0x70617773,0x34697628,0x3469763b,
+0x0000003b,0x00030005,0x0000004d,0x00003176,
+0x00030005,0x0000004e,0x00003276,0x00090005,
+0x00000054,0x5f746962,0x6e617274,0x72656673,
+0x6769735f,0x2864656e,0x693b3169,0x00003b31,
+0x00030005,0x00000052,0x00000061,0x00030005,
+0x00000053,0x00000062,0x00070005,0x00000058,
+0x65756c62,0x6e6f635f,0x63617274,0x69762874,
+0x00003b34,0x00030005,0x00000057,0x006c6176,
+0x000d0005,0x00000062,0x6f636564,0x6c5f6564,
+0x665f7264,0x6d5f726f,0x2865646f,0x345b3175,
+0x753b5d30,0x31753b31,0x3475763b,0x3475763b,
+0x0000003b,0x00040005,0x0000005d,0x736c6176,
+0x00000000,0x00050005,0x0000005e,0x72617473,
+0x64695f74,0x00000078,0x00040005,0x0000005f,
+0x65646f6d,0x00000000,0x00030005,0x00000060,
+0x00003163,0x00030005,0x00000061,0x00003263,
+0x00050005,0x00000065,0x68736168,0x75283235,
+0x00003b31,0x00030005,0x00000064,0x00000070,
+0x000a0005,0x0000006b,0x656c6573,0x705f7463,
+0x69747261,0x6e6f6974,0x3b317528,0x753b3175,
+0x31753b31,0x0000003b,0x00040005,0x00000067,
+0x64656573,0x00000000,0x00030005,0x00000068,
+0x00000078,0x00030005,0x00000069,0x00000079,
+0x00060005,0x0000006a,0x74726170,0x6f697469,
+0x756f636e,0x0000746e,0x00080005,0x00000071,
+0x676e6973,0x635f656c,0x726f6c6f,0x6f6c625f,
+0x76286b63,0x003b3475,0x00040005,0x00000070,
+0x6f6c6f63,0x00000072,0x00070005,0x00000074,
+0x6f727265,0x6f635f72,0x5f726f6c,0x636f6c62,
+0x0000286b,0x00080005,0x00000078,0x63747361,
+0x6365645f,0x5f65646f,0x636f6c62,0x7576286b,
+0x00003b34,0x00030005,0x00000077,0x00000075,
+0x00080005,0x0000007b,0x636f6c62,0x5f795f6b,
+0x657a6973,0x4144315f,0x79617272,0x00000028,
+0x00050005,0x00000088,0x73726966,0x78644974,
+0x00000000,0x00050005,0x0000008c,0x73726966,
+0x66664f74,0x00746573,0x00040005,0x0000008f,
+0x4d746962,0x006b7361,0x00050005,0x000000a9,
+0x73726966,0x756f4374,0x0000746e,0x00030005,
+0x000000ac,0x00746572,0x00040005,0x000000d2,
+0x61726170,0x0000006d,0x00040005,0x000000d4,
+0x61726170,0x0000006d,0x00040005,0x000000d6,
+0x61726170,0x0000006d,0x00060005,0x000000da,
+0x74697274,0x7469625f,0x756f635f,0x0000746e,
+0x00060005,0x000000e3,0x6e697571,0x69625f74,
+0x6f635f74,0x00746e75,0x00060005,0x000000ec,
+0x65736162,0x7469625f,0x756f635f,0x0000746e,
+0x00040005,0x00000108,0x6f636e65,0x00646564,
+0x00070005,0x00000109,0x6f636e65,0x5f646564,
+0x73746962,0x6165725f,0x00000064,0x00030005,
+0x0000010a,0x00000069,0x00030005,0x00000115,
+0x0000006d,0x00040005,0x00000117,0x61726170,
+0x0000006d,0x00040005,0x00000119,0x61726170,
+0x0000006d,0x00040005,0x0000011b,0x61726170,
+0x0000006d,0x00040005,0x0000011d,0x61726170,
+0x0000006d,0x00060005,0x00000124,0x6f636e65,
+0x5f646564,0x73746962,0x00000000,0x00050005,
+0x0000012a,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x0000012e,0x61726170,0x0000006d,
+0x00040005,0x00000130,0x61726170,0x0000006d,
+0x00040005,0x00000132,0x61726170,0x0000006d,
+0x00040005,0x00000134,0x61726170,0x0000006d,
+0x00050005,0x00000137,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000143,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x0000014b,
+0x00000069,0x00040005,0x00000153,0x75736572,
+0x0000746c,0x00050005,0x0000024e,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000025d,
+0x6f636e65,0x00646564,0x00070005,0x0000025e,
+0x6f636e65,0x5f646564,0x73746962,0x6165725f,
+0x00000064,0x00040005,0x0000025f,0x4d746962,
+0x006b7361,0x00030005,0x00000264,0x00000069,
+0x00030005,0x0000026e,0x0000006d,0x00040005,
+0x00000270,0x61726170,0x0000006d,0x00040005,
+0x00000272,0x61726170,0x0000006d,0x00040005,
+0x00000274,0x61726170,0x0000006d,0x00040005,
+0x00000276,0x61726170,0x0000006d,0x00060005,
+0x0000027d,0x6f636e65,0x5f646564,0x73746962,
+0x00000000,0x00050005,0x00000282,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000286,
+0x61726170,0x0000006d,0x00040005,0x00000288,
+0x61726170,0x0000006d,0x00040005,0x0000028a,
+0x61726170,0x0000006d,0x00040005,0x0000028c,
+0x61726170,0x0000006d,0x00050005,0x0000028f,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x0000029b,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x000002a3,0x00000069,0x00040005,
+0x000002ab,0x75736572,0x0000746c,0x00050005,
+0x00000330,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x00000345,0x00706d74,0x00030005,
+0x0000036c,0x00003076,0x00050005,0x00000370,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000374,0x00003176,0x00050005,0x00000377,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x0000037b,0x00003276,0x00050005,0x0000037e,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000382,0x00003376,0x00050005,0x00000385,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000389,0x00003476,0x00050005,0x0000038c,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000390,0x00003576,0x00050005,0x00000393,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000397,0x00003676,0x00050005,0x0000039b,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x0000039f,0x00003776,0x00050005,0x000003a2,
+0x65646e69,0x6c626178,0x00000065,0x00070005,
+0x000003b3,0x70646e65,0x746e696f,0x776f6c5f,
+0x6267725f,0x00000061,0x00070005,0x000003b9,
+0x70646e65,0x746e696f,0x6769685f,0x67725f68,
+0x00006162,0x00030005,0x000003bf,0x0000306c,
+0x00030005,0x000003c6,0x0000316c,0x00040005,
+0x000003e0,0x61726170,0x0000006d,0x00040005,
+0x000003e2,0x61726170,0x0000006d,0x00040005,
+0x000003e7,0x61726170,0x0000006d,0x00040005,
+0x000003e9,0x61726170,0x0000006d,0x00050005,
+0x000003f6,0x68676968,0x6d756c5f,0x00000061,
+0x00030005,0x00000409,0x00000069,0x00030005,
+0x00000411,0x00000078,0x00030005,0x00000420,
+0x00003073,0x00030005,0x00000426,0x00003173,
+0x00040005,0x00000439,0x61726170,0x0000006d,
+0x00040005,0x0000043b,0x61726170,0x0000006d,
+0x00040005,0x00000440,0x61726170,0x0000006d,
+0x00040005,0x00000444,0x61726170,0x0000006d,
+0x00040005,0x00000449,0x61726170,0x0000006d,
+0x00040005,0x0000044b,0x61726170,0x0000006d,
+0x00040005,0x00000450,0x61726170,0x0000006d,
+0x00040005,0x00000452,0x61726170,0x0000006d,
+0x00040005,0x00000457,0x61726170,0x0000006d,
+0x00040005,0x00000459,0x61726170,0x0000006d,
+0x00040005,0x00000474,0x61726170,0x0000006d,
+0x00040005,0x00000476,0x61726170,0x0000006d,
+0x00040005,0x0000047b,0x61726170,0x0000006d,
+0x00040005,0x0000047f,0x61726170,0x0000006d,
+0x00030005,0x0000049b,0x00003073,0x00030005,
+0x000004a2,0x00003173,0x00040005,0x000004b8,
+0x61726170,0x0000006d,0x00040005,0x000004ba,
+0x61726170,0x0000006d,0x00040005,0x000004bf,
+0x61726170,0x0000006d,0x00040005,0x000004c3,
+0x61726170,0x0000006d,0x00040005,0x000004c8,
+0x61726170,0x0000006d,0x00040005,0x000004ca,
+0x61726170,0x0000006d,0x00040005,0x000004cf,
+0x61726170,0x0000006d,0x00040005,0x000004d1,
+0x61726170,0x0000006d,0x00040005,0x000004d6,
+0x61726170,0x0000006d,0x00040005,0x000004d8,
+0x61726170,0x0000006d,0x00040005,0x000004dd,
+0x61726170,0x0000006d,0x00040005,0x000004df,
+0x61726170,0x0000006d,0x00040005,0x000004fe,
+0x61726170,0x0000006d,0x00040005,0x00000500,
+0x61726170,0x0000006d,0x00040005,0x00000505,
+0x61726170,0x0000006d,0x00040005,0x00000509,
+0x61726170,0x0000006d,0x00030005,0x00000552,
+0x0000007a,0x00070005,0x00000554,0x67616d49,
+0x726f4665,0x4274616d,0x6b636f6c,0x00000000,
+0x00060006,0x00000554,0x00000000,0x636f6c62,
+0x7a69536b,0x00000065,0x00060006,0x00000554,
+0x00000001,0x65736162,0x6579614c,0x00000072,
+0x00060006,0x00000554,0x00000002,0x6c616d73,
+0x6f6c426c,0x00006b63,0x00060005,0x00000556,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00040005,0x00000567,0x6d756e72,0x00000000,
+0x00040005,0x00000568,0x61726170,0x0000006d,
+0x00040005,0x0000056b,0x64656573,0x00000031,
+0x00040005,0x0000056f,0x64656573,0x00000032,
+0x00040005,0x00000573,0x64656573,0x00000033,
+0x00040005,0x00000577,0x64656573,0x00000034,
+0x00040005,0x0000057c,0x64656573,0x00000035,
+0x00040005,0x00000580,0x64656573,0x00000036,
+0x00040005,0x00000585,0x64656573,0x00000037,
+0x00040005,0x0000058a,0x64656573,0x00000038,
+0x00040005,0x0000058f,0x64656573,0x00000039,
+0x00040005,0x00000594,0x64656573,0x00003031,
+0x00040005,0x00000599,0x64656573,0x00003131,
+0x00040005,0x0000059e,0x64656573,0x00003231,
+0x00030005,0x000005cf,0x00316873,0x00030005,
+0x000005d5,0x00326873,0x00030005,0x000005e4,
+0x00336873,0x00030005,0x00000610,0x00000061,
+0x00030005,0x00000620,0x00000062,0x00030005,
+0x00000630,0x00000063,0x00030005,0x0000063f,
+0x00000064,0x00030005,0x00000682,0x00000068,
+0x00030005,0x0000068d,0x00000077,0x00030005,
+0x00000699,0x00746572,0x00040005,0x000006ad,
+0x61726170,0x0000006d,0x00030005,0x000006b1,
+0x00003375,0x00030005,0x000006b3,0x00373862,
+0x00030005,0x000006b7,0x00353662,0x00030005,
+0x000006bb,0x00323362,0x00030005,0x000006bf,
+0x00000061,0x00030005,0x000006c1,0x00000062,
+0x00030005,0x000006c3,0x00000064,0x00040005,
+0x000006c4,0x61726170,0x0000006d,0x00040005,
+0x000006c6,0x61726170,0x0000006d,0x00030005,
+0x000006c8,0x00726468,0x00040005,0x000006ca,
+0x61726170,0x0000006d,0x00040005,0x000006cc,
+0x61726170,0x0000006d,0x00030005,0x000006d3,
+0x00000072,0x00040005,0x000006d6,0x61726170,
+0x0000006d,0x00040005,0x000006d8,0x61726170,
+0x0000006d,0x00040005,0x000006df,0x74646977,
+0x00000068,0x00040005,0x000006e1,0x67696568,
+0x00007468,0x00040005,0x00000702,0x6f6c6f63,
+0x00000072,0x00040005,0x00000710,0x61726170,
+0x0000006d,0x00040005,0x00000723,0x61726170,
+0x0000006d,0x00040005,0x00000725,0x61726170,
+0x0000006d,0x00040005,0x00000743,0x61726170,
+0x0000006d,0x00040005,0x00000745,0x61726170,
+0x0000006d,0x00040005,0x00000765,0x74697274,
+0x00000073,0x00040005,0x00000766,0x6e697571,
+0x00007374,0x00040005,0x00000767,0x73746962,
+0x00000000,0x00060005,0x00000768,0x67696577,
+0x6f437468,0x73746e75,0x00000000,0x00050005,
+0x0000079f,0x6b636170,0x69536465,0x0000657a,
+0x00040005,0x000007a0,0x6b636170,0x00000000,
+0x00040005,0x000007a1,0x61726170,0x0000006d,
+0x00040005,0x000007a3,0x61726170,0x0000006d,
+0x00040005,0x000007a5,0x61726170,0x0000006d,
+0x00040005,0x000007a7,0x61726170,0x0000006d,
+0x00040005,0x000007a8,0x61726170,0x0000006d,
+0x00040005,0x000007ac,0x49637273,0x00007864,
+0x00040005,0x000007ad,0x49747364,0x00007864,
+0x00050005,0x000007ae,0x76655275,0x65737265,
+0x00000064,0x00060005,0x000007b0,0x67696577,
+0x69427468,0x756f4374,0x0000746e,0x00040005,
+0x000007b1,0x61726170,0x0000006d,0x00040005,
+0x000007b3,0x61726170,0x0000006d,0x00040005,
+0x000007b5,0x61726170,0x0000006d,0x00040005,
+0x000007b7,0x61726170,0x0000006d,0x00040005,
+0x000007da,0x6f636564,0x00646564,0x00040005,
+0x000007db,0x61726170,0x0000006d,0x00040005,
+0x000007dd,0x61726170,0x0000006d,0x00040005,
+0x000007df,0x61726170,0x0000006d,0x00040005,
+0x000007e1,0x61726170,0x0000006d,0x00030005,
+0x000007e4,0x00000069,0x00050005,0x000007ef,
+0x67696577,0x72477468,0x00006469,0x00050005,
+0x00000813,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x0000081b,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000839,0x6f636564,
+0x00646564,0x00040005,0x0000083a,0x61726170,
+0x0000006d,0x00040005,0x0000083c,0x61726170,
+0x0000006d,0x00040005,0x0000083e,0x61726170,
+0x0000006d,0x00040005,0x00000840,0x61726170,
+0x0000006d,0x00030005,0x00000843,0x00000069,
+0x00050005,0x0000085b,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000863,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x0000087d,
+0x6f636564,0x52646564,0x00007761,0x00040005,
+0x0000087e,0x61726170,0x0000006d,0x00040005,
+0x00000880,0x61726170,0x0000006d,0x00040005,
+0x00000882,0x61726170,0x0000006d,0x00040005,
+0x00000885,0x6f636564,0x00646564,0x00050005,
+0x0000088c,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000894,0x65646e69,0x6c626178,
+0x00000065,0x00060005,0x000008ac,0x74726170,
+0x6f697469,0x756f436e,0x0000746e,0x00050005,
+0x000008bb,0x67696577,0x74537468,0x00747261,
+0x00040005,0x000008bc,0x61726170,0x0000006d,
+0x00040005,0x000008be,0x61726170,0x0000006d,
+0x00040005,0x000008c0,0x61726170,0x0000006d,
+0x00040005,0x000008c2,0x61726170,0x0000006d,
+0x00060005,0x000008c6,0x6c617564,0x6e616c50,
+0x61745365,0x00007472,0x00030005,0x000008cb,
+0x006d6563,0x00050005,0x000008d6,0x74726170,
+0x65646f4d,0x00000000,0x00060005,0x000008db,
+0x72747865,0x69424d61,0x756f4374,0x0000746e,
+0x00050005,0x000008e5,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x000008e9,0x72747865,
+0x74534d61,0x00747261,0x00040005,0x000008f5,
+0x5f6d6563,0x006c6c61,0x00040005,0x00000900,
+0x426d6563,0x00657361,0x00040005,0x00000903,
+0x486d6563,0x00686769,0x00040005,0x00000905,
+0x61726170,0x0000006d,0x00040005,0x00000907,
+0x61726170,0x0000006d,0x00040005,0x00000909,
+0x61726170,0x0000006d,0x00040005,0x0000090b,
+0x61726170,0x0000006d,0x00040005,0x0000090e,
+0x61726170,0x0000006d,0x00040005,0x00000910,
+0x61726170,0x0000006d,0x00040005,0x00000912,
+0x61726170,0x0000006d,0x00040005,0x00000914,
+0x61726170,0x0000006d,0x00040005,0x00000919,
+0x72747865,0x00004d61,0x00040005,0x0000091a,
+0x61726170,0x0000006d,0x00040005,0x0000091b,
+0x61726170,0x0000006d,0x00040005,0x0000091d,
+0x61726170,0x0000006d,0x00060005,0x00000920,
+0x6e69616d,0x7469424d,0x6e756f43,0x00000074,
+0x00050005,0x00000924,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000927,0x0000006d,
+0x00040005,0x00000942,0x61746f74,0x0000566c,
+0x00040005,0x00000943,0x74726170,0x00000000,
+0x00040005,0x0000094d,0x61726170,0x0000006d,
+0x00040005,0x00000955,0x74537065,0x00747261,
+0x00060005,0x0000095b,0x61746f74,0x6176416c,
+0x69426c69,0x00007374,0x00050005,0x00000965,
+0x75517065,0x73746e69,0x00000000,0x00040005,
+0x00000966,0x72547065,0x00737469,0x00040005,
+0x00000967,0x69427065,0x00007374,0x00030005,
+0x00000968,0x00000069,0x00050005,0x0000097b,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x0000097f,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000983,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000986,0x61726170,
+0x0000006d,0x00040005,0x00000988,0x61726170,
+0x0000006d,0x00040005,0x0000098a,0x61726170,
+0x0000006d,0x00040005,0x0000098c,0x61726170,
+0x0000006d,0x00050005,0x0000099c,0x69427065,
+0x756f4374,0x0000746e,0x00040005,0x0000099d,
+0x61726170,0x0000006d,0x00040005,0x0000099f,
+0x61726170,0x0000006d,0x00040005,0x000009a1,
+0x61726170,0x0000006d,0x00040005,0x000009a3,
+0x61726170,0x0000006d,0x00040005,0x000009a6,
+0x6e457065,0x00000064,0x00050005,0x000009aa,
+0x6b636170,0x69536465,0x0000657a,0x00040005,
+0x000009ab,0x6b636170,0x00000000,0x00040005,
+0x000009ac,0x61726170,0x0000006d,0x00040005,
+0x000009ae,0x61726170,0x0000006d,0x00040005,
+0x000009b0,0x61726170,0x0000006d,0x00040005,
+0x000009b2,0x61726170,0x0000006d,0x00040005,
+0x000009b3,0x61726170,0x0000006d,0x00040005,
+0x000009b7,0x49637273,0x00007864,0x00040005,
+0x000009b9,0x49747364,0x00007864,0x00040005,
+0x000009c6,0x6f636564,0x00646564,0x00040005,
+0x000009c7,0x61726170,0x0000006d,0x00040005,
+0x000009c8,0x61726170,0x0000006d,0x00040005,
+0x000009ca,0x61726170,0x0000006d,0x00040005,
+0x000009cc,0x61726170,0x0000006d,0x00030005,
+0x000009cf,0x00000069,0x00040005,0x000009d7,
+0x66754276,0x00726566,0x00050005,0x00000a8f,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000a97,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000aaa,0x6f636564,0x00646564,
+0x00040005,0x00000aab,0x61726170,0x0000006d,
+0x00040005,0x00000aac,0x61726170,0x0000006d,
+0x00040005,0x00000aae,0x61726170,0x0000006d,
+0x00040005,0x00000ab0,0x61726170,0x0000006d,
+0x00030005,0x00000ab3,0x00000069,0x00050005,
+0x00000ac8,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000ad0,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000adf,0x00637273,
+0x00040005,0x00000ae0,0x61726170,0x0000006d,
+0x00040005,0x00000ae1,0x61726170,0x0000006d,
+0x00040005,0x00000ae3,0x61726170,0x0000006d,
+0x00040005,0x00000ae6,0x6f636564,0x00646564,
+0x00050005,0x00000aed,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000af5,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x00000b02,
+0x66667562,0x64497265,0x00000078,0x00040005,
+0x00000b03,0x74726170,0x00000000,0x00050005,
+0x00000b11,0x50646e65,0x746e696f,0x00000073,
+0x00040005,0x00000b14,0x61726170,0x0000006d,
+0x00040005,0x00000b16,0x61726170,0x0000006d,
+0x00040005,0x00000b19,0x61726170,0x0000006d,
+0x00040005,0x00000b1a,0x61726170,0x0000006d,
+0x00040005,0x00000b21,0x61726170,0x0000006d,
+0x00030005,0x00000b2a,0x00747364,0x00030005,
+0x00000b37,0x00006464,0x00030005,0x00000b3a,
+0x00000068,0x00030005,0x00000b44,0x00000077,
+0x00040005,0x00000b4e,0x74726170,0x00000000,
+0x00040005,0x00000b53,0x61726170,0x0000006d,
+0x00040005,0x00000b54,0x61726170,0x0000006d,
+0x00040005,0x00000b56,0x61726170,0x0000006d,
+0x00040005,0x00000b58,0x61726170,0x0000006d,
+0x00050005,0x00000b63,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000b69,0x00746572,
+0x00030005,0x00000b72,0x00007473,0x00030005,
+0x00000b76,0x00747363,0x00030005,0x00000b7a,
+0x00747367,0x00030005,0x00000b86,0x0074736a,
+0x00030005,0x00000b8a,0x00747366,0x00030005,
+0x00000b8e,0x00003076,0x00030005,0x00000b96,
+0x00303070,0x00030005,0x00000ba3,0x00313070,
+0x00030005,0x00000bb2,0x00303170,0x00030005,
+0x00000bc3,0x00313170,0x00030005,0x00000bd6,
+0x00313177,0x00030005,0x00000bde,0x00303177,
+0x00030005,0x00000be3,0x00313077,0x00030005,
+0x00000be8,0x00303077,0x00030005,0x00000bf1,
+0x00000069,0x00030005,0x00000c09,0x00003063,
+0x00030005,0x00000c0d,0x00003163,0x00030005,
+0x00000c11,0x00000063,0x00030005,0x00000c26,
+0x00736363,0x00040005,0x00000c27,0x61726170,
+0x0000006d,0x00040005,0x00000c28,0x61726170,
+0x0000006d,0x00040005,0x00000c2a,0x61726170,
+0x0000006d,0x00030005,0x00000c4f,0x00736f70,
+0x00080005,0x00000c52,0x475f6c67,0x61626f6c,
+0x766e496c,0x7461636f,0x496e6f69,0x00000044,
+0x00050005,0x00000c5c,0x42637273,0x6b636f6c,
+0x00000000,0x00050005,0x00000c5f,0x6d695f75,
+0x30656761,0x00000000,0x00040005,0x00000c61,
+0x61726170,0x0000006d,0x00060005,0x00000c73,
+0x6f636564,0x6572706d,0x64657373,0x00000000,
+0x00030005,0x00000c76,0x00000079,0x00030005,
+0x00000c7f,0x00000078,0x00050005,0x00000c8b,
+0x6d695f75,0x31656761,0x00000000,0x00040005,
+0x00000ca0,0x61726170,0x0000006d,0x00050048,
+0x00000554,0x00000000,0x00000023,0x00000000,
+0x00050048,0x00000554,0x00000001,0x00000023,
+0x00000008,0x00050048,0x00000554,0x00000002,
+0x00000023,0x0000000c,0x00030047,0x00000554,
+0x00000002,0x00040047,0x00000c52,0x0000000b,
+0x0000001c,0x00040047,0x00000c5f,0x00000022,
+0x00000000,0x00040047,0x00000c5f,0x00000021,
+0x00000000,0x00030047,0x00000c5f,0x00000018,
+0x00040047,0x00000c8b,0x00000022,0x00000000,
+0x00040047,0x00000c8b,0x00000021,0x00000001,
+0x00030047,0x00000c8b,0x00000019,0x00040047,
+0x00000cae,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000001,
+0x00040017,0x00000007,0x00000006,0x00000003,
+0x00040020,0x00000008,0x00000007,0x00000007,
+0x00040017,0x00000009,0x00000006,0x00000002,
+0x00040021,0x0000000a,0x00000009,0x00000008,
+0x00040015,0x0000000e,0x00000020,0x00000000,
+0x00040020,0x0000000f,0x00000007,0x0000000e,
+0x00040020,0x00000010,0x00000007,0x00000006,
+0x00050021,0x00000011,0x0000000e,0x0000000f,
+0x00000010,0x00040017,0x00000016,0x0000000e,
+0x00000004,0x00040020,0x00000017,0x00000007,
+0x00000016,0x00060021,0x00000018,0x0000000e,
+0x00000017,0x0000000f,0x0000000f,0x00070021,
+0x0000001e,0x0000000e,0x00000017,0x0000000f,
+0x0000000f,0x0000000f,0x00070021,0x00000025,
+0x0000000e,0x0000000f,0x0000000f,0x0000000f,
+0x0000000f,0x00080021,0x0000002c,0x00000002,
+0x0000000f,0x0000000f,0x0000000f,0x0000000f,
+0x0000000f,0x0004002b,0x0000000e,0x00000034,
+0x00000005,0x0004001c,0x00000035,0x0000000e,
+0x00000034,0x00070021,0x00000036,0x00000035,
+0x00000017,0x0000000f,0x0000000f,0x0000000f,
+0x0004002b,0x0000000e,0x0000003d,0x00000003,
+0x0004001c,0x0000003e,0x0000000e,0x0000003d,
+0x00070021,0x0000003f,0x0000003e,0x00000017,
+0x0000000f,0x0000000f,0x0000000f,0x00040021,
+0x00000046,0x0000000e,0x0000000f,0x00040017,
+0x0000004a,0x00000006,0x00000004,0x00040020,
+0x0000004b,0x00000007,0x0000004a,0x00050021,
+0x0000004c,0x00000002,0x0000004b,0x0000004b,
+0x00050021,0x00000051,0x00000002,0x00000010,
+0x00000010,0x00040021,0x00000056,0x00000002,
+0x0000004b,0x0004002b,0x0000000e,0x0000005a,
+0x00000028,0x0004001c,0x0000005b,0x0000000e,
+0x0000005a,0x00080021,0x0000005c,0x00000002,
+0x0000005b,0x0000000f,0x0000000f,0x00000017,
+0x00000017,0x0004002b,0x0000000e,0x0000006d,
+0x00000090,0x0004001c,0x0000006e,0x00000016,
+0x0000006d,0x00040021,0x0000006f,0x0000006e,
+0x00000017,0x00030021,0x00000073,0x0000006e,
+0x00040021,0x00000076,0x0000006e,0x00000016,
+0x00030021,0x0000007a,0x0000000e,0x0004002b,
+0x0000000e,0x00000084,0x00000001,0x0004002b,
+0x0000000e,0x0000008a,0x00000020,0x0004002b,
+0x00000006,0x00000090,0x00000001,0x00020014,
+0x0000009b,0x0004002b,0x0000000e,0x000000cb,
+0x00000000,0x0004002b,0x0000000e,0x000000dc,
+0x00000008,0x0004002b,0x0000000e,0x000000e0,
+0x00000004,0x0004002b,0x0000000e,0x000000e5,
+0x00000007,0x0004002b,0x0000000e,0x000000e9,
+0x00000002,0x0004002b,0x00000006,0x0000010b,
+0x00000000,0x0004002b,0x00000006,0x00000112,
+0x00000005,0x00040020,0x00000114,0x00000007,
+0x00000035,0x0004001c,0x00000125,0x00000006,
+0x00000034,0x0004002b,0x00000006,0x00000126,
+0x00000002,0x0008002c,0x00000125,0x00000127,
+0x00000126,0x00000126,0x00000090,0x00000126,
+0x00000090,0x00040020,0x00000129,0x00000007,
+0x00000125,0x0004002b,0x0000000e,0x00000155,
+0x00000100,0x0004001c,0x00000156,0x00000035,
+0x00000155,0x0008002c,0x00000035,0x00000157,
+0x000000cb,0x000000cb,0x000000cb,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000158,
+0x00000084,0x000000cb,0x000000cb,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000159,
+0x000000e9,0x000000cb,0x000000cb,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000015a,
+0x000000cb,0x000000cb,0x000000e9,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000015b,
+0x000000cb,0x00000084,0x000000cb,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000015c,
+0x00000084,0x00000084,0x000000cb,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000015d,
+0x000000e9,0x00000084,0x000000cb,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000015e,
+0x00000084,0x000000cb,0x000000e9,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000015f,
+0x000000cb,0x000000e9,0x000000cb,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000160,
+0x00000084,0x000000e9,0x000000cb,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000161,
+0x000000e9,0x000000e9,0x000000cb,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000162,
+0x000000e9,0x000000cb,0x000000e9,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000163,
+0x000000cb,0x000000e9,0x000000e9,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000164,
+0x00000084,0x000000e9,0x000000e9,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000165,
+0x000000e9,0x000000e9,0x000000e9,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000166,
+0x000000cb,0x000000cb,0x00000084,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000167,
+0x00000084,0x000000cb,0x00000084,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000168,
+0x000000e9,0x000000cb,0x00000084,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000169,
+0x000000cb,0x00000084,0x000000e9,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000016a,
+0x000000cb,0x00000084,0x00000084,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000016b,
+0x00000084,0x00000084,0x00000084,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000016c,
+0x000000e9,0x00000084,0x00000084,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000016d,
+0x00000084,0x00000084,0x000000e9,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000016e,
+0x000000cb,0x000000e9,0x00000084,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x0000016f,
+0x00000084,0x000000e9,0x00000084,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000170,
+0x000000e9,0x000000e9,0x00000084,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000171,
+0x000000e9,0x00000084,0x000000e9,0x000000cb,
+0x000000cb,0x0008002c,0x00000035,0x00000172,
+0x000000cb,0x000000cb,0x000000cb,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x00000173,
+0x00000084,0x000000cb,0x000000cb,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x00000174,
+0x000000e9,0x000000cb,0x000000cb,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x00000175,
+0x000000cb,0x000000cb,0x000000e9,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x00000176,
+0x000000cb,0x000000cb,0x000000cb,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000177,
+0x00000084,0x000000cb,0x000000cb,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000178,
+0x000000e9,0x000000cb,0x000000cb,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000179,
+0x000000cb,0x000000cb,0x000000e9,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000017a,
+0x000000cb,0x00000084,0x000000cb,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000017b,
+0x00000084,0x00000084,0x000000cb,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000017c,
+0x000000e9,0x00000084,0x000000cb,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000017d,
+0x00000084,0x000000cb,0x000000e9,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000017e,
+0x000000cb,0x000000e9,0x000000cb,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000017f,
+0x00000084,0x000000e9,0x000000cb,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000180,
+0x000000e9,0x000000e9,0x000000cb,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000181,
+0x000000e9,0x000000cb,0x000000e9,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000182,
+0x000000cb,0x000000e9,0x000000e9,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000183,
+0x00000084,0x000000e9,0x000000e9,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000184,
+0x000000e9,0x000000e9,0x000000e9,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000185,
+0x000000cb,0x000000cb,0x00000084,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000186,
+0x00000084,0x000000cb,0x00000084,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000187,
+0x000000e9,0x000000cb,0x00000084,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000188,
+0x000000cb,0x00000084,0x000000e9,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000189,
+0x000000cb,0x00000084,0x00000084,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000018a,
+0x00000084,0x00000084,0x00000084,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000018b,
+0x000000e9,0x00000084,0x00000084,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000018c,
+0x00000084,0x00000084,0x000000e9,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000018d,
+0x000000cb,0x000000e9,0x00000084,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000018e,
+0x00000084,0x000000e9,0x00000084,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x0000018f,
+0x000000e9,0x000000e9,0x00000084,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000190,
+0x000000e9,0x00000084,0x000000e9,0x00000084,
+0x000000cb,0x0008002c,0x00000035,0x00000191,
+0x000000cb,0x00000084,0x000000cb,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x00000192,
+0x00000084,0x00000084,0x000000cb,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x00000193,
+0x000000e9,0x00000084,0x000000cb,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x00000194,
+0x00000084,0x000000cb,0x000000e9,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x00000195,
+0x000000cb,0x000000cb,0x000000cb,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x00000196,
+0x00000084,0x000000cb,0x000000cb,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x00000197,
+0x000000e9,0x000000cb,0x000000cb,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x00000198,
+0x000000cb,0x000000cb,0x000000e9,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x00000199,
+0x000000cb,0x00000084,0x000000cb,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x0000019a,
+0x00000084,0x00000084,0x000000cb,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x0000019b,
+0x000000e9,0x00000084,0x000000cb,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x0000019c,
+0x00000084,0x000000cb,0x000000e9,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x0000019d,
+0x000000cb,0x000000e9,0x000000cb,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x0000019e,
+0x00000084,0x000000e9,0x000000cb,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x0000019f,
+0x000000e9,0x000000e9,0x000000cb,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a0,
+0x000000e9,0x000000cb,0x000000e9,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a1,
+0x000000cb,0x000000e9,0x000000e9,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a2,
+0x00000084,0x000000e9,0x000000e9,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a3,
+0x000000e9,0x000000e9,0x000000e9,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a4,
+0x000000cb,0x000000cb,0x00000084,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a5,
+0x00000084,0x000000cb,0x00000084,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a6,
+0x000000e9,0x000000cb,0x00000084,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a7,
+0x000000cb,0x00000084,0x000000e9,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a8,
+0x000000cb,0x00000084,0x00000084,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001a9,
+0x00000084,0x00000084,0x00000084,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001aa,
+0x000000e9,0x00000084,0x00000084,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001ab,
+0x00000084,0x00000084,0x000000e9,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001ac,
+0x000000cb,0x000000e9,0x00000084,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001ad,
+0x00000084,0x000000e9,0x00000084,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001ae,
+0x000000e9,0x000000e9,0x00000084,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001af,
+0x000000e9,0x00000084,0x000000e9,0x000000e9,
+0x000000cb,0x0008002c,0x00000035,0x000001b0,
+0x000000cb,0x000000e9,0x000000cb,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001b1,
+0x00000084,0x000000e9,0x000000cb,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001b2,
+0x000000e9,0x000000e9,0x000000cb,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001b3,
+0x000000e9,0x000000cb,0x000000e9,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001b4,
+0x000000cb,0x000000cb,0x000000cb,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001b5,
+0x00000084,0x000000cb,0x000000cb,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001b6,
+0x000000e9,0x000000cb,0x000000cb,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001b7,
+0x000000cb,0x000000cb,0x000000e9,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001b8,
+0x000000cb,0x00000084,0x000000cb,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001b9,
+0x00000084,0x00000084,0x000000cb,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001ba,
+0x000000e9,0x00000084,0x000000cb,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001bb,
+0x00000084,0x000000cb,0x000000e9,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001bc,
+0x000000cb,0x000000e9,0x000000cb,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001bd,
+0x00000084,0x000000e9,0x000000cb,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001be,
+0x000000e9,0x000000e9,0x000000cb,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001bf,
+0x000000e9,0x000000cb,0x000000e9,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c0,
+0x000000cb,0x000000e9,0x000000e9,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c1,
+0x00000084,0x000000e9,0x000000e9,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c2,
+0x000000e9,0x000000e9,0x000000e9,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c3,
+0x000000cb,0x000000cb,0x00000084,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c4,
+0x00000084,0x000000cb,0x00000084,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c5,
+0x000000e9,0x000000cb,0x00000084,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c6,
+0x000000cb,0x00000084,0x000000e9,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c7,
+0x000000cb,0x00000084,0x00000084,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c8,
+0x00000084,0x00000084,0x00000084,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001c9,
+0x000000e9,0x00000084,0x00000084,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001ca,
+0x00000084,0x00000084,0x000000e9,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001cb,
+0x000000cb,0x000000e9,0x00000084,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001cc,
+0x00000084,0x000000e9,0x00000084,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001cd,
+0x000000e9,0x000000e9,0x00000084,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001ce,
+0x000000e9,0x00000084,0x000000e9,0x000000cb,
+0x000000e9,0x0008002c,0x00000035,0x000001cf,
+0x000000cb,0x000000e9,0x000000e9,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001d0,
+0x00000084,0x000000e9,0x000000e9,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001d1,
+0x000000e9,0x000000e9,0x000000e9,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001d2,
+0x000000cb,0x000000cb,0x000000cb,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001d3,
+0x00000084,0x000000cb,0x000000cb,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001d4,
+0x000000e9,0x000000cb,0x000000cb,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001d5,
+0x000000cb,0x000000cb,0x000000e9,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001d6,
+0x000000cb,0x00000084,0x000000cb,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001d7,
+0x00000084,0x00000084,0x000000cb,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001d8,
+0x000000e9,0x00000084,0x000000cb,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001d9,
+0x00000084,0x000000cb,0x000000e9,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001da,
+0x000000cb,0x000000e9,0x000000cb,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001db,
+0x00000084,0x000000e9,0x000000cb,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001dc,
+0x000000e9,0x000000e9,0x000000cb,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001dd,
+0x000000e9,0x000000cb,0x000000e9,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001de,
+0x000000cb,0x000000e9,0x000000e9,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001df,
+0x00000084,0x000000e9,0x000000e9,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e0,
+0x000000e9,0x000000e9,0x000000e9,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e1,
+0x000000cb,0x000000cb,0x00000084,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e2,
+0x00000084,0x000000cb,0x00000084,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e3,
+0x000000e9,0x000000cb,0x00000084,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e4,
+0x000000cb,0x00000084,0x000000e9,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e5,
+0x000000cb,0x00000084,0x00000084,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e6,
+0x00000084,0x00000084,0x00000084,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e7,
+0x000000e9,0x00000084,0x00000084,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e8,
+0x00000084,0x00000084,0x000000e9,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001e9,
+0x000000cb,0x000000e9,0x00000084,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001ea,
+0x00000084,0x000000e9,0x00000084,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001eb,
+0x000000e9,0x000000e9,0x00000084,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001ec,
+0x000000e9,0x00000084,0x000000e9,0x000000cb,
+0x00000084,0x0008002c,0x00000035,0x000001ed,
+0x000000cb,0x000000cb,0x00000084,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001ee,
+0x00000084,0x000000cb,0x00000084,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001ef,
+0x000000e9,0x000000cb,0x00000084,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001f0,
+0x000000cb,0x00000084,0x000000e9,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x000001f1,
+0x000000cb,0x000000cb,0x000000cb,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001f2,
+0x00000084,0x000000cb,0x000000cb,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001f3,
+0x000000e9,0x000000cb,0x000000cb,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001f4,
+0x000000cb,0x000000cb,0x000000e9,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001f5,
+0x000000cb,0x00000084,0x000000cb,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001f6,
+0x00000084,0x00000084,0x000000cb,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001f7,
+0x000000e9,0x00000084,0x000000cb,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001f8,
+0x00000084,0x000000cb,0x000000e9,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001f9,
+0x000000cb,0x000000e9,0x000000cb,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001fa,
+0x00000084,0x000000e9,0x000000cb,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001fb,
+0x000000e9,0x000000e9,0x000000cb,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001fc,
+0x000000e9,0x000000cb,0x000000e9,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001fd,
+0x000000cb,0x000000e9,0x000000e9,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001fe,
+0x00000084,0x000000e9,0x000000e9,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x000001ff,
+0x000000e9,0x000000e9,0x000000e9,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000200,
+0x000000cb,0x000000cb,0x00000084,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000201,
+0x00000084,0x000000cb,0x00000084,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000202,
+0x000000e9,0x000000cb,0x00000084,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000203,
+0x000000cb,0x00000084,0x000000e9,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000204,
+0x000000cb,0x00000084,0x00000084,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000205,
+0x00000084,0x00000084,0x00000084,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000206,
+0x000000e9,0x00000084,0x00000084,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000207,
+0x00000084,0x00000084,0x000000e9,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000208,
+0x000000cb,0x000000e9,0x00000084,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x00000209,
+0x00000084,0x000000e9,0x00000084,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x0000020a,
+0x000000e9,0x000000e9,0x00000084,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x0000020b,
+0x000000e9,0x00000084,0x000000e9,0x00000084,
+0x00000084,0x0008002c,0x00000035,0x0000020c,
+0x000000cb,0x00000084,0x00000084,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x0000020d,
+0x00000084,0x00000084,0x00000084,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x0000020e,
+0x000000e9,0x00000084,0x00000084,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x0000020f,
+0x00000084,0x00000084,0x000000e9,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x00000210,
+0x000000cb,0x000000cb,0x000000cb,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000211,
+0x00000084,0x000000cb,0x000000cb,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000212,
+0x000000e9,0x000000cb,0x000000cb,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000213,
+0x000000cb,0x000000cb,0x000000e9,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000214,
+0x000000cb,0x00000084,0x000000cb,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000215,
+0x00000084,0x00000084,0x000000cb,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000216,
+0x000000e9,0x00000084,0x000000cb,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000217,
+0x00000084,0x000000cb,0x000000e9,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000218,
+0x000000cb,0x000000e9,0x000000cb,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000219,
+0x00000084,0x000000e9,0x000000cb,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x0000021a,
+0x000000e9,0x000000e9,0x000000cb,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x0000021b,
+0x000000e9,0x000000cb,0x000000e9,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x0000021c,
+0x000000cb,0x000000e9,0x000000e9,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x0000021d,
+0x00000084,0x000000e9,0x000000e9,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x0000021e,
+0x000000e9,0x000000e9,0x000000e9,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x0000021f,
+0x000000cb,0x000000cb,0x00000084,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000220,
+0x00000084,0x000000cb,0x00000084,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000221,
+0x000000e9,0x000000cb,0x00000084,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000222,
+0x000000cb,0x00000084,0x000000e9,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000223,
+0x000000cb,0x00000084,0x00000084,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000224,
+0x00000084,0x00000084,0x00000084,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000225,
+0x000000e9,0x00000084,0x00000084,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000226,
+0x00000084,0x00000084,0x000000e9,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000227,
+0x000000cb,0x000000e9,0x00000084,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000228,
+0x00000084,0x000000e9,0x00000084,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x00000229,
+0x000000e9,0x000000e9,0x00000084,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x0000022a,
+0x000000e9,0x00000084,0x000000e9,0x000000e9,
+0x00000084,0x0008002c,0x00000035,0x0000022b,
+0x000000cb,0x000000e9,0x00000084,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x0000022c,
+0x00000084,0x000000e9,0x00000084,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x0000022d,
+0x000000e9,0x000000e9,0x00000084,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x0000022e,
+0x000000e9,0x00000084,0x000000e9,0x000000e9,
+0x000000e9,0x0008002c,0x00000035,0x0000022f,
+0x000000cb,0x000000cb,0x000000cb,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000230,
+0x00000084,0x000000cb,0x000000cb,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000231,
+0x000000e9,0x000000cb,0x000000cb,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000232,
+0x000000cb,0x000000cb,0x000000e9,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000233,
+0x000000cb,0x00000084,0x000000cb,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000234,
+0x00000084,0x00000084,0x000000cb,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000235,
+0x000000e9,0x00000084,0x000000cb,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000236,
+0x00000084,0x000000cb,0x000000e9,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000237,
+0x000000cb,0x000000e9,0x000000cb,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000238,
+0x00000084,0x000000e9,0x000000cb,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000239,
+0x000000e9,0x000000e9,0x000000cb,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x0000023a,
+0x000000e9,0x000000cb,0x000000e9,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x0000023b,
+0x000000cb,0x000000e9,0x000000e9,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x0000023c,
+0x00000084,0x000000e9,0x000000e9,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x0000023d,
+0x000000e9,0x000000e9,0x000000e9,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x0000023e,
+0x000000cb,0x000000cb,0x00000084,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x0000023f,
+0x00000084,0x000000cb,0x00000084,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000240,
+0x000000e9,0x000000cb,0x00000084,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000241,
+0x000000cb,0x00000084,0x000000e9,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000242,
+0x000000cb,0x00000084,0x00000084,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000243,
+0x00000084,0x00000084,0x00000084,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000244,
+0x000000e9,0x00000084,0x00000084,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000245,
+0x00000084,0x00000084,0x000000e9,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000246,
+0x000000cb,0x000000e9,0x00000084,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000247,
+0x00000084,0x000000e9,0x00000084,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000248,
+0x000000e9,0x000000e9,0x00000084,0x00000084,
+0x000000e9,0x0008002c,0x00000035,0x00000249,
+0x000000e9,0x00000084,0x000000e9,0x00000084,
+0x000000e9,0x0103002c,0x00000156,0x0000024a,
+0x00000157,0x00000158,0x00000159,0x0000015a,
+0x0000015b,0x0000015c,0x0000015d,0x0000015e,
+0x0000015f,0x00000160,0x00000161,0x00000162,
+0x00000163,0x00000164,0x00000165,0x00000162,
+0x00000166,0x00000167,0x00000168,0x00000169,
+0x0000016a,0x0000016b,0x0000016c,0x0000016d,
+0x0000016e,0x0000016f,0x00000170,0x00000171,
+0x00000172,0x00000173,0x00000174,0x00000175,
+0x00000176,0x00000177,0x00000178,0x00000179,
+0x0000017a,0x0000017b,0x0000017c,0x0000017d,
+0x0000017e,0x0000017f,0x00000180,0x00000181,
+0x00000182,0x00000183,0x00000184,0x00000181,
+0x00000185,0x00000186,0x00000187,0x00000188,
+0x00000189,0x0000018a,0x0000018b,0x0000018c,
+0x0000018d,0x0000018e,0x0000018f,0x00000190,
+0x00000191,0x00000192,0x00000193,0x00000194,
+0x00000195,0x00000196,0x00000197,0x00000198,
+0x00000199,0x0000019a,0x0000019b,0x0000019c,
+0x0000019d,0x0000019e,0x0000019f,0x000001a0,
+0x000001a1,0x000001a2,0x000001a3,0x000001a0,
+0x000001a4,0x000001a5,0x000001a6,0x000001a7,
+0x000001a8,0x000001a9,0x000001aa,0x000001ab,
+0x000001ac,0x000001ad,0x000001ae,0x000001af,
+0x000001b0,0x000001b1,0x000001b2,0x000001b3,
+0x000001b4,0x000001b5,0x000001b6,0x000001b7,
+0x000001b8,0x000001b9,0x000001ba,0x000001bb,
+0x000001bc,0x000001bd,0x000001be,0x000001bf,
+0x000001c0,0x000001c1,0x000001c2,0x000001bf,
+0x000001c3,0x000001c4,0x000001c5,0x000001c6,
+0x000001c7,0x000001c8,0x000001c9,0x000001ca,
+0x000001cb,0x000001cc,0x000001cd,0x000001ce,
+0x000001cf,0x000001d0,0x000001d1,0x000001b3,
+0x000001d2,0x000001d3,0x000001d4,0x000001d5,
+0x000001d6,0x000001d7,0x000001d8,0x000001d9,
+0x000001da,0x000001db,0x000001dc,0x000001dd,
+0x000001de,0x000001df,0x000001e0,0x000001dd,
+0x000001e1,0x000001e2,0x000001e3,0x000001e4,
+0x000001e5,0x000001e6,0x000001e7,0x000001e8,
+0x000001e9,0x000001ea,0x000001eb,0x000001ec,
+0x000001ed,0x000001ee,0x000001ef,0x000001f0,
+0x000001f1,0x000001f2,0x000001f3,0x000001f4,
+0x000001f5,0x000001f6,0x000001f7,0x000001f8,
+0x000001f9,0x000001fa,0x000001fb,0x000001fc,
+0x000001fd,0x000001fe,0x000001ff,0x000001fc,
+0x00000200,0x00000201,0x00000202,0x00000203,
+0x00000204,0x00000205,0x00000206,0x00000207,
+0x00000208,0x00000209,0x0000020a,0x0000020b,
+0x0000020c,0x0000020d,0x0000020e,0x0000020f,
+0x00000210,0x00000211,0x00000212,0x00000213,
+0x00000214,0x00000215,0x00000216,0x00000217,
+0x00000218,0x00000219,0x0000021a,0x0000021b,
+0x0000021c,0x0000021d,0x0000021e,0x0000021b,
+0x0000021f,0x00000220,0x00000221,0x00000222,
+0x00000223,0x00000224,0x00000225,0x00000226,
+0x00000227,0x00000228,0x00000229,0x0000022a,
+0x0000022b,0x0000022c,0x0000022d,0x0000022e,
+0x0000022f,0x00000230,0x00000231,0x00000232,
+0x00000233,0x00000234,0x00000235,0x00000236,
+0x00000237,0x00000238,0x00000239,0x0000023a,
+0x0000023b,0x0000023c,0x0000023d,0x0000023a,
+0x0000023e,0x0000023f,0x00000240,0x00000241,
+0x00000242,0x00000243,0x00000244,0x00000245,
+0x00000246,0x00000247,0x00000248,0x00000249,
+0x000001cf,0x000001d0,0x000001d1,0x0000022e,
+0x00040020,0x0000024d,0x00000007,0x00000156,
+0x0004002b,0x00000006,0x0000026b,0x00000003,
+0x00040020,0x0000026d,0x00000007,0x0000003e,
+0x0004001c,0x0000027e,0x00000006,0x0000003d,
+0x0006002c,0x0000027e,0x0000027f,0x0000026b,
+0x00000126,0x00000126,0x00040020,0x00000281,
+0x00000007,0x0000027e,0x0004002b,0x0000000e,
+0x000002ad,0x00000080,0x0004001c,0x000002ae,
+0x0000003e,0x000002ad,0x0006002c,0x0000003e,
+0x000002af,0x000000cb,0x000000cb,0x000000cb,
+0x0006002c,0x0000003e,0x000002b0,0x00000084,
+0x000000cb,0x000000cb,0x0006002c,0x0000003e,
+0x000002b1,0x000000e9,0x000000cb,0x000000cb,
+0x0006002c,0x0000003e,0x000002b2,0x0000003d,
+0x000000cb,0x000000cb,0x0006002c,0x0000003e,
+0x000002b3,0x000000e0,0x000000cb,0x000000cb,
+0x0006002c,0x0000003e,0x000002b4,0x000000cb,
+0x000000e0,0x000000cb,0x0006002c,0x0000003e,
+0x000002b5,0x000000e0,0x000000e0,0x000000cb,
+0x0006002c,0x0000003e,0x000002b6,0x000000e0,
+0x000000e0,0x000000e0,0x0006002c,0x0000003e,
+0x000002b7,0x000000cb,0x00000084,0x000000cb,
+0x0006002c,0x0000003e,0x000002b8,0x00000084,
+0x00000084,0x000000cb,0x0006002c,0x0000003e,
+0x000002b9,0x000000e9,0x00000084,0x000000cb,
+0x0006002c,0x0000003e,0x000002ba,0x0000003d,
+0x00000084,0x000000cb,0x0006002c,0x0000003e,
+0x000002bb,0x000000e0,0x00000084,0x000000cb,
+0x0006002c,0x0000003e,0x000002bc,0x00000084,
+0x000000e0,0x000000cb,0x0006002c,0x0000003e,
+0x000002bd,0x000000e0,0x000000e0,0x00000084,
+0x0006002c,0x0000003e,0x000002be,0x000000cb,
+0x000000e9,0x000000cb,0x0006002c,0x0000003e,
+0x000002bf,0x00000084,0x000000e9,0x000000cb,
+0x0006002c,0x0000003e,0x000002c0,0x000000e9,
+0x000000e9,0x000000cb,0x0006002c,0x0000003e,
+0x000002c1,0x0000003d,0x000000e9,0x000000cb,
+0x0006002c,0x0000003e,0x000002c2,0x000000e0,
+0x000000e9,0x000000cb,0x0006002c,0x0000003e,
+0x000002c3,0x000000e9,0x000000e0,0x000000cb,
+0x0006002c,0x0000003e,0x000002c4,0x000000e0,
+0x000000e0,0x000000e9,0x0006002c,0x0000003e,
+0x000002c5,0x000000cb,0x0000003d,0x000000cb,
+0x0006002c,0x0000003e,0x000002c6,0x00000084,
+0x0000003d,0x000000cb,0x0006002c,0x0000003e,
+0x000002c7,0x000000e9,0x0000003d,0x000000cb,
+0x0006002c,0x0000003e,0x000002c8,0x0000003d,
+0x0000003d,0x000000cb,0x0006002c,0x0000003e,
+0x000002c9,0x000000e0,0x0000003d,0x000000cb,
+0x0006002c,0x0000003e,0x000002ca,0x0000003d,
+0x000000e0,0x000000cb,0x0006002c,0x0000003e,
+0x000002cb,0x000000e0,0x000000e0,0x0000003d,
+0x0006002c,0x0000003e,0x000002cc,0x000000cb,
+0x000000cb,0x00000084,0x0006002c,0x0000003e,
+0x000002cd,0x00000084,0x000000cb,0x00000084,
+0x0006002c,0x0000003e,0x000002ce,0x000000e9,
+0x000000cb,0x00000084,0x0006002c,0x0000003e,
+0x000002cf,0x0000003d,0x000000cb,0x00000084,
+0x0006002c,0x0000003e,0x000002d0,0x000000e0,
+0x000000cb,0x00000084,0x0006002c,0x0000003e,
+0x000002d1,0x000000cb,0x000000e0,0x00000084,
+0x0006002c,0x0000003e,0x000002d2,0x000000e0,
+0x000000cb,0x000000e0,0x0006002c,0x0000003e,
+0x000002d3,0x000000cb,0x000000e0,0x000000e0,
+0x0006002c,0x0000003e,0x000002d4,0x000000cb,
+0x00000084,0x00000084,0x0006002c,0x0000003e,
+0x000002d5,0x00000084,0x00000084,0x00000084,
+0x0006002c,0x0000003e,0x000002d6,0x000000e9,
+0x00000084,0x00000084,0x0006002c,0x0000003e,
+0x000002d7,0x0000003d,0x00000084,0x00000084,
+0x0006002c,0x0000003e,0x000002d8,0x000000e0,
+0x00000084,0x00000084,0x0006002c,0x0000003e,
+0x000002d9,0x00000084,0x000000e0,0x00000084,
+0x0006002c,0x0000003e,0x000002da,0x000000e0,
+0x00000084,0x000000e0,0x0006002c,0x0000003e,
+0x000002db,0x00000084,0x000000e0,0x000000e0,
+0x0006002c,0x0000003e,0x000002dc,0x000000cb,
+0x000000e9,0x00000084,0x0006002c,0x0000003e,
+0x000002dd,0x00000084,0x000000e9,0x00000084,
+0x0006002c,0x0000003e,0x000002de,0x000000e9,
+0x000000e9,0x00000084,0x0006002c,0x0000003e,
+0x000002df,0x0000003d,0x000000e9,0x00000084,
+0x0006002c,0x0000003e,0x000002e0,0x000000e0,
+0x000000e9,0x00000084,0x0006002c,0x0000003e,
+0x000002e1,0x000000e9,0x000000e0,0x00000084,
+0x0006002c,0x0000003e,0x000002e2,0x000000e0,
+0x000000e9,0x000000e0,0x0006002c,0x0000003e,
+0x000002e3,0x000000e9,0x000000e0,0x000000e0,
+0x0006002c,0x0000003e,0x000002e4,0x000000cb,
+0x0000003d,0x00000084,0x0006002c,0x0000003e,
+0x000002e5,0x00000084,0x0000003d,0x00000084,
+0x0006002c,0x0000003e,0x000002e6,0x000000e9,
+0x0000003d,0x00000084,0x0006002c,0x0000003e,
+0x000002e7,0x0000003d,0x0000003d,0x00000084,
+0x0006002c,0x0000003e,0x000002e8,0x000000e0,
+0x0000003d,0x00000084,0x0006002c,0x0000003e,
+0x000002e9,0x0000003d,0x000000e0,0x00000084,
+0x0006002c,0x0000003e,0x000002ea,0x000000e0,
+0x0000003d,0x000000e0,0x0006002c,0x0000003e,
+0x000002eb,0x0000003d,0x000000e0,0x000000e0,
+0x0006002c,0x0000003e,0x000002ec,0x000000cb,
+0x000000cb,0x000000e9,0x0006002c,0x0000003e,
+0x000002ed,0x00000084,0x000000cb,0x000000e9,
+0x0006002c,0x0000003e,0x000002ee,0x000000e9,
+0x000000cb,0x000000e9,0x0006002c,0x0000003e,
+0x000002ef,0x0000003d,0x000000cb,0x000000e9,
+0x0006002c,0x0000003e,0x000002f0,0x000000e0,
+0x000000cb,0x000000e9,0x0006002c,0x0000003e,
+0x000002f1,0x000000cb,0x000000e0,0x000000e9,
+0x0006002c,0x0000003e,0x000002f2,0x000000e9,
+0x000000cb,0x000000e0,0x0006002c,0x0000003e,
+0x000002f3,0x0000003d,0x000000cb,0x000000e0,
+0x0006002c,0x0000003e,0x000002f4,0x000000cb,
+0x00000084,0x000000e9,0x0006002c,0x0000003e,
+0x000002f5,0x00000084,0x00000084,0x000000e9,
+0x0006002c,0x0000003e,0x000002f6,0x000000e9,
+0x00000084,0x000000e9,0x0006002c,0x0000003e,
+0x000002f7,0x0000003d,0x00000084,0x000000e9,
+0x0006002c,0x0000003e,0x000002f8,0x000000e0,
+0x00000084,0x000000e9,0x0006002c,0x0000003e,
+0x000002f9,0x00000084,0x000000e0,0x000000e9,
+0x0006002c,0x0000003e,0x000002fa,0x000000e9,
+0x00000084,0x000000e0,0x0006002c,0x0000003e,
+0x000002fb,0x0000003d,0x00000084,0x000000e0,
+0x0006002c,0x0000003e,0x000002fc,0x000000cb,
+0x000000e9,0x000000e9,0x0006002c,0x0000003e,
+0x000002fd,0x00000084,0x000000e9,0x000000e9,
+0x0006002c,0x0000003e,0x000002fe,0x000000e9,
+0x000000e9,0x000000e9,0x0006002c,0x0000003e,
+0x000002ff,0x0000003d,0x000000e9,0x000000e9,
+0x0006002c,0x0000003e,0x00000300,0x000000e0,
+0x000000e9,0x000000e9,0x0006002c,0x0000003e,
+0x00000301,0x000000e9,0x000000e0,0x000000e9,
+0x0006002c,0x0000003e,0x00000302,0x000000e9,
+0x000000e9,0x000000e0,0x0006002c,0x0000003e,
+0x00000303,0x0000003d,0x000000e9,0x000000e0,
+0x0006002c,0x0000003e,0x00000304,0x000000cb,
+0x0000003d,0x000000e9,0x0006002c,0x0000003e,
+0x00000305,0x00000084,0x0000003d,0x000000e9,
+0x0006002c,0x0000003e,0x00000306,0x000000e9,
+0x0000003d,0x000000e9,0x0006002c,0x0000003e,
+0x00000307,0x0000003d,0x0000003d,0x000000e9,
+0x0006002c,0x0000003e,0x00000308,0x000000e0,
+0x0000003d,0x000000e9,0x0006002c,0x0000003e,
+0x00000309,0x0000003d,0x000000e0,0x000000e9,
+0x0006002c,0x0000003e,0x0000030a,0x000000e9,
+0x0000003d,0x000000e0,0x0006002c,0x0000003e,
+0x0000030b,0x0000003d,0x0000003d,0x000000e0,
+0x0006002c,0x0000003e,0x0000030c,0x000000cb,
+0x000000cb,0x0000003d,0x0006002c,0x0000003e,
+0x0000030d,0x00000084,0x000000cb,0x0000003d,
+0x0006002c,0x0000003e,0x0000030e,0x000000e9,
+0x000000cb,0x0000003d,0x0006002c,0x0000003e,
+0x0000030f,0x0000003d,0x000000cb,0x0000003d,
+0x0006002c,0x0000003e,0x00000310,0x000000e0,
+0x000000cb,0x0000003d,0x0006002c,0x0000003e,
+0x00000311,0x000000cb,0x000000e0,0x0000003d,
+0x0006002c,0x0000003e,0x00000312,0x000000cb,
+0x000000cb,0x000000e0,0x0006002c,0x0000003e,
+0x00000313,0x00000084,0x000000cb,0x000000e0,
+0x0006002c,0x0000003e,0x00000314,0x000000cb,
+0x00000084,0x0000003d,0x0006002c,0x0000003e,
+0x00000315,0x00000084,0x00000084,0x0000003d,
+0x0006002c,0x0000003e,0x00000316,0x000000e9,
+0x00000084,0x0000003d,0x0006002c,0x0000003e,
+0x00000317,0x0000003d,0x00000084,0x0000003d,
+0x0006002c,0x0000003e,0x00000318,0x000000e0,
+0x00000084,0x0000003d,0x0006002c,0x0000003e,
+0x00000319,0x00000084,0x000000e0,0x0000003d,
+0x0006002c,0x0000003e,0x0000031a,0x000000cb,
+0x00000084,0x000000e0,0x0006002c,0x0000003e,
+0x0000031b,0x00000084,0x00000084,0x000000e0,
+0x0006002c,0x0000003e,0x0000031c,0x000000cb,
+0x000000e9,0x0000003d,0x0006002c,0x0000003e,
+0x0000031d,0x00000084,0x000000e9,0x0000003d,
+0x0006002c,0x0000003e,0x0000031e,0x000000e9,
+0x000000e9,0x0000003d,0x0006002c,0x0000003e,
+0x0000031f,0x0000003d,0x000000e9,0x0000003d,
+0x0006002c,0x0000003e,0x00000320,0x000000e0,
+0x000000e9,0x0000003d,0x0006002c,0x0000003e,
+0x00000321,0x000000e9,0x000000e0,0x0000003d,
+0x0006002c,0x0000003e,0x00000322,0x000000cb,
+0x000000e9,0x000000e0,0x0006002c,0x0000003e,
+0x00000323,0x00000084,0x000000e9,0x000000e0,
+0x0006002c,0x0000003e,0x00000324,0x000000cb,
+0x0000003d,0x0000003d,0x0006002c,0x0000003e,
+0x00000325,0x00000084,0x0000003d,0x0000003d,
+0x0006002c,0x0000003e,0x00000326,0x000000e9,
+0x0000003d,0x0000003d,0x0006002c,0x0000003e,
+0x00000327,0x0000003d,0x0000003d,0x0000003d,
+0x0006002c,0x0000003e,0x00000328,0x000000e0,
+0x0000003d,0x0000003d,0x0006002c,0x0000003e,
+0x00000329,0x0000003d,0x000000e0,0x0000003d,
+0x0006002c,0x0000003e,0x0000032a,0x000000cb,
+0x0000003d,0x000000e0,0x0006002c,0x0000003e,
+0x0000032b,0x00000084,0x0000003d,0x000000e0,
+0x0083002c,0x000002ae,0x0000032c,0x000002af,
+0x000002b0,0x000002b1,0x000002b2,0x000002b3,
+0x000002b4,0x000002b5,0x000002b6,0x000002b7,
+0x000002b8,0x000002b9,0x000002ba,0x000002bb,
+0x000002bc,0x000002bd,0x000002b6,0x000002be,
+0x000002bf,0x000002c0,0x000002c1,0x000002c2,
+0x000002c3,0x000002c4,0x000002b6,0x000002c5,
+0x000002c6,0x000002c7,0x000002c8,0x000002c9,
+0x000002ca,0x000002cb,0x000002b6,0x000002cc,
+0x000002cd,0x000002ce,0x000002cf,0x000002d0,
+0x000002d1,0x000002d2,0x000002d3,0x000002d4,
+0x000002d5,0x000002d6,0x000002d7,0x000002d8,
+0x000002d9,0x000002da,0x000002db,0x000002dc,
+0x000002dd,0x000002de,0x000002df,0x000002e0,
+0x000002e1,0x000002e2,0x000002e3,0x000002e4,
+0x000002e5,0x000002e6,0x000002e7,0x000002e8,
+0x000002e9,0x000002ea,0x000002eb,0x000002ec,
+0x000002ed,0x000002ee,0x000002ef,0x000002f0,
+0x000002f1,0x000002f2,0x000002f3,0x000002f4,
+0x000002f5,0x000002f6,0x000002f7,0x000002f8,
+0x000002f9,0x000002fa,0x000002fb,0x000002fc,
+0x000002fd,0x000002fe,0x000002ff,0x00000300,
+0x00000301,0x00000302,0x00000303,0x00000304,
+0x00000305,0x00000306,0x00000307,0x00000308,
+0x00000309,0x0000030a,0x0000030b,0x0000030c,
+0x0000030d,0x0000030e,0x0000030f,0x00000310,
+0x00000311,0x00000312,0x00000313,0x00000314,
+0x00000315,0x00000316,0x00000317,0x00000318,
+0x00000319,0x0000031a,0x0000031b,0x0000031c,
+0x0000031d,0x0000031e,0x0000031f,0x00000320,
+0x00000321,0x00000322,0x00000323,0x00000324,
+0x00000325,0x00000326,0x00000327,0x00000328,
+0x00000329,0x0000032a,0x0000032b,0x00040020,
+0x0000032f,0x00000007,0x000002ae,0x0004002b,
+0x00000006,0x0000034c,0x00000080,0x0004002b,
+0x00000006,0x00000352,0x0000003f,0x0004002b,
+0x00000006,0x00000356,0x00000020,0x0004002b,
+0x00000006,0x0000035b,0x00000040,0x00040020,
+0x0000036f,0x00000007,0x0000005b,0x0004002b,
+0x0000000e,0x00000399,0x00000006,0x0004002b,
+0x00000006,0x000003b7,0x000000ff,0x0004002b,
+0x00000006,0x000003c3,0x000000c0,0x0004002b,
+0x00000006,0x00000419,0x00000008,0x0007002c,
+0x0000004a,0x00000516,0x0000010b,0x0000010b,
+0x0000010b,0x0000010b,0x0004002b,0x00000006,
+0x0000051d,0x0000000f,0x0004002b,0x00000006,
+0x00000522,0x00000011,0x0004002b,0x00000006,
+0x00000527,0x00000007,0x0004002b,0x00000006,
+0x0000052c,0x00000004,0x0004002b,0x00000006,
+0x00000535,0x00000010,0x0004002b,0x00000006,
+0x00000542,0x00000006,0x00040017,0x00000553,
+0x0000000e,0x00000002,0x0005001e,0x00000554,
+0x00000553,0x0000000e,0x0000000e,0x00040020,
+0x00000555,0x00000009,0x00000554,0x0004003b,
+0x00000555,0x00000556,0x00000009,0x00040020,
+0x00000557,0x00000009,0x0000000e,0x0004002b,
+0x0000000e,0x00000563,0x00000400,0x0004002b,
+0x0000000e,0x0000056d,0x0000000f,0x0004002b,
+0x00000006,0x00000579,0x0000000c,0x0004002b,
+0x00000006,0x00000582,0x00000014,0x0004002b,
+0x00000006,0x00000587,0x00000018,0x0004002b,
+0x00000006,0x0000058c,0x0000001c,0x0004002b,
+0x00000006,0x00000591,0x00000012,0x0004002b,
+0x00000006,0x00000596,0x00000016,0x0004002b,
+0x00000006,0x0000059b,0x0000001a,0x0004002b,
+0x00000006,0x000005a0,0x0000001e,0x0004002b,
+0x0000000e,0x000005e6,0x00000010,0x0004002b,
+0x00000006,0x0000061d,0x0000000e,0x0004002b,
+0x00000006,0x0000062d,0x0000000a,0x0004002b,
+0x0000000e,0x0000064e,0x0000003f,0x00040020,
+0x00000698,0x00000007,0x0000006e,0x0004002b,
+0x0000000e,0x000006ab,0x000000ff,0x0007002c,
+0x00000016,0x000006ac,0x000006ab,0x000000cb,
+0x000006ab,0x000006ab,0x0004002b,0x00000006,
+0x000006c9,0x00000009,0x0004002b,0x0000000e,
+0x000006e0,0x0000000c,0x0004002b,0x0000000e,
+0x000006f4,0x0000000a,0x0004002b,0x0000000e,
+0x000006fc,0x00000dff,0x0004002b,0x0000000e,
+0x000006fe,0x00000dfc,0x0004002b,0x0000000e,
+0x0000076f,0x00000040,0x0004002b,0x0000000e,
+0x000007bb,0x00000018,0x0004002b,0x0000000e,
+0x000007be,0x00000060,0x0004002b,0x0000000e,
+0x000007ec,0x00000078,0x0004001c,0x000007ed,
+0x0000000e,0x000007ec,0x00040020,0x000007ee,
+0x00000007,0x000007ed,0x0004002b,0x0000000e,
+0x000007f1,0x0000002d,0x0004001c,0x000007f2,
+0x0000000e,0x000007f1,0x0004002b,0x0000000e,
+0x000007f3,0x00000033,0x0004002b,0x0000000e,
+0x000007f4,0x00000019,0x0004002b,0x0000000e,
+0x000007f5,0x00000026,0x0004002b,0x0000000e,
+0x000007f6,0x00000011,0x0004002b,0x0000000e,
+0x000007f7,0x0000002e,0x0004002b,0x0000000e,
+0x000007f8,0x0000003a,0x0004002b,0x0000000e,
+0x000007f9,0x00000017,0x0004002b,0x0000000e,
+0x000007fa,0x0000000b,0x0004002b,0x0000000e,
+0x000007fb,0x00000034,0x0004002b,0x0000000e,
+0x000007fc,0x0000001c,0x0004002b,0x0000000e,
+0x000007fd,0x00000023,0x0004002b,0x0000000e,
+0x000007fe,0x00000037,0x0004002b,0x0000000e,
+0x000007ff,0x0000002f,0x0004002b,0x0000000e,
+0x00000800,0x00000027,0x0004002b,0x0000000e,
+0x00000801,0x0000003d,0x0004002b,0x0000000e,
+0x00000802,0x00000013,0x0004002b,0x0000000e,
+0x00000803,0x0000002c,0x0004002b,0x0000000e,
+0x00000804,0x0000001b,0x0004002b,0x0000000e,
+0x00000805,0x00000024,0x0004002b,0x0000000e,
+0x00000806,0x0000000d,0x0004002b,0x0000000e,
+0x00000807,0x00000032,0x0004002b,0x0000000e,
+0x00000808,0x00000016,0x0004002b,0x0000000e,
+0x00000809,0x00000029,0x0004002b,0x0000000e,
+0x0000080a,0x0000001e,0x0004002b,0x0000000e,
+0x0000080b,0x00000021,0x0030002c,0x000007f2,
+0x0000080c,0x000000cb,0x0000008a,0x0000064e,
+0x000000cb,0x0000064e,0x000006e0,0x000007f3,
+0x000007f4,0x000007f5,0x000000cb,0x0000064e,
+0x000007f6,0x000007f7,0x00000034,0x000007f8,
+0x000007f9,0x0000005a,0x000007fa,0x000007fb,
+0x000007fc,0x000007fd,0x000000cb,0x0000064e,
+0x000000dc,0x000007fe,0x000005e6,0x000007ff,
+0x000007bb,0x00000800,0x000000e9,0x00000801,
+0x000007fa,0x000007fb,0x00000802,0x00000803,
+0x00000804,0x00000805,0x00000034,0x000007f8,
+0x00000806,0x00000807,0x00000808,0x00000809,
+0x0000080a,0x0000080b,0x0004001c,0x0000080d,
+0x0000000e,0x000000e0,0x0004002b,0x0000000e,
+0x0000080e,0x00000009,0x0004002b,0x0000000e,
+0x0000080f,0x00000015,0x0007002c,0x0000080d,
+0x00000810,0x000000cb,0x0000003d,0x0000080e,
+0x0000080f,0x00040020,0x00000812,0x00000007,
+0x0000080d,0x00040020,0x0000081a,0x00000007,
+0x000007f2,0x0004001c,0x0000084c,0x0000000e,
+0x000007fd,0x0004002b,0x0000000e,0x0000084d,
+0x00000038,0x0004002b,0x0000000e,0x0000084e,
+0x0000000e,0x0004002b,0x0000000e,0x0000084f,
+0x00000031,0x0004002b,0x0000000e,0x00000850,
+0x0000002a,0x0004002b,0x0000000e,0x00000851,
+0x0000003c,0x0004002b,0x0000000e,0x00000852,
+0x00000039,0x0004002b,0x0000000e,0x00000853,
+0x00000036,0x0004002b,0x0000000e,0x00000854,
+0x0000001a,0x0004002b,0x0000000e,0x00000855,
+0x00000025,0x0004002b,0x0000000e,0x00000856,
+0x0000001d,0x0004002b,0x0000000e,0x00000857,
+0x00000022,0x0026002c,0x0000084c,0x00000858,
+0x000000cb,0x000005e6,0x0000008a,0x000007ff,
+0x0000064e,0x000000cb,0x0000064e,0x000000e5,
+0x0000084d,0x0000084e,0x0000084f,0x0000080f,
+0x00000850,0x000007fc,0x000007fd,0x000000cb,
+0x0000064e,0x000005e6,0x000007ff,0x0000003d,
+0x00000851,0x00000802,0x00000803,0x00000399,
+0x00000852,0x000007f9,0x0000005a,0x0000080e,
+0x00000853,0x00000854,0x00000855,0x00000806,
+0x00000807,0x00000856,0x00000857,0x0006002c,
+0x0000003e,0x00000859,0x000000cb,0x00000034,
+0x0000056d,0x00040020,0x00000862,0x00000007,
+0x0000084c,0x0004001c,0x00000887,0x0000000e,
+0x00000399,0x0009002c,0x00000887,0x00000888,
+0x0000064e,0x0000080f,0x0000080e,0x000000e0,
+0x000000e9,0x00000084,0x00040020,0x0000088b,
+0x00000007,0x00000887,0x0009002c,0x00000887,
+0x00000891,0x000000dc,0x000000dc,0x000000dc,
+0x000000e9,0x000000e0,0x000000dc,0x0004002b,
+0x00000006,0x000008ae,0x0000000b,0x0004002b,
+0x00000006,0x000008cd,0x0000000d,0x0004002b,
+0x00000006,0x000008d8,0x00000017,0x0007002c,
+0x0000080d,0x000008e2,0x000000cb,0x000000e9,
+0x00000034,0x000000dc,0x0004002b,0x00000006,
+0x000008f7,0x00000019,0x0004002b,0x00000006,
+0x0000090d,0x0000001b,0x0007002c,0x0000080d,
+0x00000921,0x000000cb,0x000000e9,0x00000084,
+0x000000cb,0x0004002b,0x00000006,0x00000958,
+0x0000001d,0x0004001c,0x00000970,0x0000003e,
+0x00000802,0x0006002c,0x0000003e,0x00000971,
+0x000000cb,0x000000cb,0x000000dc,0x0006002c,
+0x0000003e,0x00000972,0x00000084,0x000000cb,
+0x00000399,0x0006002c,0x0000003e,0x00000973,
+0x000000cb,0x00000084,0x00000034,0x0006002c,
+0x0000003e,0x00000974,0x000000cb,0x000000cb,
+0x000000e5,0x0006002c,0x0000003e,0x00000975,
+0x00000084,0x000000cb,0x00000034,0x0006002c,
+0x0000003e,0x00000976,0x000000cb,0x000000cb,
+0x00000399,0x0006002c,0x0000003e,0x00000977,
+0x000000cb,0x000000cb,0x00000034,0x0016002c,
+0x00000970,0x00000978,0x00000971,0x00000972,
+0x00000973,0x00000974,0x00000975,0x0000031a,
+0x00000976,0x00000313,0x00000314,0x00000977,
+0x0000030d,0x000002f4,0x00000312,0x000002ed,
+0x000002d4,0x0000030c,0x000002cd,0x000002ec,
+0x000002cc,0x00040020,0x0000097a,0x00000007,
+0x00000970,0x0004002b,0x0000000e,0x000009d9,
+0x0000017d,0x0004001c,0x000009da,0x0000000e,
+0x000009d9,0x0004002b,0x0000000e,0x000009db,
+0x000000cc,0x0004002b,0x0000000e,0x000009dc,
+0x00000066,0x0004002b,0x0000000e,0x000009dd,
+0x00000099,0x0004002b,0x0000000e,0x000009de,
+0x00000045,0x0004002b,0x0000000e,0x000009df,
+0x000000ba,0x0004002b,0x0000000e,0x000009e0,
+0x000000e8,0x0004002b,0x0000000e,0x000009e1,
+0x0000005c,0x0004002b,0x0000000e,0x000009e2,
+0x000000a3,0x0004002b,0x0000000e,0x000009e3,
+0x000000d1,0x0004002b,0x0000000e,0x000009e4,
+0x00000074,0x0004002b,0x0000000e,0x000009e5,
+0x0000008b,0x0004002b,0x0000000e,0x000009e6,
+0x000000de,0x0004002b,0x0000000e,0x000009e7,
+0x00000042,0x0004002b,0x0000000e,0x000009e8,
+0x000000bd,0x0004002b,0x0000000e,0x000009e9,
+0x00000063,0x0004002b,0x0000000e,0x000009ea,
+0x0000009c,0x0004002b,0x0000000e,0x000009eb,
+0x000000f4,0x0004002b,0x0000000e,0x000009ec,
+0x000000d3,0x0004002b,0x0000000e,0x000009ed,
+0x0000004d,0x0004002b,0x0000000e,0x000009ee,
+0x000000b2,0x0004002b,0x0000000e,0x000009ef,
+0x0000006e,0x0004002b,0x0000000e,0x000009f0,
+0x00000091,0x0004002b,0x0000000e,0x000009f1,
+0x000000e9,0x0004002b,0x0000000e,0x000009f2,
+0x000000c8,0x0004002b,0x0000000e,0x000009f3,
+0x00000058,0x0004002b,0x0000000e,0x000009f4,
+0x000000a7,0x0004002b,0x0000000e,0x000009f5,
+0x00000079,0x0004002b,0x0000000e,0x000009f6,
+0x00000086,0x0004002b,0x0000000e,0x000009f7,
+0x000000ef,0x0004002b,0x0000000e,0x000009f8,
+0x000000df,0x0004002b,0x0000000e,0x000009f9,
+0x00000030,0x0004002b,0x0000000e,0x000009fa,
+0x000000cf,0x0004002b,0x0000000e,0x000009fb,
+0x00000041,0x0004002b,0x0000000e,0x000009fc,
+0x000000be,0x0004002b,0x0000000e,0x000009fd,
+0x00000051,0x0004002b,0x0000000e,0x000009fe,
+0x000000ae,0x0004002b,0x0000000e,0x000009ff,
+0x00000061,0x0004002b,0x0000000e,0x00000a00,
+0x0000009e,0x0004002b,0x0000000e,0x00000a01,
+0x00000071,0x0004002b,0x0000000e,0x00000a02,
+0x0000008e,0x0004002b,0x0000000e,0x00000a03,
+0x000000fa,0x0004002b,0x0000000e,0x00000a04,
+0x000000ea,0x0004002b,0x0000000e,0x00000a05,
+0x000000d9,0x0004002b,0x0000000e,0x00000a06,
+0x000000c9,0x0004002b,0x0000000e,0x00000a07,
+0x00000046,0x0004002b,0x0000000e,0x00000a08,
+0x000000b9,0x0004002b,0x0000000e,0x00000a09,
+0x00000056,0x0004002b,0x0000000e,0x00000a0a,
+0x000000a9,0x0004002b,0x0000000e,0x00000a0b,
+0x00000067,0x0004002b,0x0000000e,0x00000a0c,
+0x00000098,0x0004002b,0x0000000e,0x00000a0d,
+0x00000077,0x0004002b,0x0000000e,0x00000a0e,
+0x00000088,0x0004002b,0x0000000e,0x00000a0f,
+0x000000e4,0x0004002b,0x0000000e,0x00000a10,
+0x0000002b,0x0004002b,0x0000000e,0x00000a11,
+0x000000d4,0x0004002b,0x0000000e,0x00000a12,
+0x0000003b,0x0004002b,0x0000000e,0x00000a13,
+0x000000c4,0x0004002b,0x0000000e,0x00000a14,
+0x0000004c,0x0004002b,0x0000000e,0x00000a15,
+0x000000b3,0x0004002b,0x0000000e,0x00000a16,
+0x0000006c,0x0004002b,0x0000000e,0x00000a17,
+0x00000093,0x0004002b,0x0000000e,0x00000a18,
+0x0000007c,0x0004002b,0x0000000e,0x00000a19,
+0x00000083,0x0004002b,0x0000000e,0x00000a1a,
+0x000000f7,0x0004002b,0x0000000e,0x00000a1b,
+0x000000e7,0x0004002b,0x0000000e,0x00000a1c,
+0x000000d7,0x0004002b,0x0000000e,0x00000a1d,
+0x000000c7,0x0004002b,0x0000000e,0x00000a1e,
+0x000000bf,0x0004002b,0x0000000e,0x00000a1f,
+0x00000048,0x0004002b,0x0000000e,0x00000a20,
+0x000000b7,0x0004002b,0x0000000e,0x00000a21,
+0x00000050,0x0004002b,0x0000000e,0x00000a22,
+0x000000af,0x0004002b,0x0000000e,0x00000a23,
+0x0000009f,0x0004002b,0x0000000e,0x00000a24,
+0x00000068,0x0004002b,0x0000000e,0x00000a25,
+0x00000097,0x0004002b,0x0000000e,0x00000a26,
+0x00000070,0x0004002b,0x0000000e,0x00000a27,
+0x0000008f,0x0004002b,0x0000000e,0x00000a28,
+0x00000087,0x0004002b,0x0000000e,0x00000a29,
+0x000000fd,0x0004002b,0x0000000e,0x00000a2a,
+0x000000f5,0x0004002b,0x0000000e,0x00000a2b,
+0x00000012,0x0004002b,0x0000000e,0x00000a2c,
+0x000000ed,0x0004002b,0x0000000e,0x00000a2d,
+0x000000e5,0x0004002b,0x0000000e,0x00000a2e,
+0x000000dc,0x0004002b,0x0000000e,0x00000a2f,
+0x00000043,0x0004002b,0x0000000e,0x00000a30,
+0x000000bc,0x0004002b,0x0000000e,0x00000a31,
+0x0000004b,0x0004002b,0x0000000e,0x00000a32,
+0x000000b4,0x0004002b,0x0000000e,0x00000a33,
+0x00000053,0x0004002b,0x0000000e,0x00000a34,
+0x000000ac,0x0004002b,0x0000000e,0x00000a35,
+0x0000005b,0x0004002b,0x0000000e,0x00000a36,
+0x000000a4,0x0004002b,0x0000000e,0x00000a37,
+0x0000006b,0x0004002b,0x0000000e,0x00000a38,
+0x00000094,0x0004002b,0x0000000e,0x00000a39,
+0x00000073,0x0004002b,0x0000000e,0x00000a3a,
+0x0000008c,0x0004002b,0x0000000e,0x00000a3b,
+0x0000007b,0x0004002b,0x0000000e,0x00000a3c,
+0x00000084,0x0004002b,0x0000000e,0x00000a3d,
+0x000000f2,0x0004002b,0x0000000e,0x00000a3e,
+0x000000e2,0x0004002b,0x0000000e,0x00000a3f,
+0x000000da,0x0004002b,0x0000000e,0x00000a40,
+0x000000d2,0x0004002b,0x0000000e,0x00000a41,
+0x00000035,0x0004002b,0x0000000e,0x00000a42,
+0x000000ca,0x0004002b,0x0000000e,0x00000a43,
+0x000000c2,0x0004002b,0x0000000e,0x00000a44,
+0x0000004e,0x0004002b,0x0000000e,0x00000a45,
+0x000000b1,0x0004002b,0x0000000e,0x00000a46,
+0x0000005e,0x0004002b,0x0000000e,0x00000a47,
+0x000000a1,0x0004002b,0x0000000e,0x00000a48,
+0x00000076,0x0004002b,0x0000000e,0x00000a49,
+0x00000089,0x0004002b,0x0000000e,0x00000a4a,
+0x0000007e,0x0004002b,0x0000000e,0x00000a4b,
+0x00000081,0x0004002b,0x0000000e,0x00000a4c,
+0x000000fb,0x0004002b,0x0000000e,0x00000a4d,
+0x000000f3,0x0004002b,0x0000000e,0x00000a4e,
+0x00000014,0x0004002b,0x0000000e,0x00000a4f,
+0x000000eb,0x0004002b,0x0000000e,0x00000a50,
+0x000000e3,0x0004002b,0x0000000e,0x00000a51,
+0x000000db,0x0004002b,0x0000000e,0x00000a52,
+0x000000cb,0x0004002b,0x0000000e,0x00000a53,
+0x000000c3,0x0004002b,0x0000000e,0x00000a54,
+0x00000044,0x0004002b,0x0000000e,0x00000a55,
+0x000000bb,0x0004002b,0x0000000e,0x00000a56,
+0x00000054,0x0004002b,0x0000000e,0x00000a57,
+0x000000ab,0x0004002b,0x0000000e,0x00000a58,
+0x00000064,0x0004002b,0x0000000e,0x00000a59,
+0x0000009b,0x0004002b,0x0000000e,0x00000a5a,
+0x000000fe,0x0004002b,0x0000000e,0x00000a5b,
+0x000000f6,0x0004002b,0x0000000e,0x00000a5c,
+0x000000ee,0x0004002b,0x0000000e,0x00000a5d,
+0x000000e6,0x0004002b,0x0000000e,0x00000a5e,
+0x000000d6,0x0004002b,0x0000000e,0x00000a5f,
+0x000000ce,0x0004002b,0x0000000e,0x00000a60,
+0x000000c6,0x0004002b,0x0000000e,0x00000a61,
+0x00000049,0x0004002b,0x0000000e,0x00000a62,
+0x000000b6,0x0004002b,0x0000000e,0x00000a63,
+0x00000055,0x0004002b,0x0000000e,0x00000a64,
+0x000000aa,0x0004002b,0x0000000e,0x00000a65,
+0x00000059,0x0004002b,0x0000000e,0x00000a66,
+0x000000a6,0x0004002b,0x0000000e,0x00000a67,
+0x0000005d,0x0004002b,0x0000000e,0x00000a68,
+0x000000a2,0x0004002b,0x0000000e,0x00000a69,
+0x00000065,0x0004002b,0x0000000e,0x00000a6a,
+0x0000009a,0x0004002b,0x0000000e,0x00000a6b,
+0x00000069,0x0004002b,0x0000000e,0x00000a6c,
+0x00000096,0x0004002b,0x0000000e,0x00000a6d,
+0x0000006d,0x0004002b,0x0000000e,0x00000a6e,
+0x00000092,0x0004002b,0x0000000e,0x00000a6f,
+0x00000075,0x0004002b,0x0000000e,0x00000a70,
+0x0000008a,0x0004002b,0x0000000e,0x00000a71,
+0x0000007d,0x0004002b,0x0000000e,0x00000a72,
+0x00000082,0x0004002b,0x0000000e,0x00000a73,
+0x000000f9,0x0004002b,0x0000000e,0x00000a74,
+0x000000f1,0x0004002b,0x0000000e,0x00000a75,
+0x000000e1,0x0004002b,0x0000000e,0x00000a76,
+0x000000dd,0x0004002b,0x0000000e,0x00000a77,
+0x000000d5,0x0004002b,0x0000000e,0x00000a78,
+0x000000cd,0x0004002b,0x0000000e,0x00000a79,
+0x000000c5,0x0004002b,0x0000000e,0x00000a7a,
+0x0000003e,0x0004002b,0x0000000e,0x00000a7b,
+0x000000c1,0x0004002b,0x0000000e,0x00000a7c,
+0x0000004a,0x0004002b,0x0000000e,0x00000a7d,
+0x000000b5,0x0004002b,0x0000000e,0x00000a7e,
+0x00000052,0x0004002b,0x0000000e,0x00000a7f,
+0x000000ad,0x0004002b,0x0000000e,0x00000a80,
+0x0000005a,0x0004002b,0x0000000e,0x00000a81,
+0x000000a5,0x0004002b,0x0000000e,0x00000a82,
+0x00000062,0x0004002b,0x0000000e,0x00000a83,
+0x0000009d,0x0004002b,0x0000000e,0x00000a84,
+0x0000006a,0x0004002b,0x0000000e,0x00000a85,
+0x00000095,0x0004002b,0x0000000e,0x00000a86,
+0x00000072,0x0004002b,0x0000000e,0x00000a87,
+0x0000008d,0x0004002b,0x0000000e,0x00000a88,
+0x0000007a,0x0004002b,0x0000000e,0x00000a89,
+0x00000085,0x0180002c,0x000009da,0x00000a8a,
+0x000000cb,0x000000cb,0x000000cb,0x000000cb,
+0x000006ab,0x000007f3,0x000009db,0x000009dc,
+0x000009dd,0x000000cb,0x000006ab,0x000009de,
+0x000009df,0x000007f9,0x000009e0,0x000009e1,
+0x000009e2,0x000007f7,0x000009e3,0x000009e4,
+0x000009e5,0x000000cb,0x000006ab,0x0000080b,
+0x000009e6,0x000009e7,0x000009e8,0x000009e9,
+0x000009ea,0x000007fa,0x000009eb,0x00000803,
+0x000009ec,0x000009ed,0x000009ee,0x000009ef,
+0x000009f0,0x00000808,0x000009f1,0x000007fe,
+0x000009f2,0x000009f3,0x000009f4,0x000009f5,
+0x000009f6,0x000000cb,0x000006ab,0x000005e6,
+0x000009f7,0x0000008a,0x000009f8,0x000009f9,
+0x000009fa,0x000009fb,0x000009fc,0x000009fd,
+0x000009fe,0x000009ff,0x00000a00,0x00000a01,
+0x00000a02,0x00000034,0x00000a03,0x0000080f,
+0x00000a04,0x000007f5,0x00000a05,0x00000853,
+0x00000a06,0x00000a07,0x00000a08,0x00000a09,
+0x00000a0a,0x00000a0b,0x00000a0c,0x00000a0d,
+0x00000a0e,0x000007fa,0x000009eb,0x00000804,
+0x00000a0f,0x00000a10,0x00000a11,0x00000a12,
+0x00000a13,0x00000a14,0x00000a15,0x000009e1,
+0x000009e2,0x00000a16,0x00000a17,0x00000a18,
+0x00000a19,0x000000cb,0x000006ab,0x000000dc,
+0x00000a1a,0x000005e6,0x000009f7,0x000007bb,
+0x00000a1b,0x0000008a,0x000009f8,0x0000005a,
+0x00000a1c,0x000009f9,0x000009fa,0x0000084d,
+0x00000a1d,0x0000076f,0x00000a1e,0x00000a1f,
+0x00000a20,0x00000a21,0x00000a22,0x000009f3,
+0x000009f4,0x000007be,0x00000a23,0x00000a24,
+0x00000a25,0x00000a26,0x00000a27,0x000007ec,
+0x00000a28,0x000000e9,0x00000a29,0x000006f4,
+0x00000a2a,0x00000a2b,0x00000a2c,0x00000854,
+0x00000a2d,0x000007fd,0x00000a2e,0x00000a10,
+0x00000a11,0x000007f3,0x000009db,0x00000a12,
+0x00000a13,0x00000a2f,0x00000a30,0x00000a31,
+0x00000a32,0x00000a33,0x00000a34,0x00000a35,
+0x00000a36,0x000009e9,0x000009ea,0x00000a37,
+0x00000a38,0x00000a39,0x00000a3a,0x00000a3b,
+0x00000a3c,0x00000034,0x00000a03,0x00000806,
+0x00000a3d,0x0000080f,0x00000a04,0x00000856,
+0x00000a3e,0x00000855,0x00000a3f,0x000007f1,
+0x00000a40,0x00000a41,0x00000a42,0x00000801,
+0x00000a43,0x00000a07,0x00000a08,0x00000a44,
+0x00000a45,0x00000a09,0x00000a0a,0x00000a46,
+0x00000a47,0x000009dc,0x000009dd,0x000009ef,
+0x000009f0,0x00000a48,0x00000a49,0x00000a4a,
+0x00000a4b,0x000000cb,0x000006ab,0x000000e0,
+0x00000a4c,0x000000dc,0x00000a1a,0x000006e0,
+0x00000a4d,0x000005e6,0x000009f7,0x00000a4e,
+0x00000a4f,0x000007bb,0x00000a1b,0x000007fc,
+0x00000a50,0x0000008a,0x000009f8,0x00000805,
+0x00000a51,0x0000005a,0x00000a1c,0x00000803,
+0x000009ec,0x000009f9,0x000009fa,0x000007fb,
+0x00000a52,0x0000084d,0x00000a1d,0x00000851,
+0x00000a53,0x0000076f,0x00000a1e,0x00000a54,
+0x00000a55,0x00000a1f,0x00000a20,0x00000a14,
+0x00000a15,0x00000a21,0x00000a22,0x00000a56,
+0x00000a57,0x000009f3,0x000009f4,0x000009e1,
+0x000009e2,0x000007be,0x00000a23,0x00000a58,
+0x00000a59,0x00000a24,0x00000a25,0x00000a16,
+0x00000a17,0x00000a26,0x00000a27,0x000009e4,
+0x000009e5,0x000007ec,0x00000a28,0x00000a18,
+0x00000a19,0x00000084,0x00000a5a,0x00000034,
+0x00000a03,0x0000080e,0x00000a5b,0x00000806,
+0x00000a3d,0x000007f6,0x00000a5c,0x0000080f,
+0x00000a04,0x000007f4,0x00000a5d,0x00000856,
+0x00000a3e,0x0000080b,0x000009e6,0x00000855,
+0x00000a3f,0x00000809,0x00000a5e,0x000007f1,
+0x00000a40,0x0000084f,0x00000a5f,0x00000a41,
+0x00000a42,0x00000852,0x00000a60,0x00000801,
+0x00000a43,0x000009fb,0x000009fc,0x000009de,
+0x000009df,0x00000a61,0x00000a62,0x000009ed,
+0x000009ee,0x000009fd,0x000009fe,0x00000a63,
+0x00000a64,0x00000a65,0x00000a66,0x00000a67,
+0x00000a68,0x000009ff,0x00000a00,0x00000a69,
+0x00000a6a,0x00000a6b,0x00000a6c,0x00000a6d,
+0x00000a6e,0x00000a01,0x00000a02,0x00000a6f,
+0x00000a70,0x000009f5,0x000009f6,0x00000a71,
+0x00000a72,0x000000e9,0x00000a29,0x00000399,
+0x00000a73,0x000006f4,0x00000a2a,0x0000084e,
+0x00000a74,0x00000a2b,0x00000a2c,0x00000808,
+0x000009f1,0x00000854,0x00000a2d,0x0000080a,
+0x00000a75,0x00000857,0x00000a76,0x000007f5,
+0x00000a05,0x00000850,0x00000a77,0x000007f7,
+0x000009e3,0x00000807,0x00000a78,0x00000853,
+0x00000a06,0x000007f8,0x00000a79,0x00000a7a,
+0x00000a7b,0x000009e7,0x000009e8,0x00000a07,
+0x00000a08,0x00000a7c,0x00000a7d,0x00000a44,
+0x00000a45,0x00000a7e,0x00000a7f,0x00000a09,
+0x00000a0a,0x00000a80,0x00000a81,0x00000a46,
+0x00000a47,0x00000a82,0x00000a83,0x000009dc,
+0x000009dd,0x00000a84,0x00000a85,0x000009ef,
+0x000009f0,0x00000a86,0x00000a87,0x00000a48,
+0x00000a49,0x00000a88,0x00000a89,0x00000a4a,
+0x00000a4b,0x0004001c,0x00000a8b,0x0000000e,
+0x000000e5,0x000a002c,0x00000a8b,0x00000a8c,
+0x000000cb,0x0000003d,0x0000080e,0x0000080f,
+0x000007f1,0x00000a67,0x000009e8,0x00040020,
+0x00000a8e,0x00000007,0x00000a8b,0x00040020,
+0x00000a96,0x00000007,0x000009da,0x0004002b,
+0x0000000e,0x00000abc,0x0000013b,0x0004001c,
+0x00000abd,0x0000000e,0x00000abc,0x0004002b,
+0x0000000e,0x00000abe,0x000000d8,0x0004002b,
+0x0000000e,0x00000abf,0x00000047,0x0004002b,
+0x0000000e,0x00000ac0,0x000000b8,0x0004002b,
+0x0000000e,0x00000ac1,0x000000ec,0x0004002b,
+0x0000000e,0x00000ac2,0x000000fc,0x0004002b,
+0x0000000e,0x00000ac3,0x00000057,0x0004002b,
+0x0000000e,0x00000ac4,0x000000a8,0x013e002c,
+0x00000abd,0x00000ac5,0x000000cb,0x000000cb,
+0x000000cb,0x000000cb,0x000000cb,0x000000cb,
+0x000006ab,0x000007fc,0x00000a50,0x0000084d,
+0x00000a1d,0x00000a56,0x00000a57,0x00000a01,
+0x00000a02,0x000000cb,0x000006ab,0x00000a2f,
+0x00000a30,0x00000806,0x00000a3d,0x00000a21,
+0x00000a22,0x00000804,0x00000a0f,0x00000a46,
+0x00000a47,0x0000005a,0x00000a1c,0x00000a37,
+0x00000a38,0x00000853,0x00000a06,0x000009f5,
+0x000009f6,0x000000cb,0x000006ab,0x0000008a,
+0x000009f8,0x000009fb,0x000009fc,0x000009ff,
+0x00000a00,0x00000399,0x00000a73,0x00000800,
+0x00000abe,0x00000abf,0x00000ac0,0x00000a24,
+0x00000a25,0x00000806,0x00000a3d,0x000007f1,
+0x00000a40,0x00000a44,0x00000a45,0x000009ef,
+0x000009f0,0x00000802,0x00000ac1,0x000007fb,
+0x00000a52,0x00000a56,0x00000a57,0x00000a6f,
+0x00000a70,0x00000854,0x00000a2d,0x000007f8,
+0x00000a79,0x00000a35,0x00000a36,0x00000a3b,
+0x00000a3c,0x000000cb,0x000006ab,0x000005e6,
+0x000009f7,0x0000008a,0x000009f8,0x000009f9,
+0x000009fa,0x0000076f,0x00000a1e,0x00000a21,
+0x00000a22,0x000007be,0x00000a23,0x00000a26,
+0x00000a27,0x0000003d,0x00000ac2,0x00000802,
+0x00000ac1,0x000007fd,0x00000a2e,0x000007f3,
+0x000009db,0x00000a2f,0x00000a30,0x00000a33,
+0x00000a34,0x00000a58,0x00000a59,0x000009e4,
+0x000009e5,0x00000399,0x00000a73,0x00000808,
+0x000009f1,0x000007f5,0x00000a05,0x00000853,
+0x00000a06,0x00000abf,0x00000ac0,0x00000ac3,
+0x00000ac4,0x00000a0b,0x00000a0c,0x00000a0d,
+0x00000a0e,0x0000080e,0x00000a5b,0x000007f4,
+0x00000a5d,0x00000850,0x00000a77,0x000007f8,
+0x00000a79,0x00000a7c,0x00000a7d,0x00000a80,
+0x00000a81,0x00000a84,0x00000a85,0x00000a88,
+0x00000a89,0x00000806,0x00000a3d,0x00000856,
+0x00000a3e,0x000007f1,0x00000a40,0x00000801,
+0x00000a43,0x000009ed,0x000009ee,0x00000a67,
+0x00000a68,0x00000a6d,0x00000a6e,0x00000a71,
+0x00000a72,0x000000cb,0x000006ab,0x000000dc,
+0x00000a1a,0x000005e6,0x000009f7,0x000007bb,
+0x00000a1b,0x0000008a,0x000009f8,0x0000005a,
+0x00000a1c,0x000009f9,0x000009fa,0x0000084d,
+0x00000a1d,0x0000076f,0x00000a1e,0x00000a1f,
+0x00000a20,0x00000a21,0x00000a22,0x000009f3,
+0x000009f4,0x000007be,0x00000a23,0x00000a24,
+0x00000a25,0x00000a26,0x00000a27,0x000007ec,
+0x00000a28,0x00000084,0x00000a5a,0x0000080e,
+0x00000a5b,0x000007f6,0x00000a5c,0x000007f4,
+0x00000a5d,0x0000080b,0x000009e6,0x00000809,
+0x00000a5e,0x0000084f,0x00000a5f,0x00000852,
+0x00000a60,0x000009fb,0x000009fc,0x00000a61,
+0x00000a62,0x000009fd,0x000009fe,0x00000a65,
+0x00000a66,0x000009ff,0x00000a00,0x00000a6b,
+0x00000a6c,0x00000a01,0x00000a02,0x000009f5,
+0x000009f6,0x0000003d,0x00000ac2,0x000007fa,
+0x000009eb,0x00000802,0x00000ac1,0x00000804,
+0x00000a0f,0x000007fd,0x00000a2e,0x00000a10,
+0x00000a11,0x000007f3,0x000009db,0x00000a12,
+0x00000a13,0x00000a2f,0x00000a30,0x00000a31,
+0x00000a32,0x00000a33,0x00000a34,0x00000a35,
+0x00000a36,0x000009e9,0x000009ea,0x00000a37,
+0x00000a38,0x00000a39,0x00000a3a,0x00000a3b,
+0x00000a3c,0x000000e0,0x00000a4c,0x000006e0,
+0x00000a4d,0x00000a4e,0x00000a4f,0x000007fc,
+0x00000a50,0x00000805,0x00000a51,0x00000803,
+0x000009ec,0x000007fb,0x00000a52,0x00000851,
+0x00000a53,0x00000a54,0x00000a55,0x00000a14,
+0x00000a15,0x00000a56,0x00000a57,0x000009e1,
+0x000009e2,0x00000a58,0x00000a59,0x00000a16,
+0x00000a17,0x000009e4,0x000009e5,0x00000a18,
+0x00000a19,0x00000399,0x00000a73,0x0000084e,
+0x00000a74,0x00000808,0x000009f1,0x0000080a,
+0x00000a75,0x000007f5,0x00000a05,0x000007f7,
+0x000009e3,0x00000853,0x00000a06,0x00000a7a,
+0x00000a7b,0x00000a07,0x00000a08,0x00000a44,
+0x00000a45,0x00000a09,0x00000a0a,0x00000a46,
+0x00000a47,0x000009dc,0x000009dd,0x000009ef,
+0x000009f0,0x00000a48,0x00000a49,0x00000a4a,
+0x00000a4b,0x0009002c,0x00000887,0x00000ac6,
+0x000000cb,0x00000034,0x0000056d,0x000007fd,
+0x00000a31,0x00000a59,0x00040020,0x00000acf,
+0x00000007,0x00000abd,0x0004001c,0x00000ae8,
+0x0000000e,0x000000dc,0x000b002c,0x00000ae8,
+0x00000ae9,0x000006ab,0x00000a63,0x00000805,
+0x000007f6,0x000000dc,0x000000e0,0x000000e9,
+0x00000084,0x00040020,0x00000aec,0x00000007,
+0x00000ae8,0x000b002c,0x00000ae8,0x00000af2,
+0x000000dc,0x000000dc,0x00000084,0x000000dc,
+0x000000e9,0x000000e0,0x00000399,0x000000dc,
+0x0004001c,0x00000b0e,0x00000016,0x000000e9,
+0x0004001c,0x00000b0f,0x00000b0e,0x000000e0,
+0x00040020,0x00000b10,0x00000007,0x00000b0f,
+0x00040020,0x00000b29,0x00000007,0x00000553,
+0x00040020,0x00000b2b,0x00000009,0x00000553,
+0x0004002b,0x0000000e,0x00000b51,0x000003ff,
+0x0004001c,0x00000b5b,0x0000009b,0x000005e6,
+0x0003002a,0x0000009b,0x00000b5c,0x00030029,
+0x0000009b,0x00000b5d,0x0013002c,0x00000b5b,
+0x00000b5e,0x00000b5c,0x00000b5c,0x00000b5d,
+0x00000b5d,0x00000b5c,0x00000b5c,0x00000b5c,
+0x00000b5d,0x00000b5c,0x00000b5c,0x00000b5c,
+0x00000b5d,0x00000b5c,0x00000b5c,0x00000b5d,
+0x00000b5d,0x00040020,0x00000b62,0x00000007,
+0x00000b5b,0x00040020,0x00000b64,0x00000007,
+0x0000009b,0x00040017,0x00000c50,0x0000000e,
+0x00000003,0x00040020,0x00000c51,0x00000001,
+0x00000c50,0x0004003b,0x00000c51,0x00000c52,
+0x00000001,0x00090019,0x00000c5d,0x0000000e,
+0x00000000,0x00000000,0x00000001,0x00000000,
+0x00000002,0x0000001e,0x00040020,0x00000c5e,
+0x00000000,0x00000c5d,0x0004003b,0x00000c5e,
+0x00000c5f,0x00000000,0x00090019,0x00000c89,
+0x0000000e,0x00000000,0x00000000,0x00000001,
+0x00000000,0x00000002,0x00000020,0x00040020,
+0x00000c8a,0x00000000,0x00000c89,0x0004003b,
+0x00000c8a,0x00000c8b,0x00000000,0x0006002c,
+0x00000c50,0x00000cae,0x000000dc,0x000000dc,
+0x00000084,0x0004002b,0x00000006,0x00000caf,
+0x00000013,0x00050036,0x00000002,0x00000004,
+0x00000000,0x00000003,0x000200f8,0x00000005,
+0x0004003b,0x00000008,0x00000c4f,0x00000007,
+0x0004003b,0x00000017,0x00000c5c,0x00000007,
+0x0004003b,0x00000008,0x00000c61,0x00000007,
+0x0004003b,0x00000698,0x00000c73,0x00000007,
+0x0004003b,0x0000000f,0x00000c76,0x00000007,
+0x0004003b,0x0000000f,0x00000c7f,0x00000007,
+0x0004003b,0x00000008,0x00000ca0,0x00000007,
+0x0004003d,0x00000c50,0x00000c53,0x00000c52,
+0x0004007c,0x00000007,0x00000c54,0x00000c53,
+0x0003003e,0x00000c4f,0x00000c54,0x00050041,
+0x00000557,0x00000c55,0x00000556,0x00000090,
+0x0004003d,0x0000000e,0x00000c56,0x00000c55,
+0x0004007c,0x00000006,0x00000c57,0x00000c56,
+0x00050041,0x00000010,0x00000c58,0x00000c4f,
+0x000000e9,0x0004003d,0x00000006,0x00000c59,
+0x00000c58,0x00050080,0x00000006,0x00000c5a,
+0x00000c59,0x00000c57,0x00050041,0x00000010,
+0x00000c5b,0x00000c4f,0x000000e9,0x0003003e,
+0x00000c5b,0x00000c5a,0x0004003d,0x00000c5d,
+0x00000c60,0x00000c5f,0x0004003d,0x00000007,
+0x00000c62,0x00000c4f,0x0003003e,0x00000c61,
+0x00000c62,0x00050039,0x00000009,0x00000c63,
+0x0000000c,0x00000c61,0x00050062,0x00000016,
+0x00000c64,0x00000c60,0x00000c63,0x00050051,
+0x0000000e,0x00000c65,0x00000c64,0x00000000,
+0x00050051,0x0000000e,0x00000c66,0x00000c64,
+0x00000001,0x00050051,0x0000000e,0x00000c67,
+0x00000c64,0x00000002,0x00050051,0x0000000e,
+0x00000c68,0x00000c64,0x00000003,0x00070050,
+0x00000016,0x00000c69,0x00000c65,0x00000c66,
+0x00000c67,0x00000c68,0x0003003e,0x00000c5c,
+0x00000c69,0x00050041,0x0000000f,0x00000c6a,
+0x00000c5c,0x0000003d,0x0004003d,0x0000000e,
+0x00000c6b,0x00000c6a,0x00050041,0x0000000f,
+0x00000c6c,0x00000c5c,0x000000e9,0x0004003d,
+0x0000000e,0x00000c6d,0x00000c6c,0x00050041,
+0x0000000f,0x00000c6e,0x00000c5c,0x00000084,
+0x0004003d,0x0000000e,0x00000c6f,0x00000c6e,
+0x00050041,0x0000000f,0x00000c70,0x00000c5c,
+0x000000cb,0x0004003d,0x0000000e,0x00000c71,
+0x00000c70,0x00070050,0x00000016,0x00000c72,
+0x00000c6b,0x00000c6d,0x00000c6f,0x00000c71,
+0x0003003e,0x00000c5c,0x00000c72,0x0004003d,
+0x00000016,0x00000c74,0x00000c5c,0x00050039,
+0x0000006e,0x00000c75,0x00000078,0x00000c74,
+0x0003003e,0x00000c73,0x00000c75,0x0003003e,
+0x00000c76,0x000000cb,0x000200f9,0x00000c77,
+0x000200f8,0x00000c77,0x000400f6,0x00000c79,
+0x00000c7a,0x00000000,0x000200f9,0x00000c7b,
+0x000200f8,0x00000c7b,0x0004003d,0x0000000e,
+0x00000c7c,0x00000c76,0x00040039,0x0000000e,
+0x00000c7d,0x0000007b,0x000500b0,0x0000009b,
+0x00000c7e,0x00000c7c,0x00000c7d,0x000400fa,
+0x00000c7e,0x00000c78,0x00000c79,0x000200f8,
+0x00000c78,0x0003003e,0x00000c7f,0x000000cb,
+0x000200f9,0x00000c80,0x000200f8,0x00000c80,
+0x000400f6,0x00000c82,0x00000c83,0x00000000,
+0x000200f9,0x00000c84,0x000200f8,0x00000c84,
+0x0004003d,0x0000000e,0x00000c85,0x00000c7f,
+0x00060041,0x00000557,0x00000c86,0x00000556,
+0x0000010b,0x000000cb,0x0004003d,0x0000000e,
+0x00000c87,0x00000c86,0x000500b0,0x0000009b,
+0x00000c88,0x00000c85,0x00000c87,0x000400fa,
+0x00000c88,0x00000c81,0x00000c82,0x000200f8,
+0x00000c81,0x0004003d,0x00000c89,0x00000c8c,
+0x00000c8b,0x0004003d,0x00000007,0x00000c8d,
+0x00000c4f,0x0007004f,0x00000009,0x00000c8e,
+0x00000c8d,0x00000c8d,0x00000000,0x00000001,
+0x0004007c,0x00000553,0x00000c8f,0x00000c8e,
+0x00050041,0x00000b2b,0x00000c90,0x00000556,
+0x0000010b,0x0004003d,0x00000553,0x00000c91,
+0x00000c90,0x00050084,0x00000553,0x00000c92,
+0x00000c8f,0x00000c91,0x0004003d,0x0000000e,
+0x00000c93,0x00000c7f,0x0004007c,0x00000006,
+0x00000c94,0x00000c93,0x0004003d,0x0000000e,
+0x00000c95,0x00000c76,0x0004007c,0x00000006,
+0x00000c96,0x00000c95,0x00050050,0x00000009,
+0x00000c97,0x00000c94,0x00000c96,0x0004007c,
+0x00000553,0x00000c98,0x00000c97,0x00050080,
+0x00000553,0x00000c99,0x00000c92,0x00000c98,
+0x0004007c,0x00000009,0x00000c9a,0x00000c99,
+0x00050041,0x00000010,0x00000c9b,0x00000c4f,
+0x000000e9,0x0004003d,0x00000006,0x00000c9c,
+0x00000c9b,0x00050051,0x00000006,0x00000c9d,
+0x00000c9a,0x00000000,0x00050051,0x00000006,
+0x00000c9e,0x00000c9a,0x00000001,0x00060050,
+0x00000007,0x00000c9f,0x00000c9d,0x00000c9e,
+0x00000c9c,0x0003003e,0x00000ca0,0x00000c9f,
+0x00050039,0x00000009,0x00000ca1,0x0000000c,
+0x00000ca0,0x0004003d,0x0000000e,0x00000ca2,
+0x00000c76,0x00060041,0x00000557,0x00000ca3,
+0x00000556,0x0000010b,0x000000cb,0x0004003d,
+0x0000000e,0x00000ca4,0x00000ca3,0x00050084,
+0x0000000e,0x00000ca5,0x00000ca2,0x00000ca4,
+0x0004003d,0x0000000e,0x00000ca6,0x00000c7f,
+0x00050080,0x0000000e,0x00000ca7,0x00000ca5,
+0x00000ca6,0x00050041,0x00000017,0x00000ca8,
+0x00000c73,0x00000ca7,0x0004003d,0x00000016,
+0x00000ca9,0x00000ca8,0x00040063,0x00000c8c,
+0x00000ca1,0x00000ca9,0x000200f9,0x00000c83,
+0x000200f8,0x00000c83,0x0004003d,0x0000000e,
+0x00000caa,0x00000c7f,0x00050080,0x0000000e,
+0x00000cab,0x00000caa,0x00000090,0x0003003e,
+0x00000c7f,0x00000cab,0x000200f9,0x00000c80,
+0x000200f8,0x00000c82,0x000200f9,0x00000c7a,
+0x000200f8,0x00000c7a,0x0004003d,0x0000000e,
+0x00000cac,0x00000c76,0x00050080,0x0000000e,
+0x00000cad,0x00000cac,0x00000090,0x0003003e,
+0x00000c76,0x00000cad,0x000200f9,0x00000c77,
+0x000200f8,0x00000c79,0x000100fd,0x00010038,
+0x00050036,0x00000009,0x0000000c,0x00000000,
+0x0000000a,0x00030037,0x00000008,0x0000000b,
+0x000200f8,0x0000000d,0x0004003d,0x00000007,
+0x0000007d,0x0000000b,0x0007004f,0x00000009,
+0x0000007e,0x0000007d,0x0000007d,0x00000000,
+0x00000002,0x000200fe,0x0000007e,0x00010038,
+0x00050036,0x0000000e,0x00000014,0x00000000,
+0x00000011,0x00030037,0x0000000f,0x00000012,
+0x00030037,0x00000010,0x00000013,0x000200f8,
+0x00000015,0x0004003d,0x0000000e,0x00000081,
+0x00000012,0x0004003d,0x00000006,0x00000082,
+0x00000013,0x000500c2,0x0000000e,0x00000083,
+0x00000081,0x00000082,0x000500c7,0x0000000e,
+0x00000085,0x00000083,0x00000084,0x000200fe,
+0x00000085,0x00010038,0x00050036,0x0000000e,
+0x0000001c,0x00000000,0x00000018,0x00030037,
+0x00000017,0x00000019,0x00030037,0x0000000f,
+0x0000001a,0x00030037,0x0000000f,0x0000001b,
+0x000200f8,0x0000001d,0x0004003b,0x0000000f,
+0x00000088,0x00000007,0x0004003b,0x0000000f,
+0x0000008c,0x00000007,0x0004003b,0x0000000f,
+0x0000008f,0x00000007,0x0004003b,0x0000000f,
+0x000000a9,0x00000007,0x0004003b,0x0000000f,
+0x000000ac,0x00000007,0x0004003d,0x0000000e,
+0x00000089,0x0000001a,0x00050086,0x0000000e,
+0x0000008b,0x00000089,0x0000008a,0x0003003e,
+0x00000088,0x0000008b,0x0004003d,0x0000000e,
+0x0000008d,0x0000001a,0x00050089,0x0000000e,
+0x0000008e,0x0000008d,0x0000008a,0x0003003e,
+0x0000008c,0x0000008e,0x0004003d,0x0000000e,
+0x00000091,0x0000001b,0x000500c4,0x00000006,
+0x00000092,0x00000090,0x00000091,0x00050082,
+0x00000006,0x00000093,0x00000092,0x00000090,
+0x0004007c,0x0000000e,0x00000094,0x00000093,
+0x0003003e,0x0000008f,0x00000094,0x0004003d,
+0x0000000e,0x00000095,0x00000088,0x0004003d,
+0x0000000e,0x00000096,0x0000001a,0x0004003d,
+0x0000000e,0x00000097,0x0000001b,0x00050080,
+0x0000000e,0x00000098,0x00000096,0x00000097,
+0x00050082,0x0000000e,0x00000099,0x00000098,
+0x00000084,0x00050086,0x0000000e,0x0000009a,
+0x00000099,0x0000008a,0x000500aa,0x0000009b,
+0x0000009c,0x00000095,0x0000009a,0x000300f7,
+0x0000009e,0x00000000,0x000400fa,0x0000009c,
+0x0000009d,0x000000a8,0x000200f8,0x0000009d,
+0x0004003d,0x0000000e,0x0000009f,0x00000088,
+0x00050082,0x0000000e,0x000000a0,0x0000003d,
+0x0000009f,0x00050041,0x0000000f,0x000000a1,
+0x00000019,0x000000a0,0x0004003d,0x0000000e,
+0x000000a2,0x000000a1,0x0004003d,0x0000000e,
+0x000000a3,0x0000008c,0x000500c2,0x0000000e,
+0x000000a4,0x000000a2,0x000000a3,0x0004003d,
+0x0000000e,0x000000a5,0x0000008f,0x000500c7,
+0x0000000e,0x000000a6,0x000000a4,0x000000a5,
+0x000200fe,0x000000a6,0x000200f8,0x000000a8,
+0x0004003d,0x0000000e,0x000000aa,0x0000008c,
+0x00050082,0x0000000e,0x000000ab,0x0000008a,
+0x000000aa,0x0003003e,0x000000a9,0x000000ab,
+0x0004003d,0x0000000e,0x000000ad,0x00000088,
+0x00050082,0x0000000e,0x000000ae,0x0000003d,
+0x000000ad,0x00050082,0x0000000e,0x000000af,
+0x000000ae,0x00000084,0x00050041,0x0000000f,
+0x000000b0,0x00000019,0x000000af,0x0004003d,
+0x0000000e,0x000000b1,0x000000b0,0x0004003d,
+0x0000000e,0x000000b2,0x000000a9,0x000500c4,
+0x0000000e,0x000000b3,0x000000b1,0x000000b2,
+0x0003003e,0x000000ac,0x000000b3,0x0004003d,
+0x0000000e,0x000000b4,0x00000088,0x00050082,
+0x0000000e,0x000000b5,0x0000003d,0x000000b4,
+0x00050041,0x0000000f,0x000000b6,0x00000019,
+0x000000b5,0x0004003d,0x0000000e,0x000000b7,
+0x000000b6,0x0004003d,0x0000000e,0x000000b8,
+0x0000008c,0x000500c2,0x0000000e,0x000000b9,
+0x000000b7,0x000000b8,0x0004003d,0x0000000e,
+0x000000ba,0x000000a9,0x000500c4,0x00000006,
+0x000000bb,0x00000090,0x000000ba,0x00050082,
+0x00000006,0x000000bc,0x000000bb,0x00000090,
+0x0004007c,0x0000000e,0x000000bd,0x000000bc,
+0x000500c7,0x0000000e,0x000000be,0x000000b9,
+0x000000bd,0x0004003d,0x0000000e,0x000000bf,
+0x000000ac,0x000500c5,0x0000000e,0x000000c0,
+0x000000bf,0x000000be,0x0003003e,0x000000ac,
+0x000000c0,0x0004003d,0x0000000e,0x000000c1,
+0x000000ac,0x0004003d,0x0000000e,0x000000c2,
+0x0000008f,0x000500c7,0x0000000e,0x000000c3,
+0x000000c1,0x000000c2,0x000200fe,0x000000c3,
+0x000200f8,0x0000009e,0x000100ff,0x00010038,
+0x00050036,0x0000000e,0x00000023,0x00000000,
+0x0000001e,0x00030037,0x00000017,0x0000001f,
+0x00030037,0x0000000f,0x00000020,0x00030037,
+0x0000000f,0x00000021,0x00030037,0x0000000f,
+0x00000022,0x000200f8,0x00000024,0x0004003b,
+0x00000017,0x000000d2,0x00000007,0x0004003b,
+0x0000000f,0x000000d4,0x00000007,0x0004003b,
+0x0000000f,0x000000d6,0x00000007,0x0004003d,
+0x0000000e,0x000000c6,0x00000021,0x0004003d,
+0x0000000e,0x000000c7,0x00000020,0x000500b2,
+0x0000009b,0x000000c8,0x000000c6,0x000000c7,
+0x000300f7,0x000000ca,0x00000000,0x000400fa,
+0x000000c8,0x000000c9,0x000000ca,0x000200f8,
+0x000000c9,0x000200fe,0x000000cb,0x000200f8,
+0x000000ca,0x0004003d,0x0000000e,0x000000cd,
+0x00000021,0x0004003d,0x0000000e,0x000000ce,
+0x00000020,0x00050082,0x0000000e,0x000000cf,
+0x000000cd,0x000000ce,0x0004003d,0x0000000e,
+0x000000d0,0x00000022,0x0007000c,0x0000000e,
+0x000000d1,0x00000001,0x00000026,0x000000cf,
+0x000000d0,0x0004003d,0x00000016,0x000000d3,
+0x0000001f,0x0003003e,0x000000d2,0x000000d3,
+0x0004003d,0x0000000e,0x000000d5,0x00000020,
+0x0003003e,0x000000d4,0x000000d5,0x0003003e,
+0x000000d6,0x000000d1,0x00070039,0x0000000e,
+0x000000d7,0x0000001c,0x000000d2,0x000000d4,
+0x000000d6,0x000200fe,0x000000d7,0x00010038,
+0x00050036,0x0000000e,0x0000002a,0x00000000,
+0x00000025,0x00030037,0x0000000f,0x00000026,
+0x00030037,0x0000000f,0x00000027,0x00030037,
+0x0000000f,0x00000028,0x00030037,0x0000000f,
+0x00000029,0x000200f8,0x0000002b,0x0004003b,
+0x0000000f,0x000000da,0x00000007,0x0004003b,
+0x0000000f,0x000000e3,0x00000007,0x0004003b,
+0x0000000f,0x000000ec,0x00000007,0x0004003d,
+0x0000000e,0x000000db,0x00000026,0x00050084,
+0x0000000e,0x000000dd,0x000000db,0x000000dc,
+0x0004003d,0x0000000e,0x000000de,0x00000027,
+0x00050084,0x0000000e,0x000000df,0x000000dd,
+0x000000de,0x00050080,0x0000000e,0x000000e1,
+0x000000df,0x000000e0,0x00050086,0x0000000e,
+0x000000e2,0x000000e1,0x00000034,0x0003003e,
+0x000000da,0x000000e2,0x0004003d,0x0000000e,
+0x000000e4,0x00000026,0x00050084,0x0000000e,
+0x000000e6,0x000000e4,0x000000e5,0x0004003d,
+0x0000000e,0x000000e7,0x00000028,0x00050084,
+0x0000000e,0x000000e8,0x000000e6,0x000000e7,
+0x00050080,0x0000000e,0x000000ea,0x000000e8,
+0x000000e9,0x00050086,0x0000000e,0x000000eb,
+0x000000ea,0x0000003d,0x0003003e,0x000000e3,
+0x000000eb,0x0004003d,0x0000000e,0x000000ed,
+0x00000026,0x0004003d,0x0000000e,0x000000ee,
+0x00000029,0x00050084,0x0000000e,0x000000ef,
+0x000000ed,0x000000ee,0x0003003e,0x000000ec,
+0x000000ef,0x0004003d,0x0000000e,0x000000f0,
+0x000000da,0x0004003d,0x0000000e,0x000000f1,
+0x000000e3,0x00050080,0x0000000e,0x000000f2,
+0x000000f0,0x000000f1,0x0004003d,0x0000000e,
+0x000000f3,0x000000ec,0x00050080,0x0000000e,
+0x000000f4,0x000000f2,0x000000f3,0x000200fe,
+0x000000f4,0x00010038,0x00050036,0x00000002,
+0x00000032,0x00000000,0x0000002c,0x00030037,
+0x0000000f,0x0000002d,0x00030037,0x0000000f,
+0x0000002e,0x00030037,0x0000000f,0x0000002f,
+0x00030037,0x0000000f,0x00000030,0x00030037,
+0x0000000f,0x00000031,0x000200f8,0x00000033,
+0x0004003d,0x0000000e,0x000000f7,0x0000002d,
+0x000500aa,0x0000009b,0x000000f8,0x000000f7,
+0x00000084,0x000300f7,0x000000fa,0x00000000,
+0x000400fa,0x000000f8,0x000000f9,0x000000fe,
+0x000200f8,0x000000f9,0x0003003e,0x00000030,
+0x00000034,0x0004003d,0x0000000e,0x000000fb,
+0x0000002f,0x00050084,0x0000000e,0x000000fc,
+0x00000034,0x000000fb,0x00050080,0x0000000e,
+0x000000fd,0x000000dc,0x000000fc,0x0003003e,
+0x00000031,0x000000fd,0x000200f9,0x000000fa,
+0x000200f8,0x000000fe,0x0004003d,0x0000000e,
+0x000000ff,0x0000002e,0x000500aa,0x0000009b,
+0x00000100,0x000000ff,0x00000084,0x000300f7,
+0x00000102,0x00000000,0x000400fa,0x00000100,
+0x00000101,0x00000106,0x000200f8,0x00000101,
+0x0003003e,0x00000030,0x0000003d,0x0004003d,
+0x0000000e,0x00000103,0x0000002f,0x00050084,
+0x0000000e,0x00000104,0x0000003d,0x00000103,
+0x00050080,0x0000000e,0x00000105,0x000000e5,
+0x00000104,0x0003003e,0x00000031,0x00000105,
+0x000200f9,0x00000102,0x000200f8,0x00000106,
+0x0003003e,0x00000030,0x00000084,0x0004003d,
+0x0000000e,0x00000107,0x0000002f,0x0003003e,
+0x00000031,0x00000107,0x000200f9,0x00000102,
+0x000200f8,0x00000102,0x000200f9,0x000000fa,
+0x000200f8,0x000000fa,0x000100fd,0x00010038,
+0x00050036,0x00000035,0x0000003b,0x00000000,
+0x00000036,0x00030037,0x00000017,0x00000037,
+0x00030037,0x0000000f,0x00000038,0x00030037,
+0x0000000f,0x00000039,0x00030037,0x0000000f,
+0x0000003a,0x000200f8,0x0000003c,0x0004003b,
+0x0000000f,0x00000108,0x00000007,0x0004003b,
+0x0000000f,0x00000109,0x00000007,0x0004003b,
+0x00000010,0x0000010a,0x00000007,0x0004003b,
+0x00000114,0x00000115,0x00000007,0x0004003b,
+0x00000017,0x00000117,0x00000007,0x0004003b,
+0x0000000f,0x00000119,0x00000007,0x0004003b,
+0x0000000f,0x0000011b,0x00000007,0x0004003b,
+0x0000000f,0x0000011d,0x00000007,0x0004003b,
+0x0000000f,0x00000124,0x00000007,0x0004003b,
+0x00000129,0x0000012a,0x00000007,0x0004003b,
+0x00000017,0x0000012e,0x00000007,0x0004003b,
+0x0000000f,0x00000130,0x00000007,0x0004003b,
+0x0000000f,0x00000132,0x00000007,0x0004003b,
+0x0000000f,0x00000134,0x00000007,0x0004003b,
+0x00000129,0x00000137,0x00000007,0x0004003b,
+0x00000129,0x00000143,0x00000007,0x0004003b,
+0x00000010,0x0000014b,0x00000007,0x0004003b,
+0x00000114,0x00000153,0x00000007,0x0004003b,
+0x0000024d,0x0000024e,0x00000007,0x0003003e,
+0x00000108,0x000000cb,0x0003003e,0x00000109,
+0x000000cb,0x0003003e,0x0000010a,0x0000010b,
+0x000200f9,0x0000010c,0x000200f8,0x0000010c,
+0x000400f6,0x0000010e,0x0000010f,0x00000000,
+0x000200f9,0x00000110,0x000200f8,0x00000110,
+0x0004003d,0x00000006,0x00000111,0x0000010a,
+0x000500b1,0x0000009b,0x00000113,0x00000111,
+0x00000112,0x000400fa,0x00000113,0x0000010d,
+0x0000010e,0x000200f8,0x0000010d,0x0004003d,
+0x00000006,0x00000116,0x0000010a,0x0004003d,
+0x00000016,0x00000118,0x00000037,0x0003003e,
+0x00000117,0x00000118,0x0004003d,0x0000000e,
+0x0000011a,0x00000038,0x0003003e,0x00000119,
+0x0000011a,0x0004003d,0x0000000e,0x0000011c,
+0x00000039,0x0003003e,0x0000011b,0x0000011c,
+0x0004003d,0x0000000e,0x0000011e,0x0000003a,
+0x0003003e,0x0000011d,0x0000011e,0x00080039,
+0x0000000e,0x0000011f,0x00000023,0x00000117,
+0x00000119,0x0000011b,0x0000011d,0x00050041,
+0x0000000f,0x00000120,0x00000115,0x00000116,
+0x0003003e,0x00000120,0x0000011f,0x0004003d,
+0x0000000e,0x00000121,0x0000003a,0x0004003d,
+0x0000000e,0x00000122,0x00000038,0x00050080,
+0x0000000e,0x00000123,0x00000122,0x00000121,
+0x0003003e,0x00000038,0x00000123,0x0004003d,
+0x00000006,0x00000128,0x0000010a,0x0003003e,
+0x0000012a,0x00000127,0x00050041,0x00000010,
+0x0000012b,0x0000012a,0x00000128,0x0004003d,
+0x00000006,0x0000012c,0x0000012b,0x0004007c,
+0x0000000e,0x0000012d,0x0000012c,0x0004003d,
+0x00000016,0x0000012f,0x00000037,0x0003003e,
+0x0000012e,0x0000012f,0x0004003d,0x0000000e,
+0x00000131,0x00000038,0x0003003e,0x00000130,
+0x00000131,0x0004003d,0x0000000e,0x00000133,
+0x00000039,0x0003003e,0x00000132,0x00000133,
+0x0003003e,0x00000134,0x0000012d,0x00080039,
+0x0000000e,0x00000135,0x00000023,0x0000012e,
+0x00000130,0x00000132,0x00000134,0x0003003e,
+0x00000124,0x00000135,0x0004003d,0x00000006,
+0x00000136,0x0000010a,0x0003003e,0x00000137,
+0x00000127,0x00050041,0x00000010,0x00000138,
+0x00000137,0x00000136,0x0004003d,0x00000006,
+0x00000139,0x00000138,0x0004007c,0x0000000e,
+0x0000013a,0x00000139,0x0004003d,0x0000000e,
+0x0000013b,0x00000038,0x00050080,0x0000000e,
+0x0000013c,0x0000013b,0x0000013a,0x0003003e,
+0x00000038,0x0000013c,0x0004003d,0x0000000e,
+0x0000013d,0x00000124,0x0004003d,0x0000000e,
+0x0000013e,0x00000109,0x000500c4,0x0000000e,
+0x0000013f,0x0000013d,0x0000013e,0x0004003d,
+0x0000000e,0x00000140,0x00000108,0x000500c5,
+0x0000000e,0x00000141,0x00000140,0x0000013f,
+0x0003003e,0x00000108,0x00000141,0x0004003d,
+0x00000006,0x00000142,0x0000010a,0x0003003e,
+0x00000143,0x00000127,0x00050041,0x00000010,
+0x00000144,0x00000143,0x00000142,0x0004003d,
+0x00000006,0x00000145,0x00000144,0x0004007c,
+0x0000000e,0x00000146,0x00000145,0x0004003d,
+0x0000000e,0x00000147,0x00000109,0x00050080,
+0x0000000e,0x00000148,0x00000147,0x00000146,
+0x0003003e,0x00000109,0x00000148,0x000200f9,
+0x0000010f,0x000200f8,0x0000010f,0x0004003d,
+0x00000006,0x00000149,0x0000010a,0x00050080,
+0x00000006,0x0000014a,0x00000149,0x00000090,
+0x0003003e,0x0000010a,0x0000014a,0x000200f9,
+0x0000010c,0x000200f8,0x0000010e,0x0003003e,
+0x0000014b,0x0000010b,0x000200f9,0x0000014c,
+0x000200f8,0x0000014c,0x000400f6,0x0000014e,
+0x0000014f,0x00000000,0x000200f9,0x00000150,
+0x000200f8,0x00000150,0x0004003d,0x00000006,
+0x00000151,0x0000014b,0x000500b1,0x0000009b,
+0x00000152,0x00000151,0x00000112,0x000400fa,
+0x00000152,0x0000014d,0x0000014e,0x000200f8,
+0x0000014d,0x0004003d,0x00000006,0x00000154,
+0x0000014b,0x0004003d,0x0000000e,0x0000024b,
+0x00000108,0x0004003d,0x00000006,0x0000024c,
+0x0000014b,0x0003003e,0x0000024e,0x0000024a,
+0x00060041,0x0000000f,0x0000024f,0x0000024e,
+0x0000024b,0x0000024c,0x0004003d,0x0000000e,
+0x00000250,0x0000024f,0x0004003d,0x0000000e,
+0x00000251,0x0000003a,0x000500c4,0x0000000e,
+0x00000252,0x00000250,0x00000251,0x0004003d,
+0x00000006,0x00000253,0x0000014b,0x00050041,
+0x0000000f,0x00000254,0x00000115,0x00000253,
+0x0004003d,0x0000000e,0x00000255,0x00000254,
+0x000500c5,0x0000000e,0x00000256,0x00000252,
+0x00000255,0x00050041,0x0000000f,0x00000257,
+0x00000153,0x00000154,0x0003003e,0x00000257,
+0x00000256,0x000200f9,0x0000014f,0x000200f8,
+0x0000014f,0x0004003d,0x00000006,0x00000258,
+0x0000014b,0x00050080,0x00000006,0x00000259,
+0x00000258,0x00000090,0x0003003e,0x0000014b,
+0x00000259,0x000200f9,0x0000014c,0x000200f8,
+0x0000014e,0x0004003d,0x00000035,0x0000025a,
+0x00000153,0x000200fe,0x0000025a,0x00010038,
+0x00050036,0x0000003e,0x00000044,0x00000000,
+0x0000003f,0x00030037,0x00000017,0x00000040,
+0x00030037,0x0000000f,0x00000041,0x00030037,
+0x0000000f,0x00000042,0x00030037,0x0000000f,
+0x00000043,0x000200f8,0x00000045,0x0004003b,
+0x0000000f,0x0000025d,0x00000007,0x0004003b,
+0x0000000f,0x0000025e,0x00000007,0x0004003b,
+0x0000000f,0x0000025f,0x00000007,0x0004003b,
+0x00000010,0x00000264,0x00000007,0x0004003b,
+0x0000026d,0x0000026e,0x00000007,0x0004003b,
+0x00000017,0x00000270,0x00000007,0x0004003b,
+0x0000000f,0x00000272,0x00000007,0x0004003b,
+0x0000000f,0x00000274,0x00000007,0x0004003b,
+0x0000000f,0x00000276,0x00000007,0x0004003b,
+0x0000000f,0x0000027d,0x00000007,0x0004003b,
+0x00000281,0x00000282,0x00000007,0x0004003b,
+0x00000017,0x00000286,0x00000007,0x0004003b,
+0x0000000f,0x00000288,0x00000007,0x0004003b,
+0x0000000f,0x0000028a,0x00000007,0x0004003b,
+0x0000000f,0x0000028c,0x00000007,0x0004003b,
+0x00000281,0x0000028f,0x00000007,0x0004003b,
+0x00000281,0x0000029b,0x00000007,0x0004003b,
+0x00000010,0x000002a3,0x00000007,0x0004003b,
+0x0000026d,0x000002ab,0x00000007,0x0004003b,
+0x0000032f,0x00000330,0x00000007,0x0003003e,
+0x0000025d,0x000000cb,0x0003003e,0x0000025e,
+0x000000cb,0x0004003d,0x0000000e,0x00000260,
+0x00000043,0x000500c4,0x00000006,0x00000261,
+0x00000090,0x00000260,0x00050082,0x00000006,
+0x00000262,0x00000261,0x00000090,0x0004007c,
+0x0000000e,0x00000263,0x00000262,0x0003003e,
+0x0000025f,0x00000263,0x0003003e,0x00000264,
+0x0000010b,0x000200f9,0x00000265,0x000200f8,
+0x00000265,0x000400f6,0x00000267,0x00000268,
+0x00000000,0x000200f9,0x00000269,0x000200f8,
+0x00000269,0x0004003d,0x00000006,0x0000026a,
+0x00000264,0x000500b1,0x0000009b,0x0000026c,
+0x0000026a,0x0000026b,0x000400fa,0x0000026c,
+0x00000266,0x00000267,0x000200f8,0x00000266,
+0x0004003d,0x00000006,0x0000026f,0x00000264,
+0x0004003d,0x00000016,0x00000271,0x00000040,
+0x0003003e,0x00000270,0x00000271,0x0004003d,
+0x0000000e,0x00000273,0x00000041,0x0003003e,
+0x00000272,0x00000273,0x0004003d,0x0000000e,
+0x00000275,0x00000042,0x0003003e,0x00000274,
+0x00000275,0x0004003d,0x0000000e,0x00000277,
+0x00000043,0x0003003e,0x00000276,0x00000277,
+0x00080039,0x0000000e,0x00000278,0x00000023,
+0x00000270,0x00000272,0x00000274,0x00000276,
+0x00050041,0x0000000f,0x00000279,0x0000026e,
+0x0000026f,0x0003003e,0x00000279,0x00000278,
+0x0004003d,0x0000000e,0x0000027a,0x00000043,
+0x0004003d,0x0000000e,0x0000027b,0x00000041,
+0x00050080,0x0000000e,0x0000027c,0x0000027b,
+0x0000027a,0x0003003e,0x00000041,0x0000027c,
+0x0004003d,0x00000006,0x00000280,0x00000264,
+0x0003003e,0x00000282,0x0000027f,0x00050041,
+0x00000010,0x00000283,0x00000282,0x00000280,
+0x0004003d,0x00000006,0x00000284,0x00000283,
+0x0004007c,0x0000000e,0x00000285,0x00000284,
+0x0004003d,0x00000016,0x00000287,0x00000040,
+0x0003003e,0x00000286,0x00000287,0x0004003d,
+0x0000000e,0x00000289,0x00000041,0x0003003e,
+0x00000288,0x00000289,0x0004003d,0x0000000e,
+0x0000028b,0x00000042,0x0003003e,0x0000028a,
+0x0000028b,0x0003003e,0x0000028c,0x00000285,
+0x00080039,0x0000000e,0x0000028d,0x00000023,
+0x00000286,0x00000288,0x0000028a,0x0000028c,
+0x0003003e,0x0000027d,0x0000028d,0x0004003d,
+0x00000006,0x0000028e,0x00000264,0x0003003e,
+0x0000028f,0x0000027f,0x00050041,0x00000010,
+0x00000290,0x0000028f,0x0000028e,0x0004003d,
+0x00000006,0x00000291,0x00000290,0x0004007c,
+0x0000000e,0x00000292,0x00000291,0x0004003d,
+0x0000000e,0x00000293,0x00000041,0x00050080,
+0x0000000e,0x00000294,0x00000293,0x00000292,
+0x0003003e,0x00000041,0x00000294,0x0004003d,
+0x0000000e,0x00000295,0x0000027d,0x0004003d,
+0x0000000e,0x00000296,0x0000025e,0x000500c4,
+0x0000000e,0x00000297,0x00000295,0x00000296,
+0x0004003d,0x0000000e,0x00000298,0x0000025d,
+0x000500c5,0x0000000e,0x00000299,0x00000298,
+0x00000297,0x0003003e,0x0000025d,0x00000299,
+0x0004003d,0x00000006,0x0000029a,0x00000264,
+0x0003003e,0x0000029b,0x0000027f,0x00050041,
+0x00000010,0x0000029c,0x0000029b,0x0000029a,
+0x0004003d,0x00000006,0x0000029d,0x0000029c,
+0x0004007c,0x0000000e,0x0000029e,0x0000029d,
+0x0004003d,0x0000000e,0x0000029f,0x0000025e,
+0x00050080,0x0000000e,0x000002a0,0x0000029f,
+0x0000029e,0x0003003e,0x0000025e,0x000002a0,
+0x000200f9,0x00000268,0x000200f8,0x00000268,
+0x0004003d,0x00000006,0x000002a1,0x00000264,
+0x00050080,0x00000006,0x000002a2,0x000002a1,
+0x00000090,0x0003003e,0x00000264,0x000002a2,
+0x000200f9,0x00000265,0x000200f8,0x00000267,
+0x0003003e,0x000002a3,0x0000010b,0x000200f9,
+0x000002a4,0x000200f8,0x000002a4,0x000400f6,
+0x000002a6,0x000002a7,0x00000000,0x000200f9,
+0x000002a8,0x000200f8,0x000002a8,0x0004003d,
+0x00000006,0x000002a9,0x000002a3,0x000500b1,
+0x0000009b,0x000002aa,0x000002a9,0x0000026b,
+0x000400fa,0x000002aa,0x000002a5,0x000002a6,
+0x000200f8,0x000002a5,0x0004003d,0x00000006,
+0x000002ac,0x000002a3,0x0004003d,0x0000000e,
+0x0000032d,0x0000025d,0x0004003d,0x00000006,
+0x0000032e,0x000002a3,0x0003003e,0x00000330,
+0x0000032c,0x00060041,0x0000000f,0x00000331,
+0x00000330,0x0000032d,0x0000032e,0x0004003d,
+0x0000000e,0x00000332,0x00000331,0x0004003d,
+0x0000000e,0x00000333,0x00000043,0x000500c4,
+0x0000000e,0x00000334,0x00000332,0x00000333,
+0x0004003d,0x00000006,0x00000335,0x000002a3,
+0x00050041,0x0000000f,0x00000336,0x0000026e,
+0x00000335,0x0004003d,0x0000000e,0x00000337,
+0x00000336,0x000500c5,0x0000000e,0x00000338,
+0x00000334,0x00000337,0x00050041,0x0000000f,
+0x00000339,0x000002ab,0x000002ac,0x0003003e,
+0x00000339,0x00000338,0x000200f9,0x000002a7,
+0x000200f8,0x000002a7,0x0004003d,0x00000006,
+0x0000033a,0x000002a3,0x00050080,0x00000006,
+0x0000033b,0x0000033a,0x00000090,0x0003003e,
+0x000002a3,0x0000033b,0x000200f9,0x000002a4,
+0x000200f8,0x000002a6,0x0004003d,0x0000003e,
+0x0000033c,0x000002ab,0x000200fe,0x0000033c,
+0x00010038,0x00050036,0x0000000e,0x00000048,
+0x00000000,0x00000046,0x00030037,0x0000000f,
+0x00000047,0x000200f8,0x00000049,0x0004003d,
+0x0000000e,0x0000033f,0x00000047,0x00050086,
+0x0000000e,0x00000340,0x0000033f,0x000000e0,
+0x00050080,0x0000000e,0x00000341,0x00000340,
+0x00000084,0x00050084,0x0000000e,0x00000342,
+0x00000341,0x000000e9,0x000200fe,0x00000342,
+0x00010038,0x00050036,0x00000002,0x0000004f,
+0x00000000,0x0000004c,0x00030037,0x0000004b,
+0x0000004d,0x00030037,0x0000004b,0x0000004e,
+0x000200f8,0x00000050,0x0004003b,0x0000004b,
+0x00000345,0x00000007,0x0004003d,0x0000004a,
+0x00000346,0x0000004d,0x0003003e,0x00000345,
+0x00000346,0x0004003d,0x0000004a,0x00000347,
+0x0000004e,0x0003003e,0x0000004d,0x00000347,
+0x0004003d,0x0000004a,0x00000348,0x00000345,
+0x0003003e,0x0000004e,0x00000348,0x000100fd,
+0x00010038,0x00050036,0x00000002,0x00000054,
+0x00000000,0x00000051,0x00030037,0x00000010,
+0x00000052,0x00030037,0x00000010,0x00000053,
+0x000200f8,0x00000055,0x0004003d,0x00000006,
+0x00000349,0x00000053,0x000500c3,0x00000006,
+0x0000034a,0x00000349,0x00000090,0x0003003e,
+0x00000053,0x0000034a,0x0004003d,0x00000006,
+0x0000034b,0x00000052,0x000500c7,0x00000006,
+0x0000034d,0x0000034b,0x0000034c,0x0004003d,
+0x00000006,0x0000034e,0x00000053,0x000500c5,
+0x00000006,0x0000034f,0x0000034e,0x0000034d,
+0x0003003e,0x00000053,0x0000034f,0x0004003d,
+0x00000006,0x00000350,0x00000052,0x000500c3,
+0x00000006,0x00000351,0x00000350,0x00000090,
+0x0003003e,0x00000052,0x00000351,0x0004003d,
+0x00000006,0x00000353,0x00000052,0x000500c7,
+0x00000006,0x00000354,0x00000353,0x00000352,
+0x0003003e,0x00000052,0x00000354,0x0004003d,
+0x00000006,0x00000355,0x00000052,0x000500c7,
+0x00000006,0x00000357,0x00000355,0x00000356,
+0x000500ab,0x0000009b,0x00000358,0x00000357,
+0x0000010b,0x000300f7,0x0000035a,0x00000000,
+0x000400fa,0x00000358,0x00000359,0x0000035a,
+0x000200f8,0x00000359,0x0004003d,0x00000006,
+0x0000035c,0x00000052,0x00050082,0x00000006,
+0x0000035d,0x0000035c,0x0000035b,0x0003003e,
+0x00000052,0x0000035d,0x000200f9,0x0000035a,
+0x000200f8,0x0000035a,0x000100fd,0x00010038,
+0x00050036,0x00000002,0x00000058,0x00000000,
+0x00000056,0x00030037,0x0000004b,0x00000057,
+0x000200f8,0x00000059,0x00050041,0x00000010,
+0x0000035e,0x00000057,0x000000cb,0x0004003d,
+0x00000006,0x0000035f,0x0000035e,0x00050041,
+0x00000010,0x00000360,0x00000057,0x000000e9,
+0x0004003d,0x00000006,0x00000361,0x00000360,
+0x00050080,0x00000006,0x00000362,0x0000035f,
+0x00000361,0x00050087,0x00000006,0x00000363,
+0x00000362,0x00000126,0x00050041,0x00000010,
+0x00000364,0x00000057,0x000000cb,0x0003003e,
+0x00000364,0x00000363,0x00050041,0x00000010,
+0x00000365,0x00000057,0x00000084,0x0004003d,
+0x00000006,0x00000366,0x00000365,0x00050041,
+0x00000010,0x00000367,0x00000057,0x000000e9,
+0x0004003d,0x00000006,0x00000368,0x00000367,
+0x00050080,0x00000006,0x00000369,0x00000366,
+0x00000368,0x00050087,0x00000006,0x0000036a,
+0x00000369,0x00000126,0x00050041,0x00000010,
+0x0000036b,0x00000057,0x00000084,0x0003003e,
+0x0000036b,0x0000036a,0x000100fd,0x00010038,
+0x00050036,0x00000002,0x00000062,0x00000000,
+0x0000005c,0x00030037,0x0000005b,0x0000005d,
+0x00030037,0x0000000f,0x0000005e,0x00030037,
+0x0000000f,0x0000005f,0x00030037,0x00000017,
+0x00000060,0x00030037,0x00000017,0x00000061,
+0x000200f8,0x00000063,0x0004003b,0x00000010,
+0x0000036c,0x00000007,0x0004003b,0x0000036f,
+0x00000370,0x00000007,0x0004003b,0x00000010,
+0x00000374,0x00000007,0x0004003b,0x0000036f,
+0x00000377,0x00000007,0x0004003b,0x00000010,
+0x0000037b,0x00000007,0x0004003b,0x0000036f,
+0x0000037e,0x00000007,0x0004003b,0x00000010,
+0x00000382,0x00000007,0x0004003b,0x0000036f,
+0x00000385,0x00000007,0x0004003b,0x00000010,
+0x00000389,0x00000007,0x0004003b,0x0000036f,
+0x0000038c,0x00000007,0x0004003b,0x00000010,
+0x00000390,0x00000007,0x0004003b,0x0000036f,
+0x00000393,0x00000007,0x0004003b,0x00000010,
+0x00000397,0x00000007,0x0004003b,0x0000036f,
+0x0000039b,0x00000007,0x0004003b,0x00000010,
+0x0000039f,0x00000007,0x0004003b,0x0000036f,
+0x000003a2,0x00000007,0x0004003b,0x0000004b,
+0x000003b3,0x00000007,0x0004003b,0x0000004b,
+0x000003b9,0x00000007,0x0004003b,0x00000010,
+0x000003bf,0x00000007,0x0004003b,0x00000010,
+0x000003c6,0x00000007,0x0004003b,0x00000010,
+0x000003e0,0x00000007,0x0004003b,0x00000010,
+0x000003e2,0x00000007,0x0004003b,0x00000010,
+0x000003e7,0x00000007,0x0004003b,0x00000010,
+0x000003e9,0x00000007,0x0004003b,0x00000010,
+0x000003f6,0x00000007,0x0004003b,0x00000010,
+0x00000409,0x00000007,0x0004003b,0x00000010,
+0x00000411,0x00000007,0x0004003b,0x00000010,
+0x00000420,0x00000007,0x0004003b,0x00000010,
+0x00000426,0x00000007,0x0004003b,0x0000004b,
+0x00000439,0x00000007,0x0004003b,0x0000004b,
+0x0000043b,0x00000007,0x0004003b,0x0000004b,
+0x00000440,0x00000007,0x0004003b,0x0000004b,
+0x00000444,0x00000007,0x0004003b,0x00000010,
+0x00000449,0x00000007,0x0004003b,0x00000010,
+0x0000044b,0x00000007,0x0004003b,0x00000010,
+0x00000450,0x00000007,0x0004003b,0x00000010,
+0x00000452,0x00000007,0x0004003b,0x00000010,
+0x00000457,0x00000007,0x0004003b,0x00000010,
+0x00000459,0x00000007,0x0004003b,0x0000004b,
+0x00000474,0x00000007,0x0004003b,0x0000004b,
+0x00000476,0x00000007,0x0004003b,0x0000004b,
+0x0000047b,0x00000007,0x0004003b,0x0000004b,
+0x0000047f,0x00000007,0x0004003b,0x0000000f,
+0x0000049b,0x00000007,0x0004003b,0x0000000f,
+0x000004a2,0x00000007,0x0004003b,0x0000004b,
+0x000004b8,0x00000007,0x0004003b,0x0000004b,
+0x000004ba,0x00000007,0x0004003b,0x0000004b,
+0x000004bf,0x00000007,0x0004003b,0x0000004b,
+0x000004c3,0x00000007,0x0004003b,0x00000010,
+0x000004c8,0x00000007,0x0004003b,0x00000010,
+0x000004ca,0x00000007,0x0004003b,0x00000010,
+0x000004cf,0x00000007,0x0004003b,0x00000010,
+0x000004d1,0x00000007,0x0004003b,0x00000010,
+0x000004d6,0x00000007,0x0004003b,0x00000010,
+0x000004d8,0x00000007,0x0004003b,0x00000010,
+0x000004dd,0x00000007,0x0004003b,0x00000010,
+0x000004df,0x00000007,0x0004003b,0x0000004b,
+0x000004fe,0x00000007,0x0004003b,0x0000004b,
+0x00000500,0x00000007,0x0004003b,0x0000004b,
+0x00000505,0x00000007,0x0004003b,0x0000004b,
+0x00000509,0x00000007,0x0004003d,0x0000000e,
+0x0000036d,0x0000005e,0x00050080,0x0000000e,
+0x0000036e,0x0000036d,0x000000cb,0x0003003e,
+0x00000370,0x0000005d,0x00050041,0x0000000f,
+0x00000371,0x00000370,0x0000036e,0x0004003d,
+0x0000000e,0x00000372,0x00000371,0x0004007c,
+0x00000006,0x00000373,0x00000372,0x0003003e,
+0x0000036c,0x00000373,0x0004003d,0x0000000e,
+0x00000375,0x0000005e,0x00050080,0x0000000e,
+0x00000376,0x00000375,0x00000084,0x0003003e,
+0x00000377,0x0000005d,0x00050041,0x0000000f,
+0x00000378,0x00000377,0x00000376,0x0004003d,
+0x0000000e,0x00000379,0x00000378,0x0004007c,
+0x00000006,0x0000037a,0x00000379,0x0003003e,
+0x00000374,0x0000037a,0x0004003d,0x0000000e,
+0x0000037c,0x0000005e,0x00050080,0x0000000e,
+0x0000037d,0x0000037c,0x000000e9,0x0003003e,
+0x0000037e,0x0000005d,0x00050041,0x0000000f,
+0x0000037f,0x0000037e,0x0000037d,0x0004003d,
+0x0000000e,0x00000380,0x0000037f,0x0004007c,
+0x00000006,0x00000381,0x00000380,0x0003003e,
+0x0000037b,0x00000381,0x0004003d,0x0000000e,
+0x00000383,0x0000005e,0x00050080,0x0000000e,
+0x00000384,0x00000383,0x0000003d,0x0003003e,
+0x00000385,0x0000005d,0x00050041,0x0000000f,
+0x00000386,0x00000385,0x00000384,0x0004003d,
+0x0000000e,0x00000387,0x00000386,0x0004007c,
+0x00000006,0x00000388,0x00000387,0x0003003e,
+0x00000382,0x00000388,0x0004003d,0x0000000e,
+0x0000038a,0x0000005e,0x00050080,0x0000000e,
+0x0000038b,0x0000038a,0x000000e0,0x0003003e,
+0x0000038c,0x0000005d,0x00050041,0x0000000f,
+0x0000038d,0x0000038c,0x0000038b,0x0004003d,
+0x0000000e,0x0000038e,0x0000038d,0x0004007c,
+0x00000006,0x0000038f,0x0000038e,0x0003003e,
+0x00000389,0x0000038f,0x0004003d,0x0000000e,
+0x00000391,0x0000005e,0x00050080,0x0000000e,
+0x00000392,0x00000391,0x00000034,0x0003003e,
+0x00000393,0x0000005d,0x00050041,0x0000000f,
+0x00000394,0x00000393,0x00000392,0x0004003d,
+0x0000000e,0x00000395,0x00000394,0x0004007c,
+0x00000006,0x00000396,0x00000395,0x0003003e,
+0x00000390,0x00000396,0x0004003d,0x0000000e,
+0x00000398,0x0000005e,0x00050080,0x0000000e,
+0x0000039a,0x00000398,0x00000399,0x0003003e,
+0x0000039b,0x0000005d,0x00050041,0x0000000f,
+0x0000039c,0x0000039b,0x0000039a,0x0004003d,
+0x0000000e,0x0000039d,0x0000039c,0x0004007c,
+0x00000006,0x0000039e,0x0000039d,0x0003003e,
+0x00000397,0x0000039e,0x0004003d,0x0000000e,
+0x000003a0,0x0000005e,0x00050080,0x0000000e,
+0x000003a1,0x000003a0,0x000000e5,0x0003003e,
+0x000003a2,0x0000005d,0x00050041,0x0000000f,
+0x000003a3,0x000003a2,0x000003a1,0x0004003d,
+0x0000000e,0x000003a4,0x000003a3,0x0004007c,
+0x00000006,0x000003a5,0x000003a4,0x0003003e,
+0x0000039f,0x000003a5,0x0004003d,0x0000000e,
+0x000003a6,0x0000005f,0x000300f7,0x000003b2,
+0x00000000,0x001700fb,0x000003a6,0x000003b1,
+0x00000000,0x000003a7,0x00000001,0x000003a8,
+0x00000004,0x000003a9,0x00000005,0x000003aa,
+0x00000006,0x000003ab,0x00000008,0x000003ac,
+0x00000009,0x000003ad,0x0000000a,0x000003ae,
+0x0000000c,0x000003af,0x0000000d,0x000003b0,
+0x000200f8,0x000003b1,0x0003003e,0x000003b3,
+0x00000516,0x0003003e,0x000003b9,0x00000516,
+0x000200f9,0x000003b2,0x000200f8,0x000003a7,
+0x0004003d,0x00000006,0x000003b4,0x0000036c,
+0x0004003d,0x00000006,0x000003b5,0x0000036c,
+0x0004003d,0x00000006,0x000003b6,0x0000036c,
+0x00070050,0x0000004a,0x000003b8,0x000003b4,
+0x000003b5,0x000003b6,0x000003b7,0x0003003e,
+0x000003b3,0x000003b8,0x0004003d,0x00000006,
+0x000003ba,0x00000374,0x0004003d,0x00000006,
+0x000003bb,0x00000374,0x0004003d,0x00000006,
+0x000003bc,0x00000374,0x00070050,0x0000004a,
+0x000003bd,0x000003ba,0x000003bb,0x000003bc,
+0x000003b7,0x0003003e,0x000003b9,0x000003bd,
+0x000200f9,0x000003b2,0x000200f8,0x000003a8,
+0x0004003d,0x00000006,0x000003c0,0x0000036c,
+0x000500c3,0x00000006,0x000003c1,0x000003c0,
+0x00000126,0x0004003d,0x00000006,0x000003c2,
+0x00000374,0x000500c7,0x00000006,0x000003c4,
+0x000003c2,0x000003c3,0x000500c5,0x00000006,
+0x000003c5,0x000003c1,0x000003c4,0x0003003e,
+0x000003bf,0x000003c5,0x0004003d,0x00000006,
+0x000003c7,0x000003bf,0x0004003d,0x00000006,
+0x000003c8,0x00000374,0x000500c7,0x00000006,
+0x000003c9,0x000003c8,0x00000352,0x00050080,
+0x00000006,0x000003ca,0x000003c7,0x000003c9,
+0x0007000c,0x00000006,0x000003cb,0x00000001,
+0x00000027,0x000003ca,0x000003b7,0x0003003e,
+0x000003c6,0x000003cb,0x0004003d,0x00000006,
+0x000003cc,0x000003bf,0x0004003d,0x00000006,
+0x000003cd,0x000003bf,0x0004003d,0x00000006,
+0x000003ce,0x000003bf,0x00070050,0x0000004a,
+0x000003cf,0x000003cc,0x000003cd,0x000003ce,
+0x000003b7,0x0003003e,0x000003b3,0x000003cf,
+0x0004003d,0x00000006,0x000003d0,0x000003c6,
+0x0004003d,0x00000006,0x000003d1,0x000003c6,
+0x0004003d,0x00000006,0x000003d2,0x000003c6,
+0x00070050,0x0000004a,0x000003d3,0x000003d0,
+0x000003d1,0x000003d2,0x000003b7,0x0003003e,
+0x000003b9,0x000003d3,0x000200f9,0x000003b2,
+0x000200f8,0x000003a9,0x0004003d,0x00000006,
+0x000003d5,0x0000036c,0x0004003d,0x00000006,
+0x000003d6,0x0000036c,0x0004003d,0x00000006,
+0x000003d7,0x0000036c,0x0004003d,0x00000006,
+0x000003d8,0x0000037b,0x00070050,0x0000004a,
+0x000003d9,0x000003d5,0x000003d6,0x000003d7,
+0x000003d8,0x0003003e,0x000003b3,0x000003d9,
+0x0004003d,0x00000006,0x000003da,0x00000374,
+0x0004003d,0x00000006,0x000003db,0x00000374,
+0x0004003d,0x00000006,0x000003dc,0x00000374,
+0x0004003d,0x00000006,0x000003dd,0x00000382,
+0x00070050,0x0000004a,0x000003de,0x000003da,
+0x000003db,0x000003dc,0x000003dd,0x0003003e,
+0x000003b9,0x000003de,0x000200f9,0x000003b2,
+0x000200f8,0x000003aa,0x0004003d,0x00000006,
+0x000003e1,0x00000374,0x0003003e,0x000003e0,
+0x000003e1,0x0004003d,0x00000006,0x000003e3,
+0x0000036c,0x0003003e,0x000003e2,0x000003e3,
+0x00060039,0x00000002,0x000003e4,0x00000054,
+0x000003e0,0x000003e2,0x0004003d,0x00000006,
+0x000003e5,0x000003e0,0x0003003e,0x00000374,
+0x000003e5,0x0004003d,0x00000006,0x000003e6,
+0x000003e2,0x0003003e,0x0000036c,0x000003e6,
+0x0004003d,0x00000006,0x000003e8,0x00000382,
+0x0003003e,0x000003e7,0x000003e8,0x0004003d,
+0x00000006,0x000003ea,0x0000037b,0x0003003e,
+0x000003e9,0x000003ea,0x00060039,0x00000002,
+0x000003eb,0x00000054,0x000003e7,0x000003e9,
+0x0004003d,0x00000006,0x000003ec,0x000003e7,
+0x0003003e,0x00000382,0x000003ec,0x0004003d,
+0x00000006,0x000003ed,0x000003e9,0x0003003e,
+0x0000037b,0x000003ed,0x0004003d,0x00000006,
+0x000003ee,0x0000036c,0x0004003d,0x00000006,
+0x000003ef,0x0000036c,0x0004003d,0x00000006,
+0x000003f0,0x0000036c,0x0004003d,0x00000006,
+0x000003f1,0x0000037b,0x00070050,0x0000004a,
+0x000003f2,0x000003ee,0x000003ef,0x000003f0,
+0x000003f1,0x00070050,0x0000004a,0x000003f3,
+0x0000010b,0x0000010b,0x0000010b,0x0000010b,
+0x00070050,0x0000004a,0x000003f4,0x000003b7,
+0x000003b7,0x000003b7,0x000003b7,0x0008000c,
+0x0000004a,0x000003f5,0x00000001,0x0000002d,
+0x000003f2,0x000003f3,0x000003f4,0x0003003e,
+0x000003b3,0x000003f5,0x0004003d,0x00000006,
+0x000003f7,0x0000036c,0x0004003d,0x00000006,
+0x000003f8,0x00000374,0x00050080,0x00000006,
+0x000003f9,0x000003f7,0x000003f8,0x0003003e,
+0x000003f6,0x000003f9,0x0004003d,0x00000006,
+0x000003fa,0x000003f6,0x0004003d,0x00000006,
+0x000003fb,0x000003f6,0x0004003d,0x00000006,
+0x000003fc,0x000003f6,0x0004003d,0x00000006,
+0x000003fd,0x0000037b,0x0004003d,0x00000006,
+0x000003fe,0x00000382,0x00050080,0x00000006,
+0x000003ff,0x000003fd,0x000003fe,0x00070050,
+0x0000004a,0x00000400,0x000003fa,0x000003fb,
+0x000003fc,0x000003ff,0x00070050,0x0000004a,
+0x00000401,0x0000010b,0x0000010b,0x0000010b,
+0x0000010b,0x00070050,0x0000004a,0x00000402,
+0x000003b7,0x000003b7,0x000003b7,0x000003b7,
+0x0008000c,0x0000004a,0x00000403,0x00000001,
+0x0000002d,0x00000400,0x00000401,0x00000402,
+0x0003003e,0x000003b9,0x00000403,0x000200f9,
+0x000003b2,0x000200f8,0x000003ab,0x0004003d,
+0x00000006,0x00000405,0x0000036c,0x0004003d,
+0x00000006,0x00000406,0x00000374,0x0004003d,
+0x00000006,0x00000407,0x0000037b,0x00070050,
+0x0000004a,0x00000408,0x00000405,0x00000406,
+0x00000407,0x000003b7,0x0003003e,0x000003b9,
+0x00000408,0x0003003e,0x00000409,0x0000010b,
+0x000200f9,0x0000040a,0x000200f8,0x0000040a,
+0x000400f6,0x0000040c,0x0000040d,0x00000000,
+0x000200f9,0x0000040e,0x000200f8,0x0000040e,
+0x0004003d,0x00000006,0x0000040f,0x00000409,
+0x000500b1,0x0000009b,0x00000410,0x0000040f,
+0x0000026b,0x000400fa,0x00000410,0x0000040b,
+0x0000040c,0x000200f8,0x0000040b,0x0004003d,
+0x00000006,0x00000412,0x00000409,0x00050041,
+0x00000010,0x00000413,0x000003b9,0x00000412,
+0x0004003d,0x00000006,0x00000414,0x00000413,
+0x0003003e,0x00000411,0x00000414,0x0004003d,
+0x00000006,0x00000415,0x00000409,0x0004003d,
+0x00000006,0x00000416,0x00000411,0x0004003d,
+0x00000006,0x00000417,0x00000382,0x00050084,
+0x00000006,0x00000418,0x00000416,0x00000417,
+0x000500c3,0x00000006,0x0000041a,0x00000418,
+0x00000419,0x00050041,0x00000010,0x0000041b,
+0x000003b3,0x00000415,0x0003003e,0x0000041b,
+0x0000041a,0x000200f9,0x0000040d,0x000200f8,
+0x0000040d,0x0004003d,0x00000006,0x0000041c,
+0x00000409,0x00050080,0x00000006,0x0000041d,
+0x0000041c,0x00000090,0x0003003e,0x00000409,
+0x0000041d,0x000200f9,0x0000040a,0x000200f8,
+0x0000040c,0x00050041,0x00000010,0x0000041e,
+0x000003b3,0x0000003d,0x0003003e,0x0000041e,
+0x000003b7,0x000200f9,0x000003b2,0x000200f8,
+0x000003ac,0x0004003d,0x00000006,0x00000421,
+0x0000036c,0x0004003d,0x00000006,0x00000422,
+0x0000037b,0x00050080,0x00000006,0x00000423,
+0x00000421,0x00000422,0x0004003d,0x00000006,
+0x00000424,0x00000389,0x00050080,0x00000006,
+0x00000425,0x00000423,0x00000424,0x0003003e,
+0x00000420,0x00000425,0x0004003d,0x00000006,
+0x00000427,0x00000374,0x0004003d,0x00000006,
+0x00000428,0x00000382,0x00050080,0x00000006,
+0x00000429,0x00000427,0x00000428,0x0004003d,
+0x00000006,0x0000042a,0x00000390,0x00050080,
+0x00000006,0x0000042b,0x00000429,0x0000042a,
+0x0003003e,0x00000426,0x0000042b,0x0004003d,
+0x00000006,0x0000042c,0x0000036c,0x0004003d,
+0x00000006,0x0000042d,0x0000037b,0x0004003d,
+0x00000006,0x0000042e,0x00000389,0x00070050,
+0x0000004a,0x0000042f,0x0000042c,0x0000042d,
+0x0000042e,0x000003b7,0x0003003e,0x000003b3,
+0x0000042f,0x0004003d,0x00000006,0x00000430,
+0x00000374,0x0004003d,0x00000006,0x00000431,
+0x00000382,0x0004003d,0x00000006,0x00000432,
+0x00000390,0x00070050,0x0000004a,0x00000433,
+0x00000430,0x00000431,0x00000432,0x000003b7,
+0x0003003e,0x000003b9,0x00000433,0x0004003d,
+0x00000006,0x00000434,0x00000426,0x0004003d,
+0x00000006,0x00000435,0x00000420,0x000500b1,
+0x0000009b,0x00000436,0x00000434,0x00000435,
+0x000300f7,0x00000438,0x00000000,0x000400fa,
+0x00000436,0x00000437,0x00000438,0x000200f8,
+0x00000437,0x0004003d,0x0000004a,0x0000043a,
+0x000003b3,0x0003003e,0x00000439,0x0000043a,
+0x0004003d,0x0000004a,0x0000043c,0x000003b9,
+0x0003003e,0x0000043b,0x0000043c,0x00060039,
+0x00000002,0x0000043d,0x0000004f,0x00000439,
+0x0000043b,0x0004003d,0x0000004a,0x0000043e,
+0x00000439,0x0003003e,0x000003b3,0x0000043e,
+0x0004003d,0x0000004a,0x0000043f,0x0000043b,
+0x0003003e,0x000003b9,0x0000043f,0x0004003d,
+0x0000004a,0x00000441,0x000003b3,0x0003003e,
+0x00000440,0x00000441,0x00050039,0x00000002,
+0x00000442,0x00000058,0x00000440,0x0004003d,
+0x0000004a,0x00000443,0x00000440,0x0003003e,
+0x000003b3,0x00000443,0x0004003d,0x0000004a,
+0x00000445,0x000003b9,0x0003003e,0x00000444,
+0x00000445,0x00050039,0x00000002,0x00000446,
+0x00000058,0x00000444,0x0004003d,0x0000004a,
+0x00000447,0x00000444,0x0003003e,0x000003b9,
+0x00000447,0x000200f9,0x00000438,0x000200f8,
+0x00000438,0x000200f9,0x000003b2,0x000200f8,
+0x000003ad,0x0004003d,0x00000006,0x0000044a,
+0x00000374,0x0003003e,0x00000449,0x0000044a,
+0x0004003d,0x00000006,0x0000044c,0x0000036c,
+0x0003003e,0x0000044b,0x0000044c,0x00060039,
+0x00000002,0x0000044d,0x00000054,0x00000449,
+0x0000044b,0x0004003d,0x00000006,0x0000044e,
+0x00000449,0x0003003e,0x00000374,0x0000044e,
+0x0004003d,0x00000006,0x0000044f,0x0000044b,
+0x0003003e,0x0000036c,0x0000044f,0x0004003d,
+0x00000006,0x00000451,0x00000382,0x0003003e,
+0x00000450,0x00000451,0x0004003d,0x00000006,
+0x00000453,0x0000037b,0x0003003e,0x00000452,
+0x00000453,0x00060039,0x00000002,0x00000454,
+0x00000054,0x00000450,0x00000452,0x0004003d,
+0x00000006,0x00000455,0x00000450,0x0003003e,
+0x00000382,0x00000455,0x0004003d,0x00000006,
+0x00000456,0x00000452,0x0003003e,0x0000037b,
+0x00000456,0x0004003d,0x00000006,0x00000458,
+0x00000390,0x0003003e,0x00000457,0x00000458,
+0x0004003d,0x00000006,0x0000045a,0x00000389,
+0x0003003e,0x00000459,0x0000045a,0x00060039,
+0x00000002,0x0000045b,0x00000054,0x00000457,
+0x00000459,0x0004003d,0x00000006,0x0000045c,
+0x00000457,0x0003003e,0x00000390,0x0000045c,
+0x0004003d,0x00000006,0x0000045d,0x00000459,
+0x0003003e,0x00000389,0x0000045d,0x0004003d,
+0x00000006,0x0000045e,0x0000036c,0x0004003d,
+0x00000006,0x0000045f,0x0000037b,0x0004003d,
+0x00000006,0x00000460,0x00000389,0x00070050,
+0x0000004a,0x00000461,0x0000045e,0x0000045f,
+0x00000460,0x000003b7,0x0003003e,0x000003b3,
+0x00000461,0x0004003d,0x00000006,0x00000462,
+0x0000036c,0x0004003d,0x00000006,0x00000463,
+0x00000374,0x00050080,0x00000006,0x00000464,
+0x00000462,0x00000463,0x0004003d,0x00000006,
+0x00000465,0x0000037b,0x0004003d,0x00000006,
+0x00000466,0x00000382,0x00050080,0x00000006,
+0x00000467,0x00000465,0x00000466,0x0004003d,
+0x00000006,0x00000468,0x00000389,0x0004003d,
+0x00000006,0x00000469,0x00000390,0x00050080,
+0x00000006,0x0000046a,0x00000468,0x00000469,
+0x00070050,0x0000004a,0x0000046b,0x00000464,
+0x00000467,0x0000046a,0x000003b7,0x0003003e,
+0x000003b9,0x0000046b,0x0004003d,0x00000006,
+0x0000046c,0x00000374,0x0004003d,0x00000006,
+0x0000046d,0x00000382,0x00050080,0x00000006,
+0x0000046e,0x0000046c,0x0000046d,0x0004003d,
+0x00000006,0x0000046f,0x00000390,0x00050080,
+0x00000006,0x00000470,0x0000046e,0x0000046f,
+0x000500b1,0x0000009b,0x00000471,0x00000470,
+0x0000010b,0x000300f7,0x00000473,0x00000000,
+0x000400fa,0x00000471,0x00000472,0x00000473,
+0x000200f8,0x00000472,0x0004003d,0x0000004a,
+0x00000475,0x000003b3,0x0003003e,0x00000474,
+0x00000475,0x0004003d,0x0000004a,0x00000477,
+0x000003b9,0x0003003e,0x00000476,0x00000477,
+0x00060039,0x00000002,0x00000478,0x0000004f,
+0x00000474,0x00000476,0x0004003d,0x0000004a,
+0x00000479,0x00000474,0x0003003e,0x000003b3,
+0x00000479,0x0004003d,0x0000004a,0x0000047a,
+0x00000476,0x0003003e,0x000003b9,0x0000047a,
+0x0004003d,0x0000004a,0x0000047c,0x000003b3,
+0x0003003e,0x0000047b,0x0000047c,0x00050039,
+0x00000002,0x0000047d,0x00000058,0x0000047b,
+0x0004003d,0x0000004a,0x0000047e,0x0000047b,
+0x0003003e,0x000003b3,0x0000047e,0x0004003d,
+0x0000004a,0x00000480,0x000003b9,0x0003003e,
+0x0000047f,0x00000480,0x00050039,0x00000002,
+0x00000481,0x00000058,0x0000047f,0x0004003d,
+0x0000004a,0x00000482,0x0000047f,0x0003003e,
+0x000003b9,0x00000482,0x000200f9,0x00000473,
+0x000200f8,0x00000473,0x0004003d,0x0000004a,
+0x00000483,0x000003b3,0x00070050,0x0000004a,
+0x00000484,0x0000010b,0x0000010b,0x0000010b,
+0x0000010b,0x00070050,0x0000004a,0x00000485,
+0x000003b7,0x000003b7,0x000003b7,0x000003b7,
+0x0008000c,0x0000004a,0x00000486,0x00000001,
+0x0000002d,0x00000483,0x00000484,0x00000485,
+0x0003003e,0x000003b3,0x00000486,0x0004003d,
+0x0000004a,0x00000487,0x000003b9,0x00070050,
+0x0000004a,0x00000488,0x0000010b,0x0000010b,
+0x0000010b,0x0000010b,0x00070050,0x0000004a,
+0x00000489,0x000003b7,0x000003b7,0x000003b7,
+0x000003b7,0x0008000c,0x0000004a,0x0000048a,
+0x00000001,0x0000002d,0x00000487,0x00000488,
+0x00000489,0x0003003e,0x000003b9,0x0000048a,
+0x000200f9,0x000003b2,0x000200f8,0x000003ae,
+0x0004003d,0x00000006,0x0000048c,0x0000036c,
+0x0004003d,0x00000006,0x0000048d,0x00000374,
+0x0004003d,0x00000006,0x0000048e,0x0000037b,
+0x00070050,0x0000004a,0x0000048f,0x0000048c,
+0x0000048d,0x0000048e,0x000003b7,0x0003003e,
+0x000003b9,0x0000048f,0x0003003e,0x000003b3,
+0x0000048f,0x0004003d,0x0000004a,0x00000490,
+0x000003b3,0x0004003d,0x00000006,0x00000491,
+0x00000382,0x00070050,0x0000004a,0x00000492,
+0x00000491,0x00000491,0x00000491,0x00000491,
+0x00050084,0x0000004a,0x00000493,0x00000490,
+0x00000492,0x00070050,0x0000004a,0x00000494,
+0x00000419,0x00000419,0x00000419,0x00000419,
+0x000500c3,0x0000004a,0x00000495,0x00000493,
+0x00000494,0x0003003e,0x000003b3,0x00000495,
+0x0004003d,0x00000006,0x00000496,0x00000389,
+0x00050041,0x00000010,0x00000497,0x000003b3,
+0x0000003d,0x0003003e,0x00000497,0x00000496,
+0x0004003d,0x00000006,0x00000498,0x00000390,
+0x00050041,0x00000010,0x00000499,0x000003b9,
+0x0000003d,0x0003003e,0x00000499,0x00000498,
+0x000200f9,0x000003b2,0x000200f8,0x000003af,
+0x0004003d,0x00000006,0x0000049c,0x0000036c,
+0x0004003d,0x00000006,0x0000049d,0x0000037b,
+0x00050080,0x00000006,0x0000049e,0x0000049c,
+0x0000049d,0x0004003d,0x00000006,0x0000049f,
+0x00000389,0x00050080,0x00000006,0x000004a0,
+0x0000049e,0x0000049f,0x0004007c,0x0000000e,
+0x000004a1,0x000004a0,0x0003003e,0x0000049b,
+0x000004a1,0x0004003d,0x00000006,0x000004a3,
+0x00000374,0x0004003d,0x00000006,0x000004a4,
+0x00000382,0x00050080,0x00000006,0x000004a5,
+0x000004a3,0x000004a4,0x0004003d,0x00000006,
+0x000004a6,0x00000390,0x00050080,0x00000006,
+0x000004a7,0x000004a5,0x000004a6,0x0004007c,
+0x0000000e,0x000004a8,0x000004a7,0x0003003e,
+0x000004a2,0x000004a8,0x0004003d,0x00000006,
+0x000004a9,0x0000036c,0x0004003d,0x00000006,
+0x000004aa,0x0000037b,0x0004003d,0x00000006,
+0x000004ab,0x00000389,0x0004003d,0x00000006,
+0x000004ac,0x00000397,0x00070050,0x0000004a,
+0x000004ad,0x000004a9,0x000004aa,0x000004ab,
+0x000004ac,0x0003003e,0x000003b3,0x000004ad,
+0x0004003d,0x00000006,0x000004ae,0x00000374,
+0x0004003d,0x00000006,0x000004af,0x00000382,
+0x0004003d,0x00000006,0x000004b0,0x00000390,
+0x0004003d,0x00000006,0x000004b1,0x0000039f,
+0x00070050,0x0000004a,0x000004b2,0x000004ae,
+0x000004af,0x000004b0,0x000004b1,0x0003003e,
+0x000003b9,0x000004b2,0x0004003d,0x0000000e,
+0x000004b3,0x000004a2,0x0004003d,0x0000000e,
+0x000004b4,0x0000049b,0x000500b0,0x0000009b,
+0x000004b5,0x000004b3,0x000004b4,0x000300f7,
+0x000004b7,0x00000000,0x000400fa,0x000004b5,
+0x000004b6,0x000004b7,0x000200f8,0x000004b6,
+0x0004003d,0x0000004a,0x000004b9,0x000003b3,
+0x0003003e,0x000004b8,0x000004b9,0x0004003d,
+0x0000004a,0x000004bb,0x000003b9,0x0003003e,
+0x000004ba,0x000004bb,0x00060039,0x00000002,
+0x000004bc,0x0000004f,0x000004b8,0x000004ba,
+0x0004003d,0x0000004a,0x000004bd,0x000004b8,
+0x0003003e,0x000003b3,0x000004bd,0x0004003d,
+0x0000004a,0x000004be,0x000004ba,0x0003003e,
+0x000003b9,0x000004be,0x0004003d,0x0000004a,
+0x000004c0,0x000003b3,0x0003003e,0x000004bf,
+0x000004c0,0x00050039,0x00000002,0x000004c1,
+0x00000058,0x000004bf,0x0004003d,0x0000004a,
+0x000004c2,0x000004bf,0x0003003e,0x000003b3,
+0x000004c2,0x0004003d,0x0000004a,0x000004c4,
+0x000003b9,0x0003003e,0x000004c3,0x000004c4,
+0x00050039,0x00000002,0x000004c5,0x00000058,
+0x000004c3,0x0004003d,0x0000004a,0x000004c6,
+0x000004c3,0x0003003e,0x000003b9,0x000004c6,
+0x000200f9,0x000004b7,0x000200f8,0x000004b7,
+0x000200f9,0x000003b2,0x000200f8,0x000003b0,
+0x0004003d,0x00000006,0x000004c9,0x00000374,
+0x0003003e,0x000004c8,0x000004c9,0x0004003d,
+0x00000006,0x000004cb,0x0000036c,0x0003003e,
+0x000004ca,0x000004cb,0x00060039,0x00000002,
+0x000004cc,0x00000054,0x000004c8,0x000004ca,
+0x0004003d,0x00000006,0x000004cd,0x000004c8,
+0x0003003e,0x00000374,0x000004cd,0x0004003d,
+0x00000006,0x000004ce,0x000004ca,0x0003003e,
+0x0000036c,0x000004ce,0x0004003d,0x00000006,
+0x000004d0,0x00000382,0x0003003e,0x000004cf,
+0x000004d0,0x0004003d,0x00000006,0x000004d2,
+0x0000037b,0x0003003e,0x000004d1,0x000004d2,
+0x00060039,0x00000002,0x000004d3,0x00000054,
+0x000004cf,0x000004d1,0x0004003d,0x00000006,
+0x000004d4,0x000004cf,0x0003003e,0x00000382,
+0x000004d4,0x0004003d,0x00000006,0x000004d5,
+0x000004d1,0x0003003e,0x0000037b,0x000004d5,
+0x0004003d,0x00000006,0x000004d7,0x00000390,
+0x0003003e,0x000004d6,0x000004d7,0x0004003d,
+0x00000006,0x000004d9,0x00000389,0x0003003e,
+0x000004d8,0x000004d9,0x00060039,0x00000002,
+0x000004da,0x00000054,0x000004d6,0x000004d8,
+0x0004003d,0x00000006,0x000004db,0x000004d6,
+0x0003003e,0x00000390,0x000004db,0x0004003d,
+0x00000006,0x000004dc,0x000004d8,0x0003003e,
+0x00000389,0x000004dc,0x0004003d,0x00000006,
+0x000004de,0x0000039f,0x0003003e,0x000004dd,
+0x000004de,0x0004003d,0x00000006,0x000004e0,
+0x00000397,0x0003003e,0x000004df,0x000004e0,
+0x00060039,0x00000002,0x000004e1,0x00000054,
+0x000004dd,0x000004df,0x0004003d,0x00000006,
+0x000004e2,0x000004dd,0x0003003e,0x0000039f,
+0x000004e2,0x0004003d,0x00000006,0x000004e3,
+0x000004df,0x0003003e,0x00000397,0x000004e3,
+0x0004003d,0x00000006,0x000004e4,0x0000036c,
+0x0004003d,0x00000006,0x000004e5,0x0000037b,
+0x0004003d,0x00000006,0x000004e6,0x00000389,
+0x0004003d,0x00000006,0x000004e7,0x00000397,
+0x00070050,0x0000004a,0x000004e8,0x000004e4,
+0x000004e5,0x000004e6,0x000004e7,0x0003003e,
+0x000003b3,0x000004e8,0x0004003d,0x00000006,
+0x000004e9,0x0000036c,0x0004003d,0x00000006,
+0x000004ea,0x00000374,0x00050080,0x00000006,
+0x000004eb,0x000004e9,0x000004ea,0x0004003d,
+0x00000006,0x000004ec,0x0000037b,0x0004003d,
+0x00000006,0x000004ed,0x00000382,0x00050080,
+0x00000006,0x000004ee,0x000004ec,0x000004ed,
+0x0004003d,0x00000006,0x000004ef,0x00000389,
+0x0004003d,0x00000006,0x000004f0,0x00000390,
+0x00050080,0x00000006,0x000004f1,0x000004ef,
+0x000004f0,0x0004003d,0x00000006,0x000004f2,
+0x00000397,0x0004003d,0x00000006,0x000004f3,
+0x0000039f,0x00050080,0x00000006,0x000004f4,
+0x000004f2,0x000004f3,0x00070050,0x0000004a,
+0x000004f5,0x000004eb,0x000004ee,0x000004f1,
+0x000004f4,0x0003003e,0x000003b9,0x000004f5,
+0x0004003d,0x00000006,0x000004f6,0x00000374,
+0x0004003d,0x00000006,0x000004f7,0x00000382,
+0x00050080,0x00000006,0x000004f8,0x000004f6,
+0x000004f7,0x0004003d,0x00000006,0x000004f9,
+0x00000390,0x00050080,0x00000006,0x000004fa,
+0x000004f8,0x000004f9,0x000500b1,0x0000009b,
+0x000004fb,0x000004fa,0x0000010b,0x000300f7,
+0x000004fd,0x00000000,0x000400fa,0x000004fb,
+0x000004fc,0x000004fd,0x000200f8,0x000004fc,
+0x0004003d,0x0000004a,0x000004ff,0x000003b3,
+0x0003003e,0x000004fe,0x000004ff,0x0004003d,
+0x0000004a,0x00000501,0x000003b9,0x0003003e,
+0x00000500,0x00000501,0x00060039,0x00000002,
+0x00000502,0x0000004f,0x000004fe,0x00000500,
+0x0004003d,0x0000004a,0x00000503,0x000004fe,
+0x0003003e,0x000003b3,0x00000503,0x0004003d,
+0x0000004a,0x00000504,0x00000500,0x0003003e,
+0x000003b9,0x00000504,0x0004003d,0x0000004a,
+0x00000506,0x000003b3,0x0003003e,0x00000505,
+0x00000506,0x00050039,0x00000002,0x00000507,
+0x00000058,0x00000505,0x0004003d,0x0000004a,
+0x00000508,0x00000505,0x0003003e,0x000003b3,
+0x00000508,0x0004003d,0x0000004a,0x0000050a,
+0x000003b9,0x0003003e,0x00000509,0x0000050a,
+0x00050039,0x00000002,0x0000050b,0x00000058,
+0x00000509,0x0004003d,0x0000004a,0x0000050c,
+0x00000509,0x0003003e,0x000003b9,0x0000050c,
+0x000200f9,0x000004fd,0x000200f8,0x000004fd,
+0x0004003d,0x0000004a,0x0000050d,0x000003b3,
+0x00070050,0x0000004a,0x0000050e,0x0000010b,
+0x0000010b,0x0000010b,0x0000010b,0x00070050,
+0x0000004a,0x0000050f,0x000003b7,0x000003b7,
+0x000003b7,0x000003b7,0x0008000c,0x0000004a,
+0x00000510,0x00000001,0x0000002d,0x0000050d,
+0x0000050e,0x0000050f,0x0003003e,0x000003b3,
+0x00000510,0x0004003d,0x0000004a,0x00000511,
+0x000003b9,0x00070050,0x0000004a,0x00000512,
+0x0000010b,0x0000010b,0x0000010b,0x0000010b,
+0x00070050,0x0000004a,0x00000513,0x000003b7,
+0x000003b7,0x000003b7,0x000003b7,0x0008000c,
+0x0000004a,0x00000514,0x00000001,0x0000002d,
+0x00000511,0x00000512,0x00000513,0x0003003e,
+0x000003b9,0x00000514,0x000200f9,0x000003b2,
+0x000200f8,0x000003b2,0x0004003d,0x0000004a,
+0x00000518,0x000003b3,0x0004007c,0x00000016,
+0x00000519,0x00000518,0x0003003e,0x00000060,
+0x00000519,0x0004003d,0x0000004a,0x0000051a,
+0x000003b9,0x0004007c,0x00000016,0x0000051b,
+0x0000051a,0x0003003e,0x00000061,0x0000051b,
+0x000100fd,0x00010038,0x00050036,0x0000000e,
+0x00000065,0x00000000,0x00000046,0x00030037,
+0x0000000f,0x00000064,0x000200f8,0x00000066,
+0x0004003d,0x0000000e,0x0000051c,0x00000064,
+0x000500c2,0x0000000e,0x0000051e,0x0000051c,
+0x0000051d,0x0004003d,0x0000000e,0x0000051f,
+0x00000064,0x000500c6,0x0000000e,0x00000520,
+0x0000051f,0x0000051e,0x0003003e,0x00000064,
+0x00000520,0x0004003d,0x0000000e,0x00000521,
+0x00000064,0x000500c4,0x0000000e,0x00000523,
+0x00000521,0x00000522,0x0004003d,0x0000000e,
+0x00000524,0x00000064,0x00050082,0x0000000e,
+0x00000525,0x00000524,0x00000523,0x0003003e,
+0x00000064,0x00000525,0x0004003d,0x0000000e,
+0x00000526,0x00000064,0x000500c4,0x0000000e,
+0x00000528,0x00000526,0x00000527,0x0004003d,
+0x0000000e,0x00000529,0x00000064,0x00050080,
+0x0000000e,0x0000052a,0x00000529,0x00000528,
+0x0003003e,0x00000064,0x0000052a,0x0004003d,
+0x0000000e,0x0000052b,0x00000064,0x000500c4,
+0x0000000e,0x0000052d,0x0000052b,0x0000052c,
+0x0004003d,0x0000000e,0x0000052e,0x00000064,
+0x00050080,0x0000000e,0x0000052f,0x0000052e,
+0x0000052d,0x0003003e,0x00000064,0x0000052f,
+0x0004003d,0x0000000e,0x00000530,0x00000064,
+0x000500c2,0x0000000e,0x00000531,0x00000530,
+0x00000112,0x0004003d,0x0000000e,0x00000532,
+0x00000064,0x000500c6,0x0000000e,0x00000533,
+0x00000532,0x00000531,0x0003003e,0x00000064,
+0x00000533,0x0004003d,0x0000000e,0x00000534,
+0x00000064,0x000500c4,0x0000000e,0x00000536,
+0x00000534,0x00000535,0x0004003d,0x0000000e,
+0x00000537,0x00000064,0x00050080,0x0000000e,
+0x00000538,0x00000537,0x00000536,0x0003003e,
+0x00000064,0x00000538,0x0004003d,0x0000000e,
+0x00000539,0x00000064,0x000500c2,0x0000000e,
+0x0000053a,0x00000539,0x00000527,0x0004003d,
+0x0000000e,0x0000053b,0x00000064,0x000500c6,
+0x0000000e,0x0000053c,0x0000053b,0x0000053a,
+0x0003003e,0x00000064,0x0000053c,0x0004003d,
+0x0000000e,0x0000053d,0x00000064,0x000500c2,
+0x0000000e,0x0000053e,0x0000053d,0x0000026b,
+0x0004003d,0x0000000e,0x0000053f,0x00000064,
+0x000500c6,0x0000000e,0x00000540,0x0000053f,
+0x0000053e,0x0003003e,0x00000064,0x00000540,
+0x0004003d,0x0000000e,0x00000541,0x00000064,
+0x000500c4,0x0000000e,0x00000543,0x00000541,
+0x00000542,0x0004003d,0x0000000e,0x00000544,
+0x00000064,0x000500c6,0x0000000e,0x00000545,
+0x00000544,0x00000543,0x0003003e,0x00000064,
+0x00000545,0x0004003d,0x0000000e,0x00000546,
+0x00000064,0x000500c2,0x0000000e,0x00000547,
+0x00000546,0x00000522,0x0004003d,0x0000000e,
+0x00000548,0x00000064,0x000500c6,0x0000000e,
+0x00000549,0x00000548,0x00000547,0x0003003e,
+0x00000064,0x00000549,0x0004003d,0x0000000e,
+0x0000054a,0x00000064,0x000200fe,0x0000054a,
+0x00010038,0x00050036,0x0000000e,0x0000006b,
+0x00000000,0x00000025,0x00030037,0x0000000f,
+0x00000067,0x00030037,0x0000000f,0x00000068,
+0x00030037,0x0000000f,0x00000069,0x00030037,
+0x0000000f,0x0000006a,0x000200f8,0x0000006c,
+0x0004003b,0x0000000f,0x00000552,0x00000007,
+0x0004003b,0x0000000f,0x00000567,0x00000007,
+0x0004003b,0x0000000f,0x00000568,0x00000007,
+0x0004003b,0x0000000f,0x0000056b,0x00000007,
+0x0004003b,0x0000000f,0x0000056f,0x00000007,
+0x0004003b,0x0000000f,0x00000573,0x00000007,
+0x0004003b,0x0000000f,0x00000577,0x00000007,
+0x0004003b,0x0000000f,0x0000057c,0x00000007,
+0x0004003b,0x0000000f,0x00000580,0x00000007,
+0x0004003b,0x0000000f,0x00000585,0x00000007,
+0x0004003b,0x0000000f,0x0000058a,0x00000007,
+0x0004003b,0x0000000f,0x0000058f,0x00000007,
+0x0004003b,0x0000000f,0x00000594,0x00000007,
+0x0004003b,0x0000000f,0x00000599,0x00000007,
+0x0004003b,0x0000000f,0x0000059e,0x00000007,
+0x0004003b,0x0000000f,0x000005cf,0x00000007,
+0x0004003b,0x0000000f,0x000005d5,0x00000007,
+0x0004003b,0x0000000f,0x000005e4,0x00000007,
+0x0004003b,0x0000000f,0x00000610,0x00000007,
+0x0004003b,0x0000000f,0x00000620,0x00000007,
+0x0004003b,0x0000000f,0x00000630,0x00000007,
+0x0004003b,0x0000000f,0x0000063f,0x00000007,
+0x0004003d,0x0000000e,0x0000054d,0x0000006a,
+0x000500aa,0x0000009b,0x0000054e,0x0000054d,
+0x00000084,0x000300f7,0x00000550,0x00000000,
+0x000400fa,0x0000054e,0x0000054f,0x00000550,
+0x000200f8,0x0000054f,0x000200fe,0x000000cb,
+0x000200f8,0x00000550,0x0003003e,0x00000552,
+0x000000cb,0x00050041,0x00000557,0x00000558,
+0x00000556,0x00000126,0x0004003d,0x0000000e,
+0x00000559,0x00000558,0x000500ab,0x0000009b,
+0x0000055a,0x00000559,0x000000cb,0x000300f7,
+0x0000055c,0x00000000,0x000400fa,0x0000055a,
+0x0000055b,0x0000055c,0x000200f8,0x0000055b,
+0x0004003d,0x0000000e,0x0000055d,0x00000068,
+0x000500c4,0x0000000e,0x0000055e,0x0000055d,
+0x00000090,0x0003003e,0x00000068,0x0000055e,
+0x0004003d,0x0000000e,0x0000055f,0x00000069,
+0x000500c4,0x0000000e,0x00000560,0x0000055f,
+0x00000090,0x0003003e,0x00000069,0x00000560,
+0x000200f9,0x0000055c,0x000200f8,0x0000055c,
+0x0004003d,0x0000000e,0x00000561,0x0000006a,
+0x00050082,0x0000000e,0x00000562,0x00000561,
+0x00000084,0x00050084,0x0000000e,0x00000564,
+0x00000562,0x00000563,0x0004003d,0x0000000e,
+0x00000565,0x00000067,0x00050080,0x0000000e,
+0x00000566,0x00000565,0x00000564,0x0003003e,
+0x00000067,0x00000566,0x0004003d,0x0000000e,
+0x00000569,0x00000067,0x0003003e,0x00000568,
+0x00000569,0x00050039,0x0000000e,0x0000056a,
+0x00000065,0x00000568,0x0003003e,0x00000567,
+0x0000056a,0x0004003d,0x0000000e,0x0000056c,
+0x00000567,0x000500c7,0x0000000e,0x0000056e,
+0x0000056c,0x0000056d,0x0003003e,0x0000056b,
+0x0000056e,0x0004003d,0x0000000e,0x00000570,
+0x00000567,0x000500c2,0x0000000e,0x00000571,
+0x00000570,0x0000052c,0x000500c7,0x0000000e,
+0x00000572,0x00000571,0x0000056d,0x0003003e,
+0x0000056f,0x00000572,0x0004003d,0x0000000e,
+0x00000574,0x00000567,0x000500c2,0x0000000e,
+0x00000575,0x00000574,0x00000419,0x000500c7,
+0x0000000e,0x00000576,0x00000575,0x0000056d,
+0x0003003e,0x00000573,0x00000576,0x0004003d,
+0x0000000e,0x00000578,0x00000567,0x000500c2,
+0x0000000e,0x0000057a,0x00000578,0x00000579,
+0x000500c7,0x0000000e,0x0000057b,0x0000057a,
+0x0000056d,0x0003003e,0x00000577,0x0000057b,
+0x0004003d,0x0000000e,0x0000057d,0x00000567,
+0x000500c2,0x0000000e,0x0000057e,0x0000057d,
+0x00000535,0x000500c7,0x0000000e,0x0000057f,
+0x0000057e,0x0000056d,0x0003003e,0x0000057c,
+0x0000057f,0x0004003d,0x0000000e,0x00000581,
+0x00000567,0x000500c2,0x0000000e,0x00000583,
+0x00000581,0x00000582,0x000500c7,0x0000000e,
+0x00000584,0x00000583,0x0000056d,0x0003003e,
+0x00000580,0x00000584,0x0004003d,0x0000000e,
+0x00000586,0x00000567,0x000500c2,0x0000000e,
+0x00000588,0x00000586,0x00000587,0x000500c7,
+0x0000000e,0x00000589,0x00000588,0x0000056d,
+0x0003003e,0x00000585,0x00000589,0x0004003d,
+0x0000000e,0x0000058b,0x00000567,0x000500c2,
+0x0000000e,0x0000058d,0x0000058b,0x0000058c,
+0x000500c7,0x0000000e,0x0000058e,0x0000058d,
+0x0000056d,0x0003003e,0x0000058a,0x0000058e,
+0x0004003d,0x0000000e,0x00000590,0x00000567,
+0x000500c2,0x0000000e,0x00000592,0x00000590,
+0x00000591,0x000500c7,0x0000000e,0x00000593,
+0x00000592,0x0000056d,0x0003003e,0x0000058f,
+0x00000593,0x0004003d,0x0000000e,0x00000595,
+0x00000567,0x000500c2,0x0000000e,0x00000597,
+0x00000595,0x00000596,0x000500c7,0x0000000e,
+0x00000598,0x00000597,0x0000056d,0x0003003e,
+0x00000594,0x00000598,0x0004003d,0x0000000e,
+0x0000059a,0x00000567,0x000500c2,0x0000000e,
+0x0000059c,0x0000059a,0x0000059b,0x000500c7,
+0x0000000e,0x0000059d,0x0000059c,0x0000056d,
+0x0003003e,0x00000599,0x0000059d,0x0004003d,
+0x0000000e,0x0000059f,0x00000567,0x000500c2,
+0x0000000e,0x000005a1,0x0000059f,0x000005a0,
+0x0004003d,0x0000000e,0x000005a2,0x00000567,
+0x000500c4,0x0000000e,0x000005a3,0x000005a2,
+0x00000126,0x000500c5,0x0000000e,0x000005a4,
+0x000005a1,0x000005a3,0x000500c7,0x0000000e,
+0x000005a5,0x000005a4,0x0000056d,0x0003003e,
+0x0000059e,0x000005a5,0x0004003d,0x0000000e,
+0x000005a6,0x0000056b,0x0004003d,0x0000000e,
+0x000005a7,0x0000056b,0x00050084,0x0000000e,
+0x000005a8,0x000005a7,0x000005a6,0x0003003e,
+0x0000056b,0x000005a8,0x0004003d,0x0000000e,
+0x000005a9,0x0000056f,0x0004003d,0x0000000e,
+0x000005aa,0x0000056f,0x00050084,0x0000000e,
+0x000005ab,0x000005aa,0x000005a9,0x0003003e,
+0x0000056f,0x000005ab,0x0004003d,0x0000000e,
+0x000005ac,0x00000573,0x0004003d,0x0000000e,
+0x000005ad,0x00000573,0x00050084,0x0000000e,
+0x000005ae,0x000005ad,0x000005ac,0x0003003e,
+0x00000573,0x000005ae,0x0004003d,0x0000000e,
+0x000005af,0x00000577,0x0004003d,0x0000000e,
+0x000005b0,0x00000577,0x00050084,0x0000000e,
+0x000005b1,0x000005b0,0x000005af,0x0003003e,
+0x00000577,0x000005b1,0x0004003d,0x0000000e,
+0x000005b2,0x0000057c,0x0004003d,0x0000000e,
+0x000005b3,0x0000057c,0x00050084,0x0000000e,
+0x000005b4,0x000005b3,0x000005b2,0x0003003e,
+0x0000057c,0x000005b4,0x0004003d,0x0000000e,
+0x000005b5,0x00000580,0x0004003d,0x0000000e,
+0x000005b6,0x00000580,0x00050084,0x0000000e,
+0x000005b7,0x000005b6,0x000005b5,0x0003003e,
+0x00000580,0x000005b7,0x0004003d,0x0000000e,
+0x000005b8,0x00000585,0x0004003d,0x0000000e,
+0x000005b9,0x00000585,0x00050084,0x0000000e,
+0x000005ba,0x000005b9,0x000005b8,0x0003003e,
+0x00000585,0x000005ba,0x0004003d,0x0000000e,
+0x000005bb,0x0000058a,0x0004003d,0x0000000e,
+0x000005bc,0x0000058a,0x00050084,0x0000000e,
+0x000005bd,0x000005bc,0x000005bb,0x0003003e,
+0x0000058a,0x000005bd,0x0004003d,0x0000000e,
+0x000005be,0x0000058f,0x0004003d,0x0000000e,
+0x000005bf,0x0000058f,0x00050084,0x0000000e,
+0x000005c0,0x000005bf,0x000005be,0x0003003e,
+0x0000058f,0x000005c0,0x0004003d,0x0000000e,
+0x000005c1,0x00000594,0x0004003d,0x0000000e,
+0x000005c2,0x00000594,0x00050084,0x0000000e,
+0x000005c3,0x000005c2,0x000005c1,0x0003003e,
+0x00000594,0x000005c3,0x0004003d,0x0000000e,
+0x000005c4,0x00000599,0x0004003d,0x0000000e,
+0x000005c5,0x00000599,0x00050084,0x0000000e,
+0x000005c6,0x000005c5,0x000005c4,0x0003003e,
+0x00000599,0x000005c6,0x0004003d,0x0000000e,
+0x000005c7,0x0000059e,0x0004003d,0x0000000e,
+0x000005c8,0x0000059e,0x00050084,0x0000000e,
+0x000005c9,0x000005c8,0x000005c7,0x0003003e,
+0x0000059e,0x000005c9,0x0004003d,0x0000000e,
+0x000005ca,0x00000067,0x000500c7,0x0000000e,
+0x000005cb,0x000005ca,0x00000084,0x000500ab,
+0x0000009b,0x000005cc,0x000005cb,0x000000cb,
+0x000300f7,0x000005ce,0x00000000,0x000400fa,
+0x000005cc,0x000005cd,0x000005da,0x000200f8,
+0x000005cd,0x0004003d,0x0000000e,0x000005d0,
+0x00000067,0x000500c7,0x0000000e,0x000005d1,
+0x000005d0,0x000000e9,0x000500ab,0x0000009b,
+0x000005d2,0x000005d1,0x000000cb,0x000600a9,
+0x00000006,0x000005d3,0x000005d2,0x0000052c,
+0x00000112,0x0004007c,0x0000000e,0x000005d4,
+0x000005d3,0x0003003e,0x000005cf,0x000005d4,
+0x0004003d,0x0000000e,0x000005d6,0x0000006a,
+0x000500aa,0x0000009b,0x000005d7,0x000005d6,
+0x0000003d,0x000600a9,0x00000006,0x000005d8,
+0x000005d7,0x00000542,0x00000112,0x0004007c,
+0x0000000e,0x000005d9,0x000005d8,0x0003003e,
+0x000005d5,0x000005d9,0x000200f9,0x000005ce,
+0x000200f8,0x000005da,0x0004003d,0x0000000e,
+0x000005db,0x0000006a,0x000500aa,0x0000009b,
+0x000005dc,0x000005db,0x0000003d,0x000600a9,
+0x00000006,0x000005dd,0x000005dc,0x00000542,
+0x00000112,0x0004007c,0x0000000e,0x000005de,
+0x000005dd,0x0003003e,0x000005cf,0x000005de,
+0x0004003d,0x0000000e,0x000005df,0x00000067,
+0x000500c7,0x0000000e,0x000005e0,0x000005df,
+0x000000e9,0x000500ab,0x0000009b,0x000005e1,
+0x000005e0,0x000000cb,0x000600a9,0x00000006,
+0x000005e2,0x000005e1,0x0000052c,0x00000112,
+0x0004007c,0x0000000e,0x000005e3,0x000005e2,
+0x0003003e,0x000005d5,0x000005e3,0x000200f9,
+0x000005ce,0x000200f8,0x000005ce,0x0004003d,
+0x0000000e,0x000005e5,0x00000067,0x000500c7,
+0x0000000e,0x000005e7,0x000005e5,0x000005e6,
+0x000500ab,0x0000009b,0x000005e8,0x000005e7,
+0x000000cb,0x0004003d,0x0000000e,0x000005e9,
+0x000005cf,0x0004003d,0x0000000e,0x000005ea,
+0x000005d5,0x000600a9,0x0000000e,0x000005eb,
+0x000005e8,0x000005e9,0x000005ea,0x0003003e,
+0x000005e4,0x000005eb,0x0004003d,0x0000000e,
+0x000005ec,0x000005cf,0x0004003d,0x0000000e,
+0x000005ed,0x0000056b,0x000500c2,0x0000000e,
+0x000005ee,0x000005ed,0x000005ec,0x0003003e,
+0x0000056b,0x000005ee,0x0004003d,0x0000000e,
+0x000005ef,0x000005d5,0x0004003d,0x0000000e,
+0x000005f0,0x0000056f,0x000500c2,0x0000000e,
+0x000005f1,0x000005f0,0x000005ef,0x0003003e,
+0x0000056f,0x000005f1,0x0004003d,0x0000000e,
+0x000005f2,0x000005cf,0x0004003d,0x0000000e,
+0x000005f3,0x00000573,0x000500c2,0x0000000e,
+0x000005f4,0x000005f3,0x000005f2,0x0003003e,
+0x00000573,0x000005f4,0x0004003d,0x0000000e,
+0x000005f5,0x000005d5,0x0004003d,0x0000000e,
+0x000005f6,0x00000577,0x000500c2,0x0000000e,
+0x000005f7,0x000005f6,0x000005f5,0x0003003e,
+0x00000577,0x000005f7,0x0004003d,0x0000000e,
+0x000005f8,0x000005cf,0x0004003d,0x0000000e,
+0x000005f9,0x0000057c,0x000500c2,0x0000000e,
+0x000005fa,0x000005f9,0x000005f8,0x0003003e,
+0x0000057c,0x000005fa,0x0004003d,0x0000000e,
+0x000005fb,0x000005d5,0x0004003d,0x0000000e,
+0x000005fc,0x00000580,0x000500c2,0x0000000e,
+0x000005fd,0x000005fc,0x000005fb,0x0003003e,
+0x00000580,0x000005fd,0x0004003d,0x0000000e,
+0x000005fe,0x000005cf,0x0004003d,0x0000000e,
+0x000005ff,0x00000585,0x000500c2,0x0000000e,
+0x00000600,0x000005ff,0x000005fe,0x0003003e,
+0x00000585,0x00000600,0x0004003d,0x0000000e,
+0x00000601,0x000005d5,0x0004003d,0x0000000e,
+0x00000602,0x0000058a,0x000500c2,0x0000000e,
+0x00000603,0x00000602,0x00000601,0x0003003e,
+0x0000058a,0x00000603,0x0004003d,0x0000000e,
+0x00000604,0x000005e4,0x0004003d,0x0000000e,
+0x00000605,0x0000058f,0x000500c2,0x0000000e,
+0x00000606,0x00000605,0x00000604,0x0003003e,
+0x0000058f,0x00000606,0x0004003d,0x0000000e,
+0x00000607,0x000005e4,0x0004003d,0x0000000e,
+0x00000608,0x00000594,0x000500c2,0x0000000e,
+0x00000609,0x00000608,0x00000607,0x0003003e,
+0x00000594,0x00000609,0x0004003d,0x0000000e,
+0x0000060a,0x000005e4,0x0004003d,0x0000000e,
+0x0000060b,0x00000599,0x000500c2,0x0000000e,
+0x0000060c,0x0000060b,0x0000060a,0x0003003e,
+0x00000599,0x0000060c,0x0004003d,0x0000000e,
+0x0000060d,0x000005e4,0x0004003d,0x0000000e,
+0x0000060e,0x0000059e,0x000500c2,0x0000000e,
+0x0000060f,0x0000060e,0x0000060d,0x0003003e,
+0x0000059e,0x0000060f,0x0004003d,0x0000000e,
+0x00000611,0x0000056b,0x0004003d,0x0000000e,
+0x00000612,0x00000068,0x00050084,0x0000000e,
+0x00000613,0x00000611,0x00000612,0x0004003d,
+0x0000000e,0x00000614,0x0000056f,0x0004003d,
+0x0000000e,0x00000615,0x00000069,0x00050084,
+0x0000000e,0x00000616,0x00000614,0x00000615,
+0x00050080,0x0000000e,0x00000617,0x00000613,
+0x00000616,0x0004003d,0x0000000e,0x00000618,
+0x00000599,0x0004003d,0x0000000e,0x00000619,
+0x00000552,0x00050084,0x0000000e,0x0000061a,
+0x00000618,0x00000619,0x00050080,0x0000000e,
+0x0000061b,0x00000617,0x0000061a,0x0004003d,
+0x0000000e,0x0000061c,0x00000567,0x000500c2,
+0x0000000e,0x0000061e,0x0000061c,0x0000061d,
+0x00050080,0x0000000e,0x0000061f,0x0000061b,
+0x0000061e,0x0003003e,0x00000610,0x0000061f,
+0x0004003d,0x0000000e,0x00000621,0x00000573,
+0x0004003d,0x0000000e,0x00000622,0x00000068,
+0x00050084,0x0000000e,0x00000623,0x00000621,
+0x00000622,0x0004003d,0x0000000e,0x00000624,
+0x00000577,0x0004003d,0x0000000e,0x00000625,
+0x00000069,0x00050084,0x0000000e,0x00000626,
+0x00000624,0x00000625,0x00050080,0x0000000e,
+0x00000627,0x00000623,0x00000626,0x0004003d,
+0x0000000e,0x00000628,0x0000059e,0x0004003d,
+0x0000000e,0x00000629,0x00000552,0x00050084,
+0x0000000e,0x0000062a,0x00000628,0x00000629,
+0x00050080,0x0000000e,0x0000062b,0x00000627,
+0x0000062a,0x0004003d,0x0000000e,0x0000062c,
+0x00000567,0x000500c2,0x0000000e,0x0000062e,
+0x0000062c,0x0000062d,0x00050080,0x0000000e,
+0x0000062f,0x0000062b,0x0000062e,0x0003003e,
+0x00000620,0x0000062f,0x0004003d,0x0000000e,
+0x00000631,0x0000057c,0x0004003d,0x0000000e,
+0x00000632,0x00000068,0x00050084,0x0000000e,
+0x00000633,0x00000631,0x00000632,0x0004003d,
+0x0000000e,0x00000634,0x00000580,0x0004003d,
+0x0000000e,0x00000635,0x00000069,0x00050084,
+0x0000000e,0x00000636,0x00000634,0x00000635,
+0x00050080,0x0000000e,0x00000637,0x00000633,
+0x00000636,0x0004003d,0x0000000e,0x00000638,
+0x0000058f,0x0004003d,0x0000000e,0x00000639,
+0x00000552,0x00050084,0x0000000e,0x0000063a,
+0x00000638,0x00000639,0x00050080,0x0000000e,
+0x0000063b,0x00000637,0x0000063a,0x0004003d,
+0x0000000e,0x0000063c,0x00000567,0x000500c2,
+0x0000000e,0x0000063d,0x0000063c,0x00000542,
+0x00050080,0x0000000e,0x0000063e,0x0000063b,
+0x0000063d,0x0003003e,0x00000630,0x0000063e,
+0x0004003d,0x0000000e,0x00000640,0x00000585,
+0x0004003d,0x0000000e,0x00000641,0x00000068,
+0x00050084,0x0000000e,0x00000642,0x00000640,
+0x00000641,0x0004003d,0x0000000e,0x00000643,
+0x0000058a,0x0004003d,0x0000000e,0x00000644,
+0x00000069,0x00050084,0x0000000e,0x00000645,
+0x00000643,0x00000644,0x00050080,0x0000000e,
+0x00000646,0x00000642,0x00000645,0x0004003d,
+0x0000000e,0x00000647,0x00000594,0x0004003d,
+0x0000000e,0x00000648,0x00000552,0x00050084,
+0x0000000e,0x00000649,0x00000647,0x00000648,
+0x00050080,0x0000000e,0x0000064a,0x00000646,
+0x00000649,0x0004003d,0x0000000e,0x0000064b,
+0x00000567,0x000500c2,0x0000000e,0x0000064c,
+0x0000064b,0x00000126,0x00050080,0x0000000e,
+0x0000064d,0x0000064a,0x0000064c,0x0003003e,
+0x0000063f,0x0000064d,0x0004003d,0x0000000e,
+0x0000064f,0x00000610,0x000500c7,0x0000000e,
+0x00000650,0x0000064f,0x0000064e,0x0003003e,
+0x00000610,0x00000650,0x0004003d,0x0000000e,
+0x00000651,0x00000620,0x000500c7,0x0000000e,
+0x00000652,0x00000651,0x0000064e,0x0003003e,
+0x00000620,0x00000652,0x0004003d,0x0000000e,
+0x00000653,0x00000630,0x000500c7,0x0000000e,
+0x00000654,0x00000653,0x0000064e,0x0003003e,
+0x00000630,0x00000654,0x0004003d,0x0000000e,
+0x00000655,0x0000063f,0x000500c7,0x0000000e,
+0x00000656,0x00000655,0x0000064e,0x0003003e,
+0x0000063f,0x00000656,0x0004003d,0x0000000e,
+0x00000657,0x0000006a,0x000500b0,0x0000009b,
+0x00000658,0x00000657,0x000000e0,0x000300f7,
+0x0000065a,0x00000000,0x000400fa,0x00000658,
+0x00000659,0x0000065a,0x000200f8,0x00000659,
+0x0003003e,0x0000063f,0x000000cb,0x000200f9,
+0x0000065a,0x000200f8,0x0000065a,0x0004003d,
+0x0000000e,0x0000065b,0x0000006a,0x000500b0,
+0x0000009b,0x0000065c,0x0000065b,0x0000003d,
+0x000300f7,0x0000065e,0x00000000,0x000400fa,
+0x0000065c,0x0000065d,0x0000065e,0x000200f8,
+0x0000065d,0x0003003e,0x00000630,0x000000cb,
+0x000200f9,0x0000065e,0x000200f8,0x0000065e,
+0x0004003d,0x0000000e,0x0000065f,0x00000610,
+0x0004003d,0x0000000e,0x00000660,0x00000620,
+0x000500ae,0x0000009b,0x00000661,0x0000065f,
+0x00000660,0x0004003d,0x0000000e,0x00000662,
+0x00000610,0x0004003d,0x0000000e,0x00000663,
+0x00000630,0x000500ae,0x0000009b,0x00000664,
+0x00000662,0x00000663,0x000500a7,0x0000009b,
+0x00000665,0x00000661,0x00000664,0x0004003d,
+0x0000000e,0x00000666,0x00000610,0x0004003d,
+0x0000000e,0x00000667,0x0000063f,0x000500ae,
+0x0000009b,0x00000668,0x00000666,0x00000667,
+0x000500a7,0x0000009b,0x00000669,0x00000665,
+0x00000668,0x000300f7,0x0000066b,0x00000000,
+0x000400fa,0x00000669,0x0000066a,0x0000066d,
+0x000200f8,0x0000066a,0x000200fe,0x000000cb,
+0x000200f8,0x0000066d,0x0004003d,0x0000000e,
+0x0000066e,0x00000620,0x0004003d,0x0000000e,
+0x0000066f,0x00000630,0x000500ae,0x0000009b,
+0x00000670,0x0000066e,0x0000066f,0x0004003d,
+0x0000000e,0x00000671,0x00000620,0x0004003d,
+0x0000000e,0x00000672,0x0000063f,0x000500ae,
+0x0000009b,0x00000673,0x00000671,0x00000672,
+0x000500a7,0x0000009b,0x00000674,0x00000670,
+0x00000673,0x000300f7,0x00000676,0x00000000,
+0x000400fa,0x00000674,0x00000675,0x00000678,
+0x000200f8,0x00000675,0x000200fe,0x00000084,
+0x000200f8,0x00000678,0x0004003d,0x0000000e,
+0x00000679,0x00000630,0x0004003d,0x0000000e,
+0x0000067a,0x0000063f,0x000500ae,0x0000009b,
+0x0000067b,0x00000679,0x0000067a,0x000300f7,
+0x0000067d,0x00000000,0x000400fa,0x0000067b,
+0x0000067c,0x0000067f,0x000200f8,0x0000067c,
+0x000200fe,0x000000e9,0x000200f8,0x0000067f,
+0x000200fe,0x0000003d,0x000200f8,0x0000067d,
+0x000100ff,0x000200f8,0x00000676,0x000100ff,
+0x000200f8,0x0000066b,0x000100ff,0x00010038,
+0x00050036,0x0000006e,0x00000071,0x00000000,
+0x0000006f,0x00030037,0x00000017,0x00000070,
+0x000200f8,0x00000072,0x0004003b,0x00000010,
+0x00000682,0x00000007,0x0004003b,0x00000010,
+0x0000068d,0x00000007,0x0004003b,0x00000698,
+0x00000699,0x00000007,0x0003003e,0x00000682,
+0x0000010b,0x000200f9,0x00000683,0x000200f8,
+0x00000683,0x000400f6,0x00000685,0x00000686,
+0x00000000,0x000200f9,0x00000687,0x000200f8,
+0x00000687,0x0004003d,0x00000006,0x00000688,
+0x00000682,0x0004007c,0x0000000e,0x00000689,
+0x00000688,0x00060041,0x00000557,0x0000068a,
+0x00000556,0x0000010b,0x00000084,0x0004003d,
+0x0000000e,0x0000068b,0x0000068a,0x000500b0,
+0x0000009b,0x0000068c,0x00000689,0x0000068b,
+0x000400fa,0x0000068c,0x00000684,0x00000685,
+0x000200f8,0x00000684,0x0003003e,0x0000068d,
+0x0000010b,0x000200f9,0x0000068e,0x000200f8,
+0x0000068e,0x000400f6,0x00000690,0x00000691,
+0x00000000,0x000200f9,0x00000692,0x000200f8,
+0x00000692,0x0004003d,0x00000006,0x00000693,
+0x0000068d,0x0004007c,0x0000000e,0x00000694,
+0x00000693,0x00060041,0x00000557,0x00000695,
+0x00000556,0x0000010b,0x000000cb,0x0004003d,
+0x0000000e,0x00000696,0x00000695,0x000500b0,
+0x0000009b,0x00000697,0x00000694,0x00000696,
+0x000400fa,0x00000697,0x0000068f,0x00000690,
+0x000200f8,0x0000068f,0x0004003d,0x00000006,
+0x0000069a,0x00000682,0x0004007c,0x0000000e,
+0x0000069b,0x0000069a,0x00060041,0x00000557,
+0x0000069c,0x00000556,0x0000010b,0x000000cb,
+0x0004003d,0x0000000e,0x0000069d,0x0000069c,
+0x00050084,0x0000000e,0x0000069e,0x0000069b,
+0x0000069d,0x0004003d,0x00000006,0x0000069f,
+0x0000068d,0x0004007c,0x0000000e,0x000006a0,
+0x0000069f,0x00050080,0x0000000e,0x000006a1,
+0x0000069e,0x000006a0,0x0004003d,0x00000016,
+0x000006a2,0x00000070,0x00050041,0x00000017,
+0x000006a3,0x00000699,0x000006a1,0x0003003e,
+0x000006a3,0x000006a2,0x000200f9,0x00000691,
+0x000200f8,0x00000691,0x0004003d,0x00000006,
+0x000006a4,0x0000068d,0x00050080,0x00000006,
+0x000006a5,0x000006a4,0x00000090,0x0003003e,
+0x0000068d,0x000006a5,0x000200f9,0x0000068e,
+0x000200f8,0x00000690,0x000200f9,0x00000686,
+0x000200f8,0x00000686,0x0004003d,0x00000006,
+0x000006a6,0x00000682,0x00050080,0x00000006,
+0x000006a7,0x000006a6,0x00000090,0x0003003e,
+0x00000682,0x000006a7,0x000200f9,0x00000683,
+0x000200f8,0x00000685,0x0004003d,0x0000006e,
+0x000006a8,0x00000699,0x000200fe,0x000006a8,
+0x00010038,0x00050036,0x0000006e,0x00000074,
+0x00000000,0x00000073,0x000200f8,0x00000075,
+0x0004003b,0x00000017,0x000006ad,0x00000007,
+0x0003003e,0x000006ad,0x000006ac,0x00050039,
+0x0000006e,0x000006ae,0x00000071,0x000006ad,
+0x000200fe,0x000006ae,0x00010038,0x00050036,
+0x0000006e,0x00000078,0x00000000,0x00000076,
+0x00030037,0x00000016,0x00000077,0x000200f8,
+0x00000079,0x0004003b,0x0000000f,0x000006b1,
+0x00000007,0x0004003b,0x0000000f,0x000006b3,
+0x00000007,0x0004003b,0x0000000f,0x000006b7,
+0x00000007,0x0004003b,0x0000000f,0x000006bb,
+0x00000007,0x0004003b,0x0000000f,0x000006bf,
+0x00000007,0x0004003b,0x0000000f,0x000006c1,
+0x00000007,0x0004003b,0x0000000f,0x000006c3,
+0x00000007,0x0004003b,0x0000000f,0x000006c4,
+0x00000007,0x0004003b,0x00000010,0x000006c6,
+0x00000007,0x0004003b,0x0000000f,0x000006c8,
+0x00000007,0x0004003b,0x0000000f,0x000006ca,
+0x00000007,0x0004003b,0x00000010,0x000006cc,
+0x00000007,0x0004003b,0x0000000f,0x000006d3,
+0x00000007,0x0004003b,0x0000000f,0x000006d6,
+0x00000007,0x0004003b,0x00000010,0x000006d8,
+0x00000007,0x0004003b,0x0000000f,0x000006df,
+0x00000007,0x0004003b,0x0000000f,0x000006e1,
+0x00000007,0x0004003b,0x00000017,0x00000702,
+0x00000007,0x0004003b,0x00000017,0x00000710,
+0x00000007,0x0004003b,0x0000000f,0x00000723,
+0x00000007,0x0004003b,0x00000010,0x00000725,
+0x00000007,0x0004003b,0x0000000f,0x00000743,
+0x00000007,0x0004003b,0x00000010,0x00000745,
+0x00000007,0x0004003b,0x0000000f,0x00000765,
+0x00000007,0x0004003b,0x0000000f,0x00000766,
+0x00000007,0x0004003b,0x0000000f,0x00000767,
+0x00000007,0x0004003b,0x0000000f,0x00000768,
+0x00000007,0x0004003b,0x0000000f,0x0000079f,
+0x00000007,0x0004003b,0x0000000f,0x000007a0,
+0x00000007,0x0004003b,0x0000000f,0x000007a1,
+0x00000007,0x0004003b,0x0000000f,0x000007a3,
+0x00000007,0x0004003b,0x0000000f,0x000007a5,
+0x00000007,0x0004003b,0x0000000f,0x000007a7,
+0x00000007,0x0004003b,0x0000000f,0x000007a8,
+0x00000007,0x0004003b,0x0000000f,0x000007ac,
+0x00000007,0x0004003b,0x0000000f,0x000007ad,
+0x00000007,0x0004003b,0x00000017,0x000007ae,
+0x00000007,0x0004003b,0x0000000f,0x000007b0,
+0x00000007,0x0004003b,0x0000000f,0x000007b1,
+0x00000007,0x0004003b,0x0000000f,0x000007b3,
+0x00000007,0x0004003b,0x0000000f,0x000007b5,
+0x00000007,0x0004003b,0x0000000f,0x000007b7,
+0x00000007,0x0004003b,0x00000114,0x000007da,
+0x00000007,0x0004003b,0x00000017,0x000007db,
+0x00000007,0x0004003b,0x0000000f,0x000007dd,
+0x00000007,0x0004003b,0x0000000f,0x000007df,
+0x00000007,0x0004003b,0x0000000f,0x000007e1,
+0x00000007,0x0004003b,0x00000010,0x000007e4,
+0x00000007,0x0004003b,0x000007ee,0x000007ef,
+0x00000007,0x0004003b,0x00000812,0x00000813,
+0x00000007,0x0004003b,0x0000081a,0x0000081b,
+0x00000007,0x0004003b,0x0000026d,0x00000839,
+0x00000007,0x0004003b,0x00000017,0x0000083a,
+0x00000007,0x0004003b,0x0000000f,0x0000083c,
+0x00000007,0x0004003b,0x0000000f,0x0000083e,
+0x00000007,0x0004003b,0x0000000f,0x00000840,
+0x00000007,0x0004003b,0x00000010,0x00000843,
+0x00000007,0x0004003b,0x0000026d,0x0000085b,
+0x00000007,0x0004003b,0x00000862,0x00000863,
+0x00000007,0x0004003b,0x0000000f,0x0000087d,
+0x00000007,0x0004003b,0x00000017,0x0000087e,
+0x00000007,0x0004003b,0x0000000f,0x00000880,
+0x00000007,0x0004003b,0x0000000f,0x00000882,
+0x00000007,0x0004003b,0x0000000f,0x00000885,
+0x00000007,0x0004003b,0x0000088b,0x0000088c,
+0x00000007,0x0004003b,0x0000088b,0x00000894,
+0x00000007,0x0004003b,0x0000000f,0x000008ac,
+0x00000007,0x0004003b,0x0000000f,0x000008bb,
+0x00000007,0x0004003b,0x0000000f,0x000008bc,
+0x00000007,0x0004003b,0x0000000f,0x000008be,
+0x00000007,0x0004003b,0x0000000f,0x000008c0,
+0x00000007,0x0004003b,0x0000000f,0x000008c2,
+0x00000007,0x0004003b,0x0000000f,0x000008c6,
+0x00000007,0x0004003b,0x00000017,0x000008cb,
+0x00000007,0x0004003b,0x0000000f,0x000008d6,
+0x00000007,0x0004003b,0x0000000f,0x000008db,
+0x00000007,0x0004003b,0x0000000f,0x000008de,
+0x00000007,0x0004003b,0x00000812,0x000008e5,
+0x00000007,0x0004003b,0x0000000f,0x000008e9,
+0x00000007,0x0004003b,0x0000000f,0x000008f5,
+0x00000007,0x0004003b,0x0000000f,0x00000900,
+0x00000007,0x0004003b,0x00000017,0x00000903,
+0x00000007,0x0004003b,0x0000000f,0x00000905,
+0x00000007,0x0004003b,0x00000010,0x00000907,
+0x00000007,0x0004003b,0x0000000f,0x00000909,
+0x00000007,0x0004003b,0x00000010,0x0000090b,
+0x00000007,0x0004003b,0x0000000f,0x0000090e,
+0x00000007,0x0004003b,0x00000010,0x00000910,
+0x00000007,0x0004003b,0x0000000f,0x00000912,
+0x00000007,0x0004003b,0x00000010,0x00000914,
+0x00000007,0x0004003b,0x0000000f,0x00000919,
+0x00000007,0x0004003b,0x00000017,0x0000091a,
+0x00000007,0x0004003b,0x0000000f,0x0000091b,
+0x00000007,0x0004003b,0x0000000f,0x0000091d,
+0x00000007,0x0004003b,0x0000000f,0x00000920,
+0x00000007,0x0004003b,0x00000812,0x00000924,
+0x00000007,0x0004003b,0x0000000f,0x00000927,
+0x00000007,0x0004003b,0x0000000f,0x00000942,
+0x00000007,0x0004003b,0x0000000f,0x00000943,
+0x00000007,0x0004003b,0x0000000f,0x0000094d,
+0x00000007,0x0004003b,0x0000000f,0x00000955,
+0x00000007,0x0004003b,0x0000000f,0x0000095b,
+0x00000007,0x0004003b,0x0000000f,0x00000965,
+0x00000007,0x0004003b,0x0000000f,0x00000966,
+0x00000007,0x0004003b,0x0000000f,0x00000967,
+0x00000007,0x0004003b,0x0000000f,0x00000968,
+0x00000007,0x0004003b,0x0000097a,0x0000097b,
+0x00000007,0x0004003b,0x0000097a,0x0000097f,
+0x00000007,0x0004003b,0x0000097a,0x00000983,
+0x00000007,0x0004003b,0x0000000f,0x00000986,
+0x00000007,0x0004003b,0x0000000f,0x00000988,
+0x00000007,0x0004003b,0x0000000f,0x0000098a,
+0x00000007,0x0004003b,0x0000000f,0x0000098c,
+0x00000007,0x0004003b,0x0000000f,0x0000099c,
+0x00000007,0x0004003b,0x0000000f,0x0000099d,
+0x00000007,0x0004003b,0x0000000f,0x0000099f,
+0x00000007,0x0004003b,0x0000000f,0x000009a1,
+0x00000007,0x0004003b,0x0000000f,0x000009a3,
+0x00000007,0x0004003b,0x0000000f,0x000009a6,
+0x00000007,0x0004003b,0x0000000f,0x000009aa,
+0x00000007,0x0004003b,0x0000000f,0x000009ab,
+0x00000007,0x0004003b,0x0000000f,0x000009ac,
+0x00000007,0x0004003b,0x0000000f,0x000009ae,
+0x00000007,0x0004003b,0x0000000f,0x000009b0,
+0x00000007,0x0004003b,0x0000000f,0x000009b2,
+0x00000007,0x0004003b,0x0000000f,0x000009b3,
+0x00000007,0x0004003b,0x0000000f,0x000009b7,
+0x00000007,0x0004003b,0x0000000f,0x000009b9,
+0x00000007,0x0004003b,0x00000114,0x000009c6,
+0x00000007,0x0004003b,0x00000017,0x000009c7,
+0x00000007,0x0004003b,0x0000000f,0x000009c8,
+0x00000007,0x0004003b,0x0000000f,0x000009ca,
+0x00000007,0x0004003b,0x0000000f,0x000009cc,
+0x00000007,0x0004003b,0x00000010,0x000009cf,
+0x00000007,0x0004003b,0x0000036f,0x000009d7,
+0x00000007,0x0004003b,0x00000a8e,0x00000a8f,
+0x00000007,0x0004003b,0x00000a96,0x00000a97,
+0x00000007,0x0004003b,0x0000026d,0x00000aaa,
+0x00000007,0x0004003b,0x00000017,0x00000aab,
+0x00000007,0x0004003b,0x0000000f,0x00000aac,
+0x00000007,0x0004003b,0x0000000f,0x00000aae,
+0x00000007,0x0004003b,0x0000000f,0x00000ab0,
+0x00000007,0x0004003b,0x00000010,0x00000ab3,
+0x00000007,0x0004003b,0x0000088b,0x00000ac8,
+0x00000007,0x0004003b,0x00000acf,0x00000ad0,
+0x00000007,0x0004003b,0x0000000f,0x00000adf,
+0x00000007,0x0004003b,0x00000017,0x00000ae0,
+0x00000007,0x0004003b,0x0000000f,0x00000ae1,
+0x00000007,0x0004003b,0x0000000f,0x00000ae3,
+0x00000007,0x0004003b,0x0000000f,0x00000ae6,
+0x00000007,0x0004003b,0x00000aec,0x00000aed,
+0x00000007,0x0004003b,0x00000aec,0x00000af5,
+0x00000007,0x0004003b,0x0000000f,0x00000b02,
+0x00000007,0x0004003b,0x0000000f,0x00000b03,
+0x00000007,0x0004003b,0x00000b10,0x00000b11,
+0x00000007,0x0004003b,0x0000000f,0x00000b14,
+0x00000007,0x0004003b,0x0000000f,0x00000b16,
+0x00000007,0x0004003b,0x00000017,0x00000b19,
+0x00000007,0x0004003b,0x00000017,0x00000b1a,
+0x00000007,0x0004003b,0x0000000f,0x00000b21,
+0x00000007,0x0004003b,0x00000b29,0x00000b2a,
+0x00000007,0x0004003b,0x0000000f,0x00000b37,
+0x00000007,0x0004003b,0x0000000f,0x00000b3a,
+0x00000007,0x0004003b,0x0000000f,0x00000b44,
+0x00000007,0x0004003b,0x0000000f,0x00000b4e,
+0x00000007,0x0004003b,0x0000000f,0x00000b53,
+0x00000007,0x0004003b,0x0000000f,0x00000b54,
+0x00000007,0x0004003b,0x0000000f,0x00000b56,
+0x00000007,0x0004003b,0x0000000f,0x00000b58,
+0x00000007,0x0004003b,0x00000b62,0x00000b63,
+0x00000007,0x0004003b,0x00000698,0x00000b69,
+0x00000007,0x0004003b,0x00000b29,0x00000b72,
+0x00000007,0x0004003b,0x00000b29,0x00000b76,
+0x00000007,0x0004003b,0x00000b29,0x00000b7a,
+0x00000007,0x0004003b,0x00000b29,0x00000b86,
+0x00000007,0x0004003b,0x00000b29,0x00000b8a,
+0x00000007,0x0004003b,0x0000000f,0x00000b8e,
+0x00000007,0x0004003b,0x00000b29,0x00000b96,
+0x00000007,0x0004003b,0x00000b29,0x00000ba3,
+0x00000007,0x0004003b,0x00000b29,0x00000bb2,
+0x00000007,0x0004003b,0x00000b29,0x00000bc3,
+0x00000007,0x0004003b,0x0000000f,0x00000bd6,
+0x00000007,0x0004003b,0x0000000f,0x00000bde,
+0x00000007,0x0004003b,0x0000000f,0x00000be3,
+0x00000007,0x0004003b,0x0000000f,0x00000be8,
+0x00000007,0x0004003b,0x00000b29,0x00000bf1,
+0x00000007,0x0004003b,0x00000017,0x00000c09,
+0x00000007,0x0004003b,0x00000017,0x00000c0d,
+0x00000007,0x0004003b,0x00000017,0x00000c11,
+0x00000007,0x0004003b,0x0000000f,0x00000c26,
+0x00000007,0x0004003b,0x00000017,0x00000c27,
+0x00000007,0x0004003b,0x0000000f,0x00000c28,
+0x00000007,0x0004003b,0x0000000f,0x00000c2a,
+0x00000007,0x00050051,0x0000000e,0x000006b2,
+0x00000077,0x00000003,0x0003003e,0x000006b1,
+0x000006b2,0x0004003d,0x0000000e,0x000006b4,
+0x000006b1,0x000500c2,0x0000000e,0x000006b5,
+0x000006b4,0x00000527,0x000500c7,0x0000000e,
+0x000006b6,0x000006b5,0x0000003d,0x0003003e,
+0x000006b3,0x000006b6,0x0004003d,0x0000000e,
+0x000006b8,0x000006b1,0x000500c2,0x0000000e,
+0x000006b9,0x000006b8,0x00000112,0x000500c7,
+0x0000000e,0x000006ba,0x000006b9,0x0000003d,
+0x0003003e,0x000006b7,0x000006ba,0x0004003d,
+0x0000000e,0x000006bc,0x000006b1,0x000500c2,
+0x0000000e,0x000006bd,0x000006bc,0x00000126,
+0x000500c7,0x0000000e,0x000006be,0x000006bd,
+0x0000003d,0x0003003e,0x000006bb,0x000006be,
+0x0004003d,0x0000000e,0x000006c0,0x000006b7,
+0x0003003e,0x000006bf,0x000006c0,0x0004003d,
+0x0000000e,0x000006c2,0x000006b3,0x0003003e,
+0x000006c1,0x000006c2,0x0004003d,0x0000000e,
+0x000006c5,0x000006b1,0x0003003e,0x000006c4,
+0x000006c5,0x0003003e,0x000006c6,0x0000062d,
+0x00060039,0x0000000e,0x000006c7,0x00000014,
+0x000006c4,0x000006c6,0x0003003e,0x000006c3,
+0x000006c7,0x0004003d,0x0000000e,0x000006cb,
+0x000006b1,0x0003003e,0x000006ca,0x000006cb,
+0x0003003e,0x000006cc,0x000006c9,0x00060039,
+0x0000000e,0x000006cd,0x00000014,0x000006ca,
+0x000006cc,0x0003003e,0x000006c8,0x000006cd,
+0x0004003d,0x0000000e,0x000006ce,0x000006b1,
+0x000500c7,0x0000000e,0x000006cf,0x000006ce,
+0x0000003d,0x000500aa,0x0000009b,0x000006d0,
+0x000006cf,0x000000cb,0x000300f7,0x000006d2,
+0x00000000,0x000400fa,0x000006d0,0x000006d1,
+0x0000071f,0x000200f8,0x000006d1,0x0004003d,
+0x0000000e,0x000006d4,0x000006bb,0x000500c4,
+0x0000000e,0x000006d5,0x000006d4,0x00000090,
+0x0004003d,0x0000000e,0x000006d7,0x000006b1,
+0x0003003e,0x000006d6,0x000006d7,0x0003003e,
+0x000006d8,0x0000052c,0x00060039,0x0000000e,
+0x000006d9,0x00000014,0x000006d6,0x000006d8,
+0x000500c5,0x0000000e,0x000006da,0x000006d5,
+0x000006d9,0x0003003e,0x000006d3,0x000006da,
+0x0004003d,0x0000000e,0x000006db,0x000006b3,
+0x000500aa,0x0000009b,0x000006dc,0x000006db,
+0x000000cb,0x000300f7,0x000006de,0x00000000,
+0x000400fa,0x000006dc,0x000006dd,0x000006e4,
+0x000200f8,0x000006dd,0x0003003e,0x000006df,
+0x000006e0,0x0004003d,0x0000000e,0x000006e2,
+0x000006bf,0x00050080,0x0000000e,0x000006e3,
+0x000006e2,0x000000e9,0x0003003e,0x000006e1,
+0x000006e3,0x000200f9,0x000006de,0x000200f8,
+0x000006e4,0x0004003d,0x0000000e,0x000006e5,
+0x000006b3,0x000500aa,0x0000009b,0x000006e6,
+0x000006e5,0x00000084,0x000300f7,0x000006e8,
+0x00000000,0x000400fa,0x000006e6,0x000006e7,
+0x000006eb,0x000200f8,0x000006e7,0x0004003d,
+0x0000000e,0x000006e9,0x000006bf,0x00050080,
+0x0000000e,0x000006ea,0x000006e9,0x000000e9,
+0x0003003e,0x000006df,0x000006ea,0x0003003e,
+0x000006e1,0x000006e0,0x000200f9,0x000006e8,
+0x000200f8,0x000006eb,0x0004003d,0x0000000e,
+0x000006ec,0x000006b3,0x000500aa,0x0000009b,
+0x000006ed,0x000006ec,0x0000003d,0x000300f7,
+0x000006ef,0x00000000,0x000400fa,0x000006ed,
+0x000006ee,0x00000717,0x000200f8,0x000006ee,
+0x0004003d,0x0000000e,0x000006f0,0x000006b7,
+0x000500aa,0x0000009b,0x000006f1,0x000006f0,
+0x000000cb,0x000300f7,0x000006f3,0x00000000,
+0x000400fa,0x000006f1,0x000006f2,0x000006f5,
+0x000200f8,0x000006f2,0x0003003e,0x000006df,
+0x00000399,0x0003003e,0x000006e1,0x000006f4,
+0x000200f9,0x000006f3,0x000200f8,0x000006f5,
+0x0004003d,0x0000000e,0x000006f6,0x000006b7,
+0x000500aa,0x0000009b,0x000006f7,0x000006f6,
+0x00000084,0x000300f7,0x000006f9,0x00000000,
+0x000400fa,0x000006f7,0x000006f8,0x000006fa,
+0x000200f8,0x000006f8,0x0003003e,0x000006df,
+0x000006f4,0x0003003e,0x000006e1,0x00000399,
+0x000200f9,0x000006f9,0x000200f8,0x000006fa,
+0x0004003d,0x0000000e,0x000006fb,0x000006b1,
+0x000500c7,0x0000000e,0x000006fd,0x000006fb,
+0x000006fc,0x000500aa,0x0000009b,0x000006ff,
+0x000006fd,0x000006fe,0x000300f7,0x00000701,
+0x00000000,0x000400fa,0x000006ff,0x00000700,
+0x00000714,0x000200f8,0x00000700,0x00050051,
+0x0000000e,0x00000703,0x00000077,0x00000001,
+0x000500c2,0x0000000e,0x00000704,0x00000703,
+0x00000419,0x000500c7,0x0000000e,0x00000705,
+0x00000704,0x000006ab,0x00050051,0x0000000e,
+0x00000706,0x00000077,0x00000001,0x000500c2,
+0x0000000e,0x00000707,0x00000706,0x00000587,
+0x000500c7,0x0000000e,0x00000708,0x00000707,
+0x000006ab,0x00050051,0x0000000e,0x00000709,
+0x00000077,0x00000000,0x000500c2,0x0000000e,
+0x0000070a,0x00000709,0x00000419,0x000500c7,
+0x0000000e,0x0000070b,0x0000070a,0x000006ab,
+0x00050051,0x0000000e,0x0000070c,0x00000077,
+0x00000000,0x000500c2,0x0000000e,0x0000070d,
+0x0000070c,0x00000587,0x000500c7,0x0000000e,
+0x0000070e,0x0000070d,0x000006ab,0x00070050,
+0x00000016,0x0000070f,0x00000705,0x00000708,
+0x0000070b,0x0000070e,0x0003003e,0x00000702,
+0x0000070f,0x0004003d,0x00000016,0x00000711,
+0x00000702,0x0003003e,0x00000710,0x00000711,
+0x00050039,0x0000006e,0x00000712,0x00000071,
+0x00000710,0x000200fe,0x00000712,0x000200f8,
+0x00000714,0x00040039,0x0000006e,0x00000715,
+0x00000074,0x000200fe,0x00000715,0x000200f8,
+0x00000701,0x000100ff,0x000200f8,0x000006f9,
+0x000200f9,0x000006f3,0x000200f8,0x000006f3,
+0x000200f9,0x000006ef,0x000200f8,0x00000717,
+0x0004003d,0x0000000e,0x00000718,0x000006b1,
+0x000500c2,0x0000000e,0x00000719,0x00000718,
+0x000006c9,0x000500c7,0x0000000e,0x0000071a,
+0x00000719,0x0000003d,0x0003003e,0x000006c1,
+0x0000071a,0x0004003d,0x0000000e,0x0000071b,
+0x000006bf,0x00050080,0x0000000e,0x0000071c,
+0x0000071b,0x00000399,0x0003003e,0x000006df,
+0x0000071c,0x0004003d,0x0000000e,0x0000071d,
+0x000006c1,0x00050080,0x0000000e,0x0000071e,
+0x0000071d,0x00000399,0x0003003e,0x000006e1,
+0x0000071e,0x0003003e,0x000006c3,0x000000cb,
+0x0003003e,0x000006c8,0x000000cb,0x000200f9,
+0x000006ef,0x000200f8,0x000006ef,0x000200f9,
+0x000006e8,0x000200f8,0x000006e8,0x000200f9,
+0x000006de,0x000200f8,0x000006de,0x000200f9,
+0x000006d2,0x000200f8,0x0000071f,0x0004003d,
+0x0000000e,0x00000720,0x000006b1,0x000500c7,
+0x0000000e,0x00000721,0x00000720,0x0000003d,
+0x000500c4,0x0000000e,0x00000722,0x00000721,
+0x00000090,0x0004003d,0x0000000e,0x00000724,
+0x000006b1,0x0003003e,0x00000723,0x00000724,
+0x0003003e,0x00000725,0x0000052c,0x00060039,
+0x0000000e,0x00000726,0x00000014,0x00000723,
+0x00000725,0x000500c5,0x0000000e,0x00000727,
+0x00000722,0x00000726,0x0003003e,0x000006d3,
+0x00000727,0x0004003d,0x0000000e,0x00000728,
+0x000006bb,0x000500aa,0x0000009b,0x00000729,
+0x00000728,0x000000cb,0x000300f7,0x0000072b,
+0x00000000,0x000400fa,0x00000729,0x0000072a,
+0x00000730,0x000200f8,0x0000072a,0x0004003d,
+0x0000000e,0x0000072c,0x000006c1,0x00050080,
+0x0000000e,0x0000072d,0x0000072c,0x000000e0,
+0x0003003e,0x000006df,0x0000072d,0x0004003d,
+0x0000000e,0x0000072e,0x000006bf,0x00050080,
+0x0000000e,0x0000072f,0x0000072e,0x000000e9,
+0x0003003e,0x000006e1,0x0000072f,0x000200f9,
+0x0000072b,0x000200f8,0x00000730,0x0004003d,
+0x0000000e,0x00000731,0x000006bb,0x000500aa,
+0x0000009b,0x00000732,0x00000731,0x00000084,
+0x000300f7,0x00000734,0x00000000,0x000400fa,
+0x00000732,0x00000733,0x00000739,0x000200f8,
+0x00000733,0x0004003d,0x0000000e,0x00000735,
+0x000006c1,0x00050080,0x0000000e,0x00000736,
+0x00000735,0x000000dc,0x0003003e,0x000006df,
+0x00000736,0x0004003d,0x0000000e,0x00000737,
+0x000006bf,0x00050080,0x0000000e,0x00000738,
+0x00000737,0x000000e9,0x0003003e,0x000006e1,
+0x00000738,0x000200f9,0x00000734,0x000200f8,
+0x00000739,0x0004003d,0x0000000e,0x0000073a,
+0x000006bb,0x000500aa,0x0000009b,0x0000073b,
+0x0000073a,0x000000e9,0x000300f7,0x0000073d,
+0x00000000,0x000400fa,0x0000073b,0x0000073c,
+0x00000742,0x000200f8,0x0000073c,0x0004003d,
+0x0000000e,0x0000073e,0x000006bf,0x00050080,
+0x0000000e,0x0000073f,0x0000073e,0x000000e9,
+0x0003003e,0x000006df,0x0000073f,0x0004003d,
+0x0000000e,0x00000740,0x000006c1,0x00050080,
+0x0000000e,0x00000741,0x00000740,0x000000dc,
+0x0003003e,0x000006e1,0x00000741,0x000200f9,
+0x0000073d,0x000200f8,0x00000742,0x0004003d,
+0x0000000e,0x00000744,0x000006b1,0x0003003e,
+0x00000743,0x00000744,0x0003003e,0x00000745,
+0x00000419,0x00060039,0x0000000e,0x00000746,
+0x00000014,0x00000743,0x00000745,0x000500aa,
+0x0000009b,0x00000747,0x00000746,0x000000cb,
+0x000300f7,0x00000749,0x00000000,0x000400fa,
+0x00000747,0x00000748,0x0000074f,0x000200f8,
+0x00000748,0x0004003d,0x0000000e,0x0000074a,
+0x000006bf,0x00050080,0x0000000e,0x0000074b,
+0x0000074a,0x000000e9,0x0003003e,0x000006df,
+0x0000074b,0x0004003d,0x0000000e,0x0000074c,
+0x000006c1,0x000500c7,0x0000000e,0x0000074d,
+0x0000074c,0x00000084,0x00050080,0x0000000e,
+0x0000074e,0x0000074d,0x00000399,0x0003003e,
+0x000006e1,0x0000074e,0x000200f9,0x00000749,
+0x000200f8,0x0000074f,0x0004003d,0x0000000e,
+0x00000750,0x000006c1,0x000500c7,0x0000000e,
+0x00000751,0x00000750,0x00000084,0x00050080,
+0x0000000e,0x00000752,0x00000751,0x000000e9,
+0x0003003e,0x000006df,0x00000752,0x0004003d,
+0x0000000e,0x00000753,0x000006bf,0x00050080,
+0x0000000e,0x00000754,0x00000753,0x000000e9,
+0x0003003e,0x000006e1,0x00000754,0x000200f9,
+0x00000749,0x000200f8,0x00000749,0x000200f9,
+0x0000073d,0x000200f8,0x0000073d,0x000200f9,
+0x00000734,0x000200f8,0x00000734,0x000200f9,
+0x0000072b,0x000200f8,0x0000072b,0x000200f9,
+0x000006d2,0x000200f8,0x000006d2,0x0004003d,
+0x0000000e,0x00000755,0x000006df,0x00060041,
+0x00000557,0x00000756,0x00000556,0x0000010b,
+0x000000cb,0x0004003d,0x0000000e,0x00000757,
+0x00000756,0x000500ac,0x0000009b,0x00000758,
+0x00000755,0x00000757,0x000400a8,0x0000009b,
+0x00000759,0x00000758,0x000300f7,0x0000075b,
+0x00000000,0x000400fa,0x00000759,0x0000075a,
+0x0000075b,0x000200f8,0x0000075a,0x0004003d,
+0x0000000e,0x0000075c,0x000006e1,0x00060041,
+0x00000557,0x0000075d,0x00000556,0x0000010b,
+0x00000084,0x0004003d,0x0000000e,0x0000075e,
+0x0000075d,0x000500ac,0x0000009b,0x0000075f,
+0x0000075c,0x0000075e,0x000200f9,0x0000075b,
+0x000200f8,0x0000075b,0x000700f5,0x0000009b,
+0x00000760,0x00000758,0x000006d2,0x0000075f,
+0x0000075a,0x000300f7,0x00000762,0x00000000,
+0x000400fa,0x00000760,0x00000761,0x00000762,
+0x000200f8,0x00000761,0x00040039,0x0000006e,
+0x00000763,0x00000074,0x000200fe,0x00000763,
+0x000200f8,0x00000762,0x0003003e,0x00000765,
+0x000000cb,0x0003003e,0x00000766,0x000000cb,
+0x0003003e,0x00000767,0x000000cb,0x0004003d,
+0x0000000e,0x00000769,0x000006e1,0x0004003d,
+0x0000000e,0x0000076a,0x000006df,0x00050084,
+0x0000000e,0x0000076b,0x00000769,0x0000076a,
+0x0004003d,0x0000000e,0x0000076c,0x000006c3,
+0x00050080,0x0000000e,0x0000076d,0x0000076c,
+0x00000084,0x00050084,0x0000000e,0x0000076e,
+0x0000076b,0x0000076d,0x0003003e,0x00000768,
+0x0000076e,0x0004003d,0x0000000e,0x00000770,
+0x00000768,0x000500b0,0x0000009b,0x00000771,
+0x0000076f,0x00000770,0x000300f7,0x00000773,
+0x00000000,0x000400fa,0x00000771,0x00000772,
+0x00000773,0x000200f8,0x00000772,0x00040039,
+0x0000006e,0x00000774,0x00000074,0x000200fe,
+0x00000774,0x000200f8,0x00000773,0x0004003d,
+0x0000000e,0x00000776,0x000006c8,0x000500aa,
+0x0000009b,0x00000777,0x00000776,0x000000cb,
+0x000300f7,0x00000779,0x00000000,0x000400fa,
+0x00000777,0x00000778,0x0000078c,0x000200f8,
+0x00000778,0x0004003d,0x0000000e,0x0000077a,
+0x000006d3,0x000300f7,0x00000782,0x00000000,
+0x000f00fb,0x0000077a,0x00000781,0x00000002,
+0x0000077b,0x00000003,0x0000077c,0x00000004,
+0x0000077d,0x00000005,0x0000077e,0x00000006,
+0x0000077f,0x00000007,0x00000780,0x000200f8,
+0x00000781,0x00040039,0x0000006e,0x00000789,
+0x00000074,0x000200fe,0x00000789,0x000200f8,
+0x0000077b,0x0003003e,0x00000767,0x00000084,
+0x000200f9,0x00000782,0x000200f8,0x0000077c,
+0x0003003e,0x00000765,0x00000084,0x000200f9,
+0x00000782,0x000200f8,0x0000077d,0x0003003e,
+0x00000767,0x000000e9,0x000200f9,0x00000782,
+0x000200f8,0x0000077e,0x0003003e,0x00000766,
+0x00000084,0x000200f9,0x00000782,0x000200f8,
+0x0000077f,0x0003003e,0x00000765,0x00000084,
+0x0003003e,0x00000767,0x00000084,0x000200f9,
+0x00000782,0x000200f8,0x00000780,0x0003003e,
+0x00000767,0x0000003d,0x000200f9,0x00000782,
+0x000200f8,0x00000782,0x000200f9,0x00000779,
+0x000200f8,0x0000078c,0x0004003d,0x0000000e,
+0x0000078d,0x000006d3,0x000300f7,0x00000795,
+0x00000000,0x000f00fb,0x0000078d,0x00000794,
+0x00000002,0x0000078e,0x00000003,0x0000078f,
+0x00000004,0x00000790,0x00000005,0x00000791,
+0x00000006,0x00000792,0x00000007,0x00000793,
+0x000200f8,0x00000794,0x00040039,0x0000006e,
+0x0000079c,0x00000074,0x000200fe,0x0000079c,
+0x000200f8,0x0000078e,0x0003003e,0x00000767,
+0x00000084,0x0003003e,0x00000766,0x00000084,
+0x000200f9,0x00000795,0x000200f8,0x0000078f,
+0x0003003e,0x00000765,0x00000084,0x0003003e,
+0x00000767,0x000000e9,0x000200f9,0x00000795,
+0x000200f8,0x00000790,0x0003003e,0x00000767,
+0x000000e0,0x000200f9,0x00000795,0x000200f8,
+0x00000791,0x0003003e,0x00000766,0x00000084,
+0x0003003e,0x00000767,0x000000e9,0x000200f9,
+0x00000795,0x000200f8,0x00000792,0x0003003e,
+0x00000765,0x00000084,0x0003003e,0x00000767,
+0x0000003d,0x000200f9,0x00000795,0x000200f8,
+0x00000793,0x0003003e,0x00000767,0x00000034,
+0x000200f9,0x00000795,0x000200f8,0x00000795,
+0x000200f9,0x00000779,0x000200f8,0x00000779,
+0x0003003e,0x0000079f,0x000000cb,0x0003003e,
+0x000007a0,0x000000cb,0x0004003d,0x0000000e,
+0x000007a2,0x00000765,0x0003003e,0x000007a1,
+0x000007a2,0x0004003d,0x0000000e,0x000007a4,
+0x00000766,0x0003003e,0x000007a3,0x000007a4,
+0x0004003d,0x0000000e,0x000007a6,0x00000767,
+0x0003003e,0x000007a5,0x000007a6,0x00090039,
+0x00000002,0x000007a9,0x00000032,0x000007a1,
+0x000007a3,0x000007a5,0x000007a7,0x000007a8,
+0x0004003d,0x0000000e,0x000007aa,0x000007a7,
+0x0003003e,0x000007a0,0x000007aa,0x0004003d,
+0x0000000e,0x000007ab,0x000007a8,0x0003003e,
+0x0000079f,0x000007ab,0x0003003e,0x000007ac,
+0x000000cb,0x0003003e,0x000007ad,0x000000cb,
+0x000400cc,0x00000016,0x000007af,0x00000077,
+0x0003003e,0x000007ae,0x000007af,0x0004003d,
+0x0000000e,0x000007b2,0x00000768,0x0003003e,
+0x000007b1,0x000007b2,0x0004003d,0x0000000e,
+0x000007b4,0x00000765,0x0003003e,0x000007b3,
+0x000007b4,0x0004003d,0x0000000e,0x000007b6,
+0x00000766,0x0003003e,0x000007b5,0x000007b6,
+0x0004003d,0x0000000e,0x000007b8,0x00000767,
+0x0003003e,0x000007b7,0x000007b8,0x00080039,
+0x0000000e,0x000007b9,0x0000002a,0x000007b1,
+0x000007b3,0x000007b5,0x000007b7,0x0003003e,
+0x000007b0,0x000007b9,0x0004003d,0x0000000e,
+0x000007ba,0x000007b0,0x000500b0,0x0000009b,
+0x000007bc,0x000007ba,0x000007bb,0x0004003d,
+0x0000000e,0x000007bd,0x000007b0,0x000500ac,
+0x0000009b,0x000007bf,0x000007bd,0x000007be,
+0x000500a6,0x0000009b,0x000007c0,0x000007bc,
+0x000007bf,0x000300f7,0x000007c2,0x00000000,
+0x000400fa,0x000007c0,0x000007c1,0x000007c2,
+0x000200f8,0x000007c1,0x00040039,0x0000006e,
+0x000007c3,0x00000074,0x000200fe,0x000007c3,
+0x000200f8,0x000007c2,0x00050041,0x0000000f,
+0x000007c5,0x000007ae,0x0000003d,0x0004003d,
+0x0000000e,0x000007c6,0x000007c5,0x00050041,
+0x0000000f,0x000007c7,0x000007ae,0x000000e9,
+0x0004003d,0x0000000e,0x000007c8,0x000007c7,
+0x00050041,0x0000000f,0x000007c9,0x000007ae,
+0x00000084,0x0004003d,0x0000000e,0x000007ca,
+0x000007c9,0x00050041,0x0000000f,0x000007cb,
+0x000007ae,0x000000cb,0x0004003d,0x0000000e,
+0x000007cc,0x000007cb,0x00070050,0x00000016,
+0x000007cd,0x000007c6,0x000007c8,0x000007ca,
+0x000007cc,0x0003003e,0x000007ae,0x000007cd,
+0x000200f9,0x000007ce,0x000200f8,0x000007ce,
+0x000400f6,0x000007d0,0x000007d1,0x00000000,
+0x000200f9,0x000007d2,0x000200f8,0x000007d2,
+0x0004003d,0x0000000e,0x000007d3,0x000007ad,
+0x0004003d,0x0000000e,0x000007d4,0x00000768,
+0x000500b0,0x0000009b,0x000007d5,0x000007d3,
+0x000007d4,0x000400fa,0x000007d5,0x000007cf,
+0x000007d0,0x000200f8,0x000007cf,0x0004003d,
+0x0000000e,0x000007d6,0x00000765,0x000500aa,
+0x0000009b,0x000007d7,0x000007d6,0x00000084,
+0x000300f7,0x000007d9,0x00000000,0x000400fa,
+0x000007d7,0x000007d8,0x00000834,0x000200f8,
+0x000007d8,0x0004003d,0x00000016,0x000007dc,
+0x000007ae,0x0003003e,0x000007db,0x000007dc,
+0x0004003d,0x0000000e,0x000007de,0x000007ac,
+0x0003003e,0x000007dd,0x000007de,0x0004003d,
+0x0000000e,0x000007e0,0x000007b0,0x0003003e,
+0x000007df,0x000007e0,0x0004003d,0x0000000e,
+0x000007e2,0x00000767,0x0003003e,0x000007e1,
+0x000007e2,0x00080039,0x00000035,0x000007e3,
+0x0000003b,0x000007db,0x000007dd,0x000007df,
+0x000007e1,0x0003003e,0x000007da,0x000007e3,
+0x0003003e,0x000007e4,0x0000010b,0x000200f9,
+0x000007e5,0x000200f8,0x000007e5,0x000400f6,
+0x000007e7,0x000007e8,0x00000000,0x000200f9,
+0x000007e9,0x000200f8,0x000007e9,0x0004003d,
+0x00000006,0x000007ea,0x000007e4,0x000500b1,
+0x0000009b,0x000007eb,0x000007ea,0x00000112,
+0x000400fa,0x000007eb,0x000007e6,0x000007e7,
+0x000200f8,0x000007e6,0x0004003d,0x0000000e,
+0x000007f0,0x000007ad,0x0004003d,0x0000000e,
+0x00000811,0x00000767,0x0003003e,0x00000813,
+0x00000810,0x00050041,0x0000000f,0x00000814,
+0x00000813,0x00000811,0x0004003d,0x0000000e,
+0x00000815,0x00000814,0x0004003d,0x00000006,
+0x00000816,0x000007e4,0x00050041,0x0000000f,
+0x00000817,0x000007da,0x00000816,0x0004003d,
+0x0000000e,0x00000818,0x00000817,0x00050080,
+0x0000000e,0x00000819,0x00000815,0x00000818,
+0x0003003e,0x0000081b,0x0000080c,0x00050041,
+0x0000000f,0x0000081c,0x0000081b,0x00000819,
+0x0004003d,0x0000000e,0x0000081d,0x0000081c,
+0x00050041,0x0000000f,0x0000081e,0x000007ef,
+0x000007f0,0x0003003e,0x0000081e,0x0000081d,
+0x0004003d,0x0000000e,0x0000081f,0x000007ad,
+0x00050041,0x0000000f,0x00000820,0x000007ef,
+0x0000081f,0x0004003d,0x0000000e,0x00000821,
+0x00000820,0x000500ac,0x0000009b,0x00000822,
+0x00000821,0x0000008a,0x000300f7,0x00000824,
+0x00000000,0x000400fa,0x00000822,0x00000823,
+0x00000824,0x000200f8,0x00000823,0x0004003d,
+0x0000000e,0x00000825,0x000007ad,0x00050041,
+0x0000000f,0x00000826,0x000007ef,0x00000825,
+0x0004003d,0x0000000e,0x00000827,0x00000826,
+0x00050080,0x0000000e,0x00000828,0x00000827,
+0x00000084,0x00050041,0x0000000f,0x00000829,
+0x000007ef,0x00000825,0x0003003e,0x00000829,
+0x00000828,0x000200f9,0x00000824,0x000200f8,
+0x00000824,0x0004003d,0x0000000e,0x0000082a,
+0x000007ad,0x00050080,0x0000000e,0x0000082b,
+0x0000082a,0x00000090,0x0003003e,0x000007ad,
+0x0000082b,0x0004003d,0x0000000e,0x0000082c,
+0x000007ad,0x0004003d,0x0000000e,0x0000082d,
+0x00000768,0x000500ae,0x0000009b,0x0000082e,
+0x0000082c,0x0000082d,0x000300f7,0x00000830,
+0x00000000,0x000400fa,0x0000082e,0x0000082f,
+0x00000830,0x000200f8,0x0000082f,0x000200f9,
+0x000007e7,0x000200f8,0x00000830,0x000200f9,
+0x000007e8,0x000200f8,0x000007e8,0x0004003d,
+0x00000006,0x00000832,0x000007e4,0x00050080,
+0x00000006,0x00000833,0x00000832,0x00000090,
+0x0003003e,0x000007e4,0x00000833,0x000200f9,
+0x000007e5,0x000200f8,0x000007e7,0x000200f9,
+0x000007d9,0x000200f8,0x00000834,0x0004003d,
+0x0000000e,0x00000835,0x00000766,0x000500aa,
+0x0000009b,0x00000836,0x00000835,0x00000084,
+0x000300f7,0x00000838,0x00000000,0x000400fa,
+0x00000836,0x00000837,0x0000087c,0x000200f8,
+0x00000837,0x0004003d,0x00000016,0x0000083b,
+0x000007ae,0x0003003e,0x0000083a,0x0000083b,
+0x0004003d,0x0000000e,0x0000083d,0x000007ac,
+0x0003003e,0x0000083c,0x0000083d,0x0004003d,
+0x0000000e,0x0000083f,0x000007b0,0x0003003e,
+0x0000083e,0x0000083f,0x0004003d,0x0000000e,
+0x00000841,0x00000767,0x0003003e,0x00000840,
+0x00000841,0x00080039,0x0000003e,0x00000842,
+0x00000044,0x0000083a,0x0000083c,0x0000083e,
+0x00000840,0x0003003e,0x00000839,0x00000842,
+0x0003003e,0x00000843,0x0000010b,0x000200f9,
+0x00000844,0x000200f8,0x00000844,0x000400f6,
+0x00000846,0x00000847,0x00000000,0x000200f9,
+0x00000848,0x000200f8,0x00000848,0x0004003d,
+0x00000006,0x00000849,0x00000843,0x000500b1,
+0x0000009b,0x0000084a,0x00000849,0x0000026b,
+0x000400fa,0x0000084a,0x00000845,0x00000846,
+0x000200f8,0x00000845,0x0004003d,0x0000000e,
+0x0000084b,0x000007ad,0x0004003d,0x0000000e,
+0x0000085a,0x00000767,0x0003003e,0x0000085b,
+0x00000859,0x00050041,0x0000000f,0x0000085c,
+0x0000085b,0x0000085a,0x0004003d,0x0000000e,
+0x0000085d,0x0000085c,0x0004003d,0x00000006,
+0x0000085e,0x00000843,0x00050041,0x0000000f,
+0x0000085f,0x00000839,0x0000085e,0x0004003d,
+0x0000000e,0x00000860,0x0000085f,0x00050080,
+0x0000000e,0x00000861,0x0000085d,0x00000860,
+0x0003003e,0x00000863,0x00000858,0x00050041,
+0x0000000f,0x00000864,0x00000863,0x00000861,
+0x0004003d,0x0000000e,0x00000865,0x00000864,
+0x00050041,0x0000000f,0x00000866,0x000007ef,
+0x0000084b,0x0003003e,0x00000866,0x00000865,
+0x0004003d,0x0000000e,0x00000867,0x000007ad,
+0x00050041,0x0000000f,0x00000868,0x000007ef,
+0x00000867,0x0004003d,0x0000000e,0x00000869,
+0x00000868,0x000500ac,0x0000009b,0x0000086a,
+0x00000869,0x0000008a,0x000300f7,0x0000086c,
+0x00000000,0x000400fa,0x0000086a,0x0000086b,
+0x0000086c,0x000200f8,0x0000086b,0x0004003d,
+0x0000000e,0x0000086d,0x000007ad,0x00050041,
+0x0000000f,0x0000086e,0x000007ef,0x0000086d,
+0x0004003d,0x0000000e,0x0000086f,0x0000086e,
+0x00050080,0x0000000e,0x00000870,0x0000086f,
+0x00000084,0x00050041,0x0000000f,0x00000871,
+0x000007ef,0x0000086d,0x0003003e,0x00000871,
+0x00000870,0x000200f9,0x0000086c,0x000200f8,
+0x0000086c,0x0004003d,0x0000000e,0x00000872,
+0x000007ad,0x00050080,0x0000000e,0x00000873,
+0x00000872,0x00000090,0x0003003e,0x000007ad,
+0x00000873,0x0004003d,0x0000000e,0x00000874,
+0x000007ad,0x0004003d,0x0000000e,0x00000875,
+0x00000768,0x000500ae,0x0000009b,0x00000876,
+0x00000874,0x00000875,0x000300f7,0x00000878,
+0x00000000,0x000400fa,0x00000876,0x00000877,
+0x00000878,0x000200f8,0x00000877,0x000200f9,
+0x00000846,0x000200f8,0x00000878,0x000200f9,
+0x00000847,0x000200f8,0x00000847,0x0004003d,
+0x00000006,0x0000087a,0x00000843,0x00050080,
+0x00000006,0x0000087b,0x0000087a,0x00000090,
+0x0003003e,0x00000843,0x0000087b,0x000200f9,
+0x00000844,0x000200f8,0x00000846,0x000200f9,
+0x00000838,0x000200f8,0x0000087c,0x0004003d,
+0x00000016,0x0000087f,0x000007ae,0x0003003e,
+0x0000087e,0x0000087f,0x0004003d,0x0000000e,
+0x00000881,0x000007ac,0x0003003e,0x00000880,
+0x00000881,0x0004003d,0x0000000e,0x00000883,
+0x0000079f,0x0003003e,0x00000882,0x00000883,
+0x00070039,0x0000000e,0x00000884,0x0000001c,
+0x0000087e,0x00000880,0x00000882,0x0003003e,
+0x0000087d,0x00000884,0x0004003d,0x0000000e,
+0x00000886,0x0000087d,0x0004003d,0x0000000e,
+0x00000889,0x00000767,0x00050082,0x0000000e,
+0x0000088a,0x00000889,0x00000084,0x0003003e,
+0x0000088c,0x00000888,0x00050041,0x0000000f,
+0x0000088d,0x0000088c,0x0000088a,0x0004003d,
+0x0000000e,0x0000088e,0x0000088d,0x00050084,
+0x0000000e,0x0000088f,0x00000886,0x0000088e,
+0x0004003d,0x0000000e,0x00000890,0x0000087d,
+0x0004003d,0x0000000e,0x00000892,0x00000767,
+0x00050082,0x0000000e,0x00000893,0x00000892,
+0x00000084,0x0003003e,0x00000894,0x00000891,
+0x00050041,0x0000000f,0x00000895,0x00000894,
+0x00000893,0x0004003d,0x0000000e,0x00000896,
+0x00000895,0x000500c2,0x0000000e,0x00000897,
+0x00000890,0x00000896,0x000500c5,0x0000000e,
+0x00000898,0x0000088f,0x00000897,0x0003003e,
+0x00000885,0x00000898,0x0004003d,0x0000000e,
+0x00000899,0x000007ad,0x0004003d,0x0000000e,
+0x0000089a,0x00000885,0x00050041,0x0000000f,
+0x0000089b,0x000007ef,0x00000899,0x0003003e,
+0x0000089b,0x0000089a,0x0004003d,0x0000000e,
+0x0000089c,0x000007ad,0x00050041,0x0000000f,
+0x0000089d,0x000007ef,0x0000089c,0x0004003d,
+0x0000000e,0x0000089e,0x0000089d,0x000500ac,
+0x0000009b,0x0000089f,0x0000089e,0x0000008a,
+0x000300f7,0x000008a1,0x00000000,0x000400fa,
+0x0000089f,0x000008a0,0x000008a1,0x000200f8,
+0x000008a0,0x0004003d,0x0000000e,0x000008a2,
+0x000007ad,0x00050041,0x0000000f,0x000008a3,
+0x000007ef,0x000008a2,0x0004003d,0x0000000e,
+0x000008a4,0x000008a3,0x00050080,0x0000000e,
+0x000008a5,0x000008a4,0x00000084,0x00050041,
+0x0000000f,0x000008a6,0x000007ef,0x000008a2,
+0x0003003e,0x000008a6,0x000008a5,0x000200f9,
+0x000008a1,0x000200f8,0x000008a1,0x0004003d,
+0x0000000e,0x000008a7,0x000007ad,0x00050080,
+0x0000000e,0x000008a8,0x000008a7,0x00000090,
+0x0003003e,0x000007ad,0x000008a8,0x000200f9,
+0x00000838,0x000200f8,0x00000838,0x000200f9,
+0x000007d9,0x000200f8,0x000007d9,0x0004003d,
+0x0000000e,0x000008a9,0x0000079f,0x0004003d,
+0x0000000e,0x000008aa,0x000007ac,0x00050080,
+0x0000000e,0x000008ab,0x000008aa,0x000008a9,
+0x0003003e,0x000007ac,0x000008ab,0x000200f9,
+0x000007d1,0x000200f8,0x000007d1,0x000200f9,
+0x000007ce,0x000200f8,0x000007d0,0x0004003d,
+0x0000000e,0x000008ad,0x000006b1,0x000500c2,
+0x0000000e,0x000008af,0x000008ad,0x000008ae,
+0x000500c7,0x0000000e,0x000008b0,0x000008af,
+0x0000003d,0x00050080,0x0000000e,0x000008b1,
+0x000008b0,0x00000084,0x0003003e,0x000008ac,
+0x000008b1,0x0004003d,0x0000000e,0x000008b2,
+0x000006c3,0x000500aa,0x0000009b,0x000008b3,
+0x000008b2,0x00000084,0x0004003d,0x0000000e,
+0x000008b4,0x000008ac,0x000500aa,0x0000009b,
+0x000008b5,0x000008b4,0x000000e0,0x000500a7,
+0x0000009b,0x000008b6,0x000008b3,0x000008b5,
+0x000300f7,0x000008b8,0x00000000,0x000400fa,
+0x000008b6,0x000008b7,0x000008b8,0x000200f8,
+0x000008b7,0x00040039,0x0000006e,0x000008b9,
+0x00000074,0x000200fe,0x000008b9,0x000200f8,
+0x000008b8,0x0004003d,0x0000000e,0x000008bd,
+0x00000768,0x0003003e,0x000008bc,0x000008bd,
+0x0004003d,0x0000000e,0x000008bf,0x00000765,
+0x0003003e,0x000008be,0x000008bf,0x0004003d,
+0x0000000e,0x000008c1,0x00000766,0x0003003e,
+0x000008c0,0x000008c1,0x0004003d,0x0000000e,
+0x000008c3,0x00000767,0x0003003e,0x000008c2,
+0x000008c3,0x00080039,0x0000000e,0x000008c4,
+0x0000002a,0x000008bc,0x000008be,0x000008c0,
+0x000008c2,0x00050082,0x0000000e,0x000008c5,
+0x000002ad,0x000008c4,0x0003003e,0x000008bb,
+0x000008c5,0x0003003e,0x000008c6,0x000000cb,
+0x0004003d,0x0000000e,0x000008c7,0x000008ac,
+0x000500aa,0x0000009b,0x000008c8,0x000008c7,
+0x00000084,0x000300f7,0x000008ca,0x00000000,
+0x000400fa,0x000008c8,0x000008c9,0x000008d5,
+0x000200f8,0x000008c9,0x0004003d,0x0000000e,
+0x000008cc,0x000006b1,0x000500c2,0x0000000e,
+0x000008ce,0x000008cc,0x000008cd,0x000500c7,
+0x0000000e,0x000008cf,0x000008ce,0x0000056d,
+0x00050041,0x0000000f,0x000008d0,0x000008cb,
+0x000000cb,0x0003003e,0x000008d0,0x000008cf,
+0x0004003d,0x0000000e,0x000008d1,0x000008bb,
+0x0004003d,0x0000000e,0x000008d2,0x000006c3,
+0x00050084,0x0000000e,0x000008d3,0x000008d2,
+0x000000e9,0x00050082,0x0000000e,0x000008d4,
+0x000008d1,0x000008d3,0x0003003e,0x000008c6,
+0x000008d4,0x000200f9,0x000008ca,0x000200f8,
+0x000008d5,0x0004003d,0x0000000e,0x000008d7,
+0x000006b1,0x000500c2,0x0000000e,0x000008d9,
+0x000008d7,0x000008d8,0x000500c7,0x0000000e,
+0x000008da,0x000008d9,0x0000003d,0x0003003e,
+0x000008d6,0x000008da,0x0004003d,0x0000000e,
+0x000008dc,0x000008d6,0x000500aa,0x0000009b,
+0x000008dd,0x000008dc,0x000000cb,0x000300f7,
+0x000008e0,0x00000000,0x000400fa,0x000008dd,
+0x000008df,0x000008e1,0x000200f8,0x000008df,
+0x0003003e,0x000008de,0x000000cb,0x000200f9,
+0x000008e0,0x000200f8,0x000008e1,0x0004003d,
+0x0000000e,0x000008e3,0x000008ac,0x00050082,
+0x0000000e,0x000008e4,0x000008e3,0x00000084,
+0x0003003e,0x000008e5,0x000008e2,0x00050041,
+0x0000000f,0x000008e6,0x000008e5,0x000008e4,
+0x0004003d,0x0000000e,0x000008e7,0x000008e6,
+0x0003003e,0x000008de,0x000008e7,0x000200f9,
+0x000008e0,0x000200f8,0x000008e0,0x0004003d,
+0x0000000e,0x000008e8,0x000008de,0x0003003e,
+0x000008db,0x000008e8,0x0004003d,0x0000000e,
+0x000008ea,0x000008bb,0x0004003d,0x0000000e,
+0x000008eb,0x000008db,0x00050082,0x0000000e,
+0x000008ec,0x000008ea,0x000008eb,0x0003003e,
+0x000008e9,0x000008ec,0x0004003d,0x0000000e,
+0x000008ed,0x000008e9,0x0004003d,0x0000000e,
+0x000008ee,0x000006c3,0x00050084,0x0000000e,
+0x000008ef,0x000008ee,0x000000e9,0x00050082,
+0x0000000e,0x000008f0,0x000008ed,0x000008ef,
+0x0003003e,0x000008c6,0x000008f0,0x0004003d,
+0x0000000e,0x000008f1,0x000008d6,0x000500aa,
+0x0000009b,0x000008f2,0x000008f1,0x000000cb,
+0x000300f7,0x000008f4,0x00000000,0x000400fa,
+0x000008f2,0x000008f3,0x000008ff,0x000200f8,
+0x000008f3,0x0004003d,0x0000000e,0x000008f6,
+0x000006b1,0x000500c2,0x0000000e,0x000008f8,
+0x000008f6,0x000008f7,0x000500c7,0x0000000e,
+0x000008f9,0x000008f8,0x0000056d,0x0003003e,
+0x000008f5,0x000008f9,0x0004003d,0x0000000e,
+0x000008fa,0x000008f5,0x0004003d,0x0000000e,
+0x000008fb,0x000008f5,0x0004003d,0x0000000e,
+0x000008fc,0x000008f5,0x0004003d,0x0000000e,
+0x000008fd,0x000008f5,0x00070050,0x00000016,
+0x000008fe,0x000008fa,0x000008fb,0x000008fc,
+0x000008fd,0x0003003e,0x000008cb,0x000008fe,
+0x000200f9,0x000008f4,0x000200f8,0x000008ff,
+0x0004003d,0x0000000e,0x00000901,0x000008d6,
+0x00050082,0x0000000e,0x00000902,0x00000901,
+0x00000084,0x0003003e,0x00000900,0x00000902,
+0x0004003d,0x0000000e,0x00000904,0x00000900,
+0x0004003d,0x0000000e,0x00000906,0x000006b1,
+0x0003003e,0x00000905,0x00000906,0x0003003e,
+0x00000907,0x000008f7,0x00060039,0x0000000e,
+0x00000908,0x00000014,0x00000905,0x00000907,
+0x0004003d,0x0000000e,0x0000090a,0x000006b1,
+0x0003003e,0x00000909,0x0000090a,0x0003003e,
+0x0000090b,0x0000059b,0x00060039,0x0000000e,
+0x0000090c,0x00000014,0x00000909,0x0000090b,
+0x0004003d,0x0000000e,0x0000090f,0x000006b1,
+0x0003003e,0x0000090e,0x0000090f,0x0003003e,
+0x00000910,0x0000090d,0x00060039,0x0000000e,
+0x00000911,0x00000014,0x0000090e,0x00000910,
+0x0004003d,0x0000000e,0x00000913,0x000006b1,
+0x0003003e,0x00000912,0x00000913,0x0003003e,
+0x00000914,0x0000058c,0x00060039,0x0000000e,
+0x00000915,0x00000014,0x00000912,0x00000914,
+0x00070050,0x00000016,0x00000916,0x00000908,
+0x0000090c,0x00000911,0x00000915,0x00070050,
+0x00000016,0x00000917,0x00000904,0x00000904,
+0x00000904,0x00000904,0x00050080,0x00000016,
+0x00000918,0x00000917,0x00000916,0x0003003e,
+0x00000903,0x00000918,0x0003003e,0x0000091a,
+0x00000077,0x0004003d,0x0000000e,0x0000091c,
+0x000008e9,0x0003003e,0x0000091b,0x0000091c,
+0x0004003d,0x0000000e,0x0000091e,0x000008db,
+0x0003003e,0x0000091d,0x0000091e,0x00070039,
+0x0000000e,0x0000091f,0x0000001c,0x0000091a,
+0x0000091b,0x0000091d,0x0003003e,0x00000919,
+0x0000091f,0x0004003d,0x0000000e,0x00000922,
+0x000008ac,0x00050082,0x0000000e,0x00000923,
+0x00000922,0x00000084,0x0003003e,0x00000924,
+0x00000921,0x00050041,0x0000000f,0x00000925,
+0x00000924,0x00000923,0x0004003d,0x0000000e,
+0x00000926,0x00000925,0x0003003e,0x00000920,
+0x00000926,0x0004003d,0x0000000e,0x00000928,
+0x00000919,0x0004003d,0x0000000e,0x00000929,
+0x00000920,0x000500c4,0x0000000e,0x0000092a,
+0x00000928,0x00000929,0x0004003d,0x0000000e,
+0x0000092b,0x000006b1,0x000500c2,0x0000000e,
+0x0000092c,0x0000092b,0x0000090d,0x000500c7,
+0x0000000e,0x0000092d,0x0000092c,0x0000003d,
+0x0004003d,0x0000000e,0x0000092e,0x00000920,
+0x00050082,0x0000000e,0x0000092f,0x000000e9,
+0x0000092e,0x000500c2,0x0000000e,0x00000930,
+0x0000092d,0x0000092f,0x000500c5,0x0000000e,
+0x00000931,0x0000092a,0x00000930,0x0003003e,
+0x00000927,0x00000931,0x0004003d,0x00000016,
+0x00000932,0x00000903,0x00070050,0x0000004a,
+0x00000933,0x00000126,0x00000126,0x00000126,
+0x00000126,0x000500c4,0x00000016,0x00000934,
+0x00000932,0x00000933,0x0004003d,0x0000000e,
+0x00000935,0x00000927,0x000500c7,0x0000000e,
+0x00000936,0x00000935,0x0000003d,0x0004003d,
+0x0000000e,0x00000937,0x00000927,0x000500c2,
+0x0000000e,0x00000938,0x00000937,0x00000126,
+0x000500c7,0x0000000e,0x00000939,0x00000938,
+0x0000003d,0x0004003d,0x0000000e,0x0000093a,
+0x00000927,0x000500c2,0x0000000e,0x0000093b,
+0x0000093a,0x0000052c,0x000500c7,0x0000000e,
+0x0000093c,0x0000093b,0x0000003d,0x0004003d,
+0x0000000e,0x0000093d,0x00000927,0x000500c2,
+0x0000000e,0x0000093e,0x0000093d,0x00000542,
+0x000500c7,0x0000000e,0x0000093f,0x0000093e,
+0x0000003d,0x00070050,0x00000016,0x00000940,
+0x00000936,0x00000939,0x0000093c,0x0000093f,
+0x000500c5,0x00000016,0x00000941,0x00000934,
+0x00000940,0x0003003e,0x000008cb,0x00000941,
+0x000200f9,0x000008f4,0x000200f8,0x000008f4,
+0x000200f9,0x000008ca,0x000200f8,0x000008ca,
+0x0003003e,0x00000942,0x000000cb,0x0003003e,
+0x00000943,0x000000cb,0x000200f9,0x00000944,
+0x000200f8,0x00000944,0x000400f6,0x00000946,
+0x00000947,0x00000000,0x000200f9,0x00000948,
+0x000200f8,0x00000948,0x0004003d,0x0000000e,
+0x00000949,0x00000943,0x0004003d,0x0000000e,
+0x0000094a,0x000008ac,0x000500b0,0x0000009b,
+0x0000094b,0x00000949,0x0000094a,0x000400fa,
+0x0000094b,0x00000945,0x00000946,0x000200f8,
+0x00000945,0x0004003d,0x0000000e,0x0000094c,
+0x00000943,0x00050041,0x0000000f,0x0000094e,
+0x000008cb,0x0000094c,0x0004003d,0x0000000e,
+0x0000094f,0x0000094e,0x0003003e,0x0000094d,
+0x0000094f,0x00050039,0x0000000e,0x00000950,
+0x00000048,0x0000094d,0x0004003d,0x0000000e,
+0x00000951,0x00000942,0x00050080,0x0000000e,
+0x00000952,0x00000951,0x00000950,0x0003003e,
+0x00000942,0x00000952,0x000200f9,0x00000947,
+0x000200f8,0x00000947,0x0004003d,0x0000000e,
+0x00000953,0x00000943,0x00050080,0x0000000e,
+0x00000954,0x00000953,0x00000090,0x0003003e,
+0x00000943,0x00000954,0x000200f9,0x00000944,
+0x000200f8,0x00000946,0x0004003d,0x0000000e,
+0x00000956,0x000008ac,0x000500aa,0x0000009b,
+0x00000957,0x00000956,0x00000084,0x000600a9,
+0x00000006,0x00000959,0x00000957,0x00000522,
+0x00000958,0x0004007c,0x0000000e,0x0000095a,
+0x00000959,0x0003003e,0x00000955,0x0000095a,
+0x0004003d,0x0000000e,0x0000095c,0x000008c6,
+0x0004003d,0x0000000e,0x0000095d,0x00000955,
+0x00050082,0x0000000e,0x0000095e,0x0000095c,
+0x0000095d,0x0003003e,0x0000095b,0x0000095e,
+0x0004003d,0x0000000e,0x0000095f,0x0000095b,
+0x000500ae,0x0000009b,0x00000960,0x0000095f,
+0x000002ad,0x000300f7,0x00000962,0x00000000,
+0x000400fa,0x00000960,0x00000961,0x00000962,
+0x000200f8,0x00000961,0x00040039,0x0000006e,
+0x00000963,0x00000074,0x000200fe,0x00000963,
+0x000200f8,0x00000962,0x0003003e,0x00000965,
+0x000000cb,0x0003003e,0x00000966,0x000000cb,
+0x0003003e,0x00000967,0x000000cb,0x0003003e,
+0x00000968,0x000000cb,0x000200f9,0x00000969,
+0x000200f8,0x00000969,0x000400f6,0x0000096b,
+0x0000096c,0x00000000,0x000200f9,0x0000096d,
+0x000200f8,0x0000096d,0x0004003d,0x0000000e,
+0x0000096e,0x00000968,0x000500b0,0x0000009b,
+0x0000096f,0x0000096e,0x00000802,0x000400fa,
+0x0000096f,0x0000096a,0x0000096b,0x000200f8,
+0x0000096a,0x0004003d,0x0000000e,0x00000979,
+0x00000968,0x0003003e,0x0000097b,0x00000978,
+0x00060041,0x0000000f,0x0000097c,0x0000097b,
+0x00000979,0x0000010b,0x0004003d,0x0000000e,
+0x0000097d,0x0000097c,0x0003003e,0x00000966,
+0x0000097d,0x0004003d,0x0000000e,0x0000097e,
+0x00000968,0x0003003e,0x0000097f,0x00000978,
+0x00060041,0x0000000f,0x00000980,0x0000097f,
+0x0000097e,0x00000090,0x0004003d,0x0000000e,
+0x00000981,0x00000980,0x0003003e,0x00000965,
+0x00000981,0x0004003d,0x0000000e,0x00000982,
+0x00000968,0x0003003e,0x00000983,0x00000978,
+0x00060041,0x0000000f,0x00000984,0x00000983,
+0x00000982,0x00000126,0x0004003d,0x0000000e,
+0x00000985,0x00000984,0x0003003e,0x00000967,
+0x00000985,0x0004003d,0x0000000e,0x00000987,
+0x00000942,0x0003003e,0x00000986,0x00000987,
+0x0004003d,0x0000000e,0x00000989,0x00000966,
+0x0003003e,0x00000988,0x00000989,0x0004003d,
+0x0000000e,0x0000098b,0x00000965,0x0003003e,
+0x0000098a,0x0000098b,0x0004003d,0x0000000e,
+0x0000098d,0x00000967,0x0003003e,0x0000098c,
+0x0000098d,0x00080039,0x0000000e,0x0000098e,
+0x0000002a,0x00000986,0x00000988,0x0000098a,
+0x0000098c,0x0004003d,0x0000000e,0x0000098f,
+0x0000095b,0x000500b2,0x0000009b,0x00000990,
+0x0000098e,0x0000098f,0x000300f7,0x00000992,
+0x00000000,0x000400fa,0x00000990,0x00000991,
+0x00000992,0x000200f8,0x00000991,0x000200f9,
+0x0000096b,0x000200f8,0x00000992,0x000200f9,
+0x0000096c,0x000200f8,0x0000096c,0x0004003d,
+0x0000000e,0x00000994,0x00000968,0x00050080,
+0x0000000e,0x00000995,0x00000994,0x00000090,
+0x0003003e,0x00000968,0x00000995,0x000200f9,
+0x00000969,0x000200f8,0x0000096b,0x0004003d,
+0x0000000e,0x00000996,0x00000968,0x000500ae,
+0x0000009b,0x00000997,0x00000996,0x00000802,
+0x000300f7,0x00000999,0x00000000,0x000400fa,
+0x00000997,0x00000998,0x00000999,0x000200f8,
+0x00000998,0x00040039,0x0000006e,0x0000099a,
+0x00000074,0x000200fe,0x0000099a,0x000200f8,
+0x00000999,0x0004003d,0x0000000e,0x0000099e,
+0x00000942,0x0003003e,0x0000099d,0x0000099e,
+0x0004003d,0x0000000e,0x000009a0,0x00000966,
+0x0003003e,0x0000099f,0x000009a0,0x0004003d,
+0x0000000e,0x000009a2,0x00000965,0x0003003e,
+0x000009a1,0x000009a2,0x0004003d,0x0000000e,
+0x000009a4,0x00000967,0x0003003e,0x000009a3,
+0x000009a4,0x00080039,0x0000000e,0x000009a5,
+0x0000002a,0x0000099d,0x0000099f,0x000009a1,
+0x000009a3,0x0003003e,0x0000099c,0x000009a5,
+0x0004003d,0x0000000e,0x000009a7,0x00000955,
+0x0004003d,0x0000000e,0x000009a8,0x0000099c,
+0x00050080,0x0000000e,0x000009a9,0x000009a7,
+0x000009a8,0x0003003e,0x000009a6,0x000009a9,
+0x0003003e,0x000009aa,0x000000cb,0x0003003e,
+0x000009ab,0x000000cb,0x0004003d,0x0000000e,
+0x000009ad,0x00000966,0x0003003e,0x000009ac,
+0x000009ad,0x0004003d,0x0000000e,0x000009af,
+0x00000965,0x0003003e,0x000009ae,0x000009af,
+0x0004003d,0x0000000e,0x000009b1,0x00000967,
+0x0003003e,0x000009b0,0x000009b1,0x00090039,
+0x00000002,0x000009b4,0x00000032,0x000009ac,
+0x000009ae,0x000009b0,0x000009b2,0x000009b3,
+0x0004003d,0x0000000e,0x000009b5,0x000009b2,
+0x0003003e,0x000009ab,0x000009b5,0x0004003d,
+0x0000000e,0x000009b6,0x000009b3,0x0003003e,
+0x000009aa,0x000009b6,0x0004003d,0x0000000e,
+0x000009b8,0x00000955,0x0003003e,0x000009b7,
+0x000009b8,0x0003003e,0x000009b9,0x000000cb,
+0x000200f9,0x000009ba,0x000200f8,0x000009ba,
+0x000400f6,0x000009bc,0x000009bd,0x00000000,
+0x000200f9,0x000009be,0x000200f8,0x000009be,
+0x0004003d,0x0000000e,0x000009bf,0x000009b9,
+0x0004003d,0x0000000e,0x000009c0,0x00000942,
+0x000500b0,0x0000009b,0x000009c1,0x000009bf,
+0x000009c0,0x000400fa,0x000009c1,0x000009bb,
+0x000009bc,0x000200f8,0x000009bb,0x0004003d,
+0x0000000e,0x000009c2,0x00000966,0x000500aa,
+0x0000009b,0x000009c3,0x000009c2,0x00000084,
+0x000300f7,0x000009c5,0x00000000,0x000400fa,
+0x000009c3,0x000009c4,0x00000aa5,0x000200f8,
+0x000009c4,0x0003003e,0x000009c7,0x00000077,
+0x0004003d,0x0000000e,0x000009c9,0x000009b7,
+0x0003003e,0x000009c8,0x000009c9,0x0004003d,
+0x0000000e,0x000009cb,0x000009a6,0x0003003e,
+0x000009ca,0x000009cb,0x0004003d,0x0000000e,
+0x000009cd,0x00000967,0x0003003e,0x000009cc,
+0x000009cd,0x00080039,0x00000035,0x000009ce,
+0x0000003b,0x000009c7,0x000009c8,0x000009ca,
+0x000009cc,0x0003003e,0x000009c6,0x000009ce,
+0x0003003e,0x000009cf,0x0000010b,0x000200f9,
+0x000009d0,0x000200f8,0x000009d0,0x000400f6,
+0x000009d2,0x000009d3,0x00000000,0x000200f9,
+0x000009d4,0x000200f8,0x000009d4,0x0004003d,
+0x00000006,0x000009d5,0x000009cf,0x000500b1,
+0x0000009b,0x000009d6,0x000009d5,0x00000112,
+0x000400fa,0x000009d6,0x000009d1,0x000009d2,
+0x000200f8,0x000009d1,0x0004003d,0x0000000e,
+0x000009d8,0x000009b9,0x0004003d,0x0000000e,
+0x00000a8d,0x00000967,0x0003003e,0x00000a8f,
+0x00000a8c,0x00050041,0x0000000f,0x00000a90,
+0x00000a8f,0x00000a8d,0x0004003d,0x0000000e,
+0x00000a91,0x00000a90,0x0004003d,0x00000006,
+0x00000a92,0x000009cf,0x00050041,0x0000000f,
+0x00000a93,0x000009c6,0x00000a92,0x0004003d,
+0x0000000e,0x00000a94,0x00000a93,0x00050080,
+0x0000000e,0x00000a95,0x00000a91,0x00000a94,
+0x0003003e,0x00000a97,0x00000a8a,0x00050041,
+0x0000000f,0x00000a98,0x00000a97,0x00000a95,
+0x0004003d,0x0000000e,0x00000a99,0x00000a98,
+0x00050041,0x0000000f,0x00000a9a,0x000009d7,
+0x000009d8,0x0003003e,0x00000a9a,0x00000a99,
+0x0004003d,0x0000000e,0x00000a9b,0x000009b9,
+0x00050080,0x0000000e,0x00000a9c,0x00000a9b,
+0x00000090,0x0003003e,0x000009b9,0x00000a9c,
+0x0004003d,0x0000000e,0x00000a9d,0x000009b9,
+0x0004003d,0x0000000e,0x00000a9e,0x00000942,
+0x000500ae,0x0000009b,0x00000a9f,0x00000a9d,
+0x00000a9e,0x000300f7,0x00000aa1,0x00000000,
+0x000400fa,0x00000a9f,0x00000aa0,0x00000aa1,
+0x000200f8,0x00000aa0,0x000200f9,0x000009d2,
+0x000200f8,0x00000aa1,0x000200f9,0x000009d3,
+0x000200f8,0x000009d3,0x0004003d,0x00000006,
+0x00000aa3,0x000009cf,0x00050080,0x00000006,
+0x00000aa4,0x00000aa3,0x00000090,0x0003003e,
+0x000009cf,0x00000aa4,0x000200f9,0x000009d0,
+0x000200f8,0x000009d2,0x000200f9,0x000009c5,
+0x000200f8,0x00000aa5,0x0004003d,0x0000000e,
+0x00000aa6,0x00000965,0x000500aa,0x0000009b,
+0x00000aa7,0x00000aa6,0x00000084,0x000300f7,
+0x00000aa9,0x00000000,0x000400fa,0x00000aa7,
+0x00000aa8,0x00000ade,0x000200f8,0x00000aa8,
+0x0003003e,0x00000aab,0x00000077,0x0004003d,
+0x0000000e,0x00000aad,0x000009b7,0x0003003e,
+0x00000aac,0x00000aad,0x0004003d,0x0000000e,
+0x00000aaf,0x000009a6,0x0003003e,0x00000aae,
+0x00000aaf,0x0004003d,0x0000000e,0x00000ab1,
+0x00000967,0x0003003e,0x00000ab0,0x00000ab1,
+0x00080039,0x0000003e,0x00000ab2,0x00000044,
+0x00000aab,0x00000aac,0x00000aae,0x00000ab0,
+0x0003003e,0x00000aaa,0x00000ab2,0x0003003e,
+0x00000ab3,0x0000010b,0x000200f9,0x00000ab4,
+0x000200f8,0x00000ab4,0x000400f6,0x00000ab6,
+0x00000ab7,0x00000000,0x000200f9,0x00000ab8,
+0x000200f8,0x00000ab8,0x0004003d,0x00000006,
+0x00000ab9,0x00000ab3,0x000500b1,0x0000009b,
+0x00000aba,0x00000ab9,0x0000026b,0x000400fa,
+0x00000aba,0x00000ab5,0x00000ab6,0x000200f8,
+0x00000ab5,0x0004003d,0x0000000e,0x00000abb,
+0x000009b9,0x0004003d,0x0000000e,0x00000ac7,
+0x00000967,0x0003003e,0x00000ac8,0x00000ac6,
+0x00050041,0x0000000f,0x00000ac9,0x00000ac8,
+0x00000ac7,0x0004003d,0x0000000e,0x00000aca,
+0x00000ac9,0x0004003d,0x00000006,0x00000acb,
+0x00000ab3,0x00050041,0x0000000f,0x00000acc,
+0x00000aaa,0x00000acb,0x0004003d,0x0000000e,
+0x00000acd,0x00000acc,0x00050080,0x0000000e,
+0x00000ace,0x00000aca,0x00000acd,0x0003003e,
+0x00000ad0,0x00000ac5,0x00050041,0x0000000f,
+0x00000ad1,0x00000ad0,0x00000ace,0x0004003d,
+0x0000000e,0x00000ad2,0x00000ad1,0x00050041,
+0x0000000f,0x00000ad3,0x000009d7,0x00000abb,
+0x0003003e,0x00000ad3,0x00000ad2,0x0004003d,
+0x0000000e,0x00000ad4,0x000009b9,0x00050080,
+0x0000000e,0x00000ad5,0x00000ad4,0x00000090,
+0x0003003e,0x000009b9,0x00000ad5,0x0004003d,
+0x0000000e,0x00000ad6,0x000009b9,0x0004003d,
+0x0000000e,0x00000ad7,0x00000942,0x000500ae,
+0x0000009b,0x00000ad8,0x00000ad6,0x00000ad7,
+0x000300f7,0x00000ada,0x00000000,0x000400fa,
+0x00000ad8,0x00000ad9,0x00000ada,0x000200f8,
+0x00000ad9,0x000200f9,0x00000ab6,0x000200f8,
+0x00000ada,0x000200f9,0x00000ab7,0x000200f8,
+0x00000ab7,0x0004003d,0x00000006,0x00000adc,
+0x00000ab3,0x00050080,0x00000006,0x00000add,
+0x00000adc,0x00000090,0x0003003e,0x00000ab3,
+0x00000add,0x000200f9,0x00000ab4,0x000200f8,
+0x00000ab6,0x000200f9,0x00000aa9,0x000200f8,
+0x00000ade,0x0003003e,0x00000ae0,0x00000077,
+0x0004003d,0x0000000e,0x00000ae2,0x000009b7,
+0x0003003e,0x00000ae1,0x00000ae2,0x0004003d,
+0x0000000e,0x00000ae4,0x000009aa,0x0003003e,
+0x00000ae3,0x00000ae4,0x00070039,0x0000000e,
+0x00000ae5,0x0000001c,0x00000ae0,0x00000ae1,
+0x00000ae3,0x0003003e,0x00000adf,0x00000ae5,
+0x0004003d,0x0000000e,0x00000ae7,0x00000adf,
+0x0004003d,0x0000000e,0x00000aea,0x00000967,
+0x00050082,0x0000000e,0x00000aeb,0x00000aea,
+0x00000084,0x0003003e,0x00000aed,0x00000ae9,
+0x00050041,0x0000000f,0x00000aee,0x00000aed,
+0x00000aeb,0x0004003d,0x0000000e,0x00000aef,
+0x00000aee,0x00050084,0x0000000e,0x00000af0,
+0x00000ae7,0x00000aef,0x0004003d,0x0000000e,
+0x00000af1,0x00000adf,0x0004003d,0x0000000e,
+0x00000af3,0x00000967,0x00050082,0x0000000e,
+0x00000af4,0x00000af3,0x00000084,0x0003003e,
+0x00000af5,0x00000af2,0x00050041,0x0000000f,
+0x00000af6,0x00000af5,0x00000af4,0x0004003d,
+0x0000000e,0x00000af7,0x00000af6,0x000500c2,
+0x0000000e,0x00000af8,0x00000af1,0x00000af7,
+0x000500c5,0x0000000e,0x00000af9,0x00000af0,
+0x00000af8,0x0003003e,0x00000ae6,0x00000af9,
+0x0004003d,0x0000000e,0x00000afa,0x000009b9,
+0x0004003d,0x0000000e,0x00000afb,0x00000ae6,
+0x00050041,0x0000000f,0x00000afc,0x000009d7,
+0x00000afa,0x0003003e,0x00000afc,0x00000afb,
+0x0004003d,0x0000000e,0x00000afd,0x000009b9,
+0x00050080,0x0000000e,0x00000afe,0x00000afd,
+0x00000090,0x0003003e,0x000009b9,0x00000afe,
+0x000200f9,0x00000aa9,0x000200f8,0x00000aa9,
+0x000200f9,0x000009c5,0x000200f8,0x000009c5,
+0x0004003d,0x0000000e,0x00000aff,0x000009aa,
+0x0004003d,0x0000000e,0x00000b00,0x000009b7,
+0x00050080,0x0000000e,0x00000b01,0x00000b00,
+0x00000aff,0x0003003e,0x000009b7,0x00000b01,
+0x000200f9,0x000009bd,0x000200f8,0x000009bd,
+0x000200f9,0x000009ba,0x000200f8,0x000009bc,
+0x0003003e,0x00000b02,0x000000cb,0x0003003e,
+0x00000b03,0x000000cb,0x000200f9,0x00000b04,
+0x000200f8,0x00000b04,0x000400f6,0x00000b06,
+0x00000b07,0x00000000,0x000200f9,0x00000b08,
+0x000200f8,0x00000b08,0x0004003d,0x0000000e,
+0x00000b09,0x00000b03,0x0004003d,0x0000000e,
+0x00000b0a,0x000008ac,0x000500b0,0x0000009b,
+0x00000b0b,0x00000b09,0x00000b0a,0x000400fa,
+0x00000b0b,0x00000b05,0x00000b06,0x000200f8,
+0x00000b05,0x0004003d,0x0000005b,0x00000b0c,
+0x000009d7,0x0004003d,0x0000000e,0x00000b0d,
+0x00000b03,0x0004003d,0x0000000e,0x00000b12,
+0x00000b03,0x0004003d,0x0000000e,0x00000b13,
+0x00000b03,0x0004003d,0x0000000e,0x00000b15,
+0x00000b02,0x0003003e,0x00000b14,0x00000b15,
+0x00050041,0x0000000f,0x00000b17,0x000008cb,
+0x00000b0d,0x0004003d,0x0000000e,0x00000b18,
+0x00000b17,0x0003003e,0x00000b16,0x00000b18,
+0x00090039,0x00000002,0x00000b1b,0x00000062,
+0x00000b0c,0x00000b14,0x00000b16,0x00000b19,
+0x00000b1a,0x0004003d,0x00000016,0x00000b1c,
+0x00000b19,0x00060041,0x00000017,0x00000b1d,
+0x00000b11,0x00000b12,0x0000010b,0x0003003e,
+0x00000b1d,0x00000b1c,0x0004003d,0x00000016,
+0x00000b1e,0x00000b1a,0x00060041,0x00000017,
+0x00000b1f,0x00000b11,0x00000b13,0x00000090,
+0x0003003e,0x00000b1f,0x00000b1e,0x0004003d,
+0x0000000e,0x00000b20,0x00000b03,0x00050041,
+0x0000000f,0x00000b22,0x000008cb,0x00000b20,
+0x0004003d,0x0000000e,0x00000b23,0x00000b22,
+0x0003003e,0x00000b21,0x00000b23,0x00050039,
+0x0000000e,0x00000b24,0x00000048,0x00000b21,
+0x0004003d,0x0000000e,0x00000b25,0x00000b02,
+0x00050080,0x0000000e,0x00000b26,0x00000b25,
+0x00000b24,0x0003003e,0x00000b02,0x00000b26,
+0x000200f9,0x00000b07,0x000200f8,0x00000b07,
+0x0004003d,0x0000000e,0x00000b27,0x00000b03,
+0x00050080,0x0000000e,0x00000b28,0x00000b27,
+0x00000090,0x0003003e,0x00000b03,0x00000b28,
+0x000200f9,0x00000b04,0x000200f8,0x00000b06,
+0x00050041,0x00000b2b,0x00000b2c,0x00000556,
+0x0000010b,0x0004003d,0x00000553,0x00000b2d,
+0x00000b2c,0x00050050,0x00000553,0x00000b2e,
+0x000000e9,0x000000e9,0x00050086,0x00000553,
+0x00000b2f,0x00000b2d,0x00000b2e,0x00050050,
+0x00000553,0x00000b30,0x00000563,0x00000563,
+0x00050080,0x00000553,0x00000b31,0x00000b30,
+0x00000b2f,0x00050041,0x00000b2b,0x00000b32,
+0x00000556,0x0000010b,0x0004003d,0x00000553,
+0x00000b33,0x00000b32,0x00050050,0x00000553,
+0x00000b34,0x00000084,0x00000084,0x00050082,
+0x00000553,0x00000b35,0x00000b33,0x00000b34,
+0x00050086,0x00000553,0x00000b36,0x00000b31,
+0x00000b35,0x0003003e,0x00000b2a,0x00000b36,
+0x0004003d,0x0000000e,0x00000b38,0x000006c3,
+0x00050080,0x0000000e,0x00000b39,0x00000b38,
+0x00000084,0x0003003e,0x00000b37,0x00000b39,
+0x0003003e,0x00000b3a,0x000000cb,0x000200f9,
+0x00000b3b,0x000200f8,0x00000b3b,0x000400f6,
+0x00000b3d,0x00000b3e,0x00000000,0x000200f9,
+0x00000b3f,0x000200f8,0x00000b3f,0x0004003d,
+0x0000000e,0x00000b40,0x00000b3a,0x00060041,
+0x00000557,0x00000b41,0x00000556,0x0000010b,
+0x00000084,0x0004003d,0x0000000e,0x00000b42,
+0x00000b41,0x000500b0,0x0000009b,0x00000b43,
+0x00000b40,0x00000b42,0x000400fa,0x00000b43,
+0x00000b3c,0x00000b3d,0x000200f8,0x00000b3c,
+0x0003003e,0x00000b44,0x000000cb,0x000200f9,
+0x00000b45,0x000200f8,0x00000b45,0x000400f6,
+0x00000b47,0x00000b48,0x00000000,0x000200f9,
+0x00000b49,0x000200f8,0x00000b49,0x0004003d,
+0x0000000e,0x00000b4a,0x00000b44,0x00060041,
+0x00000557,0x00000b4b,0x00000556,0x0000010b,
+0x000000cb,0x0004003d,0x0000000e,0x00000b4c,
+0x00000b4b,0x000500b0,0x0000009b,0x00000b4d,
+0x00000b4a,0x00000b4c,0x000400fa,0x00000b4d,
+0x00000b46,0x00000b47,0x000200f8,0x00000b46,
+0x0004003d,0x0000000e,0x00000b4f,0x000006b1,
+0x000500c2,0x0000000e,0x00000b50,0x00000b4f,
+0x000008cd,0x000500c7,0x0000000e,0x00000b52,
+0x00000b50,0x00000b51,0x0003003e,0x00000b53,
+0x00000b52,0x0004003d,0x0000000e,0x00000b55,
+0x00000b44,0x0003003e,0x00000b54,0x00000b55,
+0x0004003d,0x0000000e,0x00000b57,0x00000b3a,
+0x0003003e,0x00000b56,0x00000b57,0x0004003d,
+0x0000000e,0x00000b59,0x000008ac,0x0003003e,
+0x00000b58,0x00000b59,0x00080039,0x0000000e,
+0x00000b5a,0x0000006b,0x00000b53,0x00000b54,
+0x00000b56,0x00000b58,0x0003003e,0x00000b4e,
+0x00000b5a,0x0004003d,0x0000000e,0x00000b5f,
+0x00000b4e,0x00050041,0x0000000f,0x00000b60,
+0x000008cb,0x00000b5f,0x0004003d,0x0000000e,
+0x00000b61,0x00000b60,0x0003003e,0x00000b63,
+0x00000b5e,0x00050041,0x00000b64,0x00000b65,
+0x00000b63,0x00000b61,0x0004003d,0x0000009b,
+0x00000b66,0x00000b65,0x000300f7,0x00000b68,
+0x00000000,0x000400fa,0x00000b66,0x00000b67,
+0x00000b68,0x000200f8,0x00000b67,0x0004003d,
+0x0000000e,0x00000b6a,0x00000b3a,0x00060041,
+0x00000557,0x00000b6b,0x00000556,0x0000010b,
+0x000000cb,0x0004003d,0x0000000e,0x00000b6c,
+0x00000b6b,0x00050084,0x0000000e,0x00000b6d,
+0x00000b6a,0x00000b6c,0x0004003d,0x0000000e,
+0x00000b6e,0x00000b44,0x00050080,0x0000000e,
+0x00000b6f,0x00000b6d,0x00000b6e,0x00050041,
+0x00000017,0x00000b70,0x00000b69,0x00000b6f,
+0x0003003e,0x00000b70,0x000006ac,0x000200f9,
+0x00000b48,0x000200f8,0x00000b68,0x0004003d,
+0x0000000e,0x00000b73,0x00000b44,0x0004003d,
+0x0000000e,0x00000b74,0x00000b3a,0x00050050,
+0x00000553,0x00000b75,0x00000b73,0x00000b74,
+0x0003003e,0x00000b72,0x00000b75,0x0004003d,
+0x00000553,0x00000b77,0x00000b2a,0x0004003d,
+0x00000553,0x00000b78,0x00000b72,0x00050084,
+0x00000553,0x00000b79,0x00000b77,0x00000b78,
+0x0003003e,0x00000b76,0x00000b79,0x0004003d,
+0x00000553,0x00000b7b,0x00000b76,0x0004003d,
+0x0000000e,0x00000b7c,0x000006df,0x0004003d,
+0x0000000e,0x00000b7d,0x000006e1,0x00050050,
+0x00000553,0x00000b7e,0x00000b7c,0x00000b7d,
+0x00050050,0x00000553,0x00000b7f,0x00000084,
+0x00000084,0x00050082,0x00000553,0x00000b80,
+0x00000b7e,0x00000b7f,0x00050084,0x00000553,
+0x00000b81,0x00000b7b,0x00000b80,0x00050050,
+0x00000553,0x00000b82,0x0000008a,0x0000008a,
+0x00050080,0x00000553,0x00000b83,0x00000b81,
+0x00000b82,0x00050050,0x00000009,0x00000b84,
+0x00000542,0x00000542,0x000500c2,0x00000553,
+0x00000b85,0x00000b83,0x00000b84,0x0003003e,
+0x00000b7a,0x00000b85,0x0004003d,0x00000553,
+0x00000b87,0x00000b7a,0x00050050,0x00000009,
+0x00000b88,0x0000052c,0x0000052c,0x000500c2,
+0x00000553,0x00000b89,0x00000b87,0x00000b88,
+0x0003003e,0x00000b86,0x00000b89,0x0004003d,
+0x00000553,0x00000b8b,0x00000b7a,0x00050050,
+0x00000553,0x00000b8c,0x0000056d,0x0000056d,
+0x000500c7,0x00000553,0x00000b8d,0x00000b8b,
+0x00000b8c,0x0003003e,0x00000b8a,0x00000b8d,
+0x00050041,0x0000000f,0x00000b8f,0x00000b86,
+0x000000cb,0x0004003d,0x0000000e,0x00000b90,
+0x00000b8f,0x00050041,0x0000000f,0x00000b91,
+0x00000b86,0x00000084,0x0004003d,0x0000000e,
+0x00000b92,0x00000b91,0x0004003d,0x0000000e,
+0x00000b93,0x000006df,0x00050084,0x0000000e,
+0x00000b94,0x00000b92,0x00000b93,0x00050080,
+0x0000000e,0x00000b95,0x00000b90,0x00000b94,
+0x0003003e,0x00000b8e,0x00000b95,0x0004003d,
+0x0000000e,0x00000b97,0x00000b8e,0x0004003d,
+0x0000000e,0x00000b98,0x00000b37,0x00050084,
+0x0000000e,0x00000b99,0x00000b97,0x00000b98,
+0x00050041,0x0000000f,0x00000b9a,0x000007ef,
+0x00000b99,0x0004003d,0x0000000e,0x00000b9b,
+0x00000b9a,0x0004003d,0x0000000e,0x00000b9c,
+0x00000b8e,0x0004003d,0x0000000e,0x00000b9d,
+0x00000b37,0x00050084,0x0000000e,0x00000b9e,
+0x00000b9c,0x00000b9d,0x00050080,0x0000000e,
+0x00000b9f,0x00000b9e,0x00000084,0x00050041,
+0x0000000f,0x00000ba0,0x000007ef,0x00000b9f,
+0x0004003d,0x0000000e,0x00000ba1,0x00000ba0,
+0x00050050,0x00000553,0x00000ba2,0x00000b9b,
+0x00000ba1,0x0003003e,0x00000b96,0x00000ba2,
+0x0004003d,0x0000000e,0x00000ba4,0x00000b8e,
+0x00050080,0x0000000e,0x00000ba5,0x00000ba4,
+0x00000084,0x0004003d,0x0000000e,0x00000ba6,
+0x00000b37,0x00050084,0x0000000e,0x00000ba7,
+0x00000ba5,0x00000ba6,0x00050041,0x0000000f,
+0x00000ba8,0x000007ef,0x00000ba7,0x0004003d,
+0x0000000e,0x00000ba9,0x00000ba8,0x0004003d,
+0x0000000e,0x00000baa,0x00000b8e,0x00050080,
+0x0000000e,0x00000bab,0x00000baa,0x00000084,
+0x0004003d,0x0000000e,0x00000bac,0x00000b37,
+0x00050084,0x0000000e,0x00000bad,0x00000bab,
+0x00000bac,0x00050080,0x0000000e,0x00000bae,
+0x00000bad,0x00000084,0x00050041,0x0000000f,
+0x00000baf,0x000007ef,0x00000bae,0x0004003d,
+0x0000000e,0x00000bb0,0x00000baf,0x00050050,
+0x00000553,0x00000bb1,0x00000ba9,0x00000bb0,
+0x0003003e,0x00000ba3,0x00000bb1,0x0004003d,
+0x0000000e,0x00000bb3,0x00000b8e,0x0004003d,
+0x0000000e,0x00000bb4,0x000006df,0x00050080,
+0x0000000e,0x00000bb5,0x00000bb3,0x00000bb4,
+0x0004003d,0x0000000e,0x00000bb6,0x00000b37,
+0x00050084,0x0000000e,0x00000bb7,0x00000bb5,
+0x00000bb6,0x00050041,0x0000000f,0x00000bb8,
+0x000007ef,0x00000bb7,0x0004003d,0x0000000e,
+0x00000bb9,0x00000bb8,0x0004003d,0x0000000e,
+0x00000bba,0x00000b8e,0x0004003d,0x0000000e,
+0x00000bbb,0x000006df,0x00050080,0x0000000e,
+0x00000bbc,0x00000bba,0x00000bbb,0x0004003d,
+0x0000000e,0x00000bbd,0x00000b37,0x00050084,
+0x0000000e,0x00000bbe,0x00000bbc,0x00000bbd,
+0x00050080,0x0000000e,0x00000bbf,0x00000bbe,
+0x00000084,0x00050041,0x0000000f,0x00000bc0,
+0x000007ef,0x00000bbf,0x0004003d,0x0000000e,
+0x00000bc1,0x00000bc0,0x00050050,0x00000553,
+0x00000bc2,0x00000bb9,0x00000bc1,0x0003003e,
+0x00000bb2,0x00000bc2,0x0004003d,0x0000000e,
+0x00000bc4,0x00000b8e,0x0004003d,0x0000000e,
+0x00000bc5,0x000006df,0x00050080,0x0000000e,
+0x00000bc6,0x00000bc4,0x00000bc5,0x00050080,
+0x0000000e,0x00000bc7,0x00000bc6,0x00000084,
+0x0004003d,0x0000000e,0x00000bc8,0x00000b37,
+0x00050084,0x0000000e,0x00000bc9,0x00000bc7,
+0x00000bc8,0x00050041,0x0000000f,0x00000bca,
+0x000007ef,0x00000bc9,0x0004003d,0x0000000e,
+0x00000bcb,0x00000bca,0x0004003d,0x0000000e,
+0x00000bcc,0x00000b8e,0x0004003d,0x0000000e,
+0x00000bcd,0x000006df,0x00050080,0x0000000e,
+0x00000bce,0x00000bcc,0x00000bcd,0x00050080,
+0x0000000e,0x00000bcf,0x00000bce,0x00000084,
+0x0004003d,0x0000000e,0x00000bd0,0x00000b37,
+0x00050084,0x0000000e,0x00000bd1,0x00000bcf,
+0x00000bd0,0x00050080,0x0000000e,0x00000bd2,
+0x00000bd1,0x00000084,0x00050041,0x0000000f,
+0x00000bd3,0x000007ef,0x00000bd2,0x0004003d,
+0x0000000e,0x00000bd4,0x00000bd3,0x00050050,
+0x00000553,0x00000bd5,0x00000bcb,0x00000bd4,
+0x0003003e,0x00000bc3,0x00000bd5,0x00050041,
+0x0000000f,0x00000bd7,0x00000b8a,0x000000cb,
+0x0004003d,0x0000000e,0x00000bd8,0x00000bd7,
+0x00050041,0x0000000f,0x00000bd9,0x00000b8a,
+0x00000084,0x0004003d,0x0000000e,0x00000bda,
+0x00000bd9,0x00050084,0x0000000e,0x00000bdb,
+0x00000bd8,0x00000bda,0x00050080,0x0000000e,
+0x00000bdc,0x00000bdb,0x000000dc,0x000500c2,
+0x0000000e,0x00000bdd,0x00000bdc,0x0000052c,
+0x0003003e,0x00000bd6,0x00000bdd,0x00050041,
+0x0000000f,0x00000bdf,0x00000b8a,0x00000084,
+0x0004003d,0x0000000e,0x00000be0,0x00000bdf,
+0x0004003d,0x0000000e,0x00000be1,0x00000bd6,
+0x00050082,0x0000000e,0x00000be2,0x00000be0,
+0x00000be1,0x0003003e,0x00000bde,0x00000be2,
+0x00050041,0x0000000f,0x00000be4,0x00000b8a,
+0x000000cb,0x0004003d,0x0000000e,0x00000be5,
+0x00000be4,0x0004003d,0x0000000e,0x00000be6,
+0x00000bd6,0x00050082,0x0000000e,0x00000be7,
+0x00000be5,0x00000be6,0x0003003e,0x00000be3,
+0x00000be7,0x00050041,0x0000000f,0x00000be9,
+0x00000b8a,0x000000cb,0x0004003d,0x0000000e,
+0x00000bea,0x00000be9,0x00050082,0x0000000e,
+0x00000beb,0x000005e6,0x00000bea,0x00050041,
+0x0000000f,0x00000bec,0x00000b8a,0x00000084,
+0x0004003d,0x0000000e,0x00000bed,0x00000bec,
+0x00050082,0x0000000e,0x00000bee,0x00000beb,
+0x00000bed,0x0004003d,0x0000000e,0x00000bef,
+0x00000bd6,0x00050080,0x0000000e,0x00000bf0,
+0x00000bee,0x00000bef,0x0003003e,0x00000be8,
+0x00000bf0,0x0004003d,0x00000553,0x00000bf2,
+0x00000b96,0x0004003d,0x0000000e,0x00000bf3,
+0x00000be8,0x00050050,0x00000553,0x00000bf4,
+0x00000bf3,0x00000bf3,0x00050084,0x00000553,
+0x00000bf5,0x00000bf2,0x00000bf4,0x0004003d,
+0x00000553,0x00000bf6,0x00000ba3,0x0004003d,
+0x0000000e,0x00000bf7,0x00000be3,0x00050050,
+0x00000553,0x00000bf8,0x00000bf7,0x00000bf7,
+0x00050084,0x00000553,0x00000bf9,0x00000bf6,
+0x00000bf8,0x00050080,0x00000553,0x00000bfa,
+0x00000bf5,0x00000bf9,0x0004003d,0x00000553,
+0x00000bfb,0x00000bb2,0x0004003d,0x0000000e,
+0x00000bfc,0x00000bde,0x00050050,0x00000553,
+0x00000bfd,0x00000bfc,0x00000bfc,0x00050084,
+0x00000553,0x00000bfe,0x00000bfb,0x00000bfd,
+0x00050080,0x00000553,0x00000bff,0x00000bfa,
+0x00000bfe,0x0004003d,0x00000553,0x00000c00,
+0x00000bc3,0x0004003d,0x0000000e,0x00000c01,
+0x00000bd6,0x00050050,0x00000553,0x00000c02,
+0x00000c01,0x00000c01,0x00050084,0x00000553,
+0x00000c03,0x00000c00,0x00000c02,0x00050080,
+0x00000553,0x00000c04,0x00000bff,0x00000c03,
+0x00050050,0x00000553,0x00000c05,0x000000dc,
+0x000000dc,0x00050080,0x00000553,0x00000c06,
+0x00000c04,0x00000c05,0x00050050,0x00000009,
+0x00000c07,0x0000052c,0x0000052c,0x000500c2,
+0x00000553,0x00000c08,0x00000c06,0x00000c07,
+0x0003003e,0x00000bf1,0x00000c08,0x0004003d,
+0x0000000e,0x00000c0a,0x00000b4e,0x00060041,
+0x00000017,0x00000c0b,0x00000b11,0x00000c0a,
+0x0000010b,0x0004003d,0x00000016,0x00000c0c,
+0x00000c0b,0x0003003e,0x00000c09,0x00000c0c,
+0x0004003d,0x0000000e,0x00000c0e,0x00000b4e,
+0x00060041,0x00000017,0x00000c0f,0x00000b11,
+0x00000c0e,0x00000090,0x0004003d,0x00000016,
+0x00000c10,0x00000c0f,0x0003003e,0x00000c0d,
+0x00000c10,0x0004003d,0x00000016,0x00000c12,
+0x00000c09,0x00050041,0x0000000f,0x00000c13,
+0x00000bf1,0x000000cb,0x0004003d,0x0000000e,
+0x00000c14,0x00000c13,0x00050082,0x0000000e,
+0x00000c15,0x0000076f,0x00000c14,0x00070050,
+0x00000016,0x00000c16,0x00000c15,0x00000c15,
+0x00000c15,0x00000c15,0x00050084,0x00000016,
+0x00000c17,0x00000c12,0x00000c16,0x0004003d,
+0x00000016,0x00000c18,0x00000c0d,0x00050041,
+0x0000000f,0x00000c19,0x00000bf1,0x000000cb,
+0x0004003d,0x0000000e,0x00000c1a,0x00000c19,
+0x00070050,0x00000016,0x00000c1b,0x00000c1a,
+0x00000c1a,0x00000c1a,0x00000c1a,0x00050084,
+0x00000016,0x00000c1c,0x00000c18,0x00000c1b,
+0x00050080,0x00000016,0x00000c1d,0x00000c17,
+0x00000c1c,0x00070050,0x00000016,0x00000c1e,
+0x0000008a,0x0000008a,0x0000008a,0x0000008a,
+0x00050080,0x00000016,0x00000c1f,0x00000c1d,
+0x00000c1e,0x00070050,0x00000016,0x00000c20,
+0x0000076f,0x0000076f,0x0000076f,0x0000076f,
+0x00050086,0x00000016,0x00000c21,0x00000c1f,
+0x00000c20,0x0003003e,0x00000c11,0x00000c21,
+0x0004003d,0x0000000e,0x00000c22,0x000006c3,
+0x000500aa,0x0000009b,0x00000c23,0x00000c22,
+0x00000084,0x000300f7,0x00000c25,0x00000000,
+0x000400fa,0x00000c23,0x00000c24,0x00000c25,
+0x000200f8,0x00000c24,0x0003003e,0x00000c27,
+0x00000077,0x0004003d,0x0000000e,0x00000c29,
+0x000008c6,0x0003003e,0x00000c28,0x00000c29,
+0x0003003e,0x00000c2a,0x000000e9,0x00070039,
+0x0000000e,0x00000c2b,0x0000001c,0x00000c27,
+0x00000c28,0x00000c2a,0x0003003e,0x00000c26,
+0x00000c2b,0x0004003d,0x0000000e,0x00000c2c,
+0x00000c26,0x0004003d,0x0000000e,0x00000c2d,
+0x00000c26,0x00050041,0x0000000f,0x00000c2e,
+0x00000c09,0x00000c2d,0x0004003d,0x0000000e,
+0x00000c2f,0x00000c2e,0x00050041,0x0000000f,
+0x00000c30,0x00000bf1,0x00000084,0x0004003d,
+0x0000000e,0x00000c31,0x00000c30,0x00050082,
+0x0000000e,0x00000c32,0x0000076f,0x00000c31,
+0x00050084,0x0000000e,0x00000c33,0x00000c2f,
+0x00000c32,0x0004003d,0x0000000e,0x00000c34,
+0x00000c26,0x00050041,0x0000000f,0x00000c35,
+0x00000c0d,0x00000c34,0x0004003d,0x0000000e,
+0x00000c36,0x00000c35,0x00050041,0x0000000f,
+0x00000c37,0x00000bf1,0x00000084,0x0004003d,
+0x0000000e,0x00000c38,0x00000c37,0x00050084,
+0x0000000e,0x00000c39,0x00000c36,0x00000c38,
+0x00050080,0x0000000e,0x00000c3a,0x00000c33,
+0x00000c39,0x00050080,0x0000000e,0x00000c3b,
+0x00000c3a,0x0000008a,0x00050086,0x0000000e,
+0x00000c3c,0x00000c3b,0x0000076f,0x00050041,
+0x0000000f,0x00000c3d,0x00000c11,0x00000c2c,
+0x0003003e,0x00000c3d,0x00000c3c,0x000200f9,
+0x00000c25,0x000200f8,0x00000c25,0x0004003d,
+0x0000000e,0x00000c3e,0x00000b3a,0x00060041,
+0x00000557,0x00000c3f,0x00000556,0x0000010b,
+0x000000cb,0x0004003d,0x0000000e,0x00000c40,
+0x00000c3f,0x00050084,0x0000000e,0x00000c41,
+0x00000c3e,0x00000c40,0x0004003d,0x0000000e,
+0x00000c42,0x00000b44,0x00050080,0x0000000e,
+0x00000c43,0x00000c41,0x00000c42,0x0004003d,
+0x00000016,0x00000c44,0x00000c11,0x00050041,
+0x00000017,0x00000c45,0x00000b69,0x00000c43,
+0x0003003e,0x00000c45,0x00000c44,0x000200f9,
+0x00000b48,0x000200f8,0x00000b48,0x0004003d,
+0x0000000e,0x00000c46,0x00000b44,0x00050080,
+0x0000000e,0x00000c47,0x00000c46,0x00000090,
+0x0003003e,0x00000b44,0x00000c47,0x000200f9,
+0x00000b45,0x000200f8,0x00000b47,0x000200f9,
+0x00000b3e,0x000200f8,0x00000b3e,0x0004003d,
+0x0000000e,0x00000c48,0x00000b3a,0x00050080,
+0x0000000e,0x00000c49,0x00000c48,0x00000090,
+0x0003003e,0x00000b3a,0x00000c49,0x000200f9,
+0x00000b3b,0x000200f8,0x00000b3d,0x0004003d,
+0x0000006e,0x00000c4a,0x00000b69,0x000200fe,
+0x00000c4a,0x00010038,0x00050036,0x0000000e,
+0x0000007b,0x00000000,0x0000007a,0x000200f8,
+0x0000007c,0x000200fe,0x00000084,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_2D.inl
new file mode 100644
index 00000000000..ae37a6db25e
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_2D.inl
@@ -0,0 +1,5038 @@
+0x07230203,0x00010300,0x000d000a,0x00000cb1,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x00000c53,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00070005,0x0000000b,0x50746567,
+0x4432736f,0x61727241,0x69762879,0x00003b33,
+0x00030005,0x0000000a,0x00736f70,0x00050005,
+0x00000013,0x28746962,0x693b3175,0x00003b31,
+0x00030005,0x00000011,0x00000075,0x00030005,
+0x00000012,0x00746962,0x00070005,0x0000001b,
+0x73746962,0x28383231,0x3b347576,0x753b3175,
+0x00003b31,0x00030005,0x00000018,0x00000075,
+0x00050005,0x00000019,0x53746962,0x74726174,
+0x00000000,0x00050005,0x0000001a,0x43746962,
+0x746e756f,0x00000000,0x000a0005,0x00000022,
+0x73746962,0x66383231,0x5a6c6c69,0x736f7265,
+0x34757628,0x3b31753b,0x753b3175,0x00003b31,
+0x00030005,0x0000001e,0x00000075,0x00050005,
+0x0000001f,0x53746962,0x74726174,0x00000000,
+0x00040005,0x00000020,0x45746962,0x0000646e,
+0x00050005,0x00000021,0x43746962,0x746e756f,
+0x00000000,0x00090005,0x00000029,0x5f746567,
+0x5f746962,0x6e756f63,0x31752874,0x3b31753b,
+0x753b3175,0x00003b31,0x00050005,0x00000025,
+0x5f6d756e,0x736c6176,0x00000000,0x00040005,
+0x00000026,0x74697274,0x00000073,0x00040005,
+0x00000027,0x6e697571,0x00007374,0x00040005,
+0x00000028,0x73746962,0x00000000,0x000a0005,
+0x00000031,0x5f746567,0x6b636170,0x7a69735f,
+0x31752865,0x3b31753b,0x753b3175,0x31753b31,
+0x0000003b,0x00040005,0x0000002c,0x74697274,
+0x00000073,0x00040005,0x0000002d,0x6e697571,
+0x00007374,0x00040005,0x0000002e,0x73746962,
+0x00000000,0x00040005,0x0000002f,0x6b636170,
+0x00000000,0x00050005,0x00000030,0x6b636170,
+0x69536465,0x0000657a,0x00090005,0x0000003a,
+0x6f636564,0x745f6564,0x28746972,0x3b347576,
+0x753b3175,0x31753b31,0x0000003b,0x00040005,
+0x00000036,0x61746164,0x00000000,0x00040005,
+0x00000037,0x72617473,0x00000074,0x00030005,
+0x00000038,0x00646e65,0x00030005,0x00000039,
+0x0000006e,0x00090005,0x00000043,0x6f636564,
+0x715f6564,0x746e6975,0x34757628,0x3b31753b,
+0x753b3175,0x00003b31,0x00040005,0x0000003f,
+0x61746164,0x00000000,0x00040005,0x00000040,
+0x72617473,0x00000074,0x00030005,0x00000041,
+0x00646e65,0x00030005,0x00000042,0x0000006e,
+0x00060005,0x00000047,0x5f746567,0x6f635f76,
+0x28746e75,0x003b3175,0x00030005,0x00000046,
+0x006d6563,0x00060005,0x0000004e,0x70617773,
+0x34697628,0x3469763b,0x0000003b,0x00030005,
+0x0000004c,0x00003176,0x00030005,0x0000004d,
+0x00003276,0x00090005,0x00000053,0x5f746962,
+0x6e617274,0x72656673,0x6769735f,0x2864656e,
+0x693b3169,0x00003b31,0x00030005,0x00000051,
+0x00000061,0x00030005,0x00000052,0x00000062,
+0x00070005,0x00000057,0x65756c62,0x6e6f635f,
+0x63617274,0x69762874,0x00003b34,0x00030005,
+0x00000056,0x006c6176,0x000d0005,0x00000061,
+0x6f636564,0x6c5f6564,0x665f7264,0x6d5f726f,
+0x2865646f,0x345b3175,0x753b5d30,0x31753b31,
+0x3475763b,0x3475763b,0x0000003b,0x00040005,
+0x0000005c,0x736c6176,0x00000000,0x00050005,
+0x0000005d,0x72617473,0x64695f74,0x00000078,
+0x00040005,0x0000005e,0x65646f6d,0x00000000,
+0x00030005,0x0000005f,0x00003163,0x00030005,
+0x00000060,0x00003263,0x00050005,0x00000064,
+0x68736168,0x75283235,0x00003b31,0x00030005,
+0x00000063,0x00000070,0x000a0005,0x0000006a,
+0x656c6573,0x705f7463,0x69747261,0x6e6f6974,
+0x3b317528,0x753b3175,0x31753b31,0x0000003b,
+0x00040005,0x00000066,0x64656573,0x00000000,
+0x00030005,0x00000067,0x00000078,0x00030005,
+0x00000068,0x00000079,0x00060005,0x00000069,
+0x74726170,0x6f697469,0x756f636e,0x0000746e,
+0x00080005,0x00000070,0x676e6973,0x635f656c,
+0x726f6c6f,0x6f6c625f,0x76286b63,0x003b3475,
+0x00040005,0x0000006f,0x6f6c6f63,0x00000072,
+0x00070005,0x00000073,0x6f727265,0x6f635f72,
+0x5f726f6c,0x636f6c62,0x0000286b,0x00080005,
+0x00000077,0x63747361,0x6365645f,0x5f65646f,
+0x636f6c62,0x7576286b,0x00003b34,0x00030005,
+0x00000076,0x00000075,0x00080005,0x0000007a,
+0x636f6c62,0x5f795f6b,0x657a6973,0x4144325f,
+0x79617272,0x00000028,0x00050005,0x00000086,
+0x73726966,0x78644974,0x00000000,0x00050005,
+0x0000008a,0x73726966,0x66664f74,0x00746573,
+0x00040005,0x0000008d,0x4d746962,0x006b7361,
+0x00050005,0x000000a7,0x73726966,0x756f4374,
+0x0000746e,0x00030005,0x000000aa,0x00746572,
+0x00040005,0x000000d0,0x61726170,0x0000006d,
+0x00040005,0x000000d2,0x61726170,0x0000006d,
+0x00040005,0x000000d4,0x61726170,0x0000006d,
+0x00060005,0x000000d8,0x74697274,0x7469625f,
+0x756f635f,0x0000746e,0x00060005,0x000000e1,
+0x6e697571,0x69625f74,0x6f635f74,0x00746e75,
+0x00060005,0x000000ea,0x65736162,0x7469625f,
+0x756f635f,0x0000746e,0x00040005,0x00000106,
+0x6f636e65,0x00646564,0x00070005,0x00000107,
+0x6f636e65,0x5f646564,0x73746962,0x6165725f,
+0x00000064,0x00030005,0x00000108,0x00000069,
+0x00030005,0x00000113,0x0000006d,0x00040005,
+0x00000115,0x61726170,0x0000006d,0x00040005,
+0x00000117,0x61726170,0x0000006d,0x00040005,
+0x00000119,0x61726170,0x0000006d,0x00040005,
+0x0000011b,0x61726170,0x0000006d,0x00060005,
+0x00000122,0x6f636e65,0x5f646564,0x73746962,
+0x00000000,0x00050005,0x00000128,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000012c,
+0x61726170,0x0000006d,0x00040005,0x0000012e,
+0x61726170,0x0000006d,0x00040005,0x00000130,
+0x61726170,0x0000006d,0x00040005,0x00000132,
+0x61726170,0x0000006d,0x00050005,0x00000135,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000141,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x00000149,0x00000069,0x00040005,
+0x00000151,0x75736572,0x0000746c,0x00050005,
+0x0000024c,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x0000025b,0x6f636e65,0x00646564,
+0x00070005,0x0000025c,0x6f636e65,0x5f646564,
+0x73746962,0x6165725f,0x00000064,0x00040005,
+0x0000025d,0x4d746962,0x006b7361,0x00030005,
+0x00000262,0x00000069,0x00030005,0x0000026c,
+0x0000006d,0x00040005,0x0000026e,0x61726170,
+0x0000006d,0x00040005,0x00000270,0x61726170,
+0x0000006d,0x00040005,0x00000272,0x61726170,
+0x0000006d,0x00040005,0x00000274,0x61726170,
+0x0000006d,0x00060005,0x0000027b,0x6f636e65,
+0x5f646564,0x73746962,0x00000000,0x00050005,
+0x00000280,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000284,0x61726170,0x0000006d,
+0x00040005,0x00000286,0x61726170,0x0000006d,
+0x00040005,0x00000288,0x61726170,0x0000006d,
+0x00040005,0x0000028a,0x61726170,0x0000006d,
+0x00050005,0x0000028d,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000299,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x000002a1,
+0x00000069,0x00040005,0x000002a9,0x75736572,
+0x0000746c,0x00050005,0x0000032e,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x00000343,
+0x00706d74,0x00030005,0x0000036a,0x00003076,
+0x00050005,0x0000036e,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000372,0x00003176,
+0x00050005,0x00000375,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000379,0x00003276,
+0x00050005,0x0000037c,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000380,0x00003376,
+0x00050005,0x00000383,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000387,0x00003476,
+0x00050005,0x0000038a,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x0000038e,0x00003576,
+0x00050005,0x00000391,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000395,0x00003676,
+0x00050005,0x00000399,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x0000039d,0x00003776,
+0x00050005,0x000003a0,0x65646e69,0x6c626178,
+0x00000065,0x00070005,0x000003b1,0x70646e65,
+0x746e696f,0x776f6c5f,0x6267725f,0x00000061,
+0x00070005,0x000003b7,0x70646e65,0x746e696f,
+0x6769685f,0x67725f68,0x00006162,0x00030005,
+0x000003bd,0x0000306c,0x00030005,0x000003c4,
+0x0000316c,0x00040005,0x000003de,0x61726170,
+0x0000006d,0x00040005,0x000003e0,0x61726170,
+0x0000006d,0x00040005,0x000003e5,0x61726170,
+0x0000006d,0x00040005,0x000003e7,0x61726170,
+0x0000006d,0x00050005,0x000003f4,0x68676968,
+0x6d756c5f,0x00000061,0x00030005,0x00000407,
+0x00000069,0x00030005,0x0000040f,0x00000078,
+0x00030005,0x0000041e,0x00003073,0x00030005,
+0x00000424,0x00003173,0x00040005,0x00000437,
+0x61726170,0x0000006d,0x00040005,0x00000439,
+0x61726170,0x0000006d,0x00040005,0x0000043e,
+0x61726170,0x0000006d,0x00040005,0x00000442,
+0x61726170,0x0000006d,0x00040005,0x00000447,
+0x61726170,0x0000006d,0x00040005,0x00000449,
+0x61726170,0x0000006d,0x00040005,0x0000044e,
+0x61726170,0x0000006d,0x00040005,0x00000450,
+0x61726170,0x0000006d,0x00040005,0x00000455,
+0x61726170,0x0000006d,0x00040005,0x00000457,
+0x61726170,0x0000006d,0x00040005,0x00000472,
+0x61726170,0x0000006d,0x00040005,0x00000474,
+0x61726170,0x0000006d,0x00040005,0x00000479,
+0x61726170,0x0000006d,0x00040005,0x0000047d,
+0x61726170,0x0000006d,0x00030005,0x00000499,
+0x00003073,0x00030005,0x000004a0,0x00003173,
+0x00040005,0x000004b6,0x61726170,0x0000006d,
+0x00040005,0x000004b8,0x61726170,0x0000006d,
+0x00040005,0x000004bd,0x61726170,0x0000006d,
+0x00040005,0x000004c1,0x61726170,0x0000006d,
+0x00040005,0x000004c6,0x61726170,0x0000006d,
+0x00040005,0x000004c8,0x61726170,0x0000006d,
+0x00040005,0x000004cd,0x61726170,0x0000006d,
+0x00040005,0x000004cf,0x61726170,0x0000006d,
+0x00040005,0x000004d4,0x61726170,0x0000006d,
+0x00040005,0x000004d6,0x61726170,0x0000006d,
+0x00040005,0x000004db,0x61726170,0x0000006d,
+0x00040005,0x000004dd,0x61726170,0x0000006d,
+0x00040005,0x000004fc,0x61726170,0x0000006d,
+0x00040005,0x000004fe,0x61726170,0x0000006d,
+0x00040005,0x00000503,0x61726170,0x0000006d,
+0x00040005,0x00000507,0x61726170,0x0000006d,
+0x00030005,0x00000550,0x0000007a,0x00070005,
+0x00000552,0x67616d49,0x726f4665,0x4274616d,
+0x6b636f6c,0x00000000,0x00060006,0x00000552,
+0x00000000,0x636f6c62,0x7a69536b,0x00000065,
+0x00060006,0x00000552,0x00000001,0x65736162,
+0x6579614c,0x00000072,0x00060006,0x00000552,
+0x00000002,0x6c616d73,0x6f6c426c,0x00006b63,
+0x00060005,0x00000554,0x75705f75,0x6f436873,
+0x6174736e,0x0000746e,0x00040005,0x00000565,
+0x6d756e72,0x00000000,0x00040005,0x00000566,
+0x61726170,0x0000006d,0x00040005,0x00000569,
+0x64656573,0x00000031,0x00040005,0x0000056d,
+0x64656573,0x00000032,0x00040005,0x00000571,
+0x64656573,0x00000033,0x00040005,0x00000575,
+0x64656573,0x00000034,0x00040005,0x0000057a,
+0x64656573,0x00000035,0x00040005,0x0000057e,
+0x64656573,0x00000036,0x00040005,0x00000583,
+0x64656573,0x00000037,0x00040005,0x00000588,
+0x64656573,0x00000038,0x00040005,0x0000058d,
+0x64656573,0x00000039,0x00040005,0x00000592,
+0x64656573,0x00003031,0x00040005,0x00000597,
+0x64656573,0x00003131,0x00040005,0x0000059c,
+0x64656573,0x00003231,0x00030005,0x000005cd,
+0x00316873,0x00030005,0x000005d3,0x00326873,
+0x00030005,0x000005e2,0x00336873,0x00030005,
+0x0000060e,0x00000061,0x00030005,0x0000061e,
+0x00000062,0x00030005,0x0000062e,0x00000063,
+0x00030005,0x0000063d,0x00000064,0x00030005,
+0x00000680,0x00000068,0x00030005,0x0000068b,
+0x00000077,0x00030005,0x00000697,0x00746572,
+0x00040005,0x000006ab,0x61726170,0x0000006d,
+0x00030005,0x000006af,0x00003375,0x00030005,
+0x000006b1,0x00373862,0x00030005,0x000006b5,
+0x00353662,0x00030005,0x000006b9,0x00323362,
+0x00030005,0x000006bd,0x00000061,0x00030005,
+0x000006bf,0x00000062,0x00030005,0x000006c1,
+0x00000064,0x00040005,0x000006c2,0x61726170,
+0x0000006d,0x00040005,0x000006c4,0x61726170,
+0x0000006d,0x00030005,0x000006c6,0x00726468,
+0x00040005,0x000006c8,0x61726170,0x0000006d,
+0x00040005,0x000006ca,0x61726170,0x0000006d,
+0x00030005,0x000006d1,0x00000072,0x00040005,
+0x000006d4,0x61726170,0x0000006d,0x00040005,
+0x000006d6,0x61726170,0x0000006d,0x00040005,
+0x000006dd,0x74646977,0x00000068,0x00040005,
+0x000006df,0x67696568,0x00007468,0x00040005,
+0x00000700,0x6f6c6f63,0x00000072,0x00040005,
+0x0000070e,0x61726170,0x0000006d,0x00040005,
+0x00000721,0x61726170,0x0000006d,0x00040005,
+0x00000723,0x61726170,0x0000006d,0x00040005,
+0x00000741,0x61726170,0x0000006d,0x00040005,
+0x00000743,0x61726170,0x0000006d,0x00040005,
+0x00000763,0x74697274,0x00000073,0x00040005,
+0x00000764,0x6e697571,0x00007374,0x00040005,
+0x00000765,0x73746962,0x00000000,0x00060005,
+0x00000766,0x67696577,0x6f437468,0x73746e75,
+0x00000000,0x00050005,0x0000079d,0x6b636170,
+0x69536465,0x0000657a,0x00040005,0x0000079e,
+0x6b636170,0x00000000,0x00040005,0x0000079f,
+0x61726170,0x0000006d,0x00040005,0x000007a1,
+0x61726170,0x0000006d,0x00040005,0x000007a3,
+0x61726170,0x0000006d,0x00040005,0x000007a5,
+0x61726170,0x0000006d,0x00040005,0x000007a6,
+0x61726170,0x0000006d,0x00040005,0x000007aa,
+0x49637273,0x00007864,0x00040005,0x000007ab,
+0x49747364,0x00007864,0x00050005,0x000007ac,
+0x76655275,0x65737265,0x00000064,0x00060005,
+0x000007ae,0x67696577,0x69427468,0x756f4374,
+0x0000746e,0x00040005,0x000007af,0x61726170,
+0x0000006d,0x00040005,0x000007b1,0x61726170,
+0x0000006d,0x00040005,0x000007b3,0x61726170,
+0x0000006d,0x00040005,0x000007b5,0x61726170,
+0x0000006d,0x00040005,0x000007d8,0x6f636564,
+0x00646564,0x00040005,0x000007d9,0x61726170,
+0x0000006d,0x00040005,0x000007db,0x61726170,
+0x0000006d,0x00040005,0x000007dd,0x61726170,
+0x0000006d,0x00040005,0x000007df,0x61726170,
+0x0000006d,0x00030005,0x000007e2,0x00000069,
+0x00050005,0x000007ed,0x67696577,0x72477468,
+0x00006469,0x00050005,0x00000811,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x00000819,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000837,0x6f636564,0x00646564,0x00040005,
+0x00000838,0x61726170,0x0000006d,0x00040005,
+0x0000083a,0x61726170,0x0000006d,0x00040005,
+0x0000083c,0x61726170,0x0000006d,0x00040005,
+0x0000083e,0x61726170,0x0000006d,0x00030005,
+0x00000841,0x00000069,0x00050005,0x00000859,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000861,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x0000087b,0x6f636564,0x52646564,
+0x00007761,0x00040005,0x0000087c,0x61726170,
+0x0000006d,0x00040005,0x0000087e,0x61726170,
+0x0000006d,0x00040005,0x00000880,0x61726170,
+0x0000006d,0x00040005,0x00000883,0x6f636564,
+0x00646564,0x00050005,0x0000088a,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x00000892,
+0x65646e69,0x6c626178,0x00000065,0x00060005,
+0x000008aa,0x74726170,0x6f697469,0x756f436e,
+0x0000746e,0x00050005,0x000008b9,0x67696577,
+0x74537468,0x00747261,0x00040005,0x000008ba,
+0x61726170,0x0000006d,0x00040005,0x000008bc,
+0x61726170,0x0000006d,0x00040005,0x000008be,
+0x61726170,0x0000006d,0x00040005,0x000008c0,
+0x61726170,0x0000006d,0x00060005,0x000008c4,
+0x6c617564,0x6e616c50,0x61745365,0x00007472,
+0x00030005,0x000008c9,0x006d6563,0x00050005,
+0x000008d4,0x74726170,0x65646f4d,0x00000000,
+0x00060005,0x000008d9,0x72747865,0x69424d61,
+0x756f4374,0x0000746e,0x00050005,0x000008e3,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x000008e7,0x72747865,0x74534d61,0x00747261,
+0x00040005,0x000008f3,0x5f6d6563,0x006c6c61,
+0x00040005,0x000008fe,0x426d6563,0x00657361,
+0x00040005,0x00000901,0x486d6563,0x00686769,
+0x00040005,0x00000903,0x61726170,0x0000006d,
+0x00040005,0x00000905,0x61726170,0x0000006d,
+0x00040005,0x00000907,0x61726170,0x0000006d,
+0x00040005,0x00000909,0x61726170,0x0000006d,
+0x00040005,0x0000090c,0x61726170,0x0000006d,
+0x00040005,0x0000090e,0x61726170,0x0000006d,
+0x00040005,0x00000910,0x61726170,0x0000006d,
+0x00040005,0x00000912,0x61726170,0x0000006d,
+0x00040005,0x00000917,0x72747865,0x00004d61,
+0x00040005,0x00000918,0x61726170,0x0000006d,
+0x00040005,0x00000919,0x61726170,0x0000006d,
+0x00040005,0x0000091b,0x61726170,0x0000006d,
+0x00060005,0x0000091e,0x6e69616d,0x7469424d,
+0x6e756f43,0x00000074,0x00050005,0x00000922,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000925,0x0000006d,0x00040005,0x00000940,
+0x61746f74,0x0000566c,0x00040005,0x00000941,
+0x74726170,0x00000000,0x00040005,0x0000094b,
+0x61726170,0x0000006d,0x00040005,0x00000953,
+0x74537065,0x00747261,0x00060005,0x00000959,
+0x61746f74,0x6176416c,0x69426c69,0x00007374,
+0x00050005,0x00000963,0x75517065,0x73746e69,
+0x00000000,0x00040005,0x00000964,0x72547065,
+0x00737469,0x00040005,0x00000965,0x69427065,
+0x00007374,0x00030005,0x00000966,0x00000069,
+0x00050005,0x00000979,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x0000097d,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x00000981,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x00000984,0x61726170,0x0000006d,0x00040005,
+0x00000986,0x61726170,0x0000006d,0x00040005,
+0x00000988,0x61726170,0x0000006d,0x00040005,
+0x0000098a,0x61726170,0x0000006d,0x00050005,
+0x0000099a,0x69427065,0x756f4374,0x0000746e,
+0x00040005,0x0000099b,0x61726170,0x0000006d,
+0x00040005,0x0000099d,0x61726170,0x0000006d,
+0x00040005,0x0000099f,0x61726170,0x0000006d,
+0x00040005,0x000009a1,0x61726170,0x0000006d,
+0x00040005,0x000009a4,0x6e457065,0x00000064,
+0x00050005,0x000009a8,0x6b636170,0x69536465,
+0x0000657a,0x00040005,0x000009a9,0x6b636170,
+0x00000000,0x00040005,0x000009aa,0x61726170,
+0x0000006d,0x00040005,0x000009ac,0x61726170,
+0x0000006d,0x00040005,0x000009ae,0x61726170,
+0x0000006d,0x00040005,0x000009b0,0x61726170,
+0x0000006d,0x00040005,0x000009b1,0x61726170,
+0x0000006d,0x00040005,0x000009b5,0x49637273,
+0x00007864,0x00040005,0x000009b7,0x49747364,
+0x00007864,0x00040005,0x000009c4,0x6f636564,
+0x00646564,0x00040005,0x000009c5,0x61726170,
+0x0000006d,0x00040005,0x000009c6,0x61726170,
+0x0000006d,0x00040005,0x000009c8,0x61726170,
+0x0000006d,0x00040005,0x000009ca,0x61726170,
+0x0000006d,0x00030005,0x000009cd,0x00000069,
+0x00040005,0x000009d5,0x66754276,0x00726566,
+0x00050005,0x00000a8d,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000a95,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000aa8,
+0x6f636564,0x00646564,0x00040005,0x00000aa9,
+0x61726170,0x0000006d,0x00040005,0x00000aaa,
+0x61726170,0x0000006d,0x00040005,0x00000aac,
+0x61726170,0x0000006d,0x00040005,0x00000aae,
+0x61726170,0x0000006d,0x00030005,0x00000ab1,
+0x00000069,0x00050005,0x00000ac6,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x00000ace,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000add,0x00637273,0x00040005,0x00000ade,
+0x61726170,0x0000006d,0x00040005,0x00000adf,
+0x61726170,0x0000006d,0x00040005,0x00000ae1,
+0x61726170,0x0000006d,0x00040005,0x00000ae4,
+0x6f636564,0x00646564,0x00050005,0x00000aeb,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000af3,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000b00,0x66667562,0x64497265,
+0x00000078,0x00040005,0x00000b01,0x74726170,
+0x00000000,0x00050005,0x00000b0f,0x50646e65,
+0x746e696f,0x00000073,0x00040005,0x00000b12,
+0x61726170,0x0000006d,0x00040005,0x00000b14,
+0x61726170,0x0000006d,0x00040005,0x00000b17,
+0x61726170,0x0000006d,0x00040005,0x00000b18,
+0x61726170,0x0000006d,0x00040005,0x00000b1f,
+0x61726170,0x0000006d,0x00030005,0x00000b28,
+0x00747364,0x00030005,0x00000b35,0x00006464,
+0x00030005,0x00000b38,0x00000068,0x00030005,
+0x00000b42,0x00000077,0x00040005,0x00000b4c,
+0x74726170,0x00000000,0x00040005,0x00000b51,
+0x61726170,0x0000006d,0x00040005,0x00000b52,
+0x61726170,0x0000006d,0x00040005,0x00000b54,
+0x61726170,0x0000006d,0x00040005,0x00000b56,
+0x61726170,0x0000006d,0x00050005,0x00000b61,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000b67,0x00746572,0x00030005,0x00000b70,
+0x00007473,0x00030005,0x00000b74,0x00747363,
+0x00030005,0x00000b78,0x00747367,0x00030005,
+0x00000b85,0x0074736a,0x00030005,0x00000b89,
+0x00747366,0x00030005,0x00000b8d,0x00003076,
+0x00030005,0x00000b95,0x00303070,0x00030005,
+0x00000ba2,0x00313070,0x00030005,0x00000bb1,
+0x00303170,0x00030005,0x00000bc2,0x00313170,
+0x00030005,0x00000bd5,0x00313177,0x00030005,
+0x00000bdd,0x00303177,0x00030005,0x00000be2,
+0x00313077,0x00030005,0x00000be7,0x00303077,
+0x00030005,0x00000bf0,0x00000069,0x00030005,
+0x00000c08,0x00003063,0x00030005,0x00000c0c,
+0x00003163,0x00030005,0x00000c10,0x00000063,
+0x00030005,0x00000c25,0x00736363,0x00040005,
+0x00000c26,0x61726170,0x0000006d,0x00040005,
+0x00000c27,0x61726170,0x0000006d,0x00040005,
+0x00000c29,0x61726170,0x0000006d,0x00030005,
+0x00000c50,0x00736f70,0x00080005,0x00000c53,
+0x475f6c67,0x61626f6c,0x766e496c,0x7461636f,
+0x496e6f69,0x00000044,0x00050005,0x00000c5d,
+0x42637273,0x6b636f6c,0x00000000,0x00050005,
+0x00000c60,0x6d695f75,0x30656761,0x00000000,
+0x00040005,0x00000c62,0x61726170,0x0000006d,
+0x00060005,0x00000c74,0x6f636564,0x6572706d,
+0x64657373,0x00000000,0x00030005,0x00000c77,
+0x00000079,0x00030005,0x00000c80,0x00000078,
+0x00050005,0x00000c8c,0x6d695f75,0x31656761,
+0x00000000,0x00040005,0x00000ca1,0x61726170,
+0x0000006d,0x00050048,0x00000552,0x00000000,
+0x00000023,0x00000000,0x00050048,0x00000552,
+0x00000001,0x00000023,0x00000008,0x00050048,
+0x00000552,0x00000002,0x00000023,0x0000000c,
+0x00030047,0x00000552,0x00000002,0x00040047,
+0x00000c53,0x0000000b,0x0000001c,0x00040047,
+0x00000c60,0x00000022,0x00000000,0x00040047,
+0x00000c60,0x00000021,0x00000000,0x00030047,
+0x00000c60,0x00000018,0x00040047,0x00000c8c,
+0x00000022,0x00000000,0x00040047,0x00000c8c,
+0x00000021,0x00000001,0x00030047,0x00000c8c,
+0x00000019,0x00040047,0x00000caf,0x0000000b,
+0x00000019,0x00020013,0x00000002,0x00030021,
+0x00000003,0x00000002,0x00040015,0x00000006,
+0x00000020,0x00000001,0x00040017,0x00000007,
+0x00000006,0x00000003,0x00040020,0x00000008,
+0x00000007,0x00000007,0x00040021,0x00000009,
+0x00000007,0x00000008,0x00040015,0x0000000d,
+0x00000020,0x00000000,0x00040020,0x0000000e,
+0x00000007,0x0000000d,0x00040020,0x0000000f,
+0x00000007,0x00000006,0x00050021,0x00000010,
+0x0000000d,0x0000000e,0x0000000f,0x00040017,
+0x00000015,0x0000000d,0x00000004,0x00040020,
+0x00000016,0x00000007,0x00000015,0x00060021,
+0x00000017,0x0000000d,0x00000016,0x0000000e,
+0x0000000e,0x00070021,0x0000001d,0x0000000d,
+0x00000016,0x0000000e,0x0000000e,0x0000000e,
+0x00070021,0x00000024,0x0000000d,0x0000000e,
+0x0000000e,0x0000000e,0x0000000e,0x00080021,
+0x0000002b,0x00000002,0x0000000e,0x0000000e,
+0x0000000e,0x0000000e,0x0000000e,0x0004002b,
+0x0000000d,0x00000033,0x00000005,0x0004001c,
+0x00000034,0x0000000d,0x00000033,0x00070021,
+0x00000035,0x00000034,0x00000016,0x0000000e,
+0x0000000e,0x0000000e,0x0004002b,0x0000000d,
+0x0000003c,0x00000003,0x0004001c,0x0000003d,
+0x0000000d,0x0000003c,0x00070021,0x0000003e,
+0x0000003d,0x00000016,0x0000000e,0x0000000e,
+0x0000000e,0x00040021,0x00000045,0x0000000d,
+0x0000000e,0x00040017,0x00000049,0x00000006,
+0x00000004,0x00040020,0x0000004a,0x00000007,
+0x00000049,0x00050021,0x0000004b,0x00000002,
+0x0000004a,0x0000004a,0x00050021,0x00000050,
+0x00000002,0x0000000f,0x0000000f,0x00040021,
+0x00000055,0x00000002,0x0000004a,0x0004002b,
+0x0000000d,0x00000059,0x00000028,0x0004001c,
+0x0000005a,0x0000000d,0x00000059,0x00080021,
+0x0000005b,0x00000002,0x0000005a,0x0000000e,
+0x0000000e,0x00000016,0x00000016,0x0004002b,
+0x0000000d,0x0000006c,0x00000090,0x0004001c,
+0x0000006d,0x00000015,0x0000006c,0x00040021,
+0x0000006e,0x0000006d,0x00000016,0x00030021,
+0x00000072,0x0000006d,0x00040021,0x00000075,
+0x0000006d,0x00000015,0x00030021,0x00000079,
+0x0000000d,0x0004002b,0x0000000d,0x00000082,
+0x00000001,0x0004002b,0x0000000d,0x00000088,
+0x00000020,0x0004002b,0x00000006,0x0000008e,
+0x00000001,0x00020014,0x00000099,0x0004002b,
+0x0000000d,0x000000c9,0x00000000,0x0004002b,
+0x0000000d,0x000000da,0x00000008,0x0004002b,
+0x0000000d,0x000000de,0x00000004,0x0004002b,
+0x0000000d,0x000000e3,0x00000007,0x0004002b,
+0x0000000d,0x000000e7,0x00000002,0x0004002b,
+0x00000006,0x00000109,0x00000000,0x0004002b,
+0x00000006,0x00000110,0x00000005,0x00040020,
+0x00000112,0x00000007,0x00000034,0x0004001c,
+0x00000123,0x00000006,0x00000033,0x0004002b,
+0x00000006,0x00000124,0x00000002,0x0008002c,
+0x00000123,0x00000125,0x00000124,0x00000124,
+0x0000008e,0x00000124,0x0000008e,0x00040020,
+0x00000127,0x00000007,0x00000123,0x0004002b,
+0x0000000d,0x00000153,0x00000100,0x0004001c,
+0x00000154,0x00000034,0x00000153,0x0008002c,
+0x00000034,0x00000155,0x000000c9,0x000000c9,
+0x000000c9,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000156,0x00000082,0x000000c9,
+0x000000c9,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000157,0x000000e7,0x000000c9,
+0x000000c9,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000158,0x000000c9,0x000000c9,
+0x000000e7,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000159,0x000000c9,0x00000082,
+0x000000c9,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000015a,0x00000082,0x00000082,
+0x000000c9,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000015b,0x000000e7,0x00000082,
+0x000000c9,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000015c,0x00000082,0x000000c9,
+0x000000e7,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000015d,0x000000c9,0x000000e7,
+0x000000c9,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000015e,0x00000082,0x000000e7,
+0x000000c9,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000015f,0x000000e7,0x000000e7,
+0x000000c9,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000160,0x000000e7,0x000000c9,
+0x000000e7,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000161,0x000000c9,0x000000e7,
+0x000000e7,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000162,0x00000082,0x000000e7,
+0x000000e7,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000163,0x000000e7,0x000000e7,
+0x000000e7,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000164,0x000000c9,0x000000c9,
+0x00000082,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000165,0x00000082,0x000000c9,
+0x00000082,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000166,0x000000e7,0x000000c9,
+0x00000082,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000167,0x000000c9,0x00000082,
+0x000000e7,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000168,0x000000c9,0x00000082,
+0x00000082,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000169,0x00000082,0x00000082,
+0x00000082,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000016a,0x000000e7,0x00000082,
+0x00000082,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000016b,0x00000082,0x00000082,
+0x000000e7,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000016c,0x000000c9,0x000000e7,
+0x00000082,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000016d,0x00000082,0x000000e7,
+0x00000082,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000016e,0x000000e7,0x000000e7,
+0x00000082,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x0000016f,0x000000e7,0x00000082,
+0x000000e7,0x000000c9,0x000000c9,0x0008002c,
+0x00000034,0x00000170,0x000000c9,0x000000c9,
+0x000000c9,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x00000171,0x00000082,0x000000c9,
+0x000000c9,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x00000172,0x000000e7,0x000000c9,
+0x000000c9,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x00000173,0x000000c9,0x000000c9,
+0x000000e7,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x00000174,0x000000c9,0x000000c9,
+0x000000c9,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000175,0x00000082,0x000000c9,
+0x000000c9,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000176,0x000000e7,0x000000c9,
+0x000000c9,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000177,0x000000c9,0x000000c9,
+0x000000e7,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000178,0x000000c9,0x00000082,
+0x000000c9,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000179,0x00000082,0x00000082,
+0x000000c9,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000017a,0x000000e7,0x00000082,
+0x000000c9,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000017b,0x00000082,0x000000c9,
+0x000000e7,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000017c,0x000000c9,0x000000e7,
+0x000000c9,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000017d,0x00000082,0x000000e7,
+0x000000c9,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000017e,0x000000e7,0x000000e7,
+0x000000c9,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000017f,0x000000e7,0x000000c9,
+0x000000e7,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000180,0x000000c9,0x000000e7,
+0x000000e7,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000181,0x00000082,0x000000e7,
+0x000000e7,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000182,0x000000e7,0x000000e7,
+0x000000e7,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000183,0x000000c9,0x000000c9,
+0x00000082,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000184,0x00000082,0x000000c9,
+0x00000082,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000185,0x000000e7,0x000000c9,
+0x00000082,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000186,0x000000c9,0x00000082,
+0x000000e7,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000187,0x000000c9,0x00000082,
+0x00000082,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000188,0x00000082,0x00000082,
+0x00000082,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x00000189,0x000000e7,0x00000082,
+0x00000082,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000018a,0x00000082,0x00000082,
+0x000000e7,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000018b,0x000000c9,0x000000e7,
+0x00000082,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000018c,0x00000082,0x000000e7,
+0x00000082,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000018d,0x000000e7,0x000000e7,
+0x00000082,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000018e,0x000000e7,0x00000082,
+0x000000e7,0x00000082,0x000000c9,0x0008002c,
+0x00000034,0x0000018f,0x000000c9,0x00000082,
+0x000000c9,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x00000190,0x00000082,0x00000082,
+0x000000c9,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x00000191,0x000000e7,0x00000082,
+0x000000c9,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x00000192,0x00000082,0x000000c9,
+0x000000e7,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x00000193,0x000000c9,0x000000c9,
+0x000000c9,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x00000194,0x00000082,0x000000c9,
+0x000000c9,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x00000195,0x000000e7,0x000000c9,
+0x000000c9,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x00000196,0x000000c9,0x000000c9,
+0x000000e7,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x00000197,0x000000c9,0x00000082,
+0x000000c9,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x00000198,0x00000082,0x00000082,
+0x000000c9,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x00000199,0x000000e7,0x00000082,
+0x000000c9,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x0000019a,0x00000082,0x000000c9,
+0x000000e7,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x0000019b,0x000000c9,0x000000e7,
+0x000000c9,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x0000019c,0x00000082,0x000000e7,
+0x000000c9,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x0000019d,0x000000e7,0x000000e7,
+0x000000c9,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x0000019e,0x000000e7,0x000000c9,
+0x000000e7,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x0000019f,0x000000c9,0x000000e7,
+0x000000e7,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a0,0x00000082,0x000000e7,
+0x000000e7,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a1,0x000000e7,0x000000e7,
+0x000000e7,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a2,0x000000c9,0x000000c9,
+0x00000082,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a3,0x00000082,0x000000c9,
+0x00000082,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a4,0x000000e7,0x000000c9,
+0x00000082,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a5,0x000000c9,0x00000082,
+0x000000e7,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a6,0x000000c9,0x00000082,
+0x00000082,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a7,0x00000082,0x00000082,
+0x00000082,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a8,0x000000e7,0x00000082,
+0x00000082,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001a9,0x00000082,0x00000082,
+0x000000e7,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001aa,0x000000c9,0x000000e7,
+0x00000082,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001ab,0x00000082,0x000000e7,
+0x00000082,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001ac,0x000000e7,0x000000e7,
+0x00000082,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001ad,0x000000e7,0x00000082,
+0x000000e7,0x000000e7,0x000000c9,0x0008002c,
+0x00000034,0x000001ae,0x000000c9,0x000000e7,
+0x000000c9,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001af,0x00000082,0x000000e7,
+0x000000c9,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001b0,0x000000e7,0x000000e7,
+0x000000c9,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001b1,0x000000e7,0x000000c9,
+0x000000e7,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001b2,0x000000c9,0x000000c9,
+0x000000c9,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001b3,0x00000082,0x000000c9,
+0x000000c9,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001b4,0x000000e7,0x000000c9,
+0x000000c9,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001b5,0x000000c9,0x000000c9,
+0x000000e7,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001b6,0x000000c9,0x00000082,
+0x000000c9,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001b7,0x00000082,0x00000082,
+0x000000c9,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001b8,0x000000e7,0x00000082,
+0x000000c9,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001b9,0x00000082,0x000000c9,
+0x000000e7,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001ba,0x000000c9,0x000000e7,
+0x000000c9,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001bb,0x00000082,0x000000e7,
+0x000000c9,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001bc,0x000000e7,0x000000e7,
+0x000000c9,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001bd,0x000000e7,0x000000c9,
+0x000000e7,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001be,0x000000c9,0x000000e7,
+0x000000e7,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001bf,0x00000082,0x000000e7,
+0x000000e7,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c0,0x000000e7,0x000000e7,
+0x000000e7,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c1,0x000000c9,0x000000c9,
+0x00000082,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c2,0x00000082,0x000000c9,
+0x00000082,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c3,0x000000e7,0x000000c9,
+0x00000082,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c4,0x000000c9,0x00000082,
+0x000000e7,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c5,0x000000c9,0x00000082,
+0x00000082,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c6,0x00000082,0x00000082,
+0x00000082,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c7,0x000000e7,0x00000082,
+0x00000082,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c8,0x00000082,0x00000082,
+0x000000e7,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001c9,0x000000c9,0x000000e7,
+0x00000082,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001ca,0x00000082,0x000000e7,
+0x00000082,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001cb,0x000000e7,0x000000e7,
+0x00000082,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001cc,0x000000e7,0x00000082,
+0x000000e7,0x000000c9,0x000000e7,0x0008002c,
+0x00000034,0x000001cd,0x000000c9,0x000000e7,
+0x000000e7,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001ce,0x00000082,0x000000e7,
+0x000000e7,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001cf,0x000000e7,0x000000e7,
+0x000000e7,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001d0,0x000000c9,0x000000c9,
+0x000000c9,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001d1,0x00000082,0x000000c9,
+0x000000c9,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001d2,0x000000e7,0x000000c9,
+0x000000c9,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001d3,0x000000c9,0x000000c9,
+0x000000e7,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001d4,0x000000c9,0x00000082,
+0x000000c9,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001d5,0x00000082,0x00000082,
+0x000000c9,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001d6,0x000000e7,0x00000082,
+0x000000c9,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001d7,0x00000082,0x000000c9,
+0x000000e7,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001d8,0x000000c9,0x000000e7,
+0x000000c9,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001d9,0x00000082,0x000000e7,
+0x000000c9,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001da,0x000000e7,0x000000e7,
+0x000000c9,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001db,0x000000e7,0x000000c9,
+0x000000e7,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001dc,0x000000c9,0x000000e7,
+0x000000e7,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001dd,0x00000082,0x000000e7,
+0x000000e7,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001de,0x000000e7,0x000000e7,
+0x000000e7,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001df,0x000000c9,0x000000c9,
+0x00000082,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e0,0x00000082,0x000000c9,
+0x00000082,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e1,0x000000e7,0x000000c9,
+0x00000082,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e2,0x000000c9,0x00000082,
+0x000000e7,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e3,0x000000c9,0x00000082,
+0x00000082,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e4,0x00000082,0x00000082,
+0x00000082,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e5,0x000000e7,0x00000082,
+0x00000082,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e6,0x00000082,0x00000082,
+0x000000e7,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e7,0x000000c9,0x000000e7,
+0x00000082,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e8,0x00000082,0x000000e7,
+0x00000082,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001e9,0x000000e7,0x000000e7,
+0x00000082,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001ea,0x000000e7,0x00000082,
+0x000000e7,0x000000c9,0x00000082,0x0008002c,
+0x00000034,0x000001eb,0x000000c9,0x000000c9,
+0x00000082,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001ec,0x00000082,0x000000c9,
+0x00000082,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001ed,0x000000e7,0x000000c9,
+0x00000082,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001ee,0x000000c9,0x00000082,
+0x000000e7,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x000001ef,0x000000c9,0x000000c9,
+0x000000c9,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f0,0x00000082,0x000000c9,
+0x000000c9,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f1,0x000000e7,0x000000c9,
+0x000000c9,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f2,0x000000c9,0x000000c9,
+0x000000e7,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f3,0x000000c9,0x00000082,
+0x000000c9,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f4,0x00000082,0x00000082,
+0x000000c9,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f5,0x000000e7,0x00000082,
+0x000000c9,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f6,0x00000082,0x000000c9,
+0x000000e7,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f7,0x000000c9,0x000000e7,
+0x000000c9,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f8,0x00000082,0x000000e7,
+0x000000c9,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001f9,0x000000e7,0x000000e7,
+0x000000c9,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001fa,0x000000e7,0x000000c9,
+0x000000e7,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001fb,0x000000c9,0x000000e7,
+0x000000e7,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001fc,0x00000082,0x000000e7,
+0x000000e7,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001fd,0x000000e7,0x000000e7,
+0x000000e7,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001fe,0x000000c9,0x000000c9,
+0x00000082,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x000001ff,0x00000082,0x000000c9,
+0x00000082,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000200,0x000000e7,0x000000c9,
+0x00000082,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000201,0x000000c9,0x00000082,
+0x000000e7,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000202,0x000000c9,0x00000082,
+0x00000082,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000203,0x00000082,0x00000082,
+0x00000082,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000204,0x000000e7,0x00000082,
+0x00000082,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000205,0x00000082,0x00000082,
+0x000000e7,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000206,0x000000c9,0x000000e7,
+0x00000082,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000207,0x00000082,0x000000e7,
+0x00000082,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000208,0x000000e7,0x000000e7,
+0x00000082,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x00000209,0x000000e7,0x00000082,
+0x000000e7,0x00000082,0x00000082,0x0008002c,
+0x00000034,0x0000020a,0x000000c9,0x00000082,
+0x00000082,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x0000020b,0x00000082,0x00000082,
+0x00000082,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x0000020c,0x000000e7,0x00000082,
+0x00000082,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x0000020d,0x00000082,0x00000082,
+0x000000e7,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x0000020e,0x000000c9,0x000000c9,
+0x000000c9,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x0000020f,0x00000082,0x000000c9,
+0x000000c9,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000210,0x000000e7,0x000000c9,
+0x000000c9,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000211,0x000000c9,0x000000c9,
+0x000000e7,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000212,0x000000c9,0x00000082,
+0x000000c9,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000213,0x00000082,0x00000082,
+0x000000c9,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000214,0x000000e7,0x00000082,
+0x000000c9,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000215,0x00000082,0x000000c9,
+0x000000e7,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000216,0x000000c9,0x000000e7,
+0x000000c9,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000217,0x00000082,0x000000e7,
+0x000000c9,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000218,0x000000e7,0x000000e7,
+0x000000c9,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000219,0x000000e7,0x000000c9,
+0x000000e7,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x0000021a,0x000000c9,0x000000e7,
+0x000000e7,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x0000021b,0x00000082,0x000000e7,
+0x000000e7,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x0000021c,0x000000e7,0x000000e7,
+0x000000e7,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x0000021d,0x000000c9,0x000000c9,
+0x00000082,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x0000021e,0x00000082,0x000000c9,
+0x00000082,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x0000021f,0x000000e7,0x000000c9,
+0x00000082,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000220,0x000000c9,0x00000082,
+0x000000e7,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000221,0x000000c9,0x00000082,
+0x00000082,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000222,0x00000082,0x00000082,
+0x00000082,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000223,0x000000e7,0x00000082,
+0x00000082,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000224,0x00000082,0x00000082,
+0x000000e7,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000225,0x000000c9,0x000000e7,
+0x00000082,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000226,0x00000082,0x000000e7,
+0x00000082,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000227,0x000000e7,0x000000e7,
+0x00000082,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000228,0x000000e7,0x00000082,
+0x000000e7,0x000000e7,0x00000082,0x0008002c,
+0x00000034,0x00000229,0x000000c9,0x000000e7,
+0x00000082,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x0000022a,0x00000082,0x000000e7,
+0x00000082,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x0000022b,0x000000e7,0x000000e7,
+0x00000082,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x0000022c,0x000000e7,0x00000082,
+0x000000e7,0x000000e7,0x000000e7,0x0008002c,
+0x00000034,0x0000022d,0x000000c9,0x000000c9,
+0x000000c9,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x0000022e,0x00000082,0x000000c9,
+0x000000c9,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x0000022f,0x000000e7,0x000000c9,
+0x000000c9,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000230,0x000000c9,0x000000c9,
+0x000000e7,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000231,0x000000c9,0x00000082,
+0x000000c9,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000232,0x00000082,0x00000082,
+0x000000c9,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000233,0x000000e7,0x00000082,
+0x000000c9,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000234,0x00000082,0x000000c9,
+0x000000e7,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000235,0x000000c9,0x000000e7,
+0x000000c9,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000236,0x00000082,0x000000e7,
+0x000000c9,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000237,0x000000e7,0x000000e7,
+0x000000c9,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000238,0x000000e7,0x000000c9,
+0x000000e7,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000239,0x000000c9,0x000000e7,
+0x000000e7,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x0000023a,0x00000082,0x000000e7,
+0x000000e7,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x0000023b,0x000000e7,0x000000e7,
+0x000000e7,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x0000023c,0x000000c9,0x000000c9,
+0x00000082,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x0000023d,0x00000082,0x000000c9,
+0x00000082,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x0000023e,0x000000e7,0x000000c9,
+0x00000082,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x0000023f,0x000000c9,0x00000082,
+0x000000e7,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000240,0x000000c9,0x00000082,
+0x00000082,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000241,0x00000082,0x00000082,
+0x00000082,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000242,0x000000e7,0x00000082,
+0x00000082,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000243,0x00000082,0x00000082,
+0x000000e7,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000244,0x000000c9,0x000000e7,
+0x00000082,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000245,0x00000082,0x000000e7,
+0x00000082,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000246,0x000000e7,0x000000e7,
+0x00000082,0x00000082,0x000000e7,0x0008002c,
+0x00000034,0x00000247,0x000000e7,0x00000082,
+0x000000e7,0x00000082,0x000000e7,0x0103002c,
+0x00000154,0x00000248,0x00000155,0x00000156,
+0x00000157,0x00000158,0x00000159,0x0000015a,
+0x0000015b,0x0000015c,0x0000015d,0x0000015e,
+0x0000015f,0x00000160,0x00000161,0x00000162,
+0x00000163,0x00000160,0x00000164,0x00000165,
+0x00000166,0x00000167,0x00000168,0x00000169,
+0x0000016a,0x0000016b,0x0000016c,0x0000016d,
+0x0000016e,0x0000016f,0x00000170,0x00000171,
+0x00000172,0x00000173,0x00000174,0x00000175,
+0x00000176,0x00000177,0x00000178,0x00000179,
+0x0000017a,0x0000017b,0x0000017c,0x0000017d,
+0x0000017e,0x0000017f,0x00000180,0x00000181,
+0x00000182,0x0000017f,0x00000183,0x00000184,
+0x00000185,0x00000186,0x00000187,0x00000188,
+0x00000189,0x0000018a,0x0000018b,0x0000018c,
+0x0000018d,0x0000018e,0x0000018f,0x00000190,
+0x00000191,0x00000192,0x00000193,0x00000194,
+0x00000195,0x00000196,0x00000197,0x00000198,
+0x00000199,0x0000019a,0x0000019b,0x0000019c,
+0x0000019d,0x0000019e,0x0000019f,0x000001a0,
+0x000001a1,0x0000019e,0x000001a2,0x000001a3,
+0x000001a4,0x000001a5,0x000001a6,0x000001a7,
+0x000001a8,0x000001a9,0x000001aa,0x000001ab,
+0x000001ac,0x000001ad,0x000001ae,0x000001af,
+0x000001b0,0x000001b1,0x000001b2,0x000001b3,
+0x000001b4,0x000001b5,0x000001b6,0x000001b7,
+0x000001b8,0x000001b9,0x000001ba,0x000001bb,
+0x000001bc,0x000001bd,0x000001be,0x000001bf,
+0x000001c0,0x000001bd,0x000001c1,0x000001c2,
+0x000001c3,0x000001c4,0x000001c5,0x000001c6,
+0x000001c7,0x000001c8,0x000001c9,0x000001ca,
+0x000001cb,0x000001cc,0x000001cd,0x000001ce,
+0x000001cf,0x000001b1,0x000001d0,0x000001d1,
+0x000001d2,0x000001d3,0x000001d4,0x000001d5,
+0x000001d6,0x000001d7,0x000001d8,0x000001d9,
+0x000001da,0x000001db,0x000001dc,0x000001dd,
+0x000001de,0x000001db,0x000001df,0x000001e0,
+0x000001e1,0x000001e2,0x000001e3,0x000001e4,
+0x000001e5,0x000001e6,0x000001e7,0x000001e8,
+0x000001e9,0x000001ea,0x000001eb,0x000001ec,
+0x000001ed,0x000001ee,0x000001ef,0x000001f0,
+0x000001f1,0x000001f2,0x000001f3,0x000001f4,
+0x000001f5,0x000001f6,0x000001f7,0x000001f8,
+0x000001f9,0x000001fa,0x000001fb,0x000001fc,
+0x000001fd,0x000001fa,0x000001fe,0x000001ff,
+0x00000200,0x00000201,0x00000202,0x00000203,
+0x00000204,0x00000205,0x00000206,0x00000207,
+0x00000208,0x00000209,0x0000020a,0x0000020b,
+0x0000020c,0x0000020d,0x0000020e,0x0000020f,
+0x00000210,0x00000211,0x00000212,0x00000213,
+0x00000214,0x00000215,0x00000216,0x00000217,
+0x00000218,0x00000219,0x0000021a,0x0000021b,
+0x0000021c,0x00000219,0x0000021d,0x0000021e,
+0x0000021f,0x00000220,0x00000221,0x00000222,
+0x00000223,0x00000224,0x00000225,0x00000226,
+0x00000227,0x00000228,0x00000229,0x0000022a,
+0x0000022b,0x0000022c,0x0000022d,0x0000022e,
+0x0000022f,0x00000230,0x00000231,0x00000232,
+0x00000233,0x00000234,0x00000235,0x00000236,
+0x00000237,0x00000238,0x00000239,0x0000023a,
+0x0000023b,0x00000238,0x0000023c,0x0000023d,
+0x0000023e,0x0000023f,0x00000240,0x00000241,
+0x00000242,0x00000243,0x00000244,0x00000245,
+0x00000246,0x00000247,0x000001cd,0x000001ce,
+0x000001cf,0x0000022c,0x00040020,0x0000024b,
+0x00000007,0x00000154,0x0004002b,0x00000006,
+0x00000269,0x00000003,0x00040020,0x0000026b,
+0x00000007,0x0000003d,0x0004001c,0x0000027c,
+0x00000006,0x0000003c,0x0006002c,0x0000027c,
+0x0000027d,0x00000269,0x00000124,0x00000124,
+0x00040020,0x0000027f,0x00000007,0x0000027c,
+0x0004002b,0x0000000d,0x000002ab,0x00000080,
+0x0004001c,0x000002ac,0x0000003d,0x000002ab,
+0x0006002c,0x0000003d,0x000002ad,0x000000c9,
+0x000000c9,0x000000c9,0x0006002c,0x0000003d,
+0x000002ae,0x00000082,0x000000c9,0x000000c9,
+0x0006002c,0x0000003d,0x000002af,0x000000e7,
+0x000000c9,0x000000c9,0x0006002c,0x0000003d,
+0x000002b0,0x0000003c,0x000000c9,0x000000c9,
+0x0006002c,0x0000003d,0x000002b1,0x000000de,
+0x000000c9,0x000000c9,0x0006002c,0x0000003d,
+0x000002b2,0x000000c9,0x000000de,0x000000c9,
+0x0006002c,0x0000003d,0x000002b3,0x000000de,
+0x000000de,0x000000c9,0x0006002c,0x0000003d,
+0x000002b4,0x000000de,0x000000de,0x000000de,
+0x0006002c,0x0000003d,0x000002b5,0x000000c9,
+0x00000082,0x000000c9,0x0006002c,0x0000003d,
+0x000002b6,0x00000082,0x00000082,0x000000c9,
+0x0006002c,0x0000003d,0x000002b7,0x000000e7,
+0x00000082,0x000000c9,0x0006002c,0x0000003d,
+0x000002b8,0x0000003c,0x00000082,0x000000c9,
+0x0006002c,0x0000003d,0x000002b9,0x000000de,
+0x00000082,0x000000c9,0x0006002c,0x0000003d,
+0x000002ba,0x00000082,0x000000de,0x000000c9,
+0x0006002c,0x0000003d,0x000002bb,0x000000de,
+0x000000de,0x00000082,0x0006002c,0x0000003d,
+0x000002bc,0x000000c9,0x000000e7,0x000000c9,
+0x0006002c,0x0000003d,0x000002bd,0x00000082,
+0x000000e7,0x000000c9,0x0006002c,0x0000003d,
+0x000002be,0x000000e7,0x000000e7,0x000000c9,
+0x0006002c,0x0000003d,0x000002bf,0x0000003c,
+0x000000e7,0x000000c9,0x0006002c,0x0000003d,
+0x000002c0,0x000000de,0x000000e7,0x000000c9,
+0x0006002c,0x0000003d,0x000002c1,0x000000e7,
+0x000000de,0x000000c9,0x0006002c,0x0000003d,
+0x000002c2,0x000000de,0x000000de,0x000000e7,
+0x0006002c,0x0000003d,0x000002c3,0x000000c9,
+0x0000003c,0x000000c9,0x0006002c,0x0000003d,
+0x000002c4,0x00000082,0x0000003c,0x000000c9,
+0x0006002c,0x0000003d,0x000002c5,0x000000e7,
+0x0000003c,0x000000c9,0x0006002c,0x0000003d,
+0x000002c6,0x0000003c,0x0000003c,0x000000c9,
+0x0006002c,0x0000003d,0x000002c7,0x000000de,
+0x0000003c,0x000000c9,0x0006002c,0x0000003d,
+0x000002c8,0x0000003c,0x000000de,0x000000c9,
+0x0006002c,0x0000003d,0x000002c9,0x000000de,
+0x000000de,0x0000003c,0x0006002c,0x0000003d,
+0x000002ca,0x000000c9,0x000000c9,0x00000082,
+0x0006002c,0x0000003d,0x000002cb,0x00000082,
+0x000000c9,0x00000082,0x0006002c,0x0000003d,
+0x000002cc,0x000000e7,0x000000c9,0x00000082,
+0x0006002c,0x0000003d,0x000002cd,0x0000003c,
+0x000000c9,0x00000082,0x0006002c,0x0000003d,
+0x000002ce,0x000000de,0x000000c9,0x00000082,
+0x0006002c,0x0000003d,0x000002cf,0x000000c9,
+0x000000de,0x00000082,0x0006002c,0x0000003d,
+0x000002d0,0x000000de,0x000000c9,0x000000de,
+0x0006002c,0x0000003d,0x000002d1,0x000000c9,
+0x000000de,0x000000de,0x0006002c,0x0000003d,
+0x000002d2,0x000000c9,0x00000082,0x00000082,
+0x0006002c,0x0000003d,0x000002d3,0x00000082,
+0x00000082,0x00000082,0x0006002c,0x0000003d,
+0x000002d4,0x000000e7,0x00000082,0x00000082,
+0x0006002c,0x0000003d,0x000002d5,0x0000003c,
+0x00000082,0x00000082,0x0006002c,0x0000003d,
+0x000002d6,0x000000de,0x00000082,0x00000082,
+0x0006002c,0x0000003d,0x000002d7,0x00000082,
+0x000000de,0x00000082,0x0006002c,0x0000003d,
+0x000002d8,0x000000de,0x00000082,0x000000de,
+0x0006002c,0x0000003d,0x000002d9,0x00000082,
+0x000000de,0x000000de,0x0006002c,0x0000003d,
+0x000002da,0x000000c9,0x000000e7,0x00000082,
+0x0006002c,0x0000003d,0x000002db,0x00000082,
+0x000000e7,0x00000082,0x0006002c,0x0000003d,
+0x000002dc,0x000000e7,0x000000e7,0x00000082,
+0x0006002c,0x0000003d,0x000002dd,0x0000003c,
+0x000000e7,0x00000082,0x0006002c,0x0000003d,
+0x000002de,0x000000de,0x000000e7,0x00000082,
+0x0006002c,0x0000003d,0x000002df,0x000000e7,
+0x000000de,0x00000082,0x0006002c,0x0000003d,
+0x000002e0,0x000000de,0x000000e7,0x000000de,
+0x0006002c,0x0000003d,0x000002e1,0x000000e7,
+0x000000de,0x000000de,0x0006002c,0x0000003d,
+0x000002e2,0x000000c9,0x0000003c,0x00000082,
+0x0006002c,0x0000003d,0x000002e3,0x00000082,
+0x0000003c,0x00000082,0x0006002c,0x0000003d,
+0x000002e4,0x000000e7,0x0000003c,0x00000082,
+0x0006002c,0x0000003d,0x000002e5,0x0000003c,
+0x0000003c,0x00000082,0x0006002c,0x0000003d,
+0x000002e6,0x000000de,0x0000003c,0x00000082,
+0x0006002c,0x0000003d,0x000002e7,0x0000003c,
+0x000000de,0x00000082,0x0006002c,0x0000003d,
+0x000002e8,0x000000de,0x0000003c,0x000000de,
+0x0006002c,0x0000003d,0x000002e9,0x0000003c,
+0x000000de,0x000000de,0x0006002c,0x0000003d,
+0x000002ea,0x000000c9,0x000000c9,0x000000e7,
+0x0006002c,0x0000003d,0x000002eb,0x00000082,
+0x000000c9,0x000000e7,0x0006002c,0x0000003d,
+0x000002ec,0x000000e7,0x000000c9,0x000000e7,
+0x0006002c,0x0000003d,0x000002ed,0x0000003c,
+0x000000c9,0x000000e7,0x0006002c,0x0000003d,
+0x000002ee,0x000000de,0x000000c9,0x000000e7,
+0x0006002c,0x0000003d,0x000002ef,0x000000c9,
+0x000000de,0x000000e7,0x0006002c,0x0000003d,
+0x000002f0,0x000000e7,0x000000c9,0x000000de,
+0x0006002c,0x0000003d,0x000002f1,0x0000003c,
+0x000000c9,0x000000de,0x0006002c,0x0000003d,
+0x000002f2,0x000000c9,0x00000082,0x000000e7,
+0x0006002c,0x0000003d,0x000002f3,0x00000082,
+0x00000082,0x000000e7,0x0006002c,0x0000003d,
+0x000002f4,0x000000e7,0x00000082,0x000000e7,
+0x0006002c,0x0000003d,0x000002f5,0x0000003c,
+0x00000082,0x000000e7,0x0006002c,0x0000003d,
+0x000002f6,0x000000de,0x00000082,0x000000e7,
+0x0006002c,0x0000003d,0x000002f7,0x00000082,
+0x000000de,0x000000e7,0x0006002c,0x0000003d,
+0x000002f8,0x000000e7,0x00000082,0x000000de,
+0x0006002c,0x0000003d,0x000002f9,0x0000003c,
+0x00000082,0x000000de,0x0006002c,0x0000003d,
+0x000002fa,0x000000c9,0x000000e7,0x000000e7,
+0x0006002c,0x0000003d,0x000002fb,0x00000082,
+0x000000e7,0x000000e7,0x0006002c,0x0000003d,
+0x000002fc,0x000000e7,0x000000e7,0x000000e7,
+0x0006002c,0x0000003d,0x000002fd,0x0000003c,
+0x000000e7,0x000000e7,0x0006002c,0x0000003d,
+0x000002fe,0x000000de,0x000000e7,0x000000e7,
+0x0006002c,0x0000003d,0x000002ff,0x000000e7,
+0x000000de,0x000000e7,0x0006002c,0x0000003d,
+0x00000300,0x000000e7,0x000000e7,0x000000de,
+0x0006002c,0x0000003d,0x00000301,0x0000003c,
+0x000000e7,0x000000de,0x0006002c,0x0000003d,
+0x00000302,0x000000c9,0x0000003c,0x000000e7,
+0x0006002c,0x0000003d,0x00000303,0x00000082,
+0x0000003c,0x000000e7,0x0006002c,0x0000003d,
+0x00000304,0x000000e7,0x0000003c,0x000000e7,
+0x0006002c,0x0000003d,0x00000305,0x0000003c,
+0x0000003c,0x000000e7,0x0006002c,0x0000003d,
+0x00000306,0x000000de,0x0000003c,0x000000e7,
+0x0006002c,0x0000003d,0x00000307,0x0000003c,
+0x000000de,0x000000e7,0x0006002c,0x0000003d,
+0x00000308,0x000000e7,0x0000003c,0x000000de,
+0x0006002c,0x0000003d,0x00000309,0x0000003c,
+0x0000003c,0x000000de,0x0006002c,0x0000003d,
+0x0000030a,0x000000c9,0x000000c9,0x0000003c,
+0x0006002c,0x0000003d,0x0000030b,0x00000082,
+0x000000c9,0x0000003c,0x0006002c,0x0000003d,
+0x0000030c,0x000000e7,0x000000c9,0x0000003c,
+0x0006002c,0x0000003d,0x0000030d,0x0000003c,
+0x000000c9,0x0000003c,0x0006002c,0x0000003d,
+0x0000030e,0x000000de,0x000000c9,0x0000003c,
+0x0006002c,0x0000003d,0x0000030f,0x000000c9,
+0x000000de,0x0000003c,0x0006002c,0x0000003d,
+0x00000310,0x000000c9,0x000000c9,0x000000de,
+0x0006002c,0x0000003d,0x00000311,0x00000082,
+0x000000c9,0x000000de,0x0006002c,0x0000003d,
+0x00000312,0x000000c9,0x00000082,0x0000003c,
+0x0006002c,0x0000003d,0x00000313,0x00000082,
+0x00000082,0x0000003c,0x0006002c,0x0000003d,
+0x00000314,0x000000e7,0x00000082,0x0000003c,
+0x0006002c,0x0000003d,0x00000315,0x0000003c,
+0x00000082,0x0000003c,0x0006002c,0x0000003d,
+0x00000316,0x000000de,0x00000082,0x0000003c,
+0x0006002c,0x0000003d,0x00000317,0x00000082,
+0x000000de,0x0000003c,0x0006002c,0x0000003d,
+0x00000318,0x000000c9,0x00000082,0x000000de,
+0x0006002c,0x0000003d,0x00000319,0x00000082,
+0x00000082,0x000000de,0x0006002c,0x0000003d,
+0x0000031a,0x000000c9,0x000000e7,0x0000003c,
+0x0006002c,0x0000003d,0x0000031b,0x00000082,
+0x000000e7,0x0000003c,0x0006002c,0x0000003d,
+0x0000031c,0x000000e7,0x000000e7,0x0000003c,
+0x0006002c,0x0000003d,0x0000031d,0x0000003c,
+0x000000e7,0x0000003c,0x0006002c,0x0000003d,
+0x0000031e,0x000000de,0x000000e7,0x0000003c,
+0x0006002c,0x0000003d,0x0000031f,0x000000e7,
+0x000000de,0x0000003c,0x0006002c,0x0000003d,
+0x00000320,0x000000c9,0x000000e7,0x000000de,
+0x0006002c,0x0000003d,0x00000321,0x00000082,
+0x000000e7,0x000000de,0x0006002c,0x0000003d,
+0x00000322,0x000000c9,0x0000003c,0x0000003c,
+0x0006002c,0x0000003d,0x00000323,0x00000082,
+0x0000003c,0x0000003c,0x0006002c,0x0000003d,
+0x00000324,0x000000e7,0x0000003c,0x0000003c,
+0x0006002c,0x0000003d,0x00000325,0x0000003c,
+0x0000003c,0x0000003c,0x0006002c,0x0000003d,
+0x00000326,0x000000de,0x0000003c,0x0000003c,
+0x0006002c,0x0000003d,0x00000327,0x0000003c,
+0x000000de,0x0000003c,0x0006002c,0x0000003d,
+0x00000328,0x000000c9,0x0000003c,0x000000de,
+0x0006002c,0x0000003d,0x00000329,0x00000082,
+0x0000003c,0x000000de,0x0083002c,0x000002ac,
+0x0000032a,0x000002ad,0x000002ae,0x000002af,
+0x000002b0,0x000002b1,0x000002b2,0x000002b3,
+0x000002b4,0x000002b5,0x000002b6,0x000002b7,
+0x000002b8,0x000002b9,0x000002ba,0x000002bb,
+0x000002b4,0x000002bc,0x000002bd,0x000002be,
+0x000002bf,0x000002c0,0x000002c1,0x000002c2,
+0x000002b4,0x000002c3,0x000002c4,0x000002c5,
+0x000002c6,0x000002c7,0x000002c8,0x000002c9,
+0x000002b4,0x000002ca,0x000002cb,0x000002cc,
+0x000002cd,0x000002ce,0x000002cf,0x000002d0,
+0x000002d1,0x000002d2,0x000002d3,0x000002d4,
+0x000002d5,0x000002d6,0x000002d7,0x000002d8,
+0x000002d9,0x000002da,0x000002db,0x000002dc,
+0x000002dd,0x000002de,0x000002df,0x000002e0,
+0x000002e1,0x000002e2,0x000002e3,0x000002e4,
+0x000002e5,0x000002e6,0x000002e7,0x000002e8,
+0x000002e9,0x000002ea,0x000002eb,0x000002ec,
+0x000002ed,0x000002ee,0x000002ef,0x000002f0,
+0x000002f1,0x000002f2,0x000002f3,0x000002f4,
+0x000002f5,0x000002f6,0x000002f7,0x000002f8,
+0x000002f9,0x000002fa,0x000002fb,0x000002fc,
+0x000002fd,0x000002fe,0x000002ff,0x00000300,
+0x00000301,0x00000302,0x00000303,0x00000304,
+0x00000305,0x00000306,0x00000307,0x00000308,
+0x00000309,0x0000030a,0x0000030b,0x0000030c,
+0x0000030d,0x0000030e,0x0000030f,0x00000310,
+0x00000311,0x00000312,0x00000313,0x00000314,
+0x00000315,0x00000316,0x00000317,0x00000318,
+0x00000319,0x0000031a,0x0000031b,0x0000031c,
+0x0000031d,0x0000031e,0x0000031f,0x00000320,
+0x00000321,0x00000322,0x00000323,0x00000324,
+0x00000325,0x00000326,0x00000327,0x00000328,
+0x00000329,0x00040020,0x0000032d,0x00000007,
+0x000002ac,0x0004002b,0x00000006,0x0000034a,
+0x00000080,0x0004002b,0x00000006,0x00000350,
+0x0000003f,0x0004002b,0x00000006,0x00000354,
+0x00000020,0x0004002b,0x00000006,0x00000359,
+0x00000040,0x00040020,0x0000036d,0x00000007,
+0x0000005a,0x0004002b,0x0000000d,0x00000397,
+0x00000006,0x0004002b,0x00000006,0x000003b5,
+0x000000ff,0x0004002b,0x00000006,0x000003c1,
+0x000000c0,0x0004002b,0x00000006,0x00000417,
+0x00000008,0x0007002c,0x00000049,0x00000514,
+0x00000109,0x00000109,0x00000109,0x00000109,
+0x0004002b,0x00000006,0x0000051b,0x0000000f,
+0x0004002b,0x00000006,0x00000520,0x00000011,
+0x0004002b,0x00000006,0x00000525,0x00000007,
+0x0004002b,0x00000006,0x0000052a,0x00000004,
+0x0004002b,0x00000006,0x00000533,0x00000010,
+0x0004002b,0x00000006,0x00000540,0x00000006,
+0x00040017,0x00000551,0x0000000d,0x00000002,
+0x0005001e,0x00000552,0x00000551,0x0000000d,
+0x0000000d,0x00040020,0x00000553,0x00000009,
+0x00000552,0x0004003b,0x00000553,0x00000554,
+0x00000009,0x00040020,0x00000555,0x00000009,
+0x0000000d,0x0004002b,0x0000000d,0x00000561,
+0x00000400,0x0004002b,0x0000000d,0x0000056b,
+0x0000000f,0x0004002b,0x00000006,0x00000577,
+0x0000000c,0x0004002b,0x00000006,0x00000580,
+0x00000014,0x0004002b,0x00000006,0x00000585,
+0x00000018,0x0004002b,0x00000006,0x0000058a,
+0x0000001c,0x0004002b,0x00000006,0x0000058f,
+0x00000012,0x0004002b,0x00000006,0x00000594,
+0x00000016,0x0004002b,0x00000006,0x00000599,
+0x0000001a,0x0004002b,0x00000006,0x0000059e,
+0x0000001e,0x0004002b,0x0000000d,0x000005e4,
+0x00000010,0x0004002b,0x00000006,0x0000061b,
+0x0000000e,0x0004002b,0x00000006,0x0000062b,
+0x0000000a,0x0004002b,0x0000000d,0x0000064c,
+0x0000003f,0x00040020,0x00000696,0x00000007,
+0x0000006d,0x0004002b,0x0000000d,0x000006a9,
+0x000000ff,0x0007002c,0x00000015,0x000006aa,
+0x000006a9,0x000000c9,0x000006a9,0x000006a9,
+0x0004002b,0x00000006,0x000006c7,0x00000009,
+0x0004002b,0x0000000d,0x000006de,0x0000000c,
+0x0004002b,0x0000000d,0x000006f2,0x0000000a,
+0x0004002b,0x0000000d,0x000006fa,0x00000dff,
+0x0004002b,0x0000000d,0x000006fc,0x00000dfc,
+0x0004002b,0x0000000d,0x0000076d,0x00000040,
+0x0004002b,0x0000000d,0x000007b9,0x00000018,
+0x0004002b,0x0000000d,0x000007bc,0x00000060,
+0x0004002b,0x0000000d,0x000007ea,0x00000078,
+0x0004001c,0x000007eb,0x0000000d,0x000007ea,
+0x00040020,0x000007ec,0x00000007,0x000007eb,
+0x0004002b,0x0000000d,0x000007ef,0x0000002d,
+0x0004001c,0x000007f0,0x0000000d,0x000007ef,
+0x0004002b,0x0000000d,0x000007f1,0x00000033,
+0x0004002b,0x0000000d,0x000007f2,0x00000019,
+0x0004002b,0x0000000d,0x000007f3,0x00000026,
+0x0004002b,0x0000000d,0x000007f4,0x00000011,
+0x0004002b,0x0000000d,0x000007f5,0x0000002e,
+0x0004002b,0x0000000d,0x000007f6,0x0000003a,
+0x0004002b,0x0000000d,0x000007f7,0x00000017,
+0x0004002b,0x0000000d,0x000007f8,0x0000000b,
+0x0004002b,0x0000000d,0x000007f9,0x00000034,
+0x0004002b,0x0000000d,0x000007fa,0x0000001c,
+0x0004002b,0x0000000d,0x000007fb,0x00000023,
+0x0004002b,0x0000000d,0x000007fc,0x00000037,
+0x0004002b,0x0000000d,0x000007fd,0x0000002f,
+0x0004002b,0x0000000d,0x000007fe,0x00000027,
+0x0004002b,0x0000000d,0x000007ff,0x0000003d,
+0x0004002b,0x0000000d,0x00000800,0x00000013,
+0x0004002b,0x0000000d,0x00000801,0x0000002c,
+0x0004002b,0x0000000d,0x00000802,0x0000001b,
+0x0004002b,0x0000000d,0x00000803,0x00000024,
+0x0004002b,0x0000000d,0x00000804,0x0000000d,
+0x0004002b,0x0000000d,0x00000805,0x00000032,
+0x0004002b,0x0000000d,0x00000806,0x00000016,
+0x0004002b,0x0000000d,0x00000807,0x00000029,
+0x0004002b,0x0000000d,0x00000808,0x0000001e,
+0x0004002b,0x0000000d,0x00000809,0x00000021,
+0x0030002c,0x000007f0,0x0000080a,0x000000c9,
+0x00000088,0x0000064c,0x000000c9,0x0000064c,
+0x000006de,0x000007f1,0x000007f2,0x000007f3,
+0x000000c9,0x0000064c,0x000007f4,0x000007f5,
+0x00000033,0x000007f6,0x000007f7,0x00000059,
+0x000007f8,0x000007f9,0x000007fa,0x000007fb,
+0x000000c9,0x0000064c,0x000000da,0x000007fc,
+0x000005e4,0x000007fd,0x000007b9,0x000007fe,
+0x000000e7,0x000007ff,0x000007f8,0x000007f9,
+0x00000800,0x00000801,0x00000802,0x00000803,
+0x00000033,0x000007f6,0x00000804,0x00000805,
+0x00000806,0x00000807,0x00000808,0x00000809,
+0x0004001c,0x0000080b,0x0000000d,0x000000de,
+0x0004002b,0x0000000d,0x0000080c,0x00000009,
+0x0004002b,0x0000000d,0x0000080d,0x00000015,
+0x0007002c,0x0000080b,0x0000080e,0x000000c9,
+0x0000003c,0x0000080c,0x0000080d,0x00040020,
+0x00000810,0x00000007,0x0000080b,0x00040020,
+0x00000818,0x00000007,0x000007f0,0x0004001c,
+0x0000084a,0x0000000d,0x000007fb,0x0004002b,
+0x0000000d,0x0000084b,0x00000038,0x0004002b,
+0x0000000d,0x0000084c,0x0000000e,0x0004002b,
+0x0000000d,0x0000084d,0x00000031,0x0004002b,
+0x0000000d,0x0000084e,0x0000002a,0x0004002b,
+0x0000000d,0x0000084f,0x0000003c,0x0004002b,
+0x0000000d,0x00000850,0x00000039,0x0004002b,
+0x0000000d,0x00000851,0x00000036,0x0004002b,
+0x0000000d,0x00000852,0x0000001a,0x0004002b,
+0x0000000d,0x00000853,0x00000025,0x0004002b,
+0x0000000d,0x00000854,0x0000001d,0x0004002b,
+0x0000000d,0x00000855,0x00000022,0x0026002c,
+0x0000084a,0x00000856,0x000000c9,0x000005e4,
+0x00000088,0x000007fd,0x0000064c,0x000000c9,
+0x0000064c,0x000000e3,0x0000084b,0x0000084c,
+0x0000084d,0x0000080d,0x0000084e,0x000007fa,
+0x000007fb,0x000000c9,0x0000064c,0x000005e4,
+0x000007fd,0x0000003c,0x0000084f,0x00000800,
+0x00000801,0x00000397,0x00000850,0x000007f7,
+0x00000059,0x0000080c,0x00000851,0x00000852,
+0x00000853,0x00000804,0x00000805,0x00000854,
+0x00000855,0x0006002c,0x0000003d,0x00000857,
+0x000000c9,0x00000033,0x0000056b,0x00040020,
+0x00000860,0x00000007,0x0000084a,0x0004001c,
+0x00000885,0x0000000d,0x00000397,0x0009002c,
+0x00000885,0x00000886,0x0000064c,0x0000080d,
+0x0000080c,0x000000de,0x000000e7,0x00000082,
+0x00040020,0x00000889,0x00000007,0x00000885,
+0x0009002c,0x00000885,0x0000088f,0x000000da,
+0x000000da,0x000000da,0x000000e7,0x000000de,
+0x000000da,0x0004002b,0x00000006,0x000008ac,
+0x0000000b,0x0004002b,0x00000006,0x000008cb,
+0x0000000d,0x0004002b,0x00000006,0x000008d6,
+0x00000017,0x0007002c,0x0000080b,0x000008e0,
+0x000000c9,0x000000e7,0x00000033,0x000000da,
+0x0004002b,0x00000006,0x000008f5,0x00000019,
+0x0004002b,0x00000006,0x0000090b,0x0000001b,
+0x0007002c,0x0000080b,0x0000091f,0x000000c9,
+0x000000e7,0x00000082,0x000000c9,0x0004002b,
+0x00000006,0x00000956,0x0000001d,0x0004001c,
+0x0000096e,0x0000003d,0x00000800,0x0006002c,
+0x0000003d,0x0000096f,0x000000c9,0x000000c9,
+0x000000da,0x0006002c,0x0000003d,0x00000970,
+0x00000082,0x000000c9,0x00000397,0x0006002c,
+0x0000003d,0x00000971,0x000000c9,0x00000082,
+0x00000033,0x0006002c,0x0000003d,0x00000972,
+0x000000c9,0x000000c9,0x000000e3,0x0006002c,
+0x0000003d,0x00000973,0x00000082,0x000000c9,
+0x00000033,0x0006002c,0x0000003d,0x00000974,
+0x000000c9,0x000000c9,0x00000397,0x0006002c,
+0x0000003d,0x00000975,0x000000c9,0x000000c9,
+0x00000033,0x0016002c,0x0000096e,0x00000976,
+0x0000096f,0x00000970,0x00000971,0x00000972,
+0x00000973,0x00000318,0x00000974,0x00000311,
+0x00000312,0x00000975,0x0000030b,0x000002f2,
+0x00000310,0x000002eb,0x000002d2,0x0000030a,
+0x000002cb,0x000002ea,0x000002ca,0x00040020,
+0x00000978,0x00000007,0x0000096e,0x0004002b,
+0x0000000d,0x000009d7,0x0000017d,0x0004001c,
+0x000009d8,0x0000000d,0x000009d7,0x0004002b,
+0x0000000d,0x000009d9,0x000000cc,0x0004002b,
+0x0000000d,0x000009da,0x00000066,0x0004002b,
+0x0000000d,0x000009db,0x00000099,0x0004002b,
+0x0000000d,0x000009dc,0x00000045,0x0004002b,
+0x0000000d,0x000009dd,0x000000ba,0x0004002b,
+0x0000000d,0x000009de,0x000000e8,0x0004002b,
+0x0000000d,0x000009df,0x0000005c,0x0004002b,
+0x0000000d,0x000009e0,0x000000a3,0x0004002b,
+0x0000000d,0x000009e1,0x000000d1,0x0004002b,
+0x0000000d,0x000009e2,0x00000074,0x0004002b,
+0x0000000d,0x000009e3,0x0000008b,0x0004002b,
+0x0000000d,0x000009e4,0x000000de,0x0004002b,
+0x0000000d,0x000009e5,0x00000042,0x0004002b,
+0x0000000d,0x000009e6,0x000000bd,0x0004002b,
+0x0000000d,0x000009e7,0x00000063,0x0004002b,
+0x0000000d,0x000009e8,0x0000009c,0x0004002b,
+0x0000000d,0x000009e9,0x000000f4,0x0004002b,
+0x0000000d,0x000009ea,0x000000d3,0x0004002b,
+0x0000000d,0x000009eb,0x0000004d,0x0004002b,
+0x0000000d,0x000009ec,0x000000b2,0x0004002b,
+0x0000000d,0x000009ed,0x0000006e,0x0004002b,
+0x0000000d,0x000009ee,0x00000091,0x0004002b,
+0x0000000d,0x000009ef,0x000000e9,0x0004002b,
+0x0000000d,0x000009f0,0x000000c8,0x0004002b,
+0x0000000d,0x000009f1,0x00000058,0x0004002b,
+0x0000000d,0x000009f2,0x000000a7,0x0004002b,
+0x0000000d,0x000009f3,0x00000079,0x0004002b,
+0x0000000d,0x000009f4,0x00000086,0x0004002b,
+0x0000000d,0x000009f5,0x000000ef,0x0004002b,
+0x0000000d,0x000009f6,0x000000df,0x0004002b,
+0x0000000d,0x000009f7,0x00000030,0x0004002b,
+0x0000000d,0x000009f8,0x000000cf,0x0004002b,
+0x0000000d,0x000009f9,0x00000041,0x0004002b,
+0x0000000d,0x000009fa,0x000000be,0x0004002b,
+0x0000000d,0x000009fb,0x00000051,0x0004002b,
+0x0000000d,0x000009fc,0x000000ae,0x0004002b,
+0x0000000d,0x000009fd,0x00000061,0x0004002b,
+0x0000000d,0x000009fe,0x0000009e,0x0004002b,
+0x0000000d,0x000009ff,0x00000071,0x0004002b,
+0x0000000d,0x00000a00,0x0000008e,0x0004002b,
+0x0000000d,0x00000a01,0x000000fa,0x0004002b,
+0x0000000d,0x00000a02,0x000000ea,0x0004002b,
+0x0000000d,0x00000a03,0x000000d9,0x0004002b,
+0x0000000d,0x00000a04,0x000000c9,0x0004002b,
+0x0000000d,0x00000a05,0x00000046,0x0004002b,
+0x0000000d,0x00000a06,0x000000b9,0x0004002b,
+0x0000000d,0x00000a07,0x00000056,0x0004002b,
+0x0000000d,0x00000a08,0x000000a9,0x0004002b,
+0x0000000d,0x00000a09,0x00000067,0x0004002b,
+0x0000000d,0x00000a0a,0x00000098,0x0004002b,
+0x0000000d,0x00000a0b,0x00000077,0x0004002b,
+0x0000000d,0x00000a0c,0x00000088,0x0004002b,
+0x0000000d,0x00000a0d,0x000000e4,0x0004002b,
+0x0000000d,0x00000a0e,0x0000002b,0x0004002b,
+0x0000000d,0x00000a0f,0x000000d4,0x0004002b,
+0x0000000d,0x00000a10,0x0000003b,0x0004002b,
+0x0000000d,0x00000a11,0x000000c4,0x0004002b,
+0x0000000d,0x00000a12,0x0000004c,0x0004002b,
+0x0000000d,0x00000a13,0x000000b3,0x0004002b,
+0x0000000d,0x00000a14,0x0000006c,0x0004002b,
+0x0000000d,0x00000a15,0x00000093,0x0004002b,
+0x0000000d,0x00000a16,0x0000007c,0x0004002b,
+0x0000000d,0x00000a17,0x00000083,0x0004002b,
+0x0000000d,0x00000a18,0x000000f7,0x0004002b,
+0x0000000d,0x00000a19,0x000000e7,0x0004002b,
+0x0000000d,0x00000a1a,0x000000d7,0x0004002b,
+0x0000000d,0x00000a1b,0x000000c7,0x0004002b,
+0x0000000d,0x00000a1c,0x000000bf,0x0004002b,
+0x0000000d,0x00000a1d,0x00000048,0x0004002b,
+0x0000000d,0x00000a1e,0x000000b7,0x0004002b,
+0x0000000d,0x00000a1f,0x00000050,0x0004002b,
+0x0000000d,0x00000a20,0x000000af,0x0004002b,
+0x0000000d,0x00000a21,0x0000009f,0x0004002b,
+0x0000000d,0x00000a22,0x00000068,0x0004002b,
+0x0000000d,0x00000a23,0x00000097,0x0004002b,
+0x0000000d,0x00000a24,0x00000070,0x0004002b,
+0x0000000d,0x00000a25,0x0000008f,0x0004002b,
+0x0000000d,0x00000a26,0x00000087,0x0004002b,
+0x0000000d,0x00000a27,0x000000fd,0x0004002b,
+0x0000000d,0x00000a28,0x000000f5,0x0004002b,
+0x0000000d,0x00000a29,0x00000012,0x0004002b,
+0x0000000d,0x00000a2a,0x000000ed,0x0004002b,
+0x0000000d,0x00000a2b,0x000000e5,0x0004002b,
+0x0000000d,0x00000a2c,0x000000dc,0x0004002b,
+0x0000000d,0x00000a2d,0x00000043,0x0004002b,
+0x0000000d,0x00000a2e,0x000000bc,0x0004002b,
+0x0000000d,0x00000a2f,0x0000004b,0x0004002b,
+0x0000000d,0x00000a30,0x000000b4,0x0004002b,
+0x0000000d,0x00000a31,0x00000053,0x0004002b,
+0x0000000d,0x00000a32,0x000000ac,0x0004002b,
+0x0000000d,0x00000a33,0x0000005b,0x0004002b,
+0x0000000d,0x00000a34,0x000000a4,0x0004002b,
+0x0000000d,0x00000a35,0x0000006b,0x0004002b,
+0x0000000d,0x00000a36,0x00000094,0x0004002b,
+0x0000000d,0x00000a37,0x00000073,0x0004002b,
+0x0000000d,0x00000a38,0x0000008c,0x0004002b,
+0x0000000d,0x00000a39,0x0000007b,0x0004002b,
+0x0000000d,0x00000a3a,0x00000084,0x0004002b,
+0x0000000d,0x00000a3b,0x000000f2,0x0004002b,
+0x0000000d,0x00000a3c,0x000000e2,0x0004002b,
+0x0000000d,0x00000a3d,0x000000da,0x0004002b,
+0x0000000d,0x00000a3e,0x000000d2,0x0004002b,
+0x0000000d,0x00000a3f,0x00000035,0x0004002b,
+0x0000000d,0x00000a40,0x000000ca,0x0004002b,
+0x0000000d,0x00000a41,0x000000c2,0x0004002b,
+0x0000000d,0x00000a42,0x0000004e,0x0004002b,
+0x0000000d,0x00000a43,0x000000b1,0x0004002b,
+0x0000000d,0x00000a44,0x0000005e,0x0004002b,
+0x0000000d,0x00000a45,0x000000a1,0x0004002b,
+0x0000000d,0x00000a46,0x00000076,0x0004002b,
+0x0000000d,0x00000a47,0x00000089,0x0004002b,
+0x0000000d,0x00000a48,0x0000007e,0x0004002b,
+0x0000000d,0x00000a49,0x00000081,0x0004002b,
+0x0000000d,0x00000a4a,0x000000fb,0x0004002b,
+0x0000000d,0x00000a4b,0x000000f3,0x0004002b,
+0x0000000d,0x00000a4c,0x00000014,0x0004002b,
+0x0000000d,0x00000a4d,0x000000eb,0x0004002b,
+0x0000000d,0x00000a4e,0x000000e3,0x0004002b,
+0x0000000d,0x00000a4f,0x000000db,0x0004002b,
+0x0000000d,0x00000a50,0x000000cb,0x0004002b,
+0x0000000d,0x00000a51,0x000000c3,0x0004002b,
+0x0000000d,0x00000a52,0x00000044,0x0004002b,
+0x0000000d,0x00000a53,0x000000bb,0x0004002b,
+0x0000000d,0x00000a54,0x00000054,0x0004002b,
+0x0000000d,0x00000a55,0x000000ab,0x0004002b,
+0x0000000d,0x00000a56,0x00000064,0x0004002b,
+0x0000000d,0x00000a57,0x0000009b,0x0004002b,
+0x0000000d,0x00000a58,0x000000fe,0x0004002b,
+0x0000000d,0x00000a59,0x000000f6,0x0004002b,
+0x0000000d,0x00000a5a,0x000000ee,0x0004002b,
+0x0000000d,0x00000a5b,0x000000e6,0x0004002b,
+0x0000000d,0x00000a5c,0x000000d6,0x0004002b,
+0x0000000d,0x00000a5d,0x000000ce,0x0004002b,
+0x0000000d,0x00000a5e,0x000000c6,0x0004002b,
+0x0000000d,0x00000a5f,0x00000049,0x0004002b,
+0x0000000d,0x00000a60,0x000000b6,0x0004002b,
+0x0000000d,0x00000a61,0x00000055,0x0004002b,
+0x0000000d,0x00000a62,0x000000aa,0x0004002b,
+0x0000000d,0x00000a63,0x00000059,0x0004002b,
+0x0000000d,0x00000a64,0x000000a6,0x0004002b,
+0x0000000d,0x00000a65,0x0000005d,0x0004002b,
+0x0000000d,0x00000a66,0x000000a2,0x0004002b,
+0x0000000d,0x00000a67,0x00000065,0x0004002b,
+0x0000000d,0x00000a68,0x0000009a,0x0004002b,
+0x0000000d,0x00000a69,0x00000069,0x0004002b,
+0x0000000d,0x00000a6a,0x00000096,0x0004002b,
+0x0000000d,0x00000a6b,0x0000006d,0x0004002b,
+0x0000000d,0x00000a6c,0x00000092,0x0004002b,
+0x0000000d,0x00000a6d,0x00000075,0x0004002b,
+0x0000000d,0x00000a6e,0x0000008a,0x0004002b,
+0x0000000d,0x00000a6f,0x0000007d,0x0004002b,
+0x0000000d,0x00000a70,0x00000082,0x0004002b,
+0x0000000d,0x00000a71,0x000000f9,0x0004002b,
+0x0000000d,0x00000a72,0x000000f1,0x0004002b,
+0x0000000d,0x00000a73,0x000000e1,0x0004002b,
+0x0000000d,0x00000a74,0x000000dd,0x0004002b,
+0x0000000d,0x00000a75,0x000000d5,0x0004002b,
+0x0000000d,0x00000a76,0x000000cd,0x0004002b,
+0x0000000d,0x00000a77,0x000000c5,0x0004002b,
+0x0000000d,0x00000a78,0x0000003e,0x0004002b,
+0x0000000d,0x00000a79,0x000000c1,0x0004002b,
+0x0000000d,0x00000a7a,0x0000004a,0x0004002b,
+0x0000000d,0x00000a7b,0x000000b5,0x0004002b,
+0x0000000d,0x00000a7c,0x00000052,0x0004002b,
+0x0000000d,0x00000a7d,0x000000ad,0x0004002b,
+0x0000000d,0x00000a7e,0x0000005a,0x0004002b,
+0x0000000d,0x00000a7f,0x000000a5,0x0004002b,
+0x0000000d,0x00000a80,0x00000062,0x0004002b,
+0x0000000d,0x00000a81,0x0000009d,0x0004002b,
+0x0000000d,0x00000a82,0x0000006a,0x0004002b,
+0x0000000d,0x00000a83,0x00000095,0x0004002b,
+0x0000000d,0x00000a84,0x00000072,0x0004002b,
+0x0000000d,0x00000a85,0x0000008d,0x0004002b,
+0x0000000d,0x00000a86,0x0000007a,0x0004002b,
+0x0000000d,0x00000a87,0x00000085,0x0180002c,
+0x000009d8,0x00000a88,0x000000c9,0x000000c9,
+0x000000c9,0x000000c9,0x000006a9,0x000007f1,
+0x000009d9,0x000009da,0x000009db,0x000000c9,
+0x000006a9,0x000009dc,0x000009dd,0x000007f7,
+0x000009de,0x000009df,0x000009e0,0x000007f5,
+0x000009e1,0x000009e2,0x000009e3,0x000000c9,
+0x000006a9,0x00000809,0x000009e4,0x000009e5,
+0x000009e6,0x000009e7,0x000009e8,0x000007f8,
+0x000009e9,0x00000801,0x000009ea,0x000009eb,
+0x000009ec,0x000009ed,0x000009ee,0x00000806,
+0x000009ef,0x000007fc,0x000009f0,0x000009f1,
+0x000009f2,0x000009f3,0x000009f4,0x000000c9,
+0x000006a9,0x000005e4,0x000009f5,0x00000088,
+0x000009f6,0x000009f7,0x000009f8,0x000009f9,
+0x000009fa,0x000009fb,0x000009fc,0x000009fd,
+0x000009fe,0x000009ff,0x00000a00,0x00000033,
+0x00000a01,0x0000080d,0x00000a02,0x000007f3,
+0x00000a03,0x00000851,0x00000a04,0x00000a05,
+0x00000a06,0x00000a07,0x00000a08,0x00000a09,
+0x00000a0a,0x00000a0b,0x00000a0c,0x000007f8,
+0x000009e9,0x00000802,0x00000a0d,0x00000a0e,
+0x00000a0f,0x00000a10,0x00000a11,0x00000a12,
+0x00000a13,0x000009df,0x000009e0,0x00000a14,
+0x00000a15,0x00000a16,0x00000a17,0x000000c9,
+0x000006a9,0x000000da,0x00000a18,0x000005e4,
+0x000009f5,0x000007b9,0x00000a19,0x00000088,
+0x000009f6,0x00000059,0x00000a1a,0x000009f7,
+0x000009f8,0x0000084b,0x00000a1b,0x0000076d,
+0x00000a1c,0x00000a1d,0x00000a1e,0x00000a1f,
+0x00000a20,0x000009f1,0x000009f2,0x000007bc,
+0x00000a21,0x00000a22,0x00000a23,0x00000a24,
+0x00000a25,0x000007ea,0x00000a26,0x000000e7,
+0x00000a27,0x000006f2,0x00000a28,0x00000a29,
+0x00000a2a,0x00000852,0x00000a2b,0x000007fb,
+0x00000a2c,0x00000a0e,0x00000a0f,0x000007f1,
+0x000009d9,0x00000a10,0x00000a11,0x00000a2d,
+0x00000a2e,0x00000a2f,0x00000a30,0x00000a31,
+0x00000a32,0x00000a33,0x00000a34,0x000009e7,
+0x000009e8,0x00000a35,0x00000a36,0x00000a37,
+0x00000a38,0x00000a39,0x00000a3a,0x00000033,
+0x00000a01,0x00000804,0x00000a3b,0x0000080d,
+0x00000a02,0x00000854,0x00000a3c,0x00000853,
+0x00000a3d,0x000007ef,0x00000a3e,0x00000a3f,
+0x00000a40,0x000007ff,0x00000a41,0x00000a05,
+0x00000a06,0x00000a42,0x00000a43,0x00000a07,
+0x00000a08,0x00000a44,0x00000a45,0x000009da,
+0x000009db,0x000009ed,0x000009ee,0x00000a46,
+0x00000a47,0x00000a48,0x00000a49,0x000000c9,
+0x000006a9,0x000000de,0x00000a4a,0x000000da,
+0x00000a18,0x000006de,0x00000a4b,0x000005e4,
+0x000009f5,0x00000a4c,0x00000a4d,0x000007b9,
+0x00000a19,0x000007fa,0x00000a4e,0x00000088,
+0x000009f6,0x00000803,0x00000a4f,0x00000059,
+0x00000a1a,0x00000801,0x000009ea,0x000009f7,
+0x000009f8,0x000007f9,0x00000a50,0x0000084b,
+0x00000a1b,0x0000084f,0x00000a51,0x0000076d,
+0x00000a1c,0x00000a52,0x00000a53,0x00000a1d,
+0x00000a1e,0x00000a12,0x00000a13,0x00000a1f,
+0x00000a20,0x00000a54,0x00000a55,0x000009f1,
+0x000009f2,0x000009df,0x000009e0,0x000007bc,
+0x00000a21,0x00000a56,0x00000a57,0x00000a22,
+0x00000a23,0x00000a14,0x00000a15,0x00000a24,
+0x00000a25,0x000009e2,0x000009e3,0x000007ea,
+0x00000a26,0x00000a16,0x00000a17,0x00000082,
+0x00000a58,0x00000033,0x00000a01,0x0000080c,
+0x00000a59,0x00000804,0x00000a3b,0x000007f4,
+0x00000a5a,0x0000080d,0x00000a02,0x000007f2,
+0x00000a5b,0x00000854,0x00000a3c,0x00000809,
+0x000009e4,0x00000853,0x00000a3d,0x00000807,
+0x00000a5c,0x000007ef,0x00000a3e,0x0000084d,
+0x00000a5d,0x00000a3f,0x00000a40,0x00000850,
+0x00000a5e,0x000007ff,0x00000a41,0x000009f9,
+0x000009fa,0x000009dc,0x000009dd,0x00000a5f,
+0x00000a60,0x000009eb,0x000009ec,0x000009fb,
+0x000009fc,0x00000a61,0x00000a62,0x00000a63,
+0x00000a64,0x00000a65,0x00000a66,0x000009fd,
+0x000009fe,0x00000a67,0x00000a68,0x00000a69,
+0x00000a6a,0x00000a6b,0x00000a6c,0x000009ff,
+0x00000a00,0x00000a6d,0x00000a6e,0x000009f3,
+0x000009f4,0x00000a6f,0x00000a70,0x000000e7,
+0x00000a27,0x00000397,0x00000a71,0x000006f2,
+0x00000a28,0x0000084c,0x00000a72,0x00000a29,
+0x00000a2a,0x00000806,0x000009ef,0x00000852,
+0x00000a2b,0x00000808,0x00000a73,0x00000855,
+0x00000a74,0x000007f3,0x00000a03,0x0000084e,
+0x00000a75,0x000007f5,0x000009e1,0x00000805,
+0x00000a76,0x00000851,0x00000a04,0x000007f6,
+0x00000a77,0x00000a78,0x00000a79,0x000009e5,
+0x000009e6,0x00000a05,0x00000a06,0x00000a7a,
+0x00000a7b,0x00000a42,0x00000a43,0x00000a7c,
+0x00000a7d,0x00000a07,0x00000a08,0x00000a7e,
+0x00000a7f,0x00000a44,0x00000a45,0x00000a80,
+0x00000a81,0x000009da,0x000009db,0x00000a82,
+0x00000a83,0x000009ed,0x000009ee,0x00000a84,
+0x00000a85,0x00000a46,0x00000a47,0x00000a86,
+0x00000a87,0x00000a48,0x00000a49,0x0004001c,
+0x00000a89,0x0000000d,0x000000e3,0x000a002c,
+0x00000a89,0x00000a8a,0x000000c9,0x0000003c,
+0x0000080c,0x0000080d,0x000007ef,0x00000a65,
+0x000009e6,0x00040020,0x00000a8c,0x00000007,
+0x00000a89,0x00040020,0x00000a94,0x00000007,
+0x000009d8,0x0004002b,0x0000000d,0x00000aba,
+0x0000013b,0x0004001c,0x00000abb,0x0000000d,
+0x00000aba,0x0004002b,0x0000000d,0x00000abc,
+0x000000d8,0x0004002b,0x0000000d,0x00000abd,
+0x00000047,0x0004002b,0x0000000d,0x00000abe,
+0x000000b8,0x0004002b,0x0000000d,0x00000abf,
+0x000000ec,0x0004002b,0x0000000d,0x00000ac0,
+0x000000fc,0x0004002b,0x0000000d,0x00000ac1,
+0x00000057,0x0004002b,0x0000000d,0x00000ac2,
+0x000000a8,0x013e002c,0x00000abb,0x00000ac3,
+0x000000c9,0x000000c9,0x000000c9,0x000000c9,
+0x000000c9,0x000000c9,0x000006a9,0x000007fa,
+0x00000a4e,0x0000084b,0x00000a1b,0x00000a54,
+0x00000a55,0x000009ff,0x00000a00,0x000000c9,
+0x000006a9,0x00000a2d,0x00000a2e,0x00000804,
+0x00000a3b,0x00000a1f,0x00000a20,0x00000802,
+0x00000a0d,0x00000a44,0x00000a45,0x00000059,
+0x00000a1a,0x00000a35,0x00000a36,0x00000851,
+0x00000a04,0x000009f3,0x000009f4,0x000000c9,
+0x000006a9,0x00000088,0x000009f6,0x000009f9,
+0x000009fa,0x000009fd,0x000009fe,0x00000397,
+0x00000a71,0x000007fe,0x00000abc,0x00000abd,
+0x00000abe,0x00000a22,0x00000a23,0x00000804,
+0x00000a3b,0x000007ef,0x00000a3e,0x00000a42,
+0x00000a43,0x000009ed,0x000009ee,0x00000800,
+0x00000abf,0x000007f9,0x00000a50,0x00000a54,
+0x00000a55,0x00000a6d,0x00000a6e,0x00000852,
+0x00000a2b,0x000007f6,0x00000a77,0x00000a33,
+0x00000a34,0x00000a39,0x00000a3a,0x000000c9,
+0x000006a9,0x000005e4,0x000009f5,0x00000088,
+0x000009f6,0x000009f7,0x000009f8,0x0000076d,
+0x00000a1c,0x00000a1f,0x00000a20,0x000007bc,
+0x00000a21,0x00000a24,0x00000a25,0x0000003c,
+0x00000ac0,0x00000800,0x00000abf,0x000007fb,
+0x00000a2c,0x000007f1,0x000009d9,0x00000a2d,
+0x00000a2e,0x00000a31,0x00000a32,0x00000a56,
+0x00000a57,0x000009e2,0x000009e3,0x00000397,
+0x00000a71,0x00000806,0x000009ef,0x000007f3,
+0x00000a03,0x00000851,0x00000a04,0x00000abd,
+0x00000abe,0x00000ac1,0x00000ac2,0x00000a09,
+0x00000a0a,0x00000a0b,0x00000a0c,0x0000080c,
+0x00000a59,0x000007f2,0x00000a5b,0x0000084e,
+0x00000a75,0x000007f6,0x00000a77,0x00000a7a,
+0x00000a7b,0x00000a7e,0x00000a7f,0x00000a82,
+0x00000a83,0x00000a86,0x00000a87,0x00000804,
+0x00000a3b,0x00000854,0x00000a3c,0x000007ef,
+0x00000a3e,0x000007ff,0x00000a41,0x000009eb,
+0x000009ec,0x00000a65,0x00000a66,0x00000a6b,
+0x00000a6c,0x00000a6f,0x00000a70,0x000000c9,
+0x000006a9,0x000000da,0x00000a18,0x000005e4,
+0x000009f5,0x000007b9,0x00000a19,0x00000088,
+0x000009f6,0x00000059,0x00000a1a,0x000009f7,
+0x000009f8,0x0000084b,0x00000a1b,0x0000076d,
+0x00000a1c,0x00000a1d,0x00000a1e,0x00000a1f,
+0x00000a20,0x000009f1,0x000009f2,0x000007bc,
+0x00000a21,0x00000a22,0x00000a23,0x00000a24,
+0x00000a25,0x000007ea,0x00000a26,0x00000082,
+0x00000a58,0x0000080c,0x00000a59,0x000007f4,
+0x00000a5a,0x000007f2,0x00000a5b,0x00000809,
+0x000009e4,0x00000807,0x00000a5c,0x0000084d,
+0x00000a5d,0x00000850,0x00000a5e,0x000009f9,
+0x000009fa,0x00000a5f,0x00000a60,0x000009fb,
+0x000009fc,0x00000a63,0x00000a64,0x000009fd,
+0x000009fe,0x00000a69,0x00000a6a,0x000009ff,
+0x00000a00,0x000009f3,0x000009f4,0x0000003c,
+0x00000ac0,0x000007f8,0x000009e9,0x00000800,
+0x00000abf,0x00000802,0x00000a0d,0x000007fb,
+0x00000a2c,0x00000a0e,0x00000a0f,0x000007f1,
+0x000009d9,0x00000a10,0x00000a11,0x00000a2d,
+0x00000a2e,0x00000a2f,0x00000a30,0x00000a31,
+0x00000a32,0x00000a33,0x00000a34,0x000009e7,
+0x000009e8,0x00000a35,0x00000a36,0x00000a37,
+0x00000a38,0x00000a39,0x00000a3a,0x000000de,
+0x00000a4a,0x000006de,0x00000a4b,0x00000a4c,
+0x00000a4d,0x000007fa,0x00000a4e,0x00000803,
+0x00000a4f,0x00000801,0x000009ea,0x000007f9,
+0x00000a50,0x0000084f,0x00000a51,0x00000a52,
+0x00000a53,0x00000a12,0x00000a13,0x00000a54,
+0x00000a55,0x000009df,0x000009e0,0x00000a56,
+0x00000a57,0x00000a14,0x00000a15,0x000009e2,
+0x000009e3,0x00000a16,0x00000a17,0x00000397,
+0x00000a71,0x0000084c,0x00000a72,0x00000806,
+0x000009ef,0x00000808,0x00000a73,0x000007f3,
+0x00000a03,0x000007f5,0x000009e1,0x00000851,
+0x00000a04,0x00000a78,0x00000a79,0x00000a05,
+0x00000a06,0x00000a42,0x00000a43,0x00000a07,
+0x00000a08,0x00000a44,0x00000a45,0x000009da,
+0x000009db,0x000009ed,0x000009ee,0x00000a46,
+0x00000a47,0x00000a48,0x00000a49,0x0009002c,
+0x00000885,0x00000ac4,0x000000c9,0x00000033,
+0x0000056b,0x000007fb,0x00000a2f,0x00000a57,
+0x00040020,0x00000acd,0x00000007,0x00000abb,
+0x0004001c,0x00000ae6,0x0000000d,0x000000da,
+0x000b002c,0x00000ae6,0x00000ae7,0x000006a9,
+0x00000a61,0x00000803,0x000007f4,0x000000da,
+0x000000de,0x000000e7,0x00000082,0x00040020,
+0x00000aea,0x00000007,0x00000ae6,0x000b002c,
+0x00000ae6,0x00000af0,0x000000da,0x000000da,
+0x00000082,0x000000da,0x000000e7,0x000000de,
+0x00000397,0x000000da,0x0004001c,0x00000b0c,
+0x00000015,0x000000e7,0x0004001c,0x00000b0d,
+0x00000b0c,0x000000de,0x00040020,0x00000b0e,
+0x00000007,0x00000b0d,0x00040020,0x00000b27,
+0x00000007,0x00000551,0x00040020,0x00000b29,
+0x00000009,0x00000551,0x0004002b,0x0000000d,
+0x00000b4f,0x000003ff,0x0004001c,0x00000b59,
+0x00000099,0x000005e4,0x0003002a,0x00000099,
+0x00000b5a,0x00030029,0x00000099,0x00000b5b,
+0x0013002c,0x00000b59,0x00000b5c,0x00000b5a,
+0x00000b5a,0x00000b5b,0x00000b5b,0x00000b5a,
+0x00000b5a,0x00000b5a,0x00000b5b,0x00000b5a,
+0x00000b5a,0x00000b5a,0x00000b5b,0x00000b5a,
+0x00000b5a,0x00000b5b,0x00000b5b,0x00040020,
+0x00000b60,0x00000007,0x00000b59,0x00040020,
+0x00000b62,0x00000007,0x00000099,0x00040017,
+0x00000b82,0x00000006,0x00000002,0x00040017,
+0x00000c51,0x0000000d,0x00000003,0x00040020,
+0x00000c52,0x00000001,0x00000c51,0x0004003b,
+0x00000c52,0x00000c53,0x00000001,0x00090019,
+0x00000c5e,0x0000000d,0x00000001,0x00000000,
+0x00000001,0x00000000,0x00000002,0x0000001e,
+0x00040020,0x00000c5f,0x00000000,0x00000c5e,
+0x0004003b,0x00000c5f,0x00000c60,0x00000000,
+0x00090019,0x00000c8a,0x0000000d,0x00000001,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x00000020,0x00040020,0x00000c8b,0x00000000,
+0x00000c8a,0x0004003b,0x00000c8b,0x00000c8c,
+0x00000000,0x0006002c,0x00000c51,0x00000caf,
+0x000000da,0x000000da,0x00000082,0x0004002b,
+0x00000006,0x00000cb0,0x00000013,0x00050036,
+0x00000002,0x00000004,0x00000000,0x00000003,
+0x000200f8,0x00000005,0x0004003b,0x00000008,
+0x00000c50,0x00000007,0x0004003b,0x00000016,
+0x00000c5d,0x00000007,0x0004003b,0x00000008,
+0x00000c62,0x00000007,0x0004003b,0x00000696,
+0x00000c74,0x00000007,0x0004003b,0x0000000e,
+0x00000c77,0x00000007,0x0004003b,0x0000000e,
+0x00000c80,0x00000007,0x0004003b,0x00000008,
+0x00000ca1,0x00000007,0x0004003d,0x00000c51,
+0x00000c54,0x00000c53,0x0004007c,0x00000007,
+0x00000c55,0x00000c54,0x0003003e,0x00000c50,
+0x00000c55,0x00050041,0x00000555,0x00000c56,
+0x00000554,0x0000008e,0x0004003d,0x0000000d,
+0x00000c57,0x00000c56,0x0004007c,0x00000006,
+0x00000c58,0x00000c57,0x00050041,0x0000000f,
+0x00000c59,0x00000c50,0x000000e7,0x0004003d,
+0x00000006,0x00000c5a,0x00000c59,0x00050080,
+0x00000006,0x00000c5b,0x00000c5a,0x00000c58,
+0x00050041,0x0000000f,0x00000c5c,0x00000c50,
+0x000000e7,0x0003003e,0x00000c5c,0x00000c5b,
+0x0004003d,0x00000c5e,0x00000c61,0x00000c60,
+0x0004003d,0x00000007,0x00000c63,0x00000c50,
+0x0003003e,0x00000c62,0x00000c63,0x00050039,
+0x00000007,0x00000c64,0x0000000b,0x00000c62,
+0x00050062,0x00000015,0x00000c65,0x00000c61,
+0x00000c64,0x00050051,0x0000000d,0x00000c66,
+0x00000c65,0x00000000,0x00050051,0x0000000d,
+0x00000c67,0x00000c65,0x00000001,0x00050051,
+0x0000000d,0x00000c68,0x00000c65,0x00000002,
+0x00050051,0x0000000d,0x00000c69,0x00000c65,
+0x00000003,0x00070050,0x00000015,0x00000c6a,
+0x00000c66,0x00000c67,0x00000c68,0x00000c69,
+0x0003003e,0x00000c5d,0x00000c6a,0x00050041,
+0x0000000e,0x00000c6b,0x00000c5d,0x0000003c,
+0x0004003d,0x0000000d,0x00000c6c,0x00000c6b,
+0x00050041,0x0000000e,0x00000c6d,0x00000c5d,
+0x000000e7,0x0004003d,0x0000000d,0x00000c6e,
+0x00000c6d,0x00050041,0x0000000e,0x00000c6f,
+0x00000c5d,0x00000082,0x0004003d,0x0000000d,
+0x00000c70,0x00000c6f,0x00050041,0x0000000e,
+0x00000c71,0x00000c5d,0x000000c9,0x0004003d,
+0x0000000d,0x00000c72,0x00000c71,0x00070050,
+0x00000015,0x00000c73,0x00000c6c,0x00000c6e,
+0x00000c70,0x00000c72,0x0003003e,0x00000c5d,
+0x00000c73,0x0004003d,0x00000015,0x00000c75,
+0x00000c5d,0x00050039,0x0000006d,0x00000c76,
+0x00000077,0x00000c75,0x0003003e,0x00000c74,
+0x00000c76,0x0003003e,0x00000c77,0x000000c9,
+0x000200f9,0x00000c78,0x000200f8,0x00000c78,
+0x000400f6,0x00000c7a,0x00000c7b,0x00000000,
+0x000200f9,0x00000c7c,0x000200f8,0x00000c7c,
+0x0004003d,0x0000000d,0x00000c7d,0x00000c77,
+0x00040039,0x0000000d,0x00000c7e,0x0000007a,
+0x000500b0,0x00000099,0x00000c7f,0x00000c7d,
+0x00000c7e,0x000400fa,0x00000c7f,0x00000c79,
+0x00000c7a,0x000200f8,0x00000c79,0x0003003e,
+0x00000c80,0x000000c9,0x000200f9,0x00000c81,
+0x000200f8,0x00000c81,0x000400f6,0x00000c83,
+0x00000c84,0x00000000,0x000200f9,0x00000c85,
+0x000200f8,0x00000c85,0x0004003d,0x0000000d,
+0x00000c86,0x00000c80,0x00060041,0x00000555,
+0x00000c87,0x00000554,0x00000109,0x000000c9,
+0x0004003d,0x0000000d,0x00000c88,0x00000c87,
+0x000500b0,0x00000099,0x00000c89,0x00000c86,
+0x00000c88,0x000400fa,0x00000c89,0x00000c82,
+0x00000c83,0x000200f8,0x00000c82,0x0004003d,
+0x00000c8a,0x00000c8d,0x00000c8c,0x0004003d,
+0x00000007,0x00000c8e,0x00000c50,0x0007004f,
+0x00000b82,0x00000c8f,0x00000c8e,0x00000c8e,
+0x00000000,0x00000001,0x0004007c,0x00000551,
+0x00000c90,0x00000c8f,0x00050041,0x00000b29,
+0x00000c91,0x00000554,0x00000109,0x0004003d,
+0x00000551,0x00000c92,0x00000c91,0x00050084,
+0x00000551,0x00000c93,0x00000c90,0x00000c92,
+0x0004003d,0x0000000d,0x00000c94,0x00000c80,
+0x0004007c,0x00000006,0x00000c95,0x00000c94,
+0x0004003d,0x0000000d,0x00000c96,0x00000c77,
+0x0004007c,0x00000006,0x00000c97,0x00000c96,
+0x00050050,0x00000b82,0x00000c98,0x00000c95,
+0x00000c97,0x0004007c,0x00000551,0x00000c99,
+0x00000c98,0x00050080,0x00000551,0x00000c9a,
+0x00000c93,0x00000c99,0x0004007c,0x00000b82,
+0x00000c9b,0x00000c9a,0x00050041,0x0000000f,
+0x00000c9c,0x00000c50,0x000000e7,0x0004003d,
+0x00000006,0x00000c9d,0x00000c9c,0x00050051,
+0x00000006,0x00000c9e,0x00000c9b,0x00000000,
+0x00050051,0x00000006,0x00000c9f,0x00000c9b,
+0x00000001,0x00060050,0x00000007,0x00000ca0,
+0x00000c9e,0x00000c9f,0x00000c9d,0x0003003e,
+0x00000ca1,0x00000ca0,0x00050039,0x00000007,
+0x00000ca2,0x0000000b,0x00000ca1,0x0004003d,
+0x0000000d,0x00000ca3,0x00000c77,0x00060041,
+0x00000555,0x00000ca4,0x00000554,0x00000109,
+0x000000c9,0x0004003d,0x0000000d,0x00000ca5,
+0x00000ca4,0x00050084,0x0000000d,0x00000ca6,
+0x00000ca3,0x00000ca5,0x0004003d,0x0000000d,
+0x00000ca7,0x00000c80,0x00050080,0x0000000d,
+0x00000ca8,0x00000ca6,0x00000ca7,0x00050041,
+0x00000016,0x00000ca9,0x00000c74,0x00000ca8,
+0x0004003d,0x00000015,0x00000caa,0x00000ca9,
+0x00040063,0x00000c8d,0x00000ca2,0x00000caa,
+0x000200f9,0x00000c84,0x000200f8,0x00000c84,
+0x0004003d,0x0000000d,0x00000cab,0x00000c80,
+0x00050080,0x0000000d,0x00000cac,0x00000cab,
+0x0000008e,0x0003003e,0x00000c80,0x00000cac,
+0x000200f9,0x00000c81,0x000200f8,0x00000c83,
+0x000200f9,0x00000c7b,0x000200f8,0x00000c7b,
+0x0004003d,0x0000000d,0x00000cad,0x00000c77,
+0x00050080,0x0000000d,0x00000cae,0x00000cad,
+0x0000008e,0x0003003e,0x00000c77,0x00000cae,
+0x000200f9,0x00000c78,0x000200f8,0x00000c7a,
+0x000100fd,0x00010038,0x00050036,0x00000007,
+0x0000000b,0x00000000,0x00000009,0x00030037,
+0x00000008,0x0000000a,0x000200f8,0x0000000c,
+0x0004003d,0x00000007,0x0000007c,0x0000000a,
+0x000200fe,0x0000007c,0x00010038,0x00050036,
+0x0000000d,0x00000013,0x00000000,0x00000010,
+0x00030037,0x0000000e,0x00000011,0x00030037,
+0x0000000f,0x00000012,0x000200f8,0x00000014,
+0x0004003d,0x0000000d,0x0000007f,0x00000011,
+0x0004003d,0x00000006,0x00000080,0x00000012,
+0x000500c2,0x0000000d,0x00000081,0x0000007f,
+0x00000080,0x000500c7,0x0000000d,0x00000083,
+0x00000081,0x00000082,0x000200fe,0x00000083,
+0x00010038,0x00050036,0x0000000d,0x0000001b,
+0x00000000,0x00000017,0x00030037,0x00000016,
+0x00000018,0x00030037,0x0000000e,0x00000019,
+0x00030037,0x0000000e,0x0000001a,0x000200f8,
+0x0000001c,0x0004003b,0x0000000e,0x00000086,
+0x00000007,0x0004003b,0x0000000e,0x0000008a,
+0x00000007,0x0004003b,0x0000000e,0x0000008d,
+0x00000007,0x0004003b,0x0000000e,0x000000a7,
+0x00000007,0x0004003b,0x0000000e,0x000000aa,
+0x00000007,0x0004003d,0x0000000d,0x00000087,
+0x00000019,0x00050086,0x0000000d,0x00000089,
+0x00000087,0x00000088,0x0003003e,0x00000086,
+0x00000089,0x0004003d,0x0000000d,0x0000008b,
+0x00000019,0x00050089,0x0000000d,0x0000008c,
+0x0000008b,0x00000088,0x0003003e,0x0000008a,
+0x0000008c,0x0004003d,0x0000000d,0x0000008f,
+0x0000001a,0x000500c4,0x00000006,0x00000090,
+0x0000008e,0x0000008f,0x00050082,0x00000006,
+0x00000091,0x00000090,0x0000008e,0x0004007c,
+0x0000000d,0x00000092,0x00000091,0x0003003e,
+0x0000008d,0x00000092,0x0004003d,0x0000000d,
+0x00000093,0x00000086,0x0004003d,0x0000000d,
+0x00000094,0x00000019,0x0004003d,0x0000000d,
+0x00000095,0x0000001a,0x00050080,0x0000000d,
+0x00000096,0x00000094,0x00000095,0x00050082,
+0x0000000d,0x00000097,0x00000096,0x00000082,
+0x00050086,0x0000000d,0x00000098,0x00000097,
+0x00000088,0x000500aa,0x00000099,0x0000009a,
+0x00000093,0x00000098,0x000300f7,0x0000009c,
+0x00000000,0x000400fa,0x0000009a,0x0000009b,
+0x000000a6,0x000200f8,0x0000009b,0x0004003d,
+0x0000000d,0x0000009d,0x00000086,0x00050082,
+0x0000000d,0x0000009e,0x0000003c,0x0000009d,
+0x00050041,0x0000000e,0x0000009f,0x00000018,
+0x0000009e,0x0004003d,0x0000000d,0x000000a0,
+0x0000009f,0x0004003d,0x0000000d,0x000000a1,
+0x0000008a,0x000500c2,0x0000000d,0x000000a2,
+0x000000a0,0x000000a1,0x0004003d,0x0000000d,
+0x000000a3,0x0000008d,0x000500c7,0x0000000d,
+0x000000a4,0x000000a2,0x000000a3,0x000200fe,
+0x000000a4,0x000200f8,0x000000a6,0x0004003d,
+0x0000000d,0x000000a8,0x0000008a,0x00050082,
+0x0000000d,0x000000a9,0x00000088,0x000000a8,
+0x0003003e,0x000000a7,0x000000a9,0x0004003d,
+0x0000000d,0x000000ab,0x00000086,0x00050082,
+0x0000000d,0x000000ac,0x0000003c,0x000000ab,
+0x00050082,0x0000000d,0x000000ad,0x000000ac,
+0x00000082,0x00050041,0x0000000e,0x000000ae,
+0x00000018,0x000000ad,0x0004003d,0x0000000d,
+0x000000af,0x000000ae,0x0004003d,0x0000000d,
+0x000000b0,0x000000a7,0x000500c4,0x0000000d,
+0x000000b1,0x000000af,0x000000b0,0x0003003e,
+0x000000aa,0x000000b1,0x0004003d,0x0000000d,
+0x000000b2,0x00000086,0x00050082,0x0000000d,
+0x000000b3,0x0000003c,0x000000b2,0x00050041,
+0x0000000e,0x000000b4,0x00000018,0x000000b3,
+0x0004003d,0x0000000d,0x000000b5,0x000000b4,
+0x0004003d,0x0000000d,0x000000b6,0x0000008a,
+0x000500c2,0x0000000d,0x000000b7,0x000000b5,
+0x000000b6,0x0004003d,0x0000000d,0x000000b8,
+0x000000a7,0x000500c4,0x00000006,0x000000b9,
+0x0000008e,0x000000b8,0x00050082,0x00000006,
+0x000000ba,0x000000b9,0x0000008e,0x0004007c,
+0x0000000d,0x000000bb,0x000000ba,0x000500c7,
+0x0000000d,0x000000bc,0x000000b7,0x000000bb,
+0x0004003d,0x0000000d,0x000000bd,0x000000aa,
+0x000500c5,0x0000000d,0x000000be,0x000000bd,
+0x000000bc,0x0003003e,0x000000aa,0x000000be,
+0x0004003d,0x0000000d,0x000000bf,0x000000aa,
+0x0004003d,0x0000000d,0x000000c0,0x0000008d,
+0x000500c7,0x0000000d,0x000000c1,0x000000bf,
+0x000000c0,0x000200fe,0x000000c1,0x000200f8,
+0x0000009c,0x000100ff,0x00010038,0x00050036,
+0x0000000d,0x00000022,0x00000000,0x0000001d,
+0x00030037,0x00000016,0x0000001e,0x00030037,
+0x0000000e,0x0000001f,0x00030037,0x0000000e,
+0x00000020,0x00030037,0x0000000e,0x00000021,
+0x000200f8,0x00000023,0x0004003b,0x00000016,
+0x000000d0,0x00000007,0x0004003b,0x0000000e,
+0x000000d2,0x00000007,0x0004003b,0x0000000e,
+0x000000d4,0x00000007,0x0004003d,0x0000000d,
+0x000000c4,0x00000020,0x0004003d,0x0000000d,
+0x000000c5,0x0000001f,0x000500b2,0x00000099,
+0x000000c6,0x000000c4,0x000000c5,0x000300f7,
+0x000000c8,0x00000000,0x000400fa,0x000000c6,
+0x000000c7,0x000000c8,0x000200f8,0x000000c7,
+0x000200fe,0x000000c9,0x000200f8,0x000000c8,
+0x0004003d,0x0000000d,0x000000cb,0x00000020,
+0x0004003d,0x0000000d,0x000000cc,0x0000001f,
+0x00050082,0x0000000d,0x000000cd,0x000000cb,
+0x000000cc,0x0004003d,0x0000000d,0x000000ce,
+0x00000021,0x0007000c,0x0000000d,0x000000cf,
+0x00000001,0x00000026,0x000000cd,0x000000ce,
+0x0004003d,0x00000015,0x000000d1,0x0000001e,
+0x0003003e,0x000000d0,0x000000d1,0x0004003d,
+0x0000000d,0x000000d3,0x0000001f,0x0003003e,
+0x000000d2,0x000000d3,0x0003003e,0x000000d4,
+0x000000cf,0x00070039,0x0000000d,0x000000d5,
+0x0000001b,0x000000d0,0x000000d2,0x000000d4,
+0x000200fe,0x000000d5,0x00010038,0x00050036,
+0x0000000d,0x00000029,0x00000000,0x00000024,
+0x00030037,0x0000000e,0x00000025,0x00030037,
+0x0000000e,0x00000026,0x00030037,0x0000000e,
+0x00000027,0x00030037,0x0000000e,0x00000028,
+0x000200f8,0x0000002a,0x0004003b,0x0000000e,
+0x000000d8,0x00000007,0x0004003b,0x0000000e,
+0x000000e1,0x00000007,0x0004003b,0x0000000e,
+0x000000ea,0x00000007,0x0004003d,0x0000000d,
+0x000000d9,0x00000025,0x00050084,0x0000000d,
+0x000000db,0x000000d9,0x000000da,0x0004003d,
+0x0000000d,0x000000dc,0x00000026,0x00050084,
+0x0000000d,0x000000dd,0x000000db,0x000000dc,
+0x00050080,0x0000000d,0x000000df,0x000000dd,
+0x000000de,0x00050086,0x0000000d,0x000000e0,
+0x000000df,0x00000033,0x0003003e,0x000000d8,
+0x000000e0,0x0004003d,0x0000000d,0x000000e2,
+0x00000025,0x00050084,0x0000000d,0x000000e4,
+0x000000e2,0x000000e3,0x0004003d,0x0000000d,
+0x000000e5,0x00000027,0x00050084,0x0000000d,
+0x000000e6,0x000000e4,0x000000e5,0x00050080,
+0x0000000d,0x000000e8,0x000000e6,0x000000e7,
+0x00050086,0x0000000d,0x000000e9,0x000000e8,
+0x0000003c,0x0003003e,0x000000e1,0x000000e9,
+0x0004003d,0x0000000d,0x000000eb,0x00000025,
+0x0004003d,0x0000000d,0x000000ec,0x00000028,
+0x00050084,0x0000000d,0x000000ed,0x000000eb,
+0x000000ec,0x0003003e,0x000000ea,0x000000ed,
+0x0004003d,0x0000000d,0x000000ee,0x000000d8,
+0x0004003d,0x0000000d,0x000000ef,0x000000e1,
+0x00050080,0x0000000d,0x000000f0,0x000000ee,
+0x000000ef,0x0004003d,0x0000000d,0x000000f1,
+0x000000ea,0x00050080,0x0000000d,0x000000f2,
+0x000000f0,0x000000f1,0x000200fe,0x000000f2,
+0x00010038,0x00050036,0x00000002,0x00000031,
+0x00000000,0x0000002b,0x00030037,0x0000000e,
+0x0000002c,0x00030037,0x0000000e,0x0000002d,
+0x00030037,0x0000000e,0x0000002e,0x00030037,
+0x0000000e,0x0000002f,0x00030037,0x0000000e,
+0x00000030,0x000200f8,0x00000032,0x0004003d,
+0x0000000d,0x000000f5,0x0000002c,0x000500aa,
+0x00000099,0x000000f6,0x000000f5,0x00000082,
+0x000300f7,0x000000f8,0x00000000,0x000400fa,
+0x000000f6,0x000000f7,0x000000fc,0x000200f8,
+0x000000f7,0x0003003e,0x0000002f,0x00000033,
+0x0004003d,0x0000000d,0x000000f9,0x0000002e,
+0x00050084,0x0000000d,0x000000fa,0x00000033,
+0x000000f9,0x00050080,0x0000000d,0x000000fb,
+0x000000da,0x000000fa,0x0003003e,0x00000030,
+0x000000fb,0x000200f9,0x000000f8,0x000200f8,
+0x000000fc,0x0004003d,0x0000000d,0x000000fd,
+0x0000002d,0x000500aa,0x00000099,0x000000fe,
+0x000000fd,0x00000082,0x000300f7,0x00000100,
+0x00000000,0x000400fa,0x000000fe,0x000000ff,
+0x00000104,0x000200f8,0x000000ff,0x0003003e,
+0x0000002f,0x0000003c,0x0004003d,0x0000000d,
+0x00000101,0x0000002e,0x00050084,0x0000000d,
+0x00000102,0x0000003c,0x00000101,0x00050080,
+0x0000000d,0x00000103,0x000000e3,0x00000102,
+0x0003003e,0x00000030,0x00000103,0x000200f9,
+0x00000100,0x000200f8,0x00000104,0x0003003e,
+0x0000002f,0x00000082,0x0004003d,0x0000000d,
+0x00000105,0x0000002e,0x0003003e,0x00000030,
+0x00000105,0x000200f9,0x00000100,0x000200f8,
+0x00000100,0x000200f9,0x000000f8,0x000200f8,
+0x000000f8,0x000100fd,0x00010038,0x00050036,
+0x00000034,0x0000003a,0x00000000,0x00000035,
+0x00030037,0x00000016,0x00000036,0x00030037,
+0x0000000e,0x00000037,0x00030037,0x0000000e,
+0x00000038,0x00030037,0x0000000e,0x00000039,
+0x000200f8,0x0000003b,0x0004003b,0x0000000e,
+0x00000106,0x00000007,0x0004003b,0x0000000e,
+0x00000107,0x00000007,0x0004003b,0x0000000f,
+0x00000108,0x00000007,0x0004003b,0x00000112,
+0x00000113,0x00000007,0x0004003b,0x00000016,
+0x00000115,0x00000007,0x0004003b,0x0000000e,
+0x00000117,0x00000007,0x0004003b,0x0000000e,
+0x00000119,0x00000007,0x0004003b,0x0000000e,
+0x0000011b,0x00000007,0x0004003b,0x0000000e,
+0x00000122,0x00000007,0x0004003b,0x00000127,
+0x00000128,0x00000007,0x0004003b,0x00000016,
+0x0000012c,0x00000007,0x0004003b,0x0000000e,
+0x0000012e,0x00000007,0x0004003b,0x0000000e,
+0x00000130,0x00000007,0x0004003b,0x0000000e,
+0x00000132,0x00000007,0x0004003b,0x00000127,
+0x00000135,0x00000007,0x0004003b,0x00000127,
+0x00000141,0x00000007,0x0004003b,0x0000000f,
+0x00000149,0x00000007,0x0004003b,0x00000112,
+0x00000151,0x00000007,0x0004003b,0x0000024b,
+0x0000024c,0x00000007,0x0003003e,0x00000106,
+0x000000c9,0x0003003e,0x00000107,0x000000c9,
+0x0003003e,0x00000108,0x00000109,0x000200f9,
+0x0000010a,0x000200f8,0x0000010a,0x000400f6,
+0x0000010c,0x0000010d,0x00000000,0x000200f9,
+0x0000010e,0x000200f8,0x0000010e,0x0004003d,
+0x00000006,0x0000010f,0x00000108,0x000500b1,
+0x00000099,0x00000111,0x0000010f,0x00000110,
+0x000400fa,0x00000111,0x0000010b,0x0000010c,
+0x000200f8,0x0000010b,0x0004003d,0x00000006,
+0x00000114,0x00000108,0x0004003d,0x00000015,
+0x00000116,0x00000036,0x0003003e,0x00000115,
+0x00000116,0x0004003d,0x0000000d,0x00000118,
+0x00000037,0x0003003e,0x00000117,0x00000118,
+0x0004003d,0x0000000d,0x0000011a,0x00000038,
+0x0003003e,0x00000119,0x0000011a,0x0004003d,
+0x0000000d,0x0000011c,0x00000039,0x0003003e,
+0x0000011b,0x0000011c,0x00080039,0x0000000d,
+0x0000011d,0x00000022,0x00000115,0x00000117,
+0x00000119,0x0000011b,0x00050041,0x0000000e,
+0x0000011e,0x00000113,0x00000114,0x0003003e,
+0x0000011e,0x0000011d,0x0004003d,0x0000000d,
+0x0000011f,0x00000039,0x0004003d,0x0000000d,
+0x00000120,0x00000037,0x00050080,0x0000000d,
+0x00000121,0x00000120,0x0000011f,0x0003003e,
+0x00000037,0x00000121,0x0004003d,0x00000006,
+0x00000126,0x00000108,0x0003003e,0x00000128,
+0x00000125,0x00050041,0x0000000f,0x00000129,
+0x00000128,0x00000126,0x0004003d,0x00000006,
+0x0000012a,0x00000129,0x0004007c,0x0000000d,
+0x0000012b,0x0000012a,0x0004003d,0x00000015,
+0x0000012d,0x00000036,0x0003003e,0x0000012c,
+0x0000012d,0x0004003d,0x0000000d,0x0000012f,
+0x00000037,0x0003003e,0x0000012e,0x0000012f,
+0x0004003d,0x0000000d,0x00000131,0x00000038,
+0x0003003e,0x00000130,0x00000131,0x0003003e,
+0x00000132,0x0000012b,0x00080039,0x0000000d,
+0x00000133,0x00000022,0x0000012c,0x0000012e,
+0x00000130,0x00000132,0x0003003e,0x00000122,
+0x00000133,0x0004003d,0x00000006,0x00000134,
+0x00000108,0x0003003e,0x00000135,0x00000125,
+0x00050041,0x0000000f,0x00000136,0x00000135,
+0x00000134,0x0004003d,0x00000006,0x00000137,
+0x00000136,0x0004007c,0x0000000d,0x00000138,
+0x00000137,0x0004003d,0x0000000d,0x00000139,
+0x00000037,0x00050080,0x0000000d,0x0000013a,
+0x00000139,0x00000138,0x0003003e,0x00000037,
+0x0000013a,0x0004003d,0x0000000d,0x0000013b,
+0x00000122,0x0004003d,0x0000000d,0x0000013c,
+0x00000107,0x000500c4,0x0000000d,0x0000013d,
+0x0000013b,0x0000013c,0x0004003d,0x0000000d,
+0x0000013e,0x00000106,0x000500c5,0x0000000d,
+0x0000013f,0x0000013e,0x0000013d,0x0003003e,
+0x00000106,0x0000013f,0x0004003d,0x00000006,
+0x00000140,0x00000108,0x0003003e,0x00000141,
+0x00000125,0x00050041,0x0000000f,0x00000142,
+0x00000141,0x00000140,0x0004003d,0x00000006,
+0x00000143,0x00000142,0x0004007c,0x0000000d,
+0x00000144,0x00000143,0x0004003d,0x0000000d,
+0x00000145,0x00000107,0x00050080,0x0000000d,
+0x00000146,0x00000145,0x00000144,0x0003003e,
+0x00000107,0x00000146,0x000200f9,0x0000010d,
+0x000200f8,0x0000010d,0x0004003d,0x00000006,
+0x00000147,0x00000108,0x00050080,0x00000006,
+0x00000148,0x00000147,0x0000008e,0x0003003e,
+0x00000108,0x00000148,0x000200f9,0x0000010a,
+0x000200f8,0x0000010c,0x0003003e,0x00000149,
+0x00000109,0x000200f9,0x0000014a,0x000200f8,
+0x0000014a,0x000400f6,0x0000014c,0x0000014d,
+0x00000000,0x000200f9,0x0000014e,0x000200f8,
+0x0000014e,0x0004003d,0x00000006,0x0000014f,
+0x00000149,0x000500b1,0x00000099,0x00000150,
+0x0000014f,0x00000110,0x000400fa,0x00000150,
+0x0000014b,0x0000014c,0x000200f8,0x0000014b,
+0x0004003d,0x00000006,0x00000152,0x00000149,
+0x0004003d,0x0000000d,0x00000249,0x00000106,
+0x0004003d,0x00000006,0x0000024a,0x00000149,
+0x0003003e,0x0000024c,0x00000248,0x00060041,
+0x0000000e,0x0000024d,0x0000024c,0x00000249,
+0x0000024a,0x0004003d,0x0000000d,0x0000024e,
+0x0000024d,0x0004003d,0x0000000d,0x0000024f,
+0x00000039,0x000500c4,0x0000000d,0x00000250,
+0x0000024e,0x0000024f,0x0004003d,0x00000006,
+0x00000251,0x00000149,0x00050041,0x0000000e,
+0x00000252,0x00000113,0x00000251,0x0004003d,
+0x0000000d,0x00000253,0x00000252,0x000500c5,
+0x0000000d,0x00000254,0x00000250,0x00000253,
+0x00050041,0x0000000e,0x00000255,0x00000151,
+0x00000152,0x0003003e,0x00000255,0x00000254,
+0x000200f9,0x0000014d,0x000200f8,0x0000014d,
+0x0004003d,0x00000006,0x00000256,0x00000149,
+0x00050080,0x00000006,0x00000257,0x00000256,
+0x0000008e,0x0003003e,0x00000149,0x00000257,
+0x000200f9,0x0000014a,0x000200f8,0x0000014c,
+0x0004003d,0x00000034,0x00000258,0x00000151,
+0x000200fe,0x00000258,0x00010038,0x00050036,
+0x0000003d,0x00000043,0x00000000,0x0000003e,
+0x00030037,0x00000016,0x0000003f,0x00030037,
+0x0000000e,0x00000040,0x00030037,0x0000000e,
+0x00000041,0x00030037,0x0000000e,0x00000042,
+0x000200f8,0x00000044,0x0004003b,0x0000000e,
+0x0000025b,0x00000007,0x0004003b,0x0000000e,
+0x0000025c,0x00000007,0x0004003b,0x0000000e,
+0x0000025d,0x00000007,0x0004003b,0x0000000f,
+0x00000262,0x00000007,0x0004003b,0x0000026b,
+0x0000026c,0x00000007,0x0004003b,0x00000016,
+0x0000026e,0x00000007,0x0004003b,0x0000000e,
+0x00000270,0x00000007,0x0004003b,0x0000000e,
+0x00000272,0x00000007,0x0004003b,0x0000000e,
+0x00000274,0x00000007,0x0004003b,0x0000000e,
+0x0000027b,0x00000007,0x0004003b,0x0000027f,
+0x00000280,0x00000007,0x0004003b,0x00000016,
+0x00000284,0x00000007,0x0004003b,0x0000000e,
+0x00000286,0x00000007,0x0004003b,0x0000000e,
+0x00000288,0x00000007,0x0004003b,0x0000000e,
+0x0000028a,0x00000007,0x0004003b,0x0000027f,
+0x0000028d,0x00000007,0x0004003b,0x0000027f,
+0x00000299,0x00000007,0x0004003b,0x0000000f,
+0x000002a1,0x00000007,0x0004003b,0x0000026b,
+0x000002a9,0x00000007,0x0004003b,0x0000032d,
+0x0000032e,0x00000007,0x0003003e,0x0000025b,
+0x000000c9,0x0003003e,0x0000025c,0x000000c9,
+0x0004003d,0x0000000d,0x0000025e,0x00000042,
+0x000500c4,0x00000006,0x0000025f,0x0000008e,
+0x0000025e,0x00050082,0x00000006,0x00000260,
+0x0000025f,0x0000008e,0x0004007c,0x0000000d,
+0x00000261,0x00000260,0x0003003e,0x0000025d,
+0x00000261,0x0003003e,0x00000262,0x00000109,
+0x000200f9,0x00000263,0x000200f8,0x00000263,
+0x000400f6,0x00000265,0x00000266,0x00000000,
+0x000200f9,0x00000267,0x000200f8,0x00000267,
+0x0004003d,0x00000006,0x00000268,0x00000262,
+0x000500b1,0x00000099,0x0000026a,0x00000268,
+0x00000269,0x000400fa,0x0000026a,0x00000264,
+0x00000265,0x000200f8,0x00000264,0x0004003d,
+0x00000006,0x0000026d,0x00000262,0x0004003d,
+0x00000015,0x0000026f,0x0000003f,0x0003003e,
+0x0000026e,0x0000026f,0x0004003d,0x0000000d,
+0x00000271,0x00000040,0x0003003e,0x00000270,
+0x00000271,0x0004003d,0x0000000d,0x00000273,
+0x00000041,0x0003003e,0x00000272,0x00000273,
+0x0004003d,0x0000000d,0x00000275,0x00000042,
+0x0003003e,0x00000274,0x00000275,0x00080039,
+0x0000000d,0x00000276,0x00000022,0x0000026e,
+0x00000270,0x00000272,0x00000274,0x00050041,
+0x0000000e,0x00000277,0x0000026c,0x0000026d,
+0x0003003e,0x00000277,0x00000276,0x0004003d,
+0x0000000d,0x00000278,0x00000042,0x0004003d,
+0x0000000d,0x00000279,0x00000040,0x00050080,
+0x0000000d,0x0000027a,0x00000279,0x00000278,
+0x0003003e,0x00000040,0x0000027a,0x0004003d,
+0x00000006,0x0000027e,0x00000262,0x0003003e,
+0x00000280,0x0000027d,0x00050041,0x0000000f,
+0x00000281,0x00000280,0x0000027e,0x0004003d,
+0x00000006,0x00000282,0x00000281,0x0004007c,
+0x0000000d,0x00000283,0x00000282,0x0004003d,
+0x00000015,0x00000285,0x0000003f,0x0003003e,
+0x00000284,0x00000285,0x0004003d,0x0000000d,
+0x00000287,0x00000040,0x0003003e,0x00000286,
+0x00000287,0x0004003d,0x0000000d,0x00000289,
+0x00000041,0x0003003e,0x00000288,0x00000289,
+0x0003003e,0x0000028a,0x00000283,0x00080039,
+0x0000000d,0x0000028b,0x00000022,0x00000284,
+0x00000286,0x00000288,0x0000028a,0x0003003e,
+0x0000027b,0x0000028b,0x0004003d,0x00000006,
+0x0000028c,0x00000262,0x0003003e,0x0000028d,
+0x0000027d,0x00050041,0x0000000f,0x0000028e,
+0x0000028d,0x0000028c,0x0004003d,0x00000006,
+0x0000028f,0x0000028e,0x0004007c,0x0000000d,
+0x00000290,0x0000028f,0x0004003d,0x0000000d,
+0x00000291,0x00000040,0x00050080,0x0000000d,
+0x00000292,0x00000291,0x00000290,0x0003003e,
+0x00000040,0x00000292,0x0004003d,0x0000000d,
+0x00000293,0x0000027b,0x0004003d,0x0000000d,
+0x00000294,0x0000025c,0x000500c4,0x0000000d,
+0x00000295,0x00000293,0x00000294,0x0004003d,
+0x0000000d,0x00000296,0x0000025b,0x000500c5,
+0x0000000d,0x00000297,0x00000296,0x00000295,
+0x0003003e,0x0000025b,0x00000297,0x0004003d,
+0x00000006,0x00000298,0x00000262,0x0003003e,
+0x00000299,0x0000027d,0x00050041,0x0000000f,
+0x0000029a,0x00000299,0x00000298,0x0004003d,
+0x00000006,0x0000029b,0x0000029a,0x0004007c,
+0x0000000d,0x0000029c,0x0000029b,0x0004003d,
+0x0000000d,0x0000029d,0x0000025c,0x00050080,
+0x0000000d,0x0000029e,0x0000029d,0x0000029c,
+0x0003003e,0x0000025c,0x0000029e,0x000200f9,
+0x00000266,0x000200f8,0x00000266,0x0004003d,
+0x00000006,0x0000029f,0x00000262,0x00050080,
+0x00000006,0x000002a0,0x0000029f,0x0000008e,
+0x0003003e,0x00000262,0x000002a0,0x000200f9,
+0x00000263,0x000200f8,0x00000265,0x0003003e,
+0x000002a1,0x00000109,0x000200f9,0x000002a2,
+0x000200f8,0x000002a2,0x000400f6,0x000002a4,
+0x000002a5,0x00000000,0x000200f9,0x000002a6,
+0x000200f8,0x000002a6,0x0004003d,0x00000006,
+0x000002a7,0x000002a1,0x000500b1,0x00000099,
+0x000002a8,0x000002a7,0x00000269,0x000400fa,
+0x000002a8,0x000002a3,0x000002a4,0x000200f8,
+0x000002a3,0x0004003d,0x00000006,0x000002aa,
+0x000002a1,0x0004003d,0x0000000d,0x0000032b,
+0x0000025b,0x0004003d,0x00000006,0x0000032c,
+0x000002a1,0x0003003e,0x0000032e,0x0000032a,
+0x00060041,0x0000000e,0x0000032f,0x0000032e,
+0x0000032b,0x0000032c,0x0004003d,0x0000000d,
+0x00000330,0x0000032f,0x0004003d,0x0000000d,
+0x00000331,0x00000042,0x000500c4,0x0000000d,
+0x00000332,0x00000330,0x00000331,0x0004003d,
+0x00000006,0x00000333,0x000002a1,0x00050041,
+0x0000000e,0x00000334,0x0000026c,0x00000333,
+0x0004003d,0x0000000d,0x00000335,0x00000334,
+0x000500c5,0x0000000d,0x00000336,0x00000332,
+0x00000335,0x00050041,0x0000000e,0x00000337,
+0x000002a9,0x000002aa,0x0003003e,0x00000337,
+0x00000336,0x000200f9,0x000002a5,0x000200f8,
+0x000002a5,0x0004003d,0x00000006,0x00000338,
+0x000002a1,0x00050080,0x00000006,0x00000339,
+0x00000338,0x0000008e,0x0003003e,0x000002a1,
+0x00000339,0x000200f9,0x000002a2,0x000200f8,
+0x000002a4,0x0004003d,0x0000003d,0x0000033a,
+0x000002a9,0x000200fe,0x0000033a,0x00010038,
+0x00050036,0x0000000d,0x00000047,0x00000000,
+0x00000045,0x00030037,0x0000000e,0x00000046,
+0x000200f8,0x00000048,0x0004003d,0x0000000d,
+0x0000033d,0x00000046,0x00050086,0x0000000d,
+0x0000033e,0x0000033d,0x000000de,0x00050080,
+0x0000000d,0x0000033f,0x0000033e,0x00000082,
+0x00050084,0x0000000d,0x00000340,0x0000033f,
+0x000000e7,0x000200fe,0x00000340,0x00010038,
+0x00050036,0x00000002,0x0000004e,0x00000000,
+0x0000004b,0x00030037,0x0000004a,0x0000004c,
+0x00030037,0x0000004a,0x0000004d,0x000200f8,
+0x0000004f,0x0004003b,0x0000004a,0x00000343,
+0x00000007,0x0004003d,0x00000049,0x00000344,
+0x0000004c,0x0003003e,0x00000343,0x00000344,
+0x0004003d,0x00000049,0x00000345,0x0000004d,
+0x0003003e,0x0000004c,0x00000345,0x0004003d,
+0x00000049,0x00000346,0x00000343,0x0003003e,
+0x0000004d,0x00000346,0x000100fd,0x00010038,
+0x00050036,0x00000002,0x00000053,0x00000000,
+0x00000050,0x00030037,0x0000000f,0x00000051,
+0x00030037,0x0000000f,0x00000052,0x000200f8,
+0x00000054,0x0004003d,0x00000006,0x00000347,
+0x00000052,0x000500c3,0x00000006,0x00000348,
+0x00000347,0x0000008e,0x0003003e,0x00000052,
+0x00000348,0x0004003d,0x00000006,0x00000349,
+0x00000051,0x000500c7,0x00000006,0x0000034b,
+0x00000349,0x0000034a,0x0004003d,0x00000006,
+0x0000034c,0x00000052,0x000500c5,0x00000006,
+0x0000034d,0x0000034c,0x0000034b,0x0003003e,
+0x00000052,0x0000034d,0x0004003d,0x00000006,
+0x0000034e,0x00000051,0x000500c3,0x00000006,
+0x0000034f,0x0000034e,0x0000008e,0x0003003e,
+0x00000051,0x0000034f,0x0004003d,0x00000006,
+0x00000351,0x00000051,0x000500c7,0x00000006,
+0x00000352,0x00000351,0x00000350,0x0003003e,
+0x00000051,0x00000352,0x0004003d,0x00000006,
+0x00000353,0x00000051,0x000500c7,0x00000006,
+0x00000355,0x00000353,0x00000354,0x000500ab,
+0x00000099,0x00000356,0x00000355,0x00000109,
+0x000300f7,0x00000358,0x00000000,0x000400fa,
+0x00000356,0x00000357,0x00000358,0x000200f8,
+0x00000357,0x0004003d,0x00000006,0x0000035a,
+0x00000051,0x00050082,0x00000006,0x0000035b,
+0x0000035a,0x00000359,0x0003003e,0x00000051,
+0x0000035b,0x000200f9,0x00000358,0x000200f8,
+0x00000358,0x000100fd,0x00010038,0x00050036,
+0x00000002,0x00000057,0x00000000,0x00000055,
+0x00030037,0x0000004a,0x00000056,0x000200f8,
+0x00000058,0x00050041,0x0000000f,0x0000035c,
+0x00000056,0x000000c9,0x0004003d,0x00000006,
+0x0000035d,0x0000035c,0x00050041,0x0000000f,
+0x0000035e,0x00000056,0x000000e7,0x0004003d,
+0x00000006,0x0000035f,0x0000035e,0x00050080,
+0x00000006,0x00000360,0x0000035d,0x0000035f,
+0x00050087,0x00000006,0x00000361,0x00000360,
+0x00000124,0x00050041,0x0000000f,0x00000362,
+0x00000056,0x000000c9,0x0003003e,0x00000362,
+0x00000361,0x00050041,0x0000000f,0x00000363,
+0x00000056,0x00000082,0x0004003d,0x00000006,
+0x00000364,0x00000363,0x00050041,0x0000000f,
+0x00000365,0x00000056,0x000000e7,0x0004003d,
+0x00000006,0x00000366,0x00000365,0x00050080,
+0x00000006,0x00000367,0x00000364,0x00000366,
+0x00050087,0x00000006,0x00000368,0x00000367,
+0x00000124,0x00050041,0x0000000f,0x00000369,
+0x00000056,0x00000082,0x0003003e,0x00000369,
+0x00000368,0x000100fd,0x00010038,0x00050036,
+0x00000002,0x00000061,0x00000000,0x0000005b,
+0x00030037,0x0000005a,0x0000005c,0x00030037,
+0x0000000e,0x0000005d,0x00030037,0x0000000e,
+0x0000005e,0x00030037,0x00000016,0x0000005f,
+0x00030037,0x00000016,0x00000060,0x000200f8,
+0x00000062,0x0004003b,0x0000000f,0x0000036a,
+0x00000007,0x0004003b,0x0000036d,0x0000036e,
+0x00000007,0x0004003b,0x0000000f,0x00000372,
+0x00000007,0x0004003b,0x0000036d,0x00000375,
+0x00000007,0x0004003b,0x0000000f,0x00000379,
+0x00000007,0x0004003b,0x0000036d,0x0000037c,
+0x00000007,0x0004003b,0x0000000f,0x00000380,
+0x00000007,0x0004003b,0x0000036d,0x00000383,
+0x00000007,0x0004003b,0x0000000f,0x00000387,
+0x00000007,0x0004003b,0x0000036d,0x0000038a,
+0x00000007,0x0004003b,0x0000000f,0x0000038e,
+0x00000007,0x0004003b,0x0000036d,0x00000391,
+0x00000007,0x0004003b,0x0000000f,0x00000395,
+0x00000007,0x0004003b,0x0000036d,0x00000399,
+0x00000007,0x0004003b,0x0000000f,0x0000039d,
+0x00000007,0x0004003b,0x0000036d,0x000003a0,
+0x00000007,0x0004003b,0x0000004a,0x000003b1,
+0x00000007,0x0004003b,0x0000004a,0x000003b7,
+0x00000007,0x0004003b,0x0000000f,0x000003bd,
+0x00000007,0x0004003b,0x0000000f,0x000003c4,
+0x00000007,0x0004003b,0x0000000f,0x000003de,
+0x00000007,0x0004003b,0x0000000f,0x000003e0,
+0x00000007,0x0004003b,0x0000000f,0x000003e5,
+0x00000007,0x0004003b,0x0000000f,0x000003e7,
+0x00000007,0x0004003b,0x0000000f,0x000003f4,
+0x00000007,0x0004003b,0x0000000f,0x00000407,
+0x00000007,0x0004003b,0x0000000f,0x0000040f,
+0x00000007,0x0004003b,0x0000000f,0x0000041e,
+0x00000007,0x0004003b,0x0000000f,0x00000424,
+0x00000007,0x0004003b,0x0000004a,0x00000437,
+0x00000007,0x0004003b,0x0000004a,0x00000439,
+0x00000007,0x0004003b,0x0000004a,0x0000043e,
+0x00000007,0x0004003b,0x0000004a,0x00000442,
+0x00000007,0x0004003b,0x0000000f,0x00000447,
+0x00000007,0x0004003b,0x0000000f,0x00000449,
+0x00000007,0x0004003b,0x0000000f,0x0000044e,
+0x00000007,0x0004003b,0x0000000f,0x00000450,
+0x00000007,0x0004003b,0x0000000f,0x00000455,
+0x00000007,0x0004003b,0x0000000f,0x00000457,
+0x00000007,0x0004003b,0x0000004a,0x00000472,
+0x00000007,0x0004003b,0x0000004a,0x00000474,
+0x00000007,0x0004003b,0x0000004a,0x00000479,
+0x00000007,0x0004003b,0x0000004a,0x0000047d,
+0x00000007,0x0004003b,0x0000000e,0x00000499,
+0x00000007,0x0004003b,0x0000000e,0x000004a0,
+0x00000007,0x0004003b,0x0000004a,0x000004b6,
+0x00000007,0x0004003b,0x0000004a,0x000004b8,
+0x00000007,0x0004003b,0x0000004a,0x000004bd,
+0x00000007,0x0004003b,0x0000004a,0x000004c1,
+0x00000007,0x0004003b,0x0000000f,0x000004c6,
+0x00000007,0x0004003b,0x0000000f,0x000004c8,
+0x00000007,0x0004003b,0x0000000f,0x000004cd,
+0x00000007,0x0004003b,0x0000000f,0x000004cf,
+0x00000007,0x0004003b,0x0000000f,0x000004d4,
+0x00000007,0x0004003b,0x0000000f,0x000004d6,
+0x00000007,0x0004003b,0x0000000f,0x000004db,
+0x00000007,0x0004003b,0x0000000f,0x000004dd,
+0x00000007,0x0004003b,0x0000004a,0x000004fc,
+0x00000007,0x0004003b,0x0000004a,0x000004fe,
+0x00000007,0x0004003b,0x0000004a,0x00000503,
+0x00000007,0x0004003b,0x0000004a,0x00000507,
+0x00000007,0x0004003d,0x0000000d,0x0000036b,
+0x0000005d,0x00050080,0x0000000d,0x0000036c,
+0x0000036b,0x000000c9,0x0003003e,0x0000036e,
+0x0000005c,0x00050041,0x0000000e,0x0000036f,
+0x0000036e,0x0000036c,0x0004003d,0x0000000d,
+0x00000370,0x0000036f,0x0004007c,0x00000006,
+0x00000371,0x00000370,0x0003003e,0x0000036a,
+0x00000371,0x0004003d,0x0000000d,0x00000373,
+0x0000005d,0x00050080,0x0000000d,0x00000374,
+0x00000373,0x00000082,0x0003003e,0x00000375,
+0x0000005c,0x00050041,0x0000000e,0x00000376,
+0x00000375,0x00000374,0x0004003d,0x0000000d,
+0x00000377,0x00000376,0x0004007c,0x00000006,
+0x00000378,0x00000377,0x0003003e,0x00000372,
+0x00000378,0x0004003d,0x0000000d,0x0000037a,
+0x0000005d,0x00050080,0x0000000d,0x0000037b,
+0x0000037a,0x000000e7,0x0003003e,0x0000037c,
+0x0000005c,0x00050041,0x0000000e,0x0000037d,
+0x0000037c,0x0000037b,0x0004003d,0x0000000d,
+0x0000037e,0x0000037d,0x0004007c,0x00000006,
+0x0000037f,0x0000037e,0x0003003e,0x00000379,
+0x0000037f,0x0004003d,0x0000000d,0x00000381,
+0x0000005d,0x00050080,0x0000000d,0x00000382,
+0x00000381,0x0000003c,0x0003003e,0x00000383,
+0x0000005c,0x00050041,0x0000000e,0x00000384,
+0x00000383,0x00000382,0x0004003d,0x0000000d,
+0x00000385,0x00000384,0x0004007c,0x00000006,
+0x00000386,0x00000385,0x0003003e,0x00000380,
+0x00000386,0x0004003d,0x0000000d,0x00000388,
+0x0000005d,0x00050080,0x0000000d,0x00000389,
+0x00000388,0x000000de,0x0003003e,0x0000038a,
+0x0000005c,0x00050041,0x0000000e,0x0000038b,
+0x0000038a,0x00000389,0x0004003d,0x0000000d,
+0x0000038c,0x0000038b,0x0004007c,0x00000006,
+0x0000038d,0x0000038c,0x0003003e,0x00000387,
+0x0000038d,0x0004003d,0x0000000d,0x0000038f,
+0x0000005d,0x00050080,0x0000000d,0x00000390,
+0x0000038f,0x00000033,0x0003003e,0x00000391,
+0x0000005c,0x00050041,0x0000000e,0x00000392,
+0x00000391,0x00000390,0x0004003d,0x0000000d,
+0x00000393,0x00000392,0x0004007c,0x00000006,
+0x00000394,0x00000393,0x0003003e,0x0000038e,
+0x00000394,0x0004003d,0x0000000d,0x00000396,
+0x0000005d,0x00050080,0x0000000d,0x00000398,
+0x00000396,0x00000397,0x0003003e,0x00000399,
+0x0000005c,0x00050041,0x0000000e,0x0000039a,
+0x00000399,0x00000398,0x0004003d,0x0000000d,
+0x0000039b,0x0000039a,0x0004007c,0x00000006,
+0x0000039c,0x0000039b,0x0003003e,0x00000395,
+0x0000039c,0x0004003d,0x0000000d,0x0000039e,
+0x0000005d,0x00050080,0x0000000d,0x0000039f,
+0x0000039e,0x000000e3,0x0003003e,0x000003a0,
+0x0000005c,0x00050041,0x0000000e,0x000003a1,
+0x000003a0,0x0000039f,0x0004003d,0x0000000d,
+0x000003a2,0x000003a1,0x0004007c,0x00000006,
+0x000003a3,0x000003a2,0x0003003e,0x0000039d,
+0x000003a3,0x0004003d,0x0000000d,0x000003a4,
+0x0000005e,0x000300f7,0x000003b0,0x00000000,
+0x001700fb,0x000003a4,0x000003af,0x00000000,
+0x000003a5,0x00000001,0x000003a6,0x00000004,
+0x000003a7,0x00000005,0x000003a8,0x00000006,
+0x000003a9,0x00000008,0x000003aa,0x00000009,
+0x000003ab,0x0000000a,0x000003ac,0x0000000c,
+0x000003ad,0x0000000d,0x000003ae,0x000200f8,
+0x000003af,0x0003003e,0x000003b1,0x00000514,
+0x0003003e,0x000003b7,0x00000514,0x000200f9,
+0x000003b0,0x000200f8,0x000003a5,0x0004003d,
+0x00000006,0x000003b2,0x0000036a,0x0004003d,
+0x00000006,0x000003b3,0x0000036a,0x0004003d,
+0x00000006,0x000003b4,0x0000036a,0x00070050,
+0x00000049,0x000003b6,0x000003b2,0x000003b3,
+0x000003b4,0x000003b5,0x0003003e,0x000003b1,
+0x000003b6,0x0004003d,0x00000006,0x000003b8,
+0x00000372,0x0004003d,0x00000006,0x000003b9,
+0x00000372,0x0004003d,0x00000006,0x000003ba,
+0x00000372,0x00070050,0x00000049,0x000003bb,
+0x000003b8,0x000003b9,0x000003ba,0x000003b5,
+0x0003003e,0x000003b7,0x000003bb,0x000200f9,
+0x000003b0,0x000200f8,0x000003a6,0x0004003d,
+0x00000006,0x000003be,0x0000036a,0x000500c3,
+0x00000006,0x000003bf,0x000003be,0x00000124,
+0x0004003d,0x00000006,0x000003c0,0x00000372,
+0x000500c7,0x00000006,0x000003c2,0x000003c0,
+0x000003c1,0x000500c5,0x00000006,0x000003c3,
+0x000003bf,0x000003c2,0x0003003e,0x000003bd,
+0x000003c3,0x0004003d,0x00000006,0x000003c5,
+0x000003bd,0x0004003d,0x00000006,0x000003c6,
+0x00000372,0x000500c7,0x00000006,0x000003c7,
+0x000003c6,0x00000350,0x00050080,0x00000006,
+0x000003c8,0x000003c5,0x000003c7,0x0007000c,
+0x00000006,0x000003c9,0x00000001,0x00000027,
+0x000003c8,0x000003b5,0x0003003e,0x000003c4,
+0x000003c9,0x0004003d,0x00000006,0x000003ca,
+0x000003bd,0x0004003d,0x00000006,0x000003cb,
+0x000003bd,0x0004003d,0x00000006,0x000003cc,
+0x000003bd,0x00070050,0x00000049,0x000003cd,
+0x000003ca,0x000003cb,0x000003cc,0x000003b5,
+0x0003003e,0x000003b1,0x000003cd,0x0004003d,
+0x00000006,0x000003ce,0x000003c4,0x0004003d,
+0x00000006,0x000003cf,0x000003c4,0x0004003d,
+0x00000006,0x000003d0,0x000003c4,0x00070050,
+0x00000049,0x000003d1,0x000003ce,0x000003cf,
+0x000003d0,0x000003b5,0x0003003e,0x000003b7,
+0x000003d1,0x000200f9,0x000003b0,0x000200f8,
+0x000003a7,0x0004003d,0x00000006,0x000003d3,
+0x0000036a,0x0004003d,0x00000006,0x000003d4,
+0x0000036a,0x0004003d,0x00000006,0x000003d5,
+0x0000036a,0x0004003d,0x00000006,0x000003d6,
+0x00000379,0x00070050,0x00000049,0x000003d7,
+0x000003d3,0x000003d4,0x000003d5,0x000003d6,
+0x0003003e,0x000003b1,0x000003d7,0x0004003d,
+0x00000006,0x000003d8,0x00000372,0x0004003d,
+0x00000006,0x000003d9,0x00000372,0x0004003d,
+0x00000006,0x000003da,0x00000372,0x0004003d,
+0x00000006,0x000003db,0x00000380,0x00070050,
+0x00000049,0x000003dc,0x000003d8,0x000003d9,
+0x000003da,0x000003db,0x0003003e,0x000003b7,
+0x000003dc,0x000200f9,0x000003b0,0x000200f8,
+0x000003a8,0x0004003d,0x00000006,0x000003df,
+0x00000372,0x0003003e,0x000003de,0x000003df,
+0x0004003d,0x00000006,0x000003e1,0x0000036a,
+0x0003003e,0x000003e0,0x000003e1,0x00060039,
+0x00000002,0x000003e2,0x00000053,0x000003de,
+0x000003e0,0x0004003d,0x00000006,0x000003e3,
+0x000003de,0x0003003e,0x00000372,0x000003e3,
+0x0004003d,0x00000006,0x000003e4,0x000003e0,
+0x0003003e,0x0000036a,0x000003e4,0x0004003d,
+0x00000006,0x000003e6,0x00000380,0x0003003e,
+0x000003e5,0x000003e6,0x0004003d,0x00000006,
+0x000003e8,0x00000379,0x0003003e,0x000003e7,
+0x000003e8,0x00060039,0x00000002,0x000003e9,
+0x00000053,0x000003e5,0x000003e7,0x0004003d,
+0x00000006,0x000003ea,0x000003e5,0x0003003e,
+0x00000380,0x000003ea,0x0004003d,0x00000006,
+0x000003eb,0x000003e7,0x0003003e,0x00000379,
+0x000003eb,0x0004003d,0x00000006,0x000003ec,
+0x0000036a,0x0004003d,0x00000006,0x000003ed,
+0x0000036a,0x0004003d,0x00000006,0x000003ee,
+0x0000036a,0x0004003d,0x00000006,0x000003ef,
+0x00000379,0x00070050,0x00000049,0x000003f0,
+0x000003ec,0x000003ed,0x000003ee,0x000003ef,
+0x00070050,0x00000049,0x000003f1,0x00000109,
+0x00000109,0x00000109,0x00000109,0x00070050,
+0x00000049,0x000003f2,0x000003b5,0x000003b5,
+0x000003b5,0x000003b5,0x0008000c,0x00000049,
+0x000003f3,0x00000001,0x0000002d,0x000003f0,
+0x000003f1,0x000003f2,0x0003003e,0x000003b1,
+0x000003f3,0x0004003d,0x00000006,0x000003f5,
+0x0000036a,0x0004003d,0x00000006,0x000003f6,
+0x00000372,0x00050080,0x00000006,0x000003f7,
+0x000003f5,0x000003f6,0x0003003e,0x000003f4,
+0x000003f7,0x0004003d,0x00000006,0x000003f8,
+0x000003f4,0x0004003d,0x00000006,0x000003f9,
+0x000003f4,0x0004003d,0x00000006,0x000003fa,
+0x000003f4,0x0004003d,0x00000006,0x000003fb,
+0x00000379,0x0004003d,0x00000006,0x000003fc,
+0x00000380,0x00050080,0x00000006,0x000003fd,
+0x000003fb,0x000003fc,0x00070050,0x00000049,
+0x000003fe,0x000003f8,0x000003f9,0x000003fa,
+0x000003fd,0x00070050,0x00000049,0x000003ff,
+0x00000109,0x00000109,0x00000109,0x00000109,
+0x00070050,0x00000049,0x00000400,0x000003b5,
+0x000003b5,0x000003b5,0x000003b5,0x0008000c,
+0x00000049,0x00000401,0x00000001,0x0000002d,
+0x000003fe,0x000003ff,0x00000400,0x0003003e,
+0x000003b7,0x00000401,0x000200f9,0x000003b0,
+0x000200f8,0x000003a9,0x0004003d,0x00000006,
+0x00000403,0x0000036a,0x0004003d,0x00000006,
+0x00000404,0x00000372,0x0004003d,0x00000006,
+0x00000405,0x00000379,0x00070050,0x00000049,
+0x00000406,0x00000403,0x00000404,0x00000405,
+0x000003b5,0x0003003e,0x000003b7,0x00000406,
+0x0003003e,0x00000407,0x00000109,0x000200f9,
+0x00000408,0x000200f8,0x00000408,0x000400f6,
+0x0000040a,0x0000040b,0x00000000,0x000200f9,
+0x0000040c,0x000200f8,0x0000040c,0x0004003d,
+0x00000006,0x0000040d,0x00000407,0x000500b1,
+0x00000099,0x0000040e,0x0000040d,0x00000269,
+0x000400fa,0x0000040e,0x00000409,0x0000040a,
+0x000200f8,0x00000409,0x0004003d,0x00000006,
+0x00000410,0x00000407,0x00050041,0x0000000f,
+0x00000411,0x000003b7,0x00000410,0x0004003d,
+0x00000006,0x00000412,0x00000411,0x0003003e,
+0x0000040f,0x00000412,0x0004003d,0x00000006,
+0x00000413,0x00000407,0x0004003d,0x00000006,
+0x00000414,0x0000040f,0x0004003d,0x00000006,
+0x00000415,0x00000380,0x00050084,0x00000006,
+0x00000416,0x00000414,0x00000415,0x000500c3,
+0x00000006,0x00000418,0x00000416,0x00000417,
+0x00050041,0x0000000f,0x00000419,0x000003b1,
+0x00000413,0x0003003e,0x00000419,0x00000418,
+0x000200f9,0x0000040b,0x000200f8,0x0000040b,
+0x0004003d,0x00000006,0x0000041a,0x00000407,
+0x00050080,0x00000006,0x0000041b,0x0000041a,
+0x0000008e,0x0003003e,0x00000407,0x0000041b,
+0x000200f9,0x00000408,0x000200f8,0x0000040a,
+0x00050041,0x0000000f,0x0000041c,0x000003b1,
+0x0000003c,0x0003003e,0x0000041c,0x000003b5,
+0x000200f9,0x000003b0,0x000200f8,0x000003aa,
+0x0004003d,0x00000006,0x0000041f,0x0000036a,
+0x0004003d,0x00000006,0x00000420,0x00000379,
+0x00050080,0x00000006,0x00000421,0x0000041f,
+0x00000420,0x0004003d,0x00000006,0x00000422,
+0x00000387,0x00050080,0x00000006,0x00000423,
+0x00000421,0x00000422,0x0003003e,0x0000041e,
+0x00000423,0x0004003d,0x00000006,0x00000425,
+0x00000372,0x0004003d,0x00000006,0x00000426,
+0x00000380,0x00050080,0x00000006,0x00000427,
+0x00000425,0x00000426,0x0004003d,0x00000006,
+0x00000428,0x0000038e,0x00050080,0x00000006,
+0x00000429,0x00000427,0x00000428,0x0003003e,
+0x00000424,0x00000429,0x0004003d,0x00000006,
+0x0000042a,0x0000036a,0x0004003d,0x00000006,
+0x0000042b,0x00000379,0x0004003d,0x00000006,
+0x0000042c,0x00000387,0x00070050,0x00000049,
+0x0000042d,0x0000042a,0x0000042b,0x0000042c,
+0x000003b5,0x0003003e,0x000003b1,0x0000042d,
+0x0004003d,0x00000006,0x0000042e,0x00000372,
+0x0004003d,0x00000006,0x0000042f,0x00000380,
+0x0004003d,0x00000006,0x00000430,0x0000038e,
+0x00070050,0x00000049,0x00000431,0x0000042e,
+0x0000042f,0x00000430,0x000003b5,0x0003003e,
+0x000003b7,0x00000431,0x0004003d,0x00000006,
+0x00000432,0x00000424,0x0004003d,0x00000006,
+0x00000433,0x0000041e,0x000500b1,0x00000099,
+0x00000434,0x00000432,0x00000433,0x000300f7,
+0x00000436,0x00000000,0x000400fa,0x00000434,
+0x00000435,0x00000436,0x000200f8,0x00000435,
+0x0004003d,0x00000049,0x00000438,0x000003b1,
+0x0003003e,0x00000437,0x00000438,0x0004003d,
+0x00000049,0x0000043a,0x000003b7,0x0003003e,
+0x00000439,0x0000043a,0x00060039,0x00000002,
+0x0000043b,0x0000004e,0x00000437,0x00000439,
+0x0004003d,0x00000049,0x0000043c,0x00000437,
+0x0003003e,0x000003b1,0x0000043c,0x0004003d,
+0x00000049,0x0000043d,0x00000439,0x0003003e,
+0x000003b7,0x0000043d,0x0004003d,0x00000049,
+0x0000043f,0x000003b1,0x0003003e,0x0000043e,
+0x0000043f,0x00050039,0x00000002,0x00000440,
+0x00000057,0x0000043e,0x0004003d,0x00000049,
+0x00000441,0x0000043e,0x0003003e,0x000003b1,
+0x00000441,0x0004003d,0x00000049,0x00000443,
+0x000003b7,0x0003003e,0x00000442,0x00000443,
+0x00050039,0x00000002,0x00000444,0x00000057,
+0x00000442,0x0004003d,0x00000049,0x00000445,
+0x00000442,0x0003003e,0x000003b7,0x00000445,
+0x000200f9,0x00000436,0x000200f8,0x00000436,
+0x000200f9,0x000003b0,0x000200f8,0x000003ab,
+0x0004003d,0x00000006,0x00000448,0x00000372,
+0x0003003e,0x00000447,0x00000448,0x0004003d,
+0x00000006,0x0000044a,0x0000036a,0x0003003e,
+0x00000449,0x0000044a,0x00060039,0x00000002,
+0x0000044b,0x00000053,0x00000447,0x00000449,
+0x0004003d,0x00000006,0x0000044c,0x00000447,
+0x0003003e,0x00000372,0x0000044c,0x0004003d,
+0x00000006,0x0000044d,0x00000449,0x0003003e,
+0x0000036a,0x0000044d,0x0004003d,0x00000006,
+0x0000044f,0x00000380,0x0003003e,0x0000044e,
+0x0000044f,0x0004003d,0x00000006,0x00000451,
+0x00000379,0x0003003e,0x00000450,0x00000451,
+0x00060039,0x00000002,0x00000452,0x00000053,
+0x0000044e,0x00000450,0x0004003d,0x00000006,
+0x00000453,0x0000044e,0x0003003e,0x00000380,
+0x00000453,0x0004003d,0x00000006,0x00000454,
+0x00000450,0x0003003e,0x00000379,0x00000454,
+0x0004003d,0x00000006,0x00000456,0x0000038e,
+0x0003003e,0x00000455,0x00000456,0x0004003d,
+0x00000006,0x00000458,0x00000387,0x0003003e,
+0x00000457,0x00000458,0x00060039,0x00000002,
+0x00000459,0x00000053,0x00000455,0x00000457,
+0x0004003d,0x00000006,0x0000045a,0x00000455,
+0x0003003e,0x0000038e,0x0000045a,0x0004003d,
+0x00000006,0x0000045b,0x00000457,0x0003003e,
+0x00000387,0x0000045b,0x0004003d,0x00000006,
+0x0000045c,0x0000036a,0x0004003d,0x00000006,
+0x0000045d,0x00000379,0x0004003d,0x00000006,
+0x0000045e,0x00000387,0x00070050,0x00000049,
+0x0000045f,0x0000045c,0x0000045d,0x0000045e,
+0x000003b5,0x0003003e,0x000003b1,0x0000045f,
+0x0004003d,0x00000006,0x00000460,0x0000036a,
+0x0004003d,0x00000006,0x00000461,0x00000372,
+0x00050080,0x00000006,0x00000462,0x00000460,
+0x00000461,0x0004003d,0x00000006,0x00000463,
+0x00000379,0x0004003d,0x00000006,0x00000464,
+0x00000380,0x00050080,0x00000006,0x00000465,
+0x00000463,0x00000464,0x0004003d,0x00000006,
+0x00000466,0x00000387,0x0004003d,0x00000006,
+0x00000467,0x0000038e,0x00050080,0x00000006,
+0x00000468,0x00000466,0x00000467,0x00070050,
+0x00000049,0x00000469,0x00000462,0x00000465,
+0x00000468,0x000003b5,0x0003003e,0x000003b7,
+0x00000469,0x0004003d,0x00000006,0x0000046a,
+0x00000372,0x0004003d,0x00000006,0x0000046b,
+0x00000380,0x00050080,0x00000006,0x0000046c,
+0x0000046a,0x0000046b,0x0004003d,0x00000006,
+0x0000046d,0x0000038e,0x00050080,0x00000006,
+0x0000046e,0x0000046c,0x0000046d,0x000500b1,
+0x00000099,0x0000046f,0x0000046e,0x00000109,
+0x000300f7,0x00000471,0x00000000,0x000400fa,
+0x0000046f,0x00000470,0x00000471,0x000200f8,
+0x00000470,0x0004003d,0x00000049,0x00000473,
+0x000003b1,0x0003003e,0x00000472,0x00000473,
+0x0004003d,0x00000049,0x00000475,0x000003b7,
+0x0003003e,0x00000474,0x00000475,0x00060039,
+0x00000002,0x00000476,0x0000004e,0x00000472,
+0x00000474,0x0004003d,0x00000049,0x00000477,
+0x00000472,0x0003003e,0x000003b1,0x00000477,
+0x0004003d,0x00000049,0x00000478,0x00000474,
+0x0003003e,0x000003b7,0x00000478,0x0004003d,
+0x00000049,0x0000047a,0x000003b1,0x0003003e,
+0x00000479,0x0000047a,0x00050039,0x00000002,
+0x0000047b,0x00000057,0x00000479,0x0004003d,
+0x00000049,0x0000047c,0x00000479,0x0003003e,
+0x000003b1,0x0000047c,0x0004003d,0x00000049,
+0x0000047e,0x000003b7,0x0003003e,0x0000047d,
+0x0000047e,0x00050039,0x00000002,0x0000047f,
+0x00000057,0x0000047d,0x0004003d,0x00000049,
+0x00000480,0x0000047d,0x0003003e,0x000003b7,
+0x00000480,0x000200f9,0x00000471,0x000200f8,
+0x00000471,0x0004003d,0x00000049,0x00000481,
+0x000003b1,0x00070050,0x00000049,0x00000482,
+0x00000109,0x00000109,0x00000109,0x00000109,
+0x00070050,0x00000049,0x00000483,0x000003b5,
+0x000003b5,0x000003b5,0x000003b5,0x0008000c,
+0x00000049,0x00000484,0x00000001,0x0000002d,
+0x00000481,0x00000482,0x00000483,0x0003003e,
+0x000003b1,0x00000484,0x0004003d,0x00000049,
+0x00000485,0x000003b7,0x00070050,0x00000049,
+0x00000486,0x00000109,0x00000109,0x00000109,
+0x00000109,0x00070050,0x00000049,0x00000487,
+0x000003b5,0x000003b5,0x000003b5,0x000003b5,
+0x0008000c,0x00000049,0x00000488,0x00000001,
+0x0000002d,0x00000485,0x00000486,0x00000487,
+0x0003003e,0x000003b7,0x00000488,0x000200f9,
+0x000003b0,0x000200f8,0x000003ac,0x0004003d,
+0x00000006,0x0000048a,0x0000036a,0x0004003d,
+0x00000006,0x0000048b,0x00000372,0x0004003d,
+0x00000006,0x0000048c,0x00000379,0x00070050,
+0x00000049,0x0000048d,0x0000048a,0x0000048b,
+0x0000048c,0x000003b5,0x0003003e,0x000003b7,
+0x0000048d,0x0003003e,0x000003b1,0x0000048d,
+0x0004003d,0x00000049,0x0000048e,0x000003b1,
+0x0004003d,0x00000006,0x0000048f,0x00000380,
+0x00070050,0x00000049,0x00000490,0x0000048f,
+0x0000048f,0x0000048f,0x0000048f,0x00050084,
+0x00000049,0x00000491,0x0000048e,0x00000490,
+0x00070050,0x00000049,0x00000492,0x00000417,
+0x00000417,0x00000417,0x00000417,0x000500c3,
+0x00000049,0x00000493,0x00000491,0x00000492,
+0x0003003e,0x000003b1,0x00000493,0x0004003d,
+0x00000006,0x00000494,0x00000387,0x00050041,
+0x0000000f,0x00000495,0x000003b1,0x0000003c,
+0x0003003e,0x00000495,0x00000494,0x0004003d,
+0x00000006,0x00000496,0x0000038e,0x00050041,
+0x0000000f,0x00000497,0x000003b7,0x0000003c,
+0x0003003e,0x00000497,0x00000496,0x000200f9,
+0x000003b0,0x000200f8,0x000003ad,0x0004003d,
+0x00000006,0x0000049a,0x0000036a,0x0004003d,
+0x00000006,0x0000049b,0x00000379,0x00050080,
+0x00000006,0x0000049c,0x0000049a,0x0000049b,
+0x0004003d,0x00000006,0x0000049d,0x00000387,
+0x00050080,0x00000006,0x0000049e,0x0000049c,
+0x0000049d,0x0004007c,0x0000000d,0x0000049f,
+0x0000049e,0x0003003e,0x00000499,0x0000049f,
+0x0004003d,0x00000006,0x000004a1,0x00000372,
+0x0004003d,0x00000006,0x000004a2,0x00000380,
+0x00050080,0x00000006,0x000004a3,0x000004a1,
+0x000004a2,0x0004003d,0x00000006,0x000004a4,
+0x0000038e,0x00050080,0x00000006,0x000004a5,
+0x000004a3,0x000004a4,0x0004007c,0x0000000d,
+0x000004a6,0x000004a5,0x0003003e,0x000004a0,
+0x000004a6,0x0004003d,0x00000006,0x000004a7,
+0x0000036a,0x0004003d,0x00000006,0x000004a8,
+0x00000379,0x0004003d,0x00000006,0x000004a9,
+0x00000387,0x0004003d,0x00000006,0x000004aa,
+0x00000395,0x00070050,0x00000049,0x000004ab,
+0x000004a7,0x000004a8,0x000004a9,0x000004aa,
+0x0003003e,0x000003b1,0x000004ab,0x0004003d,
+0x00000006,0x000004ac,0x00000372,0x0004003d,
+0x00000006,0x000004ad,0x00000380,0x0004003d,
+0x00000006,0x000004ae,0x0000038e,0x0004003d,
+0x00000006,0x000004af,0x0000039d,0x00070050,
+0x00000049,0x000004b0,0x000004ac,0x000004ad,
+0x000004ae,0x000004af,0x0003003e,0x000003b7,
+0x000004b0,0x0004003d,0x0000000d,0x000004b1,
+0x000004a0,0x0004003d,0x0000000d,0x000004b2,
+0x00000499,0x000500b0,0x00000099,0x000004b3,
+0x000004b1,0x000004b2,0x000300f7,0x000004b5,
+0x00000000,0x000400fa,0x000004b3,0x000004b4,
+0x000004b5,0x000200f8,0x000004b4,0x0004003d,
+0x00000049,0x000004b7,0x000003b1,0x0003003e,
+0x000004b6,0x000004b7,0x0004003d,0x00000049,
+0x000004b9,0x000003b7,0x0003003e,0x000004b8,
+0x000004b9,0x00060039,0x00000002,0x000004ba,
+0x0000004e,0x000004b6,0x000004b8,0x0004003d,
+0x00000049,0x000004bb,0x000004b6,0x0003003e,
+0x000003b1,0x000004bb,0x0004003d,0x00000049,
+0x000004bc,0x000004b8,0x0003003e,0x000003b7,
+0x000004bc,0x0004003d,0x00000049,0x000004be,
+0x000003b1,0x0003003e,0x000004bd,0x000004be,
+0x00050039,0x00000002,0x000004bf,0x00000057,
+0x000004bd,0x0004003d,0x00000049,0x000004c0,
+0x000004bd,0x0003003e,0x000003b1,0x000004c0,
+0x0004003d,0x00000049,0x000004c2,0x000003b7,
+0x0003003e,0x000004c1,0x000004c2,0x00050039,
+0x00000002,0x000004c3,0x00000057,0x000004c1,
+0x0004003d,0x00000049,0x000004c4,0x000004c1,
+0x0003003e,0x000003b7,0x000004c4,0x000200f9,
+0x000004b5,0x000200f8,0x000004b5,0x000200f9,
+0x000003b0,0x000200f8,0x000003ae,0x0004003d,
+0x00000006,0x000004c7,0x00000372,0x0003003e,
+0x000004c6,0x000004c7,0x0004003d,0x00000006,
+0x000004c9,0x0000036a,0x0003003e,0x000004c8,
+0x000004c9,0x00060039,0x00000002,0x000004ca,
+0x00000053,0x000004c6,0x000004c8,0x0004003d,
+0x00000006,0x000004cb,0x000004c6,0x0003003e,
+0x00000372,0x000004cb,0x0004003d,0x00000006,
+0x000004cc,0x000004c8,0x0003003e,0x0000036a,
+0x000004cc,0x0004003d,0x00000006,0x000004ce,
+0x00000380,0x0003003e,0x000004cd,0x000004ce,
+0x0004003d,0x00000006,0x000004d0,0x00000379,
+0x0003003e,0x000004cf,0x000004d0,0x00060039,
+0x00000002,0x000004d1,0x00000053,0x000004cd,
+0x000004cf,0x0004003d,0x00000006,0x000004d2,
+0x000004cd,0x0003003e,0x00000380,0x000004d2,
+0x0004003d,0x00000006,0x000004d3,0x000004cf,
+0x0003003e,0x00000379,0x000004d3,0x0004003d,
+0x00000006,0x000004d5,0x0000038e,0x0003003e,
+0x000004d4,0x000004d5,0x0004003d,0x00000006,
+0x000004d7,0x00000387,0x0003003e,0x000004d6,
+0x000004d7,0x00060039,0x00000002,0x000004d8,
+0x00000053,0x000004d4,0x000004d6,0x0004003d,
+0x00000006,0x000004d9,0x000004d4,0x0003003e,
+0x0000038e,0x000004d9,0x0004003d,0x00000006,
+0x000004da,0x000004d6,0x0003003e,0x00000387,
+0x000004da,0x0004003d,0x00000006,0x000004dc,
+0x0000039d,0x0003003e,0x000004db,0x000004dc,
+0x0004003d,0x00000006,0x000004de,0x00000395,
+0x0003003e,0x000004dd,0x000004de,0x00060039,
+0x00000002,0x000004df,0x00000053,0x000004db,
+0x000004dd,0x0004003d,0x00000006,0x000004e0,
+0x000004db,0x0003003e,0x0000039d,0x000004e0,
+0x0004003d,0x00000006,0x000004e1,0x000004dd,
+0x0003003e,0x00000395,0x000004e1,0x0004003d,
+0x00000006,0x000004e2,0x0000036a,0x0004003d,
+0x00000006,0x000004e3,0x00000379,0x0004003d,
+0x00000006,0x000004e4,0x00000387,0x0004003d,
+0x00000006,0x000004e5,0x00000395,0x00070050,
+0x00000049,0x000004e6,0x000004e2,0x000004e3,
+0x000004e4,0x000004e5,0x0003003e,0x000003b1,
+0x000004e6,0x0004003d,0x00000006,0x000004e7,
+0x0000036a,0x0004003d,0x00000006,0x000004e8,
+0x00000372,0x00050080,0x00000006,0x000004e9,
+0x000004e7,0x000004e8,0x0004003d,0x00000006,
+0x000004ea,0x00000379,0x0004003d,0x00000006,
+0x000004eb,0x00000380,0x00050080,0x00000006,
+0x000004ec,0x000004ea,0x000004eb,0x0004003d,
+0x00000006,0x000004ed,0x00000387,0x0004003d,
+0x00000006,0x000004ee,0x0000038e,0x00050080,
+0x00000006,0x000004ef,0x000004ed,0x000004ee,
+0x0004003d,0x00000006,0x000004f0,0x00000395,
+0x0004003d,0x00000006,0x000004f1,0x0000039d,
+0x00050080,0x00000006,0x000004f2,0x000004f0,
+0x000004f1,0x00070050,0x00000049,0x000004f3,
+0x000004e9,0x000004ec,0x000004ef,0x000004f2,
+0x0003003e,0x000003b7,0x000004f3,0x0004003d,
+0x00000006,0x000004f4,0x00000372,0x0004003d,
+0x00000006,0x000004f5,0x00000380,0x00050080,
+0x00000006,0x000004f6,0x000004f4,0x000004f5,
+0x0004003d,0x00000006,0x000004f7,0x0000038e,
+0x00050080,0x00000006,0x000004f8,0x000004f6,
+0x000004f7,0x000500b1,0x00000099,0x000004f9,
+0x000004f8,0x00000109,0x000300f7,0x000004fb,
+0x00000000,0x000400fa,0x000004f9,0x000004fa,
+0x000004fb,0x000200f8,0x000004fa,0x0004003d,
+0x00000049,0x000004fd,0x000003b1,0x0003003e,
+0x000004fc,0x000004fd,0x0004003d,0x00000049,
+0x000004ff,0x000003b7,0x0003003e,0x000004fe,
+0x000004ff,0x00060039,0x00000002,0x00000500,
+0x0000004e,0x000004fc,0x000004fe,0x0004003d,
+0x00000049,0x00000501,0x000004fc,0x0003003e,
+0x000003b1,0x00000501,0x0004003d,0x00000049,
+0x00000502,0x000004fe,0x0003003e,0x000003b7,
+0x00000502,0x0004003d,0x00000049,0x00000504,
+0x000003b1,0x0003003e,0x00000503,0x00000504,
+0x00050039,0x00000002,0x00000505,0x00000057,
+0x00000503,0x0004003d,0x00000049,0x00000506,
+0x00000503,0x0003003e,0x000003b1,0x00000506,
+0x0004003d,0x00000049,0x00000508,0x000003b7,
+0x0003003e,0x00000507,0x00000508,0x00050039,
+0x00000002,0x00000509,0x00000057,0x00000507,
+0x0004003d,0x00000049,0x0000050a,0x00000507,
+0x0003003e,0x000003b7,0x0000050a,0x000200f9,
+0x000004fb,0x000200f8,0x000004fb,0x0004003d,
+0x00000049,0x0000050b,0x000003b1,0x00070050,
+0x00000049,0x0000050c,0x00000109,0x00000109,
+0x00000109,0x00000109,0x00070050,0x00000049,
+0x0000050d,0x000003b5,0x000003b5,0x000003b5,
+0x000003b5,0x0008000c,0x00000049,0x0000050e,
+0x00000001,0x0000002d,0x0000050b,0x0000050c,
+0x0000050d,0x0003003e,0x000003b1,0x0000050e,
+0x0004003d,0x00000049,0x0000050f,0x000003b7,
+0x00070050,0x00000049,0x00000510,0x00000109,
+0x00000109,0x00000109,0x00000109,0x00070050,
+0x00000049,0x00000511,0x000003b5,0x000003b5,
+0x000003b5,0x000003b5,0x0008000c,0x00000049,
+0x00000512,0x00000001,0x0000002d,0x0000050f,
+0x00000510,0x00000511,0x0003003e,0x000003b7,
+0x00000512,0x000200f9,0x000003b0,0x000200f8,
+0x000003b0,0x0004003d,0x00000049,0x00000516,
+0x000003b1,0x0004007c,0x00000015,0x00000517,
+0x00000516,0x0003003e,0x0000005f,0x00000517,
+0x0004003d,0x00000049,0x00000518,0x000003b7,
+0x0004007c,0x00000015,0x00000519,0x00000518,
+0x0003003e,0x00000060,0x00000519,0x000100fd,
+0x00010038,0x00050036,0x0000000d,0x00000064,
+0x00000000,0x00000045,0x00030037,0x0000000e,
+0x00000063,0x000200f8,0x00000065,0x0004003d,
+0x0000000d,0x0000051a,0x00000063,0x000500c2,
+0x0000000d,0x0000051c,0x0000051a,0x0000051b,
+0x0004003d,0x0000000d,0x0000051d,0x00000063,
+0x000500c6,0x0000000d,0x0000051e,0x0000051d,
+0x0000051c,0x0003003e,0x00000063,0x0000051e,
+0x0004003d,0x0000000d,0x0000051f,0x00000063,
+0x000500c4,0x0000000d,0x00000521,0x0000051f,
+0x00000520,0x0004003d,0x0000000d,0x00000522,
+0x00000063,0x00050082,0x0000000d,0x00000523,
+0x00000522,0x00000521,0x0003003e,0x00000063,
+0x00000523,0x0004003d,0x0000000d,0x00000524,
+0x00000063,0x000500c4,0x0000000d,0x00000526,
+0x00000524,0x00000525,0x0004003d,0x0000000d,
+0x00000527,0x00000063,0x00050080,0x0000000d,
+0x00000528,0x00000527,0x00000526,0x0003003e,
+0x00000063,0x00000528,0x0004003d,0x0000000d,
+0x00000529,0x00000063,0x000500c4,0x0000000d,
+0x0000052b,0x00000529,0x0000052a,0x0004003d,
+0x0000000d,0x0000052c,0x00000063,0x00050080,
+0x0000000d,0x0000052d,0x0000052c,0x0000052b,
+0x0003003e,0x00000063,0x0000052d,0x0004003d,
+0x0000000d,0x0000052e,0x00000063,0x000500c2,
+0x0000000d,0x0000052f,0x0000052e,0x00000110,
+0x0004003d,0x0000000d,0x00000530,0x00000063,
+0x000500c6,0x0000000d,0x00000531,0x00000530,
+0x0000052f,0x0003003e,0x00000063,0x00000531,
+0x0004003d,0x0000000d,0x00000532,0x00000063,
+0x000500c4,0x0000000d,0x00000534,0x00000532,
+0x00000533,0x0004003d,0x0000000d,0x00000535,
+0x00000063,0x00050080,0x0000000d,0x00000536,
+0x00000535,0x00000534,0x0003003e,0x00000063,
+0x00000536,0x0004003d,0x0000000d,0x00000537,
+0x00000063,0x000500c2,0x0000000d,0x00000538,
+0x00000537,0x00000525,0x0004003d,0x0000000d,
+0x00000539,0x00000063,0x000500c6,0x0000000d,
+0x0000053a,0x00000539,0x00000538,0x0003003e,
+0x00000063,0x0000053a,0x0004003d,0x0000000d,
+0x0000053b,0x00000063,0x000500c2,0x0000000d,
+0x0000053c,0x0000053b,0x00000269,0x0004003d,
+0x0000000d,0x0000053d,0x00000063,0x000500c6,
+0x0000000d,0x0000053e,0x0000053d,0x0000053c,
+0x0003003e,0x00000063,0x0000053e,0x0004003d,
+0x0000000d,0x0000053f,0x00000063,0x000500c4,
+0x0000000d,0x00000541,0x0000053f,0x00000540,
+0x0004003d,0x0000000d,0x00000542,0x00000063,
+0x000500c6,0x0000000d,0x00000543,0x00000542,
+0x00000541,0x0003003e,0x00000063,0x00000543,
+0x0004003d,0x0000000d,0x00000544,0x00000063,
+0x000500c2,0x0000000d,0x00000545,0x00000544,
+0x00000520,0x0004003d,0x0000000d,0x00000546,
+0x00000063,0x000500c6,0x0000000d,0x00000547,
+0x00000546,0x00000545,0x0003003e,0x00000063,
+0x00000547,0x0004003d,0x0000000d,0x00000548,
+0x00000063,0x000200fe,0x00000548,0x00010038,
+0x00050036,0x0000000d,0x0000006a,0x00000000,
+0x00000024,0x00030037,0x0000000e,0x00000066,
+0x00030037,0x0000000e,0x00000067,0x00030037,
+0x0000000e,0x00000068,0x00030037,0x0000000e,
+0x00000069,0x000200f8,0x0000006b,0x0004003b,
+0x0000000e,0x00000550,0x00000007,0x0004003b,
+0x0000000e,0x00000565,0x00000007,0x0004003b,
+0x0000000e,0x00000566,0x00000007,0x0004003b,
+0x0000000e,0x00000569,0x00000007,0x0004003b,
+0x0000000e,0x0000056d,0x00000007,0x0004003b,
+0x0000000e,0x00000571,0x00000007,0x0004003b,
+0x0000000e,0x00000575,0x00000007,0x0004003b,
+0x0000000e,0x0000057a,0x00000007,0x0004003b,
+0x0000000e,0x0000057e,0x00000007,0x0004003b,
+0x0000000e,0x00000583,0x00000007,0x0004003b,
+0x0000000e,0x00000588,0x00000007,0x0004003b,
+0x0000000e,0x0000058d,0x00000007,0x0004003b,
+0x0000000e,0x00000592,0x00000007,0x0004003b,
+0x0000000e,0x00000597,0x00000007,0x0004003b,
+0x0000000e,0x0000059c,0x00000007,0x0004003b,
+0x0000000e,0x000005cd,0x00000007,0x0004003b,
+0x0000000e,0x000005d3,0x00000007,0x0004003b,
+0x0000000e,0x000005e2,0x00000007,0x0004003b,
+0x0000000e,0x0000060e,0x00000007,0x0004003b,
+0x0000000e,0x0000061e,0x00000007,0x0004003b,
+0x0000000e,0x0000062e,0x00000007,0x0004003b,
+0x0000000e,0x0000063d,0x00000007,0x0004003d,
+0x0000000d,0x0000054b,0x00000069,0x000500aa,
+0x00000099,0x0000054c,0x0000054b,0x00000082,
+0x000300f7,0x0000054e,0x00000000,0x000400fa,
+0x0000054c,0x0000054d,0x0000054e,0x000200f8,
+0x0000054d,0x000200fe,0x000000c9,0x000200f8,
+0x0000054e,0x0003003e,0x00000550,0x000000c9,
+0x00050041,0x00000555,0x00000556,0x00000554,
+0x00000124,0x0004003d,0x0000000d,0x00000557,
+0x00000556,0x000500ab,0x00000099,0x00000558,
+0x00000557,0x000000c9,0x000300f7,0x0000055a,
+0x00000000,0x000400fa,0x00000558,0x00000559,
+0x0000055a,0x000200f8,0x00000559,0x0004003d,
+0x0000000d,0x0000055b,0x00000067,0x000500c4,
+0x0000000d,0x0000055c,0x0000055b,0x0000008e,
+0x0003003e,0x00000067,0x0000055c,0x0004003d,
+0x0000000d,0x0000055d,0x00000068,0x000500c4,
+0x0000000d,0x0000055e,0x0000055d,0x0000008e,
+0x0003003e,0x00000068,0x0000055e,0x000200f9,
+0x0000055a,0x000200f8,0x0000055a,0x0004003d,
+0x0000000d,0x0000055f,0x00000069,0x00050082,
+0x0000000d,0x00000560,0x0000055f,0x00000082,
+0x00050084,0x0000000d,0x00000562,0x00000560,
+0x00000561,0x0004003d,0x0000000d,0x00000563,
+0x00000066,0x00050080,0x0000000d,0x00000564,
+0x00000563,0x00000562,0x0003003e,0x00000066,
+0x00000564,0x0004003d,0x0000000d,0x00000567,
+0x00000066,0x0003003e,0x00000566,0x00000567,
+0x00050039,0x0000000d,0x00000568,0x00000064,
+0x00000566,0x0003003e,0x00000565,0x00000568,
+0x0004003d,0x0000000d,0x0000056a,0x00000565,
+0x000500c7,0x0000000d,0x0000056c,0x0000056a,
+0x0000056b,0x0003003e,0x00000569,0x0000056c,
+0x0004003d,0x0000000d,0x0000056e,0x00000565,
+0x000500c2,0x0000000d,0x0000056f,0x0000056e,
+0x0000052a,0x000500c7,0x0000000d,0x00000570,
+0x0000056f,0x0000056b,0x0003003e,0x0000056d,
+0x00000570,0x0004003d,0x0000000d,0x00000572,
+0x00000565,0x000500c2,0x0000000d,0x00000573,
+0x00000572,0x00000417,0x000500c7,0x0000000d,
+0x00000574,0x00000573,0x0000056b,0x0003003e,
+0x00000571,0x00000574,0x0004003d,0x0000000d,
+0x00000576,0x00000565,0x000500c2,0x0000000d,
+0x00000578,0x00000576,0x00000577,0x000500c7,
+0x0000000d,0x00000579,0x00000578,0x0000056b,
+0x0003003e,0x00000575,0x00000579,0x0004003d,
+0x0000000d,0x0000057b,0x00000565,0x000500c2,
+0x0000000d,0x0000057c,0x0000057b,0x00000533,
+0x000500c7,0x0000000d,0x0000057d,0x0000057c,
+0x0000056b,0x0003003e,0x0000057a,0x0000057d,
+0x0004003d,0x0000000d,0x0000057f,0x00000565,
+0x000500c2,0x0000000d,0x00000581,0x0000057f,
+0x00000580,0x000500c7,0x0000000d,0x00000582,
+0x00000581,0x0000056b,0x0003003e,0x0000057e,
+0x00000582,0x0004003d,0x0000000d,0x00000584,
+0x00000565,0x000500c2,0x0000000d,0x00000586,
+0x00000584,0x00000585,0x000500c7,0x0000000d,
+0x00000587,0x00000586,0x0000056b,0x0003003e,
+0x00000583,0x00000587,0x0004003d,0x0000000d,
+0x00000589,0x00000565,0x000500c2,0x0000000d,
+0x0000058b,0x00000589,0x0000058a,0x000500c7,
+0x0000000d,0x0000058c,0x0000058b,0x0000056b,
+0x0003003e,0x00000588,0x0000058c,0x0004003d,
+0x0000000d,0x0000058e,0x00000565,0x000500c2,
+0x0000000d,0x00000590,0x0000058e,0x0000058f,
+0x000500c7,0x0000000d,0x00000591,0x00000590,
+0x0000056b,0x0003003e,0x0000058d,0x00000591,
+0x0004003d,0x0000000d,0x00000593,0x00000565,
+0x000500c2,0x0000000d,0x00000595,0x00000593,
+0x00000594,0x000500c7,0x0000000d,0x00000596,
+0x00000595,0x0000056b,0x0003003e,0x00000592,
+0x00000596,0x0004003d,0x0000000d,0x00000598,
+0x00000565,0x000500c2,0x0000000d,0x0000059a,
+0x00000598,0x00000599,0x000500c7,0x0000000d,
+0x0000059b,0x0000059a,0x0000056b,0x0003003e,
+0x00000597,0x0000059b,0x0004003d,0x0000000d,
+0x0000059d,0x00000565,0x000500c2,0x0000000d,
+0x0000059f,0x0000059d,0x0000059e,0x0004003d,
+0x0000000d,0x000005a0,0x00000565,0x000500c4,
+0x0000000d,0x000005a1,0x000005a0,0x00000124,
+0x000500c5,0x0000000d,0x000005a2,0x0000059f,
+0x000005a1,0x000500c7,0x0000000d,0x000005a3,
+0x000005a2,0x0000056b,0x0003003e,0x0000059c,
+0x000005a3,0x0004003d,0x0000000d,0x000005a4,
+0x00000569,0x0004003d,0x0000000d,0x000005a5,
+0x00000569,0x00050084,0x0000000d,0x000005a6,
+0x000005a5,0x000005a4,0x0003003e,0x00000569,
+0x000005a6,0x0004003d,0x0000000d,0x000005a7,
+0x0000056d,0x0004003d,0x0000000d,0x000005a8,
+0x0000056d,0x00050084,0x0000000d,0x000005a9,
+0x000005a8,0x000005a7,0x0003003e,0x0000056d,
+0x000005a9,0x0004003d,0x0000000d,0x000005aa,
+0x00000571,0x0004003d,0x0000000d,0x000005ab,
+0x00000571,0x00050084,0x0000000d,0x000005ac,
+0x000005ab,0x000005aa,0x0003003e,0x00000571,
+0x000005ac,0x0004003d,0x0000000d,0x000005ad,
+0x00000575,0x0004003d,0x0000000d,0x000005ae,
+0x00000575,0x00050084,0x0000000d,0x000005af,
+0x000005ae,0x000005ad,0x0003003e,0x00000575,
+0x000005af,0x0004003d,0x0000000d,0x000005b0,
+0x0000057a,0x0004003d,0x0000000d,0x000005b1,
+0x0000057a,0x00050084,0x0000000d,0x000005b2,
+0x000005b1,0x000005b0,0x0003003e,0x0000057a,
+0x000005b2,0x0004003d,0x0000000d,0x000005b3,
+0x0000057e,0x0004003d,0x0000000d,0x000005b4,
+0x0000057e,0x00050084,0x0000000d,0x000005b5,
+0x000005b4,0x000005b3,0x0003003e,0x0000057e,
+0x000005b5,0x0004003d,0x0000000d,0x000005b6,
+0x00000583,0x0004003d,0x0000000d,0x000005b7,
+0x00000583,0x00050084,0x0000000d,0x000005b8,
+0x000005b7,0x000005b6,0x0003003e,0x00000583,
+0x000005b8,0x0004003d,0x0000000d,0x000005b9,
+0x00000588,0x0004003d,0x0000000d,0x000005ba,
+0x00000588,0x00050084,0x0000000d,0x000005bb,
+0x000005ba,0x000005b9,0x0003003e,0x00000588,
+0x000005bb,0x0004003d,0x0000000d,0x000005bc,
+0x0000058d,0x0004003d,0x0000000d,0x000005bd,
+0x0000058d,0x00050084,0x0000000d,0x000005be,
+0x000005bd,0x000005bc,0x0003003e,0x0000058d,
+0x000005be,0x0004003d,0x0000000d,0x000005bf,
+0x00000592,0x0004003d,0x0000000d,0x000005c0,
+0x00000592,0x00050084,0x0000000d,0x000005c1,
+0x000005c0,0x000005bf,0x0003003e,0x00000592,
+0x000005c1,0x0004003d,0x0000000d,0x000005c2,
+0x00000597,0x0004003d,0x0000000d,0x000005c3,
+0x00000597,0x00050084,0x0000000d,0x000005c4,
+0x000005c3,0x000005c2,0x0003003e,0x00000597,
+0x000005c4,0x0004003d,0x0000000d,0x000005c5,
+0x0000059c,0x0004003d,0x0000000d,0x000005c6,
+0x0000059c,0x00050084,0x0000000d,0x000005c7,
+0x000005c6,0x000005c5,0x0003003e,0x0000059c,
+0x000005c7,0x0004003d,0x0000000d,0x000005c8,
+0x00000066,0x000500c7,0x0000000d,0x000005c9,
+0x000005c8,0x00000082,0x000500ab,0x00000099,
+0x000005ca,0x000005c9,0x000000c9,0x000300f7,
+0x000005cc,0x00000000,0x000400fa,0x000005ca,
+0x000005cb,0x000005d8,0x000200f8,0x000005cb,
+0x0004003d,0x0000000d,0x000005ce,0x00000066,
+0x000500c7,0x0000000d,0x000005cf,0x000005ce,
+0x000000e7,0x000500ab,0x00000099,0x000005d0,
+0x000005cf,0x000000c9,0x000600a9,0x00000006,
+0x000005d1,0x000005d0,0x0000052a,0x00000110,
+0x0004007c,0x0000000d,0x000005d2,0x000005d1,
+0x0003003e,0x000005cd,0x000005d2,0x0004003d,
+0x0000000d,0x000005d4,0x00000069,0x000500aa,
+0x00000099,0x000005d5,0x000005d4,0x0000003c,
+0x000600a9,0x00000006,0x000005d6,0x000005d5,
+0x00000540,0x00000110,0x0004007c,0x0000000d,
+0x000005d7,0x000005d6,0x0003003e,0x000005d3,
+0x000005d7,0x000200f9,0x000005cc,0x000200f8,
+0x000005d8,0x0004003d,0x0000000d,0x000005d9,
+0x00000069,0x000500aa,0x00000099,0x000005da,
+0x000005d9,0x0000003c,0x000600a9,0x00000006,
+0x000005db,0x000005da,0x00000540,0x00000110,
+0x0004007c,0x0000000d,0x000005dc,0x000005db,
+0x0003003e,0x000005cd,0x000005dc,0x0004003d,
+0x0000000d,0x000005dd,0x00000066,0x000500c7,
+0x0000000d,0x000005de,0x000005dd,0x000000e7,
+0x000500ab,0x00000099,0x000005df,0x000005de,
+0x000000c9,0x000600a9,0x00000006,0x000005e0,
+0x000005df,0x0000052a,0x00000110,0x0004007c,
+0x0000000d,0x000005e1,0x000005e0,0x0003003e,
+0x000005d3,0x000005e1,0x000200f9,0x000005cc,
+0x000200f8,0x000005cc,0x0004003d,0x0000000d,
+0x000005e3,0x00000066,0x000500c7,0x0000000d,
+0x000005e5,0x000005e3,0x000005e4,0x000500ab,
+0x00000099,0x000005e6,0x000005e5,0x000000c9,
+0x0004003d,0x0000000d,0x000005e7,0x000005cd,
+0x0004003d,0x0000000d,0x000005e8,0x000005d3,
+0x000600a9,0x0000000d,0x000005e9,0x000005e6,
+0x000005e7,0x000005e8,0x0003003e,0x000005e2,
+0x000005e9,0x0004003d,0x0000000d,0x000005ea,
+0x000005cd,0x0004003d,0x0000000d,0x000005eb,
+0x00000569,0x000500c2,0x0000000d,0x000005ec,
+0x000005eb,0x000005ea,0x0003003e,0x00000569,
+0x000005ec,0x0004003d,0x0000000d,0x000005ed,
+0x000005d3,0x0004003d,0x0000000d,0x000005ee,
+0x0000056d,0x000500c2,0x0000000d,0x000005ef,
+0x000005ee,0x000005ed,0x0003003e,0x0000056d,
+0x000005ef,0x0004003d,0x0000000d,0x000005f0,
+0x000005cd,0x0004003d,0x0000000d,0x000005f1,
+0x00000571,0x000500c2,0x0000000d,0x000005f2,
+0x000005f1,0x000005f0,0x0003003e,0x00000571,
+0x000005f2,0x0004003d,0x0000000d,0x000005f3,
+0x000005d3,0x0004003d,0x0000000d,0x000005f4,
+0x00000575,0x000500c2,0x0000000d,0x000005f5,
+0x000005f4,0x000005f3,0x0003003e,0x00000575,
+0x000005f5,0x0004003d,0x0000000d,0x000005f6,
+0x000005cd,0x0004003d,0x0000000d,0x000005f7,
+0x0000057a,0x000500c2,0x0000000d,0x000005f8,
+0x000005f7,0x000005f6,0x0003003e,0x0000057a,
+0x000005f8,0x0004003d,0x0000000d,0x000005f9,
+0x000005d3,0x0004003d,0x0000000d,0x000005fa,
+0x0000057e,0x000500c2,0x0000000d,0x000005fb,
+0x000005fa,0x000005f9,0x0003003e,0x0000057e,
+0x000005fb,0x0004003d,0x0000000d,0x000005fc,
+0x000005cd,0x0004003d,0x0000000d,0x000005fd,
+0x00000583,0x000500c2,0x0000000d,0x000005fe,
+0x000005fd,0x000005fc,0x0003003e,0x00000583,
+0x000005fe,0x0004003d,0x0000000d,0x000005ff,
+0x000005d3,0x0004003d,0x0000000d,0x00000600,
+0x00000588,0x000500c2,0x0000000d,0x00000601,
+0x00000600,0x000005ff,0x0003003e,0x00000588,
+0x00000601,0x0004003d,0x0000000d,0x00000602,
+0x000005e2,0x0004003d,0x0000000d,0x00000603,
+0x0000058d,0x000500c2,0x0000000d,0x00000604,
+0x00000603,0x00000602,0x0003003e,0x0000058d,
+0x00000604,0x0004003d,0x0000000d,0x00000605,
+0x000005e2,0x0004003d,0x0000000d,0x00000606,
+0x00000592,0x000500c2,0x0000000d,0x00000607,
+0x00000606,0x00000605,0x0003003e,0x00000592,
+0x00000607,0x0004003d,0x0000000d,0x00000608,
+0x000005e2,0x0004003d,0x0000000d,0x00000609,
+0x00000597,0x000500c2,0x0000000d,0x0000060a,
+0x00000609,0x00000608,0x0003003e,0x00000597,
+0x0000060a,0x0004003d,0x0000000d,0x0000060b,
+0x000005e2,0x0004003d,0x0000000d,0x0000060c,
+0x0000059c,0x000500c2,0x0000000d,0x0000060d,
+0x0000060c,0x0000060b,0x0003003e,0x0000059c,
+0x0000060d,0x0004003d,0x0000000d,0x0000060f,
+0x00000569,0x0004003d,0x0000000d,0x00000610,
+0x00000067,0x00050084,0x0000000d,0x00000611,
+0x0000060f,0x00000610,0x0004003d,0x0000000d,
+0x00000612,0x0000056d,0x0004003d,0x0000000d,
+0x00000613,0x00000068,0x00050084,0x0000000d,
+0x00000614,0x00000612,0x00000613,0x00050080,
+0x0000000d,0x00000615,0x00000611,0x00000614,
+0x0004003d,0x0000000d,0x00000616,0x00000597,
+0x0004003d,0x0000000d,0x00000617,0x00000550,
+0x00050084,0x0000000d,0x00000618,0x00000616,
+0x00000617,0x00050080,0x0000000d,0x00000619,
+0x00000615,0x00000618,0x0004003d,0x0000000d,
+0x0000061a,0x00000565,0x000500c2,0x0000000d,
+0x0000061c,0x0000061a,0x0000061b,0x00050080,
+0x0000000d,0x0000061d,0x00000619,0x0000061c,
+0x0003003e,0x0000060e,0x0000061d,0x0004003d,
+0x0000000d,0x0000061f,0x00000571,0x0004003d,
+0x0000000d,0x00000620,0x00000067,0x00050084,
+0x0000000d,0x00000621,0x0000061f,0x00000620,
+0x0004003d,0x0000000d,0x00000622,0x00000575,
+0x0004003d,0x0000000d,0x00000623,0x00000068,
+0x00050084,0x0000000d,0x00000624,0x00000622,
+0x00000623,0x00050080,0x0000000d,0x00000625,
+0x00000621,0x00000624,0x0004003d,0x0000000d,
+0x00000626,0x0000059c,0x0004003d,0x0000000d,
+0x00000627,0x00000550,0x00050084,0x0000000d,
+0x00000628,0x00000626,0x00000627,0x00050080,
+0x0000000d,0x00000629,0x00000625,0x00000628,
+0x0004003d,0x0000000d,0x0000062a,0x00000565,
+0x000500c2,0x0000000d,0x0000062c,0x0000062a,
+0x0000062b,0x00050080,0x0000000d,0x0000062d,
+0x00000629,0x0000062c,0x0003003e,0x0000061e,
+0x0000062d,0x0004003d,0x0000000d,0x0000062f,
+0x0000057a,0x0004003d,0x0000000d,0x00000630,
+0x00000067,0x00050084,0x0000000d,0x00000631,
+0x0000062f,0x00000630,0x0004003d,0x0000000d,
+0x00000632,0x0000057e,0x0004003d,0x0000000d,
+0x00000633,0x00000068,0x00050084,0x0000000d,
+0x00000634,0x00000632,0x00000633,0x00050080,
+0x0000000d,0x00000635,0x00000631,0x00000634,
+0x0004003d,0x0000000d,0x00000636,0x0000058d,
+0x0004003d,0x0000000d,0x00000637,0x00000550,
+0x00050084,0x0000000d,0x00000638,0x00000636,
+0x00000637,0x00050080,0x0000000d,0x00000639,
+0x00000635,0x00000638,0x0004003d,0x0000000d,
+0x0000063a,0x00000565,0x000500c2,0x0000000d,
+0x0000063b,0x0000063a,0x00000540,0x00050080,
+0x0000000d,0x0000063c,0x00000639,0x0000063b,
+0x0003003e,0x0000062e,0x0000063c,0x0004003d,
+0x0000000d,0x0000063e,0x00000583,0x0004003d,
+0x0000000d,0x0000063f,0x00000067,0x00050084,
+0x0000000d,0x00000640,0x0000063e,0x0000063f,
+0x0004003d,0x0000000d,0x00000641,0x00000588,
+0x0004003d,0x0000000d,0x00000642,0x00000068,
+0x00050084,0x0000000d,0x00000643,0x00000641,
+0x00000642,0x00050080,0x0000000d,0x00000644,
+0x00000640,0x00000643,0x0004003d,0x0000000d,
+0x00000645,0x00000592,0x0004003d,0x0000000d,
+0x00000646,0x00000550,0x00050084,0x0000000d,
+0x00000647,0x00000645,0x00000646,0x00050080,
+0x0000000d,0x00000648,0x00000644,0x00000647,
+0x0004003d,0x0000000d,0x00000649,0x00000565,
+0x000500c2,0x0000000d,0x0000064a,0x00000649,
+0x00000124,0x00050080,0x0000000d,0x0000064b,
+0x00000648,0x0000064a,0x0003003e,0x0000063d,
+0x0000064b,0x0004003d,0x0000000d,0x0000064d,
+0x0000060e,0x000500c7,0x0000000d,0x0000064e,
+0x0000064d,0x0000064c,0x0003003e,0x0000060e,
+0x0000064e,0x0004003d,0x0000000d,0x0000064f,
+0x0000061e,0x000500c7,0x0000000d,0x00000650,
+0x0000064f,0x0000064c,0x0003003e,0x0000061e,
+0x00000650,0x0004003d,0x0000000d,0x00000651,
+0x0000062e,0x000500c7,0x0000000d,0x00000652,
+0x00000651,0x0000064c,0x0003003e,0x0000062e,
+0x00000652,0x0004003d,0x0000000d,0x00000653,
+0x0000063d,0x000500c7,0x0000000d,0x00000654,
+0x00000653,0x0000064c,0x0003003e,0x0000063d,
+0x00000654,0x0004003d,0x0000000d,0x00000655,
+0x00000069,0x000500b0,0x00000099,0x00000656,
+0x00000655,0x000000de,0x000300f7,0x00000658,
+0x00000000,0x000400fa,0x00000656,0x00000657,
+0x00000658,0x000200f8,0x00000657,0x0003003e,
+0x0000063d,0x000000c9,0x000200f9,0x00000658,
+0x000200f8,0x00000658,0x0004003d,0x0000000d,
+0x00000659,0x00000069,0x000500b0,0x00000099,
+0x0000065a,0x00000659,0x0000003c,0x000300f7,
+0x0000065c,0x00000000,0x000400fa,0x0000065a,
+0x0000065b,0x0000065c,0x000200f8,0x0000065b,
+0x0003003e,0x0000062e,0x000000c9,0x000200f9,
+0x0000065c,0x000200f8,0x0000065c,0x0004003d,
+0x0000000d,0x0000065d,0x0000060e,0x0004003d,
+0x0000000d,0x0000065e,0x0000061e,0x000500ae,
+0x00000099,0x0000065f,0x0000065d,0x0000065e,
+0x0004003d,0x0000000d,0x00000660,0x0000060e,
+0x0004003d,0x0000000d,0x00000661,0x0000062e,
+0x000500ae,0x00000099,0x00000662,0x00000660,
+0x00000661,0x000500a7,0x00000099,0x00000663,
+0x0000065f,0x00000662,0x0004003d,0x0000000d,
+0x00000664,0x0000060e,0x0004003d,0x0000000d,
+0x00000665,0x0000063d,0x000500ae,0x00000099,
+0x00000666,0x00000664,0x00000665,0x000500a7,
+0x00000099,0x00000667,0x00000663,0x00000666,
+0x000300f7,0x00000669,0x00000000,0x000400fa,
+0x00000667,0x00000668,0x0000066b,0x000200f8,
+0x00000668,0x000200fe,0x000000c9,0x000200f8,
+0x0000066b,0x0004003d,0x0000000d,0x0000066c,
+0x0000061e,0x0004003d,0x0000000d,0x0000066d,
+0x0000062e,0x000500ae,0x00000099,0x0000066e,
+0x0000066c,0x0000066d,0x0004003d,0x0000000d,
+0x0000066f,0x0000061e,0x0004003d,0x0000000d,
+0x00000670,0x0000063d,0x000500ae,0x00000099,
+0x00000671,0x0000066f,0x00000670,0x000500a7,
+0x00000099,0x00000672,0x0000066e,0x00000671,
+0x000300f7,0x00000674,0x00000000,0x000400fa,
+0x00000672,0x00000673,0x00000676,0x000200f8,
+0x00000673,0x000200fe,0x00000082,0x000200f8,
+0x00000676,0x0004003d,0x0000000d,0x00000677,
+0x0000062e,0x0004003d,0x0000000d,0x00000678,
+0x0000063d,0x000500ae,0x00000099,0x00000679,
+0x00000677,0x00000678,0x000300f7,0x0000067b,
+0x00000000,0x000400fa,0x00000679,0x0000067a,
+0x0000067d,0x000200f8,0x0000067a,0x000200fe,
+0x000000e7,0x000200f8,0x0000067d,0x000200fe,
+0x0000003c,0x000200f8,0x0000067b,0x000100ff,
+0x000200f8,0x00000674,0x000100ff,0x000200f8,
+0x00000669,0x000100ff,0x00010038,0x00050036,
+0x0000006d,0x00000070,0x00000000,0x0000006e,
+0x00030037,0x00000016,0x0000006f,0x000200f8,
+0x00000071,0x0004003b,0x0000000f,0x00000680,
+0x00000007,0x0004003b,0x0000000f,0x0000068b,
+0x00000007,0x0004003b,0x00000696,0x00000697,
+0x00000007,0x0003003e,0x00000680,0x00000109,
+0x000200f9,0x00000681,0x000200f8,0x00000681,
+0x000400f6,0x00000683,0x00000684,0x00000000,
+0x000200f9,0x00000685,0x000200f8,0x00000685,
+0x0004003d,0x00000006,0x00000686,0x00000680,
+0x0004007c,0x0000000d,0x00000687,0x00000686,
+0x00060041,0x00000555,0x00000688,0x00000554,
+0x00000109,0x00000082,0x0004003d,0x0000000d,
+0x00000689,0x00000688,0x000500b0,0x00000099,
+0x0000068a,0x00000687,0x00000689,0x000400fa,
+0x0000068a,0x00000682,0x00000683,0x000200f8,
+0x00000682,0x0003003e,0x0000068b,0x00000109,
+0x000200f9,0x0000068c,0x000200f8,0x0000068c,
+0x000400f6,0x0000068e,0x0000068f,0x00000000,
+0x000200f9,0x00000690,0x000200f8,0x00000690,
+0x0004003d,0x00000006,0x00000691,0x0000068b,
+0x0004007c,0x0000000d,0x00000692,0x00000691,
+0x00060041,0x00000555,0x00000693,0x00000554,
+0x00000109,0x000000c9,0x0004003d,0x0000000d,
+0x00000694,0x00000693,0x000500b0,0x00000099,
+0x00000695,0x00000692,0x00000694,0x000400fa,
+0x00000695,0x0000068d,0x0000068e,0x000200f8,
+0x0000068d,0x0004003d,0x00000006,0x00000698,
+0x00000680,0x0004007c,0x0000000d,0x00000699,
+0x00000698,0x00060041,0x00000555,0x0000069a,
+0x00000554,0x00000109,0x000000c9,0x0004003d,
+0x0000000d,0x0000069b,0x0000069a,0x00050084,
+0x0000000d,0x0000069c,0x00000699,0x0000069b,
+0x0004003d,0x00000006,0x0000069d,0x0000068b,
+0x0004007c,0x0000000d,0x0000069e,0x0000069d,
+0x00050080,0x0000000d,0x0000069f,0x0000069c,
+0x0000069e,0x0004003d,0x00000015,0x000006a0,
+0x0000006f,0x00050041,0x00000016,0x000006a1,
+0x00000697,0x0000069f,0x0003003e,0x000006a1,
+0x000006a0,0x000200f9,0x0000068f,0x000200f8,
+0x0000068f,0x0004003d,0x00000006,0x000006a2,
+0x0000068b,0x00050080,0x00000006,0x000006a3,
+0x000006a2,0x0000008e,0x0003003e,0x0000068b,
+0x000006a3,0x000200f9,0x0000068c,0x000200f8,
+0x0000068e,0x000200f9,0x00000684,0x000200f8,
+0x00000684,0x0004003d,0x00000006,0x000006a4,
+0x00000680,0x00050080,0x00000006,0x000006a5,
+0x000006a4,0x0000008e,0x0003003e,0x00000680,
+0x000006a5,0x000200f9,0x00000681,0x000200f8,
+0x00000683,0x0004003d,0x0000006d,0x000006a6,
+0x00000697,0x000200fe,0x000006a6,0x00010038,
+0x00050036,0x0000006d,0x00000073,0x00000000,
+0x00000072,0x000200f8,0x00000074,0x0004003b,
+0x00000016,0x000006ab,0x00000007,0x0003003e,
+0x000006ab,0x000006aa,0x00050039,0x0000006d,
+0x000006ac,0x00000070,0x000006ab,0x000200fe,
+0x000006ac,0x00010038,0x00050036,0x0000006d,
+0x00000077,0x00000000,0x00000075,0x00030037,
+0x00000015,0x00000076,0x000200f8,0x00000078,
+0x0004003b,0x0000000e,0x000006af,0x00000007,
+0x0004003b,0x0000000e,0x000006b1,0x00000007,
+0x0004003b,0x0000000e,0x000006b5,0x00000007,
+0x0004003b,0x0000000e,0x000006b9,0x00000007,
+0x0004003b,0x0000000e,0x000006bd,0x00000007,
+0x0004003b,0x0000000e,0x000006bf,0x00000007,
+0x0004003b,0x0000000e,0x000006c1,0x00000007,
+0x0004003b,0x0000000e,0x000006c2,0x00000007,
+0x0004003b,0x0000000f,0x000006c4,0x00000007,
+0x0004003b,0x0000000e,0x000006c6,0x00000007,
+0x0004003b,0x0000000e,0x000006c8,0x00000007,
+0x0004003b,0x0000000f,0x000006ca,0x00000007,
+0x0004003b,0x0000000e,0x000006d1,0x00000007,
+0x0004003b,0x0000000e,0x000006d4,0x00000007,
+0x0004003b,0x0000000f,0x000006d6,0x00000007,
+0x0004003b,0x0000000e,0x000006dd,0x00000007,
+0x0004003b,0x0000000e,0x000006df,0x00000007,
+0x0004003b,0x00000016,0x00000700,0x00000007,
+0x0004003b,0x00000016,0x0000070e,0x00000007,
+0x0004003b,0x0000000e,0x00000721,0x00000007,
+0x0004003b,0x0000000f,0x00000723,0x00000007,
+0x0004003b,0x0000000e,0x00000741,0x00000007,
+0x0004003b,0x0000000f,0x00000743,0x00000007,
+0x0004003b,0x0000000e,0x00000763,0x00000007,
+0x0004003b,0x0000000e,0x00000764,0x00000007,
+0x0004003b,0x0000000e,0x00000765,0x00000007,
+0x0004003b,0x0000000e,0x00000766,0x00000007,
+0x0004003b,0x0000000e,0x0000079d,0x00000007,
+0x0004003b,0x0000000e,0x0000079e,0x00000007,
+0x0004003b,0x0000000e,0x0000079f,0x00000007,
+0x0004003b,0x0000000e,0x000007a1,0x00000007,
+0x0004003b,0x0000000e,0x000007a3,0x00000007,
+0x0004003b,0x0000000e,0x000007a5,0x00000007,
+0x0004003b,0x0000000e,0x000007a6,0x00000007,
+0x0004003b,0x0000000e,0x000007aa,0x00000007,
+0x0004003b,0x0000000e,0x000007ab,0x00000007,
+0x0004003b,0x00000016,0x000007ac,0x00000007,
+0x0004003b,0x0000000e,0x000007ae,0x00000007,
+0x0004003b,0x0000000e,0x000007af,0x00000007,
+0x0004003b,0x0000000e,0x000007b1,0x00000007,
+0x0004003b,0x0000000e,0x000007b3,0x00000007,
+0x0004003b,0x0000000e,0x000007b5,0x00000007,
+0x0004003b,0x00000112,0x000007d8,0x00000007,
+0x0004003b,0x00000016,0x000007d9,0x00000007,
+0x0004003b,0x0000000e,0x000007db,0x00000007,
+0x0004003b,0x0000000e,0x000007dd,0x00000007,
+0x0004003b,0x0000000e,0x000007df,0x00000007,
+0x0004003b,0x0000000f,0x000007e2,0x00000007,
+0x0004003b,0x000007ec,0x000007ed,0x00000007,
+0x0004003b,0x00000810,0x00000811,0x00000007,
+0x0004003b,0x00000818,0x00000819,0x00000007,
+0x0004003b,0x0000026b,0x00000837,0x00000007,
+0x0004003b,0x00000016,0x00000838,0x00000007,
+0x0004003b,0x0000000e,0x0000083a,0x00000007,
+0x0004003b,0x0000000e,0x0000083c,0x00000007,
+0x0004003b,0x0000000e,0x0000083e,0x00000007,
+0x0004003b,0x0000000f,0x00000841,0x00000007,
+0x0004003b,0x0000026b,0x00000859,0x00000007,
+0x0004003b,0x00000860,0x00000861,0x00000007,
+0x0004003b,0x0000000e,0x0000087b,0x00000007,
+0x0004003b,0x00000016,0x0000087c,0x00000007,
+0x0004003b,0x0000000e,0x0000087e,0x00000007,
+0x0004003b,0x0000000e,0x00000880,0x00000007,
+0x0004003b,0x0000000e,0x00000883,0x00000007,
+0x0004003b,0x00000889,0x0000088a,0x00000007,
+0x0004003b,0x00000889,0x00000892,0x00000007,
+0x0004003b,0x0000000e,0x000008aa,0x00000007,
+0x0004003b,0x0000000e,0x000008b9,0x00000007,
+0x0004003b,0x0000000e,0x000008ba,0x00000007,
+0x0004003b,0x0000000e,0x000008bc,0x00000007,
+0x0004003b,0x0000000e,0x000008be,0x00000007,
+0x0004003b,0x0000000e,0x000008c0,0x00000007,
+0x0004003b,0x0000000e,0x000008c4,0x00000007,
+0x0004003b,0x00000016,0x000008c9,0x00000007,
+0x0004003b,0x0000000e,0x000008d4,0x00000007,
+0x0004003b,0x0000000e,0x000008d9,0x00000007,
+0x0004003b,0x0000000e,0x000008dc,0x00000007,
+0x0004003b,0x00000810,0x000008e3,0x00000007,
+0x0004003b,0x0000000e,0x000008e7,0x00000007,
+0x0004003b,0x0000000e,0x000008f3,0x00000007,
+0x0004003b,0x0000000e,0x000008fe,0x00000007,
+0x0004003b,0x00000016,0x00000901,0x00000007,
+0x0004003b,0x0000000e,0x00000903,0x00000007,
+0x0004003b,0x0000000f,0x00000905,0x00000007,
+0x0004003b,0x0000000e,0x00000907,0x00000007,
+0x0004003b,0x0000000f,0x00000909,0x00000007,
+0x0004003b,0x0000000e,0x0000090c,0x00000007,
+0x0004003b,0x0000000f,0x0000090e,0x00000007,
+0x0004003b,0x0000000e,0x00000910,0x00000007,
+0x0004003b,0x0000000f,0x00000912,0x00000007,
+0x0004003b,0x0000000e,0x00000917,0x00000007,
+0x0004003b,0x00000016,0x00000918,0x00000007,
+0x0004003b,0x0000000e,0x00000919,0x00000007,
+0x0004003b,0x0000000e,0x0000091b,0x00000007,
+0x0004003b,0x0000000e,0x0000091e,0x00000007,
+0x0004003b,0x00000810,0x00000922,0x00000007,
+0x0004003b,0x0000000e,0x00000925,0x00000007,
+0x0004003b,0x0000000e,0x00000940,0x00000007,
+0x0004003b,0x0000000e,0x00000941,0x00000007,
+0x0004003b,0x0000000e,0x0000094b,0x00000007,
+0x0004003b,0x0000000e,0x00000953,0x00000007,
+0x0004003b,0x0000000e,0x00000959,0x00000007,
+0x0004003b,0x0000000e,0x00000963,0x00000007,
+0x0004003b,0x0000000e,0x00000964,0x00000007,
+0x0004003b,0x0000000e,0x00000965,0x00000007,
+0x0004003b,0x0000000e,0x00000966,0x00000007,
+0x0004003b,0x00000978,0x00000979,0x00000007,
+0x0004003b,0x00000978,0x0000097d,0x00000007,
+0x0004003b,0x00000978,0x00000981,0x00000007,
+0x0004003b,0x0000000e,0x00000984,0x00000007,
+0x0004003b,0x0000000e,0x00000986,0x00000007,
+0x0004003b,0x0000000e,0x00000988,0x00000007,
+0x0004003b,0x0000000e,0x0000098a,0x00000007,
+0x0004003b,0x0000000e,0x0000099a,0x00000007,
+0x0004003b,0x0000000e,0x0000099b,0x00000007,
+0x0004003b,0x0000000e,0x0000099d,0x00000007,
+0x0004003b,0x0000000e,0x0000099f,0x00000007,
+0x0004003b,0x0000000e,0x000009a1,0x00000007,
+0x0004003b,0x0000000e,0x000009a4,0x00000007,
+0x0004003b,0x0000000e,0x000009a8,0x00000007,
+0x0004003b,0x0000000e,0x000009a9,0x00000007,
+0x0004003b,0x0000000e,0x000009aa,0x00000007,
+0x0004003b,0x0000000e,0x000009ac,0x00000007,
+0x0004003b,0x0000000e,0x000009ae,0x00000007,
+0x0004003b,0x0000000e,0x000009b0,0x00000007,
+0x0004003b,0x0000000e,0x000009b1,0x00000007,
+0x0004003b,0x0000000e,0x000009b5,0x00000007,
+0x0004003b,0x0000000e,0x000009b7,0x00000007,
+0x0004003b,0x00000112,0x000009c4,0x00000007,
+0x0004003b,0x00000016,0x000009c5,0x00000007,
+0x0004003b,0x0000000e,0x000009c6,0x00000007,
+0x0004003b,0x0000000e,0x000009c8,0x00000007,
+0x0004003b,0x0000000e,0x000009ca,0x00000007,
+0x0004003b,0x0000000f,0x000009cd,0x00000007,
+0x0004003b,0x0000036d,0x000009d5,0x00000007,
+0x0004003b,0x00000a8c,0x00000a8d,0x00000007,
+0x0004003b,0x00000a94,0x00000a95,0x00000007,
+0x0004003b,0x0000026b,0x00000aa8,0x00000007,
+0x0004003b,0x00000016,0x00000aa9,0x00000007,
+0x0004003b,0x0000000e,0x00000aaa,0x00000007,
+0x0004003b,0x0000000e,0x00000aac,0x00000007,
+0x0004003b,0x0000000e,0x00000aae,0x00000007,
+0x0004003b,0x0000000f,0x00000ab1,0x00000007,
+0x0004003b,0x00000889,0x00000ac6,0x00000007,
+0x0004003b,0x00000acd,0x00000ace,0x00000007,
+0x0004003b,0x0000000e,0x00000add,0x00000007,
+0x0004003b,0x00000016,0x00000ade,0x00000007,
+0x0004003b,0x0000000e,0x00000adf,0x00000007,
+0x0004003b,0x0000000e,0x00000ae1,0x00000007,
+0x0004003b,0x0000000e,0x00000ae4,0x00000007,
+0x0004003b,0x00000aea,0x00000aeb,0x00000007,
+0x0004003b,0x00000aea,0x00000af3,0x00000007,
+0x0004003b,0x0000000e,0x00000b00,0x00000007,
+0x0004003b,0x0000000e,0x00000b01,0x00000007,
+0x0004003b,0x00000b0e,0x00000b0f,0x00000007,
+0x0004003b,0x0000000e,0x00000b12,0x00000007,
+0x0004003b,0x0000000e,0x00000b14,0x00000007,
+0x0004003b,0x00000016,0x00000b17,0x00000007,
+0x0004003b,0x00000016,0x00000b18,0x00000007,
+0x0004003b,0x0000000e,0x00000b1f,0x00000007,
+0x0004003b,0x00000b27,0x00000b28,0x00000007,
+0x0004003b,0x0000000e,0x00000b35,0x00000007,
+0x0004003b,0x0000000e,0x00000b38,0x00000007,
+0x0004003b,0x0000000e,0x00000b42,0x00000007,
+0x0004003b,0x0000000e,0x00000b4c,0x00000007,
+0x0004003b,0x0000000e,0x00000b51,0x00000007,
+0x0004003b,0x0000000e,0x00000b52,0x00000007,
+0x0004003b,0x0000000e,0x00000b54,0x00000007,
+0x0004003b,0x0000000e,0x00000b56,0x00000007,
+0x0004003b,0x00000b60,0x00000b61,0x00000007,
+0x0004003b,0x00000696,0x00000b67,0x00000007,
+0x0004003b,0x00000b27,0x00000b70,0x00000007,
+0x0004003b,0x00000b27,0x00000b74,0x00000007,
+0x0004003b,0x00000b27,0x00000b78,0x00000007,
+0x0004003b,0x00000b27,0x00000b85,0x00000007,
+0x0004003b,0x00000b27,0x00000b89,0x00000007,
+0x0004003b,0x0000000e,0x00000b8d,0x00000007,
+0x0004003b,0x00000b27,0x00000b95,0x00000007,
+0x0004003b,0x00000b27,0x00000ba2,0x00000007,
+0x0004003b,0x00000b27,0x00000bb1,0x00000007,
+0x0004003b,0x00000b27,0x00000bc2,0x00000007,
+0x0004003b,0x0000000e,0x00000bd5,0x00000007,
+0x0004003b,0x0000000e,0x00000bdd,0x00000007,
+0x0004003b,0x0000000e,0x00000be2,0x00000007,
+0x0004003b,0x0000000e,0x00000be7,0x00000007,
+0x0004003b,0x00000b27,0x00000bf0,0x00000007,
+0x0004003b,0x00000016,0x00000c08,0x00000007,
+0x0004003b,0x00000016,0x00000c0c,0x00000007,
+0x0004003b,0x00000016,0x00000c10,0x00000007,
+0x0004003b,0x0000000e,0x00000c25,0x00000007,
+0x0004003b,0x00000016,0x00000c26,0x00000007,
+0x0004003b,0x0000000e,0x00000c27,0x00000007,
+0x0004003b,0x0000000e,0x00000c29,0x00000007,
+0x00050051,0x0000000d,0x000006b0,0x00000076,
+0x00000003,0x0003003e,0x000006af,0x000006b0,
+0x0004003d,0x0000000d,0x000006b2,0x000006af,
+0x000500c2,0x0000000d,0x000006b3,0x000006b2,
+0x00000525,0x000500c7,0x0000000d,0x000006b4,
+0x000006b3,0x0000003c,0x0003003e,0x000006b1,
+0x000006b4,0x0004003d,0x0000000d,0x000006b6,
+0x000006af,0x000500c2,0x0000000d,0x000006b7,
+0x000006b6,0x00000110,0x000500c7,0x0000000d,
+0x000006b8,0x000006b7,0x0000003c,0x0003003e,
+0x000006b5,0x000006b8,0x0004003d,0x0000000d,
+0x000006ba,0x000006af,0x000500c2,0x0000000d,
+0x000006bb,0x000006ba,0x00000124,0x000500c7,
+0x0000000d,0x000006bc,0x000006bb,0x0000003c,
+0x0003003e,0x000006b9,0x000006bc,0x0004003d,
+0x0000000d,0x000006be,0x000006b5,0x0003003e,
+0x000006bd,0x000006be,0x0004003d,0x0000000d,
+0x000006c0,0x000006b1,0x0003003e,0x000006bf,
+0x000006c0,0x0004003d,0x0000000d,0x000006c3,
+0x000006af,0x0003003e,0x000006c2,0x000006c3,
+0x0003003e,0x000006c4,0x0000062b,0x00060039,
+0x0000000d,0x000006c5,0x00000013,0x000006c2,
+0x000006c4,0x0003003e,0x000006c1,0x000006c5,
+0x0004003d,0x0000000d,0x000006c9,0x000006af,
+0x0003003e,0x000006c8,0x000006c9,0x0003003e,
+0x000006ca,0x000006c7,0x00060039,0x0000000d,
+0x000006cb,0x00000013,0x000006c8,0x000006ca,
+0x0003003e,0x000006c6,0x000006cb,0x0004003d,
+0x0000000d,0x000006cc,0x000006af,0x000500c7,
+0x0000000d,0x000006cd,0x000006cc,0x0000003c,
+0x000500aa,0x00000099,0x000006ce,0x000006cd,
+0x000000c9,0x000300f7,0x000006d0,0x00000000,
+0x000400fa,0x000006ce,0x000006cf,0x0000071d,
+0x000200f8,0x000006cf,0x0004003d,0x0000000d,
+0x000006d2,0x000006b9,0x000500c4,0x0000000d,
+0x000006d3,0x000006d2,0x0000008e,0x0004003d,
+0x0000000d,0x000006d5,0x000006af,0x0003003e,
+0x000006d4,0x000006d5,0x0003003e,0x000006d6,
+0x0000052a,0x00060039,0x0000000d,0x000006d7,
+0x00000013,0x000006d4,0x000006d6,0x000500c5,
+0x0000000d,0x000006d8,0x000006d3,0x000006d7,
+0x0003003e,0x000006d1,0x000006d8,0x0004003d,
+0x0000000d,0x000006d9,0x000006b1,0x000500aa,
+0x00000099,0x000006da,0x000006d9,0x000000c9,
+0x000300f7,0x000006dc,0x00000000,0x000400fa,
+0x000006da,0x000006db,0x000006e2,0x000200f8,
+0x000006db,0x0003003e,0x000006dd,0x000006de,
+0x0004003d,0x0000000d,0x000006e0,0x000006bd,
+0x00050080,0x0000000d,0x000006e1,0x000006e0,
+0x000000e7,0x0003003e,0x000006df,0x000006e1,
+0x000200f9,0x000006dc,0x000200f8,0x000006e2,
+0x0004003d,0x0000000d,0x000006e3,0x000006b1,
+0x000500aa,0x00000099,0x000006e4,0x000006e3,
+0x00000082,0x000300f7,0x000006e6,0x00000000,
+0x000400fa,0x000006e4,0x000006e5,0x000006e9,
+0x000200f8,0x000006e5,0x0004003d,0x0000000d,
+0x000006e7,0x000006bd,0x00050080,0x0000000d,
+0x000006e8,0x000006e7,0x000000e7,0x0003003e,
+0x000006dd,0x000006e8,0x0003003e,0x000006df,
+0x000006de,0x000200f9,0x000006e6,0x000200f8,
+0x000006e9,0x0004003d,0x0000000d,0x000006ea,
+0x000006b1,0x000500aa,0x00000099,0x000006eb,
+0x000006ea,0x0000003c,0x000300f7,0x000006ed,
+0x00000000,0x000400fa,0x000006eb,0x000006ec,
+0x00000715,0x000200f8,0x000006ec,0x0004003d,
+0x0000000d,0x000006ee,0x000006b5,0x000500aa,
+0x00000099,0x000006ef,0x000006ee,0x000000c9,
+0x000300f7,0x000006f1,0x00000000,0x000400fa,
+0x000006ef,0x000006f0,0x000006f3,0x000200f8,
+0x000006f0,0x0003003e,0x000006dd,0x00000397,
+0x0003003e,0x000006df,0x000006f2,0x000200f9,
+0x000006f1,0x000200f8,0x000006f3,0x0004003d,
+0x0000000d,0x000006f4,0x000006b5,0x000500aa,
+0x00000099,0x000006f5,0x000006f4,0x00000082,
+0x000300f7,0x000006f7,0x00000000,0x000400fa,
+0x000006f5,0x000006f6,0x000006f8,0x000200f8,
+0x000006f6,0x0003003e,0x000006dd,0x000006f2,
+0x0003003e,0x000006df,0x00000397,0x000200f9,
+0x000006f7,0x000200f8,0x000006f8,0x0004003d,
+0x0000000d,0x000006f9,0x000006af,0x000500c7,
+0x0000000d,0x000006fb,0x000006f9,0x000006fa,
+0x000500aa,0x00000099,0x000006fd,0x000006fb,
+0x000006fc,0x000300f7,0x000006ff,0x00000000,
+0x000400fa,0x000006fd,0x000006fe,0x00000712,
+0x000200f8,0x000006fe,0x00050051,0x0000000d,
+0x00000701,0x00000076,0x00000001,0x000500c2,
+0x0000000d,0x00000702,0x00000701,0x00000417,
+0x000500c7,0x0000000d,0x00000703,0x00000702,
+0x000006a9,0x00050051,0x0000000d,0x00000704,
+0x00000076,0x00000001,0x000500c2,0x0000000d,
+0x00000705,0x00000704,0x00000585,0x000500c7,
+0x0000000d,0x00000706,0x00000705,0x000006a9,
+0x00050051,0x0000000d,0x00000707,0x00000076,
+0x00000000,0x000500c2,0x0000000d,0x00000708,
+0x00000707,0x00000417,0x000500c7,0x0000000d,
+0x00000709,0x00000708,0x000006a9,0x00050051,
+0x0000000d,0x0000070a,0x00000076,0x00000000,
+0x000500c2,0x0000000d,0x0000070b,0x0000070a,
+0x00000585,0x000500c7,0x0000000d,0x0000070c,
+0x0000070b,0x000006a9,0x00070050,0x00000015,
+0x0000070d,0x00000703,0x00000706,0x00000709,
+0x0000070c,0x0003003e,0x00000700,0x0000070d,
+0x0004003d,0x00000015,0x0000070f,0x00000700,
+0x0003003e,0x0000070e,0x0000070f,0x00050039,
+0x0000006d,0x00000710,0x00000070,0x0000070e,
+0x000200fe,0x00000710,0x000200f8,0x00000712,
+0x00040039,0x0000006d,0x00000713,0x00000073,
+0x000200fe,0x00000713,0x000200f8,0x000006ff,
+0x000100ff,0x000200f8,0x000006f7,0x000200f9,
+0x000006f1,0x000200f8,0x000006f1,0x000200f9,
+0x000006ed,0x000200f8,0x00000715,0x0004003d,
+0x0000000d,0x00000716,0x000006af,0x000500c2,
+0x0000000d,0x00000717,0x00000716,0x000006c7,
+0x000500c7,0x0000000d,0x00000718,0x00000717,
+0x0000003c,0x0003003e,0x000006bf,0x00000718,
+0x0004003d,0x0000000d,0x00000719,0x000006bd,
+0x00050080,0x0000000d,0x0000071a,0x00000719,
+0x00000397,0x0003003e,0x000006dd,0x0000071a,
+0x0004003d,0x0000000d,0x0000071b,0x000006bf,
+0x00050080,0x0000000d,0x0000071c,0x0000071b,
+0x00000397,0x0003003e,0x000006df,0x0000071c,
+0x0003003e,0x000006c1,0x000000c9,0x0003003e,
+0x000006c6,0x000000c9,0x000200f9,0x000006ed,
+0x000200f8,0x000006ed,0x000200f9,0x000006e6,
+0x000200f8,0x000006e6,0x000200f9,0x000006dc,
+0x000200f8,0x000006dc,0x000200f9,0x000006d0,
+0x000200f8,0x0000071d,0x0004003d,0x0000000d,
+0x0000071e,0x000006af,0x000500c7,0x0000000d,
+0x0000071f,0x0000071e,0x0000003c,0x000500c4,
+0x0000000d,0x00000720,0x0000071f,0x0000008e,
+0x0004003d,0x0000000d,0x00000722,0x000006af,
+0x0003003e,0x00000721,0x00000722,0x0003003e,
+0x00000723,0x0000052a,0x00060039,0x0000000d,
+0x00000724,0x00000013,0x00000721,0x00000723,
+0x000500c5,0x0000000d,0x00000725,0x00000720,
+0x00000724,0x0003003e,0x000006d1,0x00000725,
+0x0004003d,0x0000000d,0x00000726,0x000006b9,
+0x000500aa,0x00000099,0x00000727,0x00000726,
+0x000000c9,0x000300f7,0x00000729,0x00000000,
+0x000400fa,0x00000727,0x00000728,0x0000072e,
+0x000200f8,0x00000728,0x0004003d,0x0000000d,
+0x0000072a,0x000006bf,0x00050080,0x0000000d,
+0x0000072b,0x0000072a,0x000000de,0x0003003e,
+0x000006dd,0x0000072b,0x0004003d,0x0000000d,
+0x0000072c,0x000006bd,0x00050080,0x0000000d,
+0x0000072d,0x0000072c,0x000000e7,0x0003003e,
+0x000006df,0x0000072d,0x000200f9,0x00000729,
+0x000200f8,0x0000072e,0x0004003d,0x0000000d,
+0x0000072f,0x000006b9,0x000500aa,0x00000099,
+0x00000730,0x0000072f,0x00000082,0x000300f7,
+0x00000732,0x00000000,0x000400fa,0x00000730,
+0x00000731,0x00000737,0x000200f8,0x00000731,
+0x0004003d,0x0000000d,0x00000733,0x000006bf,
+0x00050080,0x0000000d,0x00000734,0x00000733,
+0x000000da,0x0003003e,0x000006dd,0x00000734,
+0x0004003d,0x0000000d,0x00000735,0x000006bd,
+0x00050080,0x0000000d,0x00000736,0x00000735,
+0x000000e7,0x0003003e,0x000006df,0x00000736,
+0x000200f9,0x00000732,0x000200f8,0x00000737,
+0x0004003d,0x0000000d,0x00000738,0x000006b9,
+0x000500aa,0x00000099,0x00000739,0x00000738,
+0x000000e7,0x000300f7,0x0000073b,0x00000000,
+0x000400fa,0x00000739,0x0000073a,0x00000740,
+0x000200f8,0x0000073a,0x0004003d,0x0000000d,
+0x0000073c,0x000006bd,0x00050080,0x0000000d,
+0x0000073d,0x0000073c,0x000000e7,0x0003003e,
+0x000006dd,0x0000073d,0x0004003d,0x0000000d,
+0x0000073e,0x000006bf,0x00050080,0x0000000d,
+0x0000073f,0x0000073e,0x000000da,0x0003003e,
+0x000006df,0x0000073f,0x000200f9,0x0000073b,
+0x000200f8,0x00000740,0x0004003d,0x0000000d,
+0x00000742,0x000006af,0x0003003e,0x00000741,
+0x00000742,0x0003003e,0x00000743,0x00000417,
+0x00060039,0x0000000d,0x00000744,0x00000013,
+0x00000741,0x00000743,0x000500aa,0x00000099,
+0x00000745,0x00000744,0x000000c9,0x000300f7,
+0x00000747,0x00000000,0x000400fa,0x00000745,
+0x00000746,0x0000074d,0x000200f8,0x00000746,
+0x0004003d,0x0000000d,0x00000748,0x000006bd,
+0x00050080,0x0000000d,0x00000749,0x00000748,
+0x000000e7,0x0003003e,0x000006dd,0x00000749,
+0x0004003d,0x0000000d,0x0000074a,0x000006bf,
+0x000500c7,0x0000000d,0x0000074b,0x0000074a,
+0x00000082,0x00050080,0x0000000d,0x0000074c,
+0x0000074b,0x00000397,0x0003003e,0x000006df,
+0x0000074c,0x000200f9,0x00000747,0x000200f8,
+0x0000074d,0x0004003d,0x0000000d,0x0000074e,
+0x000006bf,0x000500c7,0x0000000d,0x0000074f,
+0x0000074e,0x00000082,0x00050080,0x0000000d,
+0x00000750,0x0000074f,0x000000e7,0x0003003e,
+0x000006dd,0x00000750,0x0004003d,0x0000000d,
+0x00000751,0x000006bd,0x00050080,0x0000000d,
+0x00000752,0x00000751,0x000000e7,0x0003003e,
+0x000006df,0x00000752,0x000200f9,0x00000747,
+0x000200f8,0x00000747,0x000200f9,0x0000073b,
+0x000200f8,0x0000073b,0x000200f9,0x00000732,
+0x000200f8,0x00000732,0x000200f9,0x00000729,
+0x000200f8,0x00000729,0x000200f9,0x000006d0,
+0x000200f8,0x000006d0,0x0004003d,0x0000000d,
+0x00000753,0x000006dd,0x00060041,0x00000555,
+0x00000754,0x00000554,0x00000109,0x000000c9,
+0x0004003d,0x0000000d,0x00000755,0x00000754,
+0x000500ac,0x00000099,0x00000756,0x00000753,
+0x00000755,0x000400a8,0x00000099,0x00000757,
+0x00000756,0x000300f7,0x00000759,0x00000000,
+0x000400fa,0x00000757,0x00000758,0x00000759,
+0x000200f8,0x00000758,0x0004003d,0x0000000d,
+0x0000075a,0x000006df,0x00060041,0x00000555,
+0x0000075b,0x00000554,0x00000109,0x00000082,
+0x0004003d,0x0000000d,0x0000075c,0x0000075b,
+0x000500ac,0x00000099,0x0000075d,0x0000075a,
+0x0000075c,0x000200f9,0x00000759,0x000200f8,
+0x00000759,0x000700f5,0x00000099,0x0000075e,
+0x00000756,0x000006d0,0x0000075d,0x00000758,
+0x000300f7,0x00000760,0x00000000,0x000400fa,
+0x0000075e,0x0000075f,0x00000760,0x000200f8,
+0x0000075f,0x00040039,0x0000006d,0x00000761,
+0x00000073,0x000200fe,0x00000761,0x000200f8,
+0x00000760,0x0003003e,0x00000763,0x000000c9,
+0x0003003e,0x00000764,0x000000c9,0x0003003e,
+0x00000765,0x000000c9,0x0004003d,0x0000000d,
+0x00000767,0x000006df,0x0004003d,0x0000000d,
+0x00000768,0x000006dd,0x00050084,0x0000000d,
+0x00000769,0x00000767,0x00000768,0x0004003d,
+0x0000000d,0x0000076a,0x000006c1,0x00050080,
+0x0000000d,0x0000076b,0x0000076a,0x00000082,
+0x00050084,0x0000000d,0x0000076c,0x00000769,
+0x0000076b,0x0003003e,0x00000766,0x0000076c,
+0x0004003d,0x0000000d,0x0000076e,0x00000766,
+0x000500b0,0x00000099,0x0000076f,0x0000076d,
+0x0000076e,0x000300f7,0x00000771,0x00000000,
+0x000400fa,0x0000076f,0x00000770,0x00000771,
+0x000200f8,0x00000770,0x00040039,0x0000006d,
+0x00000772,0x00000073,0x000200fe,0x00000772,
+0x000200f8,0x00000771,0x0004003d,0x0000000d,
+0x00000774,0x000006c6,0x000500aa,0x00000099,
+0x00000775,0x00000774,0x000000c9,0x000300f7,
+0x00000777,0x00000000,0x000400fa,0x00000775,
+0x00000776,0x0000078a,0x000200f8,0x00000776,
+0x0004003d,0x0000000d,0x00000778,0x000006d1,
+0x000300f7,0x00000780,0x00000000,0x000f00fb,
+0x00000778,0x0000077f,0x00000002,0x00000779,
+0x00000003,0x0000077a,0x00000004,0x0000077b,
+0x00000005,0x0000077c,0x00000006,0x0000077d,
+0x00000007,0x0000077e,0x000200f8,0x0000077f,
+0x00040039,0x0000006d,0x00000787,0x00000073,
+0x000200fe,0x00000787,0x000200f8,0x00000779,
+0x0003003e,0x00000765,0x00000082,0x000200f9,
+0x00000780,0x000200f8,0x0000077a,0x0003003e,
+0x00000763,0x00000082,0x000200f9,0x00000780,
+0x000200f8,0x0000077b,0x0003003e,0x00000765,
+0x000000e7,0x000200f9,0x00000780,0x000200f8,
+0x0000077c,0x0003003e,0x00000764,0x00000082,
+0x000200f9,0x00000780,0x000200f8,0x0000077d,
+0x0003003e,0x00000763,0x00000082,0x0003003e,
+0x00000765,0x00000082,0x000200f9,0x00000780,
+0x000200f8,0x0000077e,0x0003003e,0x00000765,
+0x0000003c,0x000200f9,0x00000780,0x000200f8,
+0x00000780,0x000200f9,0x00000777,0x000200f8,
+0x0000078a,0x0004003d,0x0000000d,0x0000078b,
+0x000006d1,0x000300f7,0x00000793,0x00000000,
+0x000f00fb,0x0000078b,0x00000792,0x00000002,
+0x0000078c,0x00000003,0x0000078d,0x00000004,
+0x0000078e,0x00000005,0x0000078f,0x00000006,
+0x00000790,0x00000007,0x00000791,0x000200f8,
+0x00000792,0x00040039,0x0000006d,0x0000079a,
+0x00000073,0x000200fe,0x0000079a,0x000200f8,
+0x0000078c,0x0003003e,0x00000765,0x00000082,
+0x0003003e,0x00000764,0x00000082,0x000200f9,
+0x00000793,0x000200f8,0x0000078d,0x0003003e,
+0x00000763,0x00000082,0x0003003e,0x00000765,
+0x000000e7,0x000200f9,0x00000793,0x000200f8,
+0x0000078e,0x0003003e,0x00000765,0x000000de,
+0x000200f9,0x00000793,0x000200f8,0x0000078f,
+0x0003003e,0x00000764,0x00000082,0x0003003e,
+0x00000765,0x000000e7,0x000200f9,0x00000793,
+0x000200f8,0x00000790,0x0003003e,0x00000763,
+0x00000082,0x0003003e,0x00000765,0x0000003c,
+0x000200f9,0x00000793,0x000200f8,0x00000791,
+0x0003003e,0x00000765,0x00000033,0x000200f9,
+0x00000793,0x000200f8,0x00000793,0x000200f9,
+0x00000777,0x000200f8,0x00000777,0x0003003e,
+0x0000079d,0x000000c9,0x0003003e,0x0000079e,
+0x000000c9,0x0004003d,0x0000000d,0x000007a0,
+0x00000763,0x0003003e,0x0000079f,0x000007a0,
+0x0004003d,0x0000000d,0x000007a2,0x00000764,
+0x0003003e,0x000007a1,0x000007a2,0x0004003d,
+0x0000000d,0x000007a4,0x00000765,0x0003003e,
+0x000007a3,0x000007a4,0x00090039,0x00000002,
+0x000007a7,0x00000031,0x0000079f,0x000007a1,
+0x000007a3,0x000007a5,0x000007a6,0x0004003d,
+0x0000000d,0x000007a8,0x000007a5,0x0003003e,
+0x0000079e,0x000007a8,0x0004003d,0x0000000d,
+0x000007a9,0x000007a6,0x0003003e,0x0000079d,
+0x000007a9,0x0003003e,0x000007aa,0x000000c9,
+0x0003003e,0x000007ab,0x000000c9,0x000400cc,
+0x00000015,0x000007ad,0x00000076,0x0003003e,
+0x000007ac,0x000007ad,0x0004003d,0x0000000d,
+0x000007b0,0x00000766,0x0003003e,0x000007af,
+0x000007b0,0x0004003d,0x0000000d,0x000007b2,
+0x00000763,0x0003003e,0x000007b1,0x000007b2,
+0x0004003d,0x0000000d,0x000007b4,0x00000764,
+0x0003003e,0x000007b3,0x000007b4,0x0004003d,
+0x0000000d,0x000007b6,0x00000765,0x0003003e,
+0x000007b5,0x000007b6,0x00080039,0x0000000d,
+0x000007b7,0x00000029,0x000007af,0x000007b1,
+0x000007b3,0x000007b5,0x0003003e,0x000007ae,
+0x000007b7,0x0004003d,0x0000000d,0x000007b8,
+0x000007ae,0x000500b0,0x00000099,0x000007ba,
+0x000007b8,0x000007b9,0x0004003d,0x0000000d,
+0x000007bb,0x000007ae,0x000500ac,0x00000099,
+0x000007bd,0x000007bb,0x000007bc,0x000500a6,
+0x00000099,0x000007be,0x000007ba,0x000007bd,
+0x000300f7,0x000007c0,0x00000000,0x000400fa,
+0x000007be,0x000007bf,0x000007c0,0x000200f8,
+0x000007bf,0x00040039,0x0000006d,0x000007c1,
+0x00000073,0x000200fe,0x000007c1,0x000200f8,
+0x000007c0,0x00050041,0x0000000e,0x000007c3,
+0x000007ac,0x0000003c,0x0004003d,0x0000000d,
+0x000007c4,0x000007c3,0x00050041,0x0000000e,
+0x000007c5,0x000007ac,0x000000e7,0x0004003d,
+0x0000000d,0x000007c6,0x000007c5,0x00050041,
+0x0000000e,0x000007c7,0x000007ac,0x00000082,
+0x0004003d,0x0000000d,0x000007c8,0x000007c7,
+0x00050041,0x0000000e,0x000007c9,0x000007ac,
+0x000000c9,0x0004003d,0x0000000d,0x000007ca,
+0x000007c9,0x00070050,0x00000015,0x000007cb,
+0x000007c4,0x000007c6,0x000007c8,0x000007ca,
+0x0003003e,0x000007ac,0x000007cb,0x000200f9,
+0x000007cc,0x000200f8,0x000007cc,0x000400f6,
+0x000007ce,0x000007cf,0x00000000,0x000200f9,
+0x000007d0,0x000200f8,0x000007d0,0x0004003d,
+0x0000000d,0x000007d1,0x000007ab,0x0004003d,
+0x0000000d,0x000007d2,0x00000766,0x000500b0,
+0x00000099,0x000007d3,0x000007d1,0x000007d2,
+0x000400fa,0x000007d3,0x000007cd,0x000007ce,
+0x000200f8,0x000007cd,0x0004003d,0x0000000d,
+0x000007d4,0x00000763,0x000500aa,0x00000099,
+0x000007d5,0x000007d4,0x00000082,0x000300f7,
+0x000007d7,0x00000000,0x000400fa,0x000007d5,
+0x000007d6,0x00000832,0x000200f8,0x000007d6,
+0x0004003d,0x00000015,0x000007da,0x000007ac,
+0x0003003e,0x000007d9,0x000007da,0x0004003d,
+0x0000000d,0x000007dc,0x000007aa,0x0003003e,
+0x000007db,0x000007dc,0x0004003d,0x0000000d,
+0x000007de,0x000007ae,0x0003003e,0x000007dd,
+0x000007de,0x0004003d,0x0000000d,0x000007e0,
+0x00000765,0x0003003e,0x000007df,0x000007e0,
+0x00080039,0x00000034,0x000007e1,0x0000003a,
+0x000007d9,0x000007db,0x000007dd,0x000007df,
+0x0003003e,0x000007d8,0x000007e1,0x0003003e,
+0x000007e2,0x00000109,0x000200f9,0x000007e3,
+0x000200f8,0x000007e3,0x000400f6,0x000007e5,
+0x000007e6,0x00000000,0x000200f9,0x000007e7,
+0x000200f8,0x000007e7,0x0004003d,0x00000006,
+0x000007e8,0x000007e2,0x000500b1,0x00000099,
+0x000007e9,0x000007e8,0x00000110,0x000400fa,
+0x000007e9,0x000007e4,0x000007e5,0x000200f8,
+0x000007e4,0x0004003d,0x0000000d,0x000007ee,
+0x000007ab,0x0004003d,0x0000000d,0x0000080f,
+0x00000765,0x0003003e,0x00000811,0x0000080e,
+0x00050041,0x0000000e,0x00000812,0x00000811,
+0x0000080f,0x0004003d,0x0000000d,0x00000813,
+0x00000812,0x0004003d,0x00000006,0x00000814,
+0x000007e2,0x00050041,0x0000000e,0x00000815,
+0x000007d8,0x00000814,0x0004003d,0x0000000d,
+0x00000816,0x00000815,0x00050080,0x0000000d,
+0x00000817,0x00000813,0x00000816,0x0003003e,
+0x00000819,0x0000080a,0x00050041,0x0000000e,
+0x0000081a,0x00000819,0x00000817,0x0004003d,
+0x0000000d,0x0000081b,0x0000081a,0x00050041,
+0x0000000e,0x0000081c,0x000007ed,0x000007ee,
+0x0003003e,0x0000081c,0x0000081b,0x0004003d,
+0x0000000d,0x0000081d,0x000007ab,0x00050041,
+0x0000000e,0x0000081e,0x000007ed,0x0000081d,
+0x0004003d,0x0000000d,0x0000081f,0x0000081e,
+0x000500ac,0x00000099,0x00000820,0x0000081f,
+0x00000088,0x000300f7,0x00000822,0x00000000,
+0x000400fa,0x00000820,0x00000821,0x00000822,
+0x000200f8,0x00000821,0x0004003d,0x0000000d,
+0x00000823,0x000007ab,0x00050041,0x0000000e,
+0x00000824,0x000007ed,0x00000823,0x0004003d,
+0x0000000d,0x00000825,0x00000824,0x00050080,
+0x0000000d,0x00000826,0x00000825,0x00000082,
+0x00050041,0x0000000e,0x00000827,0x000007ed,
+0x00000823,0x0003003e,0x00000827,0x00000826,
+0x000200f9,0x00000822,0x000200f8,0x00000822,
+0x0004003d,0x0000000d,0x00000828,0x000007ab,
+0x00050080,0x0000000d,0x00000829,0x00000828,
+0x0000008e,0x0003003e,0x000007ab,0x00000829,
+0x0004003d,0x0000000d,0x0000082a,0x000007ab,
+0x0004003d,0x0000000d,0x0000082b,0x00000766,
+0x000500ae,0x00000099,0x0000082c,0x0000082a,
+0x0000082b,0x000300f7,0x0000082e,0x00000000,
+0x000400fa,0x0000082c,0x0000082d,0x0000082e,
+0x000200f8,0x0000082d,0x000200f9,0x000007e5,
+0x000200f8,0x0000082e,0x000200f9,0x000007e6,
+0x000200f8,0x000007e6,0x0004003d,0x00000006,
+0x00000830,0x000007e2,0x00050080,0x00000006,
+0x00000831,0x00000830,0x0000008e,0x0003003e,
+0x000007e2,0x00000831,0x000200f9,0x000007e3,
+0x000200f8,0x000007e5,0x000200f9,0x000007d7,
+0x000200f8,0x00000832,0x0004003d,0x0000000d,
+0x00000833,0x00000764,0x000500aa,0x00000099,
+0x00000834,0x00000833,0x00000082,0x000300f7,
+0x00000836,0x00000000,0x000400fa,0x00000834,
+0x00000835,0x0000087a,0x000200f8,0x00000835,
+0x0004003d,0x00000015,0x00000839,0x000007ac,
+0x0003003e,0x00000838,0x00000839,0x0004003d,
+0x0000000d,0x0000083b,0x000007aa,0x0003003e,
+0x0000083a,0x0000083b,0x0004003d,0x0000000d,
+0x0000083d,0x000007ae,0x0003003e,0x0000083c,
+0x0000083d,0x0004003d,0x0000000d,0x0000083f,
+0x00000765,0x0003003e,0x0000083e,0x0000083f,
+0x00080039,0x0000003d,0x00000840,0x00000043,
+0x00000838,0x0000083a,0x0000083c,0x0000083e,
+0x0003003e,0x00000837,0x00000840,0x0003003e,
+0x00000841,0x00000109,0x000200f9,0x00000842,
+0x000200f8,0x00000842,0x000400f6,0x00000844,
+0x00000845,0x00000000,0x000200f9,0x00000846,
+0x000200f8,0x00000846,0x0004003d,0x00000006,
+0x00000847,0x00000841,0x000500b1,0x00000099,
+0x00000848,0x00000847,0x00000269,0x000400fa,
+0x00000848,0x00000843,0x00000844,0x000200f8,
+0x00000843,0x0004003d,0x0000000d,0x00000849,
+0x000007ab,0x0004003d,0x0000000d,0x00000858,
+0x00000765,0x0003003e,0x00000859,0x00000857,
+0x00050041,0x0000000e,0x0000085a,0x00000859,
+0x00000858,0x0004003d,0x0000000d,0x0000085b,
+0x0000085a,0x0004003d,0x00000006,0x0000085c,
+0x00000841,0x00050041,0x0000000e,0x0000085d,
+0x00000837,0x0000085c,0x0004003d,0x0000000d,
+0x0000085e,0x0000085d,0x00050080,0x0000000d,
+0x0000085f,0x0000085b,0x0000085e,0x0003003e,
+0x00000861,0x00000856,0x00050041,0x0000000e,
+0x00000862,0x00000861,0x0000085f,0x0004003d,
+0x0000000d,0x00000863,0x00000862,0x00050041,
+0x0000000e,0x00000864,0x000007ed,0x00000849,
+0x0003003e,0x00000864,0x00000863,0x0004003d,
+0x0000000d,0x00000865,0x000007ab,0x00050041,
+0x0000000e,0x00000866,0x000007ed,0x00000865,
+0x0004003d,0x0000000d,0x00000867,0x00000866,
+0x000500ac,0x00000099,0x00000868,0x00000867,
+0x00000088,0x000300f7,0x0000086a,0x00000000,
+0x000400fa,0x00000868,0x00000869,0x0000086a,
+0x000200f8,0x00000869,0x0004003d,0x0000000d,
+0x0000086b,0x000007ab,0x00050041,0x0000000e,
+0x0000086c,0x000007ed,0x0000086b,0x0004003d,
+0x0000000d,0x0000086d,0x0000086c,0x00050080,
+0x0000000d,0x0000086e,0x0000086d,0x00000082,
+0x00050041,0x0000000e,0x0000086f,0x000007ed,
+0x0000086b,0x0003003e,0x0000086f,0x0000086e,
+0x000200f9,0x0000086a,0x000200f8,0x0000086a,
+0x0004003d,0x0000000d,0x00000870,0x000007ab,
+0x00050080,0x0000000d,0x00000871,0x00000870,
+0x0000008e,0x0003003e,0x000007ab,0x00000871,
+0x0004003d,0x0000000d,0x00000872,0x000007ab,
+0x0004003d,0x0000000d,0x00000873,0x00000766,
+0x000500ae,0x00000099,0x00000874,0x00000872,
+0x00000873,0x000300f7,0x00000876,0x00000000,
+0x000400fa,0x00000874,0x00000875,0x00000876,
+0x000200f8,0x00000875,0x000200f9,0x00000844,
+0x000200f8,0x00000876,0x000200f9,0x00000845,
+0x000200f8,0x00000845,0x0004003d,0x00000006,
+0x00000878,0x00000841,0x00050080,0x00000006,
+0x00000879,0x00000878,0x0000008e,0x0003003e,
+0x00000841,0x00000879,0x000200f9,0x00000842,
+0x000200f8,0x00000844,0x000200f9,0x00000836,
+0x000200f8,0x0000087a,0x0004003d,0x00000015,
+0x0000087d,0x000007ac,0x0003003e,0x0000087c,
+0x0000087d,0x0004003d,0x0000000d,0x0000087f,
+0x000007aa,0x0003003e,0x0000087e,0x0000087f,
+0x0004003d,0x0000000d,0x00000881,0x0000079d,
+0x0003003e,0x00000880,0x00000881,0x00070039,
+0x0000000d,0x00000882,0x0000001b,0x0000087c,
+0x0000087e,0x00000880,0x0003003e,0x0000087b,
+0x00000882,0x0004003d,0x0000000d,0x00000884,
+0x0000087b,0x0004003d,0x0000000d,0x00000887,
+0x00000765,0x00050082,0x0000000d,0x00000888,
+0x00000887,0x00000082,0x0003003e,0x0000088a,
+0x00000886,0x00050041,0x0000000e,0x0000088b,
+0x0000088a,0x00000888,0x0004003d,0x0000000d,
+0x0000088c,0x0000088b,0x00050084,0x0000000d,
+0x0000088d,0x00000884,0x0000088c,0x0004003d,
+0x0000000d,0x0000088e,0x0000087b,0x0004003d,
+0x0000000d,0x00000890,0x00000765,0x00050082,
+0x0000000d,0x00000891,0x00000890,0x00000082,
+0x0003003e,0x00000892,0x0000088f,0x00050041,
+0x0000000e,0x00000893,0x00000892,0x00000891,
+0x0004003d,0x0000000d,0x00000894,0x00000893,
+0x000500c2,0x0000000d,0x00000895,0x0000088e,
+0x00000894,0x000500c5,0x0000000d,0x00000896,
+0x0000088d,0x00000895,0x0003003e,0x00000883,
+0x00000896,0x0004003d,0x0000000d,0x00000897,
+0x000007ab,0x0004003d,0x0000000d,0x00000898,
+0x00000883,0x00050041,0x0000000e,0x00000899,
+0x000007ed,0x00000897,0x0003003e,0x00000899,
+0x00000898,0x0004003d,0x0000000d,0x0000089a,
+0x000007ab,0x00050041,0x0000000e,0x0000089b,
+0x000007ed,0x0000089a,0x0004003d,0x0000000d,
+0x0000089c,0x0000089b,0x000500ac,0x00000099,
+0x0000089d,0x0000089c,0x00000088,0x000300f7,
+0x0000089f,0x00000000,0x000400fa,0x0000089d,
+0x0000089e,0x0000089f,0x000200f8,0x0000089e,
+0x0004003d,0x0000000d,0x000008a0,0x000007ab,
+0x00050041,0x0000000e,0x000008a1,0x000007ed,
+0x000008a0,0x0004003d,0x0000000d,0x000008a2,
+0x000008a1,0x00050080,0x0000000d,0x000008a3,
+0x000008a2,0x00000082,0x00050041,0x0000000e,
+0x000008a4,0x000007ed,0x000008a0,0x0003003e,
+0x000008a4,0x000008a3,0x000200f9,0x0000089f,
+0x000200f8,0x0000089f,0x0004003d,0x0000000d,
+0x000008a5,0x000007ab,0x00050080,0x0000000d,
+0x000008a6,0x000008a5,0x0000008e,0x0003003e,
+0x000007ab,0x000008a6,0x000200f9,0x00000836,
+0x000200f8,0x00000836,0x000200f9,0x000007d7,
+0x000200f8,0x000007d7,0x0004003d,0x0000000d,
+0x000008a7,0x0000079d,0x0004003d,0x0000000d,
+0x000008a8,0x000007aa,0x00050080,0x0000000d,
+0x000008a9,0x000008a8,0x000008a7,0x0003003e,
+0x000007aa,0x000008a9,0x000200f9,0x000007cf,
+0x000200f8,0x000007cf,0x000200f9,0x000007cc,
+0x000200f8,0x000007ce,0x0004003d,0x0000000d,
+0x000008ab,0x000006af,0x000500c2,0x0000000d,
+0x000008ad,0x000008ab,0x000008ac,0x000500c7,
+0x0000000d,0x000008ae,0x000008ad,0x0000003c,
+0x00050080,0x0000000d,0x000008af,0x000008ae,
+0x00000082,0x0003003e,0x000008aa,0x000008af,
+0x0004003d,0x0000000d,0x000008b0,0x000006c1,
+0x000500aa,0x00000099,0x000008b1,0x000008b0,
+0x00000082,0x0004003d,0x0000000d,0x000008b2,
+0x000008aa,0x000500aa,0x00000099,0x000008b3,
+0x000008b2,0x000000de,0x000500a7,0x00000099,
+0x000008b4,0x000008b1,0x000008b3,0x000300f7,
+0x000008b6,0x00000000,0x000400fa,0x000008b4,
+0x000008b5,0x000008b6,0x000200f8,0x000008b5,
+0x00040039,0x0000006d,0x000008b7,0x00000073,
+0x000200fe,0x000008b7,0x000200f8,0x000008b6,
+0x0004003d,0x0000000d,0x000008bb,0x00000766,
+0x0003003e,0x000008ba,0x000008bb,0x0004003d,
+0x0000000d,0x000008bd,0x00000763,0x0003003e,
+0x000008bc,0x000008bd,0x0004003d,0x0000000d,
+0x000008bf,0x00000764,0x0003003e,0x000008be,
+0x000008bf,0x0004003d,0x0000000d,0x000008c1,
+0x00000765,0x0003003e,0x000008c0,0x000008c1,
+0x00080039,0x0000000d,0x000008c2,0x00000029,
+0x000008ba,0x000008bc,0x000008be,0x000008c0,
+0x00050082,0x0000000d,0x000008c3,0x000002ab,
+0x000008c2,0x0003003e,0x000008b9,0x000008c3,
+0x0003003e,0x000008c4,0x000000c9,0x0004003d,
+0x0000000d,0x000008c5,0x000008aa,0x000500aa,
+0x00000099,0x000008c6,0x000008c5,0x00000082,
+0x000300f7,0x000008c8,0x00000000,0x000400fa,
+0x000008c6,0x000008c7,0x000008d3,0x000200f8,
+0x000008c7,0x0004003d,0x0000000d,0x000008ca,
+0x000006af,0x000500c2,0x0000000d,0x000008cc,
+0x000008ca,0x000008cb,0x000500c7,0x0000000d,
+0x000008cd,0x000008cc,0x0000056b,0x00050041,
+0x0000000e,0x000008ce,0x000008c9,0x000000c9,
+0x0003003e,0x000008ce,0x000008cd,0x0004003d,
+0x0000000d,0x000008cf,0x000008b9,0x0004003d,
+0x0000000d,0x000008d0,0x000006c1,0x00050084,
+0x0000000d,0x000008d1,0x000008d0,0x000000e7,
+0x00050082,0x0000000d,0x000008d2,0x000008cf,
+0x000008d1,0x0003003e,0x000008c4,0x000008d2,
+0x000200f9,0x000008c8,0x000200f8,0x000008d3,
+0x0004003d,0x0000000d,0x000008d5,0x000006af,
+0x000500c2,0x0000000d,0x000008d7,0x000008d5,
+0x000008d6,0x000500c7,0x0000000d,0x000008d8,
+0x000008d7,0x0000003c,0x0003003e,0x000008d4,
+0x000008d8,0x0004003d,0x0000000d,0x000008da,
+0x000008d4,0x000500aa,0x00000099,0x000008db,
+0x000008da,0x000000c9,0x000300f7,0x000008de,
+0x00000000,0x000400fa,0x000008db,0x000008dd,
+0x000008df,0x000200f8,0x000008dd,0x0003003e,
+0x000008dc,0x000000c9,0x000200f9,0x000008de,
+0x000200f8,0x000008df,0x0004003d,0x0000000d,
+0x000008e1,0x000008aa,0x00050082,0x0000000d,
+0x000008e2,0x000008e1,0x00000082,0x0003003e,
+0x000008e3,0x000008e0,0x00050041,0x0000000e,
+0x000008e4,0x000008e3,0x000008e2,0x0004003d,
+0x0000000d,0x000008e5,0x000008e4,0x0003003e,
+0x000008dc,0x000008e5,0x000200f9,0x000008de,
+0x000200f8,0x000008de,0x0004003d,0x0000000d,
+0x000008e6,0x000008dc,0x0003003e,0x000008d9,
+0x000008e6,0x0004003d,0x0000000d,0x000008e8,
+0x000008b9,0x0004003d,0x0000000d,0x000008e9,
+0x000008d9,0x00050082,0x0000000d,0x000008ea,
+0x000008e8,0x000008e9,0x0003003e,0x000008e7,
+0x000008ea,0x0004003d,0x0000000d,0x000008eb,
+0x000008e7,0x0004003d,0x0000000d,0x000008ec,
+0x000006c1,0x00050084,0x0000000d,0x000008ed,
+0x000008ec,0x000000e7,0x00050082,0x0000000d,
+0x000008ee,0x000008eb,0x000008ed,0x0003003e,
+0x000008c4,0x000008ee,0x0004003d,0x0000000d,
+0x000008ef,0x000008d4,0x000500aa,0x00000099,
+0x000008f0,0x000008ef,0x000000c9,0x000300f7,
+0x000008f2,0x00000000,0x000400fa,0x000008f0,
+0x000008f1,0x000008fd,0x000200f8,0x000008f1,
+0x0004003d,0x0000000d,0x000008f4,0x000006af,
+0x000500c2,0x0000000d,0x000008f6,0x000008f4,
+0x000008f5,0x000500c7,0x0000000d,0x000008f7,
+0x000008f6,0x0000056b,0x0003003e,0x000008f3,
+0x000008f7,0x0004003d,0x0000000d,0x000008f8,
+0x000008f3,0x0004003d,0x0000000d,0x000008f9,
+0x000008f3,0x0004003d,0x0000000d,0x000008fa,
+0x000008f3,0x0004003d,0x0000000d,0x000008fb,
+0x000008f3,0x00070050,0x00000015,0x000008fc,
+0x000008f8,0x000008f9,0x000008fa,0x000008fb,
+0x0003003e,0x000008c9,0x000008fc,0x000200f9,
+0x000008f2,0x000200f8,0x000008fd,0x0004003d,
+0x0000000d,0x000008ff,0x000008d4,0x00050082,
+0x0000000d,0x00000900,0x000008ff,0x00000082,
+0x0003003e,0x000008fe,0x00000900,0x0004003d,
+0x0000000d,0x00000902,0x000008fe,0x0004003d,
+0x0000000d,0x00000904,0x000006af,0x0003003e,
+0x00000903,0x00000904,0x0003003e,0x00000905,
+0x000008f5,0x00060039,0x0000000d,0x00000906,
+0x00000013,0x00000903,0x00000905,0x0004003d,
+0x0000000d,0x00000908,0x000006af,0x0003003e,
+0x00000907,0x00000908,0x0003003e,0x00000909,
+0x00000599,0x00060039,0x0000000d,0x0000090a,
+0x00000013,0x00000907,0x00000909,0x0004003d,
+0x0000000d,0x0000090d,0x000006af,0x0003003e,
+0x0000090c,0x0000090d,0x0003003e,0x0000090e,
+0x0000090b,0x00060039,0x0000000d,0x0000090f,
+0x00000013,0x0000090c,0x0000090e,0x0004003d,
+0x0000000d,0x00000911,0x000006af,0x0003003e,
+0x00000910,0x00000911,0x0003003e,0x00000912,
+0x0000058a,0x00060039,0x0000000d,0x00000913,
+0x00000013,0x00000910,0x00000912,0x00070050,
+0x00000015,0x00000914,0x00000906,0x0000090a,
+0x0000090f,0x00000913,0x00070050,0x00000015,
+0x00000915,0x00000902,0x00000902,0x00000902,
+0x00000902,0x00050080,0x00000015,0x00000916,
+0x00000915,0x00000914,0x0003003e,0x00000901,
+0x00000916,0x0003003e,0x00000918,0x00000076,
+0x0004003d,0x0000000d,0x0000091a,0x000008e7,
+0x0003003e,0x00000919,0x0000091a,0x0004003d,
+0x0000000d,0x0000091c,0x000008d9,0x0003003e,
+0x0000091b,0x0000091c,0x00070039,0x0000000d,
+0x0000091d,0x0000001b,0x00000918,0x00000919,
+0x0000091b,0x0003003e,0x00000917,0x0000091d,
+0x0004003d,0x0000000d,0x00000920,0x000008aa,
+0x00050082,0x0000000d,0x00000921,0x00000920,
+0x00000082,0x0003003e,0x00000922,0x0000091f,
+0x00050041,0x0000000e,0x00000923,0x00000922,
+0x00000921,0x0004003d,0x0000000d,0x00000924,
+0x00000923,0x0003003e,0x0000091e,0x00000924,
+0x0004003d,0x0000000d,0x00000926,0x00000917,
+0x0004003d,0x0000000d,0x00000927,0x0000091e,
+0x000500c4,0x0000000d,0x00000928,0x00000926,
+0x00000927,0x0004003d,0x0000000d,0x00000929,
+0x000006af,0x000500c2,0x0000000d,0x0000092a,
+0x00000929,0x0000090b,0x000500c7,0x0000000d,
+0x0000092b,0x0000092a,0x0000003c,0x0004003d,
+0x0000000d,0x0000092c,0x0000091e,0x00050082,
+0x0000000d,0x0000092d,0x000000e7,0x0000092c,
+0x000500c2,0x0000000d,0x0000092e,0x0000092b,
+0x0000092d,0x000500c5,0x0000000d,0x0000092f,
+0x00000928,0x0000092e,0x0003003e,0x00000925,
+0x0000092f,0x0004003d,0x00000015,0x00000930,
+0x00000901,0x00070050,0x00000049,0x00000931,
+0x00000124,0x00000124,0x00000124,0x00000124,
+0x000500c4,0x00000015,0x00000932,0x00000930,
+0x00000931,0x0004003d,0x0000000d,0x00000933,
+0x00000925,0x000500c7,0x0000000d,0x00000934,
+0x00000933,0x0000003c,0x0004003d,0x0000000d,
+0x00000935,0x00000925,0x000500c2,0x0000000d,
+0x00000936,0x00000935,0x00000124,0x000500c7,
+0x0000000d,0x00000937,0x00000936,0x0000003c,
+0x0004003d,0x0000000d,0x00000938,0x00000925,
+0x000500c2,0x0000000d,0x00000939,0x00000938,
+0x0000052a,0x000500c7,0x0000000d,0x0000093a,
+0x00000939,0x0000003c,0x0004003d,0x0000000d,
+0x0000093b,0x00000925,0x000500c2,0x0000000d,
+0x0000093c,0x0000093b,0x00000540,0x000500c7,
+0x0000000d,0x0000093d,0x0000093c,0x0000003c,
+0x00070050,0x00000015,0x0000093e,0x00000934,
+0x00000937,0x0000093a,0x0000093d,0x000500c5,
+0x00000015,0x0000093f,0x00000932,0x0000093e,
+0x0003003e,0x000008c9,0x0000093f,0x000200f9,
+0x000008f2,0x000200f8,0x000008f2,0x000200f9,
+0x000008c8,0x000200f8,0x000008c8,0x0003003e,
+0x00000940,0x000000c9,0x0003003e,0x00000941,
+0x000000c9,0x000200f9,0x00000942,0x000200f8,
+0x00000942,0x000400f6,0x00000944,0x00000945,
+0x00000000,0x000200f9,0x00000946,0x000200f8,
+0x00000946,0x0004003d,0x0000000d,0x00000947,
+0x00000941,0x0004003d,0x0000000d,0x00000948,
+0x000008aa,0x000500b0,0x00000099,0x00000949,
+0x00000947,0x00000948,0x000400fa,0x00000949,
+0x00000943,0x00000944,0x000200f8,0x00000943,
+0x0004003d,0x0000000d,0x0000094a,0x00000941,
+0x00050041,0x0000000e,0x0000094c,0x000008c9,
+0x0000094a,0x0004003d,0x0000000d,0x0000094d,
+0x0000094c,0x0003003e,0x0000094b,0x0000094d,
+0x00050039,0x0000000d,0x0000094e,0x00000047,
+0x0000094b,0x0004003d,0x0000000d,0x0000094f,
+0x00000940,0x00050080,0x0000000d,0x00000950,
+0x0000094f,0x0000094e,0x0003003e,0x00000940,
+0x00000950,0x000200f9,0x00000945,0x000200f8,
+0x00000945,0x0004003d,0x0000000d,0x00000951,
+0x00000941,0x00050080,0x0000000d,0x00000952,
+0x00000951,0x0000008e,0x0003003e,0x00000941,
+0x00000952,0x000200f9,0x00000942,0x000200f8,
+0x00000944,0x0004003d,0x0000000d,0x00000954,
+0x000008aa,0x000500aa,0x00000099,0x00000955,
+0x00000954,0x00000082,0x000600a9,0x00000006,
+0x00000957,0x00000955,0x00000520,0x00000956,
+0x0004007c,0x0000000d,0x00000958,0x00000957,
+0x0003003e,0x00000953,0x00000958,0x0004003d,
+0x0000000d,0x0000095a,0x000008c4,0x0004003d,
+0x0000000d,0x0000095b,0x00000953,0x00050082,
+0x0000000d,0x0000095c,0x0000095a,0x0000095b,
+0x0003003e,0x00000959,0x0000095c,0x0004003d,
+0x0000000d,0x0000095d,0x00000959,0x000500ae,
+0x00000099,0x0000095e,0x0000095d,0x000002ab,
+0x000300f7,0x00000960,0x00000000,0x000400fa,
+0x0000095e,0x0000095f,0x00000960,0x000200f8,
+0x0000095f,0x00040039,0x0000006d,0x00000961,
+0x00000073,0x000200fe,0x00000961,0x000200f8,
+0x00000960,0x0003003e,0x00000963,0x000000c9,
+0x0003003e,0x00000964,0x000000c9,0x0003003e,
+0x00000965,0x000000c9,0x0003003e,0x00000966,
+0x000000c9,0x000200f9,0x00000967,0x000200f8,
+0x00000967,0x000400f6,0x00000969,0x0000096a,
+0x00000000,0x000200f9,0x0000096b,0x000200f8,
+0x0000096b,0x0004003d,0x0000000d,0x0000096c,
+0x00000966,0x000500b0,0x00000099,0x0000096d,
+0x0000096c,0x00000800,0x000400fa,0x0000096d,
+0x00000968,0x00000969,0x000200f8,0x00000968,
+0x0004003d,0x0000000d,0x00000977,0x00000966,
+0x0003003e,0x00000979,0x00000976,0x00060041,
+0x0000000e,0x0000097a,0x00000979,0x00000977,
+0x00000109,0x0004003d,0x0000000d,0x0000097b,
+0x0000097a,0x0003003e,0x00000964,0x0000097b,
+0x0004003d,0x0000000d,0x0000097c,0x00000966,
+0x0003003e,0x0000097d,0x00000976,0x00060041,
+0x0000000e,0x0000097e,0x0000097d,0x0000097c,
+0x0000008e,0x0004003d,0x0000000d,0x0000097f,
+0x0000097e,0x0003003e,0x00000963,0x0000097f,
+0x0004003d,0x0000000d,0x00000980,0x00000966,
+0x0003003e,0x00000981,0x00000976,0x00060041,
+0x0000000e,0x00000982,0x00000981,0x00000980,
+0x00000124,0x0004003d,0x0000000d,0x00000983,
+0x00000982,0x0003003e,0x00000965,0x00000983,
+0x0004003d,0x0000000d,0x00000985,0x00000940,
+0x0003003e,0x00000984,0x00000985,0x0004003d,
+0x0000000d,0x00000987,0x00000964,0x0003003e,
+0x00000986,0x00000987,0x0004003d,0x0000000d,
+0x00000989,0x00000963,0x0003003e,0x00000988,
+0x00000989,0x0004003d,0x0000000d,0x0000098b,
+0x00000965,0x0003003e,0x0000098a,0x0000098b,
+0x00080039,0x0000000d,0x0000098c,0x00000029,
+0x00000984,0x00000986,0x00000988,0x0000098a,
+0x0004003d,0x0000000d,0x0000098d,0x00000959,
+0x000500b2,0x00000099,0x0000098e,0x0000098c,
+0x0000098d,0x000300f7,0x00000990,0x00000000,
+0x000400fa,0x0000098e,0x0000098f,0x00000990,
+0x000200f8,0x0000098f,0x000200f9,0x00000969,
+0x000200f8,0x00000990,0x000200f9,0x0000096a,
+0x000200f8,0x0000096a,0x0004003d,0x0000000d,
+0x00000992,0x00000966,0x00050080,0x0000000d,
+0x00000993,0x00000992,0x0000008e,0x0003003e,
+0x00000966,0x00000993,0x000200f9,0x00000967,
+0x000200f8,0x00000969,0x0004003d,0x0000000d,
+0x00000994,0x00000966,0x000500ae,0x00000099,
+0x00000995,0x00000994,0x00000800,0x000300f7,
+0x00000997,0x00000000,0x000400fa,0x00000995,
+0x00000996,0x00000997,0x000200f8,0x00000996,
+0x00040039,0x0000006d,0x00000998,0x00000073,
+0x000200fe,0x00000998,0x000200f8,0x00000997,
+0x0004003d,0x0000000d,0x0000099c,0x00000940,
+0x0003003e,0x0000099b,0x0000099c,0x0004003d,
+0x0000000d,0x0000099e,0x00000964,0x0003003e,
+0x0000099d,0x0000099e,0x0004003d,0x0000000d,
+0x000009a0,0x00000963,0x0003003e,0x0000099f,
+0x000009a0,0x0004003d,0x0000000d,0x000009a2,
+0x00000965,0x0003003e,0x000009a1,0x000009a2,
+0x00080039,0x0000000d,0x000009a3,0x00000029,
+0x0000099b,0x0000099d,0x0000099f,0x000009a1,
+0x0003003e,0x0000099a,0x000009a3,0x0004003d,
+0x0000000d,0x000009a5,0x00000953,0x0004003d,
+0x0000000d,0x000009a6,0x0000099a,0x00050080,
+0x0000000d,0x000009a7,0x000009a5,0x000009a6,
+0x0003003e,0x000009a4,0x000009a7,0x0003003e,
+0x000009a8,0x000000c9,0x0003003e,0x000009a9,
+0x000000c9,0x0004003d,0x0000000d,0x000009ab,
+0x00000964,0x0003003e,0x000009aa,0x000009ab,
+0x0004003d,0x0000000d,0x000009ad,0x00000963,
+0x0003003e,0x000009ac,0x000009ad,0x0004003d,
+0x0000000d,0x000009af,0x00000965,0x0003003e,
+0x000009ae,0x000009af,0x00090039,0x00000002,
+0x000009b2,0x00000031,0x000009aa,0x000009ac,
+0x000009ae,0x000009b0,0x000009b1,0x0004003d,
+0x0000000d,0x000009b3,0x000009b0,0x0003003e,
+0x000009a9,0x000009b3,0x0004003d,0x0000000d,
+0x000009b4,0x000009b1,0x0003003e,0x000009a8,
+0x000009b4,0x0004003d,0x0000000d,0x000009b6,
+0x00000953,0x0003003e,0x000009b5,0x000009b6,
+0x0003003e,0x000009b7,0x000000c9,0x000200f9,
+0x000009b8,0x000200f8,0x000009b8,0x000400f6,
+0x000009ba,0x000009bb,0x00000000,0x000200f9,
+0x000009bc,0x000200f8,0x000009bc,0x0004003d,
+0x0000000d,0x000009bd,0x000009b7,0x0004003d,
+0x0000000d,0x000009be,0x00000940,0x000500b0,
+0x00000099,0x000009bf,0x000009bd,0x000009be,
+0x000400fa,0x000009bf,0x000009b9,0x000009ba,
+0x000200f8,0x000009b9,0x0004003d,0x0000000d,
+0x000009c0,0x00000964,0x000500aa,0x00000099,
+0x000009c1,0x000009c0,0x00000082,0x000300f7,
+0x000009c3,0x00000000,0x000400fa,0x000009c1,
+0x000009c2,0x00000aa3,0x000200f8,0x000009c2,
+0x0003003e,0x000009c5,0x00000076,0x0004003d,
+0x0000000d,0x000009c7,0x000009b5,0x0003003e,
+0x000009c6,0x000009c7,0x0004003d,0x0000000d,
+0x000009c9,0x000009a4,0x0003003e,0x000009c8,
+0x000009c9,0x0004003d,0x0000000d,0x000009cb,
+0x00000965,0x0003003e,0x000009ca,0x000009cb,
+0x00080039,0x00000034,0x000009cc,0x0000003a,
+0x000009c5,0x000009c6,0x000009c8,0x000009ca,
+0x0003003e,0x000009c4,0x000009cc,0x0003003e,
+0x000009cd,0x00000109,0x000200f9,0x000009ce,
+0x000200f8,0x000009ce,0x000400f6,0x000009d0,
+0x000009d1,0x00000000,0x000200f9,0x000009d2,
+0x000200f8,0x000009d2,0x0004003d,0x00000006,
+0x000009d3,0x000009cd,0x000500b1,0x00000099,
+0x000009d4,0x000009d3,0x00000110,0x000400fa,
+0x000009d4,0x000009cf,0x000009d0,0x000200f8,
+0x000009cf,0x0004003d,0x0000000d,0x000009d6,
+0x000009b7,0x0004003d,0x0000000d,0x00000a8b,
+0x00000965,0x0003003e,0x00000a8d,0x00000a8a,
+0x00050041,0x0000000e,0x00000a8e,0x00000a8d,
+0x00000a8b,0x0004003d,0x0000000d,0x00000a8f,
+0x00000a8e,0x0004003d,0x00000006,0x00000a90,
+0x000009cd,0x00050041,0x0000000e,0x00000a91,
+0x000009c4,0x00000a90,0x0004003d,0x0000000d,
+0x00000a92,0x00000a91,0x00050080,0x0000000d,
+0x00000a93,0x00000a8f,0x00000a92,0x0003003e,
+0x00000a95,0x00000a88,0x00050041,0x0000000e,
+0x00000a96,0x00000a95,0x00000a93,0x0004003d,
+0x0000000d,0x00000a97,0x00000a96,0x00050041,
+0x0000000e,0x00000a98,0x000009d5,0x000009d6,
+0x0003003e,0x00000a98,0x00000a97,0x0004003d,
+0x0000000d,0x00000a99,0x000009b7,0x00050080,
+0x0000000d,0x00000a9a,0x00000a99,0x0000008e,
+0x0003003e,0x000009b7,0x00000a9a,0x0004003d,
+0x0000000d,0x00000a9b,0x000009b7,0x0004003d,
+0x0000000d,0x00000a9c,0x00000940,0x000500ae,
+0x00000099,0x00000a9d,0x00000a9b,0x00000a9c,
+0x000300f7,0x00000a9f,0x00000000,0x000400fa,
+0x00000a9d,0x00000a9e,0x00000a9f,0x000200f8,
+0x00000a9e,0x000200f9,0x000009d0,0x000200f8,
+0x00000a9f,0x000200f9,0x000009d1,0x000200f8,
+0x000009d1,0x0004003d,0x00000006,0x00000aa1,
+0x000009cd,0x00050080,0x00000006,0x00000aa2,
+0x00000aa1,0x0000008e,0x0003003e,0x000009cd,
+0x00000aa2,0x000200f9,0x000009ce,0x000200f8,
+0x000009d0,0x000200f9,0x000009c3,0x000200f8,
+0x00000aa3,0x0004003d,0x0000000d,0x00000aa4,
+0x00000963,0x000500aa,0x00000099,0x00000aa5,
+0x00000aa4,0x00000082,0x000300f7,0x00000aa7,
+0x00000000,0x000400fa,0x00000aa5,0x00000aa6,
+0x00000adc,0x000200f8,0x00000aa6,0x0003003e,
+0x00000aa9,0x00000076,0x0004003d,0x0000000d,
+0x00000aab,0x000009b5,0x0003003e,0x00000aaa,
+0x00000aab,0x0004003d,0x0000000d,0x00000aad,
+0x000009a4,0x0003003e,0x00000aac,0x00000aad,
+0x0004003d,0x0000000d,0x00000aaf,0x00000965,
+0x0003003e,0x00000aae,0x00000aaf,0x00080039,
+0x0000003d,0x00000ab0,0x00000043,0x00000aa9,
+0x00000aaa,0x00000aac,0x00000aae,0x0003003e,
+0x00000aa8,0x00000ab0,0x0003003e,0x00000ab1,
+0x00000109,0x000200f9,0x00000ab2,0x000200f8,
+0x00000ab2,0x000400f6,0x00000ab4,0x00000ab5,
+0x00000000,0x000200f9,0x00000ab6,0x000200f8,
+0x00000ab6,0x0004003d,0x00000006,0x00000ab7,
+0x00000ab1,0x000500b1,0x00000099,0x00000ab8,
+0x00000ab7,0x00000269,0x000400fa,0x00000ab8,
+0x00000ab3,0x00000ab4,0x000200f8,0x00000ab3,
+0x0004003d,0x0000000d,0x00000ab9,0x000009b7,
+0x0004003d,0x0000000d,0x00000ac5,0x00000965,
+0x0003003e,0x00000ac6,0x00000ac4,0x00050041,
+0x0000000e,0x00000ac7,0x00000ac6,0x00000ac5,
+0x0004003d,0x0000000d,0x00000ac8,0x00000ac7,
+0x0004003d,0x00000006,0x00000ac9,0x00000ab1,
+0x00050041,0x0000000e,0x00000aca,0x00000aa8,
+0x00000ac9,0x0004003d,0x0000000d,0x00000acb,
+0x00000aca,0x00050080,0x0000000d,0x00000acc,
+0x00000ac8,0x00000acb,0x0003003e,0x00000ace,
+0x00000ac3,0x00050041,0x0000000e,0x00000acf,
+0x00000ace,0x00000acc,0x0004003d,0x0000000d,
+0x00000ad0,0x00000acf,0x00050041,0x0000000e,
+0x00000ad1,0x000009d5,0x00000ab9,0x0003003e,
+0x00000ad1,0x00000ad0,0x0004003d,0x0000000d,
+0x00000ad2,0x000009b7,0x00050080,0x0000000d,
+0x00000ad3,0x00000ad2,0x0000008e,0x0003003e,
+0x000009b7,0x00000ad3,0x0004003d,0x0000000d,
+0x00000ad4,0x000009b7,0x0004003d,0x0000000d,
+0x00000ad5,0x00000940,0x000500ae,0x00000099,
+0x00000ad6,0x00000ad4,0x00000ad5,0x000300f7,
+0x00000ad8,0x00000000,0x000400fa,0x00000ad6,
+0x00000ad7,0x00000ad8,0x000200f8,0x00000ad7,
+0x000200f9,0x00000ab4,0x000200f8,0x00000ad8,
+0x000200f9,0x00000ab5,0x000200f8,0x00000ab5,
+0x0004003d,0x00000006,0x00000ada,0x00000ab1,
+0x00050080,0x00000006,0x00000adb,0x00000ada,
+0x0000008e,0x0003003e,0x00000ab1,0x00000adb,
+0x000200f9,0x00000ab2,0x000200f8,0x00000ab4,
+0x000200f9,0x00000aa7,0x000200f8,0x00000adc,
+0x0003003e,0x00000ade,0x00000076,0x0004003d,
+0x0000000d,0x00000ae0,0x000009b5,0x0003003e,
+0x00000adf,0x00000ae0,0x0004003d,0x0000000d,
+0x00000ae2,0x000009a8,0x0003003e,0x00000ae1,
+0x00000ae2,0x00070039,0x0000000d,0x00000ae3,
+0x0000001b,0x00000ade,0x00000adf,0x00000ae1,
+0x0003003e,0x00000add,0x00000ae3,0x0004003d,
+0x0000000d,0x00000ae5,0x00000add,0x0004003d,
+0x0000000d,0x00000ae8,0x00000965,0x00050082,
+0x0000000d,0x00000ae9,0x00000ae8,0x00000082,
+0x0003003e,0x00000aeb,0x00000ae7,0x00050041,
+0x0000000e,0x00000aec,0x00000aeb,0x00000ae9,
+0x0004003d,0x0000000d,0x00000aed,0x00000aec,
+0x00050084,0x0000000d,0x00000aee,0x00000ae5,
+0x00000aed,0x0004003d,0x0000000d,0x00000aef,
+0x00000add,0x0004003d,0x0000000d,0x00000af1,
+0x00000965,0x00050082,0x0000000d,0x00000af2,
+0x00000af1,0x00000082,0x0003003e,0x00000af3,
+0x00000af0,0x00050041,0x0000000e,0x00000af4,
+0x00000af3,0x00000af2,0x0004003d,0x0000000d,
+0x00000af5,0x00000af4,0x000500c2,0x0000000d,
+0x00000af6,0x00000aef,0x00000af5,0x000500c5,
+0x0000000d,0x00000af7,0x00000aee,0x00000af6,
+0x0003003e,0x00000ae4,0x00000af7,0x0004003d,
+0x0000000d,0x00000af8,0x000009b7,0x0004003d,
+0x0000000d,0x00000af9,0x00000ae4,0x00050041,
+0x0000000e,0x00000afa,0x000009d5,0x00000af8,
+0x0003003e,0x00000afa,0x00000af9,0x0004003d,
+0x0000000d,0x00000afb,0x000009b7,0x00050080,
+0x0000000d,0x00000afc,0x00000afb,0x0000008e,
+0x0003003e,0x000009b7,0x00000afc,0x000200f9,
+0x00000aa7,0x000200f8,0x00000aa7,0x000200f9,
+0x000009c3,0x000200f8,0x000009c3,0x0004003d,
+0x0000000d,0x00000afd,0x000009a8,0x0004003d,
+0x0000000d,0x00000afe,0x000009b5,0x00050080,
+0x0000000d,0x00000aff,0x00000afe,0x00000afd,
+0x0003003e,0x000009b5,0x00000aff,0x000200f9,
+0x000009bb,0x000200f8,0x000009bb,0x000200f9,
+0x000009b8,0x000200f8,0x000009ba,0x0003003e,
+0x00000b00,0x000000c9,0x0003003e,0x00000b01,
+0x000000c9,0x000200f9,0x00000b02,0x000200f8,
+0x00000b02,0x000400f6,0x00000b04,0x00000b05,
+0x00000000,0x000200f9,0x00000b06,0x000200f8,
+0x00000b06,0x0004003d,0x0000000d,0x00000b07,
+0x00000b01,0x0004003d,0x0000000d,0x00000b08,
+0x000008aa,0x000500b0,0x00000099,0x00000b09,
+0x00000b07,0x00000b08,0x000400fa,0x00000b09,
+0x00000b03,0x00000b04,0x000200f8,0x00000b03,
+0x0004003d,0x0000005a,0x00000b0a,0x000009d5,
+0x0004003d,0x0000000d,0x00000b0b,0x00000b01,
+0x0004003d,0x0000000d,0x00000b10,0x00000b01,
+0x0004003d,0x0000000d,0x00000b11,0x00000b01,
+0x0004003d,0x0000000d,0x00000b13,0x00000b00,
+0x0003003e,0x00000b12,0x00000b13,0x00050041,
+0x0000000e,0x00000b15,0x000008c9,0x00000b0b,
+0x0004003d,0x0000000d,0x00000b16,0x00000b15,
+0x0003003e,0x00000b14,0x00000b16,0x00090039,
+0x00000002,0x00000b19,0x00000061,0x00000b0a,
+0x00000b12,0x00000b14,0x00000b17,0x00000b18,
+0x0004003d,0x00000015,0x00000b1a,0x00000b17,
+0x00060041,0x00000016,0x00000b1b,0x00000b0f,
+0x00000b10,0x00000109,0x0003003e,0x00000b1b,
+0x00000b1a,0x0004003d,0x00000015,0x00000b1c,
+0x00000b18,0x00060041,0x00000016,0x00000b1d,
+0x00000b0f,0x00000b11,0x0000008e,0x0003003e,
+0x00000b1d,0x00000b1c,0x0004003d,0x0000000d,
+0x00000b1e,0x00000b01,0x00050041,0x0000000e,
+0x00000b20,0x000008c9,0x00000b1e,0x0004003d,
+0x0000000d,0x00000b21,0x00000b20,0x0003003e,
+0x00000b1f,0x00000b21,0x00050039,0x0000000d,
+0x00000b22,0x00000047,0x00000b1f,0x0004003d,
+0x0000000d,0x00000b23,0x00000b00,0x00050080,
+0x0000000d,0x00000b24,0x00000b23,0x00000b22,
+0x0003003e,0x00000b00,0x00000b24,0x000200f9,
+0x00000b05,0x000200f8,0x00000b05,0x0004003d,
+0x0000000d,0x00000b25,0x00000b01,0x00050080,
+0x0000000d,0x00000b26,0x00000b25,0x0000008e,
+0x0003003e,0x00000b01,0x00000b26,0x000200f9,
+0x00000b02,0x000200f8,0x00000b04,0x00050041,
+0x00000b29,0x00000b2a,0x00000554,0x00000109,
+0x0004003d,0x00000551,0x00000b2b,0x00000b2a,
+0x00050050,0x00000551,0x00000b2c,0x000000e7,
+0x000000e7,0x00050086,0x00000551,0x00000b2d,
+0x00000b2b,0x00000b2c,0x00050050,0x00000551,
+0x00000b2e,0x00000561,0x00000561,0x00050080,
+0x00000551,0x00000b2f,0x00000b2e,0x00000b2d,
+0x00050041,0x00000b29,0x00000b30,0x00000554,
+0x00000109,0x0004003d,0x00000551,0x00000b31,
+0x00000b30,0x00050050,0x00000551,0x00000b32,
+0x00000082,0x00000082,0x00050082,0x00000551,
+0x00000b33,0x00000b31,0x00000b32,0x00050086,
+0x00000551,0x00000b34,0x00000b2f,0x00000b33,
+0x0003003e,0x00000b28,0x00000b34,0x0004003d,
+0x0000000d,0x00000b36,0x000006c1,0x00050080,
+0x0000000d,0x00000b37,0x00000b36,0x00000082,
+0x0003003e,0x00000b35,0x00000b37,0x0003003e,
+0x00000b38,0x000000c9,0x000200f9,0x00000b39,
+0x000200f8,0x00000b39,0x000400f6,0x00000b3b,
+0x00000b3c,0x00000000,0x000200f9,0x00000b3d,
+0x000200f8,0x00000b3d,0x0004003d,0x0000000d,
+0x00000b3e,0x00000b38,0x00060041,0x00000555,
+0x00000b3f,0x00000554,0x00000109,0x00000082,
+0x0004003d,0x0000000d,0x00000b40,0x00000b3f,
+0x000500b0,0x00000099,0x00000b41,0x00000b3e,
+0x00000b40,0x000400fa,0x00000b41,0x00000b3a,
+0x00000b3b,0x000200f8,0x00000b3a,0x0003003e,
+0x00000b42,0x000000c9,0x000200f9,0x00000b43,
+0x000200f8,0x00000b43,0x000400f6,0x00000b45,
+0x00000b46,0x00000000,0x000200f9,0x00000b47,
+0x000200f8,0x00000b47,0x0004003d,0x0000000d,
+0x00000b48,0x00000b42,0x00060041,0x00000555,
+0x00000b49,0x00000554,0x00000109,0x000000c9,
+0x0004003d,0x0000000d,0x00000b4a,0x00000b49,
+0x000500b0,0x00000099,0x00000b4b,0x00000b48,
+0x00000b4a,0x000400fa,0x00000b4b,0x00000b44,
+0x00000b45,0x000200f8,0x00000b44,0x0004003d,
+0x0000000d,0x00000b4d,0x000006af,0x000500c2,
+0x0000000d,0x00000b4e,0x00000b4d,0x000008cb,
+0x000500c7,0x0000000d,0x00000b50,0x00000b4e,
+0x00000b4f,0x0003003e,0x00000b51,0x00000b50,
+0x0004003d,0x0000000d,0x00000b53,0x00000b42,
+0x0003003e,0x00000b52,0x00000b53,0x0004003d,
+0x0000000d,0x00000b55,0x00000b38,0x0003003e,
+0x00000b54,0x00000b55,0x0004003d,0x0000000d,
+0x00000b57,0x000008aa,0x0003003e,0x00000b56,
+0x00000b57,0x00080039,0x0000000d,0x00000b58,
+0x0000006a,0x00000b51,0x00000b52,0x00000b54,
+0x00000b56,0x0003003e,0x00000b4c,0x00000b58,
+0x0004003d,0x0000000d,0x00000b5d,0x00000b4c,
+0x00050041,0x0000000e,0x00000b5e,0x000008c9,
+0x00000b5d,0x0004003d,0x0000000d,0x00000b5f,
+0x00000b5e,0x0003003e,0x00000b61,0x00000b5c,
+0x00050041,0x00000b62,0x00000b63,0x00000b61,
+0x00000b5f,0x0004003d,0x00000099,0x00000b64,
+0x00000b63,0x000300f7,0x00000b66,0x00000000,
+0x000400fa,0x00000b64,0x00000b65,0x00000b66,
+0x000200f8,0x00000b65,0x0004003d,0x0000000d,
+0x00000b68,0x00000b38,0x00060041,0x00000555,
+0x00000b69,0x00000554,0x00000109,0x000000c9,
+0x0004003d,0x0000000d,0x00000b6a,0x00000b69,
+0x00050084,0x0000000d,0x00000b6b,0x00000b68,
+0x00000b6a,0x0004003d,0x0000000d,0x00000b6c,
+0x00000b42,0x00050080,0x0000000d,0x00000b6d,
+0x00000b6b,0x00000b6c,0x00050041,0x00000016,
+0x00000b6e,0x00000b67,0x00000b6d,0x0003003e,
+0x00000b6e,0x000006aa,0x000200f9,0x00000b46,
+0x000200f8,0x00000b66,0x0004003d,0x0000000d,
+0x00000b71,0x00000b42,0x0004003d,0x0000000d,
+0x00000b72,0x00000b38,0x00050050,0x00000551,
+0x00000b73,0x00000b71,0x00000b72,0x0003003e,
+0x00000b70,0x00000b73,0x0004003d,0x00000551,
+0x00000b75,0x00000b28,0x0004003d,0x00000551,
+0x00000b76,0x00000b70,0x00050084,0x00000551,
+0x00000b77,0x00000b75,0x00000b76,0x0003003e,
+0x00000b74,0x00000b77,0x0004003d,0x00000551,
+0x00000b79,0x00000b74,0x0004003d,0x0000000d,
+0x00000b7a,0x000006dd,0x0004003d,0x0000000d,
+0x00000b7b,0x000006df,0x00050050,0x00000551,
+0x00000b7c,0x00000b7a,0x00000b7b,0x00050050,
+0x00000551,0x00000b7d,0x00000082,0x00000082,
+0x00050082,0x00000551,0x00000b7e,0x00000b7c,
+0x00000b7d,0x00050084,0x00000551,0x00000b7f,
+0x00000b79,0x00000b7e,0x00050050,0x00000551,
+0x00000b80,0x00000088,0x00000088,0x00050080,
+0x00000551,0x00000b81,0x00000b7f,0x00000b80,
+0x00050050,0x00000b82,0x00000b83,0x00000540,
+0x00000540,0x000500c2,0x00000551,0x00000b84,
+0x00000b81,0x00000b83,0x0003003e,0x00000b78,
+0x00000b84,0x0004003d,0x00000551,0x00000b86,
+0x00000b78,0x00050050,0x00000b82,0x00000b87,
+0x0000052a,0x0000052a,0x000500c2,0x00000551,
+0x00000b88,0x00000b86,0x00000b87,0x0003003e,
+0x00000b85,0x00000b88,0x0004003d,0x00000551,
+0x00000b8a,0x00000b78,0x00050050,0x00000551,
+0x00000b8b,0x0000056b,0x0000056b,0x000500c7,
+0x00000551,0x00000b8c,0x00000b8a,0x00000b8b,
+0x0003003e,0x00000b89,0x00000b8c,0x00050041,
+0x0000000e,0x00000b8e,0x00000b85,0x000000c9,
+0x0004003d,0x0000000d,0x00000b8f,0x00000b8e,
+0x00050041,0x0000000e,0x00000b90,0x00000b85,
+0x00000082,0x0004003d,0x0000000d,0x00000b91,
+0x00000b90,0x0004003d,0x0000000d,0x00000b92,
+0x000006dd,0x00050084,0x0000000d,0x00000b93,
+0x00000b91,0x00000b92,0x00050080,0x0000000d,
+0x00000b94,0x00000b8f,0x00000b93,0x0003003e,
+0x00000b8d,0x00000b94,0x0004003d,0x0000000d,
+0x00000b96,0x00000b8d,0x0004003d,0x0000000d,
+0x00000b97,0x00000b35,0x00050084,0x0000000d,
+0x00000b98,0x00000b96,0x00000b97,0x00050041,
+0x0000000e,0x00000b99,0x000007ed,0x00000b98,
+0x0004003d,0x0000000d,0x00000b9a,0x00000b99,
+0x0004003d,0x0000000d,0x00000b9b,0x00000b8d,
+0x0004003d,0x0000000d,0x00000b9c,0x00000b35,
+0x00050084,0x0000000d,0x00000b9d,0x00000b9b,
+0x00000b9c,0x00050080,0x0000000d,0x00000b9e,
+0x00000b9d,0x00000082,0x00050041,0x0000000e,
+0x00000b9f,0x000007ed,0x00000b9e,0x0004003d,
+0x0000000d,0x00000ba0,0x00000b9f,0x00050050,
+0x00000551,0x00000ba1,0x00000b9a,0x00000ba0,
+0x0003003e,0x00000b95,0x00000ba1,0x0004003d,
+0x0000000d,0x00000ba3,0x00000b8d,0x00050080,
+0x0000000d,0x00000ba4,0x00000ba3,0x00000082,
+0x0004003d,0x0000000d,0x00000ba5,0x00000b35,
+0x00050084,0x0000000d,0x00000ba6,0x00000ba4,
+0x00000ba5,0x00050041,0x0000000e,0x00000ba7,
+0x000007ed,0x00000ba6,0x0004003d,0x0000000d,
+0x00000ba8,0x00000ba7,0x0004003d,0x0000000d,
+0x00000ba9,0x00000b8d,0x00050080,0x0000000d,
+0x00000baa,0x00000ba9,0x00000082,0x0004003d,
+0x0000000d,0x00000bab,0x00000b35,0x00050084,
+0x0000000d,0x00000bac,0x00000baa,0x00000bab,
+0x00050080,0x0000000d,0x00000bad,0x00000bac,
+0x00000082,0x00050041,0x0000000e,0x00000bae,
+0x000007ed,0x00000bad,0x0004003d,0x0000000d,
+0x00000baf,0x00000bae,0x00050050,0x00000551,
+0x00000bb0,0x00000ba8,0x00000baf,0x0003003e,
+0x00000ba2,0x00000bb0,0x0004003d,0x0000000d,
+0x00000bb2,0x00000b8d,0x0004003d,0x0000000d,
+0x00000bb3,0x000006dd,0x00050080,0x0000000d,
+0x00000bb4,0x00000bb2,0x00000bb3,0x0004003d,
+0x0000000d,0x00000bb5,0x00000b35,0x00050084,
+0x0000000d,0x00000bb6,0x00000bb4,0x00000bb5,
+0x00050041,0x0000000e,0x00000bb7,0x000007ed,
+0x00000bb6,0x0004003d,0x0000000d,0x00000bb8,
+0x00000bb7,0x0004003d,0x0000000d,0x00000bb9,
+0x00000b8d,0x0004003d,0x0000000d,0x00000bba,
+0x000006dd,0x00050080,0x0000000d,0x00000bbb,
+0x00000bb9,0x00000bba,0x0004003d,0x0000000d,
+0x00000bbc,0x00000b35,0x00050084,0x0000000d,
+0x00000bbd,0x00000bbb,0x00000bbc,0x00050080,
+0x0000000d,0x00000bbe,0x00000bbd,0x00000082,
+0x00050041,0x0000000e,0x00000bbf,0x000007ed,
+0x00000bbe,0x0004003d,0x0000000d,0x00000bc0,
+0x00000bbf,0x00050050,0x00000551,0x00000bc1,
+0x00000bb8,0x00000bc0,0x0003003e,0x00000bb1,
+0x00000bc1,0x0004003d,0x0000000d,0x00000bc3,
+0x00000b8d,0x0004003d,0x0000000d,0x00000bc4,
+0x000006dd,0x00050080,0x0000000d,0x00000bc5,
+0x00000bc3,0x00000bc4,0x00050080,0x0000000d,
+0x00000bc6,0x00000bc5,0x00000082,0x0004003d,
+0x0000000d,0x00000bc7,0x00000b35,0x00050084,
+0x0000000d,0x00000bc8,0x00000bc6,0x00000bc7,
+0x00050041,0x0000000e,0x00000bc9,0x000007ed,
+0x00000bc8,0x0004003d,0x0000000d,0x00000bca,
+0x00000bc9,0x0004003d,0x0000000d,0x00000bcb,
+0x00000b8d,0x0004003d,0x0000000d,0x00000bcc,
+0x000006dd,0x00050080,0x0000000d,0x00000bcd,
+0x00000bcb,0x00000bcc,0x00050080,0x0000000d,
+0x00000bce,0x00000bcd,0x00000082,0x0004003d,
+0x0000000d,0x00000bcf,0x00000b35,0x00050084,
+0x0000000d,0x00000bd0,0x00000bce,0x00000bcf,
+0x00050080,0x0000000d,0x00000bd1,0x00000bd0,
+0x00000082,0x00050041,0x0000000e,0x00000bd2,
+0x000007ed,0x00000bd1,0x0004003d,0x0000000d,
+0x00000bd3,0x00000bd2,0x00050050,0x00000551,
+0x00000bd4,0x00000bca,0x00000bd3,0x0003003e,
+0x00000bc2,0x00000bd4,0x00050041,0x0000000e,
+0x00000bd6,0x00000b89,0x000000c9,0x0004003d,
+0x0000000d,0x00000bd7,0x00000bd6,0x00050041,
+0x0000000e,0x00000bd8,0x00000b89,0x00000082,
+0x0004003d,0x0000000d,0x00000bd9,0x00000bd8,
+0x00050084,0x0000000d,0x00000bda,0x00000bd7,
+0x00000bd9,0x00050080,0x0000000d,0x00000bdb,
+0x00000bda,0x000000da,0x000500c2,0x0000000d,
+0x00000bdc,0x00000bdb,0x0000052a,0x0003003e,
+0x00000bd5,0x00000bdc,0x00050041,0x0000000e,
+0x00000bde,0x00000b89,0x00000082,0x0004003d,
+0x0000000d,0x00000bdf,0x00000bde,0x0004003d,
+0x0000000d,0x00000be0,0x00000bd5,0x00050082,
+0x0000000d,0x00000be1,0x00000bdf,0x00000be0,
+0x0003003e,0x00000bdd,0x00000be1,0x00050041,
+0x0000000e,0x00000be3,0x00000b89,0x000000c9,
+0x0004003d,0x0000000d,0x00000be4,0x00000be3,
+0x0004003d,0x0000000d,0x00000be5,0x00000bd5,
+0x00050082,0x0000000d,0x00000be6,0x00000be4,
+0x00000be5,0x0003003e,0x00000be2,0x00000be6,
+0x00050041,0x0000000e,0x00000be8,0x00000b89,
+0x000000c9,0x0004003d,0x0000000d,0x00000be9,
+0x00000be8,0x00050082,0x0000000d,0x00000bea,
+0x000005e4,0x00000be9,0x00050041,0x0000000e,
+0x00000beb,0x00000b89,0x00000082,0x0004003d,
+0x0000000d,0x00000bec,0x00000beb,0x00050082,
+0x0000000d,0x00000bed,0x00000bea,0x00000bec,
+0x0004003d,0x0000000d,0x00000bee,0x00000bd5,
+0x00050080,0x0000000d,0x00000bef,0x00000bed,
+0x00000bee,0x0003003e,0x00000be7,0x00000bef,
+0x0004003d,0x00000551,0x00000bf1,0x00000b95,
+0x0004003d,0x0000000d,0x00000bf2,0x00000be7,
+0x00050050,0x00000551,0x00000bf3,0x00000bf2,
+0x00000bf2,0x00050084,0x00000551,0x00000bf4,
+0x00000bf1,0x00000bf3,0x0004003d,0x00000551,
+0x00000bf5,0x00000ba2,0x0004003d,0x0000000d,
+0x00000bf6,0x00000be2,0x00050050,0x00000551,
+0x00000bf7,0x00000bf6,0x00000bf6,0x00050084,
+0x00000551,0x00000bf8,0x00000bf5,0x00000bf7,
+0x00050080,0x00000551,0x00000bf9,0x00000bf4,
+0x00000bf8,0x0004003d,0x00000551,0x00000bfa,
+0x00000bb1,0x0004003d,0x0000000d,0x00000bfb,
+0x00000bdd,0x00050050,0x00000551,0x00000bfc,
+0x00000bfb,0x00000bfb,0x00050084,0x00000551,
+0x00000bfd,0x00000bfa,0x00000bfc,0x00050080,
+0x00000551,0x00000bfe,0x00000bf9,0x00000bfd,
+0x0004003d,0x00000551,0x00000bff,0x00000bc2,
+0x0004003d,0x0000000d,0x00000c00,0x00000bd5,
+0x00050050,0x00000551,0x00000c01,0x00000c00,
+0x00000c00,0x00050084,0x00000551,0x00000c02,
+0x00000bff,0x00000c01,0x00050080,0x00000551,
+0x00000c03,0x00000bfe,0x00000c02,0x00050050,
+0x00000551,0x00000c04,0x000000da,0x000000da,
+0x00050080,0x00000551,0x00000c05,0x00000c03,
+0x00000c04,0x00050050,0x00000b82,0x00000c06,
+0x0000052a,0x0000052a,0x000500c2,0x00000551,
+0x00000c07,0x00000c05,0x00000c06,0x0003003e,
+0x00000bf0,0x00000c07,0x0004003d,0x0000000d,
+0x00000c09,0x00000b4c,0x00060041,0x00000016,
+0x00000c0a,0x00000b0f,0x00000c09,0x00000109,
+0x0004003d,0x00000015,0x00000c0b,0x00000c0a,
+0x0003003e,0x00000c08,0x00000c0b,0x0004003d,
+0x0000000d,0x00000c0d,0x00000b4c,0x00060041,
+0x00000016,0x00000c0e,0x00000b0f,0x00000c0d,
+0x0000008e,0x0004003d,0x00000015,0x00000c0f,
+0x00000c0e,0x0003003e,0x00000c0c,0x00000c0f,
+0x0004003d,0x00000015,0x00000c11,0x00000c08,
+0x00050041,0x0000000e,0x00000c12,0x00000bf0,
+0x000000c9,0x0004003d,0x0000000d,0x00000c13,
+0x00000c12,0x00050082,0x0000000d,0x00000c14,
+0x0000076d,0x00000c13,0x00070050,0x00000015,
+0x00000c15,0x00000c14,0x00000c14,0x00000c14,
+0x00000c14,0x00050084,0x00000015,0x00000c16,
+0x00000c11,0x00000c15,0x0004003d,0x00000015,
+0x00000c17,0x00000c0c,0x00050041,0x0000000e,
+0x00000c18,0x00000bf0,0x000000c9,0x0004003d,
+0x0000000d,0x00000c19,0x00000c18,0x00070050,
+0x00000015,0x00000c1a,0x00000c19,0x00000c19,
+0x00000c19,0x00000c19,0x00050084,0x00000015,
+0x00000c1b,0x00000c17,0x00000c1a,0x00050080,
+0x00000015,0x00000c1c,0x00000c16,0x00000c1b,
+0x00070050,0x00000015,0x00000c1d,0x00000088,
+0x00000088,0x00000088,0x00000088,0x00050080,
+0x00000015,0x00000c1e,0x00000c1c,0x00000c1d,
+0x00070050,0x00000015,0x00000c1f,0x0000076d,
+0x0000076d,0x0000076d,0x0000076d,0x00050086,
+0x00000015,0x00000c20,0x00000c1e,0x00000c1f,
+0x0003003e,0x00000c10,0x00000c20,0x0004003d,
+0x0000000d,0x00000c21,0x000006c1,0x000500aa,
+0x00000099,0x00000c22,0x00000c21,0x00000082,
+0x000300f7,0x00000c24,0x00000000,0x000400fa,
+0x00000c22,0x00000c23,0x00000c24,0x000200f8,
+0x00000c23,0x0003003e,0x00000c26,0x00000076,
+0x0004003d,0x0000000d,0x00000c28,0x000008c4,
+0x0003003e,0x00000c27,0x00000c28,0x0003003e,
+0x00000c29,0x000000e7,0x00070039,0x0000000d,
+0x00000c2a,0x0000001b,0x00000c26,0x00000c27,
+0x00000c29,0x0003003e,0x00000c25,0x00000c2a,
+0x0004003d,0x0000000d,0x00000c2b,0x00000c25,
+0x0004003d,0x0000000d,0x00000c2c,0x00000c25,
+0x00050041,0x0000000e,0x00000c2d,0x00000c08,
+0x00000c2c,0x0004003d,0x0000000d,0x00000c2e,
+0x00000c2d,0x00050041,0x0000000e,0x00000c2f,
+0x00000bf0,0x00000082,0x0004003d,0x0000000d,
+0x00000c30,0x00000c2f,0x00050082,0x0000000d,
+0x00000c31,0x0000076d,0x00000c30,0x00050084,
+0x0000000d,0x00000c32,0x00000c2e,0x00000c31,
+0x0004003d,0x0000000d,0x00000c33,0x00000c25,
+0x00050041,0x0000000e,0x00000c34,0x00000c0c,
+0x00000c33,0x0004003d,0x0000000d,0x00000c35,
+0x00000c34,0x00050041,0x0000000e,0x00000c36,
+0x00000bf0,0x00000082,0x0004003d,0x0000000d,
+0x00000c37,0x00000c36,0x00050084,0x0000000d,
+0x00000c38,0x00000c35,0x00000c37,0x00050080,
+0x0000000d,0x00000c39,0x00000c32,0x00000c38,
+0x00050080,0x0000000d,0x00000c3a,0x00000c39,
+0x00000088,0x00050086,0x0000000d,0x00000c3b,
+0x00000c3a,0x0000076d,0x00050041,0x0000000e,
+0x00000c3c,0x00000c10,0x00000c2b,0x0003003e,
+0x00000c3c,0x00000c3b,0x000200f9,0x00000c24,
+0x000200f8,0x00000c24,0x0004003d,0x0000000d,
+0x00000c3d,0x00000b38,0x00060041,0x00000555,
+0x00000c3e,0x00000554,0x00000109,0x000000c9,
+0x0004003d,0x0000000d,0x00000c3f,0x00000c3e,
+0x00050084,0x0000000d,0x00000c40,0x00000c3d,
+0x00000c3f,0x0004003d,0x0000000d,0x00000c41,
+0x00000b42,0x00050080,0x0000000d,0x00000c42,
+0x00000c40,0x00000c41,0x0004003d,0x00000015,
+0x00000c43,0x00000c10,0x00050041,0x00000016,
+0x00000c44,0x00000b67,0x00000c42,0x0003003e,
+0x00000c44,0x00000c43,0x000200f9,0x00000b46,
+0x000200f8,0x00000b46,0x0004003d,0x0000000d,
+0x00000c45,0x00000b42,0x00050080,0x0000000d,
+0x00000c46,0x00000c45,0x0000008e,0x0003003e,
+0x00000b42,0x00000c46,0x000200f9,0x00000b43,
+0x000200f8,0x00000b45,0x000200f9,0x00000b3c,
+0x000200f8,0x00000b3c,0x0004003d,0x0000000d,
+0x00000c47,0x00000b38,0x00050080,0x0000000d,
+0x00000c48,0x00000c47,0x0000008e,0x0003003e,
+0x00000b38,0x00000c48,0x000200f9,0x00000b39,
+0x000200f8,0x00000b3b,0x0004003d,0x0000006d,
+0x00000c49,0x00000b67,0x000200fe,0x00000c49,
+0x00010038,0x00050036,0x0000000d,0x0000007a,
+0x00000000,0x00000079,0x000200f8,0x0000007b,
+0x00060041,0x00000555,0x00000c4c,0x00000554,
+0x00000109,0x00000082,0x0004003d,0x0000000d,
+0x00000c4d,0x00000c4c,0x000200fe,0x00000c4d,
+0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_3D.inl
new file mode 100644
index 00000000000..2843f286e0c
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Astc_3D.inl
@@ -0,0 +1,5037 @@
+0x07230203,0x00010300,0x000d000a,0x00000cb1,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x00000c53,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00060005,0x0000000b,0x50746567,
+0x4433736f,0x33697628,0x0000003b,0x00030005,
+0x0000000a,0x00736f70,0x00050005,0x00000013,
+0x28746962,0x693b3175,0x00003b31,0x00030005,
+0x00000011,0x00000075,0x00030005,0x00000012,
+0x00746962,0x00070005,0x0000001b,0x73746962,
+0x28383231,0x3b347576,0x753b3175,0x00003b31,
+0x00030005,0x00000018,0x00000075,0x00050005,
+0x00000019,0x53746962,0x74726174,0x00000000,
+0x00050005,0x0000001a,0x43746962,0x746e756f,
+0x00000000,0x000a0005,0x00000022,0x73746962,
+0x66383231,0x5a6c6c69,0x736f7265,0x34757628,
+0x3b31753b,0x753b3175,0x00003b31,0x00030005,
+0x0000001e,0x00000075,0x00050005,0x0000001f,
+0x53746962,0x74726174,0x00000000,0x00040005,
+0x00000020,0x45746962,0x0000646e,0x00050005,
+0x00000021,0x43746962,0x746e756f,0x00000000,
+0x00090005,0x00000029,0x5f746567,0x5f746962,
+0x6e756f63,0x31752874,0x3b31753b,0x753b3175,
+0x00003b31,0x00050005,0x00000025,0x5f6d756e,
+0x736c6176,0x00000000,0x00040005,0x00000026,
+0x74697274,0x00000073,0x00040005,0x00000027,
+0x6e697571,0x00007374,0x00040005,0x00000028,
+0x73746962,0x00000000,0x000a0005,0x00000031,
+0x5f746567,0x6b636170,0x7a69735f,0x31752865,
+0x3b31753b,0x753b3175,0x31753b31,0x0000003b,
+0x00040005,0x0000002c,0x74697274,0x00000073,
+0x00040005,0x0000002d,0x6e697571,0x00007374,
+0x00040005,0x0000002e,0x73746962,0x00000000,
+0x00040005,0x0000002f,0x6b636170,0x00000000,
+0x00050005,0x00000030,0x6b636170,0x69536465,
+0x0000657a,0x00090005,0x0000003a,0x6f636564,
+0x745f6564,0x28746972,0x3b347576,0x753b3175,
+0x31753b31,0x0000003b,0x00040005,0x00000036,
+0x61746164,0x00000000,0x00040005,0x00000037,
+0x72617473,0x00000074,0x00030005,0x00000038,
+0x00646e65,0x00030005,0x00000039,0x0000006e,
+0x00090005,0x00000043,0x6f636564,0x715f6564,
+0x746e6975,0x34757628,0x3b31753b,0x753b3175,
+0x00003b31,0x00040005,0x0000003f,0x61746164,
+0x00000000,0x00040005,0x00000040,0x72617473,
+0x00000074,0x00030005,0x00000041,0x00646e65,
+0x00030005,0x00000042,0x0000006e,0x00060005,
+0x00000047,0x5f746567,0x6f635f76,0x28746e75,
+0x003b3175,0x00030005,0x00000046,0x006d6563,
+0x00060005,0x0000004e,0x70617773,0x34697628,
+0x3469763b,0x0000003b,0x00030005,0x0000004c,
+0x00003176,0x00030005,0x0000004d,0x00003276,
+0x00090005,0x00000053,0x5f746962,0x6e617274,
+0x72656673,0x6769735f,0x2864656e,0x693b3169,
+0x00003b31,0x00030005,0x00000051,0x00000061,
+0x00030005,0x00000052,0x00000062,0x00070005,
+0x00000057,0x65756c62,0x6e6f635f,0x63617274,
+0x69762874,0x00003b34,0x00030005,0x00000056,
+0x006c6176,0x000d0005,0x00000061,0x6f636564,
+0x6c5f6564,0x665f7264,0x6d5f726f,0x2865646f,
+0x345b3175,0x753b5d30,0x31753b31,0x3475763b,
+0x3475763b,0x0000003b,0x00040005,0x0000005c,
+0x736c6176,0x00000000,0x00050005,0x0000005d,
+0x72617473,0x64695f74,0x00000078,0x00040005,
+0x0000005e,0x65646f6d,0x00000000,0x00030005,
+0x0000005f,0x00003163,0x00030005,0x00000060,
+0x00003263,0x00050005,0x00000064,0x68736168,
+0x75283235,0x00003b31,0x00030005,0x00000063,
+0x00000070,0x000a0005,0x0000006a,0x656c6573,
+0x705f7463,0x69747261,0x6e6f6974,0x3b317528,
+0x753b3175,0x31753b31,0x0000003b,0x00040005,
+0x00000066,0x64656573,0x00000000,0x00030005,
+0x00000067,0x00000078,0x00030005,0x00000068,
+0x00000079,0x00060005,0x00000069,0x74726170,
+0x6f697469,0x756f636e,0x0000746e,0x00080005,
+0x00000070,0x676e6973,0x635f656c,0x726f6c6f,
+0x6f6c625f,0x76286b63,0x003b3475,0x00040005,
+0x0000006f,0x6f6c6f63,0x00000072,0x00070005,
+0x00000073,0x6f727265,0x6f635f72,0x5f726f6c,
+0x636f6c62,0x0000286b,0x00080005,0x00000077,
+0x63747361,0x6365645f,0x5f65646f,0x636f6c62,
+0x7576286b,0x00003b34,0x00030005,0x00000076,
+0x00000075,0x00070005,0x0000007a,0x636f6c62,
+0x5f795f6b,0x657a6973,0x2844335f,0x00000000,
+0x00050005,0x00000086,0x73726966,0x78644974,
+0x00000000,0x00050005,0x0000008a,0x73726966,
+0x66664f74,0x00746573,0x00040005,0x0000008d,
+0x4d746962,0x006b7361,0x00050005,0x000000a7,
+0x73726966,0x756f4374,0x0000746e,0x00030005,
+0x000000aa,0x00746572,0x00040005,0x000000d0,
+0x61726170,0x0000006d,0x00040005,0x000000d2,
+0x61726170,0x0000006d,0x00040005,0x000000d4,
+0x61726170,0x0000006d,0x00060005,0x000000d8,
+0x74697274,0x7469625f,0x756f635f,0x0000746e,
+0x00060005,0x000000e1,0x6e697571,0x69625f74,
+0x6f635f74,0x00746e75,0x00060005,0x000000ea,
+0x65736162,0x7469625f,0x756f635f,0x0000746e,
+0x00040005,0x00000106,0x6f636e65,0x00646564,
+0x00070005,0x00000107,0x6f636e65,0x5f646564,
+0x73746962,0x6165725f,0x00000064,0x00030005,
+0x00000108,0x00000069,0x00030005,0x00000113,
+0x0000006d,0x00040005,0x00000115,0x61726170,
+0x0000006d,0x00040005,0x00000117,0x61726170,
+0x0000006d,0x00040005,0x00000119,0x61726170,
+0x0000006d,0x00040005,0x0000011b,0x61726170,
+0x0000006d,0x00060005,0x00000122,0x6f636e65,
+0x5f646564,0x73746962,0x00000000,0x00050005,
+0x00000128,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x0000012c,0x61726170,0x0000006d,
+0x00040005,0x0000012e,0x61726170,0x0000006d,
+0x00040005,0x00000130,0x61726170,0x0000006d,
+0x00040005,0x00000132,0x61726170,0x0000006d,
+0x00050005,0x00000135,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000141,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x00000149,
+0x00000069,0x00040005,0x00000151,0x75736572,
+0x0000746c,0x00050005,0x0000024c,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000025b,
+0x6f636e65,0x00646564,0x00070005,0x0000025c,
+0x6f636e65,0x5f646564,0x73746962,0x6165725f,
+0x00000064,0x00040005,0x0000025d,0x4d746962,
+0x006b7361,0x00030005,0x00000262,0x00000069,
+0x00030005,0x0000026c,0x0000006d,0x00040005,
+0x0000026e,0x61726170,0x0000006d,0x00040005,
+0x00000270,0x61726170,0x0000006d,0x00040005,
+0x00000272,0x61726170,0x0000006d,0x00040005,
+0x00000274,0x61726170,0x0000006d,0x00060005,
+0x0000027b,0x6f636e65,0x5f646564,0x73746962,
+0x00000000,0x00050005,0x00000280,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000284,
+0x61726170,0x0000006d,0x00040005,0x00000286,
+0x61726170,0x0000006d,0x00040005,0x00000288,
+0x61726170,0x0000006d,0x00040005,0x0000028a,
+0x61726170,0x0000006d,0x00050005,0x0000028d,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000299,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x000002a1,0x00000069,0x00040005,
+0x000002a9,0x75736572,0x0000746c,0x00050005,
+0x0000032e,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x00000343,0x00706d74,0x00030005,
+0x0000036a,0x00003076,0x00050005,0x0000036e,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000372,0x00003176,0x00050005,0x00000375,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000379,0x00003276,0x00050005,0x0000037c,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000380,0x00003376,0x00050005,0x00000383,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000387,0x00003476,0x00050005,0x0000038a,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x0000038e,0x00003576,0x00050005,0x00000391,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000395,0x00003676,0x00050005,0x00000399,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x0000039d,0x00003776,0x00050005,0x000003a0,
+0x65646e69,0x6c626178,0x00000065,0x00070005,
+0x000003b1,0x70646e65,0x746e696f,0x776f6c5f,
+0x6267725f,0x00000061,0x00070005,0x000003b7,
+0x70646e65,0x746e696f,0x6769685f,0x67725f68,
+0x00006162,0x00030005,0x000003bd,0x0000306c,
+0x00030005,0x000003c4,0x0000316c,0x00040005,
+0x000003de,0x61726170,0x0000006d,0x00040005,
+0x000003e0,0x61726170,0x0000006d,0x00040005,
+0x000003e5,0x61726170,0x0000006d,0x00040005,
+0x000003e7,0x61726170,0x0000006d,0x00050005,
+0x000003f4,0x68676968,0x6d756c5f,0x00000061,
+0x00030005,0x00000407,0x00000069,0x00030005,
+0x0000040f,0x00000078,0x00030005,0x0000041e,
+0x00003073,0x00030005,0x00000424,0x00003173,
+0x00040005,0x00000437,0x61726170,0x0000006d,
+0x00040005,0x00000439,0x61726170,0x0000006d,
+0x00040005,0x0000043e,0x61726170,0x0000006d,
+0x00040005,0x00000442,0x61726170,0x0000006d,
+0x00040005,0x00000447,0x61726170,0x0000006d,
+0x00040005,0x00000449,0x61726170,0x0000006d,
+0x00040005,0x0000044e,0x61726170,0x0000006d,
+0x00040005,0x00000450,0x61726170,0x0000006d,
+0x00040005,0x00000455,0x61726170,0x0000006d,
+0x00040005,0x00000457,0x61726170,0x0000006d,
+0x00040005,0x00000472,0x61726170,0x0000006d,
+0x00040005,0x00000474,0x61726170,0x0000006d,
+0x00040005,0x00000479,0x61726170,0x0000006d,
+0x00040005,0x0000047d,0x61726170,0x0000006d,
+0x00030005,0x00000499,0x00003073,0x00030005,
+0x000004a0,0x00003173,0x00040005,0x000004b6,
+0x61726170,0x0000006d,0x00040005,0x000004b8,
+0x61726170,0x0000006d,0x00040005,0x000004bd,
+0x61726170,0x0000006d,0x00040005,0x000004c1,
+0x61726170,0x0000006d,0x00040005,0x000004c6,
+0x61726170,0x0000006d,0x00040005,0x000004c8,
+0x61726170,0x0000006d,0x00040005,0x000004cd,
+0x61726170,0x0000006d,0x00040005,0x000004cf,
+0x61726170,0x0000006d,0x00040005,0x000004d4,
+0x61726170,0x0000006d,0x00040005,0x000004d6,
+0x61726170,0x0000006d,0x00040005,0x000004db,
+0x61726170,0x0000006d,0x00040005,0x000004dd,
+0x61726170,0x0000006d,0x00040005,0x000004fc,
+0x61726170,0x0000006d,0x00040005,0x000004fe,
+0x61726170,0x0000006d,0x00040005,0x00000503,
+0x61726170,0x0000006d,0x00040005,0x00000507,
+0x61726170,0x0000006d,0x00030005,0x00000550,
+0x0000007a,0x00070005,0x00000552,0x67616d49,
+0x726f4665,0x4274616d,0x6b636f6c,0x00000000,
+0x00060006,0x00000552,0x00000000,0x636f6c62,
+0x7a69536b,0x00000065,0x00060006,0x00000552,
+0x00000001,0x65736162,0x6579614c,0x00000072,
+0x00060006,0x00000552,0x00000002,0x6c616d73,
+0x6f6c426c,0x00006b63,0x00060005,0x00000554,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00040005,0x00000565,0x6d756e72,0x00000000,
+0x00040005,0x00000566,0x61726170,0x0000006d,
+0x00040005,0x00000569,0x64656573,0x00000031,
+0x00040005,0x0000056d,0x64656573,0x00000032,
+0x00040005,0x00000571,0x64656573,0x00000033,
+0x00040005,0x00000575,0x64656573,0x00000034,
+0x00040005,0x0000057a,0x64656573,0x00000035,
+0x00040005,0x0000057e,0x64656573,0x00000036,
+0x00040005,0x00000583,0x64656573,0x00000037,
+0x00040005,0x00000588,0x64656573,0x00000038,
+0x00040005,0x0000058d,0x64656573,0x00000039,
+0x00040005,0x00000592,0x64656573,0x00003031,
+0x00040005,0x00000597,0x64656573,0x00003131,
+0x00040005,0x0000059c,0x64656573,0x00003231,
+0x00030005,0x000005cd,0x00316873,0x00030005,
+0x000005d3,0x00326873,0x00030005,0x000005e2,
+0x00336873,0x00030005,0x0000060e,0x00000061,
+0x00030005,0x0000061e,0x00000062,0x00030005,
+0x0000062e,0x00000063,0x00030005,0x0000063d,
+0x00000064,0x00030005,0x00000680,0x00000068,
+0x00030005,0x0000068b,0x00000077,0x00030005,
+0x00000697,0x00746572,0x00040005,0x000006ab,
+0x61726170,0x0000006d,0x00030005,0x000006af,
+0x00003375,0x00030005,0x000006b1,0x00373862,
+0x00030005,0x000006b5,0x00353662,0x00030005,
+0x000006b9,0x00323362,0x00030005,0x000006bd,
+0x00000061,0x00030005,0x000006bf,0x00000062,
+0x00030005,0x000006c1,0x00000064,0x00040005,
+0x000006c2,0x61726170,0x0000006d,0x00040005,
+0x000006c4,0x61726170,0x0000006d,0x00030005,
+0x000006c6,0x00726468,0x00040005,0x000006c8,
+0x61726170,0x0000006d,0x00040005,0x000006ca,
+0x61726170,0x0000006d,0x00030005,0x000006d1,
+0x00000072,0x00040005,0x000006d4,0x61726170,
+0x0000006d,0x00040005,0x000006d6,0x61726170,
+0x0000006d,0x00040005,0x000006dd,0x74646977,
+0x00000068,0x00040005,0x000006df,0x67696568,
+0x00007468,0x00040005,0x00000700,0x6f6c6f63,
+0x00000072,0x00040005,0x0000070e,0x61726170,
+0x0000006d,0x00040005,0x00000721,0x61726170,
+0x0000006d,0x00040005,0x00000723,0x61726170,
+0x0000006d,0x00040005,0x00000741,0x61726170,
+0x0000006d,0x00040005,0x00000743,0x61726170,
+0x0000006d,0x00040005,0x00000763,0x74697274,
+0x00000073,0x00040005,0x00000764,0x6e697571,
+0x00007374,0x00040005,0x00000765,0x73746962,
+0x00000000,0x00060005,0x00000766,0x67696577,
+0x6f437468,0x73746e75,0x00000000,0x00050005,
+0x0000079d,0x6b636170,0x69536465,0x0000657a,
+0x00040005,0x0000079e,0x6b636170,0x00000000,
+0x00040005,0x0000079f,0x61726170,0x0000006d,
+0x00040005,0x000007a1,0x61726170,0x0000006d,
+0x00040005,0x000007a3,0x61726170,0x0000006d,
+0x00040005,0x000007a5,0x61726170,0x0000006d,
+0x00040005,0x000007a6,0x61726170,0x0000006d,
+0x00040005,0x000007aa,0x49637273,0x00007864,
+0x00040005,0x000007ab,0x49747364,0x00007864,
+0x00050005,0x000007ac,0x76655275,0x65737265,
+0x00000064,0x00060005,0x000007ae,0x67696577,
+0x69427468,0x756f4374,0x0000746e,0x00040005,
+0x000007af,0x61726170,0x0000006d,0x00040005,
+0x000007b1,0x61726170,0x0000006d,0x00040005,
+0x000007b3,0x61726170,0x0000006d,0x00040005,
+0x000007b5,0x61726170,0x0000006d,0x00040005,
+0x000007d8,0x6f636564,0x00646564,0x00040005,
+0x000007d9,0x61726170,0x0000006d,0x00040005,
+0x000007db,0x61726170,0x0000006d,0x00040005,
+0x000007dd,0x61726170,0x0000006d,0x00040005,
+0x000007df,0x61726170,0x0000006d,0x00030005,
+0x000007e2,0x00000069,0x00050005,0x000007ed,
+0x67696577,0x72477468,0x00006469,0x00050005,
+0x00000811,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000819,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000837,0x6f636564,
+0x00646564,0x00040005,0x00000838,0x61726170,
+0x0000006d,0x00040005,0x0000083a,0x61726170,
+0x0000006d,0x00040005,0x0000083c,0x61726170,
+0x0000006d,0x00040005,0x0000083e,0x61726170,
+0x0000006d,0x00030005,0x00000841,0x00000069,
+0x00050005,0x00000859,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000861,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x0000087b,
+0x6f636564,0x52646564,0x00007761,0x00040005,
+0x0000087c,0x61726170,0x0000006d,0x00040005,
+0x0000087e,0x61726170,0x0000006d,0x00040005,
+0x00000880,0x61726170,0x0000006d,0x00040005,
+0x00000883,0x6f636564,0x00646564,0x00050005,
+0x0000088a,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000892,0x65646e69,0x6c626178,
+0x00000065,0x00060005,0x000008aa,0x74726170,
+0x6f697469,0x756f436e,0x0000746e,0x00050005,
+0x000008b9,0x67696577,0x74537468,0x00747261,
+0x00040005,0x000008ba,0x61726170,0x0000006d,
+0x00040005,0x000008bc,0x61726170,0x0000006d,
+0x00040005,0x000008be,0x61726170,0x0000006d,
+0x00040005,0x000008c0,0x61726170,0x0000006d,
+0x00060005,0x000008c4,0x6c617564,0x6e616c50,
+0x61745365,0x00007472,0x00030005,0x000008c9,
+0x006d6563,0x00050005,0x000008d4,0x74726170,
+0x65646f4d,0x00000000,0x00060005,0x000008d9,
+0x72747865,0x69424d61,0x756f4374,0x0000746e,
+0x00050005,0x000008e3,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x000008e7,0x72747865,
+0x74534d61,0x00747261,0x00040005,0x000008f3,
+0x5f6d6563,0x006c6c61,0x00040005,0x000008fe,
+0x426d6563,0x00657361,0x00040005,0x00000901,
+0x486d6563,0x00686769,0x00040005,0x00000903,
+0x61726170,0x0000006d,0x00040005,0x00000905,
+0x61726170,0x0000006d,0x00040005,0x00000907,
+0x61726170,0x0000006d,0x00040005,0x00000909,
+0x61726170,0x0000006d,0x00040005,0x0000090c,
+0x61726170,0x0000006d,0x00040005,0x0000090e,
+0x61726170,0x0000006d,0x00040005,0x00000910,
+0x61726170,0x0000006d,0x00040005,0x00000912,
+0x61726170,0x0000006d,0x00040005,0x00000917,
+0x72747865,0x00004d61,0x00040005,0x00000918,
+0x61726170,0x0000006d,0x00040005,0x00000919,
+0x61726170,0x0000006d,0x00040005,0x0000091b,
+0x61726170,0x0000006d,0x00060005,0x0000091e,
+0x6e69616d,0x7469424d,0x6e756f43,0x00000074,
+0x00050005,0x00000922,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000925,0x0000006d,
+0x00040005,0x00000940,0x61746f74,0x0000566c,
+0x00040005,0x00000941,0x74726170,0x00000000,
+0x00040005,0x0000094b,0x61726170,0x0000006d,
+0x00040005,0x00000953,0x74537065,0x00747261,
+0x00060005,0x00000959,0x61746f74,0x6176416c,
+0x69426c69,0x00007374,0x00050005,0x00000963,
+0x75517065,0x73746e69,0x00000000,0x00040005,
+0x00000964,0x72547065,0x00737469,0x00040005,
+0x00000965,0x69427065,0x00007374,0x00030005,
+0x00000966,0x00000069,0x00050005,0x00000979,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x0000097d,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000981,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000984,0x61726170,
+0x0000006d,0x00040005,0x00000986,0x61726170,
+0x0000006d,0x00040005,0x00000988,0x61726170,
+0x0000006d,0x00040005,0x0000098a,0x61726170,
+0x0000006d,0x00050005,0x0000099a,0x69427065,
+0x756f4374,0x0000746e,0x00040005,0x0000099b,
+0x61726170,0x0000006d,0x00040005,0x0000099d,
+0x61726170,0x0000006d,0x00040005,0x0000099f,
+0x61726170,0x0000006d,0x00040005,0x000009a1,
+0x61726170,0x0000006d,0x00040005,0x000009a4,
+0x6e457065,0x00000064,0x00050005,0x000009a8,
+0x6b636170,0x69536465,0x0000657a,0x00040005,
+0x000009a9,0x6b636170,0x00000000,0x00040005,
+0x000009aa,0x61726170,0x0000006d,0x00040005,
+0x000009ac,0x61726170,0x0000006d,0x00040005,
+0x000009ae,0x61726170,0x0000006d,0x00040005,
+0x000009b0,0x61726170,0x0000006d,0x00040005,
+0x000009b1,0x61726170,0x0000006d,0x00040005,
+0x000009b5,0x49637273,0x00007864,0x00040005,
+0x000009b7,0x49747364,0x00007864,0x00040005,
+0x000009c4,0x6f636564,0x00646564,0x00040005,
+0x000009c5,0x61726170,0x0000006d,0x00040005,
+0x000009c6,0x61726170,0x0000006d,0x00040005,
+0x000009c8,0x61726170,0x0000006d,0x00040005,
+0x000009ca,0x61726170,0x0000006d,0x00030005,
+0x000009cd,0x00000069,0x00040005,0x000009d5,
+0x66754276,0x00726566,0x00050005,0x00000a8d,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000a95,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000aa8,0x6f636564,0x00646564,
+0x00040005,0x00000aa9,0x61726170,0x0000006d,
+0x00040005,0x00000aaa,0x61726170,0x0000006d,
+0x00040005,0x00000aac,0x61726170,0x0000006d,
+0x00040005,0x00000aae,0x61726170,0x0000006d,
+0x00030005,0x00000ab1,0x00000069,0x00050005,
+0x00000ac6,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000ace,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000add,0x00637273,
+0x00040005,0x00000ade,0x61726170,0x0000006d,
+0x00040005,0x00000adf,0x61726170,0x0000006d,
+0x00040005,0x00000ae1,0x61726170,0x0000006d,
+0x00040005,0x00000ae4,0x6f636564,0x00646564,
+0x00050005,0x00000aeb,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000af3,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x00000b00,
+0x66667562,0x64497265,0x00000078,0x00040005,
+0x00000b01,0x74726170,0x00000000,0x00050005,
+0x00000b0f,0x50646e65,0x746e696f,0x00000073,
+0x00040005,0x00000b12,0x61726170,0x0000006d,
+0x00040005,0x00000b14,0x61726170,0x0000006d,
+0x00040005,0x00000b17,0x61726170,0x0000006d,
+0x00040005,0x00000b18,0x61726170,0x0000006d,
+0x00040005,0x00000b1f,0x61726170,0x0000006d,
+0x00030005,0x00000b28,0x00747364,0x00030005,
+0x00000b35,0x00006464,0x00030005,0x00000b38,
+0x00000068,0x00030005,0x00000b42,0x00000077,
+0x00040005,0x00000b4c,0x74726170,0x00000000,
+0x00040005,0x00000b51,0x61726170,0x0000006d,
+0x00040005,0x00000b52,0x61726170,0x0000006d,
+0x00040005,0x00000b54,0x61726170,0x0000006d,
+0x00040005,0x00000b56,0x61726170,0x0000006d,
+0x00050005,0x00000b61,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000b67,0x00746572,
+0x00030005,0x00000b70,0x00007473,0x00030005,
+0x00000b74,0x00747363,0x00030005,0x00000b78,
+0x00747367,0x00030005,0x00000b85,0x0074736a,
+0x00030005,0x00000b89,0x00747366,0x00030005,
+0x00000b8d,0x00003076,0x00030005,0x00000b95,
+0x00303070,0x00030005,0x00000ba2,0x00313070,
+0x00030005,0x00000bb1,0x00303170,0x00030005,
+0x00000bc2,0x00313170,0x00030005,0x00000bd5,
+0x00313177,0x00030005,0x00000bdd,0x00303177,
+0x00030005,0x00000be2,0x00313077,0x00030005,
+0x00000be7,0x00303077,0x00030005,0x00000bf0,
+0x00000069,0x00030005,0x00000c08,0x00003063,
+0x00030005,0x00000c0c,0x00003163,0x00030005,
+0x00000c10,0x00000063,0x00030005,0x00000c25,
+0x00736363,0x00040005,0x00000c26,0x61726170,
+0x0000006d,0x00040005,0x00000c27,0x61726170,
+0x0000006d,0x00040005,0x00000c29,0x61726170,
+0x0000006d,0x00030005,0x00000c50,0x00736f70,
+0x00080005,0x00000c53,0x475f6c67,0x61626f6c,
+0x766e496c,0x7461636f,0x496e6f69,0x00000044,
+0x00050005,0x00000c5d,0x42637273,0x6b636f6c,
+0x00000000,0x00050005,0x00000c60,0x6d695f75,
+0x30656761,0x00000000,0x00040005,0x00000c62,
+0x61726170,0x0000006d,0x00060005,0x00000c74,
+0x6f636564,0x6572706d,0x64657373,0x00000000,
+0x00030005,0x00000c77,0x00000079,0x00030005,
+0x00000c80,0x00000078,0x00050005,0x00000c8c,
+0x6d695f75,0x31656761,0x00000000,0x00040005,
+0x00000ca1,0x61726170,0x0000006d,0x00050048,
+0x00000552,0x00000000,0x00000023,0x00000000,
+0x00050048,0x00000552,0x00000001,0x00000023,
+0x00000008,0x00050048,0x00000552,0x00000002,
+0x00000023,0x0000000c,0x00030047,0x00000552,
+0x00000002,0x00040047,0x00000c53,0x0000000b,
+0x0000001c,0x00040047,0x00000c60,0x00000022,
+0x00000000,0x00040047,0x00000c60,0x00000021,
+0x00000000,0x00030047,0x00000c60,0x00000018,
+0x00040047,0x00000c8c,0x00000022,0x00000000,
+0x00040047,0x00000c8c,0x00000021,0x00000001,
+0x00030047,0x00000c8c,0x00000019,0x00040047,
+0x00000caf,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000001,
+0x00040017,0x00000007,0x00000006,0x00000003,
+0x00040020,0x00000008,0x00000007,0x00000007,
+0x00040021,0x00000009,0x00000007,0x00000008,
+0x00040015,0x0000000d,0x00000020,0x00000000,
+0x00040020,0x0000000e,0x00000007,0x0000000d,
+0x00040020,0x0000000f,0x00000007,0x00000006,
+0x00050021,0x00000010,0x0000000d,0x0000000e,
+0x0000000f,0x00040017,0x00000015,0x0000000d,
+0x00000004,0x00040020,0x00000016,0x00000007,
+0x00000015,0x00060021,0x00000017,0x0000000d,
+0x00000016,0x0000000e,0x0000000e,0x00070021,
+0x0000001d,0x0000000d,0x00000016,0x0000000e,
+0x0000000e,0x0000000e,0x00070021,0x00000024,
+0x0000000d,0x0000000e,0x0000000e,0x0000000e,
+0x0000000e,0x00080021,0x0000002b,0x00000002,
+0x0000000e,0x0000000e,0x0000000e,0x0000000e,
+0x0000000e,0x0004002b,0x0000000d,0x00000033,
+0x00000005,0x0004001c,0x00000034,0x0000000d,
+0x00000033,0x00070021,0x00000035,0x00000034,
+0x00000016,0x0000000e,0x0000000e,0x0000000e,
+0x0004002b,0x0000000d,0x0000003c,0x00000003,
+0x0004001c,0x0000003d,0x0000000d,0x0000003c,
+0x00070021,0x0000003e,0x0000003d,0x00000016,
+0x0000000e,0x0000000e,0x0000000e,0x00040021,
+0x00000045,0x0000000d,0x0000000e,0x00040017,
+0x00000049,0x00000006,0x00000004,0x00040020,
+0x0000004a,0x00000007,0x00000049,0x00050021,
+0x0000004b,0x00000002,0x0000004a,0x0000004a,
+0x00050021,0x00000050,0x00000002,0x0000000f,
+0x0000000f,0x00040021,0x00000055,0x00000002,
+0x0000004a,0x0004002b,0x0000000d,0x00000059,
+0x00000028,0x0004001c,0x0000005a,0x0000000d,
+0x00000059,0x00080021,0x0000005b,0x00000002,
+0x0000005a,0x0000000e,0x0000000e,0x00000016,
+0x00000016,0x0004002b,0x0000000d,0x0000006c,
+0x00000090,0x0004001c,0x0000006d,0x00000015,
+0x0000006c,0x00040021,0x0000006e,0x0000006d,
+0x00000016,0x00030021,0x00000072,0x0000006d,
+0x00040021,0x00000075,0x0000006d,0x00000015,
+0x00030021,0x00000079,0x0000000d,0x0004002b,
+0x0000000d,0x00000082,0x00000001,0x0004002b,
+0x0000000d,0x00000088,0x00000020,0x0004002b,
+0x00000006,0x0000008e,0x00000001,0x00020014,
+0x00000099,0x0004002b,0x0000000d,0x000000c9,
+0x00000000,0x0004002b,0x0000000d,0x000000da,
+0x00000008,0x0004002b,0x0000000d,0x000000de,
+0x00000004,0x0004002b,0x0000000d,0x000000e3,
+0x00000007,0x0004002b,0x0000000d,0x000000e7,
+0x00000002,0x0004002b,0x00000006,0x00000109,
+0x00000000,0x0004002b,0x00000006,0x00000110,
+0x00000005,0x00040020,0x00000112,0x00000007,
+0x00000034,0x0004001c,0x00000123,0x00000006,
+0x00000033,0x0004002b,0x00000006,0x00000124,
+0x00000002,0x0008002c,0x00000123,0x00000125,
+0x00000124,0x00000124,0x0000008e,0x00000124,
+0x0000008e,0x00040020,0x00000127,0x00000007,
+0x00000123,0x0004002b,0x0000000d,0x00000153,
+0x00000100,0x0004001c,0x00000154,0x00000034,
+0x00000153,0x0008002c,0x00000034,0x00000155,
+0x000000c9,0x000000c9,0x000000c9,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000156,
+0x00000082,0x000000c9,0x000000c9,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000157,
+0x000000e7,0x000000c9,0x000000c9,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000158,
+0x000000c9,0x000000c9,0x000000e7,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000159,
+0x000000c9,0x00000082,0x000000c9,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000015a,
+0x00000082,0x00000082,0x000000c9,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000015b,
+0x000000e7,0x00000082,0x000000c9,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000015c,
+0x00000082,0x000000c9,0x000000e7,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000015d,
+0x000000c9,0x000000e7,0x000000c9,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000015e,
+0x00000082,0x000000e7,0x000000c9,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000015f,
+0x000000e7,0x000000e7,0x000000c9,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000160,
+0x000000e7,0x000000c9,0x000000e7,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000161,
+0x000000c9,0x000000e7,0x000000e7,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000162,
+0x00000082,0x000000e7,0x000000e7,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000163,
+0x000000e7,0x000000e7,0x000000e7,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000164,
+0x000000c9,0x000000c9,0x00000082,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000165,
+0x00000082,0x000000c9,0x00000082,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000166,
+0x000000e7,0x000000c9,0x00000082,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000167,
+0x000000c9,0x00000082,0x000000e7,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000168,
+0x000000c9,0x00000082,0x00000082,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000169,
+0x00000082,0x00000082,0x00000082,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000016a,
+0x000000e7,0x00000082,0x00000082,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000016b,
+0x00000082,0x00000082,0x000000e7,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000016c,
+0x000000c9,0x000000e7,0x00000082,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000016d,
+0x00000082,0x000000e7,0x00000082,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000016e,
+0x000000e7,0x000000e7,0x00000082,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x0000016f,
+0x000000e7,0x00000082,0x000000e7,0x000000c9,
+0x000000c9,0x0008002c,0x00000034,0x00000170,
+0x000000c9,0x000000c9,0x000000c9,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x00000171,
+0x00000082,0x000000c9,0x000000c9,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x00000172,
+0x000000e7,0x000000c9,0x000000c9,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x00000173,
+0x000000c9,0x000000c9,0x000000e7,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x00000174,
+0x000000c9,0x000000c9,0x000000c9,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000175,
+0x00000082,0x000000c9,0x000000c9,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000176,
+0x000000e7,0x000000c9,0x000000c9,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000177,
+0x000000c9,0x000000c9,0x000000e7,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000178,
+0x000000c9,0x00000082,0x000000c9,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000179,
+0x00000082,0x00000082,0x000000c9,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000017a,
+0x000000e7,0x00000082,0x000000c9,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000017b,
+0x00000082,0x000000c9,0x000000e7,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000017c,
+0x000000c9,0x000000e7,0x000000c9,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000017d,
+0x00000082,0x000000e7,0x000000c9,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000017e,
+0x000000e7,0x000000e7,0x000000c9,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000017f,
+0x000000e7,0x000000c9,0x000000e7,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000180,
+0x000000c9,0x000000e7,0x000000e7,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000181,
+0x00000082,0x000000e7,0x000000e7,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000182,
+0x000000e7,0x000000e7,0x000000e7,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000183,
+0x000000c9,0x000000c9,0x00000082,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000184,
+0x00000082,0x000000c9,0x00000082,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000185,
+0x000000e7,0x000000c9,0x00000082,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000186,
+0x000000c9,0x00000082,0x000000e7,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000187,
+0x000000c9,0x00000082,0x00000082,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000188,
+0x00000082,0x00000082,0x00000082,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x00000189,
+0x000000e7,0x00000082,0x00000082,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000018a,
+0x00000082,0x00000082,0x000000e7,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000018b,
+0x000000c9,0x000000e7,0x00000082,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000018c,
+0x00000082,0x000000e7,0x00000082,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000018d,
+0x000000e7,0x000000e7,0x00000082,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000018e,
+0x000000e7,0x00000082,0x000000e7,0x00000082,
+0x000000c9,0x0008002c,0x00000034,0x0000018f,
+0x000000c9,0x00000082,0x000000c9,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x00000190,
+0x00000082,0x00000082,0x000000c9,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x00000191,
+0x000000e7,0x00000082,0x000000c9,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x00000192,
+0x00000082,0x000000c9,0x000000e7,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x00000193,
+0x000000c9,0x000000c9,0x000000c9,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x00000194,
+0x00000082,0x000000c9,0x000000c9,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x00000195,
+0x000000e7,0x000000c9,0x000000c9,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x00000196,
+0x000000c9,0x000000c9,0x000000e7,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x00000197,
+0x000000c9,0x00000082,0x000000c9,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x00000198,
+0x00000082,0x00000082,0x000000c9,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x00000199,
+0x000000e7,0x00000082,0x000000c9,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x0000019a,
+0x00000082,0x000000c9,0x000000e7,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x0000019b,
+0x000000c9,0x000000e7,0x000000c9,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x0000019c,
+0x00000082,0x000000e7,0x000000c9,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x0000019d,
+0x000000e7,0x000000e7,0x000000c9,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x0000019e,
+0x000000e7,0x000000c9,0x000000e7,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x0000019f,
+0x000000c9,0x000000e7,0x000000e7,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a0,
+0x00000082,0x000000e7,0x000000e7,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a1,
+0x000000e7,0x000000e7,0x000000e7,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a2,
+0x000000c9,0x000000c9,0x00000082,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a3,
+0x00000082,0x000000c9,0x00000082,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a4,
+0x000000e7,0x000000c9,0x00000082,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a5,
+0x000000c9,0x00000082,0x000000e7,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a6,
+0x000000c9,0x00000082,0x00000082,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a7,
+0x00000082,0x00000082,0x00000082,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a8,
+0x000000e7,0x00000082,0x00000082,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001a9,
+0x00000082,0x00000082,0x000000e7,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001aa,
+0x000000c9,0x000000e7,0x00000082,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001ab,
+0x00000082,0x000000e7,0x00000082,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001ac,
+0x000000e7,0x000000e7,0x00000082,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001ad,
+0x000000e7,0x00000082,0x000000e7,0x000000e7,
+0x000000c9,0x0008002c,0x00000034,0x000001ae,
+0x000000c9,0x000000e7,0x000000c9,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001af,
+0x00000082,0x000000e7,0x000000c9,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001b0,
+0x000000e7,0x000000e7,0x000000c9,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001b1,
+0x000000e7,0x000000c9,0x000000e7,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001b2,
+0x000000c9,0x000000c9,0x000000c9,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001b3,
+0x00000082,0x000000c9,0x000000c9,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001b4,
+0x000000e7,0x000000c9,0x000000c9,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001b5,
+0x000000c9,0x000000c9,0x000000e7,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001b6,
+0x000000c9,0x00000082,0x000000c9,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001b7,
+0x00000082,0x00000082,0x000000c9,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001b8,
+0x000000e7,0x00000082,0x000000c9,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001b9,
+0x00000082,0x000000c9,0x000000e7,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001ba,
+0x000000c9,0x000000e7,0x000000c9,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001bb,
+0x00000082,0x000000e7,0x000000c9,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001bc,
+0x000000e7,0x000000e7,0x000000c9,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001bd,
+0x000000e7,0x000000c9,0x000000e7,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001be,
+0x000000c9,0x000000e7,0x000000e7,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001bf,
+0x00000082,0x000000e7,0x000000e7,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c0,
+0x000000e7,0x000000e7,0x000000e7,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c1,
+0x000000c9,0x000000c9,0x00000082,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c2,
+0x00000082,0x000000c9,0x00000082,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c3,
+0x000000e7,0x000000c9,0x00000082,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c4,
+0x000000c9,0x00000082,0x000000e7,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c5,
+0x000000c9,0x00000082,0x00000082,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c6,
+0x00000082,0x00000082,0x00000082,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c7,
+0x000000e7,0x00000082,0x00000082,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c8,
+0x00000082,0x00000082,0x000000e7,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001c9,
+0x000000c9,0x000000e7,0x00000082,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001ca,
+0x00000082,0x000000e7,0x00000082,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001cb,
+0x000000e7,0x000000e7,0x00000082,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001cc,
+0x000000e7,0x00000082,0x000000e7,0x000000c9,
+0x000000e7,0x0008002c,0x00000034,0x000001cd,
+0x000000c9,0x000000e7,0x000000e7,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001ce,
+0x00000082,0x000000e7,0x000000e7,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001cf,
+0x000000e7,0x000000e7,0x000000e7,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001d0,
+0x000000c9,0x000000c9,0x000000c9,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001d1,
+0x00000082,0x000000c9,0x000000c9,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001d2,
+0x000000e7,0x000000c9,0x000000c9,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001d3,
+0x000000c9,0x000000c9,0x000000e7,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001d4,
+0x000000c9,0x00000082,0x000000c9,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001d5,
+0x00000082,0x00000082,0x000000c9,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001d6,
+0x000000e7,0x00000082,0x000000c9,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001d7,
+0x00000082,0x000000c9,0x000000e7,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001d8,
+0x000000c9,0x000000e7,0x000000c9,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001d9,
+0x00000082,0x000000e7,0x000000c9,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001da,
+0x000000e7,0x000000e7,0x000000c9,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001db,
+0x000000e7,0x000000c9,0x000000e7,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001dc,
+0x000000c9,0x000000e7,0x000000e7,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001dd,
+0x00000082,0x000000e7,0x000000e7,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001de,
+0x000000e7,0x000000e7,0x000000e7,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001df,
+0x000000c9,0x000000c9,0x00000082,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e0,
+0x00000082,0x000000c9,0x00000082,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e1,
+0x000000e7,0x000000c9,0x00000082,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e2,
+0x000000c9,0x00000082,0x000000e7,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e3,
+0x000000c9,0x00000082,0x00000082,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e4,
+0x00000082,0x00000082,0x00000082,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e5,
+0x000000e7,0x00000082,0x00000082,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e6,
+0x00000082,0x00000082,0x000000e7,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e7,
+0x000000c9,0x000000e7,0x00000082,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e8,
+0x00000082,0x000000e7,0x00000082,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001e9,
+0x000000e7,0x000000e7,0x00000082,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001ea,
+0x000000e7,0x00000082,0x000000e7,0x000000c9,
+0x00000082,0x0008002c,0x00000034,0x000001eb,
+0x000000c9,0x000000c9,0x00000082,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001ec,
+0x00000082,0x000000c9,0x00000082,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001ed,
+0x000000e7,0x000000c9,0x00000082,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001ee,
+0x000000c9,0x00000082,0x000000e7,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x000001ef,
+0x000000c9,0x000000c9,0x000000c9,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f0,
+0x00000082,0x000000c9,0x000000c9,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f1,
+0x000000e7,0x000000c9,0x000000c9,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f2,
+0x000000c9,0x000000c9,0x000000e7,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f3,
+0x000000c9,0x00000082,0x000000c9,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f4,
+0x00000082,0x00000082,0x000000c9,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f5,
+0x000000e7,0x00000082,0x000000c9,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f6,
+0x00000082,0x000000c9,0x000000e7,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f7,
+0x000000c9,0x000000e7,0x000000c9,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f8,
+0x00000082,0x000000e7,0x000000c9,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001f9,
+0x000000e7,0x000000e7,0x000000c9,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001fa,
+0x000000e7,0x000000c9,0x000000e7,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001fb,
+0x000000c9,0x000000e7,0x000000e7,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001fc,
+0x00000082,0x000000e7,0x000000e7,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001fd,
+0x000000e7,0x000000e7,0x000000e7,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001fe,
+0x000000c9,0x000000c9,0x00000082,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x000001ff,
+0x00000082,0x000000c9,0x00000082,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000200,
+0x000000e7,0x000000c9,0x00000082,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000201,
+0x000000c9,0x00000082,0x000000e7,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000202,
+0x000000c9,0x00000082,0x00000082,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000203,
+0x00000082,0x00000082,0x00000082,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000204,
+0x000000e7,0x00000082,0x00000082,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000205,
+0x00000082,0x00000082,0x000000e7,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000206,
+0x000000c9,0x000000e7,0x00000082,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000207,
+0x00000082,0x000000e7,0x00000082,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000208,
+0x000000e7,0x000000e7,0x00000082,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x00000209,
+0x000000e7,0x00000082,0x000000e7,0x00000082,
+0x00000082,0x0008002c,0x00000034,0x0000020a,
+0x000000c9,0x00000082,0x00000082,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x0000020b,
+0x00000082,0x00000082,0x00000082,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x0000020c,
+0x000000e7,0x00000082,0x00000082,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x0000020d,
+0x00000082,0x00000082,0x000000e7,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x0000020e,
+0x000000c9,0x000000c9,0x000000c9,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x0000020f,
+0x00000082,0x000000c9,0x000000c9,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000210,
+0x000000e7,0x000000c9,0x000000c9,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000211,
+0x000000c9,0x000000c9,0x000000e7,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000212,
+0x000000c9,0x00000082,0x000000c9,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000213,
+0x00000082,0x00000082,0x000000c9,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000214,
+0x000000e7,0x00000082,0x000000c9,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000215,
+0x00000082,0x000000c9,0x000000e7,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000216,
+0x000000c9,0x000000e7,0x000000c9,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000217,
+0x00000082,0x000000e7,0x000000c9,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000218,
+0x000000e7,0x000000e7,0x000000c9,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000219,
+0x000000e7,0x000000c9,0x000000e7,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x0000021a,
+0x000000c9,0x000000e7,0x000000e7,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x0000021b,
+0x00000082,0x000000e7,0x000000e7,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x0000021c,
+0x000000e7,0x000000e7,0x000000e7,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x0000021d,
+0x000000c9,0x000000c9,0x00000082,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x0000021e,
+0x00000082,0x000000c9,0x00000082,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x0000021f,
+0x000000e7,0x000000c9,0x00000082,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000220,
+0x000000c9,0x00000082,0x000000e7,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000221,
+0x000000c9,0x00000082,0x00000082,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000222,
+0x00000082,0x00000082,0x00000082,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000223,
+0x000000e7,0x00000082,0x00000082,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000224,
+0x00000082,0x00000082,0x000000e7,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000225,
+0x000000c9,0x000000e7,0x00000082,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000226,
+0x00000082,0x000000e7,0x00000082,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000227,
+0x000000e7,0x000000e7,0x00000082,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000228,
+0x000000e7,0x00000082,0x000000e7,0x000000e7,
+0x00000082,0x0008002c,0x00000034,0x00000229,
+0x000000c9,0x000000e7,0x00000082,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x0000022a,
+0x00000082,0x000000e7,0x00000082,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x0000022b,
+0x000000e7,0x000000e7,0x00000082,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x0000022c,
+0x000000e7,0x00000082,0x000000e7,0x000000e7,
+0x000000e7,0x0008002c,0x00000034,0x0000022d,
+0x000000c9,0x000000c9,0x000000c9,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x0000022e,
+0x00000082,0x000000c9,0x000000c9,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x0000022f,
+0x000000e7,0x000000c9,0x000000c9,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000230,
+0x000000c9,0x000000c9,0x000000e7,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000231,
+0x000000c9,0x00000082,0x000000c9,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000232,
+0x00000082,0x00000082,0x000000c9,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000233,
+0x000000e7,0x00000082,0x000000c9,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000234,
+0x00000082,0x000000c9,0x000000e7,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000235,
+0x000000c9,0x000000e7,0x000000c9,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000236,
+0x00000082,0x000000e7,0x000000c9,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000237,
+0x000000e7,0x000000e7,0x000000c9,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000238,
+0x000000e7,0x000000c9,0x000000e7,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000239,
+0x000000c9,0x000000e7,0x000000e7,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x0000023a,
+0x00000082,0x000000e7,0x000000e7,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x0000023b,
+0x000000e7,0x000000e7,0x000000e7,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x0000023c,
+0x000000c9,0x000000c9,0x00000082,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x0000023d,
+0x00000082,0x000000c9,0x00000082,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x0000023e,
+0x000000e7,0x000000c9,0x00000082,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x0000023f,
+0x000000c9,0x00000082,0x000000e7,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000240,
+0x000000c9,0x00000082,0x00000082,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000241,
+0x00000082,0x00000082,0x00000082,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000242,
+0x000000e7,0x00000082,0x00000082,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000243,
+0x00000082,0x00000082,0x000000e7,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000244,
+0x000000c9,0x000000e7,0x00000082,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000245,
+0x00000082,0x000000e7,0x00000082,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000246,
+0x000000e7,0x000000e7,0x00000082,0x00000082,
+0x000000e7,0x0008002c,0x00000034,0x00000247,
+0x000000e7,0x00000082,0x000000e7,0x00000082,
+0x000000e7,0x0103002c,0x00000154,0x00000248,
+0x00000155,0x00000156,0x00000157,0x00000158,
+0x00000159,0x0000015a,0x0000015b,0x0000015c,
+0x0000015d,0x0000015e,0x0000015f,0x00000160,
+0x00000161,0x00000162,0x00000163,0x00000160,
+0x00000164,0x00000165,0x00000166,0x00000167,
+0x00000168,0x00000169,0x0000016a,0x0000016b,
+0x0000016c,0x0000016d,0x0000016e,0x0000016f,
+0x00000170,0x00000171,0x00000172,0x00000173,
+0x00000174,0x00000175,0x00000176,0x00000177,
+0x00000178,0x00000179,0x0000017a,0x0000017b,
+0x0000017c,0x0000017d,0x0000017e,0x0000017f,
+0x00000180,0x00000181,0x00000182,0x0000017f,
+0x00000183,0x00000184,0x00000185,0x00000186,
+0x00000187,0x00000188,0x00000189,0x0000018a,
+0x0000018b,0x0000018c,0x0000018d,0x0000018e,
+0x0000018f,0x00000190,0x00000191,0x00000192,
+0x00000193,0x00000194,0x00000195,0x00000196,
+0x00000197,0x00000198,0x00000199,0x0000019a,
+0x0000019b,0x0000019c,0x0000019d,0x0000019e,
+0x0000019f,0x000001a0,0x000001a1,0x0000019e,
+0x000001a2,0x000001a3,0x000001a4,0x000001a5,
+0x000001a6,0x000001a7,0x000001a8,0x000001a9,
+0x000001aa,0x000001ab,0x000001ac,0x000001ad,
+0x000001ae,0x000001af,0x000001b0,0x000001b1,
+0x000001b2,0x000001b3,0x000001b4,0x000001b5,
+0x000001b6,0x000001b7,0x000001b8,0x000001b9,
+0x000001ba,0x000001bb,0x000001bc,0x000001bd,
+0x000001be,0x000001bf,0x000001c0,0x000001bd,
+0x000001c1,0x000001c2,0x000001c3,0x000001c4,
+0x000001c5,0x000001c6,0x000001c7,0x000001c8,
+0x000001c9,0x000001ca,0x000001cb,0x000001cc,
+0x000001cd,0x000001ce,0x000001cf,0x000001b1,
+0x000001d0,0x000001d1,0x000001d2,0x000001d3,
+0x000001d4,0x000001d5,0x000001d6,0x000001d7,
+0x000001d8,0x000001d9,0x000001da,0x000001db,
+0x000001dc,0x000001dd,0x000001de,0x000001db,
+0x000001df,0x000001e0,0x000001e1,0x000001e2,
+0x000001e3,0x000001e4,0x000001e5,0x000001e6,
+0x000001e7,0x000001e8,0x000001e9,0x000001ea,
+0x000001eb,0x000001ec,0x000001ed,0x000001ee,
+0x000001ef,0x000001f0,0x000001f1,0x000001f2,
+0x000001f3,0x000001f4,0x000001f5,0x000001f6,
+0x000001f7,0x000001f8,0x000001f9,0x000001fa,
+0x000001fb,0x000001fc,0x000001fd,0x000001fa,
+0x000001fe,0x000001ff,0x00000200,0x00000201,
+0x00000202,0x00000203,0x00000204,0x00000205,
+0x00000206,0x00000207,0x00000208,0x00000209,
+0x0000020a,0x0000020b,0x0000020c,0x0000020d,
+0x0000020e,0x0000020f,0x00000210,0x00000211,
+0x00000212,0x00000213,0x00000214,0x00000215,
+0x00000216,0x00000217,0x00000218,0x00000219,
+0x0000021a,0x0000021b,0x0000021c,0x00000219,
+0x0000021d,0x0000021e,0x0000021f,0x00000220,
+0x00000221,0x00000222,0x00000223,0x00000224,
+0x00000225,0x00000226,0x00000227,0x00000228,
+0x00000229,0x0000022a,0x0000022b,0x0000022c,
+0x0000022d,0x0000022e,0x0000022f,0x00000230,
+0x00000231,0x00000232,0x00000233,0x00000234,
+0x00000235,0x00000236,0x00000237,0x00000238,
+0x00000239,0x0000023a,0x0000023b,0x00000238,
+0x0000023c,0x0000023d,0x0000023e,0x0000023f,
+0x00000240,0x00000241,0x00000242,0x00000243,
+0x00000244,0x00000245,0x00000246,0x00000247,
+0x000001cd,0x000001ce,0x000001cf,0x0000022c,
+0x00040020,0x0000024b,0x00000007,0x00000154,
+0x0004002b,0x00000006,0x00000269,0x00000003,
+0x00040020,0x0000026b,0x00000007,0x0000003d,
+0x0004001c,0x0000027c,0x00000006,0x0000003c,
+0x0006002c,0x0000027c,0x0000027d,0x00000269,
+0x00000124,0x00000124,0x00040020,0x0000027f,
+0x00000007,0x0000027c,0x0004002b,0x0000000d,
+0x000002ab,0x00000080,0x0004001c,0x000002ac,
+0x0000003d,0x000002ab,0x0006002c,0x0000003d,
+0x000002ad,0x000000c9,0x000000c9,0x000000c9,
+0x0006002c,0x0000003d,0x000002ae,0x00000082,
+0x000000c9,0x000000c9,0x0006002c,0x0000003d,
+0x000002af,0x000000e7,0x000000c9,0x000000c9,
+0x0006002c,0x0000003d,0x000002b0,0x0000003c,
+0x000000c9,0x000000c9,0x0006002c,0x0000003d,
+0x000002b1,0x000000de,0x000000c9,0x000000c9,
+0x0006002c,0x0000003d,0x000002b2,0x000000c9,
+0x000000de,0x000000c9,0x0006002c,0x0000003d,
+0x000002b3,0x000000de,0x000000de,0x000000c9,
+0x0006002c,0x0000003d,0x000002b4,0x000000de,
+0x000000de,0x000000de,0x0006002c,0x0000003d,
+0x000002b5,0x000000c9,0x00000082,0x000000c9,
+0x0006002c,0x0000003d,0x000002b6,0x00000082,
+0x00000082,0x000000c9,0x0006002c,0x0000003d,
+0x000002b7,0x000000e7,0x00000082,0x000000c9,
+0x0006002c,0x0000003d,0x000002b8,0x0000003c,
+0x00000082,0x000000c9,0x0006002c,0x0000003d,
+0x000002b9,0x000000de,0x00000082,0x000000c9,
+0x0006002c,0x0000003d,0x000002ba,0x00000082,
+0x000000de,0x000000c9,0x0006002c,0x0000003d,
+0x000002bb,0x000000de,0x000000de,0x00000082,
+0x0006002c,0x0000003d,0x000002bc,0x000000c9,
+0x000000e7,0x000000c9,0x0006002c,0x0000003d,
+0x000002bd,0x00000082,0x000000e7,0x000000c9,
+0x0006002c,0x0000003d,0x000002be,0x000000e7,
+0x000000e7,0x000000c9,0x0006002c,0x0000003d,
+0x000002bf,0x0000003c,0x000000e7,0x000000c9,
+0x0006002c,0x0000003d,0x000002c0,0x000000de,
+0x000000e7,0x000000c9,0x0006002c,0x0000003d,
+0x000002c1,0x000000e7,0x000000de,0x000000c9,
+0x0006002c,0x0000003d,0x000002c2,0x000000de,
+0x000000de,0x000000e7,0x0006002c,0x0000003d,
+0x000002c3,0x000000c9,0x0000003c,0x000000c9,
+0x0006002c,0x0000003d,0x000002c4,0x00000082,
+0x0000003c,0x000000c9,0x0006002c,0x0000003d,
+0x000002c5,0x000000e7,0x0000003c,0x000000c9,
+0x0006002c,0x0000003d,0x000002c6,0x0000003c,
+0x0000003c,0x000000c9,0x0006002c,0x0000003d,
+0x000002c7,0x000000de,0x0000003c,0x000000c9,
+0x0006002c,0x0000003d,0x000002c8,0x0000003c,
+0x000000de,0x000000c9,0x0006002c,0x0000003d,
+0x000002c9,0x000000de,0x000000de,0x0000003c,
+0x0006002c,0x0000003d,0x000002ca,0x000000c9,
+0x000000c9,0x00000082,0x0006002c,0x0000003d,
+0x000002cb,0x00000082,0x000000c9,0x00000082,
+0x0006002c,0x0000003d,0x000002cc,0x000000e7,
+0x000000c9,0x00000082,0x0006002c,0x0000003d,
+0x000002cd,0x0000003c,0x000000c9,0x00000082,
+0x0006002c,0x0000003d,0x000002ce,0x000000de,
+0x000000c9,0x00000082,0x0006002c,0x0000003d,
+0x000002cf,0x000000c9,0x000000de,0x00000082,
+0x0006002c,0x0000003d,0x000002d0,0x000000de,
+0x000000c9,0x000000de,0x0006002c,0x0000003d,
+0x000002d1,0x000000c9,0x000000de,0x000000de,
+0x0006002c,0x0000003d,0x000002d2,0x000000c9,
+0x00000082,0x00000082,0x0006002c,0x0000003d,
+0x000002d3,0x00000082,0x00000082,0x00000082,
+0x0006002c,0x0000003d,0x000002d4,0x000000e7,
+0x00000082,0x00000082,0x0006002c,0x0000003d,
+0x000002d5,0x0000003c,0x00000082,0x00000082,
+0x0006002c,0x0000003d,0x000002d6,0x000000de,
+0x00000082,0x00000082,0x0006002c,0x0000003d,
+0x000002d7,0x00000082,0x000000de,0x00000082,
+0x0006002c,0x0000003d,0x000002d8,0x000000de,
+0x00000082,0x000000de,0x0006002c,0x0000003d,
+0x000002d9,0x00000082,0x000000de,0x000000de,
+0x0006002c,0x0000003d,0x000002da,0x000000c9,
+0x000000e7,0x00000082,0x0006002c,0x0000003d,
+0x000002db,0x00000082,0x000000e7,0x00000082,
+0x0006002c,0x0000003d,0x000002dc,0x000000e7,
+0x000000e7,0x00000082,0x0006002c,0x0000003d,
+0x000002dd,0x0000003c,0x000000e7,0x00000082,
+0x0006002c,0x0000003d,0x000002de,0x000000de,
+0x000000e7,0x00000082,0x0006002c,0x0000003d,
+0x000002df,0x000000e7,0x000000de,0x00000082,
+0x0006002c,0x0000003d,0x000002e0,0x000000de,
+0x000000e7,0x000000de,0x0006002c,0x0000003d,
+0x000002e1,0x000000e7,0x000000de,0x000000de,
+0x0006002c,0x0000003d,0x000002e2,0x000000c9,
+0x0000003c,0x00000082,0x0006002c,0x0000003d,
+0x000002e3,0x00000082,0x0000003c,0x00000082,
+0x0006002c,0x0000003d,0x000002e4,0x000000e7,
+0x0000003c,0x00000082,0x0006002c,0x0000003d,
+0x000002e5,0x0000003c,0x0000003c,0x00000082,
+0x0006002c,0x0000003d,0x000002e6,0x000000de,
+0x0000003c,0x00000082,0x0006002c,0x0000003d,
+0x000002e7,0x0000003c,0x000000de,0x00000082,
+0x0006002c,0x0000003d,0x000002e8,0x000000de,
+0x0000003c,0x000000de,0x0006002c,0x0000003d,
+0x000002e9,0x0000003c,0x000000de,0x000000de,
+0x0006002c,0x0000003d,0x000002ea,0x000000c9,
+0x000000c9,0x000000e7,0x0006002c,0x0000003d,
+0x000002eb,0x00000082,0x000000c9,0x000000e7,
+0x0006002c,0x0000003d,0x000002ec,0x000000e7,
+0x000000c9,0x000000e7,0x0006002c,0x0000003d,
+0x000002ed,0x0000003c,0x000000c9,0x000000e7,
+0x0006002c,0x0000003d,0x000002ee,0x000000de,
+0x000000c9,0x000000e7,0x0006002c,0x0000003d,
+0x000002ef,0x000000c9,0x000000de,0x000000e7,
+0x0006002c,0x0000003d,0x000002f0,0x000000e7,
+0x000000c9,0x000000de,0x0006002c,0x0000003d,
+0x000002f1,0x0000003c,0x000000c9,0x000000de,
+0x0006002c,0x0000003d,0x000002f2,0x000000c9,
+0x00000082,0x000000e7,0x0006002c,0x0000003d,
+0x000002f3,0x00000082,0x00000082,0x000000e7,
+0x0006002c,0x0000003d,0x000002f4,0x000000e7,
+0x00000082,0x000000e7,0x0006002c,0x0000003d,
+0x000002f5,0x0000003c,0x00000082,0x000000e7,
+0x0006002c,0x0000003d,0x000002f6,0x000000de,
+0x00000082,0x000000e7,0x0006002c,0x0000003d,
+0x000002f7,0x00000082,0x000000de,0x000000e7,
+0x0006002c,0x0000003d,0x000002f8,0x000000e7,
+0x00000082,0x000000de,0x0006002c,0x0000003d,
+0x000002f9,0x0000003c,0x00000082,0x000000de,
+0x0006002c,0x0000003d,0x000002fa,0x000000c9,
+0x000000e7,0x000000e7,0x0006002c,0x0000003d,
+0x000002fb,0x00000082,0x000000e7,0x000000e7,
+0x0006002c,0x0000003d,0x000002fc,0x000000e7,
+0x000000e7,0x000000e7,0x0006002c,0x0000003d,
+0x000002fd,0x0000003c,0x000000e7,0x000000e7,
+0x0006002c,0x0000003d,0x000002fe,0x000000de,
+0x000000e7,0x000000e7,0x0006002c,0x0000003d,
+0x000002ff,0x000000e7,0x000000de,0x000000e7,
+0x0006002c,0x0000003d,0x00000300,0x000000e7,
+0x000000e7,0x000000de,0x0006002c,0x0000003d,
+0x00000301,0x0000003c,0x000000e7,0x000000de,
+0x0006002c,0x0000003d,0x00000302,0x000000c9,
+0x0000003c,0x000000e7,0x0006002c,0x0000003d,
+0x00000303,0x00000082,0x0000003c,0x000000e7,
+0x0006002c,0x0000003d,0x00000304,0x000000e7,
+0x0000003c,0x000000e7,0x0006002c,0x0000003d,
+0x00000305,0x0000003c,0x0000003c,0x000000e7,
+0x0006002c,0x0000003d,0x00000306,0x000000de,
+0x0000003c,0x000000e7,0x0006002c,0x0000003d,
+0x00000307,0x0000003c,0x000000de,0x000000e7,
+0x0006002c,0x0000003d,0x00000308,0x000000e7,
+0x0000003c,0x000000de,0x0006002c,0x0000003d,
+0x00000309,0x0000003c,0x0000003c,0x000000de,
+0x0006002c,0x0000003d,0x0000030a,0x000000c9,
+0x000000c9,0x0000003c,0x0006002c,0x0000003d,
+0x0000030b,0x00000082,0x000000c9,0x0000003c,
+0x0006002c,0x0000003d,0x0000030c,0x000000e7,
+0x000000c9,0x0000003c,0x0006002c,0x0000003d,
+0x0000030d,0x0000003c,0x000000c9,0x0000003c,
+0x0006002c,0x0000003d,0x0000030e,0x000000de,
+0x000000c9,0x0000003c,0x0006002c,0x0000003d,
+0x0000030f,0x000000c9,0x000000de,0x0000003c,
+0x0006002c,0x0000003d,0x00000310,0x000000c9,
+0x000000c9,0x000000de,0x0006002c,0x0000003d,
+0x00000311,0x00000082,0x000000c9,0x000000de,
+0x0006002c,0x0000003d,0x00000312,0x000000c9,
+0x00000082,0x0000003c,0x0006002c,0x0000003d,
+0x00000313,0x00000082,0x00000082,0x0000003c,
+0x0006002c,0x0000003d,0x00000314,0x000000e7,
+0x00000082,0x0000003c,0x0006002c,0x0000003d,
+0x00000315,0x0000003c,0x00000082,0x0000003c,
+0x0006002c,0x0000003d,0x00000316,0x000000de,
+0x00000082,0x0000003c,0x0006002c,0x0000003d,
+0x00000317,0x00000082,0x000000de,0x0000003c,
+0x0006002c,0x0000003d,0x00000318,0x000000c9,
+0x00000082,0x000000de,0x0006002c,0x0000003d,
+0x00000319,0x00000082,0x00000082,0x000000de,
+0x0006002c,0x0000003d,0x0000031a,0x000000c9,
+0x000000e7,0x0000003c,0x0006002c,0x0000003d,
+0x0000031b,0x00000082,0x000000e7,0x0000003c,
+0x0006002c,0x0000003d,0x0000031c,0x000000e7,
+0x000000e7,0x0000003c,0x0006002c,0x0000003d,
+0x0000031d,0x0000003c,0x000000e7,0x0000003c,
+0x0006002c,0x0000003d,0x0000031e,0x000000de,
+0x000000e7,0x0000003c,0x0006002c,0x0000003d,
+0x0000031f,0x000000e7,0x000000de,0x0000003c,
+0x0006002c,0x0000003d,0x00000320,0x000000c9,
+0x000000e7,0x000000de,0x0006002c,0x0000003d,
+0x00000321,0x00000082,0x000000e7,0x000000de,
+0x0006002c,0x0000003d,0x00000322,0x000000c9,
+0x0000003c,0x0000003c,0x0006002c,0x0000003d,
+0x00000323,0x00000082,0x0000003c,0x0000003c,
+0x0006002c,0x0000003d,0x00000324,0x000000e7,
+0x0000003c,0x0000003c,0x0006002c,0x0000003d,
+0x00000325,0x0000003c,0x0000003c,0x0000003c,
+0x0006002c,0x0000003d,0x00000326,0x000000de,
+0x0000003c,0x0000003c,0x0006002c,0x0000003d,
+0x00000327,0x0000003c,0x000000de,0x0000003c,
+0x0006002c,0x0000003d,0x00000328,0x000000c9,
+0x0000003c,0x000000de,0x0006002c,0x0000003d,
+0x00000329,0x00000082,0x0000003c,0x000000de,
+0x0083002c,0x000002ac,0x0000032a,0x000002ad,
+0x000002ae,0x000002af,0x000002b0,0x000002b1,
+0x000002b2,0x000002b3,0x000002b4,0x000002b5,
+0x000002b6,0x000002b7,0x000002b8,0x000002b9,
+0x000002ba,0x000002bb,0x000002b4,0x000002bc,
+0x000002bd,0x000002be,0x000002bf,0x000002c0,
+0x000002c1,0x000002c2,0x000002b4,0x000002c3,
+0x000002c4,0x000002c5,0x000002c6,0x000002c7,
+0x000002c8,0x000002c9,0x000002b4,0x000002ca,
+0x000002cb,0x000002cc,0x000002cd,0x000002ce,
+0x000002cf,0x000002d0,0x000002d1,0x000002d2,
+0x000002d3,0x000002d4,0x000002d5,0x000002d6,
+0x000002d7,0x000002d8,0x000002d9,0x000002da,
+0x000002db,0x000002dc,0x000002dd,0x000002de,
+0x000002df,0x000002e0,0x000002e1,0x000002e2,
+0x000002e3,0x000002e4,0x000002e5,0x000002e6,
+0x000002e7,0x000002e8,0x000002e9,0x000002ea,
+0x000002eb,0x000002ec,0x000002ed,0x000002ee,
+0x000002ef,0x000002f0,0x000002f1,0x000002f2,
+0x000002f3,0x000002f4,0x000002f5,0x000002f6,
+0x000002f7,0x000002f8,0x000002f9,0x000002fa,
+0x000002fb,0x000002fc,0x000002fd,0x000002fe,
+0x000002ff,0x00000300,0x00000301,0x00000302,
+0x00000303,0x00000304,0x00000305,0x00000306,
+0x00000307,0x00000308,0x00000309,0x0000030a,
+0x0000030b,0x0000030c,0x0000030d,0x0000030e,
+0x0000030f,0x00000310,0x00000311,0x00000312,
+0x00000313,0x00000314,0x00000315,0x00000316,
+0x00000317,0x00000318,0x00000319,0x0000031a,
+0x0000031b,0x0000031c,0x0000031d,0x0000031e,
+0x0000031f,0x00000320,0x00000321,0x00000322,
+0x00000323,0x00000324,0x00000325,0x00000326,
+0x00000327,0x00000328,0x00000329,0x00040020,
+0x0000032d,0x00000007,0x000002ac,0x0004002b,
+0x00000006,0x0000034a,0x00000080,0x0004002b,
+0x00000006,0x00000350,0x0000003f,0x0004002b,
+0x00000006,0x00000354,0x00000020,0x0004002b,
+0x00000006,0x00000359,0x00000040,0x00040020,
+0x0000036d,0x00000007,0x0000005a,0x0004002b,
+0x0000000d,0x00000397,0x00000006,0x0004002b,
+0x00000006,0x000003b5,0x000000ff,0x0004002b,
+0x00000006,0x000003c1,0x000000c0,0x0004002b,
+0x00000006,0x00000417,0x00000008,0x0007002c,
+0x00000049,0x00000514,0x00000109,0x00000109,
+0x00000109,0x00000109,0x0004002b,0x00000006,
+0x0000051b,0x0000000f,0x0004002b,0x00000006,
+0x00000520,0x00000011,0x0004002b,0x00000006,
+0x00000525,0x00000007,0x0004002b,0x00000006,
+0x0000052a,0x00000004,0x0004002b,0x00000006,
+0x00000533,0x00000010,0x0004002b,0x00000006,
+0x00000540,0x00000006,0x00040017,0x00000551,
+0x0000000d,0x00000002,0x0005001e,0x00000552,
+0x00000551,0x0000000d,0x0000000d,0x00040020,
+0x00000553,0x00000009,0x00000552,0x0004003b,
+0x00000553,0x00000554,0x00000009,0x00040020,
+0x00000555,0x00000009,0x0000000d,0x0004002b,
+0x0000000d,0x00000561,0x00000400,0x0004002b,
+0x0000000d,0x0000056b,0x0000000f,0x0004002b,
+0x00000006,0x00000577,0x0000000c,0x0004002b,
+0x00000006,0x00000580,0x00000014,0x0004002b,
+0x00000006,0x00000585,0x00000018,0x0004002b,
+0x00000006,0x0000058a,0x0000001c,0x0004002b,
+0x00000006,0x0000058f,0x00000012,0x0004002b,
+0x00000006,0x00000594,0x00000016,0x0004002b,
+0x00000006,0x00000599,0x0000001a,0x0004002b,
+0x00000006,0x0000059e,0x0000001e,0x0004002b,
+0x0000000d,0x000005e4,0x00000010,0x0004002b,
+0x00000006,0x0000061b,0x0000000e,0x0004002b,
+0x00000006,0x0000062b,0x0000000a,0x0004002b,
+0x0000000d,0x0000064c,0x0000003f,0x00040020,
+0x00000696,0x00000007,0x0000006d,0x0004002b,
+0x0000000d,0x000006a9,0x000000ff,0x0007002c,
+0x00000015,0x000006aa,0x000006a9,0x000000c9,
+0x000006a9,0x000006a9,0x0004002b,0x00000006,
+0x000006c7,0x00000009,0x0004002b,0x0000000d,
+0x000006de,0x0000000c,0x0004002b,0x0000000d,
+0x000006f2,0x0000000a,0x0004002b,0x0000000d,
+0x000006fa,0x00000dff,0x0004002b,0x0000000d,
+0x000006fc,0x00000dfc,0x0004002b,0x0000000d,
+0x0000076d,0x00000040,0x0004002b,0x0000000d,
+0x000007b9,0x00000018,0x0004002b,0x0000000d,
+0x000007bc,0x00000060,0x0004002b,0x0000000d,
+0x000007ea,0x00000078,0x0004001c,0x000007eb,
+0x0000000d,0x000007ea,0x00040020,0x000007ec,
+0x00000007,0x000007eb,0x0004002b,0x0000000d,
+0x000007ef,0x0000002d,0x0004001c,0x000007f0,
+0x0000000d,0x000007ef,0x0004002b,0x0000000d,
+0x000007f1,0x00000033,0x0004002b,0x0000000d,
+0x000007f2,0x00000019,0x0004002b,0x0000000d,
+0x000007f3,0x00000026,0x0004002b,0x0000000d,
+0x000007f4,0x00000011,0x0004002b,0x0000000d,
+0x000007f5,0x0000002e,0x0004002b,0x0000000d,
+0x000007f6,0x0000003a,0x0004002b,0x0000000d,
+0x000007f7,0x00000017,0x0004002b,0x0000000d,
+0x000007f8,0x0000000b,0x0004002b,0x0000000d,
+0x000007f9,0x00000034,0x0004002b,0x0000000d,
+0x000007fa,0x0000001c,0x0004002b,0x0000000d,
+0x000007fb,0x00000023,0x0004002b,0x0000000d,
+0x000007fc,0x00000037,0x0004002b,0x0000000d,
+0x000007fd,0x0000002f,0x0004002b,0x0000000d,
+0x000007fe,0x00000027,0x0004002b,0x0000000d,
+0x000007ff,0x0000003d,0x0004002b,0x0000000d,
+0x00000800,0x00000013,0x0004002b,0x0000000d,
+0x00000801,0x0000002c,0x0004002b,0x0000000d,
+0x00000802,0x0000001b,0x0004002b,0x0000000d,
+0x00000803,0x00000024,0x0004002b,0x0000000d,
+0x00000804,0x0000000d,0x0004002b,0x0000000d,
+0x00000805,0x00000032,0x0004002b,0x0000000d,
+0x00000806,0x00000016,0x0004002b,0x0000000d,
+0x00000807,0x00000029,0x0004002b,0x0000000d,
+0x00000808,0x0000001e,0x0004002b,0x0000000d,
+0x00000809,0x00000021,0x0030002c,0x000007f0,
+0x0000080a,0x000000c9,0x00000088,0x0000064c,
+0x000000c9,0x0000064c,0x000006de,0x000007f1,
+0x000007f2,0x000007f3,0x000000c9,0x0000064c,
+0x000007f4,0x000007f5,0x00000033,0x000007f6,
+0x000007f7,0x00000059,0x000007f8,0x000007f9,
+0x000007fa,0x000007fb,0x000000c9,0x0000064c,
+0x000000da,0x000007fc,0x000005e4,0x000007fd,
+0x000007b9,0x000007fe,0x000000e7,0x000007ff,
+0x000007f8,0x000007f9,0x00000800,0x00000801,
+0x00000802,0x00000803,0x00000033,0x000007f6,
+0x00000804,0x00000805,0x00000806,0x00000807,
+0x00000808,0x00000809,0x0004001c,0x0000080b,
+0x0000000d,0x000000de,0x0004002b,0x0000000d,
+0x0000080c,0x00000009,0x0004002b,0x0000000d,
+0x0000080d,0x00000015,0x0007002c,0x0000080b,
+0x0000080e,0x000000c9,0x0000003c,0x0000080c,
+0x0000080d,0x00040020,0x00000810,0x00000007,
+0x0000080b,0x00040020,0x00000818,0x00000007,
+0x000007f0,0x0004001c,0x0000084a,0x0000000d,
+0x000007fb,0x0004002b,0x0000000d,0x0000084b,
+0x00000038,0x0004002b,0x0000000d,0x0000084c,
+0x0000000e,0x0004002b,0x0000000d,0x0000084d,
+0x00000031,0x0004002b,0x0000000d,0x0000084e,
+0x0000002a,0x0004002b,0x0000000d,0x0000084f,
+0x0000003c,0x0004002b,0x0000000d,0x00000850,
+0x00000039,0x0004002b,0x0000000d,0x00000851,
+0x00000036,0x0004002b,0x0000000d,0x00000852,
+0x0000001a,0x0004002b,0x0000000d,0x00000853,
+0x00000025,0x0004002b,0x0000000d,0x00000854,
+0x0000001d,0x0004002b,0x0000000d,0x00000855,
+0x00000022,0x0026002c,0x0000084a,0x00000856,
+0x000000c9,0x000005e4,0x00000088,0x000007fd,
+0x0000064c,0x000000c9,0x0000064c,0x000000e3,
+0x0000084b,0x0000084c,0x0000084d,0x0000080d,
+0x0000084e,0x000007fa,0x000007fb,0x000000c9,
+0x0000064c,0x000005e4,0x000007fd,0x0000003c,
+0x0000084f,0x00000800,0x00000801,0x00000397,
+0x00000850,0x000007f7,0x00000059,0x0000080c,
+0x00000851,0x00000852,0x00000853,0x00000804,
+0x00000805,0x00000854,0x00000855,0x0006002c,
+0x0000003d,0x00000857,0x000000c9,0x00000033,
+0x0000056b,0x00040020,0x00000860,0x00000007,
+0x0000084a,0x0004001c,0x00000885,0x0000000d,
+0x00000397,0x0009002c,0x00000885,0x00000886,
+0x0000064c,0x0000080d,0x0000080c,0x000000de,
+0x000000e7,0x00000082,0x00040020,0x00000889,
+0x00000007,0x00000885,0x0009002c,0x00000885,
+0x0000088f,0x000000da,0x000000da,0x000000da,
+0x000000e7,0x000000de,0x000000da,0x0004002b,
+0x00000006,0x000008ac,0x0000000b,0x0004002b,
+0x00000006,0x000008cb,0x0000000d,0x0004002b,
+0x00000006,0x000008d6,0x00000017,0x0007002c,
+0x0000080b,0x000008e0,0x000000c9,0x000000e7,
+0x00000033,0x000000da,0x0004002b,0x00000006,
+0x000008f5,0x00000019,0x0004002b,0x00000006,
+0x0000090b,0x0000001b,0x0007002c,0x0000080b,
+0x0000091f,0x000000c9,0x000000e7,0x00000082,
+0x000000c9,0x0004002b,0x00000006,0x00000956,
+0x0000001d,0x0004001c,0x0000096e,0x0000003d,
+0x00000800,0x0006002c,0x0000003d,0x0000096f,
+0x000000c9,0x000000c9,0x000000da,0x0006002c,
+0x0000003d,0x00000970,0x00000082,0x000000c9,
+0x00000397,0x0006002c,0x0000003d,0x00000971,
+0x000000c9,0x00000082,0x00000033,0x0006002c,
+0x0000003d,0x00000972,0x000000c9,0x000000c9,
+0x000000e3,0x0006002c,0x0000003d,0x00000973,
+0x00000082,0x000000c9,0x00000033,0x0006002c,
+0x0000003d,0x00000974,0x000000c9,0x000000c9,
+0x00000397,0x0006002c,0x0000003d,0x00000975,
+0x000000c9,0x000000c9,0x00000033,0x0016002c,
+0x0000096e,0x00000976,0x0000096f,0x00000970,
+0x00000971,0x00000972,0x00000973,0x00000318,
+0x00000974,0x00000311,0x00000312,0x00000975,
+0x0000030b,0x000002f2,0x00000310,0x000002eb,
+0x000002d2,0x0000030a,0x000002cb,0x000002ea,
+0x000002ca,0x00040020,0x00000978,0x00000007,
+0x0000096e,0x0004002b,0x0000000d,0x000009d7,
+0x0000017d,0x0004001c,0x000009d8,0x0000000d,
+0x000009d7,0x0004002b,0x0000000d,0x000009d9,
+0x000000cc,0x0004002b,0x0000000d,0x000009da,
+0x00000066,0x0004002b,0x0000000d,0x000009db,
+0x00000099,0x0004002b,0x0000000d,0x000009dc,
+0x00000045,0x0004002b,0x0000000d,0x000009dd,
+0x000000ba,0x0004002b,0x0000000d,0x000009de,
+0x000000e8,0x0004002b,0x0000000d,0x000009df,
+0x0000005c,0x0004002b,0x0000000d,0x000009e0,
+0x000000a3,0x0004002b,0x0000000d,0x000009e1,
+0x000000d1,0x0004002b,0x0000000d,0x000009e2,
+0x00000074,0x0004002b,0x0000000d,0x000009e3,
+0x0000008b,0x0004002b,0x0000000d,0x000009e4,
+0x000000de,0x0004002b,0x0000000d,0x000009e5,
+0x00000042,0x0004002b,0x0000000d,0x000009e6,
+0x000000bd,0x0004002b,0x0000000d,0x000009e7,
+0x00000063,0x0004002b,0x0000000d,0x000009e8,
+0x0000009c,0x0004002b,0x0000000d,0x000009e9,
+0x000000f4,0x0004002b,0x0000000d,0x000009ea,
+0x000000d3,0x0004002b,0x0000000d,0x000009eb,
+0x0000004d,0x0004002b,0x0000000d,0x000009ec,
+0x000000b2,0x0004002b,0x0000000d,0x000009ed,
+0x0000006e,0x0004002b,0x0000000d,0x000009ee,
+0x00000091,0x0004002b,0x0000000d,0x000009ef,
+0x000000e9,0x0004002b,0x0000000d,0x000009f0,
+0x000000c8,0x0004002b,0x0000000d,0x000009f1,
+0x00000058,0x0004002b,0x0000000d,0x000009f2,
+0x000000a7,0x0004002b,0x0000000d,0x000009f3,
+0x00000079,0x0004002b,0x0000000d,0x000009f4,
+0x00000086,0x0004002b,0x0000000d,0x000009f5,
+0x000000ef,0x0004002b,0x0000000d,0x000009f6,
+0x000000df,0x0004002b,0x0000000d,0x000009f7,
+0x00000030,0x0004002b,0x0000000d,0x000009f8,
+0x000000cf,0x0004002b,0x0000000d,0x000009f9,
+0x00000041,0x0004002b,0x0000000d,0x000009fa,
+0x000000be,0x0004002b,0x0000000d,0x000009fb,
+0x00000051,0x0004002b,0x0000000d,0x000009fc,
+0x000000ae,0x0004002b,0x0000000d,0x000009fd,
+0x00000061,0x0004002b,0x0000000d,0x000009fe,
+0x0000009e,0x0004002b,0x0000000d,0x000009ff,
+0x00000071,0x0004002b,0x0000000d,0x00000a00,
+0x0000008e,0x0004002b,0x0000000d,0x00000a01,
+0x000000fa,0x0004002b,0x0000000d,0x00000a02,
+0x000000ea,0x0004002b,0x0000000d,0x00000a03,
+0x000000d9,0x0004002b,0x0000000d,0x00000a04,
+0x000000c9,0x0004002b,0x0000000d,0x00000a05,
+0x00000046,0x0004002b,0x0000000d,0x00000a06,
+0x000000b9,0x0004002b,0x0000000d,0x00000a07,
+0x00000056,0x0004002b,0x0000000d,0x00000a08,
+0x000000a9,0x0004002b,0x0000000d,0x00000a09,
+0x00000067,0x0004002b,0x0000000d,0x00000a0a,
+0x00000098,0x0004002b,0x0000000d,0x00000a0b,
+0x00000077,0x0004002b,0x0000000d,0x00000a0c,
+0x00000088,0x0004002b,0x0000000d,0x00000a0d,
+0x000000e4,0x0004002b,0x0000000d,0x00000a0e,
+0x0000002b,0x0004002b,0x0000000d,0x00000a0f,
+0x000000d4,0x0004002b,0x0000000d,0x00000a10,
+0x0000003b,0x0004002b,0x0000000d,0x00000a11,
+0x000000c4,0x0004002b,0x0000000d,0x00000a12,
+0x0000004c,0x0004002b,0x0000000d,0x00000a13,
+0x000000b3,0x0004002b,0x0000000d,0x00000a14,
+0x0000006c,0x0004002b,0x0000000d,0x00000a15,
+0x00000093,0x0004002b,0x0000000d,0x00000a16,
+0x0000007c,0x0004002b,0x0000000d,0x00000a17,
+0x00000083,0x0004002b,0x0000000d,0x00000a18,
+0x000000f7,0x0004002b,0x0000000d,0x00000a19,
+0x000000e7,0x0004002b,0x0000000d,0x00000a1a,
+0x000000d7,0x0004002b,0x0000000d,0x00000a1b,
+0x000000c7,0x0004002b,0x0000000d,0x00000a1c,
+0x000000bf,0x0004002b,0x0000000d,0x00000a1d,
+0x00000048,0x0004002b,0x0000000d,0x00000a1e,
+0x000000b7,0x0004002b,0x0000000d,0x00000a1f,
+0x00000050,0x0004002b,0x0000000d,0x00000a20,
+0x000000af,0x0004002b,0x0000000d,0x00000a21,
+0x0000009f,0x0004002b,0x0000000d,0x00000a22,
+0x00000068,0x0004002b,0x0000000d,0x00000a23,
+0x00000097,0x0004002b,0x0000000d,0x00000a24,
+0x00000070,0x0004002b,0x0000000d,0x00000a25,
+0x0000008f,0x0004002b,0x0000000d,0x00000a26,
+0x00000087,0x0004002b,0x0000000d,0x00000a27,
+0x000000fd,0x0004002b,0x0000000d,0x00000a28,
+0x000000f5,0x0004002b,0x0000000d,0x00000a29,
+0x00000012,0x0004002b,0x0000000d,0x00000a2a,
+0x000000ed,0x0004002b,0x0000000d,0x00000a2b,
+0x000000e5,0x0004002b,0x0000000d,0x00000a2c,
+0x000000dc,0x0004002b,0x0000000d,0x00000a2d,
+0x00000043,0x0004002b,0x0000000d,0x00000a2e,
+0x000000bc,0x0004002b,0x0000000d,0x00000a2f,
+0x0000004b,0x0004002b,0x0000000d,0x00000a30,
+0x000000b4,0x0004002b,0x0000000d,0x00000a31,
+0x00000053,0x0004002b,0x0000000d,0x00000a32,
+0x000000ac,0x0004002b,0x0000000d,0x00000a33,
+0x0000005b,0x0004002b,0x0000000d,0x00000a34,
+0x000000a4,0x0004002b,0x0000000d,0x00000a35,
+0x0000006b,0x0004002b,0x0000000d,0x00000a36,
+0x00000094,0x0004002b,0x0000000d,0x00000a37,
+0x00000073,0x0004002b,0x0000000d,0x00000a38,
+0x0000008c,0x0004002b,0x0000000d,0x00000a39,
+0x0000007b,0x0004002b,0x0000000d,0x00000a3a,
+0x00000084,0x0004002b,0x0000000d,0x00000a3b,
+0x000000f2,0x0004002b,0x0000000d,0x00000a3c,
+0x000000e2,0x0004002b,0x0000000d,0x00000a3d,
+0x000000da,0x0004002b,0x0000000d,0x00000a3e,
+0x000000d2,0x0004002b,0x0000000d,0x00000a3f,
+0x00000035,0x0004002b,0x0000000d,0x00000a40,
+0x000000ca,0x0004002b,0x0000000d,0x00000a41,
+0x000000c2,0x0004002b,0x0000000d,0x00000a42,
+0x0000004e,0x0004002b,0x0000000d,0x00000a43,
+0x000000b1,0x0004002b,0x0000000d,0x00000a44,
+0x0000005e,0x0004002b,0x0000000d,0x00000a45,
+0x000000a1,0x0004002b,0x0000000d,0x00000a46,
+0x00000076,0x0004002b,0x0000000d,0x00000a47,
+0x00000089,0x0004002b,0x0000000d,0x00000a48,
+0x0000007e,0x0004002b,0x0000000d,0x00000a49,
+0x00000081,0x0004002b,0x0000000d,0x00000a4a,
+0x000000fb,0x0004002b,0x0000000d,0x00000a4b,
+0x000000f3,0x0004002b,0x0000000d,0x00000a4c,
+0x00000014,0x0004002b,0x0000000d,0x00000a4d,
+0x000000eb,0x0004002b,0x0000000d,0x00000a4e,
+0x000000e3,0x0004002b,0x0000000d,0x00000a4f,
+0x000000db,0x0004002b,0x0000000d,0x00000a50,
+0x000000cb,0x0004002b,0x0000000d,0x00000a51,
+0x000000c3,0x0004002b,0x0000000d,0x00000a52,
+0x00000044,0x0004002b,0x0000000d,0x00000a53,
+0x000000bb,0x0004002b,0x0000000d,0x00000a54,
+0x00000054,0x0004002b,0x0000000d,0x00000a55,
+0x000000ab,0x0004002b,0x0000000d,0x00000a56,
+0x00000064,0x0004002b,0x0000000d,0x00000a57,
+0x0000009b,0x0004002b,0x0000000d,0x00000a58,
+0x000000fe,0x0004002b,0x0000000d,0x00000a59,
+0x000000f6,0x0004002b,0x0000000d,0x00000a5a,
+0x000000ee,0x0004002b,0x0000000d,0x00000a5b,
+0x000000e6,0x0004002b,0x0000000d,0x00000a5c,
+0x000000d6,0x0004002b,0x0000000d,0x00000a5d,
+0x000000ce,0x0004002b,0x0000000d,0x00000a5e,
+0x000000c6,0x0004002b,0x0000000d,0x00000a5f,
+0x00000049,0x0004002b,0x0000000d,0x00000a60,
+0x000000b6,0x0004002b,0x0000000d,0x00000a61,
+0x00000055,0x0004002b,0x0000000d,0x00000a62,
+0x000000aa,0x0004002b,0x0000000d,0x00000a63,
+0x00000059,0x0004002b,0x0000000d,0x00000a64,
+0x000000a6,0x0004002b,0x0000000d,0x00000a65,
+0x0000005d,0x0004002b,0x0000000d,0x00000a66,
+0x000000a2,0x0004002b,0x0000000d,0x00000a67,
+0x00000065,0x0004002b,0x0000000d,0x00000a68,
+0x0000009a,0x0004002b,0x0000000d,0x00000a69,
+0x00000069,0x0004002b,0x0000000d,0x00000a6a,
+0x00000096,0x0004002b,0x0000000d,0x00000a6b,
+0x0000006d,0x0004002b,0x0000000d,0x00000a6c,
+0x00000092,0x0004002b,0x0000000d,0x00000a6d,
+0x00000075,0x0004002b,0x0000000d,0x00000a6e,
+0x0000008a,0x0004002b,0x0000000d,0x00000a6f,
+0x0000007d,0x0004002b,0x0000000d,0x00000a70,
+0x00000082,0x0004002b,0x0000000d,0x00000a71,
+0x000000f9,0x0004002b,0x0000000d,0x00000a72,
+0x000000f1,0x0004002b,0x0000000d,0x00000a73,
+0x000000e1,0x0004002b,0x0000000d,0x00000a74,
+0x000000dd,0x0004002b,0x0000000d,0x00000a75,
+0x000000d5,0x0004002b,0x0000000d,0x00000a76,
+0x000000cd,0x0004002b,0x0000000d,0x00000a77,
+0x000000c5,0x0004002b,0x0000000d,0x00000a78,
+0x0000003e,0x0004002b,0x0000000d,0x00000a79,
+0x000000c1,0x0004002b,0x0000000d,0x00000a7a,
+0x0000004a,0x0004002b,0x0000000d,0x00000a7b,
+0x000000b5,0x0004002b,0x0000000d,0x00000a7c,
+0x00000052,0x0004002b,0x0000000d,0x00000a7d,
+0x000000ad,0x0004002b,0x0000000d,0x00000a7e,
+0x0000005a,0x0004002b,0x0000000d,0x00000a7f,
+0x000000a5,0x0004002b,0x0000000d,0x00000a80,
+0x00000062,0x0004002b,0x0000000d,0x00000a81,
+0x0000009d,0x0004002b,0x0000000d,0x00000a82,
+0x0000006a,0x0004002b,0x0000000d,0x00000a83,
+0x00000095,0x0004002b,0x0000000d,0x00000a84,
+0x00000072,0x0004002b,0x0000000d,0x00000a85,
+0x0000008d,0x0004002b,0x0000000d,0x00000a86,
+0x0000007a,0x0004002b,0x0000000d,0x00000a87,
+0x00000085,0x0180002c,0x000009d8,0x00000a88,
+0x000000c9,0x000000c9,0x000000c9,0x000000c9,
+0x000006a9,0x000007f1,0x000009d9,0x000009da,
+0x000009db,0x000000c9,0x000006a9,0x000009dc,
+0x000009dd,0x000007f7,0x000009de,0x000009df,
+0x000009e0,0x000007f5,0x000009e1,0x000009e2,
+0x000009e3,0x000000c9,0x000006a9,0x00000809,
+0x000009e4,0x000009e5,0x000009e6,0x000009e7,
+0x000009e8,0x000007f8,0x000009e9,0x00000801,
+0x000009ea,0x000009eb,0x000009ec,0x000009ed,
+0x000009ee,0x00000806,0x000009ef,0x000007fc,
+0x000009f0,0x000009f1,0x000009f2,0x000009f3,
+0x000009f4,0x000000c9,0x000006a9,0x000005e4,
+0x000009f5,0x00000088,0x000009f6,0x000009f7,
+0x000009f8,0x000009f9,0x000009fa,0x000009fb,
+0x000009fc,0x000009fd,0x000009fe,0x000009ff,
+0x00000a00,0x00000033,0x00000a01,0x0000080d,
+0x00000a02,0x000007f3,0x00000a03,0x00000851,
+0x00000a04,0x00000a05,0x00000a06,0x00000a07,
+0x00000a08,0x00000a09,0x00000a0a,0x00000a0b,
+0x00000a0c,0x000007f8,0x000009e9,0x00000802,
+0x00000a0d,0x00000a0e,0x00000a0f,0x00000a10,
+0x00000a11,0x00000a12,0x00000a13,0x000009df,
+0x000009e0,0x00000a14,0x00000a15,0x00000a16,
+0x00000a17,0x000000c9,0x000006a9,0x000000da,
+0x00000a18,0x000005e4,0x000009f5,0x000007b9,
+0x00000a19,0x00000088,0x000009f6,0x00000059,
+0x00000a1a,0x000009f7,0x000009f8,0x0000084b,
+0x00000a1b,0x0000076d,0x00000a1c,0x00000a1d,
+0x00000a1e,0x00000a1f,0x00000a20,0x000009f1,
+0x000009f2,0x000007bc,0x00000a21,0x00000a22,
+0x00000a23,0x00000a24,0x00000a25,0x000007ea,
+0x00000a26,0x000000e7,0x00000a27,0x000006f2,
+0x00000a28,0x00000a29,0x00000a2a,0x00000852,
+0x00000a2b,0x000007fb,0x00000a2c,0x00000a0e,
+0x00000a0f,0x000007f1,0x000009d9,0x00000a10,
+0x00000a11,0x00000a2d,0x00000a2e,0x00000a2f,
+0x00000a30,0x00000a31,0x00000a32,0x00000a33,
+0x00000a34,0x000009e7,0x000009e8,0x00000a35,
+0x00000a36,0x00000a37,0x00000a38,0x00000a39,
+0x00000a3a,0x00000033,0x00000a01,0x00000804,
+0x00000a3b,0x0000080d,0x00000a02,0x00000854,
+0x00000a3c,0x00000853,0x00000a3d,0x000007ef,
+0x00000a3e,0x00000a3f,0x00000a40,0x000007ff,
+0x00000a41,0x00000a05,0x00000a06,0x00000a42,
+0x00000a43,0x00000a07,0x00000a08,0x00000a44,
+0x00000a45,0x000009da,0x000009db,0x000009ed,
+0x000009ee,0x00000a46,0x00000a47,0x00000a48,
+0x00000a49,0x000000c9,0x000006a9,0x000000de,
+0x00000a4a,0x000000da,0x00000a18,0x000006de,
+0x00000a4b,0x000005e4,0x000009f5,0x00000a4c,
+0x00000a4d,0x000007b9,0x00000a19,0x000007fa,
+0x00000a4e,0x00000088,0x000009f6,0x00000803,
+0x00000a4f,0x00000059,0x00000a1a,0x00000801,
+0x000009ea,0x000009f7,0x000009f8,0x000007f9,
+0x00000a50,0x0000084b,0x00000a1b,0x0000084f,
+0x00000a51,0x0000076d,0x00000a1c,0x00000a52,
+0x00000a53,0x00000a1d,0x00000a1e,0x00000a12,
+0x00000a13,0x00000a1f,0x00000a20,0x00000a54,
+0x00000a55,0x000009f1,0x000009f2,0x000009df,
+0x000009e0,0x000007bc,0x00000a21,0x00000a56,
+0x00000a57,0x00000a22,0x00000a23,0x00000a14,
+0x00000a15,0x00000a24,0x00000a25,0x000009e2,
+0x000009e3,0x000007ea,0x00000a26,0x00000a16,
+0x00000a17,0x00000082,0x00000a58,0x00000033,
+0x00000a01,0x0000080c,0x00000a59,0x00000804,
+0x00000a3b,0x000007f4,0x00000a5a,0x0000080d,
+0x00000a02,0x000007f2,0x00000a5b,0x00000854,
+0x00000a3c,0x00000809,0x000009e4,0x00000853,
+0x00000a3d,0x00000807,0x00000a5c,0x000007ef,
+0x00000a3e,0x0000084d,0x00000a5d,0x00000a3f,
+0x00000a40,0x00000850,0x00000a5e,0x000007ff,
+0x00000a41,0x000009f9,0x000009fa,0x000009dc,
+0x000009dd,0x00000a5f,0x00000a60,0x000009eb,
+0x000009ec,0x000009fb,0x000009fc,0x00000a61,
+0x00000a62,0x00000a63,0x00000a64,0x00000a65,
+0x00000a66,0x000009fd,0x000009fe,0x00000a67,
+0x00000a68,0x00000a69,0x00000a6a,0x00000a6b,
+0x00000a6c,0x000009ff,0x00000a00,0x00000a6d,
+0x00000a6e,0x000009f3,0x000009f4,0x00000a6f,
+0x00000a70,0x000000e7,0x00000a27,0x00000397,
+0x00000a71,0x000006f2,0x00000a28,0x0000084c,
+0x00000a72,0x00000a29,0x00000a2a,0x00000806,
+0x000009ef,0x00000852,0x00000a2b,0x00000808,
+0x00000a73,0x00000855,0x00000a74,0x000007f3,
+0x00000a03,0x0000084e,0x00000a75,0x000007f5,
+0x000009e1,0x00000805,0x00000a76,0x00000851,
+0x00000a04,0x000007f6,0x00000a77,0x00000a78,
+0x00000a79,0x000009e5,0x000009e6,0x00000a05,
+0x00000a06,0x00000a7a,0x00000a7b,0x00000a42,
+0x00000a43,0x00000a7c,0x00000a7d,0x00000a07,
+0x00000a08,0x00000a7e,0x00000a7f,0x00000a44,
+0x00000a45,0x00000a80,0x00000a81,0x000009da,
+0x000009db,0x00000a82,0x00000a83,0x000009ed,
+0x000009ee,0x00000a84,0x00000a85,0x00000a46,
+0x00000a47,0x00000a86,0x00000a87,0x00000a48,
+0x00000a49,0x0004001c,0x00000a89,0x0000000d,
+0x000000e3,0x000a002c,0x00000a89,0x00000a8a,
+0x000000c9,0x0000003c,0x0000080c,0x0000080d,
+0x000007ef,0x00000a65,0x000009e6,0x00040020,
+0x00000a8c,0x00000007,0x00000a89,0x00040020,
+0x00000a94,0x00000007,0x000009d8,0x0004002b,
+0x0000000d,0x00000aba,0x0000013b,0x0004001c,
+0x00000abb,0x0000000d,0x00000aba,0x0004002b,
+0x0000000d,0x00000abc,0x000000d8,0x0004002b,
+0x0000000d,0x00000abd,0x00000047,0x0004002b,
+0x0000000d,0x00000abe,0x000000b8,0x0004002b,
+0x0000000d,0x00000abf,0x000000ec,0x0004002b,
+0x0000000d,0x00000ac0,0x000000fc,0x0004002b,
+0x0000000d,0x00000ac1,0x00000057,0x0004002b,
+0x0000000d,0x00000ac2,0x000000a8,0x013e002c,
+0x00000abb,0x00000ac3,0x000000c9,0x000000c9,
+0x000000c9,0x000000c9,0x000000c9,0x000000c9,
+0x000006a9,0x000007fa,0x00000a4e,0x0000084b,
+0x00000a1b,0x00000a54,0x00000a55,0x000009ff,
+0x00000a00,0x000000c9,0x000006a9,0x00000a2d,
+0x00000a2e,0x00000804,0x00000a3b,0x00000a1f,
+0x00000a20,0x00000802,0x00000a0d,0x00000a44,
+0x00000a45,0x00000059,0x00000a1a,0x00000a35,
+0x00000a36,0x00000851,0x00000a04,0x000009f3,
+0x000009f4,0x000000c9,0x000006a9,0x00000088,
+0x000009f6,0x000009f9,0x000009fa,0x000009fd,
+0x000009fe,0x00000397,0x00000a71,0x000007fe,
+0x00000abc,0x00000abd,0x00000abe,0x00000a22,
+0x00000a23,0x00000804,0x00000a3b,0x000007ef,
+0x00000a3e,0x00000a42,0x00000a43,0x000009ed,
+0x000009ee,0x00000800,0x00000abf,0x000007f9,
+0x00000a50,0x00000a54,0x00000a55,0x00000a6d,
+0x00000a6e,0x00000852,0x00000a2b,0x000007f6,
+0x00000a77,0x00000a33,0x00000a34,0x00000a39,
+0x00000a3a,0x000000c9,0x000006a9,0x000005e4,
+0x000009f5,0x00000088,0x000009f6,0x000009f7,
+0x000009f8,0x0000076d,0x00000a1c,0x00000a1f,
+0x00000a20,0x000007bc,0x00000a21,0x00000a24,
+0x00000a25,0x0000003c,0x00000ac0,0x00000800,
+0x00000abf,0x000007fb,0x00000a2c,0x000007f1,
+0x000009d9,0x00000a2d,0x00000a2e,0x00000a31,
+0x00000a32,0x00000a56,0x00000a57,0x000009e2,
+0x000009e3,0x00000397,0x00000a71,0x00000806,
+0x000009ef,0x000007f3,0x00000a03,0x00000851,
+0x00000a04,0x00000abd,0x00000abe,0x00000ac1,
+0x00000ac2,0x00000a09,0x00000a0a,0x00000a0b,
+0x00000a0c,0x0000080c,0x00000a59,0x000007f2,
+0x00000a5b,0x0000084e,0x00000a75,0x000007f6,
+0x00000a77,0x00000a7a,0x00000a7b,0x00000a7e,
+0x00000a7f,0x00000a82,0x00000a83,0x00000a86,
+0x00000a87,0x00000804,0x00000a3b,0x00000854,
+0x00000a3c,0x000007ef,0x00000a3e,0x000007ff,
+0x00000a41,0x000009eb,0x000009ec,0x00000a65,
+0x00000a66,0x00000a6b,0x00000a6c,0x00000a6f,
+0x00000a70,0x000000c9,0x000006a9,0x000000da,
+0x00000a18,0x000005e4,0x000009f5,0x000007b9,
+0x00000a19,0x00000088,0x000009f6,0x00000059,
+0x00000a1a,0x000009f7,0x000009f8,0x0000084b,
+0x00000a1b,0x0000076d,0x00000a1c,0x00000a1d,
+0x00000a1e,0x00000a1f,0x00000a20,0x000009f1,
+0x000009f2,0x000007bc,0x00000a21,0x00000a22,
+0x00000a23,0x00000a24,0x00000a25,0x000007ea,
+0x00000a26,0x00000082,0x00000a58,0x0000080c,
+0x00000a59,0x000007f4,0x00000a5a,0x000007f2,
+0x00000a5b,0x00000809,0x000009e4,0x00000807,
+0x00000a5c,0x0000084d,0x00000a5d,0x00000850,
+0x00000a5e,0x000009f9,0x000009fa,0x00000a5f,
+0x00000a60,0x000009fb,0x000009fc,0x00000a63,
+0x00000a64,0x000009fd,0x000009fe,0x00000a69,
+0x00000a6a,0x000009ff,0x00000a00,0x000009f3,
+0x000009f4,0x0000003c,0x00000ac0,0x000007f8,
+0x000009e9,0x00000800,0x00000abf,0x00000802,
+0x00000a0d,0x000007fb,0x00000a2c,0x00000a0e,
+0x00000a0f,0x000007f1,0x000009d9,0x00000a10,
+0x00000a11,0x00000a2d,0x00000a2e,0x00000a2f,
+0x00000a30,0x00000a31,0x00000a32,0x00000a33,
+0x00000a34,0x000009e7,0x000009e8,0x00000a35,
+0x00000a36,0x00000a37,0x00000a38,0x00000a39,
+0x00000a3a,0x000000de,0x00000a4a,0x000006de,
+0x00000a4b,0x00000a4c,0x00000a4d,0x000007fa,
+0x00000a4e,0x00000803,0x00000a4f,0x00000801,
+0x000009ea,0x000007f9,0x00000a50,0x0000084f,
+0x00000a51,0x00000a52,0x00000a53,0x00000a12,
+0x00000a13,0x00000a54,0x00000a55,0x000009df,
+0x000009e0,0x00000a56,0x00000a57,0x00000a14,
+0x00000a15,0x000009e2,0x000009e3,0x00000a16,
+0x00000a17,0x00000397,0x00000a71,0x0000084c,
+0x00000a72,0x00000806,0x000009ef,0x00000808,
+0x00000a73,0x000007f3,0x00000a03,0x000007f5,
+0x000009e1,0x00000851,0x00000a04,0x00000a78,
+0x00000a79,0x00000a05,0x00000a06,0x00000a42,
+0x00000a43,0x00000a07,0x00000a08,0x00000a44,
+0x00000a45,0x000009da,0x000009db,0x000009ed,
+0x000009ee,0x00000a46,0x00000a47,0x00000a48,
+0x00000a49,0x0009002c,0x00000885,0x00000ac4,
+0x000000c9,0x00000033,0x0000056b,0x000007fb,
+0x00000a2f,0x00000a57,0x00040020,0x00000acd,
+0x00000007,0x00000abb,0x0004001c,0x00000ae6,
+0x0000000d,0x000000da,0x000b002c,0x00000ae6,
+0x00000ae7,0x000006a9,0x00000a61,0x00000803,
+0x000007f4,0x000000da,0x000000de,0x000000e7,
+0x00000082,0x00040020,0x00000aea,0x00000007,
+0x00000ae6,0x000b002c,0x00000ae6,0x00000af0,
+0x000000da,0x000000da,0x00000082,0x000000da,
+0x000000e7,0x000000de,0x00000397,0x000000da,
+0x0004001c,0x00000b0c,0x00000015,0x000000e7,
+0x0004001c,0x00000b0d,0x00000b0c,0x000000de,
+0x00040020,0x00000b0e,0x00000007,0x00000b0d,
+0x00040020,0x00000b27,0x00000007,0x00000551,
+0x00040020,0x00000b29,0x00000009,0x00000551,
+0x0004002b,0x0000000d,0x00000b4f,0x000003ff,
+0x0004001c,0x00000b59,0x00000099,0x000005e4,
+0x0003002a,0x00000099,0x00000b5a,0x00030029,
+0x00000099,0x00000b5b,0x0013002c,0x00000b59,
+0x00000b5c,0x00000b5a,0x00000b5a,0x00000b5b,
+0x00000b5b,0x00000b5a,0x00000b5a,0x00000b5a,
+0x00000b5b,0x00000b5a,0x00000b5a,0x00000b5a,
+0x00000b5b,0x00000b5a,0x00000b5a,0x00000b5b,
+0x00000b5b,0x00040020,0x00000b60,0x00000007,
+0x00000b59,0x00040020,0x00000b62,0x00000007,
+0x00000099,0x00040017,0x00000b82,0x00000006,
+0x00000002,0x00040017,0x00000c51,0x0000000d,
+0x00000003,0x00040020,0x00000c52,0x00000001,
+0x00000c51,0x0004003b,0x00000c52,0x00000c53,
+0x00000001,0x00090019,0x00000c5e,0x0000000d,
+0x00000002,0x00000000,0x00000000,0x00000000,
+0x00000002,0x0000001e,0x00040020,0x00000c5f,
+0x00000000,0x00000c5e,0x0004003b,0x00000c5f,
+0x00000c60,0x00000000,0x00090019,0x00000c8a,
+0x0000000d,0x00000002,0x00000000,0x00000000,
+0x00000000,0x00000002,0x00000020,0x00040020,
+0x00000c8b,0x00000000,0x00000c8a,0x0004003b,
+0x00000c8b,0x00000c8c,0x00000000,0x0006002c,
+0x00000c51,0x00000caf,0x000000da,0x000000da,
+0x00000082,0x0004002b,0x00000006,0x00000cb0,
+0x00000013,0x00050036,0x00000002,0x00000004,
+0x00000000,0x00000003,0x000200f8,0x00000005,
+0x0004003b,0x00000008,0x00000c50,0x00000007,
+0x0004003b,0x00000016,0x00000c5d,0x00000007,
+0x0004003b,0x00000008,0x00000c62,0x00000007,
+0x0004003b,0x00000696,0x00000c74,0x00000007,
+0x0004003b,0x0000000e,0x00000c77,0x00000007,
+0x0004003b,0x0000000e,0x00000c80,0x00000007,
+0x0004003b,0x00000008,0x00000ca1,0x00000007,
+0x0004003d,0x00000c51,0x00000c54,0x00000c53,
+0x0004007c,0x00000007,0x00000c55,0x00000c54,
+0x0003003e,0x00000c50,0x00000c55,0x00050041,
+0x00000555,0x00000c56,0x00000554,0x0000008e,
+0x0004003d,0x0000000d,0x00000c57,0x00000c56,
+0x0004007c,0x00000006,0x00000c58,0x00000c57,
+0x00050041,0x0000000f,0x00000c59,0x00000c50,
+0x000000e7,0x0004003d,0x00000006,0x00000c5a,
+0x00000c59,0x00050080,0x00000006,0x00000c5b,
+0x00000c5a,0x00000c58,0x00050041,0x0000000f,
+0x00000c5c,0x00000c50,0x000000e7,0x0003003e,
+0x00000c5c,0x00000c5b,0x0004003d,0x00000c5e,
+0x00000c61,0x00000c60,0x0004003d,0x00000007,
+0x00000c63,0x00000c50,0x0003003e,0x00000c62,
+0x00000c63,0x00050039,0x00000007,0x00000c64,
+0x0000000b,0x00000c62,0x00050062,0x00000015,
+0x00000c65,0x00000c61,0x00000c64,0x00050051,
+0x0000000d,0x00000c66,0x00000c65,0x00000000,
+0x00050051,0x0000000d,0x00000c67,0x00000c65,
+0x00000001,0x00050051,0x0000000d,0x00000c68,
+0x00000c65,0x00000002,0x00050051,0x0000000d,
+0x00000c69,0x00000c65,0x00000003,0x00070050,
+0x00000015,0x00000c6a,0x00000c66,0x00000c67,
+0x00000c68,0x00000c69,0x0003003e,0x00000c5d,
+0x00000c6a,0x00050041,0x0000000e,0x00000c6b,
+0x00000c5d,0x0000003c,0x0004003d,0x0000000d,
+0x00000c6c,0x00000c6b,0x00050041,0x0000000e,
+0x00000c6d,0x00000c5d,0x000000e7,0x0004003d,
+0x0000000d,0x00000c6e,0x00000c6d,0x00050041,
+0x0000000e,0x00000c6f,0x00000c5d,0x00000082,
+0x0004003d,0x0000000d,0x00000c70,0x00000c6f,
+0x00050041,0x0000000e,0x00000c71,0x00000c5d,
+0x000000c9,0x0004003d,0x0000000d,0x00000c72,
+0x00000c71,0x00070050,0x00000015,0x00000c73,
+0x00000c6c,0x00000c6e,0x00000c70,0x00000c72,
+0x0003003e,0x00000c5d,0x00000c73,0x0004003d,
+0x00000015,0x00000c75,0x00000c5d,0x00050039,
+0x0000006d,0x00000c76,0x00000077,0x00000c75,
+0x0003003e,0x00000c74,0x00000c76,0x0003003e,
+0x00000c77,0x000000c9,0x000200f9,0x00000c78,
+0x000200f8,0x00000c78,0x000400f6,0x00000c7a,
+0x00000c7b,0x00000000,0x000200f9,0x00000c7c,
+0x000200f8,0x00000c7c,0x0004003d,0x0000000d,
+0x00000c7d,0x00000c77,0x00040039,0x0000000d,
+0x00000c7e,0x0000007a,0x000500b0,0x00000099,
+0x00000c7f,0x00000c7d,0x00000c7e,0x000400fa,
+0x00000c7f,0x00000c79,0x00000c7a,0x000200f8,
+0x00000c79,0x0003003e,0x00000c80,0x000000c9,
+0x000200f9,0x00000c81,0x000200f8,0x00000c81,
+0x000400f6,0x00000c83,0x00000c84,0x00000000,
+0x000200f9,0x00000c85,0x000200f8,0x00000c85,
+0x0004003d,0x0000000d,0x00000c86,0x00000c80,
+0x00060041,0x00000555,0x00000c87,0x00000554,
+0x00000109,0x000000c9,0x0004003d,0x0000000d,
+0x00000c88,0x00000c87,0x000500b0,0x00000099,
+0x00000c89,0x00000c86,0x00000c88,0x000400fa,
+0x00000c89,0x00000c82,0x00000c83,0x000200f8,
+0x00000c82,0x0004003d,0x00000c8a,0x00000c8d,
+0x00000c8c,0x0004003d,0x00000007,0x00000c8e,
+0x00000c50,0x0007004f,0x00000b82,0x00000c8f,
+0x00000c8e,0x00000c8e,0x00000000,0x00000001,
+0x0004007c,0x00000551,0x00000c90,0x00000c8f,
+0x00050041,0x00000b29,0x00000c91,0x00000554,
+0x00000109,0x0004003d,0x00000551,0x00000c92,
+0x00000c91,0x00050084,0x00000551,0x00000c93,
+0x00000c90,0x00000c92,0x0004003d,0x0000000d,
+0x00000c94,0x00000c80,0x0004007c,0x00000006,
+0x00000c95,0x00000c94,0x0004003d,0x0000000d,
+0x00000c96,0x00000c77,0x0004007c,0x00000006,
+0x00000c97,0x00000c96,0x00050050,0x00000b82,
+0x00000c98,0x00000c95,0x00000c97,0x0004007c,
+0x00000551,0x00000c99,0x00000c98,0x00050080,
+0x00000551,0x00000c9a,0x00000c93,0x00000c99,
+0x0004007c,0x00000b82,0x00000c9b,0x00000c9a,
+0x00050041,0x0000000f,0x00000c9c,0x00000c50,
+0x000000e7,0x0004003d,0x00000006,0x00000c9d,
+0x00000c9c,0x00050051,0x00000006,0x00000c9e,
+0x00000c9b,0x00000000,0x00050051,0x00000006,
+0x00000c9f,0x00000c9b,0x00000001,0x00060050,
+0x00000007,0x00000ca0,0x00000c9e,0x00000c9f,
+0x00000c9d,0x0003003e,0x00000ca1,0x00000ca0,
+0x00050039,0x00000007,0x00000ca2,0x0000000b,
+0x00000ca1,0x0004003d,0x0000000d,0x00000ca3,
+0x00000c77,0x00060041,0x00000555,0x00000ca4,
+0x00000554,0x00000109,0x000000c9,0x0004003d,
+0x0000000d,0x00000ca5,0x00000ca4,0x00050084,
+0x0000000d,0x00000ca6,0x00000ca3,0x00000ca5,
+0x0004003d,0x0000000d,0x00000ca7,0x00000c80,
+0x00050080,0x0000000d,0x00000ca8,0x00000ca6,
+0x00000ca7,0x00050041,0x00000016,0x00000ca9,
+0x00000c74,0x00000ca8,0x0004003d,0x00000015,
+0x00000caa,0x00000ca9,0x00040063,0x00000c8d,
+0x00000ca2,0x00000caa,0x000200f9,0x00000c84,
+0x000200f8,0x00000c84,0x0004003d,0x0000000d,
+0x00000cab,0x00000c80,0x00050080,0x0000000d,
+0x00000cac,0x00000cab,0x0000008e,0x0003003e,
+0x00000c80,0x00000cac,0x000200f9,0x00000c81,
+0x000200f8,0x00000c83,0x000200f9,0x00000c7b,
+0x000200f8,0x00000c7b,0x0004003d,0x0000000d,
+0x00000cad,0x00000c77,0x00050080,0x0000000d,
+0x00000cae,0x00000cad,0x0000008e,0x0003003e,
+0x00000c77,0x00000cae,0x000200f9,0x00000c78,
+0x000200f8,0x00000c7a,0x000100fd,0x00010038,
+0x00050036,0x00000007,0x0000000b,0x00000000,
+0x00000009,0x00030037,0x00000008,0x0000000a,
+0x000200f8,0x0000000c,0x0004003d,0x00000007,
+0x0000007c,0x0000000a,0x000200fe,0x0000007c,
+0x00010038,0x00050036,0x0000000d,0x00000013,
+0x00000000,0x00000010,0x00030037,0x0000000e,
+0x00000011,0x00030037,0x0000000f,0x00000012,
+0x000200f8,0x00000014,0x0004003d,0x0000000d,
+0x0000007f,0x00000011,0x0004003d,0x00000006,
+0x00000080,0x00000012,0x000500c2,0x0000000d,
+0x00000081,0x0000007f,0x00000080,0x000500c7,
+0x0000000d,0x00000083,0x00000081,0x00000082,
+0x000200fe,0x00000083,0x00010038,0x00050036,
+0x0000000d,0x0000001b,0x00000000,0x00000017,
+0x00030037,0x00000016,0x00000018,0x00030037,
+0x0000000e,0x00000019,0x00030037,0x0000000e,
+0x0000001a,0x000200f8,0x0000001c,0x0004003b,
+0x0000000e,0x00000086,0x00000007,0x0004003b,
+0x0000000e,0x0000008a,0x00000007,0x0004003b,
+0x0000000e,0x0000008d,0x00000007,0x0004003b,
+0x0000000e,0x000000a7,0x00000007,0x0004003b,
+0x0000000e,0x000000aa,0x00000007,0x0004003d,
+0x0000000d,0x00000087,0x00000019,0x00050086,
+0x0000000d,0x00000089,0x00000087,0x00000088,
+0x0003003e,0x00000086,0x00000089,0x0004003d,
+0x0000000d,0x0000008b,0x00000019,0x00050089,
+0x0000000d,0x0000008c,0x0000008b,0x00000088,
+0x0003003e,0x0000008a,0x0000008c,0x0004003d,
+0x0000000d,0x0000008f,0x0000001a,0x000500c4,
+0x00000006,0x00000090,0x0000008e,0x0000008f,
+0x00050082,0x00000006,0x00000091,0x00000090,
+0x0000008e,0x0004007c,0x0000000d,0x00000092,
+0x00000091,0x0003003e,0x0000008d,0x00000092,
+0x0004003d,0x0000000d,0x00000093,0x00000086,
+0x0004003d,0x0000000d,0x00000094,0x00000019,
+0x0004003d,0x0000000d,0x00000095,0x0000001a,
+0x00050080,0x0000000d,0x00000096,0x00000094,
+0x00000095,0x00050082,0x0000000d,0x00000097,
+0x00000096,0x00000082,0x00050086,0x0000000d,
+0x00000098,0x00000097,0x00000088,0x000500aa,
+0x00000099,0x0000009a,0x00000093,0x00000098,
+0x000300f7,0x0000009c,0x00000000,0x000400fa,
+0x0000009a,0x0000009b,0x000000a6,0x000200f8,
+0x0000009b,0x0004003d,0x0000000d,0x0000009d,
+0x00000086,0x00050082,0x0000000d,0x0000009e,
+0x0000003c,0x0000009d,0x00050041,0x0000000e,
+0x0000009f,0x00000018,0x0000009e,0x0004003d,
+0x0000000d,0x000000a0,0x0000009f,0x0004003d,
+0x0000000d,0x000000a1,0x0000008a,0x000500c2,
+0x0000000d,0x000000a2,0x000000a0,0x000000a1,
+0x0004003d,0x0000000d,0x000000a3,0x0000008d,
+0x000500c7,0x0000000d,0x000000a4,0x000000a2,
+0x000000a3,0x000200fe,0x000000a4,0x000200f8,
+0x000000a6,0x0004003d,0x0000000d,0x000000a8,
+0x0000008a,0x00050082,0x0000000d,0x000000a9,
+0x00000088,0x000000a8,0x0003003e,0x000000a7,
+0x000000a9,0x0004003d,0x0000000d,0x000000ab,
+0x00000086,0x00050082,0x0000000d,0x000000ac,
+0x0000003c,0x000000ab,0x00050082,0x0000000d,
+0x000000ad,0x000000ac,0x00000082,0x00050041,
+0x0000000e,0x000000ae,0x00000018,0x000000ad,
+0x0004003d,0x0000000d,0x000000af,0x000000ae,
+0x0004003d,0x0000000d,0x000000b0,0x000000a7,
+0x000500c4,0x0000000d,0x000000b1,0x000000af,
+0x000000b0,0x0003003e,0x000000aa,0x000000b1,
+0x0004003d,0x0000000d,0x000000b2,0x00000086,
+0x00050082,0x0000000d,0x000000b3,0x0000003c,
+0x000000b2,0x00050041,0x0000000e,0x000000b4,
+0x00000018,0x000000b3,0x0004003d,0x0000000d,
+0x000000b5,0x000000b4,0x0004003d,0x0000000d,
+0x000000b6,0x0000008a,0x000500c2,0x0000000d,
+0x000000b7,0x000000b5,0x000000b6,0x0004003d,
+0x0000000d,0x000000b8,0x000000a7,0x000500c4,
+0x00000006,0x000000b9,0x0000008e,0x000000b8,
+0x00050082,0x00000006,0x000000ba,0x000000b9,
+0x0000008e,0x0004007c,0x0000000d,0x000000bb,
+0x000000ba,0x000500c7,0x0000000d,0x000000bc,
+0x000000b7,0x000000bb,0x0004003d,0x0000000d,
+0x000000bd,0x000000aa,0x000500c5,0x0000000d,
+0x000000be,0x000000bd,0x000000bc,0x0003003e,
+0x000000aa,0x000000be,0x0004003d,0x0000000d,
+0x000000bf,0x000000aa,0x0004003d,0x0000000d,
+0x000000c0,0x0000008d,0x000500c7,0x0000000d,
+0x000000c1,0x000000bf,0x000000c0,0x000200fe,
+0x000000c1,0x000200f8,0x0000009c,0x000100ff,
+0x00010038,0x00050036,0x0000000d,0x00000022,
+0x00000000,0x0000001d,0x00030037,0x00000016,
+0x0000001e,0x00030037,0x0000000e,0x0000001f,
+0x00030037,0x0000000e,0x00000020,0x00030037,
+0x0000000e,0x00000021,0x000200f8,0x00000023,
+0x0004003b,0x00000016,0x000000d0,0x00000007,
+0x0004003b,0x0000000e,0x000000d2,0x00000007,
+0x0004003b,0x0000000e,0x000000d4,0x00000007,
+0x0004003d,0x0000000d,0x000000c4,0x00000020,
+0x0004003d,0x0000000d,0x000000c5,0x0000001f,
+0x000500b2,0x00000099,0x000000c6,0x000000c4,
+0x000000c5,0x000300f7,0x000000c8,0x00000000,
+0x000400fa,0x000000c6,0x000000c7,0x000000c8,
+0x000200f8,0x000000c7,0x000200fe,0x000000c9,
+0x000200f8,0x000000c8,0x0004003d,0x0000000d,
+0x000000cb,0x00000020,0x0004003d,0x0000000d,
+0x000000cc,0x0000001f,0x00050082,0x0000000d,
+0x000000cd,0x000000cb,0x000000cc,0x0004003d,
+0x0000000d,0x000000ce,0x00000021,0x0007000c,
+0x0000000d,0x000000cf,0x00000001,0x00000026,
+0x000000cd,0x000000ce,0x0004003d,0x00000015,
+0x000000d1,0x0000001e,0x0003003e,0x000000d0,
+0x000000d1,0x0004003d,0x0000000d,0x000000d3,
+0x0000001f,0x0003003e,0x000000d2,0x000000d3,
+0x0003003e,0x000000d4,0x000000cf,0x00070039,
+0x0000000d,0x000000d5,0x0000001b,0x000000d0,
+0x000000d2,0x000000d4,0x000200fe,0x000000d5,
+0x00010038,0x00050036,0x0000000d,0x00000029,
+0x00000000,0x00000024,0x00030037,0x0000000e,
+0x00000025,0x00030037,0x0000000e,0x00000026,
+0x00030037,0x0000000e,0x00000027,0x00030037,
+0x0000000e,0x00000028,0x000200f8,0x0000002a,
+0x0004003b,0x0000000e,0x000000d8,0x00000007,
+0x0004003b,0x0000000e,0x000000e1,0x00000007,
+0x0004003b,0x0000000e,0x000000ea,0x00000007,
+0x0004003d,0x0000000d,0x000000d9,0x00000025,
+0x00050084,0x0000000d,0x000000db,0x000000d9,
+0x000000da,0x0004003d,0x0000000d,0x000000dc,
+0x00000026,0x00050084,0x0000000d,0x000000dd,
+0x000000db,0x000000dc,0x00050080,0x0000000d,
+0x000000df,0x000000dd,0x000000de,0x00050086,
+0x0000000d,0x000000e0,0x000000df,0x00000033,
+0x0003003e,0x000000d8,0x000000e0,0x0004003d,
+0x0000000d,0x000000e2,0x00000025,0x00050084,
+0x0000000d,0x000000e4,0x000000e2,0x000000e3,
+0x0004003d,0x0000000d,0x000000e5,0x00000027,
+0x00050084,0x0000000d,0x000000e6,0x000000e4,
+0x000000e5,0x00050080,0x0000000d,0x000000e8,
+0x000000e6,0x000000e7,0x00050086,0x0000000d,
+0x000000e9,0x000000e8,0x0000003c,0x0003003e,
+0x000000e1,0x000000e9,0x0004003d,0x0000000d,
+0x000000eb,0x00000025,0x0004003d,0x0000000d,
+0x000000ec,0x00000028,0x00050084,0x0000000d,
+0x000000ed,0x000000eb,0x000000ec,0x0003003e,
+0x000000ea,0x000000ed,0x0004003d,0x0000000d,
+0x000000ee,0x000000d8,0x0004003d,0x0000000d,
+0x000000ef,0x000000e1,0x00050080,0x0000000d,
+0x000000f0,0x000000ee,0x000000ef,0x0004003d,
+0x0000000d,0x000000f1,0x000000ea,0x00050080,
+0x0000000d,0x000000f2,0x000000f0,0x000000f1,
+0x000200fe,0x000000f2,0x00010038,0x00050036,
+0x00000002,0x00000031,0x00000000,0x0000002b,
+0x00030037,0x0000000e,0x0000002c,0x00030037,
+0x0000000e,0x0000002d,0x00030037,0x0000000e,
+0x0000002e,0x00030037,0x0000000e,0x0000002f,
+0x00030037,0x0000000e,0x00000030,0x000200f8,
+0x00000032,0x0004003d,0x0000000d,0x000000f5,
+0x0000002c,0x000500aa,0x00000099,0x000000f6,
+0x000000f5,0x00000082,0x000300f7,0x000000f8,
+0x00000000,0x000400fa,0x000000f6,0x000000f7,
+0x000000fc,0x000200f8,0x000000f7,0x0003003e,
+0x0000002f,0x00000033,0x0004003d,0x0000000d,
+0x000000f9,0x0000002e,0x00050084,0x0000000d,
+0x000000fa,0x00000033,0x000000f9,0x00050080,
+0x0000000d,0x000000fb,0x000000da,0x000000fa,
+0x0003003e,0x00000030,0x000000fb,0x000200f9,
+0x000000f8,0x000200f8,0x000000fc,0x0004003d,
+0x0000000d,0x000000fd,0x0000002d,0x000500aa,
+0x00000099,0x000000fe,0x000000fd,0x00000082,
+0x000300f7,0x00000100,0x00000000,0x000400fa,
+0x000000fe,0x000000ff,0x00000104,0x000200f8,
+0x000000ff,0x0003003e,0x0000002f,0x0000003c,
+0x0004003d,0x0000000d,0x00000101,0x0000002e,
+0x00050084,0x0000000d,0x00000102,0x0000003c,
+0x00000101,0x00050080,0x0000000d,0x00000103,
+0x000000e3,0x00000102,0x0003003e,0x00000030,
+0x00000103,0x000200f9,0x00000100,0x000200f8,
+0x00000104,0x0003003e,0x0000002f,0x00000082,
+0x0004003d,0x0000000d,0x00000105,0x0000002e,
+0x0003003e,0x00000030,0x00000105,0x000200f9,
+0x00000100,0x000200f8,0x00000100,0x000200f9,
+0x000000f8,0x000200f8,0x000000f8,0x000100fd,
+0x00010038,0x00050036,0x00000034,0x0000003a,
+0x00000000,0x00000035,0x00030037,0x00000016,
+0x00000036,0x00030037,0x0000000e,0x00000037,
+0x00030037,0x0000000e,0x00000038,0x00030037,
+0x0000000e,0x00000039,0x000200f8,0x0000003b,
+0x0004003b,0x0000000e,0x00000106,0x00000007,
+0x0004003b,0x0000000e,0x00000107,0x00000007,
+0x0004003b,0x0000000f,0x00000108,0x00000007,
+0x0004003b,0x00000112,0x00000113,0x00000007,
+0x0004003b,0x00000016,0x00000115,0x00000007,
+0x0004003b,0x0000000e,0x00000117,0x00000007,
+0x0004003b,0x0000000e,0x00000119,0x00000007,
+0x0004003b,0x0000000e,0x0000011b,0x00000007,
+0x0004003b,0x0000000e,0x00000122,0x00000007,
+0x0004003b,0x00000127,0x00000128,0x00000007,
+0x0004003b,0x00000016,0x0000012c,0x00000007,
+0x0004003b,0x0000000e,0x0000012e,0x00000007,
+0x0004003b,0x0000000e,0x00000130,0x00000007,
+0x0004003b,0x0000000e,0x00000132,0x00000007,
+0x0004003b,0x00000127,0x00000135,0x00000007,
+0x0004003b,0x00000127,0x00000141,0x00000007,
+0x0004003b,0x0000000f,0x00000149,0x00000007,
+0x0004003b,0x00000112,0x00000151,0x00000007,
+0x0004003b,0x0000024b,0x0000024c,0x00000007,
+0x0003003e,0x00000106,0x000000c9,0x0003003e,
+0x00000107,0x000000c9,0x0003003e,0x00000108,
+0x00000109,0x000200f9,0x0000010a,0x000200f8,
+0x0000010a,0x000400f6,0x0000010c,0x0000010d,
+0x00000000,0x000200f9,0x0000010e,0x000200f8,
+0x0000010e,0x0004003d,0x00000006,0x0000010f,
+0x00000108,0x000500b1,0x00000099,0x00000111,
+0x0000010f,0x00000110,0x000400fa,0x00000111,
+0x0000010b,0x0000010c,0x000200f8,0x0000010b,
+0x0004003d,0x00000006,0x00000114,0x00000108,
+0x0004003d,0x00000015,0x00000116,0x00000036,
+0x0003003e,0x00000115,0x00000116,0x0004003d,
+0x0000000d,0x00000118,0x00000037,0x0003003e,
+0x00000117,0x00000118,0x0004003d,0x0000000d,
+0x0000011a,0x00000038,0x0003003e,0x00000119,
+0x0000011a,0x0004003d,0x0000000d,0x0000011c,
+0x00000039,0x0003003e,0x0000011b,0x0000011c,
+0x00080039,0x0000000d,0x0000011d,0x00000022,
+0x00000115,0x00000117,0x00000119,0x0000011b,
+0x00050041,0x0000000e,0x0000011e,0x00000113,
+0x00000114,0x0003003e,0x0000011e,0x0000011d,
+0x0004003d,0x0000000d,0x0000011f,0x00000039,
+0x0004003d,0x0000000d,0x00000120,0x00000037,
+0x00050080,0x0000000d,0x00000121,0x00000120,
+0x0000011f,0x0003003e,0x00000037,0x00000121,
+0x0004003d,0x00000006,0x00000126,0x00000108,
+0x0003003e,0x00000128,0x00000125,0x00050041,
+0x0000000f,0x00000129,0x00000128,0x00000126,
+0x0004003d,0x00000006,0x0000012a,0x00000129,
+0x0004007c,0x0000000d,0x0000012b,0x0000012a,
+0x0004003d,0x00000015,0x0000012d,0x00000036,
+0x0003003e,0x0000012c,0x0000012d,0x0004003d,
+0x0000000d,0x0000012f,0x00000037,0x0003003e,
+0x0000012e,0x0000012f,0x0004003d,0x0000000d,
+0x00000131,0x00000038,0x0003003e,0x00000130,
+0x00000131,0x0003003e,0x00000132,0x0000012b,
+0x00080039,0x0000000d,0x00000133,0x00000022,
+0x0000012c,0x0000012e,0x00000130,0x00000132,
+0x0003003e,0x00000122,0x00000133,0x0004003d,
+0x00000006,0x00000134,0x00000108,0x0003003e,
+0x00000135,0x00000125,0x00050041,0x0000000f,
+0x00000136,0x00000135,0x00000134,0x0004003d,
+0x00000006,0x00000137,0x00000136,0x0004007c,
+0x0000000d,0x00000138,0x00000137,0x0004003d,
+0x0000000d,0x00000139,0x00000037,0x00050080,
+0x0000000d,0x0000013a,0x00000139,0x00000138,
+0x0003003e,0x00000037,0x0000013a,0x0004003d,
+0x0000000d,0x0000013b,0x00000122,0x0004003d,
+0x0000000d,0x0000013c,0x00000107,0x000500c4,
+0x0000000d,0x0000013d,0x0000013b,0x0000013c,
+0x0004003d,0x0000000d,0x0000013e,0x00000106,
+0x000500c5,0x0000000d,0x0000013f,0x0000013e,
+0x0000013d,0x0003003e,0x00000106,0x0000013f,
+0x0004003d,0x00000006,0x00000140,0x00000108,
+0x0003003e,0x00000141,0x00000125,0x00050041,
+0x0000000f,0x00000142,0x00000141,0x00000140,
+0x0004003d,0x00000006,0x00000143,0x00000142,
+0x0004007c,0x0000000d,0x00000144,0x00000143,
+0x0004003d,0x0000000d,0x00000145,0x00000107,
+0x00050080,0x0000000d,0x00000146,0x00000145,
+0x00000144,0x0003003e,0x00000107,0x00000146,
+0x000200f9,0x0000010d,0x000200f8,0x0000010d,
+0x0004003d,0x00000006,0x00000147,0x00000108,
+0x00050080,0x00000006,0x00000148,0x00000147,
+0x0000008e,0x0003003e,0x00000108,0x00000148,
+0x000200f9,0x0000010a,0x000200f8,0x0000010c,
+0x0003003e,0x00000149,0x00000109,0x000200f9,
+0x0000014a,0x000200f8,0x0000014a,0x000400f6,
+0x0000014c,0x0000014d,0x00000000,0x000200f9,
+0x0000014e,0x000200f8,0x0000014e,0x0004003d,
+0x00000006,0x0000014f,0x00000149,0x000500b1,
+0x00000099,0x00000150,0x0000014f,0x00000110,
+0x000400fa,0x00000150,0x0000014b,0x0000014c,
+0x000200f8,0x0000014b,0x0004003d,0x00000006,
+0x00000152,0x00000149,0x0004003d,0x0000000d,
+0x00000249,0x00000106,0x0004003d,0x00000006,
+0x0000024a,0x00000149,0x0003003e,0x0000024c,
+0x00000248,0x00060041,0x0000000e,0x0000024d,
+0x0000024c,0x00000249,0x0000024a,0x0004003d,
+0x0000000d,0x0000024e,0x0000024d,0x0004003d,
+0x0000000d,0x0000024f,0x00000039,0x000500c4,
+0x0000000d,0x00000250,0x0000024e,0x0000024f,
+0x0004003d,0x00000006,0x00000251,0x00000149,
+0x00050041,0x0000000e,0x00000252,0x00000113,
+0x00000251,0x0004003d,0x0000000d,0x00000253,
+0x00000252,0x000500c5,0x0000000d,0x00000254,
+0x00000250,0x00000253,0x00050041,0x0000000e,
+0x00000255,0x00000151,0x00000152,0x0003003e,
+0x00000255,0x00000254,0x000200f9,0x0000014d,
+0x000200f8,0x0000014d,0x0004003d,0x00000006,
+0x00000256,0x00000149,0x00050080,0x00000006,
+0x00000257,0x00000256,0x0000008e,0x0003003e,
+0x00000149,0x00000257,0x000200f9,0x0000014a,
+0x000200f8,0x0000014c,0x0004003d,0x00000034,
+0x00000258,0x00000151,0x000200fe,0x00000258,
+0x00010038,0x00050036,0x0000003d,0x00000043,
+0x00000000,0x0000003e,0x00030037,0x00000016,
+0x0000003f,0x00030037,0x0000000e,0x00000040,
+0x00030037,0x0000000e,0x00000041,0x00030037,
+0x0000000e,0x00000042,0x000200f8,0x00000044,
+0x0004003b,0x0000000e,0x0000025b,0x00000007,
+0x0004003b,0x0000000e,0x0000025c,0x00000007,
+0x0004003b,0x0000000e,0x0000025d,0x00000007,
+0x0004003b,0x0000000f,0x00000262,0x00000007,
+0x0004003b,0x0000026b,0x0000026c,0x00000007,
+0x0004003b,0x00000016,0x0000026e,0x00000007,
+0x0004003b,0x0000000e,0x00000270,0x00000007,
+0x0004003b,0x0000000e,0x00000272,0x00000007,
+0x0004003b,0x0000000e,0x00000274,0x00000007,
+0x0004003b,0x0000000e,0x0000027b,0x00000007,
+0x0004003b,0x0000027f,0x00000280,0x00000007,
+0x0004003b,0x00000016,0x00000284,0x00000007,
+0x0004003b,0x0000000e,0x00000286,0x00000007,
+0x0004003b,0x0000000e,0x00000288,0x00000007,
+0x0004003b,0x0000000e,0x0000028a,0x00000007,
+0x0004003b,0x0000027f,0x0000028d,0x00000007,
+0x0004003b,0x0000027f,0x00000299,0x00000007,
+0x0004003b,0x0000000f,0x000002a1,0x00000007,
+0x0004003b,0x0000026b,0x000002a9,0x00000007,
+0x0004003b,0x0000032d,0x0000032e,0x00000007,
+0x0003003e,0x0000025b,0x000000c9,0x0003003e,
+0x0000025c,0x000000c9,0x0004003d,0x0000000d,
+0x0000025e,0x00000042,0x000500c4,0x00000006,
+0x0000025f,0x0000008e,0x0000025e,0x00050082,
+0x00000006,0x00000260,0x0000025f,0x0000008e,
+0x0004007c,0x0000000d,0x00000261,0x00000260,
+0x0003003e,0x0000025d,0x00000261,0x0003003e,
+0x00000262,0x00000109,0x000200f9,0x00000263,
+0x000200f8,0x00000263,0x000400f6,0x00000265,
+0x00000266,0x00000000,0x000200f9,0x00000267,
+0x000200f8,0x00000267,0x0004003d,0x00000006,
+0x00000268,0x00000262,0x000500b1,0x00000099,
+0x0000026a,0x00000268,0x00000269,0x000400fa,
+0x0000026a,0x00000264,0x00000265,0x000200f8,
+0x00000264,0x0004003d,0x00000006,0x0000026d,
+0x00000262,0x0004003d,0x00000015,0x0000026f,
+0x0000003f,0x0003003e,0x0000026e,0x0000026f,
+0x0004003d,0x0000000d,0x00000271,0x00000040,
+0x0003003e,0x00000270,0x00000271,0x0004003d,
+0x0000000d,0x00000273,0x00000041,0x0003003e,
+0x00000272,0x00000273,0x0004003d,0x0000000d,
+0x00000275,0x00000042,0x0003003e,0x00000274,
+0x00000275,0x00080039,0x0000000d,0x00000276,
+0x00000022,0x0000026e,0x00000270,0x00000272,
+0x00000274,0x00050041,0x0000000e,0x00000277,
+0x0000026c,0x0000026d,0x0003003e,0x00000277,
+0x00000276,0x0004003d,0x0000000d,0x00000278,
+0x00000042,0x0004003d,0x0000000d,0x00000279,
+0x00000040,0x00050080,0x0000000d,0x0000027a,
+0x00000279,0x00000278,0x0003003e,0x00000040,
+0x0000027a,0x0004003d,0x00000006,0x0000027e,
+0x00000262,0x0003003e,0x00000280,0x0000027d,
+0x00050041,0x0000000f,0x00000281,0x00000280,
+0x0000027e,0x0004003d,0x00000006,0x00000282,
+0x00000281,0x0004007c,0x0000000d,0x00000283,
+0x00000282,0x0004003d,0x00000015,0x00000285,
+0x0000003f,0x0003003e,0x00000284,0x00000285,
+0x0004003d,0x0000000d,0x00000287,0x00000040,
+0x0003003e,0x00000286,0x00000287,0x0004003d,
+0x0000000d,0x00000289,0x00000041,0x0003003e,
+0x00000288,0x00000289,0x0003003e,0x0000028a,
+0x00000283,0x00080039,0x0000000d,0x0000028b,
+0x00000022,0x00000284,0x00000286,0x00000288,
+0x0000028a,0x0003003e,0x0000027b,0x0000028b,
+0x0004003d,0x00000006,0x0000028c,0x00000262,
+0x0003003e,0x0000028d,0x0000027d,0x00050041,
+0x0000000f,0x0000028e,0x0000028d,0x0000028c,
+0x0004003d,0x00000006,0x0000028f,0x0000028e,
+0x0004007c,0x0000000d,0x00000290,0x0000028f,
+0x0004003d,0x0000000d,0x00000291,0x00000040,
+0x00050080,0x0000000d,0x00000292,0x00000291,
+0x00000290,0x0003003e,0x00000040,0x00000292,
+0x0004003d,0x0000000d,0x00000293,0x0000027b,
+0x0004003d,0x0000000d,0x00000294,0x0000025c,
+0x000500c4,0x0000000d,0x00000295,0x00000293,
+0x00000294,0x0004003d,0x0000000d,0x00000296,
+0x0000025b,0x000500c5,0x0000000d,0x00000297,
+0x00000296,0x00000295,0x0003003e,0x0000025b,
+0x00000297,0x0004003d,0x00000006,0x00000298,
+0x00000262,0x0003003e,0x00000299,0x0000027d,
+0x00050041,0x0000000f,0x0000029a,0x00000299,
+0x00000298,0x0004003d,0x00000006,0x0000029b,
+0x0000029a,0x0004007c,0x0000000d,0x0000029c,
+0x0000029b,0x0004003d,0x0000000d,0x0000029d,
+0x0000025c,0x00050080,0x0000000d,0x0000029e,
+0x0000029d,0x0000029c,0x0003003e,0x0000025c,
+0x0000029e,0x000200f9,0x00000266,0x000200f8,
+0x00000266,0x0004003d,0x00000006,0x0000029f,
+0x00000262,0x00050080,0x00000006,0x000002a0,
+0x0000029f,0x0000008e,0x0003003e,0x00000262,
+0x000002a0,0x000200f9,0x00000263,0x000200f8,
+0x00000265,0x0003003e,0x000002a1,0x00000109,
+0x000200f9,0x000002a2,0x000200f8,0x000002a2,
+0x000400f6,0x000002a4,0x000002a5,0x00000000,
+0x000200f9,0x000002a6,0x000200f8,0x000002a6,
+0x0004003d,0x00000006,0x000002a7,0x000002a1,
+0x000500b1,0x00000099,0x000002a8,0x000002a7,
+0x00000269,0x000400fa,0x000002a8,0x000002a3,
+0x000002a4,0x000200f8,0x000002a3,0x0004003d,
+0x00000006,0x000002aa,0x000002a1,0x0004003d,
+0x0000000d,0x0000032b,0x0000025b,0x0004003d,
+0x00000006,0x0000032c,0x000002a1,0x0003003e,
+0x0000032e,0x0000032a,0x00060041,0x0000000e,
+0x0000032f,0x0000032e,0x0000032b,0x0000032c,
+0x0004003d,0x0000000d,0x00000330,0x0000032f,
+0x0004003d,0x0000000d,0x00000331,0x00000042,
+0x000500c4,0x0000000d,0x00000332,0x00000330,
+0x00000331,0x0004003d,0x00000006,0x00000333,
+0x000002a1,0x00050041,0x0000000e,0x00000334,
+0x0000026c,0x00000333,0x0004003d,0x0000000d,
+0x00000335,0x00000334,0x000500c5,0x0000000d,
+0x00000336,0x00000332,0x00000335,0x00050041,
+0x0000000e,0x00000337,0x000002a9,0x000002aa,
+0x0003003e,0x00000337,0x00000336,0x000200f9,
+0x000002a5,0x000200f8,0x000002a5,0x0004003d,
+0x00000006,0x00000338,0x000002a1,0x00050080,
+0x00000006,0x00000339,0x00000338,0x0000008e,
+0x0003003e,0x000002a1,0x00000339,0x000200f9,
+0x000002a2,0x000200f8,0x000002a4,0x0004003d,
+0x0000003d,0x0000033a,0x000002a9,0x000200fe,
+0x0000033a,0x00010038,0x00050036,0x0000000d,
+0x00000047,0x00000000,0x00000045,0x00030037,
+0x0000000e,0x00000046,0x000200f8,0x00000048,
+0x0004003d,0x0000000d,0x0000033d,0x00000046,
+0x00050086,0x0000000d,0x0000033e,0x0000033d,
+0x000000de,0x00050080,0x0000000d,0x0000033f,
+0x0000033e,0x00000082,0x00050084,0x0000000d,
+0x00000340,0x0000033f,0x000000e7,0x000200fe,
+0x00000340,0x00010038,0x00050036,0x00000002,
+0x0000004e,0x00000000,0x0000004b,0x00030037,
+0x0000004a,0x0000004c,0x00030037,0x0000004a,
+0x0000004d,0x000200f8,0x0000004f,0x0004003b,
+0x0000004a,0x00000343,0x00000007,0x0004003d,
+0x00000049,0x00000344,0x0000004c,0x0003003e,
+0x00000343,0x00000344,0x0004003d,0x00000049,
+0x00000345,0x0000004d,0x0003003e,0x0000004c,
+0x00000345,0x0004003d,0x00000049,0x00000346,
+0x00000343,0x0003003e,0x0000004d,0x00000346,
+0x000100fd,0x00010038,0x00050036,0x00000002,
+0x00000053,0x00000000,0x00000050,0x00030037,
+0x0000000f,0x00000051,0x00030037,0x0000000f,
+0x00000052,0x000200f8,0x00000054,0x0004003d,
+0x00000006,0x00000347,0x00000052,0x000500c3,
+0x00000006,0x00000348,0x00000347,0x0000008e,
+0x0003003e,0x00000052,0x00000348,0x0004003d,
+0x00000006,0x00000349,0x00000051,0x000500c7,
+0x00000006,0x0000034b,0x00000349,0x0000034a,
+0x0004003d,0x00000006,0x0000034c,0x00000052,
+0x000500c5,0x00000006,0x0000034d,0x0000034c,
+0x0000034b,0x0003003e,0x00000052,0x0000034d,
+0x0004003d,0x00000006,0x0000034e,0x00000051,
+0x000500c3,0x00000006,0x0000034f,0x0000034e,
+0x0000008e,0x0003003e,0x00000051,0x0000034f,
+0x0004003d,0x00000006,0x00000351,0x00000051,
+0x000500c7,0x00000006,0x00000352,0x00000351,
+0x00000350,0x0003003e,0x00000051,0x00000352,
+0x0004003d,0x00000006,0x00000353,0x00000051,
+0x000500c7,0x00000006,0x00000355,0x00000353,
+0x00000354,0x000500ab,0x00000099,0x00000356,
+0x00000355,0x00000109,0x000300f7,0x00000358,
+0x00000000,0x000400fa,0x00000356,0x00000357,
+0x00000358,0x000200f8,0x00000357,0x0004003d,
+0x00000006,0x0000035a,0x00000051,0x00050082,
+0x00000006,0x0000035b,0x0000035a,0x00000359,
+0x0003003e,0x00000051,0x0000035b,0x000200f9,
+0x00000358,0x000200f8,0x00000358,0x000100fd,
+0x00010038,0x00050036,0x00000002,0x00000057,
+0x00000000,0x00000055,0x00030037,0x0000004a,
+0x00000056,0x000200f8,0x00000058,0x00050041,
+0x0000000f,0x0000035c,0x00000056,0x000000c9,
+0x0004003d,0x00000006,0x0000035d,0x0000035c,
+0x00050041,0x0000000f,0x0000035e,0x00000056,
+0x000000e7,0x0004003d,0x00000006,0x0000035f,
+0x0000035e,0x00050080,0x00000006,0x00000360,
+0x0000035d,0x0000035f,0x00050087,0x00000006,
+0x00000361,0x00000360,0x00000124,0x00050041,
+0x0000000f,0x00000362,0x00000056,0x000000c9,
+0x0003003e,0x00000362,0x00000361,0x00050041,
+0x0000000f,0x00000363,0x00000056,0x00000082,
+0x0004003d,0x00000006,0x00000364,0x00000363,
+0x00050041,0x0000000f,0x00000365,0x00000056,
+0x000000e7,0x0004003d,0x00000006,0x00000366,
+0x00000365,0x00050080,0x00000006,0x00000367,
+0x00000364,0x00000366,0x00050087,0x00000006,
+0x00000368,0x00000367,0x00000124,0x00050041,
+0x0000000f,0x00000369,0x00000056,0x00000082,
+0x0003003e,0x00000369,0x00000368,0x000100fd,
+0x00010038,0x00050036,0x00000002,0x00000061,
+0x00000000,0x0000005b,0x00030037,0x0000005a,
+0x0000005c,0x00030037,0x0000000e,0x0000005d,
+0x00030037,0x0000000e,0x0000005e,0x00030037,
+0x00000016,0x0000005f,0x00030037,0x00000016,
+0x00000060,0x000200f8,0x00000062,0x0004003b,
+0x0000000f,0x0000036a,0x00000007,0x0004003b,
+0x0000036d,0x0000036e,0x00000007,0x0004003b,
+0x0000000f,0x00000372,0x00000007,0x0004003b,
+0x0000036d,0x00000375,0x00000007,0x0004003b,
+0x0000000f,0x00000379,0x00000007,0x0004003b,
+0x0000036d,0x0000037c,0x00000007,0x0004003b,
+0x0000000f,0x00000380,0x00000007,0x0004003b,
+0x0000036d,0x00000383,0x00000007,0x0004003b,
+0x0000000f,0x00000387,0x00000007,0x0004003b,
+0x0000036d,0x0000038a,0x00000007,0x0004003b,
+0x0000000f,0x0000038e,0x00000007,0x0004003b,
+0x0000036d,0x00000391,0x00000007,0x0004003b,
+0x0000000f,0x00000395,0x00000007,0x0004003b,
+0x0000036d,0x00000399,0x00000007,0x0004003b,
+0x0000000f,0x0000039d,0x00000007,0x0004003b,
+0x0000036d,0x000003a0,0x00000007,0x0004003b,
+0x0000004a,0x000003b1,0x00000007,0x0004003b,
+0x0000004a,0x000003b7,0x00000007,0x0004003b,
+0x0000000f,0x000003bd,0x00000007,0x0004003b,
+0x0000000f,0x000003c4,0x00000007,0x0004003b,
+0x0000000f,0x000003de,0x00000007,0x0004003b,
+0x0000000f,0x000003e0,0x00000007,0x0004003b,
+0x0000000f,0x000003e5,0x00000007,0x0004003b,
+0x0000000f,0x000003e7,0x00000007,0x0004003b,
+0x0000000f,0x000003f4,0x00000007,0x0004003b,
+0x0000000f,0x00000407,0x00000007,0x0004003b,
+0x0000000f,0x0000040f,0x00000007,0x0004003b,
+0x0000000f,0x0000041e,0x00000007,0x0004003b,
+0x0000000f,0x00000424,0x00000007,0x0004003b,
+0x0000004a,0x00000437,0x00000007,0x0004003b,
+0x0000004a,0x00000439,0x00000007,0x0004003b,
+0x0000004a,0x0000043e,0x00000007,0x0004003b,
+0x0000004a,0x00000442,0x00000007,0x0004003b,
+0x0000000f,0x00000447,0x00000007,0x0004003b,
+0x0000000f,0x00000449,0x00000007,0x0004003b,
+0x0000000f,0x0000044e,0x00000007,0x0004003b,
+0x0000000f,0x00000450,0x00000007,0x0004003b,
+0x0000000f,0x00000455,0x00000007,0x0004003b,
+0x0000000f,0x00000457,0x00000007,0x0004003b,
+0x0000004a,0x00000472,0x00000007,0x0004003b,
+0x0000004a,0x00000474,0x00000007,0x0004003b,
+0x0000004a,0x00000479,0x00000007,0x0004003b,
+0x0000004a,0x0000047d,0x00000007,0x0004003b,
+0x0000000e,0x00000499,0x00000007,0x0004003b,
+0x0000000e,0x000004a0,0x00000007,0x0004003b,
+0x0000004a,0x000004b6,0x00000007,0x0004003b,
+0x0000004a,0x000004b8,0x00000007,0x0004003b,
+0x0000004a,0x000004bd,0x00000007,0x0004003b,
+0x0000004a,0x000004c1,0x00000007,0x0004003b,
+0x0000000f,0x000004c6,0x00000007,0x0004003b,
+0x0000000f,0x000004c8,0x00000007,0x0004003b,
+0x0000000f,0x000004cd,0x00000007,0x0004003b,
+0x0000000f,0x000004cf,0x00000007,0x0004003b,
+0x0000000f,0x000004d4,0x00000007,0x0004003b,
+0x0000000f,0x000004d6,0x00000007,0x0004003b,
+0x0000000f,0x000004db,0x00000007,0x0004003b,
+0x0000000f,0x000004dd,0x00000007,0x0004003b,
+0x0000004a,0x000004fc,0x00000007,0x0004003b,
+0x0000004a,0x000004fe,0x00000007,0x0004003b,
+0x0000004a,0x00000503,0x00000007,0x0004003b,
+0x0000004a,0x00000507,0x00000007,0x0004003d,
+0x0000000d,0x0000036b,0x0000005d,0x00050080,
+0x0000000d,0x0000036c,0x0000036b,0x000000c9,
+0x0003003e,0x0000036e,0x0000005c,0x00050041,
+0x0000000e,0x0000036f,0x0000036e,0x0000036c,
+0x0004003d,0x0000000d,0x00000370,0x0000036f,
+0x0004007c,0x00000006,0x00000371,0x00000370,
+0x0003003e,0x0000036a,0x00000371,0x0004003d,
+0x0000000d,0x00000373,0x0000005d,0x00050080,
+0x0000000d,0x00000374,0x00000373,0x00000082,
+0x0003003e,0x00000375,0x0000005c,0x00050041,
+0x0000000e,0x00000376,0x00000375,0x00000374,
+0x0004003d,0x0000000d,0x00000377,0x00000376,
+0x0004007c,0x00000006,0x00000378,0x00000377,
+0x0003003e,0x00000372,0x00000378,0x0004003d,
+0x0000000d,0x0000037a,0x0000005d,0x00050080,
+0x0000000d,0x0000037b,0x0000037a,0x000000e7,
+0x0003003e,0x0000037c,0x0000005c,0x00050041,
+0x0000000e,0x0000037d,0x0000037c,0x0000037b,
+0x0004003d,0x0000000d,0x0000037e,0x0000037d,
+0x0004007c,0x00000006,0x0000037f,0x0000037e,
+0x0003003e,0x00000379,0x0000037f,0x0004003d,
+0x0000000d,0x00000381,0x0000005d,0x00050080,
+0x0000000d,0x00000382,0x00000381,0x0000003c,
+0x0003003e,0x00000383,0x0000005c,0x00050041,
+0x0000000e,0x00000384,0x00000383,0x00000382,
+0x0004003d,0x0000000d,0x00000385,0x00000384,
+0x0004007c,0x00000006,0x00000386,0x00000385,
+0x0003003e,0x00000380,0x00000386,0x0004003d,
+0x0000000d,0x00000388,0x0000005d,0x00050080,
+0x0000000d,0x00000389,0x00000388,0x000000de,
+0x0003003e,0x0000038a,0x0000005c,0x00050041,
+0x0000000e,0x0000038b,0x0000038a,0x00000389,
+0x0004003d,0x0000000d,0x0000038c,0x0000038b,
+0x0004007c,0x00000006,0x0000038d,0x0000038c,
+0x0003003e,0x00000387,0x0000038d,0x0004003d,
+0x0000000d,0x0000038f,0x0000005d,0x00050080,
+0x0000000d,0x00000390,0x0000038f,0x00000033,
+0x0003003e,0x00000391,0x0000005c,0x00050041,
+0x0000000e,0x00000392,0x00000391,0x00000390,
+0x0004003d,0x0000000d,0x00000393,0x00000392,
+0x0004007c,0x00000006,0x00000394,0x00000393,
+0x0003003e,0x0000038e,0x00000394,0x0004003d,
+0x0000000d,0x00000396,0x0000005d,0x00050080,
+0x0000000d,0x00000398,0x00000396,0x00000397,
+0x0003003e,0x00000399,0x0000005c,0x00050041,
+0x0000000e,0x0000039a,0x00000399,0x00000398,
+0x0004003d,0x0000000d,0x0000039b,0x0000039a,
+0x0004007c,0x00000006,0x0000039c,0x0000039b,
+0x0003003e,0x00000395,0x0000039c,0x0004003d,
+0x0000000d,0x0000039e,0x0000005d,0x00050080,
+0x0000000d,0x0000039f,0x0000039e,0x000000e3,
+0x0003003e,0x000003a0,0x0000005c,0x00050041,
+0x0000000e,0x000003a1,0x000003a0,0x0000039f,
+0x0004003d,0x0000000d,0x000003a2,0x000003a1,
+0x0004007c,0x00000006,0x000003a3,0x000003a2,
+0x0003003e,0x0000039d,0x000003a3,0x0004003d,
+0x0000000d,0x000003a4,0x0000005e,0x000300f7,
+0x000003b0,0x00000000,0x001700fb,0x000003a4,
+0x000003af,0x00000000,0x000003a5,0x00000001,
+0x000003a6,0x00000004,0x000003a7,0x00000005,
+0x000003a8,0x00000006,0x000003a9,0x00000008,
+0x000003aa,0x00000009,0x000003ab,0x0000000a,
+0x000003ac,0x0000000c,0x000003ad,0x0000000d,
+0x000003ae,0x000200f8,0x000003af,0x0003003e,
+0x000003b1,0x00000514,0x0003003e,0x000003b7,
+0x00000514,0x000200f9,0x000003b0,0x000200f8,
+0x000003a5,0x0004003d,0x00000006,0x000003b2,
+0x0000036a,0x0004003d,0x00000006,0x000003b3,
+0x0000036a,0x0004003d,0x00000006,0x000003b4,
+0x0000036a,0x00070050,0x00000049,0x000003b6,
+0x000003b2,0x000003b3,0x000003b4,0x000003b5,
+0x0003003e,0x000003b1,0x000003b6,0x0004003d,
+0x00000006,0x000003b8,0x00000372,0x0004003d,
+0x00000006,0x000003b9,0x00000372,0x0004003d,
+0x00000006,0x000003ba,0x00000372,0x00070050,
+0x00000049,0x000003bb,0x000003b8,0x000003b9,
+0x000003ba,0x000003b5,0x0003003e,0x000003b7,
+0x000003bb,0x000200f9,0x000003b0,0x000200f8,
+0x000003a6,0x0004003d,0x00000006,0x000003be,
+0x0000036a,0x000500c3,0x00000006,0x000003bf,
+0x000003be,0x00000124,0x0004003d,0x00000006,
+0x000003c0,0x00000372,0x000500c7,0x00000006,
+0x000003c2,0x000003c0,0x000003c1,0x000500c5,
+0x00000006,0x000003c3,0x000003bf,0x000003c2,
+0x0003003e,0x000003bd,0x000003c3,0x0004003d,
+0x00000006,0x000003c5,0x000003bd,0x0004003d,
+0x00000006,0x000003c6,0x00000372,0x000500c7,
+0x00000006,0x000003c7,0x000003c6,0x00000350,
+0x00050080,0x00000006,0x000003c8,0x000003c5,
+0x000003c7,0x0007000c,0x00000006,0x000003c9,
+0x00000001,0x00000027,0x000003c8,0x000003b5,
+0x0003003e,0x000003c4,0x000003c9,0x0004003d,
+0x00000006,0x000003ca,0x000003bd,0x0004003d,
+0x00000006,0x000003cb,0x000003bd,0x0004003d,
+0x00000006,0x000003cc,0x000003bd,0x00070050,
+0x00000049,0x000003cd,0x000003ca,0x000003cb,
+0x000003cc,0x000003b5,0x0003003e,0x000003b1,
+0x000003cd,0x0004003d,0x00000006,0x000003ce,
+0x000003c4,0x0004003d,0x00000006,0x000003cf,
+0x000003c4,0x0004003d,0x00000006,0x000003d0,
+0x000003c4,0x00070050,0x00000049,0x000003d1,
+0x000003ce,0x000003cf,0x000003d0,0x000003b5,
+0x0003003e,0x000003b7,0x000003d1,0x000200f9,
+0x000003b0,0x000200f8,0x000003a7,0x0004003d,
+0x00000006,0x000003d3,0x0000036a,0x0004003d,
+0x00000006,0x000003d4,0x0000036a,0x0004003d,
+0x00000006,0x000003d5,0x0000036a,0x0004003d,
+0x00000006,0x000003d6,0x00000379,0x00070050,
+0x00000049,0x000003d7,0x000003d3,0x000003d4,
+0x000003d5,0x000003d6,0x0003003e,0x000003b1,
+0x000003d7,0x0004003d,0x00000006,0x000003d8,
+0x00000372,0x0004003d,0x00000006,0x000003d9,
+0x00000372,0x0004003d,0x00000006,0x000003da,
+0x00000372,0x0004003d,0x00000006,0x000003db,
+0x00000380,0x00070050,0x00000049,0x000003dc,
+0x000003d8,0x000003d9,0x000003da,0x000003db,
+0x0003003e,0x000003b7,0x000003dc,0x000200f9,
+0x000003b0,0x000200f8,0x000003a8,0x0004003d,
+0x00000006,0x000003df,0x00000372,0x0003003e,
+0x000003de,0x000003df,0x0004003d,0x00000006,
+0x000003e1,0x0000036a,0x0003003e,0x000003e0,
+0x000003e1,0x00060039,0x00000002,0x000003e2,
+0x00000053,0x000003de,0x000003e0,0x0004003d,
+0x00000006,0x000003e3,0x000003de,0x0003003e,
+0x00000372,0x000003e3,0x0004003d,0x00000006,
+0x000003e4,0x000003e0,0x0003003e,0x0000036a,
+0x000003e4,0x0004003d,0x00000006,0x000003e6,
+0x00000380,0x0003003e,0x000003e5,0x000003e6,
+0x0004003d,0x00000006,0x000003e8,0x00000379,
+0x0003003e,0x000003e7,0x000003e8,0x00060039,
+0x00000002,0x000003e9,0x00000053,0x000003e5,
+0x000003e7,0x0004003d,0x00000006,0x000003ea,
+0x000003e5,0x0003003e,0x00000380,0x000003ea,
+0x0004003d,0x00000006,0x000003eb,0x000003e7,
+0x0003003e,0x00000379,0x000003eb,0x0004003d,
+0x00000006,0x000003ec,0x0000036a,0x0004003d,
+0x00000006,0x000003ed,0x0000036a,0x0004003d,
+0x00000006,0x000003ee,0x0000036a,0x0004003d,
+0x00000006,0x000003ef,0x00000379,0x00070050,
+0x00000049,0x000003f0,0x000003ec,0x000003ed,
+0x000003ee,0x000003ef,0x00070050,0x00000049,
+0x000003f1,0x00000109,0x00000109,0x00000109,
+0x00000109,0x00070050,0x00000049,0x000003f2,
+0x000003b5,0x000003b5,0x000003b5,0x000003b5,
+0x0008000c,0x00000049,0x000003f3,0x00000001,
+0x0000002d,0x000003f0,0x000003f1,0x000003f2,
+0x0003003e,0x000003b1,0x000003f3,0x0004003d,
+0x00000006,0x000003f5,0x0000036a,0x0004003d,
+0x00000006,0x000003f6,0x00000372,0x00050080,
+0x00000006,0x000003f7,0x000003f5,0x000003f6,
+0x0003003e,0x000003f4,0x000003f7,0x0004003d,
+0x00000006,0x000003f8,0x000003f4,0x0004003d,
+0x00000006,0x000003f9,0x000003f4,0x0004003d,
+0x00000006,0x000003fa,0x000003f4,0x0004003d,
+0x00000006,0x000003fb,0x00000379,0x0004003d,
+0x00000006,0x000003fc,0x00000380,0x00050080,
+0x00000006,0x000003fd,0x000003fb,0x000003fc,
+0x00070050,0x00000049,0x000003fe,0x000003f8,
+0x000003f9,0x000003fa,0x000003fd,0x00070050,
+0x00000049,0x000003ff,0x00000109,0x00000109,
+0x00000109,0x00000109,0x00070050,0x00000049,
+0x00000400,0x000003b5,0x000003b5,0x000003b5,
+0x000003b5,0x0008000c,0x00000049,0x00000401,
+0x00000001,0x0000002d,0x000003fe,0x000003ff,
+0x00000400,0x0003003e,0x000003b7,0x00000401,
+0x000200f9,0x000003b0,0x000200f8,0x000003a9,
+0x0004003d,0x00000006,0x00000403,0x0000036a,
+0x0004003d,0x00000006,0x00000404,0x00000372,
+0x0004003d,0x00000006,0x00000405,0x00000379,
+0x00070050,0x00000049,0x00000406,0x00000403,
+0x00000404,0x00000405,0x000003b5,0x0003003e,
+0x000003b7,0x00000406,0x0003003e,0x00000407,
+0x00000109,0x000200f9,0x00000408,0x000200f8,
+0x00000408,0x000400f6,0x0000040a,0x0000040b,
+0x00000000,0x000200f9,0x0000040c,0x000200f8,
+0x0000040c,0x0004003d,0x00000006,0x0000040d,
+0x00000407,0x000500b1,0x00000099,0x0000040e,
+0x0000040d,0x00000269,0x000400fa,0x0000040e,
+0x00000409,0x0000040a,0x000200f8,0x00000409,
+0x0004003d,0x00000006,0x00000410,0x00000407,
+0x00050041,0x0000000f,0x00000411,0x000003b7,
+0x00000410,0x0004003d,0x00000006,0x00000412,
+0x00000411,0x0003003e,0x0000040f,0x00000412,
+0x0004003d,0x00000006,0x00000413,0x00000407,
+0x0004003d,0x00000006,0x00000414,0x0000040f,
+0x0004003d,0x00000006,0x00000415,0x00000380,
+0x00050084,0x00000006,0x00000416,0x00000414,
+0x00000415,0x000500c3,0x00000006,0x00000418,
+0x00000416,0x00000417,0x00050041,0x0000000f,
+0x00000419,0x000003b1,0x00000413,0x0003003e,
+0x00000419,0x00000418,0x000200f9,0x0000040b,
+0x000200f8,0x0000040b,0x0004003d,0x00000006,
+0x0000041a,0x00000407,0x00050080,0x00000006,
+0x0000041b,0x0000041a,0x0000008e,0x0003003e,
+0x00000407,0x0000041b,0x000200f9,0x00000408,
+0x000200f8,0x0000040a,0x00050041,0x0000000f,
+0x0000041c,0x000003b1,0x0000003c,0x0003003e,
+0x0000041c,0x000003b5,0x000200f9,0x000003b0,
+0x000200f8,0x000003aa,0x0004003d,0x00000006,
+0x0000041f,0x0000036a,0x0004003d,0x00000006,
+0x00000420,0x00000379,0x00050080,0x00000006,
+0x00000421,0x0000041f,0x00000420,0x0004003d,
+0x00000006,0x00000422,0x00000387,0x00050080,
+0x00000006,0x00000423,0x00000421,0x00000422,
+0x0003003e,0x0000041e,0x00000423,0x0004003d,
+0x00000006,0x00000425,0x00000372,0x0004003d,
+0x00000006,0x00000426,0x00000380,0x00050080,
+0x00000006,0x00000427,0x00000425,0x00000426,
+0x0004003d,0x00000006,0x00000428,0x0000038e,
+0x00050080,0x00000006,0x00000429,0x00000427,
+0x00000428,0x0003003e,0x00000424,0x00000429,
+0x0004003d,0x00000006,0x0000042a,0x0000036a,
+0x0004003d,0x00000006,0x0000042b,0x00000379,
+0x0004003d,0x00000006,0x0000042c,0x00000387,
+0x00070050,0x00000049,0x0000042d,0x0000042a,
+0x0000042b,0x0000042c,0x000003b5,0x0003003e,
+0x000003b1,0x0000042d,0x0004003d,0x00000006,
+0x0000042e,0x00000372,0x0004003d,0x00000006,
+0x0000042f,0x00000380,0x0004003d,0x00000006,
+0x00000430,0x0000038e,0x00070050,0x00000049,
+0x00000431,0x0000042e,0x0000042f,0x00000430,
+0x000003b5,0x0003003e,0x000003b7,0x00000431,
+0x0004003d,0x00000006,0x00000432,0x00000424,
+0x0004003d,0x00000006,0x00000433,0x0000041e,
+0x000500b1,0x00000099,0x00000434,0x00000432,
+0x00000433,0x000300f7,0x00000436,0x00000000,
+0x000400fa,0x00000434,0x00000435,0x00000436,
+0x000200f8,0x00000435,0x0004003d,0x00000049,
+0x00000438,0x000003b1,0x0003003e,0x00000437,
+0x00000438,0x0004003d,0x00000049,0x0000043a,
+0x000003b7,0x0003003e,0x00000439,0x0000043a,
+0x00060039,0x00000002,0x0000043b,0x0000004e,
+0x00000437,0x00000439,0x0004003d,0x00000049,
+0x0000043c,0x00000437,0x0003003e,0x000003b1,
+0x0000043c,0x0004003d,0x00000049,0x0000043d,
+0x00000439,0x0003003e,0x000003b7,0x0000043d,
+0x0004003d,0x00000049,0x0000043f,0x000003b1,
+0x0003003e,0x0000043e,0x0000043f,0x00050039,
+0x00000002,0x00000440,0x00000057,0x0000043e,
+0x0004003d,0x00000049,0x00000441,0x0000043e,
+0x0003003e,0x000003b1,0x00000441,0x0004003d,
+0x00000049,0x00000443,0x000003b7,0x0003003e,
+0x00000442,0x00000443,0x00050039,0x00000002,
+0x00000444,0x00000057,0x00000442,0x0004003d,
+0x00000049,0x00000445,0x00000442,0x0003003e,
+0x000003b7,0x00000445,0x000200f9,0x00000436,
+0x000200f8,0x00000436,0x000200f9,0x000003b0,
+0x000200f8,0x000003ab,0x0004003d,0x00000006,
+0x00000448,0x00000372,0x0003003e,0x00000447,
+0x00000448,0x0004003d,0x00000006,0x0000044a,
+0x0000036a,0x0003003e,0x00000449,0x0000044a,
+0x00060039,0x00000002,0x0000044b,0x00000053,
+0x00000447,0x00000449,0x0004003d,0x00000006,
+0x0000044c,0x00000447,0x0003003e,0x00000372,
+0x0000044c,0x0004003d,0x00000006,0x0000044d,
+0x00000449,0x0003003e,0x0000036a,0x0000044d,
+0x0004003d,0x00000006,0x0000044f,0x00000380,
+0x0003003e,0x0000044e,0x0000044f,0x0004003d,
+0x00000006,0x00000451,0x00000379,0x0003003e,
+0x00000450,0x00000451,0x00060039,0x00000002,
+0x00000452,0x00000053,0x0000044e,0x00000450,
+0x0004003d,0x00000006,0x00000453,0x0000044e,
+0x0003003e,0x00000380,0x00000453,0x0004003d,
+0x00000006,0x00000454,0x00000450,0x0003003e,
+0x00000379,0x00000454,0x0004003d,0x00000006,
+0x00000456,0x0000038e,0x0003003e,0x00000455,
+0x00000456,0x0004003d,0x00000006,0x00000458,
+0x00000387,0x0003003e,0x00000457,0x00000458,
+0x00060039,0x00000002,0x00000459,0x00000053,
+0x00000455,0x00000457,0x0004003d,0x00000006,
+0x0000045a,0x00000455,0x0003003e,0x0000038e,
+0x0000045a,0x0004003d,0x00000006,0x0000045b,
+0x00000457,0x0003003e,0x00000387,0x0000045b,
+0x0004003d,0x00000006,0x0000045c,0x0000036a,
+0x0004003d,0x00000006,0x0000045d,0x00000379,
+0x0004003d,0x00000006,0x0000045e,0x00000387,
+0x00070050,0x00000049,0x0000045f,0x0000045c,
+0x0000045d,0x0000045e,0x000003b5,0x0003003e,
+0x000003b1,0x0000045f,0x0004003d,0x00000006,
+0x00000460,0x0000036a,0x0004003d,0x00000006,
+0x00000461,0x00000372,0x00050080,0x00000006,
+0x00000462,0x00000460,0x00000461,0x0004003d,
+0x00000006,0x00000463,0x00000379,0x0004003d,
+0x00000006,0x00000464,0x00000380,0x00050080,
+0x00000006,0x00000465,0x00000463,0x00000464,
+0x0004003d,0x00000006,0x00000466,0x00000387,
+0x0004003d,0x00000006,0x00000467,0x0000038e,
+0x00050080,0x00000006,0x00000468,0x00000466,
+0x00000467,0x00070050,0x00000049,0x00000469,
+0x00000462,0x00000465,0x00000468,0x000003b5,
+0x0003003e,0x000003b7,0x00000469,0x0004003d,
+0x00000006,0x0000046a,0x00000372,0x0004003d,
+0x00000006,0x0000046b,0x00000380,0x00050080,
+0x00000006,0x0000046c,0x0000046a,0x0000046b,
+0x0004003d,0x00000006,0x0000046d,0x0000038e,
+0x00050080,0x00000006,0x0000046e,0x0000046c,
+0x0000046d,0x000500b1,0x00000099,0x0000046f,
+0x0000046e,0x00000109,0x000300f7,0x00000471,
+0x00000000,0x000400fa,0x0000046f,0x00000470,
+0x00000471,0x000200f8,0x00000470,0x0004003d,
+0x00000049,0x00000473,0x000003b1,0x0003003e,
+0x00000472,0x00000473,0x0004003d,0x00000049,
+0x00000475,0x000003b7,0x0003003e,0x00000474,
+0x00000475,0x00060039,0x00000002,0x00000476,
+0x0000004e,0x00000472,0x00000474,0x0004003d,
+0x00000049,0x00000477,0x00000472,0x0003003e,
+0x000003b1,0x00000477,0x0004003d,0x00000049,
+0x00000478,0x00000474,0x0003003e,0x000003b7,
+0x00000478,0x0004003d,0x00000049,0x0000047a,
+0x000003b1,0x0003003e,0x00000479,0x0000047a,
+0x00050039,0x00000002,0x0000047b,0x00000057,
+0x00000479,0x0004003d,0x00000049,0x0000047c,
+0x00000479,0x0003003e,0x000003b1,0x0000047c,
+0x0004003d,0x00000049,0x0000047e,0x000003b7,
+0x0003003e,0x0000047d,0x0000047e,0x00050039,
+0x00000002,0x0000047f,0x00000057,0x0000047d,
+0x0004003d,0x00000049,0x00000480,0x0000047d,
+0x0003003e,0x000003b7,0x00000480,0x000200f9,
+0x00000471,0x000200f8,0x00000471,0x0004003d,
+0x00000049,0x00000481,0x000003b1,0x00070050,
+0x00000049,0x00000482,0x00000109,0x00000109,
+0x00000109,0x00000109,0x00070050,0x00000049,
+0x00000483,0x000003b5,0x000003b5,0x000003b5,
+0x000003b5,0x0008000c,0x00000049,0x00000484,
+0x00000001,0x0000002d,0x00000481,0x00000482,
+0x00000483,0x0003003e,0x000003b1,0x00000484,
+0x0004003d,0x00000049,0x00000485,0x000003b7,
+0x00070050,0x00000049,0x00000486,0x00000109,
+0x00000109,0x00000109,0x00000109,0x00070050,
+0x00000049,0x00000487,0x000003b5,0x000003b5,
+0x000003b5,0x000003b5,0x0008000c,0x00000049,
+0x00000488,0x00000001,0x0000002d,0x00000485,
+0x00000486,0x00000487,0x0003003e,0x000003b7,
+0x00000488,0x000200f9,0x000003b0,0x000200f8,
+0x000003ac,0x0004003d,0x00000006,0x0000048a,
+0x0000036a,0x0004003d,0x00000006,0x0000048b,
+0x00000372,0x0004003d,0x00000006,0x0000048c,
+0x00000379,0x00070050,0x00000049,0x0000048d,
+0x0000048a,0x0000048b,0x0000048c,0x000003b5,
+0x0003003e,0x000003b7,0x0000048d,0x0003003e,
+0x000003b1,0x0000048d,0x0004003d,0x00000049,
+0x0000048e,0x000003b1,0x0004003d,0x00000006,
+0x0000048f,0x00000380,0x00070050,0x00000049,
+0x00000490,0x0000048f,0x0000048f,0x0000048f,
+0x0000048f,0x00050084,0x00000049,0x00000491,
+0x0000048e,0x00000490,0x00070050,0x00000049,
+0x00000492,0x00000417,0x00000417,0x00000417,
+0x00000417,0x000500c3,0x00000049,0x00000493,
+0x00000491,0x00000492,0x0003003e,0x000003b1,
+0x00000493,0x0004003d,0x00000006,0x00000494,
+0x00000387,0x00050041,0x0000000f,0x00000495,
+0x000003b1,0x0000003c,0x0003003e,0x00000495,
+0x00000494,0x0004003d,0x00000006,0x00000496,
+0x0000038e,0x00050041,0x0000000f,0x00000497,
+0x000003b7,0x0000003c,0x0003003e,0x00000497,
+0x00000496,0x000200f9,0x000003b0,0x000200f8,
+0x000003ad,0x0004003d,0x00000006,0x0000049a,
+0x0000036a,0x0004003d,0x00000006,0x0000049b,
+0x00000379,0x00050080,0x00000006,0x0000049c,
+0x0000049a,0x0000049b,0x0004003d,0x00000006,
+0x0000049d,0x00000387,0x00050080,0x00000006,
+0x0000049e,0x0000049c,0x0000049d,0x0004007c,
+0x0000000d,0x0000049f,0x0000049e,0x0003003e,
+0x00000499,0x0000049f,0x0004003d,0x00000006,
+0x000004a1,0x00000372,0x0004003d,0x00000006,
+0x000004a2,0x00000380,0x00050080,0x00000006,
+0x000004a3,0x000004a1,0x000004a2,0x0004003d,
+0x00000006,0x000004a4,0x0000038e,0x00050080,
+0x00000006,0x000004a5,0x000004a3,0x000004a4,
+0x0004007c,0x0000000d,0x000004a6,0x000004a5,
+0x0003003e,0x000004a0,0x000004a6,0x0004003d,
+0x00000006,0x000004a7,0x0000036a,0x0004003d,
+0x00000006,0x000004a8,0x00000379,0x0004003d,
+0x00000006,0x000004a9,0x00000387,0x0004003d,
+0x00000006,0x000004aa,0x00000395,0x00070050,
+0x00000049,0x000004ab,0x000004a7,0x000004a8,
+0x000004a9,0x000004aa,0x0003003e,0x000003b1,
+0x000004ab,0x0004003d,0x00000006,0x000004ac,
+0x00000372,0x0004003d,0x00000006,0x000004ad,
+0x00000380,0x0004003d,0x00000006,0x000004ae,
+0x0000038e,0x0004003d,0x00000006,0x000004af,
+0x0000039d,0x00070050,0x00000049,0x000004b0,
+0x000004ac,0x000004ad,0x000004ae,0x000004af,
+0x0003003e,0x000003b7,0x000004b0,0x0004003d,
+0x0000000d,0x000004b1,0x000004a0,0x0004003d,
+0x0000000d,0x000004b2,0x00000499,0x000500b0,
+0x00000099,0x000004b3,0x000004b1,0x000004b2,
+0x000300f7,0x000004b5,0x00000000,0x000400fa,
+0x000004b3,0x000004b4,0x000004b5,0x000200f8,
+0x000004b4,0x0004003d,0x00000049,0x000004b7,
+0x000003b1,0x0003003e,0x000004b6,0x000004b7,
+0x0004003d,0x00000049,0x000004b9,0x000003b7,
+0x0003003e,0x000004b8,0x000004b9,0x00060039,
+0x00000002,0x000004ba,0x0000004e,0x000004b6,
+0x000004b8,0x0004003d,0x00000049,0x000004bb,
+0x000004b6,0x0003003e,0x000003b1,0x000004bb,
+0x0004003d,0x00000049,0x000004bc,0x000004b8,
+0x0003003e,0x000003b7,0x000004bc,0x0004003d,
+0x00000049,0x000004be,0x000003b1,0x0003003e,
+0x000004bd,0x000004be,0x00050039,0x00000002,
+0x000004bf,0x00000057,0x000004bd,0x0004003d,
+0x00000049,0x000004c0,0x000004bd,0x0003003e,
+0x000003b1,0x000004c0,0x0004003d,0x00000049,
+0x000004c2,0x000003b7,0x0003003e,0x000004c1,
+0x000004c2,0x00050039,0x00000002,0x000004c3,
+0x00000057,0x000004c1,0x0004003d,0x00000049,
+0x000004c4,0x000004c1,0x0003003e,0x000003b7,
+0x000004c4,0x000200f9,0x000004b5,0x000200f8,
+0x000004b5,0x000200f9,0x000003b0,0x000200f8,
+0x000003ae,0x0004003d,0x00000006,0x000004c7,
+0x00000372,0x0003003e,0x000004c6,0x000004c7,
+0x0004003d,0x00000006,0x000004c9,0x0000036a,
+0x0003003e,0x000004c8,0x000004c9,0x00060039,
+0x00000002,0x000004ca,0x00000053,0x000004c6,
+0x000004c8,0x0004003d,0x00000006,0x000004cb,
+0x000004c6,0x0003003e,0x00000372,0x000004cb,
+0x0004003d,0x00000006,0x000004cc,0x000004c8,
+0x0003003e,0x0000036a,0x000004cc,0x0004003d,
+0x00000006,0x000004ce,0x00000380,0x0003003e,
+0x000004cd,0x000004ce,0x0004003d,0x00000006,
+0x000004d0,0x00000379,0x0003003e,0x000004cf,
+0x000004d0,0x00060039,0x00000002,0x000004d1,
+0x00000053,0x000004cd,0x000004cf,0x0004003d,
+0x00000006,0x000004d2,0x000004cd,0x0003003e,
+0x00000380,0x000004d2,0x0004003d,0x00000006,
+0x000004d3,0x000004cf,0x0003003e,0x00000379,
+0x000004d3,0x0004003d,0x00000006,0x000004d5,
+0x0000038e,0x0003003e,0x000004d4,0x000004d5,
+0x0004003d,0x00000006,0x000004d7,0x00000387,
+0x0003003e,0x000004d6,0x000004d7,0x00060039,
+0x00000002,0x000004d8,0x00000053,0x000004d4,
+0x000004d6,0x0004003d,0x00000006,0x000004d9,
+0x000004d4,0x0003003e,0x0000038e,0x000004d9,
+0x0004003d,0x00000006,0x000004da,0x000004d6,
+0x0003003e,0x00000387,0x000004da,0x0004003d,
+0x00000006,0x000004dc,0x0000039d,0x0003003e,
+0x000004db,0x000004dc,0x0004003d,0x00000006,
+0x000004de,0x00000395,0x0003003e,0x000004dd,
+0x000004de,0x00060039,0x00000002,0x000004df,
+0x00000053,0x000004db,0x000004dd,0x0004003d,
+0x00000006,0x000004e0,0x000004db,0x0003003e,
+0x0000039d,0x000004e0,0x0004003d,0x00000006,
+0x000004e1,0x000004dd,0x0003003e,0x00000395,
+0x000004e1,0x0004003d,0x00000006,0x000004e2,
+0x0000036a,0x0004003d,0x00000006,0x000004e3,
+0x00000379,0x0004003d,0x00000006,0x000004e4,
+0x00000387,0x0004003d,0x00000006,0x000004e5,
+0x00000395,0x00070050,0x00000049,0x000004e6,
+0x000004e2,0x000004e3,0x000004e4,0x000004e5,
+0x0003003e,0x000003b1,0x000004e6,0x0004003d,
+0x00000006,0x000004e7,0x0000036a,0x0004003d,
+0x00000006,0x000004e8,0x00000372,0x00050080,
+0x00000006,0x000004e9,0x000004e7,0x000004e8,
+0x0004003d,0x00000006,0x000004ea,0x00000379,
+0x0004003d,0x00000006,0x000004eb,0x00000380,
+0x00050080,0x00000006,0x000004ec,0x000004ea,
+0x000004eb,0x0004003d,0x00000006,0x000004ed,
+0x00000387,0x0004003d,0x00000006,0x000004ee,
+0x0000038e,0x00050080,0x00000006,0x000004ef,
+0x000004ed,0x000004ee,0x0004003d,0x00000006,
+0x000004f0,0x00000395,0x0004003d,0x00000006,
+0x000004f1,0x0000039d,0x00050080,0x00000006,
+0x000004f2,0x000004f0,0x000004f1,0x00070050,
+0x00000049,0x000004f3,0x000004e9,0x000004ec,
+0x000004ef,0x000004f2,0x0003003e,0x000003b7,
+0x000004f3,0x0004003d,0x00000006,0x000004f4,
+0x00000372,0x0004003d,0x00000006,0x000004f5,
+0x00000380,0x00050080,0x00000006,0x000004f6,
+0x000004f4,0x000004f5,0x0004003d,0x00000006,
+0x000004f7,0x0000038e,0x00050080,0x00000006,
+0x000004f8,0x000004f6,0x000004f7,0x000500b1,
+0x00000099,0x000004f9,0x000004f8,0x00000109,
+0x000300f7,0x000004fb,0x00000000,0x000400fa,
+0x000004f9,0x000004fa,0x000004fb,0x000200f8,
+0x000004fa,0x0004003d,0x00000049,0x000004fd,
+0x000003b1,0x0003003e,0x000004fc,0x000004fd,
+0x0004003d,0x00000049,0x000004ff,0x000003b7,
+0x0003003e,0x000004fe,0x000004ff,0x00060039,
+0x00000002,0x00000500,0x0000004e,0x000004fc,
+0x000004fe,0x0004003d,0x00000049,0x00000501,
+0x000004fc,0x0003003e,0x000003b1,0x00000501,
+0x0004003d,0x00000049,0x00000502,0x000004fe,
+0x0003003e,0x000003b7,0x00000502,0x0004003d,
+0x00000049,0x00000504,0x000003b1,0x0003003e,
+0x00000503,0x00000504,0x00050039,0x00000002,
+0x00000505,0x00000057,0x00000503,0x0004003d,
+0x00000049,0x00000506,0x00000503,0x0003003e,
+0x000003b1,0x00000506,0x0004003d,0x00000049,
+0x00000508,0x000003b7,0x0003003e,0x00000507,
+0x00000508,0x00050039,0x00000002,0x00000509,
+0x00000057,0x00000507,0x0004003d,0x00000049,
+0x0000050a,0x00000507,0x0003003e,0x000003b7,
+0x0000050a,0x000200f9,0x000004fb,0x000200f8,
+0x000004fb,0x0004003d,0x00000049,0x0000050b,
+0x000003b1,0x00070050,0x00000049,0x0000050c,
+0x00000109,0x00000109,0x00000109,0x00000109,
+0x00070050,0x00000049,0x0000050d,0x000003b5,
+0x000003b5,0x000003b5,0x000003b5,0x0008000c,
+0x00000049,0x0000050e,0x00000001,0x0000002d,
+0x0000050b,0x0000050c,0x0000050d,0x0003003e,
+0x000003b1,0x0000050e,0x0004003d,0x00000049,
+0x0000050f,0x000003b7,0x00070050,0x00000049,
+0x00000510,0x00000109,0x00000109,0x00000109,
+0x00000109,0x00070050,0x00000049,0x00000511,
+0x000003b5,0x000003b5,0x000003b5,0x000003b5,
+0x0008000c,0x00000049,0x00000512,0x00000001,
+0x0000002d,0x0000050f,0x00000510,0x00000511,
+0x0003003e,0x000003b7,0x00000512,0x000200f9,
+0x000003b0,0x000200f8,0x000003b0,0x0004003d,
+0x00000049,0x00000516,0x000003b1,0x0004007c,
+0x00000015,0x00000517,0x00000516,0x0003003e,
+0x0000005f,0x00000517,0x0004003d,0x00000049,
+0x00000518,0x000003b7,0x0004007c,0x00000015,
+0x00000519,0x00000518,0x0003003e,0x00000060,
+0x00000519,0x000100fd,0x00010038,0x00050036,
+0x0000000d,0x00000064,0x00000000,0x00000045,
+0x00030037,0x0000000e,0x00000063,0x000200f8,
+0x00000065,0x0004003d,0x0000000d,0x0000051a,
+0x00000063,0x000500c2,0x0000000d,0x0000051c,
+0x0000051a,0x0000051b,0x0004003d,0x0000000d,
+0x0000051d,0x00000063,0x000500c6,0x0000000d,
+0x0000051e,0x0000051d,0x0000051c,0x0003003e,
+0x00000063,0x0000051e,0x0004003d,0x0000000d,
+0x0000051f,0x00000063,0x000500c4,0x0000000d,
+0x00000521,0x0000051f,0x00000520,0x0004003d,
+0x0000000d,0x00000522,0x00000063,0x00050082,
+0x0000000d,0x00000523,0x00000522,0x00000521,
+0x0003003e,0x00000063,0x00000523,0x0004003d,
+0x0000000d,0x00000524,0x00000063,0x000500c4,
+0x0000000d,0x00000526,0x00000524,0x00000525,
+0x0004003d,0x0000000d,0x00000527,0x00000063,
+0x00050080,0x0000000d,0x00000528,0x00000527,
+0x00000526,0x0003003e,0x00000063,0x00000528,
+0x0004003d,0x0000000d,0x00000529,0x00000063,
+0x000500c4,0x0000000d,0x0000052b,0x00000529,
+0x0000052a,0x0004003d,0x0000000d,0x0000052c,
+0x00000063,0x00050080,0x0000000d,0x0000052d,
+0x0000052c,0x0000052b,0x0003003e,0x00000063,
+0x0000052d,0x0004003d,0x0000000d,0x0000052e,
+0x00000063,0x000500c2,0x0000000d,0x0000052f,
+0x0000052e,0x00000110,0x0004003d,0x0000000d,
+0x00000530,0x00000063,0x000500c6,0x0000000d,
+0x00000531,0x00000530,0x0000052f,0x0003003e,
+0x00000063,0x00000531,0x0004003d,0x0000000d,
+0x00000532,0x00000063,0x000500c4,0x0000000d,
+0x00000534,0x00000532,0x00000533,0x0004003d,
+0x0000000d,0x00000535,0x00000063,0x00050080,
+0x0000000d,0x00000536,0x00000535,0x00000534,
+0x0003003e,0x00000063,0x00000536,0x0004003d,
+0x0000000d,0x00000537,0x00000063,0x000500c2,
+0x0000000d,0x00000538,0x00000537,0x00000525,
+0x0004003d,0x0000000d,0x00000539,0x00000063,
+0x000500c6,0x0000000d,0x0000053a,0x00000539,
+0x00000538,0x0003003e,0x00000063,0x0000053a,
+0x0004003d,0x0000000d,0x0000053b,0x00000063,
+0x000500c2,0x0000000d,0x0000053c,0x0000053b,
+0x00000269,0x0004003d,0x0000000d,0x0000053d,
+0x00000063,0x000500c6,0x0000000d,0x0000053e,
+0x0000053d,0x0000053c,0x0003003e,0x00000063,
+0x0000053e,0x0004003d,0x0000000d,0x0000053f,
+0x00000063,0x000500c4,0x0000000d,0x00000541,
+0x0000053f,0x00000540,0x0004003d,0x0000000d,
+0x00000542,0x00000063,0x000500c6,0x0000000d,
+0x00000543,0x00000542,0x00000541,0x0003003e,
+0x00000063,0x00000543,0x0004003d,0x0000000d,
+0x00000544,0x00000063,0x000500c2,0x0000000d,
+0x00000545,0x00000544,0x00000520,0x0004003d,
+0x0000000d,0x00000546,0x00000063,0x000500c6,
+0x0000000d,0x00000547,0x00000546,0x00000545,
+0x0003003e,0x00000063,0x00000547,0x0004003d,
+0x0000000d,0x00000548,0x00000063,0x000200fe,
+0x00000548,0x00010038,0x00050036,0x0000000d,
+0x0000006a,0x00000000,0x00000024,0x00030037,
+0x0000000e,0x00000066,0x00030037,0x0000000e,
+0x00000067,0x00030037,0x0000000e,0x00000068,
+0x00030037,0x0000000e,0x00000069,0x000200f8,
+0x0000006b,0x0004003b,0x0000000e,0x00000550,
+0x00000007,0x0004003b,0x0000000e,0x00000565,
+0x00000007,0x0004003b,0x0000000e,0x00000566,
+0x00000007,0x0004003b,0x0000000e,0x00000569,
+0x00000007,0x0004003b,0x0000000e,0x0000056d,
+0x00000007,0x0004003b,0x0000000e,0x00000571,
+0x00000007,0x0004003b,0x0000000e,0x00000575,
+0x00000007,0x0004003b,0x0000000e,0x0000057a,
+0x00000007,0x0004003b,0x0000000e,0x0000057e,
+0x00000007,0x0004003b,0x0000000e,0x00000583,
+0x00000007,0x0004003b,0x0000000e,0x00000588,
+0x00000007,0x0004003b,0x0000000e,0x0000058d,
+0x00000007,0x0004003b,0x0000000e,0x00000592,
+0x00000007,0x0004003b,0x0000000e,0x00000597,
+0x00000007,0x0004003b,0x0000000e,0x0000059c,
+0x00000007,0x0004003b,0x0000000e,0x000005cd,
+0x00000007,0x0004003b,0x0000000e,0x000005d3,
+0x00000007,0x0004003b,0x0000000e,0x000005e2,
+0x00000007,0x0004003b,0x0000000e,0x0000060e,
+0x00000007,0x0004003b,0x0000000e,0x0000061e,
+0x00000007,0x0004003b,0x0000000e,0x0000062e,
+0x00000007,0x0004003b,0x0000000e,0x0000063d,
+0x00000007,0x0004003d,0x0000000d,0x0000054b,
+0x00000069,0x000500aa,0x00000099,0x0000054c,
+0x0000054b,0x00000082,0x000300f7,0x0000054e,
+0x00000000,0x000400fa,0x0000054c,0x0000054d,
+0x0000054e,0x000200f8,0x0000054d,0x000200fe,
+0x000000c9,0x000200f8,0x0000054e,0x0003003e,
+0x00000550,0x000000c9,0x00050041,0x00000555,
+0x00000556,0x00000554,0x00000124,0x0004003d,
+0x0000000d,0x00000557,0x00000556,0x000500ab,
+0x00000099,0x00000558,0x00000557,0x000000c9,
+0x000300f7,0x0000055a,0x00000000,0x000400fa,
+0x00000558,0x00000559,0x0000055a,0x000200f8,
+0x00000559,0x0004003d,0x0000000d,0x0000055b,
+0x00000067,0x000500c4,0x0000000d,0x0000055c,
+0x0000055b,0x0000008e,0x0003003e,0x00000067,
+0x0000055c,0x0004003d,0x0000000d,0x0000055d,
+0x00000068,0x000500c4,0x0000000d,0x0000055e,
+0x0000055d,0x0000008e,0x0003003e,0x00000068,
+0x0000055e,0x000200f9,0x0000055a,0x000200f8,
+0x0000055a,0x0004003d,0x0000000d,0x0000055f,
+0x00000069,0x00050082,0x0000000d,0x00000560,
+0x0000055f,0x00000082,0x00050084,0x0000000d,
+0x00000562,0x00000560,0x00000561,0x0004003d,
+0x0000000d,0x00000563,0x00000066,0x00050080,
+0x0000000d,0x00000564,0x00000563,0x00000562,
+0x0003003e,0x00000066,0x00000564,0x0004003d,
+0x0000000d,0x00000567,0x00000066,0x0003003e,
+0x00000566,0x00000567,0x00050039,0x0000000d,
+0x00000568,0x00000064,0x00000566,0x0003003e,
+0x00000565,0x00000568,0x0004003d,0x0000000d,
+0x0000056a,0x00000565,0x000500c7,0x0000000d,
+0x0000056c,0x0000056a,0x0000056b,0x0003003e,
+0x00000569,0x0000056c,0x0004003d,0x0000000d,
+0x0000056e,0x00000565,0x000500c2,0x0000000d,
+0x0000056f,0x0000056e,0x0000052a,0x000500c7,
+0x0000000d,0x00000570,0x0000056f,0x0000056b,
+0x0003003e,0x0000056d,0x00000570,0x0004003d,
+0x0000000d,0x00000572,0x00000565,0x000500c2,
+0x0000000d,0x00000573,0x00000572,0x00000417,
+0x000500c7,0x0000000d,0x00000574,0x00000573,
+0x0000056b,0x0003003e,0x00000571,0x00000574,
+0x0004003d,0x0000000d,0x00000576,0x00000565,
+0x000500c2,0x0000000d,0x00000578,0x00000576,
+0x00000577,0x000500c7,0x0000000d,0x00000579,
+0x00000578,0x0000056b,0x0003003e,0x00000575,
+0x00000579,0x0004003d,0x0000000d,0x0000057b,
+0x00000565,0x000500c2,0x0000000d,0x0000057c,
+0x0000057b,0x00000533,0x000500c7,0x0000000d,
+0x0000057d,0x0000057c,0x0000056b,0x0003003e,
+0x0000057a,0x0000057d,0x0004003d,0x0000000d,
+0x0000057f,0x00000565,0x000500c2,0x0000000d,
+0x00000581,0x0000057f,0x00000580,0x000500c7,
+0x0000000d,0x00000582,0x00000581,0x0000056b,
+0x0003003e,0x0000057e,0x00000582,0x0004003d,
+0x0000000d,0x00000584,0x00000565,0x000500c2,
+0x0000000d,0x00000586,0x00000584,0x00000585,
+0x000500c7,0x0000000d,0x00000587,0x00000586,
+0x0000056b,0x0003003e,0x00000583,0x00000587,
+0x0004003d,0x0000000d,0x00000589,0x00000565,
+0x000500c2,0x0000000d,0x0000058b,0x00000589,
+0x0000058a,0x000500c7,0x0000000d,0x0000058c,
+0x0000058b,0x0000056b,0x0003003e,0x00000588,
+0x0000058c,0x0004003d,0x0000000d,0x0000058e,
+0x00000565,0x000500c2,0x0000000d,0x00000590,
+0x0000058e,0x0000058f,0x000500c7,0x0000000d,
+0x00000591,0x00000590,0x0000056b,0x0003003e,
+0x0000058d,0x00000591,0x0004003d,0x0000000d,
+0x00000593,0x00000565,0x000500c2,0x0000000d,
+0x00000595,0x00000593,0x00000594,0x000500c7,
+0x0000000d,0x00000596,0x00000595,0x0000056b,
+0x0003003e,0x00000592,0x00000596,0x0004003d,
+0x0000000d,0x00000598,0x00000565,0x000500c2,
+0x0000000d,0x0000059a,0x00000598,0x00000599,
+0x000500c7,0x0000000d,0x0000059b,0x0000059a,
+0x0000056b,0x0003003e,0x00000597,0x0000059b,
+0x0004003d,0x0000000d,0x0000059d,0x00000565,
+0x000500c2,0x0000000d,0x0000059f,0x0000059d,
+0x0000059e,0x0004003d,0x0000000d,0x000005a0,
+0x00000565,0x000500c4,0x0000000d,0x000005a1,
+0x000005a0,0x00000124,0x000500c5,0x0000000d,
+0x000005a2,0x0000059f,0x000005a1,0x000500c7,
+0x0000000d,0x000005a3,0x000005a2,0x0000056b,
+0x0003003e,0x0000059c,0x000005a3,0x0004003d,
+0x0000000d,0x000005a4,0x00000569,0x0004003d,
+0x0000000d,0x000005a5,0x00000569,0x00050084,
+0x0000000d,0x000005a6,0x000005a5,0x000005a4,
+0x0003003e,0x00000569,0x000005a6,0x0004003d,
+0x0000000d,0x000005a7,0x0000056d,0x0004003d,
+0x0000000d,0x000005a8,0x0000056d,0x00050084,
+0x0000000d,0x000005a9,0x000005a8,0x000005a7,
+0x0003003e,0x0000056d,0x000005a9,0x0004003d,
+0x0000000d,0x000005aa,0x00000571,0x0004003d,
+0x0000000d,0x000005ab,0x00000571,0x00050084,
+0x0000000d,0x000005ac,0x000005ab,0x000005aa,
+0x0003003e,0x00000571,0x000005ac,0x0004003d,
+0x0000000d,0x000005ad,0x00000575,0x0004003d,
+0x0000000d,0x000005ae,0x00000575,0x00050084,
+0x0000000d,0x000005af,0x000005ae,0x000005ad,
+0x0003003e,0x00000575,0x000005af,0x0004003d,
+0x0000000d,0x000005b0,0x0000057a,0x0004003d,
+0x0000000d,0x000005b1,0x0000057a,0x00050084,
+0x0000000d,0x000005b2,0x000005b1,0x000005b0,
+0x0003003e,0x0000057a,0x000005b2,0x0004003d,
+0x0000000d,0x000005b3,0x0000057e,0x0004003d,
+0x0000000d,0x000005b4,0x0000057e,0x00050084,
+0x0000000d,0x000005b5,0x000005b4,0x000005b3,
+0x0003003e,0x0000057e,0x000005b5,0x0004003d,
+0x0000000d,0x000005b6,0x00000583,0x0004003d,
+0x0000000d,0x000005b7,0x00000583,0x00050084,
+0x0000000d,0x000005b8,0x000005b7,0x000005b6,
+0x0003003e,0x00000583,0x000005b8,0x0004003d,
+0x0000000d,0x000005b9,0x00000588,0x0004003d,
+0x0000000d,0x000005ba,0x00000588,0x00050084,
+0x0000000d,0x000005bb,0x000005ba,0x000005b9,
+0x0003003e,0x00000588,0x000005bb,0x0004003d,
+0x0000000d,0x000005bc,0x0000058d,0x0004003d,
+0x0000000d,0x000005bd,0x0000058d,0x00050084,
+0x0000000d,0x000005be,0x000005bd,0x000005bc,
+0x0003003e,0x0000058d,0x000005be,0x0004003d,
+0x0000000d,0x000005bf,0x00000592,0x0004003d,
+0x0000000d,0x000005c0,0x00000592,0x00050084,
+0x0000000d,0x000005c1,0x000005c0,0x000005bf,
+0x0003003e,0x00000592,0x000005c1,0x0004003d,
+0x0000000d,0x000005c2,0x00000597,0x0004003d,
+0x0000000d,0x000005c3,0x00000597,0x00050084,
+0x0000000d,0x000005c4,0x000005c3,0x000005c2,
+0x0003003e,0x00000597,0x000005c4,0x0004003d,
+0x0000000d,0x000005c5,0x0000059c,0x0004003d,
+0x0000000d,0x000005c6,0x0000059c,0x00050084,
+0x0000000d,0x000005c7,0x000005c6,0x000005c5,
+0x0003003e,0x0000059c,0x000005c7,0x0004003d,
+0x0000000d,0x000005c8,0x00000066,0x000500c7,
+0x0000000d,0x000005c9,0x000005c8,0x00000082,
+0x000500ab,0x00000099,0x000005ca,0x000005c9,
+0x000000c9,0x000300f7,0x000005cc,0x00000000,
+0x000400fa,0x000005ca,0x000005cb,0x000005d8,
+0x000200f8,0x000005cb,0x0004003d,0x0000000d,
+0x000005ce,0x00000066,0x000500c7,0x0000000d,
+0x000005cf,0x000005ce,0x000000e7,0x000500ab,
+0x00000099,0x000005d0,0x000005cf,0x000000c9,
+0x000600a9,0x00000006,0x000005d1,0x000005d0,
+0x0000052a,0x00000110,0x0004007c,0x0000000d,
+0x000005d2,0x000005d1,0x0003003e,0x000005cd,
+0x000005d2,0x0004003d,0x0000000d,0x000005d4,
+0x00000069,0x000500aa,0x00000099,0x000005d5,
+0x000005d4,0x0000003c,0x000600a9,0x00000006,
+0x000005d6,0x000005d5,0x00000540,0x00000110,
+0x0004007c,0x0000000d,0x000005d7,0x000005d6,
+0x0003003e,0x000005d3,0x000005d7,0x000200f9,
+0x000005cc,0x000200f8,0x000005d8,0x0004003d,
+0x0000000d,0x000005d9,0x00000069,0x000500aa,
+0x00000099,0x000005da,0x000005d9,0x0000003c,
+0x000600a9,0x00000006,0x000005db,0x000005da,
+0x00000540,0x00000110,0x0004007c,0x0000000d,
+0x000005dc,0x000005db,0x0003003e,0x000005cd,
+0x000005dc,0x0004003d,0x0000000d,0x000005dd,
+0x00000066,0x000500c7,0x0000000d,0x000005de,
+0x000005dd,0x000000e7,0x000500ab,0x00000099,
+0x000005df,0x000005de,0x000000c9,0x000600a9,
+0x00000006,0x000005e0,0x000005df,0x0000052a,
+0x00000110,0x0004007c,0x0000000d,0x000005e1,
+0x000005e0,0x0003003e,0x000005d3,0x000005e1,
+0x000200f9,0x000005cc,0x000200f8,0x000005cc,
+0x0004003d,0x0000000d,0x000005e3,0x00000066,
+0x000500c7,0x0000000d,0x000005e5,0x000005e3,
+0x000005e4,0x000500ab,0x00000099,0x000005e6,
+0x000005e5,0x000000c9,0x0004003d,0x0000000d,
+0x000005e7,0x000005cd,0x0004003d,0x0000000d,
+0x000005e8,0x000005d3,0x000600a9,0x0000000d,
+0x000005e9,0x000005e6,0x000005e7,0x000005e8,
+0x0003003e,0x000005e2,0x000005e9,0x0004003d,
+0x0000000d,0x000005ea,0x000005cd,0x0004003d,
+0x0000000d,0x000005eb,0x00000569,0x000500c2,
+0x0000000d,0x000005ec,0x000005eb,0x000005ea,
+0x0003003e,0x00000569,0x000005ec,0x0004003d,
+0x0000000d,0x000005ed,0x000005d3,0x0004003d,
+0x0000000d,0x000005ee,0x0000056d,0x000500c2,
+0x0000000d,0x000005ef,0x000005ee,0x000005ed,
+0x0003003e,0x0000056d,0x000005ef,0x0004003d,
+0x0000000d,0x000005f0,0x000005cd,0x0004003d,
+0x0000000d,0x000005f1,0x00000571,0x000500c2,
+0x0000000d,0x000005f2,0x000005f1,0x000005f0,
+0x0003003e,0x00000571,0x000005f2,0x0004003d,
+0x0000000d,0x000005f3,0x000005d3,0x0004003d,
+0x0000000d,0x000005f4,0x00000575,0x000500c2,
+0x0000000d,0x000005f5,0x000005f4,0x000005f3,
+0x0003003e,0x00000575,0x000005f5,0x0004003d,
+0x0000000d,0x000005f6,0x000005cd,0x0004003d,
+0x0000000d,0x000005f7,0x0000057a,0x000500c2,
+0x0000000d,0x000005f8,0x000005f7,0x000005f6,
+0x0003003e,0x0000057a,0x000005f8,0x0004003d,
+0x0000000d,0x000005f9,0x000005d3,0x0004003d,
+0x0000000d,0x000005fa,0x0000057e,0x000500c2,
+0x0000000d,0x000005fb,0x000005fa,0x000005f9,
+0x0003003e,0x0000057e,0x000005fb,0x0004003d,
+0x0000000d,0x000005fc,0x000005cd,0x0004003d,
+0x0000000d,0x000005fd,0x00000583,0x000500c2,
+0x0000000d,0x000005fe,0x000005fd,0x000005fc,
+0x0003003e,0x00000583,0x000005fe,0x0004003d,
+0x0000000d,0x000005ff,0x000005d3,0x0004003d,
+0x0000000d,0x00000600,0x00000588,0x000500c2,
+0x0000000d,0x00000601,0x00000600,0x000005ff,
+0x0003003e,0x00000588,0x00000601,0x0004003d,
+0x0000000d,0x00000602,0x000005e2,0x0004003d,
+0x0000000d,0x00000603,0x0000058d,0x000500c2,
+0x0000000d,0x00000604,0x00000603,0x00000602,
+0x0003003e,0x0000058d,0x00000604,0x0004003d,
+0x0000000d,0x00000605,0x000005e2,0x0004003d,
+0x0000000d,0x00000606,0x00000592,0x000500c2,
+0x0000000d,0x00000607,0x00000606,0x00000605,
+0x0003003e,0x00000592,0x00000607,0x0004003d,
+0x0000000d,0x00000608,0x000005e2,0x0004003d,
+0x0000000d,0x00000609,0x00000597,0x000500c2,
+0x0000000d,0x0000060a,0x00000609,0x00000608,
+0x0003003e,0x00000597,0x0000060a,0x0004003d,
+0x0000000d,0x0000060b,0x000005e2,0x0004003d,
+0x0000000d,0x0000060c,0x0000059c,0x000500c2,
+0x0000000d,0x0000060d,0x0000060c,0x0000060b,
+0x0003003e,0x0000059c,0x0000060d,0x0004003d,
+0x0000000d,0x0000060f,0x00000569,0x0004003d,
+0x0000000d,0x00000610,0x00000067,0x00050084,
+0x0000000d,0x00000611,0x0000060f,0x00000610,
+0x0004003d,0x0000000d,0x00000612,0x0000056d,
+0x0004003d,0x0000000d,0x00000613,0x00000068,
+0x00050084,0x0000000d,0x00000614,0x00000612,
+0x00000613,0x00050080,0x0000000d,0x00000615,
+0x00000611,0x00000614,0x0004003d,0x0000000d,
+0x00000616,0x00000597,0x0004003d,0x0000000d,
+0x00000617,0x00000550,0x00050084,0x0000000d,
+0x00000618,0x00000616,0x00000617,0x00050080,
+0x0000000d,0x00000619,0x00000615,0x00000618,
+0x0004003d,0x0000000d,0x0000061a,0x00000565,
+0x000500c2,0x0000000d,0x0000061c,0x0000061a,
+0x0000061b,0x00050080,0x0000000d,0x0000061d,
+0x00000619,0x0000061c,0x0003003e,0x0000060e,
+0x0000061d,0x0004003d,0x0000000d,0x0000061f,
+0x00000571,0x0004003d,0x0000000d,0x00000620,
+0x00000067,0x00050084,0x0000000d,0x00000621,
+0x0000061f,0x00000620,0x0004003d,0x0000000d,
+0x00000622,0x00000575,0x0004003d,0x0000000d,
+0x00000623,0x00000068,0x00050084,0x0000000d,
+0x00000624,0x00000622,0x00000623,0x00050080,
+0x0000000d,0x00000625,0x00000621,0x00000624,
+0x0004003d,0x0000000d,0x00000626,0x0000059c,
+0x0004003d,0x0000000d,0x00000627,0x00000550,
+0x00050084,0x0000000d,0x00000628,0x00000626,
+0x00000627,0x00050080,0x0000000d,0x00000629,
+0x00000625,0x00000628,0x0004003d,0x0000000d,
+0x0000062a,0x00000565,0x000500c2,0x0000000d,
+0x0000062c,0x0000062a,0x0000062b,0x00050080,
+0x0000000d,0x0000062d,0x00000629,0x0000062c,
+0x0003003e,0x0000061e,0x0000062d,0x0004003d,
+0x0000000d,0x0000062f,0x0000057a,0x0004003d,
+0x0000000d,0x00000630,0x00000067,0x00050084,
+0x0000000d,0x00000631,0x0000062f,0x00000630,
+0x0004003d,0x0000000d,0x00000632,0x0000057e,
+0x0004003d,0x0000000d,0x00000633,0x00000068,
+0x00050084,0x0000000d,0x00000634,0x00000632,
+0x00000633,0x00050080,0x0000000d,0x00000635,
+0x00000631,0x00000634,0x0004003d,0x0000000d,
+0x00000636,0x0000058d,0x0004003d,0x0000000d,
+0x00000637,0x00000550,0x00050084,0x0000000d,
+0x00000638,0x00000636,0x00000637,0x00050080,
+0x0000000d,0x00000639,0x00000635,0x00000638,
+0x0004003d,0x0000000d,0x0000063a,0x00000565,
+0x000500c2,0x0000000d,0x0000063b,0x0000063a,
+0x00000540,0x00050080,0x0000000d,0x0000063c,
+0x00000639,0x0000063b,0x0003003e,0x0000062e,
+0x0000063c,0x0004003d,0x0000000d,0x0000063e,
+0x00000583,0x0004003d,0x0000000d,0x0000063f,
+0x00000067,0x00050084,0x0000000d,0x00000640,
+0x0000063e,0x0000063f,0x0004003d,0x0000000d,
+0x00000641,0x00000588,0x0004003d,0x0000000d,
+0x00000642,0x00000068,0x00050084,0x0000000d,
+0x00000643,0x00000641,0x00000642,0x00050080,
+0x0000000d,0x00000644,0x00000640,0x00000643,
+0x0004003d,0x0000000d,0x00000645,0x00000592,
+0x0004003d,0x0000000d,0x00000646,0x00000550,
+0x00050084,0x0000000d,0x00000647,0x00000645,
+0x00000646,0x00050080,0x0000000d,0x00000648,
+0x00000644,0x00000647,0x0004003d,0x0000000d,
+0x00000649,0x00000565,0x000500c2,0x0000000d,
+0x0000064a,0x00000649,0x00000124,0x00050080,
+0x0000000d,0x0000064b,0x00000648,0x0000064a,
+0x0003003e,0x0000063d,0x0000064b,0x0004003d,
+0x0000000d,0x0000064d,0x0000060e,0x000500c7,
+0x0000000d,0x0000064e,0x0000064d,0x0000064c,
+0x0003003e,0x0000060e,0x0000064e,0x0004003d,
+0x0000000d,0x0000064f,0x0000061e,0x000500c7,
+0x0000000d,0x00000650,0x0000064f,0x0000064c,
+0x0003003e,0x0000061e,0x00000650,0x0004003d,
+0x0000000d,0x00000651,0x0000062e,0x000500c7,
+0x0000000d,0x00000652,0x00000651,0x0000064c,
+0x0003003e,0x0000062e,0x00000652,0x0004003d,
+0x0000000d,0x00000653,0x0000063d,0x000500c7,
+0x0000000d,0x00000654,0x00000653,0x0000064c,
+0x0003003e,0x0000063d,0x00000654,0x0004003d,
+0x0000000d,0x00000655,0x00000069,0x000500b0,
+0x00000099,0x00000656,0x00000655,0x000000de,
+0x000300f7,0x00000658,0x00000000,0x000400fa,
+0x00000656,0x00000657,0x00000658,0x000200f8,
+0x00000657,0x0003003e,0x0000063d,0x000000c9,
+0x000200f9,0x00000658,0x000200f8,0x00000658,
+0x0004003d,0x0000000d,0x00000659,0x00000069,
+0x000500b0,0x00000099,0x0000065a,0x00000659,
+0x0000003c,0x000300f7,0x0000065c,0x00000000,
+0x000400fa,0x0000065a,0x0000065b,0x0000065c,
+0x000200f8,0x0000065b,0x0003003e,0x0000062e,
+0x000000c9,0x000200f9,0x0000065c,0x000200f8,
+0x0000065c,0x0004003d,0x0000000d,0x0000065d,
+0x0000060e,0x0004003d,0x0000000d,0x0000065e,
+0x0000061e,0x000500ae,0x00000099,0x0000065f,
+0x0000065d,0x0000065e,0x0004003d,0x0000000d,
+0x00000660,0x0000060e,0x0004003d,0x0000000d,
+0x00000661,0x0000062e,0x000500ae,0x00000099,
+0x00000662,0x00000660,0x00000661,0x000500a7,
+0x00000099,0x00000663,0x0000065f,0x00000662,
+0x0004003d,0x0000000d,0x00000664,0x0000060e,
+0x0004003d,0x0000000d,0x00000665,0x0000063d,
+0x000500ae,0x00000099,0x00000666,0x00000664,
+0x00000665,0x000500a7,0x00000099,0x00000667,
+0x00000663,0x00000666,0x000300f7,0x00000669,
+0x00000000,0x000400fa,0x00000667,0x00000668,
+0x0000066b,0x000200f8,0x00000668,0x000200fe,
+0x000000c9,0x000200f8,0x0000066b,0x0004003d,
+0x0000000d,0x0000066c,0x0000061e,0x0004003d,
+0x0000000d,0x0000066d,0x0000062e,0x000500ae,
+0x00000099,0x0000066e,0x0000066c,0x0000066d,
+0x0004003d,0x0000000d,0x0000066f,0x0000061e,
+0x0004003d,0x0000000d,0x00000670,0x0000063d,
+0x000500ae,0x00000099,0x00000671,0x0000066f,
+0x00000670,0x000500a7,0x00000099,0x00000672,
+0x0000066e,0x00000671,0x000300f7,0x00000674,
+0x00000000,0x000400fa,0x00000672,0x00000673,
+0x00000676,0x000200f8,0x00000673,0x000200fe,
+0x00000082,0x000200f8,0x00000676,0x0004003d,
+0x0000000d,0x00000677,0x0000062e,0x0004003d,
+0x0000000d,0x00000678,0x0000063d,0x000500ae,
+0x00000099,0x00000679,0x00000677,0x00000678,
+0x000300f7,0x0000067b,0x00000000,0x000400fa,
+0x00000679,0x0000067a,0x0000067d,0x000200f8,
+0x0000067a,0x000200fe,0x000000e7,0x000200f8,
+0x0000067d,0x000200fe,0x0000003c,0x000200f8,
+0x0000067b,0x000100ff,0x000200f8,0x00000674,
+0x000100ff,0x000200f8,0x00000669,0x000100ff,
+0x00010038,0x00050036,0x0000006d,0x00000070,
+0x00000000,0x0000006e,0x00030037,0x00000016,
+0x0000006f,0x000200f8,0x00000071,0x0004003b,
+0x0000000f,0x00000680,0x00000007,0x0004003b,
+0x0000000f,0x0000068b,0x00000007,0x0004003b,
+0x00000696,0x00000697,0x00000007,0x0003003e,
+0x00000680,0x00000109,0x000200f9,0x00000681,
+0x000200f8,0x00000681,0x000400f6,0x00000683,
+0x00000684,0x00000000,0x000200f9,0x00000685,
+0x000200f8,0x00000685,0x0004003d,0x00000006,
+0x00000686,0x00000680,0x0004007c,0x0000000d,
+0x00000687,0x00000686,0x00060041,0x00000555,
+0x00000688,0x00000554,0x00000109,0x00000082,
+0x0004003d,0x0000000d,0x00000689,0x00000688,
+0x000500b0,0x00000099,0x0000068a,0x00000687,
+0x00000689,0x000400fa,0x0000068a,0x00000682,
+0x00000683,0x000200f8,0x00000682,0x0003003e,
+0x0000068b,0x00000109,0x000200f9,0x0000068c,
+0x000200f8,0x0000068c,0x000400f6,0x0000068e,
+0x0000068f,0x00000000,0x000200f9,0x00000690,
+0x000200f8,0x00000690,0x0004003d,0x00000006,
+0x00000691,0x0000068b,0x0004007c,0x0000000d,
+0x00000692,0x00000691,0x00060041,0x00000555,
+0x00000693,0x00000554,0x00000109,0x000000c9,
+0x0004003d,0x0000000d,0x00000694,0x00000693,
+0x000500b0,0x00000099,0x00000695,0x00000692,
+0x00000694,0x000400fa,0x00000695,0x0000068d,
+0x0000068e,0x000200f8,0x0000068d,0x0004003d,
+0x00000006,0x00000698,0x00000680,0x0004007c,
+0x0000000d,0x00000699,0x00000698,0x00060041,
+0x00000555,0x0000069a,0x00000554,0x00000109,
+0x000000c9,0x0004003d,0x0000000d,0x0000069b,
+0x0000069a,0x00050084,0x0000000d,0x0000069c,
+0x00000699,0x0000069b,0x0004003d,0x00000006,
+0x0000069d,0x0000068b,0x0004007c,0x0000000d,
+0x0000069e,0x0000069d,0x00050080,0x0000000d,
+0x0000069f,0x0000069c,0x0000069e,0x0004003d,
+0x00000015,0x000006a0,0x0000006f,0x00050041,
+0x00000016,0x000006a1,0x00000697,0x0000069f,
+0x0003003e,0x000006a1,0x000006a0,0x000200f9,
+0x0000068f,0x000200f8,0x0000068f,0x0004003d,
+0x00000006,0x000006a2,0x0000068b,0x00050080,
+0x00000006,0x000006a3,0x000006a2,0x0000008e,
+0x0003003e,0x0000068b,0x000006a3,0x000200f9,
+0x0000068c,0x000200f8,0x0000068e,0x000200f9,
+0x00000684,0x000200f8,0x00000684,0x0004003d,
+0x00000006,0x000006a4,0x00000680,0x00050080,
+0x00000006,0x000006a5,0x000006a4,0x0000008e,
+0x0003003e,0x00000680,0x000006a5,0x000200f9,
+0x00000681,0x000200f8,0x00000683,0x0004003d,
+0x0000006d,0x000006a6,0x00000697,0x000200fe,
+0x000006a6,0x00010038,0x00050036,0x0000006d,
+0x00000073,0x00000000,0x00000072,0x000200f8,
+0x00000074,0x0004003b,0x00000016,0x000006ab,
+0x00000007,0x0003003e,0x000006ab,0x000006aa,
+0x00050039,0x0000006d,0x000006ac,0x00000070,
+0x000006ab,0x000200fe,0x000006ac,0x00010038,
+0x00050036,0x0000006d,0x00000077,0x00000000,
+0x00000075,0x00030037,0x00000015,0x00000076,
+0x000200f8,0x00000078,0x0004003b,0x0000000e,
+0x000006af,0x00000007,0x0004003b,0x0000000e,
+0x000006b1,0x00000007,0x0004003b,0x0000000e,
+0x000006b5,0x00000007,0x0004003b,0x0000000e,
+0x000006b9,0x00000007,0x0004003b,0x0000000e,
+0x000006bd,0x00000007,0x0004003b,0x0000000e,
+0x000006bf,0x00000007,0x0004003b,0x0000000e,
+0x000006c1,0x00000007,0x0004003b,0x0000000e,
+0x000006c2,0x00000007,0x0004003b,0x0000000f,
+0x000006c4,0x00000007,0x0004003b,0x0000000e,
+0x000006c6,0x00000007,0x0004003b,0x0000000e,
+0x000006c8,0x00000007,0x0004003b,0x0000000f,
+0x000006ca,0x00000007,0x0004003b,0x0000000e,
+0x000006d1,0x00000007,0x0004003b,0x0000000e,
+0x000006d4,0x00000007,0x0004003b,0x0000000f,
+0x000006d6,0x00000007,0x0004003b,0x0000000e,
+0x000006dd,0x00000007,0x0004003b,0x0000000e,
+0x000006df,0x00000007,0x0004003b,0x00000016,
+0x00000700,0x00000007,0x0004003b,0x00000016,
+0x0000070e,0x00000007,0x0004003b,0x0000000e,
+0x00000721,0x00000007,0x0004003b,0x0000000f,
+0x00000723,0x00000007,0x0004003b,0x0000000e,
+0x00000741,0x00000007,0x0004003b,0x0000000f,
+0x00000743,0x00000007,0x0004003b,0x0000000e,
+0x00000763,0x00000007,0x0004003b,0x0000000e,
+0x00000764,0x00000007,0x0004003b,0x0000000e,
+0x00000765,0x00000007,0x0004003b,0x0000000e,
+0x00000766,0x00000007,0x0004003b,0x0000000e,
+0x0000079d,0x00000007,0x0004003b,0x0000000e,
+0x0000079e,0x00000007,0x0004003b,0x0000000e,
+0x0000079f,0x00000007,0x0004003b,0x0000000e,
+0x000007a1,0x00000007,0x0004003b,0x0000000e,
+0x000007a3,0x00000007,0x0004003b,0x0000000e,
+0x000007a5,0x00000007,0x0004003b,0x0000000e,
+0x000007a6,0x00000007,0x0004003b,0x0000000e,
+0x000007aa,0x00000007,0x0004003b,0x0000000e,
+0x000007ab,0x00000007,0x0004003b,0x00000016,
+0x000007ac,0x00000007,0x0004003b,0x0000000e,
+0x000007ae,0x00000007,0x0004003b,0x0000000e,
+0x000007af,0x00000007,0x0004003b,0x0000000e,
+0x000007b1,0x00000007,0x0004003b,0x0000000e,
+0x000007b3,0x00000007,0x0004003b,0x0000000e,
+0x000007b5,0x00000007,0x0004003b,0x00000112,
+0x000007d8,0x00000007,0x0004003b,0x00000016,
+0x000007d9,0x00000007,0x0004003b,0x0000000e,
+0x000007db,0x00000007,0x0004003b,0x0000000e,
+0x000007dd,0x00000007,0x0004003b,0x0000000e,
+0x000007df,0x00000007,0x0004003b,0x0000000f,
+0x000007e2,0x00000007,0x0004003b,0x000007ec,
+0x000007ed,0x00000007,0x0004003b,0x00000810,
+0x00000811,0x00000007,0x0004003b,0x00000818,
+0x00000819,0x00000007,0x0004003b,0x0000026b,
+0x00000837,0x00000007,0x0004003b,0x00000016,
+0x00000838,0x00000007,0x0004003b,0x0000000e,
+0x0000083a,0x00000007,0x0004003b,0x0000000e,
+0x0000083c,0x00000007,0x0004003b,0x0000000e,
+0x0000083e,0x00000007,0x0004003b,0x0000000f,
+0x00000841,0x00000007,0x0004003b,0x0000026b,
+0x00000859,0x00000007,0x0004003b,0x00000860,
+0x00000861,0x00000007,0x0004003b,0x0000000e,
+0x0000087b,0x00000007,0x0004003b,0x00000016,
+0x0000087c,0x00000007,0x0004003b,0x0000000e,
+0x0000087e,0x00000007,0x0004003b,0x0000000e,
+0x00000880,0x00000007,0x0004003b,0x0000000e,
+0x00000883,0x00000007,0x0004003b,0x00000889,
+0x0000088a,0x00000007,0x0004003b,0x00000889,
+0x00000892,0x00000007,0x0004003b,0x0000000e,
+0x000008aa,0x00000007,0x0004003b,0x0000000e,
+0x000008b9,0x00000007,0x0004003b,0x0000000e,
+0x000008ba,0x00000007,0x0004003b,0x0000000e,
+0x000008bc,0x00000007,0x0004003b,0x0000000e,
+0x000008be,0x00000007,0x0004003b,0x0000000e,
+0x000008c0,0x00000007,0x0004003b,0x0000000e,
+0x000008c4,0x00000007,0x0004003b,0x00000016,
+0x000008c9,0x00000007,0x0004003b,0x0000000e,
+0x000008d4,0x00000007,0x0004003b,0x0000000e,
+0x000008d9,0x00000007,0x0004003b,0x0000000e,
+0x000008dc,0x00000007,0x0004003b,0x00000810,
+0x000008e3,0x00000007,0x0004003b,0x0000000e,
+0x000008e7,0x00000007,0x0004003b,0x0000000e,
+0x000008f3,0x00000007,0x0004003b,0x0000000e,
+0x000008fe,0x00000007,0x0004003b,0x00000016,
+0x00000901,0x00000007,0x0004003b,0x0000000e,
+0x00000903,0x00000007,0x0004003b,0x0000000f,
+0x00000905,0x00000007,0x0004003b,0x0000000e,
+0x00000907,0x00000007,0x0004003b,0x0000000f,
+0x00000909,0x00000007,0x0004003b,0x0000000e,
+0x0000090c,0x00000007,0x0004003b,0x0000000f,
+0x0000090e,0x00000007,0x0004003b,0x0000000e,
+0x00000910,0x00000007,0x0004003b,0x0000000f,
+0x00000912,0x00000007,0x0004003b,0x0000000e,
+0x00000917,0x00000007,0x0004003b,0x00000016,
+0x00000918,0x00000007,0x0004003b,0x0000000e,
+0x00000919,0x00000007,0x0004003b,0x0000000e,
+0x0000091b,0x00000007,0x0004003b,0x0000000e,
+0x0000091e,0x00000007,0x0004003b,0x00000810,
+0x00000922,0x00000007,0x0004003b,0x0000000e,
+0x00000925,0x00000007,0x0004003b,0x0000000e,
+0x00000940,0x00000007,0x0004003b,0x0000000e,
+0x00000941,0x00000007,0x0004003b,0x0000000e,
+0x0000094b,0x00000007,0x0004003b,0x0000000e,
+0x00000953,0x00000007,0x0004003b,0x0000000e,
+0x00000959,0x00000007,0x0004003b,0x0000000e,
+0x00000963,0x00000007,0x0004003b,0x0000000e,
+0x00000964,0x00000007,0x0004003b,0x0000000e,
+0x00000965,0x00000007,0x0004003b,0x0000000e,
+0x00000966,0x00000007,0x0004003b,0x00000978,
+0x00000979,0x00000007,0x0004003b,0x00000978,
+0x0000097d,0x00000007,0x0004003b,0x00000978,
+0x00000981,0x00000007,0x0004003b,0x0000000e,
+0x00000984,0x00000007,0x0004003b,0x0000000e,
+0x00000986,0x00000007,0x0004003b,0x0000000e,
+0x00000988,0x00000007,0x0004003b,0x0000000e,
+0x0000098a,0x00000007,0x0004003b,0x0000000e,
+0x0000099a,0x00000007,0x0004003b,0x0000000e,
+0x0000099b,0x00000007,0x0004003b,0x0000000e,
+0x0000099d,0x00000007,0x0004003b,0x0000000e,
+0x0000099f,0x00000007,0x0004003b,0x0000000e,
+0x000009a1,0x00000007,0x0004003b,0x0000000e,
+0x000009a4,0x00000007,0x0004003b,0x0000000e,
+0x000009a8,0x00000007,0x0004003b,0x0000000e,
+0x000009a9,0x00000007,0x0004003b,0x0000000e,
+0x000009aa,0x00000007,0x0004003b,0x0000000e,
+0x000009ac,0x00000007,0x0004003b,0x0000000e,
+0x000009ae,0x00000007,0x0004003b,0x0000000e,
+0x000009b0,0x00000007,0x0004003b,0x0000000e,
+0x000009b1,0x00000007,0x0004003b,0x0000000e,
+0x000009b5,0x00000007,0x0004003b,0x0000000e,
+0x000009b7,0x00000007,0x0004003b,0x00000112,
+0x000009c4,0x00000007,0x0004003b,0x00000016,
+0x000009c5,0x00000007,0x0004003b,0x0000000e,
+0x000009c6,0x00000007,0x0004003b,0x0000000e,
+0x000009c8,0x00000007,0x0004003b,0x0000000e,
+0x000009ca,0x00000007,0x0004003b,0x0000000f,
+0x000009cd,0x00000007,0x0004003b,0x0000036d,
+0x000009d5,0x00000007,0x0004003b,0x00000a8c,
+0x00000a8d,0x00000007,0x0004003b,0x00000a94,
+0x00000a95,0x00000007,0x0004003b,0x0000026b,
+0x00000aa8,0x00000007,0x0004003b,0x00000016,
+0x00000aa9,0x00000007,0x0004003b,0x0000000e,
+0x00000aaa,0x00000007,0x0004003b,0x0000000e,
+0x00000aac,0x00000007,0x0004003b,0x0000000e,
+0x00000aae,0x00000007,0x0004003b,0x0000000f,
+0x00000ab1,0x00000007,0x0004003b,0x00000889,
+0x00000ac6,0x00000007,0x0004003b,0x00000acd,
+0x00000ace,0x00000007,0x0004003b,0x0000000e,
+0x00000add,0x00000007,0x0004003b,0x00000016,
+0x00000ade,0x00000007,0x0004003b,0x0000000e,
+0x00000adf,0x00000007,0x0004003b,0x0000000e,
+0x00000ae1,0x00000007,0x0004003b,0x0000000e,
+0x00000ae4,0x00000007,0x0004003b,0x00000aea,
+0x00000aeb,0x00000007,0x0004003b,0x00000aea,
+0x00000af3,0x00000007,0x0004003b,0x0000000e,
+0x00000b00,0x00000007,0x0004003b,0x0000000e,
+0x00000b01,0x00000007,0x0004003b,0x00000b0e,
+0x00000b0f,0x00000007,0x0004003b,0x0000000e,
+0x00000b12,0x00000007,0x0004003b,0x0000000e,
+0x00000b14,0x00000007,0x0004003b,0x00000016,
+0x00000b17,0x00000007,0x0004003b,0x00000016,
+0x00000b18,0x00000007,0x0004003b,0x0000000e,
+0x00000b1f,0x00000007,0x0004003b,0x00000b27,
+0x00000b28,0x00000007,0x0004003b,0x0000000e,
+0x00000b35,0x00000007,0x0004003b,0x0000000e,
+0x00000b38,0x00000007,0x0004003b,0x0000000e,
+0x00000b42,0x00000007,0x0004003b,0x0000000e,
+0x00000b4c,0x00000007,0x0004003b,0x0000000e,
+0x00000b51,0x00000007,0x0004003b,0x0000000e,
+0x00000b52,0x00000007,0x0004003b,0x0000000e,
+0x00000b54,0x00000007,0x0004003b,0x0000000e,
+0x00000b56,0x00000007,0x0004003b,0x00000b60,
+0x00000b61,0x00000007,0x0004003b,0x00000696,
+0x00000b67,0x00000007,0x0004003b,0x00000b27,
+0x00000b70,0x00000007,0x0004003b,0x00000b27,
+0x00000b74,0x00000007,0x0004003b,0x00000b27,
+0x00000b78,0x00000007,0x0004003b,0x00000b27,
+0x00000b85,0x00000007,0x0004003b,0x00000b27,
+0x00000b89,0x00000007,0x0004003b,0x0000000e,
+0x00000b8d,0x00000007,0x0004003b,0x00000b27,
+0x00000b95,0x00000007,0x0004003b,0x00000b27,
+0x00000ba2,0x00000007,0x0004003b,0x00000b27,
+0x00000bb1,0x00000007,0x0004003b,0x00000b27,
+0x00000bc2,0x00000007,0x0004003b,0x0000000e,
+0x00000bd5,0x00000007,0x0004003b,0x0000000e,
+0x00000bdd,0x00000007,0x0004003b,0x0000000e,
+0x00000be2,0x00000007,0x0004003b,0x0000000e,
+0x00000be7,0x00000007,0x0004003b,0x00000b27,
+0x00000bf0,0x00000007,0x0004003b,0x00000016,
+0x00000c08,0x00000007,0x0004003b,0x00000016,
+0x00000c0c,0x00000007,0x0004003b,0x00000016,
+0x00000c10,0x00000007,0x0004003b,0x0000000e,
+0x00000c25,0x00000007,0x0004003b,0x00000016,
+0x00000c26,0x00000007,0x0004003b,0x0000000e,
+0x00000c27,0x00000007,0x0004003b,0x0000000e,
+0x00000c29,0x00000007,0x00050051,0x0000000d,
+0x000006b0,0x00000076,0x00000003,0x0003003e,
+0x000006af,0x000006b0,0x0004003d,0x0000000d,
+0x000006b2,0x000006af,0x000500c2,0x0000000d,
+0x000006b3,0x000006b2,0x00000525,0x000500c7,
+0x0000000d,0x000006b4,0x000006b3,0x0000003c,
+0x0003003e,0x000006b1,0x000006b4,0x0004003d,
+0x0000000d,0x000006b6,0x000006af,0x000500c2,
+0x0000000d,0x000006b7,0x000006b6,0x00000110,
+0x000500c7,0x0000000d,0x000006b8,0x000006b7,
+0x0000003c,0x0003003e,0x000006b5,0x000006b8,
+0x0004003d,0x0000000d,0x000006ba,0x000006af,
+0x000500c2,0x0000000d,0x000006bb,0x000006ba,
+0x00000124,0x000500c7,0x0000000d,0x000006bc,
+0x000006bb,0x0000003c,0x0003003e,0x000006b9,
+0x000006bc,0x0004003d,0x0000000d,0x000006be,
+0x000006b5,0x0003003e,0x000006bd,0x000006be,
+0x0004003d,0x0000000d,0x000006c0,0x000006b1,
+0x0003003e,0x000006bf,0x000006c0,0x0004003d,
+0x0000000d,0x000006c3,0x000006af,0x0003003e,
+0x000006c2,0x000006c3,0x0003003e,0x000006c4,
+0x0000062b,0x00060039,0x0000000d,0x000006c5,
+0x00000013,0x000006c2,0x000006c4,0x0003003e,
+0x000006c1,0x000006c5,0x0004003d,0x0000000d,
+0x000006c9,0x000006af,0x0003003e,0x000006c8,
+0x000006c9,0x0003003e,0x000006ca,0x000006c7,
+0x00060039,0x0000000d,0x000006cb,0x00000013,
+0x000006c8,0x000006ca,0x0003003e,0x000006c6,
+0x000006cb,0x0004003d,0x0000000d,0x000006cc,
+0x000006af,0x000500c7,0x0000000d,0x000006cd,
+0x000006cc,0x0000003c,0x000500aa,0x00000099,
+0x000006ce,0x000006cd,0x000000c9,0x000300f7,
+0x000006d0,0x00000000,0x000400fa,0x000006ce,
+0x000006cf,0x0000071d,0x000200f8,0x000006cf,
+0x0004003d,0x0000000d,0x000006d2,0x000006b9,
+0x000500c4,0x0000000d,0x000006d3,0x000006d2,
+0x0000008e,0x0004003d,0x0000000d,0x000006d5,
+0x000006af,0x0003003e,0x000006d4,0x000006d5,
+0x0003003e,0x000006d6,0x0000052a,0x00060039,
+0x0000000d,0x000006d7,0x00000013,0x000006d4,
+0x000006d6,0x000500c5,0x0000000d,0x000006d8,
+0x000006d3,0x000006d7,0x0003003e,0x000006d1,
+0x000006d8,0x0004003d,0x0000000d,0x000006d9,
+0x000006b1,0x000500aa,0x00000099,0x000006da,
+0x000006d9,0x000000c9,0x000300f7,0x000006dc,
+0x00000000,0x000400fa,0x000006da,0x000006db,
+0x000006e2,0x000200f8,0x000006db,0x0003003e,
+0x000006dd,0x000006de,0x0004003d,0x0000000d,
+0x000006e0,0x000006bd,0x00050080,0x0000000d,
+0x000006e1,0x000006e0,0x000000e7,0x0003003e,
+0x000006df,0x000006e1,0x000200f9,0x000006dc,
+0x000200f8,0x000006e2,0x0004003d,0x0000000d,
+0x000006e3,0x000006b1,0x000500aa,0x00000099,
+0x000006e4,0x000006e3,0x00000082,0x000300f7,
+0x000006e6,0x00000000,0x000400fa,0x000006e4,
+0x000006e5,0x000006e9,0x000200f8,0x000006e5,
+0x0004003d,0x0000000d,0x000006e7,0x000006bd,
+0x00050080,0x0000000d,0x000006e8,0x000006e7,
+0x000000e7,0x0003003e,0x000006dd,0x000006e8,
+0x0003003e,0x000006df,0x000006de,0x000200f9,
+0x000006e6,0x000200f8,0x000006e9,0x0004003d,
+0x0000000d,0x000006ea,0x000006b1,0x000500aa,
+0x00000099,0x000006eb,0x000006ea,0x0000003c,
+0x000300f7,0x000006ed,0x00000000,0x000400fa,
+0x000006eb,0x000006ec,0x00000715,0x000200f8,
+0x000006ec,0x0004003d,0x0000000d,0x000006ee,
+0x000006b5,0x000500aa,0x00000099,0x000006ef,
+0x000006ee,0x000000c9,0x000300f7,0x000006f1,
+0x00000000,0x000400fa,0x000006ef,0x000006f0,
+0x000006f3,0x000200f8,0x000006f0,0x0003003e,
+0x000006dd,0x00000397,0x0003003e,0x000006df,
+0x000006f2,0x000200f9,0x000006f1,0x000200f8,
+0x000006f3,0x0004003d,0x0000000d,0x000006f4,
+0x000006b5,0x000500aa,0x00000099,0x000006f5,
+0x000006f4,0x00000082,0x000300f7,0x000006f7,
+0x00000000,0x000400fa,0x000006f5,0x000006f6,
+0x000006f8,0x000200f8,0x000006f6,0x0003003e,
+0x000006dd,0x000006f2,0x0003003e,0x000006df,
+0x00000397,0x000200f9,0x000006f7,0x000200f8,
+0x000006f8,0x0004003d,0x0000000d,0x000006f9,
+0x000006af,0x000500c7,0x0000000d,0x000006fb,
+0x000006f9,0x000006fa,0x000500aa,0x00000099,
+0x000006fd,0x000006fb,0x000006fc,0x000300f7,
+0x000006ff,0x00000000,0x000400fa,0x000006fd,
+0x000006fe,0x00000712,0x000200f8,0x000006fe,
+0x00050051,0x0000000d,0x00000701,0x00000076,
+0x00000001,0x000500c2,0x0000000d,0x00000702,
+0x00000701,0x00000417,0x000500c7,0x0000000d,
+0x00000703,0x00000702,0x000006a9,0x00050051,
+0x0000000d,0x00000704,0x00000076,0x00000001,
+0x000500c2,0x0000000d,0x00000705,0x00000704,
+0x00000585,0x000500c7,0x0000000d,0x00000706,
+0x00000705,0x000006a9,0x00050051,0x0000000d,
+0x00000707,0x00000076,0x00000000,0x000500c2,
+0x0000000d,0x00000708,0x00000707,0x00000417,
+0x000500c7,0x0000000d,0x00000709,0x00000708,
+0x000006a9,0x00050051,0x0000000d,0x0000070a,
+0x00000076,0x00000000,0x000500c2,0x0000000d,
+0x0000070b,0x0000070a,0x00000585,0x000500c7,
+0x0000000d,0x0000070c,0x0000070b,0x000006a9,
+0x00070050,0x00000015,0x0000070d,0x00000703,
+0x00000706,0x00000709,0x0000070c,0x0003003e,
+0x00000700,0x0000070d,0x0004003d,0x00000015,
+0x0000070f,0x00000700,0x0003003e,0x0000070e,
+0x0000070f,0x00050039,0x0000006d,0x00000710,
+0x00000070,0x0000070e,0x000200fe,0x00000710,
+0x000200f8,0x00000712,0x00040039,0x0000006d,
+0x00000713,0x00000073,0x000200fe,0x00000713,
+0x000200f8,0x000006ff,0x000100ff,0x000200f8,
+0x000006f7,0x000200f9,0x000006f1,0x000200f8,
+0x000006f1,0x000200f9,0x000006ed,0x000200f8,
+0x00000715,0x0004003d,0x0000000d,0x00000716,
+0x000006af,0x000500c2,0x0000000d,0x00000717,
+0x00000716,0x000006c7,0x000500c7,0x0000000d,
+0x00000718,0x00000717,0x0000003c,0x0003003e,
+0x000006bf,0x00000718,0x0004003d,0x0000000d,
+0x00000719,0x000006bd,0x00050080,0x0000000d,
+0x0000071a,0x00000719,0x00000397,0x0003003e,
+0x000006dd,0x0000071a,0x0004003d,0x0000000d,
+0x0000071b,0x000006bf,0x00050080,0x0000000d,
+0x0000071c,0x0000071b,0x00000397,0x0003003e,
+0x000006df,0x0000071c,0x0003003e,0x000006c1,
+0x000000c9,0x0003003e,0x000006c6,0x000000c9,
+0x000200f9,0x000006ed,0x000200f8,0x000006ed,
+0x000200f9,0x000006e6,0x000200f8,0x000006e6,
+0x000200f9,0x000006dc,0x000200f8,0x000006dc,
+0x000200f9,0x000006d0,0x000200f8,0x0000071d,
+0x0004003d,0x0000000d,0x0000071e,0x000006af,
+0x000500c7,0x0000000d,0x0000071f,0x0000071e,
+0x0000003c,0x000500c4,0x0000000d,0x00000720,
+0x0000071f,0x0000008e,0x0004003d,0x0000000d,
+0x00000722,0x000006af,0x0003003e,0x00000721,
+0x00000722,0x0003003e,0x00000723,0x0000052a,
+0x00060039,0x0000000d,0x00000724,0x00000013,
+0x00000721,0x00000723,0x000500c5,0x0000000d,
+0x00000725,0x00000720,0x00000724,0x0003003e,
+0x000006d1,0x00000725,0x0004003d,0x0000000d,
+0x00000726,0x000006b9,0x000500aa,0x00000099,
+0x00000727,0x00000726,0x000000c9,0x000300f7,
+0x00000729,0x00000000,0x000400fa,0x00000727,
+0x00000728,0x0000072e,0x000200f8,0x00000728,
+0x0004003d,0x0000000d,0x0000072a,0x000006bf,
+0x00050080,0x0000000d,0x0000072b,0x0000072a,
+0x000000de,0x0003003e,0x000006dd,0x0000072b,
+0x0004003d,0x0000000d,0x0000072c,0x000006bd,
+0x00050080,0x0000000d,0x0000072d,0x0000072c,
+0x000000e7,0x0003003e,0x000006df,0x0000072d,
+0x000200f9,0x00000729,0x000200f8,0x0000072e,
+0x0004003d,0x0000000d,0x0000072f,0x000006b9,
+0x000500aa,0x00000099,0x00000730,0x0000072f,
+0x00000082,0x000300f7,0x00000732,0x00000000,
+0x000400fa,0x00000730,0x00000731,0x00000737,
+0x000200f8,0x00000731,0x0004003d,0x0000000d,
+0x00000733,0x000006bf,0x00050080,0x0000000d,
+0x00000734,0x00000733,0x000000da,0x0003003e,
+0x000006dd,0x00000734,0x0004003d,0x0000000d,
+0x00000735,0x000006bd,0x00050080,0x0000000d,
+0x00000736,0x00000735,0x000000e7,0x0003003e,
+0x000006df,0x00000736,0x000200f9,0x00000732,
+0x000200f8,0x00000737,0x0004003d,0x0000000d,
+0x00000738,0x000006b9,0x000500aa,0x00000099,
+0x00000739,0x00000738,0x000000e7,0x000300f7,
+0x0000073b,0x00000000,0x000400fa,0x00000739,
+0x0000073a,0x00000740,0x000200f8,0x0000073a,
+0x0004003d,0x0000000d,0x0000073c,0x000006bd,
+0x00050080,0x0000000d,0x0000073d,0x0000073c,
+0x000000e7,0x0003003e,0x000006dd,0x0000073d,
+0x0004003d,0x0000000d,0x0000073e,0x000006bf,
+0x00050080,0x0000000d,0x0000073f,0x0000073e,
+0x000000da,0x0003003e,0x000006df,0x0000073f,
+0x000200f9,0x0000073b,0x000200f8,0x00000740,
+0x0004003d,0x0000000d,0x00000742,0x000006af,
+0x0003003e,0x00000741,0x00000742,0x0003003e,
+0x00000743,0x00000417,0x00060039,0x0000000d,
+0x00000744,0x00000013,0x00000741,0x00000743,
+0x000500aa,0x00000099,0x00000745,0x00000744,
+0x000000c9,0x000300f7,0x00000747,0x00000000,
+0x000400fa,0x00000745,0x00000746,0x0000074d,
+0x000200f8,0x00000746,0x0004003d,0x0000000d,
+0x00000748,0x000006bd,0x00050080,0x0000000d,
+0x00000749,0x00000748,0x000000e7,0x0003003e,
+0x000006dd,0x00000749,0x0004003d,0x0000000d,
+0x0000074a,0x000006bf,0x000500c7,0x0000000d,
+0x0000074b,0x0000074a,0x00000082,0x00050080,
+0x0000000d,0x0000074c,0x0000074b,0x00000397,
+0x0003003e,0x000006df,0x0000074c,0x000200f9,
+0x00000747,0x000200f8,0x0000074d,0x0004003d,
+0x0000000d,0x0000074e,0x000006bf,0x000500c7,
+0x0000000d,0x0000074f,0x0000074e,0x00000082,
+0x00050080,0x0000000d,0x00000750,0x0000074f,
+0x000000e7,0x0003003e,0x000006dd,0x00000750,
+0x0004003d,0x0000000d,0x00000751,0x000006bd,
+0x00050080,0x0000000d,0x00000752,0x00000751,
+0x000000e7,0x0003003e,0x000006df,0x00000752,
+0x000200f9,0x00000747,0x000200f8,0x00000747,
+0x000200f9,0x0000073b,0x000200f8,0x0000073b,
+0x000200f9,0x00000732,0x000200f8,0x00000732,
+0x000200f9,0x00000729,0x000200f8,0x00000729,
+0x000200f9,0x000006d0,0x000200f8,0x000006d0,
+0x0004003d,0x0000000d,0x00000753,0x000006dd,
+0x00060041,0x00000555,0x00000754,0x00000554,
+0x00000109,0x000000c9,0x0004003d,0x0000000d,
+0x00000755,0x00000754,0x000500ac,0x00000099,
+0x00000756,0x00000753,0x00000755,0x000400a8,
+0x00000099,0x00000757,0x00000756,0x000300f7,
+0x00000759,0x00000000,0x000400fa,0x00000757,
+0x00000758,0x00000759,0x000200f8,0x00000758,
+0x0004003d,0x0000000d,0x0000075a,0x000006df,
+0x00060041,0x00000555,0x0000075b,0x00000554,
+0x00000109,0x00000082,0x0004003d,0x0000000d,
+0x0000075c,0x0000075b,0x000500ac,0x00000099,
+0x0000075d,0x0000075a,0x0000075c,0x000200f9,
+0x00000759,0x000200f8,0x00000759,0x000700f5,
+0x00000099,0x0000075e,0x00000756,0x000006d0,
+0x0000075d,0x00000758,0x000300f7,0x00000760,
+0x00000000,0x000400fa,0x0000075e,0x0000075f,
+0x00000760,0x000200f8,0x0000075f,0x00040039,
+0x0000006d,0x00000761,0x00000073,0x000200fe,
+0x00000761,0x000200f8,0x00000760,0x0003003e,
+0x00000763,0x000000c9,0x0003003e,0x00000764,
+0x000000c9,0x0003003e,0x00000765,0x000000c9,
+0x0004003d,0x0000000d,0x00000767,0x000006df,
+0x0004003d,0x0000000d,0x00000768,0x000006dd,
+0x00050084,0x0000000d,0x00000769,0x00000767,
+0x00000768,0x0004003d,0x0000000d,0x0000076a,
+0x000006c1,0x00050080,0x0000000d,0x0000076b,
+0x0000076a,0x00000082,0x00050084,0x0000000d,
+0x0000076c,0x00000769,0x0000076b,0x0003003e,
+0x00000766,0x0000076c,0x0004003d,0x0000000d,
+0x0000076e,0x00000766,0x000500b0,0x00000099,
+0x0000076f,0x0000076d,0x0000076e,0x000300f7,
+0x00000771,0x00000000,0x000400fa,0x0000076f,
+0x00000770,0x00000771,0x000200f8,0x00000770,
+0x00040039,0x0000006d,0x00000772,0x00000073,
+0x000200fe,0x00000772,0x000200f8,0x00000771,
+0x0004003d,0x0000000d,0x00000774,0x000006c6,
+0x000500aa,0x00000099,0x00000775,0x00000774,
+0x000000c9,0x000300f7,0x00000777,0x00000000,
+0x000400fa,0x00000775,0x00000776,0x0000078a,
+0x000200f8,0x00000776,0x0004003d,0x0000000d,
+0x00000778,0x000006d1,0x000300f7,0x00000780,
+0x00000000,0x000f00fb,0x00000778,0x0000077f,
+0x00000002,0x00000779,0x00000003,0x0000077a,
+0x00000004,0x0000077b,0x00000005,0x0000077c,
+0x00000006,0x0000077d,0x00000007,0x0000077e,
+0x000200f8,0x0000077f,0x00040039,0x0000006d,
+0x00000787,0x00000073,0x000200fe,0x00000787,
+0x000200f8,0x00000779,0x0003003e,0x00000765,
+0x00000082,0x000200f9,0x00000780,0x000200f8,
+0x0000077a,0x0003003e,0x00000763,0x00000082,
+0x000200f9,0x00000780,0x000200f8,0x0000077b,
+0x0003003e,0x00000765,0x000000e7,0x000200f9,
+0x00000780,0x000200f8,0x0000077c,0x0003003e,
+0x00000764,0x00000082,0x000200f9,0x00000780,
+0x000200f8,0x0000077d,0x0003003e,0x00000763,
+0x00000082,0x0003003e,0x00000765,0x00000082,
+0x000200f9,0x00000780,0x000200f8,0x0000077e,
+0x0003003e,0x00000765,0x0000003c,0x000200f9,
+0x00000780,0x000200f8,0x00000780,0x000200f9,
+0x00000777,0x000200f8,0x0000078a,0x0004003d,
+0x0000000d,0x0000078b,0x000006d1,0x000300f7,
+0x00000793,0x00000000,0x000f00fb,0x0000078b,
+0x00000792,0x00000002,0x0000078c,0x00000003,
+0x0000078d,0x00000004,0x0000078e,0x00000005,
+0x0000078f,0x00000006,0x00000790,0x00000007,
+0x00000791,0x000200f8,0x00000792,0x00040039,
+0x0000006d,0x0000079a,0x00000073,0x000200fe,
+0x0000079a,0x000200f8,0x0000078c,0x0003003e,
+0x00000765,0x00000082,0x0003003e,0x00000764,
+0x00000082,0x000200f9,0x00000793,0x000200f8,
+0x0000078d,0x0003003e,0x00000763,0x00000082,
+0x0003003e,0x00000765,0x000000e7,0x000200f9,
+0x00000793,0x000200f8,0x0000078e,0x0003003e,
+0x00000765,0x000000de,0x000200f9,0x00000793,
+0x000200f8,0x0000078f,0x0003003e,0x00000764,
+0x00000082,0x0003003e,0x00000765,0x000000e7,
+0x000200f9,0x00000793,0x000200f8,0x00000790,
+0x0003003e,0x00000763,0x00000082,0x0003003e,
+0x00000765,0x0000003c,0x000200f9,0x00000793,
+0x000200f8,0x00000791,0x0003003e,0x00000765,
+0x00000033,0x000200f9,0x00000793,0x000200f8,
+0x00000793,0x000200f9,0x00000777,0x000200f8,
+0x00000777,0x0003003e,0x0000079d,0x000000c9,
+0x0003003e,0x0000079e,0x000000c9,0x0004003d,
+0x0000000d,0x000007a0,0x00000763,0x0003003e,
+0x0000079f,0x000007a0,0x0004003d,0x0000000d,
+0x000007a2,0x00000764,0x0003003e,0x000007a1,
+0x000007a2,0x0004003d,0x0000000d,0x000007a4,
+0x00000765,0x0003003e,0x000007a3,0x000007a4,
+0x00090039,0x00000002,0x000007a7,0x00000031,
+0x0000079f,0x000007a1,0x000007a3,0x000007a5,
+0x000007a6,0x0004003d,0x0000000d,0x000007a8,
+0x000007a5,0x0003003e,0x0000079e,0x000007a8,
+0x0004003d,0x0000000d,0x000007a9,0x000007a6,
+0x0003003e,0x0000079d,0x000007a9,0x0003003e,
+0x000007aa,0x000000c9,0x0003003e,0x000007ab,
+0x000000c9,0x000400cc,0x00000015,0x000007ad,
+0x00000076,0x0003003e,0x000007ac,0x000007ad,
+0x0004003d,0x0000000d,0x000007b0,0x00000766,
+0x0003003e,0x000007af,0x000007b0,0x0004003d,
+0x0000000d,0x000007b2,0x00000763,0x0003003e,
+0x000007b1,0x000007b2,0x0004003d,0x0000000d,
+0x000007b4,0x00000764,0x0003003e,0x000007b3,
+0x000007b4,0x0004003d,0x0000000d,0x000007b6,
+0x00000765,0x0003003e,0x000007b5,0x000007b6,
+0x00080039,0x0000000d,0x000007b7,0x00000029,
+0x000007af,0x000007b1,0x000007b3,0x000007b5,
+0x0003003e,0x000007ae,0x000007b7,0x0004003d,
+0x0000000d,0x000007b8,0x000007ae,0x000500b0,
+0x00000099,0x000007ba,0x000007b8,0x000007b9,
+0x0004003d,0x0000000d,0x000007bb,0x000007ae,
+0x000500ac,0x00000099,0x000007bd,0x000007bb,
+0x000007bc,0x000500a6,0x00000099,0x000007be,
+0x000007ba,0x000007bd,0x000300f7,0x000007c0,
+0x00000000,0x000400fa,0x000007be,0x000007bf,
+0x000007c0,0x000200f8,0x000007bf,0x00040039,
+0x0000006d,0x000007c1,0x00000073,0x000200fe,
+0x000007c1,0x000200f8,0x000007c0,0x00050041,
+0x0000000e,0x000007c3,0x000007ac,0x0000003c,
+0x0004003d,0x0000000d,0x000007c4,0x000007c3,
+0x00050041,0x0000000e,0x000007c5,0x000007ac,
+0x000000e7,0x0004003d,0x0000000d,0x000007c6,
+0x000007c5,0x00050041,0x0000000e,0x000007c7,
+0x000007ac,0x00000082,0x0004003d,0x0000000d,
+0x000007c8,0x000007c7,0x00050041,0x0000000e,
+0x000007c9,0x000007ac,0x000000c9,0x0004003d,
+0x0000000d,0x000007ca,0x000007c9,0x00070050,
+0x00000015,0x000007cb,0x000007c4,0x000007c6,
+0x000007c8,0x000007ca,0x0003003e,0x000007ac,
+0x000007cb,0x000200f9,0x000007cc,0x000200f8,
+0x000007cc,0x000400f6,0x000007ce,0x000007cf,
+0x00000000,0x000200f9,0x000007d0,0x000200f8,
+0x000007d0,0x0004003d,0x0000000d,0x000007d1,
+0x000007ab,0x0004003d,0x0000000d,0x000007d2,
+0x00000766,0x000500b0,0x00000099,0x000007d3,
+0x000007d1,0x000007d2,0x000400fa,0x000007d3,
+0x000007cd,0x000007ce,0x000200f8,0x000007cd,
+0x0004003d,0x0000000d,0x000007d4,0x00000763,
+0x000500aa,0x00000099,0x000007d5,0x000007d4,
+0x00000082,0x000300f7,0x000007d7,0x00000000,
+0x000400fa,0x000007d5,0x000007d6,0x00000832,
+0x000200f8,0x000007d6,0x0004003d,0x00000015,
+0x000007da,0x000007ac,0x0003003e,0x000007d9,
+0x000007da,0x0004003d,0x0000000d,0x000007dc,
+0x000007aa,0x0003003e,0x000007db,0x000007dc,
+0x0004003d,0x0000000d,0x000007de,0x000007ae,
+0x0003003e,0x000007dd,0x000007de,0x0004003d,
+0x0000000d,0x000007e0,0x00000765,0x0003003e,
+0x000007df,0x000007e0,0x00080039,0x00000034,
+0x000007e1,0x0000003a,0x000007d9,0x000007db,
+0x000007dd,0x000007df,0x0003003e,0x000007d8,
+0x000007e1,0x0003003e,0x000007e2,0x00000109,
+0x000200f9,0x000007e3,0x000200f8,0x000007e3,
+0x000400f6,0x000007e5,0x000007e6,0x00000000,
+0x000200f9,0x000007e7,0x000200f8,0x000007e7,
+0x0004003d,0x00000006,0x000007e8,0x000007e2,
+0x000500b1,0x00000099,0x000007e9,0x000007e8,
+0x00000110,0x000400fa,0x000007e9,0x000007e4,
+0x000007e5,0x000200f8,0x000007e4,0x0004003d,
+0x0000000d,0x000007ee,0x000007ab,0x0004003d,
+0x0000000d,0x0000080f,0x00000765,0x0003003e,
+0x00000811,0x0000080e,0x00050041,0x0000000e,
+0x00000812,0x00000811,0x0000080f,0x0004003d,
+0x0000000d,0x00000813,0x00000812,0x0004003d,
+0x00000006,0x00000814,0x000007e2,0x00050041,
+0x0000000e,0x00000815,0x000007d8,0x00000814,
+0x0004003d,0x0000000d,0x00000816,0x00000815,
+0x00050080,0x0000000d,0x00000817,0x00000813,
+0x00000816,0x0003003e,0x00000819,0x0000080a,
+0x00050041,0x0000000e,0x0000081a,0x00000819,
+0x00000817,0x0004003d,0x0000000d,0x0000081b,
+0x0000081a,0x00050041,0x0000000e,0x0000081c,
+0x000007ed,0x000007ee,0x0003003e,0x0000081c,
+0x0000081b,0x0004003d,0x0000000d,0x0000081d,
+0x000007ab,0x00050041,0x0000000e,0x0000081e,
+0x000007ed,0x0000081d,0x0004003d,0x0000000d,
+0x0000081f,0x0000081e,0x000500ac,0x00000099,
+0x00000820,0x0000081f,0x00000088,0x000300f7,
+0x00000822,0x00000000,0x000400fa,0x00000820,
+0x00000821,0x00000822,0x000200f8,0x00000821,
+0x0004003d,0x0000000d,0x00000823,0x000007ab,
+0x00050041,0x0000000e,0x00000824,0x000007ed,
+0x00000823,0x0004003d,0x0000000d,0x00000825,
+0x00000824,0x00050080,0x0000000d,0x00000826,
+0x00000825,0x00000082,0x00050041,0x0000000e,
+0x00000827,0x000007ed,0x00000823,0x0003003e,
+0x00000827,0x00000826,0x000200f9,0x00000822,
+0x000200f8,0x00000822,0x0004003d,0x0000000d,
+0x00000828,0x000007ab,0x00050080,0x0000000d,
+0x00000829,0x00000828,0x0000008e,0x0003003e,
+0x000007ab,0x00000829,0x0004003d,0x0000000d,
+0x0000082a,0x000007ab,0x0004003d,0x0000000d,
+0x0000082b,0x00000766,0x000500ae,0x00000099,
+0x0000082c,0x0000082a,0x0000082b,0x000300f7,
+0x0000082e,0x00000000,0x000400fa,0x0000082c,
+0x0000082d,0x0000082e,0x000200f8,0x0000082d,
+0x000200f9,0x000007e5,0x000200f8,0x0000082e,
+0x000200f9,0x000007e6,0x000200f8,0x000007e6,
+0x0004003d,0x00000006,0x00000830,0x000007e2,
+0x00050080,0x00000006,0x00000831,0x00000830,
+0x0000008e,0x0003003e,0x000007e2,0x00000831,
+0x000200f9,0x000007e3,0x000200f8,0x000007e5,
+0x000200f9,0x000007d7,0x000200f8,0x00000832,
+0x0004003d,0x0000000d,0x00000833,0x00000764,
+0x000500aa,0x00000099,0x00000834,0x00000833,
+0x00000082,0x000300f7,0x00000836,0x00000000,
+0x000400fa,0x00000834,0x00000835,0x0000087a,
+0x000200f8,0x00000835,0x0004003d,0x00000015,
+0x00000839,0x000007ac,0x0003003e,0x00000838,
+0x00000839,0x0004003d,0x0000000d,0x0000083b,
+0x000007aa,0x0003003e,0x0000083a,0x0000083b,
+0x0004003d,0x0000000d,0x0000083d,0x000007ae,
+0x0003003e,0x0000083c,0x0000083d,0x0004003d,
+0x0000000d,0x0000083f,0x00000765,0x0003003e,
+0x0000083e,0x0000083f,0x00080039,0x0000003d,
+0x00000840,0x00000043,0x00000838,0x0000083a,
+0x0000083c,0x0000083e,0x0003003e,0x00000837,
+0x00000840,0x0003003e,0x00000841,0x00000109,
+0x000200f9,0x00000842,0x000200f8,0x00000842,
+0x000400f6,0x00000844,0x00000845,0x00000000,
+0x000200f9,0x00000846,0x000200f8,0x00000846,
+0x0004003d,0x00000006,0x00000847,0x00000841,
+0x000500b1,0x00000099,0x00000848,0x00000847,
+0x00000269,0x000400fa,0x00000848,0x00000843,
+0x00000844,0x000200f8,0x00000843,0x0004003d,
+0x0000000d,0x00000849,0x000007ab,0x0004003d,
+0x0000000d,0x00000858,0x00000765,0x0003003e,
+0x00000859,0x00000857,0x00050041,0x0000000e,
+0x0000085a,0x00000859,0x00000858,0x0004003d,
+0x0000000d,0x0000085b,0x0000085a,0x0004003d,
+0x00000006,0x0000085c,0x00000841,0x00050041,
+0x0000000e,0x0000085d,0x00000837,0x0000085c,
+0x0004003d,0x0000000d,0x0000085e,0x0000085d,
+0x00050080,0x0000000d,0x0000085f,0x0000085b,
+0x0000085e,0x0003003e,0x00000861,0x00000856,
+0x00050041,0x0000000e,0x00000862,0x00000861,
+0x0000085f,0x0004003d,0x0000000d,0x00000863,
+0x00000862,0x00050041,0x0000000e,0x00000864,
+0x000007ed,0x00000849,0x0003003e,0x00000864,
+0x00000863,0x0004003d,0x0000000d,0x00000865,
+0x000007ab,0x00050041,0x0000000e,0x00000866,
+0x000007ed,0x00000865,0x0004003d,0x0000000d,
+0x00000867,0x00000866,0x000500ac,0x00000099,
+0x00000868,0x00000867,0x00000088,0x000300f7,
+0x0000086a,0x00000000,0x000400fa,0x00000868,
+0x00000869,0x0000086a,0x000200f8,0x00000869,
+0x0004003d,0x0000000d,0x0000086b,0x000007ab,
+0x00050041,0x0000000e,0x0000086c,0x000007ed,
+0x0000086b,0x0004003d,0x0000000d,0x0000086d,
+0x0000086c,0x00050080,0x0000000d,0x0000086e,
+0x0000086d,0x00000082,0x00050041,0x0000000e,
+0x0000086f,0x000007ed,0x0000086b,0x0003003e,
+0x0000086f,0x0000086e,0x000200f9,0x0000086a,
+0x000200f8,0x0000086a,0x0004003d,0x0000000d,
+0x00000870,0x000007ab,0x00050080,0x0000000d,
+0x00000871,0x00000870,0x0000008e,0x0003003e,
+0x000007ab,0x00000871,0x0004003d,0x0000000d,
+0x00000872,0x000007ab,0x0004003d,0x0000000d,
+0x00000873,0x00000766,0x000500ae,0x00000099,
+0x00000874,0x00000872,0x00000873,0x000300f7,
+0x00000876,0x00000000,0x000400fa,0x00000874,
+0x00000875,0x00000876,0x000200f8,0x00000875,
+0x000200f9,0x00000844,0x000200f8,0x00000876,
+0x000200f9,0x00000845,0x000200f8,0x00000845,
+0x0004003d,0x00000006,0x00000878,0x00000841,
+0x00050080,0x00000006,0x00000879,0x00000878,
+0x0000008e,0x0003003e,0x00000841,0x00000879,
+0x000200f9,0x00000842,0x000200f8,0x00000844,
+0x000200f9,0x00000836,0x000200f8,0x0000087a,
+0x0004003d,0x00000015,0x0000087d,0x000007ac,
+0x0003003e,0x0000087c,0x0000087d,0x0004003d,
+0x0000000d,0x0000087f,0x000007aa,0x0003003e,
+0x0000087e,0x0000087f,0x0004003d,0x0000000d,
+0x00000881,0x0000079d,0x0003003e,0x00000880,
+0x00000881,0x00070039,0x0000000d,0x00000882,
+0x0000001b,0x0000087c,0x0000087e,0x00000880,
+0x0003003e,0x0000087b,0x00000882,0x0004003d,
+0x0000000d,0x00000884,0x0000087b,0x0004003d,
+0x0000000d,0x00000887,0x00000765,0x00050082,
+0x0000000d,0x00000888,0x00000887,0x00000082,
+0x0003003e,0x0000088a,0x00000886,0x00050041,
+0x0000000e,0x0000088b,0x0000088a,0x00000888,
+0x0004003d,0x0000000d,0x0000088c,0x0000088b,
+0x00050084,0x0000000d,0x0000088d,0x00000884,
+0x0000088c,0x0004003d,0x0000000d,0x0000088e,
+0x0000087b,0x0004003d,0x0000000d,0x00000890,
+0x00000765,0x00050082,0x0000000d,0x00000891,
+0x00000890,0x00000082,0x0003003e,0x00000892,
+0x0000088f,0x00050041,0x0000000e,0x00000893,
+0x00000892,0x00000891,0x0004003d,0x0000000d,
+0x00000894,0x00000893,0x000500c2,0x0000000d,
+0x00000895,0x0000088e,0x00000894,0x000500c5,
+0x0000000d,0x00000896,0x0000088d,0x00000895,
+0x0003003e,0x00000883,0x00000896,0x0004003d,
+0x0000000d,0x00000897,0x000007ab,0x0004003d,
+0x0000000d,0x00000898,0x00000883,0x00050041,
+0x0000000e,0x00000899,0x000007ed,0x00000897,
+0x0003003e,0x00000899,0x00000898,0x0004003d,
+0x0000000d,0x0000089a,0x000007ab,0x00050041,
+0x0000000e,0x0000089b,0x000007ed,0x0000089a,
+0x0004003d,0x0000000d,0x0000089c,0x0000089b,
+0x000500ac,0x00000099,0x0000089d,0x0000089c,
+0x00000088,0x000300f7,0x0000089f,0x00000000,
+0x000400fa,0x0000089d,0x0000089e,0x0000089f,
+0x000200f8,0x0000089e,0x0004003d,0x0000000d,
+0x000008a0,0x000007ab,0x00050041,0x0000000e,
+0x000008a1,0x000007ed,0x000008a0,0x0004003d,
+0x0000000d,0x000008a2,0x000008a1,0x00050080,
+0x0000000d,0x000008a3,0x000008a2,0x00000082,
+0x00050041,0x0000000e,0x000008a4,0x000007ed,
+0x000008a0,0x0003003e,0x000008a4,0x000008a3,
+0x000200f9,0x0000089f,0x000200f8,0x0000089f,
+0x0004003d,0x0000000d,0x000008a5,0x000007ab,
+0x00050080,0x0000000d,0x000008a6,0x000008a5,
+0x0000008e,0x0003003e,0x000007ab,0x000008a6,
+0x000200f9,0x00000836,0x000200f8,0x00000836,
+0x000200f9,0x000007d7,0x000200f8,0x000007d7,
+0x0004003d,0x0000000d,0x000008a7,0x0000079d,
+0x0004003d,0x0000000d,0x000008a8,0x000007aa,
+0x00050080,0x0000000d,0x000008a9,0x000008a8,
+0x000008a7,0x0003003e,0x000007aa,0x000008a9,
+0x000200f9,0x000007cf,0x000200f8,0x000007cf,
+0x000200f9,0x000007cc,0x000200f8,0x000007ce,
+0x0004003d,0x0000000d,0x000008ab,0x000006af,
+0x000500c2,0x0000000d,0x000008ad,0x000008ab,
+0x000008ac,0x000500c7,0x0000000d,0x000008ae,
+0x000008ad,0x0000003c,0x00050080,0x0000000d,
+0x000008af,0x000008ae,0x00000082,0x0003003e,
+0x000008aa,0x000008af,0x0004003d,0x0000000d,
+0x000008b0,0x000006c1,0x000500aa,0x00000099,
+0x000008b1,0x000008b0,0x00000082,0x0004003d,
+0x0000000d,0x000008b2,0x000008aa,0x000500aa,
+0x00000099,0x000008b3,0x000008b2,0x000000de,
+0x000500a7,0x00000099,0x000008b4,0x000008b1,
+0x000008b3,0x000300f7,0x000008b6,0x00000000,
+0x000400fa,0x000008b4,0x000008b5,0x000008b6,
+0x000200f8,0x000008b5,0x00040039,0x0000006d,
+0x000008b7,0x00000073,0x000200fe,0x000008b7,
+0x000200f8,0x000008b6,0x0004003d,0x0000000d,
+0x000008bb,0x00000766,0x0003003e,0x000008ba,
+0x000008bb,0x0004003d,0x0000000d,0x000008bd,
+0x00000763,0x0003003e,0x000008bc,0x000008bd,
+0x0004003d,0x0000000d,0x000008bf,0x00000764,
+0x0003003e,0x000008be,0x000008bf,0x0004003d,
+0x0000000d,0x000008c1,0x00000765,0x0003003e,
+0x000008c0,0x000008c1,0x00080039,0x0000000d,
+0x000008c2,0x00000029,0x000008ba,0x000008bc,
+0x000008be,0x000008c0,0x00050082,0x0000000d,
+0x000008c3,0x000002ab,0x000008c2,0x0003003e,
+0x000008b9,0x000008c3,0x0003003e,0x000008c4,
+0x000000c9,0x0004003d,0x0000000d,0x000008c5,
+0x000008aa,0x000500aa,0x00000099,0x000008c6,
+0x000008c5,0x00000082,0x000300f7,0x000008c8,
+0x00000000,0x000400fa,0x000008c6,0x000008c7,
+0x000008d3,0x000200f8,0x000008c7,0x0004003d,
+0x0000000d,0x000008ca,0x000006af,0x000500c2,
+0x0000000d,0x000008cc,0x000008ca,0x000008cb,
+0x000500c7,0x0000000d,0x000008cd,0x000008cc,
+0x0000056b,0x00050041,0x0000000e,0x000008ce,
+0x000008c9,0x000000c9,0x0003003e,0x000008ce,
+0x000008cd,0x0004003d,0x0000000d,0x000008cf,
+0x000008b9,0x0004003d,0x0000000d,0x000008d0,
+0x000006c1,0x00050084,0x0000000d,0x000008d1,
+0x000008d0,0x000000e7,0x00050082,0x0000000d,
+0x000008d2,0x000008cf,0x000008d1,0x0003003e,
+0x000008c4,0x000008d2,0x000200f9,0x000008c8,
+0x000200f8,0x000008d3,0x0004003d,0x0000000d,
+0x000008d5,0x000006af,0x000500c2,0x0000000d,
+0x000008d7,0x000008d5,0x000008d6,0x000500c7,
+0x0000000d,0x000008d8,0x000008d7,0x0000003c,
+0x0003003e,0x000008d4,0x000008d8,0x0004003d,
+0x0000000d,0x000008da,0x000008d4,0x000500aa,
+0x00000099,0x000008db,0x000008da,0x000000c9,
+0x000300f7,0x000008de,0x00000000,0x000400fa,
+0x000008db,0x000008dd,0x000008df,0x000200f8,
+0x000008dd,0x0003003e,0x000008dc,0x000000c9,
+0x000200f9,0x000008de,0x000200f8,0x000008df,
+0x0004003d,0x0000000d,0x000008e1,0x000008aa,
+0x00050082,0x0000000d,0x000008e2,0x000008e1,
+0x00000082,0x0003003e,0x000008e3,0x000008e0,
+0x00050041,0x0000000e,0x000008e4,0x000008e3,
+0x000008e2,0x0004003d,0x0000000d,0x000008e5,
+0x000008e4,0x0003003e,0x000008dc,0x000008e5,
+0x000200f9,0x000008de,0x000200f8,0x000008de,
+0x0004003d,0x0000000d,0x000008e6,0x000008dc,
+0x0003003e,0x000008d9,0x000008e6,0x0004003d,
+0x0000000d,0x000008e8,0x000008b9,0x0004003d,
+0x0000000d,0x000008e9,0x000008d9,0x00050082,
+0x0000000d,0x000008ea,0x000008e8,0x000008e9,
+0x0003003e,0x000008e7,0x000008ea,0x0004003d,
+0x0000000d,0x000008eb,0x000008e7,0x0004003d,
+0x0000000d,0x000008ec,0x000006c1,0x00050084,
+0x0000000d,0x000008ed,0x000008ec,0x000000e7,
+0x00050082,0x0000000d,0x000008ee,0x000008eb,
+0x000008ed,0x0003003e,0x000008c4,0x000008ee,
+0x0004003d,0x0000000d,0x000008ef,0x000008d4,
+0x000500aa,0x00000099,0x000008f0,0x000008ef,
+0x000000c9,0x000300f7,0x000008f2,0x00000000,
+0x000400fa,0x000008f0,0x000008f1,0x000008fd,
+0x000200f8,0x000008f1,0x0004003d,0x0000000d,
+0x000008f4,0x000006af,0x000500c2,0x0000000d,
+0x000008f6,0x000008f4,0x000008f5,0x000500c7,
+0x0000000d,0x000008f7,0x000008f6,0x0000056b,
+0x0003003e,0x000008f3,0x000008f7,0x0004003d,
+0x0000000d,0x000008f8,0x000008f3,0x0004003d,
+0x0000000d,0x000008f9,0x000008f3,0x0004003d,
+0x0000000d,0x000008fa,0x000008f3,0x0004003d,
+0x0000000d,0x000008fb,0x000008f3,0x00070050,
+0x00000015,0x000008fc,0x000008f8,0x000008f9,
+0x000008fa,0x000008fb,0x0003003e,0x000008c9,
+0x000008fc,0x000200f9,0x000008f2,0x000200f8,
+0x000008fd,0x0004003d,0x0000000d,0x000008ff,
+0x000008d4,0x00050082,0x0000000d,0x00000900,
+0x000008ff,0x00000082,0x0003003e,0x000008fe,
+0x00000900,0x0004003d,0x0000000d,0x00000902,
+0x000008fe,0x0004003d,0x0000000d,0x00000904,
+0x000006af,0x0003003e,0x00000903,0x00000904,
+0x0003003e,0x00000905,0x000008f5,0x00060039,
+0x0000000d,0x00000906,0x00000013,0x00000903,
+0x00000905,0x0004003d,0x0000000d,0x00000908,
+0x000006af,0x0003003e,0x00000907,0x00000908,
+0x0003003e,0x00000909,0x00000599,0x00060039,
+0x0000000d,0x0000090a,0x00000013,0x00000907,
+0x00000909,0x0004003d,0x0000000d,0x0000090d,
+0x000006af,0x0003003e,0x0000090c,0x0000090d,
+0x0003003e,0x0000090e,0x0000090b,0x00060039,
+0x0000000d,0x0000090f,0x00000013,0x0000090c,
+0x0000090e,0x0004003d,0x0000000d,0x00000911,
+0x000006af,0x0003003e,0x00000910,0x00000911,
+0x0003003e,0x00000912,0x0000058a,0x00060039,
+0x0000000d,0x00000913,0x00000013,0x00000910,
+0x00000912,0x00070050,0x00000015,0x00000914,
+0x00000906,0x0000090a,0x0000090f,0x00000913,
+0x00070050,0x00000015,0x00000915,0x00000902,
+0x00000902,0x00000902,0x00000902,0x00050080,
+0x00000015,0x00000916,0x00000915,0x00000914,
+0x0003003e,0x00000901,0x00000916,0x0003003e,
+0x00000918,0x00000076,0x0004003d,0x0000000d,
+0x0000091a,0x000008e7,0x0003003e,0x00000919,
+0x0000091a,0x0004003d,0x0000000d,0x0000091c,
+0x000008d9,0x0003003e,0x0000091b,0x0000091c,
+0x00070039,0x0000000d,0x0000091d,0x0000001b,
+0x00000918,0x00000919,0x0000091b,0x0003003e,
+0x00000917,0x0000091d,0x0004003d,0x0000000d,
+0x00000920,0x000008aa,0x00050082,0x0000000d,
+0x00000921,0x00000920,0x00000082,0x0003003e,
+0x00000922,0x0000091f,0x00050041,0x0000000e,
+0x00000923,0x00000922,0x00000921,0x0004003d,
+0x0000000d,0x00000924,0x00000923,0x0003003e,
+0x0000091e,0x00000924,0x0004003d,0x0000000d,
+0x00000926,0x00000917,0x0004003d,0x0000000d,
+0x00000927,0x0000091e,0x000500c4,0x0000000d,
+0x00000928,0x00000926,0x00000927,0x0004003d,
+0x0000000d,0x00000929,0x000006af,0x000500c2,
+0x0000000d,0x0000092a,0x00000929,0x0000090b,
+0x000500c7,0x0000000d,0x0000092b,0x0000092a,
+0x0000003c,0x0004003d,0x0000000d,0x0000092c,
+0x0000091e,0x00050082,0x0000000d,0x0000092d,
+0x000000e7,0x0000092c,0x000500c2,0x0000000d,
+0x0000092e,0x0000092b,0x0000092d,0x000500c5,
+0x0000000d,0x0000092f,0x00000928,0x0000092e,
+0x0003003e,0x00000925,0x0000092f,0x0004003d,
+0x00000015,0x00000930,0x00000901,0x00070050,
+0x00000049,0x00000931,0x00000124,0x00000124,
+0x00000124,0x00000124,0x000500c4,0x00000015,
+0x00000932,0x00000930,0x00000931,0x0004003d,
+0x0000000d,0x00000933,0x00000925,0x000500c7,
+0x0000000d,0x00000934,0x00000933,0x0000003c,
+0x0004003d,0x0000000d,0x00000935,0x00000925,
+0x000500c2,0x0000000d,0x00000936,0x00000935,
+0x00000124,0x000500c7,0x0000000d,0x00000937,
+0x00000936,0x0000003c,0x0004003d,0x0000000d,
+0x00000938,0x00000925,0x000500c2,0x0000000d,
+0x00000939,0x00000938,0x0000052a,0x000500c7,
+0x0000000d,0x0000093a,0x00000939,0x0000003c,
+0x0004003d,0x0000000d,0x0000093b,0x00000925,
+0x000500c2,0x0000000d,0x0000093c,0x0000093b,
+0x00000540,0x000500c7,0x0000000d,0x0000093d,
+0x0000093c,0x0000003c,0x00070050,0x00000015,
+0x0000093e,0x00000934,0x00000937,0x0000093a,
+0x0000093d,0x000500c5,0x00000015,0x0000093f,
+0x00000932,0x0000093e,0x0003003e,0x000008c9,
+0x0000093f,0x000200f9,0x000008f2,0x000200f8,
+0x000008f2,0x000200f9,0x000008c8,0x000200f8,
+0x000008c8,0x0003003e,0x00000940,0x000000c9,
+0x0003003e,0x00000941,0x000000c9,0x000200f9,
+0x00000942,0x000200f8,0x00000942,0x000400f6,
+0x00000944,0x00000945,0x00000000,0x000200f9,
+0x00000946,0x000200f8,0x00000946,0x0004003d,
+0x0000000d,0x00000947,0x00000941,0x0004003d,
+0x0000000d,0x00000948,0x000008aa,0x000500b0,
+0x00000099,0x00000949,0x00000947,0x00000948,
+0x000400fa,0x00000949,0x00000943,0x00000944,
+0x000200f8,0x00000943,0x0004003d,0x0000000d,
+0x0000094a,0x00000941,0x00050041,0x0000000e,
+0x0000094c,0x000008c9,0x0000094a,0x0004003d,
+0x0000000d,0x0000094d,0x0000094c,0x0003003e,
+0x0000094b,0x0000094d,0x00050039,0x0000000d,
+0x0000094e,0x00000047,0x0000094b,0x0004003d,
+0x0000000d,0x0000094f,0x00000940,0x00050080,
+0x0000000d,0x00000950,0x0000094f,0x0000094e,
+0x0003003e,0x00000940,0x00000950,0x000200f9,
+0x00000945,0x000200f8,0x00000945,0x0004003d,
+0x0000000d,0x00000951,0x00000941,0x00050080,
+0x0000000d,0x00000952,0x00000951,0x0000008e,
+0x0003003e,0x00000941,0x00000952,0x000200f9,
+0x00000942,0x000200f8,0x00000944,0x0004003d,
+0x0000000d,0x00000954,0x000008aa,0x000500aa,
+0x00000099,0x00000955,0x00000954,0x00000082,
+0x000600a9,0x00000006,0x00000957,0x00000955,
+0x00000520,0x00000956,0x0004007c,0x0000000d,
+0x00000958,0x00000957,0x0003003e,0x00000953,
+0x00000958,0x0004003d,0x0000000d,0x0000095a,
+0x000008c4,0x0004003d,0x0000000d,0x0000095b,
+0x00000953,0x00050082,0x0000000d,0x0000095c,
+0x0000095a,0x0000095b,0x0003003e,0x00000959,
+0x0000095c,0x0004003d,0x0000000d,0x0000095d,
+0x00000959,0x000500ae,0x00000099,0x0000095e,
+0x0000095d,0x000002ab,0x000300f7,0x00000960,
+0x00000000,0x000400fa,0x0000095e,0x0000095f,
+0x00000960,0x000200f8,0x0000095f,0x00040039,
+0x0000006d,0x00000961,0x00000073,0x000200fe,
+0x00000961,0x000200f8,0x00000960,0x0003003e,
+0x00000963,0x000000c9,0x0003003e,0x00000964,
+0x000000c9,0x0003003e,0x00000965,0x000000c9,
+0x0003003e,0x00000966,0x000000c9,0x000200f9,
+0x00000967,0x000200f8,0x00000967,0x000400f6,
+0x00000969,0x0000096a,0x00000000,0x000200f9,
+0x0000096b,0x000200f8,0x0000096b,0x0004003d,
+0x0000000d,0x0000096c,0x00000966,0x000500b0,
+0x00000099,0x0000096d,0x0000096c,0x00000800,
+0x000400fa,0x0000096d,0x00000968,0x00000969,
+0x000200f8,0x00000968,0x0004003d,0x0000000d,
+0x00000977,0x00000966,0x0003003e,0x00000979,
+0x00000976,0x00060041,0x0000000e,0x0000097a,
+0x00000979,0x00000977,0x00000109,0x0004003d,
+0x0000000d,0x0000097b,0x0000097a,0x0003003e,
+0x00000964,0x0000097b,0x0004003d,0x0000000d,
+0x0000097c,0x00000966,0x0003003e,0x0000097d,
+0x00000976,0x00060041,0x0000000e,0x0000097e,
+0x0000097d,0x0000097c,0x0000008e,0x0004003d,
+0x0000000d,0x0000097f,0x0000097e,0x0003003e,
+0x00000963,0x0000097f,0x0004003d,0x0000000d,
+0x00000980,0x00000966,0x0003003e,0x00000981,
+0x00000976,0x00060041,0x0000000e,0x00000982,
+0x00000981,0x00000980,0x00000124,0x0004003d,
+0x0000000d,0x00000983,0x00000982,0x0003003e,
+0x00000965,0x00000983,0x0004003d,0x0000000d,
+0x00000985,0x00000940,0x0003003e,0x00000984,
+0x00000985,0x0004003d,0x0000000d,0x00000987,
+0x00000964,0x0003003e,0x00000986,0x00000987,
+0x0004003d,0x0000000d,0x00000989,0x00000963,
+0x0003003e,0x00000988,0x00000989,0x0004003d,
+0x0000000d,0x0000098b,0x00000965,0x0003003e,
+0x0000098a,0x0000098b,0x00080039,0x0000000d,
+0x0000098c,0x00000029,0x00000984,0x00000986,
+0x00000988,0x0000098a,0x0004003d,0x0000000d,
+0x0000098d,0x00000959,0x000500b2,0x00000099,
+0x0000098e,0x0000098c,0x0000098d,0x000300f7,
+0x00000990,0x00000000,0x000400fa,0x0000098e,
+0x0000098f,0x00000990,0x000200f8,0x0000098f,
+0x000200f9,0x00000969,0x000200f8,0x00000990,
+0x000200f9,0x0000096a,0x000200f8,0x0000096a,
+0x0004003d,0x0000000d,0x00000992,0x00000966,
+0x00050080,0x0000000d,0x00000993,0x00000992,
+0x0000008e,0x0003003e,0x00000966,0x00000993,
+0x000200f9,0x00000967,0x000200f8,0x00000969,
+0x0004003d,0x0000000d,0x00000994,0x00000966,
+0x000500ae,0x00000099,0x00000995,0x00000994,
+0x00000800,0x000300f7,0x00000997,0x00000000,
+0x000400fa,0x00000995,0x00000996,0x00000997,
+0x000200f8,0x00000996,0x00040039,0x0000006d,
+0x00000998,0x00000073,0x000200fe,0x00000998,
+0x000200f8,0x00000997,0x0004003d,0x0000000d,
+0x0000099c,0x00000940,0x0003003e,0x0000099b,
+0x0000099c,0x0004003d,0x0000000d,0x0000099e,
+0x00000964,0x0003003e,0x0000099d,0x0000099e,
+0x0004003d,0x0000000d,0x000009a0,0x00000963,
+0x0003003e,0x0000099f,0x000009a0,0x0004003d,
+0x0000000d,0x000009a2,0x00000965,0x0003003e,
+0x000009a1,0x000009a2,0x00080039,0x0000000d,
+0x000009a3,0x00000029,0x0000099b,0x0000099d,
+0x0000099f,0x000009a1,0x0003003e,0x0000099a,
+0x000009a3,0x0004003d,0x0000000d,0x000009a5,
+0x00000953,0x0004003d,0x0000000d,0x000009a6,
+0x0000099a,0x00050080,0x0000000d,0x000009a7,
+0x000009a5,0x000009a6,0x0003003e,0x000009a4,
+0x000009a7,0x0003003e,0x000009a8,0x000000c9,
+0x0003003e,0x000009a9,0x000000c9,0x0004003d,
+0x0000000d,0x000009ab,0x00000964,0x0003003e,
+0x000009aa,0x000009ab,0x0004003d,0x0000000d,
+0x000009ad,0x00000963,0x0003003e,0x000009ac,
+0x000009ad,0x0004003d,0x0000000d,0x000009af,
+0x00000965,0x0003003e,0x000009ae,0x000009af,
+0x00090039,0x00000002,0x000009b2,0x00000031,
+0x000009aa,0x000009ac,0x000009ae,0x000009b0,
+0x000009b1,0x0004003d,0x0000000d,0x000009b3,
+0x000009b0,0x0003003e,0x000009a9,0x000009b3,
+0x0004003d,0x0000000d,0x000009b4,0x000009b1,
+0x0003003e,0x000009a8,0x000009b4,0x0004003d,
+0x0000000d,0x000009b6,0x00000953,0x0003003e,
+0x000009b5,0x000009b6,0x0003003e,0x000009b7,
+0x000000c9,0x000200f9,0x000009b8,0x000200f8,
+0x000009b8,0x000400f6,0x000009ba,0x000009bb,
+0x00000000,0x000200f9,0x000009bc,0x000200f8,
+0x000009bc,0x0004003d,0x0000000d,0x000009bd,
+0x000009b7,0x0004003d,0x0000000d,0x000009be,
+0x00000940,0x000500b0,0x00000099,0x000009bf,
+0x000009bd,0x000009be,0x000400fa,0x000009bf,
+0x000009b9,0x000009ba,0x000200f8,0x000009b9,
+0x0004003d,0x0000000d,0x000009c0,0x00000964,
+0x000500aa,0x00000099,0x000009c1,0x000009c0,
+0x00000082,0x000300f7,0x000009c3,0x00000000,
+0x000400fa,0x000009c1,0x000009c2,0x00000aa3,
+0x000200f8,0x000009c2,0x0003003e,0x000009c5,
+0x00000076,0x0004003d,0x0000000d,0x000009c7,
+0x000009b5,0x0003003e,0x000009c6,0x000009c7,
+0x0004003d,0x0000000d,0x000009c9,0x000009a4,
+0x0003003e,0x000009c8,0x000009c9,0x0004003d,
+0x0000000d,0x000009cb,0x00000965,0x0003003e,
+0x000009ca,0x000009cb,0x00080039,0x00000034,
+0x000009cc,0x0000003a,0x000009c5,0x000009c6,
+0x000009c8,0x000009ca,0x0003003e,0x000009c4,
+0x000009cc,0x0003003e,0x000009cd,0x00000109,
+0x000200f9,0x000009ce,0x000200f8,0x000009ce,
+0x000400f6,0x000009d0,0x000009d1,0x00000000,
+0x000200f9,0x000009d2,0x000200f8,0x000009d2,
+0x0004003d,0x00000006,0x000009d3,0x000009cd,
+0x000500b1,0x00000099,0x000009d4,0x000009d3,
+0x00000110,0x000400fa,0x000009d4,0x000009cf,
+0x000009d0,0x000200f8,0x000009cf,0x0004003d,
+0x0000000d,0x000009d6,0x000009b7,0x0004003d,
+0x0000000d,0x00000a8b,0x00000965,0x0003003e,
+0x00000a8d,0x00000a8a,0x00050041,0x0000000e,
+0x00000a8e,0x00000a8d,0x00000a8b,0x0004003d,
+0x0000000d,0x00000a8f,0x00000a8e,0x0004003d,
+0x00000006,0x00000a90,0x000009cd,0x00050041,
+0x0000000e,0x00000a91,0x000009c4,0x00000a90,
+0x0004003d,0x0000000d,0x00000a92,0x00000a91,
+0x00050080,0x0000000d,0x00000a93,0x00000a8f,
+0x00000a92,0x0003003e,0x00000a95,0x00000a88,
+0x00050041,0x0000000e,0x00000a96,0x00000a95,
+0x00000a93,0x0004003d,0x0000000d,0x00000a97,
+0x00000a96,0x00050041,0x0000000e,0x00000a98,
+0x000009d5,0x000009d6,0x0003003e,0x00000a98,
+0x00000a97,0x0004003d,0x0000000d,0x00000a99,
+0x000009b7,0x00050080,0x0000000d,0x00000a9a,
+0x00000a99,0x0000008e,0x0003003e,0x000009b7,
+0x00000a9a,0x0004003d,0x0000000d,0x00000a9b,
+0x000009b7,0x0004003d,0x0000000d,0x00000a9c,
+0x00000940,0x000500ae,0x00000099,0x00000a9d,
+0x00000a9b,0x00000a9c,0x000300f7,0x00000a9f,
+0x00000000,0x000400fa,0x00000a9d,0x00000a9e,
+0x00000a9f,0x000200f8,0x00000a9e,0x000200f9,
+0x000009d0,0x000200f8,0x00000a9f,0x000200f9,
+0x000009d1,0x000200f8,0x000009d1,0x0004003d,
+0x00000006,0x00000aa1,0x000009cd,0x00050080,
+0x00000006,0x00000aa2,0x00000aa1,0x0000008e,
+0x0003003e,0x000009cd,0x00000aa2,0x000200f9,
+0x000009ce,0x000200f8,0x000009d0,0x000200f9,
+0x000009c3,0x000200f8,0x00000aa3,0x0004003d,
+0x0000000d,0x00000aa4,0x00000963,0x000500aa,
+0x00000099,0x00000aa5,0x00000aa4,0x00000082,
+0x000300f7,0x00000aa7,0x00000000,0x000400fa,
+0x00000aa5,0x00000aa6,0x00000adc,0x000200f8,
+0x00000aa6,0x0003003e,0x00000aa9,0x00000076,
+0x0004003d,0x0000000d,0x00000aab,0x000009b5,
+0x0003003e,0x00000aaa,0x00000aab,0x0004003d,
+0x0000000d,0x00000aad,0x000009a4,0x0003003e,
+0x00000aac,0x00000aad,0x0004003d,0x0000000d,
+0x00000aaf,0x00000965,0x0003003e,0x00000aae,
+0x00000aaf,0x00080039,0x0000003d,0x00000ab0,
+0x00000043,0x00000aa9,0x00000aaa,0x00000aac,
+0x00000aae,0x0003003e,0x00000aa8,0x00000ab0,
+0x0003003e,0x00000ab1,0x00000109,0x000200f9,
+0x00000ab2,0x000200f8,0x00000ab2,0x000400f6,
+0x00000ab4,0x00000ab5,0x00000000,0x000200f9,
+0x00000ab6,0x000200f8,0x00000ab6,0x0004003d,
+0x00000006,0x00000ab7,0x00000ab1,0x000500b1,
+0x00000099,0x00000ab8,0x00000ab7,0x00000269,
+0x000400fa,0x00000ab8,0x00000ab3,0x00000ab4,
+0x000200f8,0x00000ab3,0x0004003d,0x0000000d,
+0x00000ab9,0x000009b7,0x0004003d,0x0000000d,
+0x00000ac5,0x00000965,0x0003003e,0x00000ac6,
+0x00000ac4,0x00050041,0x0000000e,0x00000ac7,
+0x00000ac6,0x00000ac5,0x0004003d,0x0000000d,
+0x00000ac8,0x00000ac7,0x0004003d,0x00000006,
+0x00000ac9,0x00000ab1,0x00050041,0x0000000e,
+0x00000aca,0x00000aa8,0x00000ac9,0x0004003d,
+0x0000000d,0x00000acb,0x00000aca,0x00050080,
+0x0000000d,0x00000acc,0x00000ac8,0x00000acb,
+0x0003003e,0x00000ace,0x00000ac3,0x00050041,
+0x0000000e,0x00000acf,0x00000ace,0x00000acc,
+0x0004003d,0x0000000d,0x00000ad0,0x00000acf,
+0x00050041,0x0000000e,0x00000ad1,0x000009d5,
+0x00000ab9,0x0003003e,0x00000ad1,0x00000ad0,
+0x0004003d,0x0000000d,0x00000ad2,0x000009b7,
+0x00050080,0x0000000d,0x00000ad3,0x00000ad2,
+0x0000008e,0x0003003e,0x000009b7,0x00000ad3,
+0x0004003d,0x0000000d,0x00000ad4,0x000009b7,
+0x0004003d,0x0000000d,0x00000ad5,0x00000940,
+0x000500ae,0x00000099,0x00000ad6,0x00000ad4,
+0x00000ad5,0x000300f7,0x00000ad8,0x00000000,
+0x000400fa,0x00000ad6,0x00000ad7,0x00000ad8,
+0x000200f8,0x00000ad7,0x000200f9,0x00000ab4,
+0x000200f8,0x00000ad8,0x000200f9,0x00000ab5,
+0x000200f8,0x00000ab5,0x0004003d,0x00000006,
+0x00000ada,0x00000ab1,0x00050080,0x00000006,
+0x00000adb,0x00000ada,0x0000008e,0x0003003e,
+0x00000ab1,0x00000adb,0x000200f9,0x00000ab2,
+0x000200f8,0x00000ab4,0x000200f9,0x00000aa7,
+0x000200f8,0x00000adc,0x0003003e,0x00000ade,
+0x00000076,0x0004003d,0x0000000d,0x00000ae0,
+0x000009b5,0x0003003e,0x00000adf,0x00000ae0,
+0x0004003d,0x0000000d,0x00000ae2,0x000009a8,
+0x0003003e,0x00000ae1,0x00000ae2,0x00070039,
+0x0000000d,0x00000ae3,0x0000001b,0x00000ade,
+0x00000adf,0x00000ae1,0x0003003e,0x00000add,
+0x00000ae3,0x0004003d,0x0000000d,0x00000ae5,
+0x00000add,0x0004003d,0x0000000d,0x00000ae8,
+0x00000965,0x00050082,0x0000000d,0x00000ae9,
+0x00000ae8,0x00000082,0x0003003e,0x00000aeb,
+0x00000ae7,0x00050041,0x0000000e,0x00000aec,
+0x00000aeb,0x00000ae9,0x0004003d,0x0000000d,
+0x00000aed,0x00000aec,0x00050084,0x0000000d,
+0x00000aee,0x00000ae5,0x00000aed,0x0004003d,
+0x0000000d,0x00000aef,0x00000add,0x0004003d,
+0x0000000d,0x00000af1,0x00000965,0x00050082,
+0x0000000d,0x00000af2,0x00000af1,0x00000082,
+0x0003003e,0x00000af3,0x00000af0,0x00050041,
+0x0000000e,0x00000af4,0x00000af3,0x00000af2,
+0x0004003d,0x0000000d,0x00000af5,0x00000af4,
+0x000500c2,0x0000000d,0x00000af6,0x00000aef,
+0x00000af5,0x000500c5,0x0000000d,0x00000af7,
+0x00000aee,0x00000af6,0x0003003e,0x00000ae4,
+0x00000af7,0x0004003d,0x0000000d,0x00000af8,
+0x000009b7,0x0004003d,0x0000000d,0x00000af9,
+0x00000ae4,0x00050041,0x0000000e,0x00000afa,
+0x000009d5,0x00000af8,0x0003003e,0x00000afa,
+0x00000af9,0x0004003d,0x0000000d,0x00000afb,
+0x000009b7,0x00050080,0x0000000d,0x00000afc,
+0x00000afb,0x0000008e,0x0003003e,0x000009b7,
+0x00000afc,0x000200f9,0x00000aa7,0x000200f8,
+0x00000aa7,0x000200f9,0x000009c3,0x000200f8,
+0x000009c3,0x0004003d,0x0000000d,0x00000afd,
+0x000009a8,0x0004003d,0x0000000d,0x00000afe,
+0x000009b5,0x00050080,0x0000000d,0x00000aff,
+0x00000afe,0x00000afd,0x0003003e,0x000009b5,
+0x00000aff,0x000200f9,0x000009bb,0x000200f8,
+0x000009bb,0x000200f9,0x000009b8,0x000200f8,
+0x000009ba,0x0003003e,0x00000b00,0x000000c9,
+0x0003003e,0x00000b01,0x000000c9,0x000200f9,
+0x00000b02,0x000200f8,0x00000b02,0x000400f6,
+0x00000b04,0x00000b05,0x00000000,0x000200f9,
+0x00000b06,0x000200f8,0x00000b06,0x0004003d,
+0x0000000d,0x00000b07,0x00000b01,0x0004003d,
+0x0000000d,0x00000b08,0x000008aa,0x000500b0,
+0x00000099,0x00000b09,0x00000b07,0x00000b08,
+0x000400fa,0x00000b09,0x00000b03,0x00000b04,
+0x000200f8,0x00000b03,0x0004003d,0x0000005a,
+0x00000b0a,0x000009d5,0x0004003d,0x0000000d,
+0x00000b0b,0x00000b01,0x0004003d,0x0000000d,
+0x00000b10,0x00000b01,0x0004003d,0x0000000d,
+0x00000b11,0x00000b01,0x0004003d,0x0000000d,
+0x00000b13,0x00000b00,0x0003003e,0x00000b12,
+0x00000b13,0x00050041,0x0000000e,0x00000b15,
+0x000008c9,0x00000b0b,0x0004003d,0x0000000d,
+0x00000b16,0x00000b15,0x0003003e,0x00000b14,
+0x00000b16,0x00090039,0x00000002,0x00000b19,
+0x00000061,0x00000b0a,0x00000b12,0x00000b14,
+0x00000b17,0x00000b18,0x0004003d,0x00000015,
+0x00000b1a,0x00000b17,0x00060041,0x00000016,
+0x00000b1b,0x00000b0f,0x00000b10,0x00000109,
+0x0003003e,0x00000b1b,0x00000b1a,0x0004003d,
+0x00000015,0x00000b1c,0x00000b18,0x00060041,
+0x00000016,0x00000b1d,0x00000b0f,0x00000b11,
+0x0000008e,0x0003003e,0x00000b1d,0x00000b1c,
+0x0004003d,0x0000000d,0x00000b1e,0x00000b01,
+0x00050041,0x0000000e,0x00000b20,0x000008c9,
+0x00000b1e,0x0004003d,0x0000000d,0x00000b21,
+0x00000b20,0x0003003e,0x00000b1f,0x00000b21,
+0x00050039,0x0000000d,0x00000b22,0x00000047,
+0x00000b1f,0x0004003d,0x0000000d,0x00000b23,
+0x00000b00,0x00050080,0x0000000d,0x00000b24,
+0x00000b23,0x00000b22,0x0003003e,0x00000b00,
+0x00000b24,0x000200f9,0x00000b05,0x000200f8,
+0x00000b05,0x0004003d,0x0000000d,0x00000b25,
+0x00000b01,0x00050080,0x0000000d,0x00000b26,
+0x00000b25,0x0000008e,0x0003003e,0x00000b01,
+0x00000b26,0x000200f9,0x00000b02,0x000200f8,
+0x00000b04,0x00050041,0x00000b29,0x00000b2a,
+0x00000554,0x00000109,0x0004003d,0x00000551,
+0x00000b2b,0x00000b2a,0x00050050,0x00000551,
+0x00000b2c,0x000000e7,0x000000e7,0x00050086,
+0x00000551,0x00000b2d,0x00000b2b,0x00000b2c,
+0x00050050,0x00000551,0x00000b2e,0x00000561,
+0x00000561,0x00050080,0x00000551,0x00000b2f,
+0x00000b2e,0x00000b2d,0x00050041,0x00000b29,
+0x00000b30,0x00000554,0x00000109,0x0004003d,
+0x00000551,0x00000b31,0x00000b30,0x00050050,
+0x00000551,0x00000b32,0x00000082,0x00000082,
+0x00050082,0x00000551,0x00000b33,0x00000b31,
+0x00000b32,0x00050086,0x00000551,0x00000b34,
+0x00000b2f,0x00000b33,0x0003003e,0x00000b28,
+0x00000b34,0x0004003d,0x0000000d,0x00000b36,
+0x000006c1,0x00050080,0x0000000d,0x00000b37,
+0x00000b36,0x00000082,0x0003003e,0x00000b35,
+0x00000b37,0x0003003e,0x00000b38,0x000000c9,
+0x000200f9,0x00000b39,0x000200f8,0x00000b39,
+0x000400f6,0x00000b3b,0x00000b3c,0x00000000,
+0x000200f9,0x00000b3d,0x000200f8,0x00000b3d,
+0x0004003d,0x0000000d,0x00000b3e,0x00000b38,
+0x00060041,0x00000555,0x00000b3f,0x00000554,
+0x00000109,0x00000082,0x0004003d,0x0000000d,
+0x00000b40,0x00000b3f,0x000500b0,0x00000099,
+0x00000b41,0x00000b3e,0x00000b40,0x000400fa,
+0x00000b41,0x00000b3a,0x00000b3b,0x000200f8,
+0x00000b3a,0x0003003e,0x00000b42,0x000000c9,
+0x000200f9,0x00000b43,0x000200f8,0x00000b43,
+0x000400f6,0x00000b45,0x00000b46,0x00000000,
+0x000200f9,0x00000b47,0x000200f8,0x00000b47,
+0x0004003d,0x0000000d,0x00000b48,0x00000b42,
+0x00060041,0x00000555,0x00000b49,0x00000554,
+0x00000109,0x000000c9,0x0004003d,0x0000000d,
+0x00000b4a,0x00000b49,0x000500b0,0x00000099,
+0x00000b4b,0x00000b48,0x00000b4a,0x000400fa,
+0x00000b4b,0x00000b44,0x00000b45,0x000200f8,
+0x00000b44,0x0004003d,0x0000000d,0x00000b4d,
+0x000006af,0x000500c2,0x0000000d,0x00000b4e,
+0x00000b4d,0x000008cb,0x000500c7,0x0000000d,
+0x00000b50,0x00000b4e,0x00000b4f,0x0003003e,
+0x00000b51,0x00000b50,0x0004003d,0x0000000d,
+0x00000b53,0x00000b42,0x0003003e,0x00000b52,
+0x00000b53,0x0004003d,0x0000000d,0x00000b55,
+0x00000b38,0x0003003e,0x00000b54,0x00000b55,
+0x0004003d,0x0000000d,0x00000b57,0x000008aa,
+0x0003003e,0x00000b56,0x00000b57,0x00080039,
+0x0000000d,0x00000b58,0x0000006a,0x00000b51,
+0x00000b52,0x00000b54,0x00000b56,0x0003003e,
+0x00000b4c,0x00000b58,0x0004003d,0x0000000d,
+0x00000b5d,0x00000b4c,0x00050041,0x0000000e,
+0x00000b5e,0x000008c9,0x00000b5d,0x0004003d,
+0x0000000d,0x00000b5f,0x00000b5e,0x0003003e,
+0x00000b61,0x00000b5c,0x00050041,0x00000b62,
+0x00000b63,0x00000b61,0x00000b5f,0x0004003d,
+0x00000099,0x00000b64,0x00000b63,0x000300f7,
+0x00000b66,0x00000000,0x000400fa,0x00000b64,
+0x00000b65,0x00000b66,0x000200f8,0x00000b65,
+0x0004003d,0x0000000d,0x00000b68,0x00000b38,
+0x00060041,0x00000555,0x00000b69,0x00000554,
+0x00000109,0x000000c9,0x0004003d,0x0000000d,
+0x00000b6a,0x00000b69,0x00050084,0x0000000d,
+0x00000b6b,0x00000b68,0x00000b6a,0x0004003d,
+0x0000000d,0x00000b6c,0x00000b42,0x00050080,
+0x0000000d,0x00000b6d,0x00000b6b,0x00000b6c,
+0x00050041,0x00000016,0x00000b6e,0x00000b67,
+0x00000b6d,0x0003003e,0x00000b6e,0x000006aa,
+0x000200f9,0x00000b46,0x000200f8,0x00000b66,
+0x0004003d,0x0000000d,0x00000b71,0x00000b42,
+0x0004003d,0x0000000d,0x00000b72,0x00000b38,
+0x00050050,0x00000551,0x00000b73,0x00000b71,
+0x00000b72,0x0003003e,0x00000b70,0x00000b73,
+0x0004003d,0x00000551,0x00000b75,0x00000b28,
+0x0004003d,0x00000551,0x00000b76,0x00000b70,
+0x00050084,0x00000551,0x00000b77,0x00000b75,
+0x00000b76,0x0003003e,0x00000b74,0x00000b77,
+0x0004003d,0x00000551,0x00000b79,0x00000b74,
+0x0004003d,0x0000000d,0x00000b7a,0x000006dd,
+0x0004003d,0x0000000d,0x00000b7b,0x000006df,
+0x00050050,0x00000551,0x00000b7c,0x00000b7a,
+0x00000b7b,0x00050050,0x00000551,0x00000b7d,
+0x00000082,0x00000082,0x00050082,0x00000551,
+0x00000b7e,0x00000b7c,0x00000b7d,0x00050084,
+0x00000551,0x00000b7f,0x00000b79,0x00000b7e,
+0x00050050,0x00000551,0x00000b80,0x00000088,
+0x00000088,0x00050080,0x00000551,0x00000b81,
+0x00000b7f,0x00000b80,0x00050050,0x00000b82,
+0x00000b83,0x00000540,0x00000540,0x000500c2,
+0x00000551,0x00000b84,0x00000b81,0x00000b83,
+0x0003003e,0x00000b78,0x00000b84,0x0004003d,
+0x00000551,0x00000b86,0x00000b78,0x00050050,
+0x00000b82,0x00000b87,0x0000052a,0x0000052a,
+0x000500c2,0x00000551,0x00000b88,0x00000b86,
+0x00000b87,0x0003003e,0x00000b85,0x00000b88,
+0x0004003d,0x00000551,0x00000b8a,0x00000b78,
+0x00050050,0x00000551,0x00000b8b,0x0000056b,
+0x0000056b,0x000500c7,0x00000551,0x00000b8c,
+0x00000b8a,0x00000b8b,0x0003003e,0x00000b89,
+0x00000b8c,0x00050041,0x0000000e,0x00000b8e,
+0x00000b85,0x000000c9,0x0004003d,0x0000000d,
+0x00000b8f,0x00000b8e,0x00050041,0x0000000e,
+0x00000b90,0x00000b85,0x00000082,0x0004003d,
+0x0000000d,0x00000b91,0x00000b90,0x0004003d,
+0x0000000d,0x00000b92,0x000006dd,0x00050084,
+0x0000000d,0x00000b93,0x00000b91,0x00000b92,
+0x00050080,0x0000000d,0x00000b94,0x00000b8f,
+0x00000b93,0x0003003e,0x00000b8d,0x00000b94,
+0x0004003d,0x0000000d,0x00000b96,0x00000b8d,
+0x0004003d,0x0000000d,0x00000b97,0x00000b35,
+0x00050084,0x0000000d,0x00000b98,0x00000b96,
+0x00000b97,0x00050041,0x0000000e,0x00000b99,
+0x000007ed,0x00000b98,0x0004003d,0x0000000d,
+0x00000b9a,0x00000b99,0x0004003d,0x0000000d,
+0x00000b9b,0x00000b8d,0x0004003d,0x0000000d,
+0x00000b9c,0x00000b35,0x00050084,0x0000000d,
+0x00000b9d,0x00000b9b,0x00000b9c,0x00050080,
+0x0000000d,0x00000b9e,0x00000b9d,0x00000082,
+0x00050041,0x0000000e,0x00000b9f,0x000007ed,
+0x00000b9e,0x0004003d,0x0000000d,0x00000ba0,
+0x00000b9f,0x00050050,0x00000551,0x00000ba1,
+0x00000b9a,0x00000ba0,0x0003003e,0x00000b95,
+0x00000ba1,0x0004003d,0x0000000d,0x00000ba3,
+0x00000b8d,0x00050080,0x0000000d,0x00000ba4,
+0x00000ba3,0x00000082,0x0004003d,0x0000000d,
+0x00000ba5,0x00000b35,0x00050084,0x0000000d,
+0x00000ba6,0x00000ba4,0x00000ba5,0x00050041,
+0x0000000e,0x00000ba7,0x000007ed,0x00000ba6,
+0x0004003d,0x0000000d,0x00000ba8,0x00000ba7,
+0x0004003d,0x0000000d,0x00000ba9,0x00000b8d,
+0x00050080,0x0000000d,0x00000baa,0x00000ba9,
+0x00000082,0x0004003d,0x0000000d,0x00000bab,
+0x00000b35,0x00050084,0x0000000d,0x00000bac,
+0x00000baa,0x00000bab,0x00050080,0x0000000d,
+0x00000bad,0x00000bac,0x00000082,0x00050041,
+0x0000000e,0x00000bae,0x000007ed,0x00000bad,
+0x0004003d,0x0000000d,0x00000baf,0x00000bae,
+0x00050050,0x00000551,0x00000bb0,0x00000ba8,
+0x00000baf,0x0003003e,0x00000ba2,0x00000bb0,
+0x0004003d,0x0000000d,0x00000bb2,0x00000b8d,
+0x0004003d,0x0000000d,0x00000bb3,0x000006dd,
+0x00050080,0x0000000d,0x00000bb4,0x00000bb2,
+0x00000bb3,0x0004003d,0x0000000d,0x00000bb5,
+0x00000b35,0x00050084,0x0000000d,0x00000bb6,
+0x00000bb4,0x00000bb5,0x00050041,0x0000000e,
+0x00000bb7,0x000007ed,0x00000bb6,0x0004003d,
+0x0000000d,0x00000bb8,0x00000bb7,0x0004003d,
+0x0000000d,0x00000bb9,0x00000b8d,0x0004003d,
+0x0000000d,0x00000bba,0x000006dd,0x00050080,
+0x0000000d,0x00000bbb,0x00000bb9,0x00000bba,
+0x0004003d,0x0000000d,0x00000bbc,0x00000b35,
+0x00050084,0x0000000d,0x00000bbd,0x00000bbb,
+0x00000bbc,0x00050080,0x0000000d,0x00000bbe,
+0x00000bbd,0x00000082,0x00050041,0x0000000e,
+0x00000bbf,0x000007ed,0x00000bbe,0x0004003d,
+0x0000000d,0x00000bc0,0x00000bbf,0x00050050,
+0x00000551,0x00000bc1,0x00000bb8,0x00000bc0,
+0x0003003e,0x00000bb1,0x00000bc1,0x0004003d,
+0x0000000d,0x00000bc3,0x00000b8d,0x0004003d,
+0x0000000d,0x00000bc4,0x000006dd,0x00050080,
+0x0000000d,0x00000bc5,0x00000bc3,0x00000bc4,
+0x00050080,0x0000000d,0x00000bc6,0x00000bc5,
+0x00000082,0x0004003d,0x0000000d,0x00000bc7,
+0x00000b35,0x00050084,0x0000000d,0x00000bc8,
+0x00000bc6,0x00000bc7,0x00050041,0x0000000e,
+0x00000bc9,0x000007ed,0x00000bc8,0x0004003d,
+0x0000000d,0x00000bca,0x00000bc9,0x0004003d,
+0x0000000d,0x00000bcb,0x00000b8d,0x0004003d,
+0x0000000d,0x00000bcc,0x000006dd,0x00050080,
+0x0000000d,0x00000bcd,0x00000bcb,0x00000bcc,
+0x00050080,0x0000000d,0x00000bce,0x00000bcd,
+0x00000082,0x0004003d,0x0000000d,0x00000bcf,
+0x00000b35,0x00050084,0x0000000d,0x00000bd0,
+0x00000bce,0x00000bcf,0x00050080,0x0000000d,
+0x00000bd1,0x00000bd0,0x00000082,0x00050041,
+0x0000000e,0x00000bd2,0x000007ed,0x00000bd1,
+0x0004003d,0x0000000d,0x00000bd3,0x00000bd2,
+0x00050050,0x00000551,0x00000bd4,0x00000bca,
+0x00000bd3,0x0003003e,0x00000bc2,0x00000bd4,
+0x00050041,0x0000000e,0x00000bd6,0x00000b89,
+0x000000c9,0x0004003d,0x0000000d,0x00000bd7,
+0x00000bd6,0x00050041,0x0000000e,0x00000bd8,
+0x00000b89,0x00000082,0x0004003d,0x0000000d,
+0x00000bd9,0x00000bd8,0x00050084,0x0000000d,
+0x00000bda,0x00000bd7,0x00000bd9,0x00050080,
+0x0000000d,0x00000bdb,0x00000bda,0x000000da,
+0x000500c2,0x0000000d,0x00000bdc,0x00000bdb,
+0x0000052a,0x0003003e,0x00000bd5,0x00000bdc,
+0x00050041,0x0000000e,0x00000bde,0x00000b89,
+0x00000082,0x0004003d,0x0000000d,0x00000bdf,
+0x00000bde,0x0004003d,0x0000000d,0x00000be0,
+0x00000bd5,0x00050082,0x0000000d,0x00000be1,
+0x00000bdf,0x00000be0,0x0003003e,0x00000bdd,
+0x00000be1,0x00050041,0x0000000e,0x00000be3,
+0x00000b89,0x000000c9,0x0004003d,0x0000000d,
+0x00000be4,0x00000be3,0x0004003d,0x0000000d,
+0x00000be5,0x00000bd5,0x00050082,0x0000000d,
+0x00000be6,0x00000be4,0x00000be5,0x0003003e,
+0x00000be2,0x00000be6,0x00050041,0x0000000e,
+0x00000be8,0x00000b89,0x000000c9,0x0004003d,
+0x0000000d,0x00000be9,0x00000be8,0x00050082,
+0x0000000d,0x00000bea,0x000005e4,0x00000be9,
+0x00050041,0x0000000e,0x00000beb,0x00000b89,
+0x00000082,0x0004003d,0x0000000d,0x00000bec,
+0x00000beb,0x00050082,0x0000000d,0x00000bed,
+0x00000bea,0x00000bec,0x0004003d,0x0000000d,
+0x00000bee,0x00000bd5,0x00050080,0x0000000d,
+0x00000bef,0x00000bed,0x00000bee,0x0003003e,
+0x00000be7,0x00000bef,0x0004003d,0x00000551,
+0x00000bf1,0x00000b95,0x0004003d,0x0000000d,
+0x00000bf2,0x00000be7,0x00050050,0x00000551,
+0x00000bf3,0x00000bf2,0x00000bf2,0x00050084,
+0x00000551,0x00000bf4,0x00000bf1,0x00000bf3,
+0x0004003d,0x00000551,0x00000bf5,0x00000ba2,
+0x0004003d,0x0000000d,0x00000bf6,0x00000be2,
+0x00050050,0x00000551,0x00000bf7,0x00000bf6,
+0x00000bf6,0x00050084,0x00000551,0x00000bf8,
+0x00000bf5,0x00000bf7,0x00050080,0x00000551,
+0x00000bf9,0x00000bf4,0x00000bf8,0x0004003d,
+0x00000551,0x00000bfa,0x00000bb1,0x0004003d,
+0x0000000d,0x00000bfb,0x00000bdd,0x00050050,
+0x00000551,0x00000bfc,0x00000bfb,0x00000bfb,
+0x00050084,0x00000551,0x00000bfd,0x00000bfa,
+0x00000bfc,0x00050080,0x00000551,0x00000bfe,
+0x00000bf9,0x00000bfd,0x0004003d,0x00000551,
+0x00000bff,0x00000bc2,0x0004003d,0x0000000d,
+0x00000c00,0x00000bd5,0x00050050,0x00000551,
+0x00000c01,0x00000c00,0x00000c00,0x00050084,
+0x00000551,0x00000c02,0x00000bff,0x00000c01,
+0x00050080,0x00000551,0x00000c03,0x00000bfe,
+0x00000c02,0x00050050,0x00000551,0x00000c04,
+0x000000da,0x000000da,0x00050080,0x00000551,
+0x00000c05,0x00000c03,0x00000c04,0x00050050,
+0x00000b82,0x00000c06,0x0000052a,0x0000052a,
+0x000500c2,0x00000551,0x00000c07,0x00000c05,
+0x00000c06,0x0003003e,0x00000bf0,0x00000c07,
+0x0004003d,0x0000000d,0x00000c09,0x00000b4c,
+0x00060041,0x00000016,0x00000c0a,0x00000b0f,
+0x00000c09,0x00000109,0x0004003d,0x00000015,
+0x00000c0b,0x00000c0a,0x0003003e,0x00000c08,
+0x00000c0b,0x0004003d,0x0000000d,0x00000c0d,
+0x00000b4c,0x00060041,0x00000016,0x00000c0e,
+0x00000b0f,0x00000c0d,0x0000008e,0x0004003d,
+0x00000015,0x00000c0f,0x00000c0e,0x0003003e,
+0x00000c0c,0x00000c0f,0x0004003d,0x00000015,
+0x00000c11,0x00000c08,0x00050041,0x0000000e,
+0x00000c12,0x00000bf0,0x000000c9,0x0004003d,
+0x0000000d,0x00000c13,0x00000c12,0x00050082,
+0x0000000d,0x00000c14,0x0000076d,0x00000c13,
+0x00070050,0x00000015,0x00000c15,0x00000c14,
+0x00000c14,0x00000c14,0x00000c14,0x00050084,
+0x00000015,0x00000c16,0x00000c11,0x00000c15,
+0x0004003d,0x00000015,0x00000c17,0x00000c0c,
+0x00050041,0x0000000e,0x00000c18,0x00000bf0,
+0x000000c9,0x0004003d,0x0000000d,0x00000c19,
+0x00000c18,0x00070050,0x00000015,0x00000c1a,
+0x00000c19,0x00000c19,0x00000c19,0x00000c19,
+0x00050084,0x00000015,0x00000c1b,0x00000c17,
+0x00000c1a,0x00050080,0x00000015,0x00000c1c,
+0x00000c16,0x00000c1b,0x00070050,0x00000015,
+0x00000c1d,0x00000088,0x00000088,0x00000088,
+0x00000088,0x00050080,0x00000015,0x00000c1e,
+0x00000c1c,0x00000c1d,0x00070050,0x00000015,
+0x00000c1f,0x0000076d,0x0000076d,0x0000076d,
+0x0000076d,0x00050086,0x00000015,0x00000c20,
+0x00000c1e,0x00000c1f,0x0003003e,0x00000c10,
+0x00000c20,0x0004003d,0x0000000d,0x00000c21,
+0x000006c1,0x000500aa,0x00000099,0x00000c22,
+0x00000c21,0x00000082,0x000300f7,0x00000c24,
+0x00000000,0x000400fa,0x00000c22,0x00000c23,
+0x00000c24,0x000200f8,0x00000c23,0x0003003e,
+0x00000c26,0x00000076,0x0004003d,0x0000000d,
+0x00000c28,0x000008c4,0x0003003e,0x00000c27,
+0x00000c28,0x0003003e,0x00000c29,0x000000e7,
+0x00070039,0x0000000d,0x00000c2a,0x0000001b,
+0x00000c26,0x00000c27,0x00000c29,0x0003003e,
+0x00000c25,0x00000c2a,0x0004003d,0x0000000d,
+0x00000c2b,0x00000c25,0x0004003d,0x0000000d,
+0x00000c2c,0x00000c25,0x00050041,0x0000000e,
+0x00000c2d,0x00000c08,0x00000c2c,0x0004003d,
+0x0000000d,0x00000c2e,0x00000c2d,0x00050041,
+0x0000000e,0x00000c2f,0x00000bf0,0x00000082,
+0x0004003d,0x0000000d,0x00000c30,0x00000c2f,
+0x00050082,0x0000000d,0x00000c31,0x0000076d,
+0x00000c30,0x00050084,0x0000000d,0x00000c32,
+0x00000c2e,0x00000c31,0x0004003d,0x0000000d,
+0x00000c33,0x00000c25,0x00050041,0x0000000e,
+0x00000c34,0x00000c0c,0x00000c33,0x0004003d,
+0x0000000d,0x00000c35,0x00000c34,0x00050041,
+0x0000000e,0x00000c36,0x00000bf0,0x00000082,
+0x0004003d,0x0000000d,0x00000c37,0x00000c36,
+0x00050084,0x0000000d,0x00000c38,0x00000c35,
+0x00000c37,0x00050080,0x0000000d,0x00000c39,
+0x00000c32,0x00000c38,0x00050080,0x0000000d,
+0x00000c3a,0x00000c39,0x00000088,0x00050086,
+0x0000000d,0x00000c3b,0x00000c3a,0x0000076d,
+0x00050041,0x0000000e,0x00000c3c,0x00000c10,
+0x00000c2b,0x0003003e,0x00000c3c,0x00000c3b,
+0x000200f9,0x00000c24,0x000200f8,0x00000c24,
+0x0004003d,0x0000000d,0x00000c3d,0x00000b38,
+0x00060041,0x00000555,0x00000c3e,0x00000554,
+0x00000109,0x000000c9,0x0004003d,0x0000000d,
+0x00000c3f,0x00000c3e,0x00050084,0x0000000d,
+0x00000c40,0x00000c3d,0x00000c3f,0x0004003d,
+0x0000000d,0x00000c41,0x00000b42,0x00050080,
+0x0000000d,0x00000c42,0x00000c40,0x00000c41,
+0x0004003d,0x00000015,0x00000c43,0x00000c10,
+0x00050041,0x00000016,0x00000c44,0x00000b67,
+0x00000c42,0x0003003e,0x00000c44,0x00000c43,
+0x000200f9,0x00000b46,0x000200f8,0x00000b46,
+0x0004003d,0x0000000d,0x00000c45,0x00000b42,
+0x00050080,0x0000000d,0x00000c46,0x00000c45,
+0x0000008e,0x0003003e,0x00000b42,0x00000c46,
+0x000200f9,0x00000b43,0x000200f8,0x00000b45,
+0x000200f9,0x00000b3c,0x000200f8,0x00000b3c,
+0x0004003d,0x0000000d,0x00000c47,0x00000b38,
+0x00050080,0x0000000d,0x00000c48,0x00000c47,
+0x0000008e,0x0003003e,0x00000b38,0x00000c48,
+0x000200f9,0x00000b39,0x000200f8,0x00000b3b,
+0x0004003d,0x0000006d,0x00000c49,0x00000b67,
+0x000200fe,0x00000c49,0x00010038,0x00050036,
+0x0000000d,0x0000007a,0x00000000,0x00000079,
+0x000200f8,0x0000007b,0x00060041,0x00000555,
+0x00000c4c,0x00000554,0x00000109,0x00000082,
+0x0004003d,0x0000000d,0x00000c4d,0x00000c4c,
+0x000200fe,0x00000c4d,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_1D.inl
new file mode 100644
index 00000000000..aa9847a5206
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_1D.inl
@@ -0,0 +1,640 @@
+0x07230203,0x00010300,0x000d000a,0x000001bf,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x00020011,0x00000031,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x00000132,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00070005,0x0000000c,0x50746567,
+0x4431736f,0x61727241,0x69762879,0x00003b33,
+0x00030005,0x0000000b,0x00736f70,0x000e0005,
+0x00000019,0x5f636165,0x6f636564,0x735f6564,
+0x6c676e69,0x68635f65,0x656e6e61,0x6c625f6c,
+0x5f6b636f,0x616f6c66,0x31752874,0x3b31753b,
+0x003b3162,0x00040005,0x00000016,0x68676968,
+0x00000000,0x00030005,0x00000017,0x00776f6c,
+0x00050005,0x00000018,0x69537369,0x64656e67,
+0x00000000,0x00050005,0x0000001d,0x70696c66,
+0x75283233,0x00003b31,0x00030005,0x0000001c,
+0x00000061,0x00060005,0x00000024,0x65736162,
+0x646f635f,0x726f7765,0x00000064,0x00050005,
+0x0000003a,0x746c756d,0x696c7069,0x00007265,
+0x00040005,0x00000042,0x496c6274,0x00007864,
+0x00040005,0x0000004a,0x6c626174,0x00003065,
+0x00050005,0x0000008e,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000091,0x6c626174,
+0x00003165,0x00050005,0x00000096,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x0000009b,
+0x00000070,0x00030005,0x000000c4,0x00000069,
+0x00040005,0x000000cd,0x4974756f,0x00007864,
+0x00050005,0x000000d5,0x69646f6d,0x72656966,
+0x00000000,0x00060005,0x000000db,0x69646f6d,
+0x72656966,0x756c6156,0x00000065,0x00040005,
+0x000000ea,0x6f636564,0x00646564,0x00040005,
+0x00000101,0x75736572,0x0000746c,0x00030005,
+0x0000012f,0x00736f70,0x00080005,0x00000132,
+0x475f6c67,0x61626f6c,0x766e496c,0x7461636f,
+0x496e6f69,0x00000044,0x00070005,0x00000135,
+0x67616d49,0x726f4665,0x4274616d,0x6b636f6c,
+0x00000000,0x00060006,0x00000135,0x00000000,
+0x706d6f63,0x6d726f46,0x00007461,0x00060006,
+0x00000135,0x00000001,0x65736162,0x6579614c,
+0x00000072,0x00060005,0x00000137,0x75705f75,
+0x6f436873,0x6174736e,0x0000746e,0x00050005,
+0x00000142,0x42637273,0x6b636f6c,0x00000000,
+0x00050005,0x00000145,0x6d695f75,0x30656761,
+0x00000000,0x00040005,0x00000147,0x61726170,
+0x0000006d,0x00060005,0x0000014b,0x6f636564,
+0x6572706d,0x64657373,0x00000000,0x00040005,
+0x0000014c,0x61726170,0x0000006d,0x00040005,
+0x00000150,0x61726170,0x0000006d,0x00040005,
+0x00000155,0x61726170,0x0000006d,0x00040005,
+0x00000156,0x61726170,0x0000006d,0x00040005,
+0x00000157,0x61726170,0x0000006d,0x00030005,
+0x00000159,0x00000079,0x00030005,0x00000161,
+0x00000078,0x00050005,0x0000016b,0x6d695f75,
+0x31656761,0x00000000,0x00040005,0x0000017a,
+0x61726170,0x0000006d,0x00040047,0x00000132,
+0x0000000b,0x0000001c,0x00050048,0x00000135,
+0x00000000,0x00000023,0x00000000,0x00050048,
+0x00000135,0x00000001,0x00000023,0x00000004,
+0x00030047,0x00000135,0x00000002,0x00040047,
+0x00000145,0x00000022,0x00000000,0x00040047,
+0x00000145,0x00000021,0x00000000,0x00030047,
+0x00000145,0x00000018,0x00040047,0x0000016b,
+0x00000022,0x00000000,0x00040047,0x0000016b,
+0x00000021,0x00000001,0x00030047,0x0000016b,
+0x00000019,0x00040047,0x000001be,0x0000000b,
+0x00000019,0x00020013,0x00000002,0x00030021,
+0x00000003,0x00000002,0x00040015,0x00000006,
+0x00000020,0x00000001,0x00040017,0x00000007,
+0x00000006,0x00000003,0x00040020,0x00000008,
+0x00000007,0x00000007,0x00040017,0x00000009,
+0x00000006,0x00000002,0x00040021,0x0000000a,
+0x00000009,0x00000008,0x00040015,0x0000000e,
+0x00000020,0x00000000,0x00040020,0x0000000f,
+0x00000007,0x0000000e,0x00020014,0x00000010,
+0x00040020,0x00000011,0x00000007,0x00000010,
+0x00030016,0x00000012,0x00000020,0x0004002b,
+0x0000000e,0x00000013,0x00000010,0x0004001c,
+0x00000014,0x00000012,0x00000013,0x00060021,
+0x00000015,0x00000014,0x0000000f,0x0000000f,
+0x00000011,0x00040021,0x0000001b,0x0000000e,
+0x0000000f,0x00040020,0x00000023,0x00000007,
+0x00000006,0x0004002b,0x00000006,0x00000026,
+0x00000018,0x0004002b,0x00000006,0x0000002d,
+0x00000080,0x0004002b,0x00000006,0x00000031,
+0x00000100,0x0004002b,0x00000006,0x00000035,
+0xffffff80,0x0004002b,0x00000006,0x00000039,
+0xffffff81,0x0004002b,0x00000006,0x0000003c,
+0x00000014,0x0004002b,0x00000006,0x0000003f,
+0x0000000f,0x0004002b,0x00000006,0x00000044,
+0x00000010,0x0004002b,0x0000000e,0x00000046,
+0x0000000f,0x00040017,0x00000048,0x00000006,
+0x00000004,0x00040020,0x00000049,0x00000007,
+0x00000048,0x0004002b,0x0000000e,0x0000004b,
+0x00000020,0x0004001c,0x0000004c,0x00000048,
+0x0000004b,0x0004002b,0x00000006,0x0000004d,
+0xfffffffd,0x0004002b,0x00000006,0x0000004e,
+0xfffffffa,0x0004002b,0x00000006,0x0000004f,
+0xfffffff7,0x0004002b,0x00000006,0x00000050,
+0xfffffff1,0x0007002c,0x00000048,0x00000051,
+0x0000004d,0x0000004e,0x0000004f,0x00000050,
+0x0004002b,0x00000006,0x00000052,0x00000002,
+0x0004002b,0x00000006,0x00000053,0x00000005,
+0x0004002b,0x00000006,0x00000054,0x00000008,
+0x0004002b,0x00000006,0x00000055,0x0000000e,
+0x0007002c,0x00000048,0x00000056,0x00000052,
+0x00000053,0x00000054,0x00000055,0x0004002b,
+0x00000006,0x00000057,0xfffffff9,0x0004002b,
+0x00000006,0x00000058,0xfffffff6,0x0004002b,
+0x00000006,0x00000059,0xfffffff3,0x0007002c,
+0x00000048,0x0000005a,0x0000004d,0x00000057,
+0x00000058,0x00000059,0x0004002b,0x00000006,
+0x0000005b,0x00000006,0x0004002b,0x00000006,
+0x0000005c,0x00000009,0x0004002b,0x00000006,
+0x0000005d,0x0000000c,0x0007002c,0x00000048,
+0x0000005e,0x00000052,0x0000005b,0x0000005c,
+0x0000005d,0x0004002b,0x00000006,0x0000005f,
+0xfffffffe,0x0004002b,0x00000006,0x00000060,
+0xfffffffb,0x0004002b,0x00000006,0x00000061,
+0xfffffff8,0x0007002c,0x00000048,0x00000062,
+0x0000005f,0x00000060,0x00000061,0x00000059,
+0x0004002b,0x00000006,0x00000063,0x00000001,
+0x0004002b,0x00000006,0x00000064,0x00000004,
+0x0004002b,0x00000006,0x00000065,0x00000007,
+0x0007002c,0x00000048,0x00000066,0x00000063,
+0x00000064,0x00000065,0x0000005d,0x0004002b,
+0x00000006,0x00000067,0xfffffffc,0x0007002c,
+0x00000048,0x00000068,0x0000005f,0x00000067,
+0x0000004e,0x00000059,0x0004002b,0x00000006,
+0x00000069,0x00000003,0x0007002c,0x00000048,
+0x0000006a,0x00000063,0x00000069,0x00000053,
+0x0000005d,0x0004002b,0x00000006,0x0000006b,
+0xfffffff4,0x0007002c,0x00000048,0x0000006c,
+0x0000004d,0x0000004e,0x00000061,0x0000006b,
+0x0004002b,0x00000006,0x0000006d,0x0000000b,
+0x0007002c,0x00000048,0x0000006e,0x00000052,
+0x00000053,0x00000065,0x0000006d,0x0004002b,
+0x00000006,0x0000006f,0xfffffff5,0x0007002c,
+0x00000048,0x00000070,0x0000004d,0x00000057,
+0x0000004f,0x0000006f,0x0004002b,0x00000006,
+0x00000071,0x0000000a,0x0007002c,0x00000048,
+0x00000072,0x00000052,0x0000005b,0x00000054,
+0x00000071,0x0007002c,0x00000048,0x00000073,
+0x00000067,0x00000057,0x00000061,0x0000006f,
+0x0007002c,0x00000048,0x00000074,0x00000069,
+0x0000005b,0x00000065,0x00000071,0x0007002c,
+0x00000048,0x00000075,0x0000004d,0x00000060,
+0x00000061,0x0000006f,0x0007002c,0x00000048,
+0x00000076,0x00000052,0x00000064,0x00000065,
+0x00000071,0x0007002c,0x00000048,0x00000077,
+0x0000005f,0x0000004e,0x00000061,0x00000058,
+0x0007002c,0x00000048,0x00000078,0x00000063,
+0x00000053,0x00000065,0x0000005c,0x0007002c,
+0x00000048,0x00000079,0x0000005f,0x00000060,
+0x00000061,0x00000058,0x0007002c,0x00000048,
+0x0000007a,0x00000063,0x00000064,0x00000065,
+0x0000005c,0x0007002c,0x00000048,0x0000007b,
+0x0000005f,0x00000067,0x00000061,0x00000058,
+0x0007002c,0x00000048,0x0000007c,0x00000063,
+0x00000069,0x00000065,0x0000005c,0x0007002c,
+0x00000048,0x0000007d,0x0000005f,0x00000060,
+0x00000057,0x00000058,0x0007002c,0x00000048,
+0x0000007e,0x00000063,0x00000064,0x0000005b,
+0x0000005c,0x0007002c,0x00000048,0x0000007f,
+0x0000004d,0x00000067,0x00000057,0x00000058,
+0x0007002c,0x00000048,0x00000080,0x00000052,
+0x00000069,0x0000005b,0x0000005c,0x0004002b,
+0x00000006,0x00000081,0xffffffff,0x0007002c,
+0x00000048,0x00000082,0x00000081,0x0000005f,
+0x0000004d,0x00000058,0x0004002b,0x00000006,
+0x00000083,0x00000000,0x0007002c,0x00000048,
+0x00000084,0x00000083,0x00000063,0x00000052,
+0x0000005c,0x0007002c,0x00000048,0x00000085,
+0x00000067,0x0000004e,0x00000061,0x0000004f,
+0x0007002c,0x00000048,0x00000086,0x00000069,
+0x00000053,0x00000065,0x00000054,0x0007002c,
+0x00000048,0x00000087,0x0000004d,0x00000060,
+0x00000057,0x0000004f,0x0007002c,0x00000048,
+0x00000088,0x00000052,0x00000064,0x0000005b,
+0x00000054,0x0023002c,0x0000004c,0x00000089,
+0x00000051,0x00000056,0x0000005a,0x0000005e,
+0x00000062,0x00000066,0x00000068,0x0000006a,
+0x0000006c,0x0000006e,0x00000070,0x00000072,
+0x00000073,0x00000074,0x00000075,0x00000076,
+0x00000077,0x00000078,0x00000079,0x0000007a,
+0x0000007b,0x0000007c,0x0000007d,0x0000007e,
+0x0000007f,0x00000080,0x00000082,0x00000084,
+0x00000085,0x00000086,0x00000087,0x00000088,
+0x0004002b,0x0000000e,0x0000008b,0x00000002,
+0x00040020,0x0000008d,0x00000007,0x0000004c,
+0x0004002b,0x0000000e,0x00000094,0x00000001,
+0x0004001c,0x00000099,0x0000000e,0x00000013,
+0x00040020,0x0000009a,0x00000007,0x00000099,
+0x0004002b,0x00000006,0x0000009d,0x0000000d,
+0x0004002b,0x00000006,0x000000aa,0x0000001e,
+0x0004002b,0x00000006,0x000000ae,0x0000001b,
+0x0004002b,0x00000006,0x000000b3,0x00000015,
+0x0004002b,0x00000006,0x000000b6,0x00000012,
+0x0004002b,0x0000000e,0x000000c5,0x00000000,
+0x0004002b,0x0000000e,0x000000cf,0x00000004,
+0x0004002b,0x0000000e,0x000000d9,0x00000007,
+0x0004002b,0x00000006,0x000000fd,0xfffffc01,
+0x0004002b,0x00000006,0x000000fe,0x000003ff,
+0x00040020,0x00000100,0x00000007,0x00000014,
+0x0004002b,0x00000012,0x00000105,0x447fc000,
+0x00040020,0x00000107,0x00000007,0x00000012,
+0x0004002b,0x00000006,0x0000010d,0x000007ff,
+0x0004002b,0x00000012,0x00000112,0x44ffe000,
+0x0004002b,0x0000000e,0x0000011b,0x000000ff,
+0x0004002b,0x0000000e,0x0000011f,0x0000ff00,
+0x0004002b,0x0000000e,0x00000124,0x00ff0000,
+0x0004002b,0x0000000e,0x00000129,0xff000000,
+0x00040017,0x00000130,0x0000000e,0x00000003,
+0x00040020,0x00000131,0x00000001,0x00000130,
+0x0004003b,0x00000131,0x00000132,0x00000001,
+0x0004001e,0x00000135,0x0000000e,0x0000000e,
+0x00040020,0x00000136,0x00000009,0x00000135,
+0x0004003b,0x00000136,0x00000137,0x00000009,
+0x00040020,0x00000138,0x00000009,0x0000000e,
+0x00040017,0x00000140,0x0000000e,0x00000004,
+0x00040020,0x00000141,0x00000007,0x00000140,
+0x00090019,0x00000143,0x0000000e,0x00000000,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x00000023,0x00040020,0x00000144,0x00000000,
+0x00000143,0x0004003b,0x00000144,0x00000145,
+0x00000000,0x00030029,0x00000010,0x00000154,
+0x00090019,0x00000169,0x00000012,0x00000000,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x00000013,0x00040020,0x0000016a,0x00000000,
+0x00000169,0x0004003b,0x0000016a,0x0000016b,
+0x00000000,0x0004002b,0x00000012,0x00000182,
+0x00000000,0x0004002b,0x00000012,0x00000183,
+0x3f800000,0x00040017,0x00000184,0x00000012,
+0x00000004,0x0004002b,0x0000000e,0x0000018a,
+0x00000093,0x0004002b,0x0000000e,0x0000018b,
+0x00000094,0x0004002b,0x0000000e,0x0000018c,
+0x00000095,0x0004002b,0x0000000e,0x0000018d,
+0x00000096,0x0004002b,0x0000000e,0x0000018e,
+0x00000097,0x0004002b,0x0000000e,0x0000018f,
+0x00000098,0x0004002b,0x0000000e,0x00000190,
+0x00000099,0x0004002b,0x0000000e,0x00000191,
+0x0000009a,0x0004002b,0x0000000e,0x00000192,
+0x0000009b,0x0004002b,0x0000000e,0x00000193,
+0x0000009c,0x0004002b,0x0000000e,0x00000194,
+0x00000008,0x0004001c,0x00000195,0x00000006,
+0x00000194,0x000b002c,0x00000195,0x00000196,
+0x00000083,0x00000063,0x00000052,0x00000069,
+0x00000067,0x0000004d,0x0000005f,0x00000081,
+0x0004001c,0x00000197,0x00000048,0x00000194,
+0x0007002c,0x00000048,0x00000198,0x00000052,
+0x00000054,0x0000005f,0x00000061,0x0004002b,
+0x00000006,0x00000199,0x00000011,0x0004002b,
+0x00000006,0x0000019a,0xffffffef,0x0007002c,
+0x00000048,0x0000019b,0x00000053,0x00000199,
+0x00000060,0x0000019a,0x0004002b,0x00000006,
+0x0000019c,0x0000001d,0x0004002b,0x00000006,
+0x0000019d,0xffffffe3,0x0007002c,0x00000048,
+0x0000019e,0x0000005c,0x0000019c,0x0000004f,
+0x0000019d,0x0004002b,0x00000006,0x0000019f,
+0x0000002a,0x0004002b,0x00000006,0x000001a0,
+0xffffffd6,0x0007002c,0x00000048,0x000001a1,
+0x0000009d,0x0000019f,0x00000059,0x000001a0,
+0x0004002b,0x00000006,0x000001a2,0x0000003c,
+0x0004002b,0x00000006,0x000001a3,0xffffffee,
+0x0004002b,0x00000006,0x000001a4,0xffffffc4,
+0x0007002c,0x00000048,0x000001a5,0x000000b6,
+0x000001a2,0x000001a3,0x000001a4,0x0004002b,
+0x00000006,0x000001a6,0x00000050,0x0004002b,
+0x00000006,0x000001a7,0xffffffe8,0x0004002b,
+0x00000006,0x000001a8,0xffffffb0,0x0007002c,
+0x00000048,0x000001a9,0x00000026,0x000001a6,
+0x000001a7,0x000001a8,0x0004002b,0x00000006,
+0x000001aa,0x00000021,0x0004002b,0x00000006,
+0x000001ab,0x0000006a,0x0004002b,0x00000006,
+0x000001ac,0xffffffdf,0x0004002b,0x00000006,
+0x000001ad,0xffffff96,0x0007002c,0x00000048,
+0x000001ae,0x000001aa,0x000001ab,0x000001ac,
+0x000001ad,0x0004002b,0x00000006,0x000001af,
+0x0000002f,0x0004002b,0x00000006,0x000001b0,
+0x000000b7,0x0004002b,0x00000006,0x000001b1,
+0xffffffd1,0x0004002b,0x00000006,0x000001b2,
+0xffffff49,0x0007002c,0x00000048,0x000001b3,
+0x000001af,0x000001b0,0x000001b1,0x000001b2,
+0x000b002c,0x00000197,0x000001b4,0x00000198,
+0x0000019b,0x0000019e,0x000001a1,0x000001a5,
+0x000001a9,0x000001ae,0x000001b3,0x0007002c,
+0x00000048,0x000001b5,0x00000083,0x00000054,
+0x00000083,0x00000061,0x0007002c,0x00000048,
+0x000001b6,0x00000083,0x00000199,0x00000083,
+0x0000019a,0x0007002c,0x00000048,0x000001b7,
+0x00000083,0x0000019c,0x00000083,0x0000019d,
+0x0007002c,0x00000048,0x000001b8,0x00000083,
+0x0000019f,0x00000083,0x000001a0,0x0007002c,
+0x00000048,0x000001b9,0x00000083,0x000001a2,
+0x00000083,0x000001a4,0x0007002c,0x00000048,
+0x000001ba,0x00000083,0x000001a6,0x00000083,
+0x000001a8,0x0007002c,0x00000048,0x000001bb,
+0x00000083,0x000001ab,0x00000083,0x000001ad,
+0x0007002c,0x00000048,0x000001bc,0x00000083,
+0x000001b0,0x00000083,0x000001b2,0x000b002c,
+0x00000197,0x000001bd,0x000001b5,0x000001b6,
+0x000001b7,0x000001b8,0x000001b9,0x000001ba,
+0x000001bb,0x000001bc,0x0006002c,0x00000130,
+0x000001be,0x00000194,0x00000194,0x00000094,
+0x00050036,0x00000002,0x00000004,0x00000000,
+0x00000003,0x000200f8,0x00000005,0x0004003b,
+0x00000008,0x0000012f,0x00000007,0x0004003b,
+0x00000141,0x00000142,0x00000007,0x0004003b,
+0x00000008,0x00000147,0x00000007,0x0004003b,
+0x00000100,0x0000014b,0x00000007,0x0004003b,
+0x0000000f,0x0000014c,0x00000007,0x0004003b,
+0x0000000f,0x00000150,0x00000007,0x0004003b,
+0x0000000f,0x00000155,0x00000007,0x0004003b,
+0x0000000f,0x00000156,0x00000007,0x0004003b,
+0x00000011,0x00000157,0x00000007,0x0004003b,
+0x00000023,0x00000159,0x00000007,0x0004003b,
+0x00000023,0x00000161,0x00000007,0x0004003b,
+0x00000008,0x0000017a,0x00000007,0x0004003d,
+0x00000130,0x00000133,0x00000132,0x0004007c,
+0x00000007,0x00000134,0x00000133,0x0003003e,
+0x0000012f,0x00000134,0x00050041,0x00000138,
+0x00000139,0x00000137,0x00000063,0x0004003d,
+0x0000000e,0x0000013a,0x00000139,0x0004007c,
+0x00000006,0x0000013b,0x0000013a,0x00050041,
+0x00000023,0x0000013c,0x0000012f,0x0000008b,
+0x0004003d,0x00000006,0x0000013d,0x0000013c,
+0x00050080,0x00000006,0x0000013e,0x0000013d,
+0x0000013b,0x00050041,0x00000023,0x0000013f,
+0x0000012f,0x0000008b,0x0003003e,0x0000013f,
+0x0000013e,0x0004003d,0x00000143,0x00000146,
+0x00000145,0x0004003d,0x00000007,0x00000148,
+0x0000012f,0x0003003e,0x00000147,0x00000148,
+0x00050039,0x00000009,0x00000149,0x0000000c,
+0x00000147,0x00050062,0x00000140,0x0000014a,
+0x00000146,0x00000149,0x0003003e,0x00000142,
+0x0000014a,0x00050041,0x0000000f,0x0000014d,
+0x00000142,0x000000c5,0x0004003d,0x0000000e,
+0x0000014e,0x0000014d,0x0003003e,0x0000014c,
+0x0000014e,0x00050039,0x0000000e,0x0000014f,
+0x0000001d,0x0000014c,0x00050041,0x0000000f,
+0x00000151,0x00000142,0x00000094,0x0004003d,
+0x0000000e,0x00000152,0x00000151,0x0003003e,
+0x00000150,0x00000152,0x00050039,0x0000000e,
+0x00000153,0x0000001d,0x00000150,0x0003003e,
+0x00000155,0x0000014f,0x0003003e,0x00000156,
+0x00000153,0x0003003e,0x00000157,0x00000154,
+0x00070039,0x00000014,0x00000158,0x00000019,
+0x00000155,0x00000156,0x00000157,0x0003003e,
+0x0000014b,0x00000158,0x0003003e,0x00000159,
+0x00000083,0x000200f9,0x0000015a,0x000200f8,
+0x0000015a,0x000400f6,0x0000015c,0x0000015d,
+0x00000000,0x000200f9,0x0000015e,0x000200f8,
+0x0000015e,0x0004003d,0x00000006,0x0000015f,
+0x00000159,0x000500b1,0x00000010,0x00000160,
+0x0000015f,0x00000063,0x000400fa,0x00000160,
+0x0000015b,0x0000015c,0x000200f8,0x0000015b,
+0x0003003e,0x00000161,0x00000083,0x000200f9,
+0x00000162,0x000200f8,0x00000162,0x000400f6,
+0x00000164,0x00000165,0x00000000,0x000200f9,
+0x00000166,0x000200f8,0x00000166,0x0004003d,
+0x00000006,0x00000167,0x00000161,0x000500b1,
+0x00000010,0x00000168,0x00000167,0x00000064,
+0x000400fa,0x00000168,0x00000163,0x00000164,
+0x000200f8,0x00000163,0x0004003d,0x00000169,
+0x0000016c,0x0000016b,0x0004003d,0x00000007,
+0x0000016d,0x0000012f,0x0007004f,0x00000009,
+0x0000016e,0x0000016d,0x0000016d,0x00000000,
+0x00000001,0x00050050,0x00000009,0x0000016f,
+0x00000064,0x00000064,0x00050084,0x00000009,
+0x00000170,0x0000016e,0x0000016f,0x0004003d,
+0x00000006,0x00000171,0x00000161,0x0004003d,
+0x00000006,0x00000172,0x00000159,0x00050050,
+0x00000009,0x00000173,0x00000171,0x00000172,
+0x00050080,0x00000009,0x00000174,0x00000170,
+0x00000173,0x00050041,0x00000023,0x00000175,
+0x0000012f,0x0000008b,0x0004003d,0x00000006,
+0x00000176,0x00000175,0x00050051,0x00000006,
+0x00000177,0x00000174,0x00000000,0x00050051,
+0x00000006,0x00000178,0x00000174,0x00000001,
+0x00060050,0x00000007,0x00000179,0x00000177,
+0x00000178,0x00000176,0x0003003e,0x0000017a,
+0x00000179,0x00050039,0x00000009,0x0000017b,
+0x0000000c,0x0000017a,0x0004003d,0x00000006,
+0x0000017c,0x00000159,0x00050084,0x00000006,
+0x0000017d,0x0000017c,0x00000064,0x0004003d,
+0x00000006,0x0000017e,0x00000161,0x00050080,
+0x00000006,0x0000017f,0x0000017d,0x0000017e,
+0x00050041,0x00000107,0x00000180,0x0000014b,
+0x0000017f,0x0004003d,0x00000012,0x00000181,
+0x00000180,0x00070050,0x00000184,0x00000185,
+0x00000181,0x00000182,0x00000182,0x00000183,
+0x00040063,0x0000016c,0x0000017b,0x00000185,
+0x000200f9,0x00000165,0x000200f8,0x00000165,
+0x0004003d,0x00000006,0x00000186,0x00000161,
+0x00050080,0x00000006,0x00000187,0x00000186,
+0x00000063,0x0003003e,0x00000161,0x00000187,
+0x000200f9,0x00000162,0x000200f8,0x00000164,
+0x000200f9,0x0000015d,0x000200f8,0x0000015d,
+0x0004003d,0x00000006,0x00000188,0x00000159,
+0x00050080,0x00000006,0x00000189,0x00000188,
+0x00000063,0x0003003e,0x00000159,0x00000189,
+0x000200f9,0x0000015a,0x000200f8,0x0000015c,
+0x000100fd,0x00010038,0x00050036,0x00000009,
+0x0000000c,0x00000000,0x0000000a,0x00030037,
+0x00000008,0x0000000b,0x000200f8,0x0000000d,
+0x0004003d,0x00000007,0x0000001f,0x0000000b,
+0x0007004f,0x00000009,0x00000020,0x0000001f,
+0x0000001f,0x00000000,0x00000002,0x000200fe,
+0x00000020,0x00010038,0x00050036,0x00000014,
+0x00000019,0x00000000,0x00000015,0x00030037,
+0x0000000f,0x00000016,0x00030037,0x0000000f,
+0x00000017,0x00030037,0x00000011,0x00000018,
+0x000200f8,0x0000001a,0x0004003b,0x00000023,
+0x00000024,0x00000007,0x0004003b,0x00000023,
+0x0000003a,0x00000007,0x0004003b,0x0000000f,
+0x00000042,0x00000007,0x0004003b,0x00000049,
+0x0000004a,0x00000007,0x0004003b,0x0000008d,
+0x0000008e,0x00000007,0x0004003b,0x00000049,
+0x00000091,0x00000007,0x0004003b,0x0000008d,
+0x00000096,0x00000007,0x0004003b,0x0000009a,
+0x0000009b,0x00000007,0x0004003b,0x0000000f,
+0x000000c4,0x00000007,0x0004003b,0x0000000f,
+0x000000cd,0x00000007,0x0004003b,0x0000000f,
+0x000000d5,0x00000007,0x0004003b,0x00000023,
+0x000000db,0x00000007,0x0004003b,0x00000023,
+0x000000de,0x00000007,0x0004003b,0x00000023,
+0x000000ea,0x00000007,0x0004003b,0x00000100,
+0x00000101,0x00000007,0x0004003d,0x0000000e,
+0x00000025,0x00000016,0x000500c2,0x0000000e,
+0x00000027,0x00000025,0x00000026,0x0004007c,
+0x00000006,0x00000028,0x00000027,0x0003003e,
+0x00000024,0x00000028,0x0004003d,0x00000010,
+0x00000029,0x00000018,0x000300f7,0x0000002b,
+0x00000000,0x000400fa,0x00000029,0x0000002a,
+0x0000002b,0x000200f8,0x0000002a,0x0004003d,
+0x00000006,0x0000002c,0x00000024,0x000500af,
+0x00000010,0x0000002e,0x0000002c,0x0000002d,
+0x000300f7,0x00000030,0x00000000,0x000400fa,
+0x0000002e,0x0000002f,0x00000030,0x000200f8,
+0x0000002f,0x0004003d,0x00000006,0x00000032,
+0x00000024,0x00050082,0x00000006,0x00000033,
+0x00000032,0x00000031,0x0003003e,0x00000024,
+0x00000033,0x000200f9,0x00000030,0x000200f8,
+0x00000030,0x0004003d,0x00000006,0x00000034,
+0x00000024,0x000500aa,0x00000010,0x00000036,
+0x00000034,0x00000035,0x000300f7,0x00000038,
+0x00000000,0x000400fa,0x00000036,0x00000037,
+0x00000038,0x000200f8,0x00000037,0x0003003e,
+0x00000024,0x00000039,0x000200f9,0x00000038,
+0x000200f8,0x00000038,0x000200f9,0x0000002b,
+0x000200f8,0x0000002b,0x0004003d,0x0000000e,
+0x0000003b,0x00000016,0x000500c2,0x0000000e,
+0x0000003d,0x0000003b,0x0000003c,0x0004007c,
+0x00000006,0x0000003e,0x0000003d,0x0003003e,
+0x0000003a,0x0000003e,0x0004003d,0x00000006,
+0x00000040,0x0000003a,0x000500c7,0x00000006,
+0x00000041,0x00000040,0x0000003f,0x0003003e,
+0x0000003a,0x00000041,0x0004003d,0x0000000e,
+0x00000043,0x00000016,0x000500c2,0x0000000e,
+0x00000045,0x00000043,0x00000044,0x000500c7,
+0x0000000e,0x00000047,0x00000045,0x00000046,
+0x0003003e,0x00000042,0x00000047,0x0004003d,
+0x0000000e,0x0000008a,0x00000042,0x00050084,
+0x0000000e,0x0000008c,0x0000008a,0x0000008b,
+0x0003003e,0x0000008e,0x00000089,0x00050041,
+0x00000049,0x0000008f,0x0000008e,0x0000008c,
+0x0004003d,0x00000048,0x00000090,0x0000008f,
+0x0003003e,0x0000004a,0x00000090,0x0004003d,
+0x0000000e,0x00000092,0x00000042,0x00050084,
+0x0000000e,0x00000093,0x00000092,0x0000008b,
+0x00050080,0x0000000e,0x00000095,0x00000093,
+0x00000094,0x0003003e,0x00000096,0x00000089,
+0x00050041,0x00000049,0x00000097,0x00000096,
+0x00000095,0x0004003d,0x00000048,0x00000098,
+0x00000097,0x0003003e,0x00000091,0x00000098,
+0x0004003d,0x0000000e,0x0000009c,0x00000016,
+0x000500c2,0x0000000e,0x0000009e,0x0000009c,
+0x0000009d,0x0004003d,0x0000000e,0x0000009f,
+0x00000016,0x000500c2,0x0000000e,0x000000a0,
+0x0000009f,0x00000071,0x0004003d,0x0000000e,
+0x000000a1,0x00000016,0x000500c2,0x0000000e,
+0x000000a2,0x000000a1,0x00000065,0x0004003d,
+0x0000000e,0x000000a3,0x00000016,0x000500c2,
+0x0000000e,0x000000a4,0x000000a3,0x00000064,
+0x0004003d,0x0000000e,0x000000a5,0x00000016,
+0x000500c2,0x0000000e,0x000000a6,0x000000a5,
+0x00000063,0x0004003d,0x0000000e,0x000000a7,
+0x00000016,0x000500c4,0x0000000e,0x000000a8,
+0x000000a7,0x00000052,0x0004003d,0x0000000e,
+0x000000a9,0x00000017,0x000500c2,0x0000000e,
+0x000000ab,0x000000a9,0x000000aa,0x000500c5,
+0x0000000e,0x000000ac,0x000000a8,0x000000ab,
+0x0004003d,0x0000000e,0x000000ad,0x00000017,
+0x000500c2,0x0000000e,0x000000af,0x000000ad,
+0x000000ae,0x0004003d,0x0000000e,0x000000b0,
+0x00000017,0x000500c2,0x0000000e,0x000000b1,
+0x000000b0,0x00000026,0x0004003d,0x0000000e,
+0x000000b2,0x00000017,0x000500c2,0x0000000e,
+0x000000b4,0x000000b2,0x000000b3,0x0004003d,
+0x0000000e,0x000000b5,0x00000017,0x000500c2,
+0x0000000e,0x000000b7,0x000000b5,0x000000b6,
+0x0004003d,0x0000000e,0x000000b8,0x00000017,
+0x000500c2,0x0000000e,0x000000b9,0x000000b8,
+0x0000003f,0x0004003d,0x0000000e,0x000000ba,
+0x00000017,0x000500c2,0x0000000e,0x000000bb,
+0x000000ba,0x0000005d,0x0004003d,0x0000000e,
+0x000000bc,0x00000017,0x000500c2,0x0000000e,
+0x000000bd,0x000000bc,0x0000005c,0x0004003d,
+0x0000000e,0x000000be,0x00000017,0x000500c2,
+0x0000000e,0x000000bf,0x000000be,0x0000005b,
+0x0004003d,0x0000000e,0x000000c0,0x00000017,
+0x000500c2,0x0000000e,0x000000c1,0x000000c0,
+0x00000069,0x0004003d,0x0000000e,0x000000c2,
+0x00000017,0x00130050,0x00000099,0x000000c3,
+0x0000009e,0x000000a0,0x000000a2,0x000000a4,
+0x000000a6,0x000000ac,0x000000af,0x000000b1,
+0x000000b4,0x000000b7,0x000000b9,0x000000bb,
+0x000000bd,0x000000bf,0x000000c1,0x000000c2,
+0x0003003e,0x0000009b,0x000000c3,0x0003003e,
+0x000000c4,0x000000c5,0x000200f9,0x000000c6,
+0x000200f8,0x000000c6,0x000400f6,0x000000c8,
+0x000000c9,0x00000000,0x000200f9,0x000000ca,
+0x000200f8,0x000000ca,0x0004003d,0x0000000e,
+0x000000cb,0x000000c4,0x000500b0,0x00000010,
+0x000000cc,0x000000cb,0x00000013,0x000400fa,
+0x000000cc,0x000000c7,0x000000c8,0x000200f8,
+0x000000c7,0x0004003d,0x0000000e,0x000000ce,
+0x000000c4,0x00050089,0x0000000e,0x000000d0,
+0x000000ce,0x000000cf,0x00050084,0x0000000e,
+0x000000d1,0x000000d0,0x000000cf,0x0004003d,
+0x0000000e,0x000000d2,0x000000c4,0x00050086,
+0x0000000e,0x000000d3,0x000000d2,0x000000cf,
+0x00050080,0x0000000e,0x000000d4,0x000000d1,
+0x000000d3,0x0003003e,0x000000cd,0x000000d4,
+0x0004003d,0x0000000e,0x000000d6,0x000000c4,
+0x00050041,0x0000000f,0x000000d7,0x0000009b,
+0x000000d6,0x0004003d,0x0000000e,0x000000d8,
+0x000000d7,0x000500c7,0x0000000e,0x000000da,
+0x000000d8,0x000000d9,0x0003003e,0x000000d5,
+0x000000da,0x0004003d,0x0000000e,0x000000dc,
+0x000000d5,0x000500ae,0x00000010,0x000000dd,
+0x000000dc,0x000000cf,0x000300f7,0x000000e0,
+0x00000000,0x000400fa,0x000000dd,0x000000df,
+0x000000e5,0x000200f8,0x000000df,0x0004003d,
+0x0000000e,0x000000e1,0x000000d5,0x00050082,
+0x0000000e,0x000000e2,0x000000e1,0x000000cf,
+0x00050041,0x00000023,0x000000e3,0x00000091,
+0x000000e2,0x0004003d,0x00000006,0x000000e4,
+0x000000e3,0x0003003e,0x000000de,0x000000e4,
+0x000200f9,0x000000e0,0x000200f8,0x000000e5,
+0x0004003d,0x0000000e,0x000000e6,0x000000d5,
+0x00050041,0x00000023,0x000000e7,0x0000004a,
+0x000000e6,0x0004003d,0x00000006,0x000000e8,
+0x000000e7,0x0003003e,0x000000de,0x000000e8,
+0x000200f9,0x000000e0,0x000200f8,0x000000e0,
+0x0004003d,0x00000006,0x000000e9,0x000000de,
+0x0003003e,0x000000db,0x000000e9,0x0004003d,
+0x00000006,0x000000eb,0x00000024,0x0004003d,
+0x00000006,0x000000ec,0x000000db,0x0004003d,
+0x00000006,0x000000ed,0x0000003a,0x00050084,
+0x00000006,0x000000ee,0x000000ec,0x000000ed,
+0x00050080,0x00000006,0x000000ef,0x000000eb,
+0x000000ee,0x0003003e,0x000000ea,0x000000ef,
+0x0004003d,0x00000006,0x000000f0,0x000000ea,
+0x00050084,0x00000006,0x000000f1,0x000000f0,
+0x00000054,0x0003003e,0x000000ea,0x000000f1,
+0x0004003d,0x00000006,0x000000f2,0x0000003a,
+0x000500aa,0x00000010,0x000000f3,0x000000f2,
+0x00000083,0x000300f7,0x000000f5,0x00000000,
+0x000400fa,0x000000f3,0x000000f4,0x000000f5,
+0x000200f8,0x000000f4,0x0004003d,0x00000006,
+0x000000f6,0x000000db,0x0004003d,0x00000006,
+0x000000f7,0x000000ea,0x00050080,0x00000006,
+0x000000f8,0x000000f7,0x000000f6,0x0003003e,
+0x000000ea,0x000000f8,0x000200f9,0x000000f5,
+0x000200f8,0x000000f5,0x0004003d,0x00000010,
+0x000000f9,0x00000018,0x000300f7,0x000000fb,
+0x00000000,0x000400fa,0x000000f9,0x000000fa,
+0x00000109,0x000200f8,0x000000fa,0x0004003d,
+0x00000006,0x000000fc,0x000000ea,0x0008000c,
+0x00000006,0x000000ff,0x00000001,0x0000002d,
+0x000000fc,0x000000fd,0x000000fe,0x0003003e,
+0x000000ea,0x000000ff,0x0004003d,0x0000000e,
+0x00000102,0x000000cd,0x0004003d,0x00000006,
+0x00000103,0x000000ea,0x0004006f,0x00000012,
+0x00000104,0x00000103,0x00050088,0x00000012,
+0x00000106,0x00000104,0x00000105,0x00050041,
+0x00000107,0x00000108,0x00000101,0x00000102,
+0x0003003e,0x00000108,0x00000106,0x000200f9,
+0x000000fb,0x000200f8,0x00000109,0x0004003d,
+0x00000006,0x0000010a,0x000000ea,0x00050080,
+0x00000006,0x0000010b,0x0000010a,0x00000064,
+0x0003003e,0x000000ea,0x0000010b,0x0004003d,
+0x00000006,0x0000010c,0x000000ea,0x0008000c,
+0x00000006,0x0000010e,0x00000001,0x0000002d,
+0x0000010c,0x00000083,0x0000010d,0x0003003e,
+0x000000ea,0x0000010e,0x0004003d,0x0000000e,
+0x0000010f,0x000000cd,0x0004003d,0x00000006,
+0x00000110,0x000000ea,0x0004006f,0x00000012,
+0x00000111,0x00000110,0x00050088,0x00000012,
+0x00000113,0x00000111,0x00000112,0x00050041,
+0x00000107,0x00000114,0x00000101,0x0000010f,
+0x0003003e,0x00000114,0x00000113,0x000200f9,
+0x000000fb,0x000200f8,0x000000fb,0x000200f9,
+0x000000c9,0x000200f8,0x000000c9,0x0004003d,
+0x0000000e,0x00000115,0x000000c4,0x00050080,
+0x0000000e,0x00000116,0x00000115,0x00000063,
+0x0003003e,0x000000c4,0x00000116,0x000200f9,
+0x000000c6,0x000200f8,0x000000c8,0x0004003d,
+0x00000014,0x00000117,0x00000101,0x000200fe,
+0x00000117,0x00010038,0x00050036,0x0000000e,
+0x0000001d,0x00000000,0x0000001b,0x00030037,
+0x0000000f,0x0000001c,0x000200f8,0x0000001e,
+0x0004003d,0x0000000e,0x0000011a,0x0000001c,
+0x000500c7,0x0000000e,0x0000011c,0x0000011a,
+0x0000011b,0x000500c4,0x0000000e,0x0000011d,
+0x0000011c,0x00000026,0x0004003d,0x0000000e,
+0x0000011e,0x0000001c,0x000500c7,0x0000000e,
+0x00000120,0x0000011e,0x0000011f,0x000500c4,
+0x0000000e,0x00000121,0x00000120,0x00000054,
+0x000500c5,0x0000000e,0x00000122,0x0000011d,
+0x00000121,0x0004003d,0x0000000e,0x00000123,
+0x0000001c,0x000500c7,0x0000000e,0x00000125,
+0x00000123,0x00000124,0x000500c2,0x0000000e,
+0x00000126,0x00000125,0x00000054,0x000500c5,
+0x0000000e,0x00000127,0x00000122,0x00000126,
+0x0004003d,0x0000000e,0x00000128,0x0000001c,
+0x000500c7,0x0000000e,0x0000012a,0x00000128,
+0x00000129,0x000500c2,0x0000000e,0x0000012b,
+0x0000012a,0x00000026,0x000500c5,0x0000000e,
+0x0000012c,0x00000127,0x0000012b,0x000200fe,
+0x0000012c,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_2D.inl
new file mode 100644
index 00000000000..1ebfa68fd6d
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_2D.inl
@@ -0,0 +1,638 @@
+0x07230203,0x00010300,0x000d000a,0x000001be,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x00000031,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000130,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00070005,
+0x0000000b,0x50746567,0x4432736f,0x61727241,
+0x69762879,0x00003b33,0x00030005,0x0000000a,
+0x00736f70,0x000e0005,0x00000018,0x5f636165,
+0x6f636564,0x735f6564,0x6c676e69,0x68635f65,
+0x656e6e61,0x6c625f6c,0x5f6b636f,0x616f6c66,
+0x31752874,0x3b31753b,0x003b3162,0x00040005,
+0x00000015,0x68676968,0x00000000,0x00030005,
+0x00000016,0x00776f6c,0x00050005,0x00000017,
+0x69537369,0x64656e67,0x00000000,0x00050005,
+0x0000001c,0x70696c66,0x75283233,0x00003b31,
+0x00030005,0x0000001b,0x00000061,0x00060005,
+0x00000022,0x65736162,0x646f635f,0x726f7765,
+0x00000064,0x00050005,0x00000038,0x746c756d,
+0x696c7069,0x00007265,0x00040005,0x00000040,
+0x496c6274,0x00007864,0x00040005,0x00000048,
+0x6c626174,0x00003065,0x00050005,0x0000008c,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x0000008f,0x6c626174,0x00003165,0x00050005,
+0x00000094,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x00000099,0x00000070,0x00030005,
+0x000000c2,0x00000069,0x00040005,0x000000cb,
+0x4974756f,0x00007864,0x00050005,0x000000d3,
+0x69646f6d,0x72656966,0x00000000,0x00060005,
+0x000000d9,0x69646f6d,0x72656966,0x756c6156,
+0x00000065,0x00040005,0x000000e8,0x6f636564,
+0x00646564,0x00040005,0x000000ff,0x75736572,
+0x0000746c,0x00030005,0x0000012d,0x00736f70,
+0x00080005,0x00000130,0x475f6c67,0x61626f6c,
+0x766e496c,0x7461636f,0x496e6f69,0x00000044,
+0x00070005,0x00000133,0x67616d49,0x726f4665,
+0x4274616d,0x6b636f6c,0x00000000,0x00060006,
+0x00000133,0x00000000,0x706d6f63,0x6d726f46,
+0x00007461,0x00060006,0x00000133,0x00000001,
+0x65736162,0x6579614c,0x00000072,0x00060005,
+0x00000135,0x75705f75,0x6f436873,0x6174736e,
+0x0000746e,0x00050005,0x00000140,0x42637273,
+0x6b636f6c,0x00000000,0x00050005,0x00000143,
+0x6d695f75,0x30656761,0x00000000,0x00040005,
+0x00000145,0x61726170,0x0000006d,0x00060005,
+0x00000149,0x6f636564,0x6572706d,0x64657373,
+0x00000000,0x00040005,0x0000014a,0x61726170,
+0x0000006d,0x00040005,0x0000014e,0x61726170,
+0x0000006d,0x00040005,0x00000153,0x61726170,
+0x0000006d,0x00040005,0x00000154,0x61726170,
+0x0000006d,0x00040005,0x00000155,0x61726170,
+0x0000006d,0x00030005,0x00000157,0x00000079,
+0x00030005,0x0000015f,0x00000078,0x00050005,
+0x00000169,0x6d695f75,0x31656761,0x00000000,
+0x00040005,0x00000179,0x61726170,0x0000006d,
+0x00040047,0x00000130,0x0000000b,0x0000001c,
+0x00050048,0x00000133,0x00000000,0x00000023,
+0x00000000,0x00050048,0x00000133,0x00000001,
+0x00000023,0x00000004,0x00030047,0x00000133,
+0x00000002,0x00040047,0x00000143,0x00000022,
+0x00000000,0x00040047,0x00000143,0x00000021,
+0x00000000,0x00030047,0x00000143,0x00000018,
+0x00040047,0x00000169,0x00000022,0x00000000,
+0x00040047,0x00000169,0x00000021,0x00000001,
+0x00030047,0x00000169,0x00000019,0x00040047,
+0x000001bd,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000001,
+0x00040017,0x00000007,0x00000006,0x00000003,
+0x00040020,0x00000008,0x00000007,0x00000007,
+0x00040021,0x00000009,0x00000007,0x00000008,
+0x00040015,0x0000000d,0x00000020,0x00000000,
+0x00040020,0x0000000e,0x00000007,0x0000000d,
+0x00020014,0x0000000f,0x00040020,0x00000010,
+0x00000007,0x0000000f,0x00030016,0x00000011,
+0x00000020,0x0004002b,0x0000000d,0x00000012,
+0x00000010,0x0004001c,0x00000013,0x00000011,
+0x00000012,0x00060021,0x00000014,0x00000013,
+0x0000000e,0x0000000e,0x00000010,0x00040021,
+0x0000001a,0x0000000d,0x0000000e,0x00040020,
+0x00000021,0x00000007,0x00000006,0x0004002b,
+0x00000006,0x00000024,0x00000018,0x0004002b,
+0x00000006,0x0000002b,0x00000080,0x0004002b,
+0x00000006,0x0000002f,0x00000100,0x0004002b,
+0x00000006,0x00000033,0xffffff80,0x0004002b,
+0x00000006,0x00000037,0xffffff81,0x0004002b,
+0x00000006,0x0000003a,0x00000014,0x0004002b,
+0x00000006,0x0000003d,0x0000000f,0x0004002b,
+0x00000006,0x00000042,0x00000010,0x0004002b,
+0x0000000d,0x00000044,0x0000000f,0x00040017,
+0x00000046,0x00000006,0x00000004,0x00040020,
+0x00000047,0x00000007,0x00000046,0x0004002b,
+0x0000000d,0x00000049,0x00000020,0x0004001c,
+0x0000004a,0x00000046,0x00000049,0x0004002b,
+0x00000006,0x0000004b,0xfffffffd,0x0004002b,
+0x00000006,0x0000004c,0xfffffffa,0x0004002b,
+0x00000006,0x0000004d,0xfffffff7,0x0004002b,
+0x00000006,0x0000004e,0xfffffff1,0x0007002c,
+0x00000046,0x0000004f,0x0000004b,0x0000004c,
+0x0000004d,0x0000004e,0x0004002b,0x00000006,
+0x00000050,0x00000002,0x0004002b,0x00000006,
+0x00000051,0x00000005,0x0004002b,0x00000006,
+0x00000052,0x00000008,0x0004002b,0x00000006,
+0x00000053,0x0000000e,0x0007002c,0x00000046,
+0x00000054,0x00000050,0x00000051,0x00000052,
+0x00000053,0x0004002b,0x00000006,0x00000055,
+0xfffffff9,0x0004002b,0x00000006,0x00000056,
+0xfffffff6,0x0004002b,0x00000006,0x00000057,
+0xfffffff3,0x0007002c,0x00000046,0x00000058,
+0x0000004b,0x00000055,0x00000056,0x00000057,
+0x0004002b,0x00000006,0x00000059,0x00000006,
+0x0004002b,0x00000006,0x0000005a,0x00000009,
+0x0004002b,0x00000006,0x0000005b,0x0000000c,
+0x0007002c,0x00000046,0x0000005c,0x00000050,
+0x00000059,0x0000005a,0x0000005b,0x0004002b,
+0x00000006,0x0000005d,0xfffffffe,0x0004002b,
+0x00000006,0x0000005e,0xfffffffb,0x0004002b,
+0x00000006,0x0000005f,0xfffffff8,0x0007002c,
+0x00000046,0x00000060,0x0000005d,0x0000005e,
+0x0000005f,0x00000057,0x0004002b,0x00000006,
+0x00000061,0x00000001,0x0004002b,0x00000006,
+0x00000062,0x00000004,0x0004002b,0x00000006,
+0x00000063,0x00000007,0x0007002c,0x00000046,
+0x00000064,0x00000061,0x00000062,0x00000063,
+0x0000005b,0x0004002b,0x00000006,0x00000065,
+0xfffffffc,0x0007002c,0x00000046,0x00000066,
+0x0000005d,0x00000065,0x0000004c,0x00000057,
+0x0004002b,0x00000006,0x00000067,0x00000003,
+0x0007002c,0x00000046,0x00000068,0x00000061,
+0x00000067,0x00000051,0x0000005b,0x0004002b,
+0x00000006,0x00000069,0xfffffff4,0x0007002c,
+0x00000046,0x0000006a,0x0000004b,0x0000004c,
+0x0000005f,0x00000069,0x0004002b,0x00000006,
+0x0000006b,0x0000000b,0x0007002c,0x00000046,
+0x0000006c,0x00000050,0x00000051,0x00000063,
+0x0000006b,0x0004002b,0x00000006,0x0000006d,
+0xfffffff5,0x0007002c,0x00000046,0x0000006e,
+0x0000004b,0x00000055,0x0000004d,0x0000006d,
+0x0004002b,0x00000006,0x0000006f,0x0000000a,
+0x0007002c,0x00000046,0x00000070,0x00000050,
+0x00000059,0x00000052,0x0000006f,0x0007002c,
+0x00000046,0x00000071,0x00000065,0x00000055,
+0x0000005f,0x0000006d,0x0007002c,0x00000046,
+0x00000072,0x00000067,0x00000059,0x00000063,
+0x0000006f,0x0007002c,0x00000046,0x00000073,
+0x0000004b,0x0000005e,0x0000005f,0x0000006d,
+0x0007002c,0x00000046,0x00000074,0x00000050,
+0x00000062,0x00000063,0x0000006f,0x0007002c,
+0x00000046,0x00000075,0x0000005d,0x0000004c,
+0x0000005f,0x00000056,0x0007002c,0x00000046,
+0x00000076,0x00000061,0x00000051,0x00000063,
+0x0000005a,0x0007002c,0x00000046,0x00000077,
+0x0000005d,0x0000005e,0x0000005f,0x00000056,
+0x0007002c,0x00000046,0x00000078,0x00000061,
+0x00000062,0x00000063,0x0000005a,0x0007002c,
+0x00000046,0x00000079,0x0000005d,0x00000065,
+0x0000005f,0x00000056,0x0007002c,0x00000046,
+0x0000007a,0x00000061,0x00000067,0x00000063,
+0x0000005a,0x0007002c,0x00000046,0x0000007b,
+0x0000005d,0x0000005e,0x00000055,0x00000056,
+0x0007002c,0x00000046,0x0000007c,0x00000061,
+0x00000062,0x00000059,0x0000005a,0x0007002c,
+0x00000046,0x0000007d,0x0000004b,0x00000065,
+0x00000055,0x00000056,0x0007002c,0x00000046,
+0x0000007e,0x00000050,0x00000067,0x00000059,
+0x0000005a,0x0004002b,0x00000006,0x0000007f,
+0xffffffff,0x0007002c,0x00000046,0x00000080,
+0x0000007f,0x0000005d,0x0000004b,0x00000056,
+0x0004002b,0x00000006,0x00000081,0x00000000,
+0x0007002c,0x00000046,0x00000082,0x00000081,
+0x00000061,0x00000050,0x0000005a,0x0007002c,
+0x00000046,0x00000083,0x00000065,0x0000004c,
+0x0000005f,0x0000004d,0x0007002c,0x00000046,
+0x00000084,0x00000067,0x00000051,0x00000063,
+0x00000052,0x0007002c,0x00000046,0x00000085,
+0x0000004b,0x0000005e,0x00000055,0x0000004d,
+0x0007002c,0x00000046,0x00000086,0x00000050,
+0x00000062,0x00000059,0x00000052,0x0023002c,
+0x0000004a,0x00000087,0x0000004f,0x00000054,
+0x00000058,0x0000005c,0x00000060,0x00000064,
+0x00000066,0x00000068,0x0000006a,0x0000006c,
+0x0000006e,0x00000070,0x00000071,0x00000072,
+0x00000073,0x00000074,0x00000075,0x00000076,
+0x00000077,0x00000078,0x00000079,0x0000007a,
+0x0000007b,0x0000007c,0x0000007d,0x0000007e,
+0x00000080,0x00000082,0x00000083,0x00000084,
+0x00000085,0x00000086,0x0004002b,0x0000000d,
+0x00000089,0x00000002,0x00040020,0x0000008b,
+0x00000007,0x0000004a,0x0004002b,0x0000000d,
+0x00000092,0x00000001,0x0004001c,0x00000097,
+0x0000000d,0x00000012,0x00040020,0x00000098,
+0x00000007,0x00000097,0x0004002b,0x00000006,
+0x0000009b,0x0000000d,0x0004002b,0x00000006,
+0x000000a8,0x0000001e,0x0004002b,0x00000006,
+0x000000ac,0x0000001b,0x0004002b,0x00000006,
+0x000000b1,0x00000015,0x0004002b,0x00000006,
+0x000000b4,0x00000012,0x0004002b,0x0000000d,
+0x000000c3,0x00000000,0x0004002b,0x0000000d,
+0x000000cd,0x00000004,0x0004002b,0x0000000d,
+0x000000d7,0x00000007,0x0004002b,0x00000006,
+0x000000fb,0xfffffc01,0x0004002b,0x00000006,
+0x000000fc,0x000003ff,0x00040020,0x000000fe,
+0x00000007,0x00000013,0x0004002b,0x00000011,
+0x00000103,0x447fc000,0x00040020,0x00000105,
+0x00000007,0x00000011,0x0004002b,0x00000006,
+0x0000010b,0x000007ff,0x0004002b,0x00000011,
+0x00000110,0x44ffe000,0x0004002b,0x0000000d,
+0x00000119,0x000000ff,0x0004002b,0x0000000d,
+0x0000011d,0x0000ff00,0x0004002b,0x0000000d,
+0x00000122,0x00ff0000,0x0004002b,0x0000000d,
+0x00000127,0xff000000,0x00040017,0x0000012e,
+0x0000000d,0x00000003,0x00040020,0x0000012f,
+0x00000001,0x0000012e,0x0004003b,0x0000012f,
+0x00000130,0x00000001,0x0004001e,0x00000133,
+0x0000000d,0x0000000d,0x00040020,0x00000134,
+0x00000009,0x00000133,0x0004003b,0x00000134,
+0x00000135,0x00000009,0x00040020,0x00000136,
+0x00000009,0x0000000d,0x00040017,0x0000013e,
+0x0000000d,0x00000004,0x00040020,0x0000013f,
+0x00000007,0x0000013e,0x00090019,0x00000141,
+0x0000000d,0x00000001,0x00000000,0x00000001,
+0x00000000,0x00000002,0x00000023,0x00040020,
+0x00000142,0x00000000,0x00000141,0x0004003b,
+0x00000142,0x00000143,0x00000000,0x00030029,
+0x0000000f,0x00000152,0x00090019,0x00000167,
+0x00000011,0x00000001,0x00000000,0x00000001,
+0x00000000,0x00000002,0x00000013,0x00040020,
+0x00000168,0x00000000,0x00000167,0x0004003b,
+0x00000168,0x00000169,0x00000000,0x00040017,
+0x0000016b,0x00000006,0x00000002,0x0004002b,
+0x00000011,0x00000181,0x00000000,0x0004002b,
+0x00000011,0x00000182,0x3f800000,0x00040017,
+0x00000183,0x00000011,0x00000004,0x0004002b,
+0x0000000d,0x00000189,0x00000093,0x0004002b,
+0x0000000d,0x0000018a,0x00000094,0x0004002b,
+0x0000000d,0x0000018b,0x00000095,0x0004002b,
+0x0000000d,0x0000018c,0x00000096,0x0004002b,
+0x0000000d,0x0000018d,0x00000097,0x0004002b,
+0x0000000d,0x0000018e,0x00000098,0x0004002b,
+0x0000000d,0x0000018f,0x00000099,0x0004002b,
+0x0000000d,0x00000190,0x0000009a,0x0004002b,
+0x0000000d,0x00000191,0x0000009b,0x0004002b,
+0x0000000d,0x00000192,0x0000009c,0x0004002b,
+0x0000000d,0x00000193,0x00000008,0x0004001c,
+0x00000194,0x00000006,0x00000193,0x000b002c,
+0x00000194,0x00000195,0x00000081,0x00000061,
+0x00000050,0x00000067,0x00000065,0x0000004b,
+0x0000005d,0x0000007f,0x0004001c,0x00000196,
+0x00000046,0x00000193,0x0007002c,0x00000046,
+0x00000197,0x00000050,0x00000052,0x0000005d,
+0x0000005f,0x0004002b,0x00000006,0x00000198,
+0x00000011,0x0004002b,0x00000006,0x00000199,
+0xffffffef,0x0007002c,0x00000046,0x0000019a,
+0x00000051,0x00000198,0x0000005e,0x00000199,
+0x0004002b,0x00000006,0x0000019b,0x0000001d,
+0x0004002b,0x00000006,0x0000019c,0xffffffe3,
+0x0007002c,0x00000046,0x0000019d,0x0000005a,
+0x0000019b,0x0000004d,0x0000019c,0x0004002b,
+0x00000006,0x0000019e,0x0000002a,0x0004002b,
+0x00000006,0x0000019f,0xffffffd6,0x0007002c,
+0x00000046,0x000001a0,0x0000009b,0x0000019e,
+0x00000057,0x0000019f,0x0004002b,0x00000006,
+0x000001a1,0x0000003c,0x0004002b,0x00000006,
+0x000001a2,0xffffffee,0x0004002b,0x00000006,
+0x000001a3,0xffffffc4,0x0007002c,0x00000046,
+0x000001a4,0x000000b4,0x000001a1,0x000001a2,
+0x000001a3,0x0004002b,0x00000006,0x000001a5,
+0x00000050,0x0004002b,0x00000006,0x000001a6,
+0xffffffe8,0x0004002b,0x00000006,0x000001a7,
+0xffffffb0,0x0007002c,0x00000046,0x000001a8,
+0x00000024,0x000001a5,0x000001a6,0x000001a7,
+0x0004002b,0x00000006,0x000001a9,0x00000021,
+0x0004002b,0x00000006,0x000001aa,0x0000006a,
+0x0004002b,0x00000006,0x000001ab,0xffffffdf,
+0x0004002b,0x00000006,0x000001ac,0xffffff96,
+0x0007002c,0x00000046,0x000001ad,0x000001a9,
+0x000001aa,0x000001ab,0x000001ac,0x0004002b,
+0x00000006,0x000001ae,0x0000002f,0x0004002b,
+0x00000006,0x000001af,0x000000b7,0x0004002b,
+0x00000006,0x000001b0,0xffffffd1,0x0004002b,
+0x00000006,0x000001b1,0xffffff49,0x0007002c,
+0x00000046,0x000001b2,0x000001ae,0x000001af,
+0x000001b0,0x000001b1,0x000b002c,0x00000196,
+0x000001b3,0x00000197,0x0000019a,0x0000019d,
+0x000001a0,0x000001a4,0x000001a8,0x000001ad,
+0x000001b2,0x0007002c,0x00000046,0x000001b4,
+0x00000081,0x00000052,0x00000081,0x0000005f,
+0x0007002c,0x00000046,0x000001b5,0x00000081,
+0x00000198,0x00000081,0x00000199,0x0007002c,
+0x00000046,0x000001b6,0x00000081,0x0000019b,
+0x00000081,0x0000019c,0x0007002c,0x00000046,
+0x000001b7,0x00000081,0x0000019e,0x00000081,
+0x0000019f,0x0007002c,0x00000046,0x000001b8,
+0x00000081,0x000001a1,0x00000081,0x000001a3,
+0x0007002c,0x00000046,0x000001b9,0x00000081,
+0x000001a5,0x00000081,0x000001a7,0x0007002c,
+0x00000046,0x000001ba,0x00000081,0x000001aa,
+0x00000081,0x000001ac,0x0007002c,0x00000046,
+0x000001bb,0x00000081,0x000001af,0x00000081,
+0x000001b1,0x000b002c,0x00000196,0x000001bc,
+0x000001b4,0x000001b5,0x000001b6,0x000001b7,
+0x000001b8,0x000001b9,0x000001ba,0x000001bb,
+0x0006002c,0x0000012e,0x000001bd,0x00000193,
+0x00000193,0x00000092,0x00050036,0x00000002,
+0x00000004,0x00000000,0x00000003,0x000200f8,
+0x00000005,0x0004003b,0x00000008,0x0000012d,
+0x00000007,0x0004003b,0x0000013f,0x00000140,
+0x00000007,0x0004003b,0x00000008,0x00000145,
+0x00000007,0x0004003b,0x000000fe,0x00000149,
+0x00000007,0x0004003b,0x0000000e,0x0000014a,
+0x00000007,0x0004003b,0x0000000e,0x0000014e,
+0x00000007,0x0004003b,0x0000000e,0x00000153,
+0x00000007,0x0004003b,0x0000000e,0x00000154,
+0x00000007,0x0004003b,0x00000010,0x00000155,
+0x00000007,0x0004003b,0x00000021,0x00000157,
+0x00000007,0x0004003b,0x00000021,0x0000015f,
+0x00000007,0x0004003b,0x00000008,0x00000179,
+0x00000007,0x0004003d,0x0000012e,0x00000131,
+0x00000130,0x0004007c,0x00000007,0x00000132,
+0x00000131,0x0003003e,0x0000012d,0x00000132,
+0x00050041,0x00000136,0x00000137,0x00000135,
+0x00000061,0x0004003d,0x0000000d,0x00000138,
+0x00000137,0x0004007c,0x00000006,0x00000139,
+0x00000138,0x00050041,0x00000021,0x0000013a,
+0x0000012d,0x00000089,0x0004003d,0x00000006,
+0x0000013b,0x0000013a,0x00050080,0x00000006,
+0x0000013c,0x0000013b,0x00000139,0x00050041,
+0x00000021,0x0000013d,0x0000012d,0x00000089,
+0x0003003e,0x0000013d,0x0000013c,0x0004003d,
+0x00000141,0x00000144,0x00000143,0x0004003d,
+0x00000007,0x00000146,0x0000012d,0x0003003e,
+0x00000145,0x00000146,0x00050039,0x00000007,
+0x00000147,0x0000000b,0x00000145,0x00050062,
+0x0000013e,0x00000148,0x00000144,0x00000147,
+0x0003003e,0x00000140,0x00000148,0x00050041,
+0x0000000e,0x0000014b,0x00000140,0x000000c3,
+0x0004003d,0x0000000d,0x0000014c,0x0000014b,
+0x0003003e,0x0000014a,0x0000014c,0x00050039,
+0x0000000d,0x0000014d,0x0000001c,0x0000014a,
+0x00050041,0x0000000e,0x0000014f,0x00000140,
+0x00000092,0x0004003d,0x0000000d,0x00000150,
+0x0000014f,0x0003003e,0x0000014e,0x00000150,
+0x00050039,0x0000000d,0x00000151,0x0000001c,
+0x0000014e,0x0003003e,0x00000153,0x0000014d,
+0x0003003e,0x00000154,0x00000151,0x0003003e,
+0x00000155,0x00000152,0x00070039,0x00000013,
+0x00000156,0x00000018,0x00000153,0x00000154,
+0x00000155,0x0003003e,0x00000149,0x00000156,
+0x0003003e,0x00000157,0x00000081,0x000200f9,
+0x00000158,0x000200f8,0x00000158,0x000400f6,
+0x0000015a,0x0000015b,0x00000000,0x000200f9,
+0x0000015c,0x000200f8,0x0000015c,0x0004003d,
+0x00000006,0x0000015d,0x00000157,0x000500b1,
+0x0000000f,0x0000015e,0x0000015d,0x00000062,
+0x000400fa,0x0000015e,0x00000159,0x0000015a,
+0x000200f8,0x00000159,0x0003003e,0x0000015f,
+0x00000081,0x000200f9,0x00000160,0x000200f8,
+0x00000160,0x000400f6,0x00000162,0x00000163,
+0x00000000,0x000200f9,0x00000164,0x000200f8,
+0x00000164,0x0004003d,0x00000006,0x00000165,
+0x0000015f,0x000500b1,0x0000000f,0x00000166,
+0x00000165,0x00000062,0x000400fa,0x00000166,
+0x00000161,0x00000162,0x000200f8,0x00000161,
+0x0004003d,0x00000167,0x0000016a,0x00000169,
+0x0004003d,0x00000007,0x0000016c,0x0000012d,
+0x0007004f,0x0000016b,0x0000016d,0x0000016c,
+0x0000016c,0x00000000,0x00000001,0x00050050,
+0x0000016b,0x0000016e,0x00000062,0x00000062,
+0x00050084,0x0000016b,0x0000016f,0x0000016d,
+0x0000016e,0x0004003d,0x00000006,0x00000170,
+0x0000015f,0x0004003d,0x00000006,0x00000171,
+0x00000157,0x00050050,0x0000016b,0x00000172,
+0x00000170,0x00000171,0x00050080,0x0000016b,
+0x00000173,0x0000016f,0x00000172,0x00050041,
+0x00000021,0x00000174,0x0000012d,0x00000089,
+0x0004003d,0x00000006,0x00000175,0x00000174,
+0x00050051,0x00000006,0x00000176,0x00000173,
+0x00000000,0x00050051,0x00000006,0x00000177,
+0x00000173,0x00000001,0x00060050,0x00000007,
+0x00000178,0x00000176,0x00000177,0x00000175,
+0x0003003e,0x00000179,0x00000178,0x00050039,
+0x00000007,0x0000017a,0x0000000b,0x00000179,
+0x0004003d,0x00000006,0x0000017b,0x00000157,
+0x00050084,0x00000006,0x0000017c,0x0000017b,
+0x00000062,0x0004003d,0x00000006,0x0000017d,
+0x0000015f,0x00050080,0x00000006,0x0000017e,
+0x0000017c,0x0000017d,0x00050041,0x00000105,
+0x0000017f,0x00000149,0x0000017e,0x0004003d,
+0x00000011,0x00000180,0x0000017f,0x00070050,
+0x00000183,0x00000184,0x00000180,0x00000181,
+0x00000181,0x00000182,0x00040063,0x0000016a,
+0x0000017a,0x00000184,0x000200f9,0x00000163,
+0x000200f8,0x00000163,0x0004003d,0x00000006,
+0x00000185,0x0000015f,0x00050080,0x00000006,
+0x00000186,0x00000185,0x00000061,0x0003003e,
+0x0000015f,0x00000186,0x000200f9,0x00000160,
+0x000200f8,0x00000162,0x000200f9,0x0000015b,
+0x000200f8,0x0000015b,0x0004003d,0x00000006,
+0x00000187,0x00000157,0x00050080,0x00000006,
+0x00000188,0x00000187,0x00000061,0x0003003e,
+0x00000157,0x00000188,0x000200f9,0x00000158,
+0x000200f8,0x0000015a,0x000100fd,0x00010038,
+0x00050036,0x00000007,0x0000000b,0x00000000,
+0x00000009,0x00030037,0x00000008,0x0000000a,
+0x000200f8,0x0000000c,0x0004003d,0x00000007,
+0x0000001e,0x0000000a,0x000200fe,0x0000001e,
+0x00010038,0x00050036,0x00000013,0x00000018,
+0x00000000,0x00000014,0x00030037,0x0000000e,
+0x00000015,0x00030037,0x0000000e,0x00000016,
+0x00030037,0x00000010,0x00000017,0x000200f8,
+0x00000019,0x0004003b,0x00000021,0x00000022,
+0x00000007,0x0004003b,0x00000021,0x00000038,
+0x00000007,0x0004003b,0x0000000e,0x00000040,
+0x00000007,0x0004003b,0x00000047,0x00000048,
+0x00000007,0x0004003b,0x0000008b,0x0000008c,
+0x00000007,0x0004003b,0x00000047,0x0000008f,
+0x00000007,0x0004003b,0x0000008b,0x00000094,
+0x00000007,0x0004003b,0x00000098,0x00000099,
+0x00000007,0x0004003b,0x0000000e,0x000000c2,
+0x00000007,0x0004003b,0x0000000e,0x000000cb,
+0x00000007,0x0004003b,0x0000000e,0x000000d3,
+0x00000007,0x0004003b,0x00000021,0x000000d9,
+0x00000007,0x0004003b,0x00000021,0x000000dc,
+0x00000007,0x0004003b,0x00000021,0x000000e8,
+0x00000007,0x0004003b,0x000000fe,0x000000ff,
+0x00000007,0x0004003d,0x0000000d,0x00000023,
+0x00000015,0x000500c2,0x0000000d,0x00000025,
+0x00000023,0x00000024,0x0004007c,0x00000006,
+0x00000026,0x00000025,0x0003003e,0x00000022,
+0x00000026,0x0004003d,0x0000000f,0x00000027,
+0x00000017,0x000300f7,0x00000029,0x00000000,
+0x000400fa,0x00000027,0x00000028,0x00000029,
+0x000200f8,0x00000028,0x0004003d,0x00000006,
+0x0000002a,0x00000022,0x000500af,0x0000000f,
+0x0000002c,0x0000002a,0x0000002b,0x000300f7,
+0x0000002e,0x00000000,0x000400fa,0x0000002c,
+0x0000002d,0x0000002e,0x000200f8,0x0000002d,
+0x0004003d,0x00000006,0x00000030,0x00000022,
+0x00050082,0x00000006,0x00000031,0x00000030,
+0x0000002f,0x0003003e,0x00000022,0x00000031,
+0x000200f9,0x0000002e,0x000200f8,0x0000002e,
+0x0004003d,0x00000006,0x00000032,0x00000022,
+0x000500aa,0x0000000f,0x00000034,0x00000032,
+0x00000033,0x000300f7,0x00000036,0x00000000,
+0x000400fa,0x00000034,0x00000035,0x00000036,
+0x000200f8,0x00000035,0x0003003e,0x00000022,
+0x00000037,0x000200f9,0x00000036,0x000200f8,
+0x00000036,0x000200f9,0x00000029,0x000200f8,
+0x00000029,0x0004003d,0x0000000d,0x00000039,
+0x00000015,0x000500c2,0x0000000d,0x0000003b,
+0x00000039,0x0000003a,0x0004007c,0x00000006,
+0x0000003c,0x0000003b,0x0003003e,0x00000038,
+0x0000003c,0x0004003d,0x00000006,0x0000003e,
+0x00000038,0x000500c7,0x00000006,0x0000003f,
+0x0000003e,0x0000003d,0x0003003e,0x00000038,
+0x0000003f,0x0004003d,0x0000000d,0x00000041,
+0x00000015,0x000500c2,0x0000000d,0x00000043,
+0x00000041,0x00000042,0x000500c7,0x0000000d,
+0x00000045,0x00000043,0x00000044,0x0003003e,
+0x00000040,0x00000045,0x0004003d,0x0000000d,
+0x00000088,0x00000040,0x00050084,0x0000000d,
+0x0000008a,0x00000088,0x00000089,0x0003003e,
+0x0000008c,0x00000087,0x00050041,0x00000047,
+0x0000008d,0x0000008c,0x0000008a,0x0004003d,
+0x00000046,0x0000008e,0x0000008d,0x0003003e,
+0x00000048,0x0000008e,0x0004003d,0x0000000d,
+0x00000090,0x00000040,0x00050084,0x0000000d,
+0x00000091,0x00000090,0x00000089,0x00050080,
+0x0000000d,0x00000093,0x00000091,0x00000092,
+0x0003003e,0x00000094,0x00000087,0x00050041,
+0x00000047,0x00000095,0x00000094,0x00000093,
+0x0004003d,0x00000046,0x00000096,0x00000095,
+0x0003003e,0x0000008f,0x00000096,0x0004003d,
+0x0000000d,0x0000009a,0x00000015,0x000500c2,
+0x0000000d,0x0000009c,0x0000009a,0x0000009b,
+0x0004003d,0x0000000d,0x0000009d,0x00000015,
+0x000500c2,0x0000000d,0x0000009e,0x0000009d,
+0x0000006f,0x0004003d,0x0000000d,0x0000009f,
+0x00000015,0x000500c2,0x0000000d,0x000000a0,
+0x0000009f,0x00000063,0x0004003d,0x0000000d,
+0x000000a1,0x00000015,0x000500c2,0x0000000d,
+0x000000a2,0x000000a1,0x00000062,0x0004003d,
+0x0000000d,0x000000a3,0x00000015,0x000500c2,
+0x0000000d,0x000000a4,0x000000a3,0x00000061,
+0x0004003d,0x0000000d,0x000000a5,0x00000015,
+0x000500c4,0x0000000d,0x000000a6,0x000000a5,
+0x00000050,0x0004003d,0x0000000d,0x000000a7,
+0x00000016,0x000500c2,0x0000000d,0x000000a9,
+0x000000a7,0x000000a8,0x000500c5,0x0000000d,
+0x000000aa,0x000000a6,0x000000a9,0x0004003d,
+0x0000000d,0x000000ab,0x00000016,0x000500c2,
+0x0000000d,0x000000ad,0x000000ab,0x000000ac,
+0x0004003d,0x0000000d,0x000000ae,0x00000016,
+0x000500c2,0x0000000d,0x000000af,0x000000ae,
+0x00000024,0x0004003d,0x0000000d,0x000000b0,
+0x00000016,0x000500c2,0x0000000d,0x000000b2,
+0x000000b0,0x000000b1,0x0004003d,0x0000000d,
+0x000000b3,0x00000016,0x000500c2,0x0000000d,
+0x000000b5,0x000000b3,0x000000b4,0x0004003d,
+0x0000000d,0x000000b6,0x00000016,0x000500c2,
+0x0000000d,0x000000b7,0x000000b6,0x0000003d,
+0x0004003d,0x0000000d,0x000000b8,0x00000016,
+0x000500c2,0x0000000d,0x000000b9,0x000000b8,
+0x0000005b,0x0004003d,0x0000000d,0x000000ba,
+0x00000016,0x000500c2,0x0000000d,0x000000bb,
+0x000000ba,0x0000005a,0x0004003d,0x0000000d,
+0x000000bc,0x00000016,0x000500c2,0x0000000d,
+0x000000bd,0x000000bc,0x00000059,0x0004003d,
+0x0000000d,0x000000be,0x00000016,0x000500c2,
+0x0000000d,0x000000bf,0x000000be,0x00000067,
+0x0004003d,0x0000000d,0x000000c0,0x00000016,
+0x00130050,0x00000097,0x000000c1,0x0000009c,
+0x0000009e,0x000000a0,0x000000a2,0x000000a4,
+0x000000aa,0x000000ad,0x000000af,0x000000b2,
+0x000000b5,0x000000b7,0x000000b9,0x000000bb,
+0x000000bd,0x000000bf,0x000000c0,0x0003003e,
+0x00000099,0x000000c1,0x0003003e,0x000000c2,
+0x000000c3,0x000200f9,0x000000c4,0x000200f8,
+0x000000c4,0x000400f6,0x000000c6,0x000000c7,
+0x00000000,0x000200f9,0x000000c8,0x000200f8,
+0x000000c8,0x0004003d,0x0000000d,0x000000c9,
+0x000000c2,0x000500b0,0x0000000f,0x000000ca,
+0x000000c9,0x00000012,0x000400fa,0x000000ca,
+0x000000c5,0x000000c6,0x000200f8,0x000000c5,
+0x0004003d,0x0000000d,0x000000cc,0x000000c2,
+0x00050089,0x0000000d,0x000000ce,0x000000cc,
+0x000000cd,0x00050084,0x0000000d,0x000000cf,
+0x000000ce,0x000000cd,0x0004003d,0x0000000d,
+0x000000d0,0x000000c2,0x00050086,0x0000000d,
+0x000000d1,0x000000d0,0x000000cd,0x00050080,
+0x0000000d,0x000000d2,0x000000cf,0x000000d1,
+0x0003003e,0x000000cb,0x000000d2,0x0004003d,
+0x0000000d,0x000000d4,0x000000c2,0x00050041,
+0x0000000e,0x000000d5,0x00000099,0x000000d4,
+0x0004003d,0x0000000d,0x000000d6,0x000000d5,
+0x000500c7,0x0000000d,0x000000d8,0x000000d6,
+0x000000d7,0x0003003e,0x000000d3,0x000000d8,
+0x0004003d,0x0000000d,0x000000da,0x000000d3,
+0x000500ae,0x0000000f,0x000000db,0x000000da,
+0x000000cd,0x000300f7,0x000000de,0x00000000,
+0x000400fa,0x000000db,0x000000dd,0x000000e3,
+0x000200f8,0x000000dd,0x0004003d,0x0000000d,
+0x000000df,0x000000d3,0x00050082,0x0000000d,
+0x000000e0,0x000000df,0x000000cd,0x00050041,
+0x00000021,0x000000e1,0x0000008f,0x000000e0,
+0x0004003d,0x00000006,0x000000e2,0x000000e1,
+0x0003003e,0x000000dc,0x000000e2,0x000200f9,
+0x000000de,0x000200f8,0x000000e3,0x0004003d,
+0x0000000d,0x000000e4,0x000000d3,0x00050041,
+0x00000021,0x000000e5,0x00000048,0x000000e4,
+0x0004003d,0x00000006,0x000000e6,0x000000e5,
+0x0003003e,0x000000dc,0x000000e6,0x000200f9,
+0x000000de,0x000200f8,0x000000de,0x0004003d,
+0x00000006,0x000000e7,0x000000dc,0x0003003e,
+0x000000d9,0x000000e7,0x0004003d,0x00000006,
+0x000000e9,0x00000022,0x0004003d,0x00000006,
+0x000000ea,0x000000d9,0x0004003d,0x00000006,
+0x000000eb,0x00000038,0x00050084,0x00000006,
+0x000000ec,0x000000ea,0x000000eb,0x00050080,
+0x00000006,0x000000ed,0x000000e9,0x000000ec,
+0x0003003e,0x000000e8,0x000000ed,0x0004003d,
+0x00000006,0x000000ee,0x000000e8,0x00050084,
+0x00000006,0x000000ef,0x000000ee,0x00000052,
+0x0003003e,0x000000e8,0x000000ef,0x0004003d,
+0x00000006,0x000000f0,0x00000038,0x000500aa,
+0x0000000f,0x000000f1,0x000000f0,0x00000081,
+0x000300f7,0x000000f3,0x00000000,0x000400fa,
+0x000000f1,0x000000f2,0x000000f3,0x000200f8,
+0x000000f2,0x0004003d,0x00000006,0x000000f4,
+0x000000d9,0x0004003d,0x00000006,0x000000f5,
+0x000000e8,0x00050080,0x00000006,0x000000f6,
+0x000000f5,0x000000f4,0x0003003e,0x000000e8,
+0x000000f6,0x000200f9,0x000000f3,0x000200f8,
+0x000000f3,0x0004003d,0x0000000f,0x000000f7,
+0x00000017,0x000300f7,0x000000f9,0x00000000,
+0x000400fa,0x000000f7,0x000000f8,0x00000107,
+0x000200f8,0x000000f8,0x0004003d,0x00000006,
+0x000000fa,0x000000e8,0x0008000c,0x00000006,
+0x000000fd,0x00000001,0x0000002d,0x000000fa,
+0x000000fb,0x000000fc,0x0003003e,0x000000e8,
+0x000000fd,0x0004003d,0x0000000d,0x00000100,
+0x000000cb,0x0004003d,0x00000006,0x00000101,
+0x000000e8,0x0004006f,0x00000011,0x00000102,
+0x00000101,0x00050088,0x00000011,0x00000104,
+0x00000102,0x00000103,0x00050041,0x00000105,
+0x00000106,0x000000ff,0x00000100,0x0003003e,
+0x00000106,0x00000104,0x000200f9,0x000000f9,
+0x000200f8,0x00000107,0x0004003d,0x00000006,
+0x00000108,0x000000e8,0x00050080,0x00000006,
+0x00000109,0x00000108,0x00000062,0x0003003e,
+0x000000e8,0x00000109,0x0004003d,0x00000006,
+0x0000010a,0x000000e8,0x0008000c,0x00000006,
+0x0000010c,0x00000001,0x0000002d,0x0000010a,
+0x00000081,0x0000010b,0x0003003e,0x000000e8,
+0x0000010c,0x0004003d,0x0000000d,0x0000010d,
+0x000000cb,0x0004003d,0x00000006,0x0000010e,
+0x000000e8,0x0004006f,0x00000011,0x0000010f,
+0x0000010e,0x00050088,0x00000011,0x00000111,
+0x0000010f,0x00000110,0x00050041,0x00000105,
+0x00000112,0x000000ff,0x0000010d,0x0003003e,
+0x00000112,0x00000111,0x000200f9,0x000000f9,
+0x000200f8,0x000000f9,0x000200f9,0x000000c7,
+0x000200f8,0x000000c7,0x0004003d,0x0000000d,
+0x00000113,0x000000c2,0x00050080,0x0000000d,
+0x00000114,0x00000113,0x00000061,0x0003003e,
+0x000000c2,0x00000114,0x000200f9,0x000000c4,
+0x000200f8,0x000000c6,0x0004003d,0x00000013,
+0x00000115,0x000000ff,0x000200fe,0x00000115,
+0x00010038,0x00050036,0x0000000d,0x0000001c,
+0x00000000,0x0000001a,0x00030037,0x0000000e,
+0x0000001b,0x000200f8,0x0000001d,0x0004003d,
+0x0000000d,0x00000118,0x0000001b,0x000500c7,
+0x0000000d,0x0000011a,0x00000118,0x00000119,
+0x000500c4,0x0000000d,0x0000011b,0x0000011a,
+0x00000024,0x0004003d,0x0000000d,0x0000011c,
+0x0000001b,0x000500c7,0x0000000d,0x0000011e,
+0x0000011c,0x0000011d,0x000500c4,0x0000000d,
+0x0000011f,0x0000011e,0x00000052,0x000500c5,
+0x0000000d,0x00000120,0x0000011b,0x0000011f,
+0x0004003d,0x0000000d,0x00000121,0x0000001b,
+0x000500c7,0x0000000d,0x00000123,0x00000121,
+0x00000122,0x000500c2,0x0000000d,0x00000124,
+0x00000123,0x00000052,0x000500c5,0x0000000d,
+0x00000125,0x00000120,0x00000124,0x0004003d,
+0x0000000d,0x00000126,0x0000001b,0x000500c7,
+0x0000000d,0x00000128,0x00000126,0x00000127,
+0x000500c2,0x0000000d,0x00000129,0x00000128,
+0x00000024,0x000500c5,0x0000000d,0x0000012a,
+0x00000125,0x00000129,0x000200fe,0x0000012a,
+0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_3D.inl
new file mode 100644
index 00000000000..c84e4a8ba5c
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Snorm_3D.inl
@@ -0,0 +1,637 @@
+0x07230203,0x00010300,0x000d000a,0x000001be,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x00000031,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000130,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00060005,
+0x0000000b,0x50746567,0x4433736f,0x33697628,
+0x0000003b,0x00030005,0x0000000a,0x00736f70,
+0x000e0005,0x00000018,0x5f636165,0x6f636564,
+0x735f6564,0x6c676e69,0x68635f65,0x656e6e61,
+0x6c625f6c,0x5f6b636f,0x616f6c66,0x31752874,
+0x3b31753b,0x003b3162,0x00040005,0x00000015,
+0x68676968,0x00000000,0x00030005,0x00000016,
+0x00776f6c,0x00050005,0x00000017,0x69537369,
+0x64656e67,0x00000000,0x00050005,0x0000001c,
+0x70696c66,0x75283233,0x00003b31,0x00030005,
+0x0000001b,0x00000061,0x00060005,0x00000022,
+0x65736162,0x646f635f,0x726f7765,0x00000064,
+0x00050005,0x00000038,0x746c756d,0x696c7069,
+0x00007265,0x00040005,0x00000040,0x496c6274,
+0x00007864,0x00040005,0x00000048,0x6c626174,
+0x00003065,0x00050005,0x0000008c,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000008f,
+0x6c626174,0x00003165,0x00050005,0x00000094,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000099,0x00000070,0x00030005,0x000000c2,
+0x00000069,0x00040005,0x000000cb,0x4974756f,
+0x00007864,0x00050005,0x000000d3,0x69646f6d,
+0x72656966,0x00000000,0x00060005,0x000000d9,
+0x69646f6d,0x72656966,0x756c6156,0x00000065,
+0x00040005,0x000000e8,0x6f636564,0x00646564,
+0x00040005,0x000000ff,0x75736572,0x0000746c,
+0x00030005,0x0000012d,0x00736f70,0x00080005,
+0x00000130,0x475f6c67,0x61626f6c,0x766e496c,
+0x7461636f,0x496e6f69,0x00000044,0x00070005,
+0x00000133,0x67616d49,0x726f4665,0x4274616d,
+0x6b636f6c,0x00000000,0x00060006,0x00000133,
+0x00000000,0x706d6f63,0x6d726f46,0x00007461,
+0x00060006,0x00000133,0x00000001,0x65736162,
+0x6579614c,0x00000072,0x00060005,0x00000135,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00050005,0x00000140,0x42637273,0x6b636f6c,
+0x00000000,0x00050005,0x00000143,0x6d695f75,
+0x30656761,0x00000000,0x00040005,0x00000145,
+0x61726170,0x0000006d,0x00060005,0x00000149,
+0x6f636564,0x6572706d,0x64657373,0x00000000,
+0x00040005,0x0000014a,0x61726170,0x0000006d,
+0x00040005,0x0000014e,0x61726170,0x0000006d,
+0x00040005,0x00000153,0x61726170,0x0000006d,
+0x00040005,0x00000154,0x61726170,0x0000006d,
+0x00040005,0x00000155,0x61726170,0x0000006d,
+0x00030005,0x00000157,0x00000079,0x00030005,
+0x0000015f,0x00000078,0x00050005,0x00000169,
+0x6d695f75,0x31656761,0x00000000,0x00040005,
+0x00000179,0x61726170,0x0000006d,0x00040047,
+0x00000130,0x0000000b,0x0000001c,0x00050048,
+0x00000133,0x00000000,0x00000023,0x00000000,
+0x00050048,0x00000133,0x00000001,0x00000023,
+0x00000004,0x00030047,0x00000133,0x00000002,
+0x00040047,0x00000143,0x00000022,0x00000000,
+0x00040047,0x00000143,0x00000021,0x00000000,
+0x00030047,0x00000143,0x00000018,0x00040047,
+0x00000169,0x00000022,0x00000000,0x00040047,
+0x00000169,0x00000021,0x00000001,0x00030047,
+0x00000169,0x00000019,0x00040047,0x000001bd,
+0x0000000b,0x00000019,0x00020013,0x00000002,
+0x00030021,0x00000003,0x00000002,0x00040015,
+0x00000006,0x00000020,0x00000001,0x00040017,
+0x00000007,0x00000006,0x00000003,0x00040020,
+0x00000008,0x00000007,0x00000007,0x00040021,
+0x00000009,0x00000007,0x00000008,0x00040015,
+0x0000000d,0x00000020,0x00000000,0x00040020,
+0x0000000e,0x00000007,0x0000000d,0x00020014,
+0x0000000f,0x00040020,0x00000010,0x00000007,
+0x0000000f,0x00030016,0x00000011,0x00000020,
+0x0004002b,0x0000000d,0x00000012,0x00000010,
+0x0004001c,0x00000013,0x00000011,0x00000012,
+0x00060021,0x00000014,0x00000013,0x0000000e,
+0x0000000e,0x00000010,0x00040021,0x0000001a,
+0x0000000d,0x0000000e,0x00040020,0x00000021,
+0x00000007,0x00000006,0x0004002b,0x00000006,
+0x00000024,0x00000018,0x0004002b,0x00000006,
+0x0000002b,0x00000080,0x0004002b,0x00000006,
+0x0000002f,0x00000100,0x0004002b,0x00000006,
+0x00000033,0xffffff80,0x0004002b,0x00000006,
+0x00000037,0xffffff81,0x0004002b,0x00000006,
+0x0000003a,0x00000014,0x0004002b,0x00000006,
+0x0000003d,0x0000000f,0x0004002b,0x00000006,
+0x00000042,0x00000010,0x0004002b,0x0000000d,
+0x00000044,0x0000000f,0x00040017,0x00000046,
+0x00000006,0x00000004,0x00040020,0x00000047,
+0x00000007,0x00000046,0x0004002b,0x0000000d,
+0x00000049,0x00000020,0x0004001c,0x0000004a,
+0x00000046,0x00000049,0x0004002b,0x00000006,
+0x0000004b,0xfffffffd,0x0004002b,0x00000006,
+0x0000004c,0xfffffffa,0x0004002b,0x00000006,
+0x0000004d,0xfffffff7,0x0004002b,0x00000006,
+0x0000004e,0xfffffff1,0x0007002c,0x00000046,
+0x0000004f,0x0000004b,0x0000004c,0x0000004d,
+0x0000004e,0x0004002b,0x00000006,0x00000050,
+0x00000002,0x0004002b,0x00000006,0x00000051,
+0x00000005,0x0004002b,0x00000006,0x00000052,
+0x00000008,0x0004002b,0x00000006,0x00000053,
+0x0000000e,0x0007002c,0x00000046,0x00000054,
+0x00000050,0x00000051,0x00000052,0x00000053,
+0x0004002b,0x00000006,0x00000055,0xfffffff9,
+0x0004002b,0x00000006,0x00000056,0xfffffff6,
+0x0004002b,0x00000006,0x00000057,0xfffffff3,
+0x0007002c,0x00000046,0x00000058,0x0000004b,
+0x00000055,0x00000056,0x00000057,0x0004002b,
+0x00000006,0x00000059,0x00000006,0x0004002b,
+0x00000006,0x0000005a,0x00000009,0x0004002b,
+0x00000006,0x0000005b,0x0000000c,0x0007002c,
+0x00000046,0x0000005c,0x00000050,0x00000059,
+0x0000005a,0x0000005b,0x0004002b,0x00000006,
+0x0000005d,0xfffffffe,0x0004002b,0x00000006,
+0x0000005e,0xfffffffb,0x0004002b,0x00000006,
+0x0000005f,0xfffffff8,0x0007002c,0x00000046,
+0x00000060,0x0000005d,0x0000005e,0x0000005f,
+0x00000057,0x0004002b,0x00000006,0x00000061,
+0x00000001,0x0004002b,0x00000006,0x00000062,
+0x00000004,0x0004002b,0x00000006,0x00000063,
+0x00000007,0x0007002c,0x00000046,0x00000064,
+0x00000061,0x00000062,0x00000063,0x0000005b,
+0x0004002b,0x00000006,0x00000065,0xfffffffc,
+0x0007002c,0x00000046,0x00000066,0x0000005d,
+0x00000065,0x0000004c,0x00000057,0x0004002b,
+0x00000006,0x00000067,0x00000003,0x0007002c,
+0x00000046,0x00000068,0x00000061,0x00000067,
+0x00000051,0x0000005b,0x0004002b,0x00000006,
+0x00000069,0xfffffff4,0x0007002c,0x00000046,
+0x0000006a,0x0000004b,0x0000004c,0x0000005f,
+0x00000069,0x0004002b,0x00000006,0x0000006b,
+0x0000000b,0x0007002c,0x00000046,0x0000006c,
+0x00000050,0x00000051,0x00000063,0x0000006b,
+0x0004002b,0x00000006,0x0000006d,0xfffffff5,
+0x0007002c,0x00000046,0x0000006e,0x0000004b,
+0x00000055,0x0000004d,0x0000006d,0x0004002b,
+0x00000006,0x0000006f,0x0000000a,0x0007002c,
+0x00000046,0x00000070,0x00000050,0x00000059,
+0x00000052,0x0000006f,0x0007002c,0x00000046,
+0x00000071,0x00000065,0x00000055,0x0000005f,
+0x0000006d,0x0007002c,0x00000046,0x00000072,
+0x00000067,0x00000059,0x00000063,0x0000006f,
+0x0007002c,0x00000046,0x00000073,0x0000004b,
+0x0000005e,0x0000005f,0x0000006d,0x0007002c,
+0x00000046,0x00000074,0x00000050,0x00000062,
+0x00000063,0x0000006f,0x0007002c,0x00000046,
+0x00000075,0x0000005d,0x0000004c,0x0000005f,
+0x00000056,0x0007002c,0x00000046,0x00000076,
+0x00000061,0x00000051,0x00000063,0x0000005a,
+0x0007002c,0x00000046,0x00000077,0x0000005d,
+0x0000005e,0x0000005f,0x00000056,0x0007002c,
+0x00000046,0x00000078,0x00000061,0x00000062,
+0x00000063,0x0000005a,0x0007002c,0x00000046,
+0x00000079,0x0000005d,0x00000065,0x0000005f,
+0x00000056,0x0007002c,0x00000046,0x0000007a,
+0x00000061,0x00000067,0x00000063,0x0000005a,
+0x0007002c,0x00000046,0x0000007b,0x0000005d,
+0x0000005e,0x00000055,0x00000056,0x0007002c,
+0x00000046,0x0000007c,0x00000061,0x00000062,
+0x00000059,0x0000005a,0x0007002c,0x00000046,
+0x0000007d,0x0000004b,0x00000065,0x00000055,
+0x00000056,0x0007002c,0x00000046,0x0000007e,
+0x00000050,0x00000067,0x00000059,0x0000005a,
+0x0004002b,0x00000006,0x0000007f,0xffffffff,
+0x0007002c,0x00000046,0x00000080,0x0000007f,
+0x0000005d,0x0000004b,0x00000056,0x0004002b,
+0x00000006,0x00000081,0x00000000,0x0007002c,
+0x00000046,0x00000082,0x00000081,0x00000061,
+0x00000050,0x0000005a,0x0007002c,0x00000046,
+0x00000083,0x00000065,0x0000004c,0x0000005f,
+0x0000004d,0x0007002c,0x00000046,0x00000084,
+0x00000067,0x00000051,0x00000063,0x00000052,
+0x0007002c,0x00000046,0x00000085,0x0000004b,
+0x0000005e,0x00000055,0x0000004d,0x0007002c,
+0x00000046,0x00000086,0x00000050,0x00000062,
+0x00000059,0x00000052,0x0023002c,0x0000004a,
+0x00000087,0x0000004f,0x00000054,0x00000058,
+0x0000005c,0x00000060,0x00000064,0x00000066,
+0x00000068,0x0000006a,0x0000006c,0x0000006e,
+0x00000070,0x00000071,0x00000072,0x00000073,
+0x00000074,0x00000075,0x00000076,0x00000077,
+0x00000078,0x00000079,0x0000007a,0x0000007b,
+0x0000007c,0x0000007d,0x0000007e,0x00000080,
+0x00000082,0x00000083,0x00000084,0x00000085,
+0x00000086,0x0004002b,0x0000000d,0x00000089,
+0x00000002,0x00040020,0x0000008b,0x00000007,
+0x0000004a,0x0004002b,0x0000000d,0x00000092,
+0x00000001,0x0004001c,0x00000097,0x0000000d,
+0x00000012,0x00040020,0x00000098,0x00000007,
+0x00000097,0x0004002b,0x00000006,0x0000009b,
+0x0000000d,0x0004002b,0x00000006,0x000000a8,
+0x0000001e,0x0004002b,0x00000006,0x000000ac,
+0x0000001b,0x0004002b,0x00000006,0x000000b1,
+0x00000015,0x0004002b,0x00000006,0x000000b4,
+0x00000012,0x0004002b,0x0000000d,0x000000c3,
+0x00000000,0x0004002b,0x0000000d,0x000000cd,
+0x00000004,0x0004002b,0x0000000d,0x000000d7,
+0x00000007,0x0004002b,0x00000006,0x000000fb,
+0xfffffc01,0x0004002b,0x00000006,0x000000fc,
+0x000003ff,0x00040020,0x000000fe,0x00000007,
+0x00000013,0x0004002b,0x00000011,0x00000103,
+0x447fc000,0x00040020,0x00000105,0x00000007,
+0x00000011,0x0004002b,0x00000006,0x0000010b,
+0x000007ff,0x0004002b,0x00000011,0x00000110,
+0x44ffe000,0x0004002b,0x0000000d,0x00000119,
+0x000000ff,0x0004002b,0x0000000d,0x0000011d,
+0x0000ff00,0x0004002b,0x0000000d,0x00000122,
+0x00ff0000,0x0004002b,0x0000000d,0x00000127,
+0xff000000,0x00040017,0x0000012e,0x0000000d,
+0x00000003,0x00040020,0x0000012f,0x00000001,
+0x0000012e,0x0004003b,0x0000012f,0x00000130,
+0x00000001,0x0004001e,0x00000133,0x0000000d,
+0x0000000d,0x00040020,0x00000134,0x00000009,
+0x00000133,0x0004003b,0x00000134,0x00000135,
+0x00000009,0x00040020,0x00000136,0x00000009,
+0x0000000d,0x00040017,0x0000013e,0x0000000d,
+0x00000004,0x00040020,0x0000013f,0x00000007,
+0x0000013e,0x00090019,0x00000141,0x0000000d,
+0x00000002,0x00000000,0x00000000,0x00000000,
+0x00000002,0x00000023,0x00040020,0x00000142,
+0x00000000,0x00000141,0x0004003b,0x00000142,
+0x00000143,0x00000000,0x00030029,0x0000000f,
+0x00000152,0x00090019,0x00000167,0x00000011,
+0x00000002,0x00000000,0x00000000,0x00000000,
+0x00000002,0x00000013,0x00040020,0x00000168,
+0x00000000,0x00000167,0x0004003b,0x00000168,
+0x00000169,0x00000000,0x00040017,0x0000016b,
+0x00000006,0x00000002,0x0004002b,0x00000011,
+0x00000181,0x00000000,0x0004002b,0x00000011,
+0x00000182,0x3f800000,0x00040017,0x00000183,
+0x00000011,0x00000004,0x0004002b,0x0000000d,
+0x00000189,0x00000093,0x0004002b,0x0000000d,
+0x0000018a,0x00000094,0x0004002b,0x0000000d,
+0x0000018b,0x00000095,0x0004002b,0x0000000d,
+0x0000018c,0x00000096,0x0004002b,0x0000000d,
+0x0000018d,0x00000097,0x0004002b,0x0000000d,
+0x0000018e,0x00000098,0x0004002b,0x0000000d,
+0x0000018f,0x00000099,0x0004002b,0x0000000d,
+0x00000190,0x0000009a,0x0004002b,0x0000000d,
+0x00000191,0x0000009b,0x0004002b,0x0000000d,
+0x00000192,0x0000009c,0x0004002b,0x0000000d,
+0x00000193,0x00000008,0x0004001c,0x00000194,
+0x00000006,0x00000193,0x000b002c,0x00000194,
+0x00000195,0x00000081,0x00000061,0x00000050,
+0x00000067,0x00000065,0x0000004b,0x0000005d,
+0x0000007f,0x0004001c,0x00000196,0x00000046,
+0x00000193,0x0007002c,0x00000046,0x00000197,
+0x00000050,0x00000052,0x0000005d,0x0000005f,
+0x0004002b,0x00000006,0x00000198,0x00000011,
+0x0004002b,0x00000006,0x00000199,0xffffffef,
+0x0007002c,0x00000046,0x0000019a,0x00000051,
+0x00000198,0x0000005e,0x00000199,0x0004002b,
+0x00000006,0x0000019b,0x0000001d,0x0004002b,
+0x00000006,0x0000019c,0xffffffe3,0x0007002c,
+0x00000046,0x0000019d,0x0000005a,0x0000019b,
+0x0000004d,0x0000019c,0x0004002b,0x00000006,
+0x0000019e,0x0000002a,0x0004002b,0x00000006,
+0x0000019f,0xffffffd6,0x0007002c,0x00000046,
+0x000001a0,0x0000009b,0x0000019e,0x00000057,
+0x0000019f,0x0004002b,0x00000006,0x000001a1,
+0x0000003c,0x0004002b,0x00000006,0x000001a2,
+0xffffffee,0x0004002b,0x00000006,0x000001a3,
+0xffffffc4,0x0007002c,0x00000046,0x000001a4,
+0x000000b4,0x000001a1,0x000001a2,0x000001a3,
+0x0004002b,0x00000006,0x000001a5,0x00000050,
+0x0004002b,0x00000006,0x000001a6,0xffffffe8,
+0x0004002b,0x00000006,0x000001a7,0xffffffb0,
+0x0007002c,0x00000046,0x000001a8,0x00000024,
+0x000001a5,0x000001a6,0x000001a7,0x0004002b,
+0x00000006,0x000001a9,0x00000021,0x0004002b,
+0x00000006,0x000001aa,0x0000006a,0x0004002b,
+0x00000006,0x000001ab,0xffffffdf,0x0004002b,
+0x00000006,0x000001ac,0xffffff96,0x0007002c,
+0x00000046,0x000001ad,0x000001a9,0x000001aa,
+0x000001ab,0x000001ac,0x0004002b,0x00000006,
+0x000001ae,0x0000002f,0x0004002b,0x00000006,
+0x000001af,0x000000b7,0x0004002b,0x00000006,
+0x000001b0,0xffffffd1,0x0004002b,0x00000006,
+0x000001b1,0xffffff49,0x0007002c,0x00000046,
+0x000001b2,0x000001ae,0x000001af,0x000001b0,
+0x000001b1,0x000b002c,0x00000196,0x000001b3,
+0x00000197,0x0000019a,0x0000019d,0x000001a0,
+0x000001a4,0x000001a8,0x000001ad,0x000001b2,
+0x0007002c,0x00000046,0x000001b4,0x00000081,
+0x00000052,0x00000081,0x0000005f,0x0007002c,
+0x00000046,0x000001b5,0x00000081,0x00000198,
+0x00000081,0x00000199,0x0007002c,0x00000046,
+0x000001b6,0x00000081,0x0000019b,0x00000081,
+0x0000019c,0x0007002c,0x00000046,0x000001b7,
+0x00000081,0x0000019e,0x00000081,0x0000019f,
+0x0007002c,0x00000046,0x000001b8,0x00000081,
+0x000001a1,0x00000081,0x000001a3,0x0007002c,
+0x00000046,0x000001b9,0x00000081,0x000001a5,
+0x00000081,0x000001a7,0x0007002c,0x00000046,
+0x000001ba,0x00000081,0x000001aa,0x00000081,
+0x000001ac,0x0007002c,0x00000046,0x000001bb,
+0x00000081,0x000001af,0x00000081,0x000001b1,
+0x000b002c,0x00000196,0x000001bc,0x000001b4,
+0x000001b5,0x000001b6,0x000001b7,0x000001b8,
+0x000001b9,0x000001ba,0x000001bb,0x0006002c,
+0x0000012e,0x000001bd,0x00000193,0x00000193,
+0x00000092,0x00050036,0x00000002,0x00000004,
+0x00000000,0x00000003,0x000200f8,0x00000005,
+0x0004003b,0x00000008,0x0000012d,0x00000007,
+0x0004003b,0x0000013f,0x00000140,0x00000007,
+0x0004003b,0x00000008,0x00000145,0x00000007,
+0x0004003b,0x000000fe,0x00000149,0x00000007,
+0x0004003b,0x0000000e,0x0000014a,0x00000007,
+0x0004003b,0x0000000e,0x0000014e,0x00000007,
+0x0004003b,0x0000000e,0x00000153,0x00000007,
+0x0004003b,0x0000000e,0x00000154,0x00000007,
+0x0004003b,0x00000010,0x00000155,0x00000007,
+0x0004003b,0x00000021,0x00000157,0x00000007,
+0x0004003b,0x00000021,0x0000015f,0x00000007,
+0x0004003b,0x00000008,0x00000179,0x00000007,
+0x0004003d,0x0000012e,0x00000131,0x00000130,
+0x0004007c,0x00000007,0x00000132,0x00000131,
+0x0003003e,0x0000012d,0x00000132,0x00050041,
+0x00000136,0x00000137,0x00000135,0x00000061,
+0x0004003d,0x0000000d,0x00000138,0x00000137,
+0x0004007c,0x00000006,0x00000139,0x00000138,
+0x00050041,0x00000021,0x0000013a,0x0000012d,
+0x00000089,0x0004003d,0x00000006,0x0000013b,
+0x0000013a,0x00050080,0x00000006,0x0000013c,
+0x0000013b,0x00000139,0x00050041,0x00000021,
+0x0000013d,0x0000012d,0x00000089,0x0003003e,
+0x0000013d,0x0000013c,0x0004003d,0x00000141,
+0x00000144,0x00000143,0x0004003d,0x00000007,
+0x00000146,0x0000012d,0x0003003e,0x00000145,
+0x00000146,0x00050039,0x00000007,0x00000147,
+0x0000000b,0x00000145,0x00050062,0x0000013e,
+0x00000148,0x00000144,0x00000147,0x0003003e,
+0x00000140,0x00000148,0x00050041,0x0000000e,
+0x0000014b,0x00000140,0x000000c3,0x0004003d,
+0x0000000d,0x0000014c,0x0000014b,0x0003003e,
+0x0000014a,0x0000014c,0x00050039,0x0000000d,
+0x0000014d,0x0000001c,0x0000014a,0x00050041,
+0x0000000e,0x0000014f,0x00000140,0x00000092,
+0x0004003d,0x0000000d,0x00000150,0x0000014f,
+0x0003003e,0x0000014e,0x00000150,0x00050039,
+0x0000000d,0x00000151,0x0000001c,0x0000014e,
+0x0003003e,0x00000153,0x0000014d,0x0003003e,
+0x00000154,0x00000151,0x0003003e,0x00000155,
+0x00000152,0x00070039,0x00000013,0x00000156,
+0x00000018,0x00000153,0x00000154,0x00000155,
+0x0003003e,0x00000149,0x00000156,0x0003003e,
+0x00000157,0x00000081,0x000200f9,0x00000158,
+0x000200f8,0x00000158,0x000400f6,0x0000015a,
+0x0000015b,0x00000000,0x000200f9,0x0000015c,
+0x000200f8,0x0000015c,0x0004003d,0x00000006,
+0x0000015d,0x00000157,0x000500b1,0x0000000f,
+0x0000015e,0x0000015d,0x00000062,0x000400fa,
+0x0000015e,0x00000159,0x0000015a,0x000200f8,
+0x00000159,0x0003003e,0x0000015f,0x00000081,
+0x000200f9,0x00000160,0x000200f8,0x00000160,
+0x000400f6,0x00000162,0x00000163,0x00000000,
+0x000200f9,0x00000164,0x000200f8,0x00000164,
+0x0004003d,0x00000006,0x00000165,0x0000015f,
+0x000500b1,0x0000000f,0x00000166,0x00000165,
+0x00000062,0x000400fa,0x00000166,0x00000161,
+0x00000162,0x000200f8,0x00000161,0x0004003d,
+0x00000167,0x0000016a,0x00000169,0x0004003d,
+0x00000007,0x0000016c,0x0000012d,0x0007004f,
+0x0000016b,0x0000016d,0x0000016c,0x0000016c,
+0x00000000,0x00000001,0x00050050,0x0000016b,
+0x0000016e,0x00000062,0x00000062,0x00050084,
+0x0000016b,0x0000016f,0x0000016d,0x0000016e,
+0x0004003d,0x00000006,0x00000170,0x0000015f,
+0x0004003d,0x00000006,0x00000171,0x00000157,
+0x00050050,0x0000016b,0x00000172,0x00000170,
+0x00000171,0x00050080,0x0000016b,0x00000173,
+0x0000016f,0x00000172,0x00050041,0x00000021,
+0x00000174,0x0000012d,0x00000089,0x0004003d,
+0x00000006,0x00000175,0x00000174,0x00050051,
+0x00000006,0x00000176,0x00000173,0x00000000,
+0x00050051,0x00000006,0x00000177,0x00000173,
+0x00000001,0x00060050,0x00000007,0x00000178,
+0x00000176,0x00000177,0x00000175,0x0003003e,
+0x00000179,0x00000178,0x00050039,0x00000007,
+0x0000017a,0x0000000b,0x00000179,0x0004003d,
+0x00000006,0x0000017b,0x00000157,0x00050084,
+0x00000006,0x0000017c,0x0000017b,0x00000062,
+0x0004003d,0x00000006,0x0000017d,0x0000015f,
+0x00050080,0x00000006,0x0000017e,0x0000017c,
+0x0000017d,0x00050041,0x00000105,0x0000017f,
+0x00000149,0x0000017e,0x0004003d,0x00000011,
+0x00000180,0x0000017f,0x00070050,0x00000183,
+0x00000184,0x00000180,0x00000181,0x00000181,
+0x00000182,0x00040063,0x0000016a,0x0000017a,
+0x00000184,0x000200f9,0x00000163,0x000200f8,
+0x00000163,0x0004003d,0x00000006,0x00000185,
+0x0000015f,0x00050080,0x00000006,0x00000186,
+0x00000185,0x00000061,0x0003003e,0x0000015f,
+0x00000186,0x000200f9,0x00000160,0x000200f8,
+0x00000162,0x000200f9,0x0000015b,0x000200f8,
+0x0000015b,0x0004003d,0x00000006,0x00000187,
+0x00000157,0x00050080,0x00000006,0x00000188,
+0x00000187,0x00000061,0x0003003e,0x00000157,
+0x00000188,0x000200f9,0x00000158,0x000200f8,
+0x0000015a,0x000100fd,0x00010038,0x00050036,
+0x00000007,0x0000000b,0x00000000,0x00000009,
+0x00030037,0x00000008,0x0000000a,0x000200f8,
+0x0000000c,0x0004003d,0x00000007,0x0000001e,
+0x0000000a,0x000200fe,0x0000001e,0x00010038,
+0x00050036,0x00000013,0x00000018,0x00000000,
+0x00000014,0x00030037,0x0000000e,0x00000015,
+0x00030037,0x0000000e,0x00000016,0x00030037,
+0x00000010,0x00000017,0x000200f8,0x00000019,
+0x0004003b,0x00000021,0x00000022,0x00000007,
+0x0004003b,0x00000021,0x00000038,0x00000007,
+0x0004003b,0x0000000e,0x00000040,0x00000007,
+0x0004003b,0x00000047,0x00000048,0x00000007,
+0x0004003b,0x0000008b,0x0000008c,0x00000007,
+0x0004003b,0x00000047,0x0000008f,0x00000007,
+0x0004003b,0x0000008b,0x00000094,0x00000007,
+0x0004003b,0x00000098,0x00000099,0x00000007,
+0x0004003b,0x0000000e,0x000000c2,0x00000007,
+0x0004003b,0x0000000e,0x000000cb,0x00000007,
+0x0004003b,0x0000000e,0x000000d3,0x00000007,
+0x0004003b,0x00000021,0x000000d9,0x00000007,
+0x0004003b,0x00000021,0x000000dc,0x00000007,
+0x0004003b,0x00000021,0x000000e8,0x00000007,
+0x0004003b,0x000000fe,0x000000ff,0x00000007,
+0x0004003d,0x0000000d,0x00000023,0x00000015,
+0x000500c2,0x0000000d,0x00000025,0x00000023,
+0x00000024,0x0004007c,0x00000006,0x00000026,
+0x00000025,0x0003003e,0x00000022,0x00000026,
+0x0004003d,0x0000000f,0x00000027,0x00000017,
+0x000300f7,0x00000029,0x00000000,0x000400fa,
+0x00000027,0x00000028,0x00000029,0x000200f8,
+0x00000028,0x0004003d,0x00000006,0x0000002a,
+0x00000022,0x000500af,0x0000000f,0x0000002c,
+0x0000002a,0x0000002b,0x000300f7,0x0000002e,
+0x00000000,0x000400fa,0x0000002c,0x0000002d,
+0x0000002e,0x000200f8,0x0000002d,0x0004003d,
+0x00000006,0x00000030,0x00000022,0x00050082,
+0x00000006,0x00000031,0x00000030,0x0000002f,
+0x0003003e,0x00000022,0x00000031,0x000200f9,
+0x0000002e,0x000200f8,0x0000002e,0x0004003d,
+0x00000006,0x00000032,0x00000022,0x000500aa,
+0x0000000f,0x00000034,0x00000032,0x00000033,
+0x000300f7,0x00000036,0x00000000,0x000400fa,
+0x00000034,0x00000035,0x00000036,0x000200f8,
+0x00000035,0x0003003e,0x00000022,0x00000037,
+0x000200f9,0x00000036,0x000200f8,0x00000036,
+0x000200f9,0x00000029,0x000200f8,0x00000029,
+0x0004003d,0x0000000d,0x00000039,0x00000015,
+0x000500c2,0x0000000d,0x0000003b,0x00000039,
+0x0000003a,0x0004007c,0x00000006,0x0000003c,
+0x0000003b,0x0003003e,0x00000038,0x0000003c,
+0x0004003d,0x00000006,0x0000003e,0x00000038,
+0x000500c7,0x00000006,0x0000003f,0x0000003e,
+0x0000003d,0x0003003e,0x00000038,0x0000003f,
+0x0004003d,0x0000000d,0x00000041,0x00000015,
+0x000500c2,0x0000000d,0x00000043,0x00000041,
+0x00000042,0x000500c7,0x0000000d,0x00000045,
+0x00000043,0x00000044,0x0003003e,0x00000040,
+0x00000045,0x0004003d,0x0000000d,0x00000088,
+0x00000040,0x00050084,0x0000000d,0x0000008a,
+0x00000088,0x00000089,0x0003003e,0x0000008c,
+0x00000087,0x00050041,0x00000047,0x0000008d,
+0x0000008c,0x0000008a,0x0004003d,0x00000046,
+0x0000008e,0x0000008d,0x0003003e,0x00000048,
+0x0000008e,0x0004003d,0x0000000d,0x00000090,
+0x00000040,0x00050084,0x0000000d,0x00000091,
+0x00000090,0x00000089,0x00050080,0x0000000d,
+0x00000093,0x00000091,0x00000092,0x0003003e,
+0x00000094,0x00000087,0x00050041,0x00000047,
+0x00000095,0x00000094,0x00000093,0x0004003d,
+0x00000046,0x00000096,0x00000095,0x0003003e,
+0x0000008f,0x00000096,0x0004003d,0x0000000d,
+0x0000009a,0x00000015,0x000500c2,0x0000000d,
+0x0000009c,0x0000009a,0x0000009b,0x0004003d,
+0x0000000d,0x0000009d,0x00000015,0x000500c2,
+0x0000000d,0x0000009e,0x0000009d,0x0000006f,
+0x0004003d,0x0000000d,0x0000009f,0x00000015,
+0x000500c2,0x0000000d,0x000000a0,0x0000009f,
+0x00000063,0x0004003d,0x0000000d,0x000000a1,
+0x00000015,0x000500c2,0x0000000d,0x000000a2,
+0x000000a1,0x00000062,0x0004003d,0x0000000d,
+0x000000a3,0x00000015,0x000500c2,0x0000000d,
+0x000000a4,0x000000a3,0x00000061,0x0004003d,
+0x0000000d,0x000000a5,0x00000015,0x000500c4,
+0x0000000d,0x000000a6,0x000000a5,0x00000050,
+0x0004003d,0x0000000d,0x000000a7,0x00000016,
+0x000500c2,0x0000000d,0x000000a9,0x000000a7,
+0x000000a8,0x000500c5,0x0000000d,0x000000aa,
+0x000000a6,0x000000a9,0x0004003d,0x0000000d,
+0x000000ab,0x00000016,0x000500c2,0x0000000d,
+0x000000ad,0x000000ab,0x000000ac,0x0004003d,
+0x0000000d,0x000000ae,0x00000016,0x000500c2,
+0x0000000d,0x000000af,0x000000ae,0x00000024,
+0x0004003d,0x0000000d,0x000000b0,0x00000016,
+0x000500c2,0x0000000d,0x000000b2,0x000000b0,
+0x000000b1,0x0004003d,0x0000000d,0x000000b3,
+0x00000016,0x000500c2,0x0000000d,0x000000b5,
+0x000000b3,0x000000b4,0x0004003d,0x0000000d,
+0x000000b6,0x00000016,0x000500c2,0x0000000d,
+0x000000b7,0x000000b6,0x0000003d,0x0004003d,
+0x0000000d,0x000000b8,0x00000016,0x000500c2,
+0x0000000d,0x000000b9,0x000000b8,0x0000005b,
+0x0004003d,0x0000000d,0x000000ba,0x00000016,
+0x000500c2,0x0000000d,0x000000bb,0x000000ba,
+0x0000005a,0x0004003d,0x0000000d,0x000000bc,
+0x00000016,0x000500c2,0x0000000d,0x000000bd,
+0x000000bc,0x00000059,0x0004003d,0x0000000d,
+0x000000be,0x00000016,0x000500c2,0x0000000d,
+0x000000bf,0x000000be,0x00000067,0x0004003d,
+0x0000000d,0x000000c0,0x00000016,0x00130050,
+0x00000097,0x000000c1,0x0000009c,0x0000009e,
+0x000000a0,0x000000a2,0x000000a4,0x000000aa,
+0x000000ad,0x000000af,0x000000b2,0x000000b5,
+0x000000b7,0x000000b9,0x000000bb,0x000000bd,
+0x000000bf,0x000000c0,0x0003003e,0x00000099,
+0x000000c1,0x0003003e,0x000000c2,0x000000c3,
+0x000200f9,0x000000c4,0x000200f8,0x000000c4,
+0x000400f6,0x000000c6,0x000000c7,0x00000000,
+0x000200f9,0x000000c8,0x000200f8,0x000000c8,
+0x0004003d,0x0000000d,0x000000c9,0x000000c2,
+0x000500b0,0x0000000f,0x000000ca,0x000000c9,
+0x00000012,0x000400fa,0x000000ca,0x000000c5,
+0x000000c6,0x000200f8,0x000000c5,0x0004003d,
+0x0000000d,0x000000cc,0x000000c2,0x00050089,
+0x0000000d,0x000000ce,0x000000cc,0x000000cd,
+0x00050084,0x0000000d,0x000000cf,0x000000ce,
+0x000000cd,0x0004003d,0x0000000d,0x000000d0,
+0x000000c2,0x00050086,0x0000000d,0x000000d1,
+0x000000d0,0x000000cd,0x00050080,0x0000000d,
+0x000000d2,0x000000cf,0x000000d1,0x0003003e,
+0x000000cb,0x000000d2,0x0004003d,0x0000000d,
+0x000000d4,0x000000c2,0x00050041,0x0000000e,
+0x000000d5,0x00000099,0x000000d4,0x0004003d,
+0x0000000d,0x000000d6,0x000000d5,0x000500c7,
+0x0000000d,0x000000d8,0x000000d6,0x000000d7,
+0x0003003e,0x000000d3,0x000000d8,0x0004003d,
+0x0000000d,0x000000da,0x000000d3,0x000500ae,
+0x0000000f,0x000000db,0x000000da,0x000000cd,
+0x000300f7,0x000000de,0x00000000,0x000400fa,
+0x000000db,0x000000dd,0x000000e3,0x000200f8,
+0x000000dd,0x0004003d,0x0000000d,0x000000df,
+0x000000d3,0x00050082,0x0000000d,0x000000e0,
+0x000000df,0x000000cd,0x00050041,0x00000021,
+0x000000e1,0x0000008f,0x000000e0,0x0004003d,
+0x00000006,0x000000e2,0x000000e1,0x0003003e,
+0x000000dc,0x000000e2,0x000200f9,0x000000de,
+0x000200f8,0x000000e3,0x0004003d,0x0000000d,
+0x000000e4,0x000000d3,0x00050041,0x00000021,
+0x000000e5,0x00000048,0x000000e4,0x0004003d,
+0x00000006,0x000000e6,0x000000e5,0x0003003e,
+0x000000dc,0x000000e6,0x000200f9,0x000000de,
+0x000200f8,0x000000de,0x0004003d,0x00000006,
+0x000000e7,0x000000dc,0x0003003e,0x000000d9,
+0x000000e7,0x0004003d,0x00000006,0x000000e9,
+0x00000022,0x0004003d,0x00000006,0x000000ea,
+0x000000d9,0x0004003d,0x00000006,0x000000eb,
+0x00000038,0x00050084,0x00000006,0x000000ec,
+0x000000ea,0x000000eb,0x00050080,0x00000006,
+0x000000ed,0x000000e9,0x000000ec,0x0003003e,
+0x000000e8,0x000000ed,0x0004003d,0x00000006,
+0x000000ee,0x000000e8,0x00050084,0x00000006,
+0x000000ef,0x000000ee,0x00000052,0x0003003e,
+0x000000e8,0x000000ef,0x0004003d,0x00000006,
+0x000000f0,0x00000038,0x000500aa,0x0000000f,
+0x000000f1,0x000000f0,0x00000081,0x000300f7,
+0x000000f3,0x00000000,0x000400fa,0x000000f1,
+0x000000f2,0x000000f3,0x000200f8,0x000000f2,
+0x0004003d,0x00000006,0x000000f4,0x000000d9,
+0x0004003d,0x00000006,0x000000f5,0x000000e8,
+0x00050080,0x00000006,0x000000f6,0x000000f5,
+0x000000f4,0x0003003e,0x000000e8,0x000000f6,
+0x000200f9,0x000000f3,0x000200f8,0x000000f3,
+0x0004003d,0x0000000f,0x000000f7,0x00000017,
+0x000300f7,0x000000f9,0x00000000,0x000400fa,
+0x000000f7,0x000000f8,0x00000107,0x000200f8,
+0x000000f8,0x0004003d,0x00000006,0x000000fa,
+0x000000e8,0x0008000c,0x00000006,0x000000fd,
+0x00000001,0x0000002d,0x000000fa,0x000000fb,
+0x000000fc,0x0003003e,0x000000e8,0x000000fd,
+0x0004003d,0x0000000d,0x00000100,0x000000cb,
+0x0004003d,0x00000006,0x00000101,0x000000e8,
+0x0004006f,0x00000011,0x00000102,0x00000101,
+0x00050088,0x00000011,0x00000104,0x00000102,
+0x00000103,0x00050041,0x00000105,0x00000106,
+0x000000ff,0x00000100,0x0003003e,0x00000106,
+0x00000104,0x000200f9,0x000000f9,0x000200f8,
+0x00000107,0x0004003d,0x00000006,0x00000108,
+0x000000e8,0x00050080,0x00000006,0x00000109,
+0x00000108,0x00000062,0x0003003e,0x000000e8,
+0x00000109,0x0004003d,0x00000006,0x0000010a,
+0x000000e8,0x0008000c,0x00000006,0x0000010c,
+0x00000001,0x0000002d,0x0000010a,0x00000081,
+0x0000010b,0x0003003e,0x000000e8,0x0000010c,
+0x0004003d,0x0000000d,0x0000010d,0x000000cb,
+0x0004003d,0x00000006,0x0000010e,0x000000e8,
+0x0004006f,0x00000011,0x0000010f,0x0000010e,
+0x00050088,0x00000011,0x00000111,0x0000010f,
+0x00000110,0x00050041,0x00000105,0x00000112,
+0x000000ff,0x0000010d,0x0003003e,0x00000112,
+0x00000111,0x000200f9,0x000000f9,0x000200f8,
+0x000000f9,0x000200f9,0x000000c7,0x000200f8,
+0x000000c7,0x0004003d,0x0000000d,0x00000113,
+0x000000c2,0x00050080,0x0000000d,0x00000114,
+0x00000113,0x00000061,0x0003003e,0x000000c2,
+0x00000114,0x000200f9,0x000000c4,0x000200f8,
+0x000000c6,0x0004003d,0x00000013,0x00000115,
+0x000000ff,0x000200fe,0x00000115,0x00010038,
+0x00050036,0x0000000d,0x0000001c,0x00000000,
+0x0000001a,0x00030037,0x0000000e,0x0000001b,
+0x000200f8,0x0000001d,0x0004003d,0x0000000d,
+0x00000118,0x0000001b,0x000500c7,0x0000000d,
+0x0000011a,0x00000118,0x00000119,0x000500c4,
+0x0000000d,0x0000011b,0x0000011a,0x00000024,
+0x0004003d,0x0000000d,0x0000011c,0x0000001b,
+0x000500c7,0x0000000d,0x0000011e,0x0000011c,
+0x0000011d,0x000500c4,0x0000000d,0x0000011f,
+0x0000011e,0x00000052,0x000500c5,0x0000000d,
+0x00000120,0x0000011b,0x0000011f,0x0004003d,
+0x0000000d,0x00000121,0x0000001b,0x000500c7,
+0x0000000d,0x00000123,0x00000121,0x00000122,
+0x000500c2,0x0000000d,0x00000124,0x00000123,
+0x00000052,0x000500c5,0x0000000d,0x00000125,
+0x00000120,0x00000124,0x0004003d,0x0000000d,
+0x00000126,0x0000001b,0x000500c7,0x0000000d,
+0x00000128,0x00000126,0x00000127,0x000500c2,
+0x0000000d,0x00000129,0x00000128,0x00000024,
+0x000500c5,0x0000000d,0x0000012a,0x00000125,
+0x00000129,0x000200fe,0x0000012a,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_1D.inl
new file mode 100644
index 00000000000..c1d28c17acf
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_1D.inl
@@ -0,0 +1,640 @@
+0x07230203,0x00010300,0x000d000a,0x000001bf,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x00020011,0x00000031,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x00000132,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00070005,0x0000000c,0x50746567,
+0x4431736f,0x61727241,0x69762879,0x00003b33,
+0x00030005,0x0000000b,0x00736f70,0x000e0005,
+0x00000019,0x5f636165,0x6f636564,0x735f6564,
+0x6c676e69,0x68635f65,0x656e6e61,0x6c625f6c,
+0x5f6b636f,0x616f6c66,0x31752874,0x3b31753b,
+0x003b3162,0x00040005,0x00000016,0x68676968,
+0x00000000,0x00030005,0x00000017,0x00776f6c,
+0x00050005,0x00000018,0x69537369,0x64656e67,
+0x00000000,0x00050005,0x0000001d,0x70696c66,
+0x75283233,0x00003b31,0x00030005,0x0000001c,
+0x00000061,0x00060005,0x00000024,0x65736162,
+0x646f635f,0x726f7765,0x00000064,0x00050005,
+0x0000003a,0x746c756d,0x696c7069,0x00007265,
+0x00040005,0x00000042,0x496c6274,0x00007864,
+0x00040005,0x0000004a,0x6c626174,0x00003065,
+0x00050005,0x0000008e,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000091,0x6c626174,
+0x00003165,0x00050005,0x00000096,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x0000009b,
+0x00000070,0x00030005,0x000000c4,0x00000069,
+0x00040005,0x000000cd,0x4974756f,0x00007864,
+0x00050005,0x000000d5,0x69646f6d,0x72656966,
+0x00000000,0x00060005,0x000000db,0x69646f6d,
+0x72656966,0x756c6156,0x00000065,0x00040005,
+0x000000ea,0x6f636564,0x00646564,0x00040005,
+0x00000101,0x75736572,0x0000746c,0x00030005,
+0x0000012f,0x00736f70,0x00080005,0x00000132,
+0x475f6c67,0x61626f6c,0x766e496c,0x7461636f,
+0x496e6f69,0x00000044,0x00070005,0x00000135,
+0x67616d49,0x726f4665,0x4274616d,0x6b636f6c,
+0x00000000,0x00060006,0x00000135,0x00000000,
+0x706d6f63,0x6d726f46,0x00007461,0x00060006,
+0x00000135,0x00000001,0x65736162,0x6579614c,
+0x00000072,0x00060005,0x00000137,0x75705f75,
+0x6f436873,0x6174736e,0x0000746e,0x00050005,
+0x00000142,0x42637273,0x6b636f6c,0x00000000,
+0x00050005,0x00000145,0x6d695f75,0x30656761,
+0x00000000,0x00040005,0x00000147,0x61726170,
+0x0000006d,0x00060005,0x0000014b,0x6f636564,
+0x6572706d,0x64657373,0x00000000,0x00040005,
+0x0000014c,0x61726170,0x0000006d,0x00040005,
+0x00000150,0x61726170,0x0000006d,0x00040005,
+0x00000155,0x61726170,0x0000006d,0x00040005,
+0x00000156,0x61726170,0x0000006d,0x00040005,
+0x00000157,0x61726170,0x0000006d,0x00030005,
+0x00000159,0x00000079,0x00030005,0x00000161,
+0x00000078,0x00050005,0x0000016b,0x6d695f75,
+0x31656761,0x00000000,0x00040005,0x0000017a,
+0x61726170,0x0000006d,0x00040047,0x00000132,
+0x0000000b,0x0000001c,0x00050048,0x00000135,
+0x00000000,0x00000023,0x00000000,0x00050048,
+0x00000135,0x00000001,0x00000023,0x00000004,
+0x00030047,0x00000135,0x00000002,0x00040047,
+0x00000145,0x00000022,0x00000000,0x00040047,
+0x00000145,0x00000021,0x00000000,0x00030047,
+0x00000145,0x00000018,0x00040047,0x0000016b,
+0x00000022,0x00000000,0x00040047,0x0000016b,
+0x00000021,0x00000001,0x00030047,0x0000016b,
+0x00000019,0x00040047,0x000001be,0x0000000b,
+0x00000019,0x00020013,0x00000002,0x00030021,
+0x00000003,0x00000002,0x00040015,0x00000006,
+0x00000020,0x00000001,0x00040017,0x00000007,
+0x00000006,0x00000003,0x00040020,0x00000008,
+0x00000007,0x00000007,0x00040017,0x00000009,
+0x00000006,0x00000002,0x00040021,0x0000000a,
+0x00000009,0x00000008,0x00040015,0x0000000e,
+0x00000020,0x00000000,0x00040020,0x0000000f,
+0x00000007,0x0000000e,0x00020014,0x00000010,
+0x00040020,0x00000011,0x00000007,0x00000010,
+0x00030016,0x00000012,0x00000020,0x0004002b,
+0x0000000e,0x00000013,0x00000010,0x0004001c,
+0x00000014,0x00000012,0x00000013,0x00060021,
+0x00000015,0x00000014,0x0000000f,0x0000000f,
+0x00000011,0x00040021,0x0000001b,0x0000000e,
+0x0000000f,0x00040020,0x00000023,0x00000007,
+0x00000006,0x0004002b,0x00000006,0x00000026,
+0x00000018,0x0004002b,0x00000006,0x0000002d,
+0x00000080,0x0004002b,0x00000006,0x00000031,
+0x00000100,0x0004002b,0x00000006,0x00000035,
+0xffffff80,0x0004002b,0x00000006,0x00000039,
+0xffffff81,0x0004002b,0x00000006,0x0000003c,
+0x00000014,0x0004002b,0x00000006,0x0000003f,
+0x0000000f,0x0004002b,0x00000006,0x00000044,
+0x00000010,0x0004002b,0x0000000e,0x00000046,
+0x0000000f,0x00040017,0x00000048,0x00000006,
+0x00000004,0x00040020,0x00000049,0x00000007,
+0x00000048,0x0004002b,0x0000000e,0x0000004b,
+0x00000020,0x0004001c,0x0000004c,0x00000048,
+0x0000004b,0x0004002b,0x00000006,0x0000004d,
+0xfffffffd,0x0004002b,0x00000006,0x0000004e,
+0xfffffffa,0x0004002b,0x00000006,0x0000004f,
+0xfffffff7,0x0004002b,0x00000006,0x00000050,
+0xfffffff1,0x0007002c,0x00000048,0x00000051,
+0x0000004d,0x0000004e,0x0000004f,0x00000050,
+0x0004002b,0x00000006,0x00000052,0x00000002,
+0x0004002b,0x00000006,0x00000053,0x00000005,
+0x0004002b,0x00000006,0x00000054,0x00000008,
+0x0004002b,0x00000006,0x00000055,0x0000000e,
+0x0007002c,0x00000048,0x00000056,0x00000052,
+0x00000053,0x00000054,0x00000055,0x0004002b,
+0x00000006,0x00000057,0xfffffff9,0x0004002b,
+0x00000006,0x00000058,0xfffffff6,0x0004002b,
+0x00000006,0x00000059,0xfffffff3,0x0007002c,
+0x00000048,0x0000005a,0x0000004d,0x00000057,
+0x00000058,0x00000059,0x0004002b,0x00000006,
+0x0000005b,0x00000006,0x0004002b,0x00000006,
+0x0000005c,0x00000009,0x0004002b,0x00000006,
+0x0000005d,0x0000000c,0x0007002c,0x00000048,
+0x0000005e,0x00000052,0x0000005b,0x0000005c,
+0x0000005d,0x0004002b,0x00000006,0x0000005f,
+0xfffffffe,0x0004002b,0x00000006,0x00000060,
+0xfffffffb,0x0004002b,0x00000006,0x00000061,
+0xfffffff8,0x0007002c,0x00000048,0x00000062,
+0x0000005f,0x00000060,0x00000061,0x00000059,
+0x0004002b,0x00000006,0x00000063,0x00000001,
+0x0004002b,0x00000006,0x00000064,0x00000004,
+0x0004002b,0x00000006,0x00000065,0x00000007,
+0x0007002c,0x00000048,0x00000066,0x00000063,
+0x00000064,0x00000065,0x0000005d,0x0004002b,
+0x00000006,0x00000067,0xfffffffc,0x0007002c,
+0x00000048,0x00000068,0x0000005f,0x00000067,
+0x0000004e,0x00000059,0x0004002b,0x00000006,
+0x00000069,0x00000003,0x0007002c,0x00000048,
+0x0000006a,0x00000063,0x00000069,0x00000053,
+0x0000005d,0x0004002b,0x00000006,0x0000006b,
+0xfffffff4,0x0007002c,0x00000048,0x0000006c,
+0x0000004d,0x0000004e,0x00000061,0x0000006b,
+0x0004002b,0x00000006,0x0000006d,0x0000000b,
+0x0007002c,0x00000048,0x0000006e,0x00000052,
+0x00000053,0x00000065,0x0000006d,0x0004002b,
+0x00000006,0x0000006f,0xfffffff5,0x0007002c,
+0x00000048,0x00000070,0x0000004d,0x00000057,
+0x0000004f,0x0000006f,0x0004002b,0x00000006,
+0x00000071,0x0000000a,0x0007002c,0x00000048,
+0x00000072,0x00000052,0x0000005b,0x00000054,
+0x00000071,0x0007002c,0x00000048,0x00000073,
+0x00000067,0x00000057,0x00000061,0x0000006f,
+0x0007002c,0x00000048,0x00000074,0x00000069,
+0x0000005b,0x00000065,0x00000071,0x0007002c,
+0x00000048,0x00000075,0x0000004d,0x00000060,
+0x00000061,0x0000006f,0x0007002c,0x00000048,
+0x00000076,0x00000052,0x00000064,0x00000065,
+0x00000071,0x0007002c,0x00000048,0x00000077,
+0x0000005f,0x0000004e,0x00000061,0x00000058,
+0x0007002c,0x00000048,0x00000078,0x00000063,
+0x00000053,0x00000065,0x0000005c,0x0007002c,
+0x00000048,0x00000079,0x0000005f,0x00000060,
+0x00000061,0x00000058,0x0007002c,0x00000048,
+0x0000007a,0x00000063,0x00000064,0x00000065,
+0x0000005c,0x0007002c,0x00000048,0x0000007b,
+0x0000005f,0x00000067,0x00000061,0x00000058,
+0x0007002c,0x00000048,0x0000007c,0x00000063,
+0x00000069,0x00000065,0x0000005c,0x0007002c,
+0x00000048,0x0000007d,0x0000005f,0x00000060,
+0x00000057,0x00000058,0x0007002c,0x00000048,
+0x0000007e,0x00000063,0x00000064,0x0000005b,
+0x0000005c,0x0007002c,0x00000048,0x0000007f,
+0x0000004d,0x00000067,0x00000057,0x00000058,
+0x0007002c,0x00000048,0x00000080,0x00000052,
+0x00000069,0x0000005b,0x0000005c,0x0004002b,
+0x00000006,0x00000081,0xffffffff,0x0007002c,
+0x00000048,0x00000082,0x00000081,0x0000005f,
+0x0000004d,0x00000058,0x0004002b,0x00000006,
+0x00000083,0x00000000,0x0007002c,0x00000048,
+0x00000084,0x00000083,0x00000063,0x00000052,
+0x0000005c,0x0007002c,0x00000048,0x00000085,
+0x00000067,0x0000004e,0x00000061,0x0000004f,
+0x0007002c,0x00000048,0x00000086,0x00000069,
+0x00000053,0x00000065,0x00000054,0x0007002c,
+0x00000048,0x00000087,0x0000004d,0x00000060,
+0x00000057,0x0000004f,0x0007002c,0x00000048,
+0x00000088,0x00000052,0x00000064,0x0000005b,
+0x00000054,0x0023002c,0x0000004c,0x00000089,
+0x00000051,0x00000056,0x0000005a,0x0000005e,
+0x00000062,0x00000066,0x00000068,0x0000006a,
+0x0000006c,0x0000006e,0x00000070,0x00000072,
+0x00000073,0x00000074,0x00000075,0x00000076,
+0x00000077,0x00000078,0x00000079,0x0000007a,
+0x0000007b,0x0000007c,0x0000007d,0x0000007e,
+0x0000007f,0x00000080,0x00000082,0x00000084,
+0x00000085,0x00000086,0x00000087,0x00000088,
+0x0004002b,0x0000000e,0x0000008b,0x00000002,
+0x00040020,0x0000008d,0x00000007,0x0000004c,
+0x0004002b,0x0000000e,0x00000094,0x00000001,
+0x0004001c,0x00000099,0x0000000e,0x00000013,
+0x00040020,0x0000009a,0x00000007,0x00000099,
+0x0004002b,0x00000006,0x0000009d,0x0000000d,
+0x0004002b,0x00000006,0x000000aa,0x0000001e,
+0x0004002b,0x00000006,0x000000ae,0x0000001b,
+0x0004002b,0x00000006,0x000000b3,0x00000015,
+0x0004002b,0x00000006,0x000000b6,0x00000012,
+0x0004002b,0x0000000e,0x000000c5,0x00000000,
+0x0004002b,0x0000000e,0x000000cf,0x00000004,
+0x0004002b,0x0000000e,0x000000d9,0x00000007,
+0x0004002b,0x00000006,0x000000fd,0xfffffc01,
+0x0004002b,0x00000006,0x000000fe,0x000003ff,
+0x00040020,0x00000100,0x00000007,0x00000014,
+0x0004002b,0x00000012,0x00000105,0x447fc000,
+0x00040020,0x00000107,0x00000007,0x00000012,
+0x0004002b,0x00000006,0x0000010d,0x000007ff,
+0x0004002b,0x00000012,0x00000112,0x44ffe000,
+0x0004002b,0x0000000e,0x0000011b,0x000000ff,
+0x0004002b,0x0000000e,0x0000011f,0x0000ff00,
+0x0004002b,0x0000000e,0x00000124,0x00ff0000,
+0x0004002b,0x0000000e,0x00000129,0xff000000,
+0x00040017,0x00000130,0x0000000e,0x00000003,
+0x00040020,0x00000131,0x00000001,0x00000130,
+0x0004003b,0x00000131,0x00000132,0x00000001,
+0x0004001e,0x00000135,0x0000000e,0x0000000e,
+0x00040020,0x00000136,0x00000009,0x00000135,
+0x0004003b,0x00000136,0x00000137,0x00000009,
+0x00040020,0x00000138,0x00000009,0x0000000e,
+0x00040017,0x00000140,0x0000000e,0x00000004,
+0x00040020,0x00000141,0x00000007,0x00000140,
+0x00090019,0x00000143,0x0000000e,0x00000000,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x00000023,0x00040020,0x00000144,0x00000000,
+0x00000143,0x0004003b,0x00000144,0x00000145,
+0x00000000,0x0003002a,0x00000010,0x00000154,
+0x00090019,0x00000169,0x00000012,0x00000000,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x0000000e,0x00040020,0x0000016a,0x00000000,
+0x00000169,0x0004003b,0x0000016a,0x0000016b,
+0x00000000,0x0004002b,0x00000012,0x00000182,
+0x00000000,0x0004002b,0x00000012,0x00000183,
+0x3f800000,0x00040017,0x00000184,0x00000012,
+0x00000004,0x0004002b,0x0000000e,0x0000018a,
+0x00000093,0x0004002b,0x0000000e,0x0000018b,
+0x00000094,0x0004002b,0x0000000e,0x0000018c,
+0x00000095,0x0004002b,0x0000000e,0x0000018d,
+0x00000096,0x0004002b,0x0000000e,0x0000018e,
+0x00000097,0x0004002b,0x0000000e,0x0000018f,
+0x00000098,0x0004002b,0x0000000e,0x00000190,
+0x00000099,0x0004002b,0x0000000e,0x00000191,
+0x0000009a,0x0004002b,0x0000000e,0x00000192,
+0x0000009b,0x0004002b,0x0000000e,0x00000193,
+0x0000009c,0x0004002b,0x0000000e,0x00000194,
+0x00000008,0x0004001c,0x00000195,0x00000006,
+0x00000194,0x000b002c,0x00000195,0x00000196,
+0x00000083,0x00000063,0x00000052,0x00000069,
+0x00000067,0x0000004d,0x0000005f,0x00000081,
+0x0004001c,0x00000197,0x00000048,0x00000194,
+0x0007002c,0x00000048,0x00000198,0x00000052,
+0x00000054,0x0000005f,0x00000061,0x0004002b,
+0x00000006,0x00000199,0x00000011,0x0004002b,
+0x00000006,0x0000019a,0xffffffef,0x0007002c,
+0x00000048,0x0000019b,0x00000053,0x00000199,
+0x00000060,0x0000019a,0x0004002b,0x00000006,
+0x0000019c,0x0000001d,0x0004002b,0x00000006,
+0x0000019d,0xffffffe3,0x0007002c,0x00000048,
+0x0000019e,0x0000005c,0x0000019c,0x0000004f,
+0x0000019d,0x0004002b,0x00000006,0x0000019f,
+0x0000002a,0x0004002b,0x00000006,0x000001a0,
+0xffffffd6,0x0007002c,0x00000048,0x000001a1,
+0x0000009d,0x0000019f,0x00000059,0x000001a0,
+0x0004002b,0x00000006,0x000001a2,0x0000003c,
+0x0004002b,0x00000006,0x000001a3,0xffffffee,
+0x0004002b,0x00000006,0x000001a4,0xffffffc4,
+0x0007002c,0x00000048,0x000001a5,0x000000b6,
+0x000001a2,0x000001a3,0x000001a4,0x0004002b,
+0x00000006,0x000001a6,0x00000050,0x0004002b,
+0x00000006,0x000001a7,0xffffffe8,0x0004002b,
+0x00000006,0x000001a8,0xffffffb0,0x0007002c,
+0x00000048,0x000001a9,0x00000026,0x000001a6,
+0x000001a7,0x000001a8,0x0004002b,0x00000006,
+0x000001aa,0x00000021,0x0004002b,0x00000006,
+0x000001ab,0x0000006a,0x0004002b,0x00000006,
+0x000001ac,0xffffffdf,0x0004002b,0x00000006,
+0x000001ad,0xffffff96,0x0007002c,0x00000048,
+0x000001ae,0x000001aa,0x000001ab,0x000001ac,
+0x000001ad,0x0004002b,0x00000006,0x000001af,
+0x0000002f,0x0004002b,0x00000006,0x000001b0,
+0x000000b7,0x0004002b,0x00000006,0x000001b1,
+0xffffffd1,0x0004002b,0x00000006,0x000001b2,
+0xffffff49,0x0007002c,0x00000048,0x000001b3,
+0x000001af,0x000001b0,0x000001b1,0x000001b2,
+0x000b002c,0x00000197,0x000001b4,0x00000198,
+0x0000019b,0x0000019e,0x000001a1,0x000001a5,
+0x000001a9,0x000001ae,0x000001b3,0x0007002c,
+0x00000048,0x000001b5,0x00000083,0x00000054,
+0x00000083,0x00000061,0x0007002c,0x00000048,
+0x000001b6,0x00000083,0x00000199,0x00000083,
+0x0000019a,0x0007002c,0x00000048,0x000001b7,
+0x00000083,0x0000019c,0x00000083,0x0000019d,
+0x0007002c,0x00000048,0x000001b8,0x00000083,
+0x0000019f,0x00000083,0x000001a0,0x0007002c,
+0x00000048,0x000001b9,0x00000083,0x000001a2,
+0x00000083,0x000001a4,0x0007002c,0x00000048,
+0x000001ba,0x00000083,0x000001a6,0x00000083,
+0x000001a8,0x0007002c,0x00000048,0x000001bb,
+0x00000083,0x000001ab,0x00000083,0x000001ad,
+0x0007002c,0x00000048,0x000001bc,0x00000083,
+0x000001b0,0x00000083,0x000001b2,0x000b002c,
+0x00000197,0x000001bd,0x000001b5,0x000001b6,
+0x000001b7,0x000001b8,0x000001b9,0x000001ba,
+0x000001bb,0x000001bc,0x0006002c,0x00000130,
+0x000001be,0x00000194,0x00000194,0x00000094,
+0x00050036,0x00000002,0x00000004,0x00000000,
+0x00000003,0x000200f8,0x00000005,0x0004003b,
+0x00000008,0x0000012f,0x00000007,0x0004003b,
+0x00000141,0x00000142,0x00000007,0x0004003b,
+0x00000008,0x00000147,0x00000007,0x0004003b,
+0x00000100,0x0000014b,0x00000007,0x0004003b,
+0x0000000f,0x0000014c,0x00000007,0x0004003b,
+0x0000000f,0x00000150,0x00000007,0x0004003b,
+0x0000000f,0x00000155,0x00000007,0x0004003b,
+0x0000000f,0x00000156,0x00000007,0x0004003b,
+0x00000011,0x00000157,0x00000007,0x0004003b,
+0x00000023,0x00000159,0x00000007,0x0004003b,
+0x00000023,0x00000161,0x00000007,0x0004003b,
+0x00000008,0x0000017a,0x00000007,0x0004003d,
+0x00000130,0x00000133,0x00000132,0x0004007c,
+0x00000007,0x00000134,0x00000133,0x0003003e,
+0x0000012f,0x00000134,0x00050041,0x00000138,
+0x00000139,0x00000137,0x00000063,0x0004003d,
+0x0000000e,0x0000013a,0x00000139,0x0004007c,
+0x00000006,0x0000013b,0x0000013a,0x00050041,
+0x00000023,0x0000013c,0x0000012f,0x0000008b,
+0x0004003d,0x00000006,0x0000013d,0x0000013c,
+0x00050080,0x00000006,0x0000013e,0x0000013d,
+0x0000013b,0x00050041,0x00000023,0x0000013f,
+0x0000012f,0x0000008b,0x0003003e,0x0000013f,
+0x0000013e,0x0004003d,0x00000143,0x00000146,
+0x00000145,0x0004003d,0x00000007,0x00000148,
+0x0000012f,0x0003003e,0x00000147,0x00000148,
+0x00050039,0x00000009,0x00000149,0x0000000c,
+0x00000147,0x00050062,0x00000140,0x0000014a,
+0x00000146,0x00000149,0x0003003e,0x00000142,
+0x0000014a,0x00050041,0x0000000f,0x0000014d,
+0x00000142,0x000000c5,0x0004003d,0x0000000e,
+0x0000014e,0x0000014d,0x0003003e,0x0000014c,
+0x0000014e,0x00050039,0x0000000e,0x0000014f,
+0x0000001d,0x0000014c,0x00050041,0x0000000f,
+0x00000151,0x00000142,0x00000094,0x0004003d,
+0x0000000e,0x00000152,0x00000151,0x0003003e,
+0x00000150,0x00000152,0x00050039,0x0000000e,
+0x00000153,0x0000001d,0x00000150,0x0003003e,
+0x00000155,0x0000014f,0x0003003e,0x00000156,
+0x00000153,0x0003003e,0x00000157,0x00000154,
+0x00070039,0x00000014,0x00000158,0x00000019,
+0x00000155,0x00000156,0x00000157,0x0003003e,
+0x0000014b,0x00000158,0x0003003e,0x00000159,
+0x00000083,0x000200f9,0x0000015a,0x000200f8,
+0x0000015a,0x000400f6,0x0000015c,0x0000015d,
+0x00000000,0x000200f9,0x0000015e,0x000200f8,
+0x0000015e,0x0004003d,0x00000006,0x0000015f,
+0x00000159,0x000500b1,0x00000010,0x00000160,
+0x0000015f,0x00000063,0x000400fa,0x00000160,
+0x0000015b,0x0000015c,0x000200f8,0x0000015b,
+0x0003003e,0x00000161,0x00000083,0x000200f9,
+0x00000162,0x000200f8,0x00000162,0x000400f6,
+0x00000164,0x00000165,0x00000000,0x000200f9,
+0x00000166,0x000200f8,0x00000166,0x0004003d,
+0x00000006,0x00000167,0x00000161,0x000500b1,
+0x00000010,0x00000168,0x00000167,0x00000064,
+0x000400fa,0x00000168,0x00000163,0x00000164,
+0x000200f8,0x00000163,0x0004003d,0x00000169,
+0x0000016c,0x0000016b,0x0004003d,0x00000007,
+0x0000016d,0x0000012f,0x0007004f,0x00000009,
+0x0000016e,0x0000016d,0x0000016d,0x00000000,
+0x00000001,0x00050050,0x00000009,0x0000016f,
+0x00000064,0x00000064,0x00050084,0x00000009,
+0x00000170,0x0000016e,0x0000016f,0x0004003d,
+0x00000006,0x00000171,0x00000161,0x0004003d,
+0x00000006,0x00000172,0x00000159,0x00050050,
+0x00000009,0x00000173,0x00000171,0x00000172,
+0x00050080,0x00000009,0x00000174,0x00000170,
+0x00000173,0x00050041,0x00000023,0x00000175,
+0x0000012f,0x0000008b,0x0004003d,0x00000006,
+0x00000176,0x00000175,0x00050051,0x00000006,
+0x00000177,0x00000174,0x00000000,0x00050051,
+0x00000006,0x00000178,0x00000174,0x00000001,
+0x00060050,0x00000007,0x00000179,0x00000177,
+0x00000178,0x00000176,0x0003003e,0x0000017a,
+0x00000179,0x00050039,0x00000009,0x0000017b,
+0x0000000c,0x0000017a,0x0004003d,0x00000006,
+0x0000017c,0x00000159,0x00050084,0x00000006,
+0x0000017d,0x0000017c,0x00000064,0x0004003d,
+0x00000006,0x0000017e,0x00000161,0x00050080,
+0x00000006,0x0000017f,0x0000017d,0x0000017e,
+0x00050041,0x00000107,0x00000180,0x0000014b,
+0x0000017f,0x0004003d,0x00000012,0x00000181,
+0x00000180,0x00070050,0x00000184,0x00000185,
+0x00000181,0x00000182,0x00000182,0x00000183,
+0x00040063,0x0000016c,0x0000017b,0x00000185,
+0x000200f9,0x00000165,0x000200f8,0x00000165,
+0x0004003d,0x00000006,0x00000186,0x00000161,
+0x00050080,0x00000006,0x00000187,0x00000186,
+0x00000063,0x0003003e,0x00000161,0x00000187,
+0x000200f9,0x00000162,0x000200f8,0x00000164,
+0x000200f9,0x0000015d,0x000200f8,0x0000015d,
+0x0004003d,0x00000006,0x00000188,0x00000159,
+0x00050080,0x00000006,0x00000189,0x00000188,
+0x00000063,0x0003003e,0x00000159,0x00000189,
+0x000200f9,0x0000015a,0x000200f8,0x0000015c,
+0x000100fd,0x00010038,0x00050036,0x00000009,
+0x0000000c,0x00000000,0x0000000a,0x00030037,
+0x00000008,0x0000000b,0x000200f8,0x0000000d,
+0x0004003d,0x00000007,0x0000001f,0x0000000b,
+0x0007004f,0x00000009,0x00000020,0x0000001f,
+0x0000001f,0x00000000,0x00000002,0x000200fe,
+0x00000020,0x00010038,0x00050036,0x00000014,
+0x00000019,0x00000000,0x00000015,0x00030037,
+0x0000000f,0x00000016,0x00030037,0x0000000f,
+0x00000017,0x00030037,0x00000011,0x00000018,
+0x000200f8,0x0000001a,0x0004003b,0x00000023,
+0x00000024,0x00000007,0x0004003b,0x00000023,
+0x0000003a,0x00000007,0x0004003b,0x0000000f,
+0x00000042,0x00000007,0x0004003b,0x00000049,
+0x0000004a,0x00000007,0x0004003b,0x0000008d,
+0x0000008e,0x00000007,0x0004003b,0x00000049,
+0x00000091,0x00000007,0x0004003b,0x0000008d,
+0x00000096,0x00000007,0x0004003b,0x0000009a,
+0x0000009b,0x00000007,0x0004003b,0x0000000f,
+0x000000c4,0x00000007,0x0004003b,0x0000000f,
+0x000000cd,0x00000007,0x0004003b,0x0000000f,
+0x000000d5,0x00000007,0x0004003b,0x00000023,
+0x000000db,0x00000007,0x0004003b,0x00000023,
+0x000000de,0x00000007,0x0004003b,0x00000023,
+0x000000ea,0x00000007,0x0004003b,0x00000100,
+0x00000101,0x00000007,0x0004003d,0x0000000e,
+0x00000025,0x00000016,0x000500c2,0x0000000e,
+0x00000027,0x00000025,0x00000026,0x0004007c,
+0x00000006,0x00000028,0x00000027,0x0003003e,
+0x00000024,0x00000028,0x0004003d,0x00000010,
+0x00000029,0x00000018,0x000300f7,0x0000002b,
+0x00000000,0x000400fa,0x00000029,0x0000002a,
+0x0000002b,0x000200f8,0x0000002a,0x0004003d,
+0x00000006,0x0000002c,0x00000024,0x000500af,
+0x00000010,0x0000002e,0x0000002c,0x0000002d,
+0x000300f7,0x00000030,0x00000000,0x000400fa,
+0x0000002e,0x0000002f,0x00000030,0x000200f8,
+0x0000002f,0x0004003d,0x00000006,0x00000032,
+0x00000024,0x00050082,0x00000006,0x00000033,
+0x00000032,0x00000031,0x0003003e,0x00000024,
+0x00000033,0x000200f9,0x00000030,0x000200f8,
+0x00000030,0x0004003d,0x00000006,0x00000034,
+0x00000024,0x000500aa,0x00000010,0x00000036,
+0x00000034,0x00000035,0x000300f7,0x00000038,
+0x00000000,0x000400fa,0x00000036,0x00000037,
+0x00000038,0x000200f8,0x00000037,0x0003003e,
+0x00000024,0x00000039,0x000200f9,0x00000038,
+0x000200f8,0x00000038,0x000200f9,0x0000002b,
+0x000200f8,0x0000002b,0x0004003d,0x0000000e,
+0x0000003b,0x00000016,0x000500c2,0x0000000e,
+0x0000003d,0x0000003b,0x0000003c,0x0004007c,
+0x00000006,0x0000003e,0x0000003d,0x0003003e,
+0x0000003a,0x0000003e,0x0004003d,0x00000006,
+0x00000040,0x0000003a,0x000500c7,0x00000006,
+0x00000041,0x00000040,0x0000003f,0x0003003e,
+0x0000003a,0x00000041,0x0004003d,0x0000000e,
+0x00000043,0x00000016,0x000500c2,0x0000000e,
+0x00000045,0x00000043,0x00000044,0x000500c7,
+0x0000000e,0x00000047,0x00000045,0x00000046,
+0x0003003e,0x00000042,0x00000047,0x0004003d,
+0x0000000e,0x0000008a,0x00000042,0x00050084,
+0x0000000e,0x0000008c,0x0000008a,0x0000008b,
+0x0003003e,0x0000008e,0x00000089,0x00050041,
+0x00000049,0x0000008f,0x0000008e,0x0000008c,
+0x0004003d,0x00000048,0x00000090,0x0000008f,
+0x0003003e,0x0000004a,0x00000090,0x0004003d,
+0x0000000e,0x00000092,0x00000042,0x00050084,
+0x0000000e,0x00000093,0x00000092,0x0000008b,
+0x00050080,0x0000000e,0x00000095,0x00000093,
+0x00000094,0x0003003e,0x00000096,0x00000089,
+0x00050041,0x00000049,0x00000097,0x00000096,
+0x00000095,0x0004003d,0x00000048,0x00000098,
+0x00000097,0x0003003e,0x00000091,0x00000098,
+0x0004003d,0x0000000e,0x0000009c,0x00000016,
+0x000500c2,0x0000000e,0x0000009e,0x0000009c,
+0x0000009d,0x0004003d,0x0000000e,0x0000009f,
+0x00000016,0x000500c2,0x0000000e,0x000000a0,
+0x0000009f,0x00000071,0x0004003d,0x0000000e,
+0x000000a1,0x00000016,0x000500c2,0x0000000e,
+0x000000a2,0x000000a1,0x00000065,0x0004003d,
+0x0000000e,0x000000a3,0x00000016,0x000500c2,
+0x0000000e,0x000000a4,0x000000a3,0x00000064,
+0x0004003d,0x0000000e,0x000000a5,0x00000016,
+0x000500c2,0x0000000e,0x000000a6,0x000000a5,
+0x00000063,0x0004003d,0x0000000e,0x000000a7,
+0x00000016,0x000500c4,0x0000000e,0x000000a8,
+0x000000a7,0x00000052,0x0004003d,0x0000000e,
+0x000000a9,0x00000017,0x000500c2,0x0000000e,
+0x000000ab,0x000000a9,0x000000aa,0x000500c5,
+0x0000000e,0x000000ac,0x000000a8,0x000000ab,
+0x0004003d,0x0000000e,0x000000ad,0x00000017,
+0x000500c2,0x0000000e,0x000000af,0x000000ad,
+0x000000ae,0x0004003d,0x0000000e,0x000000b0,
+0x00000017,0x000500c2,0x0000000e,0x000000b1,
+0x000000b0,0x00000026,0x0004003d,0x0000000e,
+0x000000b2,0x00000017,0x000500c2,0x0000000e,
+0x000000b4,0x000000b2,0x000000b3,0x0004003d,
+0x0000000e,0x000000b5,0x00000017,0x000500c2,
+0x0000000e,0x000000b7,0x000000b5,0x000000b6,
+0x0004003d,0x0000000e,0x000000b8,0x00000017,
+0x000500c2,0x0000000e,0x000000b9,0x000000b8,
+0x0000003f,0x0004003d,0x0000000e,0x000000ba,
+0x00000017,0x000500c2,0x0000000e,0x000000bb,
+0x000000ba,0x0000005d,0x0004003d,0x0000000e,
+0x000000bc,0x00000017,0x000500c2,0x0000000e,
+0x000000bd,0x000000bc,0x0000005c,0x0004003d,
+0x0000000e,0x000000be,0x00000017,0x000500c2,
+0x0000000e,0x000000bf,0x000000be,0x0000005b,
+0x0004003d,0x0000000e,0x000000c0,0x00000017,
+0x000500c2,0x0000000e,0x000000c1,0x000000c0,
+0x00000069,0x0004003d,0x0000000e,0x000000c2,
+0x00000017,0x00130050,0x00000099,0x000000c3,
+0x0000009e,0x000000a0,0x000000a2,0x000000a4,
+0x000000a6,0x000000ac,0x000000af,0x000000b1,
+0x000000b4,0x000000b7,0x000000b9,0x000000bb,
+0x000000bd,0x000000bf,0x000000c1,0x000000c2,
+0x0003003e,0x0000009b,0x000000c3,0x0003003e,
+0x000000c4,0x000000c5,0x000200f9,0x000000c6,
+0x000200f8,0x000000c6,0x000400f6,0x000000c8,
+0x000000c9,0x00000000,0x000200f9,0x000000ca,
+0x000200f8,0x000000ca,0x0004003d,0x0000000e,
+0x000000cb,0x000000c4,0x000500b0,0x00000010,
+0x000000cc,0x000000cb,0x00000013,0x000400fa,
+0x000000cc,0x000000c7,0x000000c8,0x000200f8,
+0x000000c7,0x0004003d,0x0000000e,0x000000ce,
+0x000000c4,0x00050089,0x0000000e,0x000000d0,
+0x000000ce,0x000000cf,0x00050084,0x0000000e,
+0x000000d1,0x000000d0,0x000000cf,0x0004003d,
+0x0000000e,0x000000d2,0x000000c4,0x00050086,
+0x0000000e,0x000000d3,0x000000d2,0x000000cf,
+0x00050080,0x0000000e,0x000000d4,0x000000d1,
+0x000000d3,0x0003003e,0x000000cd,0x000000d4,
+0x0004003d,0x0000000e,0x000000d6,0x000000c4,
+0x00050041,0x0000000f,0x000000d7,0x0000009b,
+0x000000d6,0x0004003d,0x0000000e,0x000000d8,
+0x000000d7,0x000500c7,0x0000000e,0x000000da,
+0x000000d8,0x000000d9,0x0003003e,0x000000d5,
+0x000000da,0x0004003d,0x0000000e,0x000000dc,
+0x000000d5,0x000500ae,0x00000010,0x000000dd,
+0x000000dc,0x000000cf,0x000300f7,0x000000e0,
+0x00000000,0x000400fa,0x000000dd,0x000000df,
+0x000000e5,0x000200f8,0x000000df,0x0004003d,
+0x0000000e,0x000000e1,0x000000d5,0x00050082,
+0x0000000e,0x000000e2,0x000000e1,0x000000cf,
+0x00050041,0x00000023,0x000000e3,0x00000091,
+0x000000e2,0x0004003d,0x00000006,0x000000e4,
+0x000000e3,0x0003003e,0x000000de,0x000000e4,
+0x000200f9,0x000000e0,0x000200f8,0x000000e5,
+0x0004003d,0x0000000e,0x000000e6,0x000000d5,
+0x00050041,0x00000023,0x000000e7,0x0000004a,
+0x000000e6,0x0004003d,0x00000006,0x000000e8,
+0x000000e7,0x0003003e,0x000000de,0x000000e8,
+0x000200f9,0x000000e0,0x000200f8,0x000000e0,
+0x0004003d,0x00000006,0x000000e9,0x000000de,
+0x0003003e,0x000000db,0x000000e9,0x0004003d,
+0x00000006,0x000000eb,0x00000024,0x0004003d,
+0x00000006,0x000000ec,0x000000db,0x0004003d,
+0x00000006,0x000000ed,0x0000003a,0x00050084,
+0x00000006,0x000000ee,0x000000ec,0x000000ed,
+0x00050080,0x00000006,0x000000ef,0x000000eb,
+0x000000ee,0x0003003e,0x000000ea,0x000000ef,
+0x0004003d,0x00000006,0x000000f0,0x000000ea,
+0x00050084,0x00000006,0x000000f1,0x000000f0,
+0x00000054,0x0003003e,0x000000ea,0x000000f1,
+0x0004003d,0x00000006,0x000000f2,0x0000003a,
+0x000500aa,0x00000010,0x000000f3,0x000000f2,
+0x00000083,0x000300f7,0x000000f5,0x00000000,
+0x000400fa,0x000000f3,0x000000f4,0x000000f5,
+0x000200f8,0x000000f4,0x0004003d,0x00000006,
+0x000000f6,0x000000db,0x0004003d,0x00000006,
+0x000000f7,0x000000ea,0x00050080,0x00000006,
+0x000000f8,0x000000f7,0x000000f6,0x0003003e,
+0x000000ea,0x000000f8,0x000200f9,0x000000f5,
+0x000200f8,0x000000f5,0x0004003d,0x00000010,
+0x000000f9,0x00000018,0x000300f7,0x000000fb,
+0x00000000,0x000400fa,0x000000f9,0x000000fa,
+0x00000109,0x000200f8,0x000000fa,0x0004003d,
+0x00000006,0x000000fc,0x000000ea,0x0008000c,
+0x00000006,0x000000ff,0x00000001,0x0000002d,
+0x000000fc,0x000000fd,0x000000fe,0x0003003e,
+0x000000ea,0x000000ff,0x0004003d,0x0000000e,
+0x00000102,0x000000cd,0x0004003d,0x00000006,
+0x00000103,0x000000ea,0x0004006f,0x00000012,
+0x00000104,0x00000103,0x00050088,0x00000012,
+0x00000106,0x00000104,0x00000105,0x00050041,
+0x00000107,0x00000108,0x00000101,0x00000102,
+0x0003003e,0x00000108,0x00000106,0x000200f9,
+0x000000fb,0x000200f8,0x00000109,0x0004003d,
+0x00000006,0x0000010a,0x000000ea,0x00050080,
+0x00000006,0x0000010b,0x0000010a,0x00000064,
+0x0003003e,0x000000ea,0x0000010b,0x0004003d,
+0x00000006,0x0000010c,0x000000ea,0x0008000c,
+0x00000006,0x0000010e,0x00000001,0x0000002d,
+0x0000010c,0x00000083,0x0000010d,0x0003003e,
+0x000000ea,0x0000010e,0x0004003d,0x0000000e,
+0x0000010f,0x000000cd,0x0004003d,0x00000006,
+0x00000110,0x000000ea,0x0004006f,0x00000012,
+0x00000111,0x00000110,0x00050088,0x00000012,
+0x00000113,0x00000111,0x00000112,0x00050041,
+0x00000107,0x00000114,0x00000101,0x0000010f,
+0x0003003e,0x00000114,0x00000113,0x000200f9,
+0x000000fb,0x000200f8,0x000000fb,0x000200f9,
+0x000000c9,0x000200f8,0x000000c9,0x0004003d,
+0x0000000e,0x00000115,0x000000c4,0x00050080,
+0x0000000e,0x00000116,0x00000115,0x00000063,
+0x0003003e,0x000000c4,0x00000116,0x000200f9,
+0x000000c6,0x000200f8,0x000000c8,0x0004003d,
+0x00000014,0x00000117,0x00000101,0x000200fe,
+0x00000117,0x00010038,0x00050036,0x0000000e,
+0x0000001d,0x00000000,0x0000001b,0x00030037,
+0x0000000f,0x0000001c,0x000200f8,0x0000001e,
+0x0004003d,0x0000000e,0x0000011a,0x0000001c,
+0x000500c7,0x0000000e,0x0000011c,0x0000011a,
+0x0000011b,0x000500c4,0x0000000e,0x0000011d,
+0x0000011c,0x00000026,0x0004003d,0x0000000e,
+0x0000011e,0x0000001c,0x000500c7,0x0000000e,
+0x00000120,0x0000011e,0x0000011f,0x000500c4,
+0x0000000e,0x00000121,0x00000120,0x00000054,
+0x000500c5,0x0000000e,0x00000122,0x0000011d,
+0x00000121,0x0004003d,0x0000000e,0x00000123,
+0x0000001c,0x000500c7,0x0000000e,0x00000125,
+0x00000123,0x00000124,0x000500c2,0x0000000e,
+0x00000126,0x00000125,0x00000054,0x000500c5,
+0x0000000e,0x00000127,0x00000122,0x00000126,
+0x0004003d,0x0000000e,0x00000128,0x0000001c,
+0x000500c7,0x0000000e,0x0000012a,0x00000128,
+0x00000129,0x000500c2,0x0000000e,0x0000012b,
+0x0000012a,0x00000026,0x000500c5,0x0000000e,
+0x0000012c,0x00000127,0x0000012b,0x000200fe,
+0x0000012c,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_2D.inl
new file mode 100644
index 00000000000..054c112ad22
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_2D.inl
@@ -0,0 +1,638 @@
+0x07230203,0x00010300,0x000d000a,0x000001be,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x00000031,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000130,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00070005,
+0x0000000b,0x50746567,0x4432736f,0x61727241,
+0x69762879,0x00003b33,0x00030005,0x0000000a,
+0x00736f70,0x000e0005,0x00000018,0x5f636165,
+0x6f636564,0x735f6564,0x6c676e69,0x68635f65,
+0x656e6e61,0x6c625f6c,0x5f6b636f,0x616f6c66,
+0x31752874,0x3b31753b,0x003b3162,0x00040005,
+0x00000015,0x68676968,0x00000000,0x00030005,
+0x00000016,0x00776f6c,0x00050005,0x00000017,
+0x69537369,0x64656e67,0x00000000,0x00050005,
+0x0000001c,0x70696c66,0x75283233,0x00003b31,
+0x00030005,0x0000001b,0x00000061,0x00060005,
+0x00000022,0x65736162,0x646f635f,0x726f7765,
+0x00000064,0x00050005,0x00000038,0x746c756d,
+0x696c7069,0x00007265,0x00040005,0x00000040,
+0x496c6274,0x00007864,0x00040005,0x00000048,
+0x6c626174,0x00003065,0x00050005,0x0000008c,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x0000008f,0x6c626174,0x00003165,0x00050005,
+0x00000094,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x00000099,0x00000070,0x00030005,
+0x000000c2,0x00000069,0x00040005,0x000000cb,
+0x4974756f,0x00007864,0x00050005,0x000000d3,
+0x69646f6d,0x72656966,0x00000000,0x00060005,
+0x000000d9,0x69646f6d,0x72656966,0x756c6156,
+0x00000065,0x00040005,0x000000e8,0x6f636564,
+0x00646564,0x00040005,0x000000ff,0x75736572,
+0x0000746c,0x00030005,0x0000012d,0x00736f70,
+0x00080005,0x00000130,0x475f6c67,0x61626f6c,
+0x766e496c,0x7461636f,0x496e6f69,0x00000044,
+0x00070005,0x00000133,0x67616d49,0x726f4665,
+0x4274616d,0x6b636f6c,0x00000000,0x00060006,
+0x00000133,0x00000000,0x706d6f63,0x6d726f46,
+0x00007461,0x00060006,0x00000133,0x00000001,
+0x65736162,0x6579614c,0x00000072,0x00060005,
+0x00000135,0x75705f75,0x6f436873,0x6174736e,
+0x0000746e,0x00050005,0x00000140,0x42637273,
+0x6b636f6c,0x00000000,0x00050005,0x00000143,
+0x6d695f75,0x30656761,0x00000000,0x00040005,
+0x00000145,0x61726170,0x0000006d,0x00060005,
+0x00000149,0x6f636564,0x6572706d,0x64657373,
+0x00000000,0x00040005,0x0000014a,0x61726170,
+0x0000006d,0x00040005,0x0000014e,0x61726170,
+0x0000006d,0x00040005,0x00000153,0x61726170,
+0x0000006d,0x00040005,0x00000154,0x61726170,
+0x0000006d,0x00040005,0x00000155,0x61726170,
+0x0000006d,0x00030005,0x00000157,0x00000079,
+0x00030005,0x0000015f,0x00000078,0x00050005,
+0x00000169,0x6d695f75,0x31656761,0x00000000,
+0x00040005,0x00000179,0x61726170,0x0000006d,
+0x00040047,0x00000130,0x0000000b,0x0000001c,
+0x00050048,0x00000133,0x00000000,0x00000023,
+0x00000000,0x00050048,0x00000133,0x00000001,
+0x00000023,0x00000004,0x00030047,0x00000133,
+0x00000002,0x00040047,0x00000143,0x00000022,
+0x00000000,0x00040047,0x00000143,0x00000021,
+0x00000000,0x00030047,0x00000143,0x00000018,
+0x00040047,0x00000169,0x00000022,0x00000000,
+0x00040047,0x00000169,0x00000021,0x00000001,
+0x00030047,0x00000169,0x00000019,0x00040047,
+0x000001bd,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000001,
+0x00040017,0x00000007,0x00000006,0x00000003,
+0x00040020,0x00000008,0x00000007,0x00000007,
+0x00040021,0x00000009,0x00000007,0x00000008,
+0x00040015,0x0000000d,0x00000020,0x00000000,
+0x00040020,0x0000000e,0x00000007,0x0000000d,
+0x00020014,0x0000000f,0x00040020,0x00000010,
+0x00000007,0x0000000f,0x00030016,0x00000011,
+0x00000020,0x0004002b,0x0000000d,0x00000012,
+0x00000010,0x0004001c,0x00000013,0x00000011,
+0x00000012,0x00060021,0x00000014,0x00000013,
+0x0000000e,0x0000000e,0x00000010,0x00040021,
+0x0000001a,0x0000000d,0x0000000e,0x00040020,
+0x00000021,0x00000007,0x00000006,0x0004002b,
+0x00000006,0x00000024,0x00000018,0x0004002b,
+0x00000006,0x0000002b,0x00000080,0x0004002b,
+0x00000006,0x0000002f,0x00000100,0x0004002b,
+0x00000006,0x00000033,0xffffff80,0x0004002b,
+0x00000006,0x00000037,0xffffff81,0x0004002b,
+0x00000006,0x0000003a,0x00000014,0x0004002b,
+0x00000006,0x0000003d,0x0000000f,0x0004002b,
+0x00000006,0x00000042,0x00000010,0x0004002b,
+0x0000000d,0x00000044,0x0000000f,0x00040017,
+0x00000046,0x00000006,0x00000004,0x00040020,
+0x00000047,0x00000007,0x00000046,0x0004002b,
+0x0000000d,0x00000049,0x00000020,0x0004001c,
+0x0000004a,0x00000046,0x00000049,0x0004002b,
+0x00000006,0x0000004b,0xfffffffd,0x0004002b,
+0x00000006,0x0000004c,0xfffffffa,0x0004002b,
+0x00000006,0x0000004d,0xfffffff7,0x0004002b,
+0x00000006,0x0000004e,0xfffffff1,0x0007002c,
+0x00000046,0x0000004f,0x0000004b,0x0000004c,
+0x0000004d,0x0000004e,0x0004002b,0x00000006,
+0x00000050,0x00000002,0x0004002b,0x00000006,
+0x00000051,0x00000005,0x0004002b,0x00000006,
+0x00000052,0x00000008,0x0004002b,0x00000006,
+0x00000053,0x0000000e,0x0007002c,0x00000046,
+0x00000054,0x00000050,0x00000051,0x00000052,
+0x00000053,0x0004002b,0x00000006,0x00000055,
+0xfffffff9,0x0004002b,0x00000006,0x00000056,
+0xfffffff6,0x0004002b,0x00000006,0x00000057,
+0xfffffff3,0x0007002c,0x00000046,0x00000058,
+0x0000004b,0x00000055,0x00000056,0x00000057,
+0x0004002b,0x00000006,0x00000059,0x00000006,
+0x0004002b,0x00000006,0x0000005a,0x00000009,
+0x0004002b,0x00000006,0x0000005b,0x0000000c,
+0x0007002c,0x00000046,0x0000005c,0x00000050,
+0x00000059,0x0000005a,0x0000005b,0x0004002b,
+0x00000006,0x0000005d,0xfffffffe,0x0004002b,
+0x00000006,0x0000005e,0xfffffffb,0x0004002b,
+0x00000006,0x0000005f,0xfffffff8,0x0007002c,
+0x00000046,0x00000060,0x0000005d,0x0000005e,
+0x0000005f,0x00000057,0x0004002b,0x00000006,
+0x00000061,0x00000001,0x0004002b,0x00000006,
+0x00000062,0x00000004,0x0004002b,0x00000006,
+0x00000063,0x00000007,0x0007002c,0x00000046,
+0x00000064,0x00000061,0x00000062,0x00000063,
+0x0000005b,0x0004002b,0x00000006,0x00000065,
+0xfffffffc,0x0007002c,0x00000046,0x00000066,
+0x0000005d,0x00000065,0x0000004c,0x00000057,
+0x0004002b,0x00000006,0x00000067,0x00000003,
+0x0007002c,0x00000046,0x00000068,0x00000061,
+0x00000067,0x00000051,0x0000005b,0x0004002b,
+0x00000006,0x00000069,0xfffffff4,0x0007002c,
+0x00000046,0x0000006a,0x0000004b,0x0000004c,
+0x0000005f,0x00000069,0x0004002b,0x00000006,
+0x0000006b,0x0000000b,0x0007002c,0x00000046,
+0x0000006c,0x00000050,0x00000051,0x00000063,
+0x0000006b,0x0004002b,0x00000006,0x0000006d,
+0xfffffff5,0x0007002c,0x00000046,0x0000006e,
+0x0000004b,0x00000055,0x0000004d,0x0000006d,
+0x0004002b,0x00000006,0x0000006f,0x0000000a,
+0x0007002c,0x00000046,0x00000070,0x00000050,
+0x00000059,0x00000052,0x0000006f,0x0007002c,
+0x00000046,0x00000071,0x00000065,0x00000055,
+0x0000005f,0x0000006d,0x0007002c,0x00000046,
+0x00000072,0x00000067,0x00000059,0x00000063,
+0x0000006f,0x0007002c,0x00000046,0x00000073,
+0x0000004b,0x0000005e,0x0000005f,0x0000006d,
+0x0007002c,0x00000046,0x00000074,0x00000050,
+0x00000062,0x00000063,0x0000006f,0x0007002c,
+0x00000046,0x00000075,0x0000005d,0x0000004c,
+0x0000005f,0x00000056,0x0007002c,0x00000046,
+0x00000076,0x00000061,0x00000051,0x00000063,
+0x0000005a,0x0007002c,0x00000046,0x00000077,
+0x0000005d,0x0000005e,0x0000005f,0x00000056,
+0x0007002c,0x00000046,0x00000078,0x00000061,
+0x00000062,0x00000063,0x0000005a,0x0007002c,
+0x00000046,0x00000079,0x0000005d,0x00000065,
+0x0000005f,0x00000056,0x0007002c,0x00000046,
+0x0000007a,0x00000061,0x00000067,0x00000063,
+0x0000005a,0x0007002c,0x00000046,0x0000007b,
+0x0000005d,0x0000005e,0x00000055,0x00000056,
+0x0007002c,0x00000046,0x0000007c,0x00000061,
+0x00000062,0x00000059,0x0000005a,0x0007002c,
+0x00000046,0x0000007d,0x0000004b,0x00000065,
+0x00000055,0x00000056,0x0007002c,0x00000046,
+0x0000007e,0x00000050,0x00000067,0x00000059,
+0x0000005a,0x0004002b,0x00000006,0x0000007f,
+0xffffffff,0x0007002c,0x00000046,0x00000080,
+0x0000007f,0x0000005d,0x0000004b,0x00000056,
+0x0004002b,0x00000006,0x00000081,0x00000000,
+0x0007002c,0x00000046,0x00000082,0x00000081,
+0x00000061,0x00000050,0x0000005a,0x0007002c,
+0x00000046,0x00000083,0x00000065,0x0000004c,
+0x0000005f,0x0000004d,0x0007002c,0x00000046,
+0x00000084,0x00000067,0x00000051,0x00000063,
+0x00000052,0x0007002c,0x00000046,0x00000085,
+0x0000004b,0x0000005e,0x00000055,0x0000004d,
+0x0007002c,0x00000046,0x00000086,0x00000050,
+0x00000062,0x00000059,0x00000052,0x0023002c,
+0x0000004a,0x00000087,0x0000004f,0x00000054,
+0x00000058,0x0000005c,0x00000060,0x00000064,
+0x00000066,0x00000068,0x0000006a,0x0000006c,
+0x0000006e,0x00000070,0x00000071,0x00000072,
+0x00000073,0x00000074,0x00000075,0x00000076,
+0x00000077,0x00000078,0x00000079,0x0000007a,
+0x0000007b,0x0000007c,0x0000007d,0x0000007e,
+0x00000080,0x00000082,0x00000083,0x00000084,
+0x00000085,0x00000086,0x0004002b,0x0000000d,
+0x00000089,0x00000002,0x00040020,0x0000008b,
+0x00000007,0x0000004a,0x0004002b,0x0000000d,
+0x00000092,0x00000001,0x0004001c,0x00000097,
+0x0000000d,0x00000012,0x00040020,0x00000098,
+0x00000007,0x00000097,0x0004002b,0x00000006,
+0x0000009b,0x0000000d,0x0004002b,0x00000006,
+0x000000a8,0x0000001e,0x0004002b,0x00000006,
+0x000000ac,0x0000001b,0x0004002b,0x00000006,
+0x000000b1,0x00000015,0x0004002b,0x00000006,
+0x000000b4,0x00000012,0x0004002b,0x0000000d,
+0x000000c3,0x00000000,0x0004002b,0x0000000d,
+0x000000cd,0x00000004,0x0004002b,0x0000000d,
+0x000000d7,0x00000007,0x0004002b,0x00000006,
+0x000000fb,0xfffffc01,0x0004002b,0x00000006,
+0x000000fc,0x000003ff,0x00040020,0x000000fe,
+0x00000007,0x00000013,0x0004002b,0x00000011,
+0x00000103,0x447fc000,0x00040020,0x00000105,
+0x00000007,0x00000011,0x0004002b,0x00000006,
+0x0000010b,0x000007ff,0x0004002b,0x00000011,
+0x00000110,0x44ffe000,0x0004002b,0x0000000d,
+0x00000119,0x000000ff,0x0004002b,0x0000000d,
+0x0000011d,0x0000ff00,0x0004002b,0x0000000d,
+0x00000122,0x00ff0000,0x0004002b,0x0000000d,
+0x00000127,0xff000000,0x00040017,0x0000012e,
+0x0000000d,0x00000003,0x00040020,0x0000012f,
+0x00000001,0x0000012e,0x0004003b,0x0000012f,
+0x00000130,0x00000001,0x0004001e,0x00000133,
+0x0000000d,0x0000000d,0x00040020,0x00000134,
+0x00000009,0x00000133,0x0004003b,0x00000134,
+0x00000135,0x00000009,0x00040020,0x00000136,
+0x00000009,0x0000000d,0x00040017,0x0000013e,
+0x0000000d,0x00000004,0x00040020,0x0000013f,
+0x00000007,0x0000013e,0x00090019,0x00000141,
+0x0000000d,0x00000001,0x00000000,0x00000001,
+0x00000000,0x00000002,0x00000023,0x00040020,
+0x00000142,0x00000000,0x00000141,0x0004003b,
+0x00000142,0x00000143,0x00000000,0x0003002a,
+0x0000000f,0x00000152,0x00090019,0x00000167,
+0x00000011,0x00000001,0x00000000,0x00000001,
+0x00000000,0x00000002,0x0000000e,0x00040020,
+0x00000168,0x00000000,0x00000167,0x0004003b,
+0x00000168,0x00000169,0x00000000,0x00040017,
+0x0000016b,0x00000006,0x00000002,0x0004002b,
+0x00000011,0x00000181,0x00000000,0x0004002b,
+0x00000011,0x00000182,0x3f800000,0x00040017,
+0x00000183,0x00000011,0x00000004,0x0004002b,
+0x0000000d,0x00000189,0x00000093,0x0004002b,
+0x0000000d,0x0000018a,0x00000094,0x0004002b,
+0x0000000d,0x0000018b,0x00000095,0x0004002b,
+0x0000000d,0x0000018c,0x00000096,0x0004002b,
+0x0000000d,0x0000018d,0x00000097,0x0004002b,
+0x0000000d,0x0000018e,0x00000098,0x0004002b,
+0x0000000d,0x0000018f,0x00000099,0x0004002b,
+0x0000000d,0x00000190,0x0000009a,0x0004002b,
+0x0000000d,0x00000191,0x0000009b,0x0004002b,
+0x0000000d,0x00000192,0x0000009c,0x0004002b,
+0x0000000d,0x00000193,0x00000008,0x0004001c,
+0x00000194,0x00000006,0x00000193,0x000b002c,
+0x00000194,0x00000195,0x00000081,0x00000061,
+0x00000050,0x00000067,0x00000065,0x0000004b,
+0x0000005d,0x0000007f,0x0004001c,0x00000196,
+0x00000046,0x00000193,0x0007002c,0x00000046,
+0x00000197,0x00000050,0x00000052,0x0000005d,
+0x0000005f,0x0004002b,0x00000006,0x00000198,
+0x00000011,0x0004002b,0x00000006,0x00000199,
+0xffffffef,0x0007002c,0x00000046,0x0000019a,
+0x00000051,0x00000198,0x0000005e,0x00000199,
+0x0004002b,0x00000006,0x0000019b,0x0000001d,
+0x0004002b,0x00000006,0x0000019c,0xffffffe3,
+0x0007002c,0x00000046,0x0000019d,0x0000005a,
+0x0000019b,0x0000004d,0x0000019c,0x0004002b,
+0x00000006,0x0000019e,0x0000002a,0x0004002b,
+0x00000006,0x0000019f,0xffffffd6,0x0007002c,
+0x00000046,0x000001a0,0x0000009b,0x0000019e,
+0x00000057,0x0000019f,0x0004002b,0x00000006,
+0x000001a1,0x0000003c,0x0004002b,0x00000006,
+0x000001a2,0xffffffee,0x0004002b,0x00000006,
+0x000001a3,0xffffffc4,0x0007002c,0x00000046,
+0x000001a4,0x000000b4,0x000001a1,0x000001a2,
+0x000001a3,0x0004002b,0x00000006,0x000001a5,
+0x00000050,0x0004002b,0x00000006,0x000001a6,
+0xffffffe8,0x0004002b,0x00000006,0x000001a7,
+0xffffffb0,0x0007002c,0x00000046,0x000001a8,
+0x00000024,0x000001a5,0x000001a6,0x000001a7,
+0x0004002b,0x00000006,0x000001a9,0x00000021,
+0x0004002b,0x00000006,0x000001aa,0x0000006a,
+0x0004002b,0x00000006,0x000001ab,0xffffffdf,
+0x0004002b,0x00000006,0x000001ac,0xffffff96,
+0x0007002c,0x00000046,0x000001ad,0x000001a9,
+0x000001aa,0x000001ab,0x000001ac,0x0004002b,
+0x00000006,0x000001ae,0x0000002f,0x0004002b,
+0x00000006,0x000001af,0x000000b7,0x0004002b,
+0x00000006,0x000001b0,0xffffffd1,0x0004002b,
+0x00000006,0x000001b1,0xffffff49,0x0007002c,
+0x00000046,0x000001b2,0x000001ae,0x000001af,
+0x000001b0,0x000001b1,0x000b002c,0x00000196,
+0x000001b3,0x00000197,0x0000019a,0x0000019d,
+0x000001a0,0x000001a4,0x000001a8,0x000001ad,
+0x000001b2,0x0007002c,0x00000046,0x000001b4,
+0x00000081,0x00000052,0x00000081,0x0000005f,
+0x0007002c,0x00000046,0x000001b5,0x00000081,
+0x00000198,0x00000081,0x00000199,0x0007002c,
+0x00000046,0x000001b6,0x00000081,0x0000019b,
+0x00000081,0x0000019c,0x0007002c,0x00000046,
+0x000001b7,0x00000081,0x0000019e,0x00000081,
+0x0000019f,0x0007002c,0x00000046,0x000001b8,
+0x00000081,0x000001a1,0x00000081,0x000001a3,
+0x0007002c,0x00000046,0x000001b9,0x00000081,
+0x000001a5,0x00000081,0x000001a7,0x0007002c,
+0x00000046,0x000001ba,0x00000081,0x000001aa,
+0x00000081,0x000001ac,0x0007002c,0x00000046,
+0x000001bb,0x00000081,0x000001af,0x00000081,
+0x000001b1,0x000b002c,0x00000196,0x000001bc,
+0x000001b4,0x000001b5,0x000001b6,0x000001b7,
+0x000001b8,0x000001b9,0x000001ba,0x000001bb,
+0x0006002c,0x0000012e,0x000001bd,0x00000193,
+0x00000193,0x00000092,0x00050036,0x00000002,
+0x00000004,0x00000000,0x00000003,0x000200f8,
+0x00000005,0x0004003b,0x00000008,0x0000012d,
+0x00000007,0x0004003b,0x0000013f,0x00000140,
+0x00000007,0x0004003b,0x00000008,0x00000145,
+0x00000007,0x0004003b,0x000000fe,0x00000149,
+0x00000007,0x0004003b,0x0000000e,0x0000014a,
+0x00000007,0x0004003b,0x0000000e,0x0000014e,
+0x00000007,0x0004003b,0x0000000e,0x00000153,
+0x00000007,0x0004003b,0x0000000e,0x00000154,
+0x00000007,0x0004003b,0x00000010,0x00000155,
+0x00000007,0x0004003b,0x00000021,0x00000157,
+0x00000007,0x0004003b,0x00000021,0x0000015f,
+0x00000007,0x0004003b,0x00000008,0x00000179,
+0x00000007,0x0004003d,0x0000012e,0x00000131,
+0x00000130,0x0004007c,0x00000007,0x00000132,
+0x00000131,0x0003003e,0x0000012d,0x00000132,
+0x00050041,0x00000136,0x00000137,0x00000135,
+0x00000061,0x0004003d,0x0000000d,0x00000138,
+0x00000137,0x0004007c,0x00000006,0x00000139,
+0x00000138,0x00050041,0x00000021,0x0000013a,
+0x0000012d,0x00000089,0x0004003d,0x00000006,
+0x0000013b,0x0000013a,0x00050080,0x00000006,
+0x0000013c,0x0000013b,0x00000139,0x00050041,
+0x00000021,0x0000013d,0x0000012d,0x00000089,
+0x0003003e,0x0000013d,0x0000013c,0x0004003d,
+0x00000141,0x00000144,0x00000143,0x0004003d,
+0x00000007,0x00000146,0x0000012d,0x0003003e,
+0x00000145,0x00000146,0x00050039,0x00000007,
+0x00000147,0x0000000b,0x00000145,0x00050062,
+0x0000013e,0x00000148,0x00000144,0x00000147,
+0x0003003e,0x00000140,0x00000148,0x00050041,
+0x0000000e,0x0000014b,0x00000140,0x000000c3,
+0x0004003d,0x0000000d,0x0000014c,0x0000014b,
+0x0003003e,0x0000014a,0x0000014c,0x00050039,
+0x0000000d,0x0000014d,0x0000001c,0x0000014a,
+0x00050041,0x0000000e,0x0000014f,0x00000140,
+0x00000092,0x0004003d,0x0000000d,0x00000150,
+0x0000014f,0x0003003e,0x0000014e,0x00000150,
+0x00050039,0x0000000d,0x00000151,0x0000001c,
+0x0000014e,0x0003003e,0x00000153,0x0000014d,
+0x0003003e,0x00000154,0x00000151,0x0003003e,
+0x00000155,0x00000152,0x00070039,0x00000013,
+0x00000156,0x00000018,0x00000153,0x00000154,
+0x00000155,0x0003003e,0x00000149,0x00000156,
+0x0003003e,0x00000157,0x00000081,0x000200f9,
+0x00000158,0x000200f8,0x00000158,0x000400f6,
+0x0000015a,0x0000015b,0x00000000,0x000200f9,
+0x0000015c,0x000200f8,0x0000015c,0x0004003d,
+0x00000006,0x0000015d,0x00000157,0x000500b1,
+0x0000000f,0x0000015e,0x0000015d,0x00000062,
+0x000400fa,0x0000015e,0x00000159,0x0000015a,
+0x000200f8,0x00000159,0x0003003e,0x0000015f,
+0x00000081,0x000200f9,0x00000160,0x000200f8,
+0x00000160,0x000400f6,0x00000162,0x00000163,
+0x00000000,0x000200f9,0x00000164,0x000200f8,
+0x00000164,0x0004003d,0x00000006,0x00000165,
+0x0000015f,0x000500b1,0x0000000f,0x00000166,
+0x00000165,0x00000062,0x000400fa,0x00000166,
+0x00000161,0x00000162,0x000200f8,0x00000161,
+0x0004003d,0x00000167,0x0000016a,0x00000169,
+0x0004003d,0x00000007,0x0000016c,0x0000012d,
+0x0007004f,0x0000016b,0x0000016d,0x0000016c,
+0x0000016c,0x00000000,0x00000001,0x00050050,
+0x0000016b,0x0000016e,0x00000062,0x00000062,
+0x00050084,0x0000016b,0x0000016f,0x0000016d,
+0x0000016e,0x0004003d,0x00000006,0x00000170,
+0x0000015f,0x0004003d,0x00000006,0x00000171,
+0x00000157,0x00050050,0x0000016b,0x00000172,
+0x00000170,0x00000171,0x00050080,0x0000016b,
+0x00000173,0x0000016f,0x00000172,0x00050041,
+0x00000021,0x00000174,0x0000012d,0x00000089,
+0x0004003d,0x00000006,0x00000175,0x00000174,
+0x00050051,0x00000006,0x00000176,0x00000173,
+0x00000000,0x00050051,0x00000006,0x00000177,
+0x00000173,0x00000001,0x00060050,0x00000007,
+0x00000178,0x00000176,0x00000177,0x00000175,
+0x0003003e,0x00000179,0x00000178,0x00050039,
+0x00000007,0x0000017a,0x0000000b,0x00000179,
+0x0004003d,0x00000006,0x0000017b,0x00000157,
+0x00050084,0x00000006,0x0000017c,0x0000017b,
+0x00000062,0x0004003d,0x00000006,0x0000017d,
+0x0000015f,0x00050080,0x00000006,0x0000017e,
+0x0000017c,0x0000017d,0x00050041,0x00000105,
+0x0000017f,0x00000149,0x0000017e,0x0004003d,
+0x00000011,0x00000180,0x0000017f,0x00070050,
+0x00000183,0x00000184,0x00000180,0x00000181,
+0x00000181,0x00000182,0x00040063,0x0000016a,
+0x0000017a,0x00000184,0x000200f9,0x00000163,
+0x000200f8,0x00000163,0x0004003d,0x00000006,
+0x00000185,0x0000015f,0x00050080,0x00000006,
+0x00000186,0x00000185,0x00000061,0x0003003e,
+0x0000015f,0x00000186,0x000200f9,0x00000160,
+0x000200f8,0x00000162,0x000200f9,0x0000015b,
+0x000200f8,0x0000015b,0x0004003d,0x00000006,
+0x00000187,0x00000157,0x00050080,0x00000006,
+0x00000188,0x00000187,0x00000061,0x0003003e,
+0x00000157,0x00000188,0x000200f9,0x00000158,
+0x000200f8,0x0000015a,0x000100fd,0x00010038,
+0x00050036,0x00000007,0x0000000b,0x00000000,
+0x00000009,0x00030037,0x00000008,0x0000000a,
+0x000200f8,0x0000000c,0x0004003d,0x00000007,
+0x0000001e,0x0000000a,0x000200fe,0x0000001e,
+0x00010038,0x00050036,0x00000013,0x00000018,
+0x00000000,0x00000014,0x00030037,0x0000000e,
+0x00000015,0x00030037,0x0000000e,0x00000016,
+0x00030037,0x00000010,0x00000017,0x000200f8,
+0x00000019,0x0004003b,0x00000021,0x00000022,
+0x00000007,0x0004003b,0x00000021,0x00000038,
+0x00000007,0x0004003b,0x0000000e,0x00000040,
+0x00000007,0x0004003b,0x00000047,0x00000048,
+0x00000007,0x0004003b,0x0000008b,0x0000008c,
+0x00000007,0x0004003b,0x00000047,0x0000008f,
+0x00000007,0x0004003b,0x0000008b,0x00000094,
+0x00000007,0x0004003b,0x00000098,0x00000099,
+0x00000007,0x0004003b,0x0000000e,0x000000c2,
+0x00000007,0x0004003b,0x0000000e,0x000000cb,
+0x00000007,0x0004003b,0x0000000e,0x000000d3,
+0x00000007,0x0004003b,0x00000021,0x000000d9,
+0x00000007,0x0004003b,0x00000021,0x000000dc,
+0x00000007,0x0004003b,0x00000021,0x000000e8,
+0x00000007,0x0004003b,0x000000fe,0x000000ff,
+0x00000007,0x0004003d,0x0000000d,0x00000023,
+0x00000015,0x000500c2,0x0000000d,0x00000025,
+0x00000023,0x00000024,0x0004007c,0x00000006,
+0x00000026,0x00000025,0x0003003e,0x00000022,
+0x00000026,0x0004003d,0x0000000f,0x00000027,
+0x00000017,0x000300f7,0x00000029,0x00000000,
+0x000400fa,0x00000027,0x00000028,0x00000029,
+0x000200f8,0x00000028,0x0004003d,0x00000006,
+0x0000002a,0x00000022,0x000500af,0x0000000f,
+0x0000002c,0x0000002a,0x0000002b,0x000300f7,
+0x0000002e,0x00000000,0x000400fa,0x0000002c,
+0x0000002d,0x0000002e,0x000200f8,0x0000002d,
+0x0004003d,0x00000006,0x00000030,0x00000022,
+0x00050082,0x00000006,0x00000031,0x00000030,
+0x0000002f,0x0003003e,0x00000022,0x00000031,
+0x000200f9,0x0000002e,0x000200f8,0x0000002e,
+0x0004003d,0x00000006,0x00000032,0x00000022,
+0x000500aa,0x0000000f,0x00000034,0x00000032,
+0x00000033,0x000300f7,0x00000036,0x00000000,
+0x000400fa,0x00000034,0x00000035,0x00000036,
+0x000200f8,0x00000035,0x0003003e,0x00000022,
+0x00000037,0x000200f9,0x00000036,0x000200f8,
+0x00000036,0x000200f9,0x00000029,0x000200f8,
+0x00000029,0x0004003d,0x0000000d,0x00000039,
+0x00000015,0x000500c2,0x0000000d,0x0000003b,
+0x00000039,0x0000003a,0x0004007c,0x00000006,
+0x0000003c,0x0000003b,0x0003003e,0x00000038,
+0x0000003c,0x0004003d,0x00000006,0x0000003e,
+0x00000038,0x000500c7,0x00000006,0x0000003f,
+0x0000003e,0x0000003d,0x0003003e,0x00000038,
+0x0000003f,0x0004003d,0x0000000d,0x00000041,
+0x00000015,0x000500c2,0x0000000d,0x00000043,
+0x00000041,0x00000042,0x000500c7,0x0000000d,
+0x00000045,0x00000043,0x00000044,0x0003003e,
+0x00000040,0x00000045,0x0004003d,0x0000000d,
+0x00000088,0x00000040,0x00050084,0x0000000d,
+0x0000008a,0x00000088,0x00000089,0x0003003e,
+0x0000008c,0x00000087,0x00050041,0x00000047,
+0x0000008d,0x0000008c,0x0000008a,0x0004003d,
+0x00000046,0x0000008e,0x0000008d,0x0003003e,
+0x00000048,0x0000008e,0x0004003d,0x0000000d,
+0x00000090,0x00000040,0x00050084,0x0000000d,
+0x00000091,0x00000090,0x00000089,0x00050080,
+0x0000000d,0x00000093,0x00000091,0x00000092,
+0x0003003e,0x00000094,0x00000087,0x00050041,
+0x00000047,0x00000095,0x00000094,0x00000093,
+0x0004003d,0x00000046,0x00000096,0x00000095,
+0x0003003e,0x0000008f,0x00000096,0x0004003d,
+0x0000000d,0x0000009a,0x00000015,0x000500c2,
+0x0000000d,0x0000009c,0x0000009a,0x0000009b,
+0x0004003d,0x0000000d,0x0000009d,0x00000015,
+0x000500c2,0x0000000d,0x0000009e,0x0000009d,
+0x0000006f,0x0004003d,0x0000000d,0x0000009f,
+0x00000015,0x000500c2,0x0000000d,0x000000a0,
+0x0000009f,0x00000063,0x0004003d,0x0000000d,
+0x000000a1,0x00000015,0x000500c2,0x0000000d,
+0x000000a2,0x000000a1,0x00000062,0x0004003d,
+0x0000000d,0x000000a3,0x00000015,0x000500c2,
+0x0000000d,0x000000a4,0x000000a3,0x00000061,
+0x0004003d,0x0000000d,0x000000a5,0x00000015,
+0x000500c4,0x0000000d,0x000000a6,0x000000a5,
+0x00000050,0x0004003d,0x0000000d,0x000000a7,
+0x00000016,0x000500c2,0x0000000d,0x000000a9,
+0x000000a7,0x000000a8,0x000500c5,0x0000000d,
+0x000000aa,0x000000a6,0x000000a9,0x0004003d,
+0x0000000d,0x000000ab,0x00000016,0x000500c2,
+0x0000000d,0x000000ad,0x000000ab,0x000000ac,
+0x0004003d,0x0000000d,0x000000ae,0x00000016,
+0x000500c2,0x0000000d,0x000000af,0x000000ae,
+0x00000024,0x0004003d,0x0000000d,0x000000b0,
+0x00000016,0x000500c2,0x0000000d,0x000000b2,
+0x000000b0,0x000000b1,0x0004003d,0x0000000d,
+0x000000b3,0x00000016,0x000500c2,0x0000000d,
+0x000000b5,0x000000b3,0x000000b4,0x0004003d,
+0x0000000d,0x000000b6,0x00000016,0x000500c2,
+0x0000000d,0x000000b7,0x000000b6,0x0000003d,
+0x0004003d,0x0000000d,0x000000b8,0x00000016,
+0x000500c2,0x0000000d,0x000000b9,0x000000b8,
+0x0000005b,0x0004003d,0x0000000d,0x000000ba,
+0x00000016,0x000500c2,0x0000000d,0x000000bb,
+0x000000ba,0x0000005a,0x0004003d,0x0000000d,
+0x000000bc,0x00000016,0x000500c2,0x0000000d,
+0x000000bd,0x000000bc,0x00000059,0x0004003d,
+0x0000000d,0x000000be,0x00000016,0x000500c2,
+0x0000000d,0x000000bf,0x000000be,0x00000067,
+0x0004003d,0x0000000d,0x000000c0,0x00000016,
+0x00130050,0x00000097,0x000000c1,0x0000009c,
+0x0000009e,0x000000a0,0x000000a2,0x000000a4,
+0x000000aa,0x000000ad,0x000000af,0x000000b2,
+0x000000b5,0x000000b7,0x000000b9,0x000000bb,
+0x000000bd,0x000000bf,0x000000c0,0x0003003e,
+0x00000099,0x000000c1,0x0003003e,0x000000c2,
+0x000000c3,0x000200f9,0x000000c4,0x000200f8,
+0x000000c4,0x000400f6,0x000000c6,0x000000c7,
+0x00000000,0x000200f9,0x000000c8,0x000200f8,
+0x000000c8,0x0004003d,0x0000000d,0x000000c9,
+0x000000c2,0x000500b0,0x0000000f,0x000000ca,
+0x000000c9,0x00000012,0x000400fa,0x000000ca,
+0x000000c5,0x000000c6,0x000200f8,0x000000c5,
+0x0004003d,0x0000000d,0x000000cc,0x000000c2,
+0x00050089,0x0000000d,0x000000ce,0x000000cc,
+0x000000cd,0x00050084,0x0000000d,0x000000cf,
+0x000000ce,0x000000cd,0x0004003d,0x0000000d,
+0x000000d0,0x000000c2,0x00050086,0x0000000d,
+0x000000d1,0x000000d0,0x000000cd,0x00050080,
+0x0000000d,0x000000d2,0x000000cf,0x000000d1,
+0x0003003e,0x000000cb,0x000000d2,0x0004003d,
+0x0000000d,0x000000d4,0x000000c2,0x00050041,
+0x0000000e,0x000000d5,0x00000099,0x000000d4,
+0x0004003d,0x0000000d,0x000000d6,0x000000d5,
+0x000500c7,0x0000000d,0x000000d8,0x000000d6,
+0x000000d7,0x0003003e,0x000000d3,0x000000d8,
+0x0004003d,0x0000000d,0x000000da,0x000000d3,
+0x000500ae,0x0000000f,0x000000db,0x000000da,
+0x000000cd,0x000300f7,0x000000de,0x00000000,
+0x000400fa,0x000000db,0x000000dd,0x000000e3,
+0x000200f8,0x000000dd,0x0004003d,0x0000000d,
+0x000000df,0x000000d3,0x00050082,0x0000000d,
+0x000000e0,0x000000df,0x000000cd,0x00050041,
+0x00000021,0x000000e1,0x0000008f,0x000000e0,
+0x0004003d,0x00000006,0x000000e2,0x000000e1,
+0x0003003e,0x000000dc,0x000000e2,0x000200f9,
+0x000000de,0x000200f8,0x000000e3,0x0004003d,
+0x0000000d,0x000000e4,0x000000d3,0x00050041,
+0x00000021,0x000000e5,0x00000048,0x000000e4,
+0x0004003d,0x00000006,0x000000e6,0x000000e5,
+0x0003003e,0x000000dc,0x000000e6,0x000200f9,
+0x000000de,0x000200f8,0x000000de,0x0004003d,
+0x00000006,0x000000e7,0x000000dc,0x0003003e,
+0x000000d9,0x000000e7,0x0004003d,0x00000006,
+0x000000e9,0x00000022,0x0004003d,0x00000006,
+0x000000ea,0x000000d9,0x0004003d,0x00000006,
+0x000000eb,0x00000038,0x00050084,0x00000006,
+0x000000ec,0x000000ea,0x000000eb,0x00050080,
+0x00000006,0x000000ed,0x000000e9,0x000000ec,
+0x0003003e,0x000000e8,0x000000ed,0x0004003d,
+0x00000006,0x000000ee,0x000000e8,0x00050084,
+0x00000006,0x000000ef,0x000000ee,0x00000052,
+0x0003003e,0x000000e8,0x000000ef,0x0004003d,
+0x00000006,0x000000f0,0x00000038,0x000500aa,
+0x0000000f,0x000000f1,0x000000f0,0x00000081,
+0x000300f7,0x000000f3,0x00000000,0x000400fa,
+0x000000f1,0x000000f2,0x000000f3,0x000200f8,
+0x000000f2,0x0004003d,0x00000006,0x000000f4,
+0x000000d9,0x0004003d,0x00000006,0x000000f5,
+0x000000e8,0x00050080,0x00000006,0x000000f6,
+0x000000f5,0x000000f4,0x0003003e,0x000000e8,
+0x000000f6,0x000200f9,0x000000f3,0x000200f8,
+0x000000f3,0x0004003d,0x0000000f,0x000000f7,
+0x00000017,0x000300f7,0x000000f9,0x00000000,
+0x000400fa,0x000000f7,0x000000f8,0x00000107,
+0x000200f8,0x000000f8,0x0004003d,0x00000006,
+0x000000fa,0x000000e8,0x0008000c,0x00000006,
+0x000000fd,0x00000001,0x0000002d,0x000000fa,
+0x000000fb,0x000000fc,0x0003003e,0x000000e8,
+0x000000fd,0x0004003d,0x0000000d,0x00000100,
+0x000000cb,0x0004003d,0x00000006,0x00000101,
+0x000000e8,0x0004006f,0x00000011,0x00000102,
+0x00000101,0x00050088,0x00000011,0x00000104,
+0x00000102,0x00000103,0x00050041,0x00000105,
+0x00000106,0x000000ff,0x00000100,0x0003003e,
+0x00000106,0x00000104,0x000200f9,0x000000f9,
+0x000200f8,0x00000107,0x0004003d,0x00000006,
+0x00000108,0x000000e8,0x00050080,0x00000006,
+0x00000109,0x00000108,0x00000062,0x0003003e,
+0x000000e8,0x00000109,0x0004003d,0x00000006,
+0x0000010a,0x000000e8,0x0008000c,0x00000006,
+0x0000010c,0x00000001,0x0000002d,0x0000010a,
+0x00000081,0x0000010b,0x0003003e,0x000000e8,
+0x0000010c,0x0004003d,0x0000000d,0x0000010d,
+0x000000cb,0x0004003d,0x00000006,0x0000010e,
+0x000000e8,0x0004006f,0x00000011,0x0000010f,
+0x0000010e,0x00050088,0x00000011,0x00000111,
+0x0000010f,0x00000110,0x00050041,0x00000105,
+0x00000112,0x000000ff,0x0000010d,0x0003003e,
+0x00000112,0x00000111,0x000200f9,0x000000f9,
+0x000200f8,0x000000f9,0x000200f9,0x000000c7,
+0x000200f8,0x000000c7,0x0004003d,0x0000000d,
+0x00000113,0x000000c2,0x00050080,0x0000000d,
+0x00000114,0x00000113,0x00000061,0x0003003e,
+0x000000c2,0x00000114,0x000200f9,0x000000c4,
+0x000200f8,0x000000c6,0x0004003d,0x00000013,
+0x00000115,0x000000ff,0x000200fe,0x00000115,
+0x00010038,0x00050036,0x0000000d,0x0000001c,
+0x00000000,0x0000001a,0x00030037,0x0000000e,
+0x0000001b,0x000200f8,0x0000001d,0x0004003d,
+0x0000000d,0x00000118,0x0000001b,0x000500c7,
+0x0000000d,0x0000011a,0x00000118,0x00000119,
+0x000500c4,0x0000000d,0x0000011b,0x0000011a,
+0x00000024,0x0004003d,0x0000000d,0x0000011c,
+0x0000001b,0x000500c7,0x0000000d,0x0000011e,
+0x0000011c,0x0000011d,0x000500c4,0x0000000d,
+0x0000011f,0x0000011e,0x00000052,0x000500c5,
+0x0000000d,0x00000120,0x0000011b,0x0000011f,
+0x0004003d,0x0000000d,0x00000121,0x0000001b,
+0x000500c7,0x0000000d,0x00000123,0x00000121,
+0x00000122,0x000500c2,0x0000000d,0x00000124,
+0x00000123,0x00000052,0x000500c5,0x0000000d,
+0x00000125,0x00000120,0x00000124,0x0004003d,
+0x0000000d,0x00000126,0x0000001b,0x000500c7,
+0x0000000d,0x00000128,0x00000126,0x00000127,
+0x000500c2,0x0000000d,0x00000129,0x00000128,
+0x00000024,0x000500c5,0x0000000d,0x0000012a,
+0x00000125,0x00000129,0x000200fe,0x0000012a,
+0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_3D.inl
new file mode 100644
index 00000000000..20f021c5beb
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacR11Unorm_3D.inl
@@ -0,0 +1,637 @@
+0x07230203,0x00010300,0x000d000a,0x000001be,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x00000031,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000130,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00060005,
+0x0000000b,0x50746567,0x4433736f,0x33697628,
+0x0000003b,0x00030005,0x0000000a,0x00736f70,
+0x000e0005,0x00000018,0x5f636165,0x6f636564,
+0x735f6564,0x6c676e69,0x68635f65,0x656e6e61,
+0x6c625f6c,0x5f6b636f,0x616f6c66,0x31752874,
+0x3b31753b,0x003b3162,0x00040005,0x00000015,
+0x68676968,0x00000000,0x00030005,0x00000016,
+0x00776f6c,0x00050005,0x00000017,0x69537369,
+0x64656e67,0x00000000,0x00050005,0x0000001c,
+0x70696c66,0x75283233,0x00003b31,0x00030005,
+0x0000001b,0x00000061,0x00060005,0x00000022,
+0x65736162,0x646f635f,0x726f7765,0x00000064,
+0x00050005,0x00000038,0x746c756d,0x696c7069,
+0x00007265,0x00040005,0x00000040,0x496c6274,
+0x00007864,0x00040005,0x00000048,0x6c626174,
+0x00003065,0x00050005,0x0000008c,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000008f,
+0x6c626174,0x00003165,0x00050005,0x00000094,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000099,0x00000070,0x00030005,0x000000c2,
+0x00000069,0x00040005,0x000000cb,0x4974756f,
+0x00007864,0x00050005,0x000000d3,0x69646f6d,
+0x72656966,0x00000000,0x00060005,0x000000d9,
+0x69646f6d,0x72656966,0x756c6156,0x00000065,
+0x00040005,0x000000e8,0x6f636564,0x00646564,
+0x00040005,0x000000ff,0x75736572,0x0000746c,
+0x00030005,0x0000012d,0x00736f70,0x00080005,
+0x00000130,0x475f6c67,0x61626f6c,0x766e496c,
+0x7461636f,0x496e6f69,0x00000044,0x00070005,
+0x00000133,0x67616d49,0x726f4665,0x4274616d,
+0x6b636f6c,0x00000000,0x00060006,0x00000133,
+0x00000000,0x706d6f63,0x6d726f46,0x00007461,
+0x00060006,0x00000133,0x00000001,0x65736162,
+0x6579614c,0x00000072,0x00060005,0x00000135,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00050005,0x00000140,0x42637273,0x6b636f6c,
+0x00000000,0x00050005,0x00000143,0x6d695f75,
+0x30656761,0x00000000,0x00040005,0x00000145,
+0x61726170,0x0000006d,0x00060005,0x00000149,
+0x6f636564,0x6572706d,0x64657373,0x00000000,
+0x00040005,0x0000014a,0x61726170,0x0000006d,
+0x00040005,0x0000014e,0x61726170,0x0000006d,
+0x00040005,0x00000153,0x61726170,0x0000006d,
+0x00040005,0x00000154,0x61726170,0x0000006d,
+0x00040005,0x00000155,0x61726170,0x0000006d,
+0x00030005,0x00000157,0x00000079,0x00030005,
+0x0000015f,0x00000078,0x00050005,0x00000169,
+0x6d695f75,0x31656761,0x00000000,0x00040005,
+0x00000179,0x61726170,0x0000006d,0x00040047,
+0x00000130,0x0000000b,0x0000001c,0x00050048,
+0x00000133,0x00000000,0x00000023,0x00000000,
+0x00050048,0x00000133,0x00000001,0x00000023,
+0x00000004,0x00030047,0x00000133,0x00000002,
+0x00040047,0x00000143,0x00000022,0x00000000,
+0x00040047,0x00000143,0x00000021,0x00000000,
+0x00030047,0x00000143,0x00000018,0x00040047,
+0x00000169,0x00000022,0x00000000,0x00040047,
+0x00000169,0x00000021,0x00000001,0x00030047,
+0x00000169,0x00000019,0x00040047,0x000001bd,
+0x0000000b,0x00000019,0x00020013,0x00000002,
+0x00030021,0x00000003,0x00000002,0x00040015,
+0x00000006,0x00000020,0x00000001,0x00040017,
+0x00000007,0x00000006,0x00000003,0x00040020,
+0x00000008,0x00000007,0x00000007,0x00040021,
+0x00000009,0x00000007,0x00000008,0x00040015,
+0x0000000d,0x00000020,0x00000000,0x00040020,
+0x0000000e,0x00000007,0x0000000d,0x00020014,
+0x0000000f,0x00040020,0x00000010,0x00000007,
+0x0000000f,0x00030016,0x00000011,0x00000020,
+0x0004002b,0x0000000d,0x00000012,0x00000010,
+0x0004001c,0x00000013,0x00000011,0x00000012,
+0x00060021,0x00000014,0x00000013,0x0000000e,
+0x0000000e,0x00000010,0x00040021,0x0000001a,
+0x0000000d,0x0000000e,0x00040020,0x00000021,
+0x00000007,0x00000006,0x0004002b,0x00000006,
+0x00000024,0x00000018,0x0004002b,0x00000006,
+0x0000002b,0x00000080,0x0004002b,0x00000006,
+0x0000002f,0x00000100,0x0004002b,0x00000006,
+0x00000033,0xffffff80,0x0004002b,0x00000006,
+0x00000037,0xffffff81,0x0004002b,0x00000006,
+0x0000003a,0x00000014,0x0004002b,0x00000006,
+0x0000003d,0x0000000f,0x0004002b,0x00000006,
+0x00000042,0x00000010,0x0004002b,0x0000000d,
+0x00000044,0x0000000f,0x00040017,0x00000046,
+0x00000006,0x00000004,0x00040020,0x00000047,
+0x00000007,0x00000046,0x0004002b,0x0000000d,
+0x00000049,0x00000020,0x0004001c,0x0000004a,
+0x00000046,0x00000049,0x0004002b,0x00000006,
+0x0000004b,0xfffffffd,0x0004002b,0x00000006,
+0x0000004c,0xfffffffa,0x0004002b,0x00000006,
+0x0000004d,0xfffffff7,0x0004002b,0x00000006,
+0x0000004e,0xfffffff1,0x0007002c,0x00000046,
+0x0000004f,0x0000004b,0x0000004c,0x0000004d,
+0x0000004e,0x0004002b,0x00000006,0x00000050,
+0x00000002,0x0004002b,0x00000006,0x00000051,
+0x00000005,0x0004002b,0x00000006,0x00000052,
+0x00000008,0x0004002b,0x00000006,0x00000053,
+0x0000000e,0x0007002c,0x00000046,0x00000054,
+0x00000050,0x00000051,0x00000052,0x00000053,
+0x0004002b,0x00000006,0x00000055,0xfffffff9,
+0x0004002b,0x00000006,0x00000056,0xfffffff6,
+0x0004002b,0x00000006,0x00000057,0xfffffff3,
+0x0007002c,0x00000046,0x00000058,0x0000004b,
+0x00000055,0x00000056,0x00000057,0x0004002b,
+0x00000006,0x00000059,0x00000006,0x0004002b,
+0x00000006,0x0000005a,0x00000009,0x0004002b,
+0x00000006,0x0000005b,0x0000000c,0x0007002c,
+0x00000046,0x0000005c,0x00000050,0x00000059,
+0x0000005a,0x0000005b,0x0004002b,0x00000006,
+0x0000005d,0xfffffffe,0x0004002b,0x00000006,
+0x0000005e,0xfffffffb,0x0004002b,0x00000006,
+0x0000005f,0xfffffff8,0x0007002c,0x00000046,
+0x00000060,0x0000005d,0x0000005e,0x0000005f,
+0x00000057,0x0004002b,0x00000006,0x00000061,
+0x00000001,0x0004002b,0x00000006,0x00000062,
+0x00000004,0x0004002b,0x00000006,0x00000063,
+0x00000007,0x0007002c,0x00000046,0x00000064,
+0x00000061,0x00000062,0x00000063,0x0000005b,
+0x0004002b,0x00000006,0x00000065,0xfffffffc,
+0x0007002c,0x00000046,0x00000066,0x0000005d,
+0x00000065,0x0000004c,0x00000057,0x0004002b,
+0x00000006,0x00000067,0x00000003,0x0007002c,
+0x00000046,0x00000068,0x00000061,0x00000067,
+0x00000051,0x0000005b,0x0004002b,0x00000006,
+0x00000069,0xfffffff4,0x0007002c,0x00000046,
+0x0000006a,0x0000004b,0x0000004c,0x0000005f,
+0x00000069,0x0004002b,0x00000006,0x0000006b,
+0x0000000b,0x0007002c,0x00000046,0x0000006c,
+0x00000050,0x00000051,0x00000063,0x0000006b,
+0x0004002b,0x00000006,0x0000006d,0xfffffff5,
+0x0007002c,0x00000046,0x0000006e,0x0000004b,
+0x00000055,0x0000004d,0x0000006d,0x0004002b,
+0x00000006,0x0000006f,0x0000000a,0x0007002c,
+0x00000046,0x00000070,0x00000050,0x00000059,
+0x00000052,0x0000006f,0x0007002c,0x00000046,
+0x00000071,0x00000065,0x00000055,0x0000005f,
+0x0000006d,0x0007002c,0x00000046,0x00000072,
+0x00000067,0x00000059,0x00000063,0x0000006f,
+0x0007002c,0x00000046,0x00000073,0x0000004b,
+0x0000005e,0x0000005f,0x0000006d,0x0007002c,
+0x00000046,0x00000074,0x00000050,0x00000062,
+0x00000063,0x0000006f,0x0007002c,0x00000046,
+0x00000075,0x0000005d,0x0000004c,0x0000005f,
+0x00000056,0x0007002c,0x00000046,0x00000076,
+0x00000061,0x00000051,0x00000063,0x0000005a,
+0x0007002c,0x00000046,0x00000077,0x0000005d,
+0x0000005e,0x0000005f,0x00000056,0x0007002c,
+0x00000046,0x00000078,0x00000061,0x00000062,
+0x00000063,0x0000005a,0x0007002c,0x00000046,
+0x00000079,0x0000005d,0x00000065,0x0000005f,
+0x00000056,0x0007002c,0x00000046,0x0000007a,
+0x00000061,0x00000067,0x00000063,0x0000005a,
+0x0007002c,0x00000046,0x0000007b,0x0000005d,
+0x0000005e,0x00000055,0x00000056,0x0007002c,
+0x00000046,0x0000007c,0x00000061,0x00000062,
+0x00000059,0x0000005a,0x0007002c,0x00000046,
+0x0000007d,0x0000004b,0x00000065,0x00000055,
+0x00000056,0x0007002c,0x00000046,0x0000007e,
+0x00000050,0x00000067,0x00000059,0x0000005a,
+0x0004002b,0x00000006,0x0000007f,0xffffffff,
+0x0007002c,0x00000046,0x00000080,0x0000007f,
+0x0000005d,0x0000004b,0x00000056,0x0004002b,
+0x00000006,0x00000081,0x00000000,0x0007002c,
+0x00000046,0x00000082,0x00000081,0x00000061,
+0x00000050,0x0000005a,0x0007002c,0x00000046,
+0x00000083,0x00000065,0x0000004c,0x0000005f,
+0x0000004d,0x0007002c,0x00000046,0x00000084,
+0x00000067,0x00000051,0x00000063,0x00000052,
+0x0007002c,0x00000046,0x00000085,0x0000004b,
+0x0000005e,0x00000055,0x0000004d,0x0007002c,
+0x00000046,0x00000086,0x00000050,0x00000062,
+0x00000059,0x00000052,0x0023002c,0x0000004a,
+0x00000087,0x0000004f,0x00000054,0x00000058,
+0x0000005c,0x00000060,0x00000064,0x00000066,
+0x00000068,0x0000006a,0x0000006c,0x0000006e,
+0x00000070,0x00000071,0x00000072,0x00000073,
+0x00000074,0x00000075,0x00000076,0x00000077,
+0x00000078,0x00000079,0x0000007a,0x0000007b,
+0x0000007c,0x0000007d,0x0000007e,0x00000080,
+0x00000082,0x00000083,0x00000084,0x00000085,
+0x00000086,0x0004002b,0x0000000d,0x00000089,
+0x00000002,0x00040020,0x0000008b,0x00000007,
+0x0000004a,0x0004002b,0x0000000d,0x00000092,
+0x00000001,0x0004001c,0x00000097,0x0000000d,
+0x00000012,0x00040020,0x00000098,0x00000007,
+0x00000097,0x0004002b,0x00000006,0x0000009b,
+0x0000000d,0x0004002b,0x00000006,0x000000a8,
+0x0000001e,0x0004002b,0x00000006,0x000000ac,
+0x0000001b,0x0004002b,0x00000006,0x000000b1,
+0x00000015,0x0004002b,0x00000006,0x000000b4,
+0x00000012,0x0004002b,0x0000000d,0x000000c3,
+0x00000000,0x0004002b,0x0000000d,0x000000cd,
+0x00000004,0x0004002b,0x0000000d,0x000000d7,
+0x00000007,0x0004002b,0x00000006,0x000000fb,
+0xfffffc01,0x0004002b,0x00000006,0x000000fc,
+0x000003ff,0x00040020,0x000000fe,0x00000007,
+0x00000013,0x0004002b,0x00000011,0x00000103,
+0x447fc000,0x00040020,0x00000105,0x00000007,
+0x00000011,0x0004002b,0x00000006,0x0000010b,
+0x000007ff,0x0004002b,0x00000011,0x00000110,
+0x44ffe000,0x0004002b,0x0000000d,0x00000119,
+0x000000ff,0x0004002b,0x0000000d,0x0000011d,
+0x0000ff00,0x0004002b,0x0000000d,0x00000122,
+0x00ff0000,0x0004002b,0x0000000d,0x00000127,
+0xff000000,0x00040017,0x0000012e,0x0000000d,
+0x00000003,0x00040020,0x0000012f,0x00000001,
+0x0000012e,0x0004003b,0x0000012f,0x00000130,
+0x00000001,0x0004001e,0x00000133,0x0000000d,
+0x0000000d,0x00040020,0x00000134,0x00000009,
+0x00000133,0x0004003b,0x00000134,0x00000135,
+0x00000009,0x00040020,0x00000136,0x00000009,
+0x0000000d,0x00040017,0x0000013e,0x0000000d,
+0x00000004,0x00040020,0x0000013f,0x00000007,
+0x0000013e,0x00090019,0x00000141,0x0000000d,
+0x00000002,0x00000000,0x00000000,0x00000000,
+0x00000002,0x00000023,0x00040020,0x00000142,
+0x00000000,0x00000141,0x0004003b,0x00000142,
+0x00000143,0x00000000,0x0003002a,0x0000000f,
+0x00000152,0x00090019,0x00000167,0x00000011,
+0x00000002,0x00000000,0x00000000,0x00000000,
+0x00000002,0x0000000e,0x00040020,0x00000168,
+0x00000000,0x00000167,0x0004003b,0x00000168,
+0x00000169,0x00000000,0x00040017,0x0000016b,
+0x00000006,0x00000002,0x0004002b,0x00000011,
+0x00000181,0x00000000,0x0004002b,0x00000011,
+0x00000182,0x3f800000,0x00040017,0x00000183,
+0x00000011,0x00000004,0x0004002b,0x0000000d,
+0x00000189,0x00000093,0x0004002b,0x0000000d,
+0x0000018a,0x00000094,0x0004002b,0x0000000d,
+0x0000018b,0x00000095,0x0004002b,0x0000000d,
+0x0000018c,0x00000096,0x0004002b,0x0000000d,
+0x0000018d,0x00000097,0x0004002b,0x0000000d,
+0x0000018e,0x00000098,0x0004002b,0x0000000d,
+0x0000018f,0x00000099,0x0004002b,0x0000000d,
+0x00000190,0x0000009a,0x0004002b,0x0000000d,
+0x00000191,0x0000009b,0x0004002b,0x0000000d,
+0x00000192,0x0000009c,0x0004002b,0x0000000d,
+0x00000193,0x00000008,0x0004001c,0x00000194,
+0x00000006,0x00000193,0x000b002c,0x00000194,
+0x00000195,0x00000081,0x00000061,0x00000050,
+0x00000067,0x00000065,0x0000004b,0x0000005d,
+0x0000007f,0x0004001c,0x00000196,0x00000046,
+0x00000193,0x0007002c,0x00000046,0x00000197,
+0x00000050,0x00000052,0x0000005d,0x0000005f,
+0x0004002b,0x00000006,0x00000198,0x00000011,
+0x0004002b,0x00000006,0x00000199,0xffffffef,
+0x0007002c,0x00000046,0x0000019a,0x00000051,
+0x00000198,0x0000005e,0x00000199,0x0004002b,
+0x00000006,0x0000019b,0x0000001d,0x0004002b,
+0x00000006,0x0000019c,0xffffffe3,0x0007002c,
+0x00000046,0x0000019d,0x0000005a,0x0000019b,
+0x0000004d,0x0000019c,0x0004002b,0x00000006,
+0x0000019e,0x0000002a,0x0004002b,0x00000006,
+0x0000019f,0xffffffd6,0x0007002c,0x00000046,
+0x000001a0,0x0000009b,0x0000019e,0x00000057,
+0x0000019f,0x0004002b,0x00000006,0x000001a1,
+0x0000003c,0x0004002b,0x00000006,0x000001a2,
+0xffffffee,0x0004002b,0x00000006,0x000001a3,
+0xffffffc4,0x0007002c,0x00000046,0x000001a4,
+0x000000b4,0x000001a1,0x000001a2,0x000001a3,
+0x0004002b,0x00000006,0x000001a5,0x00000050,
+0x0004002b,0x00000006,0x000001a6,0xffffffe8,
+0x0004002b,0x00000006,0x000001a7,0xffffffb0,
+0x0007002c,0x00000046,0x000001a8,0x00000024,
+0x000001a5,0x000001a6,0x000001a7,0x0004002b,
+0x00000006,0x000001a9,0x00000021,0x0004002b,
+0x00000006,0x000001aa,0x0000006a,0x0004002b,
+0x00000006,0x000001ab,0xffffffdf,0x0004002b,
+0x00000006,0x000001ac,0xffffff96,0x0007002c,
+0x00000046,0x000001ad,0x000001a9,0x000001aa,
+0x000001ab,0x000001ac,0x0004002b,0x00000006,
+0x000001ae,0x0000002f,0x0004002b,0x00000006,
+0x000001af,0x000000b7,0x0004002b,0x00000006,
+0x000001b0,0xffffffd1,0x0004002b,0x00000006,
+0x000001b1,0xffffff49,0x0007002c,0x00000046,
+0x000001b2,0x000001ae,0x000001af,0x000001b0,
+0x000001b1,0x000b002c,0x00000196,0x000001b3,
+0x00000197,0x0000019a,0x0000019d,0x000001a0,
+0x000001a4,0x000001a8,0x000001ad,0x000001b2,
+0x0007002c,0x00000046,0x000001b4,0x00000081,
+0x00000052,0x00000081,0x0000005f,0x0007002c,
+0x00000046,0x000001b5,0x00000081,0x00000198,
+0x00000081,0x00000199,0x0007002c,0x00000046,
+0x000001b6,0x00000081,0x0000019b,0x00000081,
+0x0000019c,0x0007002c,0x00000046,0x000001b7,
+0x00000081,0x0000019e,0x00000081,0x0000019f,
+0x0007002c,0x00000046,0x000001b8,0x00000081,
+0x000001a1,0x00000081,0x000001a3,0x0007002c,
+0x00000046,0x000001b9,0x00000081,0x000001a5,
+0x00000081,0x000001a7,0x0007002c,0x00000046,
+0x000001ba,0x00000081,0x000001aa,0x00000081,
+0x000001ac,0x0007002c,0x00000046,0x000001bb,
+0x00000081,0x000001af,0x00000081,0x000001b1,
+0x000b002c,0x00000196,0x000001bc,0x000001b4,
+0x000001b5,0x000001b6,0x000001b7,0x000001b8,
+0x000001b9,0x000001ba,0x000001bb,0x0006002c,
+0x0000012e,0x000001bd,0x00000193,0x00000193,
+0x00000092,0x00050036,0x00000002,0x00000004,
+0x00000000,0x00000003,0x000200f8,0x00000005,
+0x0004003b,0x00000008,0x0000012d,0x00000007,
+0x0004003b,0x0000013f,0x00000140,0x00000007,
+0x0004003b,0x00000008,0x00000145,0x00000007,
+0x0004003b,0x000000fe,0x00000149,0x00000007,
+0x0004003b,0x0000000e,0x0000014a,0x00000007,
+0x0004003b,0x0000000e,0x0000014e,0x00000007,
+0x0004003b,0x0000000e,0x00000153,0x00000007,
+0x0004003b,0x0000000e,0x00000154,0x00000007,
+0x0004003b,0x00000010,0x00000155,0x00000007,
+0x0004003b,0x00000021,0x00000157,0x00000007,
+0x0004003b,0x00000021,0x0000015f,0x00000007,
+0x0004003b,0x00000008,0x00000179,0x00000007,
+0x0004003d,0x0000012e,0x00000131,0x00000130,
+0x0004007c,0x00000007,0x00000132,0x00000131,
+0x0003003e,0x0000012d,0x00000132,0x00050041,
+0x00000136,0x00000137,0x00000135,0x00000061,
+0x0004003d,0x0000000d,0x00000138,0x00000137,
+0x0004007c,0x00000006,0x00000139,0x00000138,
+0x00050041,0x00000021,0x0000013a,0x0000012d,
+0x00000089,0x0004003d,0x00000006,0x0000013b,
+0x0000013a,0x00050080,0x00000006,0x0000013c,
+0x0000013b,0x00000139,0x00050041,0x00000021,
+0x0000013d,0x0000012d,0x00000089,0x0003003e,
+0x0000013d,0x0000013c,0x0004003d,0x00000141,
+0x00000144,0x00000143,0x0004003d,0x00000007,
+0x00000146,0x0000012d,0x0003003e,0x00000145,
+0x00000146,0x00050039,0x00000007,0x00000147,
+0x0000000b,0x00000145,0x00050062,0x0000013e,
+0x00000148,0x00000144,0x00000147,0x0003003e,
+0x00000140,0x00000148,0x00050041,0x0000000e,
+0x0000014b,0x00000140,0x000000c3,0x0004003d,
+0x0000000d,0x0000014c,0x0000014b,0x0003003e,
+0x0000014a,0x0000014c,0x00050039,0x0000000d,
+0x0000014d,0x0000001c,0x0000014a,0x00050041,
+0x0000000e,0x0000014f,0x00000140,0x00000092,
+0x0004003d,0x0000000d,0x00000150,0x0000014f,
+0x0003003e,0x0000014e,0x00000150,0x00050039,
+0x0000000d,0x00000151,0x0000001c,0x0000014e,
+0x0003003e,0x00000153,0x0000014d,0x0003003e,
+0x00000154,0x00000151,0x0003003e,0x00000155,
+0x00000152,0x00070039,0x00000013,0x00000156,
+0x00000018,0x00000153,0x00000154,0x00000155,
+0x0003003e,0x00000149,0x00000156,0x0003003e,
+0x00000157,0x00000081,0x000200f9,0x00000158,
+0x000200f8,0x00000158,0x000400f6,0x0000015a,
+0x0000015b,0x00000000,0x000200f9,0x0000015c,
+0x000200f8,0x0000015c,0x0004003d,0x00000006,
+0x0000015d,0x00000157,0x000500b1,0x0000000f,
+0x0000015e,0x0000015d,0x00000062,0x000400fa,
+0x0000015e,0x00000159,0x0000015a,0x000200f8,
+0x00000159,0x0003003e,0x0000015f,0x00000081,
+0x000200f9,0x00000160,0x000200f8,0x00000160,
+0x000400f6,0x00000162,0x00000163,0x00000000,
+0x000200f9,0x00000164,0x000200f8,0x00000164,
+0x0004003d,0x00000006,0x00000165,0x0000015f,
+0x000500b1,0x0000000f,0x00000166,0x00000165,
+0x00000062,0x000400fa,0x00000166,0x00000161,
+0x00000162,0x000200f8,0x00000161,0x0004003d,
+0x00000167,0x0000016a,0x00000169,0x0004003d,
+0x00000007,0x0000016c,0x0000012d,0x0007004f,
+0x0000016b,0x0000016d,0x0000016c,0x0000016c,
+0x00000000,0x00000001,0x00050050,0x0000016b,
+0x0000016e,0x00000062,0x00000062,0x00050084,
+0x0000016b,0x0000016f,0x0000016d,0x0000016e,
+0x0004003d,0x00000006,0x00000170,0x0000015f,
+0x0004003d,0x00000006,0x00000171,0x00000157,
+0x00050050,0x0000016b,0x00000172,0x00000170,
+0x00000171,0x00050080,0x0000016b,0x00000173,
+0x0000016f,0x00000172,0x00050041,0x00000021,
+0x00000174,0x0000012d,0x00000089,0x0004003d,
+0x00000006,0x00000175,0x00000174,0x00050051,
+0x00000006,0x00000176,0x00000173,0x00000000,
+0x00050051,0x00000006,0x00000177,0x00000173,
+0x00000001,0x00060050,0x00000007,0x00000178,
+0x00000176,0x00000177,0x00000175,0x0003003e,
+0x00000179,0x00000178,0x00050039,0x00000007,
+0x0000017a,0x0000000b,0x00000179,0x0004003d,
+0x00000006,0x0000017b,0x00000157,0x00050084,
+0x00000006,0x0000017c,0x0000017b,0x00000062,
+0x0004003d,0x00000006,0x0000017d,0x0000015f,
+0x00050080,0x00000006,0x0000017e,0x0000017c,
+0x0000017d,0x00050041,0x00000105,0x0000017f,
+0x00000149,0x0000017e,0x0004003d,0x00000011,
+0x00000180,0x0000017f,0x00070050,0x00000183,
+0x00000184,0x00000180,0x00000181,0x00000181,
+0x00000182,0x00040063,0x0000016a,0x0000017a,
+0x00000184,0x000200f9,0x00000163,0x000200f8,
+0x00000163,0x0004003d,0x00000006,0x00000185,
+0x0000015f,0x00050080,0x00000006,0x00000186,
+0x00000185,0x00000061,0x0003003e,0x0000015f,
+0x00000186,0x000200f9,0x00000160,0x000200f8,
+0x00000162,0x000200f9,0x0000015b,0x000200f8,
+0x0000015b,0x0004003d,0x00000006,0x00000187,
+0x00000157,0x00050080,0x00000006,0x00000188,
+0x00000187,0x00000061,0x0003003e,0x00000157,
+0x00000188,0x000200f9,0x00000158,0x000200f8,
+0x0000015a,0x000100fd,0x00010038,0x00050036,
+0x00000007,0x0000000b,0x00000000,0x00000009,
+0x00030037,0x00000008,0x0000000a,0x000200f8,
+0x0000000c,0x0004003d,0x00000007,0x0000001e,
+0x0000000a,0x000200fe,0x0000001e,0x00010038,
+0x00050036,0x00000013,0x00000018,0x00000000,
+0x00000014,0x00030037,0x0000000e,0x00000015,
+0x00030037,0x0000000e,0x00000016,0x00030037,
+0x00000010,0x00000017,0x000200f8,0x00000019,
+0x0004003b,0x00000021,0x00000022,0x00000007,
+0x0004003b,0x00000021,0x00000038,0x00000007,
+0x0004003b,0x0000000e,0x00000040,0x00000007,
+0x0004003b,0x00000047,0x00000048,0x00000007,
+0x0004003b,0x0000008b,0x0000008c,0x00000007,
+0x0004003b,0x00000047,0x0000008f,0x00000007,
+0x0004003b,0x0000008b,0x00000094,0x00000007,
+0x0004003b,0x00000098,0x00000099,0x00000007,
+0x0004003b,0x0000000e,0x000000c2,0x00000007,
+0x0004003b,0x0000000e,0x000000cb,0x00000007,
+0x0004003b,0x0000000e,0x000000d3,0x00000007,
+0x0004003b,0x00000021,0x000000d9,0x00000007,
+0x0004003b,0x00000021,0x000000dc,0x00000007,
+0x0004003b,0x00000021,0x000000e8,0x00000007,
+0x0004003b,0x000000fe,0x000000ff,0x00000007,
+0x0004003d,0x0000000d,0x00000023,0x00000015,
+0x000500c2,0x0000000d,0x00000025,0x00000023,
+0x00000024,0x0004007c,0x00000006,0x00000026,
+0x00000025,0x0003003e,0x00000022,0x00000026,
+0x0004003d,0x0000000f,0x00000027,0x00000017,
+0x000300f7,0x00000029,0x00000000,0x000400fa,
+0x00000027,0x00000028,0x00000029,0x000200f8,
+0x00000028,0x0004003d,0x00000006,0x0000002a,
+0x00000022,0x000500af,0x0000000f,0x0000002c,
+0x0000002a,0x0000002b,0x000300f7,0x0000002e,
+0x00000000,0x000400fa,0x0000002c,0x0000002d,
+0x0000002e,0x000200f8,0x0000002d,0x0004003d,
+0x00000006,0x00000030,0x00000022,0x00050082,
+0x00000006,0x00000031,0x00000030,0x0000002f,
+0x0003003e,0x00000022,0x00000031,0x000200f9,
+0x0000002e,0x000200f8,0x0000002e,0x0004003d,
+0x00000006,0x00000032,0x00000022,0x000500aa,
+0x0000000f,0x00000034,0x00000032,0x00000033,
+0x000300f7,0x00000036,0x00000000,0x000400fa,
+0x00000034,0x00000035,0x00000036,0x000200f8,
+0x00000035,0x0003003e,0x00000022,0x00000037,
+0x000200f9,0x00000036,0x000200f8,0x00000036,
+0x000200f9,0x00000029,0x000200f8,0x00000029,
+0x0004003d,0x0000000d,0x00000039,0x00000015,
+0x000500c2,0x0000000d,0x0000003b,0x00000039,
+0x0000003a,0x0004007c,0x00000006,0x0000003c,
+0x0000003b,0x0003003e,0x00000038,0x0000003c,
+0x0004003d,0x00000006,0x0000003e,0x00000038,
+0x000500c7,0x00000006,0x0000003f,0x0000003e,
+0x0000003d,0x0003003e,0x00000038,0x0000003f,
+0x0004003d,0x0000000d,0x00000041,0x00000015,
+0x000500c2,0x0000000d,0x00000043,0x00000041,
+0x00000042,0x000500c7,0x0000000d,0x00000045,
+0x00000043,0x00000044,0x0003003e,0x00000040,
+0x00000045,0x0004003d,0x0000000d,0x00000088,
+0x00000040,0x00050084,0x0000000d,0x0000008a,
+0x00000088,0x00000089,0x0003003e,0x0000008c,
+0x00000087,0x00050041,0x00000047,0x0000008d,
+0x0000008c,0x0000008a,0x0004003d,0x00000046,
+0x0000008e,0x0000008d,0x0003003e,0x00000048,
+0x0000008e,0x0004003d,0x0000000d,0x00000090,
+0x00000040,0x00050084,0x0000000d,0x00000091,
+0x00000090,0x00000089,0x00050080,0x0000000d,
+0x00000093,0x00000091,0x00000092,0x0003003e,
+0x00000094,0x00000087,0x00050041,0x00000047,
+0x00000095,0x00000094,0x00000093,0x0004003d,
+0x00000046,0x00000096,0x00000095,0x0003003e,
+0x0000008f,0x00000096,0x0004003d,0x0000000d,
+0x0000009a,0x00000015,0x000500c2,0x0000000d,
+0x0000009c,0x0000009a,0x0000009b,0x0004003d,
+0x0000000d,0x0000009d,0x00000015,0x000500c2,
+0x0000000d,0x0000009e,0x0000009d,0x0000006f,
+0x0004003d,0x0000000d,0x0000009f,0x00000015,
+0x000500c2,0x0000000d,0x000000a0,0x0000009f,
+0x00000063,0x0004003d,0x0000000d,0x000000a1,
+0x00000015,0x000500c2,0x0000000d,0x000000a2,
+0x000000a1,0x00000062,0x0004003d,0x0000000d,
+0x000000a3,0x00000015,0x000500c2,0x0000000d,
+0x000000a4,0x000000a3,0x00000061,0x0004003d,
+0x0000000d,0x000000a5,0x00000015,0x000500c4,
+0x0000000d,0x000000a6,0x000000a5,0x00000050,
+0x0004003d,0x0000000d,0x000000a7,0x00000016,
+0x000500c2,0x0000000d,0x000000a9,0x000000a7,
+0x000000a8,0x000500c5,0x0000000d,0x000000aa,
+0x000000a6,0x000000a9,0x0004003d,0x0000000d,
+0x000000ab,0x00000016,0x000500c2,0x0000000d,
+0x000000ad,0x000000ab,0x000000ac,0x0004003d,
+0x0000000d,0x000000ae,0x00000016,0x000500c2,
+0x0000000d,0x000000af,0x000000ae,0x00000024,
+0x0004003d,0x0000000d,0x000000b0,0x00000016,
+0x000500c2,0x0000000d,0x000000b2,0x000000b0,
+0x000000b1,0x0004003d,0x0000000d,0x000000b3,
+0x00000016,0x000500c2,0x0000000d,0x000000b5,
+0x000000b3,0x000000b4,0x0004003d,0x0000000d,
+0x000000b6,0x00000016,0x000500c2,0x0000000d,
+0x000000b7,0x000000b6,0x0000003d,0x0004003d,
+0x0000000d,0x000000b8,0x00000016,0x000500c2,
+0x0000000d,0x000000b9,0x000000b8,0x0000005b,
+0x0004003d,0x0000000d,0x000000ba,0x00000016,
+0x000500c2,0x0000000d,0x000000bb,0x000000ba,
+0x0000005a,0x0004003d,0x0000000d,0x000000bc,
+0x00000016,0x000500c2,0x0000000d,0x000000bd,
+0x000000bc,0x00000059,0x0004003d,0x0000000d,
+0x000000be,0x00000016,0x000500c2,0x0000000d,
+0x000000bf,0x000000be,0x00000067,0x0004003d,
+0x0000000d,0x000000c0,0x00000016,0x00130050,
+0x00000097,0x000000c1,0x0000009c,0x0000009e,
+0x000000a0,0x000000a2,0x000000a4,0x000000aa,
+0x000000ad,0x000000af,0x000000b2,0x000000b5,
+0x000000b7,0x000000b9,0x000000bb,0x000000bd,
+0x000000bf,0x000000c0,0x0003003e,0x00000099,
+0x000000c1,0x0003003e,0x000000c2,0x000000c3,
+0x000200f9,0x000000c4,0x000200f8,0x000000c4,
+0x000400f6,0x000000c6,0x000000c7,0x00000000,
+0x000200f9,0x000000c8,0x000200f8,0x000000c8,
+0x0004003d,0x0000000d,0x000000c9,0x000000c2,
+0x000500b0,0x0000000f,0x000000ca,0x000000c9,
+0x00000012,0x000400fa,0x000000ca,0x000000c5,
+0x000000c6,0x000200f8,0x000000c5,0x0004003d,
+0x0000000d,0x000000cc,0x000000c2,0x00050089,
+0x0000000d,0x000000ce,0x000000cc,0x000000cd,
+0x00050084,0x0000000d,0x000000cf,0x000000ce,
+0x000000cd,0x0004003d,0x0000000d,0x000000d0,
+0x000000c2,0x00050086,0x0000000d,0x000000d1,
+0x000000d0,0x000000cd,0x00050080,0x0000000d,
+0x000000d2,0x000000cf,0x000000d1,0x0003003e,
+0x000000cb,0x000000d2,0x0004003d,0x0000000d,
+0x000000d4,0x000000c2,0x00050041,0x0000000e,
+0x000000d5,0x00000099,0x000000d4,0x0004003d,
+0x0000000d,0x000000d6,0x000000d5,0x000500c7,
+0x0000000d,0x000000d8,0x000000d6,0x000000d7,
+0x0003003e,0x000000d3,0x000000d8,0x0004003d,
+0x0000000d,0x000000da,0x000000d3,0x000500ae,
+0x0000000f,0x000000db,0x000000da,0x000000cd,
+0x000300f7,0x000000de,0x00000000,0x000400fa,
+0x000000db,0x000000dd,0x000000e3,0x000200f8,
+0x000000dd,0x0004003d,0x0000000d,0x000000df,
+0x000000d3,0x00050082,0x0000000d,0x000000e0,
+0x000000df,0x000000cd,0x00050041,0x00000021,
+0x000000e1,0x0000008f,0x000000e0,0x0004003d,
+0x00000006,0x000000e2,0x000000e1,0x0003003e,
+0x000000dc,0x000000e2,0x000200f9,0x000000de,
+0x000200f8,0x000000e3,0x0004003d,0x0000000d,
+0x000000e4,0x000000d3,0x00050041,0x00000021,
+0x000000e5,0x00000048,0x000000e4,0x0004003d,
+0x00000006,0x000000e6,0x000000e5,0x0003003e,
+0x000000dc,0x000000e6,0x000200f9,0x000000de,
+0x000200f8,0x000000de,0x0004003d,0x00000006,
+0x000000e7,0x000000dc,0x0003003e,0x000000d9,
+0x000000e7,0x0004003d,0x00000006,0x000000e9,
+0x00000022,0x0004003d,0x00000006,0x000000ea,
+0x000000d9,0x0004003d,0x00000006,0x000000eb,
+0x00000038,0x00050084,0x00000006,0x000000ec,
+0x000000ea,0x000000eb,0x00050080,0x00000006,
+0x000000ed,0x000000e9,0x000000ec,0x0003003e,
+0x000000e8,0x000000ed,0x0004003d,0x00000006,
+0x000000ee,0x000000e8,0x00050084,0x00000006,
+0x000000ef,0x000000ee,0x00000052,0x0003003e,
+0x000000e8,0x000000ef,0x0004003d,0x00000006,
+0x000000f0,0x00000038,0x000500aa,0x0000000f,
+0x000000f1,0x000000f0,0x00000081,0x000300f7,
+0x000000f3,0x00000000,0x000400fa,0x000000f1,
+0x000000f2,0x000000f3,0x000200f8,0x000000f2,
+0x0004003d,0x00000006,0x000000f4,0x000000d9,
+0x0004003d,0x00000006,0x000000f5,0x000000e8,
+0x00050080,0x00000006,0x000000f6,0x000000f5,
+0x000000f4,0x0003003e,0x000000e8,0x000000f6,
+0x000200f9,0x000000f3,0x000200f8,0x000000f3,
+0x0004003d,0x0000000f,0x000000f7,0x00000017,
+0x000300f7,0x000000f9,0x00000000,0x000400fa,
+0x000000f7,0x000000f8,0x00000107,0x000200f8,
+0x000000f8,0x0004003d,0x00000006,0x000000fa,
+0x000000e8,0x0008000c,0x00000006,0x000000fd,
+0x00000001,0x0000002d,0x000000fa,0x000000fb,
+0x000000fc,0x0003003e,0x000000e8,0x000000fd,
+0x0004003d,0x0000000d,0x00000100,0x000000cb,
+0x0004003d,0x00000006,0x00000101,0x000000e8,
+0x0004006f,0x00000011,0x00000102,0x00000101,
+0x00050088,0x00000011,0x00000104,0x00000102,
+0x00000103,0x00050041,0x00000105,0x00000106,
+0x000000ff,0x00000100,0x0003003e,0x00000106,
+0x00000104,0x000200f9,0x000000f9,0x000200f8,
+0x00000107,0x0004003d,0x00000006,0x00000108,
+0x000000e8,0x00050080,0x00000006,0x00000109,
+0x00000108,0x00000062,0x0003003e,0x000000e8,
+0x00000109,0x0004003d,0x00000006,0x0000010a,
+0x000000e8,0x0008000c,0x00000006,0x0000010c,
+0x00000001,0x0000002d,0x0000010a,0x00000081,
+0x0000010b,0x0003003e,0x000000e8,0x0000010c,
+0x0004003d,0x0000000d,0x0000010d,0x000000cb,
+0x0004003d,0x00000006,0x0000010e,0x000000e8,
+0x0004006f,0x00000011,0x0000010f,0x0000010e,
+0x00050088,0x00000011,0x00000111,0x0000010f,
+0x00000110,0x00050041,0x00000105,0x00000112,
+0x000000ff,0x0000010d,0x0003003e,0x00000112,
+0x00000111,0x000200f9,0x000000f9,0x000200f8,
+0x000000f9,0x000200f9,0x000000c7,0x000200f8,
+0x000000c7,0x0004003d,0x0000000d,0x00000113,
+0x000000c2,0x00050080,0x0000000d,0x00000114,
+0x00000113,0x00000061,0x0003003e,0x000000c2,
+0x00000114,0x000200f9,0x000000c4,0x000200f8,
+0x000000c6,0x0004003d,0x00000013,0x00000115,
+0x000000ff,0x000200fe,0x00000115,0x00010038,
+0x00050036,0x0000000d,0x0000001c,0x00000000,
+0x0000001a,0x00030037,0x0000000e,0x0000001b,
+0x000200f8,0x0000001d,0x0004003d,0x0000000d,
+0x00000118,0x0000001b,0x000500c7,0x0000000d,
+0x0000011a,0x00000118,0x00000119,0x000500c4,
+0x0000000d,0x0000011b,0x0000011a,0x00000024,
+0x0004003d,0x0000000d,0x0000011c,0x0000001b,
+0x000500c7,0x0000000d,0x0000011e,0x0000011c,
+0x0000011d,0x000500c4,0x0000000d,0x0000011f,
+0x0000011e,0x00000052,0x000500c5,0x0000000d,
+0x00000120,0x0000011b,0x0000011f,0x0004003d,
+0x0000000d,0x00000121,0x0000001b,0x000500c7,
+0x0000000d,0x00000123,0x00000121,0x00000122,
+0x000500c2,0x0000000d,0x00000124,0x00000123,
+0x00000052,0x000500c5,0x0000000d,0x00000125,
+0x00000120,0x00000124,0x0004003d,0x0000000d,
+0x00000126,0x0000001b,0x000500c7,0x0000000d,
+0x00000128,0x00000126,0x00000127,0x000500c2,
+0x0000000d,0x00000129,0x00000128,0x00000024,
+0x000500c5,0x0000000d,0x0000012a,0x00000125,
+0x00000129,0x000200fe,0x0000012a,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_1D.inl
new file mode 100644
index 00000000000..3edeb38fb9a
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_1D.inl
@@ -0,0 +1,673 @@
+0x07230203,0x00010300,0x000d000a,0x000001d3,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x00020011,0x00000031,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x00000132,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00070005,0x0000000c,0x50746567,
+0x4431736f,0x61727241,0x69762879,0x00003b33,
+0x00030005,0x0000000b,0x00736f70,0x000e0005,
+0x00000019,0x5f636165,0x6f636564,0x735f6564,
+0x6c676e69,0x68635f65,0x656e6e61,0x6c625f6c,
+0x5f6b636f,0x616f6c66,0x31752874,0x3b31753b,
+0x003b3162,0x00040005,0x00000016,0x68676968,
+0x00000000,0x00030005,0x00000017,0x00776f6c,
+0x00050005,0x00000018,0x69537369,0x64656e67,
+0x00000000,0x00050005,0x0000001d,0x70696c66,
+0x75283233,0x00003b31,0x00030005,0x0000001c,
+0x00000061,0x00060005,0x00000024,0x65736162,
+0x646f635f,0x726f7765,0x00000064,0x00050005,
+0x0000003a,0x746c756d,0x696c7069,0x00007265,
+0x00040005,0x00000042,0x496c6274,0x00007864,
+0x00040005,0x0000004a,0x6c626174,0x00003065,
+0x00050005,0x0000008e,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000091,0x6c626174,
+0x00003165,0x00050005,0x00000096,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x0000009b,
+0x00000070,0x00030005,0x000000c4,0x00000069,
+0x00040005,0x000000cd,0x4974756f,0x00007864,
+0x00050005,0x000000d5,0x69646f6d,0x72656966,
+0x00000000,0x00060005,0x000000db,0x69646f6d,
+0x72656966,0x756c6156,0x00000065,0x00040005,
+0x000000ea,0x6f636564,0x00646564,0x00040005,
+0x00000101,0x75736572,0x0000746c,0x00030005,
+0x0000012f,0x00736f70,0x00080005,0x00000132,
+0x475f6c67,0x61626f6c,0x766e496c,0x7461636f,
+0x496e6f69,0x00000044,0x00070005,0x00000135,
+0x67616d49,0x726f4665,0x4274616d,0x6b636f6c,
+0x00000000,0x00060006,0x00000135,0x00000000,
+0x706d6f63,0x6d726f46,0x00007461,0x00060006,
+0x00000135,0x00000001,0x65736162,0x6579614c,
+0x00000072,0x00060005,0x00000137,0x75705f75,
+0x6f436873,0x6174736e,0x0000746e,0x00050005,
+0x00000142,0x42637273,0x6b636f6c,0x00000000,
+0x00050005,0x00000145,0x6d695f75,0x30656761,
+0x00000000,0x00040005,0x00000147,0x61726170,
+0x0000006d,0x00060005,0x0000014b,0x6f636564,
+0x6572706d,0x64657373,0x00000052,0x00040005,
+0x0000014c,0x61726170,0x0000006d,0x00040005,
+0x00000150,0x61726170,0x0000006d,0x00040005,
+0x00000155,0x61726170,0x0000006d,0x00040005,
+0x00000156,0x61726170,0x0000006d,0x00040005,
+0x00000157,0x61726170,0x0000006d,0x00060005,
+0x00000159,0x6f636564,0x6572706d,0x64657373,
+0x00000047,0x00040005,0x0000015a,0x61726170,
+0x0000006d,0x00040005,0x0000015e,0x61726170,
+0x0000006d,0x00040005,0x00000163,0x61726170,
+0x0000006d,0x00040005,0x00000164,0x61726170,
+0x0000006d,0x00040005,0x00000165,0x61726170,
+0x0000006d,0x00030005,0x00000167,0x00000079,
+0x00030005,0x0000016f,0x00000078,0x00050005,
+0x00000179,0x6d695f75,0x31656761,0x00000000,
+0x00040005,0x00000188,0x61726170,0x0000006d,
+0x00040047,0x00000132,0x0000000b,0x0000001c,
+0x00050048,0x00000135,0x00000000,0x00000023,
+0x00000000,0x00050048,0x00000135,0x00000001,
+0x00000023,0x00000004,0x00030047,0x00000135,
+0x00000002,0x00040047,0x00000145,0x00000022,
+0x00000000,0x00040047,0x00000145,0x00000021,
+0x00000000,0x00030047,0x00000145,0x00000018,
+0x00040047,0x00000179,0x00000022,0x00000000,
+0x00040047,0x00000179,0x00000021,0x00000001,
+0x00030047,0x00000179,0x00000019,0x00040047,
+0x000001d2,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000001,
+0x00040017,0x00000007,0x00000006,0x00000003,
+0x00040020,0x00000008,0x00000007,0x00000007,
+0x00040017,0x00000009,0x00000006,0x00000002,
+0x00040021,0x0000000a,0x00000009,0x00000008,
+0x00040015,0x0000000e,0x00000020,0x00000000,
+0x00040020,0x0000000f,0x00000007,0x0000000e,
+0x00020014,0x00000010,0x00040020,0x00000011,
+0x00000007,0x00000010,0x00030016,0x00000012,
+0x00000020,0x0004002b,0x0000000e,0x00000013,
+0x00000010,0x0004001c,0x00000014,0x00000012,
+0x00000013,0x00060021,0x00000015,0x00000014,
+0x0000000f,0x0000000f,0x00000011,0x00040021,
+0x0000001b,0x0000000e,0x0000000f,0x00040020,
+0x00000023,0x00000007,0x00000006,0x0004002b,
+0x00000006,0x00000026,0x00000018,0x0004002b,
+0x00000006,0x0000002d,0x00000080,0x0004002b,
+0x00000006,0x00000031,0x00000100,0x0004002b,
+0x00000006,0x00000035,0xffffff80,0x0004002b,
+0x00000006,0x00000039,0xffffff81,0x0004002b,
+0x00000006,0x0000003c,0x00000014,0x0004002b,
+0x00000006,0x0000003f,0x0000000f,0x0004002b,
+0x00000006,0x00000044,0x00000010,0x0004002b,
+0x0000000e,0x00000046,0x0000000f,0x00040017,
+0x00000048,0x00000006,0x00000004,0x00040020,
+0x00000049,0x00000007,0x00000048,0x0004002b,
+0x0000000e,0x0000004b,0x00000020,0x0004001c,
+0x0000004c,0x00000048,0x0000004b,0x0004002b,
+0x00000006,0x0000004d,0xfffffffd,0x0004002b,
+0x00000006,0x0000004e,0xfffffffa,0x0004002b,
+0x00000006,0x0000004f,0xfffffff7,0x0004002b,
+0x00000006,0x00000050,0xfffffff1,0x0007002c,
+0x00000048,0x00000051,0x0000004d,0x0000004e,
+0x0000004f,0x00000050,0x0004002b,0x00000006,
+0x00000052,0x00000002,0x0004002b,0x00000006,
+0x00000053,0x00000005,0x0004002b,0x00000006,
+0x00000054,0x00000008,0x0004002b,0x00000006,
+0x00000055,0x0000000e,0x0007002c,0x00000048,
+0x00000056,0x00000052,0x00000053,0x00000054,
+0x00000055,0x0004002b,0x00000006,0x00000057,
+0xfffffff9,0x0004002b,0x00000006,0x00000058,
+0xfffffff6,0x0004002b,0x00000006,0x00000059,
+0xfffffff3,0x0007002c,0x00000048,0x0000005a,
+0x0000004d,0x00000057,0x00000058,0x00000059,
+0x0004002b,0x00000006,0x0000005b,0x00000006,
+0x0004002b,0x00000006,0x0000005c,0x00000009,
+0x0004002b,0x00000006,0x0000005d,0x0000000c,
+0x0007002c,0x00000048,0x0000005e,0x00000052,
+0x0000005b,0x0000005c,0x0000005d,0x0004002b,
+0x00000006,0x0000005f,0xfffffffe,0x0004002b,
+0x00000006,0x00000060,0xfffffffb,0x0004002b,
+0x00000006,0x00000061,0xfffffff8,0x0007002c,
+0x00000048,0x00000062,0x0000005f,0x00000060,
+0x00000061,0x00000059,0x0004002b,0x00000006,
+0x00000063,0x00000001,0x0004002b,0x00000006,
+0x00000064,0x00000004,0x0004002b,0x00000006,
+0x00000065,0x00000007,0x0007002c,0x00000048,
+0x00000066,0x00000063,0x00000064,0x00000065,
+0x0000005d,0x0004002b,0x00000006,0x00000067,
+0xfffffffc,0x0007002c,0x00000048,0x00000068,
+0x0000005f,0x00000067,0x0000004e,0x00000059,
+0x0004002b,0x00000006,0x00000069,0x00000003,
+0x0007002c,0x00000048,0x0000006a,0x00000063,
+0x00000069,0x00000053,0x0000005d,0x0004002b,
+0x00000006,0x0000006b,0xfffffff4,0x0007002c,
+0x00000048,0x0000006c,0x0000004d,0x0000004e,
+0x00000061,0x0000006b,0x0004002b,0x00000006,
+0x0000006d,0x0000000b,0x0007002c,0x00000048,
+0x0000006e,0x00000052,0x00000053,0x00000065,
+0x0000006d,0x0004002b,0x00000006,0x0000006f,
+0xfffffff5,0x0007002c,0x00000048,0x00000070,
+0x0000004d,0x00000057,0x0000004f,0x0000006f,
+0x0004002b,0x00000006,0x00000071,0x0000000a,
+0x0007002c,0x00000048,0x00000072,0x00000052,
+0x0000005b,0x00000054,0x00000071,0x0007002c,
+0x00000048,0x00000073,0x00000067,0x00000057,
+0x00000061,0x0000006f,0x0007002c,0x00000048,
+0x00000074,0x00000069,0x0000005b,0x00000065,
+0x00000071,0x0007002c,0x00000048,0x00000075,
+0x0000004d,0x00000060,0x00000061,0x0000006f,
+0x0007002c,0x00000048,0x00000076,0x00000052,
+0x00000064,0x00000065,0x00000071,0x0007002c,
+0x00000048,0x00000077,0x0000005f,0x0000004e,
+0x00000061,0x00000058,0x0007002c,0x00000048,
+0x00000078,0x00000063,0x00000053,0x00000065,
+0x0000005c,0x0007002c,0x00000048,0x00000079,
+0x0000005f,0x00000060,0x00000061,0x00000058,
+0x0007002c,0x00000048,0x0000007a,0x00000063,
+0x00000064,0x00000065,0x0000005c,0x0007002c,
+0x00000048,0x0000007b,0x0000005f,0x00000067,
+0x00000061,0x00000058,0x0007002c,0x00000048,
+0x0000007c,0x00000063,0x00000069,0x00000065,
+0x0000005c,0x0007002c,0x00000048,0x0000007d,
+0x0000005f,0x00000060,0x00000057,0x00000058,
+0x0007002c,0x00000048,0x0000007e,0x00000063,
+0x00000064,0x0000005b,0x0000005c,0x0007002c,
+0x00000048,0x0000007f,0x0000004d,0x00000067,
+0x00000057,0x00000058,0x0007002c,0x00000048,
+0x00000080,0x00000052,0x00000069,0x0000005b,
+0x0000005c,0x0004002b,0x00000006,0x00000081,
+0xffffffff,0x0007002c,0x00000048,0x00000082,
+0x00000081,0x0000005f,0x0000004d,0x00000058,
+0x0004002b,0x00000006,0x00000083,0x00000000,
+0x0007002c,0x00000048,0x00000084,0x00000083,
+0x00000063,0x00000052,0x0000005c,0x0007002c,
+0x00000048,0x00000085,0x00000067,0x0000004e,
+0x00000061,0x0000004f,0x0007002c,0x00000048,
+0x00000086,0x00000069,0x00000053,0x00000065,
+0x00000054,0x0007002c,0x00000048,0x00000087,
+0x0000004d,0x00000060,0x00000057,0x0000004f,
+0x0007002c,0x00000048,0x00000088,0x00000052,
+0x00000064,0x0000005b,0x00000054,0x0023002c,
+0x0000004c,0x00000089,0x00000051,0x00000056,
+0x0000005a,0x0000005e,0x00000062,0x00000066,
+0x00000068,0x0000006a,0x0000006c,0x0000006e,
+0x00000070,0x00000072,0x00000073,0x00000074,
+0x00000075,0x00000076,0x00000077,0x00000078,
+0x00000079,0x0000007a,0x0000007b,0x0000007c,
+0x0000007d,0x0000007e,0x0000007f,0x00000080,
+0x00000082,0x00000084,0x00000085,0x00000086,
+0x00000087,0x00000088,0x0004002b,0x0000000e,
+0x0000008b,0x00000002,0x00040020,0x0000008d,
+0x00000007,0x0000004c,0x0004002b,0x0000000e,
+0x00000094,0x00000001,0x0004001c,0x00000099,
+0x0000000e,0x00000013,0x00040020,0x0000009a,
+0x00000007,0x00000099,0x0004002b,0x00000006,
+0x0000009d,0x0000000d,0x0004002b,0x00000006,
+0x000000aa,0x0000001e,0x0004002b,0x00000006,
+0x000000ae,0x0000001b,0x0004002b,0x00000006,
+0x000000b3,0x00000015,0x0004002b,0x00000006,
+0x000000b6,0x00000012,0x0004002b,0x0000000e,
+0x000000c5,0x00000000,0x0004002b,0x0000000e,
+0x000000cf,0x00000004,0x0004002b,0x0000000e,
+0x000000d9,0x00000007,0x0004002b,0x00000006,
+0x000000fd,0xfffffc01,0x0004002b,0x00000006,
+0x000000fe,0x000003ff,0x00040020,0x00000100,
+0x00000007,0x00000014,0x0004002b,0x00000012,
+0x00000105,0x447fc000,0x00040020,0x00000107,
+0x00000007,0x00000012,0x0004002b,0x00000006,
+0x0000010d,0x000007ff,0x0004002b,0x00000012,
+0x00000112,0x44ffe000,0x0004002b,0x0000000e,
+0x0000011b,0x000000ff,0x0004002b,0x0000000e,
+0x0000011f,0x0000ff00,0x0004002b,0x0000000e,
+0x00000124,0x00ff0000,0x0004002b,0x0000000e,
+0x00000129,0xff000000,0x00040017,0x00000130,
+0x0000000e,0x00000003,0x00040020,0x00000131,
+0x00000001,0x00000130,0x0004003b,0x00000131,
+0x00000132,0x00000001,0x0004001e,0x00000135,
+0x0000000e,0x0000000e,0x00040020,0x00000136,
+0x00000009,0x00000135,0x0004003b,0x00000136,
+0x00000137,0x00000009,0x00040020,0x00000138,
+0x00000009,0x0000000e,0x00040017,0x00000140,
+0x0000000e,0x00000004,0x00040020,0x00000141,
+0x00000007,0x00000140,0x00090019,0x00000143,
+0x0000000e,0x00000000,0x00000000,0x00000001,
+0x00000000,0x00000002,0x0000001e,0x00040020,
+0x00000144,0x00000000,0x00000143,0x0004003b,
+0x00000144,0x00000145,0x00000000,0x00030029,
+0x00000010,0x00000154,0x0004002b,0x0000000e,
+0x0000015f,0x00000003,0x00090019,0x00000177,
+0x00000012,0x00000000,0x00000000,0x00000001,
+0x00000000,0x00000002,0x00000011,0x00040020,
+0x00000178,0x00000000,0x00000177,0x0004003b,
+0x00000178,0x00000179,0x00000000,0x0004002b,
+0x00000012,0x00000196,0x00000000,0x0004002b,
+0x00000012,0x00000197,0x3f800000,0x00040017,
+0x00000198,0x00000012,0x00000004,0x0004002b,
+0x0000000e,0x0000019e,0x00000093,0x0004002b,
+0x0000000e,0x0000019f,0x00000094,0x0004002b,
+0x0000000e,0x000001a0,0x00000095,0x0004002b,
+0x0000000e,0x000001a1,0x00000096,0x0004002b,
+0x0000000e,0x000001a2,0x00000097,0x0004002b,
+0x0000000e,0x000001a3,0x00000098,0x0004002b,
+0x0000000e,0x000001a4,0x00000099,0x0004002b,
+0x0000000e,0x000001a5,0x0000009a,0x0004002b,
+0x0000000e,0x000001a6,0x0000009b,0x0004002b,
+0x0000000e,0x000001a7,0x0000009c,0x0004002b,
+0x0000000e,0x000001a8,0x00000008,0x0004001c,
+0x000001a9,0x00000006,0x000001a8,0x000b002c,
+0x000001a9,0x000001aa,0x00000083,0x00000063,
+0x00000052,0x00000069,0x00000067,0x0000004d,
+0x0000005f,0x00000081,0x0004001c,0x000001ab,
+0x00000048,0x000001a8,0x0007002c,0x00000048,
+0x000001ac,0x00000052,0x00000054,0x0000005f,
+0x00000061,0x0004002b,0x00000006,0x000001ad,
+0x00000011,0x0004002b,0x00000006,0x000001ae,
+0xffffffef,0x0007002c,0x00000048,0x000001af,
+0x00000053,0x000001ad,0x00000060,0x000001ae,
+0x0004002b,0x00000006,0x000001b0,0x0000001d,
+0x0004002b,0x00000006,0x000001b1,0xffffffe3,
+0x0007002c,0x00000048,0x000001b2,0x0000005c,
+0x000001b0,0x0000004f,0x000001b1,0x0004002b,
+0x00000006,0x000001b3,0x0000002a,0x0004002b,
+0x00000006,0x000001b4,0xffffffd6,0x0007002c,
+0x00000048,0x000001b5,0x0000009d,0x000001b3,
+0x00000059,0x000001b4,0x0004002b,0x00000006,
+0x000001b6,0x0000003c,0x0004002b,0x00000006,
+0x000001b7,0xffffffee,0x0004002b,0x00000006,
+0x000001b8,0xffffffc4,0x0007002c,0x00000048,
+0x000001b9,0x000000b6,0x000001b6,0x000001b7,
+0x000001b8,0x0004002b,0x00000006,0x000001ba,
+0x00000050,0x0004002b,0x00000006,0x000001bb,
+0xffffffe8,0x0004002b,0x00000006,0x000001bc,
+0xffffffb0,0x0007002c,0x00000048,0x000001bd,
+0x00000026,0x000001ba,0x000001bb,0x000001bc,
+0x0004002b,0x00000006,0x000001be,0x00000021,
+0x0004002b,0x00000006,0x000001bf,0x0000006a,
+0x0004002b,0x00000006,0x000001c0,0xffffffdf,
+0x0004002b,0x00000006,0x000001c1,0xffffff96,
+0x0007002c,0x00000048,0x000001c2,0x000001be,
+0x000001bf,0x000001c0,0x000001c1,0x0004002b,
+0x00000006,0x000001c3,0x0000002f,0x0004002b,
+0x00000006,0x000001c4,0x000000b7,0x0004002b,
+0x00000006,0x000001c5,0xffffffd1,0x0004002b,
+0x00000006,0x000001c6,0xffffff49,0x0007002c,
+0x00000048,0x000001c7,0x000001c3,0x000001c4,
+0x000001c5,0x000001c6,0x000b002c,0x000001ab,
+0x000001c8,0x000001ac,0x000001af,0x000001b2,
+0x000001b5,0x000001b9,0x000001bd,0x000001c2,
+0x000001c7,0x0007002c,0x00000048,0x000001c9,
+0x00000083,0x00000054,0x00000083,0x00000061,
+0x0007002c,0x00000048,0x000001ca,0x00000083,
+0x000001ad,0x00000083,0x000001ae,0x0007002c,
+0x00000048,0x000001cb,0x00000083,0x000001b0,
+0x00000083,0x000001b1,0x0007002c,0x00000048,
+0x000001cc,0x00000083,0x000001b3,0x00000083,
+0x000001b4,0x0007002c,0x00000048,0x000001cd,
+0x00000083,0x000001b6,0x00000083,0x000001b8,
+0x0007002c,0x00000048,0x000001ce,0x00000083,
+0x000001ba,0x00000083,0x000001bc,0x0007002c,
+0x00000048,0x000001cf,0x00000083,0x000001bf,
+0x00000083,0x000001c1,0x0007002c,0x00000048,
+0x000001d0,0x00000083,0x000001c4,0x00000083,
+0x000001c6,0x000b002c,0x000001ab,0x000001d1,
+0x000001c9,0x000001ca,0x000001cb,0x000001cc,
+0x000001cd,0x000001ce,0x000001cf,0x000001d0,
+0x0006002c,0x00000130,0x000001d2,0x000001a8,
+0x000001a8,0x00000094,0x00050036,0x00000002,
+0x00000004,0x00000000,0x00000003,0x000200f8,
+0x00000005,0x0004003b,0x00000008,0x0000012f,
+0x00000007,0x0004003b,0x00000141,0x00000142,
+0x00000007,0x0004003b,0x00000008,0x00000147,
+0x00000007,0x0004003b,0x00000100,0x0000014b,
+0x00000007,0x0004003b,0x0000000f,0x0000014c,
+0x00000007,0x0004003b,0x0000000f,0x00000150,
+0x00000007,0x0004003b,0x0000000f,0x00000155,
+0x00000007,0x0004003b,0x0000000f,0x00000156,
+0x00000007,0x0004003b,0x00000011,0x00000157,
+0x00000007,0x0004003b,0x00000100,0x00000159,
+0x00000007,0x0004003b,0x0000000f,0x0000015a,
+0x00000007,0x0004003b,0x0000000f,0x0000015e,
+0x00000007,0x0004003b,0x0000000f,0x00000163,
+0x00000007,0x0004003b,0x0000000f,0x00000164,
+0x00000007,0x0004003b,0x00000011,0x00000165,
+0x00000007,0x0004003b,0x00000023,0x00000167,
+0x00000007,0x0004003b,0x00000023,0x0000016f,
+0x00000007,0x0004003b,0x00000008,0x00000188,
+0x00000007,0x0004003d,0x00000130,0x00000133,
+0x00000132,0x0004007c,0x00000007,0x00000134,
+0x00000133,0x0003003e,0x0000012f,0x00000134,
+0x00050041,0x00000138,0x00000139,0x00000137,
+0x00000063,0x0004003d,0x0000000e,0x0000013a,
+0x00000139,0x0004007c,0x00000006,0x0000013b,
+0x0000013a,0x00050041,0x00000023,0x0000013c,
+0x0000012f,0x0000008b,0x0004003d,0x00000006,
+0x0000013d,0x0000013c,0x00050080,0x00000006,
+0x0000013e,0x0000013d,0x0000013b,0x00050041,
+0x00000023,0x0000013f,0x0000012f,0x0000008b,
+0x0003003e,0x0000013f,0x0000013e,0x0004003d,
+0x00000143,0x00000146,0x00000145,0x0004003d,
+0x00000007,0x00000148,0x0000012f,0x0003003e,
+0x00000147,0x00000148,0x00050039,0x00000009,
+0x00000149,0x0000000c,0x00000147,0x00050062,
+0x00000140,0x0000014a,0x00000146,0x00000149,
+0x0003003e,0x00000142,0x0000014a,0x00050041,
+0x0000000f,0x0000014d,0x00000142,0x000000c5,
+0x0004003d,0x0000000e,0x0000014e,0x0000014d,
+0x0003003e,0x0000014c,0x0000014e,0x00050039,
+0x0000000e,0x0000014f,0x0000001d,0x0000014c,
+0x00050041,0x0000000f,0x00000151,0x00000142,
+0x00000094,0x0004003d,0x0000000e,0x00000152,
+0x00000151,0x0003003e,0x00000150,0x00000152,
+0x00050039,0x0000000e,0x00000153,0x0000001d,
+0x00000150,0x0003003e,0x00000155,0x0000014f,
+0x0003003e,0x00000156,0x00000153,0x0003003e,
+0x00000157,0x00000154,0x00070039,0x00000014,
+0x00000158,0x00000019,0x00000155,0x00000156,
+0x00000157,0x0003003e,0x0000014b,0x00000158,
+0x00050041,0x0000000f,0x0000015b,0x00000142,
+0x0000008b,0x0004003d,0x0000000e,0x0000015c,
+0x0000015b,0x0003003e,0x0000015a,0x0000015c,
+0x00050039,0x0000000e,0x0000015d,0x0000001d,
+0x0000015a,0x00050041,0x0000000f,0x00000160,
+0x00000142,0x0000015f,0x0004003d,0x0000000e,
+0x00000161,0x00000160,0x0003003e,0x0000015e,
+0x00000161,0x00050039,0x0000000e,0x00000162,
+0x0000001d,0x0000015e,0x0003003e,0x00000163,
+0x0000015d,0x0003003e,0x00000164,0x00000162,
+0x0003003e,0x00000165,0x00000154,0x00070039,
+0x00000014,0x00000166,0x00000019,0x00000163,
+0x00000164,0x00000165,0x0003003e,0x00000159,
+0x00000166,0x0003003e,0x00000167,0x00000083,
+0x000200f9,0x00000168,0x000200f8,0x00000168,
+0x000400f6,0x0000016a,0x0000016b,0x00000000,
+0x000200f9,0x0000016c,0x000200f8,0x0000016c,
+0x0004003d,0x00000006,0x0000016d,0x00000167,
+0x000500b1,0x00000010,0x0000016e,0x0000016d,
+0x00000063,0x000400fa,0x0000016e,0x00000169,
+0x0000016a,0x000200f8,0x00000169,0x0003003e,
+0x0000016f,0x00000083,0x000200f9,0x00000170,
+0x000200f8,0x00000170,0x000400f6,0x00000172,
+0x00000173,0x00000000,0x000200f9,0x00000174,
+0x000200f8,0x00000174,0x0004003d,0x00000006,
+0x00000175,0x0000016f,0x000500b1,0x00000010,
+0x00000176,0x00000175,0x00000064,0x000400fa,
+0x00000176,0x00000171,0x00000172,0x000200f8,
+0x00000171,0x0004003d,0x00000177,0x0000017a,
+0x00000179,0x0004003d,0x00000007,0x0000017b,
+0x0000012f,0x0007004f,0x00000009,0x0000017c,
+0x0000017b,0x0000017b,0x00000000,0x00000001,
+0x00050050,0x00000009,0x0000017d,0x00000064,
+0x00000064,0x00050084,0x00000009,0x0000017e,
+0x0000017c,0x0000017d,0x0004003d,0x00000006,
+0x0000017f,0x0000016f,0x0004003d,0x00000006,
+0x00000180,0x00000167,0x00050050,0x00000009,
+0x00000181,0x0000017f,0x00000180,0x00050080,
+0x00000009,0x00000182,0x0000017e,0x00000181,
+0x00050041,0x00000023,0x00000183,0x0000012f,
+0x0000008b,0x0004003d,0x00000006,0x00000184,
+0x00000183,0x00050051,0x00000006,0x00000185,
+0x00000182,0x00000000,0x00050051,0x00000006,
+0x00000186,0x00000182,0x00000001,0x00060050,
+0x00000007,0x00000187,0x00000185,0x00000186,
+0x00000184,0x0003003e,0x00000188,0x00000187,
+0x00050039,0x00000009,0x00000189,0x0000000c,
+0x00000188,0x0004003d,0x00000006,0x0000018a,
+0x00000167,0x00050084,0x00000006,0x0000018b,
+0x0000018a,0x00000064,0x0004003d,0x00000006,
+0x0000018c,0x0000016f,0x00050080,0x00000006,
+0x0000018d,0x0000018b,0x0000018c,0x00050041,
+0x00000107,0x0000018e,0x0000014b,0x0000018d,
+0x0004003d,0x00000012,0x0000018f,0x0000018e,
+0x0004003d,0x00000006,0x00000190,0x00000167,
+0x00050084,0x00000006,0x00000191,0x00000190,
+0x00000064,0x0004003d,0x00000006,0x00000192,
+0x0000016f,0x00050080,0x00000006,0x00000193,
+0x00000191,0x00000192,0x00050041,0x00000107,
+0x00000194,0x00000159,0x00000193,0x0004003d,
+0x00000012,0x00000195,0x00000194,0x00070050,
+0x00000198,0x00000199,0x0000018f,0x00000195,
+0x00000196,0x00000197,0x00040063,0x0000017a,
+0x00000189,0x00000199,0x000200f9,0x00000173,
+0x000200f8,0x00000173,0x0004003d,0x00000006,
+0x0000019a,0x0000016f,0x00050080,0x00000006,
+0x0000019b,0x0000019a,0x00000063,0x0003003e,
+0x0000016f,0x0000019b,0x000200f9,0x00000170,
+0x000200f8,0x00000172,0x000200f9,0x0000016b,
+0x000200f8,0x0000016b,0x0004003d,0x00000006,
+0x0000019c,0x00000167,0x00050080,0x00000006,
+0x0000019d,0x0000019c,0x00000063,0x0003003e,
+0x00000167,0x0000019d,0x000200f9,0x00000168,
+0x000200f8,0x0000016a,0x000100fd,0x00010038,
+0x00050036,0x00000009,0x0000000c,0x00000000,
+0x0000000a,0x00030037,0x00000008,0x0000000b,
+0x000200f8,0x0000000d,0x0004003d,0x00000007,
+0x0000001f,0x0000000b,0x0007004f,0x00000009,
+0x00000020,0x0000001f,0x0000001f,0x00000000,
+0x00000002,0x000200fe,0x00000020,0x00010038,
+0x00050036,0x00000014,0x00000019,0x00000000,
+0x00000015,0x00030037,0x0000000f,0x00000016,
+0x00030037,0x0000000f,0x00000017,0x00030037,
+0x00000011,0x00000018,0x000200f8,0x0000001a,
+0x0004003b,0x00000023,0x00000024,0x00000007,
+0x0004003b,0x00000023,0x0000003a,0x00000007,
+0x0004003b,0x0000000f,0x00000042,0x00000007,
+0x0004003b,0x00000049,0x0000004a,0x00000007,
+0x0004003b,0x0000008d,0x0000008e,0x00000007,
+0x0004003b,0x00000049,0x00000091,0x00000007,
+0x0004003b,0x0000008d,0x00000096,0x00000007,
+0x0004003b,0x0000009a,0x0000009b,0x00000007,
+0x0004003b,0x0000000f,0x000000c4,0x00000007,
+0x0004003b,0x0000000f,0x000000cd,0x00000007,
+0x0004003b,0x0000000f,0x000000d5,0x00000007,
+0x0004003b,0x00000023,0x000000db,0x00000007,
+0x0004003b,0x00000023,0x000000de,0x00000007,
+0x0004003b,0x00000023,0x000000ea,0x00000007,
+0x0004003b,0x00000100,0x00000101,0x00000007,
+0x0004003d,0x0000000e,0x00000025,0x00000016,
+0x000500c2,0x0000000e,0x00000027,0x00000025,
+0x00000026,0x0004007c,0x00000006,0x00000028,
+0x00000027,0x0003003e,0x00000024,0x00000028,
+0x0004003d,0x00000010,0x00000029,0x00000018,
+0x000300f7,0x0000002b,0x00000000,0x000400fa,
+0x00000029,0x0000002a,0x0000002b,0x000200f8,
+0x0000002a,0x0004003d,0x00000006,0x0000002c,
+0x00000024,0x000500af,0x00000010,0x0000002e,
+0x0000002c,0x0000002d,0x000300f7,0x00000030,
+0x00000000,0x000400fa,0x0000002e,0x0000002f,
+0x00000030,0x000200f8,0x0000002f,0x0004003d,
+0x00000006,0x00000032,0x00000024,0x00050082,
+0x00000006,0x00000033,0x00000032,0x00000031,
+0x0003003e,0x00000024,0x00000033,0x000200f9,
+0x00000030,0x000200f8,0x00000030,0x0004003d,
+0x00000006,0x00000034,0x00000024,0x000500aa,
+0x00000010,0x00000036,0x00000034,0x00000035,
+0x000300f7,0x00000038,0x00000000,0x000400fa,
+0x00000036,0x00000037,0x00000038,0x000200f8,
+0x00000037,0x0003003e,0x00000024,0x00000039,
+0x000200f9,0x00000038,0x000200f8,0x00000038,
+0x000200f9,0x0000002b,0x000200f8,0x0000002b,
+0x0004003d,0x0000000e,0x0000003b,0x00000016,
+0x000500c2,0x0000000e,0x0000003d,0x0000003b,
+0x0000003c,0x0004007c,0x00000006,0x0000003e,
+0x0000003d,0x0003003e,0x0000003a,0x0000003e,
+0x0004003d,0x00000006,0x00000040,0x0000003a,
+0x000500c7,0x00000006,0x00000041,0x00000040,
+0x0000003f,0x0003003e,0x0000003a,0x00000041,
+0x0004003d,0x0000000e,0x00000043,0x00000016,
+0x000500c2,0x0000000e,0x00000045,0x00000043,
+0x00000044,0x000500c7,0x0000000e,0x00000047,
+0x00000045,0x00000046,0x0003003e,0x00000042,
+0x00000047,0x0004003d,0x0000000e,0x0000008a,
+0x00000042,0x00050084,0x0000000e,0x0000008c,
+0x0000008a,0x0000008b,0x0003003e,0x0000008e,
+0x00000089,0x00050041,0x00000049,0x0000008f,
+0x0000008e,0x0000008c,0x0004003d,0x00000048,
+0x00000090,0x0000008f,0x0003003e,0x0000004a,
+0x00000090,0x0004003d,0x0000000e,0x00000092,
+0x00000042,0x00050084,0x0000000e,0x00000093,
+0x00000092,0x0000008b,0x00050080,0x0000000e,
+0x00000095,0x00000093,0x00000094,0x0003003e,
+0x00000096,0x00000089,0x00050041,0x00000049,
+0x00000097,0x00000096,0x00000095,0x0004003d,
+0x00000048,0x00000098,0x00000097,0x0003003e,
+0x00000091,0x00000098,0x0004003d,0x0000000e,
+0x0000009c,0x00000016,0x000500c2,0x0000000e,
+0x0000009e,0x0000009c,0x0000009d,0x0004003d,
+0x0000000e,0x0000009f,0x00000016,0x000500c2,
+0x0000000e,0x000000a0,0x0000009f,0x00000071,
+0x0004003d,0x0000000e,0x000000a1,0x00000016,
+0x000500c2,0x0000000e,0x000000a2,0x000000a1,
+0x00000065,0x0004003d,0x0000000e,0x000000a3,
+0x00000016,0x000500c2,0x0000000e,0x000000a4,
+0x000000a3,0x00000064,0x0004003d,0x0000000e,
+0x000000a5,0x00000016,0x000500c2,0x0000000e,
+0x000000a6,0x000000a5,0x00000063,0x0004003d,
+0x0000000e,0x000000a7,0x00000016,0x000500c4,
+0x0000000e,0x000000a8,0x000000a7,0x00000052,
+0x0004003d,0x0000000e,0x000000a9,0x00000017,
+0x000500c2,0x0000000e,0x000000ab,0x000000a9,
+0x000000aa,0x000500c5,0x0000000e,0x000000ac,
+0x000000a8,0x000000ab,0x0004003d,0x0000000e,
+0x000000ad,0x00000017,0x000500c2,0x0000000e,
+0x000000af,0x000000ad,0x000000ae,0x0004003d,
+0x0000000e,0x000000b0,0x00000017,0x000500c2,
+0x0000000e,0x000000b1,0x000000b0,0x00000026,
+0x0004003d,0x0000000e,0x000000b2,0x00000017,
+0x000500c2,0x0000000e,0x000000b4,0x000000b2,
+0x000000b3,0x0004003d,0x0000000e,0x000000b5,
+0x00000017,0x000500c2,0x0000000e,0x000000b7,
+0x000000b5,0x000000b6,0x0004003d,0x0000000e,
+0x000000b8,0x00000017,0x000500c2,0x0000000e,
+0x000000b9,0x000000b8,0x0000003f,0x0004003d,
+0x0000000e,0x000000ba,0x00000017,0x000500c2,
+0x0000000e,0x000000bb,0x000000ba,0x0000005d,
+0x0004003d,0x0000000e,0x000000bc,0x00000017,
+0x000500c2,0x0000000e,0x000000bd,0x000000bc,
+0x0000005c,0x0004003d,0x0000000e,0x000000be,
+0x00000017,0x000500c2,0x0000000e,0x000000bf,
+0x000000be,0x0000005b,0x0004003d,0x0000000e,
+0x000000c0,0x00000017,0x000500c2,0x0000000e,
+0x000000c1,0x000000c0,0x00000069,0x0004003d,
+0x0000000e,0x000000c2,0x00000017,0x00130050,
+0x00000099,0x000000c3,0x0000009e,0x000000a0,
+0x000000a2,0x000000a4,0x000000a6,0x000000ac,
+0x000000af,0x000000b1,0x000000b4,0x000000b7,
+0x000000b9,0x000000bb,0x000000bd,0x000000bf,
+0x000000c1,0x000000c2,0x0003003e,0x0000009b,
+0x000000c3,0x0003003e,0x000000c4,0x000000c5,
+0x000200f9,0x000000c6,0x000200f8,0x000000c6,
+0x000400f6,0x000000c8,0x000000c9,0x00000000,
+0x000200f9,0x000000ca,0x000200f8,0x000000ca,
+0x0004003d,0x0000000e,0x000000cb,0x000000c4,
+0x000500b0,0x00000010,0x000000cc,0x000000cb,
+0x00000013,0x000400fa,0x000000cc,0x000000c7,
+0x000000c8,0x000200f8,0x000000c7,0x0004003d,
+0x0000000e,0x000000ce,0x000000c4,0x00050089,
+0x0000000e,0x000000d0,0x000000ce,0x000000cf,
+0x00050084,0x0000000e,0x000000d1,0x000000d0,
+0x000000cf,0x0004003d,0x0000000e,0x000000d2,
+0x000000c4,0x00050086,0x0000000e,0x000000d3,
+0x000000d2,0x000000cf,0x00050080,0x0000000e,
+0x000000d4,0x000000d1,0x000000d3,0x0003003e,
+0x000000cd,0x000000d4,0x0004003d,0x0000000e,
+0x000000d6,0x000000c4,0x00050041,0x0000000f,
+0x000000d7,0x0000009b,0x000000d6,0x0004003d,
+0x0000000e,0x000000d8,0x000000d7,0x000500c7,
+0x0000000e,0x000000da,0x000000d8,0x000000d9,
+0x0003003e,0x000000d5,0x000000da,0x0004003d,
+0x0000000e,0x000000dc,0x000000d5,0x000500ae,
+0x00000010,0x000000dd,0x000000dc,0x000000cf,
+0x000300f7,0x000000e0,0x00000000,0x000400fa,
+0x000000dd,0x000000df,0x000000e5,0x000200f8,
+0x000000df,0x0004003d,0x0000000e,0x000000e1,
+0x000000d5,0x00050082,0x0000000e,0x000000e2,
+0x000000e1,0x000000cf,0x00050041,0x00000023,
+0x000000e3,0x00000091,0x000000e2,0x0004003d,
+0x00000006,0x000000e4,0x000000e3,0x0003003e,
+0x000000de,0x000000e4,0x000200f9,0x000000e0,
+0x000200f8,0x000000e5,0x0004003d,0x0000000e,
+0x000000e6,0x000000d5,0x00050041,0x00000023,
+0x000000e7,0x0000004a,0x000000e6,0x0004003d,
+0x00000006,0x000000e8,0x000000e7,0x0003003e,
+0x000000de,0x000000e8,0x000200f9,0x000000e0,
+0x000200f8,0x000000e0,0x0004003d,0x00000006,
+0x000000e9,0x000000de,0x0003003e,0x000000db,
+0x000000e9,0x0004003d,0x00000006,0x000000eb,
+0x00000024,0x0004003d,0x00000006,0x000000ec,
+0x000000db,0x0004003d,0x00000006,0x000000ed,
+0x0000003a,0x00050084,0x00000006,0x000000ee,
+0x000000ec,0x000000ed,0x00050080,0x00000006,
+0x000000ef,0x000000eb,0x000000ee,0x0003003e,
+0x000000ea,0x000000ef,0x0004003d,0x00000006,
+0x000000f0,0x000000ea,0x00050084,0x00000006,
+0x000000f1,0x000000f0,0x00000054,0x0003003e,
+0x000000ea,0x000000f1,0x0004003d,0x00000006,
+0x000000f2,0x0000003a,0x000500aa,0x00000010,
+0x000000f3,0x000000f2,0x00000083,0x000300f7,
+0x000000f5,0x00000000,0x000400fa,0x000000f3,
+0x000000f4,0x000000f5,0x000200f8,0x000000f4,
+0x0004003d,0x00000006,0x000000f6,0x000000db,
+0x0004003d,0x00000006,0x000000f7,0x000000ea,
+0x00050080,0x00000006,0x000000f8,0x000000f7,
+0x000000f6,0x0003003e,0x000000ea,0x000000f8,
+0x000200f9,0x000000f5,0x000200f8,0x000000f5,
+0x0004003d,0x00000010,0x000000f9,0x00000018,
+0x000300f7,0x000000fb,0x00000000,0x000400fa,
+0x000000f9,0x000000fa,0x00000109,0x000200f8,
+0x000000fa,0x0004003d,0x00000006,0x000000fc,
+0x000000ea,0x0008000c,0x00000006,0x000000ff,
+0x00000001,0x0000002d,0x000000fc,0x000000fd,
+0x000000fe,0x0003003e,0x000000ea,0x000000ff,
+0x0004003d,0x0000000e,0x00000102,0x000000cd,
+0x0004003d,0x00000006,0x00000103,0x000000ea,
+0x0004006f,0x00000012,0x00000104,0x00000103,
+0x00050088,0x00000012,0x00000106,0x00000104,
+0x00000105,0x00050041,0x00000107,0x00000108,
+0x00000101,0x00000102,0x0003003e,0x00000108,
+0x00000106,0x000200f9,0x000000fb,0x000200f8,
+0x00000109,0x0004003d,0x00000006,0x0000010a,
+0x000000ea,0x00050080,0x00000006,0x0000010b,
+0x0000010a,0x00000064,0x0003003e,0x000000ea,
+0x0000010b,0x0004003d,0x00000006,0x0000010c,
+0x000000ea,0x0008000c,0x00000006,0x0000010e,
+0x00000001,0x0000002d,0x0000010c,0x00000083,
+0x0000010d,0x0003003e,0x000000ea,0x0000010e,
+0x0004003d,0x0000000e,0x0000010f,0x000000cd,
+0x0004003d,0x00000006,0x00000110,0x000000ea,
+0x0004006f,0x00000012,0x00000111,0x00000110,
+0x00050088,0x00000012,0x00000113,0x00000111,
+0x00000112,0x00050041,0x00000107,0x00000114,
+0x00000101,0x0000010f,0x0003003e,0x00000114,
+0x00000113,0x000200f9,0x000000fb,0x000200f8,
+0x000000fb,0x000200f9,0x000000c9,0x000200f8,
+0x000000c9,0x0004003d,0x0000000e,0x00000115,
+0x000000c4,0x00050080,0x0000000e,0x00000116,
+0x00000115,0x00000063,0x0003003e,0x000000c4,
+0x00000116,0x000200f9,0x000000c6,0x000200f8,
+0x000000c8,0x0004003d,0x00000014,0x00000117,
+0x00000101,0x000200fe,0x00000117,0x00010038,
+0x00050036,0x0000000e,0x0000001d,0x00000000,
+0x0000001b,0x00030037,0x0000000f,0x0000001c,
+0x000200f8,0x0000001e,0x0004003d,0x0000000e,
+0x0000011a,0x0000001c,0x000500c7,0x0000000e,
+0x0000011c,0x0000011a,0x0000011b,0x000500c4,
+0x0000000e,0x0000011d,0x0000011c,0x00000026,
+0x0004003d,0x0000000e,0x0000011e,0x0000001c,
+0x000500c7,0x0000000e,0x00000120,0x0000011e,
+0x0000011f,0x000500c4,0x0000000e,0x00000121,
+0x00000120,0x00000054,0x000500c5,0x0000000e,
+0x00000122,0x0000011d,0x00000121,0x0004003d,
+0x0000000e,0x00000123,0x0000001c,0x000500c7,
+0x0000000e,0x00000125,0x00000123,0x00000124,
+0x000500c2,0x0000000e,0x00000126,0x00000125,
+0x00000054,0x000500c5,0x0000000e,0x00000127,
+0x00000122,0x00000126,0x0004003d,0x0000000e,
+0x00000128,0x0000001c,0x000500c7,0x0000000e,
+0x0000012a,0x00000128,0x00000129,0x000500c2,
+0x0000000e,0x0000012b,0x0000012a,0x00000026,
+0x000500c5,0x0000000e,0x0000012c,0x00000127,
+0x0000012b,0x000200fe,0x0000012c,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_2D.inl
new file mode 100644
index 00000000000..5905a1dac2b
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_2D.inl
@@ -0,0 +1,671 @@
+0x07230203,0x00010300,0x000d000a,0x000001d2,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x00000031,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000130,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00070005,
+0x0000000b,0x50746567,0x4432736f,0x61727241,
+0x69762879,0x00003b33,0x00030005,0x0000000a,
+0x00736f70,0x000e0005,0x00000018,0x5f636165,
+0x6f636564,0x735f6564,0x6c676e69,0x68635f65,
+0x656e6e61,0x6c625f6c,0x5f6b636f,0x616f6c66,
+0x31752874,0x3b31753b,0x003b3162,0x00040005,
+0x00000015,0x68676968,0x00000000,0x00030005,
+0x00000016,0x00776f6c,0x00050005,0x00000017,
+0x69537369,0x64656e67,0x00000000,0x00050005,
+0x0000001c,0x70696c66,0x75283233,0x00003b31,
+0x00030005,0x0000001b,0x00000061,0x00060005,
+0x00000022,0x65736162,0x646f635f,0x726f7765,
+0x00000064,0x00050005,0x00000038,0x746c756d,
+0x696c7069,0x00007265,0x00040005,0x00000040,
+0x496c6274,0x00007864,0x00040005,0x00000048,
+0x6c626174,0x00003065,0x00050005,0x0000008c,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x0000008f,0x6c626174,0x00003165,0x00050005,
+0x00000094,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x00000099,0x00000070,0x00030005,
+0x000000c2,0x00000069,0x00040005,0x000000cb,
+0x4974756f,0x00007864,0x00050005,0x000000d3,
+0x69646f6d,0x72656966,0x00000000,0x00060005,
+0x000000d9,0x69646f6d,0x72656966,0x756c6156,
+0x00000065,0x00040005,0x000000e8,0x6f636564,
+0x00646564,0x00040005,0x000000ff,0x75736572,
+0x0000746c,0x00030005,0x0000012d,0x00736f70,
+0x00080005,0x00000130,0x475f6c67,0x61626f6c,
+0x766e496c,0x7461636f,0x496e6f69,0x00000044,
+0x00070005,0x00000133,0x67616d49,0x726f4665,
+0x4274616d,0x6b636f6c,0x00000000,0x00060006,
+0x00000133,0x00000000,0x706d6f63,0x6d726f46,
+0x00007461,0x00060006,0x00000133,0x00000001,
+0x65736162,0x6579614c,0x00000072,0x00060005,
+0x00000135,0x75705f75,0x6f436873,0x6174736e,
+0x0000746e,0x00050005,0x00000140,0x42637273,
+0x6b636f6c,0x00000000,0x00050005,0x00000143,
+0x6d695f75,0x30656761,0x00000000,0x00040005,
+0x00000145,0x61726170,0x0000006d,0x00060005,
+0x00000149,0x6f636564,0x6572706d,0x64657373,
+0x00000052,0x00040005,0x0000014a,0x61726170,
+0x0000006d,0x00040005,0x0000014e,0x61726170,
+0x0000006d,0x00040005,0x00000153,0x61726170,
+0x0000006d,0x00040005,0x00000154,0x61726170,
+0x0000006d,0x00040005,0x00000155,0x61726170,
+0x0000006d,0x00060005,0x00000157,0x6f636564,
+0x6572706d,0x64657373,0x00000047,0x00040005,
+0x00000158,0x61726170,0x0000006d,0x00040005,
+0x0000015c,0x61726170,0x0000006d,0x00040005,
+0x00000161,0x61726170,0x0000006d,0x00040005,
+0x00000162,0x61726170,0x0000006d,0x00040005,
+0x00000163,0x61726170,0x0000006d,0x00030005,
+0x00000165,0x00000079,0x00030005,0x0000016d,
+0x00000078,0x00050005,0x00000177,0x6d695f75,
+0x31656761,0x00000000,0x00040005,0x00000187,
+0x61726170,0x0000006d,0x00040047,0x00000130,
+0x0000000b,0x0000001c,0x00050048,0x00000133,
+0x00000000,0x00000023,0x00000000,0x00050048,
+0x00000133,0x00000001,0x00000023,0x00000004,
+0x00030047,0x00000133,0x00000002,0x00040047,
+0x00000143,0x00000022,0x00000000,0x00040047,
+0x00000143,0x00000021,0x00000000,0x00030047,
+0x00000143,0x00000018,0x00040047,0x00000177,
+0x00000022,0x00000000,0x00040047,0x00000177,
+0x00000021,0x00000001,0x00030047,0x00000177,
+0x00000019,0x00040047,0x000001d1,0x0000000b,
+0x00000019,0x00020013,0x00000002,0x00030021,
+0x00000003,0x00000002,0x00040015,0x00000006,
+0x00000020,0x00000001,0x00040017,0x00000007,
+0x00000006,0x00000003,0x00040020,0x00000008,
+0x00000007,0x00000007,0x00040021,0x00000009,
+0x00000007,0x00000008,0x00040015,0x0000000d,
+0x00000020,0x00000000,0x00040020,0x0000000e,
+0x00000007,0x0000000d,0x00020014,0x0000000f,
+0x00040020,0x00000010,0x00000007,0x0000000f,
+0x00030016,0x00000011,0x00000020,0x0004002b,
+0x0000000d,0x00000012,0x00000010,0x0004001c,
+0x00000013,0x00000011,0x00000012,0x00060021,
+0x00000014,0x00000013,0x0000000e,0x0000000e,
+0x00000010,0x00040021,0x0000001a,0x0000000d,
+0x0000000e,0x00040020,0x00000021,0x00000007,
+0x00000006,0x0004002b,0x00000006,0x00000024,
+0x00000018,0x0004002b,0x00000006,0x0000002b,
+0x00000080,0x0004002b,0x00000006,0x0000002f,
+0x00000100,0x0004002b,0x00000006,0x00000033,
+0xffffff80,0x0004002b,0x00000006,0x00000037,
+0xffffff81,0x0004002b,0x00000006,0x0000003a,
+0x00000014,0x0004002b,0x00000006,0x0000003d,
+0x0000000f,0x0004002b,0x00000006,0x00000042,
+0x00000010,0x0004002b,0x0000000d,0x00000044,
+0x0000000f,0x00040017,0x00000046,0x00000006,
+0x00000004,0x00040020,0x00000047,0x00000007,
+0x00000046,0x0004002b,0x0000000d,0x00000049,
+0x00000020,0x0004001c,0x0000004a,0x00000046,
+0x00000049,0x0004002b,0x00000006,0x0000004b,
+0xfffffffd,0x0004002b,0x00000006,0x0000004c,
+0xfffffffa,0x0004002b,0x00000006,0x0000004d,
+0xfffffff7,0x0004002b,0x00000006,0x0000004e,
+0xfffffff1,0x0007002c,0x00000046,0x0000004f,
+0x0000004b,0x0000004c,0x0000004d,0x0000004e,
+0x0004002b,0x00000006,0x00000050,0x00000002,
+0x0004002b,0x00000006,0x00000051,0x00000005,
+0x0004002b,0x00000006,0x00000052,0x00000008,
+0x0004002b,0x00000006,0x00000053,0x0000000e,
+0x0007002c,0x00000046,0x00000054,0x00000050,
+0x00000051,0x00000052,0x00000053,0x0004002b,
+0x00000006,0x00000055,0xfffffff9,0x0004002b,
+0x00000006,0x00000056,0xfffffff6,0x0004002b,
+0x00000006,0x00000057,0xfffffff3,0x0007002c,
+0x00000046,0x00000058,0x0000004b,0x00000055,
+0x00000056,0x00000057,0x0004002b,0x00000006,
+0x00000059,0x00000006,0x0004002b,0x00000006,
+0x0000005a,0x00000009,0x0004002b,0x00000006,
+0x0000005b,0x0000000c,0x0007002c,0x00000046,
+0x0000005c,0x00000050,0x00000059,0x0000005a,
+0x0000005b,0x0004002b,0x00000006,0x0000005d,
+0xfffffffe,0x0004002b,0x00000006,0x0000005e,
+0xfffffffb,0x0004002b,0x00000006,0x0000005f,
+0xfffffff8,0x0007002c,0x00000046,0x00000060,
+0x0000005d,0x0000005e,0x0000005f,0x00000057,
+0x0004002b,0x00000006,0x00000061,0x00000001,
+0x0004002b,0x00000006,0x00000062,0x00000004,
+0x0004002b,0x00000006,0x00000063,0x00000007,
+0x0007002c,0x00000046,0x00000064,0x00000061,
+0x00000062,0x00000063,0x0000005b,0x0004002b,
+0x00000006,0x00000065,0xfffffffc,0x0007002c,
+0x00000046,0x00000066,0x0000005d,0x00000065,
+0x0000004c,0x00000057,0x0004002b,0x00000006,
+0x00000067,0x00000003,0x0007002c,0x00000046,
+0x00000068,0x00000061,0x00000067,0x00000051,
+0x0000005b,0x0004002b,0x00000006,0x00000069,
+0xfffffff4,0x0007002c,0x00000046,0x0000006a,
+0x0000004b,0x0000004c,0x0000005f,0x00000069,
+0x0004002b,0x00000006,0x0000006b,0x0000000b,
+0x0007002c,0x00000046,0x0000006c,0x00000050,
+0x00000051,0x00000063,0x0000006b,0x0004002b,
+0x00000006,0x0000006d,0xfffffff5,0x0007002c,
+0x00000046,0x0000006e,0x0000004b,0x00000055,
+0x0000004d,0x0000006d,0x0004002b,0x00000006,
+0x0000006f,0x0000000a,0x0007002c,0x00000046,
+0x00000070,0x00000050,0x00000059,0x00000052,
+0x0000006f,0x0007002c,0x00000046,0x00000071,
+0x00000065,0x00000055,0x0000005f,0x0000006d,
+0x0007002c,0x00000046,0x00000072,0x00000067,
+0x00000059,0x00000063,0x0000006f,0x0007002c,
+0x00000046,0x00000073,0x0000004b,0x0000005e,
+0x0000005f,0x0000006d,0x0007002c,0x00000046,
+0x00000074,0x00000050,0x00000062,0x00000063,
+0x0000006f,0x0007002c,0x00000046,0x00000075,
+0x0000005d,0x0000004c,0x0000005f,0x00000056,
+0x0007002c,0x00000046,0x00000076,0x00000061,
+0x00000051,0x00000063,0x0000005a,0x0007002c,
+0x00000046,0x00000077,0x0000005d,0x0000005e,
+0x0000005f,0x00000056,0x0007002c,0x00000046,
+0x00000078,0x00000061,0x00000062,0x00000063,
+0x0000005a,0x0007002c,0x00000046,0x00000079,
+0x0000005d,0x00000065,0x0000005f,0x00000056,
+0x0007002c,0x00000046,0x0000007a,0x00000061,
+0x00000067,0x00000063,0x0000005a,0x0007002c,
+0x00000046,0x0000007b,0x0000005d,0x0000005e,
+0x00000055,0x00000056,0x0007002c,0x00000046,
+0x0000007c,0x00000061,0x00000062,0x00000059,
+0x0000005a,0x0007002c,0x00000046,0x0000007d,
+0x0000004b,0x00000065,0x00000055,0x00000056,
+0x0007002c,0x00000046,0x0000007e,0x00000050,
+0x00000067,0x00000059,0x0000005a,0x0004002b,
+0x00000006,0x0000007f,0xffffffff,0x0007002c,
+0x00000046,0x00000080,0x0000007f,0x0000005d,
+0x0000004b,0x00000056,0x0004002b,0x00000006,
+0x00000081,0x00000000,0x0007002c,0x00000046,
+0x00000082,0x00000081,0x00000061,0x00000050,
+0x0000005a,0x0007002c,0x00000046,0x00000083,
+0x00000065,0x0000004c,0x0000005f,0x0000004d,
+0x0007002c,0x00000046,0x00000084,0x00000067,
+0x00000051,0x00000063,0x00000052,0x0007002c,
+0x00000046,0x00000085,0x0000004b,0x0000005e,
+0x00000055,0x0000004d,0x0007002c,0x00000046,
+0x00000086,0x00000050,0x00000062,0x00000059,
+0x00000052,0x0023002c,0x0000004a,0x00000087,
+0x0000004f,0x00000054,0x00000058,0x0000005c,
+0x00000060,0x00000064,0x00000066,0x00000068,
+0x0000006a,0x0000006c,0x0000006e,0x00000070,
+0x00000071,0x00000072,0x00000073,0x00000074,
+0x00000075,0x00000076,0x00000077,0x00000078,
+0x00000079,0x0000007a,0x0000007b,0x0000007c,
+0x0000007d,0x0000007e,0x00000080,0x00000082,
+0x00000083,0x00000084,0x00000085,0x00000086,
+0x0004002b,0x0000000d,0x00000089,0x00000002,
+0x00040020,0x0000008b,0x00000007,0x0000004a,
+0x0004002b,0x0000000d,0x00000092,0x00000001,
+0x0004001c,0x00000097,0x0000000d,0x00000012,
+0x00040020,0x00000098,0x00000007,0x00000097,
+0x0004002b,0x00000006,0x0000009b,0x0000000d,
+0x0004002b,0x00000006,0x000000a8,0x0000001e,
+0x0004002b,0x00000006,0x000000ac,0x0000001b,
+0x0004002b,0x00000006,0x000000b1,0x00000015,
+0x0004002b,0x00000006,0x000000b4,0x00000012,
+0x0004002b,0x0000000d,0x000000c3,0x00000000,
+0x0004002b,0x0000000d,0x000000cd,0x00000004,
+0x0004002b,0x0000000d,0x000000d7,0x00000007,
+0x0004002b,0x00000006,0x000000fb,0xfffffc01,
+0x0004002b,0x00000006,0x000000fc,0x000003ff,
+0x00040020,0x000000fe,0x00000007,0x00000013,
+0x0004002b,0x00000011,0x00000103,0x447fc000,
+0x00040020,0x00000105,0x00000007,0x00000011,
+0x0004002b,0x00000006,0x0000010b,0x000007ff,
+0x0004002b,0x00000011,0x00000110,0x44ffe000,
+0x0004002b,0x0000000d,0x00000119,0x000000ff,
+0x0004002b,0x0000000d,0x0000011d,0x0000ff00,
+0x0004002b,0x0000000d,0x00000122,0x00ff0000,
+0x0004002b,0x0000000d,0x00000127,0xff000000,
+0x00040017,0x0000012e,0x0000000d,0x00000003,
+0x00040020,0x0000012f,0x00000001,0x0000012e,
+0x0004003b,0x0000012f,0x00000130,0x00000001,
+0x0004001e,0x00000133,0x0000000d,0x0000000d,
+0x00040020,0x00000134,0x00000009,0x00000133,
+0x0004003b,0x00000134,0x00000135,0x00000009,
+0x00040020,0x00000136,0x00000009,0x0000000d,
+0x00040017,0x0000013e,0x0000000d,0x00000004,
+0x00040020,0x0000013f,0x00000007,0x0000013e,
+0x00090019,0x00000141,0x0000000d,0x00000001,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x0000001e,0x00040020,0x00000142,0x00000000,
+0x00000141,0x0004003b,0x00000142,0x00000143,
+0x00000000,0x00030029,0x0000000f,0x00000152,
+0x0004002b,0x0000000d,0x0000015d,0x00000003,
+0x00090019,0x00000175,0x00000011,0x00000001,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x00000011,0x00040020,0x00000176,0x00000000,
+0x00000175,0x0004003b,0x00000176,0x00000177,
+0x00000000,0x00040017,0x00000179,0x00000006,
+0x00000002,0x0004002b,0x00000011,0x00000195,
+0x00000000,0x0004002b,0x00000011,0x00000196,
+0x3f800000,0x00040017,0x00000197,0x00000011,
+0x00000004,0x0004002b,0x0000000d,0x0000019d,
+0x00000093,0x0004002b,0x0000000d,0x0000019e,
+0x00000094,0x0004002b,0x0000000d,0x0000019f,
+0x00000095,0x0004002b,0x0000000d,0x000001a0,
+0x00000096,0x0004002b,0x0000000d,0x000001a1,
+0x00000097,0x0004002b,0x0000000d,0x000001a2,
+0x00000098,0x0004002b,0x0000000d,0x000001a3,
+0x00000099,0x0004002b,0x0000000d,0x000001a4,
+0x0000009a,0x0004002b,0x0000000d,0x000001a5,
+0x0000009b,0x0004002b,0x0000000d,0x000001a6,
+0x0000009c,0x0004002b,0x0000000d,0x000001a7,
+0x00000008,0x0004001c,0x000001a8,0x00000006,
+0x000001a7,0x000b002c,0x000001a8,0x000001a9,
+0x00000081,0x00000061,0x00000050,0x00000067,
+0x00000065,0x0000004b,0x0000005d,0x0000007f,
+0x0004001c,0x000001aa,0x00000046,0x000001a7,
+0x0007002c,0x00000046,0x000001ab,0x00000050,
+0x00000052,0x0000005d,0x0000005f,0x0004002b,
+0x00000006,0x000001ac,0x00000011,0x0004002b,
+0x00000006,0x000001ad,0xffffffef,0x0007002c,
+0x00000046,0x000001ae,0x00000051,0x000001ac,
+0x0000005e,0x000001ad,0x0004002b,0x00000006,
+0x000001af,0x0000001d,0x0004002b,0x00000006,
+0x000001b0,0xffffffe3,0x0007002c,0x00000046,
+0x000001b1,0x0000005a,0x000001af,0x0000004d,
+0x000001b0,0x0004002b,0x00000006,0x000001b2,
+0x0000002a,0x0004002b,0x00000006,0x000001b3,
+0xffffffd6,0x0007002c,0x00000046,0x000001b4,
+0x0000009b,0x000001b2,0x00000057,0x000001b3,
+0x0004002b,0x00000006,0x000001b5,0x0000003c,
+0x0004002b,0x00000006,0x000001b6,0xffffffee,
+0x0004002b,0x00000006,0x000001b7,0xffffffc4,
+0x0007002c,0x00000046,0x000001b8,0x000000b4,
+0x000001b5,0x000001b6,0x000001b7,0x0004002b,
+0x00000006,0x000001b9,0x00000050,0x0004002b,
+0x00000006,0x000001ba,0xffffffe8,0x0004002b,
+0x00000006,0x000001bb,0xffffffb0,0x0007002c,
+0x00000046,0x000001bc,0x00000024,0x000001b9,
+0x000001ba,0x000001bb,0x0004002b,0x00000006,
+0x000001bd,0x00000021,0x0004002b,0x00000006,
+0x000001be,0x0000006a,0x0004002b,0x00000006,
+0x000001bf,0xffffffdf,0x0004002b,0x00000006,
+0x000001c0,0xffffff96,0x0007002c,0x00000046,
+0x000001c1,0x000001bd,0x000001be,0x000001bf,
+0x000001c0,0x0004002b,0x00000006,0x000001c2,
+0x0000002f,0x0004002b,0x00000006,0x000001c3,
+0x000000b7,0x0004002b,0x00000006,0x000001c4,
+0xffffffd1,0x0004002b,0x00000006,0x000001c5,
+0xffffff49,0x0007002c,0x00000046,0x000001c6,
+0x000001c2,0x000001c3,0x000001c4,0x000001c5,
+0x000b002c,0x000001aa,0x000001c7,0x000001ab,
+0x000001ae,0x000001b1,0x000001b4,0x000001b8,
+0x000001bc,0x000001c1,0x000001c6,0x0007002c,
+0x00000046,0x000001c8,0x00000081,0x00000052,
+0x00000081,0x0000005f,0x0007002c,0x00000046,
+0x000001c9,0x00000081,0x000001ac,0x00000081,
+0x000001ad,0x0007002c,0x00000046,0x000001ca,
+0x00000081,0x000001af,0x00000081,0x000001b0,
+0x0007002c,0x00000046,0x000001cb,0x00000081,
+0x000001b2,0x00000081,0x000001b3,0x0007002c,
+0x00000046,0x000001cc,0x00000081,0x000001b5,
+0x00000081,0x000001b7,0x0007002c,0x00000046,
+0x000001cd,0x00000081,0x000001b9,0x00000081,
+0x000001bb,0x0007002c,0x00000046,0x000001ce,
+0x00000081,0x000001be,0x00000081,0x000001c0,
+0x0007002c,0x00000046,0x000001cf,0x00000081,
+0x000001c3,0x00000081,0x000001c5,0x000b002c,
+0x000001aa,0x000001d0,0x000001c8,0x000001c9,
+0x000001ca,0x000001cb,0x000001cc,0x000001cd,
+0x000001ce,0x000001cf,0x0006002c,0x0000012e,
+0x000001d1,0x000001a7,0x000001a7,0x00000092,
+0x00050036,0x00000002,0x00000004,0x00000000,
+0x00000003,0x000200f8,0x00000005,0x0004003b,
+0x00000008,0x0000012d,0x00000007,0x0004003b,
+0x0000013f,0x00000140,0x00000007,0x0004003b,
+0x00000008,0x00000145,0x00000007,0x0004003b,
+0x000000fe,0x00000149,0x00000007,0x0004003b,
+0x0000000e,0x0000014a,0x00000007,0x0004003b,
+0x0000000e,0x0000014e,0x00000007,0x0004003b,
+0x0000000e,0x00000153,0x00000007,0x0004003b,
+0x0000000e,0x00000154,0x00000007,0x0004003b,
+0x00000010,0x00000155,0x00000007,0x0004003b,
+0x000000fe,0x00000157,0x00000007,0x0004003b,
+0x0000000e,0x00000158,0x00000007,0x0004003b,
+0x0000000e,0x0000015c,0x00000007,0x0004003b,
+0x0000000e,0x00000161,0x00000007,0x0004003b,
+0x0000000e,0x00000162,0x00000007,0x0004003b,
+0x00000010,0x00000163,0x00000007,0x0004003b,
+0x00000021,0x00000165,0x00000007,0x0004003b,
+0x00000021,0x0000016d,0x00000007,0x0004003b,
+0x00000008,0x00000187,0x00000007,0x0004003d,
+0x0000012e,0x00000131,0x00000130,0x0004007c,
+0x00000007,0x00000132,0x00000131,0x0003003e,
+0x0000012d,0x00000132,0x00050041,0x00000136,
+0x00000137,0x00000135,0x00000061,0x0004003d,
+0x0000000d,0x00000138,0x00000137,0x0004007c,
+0x00000006,0x00000139,0x00000138,0x00050041,
+0x00000021,0x0000013a,0x0000012d,0x00000089,
+0x0004003d,0x00000006,0x0000013b,0x0000013a,
+0x00050080,0x00000006,0x0000013c,0x0000013b,
+0x00000139,0x00050041,0x00000021,0x0000013d,
+0x0000012d,0x00000089,0x0003003e,0x0000013d,
+0x0000013c,0x0004003d,0x00000141,0x00000144,
+0x00000143,0x0004003d,0x00000007,0x00000146,
+0x0000012d,0x0003003e,0x00000145,0x00000146,
+0x00050039,0x00000007,0x00000147,0x0000000b,
+0x00000145,0x00050062,0x0000013e,0x00000148,
+0x00000144,0x00000147,0x0003003e,0x00000140,
+0x00000148,0x00050041,0x0000000e,0x0000014b,
+0x00000140,0x000000c3,0x0004003d,0x0000000d,
+0x0000014c,0x0000014b,0x0003003e,0x0000014a,
+0x0000014c,0x00050039,0x0000000d,0x0000014d,
+0x0000001c,0x0000014a,0x00050041,0x0000000e,
+0x0000014f,0x00000140,0x00000092,0x0004003d,
+0x0000000d,0x00000150,0x0000014f,0x0003003e,
+0x0000014e,0x00000150,0x00050039,0x0000000d,
+0x00000151,0x0000001c,0x0000014e,0x0003003e,
+0x00000153,0x0000014d,0x0003003e,0x00000154,
+0x00000151,0x0003003e,0x00000155,0x00000152,
+0x00070039,0x00000013,0x00000156,0x00000018,
+0x00000153,0x00000154,0x00000155,0x0003003e,
+0x00000149,0x00000156,0x00050041,0x0000000e,
+0x00000159,0x00000140,0x00000089,0x0004003d,
+0x0000000d,0x0000015a,0x00000159,0x0003003e,
+0x00000158,0x0000015a,0x00050039,0x0000000d,
+0x0000015b,0x0000001c,0x00000158,0x00050041,
+0x0000000e,0x0000015e,0x00000140,0x0000015d,
+0x0004003d,0x0000000d,0x0000015f,0x0000015e,
+0x0003003e,0x0000015c,0x0000015f,0x00050039,
+0x0000000d,0x00000160,0x0000001c,0x0000015c,
+0x0003003e,0x00000161,0x0000015b,0x0003003e,
+0x00000162,0x00000160,0x0003003e,0x00000163,
+0x00000152,0x00070039,0x00000013,0x00000164,
+0x00000018,0x00000161,0x00000162,0x00000163,
+0x0003003e,0x00000157,0x00000164,0x0003003e,
+0x00000165,0x00000081,0x000200f9,0x00000166,
+0x000200f8,0x00000166,0x000400f6,0x00000168,
+0x00000169,0x00000000,0x000200f9,0x0000016a,
+0x000200f8,0x0000016a,0x0004003d,0x00000006,
+0x0000016b,0x00000165,0x000500b1,0x0000000f,
+0x0000016c,0x0000016b,0x00000062,0x000400fa,
+0x0000016c,0x00000167,0x00000168,0x000200f8,
+0x00000167,0x0003003e,0x0000016d,0x00000081,
+0x000200f9,0x0000016e,0x000200f8,0x0000016e,
+0x000400f6,0x00000170,0x00000171,0x00000000,
+0x000200f9,0x00000172,0x000200f8,0x00000172,
+0x0004003d,0x00000006,0x00000173,0x0000016d,
+0x000500b1,0x0000000f,0x00000174,0x00000173,
+0x00000062,0x000400fa,0x00000174,0x0000016f,
+0x00000170,0x000200f8,0x0000016f,0x0004003d,
+0x00000175,0x00000178,0x00000177,0x0004003d,
+0x00000007,0x0000017a,0x0000012d,0x0007004f,
+0x00000179,0x0000017b,0x0000017a,0x0000017a,
+0x00000000,0x00000001,0x00050050,0x00000179,
+0x0000017c,0x00000062,0x00000062,0x00050084,
+0x00000179,0x0000017d,0x0000017b,0x0000017c,
+0x0004003d,0x00000006,0x0000017e,0x0000016d,
+0x0004003d,0x00000006,0x0000017f,0x00000165,
+0x00050050,0x00000179,0x00000180,0x0000017e,
+0x0000017f,0x00050080,0x00000179,0x00000181,
+0x0000017d,0x00000180,0x00050041,0x00000021,
+0x00000182,0x0000012d,0x00000089,0x0004003d,
+0x00000006,0x00000183,0x00000182,0x00050051,
+0x00000006,0x00000184,0x00000181,0x00000000,
+0x00050051,0x00000006,0x00000185,0x00000181,
+0x00000001,0x00060050,0x00000007,0x00000186,
+0x00000184,0x00000185,0x00000183,0x0003003e,
+0x00000187,0x00000186,0x00050039,0x00000007,
+0x00000188,0x0000000b,0x00000187,0x0004003d,
+0x00000006,0x00000189,0x00000165,0x00050084,
+0x00000006,0x0000018a,0x00000189,0x00000062,
+0x0004003d,0x00000006,0x0000018b,0x0000016d,
+0x00050080,0x00000006,0x0000018c,0x0000018a,
+0x0000018b,0x00050041,0x00000105,0x0000018d,
+0x00000149,0x0000018c,0x0004003d,0x00000011,
+0x0000018e,0x0000018d,0x0004003d,0x00000006,
+0x0000018f,0x00000165,0x00050084,0x00000006,
+0x00000190,0x0000018f,0x00000062,0x0004003d,
+0x00000006,0x00000191,0x0000016d,0x00050080,
+0x00000006,0x00000192,0x00000190,0x00000191,
+0x00050041,0x00000105,0x00000193,0x00000157,
+0x00000192,0x0004003d,0x00000011,0x00000194,
+0x00000193,0x00070050,0x00000197,0x00000198,
+0x0000018e,0x00000194,0x00000195,0x00000196,
+0x00040063,0x00000178,0x00000188,0x00000198,
+0x000200f9,0x00000171,0x000200f8,0x00000171,
+0x0004003d,0x00000006,0x00000199,0x0000016d,
+0x00050080,0x00000006,0x0000019a,0x00000199,
+0x00000061,0x0003003e,0x0000016d,0x0000019a,
+0x000200f9,0x0000016e,0x000200f8,0x00000170,
+0x000200f9,0x00000169,0x000200f8,0x00000169,
+0x0004003d,0x00000006,0x0000019b,0x00000165,
+0x00050080,0x00000006,0x0000019c,0x0000019b,
+0x00000061,0x0003003e,0x00000165,0x0000019c,
+0x000200f9,0x00000166,0x000200f8,0x00000168,
+0x000100fd,0x00010038,0x00050036,0x00000007,
+0x0000000b,0x00000000,0x00000009,0x00030037,
+0x00000008,0x0000000a,0x000200f8,0x0000000c,
+0x0004003d,0x00000007,0x0000001e,0x0000000a,
+0x000200fe,0x0000001e,0x00010038,0x00050036,
+0x00000013,0x00000018,0x00000000,0x00000014,
+0x00030037,0x0000000e,0x00000015,0x00030037,
+0x0000000e,0x00000016,0x00030037,0x00000010,
+0x00000017,0x000200f8,0x00000019,0x0004003b,
+0x00000021,0x00000022,0x00000007,0x0004003b,
+0x00000021,0x00000038,0x00000007,0x0004003b,
+0x0000000e,0x00000040,0x00000007,0x0004003b,
+0x00000047,0x00000048,0x00000007,0x0004003b,
+0x0000008b,0x0000008c,0x00000007,0x0004003b,
+0x00000047,0x0000008f,0x00000007,0x0004003b,
+0x0000008b,0x00000094,0x00000007,0x0004003b,
+0x00000098,0x00000099,0x00000007,0x0004003b,
+0x0000000e,0x000000c2,0x00000007,0x0004003b,
+0x0000000e,0x000000cb,0x00000007,0x0004003b,
+0x0000000e,0x000000d3,0x00000007,0x0004003b,
+0x00000021,0x000000d9,0x00000007,0x0004003b,
+0x00000021,0x000000dc,0x00000007,0x0004003b,
+0x00000021,0x000000e8,0x00000007,0x0004003b,
+0x000000fe,0x000000ff,0x00000007,0x0004003d,
+0x0000000d,0x00000023,0x00000015,0x000500c2,
+0x0000000d,0x00000025,0x00000023,0x00000024,
+0x0004007c,0x00000006,0x00000026,0x00000025,
+0x0003003e,0x00000022,0x00000026,0x0004003d,
+0x0000000f,0x00000027,0x00000017,0x000300f7,
+0x00000029,0x00000000,0x000400fa,0x00000027,
+0x00000028,0x00000029,0x000200f8,0x00000028,
+0x0004003d,0x00000006,0x0000002a,0x00000022,
+0x000500af,0x0000000f,0x0000002c,0x0000002a,
+0x0000002b,0x000300f7,0x0000002e,0x00000000,
+0x000400fa,0x0000002c,0x0000002d,0x0000002e,
+0x000200f8,0x0000002d,0x0004003d,0x00000006,
+0x00000030,0x00000022,0x00050082,0x00000006,
+0x00000031,0x00000030,0x0000002f,0x0003003e,
+0x00000022,0x00000031,0x000200f9,0x0000002e,
+0x000200f8,0x0000002e,0x0004003d,0x00000006,
+0x00000032,0x00000022,0x000500aa,0x0000000f,
+0x00000034,0x00000032,0x00000033,0x000300f7,
+0x00000036,0x00000000,0x000400fa,0x00000034,
+0x00000035,0x00000036,0x000200f8,0x00000035,
+0x0003003e,0x00000022,0x00000037,0x000200f9,
+0x00000036,0x000200f8,0x00000036,0x000200f9,
+0x00000029,0x000200f8,0x00000029,0x0004003d,
+0x0000000d,0x00000039,0x00000015,0x000500c2,
+0x0000000d,0x0000003b,0x00000039,0x0000003a,
+0x0004007c,0x00000006,0x0000003c,0x0000003b,
+0x0003003e,0x00000038,0x0000003c,0x0004003d,
+0x00000006,0x0000003e,0x00000038,0x000500c7,
+0x00000006,0x0000003f,0x0000003e,0x0000003d,
+0x0003003e,0x00000038,0x0000003f,0x0004003d,
+0x0000000d,0x00000041,0x00000015,0x000500c2,
+0x0000000d,0x00000043,0x00000041,0x00000042,
+0x000500c7,0x0000000d,0x00000045,0x00000043,
+0x00000044,0x0003003e,0x00000040,0x00000045,
+0x0004003d,0x0000000d,0x00000088,0x00000040,
+0x00050084,0x0000000d,0x0000008a,0x00000088,
+0x00000089,0x0003003e,0x0000008c,0x00000087,
+0x00050041,0x00000047,0x0000008d,0x0000008c,
+0x0000008a,0x0004003d,0x00000046,0x0000008e,
+0x0000008d,0x0003003e,0x00000048,0x0000008e,
+0x0004003d,0x0000000d,0x00000090,0x00000040,
+0x00050084,0x0000000d,0x00000091,0x00000090,
+0x00000089,0x00050080,0x0000000d,0x00000093,
+0x00000091,0x00000092,0x0003003e,0x00000094,
+0x00000087,0x00050041,0x00000047,0x00000095,
+0x00000094,0x00000093,0x0004003d,0x00000046,
+0x00000096,0x00000095,0x0003003e,0x0000008f,
+0x00000096,0x0004003d,0x0000000d,0x0000009a,
+0x00000015,0x000500c2,0x0000000d,0x0000009c,
+0x0000009a,0x0000009b,0x0004003d,0x0000000d,
+0x0000009d,0x00000015,0x000500c2,0x0000000d,
+0x0000009e,0x0000009d,0x0000006f,0x0004003d,
+0x0000000d,0x0000009f,0x00000015,0x000500c2,
+0x0000000d,0x000000a0,0x0000009f,0x00000063,
+0x0004003d,0x0000000d,0x000000a1,0x00000015,
+0x000500c2,0x0000000d,0x000000a2,0x000000a1,
+0x00000062,0x0004003d,0x0000000d,0x000000a3,
+0x00000015,0x000500c2,0x0000000d,0x000000a4,
+0x000000a3,0x00000061,0x0004003d,0x0000000d,
+0x000000a5,0x00000015,0x000500c4,0x0000000d,
+0x000000a6,0x000000a5,0x00000050,0x0004003d,
+0x0000000d,0x000000a7,0x00000016,0x000500c2,
+0x0000000d,0x000000a9,0x000000a7,0x000000a8,
+0x000500c5,0x0000000d,0x000000aa,0x000000a6,
+0x000000a9,0x0004003d,0x0000000d,0x000000ab,
+0x00000016,0x000500c2,0x0000000d,0x000000ad,
+0x000000ab,0x000000ac,0x0004003d,0x0000000d,
+0x000000ae,0x00000016,0x000500c2,0x0000000d,
+0x000000af,0x000000ae,0x00000024,0x0004003d,
+0x0000000d,0x000000b0,0x00000016,0x000500c2,
+0x0000000d,0x000000b2,0x000000b0,0x000000b1,
+0x0004003d,0x0000000d,0x000000b3,0x00000016,
+0x000500c2,0x0000000d,0x000000b5,0x000000b3,
+0x000000b4,0x0004003d,0x0000000d,0x000000b6,
+0x00000016,0x000500c2,0x0000000d,0x000000b7,
+0x000000b6,0x0000003d,0x0004003d,0x0000000d,
+0x000000b8,0x00000016,0x000500c2,0x0000000d,
+0x000000b9,0x000000b8,0x0000005b,0x0004003d,
+0x0000000d,0x000000ba,0x00000016,0x000500c2,
+0x0000000d,0x000000bb,0x000000ba,0x0000005a,
+0x0004003d,0x0000000d,0x000000bc,0x00000016,
+0x000500c2,0x0000000d,0x000000bd,0x000000bc,
+0x00000059,0x0004003d,0x0000000d,0x000000be,
+0x00000016,0x000500c2,0x0000000d,0x000000bf,
+0x000000be,0x00000067,0x0004003d,0x0000000d,
+0x000000c0,0x00000016,0x00130050,0x00000097,
+0x000000c1,0x0000009c,0x0000009e,0x000000a0,
+0x000000a2,0x000000a4,0x000000aa,0x000000ad,
+0x000000af,0x000000b2,0x000000b5,0x000000b7,
+0x000000b9,0x000000bb,0x000000bd,0x000000bf,
+0x000000c0,0x0003003e,0x00000099,0x000000c1,
+0x0003003e,0x000000c2,0x000000c3,0x000200f9,
+0x000000c4,0x000200f8,0x000000c4,0x000400f6,
+0x000000c6,0x000000c7,0x00000000,0x000200f9,
+0x000000c8,0x000200f8,0x000000c8,0x0004003d,
+0x0000000d,0x000000c9,0x000000c2,0x000500b0,
+0x0000000f,0x000000ca,0x000000c9,0x00000012,
+0x000400fa,0x000000ca,0x000000c5,0x000000c6,
+0x000200f8,0x000000c5,0x0004003d,0x0000000d,
+0x000000cc,0x000000c2,0x00050089,0x0000000d,
+0x000000ce,0x000000cc,0x000000cd,0x00050084,
+0x0000000d,0x000000cf,0x000000ce,0x000000cd,
+0x0004003d,0x0000000d,0x000000d0,0x000000c2,
+0x00050086,0x0000000d,0x000000d1,0x000000d0,
+0x000000cd,0x00050080,0x0000000d,0x000000d2,
+0x000000cf,0x000000d1,0x0003003e,0x000000cb,
+0x000000d2,0x0004003d,0x0000000d,0x000000d4,
+0x000000c2,0x00050041,0x0000000e,0x000000d5,
+0x00000099,0x000000d4,0x0004003d,0x0000000d,
+0x000000d6,0x000000d5,0x000500c7,0x0000000d,
+0x000000d8,0x000000d6,0x000000d7,0x0003003e,
+0x000000d3,0x000000d8,0x0004003d,0x0000000d,
+0x000000da,0x000000d3,0x000500ae,0x0000000f,
+0x000000db,0x000000da,0x000000cd,0x000300f7,
+0x000000de,0x00000000,0x000400fa,0x000000db,
+0x000000dd,0x000000e3,0x000200f8,0x000000dd,
+0x0004003d,0x0000000d,0x000000df,0x000000d3,
+0x00050082,0x0000000d,0x000000e0,0x000000df,
+0x000000cd,0x00050041,0x00000021,0x000000e1,
+0x0000008f,0x000000e0,0x0004003d,0x00000006,
+0x000000e2,0x000000e1,0x0003003e,0x000000dc,
+0x000000e2,0x000200f9,0x000000de,0x000200f8,
+0x000000e3,0x0004003d,0x0000000d,0x000000e4,
+0x000000d3,0x00050041,0x00000021,0x000000e5,
+0x00000048,0x000000e4,0x0004003d,0x00000006,
+0x000000e6,0x000000e5,0x0003003e,0x000000dc,
+0x000000e6,0x000200f9,0x000000de,0x000200f8,
+0x000000de,0x0004003d,0x00000006,0x000000e7,
+0x000000dc,0x0003003e,0x000000d9,0x000000e7,
+0x0004003d,0x00000006,0x000000e9,0x00000022,
+0x0004003d,0x00000006,0x000000ea,0x000000d9,
+0x0004003d,0x00000006,0x000000eb,0x00000038,
+0x00050084,0x00000006,0x000000ec,0x000000ea,
+0x000000eb,0x00050080,0x00000006,0x000000ed,
+0x000000e9,0x000000ec,0x0003003e,0x000000e8,
+0x000000ed,0x0004003d,0x00000006,0x000000ee,
+0x000000e8,0x00050084,0x00000006,0x000000ef,
+0x000000ee,0x00000052,0x0003003e,0x000000e8,
+0x000000ef,0x0004003d,0x00000006,0x000000f0,
+0x00000038,0x000500aa,0x0000000f,0x000000f1,
+0x000000f0,0x00000081,0x000300f7,0x000000f3,
+0x00000000,0x000400fa,0x000000f1,0x000000f2,
+0x000000f3,0x000200f8,0x000000f2,0x0004003d,
+0x00000006,0x000000f4,0x000000d9,0x0004003d,
+0x00000006,0x000000f5,0x000000e8,0x00050080,
+0x00000006,0x000000f6,0x000000f5,0x000000f4,
+0x0003003e,0x000000e8,0x000000f6,0x000200f9,
+0x000000f3,0x000200f8,0x000000f3,0x0004003d,
+0x0000000f,0x000000f7,0x00000017,0x000300f7,
+0x000000f9,0x00000000,0x000400fa,0x000000f7,
+0x000000f8,0x00000107,0x000200f8,0x000000f8,
+0x0004003d,0x00000006,0x000000fa,0x000000e8,
+0x0008000c,0x00000006,0x000000fd,0x00000001,
+0x0000002d,0x000000fa,0x000000fb,0x000000fc,
+0x0003003e,0x000000e8,0x000000fd,0x0004003d,
+0x0000000d,0x00000100,0x000000cb,0x0004003d,
+0x00000006,0x00000101,0x000000e8,0x0004006f,
+0x00000011,0x00000102,0x00000101,0x00050088,
+0x00000011,0x00000104,0x00000102,0x00000103,
+0x00050041,0x00000105,0x00000106,0x000000ff,
+0x00000100,0x0003003e,0x00000106,0x00000104,
+0x000200f9,0x000000f9,0x000200f8,0x00000107,
+0x0004003d,0x00000006,0x00000108,0x000000e8,
+0x00050080,0x00000006,0x00000109,0x00000108,
+0x00000062,0x0003003e,0x000000e8,0x00000109,
+0x0004003d,0x00000006,0x0000010a,0x000000e8,
+0x0008000c,0x00000006,0x0000010c,0x00000001,
+0x0000002d,0x0000010a,0x00000081,0x0000010b,
+0x0003003e,0x000000e8,0x0000010c,0x0004003d,
+0x0000000d,0x0000010d,0x000000cb,0x0004003d,
+0x00000006,0x0000010e,0x000000e8,0x0004006f,
+0x00000011,0x0000010f,0x0000010e,0x00050088,
+0x00000011,0x00000111,0x0000010f,0x00000110,
+0x00050041,0x00000105,0x00000112,0x000000ff,
+0x0000010d,0x0003003e,0x00000112,0x00000111,
+0x000200f9,0x000000f9,0x000200f8,0x000000f9,
+0x000200f9,0x000000c7,0x000200f8,0x000000c7,
+0x0004003d,0x0000000d,0x00000113,0x000000c2,
+0x00050080,0x0000000d,0x00000114,0x00000113,
+0x00000061,0x0003003e,0x000000c2,0x00000114,
+0x000200f9,0x000000c4,0x000200f8,0x000000c6,
+0x0004003d,0x00000013,0x00000115,0x000000ff,
+0x000200fe,0x00000115,0x00010038,0x00050036,
+0x0000000d,0x0000001c,0x00000000,0x0000001a,
+0x00030037,0x0000000e,0x0000001b,0x000200f8,
+0x0000001d,0x0004003d,0x0000000d,0x00000118,
+0x0000001b,0x000500c7,0x0000000d,0x0000011a,
+0x00000118,0x00000119,0x000500c4,0x0000000d,
+0x0000011b,0x0000011a,0x00000024,0x0004003d,
+0x0000000d,0x0000011c,0x0000001b,0x000500c7,
+0x0000000d,0x0000011e,0x0000011c,0x0000011d,
+0x000500c4,0x0000000d,0x0000011f,0x0000011e,
+0x00000052,0x000500c5,0x0000000d,0x00000120,
+0x0000011b,0x0000011f,0x0004003d,0x0000000d,
+0x00000121,0x0000001b,0x000500c7,0x0000000d,
+0x00000123,0x00000121,0x00000122,0x000500c2,
+0x0000000d,0x00000124,0x00000123,0x00000052,
+0x000500c5,0x0000000d,0x00000125,0x00000120,
+0x00000124,0x0004003d,0x0000000d,0x00000126,
+0x0000001b,0x000500c7,0x0000000d,0x00000128,
+0x00000126,0x00000127,0x000500c2,0x0000000d,
+0x00000129,0x00000128,0x00000024,0x000500c5,
+0x0000000d,0x0000012a,0x00000125,0x00000129,
+0x000200fe,0x0000012a,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_3D.inl
new file mode 100644
index 00000000000..8a1aad4157c
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Snorm_3D.inl
@@ -0,0 +1,671 @@
+0x07230203,0x00010300,0x000d000a,0x000001d2,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x00000031,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000130,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00060005,
+0x0000000b,0x50746567,0x4433736f,0x33697628,
+0x0000003b,0x00030005,0x0000000a,0x00736f70,
+0x000e0005,0x00000018,0x5f636165,0x6f636564,
+0x735f6564,0x6c676e69,0x68635f65,0x656e6e61,
+0x6c625f6c,0x5f6b636f,0x616f6c66,0x31752874,
+0x3b31753b,0x003b3162,0x00040005,0x00000015,
+0x68676968,0x00000000,0x00030005,0x00000016,
+0x00776f6c,0x00050005,0x00000017,0x69537369,
+0x64656e67,0x00000000,0x00050005,0x0000001c,
+0x70696c66,0x75283233,0x00003b31,0x00030005,
+0x0000001b,0x00000061,0x00060005,0x00000022,
+0x65736162,0x646f635f,0x726f7765,0x00000064,
+0x00050005,0x00000038,0x746c756d,0x696c7069,
+0x00007265,0x00040005,0x00000040,0x496c6274,
+0x00007864,0x00040005,0x00000048,0x6c626174,
+0x00003065,0x00050005,0x0000008c,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000008f,
+0x6c626174,0x00003165,0x00050005,0x00000094,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000099,0x00000070,0x00030005,0x000000c2,
+0x00000069,0x00040005,0x000000cb,0x4974756f,
+0x00007864,0x00050005,0x000000d3,0x69646f6d,
+0x72656966,0x00000000,0x00060005,0x000000d9,
+0x69646f6d,0x72656966,0x756c6156,0x00000065,
+0x00040005,0x000000e8,0x6f636564,0x00646564,
+0x00040005,0x000000ff,0x75736572,0x0000746c,
+0x00030005,0x0000012d,0x00736f70,0x00080005,
+0x00000130,0x475f6c67,0x61626f6c,0x766e496c,
+0x7461636f,0x496e6f69,0x00000044,0x00070005,
+0x00000133,0x67616d49,0x726f4665,0x4274616d,
+0x6b636f6c,0x00000000,0x00060006,0x00000133,
+0x00000000,0x706d6f63,0x6d726f46,0x00007461,
+0x00060006,0x00000133,0x00000001,0x65736162,
+0x6579614c,0x00000072,0x00060005,0x00000135,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00050005,0x00000140,0x42637273,0x6b636f6c,
+0x00000000,0x00050005,0x00000143,0x6d695f75,
+0x30656761,0x00000000,0x00040005,0x00000145,
+0x61726170,0x0000006d,0x00060005,0x00000149,
+0x6f636564,0x6572706d,0x64657373,0x00000052,
+0x00040005,0x0000014a,0x61726170,0x0000006d,
+0x00040005,0x0000014e,0x61726170,0x0000006d,
+0x00040005,0x00000153,0x61726170,0x0000006d,
+0x00040005,0x00000154,0x61726170,0x0000006d,
+0x00040005,0x00000155,0x61726170,0x0000006d,
+0x00060005,0x00000157,0x6f636564,0x6572706d,
+0x64657373,0x00000047,0x00040005,0x00000158,
+0x61726170,0x0000006d,0x00040005,0x0000015c,
+0x61726170,0x0000006d,0x00040005,0x00000161,
+0x61726170,0x0000006d,0x00040005,0x00000162,
+0x61726170,0x0000006d,0x00040005,0x00000163,
+0x61726170,0x0000006d,0x00030005,0x00000165,
+0x00000079,0x00030005,0x0000016d,0x00000078,
+0x00050005,0x00000177,0x6d695f75,0x31656761,
+0x00000000,0x00040005,0x00000187,0x61726170,
+0x0000006d,0x00040047,0x00000130,0x0000000b,
+0x0000001c,0x00050048,0x00000133,0x00000000,
+0x00000023,0x00000000,0x00050048,0x00000133,
+0x00000001,0x00000023,0x00000004,0x00030047,
+0x00000133,0x00000002,0x00040047,0x00000143,
+0x00000022,0x00000000,0x00040047,0x00000143,
+0x00000021,0x00000000,0x00030047,0x00000143,
+0x00000018,0x00040047,0x00000177,0x00000022,
+0x00000000,0x00040047,0x00000177,0x00000021,
+0x00000001,0x00030047,0x00000177,0x00000019,
+0x00040047,0x000001d1,0x0000000b,0x00000019,
+0x00020013,0x00000002,0x00030021,0x00000003,
+0x00000002,0x00040015,0x00000006,0x00000020,
+0x00000001,0x00040017,0x00000007,0x00000006,
+0x00000003,0x00040020,0x00000008,0x00000007,
+0x00000007,0x00040021,0x00000009,0x00000007,
+0x00000008,0x00040015,0x0000000d,0x00000020,
+0x00000000,0x00040020,0x0000000e,0x00000007,
+0x0000000d,0x00020014,0x0000000f,0x00040020,
+0x00000010,0x00000007,0x0000000f,0x00030016,
+0x00000011,0x00000020,0x0004002b,0x0000000d,
+0x00000012,0x00000010,0x0004001c,0x00000013,
+0x00000011,0x00000012,0x00060021,0x00000014,
+0x00000013,0x0000000e,0x0000000e,0x00000010,
+0x00040021,0x0000001a,0x0000000d,0x0000000e,
+0x00040020,0x00000021,0x00000007,0x00000006,
+0x0004002b,0x00000006,0x00000024,0x00000018,
+0x0004002b,0x00000006,0x0000002b,0x00000080,
+0x0004002b,0x00000006,0x0000002f,0x00000100,
+0x0004002b,0x00000006,0x00000033,0xffffff80,
+0x0004002b,0x00000006,0x00000037,0xffffff81,
+0x0004002b,0x00000006,0x0000003a,0x00000014,
+0x0004002b,0x00000006,0x0000003d,0x0000000f,
+0x0004002b,0x00000006,0x00000042,0x00000010,
+0x0004002b,0x0000000d,0x00000044,0x0000000f,
+0x00040017,0x00000046,0x00000006,0x00000004,
+0x00040020,0x00000047,0x00000007,0x00000046,
+0x0004002b,0x0000000d,0x00000049,0x00000020,
+0x0004001c,0x0000004a,0x00000046,0x00000049,
+0x0004002b,0x00000006,0x0000004b,0xfffffffd,
+0x0004002b,0x00000006,0x0000004c,0xfffffffa,
+0x0004002b,0x00000006,0x0000004d,0xfffffff7,
+0x0004002b,0x00000006,0x0000004e,0xfffffff1,
+0x0007002c,0x00000046,0x0000004f,0x0000004b,
+0x0000004c,0x0000004d,0x0000004e,0x0004002b,
+0x00000006,0x00000050,0x00000002,0x0004002b,
+0x00000006,0x00000051,0x00000005,0x0004002b,
+0x00000006,0x00000052,0x00000008,0x0004002b,
+0x00000006,0x00000053,0x0000000e,0x0007002c,
+0x00000046,0x00000054,0x00000050,0x00000051,
+0x00000052,0x00000053,0x0004002b,0x00000006,
+0x00000055,0xfffffff9,0x0004002b,0x00000006,
+0x00000056,0xfffffff6,0x0004002b,0x00000006,
+0x00000057,0xfffffff3,0x0007002c,0x00000046,
+0x00000058,0x0000004b,0x00000055,0x00000056,
+0x00000057,0x0004002b,0x00000006,0x00000059,
+0x00000006,0x0004002b,0x00000006,0x0000005a,
+0x00000009,0x0004002b,0x00000006,0x0000005b,
+0x0000000c,0x0007002c,0x00000046,0x0000005c,
+0x00000050,0x00000059,0x0000005a,0x0000005b,
+0x0004002b,0x00000006,0x0000005d,0xfffffffe,
+0x0004002b,0x00000006,0x0000005e,0xfffffffb,
+0x0004002b,0x00000006,0x0000005f,0xfffffff8,
+0x0007002c,0x00000046,0x00000060,0x0000005d,
+0x0000005e,0x0000005f,0x00000057,0x0004002b,
+0x00000006,0x00000061,0x00000001,0x0004002b,
+0x00000006,0x00000062,0x00000004,0x0004002b,
+0x00000006,0x00000063,0x00000007,0x0007002c,
+0x00000046,0x00000064,0x00000061,0x00000062,
+0x00000063,0x0000005b,0x0004002b,0x00000006,
+0x00000065,0xfffffffc,0x0007002c,0x00000046,
+0x00000066,0x0000005d,0x00000065,0x0000004c,
+0x00000057,0x0004002b,0x00000006,0x00000067,
+0x00000003,0x0007002c,0x00000046,0x00000068,
+0x00000061,0x00000067,0x00000051,0x0000005b,
+0x0004002b,0x00000006,0x00000069,0xfffffff4,
+0x0007002c,0x00000046,0x0000006a,0x0000004b,
+0x0000004c,0x0000005f,0x00000069,0x0004002b,
+0x00000006,0x0000006b,0x0000000b,0x0007002c,
+0x00000046,0x0000006c,0x00000050,0x00000051,
+0x00000063,0x0000006b,0x0004002b,0x00000006,
+0x0000006d,0xfffffff5,0x0007002c,0x00000046,
+0x0000006e,0x0000004b,0x00000055,0x0000004d,
+0x0000006d,0x0004002b,0x00000006,0x0000006f,
+0x0000000a,0x0007002c,0x00000046,0x00000070,
+0x00000050,0x00000059,0x00000052,0x0000006f,
+0x0007002c,0x00000046,0x00000071,0x00000065,
+0x00000055,0x0000005f,0x0000006d,0x0007002c,
+0x00000046,0x00000072,0x00000067,0x00000059,
+0x00000063,0x0000006f,0x0007002c,0x00000046,
+0x00000073,0x0000004b,0x0000005e,0x0000005f,
+0x0000006d,0x0007002c,0x00000046,0x00000074,
+0x00000050,0x00000062,0x00000063,0x0000006f,
+0x0007002c,0x00000046,0x00000075,0x0000005d,
+0x0000004c,0x0000005f,0x00000056,0x0007002c,
+0x00000046,0x00000076,0x00000061,0x00000051,
+0x00000063,0x0000005a,0x0007002c,0x00000046,
+0x00000077,0x0000005d,0x0000005e,0x0000005f,
+0x00000056,0x0007002c,0x00000046,0x00000078,
+0x00000061,0x00000062,0x00000063,0x0000005a,
+0x0007002c,0x00000046,0x00000079,0x0000005d,
+0x00000065,0x0000005f,0x00000056,0x0007002c,
+0x00000046,0x0000007a,0x00000061,0x00000067,
+0x00000063,0x0000005a,0x0007002c,0x00000046,
+0x0000007b,0x0000005d,0x0000005e,0x00000055,
+0x00000056,0x0007002c,0x00000046,0x0000007c,
+0x00000061,0x00000062,0x00000059,0x0000005a,
+0x0007002c,0x00000046,0x0000007d,0x0000004b,
+0x00000065,0x00000055,0x00000056,0x0007002c,
+0x00000046,0x0000007e,0x00000050,0x00000067,
+0x00000059,0x0000005a,0x0004002b,0x00000006,
+0x0000007f,0xffffffff,0x0007002c,0x00000046,
+0x00000080,0x0000007f,0x0000005d,0x0000004b,
+0x00000056,0x0004002b,0x00000006,0x00000081,
+0x00000000,0x0007002c,0x00000046,0x00000082,
+0x00000081,0x00000061,0x00000050,0x0000005a,
+0x0007002c,0x00000046,0x00000083,0x00000065,
+0x0000004c,0x0000005f,0x0000004d,0x0007002c,
+0x00000046,0x00000084,0x00000067,0x00000051,
+0x00000063,0x00000052,0x0007002c,0x00000046,
+0x00000085,0x0000004b,0x0000005e,0x00000055,
+0x0000004d,0x0007002c,0x00000046,0x00000086,
+0x00000050,0x00000062,0x00000059,0x00000052,
+0x0023002c,0x0000004a,0x00000087,0x0000004f,
+0x00000054,0x00000058,0x0000005c,0x00000060,
+0x00000064,0x00000066,0x00000068,0x0000006a,
+0x0000006c,0x0000006e,0x00000070,0x00000071,
+0x00000072,0x00000073,0x00000074,0x00000075,
+0x00000076,0x00000077,0x00000078,0x00000079,
+0x0000007a,0x0000007b,0x0000007c,0x0000007d,
+0x0000007e,0x00000080,0x00000082,0x00000083,
+0x00000084,0x00000085,0x00000086,0x0004002b,
+0x0000000d,0x00000089,0x00000002,0x00040020,
+0x0000008b,0x00000007,0x0000004a,0x0004002b,
+0x0000000d,0x00000092,0x00000001,0x0004001c,
+0x00000097,0x0000000d,0x00000012,0x00040020,
+0x00000098,0x00000007,0x00000097,0x0004002b,
+0x00000006,0x0000009b,0x0000000d,0x0004002b,
+0x00000006,0x000000a8,0x0000001e,0x0004002b,
+0x00000006,0x000000ac,0x0000001b,0x0004002b,
+0x00000006,0x000000b1,0x00000015,0x0004002b,
+0x00000006,0x000000b4,0x00000012,0x0004002b,
+0x0000000d,0x000000c3,0x00000000,0x0004002b,
+0x0000000d,0x000000cd,0x00000004,0x0004002b,
+0x0000000d,0x000000d7,0x00000007,0x0004002b,
+0x00000006,0x000000fb,0xfffffc01,0x0004002b,
+0x00000006,0x000000fc,0x000003ff,0x00040020,
+0x000000fe,0x00000007,0x00000013,0x0004002b,
+0x00000011,0x00000103,0x447fc000,0x00040020,
+0x00000105,0x00000007,0x00000011,0x0004002b,
+0x00000006,0x0000010b,0x000007ff,0x0004002b,
+0x00000011,0x00000110,0x44ffe000,0x0004002b,
+0x0000000d,0x00000119,0x000000ff,0x0004002b,
+0x0000000d,0x0000011d,0x0000ff00,0x0004002b,
+0x0000000d,0x00000122,0x00ff0000,0x0004002b,
+0x0000000d,0x00000127,0xff000000,0x00040017,
+0x0000012e,0x0000000d,0x00000003,0x00040020,
+0x0000012f,0x00000001,0x0000012e,0x0004003b,
+0x0000012f,0x00000130,0x00000001,0x0004001e,
+0x00000133,0x0000000d,0x0000000d,0x00040020,
+0x00000134,0x00000009,0x00000133,0x0004003b,
+0x00000134,0x00000135,0x00000009,0x00040020,
+0x00000136,0x00000009,0x0000000d,0x00040017,
+0x0000013e,0x0000000d,0x00000004,0x00040020,
+0x0000013f,0x00000007,0x0000013e,0x00090019,
+0x00000141,0x0000000d,0x00000002,0x00000000,
+0x00000000,0x00000000,0x00000002,0x0000001e,
+0x00040020,0x00000142,0x00000000,0x00000141,
+0x0004003b,0x00000142,0x00000143,0x00000000,
+0x00030029,0x0000000f,0x00000152,0x0004002b,
+0x0000000d,0x0000015d,0x00000003,0x00090019,
+0x00000175,0x00000011,0x00000002,0x00000000,
+0x00000000,0x00000000,0x00000002,0x00000011,
+0x00040020,0x00000176,0x00000000,0x00000175,
+0x0004003b,0x00000176,0x00000177,0x00000000,
+0x00040017,0x00000179,0x00000006,0x00000002,
+0x0004002b,0x00000011,0x00000195,0x00000000,
+0x0004002b,0x00000011,0x00000196,0x3f800000,
+0x00040017,0x00000197,0x00000011,0x00000004,
+0x0004002b,0x0000000d,0x0000019d,0x00000093,
+0x0004002b,0x0000000d,0x0000019e,0x00000094,
+0x0004002b,0x0000000d,0x0000019f,0x00000095,
+0x0004002b,0x0000000d,0x000001a0,0x00000096,
+0x0004002b,0x0000000d,0x000001a1,0x00000097,
+0x0004002b,0x0000000d,0x000001a2,0x00000098,
+0x0004002b,0x0000000d,0x000001a3,0x00000099,
+0x0004002b,0x0000000d,0x000001a4,0x0000009a,
+0x0004002b,0x0000000d,0x000001a5,0x0000009b,
+0x0004002b,0x0000000d,0x000001a6,0x0000009c,
+0x0004002b,0x0000000d,0x000001a7,0x00000008,
+0x0004001c,0x000001a8,0x00000006,0x000001a7,
+0x000b002c,0x000001a8,0x000001a9,0x00000081,
+0x00000061,0x00000050,0x00000067,0x00000065,
+0x0000004b,0x0000005d,0x0000007f,0x0004001c,
+0x000001aa,0x00000046,0x000001a7,0x0007002c,
+0x00000046,0x000001ab,0x00000050,0x00000052,
+0x0000005d,0x0000005f,0x0004002b,0x00000006,
+0x000001ac,0x00000011,0x0004002b,0x00000006,
+0x000001ad,0xffffffef,0x0007002c,0x00000046,
+0x000001ae,0x00000051,0x000001ac,0x0000005e,
+0x000001ad,0x0004002b,0x00000006,0x000001af,
+0x0000001d,0x0004002b,0x00000006,0x000001b0,
+0xffffffe3,0x0007002c,0x00000046,0x000001b1,
+0x0000005a,0x000001af,0x0000004d,0x000001b0,
+0x0004002b,0x00000006,0x000001b2,0x0000002a,
+0x0004002b,0x00000006,0x000001b3,0xffffffd6,
+0x0007002c,0x00000046,0x000001b4,0x0000009b,
+0x000001b2,0x00000057,0x000001b3,0x0004002b,
+0x00000006,0x000001b5,0x0000003c,0x0004002b,
+0x00000006,0x000001b6,0xffffffee,0x0004002b,
+0x00000006,0x000001b7,0xffffffc4,0x0007002c,
+0x00000046,0x000001b8,0x000000b4,0x000001b5,
+0x000001b6,0x000001b7,0x0004002b,0x00000006,
+0x000001b9,0x00000050,0x0004002b,0x00000006,
+0x000001ba,0xffffffe8,0x0004002b,0x00000006,
+0x000001bb,0xffffffb0,0x0007002c,0x00000046,
+0x000001bc,0x00000024,0x000001b9,0x000001ba,
+0x000001bb,0x0004002b,0x00000006,0x000001bd,
+0x00000021,0x0004002b,0x00000006,0x000001be,
+0x0000006a,0x0004002b,0x00000006,0x000001bf,
+0xffffffdf,0x0004002b,0x00000006,0x000001c0,
+0xffffff96,0x0007002c,0x00000046,0x000001c1,
+0x000001bd,0x000001be,0x000001bf,0x000001c0,
+0x0004002b,0x00000006,0x000001c2,0x0000002f,
+0x0004002b,0x00000006,0x000001c3,0x000000b7,
+0x0004002b,0x00000006,0x000001c4,0xffffffd1,
+0x0004002b,0x00000006,0x000001c5,0xffffff49,
+0x0007002c,0x00000046,0x000001c6,0x000001c2,
+0x000001c3,0x000001c4,0x000001c5,0x000b002c,
+0x000001aa,0x000001c7,0x000001ab,0x000001ae,
+0x000001b1,0x000001b4,0x000001b8,0x000001bc,
+0x000001c1,0x000001c6,0x0007002c,0x00000046,
+0x000001c8,0x00000081,0x00000052,0x00000081,
+0x0000005f,0x0007002c,0x00000046,0x000001c9,
+0x00000081,0x000001ac,0x00000081,0x000001ad,
+0x0007002c,0x00000046,0x000001ca,0x00000081,
+0x000001af,0x00000081,0x000001b0,0x0007002c,
+0x00000046,0x000001cb,0x00000081,0x000001b2,
+0x00000081,0x000001b3,0x0007002c,0x00000046,
+0x000001cc,0x00000081,0x000001b5,0x00000081,
+0x000001b7,0x0007002c,0x00000046,0x000001cd,
+0x00000081,0x000001b9,0x00000081,0x000001bb,
+0x0007002c,0x00000046,0x000001ce,0x00000081,
+0x000001be,0x00000081,0x000001c0,0x0007002c,
+0x00000046,0x000001cf,0x00000081,0x000001c3,
+0x00000081,0x000001c5,0x000b002c,0x000001aa,
+0x000001d0,0x000001c8,0x000001c9,0x000001ca,
+0x000001cb,0x000001cc,0x000001cd,0x000001ce,
+0x000001cf,0x0006002c,0x0000012e,0x000001d1,
+0x000001a7,0x000001a7,0x00000092,0x00050036,
+0x00000002,0x00000004,0x00000000,0x00000003,
+0x000200f8,0x00000005,0x0004003b,0x00000008,
+0x0000012d,0x00000007,0x0004003b,0x0000013f,
+0x00000140,0x00000007,0x0004003b,0x00000008,
+0x00000145,0x00000007,0x0004003b,0x000000fe,
+0x00000149,0x00000007,0x0004003b,0x0000000e,
+0x0000014a,0x00000007,0x0004003b,0x0000000e,
+0x0000014e,0x00000007,0x0004003b,0x0000000e,
+0x00000153,0x00000007,0x0004003b,0x0000000e,
+0x00000154,0x00000007,0x0004003b,0x00000010,
+0x00000155,0x00000007,0x0004003b,0x000000fe,
+0x00000157,0x00000007,0x0004003b,0x0000000e,
+0x00000158,0x00000007,0x0004003b,0x0000000e,
+0x0000015c,0x00000007,0x0004003b,0x0000000e,
+0x00000161,0x00000007,0x0004003b,0x0000000e,
+0x00000162,0x00000007,0x0004003b,0x00000010,
+0x00000163,0x00000007,0x0004003b,0x00000021,
+0x00000165,0x00000007,0x0004003b,0x00000021,
+0x0000016d,0x00000007,0x0004003b,0x00000008,
+0x00000187,0x00000007,0x0004003d,0x0000012e,
+0x00000131,0x00000130,0x0004007c,0x00000007,
+0x00000132,0x00000131,0x0003003e,0x0000012d,
+0x00000132,0x00050041,0x00000136,0x00000137,
+0x00000135,0x00000061,0x0004003d,0x0000000d,
+0x00000138,0x00000137,0x0004007c,0x00000006,
+0x00000139,0x00000138,0x00050041,0x00000021,
+0x0000013a,0x0000012d,0x00000089,0x0004003d,
+0x00000006,0x0000013b,0x0000013a,0x00050080,
+0x00000006,0x0000013c,0x0000013b,0x00000139,
+0x00050041,0x00000021,0x0000013d,0x0000012d,
+0x00000089,0x0003003e,0x0000013d,0x0000013c,
+0x0004003d,0x00000141,0x00000144,0x00000143,
+0x0004003d,0x00000007,0x00000146,0x0000012d,
+0x0003003e,0x00000145,0x00000146,0x00050039,
+0x00000007,0x00000147,0x0000000b,0x00000145,
+0x00050062,0x0000013e,0x00000148,0x00000144,
+0x00000147,0x0003003e,0x00000140,0x00000148,
+0x00050041,0x0000000e,0x0000014b,0x00000140,
+0x000000c3,0x0004003d,0x0000000d,0x0000014c,
+0x0000014b,0x0003003e,0x0000014a,0x0000014c,
+0x00050039,0x0000000d,0x0000014d,0x0000001c,
+0x0000014a,0x00050041,0x0000000e,0x0000014f,
+0x00000140,0x00000092,0x0004003d,0x0000000d,
+0x00000150,0x0000014f,0x0003003e,0x0000014e,
+0x00000150,0x00050039,0x0000000d,0x00000151,
+0x0000001c,0x0000014e,0x0003003e,0x00000153,
+0x0000014d,0x0003003e,0x00000154,0x00000151,
+0x0003003e,0x00000155,0x00000152,0x00070039,
+0x00000013,0x00000156,0x00000018,0x00000153,
+0x00000154,0x00000155,0x0003003e,0x00000149,
+0x00000156,0x00050041,0x0000000e,0x00000159,
+0x00000140,0x00000089,0x0004003d,0x0000000d,
+0x0000015a,0x00000159,0x0003003e,0x00000158,
+0x0000015a,0x00050039,0x0000000d,0x0000015b,
+0x0000001c,0x00000158,0x00050041,0x0000000e,
+0x0000015e,0x00000140,0x0000015d,0x0004003d,
+0x0000000d,0x0000015f,0x0000015e,0x0003003e,
+0x0000015c,0x0000015f,0x00050039,0x0000000d,
+0x00000160,0x0000001c,0x0000015c,0x0003003e,
+0x00000161,0x0000015b,0x0003003e,0x00000162,
+0x00000160,0x0003003e,0x00000163,0x00000152,
+0x00070039,0x00000013,0x00000164,0x00000018,
+0x00000161,0x00000162,0x00000163,0x0003003e,
+0x00000157,0x00000164,0x0003003e,0x00000165,
+0x00000081,0x000200f9,0x00000166,0x000200f8,
+0x00000166,0x000400f6,0x00000168,0x00000169,
+0x00000000,0x000200f9,0x0000016a,0x000200f8,
+0x0000016a,0x0004003d,0x00000006,0x0000016b,
+0x00000165,0x000500b1,0x0000000f,0x0000016c,
+0x0000016b,0x00000062,0x000400fa,0x0000016c,
+0x00000167,0x00000168,0x000200f8,0x00000167,
+0x0003003e,0x0000016d,0x00000081,0x000200f9,
+0x0000016e,0x000200f8,0x0000016e,0x000400f6,
+0x00000170,0x00000171,0x00000000,0x000200f9,
+0x00000172,0x000200f8,0x00000172,0x0004003d,
+0x00000006,0x00000173,0x0000016d,0x000500b1,
+0x0000000f,0x00000174,0x00000173,0x00000062,
+0x000400fa,0x00000174,0x0000016f,0x00000170,
+0x000200f8,0x0000016f,0x0004003d,0x00000175,
+0x00000178,0x00000177,0x0004003d,0x00000007,
+0x0000017a,0x0000012d,0x0007004f,0x00000179,
+0x0000017b,0x0000017a,0x0000017a,0x00000000,
+0x00000001,0x00050050,0x00000179,0x0000017c,
+0x00000062,0x00000062,0x00050084,0x00000179,
+0x0000017d,0x0000017b,0x0000017c,0x0004003d,
+0x00000006,0x0000017e,0x0000016d,0x0004003d,
+0x00000006,0x0000017f,0x00000165,0x00050050,
+0x00000179,0x00000180,0x0000017e,0x0000017f,
+0x00050080,0x00000179,0x00000181,0x0000017d,
+0x00000180,0x00050041,0x00000021,0x00000182,
+0x0000012d,0x00000089,0x0004003d,0x00000006,
+0x00000183,0x00000182,0x00050051,0x00000006,
+0x00000184,0x00000181,0x00000000,0x00050051,
+0x00000006,0x00000185,0x00000181,0x00000001,
+0x00060050,0x00000007,0x00000186,0x00000184,
+0x00000185,0x00000183,0x0003003e,0x00000187,
+0x00000186,0x00050039,0x00000007,0x00000188,
+0x0000000b,0x00000187,0x0004003d,0x00000006,
+0x00000189,0x00000165,0x00050084,0x00000006,
+0x0000018a,0x00000189,0x00000062,0x0004003d,
+0x00000006,0x0000018b,0x0000016d,0x00050080,
+0x00000006,0x0000018c,0x0000018a,0x0000018b,
+0x00050041,0x00000105,0x0000018d,0x00000149,
+0x0000018c,0x0004003d,0x00000011,0x0000018e,
+0x0000018d,0x0004003d,0x00000006,0x0000018f,
+0x00000165,0x00050084,0x00000006,0x00000190,
+0x0000018f,0x00000062,0x0004003d,0x00000006,
+0x00000191,0x0000016d,0x00050080,0x00000006,
+0x00000192,0x00000190,0x00000191,0x00050041,
+0x00000105,0x00000193,0x00000157,0x00000192,
+0x0004003d,0x00000011,0x00000194,0x00000193,
+0x00070050,0x00000197,0x00000198,0x0000018e,
+0x00000194,0x00000195,0x00000196,0x00040063,
+0x00000178,0x00000188,0x00000198,0x000200f9,
+0x00000171,0x000200f8,0x00000171,0x0004003d,
+0x00000006,0x00000199,0x0000016d,0x00050080,
+0x00000006,0x0000019a,0x00000199,0x00000061,
+0x0003003e,0x0000016d,0x0000019a,0x000200f9,
+0x0000016e,0x000200f8,0x00000170,0x000200f9,
+0x00000169,0x000200f8,0x00000169,0x0004003d,
+0x00000006,0x0000019b,0x00000165,0x00050080,
+0x00000006,0x0000019c,0x0000019b,0x00000061,
+0x0003003e,0x00000165,0x0000019c,0x000200f9,
+0x00000166,0x000200f8,0x00000168,0x000100fd,
+0x00010038,0x00050036,0x00000007,0x0000000b,
+0x00000000,0x00000009,0x00030037,0x00000008,
+0x0000000a,0x000200f8,0x0000000c,0x0004003d,
+0x00000007,0x0000001e,0x0000000a,0x000200fe,
+0x0000001e,0x00010038,0x00050036,0x00000013,
+0x00000018,0x00000000,0x00000014,0x00030037,
+0x0000000e,0x00000015,0x00030037,0x0000000e,
+0x00000016,0x00030037,0x00000010,0x00000017,
+0x000200f8,0x00000019,0x0004003b,0x00000021,
+0x00000022,0x00000007,0x0004003b,0x00000021,
+0x00000038,0x00000007,0x0004003b,0x0000000e,
+0x00000040,0x00000007,0x0004003b,0x00000047,
+0x00000048,0x00000007,0x0004003b,0x0000008b,
+0x0000008c,0x00000007,0x0004003b,0x00000047,
+0x0000008f,0x00000007,0x0004003b,0x0000008b,
+0x00000094,0x00000007,0x0004003b,0x00000098,
+0x00000099,0x00000007,0x0004003b,0x0000000e,
+0x000000c2,0x00000007,0x0004003b,0x0000000e,
+0x000000cb,0x00000007,0x0004003b,0x0000000e,
+0x000000d3,0x00000007,0x0004003b,0x00000021,
+0x000000d9,0x00000007,0x0004003b,0x00000021,
+0x000000dc,0x00000007,0x0004003b,0x00000021,
+0x000000e8,0x00000007,0x0004003b,0x000000fe,
+0x000000ff,0x00000007,0x0004003d,0x0000000d,
+0x00000023,0x00000015,0x000500c2,0x0000000d,
+0x00000025,0x00000023,0x00000024,0x0004007c,
+0x00000006,0x00000026,0x00000025,0x0003003e,
+0x00000022,0x00000026,0x0004003d,0x0000000f,
+0x00000027,0x00000017,0x000300f7,0x00000029,
+0x00000000,0x000400fa,0x00000027,0x00000028,
+0x00000029,0x000200f8,0x00000028,0x0004003d,
+0x00000006,0x0000002a,0x00000022,0x000500af,
+0x0000000f,0x0000002c,0x0000002a,0x0000002b,
+0x000300f7,0x0000002e,0x00000000,0x000400fa,
+0x0000002c,0x0000002d,0x0000002e,0x000200f8,
+0x0000002d,0x0004003d,0x00000006,0x00000030,
+0x00000022,0x00050082,0x00000006,0x00000031,
+0x00000030,0x0000002f,0x0003003e,0x00000022,
+0x00000031,0x000200f9,0x0000002e,0x000200f8,
+0x0000002e,0x0004003d,0x00000006,0x00000032,
+0x00000022,0x000500aa,0x0000000f,0x00000034,
+0x00000032,0x00000033,0x000300f7,0x00000036,
+0x00000000,0x000400fa,0x00000034,0x00000035,
+0x00000036,0x000200f8,0x00000035,0x0003003e,
+0x00000022,0x00000037,0x000200f9,0x00000036,
+0x000200f8,0x00000036,0x000200f9,0x00000029,
+0x000200f8,0x00000029,0x0004003d,0x0000000d,
+0x00000039,0x00000015,0x000500c2,0x0000000d,
+0x0000003b,0x00000039,0x0000003a,0x0004007c,
+0x00000006,0x0000003c,0x0000003b,0x0003003e,
+0x00000038,0x0000003c,0x0004003d,0x00000006,
+0x0000003e,0x00000038,0x000500c7,0x00000006,
+0x0000003f,0x0000003e,0x0000003d,0x0003003e,
+0x00000038,0x0000003f,0x0004003d,0x0000000d,
+0x00000041,0x00000015,0x000500c2,0x0000000d,
+0x00000043,0x00000041,0x00000042,0x000500c7,
+0x0000000d,0x00000045,0x00000043,0x00000044,
+0x0003003e,0x00000040,0x00000045,0x0004003d,
+0x0000000d,0x00000088,0x00000040,0x00050084,
+0x0000000d,0x0000008a,0x00000088,0x00000089,
+0x0003003e,0x0000008c,0x00000087,0x00050041,
+0x00000047,0x0000008d,0x0000008c,0x0000008a,
+0x0004003d,0x00000046,0x0000008e,0x0000008d,
+0x0003003e,0x00000048,0x0000008e,0x0004003d,
+0x0000000d,0x00000090,0x00000040,0x00050084,
+0x0000000d,0x00000091,0x00000090,0x00000089,
+0x00050080,0x0000000d,0x00000093,0x00000091,
+0x00000092,0x0003003e,0x00000094,0x00000087,
+0x00050041,0x00000047,0x00000095,0x00000094,
+0x00000093,0x0004003d,0x00000046,0x00000096,
+0x00000095,0x0003003e,0x0000008f,0x00000096,
+0x0004003d,0x0000000d,0x0000009a,0x00000015,
+0x000500c2,0x0000000d,0x0000009c,0x0000009a,
+0x0000009b,0x0004003d,0x0000000d,0x0000009d,
+0x00000015,0x000500c2,0x0000000d,0x0000009e,
+0x0000009d,0x0000006f,0x0004003d,0x0000000d,
+0x0000009f,0x00000015,0x000500c2,0x0000000d,
+0x000000a0,0x0000009f,0x00000063,0x0004003d,
+0x0000000d,0x000000a1,0x00000015,0x000500c2,
+0x0000000d,0x000000a2,0x000000a1,0x00000062,
+0x0004003d,0x0000000d,0x000000a3,0x00000015,
+0x000500c2,0x0000000d,0x000000a4,0x000000a3,
+0x00000061,0x0004003d,0x0000000d,0x000000a5,
+0x00000015,0x000500c4,0x0000000d,0x000000a6,
+0x000000a5,0x00000050,0x0004003d,0x0000000d,
+0x000000a7,0x00000016,0x000500c2,0x0000000d,
+0x000000a9,0x000000a7,0x000000a8,0x000500c5,
+0x0000000d,0x000000aa,0x000000a6,0x000000a9,
+0x0004003d,0x0000000d,0x000000ab,0x00000016,
+0x000500c2,0x0000000d,0x000000ad,0x000000ab,
+0x000000ac,0x0004003d,0x0000000d,0x000000ae,
+0x00000016,0x000500c2,0x0000000d,0x000000af,
+0x000000ae,0x00000024,0x0004003d,0x0000000d,
+0x000000b0,0x00000016,0x000500c2,0x0000000d,
+0x000000b2,0x000000b0,0x000000b1,0x0004003d,
+0x0000000d,0x000000b3,0x00000016,0x000500c2,
+0x0000000d,0x000000b5,0x000000b3,0x000000b4,
+0x0004003d,0x0000000d,0x000000b6,0x00000016,
+0x000500c2,0x0000000d,0x000000b7,0x000000b6,
+0x0000003d,0x0004003d,0x0000000d,0x000000b8,
+0x00000016,0x000500c2,0x0000000d,0x000000b9,
+0x000000b8,0x0000005b,0x0004003d,0x0000000d,
+0x000000ba,0x00000016,0x000500c2,0x0000000d,
+0x000000bb,0x000000ba,0x0000005a,0x0004003d,
+0x0000000d,0x000000bc,0x00000016,0x000500c2,
+0x0000000d,0x000000bd,0x000000bc,0x00000059,
+0x0004003d,0x0000000d,0x000000be,0x00000016,
+0x000500c2,0x0000000d,0x000000bf,0x000000be,
+0x00000067,0x0004003d,0x0000000d,0x000000c0,
+0x00000016,0x00130050,0x00000097,0x000000c1,
+0x0000009c,0x0000009e,0x000000a0,0x000000a2,
+0x000000a4,0x000000aa,0x000000ad,0x000000af,
+0x000000b2,0x000000b5,0x000000b7,0x000000b9,
+0x000000bb,0x000000bd,0x000000bf,0x000000c0,
+0x0003003e,0x00000099,0x000000c1,0x0003003e,
+0x000000c2,0x000000c3,0x000200f9,0x000000c4,
+0x000200f8,0x000000c4,0x000400f6,0x000000c6,
+0x000000c7,0x00000000,0x000200f9,0x000000c8,
+0x000200f8,0x000000c8,0x0004003d,0x0000000d,
+0x000000c9,0x000000c2,0x000500b0,0x0000000f,
+0x000000ca,0x000000c9,0x00000012,0x000400fa,
+0x000000ca,0x000000c5,0x000000c6,0x000200f8,
+0x000000c5,0x0004003d,0x0000000d,0x000000cc,
+0x000000c2,0x00050089,0x0000000d,0x000000ce,
+0x000000cc,0x000000cd,0x00050084,0x0000000d,
+0x000000cf,0x000000ce,0x000000cd,0x0004003d,
+0x0000000d,0x000000d0,0x000000c2,0x00050086,
+0x0000000d,0x000000d1,0x000000d0,0x000000cd,
+0x00050080,0x0000000d,0x000000d2,0x000000cf,
+0x000000d1,0x0003003e,0x000000cb,0x000000d2,
+0x0004003d,0x0000000d,0x000000d4,0x000000c2,
+0x00050041,0x0000000e,0x000000d5,0x00000099,
+0x000000d4,0x0004003d,0x0000000d,0x000000d6,
+0x000000d5,0x000500c7,0x0000000d,0x000000d8,
+0x000000d6,0x000000d7,0x0003003e,0x000000d3,
+0x000000d8,0x0004003d,0x0000000d,0x000000da,
+0x000000d3,0x000500ae,0x0000000f,0x000000db,
+0x000000da,0x000000cd,0x000300f7,0x000000de,
+0x00000000,0x000400fa,0x000000db,0x000000dd,
+0x000000e3,0x000200f8,0x000000dd,0x0004003d,
+0x0000000d,0x000000df,0x000000d3,0x00050082,
+0x0000000d,0x000000e0,0x000000df,0x000000cd,
+0x00050041,0x00000021,0x000000e1,0x0000008f,
+0x000000e0,0x0004003d,0x00000006,0x000000e2,
+0x000000e1,0x0003003e,0x000000dc,0x000000e2,
+0x000200f9,0x000000de,0x000200f8,0x000000e3,
+0x0004003d,0x0000000d,0x000000e4,0x000000d3,
+0x00050041,0x00000021,0x000000e5,0x00000048,
+0x000000e4,0x0004003d,0x00000006,0x000000e6,
+0x000000e5,0x0003003e,0x000000dc,0x000000e6,
+0x000200f9,0x000000de,0x000200f8,0x000000de,
+0x0004003d,0x00000006,0x000000e7,0x000000dc,
+0x0003003e,0x000000d9,0x000000e7,0x0004003d,
+0x00000006,0x000000e9,0x00000022,0x0004003d,
+0x00000006,0x000000ea,0x000000d9,0x0004003d,
+0x00000006,0x000000eb,0x00000038,0x00050084,
+0x00000006,0x000000ec,0x000000ea,0x000000eb,
+0x00050080,0x00000006,0x000000ed,0x000000e9,
+0x000000ec,0x0003003e,0x000000e8,0x000000ed,
+0x0004003d,0x00000006,0x000000ee,0x000000e8,
+0x00050084,0x00000006,0x000000ef,0x000000ee,
+0x00000052,0x0003003e,0x000000e8,0x000000ef,
+0x0004003d,0x00000006,0x000000f0,0x00000038,
+0x000500aa,0x0000000f,0x000000f1,0x000000f0,
+0x00000081,0x000300f7,0x000000f3,0x00000000,
+0x000400fa,0x000000f1,0x000000f2,0x000000f3,
+0x000200f8,0x000000f2,0x0004003d,0x00000006,
+0x000000f4,0x000000d9,0x0004003d,0x00000006,
+0x000000f5,0x000000e8,0x00050080,0x00000006,
+0x000000f6,0x000000f5,0x000000f4,0x0003003e,
+0x000000e8,0x000000f6,0x000200f9,0x000000f3,
+0x000200f8,0x000000f3,0x0004003d,0x0000000f,
+0x000000f7,0x00000017,0x000300f7,0x000000f9,
+0x00000000,0x000400fa,0x000000f7,0x000000f8,
+0x00000107,0x000200f8,0x000000f8,0x0004003d,
+0x00000006,0x000000fa,0x000000e8,0x0008000c,
+0x00000006,0x000000fd,0x00000001,0x0000002d,
+0x000000fa,0x000000fb,0x000000fc,0x0003003e,
+0x000000e8,0x000000fd,0x0004003d,0x0000000d,
+0x00000100,0x000000cb,0x0004003d,0x00000006,
+0x00000101,0x000000e8,0x0004006f,0x00000011,
+0x00000102,0x00000101,0x00050088,0x00000011,
+0x00000104,0x00000102,0x00000103,0x00050041,
+0x00000105,0x00000106,0x000000ff,0x00000100,
+0x0003003e,0x00000106,0x00000104,0x000200f9,
+0x000000f9,0x000200f8,0x00000107,0x0004003d,
+0x00000006,0x00000108,0x000000e8,0x00050080,
+0x00000006,0x00000109,0x00000108,0x00000062,
+0x0003003e,0x000000e8,0x00000109,0x0004003d,
+0x00000006,0x0000010a,0x000000e8,0x0008000c,
+0x00000006,0x0000010c,0x00000001,0x0000002d,
+0x0000010a,0x00000081,0x0000010b,0x0003003e,
+0x000000e8,0x0000010c,0x0004003d,0x0000000d,
+0x0000010d,0x000000cb,0x0004003d,0x00000006,
+0x0000010e,0x000000e8,0x0004006f,0x00000011,
+0x0000010f,0x0000010e,0x00050088,0x00000011,
+0x00000111,0x0000010f,0x00000110,0x00050041,
+0x00000105,0x00000112,0x000000ff,0x0000010d,
+0x0003003e,0x00000112,0x00000111,0x000200f9,
+0x000000f9,0x000200f8,0x000000f9,0x000200f9,
+0x000000c7,0x000200f8,0x000000c7,0x0004003d,
+0x0000000d,0x00000113,0x000000c2,0x00050080,
+0x0000000d,0x00000114,0x00000113,0x00000061,
+0x0003003e,0x000000c2,0x00000114,0x000200f9,
+0x000000c4,0x000200f8,0x000000c6,0x0004003d,
+0x00000013,0x00000115,0x000000ff,0x000200fe,
+0x00000115,0x00010038,0x00050036,0x0000000d,
+0x0000001c,0x00000000,0x0000001a,0x00030037,
+0x0000000e,0x0000001b,0x000200f8,0x0000001d,
+0x0004003d,0x0000000d,0x00000118,0x0000001b,
+0x000500c7,0x0000000d,0x0000011a,0x00000118,
+0x00000119,0x000500c4,0x0000000d,0x0000011b,
+0x0000011a,0x00000024,0x0004003d,0x0000000d,
+0x0000011c,0x0000001b,0x000500c7,0x0000000d,
+0x0000011e,0x0000011c,0x0000011d,0x000500c4,
+0x0000000d,0x0000011f,0x0000011e,0x00000052,
+0x000500c5,0x0000000d,0x00000120,0x0000011b,
+0x0000011f,0x0004003d,0x0000000d,0x00000121,
+0x0000001b,0x000500c7,0x0000000d,0x00000123,
+0x00000121,0x00000122,0x000500c2,0x0000000d,
+0x00000124,0x00000123,0x00000052,0x000500c5,
+0x0000000d,0x00000125,0x00000120,0x00000124,
+0x0004003d,0x0000000d,0x00000126,0x0000001b,
+0x000500c7,0x0000000d,0x00000128,0x00000126,
+0x00000127,0x000500c2,0x0000000d,0x00000129,
+0x00000128,0x00000024,0x000500c5,0x0000000d,
+0x0000012a,0x00000125,0x00000129,0x000200fe,
+0x0000012a,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_1D.inl
new file mode 100644
index 00000000000..26c74a23217
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_1D.inl
@@ -0,0 +1,673 @@
+0x07230203,0x00010300,0x000d000a,0x000001d3,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x00020011,0x00000031,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x00000132,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00070005,0x0000000c,0x50746567,
+0x4431736f,0x61727241,0x69762879,0x00003b33,
+0x00030005,0x0000000b,0x00736f70,0x000e0005,
+0x00000019,0x5f636165,0x6f636564,0x735f6564,
+0x6c676e69,0x68635f65,0x656e6e61,0x6c625f6c,
+0x5f6b636f,0x616f6c66,0x31752874,0x3b31753b,
+0x003b3162,0x00040005,0x00000016,0x68676968,
+0x00000000,0x00030005,0x00000017,0x00776f6c,
+0x00050005,0x00000018,0x69537369,0x64656e67,
+0x00000000,0x00050005,0x0000001d,0x70696c66,
+0x75283233,0x00003b31,0x00030005,0x0000001c,
+0x00000061,0x00060005,0x00000024,0x65736162,
+0x646f635f,0x726f7765,0x00000064,0x00050005,
+0x0000003a,0x746c756d,0x696c7069,0x00007265,
+0x00040005,0x00000042,0x496c6274,0x00007864,
+0x00040005,0x0000004a,0x6c626174,0x00003065,
+0x00050005,0x0000008e,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000091,0x6c626174,
+0x00003165,0x00050005,0x00000096,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x0000009b,
+0x00000070,0x00030005,0x000000c4,0x00000069,
+0x00040005,0x000000cd,0x4974756f,0x00007864,
+0x00050005,0x000000d5,0x69646f6d,0x72656966,
+0x00000000,0x00060005,0x000000db,0x69646f6d,
+0x72656966,0x756c6156,0x00000065,0x00040005,
+0x000000ea,0x6f636564,0x00646564,0x00040005,
+0x00000101,0x75736572,0x0000746c,0x00030005,
+0x0000012f,0x00736f70,0x00080005,0x00000132,
+0x475f6c67,0x61626f6c,0x766e496c,0x7461636f,
+0x496e6f69,0x00000044,0x00070005,0x00000135,
+0x67616d49,0x726f4665,0x4274616d,0x6b636f6c,
+0x00000000,0x00060006,0x00000135,0x00000000,
+0x706d6f63,0x6d726f46,0x00007461,0x00060006,
+0x00000135,0x00000001,0x65736162,0x6579614c,
+0x00000072,0x00060005,0x00000137,0x75705f75,
+0x6f436873,0x6174736e,0x0000746e,0x00050005,
+0x00000142,0x42637273,0x6b636f6c,0x00000000,
+0x00050005,0x00000145,0x6d695f75,0x30656761,
+0x00000000,0x00040005,0x00000147,0x61726170,
+0x0000006d,0x00060005,0x0000014b,0x6f636564,
+0x6572706d,0x64657373,0x00000052,0x00040005,
+0x0000014c,0x61726170,0x0000006d,0x00040005,
+0x00000150,0x61726170,0x0000006d,0x00040005,
+0x00000155,0x61726170,0x0000006d,0x00040005,
+0x00000156,0x61726170,0x0000006d,0x00040005,
+0x00000157,0x61726170,0x0000006d,0x00060005,
+0x00000159,0x6f636564,0x6572706d,0x64657373,
+0x00000047,0x00040005,0x0000015a,0x61726170,
+0x0000006d,0x00040005,0x0000015e,0x61726170,
+0x0000006d,0x00040005,0x00000163,0x61726170,
+0x0000006d,0x00040005,0x00000164,0x61726170,
+0x0000006d,0x00040005,0x00000165,0x61726170,
+0x0000006d,0x00030005,0x00000167,0x00000079,
+0x00030005,0x0000016f,0x00000078,0x00050005,
+0x00000179,0x6d695f75,0x31656761,0x00000000,
+0x00040005,0x00000188,0x61726170,0x0000006d,
+0x00040047,0x00000132,0x0000000b,0x0000001c,
+0x00050048,0x00000135,0x00000000,0x00000023,
+0x00000000,0x00050048,0x00000135,0x00000001,
+0x00000023,0x00000004,0x00030047,0x00000135,
+0x00000002,0x00040047,0x00000145,0x00000022,
+0x00000000,0x00040047,0x00000145,0x00000021,
+0x00000000,0x00030047,0x00000145,0x00000018,
+0x00040047,0x00000179,0x00000022,0x00000000,
+0x00040047,0x00000179,0x00000021,0x00000001,
+0x00030047,0x00000179,0x00000019,0x00040047,
+0x000001d2,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000001,
+0x00040017,0x00000007,0x00000006,0x00000003,
+0x00040020,0x00000008,0x00000007,0x00000007,
+0x00040017,0x00000009,0x00000006,0x00000002,
+0x00040021,0x0000000a,0x00000009,0x00000008,
+0x00040015,0x0000000e,0x00000020,0x00000000,
+0x00040020,0x0000000f,0x00000007,0x0000000e,
+0x00020014,0x00000010,0x00040020,0x00000011,
+0x00000007,0x00000010,0x00030016,0x00000012,
+0x00000020,0x0004002b,0x0000000e,0x00000013,
+0x00000010,0x0004001c,0x00000014,0x00000012,
+0x00000013,0x00060021,0x00000015,0x00000014,
+0x0000000f,0x0000000f,0x00000011,0x00040021,
+0x0000001b,0x0000000e,0x0000000f,0x00040020,
+0x00000023,0x00000007,0x00000006,0x0004002b,
+0x00000006,0x00000026,0x00000018,0x0004002b,
+0x00000006,0x0000002d,0x00000080,0x0004002b,
+0x00000006,0x00000031,0x00000100,0x0004002b,
+0x00000006,0x00000035,0xffffff80,0x0004002b,
+0x00000006,0x00000039,0xffffff81,0x0004002b,
+0x00000006,0x0000003c,0x00000014,0x0004002b,
+0x00000006,0x0000003f,0x0000000f,0x0004002b,
+0x00000006,0x00000044,0x00000010,0x0004002b,
+0x0000000e,0x00000046,0x0000000f,0x00040017,
+0x00000048,0x00000006,0x00000004,0x00040020,
+0x00000049,0x00000007,0x00000048,0x0004002b,
+0x0000000e,0x0000004b,0x00000020,0x0004001c,
+0x0000004c,0x00000048,0x0000004b,0x0004002b,
+0x00000006,0x0000004d,0xfffffffd,0x0004002b,
+0x00000006,0x0000004e,0xfffffffa,0x0004002b,
+0x00000006,0x0000004f,0xfffffff7,0x0004002b,
+0x00000006,0x00000050,0xfffffff1,0x0007002c,
+0x00000048,0x00000051,0x0000004d,0x0000004e,
+0x0000004f,0x00000050,0x0004002b,0x00000006,
+0x00000052,0x00000002,0x0004002b,0x00000006,
+0x00000053,0x00000005,0x0004002b,0x00000006,
+0x00000054,0x00000008,0x0004002b,0x00000006,
+0x00000055,0x0000000e,0x0007002c,0x00000048,
+0x00000056,0x00000052,0x00000053,0x00000054,
+0x00000055,0x0004002b,0x00000006,0x00000057,
+0xfffffff9,0x0004002b,0x00000006,0x00000058,
+0xfffffff6,0x0004002b,0x00000006,0x00000059,
+0xfffffff3,0x0007002c,0x00000048,0x0000005a,
+0x0000004d,0x00000057,0x00000058,0x00000059,
+0x0004002b,0x00000006,0x0000005b,0x00000006,
+0x0004002b,0x00000006,0x0000005c,0x00000009,
+0x0004002b,0x00000006,0x0000005d,0x0000000c,
+0x0007002c,0x00000048,0x0000005e,0x00000052,
+0x0000005b,0x0000005c,0x0000005d,0x0004002b,
+0x00000006,0x0000005f,0xfffffffe,0x0004002b,
+0x00000006,0x00000060,0xfffffffb,0x0004002b,
+0x00000006,0x00000061,0xfffffff8,0x0007002c,
+0x00000048,0x00000062,0x0000005f,0x00000060,
+0x00000061,0x00000059,0x0004002b,0x00000006,
+0x00000063,0x00000001,0x0004002b,0x00000006,
+0x00000064,0x00000004,0x0004002b,0x00000006,
+0x00000065,0x00000007,0x0007002c,0x00000048,
+0x00000066,0x00000063,0x00000064,0x00000065,
+0x0000005d,0x0004002b,0x00000006,0x00000067,
+0xfffffffc,0x0007002c,0x00000048,0x00000068,
+0x0000005f,0x00000067,0x0000004e,0x00000059,
+0x0004002b,0x00000006,0x00000069,0x00000003,
+0x0007002c,0x00000048,0x0000006a,0x00000063,
+0x00000069,0x00000053,0x0000005d,0x0004002b,
+0x00000006,0x0000006b,0xfffffff4,0x0007002c,
+0x00000048,0x0000006c,0x0000004d,0x0000004e,
+0x00000061,0x0000006b,0x0004002b,0x00000006,
+0x0000006d,0x0000000b,0x0007002c,0x00000048,
+0x0000006e,0x00000052,0x00000053,0x00000065,
+0x0000006d,0x0004002b,0x00000006,0x0000006f,
+0xfffffff5,0x0007002c,0x00000048,0x00000070,
+0x0000004d,0x00000057,0x0000004f,0x0000006f,
+0x0004002b,0x00000006,0x00000071,0x0000000a,
+0x0007002c,0x00000048,0x00000072,0x00000052,
+0x0000005b,0x00000054,0x00000071,0x0007002c,
+0x00000048,0x00000073,0x00000067,0x00000057,
+0x00000061,0x0000006f,0x0007002c,0x00000048,
+0x00000074,0x00000069,0x0000005b,0x00000065,
+0x00000071,0x0007002c,0x00000048,0x00000075,
+0x0000004d,0x00000060,0x00000061,0x0000006f,
+0x0007002c,0x00000048,0x00000076,0x00000052,
+0x00000064,0x00000065,0x00000071,0x0007002c,
+0x00000048,0x00000077,0x0000005f,0x0000004e,
+0x00000061,0x00000058,0x0007002c,0x00000048,
+0x00000078,0x00000063,0x00000053,0x00000065,
+0x0000005c,0x0007002c,0x00000048,0x00000079,
+0x0000005f,0x00000060,0x00000061,0x00000058,
+0x0007002c,0x00000048,0x0000007a,0x00000063,
+0x00000064,0x00000065,0x0000005c,0x0007002c,
+0x00000048,0x0000007b,0x0000005f,0x00000067,
+0x00000061,0x00000058,0x0007002c,0x00000048,
+0x0000007c,0x00000063,0x00000069,0x00000065,
+0x0000005c,0x0007002c,0x00000048,0x0000007d,
+0x0000005f,0x00000060,0x00000057,0x00000058,
+0x0007002c,0x00000048,0x0000007e,0x00000063,
+0x00000064,0x0000005b,0x0000005c,0x0007002c,
+0x00000048,0x0000007f,0x0000004d,0x00000067,
+0x00000057,0x00000058,0x0007002c,0x00000048,
+0x00000080,0x00000052,0x00000069,0x0000005b,
+0x0000005c,0x0004002b,0x00000006,0x00000081,
+0xffffffff,0x0007002c,0x00000048,0x00000082,
+0x00000081,0x0000005f,0x0000004d,0x00000058,
+0x0004002b,0x00000006,0x00000083,0x00000000,
+0x0007002c,0x00000048,0x00000084,0x00000083,
+0x00000063,0x00000052,0x0000005c,0x0007002c,
+0x00000048,0x00000085,0x00000067,0x0000004e,
+0x00000061,0x0000004f,0x0007002c,0x00000048,
+0x00000086,0x00000069,0x00000053,0x00000065,
+0x00000054,0x0007002c,0x00000048,0x00000087,
+0x0000004d,0x00000060,0x00000057,0x0000004f,
+0x0007002c,0x00000048,0x00000088,0x00000052,
+0x00000064,0x0000005b,0x00000054,0x0023002c,
+0x0000004c,0x00000089,0x00000051,0x00000056,
+0x0000005a,0x0000005e,0x00000062,0x00000066,
+0x00000068,0x0000006a,0x0000006c,0x0000006e,
+0x00000070,0x00000072,0x00000073,0x00000074,
+0x00000075,0x00000076,0x00000077,0x00000078,
+0x00000079,0x0000007a,0x0000007b,0x0000007c,
+0x0000007d,0x0000007e,0x0000007f,0x00000080,
+0x00000082,0x00000084,0x00000085,0x00000086,
+0x00000087,0x00000088,0x0004002b,0x0000000e,
+0x0000008b,0x00000002,0x00040020,0x0000008d,
+0x00000007,0x0000004c,0x0004002b,0x0000000e,
+0x00000094,0x00000001,0x0004001c,0x00000099,
+0x0000000e,0x00000013,0x00040020,0x0000009a,
+0x00000007,0x00000099,0x0004002b,0x00000006,
+0x0000009d,0x0000000d,0x0004002b,0x00000006,
+0x000000aa,0x0000001e,0x0004002b,0x00000006,
+0x000000ae,0x0000001b,0x0004002b,0x00000006,
+0x000000b3,0x00000015,0x0004002b,0x00000006,
+0x000000b6,0x00000012,0x0004002b,0x0000000e,
+0x000000c5,0x00000000,0x0004002b,0x0000000e,
+0x000000cf,0x00000004,0x0004002b,0x0000000e,
+0x000000d9,0x00000007,0x0004002b,0x00000006,
+0x000000fd,0xfffffc01,0x0004002b,0x00000006,
+0x000000fe,0x000003ff,0x00040020,0x00000100,
+0x00000007,0x00000014,0x0004002b,0x00000012,
+0x00000105,0x447fc000,0x00040020,0x00000107,
+0x00000007,0x00000012,0x0004002b,0x00000006,
+0x0000010d,0x000007ff,0x0004002b,0x00000012,
+0x00000112,0x44ffe000,0x0004002b,0x0000000e,
+0x0000011b,0x000000ff,0x0004002b,0x0000000e,
+0x0000011f,0x0000ff00,0x0004002b,0x0000000e,
+0x00000124,0x00ff0000,0x0004002b,0x0000000e,
+0x00000129,0xff000000,0x00040017,0x00000130,
+0x0000000e,0x00000003,0x00040020,0x00000131,
+0x00000001,0x00000130,0x0004003b,0x00000131,
+0x00000132,0x00000001,0x0004001e,0x00000135,
+0x0000000e,0x0000000e,0x00040020,0x00000136,
+0x00000009,0x00000135,0x0004003b,0x00000136,
+0x00000137,0x00000009,0x00040020,0x00000138,
+0x00000009,0x0000000e,0x00040017,0x00000140,
+0x0000000e,0x00000004,0x00040020,0x00000141,
+0x00000007,0x00000140,0x00090019,0x00000143,
+0x0000000e,0x00000000,0x00000000,0x00000001,
+0x00000000,0x00000002,0x0000001e,0x00040020,
+0x00000144,0x00000000,0x00000143,0x0004003b,
+0x00000144,0x00000145,0x00000000,0x0003002a,
+0x00000010,0x00000154,0x0004002b,0x0000000e,
+0x0000015f,0x00000003,0x00090019,0x00000177,
+0x00000012,0x00000000,0x00000000,0x00000001,
+0x00000000,0x00000002,0x0000000c,0x00040020,
+0x00000178,0x00000000,0x00000177,0x0004003b,
+0x00000178,0x00000179,0x00000000,0x0004002b,
+0x00000012,0x00000196,0x00000000,0x0004002b,
+0x00000012,0x00000197,0x3f800000,0x00040017,
+0x00000198,0x00000012,0x00000004,0x0004002b,
+0x0000000e,0x0000019e,0x00000093,0x0004002b,
+0x0000000e,0x0000019f,0x00000094,0x0004002b,
+0x0000000e,0x000001a0,0x00000095,0x0004002b,
+0x0000000e,0x000001a1,0x00000096,0x0004002b,
+0x0000000e,0x000001a2,0x00000097,0x0004002b,
+0x0000000e,0x000001a3,0x00000098,0x0004002b,
+0x0000000e,0x000001a4,0x00000099,0x0004002b,
+0x0000000e,0x000001a5,0x0000009a,0x0004002b,
+0x0000000e,0x000001a6,0x0000009b,0x0004002b,
+0x0000000e,0x000001a7,0x0000009c,0x0004002b,
+0x0000000e,0x000001a8,0x00000008,0x0004001c,
+0x000001a9,0x00000006,0x000001a8,0x000b002c,
+0x000001a9,0x000001aa,0x00000083,0x00000063,
+0x00000052,0x00000069,0x00000067,0x0000004d,
+0x0000005f,0x00000081,0x0004001c,0x000001ab,
+0x00000048,0x000001a8,0x0007002c,0x00000048,
+0x000001ac,0x00000052,0x00000054,0x0000005f,
+0x00000061,0x0004002b,0x00000006,0x000001ad,
+0x00000011,0x0004002b,0x00000006,0x000001ae,
+0xffffffef,0x0007002c,0x00000048,0x000001af,
+0x00000053,0x000001ad,0x00000060,0x000001ae,
+0x0004002b,0x00000006,0x000001b0,0x0000001d,
+0x0004002b,0x00000006,0x000001b1,0xffffffe3,
+0x0007002c,0x00000048,0x000001b2,0x0000005c,
+0x000001b0,0x0000004f,0x000001b1,0x0004002b,
+0x00000006,0x000001b3,0x0000002a,0x0004002b,
+0x00000006,0x000001b4,0xffffffd6,0x0007002c,
+0x00000048,0x000001b5,0x0000009d,0x000001b3,
+0x00000059,0x000001b4,0x0004002b,0x00000006,
+0x000001b6,0x0000003c,0x0004002b,0x00000006,
+0x000001b7,0xffffffee,0x0004002b,0x00000006,
+0x000001b8,0xffffffc4,0x0007002c,0x00000048,
+0x000001b9,0x000000b6,0x000001b6,0x000001b7,
+0x000001b8,0x0004002b,0x00000006,0x000001ba,
+0x00000050,0x0004002b,0x00000006,0x000001bb,
+0xffffffe8,0x0004002b,0x00000006,0x000001bc,
+0xffffffb0,0x0007002c,0x00000048,0x000001bd,
+0x00000026,0x000001ba,0x000001bb,0x000001bc,
+0x0004002b,0x00000006,0x000001be,0x00000021,
+0x0004002b,0x00000006,0x000001bf,0x0000006a,
+0x0004002b,0x00000006,0x000001c0,0xffffffdf,
+0x0004002b,0x00000006,0x000001c1,0xffffff96,
+0x0007002c,0x00000048,0x000001c2,0x000001be,
+0x000001bf,0x000001c0,0x000001c1,0x0004002b,
+0x00000006,0x000001c3,0x0000002f,0x0004002b,
+0x00000006,0x000001c4,0x000000b7,0x0004002b,
+0x00000006,0x000001c5,0xffffffd1,0x0004002b,
+0x00000006,0x000001c6,0xffffff49,0x0007002c,
+0x00000048,0x000001c7,0x000001c3,0x000001c4,
+0x000001c5,0x000001c6,0x000b002c,0x000001ab,
+0x000001c8,0x000001ac,0x000001af,0x000001b2,
+0x000001b5,0x000001b9,0x000001bd,0x000001c2,
+0x000001c7,0x0007002c,0x00000048,0x000001c9,
+0x00000083,0x00000054,0x00000083,0x00000061,
+0x0007002c,0x00000048,0x000001ca,0x00000083,
+0x000001ad,0x00000083,0x000001ae,0x0007002c,
+0x00000048,0x000001cb,0x00000083,0x000001b0,
+0x00000083,0x000001b1,0x0007002c,0x00000048,
+0x000001cc,0x00000083,0x000001b3,0x00000083,
+0x000001b4,0x0007002c,0x00000048,0x000001cd,
+0x00000083,0x000001b6,0x00000083,0x000001b8,
+0x0007002c,0x00000048,0x000001ce,0x00000083,
+0x000001ba,0x00000083,0x000001bc,0x0007002c,
+0x00000048,0x000001cf,0x00000083,0x000001bf,
+0x00000083,0x000001c1,0x0007002c,0x00000048,
+0x000001d0,0x00000083,0x000001c4,0x00000083,
+0x000001c6,0x000b002c,0x000001ab,0x000001d1,
+0x000001c9,0x000001ca,0x000001cb,0x000001cc,
+0x000001cd,0x000001ce,0x000001cf,0x000001d0,
+0x0006002c,0x00000130,0x000001d2,0x000001a8,
+0x000001a8,0x00000094,0x00050036,0x00000002,
+0x00000004,0x00000000,0x00000003,0x000200f8,
+0x00000005,0x0004003b,0x00000008,0x0000012f,
+0x00000007,0x0004003b,0x00000141,0x00000142,
+0x00000007,0x0004003b,0x00000008,0x00000147,
+0x00000007,0x0004003b,0x00000100,0x0000014b,
+0x00000007,0x0004003b,0x0000000f,0x0000014c,
+0x00000007,0x0004003b,0x0000000f,0x00000150,
+0x00000007,0x0004003b,0x0000000f,0x00000155,
+0x00000007,0x0004003b,0x0000000f,0x00000156,
+0x00000007,0x0004003b,0x00000011,0x00000157,
+0x00000007,0x0004003b,0x00000100,0x00000159,
+0x00000007,0x0004003b,0x0000000f,0x0000015a,
+0x00000007,0x0004003b,0x0000000f,0x0000015e,
+0x00000007,0x0004003b,0x0000000f,0x00000163,
+0x00000007,0x0004003b,0x0000000f,0x00000164,
+0x00000007,0x0004003b,0x00000011,0x00000165,
+0x00000007,0x0004003b,0x00000023,0x00000167,
+0x00000007,0x0004003b,0x00000023,0x0000016f,
+0x00000007,0x0004003b,0x00000008,0x00000188,
+0x00000007,0x0004003d,0x00000130,0x00000133,
+0x00000132,0x0004007c,0x00000007,0x00000134,
+0x00000133,0x0003003e,0x0000012f,0x00000134,
+0x00050041,0x00000138,0x00000139,0x00000137,
+0x00000063,0x0004003d,0x0000000e,0x0000013a,
+0x00000139,0x0004007c,0x00000006,0x0000013b,
+0x0000013a,0x00050041,0x00000023,0x0000013c,
+0x0000012f,0x0000008b,0x0004003d,0x00000006,
+0x0000013d,0x0000013c,0x00050080,0x00000006,
+0x0000013e,0x0000013d,0x0000013b,0x00050041,
+0x00000023,0x0000013f,0x0000012f,0x0000008b,
+0x0003003e,0x0000013f,0x0000013e,0x0004003d,
+0x00000143,0x00000146,0x00000145,0x0004003d,
+0x00000007,0x00000148,0x0000012f,0x0003003e,
+0x00000147,0x00000148,0x00050039,0x00000009,
+0x00000149,0x0000000c,0x00000147,0x00050062,
+0x00000140,0x0000014a,0x00000146,0x00000149,
+0x0003003e,0x00000142,0x0000014a,0x00050041,
+0x0000000f,0x0000014d,0x00000142,0x000000c5,
+0x0004003d,0x0000000e,0x0000014e,0x0000014d,
+0x0003003e,0x0000014c,0x0000014e,0x00050039,
+0x0000000e,0x0000014f,0x0000001d,0x0000014c,
+0x00050041,0x0000000f,0x00000151,0x00000142,
+0x00000094,0x0004003d,0x0000000e,0x00000152,
+0x00000151,0x0003003e,0x00000150,0x00000152,
+0x00050039,0x0000000e,0x00000153,0x0000001d,
+0x00000150,0x0003003e,0x00000155,0x0000014f,
+0x0003003e,0x00000156,0x00000153,0x0003003e,
+0x00000157,0x00000154,0x00070039,0x00000014,
+0x00000158,0x00000019,0x00000155,0x00000156,
+0x00000157,0x0003003e,0x0000014b,0x00000158,
+0x00050041,0x0000000f,0x0000015b,0x00000142,
+0x0000008b,0x0004003d,0x0000000e,0x0000015c,
+0x0000015b,0x0003003e,0x0000015a,0x0000015c,
+0x00050039,0x0000000e,0x0000015d,0x0000001d,
+0x0000015a,0x00050041,0x0000000f,0x00000160,
+0x00000142,0x0000015f,0x0004003d,0x0000000e,
+0x00000161,0x00000160,0x0003003e,0x0000015e,
+0x00000161,0x00050039,0x0000000e,0x00000162,
+0x0000001d,0x0000015e,0x0003003e,0x00000163,
+0x0000015d,0x0003003e,0x00000164,0x00000162,
+0x0003003e,0x00000165,0x00000154,0x00070039,
+0x00000014,0x00000166,0x00000019,0x00000163,
+0x00000164,0x00000165,0x0003003e,0x00000159,
+0x00000166,0x0003003e,0x00000167,0x00000083,
+0x000200f9,0x00000168,0x000200f8,0x00000168,
+0x000400f6,0x0000016a,0x0000016b,0x00000000,
+0x000200f9,0x0000016c,0x000200f8,0x0000016c,
+0x0004003d,0x00000006,0x0000016d,0x00000167,
+0x000500b1,0x00000010,0x0000016e,0x0000016d,
+0x00000063,0x000400fa,0x0000016e,0x00000169,
+0x0000016a,0x000200f8,0x00000169,0x0003003e,
+0x0000016f,0x00000083,0x000200f9,0x00000170,
+0x000200f8,0x00000170,0x000400f6,0x00000172,
+0x00000173,0x00000000,0x000200f9,0x00000174,
+0x000200f8,0x00000174,0x0004003d,0x00000006,
+0x00000175,0x0000016f,0x000500b1,0x00000010,
+0x00000176,0x00000175,0x00000064,0x000400fa,
+0x00000176,0x00000171,0x00000172,0x000200f8,
+0x00000171,0x0004003d,0x00000177,0x0000017a,
+0x00000179,0x0004003d,0x00000007,0x0000017b,
+0x0000012f,0x0007004f,0x00000009,0x0000017c,
+0x0000017b,0x0000017b,0x00000000,0x00000001,
+0x00050050,0x00000009,0x0000017d,0x00000064,
+0x00000064,0x00050084,0x00000009,0x0000017e,
+0x0000017c,0x0000017d,0x0004003d,0x00000006,
+0x0000017f,0x0000016f,0x0004003d,0x00000006,
+0x00000180,0x00000167,0x00050050,0x00000009,
+0x00000181,0x0000017f,0x00000180,0x00050080,
+0x00000009,0x00000182,0x0000017e,0x00000181,
+0x00050041,0x00000023,0x00000183,0x0000012f,
+0x0000008b,0x0004003d,0x00000006,0x00000184,
+0x00000183,0x00050051,0x00000006,0x00000185,
+0x00000182,0x00000000,0x00050051,0x00000006,
+0x00000186,0x00000182,0x00000001,0x00060050,
+0x00000007,0x00000187,0x00000185,0x00000186,
+0x00000184,0x0003003e,0x00000188,0x00000187,
+0x00050039,0x00000009,0x00000189,0x0000000c,
+0x00000188,0x0004003d,0x00000006,0x0000018a,
+0x00000167,0x00050084,0x00000006,0x0000018b,
+0x0000018a,0x00000064,0x0004003d,0x00000006,
+0x0000018c,0x0000016f,0x00050080,0x00000006,
+0x0000018d,0x0000018b,0x0000018c,0x00050041,
+0x00000107,0x0000018e,0x0000014b,0x0000018d,
+0x0004003d,0x00000012,0x0000018f,0x0000018e,
+0x0004003d,0x00000006,0x00000190,0x00000167,
+0x00050084,0x00000006,0x00000191,0x00000190,
+0x00000064,0x0004003d,0x00000006,0x00000192,
+0x0000016f,0x00050080,0x00000006,0x00000193,
+0x00000191,0x00000192,0x00050041,0x00000107,
+0x00000194,0x00000159,0x00000193,0x0004003d,
+0x00000012,0x00000195,0x00000194,0x00070050,
+0x00000198,0x00000199,0x0000018f,0x00000195,
+0x00000196,0x00000197,0x00040063,0x0000017a,
+0x00000189,0x00000199,0x000200f9,0x00000173,
+0x000200f8,0x00000173,0x0004003d,0x00000006,
+0x0000019a,0x0000016f,0x00050080,0x00000006,
+0x0000019b,0x0000019a,0x00000063,0x0003003e,
+0x0000016f,0x0000019b,0x000200f9,0x00000170,
+0x000200f8,0x00000172,0x000200f9,0x0000016b,
+0x000200f8,0x0000016b,0x0004003d,0x00000006,
+0x0000019c,0x00000167,0x00050080,0x00000006,
+0x0000019d,0x0000019c,0x00000063,0x0003003e,
+0x00000167,0x0000019d,0x000200f9,0x00000168,
+0x000200f8,0x0000016a,0x000100fd,0x00010038,
+0x00050036,0x00000009,0x0000000c,0x00000000,
+0x0000000a,0x00030037,0x00000008,0x0000000b,
+0x000200f8,0x0000000d,0x0004003d,0x00000007,
+0x0000001f,0x0000000b,0x0007004f,0x00000009,
+0x00000020,0x0000001f,0x0000001f,0x00000000,
+0x00000002,0x000200fe,0x00000020,0x00010038,
+0x00050036,0x00000014,0x00000019,0x00000000,
+0x00000015,0x00030037,0x0000000f,0x00000016,
+0x00030037,0x0000000f,0x00000017,0x00030037,
+0x00000011,0x00000018,0x000200f8,0x0000001a,
+0x0004003b,0x00000023,0x00000024,0x00000007,
+0x0004003b,0x00000023,0x0000003a,0x00000007,
+0x0004003b,0x0000000f,0x00000042,0x00000007,
+0x0004003b,0x00000049,0x0000004a,0x00000007,
+0x0004003b,0x0000008d,0x0000008e,0x00000007,
+0x0004003b,0x00000049,0x00000091,0x00000007,
+0x0004003b,0x0000008d,0x00000096,0x00000007,
+0x0004003b,0x0000009a,0x0000009b,0x00000007,
+0x0004003b,0x0000000f,0x000000c4,0x00000007,
+0x0004003b,0x0000000f,0x000000cd,0x00000007,
+0x0004003b,0x0000000f,0x000000d5,0x00000007,
+0x0004003b,0x00000023,0x000000db,0x00000007,
+0x0004003b,0x00000023,0x000000de,0x00000007,
+0x0004003b,0x00000023,0x000000ea,0x00000007,
+0x0004003b,0x00000100,0x00000101,0x00000007,
+0x0004003d,0x0000000e,0x00000025,0x00000016,
+0x000500c2,0x0000000e,0x00000027,0x00000025,
+0x00000026,0x0004007c,0x00000006,0x00000028,
+0x00000027,0x0003003e,0x00000024,0x00000028,
+0x0004003d,0x00000010,0x00000029,0x00000018,
+0x000300f7,0x0000002b,0x00000000,0x000400fa,
+0x00000029,0x0000002a,0x0000002b,0x000200f8,
+0x0000002a,0x0004003d,0x00000006,0x0000002c,
+0x00000024,0x000500af,0x00000010,0x0000002e,
+0x0000002c,0x0000002d,0x000300f7,0x00000030,
+0x00000000,0x000400fa,0x0000002e,0x0000002f,
+0x00000030,0x000200f8,0x0000002f,0x0004003d,
+0x00000006,0x00000032,0x00000024,0x00050082,
+0x00000006,0x00000033,0x00000032,0x00000031,
+0x0003003e,0x00000024,0x00000033,0x000200f9,
+0x00000030,0x000200f8,0x00000030,0x0004003d,
+0x00000006,0x00000034,0x00000024,0x000500aa,
+0x00000010,0x00000036,0x00000034,0x00000035,
+0x000300f7,0x00000038,0x00000000,0x000400fa,
+0x00000036,0x00000037,0x00000038,0x000200f8,
+0x00000037,0x0003003e,0x00000024,0x00000039,
+0x000200f9,0x00000038,0x000200f8,0x00000038,
+0x000200f9,0x0000002b,0x000200f8,0x0000002b,
+0x0004003d,0x0000000e,0x0000003b,0x00000016,
+0x000500c2,0x0000000e,0x0000003d,0x0000003b,
+0x0000003c,0x0004007c,0x00000006,0x0000003e,
+0x0000003d,0x0003003e,0x0000003a,0x0000003e,
+0x0004003d,0x00000006,0x00000040,0x0000003a,
+0x000500c7,0x00000006,0x00000041,0x00000040,
+0x0000003f,0x0003003e,0x0000003a,0x00000041,
+0x0004003d,0x0000000e,0x00000043,0x00000016,
+0x000500c2,0x0000000e,0x00000045,0x00000043,
+0x00000044,0x000500c7,0x0000000e,0x00000047,
+0x00000045,0x00000046,0x0003003e,0x00000042,
+0x00000047,0x0004003d,0x0000000e,0x0000008a,
+0x00000042,0x00050084,0x0000000e,0x0000008c,
+0x0000008a,0x0000008b,0x0003003e,0x0000008e,
+0x00000089,0x00050041,0x00000049,0x0000008f,
+0x0000008e,0x0000008c,0x0004003d,0x00000048,
+0x00000090,0x0000008f,0x0003003e,0x0000004a,
+0x00000090,0x0004003d,0x0000000e,0x00000092,
+0x00000042,0x00050084,0x0000000e,0x00000093,
+0x00000092,0x0000008b,0x00050080,0x0000000e,
+0x00000095,0x00000093,0x00000094,0x0003003e,
+0x00000096,0x00000089,0x00050041,0x00000049,
+0x00000097,0x00000096,0x00000095,0x0004003d,
+0x00000048,0x00000098,0x00000097,0x0003003e,
+0x00000091,0x00000098,0x0004003d,0x0000000e,
+0x0000009c,0x00000016,0x000500c2,0x0000000e,
+0x0000009e,0x0000009c,0x0000009d,0x0004003d,
+0x0000000e,0x0000009f,0x00000016,0x000500c2,
+0x0000000e,0x000000a0,0x0000009f,0x00000071,
+0x0004003d,0x0000000e,0x000000a1,0x00000016,
+0x000500c2,0x0000000e,0x000000a2,0x000000a1,
+0x00000065,0x0004003d,0x0000000e,0x000000a3,
+0x00000016,0x000500c2,0x0000000e,0x000000a4,
+0x000000a3,0x00000064,0x0004003d,0x0000000e,
+0x000000a5,0x00000016,0x000500c2,0x0000000e,
+0x000000a6,0x000000a5,0x00000063,0x0004003d,
+0x0000000e,0x000000a7,0x00000016,0x000500c4,
+0x0000000e,0x000000a8,0x000000a7,0x00000052,
+0x0004003d,0x0000000e,0x000000a9,0x00000017,
+0x000500c2,0x0000000e,0x000000ab,0x000000a9,
+0x000000aa,0x000500c5,0x0000000e,0x000000ac,
+0x000000a8,0x000000ab,0x0004003d,0x0000000e,
+0x000000ad,0x00000017,0x000500c2,0x0000000e,
+0x000000af,0x000000ad,0x000000ae,0x0004003d,
+0x0000000e,0x000000b0,0x00000017,0x000500c2,
+0x0000000e,0x000000b1,0x000000b0,0x00000026,
+0x0004003d,0x0000000e,0x000000b2,0x00000017,
+0x000500c2,0x0000000e,0x000000b4,0x000000b2,
+0x000000b3,0x0004003d,0x0000000e,0x000000b5,
+0x00000017,0x000500c2,0x0000000e,0x000000b7,
+0x000000b5,0x000000b6,0x0004003d,0x0000000e,
+0x000000b8,0x00000017,0x000500c2,0x0000000e,
+0x000000b9,0x000000b8,0x0000003f,0x0004003d,
+0x0000000e,0x000000ba,0x00000017,0x000500c2,
+0x0000000e,0x000000bb,0x000000ba,0x0000005d,
+0x0004003d,0x0000000e,0x000000bc,0x00000017,
+0x000500c2,0x0000000e,0x000000bd,0x000000bc,
+0x0000005c,0x0004003d,0x0000000e,0x000000be,
+0x00000017,0x000500c2,0x0000000e,0x000000bf,
+0x000000be,0x0000005b,0x0004003d,0x0000000e,
+0x000000c0,0x00000017,0x000500c2,0x0000000e,
+0x000000c1,0x000000c0,0x00000069,0x0004003d,
+0x0000000e,0x000000c2,0x00000017,0x00130050,
+0x00000099,0x000000c3,0x0000009e,0x000000a0,
+0x000000a2,0x000000a4,0x000000a6,0x000000ac,
+0x000000af,0x000000b1,0x000000b4,0x000000b7,
+0x000000b9,0x000000bb,0x000000bd,0x000000bf,
+0x000000c1,0x000000c2,0x0003003e,0x0000009b,
+0x000000c3,0x0003003e,0x000000c4,0x000000c5,
+0x000200f9,0x000000c6,0x000200f8,0x000000c6,
+0x000400f6,0x000000c8,0x000000c9,0x00000000,
+0x000200f9,0x000000ca,0x000200f8,0x000000ca,
+0x0004003d,0x0000000e,0x000000cb,0x000000c4,
+0x000500b0,0x00000010,0x000000cc,0x000000cb,
+0x00000013,0x000400fa,0x000000cc,0x000000c7,
+0x000000c8,0x000200f8,0x000000c7,0x0004003d,
+0x0000000e,0x000000ce,0x000000c4,0x00050089,
+0x0000000e,0x000000d0,0x000000ce,0x000000cf,
+0x00050084,0x0000000e,0x000000d1,0x000000d0,
+0x000000cf,0x0004003d,0x0000000e,0x000000d2,
+0x000000c4,0x00050086,0x0000000e,0x000000d3,
+0x000000d2,0x000000cf,0x00050080,0x0000000e,
+0x000000d4,0x000000d1,0x000000d3,0x0003003e,
+0x000000cd,0x000000d4,0x0004003d,0x0000000e,
+0x000000d6,0x000000c4,0x00050041,0x0000000f,
+0x000000d7,0x0000009b,0x000000d6,0x0004003d,
+0x0000000e,0x000000d8,0x000000d7,0x000500c7,
+0x0000000e,0x000000da,0x000000d8,0x000000d9,
+0x0003003e,0x000000d5,0x000000da,0x0004003d,
+0x0000000e,0x000000dc,0x000000d5,0x000500ae,
+0x00000010,0x000000dd,0x000000dc,0x000000cf,
+0x000300f7,0x000000e0,0x00000000,0x000400fa,
+0x000000dd,0x000000df,0x000000e5,0x000200f8,
+0x000000df,0x0004003d,0x0000000e,0x000000e1,
+0x000000d5,0x00050082,0x0000000e,0x000000e2,
+0x000000e1,0x000000cf,0x00050041,0x00000023,
+0x000000e3,0x00000091,0x000000e2,0x0004003d,
+0x00000006,0x000000e4,0x000000e3,0x0003003e,
+0x000000de,0x000000e4,0x000200f9,0x000000e0,
+0x000200f8,0x000000e5,0x0004003d,0x0000000e,
+0x000000e6,0x000000d5,0x00050041,0x00000023,
+0x000000e7,0x0000004a,0x000000e6,0x0004003d,
+0x00000006,0x000000e8,0x000000e7,0x0003003e,
+0x000000de,0x000000e8,0x000200f9,0x000000e0,
+0x000200f8,0x000000e0,0x0004003d,0x00000006,
+0x000000e9,0x000000de,0x0003003e,0x000000db,
+0x000000e9,0x0004003d,0x00000006,0x000000eb,
+0x00000024,0x0004003d,0x00000006,0x000000ec,
+0x000000db,0x0004003d,0x00000006,0x000000ed,
+0x0000003a,0x00050084,0x00000006,0x000000ee,
+0x000000ec,0x000000ed,0x00050080,0x00000006,
+0x000000ef,0x000000eb,0x000000ee,0x0003003e,
+0x000000ea,0x000000ef,0x0004003d,0x00000006,
+0x000000f0,0x000000ea,0x00050084,0x00000006,
+0x000000f1,0x000000f0,0x00000054,0x0003003e,
+0x000000ea,0x000000f1,0x0004003d,0x00000006,
+0x000000f2,0x0000003a,0x000500aa,0x00000010,
+0x000000f3,0x000000f2,0x00000083,0x000300f7,
+0x000000f5,0x00000000,0x000400fa,0x000000f3,
+0x000000f4,0x000000f5,0x000200f8,0x000000f4,
+0x0004003d,0x00000006,0x000000f6,0x000000db,
+0x0004003d,0x00000006,0x000000f7,0x000000ea,
+0x00050080,0x00000006,0x000000f8,0x000000f7,
+0x000000f6,0x0003003e,0x000000ea,0x000000f8,
+0x000200f9,0x000000f5,0x000200f8,0x000000f5,
+0x0004003d,0x00000010,0x000000f9,0x00000018,
+0x000300f7,0x000000fb,0x00000000,0x000400fa,
+0x000000f9,0x000000fa,0x00000109,0x000200f8,
+0x000000fa,0x0004003d,0x00000006,0x000000fc,
+0x000000ea,0x0008000c,0x00000006,0x000000ff,
+0x00000001,0x0000002d,0x000000fc,0x000000fd,
+0x000000fe,0x0003003e,0x000000ea,0x000000ff,
+0x0004003d,0x0000000e,0x00000102,0x000000cd,
+0x0004003d,0x00000006,0x00000103,0x000000ea,
+0x0004006f,0x00000012,0x00000104,0x00000103,
+0x00050088,0x00000012,0x00000106,0x00000104,
+0x00000105,0x00050041,0x00000107,0x00000108,
+0x00000101,0x00000102,0x0003003e,0x00000108,
+0x00000106,0x000200f9,0x000000fb,0x000200f8,
+0x00000109,0x0004003d,0x00000006,0x0000010a,
+0x000000ea,0x00050080,0x00000006,0x0000010b,
+0x0000010a,0x00000064,0x0003003e,0x000000ea,
+0x0000010b,0x0004003d,0x00000006,0x0000010c,
+0x000000ea,0x0008000c,0x00000006,0x0000010e,
+0x00000001,0x0000002d,0x0000010c,0x00000083,
+0x0000010d,0x0003003e,0x000000ea,0x0000010e,
+0x0004003d,0x0000000e,0x0000010f,0x000000cd,
+0x0004003d,0x00000006,0x00000110,0x000000ea,
+0x0004006f,0x00000012,0x00000111,0x00000110,
+0x00050088,0x00000012,0x00000113,0x00000111,
+0x00000112,0x00050041,0x00000107,0x00000114,
+0x00000101,0x0000010f,0x0003003e,0x00000114,
+0x00000113,0x000200f9,0x000000fb,0x000200f8,
+0x000000fb,0x000200f9,0x000000c9,0x000200f8,
+0x000000c9,0x0004003d,0x0000000e,0x00000115,
+0x000000c4,0x00050080,0x0000000e,0x00000116,
+0x00000115,0x00000063,0x0003003e,0x000000c4,
+0x00000116,0x000200f9,0x000000c6,0x000200f8,
+0x000000c8,0x0004003d,0x00000014,0x00000117,
+0x00000101,0x000200fe,0x00000117,0x00010038,
+0x00050036,0x0000000e,0x0000001d,0x00000000,
+0x0000001b,0x00030037,0x0000000f,0x0000001c,
+0x000200f8,0x0000001e,0x0004003d,0x0000000e,
+0x0000011a,0x0000001c,0x000500c7,0x0000000e,
+0x0000011c,0x0000011a,0x0000011b,0x000500c4,
+0x0000000e,0x0000011d,0x0000011c,0x00000026,
+0x0004003d,0x0000000e,0x0000011e,0x0000001c,
+0x000500c7,0x0000000e,0x00000120,0x0000011e,
+0x0000011f,0x000500c4,0x0000000e,0x00000121,
+0x00000120,0x00000054,0x000500c5,0x0000000e,
+0x00000122,0x0000011d,0x00000121,0x0004003d,
+0x0000000e,0x00000123,0x0000001c,0x000500c7,
+0x0000000e,0x00000125,0x00000123,0x00000124,
+0x000500c2,0x0000000e,0x00000126,0x00000125,
+0x00000054,0x000500c5,0x0000000e,0x00000127,
+0x00000122,0x00000126,0x0004003d,0x0000000e,
+0x00000128,0x0000001c,0x000500c7,0x0000000e,
+0x0000012a,0x00000128,0x00000129,0x000500c2,
+0x0000000e,0x0000012b,0x0000012a,0x00000026,
+0x000500c5,0x0000000e,0x0000012c,0x00000127,
+0x0000012b,0x000200fe,0x0000012c,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_2D.inl
new file mode 100644
index 00000000000..d1ef810b200
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_2D.inl
@@ -0,0 +1,671 @@
+0x07230203,0x00010300,0x000d000a,0x000001d2,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x00000031,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000130,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00070005,
+0x0000000b,0x50746567,0x4432736f,0x61727241,
+0x69762879,0x00003b33,0x00030005,0x0000000a,
+0x00736f70,0x000e0005,0x00000018,0x5f636165,
+0x6f636564,0x735f6564,0x6c676e69,0x68635f65,
+0x656e6e61,0x6c625f6c,0x5f6b636f,0x616f6c66,
+0x31752874,0x3b31753b,0x003b3162,0x00040005,
+0x00000015,0x68676968,0x00000000,0x00030005,
+0x00000016,0x00776f6c,0x00050005,0x00000017,
+0x69537369,0x64656e67,0x00000000,0x00050005,
+0x0000001c,0x70696c66,0x75283233,0x00003b31,
+0x00030005,0x0000001b,0x00000061,0x00060005,
+0x00000022,0x65736162,0x646f635f,0x726f7765,
+0x00000064,0x00050005,0x00000038,0x746c756d,
+0x696c7069,0x00007265,0x00040005,0x00000040,
+0x496c6274,0x00007864,0x00040005,0x00000048,
+0x6c626174,0x00003065,0x00050005,0x0000008c,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x0000008f,0x6c626174,0x00003165,0x00050005,
+0x00000094,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x00000099,0x00000070,0x00030005,
+0x000000c2,0x00000069,0x00040005,0x000000cb,
+0x4974756f,0x00007864,0x00050005,0x000000d3,
+0x69646f6d,0x72656966,0x00000000,0x00060005,
+0x000000d9,0x69646f6d,0x72656966,0x756c6156,
+0x00000065,0x00040005,0x000000e8,0x6f636564,
+0x00646564,0x00040005,0x000000ff,0x75736572,
+0x0000746c,0x00030005,0x0000012d,0x00736f70,
+0x00080005,0x00000130,0x475f6c67,0x61626f6c,
+0x766e496c,0x7461636f,0x496e6f69,0x00000044,
+0x00070005,0x00000133,0x67616d49,0x726f4665,
+0x4274616d,0x6b636f6c,0x00000000,0x00060006,
+0x00000133,0x00000000,0x706d6f63,0x6d726f46,
+0x00007461,0x00060006,0x00000133,0x00000001,
+0x65736162,0x6579614c,0x00000072,0x00060005,
+0x00000135,0x75705f75,0x6f436873,0x6174736e,
+0x0000746e,0x00050005,0x00000140,0x42637273,
+0x6b636f6c,0x00000000,0x00050005,0x00000143,
+0x6d695f75,0x30656761,0x00000000,0x00040005,
+0x00000145,0x61726170,0x0000006d,0x00060005,
+0x00000149,0x6f636564,0x6572706d,0x64657373,
+0x00000052,0x00040005,0x0000014a,0x61726170,
+0x0000006d,0x00040005,0x0000014e,0x61726170,
+0x0000006d,0x00040005,0x00000153,0x61726170,
+0x0000006d,0x00040005,0x00000154,0x61726170,
+0x0000006d,0x00040005,0x00000155,0x61726170,
+0x0000006d,0x00060005,0x00000157,0x6f636564,
+0x6572706d,0x64657373,0x00000047,0x00040005,
+0x00000158,0x61726170,0x0000006d,0x00040005,
+0x0000015c,0x61726170,0x0000006d,0x00040005,
+0x00000161,0x61726170,0x0000006d,0x00040005,
+0x00000162,0x61726170,0x0000006d,0x00040005,
+0x00000163,0x61726170,0x0000006d,0x00030005,
+0x00000165,0x00000079,0x00030005,0x0000016d,
+0x00000078,0x00050005,0x00000177,0x6d695f75,
+0x31656761,0x00000000,0x00040005,0x00000187,
+0x61726170,0x0000006d,0x00040047,0x00000130,
+0x0000000b,0x0000001c,0x00050048,0x00000133,
+0x00000000,0x00000023,0x00000000,0x00050048,
+0x00000133,0x00000001,0x00000023,0x00000004,
+0x00030047,0x00000133,0x00000002,0x00040047,
+0x00000143,0x00000022,0x00000000,0x00040047,
+0x00000143,0x00000021,0x00000000,0x00030047,
+0x00000143,0x00000018,0x00040047,0x00000177,
+0x00000022,0x00000000,0x00040047,0x00000177,
+0x00000021,0x00000001,0x00030047,0x00000177,
+0x00000019,0x00040047,0x000001d1,0x0000000b,
+0x00000019,0x00020013,0x00000002,0x00030021,
+0x00000003,0x00000002,0x00040015,0x00000006,
+0x00000020,0x00000001,0x00040017,0x00000007,
+0x00000006,0x00000003,0x00040020,0x00000008,
+0x00000007,0x00000007,0x00040021,0x00000009,
+0x00000007,0x00000008,0x00040015,0x0000000d,
+0x00000020,0x00000000,0x00040020,0x0000000e,
+0x00000007,0x0000000d,0x00020014,0x0000000f,
+0x00040020,0x00000010,0x00000007,0x0000000f,
+0x00030016,0x00000011,0x00000020,0x0004002b,
+0x0000000d,0x00000012,0x00000010,0x0004001c,
+0x00000013,0x00000011,0x00000012,0x00060021,
+0x00000014,0x00000013,0x0000000e,0x0000000e,
+0x00000010,0x00040021,0x0000001a,0x0000000d,
+0x0000000e,0x00040020,0x00000021,0x00000007,
+0x00000006,0x0004002b,0x00000006,0x00000024,
+0x00000018,0x0004002b,0x00000006,0x0000002b,
+0x00000080,0x0004002b,0x00000006,0x0000002f,
+0x00000100,0x0004002b,0x00000006,0x00000033,
+0xffffff80,0x0004002b,0x00000006,0x00000037,
+0xffffff81,0x0004002b,0x00000006,0x0000003a,
+0x00000014,0x0004002b,0x00000006,0x0000003d,
+0x0000000f,0x0004002b,0x00000006,0x00000042,
+0x00000010,0x0004002b,0x0000000d,0x00000044,
+0x0000000f,0x00040017,0x00000046,0x00000006,
+0x00000004,0x00040020,0x00000047,0x00000007,
+0x00000046,0x0004002b,0x0000000d,0x00000049,
+0x00000020,0x0004001c,0x0000004a,0x00000046,
+0x00000049,0x0004002b,0x00000006,0x0000004b,
+0xfffffffd,0x0004002b,0x00000006,0x0000004c,
+0xfffffffa,0x0004002b,0x00000006,0x0000004d,
+0xfffffff7,0x0004002b,0x00000006,0x0000004e,
+0xfffffff1,0x0007002c,0x00000046,0x0000004f,
+0x0000004b,0x0000004c,0x0000004d,0x0000004e,
+0x0004002b,0x00000006,0x00000050,0x00000002,
+0x0004002b,0x00000006,0x00000051,0x00000005,
+0x0004002b,0x00000006,0x00000052,0x00000008,
+0x0004002b,0x00000006,0x00000053,0x0000000e,
+0x0007002c,0x00000046,0x00000054,0x00000050,
+0x00000051,0x00000052,0x00000053,0x0004002b,
+0x00000006,0x00000055,0xfffffff9,0x0004002b,
+0x00000006,0x00000056,0xfffffff6,0x0004002b,
+0x00000006,0x00000057,0xfffffff3,0x0007002c,
+0x00000046,0x00000058,0x0000004b,0x00000055,
+0x00000056,0x00000057,0x0004002b,0x00000006,
+0x00000059,0x00000006,0x0004002b,0x00000006,
+0x0000005a,0x00000009,0x0004002b,0x00000006,
+0x0000005b,0x0000000c,0x0007002c,0x00000046,
+0x0000005c,0x00000050,0x00000059,0x0000005a,
+0x0000005b,0x0004002b,0x00000006,0x0000005d,
+0xfffffffe,0x0004002b,0x00000006,0x0000005e,
+0xfffffffb,0x0004002b,0x00000006,0x0000005f,
+0xfffffff8,0x0007002c,0x00000046,0x00000060,
+0x0000005d,0x0000005e,0x0000005f,0x00000057,
+0x0004002b,0x00000006,0x00000061,0x00000001,
+0x0004002b,0x00000006,0x00000062,0x00000004,
+0x0004002b,0x00000006,0x00000063,0x00000007,
+0x0007002c,0x00000046,0x00000064,0x00000061,
+0x00000062,0x00000063,0x0000005b,0x0004002b,
+0x00000006,0x00000065,0xfffffffc,0x0007002c,
+0x00000046,0x00000066,0x0000005d,0x00000065,
+0x0000004c,0x00000057,0x0004002b,0x00000006,
+0x00000067,0x00000003,0x0007002c,0x00000046,
+0x00000068,0x00000061,0x00000067,0x00000051,
+0x0000005b,0x0004002b,0x00000006,0x00000069,
+0xfffffff4,0x0007002c,0x00000046,0x0000006a,
+0x0000004b,0x0000004c,0x0000005f,0x00000069,
+0x0004002b,0x00000006,0x0000006b,0x0000000b,
+0x0007002c,0x00000046,0x0000006c,0x00000050,
+0x00000051,0x00000063,0x0000006b,0x0004002b,
+0x00000006,0x0000006d,0xfffffff5,0x0007002c,
+0x00000046,0x0000006e,0x0000004b,0x00000055,
+0x0000004d,0x0000006d,0x0004002b,0x00000006,
+0x0000006f,0x0000000a,0x0007002c,0x00000046,
+0x00000070,0x00000050,0x00000059,0x00000052,
+0x0000006f,0x0007002c,0x00000046,0x00000071,
+0x00000065,0x00000055,0x0000005f,0x0000006d,
+0x0007002c,0x00000046,0x00000072,0x00000067,
+0x00000059,0x00000063,0x0000006f,0x0007002c,
+0x00000046,0x00000073,0x0000004b,0x0000005e,
+0x0000005f,0x0000006d,0x0007002c,0x00000046,
+0x00000074,0x00000050,0x00000062,0x00000063,
+0x0000006f,0x0007002c,0x00000046,0x00000075,
+0x0000005d,0x0000004c,0x0000005f,0x00000056,
+0x0007002c,0x00000046,0x00000076,0x00000061,
+0x00000051,0x00000063,0x0000005a,0x0007002c,
+0x00000046,0x00000077,0x0000005d,0x0000005e,
+0x0000005f,0x00000056,0x0007002c,0x00000046,
+0x00000078,0x00000061,0x00000062,0x00000063,
+0x0000005a,0x0007002c,0x00000046,0x00000079,
+0x0000005d,0x00000065,0x0000005f,0x00000056,
+0x0007002c,0x00000046,0x0000007a,0x00000061,
+0x00000067,0x00000063,0x0000005a,0x0007002c,
+0x00000046,0x0000007b,0x0000005d,0x0000005e,
+0x00000055,0x00000056,0x0007002c,0x00000046,
+0x0000007c,0x00000061,0x00000062,0x00000059,
+0x0000005a,0x0007002c,0x00000046,0x0000007d,
+0x0000004b,0x00000065,0x00000055,0x00000056,
+0x0007002c,0x00000046,0x0000007e,0x00000050,
+0x00000067,0x00000059,0x0000005a,0x0004002b,
+0x00000006,0x0000007f,0xffffffff,0x0007002c,
+0x00000046,0x00000080,0x0000007f,0x0000005d,
+0x0000004b,0x00000056,0x0004002b,0x00000006,
+0x00000081,0x00000000,0x0007002c,0x00000046,
+0x00000082,0x00000081,0x00000061,0x00000050,
+0x0000005a,0x0007002c,0x00000046,0x00000083,
+0x00000065,0x0000004c,0x0000005f,0x0000004d,
+0x0007002c,0x00000046,0x00000084,0x00000067,
+0x00000051,0x00000063,0x00000052,0x0007002c,
+0x00000046,0x00000085,0x0000004b,0x0000005e,
+0x00000055,0x0000004d,0x0007002c,0x00000046,
+0x00000086,0x00000050,0x00000062,0x00000059,
+0x00000052,0x0023002c,0x0000004a,0x00000087,
+0x0000004f,0x00000054,0x00000058,0x0000005c,
+0x00000060,0x00000064,0x00000066,0x00000068,
+0x0000006a,0x0000006c,0x0000006e,0x00000070,
+0x00000071,0x00000072,0x00000073,0x00000074,
+0x00000075,0x00000076,0x00000077,0x00000078,
+0x00000079,0x0000007a,0x0000007b,0x0000007c,
+0x0000007d,0x0000007e,0x00000080,0x00000082,
+0x00000083,0x00000084,0x00000085,0x00000086,
+0x0004002b,0x0000000d,0x00000089,0x00000002,
+0x00040020,0x0000008b,0x00000007,0x0000004a,
+0x0004002b,0x0000000d,0x00000092,0x00000001,
+0x0004001c,0x00000097,0x0000000d,0x00000012,
+0x00040020,0x00000098,0x00000007,0x00000097,
+0x0004002b,0x00000006,0x0000009b,0x0000000d,
+0x0004002b,0x00000006,0x000000a8,0x0000001e,
+0x0004002b,0x00000006,0x000000ac,0x0000001b,
+0x0004002b,0x00000006,0x000000b1,0x00000015,
+0x0004002b,0x00000006,0x000000b4,0x00000012,
+0x0004002b,0x0000000d,0x000000c3,0x00000000,
+0x0004002b,0x0000000d,0x000000cd,0x00000004,
+0x0004002b,0x0000000d,0x000000d7,0x00000007,
+0x0004002b,0x00000006,0x000000fb,0xfffffc01,
+0x0004002b,0x00000006,0x000000fc,0x000003ff,
+0x00040020,0x000000fe,0x00000007,0x00000013,
+0x0004002b,0x00000011,0x00000103,0x447fc000,
+0x00040020,0x00000105,0x00000007,0x00000011,
+0x0004002b,0x00000006,0x0000010b,0x000007ff,
+0x0004002b,0x00000011,0x00000110,0x44ffe000,
+0x0004002b,0x0000000d,0x00000119,0x000000ff,
+0x0004002b,0x0000000d,0x0000011d,0x0000ff00,
+0x0004002b,0x0000000d,0x00000122,0x00ff0000,
+0x0004002b,0x0000000d,0x00000127,0xff000000,
+0x00040017,0x0000012e,0x0000000d,0x00000003,
+0x00040020,0x0000012f,0x00000001,0x0000012e,
+0x0004003b,0x0000012f,0x00000130,0x00000001,
+0x0004001e,0x00000133,0x0000000d,0x0000000d,
+0x00040020,0x00000134,0x00000009,0x00000133,
+0x0004003b,0x00000134,0x00000135,0x00000009,
+0x00040020,0x00000136,0x00000009,0x0000000d,
+0x00040017,0x0000013e,0x0000000d,0x00000004,
+0x00040020,0x0000013f,0x00000007,0x0000013e,
+0x00090019,0x00000141,0x0000000d,0x00000001,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x0000001e,0x00040020,0x00000142,0x00000000,
+0x00000141,0x0004003b,0x00000142,0x00000143,
+0x00000000,0x0003002a,0x0000000f,0x00000152,
+0x0004002b,0x0000000d,0x0000015d,0x00000003,
+0x00090019,0x00000175,0x00000011,0x00000001,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x0000000c,0x00040020,0x00000176,0x00000000,
+0x00000175,0x0004003b,0x00000176,0x00000177,
+0x00000000,0x00040017,0x00000179,0x00000006,
+0x00000002,0x0004002b,0x00000011,0x00000195,
+0x00000000,0x0004002b,0x00000011,0x00000196,
+0x3f800000,0x00040017,0x00000197,0x00000011,
+0x00000004,0x0004002b,0x0000000d,0x0000019d,
+0x00000093,0x0004002b,0x0000000d,0x0000019e,
+0x00000094,0x0004002b,0x0000000d,0x0000019f,
+0x00000095,0x0004002b,0x0000000d,0x000001a0,
+0x00000096,0x0004002b,0x0000000d,0x000001a1,
+0x00000097,0x0004002b,0x0000000d,0x000001a2,
+0x00000098,0x0004002b,0x0000000d,0x000001a3,
+0x00000099,0x0004002b,0x0000000d,0x000001a4,
+0x0000009a,0x0004002b,0x0000000d,0x000001a5,
+0x0000009b,0x0004002b,0x0000000d,0x000001a6,
+0x0000009c,0x0004002b,0x0000000d,0x000001a7,
+0x00000008,0x0004001c,0x000001a8,0x00000006,
+0x000001a7,0x000b002c,0x000001a8,0x000001a9,
+0x00000081,0x00000061,0x00000050,0x00000067,
+0x00000065,0x0000004b,0x0000005d,0x0000007f,
+0x0004001c,0x000001aa,0x00000046,0x000001a7,
+0x0007002c,0x00000046,0x000001ab,0x00000050,
+0x00000052,0x0000005d,0x0000005f,0x0004002b,
+0x00000006,0x000001ac,0x00000011,0x0004002b,
+0x00000006,0x000001ad,0xffffffef,0x0007002c,
+0x00000046,0x000001ae,0x00000051,0x000001ac,
+0x0000005e,0x000001ad,0x0004002b,0x00000006,
+0x000001af,0x0000001d,0x0004002b,0x00000006,
+0x000001b0,0xffffffe3,0x0007002c,0x00000046,
+0x000001b1,0x0000005a,0x000001af,0x0000004d,
+0x000001b0,0x0004002b,0x00000006,0x000001b2,
+0x0000002a,0x0004002b,0x00000006,0x000001b3,
+0xffffffd6,0x0007002c,0x00000046,0x000001b4,
+0x0000009b,0x000001b2,0x00000057,0x000001b3,
+0x0004002b,0x00000006,0x000001b5,0x0000003c,
+0x0004002b,0x00000006,0x000001b6,0xffffffee,
+0x0004002b,0x00000006,0x000001b7,0xffffffc4,
+0x0007002c,0x00000046,0x000001b8,0x000000b4,
+0x000001b5,0x000001b6,0x000001b7,0x0004002b,
+0x00000006,0x000001b9,0x00000050,0x0004002b,
+0x00000006,0x000001ba,0xffffffe8,0x0004002b,
+0x00000006,0x000001bb,0xffffffb0,0x0007002c,
+0x00000046,0x000001bc,0x00000024,0x000001b9,
+0x000001ba,0x000001bb,0x0004002b,0x00000006,
+0x000001bd,0x00000021,0x0004002b,0x00000006,
+0x000001be,0x0000006a,0x0004002b,0x00000006,
+0x000001bf,0xffffffdf,0x0004002b,0x00000006,
+0x000001c0,0xffffff96,0x0007002c,0x00000046,
+0x000001c1,0x000001bd,0x000001be,0x000001bf,
+0x000001c0,0x0004002b,0x00000006,0x000001c2,
+0x0000002f,0x0004002b,0x00000006,0x000001c3,
+0x000000b7,0x0004002b,0x00000006,0x000001c4,
+0xffffffd1,0x0004002b,0x00000006,0x000001c5,
+0xffffff49,0x0007002c,0x00000046,0x000001c6,
+0x000001c2,0x000001c3,0x000001c4,0x000001c5,
+0x000b002c,0x000001aa,0x000001c7,0x000001ab,
+0x000001ae,0x000001b1,0x000001b4,0x000001b8,
+0x000001bc,0x000001c1,0x000001c6,0x0007002c,
+0x00000046,0x000001c8,0x00000081,0x00000052,
+0x00000081,0x0000005f,0x0007002c,0x00000046,
+0x000001c9,0x00000081,0x000001ac,0x00000081,
+0x000001ad,0x0007002c,0x00000046,0x000001ca,
+0x00000081,0x000001af,0x00000081,0x000001b0,
+0x0007002c,0x00000046,0x000001cb,0x00000081,
+0x000001b2,0x00000081,0x000001b3,0x0007002c,
+0x00000046,0x000001cc,0x00000081,0x000001b5,
+0x00000081,0x000001b7,0x0007002c,0x00000046,
+0x000001cd,0x00000081,0x000001b9,0x00000081,
+0x000001bb,0x0007002c,0x00000046,0x000001ce,
+0x00000081,0x000001be,0x00000081,0x000001c0,
+0x0007002c,0x00000046,0x000001cf,0x00000081,
+0x000001c3,0x00000081,0x000001c5,0x000b002c,
+0x000001aa,0x000001d0,0x000001c8,0x000001c9,
+0x000001ca,0x000001cb,0x000001cc,0x000001cd,
+0x000001ce,0x000001cf,0x0006002c,0x0000012e,
+0x000001d1,0x000001a7,0x000001a7,0x00000092,
+0x00050036,0x00000002,0x00000004,0x00000000,
+0x00000003,0x000200f8,0x00000005,0x0004003b,
+0x00000008,0x0000012d,0x00000007,0x0004003b,
+0x0000013f,0x00000140,0x00000007,0x0004003b,
+0x00000008,0x00000145,0x00000007,0x0004003b,
+0x000000fe,0x00000149,0x00000007,0x0004003b,
+0x0000000e,0x0000014a,0x00000007,0x0004003b,
+0x0000000e,0x0000014e,0x00000007,0x0004003b,
+0x0000000e,0x00000153,0x00000007,0x0004003b,
+0x0000000e,0x00000154,0x00000007,0x0004003b,
+0x00000010,0x00000155,0x00000007,0x0004003b,
+0x000000fe,0x00000157,0x00000007,0x0004003b,
+0x0000000e,0x00000158,0x00000007,0x0004003b,
+0x0000000e,0x0000015c,0x00000007,0x0004003b,
+0x0000000e,0x00000161,0x00000007,0x0004003b,
+0x0000000e,0x00000162,0x00000007,0x0004003b,
+0x00000010,0x00000163,0x00000007,0x0004003b,
+0x00000021,0x00000165,0x00000007,0x0004003b,
+0x00000021,0x0000016d,0x00000007,0x0004003b,
+0x00000008,0x00000187,0x00000007,0x0004003d,
+0x0000012e,0x00000131,0x00000130,0x0004007c,
+0x00000007,0x00000132,0x00000131,0x0003003e,
+0x0000012d,0x00000132,0x00050041,0x00000136,
+0x00000137,0x00000135,0x00000061,0x0004003d,
+0x0000000d,0x00000138,0x00000137,0x0004007c,
+0x00000006,0x00000139,0x00000138,0x00050041,
+0x00000021,0x0000013a,0x0000012d,0x00000089,
+0x0004003d,0x00000006,0x0000013b,0x0000013a,
+0x00050080,0x00000006,0x0000013c,0x0000013b,
+0x00000139,0x00050041,0x00000021,0x0000013d,
+0x0000012d,0x00000089,0x0003003e,0x0000013d,
+0x0000013c,0x0004003d,0x00000141,0x00000144,
+0x00000143,0x0004003d,0x00000007,0x00000146,
+0x0000012d,0x0003003e,0x00000145,0x00000146,
+0x00050039,0x00000007,0x00000147,0x0000000b,
+0x00000145,0x00050062,0x0000013e,0x00000148,
+0x00000144,0x00000147,0x0003003e,0x00000140,
+0x00000148,0x00050041,0x0000000e,0x0000014b,
+0x00000140,0x000000c3,0x0004003d,0x0000000d,
+0x0000014c,0x0000014b,0x0003003e,0x0000014a,
+0x0000014c,0x00050039,0x0000000d,0x0000014d,
+0x0000001c,0x0000014a,0x00050041,0x0000000e,
+0x0000014f,0x00000140,0x00000092,0x0004003d,
+0x0000000d,0x00000150,0x0000014f,0x0003003e,
+0x0000014e,0x00000150,0x00050039,0x0000000d,
+0x00000151,0x0000001c,0x0000014e,0x0003003e,
+0x00000153,0x0000014d,0x0003003e,0x00000154,
+0x00000151,0x0003003e,0x00000155,0x00000152,
+0x00070039,0x00000013,0x00000156,0x00000018,
+0x00000153,0x00000154,0x00000155,0x0003003e,
+0x00000149,0x00000156,0x00050041,0x0000000e,
+0x00000159,0x00000140,0x00000089,0x0004003d,
+0x0000000d,0x0000015a,0x00000159,0x0003003e,
+0x00000158,0x0000015a,0x00050039,0x0000000d,
+0x0000015b,0x0000001c,0x00000158,0x00050041,
+0x0000000e,0x0000015e,0x00000140,0x0000015d,
+0x0004003d,0x0000000d,0x0000015f,0x0000015e,
+0x0003003e,0x0000015c,0x0000015f,0x00050039,
+0x0000000d,0x00000160,0x0000001c,0x0000015c,
+0x0003003e,0x00000161,0x0000015b,0x0003003e,
+0x00000162,0x00000160,0x0003003e,0x00000163,
+0x00000152,0x00070039,0x00000013,0x00000164,
+0x00000018,0x00000161,0x00000162,0x00000163,
+0x0003003e,0x00000157,0x00000164,0x0003003e,
+0x00000165,0x00000081,0x000200f9,0x00000166,
+0x000200f8,0x00000166,0x000400f6,0x00000168,
+0x00000169,0x00000000,0x000200f9,0x0000016a,
+0x000200f8,0x0000016a,0x0004003d,0x00000006,
+0x0000016b,0x00000165,0x000500b1,0x0000000f,
+0x0000016c,0x0000016b,0x00000062,0x000400fa,
+0x0000016c,0x00000167,0x00000168,0x000200f8,
+0x00000167,0x0003003e,0x0000016d,0x00000081,
+0x000200f9,0x0000016e,0x000200f8,0x0000016e,
+0x000400f6,0x00000170,0x00000171,0x00000000,
+0x000200f9,0x00000172,0x000200f8,0x00000172,
+0x0004003d,0x00000006,0x00000173,0x0000016d,
+0x000500b1,0x0000000f,0x00000174,0x00000173,
+0x00000062,0x000400fa,0x00000174,0x0000016f,
+0x00000170,0x000200f8,0x0000016f,0x0004003d,
+0x00000175,0x00000178,0x00000177,0x0004003d,
+0x00000007,0x0000017a,0x0000012d,0x0007004f,
+0x00000179,0x0000017b,0x0000017a,0x0000017a,
+0x00000000,0x00000001,0x00050050,0x00000179,
+0x0000017c,0x00000062,0x00000062,0x00050084,
+0x00000179,0x0000017d,0x0000017b,0x0000017c,
+0x0004003d,0x00000006,0x0000017e,0x0000016d,
+0x0004003d,0x00000006,0x0000017f,0x00000165,
+0x00050050,0x00000179,0x00000180,0x0000017e,
+0x0000017f,0x00050080,0x00000179,0x00000181,
+0x0000017d,0x00000180,0x00050041,0x00000021,
+0x00000182,0x0000012d,0x00000089,0x0004003d,
+0x00000006,0x00000183,0x00000182,0x00050051,
+0x00000006,0x00000184,0x00000181,0x00000000,
+0x00050051,0x00000006,0x00000185,0x00000181,
+0x00000001,0x00060050,0x00000007,0x00000186,
+0x00000184,0x00000185,0x00000183,0x0003003e,
+0x00000187,0x00000186,0x00050039,0x00000007,
+0x00000188,0x0000000b,0x00000187,0x0004003d,
+0x00000006,0x00000189,0x00000165,0x00050084,
+0x00000006,0x0000018a,0x00000189,0x00000062,
+0x0004003d,0x00000006,0x0000018b,0x0000016d,
+0x00050080,0x00000006,0x0000018c,0x0000018a,
+0x0000018b,0x00050041,0x00000105,0x0000018d,
+0x00000149,0x0000018c,0x0004003d,0x00000011,
+0x0000018e,0x0000018d,0x0004003d,0x00000006,
+0x0000018f,0x00000165,0x00050084,0x00000006,
+0x00000190,0x0000018f,0x00000062,0x0004003d,
+0x00000006,0x00000191,0x0000016d,0x00050080,
+0x00000006,0x00000192,0x00000190,0x00000191,
+0x00050041,0x00000105,0x00000193,0x00000157,
+0x00000192,0x0004003d,0x00000011,0x00000194,
+0x00000193,0x00070050,0x00000197,0x00000198,
+0x0000018e,0x00000194,0x00000195,0x00000196,
+0x00040063,0x00000178,0x00000188,0x00000198,
+0x000200f9,0x00000171,0x000200f8,0x00000171,
+0x0004003d,0x00000006,0x00000199,0x0000016d,
+0x00050080,0x00000006,0x0000019a,0x00000199,
+0x00000061,0x0003003e,0x0000016d,0x0000019a,
+0x000200f9,0x0000016e,0x000200f8,0x00000170,
+0x000200f9,0x00000169,0x000200f8,0x00000169,
+0x0004003d,0x00000006,0x0000019b,0x00000165,
+0x00050080,0x00000006,0x0000019c,0x0000019b,
+0x00000061,0x0003003e,0x00000165,0x0000019c,
+0x000200f9,0x00000166,0x000200f8,0x00000168,
+0x000100fd,0x00010038,0x00050036,0x00000007,
+0x0000000b,0x00000000,0x00000009,0x00030037,
+0x00000008,0x0000000a,0x000200f8,0x0000000c,
+0x0004003d,0x00000007,0x0000001e,0x0000000a,
+0x000200fe,0x0000001e,0x00010038,0x00050036,
+0x00000013,0x00000018,0x00000000,0x00000014,
+0x00030037,0x0000000e,0x00000015,0x00030037,
+0x0000000e,0x00000016,0x00030037,0x00000010,
+0x00000017,0x000200f8,0x00000019,0x0004003b,
+0x00000021,0x00000022,0x00000007,0x0004003b,
+0x00000021,0x00000038,0x00000007,0x0004003b,
+0x0000000e,0x00000040,0x00000007,0x0004003b,
+0x00000047,0x00000048,0x00000007,0x0004003b,
+0x0000008b,0x0000008c,0x00000007,0x0004003b,
+0x00000047,0x0000008f,0x00000007,0x0004003b,
+0x0000008b,0x00000094,0x00000007,0x0004003b,
+0x00000098,0x00000099,0x00000007,0x0004003b,
+0x0000000e,0x000000c2,0x00000007,0x0004003b,
+0x0000000e,0x000000cb,0x00000007,0x0004003b,
+0x0000000e,0x000000d3,0x00000007,0x0004003b,
+0x00000021,0x000000d9,0x00000007,0x0004003b,
+0x00000021,0x000000dc,0x00000007,0x0004003b,
+0x00000021,0x000000e8,0x00000007,0x0004003b,
+0x000000fe,0x000000ff,0x00000007,0x0004003d,
+0x0000000d,0x00000023,0x00000015,0x000500c2,
+0x0000000d,0x00000025,0x00000023,0x00000024,
+0x0004007c,0x00000006,0x00000026,0x00000025,
+0x0003003e,0x00000022,0x00000026,0x0004003d,
+0x0000000f,0x00000027,0x00000017,0x000300f7,
+0x00000029,0x00000000,0x000400fa,0x00000027,
+0x00000028,0x00000029,0x000200f8,0x00000028,
+0x0004003d,0x00000006,0x0000002a,0x00000022,
+0x000500af,0x0000000f,0x0000002c,0x0000002a,
+0x0000002b,0x000300f7,0x0000002e,0x00000000,
+0x000400fa,0x0000002c,0x0000002d,0x0000002e,
+0x000200f8,0x0000002d,0x0004003d,0x00000006,
+0x00000030,0x00000022,0x00050082,0x00000006,
+0x00000031,0x00000030,0x0000002f,0x0003003e,
+0x00000022,0x00000031,0x000200f9,0x0000002e,
+0x000200f8,0x0000002e,0x0004003d,0x00000006,
+0x00000032,0x00000022,0x000500aa,0x0000000f,
+0x00000034,0x00000032,0x00000033,0x000300f7,
+0x00000036,0x00000000,0x000400fa,0x00000034,
+0x00000035,0x00000036,0x000200f8,0x00000035,
+0x0003003e,0x00000022,0x00000037,0x000200f9,
+0x00000036,0x000200f8,0x00000036,0x000200f9,
+0x00000029,0x000200f8,0x00000029,0x0004003d,
+0x0000000d,0x00000039,0x00000015,0x000500c2,
+0x0000000d,0x0000003b,0x00000039,0x0000003a,
+0x0004007c,0x00000006,0x0000003c,0x0000003b,
+0x0003003e,0x00000038,0x0000003c,0x0004003d,
+0x00000006,0x0000003e,0x00000038,0x000500c7,
+0x00000006,0x0000003f,0x0000003e,0x0000003d,
+0x0003003e,0x00000038,0x0000003f,0x0004003d,
+0x0000000d,0x00000041,0x00000015,0x000500c2,
+0x0000000d,0x00000043,0x00000041,0x00000042,
+0x000500c7,0x0000000d,0x00000045,0x00000043,
+0x00000044,0x0003003e,0x00000040,0x00000045,
+0x0004003d,0x0000000d,0x00000088,0x00000040,
+0x00050084,0x0000000d,0x0000008a,0x00000088,
+0x00000089,0x0003003e,0x0000008c,0x00000087,
+0x00050041,0x00000047,0x0000008d,0x0000008c,
+0x0000008a,0x0004003d,0x00000046,0x0000008e,
+0x0000008d,0x0003003e,0x00000048,0x0000008e,
+0x0004003d,0x0000000d,0x00000090,0x00000040,
+0x00050084,0x0000000d,0x00000091,0x00000090,
+0x00000089,0x00050080,0x0000000d,0x00000093,
+0x00000091,0x00000092,0x0003003e,0x00000094,
+0x00000087,0x00050041,0x00000047,0x00000095,
+0x00000094,0x00000093,0x0004003d,0x00000046,
+0x00000096,0x00000095,0x0003003e,0x0000008f,
+0x00000096,0x0004003d,0x0000000d,0x0000009a,
+0x00000015,0x000500c2,0x0000000d,0x0000009c,
+0x0000009a,0x0000009b,0x0004003d,0x0000000d,
+0x0000009d,0x00000015,0x000500c2,0x0000000d,
+0x0000009e,0x0000009d,0x0000006f,0x0004003d,
+0x0000000d,0x0000009f,0x00000015,0x000500c2,
+0x0000000d,0x000000a0,0x0000009f,0x00000063,
+0x0004003d,0x0000000d,0x000000a1,0x00000015,
+0x000500c2,0x0000000d,0x000000a2,0x000000a1,
+0x00000062,0x0004003d,0x0000000d,0x000000a3,
+0x00000015,0x000500c2,0x0000000d,0x000000a4,
+0x000000a3,0x00000061,0x0004003d,0x0000000d,
+0x000000a5,0x00000015,0x000500c4,0x0000000d,
+0x000000a6,0x000000a5,0x00000050,0x0004003d,
+0x0000000d,0x000000a7,0x00000016,0x000500c2,
+0x0000000d,0x000000a9,0x000000a7,0x000000a8,
+0x000500c5,0x0000000d,0x000000aa,0x000000a6,
+0x000000a9,0x0004003d,0x0000000d,0x000000ab,
+0x00000016,0x000500c2,0x0000000d,0x000000ad,
+0x000000ab,0x000000ac,0x0004003d,0x0000000d,
+0x000000ae,0x00000016,0x000500c2,0x0000000d,
+0x000000af,0x000000ae,0x00000024,0x0004003d,
+0x0000000d,0x000000b0,0x00000016,0x000500c2,
+0x0000000d,0x000000b2,0x000000b0,0x000000b1,
+0x0004003d,0x0000000d,0x000000b3,0x00000016,
+0x000500c2,0x0000000d,0x000000b5,0x000000b3,
+0x000000b4,0x0004003d,0x0000000d,0x000000b6,
+0x00000016,0x000500c2,0x0000000d,0x000000b7,
+0x000000b6,0x0000003d,0x0004003d,0x0000000d,
+0x000000b8,0x00000016,0x000500c2,0x0000000d,
+0x000000b9,0x000000b8,0x0000005b,0x0004003d,
+0x0000000d,0x000000ba,0x00000016,0x000500c2,
+0x0000000d,0x000000bb,0x000000ba,0x0000005a,
+0x0004003d,0x0000000d,0x000000bc,0x00000016,
+0x000500c2,0x0000000d,0x000000bd,0x000000bc,
+0x00000059,0x0004003d,0x0000000d,0x000000be,
+0x00000016,0x000500c2,0x0000000d,0x000000bf,
+0x000000be,0x00000067,0x0004003d,0x0000000d,
+0x000000c0,0x00000016,0x00130050,0x00000097,
+0x000000c1,0x0000009c,0x0000009e,0x000000a0,
+0x000000a2,0x000000a4,0x000000aa,0x000000ad,
+0x000000af,0x000000b2,0x000000b5,0x000000b7,
+0x000000b9,0x000000bb,0x000000bd,0x000000bf,
+0x000000c0,0x0003003e,0x00000099,0x000000c1,
+0x0003003e,0x000000c2,0x000000c3,0x000200f9,
+0x000000c4,0x000200f8,0x000000c4,0x000400f6,
+0x000000c6,0x000000c7,0x00000000,0x000200f9,
+0x000000c8,0x000200f8,0x000000c8,0x0004003d,
+0x0000000d,0x000000c9,0x000000c2,0x000500b0,
+0x0000000f,0x000000ca,0x000000c9,0x00000012,
+0x000400fa,0x000000ca,0x000000c5,0x000000c6,
+0x000200f8,0x000000c5,0x0004003d,0x0000000d,
+0x000000cc,0x000000c2,0x00050089,0x0000000d,
+0x000000ce,0x000000cc,0x000000cd,0x00050084,
+0x0000000d,0x000000cf,0x000000ce,0x000000cd,
+0x0004003d,0x0000000d,0x000000d0,0x000000c2,
+0x00050086,0x0000000d,0x000000d1,0x000000d0,
+0x000000cd,0x00050080,0x0000000d,0x000000d2,
+0x000000cf,0x000000d1,0x0003003e,0x000000cb,
+0x000000d2,0x0004003d,0x0000000d,0x000000d4,
+0x000000c2,0x00050041,0x0000000e,0x000000d5,
+0x00000099,0x000000d4,0x0004003d,0x0000000d,
+0x000000d6,0x000000d5,0x000500c7,0x0000000d,
+0x000000d8,0x000000d6,0x000000d7,0x0003003e,
+0x000000d3,0x000000d8,0x0004003d,0x0000000d,
+0x000000da,0x000000d3,0x000500ae,0x0000000f,
+0x000000db,0x000000da,0x000000cd,0x000300f7,
+0x000000de,0x00000000,0x000400fa,0x000000db,
+0x000000dd,0x000000e3,0x000200f8,0x000000dd,
+0x0004003d,0x0000000d,0x000000df,0x000000d3,
+0x00050082,0x0000000d,0x000000e0,0x000000df,
+0x000000cd,0x00050041,0x00000021,0x000000e1,
+0x0000008f,0x000000e0,0x0004003d,0x00000006,
+0x000000e2,0x000000e1,0x0003003e,0x000000dc,
+0x000000e2,0x000200f9,0x000000de,0x000200f8,
+0x000000e3,0x0004003d,0x0000000d,0x000000e4,
+0x000000d3,0x00050041,0x00000021,0x000000e5,
+0x00000048,0x000000e4,0x0004003d,0x00000006,
+0x000000e6,0x000000e5,0x0003003e,0x000000dc,
+0x000000e6,0x000200f9,0x000000de,0x000200f8,
+0x000000de,0x0004003d,0x00000006,0x000000e7,
+0x000000dc,0x0003003e,0x000000d9,0x000000e7,
+0x0004003d,0x00000006,0x000000e9,0x00000022,
+0x0004003d,0x00000006,0x000000ea,0x000000d9,
+0x0004003d,0x00000006,0x000000eb,0x00000038,
+0x00050084,0x00000006,0x000000ec,0x000000ea,
+0x000000eb,0x00050080,0x00000006,0x000000ed,
+0x000000e9,0x000000ec,0x0003003e,0x000000e8,
+0x000000ed,0x0004003d,0x00000006,0x000000ee,
+0x000000e8,0x00050084,0x00000006,0x000000ef,
+0x000000ee,0x00000052,0x0003003e,0x000000e8,
+0x000000ef,0x0004003d,0x00000006,0x000000f0,
+0x00000038,0x000500aa,0x0000000f,0x000000f1,
+0x000000f0,0x00000081,0x000300f7,0x000000f3,
+0x00000000,0x000400fa,0x000000f1,0x000000f2,
+0x000000f3,0x000200f8,0x000000f2,0x0004003d,
+0x00000006,0x000000f4,0x000000d9,0x0004003d,
+0x00000006,0x000000f5,0x000000e8,0x00050080,
+0x00000006,0x000000f6,0x000000f5,0x000000f4,
+0x0003003e,0x000000e8,0x000000f6,0x000200f9,
+0x000000f3,0x000200f8,0x000000f3,0x0004003d,
+0x0000000f,0x000000f7,0x00000017,0x000300f7,
+0x000000f9,0x00000000,0x000400fa,0x000000f7,
+0x000000f8,0x00000107,0x000200f8,0x000000f8,
+0x0004003d,0x00000006,0x000000fa,0x000000e8,
+0x0008000c,0x00000006,0x000000fd,0x00000001,
+0x0000002d,0x000000fa,0x000000fb,0x000000fc,
+0x0003003e,0x000000e8,0x000000fd,0x0004003d,
+0x0000000d,0x00000100,0x000000cb,0x0004003d,
+0x00000006,0x00000101,0x000000e8,0x0004006f,
+0x00000011,0x00000102,0x00000101,0x00050088,
+0x00000011,0x00000104,0x00000102,0x00000103,
+0x00050041,0x00000105,0x00000106,0x000000ff,
+0x00000100,0x0003003e,0x00000106,0x00000104,
+0x000200f9,0x000000f9,0x000200f8,0x00000107,
+0x0004003d,0x00000006,0x00000108,0x000000e8,
+0x00050080,0x00000006,0x00000109,0x00000108,
+0x00000062,0x0003003e,0x000000e8,0x00000109,
+0x0004003d,0x00000006,0x0000010a,0x000000e8,
+0x0008000c,0x00000006,0x0000010c,0x00000001,
+0x0000002d,0x0000010a,0x00000081,0x0000010b,
+0x0003003e,0x000000e8,0x0000010c,0x0004003d,
+0x0000000d,0x0000010d,0x000000cb,0x0004003d,
+0x00000006,0x0000010e,0x000000e8,0x0004006f,
+0x00000011,0x0000010f,0x0000010e,0x00050088,
+0x00000011,0x00000111,0x0000010f,0x00000110,
+0x00050041,0x00000105,0x00000112,0x000000ff,
+0x0000010d,0x0003003e,0x00000112,0x00000111,
+0x000200f9,0x000000f9,0x000200f8,0x000000f9,
+0x000200f9,0x000000c7,0x000200f8,0x000000c7,
+0x0004003d,0x0000000d,0x00000113,0x000000c2,
+0x00050080,0x0000000d,0x00000114,0x00000113,
+0x00000061,0x0003003e,0x000000c2,0x00000114,
+0x000200f9,0x000000c4,0x000200f8,0x000000c6,
+0x0004003d,0x00000013,0x00000115,0x000000ff,
+0x000200fe,0x00000115,0x00010038,0x00050036,
+0x0000000d,0x0000001c,0x00000000,0x0000001a,
+0x00030037,0x0000000e,0x0000001b,0x000200f8,
+0x0000001d,0x0004003d,0x0000000d,0x00000118,
+0x0000001b,0x000500c7,0x0000000d,0x0000011a,
+0x00000118,0x00000119,0x000500c4,0x0000000d,
+0x0000011b,0x0000011a,0x00000024,0x0004003d,
+0x0000000d,0x0000011c,0x0000001b,0x000500c7,
+0x0000000d,0x0000011e,0x0000011c,0x0000011d,
+0x000500c4,0x0000000d,0x0000011f,0x0000011e,
+0x00000052,0x000500c5,0x0000000d,0x00000120,
+0x0000011b,0x0000011f,0x0004003d,0x0000000d,
+0x00000121,0x0000001b,0x000500c7,0x0000000d,
+0x00000123,0x00000121,0x00000122,0x000500c2,
+0x0000000d,0x00000124,0x00000123,0x00000052,
+0x000500c5,0x0000000d,0x00000125,0x00000120,
+0x00000124,0x0004003d,0x0000000d,0x00000126,
+0x0000001b,0x000500c7,0x0000000d,0x00000128,
+0x00000126,0x00000127,0x000500c2,0x0000000d,
+0x00000129,0x00000128,0x00000024,0x000500c5,
+0x0000000d,0x0000012a,0x00000125,0x00000129,
+0x000200fe,0x0000012a,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_3D.inl
new file mode 100644
index 00000000000..ca8bb2fb908
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/EacRG11Unorm_3D.inl
@@ -0,0 +1,671 @@
+0x07230203,0x00010300,0x000d000a,0x000001d2,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x00000031,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x00000130,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00060005,
+0x0000000b,0x50746567,0x4433736f,0x33697628,
+0x0000003b,0x00030005,0x0000000a,0x00736f70,
+0x000e0005,0x00000018,0x5f636165,0x6f636564,
+0x735f6564,0x6c676e69,0x68635f65,0x656e6e61,
+0x6c625f6c,0x5f6b636f,0x616f6c66,0x31752874,
+0x3b31753b,0x003b3162,0x00040005,0x00000015,
+0x68676968,0x00000000,0x00030005,0x00000016,
+0x00776f6c,0x00050005,0x00000017,0x69537369,
+0x64656e67,0x00000000,0x00050005,0x0000001c,
+0x70696c66,0x75283233,0x00003b31,0x00030005,
+0x0000001b,0x00000061,0x00060005,0x00000022,
+0x65736162,0x646f635f,0x726f7765,0x00000064,
+0x00050005,0x00000038,0x746c756d,0x696c7069,
+0x00007265,0x00040005,0x00000040,0x496c6274,
+0x00007864,0x00040005,0x00000048,0x6c626174,
+0x00003065,0x00050005,0x0000008c,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x0000008f,
+0x6c626174,0x00003165,0x00050005,0x00000094,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000099,0x00000070,0x00030005,0x000000c2,
+0x00000069,0x00040005,0x000000cb,0x4974756f,
+0x00007864,0x00050005,0x000000d3,0x69646f6d,
+0x72656966,0x00000000,0x00060005,0x000000d9,
+0x69646f6d,0x72656966,0x756c6156,0x00000065,
+0x00040005,0x000000e8,0x6f636564,0x00646564,
+0x00040005,0x000000ff,0x75736572,0x0000746c,
+0x00030005,0x0000012d,0x00736f70,0x00080005,
+0x00000130,0x475f6c67,0x61626f6c,0x766e496c,
+0x7461636f,0x496e6f69,0x00000044,0x00070005,
+0x00000133,0x67616d49,0x726f4665,0x4274616d,
+0x6b636f6c,0x00000000,0x00060006,0x00000133,
+0x00000000,0x706d6f63,0x6d726f46,0x00007461,
+0x00060006,0x00000133,0x00000001,0x65736162,
+0x6579614c,0x00000072,0x00060005,0x00000135,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00050005,0x00000140,0x42637273,0x6b636f6c,
+0x00000000,0x00050005,0x00000143,0x6d695f75,
+0x30656761,0x00000000,0x00040005,0x00000145,
+0x61726170,0x0000006d,0x00060005,0x00000149,
+0x6f636564,0x6572706d,0x64657373,0x00000052,
+0x00040005,0x0000014a,0x61726170,0x0000006d,
+0x00040005,0x0000014e,0x61726170,0x0000006d,
+0x00040005,0x00000153,0x61726170,0x0000006d,
+0x00040005,0x00000154,0x61726170,0x0000006d,
+0x00040005,0x00000155,0x61726170,0x0000006d,
+0x00060005,0x00000157,0x6f636564,0x6572706d,
+0x64657373,0x00000047,0x00040005,0x00000158,
+0x61726170,0x0000006d,0x00040005,0x0000015c,
+0x61726170,0x0000006d,0x00040005,0x00000161,
+0x61726170,0x0000006d,0x00040005,0x00000162,
+0x61726170,0x0000006d,0x00040005,0x00000163,
+0x61726170,0x0000006d,0x00030005,0x00000165,
+0x00000079,0x00030005,0x0000016d,0x00000078,
+0x00050005,0x00000177,0x6d695f75,0x31656761,
+0x00000000,0x00040005,0x00000187,0x61726170,
+0x0000006d,0x00040047,0x00000130,0x0000000b,
+0x0000001c,0x00050048,0x00000133,0x00000000,
+0x00000023,0x00000000,0x00050048,0x00000133,
+0x00000001,0x00000023,0x00000004,0x00030047,
+0x00000133,0x00000002,0x00040047,0x00000143,
+0x00000022,0x00000000,0x00040047,0x00000143,
+0x00000021,0x00000000,0x00030047,0x00000143,
+0x00000018,0x00040047,0x00000177,0x00000022,
+0x00000000,0x00040047,0x00000177,0x00000021,
+0x00000001,0x00030047,0x00000177,0x00000019,
+0x00040047,0x000001d1,0x0000000b,0x00000019,
+0x00020013,0x00000002,0x00030021,0x00000003,
+0x00000002,0x00040015,0x00000006,0x00000020,
+0x00000001,0x00040017,0x00000007,0x00000006,
+0x00000003,0x00040020,0x00000008,0x00000007,
+0x00000007,0x00040021,0x00000009,0x00000007,
+0x00000008,0x00040015,0x0000000d,0x00000020,
+0x00000000,0x00040020,0x0000000e,0x00000007,
+0x0000000d,0x00020014,0x0000000f,0x00040020,
+0x00000010,0x00000007,0x0000000f,0x00030016,
+0x00000011,0x00000020,0x0004002b,0x0000000d,
+0x00000012,0x00000010,0x0004001c,0x00000013,
+0x00000011,0x00000012,0x00060021,0x00000014,
+0x00000013,0x0000000e,0x0000000e,0x00000010,
+0x00040021,0x0000001a,0x0000000d,0x0000000e,
+0x00040020,0x00000021,0x00000007,0x00000006,
+0x0004002b,0x00000006,0x00000024,0x00000018,
+0x0004002b,0x00000006,0x0000002b,0x00000080,
+0x0004002b,0x00000006,0x0000002f,0x00000100,
+0x0004002b,0x00000006,0x00000033,0xffffff80,
+0x0004002b,0x00000006,0x00000037,0xffffff81,
+0x0004002b,0x00000006,0x0000003a,0x00000014,
+0x0004002b,0x00000006,0x0000003d,0x0000000f,
+0x0004002b,0x00000006,0x00000042,0x00000010,
+0x0004002b,0x0000000d,0x00000044,0x0000000f,
+0x00040017,0x00000046,0x00000006,0x00000004,
+0x00040020,0x00000047,0x00000007,0x00000046,
+0x0004002b,0x0000000d,0x00000049,0x00000020,
+0x0004001c,0x0000004a,0x00000046,0x00000049,
+0x0004002b,0x00000006,0x0000004b,0xfffffffd,
+0x0004002b,0x00000006,0x0000004c,0xfffffffa,
+0x0004002b,0x00000006,0x0000004d,0xfffffff7,
+0x0004002b,0x00000006,0x0000004e,0xfffffff1,
+0x0007002c,0x00000046,0x0000004f,0x0000004b,
+0x0000004c,0x0000004d,0x0000004e,0x0004002b,
+0x00000006,0x00000050,0x00000002,0x0004002b,
+0x00000006,0x00000051,0x00000005,0x0004002b,
+0x00000006,0x00000052,0x00000008,0x0004002b,
+0x00000006,0x00000053,0x0000000e,0x0007002c,
+0x00000046,0x00000054,0x00000050,0x00000051,
+0x00000052,0x00000053,0x0004002b,0x00000006,
+0x00000055,0xfffffff9,0x0004002b,0x00000006,
+0x00000056,0xfffffff6,0x0004002b,0x00000006,
+0x00000057,0xfffffff3,0x0007002c,0x00000046,
+0x00000058,0x0000004b,0x00000055,0x00000056,
+0x00000057,0x0004002b,0x00000006,0x00000059,
+0x00000006,0x0004002b,0x00000006,0x0000005a,
+0x00000009,0x0004002b,0x00000006,0x0000005b,
+0x0000000c,0x0007002c,0x00000046,0x0000005c,
+0x00000050,0x00000059,0x0000005a,0x0000005b,
+0x0004002b,0x00000006,0x0000005d,0xfffffffe,
+0x0004002b,0x00000006,0x0000005e,0xfffffffb,
+0x0004002b,0x00000006,0x0000005f,0xfffffff8,
+0x0007002c,0x00000046,0x00000060,0x0000005d,
+0x0000005e,0x0000005f,0x00000057,0x0004002b,
+0x00000006,0x00000061,0x00000001,0x0004002b,
+0x00000006,0x00000062,0x00000004,0x0004002b,
+0x00000006,0x00000063,0x00000007,0x0007002c,
+0x00000046,0x00000064,0x00000061,0x00000062,
+0x00000063,0x0000005b,0x0004002b,0x00000006,
+0x00000065,0xfffffffc,0x0007002c,0x00000046,
+0x00000066,0x0000005d,0x00000065,0x0000004c,
+0x00000057,0x0004002b,0x00000006,0x00000067,
+0x00000003,0x0007002c,0x00000046,0x00000068,
+0x00000061,0x00000067,0x00000051,0x0000005b,
+0x0004002b,0x00000006,0x00000069,0xfffffff4,
+0x0007002c,0x00000046,0x0000006a,0x0000004b,
+0x0000004c,0x0000005f,0x00000069,0x0004002b,
+0x00000006,0x0000006b,0x0000000b,0x0007002c,
+0x00000046,0x0000006c,0x00000050,0x00000051,
+0x00000063,0x0000006b,0x0004002b,0x00000006,
+0x0000006d,0xfffffff5,0x0007002c,0x00000046,
+0x0000006e,0x0000004b,0x00000055,0x0000004d,
+0x0000006d,0x0004002b,0x00000006,0x0000006f,
+0x0000000a,0x0007002c,0x00000046,0x00000070,
+0x00000050,0x00000059,0x00000052,0x0000006f,
+0x0007002c,0x00000046,0x00000071,0x00000065,
+0x00000055,0x0000005f,0x0000006d,0x0007002c,
+0x00000046,0x00000072,0x00000067,0x00000059,
+0x00000063,0x0000006f,0x0007002c,0x00000046,
+0x00000073,0x0000004b,0x0000005e,0x0000005f,
+0x0000006d,0x0007002c,0x00000046,0x00000074,
+0x00000050,0x00000062,0x00000063,0x0000006f,
+0x0007002c,0x00000046,0x00000075,0x0000005d,
+0x0000004c,0x0000005f,0x00000056,0x0007002c,
+0x00000046,0x00000076,0x00000061,0x00000051,
+0x00000063,0x0000005a,0x0007002c,0x00000046,
+0x00000077,0x0000005d,0x0000005e,0x0000005f,
+0x00000056,0x0007002c,0x00000046,0x00000078,
+0x00000061,0x00000062,0x00000063,0x0000005a,
+0x0007002c,0x00000046,0x00000079,0x0000005d,
+0x00000065,0x0000005f,0x00000056,0x0007002c,
+0x00000046,0x0000007a,0x00000061,0x00000067,
+0x00000063,0x0000005a,0x0007002c,0x00000046,
+0x0000007b,0x0000005d,0x0000005e,0x00000055,
+0x00000056,0x0007002c,0x00000046,0x0000007c,
+0x00000061,0x00000062,0x00000059,0x0000005a,
+0x0007002c,0x00000046,0x0000007d,0x0000004b,
+0x00000065,0x00000055,0x00000056,0x0007002c,
+0x00000046,0x0000007e,0x00000050,0x00000067,
+0x00000059,0x0000005a,0x0004002b,0x00000006,
+0x0000007f,0xffffffff,0x0007002c,0x00000046,
+0x00000080,0x0000007f,0x0000005d,0x0000004b,
+0x00000056,0x0004002b,0x00000006,0x00000081,
+0x00000000,0x0007002c,0x00000046,0x00000082,
+0x00000081,0x00000061,0x00000050,0x0000005a,
+0x0007002c,0x00000046,0x00000083,0x00000065,
+0x0000004c,0x0000005f,0x0000004d,0x0007002c,
+0x00000046,0x00000084,0x00000067,0x00000051,
+0x00000063,0x00000052,0x0007002c,0x00000046,
+0x00000085,0x0000004b,0x0000005e,0x00000055,
+0x0000004d,0x0007002c,0x00000046,0x00000086,
+0x00000050,0x00000062,0x00000059,0x00000052,
+0x0023002c,0x0000004a,0x00000087,0x0000004f,
+0x00000054,0x00000058,0x0000005c,0x00000060,
+0x00000064,0x00000066,0x00000068,0x0000006a,
+0x0000006c,0x0000006e,0x00000070,0x00000071,
+0x00000072,0x00000073,0x00000074,0x00000075,
+0x00000076,0x00000077,0x00000078,0x00000079,
+0x0000007a,0x0000007b,0x0000007c,0x0000007d,
+0x0000007e,0x00000080,0x00000082,0x00000083,
+0x00000084,0x00000085,0x00000086,0x0004002b,
+0x0000000d,0x00000089,0x00000002,0x00040020,
+0x0000008b,0x00000007,0x0000004a,0x0004002b,
+0x0000000d,0x00000092,0x00000001,0x0004001c,
+0x00000097,0x0000000d,0x00000012,0x00040020,
+0x00000098,0x00000007,0x00000097,0x0004002b,
+0x00000006,0x0000009b,0x0000000d,0x0004002b,
+0x00000006,0x000000a8,0x0000001e,0x0004002b,
+0x00000006,0x000000ac,0x0000001b,0x0004002b,
+0x00000006,0x000000b1,0x00000015,0x0004002b,
+0x00000006,0x000000b4,0x00000012,0x0004002b,
+0x0000000d,0x000000c3,0x00000000,0x0004002b,
+0x0000000d,0x000000cd,0x00000004,0x0004002b,
+0x0000000d,0x000000d7,0x00000007,0x0004002b,
+0x00000006,0x000000fb,0xfffffc01,0x0004002b,
+0x00000006,0x000000fc,0x000003ff,0x00040020,
+0x000000fe,0x00000007,0x00000013,0x0004002b,
+0x00000011,0x00000103,0x447fc000,0x00040020,
+0x00000105,0x00000007,0x00000011,0x0004002b,
+0x00000006,0x0000010b,0x000007ff,0x0004002b,
+0x00000011,0x00000110,0x44ffe000,0x0004002b,
+0x0000000d,0x00000119,0x000000ff,0x0004002b,
+0x0000000d,0x0000011d,0x0000ff00,0x0004002b,
+0x0000000d,0x00000122,0x00ff0000,0x0004002b,
+0x0000000d,0x00000127,0xff000000,0x00040017,
+0x0000012e,0x0000000d,0x00000003,0x00040020,
+0x0000012f,0x00000001,0x0000012e,0x0004003b,
+0x0000012f,0x00000130,0x00000001,0x0004001e,
+0x00000133,0x0000000d,0x0000000d,0x00040020,
+0x00000134,0x00000009,0x00000133,0x0004003b,
+0x00000134,0x00000135,0x00000009,0x00040020,
+0x00000136,0x00000009,0x0000000d,0x00040017,
+0x0000013e,0x0000000d,0x00000004,0x00040020,
+0x0000013f,0x00000007,0x0000013e,0x00090019,
+0x00000141,0x0000000d,0x00000002,0x00000000,
+0x00000000,0x00000000,0x00000002,0x0000001e,
+0x00040020,0x00000142,0x00000000,0x00000141,
+0x0004003b,0x00000142,0x00000143,0x00000000,
+0x0003002a,0x0000000f,0x00000152,0x0004002b,
+0x0000000d,0x0000015d,0x00000003,0x00090019,
+0x00000175,0x00000011,0x00000002,0x00000000,
+0x00000000,0x00000000,0x00000002,0x0000000c,
+0x00040020,0x00000176,0x00000000,0x00000175,
+0x0004003b,0x00000176,0x00000177,0x00000000,
+0x00040017,0x00000179,0x00000006,0x00000002,
+0x0004002b,0x00000011,0x00000195,0x00000000,
+0x0004002b,0x00000011,0x00000196,0x3f800000,
+0x00040017,0x00000197,0x00000011,0x00000004,
+0x0004002b,0x0000000d,0x0000019d,0x00000093,
+0x0004002b,0x0000000d,0x0000019e,0x00000094,
+0x0004002b,0x0000000d,0x0000019f,0x00000095,
+0x0004002b,0x0000000d,0x000001a0,0x00000096,
+0x0004002b,0x0000000d,0x000001a1,0x00000097,
+0x0004002b,0x0000000d,0x000001a2,0x00000098,
+0x0004002b,0x0000000d,0x000001a3,0x00000099,
+0x0004002b,0x0000000d,0x000001a4,0x0000009a,
+0x0004002b,0x0000000d,0x000001a5,0x0000009b,
+0x0004002b,0x0000000d,0x000001a6,0x0000009c,
+0x0004002b,0x0000000d,0x000001a7,0x00000008,
+0x0004001c,0x000001a8,0x00000006,0x000001a7,
+0x000b002c,0x000001a8,0x000001a9,0x00000081,
+0x00000061,0x00000050,0x00000067,0x00000065,
+0x0000004b,0x0000005d,0x0000007f,0x0004001c,
+0x000001aa,0x00000046,0x000001a7,0x0007002c,
+0x00000046,0x000001ab,0x00000050,0x00000052,
+0x0000005d,0x0000005f,0x0004002b,0x00000006,
+0x000001ac,0x00000011,0x0004002b,0x00000006,
+0x000001ad,0xffffffef,0x0007002c,0x00000046,
+0x000001ae,0x00000051,0x000001ac,0x0000005e,
+0x000001ad,0x0004002b,0x00000006,0x000001af,
+0x0000001d,0x0004002b,0x00000006,0x000001b0,
+0xffffffe3,0x0007002c,0x00000046,0x000001b1,
+0x0000005a,0x000001af,0x0000004d,0x000001b0,
+0x0004002b,0x00000006,0x000001b2,0x0000002a,
+0x0004002b,0x00000006,0x000001b3,0xffffffd6,
+0x0007002c,0x00000046,0x000001b4,0x0000009b,
+0x000001b2,0x00000057,0x000001b3,0x0004002b,
+0x00000006,0x000001b5,0x0000003c,0x0004002b,
+0x00000006,0x000001b6,0xffffffee,0x0004002b,
+0x00000006,0x000001b7,0xffffffc4,0x0007002c,
+0x00000046,0x000001b8,0x000000b4,0x000001b5,
+0x000001b6,0x000001b7,0x0004002b,0x00000006,
+0x000001b9,0x00000050,0x0004002b,0x00000006,
+0x000001ba,0xffffffe8,0x0004002b,0x00000006,
+0x000001bb,0xffffffb0,0x0007002c,0x00000046,
+0x000001bc,0x00000024,0x000001b9,0x000001ba,
+0x000001bb,0x0004002b,0x00000006,0x000001bd,
+0x00000021,0x0004002b,0x00000006,0x000001be,
+0x0000006a,0x0004002b,0x00000006,0x000001bf,
+0xffffffdf,0x0004002b,0x00000006,0x000001c0,
+0xffffff96,0x0007002c,0x00000046,0x000001c1,
+0x000001bd,0x000001be,0x000001bf,0x000001c0,
+0x0004002b,0x00000006,0x000001c2,0x0000002f,
+0x0004002b,0x00000006,0x000001c3,0x000000b7,
+0x0004002b,0x00000006,0x000001c4,0xffffffd1,
+0x0004002b,0x00000006,0x000001c5,0xffffff49,
+0x0007002c,0x00000046,0x000001c6,0x000001c2,
+0x000001c3,0x000001c4,0x000001c5,0x000b002c,
+0x000001aa,0x000001c7,0x000001ab,0x000001ae,
+0x000001b1,0x000001b4,0x000001b8,0x000001bc,
+0x000001c1,0x000001c6,0x0007002c,0x00000046,
+0x000001c8,0x00000081,0x00000052,0x00000081,
+0x0000005f,0x0007002c,0x00000046,0x000001c9,
+0x00000081,0x000001ac,0x00000081,0x000001ad,
+0x0007002c,0x00000046,0x000001ca,0x00000081,
+0x000001af,0x00000081,0x000001b0,0x0007002c,
+0x00000046,0x000001cb,0x00000081,0x000001b2,
+0x00000081,0x000001b3,0x0007002c,0x00000046,
+0x000001cc,0x00000081,0x000001b5,0x00000081,
+0x000001b7,0x0007002c,0x00000046,0x000001cd,
+0x00000081,0x000001b9,0x00000081,0x000001bb,
+0x0007002c,0x00000046,0x000001ce,0x00000081,
+0x000001be,0x00000081,0x000001c0,0x0007002c,
+0x00000046,0x000001cf,0x00000081,0x000001c3,
+0x00000081,0x000001c5,0x000b002c,0x000001aa,
+0x000001d0,0x000001c8,0x000001c9,0x000001ca,
+0x000001cb,0x000001cc,0x000001cd,0x000001ce,
+0x000001cf,0x0006002c,0x0000012e,0x000001d1,
+0x000001a7,0x000001a7,0x00000092,0x00050036,
+0x00000002,0x00000004,0x00000000,0x00000003,
+0x000200f8,0x00000005,0x0004003b,0x00000008,
+0x0000012d,0x00000007,0x0004003b,0x0000013f,
+0x00000140,0x00000007,0x0004003b,0x00000008,
+0x00000145,0x00000007,0x0004003b,0x000000fe,
+0x00000149,0x00000007,0x0004003b,0x0000000e,
+0x0000014a,0x00000007,0x0004003b,0x0000000e,
+0x0000014e,0x00000007,0x0004003b,0x0000000e,
+0x00000153,0x00000007,0x0004003b,0x0000000e,
+0x00000154,0x00000007,0x0004003b,0x00000010,
+0x00000155,0x00000007,0x0004003b,0x000000fe,
+0x00000157,0x00000007,0x0004003b,0x0000000e,
+0x00000158,0x00000007,0x0004003b,0x0000000e,
+0x0000015c,0x00000007,0x0004003b,0x0000000e,
+0x00000161,0x00000007,0x0004003b,0x0000000e,
+0x00000162,0x00000007,0x0004003b,0x00000010,
+0x00000163,0x00000007,0x0004003b,0x00000021,
+0x00000165,0x00000007,0x0004003b,0x00000021,
+0x0000016d,0x00000007,0x0004003b,0x00000008,
+0x00000187,0x00000007,0x0004003d,0x0000012e,
+0x00000131,0x00000130,0x0004007c,0x00000007,
+0x00000132,0x00000131,0x0003003e,0x0000012d,
+0x00000132,0x00050041,0x00000136,0x00000137,
+0x00000135,0x00000061,0x0004003d,0x0000000d,
+0x00000138,0x00000137,0x0004007c,0x00000006,
+0x00000139,0x00000138,0x00050041,0x00000021,
+0x0000013a,0x0000012d,0x00000089,0x0004003d,
+0x00000006,0x0000013b,0x0000013a,0x00050080,
+0x00000006,0x0000013c,0x0000013b,0x00000139,
+0x00050041,0x00000021,0x0000013d,0x0000012d,
+0x00000089,0x0003003e,0x0000013d,0x0000013c,
+0x0004003d,0x00000141,0x00000144,0x00000143,
+0x0004003d,0x00000007,0x00000146,0x0000012d,
+0x0003003e,0x00000145,0x00000146,0x00050039,
+0x00000007,0x00000147,0x0000000b,0x00000145,
+0x00050062,0x0000013e,0x00000148,0x00000144,
+0x00000147,0x0003003e,0x00000140,0x00000148,
+0x00050041,0x0000000e,0x0000014b,0x00000140,
+0x000000c3,0x0004003d,0x0000000d,0x0000014c,
+0x0000014b,0x0003003e,0x0000014a,0x0000014c,
+0x00050039,0x0000000d,0x0000014d,0x0000001c,
+0x0000014a,0x00050041,0x0000000e,0x0000014f,
+0x00000140,0x00000092,0x0004003d,0x0000000d,
+0x00000150,0x0000014f,0x0003003e,0x0000014e,
+0x00000150,0x00050039,0x0000000d,0x00000151,
+0x0000001c,0x0000014e,0x0003003e,0x00000153,
+0x0000014d,0x0003003e,0x00000154,0x00000151,
+0x0003003e,0x00000155,0x00000152,0x00070039,
+0x00000013,0x00000156,0x00000018,0x00000153,
+0x00000154,0x00000155,0x0003003e,0x00000149,
+0x00000156,0x00050041,0x0000000e,0x00000159,
+0x00000140,0x00000089,0x0004003d,0x0000000d,
+0x0000015a,0x00000159,0x0003003e,0x00000158,
+0x0000015a,0x00050039,0x0000000d,0x0000015b,
+0x0000001c,0x00000158,0x00050041,0x0000000e,
+0x0000015e,0x00000140,0x0000015d,0x0004003d,
+0x0000000d,0x0000015f,0x0000015e,0x0003003e,
+0x0000015c,0x0000015f,0x00050039,0x0000000d,
+0x00000160,0x0000001c,0x0000015c,0x0003003e,
+0x00000161,0x0000015b,0x0003003e,0x00000162,
+0x00000160,0x0003003e,0x00000163,0x00000152,
+0x00070039,0x00000013,0x00000164,0x00000018,
+0x00000161,0x00000162,0x00000163,0x0003003e,
+0x00000157,0x00000164,0x0003003e,0x00000165,
+0x00000081,0x000200f9,0x00000166,0x000200f8,
+0x00000166,0x000400f6,0x00000168,0x00000169,
+0x00000000,0x000200f9,0x0000016a,0x000200f8,
+0x0000016a,0x0004003d,0x00000006,0x0000016b,
+0x00000165,0x000500b1,0x0000000f,0x0000016c,
+0x0000016b,0x00000062,0x000400fa,0x0000016c,
+0x00000167,0x00000168,0x000200f8,0x00000167,
+0x0003003e,0x0000016d,0x00000081,0x000200f9,
+0x0000016e,0x000200f8,0x0000016e,0x000400f6,
+0x00000170,0x00000171,0x00000000,0x000200f9,
+0x00000172,0x000200f8,0x00000172,0x0004003d,
+0x00000006,0x00000173,0x0000016d,0x000500b1,
+0x0000000f,0x00000174,0x00000173,0x00000062,
+0x000400fa,0x00000174,0x0000016f,0x00000170,
+0x000200f8,0x0000016f,0x0004003d,0x00000175,
+0x00000178,0x00000177,0x0004003d,0x00000007,
+0x0000017a,0x0000012d,0x0007004f,0x00000179,
+0x0000017b,0x0000017a,0x0000017a,0x00000000,
+0x00000001,0x00050050,0x00000179,0x0000017c,
+0x00000062,0x00000062,0x00050084,0x00000179,
+0x0000017d,0x0000017b,0x0000017c,0x0004003d,
+0x00000006,0x0000017e,0x0000016d,0x0004003d,
+0x00000006,0x0000017f,0x00000165,0x00050050,
+0x00000179,0x00000180,0x0000017e,0x0000017f,
+0x00050080,0x00000179,0x00000181,0x0000017d,
+0x00000180,0x00050041,0x00000021,0x00000182,
+0x0000012d,0x00000089,0x0004003d,0x00000006,
+0x00000183,0x00000182,0x00050051,0x00000006,
+0x00000184,0x00000181,0x00000000,0x00050051,
+0x00000006,0x00000185,0x00000181,0x00000001,
+0x00060050,0x00000007,0x00000186,0x00000184,
+0x00000185,0x00000183,0x0003003e,0x00000187,
+0x00000186,0x00050039,0x00000007,0x00000188,
+0x0000000b,0x00000187,0x0004003d,0x00000006,
+0x00000189,0x00000165,0x00050084,0x00000006,
+0x0000018a,0x00000189,0x00000062,0x0004003d,
+0x00000006,0x0000018b,0x0000016d,0x00050080,
+0x00000006,0x0000018c,0x0000018a,0x0000018b,
+0x00050041,0x00000105,0x0000018d,0x00000149,
+0x0000018c,0x0004003d,0x00000011,0x0000018e,
+0x0000018d,0x0004003d,0x00000006,0x0000018f,
+0x00000165,0x00050084,0x00000006,0x00000190,
+0x0000018f,0x00000062,0x0004003d,0x00000006,
+0x00000191,0x0000016d,0x00050080,0x00000006,
+0x00000192,0x00000190,0x00000191,0x00050041,
+0x00000105,0x00000193,0x00000157,0x00000192,
+0x0004003d,0x00000011,0x00000194,0x00000193,
+0x00070050,0x00000197,0x00000198,0x0000018e,
+0x00000194,0x00000195,0x00000196,0x00040063,
+0x00000178,0x00000188,0x00000198,0x000200f9,
+0x00000171,0x000200f8,0x00000171,0x0004003d,
+0x00000006,0x00000199,0x0000016d,0x00050080,
+0x00000006,0x0000019a,0x00000199,0x00000061,
+0x0003003e,0x0000016d,0x0000019a,0x000200f9,
+0x0000016e,0x000200f8,0x00000170,0x000200f9,
+0x00000169,0x000200f8,0x00000169,0x0004003d,
+0x00000006,0x0000019b,0x00000165,0x00050080,
+0x00000006,0x0000019c,0x0000019b,0x00000061,
+0x0003003e,0x00000165,0x0000019c,0x000200f9,
+0x00000166,0x000200f8,0x00000168,0x000100fd,
+0x00010038,0x00050036,0x00000007,0x0000000b,
+0x00000000,0x00000009,0x00030037,0x00000008,
+0x0000000a,0x000200f8,0x0000000c,0x0004003d,
+0x00000007,0x0000001e,0x0000000a,0x000200fe,
+0x0000001e,0x00010038,0x00050036,0x00000013,
+0x00000018,0x00000000,0x00000014,0x00030037,
+0x0000000e,0x00000015,0x00030037,0x0000000e,
+0x00000016,0x00030037,0x00000010,0x00000017,
+0x000200f8,0x00000019,0x0004003b,0x00000021,
+0x00000022,0x00000007,0x0004003b,0x00000021,
+0x00000038,0x00000007,0x0004003b,0x0000000e,
+0x00000040,0x00000007,0x0004003b,0x00000047,
+0x00000048,0x00000007,0x0004003b,0x0000008b,
+0x0000008c,0x00000007,0x0004003b,0x00000047,
+0x0000008f,0x00000007,0x0004003b,0x0000008b,
+0x00000094,0x00000007,0x0004003b,0x00000098,
+0x00000099,0x00000007,0x0004003b,0x0000000e,
+0x000000c2,0x00000007,0x0004003b,0x0000000e,
+0x000000cb,0x00000007,0x0004003b,0x0000000e,
+0x000000d3,0x00000007,0x0004003b,0x00000021,
+0x000000d9,0x00000007,0x0004003b,0x00000021,
+0x000000dc,0x00000007,0x0004003b,0x00000021,
+0x000000e8,0x00000007,0x0004003b,0x000000fe,
+0x000000ff,0x00000007,0x0004003d,0x0000000d,
+0x00000023,0x00000015,0x000500c2,0x0000000d,
+0x00000025,0x00000023,0x00000024,0x0004007c,
+0x00000006,0x00000026,0x00000025,0x0003003e,
+0x00000022,0x00000026,0x0004003d,0x0000000f,
+0x00000027,0x00000017,0x000300f7,0x00000029,
+0x00000000,0x000400fa,0x00000027,0x00000028,
+0x00000029,0x000200f8,0x00000028,0x0004003d,
+0x00000006,0x0000002a,0x00000022,0x000500af,
+0x0000000f,0x0000002c,0x0000002a,0x0000002b,
+0x000300f7,0x0000002e,0x00000000,0x000400fa,
+0x0000002c,0x0000002d,0x0000002e,0x000200f8,
+0x0000002d,0x0004003d,0x00000006,0x00000030,
+0x00000022,0x00050082,0x00000006,0x00000031,
+0x00000030,0x0000002f,0x0003003e,0x00000022,
+0x00000031,0x000200f9,0x0000002e,0x000200f8,
+0x0000002e,0x0004003d,0x00000006,0x00000032,
+0x00000022,0x000500aa,0x0000000f,0x00000034,
+0x00000032,0x00000033,0x000300f7,0x00000036,
+0x00000000,0x000400fa,0x00000034,0x00000035,
+0x00000036,0x000200f8,0x00000035,0x0003003e,
+0x00000022,0x00000037,0x000200f9,0x00000036,
+0x000200f8,0x00000036,0x000200f9,0x00000029,
+0x000200f8,0x00000029,0x0004003d,0x0000000d,
+0x00000039,0x00000015,0x000500c2,0x0000000d,
+0x0000003b,0x00000039,0x0000003a,0x0004007c,
+0x00000006,0x0000003c,0x0000003b,0x0003003e,
+0x00000038,0x0000003c,0x0004003d,0x00000006,
+0x0000003e,0x00000038,0x000500c7,0x00000006,
+0x0000003f,0x0000003e,0x0000003d,0x0003003e,
+0x00000038,0x0000003f,0x0004003d,0x0000000d,
+0x00000041,0x00000015,0x000500c2,0x0000000d,
+0x00000043,0x00000041,0x00000042,0x000500c7,
+0x0000000d,0x00000045,0x00000043,0x00000044,
+0x0003003e,0x00000040,0x00000045,0x0004003d,
+0x0000000d,0x00000088,0x00000040,0x00050084,
+0x0000000d,0x0000008a,0x00000088,0x00000089,
+0x0003003e,0x0000008c,0x00000087,0x00050041,
+0x00000047,0x0000008d,0x0000008c,0x0000008a,
+0x0004003d,0x00000046,0x0000008e,0x0000008d,
+0x0003003e,0x00000048,0x0000008e,0x0004003d,
+0x0000000d,0x00000090,0x00000040,0x00050084,
+0x0000000d,0x00000091,0x00000090,0x00000089,
+0x00050080,0x0000000d,0x00000093,0x00000091,
+0x00000092,0x0003003e,0x00000094,0x00000087,
+0x00050041,0x00000047,0x00000095,0x00000094,
+0x00000093,0x0004003d,0x00000046,0x00000096,
+0x00000095,0x0003003e,0x0000008f,0x00000096,
+0x0004003d,0x0000000d,0x0000009a,0x00000015,
+0x000500c2,0x0000000d,0x0000009c,0x0000009a,
+0x0000009b,0x0004003d,0x0000000d,0x0000009d,
+0x00000015,0x000500c2,0x0000000d,0x0000009e,
+0x0000009d,0x0000006f,0x0004003d,0x0000000d,
+0x0000009f,0x00000015,0x000500c2,0x0000000d,
+0x000000a0,0x0000009f,0x00000063,0x0004003d,
+0x0000000d,0x000000a1,0x00000015,0x000500c2,
+0x0000000d,0x000000a2,0x000000a1,0x00000062,
+0x0004003d,0x0000000d,0x000000a3,0x00000015,
+0x000500c2,0x0000000d,0x000000a4,0x000000a3,
+0x00000061,0x0004003d,0x0000000d,0x000000a5,
+0x00000015,0x000500c4,0x0000000d,0x000000a6,
+0x000000a5,0x00000050,0x0004003d,0x0000000d,
+0x000000a7,0x00000016,0x000500c2,0x0000000d,
+0x000000a9,0x000000a7,0x000000a8,0x000500c5,
+0x0000000d,0x000000aa,0x000000a6,0x000000a9,
+0x0004003d,0x0000000d,0x000000ab,0x00000016,
+0x000500c2,0x0000000d,0x000000ad,0x000000ab,
+0x000000ac,0x0004003d,0x0000000d,0x000000ae,
+0x00000016,0x000500c2,0x0000000d,0x000000af,
+0x000000ae,0x00000024,0x0004003d,0x0000000d,
+0x000000b0,0x00000016,0x000500c2,0x0000000d,
+0x000000b2,0x000000b0,0x000000b1,0x0004003d,
+0x0000000d,0x000000b3,0x00000016,0x000500c2,
+0x0000000d,0x000000b5,0x000000b3,0x000000b4,
+0x0004003d,0x0000000d,0x000000b6,0x00000016,
+0x000500c2,0x0000000d,0x000000b7,0x000000b6,
+0x0000003d,0x0004003d,0x0000000d,0x000000b8,
+0x00000016,0x000500c2,0x0000000d,0x000000b9,
+0x000000b8,0x0000005b,0x0004003d,0x0000000d,
+0x000000ba,0x00000016,0x000500c2,0x0000000d,
+0x000000bb,0x000000ba,0x0000005a,0x0004003d,
+0x0000000d,0x000000bc,0x00000016,0x000500c2,
+0x0000000d,0x000000bd,0x000000bc,0x00000059,
+0x0004003d,0x0000000d,0x000000be,0x00000016,
+0x000500c2,0x0000000d,0x000000bf,0x000000be,
+0x00000067,0x0004003d,0x0000000d,0x000000c0,
+0x00000016,0x00130050,0x00000097,0x000000c1,
+0x0000009c,0x0000009e,0x000000a0,0x000000a2,
+0x000000a4,0x000000aa,0x000000ad,0x000000af,
+0x000000b2,0x000000b5,0x000000b7,0x000000b9,
+0x000000bb,0x000000bd,0x000000bf,0x000000c0,
+0x0003003e,0x00000099,0x000000c1,0x0003003e,
+0x000000c2,0x000000c3,0x000200f9,0x000000c4,
+0x000200f8,0x000000c4,0x000400f6,0x000000c6,
+0x000000c7,0x00000000,0x000200f9,0x000000c8,
+0x000200f8,0x000000c8,0x0004003d,0x0000000d,
+0x000000c9,0x000000c2,0x000500b0,0x0000000f,
+0x000000ca,0x000000c9,0x00000012,0x000400fa,
+0x000000ca,0x000000c5,0x000000c6,0x000200f8,
+0x000000c5,0x0004003d,0x0000000d,0x000000cc,
+0x000000c2,0x00050089,0x0000000d,0x000000ce,
+0x000000cc,0x000000cd,0x00050084,0x0000000d,
+0x000000cf,0x000000ce,0x000000cd,0x0004003d,
+0x0000000d,0x000000d0,0x000000c2,0x00050086,
+0x0000000d,0x000000d1,0x000000d0,0x000000cd,
+0x00050080,0x0000000d,0x000000d2,0x000000cf,
+0x000000d1,0x0003003e,0x000000cb,0x000000d2,
+0x0004003d,0x0000000d,0x000000d4,0x000000c2,
+0x00050041,0x0000000e,0x000000d5,0x00000099,
+0x000000d4,0x0004003d,0x0000000d,0x000000d6,
+0x000000d5,0x000500c7,0x0000000d,0x000000d8,
+0x000000d6,0x000000d7,0x0003003e,0x000000d3,
+0x000000d8,0x0004003d,0x0000000d,0x000000da,
+0x000000d3,0x000500ae,0x0000000f,0x000000db,
+0x000000da,0x000000cd,0x000300f7,0x000000de,
+0x00000000,0x000400fa,0x000000db,0x000000dd,
+0x000000e3,0x000200f8,0x000000dd,0x0004003d,
+0x0000000d,0x000000df,0x000000d3,0x00050082,
+0x0000000d,0x000000e0,0x000000df,0x000000cd,
+0x00050041,0x00000021,0x000000e1,0x0000008f,
+0x000000e0,0x0004003d,0x00000006,0x000000e2,
+0x000000e1,0x0003003e,0x000000dc,0x000000e2,
+0x000200f9,0x000000de,0x000200f8,0x000000e3,
+0x0004003d,0x0000000d,0x000000e4,0x000000d3,
+0x00050041,0x00000021,0x000000e5,0x00000048,
+0x000000e4,0x0004003d,0x00000006,0x000000e6,
+0x000000e5,0x0003003e,0x000000dc,0x000000e6,
+0x000200f9,0x000000de,0x000200f8,0x000000de,
+0x0004003d,0x00000006,0x000000e7,0x000000dc,
+0x0003003e,0x000000d9,0x000000e7,0x0004003d,
+0x00000006,0x000000e9,0x00000022,0x0004003d,
+0x00000006,0x000000ea,0x000000d9,0x0004003d,
+0x00000006,0x000000eb,0x00000038,0x00050084,
+0x00000006,0x000000ec,0x000000ea,0x000000eb,
+0x00050080,0x00000006,0x000000ed,0x000000e9,
+0x000000ec,0x0003003e,0x000000e8,0x000000ed,
+0x0004003d,0x00000006,0x000000ee,0x000000e8,
+0x00050084,0x00000006,0x000000ef,0x000000ee,
+0x00000052,0x0003003e,0x000000e8,0x000000ef,
+0x0004003d,0x00000006,0x000000f0,0x00000038,
+0x000500aa,0x0000000f,0x000000f1,0x000000f0,
+0x00000081,0x000300f7,0x000000f3,0x00000000,
+0x000400fa,0x000000f1,0x000000f2,0x000000f3,
+0x000200f8,0x000000f2,0x0004003d,0x00000006,
+0x000000f4,0x000000d9,0x0004003d,0x00000006,
+0x000000f5,0x000000e8,0x00050080,0x00000006,
+0x000000f6,0x000000f5,0x000000f4,0x0003003e,
+0x000000e8,0x000000f6,0x000200f9,0x000000f3,
+0x000200f8,0x000000f3,0x0004003d,0x0000000f,
+0x000000f7,0x00000017,0x000300f7,0x000000f9,
+0x00000000,0x000400fa,0x000000f7,0x000000f8,
+0x00000107,0x000200f8,0x000000f8,0x0004003d,
+0x00000006,0x000000fa,0x000000e8,0x0008000c,
+0x00000006,0x000000fd,0x00000001,0x0000002d,
+0x000000fa,0x000000fb,0x000000fc,0x0003003e,
+0x000000e8,0x000000fd,0x0004003d,0x0000000d,
+0x00000100,0x000000cb,0x0004003d,0x00000006,
+0x00000101,0x000000e8,0x0004006f,0x00000011,
+0x00000102,0x00000101,0x00050088,0x00000011,
+0x00000104,0x00000102,0x00000103,0x00050041,
+0x00000105,0x00000106,0x000000ff,0x00000100,
+0x0003003e,0x00000106,0x00000104,0x000200f9,
+0x000000f9,0x000200f8,0x00000107,0x0004003d,
+0x00000006,0x00000108,0x000000e8,0x00050080,
+0x00000006,0x00000109,0x00000108,0x00000062,
+0x0003003e,0x000000e8,0x00000109,0x0004003d,
+0x00000006,0x0000010a,0x000000e8,0x0008000c,
+0x00000006,0x0000010c,0x00000001,0x0000002d,
+0x0000010a,0x00000081,0x0000010b,0x0003003e,
+0x000000e8,0x0000010c,0x0004003d,0x0000000d,
+0x0000010d,0x000000cb,0x0004003d,0x00000006,
+0x0000010e,0x000000e8,0x0004006f,0x00000011,
+0x0000010f,0x0000010e,0x00050088,0x00000011,
+0x00000111,0x0000010f,0x00000110,0x00050041,
+0x00000105,0x00000112,0x000000ff,0x0000010d,
+0x0003003e,0x00000112,0x00000111,0x000200f9,
+0x000000f9,0x000200f8,0x000000f9,0x000200f9,
+0x000000c7,0x000200f8,0x000000c7,0x0004003d,
+0x0000000d,0x00000113,0x000000c2,0x00050080,
+0x0000000d,0x00000114,0x00000113,0x00000061,
+0x0003003e,0x000000c2,0x00000114,0x000200f9,
+0x000000c4,0x000200f8,0x000000c6,0x0004003d,
+0x00000013,0x00000115,0x000000ff,0x000200fe,
+0x00000115,0x00010038,0x00050036,0x0000000d,
+0x0000001c,0x00000000,0x0000001a,0x00030037,
+0x0000000e,0x0000001b,0x000200f8,0x0000001d,
+0x0004003d,0x0000000d,0x00000118,0x0000001b,
+0x000500c7,0x0000000d,0x0000011a,0x00000118,
+0x00000119,0x000500c4,0x0000000d,0x0000011b,
+0x0000011a,0x00000024,0x0004003d,0x0000000d,
+0x0000011c,0x0000001b,0x000500c7,0x0000000d,
+0x0000011e,0x0000011c,0x0000011d,0x000500c4,
+0x0000000d,0x0000011f,0x0000011e,0x00000052,
+0x000500c5,0x0000000d,0x00000120,0x0000011b,
+0x0000011f,0x0004003d,0x0000000d,0x00000121,
+0x0000001b,0x000500c7,0x0000000d,0x00000123,
+0x00000121,0x00000122,0x000500c2,0x0000000d,
+0x00000124,0x00000123,0x00000052,0x000500c5,
+0x0000000d,0x00000125,0x00000120,0x00000124,
+0x0004003d,0x0000000d,0x00000126,0x0000001b,
+0x000500c7,0x0000000d,0x00000128,0x00000126,
+0x00000127,0x000500c2,0x0000000d,0x00000129,
+0x00000128,0x00000024,0x000500c5,0x0000000d,
+0x0000012a,0x00000125,0x00000129,0x000200fe,
+0x0000012a,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_1D.inl
new file mode 100644
index 00000000000..51c5f6de1a6
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_1D.inl
@@ -0,0 +1,1882 @@
+0x07230203,0x00010300,0x000d000a,0x000004ef,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x0000044f,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00070005,
+0x0000000c,0x50746567,0x4431736f,0x61727241,
+0x69762879,0x00003b33,0x00030005,0x0000000b,
+0x00736f70,0x00070005,0x00000014,0x764f7369,
+0x6c667265,0x6465776f,0x3b317528,0x003b3175,
+0x00040005,0x00000012,0x65736162,0x00000000,
+0x00040005,0x00000013,0x66666964,0x00000000,
+0x00060005,0x00000018,0x766e6f63,0x34747265,
+0x28386f54,0x003b3175,0x00030005,0x00000017,
+0x00000062,0x00060005,0x0000001b,0x766e6f63,
+0x35747265,0x28386f54,0x003b3175,0x00030005,
+0x0000001a,0x00000062,0x00060005,0x0000001e,
+0x766e6f63,0x36747265,0x28386f54,0x003b3175,
+0x00030005,0x0000001d,0x00000062,0x00060005,
+0x00000021,0x766e6f63,0x37747265,0x28386f54,
+0x003b3175,0x00030005,0x00000020,0x00000062,
+0x00070005,0x00000026,0x766e6f63,0x44747265,
+0x28666669,0x753b3175,0x00003b31,0x00040005,
+0x00000024,0x65736162,0x00000000,0x00040005,
+0x00000025,0x66666964,0x00000000,0x00050005,
+0x0000002b,0x616c635f,0x6928706d,0x00003b31,
+0x00030005,0x0000002a,0x00000078,0x00050005,
+0x0000002f,0x616c635f,0x7628706d,0x003b3369,
+0x00030005,0x0000002e,0x00000078,0x000a0005,
+0x0000003d,0x32637465,0x485f545f,0x646e695f,
+0x76287865,0x345b3369,0x31753b5d,0x3b31623b,
+0x003b3162,0x00050005,0x00000039,0x54726c63,
+0x656c6261,0x00000000,0x00030005,0x0000003a,
+0x00776f6c,0x00070005,0x0000003b,0x75507369,
+0x7468636e,0x756f7268,0x6c416867,0x00616870,
+0x00040005,0x0000003c,0x7161706f,0x00006575,
+0x000b0005,0x00000044,0x32637465,0x6365645f,
+0x5f65646f,0x636f6c62,0x28545f6b,0x753b3175,
+0x31623b31,0x3b31623b,0x00000000,0x00040005,
+0x00000040,0x68676968,0x00000000,0x00030005,
+0x00000041,0x00776f6c,0x00070005,0x00000042,
+0x75507369,0x7468636e,0x756f7268,0x6c416867,
+0x00616870,0x00040005,0x00000043,0x7161706f,
+0x00006575,0x000b0005,0x0000004a,0x32637465,
+0x6365645f,0x5f65646f,0x636f6c62,0x28485f6b,
+0x753b3175,0x31623b31,0x3b31623b,0x00000000,
+0x00040005,0x00000046,0x68676968,0x00000000,
+0x00030005,0x00000047,0x00776f6c,0x00070005,
+0x00000048,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00040005,0x00000049,
+0x7161706f,0x00006575,0x000a0005,0x00000050,
+0x32637465,0x6365645f,0x5f65646f,0x636f6c62,
+0x28505f6b,0x753b3175,0x31623b31,0x0000003b,
+0x00040005,0x0000004d,0x68676968,0x00000000,
+0x00030005,0x0000004e,0x00776f6c,0x00070005,
+0x0000004f,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00100005,0x0000005f,
+0x6f636564,0x735f6564,0x6c626275,0x286b636f,
+0x5b346976,0x3b5d3631,0x693b3169,0x31693b31,
+0x3469763b,0x3b31753b,0x623b3162,0x31623b31,
+0x3b31623b,0x00000000,0x00040005,0x00000055,
+0x74754f70,0x00000000,0x00030005,0x00000056,
+0x00000072,0x00030005,0x00000057,0x00000067,
+0x00030005,0x00000058,0x00000062,0x00040005,
+0x00000059,0x6c626174,0x00000065,0x00030005,
+0x0000005a,0x00776f6c,0x00040005,0x0000005b,
+0x6f636573,0x0000646e,0x00040005,0x0000005c,
+0x70696c66,0x00646570,0x00070005,0x0000005d,
+0x75507369,0x7468636e,0x756f7268,0x6c416867,
+0x00616870,0x00040005,0x0000005e,0x7161706f,
+0x00006575,0x000a0005,0x00000064,0x32637465,
+0x6365645f,0x5f65646f,0x5f626772,0x636f6c62,
+0x3175286b,0x3b31753b,0x003b3162,0x00040005,
+0x00000061,0x68676968,0x00000000,0x00030005,
+0x00000062,0x00776f6c,0x00070005,0x00000063,
+0x75507369,0x7468636e,0x756f7268,0x6c416867,
+0x00616870,0x00080005,0x00000068,0x736e6f63,
+0x63757274,0x6e695574,0x28323374,0x753b3175,
+0x00003b31,0x00030005,0x00000066,0x00363161,
+0x00030005,0x00000067,0x00363162,0x00030005,
+0x0000006e,0x006c6176,0x00050005,0x00000082,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x0000008e,0x00000063,0x00030005,0x00000099,
+0x00000063,0x00030005,0x000000a3,0x00000063,
+0x00030005,0x000000ae,0x00000063,0x00050005,
+0x000000bf,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x000000c4,0x61726170,0x0000006d,
+0x00030005,0x000000d7,0x00000079,0x00030005,
+0x000000e0,0x00000078,0x00030005,0x000000e8,
+0x0000006b,0x00030005,0x000000ed,0x0062736d,
+0x00030005,0x000000f4,0x0062736c,0x00030005,
+0x00000106,0x00746572,0x00040005,0x0000010e,
+0x7366666f,0x00007465,0x00030005,0x00000125,
+0x00003172,0x00040005,0x00000131,0x61726170,
+0x0000006d,0x00030005,0x00000134,0x00003167,
+0x00040005,0x00000138,0x61726170,0x0000006d,
+0x00030005,0x0000013b,0x00003162,0x00040005,
+0x0000013f,0x61726170,0x0000006d,0x00030005,
+0x00000142,0x00003272,0x00040005,0x00000146,
+0x61726170,0x0000006d,0x00030005,0x00000149,
+0x00003267,0x00040005,0x0000014d,0x61726170,
+0x0000006d,0x00030005,0x00000150,0x00003262,
+0x00040005,0x00000153,0x61726170,0x0000006d,
+0x00050005,0x00000156,0x65746e69,0x4965736e,
+0x00007864,0x00050005,0x0000015f,0x65746e69,
+0x4d65736e,0x0000646f,0x00050005,0x00000166,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000169,0x54726c63,0x656c6261,0x00000000,
+0x00040005,0x00000172,0x61726170,0x0000006d,
+0x00040005,0x00000177,0x61726170,0x0000006d,
+0x00040005,0x0000017c,0x61726170,0x0000006d,
+0x00040005,0x00000188,0x61726170,0x0000006d,
+0x00040005,0x0000018d,0x61726170,0x0000006d,
+0x00040005,0x00000192,0x61726170,0x0000006d,
+0x00040005,0x00000196,0x61726170,0x0000006d,
+0x00040005,0x00000198,0x61726170,0x0000006d,
+0x00040005,0x0000019a,0x61726170,0x0000006d,
+0x00040005,0x0000019c,0x61726170,0x0000006d,
+0x00040005,0x000001a1,0x31626772,0x00000000,
+0x00040005,0x000001a4,0x61726170,0x0000006d,
+0x00040005,0x000001af,0x61726170,0x0000006d,
+0x00040005,0x000001bc,0x61726170,0x0000006d,
+0x00040005,0x000001c0,0x32626772,0x00000000,
+0x00040005,0x000001c3,0x61726170,0x0000006d,
+0x00040005,0x000001ca,0x61726170,0x0000006d,
+0x00040005,0x000001d0,0x61726170,0x0000006d,
+0x00050005,0x000001d4,0x65746e69,0x4965736e,
+0x00007864,0x00050005,0x000001f4,0x65746e69,
+0x4d65736e,0x0000646f,0x00050005,0x000001f6,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x000001f9,0x54726c63,0x656c6261,0x00000000,
+0x00040005,0x00000202,0x61726170,0x0000006d,
+0x00040005,0x0000020d,0x61726170,0x0000006d,
+0x00040005,0x00000218,0x61726170,0x0000006d,
+0x00040005,0x00000223,0x61726170,0x0000006d,
+0x00040005,0x00000226,0x61726170,0x0000006d,
+0x00040005,0x00000228,0x61726170,0x0000006d,
+0x00040005,0x0000022a,0x61726170,0x0000006d,
+0x00040005,0x0000022c,0x61726170,0x0000006d,
+0x00040005,0x00000231,0x6f626772,0x00000000,
+0x00040005,0x00000235,0x61726170,0x0000006d,
+0x00040005,0x00000241,0x61726170,0x0000006d,
+0x00040005,0x00000252,0x61726170,0x0000006d,
+0x00040005,0x00000256,0x68626772,0x00000000,
+0x00040005,0x0000025d,0x61726170,0x0000006d,
+0x00040005,0x00000263,0x61726170,0x0000006d,
+0x00040005,0x00000269,0x61726170,0x0000006d,
+0x00040005,0x0000026d,0x76626772,0x00000000,
+0x00040005,0x00000271,0x61726170,0x0000006d,
+0x00040005,0x00000277,0x61726170,0x0000006d,
+0x00040005,0x0000027b,0x61726170,0x0000006d,
+0x00030005,0x00000280,0x00000069,0x00030005,
+0x00000288,0x00000079,0x00030005,0x0000028b,
+0x00000078,0x00030005,0x0000028e,0x00746572,
+0x00040005,0x000002a5,0x61726170,0x0000006d,
+0x00040005,0x000002b3,0x65736162,0x00000058,
+0x00040005,0x000002b4,0x65736162,0x00000059,
+0x00030005,0x000002bc,0x00000069,0x00030005,
+0x000002c7,0x00000078,0x00030005,0x000002cd,
+0x00000079,0x00030005,0x000002de,0x0000006b,
+0x00030005,0x000002e3,0x0062736d,0x00030005,
+0x000002e9,0x0062736c,0x00030005,0x000002ee,
+0x00000071,0x00040005,0x00000302,0x7366666f,
+0x00007465,0x00040005,0x00000306,0x746c6564,
+0x00000061,0x00040005,0x0000030e,0x61726170,
+0x0000006d,0x00040005,0x00000313,0x61726170,
+0x0000006d,0x00040005,0x00000318,0x61726170,
+0x0000006d,0x00040005,0x0000031e,0x7161706f,
+0x00006575,0x00040005,0x0000032d,0x73614272,
+0x00000065,0x00040005,0x00000330,0x73614267,
+0x00000065,0x00040005,0x00000333,0x73614262,
+0x00000065,0x00040005,0x00000338,0x61726170,
+0x0000006d,0x00040005,0x0000033a,0x61726170,
+0x0000006d,0x00040005,0x0000033e,0x61726170,
+0x0000006d,0x00040005,0x00000340,0x61726170,
+0x0000006d,0x00040005,0x00000342,0x61726170,
+0x0000006d,0x00040005,0x00000344,0x61726170,
+0x0000006d,0x00040005,0x0000034a,0x61726170,
+0x0000006d,0x00040005,0x0000034c,0x61726170,
+0x0000006d,0x00040005,0x00000350,0x61726170,
+0x0000006d,0x00040005,0x00000352,0x61726170,
+0x0000006d,0x00040005,0x00000354,0x61726170,
+0x0000006d,0x00040005,0x00000356,0x61726170,
+0x0000006d,0x00040005,0x0000035c,0x61726170,
+0x0000006d,0x00040005,0x0000035e,0x61726170,
+0x0000006d,0x00040005,0x00000362,0x61726170,
+0x0000006d,0x00040005,0x00000364,0x61726170,
+0x0000006d,0x00040005,0x00000366,0x61726170,
+0x0000006d,0x00030005,0x0000036a,0x00003172,
+0x00040005,0x0000036b,0x61726170,0x0000006d,
+0x00030005,0x0000036f,0x00003272,0x00040005,
+0x00000372,0x61726170,0x0000006d,0x00040005,
+0x00000374,0x61726170,0x0000006d,0x00030005,
+0x00000377,0x00003167,0x00040005,0x00000378,
+0x61726170,0x0000006d,0x00030005,0x0000037c,
+0x00003267,0x00040005,0x0000037f,0x61726170,
+0x0000006d,0x00040005,0x00000381,0x61726170,
+0x0000006d,0x00030005,0x00000384,0x00003162,
+0x00040005,0x00000385,0x61726170,0x0000006d,
+0x00030005,0x00000389,0x00003262,0x00040005,
+0x0000038c,0x61726170,0x0000006d,0x00040005,
+0x0000038e,0x61726170,0x0000006d,0x00040005,
+0x00000395,0x61726170,0x0000006d,0x00040005,
+0x0000039a,0x61726170,0x0000006d,0x00040005,
+0x0000039f,0x61726170,0x0000006d,0x00040005,
+0x000003a4,0x61726170,0x0000006d,0x00040005,
+0x000003a9,0x61726170,0x0000006d,0x00040005,
+0x000003ae,0x61726170,0x0000006d,0x00050005,
+0x000003b1,0x6c626174,0x646e4965,0x00417865,
+0x00050005,0x000003b5,0x6c626174,0x646e4965,
+0x00427865,0x00040005,0x000003bf,0x6c626174,
+0x00004165,0x00050005,0x000003e5,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x000003e8,
+0x6c626174,0x00004265,0x00050005,0x000003ea,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x000003f8,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x000003fc,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x000003ff,0x70696c66,
+0x00646570,0x00030005,0x00000403,0x00746572,
+0x00040005,0x00000405,0x61726170,0x0000006d,
+0x00040005,0x00000407,0x61726170,0x0000006d,
+0x00040005,0x00000409,0x61726170,0x0000006d,
+0x00040005,0x0000040b,0x61726170,0x0000006d,
+0x00040005,0x0000040d,0x61726170,0x0000006d,
+0x00040005,0x0000040f,0x61726170,0x0000006d,
+0x00040005,0x00000411,0x61726170,0x0000006d,
+0x00040005,0x00000412,0x61726170,0x0000006d,
+0x00040005,0x00000414,0x61726170,0x0000006d,
+0x00040005,0x00000416,0x61726170,0x0000006d,
+0x00040005,0x0000041b,0x61726170,0x0000006d,
+0x00040005,0x0000041d,0x61726170,0x0000006d,
+0x00040005,0x0000041f,0x61726170,0x0000006d,
+0x00040005,0x00000421,0x61726170,0x0000006d,
+0x00040005,0x00000423,0x61726170,0x0000006d,
+0x00040005,0x00000425,0x61726170,0x0000006d,
+0x00040005,0x00000427,0x61726170,0x0000006d,
+0x00040005,0x00000428,0x61726170,0x0000006d,
+0x00040005,0x0000042a,0x61726170,0x0000006d,
+0x00040005,0x0000042c,0x61726170,0x0000006d,
+0x00030005,0x00000433,0x00003261,0x00030005,
+0x0000043d,0x00003262,0x00030005,0x0000044c,
+0x00736f70,0x00080005,0x0000044f,0x475f6c67,
+0x61626f6c,0x766e496c,0x7461636f,0x496e6f69,
+0x00000044,0x00070005,0x00000452,0x67616d49,
+0x726f4665,0x4274616d,0x6b636f6c,0x00000000,
+0x00060006,0x00000452,0x00000000,0x706d6f63,
+0x6d726f46,0x00007461,0x00060006,0x00000452,
+0x00000001,0x65736162,0x6579614c,0x00000072,
+0x00060005,0x00000454,0x75705f75,0x6f436873,
+0x6174736e,0x0000746e,0x00050005,0x0000045d,
+0x42637273,0x6b636f6c,0x00000000,0x00050005,
+0x00000460,0x6d695f75,0x30656761,0x00000000,
+0x00040005,0x00000462,0x61726170,0x0000006d,
+0x00070005,0x00000468,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00060005,
+0x00000475,0x6f636564,0x6572706d,0x64657373,
+0x00000000,0x00040005,0x0000047c,0x61726170,
+0x0000006d,0x00040005,0x0000047d,0x61726170,
+0x0000006d,0x00040005,0x00000485,0x61726170,
+0x0000006d,0x00040005,0x00000486,0x61726170,
+0x0000006d,0x00040005,0x00000488,0x61726170,
+0x0000006d,0x00040005,0x00000489,0x61726170,
+0x0000006d,0x00040005,0x0000048a,0x61726170,
+0x0000006d,0x00030005,0x0000048d,0x00000079,
+0x00030005,0x00000495,0x00000078,0x00050005,
+0x0000049f,0x6d695f75,0x31656761,0x00000000,
+0x00040005,0x000004ae,0x61726170,0x0000006d,
+0x00040047,0x0000044f,0x0000000b,0x0000001c,
+0x00050048,0x00000452,0x00000000,0x00000023,
+0x00000000,0x00050048,0x00000452,0x00000001,
+0x00000023,0x00000004,0x00030047,0x00000452,
+0x00000002,0x00040047,0x00000460,0x00000022,
+0x00000000,0x00040047,0x00000460,0x00000021,
+0x00000000,0x00030047,0x00000460,0x00000018,
+0x00040047,0x0000049f,0x00000022,0x00000000,
+0x00040047,0x0000049f,0x00000021,0x00000001,
+0x00030047,0x0000049f,0x00000019,0x00040047,
+0x000004ee,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000001,
+0x00040017,0x00000007,0x00000006,0x00000003,
+0x00040020,0x00000008,0x00000007,0x00000007,
+0x00040017,0x00000009,0x00000006,0x00000002,
+0x00040021,0x0000000a,0x00000009,0x00000008,
+0x00040015,0x0000000e,0x00000020,0x00000000,
+0x00040020,0x0000000f,0x00000007,0x0000000e,
+0x00020014,0x00000010,0x00050021,0x00000011,
+0x00000010,0x0000000f,0x0000000f,0x00040021,
+0x00000016,0x0000000e,0x0000000f,0x00050021,
+0x00000023,0x0000000e,0x0000000f,0x0000000f,
+0x00040020,0x00000028,0x00000007,0x00000006,
+0x00040021,0x00000029,0x00000006,0x00000028,
+0x00040021,0x0000002d,0x00000007,0x00000008,
+0x0004002b,0x0000000e,0x00000031,0x00000004,
+0x0004001c,0x00000032,0x00000007,0x00000031,
+0x00040020,0x00000033,0x00000007,0x00000032,
+0x00040020,0x00000034,0x00000007,0x00000010,
+0x00040017,0x00000035,0x00000006,0x00000004,
+0x0004002b,0x0000000e,0x00000036,0x00000010,
+0x0004001c,0x00000037,0x00000035,0x00000036,
+0x00070021,0x00000038,0x00000037,0x00000033,
+0x0000000f,0x00000034,0x00000034,0x00070021,
+0x0000003f,0x00000037,0x0000000f,0x0000000f,
+0x00000034,0x00000034,0x00060021,0x0000004c,
+0x00000037,0x0000000f,0x0000000f,0x00000034,
+0x00040020,0x00000052,0x00000007,0x00000037,
+0x00040020,0x00000053,0x00000007,0x00000035,
+0x000d0021,0x00000054,0x00000002,0x00000052,
+0x00000028,0x00000028,0x00000028,0x00000053,
+0x0000000f,0x00000034,0x00000034,0x00000034,
+0x00000034,0x0004002b,0x0000000e,0x0000006f,
+0x0000001f,0x0004002b,0x0000000e,0x00000073,
+0x00000008,0x0004001c,0x00000074,0x00000006,
+0x00000073,0x0004002b,0x00000006,0x00000075,
+0x00000000,0x0004002b,0x00000006,0x00000076,
+0x00000001,0x0004002b,0x00000006,0x00000077,
+0x00000002,0x0004002b,0x00000006,0x00000078,
+0x00000003,0x0004002b,0x00000006,0x00000079,
+0xfffffffc,0x0004002b,0x00000006,0x0000007a,
+0xfffffffd,0x0004002b,0x00000006,0x0000007b,
+0xfffffffe,0x0004002b,0x00000006,0x0000007c,
+0xffffffff,0x000b002c,0x00000074,0x0000007d,
+0x00000075,0x00000076,0x00000077,0x00000078,
+0x00000079,0x0000007a,0x0000007b,0x0000007c,
+0x0004002b,0x0000000e,0x0000007e,0x00000007,
+0x00040020,0x00000081,0x00000007,0x00000074,
+0x0004002b,0x00000006,0x00000089,0x00000020,
+0x0004002b,0x0000000e,0x00000090,0x0000000f,
+0x0004002b,0x00000006,0x00000093,0x00000004,
+0x0004002b,0x0000000e,0x000000a5,0x0000003f,
+0x0004002b,0x0000000e,0x000000b0,0x0000007f,
+0x0004002b,0x00000006,0x000000b5,0x00000006,
+0x0004002b,0x00000006,0x000000c9,0x000000ff,
+0x0004002b,0x0000000e,0x000000d8,0x00000000,
+0x0004002b,0x0000000e,0x000000f2,0x00000002,
+0x0004002b,0x0000000e,0x000000f8,0x00000001,
+0x0007002c,0x00000035,0x0000010b,0x00000075,
+0x00000075,0x00000075,0x00000075,0x0004002b,
+0x00000006,0x00000127,0x0000001b,0x0004002b,
+0x0000000e,0x00000129,0x00000003,0x0004002b,
+0x00000006,0x0000012d,0x00000018,0x0004002b,
+0x00000006,0x00000136,0x00000014,0x0004002b,
+0x00000006,0x0000013d,0x00000010,0x0004002b,
+0x00000006,0x00000144,0x0000000c,0x0004002b,
+0x00000006,0x0000014b,0x00000008,0x0004002b,
+0x00000006,0x00000160,0x0000000b,0x0004002b,
+0x00000006,0x00000161,0x00000017,0x0004002b,
+0x00000006,0x00000162,0x00000029,0x0004002b,
+0x00000006,0x00000163,0x00000040,0x000b002c,
+0x00000074,0x00000164,0x00000078,0x000000b5,
+0x00000160,0x0000013d,0x00000161,0x00000089,
+0x00000162,0x00000163,0x0004002b,0x00000006,
+0x000001b4,0x00000013,0x0004002b,0x00000006,
+0x000001b8,0x0000000f,0x0004002b,0x00000006,
+0x000001c8,0x00000007,0x0004002b,0x00000006,
+0x00000233,0x00000019,0x0004002b,0x00000006,
+0x0000023d,0x00000011,0x0004002b,0x00000006,
+0x00000247,0x00000005,0x0004002b,0x00000006,
+0x0000026f,0x0000000d,0x0004002b,0x00000006,
+0x00000393,0x0000001c,0x0004001c,0x000003c0,
+0x00000035,0x00000073,0x0004002b,0x00000006,
+0x000003c1,0xfffffff8,0x0007002c,0x00000035,
+0x000003c2,0x00000077,0x0000014b,0x0000007b,
+0x000003c1,0x0004002b,0x00000006,0x000003c3,
+0xfffffffb,0x0004002b,0x00000006,0x000003c4,
+0xffffffef,0x0007002c,0x00000035,0x000003c5,
+0x00000247,0x0000023d,0x000003c3,0x000003c4,
+0x0004002b,0x00000006,0x000003c6,0x00000009,
+0x0004002b,0x00000006,0x000003c7,0x0000001d,
+0x0004002b,0x00000006,0x000003c8,0xfffffff7,
+0x0004002b,0x00000006,0x000003c9,0xffffffe3,
+0x0007002c,0x00000035,0x000003ca,0x000003c6,
+0x000003c7,0x000003c8,0x000003c9,0x0004002b,
+0x00000006,0x000003cb,0x0000002a,0x0004002b,
+0x00000006,0x000003cc,0xfffffff3,0x0004002b,
+0x00000006,0x000003cd,0xffffffd6,0x0007002c,
+0x00000035,0x000003ce,0x0000026f,0x000003cb,
+0x000003cc,0x000003cd,0x0004002b,0x00000006,
+0x000003cf,0x00000012,0x0004002b,0x00000006,
+0x000003d0,0x0000003c,0x0004002b,0x00000006,
+0x000003d1,0xffffffee,0x0004002b,0x00000006,
+0x000003d2,0xffffffc4,0x0007002c,0x00000035,
+0x000003d3,0x000003cf,0x000003d0,0x000003d1,
+0x000003d2,0x0004002b,0x00000006,0x000003d4,
+0x00000050,0x0004002b,0x00000006,0x000003d5,
+0xffffffe8,0x0004002b,0x00000006,0x000003d6,
+0xffffffb0,0x0007002c,0x00000035,0x000003d7,
+0x0000012d,0x000003d4,0x000003d5,0x000003d6,
+0x0004002b,0x00000006,0x000003d8,0x00000021,
+0x0004002b,0x00000006,0x000003d9,0x0000006a,
+0x0004002b,0x00000006,0x000003da,0xffffffdf,
+0x0004002b,0x00000006,0x000003db,0xffffff96,
+0x0007002c,0x00000035,0x000003dc,0x000003d8,
+0x000003d9,0x000003da,0x000003db,0x0004002b,
+0x00000006,0x000003dd,0x0000002f,0x0004002b,
+0x00000006,0x000003de,0x000000b7,0x0004002b,
+0x00000006,0x000003df,0xffffffd1,0x0004002b,
+0x00000006,0x000003e0,0xffffff49,0x0007002c,
+0x00000035,0x000003e1,0x000003dd,0x000003de,
+0x000003df,0x000003e0,0x000b002c,0x000003c0,
+0x000003e2,0x000003c2,0x000003c5,0x000003ca,
+0x000003ce,0x000003d3,0x000003d7,0x000003dc,
+0x000003e1,0x00040020,0x000003e4,0x00000007,
+0x000003c0,0x0007002c,0x00000035,0x000003ee,
+0x00000075,0x0000014b,0x00000075,0x000003c1,
+0x0007002c,0x00000035,0x000003ef,0x00000075,
+0x0000023d,0x00000075,0x000003c4,0x0007002c,
+0x00000035,0x000003f0,0x00000075,0x000003c7,
+0x00000075,0x000003c9,0x0007002c,0x00000035,
+0x000003f1,0x00000075,0x000003cb,0x00000075,
+0x000003cd,0x0007002c,0x00000035,0x000003f2,
+0x00000075,0x000003d0,0x00000075,0x000003d2,
+0x0007002c,0x00000035,0x000003f3,0x00000075,
+0x000003d4,0x00000075,0x000003d6,0x0007002c,
+0x00000035,0x000003f4,0x00000075,0x000003d9,
+0x00000075,0x000003db,0x0007002c,0x00000035,
+0x000003f5,0x00000075,0x000003de,0x00000075,
+0x000003e0,0x000b002c,0x000003c0,0x000003f6,
+0x000003ee,0x000003ef,0x000003f0,0x000003f1,
+0x000003f2,0x000003f3,0x000003f4,0x000003f5,
+0x0003002a,0x00000010,0x00000404,0x00030029,
+0x00000010,0x0000041a,0x0004002b,0x0000000e,
+0x00000435,0x000000ff,0x00040017,0x0000044d,
+0x0000000e,0x00000003,0x00040020,0x0000044e,
+0x00000001,0x0000044d,0x0004003b,0x0000044e,
+0x0000044f,0x00000001,0x0004001e,0x00000452,
+0x0000000e,0x0000000e,0x00040020,0x00000453,
+0x00000009,0x00000452,0x0004003b,0x00000453,
+0x00000454,0x00000009,0x00040020,0x00000455,
+0x00000009,0x0000000e,0x00090019,0x0000045e,
+0x0000000e,0x00000000,0x00000000,0x00000001,
+0x00000000,0x00000002,0x0000001f,0x00040020,
+0x0000045f,0x00000000,0x0000045e,0x0004003b,
+0x0000045f,0x00000460,0x00000000,0x00040017,
+0x00000465,0x0000000e,0x00000004,0x0004002b,
+0x0000000e,0x0000046b,0x00000095,0x0004002b,
+0x0000000e,0x00000472,0x00000096,0x00090019,
+0x0000049d,0x0000000e,0x00000000,0x00000000,
+0x00000001,0x00000000,0x00000002,0x00000020,
+0x00040020,0x0000049e,0x00000000,0x0000049d,
+0x0004003b,0x0000049e,0x0000049f,0x00000000,
+0x0004002b,0x0000000e,0x000004bb,0x00000093,
+0x0004002b,0x0000000e,0x000004bc,0x00000094,
+0x0004002b,0x0000000e,0x000004bd,0x00000097,
+0x0004002b,0x0000000e,0x000004be,0x00000098,
+0x0004002b,0x0000000e,0x000004bf,0x00000099,
+0x0004002b,0x0000000e,0x000004c0,0x0000009a,
+0x0004002b,0x0000000e,0x000004c1,0x0000009b,
+0x0004002b,0x0000000e,0x000004c2,0x0000009c,
+0x0004002b,0x0000000e,0x000004c3,0x00000020,
+0x0004001c,0x000004c4,0x00000035,0x000004c3,
+0x0004002b,0x00000006,0x000004c5,0xfffffffa,
+0x0004002b,0x00000006,0x000004c6,0xfffffff1,
+0x0007002c,0x00000035,0x000004c7,0x0000007a,
+0x000004c5,0x000003c8,0x000004c6,0x0004002b,
+0x00000006,0x000004c8,0x0000000e,0x0007002c,
+0x00000035,0x000004c9,0x00000077,0x00000247,
+0x0000014b,0x000004c8,0x0004002b,0x00000006,
+0x000004ca,0xfffffff9,0x0004002b,0x00000006,
+0x000004cb,0xfffffff6,0x0007002c,0x00000035,
+0x000004cc,0x0000007a,0x000004ca,0x000004cb,
+0x000003cc,0x0007002c,0x00000035,0x000004cd,
+0x00000077,0x000000b5,0x000003c6,0x00000144,
+0x0007002c,0x00000035,0x000004ce,0x0000007b,
+0x000003c3,0x000003c1,0x000003cc,0x0007002c,
+0x00000035,0x000004cf,0x00000076,0x00000093,
+0x000001c8,0x00000144,0x0007002c,0x00000035,
+0x000004d0,0x0000007b,0x00000079,0x000004c5,
+0x000003cc,0x0007002c,0x00000035,0x000004d1,
+0x00000076,0x00000078,0x00000247,0x00000144,
+0x0004002b,0x00000006,0x000004d2,0xfffffff4,
+0x0007002c,0x00000035,0x000004d3,0x0000007a,
+0x000004c5,0x000003c1,0x000004d2,0x0007002c,
+0x00000035,0x000004d4,0x00000077,0x00000247,
+0x000001c8,0x00000160,0x0004002b,0x00000006,
+0x000004d5,0xfffffff5,0x0007002c,0x00000035,
+0x000004d6,0x0000007a,0x000004ca,0x000003c8,
+0x000004d5,0x0004002b,0x00000006,0x000004d7,
+0x0000000a,0x0007002c,0x00000035,0x000004d8,
+0x00000077,0x000000b5,0x0000014b,0x000004d7,
+0x0007002c,0x00000035,0x000004d9,0x00000079,
+0x000004ca,0x000003c1,0x000004d5,0x0007002c,
+0x00000035,0x000004da,0x00000078,0x000000b5,
+0x000001c8,0x000004d7,0x0007002c,0x00000035,
+0x000004db,0x0000007a,0x000003c3,0x000003c1,
+0x000004d5,0x0007002c,0x00000035,0x000004dc,
+0x00000077,0x00000093,0x000001c8,0x000004d7,
+0x0007002c,0x00000035,0x000004dd,0x0000007b,
+0x000004c5,0x000003c1,0x000004cb,0x0007002c,
+0x00000035,0x000004de,0x00000076,0x00000247,
+0x000001c8,0x000003c6,0x0007002c,0x00000035,
+0x000004df,0x0000007b,0x000003c3,0x000003c1,
+0x000004cb,0x0007002c,0x00000035,0x000004e0,
+0x00000076,0x00000093,0x000001c8,0x000003c6,
+0x0007002c,0x00000035,0x000004e1,0x0000007b,
+0x00000079,0x000003c1,0x000004cb,0x0007002c,
+0x00000035,0x000004e2,0x00000076,0x00000078,
+0x000001c8,0x000003c6,0x0007002c,0x00000035,
+0x000004e3,0x0000007b,0x000003c3,0x000004ca,
+0x000004cb,0x0007002c,0x00000035,0x000004e4,
+0x00000076,0x00000093,0x000000b5,0x000003c6,
+0x0007002c,0x00000035,0x000004e5,0x0000007a,
+0x00000079,0x000004ca,0x000004cb,0x0007002c,
+0x00000035,0x000004e6,0x00000077,0x00000078,
+0x000000b5,0x000003c6,0x0007002c,0x00000035,
+0x000004e7,0x0000007c,0x0000007b,0x0000007a,
+0x000004cb,0x0007002c,0x00000035,0x000004e8,
+0x00000075,0x00000076,0x00000077,0x000003c6,
+0x0007002c,0x00000035,0x000004e9,0x00000079,
+0x000004c5,0x000003c1,0x000003c8,0x0007002c,
+0x00000035,0x000004ea,0x00000078,0x00000247,
+0x000001c8,0x0000014b,0x0007002c,0x00000035,
+0x000004eb,0x0000007a,0x000003c3,0x000004ca,
+0x000003c8,0x0007002c,0x00000035,0x000004ec,
+0x00000077,0x00000093,0x000000b5,0x0000014b,
+0x0023002c,0x000004c4,0x000004ed,0x000004c7,
+0x000004c9,0x000004cc,0x000004cd,0x000004ce,
+0x000004cf,0x000004d0,0x000004d1,0x000004d3,
+0x000004d4,0x000004d6,0x000004d8,0x000004d9,
+0x000004da,0x000004db,0x000004dc,0x000004dd,
+0x000004de,0x000004df,0x000004e0,0x000004e1,
+0x000004e2,0x000004e3,0x000004e4,0x000004e5,
+0x000004e6,0x000004e7,0x000004e8,0x000004e9,
+0x000004ea,0x000004eb,0x000004ec,0x0006002c,
+0x0000044d,0x000004ee,0x00000073,0x00000073,
+0x000000f8,0x00050036,0x00000002,0x00000004,
+0x00000000,0x00000003,0x000200f8,0x00000005,
+0x0004003b,0x00000008,0x0000044c,0x00000007,
+0x0004003b,0x00000053,0x0000045d,0x00000007,
+0x0004003b,0x00000008,0x00000462,0x00000007,
+0x0004003b,0x00000034,0x00000468,0x00000007,
+0x0004003b,0x00000052,0x00000475,0x00000007,
+0x0004003b,0x0000000f,0x0000047c,0x00000007,
+0x0004003b,0x0000000f,0x0000047d,0x00000007,
+0x0004003b,0x0000000f,0x00000485,0x00000007,
+0x0004003b,0x0000000f,0x00000486,0x00000007,
+0x0004003b,0x0000000f,0x00000488,0x00000007,
+0x0004003b,0x0000000f,0x00000489,0x00000007,
+0x0004003b,0x00000034,0x0000048a,0x00000007,
+0x0004003b,0x00000028,0x0000048d,0x00000007,
+0x0004003b,0x00000028,0x00000495,0x00000007,
+0x0004003b,0x00000008,0x000004ae,0x00000007,
+0x0004003d,0x0000044d,0x00000450,0x0000044f,
+0x0004007c,0x00000007,0x00000451,0x00000450,
+0x0003003e,0x0000044c,0x00000451,0x00050041,
+0x00000455,0x00000456,0x00000454,0x00000076,
+0x0004003d,0x0000000e,0x00000457,0x00000456,
+0x0004007c,0x00000006,0x00000458,0x00000457,
+0x00050041,0x00000028,0x00000459,0x0000044c,
+0x000000f2,0x0004003d,0x00000006,0x0000045a,
+0x00000459,0x00050080,0x00000006,0x0000045b,
+0x0000045a,0x00000458,0x00050041,0x00000028,
+0x0000045c,0x0000044c,0x000000f2,0x0003003e,
+0x0000045c,0x0000045b,0x0004003d,0x0000045e,
+0x00000461,0x00000460,0x0004003d,0x00000007,
+0x00000463,0x0000044c,0x0003003e,0x00000462,
+0x00000463,0x00050039,0x00000009,0x00000464,
+0x0000000c,0x00000462,0x00050062,0x00000465,
+0x00000466,0x00000461,0x00000464,0x0004007c,
+0x00000035,0x00000467,0x00000466,0x0003003e,
+0x0000045d,0x00000467,0x00050041,0x00000455,
+0x00000469,0x00000454,0x00000075,0x0004003d,
+0x0000000e,0x0000046a,0x00000469,0x000500aa,
+0x00000010,0x0000046c,0x0000046a,0x0000046b,
+0x000400a8,0x00000010,0x0000046d,0x0000046c,
+0x000300f7,0x0000046f,0x00000000,0x000400fa,
+0x0000046d,0x0000046e,0x0000046f,0x000200f8,
+0x0000046e,0x00050041,0x00000455,0x00000470,
+0x00000454,0x00000075,0x0004003d,0x0000000e,
+0x00000471,0x00000470,0x000500aa,0x00000010,
+0x00000473,0x00000471,0x00000472,0x000200f9,
+0x0000046f,0x000200f8,0x0000046f,0x000700f5,
+0x00000010,0x00000474,0x0000046c,0x00000005,
+0x00000473,0x0000046e,0x0003003e,0x00000468,
+0x00000474,0x00050041,0x00000028,0x00000476,
+0x0000045d,0x000000d8,0x0004003d,0x00000006,
+0x00000477,0x00000476,0x0004007c,0x0000000e,
+0x00000478,0x00000477,0x00050041,0x00000028,
+0x00000479,0x0000045d,0x000000f8,0x0004003d,
+0x00000006,0x0000047a,0x00000479,0x0004007c,
+0x0000000e,0x0000047b,0x0000047a,0x0003003e,
+0x0000047c,0x00000478,0x0003003e,0x0000047d,
+0x0000047b,0x00060039,0x0000000e,0x0000047e,
+0x00000068,0x0000047c,0x0000047d,0x00050041,
+0x00000028,0x0000047f,0x0000045d,0x000000f2,
+0x0004003d,0x00000006,0x00000480,0x0000047f,
+0x0004007c,0x0000000e,0x00000481,0x00000480,
+0x00050041,0x00000028,0x00000482,0x0000045d,
+0x00000129,0x0004003d,0x00000006,0x00000483,
+0x00000482,0x0004007c,0x0000000e,0x00000484,
+0x00000483,0x0003003e,0x00000485,0x00000481,
+0x0003003e,0x00000486,0x00000484,0x00060039,
+0x0000000e,0x00000487,0x00000068,0x00000485,
+0x00000486,0x0003003e,0x00000488,0x0000047e,
+0x0003003e,0x00000489,0x00000487,0x0004003d,
+0x00000010,0x0000048b,0x00000468,0x0003003e,
+0x0000048a,0x0000048b,0x00070039,0x00000037,
+0x0000048c,0x00000064,0x00000488,0x00000489,
+0x0000048a,0x0003003e,0x00000475,0x0000048c,
+0x0003003e,0x0000048d,0x00000075,0x000200f9,
+0x0000048e,0x000200f8,0x0000048e,0x000400f6,
+0x00000490,0x00000491,0x00000000,0x000200f9,
+0x00000492,0x000200f8,0x00000492,0x0004003d,
+0x00000006,0x00000493,0x0000048d,0x000500b1,
+0x00000010,0x00000494,0x00000493,0x00000076,
+0x000400fa,0x00000494,0x0000048f,0x00000490,
+0x000200f8,0x0000048f,0x0003003e,0x00000495,
+0x00000075,0x000200f9,0x00000496,0x000200f8,
+0x00000496,0x000400f6,0x00000498,0x00000499,
+0x00000000,0x000200f9,0x0000049a,0x000200f8,
+0x0000049a,0x0004003d,0x00000006,0x0000049b,
+0x00000495,0x000500b1,0x00000010,0x0000049c,
+0x0000049b,0x00000093,0x000400fa,0x0000049c,
+0x00000497,0x00000498,0x000200f8,0x00000497,
+0x0004003d,0x0000049d,0x000004a0,0x0000049f,
+0x0004003d,0x00000007,0x000004a1,0x0000044c,
+0x0007004f,0x00000009,0x000004a2,0x000004a1,
+0x000004a1,0x00000000,0x00000001,0x00050050,
+0x00000009,0x000004a3,0x00000093,0x00000093,
+0x00050084,0x00000009,0x000004a4,0x000004a2,
+0x000004a3,0x0004003d,0x00000006,0x000004a5,
+0x00000495,0x0004003d,0x00000006,0x000004a6,
+0x0000048d,0x00050050,0x00000009,0x000004a7,
+0x000004a5,0x000004a6,0x00050080,0x00000009,
+0x000004a8,0x000004a4,0x000004a7,0x00050041,
+0x00000028,0x000004a9,0x0000044c,0x000000f2,
+0x0004003d,0x00000006,0x000004aa,0x000004a9,
+0x00050051,0x00000006,0x000004ab,0x000004a8,
+0x00000000,0x00050051,0x00000006,0x000004ac,
+0x000004a8,0x00000001,0x00060050,0x00000007,
+0x000004ad,0x000004ab,0x000004ac,0x000004aa,
+0x0003003e,0x000004ae,0x000004ad,0x00050039,
+0x00000009,0x000004af,0x0000000c,0x000004ae,
+0x0004003d,0x00000006,0x000004b0,0x0000048d,
+0x00050084,0x00000006,0x000004b1,0x000004b0,
+0x00000093,0x0004003d,0x00000006,0x000004b2,
+0x00000495,0x00050080,0x00000006,0x000004b3,
+0x000004b1,0x000004b2,0x00050041,0x00000053,
+0x000004b4,0x00000475,0x000004b3,0x0004003d,
+0x00000035,0x000004b5,0x000004b4,0x0004007c,
+0x00000465,0x000004b6,0x000004b5,0x00040063,
+0x000004a0,0x000004af,0x000004b6,0x000200f9,
+0x00000499,0x000200f8,0x00000499,0x0004003d,
+0x00000006,0x000004b7,0x00000495,0x00050080,
+0x00000006,0x000004b8,0x000004b7,0x00000076,
+0x0003003e,0x00000495,0x000004b8,0x000200f9,
+0x00000496,0x000200f8,0x00000498,0x000200f9,
+0x00000491,0x000200f8,0x00000491,0x0004003d,
+0x00000006,0x000004b9,0x0000048d,0x00050080,
+0x00000006,0x000004ba,0x000004b9,0x00000076,
+0x0003003e,0x0000048d,0x000004ba,0x000200f9,
+0x0000048e,0x000200f8,0x00000490,0x000100fd,
+0x00010038,0x00050036,0x00000009,0x0000000c,
+0x00000000,0x0000000a,0x00030037,0x00000008,
+0x0000000b,0x000200f8,0x0000000d,0x0004003d,
+0x00000007,0x0000006a,0x0000000b,0x0007004f,
+0x00000009,0x0000006b,0x0000006a,0x0000006a,
+0x00000000,0x00000002,0x000200fe,0x0000006b,
+0x00010038,0x00050036,0x00000010,0x00000014,
+0x00000000,0x00000011,0x00030037,0x0000000f,
+0x00000012,0x00030037,0x0000000f,0x00000013,
+0x000200f8,0x00000015,0x0004003b,0x00000028,
+0x0000006e,0x00000007,0x0004003b,0x00000081,
+0x00000082,0x00000007,0x0004003d,0x0000000e,
+0x00000070,0x00000012,0x000500c7,0x0000000e,
+0x00000071,0x0000006f,0x00000070,0x0004007c,
+0x00000006,0x00000072,0x00000071,0x0004003d,
+0x0000000e,0x0000007f,0x00000013,0x000500c7,
+0x0000000e,0x00000080,0x0000007e,0x0000007f,
+0x0003003e,0x00000082,0x0000007d,0x00050041,
+0x00000028,0x00000083,0x00000082,0x00000080,
+0x0004003d,0x00000006,0x00000084,0x00000083,
+0x00050080,0x00000006,0x00000085,0x00000072,
+0x00000084,0x0003003e,0x0000006e,0x00000085,
+0x0004003d,0x00000006,0x00000086,0x0000006e,
+0x000500b1,0x00000010,0x00000087,0x00000086,
+0x00000075,0x0004003d,0x00000006,0x00000088,
+0x0000006e,0x000500af,0x00000010,0x0000008a,
+0x00000088,0x00000089,0x000500a6,0x00000010,
+0x0000008b,0x00000087,0x0000008a,0x000200fe,
+0x0000008b,0x00010038,0x00050036,0x0000000e,
+0x00000018,0x00000000,0x00000016,0x00030037,
+0x0000000f,0x00000017,0x000200f8,0x00000019,
+0x0004003b,0x0000000f,0x0000008e,0x00000007,
+0x0004003d,0x0000000e,0x0000008f,0x00000017,
+0x000500c7,0x0000000e,0x00000091,0x0000008f,
+0x00000090,0x0003003e,0x0000008e,0x00000091,
+0x0004003d,0x0000000e,0x00000092,0x0000008e,
+0x000500c4,0x0000000e,0x00000094,0x00000092,
+0x00000093,0x0004003d,0x0000000e,0x00000095,
+0x0000008e,0x000500c5,0x0000000e,0x00000096,
+0x00000094,0x00000095,0x000200fe,0x00000096,
+0x00010038,0x00050036,0x0000000e,0x0000001b,
+0x00000000,0x00000016,0x00030037,0x0000000f,
+0x0000001a,0x000200f8,0x0000001c,0x0004003b,
+0x0000000f,0x00000099,0x00000007,0x0004003d,
+0x0000000e,0x0000009a,0x0000001a,0x000500c7,
+0x0000000e,0x0000009b,0x0000009a,0x0000006f,
+0x0003003e,0x00000099,0x0000009b,0x0004003d,
+0x0000000e,0x0000009c,0x00000099,0x000500c4,
+0x0000000e,0x0000009d,0x0000009c,0x00000078,
+0x0004003d,0x0000000e,0x0000009e,0x00000099,
+0x000500c2,0x0000000e,0x0000009f,0x0000009e,
+0x00000077,0x000500c5,0x0000000e,0x000000a0,
+0x0000009d,0x0000009f,0x000200fe,0x000000a0,
+0x00010038,0x00050036,0x0000000e,0x0000001e,
+0x00000000,0x00000016,0x00030037,0x0000000f,
+0x0000001d,0x000200f8,0x0000001f,0x0004003b,
+0x0000000f,0x000000a3,0x00000007,0x0004003d,
+0x0000000e,0x000000a4,0x0000001d,0x000500c7,
+0x0000000e,0x000000a6,0x000000a4,0x000000a5,
+0x0003003e,0x000000a3,0x000000a6,0x0004003d,
+0x0000000e,0x000000a7,0x000000a3,0x000500c4,
+0x0000000e,0x000000a8,0x000000a7,0x00000077,
+0x0004003d,0x0000000e,0x000000a9,0x000000a3,
+0x000500c2,0x0000000e,0x000000aa,0x000000a9,
+0x00000093,0x000500c5,0x0000000e,0x000000ab,
+0x000000a8,0x000000aa,0x000200fe,0x000000ab,
+0x00010038,0x00050036,0x0000000e,0x00000021,
+0x00000000,0x00000016,0x00030037,0x0000000f,
+0x00000020,0x000200f8,0x00000022,0x0004003b,
+0x0000000f,0x000000ae,0x00000007,0x0004003d,
+0x0000000e,0x000000af,0x00000020,0x000500c7,
+0x0000000e,0x000000b1,0x000000af,0x000000b0,
+0x0003003e,0x000000ae,0x000000b1,0x0004003d,
+0x0000000e,0x000000b2,0x000000ae,0x000500c4,
+0x0000000e,0x000000b3,0x000000b2,0x00000076,
+0x0004003d,0x0000000e,0x000000b4,0x000000ae,
+0x000500c2,0x0000000e,0x000000b6,0x000000b4,
+0x000000b5,0x000500c5,0x0000000e,0x000000b7,
+0x000000b3,0x000000b6,0x000200fe,0x000000b7,
+0x00010038,0x00050036,0x0000000e,0x00000026,
+0x00000000,0x00000023,0x00030037,0x0000000f,
+0x00000024,0x00030037,0x0000000f,0x00000025,
+0x000200f8,0x00000027,0x0004003b,0x00000081,
+0x000000bf,0x00000007,0x0004003b,0x0000000f,
+0x000000c4,0x00000007,0x0004003d,0x0000000e,
+0x000000ba,0x00000024,0x000500c7,0x0000000e,
+0x000000bb,0x0000006f,0x000000ba,0x0004007c,
+0x00000006,0x000000bc,0x000000bb,0x0004003d,
+0x0000000e,0x000000bd,0x00000025,0x000500c7,
+0x0000000e,0x000000be,0x0000007e,0x000000bd,
+0x0003003e,0x000000bf,0x0000007d,0x00050041,
+0x00000028,0x000000c0,0x000000bf,0x000000be,
+0x0004003d,0x00000006,0x000000c1,0x000000c0,
+0x00050080,0x00000006,0x000000c2,0x000000bc,
+0x000000c1,0x0004007c,0x0000000e,0x000000c3,
+0x000000c2,0x0003003e,0x000000c4,0x000000c3,
+0x00050039,0x0000000e,0x000000c5,0x0000001b,
+0x000000c4,0x000200fe,0x000000c5,0x00010038,
+0x00050036,0x00000006,0x0000002b,0x00000000,
+0x00000029,0x00030037,0x00000028,0x0000002a,
+0x000200f8,0x0000002c,0x0004003d,0x00000006,
+0x000000c8,0x0000002a,0x0008000c,0x00000006,
+0x000000ca,0x00000001,0x0000002d,0x000000c8,
+0x00000075,0x000000c9,0x000200fe,0x000000ca,
+0x00010038,0x00050036,0x00000007,0x0000002f,
+0x00000000,0x0000002d,0x00030037,0x00000008,
+0x0000002e,0x000200f8,0x00000030,0x0004003d,
+0x00000007,0x000000cd,0x0000002e,0x00060050,
+0x00000007,0x000000ce,0x00000075,0x00000075,
+0x00000075,0x00060050,0x00000007,0x000000cf,
+0x000000c9,0x000000c9,0x000000c9,0x0008000c,
+0x00000007,0x000000d0,0x00000001,0x0000002d,
+0x000000cd,0x000000ce,0x000000cf,0x00050051,
+0x00000006,0x000000d1,0x000000d0,0x00000000,
+0x00050051,0x00000006,0x000000d2,0x000000d0,
+0x00000001,0x00050051,0x00000006,0x000000d3,
+0x000000d0,0x00000002,0x00060050,0x00000007,
+0x000000d4,0x000000d1,0x000000d2,0x000000d3,
+0x000200fe,0x000000d4,0x00010038,0x00050036,
+0x00000037,0x0000003d,0x00000000,0x00000038,
+0x00030037,0x00000033,0x00000039,0x00030037,
+0x0000000f,0x0000003a,0x00030037,0x00000034,
+0x0000003b,0x00030037,0x00000034,0x0000003c,
+0x000200f8,0x0000003e,0x0004003b,0x0000000f,
+0x000000d7,0x00000007,0x0004003b,0x0000000f,
+0x000000e0,0x00000007,0x0004003b,0x0000000f,
+0x000000e8,0x00000007,0x0004003b,0x0000000f,
+0x000000ed,0x00000007,0x0004003b,0x0000000f,
+0x000000f4,0x00000007,0x0004003b,0x00000052,
+0x00000106,0x00000007,0x0004003b,0x0000000f,
+0x0000010e,0x00000007,0x0003003e,0x000000d7,
+0x000000d8,0x000200f9,0x000000d9,0x000200f8,
+0x000000d9,0x000400f6,0x000000db,0x000000dc,
+0x00000000,0x000200f9,0x000000dd,0x000200f8,
+0x000000dd,0x0004003d,0x0000000e,0x000000de,
+0x000000d7,0x000500b0,0x00000010,0x000000df,
+0x000000de,0x00000031,0x000400fa,0x000000df,
+0x000000da,0x000000db,0x000200f8,0x000000da,
+0x0003003e,0x000000e0,0x000000d8,0x000200f9,
+0x000000e1,0x000200f8,0x000000e1,0x000400f6,
+0x000000e3,0x000000e4,0x00000000,0x000200f9,
+0x000000e5,0x000200f8,0x000000e5,0x0004003d,
+0x0000000e,0x000000e6,0x000000e0,0x000500b0,
+0x00000010,0x000000e7,0x000000e6,0x00000031,
+0x000400fa,0x000000e7,0x000000e2,0x000000e3,
+0x000200f8,0x000000e2,0x0004003d,0x0000000e,
+0x000000e9,0x000000d7,0x0004003d,0x0000000e,
+0x000000ea,0x000000e0,0x00050084,0x0000000e,
+0x000000eb,0x000000ea,0x00000031,0x00050080,
+0x0000000e,0x000000ec,0x000000e9,0x000000eb,
+0x0003003e,0x000000e8,0x000000ec,0x0004003d,
+0x0000000e,0x000000ee,0x0000003a,0x0004003d,
+0x0000000e,0x000000ef,0x000000e8,0x00050080,
+0x0000000e,0x000000f0,0x000000ef,0x00000090,
+0x000500c2,0x0000000e,0x000000f1,0x000000ee,
+0x000000f0,0x000500c7,0x0000000e,0x000000f3,
+0x000000f1,0x000000f2,0x0003003e,0x000000ed,
+0x000000f3,0x0004003d,0x0000000e,0x000000f5,
+0x0000003a,0x0004003d,0x0000000e,0x000000f6,
+0x000000e8,0x000500c2,0x0000000e,0x000000f7,
+0x000000f5,0x000000f6,0x000500c7,0x0000000e,
+0x000000f9,0x000000f7,0x000000f8,0x0003003e,
+0x000000f4,0x000000f9,0x0004003d,0x00000010,
+0x000000fa,0x0000003b,0x0004003d,0x00000010,
+0x000000fb,0x0000003c,0x000400a8,0x00000010,
+0x000000fc,0x000000fb,0x000500a7,0x00000010,
+0x000000fd,0x000000fa,0x000000fc,0x0004003d,
+0x0000000e,0x000000fe,0x000000ed,0x000500ab,
+0x00000010,0x000000ff,0x000000fe,0x000000d8,
+0x000500a7,0x00000010,0x00000100,0x000000fd,
+0x000000ff,0x0004003d,0x0000000e,0x00000101,
+0x000000f4,0x000500aa,0x00000010,0x00000102,
+0x00000101,0x000000d8,0x000500a7,0x00000010,
+0x00000103,0x00000100,0x00000102,0x000300f7,
+0x00000105,0x00000000,0x000400fa,0x00000103,
+0x00000104,0x0000010d,0x000200f8,0x00000104,
+0x0004003d,0x0000000e,0x00000107,0x000000d7,
+0x00050084,0x0000000e,0x00000108,0x00000107,
+0x00000031,0x0004003d,0x0000000e,0x00000109,
+0x000000e0,0x00050080,0x0000000e,0x0000010a,
+0x00000108,0x00000109,0x00050041,0x00000053,
+0x0000010c,0x00000106,0x0000010a,0x0003003e,
+0x0000010c,0x0000010b,0x000200f9,0x00000105,
+0x000200f8,0x0000010d,0x0004003d,0x0000000e,
+0x0000010f,0x000000f4,0x0004003d,0x0000000e,
+0x00000110,0x000000ed,0x000500c5,0x0000000e,
+0x00000111,0x0000010f,0x00000110,0x0003003e,
+0x0000010e,0x00000111,0x0004003d,0x0000000e,
+0x00000112,0x000000d7,0x00050084,0x0000000e,
+0x00000113,0x00000112,0x00000031,0x0004003d,
+0x0000000e,0x00000114,0x000000e0,0x00050080,
+0x0000000e,0x00000115,0x00000113,0x00000114,
+0x0004003d,0x0000000e,0x00000116,0x0000010e,
+0x00050041,0x00000008,0x00000117,0x00000039,
+0x00000116,0x0004003d,0x00000007,0x00000118,
+0x00000117,0x00050051,0x00000006,0x00000119,
+0x00000118,0x00000000,0x00050051,0x00000006,
+0x0000011a,0x00000118,0x00000001,0x00050051,
+0x00000006,0x0000011b,0x00000118,0x00000002,
+0x00070050,0x00000035,0x0000011c,0x00000119,
+0x0000011a,0x0000011b,0x000000c9,0x00050041,
+0x00000053,0x0000011d,0x00000106,0x00000115,
+0x0003003e,0x0000011d,0x0000011c,0x000200f9,
+0x00000105,0x000200f8,0x00000105,0x000200f9,
+0x000000e4,0x000200f8,0x000000e4,0x0004003d,
+0x0000000e,0x0000011e,0x000000e0,0x00050080,
+0x0000000e,0x0000011f,0x0000011e,0x00000076,
+0x0003003e,0x000000e0,0x0000011f,0x000200f9,
+0x000000e1,0x000200f8,0x000000e3,0x000200f9,
+0x000000dc,0x000200f8,0x000000dc,0x0004003d,
+0x0000000e,0x00000120,0x000000d7,0x00050080,
+0x0000000e,0x00000121,0x00000120,0x00000076,
+0x0003003e,0x000000d7,0x00000121,0x000200f9,
+0x000000d9,0x000200f8,0x000000db,0x0004003d,
+0x00000037,0x00000122,0x00000106,0x000200fe,
+0x00000122,0x00010038,0x00050036,0x00000037,
+0x00000044,0x00000000,0x0000003f,0x00030037,
+0x0000000f,0x00000040,0x00030037,0x0000000f,
+0x00000041,0x00030037,0x00000034,0x00000042,
+0x00030037,0x00000034,0x00000043,0x000200f8,
+0x00000045,0x0004003b,0x00000028,0x00000125,
+0x00000007,0x0004003b,0x0000000f,0x00000131,
+0x00000007,0x0004003b,0x00000028,0x00000134,
+0x00000007,0x0004003b,0x0000000f,0x00000138,
+0x00000007,0x0004003b,0x00000028,0x0000013b,
+0x00000007,0x0004003b,0x0000000f,0x0000013f,
+0x00000007,0x0004003b,0x00000028,0x00000142,
+0x00000007,0x0004003b,0x0000000f,0x00000146,
+0x00000007,0x0004003b,0x00000028,0x00000149,
+0x00000007,0x0004003b,0x0000000f,0x0000014d,
+0x00000007,0x0004003b,0x00000028,0x00000150,
+0x00000007,0x0004003b,0x0000000f,0x00000153,
+0x00000007,0x0004003b,0x00000028,0x00000156,
+0x00000007,0x0004003b,0x00000028,0x0000015f,
+0x00000007,0x0004003b,0x00000081,0x00000166,
+0x00000007,0x0004003b,0x00000033,0x00000169,
+0x00000007,0x0004003b,0x00000028,0x00000172,
+0x00000007,0x0004003b,0x00000028,0x00000177,
+0x00000007,0x0004003b,0x00000028,0x0000017c,
+0x00000007,0x0004003b,0x00000028,0x00000188,
+0x00000007,0x0004003b,0x00000028,0x0000018d,
+0x00000007,0x0004003b,0x00000028,0x00000192,
+0x00000007,0x0004003b,0x00000033,0x00000196,
+0x00000007,0x0004003b,0x0000000f,0x00000198,
+0x00000007,0x0004003b,0x00000034,0x0000019a,
+0x00000007,0x0004003b,0x00000034,0x0000019c,
+0x00000007,0x0004003d,0x0000000e,0x00000126,
+0x00000040,0x000500c2,0x0000000e,0x00000128,
+0x00000126,0x00000127,0x000500c7,0x0000000e,
+0x0000012a,0x00000128,0x00000129,0x000500c4,
+0x0000000e,0x0000012b,0x0000012a,0x00000077,
+0x0004003d,0x0000000e,0x0000012c,0x00000040,
+0x000500c2,0x0000000e,0x0000012e,0x0000012c,
+0x0000012d,0x000500c7,0x0000000e,0x0000012f,
+0x0000012e,0x00000129,0x000500c5,0x0000000e,
+0x00000130,0x0000012b,0x0000012f,0x0003003e,
+0x00000131,0x00000130,0x00050039,0x0000000e,
+0x00000132,0x00000018,0x00000131,0x0004007c,
+0x00000006,0x00000133,0x00000132,0x0003003e,
+0x00000125,0x00000133,0x0004003d,0x0000000e,
+0x00000135,0x00000040,0x000500c2,0x0000000e,
+0x00000137,0x00000135,0x00000136,0x0003003e,
+0x00000138,0x00000137,0x00050039,0x0000000e,
+0x00000139,0x00000018,0x00000138,0x0004007c,
+0x00000006,0x0000013a,0x00000139,0x0003003e,
+0x00000134,0x0000013a,0x0004003d,0x0000000e,
+0x0000013c,0x00000040,0x000500c2,0x0000000e,
+0x0000013e,0x0000013c,0x0000013d,0x0003003e,
+0x0000013f,0x0000013e,0x00050039,0x0000000e,
+0x00000140,0x00000018,0x0000013f,0x0004007c,
+0x00000006,0x00000141,0x00000140,0x0003003e,
+0x0000013b,0x00000141,0x0004003d,0x0000000e,
+0x00000143,0x00000040,0x000500c2,0x0000000e,
+0x00000145,0x00000143,0x00000144,0x0003003e,
+0x00000146,0x00000145,0x00050039,0x0000000e,
+0x00000147,0x00000018,0x00000146,0x0004007c,
+0x00000006,0x00000148,0x00000147,0x0003003e,
+0x00000142,0x00000148,0x0004003d,0x0000000e,
+0x0000014a,0x00000040,0x000500c2,0x0000000e,
+0x0000014c,0x0000014a,0x0000014b,0x0003003e,
+0x0000014d,0x0000014c,0x00050039,0x0000000e,
+0x0000014e,0x00000018,0x0000014d,0x0004007c,
+0x00000006,0x0000014f,0x0000014e,0x0003003e,
+0x00000149,0x0000014f,0x0004003d,0x0000000e,
+0x00000151,0x00000040,0x000500c2,0x0000000e,
+0x00000152,0x00000151,0x00000093,0x0003003e,
+0x00000153,0x00000152,0x00050039,0x0000000e,
+0x00000154,0x00000018,0x00000153,0x0004007c,
+0x00000006,0x00000155,0x00000154,0x0003003e,
+0x00000150,0x00000155,0x0004003d,0x0000000e,
+0x00000157,0x00000040,0x000500c2,0x0000000e,
+0x00000158,0x00000157,0x00000077,0x000500c7,
+0x0000000e,0x00000159,0x00000158,0x00000129,
+0x000500c4,0x0000000e,0x0000015a,0x00000159,
+0x00000076,0x0004003d,0x0000000e,0x0000015b,
+0x00000040,0x000500c7,0x0000000e,0x0000015c,
+0x0000015b,0x000000f8,0x000500c5,0x0000000e,
+0x0000015d,0x0000015a,0x0000015c,0x0004007c,
+0x00000006,0x0000015e,0x0000015d,0x0003003e,
+0x00000156,0x0000015e,0x0004003d,0x00000006,
+0x00000165,0x00000156,0x0003003e,0x00000166,
+0x00000164,0x00050041,0x00000028,0x00000167,
+0x00000166,0x00000165,0x0004003d,0x00000006,
+0x00000168,0x00000167,0x0003003e,0x0000015f,
+0x00000168,0x0004003d,0x00000006,0x0000016a,
+0x00000125,0x0004003d,0x00000006,0x0000016b,
+0x00000134,0x0004003d,0x00000006,0x0000016c,
+0x0000013b,0x00060050,0x00000007,0x0000016d,
+0x0000016a,0x0000016b,0x0000016c,0x00050041,
+0x00000008,0x0000016e,0x00000169,0x00000075,
+0x0003003e,0x0000016e,0x0000016d,0x0004003d,
+0x00000006,0x0000016f,0x00000142,0x0004003d,
+0x00000006,0x00000170,0x0000015f,0x00050080,
+0x00000006,0x00000171,0x0000016f,0x00000170,
+0x0003003e,0x00000172,0x00000171,0x00050039,
+0x00000006,0x00000173,0x0000002b,0x00000172,
+0x0004003d,0x00000006,0x00000174,0x00000149,
+0x0004003d,0x00000006,0x00000175,0x0000015f,
+0x00050080,0x00000006,0x00000176,0x00000174,
+0x00000175,0x0003003e,0x00000177,0x00000176,
+0x00050039,0x00000006,0x00000178,0x0000002b,
+0x00000177,0x0004003d,0x00000006,0x00000179,
+0x00000150,0x0004003d,0x00000006,0x0000017a,
+0x0000015f,0x00050080,0x00000006,0x0000017b,
+0x00000179,0x0000017a,0x0003003e,0x0000017c,
+0x0000017b,0x00050039,0x00000006,0x0000017d,
+0x0000002b,0x0000017c,0x00060050,0x00000007,
+0x0000017e,0x00000173,0x00000178,0x0000017d,
+0x00050041,0x00000008,0x0000017f,0x00000169,
+0x00000076,0x0003003e,0x0000017f,0x0000017e,
+0x0004003d,0x00000006,0x00000180,0x00000142,
+0x0004003d,0x00000006,0x00000181,0x00000149,
+0x0004003d,0x00000006,0x00000182,0x00000150,
+0x00060050,0x00000007,0x00000183,0x00000180,
+0x00000181,0x00000182,0x00050041,0x00000008,
+0x00000184,0x00000169,0x00000077,0x0003003e,
+0x00000184,0x00000183,0x0004003d,0x00000006,
+0x00000185,0x00000142,0x0004003d,0x00000006,
+0x00000186,0x0000015f,0x00050082,0x00000006,
+0x00000187,0x00000185,0x00000186,0x0003003e,
+0x00000188,0x00000187,0x00050039,0x00000006,
+0x00000189,0x0000002b,0x00000188,0x0004003d,
+0x00000006,0x0000018a,0x00000149,0x0004003d,
+0x00000006,0x0000018b,0x0000015f,0x00050082,
+0x00000006,0x0000018c,0x0000018a,0x0000018b,
+0x0003003e,0x0000018d,0x0000018c,0x00050039,
+0x00000006,0x0000018e,0x0000002b,0x0000018d,
+0x0004003d,0x00000006,0x0000018f,0x00000150,
+0x0004003d,0x00000006,0x00000190,0x0000015f,
+0x00050082,0x00000006,0x00000191,0x0000018f,
+0x00000190,0x0003003e,0x00000192,0x00000191,
+0x00050039,0x00000006,0x00000193,0x0000002b,
+0x00000192,0x00060050,0x00000007,0x00000194,
+0x00000189,0x0000018e,0x00000193,0x00050041,
+0x00000008,0x00000195,0x00000169,0x00000078,
+0x0003003e,0x00000195,0x00000194,0x0004003d,
+0x00000032,0x00000197,0x00000169,0x0003003e,
+0x00000196,0x00000197,0x0004003d,0x0000000e,
+0x00000199,0x00000041,0x0003003e,0x00000198,
+0x00000199,0x0004003d,0x00000010,0x0000019b,
+0x00000042,0x0003003e,0x0000019a,0x0000019b,
+0x0004003d,0x00000010,0x0000019d,0x00000043,
+0x0003003e,0x0000019c,0x0000019d,0x00080039,
+0x00000037,0x0000019e,0x0000003d,0x00000196,
+0x00000198,0x0000019a,0x0000019c,0x000200fe,
+0x0000019e,0x00010038,0x00050036,0x00000037,
+0x0000004a,0x00000000,0x0000003f,0x00030037,
+0x0000000f,0x00000046,0x00030037,0x0000000f,
+0x00000047,0x00030037,0x00000034,0x00000048,
+0x00030037,0x00000034,0x00000049,0x000200f8,
+0x0000004b,0x0004003b,0x00000008,0x000001a1,
+0x00000007,0x0004003b,0x0000000f,0x000001a4,
+0x00000007,0x0004003b,0x0000000f,0x000001af,
+0x00000007,0x0004003b,0x0000000f,0x000001bc,
+0x00000007,0x0004003b,0x00000008,0x000001c0,
+0x00000007,0x0004003b,0x0000000f,0x000001c3,
+0x00000007,0x0004003b,0x0000000f,0x000001ca,
+0x00000007,0x0004003b,0x0000000f,0x000001d0,
+0x00000007,0x0004003b,0x0000000f,0x000001d4,
+0x00000007,0x0004003b,0x00000028,0x000001f4,
+0x00000007,0x0004003b,0x00000081,0x000001f6,
+0x00000007,0x0004003b,0x00000033,0x000001f9,
+0x00000007,0x0004003b,0x00000008,0x00000202,
+0x00000007,0x0004003b,0x00000008,0x0000020d,
+0x00000007,0x0004003b,0x00000008,0x00000218,
+0x00000007,0x0004003b,0x00000008,0x00000223,
+0x00000007,0x0004003b,0x00000033,0x00000226,
+0x00000007,0x0004003b,0x0000000f,0x00000228,
+0x00000007,0x0004003b,0x00000034,0x0000022a,
+0x00000007,0x0004003b,0x00000034,0x0000022c,
+0x00000007,0x0004003d,0x0000000e,0x000001a2,
+0x00000046,0x000500c2,0x0000000e,0x000001a3,
+0x000001a2,0x00000127,0x0003003e,0x000001a4,
+0x000001a3,0x00050039,0x0000000e,0x000001a5,
+0x00000018,0x000001a4,0x0004007c,0x00000006,
+0x000001a6,0x000001a5,0x00050041,0x00000028,
+0x000001a7,0x000001a1,0x000000d8,0x0003003e,
+0x000001a7,0x000001a6,0x0004003d,0x0000000e,
+0x000001a8,0x00000046,0x000500c2,0x0000000e,
+0x000001a9,0x000001a8,0x0000012d,0x000500c4,
+0x0000000e,0x000001aa,0x000001a9,0x00000076,
+0x0004003d,0x0000000e,0x000001ab,0x00000046,
+0x000500c2,0x0000000e,0x000001ac,0x000001ab,
+0x00000136,0x000500c7,0x0000000e,0x000001ad,
+0x000001ac,0x000000f8,0x000500c5,0x0000000e,
+0x000001ae,0x000001aa,0x000001ad,0x0003003e,
+0x000001af,0x000001ae,0x00050039,0x0000000e,
+0x000001b0,0x00000018,0x000001af,0x0004007c,
+0x00000006,0x000001b1,0x000001b0,0x00050041,
+0x00000028,0x000001b2,0x000001a1,0x000000f8,
+0x0003003e,0x000001b2,0x000001b1,0x0004003d,
+0x0000000e,0x000001b3,0x00000046,0x000500c2,
+0x0000000e,0x000001b5,0x000001b3,0x000001b4,
+0x000500c4,0x0000000e,0x000001b6,0x000001b5,
+0x00000078,0x0004003d,0x0000000e,0x000001b7,
+0x00000046,0x000500c2,0x0000000e,0x000001b9,
+0x000001b7,0x000001b8,0x000500c7,0x0000000e,
+0x000001ba,0x000001b9,0x0000007e,0x000500c5,
+0x0000000e,0x000001bb,0x000001b6,0x000001ba,
+0x0003003e,0x000001bc,0x000001bb,0x00050039,
+0x0000000e,0x000001bd,0x00000018,0x000001bc,
+0x0004007c,0x00000006,0x000001be,0x000001bd,
+0x00050041,0x00000028,0x000001bf,0x000001a1,
+0x000000f2,0x0003003e,0x000001bf,0x000001be,
+0x0004003d,0x0000000e,0x000001c1,0x00000046,
+0x000500c2,0x0000000e,0x000001c2,0x000001c1,
+0x00000160,0x0003003e,0x000001c3,0x000001c2,
+0x00050039,0x0000000e,0x000001c4,0x00000018,
+0x000001c3,0x0004007c,0x00000006,0x000001c5,
+0x000001c4,0x00050041,0x00000028,0x000001c6,
+0x000001c0,0x000000d8,0x0003003e,0x000001c6,
+0x000001c5,0x0004003d,0x0000000e,0x000001c7,
+0x00000046,0x000500c2,0x0000000e,0x000001c9,
+0x000001c7,0x000001c8,0x0003003e,0x000001ca,
+0x000001c9,0x00050039,0x0000000e,0x000001cb,
+0x00000018,0x000001ca,0x0004007c,0x00000006,
+0x000001cc,0x000001cb,0x00050041,0x00000028,
+0x000001cd,0x000001c0,0x000000f8,0x0003003e,
+0x000001cd,0x000001cc,0x0004003d,0x0000000e,
+0x000001ce,0x00000046,0x000500c2,0x0000000e,
+0x000001cf,0x000001ce,0x00000078,0x0003003e,
+0x000001d0,0x000001cf,0x00050039,0x0000000e,
+0x000001d1,0x00000018,0x000001d0,0x0004007c,
+0x00000006,0x000001d2,0x000001d1,0x00050041,
+0x00000028,0x000001d3,0x000001c0,0x000000f2,
+0x0003003e,0x000001d3,0x000001d2,0x0004003d,
+0x0000000e,0x000001d5,0x00000046,0x000500c7,
+0x0000000e,0x000001d6,0x000001d5,0x00000031,
+0x0003003e,0x000001d4,0x000001d6,0x0004003d,
+0x0000000e,0x000001d7,0x00000046,0x000500c7,
+0x0000000e,0x000001d8,0x000001d7,0x000000f8,
+0x000500c4,0x0000000e,0x000001d9,0x000001d8,
+0x00000076,0x0004003d,0x0000000e,0x000001da,
+0x000001d4,0x000500c5,0x0000000e,0x000001db,
+0x000001da,0x000001d9,0x0003003e,0x000001d4,
+0x000001db,0x00050041,0x00000028,0x000001dc,
+0x000001a1,0x000000d8,0x0004003d,0x00000006,
+0x000001dd,0x000001dc,0x000500c4,0x00000006,
+0x000001de,0x000001dd,0x0000013d,0x00050041,
+0x00000028,0x000001df,0x000001a1,0x000000f8,
+0x0004003d,0x00000006,0x000001e0,0x000001df,
+0x000500c4,0x00000006,0x000001e1,0x000001e0,
+0x0000014b,0x000500c5,0x00000006,0x000001e2,
+0x000001de,0x000001e1,0x00050041,0x00000028,
+0x000001e3,0x000001a1,0x000000f2,0x0004003d,
+0x00000006,0x000001e4,0x000001e3,0x000500c5,
+0x00000006,0x000001e5,0x000001e2,0x000001e4,
+0x00050041,0x00000028,0x000001e6,0x000001c0,
+0x000000d8,0x0004003d,0x00000006,0x000001e7,
+0x000001e6,0x000500c4,0x00000006,0x000001e8,
+0x000001e7,0x0000013d,0x00050041,0x00000028,
+0x000001e9,0x000001c0,0x000000f8,0x0004003d,
+0x00000006,0x000001ea,0x000001e9,0x000500c4,
+0x00000006,0x000001eb,0x000001ea,0x0000014b,
+0x000500c5,0x00000006,0x000001ec,0x000001e8,
+0x000001eb,0x00050041,0x00000028,0x000001ed,
+0x000001c0,0x000000f2,0x0004003d,0x00000006,
+0x000001ee,0x000001ed,0x000500c5,0x00000006,
+0x000001ef,0x000001ec,0x000001ee,0x000500af,
+0x00000010,0x000001f0,0x000001e5,0x000001ef,
+0x000600a9,0x0000000e,0x000001f1,0x000001f0,
+0x000000f8,0x000000d8,0x0004003d,0x0000000e,
+0x000001f2,0x000001d4,0x000500c5,0x0000000e,
+0x000001f3,0x000001f2,0x000001f1,0x0003003e,
+0x000001d4,0x000001f3,0x0004003d,0x0000000e,
+0x000001f5,0x000001d4,0x0003003e,0x000001f6,
+0x00000164,0x00050041,0x00000028,0x000001f7,
+0x000001f6,0x000001f5,0x0004003d,0x00000006,
+0x000001f8,0x000001f7,0x0003003e,0x000001f4,
+0x000001f8,0x0004003d,0x00000007,0x000001fa,
+0x000001a1,0x00050051,0x00000006,0x000001fb,
+0x000001fa,0x00000000,0x00050051,0x00000006,
+0x000001fc,0x000001fa,0x00000001,0x00050051,
+0x00000006,0x000001fd,0x000001fa,0x00000002,
+0x00060050,0x00000007,0x000001fe,0x000001fb,
+0x000001fc,0x000001fd,0x0004003d,0x00000006,
+0x000001ff,0x000001f4,0x00060050,0x00000007,
+0x00000200,0x000001ff,0x000001ff,0x000001ff,
+0x00050080,0x00000007,0x00000201,0x000001fe,
+0x00000200,0x0003003e,0x00000202,0x00000201,
+0x00050039,0x00000007,0x00000203,0x0000002f,
+0x00000202,0x00050041,0x00000008,0x00000204,
+0x000001f9,0x00000075,0x0003003e,0x00000204,
+0x00000203,0x0004003d,0x00000007,0x00000205,
+0x000001a1,0x00050051,0x00000006,0x00000206,
+0x00000205,0x00000000,0x00050051,0x00000006,
+0x00000207,0x00000205,0x00000001,0x00050051,
+0x00000006,0x00000208,0x00000205,0x00000002,
+0x00060050,0x00000007,0x00000209,0x00000206,
+0x00000207,0x00000208,0x0004003d,0x00000006,
+0x0000020a,0x000001f4,0x00060050,0x00000007,
+0x0000020b,0x0000020a,0x0000020a,0x0000020a,
+0x00050082,0x00000007,0x0000020c,0x00000209,
+0x0000020b,0x0003003e,0x0000020d,0x0000020c,
+0x00050039,0x00000007,0x0000020e,0x0000002f,
+0x0000020d,0x00050041,0x00000008,0x0000020f,
+0x000001f9,0x00000076,0x0003003e,0x0000020f,
+0x0000020e,0x0004003d,0x00000007,0x00000210,
+0x000001c0,0x00050051,0x00000006,0x00000211,
+0x00000210,0x00000000,0x00050051,0x00000006,
+0x00000212,0x00000210,0x00000001,0x00050051,
+0x00000006,0x00000213,0x00000210,0x00000002,
+0x00060050,0x00000007,0x00000214,0x00000211,
+0x00000212,0x00000213,0x0004003d,0x00000006,
+0x00000215,0x000001f4,0x00060050,0x00000007,
+0x00000216,0x00000215,0x00000215,0x00000215,
+0x00050080,0x00000007,0x00000217,0x00000214,
+0x00000216,0x0003003e,0x00000218,0x00000217,
+0x00050039,0x00000007,0x00000219,0x0000002f,
+0x00000218,0x00050041,0x00000008,0x0000021a,
+0x000001f9,0x00000077,0x0003003e,0x0000021a,
+0x00000219,0x0004003d,0x00000007,0x0000021b,
+0x000001c0,0x00050051,0x00000006,0x0000021c,
+0x0000021b,0x00000000,0x00050051,0x00000006,
+0x0000021d,0x0000021b,0x00000001,0x00050051,
+0x00000006,0x0000021e,0x0000021b,0x00000002,
+0x00060050,0x00000007,0x0000021f,0x0000021c,
+0x0000021d,0x0000021e,0x0004003d,0x00000006,
+0x00000220,0x000001f4,0x00060050,0x00000007,
+0x00000221,0x00000220,0x00000220,0x00000220,
+0x00050082,0x00000007,0x00000222,0x0000021f,
+0x00000221,0x0003003e,0x00000223,0x00000222,
+0x00050039,0x00000007,0x00000224,0x0000002f,
+0x00000223,0x00050041,0x00000008,0x00000225,
+0x000001f9,0x00000078,0x0003003e,0x00000225,
+0x00000224,0x0004003d,0x00000032,0x00000227,
+0x000001f9,0x0003003e,0x00000226,0x00000227,
+0x0004003d,0x0000000e,0x00000229,0x00000047,
+0x0003003e,0x00000228,0x00000229,0x0004003d,
+0x00000010,0x0000022b,0x00000048,0x0003003e,
+0x0000022a,0x0000022b,0x0004003d,0x00000010,
+0x0000022d,0x00000049,0x0003003e,0x0000022c,
+0x0000022d,0x00080039,0x00000037,0x0000022e,
+0x0000003d,0x00000226,0x00000228,0x0000022a,
+0x0000022c,0x000200fe,0x0000022e,0x00010038,
+0x00050036,0x00000037,0x00000050,0x00000000,
+0x0000004c,0x00030037,0x0000000f,0x0000004d,
+0x00030037,0x0000000f,0x0000004e,0x00030037,
+0x00000034,0x0000004f,0x000200f8,0x00000051,
+0x0004003b,0x00000008,0x00000231,0x00000007,
+0x0004003b,0x0000000f,0x00000235,0x00000007,
+0x0004003b,0x0000000f,0x00000241,0x00000007,
+0x0004003b,0x0000000f,0x00000252,0x00000007,
+0x0004003b,0x00000008,0x00000256,0x00000007,
+0x0004003b,0x0000000f,0x0000025d,0x00000007,
+0x0004003b,0x0000000f,0x00000263,0x00000007,
+0x0004003b,0x0000000f,0x00000269,0x00000007,
+0x0004003b,0x00000008,0x0000026d,0x00000007,
+0x0004003b,0x0000000f,0x00000271,0x00000007,
+0x0004003b,0x0000000f,0x00000277,0x00000007,
+0x0004003b,0x0000000f,0x0000027b,0x00000007,
+0x0004003b,0x00000028,0x00000280,0x00000007,
+0x0004003b,0x00000028,0x00000288,0x00000007,
+0x0004003b,0x00000028,0x0000028b,0x00000007,
+0x0004003b,0x00000052,0x0000028e,0x00000007,
+0x0004003b,0x00000008,0x000002a5,0x00000007,
+0x0004003d,0x0000000e,0x00000232,0x0000004d,
+0x000500c2,0x0000000e,0x00000234,0x00000232,
+0x00000233,0x0003003e,0x00000235,0x00000234,
+0x00050039,0x0000000e,0x00000236,0x0000001e,
+0x00000235,0x0004007c,0x00000006,0x00000237,
+0x00000236,0x00050041,0x00000028,0x00000238,
+0x00000231,0x000000d8,0x0003003e,0x00000238,
+0x00000237,0x0004003d,0x0000000e,0x00000239,
+0x0000004d,0x000500c2,0x0000000e,0x0000023a,
+0x00000239,0x0000012d,0x000500c4,0x0000000e,
+0x0000023b,0x0000023a,0x000000b5,0x0004003d,
+0x0000000e,0x0000023c,0x0000004d,0x000500c2,
+0x0000000e,0x0000023e,0x0000023c,0x0000023d,
+0x000500c7,0x0000000e,0x0000023f,0x0000023e,
+0x000000a5,0x000500c5,0x0000000e,0x00000240,
+0x0000023b,0x0000023f,0x0003003e,0x00000241,
+0x00000240,0x00050039,0x0000000e,0x00000242,
+0x00000021,0x00000241,0x0004007c,0x00000006,
+0x00000243,0x00000242,0x00050041,0x00000028,
+0x00000244,0x00000231,0x000000f8,0x0003003e,
+0x00000244,0x00000243,0x0004003d,0x0000000e,
+0x00000245,0x0000004d,0x000500c2,0x0000000e,
+0x00000246,0x00000245,0x0000013d,0x000500c4,
+0x0000000e,0x00000248,0x00000246,0x00000247,
+0x0004003d,0x0000000e,0x00000249,0x0000004d,
+0x000500c2,0x0000000e,0x0000024a,0x00000249,
+0x00000160,0x000500c7,0x0000000e,0x0000024b,
+0x0000024a,0x00000129,0x000500c4,0x0000000e,
+0x0000024c,0x0000024b,0x00000078,0x000500c5,
+0x0000000e,0x0000024d,0x00000248,0x0000024c,
+0x0004003d,0x0000000e,0x0000024e,0x0000004d,
+0x000500c2,0x0000000e,0x0000024f,0x0000024e,
+0x000001c8,0x000500c7,0x0000000e,0x00000250,
+0x0000024f,0x0000007e,0x000500c5,0x0000000e,
+0x00000251,0x0000024d,0x00000250,0x0003003e,
+0x00000252,0x00000251,0x00050039,0x0000000e,
+0x00000253,0x0000001e,0x00000252,0x0004007c,
+0x00000006,0x00000254,0x00000253,0x00050041,
+0x00000028,0x00000255,0x00000231,0x000000f2,
+0x0003003e,0x00000255,0x00000254,0x0004003d,
+0x0000000e,0x00000257,0x0000004d,0x000500c2,
+0x0000000e,0x00000258,0x00000257,0x00000077,
+0x000500c4,0x0000000e,0x00000259,0x00000258,
+0x00000076,0x0004003d,0x0000000e,0x0000025a,
+0x0000004d,0x000500c7,0x0000000e,0x0000025b,
+0x0000025a,0x000000f8,0x000500c5,0x0000000e,
+0x0000025c,0x00000259,0x0000025b,0x0003003e,
+0x0000025d,0x0000025c,0x00050039,0x0000000e,
+0x0000025e,0x0000001e,0x0000025d,0x0004007c,
+0x00000006,0x0000025f,0x0000025e,0x00050041,
+0x00000028,0x00000260,0x00000256,0x000000d8,
+0x0003003e,0x00000260,0x0000025f,0x0004003d,
+0x0000000e,0x00000261,0x0000004e,0x000500c2,
+0x0000000e,0x00000262,0x00000261,0x00000233,
+0x0003003e,0x00000263,0x00000262,0x00050039,
+0x0000000e,0x00000264,0x00000021,0x00000263,
+0x0004007c,0x00000006,0x00000265,0x00000264,
+0x00050041,0x00000028,0x00000266,0x00000256,
+0x000000f8,0x0003003e,0x00000266,0x00000265,
+0x0004003d,0x0000000e,0x00000267,0x0000004e,
+0x000500c2,0x0000000e,0x00000268,0x00000267,
+0x000001b4,0x0003003e,0x00000269,0x00000268,
+0x00050039,0x0000000e,0x0000026a,0x0000001e,
+0x00000269,0x0004007c,0x00000006,0x0000026b,
+0x0000026a,0x00050041,0x00000028,0x0000026c,
+0x00000256,0x000000f2,0x0003003e,0x0000026c,
+0x0000026b,0x0004003d,0x0000000e,0x0000026e,
+0x0000004e,0x000500c2,0x0000000e,0x00000270,
+0x0000026e,0x0000026f,0x0003003e,0x00000271,
+0x00000270,0x00050039,0x0000000e,0x00000272,
+0x0000001e,0x00000271,0x0004007c,0x00000006,
+0x00000273,0x00000272,0x00050041,0x00000028,
+0x00000274,0x0000026d,0x000000d8,0x0003003e,
+0x00000274,0x00000273,0x0004003d,0x0000000e,
+0x00000275,0x0000004e,0x000500c2,0x0000000e,
+0x00000276,0x00000275,0x000000b5,0x0003003e,
+0x00000277,0x00000276,0x00050039,0x0000000e,
+0x00000278,0x00000021,0x00000277,0x0004007c,
+0x00000006,0x00000279,0x00000278,0x00050041,
+0x00000028,0x0000027a,0x0000026d,0x000000f8,
+0x0003003e,0x0000027a,0x00000279,0x0004003d,
+0x0000000e,0x0000027c,0x0000004e,0x0003003e,
+0x0000027b,0x0000027c,0x00050039,0x0000000e,
+0x0000027d,0x0000001e,0x0000027b,0x0004007c,
+0x00000006,0x0000027e,0x0000027d,0x00050041,
+0x00000028,0x0000027f,0x0000026d,0x000000f2,
+0x0003003e,0x0000027f,0x0000027e,0x0003003e,
+0x00000280,0x00000075,0x000200f9,0x00000281,
+0x000200f8,0x00000281,0x000400f6,0x00000283,
+0x00000284,0x00000000,0x000200f9,0x00000285,
+0x000200f8,0x00000285,0x0004003d,0x00000006,
+0x00000286,0x00000280,0x000500b1,0x00000010,
+0x00000287,0x00000286,0x0000013d,0x000400fa,
+0x00000287,0x00000282,0x00000283,0x000200f8,
+0x00000282,0x0004003d,0x00000006,0x00000289,
+0x00000280,0x000500c3,0x00000006,0x0000028a,
+0x00000289,0x00000077,0x0003003e,0x00000288,
+0x0000028a,0x0004003d,0x00000006,0x0000028c,
+0x00000280,0x000500c7,0x00000006,0x0000028d,
+0x0000028c,0x00000078,0x0003003e,0x0000028b,
+0x0000028d,0x0004003d,0x00000006,0x0000028f,
+0x00000280,0x0004003d,0x00000006,0x00000290,
+0x0000028b,0x0004003d,0x00000007,0x00000291,
+0x00000256,0x0004003d,0x00000007,0x00000292,
+0x00000231,0x00050082,0x00000007,0x00000293,
+0x00000291,0x00000292,0x00060050,0x00000007,
+0x00000294,0x00000290,0x00000290,0x00000290,
+0x00050084,0x00000007,0x00000295,0x00000294,
+0x00000293,0x0004003d,0x00000006,0x00000296,
+0x00000288,0x0004003d,0x00000007,0x00000297,
+0x0000026d,0x0004003d,0x00000007,0x00000298,
+0x00000231,0x00050082,0x00000007,0x00000299,
+0x00000297,0x00000298,0x00060050,0x00000007,
+0x0000029a,0x00000296,0x00000296,0x00000296,
+0x00050084,0x00000007,0x0000029b,0x0000029a,
+0x00000299,0x00050080,0x00000007,0x0000029c,
+0x00000295,0x0000029b,0x0004003d,0x00000007,
+0x0000029d,0x00000231,0x00060050,0x00000007,
+0x0000029e,0x00000093,0x00000093,0x00000093,
+0x00050084,0x00000007,0x0000029f,0x0000029e,
+0x0000029d,0x00050080,0x00000007,0x000002a0,
+0x0000029c,0x0000029f,0x00060050,0x00000007,
+0x000002a1,0x00000077,0x00000077,0x00000077,
+0x00050080,0x00000007,0x000002a2,0x000002a0,
+0x000002a1,0x00060050,0x00000007,0x000002a3,
+0x00000077,0x00000077,0x00000077,0x000500c3,
+0x00000007,0x000002a4,0x000002a2,0x000002a3,
+0x0003003e,0x000002a5,0x000002a4,0x00050039,
+0x00000007,0x000002a6,0x0000002f,0x000002a5,
+0x00050051,0x00000006,0x000002a7,0x000002a6,
+0x00000000,0x00050051,0x00000006,0x000002a8,
+0x000002a6,0x00000001,0x00050051,0x00000006,
+0x000002a9,0x000002a6,0x00000002,0x00070050,
+0x00000035,0x000002aa,0x000002a7,0x000002a8,
+0x000002a9,0x000000c9,0x00050041,0x00000053,
+0x000002ab,0x0000028e,0x0000028f,0x0003003e,
+0x000002ab,0x000002aa,0x0004003d,0x00000006,
+0x000002ac,0x00000280,0x00060041,0x00000028,
+0x000002ad,0x0000028e,0x000002ac,0x00000129,
+0x0003003e,0x000002ad,0x000000c9,0x000200f9,
+0x00000284,0x000200f8,0x00000284,0x0004003d,
+0x00000006,0x000002ae,0x00000280,0x00050080,
+0x00000006,0x000002af,0x000002ae,0x00000076,
+0x0003003e,0x00000280,0x000002af,0x000200f9,
+0x00000281,0x000200f8,0x00000283,0x0004003d,
+0x00000037,0x000002b0,0x0000028e,0x000200fe,
+0x000002b0,0x00010038,0x00050036,0x00000002,
+0x0000005f,0x00000000,0x00000054,0x00030037,
+0x00000052,0x00000055,0x00030037,0x00000028,
+0x00000056,0x00030037,0x00000028,0x00000057,
+0x00030037,0x00000028,0x00000058,0x00030037,
+0x00000053,0x00000059,0x00030037,0x0000000f,
+0x0000005a,0x00030037,0x00000034,0x0000005b,
+0x00030037,0x00000034,0x0000005c,0x00030037,
+0x00000034,0x0000005d,0x00030037,0x00000034,
+0x0000005e,0x000200f8,0x00000060,0x0004003b,
+0x0000000f,0x000002b3,0x00000007,0x0004003b,
+0x0000000f,0x000002b4,0x00000007,0x0004003b,
+0x00000028,0x000002bc,0x00000007,0x0004003b,
+0x0000000f,0x000002c7,0x00000007,0x0004003b,
+0x0000000f,0x000002cd,0x00000007,0x0004003b,
+0x0000000f,0x000002de,0x00000007,0x0004003b,
+0x0000000f,0x000002e3,0x00000007,0x0004003b,
+0x0000000f,0x000002e9,0x00000007,0x0004003b,
+0x0000000f,0x000002ee,0x00000007,0x0004003b,
+0x0000000f,0x00000302,0x00000007,0x0004003b,
+0x00000028,0x00000306,0x00000007,0x0004003b,
+0x00000028,0x0000030e,0x00000007,0x0004003b,
+0x00000028,0x00000313,0x00000007,0x0004003b,
+0x00000028,0x00000318,0x00000007,0x0003003e,
+0x000002b3,0x000000d8,0x0003003e,0x000002b4,
+0x000000d8,0x0004003d,0x00000010,0x000002b5,
+0x0000005b,0x000300f7,0x000002b7,0x00000000,
+0x000400fa,0x000002b5,0x000002b6,0x000002b7,
+0x000200f8,0x000002b6,0x0004003d,0x00000010,
+0x000002b8,0x0000005c,0x000300f7,0x000002ba,
+0x00000000,0x000400fa,0x000002b8,0x000002b9,
+0x000002bb,0x000200f8,0x000002b9,0x0003003e,
+0x000002b4,0x000000f2,0x000200f9,0x000002ba,
+0x000200f8,0x000002bb,0x0003003e,0x000002b3,
+0x000000f2,0x000200f9,0x000002ba,0x000200f8,
+0x000002ba,0x000200f9,0x000002b7,0x000200f8,
+0x000002b7,0x0003003e,0x000002bc,0x00000075,
+0x000200f9,0x000002bd,0x000200f8,0x000002bd,
+0x000400f6,0x000002bf,0x000002c0,0x00000000,
+0x000200f9,0x000002c1,0x000200f8,0x000002c1,
+0x0004003d,0x00000006,0x000002c2,0x000002bc,
+0x000500b1,0x00000010,0x000002c3,0x000002c2,
+0x0000014b,0x000400fa,0x000002c3,0x000002be,
+0x000002bf,0x000200f8,0x000002be,0x0004003d,
+0x00000010,0x000002c4,0x0000005c,0x000300f7,
+0x000002c6,0x00000000,0x000400fa,0x000002c4,
+0x000002c5,0x000002d3,0x000200f8,0x000002c5,
+0x0004003d,0x0000000e,0x000002c8,0x000002b3,
+0x0004003d,0x00000006,0x000002c9,0x000002bc,
+0x000500c3,0x00000006,0x000002ca,0x000002c9,
+0x00000076,0x0004007c,0x0000000e,0x000002cb,
+0x000002ca,0x00050080,0x0000000e,0x000002cc,
+0x000002c8,0x000002cb,0x0003003e,0x000002c7,
+0x000002cc,0x0004003d,0x0000000e,0x000002ce,
+0x000002b4,0x0004003d,0x00000006,0x000002cf,
+0x000002bc,0x000500c7,0x00000006,0x000002d0,
+0x000002cf,0x00000076,0x0004007c,0x0000000e,
+0x000002d1,0x000002d0,0x00050080,0x0000000e,
+0x000002d2,0x000002ce,0x000002d1,0x0003003e,
+0x000002cd,0x000002d2,0x000200f9,0x000002c6,
+0x000200f8,0x000002d3,0x0004003d,0x0000000e,
+0x000002d4,0x000002b3,0x0004003d,0x00000006,
+0x000002d5,0x000002bc,0x000500c3,0x00000006,
+0x000002d6,0x000002d5,0x00000077,0x0004007c,
+0x0000000e,0x000002d7,0x000002d6,0x00050080,
+0x0000000e,0x000002d8,0x000002d4,0x000002d7,
+0x0003003e,0x000002c7,0x000002d8,0x0004003d,
+0x0000000e,0x000002d9,0x000002b4,0x0004003d,
+0x00000006,0x000002da,0x000002bc,0x000500c7,
+0x00000006,0x000002db,0x000002da,0x00000078,
+0x0004007c,0x0000000e,0x000002dc,0x000002db,
+0x00050080,0x0000000e,0x000002dd,0x000002d9,
+0x000002dc,0x0003003e,0x000002cd,0x000002dd,
+0x000200f9,0x000002c6,0x000200f8,0x000002c6,
+0x0004003d,0x0000000e,0x000002df,0x000002cd,
+0x0004003d,0x0000000e,0x000002e0,0x000002c7,
+0x00050084,0x0000000e,0x000002e1,0x000002e0,
+0x00000031,0x00050080,0x0000000e,0x000002e2,
+0x000002df,0x000002e1,0x0003003e,0x000002de,
+0x000002e2,0x0004003d,0x0000000e,0x000002e4,
+0x0000005a,0x0004003d,0x0000000e,0x000002e5,
+0x000002de,0x00050080,0x0000000e,0x000002e6,
+0x000002e5,0x00000090,0x000500c2,0x0000000e,
+0x000002e7,0x000002e4,0x000002e6,0x000500c7,
+0x0000000e,0x000002e8,0x000002e7,0x000000f2,
+0x0003003e,0x000002e3,0x000002e8,0x0004003d,
+0x0000000e,0x000002ea,0x0000005a,0x0004003d,
+0x0000000e,0x000002eb,0x000002de,0x000500c2,
+0x0000000e,0x000002ec,0x000002ea,0x000002eb,
+0x000500c7,0x0000000e,0x000002ed,0x000002ec,
+0x000000f8,0x0003003e,0x000002e9,0x000002ed,
+0x0004003d,0x0000000e,0x000002ef,0x000002c7,
+0x0004003d,0x0000000e,0x000002f0,0x000002cd,
+0x00050084,0x0000000e,0x000002f1,0x00000031,
+0x000002f0,0x00050080,0x0000000e,0x000002f2,
+0x000002ef,0x000002f1,0x0003003e,0x000002ee,
+0x000002f2,0x0004003d,0x00000010,0x000002f3,
+0x0000005d,0x0004003d,0x00000010,0x000002f4,
+0x0000005e,0x000400a8,0x00000010,0x000002f5,
+0x000002f4,0x000500a7,0x00000010,0x000002f6,
+0x000002f3,0x000002f5,0x0004003d,0x0000000e,
+0x000002f7,0x000002e3,0x000500ab,0x00000010,
+0x000002f8,0x000002f7,0x000000d8,0x000500a7,
+0x00000010,0x000002f9,0x000002f6,0x000002f8,
+0x0004003d,0x0000000e,0x000002fa,0x000002e9,
+0x000500aa,0x00000010,0x000002fb,0x000002fa,
+0x000000d8,0x000500a7,0x00000010,0x000002fc,
+0x000002f9,0x000002fb,0x000300f7,0x000002fe,
+0x00000000,0x000400fa,0x000002fc,0x000002fd,
+0x00000301,0x000200f8,0x000002fd,0x0004003d,
+0x0000000e,0x000002ff,0x000002ee,0x00050041,
+0x00000053,0x00000300,0x00000055,0x000002ff,
+0x0003003e,0x00000300,0x0000010b,0x000200f9,
+0x000002fe,0x000200f8,0x00000301,0x0004003d,
+0x0000000e,0x00000303,0x000002e9,0x0004003d,
+0x0000000e,0x00000304,0x000002e3,0x000500c5,
+0x0000000e,0x00000305,0x00000303,0x00000304,
+0x0003003e,0x00000302,0x00000305,0x0004003d,
+0x0000000e,0x00000307,0x00000302,0x00050041,
+0x00000028,0x00000308,0x00000059,0x00000307,
+0x0004003d,0x00000006,0x00000309,0x00000308,
+0x0003003e,0x00000306,0x00000309,0x0004003d,
+0x0000000e,0x0000030a,0x000002ee,0x0004003d,
+0x00000006,0x0000030b,0x00000056,0x0004003d,
+0x00000006,0x0000030c,0x00000306,0x00050080,
+0x00000006,0x0000030d,0x0000030b,0x0000030c,
+0x0003003e,0x0000030e,0x0000030d,0x00050039,
+0x00000006,0x0000030f,0x0000002b,0x0000030e,
+0x0004003d,0x00000006,0x00000310,0x00000057,
+0x0004003d,0x00000006,0x00000311,0x00000306,
+0x00050080,0x00000006,0x00000312,0x00000310,
+0x00000311,0x0003003e,0x00000313,0x00000312,
+0x00050039,0x00000006,0x00000314,0x0000002b,
+0x00000313,0x0004003d,0x00000006,0x00000315,
+0x00000058,0x0004003d,0x00000006,0x00000316,
+0x00000306,0x00050080,0x00000006,0x00000317,
+0x00000315,0x00000316,0x0003003e,0x00000318,
+0x00000317,0x00050039,0x00000006,0x00000319,
+0x0000002b,0x00000318,0x00070050,0x00000035,
+0x0000031a,0x0000030f,0x00000314,0x00000319,
+0x000000c9,0x00050041,0x00000053,0x0000031b,
+0x00000055,0x0000030a,0x0003003e,0x0000031b,
+0x0000031a,0x000200f9,0x000002fe,0x000200f8,
+0x000002fe,0x000200f9,0x000002c0,0x000200f8,
+0x000002c0,0x0004003d,0x00000006,0x0000031c,
+0x000002bc,0x00050080,0x00000006,0x0000031d,
+0x0000031c,0x00000076,0x0003003e,0x000002bc,
+0x0000031d,0x000200f9,0x000002bd,0x000200f8,
+0x000002bf,0x000100fd,0x00010038,0x00050036,
+0x00000037,0x00000064,0x00000000,0x0000004c,
+0x00030037,0x0000000f,0x00000061,0x00030037,
+0x0000000f,0x00000062,0x00030037,0x00000034,
+0x00000063,0x000200f8,0x00000065,0x0004003b,
+0x00000034,0x0000031e,0x00000007,0x0004003b,
+0x0000000f,0x0000032d,0x00000007,0x0004003b,
+0x0000000f,0x00000330,0x00000007,0x0004003b,
+0x0000000f,0x00000333,0x00000007,0x0004003b,
+0x0000000f,0x00000338,0x00000007,0x0004003b,
+0x0000000f,0x0000033a,0x00000007,0x0004003b,
+0x0000000f,0x0000033e,0x00000007,0x0004003b,
+0x0000000f,0x00000340,0x00000007,0x0004003b,
+0x00000034,0x00000342,0x00000007,0x0004003b,
+0x00000034,0x00000344,0x00000007,0x0004003b,
+0x0000000f,0x0000034a,0x00000007,0x0004003b,
+0x0000000f,0x0000034c,0x00000007,0x0004003b,
+0x0000000f,0x00000350,0x00000007,0x0004003b,
+0x0000000f,0x00000352,0x00000007,0x0004003b,
+0x00000034,0x00000354,0x00000007,0x0004003b,
+0x00000034,0x00000356,0x00000007,0x0004003b,
+0x0000000f,0x0000035c,0x00000007,0x0004003b,
+0x0000000f,0x0000035e,0x00000007,0x0004003b,
+0x0000000f,0x00000362,0x00000007,0x0004003b,
+0x0000000f,0x00000364,0x00000007,0x0004003b,
+0x00000034,0x00000366,0x00000007,0x0004003b,
+0x00000028,0x0000036a,0x00000007,0x0004003b,
+0x0000000f,0x0000036b,0x00000007,0x0004003b,
+0x00000028,0x0000036f,0x00000007,0x0004003b,
+0x0000000f,0x00000372,0x00000007,0x0004003b,
+0x0000000f,0x00000374,0x00000007,0x0004003b,
+0x00000028,0x00000377,0x00000007,0x0004003b,
+0x0000000f,0x00000378,0x00000007,0x0004003b,
+0x00000028,0x0000037c,0x00000007,0x0004003b,
+0x0000000f,0x0000037f,0x00000007,0x0004003b,
+0x0000000f,0x00000381,0x00000007,0x0004003b,
+0x00000028,0x00000384,0x00000007,0x0004003b,
+0x0000000f,0x00000385,0x00000007,0x0004003b,
+0x00000028,0x00000389,0x00000007,0x0004003b,
+0x0000000f,0x0000038c,0x00000007,0x0004003b,
+0x0000000f,0x0000038e,0x00000007,0x0004003b,
+0x0000000f,0x00000395,0x00000007,0x0004003b,
+0x0000000f,0x0000039a,0x00000007,0x0004003b,
+0x0000000f,0x0000039f,0x00000007,0x0004003b,
+0x0000000f,0x000003a4,0x00000007,0x0004003b,
+0x0000000f,0x000003a9,0x00000007,0x0004003b,
+0x0000000f,0x000003ae,0x00000007,0x0004003b,
+0x0000000f,0x000003b1,0x00000007,0x0004003b,
+0x0000000f,0x000003b5,0x00000007,0x0004003b,
+0x00000053,0x000003bf,0x00000007,0x0004003b,
+0x000003e4,0x000003e5,0x00000007,0x0004003b,
+0x00000053,0x000003e8,0x00000007,0x0004003b,
+0x000003e4,0x000003ea,0x00000007,0x0004003b,
+0x000003e4,0x000003f8,0x00000007,0x0004003b,
+0x000003e4,0x000003fc,0x00000007,0x0004003b,
+0x00000034,0x000003ff,0x00000007,0x0004003b,
+0x00000052,0x00000403,0x00000007,0x0004003b,
+0x00000052,0x00000405,0x00000007,0x0004003b,
+0x00000028,0x00000407,0x00000007,0x0004003b,
+0x00000028,0x00000409,0x00000007,0x0004003b,
+0x00000028,0x0000040b,0x00000007,0x0004003b,
+0x00000053,0x0000040d,0x00000007,0x0004003b,
+0x0000000f,0x0000040f,0x00000007,0x0004003b,
+0x00000034,0x00000411,0x00000007,0x0004003b,
+0x00000034,0x00000412,0x00000007,0x0004003b,
+0x00000034,0x00000414,0x00000007,0x0004003b,
+0x00000034,0x00000416,0x00000007,0x0004003b,
+0x00000052,0x0000041b,0x00000007,0x0004003b,
+0x00000028,0x0000041d,0x00000007,0x0004003b,
+0x00000028,0x0000041f,0x00000007,0x0004003b,
+0x00000028,0x00000421,0x00000007,0x0004003b,
+0x00000053,0x00000423,0x00000007,0x0004003b,
+0x0000000f,0x00000425,0x00000007,0x0004003b,
+0x00000034,0x00000427,0x00000007,0x0004003b,
+0x00000034,0x00000428,0x00000007,0x0004003b,
+0x00000034,0x0000042a,0x00000007,0x0004003b,
+0x00000034,0x0000042c,0x00000007,0x0004003d,
+0x0000000e,0x0000031f,0x00000061,0x000500c2,
+0x0000000e,0x00000320,0x0000031f,0x00000076,
+0x000500c7,0x0000000e,0x00000321,0x00000320,
+0x000000f8,0x000500ab,0x00000010,0x00000322,
+0x00000321,0x000000d8,0x0003003e,0x0000031e,
+0x00000322,0x0004003d,0x00000010,0x00000323,
+0x00000063,0x000400a8,0x00000010,0x00000324,
+0x00000323,0x000300f7,0x00000326,0x00000000,
+0x000400fa,0x00000324,0x00000325,0x00000326,
+0x000200f8,0x00000325,0x0004003d,0x0000000e,
+0x00000327,0x00000061,0x000500c7,0x0000000e,
+0x00000328,0x00000327,0x000000f2,0x000500ab,
+0x00000010,0x00000329,0x00000328,0x000000d8,
+0x000200f9,0x00000326,0x000200f8,0x00000326,
+0x000700f5,0x00000010,0x0000032a,0x00000323,
+0x00000065,0x00000329,0x00000325,0x000300f7,
+0x0000032c,0x00000000,0x000400fa,0x0000032a,
+0x0000032b,0x00000391,0x000200f8,0x0000032b,
+0x0004003d,0x0000000e,0x0000032e,0x00000061,
+0x000500c2,0x0000000e,0x0000032f,0x0000032e,
+0x00000127,0x0003003e,0x0000032d,0x0000032f,
+0x0004003d,0x0000000e,0x00000331,0x00000061,
+0x000500c2,0x0000000e,0x00000332,0x00000331,
+0x000001b4,0x0003003e,0x00000330,0x00000332,
+0x0004003d,0x0000000e,0x00000334,0x00000061,
+0x000500c2,0x0000000e,0x00000335,0x00000334,
+0x00000160,0x0003003e,0x00000333,0x00000335,
+0x0004003d,0x0000000e,0x00000336,0x00000061,
+0x000500c2,0x0000000e,0x00000337,0x00000336,
+0x0000012d,0x0004003d,0x0000000e,0x00000339,
+0x0000032d,0x0003003e,0x00000338,0x00000339,
+0x0003003e,0x0000033a,0x00000337,0x00060039,
+0x00000010,0x0000033b,0x00000014,0x00000338,
+0x0000033a,0x000300f7,0x0000033d,0x00000000,
+0x000400fa,0x0000033b,0x0000033c,0x0000033d,
+0x000200f8,0x0000033c,0x0004003d,0x0000000e,
+0x0000033f,0x00000061,0x0003003e,0x0000033e,
+0x0000033f,0x0004003d,0x0000000e,0x00000341,
+0x00000062,0x0003003e,0x00000340,0x00000341,
+0x0004003d,0x00000010,0x00000343,0x00000063,
+0x0003003e,0x00000342,0x00000343,0x0004003d,
+0x00000010,0x00000345,0x0000031e,0x0003003e,
+0x00000344,0x00000345,0x00080039,0x00000037,
+0x00000346,0x00000044,0x0000033e,0x00000340,
+0x00000342,0x00000344,0x000200fe,0x00000346,
+0x000200f8,0x0000033d,0x0004003d,0x0000000e,
+0x00000348,0x00000061,0x000500c2,0x0000000e,
+0x00000349,0x00000348,0x0000013d,0x0004003d,
+0x0000000e,0x0000034b,0x00000330,0x0003003e,
+0x0000034a,0x0000034b,0x0003003e,0x0000034c,
+0x00000349,0x00060039,0x00000010,0x0000034d,
+0x00000014,0x0000034a,0x0000034c,0x000300f7,
+0x0000034f,0x00000000,0x000400fa,0x0000034d,
+0x0000034e,0x0000034f,0x000200f8,0x0000034e,
+0x0004003d,0x0000000e,0x00000351,0x00000061,
+0x0003003e,0x00000350,0x00000351,0x0004003d,
+0x0000000e,0x00000353,0x00000062,0x0003003e,
+0x00000352,0x00000353,0x0004003d,0x00000010,
+0x00000355,0x00000063,0x0003003e,0x00000354,
+0x00000355,0x0004003d,0x00000010,0x00000357,
+0x0000031e,0x0003003e,0x00000356,0x00000357,
+0x00080039,0x00000037,0x00000358,0x0000004a,
+0x00000350,0x00000352,0x00000354,0x00000356,
+0x000200fe,0x00000358,0x000200f8,0x0000034f,
+0x0004003d,0x0000000e,0x0000035a,0x00000061,
+0x000500c2,0x0000000e,0x0000035b,0x0000035a,
+0x0000014b,0x0004003d,0x0000000e,0x0000035d,
+0x00000333,0x0003003e,0x0000035c,0x0000035d,
+0x0003003e,0x0000035e,0x0000035b,0x00060039,
+0x00000010,0x0000035f,0x00000014,0x0000035c,
+0x0000035e,0x000300f7,0x00000361,0x00000000,
+0x000400fa,0x0000035f,0x00000360,0x00000361,
+0x000200f8,0x00000360,0x0004003d,0x0000000e,
+0x00000363,0x00000061,0x0003003e,0x00000362,
+0x00000363,0x0004003d,0x0000000e,0x00000365,
+0x00000062,0x0003003e,0x00000364,0x00000365,
+0x0004003d,0x00000010,0x00000367,0x00000063,
+0x0003003e,0x00000366,0x00000367,0x00070039,
+0x00000037,0x00000368,0x00000050,0x00000362,
+0x00000364,0x00000366,0x000200fe,0x00000368,
+0x000200f8,0x00000361,0x0004003d,0x0000000e,
+0x0000036c,0x0000032d,0x0003003e,0x0000036b,
+0x0000036c,0x00050039,0x0000000e,0x0000036d,
+0x0000001b,0x0000036b,0x0004007c,0x00000006,
+0x0000036e,0x0000036d,0x0003003e,0x0000036a,
+0x0000036e,0x0004003d,0x0000000e,0x00000370,
+0x00000061,0x000500c2,0x0000000e,0x00000371,
+0x00000370,0x0000012d,0x0004003d,0x0000000e,
+0x00000373,0x0000032d,0x0003003e,0x00000372,
+0x00000373,0x0003003e,0x00000374,0x00000371,
+0x00060039,0x0000000e,0x00000375,0x00000026,
+0x00000372,0x00000374,0x0004007c,0x00000006,
+0x00000376,0x00000375,0x0003003e,0x0000036f,
+0x00000376,0x0004003d,0x0000000e,0x00000379,
+0x00000330,0x0003003e,0x00000378,0x00000379,
+0x00050039,0x0000000e,0x0000037a,0x0000001b,
+0x00000378,0x0004007c,0x00000006,0x0000037b,
+0x0000037a,0x0003003e,0x00000377,0x0000037b,
+0x0004003d,0x0000000e,0x0000037d,0x00000061,
+0x000500c2,0x0000000e,0x0000037e,0x0000037d,
+0x0000013d,0x0004003d,0x0000000e,0x00000380,
+0x00000330,0x0003003e,0x0000037f,0x00000380,
+0x0003003e,0x00000381,0x0000037e,0x00060039,
+0x0000000e,0x00000382,0x00000026,0x0000037f,
+0x00000381,0x0004007c,0x00000006,0x00000383,
+0x00000382,0x0003003e,0x0000037c,0x00000383,
+0x0004003d,0x0000000e,0x00000386,0x00000333,
+0x0003003e,0x00000385,0x00000386,0x00050039,
+0x0000000e,0x00000387,0x0000001b,0x00000385,
+0x0004007c,0x00000006,0x00000388,0x00000387,
+0x0003003e,0x00000384,0x00000388,0x0004003d,
+0x0000000e,0x0000038a,0x00000061,0x000500c2,
+0x0000000e,0x0000038b,0x0000038a,0x0000014b,
+0x0004003d,0x0000000e,0x0000038d,0x00000333,
+0x0003003e,0x0000038c,0x0000038d,0x0003003e,
+0x0000038e,0x0000038b,0x00060039,0x0000000e,
+0x0000038f,0x00000026,0x0000038c,0x0000038e,
+0x0004007c,0x00000006,0x00000390,0x0000038f,
+0x0003003e,0x00000389,0x00000390,0x000200f9,
+0x0000032c,0x000200f8,0x00000391,0x0004003d,
+0x0000000e,0x00000392,0x00000061,0x000500c2,
+0x0000000e,0x00000394,0x00000392,0x00000393,
+0x0003003e,0x00000395,0x00000394,0x00050039,
+0x0000000e,0x00000396,0x00000018,0x00000395,
+0x0004007c,0x00000006,0x00000397,0x00000396,
+0x0003003e,0x0000036a,0x00000397,0x0004003d,
+0x0000000e,0x00000398,0x00000061,0x000500c2,
+0x0000000e,0x00000399,0x00000398,0x0000012d,
+0x0003003e,0x0000039a,0x00000399,0x00050039,
+0x0000000e,0x0000039b,0x00000018,0x0000039a,
+0x0004007c,0x00000006,0x0000039c,0x0000039b,
+0x0003003e,0x0000036f,0x0000039c,0x0004003d,
+0x0000000e,0x0000039d,0x00000061,0x000500c2,
+0x0000000e,0x0000039e,0x0000039d,0x00000136,
+0x0003003e,0x0000039f,0x0000039e,0x00050039,
+0x0000000e,0x000003a0,0x00000018,0x0000039f,
+0x0004007c,0x00000006,0x000003a1,0x000003a0,
+0x0003003e,0x00000377,0x000003a1,0x0004003d,
+0x0000000e,0x000003a2,0x00000061,0x000500c2,
+0x0000000e,0x000003a3,0x000003a2,0x0000013d,
+0x0003003e,0x000003a4,0x000003a3,0x00050039,
+0x0000000e,0x000003a5,0x00000018,0x000003a4,
+0x0004007c,0x00000006,0x000003a6,0x000003a5,
+0x0003003e,0x0000037c,0x000003a6,0x0004003d,
+0x0000000e,0x000003a7,0x00000061,0x000500c2,
+0x0000000e,0x000003a8,0x000003a7,0x00000144,
+0x0003003e,0x000003a9,0x000003a8,0x00050039,
+0x0000000e,0x000003aa,0x00000018,0x000003a9,
+0x0004007c,0x00000006,0x000003ab,0x000003aa,
+0x0003003e,0x00000384,0x000003ab,0x0004003d,
+0x0000000e,0x000003ac,0x00000061,0x000500c2,
+0x0000000e,0x000003ad,0x000003ac,0x0000014b,
+0x0003003e,0x000003ae,0x000003ad,0x00050039,
+0x0000000e,0x000003af,0x00000018,0x000003ae,
+0x0004007c,0x00000006,0x000003b0,0x000003af,
+0x0003003e,0x00000389,0x000003b0,0x000200f9,
+0x0000032c,0x000200f8,0x0000032c,0x0004003d,
+0x0000000e,0x000003b2,0x00000061,0x000500c2,
+0x0000000e,0x000003b3,0x000003b2,0x00000247,
+0x000500c7,0x0000000e,0x000003b4,0x0000007e,
+0x000003b3,0x0003003e,0x000003b1,0x000003b4,
+0x0004003d,0x0000000e,0x000003b6,0x00000061,
+0x000500c2,0x0000000e,0x000003b7,0x000003b6,
+0x00000077,0x000500c7,0x0000000e,0x000003b8,
+0x0000007e,0x000003b7,0x0003003e,0x000003b5,
+0x000003b8,0x0004003d,0x00000010,0x000003b9,
+0x0000031e,0x0004003d,0x00000010,0x000003ba,
+0x00000063,0x000400a8,0x00000010,0x000003bb,
+0x000003ba,0x000500a6,0x00000010,0x000003bc,
+0x000003b9,0x000003bb,0x000300f7,0x000003be,
+0x00000000,0x000400fa,0x000003bc,0x000003bd,
+0x000003ed,0x000200f8,0x000003bd,0x0004003d,
+0x0000000e,0x000003e3,0x000003b1,0x0003003e,
+0x000003e5,0x000003e2,0x00050041,0x00000053,
+0x000003e6,0x000003e5,0x000003e3,0x0004003d,
+0x00000035,0x000003e7,0x000003e6,0x0003003e,
+0x000003bf,0x000003e7,0x0004003d,0x0000000e,
+0x000003e9,0x000003b5,0x0003003e,0x000003ea,
+0x000003e2,0x00050041,0x00000053,0x000003eb,
+0x000003ea,0x000003e9,0x0004003d,0x00000035,
+0x000003ec,0x000003eb,0x0003003e,0x000003e8,
+0x000003ec,0x000200f9,0x000003be,0x000200f8,
+0x000003ed,0x0004003d,0x0000000e,0x000003f7,
+0x000003b1,0x0003003e,0x000003f8,0x000003f6,
+0x00050041,0x00000053,0x000003f9,0x000003f8,
+0x000003f7,0x0004003d,0x00000035,0x000003fa,
+0x000003f9,0x0003003e,0x000003bf,0x000003fa,
+0x0004003d,0x0000000e,0x000003fb,0x000003b5,
+0x0003003e,0x000003fc,0x000003f6,0x00050041,
+0x00000053,0x000003fd,0x000003fc,0x000003fb,
+0x0004003d,0x00000035,0x000003fe,0x000003fd,
+0x0003003e,0x000003e8,0x000003fe,0x000200f9,
+0x000003be,0x000200f8,0x000003be,0x0004003d,
+0x0000000e,0x00000400,0x00000061,0x000500c7,
+0x0000000e,0x00000401,0x00000400,0x000000f8,
+0x000500ab,0x00000010,0x00000402,0x00000401,
+0x000000d8,0x0003003e,0x000003ff,0x00000402,
+0x0004003d,0x00000037,0x00000406,0x00000403,
+0x0003003e,0x00000405,0x00000406,0x0004003d,
+0x00000006,0x00000408,0x0000036a,0x0003003e,
+0x00000407,0x00000408,0x0004003d,0x00000006,
+0x0000040a,0x00000377,0x0003003e,0x00000409,
+0x0000040a,0x0004003d,0x00000006,0x0000040c,
+0x00000384,0x0003003e,0x0000040b,0x0000040c,
+0x0004003d,0x00000035,0x0000040e,0x000003bf,
+0x0003003e,0x0000040d,0x0000040e,0x0004003d,
+0x0000000e,0x00000410,0x00000062,0x0003003e,
+0x0000040f,0x00000410,0x0003003e,0x00000411,
+0x00000404,0x0004003d,0x00000010,0x00000413,
+0x000003ff,0x0003003e,0x00000412,0x00000413,
+0x0004003d,0x00000010,0x00000415,0x00000063,
+0x0003003e,0x00000414,0x00000415,0x0004003d,
+0x00000010,0x00000417,0x0000031e,0x0003003e,
+0x00000416,0x00000417,0x000e0039,0x00000002,
+0x00000418,0x0000005f,0x00000405,0x00000407,
+0x00000409,0x0000040b,0x0000040d,0x0000040f,
+0x00000411,0x00000412,0x00000414,0x00000416,
+0x0004003d,0x00000037,0x00000419,0x00000405,
+0x0003003e,0x00000403,0x00000419,0x0004003d,
+0x00000037,0x0000041c,0x00000403,0x0003003e,
+0x0000041b,0x0000041c,0x0004003d,0x00000006,
+0x0000041e,0x0000036f,0x0003003e,0x0000041d,
+0x0000041e,0x0004003d,0x00000006,0x00000420,
+0x0000037c,0x0003003e,0x0000041f,0x00000420,
+0x0004003d,0x00000006,0x00000422,0x00000389,
+0x0003003e,0x00000421,0x00000422,0x0004003d,
+0x00000035,0x00000424,0x000003e8,0x0003003e,
+0x00000423,0x00000424,0x0004003d,0x0000000e,
+0x00000426,0x00000062,0x0003003e,0x00000425,
+0x00000426,0x0003003e,0x00000427,0x0000041a,
+0x0004003d,0x00000010,0x00000429,0x000003ff,
+0x0003003e,0x00000428,0x00000429,0x0004003d,
+0x00000010,0x0000042b,0x00000063,0x0003003e,
+0x0000042a,0x0000042b,0x0004003d,0x00000010,
+0x0000042d,0x0000031e,0x0003003e,0x0000042c,
+0x0000042d,0x000e0039,0x00000002,0x0000042e,
+0x0000005f,0x0000041b,0x0000041d,0x0000041f,
+0x00000421,0x00000423,0x00000425,0x00000427,
+0x00000428,0x0000042a,0x0000042c,0x0004003d,
+0x00000037,0x0000042f,0x0000041b,0x0003003e,
+0x00000403,0x0000042f,0x0004003d,0x00000037,
+0x00000430,0x00000403,0x000200fe,0x00000430,
+0x00010038,0x00050036,0x0000000e,0x00000068,
+0x00000000,0x00000023,0x00030037,0x0000000f,
+0x00000066,0x00030037,0x0000000f,0x00000067,
+0x000200f8,0x00000069,0x0004003b,0x0000000f,
+0x00000433,0x00000007,0x0004003b,0x0000000f,
+0x0000043d,0x00000007,0x0004003d,0x0000000e,
+0x00000434,0x00000066,0x000500c7,0x0000000e,
+0x00000436,0x00000434,0x00000435,0x000500c4,
+0x0000000e,0x00000437,0x00000436,0x0000014b,
+0x0003003e,0x00000433,0x00000437,0x0004003d,
+0x0000000e,0x00000438,0x00000066,0x000500c2,
+0x0000000e,0x00000439,0x00000438,0x0000014b,
+0x000500c7,0x0000000e,0x0000043a,0x00000439,
+0x00000435,0x0004003d,0x0000000e,0x0000043b,
+0x00000433,0x000500c5,0x0000000e,0x0000043c,
+0x0000043b,0x0000043a,0x0003003e,0x00000433,
+0x0000043c,0x0004003d,0x0000000e,0x0000043e,
+0x00000067,0x000500c7,0x0000000e,0x0000043f,
+0x0000043e,0x00000435,0x000500c4,0x0000000e,
+0x00000440,0x0000043f,0x0000014b,0x0003003e,
+0x0000043d,0x00000440,0x0004003d,0x0000000e,
+0x00000441,0x00000067,0x000500c2,0x0000000e,
+0x00000442,0x00000441,0x0000014b,0x000500c7,
+0x0000000e,0x00000443,0x00000442,0x00000435,
+0x0004003d,0x0000000e,0x00000444,0x0000043d,
+0x000500c5,0x0000000e,0x00000445,0x00000444,
+0x00000443,0x0003003e,0x0000043d,0x00000445,
+0x0004003d,0x0000000e,0x00000446,0x00000433,
+0x000500c4,0x0000000e,0x00000447,0x00000446,
+0x0000013d,0x0004003d,0x0000000e,0x00000448,
+0x0000043d,0x000500c5,0x0000000e,0x00000449,
+0x00000447,0x00000448,0x000200fe,0x00000449,
+0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_2D.inl
new file mode 100644
index 00000000000..822bee6f4a9
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_2D.inl
@@ -0,0 +1,1878 @@
+0x07230203,0x00010300,0x000d000a,0x000004ed,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x0000044c,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00070005,0x0000000b,0x50746567,
+0x4432736f,0x61727241,0x69762879,0x00003b33,
+0x00030005,0x0000000a,0x00736f70,0x00070005,
+0x00000013,0x764f7369,0x6c667265,0x6465776f,
+0x3b317528,0x003b3175,0x00040005,0x00000011,
+0x65736162,0x00000000,0x00040005,0x00000012,
+0x66666964,0x00000000,0x00060005,0x00000017,
+0x766e6f63,0x34747265,0x28386f54,0x003b3175,
+0x00030005,0x00000016,0x00000062,0x00060005,
+0x0000001a,0x766e6f63,0x35747265,0x28386f54,
+0x003b3175,0x00030005,0x00000019,0x00000062,
+0x00060005,0x0000001d,0x766e6f63,0x36747265,
+0x28386f54,0x003b3175,0x00030005,0x0000001c,
+0x00000062,0x00060005,0x00000020,0x766e6f63,
+0x37747265,0x28386f54,0x003b3175,0x00030005,
+0x0000001f,0x00000062,0x00070005,0x00000025,
+0x766e6f63,0x44747265,0x28666669,0x753b3175,
+0x00003b31,0x00040005,0x00000023,0x65736162,
+0x00000000,0x00040005,0x00000024,0x66666964,
+0x00000000,0x00050005,0x0000002a,0x616c635f,
+0x6928706d,0x00003b31,0x00030005,0x00000029,
+0x00000078,0x00050005,0x0000002d,0x616c635f,
+0x7628706d,0x003b3369,0x00030005,0x0000002c,
+0x00000078,0x000a0005,0x0000003b,0x32637465,
+0x485f545f,0x646e695f,0x76287865,0x345b3369,
+0x31753b5d,0x3b31623b,0x003b3162,0x00050005,
+0x00000037,0x54726c63,0x656c6261,0x00000000,
+0x00030005,0x00000038,0x00776f6c,0x00070005,
+0x00000039,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00040005,0x0000003a,
+0x7161706f,0x00006575,0x000b0005,0x00000042,
+0x32637465,0x6365645f,0x5f65646f,0x636f6c62,
+0x28545f6b,0x753b3175,0x31623b31,0x3b31623b,
+0x00000000,0x00040005,0x0000003e,0x68676968,
+0x00000000,0x00030005,0x0000003f,0x00776f6c,
+0x00070005,0x00000040,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00040005,
+0x00000041,0x7161706f,0x00006575,0x000b0005,
+0x00000048,0x32637465,0x6365645f,0x5f65646f,
+0x636f6c62,0x28485f6b,0x753b3175,0x31623b31,
+0x3b31623b,0x00000000,0x00040005,0x00000044,
+0x68676968,0x00000000,0x00030005,0x00000045,
+0x00776f6c,0x00070005,0x00000046,0x75507369,
+0x7468636e,0x756f7268,0x6c416867,0x00616870,
+0x00040005,0x00000047,0x7161706f,0x00006575,
+0x000a0005,0x0000004e,0x32637465,0x6365645f,
+0x5f65646f,0x636f6c62,0x28505f6b,0x753b3175,
+0x31623b31,0x0000003b,0x00040005,0x0000004b,
+0x68676968,0x00000000,0x00030005,0x0000004c,
+0x00776f6c,0x00070005,0x0000004d,0x75507369,
+0x7468636e,0x756f7268,0x6c416867,0x00616870,
+0x00100005,0x0000005d,0x6f636564,0x735f6564,
+0x6c626275,0x286b636f,0x5b346976,0x3b5d3631,
+0x693b3169,0x31693b31,0x3469763b,0x3b31753b,
+0x623b3162,0x31623b31,0x3b31623b,0x00000000,
+0x00040005,0x00000053,0x74754f70,0x00000000,
+0x00030005,0x00000054,0x00000072,0x00030005,
+0x00000055,0x00000067,0x00030005,0x00000056,
+0x00000062,0x00040005,0x00000057,0x6c626174,
+0x00000065,0x00030005,0x00000058,0x00776f6c,
+0x00040005,0x00000059,0x6f636573,0x0000646e,
+0x00040005,0x0000005a,0x70696c66,0x00646570,
+0x00070005,0x0000005b,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00040005,
+0x0000005c,0x7161706f,0x00006575,0x000a0005,
+0x00000062,0x32637465,0x6365645f,0x5f65646f,
+0x5f626772,0x636f6c62,0x3175286b,0x3b31753b,
+0x003b3162,0x00040005,0x0000005f,0x68676968,
+0x00000000,0x00030005,0x00000060,0x00776f6c,
+0x00070005,0x00000061,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00080005,
+0x00000066,0x736e6f63,0x63757274,0x6e695574,
+0x28323374,0x753b3175,0x00003b31,0x00030005,
+0x00000064,0x00363161,0x00030005,0x00000065,
+0x00363162,0x00030005,0x0000006b,0x006c6176,
+0x00050005,0x0000007f,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x0000008b,0x00000063,
+0x00030005,0x00000096,0x00000063,0x00030005,
+0x000000a0,0x00000063,0x00030005,0x000000ab,
+0x00000063,0x00050005,0x000000bc,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x000000c1,
+0x61726170,0x0000006d,0x00030005,0x000000d4,
+0x00000079,0x00030005,0x000000dd,0x00000078,
+0x00030005,0x000000e5,0x0000006b,0x00030005,
+0x000000ea,0x0062736d,0x00030005,0x000000f1,
+0x0062736c,0x00030005,0x00000103,0x00746572,
+0x00040005,0x0000010b,0x7366666f,0x00007465,
+0x00030005,0x00000122,0x00003172,0x00040005,
+0x0000012e,0x61726170,0x0000006d,0x00030005,
+0x00000131,0x00003167,0x00040005,0x00000135,
+0x61726170,0x0000006d,0x00030005,0x00000138,
+0x00003162,0x00040005,0x0000013c,0x61726170,
+0x0000006d,0x00030005,0x0000013f,0x00003272,
+0x00040005,0x00000143,0x61726170,0x0000006d,
+0x00030005,0x00000146,0x00003267,0x00040005,
+0x0000014a,0x61726170,0x0000006d,0x00030005,
+0x0000014d,0x00003262,0x00040005,0x00000150,
+0x61726170,0x0000006d,0x00050005,0x00000153,
+0x65746e69,0x4965736e,0x00007864,0x00050005,
+0x0000015c,0x65746e69,0x4d65736e,0x0000646f,
+0x00050005,0x00000163,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x00000166,0x54726c63,
+0x656c6261,0x00000000,0x00040005,0x0000016f,
+0x61726170,0x0000006d,0x00040005,0x00000174,
+0x61726170,0x0000006d,0x00040005,0x00000179,
+0x61726170,0x0000006d,0x00040005,0x00000185,
+0x61726170,0x0000006d,0x00040005,0x0000018a,
+0x61726170,0x0000006d,0x00040005,0x0000018f,
+0x61726170,0x0000006d,0x00040005,0x00000193,
+0x61726170,0x0000006d,0x00040005,0x00000195,
+0x61726170,0x0000006d,0x00040005,0x00000197,
+0x61726170,0x0000006d,0x00040005,0x00000199,
+0x61726170,0x0000006d,0x00040005,0x0000019e,
+0x31626772,0x00000000,0x00040005,0x000001a1,
+0x61726170,0x0000006d,0x00040005,0x000001ac,
+0x61726170,0x0000006d,0x00040005,0x000001b9,
+0x61726170,0x0000006d,0x00040005,0x000001bd,
+0x32626772,0x00000000,0x00040005,0x000001c0,
+0x61726170,0x0000006d,0x00040005,0x000001c7,
+0x61726170,0x0000006d,0x00040005,0x000001cd,
+0x61726170,0x0000006d,0x00050005,0x000001d1,
+0x65746e69,0x4965736e,0x00007864,0x00050005,
+0x000001f1,0x65746e69,0x4d65736e,0x0000646f,
+0x00050005,0x000001f3,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x000001f6,0x54726c63,
+0x656c6261,0x00000000,0x00040005,0x000001ff,
+0x61726170,0x0000006d,0x00040005,0x0000020a,
+0x61726170,0x0000006d,0x00040005,0x00000215,
+0x61726170,0x0000006d,0x00040005,0x00000220,
+0x61726170,0x0000006d,0x00040005,0x00000223,
+0x61726170,0x0000006d,0x00040005,0x00000225,
+0x61726170,0x0000006d,0x00040005,0x00000227,
+0x61726170,0x0000006d,0x00040005,0x00000229,
+0x61726170,0x0000006d,0x00040005,0x0000022e,
+0x6f626772,0x00000000,0x00040005,0x00000232,
+0x61726170,0x0000006d,0x00040005,0x0000023e,
+0x61726170,0x0000006d,0x00040005,0x0000024f,
+0x61726170,0x0000006d,0x00040005,0x00000253,
+0x68626772,0x00000000,0x00040005,0x0000025a,
+0x61726170,0x0000006d,0x00040005,0x00000260,
+0x61726170,0x0000006d,0x00040005,0x00000266,
+0x61726170,0x0000006d,0x00040005,0x0000026a,
+0x76626772,0x00000000,0x00040005,0x0000026e,
+0x61726170,0x0000006d,0x00040005,0x00000274,
+0x61726170,0x0000006d,0x00040005,0x00000278,
+0x61726170,0x0000006d,0x00030005,0x0000027d,
+0x00000069,0x00030005,0x00000285,0x00000079,
+0x00030005,0x00000288,0x00000078,0x00030005,
+0x0000028b,0x00746572,0x00040005,0x000002a2,
+0x61726170,0x0000006d,0x00040005,0x000002b0,
+0x65736162,0x00000058,0x00040005,0x000002b1,
+0x65736162,0x00000059,0x00030005,0x000002b9,
+0x00000069,0x00030005,0x000002c4,0x00000078,
+0x00030005,0x000002ca,0x00000079,0x00030005,
+0x000002db,0x0000006b,0x00030005,0x000002e0,
+0x0062736d,0x00030005,0x000002e6,0x0062736c,
+0x00030005,0x000002eb,0x00000071,0x00040005,
+0x000002ff,0x7366666f,0x00007465,0x00040005,
+0x00000303,0x746c6564,0x00000061,0x00040005,
+0x0000030b,0x61726170,0x0000006d,0x00040005,
+0x00000310,0x61726170,0x0000006d,0x00040005,
+0x00000315,0x61726170,0x0000006d,0x00040005,
+0x0000031b,0x7161706f,0x00006575,0x00040005,
+0x0000032a,0x73614272,0x00000065,0x00040005,
+0x0000032d,0x73614267,0x00000065,0x00040005,
+0x00000330,0x73614262,0x00000065,0x00040005,
+0x00000335,0x61726170,0x0000006d,0x00040005,
+0x00000337,0x61726170,0x0000006d,0x00040005,
+0x0000033b,0x61726170,0x0000006d,0x00040005,
+0x0000033d,0x61726170,0x0000006d,0x00040005,
+0x0000033f,0x61726170,0x0000006d,0x00040005,
+0x00000341,0x61726170,0x0000006d,0x00040005,
+0x00000347,0x61726170,0x0000006d,0x00040005,
+0x00000349,0x61726170,0x0000006d,0x00040005,
+0x0000034d,0x61726170,0x0000006d,0x00040005,
+0x0000034f,0x61726170,0x0000006d,0x00040005,
+0x00000351,0x61726170,0x0000006d,0x00040005,
+0x00000353,0x61726170,0x0000006d,0x00040005,
+0x00000359,0x61726170,0x0000006d,0x00040005,
+0x0000035b,0x61726170,0x0000006d,0x00040005,
+0x0000035f,0x61726170,0x0000006d,0x00040005,
+0x00000361,0x61726170,0x0000006d,0x00040005,
+0x00000363,0x61726170,0x0000006d,0x00030005,
+0x00000367,0x00003172,0x00040005,0x00000368,
+0x61726170,0x0000006d,0x00030005,0x0000036c,
+0x00003272,0x00040005,0x0000036f,0x61726170,
+0x0000006d,0x00040005,0x00000371,0x61726170,
+0x0000006d,0x00030005,0x00000374,0x00003167,
+0x00040005,0x00000375,0x61726170,0x0000006d,
+0x00030005,0x00000379,0x00003267,0x00040005,
+0x0000037c,0x61726170,0x0000006d,0x00040005,
+0x0000037e,0x61726170,0x0000006d,0x00030005,
+0x00000381,0x00003162,0x00040005,0x00000382,
+0x61726170,0x0000006d,0x00030005,0x00000386,
+0x00003262,0x00040005,0x00000389,0x61726170,
+0x0000006d,0x00040005,0x0000038b,0x61726170,
+0x0000006d,0x00040005,0x00000392,0x61726170,
+0x0000006d,0x00040005,0x00000397,0x61726170,
+0x0000006d,0x00040005,0x0000039c,0x61726170,
+0x0000006d,0x00040005,0x000003a1,0x61726170,
+0x0000006d,0x00040005,0x000003a6,0x61726170,
+0x0000006d,0x00040005,0x000003ab,0x61726170,
+0x0000006d,0x00050005,0x000003ae,0x6c626174,
+0x646e4965,0x00417865,0x00050005,0x000003b2,
+0x6c626174,0x646e4965,0x00427865,0x00040005,
+0x000003bc,0x6c626174,0x00004165,0x00050005,
+0x000003e2,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x000003e5,0x6c626174,0x00004265,
+0x00050005,0x000003e7,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x000003f5,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x000003f9,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x000003fc,0x70696c66,0x00646570,0x00030005,
+0x00000400,0x00746572,0x00040005,0x00000402,
+0x61726170,0x0000006d,0x00040005,0x00000404,
+0x61726170,0x0000006d,0x00040005,0x00000406,
+0x61726170,0x0000006d,0x00040005,0x00000408,
+0x61726170,0x0000006d,0x00040005,0x0000040a,
+0x61726170,0x0000006d,0x00040005,0x0000040c,
+0x61726170,0x0000006d,0x00040005,0x0000040e,
+0x61726170,0x0000006d,0x00040005,0x0000040f,
+0x61726170,0x0000006d,0x00040005,0x00000411,
+0x61726170,0x0000006d,0x00040005,0x00000413,
+0x61726170,0x0000006d,0x00040005,0x00000418,
+0x61726170,0x0000006d,0x00040005,0x0000041a,
+0x61726170,0x0000006d,0x00040005,0x0000041c,
+0x61726170,0x0000006d,0x00040005,0x0000041e,
+0x61726170,0x0000006d,0x00040005,0x00000420,
+0x61726170,0x0000006d,0x00040005,0x00000422,
+0x61726170,0x0000006d,0x00040005,0x00000424,
+0x61726170,0x0000006d,0x00040005,0x00000425,
+0x61726170,0x0000006d,0x00040005,0x00000427,
+0x61726170,0x0000006d,0x00040005,0x00000429,
+0x61726170,0x0000006d,0x00030005,0x00000430,
+0x00003261,0x00030005,0x0000043a,0x00003262,
+0x00030005,0x00000449,0x00736f70,0x00080005,
+0x0000044c,0x475f6c67,0x61626f6c,0x766e496c,
+0x7461636f,0x496e6f69,0x00000044,0x00070005,
+0x0000044f,0x67616d49,0x726f4665,0x4274616d,
+0x6b636f6c,0x00000000,0x00060006,0x0000044f,
+0x00000000,0x706d6f63,0x6d726f46,0x00007461,
+0x00060006,0x0000044f,0x00000001,0x65736162,
+0x6579614c,0x00000072,0x00060005,0x00000451,
+0x75705f75,0x6f436873,0x6174736e,0x0000746e,
+0x00050005,0x0000045a,0x42637273,0x6b636f6c,
+0x00000000,0x00050005,0x0000045d,0x6d695f75,
+0x30656761,0x00000000,0x00040005,0x0000045f,
+0x61726170,0x0000006d,0x00070005,0x00000465,
+0x75507369,0x7468636e,0x756f7268,0x6c416867,
+0x00616870,0x00060005,0x00000472,0x6f636564,
+0x6572706d,0x64657373,0x00000000,0x00040005,
+0x00000479,0x61726170,0x0000006d,0x00040005,
+0x0000047a,0x61726170,0x0000006d,0x00040005,
+0x00000482,0x61726170,0x0000006d,0x00040005,
+0x00000483,0x61726170,0x0000006d,0x00040005,
+0x00000485,0x61726170,0x0000006d,0x00040005,
+0x00000486,0x61726170,0x0000006d,0x00040005,
+0x00000487,0x61726170,0x0000006d,0x00030005,
+0x0000048a,0x00000079,0x00030005,0x00000492,
+0x00000078,0x00050005,0x0000049c,0x6d695f75,
+0x31656761,0x00000000,0x00040005,0x000004ac,
+0x61726170,0x0000006d,0x00040047,0x0000044c,
+0x0000000b,0x0000001c,0x00050048,0x0000044f,
+0x00000000,0x00000023,0x00000000,0x00050048,
+0x0000044f,0x00000001,0x00000023,0x00000004,
+0x00030047,0x0000044f,0x00000002,0x00040047,
+0x0000045d,0x00000022,0x00000000,0x00040047,
+0x0000045d,0x00000021,0x00000000,0x00030047,
+0x0000045d,0x00000018,0x00040047,0x0000049c,
+0x00000022,0x00000000,0x00040047,0x0000049c,
+0x00000021,0x00000001,0x00030047,0x0000049c,
+0x00000019,0x00040047,0x000004ec,0x0000000b,
+0x00000019,0x00020013,0x00000002,0x00030021,
+0x00000003,0x00000002,0x00040015,0x00000006,
+0x00000020,0x00000001,0x00040017,0x00000007,
+0x00000006,0x00000003,0x00040020,0x00000008,
+0x00000007,0x00000007,0x00040021,0x00000009,
+0x00000007,0x00000008,0x00040015,0x0000000d,
+0x00000020,0x00000000,0x00040020,0x0000000e,
+0x00000007,0x0000000d,0x00020014,0x0000000f,
+0x00050021,0x00000010,0x0000000f,0x0000000e,
+0x0000000e,0x00040021,0x00000015,0x0000000d,
+0x0000000e,0x00050021,0x00000022,0x0000000d,
+0x0000000e,0x0000000e,0x00040020,0x00000027,
+0x00000007,0x00000006,0x00040021,0x00000028,
+0x00000006,0x00000027,0x0004002b,0x0000000d,
+0x0000002f,0x00000004,0x0004001c,0x00000030,
+0x00000007,0x0000002f,0x00040020,0x00000031,
+0x00000007,0x00000030,0x00040020,0x00000032,
+0x00000007,0x0000000f,0x00040017,0x00000033,
+0x00000006,0x00000004,0x0004002b,0x0000000d,
+0x00000034,0x00000010,0x0004001c,0x00000035,
+0x00000033,0x00000034,0x00070021,0x00000036,
+0x00000035,0x00000031,0x0000000e,0x00000032,
+0x00000032,0x00070021,0x0000003d,0x00000035,
+0x0000000e,0x0000000e,0x00000032,0x00000032,
+0x00060021,0x0000004a,0x00000035,0x0000000e,
+0x0000000e,0x00000032,0x00040020,0x00000050,
+0x00000007,0x00000035,0x00040020,0x00000051,
+0x00000007,0x00000033,0x000d0021,0x00000052,
+0x00000002,0x00000050,0x00000027,0x00000027,
+0x00000027,0x00000051,0x0000000e,0x00000032,
+0x00000032,0x00000032,0x00000032,0x0004002b,
+0x0000000d,0x0000006c,0x0000001f,0x0004002b,
+0x0000000d,0x00000070,0x00000008,0x0004001c,
+0x00000071,0x00000006,0x00000070,0x0004002b,
+0x00000006,0x00000072,0x00000000,0x0004002b,
+0x00000006,0x00000073,0x00000001,0x0004002b,
+0x00000006,0x00000074,0x00000002,0x0004002b,
+0x00000006,0x00000075,0x00000003,0x0004002b,
+0x00000006,0x00000076,0xfffffffc,0x0004002b,
+0x00000006,0x00000077,0xfffffffd,0x0004002b,
+0x00000006,0x00000078,0xfffffffe,0x0004002b,
+0x00000006,0x00000079,0xffffffff,0x000b002c,
+0x00000071,0x0000007a,0x00000072,0x00000073,
+0x00000074,0x00000075,0x00000076,0x00000077,
+0x00000078,0x00000079,0x0004002b,0x0000000d,
+0x0000007b,0x00000007,0x00040020,0x0000007e,
+0x00000007,0x00000071,0x0004002b,0x00000006,
+0x00000086,0x00000020,0x0004002b,0x0000000d,
+0x0000008d,0x0000000f,0x0004002b,0x00000006,
+0x00000090,0x00000004,0x0004002b,0x0000000d,
+0x000000a2,0x0000003f,0x0004002b,0x0000000d,
+0x000000ad,0x0000007f,0x0004002b,0x00000006,
+0x000000b2,0x00000006,0x0004002b,0x00000006,
+0x000000c6,0x000000ff,0x0004002b,0x0000000d,
+0x000000d5,0x00000000,0x0004002b,0x0000000d,
+0x000000ef,0x00000002,0x0004002b,0x0000000d,
+0x000000f5,0x00000001,0x0007002c,0x00000033,
+0x00000108,0x00000072,0x00000072,0x00000072,
+0x00000072,0x0004002b,0x00000006,0x00000124,
+0x0000001b,0x0004002b,0x0000000d,0x00000126,
+0x00000003,0x0004002b,0x00000006,0x0000012a,
+0x00000018,0x0004002b,0x00000006,0x00000133,
+0x00000014,0x0004002b,0x00000006,0x0000013a,
+0x00000010,0x0004002b,0x00000006,0x00000141,
+0x0000000c,0x0004002b,0x00000006,0x00000148,
+0x00000008,0x0004002b,0x00000006,0x0000015d,
+0x0000000b,0x0004002b,0x00000006,0x0000015e,
+0x00000017,0x0004002b,0x00000006,0x0000015f,
+0x00000029,0x0004002b,0x00000006,0x00000160,
+0x00000040,0x000b002c,0x00000071,0x00000161,
+0x00000075,0x000000b2,0x0000015d,0x0000013a,
+0x0000015e,0x00000086,0x0000015f,0x00000160,
+0x0004002b,0x00000006,0x000001b1,0x00000013,
+0x0004002b,0x00000006,0x000001b5,0x0000000f,
+0x0004002b,0x00000006,0x000001c5,0x00000007,
+0x0004002b,0x00000006,0x00000230,0x00000019,
+0x0004002b,0x00000006,0x0000023a,0x00000011,
+0x0004002b,0x00000006,0x00000244,0x00000005,
+0x0004002b,0x00000006,0x0000026c,0x0000000d,
+0x0004002b,0x00000006,0x00000390,0x0000001c,
+0x0004001c,0x000003bd,0x00000033,0x00000070,
+0x0004002b,0x00000006,0x000003be,0xfffffff8,
+0x0007002c,0x00000033,0x000003bf,0x00000074,
+0x00000148,0x00000078,0x000003be,0x0004002b,
+0x00000006,0x000003c0,0xfffffffb,0x0004002b,
+0x00000006,0x000003c1,0xffffffef,0x0007002c,
+0x00000033,0x000003c2,0x00000244,0x0000023a,
+0x000003c0,0x000003c1,0x0004002b,0x00000006,
+0x000003c3,0x00000009,0x0004002b,0x00000006,
+0x000003c4,0x0000001d,0x0004002b,0x00000006,
+0x000003c5,0xfffffff7,0x0004002b,0x00000006,
+0x000003c6,0xffffffe3,0x0007002c,0x00000033,
+0x000003c7,0x000003c3,0x000003c4,0x000003c5,
+0x000003c6,0x0004002b,0x00000006,0x000003c8,
+0x0000002a,0x0004002b,0x00000006,0x000003c9,
+0xfffffff3,0x0004002b,0x00000006,0x000003ca,
+0xffffffd6,0x0007002c,0x00000033,0x000003cb,
+0x0000026c,0x000003c8,0x000003c9,0x000003ca,
+0x0004002b,0x00000006,0x000003cc,0x00000012,
+0x0004002b,0x00000006,0x000003cd,0x0000003c,
+0x0004002b,0x00000006,0x000003ce,0xffffffee,
+0x0004002b,0x00000006,0x000003cf,0xffffffc4,
+0x0007002c,0x00000033,0x000003d0,0x000003cc,
+0x000003cd,0x000003ce,0x000003cf,0x0004002b,
+0x00000006,0x000003d1,0x00000050,0x0004002b,
+0x00000006,0x000003d2,0xffffffe8,0x0004002b,
+0x00000006,0x000003d3,0xffffffb0,0x0007002c,
+0x00000033,0x000003d4,0x0000012a,0x000003d1,
+0x000003d2,0x000003d3,0x0004002b,0x00000006,
+0x000003d5,0x00000021,0x0004002b,0x00000006,
+0x000003d6,0x0000006a,0x0004002b,0x00000006,
+0x000003d7,0xffffffdf,0x0004002b,0x00000006,
+0x000003d8,0xffffff96,0x0007002c,0x00000033,
+0x000003d9,0x000003d5,0x000003d6,0x000003d7,
+0x000003d8,0x0004002b,0x00000006,0x000003da,
+0x0000002f,0x0004002b,0x00000006,0x000003db,
+0x000000b7,0x0004002b,0x00000006,0x000003dc,
+0xffffffd1,0x0004002b,0x00000006,0x000003dd,
+0xffffff49,0x0007002c,0x00000033,0x000003de,
+0x000003da,0x000003db,0x000003dc,0x000003dd,
+0x000b002c,0x000003bd,0x000003df,0x000003bf,
+0x000003c2,0x000003c7,0x000003cb,0x000003d0,
+0x000003d4,0x000003d9,0x000003de,0x00040020,
+0x000003e1,0x00000007,0x000003bd,0x0007002c,
+0x00000033,0x000003eb,0x00000072,0x00000148,
+0x00000072,0x000003be,0x0007002c,0x00000033,
+0x000003ec,0x00000072,0x0000023a,0x00000072,
+0x000003c1,0x0007002c,0x00000033,0x000003ed,
+0x00000072,0x000003c4,0x00000072,0x000003c6,
+0x0007002c,0x00000033,0x000003ee,0x00000072,
+0x000003c8,0x00000072,0x000003ca,0x0007002c,
+0x00000033,0x000003ef,0x00000072,0x000003cd,
+0x00000072,0x000003cf,0x0007002c,0x00000033,
+0x000003f0,0x00000072,0x000003d1,0x00000072,
+0x000003d3,0x0007002c,0x00000033,0x000003f1,
+0x00000072,0x000003d6,0x00000072,0x000003d8,
+0x0007002c,0x00000033,0x000003f2,0x00000072,
+0x000003db,0x00000072,0x000003dd,0x000b002c,
+0x000003bd,0x000003f3,0x000003eb,0x000003ec,
+0x000003ed,0x000003ee,0x000003ef,0x000003f0,
+0x000003f1,0x000003f2,0x0003002a,0x0000000f,
+0x00000401,0x00030029,0x0000000f,0x00000417,
+0x0004002b,0x0000000d,0x00000432,0x000000ff,
+0x00040017,0x0000044a,0x0000000d,0x00000003,
+0x00040020,0x0000044b,0x00000001,0x0000044a,
+0x0004003b,0x0000044b,0x0000044c,0x00000001,
+0x0004001e,0x0000044f,0x0000000d,0x0000000d,
+0x00040020,0x00000450,0x00000009,0x0000044f,
+0x0004003b,0x00000450,0x00000451,0x00000009,
+0x00040020,0x00000452,0x00000009,0x0000000d,
+0x00090019,0x0000045b,0x0000000d,0x00000001,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x0000001f,0x00040020,0x0000045c,0x00000000,
+0x0000045b,0x0004003b,0x0000045c,0x0000045d,
+0x00000000,0x00040017,0x00000462,0x0000000d,
+0x00000004,0x0004002b,0x0000000d,0x00000468,
+0x00000095,0x0004002b,0x0000000d,0x0000046f,
+0x00000096,0x00090019,0x0000049a,0x0000000d,
+0x00000001,0x00000000,0x00000001,0x00000000,
+0x00000002,0x00000020,0x00040020,0x0000049b,
+0x00000000,0x0000049a,0x0004003b,0x0000049b,
+0x0000049c,0x00000000,0x00040017,0x0000049e,
+0x00000006,0x00000002,0x0004002b,0x0000000d,
+0x000004b9,0x00000093,0x0004002b,0x0000000d,
+0x000004ba,0x00000094,0x0004002b,0x0000000d,
+0x000004bb,0x00000097,0x0004002b,0x0000000d,
+0x000004bc,0x00000098,0x0004002b,0x0000000d,
+0x000004bd,0x00000099,0x0004002b,0x0000000d,
+0x000004be,0x0000009a,0x0004002b,0x0000000d,
+0x000004bf,0x0000009b,0x0004002b,0x0000000d,
+0x000004c0,0x0000009c,0x0004002b,0x0000000d,
+0x000004c1,0x00000020,0x0004001c,0x000004c2,
+0x00000033,0x000004c1,0x0004002b,0x00000006,
+0x000004c3,0xfffffffa,0x0004002b,0x00000006,
+0x000004c4,0xfffffff1,0x0007002c,0x00000033,
+0x000004c5,0x00000077,0x000004c3,0x000003c5,
+0x000004c4,0x0004002b,0x00000006,0x000004c6,
+0x0000000e,0x0007002c,0x00000033,0x000004c7,
+0x00000074,0x00000244,0x00000148,0x000004c6,
+0x0004002b,0x00000006,0x000004c8,0xfffffff9,
+0x0004002b,0x00000006,0x000004c9,0xfffffff6,
+0x0007002c,0x00000033,0x000004ca,0x00000077,
+0x000004c8,0x000004c9,0x000003c9,0x0007002c,
+0x00000033,0x000004cb,0x00000074,0x000000b2,
+0x000003c3,0x00000141,0x0007002c,0x00000033,
+0x000004cc,0x00000078,0x000003c0,0x000003be,
+0x000003c9,0x0007002c,0x00000033,0x000004cd,
+0x00000073,0x00000090,0x000001c5,0x00000141,
+0x0007002c,0x00000033,0x000004ce,0x00000078,
+0x00000076,0x000004c3,0x000003c9,0x0007002c,
+0x00000033,0x000004cf,0x00000073,0x00000075,
+0x00000244,0x00000141,0x0004002b,0x00000006,
+0x000004d0,0xfffffff4,0x0007002c,0x00000033,
+0x000004d1,0x00000077,0x000004c3,0x000003be,
+0x000004d0,0x0007002c,0x00000033,0x000004d2,
+0x00000074,0x00000244,0x000001c5,0x0000015d,
+0x0004002b,0x00000006,0x000004d3,0xfffffff5,
+0x0007002c,0x00000033,0x000004d4,0x00000077,
+0x000004c8,0x000003c5,0x000004d3,0x0004002b,
+0x00000006,0x000004d5,0x0000000a,0x0007002c,
+0x00000033,0x000004d6,0x00000074,0x000000b2,
+0x00000148,0x000004d5,0x0007002c,0x00000033,
+0x000004d7,0x00000076,0x000004c8,0x000003be,
+0x000004d3,0x0007002c,0x00000033,0x000004d8,
+0x00000075,0x000000b2,0x000001c5,0x000004d5,
+0x0007002c,0x00000033,0x000004d9,0x00000077,
+0x000003c0,0x000003be,0x000004d3,0x0007002c,
+0x00000033,0x000004da,0x00000074,0x00000090,
+0x000001c5,0x000004d5,0x0007002c,0x00000033,
+0x000004db,0x00000078,0x000004c3,0x000003be,
+0x000004c9,0x0007002c,0x00000033,0x000004dc,
+0x00000073,0x00000244,0x000001c5,0x000003c3,
+0x0007002c,0x00000033,0x000004dd,0x00000078,
+0x000003c0,0x000003be,0x000004c9,0x0007002c,
+0x00000033,0x000004de,0x00000073,0x00000090,
+0x000001c5,0x000003c3,0x0007002c,0x00000033,
+0x000004df,0x00000078,0x00000076,0x000003be,
+0x000004c9,0x0007002c,0x00000033,0x000004e0,
+0x00000073,0x00000075,0x000001c5,0x000003c3,
+0x0007002c,0x00000033,0x000004e1,0x00000078,
+0x000003c0,0x000004c8,0x000004c9,0x0007002c,
+0x00000033,0x000004e2,0x00000073,0x00000090,
+0x000000b2,0x000003c3,0x0007002c,0x00000033,
+0x000004e3,0x00000077,0x00000076,0x000004c8,
+0x000004c9,0x0007002c,0x00000033,0x000004e4,
+0x00000074,0x00000075,0x000000b2,0x000003c3,
+0x0007002c,0x00000033,0x000004e5,0x00000079,
+0x00000078,0x00000077,0x000004c9,0x0007002c,
+0x00000033,0x000004e6,0x00000072,0x00000073,
+0x00000074,0x000003c3,0x0007002c,0x00000033,
+0x000004e7,0x00000076,0x000004c3,0x000003be,
+0x000003c5,0x0007002c,0x00000033,0x000004e8,
+0x00000075,0x00000244,0x000001c5,0x00000148,
+0x0007002c,0x00000033,0x000004e9,0x00000077,
+0x000003c0,0x000004c8,0x000003c5,0x0007002c,
+0x00000033,0x000004ea,0x00000074,0x00000090,
+0x000000b2,0x00000148,0x0023002c,0x000004c2,
+0x000004eb,0x000004c5,0x000004c7,0x000004ca,
+0x000004cb,0x000004cc,0x000004cd,0x000004ce,
+0x000004cf,0x000004d1,0x000004d2,0x000004d4,
+0x000004d6,0x000004d7,0x000004d8,0x000004d9,
+0x000004da,0x000004db,0x000004dc,0x000004dd,
+0x000004de,0x000004df,0x000004e0,0x000004e1,
+0x000004e2,0x000004e3,0x000004e4,0x000004e5,
+0x000004e6,0x000004e7,0x000004e8,0x000004e9,
+0x000004ea,0x0006002c,0x0000044a,0x000004ec,
+0x00000070,0x00000070,0x000000f5,0x00050036,
+0x00000002,0x00000004,0x00000000,0x00000003,
+0x000200f8,0x00000005,0x0004003b,0x00000008,
+0x00000449,0x00000007,0x0004003b,0x00000051,
+0x0000045a,0x00000007,0x0004003b,0x00000008,
+0x0000045f,0x00000007,0x0004003b,0x00000032,
+0x00000465,0x00000007,0x0004003b,0x00000050,
+0x00000472,0x00000007,0x0004003b,0x0000000e,
+0x00000479,0x00000007,0x0004003b,0x0000000e,
+0x0000047a,0x00000007,0x0004003b,0x0000000e,
+0x00000482,0x00000007,0x0004003b,0x0000000e,
+0x00000483,0x00000007,0x0004003b,0x0000000e,
+0x00000485,0x00000007,0x0004003b,0x0000000e,
+0x00000486,0x00000007,0x0004003b,0x00000032,
+0x00000487,0x00000007,0x0004003b,0x00000027,
+0x0000048a,0x00000007,0x0004003b,0x00000027,
+0x00000492,0x00000007,0x0004003b,0x00000008,
+0x000004ac,0x00000007,0x0004003d,0x0000044a,
+0x0000044d,0x0000044c,0x0004007c,0x00000007,
+0x0000044e,0x0000044d,0x0003003e,0x00000449,
+0x0000044e,0x00050041,0x00000452,0x00000453,
+0x00000451,0x00000073,0x0004003d,0x0000000d,
+0x00000454,0x00000453,0x0004007c,0x00000006,
+0x00000455,0x00000454,0x00050041,0x00000027,
+0x00000456,0x00000449,0x000000ef,0x0004003d,
+0x00000006,0x00000457,0x00000456,0x00050080,
+0x00000006,0x00000458,0x00000457,0x00000455,
+0x00050041,0x00000027,0x00000459,0x00000449,
+0x000000ef,0x0003003e,0x00000459,0x00000458,
+0x0004003d,0x0000045b,0x0000045e,0x0000045d,
+0x0004003d,0x00000007,0x00000460,0x00000449,
+0x0003003e,0x0000045f,0x00000460,0x00050039,
+0x00000007,0x00000461,0x0000000b,0x0000045f,
+0x00050062,0x00000462,0x00000463,0x0000045e,
+0x00000461,0x0004007c,0x00000033,0x00000464,
+0x00000463,0x0003003e,0x0000045a,0x00000464,
+0x00050041,0x00000452,0x00000466,0x00000451,
+0x00000072,0x0004003d,0x0000000d,0x00000467,
+0x00000466,0x000500aa,0x0000000f,0x00000469,
+0x00000467,0x00000468,0x000400a8,0x0000000f,
+0x0000046a,0x00000469,0x000300f7,0x0000046c,
+0x00000000,0x000400fa,0x0000046a,0x0000046b,
+0x0000046c,0x000200f8,0x0000046b,0x00050041,
+0x00000452,0x0000046d,0x00000451,0x00000072,
+0x0004003d,0x0000000d,0x0000046e,0x0000046d,
+0x000500aa,0x0000000f,0x00000470,0x0000046e,
+0x0000046f,0x000200f9,0x0000046c,0x000200f8,
+0x0000046c,0x000700f5,0x0000000f,0x00000471,
+0x00000469,0x00000005,0x00000470,0x0000046b,
+0x0003003e,0x00000465,0x00000471,0x00050041,
+0x00000027,0x00000473,0x0000045a,0x000000d5,
+0x0004003d,0x00000006,0x00000474,0x00000473,
+0x0004007c,0x0000000d,0x00000475,0x00000474,
+0x00050041,0x00000027,0x00000476,0x0000045a,
+0x000000f5,0x0004003d,0x00000006,0x00000477,
+0x00000476,0x0004007c,0x0000000d,0x00000478,
+0x00000477,0x0003003e,0x00000479,0x00000475,
+0x0003003e,0x0000047a,0x00000478,0x00060039,
+0x0000000d,0x0000047b,0x00000066,0x00000479,
+0x0000047a,0x00050041,0x00000027,0x0000047c,
+0x0000045a,0x000000ef,0x0004003d,0x00000006,
+0x0000047d,0x0000047c,0x0004007c,0x0000000d,
+0x0000047e,0x0000047d,0x00050041,0x00000027,
+0x0000047f,0x0000045a,0x00000126,0x0004003d,
+0x00000006,0x00000480,0x0000047f,0x0004007c,
+0x0000000d,0x00000481,0x00000480,0x0003003e,
+0x00000482,0x0000047e,0x0003003e,0x00000483,
+0x00000481,0x00060039,0x0000000d,0x00000484,
+0x00000066,0x00000482,0x00000483,0x0003003e,
+0x00000485,0x0000047b,0x0003003e,0x00000486,
+0x00000484,0x0004003d,0x0000000f,0x00000488,
+0x00000465,0x0003003e,0x00000487,0x00000488,
+0x00070039,0x00000035,0x00000489,0x00000062,
+0x00000485,0x00000486,0x00000487,0x0003003e,
+0x00000472,0x00000489,0x0003003e,0x0000048a,
+0x00000072,0x000200f9,0x0000048b,0x000200f8,
+0x0000048b,0x000400f6,0x0000048d,0x0000048e,
+0x00000000,0x000200f9,0x0000048f,0x000200f8,
+0x0000048f,0x0004003d,0x00000006,0x00000490,
+0x0000048a,0x000500b1,0x0000000f,0x00000491,
+0x00000490,0x00000090,0x000400fa,0x00000491,
+0x0000048c,0x0000048d,0x000200f8,0x0000048c,
+0x0003003e,0x00000492,0x00000072,0x000200f9,
+0x00000493,0x000200f8,0x00000493,0x000400f6,
+0x00000495,0x00000496,0x00000000,0x000200f9,
+0x00000497,0x000200f8,0x00000497,0x0004003d,
+0x00000006,0x00000498,0x00000492,0x000500b1,
+0x0000000f,0x00000499,0x00000498,0x00000090,
+0x000400fa,0x00000499,0x00000494,0x00000495,
+0x000200f8,0x00000494,0x0004003d,0x0000049a,
+0x0000049d,0x0000049c,0x0004003d,0x00000007,
+0x0000049f,0x00000449,0x0007004f,0x0000049e,
+0x000004a0,0x0000049f,0x0000049f,0x00000000,
+0x00000001,0x00050050,0x0000049e,0x000004a1,
+0x00000090,0x00000090,0x00050084,0x0000049e,
+0x000004a2,0x000004a0,0x000004a1,0x0004003d,
+0x00000006,0x000004a3,0x00000492,0x0004003d,
+0x00000006,0x000004a4,0x0000048a,0x00050050,
+0x0000049e,0x000004a5,0x000004a3,0x000004a4,
+0x00050080,0x0000049e,0x000004a6,0x000004a2,
+0x000004a5,0x00050041,0x00000027,0x000004a7,
+0x00000449,0x000000ef,0x0004003d,0x00000006,
+0x000004a8,0x000004a7,0x00050051,0x00000006,
+0x000004a9,0x000004a6,0x00000000,0x00050051,
+0x00000006,0x000004aa,0x000004a6,0x00000001,
+0x00060050,0x00000007,0x000004ab,0x000004a9,
+0x000004aa,0x000004a8,0x0003003e,0x000004ac,
+0x000004ab,0x00050039,0x00000007,0x000004ad,
+0x0000000b,0x000004ac,0x0004003d,0x00000006,
+0x000004ae,0x0000048a,0x00050084,0x00000006,
+0x000004af,0x000004ae,0x00000090,0x0004003d,
+0x00000006,0x000004b0,0x00000492,0x00050080,
+0x00000006,0x000004b1,0x000004af,0x000004b0,
+0x00050041,0x00000051,0x000004b2,0x00000472,
+0x000004b1,0x0004003d,0x00000033,0x000004b3,
+0x000004b2,0x0004007c,0x00000462,0x000004b4,
+0x000004b3,0x00040063,0x0000049d,0x000004ad,
+0x000004b4,0x000200f9,0x00000496,0x000200f8,
+0x00000496,0x0004003d,0x00000006,0x000004b5,
+0x00000492,0x00050080,0x00000006,0x000004b6,
+0x000004b5,0x00000073,0x0003003e,0x00000492,
+0x000004b6,0x000200f9,0x00000493,0x000200f8,
+0x00000495,0x000200f9,0x0000048e,0x000200f8,
+0x0000048e,0x0004003d,0x00000006,0x000004b7,
+0x0000048a,0x00050080,0x00000006,0x000004b8,
+0x000004b7,0x00000073,0x0003003e,0x0000048a,
+0x000004b8,0x000200f9,0x0000048b,0x000200f8,
+0x0000048d,0x000100fd,0x00010038,0x00050036,
+0x00000007,0x0000000b,0x00000000,0x00000009,
+0x00030037,0x00000008,0x0000000a,0x000200f8,
+0x0000000c,0x0004003d,0x00000007,0x00000068,
+0x0000000a,0x000200fe,0x00000068,0x00010038,
+0x00050036,0x0000000f,0x00000013,0x00000000,
+0x00000010,0x00030037,0x0000000e,0x00000011,
+0x00030037,0x0000000e,0x00000012,0x000200f8,
+0x00000014,0x0004003b,0x00000027,0x0000006b,
+0x00000007,0x0004003b,0x0000007e,0x0000007f,
+0x00000007,0x0004003d,0x0000000d,0x0000006d,
+0x00000011,0x000500c7,0x0000000d,0x0000006e,
+0x0000006c,0x0000006d,0x0004007c,0x00000006,
+0x0000006f,0x0000006e,0x0004003d,0x0000000d,
+0x0000007c,0x00000012,0x000500c7,0x0000000d,
+0x0000007d,0x0000007b,0x0000007c,0x0003003e,
+0x0000007f,0x0000007a,0x00050041,0x00000027,
+0x00000080,0x0000007f,0x0000007d,0x0004003d,
+0x00000006,0x00000081,0x00000080,0x00050080,
+0x00000006,0x00000082,0x0000006f,0x00000081,
+0x0003003e,0x0000006b,0x00000082,0x0004003d,
+0x00000006,0x00000083,0x0000006b,0x000500b1,
+0x0000000f,0x00000084,0x00000083,0x00000072,
+0x0004003d,0x00000006,0x00000085,0x0000006b,
+0x000500af,0x0000000f,0x00000087,0x00000085,
+0x00000086,0x000500a6,0x0000000f,0x00000088,
+0x00000084,0x00000087,0x000200fe,0x00000088,
+0x00010038,0x00050036,0x0000000d,0x00000017,
+0x00000000,0x00000015,0x00030037,0x0000000e,
+0x00000016,0x000200f8,0x00000018,0x0004003b,
+0x0000000e,0x0000008b,0x00000007,0x0004003d,
+0x0000000d,0x0000008c,0x00000016,0x000500c7,
+0x0000000d,0x0000008e,0x0000008c,0x0000008d,
+0x0003003e,0x0000008b,0x0000008e,0x0004003d,
+0x0000000d,0x0000008f,0x0000008b,0x000500c4,
+0x0000000d,0x00000091,0x0000008f,0x00000090,
+0x0004003d,0x0000000d,0x00000092,0x0000008b,
+0x000500c5,0x0000000d,0x00000093,0x00000091,
+0x00000092,0x000200fe,0x00000093,0x00010038,
+0x00050036,0x0000000d,0x0000001a,0x00000000,
+0x00000015,0x00030037,0x0000000e,0x00000019,
+0x000200f8,0x0000001b,0x0004003b,0x0000000e,
+0x00000096,0x00000007,0x0004003d,0x0000000d,
+0x00000097,0x00000019,0x000500c7,0x0000000d,
+0x00000098,0x00000097,0x0000006c,0x0003003e,
+0x00000096,0x00000098,0x0004003d,0x0000000d,
+0x00000099,0x00000096,0x000500c4,0x0000000d,
+0x0000009a,0x00000099,0x00000075,0x0004003d,
+0x0000000d,0x0000009b,0x00000096,0x000500c2,
+0x0000000d,0x0000009c,0x0000009b,0x00000074,
+0x000500c5,0x0000000d,0x0000009d,0x0000009a,
+0x0000009c,0x000200fe,0x0000009d,0x00010038,
+0x00050036,0x0000000d,0x0000001d,0x00000000,
+0x00000015,0x00030037,0x0000000e,0x0000001c,
+0x000200f8,0x0000001e,0x0004003b,0x0000000e,
+0x000000a0,0x00000007,0x0004003d,0x0000000d,
+0x000000a1,0x0000001c,0x000500c7,0x0000000d,
+0x000000a3,0x000000a1,0x000000a2,0x0003003e,
+0x000000a0,0x000000a3,0x0004003d,0x0000000d,
+0x000000a4,0x000000a0,0x000500c4,0x0000000d,
+0x000000a5,0x000000a4,0x00000074,0x0004003d,
+0x0000000d,0x000000a6,0x000000a0,0x000500c2,
+0x0000000d,0x000000a7,0x000000a6,0x00000090,
+0x000500c5,0x0000000d,0x000000a8,0x000000a5,
+0x000000a7,0x000200fe,0x000000a8,0x00010038,
+0x00050036,0x0000000d,0x00000020,0x00000000,
+0x00000015,0x00030037,0x0000000e,0x0000001f,
+0x000200f8,0x00000021,0x0004003b,0x0000000e,
+0x000000ab,0x00000007,0x0004003d,0x0000000d,
+0x000000ac,0x0000001f,0x000500c7,0x0000000d,
+0x000000ae,0x000000ac,0x000000ad,0x0003003e,
+0x000000ab,0x000000ae,0x0004003d,0x0000000d,
+0x000000af,0x000000ab,0x000500c4,0x0000000d,
+0x000000b0,0x000000af,0x00000073,0x0004003d,
+0x0000000d,0x000000b1,0x000000ab,0x000500c2,
+0x0000000d,0x000000b3,0x000000b1,0x000000b2,
+0x000500c5,0x0000000d,0x000000b4,0x000000b0,
+0x000000b3,0x000200fe,0x000000b4,0x00010038,
+0x00050036,0x0000000d,0x00000025,0x00000000,
+0x00000022,0x00030037,0x0000000e,0x00000023,
+0x00030037,0x0000000e,0x00000024,0x000200f8,
+0x00000026,0x0004003b,0x0000007e,0x000000bc,
+0x00000007,0x0004003b,0x0000000e,0x000000c1,
+0x00000007,0x0004003d,0x0000000d,0x000000b7,
+0x00000023,0x000500c7,0x0000000d,0x000000b8,
+0x0000006c,0x000000b7,0x0004007c,0x00000006,
+0x000000b9,0x000000b8,0x0004003d,0x0000000d,
+0x000000ba,0x00000024,0x000500c7,0x0000000d,
+0x000000bb,0x0000007b,0x000000ba,0x0003003e,
+0x000000bc,0x0000007a,0x00050041,0x00000027,
+0x000000bd,0x000000bc,0x000000bb,0x0004003d,
+0x00000006,0x000000be,0x000000bd,0x00050080,
+0x00000006,0x000000bf,0x000000b9,0x000000be,
+0x0004007c,0x0000000d,0x000000c0,0x000000bf,
+0x0003003e,0x000000c1,0x000000c0,0x00050039,
+0x0000000d,0x000000c2,0x0000001a,0x000000c1,
+0x000200fe,0x000000c2,0x00010038,0x00050036,
+0x00000006,0x0000002a,0x00000000,0x00000028,
+0x00030037,0x00000027,0x00000029,0x000200f8,
+0x0000002b,0x0004003d,0x00000006,0x000000c5,
+0x00000029,0x0008000c,0x00000006,0x000000c7,
+0x00000001,0x0000002d,0x000000c5,0x00000072,
+0x000000c6,0x000200fe,0x000000c7,0x00010038,
+0x00050036,0x00000007,0x0000002d,0x00000000,
+0x00000009,0x00030037,0x00000008,0x0000002c,
+0x000200f8,0x0000002e,0x0004003d,0x00000007,
+0x000000ca,0x0000002c,0x00060050,0x00000007,
+0x000000cb,0x00000072,0x00000072,0x00000072,
+0x00060050,0x00000007,0x000000cc,0x000000c6,
+0x000000c6,0x000000c6,0x0008000c,0x00000007,
+0x000000cd,0x00000001,0x0000002d,0x000000ca,
+0x000000cb,0x000000cc,0x00050051,0x00000006,
+0x000000ce,0x000000cd,0x00000000,0x00050051,
+0x00000006,0x000000cf,0x000000cd,0x00000001,
+0x00050051,0x00000006,0x000000d0,0x000000cd,
+0x00000002,0x00060050,0x00000007,0x000000d1,
+0x000000ce,0x000000cf,0x000000d0,0x000200fe,
+0x000000d1,0x00010038,0x00050036,0x00000035,
+0x0000003b,0x00000000,0x00000036,0x00030037,
+0x00000031,0x00000037,0x00030037,0x0000000e,
+0x00000038,0x00030037,0x00000032,0x00000039,
+0x00030037,0x00000032,0x0000003a,0x000200f8,
+0x0000003c,0x0004003b,0x0000000e,0x000000d4,
+0x00000007,0x0004003b,0x0000000e,0x000000dd,
+0x00000007,0x0004003b,0x0000000e,0x000000e5,
+0x00000007,0x0004003b,0x0000000e,0x000000ea,
+0x00000007,0x0004003b,0x0000000e,0x000000f1,
+0x00000007,0x0004003b,0x00000050,0x00000103,
+0x00000007,0x0004003b,0x0000000e,0x0000010b,
+0x00000007,0x0003003e,0x000000d4,0x000000d5,
+0x000200f9,0x000000d6,0x000200f8,0x000000d6,
+0x000400f6,0x000000d8,0x000000d9,0x00000000,
+0x000200f9,0x000000da,0x000200f8,0x000000da,
+0x0004003d,0x0000000d,0x000000db,0x000000d4,
+0x000500b0,0x0000000f,0x000000dc,0x000000db,
+0x0000002f,0x000400fa,0x000000dc,0x000000d7,
+0x000000d8,0x000200f8,0x000000d7,0x0003003e,
+0x000000dd,0x000000d5,0x000200f9,0x000000de,
+0x000200f8,0x000000de,0x000400f6,0x000000e0,
+0x000000e1,0x00000000,0x000200f9,0x000000e2,
+0x000200f8,0x000000e2,0x0004003d,0x0000000d,
+0x000000e3,0x000000dd,0x000500b0,0x0000000f,
+0x000000e4,0x000000e3,0x0000002f,0x000400fa,
+0x000000e4,0x000000df,0x000000e0,0x000200f8,
+0x000000df,0x0004003d,0x0000000d,0x000000e6,
+0x000000d4,0x0004003d,0x0000000d,0x000000e7,
+0x000000dd,0x00050084,0x0000000d,0x000000e8,
+0x000000e7,0x0000002f,0x00050080,0x0000000d,
+0x000000e9,0x000000e6,0x000000e8,0x0003003e,
+0x000000e5,0x000000e9,0x0004003d,0x0000000d,
+0x000000eb,0x00000038,0x0004003d,0x0000000d,
+0x000000ec,0x000000e5,0x00050080,0x0000000d,
+0x000000ed,0x000000ec,0x0000008d,0x000500c2,
+0x0000000d,0x000000ee,0x000000eb,0x000000ed,
+0x000500c7,0x0000000d,0x000000f0,0x000000ee,
+0x000000ef,0x0003003e,0x000000ea,0x000000f0,
+0x0004003d,0x0000000d,0x000000f2,0x00000038,
+0x0004003d,0x0000000d,0x000000f3,0x000000e5,
+0x000500c2,0x0000000d,0x000000f4,0x000000f2,
+0x000000f3,0x000500c7,0x0000000d,0x000000f6,
+0x000000f4,0x000000f5,0x0003003e,0x000000f1,
+0x000000f6,0x0004003d,0x0000000f,0x000000f7,
+0x00000039,0x0004003d,0x0000000f,0x000000f8,
+0x0000003a,0x000400a8,0x0000000f,0x000000f9,
+0x000000f8,0x000500a7,0x0000000f,0x000000fa,
+0x000000f7,0x000000f9,0x0004003d,0x0000000d,
+0x000000fb,0x000000ea,0x000500ab,0x0000000f,
+0x000000fc,0x000000fb,0x000000d5,0x000500a7,
+0x0000000f,0x000000fd,0x000000fa,0x000000fc,
+0x0004003d,0x0000000d,0x000000fe,0x000000f1,
+0x000500aa,0x0000000f,0x000000ff,0x000000fe,
+0x000000d5,0x000500a7,0x0000000f,0x00000100,
+0x000000fd,0x000000ff,0x000300f7,0x00000102,
+0x00000000,0x000400fa,0x00000100,0x00000101,
+0x0000010a,0x000200f8,0x00000101,0x0004003d,
+0x0000000d,0x00000104,0x000000d4,0x00050084,
+0x0000000d,0x00000105,0x00000104,0x0000002f,
+0x0004003d,0x0000000d,0x00000106,0x000000dd,
+0x00050080,0x0000000d,0x00000107,0x00000105,
+0x00000106,0x00050041,0x00000051,0x00000109,
+0x00000103,0x00000107,0x0003003e,0x00000109,
+0x00000108,0x000200f9,0x00000102,0x000200f8,
+0x0000010a,0x0004003d,0x0000000d,0x0000010c,
+0x000000f1,0x0004003d,0x0000000d,0x0000010d,
+0x000000ea,0x000500c5,0x0000000d,0x0000010e,
+0x0000010c,0x0000010d,0x0003003e,0x0000010b,
+0x0000010e,0x0004003d,0x0000000d,0x0000010f,
+0x000000d4,0x00050084,0x0000000d,0x00000110,
+0x0000010f,0x0000002f,0x0004003d,0x0000000d,
+0x00000111,0x000000dd,0x00050080,0x0000000d,
+0x00000112,0x00000110,0x00000111,0x0004003d,
+0x0000000d,0x00000113,0x0000010b,0x00050041,
+0x00000008,0x00000114,0x00000037,0x00000113,
+0x0004003d,0x00000007,0x00000115,0x00000114,
+0x00050051,0x00000006,0x00000116,0x00000115,
+0x00000000,0x00050051,0x00000006,0x00000117,
+0x00000115,0x00000001,0x00050051,0x00000006,
+0x00000118,0x00000115,0x00000002,0x00070050,
+0x00000033,0x00000119,0x00000116,0x00000117,
+0x00000118,0x000000c6,0x00050041,0x00000051,
+0x0000011a,0x00000103,0x00000112,0x0003003e,
+0x0000011a,0x00000119,0x000200f9,0x00000102,
+0x000200f8,0x00000102,0x000200f9,0x000000e1,
+0x000200f8,0x000000e1,0x0004003d,0x0000000d,
+0x0000011b,0x000000dd,0x00050080,0x0000000d,
+0x0000011c,0x0000011b,0x00000073,0x0003003e,
+0x000000dd,0x0000011c,0x000200f9,0x000000de,
+0x000200f8,0x000000e0,0x000200f9,0x000000d9,
+0x000200f8,0x000000d9,0x0004003d,0x0000000d,
+0x0000011d,0x000000d4,0x00050080,0x0000000d,
+0x0000011e,0x0000011d,0x00000073,0x0003003e,
+0x000000d4,0x0000011e,0x000200f9,0x000000d6,
+0x000200f8,0x000000d8,0x0004003d,0x00000035,
+0x0000011f,0x00000103,0x000200fe,0x0000011f,
+0x00010038,0x00050036,0x00000035,0x00000042,
+0x00000000,0x0000003d,0x00030037,0x0000000e,
+0x0000003e,0x00030037,0x0000000e,0x0000003f,
+0x00030037,0x00000032,0x00000040,0x00030037,
+0x00000032,0x00000041,0x000200f8,0x00000043,
+0x0004003b,0x00000027,0x00000122,0x00000007,
+0x0004003b,0x0000000e,0x0000012e,0x00000007,
+0x0004003b,0x00000027,0x00000131,0x00000007,
+0x0004003b,0x0000000e,0x00000135,0x00000007,
+0x0004003b,0x00000027,0x00000138,0x00000007,
+0x0004003b,0x0000000e,0x0000013c,0x00000007,
+0x0004003b,0x00000027,0x0000013f,0x00000007,
+0x0004003b,0x0000000e,0x00000143,0x00000007,
+0x0004003b,0x00000027,0x00000146,0x00000007,
+0x0004003b,0x0000000e,0x0000014a,0x00000007,
+0x0004003b,0x00000027,0x0000014d,0x00000007,
+0x0004003b,0x0000000e,0x00000150,0x00000007,
+0x0004003b,0x00000027,0x00000153,0x00000007,
+0x0004003b,0x00000027,0x0000015c,0x00000007,
+0x0004003b,0x0000007e,0x00000163,0x00000007,
+0x0004003b,0x00000031,0x00000166,0x00000007,
+0x0004003b,0x00000027,0x0000016f,0x00000007,
+0x0004003b,0x00000027,0x00000174,0x00000007,
+0x0004003b,0x00000027,0x00000179,0x00000007,
+0x0004003b,0x00000027,0x00000185,0x00000007,
+0x0004003b,0x00000027,0x0000018a,0x00000007,
+0x0004003b,0x00000027,0x0000018f,0x00000007,
+0x0004003b,0x00000031,0x00000193,0x00000007,
+0x0004003b,0x0000000e,0x00000195,0x00000007,
+0x0004003b,0x00000032,0x00000197,0x00000007,
+0x0004003b,0x00000032,0x00000199,0x00000007,
+0x0004003d,0x0000000d,0x00000123,0x0000003e,
+0x000500c2,0x0000000d,0x00000125,0x00000123,
+0x00000124,0x000500c7,0x0000000d,0x00000127,
+0x00000125,0x00000126,0x000500c4,0x0000000d,
+0x00000128,0x00000127,0x00000074,0x0004003d,
+0x0000000d,0x00000129,0x0000003e,0x000500c2,
+0x0000000d,0x0000012b,0x00000129,0x0000012a,
+0x000500c7,0x0000000d,0x0000012c,0x0000012b,
+0x00000126,0x000500c5,0x0000000d,0x0000012d,
+0x00000128,0x0000012c,0x0003003e,0x0000012e,
+0x0000012d,0x00050039,0x0000000d,0x0000012f,
+0x00000017,0x0000012e,0x0004007c,0x00000006,
+0x00000130,0x0000012f,0x0003003e,0x00000122,
+0x00000130,0x0004003d,0x0000000d,0x00000132,
+0x0000003e,0x000500c2,0x0000000d,0x00000134,
+0x00000132,0x00000133,0x0003003e,0x00000135,
+0x00000134,0x00050039,0x0000000d,0x00000136,
+0x00000017,0x00000135,0x0004007c,0x00000006,
+0x00000137,0x00000136,0x0003003e,0x00000131,
+0x00000137,0x0004003d,0x0000000d,0x00000139,
+0x0000003e,0x000500c2,0x0000000d,0x0000013b,
+0x00000139,0x0000013a,0x0003003e,0x0000013c,
+0x0000013b,0x00050039,0x0000000d,0x0000013d,
+0x00000017,0x0000013c,0x0004007c,0x00000006,
+0x0000013e,0x0000013d,0x0003003e,0x00000138,
+0x0000013e,0x0004003d,0x0000000d,0x00000140,
+0x0000003e,0x000500c2,0x0000000d,0x00000142,
+0x00000140,0x00000141,0x0003003e,0x00000143,
+0x00000142,0x00050039,0x0000000d,0x00000144,
+0x00000017,0x00000143,0x0004007c,0x00000006,
+0x00000145,0x00000144,0x0003003e,0x0000013f,
+0x00000145,0x0004003d,0x0000000d,0x00000147,
+0x0000003e,0x000500c2,0x0000000d,0x00000149,
+0x00000147,0x00000148,0x0003003e,0x0000014a,
+0x00000149,0x00050039,0x0000000d,0x0000014b,
+0x00000017,0x0000014a,0x0004007c,0x00000006,
+0x0000014c,0x0000014b,0x0003003e,0x00000146,
+0x0000014c,0x0004003d,0x0000000d,0x0000014e,
+0x0000003e,0x000500c2,0x0000000d,0x0000014f,
+0x0000014e,0x00000090,0x0003003e,0x00000150,
+0x0000014f,0x00050039,0x0000000d,0x00000151,
+0x00000017,0x00000150,0x0004007c,0x00000006,
+0x00000152,0x00000151,0x0003003e,0x0000014d,
+0x00000152,0x0004003d,0x0000000d,0x00000154,
+0x0000003e,0x000500c2,0x0000000d,0x00000155,
+0x00000154,0x00000074,0x000500c7,0x0000000d,
+0x00000156,0x00000155,0x00000126,0x000500c4,
+0x0000000d,0x00000157,0x00000156,0x00000073,
+0x0004003d,0x0000000d,0x00000158,0x0000003e,
+0x000500c7,0x0000000d,0x00000159,0x00000158,
+0x000000f5,0x000500c5,0x0000000d,0x0000015a,
+0x00000157,0x00000159,0x0004007c,0x00000006,
+0x0000015b,0x0000015a,0x0003003e,0x00000153,
+0x0000015b,0x0004003d,0x00000006,0x00000162,
+0x00000153,0x0003003e,0x00000163,0x00000161,
+0x00050041,0x00000027,0x00000164,0x00000163,
+0x00000162,0x0004003d,0x00000006,0x00000165,
+0x00000164,0x0003003e,0x0000015c,0x00000165,
+0x0004003d,0x00000006,0x00000167,0x00000122,
+0x0004003d,0x00000006,0x00000168,0x00000131,
+0x0004003d,0x00000006,0x00000169,0x00000138,
+0x00060050,0x00000007,0x0000016a,0x00000167,
+0x00000168,0x00000169,0x00050041,0x00000008,
+0x0000016b,0x00000166,0x00000072,0x0003003e,
+0x0000016b,0x0000016a,0x0004003d,0x00000006,
+0x0000016c,0x0000013f,0x0004003d,0x00000006,
+0x0000016d,0x0000015c,0x00050080,0x00000006,
+0x0000016e,0x0000016c,0x0000016d,0x0003003e,
+0x0000016f,0x0000016e,0x00050039,0x00000006,
+0x00000170,0x0000002a,0x0000016f,0x0004003d,
+0x00000006,0x00000171,0x00000146,0x0004003d,
+0x00000006,0x00000172,0x0000015c,0x00050080,
+0x00000006,0x00000173,0x00000171,0x00000172,
+0x0003003e,0x00000174,0x00000173,0x00050039,
+0x00000006,0x00000175,0x0000002a,0x00000174,
+0x0004003d,0x00000006,0x00000176,0x0000014d,
+0x0004003d,0x00000006,0x00000177,0x0000015c,
+0x00050080,0x00000006,0x00000178,0x00000176,
+0x00000177,0x0003003e,0x00000179,0x00000178,
+0x00050039,0x00000006,0x0000017a,0x0000002a,
+0x00000179,0x00060050,0x00000007,0x0000017b,
+0x00000170,0x00000175,0x0000017a,0x00050041,
+0x00000008,0x0000017c,0x00000166,0x00000073,
+0x0003003e,0x0000017c,0x0000017b,0x0004003d,
+0x00000006,0x0000017d,0x0000013f,0x0004003d,
+0x00000006,0x0000017e,0x00000146,0x0004003d,
+0x00000006,0x0000017f,0x0000014d,0x00060050,
+0x00000007,0x00000180,0x0000017d,0x0000017e,
+0x0000017f,0x00050041,0x00000008,0x00000181,
+0x00000166,0x00000074,0x0003003e,0x00000181,
+0x00000180,0x0004003d,0x00000006,0x00000182,
+0x0000013f,0x0004003d,0x00000006,0x00000183,
+0x0000015c,0x00050082,0x00000006,0x00000184,
+0x00000182,0x00000183,0x0003003e,0x00000185,
+0x00000184,0x00050039,0x00000006,0x00000186,
+0x0000002a,0x00000185,0x0004003d,0x00000006,
+0x00000187,0x00000146,0x0004003d,0x00000006,
+0x00000188,0x0000015c,0x00050082,0x00000006,
+0x00000189,0x00000187,0x00000188,0x0003003e,
+0x0000018a,0x00000189,0x00050039,0x00000006,
+0x0000018b,0x0000002a,0x0000018a,0x0004003d,
+0x00000006,0x0000018c,0x0000014d,0x0004003d,
+0x00000006,0x0000018d,0x0000015c,0x00050082,
+0x00000006,0x0000018e,0x0000018c,0x0000018d,
+0x0003003e,0x0000018f,0x0000018e,0x00050039,
+0x00000006,0x00000190,0x0000002a,0x0000018f,
+0x00060050,0x00000007,0x00000191,0x00000186,
+0x0000018b,0x00000190,0x00050041,0x00000008,
+0x00000192,0x00000166,0x00000075,0x0003003e,
+0x00000192,0x00000191,0x0004003d,0x00000030,
+0x00000194,0x00000166,0x0003003e,0x00000193,
+0x00000194,0x0004003d,0x0000000d,0x00000196,
+0x0000003f,0x0003003e,0x00000195,0x00000196,
+0x0004003d,0x0000000f,0x00000198,0x00000040,
+0x0003003e,0x00000197,0x00000198,0x0004003d,
+0x0000000f,0x0000019a,0x00000041,0x0003003e,
+0x00000199,0x0000019a,0x00080039,0x00000035,
+0x0000019b,0x0000003b,0x00000193,0x00000195,
+0x00000197,0x00000199,0x000200fe,0x0000019b,
+0x00010038,0x00050036,0x00000035,0x00000048,
+0x00000000,0x0000003d,0x00030037,0x0000000e,
+0x00000044,0x00030037,0x0000000e,0x00000045,
+0x00030037,0x00000032,0x00000046,0x00030037,
+0x00000032,0x00000047,0x000200f8,0x00000049,
+0x0004003b,0x00000008,0x0000019e,0x00000007,
+0x0004003b,0x0000000e,0x000001a1,0x00000007,
+0x0004003b,0x0000000e,0x000001ac,0x00000007,
+0x0004003b,0x0000000e,0x000001b9,0x00000007,
+0x0004003b,0x00000008,0x000001bd,0x00000007,
+0x0004003b,0x0000000e,0x000001c0,0x00000007,
+0x0004003b,0x0000000e,0x000001c7,0x00000007,
+0x0004003b,0x0000000e,0x000001cd,0x00000007,
+0x0004003b,0x0000000e,0x000001d1,0x00000007,
+0x0004003b,0x00000027,0x000001f1,0x00000007,
+0x0004003b,0x0000007e,0x000001f3,0x00000007,
+0x0004003b,0x00000031,0x000001f6,0x00000007,
+0x0004003b,0x00000008,0x000001ff,0x00000007,
+0x0004003b,0x00000008,0x0000020a,0x00000007,
+0x0004003b,0x00000008,0x00000215,0x00000007,
+0x0004003b,0x00000008,0x00000220,0x00000007,
+0x0004003b,0x00000031,0x00000223,0x00000007,
+0x0004003b,0x0000000e,0x00000225,0x00000007,
+0x0004003b,0x00000032,0x00000227,0x00000007,
+0x0004003b,0x00000032,0x00000229,0x00000007,
+0x0004003d,0x0000000d,0x0000019f,0x00000044,
+0x000500c2,0x0000000d,0x000001a0,0x0000019f,
+0x00000124,0x0003003e,0x000001a1,0x000001a0,
+0x00050039,0x0000000d,0x000001a2,0x00000017,
+0x000001a1,0x0004007c,0x00000006,0x000001a3,
+0x000001a2,0x00050041,0x00000027,0x000001a4,
+0x0000019e,0x000000d5,0x0003003e,0x000001a4,
+0x000001a3,0x0004003d,0x0000000d,0x000001a5,
+0x00000044,0x000500c2,0x0000000d,0x000001a6,
+0x000001a5,0x0000012a,0x000500c4,0x0000000d,
+0x000001a7,0x000001a6,0x00000073,0x0004003d,
+0x0000000d,0x000001a8,0x00000044,0x000500c2,
+0x0000000d,0x000001a9,0x000001a8,0x00000133,
+0x000500c7,0x0000000d,0x000001aa,0x000001a9,
+0x000000f5,0x000500c5,0x0000000d,0x000001ab,
+0x000001a7,0x000001aa,0x0003003e,0x000001ac,
+0x000001ab,0x00050039,0x0000000d,0x000001ad,
+0x00000017,0x000001ac,0x0004007c,0x00000006,
+0x000001ae,0x000001ad,0x00050041,0x00000027,
+0x000001af,0x0000019e,0x000000f5,0x0003003e,
+0x000001af,0x000001ae,0x0004003d,0x0000000d,
+0x000001b0,0x00000044,0x000500c2,0x0000000d,
+0x000001b2,0x000001b0,0x000001b1,0x000500c4,
+0x0000000d,0x000001b3,0x000001b2,0x00000075,
+0x0004003d,0x0000000d,0x000001b4,0x00000044,
+0x000500c2,0x0000000d,0x000001b6,0x000001b4,
+0x000001b5,0x000500c7,0x0000000d,0x000001b7,
+0x000001b6,0x0000007b,0x000500c5,0x0000000d,
+0x000001b8,0x000001b3,0x000001b7,0x0003003e,
+0x000001b9,0x000001b8,0x00050039,0x0000000d,
+0x000001ba,0x00000017,0x000001b9,0x0004007c,
+0x00000006,0x000001bb,0x000001ba,0x00050041,
+0x00000027,0x000001bc,0x0000019e,0x000000ef,
+0x0003003e,0x000001bc,0x000001bb,0x0004003d,
+0x0000000d,0x000001be,0x00000044,0x000500c2,
+0x0000000d,0x000001bf,0x000001be,0x0000015d,
+0x0003003e,0x000001c0,0x000001bf,0x00050039,
+0x0000000d,0x000001c1,0x00000017,0x000001c0,
+0x0004007c,0x00000006,0x000001c2,0x000001c1,
+0x00050041,0x00000027,0x000001c3,0x000001bd,
+0x000000d5,0x0003003e,0x000001c3,0x000001c2,
+0x0004003d,0x0000000d,0x000001c4,0x00000044,
+0x000500c2,0x0000000d,0x000001c6,0x000001c4,
+0x000001c5,0x0003003e,0x000001c7,0x000001c6,
+0x00050039,0x0000000d,0x000001c8,0x00000017,
+0x000001c7,0x0004007c,0x00000006,0x000001c9,
+0x000001c8,0x00050041,0x00000027,0x000001ca,
+0x000001bd,0x000000f5,0x0003003e,0x000001ca,
+0x000001c9,0x0004003d,0x0000000d,0x000001cb,
+0x00000044,0x000500c2,0x0000000d,0x000001cc,
+0x000001cb,0x00000075,0x0003003e,0x000001cd,
+0x000001cc,0x00050039,0x0000000d,0x000001ce,
+0x00000017,0x000001cd,0x0004007c,0x00000006,
+0x000001cf,0x000001ce,0x00050041,0x00000027,
+0x000001d0,0x000001bd,0x000000ef,0x0003003e,
+0x000001d0,0x000001cf,0x0004003d,0x0000000d,
+0x000001d2,0x00000044,0x000500c7,0x0000000d,
+0x000001d3,0x000001d2,0x0000002f,0x0003003e,
+0x000001d1,0x000001d3,0x0004003d,0x0000000d,
+0x000001d4,0x00000044,0x000500c7,0x0000000d,
+0x000001d5,0x000001d4,0x000000f5,0x000500c4,
+0x0000000d,0x000001d6,0x000001d5,0x00000073,
+0x0004003d,0x0000000d,0x000001d7,0x000001d1,
+0x000500c5,0x0000000d,0x000001d8,0x000001d7,
+0x000001d6,0x0003003e,0x000001d1,0x000001d8,
+0x00050041,0x00000027,0x000001d9,0x0000019e,
+0x000000d5,0x0004003d,0x00000006,0x000001da,
+0x000001d9,0x000500c4,0x00000006,0x000001db,
+0x000001da,0x0000013a,0x00050041,0x00000027,
+0x000001dc,0x0000019e,0x000000f5,0x0004003d,
+0x00000006,0x000001dd,0x000001dc,0x000500c4,
+0x00000006,0x000001de,0x000001dd,0x00000148,
+0x000500c5,0x00000006,0x000001df,0x000001db,
+0x000001de,0x00050041,0x00000027,0x000001e0,
+0x0000019e,0x000000ef,0x0004003d,0x00000006,
+0x000001e1,0x000001e0,0x000500c5,0x00000006,
+0x000001e2,0x000001df,0x000001e1,0x00050041,
+0x00000027,0x000001e3,0x000001bd,0x000000d5,
+0x0004003d,0x00000006,0x000001e4,0x000001e3,
+0x000500c4,0x00000006,0x000001e5,0x000001e4,
+0x0000013a,0x00050041,0x00000027,0x000001e6,
+0x000001bd,0x000000f5,0x0004003d,0x00000006,
+0x000001e7,0x000001e6,0x000500c4,0x00000006,
+0x000001e8,0x000001e7,0x00000148,0x000500c5,
+0x00000006,0x000001e9,0x000001e5,0x000001e8,
+0x00050041,0x00000027,0x000001ea,0x000001bd,
+0x000000ef,0x0004003d,0x00000006,0x000001eb,
+0x000001ea,0x000500c5,0x00000006,0x000001ec,
+0x000001e9,0x000001eb,0x000500af,0x0000000f,
+0x000001ed,0x000001e2,0x000001ec,0x000600a9,
+0x0000000d,0x000001ee,0x000001ed,0x000000f5,
+0x000000d5,0x0004003d,0x0000000d,0x000001ef,
+0x000001d1,0x000500c5,0x0000000d,0x000001f0,
+0x000001ef,0x000001ee,0x0003003e,0x000001d1,
+0x000001f0,0x0004003d,0x0000000d,0x000001f2,
+0x000001d1,0x0003003e,0x000001f3,0x00000161,
+0x00050041,0x00000027,0x000001f4,0x000001f3,
+0x000001f2,0x0004003d,0x00000006,0x000001f5,
+0x000001f4,0x0003003e,0x000001f1,0x000001f5,
+0x0004003d,0x00000007,0x000001f7,0x0000019e,
+0x00050051,0x00000006,0x000001f8,0x000001f7,
+0x00000000,0x00050051,0x00000006,0x000001f9,
+0x000001f7,0x00000001,0x00050051,0x00000006,
+0x000001fa,0x000001f7,0x00000002,0x00060050,
+0x00000007,0x000001fb,0x000001f8,0x000001f9,
+0x000001fa,0x0004003d,0x00000006,0x000001fc,
+0x000001f1,0x00060050,0x00000007,0x000001fd,
+0x000001fc,0x000001fc,0x000001fc,0x00050080,
+0x00000007,0x000001fe,0x000001fb,0x000001fd,
+0x0003003e,0x000001ff,0x000001fe,0x00050039,
+0x00000007,0x00000200,0x0000002d,0x000001ff,
+0x00050041,0x00000008,0x00000201,0x000001f6,
+0x00000072,0x0003003e,0x00000201,0x00000200,
+0x0004003d,0x00000007,0x00000202,0x0000019e,
+0x00050051,0x00000006,0x00000203,0x00000202,
+0x00000000,0x00050051,0x00000006,0x00000204,
+0x00000202,0x00000001,0x00050051,0x00000006,
+0x00000205,0x00000202,0x00000002,0x00060050,
+0x00000007,0x00000206,0x00000203,0x00000204,
+0x00000205,0x0004003d,0x00000006,0x00000207,
+0x000001f1,0x00060050,0x00000007,0x00000208,
+0x00000207,0x00000207,0x00000207,0x00050082,
+0x00000007,0x00000209,0x00000206,0x00000208,
+0x0003003e,0x0000020a,0x00000209,0x00050039,
+0x00000007,0x0000020b,0x0000002d,0x0000020a,
+0x00050041,0x00000008,0x0000020c,0x000001f6,
+0x00000073,0x0003003e,0x0000020c,0x0000020b,
+0x0004003d,0x00000007,0x0000020d,0x000001bd,
+0x00050051,0x00000006,0x0000020e,0x0000020d,
+0x00000000,0x00050051,0x00000006,0x0000020f,
+0x0000020d,0x00000001,0x00050051,0x00000006,
+0x00000210,0x0000020d,0x00000002,0x00060050,
+0x00000007,0x00000211,0x0000020e,0x0000020f,
+0x00000210,0x0004003d,0x00000006,0x00000212,
+0x000001f1,0x00060050,0x00000007,0x00000213,
+0x00000212,0x00000212,0x00000212,0x00050080,
+0x00000007,0x00000214,0x00000211,0x00000213,
+0x0003003e,0x00000215,0x00000214,0x00050039,
+0x00000007,0x00000216,0x0000002d,0x00000215,
+0x00050041,0x00000008,0x00000217,0x000001f6,
+0x00000074,0x0003003e,0x00000217,0x00000216,
+0x0004003d,0x00000007,0x00000218,0x000001bd,
+0x00050051,0x00000006,0x00000219,0x00000218,
+0x00000000,0x00050051,0x00000006,0x0000021a,
+0x00000218,0x00000001,0x00050051,0x00000006,
+0x0000021b,0x00000218,0x00000002,0x00060050,
+0x00000007,0x0000021c,0x00000219,0x0000021a,
+0x0000021b,0x0004003d,0x00000006,0x0000021d,
+0x000001f1,0x00060050,0x00000007,0x0000021e,
+0x0000021d,0x0000021d,0x0000021d,0x00050082,
+0x00000007,0x0000021f,0x0000021c,0x0000021e,
+0x0003003e,0x00000220,0x0000021f,0x00050039,
+0x00000007,0x00000221,0x0000002d,0x00000220,
+0x00050041,0x00000008,0x00000222,0x000001f6,
+0x00000075,0x0003003e,0x00000222,0x00000221,
+0x0004003d,0x00000030,0x00000224,0x000001f6,
+0x0003003e,0x00000223,0x00000224,0x0004003d,
+0x0000000d,0x00000226,0x00000045,0x0003003e,
+0x00000225,0x00000226,0x0004003d,0x0000000f,
+0x00000228,0x00000046,0x0003003e,0x00000227,
+0x00000228,0x0004003d,0x0000000f,0x0000022a,
+0x00000047,0x0003003e,0x00000229,0x0000022a,
+0x00080039,0x00000035,0x0000022b,0x0000003b,
+0x00000223,0x00000225,0x00000227,0x00000229,
+0x000200fe,0x0000022b,0x00010038,0x00050036,
+0x00000035,0x0000004e,0x00000000,0x0000004a,
+0x00030037,0x0000000e,0x0000004b,0x00030037,
+0x0000000e,0x0000004c,0x00030037,0x00000032,
+0x0000004d,0x000200f8,0x0000004f,0x0004003b,
+0x00000008,0x0000022e,0x00000007,0x0004003b,
+0x0000000e,0x00000232,0x00000007,0x0004003b,
+0x0000000e,0x0000023e,0x00000007,0x0004003b,
+0x0000000e,0x0000024f,0x00000007,0x0004003b,
+0x00000008,0x00000253,0x00000007,0x0004003b,
+0x0000000e,0x0000025a,0x00000007,0x0004003b,
+0x0000000e,0x00000260,0x00000007,0x0004003b,
+0x0000000e,0x00000266,0x00000007,0x0004003b,
+0x00000008,0x0000026a,0x00000007,0x0004003b,
+0x0000000e,0x0000026e,0x00000007,0x0004003b,
+0x0000000e,0x00000274,0x00000007,0x0004003b,
+0x0000000e,0x00000278,0x00000007,0x0004003b,
+0x00000027,0x0000027d,0x00000007,0x0004003b,
+0x00000027,0x00000285,0x00000007,0x0004003b,
+0x00000027,0x00000288,0x00000007,0x0004003b,
+0x00000050,0x0000028b,0x00000007,0x0004003b,
+0x00000008,0x000002a2,0x00000007,0x0004003d,
+0x0000000d,0x0000022f,0x0000004b,0x000500c2,
+0x0000000d,0x00000231,0x0000022f,0x00000230,
+0x0003003e,0x00000232,0x00000231,0x00050039,
+0x0000000d,0x00000233,0x0000001d,0x00000232,
+0x0004007c,0x00000006,0x00000234,0x00000233,
+0x00050041,0x00000027,0x00000235,0x0000022e,
+0x000000d5,0x0003003e,0x00000235,0x00000234,
+0x0004003d,0x0000000d,0x00000236,0x0000004b,
+0x000500c2,0x0000000d,0x00000237,0x00000236,
+0x0000012a,0x000500c4,0x0000000d,0x00000238,
+0x00000237,0x000000b2,0x0004003d,0x0000000d,
+0x00000239,0x0000004b,0x000500c2,0x0000000d,
+0x0000023b,0x00000239,0x0000023a,0x000500c7,
+0x0000000d,0x0000023c,0x0000023b,0x000000a2,
+0x000500c5,0x0000000d,0x0000023d,0x00000238,
+0x0000023c,0x0003003e,0x0000023e,0x0000023d,
+0x00050039,0x0000000d,0x0000023f,0x00000020,
+0x0000023e,0x0004007c,0x00000006,0x00000240,
+0x0000023f,0x00050041,0x00000027,0x00000241,
+0x0000022e,0x000000f5,0x0003003e,0x00000241,
+0x00000240,0x0004003d,0x0000000d,0x00000242,
+0x0000004b,0x000500c2,0x0000000d,0x00000243,
+0x00000242,0x0000013a,0x000500c4,0x0000000d,
+0x00000245,0x00000243,0x00000244,0x0004003d,
+0x0000000d,0x00000246,0x0000004b,0x000500c2,
+0x0000000d,0x00000247,0x00000246,0x0000015d,
+0x000500c7,0x0000000d,0x00000248,0x00000247,
+0x00000126,0x000500c4,0x0000000d,0x00000249,
+0x00000248,0x00000075,0x000500c5,0x0000000d,
+0x0000024a,0x00000245,0x00000249,0x0004003d,
+0x0000000d,0x0000024b,0x0000004b,0x000500c2,
+0x0000000d,0x0000024c,0x0000024b,0x000001c5,
+0x000500c7,0x0000000d,0x0000024d,0x0000024c,
+0x0000007b,0x000500c5,0x0000000d,0x0000024e,
+0x0000024a,0x0000024d,0x0003003e,0x0000024f,
+0x0000024e,0x00050039,0x0000000d,0x00000250,
+0x0000001d,0x0000024f,0x0004007c,0x00000006,
+0x00000251,0x00000250,0x00050041,0x00000027,
+0x00000252,0x0000022e,0x000000ef,0x0003003e,
+0x00000252,0x00000251,0x0004003d,0x0000000d,
+0x00000254,0x0000004b,0x000500c2,0x0000000d,
+0x00000255,0x00000254,0x00000074,0x000500c4,
+0x0000000d,0x00000256,0x00000255,0x00000073,
+0x0004003d,0x0000000d,0x00000257,0x0000004b,
+0x000500c7,0x0000000d,0x00000258,0x00000257,
+0x000000f5,0x000500c5,0x0000000d,0x00000259,
+0x00000256,0x00000258,0x0003003e,0x0000025a,
+0x00000259,0x00050039,0x0000000d,0x0000025b,
+0x0000001d,0x0000025a,0x0004007c,0x00000006,
+0x0000025c,0x0000025b,0x00050041,0x00000027,
+0x0000025d,0x00000253,0x000000d5,0x0003003e,
+0x0000025d,0x0000025c,0x0004003d,0x0000000d,
+0x0000025e,0x0000004c,0x000500c2,0x0000000d,
+0x0000025f,0x0000025e,0x00000230,0x0003003e,
+0x00000260,0x0000025f,0x00050039,0x0000000d,
+0x00000261,0x00000020,0x00000260,0x0004007c,
+0x00000006,0x00000262,0x00000261,0x00050041,
+0x00000027,0x00000263,0x00000253,0x000000f5,
+0x0003003e,0x00000263,0x00000262,0x0004003d,
+0x0000000d,0x00000264,0x0000004c,0x000500c2,
+0x0000000d,0x00000265,0x00000264,0x000001b1,
+0x0003003e,0x00000266,0x00000265,0x00050039,
+0x0000000d,0x00000267,0x0000001d,0x00000266,
+0x0004007c,0x00000006,0x00000268,0x00000267,
+0x00050041,0x00000027,0x00000269,0x00000253,
+0x000000ef,0x0003003e,0x00000269,0x00000268,
+0x0004003d,0x0000000d,0x0000026b,0x0000004c,
+0x000500c2,0x0000000d,0x0000026d,0x0000026b,
+0x0000026c,0x0003003e,0x0000026e,0x0000026d,
+0x00050039,0x0000000d,0x0000026f,0x0000001d,
+0x0000026e,0x0004007c,0x00000006,0x00000270,
+0x0000026f,0x00050041,0x00000027,0x00000271,
+0x0000026a,0x000000d5,0x0003003e,0x00000271,
+0x00000270,0x0004003d,0x0000000d,0x00000272,
+0x0000004c,0x000500c2,0x0000000d,0x00000273,
+0x00000272,0x000000b2,0x0003003e,0x00000274,
+0x00000273,0x00050039,0x0000000d,0x00000275,
+0x00000020,0x00000274,0x0004007c,0x00000006,
+0x00000276,0x00000275,0x00050041,0x00000027,
+0x00000277,0x0000026a,0x000000f5,0x0003003e,
+0x00000277,0x00000276,0x0004003d,0x0000000d,
+0x00000279,0x0000004c,0x0003003e,0x00000278,
+0x00000279,0x00050039,0x0000000d,0x0000027a,
+0x0000001d,0x00000278,0x0004007c,0x00000006,
+0x0000027b,0x0000027a,0x00050041,0x00000027,
+0x0000027c,0x0000026a,0x000000ef,0x0003003e,
+0x0000027c,0x0000027b,0x0003003e,0x0000027d,
+0x00000072,0x000200f9,0x0000027e,0x000200f8,
+0x0000027e,0x000400f6,0x00000280,0x00000281,
+0x00000000,0x000200f9,0x00000282,0x000200f8,
+0x00000282,0x0004003d,0x00000006,0x00000283,
+0x0000027d,0x000500b1,0x0000000f,0x00000284,
+0x00000283,0x0000013a,0x000400fa,0x00000284,
+0x0000027f,0x00000280,0x000200f8,0x0000027f,
+0x0004003d,0x00000006,0x00000286,0x0000027d,
+0x000500c3,0x00000006,0x00000287,0x00000286,
+0x00000074,0x0003003e,0x00000285,0x00000287,
+0x0004003d,0x00000006,0x00000289,0x0000027d,
+0x000500c7,0x00000006,0x0000028a,0x00000289,
+0x00000075,0x0003003e,0x00000288,0x0000028a,
+0x0004003d,0x00000006,0x0000028c,0x0000027d,
+0x0004003d,0x00000006,0x0000028d,0x00000288,
+0x0004003d,0x00000007,0x0000028e,0x00000253,
+0x0004003d,0x00000007,0x0000028f,0x0000022e,
+0x00050082,0x00000007,0x00000290,0x0000028e,
+0x0000028f,0x00060050,0x00000007,0x00000291,
+0x0000028d,0x0000028d,0x0000028d,0x00050084,
+0x00000007,0x00000292,0x00000291,0x00000290,
+0x0004003d,0x00000006,0x00000293,0x00000285,
+0x0004003d,0x00000007,0x00000294,0x0000026a,
+0x0004003d,0x00000007,0x00000295,0x0000022e,
+0x00050082,0x00000007,0x00000296,0x00000294,
+0x00000295,0x00060050,0x00000007,0x00000297,
+0x00000293,0x00000293,0x00000293,0x00050084,
+0x00000007,0x00000298,0x00000297,0x00000296,
+0x00050080,0x00000007,0x00000299,0x00000292,
+0x00000298,0x0004003d,0x00000007,0x0000029a,
+0x0000022e,0x00060050,0x00000007,0x0000029b,
+0x00000090,0x00000090,0x00000090,0x00050084,
+0x00000007,0x0000029c,0x0000029b,0x0000029a,
+0x00050080,0x00000007,0x0000029d,0x00000299,
+0x0000029c,0x00060050,0x00000007,0x0000029e,
+0x00000074,0x00000074,0x00000074,0x00050080,
+0x00000007,0x0000029f,0x0000029d,0x0000029e,
+0x00060050,0x00000007,0x000002a0,0x00000074,
+0x00000074,0x00000074,0x000500c3,0x00000007,
+0x000002a1,0x0000029f,0x000002a0,0x0003003e,
+0x000002a2,0x000002a1,0x00050039,0x00000007,
+0x000002a3,0x0000002d,0x000002a2,0x00050051,
+0x00000006,0x000002a4,0x000002a3,0x00000000,
+0x00050051,0x00000006,0x000002a5,0x000002a3,
+0x00000001,0x00050051,0x00000006,0x000002a6,
+0x000002a3,0x00000002,0x00070050,0x00000033,
+0x000002a7,0x000002a4,0x000002a5,0x000002a6,
+0x000000c6,0x00050041,0x00000051,0x000002a8,
+0x0000028b,0x0000028c,0x0003003e,0x000002a8,
+0x000002a7,0x0004003d,0x00000006,0x000002a9,
+0x0000027d,0x00060041,0x00000027,0x000002aa,
+0x0000028b,0x000002a9,0x00000126,0x0003003e,
+0x000002aa,0x000000c6,0x000200f9,0x00000281,
+0x000200f8,0x00000281,0x0004003d,0x00000006,
+0x000002ab,0x0000027d,0x00050080,0x00000006,
+0x000002ac,0x000002ab,0x00000073,0x0003003e,
+0x0000027d,0x000002ac,0x000200f9,0x0000027e,
+0x000200f8,0x00000280,0x0004003d,0x00000035,
+0x000002ad,0x0000028b,0x000200fe,0x000002ad,
+0x00010038,0x00050036,0x00000002,0x0000005d,
+0x00000000,0x00000052,0x00030037,0x00000050,
+0x00000053,0x00030037,0x00000027,0x00000054,
+0x00030037,0x00000027,0x00000055,0x00030037,
+0x00000027,0x00000056,0x00030037,0x00000051,
+0x00000057,0x00030037,0x0000000e,0x00000058,
+0x00030037,0x00000032,0x00000059,0x00030037,
+0x00000032,0x0000005a,0x00030037,0x00000032,
+0x0000005b,0x00030037,0x00000032,0x0000005c,
+0x000200f8,0x0000005e,0x0004003b,0x0000000e,
+0x000002b0,0x00000007,0x0004003b,0x0000000e,
+0x000002b1,0x00000007,0x0004003b,0x00000027,
+0x000002b9,0x00000007,0x0004003b,0x0000000e,
+0x000002c4,0x00000007,0x0004003b,0x0000000e,
+0x000002ca,0x00000007,0x0004003b,0x0000000e,
+0x000002db,0x00000007,0x0004003b,0x0000000e,
+0x000002e0,0x00000007,0x0004003b,0x0000000e,
+0x000002e6,0x00000007,0x0004003b,0x0000000e,
+0x000002eb,0x00000007,0x0004003b,0x0000000e,
+0x000002ff,0x00000007,0x0004003b,0x00000027,
+0x00000303,0x00000007,0x0004003b,0x00000027,
+0x0000030b,0x00000007,0x0004003b,0x00000027,
+0x00000310,0x00000007,0x0004003b,0x00000027,
+0x00000315,0x00000007,0x0003003e,0x000002b0,
+0x000000d5,0x0003003e,0x000002b1,0x000000d5,
+0x0004003d,0x0000000f,0x000002b2,0x00000059,
+0x000300f7,0x000002b4,0x00000000,0x000400fa,
+0x000002b2,0x000002b3,0x000002b4,0x000200f8,
+0x000002b3,0x0004003d,0x0000000f,0x000002b5,
+0x0000005a,0x000300f7,0x000002b7,0x00000000,
+0x000400fa,0x000002b5,0x000002b6,0x000002b8,
+0x000200f8,0x000002b6,0x0003003e,0x000002b1,
+0x000000ef,0x000200f9,0x000002b7,0x000200f8,
+0x000002b8,0x0003003e,0x000002b0,0x000000ef,
+0x000200f9,0x000002b7,0x000200f8,0x000002b7,
+0x000200f9,0x000002b4,0x000200f8,0x000002b4,
+0x0003003e,0x000002b9,0x00000072,0x000200f9,
+0x000002ba,0x000200f8,0x000002ba,0x000400f6,
+0x000002bc,0x000002bd,0x00000000,0x000200f9,
+0x000002be,0x000200f8,0x000002be,0x0004003d,
+0x00000006,0x000002bf,0x000002b9,0x000500b1,
+0x0000000f,0x000002c0,0x000002bf,0x00000148,
+0x000400fa,0x000002c0,0x000002bb,0x000002bc,
+0x000200f8,0x000002bb,0x0004003d,0x0000000f,
+0x000002c1,0x0000005a,0x000300f7,0x000002c3,
+0x00000000,0x000400fa,0x000002c1,0x000002c2,
+0x000002d0,0x000200f8,0x000002c2,0x0004003d,
+0x0000000d,0x000002c5,0x000002b0,0x0004003d,
+0x00000006,0x000002c6,0x000002b9,0x000500c3,
+0x00000006,0x000002c7,0x000002c6,0x00000073,
+0x0004007c,0x0000000d,0x000002c8,0x000002c7,
+0x00050080,0x0000000d,0x000002c9,0x000002c5,
+0x000002c8,0x0003003e,0x000002c4,0x000002c9,
+0x0004003d,0x0000000d,0x000002cb,0x000002b1,
+0x0004003d,0x00000006,0x000002cc,0x000002b9,
+0x000500c7,0x00000006,0x000002cd,0x000002cc,
+0x00000073,0x0004007c,0x0000000d,0x000002ce,
+0x000002cd,0x00050080,0x0000000d,0x000002cf,
+0x000002cb,0x000002ce,0x0003003e,0x000002ca,
+0x000002cf,0x000200f9,0x000002c3,0x000200f8,
+0x000002d0,0x0004003d,0x0000000d,0x000002d1,
+0x000002b0,0x0004003d,0x00000006,0x000002d2,
+0x000002b9,0x000500c3,0x00000006,0x000002d3,
+0x000002d2,0x00000074,0x0004007c,0x0000000d,
+0x000002d4,0x000002d3,0x00050080,0x0000000d,
+0x000002d5,0x000002d1,0x000002d4,0x0003003e,
+0x000002c4,0x000002d5,0x0004003d,0x0000000d,
+0x000002d6,0x000002b1,0x0004003d,0x00000006,
+0x000002d7,0x000002b9,0x000500c7,0x00000006,
+0x000002d8,0x000002d7,0x00000075,0x0004007c,
+0x0000000d,0x000002d9,0x000002d8,0x00050080,
+0x0000000d,0x000002da,0x000002d6,0x000002d9,
+0x0003003e,0x000002ca,0x000002da,0x000200f9,
+0x000002c3,0x000200f8,0x000002c3,0x0004003d,
+0x0000000d,0x000002dc,0x000002ca,0x0004003d,
+0x0000000d,0x000002dd,0x000002c4,0x00050084,
+0x0000000d,0x000002de,0x000002dd,0x0000002f,
+0x00050080,0x0000000d,0x000002df,0x000002dc,
+0x000002de,0x0003003e,0x000002db,0x000002df,
+0x0004003d,0x0000000d,0x000002e1,0x00000058,
+0x0004003d,0x0000000d,0x000002e2,0x000002db,
+0x00050080,0x0000000d,0x000002e3,0x000002e2,
+0x0000008d,0x000500c2,0x0000000d,0x000002e4,
+0x000002e1,0x000002e3,0x000500c7,0x0000000d,
+0x000002e5,0x000002e4,0x000000ef,0x0003003e,
+0x000002e0,0x000002e5,0x0004003d,0x0000000d,
+0x000002e7,0x00000058,0x0004003d,0x0000000d,
+0x000002e8,0x000002db,0x000500c2,0x0000000d,
+0x000002e9,0x000002e7,0x000002e8,0x000500c7,
+0x0000000d,0x000002ea,0x000002e9,0x000000f5,
+0x0003003e,0x000002e6,0x000002ea,0x0004003d,
+0x0000000d,0x000002ec,0x000002c4,0x0004003d,
+0x0000000d,0x000002ed,0x000002ca,0x00050084,
+0x0000000d,0x000002ee,0x0000002f,0x000002ed,
+0x00050080,0x0000000d,0x000002ef,0x000002ec,
+0x000002ee,0x0003003e,0x000002eb,0x000002ef,
+0x0004003d,0x0000000f,0x000002f0,0x0000005b,
+0x0004003d,0x0000000f,0x000002f1,0x0000005c,
+0x000400a8,0x0000000f,0x000002f2,0x000002f1,
+0x000500a7,0x0000000f,0x000002f3,0x000002f0,
+0x000002f2,0x0004003d,0x0000000d,0x000002f4,
+0x000002e0,0x000500ab,0x0000000f,0x000002f5,
+0x000002f4,0x000000d5,0x000500a7,0x0000000f,
+0x000002f6,0x000002f3,0x000002f5,0x0004003d,
+0x0000000d,0x000002f7,0x000002e6,0x000500aa,
+0x0000000f,0x000002f8,0x000002f7,0x000000d5,
+0x000500a7,0x0000000f,0x000002f9,0x000002f6,
+0x000002f8,0x000300f7,0x000002fb,0x00000000,
+0x000400fa,0x000002f9,0x000002fa,0x000002fe,
+0x000200f8,0x000002fa,0x0004003d,0x0000000d,
+0x000002fc,0x000002eb,0x00050041,0x00000051,
+0x000002fd,0x00000053,0x000002fc,0x0003003e,
+0x000002fd,0x00000108,0x000200f9,0x000002fb,
+0x000200f8,0x000002fe,0x0004003d,0x0000000d,
+0x00000300,0x000002e6,0x0004003d,0x0000000d,
+0x00000301,0x000002e0,0x000500c5,0x0000000d,
+0x00000302,0x00000300,0x00000301,0x0003003e,
+0x000002ff,0x00000302,0x0004003d,0x0000000d,
+0x00000304,0x000002ff,0x00050041,0x00000027,
+0x00000305,0x00000057,0x00000304,0x0004003d,
+0x00000006,0x00000306,0x00000305,0x0003003e,
+0x00000303,0x00000306,0x0004003d,0x0000000d,
+0x00000307,0x000002eb,0x0004003d,0x00000006,
+0x00000308,0x00000054,0x0004003d,0x00000006,
+0x00000309,0x00000303,0x00050080,0x00000006,
+0x0000030a,0x00000308,0x00000309,0x0003003e,
+0x0000030b,0x0000030a,0x00050039,0x00000006,
+0x0000030c,0x0000002a,0x0000030b,0x0004003d,
+0x00000006,0x0000030d,0x00000055,0x0004003d,
+0x00000006,0x0000030e,0x00000303,0x00050080,
+0x00000006,0x0000030f,0x0000030d,0x0000030e,
+0x0003003e,0x00000310,0x0000030f,0x00050039,
+0x00000006,0x00000311,0x0000002a,0x00000310,
+0x0004003d,0x00000006,0x00000312,0x00000056,
+0x0004003d,0x00000006,0x00000313,0x00000303,
+0x00050080,0x00000006,0x00000314,0x00000312,
+0x00000313,0x0003003e,0x00000315,0x00000314,
+0x00050039,0x00000006,0x00000316,0x0000002a,
+0x00000315,0x00070050,0x00000033,0x00000317,
+0x0000030c,0x00000311,0x00000316,0x000000c6,
+0x00050041,0x00000051,0x00000318,0x00000053,
+0x00000307,0x0003003e,0x00000318,0x00000317,
+0x000200f9,0x000002fb,0x000200f8,0x000002fb,
+0x000200f9,0x000002bd,0x000200f8,0x000002bd,
+0x0004003d,0x00000006,0x00000319,0x000002b9,
+0x00050080,0x00000006,0x0000031a,0x00000319,
+0x00000073,0x0003003e,0x000002b9,0x0000031a,
+0x000200f9,0x000002ba,0x000200f8,0x000002bc,
+0x000100fd,0x00010038,0x00050036,0x00000035,
+0x00000062,0x00000000,0x0000004a,0x00030037,
+0x0000000e,0x0000005f,0x00030037,0x0000000e,
+0x00000060,0x00030037,0x00000032,0x00000061,
+0x000200f8,0x00000063,0x0004003b,0x00000032,
+0x0000031b,0x00000007,0x0004003b,0x0000000e,
+0x0000032a,0x00000007,0x0004003b,0x0000000e,
+0x0000032d,0x00000007,0x0004003b,0x0000000e,
+0x00000330,0x00000007,0x0004003b,0x0000000e,
+0x00000335,0x00000007,0x0004003b,0x0000000e,
+0x00000337,0x00000007,0x0004003b,0x0000000e,
+0x0000033b,0x00000007,0x0004003b,0x0000000e,
+0x0000033d,0x00000007,0x0004003b,0x00000032,
+0x0000033f,0x00000007,0x0004003b,0x00000032,
+0x00000341,0x00000007,0x0004003b,0x0000000e,
+0x00000347,0x00000007,0x0004003b,0x0000000e,
+0x00000349,0x00000007,0x0004003b,0x0000000e,
+0x0000034d,0x00000007,0x0004003b,0x0000000e,
+0x0000034f,0x00000007,0x0004003b,0x00000032,
+0x00000351,0x00000007,0x0004003b,0x00000032,
+0x00000353,0x00000007,0x0004003b,0x0000000e,
+0x00000359,0x00000007,0x0004003b,0x0000000e,
+0x0000035b,0x00000007,0x0004003b,0x0000000e,
+0x0000035f,0x00000007,0x0004003b,0x0000000e,
+0x00000361,0x00000007,0x0004003b,0x00000032,
+0x00000363,0x00000007,0x0004003b,0x00000027,
+0x00000367,0x00000007,0x0004003b,0x0000000e,
+0x00000368,0x00000007,0x0004003b,0x00000027,
+0x0000036c,0x00000007,0x0004003b,0x0000000e,
+0x0000036f,0x00000007,0x0004003b,0x0000000e,
+0x00000371,0x00000007,0x0004003b,0x00000027,
+0x00000374,0x00000007,0x0004003b,0x0000000e,
+0x00000375,0x00000007,0x0004003b,0x00000027,
+0x00000379,0x00000007,0x0004003b,0x0000000e,
+0x0000037c,0x00000007,0x0004003b,0x0000000e,
+0x0000037e,0x00000007,0x0004003b,0x00000027,
+0x00000381,0x00000007,0x0004003b,0x0000000e,
+0x00000382,0x00000007,0x0004003b,0x00000027,
+0x00000386,0x00000007,0x0004003b,0x0000000e,
+0x00000389,0x00000007,0x0004003b,0x0000000e,
+0x0000038b,0x00000007,0x0004003b,0x0000000e,
+0x00000392,0x00000007,0x0004003b,0x0000000e,
+0x00000397,0x00000007,0x0004003b,0x0000000e,
+0x0000039c,0x00000007,0x0004003b,0x0000000e,
+0x000003a1,0x00000007,0x0004003b,0x0000000e,
+0x000003a6,0x00000007,0x0004003b,0x0000000e,
+0x000003ab,0x00000007,0x0004003b,0x0000000e,
+0x000003ae,0x00000007,0x0004003b,0x0000000e,
+0x000003b2,0x00000007,0x0004003b,0x00000051,
+0x000003bc,0x00000007,0x0004003b,0x000003e1,
+0x000003e2,0x00000007,0x0004003b,0x00000051,
+0x000003e5,0x00000007,0x0004003b,0x000003e1,
+0x000003e7,0x00000007,0x0004003b,0x000003e1,
+0x000003f5,0x00000007,0x0004003b,0x000003e1,
+0x000003f9,0x00000007,0x0004003b,0x00000032,
+0x000003fc,0x00000007,0x0004003b,0x00000050,
+0x00000400,0x00000007,0x0004003b,0x00000050,
+0x00000402,0x00000007,0x0004003b,0x00000027,
+0x00000404,0x00000007,0x0004003b,0x00000027,
+0x00000406,0x00000007,0x0004003b,0x00000027,
+0x00000408,0x00000007,0x0004003b,0x00000051,
+0x0000040a,0x00000007,0x0004003b,0x0000000e,
+0x0000040c,0x00000007,0x0004003b,0x00000032,
+0x0000040e,0x00000007,0x0004003b,0x00000032,
+0x0000040f,0x00000007,0x0004003b,0x00000032,
+0x00000411,0x00000007,0x0004003b,0x00000032,
+0x00000413,0x00000007,0x0004003b,0x00000050,
+0x00000418,0x00000007,0x0004003b,0x00000027,
+0x0000041a,0x00000007,0x0004003b,0x00000027,
+0x0000041c,0x00000007,0x0004003b,0x00000027,
+0x0000041e,0x00000007,0x0004003b,0x00000051,
+0x00000420,0x00000007,0x0004003b,0x0000000e,
+0x00000422,0x00000007,0x0004003b,0x00000032,
+0x00000424,0x00000007,0x0004003b,0x00000032,
+0x00000425,0x00000007,0x0004003b,0x00000032,
+0x00000427,0x00000007,0x0004003b,0x00000032,
+0x00000429,0x00000007,0x0004003d,0x0000000d,
+0x0000031c,0x0000005f,0x000500c2,0x0000000d,
+0x0000031d,0x0000031c,0x00000073,0x000500c7,
+0x0000000d,0x0000031e,0x0000031d,0x000000f5,
+0x000500ab,0x0000000f,0x0000031f,0x0000031e,
+0x000000d5,0x0003003e,0x0000031b,0x0000031f,
+0x0004003d,0x0000000f,0x00000320,0x00000061,
+0x000400a8,0x0000000f,0x00000321,0x00000320,
+0x000300f7,0x00000323,0x00000000,0x000400fa,
+0x00000321,0x00000322,0x00000323,0x000200f8,
+0x00000322,0x0004003d,0x0000000d,0x00000324,
+0x0000005f,0x000500c7,0x0000000d,0x00000325,
+0x00000324,0x000000ef,0x000500ab,0x0000000f,
+0x00000326,0x00000325,0x000000d5,0x000200f9,
+0x00000323,0x000200f8,0x00000323,0x000700f5,
+0x0000000f,0x00000327,0x00000320,0x00000063,
+0x00000326,0x00000322,0x000300f7,0x00000329,
+0x00000000,0x000400fa,0x00000327,0x00000328,
+0x0000038e,0x000200f8,0x00000328,0x0004003d,
+0x0000000d,0x0000032b,0x0000005f,0x000500c2,
+0x0000000d,0x0000032c,0x0000032b,0x00000124,
+0x0003003e,0x0000032a,0x0000032c,0x0004003d,
+0x0000000d,0x0000032e,0x0000005f,0x000500c2,
+0x0000000d,0x0000032f,0x0000032e,0x000001b1,
+0x0003003e,0x0000032d,0x0000032f,0x0004003d,
+0x0000000d,0x00000331,0x0000005f,0x000500c2,
+0x0000000d,0x00000332,0x00000331,0x0000015d,
+0x0003003e,0x00000330,0x00000332,0x0004003d,
+0x0000000d,0x00000333,0x0000005f,0x000500c2,
+0x0000000d,0x00000334,0x00000333,0x0000012a,
+0x0004003d,0x0000000d,0x00000336,0x0000032a,
+0x0003003e,0x00000335,0x00000336,0x0003003e,
+0x00000337,0x00000334,0x00060039,0x0000000f,
+0x00000338,0x00000013,0x00000335,0x00000337,
+0x000300f7,0x0000033a,0x00000000,0x000400fa,
+0x00000338,0x00000339,0x0000033a,0x000200f8,
+0x00000339,0x0004003d,0x0000000d,0x0000033c,
+0x0000005f,0x0003003e,0x0000033b,0x0000033c,
+0x0004003d,0x0000000d,0x0000033e,0x00000060,
+0x0003003e,0x0000033d,0x0000033e,0x0004003d,
+0x0000000f,0x00000340,0x00000061,0x0003003e,
+0x0000033f,0x00000340,0x0004003d,0x0000000f,
+0x00000342,0x0000031b,0x0003003e,0x00000341,
+0x00000342,0x00080039,0x00000035,0x00000343,
+0x00000042,0x0000033b,0x0000033d,0x0000033f,
+0x00000341,0x000200fe,0x00000343,0x000200f8,
+0x0000033a,0x0004003d,0x0000000d,0x00000345,
+0x0000005f,0x000500c2,0x0000000d,0x00000346,
+0x00000345,0x0000013a,0x0004003d,0x0000000d,
+0x00000348,0x0000032d,0x0003003e,0x00000347,
+0x00000348,0x0003003e,0x00000349,0x00000346,
+0x00060039,0x0000000f,0x0000034a,0x00000013,
+0x00000347,0x00000349,0x000300f7,0x0000034c,
+0x00000000,0x000400fa,0x0000034a,0x0000034b,
+0x0000034c,0x000200f8,0x0000034b,0x0004003d,
+0x0000000d,0x0000034e,0x0000005f,0x0003003e,
+0x0000034d,0x0000034e,0x0004003d,0x0000000d,
+0x00000350,0x00000060,0x0003003e,0x0000034f,
+0x00000350,0x0004003d,0x0000000f,0x00000352,
+0x00000061,0x0003003e,0x00000351,0x00000352,
+0x0004003d,0x0000000f,0x00000354,0x0000031b,
+0x0003003e,0x00000353,0x00000354,0x00080039,
+0x00000035,0x00000355,0x00000048,0x0000034d,
+0x0000034f,0x00000351,0x00000353,0x000200fe,
+0x00000355,0x000200f8,0x0000034c,0x0004003d,
+0x0000000d,0x00000357,0x0000005f,0x000500c2,
+0x0000000d,0x00000358,0x00000357,0x00000148,
+0x0004003d,0x0000000d,0x0000035a,0x00000330,
+0x0003003e,0x00000359,0x0000035a,0x0003003e,
+0x0000035b,0x00000358,0x00060039,0x0000000f,
+0x0000035c,0x00000013,0x00000359,0x0000035b,
+0x000300f7,0x0000035e,0x00000000,0x000400fa,
+0x0000035c,0x0000035d,0x0000035e,0x000200f8,
+0x0000035d,0x0004003d,0x0000000d,0x00000360,
+0x0000005f,0x0003003e,0x0000035f,0x00000360,
+0x0004003d,0x0000000d,0x00000362,0x00000060,
+0x0003003e,0x00000361,0x00000362,0x0004003d,
+0x0000000f,0x00000364,0x00000061,0x0003003e,
+0x00000363,0x00000364,0x00070039,0x00000035,
+0x00000365,0x0000004e,0x0000035f,0x00000361,
+0x00000363,0x000200fe,0x00000365,0x000200f8,
+0x0000035e,0x0004003d,0x0000000d,0x00000369,
+0x0000032a,0x0003003e,0x00000368,0x00000369,
+0x00050039,0x0000000d,0x0000036a,0x0000001a,
+0x00000368,0x0004007c,0x00000006,0x0000036b,
+0x0000036a,0x0003003e,0x00000367,0x0000036b,
+0x0004003d,0x0000000d,0x0000036d,0x0000005f,
+0x000500c2,0x0000000d,0x0000036e,0x0000036d,
+0x0000012a,0x0004003d,0x0000000d,0x00000370,
+0x0000032a,0x0003003e,0x0000036f,0x00000370,
+0x0003003e,0x00000371,0x0000036e,0x00060039,
+0x0000000d,0x00000372,0x00000025,0x0000036f,
+0x00000371,0x0004007c,0x00000006,0x00000373,
+0x00000372,0x0003003e,0x0000036c,0x00000373,
+0x0004003d,0x0000000d,0x00000376,0x0000032d,
+0x0003003e,0x00000375,0x00000376,0x00050039,
+0x0000000d,0x00000377,0x0000001a,0x00000375,
+0x0004007c,0x00000006,0x00000378,0x00000377,
+0x0003003e,0x00000374,0x00000378,0x0004003d,
+0x0000000d,0x0000037a,0x0000005f,0x000500c2,
+0x0000000d,0x0000037b,0x0000037a,0x0000013a,
+0x0004003d,0x0000000d,0x0000037d,0x0000032d,
+0x0003003e,0x0000037c,0x0000037d,0x0003003e,
+0x0000037e,0x0000037b,0x00060039,0x0000000d,
+0x0000037f,0x00000025,0x0000037c,0x0000037e,
+0x0004007c,0x00000006,0x00000380,0x0000037f,
+0x0003003e,0x00000379,0x00000380,0x0004003d,
+0x0000000d,0x00000383,0x00000330,0x0003003e,
+0x00000382,0x00000383,0x00050039,0x0000000d,
+0x00000384,0x0000001a,0x00000382,0x0004007c,
+0x00000006,0x00000385,0x00000384,0x0003003e,
+0x00000381,0x00000385,0x0004003d,0x0000000d,
+0x00000387,0x0000005f,0x000500c2,0x0000000d,
+0x00000388,0x00000387,0x00000148,0x0004003d,
+0x0000000d,0x0000038a,0x00000330,0x0003003e,
+0x00000389,0x0000038a,0x0003003e,0x0000038b,
+0x00000388,0x00060039,0x0000000d,0x0000038c,
+0x00000025,0x00000389,0x0000038b,0x0004007c,
+0x00000006,0x0000038d,0x0000038c,0x0003003e,
+0x00000386,0x0000038d,0x000200f9,0x00000329,
+0x000200f8,0x0000038e,0x0004003d,0x0000000d,
+0x0000038f,0x0000005f,0x000500c2,0x0000000d,
+0x00000391,0x0000038f,0x00000390,0x0003003e,
+0x00000392,0x00000391,0x00050039,0x0000000d,
+0x00000393,0x00000017,0x00000392,0x0004007c,
+0x00000006,0x00000394,0x00000393,0x0003003e,
+0x00000367,0x00000394,0x0004003d,0x0000000d,
+0x00000395,0x0000005f,0x000500c2,0x0000000d,
+0x00000396,0x00000395,0x0000012a,0x0003003e,
+0x00000397,0x00000396,0x00050039,0x0000000d,
+0x00000398,0x00000017,0x00000397,0x0004007c,
+0x00000006,0x00000399,0x00000398,0x0003003e,
+0x0000036c,0x00000399,0x0004003d,0x0000000d,
+0x0000039a,0x0000005f,0x000500c2,0x0000000d,
+0x0000039b,0x0000039a,0x00000133,0x0003003e,
+0x0000039c,0x0000039b,0x00050039,0x0000000d,
+0x0000039d,0x00000017,0x0000039c,0x0004007c,
+0x00000006,0x0000039e,0x0000039d,0x0003003e,
+0x00000374,0x0000039e,0x0004003d,0x0000000d,
+0x0000039f,0x0000005f,0x000500c2,0x0000000d,
+0x000003a0,0x0000039f,0x0000013a,0x0003003e,
+0x000003a1,0x000003a0,0x00050039,0x0000000d,
+0x000003a2,0x00000017,0x000003a1,0x0004007c,
+0x00000006,0x000003a3,0x000003a2,0x0003003e,
+0x00000379,0x000003a3,0x0004003d,0x0000000d,
+0x000003a4,0x0000005f,0x000500c2,0x0000000d,
+0x000003a5,0x000003a4,0x00000141,0x0003003e,
+0x000003a6,0x000003a5,0x00050039,0x0000000d,
+0x000003a7,0x00000017,0x000003a6,0x0004007c,
+0x00000006,0x000003a8,0x000003a7,0x0003003e,
+0x00000381,0x000003a8,0x0004003d,0x0000000d,
+0x000003a9,0x0000005f,0x000500c2,0x0000000d,
+0x000003aa,0x000003a9,0x00000148,0x0003003e,
+0x000003ab,0x000003aa,0x00050039,0x0000000d,
+0x000003ac,0x00000017,0x000003ab,0x0004007c,
+0x00000006,0x000003ad,0x000003ac,0x0003003e,
+0x00000386,0x000003ad,0x000200f9,0x00000329,
+0x000200f8,0x00000329,0x0004003d,0x0000000d,
+0x000003af,0x0000005f,0x000500c2,0x0000000d,
+0x000003b0,0x000003af,0x00000244,0x000500c7,
+0x0000000d,0x000003b1,0x0000007b,0x000003b0,
+0x0003003e,0x000003ae,0x000003b1,0x0004003d,
+0x0000000d,0x000003b3,0x0000005f,0x000500c2,
+0x0000000d,0x000003b4,0x000003b3,0x00000074,
+0x000500c7,0x0000000d,0x000003b5,0x0000007b,
+0x000003b4,0x0003003e,0x000003b2,0x000003b5,
+0x0004003d,0x0000000f,0x000003b6,0x0000031b,
+0x0004003d,0x0000000f,0x000003b7,0x00000061,
+0x000400a8,0x0000000f,0x000003b8,0x000003b7,
+0x000500a6,0x0000000f,0x000003b9,0x000003b6,
+0x000003b8,0x000300f7,0x000003bb,0x00000000,
+0x000400fa,0x000003b9,0x000003ba,0x000003ea,
+0x000200f8,0x000003ba,0x0004003d,0x0000000d,
+0x000003e0,0x000003ae,0x0003003e,0x000003e2,
+0x000003df,0x00050041,0x00000051,0x000003e3,
+0x000003e2,0x000003e0,0x0004003d,0x00000033,
+0x000003e4,0x000003e3,0x0003003e,0x000003bc,
+0x000003e4,0x0004003d,0x0000000d,0x000003e6,
+0x000003b2,0x0003003e,0x000003e7,0x000003df,
+0x00050041,0x00000051,0x000003e8,0x000003e7,
+0x000003e6,0x0004003d,0x00000033,0x000003e9,
+0x000003e8,0x0003003e,0x000003e5,0x000003e9,
+0x000200f9,0x000003bb,0x000200f8,0x000003ea,
+0x0004003d,0x0000000d,0x000003f4,0x000003ae,
+0x0003003e,0x000003f5,0x000003f3,0x00050041,
+0x00000051,0x000003f6,0x000003f5,0x000003f4,
+0x0004003d,0x00000033,0x000003f7,0x000003f6,
+0x0003003e,0x000003bc,0x000003f7,0x0004003d,
+0x0000000d,0x000003f8,0x000003b2,0x0003003e,
+0x000003f9,0x000003f3,0x00050041,0x00000051,
+0x000003fa,0x000003f9,0x000003f8,0x0004003d,
+0x00000033,0x000003fb,0x000003fa,0x0003003e,
+0x000003e5,0x000003fb,0x000200f9,0x000003bb,
+0x000200f8,0x000003bb,0x0004003d,0x0000000d,
+0x000003fd,0x0000005f,0x000500c7,0x0000000d,
+0x000003fe,0x000003fd,0x000000f5,0x000500ab,
+0x0000000f,0x000003ff,0x000003fe,0x000000d5,
+0x0003003e,0x000003fc,0x000003ff,0x0004003d,
+0x00000035,0x00000403,0x00000400,0x0003003e,
+0x00000402,0x00000403,0x0004003d,0x00000006,
+0x00000405,0x00000367,0x0003003e,0x00000404,
+0x00000405,0x0004003d,0x00000006,0x00000407,
+0x00000374,0x0003003e,0x00000406,0x00000407,
+0x0004003d,0x00000006,0x00000409,0x00000381,
+0x0003003e,0x00000408,0x00000409,0x0004003d,
+0x00000033,0x0000040b,0x000003bc,0x0003003e,
+0x0000040a,0x0000040b,0x0004003d,0x0000000d,
+0x0000040d,0x00000060,0x0003003e,0x0000040c,
+0x0000040d,0x0003003e,0x0000040e,0x00000401,
+0x0004003d,0x0000000f,0x00000410,0x000003fc,
+0x0003003e,0x0000040f,0x00000410,0x0004003d,
+0x0000000f,0x00000412,0x00000061,0x0003003e,
+0x00000411,0x00000412,0x0004003d,0x0000000f,
+0x00000414,0x0000031b,0x0003003e,0x00000413,
+0x00000414,0x000e0039,0x00000002,0x00000415,
+0x0000005d,0x00000402,0x00000404,0x00000406,
+0x00000408,0x0000040a,0x0000040c,0x0000040e,
+0x0000040f,0x00000411,0x00000413,0x0004003d,
+0x00000035,0x00000416,0x00000402,0x0003003e,
+0x00000400,0x00000416,0x0004003d,0x00000035,
+0x00000419,0x00000400,0x0003003e,0x00000418,
+0x00000419,0x0004003d,0x00000006,0x0000041b,
+0x0000036c,0x0003003e,0x0000041a,0x0000041b,
+0x0004003d,0x00000006,0x0000041d,0x00000379,
+0x0003003e,0x0000041c,0x0000041d,0x0004003d,
+0x00000006,0x0000041f,0x00000386,0x0003003e,
+0x0000041e,0x0000041f,0x0004003d,0x00000033,
+0x00000421,0x000003e5,0x0003003e,0x00000420,
+0x00000421,0x0004003d,0x0000000d,0x00000423,
+0x00000060,0x0003003e,0x00000422,0x00000423,
+0x0003003e,0x00000424,0x00000417,0x0004003d,
+0x0000000f,0x00000426,0x000003fc,0x0003003e,
+0x00000425,0x00000426,0x0004003d,0x0000000f,
+0x00000428,0x00000061,0x0003003e,0x00000427,
+0x00000428,0x0004003d,0x0000000f,0x0000042a,
+0x0000031b,0x0003003e,0x00000429,0x0000042a,
+0x000e0039,0x00000002,0x0000042b,0x0000005d,
+0x00000418,0x0000041a,0x0000041c,0x0000041e,
+0x00000420,0x00000422,0x00000424,0x00000425,
+0x00000427,0x00000429,0x0004003d,0x00000035,
+0x0000042c,0x00000418,0x0003003e,0x00000400,
+0x0000042c,0x0004003d,0x00000035,0x0000042d,
+0x00000400,0x000200fe,0x0000042d,0x00010038,
+0x00050036,0x0000000d,0x00000066,0x00000000,
+0x00000022,0x00030037,0x0000000e,0x00000064,
+0x00030037,0x0000000e,0x00000065,0x000200f8,
+0x00000067,0x0004003b,0x0000000e,0x00000430,
+0x00000007,0x0004003b,0x0000000e,0x0000043a,
+0x00000007,0x0004003d,0x0000000d,0x00000431,
+0x00000064,0x000500c7,0x0000000d,0x00000433,
+0x00000431,0x00000432,0x000500c4,0x0000000d,
+0x00000434,0x00000433,0x00000148,0x0003003e,
+0x00000430,0x00000434,0x0004003d,0x0000000d,
+0x00000435,0x00000064,0x000500c2,0x0000000d,
+0x00000436,0x00000435,0x00000148,0x000500c7,
+0x0000000d,0x00000437,0x00000436,0x00000432,
+0x0004003d,0x0000000d,0x00000438,0x00000430,
+0x000500c5,0x0000000d,0x00000439,0x00000438,
+0x00000437,0x0003003e,0x00000430,0x00000439,
+0x0004003d,0x0000000d,0x0000043b,0x00000065,
+0x000500c7,0x0000000d,0x0000043c,0x0000043b,
+0x00000432,0x000500c4,0x0000000d,0x0000043d,
+0x0000043c,0x00000148,0x0003003e,0x0000043a,
+0x0000043d,0x0004003d,0x0000000d,0x0000043e,
+0x00000065,0x000500c2,0x0000000d,0x0000043f,
+0x0000043e,0x00000148,0x000500c7,0x0000000d,
+0x00000440,0x0000043f,0x00000432,0x0004003d,
+0x0000000d,0x00000441,0x0000043a,0x000500c5,
+0x0000000d,0x00000442,0x00000441,0x00000440,
+0x0003003e,0x0000043a,0x00000442,0x0004003d,
+0x0000000d,0x00000443,0x00000430,0x000500c4,
+0x0000000d,0x00000444,0x00000443,0x0000013a,
+0x0004003d,0x0000000d,0x00000445,0x0000043a,
+0x000500c5,0x0000000d,0x00000446,0x00000444,
+0x00000445,0x000200fe,0x00000446,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_3D.inl
new file mode 100644
index 00000000000..b3e9447a4d7
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGB8_3D.inl
@@ -0,0 +1,1878 @@
+0x07230203,0x00010300,0x000d000a,0x000004ed,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x0000044c,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00060005,0x0000000b,0x50746567,
+0x4433736f,0x33697628,0x0000003b,0x00030005,
+0x0000000a,0x00736f70,0x00070005,0x00000013,
+0x764f7369,0x6c667265,0x6465776f,0x3b317528,
+0x003b3175,0x00040005,0x00000011,0x65736162,
+0x00000000,0x00040005,0x00000012,0x66666964,
+0x00000000,0x00060005,0x00000017,0x766e6f63,
+0x34747265,0x28386f54,0x003b3175,0x00030005,
+0x00000016,0x00000062,0x00060005,0x0000001a,
+0x766e6f63,0x35747265,0x28386f54,0x003b3175,
+0x00030005,0x00000019,0x00000062,0x00060005,
+0x0000001d,0x766e6f63,0x36747265,0x28386f54,
+0x003b3175,0x00030005,0x0000001c,0x00000062,
+0x00060005,0x00000020,0x766e6f63,0x37747265,
+0x28386f54,0x003b3175,0x00030005,0x0000001f,
+0x00000062,0x00070005,0x00000025,0x766e6f63,
+0x44747265,0x28666669,0x753b3175,0x00003b31,
+0x00040005,0x00000023,0x65736162,0x00000000,
+0x00040005,0x00000024,0x66666964,0x00000000,
+0x00050005,0x0000002a,0x616c635f,0x6928706d,
+0x00003b31,0x00030005,0x00000029,0x00000078,
+0x00050005,0x0000002d,0x616c635f,0x7628706d,
+0x003b3369,0x00030005,0x0000002c,0x00000078,
+0x000a0005,0x0000003b,0x32637465,0x485f545f,
+0x646e695f,0x76287865,0x345b3369,0x31753b5d,
+0x3b31623b,0x003b3162,0x00050005,0x00000037,
+0x54726c63,0x656c6261,0x00000000,0x00030005,
+0x00000038,0x00776f6c,0x00070005,0x00000039,
+0x75507369,0x7468636e,0x756f7268,0x6c416867,
+0x00616870,0x00040005,0x0000003a,0x7161706f,
+0x00006575,0x000b0005,0x00000042,0x32637465,
+0x6365645f,0x5f65646f,0x636f6c62,0x28545f6b,
+0x753b3175,0x31623b31,0x3b31623b,0x00000000,
+0x00040005,0x0000003e,0x68676968,0x00000000,
+0x00030005,0x0000003f,0x00776f6c,0x00070005,
+0x00000040,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00040005,0x00000041,
+0x7161706f,0x00006575,0x000b0005,0x00000048,
+0x32637465,0x6365645f,0x5f65646f,0x636f6c62,
+0x28485f6b,0x753b3175,0x31623b31,0x3b31623b,
+0x00000000,0x00040005,0x00000044,0x68676968,
+0x00000000,0x00030005,0x00000045,0x00776f6c,
+0x00070005,0x00000046,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00040005,
+0x00000047,0x7161706f,0x00006575,0x000a0005,
+0x0000004e,0x32637465,0x6365645f,0x5f65646f,
+0x636f6c62,0x28505f6b,0x753b3175,0x31623b31,
+0x0000003b,0x00040005,0x0000004b,0x68676968,
+0x00000000,0x00030005,0x0000004c,0x00776f6c,
+0x00070005,0x0000004d,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00100005,
+0x0000005d,0x6f636564,0x735f6564,0x6c626275,
+0x286b636f,0x5b346976,0x3b5d3631,0x693b3169,
+0x31693b31,0x3469763b,0x3b31753b,0x623b3162,
+0x31623b31,0x3b31623b,0x00000000,0x00040005,
+0x00000053,0x74754f70,0x00000000,0x00030005,
+0x00000054,0x00000072,0x00030005,0x00000055,
+0x00000067,0x00030005,0x00000056,0x00000062,
+0x00040005,0x00000057,0x6c626174,0x00000065,
+0x00030005,0x00000058,0x00776f6c,0x00040005,
+0x00000059,0x6f636573,0x0000646e,0x00040005,
+0x0000005a,0x70696c66,0x00646570,0x00070005,
+0x0000005b,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00040005,0x0000005c,
+0x7161706f,0x00006575,0x000a0005,0x00000062,
+0x32637465,0x6365645f,0x5f65646f,0x5f626772,
+0x636f6c62,0x3175286b,0x3b31753b,0x003b3162,
+0x00040005,0x0000005f,0x68676968,0x00000000,
+0x00030005,0x00000060,0x00776f6c,0x00070005,
+0x00000061,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00080005,0x00000066,
+0x736e6f63,0x63757274,0x6e695574,0x28323374,
+0x753b3175,0x00003b31,0x00030005,0x00000064,
+0x00363161,0x00030005,0x00000065,0x00363162,
+0x00030005,0x0000006b,0x006c6176,0x00050005,
+0x0000007f,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x0000008b,0x00000063,0x00030005,
+0x00000096,0x00000063,0x00030005,0x000000a0,
+0x00000063,0x00030005,0x000000ab,0x00000063,
+0x00050005,0x000000bc,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x000000c1,0x61726170,
+0x0000006d,0x00030005,0x000000d4,0x00000079,
+0x00030005,0x000000dd,0x00000078,0x00030005,
+0x000000e5,0x0000006b,0x00030005,0x000000ea,
+0x0062736d,0x00030005,0x000000f1,0x0062736c,
+0x00030005,0x00000103,0x00746572,0x00040005,
+0x0000010b,0x7366666f,0x00007465,0x00030005,
+0x00000122,0x00003172,0x00040005,0x0000012e,
+0x61726170,0x0000006d,0x00030005,0x00000131,
+0x00003167,0x00040005,0x00000135,0x61726170,
+0x0000006d,0x00030005,0x00000138,0x00003162,
+0x00040005,0x0000013c,0x61726170,0x0000006d,
+0x00030005,0x0000013f,0x00003272,0x00040005,
+0x00000143,0x61726170,0x0000006d,0x00030005,
+0x00000146,0x00003267,0x00040005,0x0000014a,
+0x61726170,0x0000006d,0x00030005,0x0000014d,
+0x00003262,0x00040005,0x00000150,0x61726170,
+0x0000006d,0x00050005,0x00000153,0x65746e69,
+0x4965736e,0x00007864,0x00050005,0x0000015c,
+0x65746e69,0x4d65736e,0x0000646f,0x00050005,
+0x00000163,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x00000166,0x54726c63,0x656c6261,
+0x00000000,0x00040005,0x0000016f,0x61726170,
+0x0000006d,0x00040005,0x00000174,0x61726170,
+0x0000006d,0x00040005,0x00000179,0x61726170,
+0x0000006d,0x00040005,0x00000185,0x61726170,
+0x0000006d,0x00040005,0x0000018a,0x61726170,
+0x0000006d,0x00040005,0x0000018f,0x61726170,
+0x0000006d,0x00040005,0x00000193,0x61726170,
+0x0000006d,0x00040005,0x00000195,0x61726170,
+0x0000006d,0x00040005,0x00000197,0x61726170,
+0x0000006d,0x00040005,0x00000199,0x61726170,
+0x0000006d,0x00040005,0x0000019e,0x31626772,
+0x00000000,0x00040005,0x000001a1,0x61726170,
+0x0000006d,0x00040005,0x000001ac,0x61726170,
+0x0000006d,0x00040005,0x000001b9,0x61726170,
+0x0000006d,0x00040005,0x000001bd,0x32626772,
+0x00000000,0x00040005,0x000001c0,0x61726170,
+0x0000006d,0x00040005,0x000001c7,0x61726170,
+0x0000006d,0x00040005,0x000001cd,0x61726170,
+0x0000006d,0x00050005,0x000001d1,0x65746e69,
+0x4965736e,0x00007864,0x00050005,0x000001f1,
+0x65746e69,0x4d65736e,0x0000646f,0x00050005,
+0x000001f3,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x000001f6,0x54726c63,0x656c6261,
+0x00000000,0x00040005,0x000001ff,0x61726170,
+0x0000006d,0x00040005,0x0000020a,0x61726170,
+0x0000006d,0x00040005,0x00000215,0x61726170,
+0x0000006d,0x00040005,0x00000220,0x61726170,
+0x0000006d,0x00040005,0x00000223,0x61726170,
+0x0000006d,0x00040005,0x00000225,0x61726170,
+0x0000006d,0x00040005,0x00000227,0x61726170,
+0x0000006d,0x00040005,0x00000229,0x61726170,
+0x0000006d,0x00040005,0x0000022e,0x6f626772,
+0x00000000,0x00040005,0x00000232,0x61726170,
+0x0000006d,0x00040005,0x0000023e,0x61726170,
+0x0000006d,0x00040005,0x0000024f,0x61726170,
+0x0000006d,0x00040005,0x00000253,0x68626772,
+0x00000000,0x00040005,0x0000025a,0x61726170,
+0x0000006d,0x00040005,0x00000260,0x61726170,
+0x0000006d,0x00040005,0x00000266,0x61726170,
+0x0000006d,0x00040005,0x0000026a,0x76626772,
+0x00000000,0x00040005,0x0000026e,0x61726170,
+0x0000006d,0x00040005,0x00000274,0x61726170,
+0x0000006d,0x00040005,0x00000278,0x61726170,
+0x0000006d,0x00030005,0x0000027d,0x00000069,
+0x00030005,0x00000285,0x00000079,0x00030005,
+0x00000288,0x00000078,0x00030005,0x0000028b,
+0x00746572,0x00040005,0x000002a2,0x61726170,
+0x0000006d,0x00040005,0x000002b0,0x65736162,
+0x00000058,0x00040005,0x000002b1,0x65736162,
+0x00000059,0x00030005,0x000002b9,0x00000069,
+0x00030005,0x000002c4,0x00000078,0x00030005,
+0x000002ca,0x00000079,0x00030005,0x000002db,
+0x0000006b,0x00030005,0x000002e0,0x0062736d,
+0x00030005,0x000002e6,0x0062736c,0x00030005,
+0x000002eb,0x00000071,0x00040005,0x000002ff,
+0x7366666f,0x00007465,0x00040005,0x00000303,
+0x746c6564,0x00000061,0x00040005,0x0000030b,
+0x61726170,0x0000006d,0x00040005,0x00000310,
+0x61726170,0x0000006d,0x00040005,0x00000315,
+0x61726170,0x0000006d,0x00040005,0x0000031b,
+0x7161706f,0x00006575,0x00040005,0x0000032a,
+0x73614272,0x00000065,0x00040005,0x0000032d,
+0x73614267,0x00000065,0x00040005,0x00000330,
+0x73614262,0x00000065,0x00040005,0x00000335,
+0x61726170,0x0000006d,0x00040005,0x00000337,
+0x61726170,0x0000006d,0x00040005,0x0000033b,
+0x61726170,0x0000006d,0x00040005,0x0000033d,
+0x61726170,0x0000006d,0x00040005,0x0000033f,
+0x61726170,0x0000006d,0x00040005,0x00000341,
+0x61726170,0x0000006d,0x00040005,0x00000347,
+0x61726170,0x0000006d,0x00040005,0x00000349,
+0x61726170,0x0000006d,0x00040005,0x0000034d,
+0x61726170,0x0000006d,0x00040005,0x0000034f,
+0x61726170,0x0000006d,0x00040005,0x00000351,
+0x61726170,0x0000006d,0x00040005,0x00000353,
+0x61726170,0x0000006d,0x00040005,0x00000359,
+0x61726170,0x0000006d,0x00040005,0x0000035b,
+0x61726170,0x0000006d,0x00040005,0x0000035f,
+0x61726170,0x0000006d,0x00040005,0x00000361,
+0x61726170,0x0000006d,0x00040005,0x00000363,
+0x61726170,0x0000006d,0x00030005,0x00000367,
+0x00003172,0x00040005,0x00000368,0x61726170,
+0x0000006d,0x00030005,0x0000036c,0x00003272,
+0x00040005,0x0000036f,0x61726170,0x0000006d,
+0x00040005,0x00000371,0x61726170,0x0000006d,
+0x00030005,0x00000374,0x00003167,0x00040005,
+0x00000375,0x61726170,0x0000006d,0x00030005,
+0x00000379,0x00003267,0x00040005,0x0000037c,
+0x61726170,0x0000006d,0x00040005,0x0000037e,
+0x61726170,0x0000006d,0x00030005,0x00000381,
+0x00003162,0x00040005,0x00000382,0x61726170,
+0x0000006d,0x00030005,0x00000386,0x00003262,
+0x00040005,0x00000389,0x61726170,0x0000006d,
+0x00040005,0x0000038b,0x61726170,0x0000006d,
+0x00040005,0x00000392,0x61726170,0x0000006d,
+0x00040005,0x00000397,0x61726170,0x0000006d,
+0x00040005,0x0000039c,0x61726170,0x0000006d,
+0x00040005,0x000003a1,0x61726170,0x0000006d,
+0x00040005,0x000003a6,0x61726170,0x0000006d,
+0x00040005,0x000003ab,0x61726170,0x0000006d,
+0x00050005,0x000003ae,0x6c626174,0x646e4965,
+0x00417865,0x00050005,0x000003b2,0x6c626174,
+0x646e4965,0x00427865,0x00040005,0x000003bc,
+0x6c626174,0x00004165,0x00050005,0x000003e2,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x000003e5,0x6c626174,0x00004265,0x00050005,
+0x000003e7,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x000003f5,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x000003f9,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x000003fc,
+0x70696c66,0x00646570,0x00030005,0x00000400,
+0x00746572,0x00040005,0x00000402,0x61726170,
+0x0000006d,0x00040005,0x00000404,0x61726170,
+0x0000006d,0x00040005,0x00000406,0x61726170,
+0x0000006d,0x00040005,0x00000408,0x61726170,
+0x0000006d,0x00040005,0x0000040a,0x61726170,
+0x0000006d,0x00040005,0x0000040c,0x61726170,
+0x0000006d,0x00040005,0x0000040e,0x61726170,
+0x0000006d,0x00040005,0x0000040f,0x61726170,
+0x0000006d,0x00040005,0x00000411,0x61726170,
+0x0000006d,0x00040005,0x00000413,0x61726170,
+0x0000006d,0x00040005,0x00000418,0x61726170,
+0x0000006d,0x00040005,0x0000041a,0x61726170,
+0x0000006d,0x00040005,0x0000041c,0x61726170,
+0x0000006d,0x00040005,0x0000041e,0x61726170,
+0x0000006d,0x00040005,0x00000420,0x61726170,
+0x0000006d,0x00040005,0x00000422,0x61726170,
+0x0000006d,0x00040005,0x00000424,0x61726170,
+0x0000006d,0x00040005,0x00000425,0x61726170,
+0x0000006d,0x00040005,0x00000427,0x61726170,
+0x0000006d,0x00040005,0x00000429,0x61726170,
+0x0000006d,0x00030005,0x00000430,0x00003261,
+0x00030005,0x0000043a,0x00003262,0x00030005,
+0x00000449,0x00736f70,0x00080005,0x0000044c,
+0x475f6c67,0x61626f6c,0x766e496c,0x7461636f,
+0x496e6f69,0x00000044,0x00070005,0x0000044f,
+0x67616d49,0x726f4665,0x4274616d,0x6b636f6c,
+0x00000000,0x00060006,0x0000044f,0x00000000,
+0x706d6f63,0x6d726f46,0x00007461,0x00060006,
+0x0000044f,0x00000001,0x65736162,0x6579614c,
+0x00000072,0x00060005,0x00000451,0x75705f75,
+0x6f436873,0x6174736e,0x0000746e,0x00050005,
+0x0000045a,0x42637273,0x6b636f6c,0x00000000,
+0x00050005,0x0000045d,0x6d695f75,0x30656761,
+0x00000000,0x00040005,0x0000045f,0x61726170,
+0x0000006d,0x00070005,0x00000465,0x75507369,
+0x7468636e,0x756f7268,0x6c416867,0x00616870,
+0x00060005,0x00000472,0x6f636564,0x6572706d,
+0x64657373,0x00000000,0x00040005,0x00000479,
+0x61726170,0x0000006d,0x00040005,0x0000047a,
+0x61726170,0x0000006d,0x00040005,0x00000482,
+0x61726170,0x0000006d,0x00040005,0x00000483,
+0x61726170,0x0000006d,0x00040005,0x00000485,
+0x61726170,0x0000006d,0x00040005,0x00000486,
+0x61726170,0x0000006d,0x00040005,0x00000487,
+0x61726170,0x0000006d,0x00030005,0x0000048a,
+0x00000079,0x00030005,0x00000492,0x00000078,
+0x00050005,0x0000049c,0x6d695f75,0x31656761,
+0x00000000,0x00040005,0x000004ac,0x61726170,
+0x0000006d,0x00040047,0x0000044c,0x0000000b,
+0x0000001c,0x00050048,0x0000044f,0x00000000,
+0x00000023,0x00000000,0x00050048,0x0000044f,
+0x00000001,0x00000023,0x00000004,0x00030047,
+0x0000044f,0x00000002,0x00040047,0x0000045d,
+0x00000022,0x00000000,0x00040047,0x0000045d,
+0x00000021,0x00000000,0x00030047,0x0000045d,
+0x00000018,0x00040047,0x0000049c,0x00000022,
+0x00000000,0x00040047,0x0000049c,0x00000021,
+0x00000001,0x00030047,0x0000049c,0x00000019,
+0x00040047,0x000004ec,0x0000000b,0x00000019,
+0x00020013,0x00000002,0x00030021,0x00000003,
+0x00000002,0x00040015,0x00000006,0x00000020,
+0x00000001,0x00040017,0x00000007,0x00000006,
+0x00000003,0x00040020,0x00000008,0x00000007,
+0x00000007,0x00040021,0x00000009,0x00000007,
+0x00000008,0x00040015,0x0000000d,0x00000020,
+0x00000000,0x00040020,0x0000000e,0x00000007,
+0x0000000d,0x00020014,0x0000000f,0x00050021,
+0x00000010,0x0000000f,0x0000000e,0x0000000e,
+0x00040021,0x00000015,0x0000000d,0x0000000e,
+0x00050021,0x00000022,0x0000000d,0x0000000e,
+0x0000000e,0x00040020,0x00000027,0x00000007,
+0x00000006,0x00040021,0x00000028,0x00000006,
+0x00000027,0x0004002b,0x0000000d,0x0000002f,
+0x00000004,0x0004001c,0x00000030,0x00000007,
+0x0000002f,0x00040020,0x00000031,0x00000007,
+0x00000030,0x00040020,0x00000032,0x00000007,
+0x0000000f,0x00040017,0x00000033,0x00000006,
+0x00000004,0x0004002b,0x0000000d,0x00000034,
+0x00000010,0x0004001c,0x00000035,0x00000033,
+0x00000034,0x00070021,0x00000036,0x00000035,
+0x00000031,0x0000000e,0x00000032,0x00000032,
+0x00070021,0x0000003d,0x00000035,0x0000000e,
+0x0000000e,0x00000032,0x00000032,0x00060021,
+0x0000004a,0x00000035,0x0000000e,0x0000000e,
+0x00000032,0x00040020,0x00000050,0x00000007,
+0x00000035,0x00040020,0x00000051,0x00000007,
+0x00000033,0x000d0021,0x00000052,0x00000002,
+0x00000050,0x00000027,0x00000027,0x00000027,
+0x00000051,0x0000000e,0x00000032,0x00000032,
+0x00000032,0x00000032,0x0004002b,0x0000000d,
+0x0000006c,0x0000001f,0x0004002b,0x0000000d,
+0x00000070,0x00000008,0x0004001c,0x00000071,
+0x00000006,0x00000070,0x0004002b,0x00000006,
+0x00000072,0x00000000,0x0004002b,0x00000006,
+0x00000073,0x00000001,0x0004002b,0x00000006,
+0x00000074,0x00000002,0x0004002b,0x00000006,
+0x00000075,0x00000003,0x0004002b,0x00000006,
+0x00000076,0xfffffffc,0x0004002b,0x00000006,
+0x00000077,0xfffffffd,0x0004002b,0x00000006,
+0x00000078,0xfffffffe,0x0004002b,0x00000006,
+0x00000079,0xffffffff,0x000b002c,0x00000071,
+0x0000007a,0x00000072,0x00000073,0x00000074,
+0x00000075,0x00000076,0x00000077,0x00000078,
+0x00000079,0x0004002b,0x0000000d,0x0000007b,
+0x00000007,0x00040020,0x0000007e,0x00000007,
+0x00000071,0x0004002b,0x00000006,0x00000086,
+0x00000020,0x0004002b,0x0000000d,0x0000008d,
+0x0000000f,0x0004002b,0x00000006,0x00000090,
+0x00000004,0x0004002b,0x0000000d,0x000000a2,
+0x0000003f,0x0004002b,0x0000000d,0x000000ad,
+0x0000007f,0x0004002b,0x00000006,0x000000b2,
+0x00000006,0x0004002b,0x00000006,0x000000c6,
+0x000000ff,0x0004002b,0x0000000d,0x000000d5,
+0x00000000,0x0004002b,0x0000000d,0x000000ef,
+0x00000002,0x0004002b,0x0000000d,0x000000f5,
+0x00000001,0x0007002c,0x00000033,0x00000108,
+0x00000072,0x00000072,0x00000072,0x00000072,
+0x0004002b,0x00000006,0x00000124,0x0000001b,
+0x0004002b,0x0000000d,0x00000126,0x00000003,
+0x0004002b,0x00000006,0x0000012a,0x00000018,
+0x0004002b,0x00000006,0x00000133,0x00000014,
+0x0004002b,0x00000006,0x0000013a,0x00000010,
+0x0004002b,0x00000006,0x00000141,0x0000000c,
+0x0004002b,0x00000006,0x00000148,0x00000008,
+0x0004002b,0x00000006,0x0000015d,0x0000000b,
+0x0004002b,0x00000006,0x0000015e,0x00000017,
+0x0004002b,0x00000006,0x0000015f,0x00000029,
+0x0004002b,0x00000006,0x00000160,0x00000040,
+0x000b002c,0x00000071,0x00000161,0x00000075,
+0x000000b2,0x0000015d,0x0000013a,0x0000015e,
+0x00000086,0x0000015f,0x00000160,0x0004002b,
+0x00000006,0x000001b1,0x00000013,0x0004002b,
+0x00000006,0x000001b5,0x0000000f,0x0004002b,
+0x00000006,0x000001c5,0x00000007,0x0004002b,
+0x00000006,0x00000230,0x00000019,0x0004002b,
+0x00000006,0x0000023a,0x00000011,0x0004002b,
+0x00000006,0x00000244,0x00000005,0x0004002b,
+0x00000006,0x0000026c,0x0000000d,0x0004002b,
+0x00000006,0x00000390,0x0000001c,0x0004001c,
+0x000003bd,0x00000033,0x00000070,0x0004002b,
+0x00000006,0x000003be,0xfffffff8,0x0007002c,
+0x00000033,0x000003bf,0x00000074,0x00000148,
+0x00000078,0x000003be,0x0004002b,0x00000006,
+0x000003c0,0xfffffffb,0x0004002b,0x00000006,
+0x000003c1,0xffffffef,0x0007002c,0x00000033,
+0x000003c2,0x00000244,0x0000023a,0x000003c0,
+0x000003c1,0x0004002b,0x00000006,0x000003c3,
+0x00000009,0x0004002b,0x00000006,0x000003c4,
+0x0000001d,0x0004002b,0x00000006,0x000003c5,
+0xfffffff7,0x0004002b,0x00000006,0x000003c6,
+0xffffffe3,0x0007002c,0x00000033,0x000003c7,
+0x000003c3,0x000003c4,0x000003c5,0x000003c6,
+0x0004002b,0x00000006,0x000003c8,0x0000002a,
+0x0004002b,0x00000006,0x000003c9,0xfffffff3,
+0x0004002b,0x00000006,0x000003ca,0xffffffd6,
+0x0007002c,0x00000033,0x000003cb,0x0000026c,
+0x000003c8,0x000003c9,0x000003ca,0x0004002b,
+0x00000006,0x000003cc,0x00000012,0x0004002b,
+0x00000006,0x000003cd,0x0000003c,0x0004002b,
+0x00000006,0x000003ce,0xffffffee,0x0004002b,
+0x00000006,0x000003cf,0xffffffc4,0x0007002c,
+0x00000033,0x000003d0,0x000003cc,0x000003cd,
+0x000003ce,0x000003cf,0x0004002b,0x00000006,
+0x000003d1,0x00000050,0x0004002b,0x00000006,
+0x000003d2,0xffffffe8,0x0004002b,0x00000006,
+0x000003d3,0xffffffb0,0x0007002c,0x00000033,
+0x000003d4,0x0000012a,0x000003d1,0x000003d2,
+0x000003d3,0x0004002b,0x00000006,0x000003d5,
+0x00000021,0x0004002b,0x00000006,0x000003d6,
+0x0000006a,0x0004002b,0x00000006,0x000003d7,
+0xffffffdf,0x0004002b,0x00000006,0x000003d8,
+0xffffff96,0x0007002c,0x00000033,0x000003d9,
+0x000003d5,0x000003d6,0x000003d7,0x000003d8,
+0x0004002b,0x00000006,0x000003da,0x0000002f,
+0x0004002b,0x00000006,0x000003db,0x000000b7,
+0x0004002b,0x00000006,0x000003dc,0xffffffd1,
+0x0004002b,0x00000006,0x000003dd,0xffffff49,
+0x0007002c,0x00000033,0x000003de,0x000003da,
+0x000003db,0x000003dc,0x000003dd,0x000b002c,
+0x000003bd,0x000003df,0x000003bf,0x000003c2,
+0x000003c7,0x000003cb,0x000003d0,0x000003d4,
+0x000003d9,0x000003de,0x00040020,0x000003e1,
+0x00000007,0x000003bd,0x0007002c,0x00000033,
+0x000003eb,0x00000072,0x00000148,0x00000072,
+0x000003be,0x0007002c,0x00000033,0x000003ec,
+0x00000072,0x0000023a,0x00000072,0x000003c1,
+0x0007002c,0x00000033,0x000003ed,0x00000072,
+0x000003c4,0x00000072,0x000003c6,0x0007002c,
+0x00000033,0x000003ee,0x00000072,0x000003c8,
+0x00000072,0x000003ca,0x0007002c,0x00000033,
+0x000003ef,0x00000072,0x000003cd,0x00000072,
+0x000003cf,0x0007002c,0x00000033,0x000003f0,
+0x00000072,0x000003d1,0x00000072,0x000003d3,
+0x0007002c,0x00000033,0x000003f1,0x00000072,
+0x000003d6,0x00000072,0x000003d8,0x0007002c,
+0x00000033,0x000003f2,0x00000072,0x000003db,
+0x00000072,0x000003dd,0x000b002c,0x000003bd,
+0x000003f3,0x000003eb,0x000003ec,0x000003ed,
+0x000003ee,0x000003ef,0x000003f0,0x000003f1,
+0x000003f2,0x0003002a,0x0000000f,0x00000401,
+0x00030029,0x0000000f,0x00000417,0x0004002b,
+0x0000000d,0x00000432,0x000000ff,0x00040017,
+0x0000044a,0x0000000d,0x00000003,0x00040020,
+0x0000044b,0x00000001,0x0000044a,0x0004003b,
+0x0000044b,0x0000044c,0x00000001,0x0004001e,
+0x0000044f,0x0000000d,0x0000000d,0x00040020,
+0x00000450,0x00000009,0x0000044f,0x0004003b,
+0x00000450,0x00000451,0x00000009,0x00040020,
+0x00000452,0x00000009,0x0000000d,0x00090019,
+0x0000045b,0x0000000d,0x00000002,0x00000000,
+0x00000000,0x00000000,0x00000002,0x0000001f,
+0x00040020,0x0000045c,0x00000000,0x0000045b,
+0x0004003b,0x0000045c,0x0000045d,0x00000000,
+0x00040017,0x00000462,0x0000000d,0x00000004,
+0x0004002b,0x0000000d,0x00000468,0x00000095,
+0x0004002b,0x0000000d,0x0000046f,0x00000096,
+0x00090019,0x0000049a,0x0000000d,0x00000002,
+0x00000000,0x00000000,0x00000000,0x00000002,
+0x00000020,0x00040020,0x0000049b,0x00000000,
+0x0000049a,0x0004003b,0x0000049b,0x0000049c,
+0x00000000,0x00040017,0x0000049e,0x00000006,
+0x00000002,0x0004002b,0x0000000d,0x000004b9,
+0x00000093,0x0004002b,0x0000000d,0x000004ba,
+0x00000094,0x0004002b,0x0000000d,0x000004bb,
+0x00000097,0x0004002b,0x0000000d,0x000004bc,
+0x00000098,0x0004002b,0x0000000d,0x000004bd,
+0x00000099,0x0004002b,0x0000000d,0x000004be,
+0x0000009a,0x0004002b,0x0000000d,0x000004bf,
+0x0000009b,0x0004002b,0x0000000d,0x000004c0,
+0x0000009c,0x0004002b,0x0000000d,0x000004c1,
+0x00000020,0x0004001c,0x000004c2,0x00000033,
+0x000004c1,0x0004002b,0x00000006,0x000004c3,
+0xfffffffa,0x0004002b,0x00000006,0x000004c4,
+0xfffffff1,0x0007002c,0x00000033,0x000004c5,
+0x00000077,0x000004c3,0x000003c5,0x000004c4,
+0x0004002b,0x00000006,0x000004c6,0x0000000e,
+0x0007002c,0x00000033,0x000004c7,0x00000074,
+0x00000244,0x00000148,0x000004c6,0x0004002b,
+0x00000006,0x000004c8,0xfffffff9,0x0004002b,
+0x00000006,0x000004c9,0xfffffff6,0x0007002c,
+0x00000033,0x000004ca,0x00000077,0x000004c8,
+0x000004c9,0x000003c9,0x0007002c,0x00000033,
+0x000004cb,0x00000074,0x000000b2,0x000003c3,
+0x00000141,0x0007002c,0x00000033,0x000004cc,
+0x00000078,0x000003c0,0x000003be,0x000003c9,
+0x0007002c,0x00000033,0x000004cd,0x00000073,
+0x00000090,0x000001c5,0x00000141,0x0007002c,
+0x00000033,0x000004ce,0x00000078,0x00000076,
+0x000004c3,0x000003c9,0x0007002c,0x00000033,
+0x000004cf,0x00000073,0x00000075,0x00000244,
+0x00000141,0x0004002b,0x00000006,0x000004d0,
+0xfffffff4,0x0007002c,0x00000033,0x000004d1,
+0x00000077,0x000004c3,0x000003be,0x000004d0,
+0x0007002c,0x00000033,0x000004d2,0x00000074,
+0x00000244,0x000001c5,0x0000015d,0x0004002b,
+0x00000006,0x000004d3,0xfffffff5,0x0007002c,
+0x00000033,0x000004d4,0x00000077,0x000004c8,
+0x000003c5,0x000004d3,0x0004002b,0x00000006,
+0x000004d5,0x0000000a,0x0007002c,0x00000033,
+0x000004d6,0x00000074,0x000000b2,0x00000148,
+0x000004d5,0x0007002c,0x00000033,0x000004d7,
+0x00000076,0x000004c8,0x000003be,0x000004d3,
+0x0007002c,0x00000033,0x000004d8,0x00000075,
+0x000000b2,0x000001c5,0x000004d5,0x0007002c,
+0x00000033,0x000004d9,0x00000077,0x000003c0,
+0x000003be,0x000004d3,0x0007002c,0x00000033,
+0x000004da,0x00000074,0x00000090,0x000001c5,
+0x000004d5,0x0007002c,0x00000033,0x000004db,
+0x00000078,0x000004c3,0x000003be,0x000004c9,
+0x0007002c,0x00000033,0x000004dc,0x00000073,
+0x00000244,0x000001c5,0x000003c3,0x0007002c,
+0x00000033,0x000004dd,0x00000078,0x000003c0,
+0x000003be,0x000004c9,0x0007002c,0x00000033,
+0x000004de,0x00000073,0x00000090,0x000001c5,
+0x000003c3,0x0007002c,0x00000033,0x000004df,
+0x00000078,0x00000076,0x000003be,0x000004c9,
+0x0007002c,0x00000033,0x000004e0,0x00000073,
+0x00000075,0x000001c5,0x000003c3,0x0007002c,
+0x00000033,0x000004e1,0x00000078,0x000003c0,
+0x000004c8,0x000004c9,0x0007002c,0x00000033,
+0x000004e2,0x00000073,0x00000090,0x000000b2,
+0x000003c3,0x0007002c,0x00000033,0x000004e3,
+0x00000077,0x00000076,0x000004c8,0x000004c9,
+0x0007002c,0x00000033,0x000004e4,0x00000074,
+0x00000075,0x000000b2,0x000003c3,0x0007002c,
+0x00000033,0x000004e5,0x00000079,0x00000078,
+0x00000077,0x000004c9,0x0007002c,0x00000033,
+0x000004e6,0x00000072,0x00000073,0x00000074,
+0x000003c3,0x0007002c,0x00000033,0x000004e7,
+0x00000076,0x000004c3,0x000003be,0x000003c5,
+0x0007002c,0x00000033,0x000004e8,0x00000075,
+0x00000244,0x000001c5,0x00000148,0x0007002c,
+0x00000033,0x000004e9,0x00000077,0x000003c0,
+0x000004c8,0x000003c5,0x0007002c,0x00000033,
+0x000004ea,0x00000074,0x00000090,0x000000b2,
+0x00000148,0x0023002c,0x000004c2,0x000004eb,
+0x000004c5,0x000004c7,0x000004ca,0x000004cb,
+0x000004cc,0x000004cd,0x000004ce,0x000004cf,
+0x000004d1,0x000004d2,0x000004d4,0x000004d6,
+0x000004d7,0x000004d8,0x000004d9,0x000004da,
+0x000004db,0x000004dc,0x000004dd,0x000004de,
+0x000004df,0x000004e0,0x000004e1,0x000004e2,
+0x000004e3,0x000004e4,0x000004e5,0x000004e6,
+0x000004e7,0x000004e8,0x000004e9,0x000004ea,
+0x0006002c,0x0000044a,0x000004ec,0x00000070,
+0x00000070,0x000000f5,0x00050036,0x00000002,
+0x00000004,0x00000000,0x00000003,0x000200f8,
+0x00000005,0x0004003b,0x00000008,0x00000449,
+0x00000007,0x0004003b,0x00000051,0x0000045a,
+0x00000007,0x0004003b,0x00000008,0x0000045f,
+0x00000007,0x0004003b,0x00000032,0x00000465,
+0x00000007,0x0004003b,0x00000050,0x00000472,
+0x00000007,0x0004003b,0x0000000e,0x00000479,
+0x00000007,0x0004003b,0x0000000e,0x0000047a,
+0x00000007,0x0004003b,0x0000000e,0x00000482,
+0x00000007,0x0004003b,0x0000000e,0x00000483,
+0x00000007,0x0004003b,0x0000000e,0x00000485,
+0x00000007,0x0004003b,0x0000000e,0x00000486,
+0x00000007,0x0004003b,0x00000032,0x00000487,
+0x00000007,0x0004003b,0x00000027,0x0000048a,
+0x00000007,0x0004003b,0x00000027,0x00000492,
+0x00000007,0x0004003b,0x00000008,0x000004ac,
+0x00000007,0x0004003d,0x0000044a,0x0000044d,
+0x0000044c,0x0004007c,0x00000007,0x0000044e,
+0x0000044d,0x0003003e,0x00000449,0x0000044e,
+0x00050041,0x00000452,0x00000453,0x00000451,
+0x00000073,0x0004003d,0x0000000d,0x00000454,
+0x00000453,0x0004007c,0x00000006,0x00000455,
+0x00000454,0x00050041,0x00000027,0x00000456,
+0x00000449,0x000000ef,0x0004003d,0x00000006,
+0x00000457,0x00000456,0x00050080,0x00000006,
+0x00000458,0x00000457,0x00000455,0x00050041,
+0x00000027,0x00000459,0x00000449,0x000000ef,
+0x0003003e,0x00000459,0x00000458,0x0004003d,
+0x0000045b,0x0000045e,0x0000045d,0x0004003d,
+0x00000007,0x00000460,0x00000449,0x0003003e,
+0x0000045f,0x00000460,0x00050039,0x00000007,
+0x00000461,0x0000000b,0x0000045f,0x00050062,
+0x00000462,0x00000463,0x0000045e,0x00000461,
+0x0004007c,0x00000033,0x00000464,0x00000463,
+0x0003003e,0x0000045a,0x00000464,0x00050041,
+0x00000452,0x00000466,0x00000451,0x00000072,
+0x0004003d,0x0000000d,0x00000467,0x00000466,
+0x000500aa,0x0000000f,0x00000469,0x00000467,
+0x00000468,0x000400a8,0x0000000f,0x0000046a,
+0x00000469,0x000300f7,0x0000046c,0x00000000,
+0x000400fa,0x0000046a,0x0000046b,0x0000046c,
+0x000200f8,0x0000046b,0x00050041,0x00000452,
+0x0000046d,0x00000451,0x00000072,0x0004003d,
+0x0000000d,0x0000046e,0x0000046d,0x000500aa,
+0x0000000f,0x00000470,0x0000046e,0x0000046f,
+0x000200f9,0x0000046c,0x000200f8,0x0000046c,
+0x000700f5,0x0000000f,0x00000471,0x00000469,
+0x00000005,0x00000470,0x0000046b,0x0003003e,
+0x00000465,0x00000471,0x00050041,0x00000027,
+0x00000473,0x0000045a,0x000000d5,0x0004003d,
+0x00000006,0x00000474,0x00000473,0x0004007c,
+0x0000000d,0x00000475,0x00000474,0x00050041,
+0x00000027,0x00000476,0x0000045a,0x000000f5,
+0x0004003d,0x00000006,0x00000477,0x00000476,
+0x0004007c,0x0000000d,0x00000478,0x00000477,
+0x0003003e,0x00000479,0x00000475,0x0003003e,
+0x0000047a,0x00000478,0x00060039,0x0000000d,
+0x0000047b,0x00000066,0x00000479,0x0000047a,
+0x00050041,0x00000027,0x0000047c,0x0000045a,
+0x000000ef,0x0004003d,0x00000006,0x0000047d,
+0x0000047c,0x0004007c,0x0000000d,0x0000047e,
+0x0000047d,0x00050041,0x00000027,0x0000047f,
+0x0000045a,0x00000126,0x0004003d,0x00000006,
+0x00000480,0x0000047f,0x0004007c,0x0000000d,
+0x00000481,0x00000480,0x0003003e,0x00000482,
+0x0000047e,0x0003003e,0x00000483,0x00000481,
+0x00060039,0x0000000d,0x00000484,0x00000066,
+0x00000482,0x00000483,0x0003003e,0x00000485,
+0x0000047b,0x0003003e,0x00000486,0x00000484,
+0x0004003d,0x0000000f,0x00000488,0x00000465,
+0x0003003e,0x00000487,0x00000488,0x00070039,
+0x00000035,0x00000489,0x00000062,0x00000485,
+0x00000486,0x00000487,0x0003003e,0x00000472,
+0x00000489,0x0003003e,0x0000048a,0x00000072,
+0x000200f9,0x0000048b,0x000200f8,0x0000048b,
+0x000400f6,0x0000048d,0x0000048e,0x00000000,
+0x000200f9,0x0000048f,0x000200f8,0x0000048f,
+0x0004003d,0x00000006,0x00000490,0x0000048a,
+0x000500b1,0x0000000f,0x00000491,0x00000490,
+0x00000090,0x000400fa,0x00000491,0x0000048c,
+0x0000048d,0x000200f8,0x0000048c,0x0003003e,
+0x00000492,0x00000072,0x000200f9,0x00000493,
+0x000200f8,0x00000493,0x000400f6,0x00000495,
+0x00000496,0x00000000,0x000200f9,0x00000497,
+0x000200f8,0x00000497,0x0004003d,0x00000006,
+0x00000498,0x00000492,0x000500b1,0x0000000f,
+0x00000499,0x00000498,0x00000090,0x000400fa,
+0x00000499,0x00000494,0x00000495,0x000200f8,
+0x00000494,0x0004003d,0x0000049a,0x0000049d,
+0x0000049c,0x0004003d,0x00000007,0x0000049f,
+0x00000449,0x0007004f,0x0000049e,0x000004a0,
+0x0000049f,0x0000049f,0x00000000,0x00000001,
+0x00050050,0x0000049e,0x000004a1,0x00000090,
+0x00000090,0x00050084,0x0000049e,0x000004a2,
+0x000004a0,0x000004a1,0x0004003d,0x00000006,
+0x000004a3,0x00000492,0x0004003d,0x00000006,
+0x000004a4,0x0000048a,0x00050050,0x0000049e,
+0x000004a5,0x000004a3,0x000004a4,0x00050080,
+0x0000049e,0x000004a6,0x000004a2,0x000004a5,
+0x00050041,0x00000027,0x000004a7,0x00000449,
+0x000000ef,0x0004003d,0x00000006,0x000004a8,
+0x000004a7,0x00050051,0x00000006,0x000004a9,
+0x000004a6,0x00000000,0x00050051,0x00000006,
+0x000004aa,0x000004a6,0x00000001,0x00060050,
+0x00000007,0x000004ab,0x000004a9,0x000004aa,
+0x000004a8,0x0003003e,0x000004ac,0x000004ab,
+0x00050039,0x00000007,0x000004ad,0x0000000b,
+0x000004ac,0x0004003d,0x00000006,0x000004ae,
+0x0000048a,0x00050084,0x00000006,0x000004af,
+0x000004ae,0x00000090,0x0004003d,0x00000006,
+0x000004b0,0x00000492,0x00050080,0x00000006,
+0x000004b1,0x000004af,0x000004b0,0x00050041,
+0x00000051,0x000004b2,0x00000472,0x000004b1,
+0x0004003d,0x00000033,0x000004b3,0x000004b2,
+0x0004007c,0x00000462,0x000004b4,0x000004b3,
+0x00040063,0x0000049d,0x000004ad,0x000004b4,
+0x000200f9,0x00000496,0x000200f8,0x00000496,
+0x0004003d,0x00000006,0x000004b5,0x00000492,
+0x00050080,0x00000006,0x000004b6,0x000004b5,
+0x00000073,0x0003003e,0x00000492,0x000004b6,
+0x000200f9,0x00000493,0x000200f8,0x00000495,
+0x000200f9,0x0000048e,0x000200f8,0x0000048e,
+0x0004003d,0x00000006,0x000004b7,0x0000048a,
+0x00050080,0x00000006,0x000004b8,0x000004b7,
+0x00000073,0x0003003e,0x0000048a,0x000004b8,
+0x000200f9,0x0000048b,0x000200f8,0x0000048d,
+0x000100fd,0x00010038,0x00050036,0x00000007,
+0x0000000b,0x00000000,0x00000009,0x00030037,
+0x00000008,0x0000000a,0x000200f8,0x0000000c,
+0x0004003d,0x00000007,0x00000068,0x0000000a,
+0x000200fe,0x00000068,0x00010038,0x00050036,
+0x0000000f,0x00000013,0x00000000,0x00000010,
+0x00030037,0x0000000e,0x00000011,0x00030037,
+0x0000000e,0x00000012,0x000200f8,0x00000014,
+0x0004003b,0x00000027,0x0000006b,0x00000007,
+0x0004003b,0x0000007e,0x0000007f,0x00000007,
+0x0004003d,0x0000000d,0x0000006d,0x00000011,
+0x000500c7,0x0000000d,0x0000006e,0x0000006c,
+0x0000006d,0x0004007c,0x00000006,0x0000006f,
+0x0000006e,0x0004003d,0x0000000d,0x0000007c,
+0x00000012,0x000500c7,0x0000000d,0x0000007d,
+0x0000007b,0x0000007c,0x0003003e,0x0000007f,
+0x0000007a,0x00050041,0x00000027,0x00000080,
+0x0000007f,0x0000007d,0x0004003d,0x00000006,
+0x00000081,0x00000080,0x00050080,0x00000006,
+0x00000082,0x0000006f,0x00000081,0x0003003e,
+0x0000006b,0x00000082,0x0004003d,0x00000006,
+0x00000083,0x0000006b,0x000500b1,0x0000000f,
+0x00000084,0x00000083,0x00000072,0x0004003d,
+0x00000006,0x00000085,0x0000006b,0x000500af,
+0x0000000f,0x00000087,0x00000085,0x00000086,
+0x000500a6,0x0000000f,0x00000088,0x00000084,
+0x00000087,0x000200fe,0x00000088,0x00010038,
+0x00050036,0x0000000d,0x00000017,0x00000000,
+0x00000015,0x00030037,0x0000000e,0x00000016,
+0x000200f8,0x00000018,0x0004003b,0x0000000e,
+0x0000008b,0x00000007,0x0004003d,0x0000000d,
+0x0000008c,0x00000016,0x000500c7,0x0000000d,
+0x0000008e,0x0000008c,0x0000008d,0x0003003e,
+0x0000008b,0x0000008e,0x0004003d,0x0000000d,
+0x0000008f,0x0000008b,0x000500c4,0x0000000d,
+0x00000091,0x0000008f,0x00000090,0x0004003d,
+0x0000000d,0x00000092,0x0000008b,0x000500c5,
+0x0000000d,0x00000093,0x00000091,0x00000092,
+0x000200fe,0x00000093,0x00010038,0x00050036,
+0x0000000d,0x0000001a,0x00000000,0x00000015,
+0x00030037,0x0000000e,0x00000019,0x000200f8,
+0x0000001b,0x0004003b,0x0000000e,0x00000096,
+0x00000007,0x0004003d,0x0000000d,0x00000097,
+0x00000019,0x000500c7,0x0000000d,0x00000098,
+0x00000097,0x0000006c,0x0003003e,0x00000096,
+0x00000098,0x0004003d,0x0000000d,0x00000099,
+0x00000096,0x000500c4,0x0000000d,0x0000009a,
+0x00000099,0x00000075,0x0004003d,0x0000000d,
+0x0000009b,0x00000096,0x000500c2,0x0000000d,
+0x0000009c,0x0000009b,0x00000074,0x000500c5,
+0x0000000d,0x0000009d,0x0000009a,0x0000009c,
+0x000200fe,0x0000009d,0x00010038,0x00050036,
+0x0000000d,0x0000001d,0x00000000,0x00000015,
+0x00030037,0x0000000e,0x0000001c,0x000200f8,
+0x0000001e,0x0004003b,0x0000000e,0x000000a0,
+0x00000007,0x0004003d,0x0000000d,0x000000a1,
+0x0000001c,0x000500c7,0x0000000d,0x000000a3,
+0x000000a1,0x000000a2,0x0003003e,0x000000a0,
+0x000000a3,0x0004003d,0x0000000d,0x000000a4,
+0x000000a0,0x000500c4,0x0000000d,0x000000a5,
+0x000000a4,0x00000074,0x0004003d,0x0000000d,
+0x000000a6,0x000000a0,0x000500c2,0x0000000d,
+0x000000a7,0x000000a6,0x00000090,0x000500c5,
+0x0000000d,0x000000a8,0x000000a5,0x000000a7,
+0x000200fe,0x000000a8,0x00010038,0x00050036,
+0x0000000d,0x00000020,0x00000000,0x00000015,
+0x00030037,0x0000000e,0x0000001f,0x000200f8,
+0x00000021,0x0004003b,0x0000000e,0x000000ab,
+0x00000007,0x0004003d,0x0000000d,0x000000ac,
+0x0000001f,0x000500c7,0x0000000d,0x000000ae,
+0x000000ac,0x000000ad,0x0003003e,0x000000ab,
+0x000000ae,0x0004003d,0x0000000d,0x000000af,
+0x000000ab,0x000500c4,0x0000000d,0x000000b0,
+0x000000af,0x00000073,0x0004003d,0x0000000d,
+0x000000b1,0x000000ab,0x000500c2,0x0000000d,
+0x000000b3,0x000000b1,0x000000b2,0x000500c5,
+0x0000000d,0x000000b4,0x000000b0,0x000000b3,
+0x000200fe,0x000000b4,0x00010038,0x00050036,
+0x0000000d,0x00000025,0x00000000,0x00000022,
+0x00030037,0x0000000e,0x00000023,0x00030037,
+0x0000000e,0x00000024,0x000200f8,0x00000026,
+0x0004003b,0x0000007e,0x000000bc,0x00000007,
+0x0004003b,0x0000000e,0x000000c1,0x00000007,
+0x0004003d,0x0000000d,0x000000b7,0x00000023,
+0x000500c7,0x0000000d,0x000000b8,0x0000006c,
+0x000000b7,0x0004007c,0x00000006,0x000000b9,
+0x000000b8,0x0004003d,0x0000000d,0x000000ba,
+0x00000024,0x000500c7,0x0000000d,0x000000bb,
+0x0000007b,0x000000ba,0x0003003e,0x000000bc,
+0x0000007a,0x00050041,0x00000027,0x000000bd,
+0x000000bc,0x000000bb,0x0004003d,0x00000006,
+0x000000be,0x000000bd,0x00050080,0x00000006,
+0x000000bf,0x000000b9,0x000000be,0x0004007c,
+0x0000000d,0x000000c0,0x000000bf,0x0003003e,
+0x000000c1,0x000000c0,0x00050039,0x0000000d,
+0x000000c2,0x0000001a,0x000000c1,0x000200fe,
+0x000000c2,0x00010038,0x00050036,0x00000006,
+0x0000002a,0x00000000,0x00000028,0x00030037,
+0x00000027,0x00000029,0x000200f8,0x0000002b,
+0x0004003d,0x00000006,0x000000c5,0x00000029,
+0x0008000c,0x00000006,0x000000c7,0x00000001,
+0x0000002d,0x000000c5,0x00000072,0x000000c6,
+0x000200fe,0x000000c7,0x00010038,0x00050036,
+0x00000007,0x0000002d,0x00000000,0x00000009,
+0x00030037,0x00000008,0x0000002c,0x000200f8,
+0x0000002e,0x0004003d,0x00000007,0x000000ca,
+0x0000002c,0x00060050,0x00000007,0x000000cb,
+0x00000072,0x00000072,0x00000072,0x00060050,
+0x00000007,0x000000cc,0x000000c6,0x000000c6,
+0x000000c6,0x0008000c,0x00000007,0x000000cd,
+0x00000001,0x0000002d,0x000000ca,0x000000cb,
+0x000000cc,0x00050051,0x00000006,0x000000ce,
+0x000000cd,0x00000000,0x00050051,0x00000006,
+0x000000cf,0x000000cd,0x00000001,0x00050051,
+0x00000006,0x000000d0,0x000000cd,0x00000002,
+0x00060050,0x00000007,0x000000d1,0x000000ce,
+0x000000cf,0x000000d0,0x000200fe,0x000000d1,
+0x00010038,0x00050036,0x00000035,0x0000003b,
+0x00000000,0x00000036,0x00030037,0x00000031,
+0x00000037,0x00030037,0x0000000e,0x00000038,
+0x00030037,0x00000032,0x00000039,0x00030037,
+0x00000032,0x0000003a,0x000200f8,0x0000003c,
+0x0004003b,0x0000000e,0x000000d4,0x00000007,
+0x0004003b,0x0000000e,0x000000dd,0x00000007,
+0x0004003b,0x0000000e,0x000000e5,0x00000007,
+0x0004003b,0x0000000e,0x000000ea,0x00000007,
+0x0004003b,0x0000000e,0x000000f1,0x00000007,
+0x0004003b,0x00000050,0x00000103,0x00000007,
+0x0004003b,0x0000000e,0x0000010b,0x00000007,
+0x0003003e,0x000000d4,0x000000d5,0x000200f9,
+0x000000d6,0x000200f8,0x000000d6,0x000400f6,
+0x000000d8,0x000000d9,0x00000000,0x000200f9,
+0x000000da,0x000200f8,0x000000da,0x0004003d,
+0x0000000d,0x000000db,0x000000d4,0x000500b0,
+0x0000000f,0x000000dc,0x000000db,0x0000002f,
+0x000400fa,0x000000dc,0x000000d7,0x000000d8,
+0x000200f8,0x000000d7,0x0003003e,0x000000dd,
+0x000000d5,0x000200f9,0x000000de,0x000200f8,
+0x000000de,0x000400f6,0x000000e0,0x000000e1,
+0x00000000,0x000200f9,0x000000e2,0x000200f8,
+0x000000e2,0x0004003d,0x0000000d,0x000000e3,
+0x000000dd,0x000500b0,0x0000000f,0x000000e4,
+0x000000e3,0x0000002f,0x000400fa,0x000000e4,
+0x000000df,0x000000e0,0x000200f8,0x000000df,
+0x0004003d,0x0000000d,0x000000e6,0x000000d4,
+0x0004003d,0x0000000d,0x000000e7,0x000000dd,
+0x00050084,0x0000000d,0x000000e8,0x000000e7,
+0x0000002f,0x00050080,0x0000000d,0x000000e9,
+0x000000e6,0x000000e8,0x0003003e,0x000000e5,
+0x000000e9,0x0004003d,0x0000000d,0x000000eb,
+0x00000038,0x0004003d,0x0000000d,0x000000ec,
+0x000000e5,0x00050080,0x0000000d,0x000000ed,
+0x000000ec,0x0000008d,0x000500c2,0x0000000d,
+0x000000ee,0x000000eb,0x000000ed,0x000500c7,
+0x0000000d,0x000000f0,0x000000ee,0x000000ef,
+0x0003003e,0x000000ea,0x000000f0,0x0004003d,
+0x0000000d,0x000000f2,0x00000038,0x0004003d,
+0x0000000d,0x000000f3,0x000000e5,0x000500c2,
+0x0000000d,0x000000f4,0x000000f2,0x000000f3,
+0x000500c7,0x0000000d,0x000000f6,0x000000f4,
+0x000000f5,0x0003003e,0x000000f1,0x000000f6,
+0x0004003d,0x0000000f,0x000000f7,0x00000039,
+0x0004003d,0x0000000f,0x000000f8,0x0000003a,
+0x000400a8,0x0000000f,0x000000f9,0x000000f8,
+0x000500a7,0x0000000f,0x000000fa,0x000000f7,
+0x000000f9,0x0004003d,0x0000000d,0x000000fb,
+0x000000ea,0x000500ab,0x0000000f,0x000000fc,
+0x000000fb,0x000000d5,0x000500a7,0x0000000f,
+0x000000fd,0x000000fa,0x000000fc,0x0004003d,
+0x0000000d,0x000000fe,0x000000f1,0x000500aa,
+0x0000000f,0x000000ff,0x000000fe,0x000000d5,
+0x000500a7,0x0000000f,0x00000100,0x000000fd,
+0x000000ff,0x000300f7,0x00000102,0x00000000,
+0x000400fa,0x00000100,0x00000101,0x0000010a,
+0x000200f8,0x00000101,0x0004003d,0x0000000d,
+0x00000104,0x000000d4,0x00050084,0x0000000d,
+0x00000105,0x00000104,0x0000002f,0x0004003d,
+0x0000000d,0x00000106,0x000000dd,0x00050080,
+0x0000000d,0x00000107,0x00000105,0x00000106,
+0x00050041,0x00000051,0x00000109,0x00000103,
+0x00000107,0x0003003e,0x00000109,0x00000108,
+0x000200f9,0x00000102,0x000200f8,0x0000010a,
+0x0004003d,0x0000000d,0x0000010c,0x000000f1,
+0x0004003d,0x0000000d,0x0000010d,0x000000ea,
+0x000500c5,0x0000000d,0x0000010e,0x0000010c,
+0x0000010d,0x0003003e,0x0000010b,0x0000010e,
+0x0004003d,0x0000000d,0x0000010f,0x000000d4,
+0x00050084,0x0000000d,0x00000110,0x0000010f,
+0x0000002f,0x0004003d,0x0000000d,0x00000111,
+0x000000dd,0x00050080,0x0000000d,0x00000112,
+0x00000110,0x00000111,0x0004003d,0x0000000d,
+0x00000113,0x0000010b,0x00050041,0x00000008,
+0x00000114,0x00000037,0x00000113,0x0004003d,
+0x00000007,0x00000115,0x00000114,0x00050051,
+0x00000006,0x00000116,0x00000115,0x00000000,
+0x00050051,0x00000006,0x00000117,0x00000115,
+0x00000001,0x00050051,0x00000006,0x00000118,
+0x00000115,0x00000002,0x00070050,0x00000033,
+0x00000119,0x00000116,0x00000117,0x00000118,
+0x000000c6,0x00050041,0x00000051,0x0000011a,
+0x00000103,0x00000112,0x0003003e,0x0000011a,
+0x00000119,0x000200f9,0x00000102,0x000200f8,
+0x00000102,0x000200f9,0x000000e1,0x000200f8,
+0x000000e1,0x0004003d,0x0000000d,0x0000011b,
+0x000000dd,0x00050080,0x0000000d,0x0000011c,
+0x0000011b,0x00000073,0x0003003e,0x000000dd,
+0x0000011c,0x000200f9,0x000000de,0x000200f8,
+0x000000e0,0x000200f9,0x000000d9,0x000200f8,
+0x000000d9,0x0004003d,0x0000000d,0x0000011d,
+0x000000d4,0x00050080,0x0000000d,0x0000011e,
+0x0000011d,0x00000073,0x0003003e,0x000000d4,
+0x0000011e,0x000200f9,0x000000d6,0x000200f8,
+0x000000d8,0x0004003d,0x00000035,0x0000011f,
+0x00000103,0x000200fe,0x0000011f,0x00010038,
+0x00050036,0x00000035,0x00000042,0x00000000,
+0x0000003d,0x00030037,0x0000000e,0x0000003e,
+0x00030037,0x0000000e,0x0000003f,0x00030037,
+0x00000032,0x00000040,0x00030037,0x00000032,
+0x00000041,0x000200f8,0x00000043,0x0004003b,
+0x00000027,0x00000122,0x00000007,0x0004003b,
+0x0000000e,0x0000012e,0x00000007,0x0004003b,
+0x00000027,0x00000131,0x00000007,0x0004003b,
+0x0000000e,0x00000135,0x00000007,0x0004003b,
+0x00000027,0x00000138,0x00000007,0x0004003b,
+0x0000000e,0x0000013c,0x00000007,0x0004003b,
+0x00000027,0x0000013f,0x00000007,0x0004003b,
+0x0000000e,0x00000143,0x00000007,0x0004003b,
+0x00000027,0x00000146,0x00000007,0x0004003b,
+0x0000000e,0x0000014a,0x00000007,0x0004003b,
+0x00000027,0x0000014d,0x00000007,0x0004003b,
+0x0000000e,0x00000150,0x00000007,0x0004003b,
+0x00000027,0x00000153,0x00000007,0x0004003b,
+0x00000027,0x0000015c,0x00000007,0x0004003b,
+0x0000007e,0x00000163,0x00000007,0x0004003b,
+0x00000031,0x00000166,0x00000007,0x0004003b,
+0x00000027,0x0000016f,0x00000007,0x0004003b,
+0x00000027,0x00000174,0x00000007,0x0004003b,
+0x00000027,0x00000179,0x00000007,0x0004003b,
+0x00000027,0x00000185,0x00000007,0x0004003b,
+0x00000027,0x0000018a,0x00000007,0x0004003b,
+0x00000027,0x0000018f,0x00000007,0x0004003b,
+0x00000031,0x00000193,0x00000007,0x0004003b,
+0x0000000e,0x00000195,0x00000007,0x0004003b,
+0x00000032,0x00000197,0x00000007,0x0004003b,
+0x00000032,0x00000199,0x00000007,0x0004003d,
+0x0000000d,0x00000123,0x0000003e,0x000500c2,
+0x0000000d,0x00000125,0x00000123,0x00000124,
+0x000500c7,0x0000000d,0x00000127,0x00000125,
+0x00000126,0x000500c4,0x0000000d,0x00000128,
+0x00000127,0x00000074,0x0004003d,0x0000000d,
+0x00000129,0x0000003e,0x000500c2,0x0000000d,
+0x0000012b,0x00000129,0x0000012a,0x000500c7,
+0x0000000d,0x0000012c,0x0000012b,0x00000126,
+0x000500c5,0x0000000d,0x0000012d,0x00000128,
+0x0000012c,0x0003003e,0x0000012e,0x0000012d,
+0x00050039,0x0000000d,0x0000012f,0x00000017,
+0x0000012e,0x0004007c,0x00000006,0x00000130,
+0x0000012f,0x0003003e,0x00000122,0x00000130,
+0x0004003d,0x0000000d,0x00000132,0x0000003e,
+0x000500c2,0x0000000d,0x00000134,0x00000132,
+0x00000133,0x0003003e,0x00000135,0x00000134,
+0x00050039,0x0000000d,0x00000136,0x00000017,
+0x00000135,0x0004007c,0x00000006,0x00000137,
+0x00000136,0x0003003e,0x00000131,0x00000137,
+0x0004003d,0x0000000d,0x00000139,0x0000003e,
+0x000500c2,0x0000000d,0x0000013b,0x00000139,
+0x0000013a,0x0003003e,0x0000013c,0x0000013b,
+0x00050039,0x0000000d,0x0000013d,0x00000017,
+0x0000013c,0x0004007c,0x00000006,0x0000013e,
+0x0000013d,0x0003003e,0x00000138,0x0000013e,
+0x0004003d,0x0000000d,0x00000140,0x0000003e,
+0x000500c2,0x0000000d,0x00000142,0x00000140,
+0x00000141,0x0003003e,0x00000143,0x00000142,
+0x00050039,0x0000000d,0x00000144,0x00000017,
+0x00000143,0x0004007c,0x00000006,0x00000145,
+0x00000144,0x0003003e,0x0000013f,0x00000145,
+0x0004003d,0x0000000d,0x00000147,0x0000003e,
+0x000500c2,0x0000000d,0x00000149,0x00000147,
+0x00000148,0x0003003e,0x0000014a,0x00000149,
+0x00050039,0x0000000d,0x0000014b,0x00000017,
+0x0000014a,0x0004007c,0x00000006,0x0000014c,
+0x0000014b,0x0003003e,0x00000146,0x0000014c,
+0x0004003d,0x0000000d,0x0000014e,0x0000003e,
+0x000500c2,0x0000000d,0x0000014f,0x0000014e,
+0x00000090,0x0003003e,0x00000150,0x0000014f,
+0x00050039,0x0000000d,0x00000151,0x00000017,
+0x00000150,0x0004007c,0x00000006,0x00000152,
+0x00000151,0x0003003e,0x0000014d,0x00000152,
+0x0004003d,0x0000000d,0x00000154,0x0000003e,
+0x000500c2,0x0000000d,0x00000155,0x00000154,
+0x00000074,0x000500c7,0x0000000d,0x00000156,
+0x00000155,0x00000126,0x000500c4,0x0000000d,
+0x00000157,0x00000156,0x00000073,0x0004003d,
+0x0000000d,0x00000158,0x0000003e,0x000500c7,
+0x0000000d,0x00000159,0x00000158,0x000000f5,
+0x000500c5,0x0000000d,0x0000015a,0x00000157,
+0x00000159,0x0004007c,0x00000006,0x0000015b,
+0x0000015a,0x0003003e,0x00000153,0x0000015b,
+0x0004003d,0x00000006,0x00000162,0x00000153,
+0x0003003e,0x00000163,0x00000161,0x00050041,
+0x00000027,0x00000164,0x00000163,0x00000162,
+0x0004003d,0x00000006,0x00000165,0x00000164,
+0x0003003e,0x0000015c,0x00000165,0x0004003d,
+0x00000006,0x00000167,0x00000122,0x0004003d,
+0x00000006,0x00000168,0x00000131,0x0004003d,
+0x00000006,0x00000169,0x00000138,0x00060050,
+0x00000007,0x0000016a,0x00000167,0x00000168,
+0x00000169,0x00050041,0x00000008,0x0000016b,
+0x00000166,0x00000072,0x0003003e,0x0000016b,
+0x0000016a,0x0004003d,0x00000006,0x0000016c,
+0x0000013f,0x0004003d,0x00000006,0x0000016d,
+0x0000015c,0x00050080,0x00000006,0x0000016e,
+0x0000016c,0x0000016d,0x0003003e,0x0000016f,
+0x0000016e,0x00050039,0x00000006,0x00000170,
+0x0000002a,0x0000016f,0x0004003d,0x00000006,
+0x00000171,0x00000146,0x0004003d,0x00000006,
+0x00000172,0x0000015c,0x00050080,0x00000006,
+0x00000173,0x00000171,0x00000172,0x0003003e,
+0x00000174,0x00000173,0x00050039,0x00000006,
+0x00000175,0x0000002a,0x00000174,0x0004003d,
+0x00000006,0x00000176,0x0000014d,0x0004003d,
+0x00000006,0x00000177,0x0000015c,0x00050080,
+0x00000006,0x00000178,0x00000176,0x00000177,
+0x0003003e,0x00000179,0x00000178,0x00050039,
+0x00000006,0x0000017a,0x0000002a,0x00000179,
+0x00060050,0x00000007,0x0000017b,0x00000170,
+0x00000175,0x0000017a,0x00050041,0x00000008,
+0x0000017c,0x00000166,0x00000073,0x0003003e,
+0x0000017c,0x0000017b,0x0004003d,0x00000006,
+0x0000017d,0x0000013f,0x0004003d,0x00000006,
+0x0000017e,0x00000146,0x0004003d,0x00000006,
+0x0000017f,0x0000014d,0x00060050,0x00000007,
+0x00000180,0x0000017d,0x0000017e,0x0000017f,
+0x00050041,0x00000008,0x00000181,0x00000166,
+0x00000074,0x0003003e,0x00000181,0x00000180,
+0x0004003d,0x00000006,0x00000182,0x0000013f,
+0x0004003d,0x00000006,0x00000183,0x0000015c,
+0x00050082,0x00000006,0x00000184,0x00000182,
+0x00000183,0x0003003e,0x00000185,0x00000184,
+0x00050039,0x00000006,0x00000186,0x0000002a,
+0x00000185,0x0004003d,0x00000006,0x00000187,
+0x00000146,0x0004003d,0x00000006,0x00000188,
+0x0000015c,0x00050082,0x00000006,0x00000189,
+0x00000187,0x00000188,0x0003003e,0x0000018a,
+0x00000189,0x00050039,0x00000006,0x0000018b,
+0x0000002a,0x0000018a,0x0004003d,0x00000006,
+0x0000018c,0x0000014d,0x0004003d,0x00000006,
+0x0000018d,0x0000015c,0x00050082,0x00000006,
+0x0000018e,0x0000018c,0x0000018d,0x0003003e,
+0x0000018f,0x0000018e,0x00050039,0x00000006,
+0x00000190,0x0000002a,0x0000018f,0x00060050,
+0x00000007,0x00000191,0x00000186,0x0000018b,
+0x00000190,0x00050041,0x00000008,0x00000192,
+0x00000166,0x00000075,0x0003003e,0x00000192,
+0x00000191,0x0004003d,0x00000030,0x00000194,
+0x00000166,0x0003003e,0x00000193,0x00000194,
+0x0004003d,0x0000000d,0x00000196,0x0000003f,
+0x0003003e,0x00000195,0x00000196,0x0004003d,
+0x0000000f,0x00000198,0x00000040,0x0003003e,
+0x00000197,0x00000198,0x0004003d,0x0000000f,
+0x0000019a,0x00000041,0x0003003e,0x00000199,
+0x0000019a,0x00080039,0x00000035,0x0000019b,
+0x0000003b,0x00000193,0x00000195,0x00000197,
+0x00000199,0x000200fe,0x0000019b,0x00010038,
+0x00050036,0x00000035,0x00000048,0x00000000,
+0x0000003d,0x00030037,0x0000000e,0x00000044,
+0x00030037,0x0000000e,0x00000045,0x00030037,
+0x00000032,0x00000046,0x00030037,0x00000032,
+0x00000047,0x000200f8,0x00000049,0x0004003b,
+0x00000008,0x0000019e,0x00000007,0x0004003b,
+0x0000000e,0x000001a1,0x00000007,0x0004003b,
+0x0000000e,0x000001ac,0x00000007,0x0004003b,
+0x0000000e,0x000001b9,0x00000007,0x0004003b,
+0x00000008,0x000001bd,0x00000007,0x0004003b,
+0x0000000e,0x000001c0,0x00000007,0x0004003b,
+0x0000000e,0x000001c7,0x00000007,0x0004003b,
+0x0000000e,0x000001cd,0x00000007,0x0004003b,
+0x0000000e,0x000001d1,0x00000007,0x0004003b,
+0x00000027,0x000001f1,0x00000007,0x0004003b,
+0x0000007e,0x000001f3,0x00000007,0x0004003b,
+0x00000031,0x000001f6,0x00000007,0x0004003b,
+0x00000008,0x000001ff,0x00000007,0x0004003b,
+0x00000008,0x0000020a,0x00000007,0x0004003b,
+0x00000008,0x00000215,0x00000007,0x0004003b,
+0x00000008,0x00000220,0x00000007,0x0004003b,
+0x00000031,0x00000223,0x00000007,0x0004003b,
+0x0000000e,0x00000225,0x00000007,0x0004003b,
+0x00000032,0x00000227,0x00000007,0x0004003b,
+0x00000032,0x00000229,0x00000007,0x0004003d,
+0x0000000d,0x0000019f,0x00000044,0x000500c2,
+0x0000000d,0x000001a0,0x0000019f,0x00000124,
+0x0003003e,0x000001a1,0x000001a0,0x00050039,
+0x0000000d,0x000001a2,0x00000017,0x000001a1,
+0x0004007c,0x00000006,0x000001a3,0x000001a2,
+0x00050041,0x00000027,0x000001a4,0x0000019e,
+0x000000d5,0x0003003e,0x000001a4,0x000001a3,
+0x0004003d,0x0000000d,0x000001a5,0x00000044,
+0x000500c2,0x0000000d,0x000001a6,0x000001a5,
+0x0000012a,0x000500c4,0x0000000d,0x000001a7,
+0x000001a6,0x00000073,0x0004003d,0x0000000d,
+0x000001a8,0x00000044,0x000500c2,0x0000000d,
+0x000001a9,0x000001a8,0x00000133,0x000500c7,
+0x0000000d,0x000001aa,0x000001a9,0x000000f5,
+0x000500c5,0x0000000d,0x000001ab,0x000001a7,
+0x000001aa,0x0003003e,0x000001ac,0x000001ab,
+0x00050039,0x0000000d,0x000001ad,0x00000017,
+0x000001ac,0x0004007c,0x00000006,0x000001ae,
+0x000001ad,0x00050041,0x00000027,0x000001af,
+0x0000019e,0x000000f5,0x0003003e,0x000001af,
+0x000001ae,0x0004003d,0x0000000d,0x000001b0,
+0x00000044,0x000500c2,0x0000000d,0x000001b2,
+0x000001b0,0x000001b1,0x000500c4,0x0000000d,
+0x000001b3,0x000001b2,0x00000075,0x0004003d,
+0x0000000d,0x000001b4,0x00000044,0x000500c2,
+0x0000000d,0x000001b6,0x000001b4,0x000001b5,
+0x000500c7,0x0000000d,0x000001b7,0x000001b6,
+0x0000007b,0x000500c5,0x0000000d,0x000001b8,
+0x000001b3,0x000001b7,0x0003003e,0x000001b9,
+0x000001b8,0x00050039,0x0000000d,0x000001ba,
+0x00000017,0x000001b9,0x0004007c,0x00000006,
+0x000001bb,0x000001ba,0x00050041,0x00000027,
+0x000001bc,0x0000019e,0x000000ef,0x0003003e,
+0x000001bc,0x000001bb,0x0004003d,0x0000000d,
+0x000001be,0x00000044,0x000500c2,0x0000000d,
+0x000001bf,0x000001be,0x0000015d,0x0003003e,
+0x000001c0,0x000001bf,0x00050039,0x0000000d,
+0x000001c1,0x00000017,0x000001c0,0x0004007c,
+0x00000006,0x000001c2,0x000001c1,0x00050041,
+0x00000027,0x000001c3,0x000001bd,0x000000d5,
+0x0003003e,0x000001c3,0x000001c2,0x0004003d,
+0x0000000d,0x000001c4,0x00000044,0x000500c2,
+0x0000000d,0x000001c6,0x000001c4,0x000001c5,
+0x0003003e,0x000001c7,0x000001c6,0x00050039,
+0x0000000d,0x000001c8,0x00000017,0x000001c7,
+0x0004007c,0x00000006,0x000001c9,0x000001c8,
+0x00050041,0x00000027,0x000001ca,0x000001bd,
+0x000000f5,0x0003003e,0x000001ca,0x000001c9,
+0x0004003d,0x0000000d,0x000001cb,0x00000044,
+0x000500c2,0x0000000d,0x000001cc,0x000001cb,
+0x00000075,0x0003003e,0x000001cd,0x000001cc,
+0x00050039,0x0000000d,0x000001ce,0x00000017,
+0x000001cd,0x0004007c,0x00000006,0x000001cf,
+0x000001ce,0x00050041,0x00000027,0x000001d0,
+0x000001bd,0x000000ef,0x0003003e,0x000001d0,
+0x000001cf,0x0004003d,0x0000000d,0x000001d2,
+0x00000044,0x000500c7,0x0000000d,0x000001d3,
+0x000001d2,0x0000002f,0x0003003e,0x000001d1,
+0x000001d3,0x0004003d,0x0000000d,0x000001d4,
+0x00000044,0x000500c7,0x0000000d,0x000001d5,
+0x000001d4,0x000000f5,0x000500c4,0x0000000d,
+0x000001d6,0x000001d5,0x00000073,0x0004003d,
+0x0000000d,0x000001d7,0x000001d1,0x000500c5,
+0x0000000d,0x000001d8,0x000001d7,0x000001d6,
+0x0003003e,0x000001d1,0x000001d8,0x00050041,
+0x00000027,0x000001d9,0x0000019e,0x000000d5,
+0x0004003d,0x00000006,0x000001da,0x000001d9,
+0x000500c4,0x00000006,0x000001db,0x000001da,
+0x0000013a,0x00050041,0x00000027,0x000001dc,
+0x0000019e,0x000000f5,0x0004003d,0x00000006,
+0x000001dd,0x000001dc,0x000500c4,0x00000006,
+0x000001de,0x000001dd,0x00000148,0x000500c5,
+0x00000006,0x000001df,0x000001db,0x000001de,
+0x00050041,0x00000027,0x000001e0,0x0000019e,
+0x000000ef,0x0004003d,0x00000006,0x000001e1,
+0x000001e0,0x000500c5,0x00000006,0x000001e2,
+0x000001df,0x000001e1,0x00050041,0x00000027,
+0x000001e3,0x000001bd,0x000000d5,0x0004003d,
+0x00000006,0x000001e4,0x000001e3,0x000500c4,
+0x00000006,0x000001e5,0x000001e4,0x0000013a,
+0x00050041,0x00000027,0x000001e6,0x000001bd,
+0x000000f5,0x0004003d,0x00000006,0x000001e7,
+0x000001e6,0x000500c4,0x00000006,0x000001e8,
+0x000001e7,0x00000148,0x000500c5,0x00000006,
+0x000001e9,0x000001e5,0x000001e8,0x00050041,
+0x00000027,0x000001ea,0x000001bd,0x000000ef,
+0x0004003d,0x00000006,0x000001eb,0x000001ea,
+0x000500c5,0x00000006,0x000001ec,0x000001e9,
+0x000001eb,0x000500af,0x0000000f,0x000001ed,
+0x000001e2,0x000001ec,0x000600a9,0x0000000d,
+0x000001ee,0x000001ed,0x000000f5,0x000000d5,
+0x0004003d,0x0000000d,0x000001ef,0x000001d1,
+0x000500c5,0x0000000d,0x000001f0,0x000001ef,
+0x000001ee,0x0003003e,0x000001d1,0x000001f0,
+0x0004003d,0x0000000d,0x000001f2,0x000001d1,
+0x0003003e,0x000001f3,0x00000161,0x00050041,
+0x00000027,0x000001f4,0x000001f3,0x000001f2,
+0x0004003d,0x00000006,0x000001f5,0x000001f4,
+0x0003003e,0x000001f1,0x000001f5,0x0004003d,
+0x00000007,0x000001f7,0x0000019e,0x00050051,
+0x00000006,0x000001f8,0x000001f7,0x00000000,
+0x00050051,0x00000006,0x000001f9,0x000001f7,
+0x00000001,0x00050051,0x00000006,0x000001fa,
+0x000001f7,0x00000002,0x00060050,0x00000007,
+0x000001fb,0x000001f8,0x000001f9,0x000001fa,
+0x0004003d,0x00000006,0x000001fc,0x000001f1,
+0x00060050,0x00000007,0x000001fd,0x000001fc,
+0x000001fc,0x000001fc,0x00050080,0x00000007,
+0x000001fe,0x000001fb,0x000001fd,0x0003003e,
+0x000001ff,0x000001fe,0x00050039,0x00000007,
+0x00000200,0x0000002d,0x000001ff,0x00050041,
+0x00000008,0x00000201,0x000001f6,0x00000072,
+0x0003003e,0x00000201,0x00000200,0x0004003d,
+0x00000007,0x00000202,0x0000019e,0x00050051,
+0x00000006,0x00000203,0x00000202,0x00000000,
+0x00050051,0x00000006,0x00000204,0x00000202,
+0x00000001,0x00050051,0x00000006,0x00000205,
+0x00000202,0x00000002,0x00060050,0x00000007,
+0x00000206,0x00000203,0x00000204,0x00000205,
+0x0004003d,0x00000006,0x00000207,0x000001f1,
+0x00060050,0x00000007,0x00000208,0x00000207,
+0x00000207,0x00000207,0x00050082,0x00000007,
+0x00000209,0x00000206,0x00000208,0x0003003e,
+0x0000020a,0x00000209,0x00050039,0x00000007,
+0x0000020b,0x0000002d,0x0000020a,0x00050041,
+0x00000008,0x0000020c,0x000001f6,0x00000073,
+0x0003003e,0x0000020c,0x0000020b,0x0004003d,
+0x00000007,0x0000020d,0x000001bd,0x00050051,
+0x00000006,0x0000020e,0x0000020d,0x00000000,
+0x00050051,0x00000006,0x0000020f,0x0000020d,
+0x00000001,0x00050051,0x00000006,0x00000210,
+0x0000020d,0x00000002,0x00060050,0x00000007,
+0x00000211,0x0000020e,0x0000020f,0x00000210,
+0x0004003d,0x00000006,0x00000212,0x000001f1,
+0x00060050,0x00000007,0x00000213,0x00000212,
+0x00000212,0x00000212,0x00050080,0x00000007,
+0x00000214,0x00000211,0x00000213,0x0003003e,
+0x00000215,0x00000214,0x00050039,0x00000007,
+0x00000216,0x0000002d,0x00000215,0x00050041,
+0x00000008,0x00000217,0x000001f6,0x00000074,
+0x0003003e,0x00000217,0x00000216,0x0004003d,
+0x00000007,0x00000218,0x000001bd,0x00050051,
+0x00000006,0x00000219,0x00000218,0x00000000,
+0x00050051,0x00000006,0x0000021a,0x00000218,
+0x00000001,0x00050051,0x00000006,0x0000021b,
+0x00000218,0x00000002,0x00060050,0x00000007,
+0x0000021c,0x00000219,0x0000021a,0x0000021b,
+0x0004003d,0x00000006,0x0000021d,0x000001f1,
+0x00060050,0x00000007,0x0000021e,0x0000021d,
+0x0000021d,0x0000021d,0x00050082,0x00000007,
+0x0000021f,0x0000021c,0x0000021e,0x0003003e,
+0x00000220,0x0000021f,0x00050039,0x00000007,
+0x00000221,0x0000002d,0x00000220,0x00050041,
+0x00000008,0x00000222,0x000001f6,0x00000075,
+0x0003003e,0x00000222,0x00000221,0x0004003d,
+0x00000030,0x00000224,0x000001f6,0x0003003e,
+0x00000223,0x00000224,0x0004003d,0x0000000d,
+0x00000226,0x00000045,0x0003003e,0x00000225,
+0x00000226,0x0004003d,0x0000000f,0x00000228,
+0x00000046,0x0003003e,0x00000227,0x00000228,
+0x0004003d,0x0000000f,0x0000022a,0x00000047,
+0x0003003e,0x00000229,0x0000022a,0x00080039,
+0x00000035,0x0000022b,0x0000003b,0x00000223,
+0x00000225,0x00000227,0x00000229,0x000200fe,
+0x0000022b,0x00010038,0x00050036,0x00000035,
+0x0000004e,0x00000000,0x0000004a,0x00030037,
+0x0000000e,0x0000004b,0x00030037,0x0000000e,
+0x0000004c,0x00030037,0x00000032,0x0000004d,
+0x000200f8,0x0000004f,0x0004003b,0x00000008,
+0x0000022e,0x00000007,0x0004003b,0x0000000e,
+0x00000232,0x00000007,0x0004003b,0x0000000e,
+0x0000023e,0x00000007,0x0004003b,0x0000000e,
+0x0000024f,0x00000007,0x0004003b,0x00000008,
+0x00000253,0x00000007,0x0004003b,0x0000000e,
+0x0000025a,0x00000007,0x0004003b,0x0000000e,
+0x00000260,0x00000007,0x0004003b,0x0000000e,
+0x00000266,0x00000007,0x0004003b,0x00000008,
+0x0000026a,0x00000007,0x0004003b,0x0000000e,
+0x0000026e,0x00000007,0x0004003b,0x0000000e,
+0x00000274,0x00000007,0x0004003b,0x0000000e,
+0x00000278,0x00000007,0x0004003b,0x00000027,
+0x0000027d,0x00000007,0x0004003b,0x00000027,
+0x00000285,0x00000007,0x0004003b,0x00000027,
+0x00000288,0x00000007,0x0004003b,0x00000050,
+0x0000028b,0x00000007,0x0004003b,0x00000008,
+0x000002a2,0x00000007,0x0004003d,0x0000000d,
+0x0000022f,0x0000004b,0x000500c2,0x0000000d,
+0x00000231,0x0000022f,0x00000230,0x0003003e,
+0x00000232,0x00000231,0x00050039,0x0000000d,
+0x00000233,0x0000001d,0x00000232,0x0004007c,
+0x00000006,0x00000234,0x00000233,0x00050041,
+0x00000027,0x00000235,0x0000022e,0x000000d5,
+0x0003003e,0x00000235,0x00000234,0x0004003d,
+0x0000000d,0x00000236,0x0000004b,0x000500c2,
+0x0000000d,0x00000237,0x00000236,0x0000012a,
+0x000500c4,0x0000000d,0x00000238,0x00000237,
+0x000000b2,0x0004003d,0x0000000d,0x00000239,
+0x0000004b,0x000500c2,0x0000000d,0x0000023b,
+0x00000239,0x0000023a,0x000500c7,0x0000000d,
+0x0000023c,0x0000023b,0x000000a2,0x000500c5,
+0x0000000d,0x0000023d,0x00000238,0x0000023c,
+0x0003003e,0x0000023e,0x0000023d,0x00050039,
+0x0000000d,0x0000023f,0x00000020,0x0000023e,
+0x0004007c,0x00000006,0x00000240,0x0000023f,
+0x00050041,0x00000027,0x00000241,0x0000022e,
+0x000000f5,0x0003003e,0x00000241,0x00000240,
+0x0004003d,0x0000000d,0x00000242,0x0000004b,
+0x000500c2,0x0000000d,0x00000243,0x00000242,
+0x0000013a,0x000500c4,0x0000000d,0x00000245,
+0x00000243,0x00000244,0x0004003d,0x0000000d,
+0x00000246,0x0000004b,0x000500c2,0x0000000d,
+0x00000247,0x00000246,0x0000015d,0x000500c7,
+0x0000000d,0x00000248,0x00000247,0x00000126,
+0x000500c4,0x0000000d,0x00000249,0x00000248,
+0x00000075,0x000500c5,0x0000000d,0x0000024a,
+0x00000245,0x00000249,0x0004003d,0x0000000d,
+0x0000024b,0x0000004b,0x000500c2,0x0000000d,
+0x0000024c,0x0000024b,0x000001c5,0x000500c7,
+0x0000000d,0x0000024d,0x0000024c,0x0000007b,
+0x000500c5,0x0000000d,0x0000024e,0x0000024a,
+0x0000024d,0x0003003e,0x0000024f,0x0000024e,
+0x00050039,0x0000000d,0x00000250,0x0000001d,
+0x0000024f,0x0004007c,0x00000006,0x00000251,
+0x00000250,0x00050041,0x00000027,0x00000252,
+0x0000022e,0x000000ef,0x0003003e,0x00000252,
+0x00000251,0x0004003d,0x0000000d,0x00000254,
+0x0000004b,0x000500c2,0x0000000d,0x00000255,
+0x00000254,0x00000074,0x000500c4,0x0000000d,
+0x00000256,0x00000255,0x00000073,0x0004003d,
+0x0000000d,0x00000257,0x0000004b,0x000500c7,
+0x0000000d,0x00000258,0x00000257,0x000000f5,
+0x000500c5,0x0000000d,0x00000259,0x00000256,
+0x00000258,0x0003003e,0x0000025a,0x00000259,
+0x00050039,0x0000000d,0x0000025b,0x0000001d,
+0x0000025a,0x0004007c,0x00000006,0x0000025c,
+0x0000025b,0x00050041,0x00000027,0x0000025d,
+0x00000253,0x000000d5,0x0003003e,0x0000025d,
+0x0000025c,0x0004003d,0x0000000d,0x0000025e,
+0x0000004c,0x000500c2,0x0000000d,0x0000025f,
+0x0000025e,0x00000230,0x0003003e,0x00000260,
+0x0000025f,0x00050039,0x0000000d,0x00000261,
+0x00000020,0x00000260,0x0004007c,0x00000006,
+0x00000262,0x00000261,0x00050041,0x00000027,
+0x00000263,0x00000253,0x000000f5,0x0003003e,
+0x00000263,0x00000262,0x0004003d,0x0000000d,
+0x00000264,0x0000004c,0x000500c2,0x0000000d,
+0x00000265,0x00000264,0x000001b1,0x0003003e,
+0x00000266,0x00000265,0x00050039,0x0000000d,
+0x00000267,0x0000001d,0x00000266,0x0004007c,
+0x00000006,0x00000268,0x00000267,0x00050041,
+0x00000027,0x00000269,0x00000253,0x000000ef,
+0x0003003e,0x00000269,0x00000268,0x0004003d,
+0x0000000d,0x0000026b,0x0000004c,0x000500c2,
+0x0000000d,0x0000026d,0x0000026b,0x0000026c,
+0x0003003e,0x0000026e,0x0000026d,0x00050039,
+0x0000000d,0x0000026f,0x0000001d,0x0000026e,
+0x0004007c,0x00000006,0x00000270,0x0000026f,
+0x00050041,0x00000027,0x00000271,0x0000026a,
+0x000000d5,0x0003003e,0x00000271,0x00000270,
+0x0004003d,0x0000000d,0x00000272,0x0000004c,
+0x000500c2,0x0000000d,0x00000273,0x00000272,
+0x000000b2,0x0003003e,0x00000274,0x00000273,
+0x00050039,0x0000000d,0x00000275,0x00000020,
+0x00000274,0x0004007c,0x00000006,0x00000276,
+0x00000275,0x00050041,0x00000027,0x00000277,
+0x0000026a,0x000000f5,0x0003003e,0x00000277,
+0x00000276,0x0004003d,0x0000000d,0x00000279,
+0x0000004c,0x0003003e,0x00000278,0x00000279,
+0x00050039,0x0000000d,0x0000027a,0x0000001d,
+0x00000278,0x0004007c,0x00000006,0x0000027b,
+0x0000027a,0x00050041,0x00000027,0x0000027c,
+0x0000026a,0x000000ef,0x0003003e,0x0000027c,
+0x0000027b,0x0003003e,0x0000027d,0x00000072,
+0x000200f9,0x0000027e,0x000200f8,0x0000027e,
+0x000400f6,0x00000280,0x00000281,0x00000000,
+0x000200f9,0x00000282,0x000200f8,0x00000282,
+0x0004003d,0x00000006,0x00000283,0x0000027d,
+0x000500b1,0x0000000f,0x00000284,0x00000283,
+0x0000013a,0x000400fa,0x00000284,0x0000027f,
+0x00000280,0x000200f8,0x0000027f,0x0004003d,
+0x00000006,0x00000286,0x0000027d,0x000500c3,
+0x00000006,0x00000287,0x00000286,0x00000074,
+0x0003003e,0x00000285,0x00000287,0x0004003d,
+0x00000006,0x00000289,0x0000027d,0x000500c7,
+0x00000006,0x0000028a,0x00000289,0x00000075,
+0x0003003e,0x00000288,0x0000028a,0x0004003d,
+0x00000006,0x0000028c,0x0000027d,0x0004003d,
+0x00000006,0x0000028d,0x00000288,0x0004003d,
+0x00000007,0x0000028e,0x00000253,0x0004003d,
+0x00000007,0x0000028f,0x0000022e,0x00050082,
+0x00000007,0x00000290,0x0000028e,0x0000028f,
+0x00060050,0x00000007,0x00000291,0x0000028d,
+0x0000028d,0x0000028d,0x00050084,0x00000007,
+0x00000292,0x00000291,0x00000290,0x0004003d,
+0x00000006,0x00000293,0x00000285,0x0004003d,
+0x00000007,0x00000294,0x0000026a,0x0004003d,
+0x00000007,0x00000295,0x0000022e,0x00050082,
+0x00000007,0x00000296,0x00000294,0x00000295,
+0x00060050,0x00000007,0x00000297,0x00000293,
+0x00000293,0x00000293,0x00050084,0x00000007,
+0x00000298,0x00000297,0x00000296,0x00050080,
+0x00000007,0x00000299,0x00000292,0x00000298,
+0x0004003d,0x00000007,0x0000029a,0x0000022e,
+0x00060050,0x00000007,0x0000029b,0x00000090,
+0x00000090,0x00000090,0x00050084,0x00000007,
+0x0000029c,0x0000029b,0x0000029a,0x00050080,
+0x00000007,0x0000029d,0x00000299,0x0000029c,
+0x00060050,0x00000007,0x0000029e,0x00000074,
+0x00000074,0x00000074,0x00050080,0x00000007,
+0x0000029f,0x0000029d,0x0000029e,0x00060050,
+0x00000007,0x000002a0,0x00000074,0x00000074,
+0x00000074,0x000500c3,0x00000007,0x000002a1,
+0x0000029f,0x000002a0,0x0003003e,0x000002a2,
+0x000002a1,0x00050039,0x00000007,0x000002a3,
+0x0000002d,0x000002a2,0x00050051,0x00000006,
+0x000002a4,0x000002a3,0x00000000,0x00050051,
+0x00000006,0x000002a5,0x000002a3,0x00000001,
+0x00050051,0x00000006,0x000002a6,0x000002a3,
+0x00000002,0x00070050,0x00000033,0x000002a7,
+0x000002a4,0x000002a5,0x000002a6,0x000000c6,
+0x00050041,0x00000051,0x000002a8,0x0000028b,
+0x0000028c,0x0003003e,0x000002a8,0x000002a7,
+0x0004003d,0x00000006,0x000002a9,0x0000027d,
+0x00060041,0x00000027,0x000002aa,0x0000028b,
+0x000002a9,0x00000126,0x0003003e,0x000002aa,
+0x000000c6,0x000200f9,0x00000281,0x000200f8,
+0x00000281,0x0004003d,0x00000006,0x000002ab,
+0x0000027d,0x00050080,0x00000006,0x000002ac,
+0x000002ab,0x00000073,0x0003003e,0x0000027d,
+0x000002ac,0x000200f9,0x0000027e,0x000200f8,
+0x00000280,0x0004003d,0x00000035,0x000002ad,
+0x0000028b,0x000200fe,0x000002ad,0x00010038,
+0x00050036,0x00000002,0x0000005d,0x00000000,
+0x00000052,0x00030037,0x00000050,0x00000053,
+0x00030037,0x00000027,0x00000054,0x00030037,
+0x00000027,0x00000055,0x00030037,0x00000027,
+0x00000056,0x00030037,0x00000051,0x00000057,
+0x00030037,0x0000000e,0x00000058,0x00030037,
+0x00000032,0x00000059,0x00030037,0x00000032,
+0x0000005a,0x00030037,0x00000032,0x0000005b,
+0x00030037,0x00000032,0x0000005c,0x000200f8,
+0x0000005e,0x0004003b,0x0000000e,0x000002b0,
+0x00000007,0x0004003b,0x0000000e,0x000002b1,
+0x00000007,0x0004003b,0x00000027,0x000002b9,
+0x00000007,0x0004003b,0x0000000e,0x000002c4,
+0x00000007,0x0004003b,0x0000000e,0x000002ca,
+0x00000007,0x0004003b,0x0000000e,0x000002db,
+0x00000007,0x0004003b,0x0000000e,0x000002e0,
+0x00000007,0x0004003b,0x0000000e,0x000002e6,
+0x00000007,0x0004003b,0x0000000e,0x000002eb,
+0x00000007,0x0004003b,0x0000000e,0x000002ff,
+0x00000007,0x0004003b,0x00000027,0x00000303,
+0x00000007,0x0004003b,0x00000027,0x0000030b,
+0x00000007,0x0004003b,0x00000027,0x00000310,
+0x00000007,0x0004003b,0x00000027,0x00000315,
+0x00000007,0x0003003e,0x000002b0,0x000000d5,
+0x0003003e,0x000002b1,0x000000d5,0x0004003d,
+0x0000000f,0x000002b2,0x00000059,0x000300f7,
+0x000002b4,0x00000000,0x000400fa,0x000002b2,
+0x000002b3,0x000002b4,0x000200f8,0x000002b3,
+0x0004003d,0x0000000f,0x000002b5,0x0000005a,
+0x000300f7,0x000002b7,0x00000000,0x000400fa,
+0x000002b5,0x000002b6,0x000002b8,0x000200f8,
+0x000002b6,0x0003003e,0x000002b1,0x000000ef,
+0x000200f9,0x000002b7,0x000200f8,0x000002b8,
+0x0003003e,0x000002b0,0x000000ef,0x000200f9,
+0x000002b7,0x000200f8,0x000002b7,0x000200f9,
+0x000002b4,0x000200f8,0x000002b4,0x0003003e,
+0x000002b9,0x00000072,0x000200f9,0x000002ba,
+0x000200f8,0x000002ba,0x000400f6,0x000002bc,
+0x000002bd,0x00000000,0x000200f9,0x000002be,
+0x000200f8,0x000002be,0x0004003d,0x00000006,
+0x000002bf,0x000002b9,0x000500b1,0x0000000f,
+0x000002c0,0x000002bf,0x00000148,0x000400fa,
+0x000002c0,0x000002bb,0x000002bc,0x000200f8,
+0x000002bb,0x0004003d,0x0000000f,0x000002c1,
+0x0000005a,0x000300f7,0x000002c3,0x00000000,
+0x000400fa,0x000002c1,0x000002c2,0x000002d0,
+0x000200f8,0x000002c2,0x0004003d,0x0000000d,
+0x000002c5,0x000002b0,0x0004003d,0x00000006,
+0x000002c6,0x000002b9,0x000500c3,0x00000006,
+0x000002c7,0x000002c6,0x00000073,0x0004007c,
+0x0000000d,0x000002c8,0x000002c7,0x00050080,
+0x0000000d,0x000002c9,0x000002c5,0x000002c8,
+0x0003003e,0x000002c4,0x000002c9,0x0004003d,
+0x0000000d,0x000002cb,0x000002b1,0x0004003d,
+0x00000006,0x000002cc,0x000002b9,0x000500c7,
+0x00000006,0x000002cd,0x000002cc,0x00000073,
+0x0004007c,0x0000000d,0x000002ce,0x000002cd,
+0x00050080,0x0000000d,0x000002cf,0x000002cb,
+0x000002ce,0x0003003e,0x000002ca,0x000002cf,
+0x000200f9,0x000002c3,0x000200f8,0x000002d0,
+0x0004003d,0x0000000d,0x000002d1,0x000002b0,
+0x0004003d,0x00000006,0x000002d2,0x000002b9,
+0x000500c3,0x00000006,0x000002d3,0x000002d2,
+0x00000074,0x0004007c,0x0000000d,0x000002d4,
+0x000002d3,0x00050080,0x0000000d,0x000002d5,
+0x000002d1,0x000002d4,0x0003003e,0x000002c4,
+0x000002d5,0x0004003d,0x0000000d,0x000002d6,
+0x000002b1,0x0004003d,0x00000006,0x000002d7,
+0x000002b9,0x000500c7,0x00000006,0x000002d8,
+0x000002d7,0x00000075,0x0004007c,0x0000000d,
+0x000002d9,0x000002d8,0x00050080,0x0000000d,
+0x000002da,0x000002d6,0x000002d9,0x0003003e,
+0x000002ca,0x000002da,0x000200f9,0x000002c3,
+0x000200f8,0x000002c3,0x0004003d,0x0000000d,
+0x000002dc,0x000002ca,0x0004003d,0x0000000d,
+0x000002dd,0x000002c4,0x00050084,0x0000000d,
+0x000002de,0x000002dd,0x0000002f,0x00050080,
+0x0000000d,0x000002df,0x000002dc,0x000002de,
+0x0003003e,0x000002db,0x000002df,0x0004003d,
+0x0000000d,0x000002e1,0x00000058,0x0004003d,
+0x0000000d,0x000002e2,0x000002db,0x00050080,
+0x0000000d,0x000002e3,0x000002e2,0x0000008d,
+0x000500c2,0x0000000d,0x000002e4,0x000002e1,
+0x000002e3,0x000500c7,0x0000000d,0x000002e5,
+0x000002e4,0x000000ef,0x0003003e,0x000002e0,
+0x000002e5,0x0004003d,0x0000000d,0x000002e7,
+0x00000058,0x0004003d,0x0000000d,0x000002e8,
+0x000002db,0x000500c2,0x0000000d,0x000002e9,
+0x000002e7,0x000002e8,0x000500c7,0x0000000d,
+0x000002ea,0x000002e9,0x000000f5,0x0003003e,
+0x000002e6,0x000002ea,0x0004003d,0x0000000d,
+0x000002ec,0x000002c4,0x0004003d,0x0000000d,
+0x000002ed,0x000002ca,0x00050084,0x0000000d,
+0x000002ee,0x0000002f,0x000002ed,0x00050080,
+0x0000000d,0x000002ef,0x000002ec,0x000002ee,
+0x0003003e,0x000002eb,0x000002ef,0x0004003d,
+0x0000000f,0x000002f0,0x0000005b,0x0004003d,
+0x0000000f,0x000002f1,0x0000005c,0x000400a8,
+0x0000000f,0x000002f2,0x000002f1,0x000500a7,
+0x0000000f,0x000002f3,0x000002f0,0x000002f2,
+0x0004003d,0x0000000d,0x000002f4,0x000002e0,
+0x000500ab,0x0000000f,0x000002f5,0x000002f4,
+0x000000d5,0x000500a7,0x0000000f,0x000002f6,
+0x000002f3,0x000002f5,0x0004003d,0x0000000d,
+0x000002f7,0x000002e6,0x000500aa,0x0000000f,
+0x000002f8,0x000002f7,0x000000d5,0x000500a7,
+0x0000000f,0x000002f9,0x000002f6,0x000002f8,
+0x000300f7,0x000002fb,0x00000000,0x000400fa,
+0x000002f9,0x000002fa,0x000002fe,0x000200f8,
+0x000002fa,0x0004003d,0x0000000d,0x000002fc,
+0x000002eb,0x00050041,0x00000051,0x000002fd,
+0x00000053,0x000002fc,0x0003003e,0x000002fd,
+0x00000108,0x000200f9,0x000002fb,0x000200f8,
+0x000002fe,0x0004003d,0x0000000d,0x00000300,
+0x000002e6,0x0004003d,0x0000000d,0x00000301,
+0x000002e0,0x000500c5,0x0000000d,0x00000302,
+0x00000300,0x00000301,0x0003003e,0x000002ff,
+0x00000302,0x0004003d,0x0000000d,0x00000304,
+0x000002ff,0x00050041,0x00000027,0x00000305,
+0x00000057,0x00000304,0x0004003d,0x00000006,
+0x00000306,0x00000305,0x0003003e,0x00000303,
+0x00000306,0x0004003d,0x0000000d,0x00000307,
+0x000002eb,0x0004003d,0x00000006,0x00000308,
+0x00000054,0x0004003d,0x00000006,0x00000309,
+0x00000303,0x00050080,0x00000006,0x0000030a,
+0x00000308,0x00000309,0x0003003e,0x0000030b,
+0x0000030a,0x00050039,0x00000006,0x0000030c,
+0x0000002a,0x0000030b,0x0004003d,0x00000006,
+0x0000030d,0x00000055,0x0004003d,0x00000006,
+0x0000030e,0x00000303,0x00050080,0x00000006,
+0x0000030f,0x0000030d,0x0000030e,0x0003003e,
+0x00000310,0x0000030f,0x00050039,0x00000006,
+0x00000311,0x0000002a,0x00000310,0x0004003d,
+0x00000006,0x00000312,0x00000056,0x0004003d,
+0x00000006,0x00000313,0x00000303,0x00050080,
+0x00000006,0x00000314,0x00000312,0x00000313,
+0x0003003e,0x00000315,0x00000314,0x00050039,
+0x00000006,0x00000316,0x0000002a,0x00000315,
+0x00070050,0x00000033,0x00000317,0x0000030c,
+0x00000311,0x00000316,0x000000c6,0x00050041,
+0x00000051,0x00000318,0x00000053,0x00000307,
+0x0003003e,0x00000318,0x00000317,0x000200f9,
+0x000002fb,0x000200f8,0x000002fb,0x000200f9,
+0x000002bd,0x000200f8,0x000002bd,0x0004003d,
+0x00000006,0x00000319,0x000002b9,0x00050080,
+0x00000006,0x0000031a,0x00000319,0x00000073,
+0x0003003e,0x000002b9,0x0000031a,0x000200f9,
+0x000002ba,0x000200f8,0x000002bc,0x000100fd,
+0x00010038,0x00050036,0x00000035,0x00000062,
+0x00000000,0x0000004a,0x00030037,0x0000000e,
+0x0000005f,0x00030037,0x0000000e,0x00000060,
+0x00030037,0x00000032,0x00000061,0x000200f8,
+0x00000063,0x0004003b,0x00000032,0x0000031b,
+0x00000007,0x0004003b,0x0000000e,0x0000032a,
+0x00000007,0x0004003b,0x0000000e,0x0000032d,
+0x00000007,0x0004003b,0x0000000e,0x00000330,
+0x00000007,0x0004003b,0x0000000e,0x00000335,
+0x00000007,0x0004003b,0x0000000e,0x00000337,
+0x00000007,0x0004003b,0x0000000e,0x0000033b,
+0x00000007,0x0004003b,0x0000000e,0x0000033d,
+0x00000007,0x0004003b,0x00000032,0x0000033f,
+0x00000007,0x0004003b,0x00000032,0x00000341,
+0x00000007,0x0004003b,0x0000000e,0x00000347,
+0x00000007,0x0004003b,0x0000000e,0x00000349,
+0x00000007,0x0004003b,0x0000000e,0x0000034d,
+0x00000007,0x0004003b,0x0000000e,0x0000034f,
+0x00000007,0x0004003b,0x00000032,0x00000351,
+0x00000007,0x0004003b,0x00000032,0x00000353,
+0x00000007,0x0004003b,0x0000000e,0x00000359,
+0x00000007,0x0004003b,0x0000000e,0x0000035b,
+0x00000007,0x0004003b,0x0000000e,0x0000035f,
+0x00000007,0x0004003b,0x0000000e,0x00000361,
+0x00000007,0x0004003b,0x00000032,0x00000363,
+0x00000007,0x0004003b,0x00000027,0x00000367,
+0x00000007,0x0004003b,0x0000000e,0x00000368,
+0x00000007,0x0004003b,0x00000027,0x0000036c,
+0x00000007,0x0004003b,0x0000000e,0x0000036f,
+0x00000007,0x0004003b,0x0000000e,0x00000371,
+0x00000007,0x0004003b,0x00000027,0x00000374,
+0x00000007,0x0004003b,0x0000000e,0x00000375,
+0x00000007,0x0004003b,0x00000027,0x00000379,
+0x00000007,0x0004003b,0x0000000e,0x0000037c,
+0x00000007,0x0004003b,0x0000000e,0x0000037e,
+0x00000007,0x0004003b,0x00000027,0x00000381,
+0x00000007,0x0004003b,0x0000000e,0x00000382,
+0x00000007,0x0004003b,0x00000027,0x00000386,
+0x00000007,0x0004003b,0x0000000e,0x00000389,
+0x00000007,0x0004003b,0x0000000e,0x0000038b,
+0x00000007,0x0004003b,0x0000000e,0x00000392,
+0x00000007,0x0004003b,0x0000000e,0x00000397,
+0x00000007,0x0004003b,0x0000000e,0x0000039c,
+0x00000007,0x0004003b,0x0000000e,0x000003a1,
+0x00000007,0x0004003b,0x0000000e,0x000003a6,
+0x00000007,0x0004003b,0x0000000e,0x000003ab,
+0x00000007,0x0004003b,0x0000000e,0x000003ae,
+0x00000007,0x0004003b,0x0000000e,0x000003b2,
+0x00000007,0x0004003b,0x00000051,0x000003bc,
+0x00000007,0x0004003b,0x000003e1,0x000003e2,
+0x00000007,0x0004003b,0x00000051,0x000003e5,
+0x00000007,0x0004003b,0x000003e1,0x000003e7,
+0x00000007,0x0004003b,0x000003e1,0x000003f5,
+0x00000007,0x0004003b,0x000003e1,0x000003f9,
+0x00000007,0x0004003b,0x00000032,0x000003fc,
+0x00000007,0x0004003b,0x00000050,0x00000400,
+0x00000007,0x0004003b,0x00000050,0x00000402,
+0x00000007,0x0004003b,0x00000027,0x00000404,
+0x00000007,0x0004003b,0x00000027,0x00000406,
+0x00000007,0x0004003b,0x00000027,0x00000408,
+0x00000007,0x0004003b,0x00000051,0x0000040a,
+0x00000007,0x0004003b,0x0000000e,0x0000040c,
+0x00000007,0x0004003b,0x00000032,0x0000040e,
+0x00000007,0x0004003b,0x00000032,0x0000040f,
+0x00000007,0x0004003b,0x00000032,0x00000411,
+0x00000007,0x0004003b,0x00000032,0x00000413,
+0x00000007,0x0004003b,0x00000050,0x00000418,
+0x00000007,0x0004003b,0x00000027,0x0000041a,
+0x00000007,0x0004003b,0x00000027,0x0000041c,
+0x00000007,0x0004003b,0x00000027,0x0000041e,
+0x00000007,0x0004003b,0x00000051,0x00000420,
+0x00000007,0x0004003b,0x0000000e,0x00000422,
+0x00000007,0x0004003b,0x00000032,0x00000424,
+0x00000007,0x0004003b,0x00000032,0x00000425,
+0x00000007,0x0004003b,0x00000032,0x00000427,
+0x00000007,0x0004003b,0x00000032,0x00000429,
+0x00000007,0x0004003d,0x0000000d,0x0000031c,
+0x0000005f,0x000500c2,0x0000000d,0x0000031d,
+0x0000031c,0x00000073,0x000500c7,0x0000000d,
+0x0000031e,0x0000031d,0x000000f5,0x000500ab,
+0x0000000f,0x0000031f,0x0000031e,0x000000d5,
+0x0003003e,0x0000031b,0x0000031f,0x0004003d,
+0x0000000f,0x00000320,0x00000061,0x000400a8,
+0x0000000f,0x00000321,0x00000320,0x000300f7,
+0x00000323,0x00000000,0x000400fa,0x00000321,
+0x00000322,0x00000323,0x000200f8,0x00000322,
+0x0004003d,0x0000000d,0x00000324,0x0000005f,
+0x000500c7,0x0000000d,0x00000325,0x00000324,
+0x000000ef,0x000500ab,0x0000000f,0x00000326,
+0x00000325,0x000000d5,0x000200f9,0x00000323,
+0x000200f8,0x00000323,0x000700f5,0x0000000f,
+0x00000327,0x00000320,0x00000063,0x00000326,
+0x00000322,0x000300f7,0x00000329,0x00000000,
+0x000400fa,0x00000327,0x00000328,0x0000038e,
+0x000200f8,0x00000328,0x0004003d,0x0000000d,
+0x0000032b,0x0000005f,0x000500c2,0x0000000d,
+0x0000032c,0x0000032b,0x00000124,0x0003003e,
+0x0000032a,0x0000032c,0x0004003d,0x0000000d,
+0x0000032e,0x0000005f,0x000500c2,0x0000000d,
+0x0000032f,0x0000032e,0x000001b1,0x0003003e,
+0x0000032d,0x0000032f,0x0004003d,0x0000000d,
+0x00000331,0x0000005f,0x000500c2,0x0000000d,
+0x00000332,0x00000331,0x0000015d,0x0003003e,
+0x00000330,0x00000332,0x0004003d,0x0000000d,
+0x00000333,0x0000005f,0x000500c2,0x0000000d,
+0x00000334,0x00000333,0x0000012a,0x0004003d,
+0x0000000d,0x00000336,0x0000032a,0x0003003e,
+0x00000335,0x00000336,0x0003003e,0x00000337,
+0x00000334,0x00060039,0x0000000f,0x00000338,
+0x00000013,0x00000335,0x00000337,0x000300f7,
+0x0000033a,0x00000000,0x000400fa,0x00000338,
+0x00000339,0x0000033a,0x000200f8,0x00000339,
+0x0004003d,0x0000000d,0x0000033c,0x0000005f,
+0x0003003e,0x0000033b,0x0000033c,0x0004003d,
+0x0000000d,0x0000033e,0x00000060,0x0003003e,
+0x0000033d,0x0000033e,0x0004003d,0x0000000f,
+0x00000340,0x00000061,0x0003003e,0x0000033f,
+0x00000340,0x0004003d,0x0000000f,0x00000342,
+0x0000031b,0x0003003e,0x00000341,0x00000342,
+0x00080039,0x00000035,0x00000343,0x00000042,
+0x0000033b,0x0000033d,0x0000033f,0x00000341,
+0x000200fe,0x00000343,0x000200f8,0x0000033a,
+0x0004003d,0x0000000d,0x00000345,0x0000005f,
+0x000500c2,0x0000000d,0x00000346,0x00000345,
+0x0000013a,0x0004003d,0x0000000d,0x00000348,
+0x0000032d,0x0003003e,0x00000347,0x00000348,
+0x0003003e,0x00000349,0x00000346,0x00060039,
+0x0000000f,0x0000034a,0x00000013,0x00000347,
+0x00000349,0x000300f7,0x0000034c,0x00000000,
+0x000400fa,0x0000034a,0x0000034b,0x0000034c,
+0x000200f8,0x0000034b,0x0004003d,0x0000000d,
+0x0000034e,0x0000005f,0x0003003e,0x0000034d,
+0x0000034e,0x0004003d,0x0000000d,0x00000350,
+0x00000060,0x0003003e,0x0000034f,0x00000350,
+0x0004003d,0x0000000f,0x00000352,0x00000061,
+0x0003003e,0x00000351,0x00000352,0x0004003d,
+0x0000000f,0x00000354,0x0000031b,0x0003003e,
+0x00000353,0x00000354,0x00080039,0x00000035,
+0x00000355,0x00000048,0x0000034d,0x0000034f,
+0x00000351,0x00000353,0x000200fe,0x00000355,
+0x000200f8,0x0000034c,0x0004003d,0x0000000d,
+0x00000357,0x0000005f,0x000500c2,0x0000000d,
+0x00000358,0x00000357,0x00000148,0x0004003d,
+0x0000000d,0x0000035a,0x00000330,0x0003003e,
+0x00000359,0x0000035a,0x0003003e,0x0000035b,
+0x00000358,0x00060039,0x0000000f,0x0000035c,
+0x00000013,0x00000359,0x0000035b,0x000300f7,
+0x0000035e,0x00000000,0x000400fa,0x0000035c,
+0x0000035d,0x0000035e,0x000200f8,0x0000035d,
+0x0004003d,0x0000000d,0x00000360,0x0000005f,
+0x0003003e,0x0000035f,0x00000360,0x0004003d,
+0x0000000d,0x00000362,0x00000060,0x0003003e,
+0x00000361,0x00000362,0x0004003d,0x0000000f,
+0x00000364,0x00000061,0x0003003e,0x00000363,
+0x00000364,0x00070039,0x00000035,0x00000365,
+0x0000004e,0x0000035f,0x00000361,0x00000363,
+0x000200fe,0x00000365,0x000200f8,0x0000035e,
+0x0004003d,0x0000000d,0x00000369,0x0000032a,
+0x0003003e,0x00000368,0x00000369,0x00050039,
+0x0000000d,0x0000036a,0x0000001a,0x00000368,
+0x0004007c,0x00000006,0x0000036b,0x0000036a,
+0x0003003e,0x00000367,0x0000036b,0x0004003d,
+0x0000000d,0x0000036d,0x0000005f,0x000500c2,
+0x0000000d,0x0000036e,0x0000036d,0x0000012a,
+0x0004003d,0x0000000d,0x00000370,0x0000032a,
+0x0003003e,0x0000036f,0x00000370,0x0003003e,
+0x00000371,0x0000036e,0x00060039,0x0000000d,
+0x00000372,0x00000025,0x0000036f,0x00000371,
+0x0004007c,0x00000006,0x00000373,0x00000372,
+0x0003003e,0x0000036c,0x00000373,0x0004003d,
+0x0000000d,0x00000376,0x0000032d,0x0003003e,
+0x00000375,0x00000376,0x00050039,0x0000000d,
+0x00000377,0x0000001a,0x00000375,0x0004007c,
+0x00000006,0x00000378,0x00000377,0x0003003e,
+0x00000374,0x00000378,0x0004003d,0x0000000d,
+0x0000037a,0x0000005f,0x000500c2,0x0000000d,
+0x0000037b,0x0000037a,0x0000013a,0x0004003d,
+0x0000000d,0x0000037d,0x0000032d,0x0003003e,
+0x0000037c,0x0000037d,0x0003003e,0x0000037e,
+0x0000037b,0x00060039,0x0000000d,0x0000037f,
+0x00000025,0x0000037c,0x0000037e,0x0004007c,
+0x00000006,0x00000380,0x0000037f,0x0003003e,
+0x00000379,0x00000380,0x0004003d,0x0000000d,
+0x00000383,0x00000330,0x0003003e,0x00000382,
+0x00000383,0x00050039,0x0000000d,0x00000384,
+0x0000001a,0x00000382,0x0004007c,0x00000006,
+0x00000385,0x00000384,0x0003003e,0x00000381,
+0x00000385,0x0004003d,0x0000000d,0x00000387,
+0x0000005f,0x000500c2,0x0000000d,0x00000388,
+0x00000387,0x00000148,0x0004003d,0x0000000d,
+0x0000038a,0x00000330,0x0003003e,0x00000389,
+0x0000038a,0x0003003e,0x0000038b,0x00000388,
+0x00060039,0x0000000d,0x0000038c,0x00000025,
+0x00000389,0x0000038b,0x0004007c,0x00000006,
+0x0000038d,0x0000038c,0x0003003e,0x00000386,
+0x0000038d,0x000200f9,0x00000329,0x000200f8,
+0x0000038e,0x0004003d,0x0000000d,0x0000038f,
+0x0000005f,0x000500c2,0x0000000d,0x00000391,
+0x0000038f,0x00000390,0x0003003e,0x00000392,
+0x00000391,0x00050039,0x0000000d,0x00000393,
+0x00000017,0x00000392,0x0004007c,0x00000006,
+0x00000394,0x00000393,0x0003003e,0x00000367,
+0x00000394,0x0004003d,0x0000000d,0x00000395,
+0x0000005f,0x000500c2,0x0000000d,0x00000396,
+0x00000395,0x0000012a,0x0003003e,0x00000397,
+0x00000396,0x00050039,0x0000000d,0x00000398,
+0x00000017,0x00000397,0x0004007c,0x00000006,
+0x00000399,0x00000398,0x0003003e,0x0000036c,
+0x00000399,0x0004003d,0x0000000d,0x0000039a,
+0x0000005f,0x000500c2,0x0000000d,0x0000039b,
+0x0000039a,0x00000133,0x0003003e,0x0000039c,
+0x0000039b,0x00050039,0x0000000d,0x0000039d,
+0x00000017,0x0000039c,0x0004007c,0x00000006,
+0x0000039e,0x0000039d,0x0003003e,0x00000374,
+0x0000039e,0x0004003d,0x0000000d,0x0000039f,
+0x0000005f,0x000500c2,0x0000000d,0x000003a0,
+0x0000039f,0x0000013a,0x0003003e,0x000003a1,
+0x000003a0,0x00050039,0x0000000d,0x000003a2,
+0x00000017,0x000003a1,0x0004007c,0x00000006,
+0x000003a3,0x000003a2,0x0003003e,0x00000379,
+0x000003a3,0x0004003d,0x0000000d,0x000003a4,
+0x0000005f,0x000500c2,0x0000000d,0x000003a5,
+0x000003a4,0x00000141,0x0003003e,0x000003a6,
+0x000003a5,0x00050039,0x0000000d,0x000003a7,
+0x00000017,0x000003a6,0x0004007c,0x00000006,
+0x000003a8,0x000003a7,0x0003003e,0x00000381,
+0x000003a8,0x0004003d,0x0000000d,0x000003a9,
+0x0000005f,0x000500c2,0x0000000d,0x000003aa,
+0x000003a9,0x00000148,0x0003003e,0x000003ab,
+0x000003aa,0x00050039,0x0000000d,0x000003ac,
+0x00000017,0x000003ab,0x0004007c,0x00000006,
+0x000003ad,0x000003ac,0x0003003e,0x00000386,
+0x000003ad,0x000200f9,0x00000329,0x000200f8,
+0x00000329,0x0004003d,0x0000000d,0x000003af,
+0x0000005f,0x000500c2,0x0000000d,0x000003b0,
+0x000003af,0x00000244,0x000500c7,0x0000000d,
+0x000003b1,0x0000007b,0x000003b0,0x0003003e,
+0x000003ae,0x000003b1,0x0004003d,0x0000000d,
+0x000003b3,0x0000005f,0x000500c2,0x0000000d,
+0x000003b4,0x000003b3,0x00000074,0x000500c7,
+0x0000000d,0x000003b5,0x0000007b,0x000003b4,
+0x0003003e,0x000003b2,0x000003b5,0x0004003d,
+0x0000000f,0x000003b6,0x0000031b,0x0004003d,
+0x0000000f,0x000003b7,0x00000061,0x000400a8,
+0x0000000f,0x000003b8,0x000003b7,0x000500a6,
+0x0000000f,0x000003b9,0x000003b6,0x000003b8,
+0x000300f7,0x000003bb,0x00000000,0x000400fa,
+0x000003b9,0x000003ba,0x000003ea,0x000200f8,
+0x000003ba,0x0004003d,0x0000000d,0x000003e0,
+0x000003ae,0x0003003e,0x000003e2,0x000003df,
+0x00050041,0x00000051,0x000003e3,0x000003e2,
+0x000003e0,0x0004003d,0x00000033,0x000003e4,
+0x000003e3,0x0003003e,0x000003bc,0x000003e4,
+0x0004003d,0x0000000d,0x000003e6,0x000003b2,
+0x0003003e,0x000003e7,0x000003df,0x00050041,
+0x00000051,0x000003e8,0x000003e7,0x000003e6,
+0x0004003d,0x00000033,0x000003e9,0x000003e8,
+0x0003003e,0x000003e5,0x000003e9,0x000200f9,
+0x000003bb,0x000200f8,0x000003ea,0x0004003d,
+0x0000000d,0x000003f4,0x000003ae,0x0003003e,
+0x000003f5,0x000003f3,0x00050041,0x00000051,
+0x000003f6,0x000003f5,0x000003f4,0x0004003d,
+0x00000033,0x000003f7,0x000003f6,0x0003003e,
+0x000003bc,0x000003f7,0x0004003d,0x0000000d,
+0x000003f8,0x000003b2,0x0003003e,0x000003f9,
+0x000003f3,0x00050041,0x00000051,0x000003fa,
+0x000003f9,0x000003f8,0x0004003d,0x00000033,
+0x000003fb,0x000003fa,0x0003003e,0x000003e5,
+0x000003fb,0x000200f9,0x000003bb,0x000200f8,
+0x000003bb,0x0004003d,0x0000000d,0x000003fd,
+0x0000005f,0x000500c7,0x0000000d,0x000003fe,
+0x000003fd,0x000000f5,0x000500ab,0x0000000f,
+0x000003ff,0x000003fe,0x000000d5,0x0003003e,
+0x000003fc,0x000003ff,0x0004003d,0x00000035,
+0x00000403,0x00000400,0x0003003e,0x00000402,
+0x00000403,0x0004003d,0x00000006,0x00000405,
+0x00000367,0x0003003e,0x00000404,0x00000405,
+0x0004003d,0x00000006,0x00000407,0x00000374,
+0x0003003e,0x00000406,0x00000407,0x0004003d,
+0x00000006,0x00000409,0x00000381,0x0003003e,
+0x00000408,0x00000409,0x0004003d,0x00000033,
+0x0000040b,0x000003bc,0x0003003e,0x0000040a,
+0x0000040b,0x0004003d,0x0000000d,0x0000040d,
+0x00000060,0x0003003e,0x0000040c,0x0000040d,
+0x0003003e,0x0000040e,0x00000401,0x0004003d,
+0x0000000f,0x00000410,0x000003fc,0x0003003e,
+0x0000040f,0x00000410,0x0004003d,0x0000000f,
+0x00000412,0x00000061,0x0003003e,0x00000411,
+0x00000412,0x0004003d,0x0000000f,0x00000414,
+0x0000031b,0x0003003e,0x00000413,0x00000414,
+0x000e0039,0x00000002,0x00000415,0x0000005d,
+0x00000402,0x00000404,0x00000406,0x00000408,
+0x0000040a,0x0000040c,0x0000040e,0x0000040f,
+0x00000411,0x00000413,0x0004003d,0x00000035,
+0x00000416,0x00000402,0x0003003e,0x00000400,
+0x00000416,0x0004003d,0x00000035,0x00000419,
+0x00000400,0x0003003e,0x00000418,0x00000419,
+0x0004003d,0x00000006,0x0000041b,0x0000036c,
+0x0003003e,0x0000041a,0x0000041b,0x0004003d,
+0x00000006,0x0000041d,0x00000379,0x0003003e,
+0x0000041c,0x0000041d,0x0004003d,0x00000006,
+0x0000041f,0x00000386,0x0003003e,0x0000041e,
+0x0000041f,0x0004003d,0x00000033,0x00000421,
+0x000003e5,0x0003003e,0x00000420,0x00000421,
+0x0004003d,0x0000000d,0x00000423,0x00000060,
+0x0003003e,0x00000422,0x00000423,0x0003003e,
+0x00000424,0x00000417,0x0004003d,0x0000000f,
+0x00000426,0x000003fc,0x0003003e,0x00000425,
+0x00000426,0x0004003d,0x0000000f,0x00000428,
+0x00000061,0x0003003e,0x00000427,0x00000428,
+0x0004003d,0x0000000f,0x0000042a,0x0000031b,
+0x0003003e,0x00000429,0x0000042a,0x000e0039,
+0x00000002,0x0000042b,0x0000005d,0x00000418,
+0x0000041a,0x0000041c,0x0000041e,0x00000420,
+0x00000422,0x00000424,0x00000425,0x00000427,
+0x00000429,0x0004003d,0x00000035,0x0000042c,
+0x00000418,0x0003003e,0x00000400,0x0000042c,
+0x0004003d,0x00000035,0x0000042d,0x00000400,
+0x000200fe,0x0000042d,0x00010038,0x00050036,
+0x0000000d,0x00000066,0x00000000,0x00000022,
+0x00030037,0x0000000e,0x00000064,0x00030037,
+0x0000000e,0x00000065,0x000200f8,0x00000067,
+0x0004003b,0x0000000e,0x00000430,0x00000007,
+0x0004003b,0x0000000e,0x0000043a,0x00000007,
+0x0004003d,0x0000000d,0x00000431,0x00000064,
+0x000500c7,0x0000000d,0x00000433,0x00000431,
+0x00000432,0x000500c4,0x0000000d,0x00000434,
+0x00000433,0x00000148,0x0003003e,0x00000430,
+0x00000434,0x0004003d,0x0000000d,0x00000435,
+0x00000064,0x000500c2,0x0000000d,0x00000436,
+0x00000435,0x00000148,0x000500c7,0x0000000d,
+0x00000437,0x00000436,0x00000432,0x0004003d,
+0x0000000d,0x00000438,0x00000430,0x000500c5,
+0x0000000d,0x00000439,0x00000438,0x00000437,
+0x0003003e,0x00000430,0x00000439,0x0004003d,
+0x0000000d,0x0000043b,0x00000065,0x000500c7,
+0x0000000d,0x0000043c,0x0000043b,0x00000432,
+0x000500c4,0x0000000d,0x0000043d,0x0000043c,
+0x00000148,0x0003003e,0x0000043a,0x0000043d,
+0x0004003d,0x0000000d,0x0000043e,0x00000065,
+0x000500c2,0x0000000d,0x0000043f,0x0000043e,
+0x00000148,0x000500c7,0x0000000d,0x00000440,
+0x0000043f,0x00000432,0x0004003d,0x0000000d,
+0x00000441,0x0000043a,0x000500c5,0x0000000d,
+0x00000442,0x00000441,0x00000440,0x0003003e,
+0x0000043a,0x00000442,0x0004003d,0x0000000d,
+0x00000443,0x00000430,0x000500c4,0x0000000d,
+0x00000444,0x00000443,0x0000013a,0x0004003d,
+0x0000000d,0x00000445,0x0000043a,0x000500c5,
+0x0000000d,0x00000446,0x00000444,0x00000445,
+0x000200fe,0x00000446,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_1D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_1D.inl
new file mode 100644
index 00000000000..dd3ffcf910e
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_1D.inl
@@ -0,0 +1,2073 @@
+0x07230203,0x00010300,0x000d000b,0x00000577,
+0x00000000,0x00020011,0x00000001,0x00020011,
+0x0000002c,0x0006000b,0x00000001,0x4c534c47,
+0x6474732e,0x3035342e,0x00000000,0x0003000e,
+0x00000000,0x00000001,0x0006000f,0x00000005,
+0x00000004,0x6e69616d,0x00000000,0x000004f6,
+0x00060010,0x00000004,0x00000011,0x00000008,
+0x00000008,0x00000001,0x00030003,0x00000002,
+0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
+0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
+0x7269645f,0x69746365,0x00006576,0x00080004,
+0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
+0x69645f65,0x74636572,0x00657669,0x00040005,
+0x00000004,0x6e69616d,0x00000000,0x00070005,
+0x0000000c,0x50746567,0x4431736f,0x61727241,
+0x69762879,0x00003b33,0x00030005,0x0000000b,
+0x00736f70,0x00070005,0x00000014,0x764f7369,
+0x6c667265,0x6465776f,0x3b317528,0x003b3175,
+0x00040005,0x00000012,0x65736162,0x00000000,
+0x00040005,0x00000013,0x66666964,0x00000000,
+0x00060005,0x00000018,0x766e6f63,0x34747265,
+0x28386f54,0x003b3175,0x00030005,0x00000017,
+0x00000062,0x00060005,0x0000001b,0x766e6f63,
+0x35747265,0x28386f54,0x003b3175,0x00030005,
+0x0000001a,0x00000062,0x00060005,0x0000001e,
+0x766e6f63,0x36747265,0x28386f54,0x003b3175,
+0x00030005,0x0000001d,0x00000062,0x00060005,
+0x00000021,0x766e6f63,0x37747265,0x28386f54,
+0x003b3175,0x00030005,0x00000020,0x00000062,
+0x00070005,0x00000026,0x766e6f63,0x44747265,
+0x28666669,0x753b3175,0x00003b31,0x00040005,
+0x00000024,0x65736162,0x00000000,0x00040005,
+0x00000025,0x66666964,0x00000000,0x00050005,
+0x0000002b,0x616c635f,0x6928706d,0x00003b31,
+0x00030005,0x0000002a,0x00000078,0x00050005,
+0x0000002f,0x616c635f,0x7628706d,0x003b3369,
+0x00030005,0x0000002e,0x00000078,0x000a0005,
+0x0000003d,0x32637465,0x485f545f,0x646e695f,
+0x76287865,0x345b3369,0x31753b5d,0x3b31623b,
+0x003b3162,0x00050005,0x00000039,0x54726c63,
+0x656c6261,0x00000000,0x00030005,0x0000003a,
+0x00776f6c,0x00070005,0x0000003b,0x75507369,
+0x7468636e,0x756f7268,0x6c416867,0x00616870,
+0x00040005,0x0000003c,0x7161706f,0x00006575,
+0x000b0005,0x00000044,0x32637465,0x6365645f,
+0x5f65646f,0x636f6c62,0x28545f6b,0x753b3175,
+0x31623b31,0x3b31623b,0x00000000,0x00040005,
+0x00000040,0x68676968,0x00000000,0x00030005,
+0x00000041,0x00776f6c,0x00070005,0x00000042,
+0x75507369,0x7468636e,0x756f7268,0x6c416867,
+0x00616870,0x00040005,0x00000043,0x7161706f,
+0x00006575,0x000b0005,0x0000004a,0x32637465,
+0x6365645f,0x5f65646f,0x636f6c62,0x28485f6b,
+0x753b3175,0x31623b31,0x3b31623b,0x00000000,
+0x00040005,0x00000046,0x68676968,0x00000000,
+0x00030005,0x00000047,0x00776f6c,0x00070005,
+0x00000048,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00040005,0x00000049,
+0x7161706f,0x00006575,0x000a0005,0x00000050,
+0x32637465,0x6365645f,0x5f65646f,0x636f6c62,
+0x28505f6b,0x753b3175,0x31623b31,0x0000003b,
+0x00040005,0x0000004d,0x68676968,0x00000000,
+0x00030005,0x0000004e,0x00776f6c,0x00070005,
+0x0000004f,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00100005,0x0000005f,
+0x6f636564,0x735f6564,0x6c626275,0x286b636f,
+0x5b346976,0x3b5d3631,0x693b3169,0x31693b31,
+0x3469763b,0x3b31753b,0x623b3162,0x31623b31,
+0x3b31623b,0x00000000,0x00040005,0x00000055,
+0x74754f70,0x00000000,0x00030005,0x00000056,
+0x00000072,0x00030005,0x00000057,0x00000067,
+0x00030005,0x00000058,0x00000062,0x00040005,
+0x00000059,0x6c626174,0x00000065,0x00030005,
+0x0000005a,0x00776f6c,0x00040005,0x0000005b,
+0x6f636573,0x0000646e,0x00040005,0x0000005c,
+0x70696c66,0x00646570,0x00070005,0x0000005d,
+0x75507369,0x7468636e,0x756f7268,0x6c416867,
+0x00616870,0x00040005,0x0000005e,0x7161706f,
+0x00006575,0x000a0005,0x00000064,0x32637465,
+0x6365645f,0x5f65646f,0x5f626772,0x636f6c62,
+0x3175286b,0x3b31753b,0x003b3162,0x00040005,
+0x00000061,0x68676968,0x00000000,0x00030005,
+0x00000062,0x00776f6c,0x00070005,0x00000063,
+0x75507369,0x7468636e,0x756f7268,0x6c416867,
+0x00616870,0x000d0005,0x0000006b,0x5f636165,
+0x6f636564,0x735f6564,0x6c676e69,0x68635f65,
+0x656e6e61,0x6c625f6c,0x286b636f,0x753b3175,
+0x31623b31,0x0000003b,0x00040005,0x00000068,
+0x68676968,0x00000000,0x00030005,0x00000069,
+0x00776f6c,0x00050005,0x0000006a,0x69537369,
+0x64656e67,0x00000000,0x00050005,0x0000006e,
+0x70696c66,0x75283233,0x00003b31,0x00030005,
+0x0000006d,0x00000061,0x00030005,0x00000074,
+0x006c6176,0x00050005,0x00000088,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x00000094,
+0x00000063,0x00030005,0x0000009f,0x00000063,
+0x00030005,0x000000a9,0x00000063,0x00030005,
+0x000000b4,0x00000063,0x00050005,0x000000c5,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x000000ca,0x61726170,0x0000006d,0x00030005,
+0x000000dd,0x00000079,0x00030005,0x000000e6,
+0x00000078,0x00030005,0x000000ee,0x0000006b,
+0x00030005,0x000000f3,0x0062736d,0x00030005,
+0x000000fa,0x0062736c,0x00030005,0x0000010c,
+0x00746572,0x00040005,0x00000114,0x7366666f,
+0x00007465,0x00030005,0x0000012b,0x00003172,
+0x00040005,0x00000137,0x61726170,0x0000006d,
+0x00030005,0x0000013a,0x00003167,0x00040005,
+0x0000013e,0x61726170,0x0000006d,0x00030005,
+0x00000141,0x00003162,0x00040005,0x00000145,
+0x61726170,0x0000006d,0x00030005,0x00000148,
+0x00003272,0x00040005,0x0000014c,0x61726170,
+0x0000006d,0x00030005,0x0000014f,0x00003267,
+0x00040005,0x00000153,0x61726170,0x0000006d,
+0x00030005,0x00000156,0x00003262,0x00040005,
+0x00000159,0x61726170,0x0000006d,0x00050005,
+0x0000015c,0x65746e69,0x4965736e,0x00007864,
+0x00050005,0x00000165,0x65746e69,0x4d65736e,
+0x0000646f,0x00050005,0x0000016c,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x0000016f,
+0x54726c63,0x656c6261,0x00000000,0x00040005,
+0x00000178,0x61726170,0x0000006d,0x00040005,
+0x0000017d,0x61726170,0x0000006d,0x00040005,
+0x00000182,0x61726170,0x0000006d,0x00040005,
+0x0000018e,0x61726170,0x0000006d,0x00040005,
+0x00000193,0x61726170,0x0000006d,0x00040005,
+0x00000198,0x61726170,0x0000006d,0x00040005,
+0x0000019c,0x61726170,0x0000006d,0x00040005,
+0x0000019e,0x61726170,0x0000006d,0x00040005,
+0x000001a0,0x61726170,0x0000006d,0x00040005,
+0x000001a2,0x61726170,0x0000006d,0x00040005,
+0x000001a7,0x31626772,0x00000000,0x00040005,
+0x000001aa,0x61726170,0x0000006d,0x00040005,
+0x000001b5,0x61726170,0x0000006d,0x00040005,
+0x000001c2,0x61726170,0x0000006d,0x00040005,
+0x000001c6,0x32626772,0x00000000,0x00040005,
+0x000001c9,0x61726170,0x0000006d,0x00040005,
+0x000001d0,0x61726170,0x0000006d,0x00040005,
+0x000001d6,0x61726170,0x0000006d,0x00050005,
+0x000001da,0x65746e69,0x4965736e,0x00007864,
+0x00050005,0x000001fa,0x65746e69,0x4d65736e,
+0x0000646f,0x00050005,0x000001fc,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x000001ff,
+0x54726c63,0x656c6261,0x00000000,0x00040005,
+0x00000208,0x61726170,0x0000006d,0x00040005,
+0x00000213,0x61726170,0x0000006d,0x00040005,
+0x0000021e,0x61726170,0x0000006d,0x00040005,
+0x00000229,0x61726170,0x0000006d,0x00040005,
+0x0000022c,0x61726170,0x0000006d,0x00040005,
+0x0000022e,0x61726170,0x0000006d,0x00040005,
+0x00000230,0x61726170,0x0000006d,0x00040005,
+0x00000232,0x61726170,0x0000006d,0x00040005,
+0x00000237,0x6f626772,0x00000000,0x00040005,
+0x0000023b,0x61726170,0x0000006d,0x00040005,
+0x00000247,0x61726170,0x0000006d,0x00040005,
+0x00000258,0x61726170,0x0000006d,0x00040005,
+0x0000025c,0x68626772,0x00000000,0x00040005,
+0x00000263,0x61726170,0x0000006d,0x00040005,
+0x00000269,0x61726170,0x0000006d,0x00040005,
+0x0000026f,0x61726170,0x0000006d,0x00040005,
+0x00000273,0x76626772,0x00000000,0x00040005,
+0x00000277,0x61726170,0x0000006d,0x00040005,
+0x0000027d,0x61726170,0x0000006d,0x00040005,
+0x00000281,0x61726170,0x0000006d,0x00030005,
+0x00000286,0x00000069,0x00030005,0x0000028e,
+0x00000079,0x00030005,0x00000291,0x00000078,
+0x00030005,0x00000294,0x00746572,0x00040005,
+0x000002ab,0x61726170,0x0000006d,0x00040005,
+0x000002b9,0x65736162,0x00000058,0x00040005,
+0x000002ba,0x65736162,0x00000059,0x00030005,
+0x000002c2,0x00000069,0x00030005,0x000002cd,
+0x00000078,0x00030005,0x000002d3,0x00000079,
+0x00030005,0x000002e4,0x0000006b,0x00030005,
+0x000002e9,0x0062736d,0x00030005,0x000002ef,
+0x0062736c,0x00030005,0x000002f4,0x00000071,
+0x00040005,0x00000308,0x7366666f,0x00007465,
+0x00040005,0x0000030c,0x746c6564,0x00000061,
+0x00040005,0x00000314,0x61726170,0x0000006d,
+0x00040005,0x00000319,0x61726170,0x0000006d,
+0x00040005,0x0000031e,0x61726170,0x0000006d,
+0x00040005,0x00000324,0x7161706f,0x00006575,
+0x00040005,0x00000333,0x73614272,0x00000065,
+0x00040005,0x00000336,0x73614267,0x00000065,
+0x00040005,0x00000339,0x73614262,0x00000065,
+0x00040005,0x0000033e,0x61726170,0x0000006d,
+0x00040005,0x00000340,0x61726170,0x0000006d,
+0x00040005,0x00000344,0x61726170,0x0000006d,
+0x00040005,0x00000346,0x61726170,0x0000006d,
+0x00040005,0x00000348,0x61726170,0x0000006d,
+0x00040005,0x0000034a,0x61726170,0x0000006d,
+0x00040005,0x00000350,0x61726170,0x0000006d,
+0x00040005,0x00000352,0x61726170,0x0000006d,
+0x00040005,0x00000356,0x61726170,0x0000006d,
+0x00040005,0x00000358,0x61726170,0x0000006d,
+0x00040005,0x0000035a,0x61726170,0x0000006d,
+0x00040005,0x0000035c,0x61726170,0x0000006d,
+0x00040005,0x00000362,0x61726170,0x0000006d,
+0x00040005,0x00000364,0x61726170,0x0000006d,
+0x00040005,0x00000368,0x61726170,0x0000006d,
+0x00040005,0x0000036a,0x61726170,0x0000006d,
+0x00040005,0x0000036c,0x61726170,0x0000006d,
+0x00030005,0x00000370,0x00003172,0x00040005,
+0x00000371,0x61726170,0x0000006d,0x00030005,
+0x00000375,0x00003272,0x00040005,0x00000378,
+0x61726170,0x0000006d,0x00040005,0x0000037a,
+0x61726170,0x0000006d,0x00030005,0x0000037d,
+0x00003167,0x00040005,0x0000037e,0x61726170,
+0x0000006d,0x00030005,0x00000382,0x00003267,
+0x00040005,0x00000385,0x61726170,0x0000006d,
+0x00040005,0x00000387,0x61726170,0x0000006d,
+0x00030005,0x0000038a,0x00003162,0x00040005,
+0x0000038b,0x61726170,0x0000006d,0x00030005,
+0x0000038f,0x00003262,0x00040005,0x00000392,
+0x61726170,0x0000006d,0x00040005,0x00000394,
+0x61726170,0x0000006d,0x00040005,0x0000039b,
+0x61726170,0x0000006d,0x00040005,0x000003a0,
+0x61726170,0x0000006d,0x00040005,0x000003a5,
+0x61726170,0x0000006d,0x00040005,0x000003aa,
+0x61726170,0x0000006d,0x00040005,0x000003af,
+0x61726170,0x0000006d,0x00040005,0x000003b4,
+0x61726170,0x0000006d,0x00050005,0x000003b7,
+0x6c626174,0x646e4965,0x00417865,0x00050005,
+0x000003bb,0x6c626174,0x646e4965,0x00427865,
+0x00040005,0x000003c5,0x6c626174,0x00004165,
+0x00050005,0x000003eb,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x000003ee,0x6c626174,
+0x00004265,0x00050005,0x000003f0,0x65646e69,
+0x6c626178,0x00000065,0x00050005,0x000003fe,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x00000402,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000405,0x70696c66,0x00646570,
+0x00030005,0x00000409,0x00746572,0x00040005,
+0x0000040b,0x61726170,0x0000006d,0x00040005,
+0x0000040d,0x61726170,0x0000006d,0x00040005,
+0x0000040f,0x61726170,0x0000006d,0x00040005,
+0x00000411,0x61726170,0x0000006d,0x00040005,
+0x00000413,0x61726170,0x0000006d,0x00040005,
+0x00000415,0x61726170,0x0000006d,0x00040005,
+0x00000417,0x61726170,0x0000006d,0x00040005,
+0x00000418,0x61726170,0x0000006d,0x00040005,
+0x0000041a,0x61726170,0x0000006d,0x00040005,
+0x0000041c,0x61726170,0x0000006d,0x00040005,
+0x00000421,0x61726170,0x0000006d,0x00040005,
+0x00000423,0x61726170,0x0000006d,0x00040005,
+0x00000425,0x61726170,0x0000006d,0x00040005,
+0x00000427,0x61726170,0x0000006d,0x00040005,
+0x00000429,0x61726170,0x0000006d,0x00040005,
+0x0000042b,0x61726170,0x0000006d,0x00040005,
+0x0000042d,0x61726170,0x0000006d,0x00040005,
+0x0000042e,0x61726170,0x0000006d,0x00040005,
+0x00000430,0x61726170,0x0000006d,0x00040005,
+0x00000432,0x61726170,0x0000006d,0x00060005,
+0x00000439,0x65736162,0x646f635f,0x726f7765,
+0x00000064,0x00050005,0x0000043f,0x746c756d,
+0x696c7069,0x00007265,0x00040005,0x00000445,
+0x496c6274,0x00007864,0x00040005,0x00000449,
+0x6c626174,0x00003065,0x00050005,0x00000478,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x0000047b,0x6c626174,0x00003165,0x00050005,
+0x0000047f,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x00000483,0x00000070,0x00030005,
+0x000004a9,0x00000069,0x00040005,0x000004b1,
+0x4974756f,0x00007864,0x00050005,0x000004b8,
+0x69646f6d,0x72656966,0x00000000,0x00060005,
+0x000004bd,0x69646f6d,0x72656966,0x756c6156,
+0x00000065,0x00040005,0x000004cc,0x6f636564,
+0x00646564,0x00040005,0x000004d2,0x75736572,
+0x0000746c,0x00040005,0x000004d4,0x61726170,
+0x0000006d,0x00030005,0x000004f3,0x00736f70,
+0x00080005,0x000004f6,0x475f6c67,0x61626f6c,
+0x766e496c,0x7461636f,0x496e6f69,0x00000044,
+0x00070005,0x000004f9,0x67616d49,0x726f4665,
+0x4274616d,0x6b636f6c,0x00000000,0x00060006,
+0x000004f9,0x00000000,0x706d6f63,0x6d726f46,
+0x00007461,0x00060006,0x000004f9,0x00000001,
+0x65736162,0x6579614c,0x00000072,0x00060005,
+0x000004fb,0x75705f75,0x6f436873,0x6174736e,
+0x0000746e,0x00050005,0x00000506,0x42637273,
+0x6b636f6c,0x00000000,0x00050005,0x00000509,
+0x6d695f75,0x30656761,0x00000000,0x00040005,
+0x0000050b,0x61726170,0x0000006d,0x00070005,
+0x00000514,0x6f636564,0x6572706d,0x64657373,
+0x68706c41,0x00000061,0x00040005,0x00000515,
+0x61726170,0x0000006d,0x00040005,0x00000519,
+0x61726170,0x0000006d,0x00040005,0x0000051d,
+0x61726170,0x0000006d,0x00040005,0x0000051e,
+0x61726170,0x0000006d,0x00040005,0x0000051f,
+0x61726170,0x0000006d,0x00060005,0x00000521,
+0x6f636564,0x6572706d,0x64657373,0x00000000,
+0x00040005,0x00000522,0x61726170,0x0000006d,
+0x00040005,0x00000528,0x61726170,0x0000006d,
+0x00040005,0x0000052e,0x61726170,0x0000006d,
+0x00040005,0x0000052f,0x61726170,0x0000006d,
+0x00040005,0x00000530,0x61726170,0x0000006d,
+0x00030005,0x00000532,0x00000079,0x00030005,
+0x0000053a,0x00000078,0x00050005,0x00000544,
+0x6d695f75,0x31656761,0x00000000,0x00040005,
+0x00000553,0x61726170,0x0000006d,0x00040047,
+0x000004f6,0x0000000b,0x0000001c,0x00050048,
+0x000004f9,0x00000000,0x00000023,0x00000000,
+0x00050048,0x000004f9,0x00000001,0x00000023,
+0x00000004,0x00030047,0x000004f9,0x00000002,
+0x00040047,0x00000509,0x00000022,0x00000000,
+0x00040047,0x00000509,0x00000021,0x00000000,
+0x00030047,0x00000509,0x00000018,0x00040047,
+0x00000544,0x00000022,0x00000000,0x00040047,
+0x00000544,0x00000021,0x00000001,0x00030047,
+0x00000544,0x00000019,0x00040047,0x00000576,
+0x0000000b,0x00000019,0x00020013,0x00000002,
+0x00030021,0x00000003,0x00000002,0x00040015,
+0x00000006,0x00000020,0x00000001,0x00040017,
+0x00000007,0x00000006,0x00000003,0x00040020,
+0x00000008,0x00000007,0x00000007,0x00040017,
+0x00000009,0x00000006,0x00000002,0x00040021,
+0x0000000a,0x00000009,0x00000008,0x00040015,
+0x0000000e,0x00000020,0x00000000,0x00040020,
+0x0000000f,0x00000007,0x0000000e,0x00020014,
+0x00000010,0x00050021,0x00000011,0x00000010,
+0x0000000f,0x0000000f,0x00040021,0x00000016,
+0x0000000e,0x0000000f,0x00050021,0x00000023,
+0x0000000e,0x0000000f,0x0000000f,0x00040020,
+0x00000028,0x00000007,0x00000006,0x00040021,
+0x00000029,0x00000006,0x00000028,0x00040021,
+0x0000002d,0x00000007,0x00000008,0x0004002b,
+0x0000000e,0x00000031,0x00000004,0x0004001c,
+0x00000032,0x00000007,0x00000031,0x00040020,
+0x00000033,0x00000007,0x00000032,0x00040020,
+0x00000034,0x00000007,0x00000010,0x00040017,
+0x00000035,0x00000006,0x00000004,0x0004002b,
+0x0000000e,0x00000036,0x00000010,0x0004001c,
+0x00000037,0x00000035,0x00000036,0x00070021,
+0x00000038,0x00000037,0x00000033,0x0000000f,
+0x00000034,0x00000034,0x00070021,0x0000003f,
+0x00000037,0x0000000f,0x0000000f,0x00000034,
+0x00000034,0x00060021,0x0000004c,0x00000037,
+0x0000000f,0x0000000f,0x00000034,0x00040020,
+0x00000052,0x00000007,0x00000037,0x00040020,
+0x00000053,0x00000007,0x00000035,0x000d0021,
+0x00000054,0x00000002,0x00000052,0x00000028,
+0x00000028,0x00000028,0x00000053,0x0000000f,
+0x00000034,0x00000034,0x00000034,0x00000034,
+0x0004001c,0x00000066,0x0000000e,0x00000036,
+0x00060021,0x00000067,0x00000066,0x0000000f,
+0x0000000f,0x00000034,0x0004002b,0x0000000e,
+0x00000075,0x0000001f,0x0004002b,0x0000000e,
+0x00000079,0x00000008,0x0004001c,0x0000007a,
+0x00000006,0x00000079,0x0004002b,0x00000006,
+0x0000007b,0x00000000,0x0004002b,0x00000006,
+0x0000007c,0x00000001,0x0004002b,0x00000006,
+0x0000007d,0x00000002,0x0004002b,0x00000006,
+0x0000007e,0x00000003,0x0004002b,0x00000006,
+0x0000007f,0xfffffffc,0x0004002b,0x00000006,
+0x00000080,0xfffffffd,0x0004002b,0x00000006,
+0x00000081,0xfffffffe,0x0004002b,0x00000006,
+0x00000082,0xffffffff,0x000b002c,0x0000007a,
+0x00000083,0x0000007b,0x0000007c,0x0000007d,
+0x0000007e,0x0000007f,0x00000080,0x00000081,
+0x00000082,0x0004002b,0x0000000e,0x00000084,
+0x00000007,0x00040020,0x00000087,0x00000007,
+0x0000007a,0x0004002b,0x00000006,0x0000008f,
+0x00000020,0x0004002b,0x0000000e,0x00000096,
+0x0000000f,0x0004002b,0x00000006,0x00000099,
+0x00000004,0x0004002b,0x0000000e,0x000000ab,
+0x0000003f,0x0004002b,0x0000000e,0x000000b6,
+0x0000007f,0x0004002b,0x00000006,0x000000bb,
+0x00000006,0x0004002b,0x00000006,0x000000cf,
+0x000000ff,0x0004002b,0x0000000e,0x000000de,
+0x00000000,0x0004002b,0x0000000e,0x000000f8,
+0x00000002,0x0004002b,0x0000000e,0x000000fe,
+0x00000001,0x0007002c,0x00000035,0x00000111,
+0x0000007b,0x0000007b,0x0000007b,0x0000007b,
+0x0004002b,0x00000006,0x0000012d,0x0000001b,
+0x0004002b,0x0000000e,0x0000012f,0x00000003,
+0x0004002b,0x00000006,0x00000133,0x00000018,
+0x0004002b,0x00000006,0x0000013c,0x00000014,
+0x0004002b,0x00000006,0x00000143,0x00000010,
+0x0004002b,0x00000006,0x0000014a,0x0000000c,
+0x0004002b,0x00000006,0x00000151,0x00000008,
+0x0004002b,0x00000006,0x00000166,0x0000000b,
+0x0004002b,0x00000006,0x00000167,0x00000017,
+0x0004002b,0x00000006,0x00000168,0x00000029,
+0x0004002b,0x00000006,0x00000169,0x00000040,
+0x000b002c,0x0000007a,0x0000016a,0x0000007e,
+0x000000bb,0x00000166,0x00000143,0x00000167,
+0x0000008f,0x00000168,0x00000169,0x0004002b,
+0x00000006,0x000001ba,0x00000013,0x0004002b,
+0x00000006,0x000001be,0x0000000f,0x0004002b,
+0x00000006,0x000001ce,0x00000007,0x0004002b,
+0x00000006,0x00000239,0x00000019,0x0004002b,
+0x00000006,0x00000243,0x00000011,0x0004002b,
+0x00000006,0x0000024d,0x00000005,0x0004002b,
+0x00000006,0x00000275,0x0000000d,0x0004002b,
+0x00000006,0x00000399,0x0000001c,0x0004001c,
+0x000003c6,0x00000035,0x00000079,0x0004002b,
+0x00000006,0x000003c7,0xfffffff8,0x0007002c,
+0x00000035,0x000003c8,0x0000007d,0x00000151,
+0x00000081,0x000003c7,0x0004002b,0x00000006,
+0x000003c9,0xfffffffb,0x0004002b,0x00000006,
+0x000003ca,0xffffffef,0x0007002c,0x00000035,
+0x000003cb,0x0000024d,0x00000243,0x000003c9,
+0x000003ca,0x0004002b,0x00000006,0x000003cc,
+0x00000009,0x0004002b,0x00000006,0x000003cd,
+0x0000001d,0x0004002b,0x00000006,0x000003ce,
+0xfffffff7,0x0004002b,0x00000006,0x000003cf,
+0xffffffe3,0x0007002c,0x00000035,0x000003d0,
+0x000003cc,0x000003cd,0x000003ce,0x000003cf,
+0x0004002b,0x00000006,0x000003d1,0x0000002a,
+0x0004002b,0x00000006,0x000003d2,0xfffffff3,
+0x0004002b,0x00000006,0x000003d3,0xffffffd6,
+0x0007002c,0x00000035,0x000003d4,0x00000275,
+0x000003d1,0x000003d2,0x000003d3,0x0004002b,
+0x00000006,0x000003d5,0x00000012,0x0004002b,
+0x00000006,0x000003d6,0x0000003c,0x0004002b,
+0x00000006,0x000003d7,0xffffffee,0x0004002b,
+0x00000006,0x000003d8,0xffffffc4,0x0007002c,
+0x00000035,0x000003d9,0x000003d5,0x000003d6,
+0x000003d7,0x000003d8,0x0004002b,0x00000006,
+0x000003da,0x00000050,0x0004002b,0x00000006,
+0x000003db,0xffffffe8,0x0004002b,0x00000006,
+0x000003dc,0xffffffb0,0x0007002c,0x00000035,
+0x000003dd,0x00000133,0x000003da,0x000003db,
+0x000003dc,0x0004002b,0x00000006,0x000003de,
+0x00000021,0x0004002b,0x00000006,0x000003df,
+0x0000006a,0x0004002b,0x00000006,0x000003e0,
+0xffffffdf,0x0004002b,0x00000006,0x000003e1,
+0xffffff96,0x0007002c,0x00000035,0x000003e2,
+0x000003de,0x000003df,0x000003e0,0x000003e1,
+0x0004002b,0x00000006,0x000003e3,0x0000002f,
+0x0004002b,0x00000006,0x000003e4,0x000000b7,
+0x0004002b,0x00000006,0x000003e5,0xffffffd1,
+0x0004002b,0x00000006,0x000003e6,0xffffff49,
+0x0007002c,0x00000035,0x000003e7,0x000003e3,
+0x000003e4,0x000003e5,0x000003e6,0x000b002c,
+0x000003c6,0x000003e8,0x000003c8,0x000003cb,
+0x000003d0,0x000003d4,0x000003d9,0x000003dd,
+0x000003e2,0x000003e7,0x00040020,0x000003ea,
+0x00000007,0x000003c6,0x0007002c,0x00000035,
+0x000003f4,0x0000007b,0x00000151,0x0000007b,
+0x000003c7,0x0007002c,0x00000035,0x000003f5,
+0x0000007b,0x00000243,0x0000007b,0x000003ca,
+0x0007002c,0x00000035,0x000003f6,0x0000007b,
+0x000003cd,0x0000007b,0x000003cf,0x0007002c,
+0x00000035,0x000003f7,0x0000007b,0x000003d1,
+0x0000007b,0x000003d3,0x0007002c,0x00000035,
+0x000003f8,0x0000007b,0x000003d6,0x0000007b,
+0x000003d8,0x0007002c,0x00000035,0x000003f9,
+0x0000007b,0x000003da,0x0000007b,0x000003dc,
+0x0007002c,0x00000035,0x000003fa,0x0000007b,
+0x000003df,0x0000007b,0x000003e1,0x0007002c,
+0x00000035,0x000003fb,0x0000007b,0x000003e4,
+0x0000007b,0x000003e6,0x000b002c,0x000003c6,
+0x000003fc,0x000003f4,0x000003f5,0x000003f6,
+0x000003f7,0x000003f8,0x000003f9,0x000003fa,
+0x000003fb,0x0003002a,0x00000010,0x0000040a,
+0x00030029,0x00000010,0x00000420,0x0004002b,
+0x0000000e,0x0000044a,0x00000020,0x0004001c,
+0x0000044b,0x00000035,0x0000044a,0x0004002b,
+0x00000006,0x0000044c,0xfffffffa,0x0004002b,
+0x00000006,0x0000044d,0xfffffff1,0x0007002c,
+0x00000035,0x0000044e,0x00000080,0x0000044c,
+0x000003ce,0x0000044d,0x0004002b,0x00000006,
+0x0000044f,0x0000000e,0x0007002c,0x00000035,
+0x00000450,0x0000007d,0x0000024d,0x00000151,
+0x0000044f,0x0004002b,0x00000006,0x00000451,
+0xfffffff9,0x0004002b,0x00000006,0x00000452,
+0xfffffff6,0x0007002c,0x00000035,0x00000453,
+0x00000080,0x00000451,0x00000452,0x000003d2,
+0x0007002c,0x00000035,0x00000454,0x0000007d,
+0x000000bb,0x000003cc,0x0000014a,0x0007002c,
+0x00000035,0x00000455,0x00000081,0x000003c9,
+0x000003c7,0x000003d2,0x0007002c,0x00000035,
+0x00000456,0x0000007c,0x00000099,0x000001ce,
+0x0000014a,0x0007002c,0x00000035,0x00000457,
+0x00000081,0x0000007f,0x0000044c,0x000003d2,
+0x0007002c,0x00000035,0x00000458,0x0000007c,
+0x0000007e,0x0000024d,0x0000014a,0x0004002b,
+0x00000006,0x00000459,0xfffffff4,0x0007002c,
+0x00000035,0x0000045a,0x00000080,0x0000044c,
+0x000003c7,0x00000459,0x0007002c,0x00000035,
+0x0000045b,0x0000007d,0x0000024d,0x000001ce,
+0x00000166,0x0004002b,0x00000006,0x0000045c,
+0xfffffff5,0x0007002c,0x00000035,0x0000045d,
+0x00000080,0x00000451,0x000003ce,0x0000045c,
+0x0004002b,0x00000006,0x0000045e,0x0000000a,
+0x0007002c,0x00000035,0x0000045f,0x0000007d,
+0x000000bb,0x00000151,0x0000045e,0x0007002c,
+0x00000035,0x00000460,0x0000007f,0x00000451,
+0x000003c7,0x0000045c,0x0007002c,0x00000035,
+0x00000461,0x0000007e,0x000000bb,0x000001ce,
+0x0000045e,0x0007002c,0x00000035,0x00000462,
+0x00000080,0x000003c9,0x000003c7,0x0000045c,
+0x0007002c,0x00000035,0x00000463,0x0000007d,
+0x00000099,0x000001ce,0x0000045e,0x0007002c,
+0x00000035,0x00000464,0x00000081,0x0000044c,
+0x000003c7,0x00000452,0x0007002c,0x00000035,
+0x00000465,0x0000007c,0x0000024d,0x000001ce,
+0x000003cc,0x0007002c,0x00000035,0x00000466,
+0x00000081,0x000003c9,0x000003c7,0x00000452,
+0x0007002c,0x00000035,0x00000467,0x0000007c,
+0x00000099,0x000001ce,0x000003cc,0x0007002c,
+0x00000035,0x00000468,0x00000081,0x0000007f,
+0x000003c7,0x00000452,0x0007002c,0x00000035,
+0x00000469,0x0000007c,0x0000007e,0x000001ce,
+0x000003cc,0x0007002c,0x00000035,0x0000046a,
+0x00000081,0x000003c9,0x00000451,0x00000452,
+0x0007002c,0x00000035,0x0000046b,0x0000007c,
+0x00000099,0x000000bb,0x000003cc,0x0007002c,
+0x00000035,0x0000046c,0x00000080,0x0000007f,
+0x00000451,0x00000452,0x0007002c,0x00000035,
+0x0000046d,0x0000007d,0x0000007e,0x000000bb,
+0x000003cc,0x0007002c,0x00000035,0x0000046e,
+0x00000082,0x00000081,0x00000080,0x00000452,
+0x0007002c,0x00000035,0x0000046f,0x0000007b,
+0x0000007c,0x0000007d,0x000003cc,0x0007002c,
+0x00000035,0x00000470,0x0000007f,0x0000044c,
+0x000003c7,0x000003ce,0x0007002c,0x00000035,
+0x00000471,0x0000007e,0x0000024d,0x000001ce,
+0x00000151,0x0007002c,0x00000035,0x00000472,
+0x00000080,0x000003c9,0x00000451,0x000003ce,
+0x0007002c,0x00000035,0x00000473,0x0000007d,
+0x00000099,0x000000bb,0x00000151,0x0023002c,
+0x0000044b,0x00000474,0x0000044e,0x00000450,
+0x00000453,0x00000454,0x00000455,0x00000456,
+0x00000457,0x00000458,0x0000045a,0x0000045b,
+0x0000045d,0x0000045f,0x00000460,0x00000461,
+0x00000462,0x00000463,0x00000464,0x00000465,
+0x00000466,0x00000467,0x00000468,0x00000469,
+0x0000046a,0x0000046b,0x0000046c,0x0000046d,
+0x0000046e,0x0000046f,0x00000470,0x00000471,
+0x00000472,0x00000473,0x00040020,0x00000477,
+0x00000007,0x0000044b,0x00040020,0x00000482,
+0x00000007,0x00000066,0x0004002b,0x00000006,
+0x00000491,0x0000001e,0x0004002b,0x00000006,
+0x00000499,0x00000015,0x0004002b,0x0000000e,
+0x000004df,0x000000ff,0x0004002b,0x0000000e,
+0x000004e3,0x0000ff00,0x0004002b,0x0000000e,
+0x000004e8,0x00ff0000,0x0004002b,0x0000000e,
+0x000004ed,0xff000000,0x00040017,0x000004f4,
+0x0000000e,0x00000003,0x00040020,0x000004f5,
+0x00000001,0x000004f4,0x0004003b,0x000004f5,
+0x000004f6,0x00000001,0x0004001e,0x000004f9,
+0x0000000e,0x0000000e,0x00040020,0x000004fa,
+0x00000009,0x000004f9,0x0004003b,0x000004fa,
+0x000004fb,0x00000009,0x00040020,0x000004fc,
+0x00000009,0x0000000e,0x00040017,0x00000504,
+0x0000000e,0x00000004,0x00040020,0x00000505,
+0x00000007,0x00000504,0x00090019,0x00000507,
+0x0000000e,0x00000000,0x00000000,0x00000001,
+0x00000000,0x00000002,0x0000001e,0x00040020,
+0x00000508,0x00000000,0x00000507,0x0004003b,
+0x00000508,0x00000509,0x00000000,0x00090019,
+0x00000542,0x0000000e,0x00000000,0x00000000,
+0x00000001,0x00000000,0x00000002,0x00000020,
+0x00040020,0x00000543,0x00000000,0x00000542,
+0x0004003b,0x00000543,0x00000544,0x00000000,
+0x0004002b,0x0000000e,0x0000056c,0x00000093,
+0x0004002b,0x0000000e,0x0000056d,0x00000094,
+0x0004002b,0x0000000e,0x0000056e,0x00000095,
+0x0004002b,0x0000000e,0x0000056f,0x00000096,
+0x0004002b,0x0000000e,0x00000570,0x00000097,
+0x0004002b,0x0000000e,0x00000571,0x00000098,
+0x0004002b,0x0000000e,0x00000572,0x00000099,
+0x0004002b,0x0000000e,0x00000573,0x0000009a,
+0x0004002b,0x0000000e,0x00000574,0x0000009b,
+0x0004002b,0x0000000e,0x00000575,0x0000009c,
+0x0006002c,0x000004f4,0x00000576,0x00000079,
+0x00000079,0x000000fe,0x00050036,0x00000002,
+0x00000004,0x00000000,0x00000003,0x000200f8,
+0x00000005,0x0004003b,0x00000008,0x000004f3,
+0x00000007,0x0004003b,0x00000505,0x00000506,
+0x00000007,0x0004003b,0x00000008,0x0000050b,
+0x00000007,0x0004003b,0x00000482,0x00000514,
+0x00000007,0x0004003b,0x0000000f,0x00000515,
+0x00000007,0x0004003b,0x0000000f,0x00000519,
+0x00000007,0x0004003b,0x0000000f,0x0000051d,
+0x00000007,0x0004003b,0x0000000f,0x0000051e,
+0x00000007,0x0004003b,0x00000034,0x0000051f,
+0x00000007,0x0004003b,0x00000052,0x00000521,
+0x00000007,0x0004003b,0x0000000f,0x00000522,
+0x00000007,0x0004003b,0x0000000f,0x00000528,
+0x00000007,0x0004003b,0x0000000f,0x0000052e,
+0x00000007,0x0004003b,0x0000000f,0x0000052f,
+0x00000007,0x0004003b,0x00000034,0x00000530,
+0x00000007,0x0004003b,0x00000028,0x00000532,
+0x00000007,0x0004003b,0x00000028,0x0000053a,
+0x00000007,0x0004003b,0x00000008,0x00000553,
+0x00000007,0x0004003d,0x000004f4,0x000004f7,
+0x000004f6,0x0004007c,0x00000007,0x000004f8,
+0x000004f7,0x0003003e,0x000004f3,0x000004f8,
+0x00050041,0x000004fc,0x000004fd,0x000004fb,
+0x0000007c,0x0004003d,0x0000000e,0x000004fe,
+0x000004fd,0x0004007c,0x00000006,0x000004ff,
+0x000004fe,0x00050041,0x00000028,0x00000500,
+0x000004f3,0x000000f8,0x0004003d,0x00000006,
+0x00000501,0x00000500,0x00050080,0x00000006,
+0x00000502,0x00000501,0x000004ff,0x00050041,
+0x00000028,0x00000503,0x000004f3,0x000000f8,
+0x0003003e,0x00000503,0x00000502,0x0004003d,
+0x00000507,0x0000050a,0x00000509,0x0004003d,
+0x00000007,0x0000050c,0x000004f3,0x0003003e,
+0x0000050b,0x0000050c,0x00050039,0x00000009,
+0x0000050d,0x0000000c,0x0000050b,0x00050062,
+0x00000504,0x0000050e,0x0000050a,0x0000050d,
+0x00050051,0x0000000e,0x0000050f,0x0000050e,
+0x00000000,0x00050051,0x0000000e,0x00000510,
+0x0000050e,0x00000001,0x00050051,0x0000000e,
+0x00000511,0x0000050e,0x00000002,0x00050051,
+0x0000000e,0x00000512,0x0000050e,0x00000003,
+0x00070050,0x00000504,0x00000513,0x0000050f,
+0x00000510,0x00000511,0x00000512,0x0003003e,
+0x00000506,0x00000513,0x00050041,0x0000000f,
+0x00000516,0x00000506,0x000000de,0x0004003d,
+0x0000000e,0x00000517,0x00000516,0x0003003e,
+0x00000515,0x00000517,0x00050039,0x0000000e,
+0x00000518,0x0000006e,0x00000515,0x00050041,
+0x0000000f,0x0000051a,0x00000506,0x000000fe,
+0x0004003d,0x0000000e,0x0000051b,0x0000051a,
+0x0003003e,0x00000519,0x0000051b,0x00050039,
+0x0000000e,0x0000051c,0x0000006e,0x00000519,
+0x0003003e,0x0000051d,0x00000518,0x0003003e,
+0x0000051e,0x0000051c,0x0003003e,0x0000051f,
+0x0000040a,0x00070039,0x00000066,0x00000520,
+0x0000006b,0x0000051d,0x0000051e,0x0000051f,
+0x0003003e,0x00000514,0x00000520,0x00050041,
+0x0000000f,0x00000523,0x00000506,0x000000f8,
+0x0004003d,0x0000000e,0x00000524,0x00000523,
+0x0003003e,0x00000522,0x00000524,0x00050039,
+0x0000000e,0x00000525,0x0000006e,0x00000522,
+0x0004007c,0x00000006,0x00000526,0x00000525,
+0x0004007c,0x0000000e,0x00000527,0x00000526,
+0x00050041,0x0000000f,0x00000529,0x00000506,
+0x0000012f,0x0004003d,0x0000000e,0x0000052a,
+0x00000529,0x0003003e,0x00000528,0x0000052a,
+0x00050039,0x0000000e,0x0000052b,0x0000006e,
+0x00000528,0x0004007c,0x00000006,0x0000052c,
+0x0000052b,0x0004007c,0x0000000e,0x0000052d,
+0x0000052c,0x0003003e,0x0000052e,0x00000527,
+0x0003003e,0x0000052f,0x0000052d,0x0003003e,
+0x00000530,0x0000040a,0x00070039,0x00000037,
+0x00000531,0x00000064,0x0000052e,0x0000052f,
+0x00000530,0x0003003e,0x00000521,0x00000531,
+0x0003003e,0x00000532,0x0000007b,0x000200f9,
+0x00000533,0x000200f8,0x00000533,0x000400f6,
+0x00000535,0x00000536,0x00000000,0x000200f9,
+0x00000537,0x000200f8,0x00000537,0x0004003d,
+0x00000006,0x00000538,0x00000532,0x000500b1,
+0x00000010,0x00000539,0x00000538,0x0000007c,
+0x000400fa,0x00000539,0x00000534,0x00000535,
+0x000200f8,0x00000534,0x0003003e,0x0000053a,
+0x0000007b,0x000200f9,0x0000053b,0x000200f8,
+0x0000053b,0x000400f6,0x0000053d,0x0000053e,
+0x00000000,0x000200f9,0x0000053f,0x000200f8,
+0x0000053f,0x0004003d,0x00000006,0x00000540,
+0x0000053a,0x000500b1,0x00000010,0x00000541,
+0x00000540,0x00000099,0x000400fa,0x00000541,
+0x0000053c,0x0000053d,0x000200f8,0x0000053c,
+0x0004003d,0x00000542,0x00000545,0x00000544,
+0x0004003d,0x00000007,0x00000546,0x000004f3,
+0x0007004f,0x00000009,0x00000547,0x00000546,
+0x00000546,0x00000000,0x00000001,0x00050050,
+0x00000009,0x00000548,0x00000099,0x00000099,
+0x00050084,0x00000009,0x00000549,0x00000547,
+0x00000548,0x0004003d,0x00000006,0x0000054a,
+0x0000053a,0x0004003d,0x00000006,0x0000054b,
+0x00000532,0x00050050,0x00000009,0x0000054c,
+0x0000054a,0x0000054b,0x00050080,0x00000009,
+0x0000054d,0x00000549,0x0000054c,0x00050041,
+0x00000028,0x0000054e,0x000004f3,0x000000f8,
+0x0004003d,0x00000006,0x0000054f,0x0000054e,
+0x00050051,0x00000006,0x00000550,0x0000054d,
+0x00000000,0x00050051,0x00000006,0x00000551,
+0x0000054d,0x00000001,0x00060050,0x00000007,
+0x00000552,0x00000550,0x00000551,0x0000054f,
+0x0003003e,0x00000553,0x00000552,0x00050039,
+0x00000009,0x00000554,0x0000000c,0x00000553,
+0x0004003d,0x00000006,0x00000555,0x00000532,
+0x00050084,0x00000006,0x00000556,0x00000555,
+0x00000099,0x0004003d,0x00000006,0x00000557,
+0x0000053a,0x00050080,0x00000006,0x00000558,
+0x00000556,0x00000557,0x00050041,0x00000053,
+0x00000559,0x00000521,0x00000558,0x0004003d,
+0x00000035,0x0000055a,0x00000559,0x0008004f,
+0x00000007,0x0000055b,0x0000055a,0x0000055a,
+0x00000000,0x00000001,0x00000002,0x0004003d,
+0x00000006,0x0000055c,0x00000532,0x00050084,
+0x00000006,0x0000055d,0x0000055c,0x00000099,
+0x0004003d,0x00000006,0x0000055e,0x0000053a,
+0x00050080,0x00000006,0x0000055f,0x0000055d,
+0x0000055e,0x00050041,0x0000000f,0x00000560,
+0x00000514,0x0000055f,0x0004003d,0x0000000e,
+0x00000561,0x00000560,0x0004007c,0x00000006,
+0x00000562,0x00000561,0x00050051,0x00000006,
+0x00000563,0x0000055b,0x00000000,0x00050051,
+0x00000006,0x00000564,0x0000055b,0x00000001,
+0x00050051,0x00000006,0x00000565,0x0000055b,
+0x00000002,0x00070050,0x00000035,0x00000566,
+0x00000563,0x00000564,0x00000565,0x00000562,
+0x0004007c,0x00000504,0x00000567,0x00000566,
+0x00040063,0x00000545,0x00000554,0x00000567,
+0x000200f9,0x0000053e,0x000200f8,0x0000053e,
+0x0004003d,0x00000006,0x00000568,0x0000053a,
+0x00050080,0x00000006,0x00000569,0x00000568,
+0x0000007c,0x0003003e,0x0000053a,0x00000569,
+0x000200f9,0x0000053b,0x000200f8,0x0000053d,
+0x000200f9,0x00000536,0x000200f8,0x00000536,
+0x0004003d,0x00000006,0x0000056a,0x00000532,
+0x00050080,0x00000006,0x0000056b,0x0000056a,
+0x0000007c,0x0003003e,0x00000532,0x0000056b,
+0x000200f9,0x00000533,0x000200f8,0x00000535,
+0x000100fd,0x00010038,0x00050036,0x00000009,
+0x0000000c,0x00000000,0x0000000a,0x00030037,
+0x00000008,0x0000000b,0x000200f8,0x0000000d,
+0x0004003d,0x00000007,0x00000070,0x0000000b,
+0x0007004f,0x00000009,0x00000071,0x00000070,
+0x00000070,0x00000000,0x00000002,0x000200fe,
+0x00000071,0x00010038,0x00050036,0x00000010,
+0x00000014,0x00000000,0x00000011,0x00030037,
+0x0000000f,0x00000012,0x00030037,0x0000000f,
+0x00000013,0x000200f8,0x00000015,0x0004003b,
+0x00000028,0x00000074,0x00000007,0x0004003b,
+0x00000087,0x00000088,0x00000007,0x0004003d,
+0x0000000e,0x00000076,0x00000012,0x000500c7,
+0x0000000e,0x00000077,0x00000075,0x00000076,
+0x0004007c,0x00000006,0x00000078,0x00000077,
+0x0004003d,0x0000000e,0x00000085,0x00000013,
+0x000500c7,0x0000000e,0x00000086,0x00000084,
+0x00000085,0x0003003e,0x00000088,0x00000083,
+0x00050041,0x00000028,0x00000089,0x00000088,
+0x00000086,0x0004003d,0x00000006,0x0000008a,
+0x00000089,0x00050080,0x00000006,0x0000008b,
+0x00000078,0x0000008a,0x0003003e,0x00000074,
+0x0000008b,0x0004003d,0x00000006,0x0000008c,
+0x00000074,0x000500b1,0x00000010,0x0000008d,
+0x0000008c,0x0000007b,0x0004003d,0x00000006,
+0x0000008e,0x00000074,0x000500af,0x00000010,
+0x00000090,0x0000008e,0x0000008f,0x000500a6,
+0x00000010,0x00000091,0x0000008d,0x00000090,
+0x000200fe,0x00000091,0x00010038,0x00050036,
+0x0000000e,0x00000018,0x00000000,0x00000016,
+0x00030037,0x0000000f,0x00000017,0x000200f8,
+0x00000019,0x0004003b,0x0000000f,0x00000094,
+0x00000007,0x0004003d,0x0000000e,0x00000095,
+0x00000017,0x000500c7,0x0000000e,0x00000097,
+0x00000095,0x00000096,0x0003003e,0x00000094,
+0x00000097,0x0004003d,0x0000000e,0x00000098,
+0x00000094,0x000500c4,0x0000000e,0x0000009a,
+0x00000098,0x00000099,0x0004003d,0x0000000e,
+0x0000009b,0x00000094,0x000500c5,0x0000000e,
+0x0000009c,0x0000009a,0x0000009b,0x000200fe,
+0x0000009c,0x00010038,0x00050036,0x0000000e,
+0x0000001b,0x00000000,0x00000016,0x00030037,
+0x0000000f,0x0000001a,0x000200f8,0x0000001c,
+0x0004003b,0x0000000f,0x0000009f,0x00000007,
+0x0004003d,0x0000000e,0x000000a0,0x0000001a,
+0x000500c7,0x0000000e,0x000000a1,0x000000a0,
+0x00000075,0x0003003e,0x0000009f,0x000000a1,
+0x0004003d,0x0000000e,0x000000a2,0x0000009f,
+0x000500c4,0x0000000e,0x000000a3,0x000000a2,
+0x0000007e,0x0004003d,0x0000000e,0x000000a4,
+0x0000009f,0x000500c2,0x0000000e,0x000000a5,
+0x000000a4,0x0000007d,0x000500c5,0x0000000e,
+0x000000a6,0x000000a3,0x000000a5,0x000200fe,
+0x000000a6,0x00010038,0x00050036,0x0000000e,
+0x0000001e,0x00000000,0x00000016,0x00030037,
+0x0000000f,0x0000001d,0x000200f8,0x0000001f,
+0x0004003b,0x0000000f,0x000000a9,0x00000007,
+0x0004003d,0x0000000e,0x000000aa,0x0000001d,
+0x000500c7,0x0000000e,0x000000ac,0x000000aa,
+0x000000ab,0x0003003e,0x000000a9,0x000000ac,
+0x0004003d,0x0000000e,0x000000ad,0x000000a9,
+0x000500c4,0x0000000e,0x000000ae,0x000000ad,
+0x0000007d,0x0004003d,0x0000000e,0x000000af,
+0x000000a9,0x000500c2,0x0000000e,0x000000b0,
+0x000000af,0x00000099,0x000500c5,0x0000000e,
+0x000000b1,0x000000ae,0x000000b0,0x000200fe,
+0x000000b1,0x00010038,0x00050036,0x0000000e,
+0x00000021,0x00000000,0x00000016,0x00030037,
+0x0000000f,0x00000020,0x000200f8,0x00000022,
+0x0004003b,0x0000000f,0x000000b4,0x00000007,
+0x0004003d,0x0000000e,0x000000b5,0x00000020,
+0x000500c7,0x0000000e,0x000000b7,0x000000b5,
+0x000000b6,0x0003003e,0x000000b4,0x000000b7,
+0x0004003d,0x0000000e,0x000000b8,0x000000b4,
+0x000500c4,0x0000000e,0x000000b9,0x000000b8,
+0x0000007c,0x0004003d,0x0000000e,0x000000ba,
+0x000000b4,0x000500c2,0x0000000e,0x000000bc,
+0x000000ba,0x000000bb,0x000500c5,0x0000000e,
+0x000000bd,0x000000b9,0x000000bc,0x000200fe,
+0x000000bd,0x00010038,0x00050036,0x0000000e,
+0x00000026,0x00000000,0x00000023,0x00030037,
+0x0000000f,0x00000024,0x00030037,0x0000000f,
+0x00000025,0x000200f8,0x00000027,0x0004003b,
+0x00000087,0x000000c5,0x00000007,0x0004003b,
+0x0000000f,0x000000ca,0x00000007,0x0004003d,
+0x0000000e,0x000000c0,0x00000024,0x000500c7,
+0x0000000e,0x000000c1,0x00000075,0x000000c0,
+0x0004007c,0x00000006,0x000000c2,0x000000c1,
+0x0004003d,0x0000000e,0x000000c3,0x00000025,
+0x000500c7,0x0000000e,0x000000c4,0x00000084,
+0x000000c3,0x0003003e,0x000000c5,0x00000083,
+0x00050041,0x00000028,0x000000c6,0x000000c5,
+0x000000c4,0x0004003d,0x00000006,0x000000c7,
+0x000000c6,0x00050080,0x00000006,0x000000c8,
+0x000000c2,0x000000c7,0x0004007c,0x0000000e,
+0x000000c9,0x000000c8,0x0003003e,0x000000ca,
+0x000000c9,0x00050039,0x0000000e,0x000000cb,
+0x0000001b,0x000000ca,0x000200fe,0x000000cb,
+0x00010038,0x00050036,0x00000006,0x0000002b,
+0x00000000,0x00000029,0x00030037,0x00000028,
+0x0000002a,0x000200f8,0x0000002c,0x0004003d,
+0x00000006,0x000000ce,0x0000002a,0x0008000c,
+0x00000006,0x000000d0,0x00000001,0x0000002d,
+0x000000ce,0x0000007b,0x000000cf,0x000200fe,
+0x000000d0,0x00010038,0x00050036,0x00000007,
+0x0000002f,0x00000000,0x0000002d,0x00030037,
+0x00000008,0x0000002e,0x000200f8,0x00000030,
+0x0004003d,0x00000007,0x000000d3,0x0000002e,
+0x00060050,0x00000007,0x000000d4,0x0000007b,
+0x0000007b,0x0000007b,0x00060050,0x00000007,
+0x000000d5,0x000000cf,0x000000cf,0x000000cf,
+0x0008000c,0x00000007,0x000000d6,0x00000001,
+0x0000002d,0x000000d3,0x000000d4,0x000000d5,
+0x00050051,0x00000006,0x000000d7,0x000000d6,
+0x00000000,0x00050051,0x00000006,0x000000d8,
+0x000000d6,0x00000001,0x00050051,0x00000006,
+0x000000d9,0x000000d6,0x00000002,0x00060050,
+0x00000007,0x000000da,0x000000d7,0x000000d8,
+0x000000d9,0x000200fe,0x000000da,0x00010038,
+0x00050036,0x00000037,0x0000003d,0x00000000,
+0x00000038,0x00030037,0x00000033,0x00000039,
+0x00030037,0x0000000f,0x0000003a,0x00030037,
+0x00000034,0x0000003b,0x00030037,0x00000034,
+0x0000003c,0x000200f8,0x0000003e,0x0004003b,
+0x0000000f,0x000000dd,0x00000007,0x0004003b,
+0x0000000f,0x000000e6,0x00000007,0x0004003b,
+0x0000000f,0x000000ee,0x00000007,0x0004003b,
+0x0000000f,0x000000f3,0x00000007,0x0004003b,
+0x0000000f,0x000000fa,0x00000007,0x0004003b,
+0x00000052,0x0000010c,0x00000007,0x0004003b,
+0x0000000f,0x00000114,0x00000007,0x0003003e,
+0x000000dd,0x000000de,0x000200f9,0x000000df,
+0x000200f8,0x000000df,0x000400f6,0x000000e1,
+0x000000e2,0x00000000,0x000200f9,0x000000e3,
+0x000200f8,0x000000e3,0x0004003d,0x0000000e,
+0x000000e4,0x000000dd,0x000500b0,0x00000010,
+0x000000e5,0x000000e4,0x00000031,0x000400fa,
+0x000000e5,0x000000e0,0x000000e1,0x000200f8,
+0x000000e0,0x0003003e,0x000000e6,0x000000de,
+0x000200f9,0x000000e7,0x000200f8,0x000000e7,
+0x000400f6,0x000000e9,0x000000ea,0x00000000,
+0x000200f9,0x000000eb,0x000200f8,0x000000eb,
+0x0004003d,0x0000000e,0x000000ec,0x000000e6,
+0x000500b0,0x00000010,0x000000ed,0x000000ec,
+0x00000031,0x000400fa,0x000000ed,0x000000e8,
+0x000000e9,0x000200f8,0x000000e8,0x0004003d,
+0x0000000e,0x000000ef,0x000000dd,0x0004003d,
+0x0000000e,0x000000f0,0x000000e6,0x00050084,
+0x0000000e,0x000000f1,0x000000f0,0x00000031,
+0x00050080,0x0000000e,0x000000f2,0x000000ef,
+0x000000f1,0x0003003e,0x000000ee,0x000000f2,
+0x0004003d,0x0000000e,0x000000f4,0x0000003a,
+0x0004003d,0x0000000e,0x000000f5,0x000000ee,
+0x00050080,0x0000000e,0x000000f6,0x000000f5,
+0x00000096,0x000500c2,0x0000000e,0x000000f7,
+0x000000f4,0x000000f6,0x000500c7,0x0000000e,
+0x000000f9,0x000000f7,0x000000f8,0x0003003e,
+0x000000f3,0x000000f9,0x0004003d,0x0000000e,
+0x000000fb,0x0000003a,0x0004003d,0x0000000e,
+0x000000fc,0x000000ee,0x000500c2,0x0000000e,
+0x000000fd,0x000000fb,0x000000fc,0x000500c7,
+0x0000000e,0x000000ff,0x000000fd,0x000000fe,
+0x0003003e,0x000000fa,0x000000ff,0x0004003d,
+0x00000010,0x00000100,0x0000003b,0x0004003d,
+0x00000010,0x00000101,0x0000003c,0x000400a8,
+0x00000010,0x00000102,0x00000101,0x000500a7,
+0x00000010,0x00000103,0x00000100,0x00000102,
+0x0004003d,0x0000000e,0x00000104,0x000000f3,
+0x000500ab,0x00000010,0x00000105,0x00000104,
+0x000000de,0x000500a7,0x00000010,0x00000106,
+0x00000103,0x00000105,0x0004003d,0x0000000e,
+0x00000107,0x000000fa,0x000500aa,0x00000010,
+0x00000108,0x00000107,0x000000de,0x000500a7,
+0x00000010,0x00000109,0x00000106,0x00000108,
+0x000300f7,0x0000010b,0x00000000,0x000400fa,
+0x00000109,0x0000010a,0x00000113,0x000200f8,
+0x0000010a,0x0004003d,0x0000000e,0x0000010d,
+0x000000dd,0x00050084,0x0000000e,0x0000010e,
+0x0000010d,0x00000031,0x0004003d,0x0000000e,
+0x0000010f,0x000000e6,0x00050080,0x0000000e,
+0x00000110,0x0000010e,0x0000010f,0x00050041,
+0x00000053,0x00000112,0x0000010c,0x00000110,
+0x0003003e,0x00000112,0x00000111,0x000200f9,
+0x0000010b,0x000200f8,0x00000113,0x0004003d,
+0x0000000e,0x00000115,0x000000fa,0x0004003d,
+0x0000000e,0x00000116,0x000000f3,0x000500c5,
+0x0000000e,0x00000117,0x00000115,0x00000116,
+0x0003003e,0x00000114,0x00000117,0x0004003d,
+0x0000000e,0x00000118,0x000000dd,0x00050084,
+0x0000000e,0x00000119,0x00000118,0x00000031,
+0x0004003d,0x0000000e,0x0000011a,0x000000e6,
+0x00050080,0x0000000e,0x0000011b,0x00000119,
+0x0000011a,0x0004003d,0x0000000e,0x0000011c,
+0x00000114,0x00050041,0x00000008,0x0000011d,
+0x00000039,0x0000011c,0x0004003d,0x00000007,
+0x0000011e,0x0000011d,0x00050051,0x00000006,
+0x0000011f,0x0000011e,0x00000000,0x00050051,
+0x00000006,0x00000120,0x0000011e,0x00000001,
+0x00050051,0x00000006,0x00000121,0x0000011e,
+0x00000002,0x00070050,0x00000035,0x00000122,
+0x0000011f,0x00000120,0x00000121,0x000000cf,
+0x00050041,0x00000053,0x00000123,0x0000010c,
+0x0000011b,0x0003003e,0x00000123,0x00000122,
+0x000200f9,0x0000010b,0x000200f8,0x0000010b,
+0x000200f9,0x000000ea,0x000200f8,0x000000ea,
+0x0004003d,0x0000000e,0x00000124,0x000000e6,
+0x00050080,0x0000000e,0x00000125,0x00000124,
+0x0000007c,0x0003003e,0x000000e6,0x00000125,
+0x000200f9,0x000000e7,0x000200f8,0x000000e9,
+0x000200f9,0x000000e2,0x000200f8,0x000000e2,
+0x0004003d,0x0000000e,0x00000126,0x000000dd,
+0x00050080,0x0000000e,0x00000127,0x00000126,
+0x0000007c,0x0003003e,0x000000dd,0x00000127,
+0x000200f9,0x000000df,0x000200f8,0x000000e1,
+0x0004003d,0x00000037,0x00000128,0x0000010c,
+0x000200fe,0x00000128,0x00010038,0x00050036,
+0x00000037,0x00000044,0x00000000,0x0000003f,
+0x00030037,0x0000000f,0x00000040,0x00030037,
+0x0000000f,0x00000041,0x00030037,0x00000034,
+0x00000042,0x00030037,0x00000034,0x00000043,
+0x000200f8,0x00000045,0x0004003b,0x00000028,
+0x0000012b,0x00000007,0x0004003b,0x0000000f,
+0x00000137,0x00000007,0x0004003b,0x00000028,
+0x0000013a,0x00000007,0x0004003b,0x0000000f,
+0x0000013e,0x00000007,0x0004003b,0x00000028,
+0x00000141,0x00000007,0x0004003b,0x0000000f,
+0x00000145,0x00000007,0x0004003b,0x00000028,
+0x00000148,0x00000007,0x0004003b,0x0000000f,
+0x0000014c,0x00000007,0x0004003b,0x00000028,
+0x0000014f,0x00000007,0x0004003b,0x0000000f,
+0x00000153,0x00000007,0x0004003b,0x00000028,
+0x00000156,0x00000007,0x0004003b,0x0000000f,
+0x00000159,0x00000007,0x0004003b,0x00000028,
+0x0000015c,0x00000007,0x0004003b,0x00000028,
+0x00000165,0x00000007,0x0004003b,0x00000087,
+0x0000016c,0x00000007,0x0004003b,0x00000033,
+0x0000016f,0x00000007,0x0004003b,0x00000028,
+0x00000178,0x00000007,0x0004003b,0x00000028,
+0x0000017d,0x00000007,0x0004003b,0x00000028,
+0x00000182,0x00000007,0x0004003b,0x00000028,
+0x0000018e,0x00000007,0x0004003b,0x00000028,
+0x00000193,0x00000007,0x0004003b,0x00000028,
+0x00000198,0x00000007,0x0004003b,0x00000033,
+0x0000019c,0x00000007,0x0004003b,0x0000000f,
+0x0000019e,0x00000007,0x0004003b,0x00000034,
+0x000001a0,0x00000007,0x0004003b,0x00000034,
+0x000001a2,0x00000007,0x0004003d,0x0000000e,
+0x0000012c,0x00000040,0x000500c2,0x0000000e,
+0x0000012e,0x0000012c,0x0000012d,0x000500c7,
+0x0000000e,0x00000130,0x0000012e,0x0000012f,
+0x000500c4,0x0000000e,0x00000131,0x00000130,
+0x0000007d,0x0004003d,0x0000000e,0x00000132,
+0x00000040,0x000500c2,0x0000000e,0x00000134,
+0x00000132,0x00000133,0x000500c7,0x0000000e,
+0x00000135,0x00000134,0x0000012f,0x000500c5,
+0x0000000e,0x00000136,0x00000131,0x00000135,
+0x0003003e,0x00000137,0x00000136,0x00050039,
+0x0000000e,0x00000138,0x00000018,0x00000137,
+0x0004007c,0x00000006,0x00000139,0x00000138,
+0x0003003e,0x0000012b,0x00000139,0x0004003d,
+0x0000000e,0x0000013b,0x00000040,0x000500c2,
+0x0000000e,0x0000013d,0x0000013b,0x0000013c,
+0x0003003e,0x0000013e,0x0000013d,0x00050039,
+0x0000000e,0x0000013f,0x00000018,0x0000013e,
+0x0004007c,0x00000006,0x00000140,0x0000013f,
+0x0003003e,0x0000013a,0x00000140,0x0004003d,
+0x0000000e,0x00000142,0x00000040,0x000500c2,
+0x0000000e,0x00000144,0x00000142,0x00000143,
+0x0003003e,0x00000145,0x00000144,0x00050039,
+0x0000000e,0x00000146,0x00000018,0x00000145,
+0x0004007c,0x00000006,0x00000147,0x00000146,
+0x0003003e,0x00000141,0x00000147,0x0004003d,
+0x0000000e,0x00000149,0x00000040,0x000500c2,
+0x0000000e,0x0000014b,0x00000149,0x0000014a,
+0x0003003e,0x0000014c,0x0000014b,0x00050039,
+0x0000000e,0x0000014d,0x00000018,0x0000014c,
+0x0004007c,0x00000006,0x0000014e,0x0000014d,
+0x0003003e,0x00000148,0x0000014e,0x0004003d,
+0x0000000e,0x00000150,0x00000040,0x000500c2,
+0x0000000e,0x00000152,0x00000150,0x00000151,
+0x0003003e,0x00000153,0x00000152,0x00050039,
+0x0000000e,0x00000154,0x00000018,0x00000153,
+0x0004007c,0x00000006,0x00000155,0x00000154,
+0x0003003e,0x0000014f,0x00000155,0x0004003d,
+0x0000000e,0x00000157,0x00000040,0x000500c2,
+0x0000000e,0x00000158,0x00000157,0x00000099,
+0x0003003e,0x00000159,0x00000158,0x00050039,
+0x0000000e,0x0000015a,0x00000018,0x00000159,
+0x0004007c,0x00000006,0x0000015b,0x0000015a,
+0x0003003e,0x00000156,0x0000015b,0x0004003d,
+0x0000000e,0x0000015d,0x00000040,0x000500c2,
+0x0000000e,0x0000015e,0x0000015d,0x0000007d,
+0x000500c7,0x0000000e,0x0000015f,0x0000015e,
+0x0000012f,0x000500c4,0x0000000e,0x00000160,
+0x0000015f,0x0000007c,0x0004003d,0x0000000e,
+0x00000161,0x00000040,0x000500c7,0x0000000e,
+0x00000162,0x00000161,0x000000fe,0x000500c5,
+0x0000000e,0x00000163,0x00000160,0x00000162,
+0x0004007c,0x00000006,0x00000164,0x00000163,
+0x0003003e,0x0000015c,0x00000164,0x0004003d,
+0x00000006,0x0000016b,0x0000015c,0x0003003e,
+0x0000016c,0x0000016a,0x00050041,0x00000028,
+0x0000016d,0x0000016c,0x0000016b,0x0004003d,
+0x00000006,0x0000016e,0x0000016d,0x0003003e,
+0x00000165,0x0000016e,0x0004003d,0x00000006,
+0x00000170,0x0000012b,0x0004003d,0x00000006,
+0x00000171,0x0000013a,0x0004003d,0x00000006,
+0x00000172,0x00000141,0x00060050,0x00000007,
+0x00000173,0x00000170,0x00000171,0x00000172,
+0x00050041,0x00000008,0x00000174,0x0000016f,
+0x0000007b,0x0003003e,0x00000174,0x00000173,
+0x0004003d,0x00000006,0x00000175,0x00000148,
+0x0004003d,0x00000006,0x00000176,0x00000165,
+0x00050080,0x00000006,0x00000177,0x00000175,
+0x00000176,0x0003003e,0x00000178,0x00000177,
+0x00050039,0x00000006,0x00000179,0x0000002b,
+0x00000178,0x0004003d,0x00000006,0x0000017a,
+0x0000014f,0x0004003d,0x00000006,0x0000017b,
+0x00000165,0x00050080,0x00000006,0x0000017c,
+0x0000017a,0x0000017b,0x0003003e,0x0000017d,
+0x0000017c,0x00050039,0x00000006,0x0000017e,
+0x0000002b,0x0000017d,0x0004003d,0x00000006,
+0x0000017f,0x00000156,0x0004003d,0x00000006,
+0x00000180,0x00000165,0x00050080,0x00000006,
+0x00000181,0x0000017f,0x00000180,0x0003003e,
+0x00000182,0x00000181,0x00050039,0x00000006,
+0x00000183,0x0000002b,0x00000182,0x00060050,
+0x00000007,0x00000184,0x00000179,0x0000017e,
+0x00000183,0x00050041,0x00000008,0x00000185,
+0x0000016f,0x0000007c,0x0003003e,0x00000185,
+0x00000184,0x0004003d,0x00000006,0x00000186,
+0x00000148,0x0004003d,0x00000006,0x00000187,
+0x0000014f,0x0004003d,0x00000006,0x00000188,
+0x00000156,0x00060050,0x00000007,0x00000189,
+0x00000186,0x00000187,0x00000188,0x00050041,
+0x00000008,0x0000018a,0x0000016f,0x0000007d,
+0x0003003e,0x0000018a,0x00000189,0x0004003d,
+0x00000006,0x0000018b,0x00000148,0x0004003d,
+0x00000006,0x0000018c,0x00000165,0x00050082,
+0x00000006,0x0000018d,0x0000018b,0x0000018c,
+0x0003003e,0x0000018e,0x0000018d,0x00050039,
+0x00000006,0x0000018f,0x0000002b,0x0000018e,
+0x0004003d,0x00000006,0x00000190,0x0000014f,
+0x0004003d,0x00000006,0x00000191,0x00000165,
+0x00050082,0x00000006,0x00000192,0x00000190,
+0x00000191,0x0003003e,0x00000193,0x00000192,
+0x00050039,0x00000006,0x00000194,0x0000002b,
+0x00000193,0x0004003d,0x00000006,0x00000195,
+0x00000156,0x0004003d,0x00000006,0x00000196,
+0x00000165,0x00050082,0x00000006,0x00000197,
+0x00000195,0x00000196,0x0003003e,0x00000198,
+0x00000197,0x00050039,0x00000006,0x00000199,
+0x0000002b,0x00000198,0x00060050,0x00000007,
+0x0000019a,0x0000018f,0x00000194,0x00000199,
+0x00050041,0x00000008,0x0000019b,0x0000016f,
+0x0000007e,0x0003003e,0x0000019b,0x0000019a,
+0x0004003d,0x00000032,0x0000019d,0x0000016f,
+0x0003003e,0x0000019c,0x0000019d,0x0004003d,
+0x0000000e,0x0000019f,0x00000041,0x0003003e,
+0x0000019e,0x0000019f,0x0004003d,0x00000010,
+0x000001a1,0x00000042,0x0003003e,0x000001a0,
+0x000001a1,0x0004003d,0x00000010,0x000001a3,
+0x00000043,0x0003003e,0x000001a2,0x000001a3,
+0x00080039,0x00000037,0x000001a4,0x0000003d,
+0x0000019c,0x0000019e,0x000001a0,0x000001a2,
+0x000200fe,0x000001a4,0x00010038,0x00050036,
+0x00000037,0x0000004a,0x00000000,0x0000003f,
+0x00030037,0x0000000f,0x00000046,0x00030037,
+0x0000000f,0x00000047,0x00030037,0x00000034,
+0x00000048,0x00030037,0x00000034,0x00000049,
+0x000200f8,0x0000004b,0x0004003b,0x00000008,
+0x000001a7,0x00000007,0x0004003b,0x0000000f,
+0x000001aa,0x00000007,0x0004003b,0x0000000f,
+0x000001b5,0x00000007,0x0004003b,0x0000000f,
+0x000001c2,0x00000007,0x0004003b,0x00000008,
+0x000001c6,0x00000007,0x0004003b,0x0000000f,
+0x000001c9,0x00000007,0x0004003b,0x0000000f,
+0x000001d0,0x00000007,0x0004003b,0x0000000f,
+0x000001d6,0x00000007,0x0004003b,0x0000000f,
+0x000001da,0x00000007,0x0004003b,0x00000028,
+0x000001fa,0x00000007,0x0004003b,0x00000087,
+0x000001fc,0x00000007,0x0004003b,0x00000033,
+0x000001ff,0x00000007,0x0004003b,0x00000008,
+0x00000208,0x00000007,0x0004003b,0x00000008,
+0x00000213,0x00000007,0x0004003b,0x00000008,
+0x0000021e,0x00000007,0x0004003b,0x00000008,
+0x00000229,0x00000007,0x0004003b,0x00000033,
+0x0000022c,0x00000007,0x0004003b,0x0000000f,
+0x0000022e,0x00000007,0x0004003b,0x00000034,
+0x00000230,0x00000007,0x0004003b,0x00000034,
+0x00000232,0x00000007,0x0004003d,0x0000000e,
+0x000001a8,0x00000046,0x000500c2,0x0000000e,
+0x000001a9,0x000001a8,0x0000012d,0x0003003e,
+0x000001aa,0x000001a9,0x00050039,0x0000000e,
+0x000001ab,0x00000018,0x000001aa,0x0004007c,
+0x00000006,0x000001ac,0x000001ab,0x00050041,
+0x00000028,0x000001ad,0x000001a7,0x000000de,
+0x0003003e,0x000001ad,0x000001ac,0x0004003d,
+0x0000000e,0x000001ae,0x00000046,0x000500c2,
+0x0000000e,0x000001af,0x000001ae,0x00000133,
+0x000500c4,0x0000000e,0x000001b0,0x000001af,
+0x0000007c,0x0004003d,0x0000000e,0x000001b1,
+0x00000046,0x000500c2,0x0000000e,0x000001b2,
+0x000001b1,0x0000013c,0x000500c7,0x0000000e,
+0x000001b3,0x000001b2,0x000000fe,0x000500c5,
+0x0000000e,0x000001b4,0x000001b0,0x000001b3,
+0x0003003e,0x000001b5,0x000001b4,0x00050039,
+0x0000000e,0x000001b6,0x00000018,0x000001b5,
+0x0004007c,0x00000006,0x000001b7,0x000001b6,
+0x00050041,0x00000028,0x000001b8,0x000001a7,
+0x000000fe,0x0003003e,0x000001b8,0x000001b7,
+0x0004003d,0x0000000e,0x000001b9,0x00000046,
+0x000500c2,0x0000000e,0x000001bb,0x000001b9,
+0x000001ba,0x000500c4,0x0000000e,0x000001bc,
+0x000001bb,0x0000007e,0x0004003d,0x0000000e,
+0x000001bd,0x00000046,0x000500c2,0x0000000e,
+0x000001bf,0x000001bd,0x000001be,0x000500c7,
+0x0000000e,0x000001c0,0x000001bf,0x00000084,
+0x000500c5,0x0000000e,0x000001c1,0x000001bc,
+0x000001c0,0x0003003e,0x000001c2,0x000001c1,
+0x00050039,0x0000000e,0x000001c3,0x00000018,
+0x000001c2,0x0004007c,0x00000006,0x000001c4,
+0x000001c3,0x00050041,0x00000028,0x000001c5,
+0x000001a7,0x000000f8,0x0003003e,0x000001c5,
+0x000001c4,0x0004003d,0x0000000e,0x000001c7,
+0x00000046,0x000500c2,0x0000000e,0x000001c8,
+0x000001c7,0x00000166,0x0003003e,0x000001c9,
+0x000001c8,0x00050039,0x0000000e,0x000001ca,
+0x00000018,0x000001c9,0x0004007c,0x00000006,
+0x000001cb,0x000001ca,0x00050041,0x00000028,
+0x000001cc,0x000001c6,0x000000de,0x0003003e,
+0x000001cc,0x000001cb,0x0004003d,0x0000000e,
+0x000001cd,0x00000046,0x000500c2,0x0000000e,
+0x000001cf,0x000001cd,0x000001ce,0x0003003e,
+0x000001d0,0x000001cf,0x00050039,0x0000000e,
+0x000001d1,0x00000018,0x000001d0,0x0004007c,
+0x00000006,0x000001d2,0x000001d1,0x00050041,
+0x00000028,0x000001d3,0x000001c6,0x000000fe,
+0x0003003e,0x000001d3,0x000001d2,0x0004003d,
+0x0000000e,0x000001d4,0x00000046,0x000500c2,
+0x0000000e,0x000001d5,0x000001d4,0x0000007e,
+0x0003003e,0x000001d6,0x000001d5,0x00050039,
+0x0000000e,0x000001d7,0x00000018,0x000001d6,
+0x0004007c,0x00000006,0x000001d8,0x000001d7,
+0x00050041,0x00000028,0x000001d9,0x000001c6,
+0x000000f8,0x0003003e,0x000001d9,0x000001d8,
+0x0004003d,0x0000000e,0x000001db,0x00000046,
+0x000500c7,0x0000000e,0x000001dc,0x000001db,
+0x00000031,0x0003003e,0x000001da,0x000001dc,
+0x0004003d,0x0000000e,0x000001dd,0x00000046,
+0x000500c7,0x0000000e,0x000001de,0x000001dd,
+0x000000fe,0x000500c4,0x0000000e,0x000001df,
+0x000001de,0x0000007c,0x0004003d,0x0000000e,
+0x000001e0,0x000001da,0x000500c5,0x0000000e,
+0x000001e1,0x000001e0,0x000001df,0x0003003e,
+0x000001da,0x000001e1,0x00050041,0x00000028,
+0x000001e2,0x000001a7,0x000000de,0x0004003d,
+0x00000006,0x000001e3,0x000001e2,0x000500c4,
+0x00000006,0x000001e4,0x000001e3,0x00000143,
+0x00050041,0x00000028,0x000001e5,0x000001a7,
+0x000000fe,0x0004003d,0x00000006,0x000001e6,
+0x000001e5,0x000500c4,0x00000006,0x000001e7,
+0x000001e6,0x00000151,0x000500c5,0x00000006,
+0x000001e8,0x000001e4,0x000001e7,0x00050041,
+0x00000028,0x000001e9,0x000001a7,0x000000f8,
+0x0004003d,0x00000006,0x000001ea,0x000001e9,
+0x000500c5,0x00000006,0x000001eb,0x000001e8,
+0x000001ea,0x00050041,0x00000028,0x000001ec,
+0x000001c6,0x000000de,0x0004003d,0x00000006,
+0x000001ed,0x000001ec,0x000500c4,0x00000006,
+0x000001ee,0x000001ed,0x00000143,0x00050041,
+0x00000028,0x000001ef,0x000001c6,0x000000fe,
+0x0004003d,0x00000006,0x000001f0,0x000001ef,
+0x000500c4,0x00000006,0x000001f1,0x000001f0,
+0x00000151,0x000500c5,0x00000006,0x000001f2,
+0x000001ee,0x000001f1,0x00050041,0x00000028,
+0x000001f3,0x000001c6,0x000000f8,0x0004003d,
+0x00000006,0x000001f4,0x000001f3,0x000500c5,
+0x00000006,0x000001f5,0x000001f2,0x000001f4,
+0x000500af,0x00000010,0x000001f6,0x000001eb,
+0x000001f5,0x000600a9,0x0000000e,0x000001f7,
+0x000001f6,0x000000fe,0x000000de,0x0004003d,
+0x0000000e,0x000001f8,0x000001da,0x000500c5,
+0x0000000e,0x000001f9,0x000001f8,0x000001f7,
+0x0003003e,0x000001da,0x000001f9,0x0004003d,
+0x0000000e,0x000001fb,0x000001da,0x0003003e,
+0x000001fc,0x0000016a,0x00050041,0x00000028,
+0x000001fd,0x000001fc,0x000001fb,0x0004003d,
+0x00000006,0x000001fe,0x000001fd,0x0003003e,
+0x000001fa,0x000001fe,0x0004003d,0x00000007,
+0x00000200,0x000001a7,0x00050051,0x00000006,
+0x00000201,0x00000200,0x00000000,0x00050051,
+0x00000006,0x00000202,0x00000200,0x00000001,
+0x00050051,0x00000006,0x00000203,0x00000200,
+0x00000002,0x00060050,0x00000007,0x00000204,
+0x00000201,0x00000202,0x00000203,0x0004003d,
+0x00000006,0x00000205,0x000001fa,0x00060050,
+0x00000007,0x00000206,0x00000205,0x00000205,
+0x00000205,0x00050080,0x00000007,0x00000207,
+0x00000204,0x00000206,0x0003003e,0x00000208,
+0x00000207,0x00050039,0x00000007,0x00000209,
+0x0000002f,0x00000208,0x00050041,0x00000008,
+0x0000020a,0x000001ff,0x0000007b,0x0003003e,
+0x0000020a,0x00000209,0x0004003d,0x00000007,
+0x0000020b,0x000001a7,0x00050051,0x00000006,
+0x0000020c,0x0000020b,0x00000000,0x00050051,
+0x00000006,0x0000020d,0x0000020b,0x00000001,
+0x00050051,0x00000006,0x0000020e,0x0000020b,
+0x00000002,0x00060050,0x00000007,0x0000020f,
+0x0000020c,0x0000020d,0x0000020e,0x0004003d,
+0x00000006,0x00000210,0x000001fa,0x00060050,
+0x00000007,0x00000211,0x00000210,0x00000210,
+0x00000210,0x00050082,0x00000007,0x00000212,
+0x0000020f,0x00000211,0x0003003e,0x00000213,
+0x00000212,0x00050039,0x00000007,0x00000214,
+0x0000002f,0x00000213,0x00050041,0x00000008,
+0x00000215,0x000001ff,0x0000007c,0x0003003e,
+0x00000215,0x00000214,0x0004003d,0x00000007,
+0x00000216,0x000001c6,0x00050051,0x00000006,
+0x00000217,0x00000216,0x00000000,0x00050051,
+0x00000006,0x00000218,0x00000216,0x00000001,
+0x00050051,0x00000006,0x00000219,0x00000216,
+0x00000002,0x00060050,0x00000007,0x0000021a,
+0x00000217,0x00000218,0x00000219,0x0004003d,
+0x00000006,0x0000021b,0x000001fa,0x00060050,
+0x00000007,0x0000021c,0x0000021b,0x0000021b,
+0x0000021b,0x00050080,0x00000007,0x0000021d,
+0x0000021a,0x0000021c,0x0003003e,0x0000021e,
+0x0000021d,0x00050039,0x00000007,0x0000021f,
+0x0000002f,0x0000021e,0x00050041,0x00000008,
+0x00000220,0x000001ff,0x0000007d,0x0003003e,
+0x00000220,0x0000021f,0x0004003d,0x00000007,
+0x00000221,0x000001c6,0x00050051,0x00000006,
+0x00000222,0x00000221,0x00000000,0x00050051,
+0x00000006,0x00000223,0x00000221,0x00000001,
+0x00050051,0x00000006,0x00000224,0x00000221,
+0x00000002,0x00060050,0x00000007,0x00000225,
+0x00000222,0x00000223,0x00000224,0x0004003d,
+0x00000006,0x00000226,0x000001fa,0x00060050,
+0x00000007,0x00000227,0x00000226,0x00000226,
+0x00000226,0x00050082,0x00000007,0x00000228,
+0x00000225,0x00000227,0x0003003e,0x00000229,
+0x00000228,0x00050039,0x00000007,0x0000022a,
+0x0000002f,0x00000229,0x00050041,0x00000008,
+0x0000022b,0x000001ff,0x0000007e,0x0003003e,
+0x0000022b,0x0000022a,0x0004003d,0x00000032,
+0x0000022d,0x000001ff,0x0003003e,0x0000022c,
+0x0000022d,0x0004003d,0x0000000e,0x0000022f,
+0x00000047,0x0003003e,0x0000022e,0x0000022f,
+0x0004003d,0x00000010,0x00000231,0x00000048,
+0x0003003e,0x00000230,0x00000231,0x0004003d,
+0x00000010,0x00000233,0x00000049,0x0003003e,
+0x00000232,0x00000233,0x00080039,0x00000037,
+0x00000234,0x0000003d,0x0000022c,0x0000022e,
+0x00000230,0x00000232,0x000200fe,0x00000234,
+0x00010038,0x00050036,0x00000037,0x00000050,
+0x00000000,0x0000004c,0x00030037,0x0000000f,
+0x0000004d,0x00030037,0x0000000f,0x0000004e,
+0x00030037,0x00000034,0x0000004f,0x000200f8,
+0x00000051,0x0004003b,0x00000008,0x00000237,
+0x00000007,0x0004003b,0x0000000f,0x0000023b,
+0x00000007,0x0004003b,0x0000000f,0x00000247,
+0x00000007,0x0004003b,0x0000000f,0x00000258,
+0x00000007,0x0004003b,0x00000008,0x0000025c,
+0x00000007,0x0004003b,0x0000000f,0x00000263,
+0x00000007,0x0004003b,0x0000000f,0x00000269,
+0x00000007,0x0004003b,0x0000000f,0x0000026f,
+0x00000007,0x0004003b,0x00000008,0x00000273,
+0x00000007,0x0004003b,0x0000000f,0x00000277,
+0x00000007,0x0004003b,0x0000000f,0x0000027d,
+0x00000007,0x0004003b,0x0000000f,0x00000281,
+0x00000007,0x0004003b,0x00000028,0x00000286,
+0x00000007,0x0004003b,0x00000028,0x0000028e,
+0x00000007,0x0004003b,0x00000028,0x00000291,
+0x00000007,0x0004003b,0x00000052,0x00000294,
+0x00000007,0x0004003b,0x00000008,0x000002ab,
+0x00000007,0x0004003d,0x0000000e,0x00000238,
+0x0000004d,0x000500c2,0x0000000e,0x0000023a,
+0x00000238,0x00000239,0x0003003e,0x0000023b,
+0x0000023a,0x00050039,0x0000000e,0x0000023c,
+0x0000001e,0x0000023b,0x0004007c,0x00000006,
+0x0000023d,0x0000023c,0x00050041,0x00000028,
+0x0000023e,0x00000237,0x000000de,0x0003003e,
+0x0000023e,0x0000023d,0x0004003d,0x0000000e,
+0x0000023f,0x0000004d,0x000500c2,0x0000000e,
+0x00000240,0x0000023f,0x00000133,0x000500c4,
+0x0000000e,0x00000241,0x00000240,0x000000bb,
+0x0004003d,0x0000000e,0x00000242,0x0000004d,
+0x000500c2,0x0000000e,0x00000244,0x00000242,
+0x00000243,0x000500c7,0x0000000e,0x00000245,
+0x00000244,0x000000ab,0x000500c5,0x0000000e,
+0x00000246,0x00000241,0x00000245,0x0003003e,
+0x00000247,0x00000246,0x00050039,0x0000000e,
+0x00000248,0x00000021,0x00000247,0x0004007c,
+0x00000006,0x00000249,0x00000248,0x00050041,
+0x00000028,0x0000024a,0x00000237,0x000000fe,
+0x0003003e,0x0000024a,0x00000249,0x0004003d,
+0x0000000e,0x0000024b,0x0000004d,0x000500c2,
+0x0000000e,0x0000024c,0x0000024b,0x00000143,
+0x000500c4,0x0000000e,0x0000024e,0x0000024c,
+0x0000024d,0x0004003d,0x0000000e,0x0000024f,
+0x0000004d,0x000500c2,0x0000000e,0x00000250,
+0x0000024f,0x00000166,0x000500c7,0x0000000e,
+0x00000251,0x00000250,0x0000012f,0x000500c4,
+0x0000000e,0x00000252,0x00000251,0x0000007e,
+0x000500c5,0x0000000e,0x00000253,0x0000024e,
+0x00000252,0x0004003d,0x0000000e,0x00000254,
+0x0000004d,0x000500c2,0x0000000e,0x00000255,
+0x00000254,0x000001ce,0x000500c7,0x0000000e,
+0x00000256,0x00000255,0x00000084,0x000500c5,
+0x0000000e,0x00000257,0x00000253,0x00000256,
+0x0003003e,0x00000258,0x00000257,0x00050039,
+0x0000000e,0x00000259,0x0000001e,0x00000258,
+0x0004007c,0x00000006,0x0000025a,0x00000259,
+0x00050041,0x00000028,0x0000025b,0x00000237,
+0x000000f8,0x0003003e,0x0000025b,0x0000025a,
+0x0004003d,0x0000000e,0x0000025d,0x0000004d,
+0x000500c2,0x0000000e,0x0000025e,0x0000025d,
+0x0000007d,0x000500c4,0x0000000e,0x0000025f,
+0x0000025e,0x0000007c,0x0004003d,0x0000000e,
+0x00000260,0x0000004d,0x000500c7,0x0000000e,
+0x00000261,0x00000260,0x000000fe,0x000500c5,
+0x0000000e,0x00000262,0x0000025f,0x00000261,
+0x0003003e,0x00000263,0x00000262,0x00050039,
+0x0000000e,0x00000264,0x0000001e,0x00000263,
+0x0004007c,0x00000006,0x00000265,0x00000264,
+0x00050041,0x00000028,0x00000266,0x0000025c,
+0x000000de,0x0003003e,0x00000266,0x00000265,
+0x0004003d,0x0000000e,0x00000267,0x0000004e,
+0x000500c2,0x0000000e,0x00000268,0x00000267,
+0x00000239,0x0003003e,0x00000269,0x00000268,
+0x00050039,0x0000000e,0x0000026a,0x00000021,
+0x00000269,0x0004007c,0x00000006,0x0000026b,
+0x0000026a,0x00050041,0x00000028,0x0000026c,
+0x0000025c,0x000000fe,0x0003003e,0x0000026c,
+0x0000026b,0x0004003d,0x0000000e,0x0000026d,
+0x0000004e,0x000500c2,0x0000000e,0x0000026e,
+0x0000026d,0x000001ba,0x0003003e,0x0000026f,
+0x0000026e,0x00050039,0x0000000e,0x00000270,
+0x0000001e,0x0000026f,0x0004007c,0x00000006,
+0x00000271,0x00000270,0x00050041,0x00000028,
+0x00000272,0x0000025c,0x000000f8,0x0003003e,
+0x00000272,0x00000271,0x0004003d,0x0000000e,
+0x00000274,0x0000004e,0x000500c2,0x0000000e,
+0x00000276,0x00000274,0x00000275,0x0003003e,
+0x00000277,0x00000276,0x00050039,0x0000000e,
+0x00000278,0x0000001e,0x00000277,0x0004007c,
+0x00000006,0x00000279,0x00000278,0x00050041,
+0x00000028,0x0000027a,0x00000273,0x000000de,
+0x0003003e,0x0000027a,0x00000279,0x0004003d,
+0x0000000e,0x0000027b,0x0000004e,0x000500c2,
+0x0000000e,0x0000027c,0x0000027b,0x000000bb,
+0x0003003e,0x0000027d,0x0000027c,0x00050039,
+0x0000000e,0x0000027e,0x00000021,0x0000027d,
+0x0004007c,0x00000006,0x0000027f,0x0000027e,
+0x00050041,0x00000028,0x00000280,0x00000273,
+0x000000fe,0x0003003e,0x00000280,0x0000027f,
+0x0004003d,0x0000000e,0x00000282,0x0000004e,
+0x0003003e,0x00000281,0x00000282,0x00050039,
+0x0000000e,0x00000283,0x0000001e,0x00000281,
+0x0004007c,0x00000006,0x00000284,0x00000283,
+0x00050041,0x00000028,0x00000285,0x00000273,
+0x000000f8,0x0003003e,0x00000285,0x00000284,
+0x0003003e,0x00000286,0x0000007b,0x000200f9,
+0x00000287,0x000200f8,0x00000287,0x000400f6,
+0x00000289,0x0000028a,0x00000000,0x000200f9,
+0x0000028b,0x000200f8,0x0000028b,0x0004003d,
+0x00000006,0x0000028c,0x00000286,0x000500b1,
+0x00000010,0x0000028d,0x0000028c,0x00000143,
+0x000400fa,0x0000028d,0x00000288,0x00000289,
+0x000200f8,0x00000288,0x0004003d,0x00000006,
+0x0000028f,0x00000286,0x000500c3,0x00000006,
+0x00000290,0x0000028f,0x0000007d,0x0003003e,
+0x0000028e,0x00000290,0x0004003d,0x00000006,
+0x00000292,0x00000286,0x000500c7,0x00000006,
+0x00000293,0x00000292,0x0000007e,0x0003003e,
+0x00000291,0x00000293,0x0004003d,0x00000006,
+0x00000295,0x00000286,0x0004003d,0x00000006,
+0x00000296,0x00000291,0x0004003d,0x00000007,
+0x00000297,0x0000025c,0x0004003d,0x00000007,
+0x00000298,0x00000237,0x00050082,0x00000007,
+0x00000299,0x00000297,0x00000298,0x00060050,
+0x00000007,0x0000029a,0x00000296,0x00000296,
+0x00000296,0x00050084,0x00000007,0x0000029b,
+0x0000029a,0x00000299,0x0004003d,0x00000006,
+0x0000029c,0x0000028e,0x0004003d,0x00000007,
+0x0000029d,0x00000273,0x0004003d,0x00000007,
+0x0000029e,0x00000237,0x00050082,0x00000007,
+0x0000029f,0x0000029d,0x0000029e,0x00060050,
+0x00000007,0x000002a0,0x0000029c,0x0000029c,
+0x0000029c,0x00050084,0x00000007,0x000002a1,
+0x000002a0,0x0000029f,0x00050080,0x00000007,
+0x000002a2,0x0000029b,0x000002a1,0x0004003d,
+0x00000007,0x000002a3,0x00000237,0x00060050,
+0x00000007,0x000002a4,0x00000099,0x00000099,
+0x00000099,0x00050084,0x00000007,0x000002a5,
+0x000002a4,0x000002a3,0x00050080,0x00000007,
+0x000002a6,0x000002a2,0x000002a5,0x00060050,
+0x00000007,0x000002a7,0x0000007d,0x0000007d,
+0x0000007d,0x00050080,0x00000007,0x000002a8,
+0x000002a6,0x000002a7,0x00060050,0x00000007,
+0x000002a9,0x0000007d,0x0000007d,0x0000007d,
+0x000500c3,0x00000007,0x000002aa,0x000002a8,
+0x000002a9,0x0003003e,0x000002ab,0x000002aa,
+0x00050039,0x00000007,0x000002ac,0x0000002f,
+0x000002ab,0x00050051,0x00000006,0x000002ad,
+0x000002ac,0x00000000,0x00050051,0x00000006,
+0x000002ae,0x000002ac,0x00000001,0x00050051,
+0x00000006,0x000002af,0x000002ac,0x00000002,
+0x00070050,0x00000035,0x000002b0,0x000002ad,
+0x000002ae,0x000002af,0x000000cf,0x00050041,
+0x00000053,0x000002b1,0x00000294,0x00000295,
+0x0003003e,0x000002b1,0x000002b0,0x0004003d,
+0x00000006,0x000002b2,0x00000286,0x00060041,
+0x00000028,0x000002b3,0x00000294,0x000002b2,
+0x0000012f,0x0003003e,0x000002b3,0x000000cf,
+0x000200f9,0x0000028a,0x000200f8,0x0000028a,
+0x0004003d,0x00000006,0x000002b4,0x00000286,
+0x00050080,0x00000006,0x000002b5,0x000002b4,
+0x0000007c,0x0003003e,0x00000286,0x000002b5,
+0x000200f9,0x00000287,0x000200f8,0x00000289,
+0x0004003d,0x00000037,0x000002b6,0x00000294,
+0x000200fe,0x000002b6,0x00010038,0x00050036,
+0x00000002,0x0000005f,0x00000000,0x00000054,
+0x00030037,0x00000052,0x00000055,0x00030037,
+0x00000028,0x00000056,0x00030037,0x00000028,
+0x00000057,0x00030037,0x00000028,0x00000058,
+0x00030037,0x00000053,0x00000059,0x00030037,
+0x0000000f,0x0000005a,0x00030037,0x00000034,
+0x0000005b,0x00030037,0x00000034,0x0000005c,
+0x00030037,0x00000034,0x0000005d,0x00030037,
+0x00000034,0x0000005e,0x000200f8,0x00000060,
+0x0004003b,0x0000000f,0x000002b9,0x00000007,
+0x0004003b,0x0000000f,0x000002ba,0x00000007,
+0x0004003b,0x00000028,0x000002c2,0x00000007,
+0x0004003b,0x0000000f,0x000002cd,0x00000007,
+0x0004003b,0x0000000f,0x000002d3,0x00000007,
+0x0004003b,0x0000000f,0x000002e4,0x00000007,
+0x0004003b,0x0000000f,0x000002e9,0x00000007,
+0x0004003b,0x0000000f,0x000002ef,0x00000007,
+0x0004003b,0x0000000f,0x000002f4,0x00000007,
+0x0004003b,0x0000000f,0x00000308,0x00000007,
+0x0004003b,0x00000028,0x0000030c,0x00000007,
+0x0004003b,0x00000028,0x00000314,0x00000007,
+0x0004003b,0x00000028,0x00000319,0x00000007,
+0x0004003b,0x00000028,0x0000031e,0x00000007,
+0x0003003e,0x000002b9,0x000000de,0x0003003e,
+0x000002ba,0x000000de,0x0004003d,0x00000010,
+0x000002bb,0x0000005b,0x000300f7,0x000002bd,
+0x00000000,0x000400fa,0x000002bb,0x000002bc,
+0x000002bd,0x000200f8,0x000002bc,0x0004003d,
+0x00000010,0x000002be,0x0000005c,0x000300f7,
+0x000002c0,0x00000000,0x000400fa,0x000002be,
+0x000002bf,0x000002c1,0x000200f8,0x000002bf,
+0x0003003e,0x000002ba,0x000000f8,0x000200f9,
+0x000002c0,0x000200f8,0x000002c1,0x0003003e,
+0x000002b9,0x000000f8,0x000200f9,0x000002c0,
+0x000200f8,0x000002c0,0x000200f9,0x000002bd,
+0x000200f8,0x000002bd,0x0003003e,0x000002c2,
+0x0000007b,0x000200f9,0x000002c3,0x000200f8,
+0x000002c3,0x000400f6,0x000002c5,0x000002c6,
+0x00000000,0x000200f9,0x000002c7,0x000200f8,
+0x000002c7,0x0004003d,0x00000006,0x000002c8,
+0x000002c2,0x000500b1,0x00000010,0x000002c9,
+0x000002c8,0x00000151,0x000400fa,0x000002c9,
+0x000002c4,0x000002c5,0x000200f8,0x000002c4,
+0x0004003d,0x00000010,0x000002ca,0x0000005c,
+0x000300f7,0x000002cc,0x00000000,0x000400fa,
+0x000002ca,0x000002cb,0x000002d9,0x000200f8,
+0x000002cb,0x0004003d,0x0000000e,0x000002ce,
+0x000002b9,0x0004003d,0x00000006,0x000002cf,
+0x000002c2,0x000500c3,0x00000006,0x000002d0,
+0x000002cf,0x0000007c,0x0004007c,0x0000000e,
+0x000002d1,0x000002d0,0x00050080,0x0000000e,
+0x000002d2,0x000002ce,0x000002d1,0x0003003e,
+0x000002cd,0x000002d2,0x0004003d,0x0000000e,
+0x000002d4,0x000002ba,0x0004003d,0x00000006,
+0x000002d5,0x000002c2,0x000500c7,0x00000006,
+0x000002d6,0x000002d5,0x0000007c,0x0004007c,
+0x0000000e,0x000002d7,0x000002d6,0x00050080,
+0x0000000e,0x000002d8,0x000002d4,0x000002d7,
+0x0003003e,0x000002d3,0x000002d8,0x000200f9,
+0x000002cc,0x000200f8,0x000002d9,0x0004003d,
+0x0000000e,0x000002da,0x000002b9,0x0004003d,
+0x00000006,0x000002db,0x000002c2,0x000500c3,
+0x00000006,0x000002dc,0x000002db,0x0000007d,
+0x0004007c,0x0000000e,0x000002dd,0x000002dc,
+0x00050080,0x0000000e,0x000002de,0x000002da,
+0x000002dd,0x0003003e,0x000002cd,0x000002de,
+0x0004003d,0x0000000e,0x000002df,0x000002ba,
+0x0004003d,0x00000006,0x000002e0,0x000002c2,
+0x000500c7,0x00000006,0x000002e1,0x000002e0,
+0x0000007e,0x0004007c,0x0000000e,0x000002e2,
+0x000002e1,0x00050080,0x0000000e,0x000002e3,
+0x000002df,0x000002e2,0x0003003e,0x000002d3,
+0x000002e3,0x000200f9,0x000002cc,0x000200f8,
+0x000002cc,0x0004003d,0x0000000e,0x000002e5,
+0x000002d3,0x0004003d,0x0000000e,0x000002e6,
+0x000002cd,0x00050084,0x0000000e,0x000002e7,
+0x000002e6,0x00000031,0x00050080,0x0000000e,
+0x000002e8,0x000002e5,0x000002e7,0x0003003e,
+0x000002e4,0x000002e8,0x0004003d,0x0000000e,
+0x000002ea,0x0000005a,0x0004003d,0x0000000e,
+0x000002eb,0x000002e4,0x00050080,0x0000000e,
+0x000002ec,0x000002eb,0x00000096,0x000500c2,
+0x0000000e,0x000002ed,0x000002ea,0x000002ec,
+0x000500c7,0x0000000e,0x000002ee,0x000002ed,
+0x000000f8,0x0003003e,0x000002e9,0x000002ee,
+0x0004003d,0x0000000e,0x000002f0,0x0000005a,
+0x0004003d,0x0000000e,0x000002f1,0x000002e4,
+0x000500c2,0x0000000e,0x000002f2,0x000002f0,
+0x000002f1,0x000500c7,0x0000000e,0x000002f3,
+0x000002f2,0x000000fe,0x0003003e,0x000002ef,
+0x000002f3,0x0004003d,0x0000000e,0x000002f5,
+0x000002cd,0x0004003d,0x0000000e,0x000002f6,
+0x000002d3,0x00050084,0x0000000e,0x000002f7,
+0x00000031,0x000002f6,0x00050080,0x0000000e,
+0x000002f8,0x000002f5,0x000002f7,0x0003003e,
+0x000002f4,0x000002f8,0x0004003d,0x00000010,
+0x000002f9,0x0000005d,0x0004003d,0x00000010,
+0x000002fa,0x0000005e,0x000400a8,0x00000010,
+0x000002fb,0x000002fa,0x000500a7,0x00000010,
+0x000002fc,0x000002f9,0x000002fb,0x0004003d,
+0x0000000e,0x000002fd,0x000002e9,0x000500ab,
+0x00000010,0x000002fe,0x000002fd,0x000000de,
+0x000500a7,0x00000010,0x000002ff,0x000002fc,
+0x000002fe,0x0004003d,0x0000000e,0x00000300,
+0x000002ef,0x000500aa,0x00000010,0x00000301,
+0x00000300,0x000000de,0x000500a7,0x00000010,
+0x00000302,0x000002ff,0x00000301,0x000300f7,
+0x00000304,0x00000000,0x000400fa,0x00000302,
+0x00000303,0x00000307,0x000200f8,0x00000303,
+0x0004003d,0x0000000e,0x00000305,0x000002f4,
+0x00050041,0x00000053,0x00000306,0x00000055,
+0x00000305,0x0003003e,0x00000306,0x00000111,
+0x000200f9,0x00000304,0x000200f8,0x00000307,
+0x0004003d,0x0000000e,0x00000309,0x000002ef,
+0x0004003d,0x0000000e,0x0000030a,0x000002e9,
+0x000500c5,0x0000000e,0x0000030b,0x00000309,
+0x0000030a,0x0003003e,0x00000308,0x0000030b,
+0x0004003d,0x0000000e,0x0000030d,0x00000308,
+0x00050041,0x00000028,0x0000030e,0x00000059,
+0x0000030d,0x0004003d,0x00000006,0x0000030f,
+0x0000030e,0x0003003e,0x0000030c,0x0000030f,
+0x0004003d,0x0000000e,0x00000310,0x000002f4,
+0x0004003d,0x00000006,0x00000311,0x00000056,
+0x0004003d,0x00000006,0x00000312,0x0000030c,
+0x00050080,0x00000006,0x00000313,0x00000311,
+0x00000312,0x0003003e,0x00000314,0x00000313,
+0x00050039,0x00000006,0x00000315,0x0000002b,
+0x00000314,0x0004003d,0x00000006,0x00000316,
+0x00000057,0x0004003d,0x00000006,0x00000317,
+0x0000030c,0x00050080,0x00000006,0x00000318,
+0x00000316,0x00000317,0x0003003e,0x00000319,
+0x00000318,0x00050039,0x00000006,0x0000031a,
+0x0000002b,0x00000319,0x0004003d,0x00000006,
+0x0000031b,0x00000058,0x0004003d,0x00000006,
+0x0000031c,0x0000030c,0x00050080,0x00000006,
+0x0000031d,0x0000031b,0x0000031c,0x0003003e,
+0x0000031e,0x0000031d,0x00050039,0x00000006,
+0x0000031f,0x0000002b,0x0000031e,0x00070050,
+0x00000035,0x00000320,0x00000315,0x0000031a,
+0x0000031f,0x000000cf,0x00050041,0x00000053,
+0x00000321,0x00000055,0x00000310,0x0003003e,
+0x00000321,0x00000320,0x000200f9,0x00000304,
+0x000200f8,0x00000304,0x000200f9,0x000002c6,
+0x000200f8,0x000002c6,0x0004003d,0x00000006,
+0x00000322,0x000002c2,0x00050080,0x00000006,
+0x00000323,0x00000322,0x0000007c,0x0003003e,
+0x000002c2,0x00000323,0x000200f9,0x000002c3,
+0x000200f8,0x000002c5,0x000100fd,0x00010038,
+0x00050036,0x00000037,0x00000064,0x00000000,
+0x0000004c,0x00030037,0x0000000f,0x00000061,
+0x00030037,0x0000000f,0x00000062,0x00030037,
+0x00000034,0x00000063,0x000200f8,0x00000065,
+0x0004003b,0x00000034,0x00000324,0x00000007,
+0x0004003b,0x0000000f,0x00000333,0x00000007,
+0x0004003b,0x0000000f,0x00000336,0x00000007,
+0x0004003b,0x0000000f,0x00000339,0x00000007,
+0x0004003b,0x0000000f,0x0000033e,0x00000007,
+0x0004003b,0x0000000f,0x00000340,0x00000007,
+0x0004003b,0x0000000f,0x00000344,0x00000007,
+0x0004003b,0x0000000f,0x00000346,0x00000007,
+0x0004003b,0x00000034,0x00000348,0x00000007,
+0x0004003b,0x00000034,0x0000034a,0x00000007,
+0x0004003b,0x0000000f,0x00000350,0x00000007,
+0x0004003b,0x0000000f,0x00000352,0x00000007,
+0x0004003b,0x0000000f,0x00000356,0x00000007,
+0x0004003b,0x0000000f,0x00000358,0x00000007,
+0x0004003b,0x00000034,0x0000035a,0x00000007,
+0x0004003b,0x00000034,0x0000035c,0x00000007,
+0x0004003b,0x0000000f,0x00000362,0x00000007,
+0x0004003b,0x0000000f,0x00000364,0x00000007,
+0x0004003b,0x0000000f,0x00000368,0x00000007,
+0x0004003b,0x0000000f,0x0000036a,0x00000007,
+0x0004003b,0x00000034,0x0000036c,0x00000007,
+0x0004003b,0x00000028,0x00000370,0x00000007,
+0x0004003b,0x0000000f,0x00000371,0x00000007,
+0x0004003b,0x00000028,0x00000375,0x00000007,
+0x0004003b,0x0000000f,0x00000378,0x00000007,
+0x0004003b,0x0000000f,0x0000037a,0x00000007,
+0x0004003b,0x00000028,0x0000037d,0x00000007,
+0x0004003b,0x0000000f,0x0000037e,0x00000007,
+0x0004003b,0x00000028,0x00000382,0x00000007,
+0x0004003b,0x0000000f,0x00000385,0x00000007,
+0x0004003b,0x0000000f,0x00000387,0x00000007,
+0x0004003b,0x00000028,0x0000038a,0x00000007,
+0x0004003b,0x0000000f,0x0000038b,0x00000007,
+0x0004003b,0x00000028,0x0000038f,0x00000007,
+0x0004003b,0x0000000f,0x00000392,0x00000007,
+0x0004003b,0x0000000f,0x00000394,0x00000007,
+0x0004003b,0x0000000f,0x0000039b,0x00000007,
+0x0004003b,0x0000000f,0x000003a0,0x00000007,
+0x0004003b,0x0000000f,0x000003a5,0x00000007,
+0x0004003b,0x0000000f,0x000003aa,0x00000007,
+0x0004003b,0x0000000f,0x000003af,0x00000007,
+0x0004003b,0x0000000f,0x000003b4,0x00000007,
+0x0004003b,0x0000000f,0x000003b7,0x00000007,
+0x0004003b,0x0000000f,0x000003bb,0x00000007,
+0x0004003b,0x00000053,0x000003c5,0x00000007,
+0x0004003b,0x000003ea,0x000003eb,0x00000007,
+0x0004003b,0x00000053,0x000003ee,0x00000007,
+0x0004003b,0x000003ea,0x000003f0,0x00000007,
+0x0004003b,0x000003ea,0x000003fe,0x00000007,
+0x0004003b,0x000003ea,0x00000402,0x00000007,
+0x0004003b,0x00000034,0x00000405,0x00000007,
+0x0004003b,0x00000052,0x00000409,0x00000007,
+0x0004003b,0x00000052,0x0000040b,0x00000007,
+0x0004003b,0x00000028,0x0000040d,0x00000007,
+0x0004003b,0x00000028,0x0000040f,0x00000007,
+0x0004003b,0x00000028,0x00000411,0x00000007,
+0x0004003b,0x00000053,0x00000413,0x00000007,
+0x0004003b,0x0000000f,0x00000415,0x00000007,
+0x0004003b,0x00000034,0x00000417,0x00000007,
+0x0004003b,0x00000034,0x00000418,0x00000007,
+0x0004003b,0x00000034,0x0000041a,0x00000007,
+0x0004003b,0x00000034,0x0000041c,0x00000007,
+0x0004003b,0x00000052,0x00000421,0x00000007,
+0x0004003b,0x00000028,0x00000423,0x00000007,
+0x0004003b,0x00000028,0x00000425,0x00000007,
+0x0004003b,0x00000028,0x00000427,0x00000007,
+0x0004003b,0x00000053,0x00000429,0x00000007,
+0x0004003b,0x0000000f,0x0000042b,0x00000007,
+0x0004003b,0x00000034,0x0000042d,0x00000007,
+0x0004003b,0x00000034,0x0000042e,0x00000007,
+0x0004003b,0x00000034,0x00000430,0x00000007,
+0x0004003b,0x00000034,0x00000432,0x00000007,
+0x0004003d,0x0000000e,0x00000325,0x00000061,
+0x000500c2,0x0000000e,0x00000326,0x00000325,
+0x0000007c,0x000500c7,0x0000000e,0x00000327,
+0x00000326,0x000000fe,0x000500ab,0x00000010,
+0x00000328,0x00000327,0x000000de,0x0003003e,
+0x00000324,0x00000328,0x0004003d,0x00000010,
+0x00000329,0x00000063,0x000400a8,0x00000010,
+0x0000032a,0x00000329,0x000300f7,0x0000032c,
+0x00000000,0x000400fa,0x0000032a,0x0000032b,
+0x0000032c,0x000200f8,0x0000032b,0x0004003d,
+0x0000000e,0x0000032d,0x00000061,0x000500c7,
+0x0000000e,0x0000032e,0x0000032d,0x000000f8,
+0x000500ab,0x00000010,0x0000032f,0x0000032e,
+0x000000de,0x000200f9,0x0000032c,0x000200f8,
+0x0000032c,0x000700f5,0x00000010,0x00000330,
+0x00000329,0x00000065,0x0000032f,0x0000032b,
+0x000300f7,0x00000332,0x00000000,0x000400fa,
+0x00000330,0x00000331,0x00000397,0x000200f8,
+0x00000331,0x0004003d,0x0000000e,0x00000334,
+0x00000061,0x000500c2,0x0000000e,0x00000335,
+0x00000334,0x0000012d,0x0003003e,0x00000333,
+0x00000335,0x0004003d,0x0000000e,0x00000337,
+0x00000061,0x000500c2,0x0000000e,0x00000338,
+0x00000337,0x000001ba,0x0003003e,0x00000336,
+0x00000338,0x0004003d,0x0000000e,0x0000033a,
+0x00000061,0x000500c2,0x0000000e,0x0000033b,
+0x0000033a,0x00000166,0x0003003e,0x00000339,
+0x0000033b,0x0004003d,0x0000000e,0x0000033c,
+0x00000061,0x000500c2,0x0000000e,0x0000033d,
+0x0000033c,0x00000133,0x0004003d,0x0000000e,
+0x0000033f,0x00000333,0x0003003e,0x0000033e,
+0x0000033f,0x0003003e,0x00000340,0x0000033d,
+0x00060039,0x00000010,0x00000341,0x00000014,
+0x0000033e,0x00000340,0x000300f7,0x00000343,
+0x00000000,0x000400fa,0x00000341,0x00000342,
+0x00000343,0x000200f8,0x00000342,0x0004003d,
+0x0000000e,0x00000345,0x00000061,0x0003003e,
+0x00000344,0x00000345,0x0004003d,0x0000000e,
+0x00000347,0x00000062,0x0003003e,0x00000346,
+0x00000347,0x0004003d,0x00000010,0x00000349,
+0x00000063,0x0003003e,0x00000348,0x00000349,
+0x0004003d,0x00000010,0x0000034b,0x00000324,
+0x0003003e,0x0000034a,0x0000034b,0x00080039,
+0x00000037,0x0000034c,0x00000044,0x00000344,
+0x00000346,0x00000348,0x0000034a,0x000200fe,
+0x0000034c,0x000200f8,0x00000343,0x0004003d,
+0x0000000e,0x0000034e,0x00000061,0x000500c2,
+0x0000000e,0x0000034f,0x0000034e,0x00000143,
+0x0004003d,0x0000000e,0x00000351,0x00000336,
+0x0003003e,0x00000350,0x00000351,0x0003003e,
+0x00000352,0x0000034f,0x00060039,0x00000010,
+0x00000353,0x00000014,0x00000350,0x00000352,
+0x000300f7,0x00000355,0x00000000,0x000400fa,
+0x00000353,0x00000354,0x00000355,0x000200f8,
+0x00000354,0x0004003d,0x0000000e,0x00000357,
+0x00000061,0x0003003e,0x00000356,0x00000357,
+0x0004003d,0x0000000e,0x00000359,0x00000062,
+0x0003003e,0x00000358,0x00000359,0x0004003d,
+0x00000010,0x0000035b,0x00000063,0x0003003e,
+0x0000035a,0x0000035b,0x0004003d,0x00000010,
+0x0000035d,0x00000324,0x0003003e,0x0000035c,
+0x0000035d,0x00080039,0x00000037,0x0000035e,
+0x0000004a,0x00000356,0x00000358,0x0000035a,
+0x0000035c,0x000200fe,0x0000035e,0x000200f8,
+0x00000355,0x0004003d,0x0000000e,0x00000360,
+0x00000061,0x000500c2,0x0000000e,0x00000361,
+0x00000360,0x00000151,0x0004003d,0x0000000e,
+0x00000363,0x00000339,0x0003003e,0x00000362,
+0x00000363,0x0003003e,0x00000364,0x00000361,
+0x00060039,0x00000010,0x00000365,0x00000014,
+0x00000362,0x00000364,0x000300f7,0x00000367,
+0x00000000,0x000400fa,0x00000365,0x00000366,
+0x00000367,0x000200f8,0x00000366,0x0004003d,
+0x0000000e,0x00000369,0x00000061,0x0003003e,
+0x00000368,0x00000369,0x0004003d,0x0000000e,
+0x0000036b,0x00000062,0x0003003e,0x0000036a,
+0x0000036b,0x0004003d,0x00000010,0x0000036d,
+0x00000063,0x0003003e,0x0000036c,0x0000036d,
+0x00070039,0x00000037,0x0000036e,0x00000050,
+0x00000368,0x0000036a,0x0000036c,0x000200fe,
+0x0000036e,0x000200f8,0x00000367,0x0004003d,
+0x0000000e,0x00000372,0x00000333,0x0003003e,
+0x00000371,0x00000372,0x00050039,0x0000000e,
+0x00000373,0x0000001b,0x00000371,0x0004007c,
+0x00000006,0x00000374,0x00000373,0x0003003e,
+0x00000370,0x00000374,0x0004003d,0x0000000e,
+0x00000376,0x00000061,0x000500c2,0x0000000e,
+0x00000377,0x00000376,0x00000133,0x0004003d,
+0x0000000e,0x00000379,0x00000333,0x0003003e,
+0x00000378,0x00000379,0x0003003e,0x0000037a,
+0x00000377,0x00060039,0x0000000e,0x0000037b,
+0x00000026,0x00000378,0x0000037a,0x0004007c,
+0x00000006,0x0000037c,0x0000037b,0x0003003e,
+0x00000375,0x0000037c,0x0004003d,0x0000000e,
+0x0000037f,0x00000336,0x0003003e,0x0000037e,
+0x0000037f,0x00050039,0x0000000e,0x00000380,
+0x0000001b,0x0000037e,0x0004007c,0x00000006,
+0x00000381,0x00000380,0x0003003e,0x0000037d,
+0x00000381,0x0004003d,0x0000000e,0x00000383,
+0x00000061,0x000500c2,0x0000000e,0x00000384,
+0x00000383,0x00000143,0x0004003d,0x0000000e,
+0x00000386,0x00000336,0x0003003e,0x00000385,
+0x00000386,0x0003003e,0x00000387,0x00000384,
+0x00060039,0x0000000e,0x00000388,0x00000026,
+0x00000385,0x00000387,0x0004007c,0x00000006,
+0x00000389,0x00000388,0x0003003e,0x00000382,
+0x00000389,0x0004003d,0x0000000e,0x0000038c,
+0x00000339,0x0003003e,0x0000038b,0x0000038c,
+0x00050039,0x0000000e,0x0000038d,0x0000001b,
+0x0000038b,0x0004007c,0x00000006,0x0000038e,
+0x0000038d,0x0003003e,0x0000038a,0x0000038e,
+0x0004003d,0x0000000e,0x00000390,0x00000061,
+0x000500c2,0x0000000e,0x00000391,0x00000390,
+0x00000151,0x0004003d,0x0000000e,0x00000393,
+0x00000339,0x0003003e,0x00000392,0x00000393,
+0x0003003e,0x00000394,0x00000391,0x00060039,
+0x0000000e,0x00000395,0x00000026,0x00000392,
+0x00000394,0x0004007c,0x00000006,0x00000396,
+0x00000395,0x0003003e,0x0000038f,0x00000396,
+0x000200f9,0x00000332,0x000200f8,0x00000397,
+0x0004003d,0x0000000e,0x00000398,0x00000061,
+0x000500c2,0x0000000e,0x0000039a,0x00000398,
+0x00000399,0x0003003e,0x0000039b,0x0000039a,
+0x00050039,0x0000000e,0x0000039c,0x00000018,
+0x0000039b,0x0004007c,0x00000006,0x0000039d,
+0x0000039c,0x0003003e,0x00000370,0x0000039d,
+0x0004003d,0x0000000e,0x0000039e,0x00000061,
+0x000500c2,0x0000000e,0x0000039f,0x0000039e,
+0x00000133,0x0003003e,0x000003a0,0x0000039f,
+0x00050039,0x0000000e,0x000003a1,0x00000018,
+0x000003a0,0x0004007c,0x00000006,0x000003a2,
+0x000003a1,0x0003003e,0x00000375,0x000003a2,
+0x0004003d,0x0000000e,0x000003a3,0x00000061,
+0x000500c2,0x0000000e,0x000003a4,0x000003a3,
+0x0000013c,0x0003003e,0x000003a5,0x000003a4,
+0x00050039,0x0000000e,0x000003a6,0x00000018,
+0x000003a5,0x0004007c,0x00000006,0x000003a7,
+0x000003a6,0x0003003e,0x0000037d,0x000003a7,
+0x0004003d,0x0000000e,0x000003a8,0x00000061,
+0x000500c2,0x0000000e,0x000003a9,0x000003a8,
+0x00000143,0x0003003e,0x000003aa,0x000003a9,
+0x00050039,0x0000000e,0x000003ab,0x00000018,
+0x000003aa,0x0004007c,0x00000006,0x000003ac,
+0x000003ab,0x0003003e,0x00000382,0x000003ac,
+0x0004003d,0x0000000e,0x000003ad,0x00000061,
+0x000500c2,0x0000000e,0x000003ae,0x000003ad,
+0x0000014a,0x0003003e,0x000003af,0x000003ae,
+0x00050039,0x0000000e,0x000003b0,0x00000018,
+0x000003af,0x0004007c,0x00000006,0x000003b1,
+0x000003b0,0x0003003e,0x0000038a,0x000003b1,
+0x0004003d,0x0000000e,0x000003b2,0x00000061,
+0x000500c2,0x0000000e,0x000003b3,0x000003b2,
+0x00000151,0x0003003e,0x000003b4,0x000003b3,
+0x00050039,0x0000000e,0x000003b5,0x00000018,
+0x000003b4,0x0004007c,0x00000006,0x000003b6,
+0x000003b5,0x0003003e,0x0000038f,0x000003b6,
+0x000200f9,0x00000332,0x000200f8,0x00000332,
+0x0004003d,0x0000000e,0x000003b8,0x00000061,
+0x000500c2,0x0000000e,0x000003b9,0x000003b8,
+0x0000024d,0x000500c7,0x0000000e,0x000003ba,
+0x00000084,0x000003b9,0x0003003e,0x000003b7,
+0x000003ba,0x0004003d,0x0000000e,0x000003bc,
+0x00000061,0x000500c2,0x0000000e,0x000003bd,
+0x000003bc,0x0000007d,0x000500c7,0x0000000e,
+0x000003be,0x00000084,0x000003bd,0x0003003e,
+0x000003bb,0x000003be,0x0004003d,0x00000010,
+0x000003bf,0x00000324,0x0004003d,0x00000010,
+0x000003c0,0x00000063,0x000400a8,0x00000010,
+0x000003c1,0x000003c0,0x000500a6,0x00000010,
+0x000003c2,0x000003bf,0x000003c1,0x000300f7,
+0x000003c4,0x00000000,0x000400fa,0x000003c2,
+0x000003c3,0x000003f3,0x000200f8,0x000003c3,
+0x0004003d,0x0000000e,0x000003e9,0x000003b7,
+0x0003003e,0x000003eb,0x000003e8,0x00050041,
+0x00000053,0x000003ec,0x000003eb,0x000003e9,
+0x0004003d,0x00000035,0x000003ed,0x000003ec,
+0x0003003e,0x000003c5,0x000003ed,0x0004003d,
+0x0000000e,0x000003ef,0x000003bb,0x0003003e,
+0x000003f0,0x000003e8,0x00050041,0x00000053,
+0x000003f1,0x000003f0,0x000003ef,0x0004003d,
+0x00000035,0x000003f2,0x000003f1,0x0003003e,
+0x000003ee,0x000003f2,0x000200f9,0x000003c4,
+0x000200f8,0x000003f3,0x0004003d,0x0000000e,
+0x000003fd,0x000003b7,0x0003003e,0x000003fe,
+0x000003fc,0x00050041,0x00000053,0x000003ff,
+0x000003fe,0x000003fd,0x0004003d,0x00000035,
+0x00000400,0x000003ff,0x0003003e,0x000003c5,
+0x00000400,0x0004003d,0x0000000e,0x00000401,
+0x000003bb,0x0003003e,0x00000402,0x000003fc,
+0x00050041,0x00000053,0x00000403,0x00000402,
+0x00000401,0x0004003d,0x00000035,0x00000404,
+0x00000403,0x0003003e,0x000003ee,0x00000404,
+0x000200f9,0x000003c4,0x000200f8,0x000003c4,
+0x0004003d,0x0000000e,0x00000406,0x00000061,
+0x000500c7,0x0000000e,0x00000407,0x00000406,
+0x000000fe,0x000500ab,0x00000010,0x00000408,
+0x00000407,0x000000de,0x0003003e,0x00000405,
+0x00000408,0x0004003d,0x00000037,0x0000040c,
+0x00000409,0x0003003e,0x0000040b,0x0000040c,
+0x0004003d,0x00000006,0x0000040e,0x00000370,
+0x0003003e,0x0000040d,0x0000040e,0x0004003d,
+0x00000006,0x00000410,0x0000037d,0x0003003e,
+0x0000040f,0x00000410,0x0004003d,0x00000006,
+0x00000412,0x0000038a,0x0003003e,0x00000411,
+0x00000412,0x0004003d,0x00000035,0x00000414,
+0x000003c5,0x0003003e,0x00000413,0x00000414,
+0x0004003d,0x0000000e,0x00000416,0x00000062,
+0x0003003e,0x00000415,0x00000416,0x0003003e,
+0x00000417,0x0000040a,0x0004003d,0x00000010,
+0x00000419,0x00000405,0x0003003e,0x00000418,
+0x00000419,0x0004003d,0x00000010,0x0000041b,
+0x00000063,0x0003003e,0x0000041a,0x0000041b,
+0x0004003d,0x00000010,0x0000041d,0x00000324,
+0x0003003e,0x0000041c,0x0000041d,0x000e0039,
+0x00000002,0x0000041e,0x0000005f,0x0000040b,
+0x0000040d,0x0000040f,0x00000411,0x00000413,
+0x00000415,0x00000417,0x00000418,0x0000041a,
+0x0000041c,0x0004003d,0x00000037,0x0000041f,
+0x0000040b,0x0003003e,0x00000409,0x0000041f,
+0x0004003d,0x00000037,0x00000422,0x00000409,
+0x0003003e,0x00000421,0x00000422,0x0004003d,
+0x00000006,0x00000424,0x00000375,0x0003003e,
+0x00000423,0x00000424,0x0004003d,0x00000006,
+0x00000426,0x00000382,0x0003003e,0x00000425,
+0x00000426,0x0004003d,0x00000006,0x00000428,
+0x0000038f,0x0003003e,0x00000427,0x00000428,
+0x0004003d,0x00000035,0x0000042a,0x000003ee,
+0x0003003e,0x00000429,0x0000042a,0x0004003d,
+0x0000000e,0x0000042c,0x00000062,0x0003003e,
+0x0000042b,0x0000042c,0x0003003e,0x0000042d,
+0x00000420,0x0004003d,0x00000010,0x0000042f,
+0x00000405,0x0003003e,0x0000042e,0x0000042f,
+0x0004003d,0x00000010,0x00000431,0x00000063,
+0x0003003e,0x00000430,0x00000431,0x0004003d,
+0x00000010,0x00000433,0x00000324,0x0003003e,
+0x00000432,0x00000433,0x000e0039,0x00000002,
+0x00000434,0x0000005f,0x00000421,0x00000423,
+0x00000425,0x00000427,0x00000429,0x0000042b,
+0x0000042d,0x0000042e,0x00000430,0x00000432,
+0x0004003d,0x00000037,0x00000435,0x00000421,
+0x0003003e,0x00000409,0x00000435,0x0004003d,
+0x00000037,0x00000436,0x00000409,0x000200fe,
+0x00000436,0x00010038,0x00050036,0x00000066,
+0x0000006b,0x00000000,0x00000067,0x00030037,
+0x0000000f,0x00000068,0x00030037,0x0000000f,
+0x00000069,0x00030037,0x00000034,0x0000006a,
+0x000200f8,0x0000006c,0x0004003b,0x00000028,
+0x00000439,0x00000007,0x0004003b,0x00000028,
+0x0000043f,0x00000007,0x0004003b,0x0000000f,
+0x00000445,0x00000007,0x0004003b,0x00000053,
+0x00000449,0x00000007,0x0004003b,0x00000477,
+0x00000478,0x00000007,0x0004003b,0x00000053,
+0x0000047b,0x00000007,0x0004003b,0x00000477,
+0x0000047f,0x00000007,0x0004003b,0x00000482,
+0x00000483,0x00000007,0x0004003b,0x0000000f,
+0x000004a9,0x00000007,0x0004003b,0x0000000f,
+0x000004b1,0x00000007,0x0004003b,0x0000000f,
+0x000004b8,0x00000007,0x0004003b,0x00000028,
+0x000004bd,0x00000007,0x0004003b,0x00000028,
+0x000004c0,0x00000007,0x0004003b,0x00000028,
+0x000004cc,0x00000007,0x0004003b,0x00000482,
+0x000004d2,0x00000007,0x0004003b,0x00000028,
+0x000004d4,0x00000007,0x0004003d,0x0000000e,
+0x0000043a,0x00000068,0x000500c2,0x0000000e,
+0x0000043b,0x0000043a,0x00000133,0x0004007c,
+0x00000006,0x0000043c,0x0000043b,0x0003003e,
+0x00000439,0x0000043c,0x0004003d,0x00000006,
+0x0000043d,0x00000439,0x000500c7,0x00000006,
+0x0000043e,0x0000043d,0x000000cf,0x0003003e,
+0x00000439,0x0000043e,0x0004003d,0x0000000e,
+0x00000440,0x00000068,0x000500c2,0x0000000e,
+0x00000441,0x00000440,0x0000013c,0x0004007c,
+0x00000006,0x00000442,0x00000441,0x0003003e,
+0x0000043f,0x00000442,0x0004003d,0x00000006,
+0x00000443,0x0000043f,0x000500c7,0x00000006,
+0x00000444,0x00000443,0x000001be,0x0003003e,
+0x0000043f,0x00000444,0x0004003d,0x0000000e,
+0x00000446,0x00000068,0x000500c2,0x0000000e,
+0x00000447,0x00000446,0x00000143,0x000500c7,
+0x0000000e,0x00000448,0x00000447,0x00000096,
+0x0003003e,0x00000445,0x00000448,0x0004003d,
+0x0000000e,0x00000475,0x00000445,0x00050084,
+0x0000000e,0x00000476,0x00000475,0x000000f8,
+0x0003003e,0x00000478,0x00000474,0x00050041,
+0x00000053,0x00000479,0x00000478,0x00000476,
+0x0004003d,0x00000035,0x0000047a,0x00000479,
+0x0003003e,0x00000449,0x0000047a,0x0004003d,
+0x0000000e,0x0000047c,0x00000445,0x00050084,
+0x0000000e,0x0000047d,0x0000047c,0x000000f8,
+0x00050080,0x0000000e,0x0000047e,0x0000047d,
+0x000000fe,0x0003003e,0x0000047f,0x00000474,
+0x00050041,0x00000053,0x00000480,0x0000047f,
+0x0000047e,0x0004003d,0x00000035,0x00000481,
+0x00000480,0x0003003e,0x0000047b,0x00000481,
+0x0004003d,0x0000000e,0x00000484,0x00000068,
+0x000500c2,0x0000000e,0x00000485,0x00000484,
+0x00000275,0x0004003d,0x0000000e,0x00000486,
+0x00000068,0x000500c2,0x0000000e,0x00000487,
+0x00000486,0x0000045e,0x0004003d,0x0000000e,
+0x00000488,0x00000068,0x000500c2,0x0000000e,
+0x00000489,0x00000488,0x000001ce,0x0004003d,
+0x0000000e,0x0000048a,0x00000068,0x000500c2,
+0x0000000e,0x0000048b,0x0000048a,0x00000099,
+0x0004003d,0x0000000e,0x0000048c,0x00000068,
+0x000500c2,0x0000000e,0x0000048d,0x0000048c,
+0x0000007c,0x0004003d,0x0000000e,0x0000048e,
+0x00000068,0x000500c4,0x0000000e,0x0000048f,
+0x0000048e,0x0000007d,0x0004003d,0x0000000e,
+0x00000490,0x00000069,0x000500c2,0x0000000e,
+0x00000492,0x00000490,0x00000491,0x000500c5,
+0x0000000e,0x00000493,0x0000048f,0x00000492,
+0x0004003d,0x0000000e,0x00000494,0x00000069,
+0x000500c2,0x0000000e,0x00000495,0x00000494,
+0x0000012d,0x0004003d,0x0000000e,0x00000496,
+0x00000069,0x000500c2,0x0000000e,0x00000497,
+0x00000496,0x00000133,0x0004003d,0x0000000e,
+0x00000498,0x00000069,0x000500c2,0x0000000e,
+0x0000049a,0x00000498,0x00000499,0x0004003d,
+0x0000000e,0x0000049b,0x00000069,0x000500c2,
+0x0000000e,0x0000049c,0x0000049b,0x000003d5,
+0x0004003d,0x0000000e,0x0000049d,0x00000069,
+0x000500c2,0x0000000e,0x0000049e,0x0000049d,
+0x000001be,0x0004003d,0x0000000e,0x0000049f,
+0x00000069,0x000500c2,0x0000000e,0x000004a0,
+0x0000049f,0x0000014a,0x0004003d,0x0000000e,
+0x000004a1,0x00000069,0x000500c2,0x0000000e,
+0x000004a2,0x000004a1,0x000003cc,0x0004003d,
+0x0000000e,0x000004a3,0x00000069,0x000500c2,
+0x0000000e,0x000004a4,0x000004a3,0x000000bb,
+0x0004003d,0x0000000e,0x000004a5,0x00000069,
+0x000500c2,0x0000000e,0x000004a6,0x000004a5,
+0x0000007e,0x0004003d,0x0000000e,0x000004a7,
+0x00000069,0x00130050,0x00000066,0x000004a8,
+0x00000485,0x00000487,0x00000489,0x0000048b,
+0x0000048d,0x00000493,0x00000495,0x00000497,
+0x0000049a,0x0000049c,0x0000049e,0x000004a0,
+0x000004a2,0x000004a4,0x000004a6,0x000004a7,
+0x0003003e,0x00000483,0x000004a8,0x0003003e,
+0x000004a9,0x000000de,0x000200f9,0x000004aa,
+0x000200f8,0x000004aa,0x000400f6,0x000004ac,
+0x000004ad,0x00000000,0x000200f9,0x000004ae,
+0x000200f8,0x000004ae,0x0004003d,0x0000000e,
+0x000004af,0x000004a9,0x000500b0,0x00000010,
+0x000004b0,0x000004af,0x00000036,0x000400fa,
+0x000004b0,0x000004ab,0x000004ac,0x000200f8,
+0x000004ab,0x0004003d,0x0000000e,0x000004b2,
+0x000004a9,0x00050089,0x0000000e,0x000004b3,
+0x000004b2,0x00000031,0x00050084,0x0000000e,
+0x000004b4,0x000004b3,0x00000031,0x0004003d,
+0x0000000e,0x000004b5,0x000004a9,0x00050086,
+0x0000000e,0x000004b6,0x000004b5,0x00000031,
+0x00050080,0x0000000e,0x000004b7,0x000004b4,
+0x000004b6,0x0003003e,0x000004b1,0x000004b7,
+0x0004003d,0x0000000e,0x000004b9,0x000004a9,
+0x00050041,0x0000000f,0x000004ba,0x00000483,
+0x000004b9,0x0004003d,0x0000000e,0x000004bb,
+0x000004ba,0x000500c7,0x0000000e,0x000004bc,
+0x000004bb,0x00000084,0x0003003e,0x000004b8,
+0x000004bc,0x0004003d,0x0000000e,0x000004be,
+0x000004b8,0x000500ae,0x00000010,0x000004bf,
+0x000004be,0x00000031,0x000300f7,0x000004c2,
+0x00000000,0x000400fa,0x000004bf,0x000004c1,
+0x000004c7,0x000200f8,0x000004c1,0x0004003d,
+0x0000000e,0x000004c3,0x000004b8,0x00050082,
+0x0000000e,0x000004c4,0x000004c3,0x00000031,
+0x00050041,0x00000028,0x000004c5,0x0000047b,
+0x000004c4,0x0004003d,0x00000006,0x000004c6,
+0x000004c5,0x0003003e,0x000004c0,0x000004c6,
+0x000200f9,0x000004c2,0x000200f8,0x000004c7,
+0x0004003d,0x0000000e,0x000004c8,0x000004b8,
+0x00050041,0x00000028,0x000004c9,0x00000449,
+0x000004c8,0x0004003d,0x00000006,0x000004ca,
+0x000004c9,0x0003003e,0x000004c0,0x000004ca,
+0x000200f9,0x000004c2,0x000200f8,0x000004c2,
+0x0004003d,0x00000006,0x000004cb,0x000004c0,
+0x0003003e,0x000004bd,0x000004cb,0x0004003d,
+0x00000006,0x000004cd,0x00000439,0x0004003d,
+0x00000006,0x000004ce,0x000004bd,0x0004003d,
+0x00000006,0x000004cf,0x0000043f,0x00050084,
+0x00000006,0x000004d0,0x000004ce,0x000004cf,
+0x00050080,0x00000006,0x000004d1,0x000004cd,
+0x000004d0,0x0003003e,0x000004cc,0x000004d1,
+0x0004003d,0x0000000e,0x000004d3,0x000004b1,
+0x0004003d,0x00000006,0x000004d5,0x000004cc,
+0x0003003e,0x000004d4,0x000004d5,0x00050039,
+0x00000006,0x000004d6,0x0000002b,0x000004d4,
+0x0004007c,0x0000000e,0x000004d7,0x000004d6,
+0x00050041,0x0000000f,0x000004d8,0x000004d2,
+0x000004d3,0x0003003e,0x000004d8,0x000004d7,
+0x000200f9,0x000004ad,0x000200f8,0x000004ad,
+0x0004003d,0x0000000e,0x000004d9,0x000004a9,
+0x00050080,0x0000000e,0x000004da,0x000004d9,
+0x0000007c,0x0003003e,0x000004a9,0x000004da,
+0x000200f9,0x000004aa,0x000200f8,0x000004ac,
+0x0004003d,0x00000066,0x000004db,0x000004d2,
+0x000200fe,0x000004db,0x00010038,0x00050036,
+0x0000000e,0x0000006e,0x00000000,0x00000016,
+0x00030037,0x0000000f,0x0000006d,0x000200f8,
+0x0000006f,0x0004003d,0x0000000e,0x000004de,
+0x0000006d,0x000500c7,0x0000000e,0x000004e0,
+0x000004de,0x000004df,0x000500c4,0x0000000e,
+0x000004e1,0x000004e0,0x00000133,0x0004003d,
+0x0000000e,0x000004e2,0x0000006d,0x000500c7,
+0x0000000e,0x000004e4,0x000004e2,0x000004e3,
+0x000500c4,0x0000000e,0x000004e5,0x000004e4,
+0x00000151,0x000500c5,0x0000000e,0x000004e6,
+0x000004e1,0x000004e5,0x0004003d,0x0000000e,
+0x000004e7,0x0000006d,0x000500c7,0x0000000e,
+0x000004e9,0x000004e7,0x000004e8,0x000500c2,
+0x0000000e,0x000004ea,0x000004e9,0x00000151,
+0x000500c5,0x0000000e,0x000004eb,0x000004e6,
+0x000004ea,0x0004003d,0x0000000e,0x000004ec,
+0x0000006d,0x000500c7,0x0000000e,0x000004ee,
+0x000004ec,0x000004ed,0x000500c2,0x0000000e,
+0x000004ef,0x000004ee,0x00000133,0x000500c5,
+0x0000000e,0x000004f0,0x000004eb,0x000004ef,
+0x000200fe,0x000004f0,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_2D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_2D.inl
new file mode 100644
index 00000000000..54e12b8c73d
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_2D.inl
@@ -0,0 +1,2070 @@
+0x07230203,0x00010300,0x000d000b,0x00000575,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x000004f3,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00070005,0x0000000b,0x50746567,
+0x4432736f,0x61727241,0x69762879,0x00003b33,
+0x00030005,0x0000000a,0x00736f70,0x00070005,
+0x00000013,0x764f7369,0x6c667265,0x6465776f,
+0x3b317528,0x003b3175,0x00040005,0x00000011,
+0x65736162,0x00000000,0x00040005,0x00000012,
+0x66666964,0x00000000,0x00060005,0x00000017,
+0x766e6f63,0x34747265,0x28386f54,0x003b3175,
+0x00030005,0x00000016,0x00000062,0x00060005,
+0x0000001a,0x766e6f63,0x35747265,0x28386f54,
+0x003b3175,0x00030005,0x00000019,0x00000062,
+0x00060005,0x0000001d,0x766e6f63,0x36747265,
+0x28386f54,0x003b3175,0x00030005,0x0000001c,
+0x00000062,0x00060005,0x00000020,0x766e6f63,
+0x37747265,0x28386f54,0x003b3175,0x00030005,
+0x0000001f,0x00000062,0x00070005,0x00000025,
+0x766e6f63,0x44747265,0x28666669,0x753b3175,
+0x00003b31,0x00040005,0x00000023,0x65736162,
+0x00000000,0x00040005,0x00000024,0x66666964,
+0x00000000,0x00050005,0x0000002a,0x616c635f,
+0x6928706d,0x00003b31,0x00030005,0x00000029,
+0x00000078,0x00050005,0x0000002d,0x616c635f,
+0x7628706d,0x003b3369,0x00030005,0x0000002c,
+0x00000078,0x000a0005,0x0000003b,0x32637465,
+0x485f545f,0x646e695f,0x76287865,0x345b3369,
+0x31753b5d,0x3b31623b,0x003b3162,0x00050005,
+0x00000037,0x54726c63,0x656c6261,0x00000000,
+0x00030005,0x00000038,0x00776f6c,0x00070005,
+0x00000039,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00040005,0x0000003a,
+0x7161706f,0x00006575,0x000b0005,0x00000042,
+0x32637465,0x6365645f,0x5f65646f,0x636f6c62,
+0x28545f6b,0x753b3175,0x31623b31,0x3b31623b,
+0x00000000,0x00040005,0x0000003e,0x68676968,
+0x00000000,0x00030005,0x0000003f,0x00776f6c,
+0x00070005,0x00000040,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00040005,
+0x00000041,0x7161706f,0x00006575,0x000b0005,
+0x00000048,0x32637465,0x6365645f,0x5f65646f,
+0x636f6c62,0x28485f6b,0x753b3175,0x31623b31,
+0x3b31623b,0x00000000,0x00040005,0x00000044,
+0x68676968,0x00000000,0x00030005,0x00000045,
+0x00776f6c,0x00070005,0x00000046,0x75507369,
+0x7468636e,0x756f7268,0x6c416867,0x00616870,
+0x00040005,0x00000047,0x7161706f,0x00006575,
+0x000a0005,0x0000004e,0x32637465,0x6365645f,
+0x5f65646f,0x636f6c62,0x28505f6b,0x753b3175,
+0x31623b31,0x0000003b,0x00040005,0x0000004b,
+0x68676968,0x00000000,0x00030005,0x0000004c,
+0x00776f6c,0x00070005,0x0000004d,0x75507369,
+0x7468636e,0x756f7268,0x6c416867,0x00616870,
+0x00100005,0x0000005d,0x6f636564,0x735f6564,
+0x6c626275,0x286b636f,0x5b346976,0x3b5d3631,
+0x693b3169,0x31693b31,0x3469763b,0x3b31753b,
+0x623b3162,0x31623b31,0x3b31623b,0x00000000,
+0x00040005,0x00000053,0x74754f70,0x00000000,
+0x00030005,0x00000054,0x00000072,0x00030005,
+0x00000055,0x00000067,0x00030005,0x00000056,
+0x00000062,0x00040005,0x00000057,0x6c626174,
+0x00000065,0x00030005,0x00000058,0x00776f6c,
+0x00040005,0x00000059,0x6f636573,0x0000646e,
+0x00040005,0x0000005a,0x70696c66,0x00646570,
+0x00070005,0x0000005b,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00040005,
+0x0000005c,0x7161706f,0x00006575,0x000a0005,
+0x00000062,0x32637465,0x6365645f,0x5f65646f,
+0x5f626772,0x636f6c62,0x3175286b,0x3b31753b,
+0x003b3162,0x00040005,0x0000005f,0x68676968,
+0x00000000,0x00030005,0x00000060,0x00776f6c,
+0x00070005,0x00000061,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x000d0005,
+0x00000069,0x5f636165,0x6f636564,0x735f6564,
+0x6c676e69,0x68635f65,0x656e6e61,0x6c625f6c,
+0x286b636f,0x753b3175,0x31623b31,0x0000003b,
+0x00040005,0x00000066,0x68676968,0x00000000,
+0x00030005,0x00000067,0x00776f6c,0x00050005,
+0x00000068,0x69537369,0x64656e67,0x00000000,
+0x00050005,0x0000006c,0x70696c66,0x75283233,
+0x00003b31,0x00030005,0x0000006b,0x00000061,
+0x00030005,0x00000071,0x006c6176,0x00050005,
+0x00000085,0x65646e69,0x6c626178,0x00000065,
+0x00030005,0x00000091,0x00000063,0x00030005,
+0x0000009c,0x00000063,0x00030005,0x000000a6,
+0x00000063,0x00030005,0x000000b1,0x00000063,
+0x00050005,0x000000c2,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x000000c7,0x61726170,
+0x0000006d,0x00030005,0x000000da,0x00000079,
+0x00030005,0x000000e3,0x00000078,0x00030005,
+0x000000eb,0x0000006b,0x00030005,0x000000f0,
+0x0062736d,0x00030005,0x000000f7,0x0062736c,
+0x00030005,0x00000109,0x00746572,0x00040005,
+0x00000111,0x7366666f,0x00007465,0x00030005,
+0x00000128,0x00003172,0x00040005,0x00000134,
+0x61726170,0x0000006d,0x00030005,0x00000137,
+0x00003167,0x00040005,0x0000013b,0x61726170,
+0x0000006d,0x00030005,0x0000013e,0x00003162,
+0x00040005,0x00000142,0x61726170,0x0000006d,
+0x00030005,0x00000145,0x00003272,0x00040005,
+0x00000149,0x61726170,0x0000006d,0x00030005,
+0x0000014c,0x00003267,0x00040005,0x00000150,
+0x61726170,0x0000006d,0x00030005,0x00000153,
+0x00003262,0x00040005,0x00000156,0x61726170,
+0x0000006d,0x00050005,0x00000159,0x65746e69,
+0x4965736e,0x00007864,0x00050005,0x00000162,
+0x65746e69,0x4d65736e,0x0000646f,0x00050005,
+0x00000169,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x0000016c,0x54726c63,0x656c6261,
+0x00000000,0x00040005,0x00000175,0x61726170,
+0x0000006d,0x00040005,0x0000017a,0x61726170,
+0x0000006d,0x00040005,0x0000017f,0x61726170,
+0x0000006d,0x00040005,0x0000018b,0x61726170,
+0x0000006d,0x00040005,0x00000190,0x61726170,
+0x0000006d,0x00040005,0x00000195,0x61726170,
+0x0000006d,0x00040005,0x00000199,0x61726170,
+0x0000006d,0x00040005,0x0000019b,0x61726170,
+0x0000006d,0x00040005,0x0000019d,0x61726170,
+0x0000006d,0x00040005,0x0000019f,0x61726170,
+0x0000006d,0x00040005,0x000001a4,0x31626772,
+0x00000000,0x00040005,0x000001a7,0x61726170,
+0x0000006d,0x00040005,0x000001b2,0x61726170,
+0x0000006d,0x00040005,0x000001bf,0x61726170,
+0x0000006d,0x00040005,0x000001c3,0x32626772,
+0x00000000,0x00040005,0x000001c6,0x61726170,
+0x0000006d,0x00040005,0x000001cd,0x61726170,
+0x0000006d,0x00040005,0x000001d3,0x61726170,
+0x0000006d,0x00050005,0x000001d7,0x65746e69,
+0x4965736e,0x00007864,0x00050005,0x000001f7,
+0x65746e69,0x4d65736e,0x0000646f,0x00050005,
+0x000001f9,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x000001fc,0x54726c63,0x656c6261,
+0x00000000,0x00040005,0x00000205,0x61726170,
+0x0000006d,0x00040005,0x00000210,0x61726170,
+0x0000006d,0x00040005,0x0000021b,0x61726170,
+0x0000006d,0x00040005,0x00000226,0x61726170,
+0x0000006d,0x00040005,0x00000229,0x61726170,
+0x0000006d,0x00040005,0x0000022b,0x61726170,
+0x0000006d,0x00040005,0x0000022d,0x61726170,
+0x0000006d,0x00040005,0x0000022f,0x61726170,
+0x0000006d,0x00040005,0x00000234,0x6f626772,
+0x00000000,0x00040005,0x00000238,0x61726170,
+0x0000006d,0x00040005,0x00000244,0x61726170,
+0x0000006d,0x00040005,0x00000255,0x61726170,
+0x0000006d,0x00040005,0x00000259,0x68626772,
+0x00000000,0x00040005,0x00000260,0x61726170,
+0x0000006d,0x00040005,0x00000266,0x61726170,
+0x0000006d,0x00040005,0x0000026c,0x61726170,
+0x0000006d,0x00040005,0x00000270,0x76626772,
+0x00000000,0x00040005,0x00000274,0x61726170,
+0x0000006d,0x00040005,0x0000027a,0x61726170,
+0x0000006d,0x00040005,0x0000027e,0x61726170,
+0x0000006d,0x00030005,0x00000283,0x00000069,
+0x00030005,0x0000028b,0x00000079,0x00030005,
+0x0000028e,0x00000078,0x00030005,0x00000291,
+0x00746572,0x00040005,0x000002a8,0x61726170,
+0x0000006d,0x00040005,0x000002b6,0x65736162,
+0x00000058,0x00040005,0x000002b7,0x65736162,
+0x00000059,0x00030005,0x000002bf,0x00000069,
+0x00030005,0x000002ca,0x00000078,0x00030005,
+0x000002d0,0x00000079,0x00030005,0x000002e1,
+0x0000006b,0x00030005,0x000002e6,0x0062736d,
+0x00030005,0x000002ec,0x0062736c,0x00030005,
+0x000002f1,0x00000071,0x00040005,0x00000305,
+0x7366666f,0x00007465,0x00040005,0x00000309,
+0x746c6564,0x00000061,0x00040005,0x00000311,
+0x61726170,0x0000006d,0x00040005,0x00000316,
+0x61726170,0x0000006d,0x00040005,0x0000031b,
+0x61726170,0x0000006d,0x00040005,0x00000321,
+0x7161706f,0x00006575,0x00040005,0x00000330,
+0x73614272,0x00000065,0x00040005,0x00000333,
+0x73614267,0x00000065,0x00040005,0x00000336,
+0x73614262,0x00000065,0x00040005,0x0000033b,
+0x61726170,0x0000006d,0x00040005,0x0000033d,
+0x61726170,0x0000006d,0x00040005,0x00000341,
+0x61726170,0x0000006d,0x00040005,0x00000343,
+0x61726170,0x0000006d,0x00040005,0x00000345,
+0x61726170,0x0000006d,0x00040005,0x00000347,
+0x61726170,0x0000006d,0x00040005,0x0000034d,
+0x61726170,0x0000006d,0x00040005,0x0000034f,
+0x61726170,0x0000006d,0x00040005,0x00000353,
+0x61726170,0x0000006d,0x00040005,0x00000355,
+0x61726170,0x0000006d,0x00040005,0x00000357,
+0x61726170,0x0000006d,0x00040005,0x00000359,
+0x61726170,0x0000006d,0x00040005,0x0000035f,
+0x61726170,0x0000006d,0x00040005,0x00000361,
+0x61726170,0x0000006d,0x00040005,0x00000365,
+0x61726170,0x0000006d,0x00040005,0x00000367,
+0x61726170,0x0000006d,0x00040005,0x00000369,
+0x61726170,0x0000006d,0x00030005,0x0000036d,
+0x00003172,0x00040005,0x0000036e,0x61726170,
+0x0000006d,0x00030005,0x00000372,0x00003272,
+0x00040005,0x00000375,0x61726170,0x0000006d,
+0x00040005,0x00000377,0x61726170,0x0000006d,
+0x00030005,0x0000037a,0x00003167,0x00040005,
+0x0000037b,0x61726170,0x0000006d,0x00030005,
+0x0000037f,0x00003267,0x00040005,0x00000382,
+0x61726170,0x0000006d,0x00040005,0x00000384,
+0x61726170,0x0000006d,0x00030005,0x00000387,
+0x00003162,0x00040005,0x00000388,0x61726170,
+0x0000006d,0x00030005,0x0000038c,0x00003262,
+0x00040005,0x0000038f,0x61726170,0x0000006d,
+0x00040005,0x00000391,0x61726170,0x0000006d,
+0x00040005,0x00000398,0x61726170,0x0000006d,
+0x00040005,0x0000039d,0x61726170,0x0000006d,
+0x00040005,0x000003a2,0x61726170,0x0000006d,
+0x00040005,0x000003a7,0x61726170,0x0000006d,
+0x00040005,0x000003ac,0x61726170,0x0000006d,
+0x00040005,0x000003b1,0x61726170,0x0000006d,
+0x00050005,0x000003b4,0x6c626174,0x646e4965,
+0x00417865,0x00050005,0x000003b8,0x6c626174,
+0x646e4965,0x00427865,0x00040005,0x000003c2,
+0x6c626174,0x00004165,0x00050005,0x000003e8,
+0x65646e69,0x6c626178,0x00000065,0x00040005,
+0x000003eb,0x6c626174,0x00004265,0x00050005,
+0x000003ed,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x000003fb,0x65646e69,0x6c626178,
+0x00000065,0x00050005,0x000003ff,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x00000402,
+0x70696c66,0x00646570,0x00030005,0x00000406,
+0x00746572,0x00040005,0x00000408,0x61726170,
+0x0000006d,0x00040005,0x0000040a,0x61726170,
+0x0000006d,0x00040005,0x0000040c,0x61726170,
+0x0000006d,0x00040005,0x0000040e,0x61726170,
+0x0000006d,0x00040005,0x00000410,0x61726170,
+0x0000006d,0x00040005,0x00000412,0x61726170,
+0x0000006d,0x00040005,0x00000414,0x61726170,
+0x0000006d,0x00040005,0x00000415,0x61726170,
+0x0000006d,0x00040005,0x00000417,0x61726170,
+0x0000006d,0x00040005,0x00000419,0x61726170,
+0x0000006d,0x00040005,0x0000041e,0x61726170,
+0x0000006d,0x00040005,0x00000420,0x61726170,
+0x0000006d,0x00040005,0x00000422,0x61726170,
+0x0000006d,0x00040005,0x00000424,0x61726170,
+0x0000006d,0x00040005,0x00000426,0x61726170,
+0x0000006d,0x00040005,0x00000428,0x61726170,
+0x0000006d,0x00040005,0x0000042a,0x61726170,
+0x0000006d,0x00040005,0x0000042b,0x61726170,
+0x0000006d,0x00040005,0x0000042d,0x61726170,
+0x0000006d,0x00040005,0x0000042f,0x61726170,
+0x0000006d,0x00060005,0x00000436,0x65736162,
+0x646f635f,0x726f7765,0x00000064,0x00050005,
+0x0000043c,0x746c756d,0x696c7069,0x00007265,
+0x00040005,0x00000442,0x496c6274,0x00007864,
+0x00040005,0x00000446,0x6c626174,0x00003065,
+0x00050005,0x00000475,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000478,0x6c626174,
+0x00003165,0x00050005,0x0000047c,0x65646e69,
+0x6c626178,0x00000065,0x00030005,0x00000480,
+0x00000070,0x00030005,0x000004a6,0x00000069,
+0x00040005,0x000004ae,0x4974756f,0x00007864,
+0x00050005,0x000004b5,0x69646f6d,0x72656966,
+0x00000000,0x00060005,0x000004ba,0x69646f6d,
+0x72656966,0x756c6156,0x00000065,0x00040005,
+0x000004c9,0x6f636564,0x00646564,0x00040005,
+0x000004cf,0x75736572,0x0000746c,0x00040005,
+0x000004d1,0x61726170,0x0000006d,0x00030005,
+0x000004f0,0x00736f70,0x00080005,0x000004f3,
+0x475f6c67,0x61626f6c,0x766e496c,0x7461636f,
+0x496e6f69,0x00000044,0x00070005,0x000004f6,
+0x67616d49,0x726f4665,0x4274616d,0x6b636f6c,
+0x00000000,0x00060006,0x000004f6,0x00000000,
+0x706d6f63,0x6d726f46,0x00007461,0x00060006,
+0x000004f6,0x00000001,0x65736162,0x6579614c,
+0x00000072,0x00060005,0x000004f8,0x75705f75,
+0x6f436873,0x6174736e,0x0000746e,0x00050005,
+0x00000503,0x42637273,0x6b636f6c,0x00000000,
+0x00050005,0x00000506,0x6d695f75,0x30656761,
+0x00000000,0x00040005,0x00000508,0x61726170,
+0x0000006d,0x00070005,0x00000511,0x6f636564,
+0x6572706d,0x64657373,0x68706c41,0x00000061,
+0x00040005,0x00000512,0x61726170,0x0000006d,
+0x00040005,0x00000516,0x61726170,0x0000006d,
+0x00040005,0x0000051a,0x61726170,0x0000006d,
+0x00040005,0x0000051b,0x61726170,0x0000006d,
+0x00040005,0x0000051c,0x61726170,0x0000006d,
+0x00060005,0x0000051e,0x6f636564,0x6572706d,
+0x64657373,0x00000000,0x00040005,0x0000051f,
+0x61726170,0x0000006d,0x00040005,0x00000525,
+0x61726170,0x0000006d,0x00040005,0x0000052b,
+0x61726170,0x0000006d,0x00040005,0x0000052c,
+0x61726170,0x0000006d,0x00040005,0x0000052d,
+0x61726170,0x0000006d,0x00030005,0x0000052f,
+0x00000079,0x00030005,0x00000537,0x00000078,
+0x00050005,0x00000541,0x6d695f75,0x31656761,
+0x00000000,0x00040005,0x00000551,0x61726170,
+0x0000006d,0x00040047,0x000004f3,0x0000000b,
+0x0000001c,0x00050048,0x000004f6,0x00000000,
+0x00000023,0x00000000,0x00050048,0x000004f6,
+0x00000001,0x00000023,0x00000004,0x00030047,
+0x000004f6,0x00000002,0x00040047,0x00000506,
+0x00000022,0x00000000,0x00040047,0x00000506,
+0x00000021,0x00000000,0x00030047,0x00000506,
+0x00000018,0x00040047,0x00000541,0x00000022,
+0x00000000,0x00040047,0x00000541,0x00000021,
+0x00000001,0x00030047,0x00000541,0x00000019,
+0x00040047,0x00000574,0x0000000b,0x00000019,
+0x00020013,0x00000002,0x00030021,0x00000003,
+0x00000002,0x00040015,0x00000006,0x00000020,
+0x00000001,0x00040017,0x00000007,0x00000006,
+0x00000003,0x00040020,0x00000008,0x00000007,
+0x00000007,0x00040021,0x00000009,0x00000007,
+0x00000008,0x00040015,0x0000000d,0x00000020,
+0x00000000,0x00040020,0x0000000e,0x00000007,
+0x0000000d,0x00020014,0x0000000f,0x00050021,
+0x00000010,0x0000000f,0x0000000e,0x0000000e,
+0x00040021,0x00000015,0x0000000d,0x0000000e,
+0x00050021,0x00000022,0x0000000d,0x0000000e,
+0x0000000e,0x00040020,0x00000027,0x00000007,
+0x00000006,0x00040021,0x00000028,0x00000006,
+0x00000027,0x0004002b,0x0000000d,0x0000002f,
+0x00000004,0x0004001c,0x00000030,0x00000007,
+0x0000002f,0x00040020,0x00000031,0x00000007,
+0x00000030,0x00040020,0x00000032,0x00000007,
+0x0000000f,0x00040017,0x00000033,0x00000006,
+0x00000004,0x0004002b,0x0000000d,0x00000034,
+0x00000010,0x0004001c,0x00000035,0x00000033,
+0x00000034,0x00070021,0x00000036,0x00000035,
+0x00000031,0x0000000e,0x00000032,0x00000032,
+0x00070021,0x0000003d,0x00000035,0x0000000e,
+0x0000000e,0x00000032,0x00000032,0x00060021,
+0x0000004a,0x00000035,0x0000000e,0x0000000e,
+0x00000032,0x00040020,0x00000050,0x00000007,
+0x00000035,0x00040020,0x00000051,0x00000007,
+0x00000033,0x000d0021,0x00000052,0x00000002,
+0x00000050,0x00000027,0x00000027,0x00000027,
+0x00000051,0x0000000e,0x00000032,0x00000032,
+0x00000032,0x00000032,0x0004001c,0x00000064,
+0x0000000d,0x00000034,0x00060021,0x00000065,
+0x00000064,0x0000000e,0x0000000e,0x00000032,
+0x0004002b,0x0000000d,0x00000072,0x0000001f,
+0x0004002b,0x0000000d,0x00000076,0x00000008,
+0x0004001c,0x00000077,0x00000006,0x00000076,
+0x0004002b,0x00000006,0x00000078,0x00000000,
+0x0004002b,0x00000006,0x00000079,0x00000001,
+0x0004002b,0x00000006,0x0000007a,0x00000002,
+0x0004002b,0x00000006,0x0000007b,0x00000003,
+0x0004002b,0x00000006,0x0000007c,0xfffffffc,
+0x0004002b,0x00000006,0x0000007d,0xfffffffd,
+0x0004002b,0x00000006,0x0000007e,0xfffffffe,
+0x0004002b,0x00000006,0x0000007f,0xffffffff,
+0x000b002c,0x00000077,0x00000080,0x00000078,
+0x00000079,0x0000007a,0x0000007b,0x0000007c,
+0x0000007d,0x0000007e,0x0000007f,0x0004002b,
+0x0000000d,0x00000081,0x00000007,0x00040020,
+0x00000084,0x00000007,0x00000077,0x0004002b,
+0x00000006,0x0000008c,0x00000020,0x0004002b,
+0x0000000d,0x00000093,0x0000000f,0x0004002b,
+0x00000006,0x00000096,0x00000004,0x0004002b,
+0x0000000d,0x000000a8,0x0000003f,0x0004002b,
+0x0000000d,0x000000b3,0x0000007f,0x0004002b,
+0x00000006,0x000000b8,0x00000006,0x0004002b,
+0x00000006,0x000000cc,0x000000ff,0x0004002b,
+0x0000000d,0x000000db,0x00000000,0x0004002b,
+0x0000000d,0x000000f5,0x00000002,0x0004002b,
+0x0000000d,0x000000fb,0x00000001,0x0007002c,
+0x00000033,0x0000010e,0x00000078,0x00000078,
+0x00000078,0x00000078,0x0004002b,0x00000006,
+0x0000012a,0x0000001b,0x0004002b,0x0000000d,
+0x0000012c,0x00000003,0x0004002b,0x00000006,
+0x00000130,0x00000018,0x0004002b,0x00000006,
+0x00000139,0x00000014,0x0004002b,0x00000006,
+0x00000140,0x00000010,0x0004002b,0x00000006,
+0x00000147,0x0000000c,0x0004002b,0x00000006,
+0x0000014e,0x00000008,0x0004002b,0x00000006,
+0x00000163,0x0000000b,0x0004002b,0x00000006,
+0x00000164,0x00000017,0x0004002b,0x00000006,
+0x00000165,0x00000029,0x0004002b,0x00000006,
+0x00000166,0x00000040,0x000b002c,0x00000077,
+0x00000167,0x0000007b,0x000000b8,0x00000163,
+0x00000140,0x00000164,0x0000008c,0x00000165,
+0x00000166,0x0004002b,0x00000006,0x000001b7,
+0x00000013,0x0004002b,0x00000006,0x000001bb,
+0x0000000f,0x0004002b,0x00000006,0x000001cb,
+0x00000007,0x0004002b,0x00000006,0x00000236,
+0x00000019,0x0004002b,0x00000006,0x00000240,
+0x00000011,0x0004002b,0x00000006,0x0000024a,
+0x00000005,0x0004002b,0x00000006,0x00000272,
+0x0000000d,0x0004002b,0x00000006,0x00000396,
+0x0000001c,0x0004001c,0x000003c3,0x00000033,
+0x00000076,0x0004002b,0x00000006,0x000003c4,
+0xfffffff8,0x0007002c,0x00000033,0x000003c5,
+0x0000007a,0x0000014e,0x0000007e,0x000003c4,
+0x0004002b,0x00000006,0x000003c6,0xfffffffb,
+0x0004002b,0x00000006,0x000003c7,0xffffffef,
+0x0007002c,0x00000033,0x000003c8,0x0000024a,
+0x00000240,0x000003c6,0x000003c7,0x0004002b,
+0x00000006,0x000003c9,0x00000009,0x0004002b,
+0x00000006,0x000003ca,0x0000001d,0x0004002b,
+0x00000006,0x000003cb,0xfffffff7,0x0004002b,
+0x00000006,0x000003cc,0xffffffe3,0x0007002c,
+0x00000033,0x000003cd,0x000003c9,0x000003ca,
+0x000003cb,0x000003cc,0x0004002b,0x00000006,
+0x000003ce,0x0000002a,0x0004002b,0x00000006,
+0x000003cf,0xfffffff3,0x0004002b,0x00000006,
+0x000003d0,0xffffffd6,0x0007002c,0x00000033,
+0x000003d1,0x00000272,0x000003ce,0x000003cf,
+0x000003d0,0x0004002b,0x00000006,0x000003d2,
+0x00000012,0x0004002b,0x00000006,0x000003d3,
+0x0000003c,0x0004002b,0x00000006,0x000003d4,
+0xffffffee,0x0004002b,0x00000006,0x000003d5,
+0xffffffc4,0x0007002c,0x00000033,0x000003d6,
+0x000003d2,0x000003d3,0x000003d4,0x000003d5,
+0x0004002b,0x00000006,0x000003d7,0x00000050,
+0x0004002b,0x00000006,0x000003d8,0xffffffe8,
+0x0004002b,0x00000006,0x000003d9,0xffffffb0,
+0x0007002c,0x00000033,0x000003da,0x00000130,
+0x000003d7,0x000003d8,0x000003d9,0x0004002b,
+0x00000006,0x000003db,0x00000021,0x0004002b,
+0x00000006,0x000003dc,0x0000006a,0x0004002b,
+0x00000006,0x000003dd,0xffffffdf,0x0004002b,
+0x00000006,0x000003de,0xffffff96,0x0007002c,
+0x00000033,0x000003df,0x000003db,0x000003dc,
+0x000003dd,0x000003de,0x0004002b,0x00000006,
+0x000003e0,0x0000002f,0x0004002b,0x00000006,
+0x000003e1,0x000000b7,0x0004002b,0x00000006,
+0x000003e2,0xffffffd1,0x0004002b,0x00000006,
+0x000003e3,0xffffff49,0x0007002c,0x00000033,
+0x000003e4,0x000003e0,0x000003e1,0x000003e2,
+0x000003e3,0x000b002c,0x000003c3,0x000003e5,
+0x000003c5,0x000003c8,0x000003cd,0x000003d1,
+0x000003d6,0x000003da,0x000003df,0x000003e4,
+0x00040020,0x000003e7,0x00000007,0x000003c3,
+0x0007002c,0x00000033,0x000003f1,0x00000078,
+0x0000014e,0x00000078,0x000003c4,0x0007002c,
+0x00000033,0x000003f2,0x00000078,0x00000240,
+0x00000078,0x000003c7,0x0007002c,0x00000033,
+0x000003f3,0x00000078,0x000003ca,0x00000078,
+0x000003cc,0x0007002c,0x00000033,0x000003f4,
+0x00000078,0x000003ce,0x00000078,0x000003d0,
+0x0007002c,0x00000033,0x000003f5,0x00000078,
+0x000003d3,0x00000078,0x000003d5,0x0007002c,
+0x00000033,0x000003f6,0x00000078,0x000003d7,
+0x00000078,0x000003d9,0x0007002c,0x00000033,
+0x000003f7,0x00000078,0x000003dc,0x00000078,
+0x000003de,0x0007002c,0x00000033,0x000003f8,
+0x00000078,0x000003e1,0x00000078,0x000003e3,
+0x000b002c,0x000003c3,0x000003f9,0x000003f1,
+0x000003f2,0x000003f3,0x000003f4,0x000003f5,
+0x000003f6,0x000003f7,0x000003f8,0x0003002a,
+0x0000000f,0x00000407,0x00030029,0x0000000f,
+0x0000041d,0x0004002b,0x0000000d,0x00000447,
+0x00000020,0x0004001c,0x00000448,0x00000033,
+0x00000447,0x0004002b,0x00000006,0x00000449,
+0xfffffffa,0x0004002b,0x00000006,0x0000044a,
+0xfffffff1,0x0007002c,0x00000033,0x0000044b,
+0x0000007d,0x00000449,0x000003cb,0x0000044a,
+0x0004002b,0x00000006,0x0000044c,0x0000000e,
+0x0007002c,0x00000033,0x0000044d,0x0000007a,
+0x0000024a,0x0000014e,0x0000044c,0x0004002b,
+0x00000006,0x0000044e,0xfffffff9,0x0004002b,
+0x00000006,0x0000044f,0xfffffff6,0x0007002c,
+0x00000033,0x00000450,0x0000007d,0x0000044e,
+0x0000044f,0x000003cf,0x0007002c,0x00000033,
+0x00000451,0x0000007a,0x000000b8,0x000003c9,
+0x00000147,0x0007002c,0x00000033,0x00000452,
+0x0000007e,0x000003c6,0x000003c4,0x000003cf,
+0x0007002c,0x00000033,0x00000453,0x00000079,
+0x00000096,0x000001cb,0x00000147,0x0007002c,
+0x00000033,0x00000454,0x0000007e,0x0000007c,
+0x00000449,0x000003cf,0x0007002c,0x00000033,
+0x00000455,0x00000079,0x0000007b,0x0000024a,
+0x00000147,0x0004002b,0x00000006,0x00000456,
+0xfffffff4,0x0007002c,0x00000033,0x00000457,
+0x0000007d,0x00000449,0x000003c4,0x00000456,
+0x0007002c,0x00000033,0x00000458,0x0000007a,
+0x0000024a,0x000001cb,0x00000163,0x0004002b,
+0x00000006,0x00000459,0xfffffff5,0x0007002c,
+0x00000033,0x0000045a,0x0000007d,0x0000044e,
+0x000003cb,0x00000459,0x0004002b,0x00000006,
+0x0000045b,0x0000000a,0x0007002c,0x00000033,
+0x0000045c,0x0000007a,0x000000b8,0x0000014e,
+0x0000045b,0x0007002c,0x00000033,0x0000045d,
+0x0000007c,0x0000044e,0x000003c4,0x00000459,
+0x0007002c,0x00000033,0x0000045e,0x0000007b,
+0x000000b8,0x000001cb,0x0000045b,0x0007002c,
+0x00000033,0x0000045f,0x0000007d,0x000003c6,
+0x000003c4,0x00000459,0x0007002c,0x00000033,
+0x00000460,0x0000007a,0x00000096,0x000001cb,
+0x0000045b,0x0007002c,0x00000033,0x00000461,
+0x0000007e,0x00000449,0x000003c4,0x0000044f,
+0x0007002c,0x00000033,0x00000462,0x00000079,
+0x0000024a,0x000001cb,0x000003c9,0x0007002c,
+0x00000033,0x00000463,0x0000007e,0x000003c6,
+0x000003c4,0x0000044f,0x0007002c,0x00000033,
+0x00000464,0x00000079,0x00000096,0x000001cb,
+0x000003c9,0x0007002c,0x00000033,0x00000465,
+0x0000007e,0x0000007c,0x000003c4,0x0000044f,
+0x0007002c,0x00000033,0x00000466,0x00000079,
+0x0000007b,0x000001cb,0x000003c9,0x0007002c,
+0x00000033,0x00000467,0x0000007e,0x000003c6,
+0x0000044e,0x0000044f,0x0007002c,0x00000033,
+0x00000468,0x00000079,0x00000096,0x000000b8,
+0x000003c9,0x0007002c,0x00000033,0x00000469,
+0x0000007d,0x0000007c,0x0000044e,0x0000044f,
+0x0007002c,0x00000033,0x0000046a,0x0000007a,
+0x0000007b,0x000000b8,0x000003c9,0x0007002c,
+0x00000033,0x0000046b,0x0000007f,0x0000007e,
+0x0000007d,0x0000044f,0x0007002c,0x00000033,
+0x0000046c,0x00000078,0x00000079,0x0000007a,
+0x000003c9,0x0007002c,0x00000033,0x0000046d,
+0x0000007c,0x00000449,0x000003c4,0x000003cb,
+0x0007002c,0x00000033,0x0000046e,0x0000007b,
+0x0000024a,0x000001cb,0x0000014e,0x0007002c,
+0x00000033,0x0000046f,0x0000007d,0x000003c6,
+0x0000044e,0x000003cb,0x0007002c,0x00000033,
+0x00000470,0x0000007a,0x00000096,0x000000b8,
+0x0000014e,0x0023002c,0x00000448,0x00000471,
+0x0000044b,0x0000044d,0x00000450,0x00000451,
+0x00000452,0x00000453,0x00000454,0x00000455,
+0x00000457,0x00000458,0x0000045a,0x0000045c,
+0x0000045d,0x0000045e,0x0000045f,0x00000460,
+0x00000461,0x00000462,0x00000463,0x00000464,
+0x00000465,0x00000466,0x00000467,0x00000468,
+0x00000469,0x0000046a,0x0000046b,0x0000046c,
+0x0000046d,0x0000046e,0x0000046f,0x00000470,
+0x00040020,0x00000474,0x00000007,0x00000448,
+0x00040020,0x0000047f,0x00000007,0x00000064,
+0x0004002b,0x00000006,0x0000048e,0x0000001e,
+0x0004002b,0x00000006,0x00000496,0x00000015,
+0x0004002b,0x0000000d,0x000004dc,0x000000ff,
+0x0004002b,0x0000000d,0x000004e0,0x0000ff00,
+0x0004002b,0x0000000d,0x000004e5,0x00ff0000,
+0x0004002b,0x0000000d,0x000004ea,0xff000000,
+0x00040017,0x000004f1,0x0000000d,0x00000003,
+0x00040020,0x000004f2,0x00000001,0x000004f1,
+0x0004003b,0x000004f2,0x000004f3,0x00000001,
+0x0004001e,0x000004f6,0x0000000d,0x0000000d,
+0x00040020,0x000004f7,0x00000009,0x000004f6,
+0x0004003b,0x000004f7,0x000004f8,0x00000009,
+0x00040020,0x000004f9,0x00000009,0x0000000d,
+0x00040017,0x00000501,0x0000000d,0x00000004,
+0x00040020,0x00000502,0x00000007,0x00000501,
+0x00090019,0x00000504,0x0000000d,0x00000001,
+0x00000000,0x00000001,0x00000000,0x00000002,
+0x0000001e,0x00040020,0x00000505,0x00000000,
+0x00000504,0x0004003b,0x00000505,0x00000506,
+0x00000000,0x00090019,0x0000053f,0x0000000d,
+0x00000001,0x00000000,0x00000001,0x00000000,
+0x00000002,0x00000020,0x00040020,0x00000540,
+0x00000000,0x0000053f,0x0004003b,0x00000540,
+0x00000541,0x00000000,0x00040017,0x00000543,
+0x00000006,0x00000002,0x0004002b,0x0000000d,
+0x0000056a,0x00000093,0x0004002b,0x0000000d,
+0x0000056b,0x00000094,0x0004002b,0x0000000d,
+0x0000056c,0x00000095,0x0004002b,0x0000000d,
+0x0000056d,0x00000096,0x0004002b,0x0000000d,
+0x0000056e,0x00000097,0x0004002b,0x0000000d,
+0x0000056f,0x00000098,0x0004002b,0x0000000d,
+0x00000570,0x00000099,0x0004002b,0x0000000d,
+0x00000571,0x0000009a,0x0004002b,0x0000000d,
+0x00000572,0x0000009b,0x0004002b,0x0000000d,
+0x00000573,0x0000009c,0x0006002c,0x000004f1,
+0x00000574,0x00000076,0x00000076,0x000000fb,
+0x00050036,0x00000002,0x00000004,0x00000000,
+0x00000003,0x000200f8,0x00000005,0x0004003b,
+0x00000008,0x000004f0,0x00000007,0x0004003b,
+0x00000502,0x00000503,0x00000007,0x0004003b,
+0x00000008,0x00000508,0x00000007,0x0004003b,
+0x0000047f,0x00000511,0x00000007,0x0004003b,
+0x0000000e,0x00000512,0x00000007,0x0004003b,
+0x0000000e,0x00000516,0x00000007,0x0004003b,
+0x0000000e,0x0000051a,0x00000007,0x0004003b,
+0x0000000e,0x0000051b,0x00000007,0x0004003b,
+0x00000032,0x0000051c,0x00000007,0x0004003b,
+0x00000050,0x0000051e,0x00000007,0x0004003b,
+0x0000000e,0x0000051f,0x00000007,0x0004003b,
+0x0000000e,0x00000525,0x00000007,0x0004003b,
+0x0000000e,0x0000052b,0x00000007,0x0004003b,
+0x0000000e,0x0000052c,0x00000007,0x0004003b,
+0x00000032,0x0000052d,0x00000007,0x0004003b,
+0x00000027,0x0000052f,0x00000007,0x0004003b,
+0x00000027,0x00000537,0x00000007,0x0004003b,
+0x00000008,0x00000551,0x00000007,0x0004003d,
+0x000004f1,0x000004f4,0x000004f3,0x0004007c,
+0x00000007,0x000004f5,0x000004f4,0x0003003e,
+0x000004f0,0x000004f5,0x00050041,0x000004f9,
+0x000004fa,0x000004f8,0x00000079,0x0004003d,
+0x0000000d,0x000004fb,0x000004fa,0x0004007c,
+0x00000006,0x000004fc,0x000004fb,0x00050041,
+0x00000027,0x000004fd,0x000004f0,0x000000f5,
+0x0004003d,0x00000006,0x000004fe,0x000004fd,
+0x00050080,0x00000006,0x000004ff,0x000004fe,
+0x000004fc,0x00050041,0x00000027,0x00000500,
+0x000004f0,0x000000f5,0x0003003e,0x00000500,
+0x000004ff,0x0004003d,0x00000504,0x00000507,
+0x00000506,0x0004003d,0x00000007,0x00000509,
+0x000004f0,0x0003003e,0x00000508,0x00000509,
+0x00050039,0x00000007,0x0000050a,0x0000000b,
+0x00000508,0x00050062,0x00000501,0x0000050b,
+0x00000507,0x0000050a,0x00050051,0x0000000d,
+0x0000050c,0x0000050b,0x00000000,0x00050051,
+0x0000000d,0x0000050d,0x0000050b,0x00000001,
+0x00050051,0x0000000d,0x0000050e,0x0000050b,
+0x00000002,0x00050051,0x0000000d,0x0000050f,
+0x0000050b,0x00000003,0x00070050,0x00000501,
+0x00000510,0x0000050c,0x0000050d,0x0000050e,
+0x0000050f,0x0003003e,0x00000503,0x00000510,
+0x00050041,0x0000000e,0x00000513,0x00000503,
+0x000000db,0x0004003d,0x0000000d,0x00000514,
+0x00000513,0x0003003e,0x00000512,0x00000514,
+0x00050039,0x0000000d,0x00000515,0x0000006c,
+0x00000512,0x00050041,0x0000000e,0x00000517,
+0x00000503,0x000000fb,0x0004003d,0x0000000d,
+0x00000518,0x00000517,0x0003003e,0x00000516,
+0x00000518,0x00050039,0x0000000d,0x00000519,
+0x0000006c,0x00000516,0x0003003e,0x0000051a,
+0x00000515,0x0003003e,0x0000051b,0x00000519,
+0x0003003e,0x0000051c,0x00000407,0x00070039,
+0x00000064,0x0000051d,0x00000069,0x0000051a,
+0x0000051b,0x0000051c,0x0003003e,0x00000511,
+0x0000051d,0x00050041,0x0000000e,0x00000520,
+0x00000503,0x000000f5,0x0004003d,0x0000000d,
+0x00000521,0x00000520,0x0003003e,0x0000051f,
+0x00000521,0x00050039,0x0000000d,0x00000522,
+0x0000006c,0x0000051f,0x0004007c,0x00000006,
+0x00000523,0x00000522,0x0004007c,0x0000000d,
+0x00000524,0x00000523,0x00050041,0x0000000e,
+0x00000526,0x00000503,0x0000012c,0x0004003d,
+0x0000000d,0x00000527,0x00000526,0x0003003e,
+0x00000525,0x00000527,0x00050039,0x0000000d,
+0x00000528,0x0000006c,0x00000525,0x0004007c,
+0x00000006,0x00000529,0x00000528,0x0004007c,
+0x0000000d,0x0000052a,0x00000529,0x0003003e,
+0x0000052b,0x00000524,0x0003003e,0x0000052c,
+0x0000052a,0x0003003e,0x0000052d,0x00000407,
+0x00070039,0x00000035,0x0000052e,0x00000062,
+0x0000052b,0x0000052c,0x0000052d,0x0003003e,
+0x0000051e,0x0000052e,0x0003003e,0x0000052f,
+0x00000078,0x000200f9,0x00000530,0x000200f8,
+0x00000530,0x000400f6,0x00000532,0x00000533,
+0x00000000,0x000200f9,0x00000534,0x000200f8,
+0x00000534,0x0004003d,0x00000006,0x00000535,
+0x0000052f,0x000500b1,0x0000000f,0x00000536,
+0x00000535,0x00000096,0x000400fa,0x00000536,
+0x00000531,0x00000532,0x000200f8,0x00000531,
+0x0003003e,0x00000537,0x00000078,0x000200f9,
+0x00000538,0x000200f8,0x00000538,0x000400f6,
+0x0000053a,0x0000053b,0x00000000,0x000200f9,
+0x0000053c,0x000200f8,0x0000053c,0x0004003d,
+0x00000006,0x0000053d,0x00000537,0x000500b1,
+0x0000000f,0x0000053e,0x0000053d,0x00000096,
+0x000400fa,0x0000053e,0x00000539,0x0000053a,
+0x000200f8,0x00000539,0x0004003d,0x0000053f,
+0x00000542,0x00000541,0x0004003d,0x00000007,
+0x00000544,0x000004f0,0x0007004f,0x00000543,
+0x00000545,0x00000544,0x00000544,0x00000000,
+0x00000001,0x00050050,0x00000543,0x00000546,
+0x00000096,0x00000096,0x00050084,0x00000543,
+0x00000547,0x00000545,0x00000546,0x0004003d,
+0x00000006,0x00000548,0x00000537,0x0004003d,
+0x00000006,0x00000549,0x0000052f,0x00050050,
+0x00000543,0x0000054a,0x00000548,0x00000549,
+0x00050080,0x00000543,0x0000054b,0x00000547,
+0x0000054a,0x00050041,0x00000027,0x0000054c,
+0x000004f0,0x000000f5,0x0004003d,0x00000006,
+0x0000054d,0x0000054c,0x00050051,0x00000006,
+0x0000054e,0x0000054b,0x00000000,0x00050051,
+0x00000006,0x0000054f,0x0000054b,0x00000001,
+0x00060050,0x00000007,0x00000550,0x0000054e,
+0x0000054f,0x0000054d,0x0003003e,0x00000551,
+0x00000550,0x00050039,0x00000007,0x00000552,
+0x0000000b,0x00000551,0x0004003d,0x00000006,
+0x00000553,0x0000052f,0x00050084,0x00000006,
+0x00000554,0x00000553,0x00000096,0x0004003d,
+0x00000006,0x00000555,0x00000537,0x00050080,
+0x00000006,0x00000556,0x00000554,0x00000555,
+0x00050041,0x00000051,0x00000557,0x0000051e,
+0x00000556,0x0004003d,0x00000033,0x00000558,
+0x00000557,0x0008004f,0x00000007,0x00000559,
+0x00000558,0x00000558,0x00000000,0x00000001,
+0x00000002,0x0004003d,0x00000006,0x0000055a,
+0x0000052f,0x00050084,0x00000006,0x0000055b,
+0x0000055a,0x00000096,0x0004003d,0x00000006,
+0x0000055c,0x00000537,0x00050080,0x00000006,
+0x0000055d,0x0000055b,0x0000055c,0x00050041,
+0x0000000e,0x0000055e,0x00000511,0x0000055d,
+0x0004003d,0x0000000d,0x0000055f,0x0000055e,
+0x0004007c,0x00000006,0x00000560,0x0000055f,
+0x00050051,0x00000006,0x00000561,0x00000559,
+0x00000000,0x00050051,0x00000006,0x00000562,
+0x00000559,0x00000001,0x00050051,0x00000006,
+0x00000563,0x00000559,0x00000002,0x00070050,
+0x00000033,0x00000564,0x00000561,0x00000562,
+0x00000563,0x00000560,0x0004007c,0x00000501,
+0x00000565,0x00000564,0x00040063,0x00000542,
+0x00000552,0x00000565,0x000200f9,0x0000053b,
+0x000200f8,0x0000053b,0x0004003d,0x00000006,
+0x00000566,0x00000537,0x00050080,0x00000006,
+0x00000567,0x00000566,0x00000079,0x0003003e,
+0x00000537,0x00000567,0x000200f9,0x00000538,
+0x000200f8,0x0000053a,0x000200f9,0x00000533,
+0x000200f8,0x00000533,0x0004003d,0x00000006,
+0x00000568,0x0000052f,0x00050080,0x00000006,
+0x00000569,0x00000568,0x00000079,0x0003003e,
+0x0000052f,0x00000569,0x000200f9,0x00000530,
+0x000200f8,0x00000532,0x000100fd,0x00010038,
+0x00050036,0x00000007,0x0000000b,0x00000000,
+0x00000009,0x00030037,0x00000008,0x0000000a,
+0x000200f8,0x0000000c,0x0004003d,0x00000007,
+0x0000006e,0x0000000a,0x000200fe,0x0000006e,
+0x00010038,0x00050036,0x0000000f,0x00000013,
+0x00000000,0x00000010,0x00030037,0x0000000e,
+0x00000011,0x00030037,0x0000000e,0x00000012,
+0x000200f8,0x00000014,0x0004003b,0x00000027,
+0x00000071,0x00000007,0x0004003b,0x00000084,
+0x00000085,0x00000007,0x0004003d,0x0000000d,
+0x00000073,0x00000011,0x000500c7,0x0000000d,
+0x00000074,0x00000072,0x00000073,0x0004007c,
+0x00000006,0x00000075,0x00000074,0x0004003d,
+0x0000000d,0x00000082,0x00000012,0x000500c7,
+0x0000000d,0x00000083,0x00000081,0x00000082,
+0x0003003e,0x00000085,0x00000080,0x00050041,
+0x00000027,0x00000086,0x00000085,0x00000083,
+0x0004003d,0x00000006,0x00000087,0x00000086,
+0x00050080,0x00000006,0x00000088,0x00000075,
+0x00000087,0x0003003e,0x00000071,0x00000088,
+0x0004003d,0x00000006,0x00000089,0x00000071,
+0x000500b1,0x0000000f,0x0000008a,0x00000089,
+0x00000078,0x0004003d,0x00000006,0x0000008b,
+0x00000071,0x000500af,0x0000000f,0x0000008d,
+0x0000008b,0x0000008c,0x000500a6,0x0000000f,
+0x0000008e,0x0000008a,0x0000008d,0x000200fe,
+0x0000008e,0x00010038,0x00050036,0x0000000d,
+0x00000017,0x00000000,0x00000015,0x00030037,
+0x0000000e,0x00000016,0x000200f8,0x00000018,
+0x0004003b,0x0000000e,0x00000091,0x00000007,
+0x0004003d,0x0000000d,0x00000092,0x00000016,
+0x000500c7,0x0000000d,0x00000094,0x00000092,
+0x00000093,0x0003003e,0x00000091,0x00000094,
+0x0004003d,0x0000000d,0x00000095,0x00000091,
+0x000500c4,0x0000000d,0x00000097,0x00000095,
+0x00000096,0x0004003d,0x0000000d,0x00000098,
+0x00000091,0x000500c5,0x0000000d,0x00000099,
+0x00000097,0x00000098,0x000200fe,0x00000099,
+0x00010038,0x00050036,0x0000000d,0x0000001a,
+0x00000000,0x00000015,0x00030037,0x0000000e,
+0x00000019,0x000200f8,0x0000001b,0x0004003b,
+0x0000000e,0x0000009c,0x00000007,0x0004003d,
+0x0000000d,0x0000009d,0x00000019,0x000500c7,
+0x0000000d,0x0000009e,0x0000009d,0x00000072,
+0x0003003e,0x0000009c,0x0000009e,0x0004003d,
+0x0000000d,0x0000009f,0x0000009c,0x000500c4,
+0x0000000d,0x000000a0,0x0000009f,0x0000007b,
+0x0004003d,0x0000000d,0x000000a1,0x0000009c,
+0x000500c2,0x0000000d,0x000000a2,0x000000a1,
+0x0000007a,0x000500c5,0x0000000d,0x000000a3,
+0x000000a0,0x000000a2,0x000200fe,0x000000a3,
+0x00010038,0x00050036,0x0000000d,0x0000001d,
+0x00000000,0x00000015,0x00030037,0x0000000e,
+0x0000001c,0x000200f8,0x0000001e,0x0004003b,
+0x0000000e,0x000000a6,0x00000007,0x0004003d,
+0x0000000d,0x000000a7,0x0000001c,0x000500c7,
+0x0000000d,0x000000a9,0x000000a7,0x000000a8,
+0x0003003e,0x000000a6,0x000000a9,0x0004003d,
+0x0000000d,0x000000aa,0x000000a6,0x000500c4,
+0x0000000d,0x000000ab,0x000000aa,0x0000007a,
+0x0004003d,0x0000000d,0x000000ac,0x000000a6,
+0x000500c2,0x0000000d,0x000000ad,0x000000ac,
+0x00000096,0x000500c5,0x0000000d,0x000000ae,
+0x000000ab,0x000000ad,0x000200fe,0x000000ae,
+0x00010038,0x00050036,0x0000000d,0x00000020,
+0x00000000,0x00000015,0x00030037,0x0000000e,
+0x0000001f,0x000200f8,0x00000021,0x0004003b,
+0x0000000e,0x000000b1,0x00000007,0x0004003d,
+0x0000000d,0x000000b2,0x0000001f,0x000500c7,
+0x0000000d,0x000000b4,0x000000b2,0x000000b3,
+0x0003003e,0x000000b1,0x000000b4,0x0004003d,
+0x0000000d,0x000000b5,0x000000b1,0x000500c4,
+0x0000000d,0x000000b6,0x000000b5,0x00000079,
+0x0004003d,0x0000000d,0x000000b7,0x000000b1,
+0x000500c2,0x0000000d,0x000000b9,0x000000b7,
+0x000000b8,0x000500c5,0x0000000d,0x000000ba,
+0x000000b6,0x000000b9,0x000200fe,0x000000ba,
+0x00010038,0x00050036,0x0000000d,0x00000025,
+0x00000000,0x00000022,0x00030037,0x0000000e,
+0x00000023,0x00030037,0x0000000e,0x00000024,
+0x000200f8,0x00000026,0x0004003b,0x00000084,
+0x000000c2,0x00000007,0x0004003b,0x0000000e,
+0x000000c7,0x00000007,0x0004003d,0x0000000d,
+0x000000bd,0x00000023,0x000500c7,0x0000000d,
+0x000000be,0x00000072,0x000000bd,0x0004007c,
+0x00000006,0x000000bf,0x000000be,0x0004003d,
+0x0000000d,0x000000c0,0x00000024,0x000500c7,
+0x0000000d,0x000000c1,0x00000081,0x000000c0,
+0x0003003e,0x000000c2,0x00000080,0x00050041,
+0x00000027,0x000000c3,0x000000c2,0x000000c1,
+0x0004003d,0x00000006,0x000000c4,0x000000c3,
+0x00050080,0x00000006,0x000000c5,0x000000bf,
+0x000000c4,0x0004007c,0x0000000d,0x000000c6,
+0x000000c5,0x0003003e,0x000000c7,0x000000c6,
+0x00050039,0x0000000d,0x000000c8,0x0000001a,
+0x000000c7,0x000200fe,0x000000c8,0x00010038,
+0x00050036,0x00000006,0x0000002a,0x00000000,
+0x00000028,0x00030037,0x00000027,0x00000029,
+0x000200f8,0x0000002b,0x0004003d,0x00000006,
+0x000000cb,0x00000029,0x0008000c,0x00000006,
+0x000000cd,0x00000001,0x0000002d,0x000000cb,
+0x00000078,0x000000cc,0x000200fe,0x000000cd,
+0x00010038,0x00050036,0x00000007,0x0000002d,
+0x00000000,0x00000009,0x00030037,0x00000008,
+0x0000002c,0x000200f8,0x0000002e,0x0004003d,
+0x00000007,0x000000d0,0x0000002c,0x00060050,
+0x00000007,0x000000d1,0x00000078,0x00000078,
+0x00000078,0x00060050,0x00000007,0x000000d2,
+0x000000cc,0x000000cc,0x000000cc,0x0008000c,
+0x00000007,0x000000d3,0x00000001,0x0000002d,
+0x000000d0,0x000000d1,0x000000d2,0x00050051,
+0x00000006,0x000000d4,0x000000d3,0x00000000,
+0x00050051,0x00000006,0x000000d5,0x000000d3,
+0x00000001,0x00050051,0x00000006,0x000000d6,
+0x000000d3,0x00000002,0x00060050,0x00000007,
+0x000000d7,0x000000d4,0x000000d5,0x000000d6,
+0x000200fe,0x000000d7,0x00010038,0x00050036,
+0x00000035,0x0000003b,0x00000000,0x00000036,
+0x00030037,0x00000031,0x00000037,0x00030037,
+0x0000000e,0x00000038,0x00030037,0x00000032,
+0x00000039,0x00030037,0x00000032,0x0000003a,
+0x000200f8,0x0000003c,0x0004003b,0x0000000e,
+0x000000da,0x00000007,0x0004003b,0x0000000e,
+0x000000e3,0x00000007,0x0004003b,0x0000000e,
+0x000000eb,0x00000007,0x0004003b,0x0000000e,
+0x000000f0,0x00000007,0x0004003b,0x0000000e,
+0x000000f7,0x00000007,0x0004003b,0x00000050,
+0x00000109,0x00000007,0x0004003b,0x0000000e,
+0x00000111,0x00000007,0x0003003e,0x000000da,
+0x000000db,0x000200f9,0x000000dc,0x000200f8,
+0x000000dc,0x000400f6,0x000000de,0x000000df,
+0x00000000,0x000200f9,0x000000e0,0x000200f8,
+0x000000e0,0x0004003d,0x0000000d,0x000000e1,
+0x000000da,0x000500b0,0x0000000f,0x000000e2,
+0x000000e1,0x0000002f,0x000400fa,0x000000e2,
+0x000000dd,0x000000de,0x000200f8,0x000000dd,
+0x0003003e,0x000000e3,0x000000db,0x000200f9,
+0x000000e4,0x000200f8,0x000000e4,0x000400f6,
+0x000000e6,0x000000e7,0x00000000,0x000200f9,
+0x000000e8,0x000200f8,0x000000e8,0x0004003d,
+0x0000000d,0x000000e9,0x000000e3,0x000500b0,
+0x0000000f,0x000000ea,0x000000e9,0x0000002f,
+0x000400fa,0x000000ea,0x000000e5,0x000000e6,
+0x000200f8,0x000000e5,0x0004003d,0x0000000d,
+0x000000ec,0x000000da,0x0004003d,0x0000000d,
+0x000000ed,0x000000e3,0x00050084,0x0000000d,
+0x000000ee,0x000000ed,0x0000002f,0x00050080,
+0x0000000d,0x000000ef,0x000000ec,0x000000ee,
+0x0003003e,0x000000eb,0x000000ef,0x0004003d,
+0x0000000d,0x000000f1,0x00000038,0x0004003d,
+0x0000000d,0x000000f2,0x000000eb,0x00050080,
+0x0000000d,0x000000f3,0x000000f2,0x00000093,
+0x000500c2,0x0000000d,0x000000f4,0x000000f1,
+0x000000f3,0x000500c7,0x0000000d,0x000000f6,
+0x000000f4,0x000000f5,0x0003003e,0x000000f0,
+0x000000f6,0x0004003d,0x0000000d,0x000000f8,
+0x00000038,0x0004003d,0x0000000d,0x000000f9,
+0x000000eb,0x000500c2,0x0000000d,0x000000fa,
+0x000000f8,0x000000f9,0x000500c7,0x0000000d,
+0x000000fc,0x000000fa,0x000000fb,0x0003003e,
+0x000000f7,0x000000fc,0x0004003d,0x0000000f,
+0x000000fd,0x00000039,0x0004003d,0x0000000f,
+0x000000fe,0x0000003a,0x000400a8,0x0000000f,
+0x000000ff,0x000000fe,0x000500a7,0x0000000f,
+0x00000100,0x000000fd,0x000000ff,0x0004003d,
+0x0000000d,0x00000101,0x000000f0,0x000500ab,
+0x0000000f,0x00000102,0x00000101,0x000000db,
+0x000500a7,0x0000000f,0x00000103,0x00000100,
+0x00000102,0x0004003d,0x0000000d,0x00000104,
+0x000000f7,0x000500aa,0x0000000f,0x00000105,
+0x00000104,0x000000db,0x000500a7,0x0000000f,
+0x00000106,0x00000103,0x00000105,0x000300f7,
+0x00000108,0x00000000,0x000400fa,0x00000106,
+0x00000107,0x00000110,0x000200f8,0x00000107,
+0x0004003d,0x0000000d,0x0000010a,0x000000da,
+0x00050084,0x0000000d,0x0000010b,0x0000010a,
+0x0000002f,0x0004003d,0x0000000d,0x0000010c,
+0x000000e3,0x00050080,0x0000000d,0x0000010d,
+0x0000010b,0x0000010c,0x00050041,0x00000051,
+0x0000010f,0x00000109,0x0000010d,0x0003003e,
+0x0000010f,0x0000010e,0x000200f9,0x00000108,
+0x000200f8,0x00000110,0x0004003d,0x0000000d,
+0x00000112,0x000000f7,0x0004003d,0x0000000d,
+0x00000113,0x000000f0,0x000500c5,0x0000000d,
+0x00000114,0x00000112,0x00000113,0x0003003e,
+0x00000111,0x00000114,0x0004003d,0x0000000d,
+0x00000115,0x000000da,0x00050084,0x0000000d,
+0x00000116,0x00000115,0x0000002f,0x0004003d,
+0x0000000d,0x00000117,0x000000e3,0x00050080,
+0x0000000d,0x00000118,0x00000116,0x00000117,
+0x0004003d,0x0000000d,0x00000119,0x00000111,
+0x00050041,0x00000008,0x0000011a,0x00000037,
+0x00000119,0x0004003d,0x00000007,0x0000011b,
+0x0000011a,0x00050051,0x00000006,0x0000011c,
+0x0000011b,0x00000000,0x00050051,0x00000006,
+0x0000011d,0x0000011b,0x00000001,0x00050051,
+0x00000006,0x0000011e,0x0000011b,0x00000002,
+0x00070050,0x00000033,0x0000011f,0x0000011c,
+0x0000011d,0x0000011e,0x000000cc,0x00050041,
+0x00000051,0x00000120,0x00000109,0x00000118,
+0x0003003e,0x00000120,0x0000011f,0x000200f9,
+0x00000108,0x000200f8,0x00000108,0x000200f9,
+0x000000e7,0x000200f8,0x000000e7,0x0004003d,
+0x0000000d,0x00000121,0x000000e3,0x00050080,
+0x0000000d,0x00000122,0x00000121,0x00000079,
+0x0003003e,0x000000e3,0x00000122,0x000200f9,
+0x000000e4,0x000200f8,0x000000e6,0x000200f9,
+0x000000df,0x000200f8,0x000000df,0x0004003d,
+0x0000000d,0x00000123,0x000000da,0x00050080,
+0x0000000d,0x00000124,0x00000123,0x00000079,
+0x0003003e,0x000000da,0x00000124,0x000200f9,
+0x000000dc,0x000200f8,0x000000de,0x0004003d,
+0x00000035,0x00000125,0x00000109,0x000200fe,
+0x00000125,0x00010038,0x00050036,0x00000035,
+0x00000042,0x00000000,0x0000003d,0x00030037,
+0x0000000e,0x0000003e,0x00030037,0x0000000e,
+0x0000003f,0x00030037,0x00000032,0x00000040,
+0x00030037,0x00000032,0x00000041,0x000200f8,
+0x00000043,0x0004003b,0x00000027,0x00000128,
+0x00000007,0x0004003b,0x0000000e,0x00000134,
+0x00000007,0x0004003b,0x00000027,0x00000137,
+0x00000007,0x0004003b,0x0000000e,0x0000013b,
+0x00000007,0x0004003b,0x00000027,0x0000013e,
+0x00000007,0x0004003b,0x0000000e,0x00000142,
+0x00000007,0x0004003b,0x00000027,0x00000145,
+0x00000007,0x0004003b,0x0000000e,0x00000149,
+0x00000007,0x0004003b,0x00000027,0x0000014c,
+0x00000007,0x0004003b,0x0000000e,0x00000150,
+0x00000007,0x0004003b,0x00000027,0x00000153,
+0x00000007,0x0004003b,0x0000000e,0x00000156,
+0x00000007,0x0004003b,0x00000027,0x00000159,
+0x00000007,0x0004003b,0x00000027,0x00000162,
+0x00000007,0x0004003b,0x00000084,0x00000169,
+0x00000007,0x0004003b,0x00000031,0x0000016c,
+0x00000007,0x0004003b,0x00000027,0x00000175,
+0x00000007,0x0004003b,0x00000027,0x0000017a,
+0x00000007,0x0004003b,0x00000027,0x0000017f,
+0x00000007,0x0004003b,0x00000027,0x0000018b,
+0x00000007,0x0004003b,0x00000027,0x00000190,
+0x00000007,0x0004003b,0x00000027,0x00000195,
+0x00000007,0x0004003b,0x00000031,0x00000199,
+0x00000007,0x0004003b,0x0000000e,0x0000019b,
+0x00000007,0x0004003b,0x00000032,0x0000019d,
+0x00000007,0x0004003b,0x00000032,0x0000019f,
+0x00000007,0x0004003d,0x0000000d,0x00000129,
+0x0000003e,0x000500c2,0x0000000d,0x0000012b,
+0x00000129,0x0000012a,0x000500c7,0x0000000d,
+0x0000012d,0x0000012b,0x0000012c,0x000500c4,
+0x0000000d,0x0000012e,0x0000012d,0x0000007a,
+0x0004003d,0x0000000d,0x0000012f,0x0000003e,
+0x000500c2,0x0000000d,0x00000131,0x0000012f,
+0x00000130,0x000500c7,0x0000000d,0x00000132,
+0x00000131,0x0000012c,0x000500c5,0x0000000d,
+0x00000133,0x0000012e,0x00000132,0x0003003e,
+0x00000134,0x00000133,0x00050039,0x0000000d,
+0x00000135,0x00000017,0x00000134,0x0004007c,
+0x00000006,0x00000136,0x00000135,0x0003003e,
+0x00000128,0x00000136,0x0004003d,0x0000000d,
+0x00000138,0x0000003e,0x000500c2,0x0000000d,
+0x0000013a,0x00000138,0x00000139,0x0003003e,
+0x0000013b,0x0000013a,0x00050039,0x0000000d,
+0x0000013c,0x00000017,0x0000013b,0x0004007c,
+0x00000006,0x0000013d,0x0000013c,0x0003003e,
+0x00000137,0x0000013d,0x0004003d,0x0000000d,
+0x0000013f,0x0000003e,0x000500c2,0x0000000d,
+0x00000141,0x0000013f,0x00000140,0x0003003e,
+0x00000142,0x00000141,0x00050039,0x0000000d,
+0x00000143,0x00000017,0x00000142,0x0004007c,
+0x00000006,0x00000144,0x00000143,0x0003003e,
+0x0000013e,0x00000144,0x0004003d,0x0000000d,
+0x00000146,0x0000003e,0x000500c2,0x0000000d,
+0x00000148,0x00000146,0x00000147,0x0003003e,
+0x00000149,0x00000148,0x00050039,0x0000000d,
+0x0000014a,0x00000017,0x00000149,0x0004007c,
+0x00000006,0x0000014b,0x0000014a,0x0003003e,
+0x00000145,0x0000014b,0x0004003d,0x0000000d,
+0x0000014d,0x0000003e,0x000500c2,0x0000000d,
+0x0000014f,0x0000014d,0x0000014e,0x0003003e,
+0x00000150,0x0000014f,0x00050039,0x0000000d,
+0x00000151,0x00000017,0x00000150,0x0004007c,
+0x00000006,0x00000152,0x00000151,0x0003003e,
+0x0000014c,0x00000152,0x0004003d,0x0000000d,
+0x00000154,0x0000003e,0x000500c2,0x0000000d,
+0x00000155,0x00000154,0x00000096,0x0003003e,
+0x00000156,0x00000155,0x00050039,0x0000000d,
+0x00000157,0x00000017,0x00000156,0x0004007c,
+0x00000006,0x00000158,0x00000157,0x0003003e,
+0x00000153,0x00000158,0x0004003d,0x0000000d,
+0x0000015a,0x0000003e,0x000500c2,0x0000000d,
+0x0000015b,0x0000015a,0x0000007a,0x000500c7,
+0x0000000d,0x0000015c,0x0000015b,0x0000012c,
+0x000500c4,0x0000000d,0x0000015d,0x0000015c,
+0x00000079,0x0004003d,0x0000000d,0x0000015e,
+0x0000003e,0x000500c7,0x0000000d,0x0000015f,
+0x0000015e,0x000000fb,0x000500c5,0x0000000d,
+0x00000160,0x0000015d,0x0000015f,0x0004007c,
+0x00000006,0x00000161,0x00000160,0x0003003e,
+0x00000159,0x00000161,0x0004003d,0x00000006,
+0x00000168,0x00000159,0x0003003e,0x00000169,
+0x00000167,0x00050041,0x00000027,0x0000016a,
+0x00000169,0x00000168,0x0004003d,0x00000006,
+0x0000016b,0x0000016a,0x0003003e,0x00000162,
+0x0000016b,0x0004003d,0x00000006,0x0000016d,
+0x00000128,0x0004003d,0x00000006,0x0000016e,
+0x00000137,0x0004003d,0x00000006,0x0000016f,
+0x0000013e,0x00060050,0x00000007,0x00000170,
+0x0000016d,0x0000016e,0x0000016f,0x00050041,
+0x00000008,0x00000171,0x0000016c,0x00000078,
+0x0003003e,0x00000171,0x00000170,0x0004003d,
+0x00000006,0x00000172,0x00000145,0x0004003d,
+0x00000006,0x00000173,0x00000162,0x00050080,
+0x00000006,0x00000174,0x00000172,0x00000173,
+0x0003003e,0x00000175,0x00000174,0x00050039,
+0x00000006,0x00000176,0x0000002a,0x00000175,
+0x0004003d,0x00000006,0x00000177,0x0000014c,
+0x0004003d,0x00000006,0x00000178,0x00000162,
+0x00050080,0x00000006,0x00000179,0x00000177,
+0x00000178,0x0003003e,0x0000017a,0x00000179,
+0x00050039,0x00000006,0x0000017b,0x0000002a,
+0x0000017a,0x0004003d,0x00000006,0x0000017c,
+0x00000153,0x0004003d,0x00000006,0x0000017d,
+0x00000162,0x00050080,0x00000006,0x0000017e,
+0x0000017c,0x0000017d,0x0003003e,0x0000017f,
+0x0000017e,0x00050039,0x00000006,0x00000180,
+0x0000002a,0x0000017f,0x00060050,0x00000007,
+0x00000181,0x00000176,0x0000017b,0x00000180,
+0x00050041,0x00000008,0x00000182,0x0000016c,
+0x00000079,0x0003003e,0x00000182,0x00000181,
+0x0004003d,0x00000006,0x00000183,0x00000145,
+0x0004003d,0x00000006,0x00000184,0x0000014c,
+0x0004003d,0x00000006,0x00000185,0x00000153,
+0x00060050,0x00000007,0x00000186,0x00000183,
+0x00000184,0x00000185,0x00050041,0x00000008,
+0x00000187,0x0000016c,0x0000007a,0x0003003e,
+0x00000187,0x00000186,0x0004003d,0x00000006,
+0x00000188,0x00000145,0x0004003d,0x00000006,
+0x00000189,0x00000162,0x00050082,0x00000006,
+0x0000018a,0x00000188,0x00000189,0x0003003e,
+0x0000018b,0x0000018a,0x00050039,0x00000006,
+0x0000018c,0x0000002a,0x0000018b,0x0004003d,
+0x00000006,0x0000018d,0x0000014c,0x0004003d,
+0x00000006,0x0000018e,0x00000162,0x00050082,
+0x00000006,0x0000018f,0x0000018d,0x0000018e,
+0x0003003e,0x00000190,0x0000018f,0x00050039,
+0x00000006,0x00000191,0x0000002a,0x00000190,
+0x0004003d,0x00000006,0x00000192,0x00000153,
+0x0004003d,0x00000006,0x00000193,0x00000162,
+0x00050082,0x00000006,0x00000194,0x00000192,
+0x00000193,0x0003003e,0x00000195,0x00000194,
+0x00050039,0x00000006,0x00000196,0x0000002a,
+0x00000195,0x00060050,0x00000007,0x00000197,
+0x0000018c,0x00000191,0x00000196,0x00050041,
+0x00000008,0x00000198,0x0000016c,0x0000007b,
+0x0003003e,0x00000198,0x00000197,0x0004003d,
+0x00000030,0x0000019a,0x0000016c,0x0003003e,
+0x00000199,0x0000019a,0x0004003d,0x0000000d,
+0x0000019c,0x0000003f,0x0003003e,0x0000019b,
+0x0000019c,0x0004003d,0x0000000f,0x0000019e,
+0x00000040,0x0003003e,0x0000019d,0x0000019e,
+0x0004003d,0x0000000f,0x000001a0,0x00000041,
+0x0003003e,0x0000019f,0x000001a0,0x00080039,
+0x00000035,0x000001a1,0x0000003b,0x00000199,
+0x0000019b,0x0000019d,0x0000019f,0x000200fe,
+0x000001a1,0x00010038,0x00050036,0x00000035,
+0x00000048,0x00000000,0x0000003d,0x00030037,
+0x0000000e,0x00000044,0x00030037,0x0000000e,
+0x00000045,0x00030037,0x00000032,0x00000046,
+0x00030037,0x00000032,0x00000047,0x000200f8,
+0x00000049,0x0004003b,0x00000008,0x000001a4,
+0x00000007,0x0004003b,0x0000000e,0x000001a7,
+0x00000007,0x0004003b,0x0000000e,0x000001b2,
+0x00000007,0x0004003b,0x0000000e,0x000001bf,
+0x00000007,0x0004003b,0x00000008,0x000001c3,
+0x00000007,0x0004003b,0x0000000e,0x000001c6,
+0x00000007,0x0004003b,0x0000000e,0x000001cd,
+0x00000007,0x0004003b,0x0000000e,0x000001d3,
+0x00000007,0x0004003b,0x0000000e,0x000001d7,
+0x00000007,0x0004003b,0x00000027,0x000001f7,
+0x00000007,0x0004003b,0x00000084,0x000001f9,
+0x00000007,0x0004003b,0x00000031,0x000001fc,
+0x00000007,0x0004003b,0x00000008,0x00000205,
+0x00000007,0x0004003b,0x00000008,0x00000210,
+0x00000007,0x0004003b,0x00000008,0x0000021b,
+0x00000007,0x0004003b,0x00000008,0x00000226,
+0x00000007,0x0004003b,0x00000031,0x00000229,
+0x00000007,0x0004003b,0x0000000e,0x0000022b,
+0x00000007,0x0004003b,0x00000032,0x0000022d,
+0x00000007,0x0004003b,0x00000032,0x0000022f,
+0x00000007,0x0004003d,0x0000000d,0x000001a5,
+0x00000044,0x000500c2,0x0000000d,0x000001a6,
+0x000001a5,0x0000012a,0x0003003e,0x000001a7,
+0x000001a6,0x00050039,0x0000000d,0x000001a8,
+0x00000017,0x000001a7,0x0004007c,0x00000006,
+0x000001a9,0x000001a8,0x00050041,0x00000027,
+0x000001aa,0x000001a4,0x000000db,0x0003003e,
+0x000001aa,0x000001a9,0x0004003d,0x0000000d,
+0x000001ab,0x00000044,0x000500c2,0x0000000d,
+0x000001ac,0x000001ab,0x00000130,0x000500c4,
+0x0000000d,0x000001ad,0x000001ac,0x00000079,
+0x0004003d,0x0000000d,0x000001ae,0x00000044,
+0x000500c2,0x0000000d,0x000001af,0x000001ae,
+0x00000139,0x000500c7,0x0000000d,0x000001b0,
+0x000001af,0x000000fb,0x000500c5,0x0000000d,
+0x000001b1,0x000001ad,0x000001b0,0x0003003e,
+0x000001b2,0x000001b1,0x00050039,0x0000000d,
+0x000001b3,0x00000017,0x000001b2,0x0004007c,
+0x00000006,0x000001b4,0x000001b3,0x00050041,
+0x00000027,0x000001b5,0x000001a4,0x000000fb,
+0x0003003e,0x000001b5,0x000001b4,0x0004003d,
+0x0000000d,0x000001b6,0x00000044,0x000500c2,
+0x0000000d,0x000001b8,0x000001b6,0x000001b7,
+0x000500c4,0x0000000d,0x000001b9,0x000001b8,
+0x0000007b,0x0004003d,0x0000000d,0x000001ba,
+0x00000044,0x000500c2,0x0000000d,0x000001bc,
+0x000001ba,0x000001bb,0x000500c7,0x0000000d,
+0x000001bd,0x000001bc,0x00000081,0x000500c5,
+0x0000000d,0x000001be,0x000001b9,0x000001bd,
+0x0003003e,0x000001bf,0x000001be,0x00050039,
+0x0000000d,0x000001c0,0x00000017,0x000001bf,
+0x0004007c,0x00000006,0x000001c1,0x000001c0,
+0x00050041,0x00000027,0x000001c2,0x000001a4,
+0x000000f5,0x0003003e,0x000001c2,0x000001c1,
+0x0004003d,0x0000000d,0x000001c4,0x00000044,
+0x000500c2,0x0000000d,0x000001c5,0x000001c4,
+0x00000163,0x0003003e,0x000001c6,0x000001c5,
+0x00050039,0x0000000d,0x000001c7,0x00000017,
+0x000001c6,0x0004007c,0x00000006,0x000001c8,
+0x000001c7,0x00050041,0x00000027,0x000001c9,
+0x000001c3,0x000000db,0x0003003e,0x000001c9,
+0x000001c8,0x0004003d,0x0000000d,0x000001ca,
+0x00000044,0x000500c2,0x0000000d,0x000001cc,
+0x000001ca,0x000001cb,0x0003003e,0x000001cd,
+0x000001cc,0x00050039,0x0000000d,0x000001ce,
+0x00000017,0x000001cd,0x0004007c,0x00000006,
+0x000001cf,0x000001ce,0x00050041,0x00000027,
+0x000001d0,0x000001c3,0x000000fb,0x0003003e,
+0x000001d0,0x000001cf,0x0004003d,0x0000000d,
+0x000001d1,0x00000044,0x000500c2,0x0000000d,
+0x000001d2,0x000001d1,0x0000007b,0x0003003e,
+0x000001d3,0x000001d2,0x00050039,0x0000000d,
+0x000001d4,0x00000017,0x000001d3,0x0004007c,
+0x00000006,0x000001d5,0x000001d4,0x00050041,
+0x00000027,0x000001d6,0x000001c3,0x000000f5,
+0x0003003e,0x000001d6,0x000001d5,0x0004003d,
+0x0000000d,0x000001d8,0x00000044,0x000500c7,
+0x0000000d,0x000001d9,0x000001d8,0x0000002f,
+0x0003003e,0x000001d7,0x000001d9,0x0004003d,
+0x0000000d,0x000001da,0x00000044,0x000500c7,
+0x0000000d,0x000001db,0x000001da,0x000000fb,
+0x000500c4,0x0000000d,0x000001dc,0x000001db,
+0x00000079,0x0004003d,0x0000000d,0x000001dd,
+0x000001d7,0x000500c5,0x0000000d,0x000001de,
+0x000001dd,0x000001dc,0x0003003e,0x000001d7,
+0x000001de,0x00050041,0x00000027,0x000001df,
+0x000001a4,0x000000db,0x0004003d,0x00000006,
+0x000001e0,0x000001df,0x000500c4,0x00000006,
+0x000001e1,0x000001e0,0x00000140,0x00050041,
+0x00000027,0x000001e2,0x000001a4,0x000000fb,
+0x0004003d,0x00000006,0x000001e3,0x000001e2,
+0x000500c4,0x00000006,0x000001e4,0x000001e3,
+0x0000014e,0x000500c5,0x00000006,0x000001e5,
+0x000001e1,0x000001e4,0x00050041,0x00000027,
+0x000001e6,0x000001a4,0x000000f5,0x0004003d,
+0x00000006,0x000001e7,0x000001e6,0x000500c5,
+0x00000006,0x000001e8,0x000001e5,0x000001e7,
+0x00050041,0x00000027,0x000001e9,0x000001c3,
+0x000000db,0x0004003d,0x00000006,0x000001ea,
+0x000001e9,0x000500c4,0x00000006,0x000001eb,
+0x000001ea,0x00000140,0x00050041,0x00000027,
+0x000001ec,0x000001c3,0x000000fb,0x0004003d,
+0x00000006,0x000001ed,0x000001ec,0x000500c4,
+0x00000006,0x000001ee,0x000001ed,0x0000014e,
+0x000500c5,0x00000006,0x000001ef,0x000001eb,
+0x000001ee,0x00050041,0x00000027,0x000001f0,
+0x000001c3,0x000000f5,0x0004003d,0x00000006,
+0x000001f1,0x000001f0,0x000500c5,0x00000006,
+0x000001f2,0x000001ef,0x000001f1,0x000500af,
+0x0000000f,0x000001f3,0x000001e8,0x000001f2,
+0x000600a9,0x0000000d,0x000001f4,0x000001f3,
+0x000000fb,0x000000db,0x0004003d,0x0000000d,
+0x000001f5,0x000001d7,0x000500c5,0x0000000d,
+0x000001f6,0x000001f5,0x000001f4,0x0003003e,
+0x000001d7,0x000001f6,0x0004003d,0x0000000d,
+0x000001f8,0x000001d7,0x0003003e,0x000001f9,
+0x00000167,0x00050041,0x00000027,0x000001fa,
+0x000001f9,0x000001f8,0x0004003d,0x00000006,
+0x000001fb,0x000001fa,0x0003003e,0x000001f7,
+0x000001fb,0x0004003d,0x00000007,0x000001fd,
+0x000001a4,0x00050051,0x00000006,0x000001fe,
+0x000001fd,0x00000000,0x00050051,0x00000006,
+0x000001ff,0x000001fd,0x00000001,0x00050051,
+0x00000006,0x00000200,0x000001fd,0x00000002,
+0x00060050,0x00000007,0x00000201,0x000001fe,
+0x000001ff,0x00000200,0x0004003d,0x00000006,
+0x00000202,0x000001f7,0x00060050,0x00000007,
+0x00000203,0x00000202,0x00000202,0x00000202,
+0x00050080,0x00000007,0x00000204,0x00000201,
+0x00000203,0x0003003e,0x00000205,0x00000204,
+0x00050039,0x00000007,0x00000206,0x0000002d,
+0x00000205,0x00050041,0x00000008,0x00000207,
+0x000001fc,0x00000078,0x0003003e,0x00000207,
+0x00000206,0x0004003d,0x00000007,0x00000208,
+0x000001a4,0x00050051,0x00000006,0x00000209,
+0x00000208,0x00000000,0x00050051,0x00000006,
+0x0000020a,0x00000208,0x00000001,0x00050051,
+0x00000006,0x0000020b,0x00000208,0x00000002,
+0x00060050,0x00000007,0x0000020c,0x00000209,
+0x0000020a,0x0000020b,0x0004003d,0x00000006,
+0x0000020d,0x000001f7,0x00060050,0x00000007,
+0x0000020e,0x0000020d,0x0000020d,0x0000020d,
+0x00050082,0x00000007,0x0000020f,0x0000020c,
+0x0000020e,0x0003003e,0x00000210,0x0000020f,
+0x00050039,0x00000007,0x00000211,0x0000002d,
+0x00000210,0x00050041,0x00000008,0x00000212,
+0x000001fc,0x00000079,0x0003003e,0x00000212,
+0x00000211,0x0004003d,0x00000007,0x00000213,
+0x000001c3,0x00050051,0x00000006,0x00000214,
+0x00000213,0x00000000,0x00050051,0x00000006,
+0x00000215,0x00000213,0x00000001,0x00050051,
+0x00000006,0x00000216,0x00000213,0x00000002,
+0x00060050,0x00000007,0x00000217,0x00000214,
+0x00000215,0x00000216,0x0004003d,0x00000006,
+0x00000218,0x000001f7,0x00060050,0x00000007,
+0x00000219,0x00000218,0x00000218,0x00000218,
+0x00050080,0x00000007,0x0000021a,0x00000217,
+0x00000219,0x0003003e,0x0000021b,0x0000021a,
+0x00050039,0x00000007,0x0000021c,0x0000002d,
+0x0000021b,0x00050041,0x00000008,0x0000021d,
+0x000001fc,0x0000007a,0x0003003e,0x0000021d,
+0x0000021c,0x0004003d,0x00000007,0x0000021e,
+0x000001c3,0x00050051,0x00000006,0x0000021f,
+0x0000021e,0x00000000,0x00050051,0x00000006,
+0x00000220,0x0000021e,0x00000001,0x00050051,
+0x00000006,0x00000221,0x0000021e,0x00000002,
+0x00060050,0x00000007,0x00000222,0x0000021f,
+0x00000220,0x00000221,0x0004003d,0x00000006,
+0x00000223,0x000001f7,0x00060050,0x00000007,
+0x00000224,0x00000223,0x00000223,0x00000223,
+0x00050082,0x00000007,0x00000225,0x00000222,
+0x00000224,0x0003003e,0x00000226,0x00000225,
+0x00050039,0x00000007,0x00000227,0x0000002d,
+0x00000226,0x00050041,0x00000008,0x00000228,
+0x000001fc,0x0000007b,0x0003003e,0x00000228,
+0x00000227,0x0004003d,0x00000030,0x0000022a,
+0x000001fc,0x0003003e,0x00000229,0x0000022a,
+0x0004003d,0x0000000d,0x0000022c,0x00000045,
+0x0003003e,0x0000022b,0x0000022c,0x0004003d,
+0x0000000f,0x0000022e,0x00000046,0x0003003e,
+0x0000022d,0x0000022e,0x0004003d,0x0000000f,
+0x00000230,0x00000047,0x0003003e,0x0000022f,
+0x00000230,0x00080039,0x00000035,0x00000231,
+0x0000003b,0x00000229,0x0000022b,0x0000022d,
+0x0000022f,0x000200fe,0x00000231,0x00010038,
+0x00050036,0x00000035,0x0000004e,0x00000000,
+0x0000004a,0x00030037,0x0000000e,0x0000004b,
+0x00030037,0x0000000e,0x0000004c,0x00030037,
+0x00000032,0x0000004d,0x000200f8,0x0000004f,
+0x0004003b,0x00000008,0x00000234,0x00000007,
+0x0004003b,0x0000000e,0x00000238,0x00000007,
+0x0004003b,0x0000000e,0x00000244,0x00000007,
+0x0004003b,0x0000000e,0x00000255,0x00000007,
+0x0004003b,0x00000008,0x00000259,0x00000007,
+0x0004003b,0x0000000e,0x00000260,0x00000007,
+0x0004003b,0x0000000e,0x00000266,0x00000007,
+0x0004003b,0x0000000e,0x0000026c,0x00000007,
+0x0004003b,0x00000008,0x00000270,0x00000007,
+0x0004003b,0x0000000e,0x00000274,0x00000007,
+0x0004003b,0x0000000e,0x0000027a,0x00000007,
+0x0004003b,0x0000000e,0x0000027e,0x00000007,
+0x0004003b,0x00000027,0x00000283,0x00000007,
+0x0004003b,0x00000027,0x0000028b,0x00000007,
+0x0004003b,0x00000027,0x0000028e,0x00000007,
+0x0004003b,0x00000050,0x00000291,0x00000007,
+0x0004003b,0x00000008,0x000002a8,0x00000007,
+0x0004003d,0x0000000d,0x00000235,0x0000004b,
+0x000500c2,0x0000000d,0x00000237,0x00000235,
+0x00000236,0x0003003e,0x00000238,0x00000237,
+0x00050039,0x0000000d,0x00000239,0x0000001d,
+0x00000238,0x0004007c,0x00000006,0x0000023a,
+0x00000239,0x00050041,0x00000027,0x0000023b,
+0x00000234,0x000000db,0x0003003e,0x0000023b,
+0x0000023a,0x0004003d,0x0000000d,0x0000023c,
+0x0000004b,0x000500c2,0x0000000d,0x0000023d,
+0x0000023c,0x00000130,0x000500c4,0x0000000d,
+0x0000023e,0x0000023d,0x000000b8,0x0004003d,
+0x0000000d,0x0000023f,0x0000004b,0x000500c2,
+0x0000000d,0x00000241,0x0000023f,0x00000240,
+0x000500c7,0x0000000d,0x00000242,0x00000241,
+0x000000a8,0x000500c5,0x0000000d,0x00000243,
+0x0000023e,0x00000242,0x0003003e,0x00000244,
+0x00000243,0x00050039,0x0000000d,0x00000245,
+0x00000020,0x00000244,0x0004007c,0x00000006,
+0x00000246,0x00000245,0x00050041,0x00000027,
+0x00000247,0x00000234,0x000000fb,0x0003003e,
+0x00000247,0x00000246,0x0004003d,0x0000000d,
+0x00000248,0x0000004b,0x000500c2,0x0000000d,
+0x00000249,0x00000248,0x00000140,0x000500c4,
+0x0000000d,0x0000024b,0x00000249,0x0000024a,
+0x0004003d,0x0000000d,0x0000024c,0x0000004b,
+0x000500c2,0x0000000d,0x0000024d,0x0000024c,
+0x00000163,0x000500c7,0x0000000d,0x0000024e,
+0x0000024d,0x0000012c,0x000500c4,0x0000000d,
+0x0000024f,0x0000024e,0x0000007b,0x000500c5,
+0x0000000d,0x00000250,0x0000024b,0x0000024f,
+0x0004003d,0x0000000d,0x00000251,0x0000004b,
+0x000500c2,0x0000000d,0x00000252,0x00000251,
+0x000001cb,0x000500c7,0x0000000d,0x00000253,
+0x00000252,0x00000081,0x000500c5,0x0000000d,
+0x00000254,0x00000250,0x00000253,0x0003003e,
+0x00000255,0x00000254,0x00050039,0x0000000d,
+0x00000256,0x0000001d,0x00000255,0x0004007c,
+0x00000006,0x00000257,0x00000256,0x00050041,
+0x00000027,0x00000258,0x00000234,0x000000f5,
+0x0003003e,0x00000258,0x00000257,0x0004003d,
+0x0000000d,0x0000025a,0x0000004b,0x000500c2,
+0x0000000d,0x0000025b,0x0000025a,0x0000007a,
+0x000500c4,0x0000000d,0x0000025c,0x0000025b,
+0x00000079,0x0004003d,0x0000000d,0x0000025d,
+0x0000004b,0x000500c7,0x0000000d,0x0000025e,
+0x0000025d,0x000000fb,0x000500c5,0x0000000d,
+0x0000025f,0x0000025c,0x0000025e,0x0003003e,
+0x00000260,0x0000025f,0x00050039,0x0000000d,
+0x00000261,0x0000001d,0x00000260,0x0004007c,
+0x00000006,0x00000262,0x00000261,0x00050041,
+0x00000027,0x00000263,0x00000259,0x000000db,
+0x0003003e,0x00000263,0x00000262,0x0004003d,
+0x0000000d,0x00000264,0x0000004c,0x000500c2,
+0x0000000d,0x00000265,0x00000264,0x00000236,
+0x0003003e,0x00000266,0x00000265,0x00050039,
+0x0000000d,0x00000267,0x00000020,0x00000266,
+0x0004007c,0x00000006,0x00000268,0x00000267,
+0x00050041,0x00000027,0x00000269,0x00000259,
+0x000000fb,0x0003003e,0x00000269,0x00000268,
+0x0004003d,0x0000000d,0x0000026a,0x0000004c,
+0x000500c2,0x0000000d,0x0000026b,0x0000026a,
+0x000001b7,0x0003003e,0x0000026c,0x0000026b,
+0x00050039,0x0000000d,0x0000026d,0x0000001d,
+0x0000026c,0x0004007c,0x00000006,0x0000026e,
+0x0000026d,0x00050041,0x00000027,0x0000026f,
+0x00000259,0x000000f5,0x0003003e,0x0000026f,
+0x0000026e,0x0004003d,0x0000000d,0x00000271,
+0x0000004c,0x000500c2,0x0000000d,0x00000273,
+0x00000271,0x00000272,0x0003003e,0x00000274,
+0x00000273,0x00050039,0x0000000d,0x00000275,
+0x0000001d,0x00000274,0x0004007c,0x00000006,
+0x00000276,0x00000275,0x00050041,0x00000027,
+0x00000277,0x00000270,0x000000db,0x0003003e,
+0x00000277,0x00000276,0x0004003d,0x0000000d,
+0x00000278,0x0000004c,0x000500c2,0x0000000d,
+0x00000279,0x00000278,0x000000b8,0x0003003e,
+0x0000027a,0x00000279,0x00050039,0x0000000d,
+0x0000027b,0x00000020,0x0000027a,0x0004007c,
+0x00000006,0x0000027c,0x0000027b,0x00050041,
+0x00000027,0x0000027d,0x00000270,0x000000fb,
+0x0003003e,0x0000027d,0x0000027c,0x0004003d,
+0x0000000d,0x0000027f,0x0000004c,0x0003003e,
+0x0000027e,0x0000027f,0x00050039,0x0000000d,
+0x00000280,0x0000001d,0x0000027e,0x0004007c,
+0x00000006,0x00000281,0x00000280,0x00050041,
+0x00000027,0x00000282,0x00000270,0x000000f5,
+0x0003003e,0x00000282,0x00000281,0x0003003e,
+0x00000283,0x00000078,0x000200f9,0x00000284,
+0x000200f8,0x00000284,0x000400f6,0x00000286,
+0x00000287,0x00000000,0x000200f9,0x00000288,
+0x000200f8,0x00000288,0x0004003d,0x00000006,
+0x00000289,0x00000283,0x000500b1,0x0000000f,
+0x0000028a,0x00000289,0x00000140,0x000400fa,
+0x0000028a,0x00000285,0x00000286,0x000200f8,
+0x00000285,0x0004003d,0x00000006,0x0000028c,
+0x00000283,0x000500c3,0x00000006,0x0000028d,
+0x0000028c,0x0000007a,0x0003003e,0x0000028b,
+0x0000028d,0x0004003d,0x00000006,0x0000028f,
+0x00000283,0x000500c7,0x00000006,0x00000290,
+0x0000028f,0x0000007b,0x0003003e,0x0000028e,
+0x00000290,0x0004003d,0x00000006,0x00000292,
+0x00000283,0x0004003d,0x00000006,0x00000293,
+0x0000028e,0x0004003d,0x00000007,0x00000294,
+0x00000259,0x0004003d,0x00000007,0x00000295,
+0x00000234,0x00050082,0x00000007,0x00000296,
+0x00000294,0x00000295,0x00060050,0x00000007,
+0x00000297,0x00000293,0x00000293,0x00000293,
+0x00050084,0x00000007,0x00000298,0x00000297,
+0x00000296,0x0004003d,0x00000006,0x00000299,
+0x0000028b,0x0004003d,0x00000007,0x0000029a,
+0x00000270,0x0004003d,0x00000007,0x0000029b,
+0x00000234,0x00050082,0x00000007,0x0000029c,
+0x0000029a,0x0000029b,0x00060050,0x00000007,
+0x0000029d,0x00000299,0x00000299,0x00000299,
+0x00050084,0x00000007,0x0000029e,0x0000029d,
+0x0000029c,0x00050080,0x00000007,0x0000029f,
+0x00000298,0x0000029e,0x0004003d,0x00000007,
+0x000002a0,0x00000234,0x00060050,0x00000007,
+0x000002a1,0x00000096,0x00000096,0x00000096,
+0x00050084,0x00000007,0x000002a2,0x000002a1,
+0x000002a0,0x00050080,0x00000007,0x000002a3,
+0x0000029f,0x000002a2,0x00060050,0x00000007,
+0x000002a4,0x0000007a,0x0000007a,0x0000007a,
+0x00050080,0x00000007,0x000002a5,0x000002a3,
+0x000002a4,0x00060050,0x00000007,0x000002a6,
+0x0000007a,0x0000007a,0x0000007a,0x000500c3,
+0x00000007,0x000002a7,0x000002a5,0x000002a6,
+0x0003003e,0x000002a8,0x000002a7,0x00050039,
+0x00000007,0x000002a9,0x0000002d,0x000002a8,
+0x00050051,0x00000006,0x000002aa,0x000002a9,
+0x00000000,0x00050051,0x00000006,0x000002ab,
+0x000002a9,0x00000001,0x00050051,0x00000006,
+0x000002ac,0x000002a9,0x00000002,0x00070050,
+0x00000033,0x000002ad,0x000002aa,0x000002ab,
+0x000002ac,0x000000cc,0x00050041,0x00000051,
+0x000002ae,0x00000291,0x00000292,0x0003003e,
+0x000002ae,0x000002ad,0x0004003d,0x00000006,
+0x000002af,0x00000283,0x00060041,0x00000027,
+0x000002b0,0x00000291,0x000002af,0x0000012c,
+0x0003003e,0x000002b0,0x000000cc,0x000200f9,
+0x00000287,0x000200f8,0x00000287,0x0004003d,
+0x00000006,0x000002b1,0x00000283,0x00050080,
+0x00000006,0x000002b2,0x000002b1,0x00000079,
+0x0003003e,0x00000283,0x000002b2,0x000200f9,
+0x00000284,0x000200f8,0x00000286,0x0004003d,
+0x00000035,0x000002b3,0x00000291,0x000200fe,
+0x000002b3,0x00010038,0x00050036,0x00000002,
+0x0000005d,0x00000000,0x00000052,0x00030037,
+0x00000050,0x00000053,0x00030037,0x00000027,
+0x00000054,0x00030037,0x00000027,0x00000055,
+0x00030037,0x00000027,0x00000056,0x00030037,
+0x00000051,0x00000057,0x00030037,0x0000000e,
+0x00000058,0x00030037,0x00000032,0x00000059,
+0x00030037,0x00000032,0x0000005a,0x00030037,
+0x00000032,0x0000005b,0x00030037,0x00000032,
+0x0000005c,0x000200f8,0x0000005e,0x0004003b,
+0x0000000e,0x000002b6,0x00000007,0x0004003b,
+0x0000000e,0x000002b7,0x00000007,0x0004003b,
+0x00000027,0x000002bf,0x00000007,0x0004003b,
+0x0000000e,0x000002ca,0x00000007,0x0004003b,
+0x0000000e,0x000002d0,0x00000007,0x0004003b,
+0x0000000e,0x000002e1,0x00000007,0x0004003b,
+0x0000000e,0x000002e6,0x00000007,0x0004003b,
+0x0000000e,0x000002ec,0x00000007,0x0004003b,
+0x0000000e,0x000002f1,0x00000007,0x0004003b,
+0x0000000e,0x00000305,0x00000007,0x0004003b,
+0x00000027,0x00000309,0x00000007,0x0004003b,
+0x00000027,0x00000311,0x00000007,0x0004003b,
+0x00000027,0x00000316,0x00000007,0x0004003b,
+0x00000027,0x0000031b,0x00000007,0x0003003e,
+0x000002b6,0x000000db,0x0003003e,0x000002b7,
+0x000000db,0x0004003d,0x0000000f,0x000002b8,
+0x00000059,0x000300f7,0x000002ba,0x00000000,
+0x000400fa,0x000002b8,0x000002b9,0x000002ba,
+0x000200f8,0x000002b9,0x0004003d,0x0000000f,
+0x000002bb,0x0000005a,0x000300f7,0x000002bd,
+0x00000000,0x000400fa,0x000002bb,0x000002bc,
+0x000002be,0x000200f8,0x000002bc,0x0003003e,
+0x000002b7,0x000000f5,0x000200f9,0x000002bd,
+0x000200f8,0x000002be,0x0003003e,0x000002b6,
+0x000000f5,0x000200f9,0x000002bd,0x000200f8,
+0x000002bd,0x000200f9,0x000002ba,0x000200f8,
+0x000002ba,0x0003003e,0x000002bf,0x00000078,
+0x000200f9,0x000002c0,0x000200f8,0x000002c0,
+0x000400f6,0x000002c2,0x000002c3,0x00000000,
+0x000200f9,0x000002c4,0x000200f8,0x000002c4,
+0x0004003d,0x00000006,0x000002c5,0x000002bf,
+0x000500b1,0x0000000f,0x000002c6,0x000002c5,
+0x0000014e,0x000400fa,0x000002c6,0x000002c1,
+0x000002c2,0x000200f8,0x000002c1,0x0004003d,
+0x0000000f,0x000002c7,0x0000005a,0x000300f7,
+0x000002c9,0x00000000,0x000400fa,0x000002c7,
+0x000002c8,0x000002d6,0x000200f8,0x000002c8,
+0x0004003d,0x0000000d,0x000002cb,0x000002b6,
+0x0004003d,0x00000006,0x000002cc,0x000002bf,
+0x000500c3,0x00000006,0x000002cd,0x000002cc,
+0x00000079,0x0004007c,0x0000000d,0x000002ce,
+0x000002cd,0x00050080,0x0000000d,0x000002cf,
+0x000002cb,0x000002ce,0x0003003e,0x000002ca,
+0x000002cf,0x0004003d,0x0000000d,0x000002d1,
+0x000002b7,0x0004003d,0x00000006,0x000002d2,
+0x000002bf,0x000500c7,0x00000006,0x000002d3,
+0x000002d2,0x00000079,0x0004007c,0x0000000d,
+0x000002d4,0x000002d3,0x00050080,0x0000000d,
+0x000002d5,0x000002d1,0x000002d4,0x0003003e,
+0x000002d0,0x000002d5,0x000200f9,0x000002c9,
+0x000200f8,0x000002d6,0x0004003d,0x0000000d,
+0x000002d7,0x000002b6,0x0004003d,0x00000006,
+0x000002d8,0x000002bf,0x000500c3,0x00000006,
+0x000002d9,0x000002d8,0x0000007a,0x0004007c,
+0x0000000d,0x000002da,0x000002d9,0x00050080,
+0x0000000d,0x000002db,0x000002d7,0x000002da,
+0x0003003e,0x000002ca,0x000002db,0x0004003d,
+0x0000000d,0x000002dc,0x000002b7,0x0004003d,
+0x00000006,0x000002dd,0x000002bf,0x000500c7,
+0x00000006,0x000002de,0x000002dd,0x0000007b,
+0x0004007c,0x0000000d,0x000002df,0x000002de,
+0x00050080,0x0000000d,0x000002e0,0x000002dc,
+0x000002df,0x0003003e,0x000002d0,0x000002e0,
+0x000200f9,0x000002c9,0x000200f8,0x000002c9,
+0x0004003d,0x0000000d,0x000002e2,0x000002d0,
+0x0004003d,0x0000000d,0x000002e3,0x000002ca,
+0x00050084,0x0000000d,0x000002e4,0x000002e3,
+0x0000002f,0x00050080,0x0000000d,0x000002e5,
+0x000002e2,0x000002e4,0x0003003e,0x000002e1,
+0x000002e5,0x0004003d,0x0000000d,0x000002e7,
+0x00000058,0x0004003d,0x0000000d,0x000002e8,
+0x000002e1,0x00050080,0x0000000d,0x000002e9,
+0x000002e8,0x00000093,0x000500c2,0x0000000d,
+0x000002ea,0x000002e7,0x000002e9,0x000500c7,
+0x0000000d,0x000002eb,0x000002ea,0x000000f5,
+0x0003003e,0x000002e6,0x000002eb,0x0004003d,
+0x0000000d,0x000002ed,0x00000058,0x0004003d,
+0x0000000d,0x000002ee,0x000002e1,0x000500c2,
+0x0000000d,0x000002ef,0x000002ed,0x000002ee,
+0x000500c7,0x0000000d,0x000002f0,0x000002ef,
+0x000000fb,0x0003003e,0x000002ec,0x000002f0,
+0x0004003d,0x0000000d,0x000002f2,0x000002ca,
+0x0004003d,0x0000000d,0x000002f3,0x000002d0,
+0x00050084,0x0000000d,0x000002f4,0x0000002f,
+0x000002f3,0x00050080,0x0000000d,0x000002f5,
+0x000002f2,0x000002f4,0x0003003e,0x000002f1,
+0x000002f5,0x0004003d,0x0000000f,0x000002f6,
+0x0000005b,0x0004003d,0x0000000f,0x000002f7,
+0x0000005c,0x000400a8,0x0000000f,0x000002f8,
+0x000002f7,0x000500a7,0x0000000f,0x000002f9,
+0x000002f6,0x000002f8,0x0004003d,0x0000000d,
+0x000002fa,0x000002e6,0x000500ab,0x0000000f,
+0x000002fb,0x000002fa,0x000000db,0x000500a7,
+0x0000000f,0x000002fc,0x000002f9,0x000002fb,
+0x0004003d,0x0000000d,0x000002fd,0x000002ec,
+0x000500aa,0x0000000f,0x000002fe,0x000002fd,
+0x000000db,0x000500a7,0x0000000f,0x000002ff,
+0x000002fc,0x000002fe,0x000300f7,0x00000301,
+0x00000000,0x000400fa,0x000002ff,0x00000300,
+0x00000304,0x000200f8,0x00000300,0x0004003d,
+0x0000000d,0x00000302,0x000002f1,0x00050041,
+0x00000051,0x00000303,0x00000053,0x00000302,
+0x0003003e,0x00000303,0x0000010e,0x000200f9,
+0x00000301,0x000200f8,0x00000304,0x0004003d,
+0x0000000d,0x00000306,0x000002ec,0x0004003d,
+0x0000000d,0x00000307,0x000002e6,0x000500c5,
+0x0000000d,0x00000308,0x00000306,0x00000307,
+0x0003003e,0x00000305,0x00000308,0x0004003d,
+0x0000000d,0x0000030a,0x00000305,0x00050041,
+0x00000027,0x0000030b,0x00000057,0x0000030a,
+0x0004003d,0x00000006,0x0000030c,0x0000030b,
+0x0003003e,0x00000309,0x0000030c,0x0004003d,
+0x0000000d,0x0000030d,0x000002f1,0x0004003d,
+0x00000006,0x0000030e,0x00000054,0x0004003d,
+0x00000006,0x0000030f,0x00000309,0x00050080,
+0x00000006,0x00000310,0x0000030e,0x0000030f,
+0x0003003e,0x00000311,0x00000310,0x00050039,
+0x00000006,0x00000312,0x0000002a,0x00000311,
+0x0004003d,0x00000006,0x00000313,0x00000055,
+0x0004003d,0x00000006,0x00000314,0x00000309,
+0x00050080,0x00000006,0x00000315,0x00000313,
+0x00000314,0x0003003e,0x00000316,0x00000315,
+0x00050039,0x00000006,0x00000317,0x0000002a,
+0x00000316,0x0004003d,0x00000006,0x00000318,
+0x00000056,0x0004003d,0x00000006,0x00000319,
+0x00000309,0x00050080,0x00000006,0x0000031a,
+0x00000318,0x00000319,0x0003003e,0x0000031b,
+0x0000031a,0x00050039,0x00000006,0x0000031c,
+0x0000002a,0x0000031b,0x00070050,0x00000033,
+0x0000031d,0x00000312,0x00000317,0x0000031c,
+0x000000cc,0x00050041,0x00000051,0x0000031e,
+0x00000053,0x0000030d,0x0003003e,0x0000031e,
+0x0000031d,0x000200f9,0x00000301,0x000200f8,
+0x00000301,0x000200f9,0x000002c3,0x000200f8,
+0x000002c3,0x0004003d,0x00000006,0x0000031f,
+0x000002bf,0x00050080,0x00000006,0x00000320,
+0x0000031f,0x00000079,0x0003003e,0x000002bf,
+0x00000320,0x000200f9,0x000002c0,0x000200f8,
+0x000002c2,0x000100fd,0x00010038,0x00050036,
+0x00000035,0x00000062,0x00000000,0x0000004a,
+0x00030037,0x0000000e,0x0000005f,0x00030037,
+0x0000000e,0x00000060,0x00030037,0x00000032,
+0x00000061,0x000200f8,0x00000063,0x0004003b,
+0x00000032,0x00000321,0x00000007,0x0004003b,
+0x0000000e,0x00000330,0x00000007,0x0004003b,
+0x0000000e,0x00000333,0x00000007,0x0004003b,
+0x0000000e,0x00000336,0x00000007,0x0004003b,
+0x0000000e,0x0000033b,0x00000007,0x0004003b,
+0x0000000e,0x0000033d,0x00000007,0x0004003b,
+0x0000000e,0x00000341,0x00000007,0x0004003b,
+0x0000000e,0x00000343,0x00000007,0x0004003b,
+0x00000032,0x00000345,0x00000007,0x0004003b,
+0x00000032,0x00000347,0x00000007,0x0004003b,
+0x0000000e,0x0000034d,0x00000007,0x0004003b,
+0x0000000e,0x0000034f,0x00000007,0x0004003b,
+0x0000000e,0x00000353,0x00000007,0x0004003b,
+0x0000000e,0x00000355,0x00000007,0x0004003b,
+0x00000032,0x00000357,0x00000007,0x0004003b,
+0x00000032,0x00000359,0x00000007,0x0004003b,
+0x0000000e,0x0000035f,0x00000007,0x0004003b,
+0x0000000e,0x00000361,0x00000007,0x0004003b,
+0x0000000e,0x00000365,0x00000007,0x0004003b,
+0x0000000e,0x00000367,0x00000007,0x0004003b,
+0x00000032,0x00000369,0x00000007,0x0004003b,
+0x00000027,0x0000036d,0x00000007,0x0004003b,
+0x0000000e,0x0000036e,0x00000007,0x0004003b,
+0x00000027,0x00000372,0x00000007,0x0004003b,
+0x0000000e,0x00000375,0x00000007,0x0004003b,
+0x0000000e,0x00000377,0x00000007,0x0004003b,
+0x00000027,0x0000037a,0x00000007,0x0004003b,
+0x0000000e,0x0000037b,0x00000007,0x0004003b,
+0x00000027,0x0000037f,0x00000007,0x0004003b,
+0x0000000e,0x00000382,0x00000007,0x0004003b,
+0x0000000e,0x00000384,0x00000007,0x0004003b,
+0x00000027,0x00000387,0x00000007,0x0004003b,
+0x0000000e,0x00000388,0x00000007,0x0004003b,
+0x00000027,0x0000038c,0x00000007,0x0004003b,
+0x0000000e,0x0000038f,0x00000007,0x0004003b,
+0x0000000e,0x00000391,0x00000007,0x0004003b,
+0x0000000e,0x00000398,0x00000007,0x0004003b,
+0x0000000e,0x0000039d,0x00000007,0x0004003b,
+0x0000000e,0x000003a2,0x00000007,0x0004003b,
+0x0000000e,0x000003a7,0x00000007,0x0004003b,
+0x0000000e,0x000003ac,0x00000007,0x0004003b,
+0x0000000e,0x000003b1,0x00000007,0x0004003b,
+0x0000000e,0x000003b4,0x00000007,0x0004003b,
+0x0000000e,0x000003b8,0x00000007,0x0004003b,
+0x00000051,0x000003c2,0x00000007,0x0004003b,
+0x000003e7,0x000003e8,0x00000007,0x0004003b,
+0x00000051,0x000003eb,0x00000007,0x0004003b,
+0x000003e7,0x000003ed,0x00000007,0x0004003b,
+0x000003e7,0x000003fb,0x00000007,0x0004003b,
+0x000003e7,0x000003ff,0x00000007,0x0004003b,
+0x00000032,0x00000402,0x00000007,0x0004003b,
+0x00000050,0x00000406,0x00000007,0x0004003b,
+0x00000050,0x00000408,0x00000007,0x0004003b,
+0x00000027,0x0000040a,0x00000007,0x0004003b,
+0x00000027,0x0000040c,0x00000007,0x0004003b,
+0x00000027,0x0000040e,0x00000007,0x0004003b,
+0x00000051,0x00000410,0x00000007,0x0004003b,
+0x0000000e,0x00000412,0x00000007,0x0004003b,
+0x00000032,0x00000414,0x00000007,0x0004003b,
+0x00000032,0x00000415,0x00000007,0x0004003b,
+0x00000032,0x00000417,0x00000007,0x0004003b,
+0x00000032,0x00000419,0x00000007,0x0004003b,
+0x00000050,0x0000041e,0x00000007,0x0004003b,
+0x00000027,0x00000420,0x00000007,0x0004003b,
+0x00000027,0x00000422,0x00000007,0x0004003b,
+0x00000027,0x00000424,0x00000007,0x0004003b,
+0x00000051,0x00000426,0x00000007,0x0004003b,
+0x0000000e,0x00000428,0x00000007,0x0004003b,
+0x00000032,0x0000042a,0x00000007,0x0004003b,
+0x00000032,0x0000042b,0x00000007,0x0004003b,
+0x00000032,0x0000042d,0x00000007,0x0004003b,
+0x00000032,0x0000042f,0x00000007,0x0004003d,
+0x0000000d,0x00000322,0x0000005f,0x000500c2,
+0x0000000d,0x00000323,0x00000322,0x00000079,
+0x000500c7,0x0000000d,0x00000324,0x00000323,
+0x000000fb,0x000500ab,0x0000000f,0x00000325,
+0x00000324,0x000000db,0x0003003e,0x00000321,
+0x00000325,0x0004003d,0x0000000f,0x00000326,
+0x00000061,0x000400a8,0x0000000f,0x00000327,
+0x00000326,0x000300f7,0x00000329,0x00000000,
+0x000400fa,0x00000327,0x00000328,0x00000329,
+0x000200f8,0x00000328,0x0004003d,0x0000000d,
+0x0000032a,0x0000005f,0x000500c7,0x0000000d,
+0x0000032b,0x0000032a,0x000000f5,0x000500ab,
+0x0000000f,0x0000032c,0x0000032b,0x000000db,
+0x000200f9,0x00000329,0x000200f8,0x00000329,
+0x000700f5,0x0000000f,0x0000032d,0x00000326,
+0x00000063,0x0000032c,0x00000328,0x000300f7,
+0x0000032f,0x00000000,0x000400fa,0x0000032d,
+0x0000032e,0x00000394,0x000200f8,0x0000032e,
+0x0004003d,0x0000000d,0x00000331,0x0000005f,
+0x000500c2,0x0000000d,0x00000332,0x00000331,
+0x0000012a,0x0003003e,0x00000330,0x00000332,
+0x0004003d,0x0000000d,0x00000334,0x0000005f,
+0x000500c2,0x0000000d,0x00000335,0x00000334,
+0x000001b7,0x0003003e,0x00000333,0x00000335,
+0x0004003d,0x0000000d,0x00000337,0x0000005f,
+0x000500c2,0x0000000d,0x00000338,0x00000337,
+0x00000163,0x0003003e,0x00000336,0x00000338,
+0x0004003d,0x0000000d,0x00000339,0x0000005f,
+0x000500c2,0x0000000d,0x0000033a,0x00000339,
+0x00000130,0x0004003d,0x0000000d,0x0000033c,
+0x00000330,0x0003003e,0x0000033b,0x0000033c,
+0x0003003e,0x0000033d,0x0000033a,0x00060039,
+0x0000000f,0x0000033e,0x00000013,0x0000033b,
+0x0000033d,0x000300f7,0x00000340,0x00000000,
+0x000400fa,0x0000033e,0x0000033f,0x00000340,
+0x000200f8,0x0000033f,0x0004003d,0x0000000d,
+0x00000342,0x0000005f,0x0003003e,0x00000341,
+0x00000342,0x0004003d,0x0000000d,0x00000344,
+0x00000060,0x0003003e,0x00000343,0x00000344,
+0x0004003d,0x0000000f,0x00000346,0x00000061,
+0x0003003e,0x00000345,0x00000346,0x0004003d,
+0x0000000f,0x00000348,0x00000321,0x0003003e,
+0x00000347,0x00000348,0x00080039,0x00000035,
+0x00000349,0x00000042,0x00000341,0x00000343,
+0x00000345,0x00000347,0x000200fe,0x00000349,
+0x000200f8,0x00000340,0x0004003d,0x0000000d,
+0x0000034b,0x0000005f,0x000500c2,0x0000000d,
+0x0000034c,0x0000034b,0x00000140,0x0004003d,
+0x0000000d,0x0000034e,0x00000333,0x0003003e,
+0x0000034d,0x0000034e,0x0003003e,0x0000034f,
+0x0000034c,0x00060039,0x0000000f,0x00000350,
+0x00000013,0x0000034d,0x0000034f,0x000300f7,
+0x00000352,0x00000000,0x000400fa,0x00000350,
+0x00000351,0x00000352,0x000200f8,0x00000351,
+0x0004003d,0x0000000d,0x00000354,0x0000005f,
+0x0003003e,0x00000353,0x00000354,0x0004003d,
+0x0000000d,0x00000356,0x00000060,0x0003003e,
+0x00000355,0x00000356,0x0004003d,0x0000000f,
+0x00000358,0x00000061,0x0003003e,0x00000357,
+0x00000358,0x0004003d,0x0000000f,0x0000035a,
+0x00000321,0x0003003e,0x00000359,0x0000035a,
+0x00080039,0x00000035,0x0000035b,0x00000048,
+0x00000353,0x00000355,0x00000357,0x00000359,
+0x000200fe,0x0000035b,0x000200f8,0x00000352,
+0x0004003d,0x0000000d,0x0000035d,0x0000005f,
+0x000500c2,0x0000000d,0x0000035e,0x0000035d,
+0x0000014e,0x0004003d,0x0000000d,0x00000360,
+0x00000336,0x0003003e,0x0000035f,0x00000360,
+0x0003003e,0x00000361,0x0000035e,0x00060039,
+0x0000000f,0x00000362,0x00000013,0x0000035f,
+0x00000361,0x000300f7,0x00000364,0x00000000,
+0x000400fa,0x00000362,0x00000363,0x00000364,
+0x000200f8,0x00000363,0x0004003d,0x0000000d,
+0x00000366,0x0000005f,0x0003003e,0x00000365,
+0x00000366,0x0004003d,0x0000000d,0x00000368,
+0x00000060,0x0003003e,0x00000367,0x00000368,
+0x0004003d,0x0000000f,0x0000036a,0x00000061,
+0x0003003e,0x00000369,0x0000036a,0x00070039,
+0x00000035,0x0000036b,0x0000004e,0x00000365,
+0x00000367,0x00000369,0x000200fe,0x0000036b,
+0x000200f8,0x00000364,0x0004003d,0x0000000d,
+0x0000036f,0x00000330,0x0003003e,0x0000036e,
+0x0000036f,0x00050039,0x0000000d,0x00000370,
+0x0000001a,0x0000036e,0x0004007c,0x00000006,
+0x00000371,0x00000370,0x0003003e,0x0000036d,
+0x00000371,0x0004003d,0x0000000d,0x00000373,
+0x0000005f,0x000500c2,0x0000000d,0x00000374,
+0x00000373,0x00000130,0x0004003d,0x0000000d,
+0x00000376,0x00000330,0x0003003e,0x00000375,
+0x00000376,0x0003003e,0x00000377,0x00000374,
+0x00060039,0x0000000d,0x00000378,0x00000025,
+0x00000375,0x00000377,0x0004007c,0x00000006,
+0x00000379,0x00000378,0x0003003e,0x00000372,
+0x00000379,0x0004003d,0x0000000d,0x0000037c,
+0x00000333,0x0003003e,0x0000037b,0x0000037c,
+0x00050039,0x0000000d,0x0000037d,0x0000001a,
+0x0000037b,0x0004007c,0x00000006,0x0000037e,
+0x0000037d,0x0003003e,0x0000037a,0x0000037e,
+0x0004003d,0x0000000d,0x00000380,0x0000005f,
+0x000500c2,0x0000000d,0x00000381,0x00000380,
+0x00000140,0x0004003d,0x0000000d,0x00000383,
+0x00000333,0x0003003e,0x00000382,0x00000383,
+0x0003003e,0x00000384,0x00000381,0x00060039,
+0x0000000d,0x00000385,0x00000025,0x00000382,
+0x00000384,0x0004007c,0x00000006,0x00000386,
+0x00000385,0x0003003e,0x0000037f,0x00000386,
+0x0004003d,0x0000000d,0x00000389,0x00000336,
+0x0003003e,0x00000388,0x00000389,0x00050039,
+0x0000000d,0x0000038a,0x0000001a,0x00000388,
+0x0004007c,0x00000006,0x0000038b,0x0000038a,
+0x0003003e,0x00000387,0x0000038b,0x0004003d,
+0x0000000d,0x0000038d,0x0000005f,0x000500c2,
+0x0000000d,0x0000038e,0x0000038d,0x0000014e,
+0x0004003d,0x0000000d,0x00000390,0x00000336,
+0x0003003e,0x0000038f,0x00000390,0x0003003e,
+0x00000391,0x0000038e,0x00060039,0x0000000d,
+0x00000392,0x00000025,0x0000038f,0x00000391,
+0x0004007c,0x00000006,0x00000393,0x00000392,
+0x0003003e,0x0000038c,0x00000393,0x000200f9,
+0x0000032f,0x000200f8,0x00000394,0x0004003d,
+0x0000000d,0x00000395,0x0000005f,0x000500c2,
+0x0000000d,0x00000397,0x00000395,0x00000396,
+0x0003003e,0x00000398,0x00000397,0x00050039,
+0x0000000d,0x00000399,0x00000017,0x00000398,
+0x0004007c,0x00000006,0x0000039a,0x00000399,
+0x0003003e,0x0000036d,0x0000039a,0x0004003d,
+0x0000000d,0x0000039b,0x0000005f,0x000500c2,
+0x0000000d,0x0000039c,0x0000039b,0x00000130,
+0x0003003e,0x0000039d,0x0000039c,0x00050039,
+0x0000000d,0x0000039e,0x00000017,0x0000039d,
+0x0004007c,0x00000006,0x0000039f,0x0000039e,
+0x0003003e,0x00000372,0x0000039f,0x0004003d,
+0x0000000d,0x000003a0,0x0000005f,0x000500c2,
+0x0000000d,0x000003a1,0x000003a0,0x00000139,
+0x0003003e,0x000003a2,0x000003a1,0x00050039,
+0x0000000d,0x000003a3,0x00000017,0x000003a2,
+0x0004007c,0x00000006,0x000003a4,0x000003a3,
+0x0003003e,0x0000037a,0x000003a4,0x0004003d,
+0x0000000d,0x000003a5,0x0000005f,0x000500c2,
+0x0000000d,0x000003a6,0x000003a5,0x00000140,
+0x0003003e,0x000003a7,0x000003a6,0x00050039,
+0x0000000d,0x000003a8,0x00000017,0x000003a7,
+0x0004007c,0x00000006,0x000003a9,0x000003a8,
+0x0003003e,0x0000037f,0x000003a9,0x0004003d,
+0x0000000d,0x000003aa,0x0000005f,0x000500c2,
+0x0000000d,0x000003ab,0x000003aa,0x00000147,
+0x0003003e,0x000003ac,0x000003ab,0x00050039,
+0x0000000d,0x000003ad,0x00000017,0x000003ac,
+0x0004007c,0x00000006,0x000003ae,0x000003ad,
+0x0003003e,0x00000387,0x000003ae,0x0004003d,
+0x0000000d,0x000003af,0x0000005f,0x000500c2,
+0x0000000d,0x000003b0,0x000003af,0x0000014e,
+0x0003003e,0x000003b1,0x000003b0,0x00050039,
+0x0000000d,0x000003b2,0x00000017,0x000003b1,
+0x0004007c,0x00000006,0x000003b3,0x000003b2,
+0x0003003e,0x0000038c,0x000003b3,0x000200f9,
+0x0000032f,0x000200f8,0x0000032f,0x0004003d,
+0x0000000d,0x000003b5,0x0000005f,0x000500c2,
+0x0000000d,0x000003b6,0x000003b5,0x0000024a,
+0x000500c7,0x0000000d,0x000003b7,0x00000081,
+0x000003b6,0x0003003e,0x000003b4,0x000003b7,
+0x0004003d,0x0000000d,0x000003b9,0x0000005f,
+0x000500c2,0x0000000d,0x000003ba,0x000003b9,
+0x0000007a,0x000500c7,0x0000000d,0x000003bb,
+0x00000081,0x000003ba,0x0003003e,0x000003b8,
+0x000003bb,0x0004003d,0x0000000f,0x000003bc,
+0x00000321,0x0004003d,0x0000000f,0x000003bd,
+0x00000061,0x000400a8,0x0000000f,0x000003be,
+0x000003bd,0x000500a6,0x0000000f,0x000003bf,
+0x000003bc,0x000003be,0x000300f7,0x000003c1,
+0x00000000,0x000400fa,0x000003bf,0x000003c0,
+0x000003f0,0x000200f8,0x000003c0,0x0004003d,
+0x0000000d,0x000003e6,0x000003b4,0x0003003e,
+0x000003e8,0x000003e5,0x00050041,0x00000051,
+0x000003e9,0x000003e8,0x000003e6,0x0004003d,
+0x00000033,0x000003ea,0x000003e9,0x0003003e,
+0x000003c2,0x000003ea,0x0004003d,0x0000000d,
+0x000003ec,0x000003b8,0x0003003e,0x000003ed,
+0x000003e5,0x00050041,0x00000051,0x000003ee,
+0x000003ed,0x000003ec,0x0004003d,0x00000033,
+0x000003ef,0x000003ee,0x0003003e,0x000003eb,
+0x000003ef,0x000200f9,0x000003c1,0x000200f8,
+0x000003f0,0x0004003d,0x0000000d,0x000003fa,
+0x000003b4,0x0003003e,0x000003fb,0x000003f9,
+0x00050041,0x00000051,0x000003fc,0x000003fb,
+0x000003fa,0x0004003d,0x00000033,0x000003fd,
+0x000003fc,0x0003003e,0x000003c2,0x000003fd,
+0x0004003d,0x0000000d,0x000003fe,0x000003b8,
+0x0003003e,0x000003ff,0x000003f9,0x00050041,
+0x00000051,0x00000400,0x000003ff,0x000003fe,
+0x0004003d,0x00000033,0x00000401,0x00000400,
+0x0003003e,0x000003eb,0x00000401,0x000200f9,
+0x000003c1,0x000200f8,0x000003c1,0x0004003d,
+0x0000000d,0x00000403,0x0000005f,0x000500c7,
+0x0000000d,0x00000404,0x00000403,0x000000fb,
+0x000500ab,0x0000000f,0x00000405,0x00000404,
+0x000000db,0x0003003e,0x00000402,0x00000405,
+0x0004003d,0x00000035,0x00000409,0x00000406,
+0x0003003e,0x00000408,0x00000409,0x0004003d,
+0x00000006,0x0000040b,0x0000036d,0x0003003e,
+0x0000040a,0x0000040b,0x0004003d,0x00000006,
+0x0000040d,0x0000037a,0x0003003e,0x0000040c,
+0x0000040d,0x0004003d,0x00000006,0x0000040f,
+0x00000387,0x0003003e,0x0000040e,0x0000040f,
+0x0004003d,0x00000033,0x00000411,0x000003c2,
+0x0003003e,0x00000410,0x00000411,0x0004003d,
+0x0000000d,0x00000413,0x00000060,0x0003003e,
+0x00000412,0x00000413,0x0003003e,0x00000414,
+0x00000407,0x0004003d,0x0000000f,0x00000416,
+0x00000402,0x0003003e,0x00000415,0x00000416,
+0x0004003d,0x0000000f,0x00000418,0x00000061,
+0x0003003e,0x00000417,0x00000418,0x0004003d,
+0x0000000f,0x0000041a,0x00000321,0x0003003e,
+0x00000419,0x0000041a,0x000e0039,0x00000002,
+0x0000041b,0x0000005d,0x00000408,0x0000040a,
+0x0000040c,0x0000040e,0x00000410,0x00000412,
+0x00000414,0x00000415,0x00000417,0x00000419,
+0x0004003d,0x00000035,0x0000041c,0x00000408,
+0x0003003e,0x00000406,0x0000041c,0x0004003d,
+0x00000035,0x0000041f,0x00000406,0x0003003e,
+0x0000041e,0x0000041f,0x0004003d,0x00000006,
+0x00000421,0x00000372,0x0003003e,0x00000420,
+0x00000421,0x0004003d,0x00000006,0x00000423,
+0x0000037f,0x0003003e,0x00000422,0x00000423,
+0x0004003d,0x00000006,0x00000425,0x0000038c,
+0x0003003e,0x00000424,0x00000425,0x0004003d,
+0x00000033,0x00000427,0x000003eb,0x0003003e,
+0x00000426,0x00000427,0x0004003d,0x0000000d,
+0x00000429,0x00000060,0x0003003e,0x00000428,
+0x00000429,0x0003003e,0x0000042a,0x0000041d,
+0x0004003d,0x0000000f,0x0000042c,0x00000402,
+0x0003003e,0x0000042b,0x0000042c,0x0004003d,
+0x0000000f,0x0000042e,0x00000061,0x0003003e,
+0x0000042d,0x0000042e,0x0004003d,0x0000000f,
+0x00000430,0x00000321,0x0003003e,0x0000042f,
+0x00000430,0x000e0039,0x00000002,0x00000431,
+0x0000005d,0x0000041e,0x00000420,0x00000422,
+0x00000424,0x00000426,0x00000428,0x0000042a,
+0x0000042b,0x0000042d,0x0000042f,0x0004003d,
+0x00000035,0x00000432,0x0000041e,0x0003003e,
+0x00000406,0x00000432,0x0004003d,0x00000035,
+0x00000433,0x00000406,0x000200fe,0x00000433,
+0x00010038,0x00050036,0x00000064,0x00000069,
+0x00000000,0x00000065,0x00030037,0x0000000e,
+0x00000066,0x00030037,0x0000000e,0x00000067,
+0x00030037,0x00000032,0x00000068,0x000200f8,
+0x0000006a,0x0004003b,0x00000027,0x00000436,
+0x00000007,0x0004003b,0x00000027,0x0000043c,
+0x00000007,0x0004003b,0x0000000e,0x00000442,
+0x00000007,0x0004003b,0x00000051,0x00000446,
+0x00000007,0x0004003b,0x00000474,0x00000475,
+0x00000007,0x0004003b,0x00000051,0x00000478,
+0x00000007,0x0004003b,0x00000474,0x0000047c,
+0x00000007,0x0004003b,0x0000047f,0x00000480,
+0x00000007,0x0004003b,0x0000000e,0x000004a6,
+0x00000007,0x0004003b,0x0000000e,0x000004ae,
+0x00000007,0x0004003b,0x0000000e,0x000004b5,
+0x00000007,0x0004003b,0x00000027,0x000004ba,
+0x00000007,0x0004003b,0x00000027,0x000004bd,
+0x00000007,0x0004003b,0x00000027,0x000004c9,
+0x00000007,0x0004003b,0x0000047f,0x000004cf,
+0x00000007,0x0004003b,0x00000027,0x000004d1,
+0x00000007,0x0004003d,0x0000000d,0x00000437,
+0x00000066,0x000500c2,0x0000000d,0x00000438,
+0x00000437,0x00000130,0x0004007c,0x00000006,
+0x00000439,0x00000438,0x0003003e,0x00000436,
+0x00000439,0x0004003d,0x00000006,0x0000043a,
+0x00000436,0x000500c7,0x00000006,0x0000043b,
+0x0000043a,0x000000cc,0x0003003e,0x00000436,
+0x0000043b,0x0004003d,0x0000000d,0x0000043d,
+0x00000066,0x000500c2,0x0000000d,0x0000043e,
+0x0000043d,0x00000139,0x0004007c,0x00000006,
+0x0000043f,0x0000043e,0x0003003e,0x0000043c,
+0x0000043f,0x0004003d,0x00000006,0x00000440,
+0x0000043c,0x000500c7,0x00000006,0x00000441,
+0x00000440,0x000001bb,0x0003003e,0x0000043c,
+0x00000441,0x0004003d,0x0000000d,0x00000443,
+0x00000066,0x000500c2,0x0000000d,0x00000444,
+0x00000443,0x00000140,0x000500c7,0x0000000d,
+0x00000445,0x00000444,0x00000093,0x0003003e,
+0x00000442,0x00000445,0x0004003d,0x0000000d,
+0x00000472,0x00000442,0x00050084,0x0000000d,
+0x00000473,0x00000472,0x000000f5,0x0003003e,
+0x00000475,0x00000471,0x00050041,0x00000051,
+0x00000476,0x00000475,0x00000473,0x0004003d,
+0x00000033,0x00000477,0x00000476,0x0003003e,
+0x00000446,0x00000477,0x0004003d,0x0000000d,
+0x00000479,0x00000442,0x00050084,0x0000000d,
+0x0000047a,0x00000479,0x000000f5,0x00050080,
+0x0000000d,0x0000047b,0x0000047a,0x000000fb,
+0x0003003e,0x0000047c,0x00000471,0x00050041,
+0x00000051,0x0000047d,0x0000047c,0x0000047b,
+0x0004003d,0x00000033,0x0000047e,0x0000047d,
+0x0003003e,0x00000478,0x0000047e,0x0004003d,
+0x0000000d,0x00000481,0x00000066,0x000500c2,
+0x0000000d,0x00000482,0x00000481,0x00000272,
+0x0004003d,0x0000000d,0x00000483,0x00000066,
+0x000500c2,0x0000000d,0x00000484,0x00000483,
+0x0000045b,0x0004003d,0x0000000d,0x00000485,
+0x00000066,0x000500c2,0x0000000d,0x00000486,
+0x00000485,0x000001cb,0x0004003d,0x0000000d,
+0x00000487,0x00000066,0x000500c2,0x0000000d,
+0x00000488,0x00000487,0x00000096,0x0004003d,
+0x0000000d,0x00000489,0x00000066,0x000500c2,
+0x0000000d,0x0000048a,0x00000489,0x00000079,
+0x0004003d,0x0000000d,0x0000048b,0x00000066,
+0x000500c4,0x0000000d,0x0000048c,0x0000048b,
+0x0000007a,0x0004003d,0x0000000d,0x0000048d,
+0x00000067,0x000500c2,0x0000000d,0x0000048f,
+0x0000048d,0x0000048e,0x000500c5,0x0000000d,
+0x00000490,0x0000048c,0x0000048f,0x0004003d,
+0x0000000d,0x00000491,0x00000067,0x000500c2,
+0x0000000d,0x00000492,0x00000491,0x0000012a,
+0x0004003d,0x0000000d,0x00000493,0x00000067,
+0x000500c2,0x0000000d,0x00000494,0x00000493,
+0x00000130,0x0004003d,0x0000000d,0x00000495,
+0x00000067,0x000500c2,0x0000000d,0x00000497,
+0x00000495,0x00000496,0x0004003d,0x0000000d,
+0x00000498,0x00000067,0x000500c2,0x0000000d,
+0x00000499,0x00000498,0x000003d2,0x0004003d,
+0x0000000d,0x0000049a,0x00000067,0x000500c2,
+0x0000000d,0x0000049b,0x0000049a,0x000001bb,
+0x0004003d,0x0000000d,0x0000049c,0x00000067,
+0x000500c2,0x0000000d,0x0000049d,0x0000049c,
+0x00000147,0x0004003d,0x0000000d,0x0000049e,
+0x00000067,0x000500c2,0x0000000d,0x0000049f,
+0x0000049e,0x000003c9,0x0004003d,0x0000000d,
+0x000004a0,0x00000067,0x000500c2,0x0000000d,
+0x000004a1,0x000004a0,0x000000b8,0x0004003d,
+0x0000000d,0x000004a2,0x00000067,0x000500c2,
+0x0000000d,0x000004a3,0x000004a2,0x0000007b,
+0x0004003d,0x0000000d,0x000004a4,0x00000067,
+0x00130050,0x00000064,0x000004a5,0x00000482,
+0x00000484,0x00000486,0x00000488,0x0000048a,
+0x00000490,0x00000492,0x00000494,0x00000497,
+0x00000499,0x0000049b,0x0000049d,0x0000049f,
+0x000004a1,0x000004a3,0x000004a4,0x0003003e,
+0x00000480,0x000004a5,0x0003003e,0x000004a6,
+0x000000db,0x000200f9,0x000004a7,0x000200f8,
+0x000004a7,0x000400f6,0x000004a9,0x000004aa,
+0x00000000,0x000200f9,0x000004ab,0x000200f8,
+0x000004ab,0x0004003d,0x0000000d,0x000004ac,
+0x000004a6,0x000500b0,0x0000000f,0x000004ad,
+0x000004ac,0x00000034,0x000400fa,0x000004ad,
+0x000004a8,0x000004a9,0x000200f8,0x000004a8,
+0x0004003d,0x0000000d,0x000004af,0x000004a6,
+0x00050089,0x0000000d,0x000004b0,0x000004af,
+0x0000002f,0x00050084,0x0000000d,0x000004b1,
+0x000004b0,0x0000002f,0x0004003d,0x0000000d,
+0x000004b2,0x000004a6,0x00050086,0x0000000d,
+0x000004b3,0x000004b2,0x0000002f,0x00050080,
+0x0000000d,0x000004b4,0x000004b1,0x000004b3,
+0x0003003e,0x000004ae,0x000004b4,0x0004003d,
+0x0000000d,0x000004b6,0x000004a6,0x00050041,
+0x0000000e,0x000004b7,0x00000480,0x000004b6,
+0x0004003d,0x0000000d,0x000004b8,0x000004b7,
+0x000500c7,0x0000000d,0x000004b9,0x000004b8,
+0x00000081,0x0003003e,0x000004b5,0x000004b9,
+0x0004003d,0x0000000d,0x000004bb,0x000004b5,
+0x000500ae,0x0000000f,0x000004bc,0x000004bb,
+0x0000002f,0x000300f7,0x000004bf,0x00000000,
+0x000400fa,0x000004bc,0x000004be,0x000004c4,
+0x000200f8,0x000004be,0x0004003d,0x0000000d,
+0x000004c0,0x000004b5,0x00050082,0x0000000d,
+0x000004c1,0x000004c0,0x0000002f,0x00050041,
+0x00000027,0x000004c2,0x00000478,0x000004c1,
+0x0004003d,0x00000006,0x000004c3,0x000004c2,
+0x0003003e,0x000004bd,0x000004c3,0x000200f9,
+0x000004bf,0x000200f8,0x000004c4,0x0004003d,
+0x0000000d,0x000004c5,0x000004b5,0x00050041,
+0x00000027,0x000004c6,0x00000446,0x000004c5,
+0x0004003d,0x00000006,0x000004c7,0x000004c6,
+0x0003003e,0x000004bd,0x000004c7,0x000200f9,
+0x000004bf,0x000200f8,0x000004bf,0x0004003d,
+0x00000006,0x000004c8,0x000004bd,0x0003003e,
+0x000004ba,0x000004c8,0x0004003d,0x00000006,
+0x000004ca,0x00000436,0x0004003d,0x00000006,
+0x000004cb,0x000004ba,0x0004003d,0x00000006,
+0x000004cc,0x0000043c,0x00050084,0x00000006,
+0x000004cd,0x000004cb,0x000004cc,0x00050080,
+0x00000006,0x000004ce,0x000004ca,0x000004cd,
+0x0003003e,0x000004c9,0x000004ce,0x0004003d,
+0x0000000d,0x000004d0,0x000004ae,0x0004003d,
+0x00000006,0x000004d2,0x000004c9,0x0003003e,
+0x000004d1,0x000004d2,0x00050039,0x00000006,
+0x000004d3,0x0000002a,0x000004d1,0x0004007c,
+0x0000000d,0x000004d4,0x000004d3,0x00050041,
+0x0000000e,0x000004d5,0x000004cf,0x000004d0,
+0x0003003e,0x000004d5,0x000004d4,0x000200f9,
+0x000004aa,0x000200f8,0x000004aa,0x0004003d,
+0x0000000d,0x000004d6,0x000004a6,0x00050080,
+0x0000000d,0x000004d7,0x000004d6,0x00000079,
+0x0003003e,0x000004a6,0x000004d7,0x000200f9,
+0x000004a7,0x000200f8,0x000004a9,0x0004003d,
+0x00000064,0x000004d8,0x000004cf,0x000200fe,
+0x000004d8,0x00010038,0x00050036,0x0000000d,
+0x0000006c,0x00000000,0x00000015,0x00030037,
+0x0000000e,0x0000006b,0x000200f8,0x0000006d,
+0x0004003d,0x0000000d,0x000004db,0x0000006b,
+0x000500c7,0x0000000d,0x000004dd,0x000004db,
+0x000004dc,0x000500c4,0x0000000d,0x000004de,
+0x000004dd,0x00000130,0x0004003d,0x0000000d,
+0x000004df,0x0000006b,0x000500c7,0x0000000d,
+0x000004e1,0x000004df,0x000004e0,0x000500c4,
+0x0000000d,0x000004e2,0x000004e1,0x0000014e,
+0x000500c5,0x0000000d,0x000004e3,0x000004de,
+0x000004e2,0x0004003d,0x0000000d,0x000004e4,
+0x0000006b,0x000500c7,0x0000000d,0x000004e6,
+0x000004e4,0x000004e5,0x000500c2,0x0000000d,
+0x000004e7,0x000004e6,0x0000014e,0x000500c5,
+0x0000000d,0x000004e8,0x000004e3,0x000004e7,
+0x0004003d,0x0000000d,0x000004e9,0x0000006b,
+0x000500c7,0x0000000d,0x000004eb,0x000004e9,
+0x000004ea,0x000500c2,0x0000000d,0x000004ec,
+0x000004eb,0x00000130,0x000500c5,0x0000000d,
+0x000004ed,0x000004e8,0x000004ec,0x000200fe,
+0x000004ed,0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_3D.inl b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_3D.inl
new file mode 100644
index 00000000000..a6fe9a1d61b
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/shaders/compiled/Etc2RGBA8_3D.inl
@@ -0,0 +1,2070 @@
+0x07230203,0x00010300,0x000d000b,0x00000575,
+0x00000000,0x00020011,0x00000001,0x0006000b,
+0x00000001,0x4c534c47,0x6474732e,0x3035342e,
+0x00000000,0x0003000e,0x00000000,0x00000001,
+0x0006000f,0x00000005,0x00000004,0x6e69616d,
+0x00000000,0x000004f3,0x00060010,0x00000004,
+0x00000011,0x00000008,0x00000008,0x00000001,
+0x00030003,0x00000002,0x000001c2,0x000a0004,
+0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
+0x5f656c79,0x656e696c,0x7269645f,0x69746365,
+0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
+0x6e695f45,0x64756c63,0x69645f65,0x74636572,
+0x00657669,0x00040005,0x00000004,0x6e69616d,
+0x00000000,0x00060005,0x0000000b,0x50746567,
+0x4433736f,0x33697628,0x0000003b,0x00030005,
+0x0000000a,0x00736f70,0x00070005,0x00000013,
+0x764f7369,0x6c667265,0x6465776f,0x3b317528,
+0x003b3175,0x00040005,0x00000011,0x65736162,
+0x00000000,0x00040005,0x00000012,0x66666964,
+0x00000000,0x00060005,0x00000017,0x766e6f63,
+0x34747265,0x28386f54,0x003b3175,0x00030005,
+0x00000016,0x00000062,0x00060005,0x0000001a,
+0x766e6f63,0x35747265,0x28386f54,0x003b3175,
+0x00030005,0x00000019,0x00000062,0x00060005,
+0x0000001d,0x766e6f63,0x36747265,0x28386f54,
+0x003b3175,0x00030005,0x0000001c,0x00000062,
+0x00060005,0x00000020,0x766e6f63,0x37747265,
+0x28386f54,0x003b3175,0x00030005,0x0000001f,
+0x00000062,0x00070005,0x00000025,0x766e6f63,
+0x44747265,0x28666669,0x753b3175,0x00003b31,
+0x00040005,0x00000023,0x65736162,0x00000000,
+0x00040005,0x00000024,0x66666964,0x00000000,
+0x00050005,0x0000002a,0x616c635f,0x6928706d,
+0x00003b31,0x00030005,0x00000029,0x00000078,
+0x00050005,0x0000002d,0x616c635f,0x7628706d,
+0x003b3369,0x00030005,0x0000002c,0x00000078,
+0x000a0005,0x0000003b,0x32637465,0x485f545f,
+0x646e695f,0x76287865,0x345b3369,0x31753b5d,
+0x3b31623b,0x003b3162,0x00050005,0x00000037,
+0x54726c63,0x656c6261,0x00000000,0x00030005,
+0x00000038,0x00776f6c,0x00070005,0x00000039,
+0x75507369,0x7468636e,0x756f7268,0x6c416867,
+0x00616870,0x00040005,0x0000003a,0x7161706f,
+0x00006575,0x000b0005,0x00000042,0x32637465,
+0x6365645f,0x5f65646f,0x636f6c62,0x28545f6b,
+0x753b3175,0x31623b31,0x3b31623b,0x00000000,
+0x00040005,0x0000003e,0x68676968,0x00000000,
+0x00030005,0x0000003f,0x00776f6c,0x00070005,
+0x00000040,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00040005,0x00000041,
+0x7161706f,0x00006575,0x000b0005,0x00000048,
+0x32637465,0x6365645f,0x5f65646f,0x636f6c62,
+0x28485f6b,0x753b3175,0x31623b31,0x3b31623b,
+0x00000000,0x00040005,0x00000044,0x68676968,
+0x00000000,0x00030005,0x00000045,0x00776f6c,
+0x00070005,0x00000046,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00040005,
+0x00000047,0x7161706f,0x00006575,0x000a0005,
+0x0000004e,0x32637465,0x6365645f,0x5f65646f,
+0x636f6c62,0x28505f6b,0x753b3175,0x31623b31,
+0x0000003b,0x00040005,0x0000004b,0x68676968,
+0x00000000,0x00030005,0x0000004c,0x00776f6c,
+0x00070005,0x0000004d,0x75507369,0x7468636e,
+0x756f7268,0x6c416867,0x00616870,0x00100005,
+0x0000005d,0x6f636564,0x735f6564,0x6c626275,
+0x286b636f,0x5b346976,0x3b5d3631,0x693b3169,
+0x31693b31,0x3469763b,0x3b31753b,0x623b3162,
+0x31623b31,0x3b31623b,0x00000000,0x00040005,
+0x00000053,0x74754f70,0x00000000,0x00030005,
+0x00000054,0x00000072,0x00030005,0x00000055,
+0x00000067,0x00030005,0x00000056,0x00000062,
+0x00040005,0x00000057,0x6c626174,0x00000065,
+0x00030005,0x00000058,0x00776f6c,0x00040005,
+0x00000059,0x6f636573,0x0000646e,0x00040005,
+0x0000005a,0x70696c66,0x00646570,0x00070005,
+0x0000005b,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x00040005,0x0000005c,
+0x7161706f,0x00006575,0x000a0005,0x00000062,
+0x32637465,0x6365645f,0x5f65646f,0x5f626772,
+0x636f6c62,0x3175286b,0x3b31753b,0x003b3162,
+0x00040005,0x0000005f,0x68676968,0x00000000,
+0x00030005,0x00000060,0x00776f6c,0x00070005,
+0x00000061,0x75507369,0x7468636e,0x756f7268,
+0x6c416867,0x00616870,0x000d0005,0x00000069,
+0x5f636165,0x6f636564,0x735f6564,0x6c676e69,
+0x68635f65,0x656e6e61,0x6c625f6c,0x286b636f,
+0x753b3175,0x31623b31,0x0000003b,0x00040005,
+0x00000066,0x68676968,0x00000000,0x00030005,
+0x00000067,0x00776f6c,0x00050005,0x00000068,
+0x69537369,0x64656e67,0x00000000,0x00050005,
+0x0000006c,0x70696c66,0x75283233,0x00003b31,
+0x00030005,0x0000006b,0x00000061,0x00030005,
+0x00000071,0x006c6176,0x00050005,0x00000085,
+0x65646e69,0x6c626178,0x00000065,0x00030005,
+0x00000091,0x00000063,0x00030005,0x0000009c,
+0x00000063,0x00030005,0x000000a6,0x00000063,
+0x00030005,0x000000b1,0x00000063,0x00050005,
+0x000000c2,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x000000c7,0x61726170,0x0000006d,
+0x00030005,0x000000da,0x00000079,0x00030005,
+0x000000e3,0x00000078,0x00030005,0x000000eb,
+0x0000006b,0x00030005,0x000000f0,0x0062736d,
+0x00030005,0x000000f7,0x0062736c,0x00030005,
+0x00000109,0x00746572,0x00040005,0x00000111,
+0x7366666f,0x00007465,0x00030005,0x00000128,
+0x00003172,0x00040005,0x00000134,0x61726170,
+0x0000006d,0x00030005,0x00000137,0x00003167,
+0x00040005,0x0000013b,0x61726170,0x0000006d,
+0x00030005,0x0000013e,0x00003162,0x00040005,
+0x00000142,0x61726170,0x0000006d,0x00030005,
+0x00000145,0x00003272,0x00040005,0x00000149,
+0x61726170,0x0000006d,0x00030005,0x0000014c,
+0x00003267,0x00040005,0x00000150,0x61726170,
+0x0000006d,0x00030005,0x00000153,0x00003262,
+0x00040005,0x00000156,0x61726170,0x0000006d,
+0x00050005,0x00000159,0x65746e69,0x4965736e,
+0x00007864,0x00050005,0x00000162,0x65746e69,
+0x4d65736e,0x0000646f,0x00050005,0x00000169,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x0000016c,0x54726c63,0x656c6261,0x00000000,
+0x00040005,0x00000175,0x61726170,0x0000006d,
+0x00040005,0x0000017a,0x61726170,0x0000006d,
+0x00040005,0x0000017f,0x61726170,0x0000006d,
+0x00040005,0x0000018b,0x61726170,0x0000006d,
+0x00040005,0x00000190,0x61726170,0x0000006d,
+0x00040005,0x00000195,0x61726170,0x0000006d,
+0x00040005,0x00000199,0x61726170,0x0000006d,
+0x00040005,0x0000019b,0x61726170,0x0000006d,
+0x00040005,0x0000019d,0x61726170,0x0000006d,
+0x00040005,0x0000019f,0x61726170,0x0000006d,
+0x00040005,0x000001a4,0x31626772,0x00000000,
+0x00040005,0x000001a7,0x61726170,0x0000006d,
+0x00040005,0x000001b2,0x61726170,0x0000006d,
+0x00040005,0x000001bf,0x61726170,0x0000006d,
+0x00040005,0x000001c3,0x32626772,0x00000000,
+0x00040005,0x000001c6,0x61726170,0x0000006d,
+0x00040005,0x000001cd,0x61726170,0x0000006d,
+0x00040005,0x000001d3,0x61726170,0x0000006d,
+0x00050005,0x000001d7,0x65746e69,0x4965736e,
+0x00007864,0x00050005,0x000001f7,0x65746e69,
+0x4d65736e,0x0000646f,0x00050005,0x000001f9,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x000001fc,0x54726c63,0x656c6261,0x00000000,
+0x00040005,0x00000205,0x61726170,0x0000006d,
+0x00040005,0x00000210,0x61726170,0x0000006d,
+0x00040005,0x0000021b,0x61726170,0x0000006d,
+0x00040005,0x00000226,0x61726170,0x0000006d,
+0x00040005,0x00000229,0x61726170,0x0000006d,
+0x00040005,0x0000022b,0x61726170,0x0000006d,
+0x00040005,0x0000022d,0x61726170,0x0000006d,
+0x00040005,0x0000022f,0x61726170,0x0000006d,
+0x00040005,0x00000234,0x6f626772,0x00000000,
+0x00040005,0x00000238,0x61726170,0x0000006d,
+0x00040005,0x00000244,0x61726170,0x0000006d,
+0x00040005,0x00000255,0x61726170,0x0000006d,
+0x00040005,0x00000259,0x68626772,0x00000000,
+0x00040005,0x00000260,0x61726170,0x0000006d,
+0x00040005,0x00000266,0x61726170,0x0000006d,
+0x00040005,0x0000026c,0x61726170,0x0000006d,
+0x00040005,0x00000270,0x76626772,0x00000000,
+0x00040005,0x00000274,0x61726170,0x0000006d,
+0x00040005,0x0000027a,0x61726170,0x0000006d,
+0x00040005,0x0000027e,0x61726170,0x0000006d,
+0x00030005,0x00000283,0x00000069,0x00030005,
+0x0000028b,0x00000079,0x00030005,0x0000028e,
+0x00000078,0x00030005,0x00000291,0x00746572,
+0x00040005,0x000002a8,0x61726170,0x0000006d,
+0x00040005,0x000002b6,0x65736162,0x00000058,
+0x00040005,0x000002b7,0x65736162,0x00000059,
+0x00030005,0x000002bf,0x00000069,0x00030005,
+0x000002ca,0x00000078,0x00030005,0x000002d0,
+0x00000079,0x00030005,0x000002e1,0x0000006b,
+0x00030005,0x000002e6,0x0062736d,0x00030005,
+0x000002ec,0x0062736c,0x00030005,0x000002f1,
+0x00000071,0x00040005,0x00000305,0x7366666f,
+0x00007465,0x00040005,0x00000309,0x746c6564,
+0x00000061,0x00040005,0x00000311,0x61726170,
+0x0000006d,0x00040005,0x00000316,0x61726170,
+0x0000006d,0x00040005,0x0000031b,0x61726170,
+0x0000006d,0x00040005,0x00000321,0x7161706f,
+0x00006575,0x00040005,0x00000330,0x73614272,
+0x00000065,0x00040005,0x00000333,0x73614267,
+0x00000065,0x00040005,0x00000336,0x73614262,
+0x00000065,0x00040005,0x0000033b,0x61726170,
+0x0000006d,0x00040005,0x0000033d,0x61726170,
+0x0000006d,0x00040005,0x00000341,0x61726170,
+0x0000006d,0x00040005,0x00000343,0x61726170,
+0x0000006d,0x00040005,0x00000345,0x61726170,
+0x0000006d,0x00040005,0x00000347,0x61726170,
+0x0000006d,0x00040005,0x0000034d,0x61726170,
+0x0000006d,0x00040005,0x0000034f,0x61726170,
+0x0000006d,0x00040005,0x00000353,0x61726170,
+0x0000006d,0x00040005,0x00000355,0x61726170,
+0x0000006d,0x00040005,0x00000357,0x61726170,
+0x0000006d,0x00040005,0x00000359,0x61726170,
+0x0000006d,0x00040005,0x0000035f,0x61726170,
+0x0000006d,0x00040005,0x00000361,0x61726170,
+0x0000006d,0x00040005,0x00000365,0x61726170,
+0x0000006d,0x00040005,0x00000367,0x61726170,
+0x0000006d,0x00040005,0x00000369,0x61726170,
+0x0000006d,0x00030005,0x0000036d,0x00003172,
+0x00040005,0x0000036e,0x61726170,0x0000006d,
+0x00030005,0x00000372,0x00003272,0x00040005,
+0x00000375,0x61726170,0x0000006d,0x00040005,
+0x00000377,0x61726170,0x0000006d,0x00030005,
+0x0000037a,0x00003167,0x00040005,0x0000037b,
+0x61726170,0x0000006d,0x00030005,0x0000037f,
+0x00003267,0x00040005,0x00000382,0x61726170,
+0x0000006d,0x00040005,0x00000384,0x61726170,
+0x0000006d,0x00030005,0x00000387,0x00003162,
+0x00040005,0x00000388,0x61726170,0x0000006d,
+0x00030005,0x0000038c,0x00003262,0x00040005,
+0x0000038f,0x61726170,0x0000006d,0x00040005,
+0x00000391,0x61726170,0x0000006d,0x00040005,
+0x00000398,0x61726170,0x0000006d,0x00040005,
+0x0000039d,0x61726170,0x0000006d,0x00040005,
+0x000003a2,0x61726170,0x0000006d,0x00040005,
+0x000003a7,0x61726170,0x0000006d,0x00040005,
+0x000003ac,0x61726170,0x0000006d,0x00040005,
+0x000003b1,0x61726170,0x0000006d,0x00050005,
+0x000003b4,0x6c626174,0x646e4965,0x00417865,
+0x00050005,0x000003b8,0x6c626174,0x646e4965,
+0x00427865,0x00040005,0x000003c2,0x6c626174,
+0x00004165,0x00050005,0x000003e8,0x65646e69,
+0x6c626178,0x00000065,0x00040005,0x000003eb,
+0x6c626174,0x00004265,0x00050005,0x000003ed,
+0x65646e69,0x6c626178,0x00000065,0x00050005,
+0x000003fb,0x65646e69,0x6c626178,0x00000065,
+0x00050005,0x000003ff,0x65646e69,0x6c626178,
+0x00000065,0x00040005,0x00000402,0x70696c66,
+0x00646570,0x00030005,0x00000406,0x00746572,
+0x00040005,0x00000408,0x61726170,0x0000006d,
+0x00040005,0x0000040a,0x61726170,0x0000006d,
+0x00040005,0x0000040c,0x61726170,0x0000006d,
+0x00040005,0x0000040e,0x61726170,0x0000006d,
+0x00040005,0x00000410,0x61726170,0x0000006d,
+0x00040005,0x00000412,0x61726170,0x0000006d,
+0x00040005,0x00000414,0x61726170,0x0000006d,
+0x00040005,0x00000415,0x61726170,0x0000006d,
+0x00040005,0x00000417,0x61726170,0x0000006d,
+0x00040005,0x00000419,0x61726170,0x0000006d,
+0x00040005,0x0000041e,0x61726170,0x0000006d,
+0x00040005,0x00000420,0x61726170,0x0000006d,
+0x00040005,0x00000422,0x61726170,0x0000006d,
+0x00040005,0x00000424,0x61726170,0x0000006d,
+0x00040005,0x00000426,0x61726170,0x0000006d,
+0x00040005,0x00000428,0x61726170,0x0000006d,
+0x00040005,0x0000042a,0x61726170,0x0000006d,
+0x00040005,0x0000042b,0x61726170,0x0000006d,
+0x00040005,0x0000042d,0x61726170,0x0000006d,
+0x00040005,0x0000042f,0x61726170,0x0000006d,
+0x00060005,0x00000436,0x65736162,0x646f635f,
+0x726f7765,0x00000064,0x00050005,0x0000043c,
+0x746c756d,0x696c7069,0x00007265,0x00040005,
+0x00000442,0x496c6274,0x00007864,0x00040005,
+0x00000446,0x6c626174,0x00003065,0x00050005,
+0x00000475,0x65646e69,0x6c626178,0x00000065,
+0x00040005,0x00000478,0x6c626174,0x00003165,
+0x00050005,0x0000047c,0x65646e69,0x6c626178,
+0x00000065,0x00030005,0x00000480,0x00000070,
+0x00030005,0x000004a6,0x00000069,0x00040005,
+0x000004ae,0x4974756f,0x00007864,0x00050005,
+0x000004b5,0x69646f6d,0x72656966,0x00000000,
+0x00060005,0x000004ba,0x69646f6d,0x72656966,
+0x756c6156,0x00000065,0x00040005,0x000004c9,
+0x6f636564,0x00646564,0x00040005,0x000004cf,
+0x75736572,0x0000746c,0x00040005,0x000004d1,
+0x61726170,0x0000006d,0x00030005,0x000004f0,
+0x00736f70,0x00080005,0x000004f3,0x475f6c67,
+0x61626f6c,0x766e496c,0x7461636f,0x496e6f69,
+0x00000044,0x00070005,0x000004f6,0x67616d49,
+0x726f4665,0x4274616d,0x6b636f6c,0x00000000,
+0x00060006,0x000004f6,0x00000000,0x706d6f63,
+0x6d726f46,0x00007461,0x00060006,0x000004f6,
+0x00000001,0x65736162,0x6579614c,0x00000072,
+0x00060005,0x000004f8,0x75705f75,0x6f436873,
+0x6174736e,0x0000746e,0x00050005,0x00000503,
+0x42637273,0x6b636f6c,0x00000000,0x00050005,
+0x00000506,0x6d695f75,0x30656761,0x00000000,
+0x00040005,0x00000508,0x61726170,0x0000006d,
+0x00070005,0x00000511,0x6f636564,0x6572706d,
+0x64657373,0x68706c41,0x00000061,0x00040005,
+0x00000512,0x61726170,0x0000006d,0x00040005,
+0x00000516,0x61726170,0x0000006d,0x00040005,
+0x0000051a,0x61726170,0x0000006d,0x00040005,
+0x0000051b,0x61726170,0x0000006d,0x00040005,
+0x0000051c,0x61726170,0x0000006d,0x00060005,
+0x0000051e,0x6f636564,0x6572706d,0x64657373,
+0x00000000,0x00040005,0x0000051f,0x61726170,
+0x0000006d,0x00040005,0x00000525,0x61726170,
+0x0000006d,0x00040005,0x0000052b,0x61726170,
+0x0000006d,0x00040005,0x0000052c,0x61726170,
+0x0000006d,0x00040005,0x0000052d,0x61726170,
+0x0000006d,0x00030005,0x0000052f,0x00000079,
+0x00030005,0x00000537,0x00000078,0x00050005,
+0x00000541,0x6d695f75,0x31656761,0x00000000,
+0x00040005,0x00000551,0x61726170,0x0000006d,
+0x00040047,0x000004f3,0x0000000b,0x0000001c,
+0x00050048,0x000004f6,0x00000000,0x00000023,
+0x00000000,0x00050048,0x000004f6,0x00000001,
+0x00000023,0x00000004,0x00030047,0x000004f6,
+0x00000002,0x00040047,0x00000506,0x00000022,
+0x00000000,0x00040047,0x00000506,0x00000021,
+0x00000000,0x00030047,0x00000506,0x00000018,
+0x00040047,0x00000541,0x00000022,0x00000000,
+0x00040047,0x00000541,0x00000021,0x00000001,
+0x00030047,0x00000541,0x00000019,0x00040047,
+0x00000574,0x0000000b,0x00000019,0x00020013,
+0x00000002,0x00030021,0x00000003,0x00000002,
+0x00040015,0x00000006,0x00000020,0x00000001,
+0x00040017,0x00000007,0x00000006,0x00000003,
+0x00040020,0x00000008,0x00000007,0x00000007,
+0x00040021,0x00000009,0x00000007,0x00000008,
+0x00040015,0x0000000d,0x00000020,0x00000000,
+0x00040020,0x0000000e,0x00000007,0x0000000d,
+0x00020014,0x0000000f,0x00050021,0x00000010,
+0x0000000f,0x0000000e,0x0000000e,0x00040021,
+0x00000015,0x0000000d,0x0000000e,0x00050021,
+0x00000022,0x0000000d,0x0000000e,0x0000000e,
+0x00040020,0x00000027,0x00000007,0x00000006,
+0x00040021,0x00000028,0x00000006,0x00000027,
+0x0004002b,0x0000000d,0x0000002f,0x00000004,
+0x0004001c,0x00000030,0x00000007,0x0000002f,
+0x00040020,0x00000031,0x00000007,0x00000030,
+0x00040020,0x00000032,0x00000007,0x0000000f,
+0x00040017,0x00000033,0x00000006,0x00000004,
+0x0004002b,0x0000000d,0x00000034,0x00000010,
+0x0004001c,0x00000035,0x00000033,0x00000034,
+0x00070021,0x00000036,0x00000035,0x00000031,
+0x0000000e,0x00000032,0x00000032,0x00070021,
+0x0000003d,0x00000035,0x0000000e,0x0000000e,
+0x00000032,0x00000032,0x00060021,0x0000004a,
+0x00000035,0x0000000e,0x0000000e,0x00000032,
+0x00040020,0x00000050,0x00000007,0x00000035,
+0x00040020,0x00000051,0x00000007,0x00000033,
+0x000d0021,0x00000052,0x00000002,0x00000050,
+0x00000027,0x00000027,0x00000027,0x00000051,
+0x0000000e,0x00000032,0x00000032,0x00000032,
+0x00000032,0x0004001c,0x00000064,0x0000000d,
+0x00000034,0x00060021,0x00000065,0x00000064,
+0x0000000e,0x0000000e,0x00000032,0x0004002b,
+0x0000000d,0x00000072,0x0000001f,0x0004002b,
+0x0000000d,0x00000076,0x00000008,0x0004001c,
+0x00000077,0x00000006,0x00000076,0x0004002b,
+0x00000006,0x00000078,0x00000000,0x0004002b,
+0x00000006,0x00000079,0x00000001,0x0004002b,
+0x00000006,0x0000007a,0x00000002,0x0004002b,
+0x00000006,0x0000007b,0x00000003,0x0004002b,
+0x00000006,0x0000007c,0xfffffffc,0x0004002b,
+0x00000006,0x0000007d,0xfffffffd,0x0004002b,
+0x00000006,0x0000007e,0xfffffffe,0x0004002b,
+0x00000006,0x0000007f,0xffffffff,0x000b002c,
+0x00000077,0x00000080,0x00000078,0x00000079,
+0x0000007a,0x0000007b,0x0000007c,0x0000007d,
+0x0000007e,0x0000007f,0x0004002b,0x0000000d,
+0x00000081,0x00000007,0x00040020,0x00000084,
+0x00000007,0x00000077,0x0004002b,0x00000006,
+0x0000008c,0x00000020,0x0004002b,0x0000000d,
+0x00000093,0x0000000f,0x0004002b,0x00000006,
+0x00000096,0x00000004,0x0004002b,0x0000000d,
+0x000000a8,0x0000003f,0x0004002b,0x0000000d,
+0x000000b3,0x0000007f,0x0004002b,0x00000006,
+0x000000b8,0x00000006,0x0004002b,0x00000006,
+0x000000cc,0x000000ff,0x0004002b,0x0000000d,
+0x000000db,0x00000000,0x0004002b,0x0000000d,
+0x000000f5,0x00000002,0x0004002b,0x0000000d,
+0x000000fb,0x00000001,0x0007002c,0x00000033,
+0x0000010e,0x00000078,0x00000078,0x00000078,
+0x00000078,0x0004002b,0x00000006,0x0000012a,
+0x0000001b,0x0004002b,0x0000000d,0x0000012c,
+0x00000003,0x0004002b,0x00000006,0x00000130,
+0x00000018,0x0004002b,0x00000006,0x00000139,
+0x00000014,0x0004002b,0x00000006,0x00000140,
+0x00000010,0x0004002b,0x00000006,0x00000147,
+0x0000000c,0x0004002b,0x00000006,0x0000014e,
+0x00000008,0x0004002b,0x00000006,0x00000163,
+0x0000000b,0x0004002b,0x00000006,0x00000164,
+0x00000017,0x0004002b,0x00000006,0x00000165,
+0x00000029,0x0004002b,0x00000006,0x00000166,
+0x00000040,0x000b002c,0x00000077,0x00000167,
+0x0000007b,0x000000b8,0x00000163,0x00000140,
+0x00000164,0x0000008c,0x00000165,0x00000166,
+0x0004002b,0x00000006,0x000001b7,0x00000013,
+0x0004002b,0x00000006,0x000001bb,0x0000000f,
+0x0004002b,0x00000006,0x000001cb,0x00000007,
+0x0004002b,0x00000006,0x00000236,0x00000019,
+0x0004002b,0x00000006,0x00000240,0x00000011,
+0x0004002b,0x00000006,0x0000024a,0x00000005,
+0x0004002b,0x00000006,0x00000272,0x0000000d,
+0x0004002b,0x00000006,0x00000396,0x0000001c,
+0x0004001c,0x000003c3,0x00000033,0x00000076,
+0x0004002b,0x00000006,0x000003c4,0xfffffff8,
+0x0007002c,0x00000033,0x000003c5,0x0000007a,
+0x0000014e,0x0000007e,0x000003c4,0x0004002b,
+0x00000006,0x000003c6,0xfffffffb,0x0004002b,
+0x00000006,0x000003c7,0xffffffef,0x0007002c,
+0x00000033,0x000003c8,0x0000024a,0x00000240,
+0x000003c6,0x000003c7,0x0004002b,0x00000006,
+0x000003c9,0x00000009,0x0004002b,0x00000006,
+0x000003ca,0x0000001d,0x0004002b,0x00000006,
+0x000003cb,0xfffffff7,0x0004002b,0x00000006,
+0x000003cc,0xffffffe3,0x0007002c,0x00000033,
+0x000003cd,0x000003c9,0x000003ca,0x000003cb,
+0x000003cc,0x0004002b,0x00000006,0x000003ce,
+0x0000002a,0x0004002b,0x00000006,0x000003cf,
+0xfffffff3,0x0004002b,0x00000006,0x000003d0,
+0xffffffd6,0x0007002c,0x00000033,0x000003d1,
+0x00000272,0x000003ce,0x000003cf,0x000003d0,
+0x0004002b,0x00000006,0x000003d2,0x00000012,
+0x0004002b,0x00000006,0x000003d3,0x0000003c,
+0x0004002b,0x00000006,0x000003d4,0xffffffee,
+0x0004002b,0x00000006,0x000003d5,0xffffffc4,
+0x0007002c,0x00000033,0x000003d6,0x000003d2,
+0x000003d3,0x000003d4,0x000003d5,0x0004002b,
+0x00000006,0x000003d7,0x00000050,0x0004002b,
+0x00000006,0x000003d8,0xffffffe8,0x0004002b,
+0x00000006,0x000003d9,0xffffffb0,0x0007002c,
+0x00000033,0x000003da,0x00000130,0x000003d7,
+0x000003d8,0x000003d9,0x0004002b,0x00000006,
+0x000003db,0x00000021,0x0004002b,0x00000006,
+0x000003dc,0x0000006a,0x0004002b,0x00000006,
+0x000003dd,0xffffffdf,0x0004002b,0x00000006,
+0x000003de,0xffffff96,0x0007002c,0x00000033,
+0x000003df,0x000003db,0x000003dc,0x000003dd,
+0x000003de,0x0004002b,0x00000006,0x000003e0,
+0x0000002f,0x0004002b,0x00000006,0x000003e1,
+0x000000b7,0x0004002b,0x00000006,0x000003e2,
+0xffffffd1,0x0004002b,0x00000006,0x000003e3,
+0xffffff49,0x0007002c,0x00000033,0x000003e4,
+0x000003e0,0x000003e1,0x000003e2,0x000003e3,
+0x000b002c,0x000003c3,0x000003e5,0x000003c5,
+0x000003c8,0x000003cd,0x000003d1,0x000003d6,
+0x000003da,0x000003df,0x000003e4,0x00040020,
+0x000003e7,0x00000007,0x000003c3,0x0007002c,
+0x00000033,0x000003f1,0x00000078,0x0000014e,
+0x00000078,0x000003c4,0x0007002c,0x00000033,
+0x000003f2,0x00000078,0x00000240,0x00000078,
+0x000003c7,0x0007002c,0x00000033,0x000003f3,
+0x00000078,0x000003ca,0x00000078,0x000003cc,
+0x0007002c,0x00000033,0x000003f4,0x00000078,
+0x000003ce,0x00000078,0x000003d0,0x0007002c,
+0x00000033,0x000003f5,0x00000078,0x000003d3,
+0x00000078,0x000003d5,0x0007002c,0x00000033,
+0x000003f6,0x00000078,0x000003d7,0x00000078,
+0x000003d9,0x0007002c,0x00000033,0x000003f7,
+0x00000078,0x000003dc,0x00000078,0x000003de,
+0x0007002c,0x00000033,0x000003f8,0x00000078,
+0x000003e1,0x00000078,0x000003e3,0x000b002c,
+0x000003c3,0x000003f9,0x000003f1,0x000003f2,
+0x000003f3,0x000003f4,0x000003f5,0x000003f6,
+0x000003f7,0x000003f8,0x0003002a,0x0000000f,
+0x00000407,0x00030029,0x0000000f,0x0000041d,
+0x0004002b,0x0000000d,0x00000447,0x00000020,
+0x0004001c,0x00000448,0x00000033,0x00000447,
+0x0004002b,0x00000006,0x00000449,0xfffffffa,
+0x0004002b,0x00000006,0x0000044a,0xfffffff1,
+0x0007002c,0x00000033,0x0000044b,0x0000007d,
+0x00000449,0x000003cb,0x0000044a,0x0004002b,
+0x00000006,0x0000044c,0x0000000e,0x0007002c,
+0x00000033,0x0000044d,0x0000007a,0x0000024a,
+0x0000014e,0x0000044c,0x0004002b,0x00000006,
+0x0000044e,0xfffffff9,0x0004002b,0x00000006,
+0x0000044f,0xfffffff6,0x0007002c,0x00000033,
+0x00000450,0x0000007d,0x0000044e,0x0000044f,
+0x000003cf,0x0007002c,0x00000033,0x00000451,
+0x0000007a,0x000000b8,0x000003c9,0x00000147,
+0x0007002c,0x00000033,0x00000452,0x0000007e,
+0x000003c6,0x000003c4,0x000003cf,0x0007002c,
+0x00000033,0x00000453,0x00000079,0x00000096,
+0x000001cb,0x00000147,0x0007002c,0x00000033,
+0x00000454,0x0000007e,0x0000007c,0x00000449,
+0x000003cf,0x0007002c,0x00000033,0x00000455,
+0x00000079,0x0000007b,0x0000024a,0x00000147,
+0x0004002b,0x00000006,0x00000456,0xfffffff4,
+0x0007002c,0x00000033,0x00000457,0x0000007d,
+0x00000449,0x000003c4,0x00000456,0x0007002c,
+0x00000033,0x00000458,0x0000007a,0x0000024a,
+0x000001cb,0x00000163,0x0004002b,0x00000006,
+0x00000459,0xfffffff5,0x0007002c,0x00000033,
+0x0000045a,0x0000007d,0x0000044e,0x000003cb,
+0x00000459,0x0004002b,0x00000006,0x0000045b,
+0x0000000a,0x0007002c,0x00000033,0x0000045c,
+0x0000007a,0x000000b8,0x0000014e,0x0000045b,
+0x0007002c,0x00000033,0x0000045d,0x0000007c,
+0x0000044e,0x000003c4,0x00000459,0x0007002c,
+0x00000033,0x0000045e,0x0000007b,0x000000b8,
+0x000001cb,0x0000045b,0x0007002c,0x00000033,
+0x0000045f,0x0000007d,0x000003c6,0x000003c4,
+0x00000459,0x0007002c,0x00000033,0x00000460,
+0x0000007a,0x00000096,0x000001cb,0x0000045b,
+0x0007002c,0x00000033,0x00000461,0x0000007e,
+0x00000449,0x000003c4,0x0000044f,0x0007002c,
+0x00000033,0x00000462,0x00000079,0x0000024a,
+0x000001cb,0x000003c9,0x0007002c,0x00000033,
+0x00000463,0x0000007e,0x000003c6,0x000003c4,
+0x0000044f,0x0007002c,0x00000033,0x00000464,
+0x00000079,0x00000096,0x000001cb,0x000003c9,
+0x0007002c,0x00000033,0x00000465,0x0000007e,
+0x0000007c,0x000003c4,0x0000044f,0x0007002c,
+0x00000033,0x00000466,0x00000079,0x0000007b,
+0x000001cb,0x000003c9,0x0007002c,0x00000033,
+0x00000467,0x0000007e,0x000003c6,0x0000044e,
+0x0000044f,0x0007002c,0x00000033,0x00000468,
+0x00000079,0x00000096,0x000000b8,0x000003c9,
+0x0007002c,0x00000033,0x00000469,0x0000007d,
+0x0000007c,0x0000044e,0x0000044f,0x0007002c,
+0x00000033,0x0000046a,0x0000007a,0x0000007b,
+0x000000b8,0x000003c9,0x0007002c,0x00000033,
+0x0000046b,0x0000007f,0x0000007e,0x0000007d,
+0x0000044f,0x0007002c,0x00000033,0x0000046c,
+0x00000078,0x00000079,0x0000007a,0x000003c9,
+0x0007002c,0x00000033,0x0000046d,0x0000007c,
+0x00000449,0x000003c4,0x000003cb,0x0007002c,
+0x00000033,0x0000046e,0x0000007b,0x0000024a,
+0x000001cb,0x0000014e,0x0007002c,0x00000033,
+0x0000046f,0x0000007d,0x000003c6,0x0000044e,
+0x000003cb,0x0007002c,0x00000033,0x00000470,
+0x0000007a,0x00000096,0x000000b8,0x0000014e,
+0x0023002c,0x00000448,0x00000471,0x0000044b,
+0x0000044d,0x00000450,0x00000451,0x00000452,
+0x00000453,0x00000454,0x00000455,0x00000457,
+0x00000458,0x0000045a,0x0000045c,0x0000045d,
+0x0000045e,0x0000045f,0x00000460,0x00000461,
+0x00000462,0x00000463,0x00000464,0x00000465,
+0x00000466,0x00000467,0x00000468,0x00000469,
+0x0000046a,0x0000046b,0x0000046c,0x0000046d,
+0x0000046e,0x0000046f,0x00000470,0x00040020,
+0x00000474,0x00000007,0x00000448,0x00040020,
+0x0000047f,0x00000007,0x00000064,0x0004002b,
+0x00000006,0x0000048e,0x0000001e,0x0004002b,
+0x00000006,0x00000496,0x00000015,0x0004002b,
+0x0000000d,0x000004dc,0x000000ff,0x0004002b,
+0x0000000d,0x000004e0,0x0000ff00,0x0004002b,
+0x0000000d,0x000004e5,0x00ff0000,0x0004002b,
+0x0000000d,0x000004ea,0xff000000,0x00040017,
+0x000004f1,0x0000000d,0x00000003,0x00040020,
+0x000004f2,0x00000001,0x000004f1,0x0004003b,
+0x000004f2,0x000004f3,0x00000001,0x0004001e,
+0x000004f6,0x0000000d,0x0000000d,0x00040020,
+0x000004f7,0x00000009,0x000004f6,0x0004003b,
+0x000004f7,0x000004f8,0x00000009,0x00040020,
+0x000004f9,0x00000009,0x0000000d,0x00040017,
+0x00000501,0x0000000d,0x00000004,0x00040020,
+0x00000502,0x00000007,0x00000501,0x00090019,
+0x00000504,0x0000000d,0x00000002,0x00000000,
+0x00000000,0x00000000,0x00000002,0x0000001e,
+0x00040020,0x00000505,0x00000000,0x00000504,
+0x0004003b,0x00000505,0x00000506,0x00000000,
+0x00090019,0x0000053f,0x0000000d,0x00000002,
+0x00000000,0x00000000,0x00000000,0x00000002,
+0x00000020,0x00040020,0x00000540,0x00000000,
+0x0000053f,0x0004003b,0x00000540,0x00000541,
+0x00000000,0x00040017,0x00000543,0x00000006,
+0x00000002,0x0004002b,0x0000000d,0x0000056a,
+0x00000093,0x0004002b,0x0000000d,0x0000056b,
+0x00000094,0x0004002b,0x0000000d,0x0000056c,
+0x00000095,0x0004002b,0x0000000d,0x0000056d,
+0x00000096,0x0004002b,0x0000000d,0x0000056e,
+0x00000097,0x0004002b,0x0000000d,0x0000056f,
+0x00000098,0x0004002b,0x0000000d,0x00000570,
+0x00000099,0x0004002b,0x0000000d,0x00000571,
+0x0000009a,0x0004002b,0x0000000d,0x00000572,
+0x0000009b,0x0004002b,0x0000000d,0x00000573,
+0x0000009c,0x0006002c,0x000004f1,0x00000574,
+0x00000076,0x00000076,0x000000fb,0x00050036,
+0x00000002,0x00000004,0x00000000,0x00000003,
+0x000200f8,0x00000005,0x0004003b,0x00000008,
+0x000004f0,0x00000007,0x0004003b,0x00000502,
+0x00000503,0x00000007,0x0004003b,0x00000008,
+0x00000508,0x00000007,0x0004003b,0x0000047f,
+0x00000511,0x00000007,0x0004003b,0x0000000e,
+0x00000512,0x00000007,0x0004003b,0x0000000e,
+0x00000516,0x00000007,0x0004003b,0x0000000e,
+0x0000051a,0x00000007,0x0004003b,0x0000000e,
+0x0000051b,0x00000007,0x0004003b,0x00000032,
+0x0000051c,0x00000007,0x0004003b,0x00000050,
+0x0000051e,0x00000007,0x0004003b,0x0000000e,
+0x0000051f,0x00000007,0x0004003b,0x0000000e,
+0x00000525,0x00000007,0x0004003b,0x0000000e,
+0x0000052b,0x00000007,0x0004003b,0x0000000e,
+0x0000052c,0x00000007,0x0004003b,0x00000032,
+0x0000052d,0x00000007,0x0004003b,0x00000027,
+0x0000052f,0x00000007,0x0004003b,0x00000027,
+0x00000537,0x00000007,0x0004003b,0x00000008,
+0x00000551,0x00000007,0x0004003d,0x000004f1,
+0x000004f4,0x000004f3,0x0004007c,0x00000007,
+0x000004f5,0x000004f4,0x0003003e,0x000004f0,
+0x000004f5,0x00050041,0x000004f9,0x000004fa,
+0x000004f8,0x00000079,0x0004003d,0x0000000d,
+0x000004fb,0x000004fa,0x0004007c,0x00000006,
+0x000004fc,0x000004fb,0x00050041,0x00000027,
+0x000004fd,0x000004f0,0x000000f5,0x0004003d,
+0x00000006,0x000004fe,0x000004fd,0x00050080,
+0x00000006,0x000004ff,0x000004fe,0x000004fc,
+0x00050041,0x00000027,0x00000500,0x000004f0,
+0x000000f5,0x0003003e,0x00000500,0x000004ff,
+0x0004003d,0x00000504,0x00000507,0x00000506,
+0x0004003d,0x00000007,0x00000509,0x000004f0,
+0x0003003e,0x00000508,0x00000509,0x00050039,
+0x00000007,0x0000050a,0x0000000b,0x00000508,
+0x00050062,0x00000501,0x0000050b,0x00000507,
+0x0000050a,0x00050051,0x0000000d,0x0000050c,
+0x0000050b,0x00000000,0x00050051,0x0000000d,
+0x0000050d,0x0000050b,0x00000001,0x00050051,
+0x0000000d,0x0000050e,0x0000050b,0x00000002,
+0x00050051,0x0000000d,0x0000050f,0x0000050b,
+0x00000003,0x00070050,0x00000501,0x00000510,
+0x0000050c,0x0000050d,0x0000050e,0x0000050f,
+0x0003003e,0x00000503,0x00000510,0x00050041,
+0x0000000e,0x00000513,0x00000503,0x000000db,
+0x0004003d,0x0000000d,0x00000514,0x00000513,
+0x0003003e,0x00000512,0x00000514,0x00050039,
+0x0000000d,0x00000515,0x0000006c,0x00000512,
+0x00050041,0x0000000e,0x00000517,0x00000503,
+0x000000fb,0x0004003d,0x0000000d,0x00000518,
+0x00000517,0x0003003e,0x00000516,0x00000518,
+0x00050039,0x0000000d,0x00000519,0x0000006c,
+0x00000516,0x0003003e,0x0000051a,0x00000515,
+0x0003003e,0x0000051b,0x00000519,0x0003003e,
+0x0000051c,0x00000407,0x00070039,0x00000064,
+0x0000051d,0x00000069,0x0000051a,0x0000051b,
+0x0000051c,0x0003003e,0x00000511,0x0000051d,
+0x00050041,0x0000000e,0x00000520,0x00000503,
+0x000000f5,0x0004003d,0x0000000d,0x00000521,
+0x00000520,0x0003003e,0x0000051f,0x00000521,
+0x00050039,0x0000000d,0x00000522,0x0000006c,
+0x0000051f,0x0004007c,0x00000006,0x00000523,
+0x00000522,0x0004007c,0x0000000d,0x00000524,
+0x00000523,0x00050041,0x0000000e,0x00000526,
+0x00000503,0x0000012c,0x0004003d,0x0000000d,
+0x00000527,0x00000526,0x0003003e,0x00000525,
+0x00000527,0x00050039,0x0000000d,0x00000528,
+0x0000006c,0x00000525,0x0004007c,0x00000006,
+0x00000529,0x00000528,0x0004007c,0x0000000d,
+0x0000052a,0x00000529,0x0003003e,0x0000052b,
+0x00000524,0x0003003e,0x0000052c,0x0000052a,
+0x0003003e,0x0000052d,0x00000407,0x00070039,
+0x00000035,0x0000052e,0x00000062,0x0000052b,
+0x0000052c,0x0000052d,0x0003003e,0x0000051e,
+0x0000052e,0x0003003e,0x0000052f,0x00000078,
+0x000200f9,0x00000530,0x000200f8,0x00000530,
+0x000400f6,0x00000532,0x00000533,0x00000000,
+0x000200f9,0x00000534,0x000200f8,0x00000534,
+0x0004003d,0x00000006,0x00000535,0x0000052f,
+0x000500b1,0x0000000f,0x00000536,0x00000535,
+0x00000096,0x000400fa,0x00000536,0x00000531,
+0x00000532,0x000200f8,0x00000531,0x0003003e,
+0x00000537,0x00000078,0x000200f9,0x00000538,
+0x000200f8,0x00000538,0x000400f6,0x0000053a,
+0x0000053b,0x00000000,0x000200f9,0x0000053c,
+0x000200f8,0x0000053c,0x0004003d,0x00000006,
+0x0000053d,0x00000537,0x000500b1,0x0000000f,
+0x0000053e,0x0000053d,0x00000096,0x000400fa,
+0x0000053e,0x00000539,0x0000053a,0x000200f8,
+0x00000539,0x0004003d,0x0000053f,0x00000542,
+0x00000541,0x0004003d,0x00000007,0x00000544,
+0x000004f0,0x0007004f,0x00000543,0x00000545,
+0x00000544,0x00000544,0x00000000,0x00000001,
+0x00050050,0x00000543,0x00000546,0x00000096,
+0x00000096,0x00050084,0x00000543,0x00000547,
+0x00000545,0x00000546,0x0004003d,0x00000006,
+0x00000548,0x00000537,0x0004003d,0x00000006,
+0x00000549,0x0000052f,0x00050050,0x00000543,
+0x0000054a,0x00000548,0x00000549,0x00050080,
+0x00000543,0x0000054b,0x00000547,0x0000054a,
+0x00050041,0x00000027,0x0000054c,0x000004f0,
+0x000000f5,0x0004003d,0x00000006,0x0000054d,
+0x0000054c,0x00050051,0x00000006,0x0000054e,
+0x0000054b,0x00000000,0x00050051,0x00000006,
+0x0000054f,0x0000054b,0x00000001,0x00060050,
+0x00000007,0x00000550,0x0000054e,0x0000054f,
+0x0000054d,0x0003003e,0x00000551,0x00000550,
+0x00050039,0x00000007,0x00000552,0x0000000b,
+0x00000551,0x0004003d,0x00000006,0x00000553,
+0x0000052f,0x00050084,0x00000006,0x00000554,
+0x00000553,0x00000096,0x0004003d,0x00000006,
+0x00000555,0x00000537,0x00050080,0x00000006,
+0x00000556,0x00000554,0x00000555,0x00050041,
+0x00000051,0x00000557,0x0000051e,0x00000556,
+0x0004003d,0x00000033,0x00000558,0x00000557,
+0x0008004f,0x00000007,0x00000559,0x00000558,
+0x00000558,0x00000000,0x00000001,0x00000002,
+0x0004003d,0x00000006,0x0000055a,0x0000052f,
+0x00050084,0x00000006,0x0000055b,0x0000055a,
+0x00000096,0x0004003d,0x00000006,0x0000055c,
+0x00000537,0x00050080,0x00000006,0x0000055d,
+0x0000055b,0x0000055c,0x00050041,0x0000000e,
+0x0000055e,0x00000511,0x0000055d,0x0004003d,
+0x0000000d,0x0000055f,0x0000055e,0x0004007c,
+0x00000006,0x00000560,0x0000055f,0x00050051,
+0x00000006,0x00000561,0x00000559,0x00000000,
+0x00050051,0x00000006,0x00000562,0x00000559,
+0x00000001,0x00050051,0x00000006,0x00000563,
+0x00000559,0x00000002,0x00070050,0x00000033,
+0x00000564,0x00000561,0x00000562,0x00000563,
+0x00000560,0x0004007c,0x00000501,0x00000565,
+0x00000564,0x00040063,0x00000542,0x00000552,
+0x00000565,0x000200f9,0x0000053b,0x000200f8,
+0x0000053b,0x0004003d,0x00000006,0x00000566,
+0x00000537,0x00050080,0x00000006,0x00000567,
+0x00000566,0x00000079,0x0003003e,0x00000537,
+0x00000567,0x000200f9,0x00000538,0x000200f8,
+0x0000053a,0x000200f9,0x00000533,0x000200f8,
+0x00000533,0x0004003d,0x00000006,0x00000568,
+0x0000052f,0x00050080,0x00000006,0x00000569,
+0x00000568,0x00000079,0x0003003e,0x0000052f,
+0x00000569,0x000200f9,0x00000530,0x000200f8,
+0x00000532,0x000100fd,0x00010038,0x00050036,
+0x00000007,0x0000000b,0x00000000,0x00000009,
+0x00030037,0x00000008,0x0000000a,0x000200f8,
+0x0000000c,0x0004003d,0x00000007,0x0000006e,
+0x0000000a,0x000200fe,0x0000006e,0x00010038,
+0x00050036,0x0000000f,0x00000013,0x00000000,
+0x00000010,0x00030037,0x0000000e,0x00000011,
+0x00030037,0x0000000e,0x00000012,0x000200f8,
+0x00000014,0x0004003b,0x00000027,0x00000071,
+0x00000007,0x0004003b,0x00000084,0x00000085,
+0x00000007,0x0004003d,0x0000000d,0x00000073,
+0x00000011,0x000500c7,0x0000000d,0x00000074,
+0x00000072,0x00000073,0x0004007c,0x00000006,
+0x00000075,0x00000074,0x0004003d,0x0000000d,
+0x00000082,0x00000012,0x000500c7,0x0000000d,
+0x00000083,0x00000081,0x00000082,0x0003003e,
+0x00000085,0x00000080,0x00050041,0x00000027,
+0x00000086,0x00000085,0x00000083,0x0004003d,
+0x00000006,0x00000087,0x00000086,0x00050080,
+0x00000006,0x00000088,0x00000075,0x00000087,
+0x0003003e,0x00000071,0x00000088,0x0004003d,
+0x00000006,0x00000089,0x00000071,0x000500b1,
+0x0000000f,0x0000008a,0x00000089,0x00000078,
+0x0004003d,0x00000006,0x0000008b,0x00000071,
+0x000500af,0x0000000f,0x0000008d,0x0000008b,
+0x0000008c,0x000500a6,0x0000000f,0x0000008e,
+0x0000008a,0x0000008d,0x000200fe,0x0000008e,
+0x00010038,0x00050036,0x0000000d,0x00000017,
+0x00000000,0x00000015,0x00030037,0x0000000e,
+0x00000016,0x000200f8,0x00000018,0x0004003b,
+0x0000000e,0x00000091,0x00000007,0x0004003d,
+0x0000000d,0x00000092,0x00000016,0x000500c7,
+0x0000000d,0x00000094,0x00000092,0x00000093,
+0x0003003e,0x00000091,0x00000094,0x0004003d,
+0x0000000d,0x00000095,0x00000091,0x000500c4,
+0x0000000d,0x00000097,0x00000095,0x00000096,
+0x0004003d,0x0000000d,0x00000098,0x00000091,
+0x000500c5,0x0000000d,0x00000099,0x00000097,
+0x00000098,0x000200fe,0x00000099,0x00010038,
+0x00050036,0x0000000d,0x0000001a,0x00000000,
+0x00000015,0x00030037,0x0000000e,0x00000019,
+0x000200f8,0x0000001b,0x0004003b,0x0000000e,
+0x0000009c,0x00000007,0x0004003d,0x0000000d,
+0x0000009d,0x00000019,0x000500c7,0x0000000d,
+0x0000009e,0x0000009d,0x00000072,0x0003003e,
+0x0000009c,0x0000009e,0x0004003d,0x0000000d,
+0x0000009f,0x0000009c,0x000500c4,0x0000000d,
+0x000000a0,0x0000009f,0x0000007b,0x0004003d,
+0x0000000d,0x000000a1,0x0000009c,0x000500c2,
+0x0000000d,0x000000a2,0x000000a1,0x0000007a,
+0x000500c5,0x0000000d,0x000000a3,0x000000a0,
+0x000000a2,0x000200fe,0x000000a3,0x00010038,
+0x00050036,0x0000000d,0x0000001d,0x00000000,
+0x00000015,0x00030037,0x0000000e,0x0000001c,
+0x000200f8,0x0000001e,0x0004003b,0x0000000e,
+0x000000a6,0x00000007,0x0004003d,0x0000000d,
+0x000000a7,0x0000001c,0x000500c7,0x0000000d,
+0x000000a9,0x000000a7,0x000000a8,0x0003003e,
+0x000000a6,0x000000a9,0x0004003d,0x0000000d,
+0x000000aa,0x000000a6,0x000500c4,0x0000000d,
+0x000000ab,0x000000aa,0x0000007a,0x0004003d,
+0x0000000d,0x000000ac,0x000000a6,0x000500c2,
+0x0000000d,0x000000ad,0x000000ac,0x00000096,
+0x000500c5,0x0000000d,0x000000ae,0x000000ab,
+0x000000ad,0x000200fe,0x000000ae,0x00010038,
+0x00050036,0x0000000d,0x00000020,0x00000000,
+0x00000015,0x00030037,0x0000000e,0x0000001f,
+0x000200f8,0x00000021,0x0004003b,0x0000000e,
+0x000000b1,0x00000007,0x0004003d,0x0000000d,
+0x000000b2,0x0000001f,0x000500c7,0x0000000d,
+0x000000b4,0x000000b2,0x000000b3,0x0003003e,
+0x000000b1,0x000000b4,0x0004003d,0x0000000d,
+0x000000b5,0x000000b1,0x000500c4,0x0000000d,
+0x000000b6,0x000000b5,0x00000079,0x0004003d,
+0x0000000d,0x000000b7,0x000000b1,0x000500c2,
+0x0000000d,0x000000b9,0x000000b7,0x000000b8,
+0x000500c5,0x0000000d,0x000000ba,0x000000b6,
+0x000000b9,0x000200fe,0x000000ba,0x00010038,
+0x00050036,0x0000000d,0x00000025,0x00000000,
+0x00000022,0x00030037,0x0000000e,0x00000023,
+0x00030037,0x0000000e,0x00000024,0x000200f8,
+0x00000026,0x0004003b,0x00000084,0x000000c2,
+0x00000007,0x0004003b,0x0000000e,0x000000c7,
+0x00000007,0x0004003d,0x0000000d,0x000000bd,
+0x00000023,0x000500c7,0x0000000d,0x000000be,
+0x00000072,0x000000bd,0x0004007c,0x00000006,
+0x000000bf,0x000000be,0x0004003d,0x0000000d,
+0x000000c0,0x00000024,0x000500c7,0x0000000d,
+0x000000c1,0x00000081,0x000000c0,0x0003003e,
+0x000000c2,0x00000080,0x00050041,0x00000027,
+0x000000c3,0x000000c2,0x000000c1,0x0004003d,
+0x00000006,0x000000c4,0x000000c3,0x00050080,
+0x00000006,0x000000c5,0x000000bf,0x000000c4,
+0x0004007c,0x0000000d,0x000000c6,0x000000c5,
+0x0003003e,0x000000c7,0x000000c6,0x00050039,
+0x0000000d,0x000000c8,0x0000001a,0x000000c7,
+0x000200fe,0x000000c8,0x00010038,0x00050036,
+0x00000006,0x0000002a,0x00000000,0x00000028,
+0x00030037,0x00000027,0x00000029,0x000200f8,
+0x0000002b,0x0004003d,0x00000006,0x000000cb,
+0x00000029,0x0008000c,0x00000006,0x000000cd,
+0x00000001,0x0000002d,0x000000cb,0x00000078,
+0x000000cc,0x000200fe,0x000000cd,0x00010038,
+0x00050036,0x00000007,0x0000002d,0x00000000,
+0x00000009,0x00030037,0x00000008,0x0000002c,
+0x000200f8,0x0000002e,0x0004003d,0x00000007,
+0x000000d0,0x0000002c,0x00060050,0x00000007,
+0x000000d1,0x00000078,0x00000078,0x00000078,
+0x00060050,0x00000007,0x000000d2,0x000000cc,
+0x000000cc,0x000000cc,0x0008000c,0x00000007,
+0x000000d3,0x00000001,0x0000002d,0x000000d0,
+0x000000d1,0x000000d2,0x00050051,0x00000006,
+0x000000d4,0x000000d3,0x00000000,0x00050051,
+0x00000006,0x000000d5,0x000000d3,0x00000001,
+0x00050051,0x00000006,0x000000d6,0x000000d3,
+0x00000002,0x00060050,0x00000007,0x000000d7,
+0x000000d4,0x000000d5,0x000000d6,0x000200fe,
+0x000000d7,0x00010038,0x00050036,0x00000035,
+0x0000003b,0x00000000,0x00000036,0x00030037,
+0x00000031,0x00000037,0x00030037,0x0000000e,
+0x00000038,0x00030037,0x00000032,0x00000039,
+0x00030037,0x00000032,0x0000003a,0x000200f8,
+0x0000003c,0x0004003b,0x0000000e,0x000000da,
+0x00000007,0x0004003b,0x0000000e,0x000000e3,
+0x00000007,0x0004003b,0x0000000e,0x000000eb,
+0x00000007,0x0004003b,0x0000000e,0x000000f0,
+0x00000007,0x0004003b,0x0000000e,0x000000f7,
+0x00000007,0x0004003b,0x00000050,0x00000109,
+0x00000007,0x0004003b,0x0000000e,0x00000111,
+0x00000007,0x0003003e,0x000000da,0x000000db,
+0x000200f9,0x000000dc,0x000200f8,0x000000dc,
+0x000400f6,0x000000de,0x000000df,0x00000000,
+0x000200f9,0x000000e0,0x000200f8,0x000000e0,
+0x0004003d,0x0000000d,0x000000e1,0x000000da,
+0x000500b0,0x0000000f,0x000000e2,0x000000e1,
+0x0000002f,0x000400fa,0x000000e2,0x000000dd,
+0x000000de,0x000200f8,0x000000dd,0x0003003e,
+0x000000e3,0x000000db,0x000200f9,0x000000e4,
+0x000200f8,0x000000e4,0x000400f6,0x000000e6,
+0x000000e7,0x00000000,0x000200f9,0x000000e8,
+0x000200f8,0x000000e8,0x0004003d,0x0000000d,
+0x000000e9,0x000000e3,0x000500b0,0x0000000f,
+0x000000ea,0x000000e9,0x0000002f,0x000400fa,
+0x000000ea,0x000000e5,0x000000e6,0x000200f8,
+0x000000e5,0x0004003d,0x0000000d,0x000000ec,
+0x000000da,0x0004003d,0x0000000d,0x000000ed,
+0x000000e3,0x00050084,0x0000000d,0x000000ee,
+0x000000ed,0x0000002f,0x00050080,0x0000000d,
+0x000000ef,0x000000ec,0x000000ee,0x0003003e,
+0x000000eb,0x000000ef,0x0004003d,0x0000000d,
+0x000000f1,0x00000038,0x0004003d,0x0000000d,
+0x000000f2,0x000000eb,0x00050080,0x0000000d,
+0x000000f3,0x000000f2,0x00000093,0x000500c2,
+0x0000000d,0x000000f4,0x000000f1,0x000000f3,
+0x000500c7,0x0000000d,0x000000f6,0x000000f4,
+0x000000f5,0x0003003e,0x000000f0,0x000000f6,
+0x0004003d,0x0000000d,0x000000f8,0x00000038,
+0x0004003d,0x0000000d,0x000000f9,0x000000eb,
+0x000500c2,0x0000000d,0x000000fa,0x000000f8,
+0x000000f9,0x000500c7,0x0000000d,0x000000fc,
+0x000000fa,0x000000fb,0x0003003e,0x000000f7,
+0x000000fc,0x0004003d,0x0000000f,0x000000fd,
+0x00000039,0x0004003d,0x0000000f,0x000000fe,
+0x0000003a,0x000400a8,0x0000000f,0x000000ff,
+0x000000fe,0x000500a7,0x0000000f,0x00000100,
+0x000000fd,0x000000ff,0x0004003d,0x0000000d,
+0x00000101,0x000000f0,0x000500ab,0x0000000f,
+0x00000102,0x00000101,0x000000db,0x000500a7,
+0x0000000f,0x00000103,0x00000100,0x00000102,
+0x0004003d,0x0000000d,0x00000104,0x000000f7,
+0x000500aa,0x0000000f,0x00000105,0x00000104,
+0x000000db,0x000500a7,0x0000000f,0x00000106,
+0x00000103,0x00000105,0x000300f7,0x00000108,
+0x00000000,0x000400fa,0x00000106,0x00000107,
+0x00000110,0x000200f8,0x00000107,0x0004003d,
+0x0000000d,0x0000010a,0x000000da,0x00050084,
+0x0000000d,0x0000010b,0x0000010a,0x0000002f,
+0x0004003d,0x0000000d,0x0000010c,0x000000e3,
+0x00050080,0x0000000d,0x0000010d,0x0000010b,
+0x0000010c,0x00050041,0x00000051,0x0000010f,
+0x00000109,0x0000010d,0x0003003e,0x0000010f,
+0x0000010e,0x000200f9,0x00000108,0x000200f8,
+0x00000110,0x0004003d,0x0000000d,0x00000112,
+0x000000f7,0x0004003d,0x0000000d,0x00000113,
+0x000000f0,0x000500c5,0x0000000d,0x00000114,
+0x00000112,0x00000113,0x0003003e,0x00000111,
+0x00000114,0x0004003d,0x0000000d,0x00000115,
+0x000000da,0x00050084,0x0000000d,0x00000116,
+0x00000115,0x0000002f,0x0004003d,0x0000000d,
+0x00000117,0x000000e3,0x00050080,0x0000000d,
+0x00000118,0x00000116,0x00000117,0x0004003d,
+0x0000000d,0x00000119,0x00000111,0x00050041,
+0x00000008,0x0000011a,0x00000037,0x00000119,
+0x0004003d,0x00000007,0x0000011b,0x0000011a,
+0x00050051,0x00000006,0x0000011c,0x0000011b,
+0x00000000,0x00050051,0x00000006,0x0000011d,
+0x0000011b,0x00000001,0x00050051,0x00000006,
+0x0000011e,0x0000011b,0x00000002,0x00070050,
+0x00000033,0x0000011f,0x0000011c,0x0000011d,
+0x0000011e,0x000000cc,0x00050041,0x00000051,
+0x00000120,0x00000109,0x00000118,0x0003003e,
+0x00000120,0x0000011f,0x000200f9,0x00000108,
+0x000200f8,0x00000108,0x000200f9,0x000000e7,
+0x000200f8,0x000000e7,0x0004003d,0x0000000d,
+0x00000121,0x000000e3,0x00050080,0x0000000d,
+0x00000122,0x00000121,0x00000079,0x0003003e,
+0x000000e3,0x00000122,0x000200f9,0x000000e4,
+0x000200f8,0x000000e6,0x000200f9,0x000000df,
+0x000200f8,0x000000df,0x0004003d,0x0000000d,
+0x00000123,0x000000da,0x00050080,0x0000000d,
+0x00000124,0x00000123,0x00000079,0x0003003e,
+0x000000da,0x00000124,0x000200f9,0x000000dc,
+0x000200f8,0x000000de,0x0004003d,0x00000035,
+0x00000125,0x00000109,0x000200fe,0x00000125,
+0x00010038,0x00050036,0x00000035,0x00000042,
+0x00000000,0x0000003d,0x00030037,0x0000000e,
+0x0000003e,0x00030037,0x0000000e,0x0000003f,
+0x00030037,0x00000032,0x00000040,0x00030037,
+0x00000032,0x00000041,0x000200f8,0x00000043,
+0x0004003b,0x00000027,0x00000128,0x00000007,
+0x0004003b,0x0000000e,0x00000134,0x00000007,
+0x0004003b,0x00000027,0x00000137,0x00000007,
+0x0004003b,0x0000000e,0x0000013b,0x00000007,
+0x0004003b,0x00000027,0x0000013e,0x00000007,
+0x0004003b,0x0000000e,0x00000142,0x00000007,
+0x0004003b,0x00000027,0x00000145,0x00000007,
+0x0004003b,0x0000000e,0x00000149,0x00000007,
+0x0004003b,0x00000027,0x0000014c,0x00000007,
+0x0004003b,0x0000000e,0x00000150,0x00000007,
+0x0004003b,0x00000027,0x00000153,0x00000007,
+0x0004003b,0x0000000e,0x00000156,0x00000007,
+0x0004003b,0x00000027,0x00000159,0x00000007,
+0x0004003b,0x00000027,0x00000162,0x00000007,
+0x0004003b,0x00000084,0x00000169,0x00000007,
+0x0004003b,0x00000031,0x0000016c,0x00000007,
+0x0004003b,0x00000027,0x00000175,0x00000007,
+0x0004003b,0x00000027,0x0000017a,0x00000007,
+0x0004003b,0x00000027,0x0000017f,0x00000007,
+0x0004003b,0x00000027,0x0000018b,0x00000007,
+0x0004003b,0x00000027,0x00000190,0x00000007,
+0x0004003b,0x00000027,0x00000195,0x00000007,
+0x0004003b,0x00000031,0x00000199,0x00000007,
+0x0004003b,0x0000000e,0x0000019b,0x00000007,
+0x0004003b,0x00000032,0x0000019d,0x00000007,
+0x0004003b,0x00000032,0x0000019f,0x00000007,
+0x0004003d,0x0000000d,0x00000129,0x0000003e,
+0x000500c2,0x0000000d,0x0000012b,0x00000129,
+0x0000012a,0x000500c7,0x0000000d,0x0000012d,
+0x0000012b,0x0000012c,0x000500c4,0x0000000d,
+0x0000012e,0x0000012d,0x0000007a,0x0004003d,
+0x0000000d,0x0000012f,0x0000003e,0x000500c2,
+0x0000000d,0x00000131,0x0000012f,0x00000130,
+0x000500c7,0x0000000d,0x00000132,0x00000131,
+0x0000012c,0x000500c5,0x0000000d,0x00000133,
+0x0000012e,0x00000132,0x0003003e,0x00000134,
+0x00000133,0x00050039,0x0000000d,0x00000135,
+0x00000017,0x00000134,0x0004007c,0x00000006,
+0x00000136,0x00000135,0x0003003e,0x00000128,
+0x00000136,0x0004003d,0x0000000d,0x00000138,
+0x0000003e,0x000500c2,0x0000000d,0x0000013a,
+0x00000138,0x00000139,0x0003003e,0x0000013b,
+0x0000013a,0x00050039,0x0000000d,0x0000013c,
+0x00000017,0x0000013b,0x0004007c,0x00000006,
+0x0000013d,0x0000013c,0x0003003e,0x00000137,
+0x0000013d,0x0004003d,0x0000000d,0x0000013f,
+0x0000003e,0x000500c2,0x0000000d,0x00000141,
+0x0000013f,0x00000140,0x0003003e,0x00000142,
+0x00000141,0x00050039,0x0000000d,0x00000143,
+0x00000017,0x00000142,0x0004007c,0x00000006,
+0x00000144,0x00000143,0x0003003e,0x0000013e,
+0x00000144,0x0004003d,0x0000000d,0x00000146,
+0x0000003e,0x000500c2,0x0000000d,0x00000148,
+0x00000146,0x00000147,0x0003003e,0x00000149,
+0x00000148,0x00050039,0x0000000d,0x0000014a,
+0x00000017,0x00000149,0x0004007c,0x00000006,
+0x0000014b,0x0000014a,0x0003003e,0x00000145,
+0x0000014b,0x0004003d,0x0000000d,0x0000014d,
+0x0000003e,0x000500c2,0x0000000d,0x0000014f,
+0x0000014d,0x0000014e,0x0003003e,0x00000150,
+0x0000014f,0x00050039,0x0000000d,0x00000151,
+0x00000017,0x00000150,0x0004007c,0x00000006,
+0x00000152,0x00000151,0x0003003e,0x0000014c,
+0x00000152,0x0004003d,0x0000000d,0x00000154,
+0x0000003e,0x000500c2,0x0000000d,0x00000155,
+0x00000154,0x00000096,0x0003003e,0x00000156,
+0x00000155,0x00050039,0x0000000d,0x00000157,
+0x00000017,0x00000156,0x0004007c,0x00000006,
+0x00000158,0x00000157,0x0003003e,0x00000153,
+0x00000158,0x0004003d,0x0000000d,0x0000015a,
+0x0000003e,0x000500c2,0x0000000d,0x0000015b,
+0x0000015a,0x0000007a,0x000500c7,0x0000000d,
+0x0000015c,0x0000015b,0x0000012c,0x000500c4,
+0x0000000d,0x0000015d,0x0000015c,0x00000079,
+0x0004003d,0x0000000d,0x0000015e,0x0000003e,
+0x000500c7,0x0000000d,0x0000015f,0x0000015e,
+0x000000fb,0x000500c5,0x0000000d,0x00000160,
+0x0000015d,0x0000015f,0x0004007c,0x00000006,
+0x00000161,0x00000160,0x0003003e,0x00000159,
+0x00000161,0x0004003d,0x00000006,0x00000168,
+0x00000159,0x0003003e,0x00000169,0x00000167,
+0x00050041,0x00000027,0x0000016a,0x00000169,
+0x00000168,0x0004003d,0x00000006,0x0000016b,
+0x0000016a,0x0003003e,0x00000162,0x0000016b,
+0x0004003d,0x00000006,0x0000016d,0x00000128,
+0x0004003d,0x00000006,0x0000016e,0x00000137,
+0x0004003d,0x00000006,0x0000016f,0x0000013e,
+0x00060050,0x00000007,0x00000170,0x0000016d,
+0x0000016e,0x0000016f,0x00050041,0x00000008,
+0x00000171,0x0000016c,0x00000078,0x0003003e,
+0x00000171,0x00000170,0x0004003d,0x00000006,
+0x00000172,0x00000145,0x0004003d,0x00000006,
+0x00000173,0x00000162,0x00050080,0x00000006,
+0x00000174,0x00000172,0x00000173,0x0003003e,
+0x00000175,0x00000174,0x00050039,0x00000006,
+0x00000176,0x0000002a,0x00000175,0x0004003d,
+0x00000006,0x00000177,0x0000014c,0x0004003d,
+0x00000006,0x00000178,0x00000162,0x00050080,
+0x00000006,0x00000179,0x00000177,0x00000178,
+0x0003003e,0x0000017a,0x00000179,0x00050039,
+0x00000006,0x0000017b,0x0000002a,0x0000017a,
+0x0004003d,0x00000006,0x0000017c,0x00000153,
+0x0004003d,0x00000006,0x0000017d,0x00000162,
+0x00050080,0x00000006,0x0000017e,0x0000017c,
+0x0000017d,0x0003003e,0x0000017f,0x0000017e,
+0x00050039,0x00000006,0x00000180,0x0000002a,
+0x0000017f,0x00060050,0x00000007,0x00000181,
+0x00000176,0x0000017b,0x00000180,0x00050041,
+0x00000008,0x00000182,0x0000016c,0x00000079,
+0x0003003e,0x00000182,0x00000181,0x0004003d,
+0x00000006,0x00000183,0x00000145,0x0004003d,
+0x00000006,0x00000184,0x0000014c,0x0004003d,
+0x00000006,0x00000185,0x00000153,0x00060050,
+0x00000007,0x00000186,0x00000183,0x00000184,
+0x00000185,0x00050041,0x00000008,0x00000187,
+0x0000016c,0x0000007a,0x0003003e,0x00000187,
+0x00000186,0x0004003d,0x00000006,0x00000188,
+0x00000145,0x0004003d,0x00000006,0x00000189,
+0x00000162,0x00050082,0x00000006,0x0000018a,
+0x00000188,0x00000189,0x0003003e,0x0000018b,
+0x0000018a,0x00050039,0x00000006,0x0000018c,
+0x0000002a,0x0000018b,0x0004003d,0x00000006,
+0x0000018d,0x0000014c,0x0004003d,0x00000006,
+0x0000018e,0x00000162,0x00050082,0x00000006,
+0x0000018f,0x0000018d,0x0000018e,0x0003003e,
+0x00000190,0x0000018f,0x00050039,0x00000006,
+0x00000191,0x0000002a,0x00000190,0x0004003d,
+0x00000006,0x00000192,0x00000153,0x0004003d,
+0x00000006,0x00000193,0x00000162,0x00050082,
+0x00000006,0x00000194,0x00000192,0x00000193,
+0x0003003e,0x00000195,0x00000194,0x00050039,
+0x00000006,0x00000196,0x0000002a,0x00000195,
+0x00060050,0x00000007,0x00000197,0x0000018c,
+0x00000191,0x00000196,0x00050041,0x00000008,
+0x00000198,0x0000016c,0x0000007b,0x0003003e,
+0x00000198,0x00000197,0x0004003d,0x00000030,
+0x0000019a,0x0000016c,0x0003003e,0x00000199,
+0x0000019a,0x0004003d,0x0000000d,0x0000019c,
+0x0000003f,0x0003003e,0x0000019b,0x0000019c,
+0x0004003d,0x0000000f,0x0000019e,0x00000040,
+0x0003003e,0x0000019d,0x0000019e,0x0004003d,
+0x0000000f,0x000001a0,0x00000041,0x0003003e,
+0x0000019f,0x000001a0,0x00080039,0x00000035,
+0x000001a1,0x0000003b,0x00000199,0x0000019b,
+0x0000019d,0x0000019f,0x000200fe,0x000001a1,
+0x00010038,0x00050036,0x00000035,0x00000048,
+0x00000000,0x0000003d,0x00030037,0x0000000e,
+0x00000044,0x00030037,0x0000000e,0x00000045,
+0x00030037,0x00000032,0x00000046,0x00030037,
+0x00000032,0x00000047,0x000200f8,0x00000049,
+0x0004003b,0x00000008,0x000001a4,0x00000007,
+0x0004003b,0x0000000e,0x000001a7,0x00000007,
+0x0004003b,0x0000000e,0x000001b2,0x00000007,
+0x0004003b,0x0000000e,0x000001bf,0x00000007,
+0x0004003b,0x00000008,0x000001c3,0x00000007,
+0x0004003b,0x0000000e,0x000001c6,0x00000007,
+0x0004003b,0x0000000e,0x000001cd,0x00000007,
+0x0004003b,0x0000000e,0x000001d3,0x00000007,
+0x0004003b,0x0000000e,0x000001d7,0x00000007,
+0x0004003b,0x00000027,0x000001f7,0x00000007,
+0x0004003b,0x00000084,0x000001f9,0x00000007,
+0x0004003b,0x00000031,0x000001fc,0x00000007,
+0x0004003b,0x00000008,0x00000205,0x00000007,
+0x0004003b,0x00000008,0x00000210,0x00000007,
+0x0004003b,0x00000008,0x0000021b,0x00000007,
+0x0004003b,0x00000008,0x00000226,0x00000007,
+0x0004003b,0x00000031,0x00000229,0x00000007,
+0x0004003b,0x0000000e,0x0000022b,0x00000007,
+0x0004003b,0x00000032,0x0000022d,0x00000007,
+0x0004003b,0x00000032,0x0000022f,0x00000007,
+0x0004003d,0x0000000d,0x000001a5,0x00000044,
+0x000500c2,0x0000000d,0x000001a6,0x000001a5,
+0x0000012a,0x0003003e,0x000001a7,0x000001a6,
+0x00050039,0x0000000d,0x000001a8,0x00000017,
+0x000001a7,0x0004007c,0x00000006,0x000001a9,
+0x000001a8,0x00050041,0x00000027,0x000001aa,
+0x000001a4,0x000000db,0x0003003e,0x000001aa,
+0x000001a9,0x0004003d,0x0000000d,0x000001ab,
+0x00000044,0x000500c2,0x0000000d,0x000001ac,
+0x000001ab,0x00000130,0x000500c4,0x0000000d,
+0x000001ad,0x000001ac,0x00000079,0x0004003d,
+0x0000000d,0x000001ae,0x00000044,0x000500c2,
+0x0000000d,0x000001af,0x000001ae,0x00000139,
+0x000500c7,0x0000000d,0x000001b0,0x000001af,
+0x000000fb,0x000500c5,0x0000000d,0x000001b1,
+0x000001ad,0x000001b0,0x0003003e,0x000001b2,
+0x000001b1,0x00050039,0x0000000d,0x000001b3,
+0x00000017,0x000001b2,0x0004007c,0x00000006,
+0x000001b4,0x000001b3,0x00050041,0x00000027,
+0x000001b5,0x000001a4,0x000000fb,0x0003003e,
+0x000001b5,0x000001b4,0x0004003d,0x0000000d,
+0x000001b6,0x00000044,0x000500c2,0x0000000d,
+0x000001b8,0x000001b6,0x000001b7,0x000500c4,
+0x0000000d,0x000001b9,0x000001b8,0x0000007b,
+0x0004003d,0x0000000d,0x000001ba,0x00000044,
+0x000500c2,0x0000000d,0x000001bc,0x000001ba,
+0x000001bb,0x000500c7,0x0000000d,0x000001bd,
+0x000001bc,0x00000081,0x000500c5,0x0000000d,
+0x000001be,0x000001b9,0x000001bd,0x0003003e,
+0x000001bf,0x000001be,0x00050039,0x0000000d,
+0x000001c0,0x00000017,0x000001bf,0x0004007c,
+0x00000006,0x000001c1,0x000001c0,0x00050041,
+0x00000027,0x000001c2,0x000001a4,0x000000f5,
+0x0003003e,0x000001c2,0x000001c1,0x0004003d,
+0x0000000d,0x000001c4,0x00000044,0x000500c2,
+0x0000000d,0x000001c5,0x000001c4,0x00000163,
+0x0003003e,0x000001c6,0x000001c5,0x00050039,
+0x0000000d,0x000001c7,0x00000017,0x000001c6,
+0x0004007c,0x00000006,0x000001c8,0x000001c7,
+0x00050041,0x00000027,0x000001c9,0x000001c3,
+0x000000db,0x0003003e,0x000001c9,0x000001c8,
+0x0004003d,0x0000000d,0x000001ca,0x00000044,
+0x000500c2,0x0000000d,0x000001cc,0x000001ca,
+0x000001cb,0x0003003e,0x000001cd,0x000001cc,
+0x00050039,0x0000000d,0x000001ce,0x00000017,
+0x000001cd,0x0004007c,0x00000006,0x000001cf,
+0x000001ce,0x00050041,0x00000027,0x000001d0,
+0x000001c3,0x000000fb,0x0003003e,0x000001d0,
+0x000001cf,0x0004003d,0x0000000d,0x000001d1,
+0x00000044,0x000500c2,0x0000000d,0x000001d2,
+0x000001d1,0x0000007b,0x0003003e,0x000001d3,
+0x000001d2,0x00050039,0x0000000d,0x000001d4,
+0x00000017,0x000001d3,0x0004007c,0x00000006,
+0x000001d5,0x000001d4,0x00050041,0x00000027,
+0x000001d6,0x000001c3,0x000000f5,0x0003003e,
+0x000001d6,0x000001d5,0x0004003d,0x0000000d,
+0x000001d8,0x00000044,0x000500c7,0x0000000d,
+0x000001d9,0x000001d8,0x0000002f,0x0003003e,
+0x000001d7,0x000001d9,0x0004003d,0x0000000d,
+0x000001da,0x00000044,0x000500c7,0x0000000d,
+0x000001db,0x000001da,0x000000fb,0x000500c4,
+0x0000000d,0x000001dc,0x000001db,0x00000079,
+0x0004003d,0x0000000d,0x000001dd,0x000001d7,
+0x000500c5,0x0000000d,0x000001de,0x000001dd,
+0x000001dc,0x0003003e,0x000001d7,0x000001de,
+0x00050041,0x00000027,0x000001df,0x000001a4,
+0x000000db,0x0004003d,0x00000006,0x000001e0,
+0x000001df,0x000500c4,0x00000006,0x000001e1,
+0x000001e0,0x00000140,0x00050041,0x00000027,
+0x000001e2,0x000001a4,0x000000fb,0x0004003d,
+0x00000006,0x000001e3,0x000001e2,0x000500c4,
+0x00000006,0x000001e4,0x000001e3,0x0000014e,
+0x000500c5,0x00000006,0x000001e5,0x000001e1,
+0x000001e4,0x00050041,0x00000027,0x000001e6,
+0x000001a4,0x000000f5,0x0004003d,0x00000006,
+0x000001e7,0x000001e6,0x000500c5,0x00000006,
+0x000001e8,0x000001e5,0x000001e7,0x00050041,
+0x00000027,0x000001e9,0x000001c3,0x000000db,
+0x0004003d,0x00000006,0x000001ea,0x000001e9,
+0x000500c4,0x00000006,0x000001eb,0x000001ea,
+0x00000140,0x00050041,0x00000027,0x000001ec,
+0x000001c3,0x000000fb,0x0004003d,0x00000006,
+0x000001ed,0x000001ec,0x000500c4,0x00000006,
+0x000001ee,0x000001ed,0x0000014e,0x000500c5,
+0x00000006,0x000001ef,0x000001eb,0x000001ee,
+0x00050041,0x00000027,0x000001f0,0x000001c3,
+0x000000f5,0x0004003d,0x00000006,0x000001f1,
+0x000001f0,0x000500c5,0x00000006,0x000001f2,
+0x000001ef,0x000001f1,0x000500af,0x0000000f,
+0x000001f3,0x000001e8,0x000001f2,0x000600a9,
+0x0000000d,0x000001f4,0x000001f3,0x000000fb,
+0x000000db,0x0004003d,0x0000000d,0x000001f5,
+0x000001d7,0x000500c5,0x0000000d,0x000001f6,
+0x000001f5,0x000001f4,0x0003003e,0x000001d7,
+0x000001f6,0x0004003d,0x0000000d,0x000001f8,
+0x000001d7,0x0003003e,0x000001f9,0x00000167,
+0x00050041,0x00000027,0x000001fa,0x000001f9,
+0x000001f8,0x0004003d,0x00000006,0x000001fb,
+0x000001fa,0x0003003e,0x000001f7,0x000001fb,
+0x0004003d,0x00000007,0x000001fd,0x000001a4,
+0x00050051,0x00000006,0x000001fe,0x000001fd,
+0x00000000,0x00050051,0x00000006,0x000001ff,
+0x000001fd,0x00000001,0x00050051,0x00000006,
+0x00000200,0x000001fd,0x00000002,0x00060050,
+0x00000007,0x00000201,0x000001fe,0x000001ff,
+0x00000200,0x0004003d,0x00000006,0x00000202,
+0x000001f7,0x00060050,0x00000007,0x00000203,
+0x00000202,0x00000202,0x00000202,0x00050080,
+0x00000007,0x00000204,0x00000201,0x00000203,
+0x0003003e,0x00000205,0x00000204,0x00050039,
+0x00000007,0x00000206,0x0000002d,0x00000205,
+0x00050041,0x00000008,0x00000207,0x000001fc,
+0x00000078,0x0003003e,0x00000207,0x00000206,
+0x0004003d,0x00000007,0x00000208,0x000001a4,
+0x00050051,0x00000006,0x00000209,0x00000208,
+0x00000000,0x00050051,0x00000006,0x0000020a,
+0x00000208,0x00000001,0x00050051,0x00000006,
+0x0000020b,0x00000208,0x00000002,0x00060050,
+0x00000007,0x0000020c,0x00000209,0x0000020a,
+0x0000020b,0x0004003d,0x00000006,0x0000020d,
+0x000001f7,0x00060050,0x00000007,0x0000020e,
+0x0000020d,0x0000020d,0x0000020d,0x00050082,
+0x00000007,0x0000020f,0x0000020c,0x0000020e,
+0x0003003e,0x00000210,0x0000020f,0x00050039,
+0x00000007,0x00000211,0x0000002d,0x00000210,
+0x00050041,0x00000008,0x00000212,0x000001fc,
+0x00000079,0x0003003e,0x00000212,0x00000211,
+0x0004003d,0x00000007,0x00000213,0x000001c3,
+0x00050051,0x00000006,0x00000214,0x00000213,
+0x00000000,0x00050051,0x00000006,0x00000215,
+0x00000213,0x00000001,0x00050051,0x00000006,
+0x00000216,0x00000213,0x00000002,0x00060050,
+0x00000007,0x00000217,0x00000214,0x00000215,
+0x00000216,0x0004003d,0x00000006,0x00000218,
+0x000001f7,0x00060050,0x00000007,0x00000219,
+0x00000218,0x00000218,0x00000218,0x00050080,
+0x00000007,0x0000021a,0x00000217,0x00000219,
+0x0003003e,0x0000021b,0x0000021a,0x00050039,
+0x00000007,0x0000021c,0x0000002d,0x0000021b,
+0x00050041,0x00000008,0x0000021d,0x000001fc,
+0x0000007a,0x0003003e,0x0000021d,0x0000021c,
+0x0004003d,0x00000007,0x0000021e,0x000001c3,
+0x00050051,0x00000006,0x0000021f,0x0000021e,
+0x00000000,0x00050051,0x00000006,0x00000220,
+0x0000021e,0x00000001,0x00050051,0x00000006,
+0x00000221,0x0000021e,0x00000002,0x00060050,
+0x00000007,0x00000222,0x0000021f,0x00000220,
+0x00000221,0x0004003d,0x00000006,0x00000223,
+0x000001f7,0x00060050,0x00000007,0x00000224,
+0x00000223,0x00000223,0x00000223,0x00050082,
+0x00000007,0x00000225,0x00000222,0x00000224,
+0x0003003e,0x00000226,0x00000225,0x00050039,
+0x00000007,0x00000227,0x0000002d,0x00000226,
+0x00050041,0x00000008,0x00000228,0x000001fc,
+0x0000007b,0x0003003e,0x00000228,0x00000227,
+0x0004003d,0x00000030,0x0000022a,0x000001fc,
+0x0003003e,0x00000229,0x0000022a,0x0004003d,
+0x0000000d,0x0000022c,0x00000045,0x0003003e,
+0x0000022b,0x0000022c,0x0004003d,0x0000000f,
+0x0000022e,0x00000046,0x0003003e,0x0000022d,
+0x0000022e,0x0004003d,0x0000000f,0x00000230,
+0x00000047,0x0003003e,0x0000022f,0x00000230,
+0x00080039,0x00000035,0x00000231,0x0000003b,
+0x00000229,0x0000022b,0x0000022d,0x0000022f,
+0x000200fe,0x00000231,0x00010038,0x00050036,
+0x00000035,0x0000004e,0x00000000,0x0000004a,
+0x00030037,0x0000000e,0x0000004b,0x00030037,
+0x0000000e,0x0000004c,0x00030037,0x00000032,
+0x0000004d,0x000200f8,0x0000004f,0x0004003b,
+0x00000008,0x00000234,0x00000007,0x0004003b,
+0x0000000e,0x00000238,0x00000007,0x0004003b,
+0x0000000e,0x00000244,0x00000007,0x0004003b,
+0x0000000e,0x00000255,0x00000007,0x0004003b,
+0x00000008,0x00000259,0x00000007,0x0004003b,
+0x0000000e,0x00000260,0x00000007,0x0004003b,
+0x0000000e,0x00000266,0x00000007,0x0004003b,
+0x0000000e,0x0000026c,0x00000007,0x0004003b,
+0x00000008,0x00000270,0x00000007,0x0004003b,
+0x0000000e,0x00000274,0x00000007,0x0004003b,
+0x0000000e,0x0000027a,0x00000007,0x0004003b,
+0x0000000e,0x0000027e,0x00000007,0x0004003b,
+0x00000027,0x00000283,0x00000007,0x0004003b,
+0x00000027,0x0000028b,0x00000007,0x0004003b,
+0x00000027,0x0000028e,0x00000007,0x0004003b,
+0x00000050,0x00000291,0x00000007,0x0004003b,
+0x00000008,0x000002a8,0x00000007,0x0004003d,
+0x0000000d,0x00000235,0x0000004b,0x000500c2,
+0x0000000d,0x00000237,0x00000235,0x00000236,
+0x0003003e,0x00000238,0x00000237,0x00050039,
+0x0000000d,0x00000239,0x0000001d,0x00000238,
+0x0004007c,0x00000006,0x0000023a,0x00000239,
+0x00050041,0x00000027,0x0000023b,0x00000234,
+0x000000db,0x0003003e,0x0000023b,0x0000023a,
+0x0004003d,0x0000000d,0x0000023c,0x0000004b,
+0x000500c2,0x0000000d,0x0000023d,0x0000023c,
+0x00000130,0x000500c4,0x0000000d,0x0000023e,
+0x0000023d,0x000000b8,0x0004003d,0x0000000d,
+0x0000023f,0x0000004b,0x000500c2,0x0000000d,
+0x00000241,0x0000023f,0x00000240,0x000500c7,
+0x0000000d,0x00000242,0x00000241,0x000000a8,
+0x000500c5,0x0000000d,0x00000243,0x0000023e,
+0x00000242,0x0003003e,0x00000244,0x00000243,
+0x00050039,0x0000000d,0x00000245,0x00000020,
+0x00000244,0x0004007c,0x00000006,0x00000246,
+0x00000245,0x00050041,0x00000027,0x00000247,
+0x00000234,0x000000fb,0x0003003e,0x00000247,
+0x00000246,0x0004003d,0x0000000d,0x00000248,
+0x0000004b,0x000500c2,0x0000000d,0x00000249,
+0x00000248,0x00000140,0x000500c4,0x0000000d,
+0x0000024b,0x00000249,0x0000024a,0x0004003d,
+0x0000000d,0x0000024c,0x0000004b,0x000500c2,
+0x0000000d,0x0000024d,0x0000024c,0x00000163,
+0x000500c7,0x0000000d,0x0000024e,0x0000024d,
+0x0000012c,0x000500c4,0x0000000d,0x0000024f,
+0x0000024e,0x0000007b,0x000500c5,0x0000000d,
+0x00000250,0x0000024b,0x0000024f,0x0004003d,
+0x0000000d,0x00000251,0x0000004b,0x000500c2,
+0x0000000d,0x00000252,0x00000251,0x000001cb,
+0x000500c7,0x0000000d,0x00000253,0x00000252,
+0x00000081,0x000500c5,0x0000000d,0x00000254,
+0x00000250,0x00000253,0x0003003e,0x00000255,
+0x00000254,0x00050039,0x0000000d,0x00000256,
+0x0000001d,0x00000255,0x0004007c,0x00000006,
+0x00000257,0x00000256,0x00050041,0x00000027,
+0x00000258,0x00000234,0x000000f5,0x0003003e,
+0x00000258,0x00000257,0x0004003d,0x0000000d,
+0x0000025a,0x0000004b,0x000500c2,0x0000000d,
+0x0000025b,0x0000025a,0x0000007a,0x000500c4,
+0x0000000d,0x0000025c,0x0000025b,0x00000079,
+0x0004003d,0x0000000d,0x0000025d,0x0000004b,
+0x000500c7,0x0000000d,0x0000025e,0x0000025d,
+0x000000fb,0x000500c5,0x0000000d,0x0000025f,
+0x0000025c,0x0000025e,0x0003003e,0x00000260,
+0x0000025f,0x00050039,0x0000000d,0x00000261,
+0x0000001d,0x00000260,0x0004007c,0x00000006,
+0x00000262,0x00000261,0x00050041,0x00000027,
+0x00000263,0x00000259,0x000000db,0x0003003e,
+0x00000263,0x00000262,0x0004003d,0x0000000d,
+0x00000264,0x0000004c,0x000500c2,0x0000000d,
+0x00000265,0x00000264,0x00000236,0x0003003e,
+0x00000266,0x00000265,0x00050039,0x0000000d,
+0x00000267,0x00000020,0x00000266,0x0004007c,
+0x00000006,0x00000268,0x00000267,0x00050041,
+0x00000027,0x00000269,0x00000259,0x000000fb,
+0x0003003e,0x00000269,0x00000268,0x0004003d,
+0x0000000d,0x0000026a,0x0000004c,0x000500c2,
+0x0000000d,0x0000026b,0x0000026a,0x000001b7,
+0x0003003e,0x0000026c,0x0000026b,0x00050039,
+0x0000000d,0x0000026d,0x0000001d,0x0000026c,
+0x0004007c,0x00000006,0x0000026e,0x0000026d,
+0x00050041,0x00000027,0x0000026f,0x00000259,
+0x000000f5,0x0003003e,0x0000026f,0x0000026e,
+0x0004003d,0x0000000d,0x00000271,0x0000004c,
+0x000500c2,0x0000000d,0x00000273,0x00000271,
+0x00000272,0x0003003e,0x00000274,0x00000273,
+0x00050039,0x0000000d,0x00000275,0x0000001d,
+0x00000274,0x0004007c,0x00000006,0x00000276,
+0x00000275,0x00050041,0x00000027,0x00000277,
+0x00000270,0x000000db,0x0003003e,0x00000277,
+0x00000276,0x0004003d,0x0000000d,0x00000278,
+0x0000004c,0x000500c2,0x0000000d,0x00000279,
+0x00000278,0x000000b8,0x0003003e,0x0000027a,
+0x00000279,0x00050039,0x0000000d,0x0000027b,
+0x00000020,0x0000027a,0x0004007c,0x00000006,
+0x0000027c,0x0000027b,0x00050041,0x00000027,
+0x0000027d,0x00000270,0x000000fb,0x0003003e,
+0x0000027d,0x0000027c,0x0004003d,0x0000000d,
+0x0000027f,0x0000004c,0x0003003e,0x0000027e,
+0x0000027f,0x00050039,0x0000000d,0x00000280,
+0x0000001d,0x0000027e,0x0004007c,0x00000006,
+0x00000281,0x00000280,0x00050041,0x00000027,
+0x00000282,0x00000270,0x000000f5,0x0003003e,
+0x00000282,0x00000281,0x0003003e,0x00000283,
+0x00000078,0x000200f9,0x00000284,0x000200f8,
+0x00000284,0x000400f6,0x00000286,0x00000287,
+0x00000000,0x000200f9,0x00000288,0x000200f8,
+0x00000288,0x0004003d,0x00000006,0x00000289,
+0x00000283,0x000500b1,0x0000000f,0x0000028a,
+0x00000289,0x00000140,0x000400fa,0x0000028a,
+0x00000285,0x00000286,0x000200f8,0x00000285,
+0x0004003d,0x00000006,0x0000028c,0x00000283,
+0x000500c3,0x00000006,0x0000028d,0x0000028c,
+0x0000007a,0x0003003e,0x0000028b,0x0000028d,
+0x0004003d,0x00000006,0x0000028f,0x00000283,
+0x000500c7,0x00000006,0x00000290,0x0000028f,
+0x0000007b,0x0003003e,0x0000028e,0x00000290,
+0x0004003d,0x00000006,0x00000292,0x00000283,
+0x0004003d,0x00000006,0x00000293,0x0000028e,
+0x0004003d,0x00000007,0x00000294,0x00000259,
+0x0004003d,0x00000007,0x00000295,0x00000234,
+0x00050082,0x00000007,0x00000296,0x00000294,
+0x00000295,0x00060050,0x00000007,0x00000297,
+0x00000293,0x00000293,0x00000293,0x00050084,
+0x00000007,0x00000298,0x00000297,0x00000296,
+0x0004003d,0x00000006,0x00000299,0x0000028b,
+0x0004003d,0x00000007,0x0000029a,0x00000270,
+0x0004003d,0x00000007,0x0000029b,0x00000234,
+0x00050082,0x00000007,0x0000029c,0x0000029a,
+0x0000029b,0x00060050,0x00000007,0x0000029d,
+0x00000299,0x00000299,0x00000299,0x00050084,
+0x00000007,0x0000029e,0x0000029d,0x0000029c,
+0x00050080,0x00000007,0x0000029f,0x00000298,
+0x0000029e,0x0004003d,0x00000007,0x000002a0,
+0x00000234,0x00060050,0x00000007,0x000002a1,
+0x00000096,0x00000096,0x00000096,0x00050084,
+0x00000007,0x000002a2,0x000002a1,0x000002a0,
+0x00050080,0x00000007,0x000002a3,0x0000029f,
+0x000002a2,0x00060050,0x00000007,0x000002a4,
+0x0000007a,0x0000007a,0x0000007a,0x00050080,
+0x00000007,0x000002a5,0x000002a3,0x000002a4,
+0x00060050,0x00000007,0x000002a6,0x0000007a,
+0x0000007a,0x0000007a,0x000500c3,0x00000007,
+0x000002a7,0x000002a5,0x000002a6,0x0003003e,
+0x000002a8,0x000002a7,0x00050039,0x00000007,
+0x000002a9,0x0000002d,0x000002a8,0x00050051,
+0x00000006,0x000002aa,0x000002a9,0x00000000,
+0x00050051,0x00000006,0x000002ab,0x000002a9,
+0x00000001,0x00050051,0x00000006,0x000002ac,
+0x000002a9,0x00000002,0x00070050,0x00000033,
+0x000002ad,0x000002aa,0x000002ab,0x000002ac,
+0x000000cc,0x00050041,0x00000051,0x000002ae,
+0x00000291,0x00000292,0x0003003e,0x000002ae,
+0x000002ad,0x0004003d,0x00000006,0x000002af,
+0x00000283,0x00060041,0x00000027,0x000002b0,
+0x00000291,0x000002af,0x0000012c,0x0003003e,
+0x000002b0,0x000000cc,0x000200f9,0x00000287,
+0x000200f8,0x00000287,0x0004003d,0x00000006,
+0x000002b1,0x00000283,0x00050080,0x00000006,
+0x000002b2,0x000002b1,0x00000079,0x0003003e,
+0x00000283,0x000002b2,0x000200f9,0x00000284,
+0x000200f8,0x00000286,0x0004003d,0x00000035,
+0x000002b3,0x00000291,0x000200fe,0x000002b3,
+0x00010038,0x00050036,0x00000002,0x0000005d,
+0x00000000,0x00000052,0x00030037,0x00000050,
+0x00000053,0x00030037,0x00000027,0x00000054,
+0x00030037,0x00000027,0x00000055,0x00030037,
+0x00000027,0x00000056,0x00030037,0x00000051,
+0x00000057,0x00030037,0x0000000e,0x00000058,
+0x00030037,0x00000032,0x00000059,0x00030037,
+0x00000032,0x0000005a,0x00030037,0x00000032,
+0x0000005b,0x00030037,0x00000032,0x0000005c,
+0x000200f8,0x0000005e,0x0004003b,0x0000000e,
+0x000002b6,0x00000007,0x0004003b,0x0000000e,
+0x000002b7,0x00000007,0x0004003b,0x00000027,
+0x000002bf,0x00000007,0x0004003b,0x0000000e,
+0x000002ca,0x00000007,0x0004003b,0x0000000e,
+0x000002d0,0x00000007,0x0004003b,0x0000000e,
+0x000002e1,0x00000007,0x0004003b,0x0000000e,
+0x000002e6,0x00000007,0x0004003b,0x0000000e,
+0x000002ec,0x00000007,0x0004003b,0x0000000e,
+0x000002f1,0x00000007,0x0004003b,0x0000000e,
+0x00000305,0x00000007,0x0004003b,0x00000027,
+0x00000309,0x00000007,0x0004003b,0x00000027,
+0x00000311,0x00000007,0x0004003b,0x00000027,
+0x00000316,0x00000007,0x0004003b,0x00000027,
+0x0000031b,0x00000007,0x0003003e,0x000002b6,
+0x000000db,0x0003003e,0x000002b7,0x000000db,
+0x0004003d,0x0000000f,0x000002b8,0x00000059,
+0x000300f7,0x000002ba,0x00000000,0x000400fa,
+0x000002b8,0x000002b9,0x000002ba,0x000200f8,
+0x000002b9,0x0004003d,0x0000000f,0x000002bb,
+0x0000005a,0x000300f7,0x000002bd,0x00000000,
+0x000400fa,0x000002bb,0x000002bc,0x000002be,
+0x000200f8,0x000002bc,0x0003003e,0x000002b7,
+0x000000f5,0x000200f9,0x000002bd,0x000200f8,
+0x000002be,0x0003003e,0x000002b6,0x000000f5,
+0x000200f9,0x000002bd,0x000200f8,0x000002bd,
+0x000200f9,0x000002ba,0x000200f8,0x000002ba,
+0x0003003e,0x000002bf,0x00000078,0x000200f9,
+0x000002c0,0x000200f8,0x000002c0,0x000400f6,
+0x000002c2,0x000002c3,0x00000000,0x000200f9,
+0x000002c4,0x000200f8,0x000002c4,0x0004003d,
+0x00000006,0x000002c5,0x000002bf,0x000500b1,
+0x0000000f,0x000002c6,0x000002c5,0x0000014e,
+0x000400fa,0x000002c6,0x000002c1,0x000002c2,
+0x000200f8,0x000002c1,0x0004003d,0x0000000f,
+0x000002c7,0x0000005a,0x000300f7,0x000002c9,
+0x00000000,0x000400fa,0x000002c7,0x000002c8,
+0x000002d6,0x000200f8,0x000002c8,0x0004003d,
+0x0000000d,0x000002cb,0x000002b6,0x0004003d,
+0x00000006,0x000002cc,0x000002bf,0x000500c3,
+0x00000006,0x000002cd,0x000002cc,0x00000079,
+0x0004007c,0x0000000d,0x000002ce,0x000002cd,
+0x00050080,0x0000000d,0x000002cf,0x000002cb,
+0x000002ce,0x0003003e,0x000002ca,0x000002cf,
+0x0004003d,0x0000000d,0x000002d1,0x000002b7,
+0x0004003d,0x00000006,0x000002d2,0x000002bf,
+0x000500c7,0x00000006,0x000002d3,0x000002d2,
+0x00000079,0x0004007c,0x0000000d,0x000002d4,
+0x000002d3,0x00050080,0x0000000d,0x000002d5,
+0x000002d1,0x000002d4,0x0003003e,0x000002d0,
+0x000002d5,0x000200f9,0x000002c9,0x000200f8,
+0x000002d6,0x0004003d,0x0000000d,0x000002d7,
+0x000002b6,0x0004003d,0x00000006,0x000002d8,
+0x000002bf,0x000500c3,0x00000006,0x000002d9,
+0x000002d8,0x0000007a,0x0004007c,0x0000000d,
+0x000002da,0x000002d9,0x00050080,0x0000000d,
+0x000002db,0x000002d7,0x000002da,0x0003003e,
+0x000002ca,0x000002db,0x0004003d,0x0000000d,
+0x000002dc,0x000002b7,0x0004003d,0x00000006,
+0x000002dd,0x000002bf,0x000500c7,0x00000006,
+0x000002de,0x000002dd,0x0000007b,0x0004007c,
+0x0000000d,0x000002df,0x000002de,0x00050080,
+0x0000000d,0x000002e0,0x000002dc,0x000002df,
+0x0003003e,0x000002d0,0x000002e0,0x000200f9,
+0x000002c9,0x000200f8,0x000002c9,0x0004003d,
+0x0000000d,0x000002e2,0x000002d0,0x0004003d,
+0x0000000d,0x000002e3,0x000002ca,0x00050084,
+0x0000000d,0x000002e4,0x000002e3,0x0000002f,
+0x00050080,0x0000000d,0x000002e5,0x000002e2,
+0x000002e4,0x0003003e,0x000002e1,0x000002e5,
+0x0004003d,0x0000000d,0x000002e7,0x00000058,
+0x0004003d,0x0000000d,0x000002e8,0x000002e1,
+0x00050080,0x0000000d,0x000002e9,0x000002e8,
+0x00000093,0x000500c2,0x0000000d,0x000002ea,
+0x000002e7,0x000002e9,0x000500c7,0x0000000d,
+0x000002eb,0x000002ea,0x000000f5,0x0003003e,
+0x000002e6,0x000002eb,0x0004003d,0x0000000d,
+0x000002ed,0x00000058,0x0004003d,0x0000000d,
+0x000002ee,0x000002e1,0x000500c2,0x0000000d,
+0x000002ef,0x000002ed,0x000002ee,0x000500c7,
+0x0000000d,0x000002f0,0x000002ef,0x000000fb,
+0x0003003e,0x000002ec,0x000002f0,0x0004003d,
+0x0000000d,0x000002f2,0x000002ca,0x0004003d,
+0x0000000d,0x000002f3,0x000002d0,0x00050084,
+0x0000000d,0x000002f4,0x0000002f,0x000002f3,
+0x00050080,0x0000000d,0x000002f5,0x000002f2,
+0x000002f4,0x0003003e,0x000002f1,0x000002f5,
+0x0004003d,0x0000000f,0x000002f6,0x0000005b,
+0x0004003d,0x0000000f,0x000002f7,0x0000005c,
+0x000400a8,0x0000000f,0x000002f8,0x000002f7,
+0x000500a7,0x0000000f,0x000002f9,0x000002f6,
+0x000002f8,0x0004003d,0x0000000d,0x000002fa,
+0x000002e6,0x000500ab,0x0000000f,0x000002fb,
+0x000002fa,0x000000db,0x000500a7,0x0000000f,
+0x000002fc,0x000002f9,0x000002fb,0x0004003d,
+0x0000000d,0x000002fd,0x000002ec,0x000500aa,
+0x0000000f,0x000002fe,0x000002fd,0x000000db,
+0x000500a7,0x0000000f,0x000002ff,0x000002fc,
+0x000002fe,0x000300f7,0x00000301,0x00000000,
+0x000400fa,0x000002ff,0x00000300,0x00000304,
+0x000200f8,0x00000300,0x0004003d,0x0000000d,
+0x00000302,0x000002f1,0x00050041,0x00000051,
+0x00000303,0x00000053,0x00000302,0x0003003e,
+0x00000303,0x0000010e,0x000200f9,0x00000301,
+0x000200f8,0x00000304,0x0004003d,0x0000000d,
+0x00000306,0x000002ec,0x0004003d,0x0000000d,
+0x00000307,0x000002e6,0x000500c5,0x0000000d,
+0x00000308,0x00000306,0x00000307,0x0003003e,
+0x00000305,0x00000308,0x0004003d,0x0000000d,
+0x0000030a,0x00000305,0x00050041,0x00000027,
+0x0000030b,0x00000057,0x0000030a,0x0004003d,
+0x00000006,0x0000030c,0x0000030b,0x0003003e,
+0x00000309,0x0000030c,0x0004003d,0x0000000d,
+0x0000030d,0x000002f1,0x0004003d,0x00000006,
+0x0000030e,0x00000054,0x0004003d,0x00000006,
+0x0000030f,0x00000309,0x00050080,0x00000006,
+0x00000310,0x0000030e,0x0000030f,0x0003003e,
+0x00000311,0x00000310,0x00050039,0x00000006,
+0x00000312,0x0000002a,0x00000311,0x0004003d,
+0x00000006,0x00000313,0x00000055,0x0004003d,
+0x00000006,0x00000314,0x00000309,0x00050080,
+0x00000006,0x00000315,0x00000313,0x00000314,
+0x0003003e,0x00000316,0x00000315,0x00050039,
+0x00000006,0x00000317,0x0000002a,0x00000316,
+0x0004003d,0x00000006,0x00000318,0x00000056,
+0x0004003d,0x00000006,0x00000319,0x00000309,
+0x00050080,0x00000006,0x0000031a,0x00000318,
+0x00000319,0x0003003e,0x0000031b,0x0000031a,
+0x00050039,0x00000006,0x0000031c,0x0000002a,
+0x0000031b,0x00070050,0x00000033,0x0000031d,
+0x00000312,0x00000317,0x0000031c,0x000000cc,
+0x00050041,0x00000051,0x0000031e,0x00000053,
+0x0000030d,0x0003003e,0x0000031e,0x0000031d,
+0x000200f9,0x00000301,0x000200f8,0x00000301,
+0x000200f9,0x000002c3,0x000200f8,0x000002c3,
+0x0004003d,0x00000006,0x0000031f,0x000002bf,
+0x00050080,0x00000006,0x00000320,0x0000031f,
+0x00000079,0x0003003e,0x000002bf,0x00000320,
+0x000200f9,0x000002c0,0x000200f8,0x000002c2,
+0x000100fd,0x00010038,0x00050036,0x00000035,
+0x00000062,0x00000000,0x0000004a,0x00030037,
+0x0000000e,0x0000005f,0x00030037,0x0000000e,
+0x00000060,0x00030037,0x00000032,0x00000061,
+0x000200f8,0x00000063,0x0004003b,0x00000032,
+0x00000321,0x00000007,0x0004003b,0x0000000e,
+0x00000330,0x00000007,0x0004003b,0x0000000e,
+0x00000333,0x00000007,0x0004003b,0x0000000e,
+0x00000336,0x00000007,0x0004003b,0x0000000e,
+0x0000033b,0x00000007,0x0004003b,0x0000000e,
+0x0000033d,0x00000007,0x0004003b,0x0000000e,
+0x00000341,0x00000007,0x0004003b,0x0000000e,
+0x00000343,0x00000007,0x0004003b,0x00000032,
+0x00000345,0x00000007,0x0004003b,0x00000032,
+0x00000347,0x00000007,0x0004003b,0x0000000e,
+0x0000034d,0x00000007,0x0004003b,0x0000000e,
+0x0000034f,0x00000007,0x0004003b,0x0000000e,
+0x00000353,0x00000007,0x0004003b,0x0000000e,
+0x00000355,0x00000007,0x0004003b,0x00000032,
+0x00000357,0x00000007,0x0004003b,0x00000032,
+0x00000359,0x00000007,0x0004003b,0x0000000e,
+0x0000035f,0x00000007,0x0004003b,0x0000000e,
+0x00000361,0x00000007,0x0004003b,0x0000000e,
+0x00000365,0x00000007,0x0004003b,0x0000000e,
+0x00000367,0x00000007,0x0004003b,0x00000032,
+0x00000369,0x00000007,0x0004003b,0x00000027,
+0x0000036d,0x00000007,0x0004003b,0x0000000e,
+0x0000036e,0x00000007,0x0004003b,0x00000027,
+0x00000372,0x00000007,0x0004003b,0x0000000e,
+0x00000375,0x00000007,0x0004003b,0x0000000e,
+0x00000377,0x00000007,0x0004003b,0x00000027,
+0x0000037a,0x00000007,0x0004003b,0x0000000e,
+0x0000037b,0x00000007,0x0004003b,0x00000027,
+0x0000037f,0x00000007,0x0004003b,0x0000000e,
+0x00000382,0x00000007,0x0004003b,0x0000000e,
+0x00000384,0x00000007,0x0004003b,0x00000027,
+0x00000387,0x00000007,0x0004003b,0x0000000e,
+0x00000388,0x00000007,0x0004003b,0x00000027,
+0x0000038c,0x00000007,0x0004003b,0x0000000e,
+0x0000038f,0x00000007,0x0004003b,0x0000000e,
+0x00000391,0x00000007,0x0004003b,0x0000000e,
+0x00000398,0x00000007,0x0004003b,0x0000000e,
+0x0000039d,0x00000007,0x0004003b,0x0000000e,
+0x000003a2,0x00000007,0x0004003b,0x0000000e,
+0x000003a7,0x00000007,0x0004003b,0x0000000e,
+0x000003ac,0x00000007,0x0004003b,0x0000000e,
+0x000003b1,0x00000007,0x0004003b,0x0000000e,
+0x000003b4,0x00000007,0x0004003b,0x0000000e,
+0x000003b8,0x00000007,0x0004003b,0x00000051,
+0x000003c2,0x00000007,0x0004003b,0x000003e7,
+0x000003e8,0x00000007,0x0004003b,0x00000051,
+0x000003eb,0x00000007,0x0004003b,0x000003e7,
+0x000003ed,0x00000007,0x0004003b,0x000003e7,
+0x000003fb,0x00000007,0x0004003b,0x000003e7,
+0x000003ff,0x00000007,0x0004003b,0x00000032,
+0x00000402,0x00000007,0x0004003b,0x00000050,
+0x00000406,0x00000007,0x0004003b,0x00000050,
+0x00000408,0x00000007,0x0004003b,0x00000027,
+0x0000040a,0x00000007,0x0004003b,0x00000027,
+0x0000040c,0x00000007,0x0004003b,0x00000027,
+0x0000040e,0x00000007,0x0004003b,0x00000051,
+0x00000410,0x00000007,0x0004003b,0x0000000e,
+0x00000412,0x00000007,0x0004003b,0x00000032,
+0x00000414,0x00000007,0x0004003b,0x00000032,
+0x00000415,0x00000007,0x0004003b,0x00000032,
+0x00000417,0x00000007,0x0004003b,0x00000032,
+0x00000419,0x00000007,0x0004003b,0x00000050,
+0x0000041e,0x00000007,0x0004003b,0x00000027,
+0x00000420,0x00000007,0x0004003b,0x00000027,
+0x00000422,0x00000007,0x0004003b,0x00000027,
+0x00000424,0x00000007,0x0004003b,0x00000051,
+0x00000426,0x00000007,0x0004003b,0x0000000e,
+0x00000428,0x00000007,0x0004003b,0x00000032,
+0x0000042a,0x00000007,0x0004003b,0x00000032,
+0x0000042b,0x00000007,0x0004003b,0x00000032,
+0x0000042d,0x00000007,0x0004003b,0x00000032,
+0x0000042f,0x00000007,0x0004003d,0x0000000d,
+0x00000322,0x0000005f,0x000500c2,0x0000000d,
+0x00000323,0x00000322,0x00000079,0x000500c7,
+0x0000000d,0x00000324,0x00000323,0x000000fb,
+0x000500ab,0x0000000f,0x00000325,0x00000324,
+0x000000db,0x0003003e,0x00000321,0x00000325,
+0x0004003d,0x0000000f,0x00000326,0x00000061,
+0x000400a8,0x0000000f,0x00000327,0x00000326,
+0x000300f7,0x00000329,0x00000000,0x000400fa,
+0x00000327,0x00000328,0x00000329,0x000200f8,
+0x00000328,0x0004003d,0x0000000d,0x0000032a,
+0x0000005f,0x000500c7,0x0000000d,0x0000032b,
+0x0000032a,0x000000f5,0x000500ab,0x0000000f,
+0x0000032c,0x0000032b,0x000000db,0x000200f9,
+0x00000329,0x000200f8,0x00000329,0x000700f5,
+0x0000000f,0x0000032d,0x00000326,0x00000063,
+0x0000032c,0x00000328,0x000300f7,0x0000032f,
+0x00000000,0x000400fa,0x0000032d,0x0000032e,
+0x00000394,0x000200f8,0x0000032e,0x0004003d,
+0x0000000d,0x00000331,0x0000005f,0x000500c2,
+0x0000000d,0x00000332,0x00000331,0x0000012a,
+0x0003003e,0x00000330,0x00000332,0x0004003d,
+0x0000000d,0x00000334,0x0000005f,0x000500c2,
+0x0000000d,0x00000335,0x00000334,0x000001b7,
+0x0003003e,0x00000333,0x00000335,0x0004003d,
+0x0000000d,0x00000337,0x0000005f,0x000500c2,
+0x0000000d,0x00000338,0x00000337,0x00000163,
+0x0003003e,0x00000336,0x00000338,0x0004003d,
+0x0000000d,0x00000339,0x0000005f,0x000500c2,
+0x0000000d,0x0000033a,0x00000339,0x00000130,
+0x0004003d,0x0000000d,0x0000033c,0x00000330,
+0x0003003e,0x0000033b,0x0000033c,0x0003003e,
+0x0000033d,0x0000033a,0x00060039,0x0000000f,
+0x0000033e,0x00000013,0x0000033b,0x0000033d,
+0x000300f7,0x00000340,0x00000000,0x000400fa,
+0x0000033e,0x0000033f,0x00000340,0x000200f8,
+0x0000033f,0x0004003d,0x0000000d,0x00000342,
+0x0000005f,0x0003003e,0x00000341,0x00000342,
+0x0004003d,0x0000000d,0x00000344,0x00000060,
+0x0003003e,0x00000343,0x00000344,0x0004003d,
+0x0000000f,0x00000346,0x00000061,0x0003003e,
+0x00000345,0x00000346,0x0004003d,0x0000000f,
+0x00000348,0x00000321,0x0003003e,0x00000347,
+0x00000348,0x00080039,0x00000035,0x00000349,
+0x00000042,0x00000341,0x00000343,0x00000345,
+0x00000347,0x000200fe,0x00000349,0x000200f8,
+0x00000340,0x0004003d,0x0000000d,0x0000034b,
+0x0000005f,0x000500c2,0x0000000d,0x0000034c,
+0x0000034b,0x00000140,0x0004003d,0x0000000d,
+0x0000034e,0x00000333,0x0003003e,0x0000034d,
+0x0000034e,0x0003003e,0x0000034f,0x0000034c,
+0x00060039,0x0000000f,0x00000350,0x00000013,
+0x0000034d,0x0000034f,0x000300f7,0x00000352,
+0x00000000,0x000400fa,0x00000350,0x00000351,
+0x00000352,0x000200f8,0x00000351,0x0004003d,
+0x0000000d,0x00000354,0x0000005f,0x0003003e,
+0x00000353,0x00000354,0x0004003d,0x0000000d,
+0x00000356,0x00000060,0x0003003e,0x00000355,
+0x00000356,0x0004003d,0x0000000f,0x00000358,
+0x00000061,0x0003003e,0x00000357,0x00000358,
+0x0004003d,0x0000000f,0x0000035a,0x00000321,
+0x0003003e,0x00000359,0x0000035a,0x00080039,
+0x00000035,0x0000035b,0x00000048,0x00000353,
+0x00000355,0x00000357,0x00000359,0x000200fe,
+0x0000035b,0x000200f8,0x00000352,0x0004003d,
+0x0000000d,0x0000035d,0x0000005f,0x000500c2,
+0x0000000d,0x0000035e,0x0000035d,0x0000014e,
+0x0004003d,0x0000000d,0x00000360,0x00000336,
+0x0003003e,0x0000035f,0x00000360,0x0003003e,
+0x00000361,0x0000035e,0x00060039,0x0000000f,
+0x00000362,0x00000013,0x0000035f,0x00000361,
+0x000300f7,0x00000364,0x00000000,0x000400fa,
+0x00000362,0x00000363,0x00000364,0x000200f8,
+0x00000363,0x0004003d,0x0000000d,0x00000366,
+0x0000005f,0x0003003e,0x00000365,0x00000366,
+0x0004003d,0x0000000d,0x00000368,0x00000060,
+0x0003003e,0x00000367,0x00000368,0x0004003d,
+0x0000000f,0x0000036a,0x00000061,0x0003003e,
+0x00000369,0x0000036a,0x00070039,0x00000035,
+0x0000036b,0x0000004e,0x00000365,0x00000367,
+0x00000369,0x000200fe,0x0000036b,0x000200f8,
+0x00000364,0x0004003d,0x0000000d,0x0000036f,
+0x00000330,0x0003003e,0x0000036e,0x0000036f,
+0x00050039,0x0000000d,0x00000370,0x0000001a,
+0x0000036e,0x0004007c,0x00000006,0x00000371,
+0x00000370,0x0003003e,0x0000036d,0x00000371,
+0x0004003d,0x0000000d,0x00000373,0x0000005f,
+0x000500c2,0x0000000d,0x00000374,0x00000373,
+0x00000130,0x0004003d,0x0000000d,0x00000376,
+0x00000330,0x0003003e,0x00000375,0x00000376,
+0x0003003e,0x00000377,0x00000374,0x00060039,
+0x0000000d,0x00000378,0x00000025,0x00000375,
+0x00000377,0x0004007c,0x00000006,0x00000379,
+0x00000378,0x0003003e,0x00000372,0x00000379,
+0x0004003d,0x0000000d,0x0000037c,0x00000333,
+0x0003003e,0x0000037b,0x0000037c,0x00050039,
+0x0000000d,0x0000037d,0x0000001a,0x0000037b,
+0x0004007c,0x00000006,0x0000037e,0x0000037d,
+0x0003003e,0x0000037a,0x0000037e,0x0004003d,
+0x0000000d,0x00000380,0x0000005f,0x000500c2,
+0x0000000d,0x00000381,0x00000380,0x00000140,
+0x0004003d,0x0000000d,0x00000383,0x00000333,
+0x0003003e,0x00000382,0x00000383,0x0003003e,
+0x00000384,0x00000381,0x00060039,0x0000000d,
+0x00000385,0x00000025,0x00000382,0x00000384,
+0x0004007c,0x00000006,0x00000386,0x00000385,
+0x0003003e,0x0000037f,0x00000386,0x0004003d,
+0x0000000d,0x00000389,0x00000336,0x0003003e,
+0x00000388,0x00000389,0x00050039,0x0000000d,
+0x0000038a,0x0000001a,0x00000388,0x0004007c,
+0x00000006,0x0000038b,0x0000038a,0x0003003e,
+0x00000387,0x0000038b,0x0004003d,0x0000000d,
+0x0000038d,0x0000005f,0x000500c2,0x0000000d,
+0x0000038e,0x0000038d,0x0000014e,0x0004003d,
+0x0000000d,0x00000390,0x00000336,0x0003003e,
+0x0000038f,0x00000390,0x0003003e,0x00000391,
+0x0000038e,0x00060039,0x0000000d,0x00000392,
+0x00000025,0x0000038f,0x00000391,0x0004007c,
+0x00000006,0x00000393,0x00000392,0x0003003e,
+0x0000038c,0x00000393,0x000200f9,0x0000032f,
+0x000200f8,0x00000394,0x0004003d,0x0000000d,
+0x00000395,0x0000005f,0x000500c2,0x0000000d,
+0x00000397,0x00000395,0x00000396,0x0003003e,
+0x00000398,0x00000397,0x00050039,0x0000000d,
+0x00000399,0x00000017,0x00000398,0x0004007c,
+0x00000006,0x0000039a,0x00000399,0x0003003e,
+0x0000036d,0x0000039a,0x0004003d,0x0000000d,
+0x0000039b,0x0000005f,0x000500c2,0x0000000d,
+0x0000039c,0x0000039b,0x00000130,0x0003003e,
+0x0000039d,0x0000039c,0x00050039,0x0000000d,
+0x0000039e,0x00000017,0x0000039d,0x0004007c,
+0x00000006,0x0000039f,0x0000039e,0x0003003e,
+0x00000372,0x0000039f,0x0004003d,0x0000000d,
+0x000003a0,0x0000005f,0x000500c2,0x0000000d,
+0x000003a1,0x000003a0,0x00000139,0x0003003e,
+0x000003a2,0x000003a1,0x00050039,0x0000000d,
+0x000003a3,0x00000017,0x000003a2,0x0004007c,
+0x00000006,0x000003a4,0x000003a3,0x0003003e,
+0x0000037a,0x000003a4,0x0004003d,0x0000000d,
+0x000003a5,0x0000005f,0x000500c2,0x0000000d,
+0x000003a6,0x000003a5,0x00000140,0x0003003e,
+0x000003a7,0x000003a6,0x00050039,0x0000000d,
+0x000003a8,0x00000017,0x000003a7,0x0004007c,
+0x00000006,0x000003a9,0x000003a8,0x0003003e,
+0x0000037f,0x000003a9,0x0004003d,0x0000000d,
+0x000003aa,0x0000005f,0x000500c2,0x0000000d,
+0x000003ab,0x000003aa,0x00000147,0x0003003e,
+0x000003ac,0x000003ab,0x00050039,0x0000000d,
+0x000003ad,0x00000017,0x000003ac,0x0004007c,
+0x00000006,0x000003ae,0x000003ad,0x0003003e,
+0x00000387,0x000003ae,0x0004003d,0x0000000d,
+0x000003af,0x0000005f,0x000500c2,0x0000000d,
+0x000003b0,0x000003af,0x0000014e,0x0003003e,
+0x000003b1,0x000003b0,0x00050039,0x0000000d,
+0x000003b2,0x00000017,0x000003b1,0x0004007c,
+0x00000006,0x000003b3,0x000003b2,0x0003003e,
+0x0000038c,0x000003b3,0x000200f9,0x0000032f,
+0x000200f8,0x0000032f,0x0004003d,0x0000000d,
+0x000003b5,0x0000005f,0x000500c2,0x0000000d,
+0x000003b6,0x000003b5,0x0000024a,0x000500c7,
+0x0000000d,0x000003b7,0x00000081,0x000003b6,
+0x0003003e,0x000003b4,0x000003b7,0x0004003d,
+0x0000000d,0x000003b9,0x0000005f,0x000500c2,
+0x0000000d,0x000003ba,0x000003b9,0x0000007a,
+0x000500c7,0x0000000d,0x000003bb,0x00000081,
+0x000003ba,0x0003003e,0x000003b8,0x000003bb,
+0x0004003d,0x0000000f,0x000003bc,0x00000321,
+0x0004003d,0x0000000f,0x000003bd,0x00000061,
+0x000400a8,0x0000000f,0x000003be,0x000003bd,
+0x000500a6,0x0000000f,0x000003bf,0x000003bc,
+0x000003be,0x000300f7,0x000003c1,0x00000000,
+0x000400fa,0x000003bf,0x000003c0,0x000003f0,
+0x000200f8,0x000003c0,0x0004003d,0x0000000d,
+0x000003e6,0x000003b4,0x0003003e,0x000003e8,
+0x000003e5,0x00050041,0x00000051,0x000003e9,
+0x000003e8,0x000003e6,0x0004003d,0x00000033,
+0x000003ea,0x000003e9,0x0003003e,0x000003c2,
+0x000003ea,0x0004003d,0x0000000d,0x000003ec,
+0x000003b8,0x0003003e,0x000003ed,0x000003e5,
+0x00050041,0x00000051,0x000003ee,0x000003ed,
+0x000003ec,0x0004003d,0x00000033,0x000003ef,
+0x000003ee,0x0003003e,0x000003eb,0x000003ef,
+0x000200f9,0x000003c1,0x000200f8,0x000003f0,
+0x0004003d,0x0000000d,0x000003fa,0x000003b4,
+0x0003003e,0x000003fb,0x000003f9,0x00050041,
+0x00000051,0x000003fc,0x000003fb,0x000003fa,
+0x0004003d,0x00000033,0x000003fd,0x000003fc,
+0x0003003e,0x000003c2,0x000003fd,0x0004003d,
+0x0000000d,0x000003fe,0x000003b8,0x0003003e,
+0x000003ff,0x000003f9,0x00050041,0x00000051,
+0x00000400,0x000003ff,0x000003fe,0x0004003d,
+0x00000033,0x00000401,0x00000400,0x0003003e,
+0x000003eb,0x00000401,0x000200f9,0x000003c1,
+0x000200f8,0x000003c1,0x0004003d,0x0000000d,
+0x00000403,0x0000005f,0x000500c7,0x0000000d,
+0x00000404,0x00000403,0x000000fb,0x000500ab,
+0x0000000f,0x00000405,0x00000404,0x000000db,
+0x0003003e,0x00000402,0x00000405,0x0004003d,
+0x00000035,0x00000409,0x00000406,0x0003003e,
+0x00000408,0x00000409,0x0004003d,0x00000006,
+0x0000040b,0x0000036d,0x0003003e,0x0000040a,
+0x0000040b,0x0004003d,0x00000006,0x0000040d,
+0x0000037a,0x0003003e,0x0000040c,0x0000040d,
+0x0004003d,0x00000006,0x0000040f,0x00000387,
+0x0003003e,0x0000040e,0x0000040f,0x0004003d,
+0x00000033,0x00000411,0x000003c2,0x0003003e,
+0x00000410,0x00000411,0x0004003d,0x0000000d,
+0x00000413,0x00000060,0x0003003e,0x00000412,
+0x00000413,0x0003003e,0x00000414,0x00000407,
+0x0004003d,0x0000000f,0x00000416,0x00000402,
+0x0003003e,0x00000415,0x00000416,0x0004003d,
+0x0000000f,0x00000418,0x00000061,0x0003003e,
+0x00000417,0x00000418,0x0004003d,0x0000000f,
+0x0000041a,0x00000321,0x0003003e,0x00000419,
+0x0000041a,0x000e0039,0x00000002,0x0000041b,
+0x0000005d,0x00000408,0x0000040a,0x0000040c,
+0x0000040e,0x00000410,0x00000412,0x00000414,
+0x00000415,0x00000417,0x00000419,0x0004003d,
+0x00000035,0x0000041c,0x00000408,0x0003003e,
+0x00000406,0x0000041c,0x0004003d,0x00000035,
+0x0000041f,0x00000406,0x0003003e,0x0000041e,
+0x0000041f,0x0004003d,0x00000006,0x00000421,
+0x00000372,0x0003003e,0x00000420,0x00000421,
+0x0004003d,0x00000006,0x00000423,0x0000037f,
+0x0003003e,0x00000422,0x00000423,0x0004003d,
+0x00000006,0x00000425,0x0000038c,0x0003003e,
+0x00000424,0x00000425,0x0004003d,0x00000033,
+0x00000427,0x000003eb,0x0003003e,0x00000426,
+0x00000427,0x0004003d,0x0000000d,0x00000429,
+0x00000060,0x0003003e,0x00000428,0x00000429,
+0x0003003e,0x0000042a,0x0000041d,0x0004003d,
+0x0000000f,0x0000042c,0x00000402,0x0003003e,
+0x0000042b,0x0000042c,0x0004003d,0x0000000f,
+0x0000042e,0x00000061,0x0003003e,0x0000042d,
+0x0000042e,0x0004003d,0x0000000f,0x00000430,
+0x00000321,0x0003003e,0x0000042f,0x00000430,
+0x000e0039,0x00000002,0x00000431,0x0000005d,
+0x0000041e,0x00000420,0x00000422,0x00000424,
+0x00000426,0x00000428,0x0000042a,0x0000042b,
+0x0000042d,0x0000042f,0x0004003d,0x00000035,
+0x00000432,0x0000041e,0x0003003e,0x00000406,
+0x00000432,0x0004003d,0x00000035,0x00000433,
+0x00000406,0x000200fe,0x00000433,0x00010038,
+0x00050036,0x00000064,0x00000069,0x00000000,
+0x00000065,0x00030037,0x0000000e,0x00000066,
+0x00030037,0x0000000e,0x00000067,0x00030037,
+0x00000032,0x00000068,0x000200f8,0x0000006a,
+0x0004003b,0x00000027,0x00000436,0x00000007,
+0x0004003b,0x00000027,0x0000043c,0x00000007,
+0x0004003b,0x0000000e,0x00000442,0x00000007,
+0x0004003b,0x00000051,0x00000446,0x00000007,
+0x0004003b,0x00000474,0x00000475,0x00000007,
+0x0004003b,0x00000051,0x00000478,0x00000007,
+0x0004003b,0x00000474,0x0000047c,0x00000007,
+0x0004003b,0x0000047f,0x00000480,0x00000007,
+0x0004003b,0x0000000e,0x000004a6,0x00000007,
+0x0004003b,0x0000000e,0x000004ae,0x00000007,
+0x0004003b,0x0000000e,0x000004b5,0x00000007,
+0x0004003b,0x00000027,0x000004ba,0x00000007,
+0x0004003b,0x00000027,0x000004bd,0x00000007,
+0x0004003b,0x00000027,0x000004c9,0x00000007,
+0x0004003b,0x0000047f,0x000004cf,0x00000007,
+0x0004003b,0x00000027,0x000004d1,0x00000007,
+0x0004003d,0x0000000d,0x00000437,0x00000066,
+0x000500c2,0x0000000d,0x00000438,0x00000437,
+0x00000130,0x0004007c,0x00000006,0x00000439,
+0x00000438,0x0003003e,0x00000436,0x00000439,
+0x0004003d,0x00000006,0x0000043a,0x00000436,
+0x000500c7,0x00000006,0x0000043b,0x0000043a,
+0x000000cc,0x0003003e,0x00000436,0x0000043b,
+0x0004003d,0x0000000d,0x0000043d,0x00000066,
+0x000500c2,0x0000000d,0x0000043e,0x0000043d,
+0x00000139,0x0004007c,0x00000006,0x0000043f,
+0x0000043e,0x0003003e,0x0000043c,0x0000043f,
+0x0004003d,0x00000006,0x00000440,0x0000043c,
+0x000500c7,0x00000006,0x00000441,0x00000440,
+0x000001bb,0x0003003e,0x0000043c,0x00000441,
+0x0004003d,0x0000000d,0x00000443,0x00000066,
+0x000500c2,0x0000000d,0x00000444,0x00000443,
+0x00000140,0x000500c7,0x0000000d,0x00000445,
+0x00000444,0x00000093,0x0003003e,0x00000442,
+0x00000445,0x0004003d,0x0000000d,0x00000472,
+0x00000442,0x00050084,0x0000000d,0x00000473,
+0x00000472,0x000000f5,0x0003003e,0x00000475,
+0x00000471,0x00050041,0x00000051,0x00000476,
+0x00000475,0x00000473,0x0004003d,0x00000033,
+0x00000477,0x00000476,0x0003003e,0x00000446,
+0x00000477,0x0004003d,0x0000000d,0x00000479,
+0x00000442,0x00050084,0x0000000d,0x0000047a,
+0x00000479,0x000000f5,0x00050080,0x0000000d,
+0x0000047b,0x0000047a,0x000000fb,0x0003003e,
+0x0000047c,0x00000471,0x00050041,0x00000051,
+0x0000047d,0x0000047c,0x0000047b,0x0004003d,
+0x00000033,0x0000047e,0x0000047d,0x0003003e,
+0x00000478,0x0000047e,0x0004003d,0x0000000d,
+0x00000481,0x00000066,0x000500c2,0x0000000d,
+0x00000482,0x00000481,0x00000272,0x0004003d,
+0x0000000d,0x00000483,0x00000066,0x000500c2,
+0x0000000d,0x00000484,0x00000483,0x0000045b,
+0x0004003d,0x0000000d,0x00000485,0x00000066,
+0x000500c2,0x0000000d,0x00000486,0x00000485,
+0x000001cb,0x0004003d,0x0000000d,0x00000487,
+0x00000066,0x000500c2,0x0000000d,0x00000488,
+0x00000487,0x00000096,0x0004003d,0x0000000d,
+0x00000489,0x00000066,0x000500c2,0x0000000d,
+0x0000048a,0x00000489,0x00000079,0x0004003d,
+0x0000000d,0x0000048b,0x00000066,0x000500c4,
+0x0000000d,0x0000048c,0x0000048b,0x0000007a,
+0x0004003d,0x0000000d,0x0000048d,0x00000067,
+0x000500c2,0x0000000d,0x0000048f,0x0000048d,
+0x0000048e,0x000500c5,0x0000000d,0x00000490,
+0x0000048c,0x0000048f,0x0004003d,0x0000000d,
+0x00000491,0x00000067,0x000500c2,0x0000000d,
+0x00000492,0x00000491,0x0000012a,0x0004003d,
+0x0000000d,0x00000493,0x00000067,0x000500c2,
+0x0000000d,0x00000494,0x00000493,0x00000130,
+0x0004003d,0x0000000d,0x00000495,0x00000067,
+0x000500c2,0x0000000d,0x00000497,0x00000495,
+0x00000496,0x0004003d,0x0000000d,0x00000498,
+0x00000067,0x000500c2,0x0000000d,0x00000499,
+0x00000498,0x000003d2,0x0004003d,0x0000000d,
+0x0000049a,0x00000067,0x000500c2,0x0000000d,
+0x0000049b,0x0000049a,0x000001bb,0x0004003d,
+0x0000000d,0x0000049c,0x00000067,0x000500c2,
+0x0000000d,0x0000049d,0x0000049c,0x00000147,
+0x0004003d,0x0000000d,0x0000049e,0x00000067,
+0x000500c2,0x0000000d,0x0000049f,0x0000049e,
+0x000003c9,0x0004003d,0x0000000d,0x000004a0,
+0x00000067,0x000500c2,0x0000000d,0x000004a1,
+0x000004a0,0x000000b8,0x0004003d,0x0000000d,
+0x000004a2,0x00000067,0x000500c2,0x0000000d,
+0x000004a3,0x000004a2,0x0000007b,0x0004003d,
+0x0000000d,0x000004a4,0x00000067,0x00130050,
+0x00000064,0x000004a5,0x00000482,0x00000484,
+0x00000486,0x00000488,0x0000048a,0x00000490,
+0x00000492,0x00000494,0x00000497,0x00000499,
+0x0000049b,0x0000049d,0x0000049f,0x000004a1,
+0x000004a3,0x000004a4,0x0003003e,0x00000480,
+0x000004a5,0x0003003e,0x000004a6,0x000000db,
+0x000200f9,0x000004a7,0x000200f8,0x000004a7,
+0x000400f6,0x000004a9,0x000004aa,0x00000000,
+0x000200f9,0x000004ab,0x000200f8,0x000004ab,
+0x0004003d,0x0000000d,0x000004ac,0x000004a6,
+0x000500b0,0x0000000f,0x000004ad,0x000004ac,
+0x00000034,0x000400fa,0x000004ad,0x000004a8,
+0x000004a9,0x000200f8,0x000004a8,0x0004003d,
+0x0000000d,0x000004af,0x000004a6,0x00050089,
+0x0000000d,0x000004b0,0x000004af,0x0000002f,
+0x00050084,0x0000000d,0x000004b1,0x000004b0,
+0x0000002f,0x0004003d,0x0000000d,0x000004b2,
+0x000004a6,0x00050086,0x0000000d,0x000004b3,
+0x000004b2,0x0000002f,0x00050080,0x0000000d,
+0x000004b4,0x000004b1,0x000004b3,0x0003003e,
+0x000004ae,0x000004b4,0x0004003d,0x0000000d,
+0x000004b6,0x000004a6,0x00050041,0x0000000e,
+0x000004b7,0x00000480,0x000004b6,0x0004003d,
+0x0000000d,0x000004b8,0x000004b7,0x000500c7,
+0x0000000d,0x000004b9,0x000004b8,0x00000081,
+0x0003003e,0x000004b5,0x000004b9,0x0004003d,
+0x0000000d,0x000004bb,0x000004b5,0x000500ae,
+0x0000000f,0x000004bc,0x000004bb,0x0000002f,
+0x000300f7,0x000004bf,0x00000000,0x000400fa,
+0x000004bc,0x000004be,0x000004c4,0x000200f8,
+0x000004be,0x0004003d,0x0000000d,0x000004c0,
+0x000004b5,0x00050082,0x0000000d,0x000004c1,
+0x000004c0,0x0000002f,0x00050041,0x00000027,
+0x000004c2,0x00000478,0x000004c1,0x0004003d,
+0x00000006,0x000004c3,0x000004c2,0x0003003e,
+0x000004bd,0x000004c3,0x000200f9,0x000004bf,
+0x000200f8,0x000004c4,0x0004003d,0x0000000d,
+0x000004c5,0x000004b5,0x00050041,0x00000027,
+0x000004c6,0x00000446,0x000004c5,0x0004003d,
+0x00000006,0x000004c7,0x000004c6,0x0003003e,
+0x000004bd,0x000004c7,0x000200f9,0x000004bf,
+0x000200f8,0x000004bf,0x0004003d,0x00000006,
+0x000004c8,0x000004bd,0x0003003e,0x000004ba,
+0x000004c8,0x0004003d,0x00000006,0x000004ca,
+0x00000436,0x0004003d,0x00000006,0x000004cb,
+0x000004ba,0x0004003d,0x00000006,0x000004cc,
+0x0000043c,0x00050084,0x00000006,0x000004cd,
+0x000004cb,0x000004cc,0x00050080,0x00000006,
+0x000004ce,0x000004ca,0x000004cd,0x0003003e,
+0x000004c9,0x000004ce,0x0004003d,0x0000000d,
+0x000004d0,0x000004ae,0x0004003d,0x00000006,
+0x000004d2,0x000004c9,0x0003003e,0x000004d1,
+0x000004d2,0x00050039,0x00000006,0x000004d3,
+0x0000002a,0x000004d1,0x0004007c,0x0000000d,
+0x000004d4,0x000004d3,0x00050041,0x0000000e,
+0x000004d5,0x000004cf,0x000004d0,0x0003003e,
+0x000004d5,0x000004d4,0x000200f9,0x000004aa,
+0x000200f8,0x000004aa,0x0004003d,0x0000000d,
+0x000004d6,0x000004a6,0x00050080,0x0000000d,
+0x000004d7,0x000004d6,0x00000079,0x0003003e,
+0x000004a6,0x000004d7,0x000200f9,0x000004a7,
+0x000200f8,0x000004a9,0x0004003d,0x00000064,
+0x000004d8,0x000004cf,0x000200fe,0x000004d8,
+0x00010038,0x00050036,0x0000000d,0x0000006c,
+0x00000000,0x00000015,0x00030037,0x0000000e,
+0x0000006b,0x000200f8,0x0000006d,0x0004003d,
+0x0000000d,0x000004db,0x0000006b,0x000500c7,
+0x0000000d,0x000004dd,0x000004db,0x000004dc,
+0x000500c4,0x0000000d,0x000004de,0x000004dd,
+0x00000130,0x0004003d,0x0000000d,0x000004df,
+0x0000006b,0x000500c7,0x0000000d,0x000004e1,
+0x000004df,0x000004e0,0x000500c4,0x0000000d,
+0x000004e2,0x000004e1,0x0000014e,0x000500c5,
+0x0000000d,0x000004e3,0x000004de,0x000004e2,
+0x0004003d,0x0000000d,0x000004e4,0x0000006b,
+0x000500c7,0x0000000d,0x000004e6,0x000004e4,
+0x000004e5,0x000500c2,0x0000000d,0x000004e7,
+0x000004e6,0x0000014e,0x000500c5,0x0000000d,
+0x000004e8,0x000004e3,0x000004e7,0x0004003d,
+0x0000000d,0x000004e9,0x0000006b,0x000500c7,
+0x0000000d,0x000004eb,0x000004e9,0x000004ea,
+0x000500c2,0x0000000d,0x000004ec,0x000004eb,
+0x00000130,0x000500c5,0x0000000d,0x000004ed,
+0x000004e8,0x000004ec,0x000200fe,0x000004ed,
+0x00010038
diff --git a/src/gfxstream/host/vulkan/emulated_textures/testing/ComputePipelineRestoration_integrationtest.cpp b/src/gfxstream/host/vulkan/emulated_textures/testing/ComputePipelineRestoration_integrationtest.cpp
new file mode 100644
index 00000000000..133348b4ea8
--- /dev/null
+++ b/src/gfxstream/host/vulkan/emulated_textures/testing/ComputePipelineRestoration_integrationtest.cpp
@@ -0,0 +1,215 @@
+// 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.
+
+// This is an integration test that verifies that the compute pipeline is correctly restored after
+// we perform texture decompression.
+
+#include <gmock/gmock.h>
+
+#include <cstdint>
+#include <vector>
+
+#include "stream-servers/vulkan/testing/VulkanTestHelper.h"
+
+namespace goldfish_vk::testing {
+namespace {
+
+// Compiled code for the following shader:
+//
+// #version 450
+// void main() {}
+inline constexpr uint32_t emptyShader[] = {
+ 0x07230203, 0x00010300, 0x000d000b, 0x00000006, 0x00000000, 0x00020011, 0x00000001, 0x0006000b,
+ 0x00000001, 0x4c534c47, 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001,
+ 0x0005000f, 0x00000005, 0x00000004, 0x6e69616d, 0x00000000, 0x00060010, 0x00000004, 0x00000011,
+ 0x00000001, 0x00000001, 0x00000001, 0x00030003, 0x00000002, 0x000001c2, 0x000a0004, 0x475f4c47,
+ 0x4c474f4f, 0x70635f45, 0x74735f70, 0x5f656c79, 0x656e696c, 0x7269645f, 0x69746365, 0x00006576,
+ 0x00080004, 0x475f4c47, 0x4c474f4f, 0x6e695f45, 0x64756c63, 0x69645f65, 0x74636572, 0x00657669,
+ 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00020013, 0x00000002, 0x00030021, 0x00000003,
+ 0x00000002, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005,
+ 0x000100fd, 0x00010038};
+
+class ComputePipelineRestorationTest : public ::testing::Test {
+ protected:
+ void SetUp() override {
+ vkTest = std::make_unique<VulkanTestHelper>();
+ vkTest->failOnValidationErrors(false);
+ vkTest->initialize(
+ {.astcLdrEmulationMode = AstcEmulationMode::Gpu,
+ .appInfo = VkApplicationInfo{.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
+ .pApplicationName = "pipeline_restoration_test",
+ .pEngineName = "pipeline_restoration_test",
+ .apiVersion = VK_API_VERSION_1_1},
+ .deviceFeatures = {
+ .textureCompressionASTC_LDR = true,
+ }});
+
+ vk = &vkTest->vk();
+ device = vkTest->device();
+ }
+
+ // Tears the test down, and make sure there are no validation errors
+ void TearDown() override {
+ vk->vkDestroyImage(device, image, nullptr);
+ vk->vkFreeMemory(device, imageMemory, nullptr);
+
+ vkTest->destroy();
+ ASSERT_FALSE(vkTest->hasValidationErrors());
+ vkTest.reset();
+ vk = nullptr;
+ device = VK_NULL_HANDLE;
+ }
+
+ // Creates an arbitrary 128x128 ASTC image
+ void createImage() {
+ VkImageCreateInfo imageInfo = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
+ .imageType = VK_IMAGE_TYPE_2D,
+ .format = VK_FORMAT_ASTC_4x4_UNORM_BLOCK,
+ .extent = {128, 128, 1},
+ .mipLevels = 1,
+ .arrayLayers = 1,
+ .samples = VK_SAMPLE_COUNT_1_BIT,
+ .tiling = VK_IMAGE_TILING_OPTIMAL,
+ .usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT |
+ VK_IMAGE_USAGE_SAMPLED_BIT,
+ .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
+ };
+ VK_CHECK(vk->vkCreateImage(device, &imageInfo, nullptr, &image));
+
+ VkMemoryRequirements memRequirements;
+ vk->vkGetImageMemoryRequirements(device, image, &memRequirements);
+
+ VkMemoryAllocateInfo allocInfo = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ .allocationSize = memRequirements.size,
+ .memoryTypeIndex = vkTest->findMemoryType(memRequirements.memoryTypeBits,
+ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT),
+ };
+ VK_CHECK(vk->vkAllocateMemory(device, &allocInfo, nullptr, &imageMemory));
+ VK_CHECK(vk->vkBindImageMemory(device, image, imageMemory, 0));
+ }
+
+ // Tries to decompress an image, which will trigger the pipeline restoration mechanism
+ void decompressImage(VkCommandBuffer cmdBuf) {
+ if (image == VK_NULL_HANDLE) {
+ createImage();
+ }
+
+ // Transition the image to TRANSFER_DST, pretend we write some data to it
+ vkTest->transitionImageLayout(cmdBuf, image, VK_IMAGE_LAYOUT_UNDEFINED,
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
+ // Then transition to SHADER_READ, as if we were going to read from it. This will trigger
+ // the decompression code
+ vkTest->transitionImageLayout(cmdBuf, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
+ }
+
+ std::unique_ptr<VulkanTestHelper> vkTest;
+ VkDecoderTestDispatch* vk = nullptr;
+ VkDevice device = VK_NULL_HANDLE;
+ VkImage image = VK_NULL_HANDLE;
+ VkDeviceMemory imageMemory = VK_NULL_HANDLE;
+};
+
+TEST_F(ComputePipelineRestorationTest, ShouldNotRestoreDestroyedPipeline) {
+ // Create the shader module
+ VkShaderModuleCreateInfo shaderInfo = {
+ .sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
+ .codeSize = sizeof(emptyShader),
+ .pCode = emptyShader,
+ };
+ VkShaderModule shader;
+ VK_CHECK(vk->vkCreateShaderModule(device, &shaderInfo, nullptr, &shader));
+
+ // Create the descriptor set layout. The shader has no bindings.
+ VkDescriptorSetLayoutCreateInfo dsLayoutInfo = {
+ .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+ };
+ VkDescriptorSetLayout descriptorSetLayout;
+ VK_CHECK(vk->vkCreateDescriptorSetLayout(device, &dsLayoutInfo, nullptr, &descriptorSetLayout));
+ VkDescriptorSetLayout unboxedDSLayout = unbox_VkDescriptorSetLayout(descriptorSetLayout);
+
+ // Create the pipeline layout
+ VkPipelineLayoutCreateInfo pipelineLayoutInfo = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
+ .setLayoutCount = 1,
+ .pSetLayouts = &unboxedDSLayout,
+ };
+ VkPipelineLayout pipelineLayout;
+ VK_CHECK(vk->vkCreatePipelineLayout(device, &pipelineLayoutInfo, nullptr, &pipelineLayout));
+
+ // Create the compute pipeline
+ VkComputePipelineCreateInfo computePipelineInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
+ .stage = {.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
+ .stage = VK_SHADER_STAGE_COMPUTE_BIT,
+ .module = unbox_VkShaderModule(shader),
+ .pName = "main"},
+ .layout = unbox_VkPipelineLayout(pipelineLayout),
+ };
+ VkPipeline pipeline;
+ VK_CHECK(
+ vk->vkCreateComputePipelines(device, nullptr, 1, &computePipelineInfo, nullptr, &pipeline));
+ vk->vkDestroyShaderModule(device, shader, nullptr);
+
+ // Create a command buffer
+ VkCommandBufferAllocateInfo allocInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ .commandPool = unbox_VkCommandPool(vkTest->commandPool()),
+ .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
+ .commandBufferCount = 1,
+ };
+ VkCommandBuffer cmdBuf;
+ vk->vkAllocateCommandBuffers(device, &allocInfo, &cmdBuf);
+ auto unboxedCmdBuf = unbox_VkCommandBuffer(cmdBuf);
+
+ // Begin command buffer and bind the pipeline to it
+ VkCommandBufferBeginInfo beginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+ vk->vkBeginCommandBuffer(cmdBuf, &beginInfo);
+ vk->vkCmdBindPipeline(cmdBuf, VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
+ vk->vkEndCommandBuffer(cmdBuf);
+
+ // Submit the command buffer
+ VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &unboxedCmdBuf,
+ };
+ vk->vkQueueSubmit(vkTest->graphicsQueue(), 1, &submitInfo, VK_NULL_HANDLE);
+ vk->vkQueueWaitIdle(vkTest->graphicsQueue());
+
+ // Now destroy the pipeline. This is legal since the command buffer is fully submitted.
+ vk->vkDestroyPipeline(device, pipeline, nullptr);
+ vk->vkDestroyPipelineLayout(device, pipelineLayout, nullptr);
+
+ // Now begin the command buffer again
+ vk->vkBeginCommandBuffer(cmdBuf, &beginInfo);
+
+ // If we do image decompression now, it should not try to restore the now-destroyed pipeline
+ decompressImage(cmdBuf);
+
+ // Submit the command buffer and destroy everything
+ vk->vkEndCommandBuffer(cmdBuf);
+ vk->vkQueueSubmit(vkTest->graphicsQueue(), 1, &submitInfo, VK_NULL_HANDLE);
+ vk->vkQueueWaitIdle(vkTest->graphicsQueue());
+ vk->vkFreeCommandBuffers(device, vkTest->commandPool(), 1, &unboxedCmdBuf);
+ vk->vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr);
+}
+
+} // namespace
+} // namespace goldfish_vk::testing \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/meson.build b/src/gfxstream/host/vulkan/meson.build
new file mode 100644
index 00000000000..b0103638b47
--- /dev/null
+++ b/src/gfxstream/host/vulkan/meson.build
@@ -0,0 +1,60 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_vulkan_server = include_directories('.')
+
+subdir('cereal')
+subdir('emulated_textures')
+
+files_lib_vulkan_server = files(
+ 'BorrowedImageVk.cpp',
+ 'BufferVk.cpp',
+ 'ColorBufferVk.cpp',
+ 'CompositorVk.cpp',
+ 'DisplayVk.cpp',
+ 'DisplaySurfaceVk.cpp',
+ 'PostWorkerVk.cpp',
+ 'DebugUtilsHelper.cpp',
+ 'SwapChainStateVk.cpp',
+ 'RenderThreadInfoVk.cpp',
+ 'VkAndroidNativeBuffer.cpp',
+ 'VkCommonOperations.cpp',
+ 'VkDecoderGlobalState.cpp',
+ 'VkFormatUtils.cpp',
+ 'VkReconstruction.cpp',
+ 'VulkanDispatch.cpp',
+ 'VulkanHandleMapping.cpp',
+ 'VulkanStream.cpp',
+ 'vk_util.cpp'
+)
+
+vulkan_server_cpp_args = [
+ '-fvisibility=hidden',
+ '-Wno-inconsistent-missing-override',
+ '-Wno-unused-value',
+ '-Wno-return-type',
+ '-Wno-return-type-c-linkage',
+ '-Wno-uninitialized',
+ '-DVK_GFXSTREAM_STRUCTURE_TYPE_EXT',
+]
+
+# Shouldn't these be defined by standard Vulkan headers?
+if host_machine.system() == 'darwin'
+ vulkan_server_cpp_args += '-DVK_USE_PLATFORM_METAL_EXT'
+elif host_machine.system() == 'windows'
+ vulkan_server_cpp_args += '-DVK_USE_PLATFORM_WIN32_KHR'
+elif host_machine.system() == 'qnx'
+ vulkan_server_cpp_args += '-DVK_USE_PLATFORM_SCREEN_QNX'
+endif
+
+lib_vulkan_server = static_library(
+ 'lib_vulkan_server',
+ files_lib_vulkan_server,
+ cpp_args: vulkan_server_cpp_args + gfxstream_host_args,
+ include_directories: [inc_root, inc_gfxstream_include, inc_include, inc_utils, inc_apigen_codec,
+ inc_cereal, inc_stream_servers,
+ inc_vulkan_server, inc_renderdoc_external,
+ inc_gl_host_common, inc_vulkan_headers],
+ link_with: [lib_vulkan_cereal, lib_emulated_textures],
+ dependencies: [aemu_base_dep, aemu_common_dep, aemu_snapshot_dep, dep_cereal_common, dep_glm]
+)
diff --git a/src/gfxstream/host/vulkan/testing/VkDecoderTestDispatch.h b/src/gfxstream/host/vulkan/testing/VkDecoderTestDispatch.h
new file mode 100644
index 00000000000..c12a911a5c5
--- /dev/null
+++ b/src/gfxstream/host/vulkan/testing/VkDecoderTestDispatch.h
@@ -0,0 +1,295 @@
+// 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.
+
+#pragma once
+
+#include "host/vulkan/VkDecoderGlobalState.h"
+#include "goldfish_vk_dispatch.h"
+#include "vulkan/vulkan.h"
+
+namespace gfxstream {
+namespace vk {
+namespace testing {
+
+// TODO(gregschlom): This class should be auto-generated
+class VkDecoderTestDispatch {
+ public:
+ VkDecoderTestDispatch(VulkanDispatch* vk, android::base::BumpPool* bp,
+ VkDecoderContext* decoderContext)
+ : mVk(vk), mDgs(VkDecoderGlobalState::get()), mBp(bp), mDecoderContext(decoderContext) {}
+
+ // Vulkan API wrappers - please keep sorted alphabetically
+ //
+ // These methods call into VkDecoderGlobalState (or VulkanDispatch if the method isn't
+ // implemented in VkDecoderGlobalState), while taking care of unboxing the parameters as
+ // needed.
+
+ VkResult vkAllocateCommandBuffers(VkDevice device,
+ const VkCommandBufferAllocateInfo* pAllocateInfo,
+ VkCommandBuffer* pCommandBuffers) {
+ return mDgs->on_vkAllocateCommandBuffers(mBp, device, pAllocateInfo, pCommandBuffers);
+ }
+
+ VkResult vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo,
+ const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) {
+ return mDgs->on_vkAllocateMemory(mBp, device, pAllocateInfo, pAllocator, pMemory);
+ }
+
+ VkResult vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
+ const VkCommandBufferBeginInfo* pBeginInfo) {
+ return mDgs->on_vkBeginCommandBuffer(mBp, commandBuffer, pBeginInfo,
+ *mDecoderContext);
+ }
+
+ VkResult vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory,
+ VkDeviceSize memoryOffset) {
+ return mDgs->on_vkBindBufferMemory(mBp, device, unbox_VkBuffer(buffer),
+ unbox_VkDeviceMemory(memory), memoryOffset);
+ }
+
+ VkResult vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory,
+ VkDeviceSize memoryOffset) {
+ return mDgs->on_vkBindImageMemory(mBp, device, unbox_VkImage(image),
+ unbox_VkDeviceMemory(memory), memoryOffset);
+ }
+
+ void vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+ VkImageLayout srcImageLayout, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkImageBlit* pRegions, VkFilter filter) {
+ return mVk->vkCmdBlitImage(unbox_VkCommandBuffer(commandBuffer), unbox_VkImage(srcImage),
+ srcImageLayout, unbox_VkImage(dstImage), dstImageLayout,
+ regionCount, pRegions, filter);
+ }
+ void vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkBufferImageCopy* pRegions) {
+ mDgs->on_vkCmdCopyBufferToImage(mBp, commandBuffer, unbox_VkBuffer(srcBuffer),
+ unbox_VkImage(dstImage), dstImageLayout, regionCount,
+ pRegions, *mDecoderContext);
+ }
+
+ void vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage,
+ VkImageLayout srcImageLayout, VkImage dstImage,
+ VkImageLayout dstImageLayout, uint32_t regionCount,
+ const VkImageCopy* pRegions) {
+ mDgs->on_vkCmdCopyImage(mBp, commandBuffer, unbox_VkImage(srcImage), srcImageLayout,
+ unbox_VkImage(dstImage), dstImageLayout, regionCount, pRegions);
+ }
+
+ 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) {
+ mDgs->on_vkCmdPipelineBarrier(mBp, commandBuffer, srcStageMask, dstStageMask,
+ dependencyFlags, memoryBarrierCount, pMemoryBarriers,
+ bufferMemoryBarrierCount, pBufferMemoryBarriers,
+ imageMemoryBarrierCount, pImageMemoryBarriers);
+ }
+
+ void vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage,
+ VkImageLayout srcImageLayout, VkBuffer dstBuffer,
+ uint32_t regionCount, const VkBufferImageCopy* pRegions) {
+ mDgs->on_vkCmdCopyImageToBuffer(mBp, commandBuffer, unbox_VkImage(srcImage), srcImageLayout,
+ unbox_VkBuffer(dstBuffer), regionCount, pRegions);
+ }
+
+ VkResult vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) {
+ return mDgs->on_vkCreateBuffer(mBp, device, pCreateInfo, pAllocator, pBuffer);
+ }
+
+ VkResult vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkCommandPool* pCommandPool) {
+ return mDgs->on_vkCreateCommandPool(mBp, device, pCreateInfo, pAllocator, pCommandPool);
+ }
+
+ VkResult vkCreateDebugUtilsMessengerEXT(VkInstance instance,
+ const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkDebugUtilsMessengerEXT* pDebugMessenger) {
+ instance = unbox_VkInstance(instance);
+ auto func = (PFN_vkCreateDebugUtilsMessengerEXT)mVk->vkGetInstanceProcAddr(
+ instance, "vkCreateDebugUtilsMessengerEXT");
+ if (func != nullptr) {
+ return func(instance, pCreateInfo, pAllocator, pDebugMessenger);
+ } else {
+ return VK_ERROR_EXTENSION_NOT_PRESENT;
+ }
+ }
+
+ VkResult vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) {
+ return mDgs->on_vkCreateDevice(mBp, physicalDevice, pCreateInfo, pAllocator, pDevice);
+ }
+
+ VkResult vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkImage* pImage) {
+ mDgs->transformImpl_VkImageCreateInfo_tohost(pCreateInfo, 1);
+ return mDgs->on_vkCreateImage(mBp, device, pCreateInfo, pAllocator, pImage);
+ }
+
+ VkResult vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkImageView* pView) {
+ return mDgs->on_vkCreateImageView(mBp, device, pCreateInfo, pAllocator, pView);
+ }
+
+ VkResult vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator, VkInstance* pInstance) {
+ return mDgs->on_vkCreateInstance(mBp, pCreateInfo, pAllocator, pInstance);
+ }
+
+ void vkDestroyBuffer(VkDevice device, VkBuffer buffer,
+ const VkAllocationCallbacks* pAllocator) {
+ mDgs->on_vkDestroyBuffer(mBp, device, unbox_VkBuffer(buffer), pAllocator);
+ delete_VkBuffer(buffer);
+ }
+
+ void vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool,
+ const VkAllocationCallbacks* pAllocator) {
+ mDgs->on_vkDestroyCommandPool(mBp, device, unbox_VkCommandPool(commandPool), pAllocator);
+ delete_VkCommandPool(commandPool);
+ }
+
+ void vkDestroyDebugUtilsMessengerEXT(VkInstance instance,
+ VkDebugUtilsMessengerEXT debugMessenger,
+ const VkAllocationCallbacks* pAllocator) {
+ instance = unbox_VkInstance(instance);
+ auto func = (PFN_vkDestroyDebugUtilsMessengerEXT)mVk->vkGetInstanceProcAddr(
+ instance, "vkDestroyDebugUtilsMessengerEXT");
+ if (func != nullptr) {
+ func(instance, debugMessenger, pAllocator);
+ }
+ }
+
+ void vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) {
+ mDgs->on_vkDestroyDevice(mBp, device, pAllocator);
+ }
+
+ void vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) {
+ mDgs->on_vkDestroyImage(mBp, device, unbox_VkImage(image), pAllocator);
+ delete_VkImage(image);
+ }
+
+ void vkDestroyImageView(VkDevice device, VkImageView imageView,
+ const VkAllocationCallbacks* pAllocator) {
+ mDgs->on_vkDestroyImageView(mBp, device, unbox_VkImageView(imageView), pAllocator);
+ delete_VkImageView(imageView);
+ }
+
+ void vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator) {
+ mDgs->on_vkDestroyInstance(mBp, instance, pAllocator);
+ }
+
+ VkResult vkEndCommandBuffer(VkCommandBuffer commandBuffer) {
+ return mDgs->on_vkEndCommandBuffer(mBp, commandBuffer, *mDecoderContext);
+ }
+
+ VkResult vkEnumerateInstanceLayerProperties(uint32_t* pPropertyCount,
+ VkLayerProperties* pProperties) {
+ return mVk->vkEnumerateInstanceLayerProperties(pPropertyCount, pProperties);
+ }
+
+ VkResult vkEnumeratePhysicalDevices(VkInstance instance, uint32_t* physicalDeviceCount,
+ VkPhysicalDevice* physicalDevices) {
+ return mDgs->on_vkEnumeratePhysicalDevices(mBp, instance, physicalDeviceCount,
+ physicalDevices);
+ }
+
+ void vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool,
+ uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) {
+ mDgs->on_vkFreeCommandBuffers(mBp, device, unbox_VkCommandPool(commandPool),
+ commandBufferCount, pCommandBuffers);
+ // Calling delete_VkCommandBuffer is normally done in the decoder, so we have to do it here.
+ for (int i = 0; i < commandBufferCount; ++i) {
+ delete_VkCommandBuffer(unboxed_to_boxed_VkCommandBuffer(pCommandBuffers[i]));
+ }
+ }
+
+ void vkFreeMemory(VkDevice device, VkDeviceMemory memory,
+ const VkAllocationCallbacks* pAllocator) {
+ mDgs->on_vkFreeMemory(mBp, device, unbox_VkDeviceMemory(memory), pAllocator);
+ delete_VkDeviceMemory(memory);
+ }
+
+ void vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer,
+ VkMemoryRequirements* pMemoryRequirements) {
+ mVk->vkGetBufferMemoryRequirements(unbox_VkDevice(device), unbox_VkBuffer(buffer),
+ pMemoryRequirements);
+ }
+
+ void vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex,
+ VkQueue* pQueue) {
+ mDgs->on_vkGetDeviceQueue(mBp, device, queueFamilyIndex, queueIndex, pQueue);
+ }
+
+ void vkGetImageMemoryRequirements(VkDevice device, VkImage image,
+ VkMemoryRequirements* pMemoryRequirements) {
+ mDgs->on_vkGetImageMemoryRequirements(mBp, device, unbox_VkImage(image),
+ pMemoryRequirements);
+ }
+
+ void vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format,
+ VkFormatProperties* pFormatProperties) {
+ mDgs->on_vkGetPhysicalDeviceFormatProperties(mBp, physicalDevice, format,
+ pFormatProperties);
+ }
+ void vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice,
+ VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
+ mDgs->on_vkGetPhysicalDeviceMemoryProperties(mBp, physicalDevice, pMemoryProperties);
+ }
+
+ VkResult vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits,
+ VkFence fence) {
+ return mDgs->on_vkQueueSubmit(mBp, queue, submitCount, pSubmits, fence);
+ }
+
+ VkResult vkQueueWaitIdle(VkQueue queue) { return mDgs->on_vkQueueWaitIdle(mBp, queue); }
+
+ VkResult vkDeviceWaitIdle(VkDevice device) {
+ return mVk->vkDeviceWaitIdle(unbox_VkDevice(device));
+ }
+
+ void vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice,
+ uint32_t* pQueueFamilyPropertyCount,
+ VkQueueFamilyProperties* pQueueFamilyProperties) {
+ mVk->vkGetPhysicalDeviceQueueFamilyProperties(unbox_VkPhysicalDevice(physicalDevice),
+ pQueueFamilyPropertyCount,
+ pQueueFamilyProperties);
+ }
+
+ VkResult vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset,
+ VkDeviceSize size, VkMemoryMapFlags flags, void** ppData) {
+ return mDgs->on_vkMapMemory(mBp, device, unbox_VkDeviceMemory(memory), offset, size, flags,
+ ppData);
+ }
+
+ void vkUnmapMemory(VkDevice device, VkDeviceMemory memory) {
+ mDgs->on_vkUnmapMemory(mBp, device, unbox_VkDeviceMemory(memory));
+ }
+
+ private:
+ VulkanDispatch* mVk;
+ VkDecoderGlobalState* mDgs;
+ android::base::BumpPool* mBp;
+ VkDecoderContext* mDecoderContext;
+};
+
+} // namespace testing
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/testing/VulkanTestHelper.cpp b/src/gfxstream/host/vulkan/testing/VulkanTestHelper.cpp
new file mode 100644
index 00000000000..01295b85d61
--- /dev/null
+++ b/src/gfxstream/host/vulkan/testing/VulkanTestHelper.cpp
@@ -0,0 +1,347 @@
+// 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 "VulkanTestHelper.h"
+
+#include "host-common/emugl_vm_operations.h"
+#include "host-common/feature_control.h"
+#include "host-common/logging.h"
+#include "host-common/vm_operations.h"
+
+namespace gfxstream {
+namespace vk {
+namespace testing {
+namespace {
+
+using ::android::base::BumpPool;
+
+bool validationErrorsFound = false;
+
+// Called back by the Vulkan validation layer in case of a validation error
+VKAPI_ATTR VkBool32 VKAPI_CALL validationCallback(
+ VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT type,
+ const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData) {
+ if (severity >= VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) {
+ ERR("Validation Layer: \"%s\"", pCallbackData->pMessage);
+ validationErrorsFound = true;
+ }
+ return VK_FALSE;
+}
+
+} // namespace
+
+std::mutex VulkanTestHelper::mMutex;
+
+VulkanTestHelper::VulkanTestHelper()
+ : mLock(mMutex),
+ mVk(vkDispatch(/*forTesting=*/true)),
+ mLogger(),
+ mMetricsLogger(android::base::CreateMetricsLogger()),
+ mHealthMonitor(*mMetricsLogger),
+ mVkEmu(createGlobalVkEmulation(mVk, false)),
+ mBp(std::make_unique<BumpPool>()),
+ mDecoderContext(VkDecoderContext{.processName = "vulkan_test",
+ .gfxApiLogger = &mLogger,
+ .healthMonitor = &mHealthMonitor,
+ .metricsLogger = mMetricsLogger.get()}),
+ mTestDispatch(mVk, mBp.get(), &mDecoderContext) {
+ // Enable so that we can have VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
+ feature_set_enabled_override(kFeature_GLDirectMem, true);
+
+ // This is used by VkDecoderGlobalState::on_vkCreateInstance()
+ QAndroidVmOperations vmOps;
+ vmOps.setSkipSnapshotSave = [](bool) {};
+ set_emugl_vm_operations(vmOps);
+
+ validationErrorsFound = false;
+}
+
+void VulkanTestHelper::destroy() {
+ if (mDevice) {
+ vk().vkDeviceWaitIdle(mDevice);
+ if (mCommandPool) vk().vkDestroyCommandPool(mDevice, mCommandPool, nullptr);
+ vk().vkDestroyDevice(mDevice, nullptr);
+ }
+ if (mInstance) {
+ if (mDebugMessenger) {
+ vk().vkDestroyDebugUtilsMessengerEXT(mInstance, mDebugMessenger, nullptr);
+ }
+ vk().vkDestroyInstance(mInstance, nullptr);
+ }
+
+ mCommandPool = VK_NULL_HANDLE;
+ mDevice = VK_NULL_HANDLE;
+ mInstance = VK_NULL_HANDLE;
+ mDebugMessenger = VK_NULL_HANDLE;
+
+ VkDecoderGlobalState::reset();
+ teardownGlobalVkEmulation();
+}
+
+VulkanTestHelper::~VulkanTestHelper() {
+ destroy();
+ if (mFailOnValidationErrors && validationErrorsFound) {
+ FATAL() << "Validation errors found. Aborting.";
+ }
+}
+
+void VulkanTestHelper::initialize(const InitializationOptions& options) {
+ initVkEmulationFeatures(std::make_unique<VkEmulationFeatures>(VkEmulationFeatures{
+ .astcLdrEmulationMode = options.astcLdrEmulationMode,
+ }));
+
+ // Check that the validation layer is present
+ const char* validationLayer = "VK_LAYER_KHRONOS_validation";
+ uint32_t layerCount;
+ vk().vkEnumerateInstanceLayerProperties(&layerCount, nullptr);
+ std::vector<VkLayerProperties> availableLayers(layerCount);
+ vk().vkEnumerateInstanceLayerProperties(&layerCount, availableLayers.data());
+
+ bool layerFound = false;
+ for (const auto& layerProperties : availableLayers) {
+ if (strcmp(validationLayer, layerProperties.layerName) == 0) {
+ layerFound = true;
+ break;
+ }
+ }
+ if (!layerFound) FATAL() << "Vulkan Validation Layer not found";
+
+ // Create the instance
+ VkApplicationInfo defaultAppInfo = {
+ .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
+ .pApplicationName = "vulkan_test",
+ .pEngineName = "vulkan_test",
+ .apiVersion = VK_API_VERSION_1_1,
+ };
+
+ VkDebugUtilsMessengerCreateInfoEXT debugCreateInfo = {
+ .sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT,
+ .messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT |
+ VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT |
+ VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT,
+ .messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT |
+ VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT |
+ VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT,
+ .pfnUserCallback = validationCallback,
+ };
+
+ std::vector<const char*> extensions = {VK_EXT_DEBUG_UTILS_EXTENSION_NAME};
+ for (const auto& extName : options.enabledExtensions) {
+ extensions.push_back(extName.c_str());
+ }
+
+ VkInstanceCreateInfo createInfo = {
+ .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
+ .pNext = (VkDebugUtilsMessengerCreateInfoEXT*)&debugCreateInfo,
+ .pApplicationInfo = options.appInfo ? &options.appInfo.value() : &defaultAppInfo,
+ .enabledLayerCount = 1,
+ .ppEnabledLayerNames = &validationLayer,
+ .enabledExtensionCount = static_cast<uint32_t>(extensions.size()),
+ .ppEnabledExtensionNames = extensions.data(),
+ };
+ VK_CHECK(vk().vkCreateInstance(&createInfo, nullptr, &mInstance));
+
+ // Setup validation layer callbacks
+ VK_CHECK(vk().vkCreateDebugUtilsMessengerEXT(mInstance, &debugCreateInfo, nullptr,
+ &mDebugMessenger));
+
+ // Pick a physical device
+ uint32_t deviceCount = 0;
+ vk().vkEnumeratePhysicalDevices(mInstance, &deviceCount, nullptr);
+ if (deviceCount == 0) FATAL() << "No Vulkan device found.";
+ std::vector<VkPhysicalDevice> devices(deviceCount);
+ VK_CHECK(vk().vkEnumeratePhysicalDevices(mInstance, &deviceCount, devices.data()));
+
+ mPhysicalDevice = devices[0];
+ assert(mPhysicalDevice != VK_NULL_HANDLE);
+
+ // Create the logical device
+ float queuePriority = 1.0f;
+ VkDeviceQueueCreateInfo queueCreateInfo = {
+ .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
+ .queueFamilyIndex = getQueueFamilyIndex(VK_QUEUE_GRAPHICS_BIT),
+ .queueCount = 1,
+ .pQueuePriorities = &queuePriority,
+ };
+
+ VkDeviceCreateInfo deviceCreateInfo = {
+ .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
+ .queueCreateInfoCount = 1,
+ .pQueueCreateInfos = &queueCreateInfo,
+ .enabledLayerCount = 1,
+ .ppEnabledLayerNames = &validationLayer,
+ .pEnabledFeatures = &options.deviceFeatures,
+ };
+ VK_CHECK(vk().vkCreateDevice(mPhysicalDevice, &deviceCreateInfo, nullptr, &mDevice));
+
+ // Get a graphics queue
+ vk().vkGetDeviceQueue(mDevice, queueCreateInfo.queueFamilyIndex, 0, &mGraphicsQueue);
+ assert(mGraphicsQueue != VK_NULL_HANDLE);
+
+ // Create command pool
+ VkCommandPoolCreateInfo poolInfo{
+ .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
+ .flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
+ .queueFamilyIndex = queueCreateInfo.queueFamilyIndex,
+ };
+ VK_CHECK(vk().vkCreateCommandPool(mDevice, &poolInfo, nullptr, &mCommandPool));
+}
+
+bool VulkanTestHelper::hasValidationErrors() const { return validationErrorsFound; }
+
+VkCommandBuffer VulkanTestHelper::beginCommandBuffer() {
+ VkCommandBufferAllocateInfo allocInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ .commandPool = unbox_VkCommandPool(mCommandPool),
+ .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
+ .commandBufferCount = 1,
+ };
+ VkCommandBuffer commandBuffer;
+ vk().vkAllocateCommandBuffers(mDevice, &allocInfo, &commandBuffer);
+
+ VkCommandBufferBeginInfo beginInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
+ };
+ vk().vkBeginCommandBuffer(commandBuffer, &beginInfo);
+ return commandBuffer;
+}
+
+void VulkanTestHelper::submitCommandBuffer(VkCommandBuffer commandBuffer) {
+ vk().vkEndCommandBuffer(commandBuffer);
+ auto cmdBuf = unbox_VkCommandBuffer(commandBuffer);
+
+ VkSubmitInfo submitInfo = {
+ .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &cmdBuf,
+ };
+ vk().vkQueueSubmit(mGraphicsQueue, 1, &submitInfo, VK_NULL_HANDLE);
+ vk().vkQueueWaitIdle(mGraphicsQueue);
+ vk().vkFreeCommandBuffers(mDevice, mCommandPool, 1, &cmdBuf);
+}
+
+uint32_t VulkanTestHelper::getQueueFamilyIndex(VkQueueFlagBits queueFlags) {
+ uint32_t queueFamilyCount = 0;
+ vk().vkGetPhysicalDeviceQueueFamilyProperties(mPhysicalDevice, &queueFamilyCount, nullptr);
+
+ std::vector<VkQueueFamilyProperties> queueFamilies(queueFamilyCount);
+ vk().vkGetPhysicalDeviceQueueFamilyProperties(mPhysicalDevice, &queueFamilyCount,
+ queueFamilies.data());
+ for (uint32_t i = 0; i < static_cast<uint32_t>(queueFamilies.size()); i++) {
+ if (queueFamilies[i].queueFlags & queueFlags) {
+ return i;
+ }
+ }
+
+ FATAL() << "No queue family found matching the requested flags";
+}
+
+uint32_t VulkanTestHelper::findMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties) {
+ VkPhysicalDeviceMemoryProperties memProperties;
+ vk().vkGetPhysicalDeviceMemoryProperties(mPhysicalDevice, &memProperties);
+
+ for (uint32_t i = 0; i < memProperties.memoryTypeCount; i++) {
+ if ((typeFilter & (1 << i)) &&
+ (memProperties.memoryTypes[i].propertyFlags & properties) == properties) {
+ return i;
+ }
+ }
+ FATAL() << "failed to find suitable memory type!";
+}
+
+void VulkanTestHelper::createBuffer(VkDeviceSize size, VkBufferUsageFlags usage,
+ VkMemoryPropertyFlags properties, VkBuffer& buffer,
+ VkDeviceMemory& bufferMemory) {
+ VkBufferCreateInfo bufferInfo = {
+ .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
+ .size = size,
+ .usage = usage,
+ .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
+ };
+ VK_CHECK(vk().vkCreateBuffer(mDevice, &bufferInfo, nullptr, &buffer));
+
+ VkMemoryRequirements memRequirements;
+ vk().vkGetBufferMemoryRequirements(mDevice, buffer, &memRequirements);
+
+ VkMemoryAllocateInfo allocInfo = {
+ .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
+ .allocationSize = memRequirements.size,
+ .memoryTypeIndex = findMemoryType(memRequirements.memoryTypeBits, properties),
+ };
+ VK_CHECK(vk().vkAllocateMemory(mDevice, &allocInfo, nullptr, &bufferMemory));
+
+ vk().vkBindBufferMemory(mDevice, buffer, bufferMemory, 0);
+}
+
+void VulkanTestHelper::transitionImageLayout(VkCommandBuffer cmdBuf, VkImage image,
+ VkImageLayout oldLayout, VkImageLayout newLayout) {
+ VkImageMemoryBarrier barrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .oldLayout = oldLayout,
+ .newLayout = newLayout,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = unbox_VkImage(image),
+ .subresourceRange =
+ {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
+ },
+ };
+
+ switch (oldLayout) {
+ case VK_IMAGE_LAYOUT_UNDEFINED:
+ barrier.srcAccessMask = 0;
+ break;
+ case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
+ barrier.srcAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
+ break;
+ case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:
+ barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
+ break;
+ case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
+ barrier.srcAccessMask = VK_ACCESS_SHADER_READ_BIT;
+ break;
+ default:
+ FATAL() << "Unsupported layout transition!";
+ }
+
+ switch (newLayout) {
+ case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:
+ barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
+ break;
+ case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
+ barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
+ break;
+ case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
+ if (barrier.srcAccessMask == 0) {
+ barrier.srcAccessMask = VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT;
+ }
+ barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
+ break;
+ default:
+ FATAL() << "Unsupported layout transition!";
+ }
+ vk().vkCmdPipelineBarrier(cmdBuf, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, 1,
+ &barrier);
+}
+
+} // namespace testing
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/testing/VulkanTestHelper.h b/src/gfxstream/host/vulkan/testing/VulkanTestHelper.h
new file mode 100644
index 00000000000..1c96c684806
--- /dev/null
+++ b/src/gfxstream/host/vulkan/testing/VulkanTestHelper.h
@@ -0,0 +1,122 @@
+// 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.
+
+#pragma once
+
+#include "VkDecoderGlobalState.h"
+#include "VulkanDispatch.h"
+#include "aemu/base/BumpPool.h"
+#include "base/include/aemu/base/HealthMonitor.h"
+#include "base/include/aemu/base/Metrics.h"
+#include "host/vulkan/VkCommonOperations.h"
+#include "host/vulkan/VkDecoderContext.h"
+#include "host/vulkan/testing/VkDecoderTestDispatch.h"
+#include "utils/include/utils/GfxApiLogger.h"
+
+namespace gfxstream {
+namespace vk {
+namespace testing {
+
+// This class provides facilities to write tests that call into the Vulkan API through VkDecoder and
+// VkDecoderGlobalState.
+//
+// Usage:
+//
+// TEST(MyVulkanTest, Test1) {
+// VulkanTestHelper vkTest;
+// vkTest.initialize();
+// // then use vkTest.vk() to start calling Vulkan APIs.
+// }
+class VulkanTestHelper {
+ public:
+ // Only one instance of this class can exist at a time. (Enforced by locking a mutex on
+ // construction). This is needed because VkDecoderGlobalState is a singleton, so we can't
+ // allow tests to run in parallel.
+ VulkanTestHelper();
+
+ ~VulkanTestHelper();
+
+ // Optional parameters for the `initialize()` function
+ struct InitializationOptions {
+ AstcEmulationMode astcLdrEmulationMode;
+ std::optional<VkApplicationInfo> appInfo;
+ VkPhysicalDeviceFeatures deviceFeatures;
+ std::vector<std::string> enabledExtensions; // enabled extensions for vkCreateInstance
+ };
+
+ void initialize(const InitializationOptions& options = {});
+
+ // Destroys all the Vulkan objects. This is normally automatically called by the destructor but
+ // can be called manually to allow checking if there are any validation errors at destruction.
+ void destroy();
+
+ // Whether the test should fail if there were Vulkan validation errors. Defaults to true.
+ void failOnValidationErrors(bool value) { mFailOnValidationErrors = value; }
+
+ bool hasValidationErrors() const;
+
+ // Vulkan helper functions
+
+ // Starts a command buffer
+ VkCommandBuffer beginCommandBuffer();
+
+ // Submits a command buffer
+ void submitCommandBuffer(VkCommandBuffer commandBuffer);
+
+ // Gets the index of a queue family that supports the requested queue flags, or aborts.
+ uint32_t getQueueFamilyIndex(VkQueueFlagBits queueFlags);
+
+ uint32_t findMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties);
+
+ // Creates a new VkBuffer and associated memory
+ void createBuffer(VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties,
+ VkBuffer& buffer, VkDeviceMemory& bufferMemory);
+
+ // Calls vkCmdPipelineBarrier to change an image layout
+ void transitionImageLayout(VkCommandBuffer cmdBuf, VkImage image, VkImageLayout oldLayout,
+ VkImageLayout newLayout);
+
+ // Accessors
+ VkDecoderTestDispatch& vk() { return mTestDispatch; }
+ VkInstance instance() { return mInstance; }
+ VkDevice device() { return mDevice; }
+ VkPhysicalDevice physDev() { return mPhysicalDevice; }
+ VkCommandPool commandPool() { return mCommandPool; }
+ VkQueue graphicsQueue() { return mGraphicsQueue; }
+
+ private:
+ static std::mutex mMutex; // Locked for the entire lifetime of this class.
+ std::lock_guard<std::mutex> mLock;
+ VulkanDispatch* mVk;
+ emugl::GfxApiLogger mLogger;
+ std::unique_ptr<android::base::MetricsLogger> mMetricsLogger;
+ emugl::HealthMonitor<> mHealthMonitor;
+ VkEmulation* mVkEmu;
+ std::unique_ptr<::android::base::BumpPool> mBp;
+ VkDecoderContext mDecoderContext;
+ VkDecoderTestDispatch mTestDispatch;
+ bool mFailOnValidationErrors = true;
+
+ // Vulkan objects
+ VkInstance mInstance = VK_NULL_HANDLE;
+ VkPhysicalDevice mPhysicalDevice = VK_NULL_HANDLE;
+ VkDevice mDevice = VK_NULL_HANDLE;
+ VkCommandPool mCommandPool = VK_NULL_HANDLE;
+ VkQueue mGraphicsQueue = VK_NULL_HANDLE;
+ VkDebugUtilsMessengerEXT mDebugMessenger = VK_NULL_HANDLE;
+};
+
+} // namespace testing
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/vk_android_native_buffer_gfxstream.h b/src/gfxstream/host/vulkan/vk_android_native_buffer_gfxstream.h
new file mode 100644
index 00000000000..b00b2e21e75
--- /dev/null
+++ b/src/gfxstream/host/vulkan/vk_android_native_buffer_gfxstream.h
@@ -0,0 +1,251 @@
+/*
+ * 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 __VK_ANDROID_NATIVE_BUFFER_H__
+#define __VK_ANDROID_NATIVE_BUFFER_H__
+
+#include <vulkan/vulkan.h>
+
+/* MESA: A hack to avoid #ifdefs in driver code. */
+#if defined(ANDROID)
+#include <cutils/native_handle.h>
+
+#if ANDROID_API_LEVEL < 28
+/* buffer_handle_t was defined in the deprecated system/window.h */
+typedef const native_handle_t* buffer_handle_t;
+#endif
+
+#else
+typedef void* buffer_handle_t;
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define VK_ANDROID_native_buffer 1
+
+#define VK_ANDROID_NATIVE_BUFFER_EXTENSION_NUMBER 11
+/*
+ * NOTE ON VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
+ *
+ * This version of the extension transitions from gralloc0 to gralloc1 usage
+ * flags (int -> 2x uint64_t). The WSI implementation will temporarily continue
+ * to fill out deprecated fields in VkNativeBufferANDROID, and will call the
+ * deprecated vkGetSwapchainGrallocUsageANDROID if the new
+ * vkGetSwapchainGrallocUsage2ANDROID is not supported. This transitionary
+ * backwards-compatibility support is temporary, and will likely be removed
+ * (along with all gralloc0 support) in a future release.
+ */
+/*
+ * NOTE ON VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 8
+ *
+ * This version of the extension doesn't introduce new types or structs, but is
+ * to accommodate the new struct VkBindImageMemorySwapchainInfoKHR added in
+ * VK_KHR_swapchain spec version 69. When VkBindImageMemorySwapchainInfoKHR is
+ * chained in the pNext chain of VkBindImageMemoryInfo, a VkNativeBufferANDROID
+ * that holds the correct gralloc handle according to the imageIndex specified
+ * in VkBindImageMemorySwapchainInfoKHR will be additionally chained to the
+ * pNext chain of VkBindImageMemoryInfo and passed down to the driver.
+ */
+/*
+ * NOTE ON VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 9
+ *
+ * This version of the extension is largely designed to clean up the mix of
+ * GrallocUsage and GrallocUsage2
+ */
+#define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 9
+#define VK_ANDROID_NATIVE_BUFFER_EXTENSION_NAME "VK_ANDROID_native_buffer"
+
+#define VK_ANDROID_NATIVE_BUFFER_ENUM(type, id) \
+ ((type)(1000000000 + (1000 * (VK_ANDROID_NATIVE_BUFFER_EXTENSION_NUMBER - 1)) + (id)))
+#define VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 0)
+#define VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID \
+ VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 1)
+#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID \
+ VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 2)
+#define VK_STRUCTURE_TYPE_GRALLOC_USAGE_INFO_ANDROID \
+ VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 3)
+
+/* clang-format off */
+typedef enum VkSwapchainImageUsageFlagBitsANDROID {
+ VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_ANDROID = 0x00000001,
+ VK_SWAPCHAIN_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSwapchainImageUsageFlagBitsANDROID;
+typedef VkFlags VkSwapchainImageUsageFlagsANDROID;
+
+/*
+ * struct VkNativeBufferUsage2ANDROID
+ *
+ * consumer: gralloc1 consumer usage flag
+ * producer: gralloc1 producer usage flag
+ */
+typedef struct {
+ uint64_t consumer;
+ uint64_t producer;
+} VkNativeBufferUsage2ANDROID;
+
+/*
+ * struct VkNativeBufferANDROID
+ *
+ * sType: VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID
+ * pNext: NULL or a pointer to a structure extending this structure
+ * handle: buffer handle returned from gralloc alloc()
+ * stride: stride returned from gralloc alloc()
+ * format: gralloc format requested when the buffer was allocated
+ * usage: gralloc usage requested when the buffer was allocated
+ * usage2: gralloc usage requested when the buffer was allocated
+ * usage3: gralloc usage requested when the buffer was allocated
+ */
+typedef struct {
+ VkStructureType sType;
+ const void* pNext;
+ const uint32_t* handle;
+ int stride;
+ int format;
+ int usage; /* DEPRECATED in SPEC_VERSION 6 */
+ VkNativeBufferUsage2ANDROID usage2; /* DEPRECATED in SPEC_VERSION 9 */
+ uint64_t usage3; /* ADDED in SPEC_VERSION 9 */
+} VkNativeBufferANDROID;
+
+/*
+ * struct VkSwapchainImageCreateInfoANDROID
+ *
+ * sType: VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID
+ * pNext: NULL or a pointer to a structure extending this structure
+ * usage: is a bitmask of VkSwapchainImageUsageFlagsANDROID
+ */
+typedef struct {
+ VkStructureType sType;
+ const void* pNext;
+ VkSwapchainImageUsageFlagsANDROID usage;
+} VkSwapchainImageCreateInfoANDROID;
+
+/*
+ * struct VkPhysicalDevicePresentationPropertiesANDROID
+ *
+ * sType: VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID
+ * pNext: NULL or a pointer to a structure extending this structure
+ * sharedImage: specifies if the image can be shared with the display system
+ */
+typedef struct {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 sharedImage;
+} VkPhysicalDevicePresentationPropertiesANDROID;
+
+/*
+ * struct VkGrallocUsageInfoANDROID
+ *
+ * sType: VK_STRUCTURE_TYPE_GRALLOC_USAGE_INFO_ANDROID
+ * pNext: NULL or a pointer to a structure extending this structure
+ * format: value specifying the format the image will be created with
+ * imageUsage: bitmask of VkImageUsageFlagBits describing intended usage
+ */
+typedef struct {
+ VkStructureType sType;
+ const void* pNext;
+ VkFormat format;
+ VkImageUsageFlags imageUsage;
+} VkGrallocUsageInfoANDROID;
+
+/* DEPRECATED in SPEC_VERSION 6 */
+typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainGrallocUsageANDROID)(
+ VkDevice device,
+ VkFormat format,
+ VkImageUsageFlags imageUsage,
+ int* grallocUsage);
+
+/* DEPRECATED in SPEC_VERSION 9 */
+typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainGrallocUsage2ANDROID)(
+ VkDevice device,
+ VkFormat format,
+ VkImageUsageFlags imageUsage,
+ VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
+ uint64_t* grallocConsumerUsage,
+ uint64_t* grallocProducerUsage);
+
+/* ADDED in SPEC_VERSION 9 */
+typedef VkResult (VKAPI_PTR *PFN_vkGetSwapchainGrallocUsage3ANDROID)(
+ VkDevice device,
+ const VkGrallocUsageInfoANDROID* grallocUsageInfo,
+ uint64_t* grallocUsage);
+
+typedef VkResult (VKAPI_PTR *PFN_vkAcquireImageANDROID)(
+ VkDevice device,
+ VkImage image,
+ int nativeFenceFd,
+ VkSemaphore semaphore,
+ VkFence fence);
+
+typedef VkResult (VKAPI_PTR *PFN_vkQueueSignalReleaseImageANDROID)(
+ VkQueue queue,
+ uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores,
+ VkImage image,
+ int* pNativeFenceFd);
+
+#ifndef VK_NO_PROTOTYPES
+
+/* DEPRECATED in SPEC_VERSION 6 */
+VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsageANDROID(
+ VkDevice device,
+ VkFormat format,
+ VkImageUsageFlags imageUsage,
+ int* grallocUsage
+);
+
+/* DEPRECATED in SPEC_VERSION 9 */
+VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsage2ANDROID(
+ VkDevice device,
+ VkFormat format,
+ VkImageUsageFlags imageUsage,
+ VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
+ uint64_t* grallocConsumerUsage,
+ uint64_t* grallocProducerUsage
+);
+
+/* ADDED in SPEC_VERSION 9 */
+VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainGrallocUsage3ANDROID(
+ VkDevice device,
+ const VkGrallocUsageInfoANDROID* grallocUsageInfo,
+ uint64_t* grallocUsage
+);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkAcquireImageANDROID(
+ VkDevice device,
+ VkImage image,
+ int nativeFenceFd,
+ VkSemaphore semaphore,
+ VkFence fence
+);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkQueueSignalReleaseImageANDROID(
+ VkQueue queue,
+ uint32_t waitSemaphoreCount,
+ const VkSemaphore* pWaitSemaphores,
+ VkImage image,
+ int* pNativeFenceFd
+);
+
+#endif
+/* clang-format on */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __VK_ANDROID_NATIVE_BUFFER_H__ */
diff --git a/src/gfxstream/host/vulkan/vk_android_native_buffer_structure_type.h b/src/gfxstream/host/vulkan/vk_android_native_buffer_structure_type.h
new file mode 100644
index 00000000000..caa7ec6e1c7
--- /dev/null
+++ b/src/gfxstream/host/vulkan/vk_android_native_buffer_structure_type.h
@@ -0,0 +1,41 @@
+// 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 vk_android_native_buffer_structure_type
+//
+// (header) generated by codegen/vulkan/vulkan-docs-next/scripts/genvk.py -registry
+// codegen/vulkan/vulkan-docs-next/xml/vk.xml -registryGfxstream
+// codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.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_ANDROID_NATIVE_BUFFER_ENUM(type, id) \
+ ((type)(1000000000 + (1000 * (VK_ANDROID_NATIVE_BUFFER_NUMBER - 1)) + (id)))
+
+#define VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 0)
+#define VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID \
+ VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 1)
+#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID \
+ VK_ANDROID_NATIVE_BUFFER_ENUM(VkStructureType, 2)
diff --git a/src/gfxstream/host/vulkan/vk_fn_info.h b/src/gfxstream/host/vulkan/vk_fn_info.h
new file mode 100644
index 00000000000..a44fb8d0369
--- /dev/null
+++ b/src/gfxstream/host/vulkan/vk_fn_info.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 VK_FN_INFO_H
+#define VK_FN_INFO_H
+
+#include <vulkan/vulkan.h>
+
+#include <initializer_list>
+#include <tuple>
+
+namespace gfxstream {
+namespace vk {
+namespace vk_util {
+namespace vk_fn_info {
+template <class T>
+struct GetVkFnInfo;
+
+#define REGISTER_VK_FN_INFO(coreName, allNames) \
+ struct coreName; \
+ template <> \
+ struct GetVkFnInfo<coreName> { \
+ static constexpr auto names = std::make_tuple allNames; \
+ using type = PFN_vk##coreName; \
+ };
+
+REGISTER_VK_FN_INFO(GetPhysicalDeviceProperties2,
+ ("vkGetPhysicalDeviceProperties2KHR", "vkGetPhysicalDeviceProperties2"))
+REGISTER_VK_FN_INFO(GetPhysicalDeviceImageFormatProperties2,
+ ("vkGetPhysicalDeviceImageFormatProperties2KHR",
+ "vkGetPhysicalDeviceImageFormatProperties2"))
+REGISTER_VK_FN_INFO(GetPhysicalDeviceFeatures2,
+ ("vkGetPhysicalDeviceFeatures2", "vkGetPhysicalDeviceFeatures2KHR"));
+
+} // namespace vk_fn_info
+} // namespace vk_util
+} // namespace vk
+} // namespace gfxstream
+
+#endif /* VK_FN_INFO_H */
diff --git a/src/gfxstream/host/vulkan/vk_format_info.h b/src/gfxstream/host/vulkan/vk_format_info.h
new file mode 100644
index 00000000000..ad10df2f006
--- /dev/null
+++ b/src/gfxstream/host/vulkan/vk_format_info.h
@@ -0,0 +1,144 @@
+/*
+ * 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>
+#include <vndk/hardware_buffer.h>
+#include <vulkan/vulkan.h>
+
+namespace gfxstream {
+namespace vk {
+
+/* See i915_private_android_types.h in minigbm. */
+#define HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL 0x100
+
+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:
+ 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:
+ return VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
+ case AHARDWAREBUFFER_FORMAT_BLOB:
+ default:
+ return VK_FORMAT_UNDEFINED;
+ }
+}
+
+static inline unsigned android_format_from_vk(unsigned 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;
+ default:
+ return AHARDWAREBUFFER_FORMAT_BLOB;
+ }
+}
+
+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 */ \ No newline at end of file
diff --git a/src/gfxstream/host/vulkan/vk_util.cpp b/src/gfxstream/host/vulkan/vk_util.cpp
new file mode 100644
index 00000000000..096f03aa777
--- /dev/null
+++ b/src/gfxstream/host/vulkan/vk_util.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2011-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 "vk_util.h"
+
+namespace gfxstream {
+namespace vk {
+namespace vk_util {
+namespace {
+
+std::unique_ptr<CallbacksWrapper<VkCheckCallbacks>> gVkCheckCallbacks =
+ std::make_unique<CallbacksWrapper<VkCheckCallbacks>>(nullptr);
+
+} // namespace
+
+void setVkCheckCallbacks(std::unique_ptr<VkCheckCallbacks> callbacks) {
+ gVkCheckCallbacks = std::make_unique<CallbacksWrapper<VkCheckCallbacks>>(std::move(callbacks));
+}
+
+const CallbacksWrapper<VkCheckCallbacks>& getVkCheckCallbacks() { return *gVkCheckCallbacks; }
+
+std::optional<uint32_t> findMemoryType(const VulkanDispatch* ivk, VkPhysicalDevice physicalDevice,
+ uint32_t typeFilter, VkMemoryPropertyFlags properties) {
+ VkPhysicalDeviceMemoryProperties memProperties;
+ ivk->vkGetPhysicalDeviceMemoryProperties(physicalDevice, &memProperties);
+
+ for (uint32_t i = 0; i < memProperties.memoryTypeCount; i++) {
+ if ((typeFilter & (1 << i)) &&
+ (memProperties.memoryTypes[i].propertyFlags & properties) == properties) {
+ return i;
+ }
+ }
+ return std::nullopt;
+}
+
+} // namespace vk_util
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/vk_util.h b/src/gfxstream/host/vulkan/vk_util.h
new file mode 100644
index 00000000000..4064dd33847
--- /dev/null
+++ b/src/gfxstream/host/vulkan/vk_util.h
@@ -0,0 +1,517 @@
+/*
+ * 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 <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <vulkan/vulkan.h>
+
+#include <chrono>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <string>
+#include <thread>
+#include <tuple>
+#include <type_traits>
+#include <vector>
+
+#include "VkDecoderContext.h"
+#include "VulkanDispatch.h"
+#include "aemu/base/synchronization/Lock.h"
+#include "host-common/GfxstreamFatalError.h"
+#include "host-common/logging.h"
+#include "vk_fn_info.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);
+}
+
+// The caller should guarantee that all the pNext structs in the chain starting at nextChain is not
+// a const object to avoid unexpected undefined behavior.
+template <class T, class U, typename = std::enable_if_t<!std::is_const_v<T> && !std::is_const_v<U>>>
+void vk_insert_struct(T& pos, U& nextChain) {
+ vk_struct_common* nextChainTail = reinterpret_cast<vk_struct_common*>(&nextChain);
+ for (; nextChainTail->pNext; nextChainTail = nextChainTail->pNext) {}
+
+ nextChainTail->pNext = reinterpret_cast<vk_struct_common*>(const_cast<void*>(pos.pNext));
+ pos.pNext = &nextChain;
+}
+
+template <class S, class T>
+void vk_struct_chain_remove(S* unwanted, T* vk_struct) {
+ if (!unwanted) return;
+
+ vk_foreach_struct(current, vk_struct) {
+ if ((void*)unwanted == current->pNext) {
+ const vk_struct_common* unwanted_as_common =
+ reinterpret_cast<const vk_struct_common*>(unwanted);
+ current->pNext = unwanted_as_common->pNext;
+ }
+ }
+}
+
+#define VK_CHECK(x) \
+ do { \
+ VkResult err = x; \
+ if (err != VK_SUCCESS) { \
+ if (err == VK_ERROR_DEVICE_LOST) { \
+ vk_util::getVkCheckCallbacks().callIfExists( \
+ &vk_util::VkCheckCallbacks::onVkErrorDeviceLost); \
+ } \
+ if (err == VK_ERROR_OUT_OF_HOST_MEMORY || err == VK_ERROR_OUT_OF_DEVICE_MEMORY || \
+ err == VK_ERROR_OUT_OF_POOL_MEMORY) { \
+ vk_util::getVkCheckCallbacks().callIfExists( \
+ &vk_util::VkCheckCallbacks::onVkErrorOutOfMemory, err, __func__, __LINE__); \
+ } \
+ GFXSTREAM_ABORT(::emugl::FatalError(err)); \
+ } \
+ } while (0)
+
+#define VK_CHECK_MEMALLOC(x, allocateInfo) \
+ do { \
+ VkResult err = x; \
+ if (err != VK_SUCCESS) { \
+ if (err == VK_ERROR_OUT_OF_HOST_MEMORY || err == VK_ERROR_OUT_OF_DEVICE_MEMORY) { \
+ vk_util::getVkCheckCallbacks().callIfExists( \
+ &vk_util::VkCheckCallbacks::onVkErrorOutOfMemoryOnAllocation, err, __func__, \
+ __LINE__, allocateInfo.allocationSize); \
+ } \
+ GFXSTREAM_ABORT(::emugl::FatalError(err)); \
+ } \
+ } while (0)
+
+typedef void* MTLTextureRef;
+typedef void* MTLBufferRef;
+
+namespace vk_util {
+
+inline VkResult waitForVkQueueIdleWithRetry(const VulkanDispatch& vk, VkQueue queue) {
+ using namespace std::chrono_literals;
+ constexpr uint32_t retryLimit = 5;
+ constexpr std::chrono::duration waitInterval = 4ms;
+ VkResult res = vk.vkQueueWaitIdle(queue);
+ for (uint32_t retryTimes = 1; retryTimes < retryLimit && res == VK_TIMEOUT; retryTimes++) {
+ INFO("VK_TIMEOUT returned from vkQueueWaitIdle with %" PRIu32 " attempt. Wait for %" PRIu32
+ "ms before another attempt.",
+ retryTimes,
+ static_cast<uint32_t>(
+ std::chrono::duration_cast<std::chrono::milliseconds>(waitInterval).count()));
+ std::this_thread::sleep_for(waitInterval);
+ res = vk.vkQueueWaitIdle(queue);
+ }
+ return res;
+}
+
+typedef struct {
+ std::function<void()> onVkErrorDeviceLost;
+ std::function<void(VkResult, const char*, int)> onVkErrorOutOfMemory;
+ std::function<void(VkResult, const char*, int, uint64_t)> onVkErrorOutOfMemoryOnAllocation;
+} VkCheckCallbacks;
+
+template <class T>
+class CallbacksWrapper {
+ public:
+ CallbacksWrapper(std::unique_ptr<T> callbacks) : mCallbacks(std::move(callbacks)) {}
+ // function should be a member function pointer to T.
+ template <class U, class... Args>
+ void callIfExists(U function, Args&&... args) const {
+ if (mCallbacks && (*mCallbacks.*function)) {
+ (*mCallbacks.*function)(std::forward<Args>(args)...);
+ }
+ }
+
+ T* get() const { return mCallbacks.get(); }
+
+ private:
+ std::unique_ptr<T> mCallbacks;
+};
+
+std::optional<uint32_t> findMemoryType(const VulkanDispatch* ivk, VkPhysicalDevice physicalDevice,
+ uint32_t typeFilter, VkMemoryPropertyFlags properties);
+
+void setVkCheckCallbacks(std::unique_ptr<VkCheckCallbacks>);
+const CallbacksWrapper<VkCheckCallbacks>& getVkCheckCallbacks();
+
+class CrtpBase {};
+
+// Utility class to make chaining inheritance of multiple CRTP classes more
+// readable by allowing one to replace
+//
+// class MyClass
+// : public vk_util::Crtp1<MyClass,
+// vk_util::Crtp2<MyClass,
+// vk_util::Crtp3<MyClass>>> {};
+//
+// with
+//
+// class MyClass :
+// : public vk_util::MultiCrtp<MyClass,
+// vk_util::Crtp1,
+// vk_util::Crtp2,
+// vk_util::Ctrp3> {};
+namespace vk_util_internal {
+
+// For the template "recursion", this is the base case where the list is empty
+// and which just inherits from the last type.
+template <typename T, //
+ typename U, //
+ template <typename, typename> class... CrtpClasses>
+class MultiCrtpChainHelper : public U {};
+
+// For the template "recursion", this is the case where the list is not empty
+// and which uses the "current" CRTP class as the "U" type and passes the
+// resulting type to the next step in the template "recursion".
+template <typename T, //
+ typename U, //
+ template <typename, typename> class Crtp, //
+ template <typename, typename> class... Crtps>
+class MultiCrtpChainHelper<T, U, Crtp, Crtps...>
+ : public MultiCrtpChainHelper<T, Crtp<T, U>, Crtps...> {};
+
+} // namespace vk_util_internal
+
+template <typename T, //
+ template <typename, typename> class... CrtpClasses>
+class MultiCrtp : public vk_util_internal::MultiCrtpChainHelper<T, CrtpBase, CrtpClasses...> {};
+
+template <class T, class U = CrtpBase>
+class FindMemoryType : public U {
+ protected:
+ std::optional<uint32_t> findMemoryType(uint32_t typeFilter,
+ VkMemoryPropertyFlags properties) const {
+ const T& self = static_cast<const T&>(*this);
+ return vk_util::findMemoryType(&self.m_vk, self.m_vkPhysicalDevice, typeFilter, properties);
+ }
+};
+
+template <class T, class U = CrtpBase>
+class RunSingleTimeCommand : public U {
+ protected:
+ void runSingleTimeCommands(VkQueue queue, std::shared_ptr<android::base::Lock> queueLock,
+ std::function<void(const VkCommandBuffer& commandBuffer)> f) const {
+ const T& self = static_cast<const T&>(*this);
+ VkCommandBuffer cmdBuff;
+ VkCommandBufferAllocateInfo cmdBuffAllocInfo = {
+ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ .commandPool = self.m_vkCommandPool,
+ .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
+ .commandBufferCount = 1};
+ VK_CHECK(self.m_vk.vkAllocateCommandBuffers(self.m_vkDevice, &cmdBuffAllocInfo, &cmdBuff));
+ VkCommandBufferBeginInfo beginInfo = {.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ .flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT};
+ VK_CHECK(self.m_vk.vkBeginCommandBuffer(cmdBuff, &beginInfo));
+ f(cmdBuff);
+ VK_CHECK(self.m_vk.vkEndCommandBuffer(cmdBuff));
+ VkSubmitInfo submitInfo = {.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
+ .commandBufferCount = 1,
+ .pCommandBuffers = &cmdBuff};
+ {
+ std::unique_ptr<android::base::AutoLock> lock = nullptr;
+ if (queueLock) {
+ lock = std::make_unique<android::base::AutoLock>(*queueLock);
+ }
+ VK_CHECK(self.m_vk.vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
+ VK_CHECK(self.m_vk.vkQueueWaitIdle(queue));
+ }
+ self.m_vk.vkFreeCommandBuffers(self.m_vkDevice, self.m_vkCommandPool, 1, &cmdBuff);
+ }
+};
+template <class T, class U = CrtpBase>
+class RecordImageLayoutTransformCommands : public U {
+ protected:
+ void recordImageLayoutTransformCommands(VkCommandBuffer cmdBuff, VkImage image,
+ VkImageLayout oldLayout,
+ VkImageLayout newLayout) const {
+ const T& self = static_cast<const T&>(*this);
+ VkImageMemoryBarrier imageBarrier = {
+ .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
+ .srcAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
+ .oldLayout = oldLayout,
+ .newLayout = newLayout,
+ .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
+ .image = image,
+ .subresourceRange = {.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = 0,
+ .levelCount = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1}};
+ self.m_vk.vkCmdPipelineBarrier(cmdBuff, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0,
+ nullptr, 1, &imageBarrier);
+ }
+};
+
+template <class T>
+typename vk_fn_info::GetVkFnInfo<T>::type getVkInstanceProcAddrWithFallback(
+ const std::vector<std::function<std::remove_pointer_t<PFN_vkGetInstanceProcAddr>>>&
+ vkGetInstanceProcAddrs,
+ VkInstance instance) {
+ for (const auto& vkGetInstanceProcAddr : vkGetInstanceProcAddrs) {
+ if (!vkGetInstanceProcAddr) {
+ continue;
+ }
+ PFN_vkVoidFunction resWithCurrentVkGetInstanceProcAddr = std::apply(
+ [&vkGetInstanceProcAddr, instance](auto&&... names) -> PFN_vkVoidFunction {
+ for (const char* name : {names...}) {
+ if (PFN_vkVoidFunction resWithCurrentName =
+ vkGetInstanceProcAddr(instance, name)) {
+ return resWithCurrentName;
+ }
+ }
+ return nullptr;
+ },
+ vk_fn_info::GetVkFnInfo<T>::names);
+ if (resWithCurrentVkGetInstanceProcAddr) {
+ return reinterpret_cast<typename vk_fn_info::GetVkFnInfo<T>::type>(
+ resWithCurrentVkGetInstanceProcAddr);
+ }
+ }
+ return nullptr;
+}
+
+static inline bool vk_descriptor_type_has_image_view(VkDescriptorType type) {
+ switch (type) {
+ case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
+ case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
+ case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
+ case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
+ return true;
+ default:
+ return false;
+ }
+}
+
+} // namespace vk_util
+} // namespace vk
+} // namespace gfxstream
+
+#endif /* VK_UTIL_H */
diff --git a/src/gfxstream/host/vulkan/vk_util_unittest.cpp b/src/gfxstream/host/vulkan/vk_util_unittest.cpp
new file mode 100644
index 00000000000..d7238729bb9
--- /dev/null
+++ b/src/gfxstream/host/vulkan/vk_util_unittest.cpp
@@ -0,0 +1,267 @@
+// 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 <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "vk_util.h"
+
+#include <vulkan/vulkan_core.h>
+
+#include <tuple>
+
+namespace gfxstream {
+namespace vk {
+namespace vk_util {
+namespace vk_fn_info {
+
+// Register a fake Vulkan function for testing.
+using PFN_vkGfxstreamTestFunc = PFN_vkCreateDevice;
+REGISTER_VK_FN_INFO(GfxstreamTestFunc, ("vkGfxstreamTestFunc", "vkGfxstreamTestFuncGOOGLE",
+ "vkGfxstreamTestFuncGFXSTREAM"))
+constexpr auto vkGfxstreamTestFuncNames = vk_fn_info::GetVkFnInfo<GfxstreamTestFunc>::names;
+
+namespace {
+using ::testing::_;
+using ::testing::MockFunction;
+using ::testing::Return;
+using ::testing::StrEq;
+using ::testing::StrNe;
+
+TEST(getVkInstanceProcAddrWithFallbackTest, ShouldReturnNullOnFailure) {
+ VkInstance instance = reinterpret_cast<VkInstance>(0x1234'0000);
+ MockFunction<std::remove_pointer_t<PFN_vkGetInstanceProcAddr>> vkGetInstanceProcAddrAlwaysNULL;
+
+ EXPECT_CALL(vkGetInstanceProcAddrAlwaysNULL, Call(instance, _)).WillRepeatedly(Return(nullptr));
+
+ EXPECT_EQ(getVkInstanceProcAddrWithFallback<GfxstreamTestFunc>({}, instance), nullptr);
+ EXPECT_EQ(getVkInstanceProcAddrWithFallback<GfxstreamTestFunc>({nullptr, nullptr}, instance),
+ nullptr);
+ EXPECT_EQ(getVkInstanceProcAddrWithFallback<GfxstreamTestFunc>(
+ {vkGetInstanceProcAddrAlwaysNULL.AsStdFunction(),
+ vkGetInstanceProcAddrAlwaysNULL.AsStdFunction()},
+ instance),
+ nullptr);
+}
+
+TEST(getVkInstanceProcAddrWithFallbackTest, ShouldSkipNullVkGetInstanceProcAddr) {
+ VkInstance instance = reinterpret_cast<VkInstance>(0x1234'0000);
+ PFN_vkGfxstreamTestFunc validFp = reinterpret_cast<PFN_vkGfxstreamTestFunc>(0x4321'0000);
+ MockFunction<std::remove_pointer_t<PFN_vkGetInstanceProcAddr>> vkGetInstanceProcAddrMock;
+
+ EXPECT_CALL(vkGetInstanceProcAddrMock, Call(instance, _))
+ .WillRepeatedly(Return(reinterpret_cast<PFN_vkVoidFunction>(validFp)));
+
+ EXPECT_EQ(getVkInstanceProcAddrWithFallback<GfxstreamTestFunc>(
+ {nullptr, vkGetInstanceProcAddrMock.AsStdFunction()}, instance),
+ validFp);
+ EXPECT_EQ(getVkInstanceProcAddrWithFallback<GfxstreamTestFunc>(
+ {vkGetInstanceProcAddrMock.AsStdFunction(), nullptr}, instance),
+ validFp);
+}
+
+TEST(getVkInstanceProcAddrWithFallbackTest, ShouldSkipNullFpReturned) {
+ VkInstance instance = reinterpret_cast<VkInstance>(0x1234'0000);
+ PFN_vkGfxstreamTestFunc validFp = reinterpret_cast<PFN_vkGfxstreamTestFunc>(0x4321'0000);
+ MockFunction<std::remove_pointer_t<PFN_vkGetInstanceProcAddr>> vkGetInstanceProcAddrMock;
+ MockFunction<std::remove_pointer_t<PFN_vkGetInstanceProcAddr>> vkGetInstanceProcAddrAlwaysNULL;
+
+ // We know that vkGfxstreamTest has different names.
+ EXPECT_CALL(vkGetInstanceProcAddrMock,
+ Call(instance, StrNe(std::get<1>(vkGfxstreamTestFuncNames))))
+ .WillRepeatedly(Return(nullptr));
+ EXPECT_CALL(vkGetInstanceProcAddrMock,
+ Call(instance, StrEq(std::get<1>(vkGfxstreamTestFuncNames))))
+ .WillRepeatedly(Return(reinterpret_cast<PFN_vkVoidFunction>(validFp)));
+ EXPECT_CALL(vkGetInstanceProcAddrAlwaysNULL, Call(instance, _)).WillRepeatedly(Return(nullptr));
+
+ EXPECT_EQ(getVkInstanceProcAddrWithFallback<GfxstreamTestFunc>(
+ {vkGetInstanceProcAddrMock.AsStdFunction(),
+ vkGetInstanceProcAddrAlwaysNULL.AsStdFunction()},
+ instance),
+ validFp);
+ EXPECT_EQ(getVkInstanceProcAddrWithFallback<GfxstreamTestFunc>(
+ {vkGetInstanceProcAddrAlwaysNULL.AsStdFunction(),
+ vkGetInstanceProcAddrMock.AsStdFunction()},
+ instance),
+ validFp);
+}
+
+TEST(getVkInstanceProcAddrWithFallbackTest, firstVkInstanceProcAddrShouldTakeThePriority) {
+ VkInstance instance = reinterpret_cast<VkInstance>(0x1234'0000);
+ PFN_vkGfxstreamTestFunc validFp1 = reinterpret_cast<PFN_vkGfxstreamTestFunc>(0x4321'0000);
+ PFN_vkGfxstreamTestFunc validFp2 = reinterpret_cast<PFN_vkGfxstreamTestFunc>(0x3421'0070);
+ MockFunction<std::remove_pointer_t<PFN_vkGetInstanceProcAddr>> vkGetInstanceProcAddrMock1;
+ MockFunction<std::remove_pointer_t<PFN_vkGetInstanceProcAddr>> vkGetInstanceProcAddrMock2;
+
+ EXPECT_CALL(vkGetInstanceProcAddrMock1, Call(instance, _))
+ .WillRepeatedly(Return(reinterpret_cast<PFN_vkVoidFunction>(validFp1)));
+ EXPECT_CALL(vkGetInstanceProcAddrMock2, Call(instance, _))
+ .WillRepeatedly(Return(reinterpret_cast<PFN_vkVoidFunction>(validFp2)));
+
+ EXPECT_EQ(getVkInstanceProcAddrWithFallback<GfxstreamTestFunc>(
+ {vkGetInstanceProcAddrMock1.AsStdFunction(),
+ vkGetInstanceProcAddrMock2.AsStdFunction()},
+ instance),
+ validFp1);
+}
+
+TEST(getVkInstanceProcAddrWithFallbackTest, firstNameShouldTakeThePriority) {
+ VkInstance instance = reinterpret_cast<VkInstance>(0x1234'0000);
+ PFN_vkGfxstreamTestFunc validFps[] = {reinterpret_cast<PFN_vkGfxstreamTestFunc>(0x4321'0000),
+ reinterpret_cast<PFN_vkGfxstreamTestFunc>(0x3421'0070),
+ reinterpret_cast<PFN_vkGfxstreamTestFunc>(0x2222'4321)};
+ MockFunction<std::remove_pointer_t<PFN_vkGetInstanceProcAddr>> vkGetInstanceProcAddrMock;
+
+ EXPECT_CALL(vkGetInstanceProcAddrMock,
+ Call(instance, StrEq(std::get<0>(vkGfxstreamTestFuncNames))))
+ .WillRepeatedly(Return(reinterpret_cast<PFN_vkVoidFunction>(validFps[0])));
+ ON_CALL(vkGetInstanceProcAddrMock, Call(instance, StrEq(std::get<1>(vkGfxstreamTestFuncNames))))
+ .WillByDefault(Return(reinterpret_cast<PFN_vkVoidFunction>(validFps[1])));
+ ON_CALL(vkGetInstanceProcAddrMock, Call(instance, StrEq(std::get<2>(vkGfxstreamTestFuncNames))))
+ .WillByDefault(Return(reinterpret_cast<PFN_vkVoidFunction>(validFps[2])));
+
+ EXPECT_EQ(getVkInstanceProcAddrWithFallback<GfxstreamTestFunc>(
+ {vkGetInstanceProcAddrMock.AsStdFunction()}, instance),
+ validFps[0]);
+}
+
+TEST(VkCheckCallbacksDeathTest, deviceLostCallbackShouldBeCalled) {
+ setVkCheckCallbacks(std::make_unique<VkCheckCallbacks>(VkCheckCallbacks{
+ .onVkErrorDeviceLost = [] { exit(43); },
+ }));
+
+ EXPECT_EXIT(VK_CHECK(VK_ERROR_DEVICE_LOST), testing::ExitedWithCode(43), "");
+}
+
+TEST(VkCheckCallbacksDeathTest, deviceLostCallbackShouldNotBeCalled) {
+ // Default death function uses exit code 42
+ emugl::setDieFunction([] { exit(42); });
+
+ // Device lost death function uses exit code 43
+ setVkCheckCallbacks(std::make_unique<VkCheckCallbacks>(VkCheckCallbacks{
+ .onVkErrorDeviceLost = [] { exit(43); },
+ }));
+
+ EXPECT_EXIT(VK_CHECK(VK_ERROR_OUT_OF_DEVICE_MEMORY), testing::ExitedWithCode(42), "");
+}
+
+TEST(VkCheckCallbacksDeathTest, nullCallbacksShouldntCrash) {
+ emugl::setDieFunction([] { exit(42); });
+ setVkCheckCallbacks(nullptr);
+ EXPECT_EXIT(VK_CHECK(VK_ERROR_DEVICE_LOST), testing::ExitedWithCode(42), "");
+}
+
+TEST(VkCheckCallbacksDeathTest, nullVkDeviceLostErrorCallbackShouldntCrash) {
+ emugl::setDieFunction([] { exit(42); });
+ setVkCheckCallbacks(
+ std::make_unique<VkCheckCallbacks>(VkCheckCallbacks{.onVkErrorDeviceLost = nullptr}));
+ EXPECT_EXIT(VK_CHECK(VK_ERROR_DEVICE_LOST), testing::ExitedWithCode(42), "");
+}
+
+template <typename T, class U = CrtpBase>
+class ExampleCrtpClass1 : public U {
+ public:
+ void doCtrp1() {
+ T& self = static_cast<T&>(*this);
+ EXPECT_EQ(self.value, 42);
+ self.doCtrp1WasCalled = true;
+ }
+};
+
+template <typename T, class U = CrtpBase>
+class ExampleCrtpClass2 : public U {
+ public:
+ void doCtrp2() {
+ T& self = static_cast<T&>(*this);
+ EXPECT_EQ(self.value, 42);
+ self.doCtrp2WasCalled = true;
+ }
+};
+
+template <typename T, class U = CrtpBase>
+class ExampleCrtpClass3 : public U {
+ public:
+ void doCtrp3() {
+ T& self = static_cast<T&>(*this);
+ EXPECT_EQ(self.value, 42);
+ self.doCtrp3WasCalled = true;
+ }
+};
+
+struct MultiCrtpTestStruct
+ : MultiCrtp<MultiCrtpTestStruct, ExampleCrtpClass1, ExampleCrtpClass2, ExampleCrtpClass3> {
+ void doCtrpMethods() {
+ doCtrp1();
+ doCtrp2();
+ doCtrp3();
+ }
+
+ int value = 42;
+ bool doCtrp1WasCalled = false;
+ bool doCtrp2WasCalled = false;
+ bool doCtrp3WasCalled = false;
+};
+
+TEST(MultiCrtp, MultiCrtp) {
+ MultiCrtpTestStruct object;
+ object.doCtrpMethods();
+ EXPECT_TRUE(object.doCtrp1WasCalled);
+ EXPECT_TRUE(object.doCtrp2WasCalled);
+ EXPECT_TRUE(object.doCtrp3WasCalled);
+}
+
+TEST(vk_util, vk_insert_struct) {
+ VkDeviceCreateInfo deviceCi = {
+ .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
+ .pNext = nullptr,
+ };
+ VkPhysicalDeviceFeatures2 physicalDeviceFeature = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
+ .pNext = nullptr,
+ };
+ vk_insert_struct(deviceCi, physicalDeviceFeature);
+ ASSERT_EQ(deviceCi.pNext, &physicalDeviceFeature);
+ ASSERT_EQ(physicalDeviceFeature.pNext, nullptr);
+
+ VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcrFeature = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
+ .pNext = nullptr,
+ };
+ VkPhysicalDeviceDescriptorIndexingFeatures indexingFeatures = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES,
+ .pNext = nullptr,
+ };
+ vk_insert_struct(ycbcrFeature, indexingFeatures);
+ ASSERT_EQ(ycbcrFeature.pNext, &indexingFeatures);
+ ASSERT_EQ(indexingFeatures.pNext, nullptr);
+
+ vk_insert_struct(deviceCi, ycbcrFeature);
+ const VkBaseInStructure* base = reinterpret_cast<VkBaseInStructure*>(&deviceCi);
+ ASSERT_EQ(base, reinterpret_cast<VkBaseInStructure*>(&deviceCi));
+ base = base->pNext;
+ ASSERT_EQ(base, reinterpret_cast<VkBaseInStructure*>(&ycbcrFeature));
+ base = base->pNext;
+ ASSERT_EQ(base, reinterpret_cast<VkBaseInStructure*>(&indexingFeatures));
+ base = base->pNext;
+ ASSERT_EQ(base, reinterpret_cast<VkBaseInStructure*>(&physicalDeviceFeature));
+ base = base->pNext;
+ ASSERT_EQ(base, nullptr);
+}
+
+} // namespace
+} // namespace vk_fn_info
+} // namespace vk_util
+} // namespace vk
+} // namespace gfxstream
diff --git a/src/gfxstream/host/vulkan/vulkan_gfxstream.h b/src/gfxstream/host/vulkan/vulkan_gfxstream.h
new file mode 100644
index 00000000000..a2c288ce259
--- /dev/null
+++ b/src/gfxstream/host/vulkan/vulkan_gfxstream.h
@@ -0,0 +1,234 @@
+/*
+** Copyright 2015-2023 The Khronos Group Inc.
+**
+** SPDX-License-Identifier: Apache-2.0
+*/
+
+/*
+** This header is generated from the Khronos Vulkan XML API Registry.
+**
+*/
+
+#pragma once
+#ifdef VK_GFXSTREAM_STRUCTURE_TYPE_EXT
+#include "vulkan_gfxstream_structure_type.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+// VK_GOOGLE_gfxstream is a preprocessor guard. Do not pass it to API calls.
+#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);
+typedef void (VKAPI_PTR *PFN_vkUpdateDescriptorSetWithTemplateSized2GOOGLE)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, uint32_t imageInfoCount, uint32_t bufferInfoCount, uint32_t bufferViewCount, uint32_t inlineUniformBlockCount, const uint32_t* pImageInfoEntryIndices, const uint32_t* pBufferInfoEntryIndices, const uint32_t* pBufferViewEntryIndices, const VkDescriptorImageInfo* pImageInfos, const VkDescriptorBufferInfo* pBufferInfos, const VkBufferView* pBufferViews, const uint8_t* pInlineUniformBlockData);
+typedef void (VKAPI_PTR *PFN_vkQueueSubmitAsync2GOOGLE)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence);
+
+#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);
+
+VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateSized2GOOGLE(
+ VkDevice device,
+ VkDescriptorSet descriptorSet,
+ VkDescriptorUpdateTemplate descriptorUpdateTemplate,
+ uint32_t imageInfoCount,
+ uint32_t bufferInfoCount,
+ uint32_t bufferViewCount,
+ uint32_t inlineUniformBlockCount,
+ const uint32_t* pImageInfoEntryIndices,
+ const uint32_t* pBufferInfoEntryIndices,
+ const uint32_t* pBufferViewEntryIndices,
+ const VkDescriptorImageInfo* pImageInfos,
+ const VkDescriptorBufferInfo* pBufferInfos,
+ const VkBufferView* pBufferViews,
+ const uint8_t* pInlineUniformBlockData);
+
+VKAPI_ATTR void VKAPI_CALL vkQueueSubmitAsync2GOOGLE(
+ VkQueue queue,
+ uint32_t submitCount,
+ const VkSubmitInfo2* pSubmits,
+ VkFence fence);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/gfxstream/host/vulkan/vulkan_gfxstream_structure_type.h b/src/gfxstream/host/vulkan/vulkan_gfxstream_structure_type.h
new file mode 100644
index 00000000000..7ef8ed8cb1c
--- /dev/null
+++ b/src/gfxstream/host/vulkan/vulkan_gfxstream_structure_type.h
@@ -0,0 +1,39 @@
+// 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/vulkan-docs-next/scripts/genvk.py -registry
+// codegen/vulkan/vulkan-docs-next/xml/vk.xml -registryGfxstream
+// codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.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/src/gfxstream/include/OpenGLESDispatch/DispatchTables.h b/src/gfxstream/include/OpenGLESDispatch/DispatchTables.h
new file mode 100644
index 00000000000..fc2e6600bdf
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/DispatchTables.h
@@ -0,0 +1,28 @@
+/*
+* Copyright (C) 2011-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.
+*/
+#pragma once
+
+#include "OpenGLESDispatch/GLESv1Dispatch.h"
+#include "OpenGLESDispatch/GLESv2Dispatch.h"
+
+namespace gfxstream {
+namespace gl {
+
+extern GLESv2Dispatch s_gles2;
+extern GLESv1Dispatch s_gles1;
+
+} // namespace gl
+} // namespace gfxstream
diff --git a/src/gfxstream/include/OpenGLESDispatch/EGLDispatch.h b/src/gfxstream/include/OpenGLESDispatch/EGLDispatch.h
new file mode 100644
index 00000000000..6356b06d909
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/EGLDispatch.h
@@ -0,0 +1,70 @@
+/*
+* 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.
+*/
+#pragma once
+
+extern "C" {
+ #include "OpenGLESDispatch/RenderEGL_functions.h"
+ #include "OpenGLESDispatch/RenderEGL_extensions_functions.h"
+ #include "OpenGLESDispatch/RenderEGL_snapshot_functions.h"
+}
+
+#include "OpenGLESDispatch/RenderEGL_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/RenderEGL_extensions_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/RenderEGL_snapshot_static_translator_namespaced_header.h"
+
+namespace gfxstream {
+namespace gl {
+
+// This header is used to define the EGLDispatch structure that contains
+// pointers to the EGL shared library used by libOpenglRender. Normally,
+// this will be our own libEGL_translator, but one could imagine a
+// vendor-specific being used instead.
+
+// There is a single global instance of this structure, named |s_egl|,
+// which must be initialized by calling init_egl_dispatch() before use.
+
+// Note that our code requires the implementation of misc EGL extensions
+// including eglSetSwapRectangleANDROID(), see RenderEGL_extensions_functions.h
+// for a full list.
+
+#define RENDER_EGL_DEFINE_TYPE(return_type, function_name, signature) \
+ typedef return_type (EGLAPIENTRY *function_name ## _t) signature;
+
+#define RENDER_EGL_DECLARE_MEMBER(return_type, function_name, signature) \
+ function_name ## _t function_name;
+
+// Define function typedefs.
+LIST_RENDER_EGL_FUNCTIONS(RENDER_EGL_DEFINE_TYPE)
+LIST_RENDER_EGL_EXTENSIONS_FUNCTIONS(RENDER_EGL_DEFINE_TYPE)
+LIST_RENDER_EGL_SNAPSHOT_FUNCTIONS(RENDER_EGL_DEFINE_TYPE)
+
+// Define EGLDispatch structure.
+struct EGLDispatch {
+ LIST_RENDER_EGL_FUNCTIONS(RENDER_EGL_DECLARE_MEMBER)
+ LIST_RENDER_EGL_EXTENSIONS_FUNCTIONS(RENDER_EGL_DECLARE_MEMBER)
+ LIST_RENDER_EGL_SNAPSHOT_FUNCTIONS(RENDER_EGL_DECLARE_MEMBER)
+
+ bool initialized = false;
+};
+
+// Initialize EGLDispatch function. Return true on success, false on failure.
+bool init_egl_dispatch();
+
+// Global EGLDispatch instance. Call init_egl_dispatch() before using it.
+extern EGLDispatch s_egl;
+
+} // namespace gl
+} // namespace gfxstream
diff --git a/src/gfxstream/include/OpenGLESDispatch/GLESv1Dispatch.h b/src/gfxstream/include/OpenGLESDispatch/GLESv1Dispatch.h
new file mode 100644
index 00000000000..5e1d2a50ee4
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/GLESv1Dispatch.h
@@ -0,0 +1,60 @@
+/*
+* 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.
+*/
+#pragma once
+
+#include "OpenGLESDispatch/gldefs.h"
+#include "OpenGLESDispatch/gles_functions.h"
+#include "KHR/khrplatform.h"
+
+#include "OpenGLESDispatch/gles1_only_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles1_extensions_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles_common_for_gles1_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles_extensions_for_gles1_static_translator_namespaced_header.h"
+
+#include <stdint.h>
+
+namespace gfxstream {
+namespace gl {
+
+// Define function pointer types.
+#define GLES1_DISPATCH_DEFINE_TYPE(return_type,func_name,signature,callargs) \
+ typedef return_type (KHRONOS_APIENTRY * func_name ## _t) signature;
+
+LIST_GLES1_FUNCTIONS(GLES1_DISPATCH_DEFINE_TYPE,GLES1_DISPATCH_DEFINE_TYPE)
+ LIST_GLES12_TR_FUNCTIONS(GLES1_DISPATCH_DEFINE_TYPE)
+
+struct GLESv1Dispatch {
+#define GLES1_DISPATCH_DECLARE_POINTER(return_type,func_name,signature,callargs) \
+ func_name ## _t func_name;
+ LIST_GLES1_FUNCTIONS(GLES1_DISPATCH_DECLARE_POINTER,
+ GLES1_DISPATCH_DECLARE_POINTER)
+
+ bool initialized = false;
+};
+
+#undef GLES1_DISPATCH_DECLARE_POINTER
+#undef GLES1_DISPATCH_DEFINE_TYPE
+
+bool gles1_dispatch_init(GLESv1Dispatch* dispatch_table);
+
+// Used to initialize the decoder.
+void* gles1_dispatch_get_proc_func(const char* name, void* userData);
+
+// Used to check for unimplemented.
+void gles1_unimplemented();
+
+} // namespace gl
+} // namespace gfxstream
diff --git a/src/gfxstream/include/OpenGLESDispatch/GLESv2Dispatch.h b/src/gfxstream/include/OpenGLESDispatch/GLESv2Dispatch.h
new file mode 100644
index 00000000000..ff7da1b32a0
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/GLESv2Dispatch.h
@@ -0,0 +1,74 @@
+/*
+* 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.
+*/
+#pragma once
+
+#include <stdint.h>
+#include "OpenGLESDispatch/gldefs.h"
+#include "OpenGLESDispatch/gles_functions.h"
+#include "KHR/khrplatform.h"
+
+#include "OpenGLESDispatch/gles2_extensions_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles2_only_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles_common_for_gles2_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles_extensions_for_gles2_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles31_only_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles32_only_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles3_extensions_static_translator_namespaced_header.h"
+#include "OpenGLESDispatch/gles3_only_static_translator_namespaced_header.h"
+
+namespace gfxstream {
+namespace gl {
+
+// Define function pointer types.
+#define GLES2_DISPATCH_DEFINE_TYPE(return_type,func_name,signature,callargs) \
+ typedef return_type (KHRONOS_APIENTRY * func_name ## _t) signature;
+
+LIST_GLES2_FUNCTIONS(GLES2_DISPATCH_DEFINE_TYPE,GLES2_DISPATCH_DEFINE_TYPE)
+
+struct GLESv2Dispatch {
+#define GLES2_DISPATCH_DECLARE_POINTER(return_type,func_name,signature,callargs) \
+ func_name ## _t func_name;
+ LIST_GLES2_FUNCTIONS(GLES2_DISPATCH_DECLARE_POINTER,
+ GLES2_DISPATCH_DECLARE_POINTER)
+
+ bool initialized = false;
+};
+
+#undef GLES2_DISPATCH_DECLARE_POINTER
+#undef GLES2_DISPATCH_DEFINE_TYPE
+
+bool gles2_dispatch_init(GLESv2Dispatch* dispatch_table);
+
+// Used to initialize the decoder.
+void* gles2_dispatch_get_proc_func(const char* name, void* userData);
+// Used to check for unimplemented.
+void gles2_unimplemented();
+
+// Used to query max GLES version support based on what the dispatch mechanism
+// has found in the GLESv2 library.
+// First, a enum for tracking the detected GLES version based on dispatch.
+// We support 2 minimally.
+enum GLESDispatchMaxVersion {
+ GLES_DISPATCH_MAX_VERSION_2 = 0,
+ GLES_DISPATCH_MAX_VERSION_3_0 = 1,
+ GLES_DISPATCH_MAX_VERSION_3_1 = 2,
+ GLES_DISPATCH_MAX_VERSION_3_2 = 3,
+};
+
+GLESDispatchMaxVersion gles2_dispatch_get_max_version();
+
+} // namespace gl
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/include/OpenGLESDispatch/OpenGLDispatchLoader.h b/src/gfxstream/include/OpenGLESDispatch/OpenGLDispatchLoader.h
new file mode 100644
index 00000000000..07ee1b8f4e8
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/OpenGLDispatchLoader.h
@@ -0,0 +1,64 @@
+// 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.
+
+#pragma once
+
+#include "OpenGLESDispatch/EGLDispatch.h"
+#include "OpenGLESDispatch/GLESv1Dispatch.h"
+#include "OpenGLESDispatch/GLESv2Dispatch.h"
+
+namespace gfxstream {
+namespace gl {
+
+// Helper classes to hold global EGLDispatch, GLESv1Dispatch and GLESv2Dispatch
+// objects, initialized lazily in a thread-safe way. The instances are leaked on
+// program exit.
+
+struct LazyLoadedGLESv1Dispatch {
+ // Return pointer to global GLESv1Dispatch instance, or nullptr if there
+ // was an error when trying to initialize/load the library.
+ static const GLESv1Dispatch* get();
+
+ LazyLoadedGLESv1Dispatch();
+
+private:
+ bool mValid;
+};
+
+struct LazyLoadedGLESv2Dispatch {
+ // Return pointer to global GLESv2Dispatch instance, or nullptr if there
+ // was an error when trying to initialize/load the library.
+ static const GLESv2Dispatch* get();
+
+ LazyLoadedGLESv2Dispatch();
+
+private:
+ bool mValid;
+};
+
+// Note that the dispatch table is provided by libOpenGLESDispatch as the
+// 's_egl' global variable.
+struct LazyLoadedEGLDispatch {
+ // Return pointer to EGLDispatch table, or nullptr if there was
+ // an error when trying to initialize/load the library.
+ static const EGLDispatch* get();
+
+ LazyLoadedEGLDispatch();
+
+private:
+ bool mValid;
+};
+
+} // namespace gl
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/include/OpenGLESDispatch/RenderEGL_extensions_functions.h b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_extensions_functions.h
new file mode 100644
index 00000000000..3ea98c88ce7
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_extensions_functions.h
@@ -0,0 +1,38 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=functions stream-servers/gl/OpenGLESDispatch/render_egl_extensions.entries --output=include/OpenGLESDispatch/RenderEGL_extensions_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef RENDER_EGL_EXTENSIONS_FUNCTIONS_H
+#define RENDER_EGL_EXTENSIONS_FUNCTIONS_H
+
+#include <EGL/egl.h>
+#define EGL_EGLEXT_PROTOTYPES
+#include <EGL/eglext.h>
+#define LIST_RENDER_EGL_EXTENSIONS_FUNCTIONS(X) \
+ X(EGLImageKHR, eglCreateImageKHR, (EGLDisplay display, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLint* attrib_list)) \
+ X(EGLBoolean, eglDestroyImageKHR, (EGLDisplay display, EGLImageKHR image)) \
+ X(EGLSyncKHR, eglCreateSyncKHR, (EGLDisplay display, EGLenum type, const EGLint* attribs)) \
+ X(EGLint, eglClientWaitSyncKHR, (EGLDisplay display, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout)) \
+ X(EGLint, eglWaitSyncKHR, (EGLDisplay display, EGLSyncKHR sync, EGLint flags)) \
+ X(EGLBoolean, eglDestroySyncKHR, (EGLDisplay display, EGLSyncKHR sync)) \
+ X(EGLint, eglGetMaxGLESVersion, (EGLDisplay display)) \
+ X(void, eglBlitFromCurrentReadBufferANDROID, (EGLDisplay display, EGLImageKHR image)) \
+ X(void*, eglSetImageFenceANDROID, (EGLDisplay display, EGLImageKHR image)) \
+ X(void, eglWaitImageFenceANDROID, (EGLDisplay display, void* fence)) \
+ X(void, eglAddLibrarySearchPathANDROID, (const char* path)) \
+ X(EGLBoolean, eglQueryVulkanInteropSupportANDROID, ()) \
+ X(EGLBoolean, eglGetSyncAttribKHR, (EGLDisplay display, EGLSync sync, EGLint attribute, EGLint * value)) \
+ X(EGLDisplay, eglGetNativeDisplayANDROID, (EGLDisplay display)) \
+ X(EGLContext, eglGetNativeContextANDROID, (EGLDisplay display, EGLContext context)) \
+ X(EGLImage, eglGetNativeImageANDROID, (EGLDisplay display, EGLImage image)) \
+ X(EGLBoolean, eglSetImageInfoANDROID, (EGLDisplay display, EGLImage image, EGLint width, EGLint height, EGLint internalformat)) \
+ X(EGLImage, eglImportImageANDROID, (EGLDisplay display, EGLImage image)) \
+ X(EGLint, eglDebugMessageControlKHR, (EGLDEBUGPROCKHR callback, const EGLAttrib * attrib_list)) \
+
+EGLAPI EGLint EGLAPIENTRY eglGetMaxGLESVersion(EGLDisplay display);
+EGLAPI void EGLAPIENTRY eglBlitFromCurrentReadBufferANDROID(EGLDisplay display, EGLImageKHR image);
+EGLAPI void* EGLAPIENTRY eglSetImageFenceANDROID(EGLDisplay display, EGLImageKHR image);
+EGLAPI void EGLAPIENTRY eglWaitImageFenceANDROID(EGLDisplay display, void* fence);
+EGLAPI void EGLAPIENTRY eglAddLibrarySearchPathANDROID(const char* path);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryVulkanInteropSupportANDROID();
+
+#endif // RENDER_EGL_EXTENSIONS_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/RenderEGL_extensions_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_extensions_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..ddd4894d4c5
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_extensions_static_translator_namespaced_header.h
@@ -0,0 +1,31 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/render_egl_extensions.entries --output=include/OpenGLESDispatch/RenderEGL_extensions_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+#include <EGL/egl.h>
+#define EGL_EGLEXT_PROTOTYPES
+#include <EGL/eglext.h>
+namespace translator {
+namespace egl {
+EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR(EGLDisplay display, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLint* attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR(EGLDisplay display, EGLImageKHR image);
+EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay display, EGLenum type, const EGLint* attribs);
+EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay display, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
+EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay display, EGLSyncKHR sync, EGLint flags);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay display, EGLSyncKHR sync);
+EGLAPI EGLint EGLAPIENTRY eglGetMaxGLESVersion(EGLDisplay display);
+EGLAPI void EGLAPIENTRY eglBlitFromCurrentReadBufferANDROID(EGLDisplay display, EGLImageKHR image);
+EGLAPI void* EGLAPIENTRY eglSetImageFenceANDROID(EGLDisplay display, EGLImageKHR image);
+EGLAPI void EGLAPIENTRY eglWaitImageFenceANDROID(EGLDisplay display, void* fence);
+EGLAPI void EGLAPIENTRY eglAddLibrarySearchPathANDROID(const char* path);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryVulkanInteropSupportANDROID();
+EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay display, EGLSync sync, EGLint attribute, EGLint * value);
+EGLAPI EGLDisplay EGLAPIENTRY eglGetNativeDisplayANDROID(EGLDisplay display);
+EGLAPI EGLContext EGLAPIENTRY eglGetNativeContextANDROID(EGLDisplay display, EGLContext context);
+EGLAPI EGLImage EGLAPIENTRY eglGetNativeImageANDROID(EGLDisplay display, EGLImage image);
+EGLAPI EGLBoolean EGLAPIENTRY eglSetImageInfoANDROID(EGLDisplay display, EGLImage image, EGLint width, EGLint height, EGLint internalformat);
+EGLAPI EGLImage EGLAPIENTRY eglImportImageANDROID(EGLDisplay display, EGLImage image);
+EGLAPI EGLint EGLAPIENTRY eglDebugMessageControlKHR(EGLDEBUGPROCKHR callback, const EGLAttrib * attrib_list);
+} // namespace translator
+} // namespace egl
diff --git a/src/gfxstream/include/OpenGLESDispatch/RenderEGL_functions.h b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_functions.h
new file mode 100644
index 00000000000..356e5c5b7a2
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_functions.h
@@ -0,0 +1,35 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=functions stream-servers/gl/OpenGLESDispatch/render_egl.entries --output=include/OpenGLESDispatch/RenderEGL_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef RENDER_EGL_FUNCTIONS_H
+#define RENDER_EGL_FUNCTIONS_H
+
+#include <EGL/egl.h>
+#define translator_egl_const_char const char
+#define LIST_RENDER_EGL_FUNCTIONS(X) \
+ X(EGLint, eglGetError, ()) \
+ X(EGLDisplay, eglGetDisplay, (EGLNativeDisplayType dpy)) \
+ X(EGLBoolean, eglTerminate, (EGLDisplay dpy)) \
+ X(EGLBoolean, eglInitialize, (EGLDisplay dpy, EGLint* major, EGLint* minor)) \
+ X(translator_egl_const_char*, eglQueryString, (EGLDisplay dpy, EGLint id)) \
+ X(EGLBoolean, eglGetConfigs, (EGLDisplay display, EGLConfig* configs, EGLint config_size, EGLint* num_config)) \
+ X(EGLBoolean, eglChooseConfig, (EGLDisplay display, const EGLint* attribs, EGLConfig* configs, EGLint config_size, EGLint* num_config)) \
+ X(EGLBoolean, eglGetConfigAttrib, (EGLDisplay display, EGLConfig config, EGLint attribute, EGLint* value)) \
+ X(EGLSurface, eglCreateWindowSurface, (EGLDisplay display, EGLConfig config, EGLNativeWindowType native_window, const EGLint* attrib_list)) \
+ X(EGLSurface, eglCreatePbufferSurface, (EGLDisplay display, EGLConfig config, const EGLint* attrib_list)) \
+ X(EGLBoolean, eglDestroySurface, (EGLDisplay display, EGLSurface surface)) \
+ X(EGLBoolean, eglBindAPI, (EGLenum api)) \
+ X(EGLenum, eglQueryAPI, ()) \
+ X(EGLBoolean, eglReleaseThread, ()) \
+ X(EGLContext, eglCreateContext, (EGLDisplay display, EGLConfig config, EGLContext share_context, const EGLint* attrib_list)) \
+ X(EGLBoolean, eglDestroyContext, (EGLDisplay display, EGLContext context)) \
+ X(EGLBoolean, eglMakeCurrent, (EGLDisplay display, EGLSurface draw, EGLSurface read, EGLContext context)) \
+ X(EGLContext, eglGetCurrentContext, ()) \
+ X(EGLDisplay, eglGetCurrentDisplay, ()) \
+ X(EGLSurface, eglGetCurrentSurface, (EGLint readdraw)) \
+ X(EGLBoolean, eglQuerySurface, (EGLDisplay display, EGLSurface surface, EGLint attribute, EGLint * value)) \
+ X(EGLBoolean, eglSwapBuffers, (EGLDisplay display, EGLSurface surface)) \
+ X(void*, eglGetProcAddress, (const char* function_name)) \
+
+
+#endif // RENDER_EGL_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/RenderEGL_snapshot_functions.h b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_snapshot_functions.h
new file mode 100644
index 00000000000..4ed0c530559
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_snapshot_functions.h
@@ -0,0 +1,34 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=functions stream-servers/gl/OpenGLESDispatch/render_egl_snapshot.entries --output=include/OpenGLESDispatch/RenderEGL_snapshot_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef RENDER_EGL_SNAPSHOT_FUNCTIONS_H
+#define RENDER_EGL_SNAPSHOT_FUNCTIONS_H
+
+#define LIST_RENDER_EGL_SNAPSHOT_FUNCTIONS(X) \
+ X(EGLConfig, eglLoadConfig, (EGLDisplay display, EGLStreamKHR stream)) \
+ X(EGLContext, eglLoadContext, (EGLDisplay display, const EGLint * attrib_list, EGLStreamKHR stream)) \
+ X(EGLBoolean, eglLoadAllImages, (EGLDisplay display, EGLStreamKHR stream, const void* textureLoader)) \
+ X(EGLBoolean, eglSaveConfig, (EGLDisplay display, EGLConfig config, EGLStreamKHR stream)) \
+ X(EGLBoolean, eglSaveContext, (EGLDisplay display, EGLContext context, EGLStreamKHR stream)) \
+ X(EGLBoolean, eglSaveAllImages, (EGLDisplay display, EGLStreamKHR stream, const void* textureSaver)) \
+ X(EGLBoolean, eglPreSaveContext, (EGLDisplay display, EGLContext contex, EGLStreamKHR stream)) \
+ X(EGLBoolean, eglPostLoadAllImages, (EGLDisplay display, EGLStreamKHR stream)) \
+ X(EGLBoolean, eglPostSaveContext, (EGLDisplay display, EGLConfig config, EGLStreamKHR stream)) \
+ X(void, eglUseOsEglApi, (EGLBoolean enable, EGLBoolean nullEgl)) \
+ X(void, eglSetMaxGLESVersion, (EGLint glesVersion)) \
+ X(void, eglFillUsages, (void* usages)) \
+
+EGLAPI EGLConfig EGLAPIENTRY eglLoadConfig(EGLDisplay display, EGLStreamKHR stream);
+EGLAPI EGLContext EGLAPIENTRY eglLoadContext(EGLDisplay display, const EGLint * attrib_list, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglLoadAllImages(EGLDisplay display, EGLStreamKHR stream, const void* textureLoader);
+EGLAPI EGLBoolean EGLAPIENTRY eglSaveConfig(EGLDisplay display, EGLConfig config, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglSaveContext(EGLDisplay display, EGLContext context, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglSaveAllImages(EGLDisplay display, EGLStreamKHR stream, const void* textureSaver);
+EGLAPI EGLBoolean EGLAPIENTRY eglPreSaveContext(EGLDisplay display, EGLContext contex, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglPostLoadAllImages(EGLDisplay display, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglPostSaveContext(EGLDisplay display, EGLConfig config, EGLStreamKHR stream);
+EGLAPI void EGLAPIENTRY eglUseOsEglApi(EGLBoolean enable, EGLBoolean nullEgl);
+EGLAPI void EGLAPIENTRY eglSetMaxGLESVersion(EGLint glesVersion);
+EGLAPI void EGLAPIENTRY eglFillUsages(void* usages);
+
+#endif // RENDER_EGL_SNAPSHOT_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/RenderEGL_snapshot_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_snapshot_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..2ac4ba1ae2e
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_snapshot_static_translator_namespaced_header.h
@@ -0,0 +1,21 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/render_egl_snapshot.entries --output=include/OpenGLESDispatch/RenderEGL_snapshot_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+namespace translator {
+namespace egl {
+EGLAPI EGLConfig EGLAPIENTRY eglLoadConfig(EGLDisplay display, EGLStreamKHR stream);
+EGLAPI EGLContext EGLAPIENTRY eglLoadContext(EGLDisplay display, const EGLint * attrib_list, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglLoadAllImages(EGLDisplay display, EGLStreamKHR stream, const void* textureLoader);
+EGLAPI EGLBoolean EGLAPIENTRY eglSaveConfig(EGLDisplay display, EGLConfig config, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglSaveContext(EGLDisplay display, EGLContext context, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglSaveAllImages(EGLDisplay display, EGLStreamKHR stream, const void* textureSaver);
+EGLAPI EGLBoolean EGLAPIENTRY eglPreSaveContext(EGLDisplay display, EGLContext contex, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglPostLoadAllImages(EGLDisplay display, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglPostSaveContext(EGLDisplay display, EGLConfig config, EGLStreamKHR stream);
+EGLAPI void EGLAPIENTRY eglUseOsEglApi(EGLBoolean enable, EGLBoolean nullEgl);
+EGLAPI void EGLAPIENTRY eglSetMaxGLESVersion(EGLint glesVersion);
+EGLAPI void EGLAPIENTRY eglFillUsages(void* usages);
+} // namespace translator
+} // namespace egl
diff --git a/src/gfxstream/include/OpenGLESDispatch/RenderEGL_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..a3db6aeb467
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/RenderEGL_static_translator_namespaced_header.h
@@ -0,0 +1,34 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/render_egl.entries --output=include/OpenGLESDispatch/RenderEGL_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+#include <EGL/egl.h>
+#define translator_egl_const_char const char
+namespace translator {
+namespace egl {
+EGLAPI EGLint EGLAPIENTRY eglGetError();
+EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType dpy);
+EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
+EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor);
+EGLAPI translator_egl_const_char* EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint id);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay display, EGLConfig* configs, EGLint config_size, EGLint* num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay display, const EGLint* attribs, EGLConfig* configs, EGLint config_size, EGLint* num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay display, EGLConfig config, EGLint attribute, EGLint* value);
+EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay display, EGLConfig config, EGLNativeWindowType native_window, const EGLint* attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay display, EGLConfig config, const EGLint* attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay display, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
+EGLAPI EGLenum EGLAPIENTRY eglQueryAPI();
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread();
+EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay display, EGLConfig config, EGLContext share_context, const EGLint* attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay display, EGLContext context);
+EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay display, EGLSurface draw, EGLSurface read, EGLContext context);
+EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext();
+EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay();
+EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
+EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay display, EGLSurface surface, EGLint attribute, EGLint * value);
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay display, EGLSurface surface);
+EGLAPI void* EGLAPIENTRY eglGetProcAddress(const char* function_name);
+} // namespace translator
+} // namespace egl
diff --git a/src/gfxstream/include/OpenGLESDispatch/StaticDispatch.h b/src/gfxstream/include/OpenGLESDispatch/StaticDispatch.h
new file mode 100644
index 00000000000..db81b99b6c6
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/StaticDispatch.h
@@ -0,0 +1,27 @@
+/*
+* 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.
+*/
+#pragma once
+
+// Returns functions from s_gles2/s_gles1, for use with static Translator.
+
+namespace gfxstream {
+namespace gl {
+
+void* gles2_dispatch_get_proc_func_static(const char* name);
+void* gles1_dispatch_get_proc_func_static(const char* name);
+
+} // namespace gl
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/include/OpenGLESDispatch/gldefs.h b/src/gfxstream/include/OpenGLESDispatch/gldefs.h
new file mode 100644
index 00000000000..77df1173521
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gldefs.h
@@ -0,0 +1,45 @@
+/*
+* 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.
+*/
+
+#pragma once
+
+typedef double GLclampd; /* double precision float in [0,1] */
+typedef double GLdouble; /* double precision float */
+typedef void* GLeglImageOES;
+
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#define GL_Q 0x2003
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_INT 0x1404
+#define GL_HALF_FLOAT_NV 0x140B
+#define GL_HALF_FLOAT 0x140B
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#define GL_POINT_SPRITE 0x8861
+#define GL_FRAMEBUFFER_EXT 0x8D40
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#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_INTERNAL_FORMAT 0x1003
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles12tr.h b/src/gfxstream/include/OpenGLESDispatch/gles12tr.h
new file mode 100644
index 00000000000..8aa839e1fc7
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles12tr.h
@@ -0,0 +1,17 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs android/android-emugl/host/libs/libOpenGLESDispatch/gles12tr.entries --output=android/android-emugl/host/include/OpenGLESDispatch/gles12tr.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES12_TR_FUNCTIONS_H
+#define GLES12_TR_FUNCTIONS_H
+
+typedef void* voidptr;
+#define LIST_GLES12_TR_FUNCTIONS(X) \
+ X(voidptr, create_gles1_context, (void* share, const void* underlying_apis), (share, underlying_apis)) \
+ X(voidptr, get_current_gles_context, (), ()) \
+ X(void, set_current_gles_context, (void* ctx), (ctx)) \
+ X(voidptr, create_underlying_api, (), ()) \
+ X(void, make_current_setup, (uint32_t surf_width, uint32_t surf_height), (surf_width, surf_height)) \
+ X(void, destroy_gles1_context, (void* ctx), (ctx)) \
+
+
+#endif // GLES12_TR_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles12tr_internal.h b/src/gfxstream/include/OpenGLESDispatch/gles12tr_internal.h
new file mode 100644
index 00000000000..657ba401f0e
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles12tr_internal.h
@@ -0,0 +1,331 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs android/android-emugl/host/libs/libOpenGLESDispatch/gles12tr_internal.entries --output=android/android-emugl/host/include/OpenGLESDispatch/gles12tr_internal.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES12TR_INTERNAL_FUNCTIONS_H
+#define GLES12TR_INTERNAL_FUNCTIONS_H
+
+typedef GLvoid* GLvoidptr;
+typedef const GLubyte* constGLubyte;
+#define LIST_GLES12TR_INTERNAL_FUNCTIONS(X) \
+ X(void, glActiveTexture, (GLenum texture), (texture)) \
+ X(void, glAlphaFunc, (GLenum func, GLclampf ref), (func, ref)) \
+ X(void, glAlphaFuncx, (GLenum func, GLclampx ref), (func, ref)) \
+ X(void, glAlphaFuncxOES, (GLenum func, GLclampx ref), (func, ref)) \
+ X(void, glAttachShader, (GLuint program, GLuint shader), (program, shader)) \
+ X(void, glBindAttribLocation, (GLuint program, GLuint index, const GLchar* name), (program, index, name)) \
+ X(void, glBindBuffer, (GLenum target, GLuint buffer), (target, buffer)) \
+ X(void, glBindFramebuffer, (GLenum target, GLuint framebuffer), (target, framebuffer)) \
+ X(void, glBindFramebufferOES, (GLenum target, GLuint framebuffer), (target, framebuffer)) \
+ X(void, glBindRenderbuffer, (GLenum target, GLuint renderbuffer), (target, renderbuffer)) \
+ X(void, glBindRenderbufferOES, (GLenum target, GLuint renderbuffer), (target, renderbuffer)) \
+ X(void, glBindTexture, (GLenum target, GLuint texture), (target, texture)) \
+ X(void, glBlendColor, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red, green, blue, alpha)) \
+ X(void, glBlendEquation, (GLenum mode), (mode)) \
+ X(void, glBlendEquationOES, (GLenum mode), (mode)) \
+ X(void, glBlendEquationSeparate, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha)) \
+ X(void, glBlendEquationSeparateOES, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha)) \
+ X(void, glBlendFunc, (GLenum sfactor, GLenum dfactor), (sfactor, dfactor)) \
+ X(void, glBlendFuncSeparate, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha)) \
+ X(void, glBlendFuncSeparateOES, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha)) \
+ X(void, glBufferData, (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage), (target, size, data, usage)) \
+ X(void, glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data), (target, offset, size, data)) \
+ X(GLenum, glCheckFramebufferStatus, (GLenum target), (target)) \
+ X(GLenum, glCheckFramebufferStatusOES, (GLenum target), (target)) \
+ X(void, glClear, (GLbitfield mask), (mask)) \
+ X(void, glClearColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), (red, green, blue, alpha)) \
+ X(void, glClearColorx, (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha), (red, green, blue, alpha)) \
+ X(void, glClearColorxOES, (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha), (red, green, blue, alpha)) \
+ X(void, glClearDepthf, (GLfloat depth), (depth)) \
+ X(void, glClearDepthfOES, (GLclampf depth), (depth)) \
+ X(void, glClearDepthx, (GLclampx depth), (depth)) \
+ X(void, glClearDepthxOES, (GLclampx depth), (depth)) \
+ X(void, glClearStencil, (GLint s), (s)) \
+ X(void, glClientActiveTexture, (GLenum texture), (texture)) \
+ X(void, glClipPlanef, (GLenum pname, const GLfloat* equation), (pname, equation)) \
+ X(void, glClipPlanefOES, (GLenum pname, const GLfloat* equation), (pname, equation)) \
+ X(void, glClipPlanex, (GLenum pname, const GLfixed* equation), (pname, equation)) \
+ X(void, glClipPlanexOES, (GLenum pname, const GLfixed* equation), (pname, equation)) \
+ X(void, glColor4f, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red, green, blue, alpha)) \
+ X(void, glColor4fv, (const GLfloat* components), (components)) \
+ X(void, glColor4ub, (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha), (red, green, blue, alpha)) \
+ X(void, glColor4ubv, (const GLubyte* components), (components)) \
+ X(void, glColor4x, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha)) \
+ X(void, glColor4xOES, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha)) \
+ X(void, glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha), (red, green, blue, alpha)) \
+ X(void, glColorPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer), (size, type, stride, pointer)) \
+ X(void, glColorPointerBounds, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer, GLsizei count), (size, type, stride, pointer, count)) \
+ X(void, glCompileShader, (GLuint shader), (shader)) \
+ X(void, glCompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei image_size, const GLvoid* data), (target, level, internalformat, width, height, border, image_size, data)) \
+ X(void, glCompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei image_size, const GLvoid* data), (target, level, xoffset, yoffset, width, height, format, image_size, data)) \
+ X(void, glCopyTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border), (target, level, internalformat, x, y, width, height, border)) \
+ X(void, glCopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, x, y, width, height)) \
+ X(GLuint, glCreateProgram, (), ()) \
+ X(GLuint, glCreateShader, (GLenum type), (type)) \
+ X(void, glCullFace, (GLenum mode), (mode)) \
+ X(void, glCurrentPaletteMatrixOES, (GLuint index), (index)) \
+ X(void, glDeleteBuffers, (GLsizei n, const GLuint* buffers), (n, buffers)) \
+ X(void, glDeleteFramebuffers, (GLsizei n, const GLuint* framebuffers), (n, framebuffers)) \
+ X(void, glDeleteFramebuffersOES, (GLsizei n, const GLuint* framebuffers), (n, framebuffers)) \
+ X(void, glDeleteProgram, (GLuint program), (program)) \
+ X(void, glDeleteRenderbuffers, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers)) \
+ X(void, glDeleteRenderbuffersOES, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers)) \
+ X(void, glDeleteShader, (GLuint shader), (shader)) \
+ X(void, glDeleteTextures, (GLsizei n, const GLuint* textures), (n, textures)) \
+ X(void, glDepthFunc, (GLenum func), (func)) \
+ X(void, glDepthMask, (GLboolean flag), (flag)) \
+ X(void, glDepthRangef, (GLclampf zNear, GLclampf zFar), (zNear, zFar)) \
+ X(void, glDepthRangefOES, (GLclampf zNear, GLclampf zFar), (zNear, zFar)) \
+ X(void, glDepthRangex, (GLclampx zNear, GLclampx zFar), (zNear, zFar)) \
+ X(void, glDepthRangexOES, (GLclampx zNear, GLclampx zFar), (zNear, zFar)) \
+ X(void, glDetachShader, (GLuint program, GLuint shader), (program, shader)) \
+ X(void, glDisable, (GLenum cap), (cap)) \
+ X(void, glDisableClientState, (GLenum cap), (cap)) \
+ X(void, glDisableVertexAttribArray, (GLuint index), (index)) \
+ X(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count), (mode, first, count)) \
+ X(void, glDrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices), (mode, count, type, indices)) \
+ X(void, glDrawTexfOES, (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height), (x, y, z, width, height)) \
+ X(void, glDrawTexfvOES, (const GLfloat* coords), (coords)) \
+ X(void, glDrawTexiOES, (GLint x, GLint y, GLint z, GLint width, GLint height), (x, y, z, width, height)) \
+ X(void, glDrawTexivOES, (const GLint* coords), (coords)) \
+ X(void, glDrawTexsOES, (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height), (x, y, z, width, height)) \
+ X(void, glDrawTexsvOES, (const GLshort* coords), (coords)) \
+ X(void, glDrawTexxOES, (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height), (x, y, z, width, height)) \
+ X(void, glDrawTexxvOES, (const GLfixed* coords), (coords)) \
+ X(void, glEGLImageTargetRenderbufferStorageOES, (GLenum target, GLeglImageOES buffer), (target, buffer)) \
+ X(void, glEGLImageTargetTexture2DOES, (GLenum target, GLeglImageOES buffer), (target, buffer)) \
+ X(void, glEnable, (GLenum cap), (cap)) \
+ X(void, glEnableClientState, (GLenum cap), (cap)) \
+ X(void, glEnableVertexAttribArray, (GLuint index), (index)) \
+ X(void, glFinish, (), ()) \
+ X(void, glFlush, (), ()) \
+ X(void, glFogf, (GLenum name, GLfloat param), (name, param)) \
+ X(void, glFogfv, (GLenum name, const GLfloat* params), (name, params)) \
+ X(void, glFogx, (GLenum pname, GLfixed param), (pname, param)) \
+ X(void, glFogxOES, (GLenum pname, GLfixed param), (pname, param)) \
+ X(void, glFogxv, (GLenum pname, const GLfixed* params), (pname, params)) \
+ X(void, glFogxvOES, (GLenum pname, const GLfixed* params), (pname, params)) \
+ X(void, glFramebufferRenderbuffer, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer)) \
+ X(void, glFramebufferRenderbufferOES, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer)) \
+ X(void, glFramebufferTexture2D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level)) \
+ X(void, glFramebufferTexture2DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level)) \
+ X(void, glFrontFace, (GLenum mode), (mode)) \
+ X(void, glFrustumf, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glFrustumfOES, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glFrustumx, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glFrustumxOES, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glGenBuffers, (GLsizei n, GLuint* buffers), (n, buffers)) \
+ X(void, glGenFramebuffers, (GLsizei n, GLuint* framebuffers), (n, framebuffers)) \
+ X(void, glGenFramebuffersOES, (GLsizei n, GLuint* framebuffers), (n, framebuffers)) \
+ X(void, glGenRenderbuffers, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers)) \
+ X(void, glGenRenderbuffersOES, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers)) \
+ X(void, glGenTextures, (GLsizei n, GLuint* textures), (n, textures)) \
+ X(void, glGenerateMipmap, (GLenum target), (target)) \
+ X(void, glGenerateMipmapOES, (GLenum target), (target)) \
+ X(void, glGetActiveAttrib, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name), (program, index, bufsize, length, size, type, name)) \
+ X(void, glGetActiveUniform, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name), (program, index, bufsize, length, size, type, name)) \
+ X(void, glGetAttachedShaders, (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders), (program, maxcount, count, shaders)) \
+ X(GLint, glGetAttribLocation, (GLuint program, const GLchar* name), (program, name)) \
+ X(void, glGetBooleanv, (GLenum pname, GLboolean* params), (pname, params)) \
+ X(void, glGetBufferParameteriv, (GLenum target, GLenum pname, GLint* params), (target, pname, params)) \
+ X(void, glGetClipPlanef, (GLenum pname, GLfloat* eqn), (pname, eqn)) \
+ X(void, glGetClipPlanefOES, (GLenum pname, GLfloat* eqn), (pname, eqn)) \
+ X(void, glGetClipPlanex, (GLenum pname, GLfixed* eqn), (pname, eqn)) \
+ X(void, glGetClipPlanexOES, (GLenum pname, GLfixed* eqn), (pname, eqn)) \
+ X(GLenum, glGetError, (), ()) \
+ X(void, glGetFixedv, (GLenum pname, GLfixed* params), (pname, params)) \
+ X(void, glGetFixedvOES, (GLenum pname, GLfixed* params), (pname, params)) \
+ X(void, glGetFloatv, (GLenum pname, GLfloat* params), (pname, params)) \
+ X(void, glGetFramebufferAttachmentParameteriv, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params)) \
+ X(void, glGetFramebufferAttachmentParameterivOES, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params)) \
+ X(void, glGetIntegerv, (GLenum pname, GLint* params), (pname, params)) \
+ X(void, glGetLightfv, (GLenum lightid, GLenum name, GLfloat* params), (lightid, name, params)) \
+ X(void, glGetLightxv, (GLenum light, GLenum pname, GLfixed* params), (light, pname, params)) \
+ X(void, glGetLightxvOES, (GLenum light, GLenum pname, GLfixed* params), (light, pname, params)) \
+ X(void, glGetMaterialfv, (GLenum face, GLenum name, GLfloat* params), (face, name, params)) \
+ X(void, glGetMaterialxv, (GLenum face, GLenum pname, GLfixed* params), (face, pname, params)) \
+ X(void, glGetMaterialxvOES, (GLenum face, GLenum pname, GLfixed* params), (face, pname, params)) \
+ X(void, glGetPointerv, (GLenum pname, void** params), (pname, params)) \
+ X(void, glGetProgramInfoLog, (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog), (program, bufsize, length, infolog)) \
+ X(void, glGetProgramiv, (GLuint program, GLenum pname, GLint* params), (program, pname, params)) \
+ X(void, glGetRenderbufferParameteriv, (GLenum target, GLenum pname, GLint* params), (target, pname, params)) \
+ X(void, glGetRenderbufferParameterivOES, (GLenum target, GLenum pname, GLint* params), (target, pname, params)) \
+ X(void, glGetShaderInfoLog, (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog), (shader, bufsize, length, infolog)) \
+ X(void, glGetShaderPrecisionFormat, (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision), (shadertype, precisiontype, range, precision)) \
+ X(void, glGetShaderSource, (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source), (shader, bufsize, length, source)) \
+ X(void, glGetShaderiv, (GLuint shader, GLenum pname, GLint* params), (shader, pname, params)) \
+ X(constGLubyte, glGetString, (GLenum name), (name)) \
+ X(void, glGetTexEnvfv, (GLenum env, GLenum pname, GLfloat* params), (env, pname, params)) \
+ X(void, glGetTexEnviv, (GLenum env, GLenum pname, GLint* params), (env, pname, params)) \
+ X(void, glGetTexEnvxv, (GLenum env, GLenum pname, GLfixed* params), (env, pname, params)) \
+ X(void, glGetTexEnvxvOES, (GLenum env, GLenum pname, GLfixed* params), (env, pname, params)) \
+ X(void, glGetTexParameterfv, (GLenum target, GLenum pname, GLfloat* params), (target, pname, params)) \
+ X(void, glGetTexParameteriv, (GLenum target, GLenum pname, GLint* params), (target, pname, params)) \
+ X(void, glGetTexParameterxv, (GLenum target, GLenum pname, GLfixed* params), (target, pname, params)) \
+ X(void, glGetTexParameterxvOES, (GLenum target, GLenum pname, GLfixed* params), (target, pname, params)) \
+ X(void, glGetUniformfv, (GLuint program, GLint location, GLfloat* params), (program, location, params)) \
+ X(void, glGetUniformiv, (GLuint program, GLint location, GLint* params), (program, location, params)) \
+ X(GLint, glGetUniformLocation, (GLuint program, const GLchar* name), (program, name)) \
+ X(void, glGetVertexAttribPointerv, (GLuint index, GLenum pname, GLvoid** pointer), (index, pname, pointer)) \
+ X(void, glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat* params), (index, pname, params)) \
+ X(void, glGetVertexAttribiv, (GLuint index, GLenum pname, GLint* params), (index, pname, params)) \
+ X(void, glHint, (GLenum target, GLenum mode), (target, mode)) \
+ X(GLboolean, glIsBuffer, (GLuint buffer), (buffer)) \
+ X(GLboolean, glIsEnabled, (GLenum cap), (cap)) \
+ X(GLboolean, glIsFramebuffer, (GLuint framebuffer), (framebuffer)) \
+ X(GLboolean, glIsFramebufferOES, (GLuint framebuffer), (framebuffer)) \
+ X(GLboolean, glIsProgram, (GLuint program), (program)) \
+ X(GLboolean, glIsRenderbuffer, (GLuint renderbuffer), (renderbuffer)) \
+ X(GLboolean, glIsRenderbufferOES, (GLuint renderbuffer), (renderbuffer)) \
+ X(GLboolean, glIsShader, (GLuint shader), (shader)) \
+ X(GLboolean, glIsTexture, (GLuint texture), (texture)) \
+ X(void, glLightModelf, (GLenum name, GLfloat param), (name, param)) \
+ X(void, glLightModelfv, (GLenum name, const GLfloat* params), (name, params)) \
+ X(void, glLightModelx, (GLenum pname, GLfixed param), (pname, param)) \
+ X(void, glLightModelxOES, (GLenum pname, GLfixed param), (pname, param)) \
+ X(void, glLightModelxv, (GLenum pname, const GLfixed* params), (pname, params)) \
+ X(void, glLightModelxvOES, (GLenum pname, const GLfixed* params), (pname, params)) \
+ X(void, glLightf, (GLenum lightid, GLenum name, GLfloat param), (lightid, name, param)) \
+ X(void, glLightfv, (GLenum lightid, GLenum name, const GLfloat* params), (lightid, name, params)) \
+ X(void, glLightx, (GLenum light, GLenum pname, GLfixed param), (light, pname, param)) \
+ X(void, glLightxOES, (GLenum light, GLenum pname, GLfixed param), (light, pname, param)) \
+ X(void, glLightxv, (GLenum light, GLenum pname, const GLfixed* params), (light, pname, params)) \
+ X(void, glLightxvOES, (GLenum light, GLenum pname, const GLfixed* params), (light, pname, params)) \
+ X(void, glLineWidth, (GLfloat width), (width)) \
+ X(void, glLineWidthx, (GLfixed width), (width)) \
+ X(void, glLineWidthxOES, (GLfixed width), (width)) \
+ X(void, glLinkProgram, (GLuint program), (program)) \
+ X(void, glLoadIdentity, (), ()) \
+ X(void, glLoadMatrixf, (const GLfloat* m), (m)) \
+ X(void, glLoadMatrixx, (const GLfixed* m), (m)) \
+ X(void, glLoadMatrixxOES, (const GLfixed* m), (m)) \
+ X(void, glLoadPaletteFromModelViewMatrixOES, (), ()) \
+ X(GLvoidptr, glMapTexSubImage2DCHROMIUM, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLenum access), (target, level, xoffset, yoffset, width, height, format, type, access)) \
+ X(void, glMaterialf, (GLenum face, GLenum name, GLfloat param), (face, name, param)) \
+ X(void, glMaterialfv, (GLenum face, GLenum name, const GLfloat* params), (face, name, params)) \
+ X(void, glMaterialx, (GLenum face, GLenum pname, GLfixed param), (face, pname, param)) \
+ X(void, glMaterialxOES, (GLenum face, GLenum pname, GLfixed param), (face, pname, param)) \
+ X(void, glMaterialxv, (GLenum face, GLenum pname, const GLfixed* params), (face, pname, params)) \
+ X(void, glMaterialxvOES, (GLenum face, GLenum pname, const GLfixed* params), (face, pname, params)) \
+ X(void, glMatrixMode, (GLenum mode), (mode)) \
+ X(void, glMatrixIndexPointerOES, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer), (size, type, stride, pointer)) \
+ X(void, glMatrixIndexPointerOESBounds, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer, GLsizei count), (size, type, stride, pointer, count)) \
+ X(void, glMultMatrixf, (const GLfloat* m), (m)) \
+ X(void, glMultMatrixx, (const GLfixed* m), (m)) \
+ X(void, glMultMatrixxOES, (const GLfixed* m), (m)) \
+ X(void, glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz), (nx, ny, nz)) \
+ X(void, glNormal3fv, (const GLfloat* coords), (coords)) \
+ X(void, glNormal3sv, (const GLshort* coords), (coords)) \
+ X(void, glNormal3x, (GLfixed nx, GLfixed ny, GLfixed nz), (nx, ny, nz)) \
+ X(void, glNormal3xOES, (GLfixed nx, GLfixed ny, GLfixed nz), (nx, ny, nz)) \
+ X(void, glNormalPointer, (GLenum type, GLsizei stride, const GLvoid* pointer), (type, stride, pointer)) \
+ X(void, glNormalPointerBounds, (GLenum type, GLsizei stride, const GLvoid* pointer, GLsizei count), (type, stride, pointer, count)) \
+ X(void, glOrthof, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat z_near, GLfloat z_far), (left, right, bottom, top, z_near, z_far)) \
+ X(void, glOrthofOES, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glOrthox, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glOrthoxOES, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glPixelStorei, (GLenum pname, GLint param), (pname, param)) \
+ X(void, glPointParameterf, (GLenum pname, GLfloat param), (pname, param)) \
+ X(void, glPointParameterfv, (GLenum pname, const GLfloat* params), (pname, params)) \
+ X(void, glPointParameterx, (GLenum pname, GLfixed param), (pname, param)) \
+ X(void, glPointParameterxOES, (GLenum pname, GLfixed param), (pname, param)) \
+ X(void, glPointParameterxv, (GLenum pname, const GLfixed* params), (pname, params)) \
+ X(void, glPointParameterxvOES, (GLenum pname, const GLfixed* params), (pname, params)) \
+ X(void, glPointSize, (GLfloat size), (size)) \
+ X(void, glPointSizex, (GLfixed size), (size)) \
+ X(void, glPointSizexOES, (GLfixed size), (size)) \
+ X(void, glPointSizePointerOES, (GLenum type, GLsizei stride, const GLvoid* pointer), (type, stride, pointer)) \
+ X(void, glPointSizePointer, (GLenum type, GLsizei stride, const GLvoid* pointer), (type, stride, pointer)) \
+ X(void, glPointSizePointerOESBounds, (GLenum type, GLsizei stride, const GLvoid* pointer, GLsizei count), (type, stride, pointer, count)) \
+ X(void, glPolygonOffset, (GLfloat factor, GLfloat units), (factor, units)) \
+ X(void, glPolygonOffsetx, (GLfixed factor, GLfixed units), (factor, units)) \
+ X(void, glPolygonOffsetxOES, (GLfixed factor, GLfixed units), (factor, units)) \
+ X(void, glPopMatrix, (), ()) \
+ X(void, glPushMatrix, (), ()) \
+ X(void, glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels), (x, y, width, height, format, type, pixels)) \
+ X(void, glReleaseShaderCompiler, (), ()) \
+ X(void, glRenderbufferStorage, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height)) \
+ X(void, glRenderbufferStorageOES, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height)) \
+ X(void, glRotatef, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z), (angle, x, y, z)) \
+ X(void, glRotatex, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z)) \
+ X(void, glRotatexOES, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z)) \
+ X(void, glSampleCoverage, (GLclampf value, GLboolean invert), (value, invert)) \
+ X(void, glSampleCoveragex, (GLclampx value, GLboolean invert), (value, invert)) \
+ X(void, glSampleCoveragexOES, (GLclampx value, GLboolean invert), (value, invert)) \
+ X(void, glScalef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z)) \
+ X(void, glScalex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z)) \
+ X(void, glScalexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z)) \
+ X(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height)) \
+ X(void, glShadeModel, (GLenum mode), (mode)) \
+ X(void, glShaderSource, (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length), (shader, count, string, length)) \
+ X(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask), (func, ref, mask)) \
+ X(void, glStencilFuncSeparate, (GLenum face, GLenum func, GLint ref, GLuint mask), (face, func, ref, mask)) \
+ X(void, glStencilMask, (GLuint mask), (mask)) \
+ X(void, glStencilMaskSeparate, (GLenum face, GLuint mask), (face, mask)) \
+ X(void, glStencilOp, (GLenum sfail, GLenum zfail, GLenum zpass), (sfail, zfail, zpass)) \
+ X(void, glStencilOpSeparate, (GLenum face, GLenum sfail, GLenum zfail, GLenum zpass), (face, sfail, zfail, zpass)) \
+ X(void, glTexCoordPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer), (size, type, stride, pointer)) \
+ X(void, glTexCoordPointerBounds, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer, GLsizei count), (size, type, stride, pointer, count)) \
+ X(void, glTexEnvf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param)) \
+ X(void, glTexEnvfv, (GLenum target, GLenum pname, const GLfloat* params), (target, pname, params)) \
+ X(void, glTexEnvi, (GLenum target, GLenum pname, GLint param), (target, pname, param)) \
+ X(void, glTexEnviv, (GLenum target, GLenum pname, const GLint* params), (target, pname, params)) \
+ X(void, glTexEnvx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param)) \
+ X(void, glTexEnvxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param)) \
+ X(void, glTexEnvxv, (GLenum target, GLenum pname, const GLfixed* params), (target, pname, params)) \
+ X(void, glTexEnvxvOES, (GLenum target, GLenum pname, const GLfixed* params), (target, pname, params)) \
+ X(void, glTexGeniOES, (GLenum coord, GLenum pname, GLint param), (coord, pname, param)) \
+ X(void, glTexGenivOES, (GLenum coord, GLenum pname, const GLint* params), (coord, pname, params)) \
+ X(void, glTexGenxOES, (GLenum coord, GLenum pname, GLfixed param), (coord, pname, param)) \
+ X(void, glTexGenxvOES, (GLenum coord, GLenum pname, const GLfixed* params), (coord, pname, params)) \
+ X(void, glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels), (target, level, internalformat, width, height, border, format, type, pixels)) \
+ X(void, glTexParameterf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param)) \
+ X(void, glTexParameterfv, (GLenum target, GLenum pname, const GLfloat* params), (target, pname, params)) \
+ X(void, glTexParameteri, (GLenum target, GLenum pname, GLint param), (target, pname, param)) \
+ X(void, glTexParameteriv, (GLenum target, GLenum pname, const GLint* params), (target, pname, params)) \
+ X(void, glTexParameterx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param)) \
+ X(void, glTexParameterxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param)) \
+ X(void, glTexParameterxv, (GLenum target, GLenum pname, const GLfixed* params), (target, pname, params)) \
+ X(void, glTexParameterxvOES, (GLenum target, GLenum pname, const GLfixed* params), (target, pname, params)) \
+ X(void, glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels), (target, level, xoffset, yoffset, width, height, format, type, pixels)) \
+ X(void, glTranslatef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z)) \
+ X(void, glTranslatex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z)) \
+ X(void, glTranslatexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z)) \
+ X(void, glUniform1f, (GLint location, GLfloat x), (location, x)) \
+ X(void, glUniform1fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v)) \
+ X(void, glUniform1i, (GLint location, GLint x), (location, x)) \
+ X(void, glUniform1iv, (GLint location, GLsizei count, const GLint* v), (location, count, v)) \
+ X(void, glUniform2f, (GLint location, GLfloat x, GLfloat y), (location, x, y)) \
+ X(void, glUniform2fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v)) \
+ X(void, glUniform2i, (GLint location, GLint x, GLint y), (location, x, y)) \
+ X(void, glUniform2iv, (GLint location, GLsizei count, const GLint* v), (location, count, v)) \
+ X(void, glUniform3f, (GLint location, GLfloat x, GLfloat y, GLfloat z), (location, x, y, z)) \
+ X(void, glUniform3fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v)) \
+ X(void, glUniform3i, (GLint location, GLint x, GLint y, GLint z), (location, x, y, z)) \
+ X(void, glUniform3iv, (GLint location, GLsizei count, const GLint* v), (location, count, v)) \
+ X(void, glUniform4f, (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (location, x, y, z, w)) \
+ X(void, glUniform4fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v)) \
+ X(void, glUniform4i, (GLint location, GLint x, GLint y, GLint z, GLint w), (location, x, y, z, w)) \
+ X(void, glUniform4iv, (GLint location, GLsizei count, const GLint* v), (location, count, v)) \
+ X(void, glUniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value)) \
+ X(void, glUniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value)) \
+ X(void, glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value)) \
+ X(void, glUnmapTexSubImage2DCHROMIUM, (const GLvoid* mem), (mem)) \
+ X(void, glUseProgram, (GLuint program), (program)) \
+ X(void, glValidateProgram, (GLuint program), (program)) \
+ X(void, glVertexAttrib1f, (GLuint indx, GLfloat x), (indx, x)) \
+ X(void, glVertexAttrib1fv, (GLuint indx, const GLfloat* values), (indx, values)) \
+ X(void, glVertexAttrib2f, (GLuint indx, GLfloat x, GLfloat y), (indx, x, y)) \
+ X(void, glVertexAttrib2fv, (GLuint indx, const GLfloat* values), (indx, values)) \
+ X(void, glVertexAttrib3f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z), (indx, x, y, z)) \
+ X(void, glVertexAttrib3fv, (GLuint indx, const GLfloat* values), (indx, values)) \
+ X(void, glVertexAttrib4f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (indx, x, y, z, w)) \
+ X(void, glVertexAttrib4fv, (GLuint indx, const GLfloat* values), (indx, values)) \
+ X(void, glVertexAttribPointer, (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer), (indx, size, type, normalized, stride, pointer)) \
+ X(void, glVertexPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer), (size, type, stride, pointer)) \
+ X(void, glVertexPointerBounds, (GLint size, GLenum type, GLsizei stride, GLvoid* pointer, GLsizei count), (size, type, stride, pointer, count)) \
+ X(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height)) \
+ X(void, glWeightPointerOES, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer), (size, type, stride, pointer)) \
+ X(void, glWeightPointerOESBounds, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer, GLsizei count), (size, type, stride, pointer, count)) \
+
+
+#endif // GLES12TR_INTERNAL_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles1_extensions_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles1_extensions_functions.h
new file mode 100644
index 00000000000..abc5b300e06
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles1_extensions_functions.h
@@ -0,0 +1,64 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/gl/OpenGLESDispatch/gles1_extensions.entries --output=include/OpenGLESDispatch/gles1_extensions_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES1_EXTENSIONS_FUNCTIONS_H
+#define GLES1_EXTENSIONS_FUNCTIONS_H
+
+#define LIST_GLES1_EXTENSIONS_FUNCTIONS(X) \
+ X(void, glCurrentPaletteMatrixARB, (GLint index), (index)) \
+ X(void, glMatrixIndexuivARB, (GLint size, GLuint * indices), (size, indices)) \
+ X(void, glMatrixIndexPointerARB, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer), (size, type, stride, pointer)) \
+ X(void, glWeightPointerARB, (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer), (size, type, stride, pointer)) \
+ X(void, glTexGenf, (GLenum coord, GLenum pname, GLfloat param), (coord, pname, param)) \
+ X(void, glTexGeni, (GLenum coord, GLenum pname, GLint param), (coord, pname, param)) \
+ X(void, glTexGenfv, (GLenum coord, GLenum pname, const GLfloat * params), (coord, pname, params)) \
+ X(void, glTexGeniv, (GLenum coord, GLenum pname, const GLint * params), (coord, pname, params)) \
+ X(void, glGetTexGenfv, (GLenum coord, GLenum pname, GLfloat * params), (coord, pname, params)) \
+ X(void, glGetTexGeniv, (GLenum coord, GLenum pname, GLint * params), (coord, pname, params)) \
+ X(void, glColorPointerWithDataSize, (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer, GLsizei dataSize), (size, type, stride, pointer, dataSize)) \
+ X(void, glNormalPointerWithDataSize, (GLenum type, GLsizei stride, const GLvoid * pointer, GLsizei dataSize), (type, stride, pointer, dataSize)) \
+ X(void, glTexCoordPointerWithDataSize, (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer, GLsizei dataSize), (size, type, stride, pointer, dataSize)) \
+ X(void, glVertexPointerWithDataSize, (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer, GLsizei dataSize), (size, type, stride, pointer, dataSize)) \
+ X(void, glPointSizePointerOES, (GLenum type, GLsizei stride, const GLvoid * pointer), (type, stride, pointer)) \
+ X(void, glBlendEquationSeparateOES, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha)) \
+ X(void, glBlendFuncSeparateOES, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha)) \
+ X(void, glBlendEquationOES, (GLenum mode), (mode)) \
+ X(void, glDrawTexsOES, (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height), (x, y, z, width, height)) \
+ X(void, glDrawTexiOES, (GLint x, GLint y, GLint z, GLint width, GLint height), (x, y, z, width, height)) \
+ X(void, glDrawTexxOES, (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height), (x, y, z, width, height)) \
+ X(void, glDrawTexsvOES, (const GLshort * coords), (coords)) \
+ X(void, glDrawTexivOES, (const GLint * coords), (coords)) \
+ X(void, glDrawTexxvOES, (const GLfixed * coords), (coords)) \
+ X(void, glDrawTexfOES, (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height), (x, y, z, width, height)) \
+ X(void, glDrawTexfvOES, (const GLfloat * coords), (coords)) \
+ X(GLboolean, glIsRenderbufferOES, (GLuint renderbuffer), (renderbuffer)) \
+ X(void, glBindRenderbufferOES, (GLenum target, GLuint renderbuffer), (target, renderbuffer)) \
+ X(void, glDeleteRenderbuffersOES, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers)) \
+ X(void, glGenRenderbuffersOES, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers)) \
+ X(void, glRenderbufferStorageOES, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height)) \
+ X(void, glGetRenderbufferParameterivOES, (GLenum target, GLenum pname, GLint* params), (target, pname, params)) \
+ X(GLboolean, glIsFramebufferOES, (GLuint framebuffer), (framebuffer)) \
+ X(void, glBindFramebufferOES, (GLenum target, GLuint framebuffer), (target, framebuffer)) \
+ X(void, glDeleteFramebuffersOES, (GLsizei n, const GLuint* framebuffers), (n, framebuffers)) \
+ X(void, glGenFramebuffersOES, (GLsizei n, GLuint* framebuffers), (n, framebuffers)) \
+ X(GLenum, glCheckFramebufferStatusOES, (GLenum target), (target)) \
+ X(void, glFramebufferRenderbufferOES, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer)) \
+ X(void, glFramebufferTexture2DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level)) \
+ X(void, glGetFramebufferAttachmentParameterivOES, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params)) \
+ X(void, glGenerateMipmapOES, (GLenum target), (target)) \
+ X(void, glCurrentPaletteMatrixOES, (GLuint matrixpaletteindex), (matrixpaletteindex)) \
+ X(void, glLoadPaletteFromModelViewMatrixOES, (), ()) \
+ X(void, glMatrixIndexPointerOES, (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), (size, type, stride, pointer)) \
+ X(void, glWeightPointerOES, (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), (size, type, stride, pointer)) \
+ X(void, glTexGenfOES, (GLenum coord, GLenum pname, GLfloat param), (coord, pname, param)) \
+ X(void, glTexGenfvOES, (GLenum coord, GLenum pname, const GLfloat * params), (coord, pname, params)) \
+ X(void, glTexGeniOES, (GLenum coord, GLenum pname, GLint param), (coord, pname, param)) \
+ X(void, glTexGenivOES, (GLenum coord, GLenum pname, const GLint * params), (coord, pname, params)) \
+ X(void, glTexGenxOES, (GLenum coord, GLenum pname, GLfixed param), (coord, pname, param)) \
+ X(void, glTexGenxvOES, (GLenum coord, GLenum pname, const GLfixed * params), (coord, pname, params)) \
+ X(void, glGetTexGenfvOES, (GLenum coord, GLenum pname, GLfloat * params), (coord, pname, params)) \
+ X(void, glGetTexGenivOES, (GLenum coord, GLenum pname, GLint * params), (coord, pname, params)) \
+ X(void, glGetTexGenxvOES, (GLenum coord, GLenum pname, GLfixed * params), (coord, pname, params)) \
+
+
+#endif // GLES1_EXTENSIONS_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles1_extensions_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles1_extensions_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..592886e0ec5
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles1_extensions_static_translator_namespaced_header.h
@@ -0,0 +1,63 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles1_extensions.entries --output=include/OpenGLESDispatch/gles1_extensions_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+namespace translator {
+namespace gles1 {
+GL_APICALL void GL_APIENTRY glCurrentPaletteMatrixARB(GLint index);
+GL_APICALL void GL_APIENTRY glMatrixIndexuivARB(GLint size, GLuint * indices);
+GL_APICALL void GL_APIENTRY glMatrixIndexPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+GL_APICALL void GL_APIENTRY glWeightPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+GL_APICALL void GL_APIENTRY glTexGenf(GLenum coord, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexGeni(GLenum coord, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params);
+GL_APICALL void GL_APIENTRY glTexGeniv(GLenum coord, GLenum pname, const GLint * params);
+GL_APICALL void GL_APIENTRY glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params);
+GL_APICALL void GL_APIENTRY glGetTexGeniv(GLenum coord, GLenum pname, GLint * params);
+GL_APICALL void GL_APIENTRY glColorPointerWithDataSize(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer, GLsizei dataSize);
+GL_APICALL void GL_APIENTRY glNormalPointerWithDataSize(GLenum type, GLsizei stride, const GLvoid * pointer, GLsizei dataSize);
+GL_APICALL void GL_APIENTRY glTexCoordPointerWithDataSize(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer, GLsizei dataSize);
+GL_APICALL void GL_APIENTRY glVertexPointerWithDataSize(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer, GLsizei dataSize);
+GL_APICALL void GL_APIENTRY glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid * pointer);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void GL_APIENTRY glBlendEquationOES(GLenum mode);
+GL_APICALL void GL_APIENTRY glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+GL_APICALL void GL_APIENTRY glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height);
+GL_APICALL void GL_APIENTRY glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+GL_APICALL void GL_APIENTRY glDrawTexsvOES(const GLshort * coords);
+GL_APICALL void GL_APIENTRY glDrawTexivOES(const GLint * coords);
+GL_APICALL void GL_APIENTRY glDrawTexxvOES(const GLfixed * coords);
+GL_APICALL void GL_APIENTRY glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+GL_APICALL void GL_APIENTRY glDrawTexfvOES(const GLfloat * coords);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbufferOES(GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbufferOES(GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebufferOES(GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindFramebufferOES(GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers);
+GL_APICALL void GL_APIENTRY glGenFramebuffersOES(GLsizei n, GLuint* framebuffers);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatusOES(GLenum target);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGenerateMipmapOES(GLenum target);
+GL_APICALL void GL_APIENTRY glCurrentPaletteMatrixOES(GLuint matrixpaletteindex);
+GL_APICALL void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES();
+GL_APICALL void GL_APIENTRY glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
+GL_APICALL void GL_APIENTRY glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
+GL_APICALL void GL_APIENTRY glTexGenfOES(GLenum coord, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat * params);
+GL_APICALL void GL_APIENTRY glTexGeniOES(GLenum coord, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexGenivOES(GLenum coord, GLenum pname, const GLint * params);
+GL_APICALL void GL_APIENTRY glTexGenxOES(GLenum coord, GLenum pname, GLfixed param);
+GL_APICALL void GL_APIENTRY glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed * params);
+GL_APICALL void GL_APIENTRY glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat * params);
+GL_APICALL void GL_APIENTRY glGetTexGenivOES(GLenum coord, GLenum pname, GLint * params);
+GL_APICALL void GL_APIENTRY glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed * params);
+} // namespace translator
+} // namespace gles1
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles1_only_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles1_only_functions.h
new file mode 100644
index 00000000000..26d1be1d860
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles1_only_functions.h
@@ -0,0 +1,113 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/gl/OpenGLESDispatch/gles1_only.entries --output=include/OpenGLESDispatch/gles1_only_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES1_ONLY_FUNCTIONS_H
+#define GLES1_ONLY_FUNCTIONS_H
+
+#define LIST_GLES1_ONLY_FUNCTIONS(X) \
+ X(void, glAlphaFunc, (GLenum func, GLclampf ref), (func, ref)) \
+ X(void, glBegin, (GLenum mode), (mode)) \
+ X(void, glClientActiveTexture, (GLenum texture), (texture)) \
+ X(void, glClipPlane, (GLenum plane, const GLdouble * equation), (plane, equation)) \
+ X(void, glColor4d, (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha), (red, green, blue, alpha)) \
+ X(void, glColor4f, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha), (red, green, blue, alpha)) \
+ X(void, glColor4fv, (const GLfloat * v), (v)) \
+ X(void, glColor4ub, (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha), (red, green, blue, alpha)) \
+ X(void, glColor4ubv, (const GLubyte * v), (v)) \
+ X(void, glColorPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), (size, type, stride, pointer)) \
+ X(void, glDisableClientState, (GLenum array), (array)) \
+ X(void, glEnableClientState, (GLenum array), (array)) \
+ X(void, glEnd, (), ()) \
+ X(void, glFogf, (GLenum pname, GLfloat param), (pname, param)) \
+ X(void, glFogfv, (GLenum pname, const GLfloat * params), (pname, params)) \
+ X(void, glGetClipPlane, (GLenum plane, GLdouble * equation), (plane, equation)) \
+ X(void, glGetDoublev, (GLenum pname, GLdouble * params), (pname, params)) \
+ X(void, glGetLightfv, (GLenum light, GLenum pname, GLfloat * params), (light, pname, params)) \
+ X(void, glGetMaterialfv, (GLenum face, GLenum pname, GLfloat * params), (face, pname, params)) \
+ X(void, glGetPointerv, (GLenum pname, GLvoid* * params), (pname, params)) \
+ X(void, glGetTexEnvfv, (GLenum target, GLenum pname, GLfloat * params), (target, pname, params)) \
+ X(void, glGetTexEnviv, (GLenum target, GLenum pname, GLint * params), (target, pname, params)) \
+ X(void, glLightf, (GLenum light, GLenum pname, GLfloat param), (light, pname, param)) \
+ X(void, glLightfv, (GLenum light, GLenum pname, const GLfloat * params), (light, pname, params)) \
+ X(void, glLightModelf, (GLenum pname, GLfloat param), (pname, param)) \
+ X(void, glLightModelfv, (GLenum pname, const GLfloat * params), (pname, params)) \
+ X(void, glLoadIdentity, (), ()) \
+ X(void, glLoadMatrixf, (const GLfloat * m), (m)) \
+ X(void, glLogicOp, (GLenum opcode), (opcode)) \
+ X(void, glMaterialf, (GLenum face, GLenum pname, GLfloat param), (face, pname, param)) \
+ X(void, glMaterialfv, (GLenum face, GLenum pname, const GLfloat * params), (face, pname, params)) \
+ X(void, glMultiTexCoord2fv, (GLenum target, const GLfloat * v), (target, v)) \
+ X(void, glMultiTexCoord2sv, (GLenum target, const GLshort * v), (target, v)) \
+ X(void, glMultiTexCoord3fv, (GLenum target, const GLfloat * v), (target, v)) \
+ X(void, glMultiTexCoord3sv, (GLenum target, const GLshort * v), (target, v)) \
+ X(void, glMultiTexCoord4f, (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q), (target, s, t, r, q)) \
+ X(void, glMultiTexCoord4fv, (GLenum target, const GLfloat * v), (target, v)) \
+ X(void, glMultiTexCoord4sv, (GLenum target, const GLshort * v), (target, v)) \
+ X(void, glMultMatrixf, (const GLfloat * m), (m)) \
+ X(void, glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz), (nx, ny, nz)) \
+ X(void, glNormal3fv, (const GLfloat * v), (v)) \
+ X(void, glNormal3sv, (const GLshort * v), (v)) \
+ X(void, glOrtho, (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glPointParameterf, (GLenum param, GLfloat value), (param, value)) \
+ X(void, glPointParameterfv, (GLenum param, const GLfloat * values), (param, values)) \
+ X(void, glPointSize, (GLfloat size), (size)) \
+ X(void, glRotatef, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z), (angle, x, y, z)) \
+ X(void, glScalef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z)) \
+ X(void, glTexEnvf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param)) \
+ X(void, glTexEnvfv, (GLenum target, GLenum pname, const GLfloat * params), (target, pname, params)) \
+ X(void, glMatrixMode, (GLenum mode), (mode)) \
+ X(void, glNormalPointer, (GLenum type, GLsizei stride, const GLvoid * pointer), (type, stride, pointer)) \
+ X(void, glPopMatrix, (), ()) \
+ X(void, glPushMatrix, (), ()) \
+ X(void, glShadeModel, (GLenum mode), (mode)) \
+ X(void, glTexCoordPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), (size, type, stride, pointer)) \
+ X(void, glTexEnvi, (GLenum target, GLenum pname, GLint param), (target, pname, param)) \
+ X(void, glTexEnviv, (GLenum target, GLenum pname, const GLint * params), (target, pname, params)) \
+ X(void, glTranslatef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z)) \
+ X(void, glVertexPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), (size, type, stride, pointer)) \
+ X(void, glClipPlanef, (GLenum plane, const GLfloat * equation), (plane, equation)) \
+ X(void, glFrustumf, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glGetClipPlanef, (GLenum pname, GLfloat eqn[4]), (pname, eqn[4])) \
+ X(void, glOrthof, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glAlphaFuncx, (GLenum func, GLclampx ref), (func, ref)) \
+ X(void, glClearColorx, (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha), (red, green, blue, alpha)) \
+ X(void, glClearDepthx, (GLclampx depth), (depth)) \
+ X(void, glColor4x, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha), (red, green, blue, alpha)) \
+ X(void, glDepthRangex, (GLclampx zNear, GLclampx zFar), (zNear, zFar)) \
+ X(void, glFogx, (GLenum pname, GLfixed param), (pname, param)) \
+ X(void, glFogxv, (GLenum pname, const GLfixed * params), (pname, params)) \
+ X(void, glFrustumx, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glClipPlanex, (GLenum pname, const GLfixed * eqn), (pname, eqn)) \
+ X(void, glGetFixedv, (GLenum pname, GLfixed * params), (pname, params)) \
+ X(void, glGetLightxv, (GLenum light, GLenum pname, GLfixed * params), (light, pname, params)) \
+ X(void, glGetMaterialxv, (GLenum face, GLenum pname, GLfixed * params), (face, pname, params)) \
+ X(void, glGetTexEnvxv, (GLenum env, GLenum pname, GLfixed * params), (env, pname, params)) \
+ X(void, glGetTexParameterxv, (GLenum target, GLenum pname, GLfixed * params), (target, pname, params)) \
+ X(void, glLightModelx, (GLenum pname, GLfixed param), (pname, param)) \
+ X(void, glLightModelxv, (GLenum pname, const GLfixed * params), (pname, params)) \
+ X(void, glLightx, (GLenum light, GLenum pname, GLfixed param), (light, pname, param)) \
+ X(void, glLightxv, (GLenum light, GLenum pname, const GLfixed * params), (light, pname, params)) \
+ X(void, glLineWidthx, (GLfixed width), (width)) \
+ X(void, glLoadMatrixx, (const GLfixed * m), (m)) \
+ X(void, glMaterialx, (GLenum face, GLenum pname, GLfixed param), (face, pname, param)) \
+ X(void, glMaterialxv, (GLenum face, GLenum pname, const GLfixed * params), (face, pname, params)) \
+ X(void, glMultMatrixx, (const GLfixed * m), (m)) \
+ X(void, glMultiTexCoord4x, (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q), (target, s, t, r, q)) \
+ X(void, glNormal3x, (GLfixed nx, GLfixed ny, GLfixed nz), (nx, ny, nz)) \
+ X(void, glOrthox, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar), (left, right, bottom, top, zNear, zFar)) \
+ X(void, glPointParameterx, (GLenum pname, GLfixed param), (pname, param)) \
+ X(void, glPointParameterxv, (GLenum pname, const GLfixed * params), (pname, params)) \
+ X(void, glPointSizex, (GLfixed size), (size)) \
+ X(void, glPolygonOffsetx, (GLfixed factor, GLfixed units), (factor, units)) \
+ X(void, glRotatex, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z)) \
+ X(void, glSampleCoveragex, (GLclampx value, GLboolean invert), (value, invert)) \
+ X(void, glScalex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z)) \
+ X(void, glTexEnvx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param)) \
+ X(void, glTexEnvxv, (GLenum target, GLenum pname, const GLfixed * params), (target, pname, params)) \
+ X(void, glTexParameterx, (GLenum target, GLenum pname, GLfixed param), (target, pname, param)) \
+ X(void, glTexParameterxv, (GLenum target, GLenum pname, const GLfixed * params), (target, pname, params)) \
+ X(void, glTranslatex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z)) \
+ X(void, glGetClipPlanex, (GLenum pname, GLfixed eqn[4]), (pname, eqn[4])) \
+
+
+#endif // GLES1_ONLY_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles1_only_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles1_only_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..f65762598a8
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles1_only_static_translator_namespaced_header.h
@@ -0,0 +1,112 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles1_only.entries --output=include/OpenGLESDispatch/gles1_only_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+namespace translator {
+namespace gles1 {
+GL_APICALL void GL_APIENTRY glAlphaFunc(GLenum func, GLclampf ref);
+GL_APICALL void GL_APIENTRY glBegin(GLenum mode);
+GL_APICALL void GL_APIENTRY glClientActiveTexture(GLenum texture);
+GL_APICALL void GL_APIENTRY glClipPlane(GLenum plane, const GLdouble * equation);
+GL_APICALL void GL_APIENTRY glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
+GL_APICALL void GL_APIENTRY glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glColor4fv(const GLfloat * v);
+GL_APICALL void GL_APIENTRY glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+GL_APICALL void GL_APIENTRY glColor4ubv(const GLubyte * v);
+GL_APICALL void GL_APIENTRY glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
+GL_APICALL void GL_APIENTRY glDisableClientState(GLenum array);
+GL_APICALL void GL_APIENTRY glEnableClientState(GLenum array);
+GL_APICALL void GL_APIENTRY glEnd();
+GL_APICALL void GL_APIENTRY glFogf(GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glFogfv(GLenum pname, const GLfloat * params);
+GL_APICALL void GL_APIENTRY glGetClipPlane(GLenum plane, GLdouble * equation);
+GL_APICALL void GL_APIENTRY glGetDoublev(GLenum pname, GLdouble * params);
+GL_APICALL void GL_APIENTRY glGetLightfv(GLenum light, GLenum pname, GLfloat * params);
+GL_APICALL void GL_APIENTRY glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params);
+GL_APICALL void GL_APIENTRY glGetPointerv(GLenum pname, GLvoid* * params);
+GL_APICALL void GL_APIENTRY glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params);
+GL_APICALL void GL_APIENTRY glGetTexEnviv(GLenum target, GLenum pname, GLint * params);
+GL_APICALL void GL_APIENTRY glLightf(GLenum light, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glLightfv(GLenum light, GLenum pname, const GLfloat * params);
+GL_APICALL void GL_APIENTRY glLightModelf(GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glLightModelfv(GLenum pname, const GLfloat * params);
+GL_APICALL void GL_APIENTRY glLoadIdentity();
+GL_APICALL void GL_APIENTRY glLoadMatrixf(const GLfloat * m);
+GL_APICALL void GL_APIENTRY glLogicOp(GLenum opcode);
+GL_APICALL void GL_APIENTRY glMaterialf(GLenum face, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glMaterialfv(GLenum face, GLenum pname, const GLfloat * params);
+GL_APICALL void GL_APIENTRY glMultiTexCoord2fv(GLenum target, const GLfloat * v);
+GL_APICALL void GL_APIENTRY glMultiTexCoord2sv(GLenum target, const GLshort * v);
+GL_APICALL void GL_APIENTRY glMultiTexCoord3fv(GLenum target, const GLfloat * v);
+GL_APICALL void GL_APIENTRY glMultiTexCoord3sv(GLenum target, const GLshort * v);
+GL_APICALL void GL_APIENTRY glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GL_APICALL void GL_APIENTRY glMultiTexCoord4fv(GLenum target, const GLfloat * v);
+GL_APICALL void GL_APIENTRY glMultiTexCoord4sv(GLenum target, const GLshort * v);
+GL_APICALL void GL_APIENTRY glMultMatrixf(const GLfloat * m);
+GL_APICALL void GL_APIENTRY glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
+GL_APICALL void GL_APIENTRY glNormal3fv(const GLfloat * v);
+GL_APICALL void GL_APIENTRY glNormal3sv(const GLshort * v);
+GL_APICALL void GL_APIENTRY glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GL_APICALL void GL_APIENTRY glPointParameterf(GLenum param, GLfloat value);
+GL_APICALL void GL_APIENTRY glPointParameterfv(GLenum param, const GLfloat * values);
+GL_APICALL void GL_APIENTRY glPointSize(GLfloat size);
+GL_APICALL void GL_APIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glTexEnvf(GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params);
+GL_APICALL void GL_APIENTRY glMatrixMode(GLenum mode);
+GL_APICALL void GL_APIENTRY glNormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
+GL_APICALL void GL_APIENTRY glPopMatrix();
+GL_APICALL void GL_APIENTRY glPushMatrix();
+GL_APICALL void GL_APIENTRY glShadeModel(GLenum mode);
+GL_APICALL void GL_APIENTRY glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
+GL_APICALL void GL_APIENTRY glTexEnvi(GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexEnviv(GLenum target, GLenum pname, const GLint * params);
+GL_APICALL void GL_APIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
+GL_APICALL void GL_APIENTRY glClipPlanef(GLenum plane, const GLfloat * equation);
+GL_APICALL void GL_APIENTRY glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_APICALL void GL_APIENTRY glGetClipPlanef(GLenum pname, GLfloat eqn[4]);
+GL_APICALL void GL_APIENTRY glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_APICALL void GL_APIENTRY glAlphaFuncx(GLenum func, GLclampx ref);
+GL_APICALL void GL_APIENTRY glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_APICALL void GL_APIENTRY glClearDepthx(GLclampx depth);
+GL_APICALL void GL_APIENTRY glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_APICALL void GL_APIENTRY glDepthRangex(GLclampx zNear, GLclampx zFar);
+GL_APICALL void GL_APIENTRY glFogx(GLenum pname, GLfixed param);
+GL_APICALL void GL_APIENTRY glFogxv(GLenum pname, const GLfixed * params);
+GL_APICALL void GL_APIENTRY glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_APICALL void GL_APIENTRY glClipPlanex(GLenum pname, const GLfixed * eqn);
+GL_APICALL void GL_APIENTRY glGetFixedv(GLenum pname, GLfixed * params);
+GL_APICALL void GL_APIENTRY glGetLightxv(GLenum light, GLenum pname, GLfixed * params);
+GL_APICALL void GL_APIENTRY glGetMaterialxv(GLenum face, GLenum pname, GLfixed * params);
+GL_APICALL void GL_APIENTRY glGetTexEnvxv(GLenum env, GLenum pname, GLfixed * params);
+GL_APICALL void GL_APIENTRY glGetTexParameterxv(GLenum target, GLenum pname, GLfixed * params);
+GL_APICALL void GL_APIENTRY glLightModelx(GLenum pname, GLfixed param);
+GL_APICALL void GL_APIENTRY glLightModelxv(GLenum pname, const GLfixed * params);
+GL_APICALL void GL_APIENTRY glLightx(GLenum light, GLenum pname, GLfixed param);
+GL_APICALL void GL_APIENTRY glLightxv(GLenum light, GLenum pname, const GLfixed * params);
+GL_APICALL void GL_APIENTRY glLineWidthx(GLfixed width);
+GL_APICALL void GL_APIENTRY glLoadMatrixx(const GLfixed * m);
+GL_APICALL void GL_APIENTRY glMaterialx(GLenum face, GLenum pname, GLfixed param);
+GL_APICALL void GL_APIENTRY glMaterialxv(GLenum face, GLenum pname, const GLfixed * params);
+GL_APICALL void GL_APIENTRY glMultMatrixx(const GLfixed * m);
+GL_APICALL void GL_APIENTRY glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_APICALL void GL_APIENTRY glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz);
+GL_APICALL void GL_APIENTRY glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_APICALL void GL_APIENTRY glPointParameterx(GLenum pname, GLfixed param);
+GL_APICALL void GL_APIENTRY glPointParameterxv(GLenum pname, const GLfixed * params);
+GL_APICALL void GL_APIENTRY glPointSizex(GLfixed size);
+GL_APICALL void GL_APIENTRY glPolygonOffsetx(GLfixed factor, GLfixed units);
+GL_APICALL void GL_APIENTRY glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_APICALL void GL_APIENTRY glSampleCoveragex(GLclampx value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScalex(GLfixed x, GLfixed y, GLfixed z);
+GL_APICALL void GL_APIENTRY glTexEnvx(GLenum target, GLenum pname, GLfixed param);
+GL_APICALL void GL_APIENTRY glTexEnvxv(GLenum target, GLenum pname, const GLfixed * params);
+GL_APICALL void GL_APIENTRY glTexParameterx(GLenum target, GLenum pname, GLfixed param);
+GL_APICALL void GL_APIENTRY glTexParameterxv(GLenum target, GLenum pname, const GLfixed * params);
+GL_APICALL void GL_APIENTRY glTranslatex(GLfixed x, GLfixed y, GLfixed z);
+GL_APICALL void GL_APIENTRY glGetClipPlanex(GLenum pname, GLfixed eqn[4]);
+} // namespace translator
+} // namespace gles1
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles2_extensions_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles2_extensions_functions.h
new file mode 100644
index 00000000000..b87ae849155
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles2_extensions_functions.h
@@ -0,0 +1,29 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/gl/OpenGLESDispatch/gles2_extensions.entries --output=include/OpenGLESDispatch/gles2_extensions_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES2_EXTENSIONS_FUNCTIONS_H
+#define GLES2_EXTENSIONS_FUNCTIONS_H
+
+#include <GLES/gl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#define LIST_GLES2_EXTENSIONS_FUNCTIONS(X) \
+ X(void, glGetShaderPrecisionFormat, (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision), (shadertype, precisiontype, range, precision)) \
+ X(void, glReleaseShaderCompiler, (), ()) \
+ X(void, glShaderBinary, (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length), (n, shaders, binaryformat, binary, length)) \
+ X(void, glVertexAttribPointerWithDataSize, (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr, GLsizei dataSize), (indx, size, type, normalized, stride, ptr, dataSize)) \
+ X(void, glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset), (target, attachment, textarget, texture, level, zoffset)) \
+ X(void, glTestHostDriverPerformance, (GLuint count, uint64_t* duration_us, uint64_t* duration_cpu_us), (count, duration_us, duration_cpu_us)) \
+ X(void, glBindVertexArrayOES, (GLuint array), (array)) \
+ X(void, glDeleteVertexArraysOES, (GLsizei n, const GLuint * arrays), (n, arrays)) \
+ X(void, glGenVertexArraysOES, (GLsizei n, GLuint * arrays), (n, arrays)) \
+ X(GLboolean, glIsVertexArrayOES, (GLuint array), (array)) \
+ X(void, glDebugMessageControlKHR, (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled), (source, type, severity, count, ids, enabled)) \
+ X(void, glDebugMessageInsertKHR, (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf), (source, type, id, severity, length, buf)) \
+ X(void, glDebugMessageCallbackKHR, (GLDEBUGPROCKHR callback, const void * userParam), (callback, userParam)) \
+ X(GLuint, glGetDebugMessageLogKHR, (GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog), (count, bufSize, sources, types, ids, severities, lengths, messageLog)) \
+ X(void, glPushDebugGroupKHR, (GLenum source, GLuint id, GLsizei length, const GLchar* message), (source, id, length, message)) \
+ X(void, glPopDebugGroupKHR, (), ()) \
+
+
+#endif // GLES2_EXTENSIONS_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles2_extensions_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles2_extensions_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..2738f1be124
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles2_extensions_static_translator_namespaced_header.h
@@ -0,0 +1,28 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles2_extensions.entries --output=include/OpenGLESDispatch/gles2_extensions_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+#include <GLES/gl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+namespace translator {
+namespace gles2 {
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler();
+GL_APICALL void GL_APIENTRY glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glVertexAttribPointerWithDataSize(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr, GLsizei dataSize);
+GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GL_APICALL void GL_APIENTRY glTestHostDriverPerformance(GLuint count, uint64_t* duration_us, uint64_t* duration_cpu_us);
+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);
+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();
+} // namespace translator
+} // namespace gles2
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles2_only_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles2_only_functions.h
new file mode 100644
index 00000000000..f9b0e46add2
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles2_only_functions.h
@@ -0,0 +1,88 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/gl/OpenGLESDispatch/gles2_only.entries --output=include/OpenGLESDispatch/gles2_only_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES2_ONLY_FUNCTIONS_H
+#define GLES2_ONLY_FUNCTIONS_H
+
+#define LIST_GLES2_ONLY_FUNCTIONS(X) \
+ X(void, glBlendColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), (red, green, blue, alpha)) \
+ X(void, glStencilFuncSeparate, (GLenum face, GLenum func, GLint ref, GLuint mask), (face, func, ref, mask)) \
+ X(void, glStencilMaskSeparate, (GLenum face, GLuint mask), (face, mask)) \
+ X(void, glStencilOpSeparate, (GLenum face, GLenum fail, GLenum zfail, GLenum zpass), (face, fail, zfail, zpass)) \
+ X(GLboolean, glIsProgram, (GLuint program), (program)) \
+ X(GLboolean, glIsShader, (GLuint shader), (shader)) \
+ X(void, glVertexAttrib1f, (GLuint indx, GLfloat x), (indx, x)) \
+ X(void, glVertexAttrib1fv, (GLuint indx, const GLfloat* values), (indx, values)) \
+ X(void, glVertexAttrib2f, (GLuint indx, GLfloat x, GLfloat y), (indx, x, y)) \
+ X(void, glVertexAttrib2fv, (GLuint indx, const GLfloat* values), (indx, values)) \
+ X(void, glVertexAttrib3f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z), (indx, x, y, z)) \
+ X(void, glVertexAttrib3fv, (GLuint indx, const GLfloat* values), (indx, values)) \
+ X(void, glVertexAttrib4f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (indx, x, y, z, w)) \
+ X(void, glVertexAttrib4fv, (GLuint indx, const GLfloat* values), (indx, values)) \
+ X(void, glVertexAttribPointer, (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr), (indx, size, type, normalized, stride, ptr)) \
+ X(void, glDisableVertexAttribArray, (GLuint index), (index)) \
+ X(void, glEnableVertexAttribArray, (GLuint index), (index)) \
+ X(void, glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat* params), (index, pname, params)) \
+ X(void, glGetVertexAttribiv, (GLuint index, GLenum pname, GLint* params), (index, pname, params)) \
+ X(void, glGetVertexAttribPointerv, (GLuint index, GLenum pname, GLvoid** pointer), (index, pname, pointer)) \
+ X(void, glUniform1f, (GLint location, GLfloat x), (location, x)) \
+ X(void, glUniform1fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v)) \
+ X(void, glUniform1i, (GLint location, GLint x), (location, x)) \
+ X(void, glUniform1iv, (GLint location, GLsizei count, const GLint* v), (location, count, v)) \
+ X(void, glUniform2f, (GLint location, GLfloat x, GLfloat y), (location, x, y)) \
+ X(void, glUniform2fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v)) \
+ X(void, glUniform2i, (GLint location, GLint x, GLint y), (location, x, y)) \
+ X(void, glUniform2iv, (GLint location, GLsizei count, const GLint* v), (location, count, v)) \
+ X(void, glUniform3f, (GLint location, GLfloat x, GLfloat y, GLfloat z), (location, x, y, z)) \
+ X(void, glUniform3fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v)) \
+ X(void, glUniform3i, (GLint location, GLint x, GLint y, GLint z), (location, x, y, z)) \
+ X(void, glUniform3iv, (GLint location, GLsizei count, const GLint* v), (location, count, v)) \
+ X(void, glUniform4f, (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (location, x, y, z, w)) \
+ X(void, glUniform4fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v)) \
+ X(void, glUniform4i, (GLint location, GLint x, GLint y, GLint z, GLint w), (location, x, y, z, w)) \
+ X(void, glUniform4iv, (GLint location, GLsizei count, const GLint* v), (location, count, v)) \
+ X(void, glUniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value)) \
+ X(void, glUniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value)) \
+ X(void, glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value)) \
+ X(void, glAttachShader, (GLuint program, GLuint shader), (program, shader)) \
+ X(void, glBindAttribLocation, (GLuint program, GLuint index, const GLchar* name), (program, index, name)) \
+ X(void, glCompileShader, (GLuint shader), (shader)) \
+ X(GLuint, glCreateProgram, (), ()) \
+ X(GLuint, glCreateShader, (GLenum type), (type)) \
+ X(void, glDeleteProgram, (GLuint program), (program)) \
+ X(void, glDeleteShader, (GLuint shader), (shader)) \
+ X(void, glDetachShader, (GLuint program, GLuint shader), (program, shader)) \
+ X(void, glLinkProgram, (GLuint program), (program)) \
+ X(void, glUseProgram, (GLuint program), (program)) \
+ X(void, glValidateProgram, (GLuint program), (program)) \
+ X(void, glGetActiveAttrib, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name), (program, index, bufsize, length, size, type, name)) \
+ X(void, glGetActiveUniform, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name), (program, index, bufsize, length, size, type, name)) \
+ X(void, glGetAttachedShaders, (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders), (program, maxcount, count, shaders)) \
+ X(int, glGetAttribLocation, (GLuint program, const GLchar* name), (program, name)) \
+ X(void, glGetProgramiv, (GLuint program, GLenum pname, GLint* params), (program, pname, params)) \
+ X(void, glGetProgramInfoLog, (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog), (program, bufsize, length, infolog)) \
+ X(void, glGetShaderiv, (GLuint shader, GLenum pname, GLint* params), (shader, pname, params)) \
+ X(void, glGetShaderInfoLog, (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog), (shader, bufsize, length, infolog)) \
+ X(void, glGetShaderSource, (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source), (shader, bufsize, length, source)) \
+ X(void, glGetUniformfv, (GLuint program, GLint location, GLfloat* params), (program, location, params)) \
+ X(void, glGetUniformiv, (GLuint program, GLint location, GLint* params), (program, location, params)) \
+ X(int, glGetUniformLocation, (GLuint program, const GLchar* name), (program, name)) \
+ X(void, glShaderSource, (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length), (shader, count, string, length)) \
+ X(void, glBindFramebuffer, (GLenum target, GLuint framebuffer), (target, framebuffer)) \
+ X(void, glGenFramebuffers, (GLsizei n, GLuint* framebuffers), (n, framebuffers)) \
+ X(void, glFramebufferTexture2D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level)) \
+ X(GLenum, glCheckFramebufferStatus, (GLenum target), (target)) \
+ X(GLboolean, glIsFramebuffer, (GLuint framebuffer), (framebuffer)) \
+ X(void, glDeleteFramebuffers, (GLsizei n, const GLuint* framebuffers), (n, framebuffers)) \
+ X(GLboolean, glIsRenderbuffer, (GLuint renderbuffer), (renderbuffer)) \
+ X(void, glBindRenderbuffer, (GLenum target, GLuint renderbuffer), (target, renderbuffer)) \
+ X(void, glDeleteRenderbuffers, (GLsizei n, const GLuint * renderbuffers), (n, renderbuffers)) \
+ X(void, glGenRenderbuffers, (GLsizei n, GLuint * renderbuffers), (n, renderbuffers)) \
+ X(void, glRenderbufferStorage, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height)) \
+ X(void, glGetRenderbufferParameteriv, (GLenum target, GLenum pname, GLint * params), (target, pname, params)) \
+ X(void, glFramebufferRenderbuffer, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer)) \
+ X(void, glGetFramebufferAttachmentParameteriv, (GLenum target, GLenum attachment, GLenum pname, GLint * params), (target, attachment, pname, params)) \
+ X(void, glGenerateMipmap, (GLenum target), (target)) \
+
+
+#endif // GLES2_ONLY_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles2_only_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles2_only_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..c153866b80e
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles2_only_static_translator_namespaced_header.h
@@ -0,0 +1,87 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles2_only.entries --output=include/OpenGLESDispatch/gles2_only_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+namespace translator {
+namespace gles2 {
+GL_APICALL void GL_APIENTRY glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate(GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram(GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsShader(GLuint shader);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f(GLuint indx, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv(GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv(GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv(GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv(GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray(GLuint index);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray(GLuint index);
+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, GLvoid** pointer);
+GL_APICALL void GL_APIENTRY glUniform1f(GLint location, GLfloat x);
+GL_APICALL void GL_APIENTRY glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform1i(GLint location, GLint x);
+GL_APICALL void GL_APIENTRY glUniform1iv(GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniform2f(GLint location, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform2i(GLint location, GLint x, GLint y);
+GL_APICALL void GL_APIENTRY glUniform2iv(GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform3i(GLint location, GLint x, GLint y, GLint z);
+GL_APICALL void GL_APIENTRY glUniform3iv(GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void GL_APIENTRY glUniform4iv(GLint location, GLsizei count, const GLint* v);
+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 glAttachShader(GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation(GLuint program, GLuint index, const GLchar* name);
+GL_APICALL void GL_APIENTRY glCompileShader(GLuint shader);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram();
+GL_APICALL GLuint GL_APIENTRY glCreateShader(GLenum type);
+GL_APICALL void GL_APIENTRY glDeleteProgram(GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteShader(GLuint shader);
+GL_APICALL void GL_APIENTRY glDetachShader(GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glLinkProgram(GLuint program);
+GL_APICALL void GL_APIENTRY glUseProgram(GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram(GLuint program);
+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 int GL_APIENTRY glGetAttribLocation(GLuint program, const GLchar* name);
+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 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 glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
+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 int GL_APIENTRY glGetUniformLocation(GLuint program, const GLchar* name);
+GL_APICALL void GL_APIENTRY glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
+GL_APICALL void GL_APIENTRY glBindFramebuffer(GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glGenFramebuffers(GLsizei n, GLuint* framebuffers);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus(GLenum target);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer(GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer(GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer(GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers(GLsizei n, GLuint * renderbuffers);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params);
+GL_APICALL void GL_APIENTRY glGenerateMipmap(GLenum target);
+} // namespace translator
+} // namespace gles2
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles31_only_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles31_only_functions.h
new file mode 100644
index 00000000000..80d6d3997d9
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles31_only_functions.h
@@ -0,0 +1,79 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/gl/OpenGLESDispatch/gles31_only.entries --output=include/OpenGLESDispatch/gles31_only_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES31_ONLY_FUNCTIONS_H
+#define GLES31_ONLY_FUNCTIONS_H
+
+#include <GLES/gl.h>
+#include <GLES3/gl3.h>
+#include <GLES3/gl31.h>
+#define LIST_GLES31_ONLY_FUNCTIONS(X) \
+ X(void, glGetBooleani_v, (GLenum target, GLuint index, GLboolean * data), (target, index, data)) \
+ X(void, glMemoryBarrier, (GLbitfield barriers), (barriers)) \
+ X(void, glMemoryBarrierByRegion, (GLbitfield barriers), (barriers)) \
+ X(void, glGenProgramPipelines, (GLsizei n, GLuint * pipelines), (n, pipelines)) \
+ X(void, glDeleteProgramPipelines, (GLsizei n, const GLuint * pipelines), (n, pipelines)) \
+ X(void, glBindProgramPipeline, (GLuint pipeline), (pipeline)) \
+ X(void, glGetProgramPipelineiv, (GLuint pipeline, GLenum pname, GLint * params), (pipeline, pname, params)) \
+ X(void, glGetProgramPipelineInfoLog, (GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog), (pipeline, bufSize, length, infoLog)) \
+ X(void, glValidateProgramPipeline, (GLuint pipeline), (pipeline)) \
+ X(GLboolean, glIsProgramPipeline, (GLuint pipeline), (pipeline)) \
+ X(void, glUseProgramStages, (GLuint pipeline, GLbitfield stages, GLuint program), (pipeline, stages, program)) \
+ X(void, glActiveShaderProgram, (GLuint pipeline, GLuint program), (pipeline, program)) \
+ X(GLuint, glCreateShaderProgramv, (GLenum type, GLsizei count, const char ** strings), (type, count, strings)) \
+ X(void, glProgramUniform1f, (GLuint program, GLint location, GLfloat v0), (program, location, v0)) \
+ X(void, glProgramUniform2f, (GLuint program, GLint location, GLfloat v0, GLfloat v1), (program, location, v0, v1)) \
+ X(void, glProgramUniform3f, (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2), (program, location, v0, v1, v2)) \
+ X(void, glProgramUniform4f, (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3), (program, location, v0, v1, v2, v3)) \
+ X(void, glProgramUniform1i, (GLuint program, GLint location, GLint v0), (program, location, v0)) \
+ X(void, glProgramUniform2i, (GLuint program, GLint location, GLint v0, GLint v1), (program, location, v0, v1)) \
+ X(void, glProgramUniform3i, (GLuint program, GLint location, GLint v0, GLint v1, GLint v2), (program, location, v0, v1, v2)) \
+ X(void, glProgramUniform4i, (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3), (program, location, v0, v1, v2, v3)) \
+ X(void, glProgramUniform1ui, (GLuint program, GLint location, GLuint v0), (program, location, v0)) \
+ X(void, glProgramUniform2ui, (GLuint program, GLint location, GLint v0, GLuint v1), (program, location, v0, v1)) \
+ X(void, glProgramUniform3ui, (GLuint program, GLint location, GLint v0, GLint v1, GLuint v2), (program, location, v0, v1, v2)) \
+ X(void, glProgramUniform4ui, (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3), (program, location, v0, v1, v2, v3)) \
+ X(void, glProgramUniform1fv, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value)) \
+ X(void, glProgramUniform2fv, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value)) \
+ X(void, glProgramUniform3fv, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value)) \
+ X(void, glProgramUniform4fv, (GLuint program, GLint location, GLsizei count, const GLfloat * value), (program, location, count, value)) \
+ X(void, glProgramUniform1iv, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value)) \
+ X(void, glProgramUniform2iv, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value)) \
+ X(void, glProgramUniform3iv, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value)) \
+ X(void, glProgramUniform4iv, (GLuint program, GLint location, GLsizei count, const GLint * value), (program, location, count, value)) \
+ X(void, glProgramUniform1uiv, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value)) \
+ X(void, glProgramUniform2uiv, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value)) \
+ X(void, glProgramUniform3uiv, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value)) \
+ X(void, glProgramUniform4uiv, (GLuint program, GLint location, GLsizei count, const GLuint * value), (program, location, count, value)) \
+ X(void, glProgramUniformMatrix2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value)) \
+ X(void, glProgramUniformMatrix3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value)) \
+ X(void, glProgramUniformMatrix4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value)) \
+ X(void, glProgramUniformMatrix2x3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value)) \
+ X(void, glProgramUniformMatrix3x2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value)) \
+ X(void, glProgramUniformMatrix2x4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value)) \
+ X(void, glProgramUniformMatrix4x2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value)) \
+ X(void, glProgramUniformMatrix3x4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value)) \
+ X(void, glProgramUniformMatrix4x3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (program, location, count, transpose, value)) \
+ X(void, glGetProgramInterfaceiv, (GLuint program, GLenum programInterface, GLenum pname, GLint * params), (program, programInterface, pname, params)) \
+ X(void, glGetProgramResourceiv, (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params), (program, programInterface, index, propCount, props, bufSize, length, params)) \
+ X(GLuint, glGetProgramResourceIndex, (GLuint program, GLenum programInterface, const char * name), (program, programInterface, name)) \
+ X(GLint, glGetProgramResourceLocation, (GLuint program, GLenum programInterface, const char * name), (program, programInterface, name)) \
+ X(void, glGetProgramResourceName, (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, char * name), (program, programInterface, index, bufSize, length, name)) \
+ X(void, glBindImageTexture, (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), (unit, texture, level, layered, layer, access, format)) \
+ X(void, glDispatchCompute, (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z), (num_groups_x, num_groups_y, num_groups_z)) \
+ X(void, glDispatchComputeIndirect, (GLintptr indirect), (indirect)) \
+ X(void, glBindVertexBuffer, (GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride), (bindingindex, buffer, offset, stride)) \
+ X(void, glVertexAttribBinding, (GLuint attribindex, GLuint bindingindex), (attribindex, bindingindex)) \
+ X(void, glVertexAttribFormat, (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset), (attribindex, size, type, normalized, relativeoffset)) \
+ X(void, glVertexAttribIFormat, (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset), (attribindex, size, type, relativeoffset)) \
+ X(void, glVertexBindingDivisor, (GLuint bindingindex, GLuint divisor), (bindingindex, divisor)) \
+ X(void, glDrawArraysIndirect, (GLenum mode, const void * indirect), (mode, indirect)) \
+ X(void, glDrawElementsIndirect, (GLenum mode, GLenum type, const void * indirect), (mode, type, indirect)) \
+ X(void, glTexStorage2DMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations), (target, samples, internalformat, width, height, fixedsamplelocations)) \
+ X(void, glSampleMaski, (GLuint maskNumber, GLbitfield mask), (maskNumber, mask)) \
+ X(void, glGetMultisamplefv, (GLenum pname, GLuint index, GLfloat * val), (pname, index, val)) \
+ X(void, glFramebufferParameteri, (GLenum target, GLenum pname, GLint param), (target, pname, param)) \
+ X(void, glGetFramebufferParameteriv, (GLenum target, GLenum pname, GLint * params), (target, pname, params)) \
+
+
+#endif // GLES31_ONLY_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles31_only_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles31_only_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..bafab12bd98
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles31_only_static_translator_namespaced_header.h
@@ -0,0 +1,78 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles31_only.entries --output=include/OpenGLESDispatch/gles31_only_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+#include <GLES/gl.h>
+#include <GLES3/gl3.h>
+#include <GLES3/gl31.h>
+namespace translator {
+namespace gles2 {
+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 glGenProgramPipelines(GLsizei n, GLuint * pipelines);
+GL_APICALL void GL_APIENTRY glDeleteProgramPipelines(GLsizei n, const GLuint * pipelines);
+GL_APICALL void GL_APIENTRY glBindProgramPipeline(GLuint pipeline);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint * params);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
+GL_APICALL void GL_APIENTRY glValidateProgramPipeline(GLuint pipeline);
+GL_APICALL GLboolean GL_APIENTRY glIsProgramPipeline(GLuint pipeline);
+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 char ** strings);
+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 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, GLint v0, GLuint v1);
+GL_APICALL void GL_APIENTRY glProgramUniform3ui(GLuint program, GLint location, GLint v0, GLint v1, GLuint v2);
+GL_APICALL void GL_APIENTRY glProgramUniform4ui(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3);
+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 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 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 glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint * params);
+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 GLuint GL_APIENTRY glGetProgramResourceIndex(GLuint program, GLenum programInterface, const char * name);
+GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocation(GLuint program, GLenum programInterface, const char * name);
+GL_APICALL void GL_APIENTRY glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, char * name);
+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 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 glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride);
+GL_APICALL void GL_APIENTRY glVertexAttribBinding(GLuint attribindex, GLuint bindingindex);
+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 glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
+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 glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GL_APICALL void GL_APIENTRY glSampleMaski(GLuint maskNumber, GLbitfield mask);
+GL_APICALL void GL_APIENTRY glGetMultisamplefv(GLenum pname, GLuint index, GLfloat * val);
+GL_APICALL void GL_APIENTRY glFramebufferParameteri(GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint * params);
+} // namespace translator
+} // namespace gles2
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles32_only_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles32_only_functions.h
new file mode 100644
index 00000000000..69c0a10047d
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles32_only_functions.h
@@ -0,0 +1,19 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/OpenGLESDispatch/gles32_only.entries --output=stream-servers/OpenGLESDispatch/gles32_only_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES32_ONLY_FUNCTIONS_H
+#define GLES32_ONLY_FUNCTIONS_H
+
+#include <GLES/gl.h>
+#include <GLES3/gl3.h>
+#include <GLES3/gl32.h>
+#define LIST_GLES32_ONLY_FUNCTIONS(X) \
+ X(void, glDebugMessageControl, (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled), (source, type, severity, count, ids, enabled)) \
+ X(void, glDebugMessageInsert, (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf), (source, type, id, severity, length, buf)) \
+ X(void, glDebugMessageCallback, (GLDEBUGPROC callback, const void * userParam), (callback, userParam)) \
+ X(GLuint, glGetDebugMessageLog, (GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog), (count, bufSize, sources, types, ids, severities, lengths, messageLog)) \
+ X(void, glPushDebugGroup, (GLenum source, GLuint id, GLsizei length, const GLchar* message), (source, id, length, message)) \
+ X(void, glPopDebugGroup, (), ()) \
+
+
+#endif // GLES32_ONLY_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles32_only_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles32_only_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..1aaab7b8f4b
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles32_only_static_translator_namespaced_header.h
@@ -0,0 +1,18 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/OpenGLESDispatch/gles32_only.entries --output=stream-servers/OpenGLESDispatch/gles32_only_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+#include <GLES/gl.h>
+#include <GLES3/gl3.h>
+#include <GLES3/gl32.h>
+namespace translator {
+namespace gles2 {
+GL_APICALL void GL_APIENTRY glDebugMessageControl(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled);
+GL_APICALL void GL_APIENTRY glDebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf);
+GL_APICALL void GL_APIENTRY glDebugMessageCallback(GLDEBUGPROC callback, const void * userParam);
+GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLog(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog);
+GL_APICALL void GL_APIENTRY glPushDebugGroup(GLenum source, GLuint id, GLsizei length, const GLchar* message);
+GL_APICALL void GL_APIENTRY glPopDebugGroup();
+} // namespace translator
+} // namespace gles2
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles3_extensions_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles3_extensions_functions.h
new file mode 100644
index 00000000000..62e055e6c45
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles3_extensions_functions.h
@@ -0,0 +1,24 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/gl/OpenGLESDispatch/gles3_extensions.entries --output=include/OpenGLESDispatch/gles3_extensions_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES3_EXTENSIONS_FUNCTIONS_H
+#define GLES3_EXTENSIONS_FUNCTIONS_H
+
+#define LIST_GLES3_EXTENSIONS_FUNCTIONS(X) \
+ X(void, glVertexAttribIPointerWithDataSize, (GLuint indx, GLint size, GLenum type, GLsizei stride, const GLvoid* ptr, GLsizei dataSize), (indx, size, type, stride, ptr, dataSize)) \
+ X(void, glPrimitiveRestartIndex, (GLuint index), (index)) \
+ X(void, glTexBufferOES, (GLenum target, GLenum internalformat, GLuint buffer), (target, internalformat, buffer)) \
+ X(void, glTexBufferRangeOES, (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size), (target, internalformat, buffer, offset, size)) \
+ X(void, glTexBufferEXT, (GLenum target, GLenum internalformat, GLuint buffer), (target, internalformat, buffer)) \
+ X(void, glTexBufferRangeEXT, (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size), (target, internalformat, buffer, offset, size)) \
+ X(void, glEnableiEXT, (GLenum cap, GLuint index), (cap, index)) \
+ X(void, glDisableiEXT, (GLenum cap, GLuint index), (cap, index)) \
+ X(void, glBlendEquationiEXT, (GLuint buf, GLenum mode), (buf, mode)) \
+ X(void, glBlendEquationSeparateiEXT, (GLuint buf, GLenum modeRGB, GLenum modeAlpha), (buf, modeRGB, modeAlpha)) \
+ X(void, glBlendFunciEXT, (GLuint buf, GLenum sfactor, GLenum dfactor), (buf, sfactor, dfactor)) \
+ X(void, glBlendFuncSeparateiEXT, (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (buf, srcRGB, dstRGB, srcAlpha, dstAlpha)) \
+ X(void, glColorMaskiEXT, (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha), (buf, red, green, blue, alpha)) \
+ X(GLboolean, glIsEnablediEXT, (GLenum cap, GLuint index), (cap, index)) \
+
+
+#endif // GLES3_EXTENSIONS_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles3_extensions_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles3_extensions_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..636fe9aaaea
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles3_extensions_static_translator_namespaced_header.h
@@ -0,0 +1,23 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles3_extensions.entries --output=include/OpenGLESDispatch/gles3_extensions_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+namespace translator {
+namespace gles2 {
+GL_APICALL void GL_APIENTRY glVertexAttribIPointerWithDataSize(GLuint indx, GLint size, GLenum type, GLsizei stride, const GLvoid* ptr, GLsizei dataSize);
+GL_APICALL void GL_APIENTRY glPrimitiveRestartIndex(GLuint index);
+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);
+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);
+GL_APICALL void GL_APIENTRY glEnableiEXT(GLenum cap, GLuint index);
+GL_APICALL void GL_APIENTRY glDisableiEXT(GLenum cap, 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 sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void GL_APIENTRY glColorMaskiEXT(GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT(GLenum cap, GLuint index);
+} // namespace translator
+} // namespace gles2
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles3_only_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles3_only_functions.h
new file mode 100644
index 00000000000..395d6c97ec6
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles3_only_functions.h
@@ -0,0 +1,115 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/gl/OpenGLESDispatch/gles3_only.entries --output=include/OpenGLESDispatch/gles3_only_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES3_ONLY_FUNCTIONS_H
+#define GLES3_ONLY_FUNCTIONS_H
+
+#include <GLES/gl.h>
+#include <GLES3/gl3.h>
+#define LIST_GLES3_ONLY_FUNCTIONS(X) \
+ X(GLconstubyteptr, glGetStringi, (GLenum name, GLint index), (name, index)) \
+ X(void, glGenVertexArrays, (GLsizei n, GLuint* arrays), (n, arrays)) \
+ X(void, glBindVertexArray, (GLuint array), (array)) \
+ X(void, glDeleteVertexArrays, (GLsizei n, const GLuint * arrays), (n, arrays)) \
+ X(GLboolean, glIsVertexArray, (GLuint array), (array)) \
+ X(void *, glMapBufferRange, (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access), (target, offset, length, access)) \
+ X(GLboolean, glUnmapBuffer, (GLenum target), (target)) \
+ X(void, glFlushMappedBufferRange, (GLenum target, GLintptr offset, GLsizeiptr length), (target, offset, length)) \
+ X(void, glBindBufferRange, (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size), (target, index, buffer, offset, size)) \
+ X(void, glBindBufferBase, (GLenum target, GLuint index, GLuint buffer), (target, index, buffer)) \
+ X(void, glCopyBufferSubData, (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size), (readtarget, writetarget, readoffset, writeoffset, size)) \
+ X(void, glClearBufferiv, (GLenum buffer, GLint drawBuffer, const GLint * value), (buffer, drawBuffer, value)) \
+ X(void, glClearBufferuiv, (GLenum buffer, GLint drawBuffer, const GLuint * value), (buffer, drawBuffer, value)) \
+ X(void, glClearBufferfv, (GLenum buffer, GLint drawBuffer, const GLfloat * value), (buffer, drawBuffer, value)) \
+ X(void, glClearBufferfi, (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil), (buffer, drawBuffer, depth, stencil)) \
+ X(void, glGetBufferParameteri64v, (GLenum target, GLenum value, GLint64 * data), (target, value, data)) \
+ X(void, glGetBufferPointerv, (GLenum target, GLenum pname, GLvoid ** params), (target, pname, params)) \
+ X(void, glUniformBlockBinding, (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding), (program, uniformBlockIndex, uniformBlockBinding)) \
+ X(GLuint, glGetUniformBlockIndex, (GLuint program, const GLchar * uniformBlockName), (program, uniformBlockName)) \
+ X(void, glGetUniformIndices, (GLuint program, GLsizei uniformCount, const GLchar ** uniformNames, GLuint * uniformIndices), (program, uniformCount, uniformNames, uniformIndices)) \
+ X(void, glGetActiveUniformBlockiv, (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params), (program, uniformBlockIndex, pname, params)) \
+ X(void, glGetActiveUniformBlockName, (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName), (program, uniformBlockIndex, bufSize, length, uniformBlockName)) \
+ X(void, glUniform1ui, (GLint location, GLuint v0), (location, v0)) \
+ X(void, glUniform2ui, (GLint location, GLuint v0, GLuint v1), (location, v0, v1)) \
+ X(void, glUniform3ui, (GLint location, GLuint v0, GLuint v1, GLuint v2), (location, v0, v1, v2)) \
+ X(void, glUniform4ui, (GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3), (location, v0, v1, v2, v3)) \
+ X(void, glUniform1uiv, (GLint location, GLsizei count, const GLuint * value), (location, count, value)) \
+ X(void, glUniform2uiv, (GLint location, GLsizei count, const GLuint * value), (location, count, value)) \
+ X(void, glUniform3uiv, (GLint location, GLsizei count, const GLuint * value), (location, count, value)) \
+ X(void, glUniform4uiv, (GLint location, GLsizei count, const GLuint * value), (location, count, value)) \
+ X(void, glUniformMatrix2x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value)) \
+ X(void, glUniformMatrix3x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value)) \
+ X(void, glUniformMatrix2x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value)) \
+ X(void, glUniformMatrix4x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value)) \
+ X(void, glUniformMatrix3x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value)) \
+ X(void, glUniformMatrix4x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value), (location, count, transpose, value)) \
+ X(void, glGetUniformuiv, (GLuint program, GLint location, GLuint * params), (program, location, params)) \
+ X(void, glGetActiveUniformsiv, (GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params), (program, uniformCount, uniformIndices, pname, params)) \
+ X(void, glVertexAttribI4i, (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3), (index, v0, v1, v2, v3)) \
+ X(void, glVertexAttribI4ui, (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3), (index, v0, v1, v2, v3)) \
+ X(void, glVertexAttribI4iv, (GLuint index, const GLint * v), (index, v)) \
+ X(void, glVertexAttribI4uiv, (GLuint index, const GLuint * v), (index, v)) \
+ X(void, glVertexAttribIPointer, (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer), (index, size, type, stride, pointer)) \
+ X(void, glGetVertexAttribIiv, (GLuint index, GLenum pname, GLint * params), (index, pname, params)) \
+ X(void, glGetVertexAttribIuiv, (GLuint index, GLenum pname, GLuint * params), (index, pname, params)) \
+ X(void, glVertexAttribDivisor, (GLuint index, GLuint divisor), (index, divisor)) \
+ X(void, glDrawArraysInstanced, (GLenum mode, GLint first, GLsizei count, GLsizei primcount), (mode, first, count, primcount)) \
+ X(void, glDrawElementsInstanced, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount), (mode, count, type, indices, primcount)) \
+ X(void, glDrawRangeElements, (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices), (mode, start, end, count, type, indices)) \
+ X(GLsync, glFenceSync, (GLenum condition, GLbitfield flags), (condition, flags)) \
+ X(GLenum, glClientWaitSync, (GLsync wait_on, GLbitfield flags, GLuint64 timeout), (wait_on, flags, timeout)) \
+ X(void, glWaitSync, (GLsync wait_on, GLbitfield flags, GLuint64 timeout), (wait_on, flags, timeout)) \
+ X(void, glDeleteSync, (GLsync to_delete), (to_delete)) \
+ X(GLboolean, glIsSync, (GLsync sync), (sync)) \
+ X(void, glGetSynciv, (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values), (sync, pname, bufSize, length, values)) \
+ X(void, glDrawBuffers, (GLsizei n, const GLenum * bufs), (n, bufs)) \
+ X(void, glReadBuffer, (GLenum src), (src)) \
+ X(void, glBlitFramebuffer, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter), (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)) \
+ X(void, glInvalidateFramebuffer, (GLenum target, GLsizei numAttachments, const GLenum * attachments), (target, numAttachments, attachments)) \
+ X(void, glInvalidateSubFramebuffer, (GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height), (target, numAttachments, attachments, x, y, width, height)) \
+ X(void, glFramebufferTextureLayer, (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer), (target, attachment, texture, level, layer)) \
+ X(void, glGetInternalformativ, (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params), (target, internalformat, pname, bufSize, params)) \
+ X(void, glTexStorage2D, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (target, levels, internalformat, width, height)) \
+ X(void, glBeginTransformFeedback, (GLenum primitiveMode), (primitiveMode)) \
+ X(void, glEndTransformFeedback, (), ()) \
+ X(void, glGenTransformFeedbacks, (GLsizei n, GLuint * ids), (n, ids)) \
+ X(void, glDeleteTransformFeedbacks, (GLsizei n, const GLuint * ids), (n, ids)) \
+ X(void, glBindTransformFeedback, (GLenum target, GLuint id), (target, id)) \
+ X(void, glPauseTransformFeedback, (), ()) \
+ X(void, glResumeTransformFeedback, (), ()) \
+ X(GLboolean, glIsTransformFeedback, (GLuint id), (id)) \
+ X(void, glTransformFeedbackVaryings, (GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode), (program, count, varyings, bufferMode)) \
+ X(void, glGetTransformFeedbackVarying, (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, char * name), (program, index, bufSize, length, size, type, name)) \
+ X(void, glGenSamplers, (GLsizei n, GLuint * samplers), (n, samplers)) \
+ X(void, glDeleteSamplers, (GLsizei n, const GLuint * samplers), (n, samplers)) \
+ X(void, glBindSampler, (GLuint unit, GLuint sampler), (unit, sampler)) \
+ X(void, glSamplerParameterf, (GLuint sampler, GLenum pname, GLfloat param), (sampler, pname, param)) \
+ X(void, glSamplerParameteri, (GLuint sampler, GLenum pname, GLint param), (sampler, pname, param)) \
+ X(void, glSamplerParameterfv, (GLuint sampler, GLenum pname, const GLfloat * params), (sampler, pname, params)) \
+ X(void, glSamplerParameteriv, (GLuint sampler, GLenum pname, const GLint * params), (sampler, pname, params)) \
+ X(void, glGetSamplerParameterfv, (GLuint sampler, GLenum pname, GLfloat * params), (sampler, pname, params)) \
+ X(void, glGetSamplerParameteriv, (GLuint sampler, GLenum pname, GLint * params), (sampler, pname, params)) \
+ X(GLboolean, glIsSampler, (GLuint sampler), (sampler)) \
+ X(void, glGenQueries, (GLsizei n, GLuint * queries), (n, queries)) \
+ X(void, glDeleteQueries, (GLsizei n, const GLuint * queries), (n, queries)) \
+ X(void, glBeginQuery, (GLenum target, GLuint query), (target, query)) \
+ X(void, glEndQuery, (GLenum target), (target)) \
+ X(void, glGetQueryiv, (GLenum target, GLenum pname, GLint * params), (target, pname, params)) \
+ X(void, glGetQueryObjectuiv, (GLuint query, GLenum pname, GLuint * params), (query, pname, params)) \
+ X(GLboolean, glIsQuery, (GLuint query), (query)) \
+ X(void, glProgramParameteri, (GLuint program, GLenum pname, GLint value), (program, pname, value)) \
+ X(void, glProgramBinary, (GLuint program, GLenum binaryFormat, const void * binary, GLsizei length), (program, binaryFormat, binary, length)) \
+ X(void, glGetProgramBinary, (GLuint program, GLsizei bufsize, GLsizei * length, GLenum * binaryFormat, void * binary), (program, bufsize, length, binaryFormat, binary)) \
+ X(GLint, glGetFragDataLocation, (GLuint program, const char * name), (program, name)) \
+ X(void, glGetInteger64v, (GLenum pname, GLint64 * data), (pname, data)) \
+ X(void, glGetIntegeri_v, (GLenum target, GLuint index, GLint * data), (target, index, data)) \
+ X(void, glGetInteger64i_v, (GLenum target, GLuint index, GLint64 * data), (target, index, data)) \
+ X(void, glTexImage3D, (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data), (target, level, internalFormat, width, height, depth, border, format, type, data)) \
+ X(void, glTexStorage3D, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (target, levels, internalformat, width, height, depth)) \
+ X(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), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data)) \
+ X(void, glCompressedTexImage3D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data), (target, level, internalformat, width, height, depth, border, imageSize, data)) \
+ X(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), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data)) \
+ X(void, glCopyTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, zoffset, x, y, width, height)) \
+
+
+#endif // GLES3_ONLY_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles3_only_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles3_only_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..dc573c93e7c
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles3_only_static_translator_namespaced_header.h
@@ -0,0 +1,114 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles3_only.entries --output=include/OpenGLESDispatch/gles3_only_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+#include <GLES/gl.h>
+#include <GLES3/gl3.h>
+namespace translator {
+namespace gles2 {
+GL_APICALL GLconstubyteptr GL_APIENTRY glGetStringi(GLenum name, GLint index);
+GL_APICALL void GL_APIENTRY glGenVertexArrays(GLsizei n, GLuint* arrays);
+GL_APICALL void GL_APIENTRY glBindVertexArray(GLuint array);
+GL_APICALL void GL_APIENTRY glDeleteVertexArrays(GLsizei n, const GLuint * arrays);
+GL_APICALL GLboolean GL_APIENTRY glIsVertexArray(GLuint array);
+GL_APICALL void * GL_APIENTRY glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer(GLenum target);
+GL_APICALL void GL_APIENTRY glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
+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 glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
+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 void GL_APIENTRY glGetBufferParameteri64v(GLenum target, GLenum value, GLint64 * data);
+GL_APICALL void GL_APIENTRY glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params);
+GL_APICALL void GL_APIENTRY glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName);
+GL_APICALL void GL_APIENTRY glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar ** uniformNames, GLuint * uniformIndices);
+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 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, GLint 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 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 glGetUniformuiv(GLuint program, GLint location, GLuint * params);
+GL_APICALL void GL_APIENTRY glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params);
+GL_APICALL void GL_APIENTRY glVertexAttribI4i(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glVertexAttribI4ui(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+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 glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * 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 glVertexAttribDivisor(GLuint index, GLuint divisor);
+GL_APICALL void GL_APIENTRY glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices);
+GL_APICALL GLsync GL_APIENTRY glFenceSync(GLenum condition, GLbitfield flags);
+GL_APICALL GLenum GL_APIENTRY glClientWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glDeleteSync(GLsync to_delete);
+GL_APICALL GLboolean GL_APIENTRY glIsSync(GLsync sync);
+GL_APICALL void GL_APIENTRY glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values);
+GL_APICALL void GL_APIENTRY glDrawBuffers(GLsizei n, const GLenum * bufs);
+GL_APICALL void GL_APIENTRY glReadBuffer(GLenum src);
+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 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 glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GL_APICALL void GL_APIENTRY glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params);
+GL_APICALL void GL_APIENTRY glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glBeginTransformFeedback(GLenum primitiveMode);
+GL_APICALL void GL_APIENTRY glEndTransformFeedback();
+GL_APICALL void GL_APIENTRY glGenTransformFeedbacks(GLsizei n, GLuint * ids);
+GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks(GLsizei n, const GLuint * ids);
+GL_APICALL void GL_APIENTRY glBindTransformFeedback(GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glPauseTransformFeedback();
+GL_APICALL void GL_APIENTRY glResumeTransformFeedback();
+GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback(GLuint id);
+GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings(GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode);
+GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, char * name);
+GL_APICALL void GL_APIENTRY glGenSamplers(GLsizei n, GLuint * samplers);
+GL_APICALL void GL_APIENTRY glDeleteSamplers(GLsizei n, const GLuint * samplers);
+GL_APICALL void GL_APIENTRY glBindSampler(GLuint unit, GLuint sampler);
+GL_APICALL void GL_APIENTRY glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glSamplerParameteri(GLuint sampler, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * params);
+GL_APICALL void GL_APIENTRY glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint * params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat * params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint * params);
+GL_APICALL GLboolean GL_APIENTRY glIsSampler(GLuint sampler);
+GL_APICALL void GL_APIENTRY glGenQueries(GLsizei n, GLuint * queries);
+GL_APICALL void GL_APIENTRY glDeleteQueries(GLsizei n, const GLuint * queries);
+GL_APICALL void GL_APIENTRY glBeginQuery(GLenum target, GLuint query);
+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 query, GLenum pname, GLuint * params);
+GL_APICALL GLboolean GL_APIENTRY glIsQuery(GLuint query);
+GL_APICALL void GL_APIENTRY glProgramParameteri(GLuint program, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glProgramBinary(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glGetProgramBinary(GLuint program, GLsizei bufsize, GLsizei * length, GLenum * binaryFormat, void * binary);
+GL_APICALL GLint GL_APIENTRY glGetFragDataLocation(GLuint program, const char * name);
+GL_APICALL void GL_APIENTRY glGetInteger64v(GLenum pname, GLint64 * data);
+GL_APICALL void GL_APIENTRY glGetIntegeri_v(GLenum target, GLuint index, GLint * data);
+GL_APICALL void GL_APIENTRY glGetInteger64i_v(GLenum target, GLuint index, GLint64 * data);
+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 GLvoid * data);
+GL_APICALL void GL_APIENTRY glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+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 GLvoid * data);
+GL_APICALL void GL_APIENTRY glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * 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 GLvoid * data);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+} // namespace translator
+} // namespace gles2
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles_common_for_gles1_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles_common_for_gles1_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..e6c9d691ccc
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles_common_for_gles1_static_translator_namespaced_header.h
@@ -0,0 +1,83 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles_common_for_gles1.entries --output=include/OpenGLESDispatch/gles_common_for_gles1_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+#include <GLES/gl.h>
+// Return types must be single words, see GLDispatch.cpp
+typedef const GLubyte* GLconstubyteptr;
+namespace translator {
+namespace gles1 {
+GL_APICALL void GL_APIENTRY glActiveTexture(GLenum texture);
+GL_APICALL void GL_APIENTRY glBindBuffer(GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindTexture(GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendEquation(GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void GL_APIENTRY glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
+GL_APICALL void GL_APIENTRY glClear(GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_APICALL void GL_APIENTRY glClearDepth(GLclampd depth);
+GL_APICALL void GL_APIENTRY glClearDepthf(GLclampf depth);
+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 glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * 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 void GL_APIENTRY glCullFace(GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers(GLsizei n, const GLuint * buffers);
+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 glDepthRange(GLclampd zNear, GLclampd zFar);
+GL_APICALL void GL_APIENTRY glDepthRangef(GLclampf zNear, GLclampf zFar);
+GL_APICALL void GL_APIENTRY glDisable(GLenum cap);
+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 GLvoid * indices);
+GL_APICALL void GL_APIENTRY glEnable(GLenum cap);
+GL_APICALL void GL_APIENTRY glFinish();
+GL_APICALL void GL_APIENTRY glFlush();
+GL_APICALL void GL_APIENTRY glFrontFace(GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers(GLsizei n, GLuint * buffers);
+GL_APICALL void GL_APIENTRY glGenTextures(GLsizei n, GLuint * textures);
+GL_APICALL void GL_APIENTRY glGetBooleanv(GLenum pname, GLboolean * params);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv(GLenum buffer, GLenum parameter, GLint * value);
+GL_APICALL GLenum GL_APIENTRY glGetError();
+GL_APICALL void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat * params);
+GL_APICALL void GL_APIENTRY glGetIntegerv(GLenum pname, GLint * params);
+GL_APICALL GLconstubyteptr GL_APIENTRY glGetString(GLenum name);
+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 glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels);
+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 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 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 glIsTexture(GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth(GLfloat width);
+GL_APICALL void GL_APIENTRY glPolygonOffset(GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glPixelStorei(GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage(GLclampf value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glStencilFunc(GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask(GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels);
+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 GLvoid * pixels);
+GL_APICALL void GL_APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glPushAttrib(GLbitfield mask);
+GL_APICALL void GL_APIENTRY glPushClientAttrib(GLbitfield mask);
+GL_APICALL void GL_APIENTRY glPopAttrib();
+GL_APICALL void GL_APIENTRY glPopClientAttrib();
+} // namespace translator
+} // namespace gles1
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles_common_for_gles2_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles_common_for_gles2_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..eac87ae53ce
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles_common_for_gles2_static_translator_namespaced_header.h
@@ -0,0 +1,83 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles_common_for_gles2.entries --output=include/OpenGLESDispatch/gles_common_for_gles2_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+#include <GLES/gl.h>
+// Return types must be single words, see GLDispatch.cpp
+typedef const GLubyte* GLconstubyteptr;
+namespace translator {
+namespace gles2 {
+GL_APICALL void GL_APIENTRY glActiveTexture(GLenum texture);
+GL_APICALL void GL_APIENTRY glBindBuffer(GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindTexture(GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendEquation(GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void GL_APIENTRY glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
+GL_APICALL void GL_APIENTRY glClear(GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_APICALL void GL_APIENTRY glClearDepth(GLclampd depth);
+GL_APICALL void GL_APIENTRY glClearDepthf(GLclampf depth);
+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 glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * 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 void GL_APIENTRY glCullFace(GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers(GLsizei n, const GLuint * buffers);
+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 glDepthRange(GLclampd zNear, GLclampd zFar);
+GL_APICALL void GL_APIENTRY glDepthRangef(GLclampf zNear, GLclampf zFar);
+GL_APICALL void GL_APIENTRY glDisable(GLenum cap);
+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 GLvoid * indices);
+GL_APICALL void GL_APIENTRY glEnable(GLenum cap);
+GL_APICALL void GL_APIENTRY glFinish();
+GL_APICALL void GL_APIENTRY glFlush();
+GL_APICALL void GL_APIENTRY glFrontFace(GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers(GLsizei n, GLuint * buffers);
+GL_APICALL void GL_APIENTRY glGenTextures(GLsizei n, GLuint * textures);
+GL_APICALL void GL_APIENTRY glGetBooleanv(GLenum pname, GLboolean * params);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv(GLenum buffer, GLenum parameter, GLint * value);
+GL_APICALL GLenum GL_APIENTRY glGetError();
+GL_APICALL void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat * params);
+GL_APICALL void GL_APIENTRY glGetIntegerv(GLenum pname, GLint * params);
+GL_APICALL GLconstubyteptr GL_APIENTRY glGetString(GLenum name);
+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 glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels);
+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 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 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 glIsTexture(GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth(GLfloat width);
+GL_APICALL void GL_APIENTRY glPolygonOffset(GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glPixelStorei(GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage(GLclampf value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glStencilFunc(GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask(GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels);
+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 GLvoid * pixels);
+GL_APICALL void GL_APIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glPushAttrib(GLbitfield mask);
+GL_APICALL void GL_APIENTRY glPushClientAttrib(GLbitfield mask);
+GL_APICALL void GL_APIENTRY glPopAttrib();
+GL_APICALL void GL_APIENTRY glPopClientAttrib();
+} // namespace translator
+} // namespace gles2
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles_common_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles_common_functions.h
new file mode 100644
index 00000000000..3b3087f8f87
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles_common_functions.h
@@ -0,0 +1,84 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/gl/OpenGLESDispatch/gles_common.entries --output=include/OpenGLESDispatch/gles_common_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES_COMMON_FUNCTIONS_H
+#define GLES_COMMON_FUNCTIONS_H
+
+#include <GLES/gl.h>
+// Return types must be single words, see GLDispatch.cpp
+typedef const GLubyte* GLconstubyteptr;
+#define LIST_GLES_COMMON_FUNCTIONS(X) \
+ X(void, glActiveTexture, (GLenum texture), (texture)) \
+ X(void, glBindBuffer, (GLenum target, GLuint buffer), (target, buffer)) \
+ X(void, glBindTexture, (GLenum target, GLuint texture), (target, texture)) \
+ X(void, glBlendFunc, (GLenum sfactor, GLenum dfactor), (sfactor, dfactor)) \
+ X(void, glBlendEquation, (GLenum mode), (mode)) \
+ X(void, glBlendEquationSeparate, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha)) \
+ X(void, glBlendFuncSeparate, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha)) \
+ X(void, glBufferData, (GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage), (target, size, data, usage)) \
+ X(void, glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data), (target, offset, size, data)) \
+ X(void, glClear, (GLbitfield mask), (mask)) \
+ X(void, glClearColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), (red, green, blue, alpha)) \
+ X(void, glClearDepth, (GLclampd depth), (depth)) \
+ X(void, glClearDepthf, (GLclampf depth), (depth)) \
+ X(void, glClearStencil, (GLint s), (s)) \
+ X(void, glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha), (red, green, blue, alpha)) \
+ X(void, glCompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data), (target, level, internalformat, width, height, border, imageSize, data)) \
+ X(void, glCompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data), (target, level, xoffset, yoffset, width, height, format, imageSize, data)) \
+ X(void, glCopyTexImage2D, (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border), (target, level, internalFormat, x, y, width, height, border)) \
+ X(void, glCopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, x, y, width, height)) \
+ X(void, glCullFace, (GLenum mode), (mode)) \
+ X(void, glDeleteBuffers, (GLsizei n, const GLuint * buffers), (n, buffers)) \
+ X(void, glDeleteTextures, (GLsizei n, const GLuint * textures), (n, textures)) \
+ X(void, glDepthFunc, (GLenum func), (func)) \
+ X(void, glDepthMask, (GLboolean flag), (flag)) \
+ X(void, glDepthRange, (GLclampd zNear, GLclampd zFar), (zNear, zFar)) \
+ X(void, glDepthRangef, (GLclampf zNear, GLclampf zFar), (zNear, zFar)) \
+ X(void, glDisable, (GLenum cap), (cap)) \
+ X(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count), (mode, first, count)) \
+ X(void, glDrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid * indices), (mode, count, type, indices)) \
+ X(void, glEnable, (GLenum cap), (cap)) \
+ X(void, glFinish, (), ()) \
+ X(void, glFlush, (), ()) \
+ X(void, glFrontFace, (GLenum mode), (mode)) \
+ X(void, glGenBuffers, (GLsizei n, GLuint * buffers), (n, buffers)) \
+ X(void, glGenTextures, (GLsizei n, GLuint * textures), (n, textures)) \
+ X(void, glGetBooleanv, (GLenum pname, GLboolean * params), (pname, params)) \
+ X(void, glGetBufferParameteriv, (GLenum buffer, GLenum parameter, GLint * value), (buffer, parameter, value)) \
+ X(GLenum, glGetError, (), ()) \
+ X(void, glGetFloatv, (GLenum pname, GLfloat * params), (pname, params)) \
+ X(void, glGetIntegerv, (GLenum pname, GLint * params), (pname, params)) \
+ X(GLconstubyteptr, glGetString, (GLenum name), (name)) \
+ X(void, glTexParameterf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param)) \
+ X(void, glTexParameterfv, (GLenum target, GLenum pname, const GLfloat * params), (target, pname, params)) \
+ X(void, glGetTexImage, (GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels), (target, level, format, type, pixels)) \
+ X(void, glGetTexParameterfv, (GLenum target, GLenum pname, GLfloat * params), (target, pname, params)) \
+ X(void, glGetTexParameteriv, (GLenum target, GLenum pname, GLint * params), (target, pname, params)) \
+ X(void, glGetTexLevelParameteriv, (GLenum target, GLint level, GLenum pname, GLint * params), (target, level, pname, params)) \
+ X(void, glGetTexLevelParameterfv, (GLenum target, GLint level, GLenum pname, GLfloat * params), (target, level, pname, params)) \
+ X(void, glHint, (GLenum target, GLenum mode), (target, mode)) \
+ X(GLboolean, glIsBuffer, (GLuint buffer), (buffer)) \
+ X(GLboolean, glIsEnabled, (GLenum cap), (cap)) \
+ X(GLboolean, glIsTexture, (GLuint texture), (texture)) \
+ X(void, glLineWidth, (GLfloat width), (width)) \
+ X(void, glPolygonOffset, (GLfloat factor, GLfloat units), (factor, units)) \
+ X(void, glPixelStorei, (GLenum pname, GLint param), (pname, param)) \
+ X(void, glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels), (x, y, width, height, format, type, pixels)) \
+ X(void, glRenderbufferStorageMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height)) \
+ X(void, glSampleCoverage, (GLclampf value, GLboolean invert), (value, invert)) \
+ X(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height)) \
+ X(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask), (func, ref, mask)) \
+ X(void, glStencilMask, (GLuint mask), (mask)) \
+ X(void, glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass), (fail, zfail, zpass)) \
+ X(void, glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels), (target, level, internalformat, width, height, border, format, type, pixels)) \
+ X(void, glTexParameteri, (GLenum target, GLenum pname, GLint param), (target, pname, param)) \
+ X(void, glTexParameteriv, (GLenum target, GLenum pname, const GLint * params), (target, pname, params)) \
+ X(void, glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels), (target, level, xoffset, yoffset, width, height, format, type, pixels)) \
+ X(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height)) \
+ X(void, glPushAttrib, (GLbitfield mask), (mask)) \
+ X(void, glPushClientAttrib, (GLbitfield mask), (mask)) \
+ X(void, glPopAttrib, (), ()) \
+ X(void, glPopClientAttrib, (), ()) \
+
+
+#endif // GLES_COMMON_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles_extensions_for_gles1_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles_extensions_for_gles1_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..92bb280e52e
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles_extensions_for_gles1_static_translator_namespaced_header.h
@@ -0,0 +1,59 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles_extensions_for_gles1.entries --output=include/OpenGLESDispatch/gles_extensions_for_gles1_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+namespace translator {
+namespace gles1 {
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbufferEXT(GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebufferEXT(GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindFramebufferEXT(GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers);
+GL_APICALL void GL_APIENTRY glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatusEXT(GLenum target);
+GL_APICALL void GL_APIENTRY glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params);
+GL_APICALL void GL_APIENTRY glGenerateMipmapEXT(GLenum target);
+GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT();
+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, float * params);
+GL_APICALL void GL_APIENTRY glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint * params);
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
+GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
+GL_APICALL void GL_APIENTRY glDrawArraysNullAEMU(GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElementsNullAEMU(GLenum mode, GLsizei count, GLenum type, const void * indices);
+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 glImportMemoryFdEXT(GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
+GL_APICALL void GL_APIENTRY glImportMemoryWin32HandleEXT(GLuint memory, GLuint64 size, GLenum handleType, void* handle);
+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 glTexParameteriHOST(GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glImportSemaphoreFdEXT(GLuint semaphore, GLenum handleType, GLint fd);
+GL_APICALL void GL_APIENTRY glImportSemaphoreWin32HandleEXT(GLuint semaphore, GLenum handleType, void* handle);
+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);
+GL_APICALL GLuint GL_APIENTRY glGetGlobalTexName(GLuint localTexName);
+} // namespace translator
+} // namespace gles1
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles_extensions_for_gles2_static_translator_namespaced_header.h b/src/gfxstream/include/OpenGLESDispatch/gles_extensions_for_gles2_static_translator_namespaced_header.h
new file mode 100644
index 00000000000..6e4c6e585dc
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles_extensions_for_gles2_static_translator_namespaced_header.h
@@ -0,0 +1,59 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=static_translator_namespaced_header stream-servers/gl/OpenGLESDispatch/gles_extensions_for_gles2.entries --output=include/OpenGLESDispatch/gles_extensions_for_gles2_static_translator_namespaced_header.h
+// DO NOT EDIT THIS FILE
+
+#pragma once
+
+namespace translator {
+namespace gles2 {
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbufferEXT(GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebufferEXT(GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindFramebufferEXT(GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers);
+GL_APICALL void GL_APIENTRY glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatusEXT(GLenum target);
+GL_APICALL void GL_APIENTRY glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params);
+GL_APICALL void GL_APIENTRY glGenerateMipmapEXT(GLenum target);
+GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT();
+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, float * params);
+GL_APICALL void GL_APIENTRY glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint * params);
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
+GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
+GL_APICALL void GL_APIENTRY glDrawArraysNullAEMU(GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElementsNullAEMU(GLenum mode, GLsizei count, GLenum type, const void * indices);
+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 glImportMemoryFdEXT(GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
+GL_APICALL void GL_APIENTRY glImportMemoryWin32HandleEXT(GLuint memory, GLuint64 size, GLenum handleType, void* handle);
+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 glTexParameteriHOST(GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glImportSemaphoreFdEXT(GLuint semaphore, GLenum handleType, GLint fd);
+GL_APICALL void GL_APIENTRY glImportSemaphoreWin32HandleEXT(GLuint semaphore, GLenum handleType, void* handle);
+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);
+GL_APICALL GLuint GL_APIENTRY glGetGlobalTexName(GLuint localTexName);
+} // namespace translator
+} // namespace gles2
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles_extensions_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles_extensions_functions.h
new file mode 100644
index 00000000000..8aa705aefd7
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles_extensions_functions.h
@@ -0,0 +1,60 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs stream-servers/gl/OpenGLESDispatch/gles_extensions.entries --output=include/OpenGLESDispatch/gles_extensions_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef GLES_EXTENSIONS_FUNCTIONS_H
+#define GLES_EXTENSIONS_FUNCTIONS_H
+
+#define LIST_GLES_EXTENSIONS_FUNCTIONS(X) \
+ X(GLboolean, glIsRenderbufferEXT, (GLuint renderbuffer), (renderbuffer)) \
+ X(void, glBindRenderbufferEXT, (GLenum target, GLuint renderbuffer), (target, renderbuffer)) \
+ X(void, glDeleteRenderbuffersEXT, (GLsizei n, const GLuint * renderbuffers), (n, renderbuffers)) \
+ X(void, glGenRenderbuffersEXT, (GLsizei n, GLuint * renderbuffers), (n, renderbuffers)) \
+ X(void, glRenderbufferStorageEXT, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height)) \
+ X(void, glGetRenderbufferParameterivEXT, (GLenum target, GLenum pname, GLint * params), (target, pname, params)) \
+ X(GLboolean, glIsFramebufferEXT, (GLuint framebuffer), (framebuffer)) \
+ X(void, glBindFramebufferEXT, (GLenum target, GLuint framebuffer), (target, framebuffer)) \
+ X(void, glDeleteFramebuffersEXT, (GLsizei n, const GLuint * framebuffers), (n, framebuffers)) \
+ X(void, glGenFramebuffersEXT, (GLsizei n, GLuint * framebuffers), (n, framebuffers)) \
+ X(GLenum, glCheckFramebufferStatusEXT, (GLenum target), (target)) \
+ X(void, glFramebufferTexture1DEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level)) \
+ X(void, glFramebufferTexture2DEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level)) \
+ X(void, glFramebufferTexture3DEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset), (target, attachment, textarget, texture, level, zoffset)) \
+ X(void, glFramebufferRenderbufferEXT, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer)) \
+ X(void, glGetFramebufferAttachmentParameterivEXT, (GLenum target, GLenum attachment, GLenum pname, GLint * params), (target, attachment, pname, params)) \
+ X(void, glGenerateMipmapEXT, (GLenum target), (target)) \
+ X(GLenum, glGetGraphicsResetStatusEXT, (), ()) \
+ X(void, glReadnPixelsEXT, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data), (x, y, width, height, format, type, bufSize, data)) \
+ X(void, glGetnUniformfvEXT, (GLuint program, GLint location, GLsizei bufSize, float * params), (program, location, bufSize, params)) \
+ X(void, glGetnUniformivEXT, (GLuint program, GLint location, GLsizei bufSize, GLint * params), (program, location, bufSize, params)) \
+ X(void, glEGLImageTargetTexture2DOES, (GLenum target, GLeglImageOES image), (target, image)) \
+ X(void, glEGLImageTargetRenderbufferStorageOES, (GLenum target, GLeglImageOES image), (target, image)) \
+ X(void, glDrawArraysNullAEMU, (GLenum mode, GLint first, GLsizei count), (mode, first, count)) \
+ X(void, glDrawElementsNullAEMU, (GLenum mode, GLsizei count, GLenum type, const void * indices), (mode, count, type, indices)) \
+ X(void, glGetUnsignedBytevEXT, (GLenum pname, GLubyte* data), (pname, data)) \
+ X(void, glGetUnsignedBytei_vEXT, (GLenum target, GLuint index, GLubyte* data), (target, index, data)) \
+ X(void, glImportMemoryFdEXT, (GLuint memory, GLuint64 size, GLenum handleType, GLint fd), (memory, size, handleType, fd)) \
+ X(void, glImportMemoryWin32HandleEXT, (GLuint memory, GLuint64 size, GLenum handleType, void* handle), (memory, size, handleType, handle)) \
+ X(void, glDeleteMemoryObjectsEXT, (GLsizei n, const GLuint * memoryObjects), (n, memoryObjects)) \
+ X(GLboolean, glIsMemoryObjectEXT, (GLuint memoryObject), (memoryObject)) \
+ X(void, glCreateMemoryObjectsEXT, (GLsizei n, GLuint * memoryObjects), (n, memoryObjects)) \
+ X(void, glMemoryObjectParameterivEXT, (GLuint memoryObject, GLenum pname, const GLint * params), (memoryObject, pname, params)) \
+ X(void, glGetMemoryObjectParameterivEXT, (GLuint memoryObject, GLenum pname, GLint * params), (memoryObject, pname, params)) \
+ X(void, glTexStorageMem2DEXT, (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset), (target, levels, internalFormat, width, height, memory, offset)) \
+ X(void, glTexStorageMem2DMultisampleEXT, (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset), (target, samples, internalFormat, width, height, fixedSampleLocations, memory, offset)) \
+ X(void, glTexStorageMem3DEXT, (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset), (target, levels, internalFormat, width, height, depth, memory, offset)) \
+ X(void, glTexStorageMem3DMultisampleEXT, (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset), (target, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset)) \
+ X(void, glBufferStorageMemEXT, (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset), (target, size, memory, offset)) \
+ X(void, glTexParameteriHOST, (GLenum target, GLenum pname, GLint param), (target, pname, param)) \
+ X(void, glImportSemaphoreFdEXT, (GLuint semaphore, GLenum handleType, GLint fd), (semaphore, handleType, fd)) \
+ X(void, glImportSemaphoreWin32HandleEXT, (GLuint semaphore, GLenum handleType, void* handle), (semaphore, handleType, handle)) \
+ X(void, glGenSemaphoresEXT, (GLsizei n, GLuint * semaphores), (n, semaphores)) \
+ X(void, glDeleteSemaphoresEXT, (GLsizei n, const GLuint * semaphores), (n, semaphores)) \
+ X(GLboolean, glIsSemaphoreEXT, (GLuint semaphore), (semaphore)) \
+ X(void, glSemaphoreParameterui64vEXT, (GLuint semaphore, GLenum pname, const GLuint64 * params), (semaphore, pname, params)) \
+ X(void, glGetSemaphoreParameterui64vEXT, (GLuint semaphore, GLenum pname, GLuint64 * params), (semaphore, pname, params)) \
+ X(void, glWaitSemaphoreEXT, (GLuint semaphore, GLuint numBufferBarriers, const GLuint * buffers, GLuint numTextureBarriers, const GLuint * textures, const GLenum * srcLayouts), (semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, srcLayouts)) \
+ X(void, glSignalSemaphoreEXT, (GLuint semaphore, GLuint numBufferBarriers, const GLuint * buffers, GLuint numTextureBarriers, const GLuint * textures, const GLenum * dstLayouts), (semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, dstLayouts)) \
+ X(GLuint, glGetGlobalTexName, (GLuint localTexName), (localTexName)) \
+
+
+#endif // GLES_EXTENSIONS_FUNCTIONS_H
diff --git a/src/gfxstream/include/OpenGLESDispatch/gles_functions.h b/src/gfxstream/include/OpenGLESDispatch/gles_functions.h
new file mode 100644
index 00000000000..f59bf230332
--- /dev/null
+++ b/src/gfxstream/include/OpenGLESDispatch/gles_functions.h
@@ -0,0 +1,62 @@
+// 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.
+
+#pragma once
+
+#include "OpenGLESDispatch/gles_common_functions.h"
+#include "OpenGLESDispatch/gles_extensions_functions.h"
+#include "OpenGLESDispatch/gles1_only_functions.h"
+#include "OpenGLESDispatch/gles1_extensions_functions.h"
+#include "OpenGLESDispatch/gles12tr.h"
+#include "OpenGLESDispatch/gles2_only_functions.h"
+#include "OpenGLESDispatch/gles2_extensions_functions.h"
+#include "OpenGLESDispatch/gles3_only_functions.h"
+#include "OpenGLESDispatch/gles3_extensions_functions.h"
+#include "OpenGLESDispatch/gles31_only_functions.h"
+#include "OpenGLESDispatch/gles32_only_functions.h"
+
+// As a special case, LIST_GLES3_ONLY_FUNCTIONS below uses the Y parameter
+// instead of the X one, meaning that the corresponding functions are
+// optional extensions. For example, glGetStringi is part of GLESv3
+// and is not always provided by host desktop GL drivers.
+// If there are any more GLES3 functions on top of that, they're assumed
+// to extend the GLES2 driver.
+#define LIST_GLES_FUNCTIONS(X,Y) \
+ LIST_GLES_COMMON_FUNCTIONS(X) \
+ LIST_GLES_EXTENSIONS_FUNCTIONS(Y) \
+ LIST_GLES1_ONLY_FUNCTIONS(X) \
+ LIST_GLES1_EXTENSIONS_FUNCTIONS(Y) \
+ LIST_GLES2_ONLY_FUNCTIONS(X) \
+ LIST_GLES2_EXTENSIONS_FUNCTIONS(Y) \
+ LIST_GLES3_ONLY_FUNCTIONS(Y) \
+ LIST_GLES3_EXTENSIONS_FUNCTIONS(Y) \
+ LIST_GLES31_ONLY_FUNCTIONS(Y) \
+ LIST_GLES32_ONLY_FUNCTIONS(Y) \
+
+#define LIST_GLES1_FUNCTIONS(X, Y) \
+ LIST_GLES_COMMON_FUNCTIONS(X) \
+ LIST_GLES_EXTENSIONS_FUNCTIONS(Y) \
+ LIST_GLES1_ONLY_FUNCTIONS(X) \
+ LIST_GLES1_EXTENSIONS_FUNCTIONS(Y) \
+
+#define LIST_GLES2_FUNCTIONS(X, Y) \
+ LIST_GLES_COMMON_FUNCTIONS(X) \
+ LIST_GLES_EXTENSIONS_FUNCTIONS(Y) \
+ LIST_GLES2_ONLY_FUNCTIONS(X) \
+ LIST_GLES2_EXTENSIONS_FUNCTIONS(Y) \
+ LIST_GLES3_ONLY_FUNCTIONS(Y) \
+ LIST_GLES3_EXTENSIONS_FUNCTIONS(Y) \
+ LIST_GLES31_ONLY_FUNCTIONS(Y) \
+ LIST_GLES32_ONLY_FUNCTIONS(Y) \
+
diff --git a/src/gfxstream/include/render-utils/IOStream.h b/src/gfxstream/include/render-utils/IOStream.h
new file mode 100644
index 00000000000..6538dcbfb9f
--- /dev/null
+++ b/src/gfxstream/include/render-utils/IOStream.h
@@ -0,0 +1,116 @@
+/*
+* 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.
+*/
+#pragma once
+
+#include "aemu/base/files/Stream.h"
+#include "host-common/logging.h"
+
+#include <assert.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+namespace gfxstream {
+
+class IOStream {
+protected:
+ explicit IOStream(size_t bufSize) : m_bufsize(bufSize) {}
+
+ ~IOStream() {
+ // NOTE: m_buf was owned by the child class thus we expect it to be
+ // released before the object destruction.
+ }
+
+public:
+ virtual void *allocBuffer(size_t minSize) = 0;
+ virtual int commitBuffer(size_t size) = 0;
+ virtual int writeFully(const void* buf, size_t len) = 0;
+ virtual const unsigned char *readFully( void *buf, size_t len) = 0;
+
+ size_t read(void* buf, size_t bufLen) {
+ if (!readRaw(buf, &bufLen)) {
+ return 0;
+ }
+ return bufLen;
+ }
+
+ unsigned char* alloc(size_t len) {
+ if (m_buf && len > m_free) {
+ if (flush() < 0) {
+ ERR("Failed to flush in alloc\n");
+ return NULL; // we failed to flush so something is wrong
+ }
+ }
+
+ if (!m_buf || len > m_bufsize) {
+ int allocLen = m_bufsize < len ? len : m_bufsize;
+ m_buf = (unsigned char *)allocBuffer(allocLen);
+ if (!m_buf) {
+ ERR("Alloc (%u bytes) failed\n", allocLen);
+ return NULL;
+ }
+ m_bufsize = m_free = allocLen;
+ }
+
+ unsigned char* ptr = m_buf + (m_bufsize - m_free);
+ m_free -= len;
+
+ return ptr;
+ }
+
+ int flush() {
+ if (!m_buf || m_free == m_bufsize) return 0;
+
+ int stat = commitBuffer(m_bufsize - m_free);
+ m_buf = NULL;
+ m_free = 0;
+ return stat;
+ }
+
+ const unsigned char *readback(void *buf, size_t len) {
+ flush();
+ return readFully(buf, len);
+ }
+
+ void save(android::base::Stream* stream) {
+ stream->putBe32(m_bufsize);
+ stream->putBe32(m_free);
+ stream->putByte(m_buf != nullptr);
+ onSave(stream);
+ }
+
+ void load(android::base::Stream* stream) {
+ m_bufsize = stream->getBe32();
+ m_free = stream->getBe32();
+ const bool haveBuf = stream->getByte();
+ const auto buf = onLoad(stream);
+ m_buf = haveBuf ? buf : nullptr;
+ }
+
+ virtual void* getDmaForReading(uint64_t guest_paddr) = 0;
+ virtual void unlockDma(uint64_t guest_paddr) = 0;
+
+protected:
+ virtual const unsigned char *readRaw(void *buf, size_t *inout_len) = 0;
+ virtual void onSave(android::base::Stream* stream) = 0;
+ virtual unsigned char* onLoad(android::base::Stream* stream) = 0;
+
+ unsigned char* m_buf = nullptr;
+ size_t m_bufsize;
+ size_t m_free = 0;
+};
+
+} // namespace gfxstream \ No newline at end of file
diff --git a/src/gfxstream/include/render-utils/MediaNative.h b/src/gfxstream/include/render-utils/MediaNative.h
new file mode 100644
index 00000000000..f060e98e531
--- /dev/null
+++ b/src/gfxstream/include/render-utils/MediaNative.h
@@ -0,0 +1,40 @@
+/*
+* 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.
+*/
+#pragma once
+
+// media decoding related common declaration
+
+extern "C" {
+typedef void (*yuv_updater_t)(void* privData,
+ uint32_t type,
+ uint32_t* textures,
+ void* callerData);
+#ifdef __APPLE__
+void nsConvertVideoFrameToNV12Textures(void* context,
+ void* iosurface,
+ int Ytex,
+ int UVtex);
+typedef void (*convertNV21Func)(void* context,
+ void* iosurface,
+ int Ytex,
+ int UVtex);
+struct MediaNativeCallerData {
+ void* ctx;
+ convertNV21Func converter;
+};
+
+#endif
+}
diff --git a/src/gfxstream/include/render-utils/RenderChannel.h b/src/gfxstream/include/render-utils/RenderChannel.h
new file mode 100644
index 00000000000..02918f4a6b5
--- /dev/null
+++ b/src/gfxstream/include/render-utils/RenderChannel.h
@@ -0,0 +1,126 @@
+// 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 "aemu/base/EnumFlags.h"
+#include "aemu/base/containers/SmallVector.h"
+#include "aemu/base/files/Stream.h"
+#include "aemu/base/containers/BufferQueue.h"
+
+#include <functional>
+#include <memory>
+
+namespace gfxstream {
+
+// Turn the RenderChannel::State enum into flags.
+using namespace ::android::base::EnumFlags;
+
+// RenderChannel - For each guest-to-host renderer connection, this provides
+// an interface for the guest side to interact with the corresponding renderer
+// thread on the host. Its main purpose is to send and receive wire protocol
+// bytes in an asynchronous way (compatible with Android pipes).
+//
+// Usage is the following:
+// 1) Get an instance pointer through a dedicated Renderer function
+// (e.g. RendererImpl::createRenderChannel()).
+//
+// 2) Call setEventCallback() to indicate which callback should be called
+// when the channel's state has changed due to a host thread event.
+//
+class RenderChannel {
+public:
+ // A type used to pass byte packets between the guest and the
+ // RenderChannel instance. Experience has shown that using a
+ // SmallFixedVector<char, N> instance instead of a std::vector<char>
+ // avoids a lot of un-necessary heap allocations. The current size
+ // of 512 was selected after profiling existing traffic, including
+ // the one used in protocol-heavy benchmark like Antutu3D.
+ using Buffer = android::base::SmallFixedVector<char, 512>;
+
+ // Bit-flags for the channel state.
+ // |CanRead| means there is data from the host to read.
+ // |CanWrite| means there is room to send data to the host.
+ // |Stopped| means the channel was stopped.
+ enum class State {
+ // Can't use None here, some system header declares it as a macro.
+ Empty = 0,
+ CanRead = 1 << 0,
+ CanWrite = 1 << 1,
+ Stopped = 1 << 2,
+ };
+
+ using IoResult = android::base::BufferQueueResult;
+ using Duration = uint64_t;
+
+ // Type of a callback used to tell the guest when the RenderChannel
+ // state changes. Used by setEventCallback(). The parameter contains
+ // the State bits matching the event, i.e. it is the logical AND of
+ // the last value passed to setWantedEvents() and the current
+ // RenderChannel state.
+ using EventCallback = std::function<void(State)>;
+
+ // Sets a single (!) callback that is called when the channel state's
+ // changes due to an event *from* *the* *host* only. |callback| is a
+ // guest-provided callback that will be called from the host renderer
+ // thread, not the guest one.
+ virtual void setEventCallback(EventCallback&& callback) = 0;
+
+ // Used to indicate which i/o events the guest wants to be notified
+ // through its StateChangeCallback. |state| must be a combination of
+ // State::CanRead or State::CanWrite only. This will *not* call the
+ // callback directly since this happens in the guest thread.
+ virtual void setWantedEvents(State state) = 0;
+
+ // Get the current state flags.
+ virtual State state() const = 0;
+
+ // Try to writes the data in |buffer| into the channel. On success,
+ // return IoResult::Ok and moves |buffer|. On failure, return
+ // IoResult::TryAgain if the channel was full, or IoResult::Error
+ // if it is stopped.
+ virtual IoResult tryWrite(Buffer&& buffer) = 0;
+
+ // Blocking call that waits until able to write into the channel.
+ virtual void waitUntilWritable() = 0;
+
+ // Try to read data from the channel. On success, return IoResult::Ok and
+ // sets |*buffer| to contain the data. On failure, return
+ // IoResult::TryAgain if the channel was empty, or IoResult::Error if
+ // it was stopped.
+ virtual IoResult tryRead(Buffer* buffer) = 0;
+
+ // Try to read data from the channel. On success, return IoResult::Ok and
+ // sets |*buffer| to contain the data. On failure, return IoResult::Error
+ // if it was stopped. Returns IoResult::Timeout if we waited passed
+ // waitUntilUs.
+ virtual IoResult readBefore(Buffer* buffer, Duration waitUntilUs) = 0;
+
+ // Blocking call that waits until data is available to read from the channel.
+ virtual void waitUntilReadable() = 0;
+
+ // Abort all pending operations. Any following operation is a noop.
+ // Once a channel is stopped, it cannot be re-started.
+ virtual void stop() = 0;
+
+ // Callback function when snapshotting the virtual machine.
+ virtual void onSave(android::base::Stream* stream) = 0;
+
+protected:
+ ~RenderChannel() = default;
+};
+
+// Shared pointer to RenderChannel instance.
+using RenderChannelPtr = std::shared_ptr<RenderChannel>;
+
+} // namespace gfxstream
diff --git a/src/gfxstream/include/render-utils/RenderLib.h b/src/gfxstream/include/render-utils/RenderLib.h
new file mode 100644
index 00000000000..eb44b62c037
--- /dev/null
+++ b/src/gfxstream/include/render-utils/RenderLib.h
@@ -0,0 +1,116 @@
+// 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 <memory>
+
+#include "aemu/base/files/Stream.h"
+#include "host-common/crash_reporter.h"
+#include "host-common/dma_device.h"
+#include "host-common/multi_display_agent.h"
+#include "host-common/RefcountPipe.h"
+#include "host-common/sync_device.h"
+#include "host-common/vm_operations.h"
+#include "host-common/window_agent.h"
+#include "host-common/opengl/emugl_config.h"
+#include "render-utils/Renderer.h"
+#include "render-utils/render_api_types.h"
+
+extern "C" {
+
+struct address_space_device_control_ops;
+
+} // extern "C"
+
+namespace android {
+namespace base {
+
+class CpuUsage;
+class MemoryTracker;
+class GLObjectCounter;
+
+} // namespace base
+} // namespace android
+
+namespace gfxstream {
+
+struct RenderOpt {
+ void* display;
+ void* surface;
+ void* config;
+};
+
+using android::emulation::OnLastColorBufferRef;
+
+// RenderLib - root interface for the GPU emulation library
+// Use it to set the library-wide parameters (logging, crash reporting) and
+// create indivudual renderers that take care of drawing windows.
+class RenderLib {
+public:
+ virtual ~RenderLib() = default;
+
+ // Get the selected renderer
+ virtual void setRenderer(SelectedRenderer renderer) = 0;
+ // Tell emugl the API version of the system image
+ virtual void setAvdInfo(bool phone, int api) = 0;
+ // Get the GLES major/minor version determined by libOpenglRender.
+ virtual void getGlesVersion(int* maj, int* min) = 0;
+ virtual void setLogger(emugl_logger_struct logger) = 0;
+ virtual void setGLObjectCounter(
+ android::base::GLObjectCounter* counter) = 0;
+ virtual void setCrashReporter(emugl_crash_reporter_t reporter) = 0;
+ virtual void setFeatureController(emugl_feature_is_enabled_t featureController) = 0;
+ virtual void setSyncDevice(emugl_sync_create_timeline_t,
+ emugl_sync_create_fence_t,
+ emugl_sync_timeline_inc_t,
+ emugl_sync_destroy_timeline_t,
+ emugl_sync_register_trigger_wait_t,
+ emugl_sync_device_exists_t) = 0;
+
+ // Sets the function use to read from the guest
+ // physically contiguous DMA region at particular offsets.
+ virtual void setDmaOps(emugl_dma_ops) = 0;
+
+ virtual void setVmOps(const QAndroidVmOperations &vm_operations) = 0;
+ virtual void setAddressSpaceDeviceControlOps(struct address_space_device_control_ops* ops) = 0;
+
+ virtual void setWindowOps(const QAndroidEmulatorWindowAgent &window_operations,
+ const QAndroidMultiDisplayAgent &multi_display_operations) = 0;
+
+ virtual void setUsageTracker(android::base::CpuUsage* cpuUsage,
+ android::base::MemoryTracker* memUsage) = 0;
+
+ virtual void setGrallocImplementation(GrallocImplementation gralloc) = 0;
+
+ virtual bool getOpt(RenderOpt* opt) = 0;
+
+ // initRenderer - initialize the OpenGL renderer object.
+ //
+ // |width| and |height| are the framebuffer dimensions that will be reported
+ // to the guest display driver.
+ //
+ // |useSubWindow| is true to indicate that renderer has to support an
+ // OpenGL subwindow. If false, it only supports setPostCallback().
+ // See Renderer.h for more info.
+ //
+ // There might be only one renderer.
+ virtual RendererPtr initRenderer(int width, int height,
+ bool useSubWindow, bool egl2egl) = 0;
+
+ virtual OnLastColorBufferRef getOnLastColorBufferRef() = 0;
+};
+
+using RenderLibPtr = std::unique_ptr<RenderLib>;
+
+} // namespace gfxstream
diff --git a/src/gfxstream/include/render-utils/Renderer.h b/src/gfxstream/include/render-utils/Renderer.h
new file mode 100644
index 00000000000..7520d9e36a2
--- /dev/null
+++ b/src/gfxstream/include/render-utils/Renderer.h
@@ -0,0 +1,328 @@
+// 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 "aemu/base/files/Stream.h"
+#include "aemu/base/ring_buffer.h"
+#include "host-common/address_space_graphics_types.h"
+#include "render-utils/RenderChannel.h"
+#include "render-utils/render_api_platform_types.h"
+#include "render-utils/virtio_gpu_ops.h"
+#include "snapshot/common.h"
+
+#include <functional>
+#include <memory>
+#include <optional>
+#include <string>
+
+namespace android_studio {
+class EmulatorGLESUsages;
+}
+
+namespace gfxstream {
+
+typedef struct {
+ int x, y;
+} Pos;
+
+typedef struct {
+ int w, h;
+} Size;
+
+// A structure used to model a rectangle in pixels.
+// |pos| is the location of the rectangle's origin (top-left corner).
+// |size| is the dimension in integer pixels of the rectangle.
+typedef struct {
+ Pos pos;
+ Size size;
+} Rect;
+
+enum class FrameBufferChange {
+ FrameReady = 0,
+};
+
+struct FrameBufferChangeEvent {
+ FrameBufferChange change;
+ uint64_t frameNumber;
+};
+
+// Renderer - an object that manages a single OpenGL window used for drawing
+// and is able to create individual render channels for that window.
+//
+class Renderer {
+public:
+ // createRenderChannel - create a separate channel for the rendering data.
+ // This call instantiates a new object that waits for the serialized data
+ // from the guest, deserializes it, executes the passed GL commands and
+ // returns the results back.
+ // |loadStream| - if not NULL, RenderChannel uses it to load saved state
+ // asynchronously on its own thread. |loadStream| can be used right after
+ // the call as all the required data is copied here synchronously.
+ virtual RenderChannelPtr createRenderChannel(
+ android::base::Stream* loadStream = nullptr,
+ uint32_t virtioGpuContextId = -1) = 0;
+
+ // analog of createRenderChannel, but for the address space graphics device
+ virtual void* addressSpaceGraphicsConsumerCreate(
+ struct asg_context,
+ android::base::Stream* loadStream,
+ android::emulation::asg::ConsumerCallbacks,
+ uint32_t contextId, uint32_t capsetId,
+ std::optional<std::string> nameOpt) = 0;
+ virtual void addressSpaceGraphicsConsumerDestroy(void*) = 0;
+ virtual void addressSpaceGraphicsConsumerPreSave(void* consumer) = 0;
+ virtual void addressSpaceGraphicsConsumerSave(
+ void* consumer,
+ android::base::Stream* stream) = 0;
+ virtual void addressSpaceGraphicsConsumerPostSave(void* consumer) = 0;
+ virtual void addressSpaceGraphicsConsumerRegisterPostLoadRenderThread(
+ void* consumer) = 0;
+
+ // getHardwareStrings - describe the GPU hardware and driver.
+ // The underlying GL's vendor/renderer/version strings are returned to the
+ // caller.
+ struct HardwareStrings {
+ std::string vendor;
+ std::string renderer;
+ std::string version;
+ };
+ virtual HardwareStrings getHardwareStrings() = 0;
+
+ // A per-frame callback can be registered with setPostCallback(); to remove
+ // it pass an empty callback. While a callback is registered, the renderer
+ // will call it just before each new frame is displayed, providing a copy of
+ // the framebuffer contents.
+ //
+ // The callback will be called from one of the renderer's threads, so will
+ // probably need synchronization on any data structures it modifies. The
+ // pixels buffer may be overwritten as soon as the callback returns; it
+ // doesn't need to be synchronized, but if the callback needs the pixels
+ // afterwards it must copy them.
+ //
+ // The pixels buffer is intentionally not const: the callback may modify the
+ // data without copying to another buffer if it wants, e.g. in-place RGBA to
+ // RGB conversion, or in-place y-inversion.
+ //
+ // Parameters are:
+ // displayId Default is 0. Can also be 1 to 10 if multi display
+ // configured.
+ // width, height Dimensions of the image, in pixels. Rows are tightly
+ // packed; there is no inter-row padding.
+ // ydir Indicates row order: 1 means top-to-bottom order, -1
+ // means bottom-to-top order.
+ // format, type Format and type GL enums, as used in glTexImage2D() or
+ // glReadPixels(), describing the pixel format.
+ // pixels The framebuffer image.
+ //
+ // In the first implementation, ydir is always -1 (bottom to top), format
+ // and type are always GL_RGBA and GL_UNSIGNED_BYTE, and the width and
+ // height will always be the same as the ones used to create the renderer.
+ using OnPostCallback = void (*)(void* context,
+ uint32_t displayId,
+ int width,
+ int height,
+ int ydir,
+ int format,
+ int type,
+ unsigned char* pixels);
+ virtual void setPostCallback(OnPostCallback onPost,
+ void* context,
+ bool useBgraReadback,
+ uint32_t displayId) = 0;
+
+ using FrameBufferChangeEventListener =
+ std::function<void(const FrameBufferChangeEvent evt)>;
+
+ // Adds a FramebufferChangeEventListener. The listener will be invoked
+ // whenever a new frame has been made available and is to be rendered on
+ // screen. You should do as little work as possible on this callback.
+ virtual void addListener(FrameBufferChangeEventListener* listener) = 0;
+
+ // Removes the listener.
+ virtual void removeListener(FrameBufferChangeEventListener* listener) = 0;
+
+ // Async readback API
+ virtual bool asyncReadbackSupported() = 0;
+
+ // Separate callback to get RGBA Pixels in async readback mode.
+ using ReadPixelsCallback = void (*)(void* pixels,
+ uint32_t bytes,
+ uint32_t displayId);
+ virtual ReadPixelsCallback getReadPixelsCallback() = 0;
+
+ using FlushReadPixelPipeline = void (*)(int displayId);
+ // Flushes the pipeline by duplicating the last frame and informing
+ // the async callback that a new frame is available if no reads are
+ // active
+ virtual FlushReadPixelPipeline getFlushReadPixelPipeline() = 0;
+
+ // showOpenGLSubwindow -
+ // Create or modify a native subwindow which is a child of 'window'
+ // to be used for framebuffer display. If a subwindow already exists,
+ // its properties will be updated to match the given parameters.
+ // wx,wy is the top left corner of the rendering subwindow.
+ // ww,wh are the dimensions of the rendering subwindow.
+ // fbw,fbh are the dimensions of the underlying guest framebuffer.
+ // dpr is the device pixel ratio, which is needed for higher density
+ // displays like retina.
+ // zRot is the rotation to apply on the framebuffer display image.
+ //
+ // Return true on success, false on failure, which can happen when using
+ // a software-only renderer like OSMesa. In this case, the client should
+ // call setPostCallback to get the content of each new frame when it is
+ // posted, and will be responsible for displaying it.
+ virtual bool showOpenGLSubwindow(FBNativeWindowType window,
+ int wx,
+ int wy,
+ int ww,
+ int wh,
+ int fbw,
+ int fbh,
+ float dpr,
+ float zRot,
+ bool deleteExisting,
+ bool hideWindow) = 0;
+
+ // destroyOpenGLSubwindow -
+ // destroys the created native subwindow. Once destroyed,
+ // Framebuffer content will not be visible until a new
+ // subwindow will be created.
+ virtual bool destroyOpenGLSubwindow() = 0;
+
+ // setOpenGLDisplayRotation -
+ // set the framebuffer display image rotation in units
+ // of degrees around the z axis
+ virtual void setOpenGLDisplayRotation(float zRot) = 0;
+
+ // setOpenGLDisplayTranslation
+ // change what coordinate of the guest framebuffer will be displayed at
+ // the corner of the GPU sub-window. Specifically, |px| and |py| = 0
+ // means
+ // align the bottom-left of the framebuffer with the bottom-left of the
+ // sub-window, and |px| and |py| = 1 means align the top right of the
+ // framebuffer with the top right of the sub-window. Intermediate values
+ // interpolate between these states.
+ virtual void setOpenGLDisplayTranslation(float px, float py) = 0;
+
+ // repaintOpenGLDisplay -
+ // causes the OpenGL subwindow to get repainted with the
+ // latest framebuffer content.
+ virtual void repaintOpenGLDisplay() = 0;
+
+ // hasGuestPostedAFrame / resetGuestPostedAFrame -
+ // for liveness checking; queries whether or not the guest
+ // has successfully issued a framebuffer post to the emulator,
+ // and a method to reset that state.
+ virtual bool hasGuestPostedAFrame() = 0;
+ virtual void resetGuestPostedAFrame() = 0;
+
+ // setScreenMask -
+ // provide the image that should be overlayed on the
+ // device screen to mask that screen
+ virtual void setScreenMask(int width,
+ int height,
+ const unsigned char* rgbaData) = 0;
+
+ // setMultiDisplay
+ // add/modify/del multi-display window
+ virtual void setMultiDisplay(uint32_t id,
+ int32_t x,
+ int32_t y,
+ uint32_t w,
+ uint32_t h,
+ uint32_t dpi,
+ bool add) = 0;
+ // setMultiDisplayColorBuffer
+ // bind ColorBuffer to the display
+ virtual void setMultiDisplayColorBuffer(uint32_t id, uint32_t cb) = 0;
+
+ // onGuestGraphicsProcessCreate
+ // Notify the renderer that a new graphics process is created. Used to create process
+ // specific resources.
+ virtual void onGuestGraphicsProcessCreate(uint64_t puid) = 0;
+ // cleanupProcGLObjects -
+ // clean up all per-process resources when guest process exits (or is
+ // killed). Such resources include color buffer handles and EglImage handles.
+ // TODO(kaiyili): rename this interface to onGuestGraphicsProcessDestroy.
+ virtual void cleanupProcGLObjects(uint64_t puid) = 0;
+
+ // Wait for cleanupProcGLObjects to finish.
+ virtual void waitForProcessCleanup() = 0;
+
+ virtual struct AndroidVirtioGpuOps* getVirtioGpuOps(void) = 0;
+
+ // Stops all channels and render threads. The renderer cannot be used after
+ // stopped.
+ virtual void stop(bool wait) = 0;
+
+ // Waits for all channels to finish and deletes all render threads.
+ // The renderer can still be used after finish().
+ virtual void finish() = 0;
+
+ // Pauses all channels to prepare for snapshot saving.
+ virtual void pauseAllPreSave() = 0;
+
+ // Resumes all channels after snapshot saving or loading.
+ virtual void resumeAll(bool waitForSave = true) = 0;
+
+ virtual void save(
+ android::base::Stream* stream,
+ const android::snapshot::ITextureSaverPtr& textureSaver) = 0;
+ virtual bool load(
+ android::base::Stream* stream,
+ const android::snapshot::ITextureLoaderPtr& textureLoader) = 0;
+
+ // Fill GLES usage protobuf
+ virtual void fillGLESUsages(android_studio::EmulatorGLESUsages*) = 0;
+
+ // Saves a screenshot of the previous frame.
+ // nChannels should be 3 (RGB) or 4 (RGBA).
+ // You must provide a pre-allocated buffer of sufficient
+ // size. Returns 0 on success. In the case of failure and if *cPixels != 0
+ // you can call this function again with a buffer of size *cPixels. cPixels
+ // should usually be at at least desiredWidth * desiredHeight * nChannels.
+ //
+ // In practice the buffer should be > desiredWidth *
+ // desiredHeight * nChannels.
+ //
+ // Note: Do not call this function again if it fails and *cPixels == 0
+ // swiftshader_indirect does not work with 3 channels
+ //
+ // This function supports rectangle snipping by
+ // providing an |rect| parameter. The default value of {{0,0}, {0,0}}
+ // indicates the users wants to snip the entire screen.
+ // - |rect| represents a rectangle within the screen defined by
+ // desiredWidth and desiredHeight.
+ virtual int getScreenshot(unsigned int nChannels, unsigned int* width, unsigned int* height,
+ uint8_t* pixels, size_t* cPixels, int displayId = 0,
+ int desiredWidth = 0, int desiredHeight = 0, int desiredRotation = 0,
+ Rect rect = {{0, 0}, {0, 0}}) = 0;
+ virtual void snapshotOperationCallback(
+ int snapshotterOp,
+ int snapshotterStage) = 0;
+
+ virtual void setVsyncHz(int vsyncHz) = 0;
+ virtual void setDisplayConfigs(int configId, int w, int h, int dpiX, int dpiY) = 0;
+ virtual void setDisplayActiveConfig(int configId) = 0;
+
+ virtual const void* getEglDispatch() = 0;
+ virtual const void* getGles2Dispatch() = 0;
+
+protected:
+ ~Renderer() = default;
+};
+
+using RendererPtr = std::shared_ptr<Renderer>;
+
+} // namespace gfxstream
diff --git a/src/gfxstream/include/render-utils/render_api.h b/src/gfxstream/include/render-utils/render_api.h
new file mode 100644
index 00000000000..653d0ccd430
--- /dev/null
+++ b/src/gfxstream/include/render-utils/render_api.h
@@ -0,0 +1,50 @@
+/*
+* 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.
+*/
+#pragma once
+
+#include "render-utils/render_api_functions.h"
+
+#include "aemu/base/c_header.h"
+
+#include <KHR/khrplatform.h>
+
+// All interfaces which can fail return an int, with zero indicating failure
+// and anything else indicating success.
+
+#ifndef USING_ANDROID_BP
+ANDROID_BEGIN_HEADER
+#endif
+
+namespace gfxstream {
+
+// Use KHRONOS_APICALL to control visibility, but do not use KHRONOS_APIENTRY
+// because we don't need the functions to be __stdcall on Win32.
+#define RENDER_APICALL KHRONOS_APICALL
+#define RENDER_APIENTRY
+
+#define RENDER_API_DECLARE(return_type, func_name, signature, callargs) \
+ typedef return_type (RENDER_APIENTRY *func_name ## Fn) signature; \
+ RENDER_APICALL return_type RENDER_APIENTRY func_name signature;
+
+LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
+
+RENDER_APICALL RenderLibPtr RENDER_APIENTRY initLibrary();
+
+} // namespace gfxstream
+
+#ifndef USING_ANDROID_BP
+ANDROID_END_HEADER
+#endif
diff --git a/src/gfxstream/include/render-utils/render_api_functions.h b/src/gfxstream/include/render-utils/render_api_functions.h
new file mode 100644
index 00000000000..aa5824bf942
--- /dev/null
+++ b/src/gfxstream/include/render-utils/render_api_functions.h
@@ -0,0 +1,11 @@
+// Auto-generated with: android/scripts/gen-entries.py --mode=funcargs android/android-emugl/host/libs/libOpenglRender/render_api.entries --output=android/android-emugl/host/include/OpenglRender/render_api_functions.h
+// DO NOT EDIT THIS FILE
+
+#ifndef RENDER_API_FUNCTIONS_H
+#define RENDER_API_FUNCTIONS_H
+
+#include "render-utils/RenderLib.h"
+
+#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
+
+#endif // RENDER_API_FUNCTIONS_H
diff --git a/src/gfxstream/include/render-utils/render_api_platform_types.h b/src/gfxstream/include/render-utils/render_api_platform_types.h
new file mode 100644
index 00000000000..17506c29baf
--- /dev/null
+++ b/src/gfxstream/include/render-utils/render_api_platform_types.h
@@ -0,0 +1,46 @@
+/*
+* 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.
+*/
+
+#pragma once
+
+// Define FBNativeWindowType which corresponds to the type of native
+// host UI window handles.
+
+#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
+#include <windows.h>
+
+typedef HWND FBNativeWindowType;
+#elif defined(ANDROID)
+#include <android/native_window.h>
+typedef ANativeWindow* FBNativeWindowType;
+#elif defined(__linux__)
+
+// Really a Window handle, but we don't want to include the X11 headers here.
+#include <stdint.h>
+typedef uint32_t FBNativeWindowType;
+
+#elif defined(__APPLE__)
+
+typedef void* FBNativeWindowType;
+
+#elif defined(__QNX__)
+
+#include <screen/screen.h>
+typedef screen_window_t FBNativeWindowType;
+
+#else
+#warning "Unsupported platform"
+#endif
diff --git a/src/gfxstream/include/render-utils/render_api_types.h b/src/gfxstream/include/render-utils/render_api_types.h
new file mode 100644
index 00000000000..3338adea76e
--- /dev/null
+++ b/src/gfxstream/include/render-utils/render_api_types.h
@@ -0,0 +1,31 @@
+// 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
+
+// Interface between android-emu non-base libraries and emugl
+
+#include "host-common/GoldfishDma.h"
+#include "host-common/goldfish_sync.h"
+#include "host-common/FeatureControl.h"
+
+// Feature control
+typedef bool (*emugl_feature_is_enabled_t)(android::featurecontrol::Feature feature);
+
+// OpenGL timestamped logger
+typedef void (*emugl_logger_t)(const char* fmt, ...);
+typedef struct {
+ emugl_logger_t coarse;
+ emugl_logger_t fine;
+} emugl_logger_struct;
+
diff --git a/src/gfxstream/include/render-utils/virtio_gpu_ops.h b/src/gfxstream/include/render-utils/virtio_gpu_ops.h
new file mode 100644
index 00000000000..e224046126d
--- /dev/null
+++ b/src/gfxstream/include/render-utils/virtio_gpu_ops.h
@@ -0,0 +1,183 @@
+// 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.
+#pragma once
+
+#ifdef __cplusplus
+#include <functional>
+#include <future>
+#endif
+
+/* virtio-gpu interface for buffers
+ * (triggered by minigbm/egl calling virtio-gpu ioctls) */
+typedef void (*create_buffer_with_handle_t)(uint64_t size, uint32_t handle);
+
+/* virtio-gpu interface for color buffers
+ * (triggered by minigbm/egl calling virtio-gpu ioctls) */
+typedef void (*create_color_buffer_with_handle_t)(
+ uint32_t width,
+ uint32_t height,
+ uint32_t format,
+ uint32_t fwkFormat,
+ uint32_t handle);
+
+/* create YUV textures with given width and height
+ type: FRAMEWORK_FORMAT_NV12 or FRAMEWORK_FORMAT_YUV_420_888
+ count: how many set of textures will be created
+ output: caller allocated storage to hold results: size should
+ be 2*count for NV12 or 3*cout for YUV_420_888
+ */
+typedef void (*create_yuv_textures_t)(uint32_t type,
+ uint32_t count,
+ int width,
+ int height,
+ uint32_t* output);
+
+/* destroy YUV textures */
+typedef void (*destroy_yuv_textures_t)(uint32_t type,
+ uint32_t count,
+ uint32_t* textures);
+/* call the user provided func with privData to update the content
+ of textures.
+ type: FRAMEWORK_FORMAT_NV12 or FRAMEWORK_FORMAT_YUV_420_888
+ textures: size 2 (NV12) or 3 (YUV420)
+ */
+typedef void (*update_yuv_textures_t)(uint32_t type,
+ uint32_t* textures,
+ void* privData,
+ void* func);
+
+/* swap out the yuv textures of the colorbuffer, and use the new yuv textures
+ * to update colorbuffer content; on return, textures will have the retired
+ * yuv textures that are free to hold new data
+ */
+typedef void (*swap_textures_and_update_color_buffer_t)(
+ uint32_t colorbufferhandle,
+ int x,
+ int y,
+ int width,
+ int height,
+ uint32_t format,
+ uint32_t type,
+ uint32_t texture_type,
+ uint32_t* textures,
+ void* metadata);
+
+typedef void (*open_color_buffer_t)(uint32_t handle);
+typedef void (*close_buffer_t)(uint32_t handle);
+typedef void (*close_color_buffer_t)(uint32_t handle);
+typedef void (*update_buffer_t)(uint32_t handle, uint64_t offset, uint64_t sizeToRead, void* bytes);
+typedef void (*update_color_buffer_t)(
+ uint32_t handle, int x, int y, int width, int height,
+ uint32_t format, uint32_t type, void* pixels);
+typedef void (*read_buffer_t)(uint32_t handle, uint64_t offset, uint64_t sizeToRead, void* bytes);
+typedef void (*read_color_buffer_t)(
+ uint32_t handle, int x, int y, int width, int height,
+ uint32_t format, uint32_t type, void* pixels);
+typedef void (*read_color_buffer_yuv_t)(
+ uint32_t handle, int x, int y, int width, int height,
+ void* pixels, uint32_t pixels_size);
+typedef void (*post_color_buffer_t)(uint32_t handle);
+#ifdef __cplusplus
+using CpuCompletionCallback = std::function<void(std::shared_future<void> waitForGpu)>;
+typedef void (*async_post_color_buffer_t)(uint32_t, CpuCompletionCallback);
+#else
+typedef void* async_post_color_buffer_t;
+#endif
+typedef void (*repost_t)(void);
+typedef uint32_t (*get_last_posted_color_buffer_t)(void);
+typedef void (*bind_color_buffer_to_texture_t)(uint32_t);
+typedef void* (*get_global_egl_context_t)(void);
+typedef void (*wait_for_gpu_t)(uint64_t eglsync);
+typedef void (*wait_for_gpu_vulkan_t)(uint64_t device, uint64_t fence);
+typedef void (*set_guest_managed_color_buffer_lifetime_t)(bool guest_managed);
+typedef void (*update_color_buffer_from_framework_format_t)(uint32_t handle,
+ int x,
+ int y,
+ int width,
+ int height,
+ uint32_t fwkFormat,
+ uint32_t format,
+ uint32_t type,
+ void* pixels,
+ void* metadata);
+
+#ifdef __cplusplus
+using FenceCompletionCallback = std::function<void()>;
+typedef void (*async_wait_for_gpu_with_cb_t)(uint64_t eglsync, FenceCompletionCallback);
+typedef void (*async_wait_for_gpu_vulkan_with_cb_t)(uint64_t device, uint64_t fence, FenceCompletionCallback);
+typedef void (*async_wait_for_gpu_vulkan_qsri_with_cb_t)(uint64_t image, FenceCompletionCallback);
+#else
+typedef void* async_wait_for_gpu_with_cb_t;
+typedef void* async_wait_for_gpu_vulkan_with_cb_t;
+typedef void* async_wait_for_gpu_vulkan_qsri_with_cb_t;
+#endif
+typedef void (*wait_for_gpu_vulkan_qsri_t)(uint64_t image);
+
+// Platform resources and contexts support
+#define RESOURCE_TYPE_MASK 0x0F
+#define RESOURCE_USE_MASK 0xF0
+
+// types
+#define RESOURCE_TYPE_EGL_NATIVE_PIXMAP 0x01
+#define RESOURCE_TYPE_EGL_IMAGE 0x02
+#define RESOURCE_TYPE_VK_EXT_MEMORY_HANDLE 0x03
+
+// uses
+#define RESOURCE_USE_PRESERVE 0x10
+
+typedef bool (*platform_import_resource_t)(uint32_t handle, uint32_t info, void* resource);
+typedef bool (*platform_resource_info_t)(uint32_t handle, int32_t* width, int32_t* height, int32_t* internal_format);
+typedef void* (*platform_create_shared_egl_context_t)(void);
+typedef bool (*platform_destroy_shared_egl_context_t)(void* context);
+
+struct AndroidVirtioGpuOps {
+ create_buffer_with_handle_t create_buffer_with_handle;
+ create_color_buffer_with_handle_t create_color_buffer_with_handle;
+ open_color_buffer_t open_color_buffer;
+ close_buffer_t close_buffer;
+ close_color_buffer_t close_color_buffer;
+ update_buffer_t update_buffer;
+ update_color_buffer_t update_color_buffer;
+ read_buffer_t read_buffer;
+ read_color_buffer_t read_color_buffer;
+ read_color_buffer_yuv_t read_color_buffer_yuv;
+ post_color_buffer_t post_color_buffer;
+ async_post_color_buffer_t async_post_color_buffer;
+ repost_t repost;
+ /* yuv texture related */
+ create_yuv_textures_t create_yuv_textures;
+ destroy_yuv_textures_t destroy_yuv_textures;
+ update_yuv_textures_t update_yuv_textures;
+ swap_textures_and_update_color_buffer_t
+ swap_textures_and_update_color_buffer;
+ /* virtual device widget related */
+ get_last_posted_color_buffer_t get_last_posted_color_buffer;
+ bind_color_buffer_to_texture_t bind_color_buffer_to_texture;
+ get_global_egl_context_t get_global_egl_context;
+ wait_for_gpu_t wait_for_gpu;
+ wait_for_gpu_vulkan_t wait_for_gpu_vulkan;
+ set_guest_managed_color_buffer_lifetime_t set_guest_managed_color_buffer_lifetime;
+ async_wait_for_gpu_with_cb_t async_wait_for_gpu_with_cb;
+ async_wait_for_gpu_vulkan_with_cb_t async_wait_for_gpu_vulkan_with_cb;
+
+ async_wait_for_gpu_vulkan_qsri_with_cb_t async_wait_for_gpu_vulkan_qsri_with_cb;
+ wait_for_gpu_vulkan_qsri_t wait_for_gpu_vulkan_qsri;
+
+ update_color_buffer_from_framework_format_t update_color_buffer_from_framework_format;
+
+ platform_import_resource_t platform_import_resource;
+ platform_resource_info_t platform_resource_info;
+ platform_create_shared_egl_context_t platform_create_shared_egl_context;
+ platform_destroy_shared_egl_context_t platform_destroy_shared_egl_context;
+};
diff --git a/src/gfxstream/meson.build b/src/gfxstream/meson.build
new file mode 100644
index 00000000000..2c17fc7626f
--- /dev/null
+++ b/src/gfxstream/meson.build
@@ -0,0 +1,36 @@
+# Copyright 2023 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+build = 'both'
+
+with_guest = build.contains('guest') or build.contains('both')
+with_host = build.contains('host') or build.contains('both')
+
+#========================#
+# Logging + error report #
+#========================#
+log_level = 'error'
+
+#===============#
+# Decoders #
+#===============#
+decoders = 'vulkan'
+with_guest = true
+with_host = true
+
+genvk = files('codegen/vulkan/vulkan-docs-next/scripts/genvk.py')
+vk_gfxstream_xml = files('codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.xml')
+
+use_auto = decoders.contains('auto') and with_host
+use_gles = decoders.contains('gles') and with_host
+use_vulkan = decoders.contains('vulkan') and with_host
+use_magma = decoders.contains('magma') and with_host
+use_composer = decoders.contains('composer') and with_host
+
+if with_guest
+ subdir('guest')
+endif
+if with_host
+ subdir('common')
+ subdir('host')
+endif
diff --git a/src/gfxstream/meson_options.txt b/src/gfxstream/meson_options.txt
new file mode 100644
index 00000000000..b5032fecfea
--- /dev/null
+++ b/src/gfxstream/meson_options.txt
@@ -0,0 +1,736 @@
+# 2023 Android Open Source Project
+# Copyright © 2017-2019 Intel Corporation
+# SPDX-License-Identifier: MIT
+
+option(
+ 'platforms',
+ type : 'array',
+ value : ['auto'],
+ choices : [
+ 'auto', 'x11', 'wayland', 'haiku', 'android', 'windows',
+ ],
+ description : 'window systems to support. If this is set to `auto`, all ' +
+ 'platforms applicable will be enabled.'
+)
+
+option(
+ 'egl-native-platform',
+ type : 'combo',
+ value : 'auto',
+ choices : [
+ 'auto', 'x11', 'wayland', 'haiku', 'android', 'windows',
+ 'surfaceless', 'drm',
+ ],
+ description : 'the window system EGL assumes for EGL_DEFAULT_DISPLAY',
+)
+
+option(
+ 'android-stub',
+ type : 'boolean',
+ value : false,
+ description : 'Build against android-stub',
+)
+
+option(
+ 'android-libbacktrace',
+ type : 'feature',
+ description : 'Use Android\'s libbacktrace',
+)
+
+option(
+ 'dri3',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'enable support for dri3'
+)
+
+option(
+ 'dri-drivers-path',
+ type : 'string',
+ value : '',
+ description : 'Location to install dri drivers. Default: $libdir/dri.'
+)
+
+option(
+ 'dri-search-path',
+ type : 'string',
+ value : '',
+ description : 'Locations to search for dri drivers, passed as colon ' +
+ 'separated list. Default: dri-drivers-path.'
+)
+
+option(
+ 'expat',
+ type : 'feature',
+ value : 'auto',
+ description : 'Controls the use of expat. ' +
+ 'Cannot be disabled if xmlconfig is enabled.'
+)
+
+option(
+ 'gallium-drivers',
+ type : 'array',
+ value : [],
+ choices : [
+ 'auto', 'kmsro', 'radeonsi', 'r300', 'r600', 'nouveau', 'freedreno',
+ 'swrast', 'v3d', 'vc4', 'etnaviv', 'tegra', 'i915', 'svga', 'virgl',
+ 'panfrost', 'iris', 'lima', 'zink', 'd3d12', 'asahi', 'crocus',
+ ],
+ description : 'List of gallium drivers to build. If this is set to auto ' +
+ 'all drivers applicable to the target OS/architecture ' +
+ 'will be built'
+)
+
+option(
+ 'gallium-extra-hud',
+ type : 'boolean',
+ value : false,
+ description : 'Enable HUD block/NIC I/O HUD status support',
+)
+
+option(
+ 'gallium-vdpau',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'enable gallium vdpau frontend.',
+)
+
+option(
+ 'vdpau-libs-path',
+ type : 'string',
+ value : '',
+ description : 'path to put vdpau libraries. defaults to $libdir/vdpau.'
+)
+
+option(
+ 'gallium-omx',
+ type : 'combo',
+ value : 'auto',
+ choices : ['auto', 'disabled', 'bellagio', 'tizonia'],
+ description : 'enable gallium omx frontend.',
+)
+
+option(
+ 'omx-libs-path',
+ type : 'string',
+ value : '',
+ description : 'path to put omx libraries. defaults to omx-bellagio ' +
+ 'pkg-config pluginsdir.'
+)
+
+option(
+ 'gallium-va',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'enable gallium va frontend.',
+)
+
+option(
+ 'va-libs-path',
+ type : 'string',
+ value : '',
+ description : 'path to put va libraries. defaults to $libdir/dri.'
+)
+
+option(
+ 'gallium-xa',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'enable gallium xa frontend.',
+)
+
+option(
+ 'gallium-nine',
+ type : 'boolean',
+ value : false,
+ description : 'build gallium "nine" Direct3D 9.x frontend.',
+)
+
+option(
+ 'gallium-d3d10umd',
+ type : 'boolean',
+ value : false,
+ description : 'build gallium D3D10 WDDM UMD frontend.',
+)
+
+option(
+ 'gallium-opencl',
+ type : 'combo',
+ choices : ['icd', 'standalone', 'disabled'],
+ value : 'disabled',
+ description : 'build gallium "clover" OpenCL frontend.',
+)
+
+option(
+ 'gallium-rusticl',
+ type : 'boolean',
+ value : false,
+ description : 'build gallium "rusticl" OpenCL frontend.',
+)
+
+option(
+ 'gallium-windows-dll-name',
+ type : 'string',
+ value : 'libgallium_wgl',
+ description : 'name of gallium megadriver DLL built for Windows. ' +
+ 'defaults to libgallium_wgl.dll to match DRI',
+)
+
+option(
+ 'opencl-spirv',
+ type : 'boolean',
+ value : false,
+ description : 'build gallium "clover" OpenCL frontend with SPIR-V ' +
+ 'binary support.',
+)
+
+option(
+ 'static-libclc',
+ type : 'array',
+ value : [],
+ choices : ['spirv', 'spirv64', 'all'],
+ description : 'Link libclc SPIR-V statically.',
+)
+
+option(
+ 'opencl-external-clang-headers',
+ type : 'feature',
+ description : 'Use system Clang headers at runtime for OpenCL kernel ' +
+ 'compilation.',
+)
+
+option(
+ 'd3d-drivers-path',
+ type : 'string',
+ value : '',
+ description : 'Location of D3D drivers. Default: $libdir/d3d',
+)
+
+option(
+ 'vulkan-drivers',
+ type : 'array',
+ value : ['gfxstream-experimental'],
+ choices : ['auto', 'amd', 'broadcom', 'freedreno', 'intel', 'intel_hasvk',
+ 'panfrost', 'swrast', 'virtio', 'imagination-experimental',
+ 'microsoft-experimental', 'nouveau-experimental', 'gfxstream-experimental'],
+ description : 'List of vulkan drivers to build. If this is set to auto ' +
+ 'all drivers applicable to the target OS/architecture ' +
+ 'will be built'
+)
+
+# Note that currently turnip supports msm and kgsl, while the gallium driver
+# support msm and virtio. This is a temporary situation with virtio support
+# for turnip and kgsl support for gallium planned/in-progress.
+option(
+ 'freedreno-kmds',
+ type : 'array',
+ value : ['msm'],
+ choices : ['msm', 'kgsl', 'virtio'],
+ description : 'List of kernel-mode drivers to enable for freedreno ' +
+ 'gallium and vulkan driver',
+)
+
+option(
+ 'imagination-srv',
+ type : 'boolean',
+ value : false,
+ description : 'Enable Services backend for Imagination Technologies ' +
+ 'vulkan driver',
+)
+
+option(
+ 'shader-cache',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Build with on-disk shader cache support.',
+)
+
+option(
+ 'shader-cache-default',
+ type : 'boolean',
+ value : true,
+ description : 'If set to false, the feature is only activated when ' +
+ 'environment variable MESA_SHADER_CACHE_DISABLE is set ' +
+ 'to false',
+)
+
+option(
+ 'shader-cache-max-size',
+ type : 'string',
+ value : '',
+ description : 'Default value for MESA_SHADER_CACHE_MAX_SIZE enviroment ' +
+ 'variable. If set, determines the maximum size of the ' +
+ 'on-disk cache of compiled shader programs, can be overriden ' +
+ 'by enviroment variable if needed. Should be set to a number ' +
+ 'optionally followed by ``K``, ``M``, or ``G`` to specify ' +
+ 'a size in kilobytes, megabytes, or gigabytes. By default, ' +
+ 'gigabytes will be assumed. And if unset, a maximum size of ' +
+ '1GB will be used.'
+)
+
+option(
+ 'vulkan-icd-dir',
+ type : 'string',
+ value : '',
+ description : 'Location relative to prefix to put vulkan icds on install. ' +
+ 'Default: $datadir/vulkan/icd.d'
+)
+
+option(
+ 'moltenvk-dir',
+ type : 'string',
+ value : '',
+ description : 'Location of the MoltenVk SDK. Default: '
+)
+
+option(
+ 'vulkan-layers',
+ type : 'array',
+ value : [],
+ choices : ['device-select', 'intel-nullhw', 'overlay'],
+ description : 'List of vulkan layers to build'
+)
+
+option(
+ 'shared-glapi',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Whether to build a shared or static glapi. Defaults to ' +
+ 'disabled on Windows, enabled elsewhere'
+)
+
+option(
+ 'gles1',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Build support for OpenGL ES 1.x'
+)
+
+option(
+ 'gles2',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Build support for OpenGL ES 2.x and 3.x'
+)
+
+option(
+ 'opengl',
+ type : 'boolean',
+ value : false,
+ description : 'Build support for desktop OpenGL'
+)
+
+option(
+ 'gbm',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Build support for gbm platform'
+)
+
+option(
+ 'gbm-backends-path',
+ type : 'string',
+ value : '',
+ description : 'Locations to search for gbm backends, passed as colon ' +
+ 'separated list. Default: $libdir/gbm.'
+)
+
+option(
+ 'glx',
+ type : 'combo',
+ value : 'auto',
+ choices : ['auto', 'disabled', 'dri', 'xlib'],
+ description : 'Build support for GLX platform'
+)
+
+option(
+ 'egl',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Build support for EGL platform'
+)
+
+option(
+ 'glvnd',
+ type : 'boolean',
+ value : false,
+ description : 'Enable GLVND support.'
+)
+
+option(
+ 'microsoft-clc',
+ type : 'feature',
+ value : 'auto',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Build support for the Microsoft CLC to DXIL compiler'
+)
+
+option(
+ 'spirv-to-dxil',
+ type : 'boolean',
+ value : false,
+ description : 'Build support for the SPIR-V to DXIL library'
+)
+
+option(
+ 'glvnd-vendor-name',
+ type : 'string',
+ value : 'mesa',
+ description : 'Vendor name string to use for glvnd libraries'
+)
+
+option(
+ 'glx-read-only-text',
+ type : 'boolean',
+ value : false,
+ description : 'Disable writable .text section on x86 (decreases performance)'
+)
+
+option(
+ 'llvm',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Build with LLVM support.'
+)
+
+option(
+ 'shared-llvm',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Whether to link LLVM shared or statically.'
+)
+
+option(
+ 'draw-use-llvm',
+ type : 'boolean',
+ value : true,
+ description : 'Whether to use LLVM for the Gallium draw module, if LLVM ' +
+ 'is included.'
+)
+
+option(
+ 'valgrind',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Build with valgrind support'
+)
+
+option(
+ 'libunwind',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Use libunwind for stack-traces'
+)
+
+option(
+ 'lmsensors',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Enable HUD lmsensors support.'
+)
+
+option(
+ 'build-tests',
+ type : 'boolean',
+ value : false,
+ description : 'Build unit tests. Currently this will build *all* unit ' +
+ 'tests except the ACO tests, which may build more than expected.'
+)
+
+option(
+ 'enable-glcpp-tests',
+ type : 'boolean',
+ value : true,
+ description : 'Build glcpp unit tests. These are flaky on CI.'
+)
+
+option(
+ 'build-aco-tests',
+ type : 'boolean',
+ value : false,
+ description : 'Build ACO tests. These require RADV and glslang but not ' +
+ 'an AMD GPU.'
+)
+
+option(
+ 'install-intel-gpu-tests',
+ type : 'boolean',
+ value : false,
+ description : 'Build and install Intel unit tests which require the GPU. ' +
+ 'This option is for developers and the Intel CI system only.'
+)
+
+option(
+ 'selinux',
+ type : 'boolean',
+ value : false,
+ description : 'Build an SELinux-aware Mesa. This currently disables ' +
+ 'execmem support at runtime unless SELinux is configured ' +
+ 'with allow_execmem.'
+)
+
+option(
+ 'execmem',
+ type : 'boolean',
+ deprecated : true,
+ description : 'Does nothing, left here for a while to avoid build breakages.',
+)
+
+option(
+ 'osmesa',
+ type : 'boolean',
+ value : false,
+ description : 'Build OSmesa.'
+)
+
+option(
+ 'tools',
+ type : 'array',
+ value : [],
+ choices : ['drm-shim', 'etnaviv', 'freedreno', 'glsl', 'intel', 'intel-ui',
+ 'nir', 'nouveau', 'lima', 'panfrost', 'asahi', 'imagination',
+ 'all', 'dlclose-skip'],
+ description : 'List of tools to build. (Note: `intel-ui` selects `intel`)',
+)
+
+option(
+ 'power8',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Enable power8 optimizations.',
+)
+
+option(
+ 'xlib-lease',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Enable VK_EXT_acquire_xlib_display.'
+)
+
+option(
+ 'glx-direct',
+ type : 'boolean',
+ value : true,
+ description : 'Enable direct rendering in GLX and EGL for DRI',
+)
+
+option('egl-lib-suffix',
+ type : 'string',
+ value : '',
+ description : 'Suffix to append to EGL library name. Default: none.'
+)
+
+option(
+ 'gles-lib-suffix',
+ type : 'string',
+ value : '',
+ description : 'Suffix to append to GLES library names. Default: none.'
+)
+
+option(
+ 'platform-sdk-version',
+ type : 'integer',
+ min : 25,
+ max : 10000,
+ value : 25,
+ description : 'Android Platform SDK version. Default: Nougat version.'
+)
+
+option(
+ 'allow-kcmp',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Allow using KCMP_FILE to compare file descriptions. ' +
+ 'auto = allowed everywhere except on Android'
+)
+
+option(
+ 'zstd',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Use ZSTD instead of ZLIB in some cases.'
+)
+
+option(
+ 'zlib',
+ type : 'feature',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ value : 'enabled',
+ description : 'Use ZLIB to build driver. Default: enabled'
+)
+
+option(
+ 'sse2',
+ type : 'boolean',
+ value : true,
+ description : 'use msse2 flag for x86. Uses sse/sse2 instead of x87. Default: true',
+)
+
+option(
+ 'perfetto',
+ type : 'boolean',
+ value : false,
+ description : 'Enable performance analysis with Perfetto. Default: false'
+)
+
+option(
+ 'datasources',
+ type : 'array',
+ value : ['auto'],
+ choices : ['auto', 'panfrost', 'intel', 'freedreno'],
+ description : 'List of Perfetto datasources to build. If this is set to ' +
+ '`auto`, datasources that can not be build are skipped. ' +
+ 'Default: [`auto`]'
+)
+
+option(
+ 'gpuvis',
+ type : 'boolean',
+ value : false,
+ description : 'Enable tracing markers for gpuvis. Default: false'
+)
+
+option(
+ 'custom-shader-replacement',
+ type : 'string',
+ value : '',
+ description : 'Enable a custom shader replacement mechanism. Note that ' +
+ 'enabling this option requires adding/generating a ' +
+ 'shader_replacement.h file that can be included (see ' +
+ 'shaderapi.c).'
+)
+
+option(
+ 'vmware-mks-stats',
+ type : 'boolean',
+ value : false,
+ description : 'Build gallium VMware/svga driver with mksGuestStats ' +
+ 'instrumentation.'
+)
+
+option(
+ 'vulkan-beta',
+ type : 'boolean',
+ value : false,
+ description : 'Build vulkan drivers with BETA extensions enabled.'
+)
+
+option(
+ 'intel-clc',
+ type : 'combo',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ value : 'disabled',
+ choices : [
+ 'enabled', 'disabled', 'system',
+ ],
+ description : 'Build the intel-clc compiler (enables Vulkan Intel ' +
+ 'Ray Tracing on supported hardware).'
+)
+
+option(
+ 'video-codecs',
+ type : 'array',
+ value : [],
+ choices: [
+ 'vc1dec', 'h264dec', 'h264enc', 'h265dec', 'h265enc'
+ ],
+ description : 'List of patent encumbered codecs to build support for. ' +
+ 'Distros might want to consult their legal department before ' +
+ 'enabling these. This is used for all video APIs (vaapi, ' +
+ 'vdpau, vulkan). Non-patent encumbered codecs will be ' +
+ 'enabled by default.'
+)
+
+option(
+ 'gallium-d3d12-video',
+ type : 'feature',
+ value : 'auto',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'build gallium d3d12 with video support.',
+)
+
+option(
+ 'radv-build-id',
+ type : 'string',
+ value : '',
+ description : 'Override build id for shader cache keys (hex string). ' +
+ 'Can be extracted with readelf -x .note.gnu.build-id'
+)
+
+option(
+ 'min-windows-version',
+ type : 'integer',
+ min : 7,
+ max : 11,
+ value : 8,
+ description : 'Minimum Windows version to support. Defaults to Windows 8.'
+)
+
+option(
+ 'xmlconfig',
+ type : 'feature',
+ value : 'auto',
+ deprecated: {'true': 'enabled', 'false': 'disabled'},
+ description : 'Build custom xmlconfig (driconf) support. If disabled, ' +
+ 'the default driconf file is hardcoded into Mesa. ' +
+ 'Requires expat.'
+)
+
+option (
+ 'intel-xe-kmd',
+ type : 'feature',
+ value : 'disabled',
+ description: 'Enable Intel Xe KMD support.'
+)
+
+option(
+ 'nvk-legacy-uapi',
+ type : 'boolean',
+ value : 'false',
+ description : 'Build support for legacy kernel uAPI.'
+)
+
+option(
+ 'vk-no-nir',
+ type : 'boolean',
+ value : 'true',
+ description : 'Try to build Mesa Vulkan runtime without NIR'
+)
+
+option(
+ 'decoders',
+ type : 'array',
+ value : ['auto'],
+ choices : [
+ 'gles',
+ 'vulkan',
+ 'magma',
+ 'composer',
+ 'auto',
+ ],
+ description : 'A list of supported decoders to build'
+)
+option(
+ 'log-level',
+ type : 'combo',
+ value : 'error',
+ choices : [
+ 'none',
+ 'info',
+ 'warn',
+ 'error',
+ ],
+ description : 'The logging level of gfxstream'
+)
+option('qnx_target', type : 'string', value : '', description : 'QNX SDP target path')
+option(
+ 'gfxstream-build',
+ type : 'combo',
+ value : 'host',
+ choices : [
+ 'both',
+ 'guest',
+ 'host',
+ ],
+ description : 'Which portions of gfxstream to build'
+)
diff --git a/src/gfxstream/qnx/Makefile b/src/gfxstream/qnx/Makefile
new file mode 100644
index 00000000000..1f254004140
--- /dev/null
+++ b/src/gfxstream/qnx/Makefile
@@ -0,0 +1,8 @@
+LIST=OS
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
diff --git a/src/gfxstream/qnx/README.md b/src/gfxstream/qnx/README.md
new file mode 100644
index 00000000000..b4a94d82c8b
--- /dev/null
+++ b/src/gfxstream/qnx/README.md
@@ -0,0 +1,30 @@
+# Build: QNX
+
+Requires QNX SDP to build, with `QNX_TARGET` and `QNX_HOST` environment variables set. Make sure the latest meson is installed.
+
+Build scripts are made available to show how to cross-compile gfxstream and its aemu dependencies. See `./qnx/nto/build-aemu.sh` and `./qnx/nto/build-gfxstream.sh`
+
+ cd ./qnx
+ make
+
+Make will navigate to `./qnx/nto/aarch64le` and run the build scripts from there.
+
+The aemu dependency is downloaded to, and built in `./qnx/nto/aarch64le/aemu`.
+
+Gfxstream's build directory is `./qnx/nto/aarch64le/gfxstream`.
+
+ cd ./qnx
+ make install
+
+The install target requires the `INSTALL_ROOT_nto` environment variable, which sets the qnx staging/install path.
+
+pinfo.mk writes build info into the binary:
+
+ # use -i ./nto/aarch64le/gfxstream/host/libgfxstream_backend.so
+ QNX_BUILDID=(GNU)5dc1327b962ed2a7e992c1f6f35c0df3
+ NAME=libgfxstream_backend.so
+ DESCRIPTION=virtio-gpu backend renderer
+ DATE=2023/09/18-10:58:49-EDT
+ COMMIT=7b8c19e51845aee014684c43e6aa8409e919af6a
+
+A "recursive make" directory layout is used to allow multiplatform builds. For more info, see: [Conventions for Recursive Makefiles and Directories](https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.prog/topic/make_convent.html)
diff --git a/src/gfxstream/qnx/common.mk b/src/gfxstream/qnx/common.mk
new file mode 100644
index 00000000000..67b996e48b9
--- /dev/null
+++ b/src/gfxstream/qnx/common.mk
@@ -0,0 +1,48 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+.PHONY: gfxstream
+.PHONY: aemu
+.PHONY: clean
+.PHONY: install
+
+all: gfxstream
+
+check-sdp:
+ @if [ -z "$${QNX_TARGET}" ]; then \
+ echo "'QNX_TARGET' not set. Make sure QNX SDP environment is configured"; \
+ exit 1; \
+ fi
+ @if [ -z "$${QNX_HOST}" ]; then \
+ echo "'QNX_HOST' not set. Make sure QNX SDP environment is configured"; \
+ exit 1; \
+ fi
+
+check-install-root:
+ @if [ -z "$${INSTALL_ROOT_nto}" ]; then \
+ echo "'INSTALL_ROOT_nto' not set."; \
+ exit 1; \
+ fi
+
+aemu: check-sdp
+ ../build-aemu.sh
+
+gfxstream: check-sdp aemu
+ ../build-gfxstream.sh
+
+install: check-sdp check-install-root gfxstream
+ $(MAKE) -f ../../pinfo.mk gfxstream/host/libgfxstream*
+ $(LN_HOST) -s libgfxstream_backend.so gfxstream/host/libgfxstream.so
+ find gfxstream/host/ -maxdepth 1 \( -type f -o -type l \) -name "libgfxstream*" \
+ -exec $(CP_HOST) -d {} $(INSTALL_ROOT_nto)/$(VARIANT)/usr/lib/ \;
+
+clean:
+ rm -rf aemu
+ rm -rf gfxstream
+ rm -f *.pinfo
+ @if [ -n "$${INSTALL_ROOT_nto}" ]; then \
+ rm -f $(INSTALL_ROOT_nto)/$(VARIANT)/usr/lib/libgfxstream* ;\
+ fi
+
diff --git a/src/gfxstream/qnx/host/platform_qnx.cpp b/src/gfxstream/qnx/host/platform_qnx.cpp
new file mode 100644
index 00000000000..37c369bec46
--- /dev/null
+++ b/src/gfxstream/qnx/host/platform_qnx.cpp
@@ -0,0 +1,26 @@
+// Copyright (C) 2023 The Android Open Source Project
+// Copyright (C) 2023 BlackBerry Limited
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <EGL/egl.h>
+#include <GLES2/gl2.h>
+
+// without this the build fails to properly link to the qnx EGL and GLESv2 libs:
+// SharedLibrary.cpp:266] SharedLibrary::open for [libGLESv2.so] failed (posix). dlerror:
+// [Unresolved symbols] EglOsApi_egl.cpp:208] EglOsGlLibrary: Could not open GL library
+// libGLESv2.so [Unresolved symbols]
+void link_EGL_GLES2(void) {
+ eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ glViewport(0, 0, 0, 0);
+}
diff --git a/src/gfxstream/qnx/nto/Makefile b/src/gfxstream/qnx/nto/Makefile
new file mode 100644
index 00000000000..0cc5eae2d76
--- /dev/null
+++ b/src/gfxstream/qnx/nto/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
diff --git a/src/gfxstream/qnx/nto/aarch64-le/Makefile b/src/gfxstream/qnx/nto/aarch64-le/Makefile
new file mode 100644
index 00000000000..262ffd4357b
--- /dev/null
+++ b/src/gfxstream/qnx/nto/aarch64-le/Makefile
@@ -0,0 +1,3 @@
+export PROCESSOR=aarch64
+export VARIANT=aarch64le
+include ../../common.mk
diff --git a/src/gfxstream/qnx/nto/aarch64-le/meson.cross.ini b/src/gfxstream/qnx/nto/aarch64-le/meson.cross.ini
new file mode 100644
index 00000000000..d6fd11a427e
--- /dev/null
+++ b/src/gfxstream/qnx/nto/aarch64-le/meson.cross.ini
@@ -0,0 +1,17 @@
+[properties]
+pkg_config_libdir = '@GLOBAL_SOURCE_ROOT@/qnx/pkgconfig'
+qnx_path_prefix = 'qnx/nto/aarch64-le'
+
+[binaries]
+c = 'ntoaarch64-gcc'
+cpp = 'ntoaarch64-g++'
+ar = 'ntoaarch64-ar'
+strip = 'ntoaarch64-strip'
+pkg-config = 'pkg-config'
+
+# meson host_machine == QNX target system
+[host_machine]
+system = 'qnx'
+cpu_family = 'aarch64'
+cpu = 'aarch64'
+endian = 'little'
diff --git a/src/gfxstream/qnx/nto/build-aemu.sh b/src/gfxstream/qnx/nto/build-aemu.sh
new file mode 100755
index 00000000000..1deb5c9e05e
--- /dev/null
+++ b/src/gfxstream/qnx/nto/build-aemu.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+set -e
+
+AEMU_COMMIT_SHA=HEAD
+
+if [ ! -d aemu ]
+then
+ git clone https://android.googlesource.com/platform/hardware/google/aemu aemu
+fi
+
+cd aemu
+git checkout $AEMU_COMMIT_SHA
+
+cmake -D CMAKE_TOOLCHAIN_FILE=../../qnx.nto.toolchain.cmake \
+ -D AEMU_COMMON_GEN_PKGCONFIG=ON \
+ -D AEMU_COMMON_BUILD_CONFIG=gfxstream \
+ -D ENABLE_VKCEREAL_TESTS=OFF -B build
+
+cmake --build build -j
+cmake --install build --prefix install
diff --git a/src/gfxstream/qnx/nto/build-gfxstream.sh b/src/gfxstream/qnx/nto/build-gfxstream.sh
new file mode 100755
index 00000000000..c2fc69b14a2
--- /dev/null
+++ b/src/gfxstream/qnx/nto/build-gfxstream.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+set -e
+
+if [ -z "$QNX_HOST" ]; then
+ echo "QNX_HOST not set"
+ exit 1
+fi
+
+if [ -z "$QNX_TARGET" ]; then
+ echo "QNX_TARGET not set"
+ exit 1
+fi
+
+export PKG_CONFIG_LIBDIR=../../pkgconfig
+
+meson setup ../../.. gfxstream/ \
+ --cross-file ./meson.cross.ini \
+ -Ddefault_library=shared \
+ -Ddecoders=gles,vulkan,composer \
+ -Dqnx_target=$QNX_TARGET
+
+ninja -v -C gfxstream
diff --git a/src/gfxstream/qnx/nto/qnx.nto.toolchain.cmake b/src/gfxstream/qnx/nto/qnx.nto.toolchain.cmake
new file mode 100644
index 00000000000..97b4b0579b3
--- /dev/null
+++ b/src/gfxstream/qnx/nto/qnx.nto.toolchain.cmake
@@ -0,0 +1,42 @@
+
+if("$ENV{QNX_HOST}" STREQUAL "")
+ message(FATAL_ERROR "QNX_HOST environment variable not found. Please set path to your QNX SDP installation")
+endif()
+
+if("$ENV{QNX_TARGET}" STREQUAL "")
+ message(FATAL_ERROR "QNX_TARGET environment variable not found. Please set QNX target path")
+endif()
+
+if("$ENV{PROCESSOR}" STREQUAL "")
+ message(FATAL_ERROR "PROCESSOR variable not found. This variable should be set in the Makefile at CPU level (ie: nto/aarch64/Makefile)")
+endif()
+
+if("$ENV{VARIANT}" STREQUAL "")
+ message(FATAL_ERROR "VARIANT variable not found. This variable should be set in the Makefile at VARIANT level (ie: nto/aarch64/le/Makefile)")
+endif()
+
+message(STATUS "using QNX_HOST $ENV{QNX_HOST}")
+message(STATUS "using QNX_TARGET $ENV{QNX_TARGET}")
+message(STATUS "cpu=$ENV{PROCESSOR}")
+message(STATUS "variant=$ENV{VARIANT}")
+
+set(QNX true)
+set(CMAKE_SYSTEM_NAME QNX)
+add_definitions("-D_QNX_SOURCE")
+
+set(DEPENDENCY_OVERRIDE "DOWNLOAD")
+
+set(GENERATE_PINFO_FILES $ENV{GENERATE_PINFO_FILES})
+
+set(target gcc_nto$ENV{VARIANT})
+set(ntoarch $ENV{VARIANT})
+set(processor $ENV{PROCESSOR})
+set(CMAKE_C_COMPILER qcc)
+set(CMAKE_C_COMPILER_TARGET ${target})
+set(CMAKE_CXX_COMPILER qcc -lang-c++)
+set(CMAKE_CXX_COMPILER_TARGET ${target})
+set(CMAKE_ASM_COMPILER qcc -V${target})
+set(CMAKE_RANLIB $ENV{QNX_HOST}/usr/bin/nto${processor}-ranlib CACHE PATH "QNX ranlib Program" FORCE)
+set(CMAKE_AR $ENV{QNX_HOST}/usr/bin/nto${processor}-ar CACHE PATH "QNX ar Program" FORCE)
+set(CMAKE_SYSROOT $ENV{QNX_TARGET})
+set(CMAKE_CXX_STANDARD 20) \ No newline at end of file
diff --git a/src/gfxstream/qnx/pinfo.mk b/src/gfxstream/qnx/pinfo.mk
new file mode 100644
index 00000000000..5b87584d26c
--- /dev/null
+++ b/src/gfxstream/qnx/pinfo.mk
@@ -0,0 +1,17 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+define PINFO
+PINFO DESCRIPTION=virtio-gpu backend renderer
+PINFO COMMIT=${shell git log --pretty=format:'%H' -n1 }
+endef
+USEFILE=
+
+include $(MKFILES_ROOT)/qtargets.mk
+
+FORCE:
+%.so: FORCE
+ $(ADD_PINFO)
+ $(ADD_USAGE)
diff --git a/src/gfxstream/qnx/pkgconfig/screen.pc b/src/gfxstream/qnx/pkgconfig/screen.pc
new file mode 100644
index 00000000000..7879e172620
--- /dev/null
+++ b/src/gfxstream/qnx/pkgconfig/screen.pc
@@ -0,0 +1,9 @@
+prefix=${env:QNX_TARGET}
+exec_prefix=${prefix}/${env:VARIANT}
+libdir=${exec_prefix}/usr/lib
+includedir=${prefix}/usr/include
+
+Name: screen
+Description: QNX Screen Composited Windowing Native API client
+Libs: -L${libdir} -lscreen
+Cflags: -I${includedir}
diff --git a/src/gfxstream/scripts/build-nested-vulkan-loader.sh b/src/gfxstream/scripts/build-nested-vulkan-loader.sh
new file mode 100755
index 00000000000..b67362e72f4
--- /dev/null
+++ b/src/gfxstream/scripts/build-nested-vulkan-loader.sh
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+# Copyright 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.
+
+set -o errexit
+
+WORKING_DIRECTORY="/tmp/gfxstream-nested-vulkan-loader"
+if [ ! -z "$1" ]; then
+ WORKING_DIRECTORY=$1
+fi
+
+if [ ! -d $WORKING_DIRECTORY ]; then
+ echo "Creating working directory $WORKING_DIRECTORY."
+ mkdir -p $WORKING_DIRECTORY
+ cd $WORKING_DIRECTORY
+ git clone https://github.com/KhronosGroup/Vulkan-Loader.git .
+ git checkout -b v1.3.273 tags/v1.3.273
+else
+ echo "Reusing existing working directory $WORKING_DIRECTORY."
+ cd $WORKING_DIRECTORY
+fi
+
+echo "Applying edits for Gfxstream."
+VK_LOADER_ENV_VARS=(
+ "VK_ADD_DRIVER_FILES"
+ "VK_ADD_LAYER_PATH"
+ "VK_DRIVER_FILES"
+ "VK_ICD_FILENAMES"
+ "VK_INSTANCE_LAYERS"
+ "VK_LAYER_PATH"
+ "VK_LAYER_PATH"
+ "VK_LOADER_DEBUG"
+ "VK_LOADER_DRIVERS_DISABLE"
+ "VK_LOADER_DRIVERS_SELECT"
+ "VK_LOADER_LAYERS_ALLOW"
+ "VK_LOADER_LAYERS_DISABLE"
+ "VK_LOADER_LAYERS_ENABLE"
+)
+for var in ${VK_LOADER_ENV_VARS[@]}; do
+ echo "- Replacing occurrences of \"$var\" with \"GFXSTREAM_$var\"."
+ sed -i -e "s/\\\"$var\\\"/\\\"GFXSTREAM_$var\\\"/g" loader/*.c
+ sed -i -e "s/\\\"$var\\\"/\\\"GFXSTREAM_$var\\\"/g" loader/*.h
+done
+echo "- Adding in \"GFXSTREAM\" prefix to logging."
+sed -i -e "s/ fputs(cmd_line_msg, stderr);/ fputs(\\\"GFXSTREAM-LOADER: \\\", stderr); fputs(cmd_line_msg, stderr);/g" loader/log.c
+
+if [ ! -d build ]; then
+ echo "Creating build directory."
+ mkdir build
+ cd build
+ python ../scripts/update_deps.py
+ cmake -C helper.cmake -D CMAKE_BUILD_TYPE=Debug ..
+else
+ echo "Reusing existing build directory."
+ cd build
+fi
+
+echo "Building."
+cmake --build .
+
+cp loader/libvulkan.so loader/libvulkan_gfxstream.so
+
+echo "Use export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:$(pwd)/loader\" to add to your path."
diff --git a/src/gfxstream/scripts/gen-entries.py b/src/gfxstream/scripts/gen-entries.py
new file mode 100755
index 00000000000..3b5a67a2e17
--- /dev/null
+++ b/src/gfxstream/scripts/gen-entries.py
@@ -0,0 +1,663 @@
+#!/usr/bin/env python
+
+# 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.
+
+# Utility functions used to parse a list of DLL entry points.
+# Expected format:
+#
+# <empty-line> -> ignored
+# #<comment> -> ignored
+# %<verbatim> -> verbatim output for header files.
+# !<prefix> -> prefix name for header files.
+# <return-type> <function-name> <signature> ; -> entry point declaration.
+#
+# Anything else is an error.
+
+import re
+import sys
+import argparse
+
+re_func = re.compile(r"""^(.*[\* ])([A-Za-z_][A-Za-z0-9_]*)\((.*)\);$""")
+re_param = re.compile(r"""^(.*[\* ])([A-Za-z_][A-Za-z0-9_\[\]]*)$""")
+
+class Entry:
+ """Small class used to model a single DLL entry point."""
+ def __init__(self, func_name, return_type, parameters):
+ """Initialize Entry instance. |func_name| is the function name,
+ |return_type| its return type, and |parameters| is a list of
+ (type,name) tuples from the entry's signature.
+ """
+ self.__name__ = func_name
+ self.return_type = return_type
+ self.parameters = ""
+ self.vartypes = []
+ self.varnames = []
+ self.call = ""
+ comma = ""
+ for param in parameters:
+ self.vartypes.append(param[0])
+ self.varnames.append(param[1])
+ self.parameters += "%s%s %s" % (comma, param[0], param[1])
+ self.call += "%s%s" % (comma, param[1])
+ comma = ", "
+
+def banner_command(argv):
+ """Return sanitized command-line description.
+ |argv| must be a list of command-line parameters, e.g. sys.argv.
+ Return a string corresponding to the command, with platform-specific
+ paths removed."""
+
+ # Remove path from first parameter
+ argv = argv[:]
+ argv[0] = "android/scripts/gen-entries.py"
+ return ' '.join(argv)
+
+def parse_entries_file(lines):
+ """Parse an .entries file and return a tuple of:
+ entries: list of Entry instances from the file.
+ prefix_name: prefix name from the file, or None.
+ verbatim: list of verbatim lines from the file.
+ errors: list of errors in the file, prefixed by line number.
+ """
+ entries = []
+ verbatim = []
+ errors = []
+ lineno = 0
+ prefix_name = None
+ namespaces = []
+ for line in lines:
+ lineno += 1
+ line = line.strip()
+ if len(line) == 0: # Ignore empty lines
+ continue
+ if line[0] == '#': # Ignore comments
+ continue
+ if line[0] == '!': # Prefix name
+ prefix_name = line[1:]
+ continue
+ if line[0] == '%': # Verbatim line copy
+ verbatim.append(line[1:])
+ continue
+ if line.startswith("namespaces"): # Namespaces
+ namespaces = list(map(lambda t: t.strip(), line.split("namespaces")[1].strip().split(",")))
+ continue
+ # Must be a function signature.
+ m = re_func.match(line)
+ if not m:
+ errors.append("%d: '%s'" % (lineno, line))
+ continue
+
+ return_type, func_name, parameters = m.groups()
+ return_type = return_type.strip()
+ parameters = parameters.strip()
+ params = []
+ failure = False
+ if parameters != "void":
+ for parameter in parameters.split(','):
+ parameter = parameter.strip()
+ m = re_param.match(parameter)
+ if not m:
+ errors.append("%d: parameter '%s'" % (lineno, parameter))
+ failure = True
+ break
+ else:
+ param_type, param_name = m.groups()
+ params.append((param_type.strip(), param_name.strip()))
+
+ if not failure:
+ entries.append(Entry(func_name, return_type, params))
+
+ return (entries, prefix_name, verbatim, namespaces, errors)
+
+
+def gen_functions_header(entries, prefix_name, verbatim, filename, with_args):
+ """Generate a C header containing a macro listing all entry points.
+ |entries| is a list of Entry instances.
+ |prefix_name| is a prefix-name, it will be converted to upper-case.
+ |verbatim| is a list of verbatim lines that must appear before the
+ macro declaration. Useful to insert #include <> statements.
+ |filename| is the name of the original file.
+ """
+ prefix_name = prefix_name.upper()
+
+ print("// Auto-generated with: %s" % banner_command(sys.argv))
+ print("// DO NOT EDIT THIS FILE")
+ print("")
+ print("#ifndef %s_FUNCTIONS_H" % prefix_name)
+ print("#define %s_FUNCTIONS_H" % prefix_name)
+ print("")
+ for line in verbatim:
+ print(line)
+
+ print("#define LIST_%s_FUNCTIONS(X) \\" % prefix_name)
+
+ new_header_apis = [
+ # AEMU private exts
+ "eglGetMaxGLESVersion",
+ "eglBlitFromCurrentReadBufferANDROID",
+ "eglSetImageFenceANDROID",
+ "eglWaitImageFenceANDROID",
+ "eglAddLibrarySearchPathANDROID",
+ "eglQueryVulkanInteropSupportANDROID",
+ "eglQueryVulkanInteropSupportANDROID",
+ # For snapshotting
+ "eglLoadConfig",
+ "eglLoadContext",
+ "eglLoadAllImages",
+ "eglSaveConfig",
+ "eglSaveContext",
+ "eglSaveAllImages",
+ "eglPreSaveContext",
+ "eglPostLoadAllImages",
+ "eglPostSaveContext",
+ "eglUseOsEglApi",
+ "eglFillUsages",
+ "eglSetMaxGLESVersion",
+ ]
+
+ need_decls = []
+
+ for entry in entries:
+ if entry.__name__ in new_header_apis:
+ need_decls.append(entry)
+
+ if with_args:
+ print(" X(%s, %s, (%s), (%s)) \\" % \
+ (entry.return_type, entry.__name__, entry.parameters,
+ entry.call))
+ else:
+ print(" X(%s, %s, (%s)) \\" % \
+ (entry.return_type, entry.__name__, entry.parameters))
+
+
+ print("")
+
+ for entry in need_decls:
+ print("EGLAPI %s EGLAPIENTRY %s(%s);" % (entry.return_type, entry.__name__, entry.parameters))
+
+ print("")
+ print("#endif // %s_FUNCTIONS_H" % prefix_name)
+
+def gen_static_translator_namespaced_header(entries, namespaces, prefix_name, verbatim, filename, with_args):
+ """Generate a C++ header containing a header for |entries|
+ with nesting inside |namespaces|.
+ |prefix_name| is a prefix-name, it will be converted to upper-case.
+ |verbatim| is a list of verbatim lines that must appear before the
+ macro declaration. Useful to insert #include <> statements.
+ |filename| is the name of the original file.
+ """
+ prefix_name = prefix_name.upper()
+
+ print("// Auto-generated with: %s" % banner_command(sys.argv))
+ print("// DO NOT EDIT THIS FILE")
+ print("")
+ print("#pragma once")
+ print("")
+ for line in verbatim:
+ print(line)
+
+ for ns in namespaces:
+ print("namespace %s {" % ns)
+
+ for entry in entries:
+ if "gles" in filename:
+ print("GL_APICALL %s GL_APIENTRY %s(%s);" % (entry.return_type, entry.__name__, entry.parameters))
+ else:
+ print("EGLAPI %s EGLAPIENTRY %s(%s);" % (entry.return_type, entry.__name__, entry.parameters))
+
+ for ns in namespaces:
+ print("} // namespace %s" % ns)
+
+def gen_static_translator_namespaced_stubs(entries, namespaces, prefix_name, verbatim, filename, with_args):
+ """Generate a C++ header containing a header for |entries|
+ with nesting inside |namespaces|.
+ |prefix_name| is a prefix-name, it will be converted to upper-case.
+ |verbatim| is a list of verbatim lines that must appear before the
+ macro declaration. Useful to insert #include <> statements.
+ |filename| is the name of the original file.
+ """
+ prefix_name = prefix_name.upper()
+
+ print("// Auto-generated with: %s" % banner_command(sys.argv))
+ print("// DO NOT EDIT THIS FILE")
+ print("")
+ for line in verbatim:
+ print(line)
+
+ for ns in namespaces:
+ print("namespace %s {" % ns)
+
+ for entry in entries:
+ if "gles" in filename:
+ if "void" == entry.return_type:
+ return_part = "return"
+ else:
+ return_part = "return (%s)0" % entry.return_type
+
+ print("GL_APICALL %s GL_APIENTRY %s(%s) { %s; }" % (entry.return_type, entry.__name__, ", ".join(entry.vartypes), return_part))
+ else:
+ print("EGLAPI %s EGLAPIENTRY %s(%s);" % (entry.return_type, entry.__name__, entry.parameters))
+
+ namespaces.reverse()
+
+ for ns in namespaces:
+ print("} // namespace %s" % ns)
+
+# The purpose of gen_translator()
+# is to quickly generate implementations on the host Translator,
+# which processes commands that just got onto the renderthread off goldfish pipe
+# and are fed to system OpenGL.
+
+def gen_translator(entries):
+ # Definitions for custom implementation bodies go in
+ # android/scripts/gles3translatorgen/gles30_custom.py
+ # android/scripts/gles3translatorgen/gles31_custom.py
+ from gles3translatorgen import gles30_custom
+ from gles3translatorgen import gles31_custom
+
+ translator_custom_share_processing = { }
+ for (k, v) in list(gles30_custom.custom_share_processing.items()):
+ translator_custom_share_processing[k] = v
+ for (k, v) in list(gles31_custom.custom_share_processing.items()):
+ translator_custom_share_processing[k] = v
+
+ translator_custom_pre = { }
+ for (k, v) in list(gles30_custom.custom_preprocesses.items()):
+ translator_custom_pre[k] = v
+ for (k, v) in list(gles31_custom.custom_preprocesses.items()):
+ translator_custom_pre[k] = v
+
+ translator_custom_post = { }
+ for (k, v) in list(gles30_custom.custom_postprocesses.items()):
+ translator_custom_post[k] = v
+ for (k, v) in list(gles31_custom.custom_postprocesses.items()):
+ translator_custom_post[k] = v
+
+ translator_no_passthrough = {}
+ for (k, v) in list(gles30_custom.no_passthrough.items()):
+ translator_no_passthrough[k] = v
+ for (k, v) in list(gles31_custom.no_passthrough.items()):
+ translator_no_passthrough[k] = v
+
+ translator_needexternc = {
+ "glGetStringi": 1,
+ "glUniform4ui": 1,
+ "glGetUniformIndices": 1,
+ "glTransformFeedbackVaryings": 1,
+ "glCreateShaderProgramv": 1,
+ "glProgramUniform2ui": 1,
+ "glProgramUniform3ui": 1,
+ "glProgramUniform4ui": 1,
+ "glBindVertexBuffer": 1,
+ };
+ translator_nocontext_fail_codes = {
+ "glClientWaitSync" : "GL_WAIT_FAILED",
+ };
+ def needExternC(entry):
+ if entry.__name__ in translator_needexternc:
+ return "extern \"C\" "
+ else:
+ return ""
+ def get_fail_code(entry):
+ if entry.__name__ in translator_nocontext_fail_codes:
+ return translator_nocontext_fail_codes[entry.__name__];
+ else:
+ return "0"
+ def gen_cxt_getter(entry):
+ if (entry.return_type == "void"):
+ print(" GET_CTX_V2();")
+ else:
+ print(" GET_CTX_V2_RET(%s);" % get_fail_code(entry))
+
+ def gen_validations_custom_impl(entry):
+ isGen = entry.__name__.startswith("glGen")
+ isDelete = entry.__name__.startswith("glDelete")
+ isBufferOp = "Buffer" in entry.__name__
+
+ hasTargetArg = "target" in entry.varnames
+ hasProgramArg = "program" in entry.varnames
+
+ def mySetError(condition, glerr):
+ if entry.return_type == "void":
+ return "SET_ERROR_IF(%s,%s)" % (condition, glerr);
+ else:
+ return "RET_AND_SET_ERROR_IF(%s,%s,%s)" % (condition, glerr, get_fail_code(entry));
+
+ if (isGen or isDelete) and ("n" in entry.varnames):
+ print(" %s;" % mySetError("n < 0", "GL_INVALID_VALUE"));
+ if (isBufferOp and hasTargetArg):
+ print(" %s;" % mySetError("!GLESv2Validate::bufferTarget(ctx, target)", "GL_INVALID_ENUM"));
+ if entry.__name__ in translator_custom_pre:
+ print(translator_custom_pre[entry.__name__])
+
+ def gen_call_ret(entry):
+ globalNameTypes = {
+ ("GLuint", "program") : "NamedObjectType::SHADER_OR_PROGRAM",
+ ("GLuint", "texture") : "NamedObjectType::TEXTURE",
+ ("GLuint", "buffer") : "NamedObjectType::VERTEXBUFFER",
+ ("GLuint", "sampler") : "NamedObjectType::SAMPLER",
+ ("GLuint", "query") : "NamedObjectType::QUERY",
+ }
+ globalNames = {
+ ("GLuint", "program") : "globalProgramName",
+ ("GLuint", "texture") : "globalTextureName",
+ ("GLuint", "buffer") : "globalBufferName",
+ ("GLuint", "sampler") : "globalSampler",
+ ("GLuint", "query") : "globalQuery",
+ }
+
+ needsShareGroup = False
+ for v in zip(entry.vartypes, entry.varnames):
+ if v in list(globalNameTypes.keys()):
+ needsShareGroup = True
+
+ if needsShareGroup:
+ print(" if (ctx->shareGroup().get()) {")
+ for key in zip(entry.vartypes, entry.varnames):
+ vartype, varname = key
+ if key in globalNames:
+ print(" const GLuint %s = ctx->shareGroup()->getGlobalName(%s, %s);" % (globalNames[key], globalNameTypes[key], varname))
+
+ globalCall = ", ".join([globalNames.get(k, k[1]) for k in zip(entry.vartypes, entry.varnames)])
+
+ if needsShareGroup and entry.__name__ in translator_custom_share_processing:
+ print(translator_custom_share_processing[entry.__name__])
+
+ if (entry.return_type == "void"):
+ if (needsShareGroup):
+ print(" ")
+
+ if entry.__name__ not in translator_no_passthrough:
+ print(" ctx->dispatcher().%s(%s);" % (entry.__name__, globalCall))
+
+ if needsShareGroup:
+ print(" }")
+ if entry.__name__ in translator_custom_post:
+ print(translator_custom_post[entry.__name__]);
+ else:
+ if (needsShareGroup):
+ print(" ")
+ if entry.__name__ not in translator_no_passthrough:
+ print(" %s %s = ctx->dispatcher().%s(%s);" % (entry.return_type, entry.__name__ + "RET", entry.__name__, globalCall))
+ else:
+ print(" %s %s = %s" % (entry.return_type, entry_func_name + "RET", get_fail_code(entry)))
+
+ if entry.__name__ in translator_custom_post:
+ print(translator_custom_post[entry.__name__]);
+
+ print(" return %s;" % (entry.__name__ + "RET"));
+ if needsShareGroup:
+ print(" } else return %s;" % (get_fail_code(entry)))
+
+ print("// Auto-generated with: %s" % banner_command(sys.argv))
+ print("// This file is best left unedited.")
+ print("// Try to make changes through gen_translator in gen-entries.py,")
+ print("// and/or parcel out custom functionality in separate code.")
+ for entry in entries:
+ print("%sGL_APICALL %s GL_APIENTRY %s(%s) {" % (needExternC(entry), entry.return_type, entry.__name__, entry.parameters))
+ gen_cxt_getter(entry);
+ gen_validations_custom_impl(entry);
+ gen_call_ret(entry);
+ print("}\n")
+
+def gen_dll_wrapper(entries, prefix_name, verbatim, filename):
+ """Generate a C source file that contains functions that act as wrappers
+ for entry points located in another shared library. This allows the
+ code that calls these functions to perform lazy-linking to system
+ libraries.
+ |entries|, |prefix_name|, |verbatim| and |filename| are the same as
+ for gen_functions_header() above.
+ """
+ upper_name = prefix_name.upper()
+
+ ENTRY_PREFIX = "__dll_"
+
+ print("// Auto-generated with: %s" % banner_command(sys.argv))
+ print("// DO NOT EDIT THIS FILE")
+ print("")
+ print("#include <dlfcn.h>")
+ for line in verbatim:
+ print(line)
+
+ print("")
+ print("///")
+ print("/// W R A P P E R P O I N T E R S")
+ print("///")
+ print("")
+ for entry in entries:
+ ptr_name = ENTRY_PREFIX + entry.__name__
+ print("static %s (*%s)(%s) = 0;" % \
+ (entry.return_type, ptr_name, entry.parameters))
+
+ print("")
+ print("///")
+ print("/// W R A P P E R F U N C T I O N S")
+ print("///")
+ print("")
+
+ for entry in entries:
+ print("%s %s(%s) {" % \
+ (entry.return_type, entry.__name__, entry.parameters))
+ ptr_name = ENTRY_PREFIX + entry.__name__
+ if entry.return_type != "void":
+ print(" return %s(%s);" % (ptr_name, entry.call))
+ else:
+ print(" %s(%s);" % (ptr_name, entry.call))
+ print("}\n")
+
+ print("")
+ print("///")
+ print("/// I N I T I A L I Z A T I O N F U N C T I O N")
+ print("///")
+ print("")
+
+ print("int %s_dynlink_init(void* lib) {" % prefix_name)
+ for entry in entries:
+ ptr_name = ENTRY_PREFIX + entry.__name__
+ print(" %s = (%s(*)(%s))dlsym(lib, \"%s\");" % \
+ (ptr_name,
+ entry.return_type,
+ entry.parameters,
+ entry.__name__))
+ print(" if (!%s) return -1;" % ptr_name)
+ print(" return 0;")
+ print("}")
+
+
+def gen_windows_def_file(entries):
+ """Generate a windows DLL .def file. |entries| is a list of Entry instances.
+ """
+ print("EXPORTS")
+ for entry in entries:
+ print(" %s" % entry.__name__)
+
+
+def gen_unix_sym_file(entries):
+ """Generate an ELF linker version file. |entries| is a list of Entry
+ instances.
+ """
+ print("VERSION {")
+ print("\tglobal:")
+ for entry in entries:
+ print("\t\t%s;" % entry.__name__)
+ print("\tlocal:")
+ print("\t\t*;")
+ print("};")
+
+def gen_symbols(entries, underscore):
+ """Generate a list of symbols from |entries|, a list of Entry instances.
+ |underscore| is a boolean. If True, then prepend an underscore to each
+ symbol name.
+ """
+ prefix = ""
+ if underscore:
+ prefix = "_"
+ for entry in entries:
+ print("%s%s" % (prefix, entry.__name__))
+
+
+VARTYPE_TO_PRINT_FORMAT = {
+ 'GLenum': '0x%X',
+ 'GLboolean': '%d',
+ 'GLbitfield': '%d',
+ 'GLvoid': '%d',
+ 'GLubyte': '%u',
+ 'GLbyte': '%c',
+ 'GLshort': '%d',
+ 'GLushort': '%d',
+ 'GLint': '%d',
+ 'GLuint': '%d',
+ 'GLclampx': '%d',
+ 'GLsizei': '%d',
+ 'GLfloat': '%f',
+ 'GLclampf': '%f',
+ 'GLdouble': '%f',
+ 'GLclampd': '%f',
+ 'GLchar': '%c',
+ 'GLcharARB': '%c',
+ 'GLfixed': '%d',
+ 'GLintptr': '%ld',
+ 'GLsizeiptr': '%ld',
+ 'GLsync': '%p',
+ 'GLuint64': "%lu",
+ 'GLeglImageOES': '%p',
+}
+
+def get_printf_format(var_type, var_name):
+ if '*' in var_type:
+ return "%p"
+
+ if '[' in var_name:
+ return "%p"
+
+ # Function pointer
+ if 'PROC' in var_type:
+ return "%p"
+
+ return VARTYPE_TO_PRINT_FORMAT[var_type]
+
+def get_printf_name(var_name):
+ if '[' in var_name:
+ return var_name[:var_name.index('[')]
+
+ return var_name
+
+def gen_dispatch_logging_wrappers(entries):
+ print("// Auto-generated with: %s" % banner_command(sys.argv))
+ print("// DO NOT EDIT THIS FILE")
+ print("")
+
+ for entry in entries:
+ print("%s %s_dispatchLoggingWrapper(%s) {" % \
+ (entry.return_type, entry.__name__, entry.parameters))
+
+ print_var_formats = []
+ print_var_names = []
+ for (param_type, param_name) in zip(entry.vartypes, entry.varnames):
+ print_var_formats.append("%s:%s" % (param_name, get_printf_format(param_type, param_name)))
+ print_var_names.append(get_printf_name(param_name))
+
+ optional_comma = ", " if print_var_formats else ""
+ print("\tDISPATCH_DEBUG_LOG(\"%s(%s)\"%s%s);"
+ % (entry.__name__, ", ".join(print_var_formats), optional_comma, ", ".join(print_var_names)))
+
+ if entry.return_type == "void":
+ optional_return = ""
+ else:
+ optional_return = "return "
+
+ print("\t%sGLDispatch::%s_underlying(%s);" % (optional_return, entry.__name__, ", ".join(print_var_names)))
+ print("}")
+ print("")
+
+
+def parse_file(filename, lines, mode):
+ """Generate one of possible outputs from |filename|. |lines| must be a list
+ of text lines from the file, and |mode| is one of the --mode option
+ values.
+ """
+ entries, prefix_name, verbatim, namespaces, errors = parse_entries_file(lines)
+ if errors:
+ for error in errors:
+ sys.stderr.write("ERROR: %s:%s" % (filename, error))
+ sys.exit(1)
+
+ if not prefix_name:
+ prefix_name = "unknown"
+
+ if mode == 'def':
+ gen_windows_def_file(entries)
+ elif mode == 'sym':
+ gen_unix_sym_file(entries)
+ elif mode == 'translator_passthrough':
+ gen_translator(entries)
+ elif mode == 'wrapper':
+ gen_dll_wrapper(entries, prefix_name, verbatim, filename)
+ elif mode == 'symbols':
+ gen_symbols(entries, False)
+ elif mode == '_symbols':
+ gen_symbols(entries, True)
+ elif mode == 'functions':
+ gen_functions_header(entries, prefix_name, verbatim, filename, False)
+ elif mode == 'funcargs':
+ gen_functions_header(entries, prefix_name, verbatim, filename, True)
+ elif mode == 'static_translator_namespaced_header':
+ gen_static_translator_namespaced_header(entries, namespaces, prefix_name, verbatim, filename, True)
+ elif mode == 'static_translator_namespaced_stubs':
+ gen_static_translator_namespaced_stubs(entries, namespaces, prefix_name, verbatim, filename, True)
+ elif mode == 'dispatch_logging_wrappers':
+ gen_dispatch_logging_wrappers(entries)
+
+# List of valid --mode option values.
+mode_list = [
+ 'def', 'sym', 'translator_passthrough', 'wrapper', 'symbols', '_symbols', 'functions', 'funcargs', 'static_translator_namespaced_header', 'static_translator_namespaced_stubs', 'dispatch_logging_wrappers',
+]
+
+# Argument parsing.
+parser = argparse.ArgumentParser(
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ description="""\
+A script used to parse an .entries input file containing a list of function
+declarations, and generate various output files depending on the value of
+the --mode option, which can be:
+
+ def Generate a windows DLL .def file.
+ sym Generate a Unix .so linker script.
+ wrapper Generate a C source file containing wrapper functions.
+ symbols Generate a simple list of symbols, one per line.
+ _symbols Generate a simple list of symbols, prefixed with _.
+ functions Generate a C header containing a macro listing all functions.
+ funcargs Like 'functions', but adds function call arguments to listing.
+ static_translator_namespaced_header Generate C++ header with namespaced versions of the api declarations.
+ dispatch_logging_wrappers Generate C++ functions which debug log the function with arguments and then call the underlying function.
+
+""")
+parser.add_argument("--mode", help="Output mode", choices=mode_list)
+parser.add_argument("--output", help="output file")
+parser.add_argument("file", help=".entries file path")
+
+args = parser.parse_args()
+
+if not args.mode:
+ sys,stderr.write("ERROR: Please use --mode=<name>, see --help.")
+ sys.exit(1)
+
+if args.output:
+ sys.stdout = open(args.output, "w+")
+
+if args.file == '--':
+ parse_file("<stdin>", sys.stdin, args.mode)
+else:
+ parse_file(args.file, open(args.file), args.mode)
diff --git a/src/gfxstream/scripts/generate-apigen-sources.sh b/src/gfxstream/scripts/generate-apigen-sources.sh
new file mode 100755
index 00000000000..dd75f1044da
--- /dev/null
+++ b/src/gfxstream/scripts/generate-apigen-sources.sh
@@ -0,0 +1,26 @@
+set -x
+
+# The encoders use the prefix GL while the decoders use the prefix GLES
+cp -f codegen/gles1/gles1.attrib codegen/gles1/gl.attrib
+cp -f codegen/gles1/gles1.in codegen/gles1/gl.in
+cp -f codegen/gles1/gles1.types codegen/gles1/gl.types
+./build/gfxstream-generic-apigen -i ./codegen/gles1 -D ./host/gl/gles1_dec gles1
+./build/gfxstream-generic-apigen -i ./codegen/gles1 -E ./guest/GLESv1_enc gl
+rm codegen/gles1/gl.attrib
+rm codegen/gles1/gl.in
+rm codegen/gles1/gl.types
+
+cp -f codegen/gles2/gles2.attrib codegen/gles2/gl2.attrib
+cp -f codegen/gles2/gles2.in codegen/gles2/gl2.in
+cp -f codegen/gles2/gles2.types codegen/gles2/gl2.types
+./build/gfxstream-generic-apigen -i ./codegen/gles2 -D ./host/gl/gles2_dec gles2
+./build/gfxstream-generic-apigen -i ./codegen/gles2 -E ./guest/GLESv2_enc gl2
+rm codegen/gles2/gl2.attrib
+rm codegen/gles2/gl2.in
+rm codegen/gles2/gl2.types
+
+./build/gfxstream-generic-apigen -i ./codegen/renderControl -D ./host/renderControl_dec renderControl
+./build/gfxstream-generic-apigen -i ./codegen/renderControl -E ./guest/renderControl_enc renderControl
+
+./build/gfxstream-generic-apigen -i ./codegen/magma -D ./host/magma/magma_dec magma
+./build/gfxstream-generic-apigen -i ./codegen/magma -E ./guest/magma/magma_enc magma \ No newline at end of file
diff --git a/src/gfxstream/scripts/generate-compositor-shader-headers.sh b/src/gfxstream/scripts/generate-compositor-shader-headers.sh
new file mode 100644
index 00000000000..4a69b17ac1d
--- /dev/null
+++ b/src/gfxstream/scripts/generate-compositor-shader-headers.sh
@@ -0,0 +1,2 @@
+py scripts/glsl-shader-to-spv-c-array.py stream-servers/vulkan/Compositor.vert stream-servers/vulkan/CompositorVertexShader.h compositorVertexShader
+py scripts/glsl-shader-to-spv-c-array.py stream-servers/vulkan/Compositor.frag stream-servers/vulkan/CompositorFragmentShader.h compositorFragmentShader \ No newline at end of file
diff --git a/src/gfxstream/scripts/generate-dispatch-headers.sh b/src/gfxstream/scripts/generate-dispatch-headers.sh
new file mode 100755
index 00000000000..6b2bca5e18d
--- /dev/null
+++ b/src/gfxstream/scripts/generate-dispatch-headers.sh
@@ -0,0 +1,94 @@
+#!/bin/sh
+
+# Copyright 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.
+
+PROGRAM_PARAMETERS=""
+
+PROGRAM_DESCRIPTION=\
+"Regenerate static translator headers for EGL/GLES1/GLES2,3."
+
+ENTRIES_DIR=stream-servers/gl/OpenGLESDispatch
+HEADER_OUT_DIR=include/OpenGLESDispatch
+IMPL_OUT_DIR=stream-servers/gl/OpenGLESDispatch
+
+function gen_entries_with_mode() {
+ local mode=$1
+ local entries_file=$2
+ local output_path=$3
+ scripts/gen-entries.py --mode=$mode $entries_file --output=$output_path
+}
+
+function funcargs_header() {
+ gen_entries_with_mode funcargs $1 $2
+}
+
+function functions_header() {
+ gen_entries_with_mode functions $1 $2
+}
+
+function static_translator_namespaced_header() {
+ gen_entries_with_mode static_translator_namespaced_header $1 $2
+}
+
+function static_translator_namespaced_stubs() {
+ gen_entries_with_mode static_translator_namespaced_stubs $1 $2
+}
+
+function dispatch_logging_wrappers() {
+ gen_entries_with_mode dispatch_logging_wrappers $1 $2
+}
+
+functions_header $ENTRIES_DIR/render_egl.entries $HEADER_OUT_DIR/RenderEGL_functions.h
+functions_header $ENTRIES_DIR/render_egl_extensions.entries $HEADER_OUT_DIR/RenderEGL_extensions_functions.h
+functions_header $ENTRIES_DIR/render_egl_snapshot.entries $HEADER_OUT_DIR/RenderEGL_snapshot_functions.h
+
+funcargs_header $ENTRIES_DIR/gles1_extensions.entries $HEADER_OUT_DIR/gles1_extensions_functions.h
+funcargs_header $ENTRIES_DIR/gles1_only.entries $HEADER_OUT_DIR/gles1_only_functions.h
+funcargs_header $ENTRIES_DIR/gles2_extensions.entries $HEADER_OUT_DIR/gles2_extensions_functions.h
+funcargs_header $ENTRIES_DIR/gles2_only.entries $HEADER_OUT_DIR/gles2_only_functions.h
+funcargs_header $ENTRIES_DIR/gles31_only.entries $HEADER_OUT_DIR/gles31_only_functions.h
+funcargs_header $ENTRIES_DIR/gles3_extensions.entries $HEADER_OUT_DIR/gles3_extensions_functions.h
+funcargs_header $ENTRIES_DIR/gles3_only.entries $HEADER_OUT_DIR/gles3_only_functions.h
+funcargs_header $ENTRIES_DIR/gles_common.entries $HEADER_OUT_DIR/gles_common_functions.h
+funcargs_header $ENTRIES_DIR/gles_extensions.entries $HEADER_OUT_DIR/gles_extensions_functions.h
+
+static_translator_namespaced_header $ENTRIES_DIR/render_egl.entries $HEADER_OUT_DIR/RenderEGL_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/render_egl_extensions.entries $HEADER_OUT_DIR/RenderEGL_extensions_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/render_egl_snapshot.entries $HEADER_OUT_DIR/RenderEGL_snapshot_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles1_extensions.entries $HEADER_OUT_DIR/gles1_extensions_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles1_only.entries $HEADER_OUT_DIR/gles1_only_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles2_extensions.entries $HEADER_OUT_DIR/gles2_extensions_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles2_only.entries $HEADER_OUT_DIR/gles2_only_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles31_only.entries $HEADER_OUT_DIR/gles31_only_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles3_extensions.entries $HEADER_OUT_DIR/gles3_extensions_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles3_only.entries $HEADER_OUT_DIR/gles3_only_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles_common_for_gles1.entries $HEADER_OUT_DIR/gles_common_for_gles1_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles_common_for_gles2.entries $HEADER_OUT_DIR/gles_common_for_gles2_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles_extensions_for_gles1.entries $HEADER_OUT_DIR/gles_extensions_for_gles1_static_translator_namespaced_header.h
+static_translator_namespaced_header $ENTRIES_DIR/gles_extensions_for_gles2.entries $HEADER_OUT_DIR/gles_extensions_for_gles2_static_translator_namespaced_header.h
+
+static_translator_namespaced_stubs $ENTRIES_DIR/gles1_stubbed_in_translator_namespace.entries $IMPL_OUT_DIR/gles1_stubbed_in_translator_namespace.cpp
+static_translator_namespaced_stubs $ENTRIES_DIR/gles2_stubbed_in_translator_namespace.entries $IMPL_OUT_DIR/gles2_stubbed_in_translator_namespace.cpp
+
+dispatch_logging_wrappers $ENTRIES_DIR/gles_common.entries $IMPL_OUT_DIR/gles_common_dispatch_logging_wrappers.impl
+dispatch_logging_wrappers $ENTRIES_DIR/gles_extensions.entries $IMPL_OUT_DIR/gles_extensions_dispatch_logging_wrappers.impl
+dispatch_logging_wrappers $ENTRIES_DIR/gles1_extensions.entries $IMPL_OUT_DIR/gles1_extensions_dispatch_logging_wrappers.impl
+dispatch_logging_wrappers $ENTRIES_DIR/gles1_only.entries $IMPL_OUT_DIR/gles1_only_dispatch_logging_wrappers.impl
+dispatch_logging_wrappers $ENTRIES_DIR/gles2_extensions.entries $IMPL_OUT_DIR/gles2_extensions_dispatch_logging_wrappers.impl
+dispatch_logging_wrappers $ENTRIES_DIR/gles2_only.entries $IMPL_OUT_DIR/gles2_only_dispatch_logging_wrappers.impl
+dispatch_logging_wrappers $ENTRIES_DIR/gles3_extensions.entries $IMPL_OUT_DIR/gles3_extensions_dispatch_logging_wrappers.impl
+dispatch_logging_wrappers $ENTRIES_DIR/gles3_only.entries $IMPL_OUT_DIR/gles3_only_dispatch_logging_wrappers.impl
+dispatch_logging_wrappers $ENTRIES_DIR/gles31_only.entries $IMPL_OUT_DIR/gles31_only_dispatch_logging_wrappers.impl
+dispatch_logging_wrappers $ENTRIES_DIR/gles32_only.entries $IMPL_OUT_DIR/gles32_only_dispatch_logging_wrappers.impl
diff --git a/src/gfxstream/scripts/generate-gfxstream-vulkan.sh b/src/gfxstream/scripts/generate-gfxstream-vulkan.sh
new file mode 100755
index 00000000000..eea57f91466
--- /dev/null
+++ b/src/gfxstream/scripts/generate-gfxstream-vulkan.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# 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.
+
+export GFXSTREAM_DIR=$(pwd)
+
+if [ -z "$1" ];
+then
+ export GFXSTREAM_GUEST_DIR=$GFXSTREAM_DIR/guest
+else
+ export GFXSTREAM_GUEST_DIR=$1
+fi
+
+# Detect clang-format
+#if ! $WHICH clang-format > /dev/null; then
+# echo "Failed to find clang-format." 1>&2
+# exit 1
+#fi
+
+export GFXSTREAM_GUEST_ENCODER_DIR=$GFXSTREAM_GUEST_DIR/vulkan_enc
+export GFXSTREAM_HOST_DECODER_DIR=$GFXSTREAM_DIR/host/vulkan
+export GFXSTREAM_OUTPUT_DIR=$GFXSTREAM_HOST_DECODER_DIR/cereal
+export GFXSTREAM_SCRIPTS_DIR=$GFXSTREAM_DIR/scripts
+
+export GEN_VK=$GFXSTREAM_DIR/codegen/vulkan/vulkan-docs-next/scripts/genvk.py
+export VK_XML=$GFXSTREAM_DIR/codegen/vulkan/vulkan-docs-next/xml/vk.xml
+export CUSTOM_XML=$GFXSTREAM_DIR/codegen/vulkan/vulkan-docs-next/xml/vk_gfxstream.xml
+
+python3 $GEN_VK -registry $VK_XML -registryGfxstream $CUSTOM_XML cereal -o $GFXSTREAM_OUTPUT_DIR
+
+# Should have a unified headers dir here:
+python3 $GEN_VK -registry $CUSTOM_XML vulkan_gfxstream.h -o $GFXSTREAM_GUEST_ENCODER_DIR
+python3 $GEN_VK -registry $CUSTOM_XML vulkan_gfxstream.h -o $GFXSTREAM_HOST_DECODER_DIR
diff --git a/src/gfxstream/scripts/gles3translatorgen/__init__.py b/src/gfxstream/scripts/gles3translatorgen/__init__.py
new file mode 100644
index 00000000000..52d6c7571e3
--- /dev/null
+++ b/src/gfxstream/scripts/gles3translatorgen/__init__.py
@@ -0,0 +1,17 @@
+#
+# 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.
+
+from . import gles30_custom
+from . import gles31_custom
diff --git a/src/gfxstream/scripts/gles3translatorgen/gles30_custom.py b/src/gfxstream/scripts/gles3translatorgen/gles30_custom.py
new file mode 100644
index 00000000000..e762d3184ef
--- /dev/null
+++ b/src/gfxstream/scripts/gles3translatorgen/gles30_custom.py
@@ -0,0 +1,211 @@
+custom_preprocesses = {
+"glBindVertexArray" : """
+ ctx->setVertexArrayObject(array);
+""",
+
+"glDeleteVertexArrays" : """
+ ctx->removeVertexArrayObjects(n, arrays);
+""",
+
+"glBindBufferRange" : """
+ ctx->bindBuffer(target, buffer);
+ ctx->bindIndexedBuffer(target, index, buffer, offset, size);
+""",
+
+"glBindBufferBase" : """
+ ctx->bindBuffer(target, buffer);
+ ctx->bindIndexedBuffer(target, index, buffer);
+""",
+
+"glVertexAttribIPointer" : """
+ SET_ERROR_IF((!GLESv2Validate::arrayIndex(ctx,index)),GL_INVALID_VALUE);
+ s_glPrepareVertexAttribPointer(ctx, index, size, type, false, stride, pointer, true);
+ if (ctx->isBindedBuffer(GL_ARRAY_BUFFER)) {
+""",
+
+"glVertexAttribDivisor" : """
+ SET_ERROR_IF((!GLESv2Validate::arrayIndex(ctx,index)),GL_INVALID_VALUE);
+ ctx->setVertexAttribBindingIndex(index, index);
+ ctx->setVertexAttribDivisor(index, divisor);
+""",
+
+"glRenderbufferStorageMultisample" : """
+ GLint err = GL_NO_ERROR;
+ internalformat = sPrepareRenderbufferStorage(internalformat, &err);
+ SET_ERROR_IF(err != GL_NO_ERROR, err);
+""",
+
+"glFramebufferTextureLayer" : """
+ GLenum textarget = GL_TEXTURE_2D_ARRAY;
+ SET_ERROR_IF(!(GLESv2Validate::framebufferTarget(ctx, target) &&
+ GLESv2Validate::framebufferAttachment(ctx, attachment)), GL_INVALID_ENUM);
+ if (texture) {
+ if (!ctx->shareGroup()->isObject(NamedObjectType::TEXTURE, texture)) {
+ ctx->shareGroup()->genName(NamedObjectType::TEXTURE, texture);
+ }
+ TextureData* texData = getTextureData(texture);
+ textarget = texData->target;
+ }
+""",
+
+"glTexStorage2D" : """
+ GLint err = GL_NO_ERROR;
+ GLenum format, type;
+ GLESv2Validate::getCompatibleFormatTypeForInternalFormat(internalformat, &format, &type);
+ for (GLsizei i = 0; i < levels; i++)
+ sPrepareTexImage2D(target, i, (GLint)internalformat, width, height, 0, format, type, NULL, &type, (GLint*)&internalformat, &err);
+ SET_ERROR_IF(err != GL_NO_ERROR, err);
+""",
+
+"glGenSamplers" : """
+ if(ctx->shareGroup().get()) {
+ for(int i=0; i<n ;i++) {
+ samplers[i] = ctx->shareGroup()->genName(NamedObjectType::SAMPLER,
+ 0, true);
+ }
+ }
+""",
+
+"glDeleteSamplers" : """
+ if(ctx->shareGroup().get()) {
+ for(int i=0; i<n ;i++) {
+ ctx->shareGroup()->deleteName(NamedObjectType::SAMPLER, samplers[i]);
+ }
+ }
+""",
+
+"glGenQueries" : """
+ if(ctx->shareGroup().get()) {
+ for(int i=0; i<n ;i++) {
+ queries[i] = ctx->shareGroup()->genName(NamedObjectType::QUERY,
+ 0, true);
+ }
+ }
+""",
+
+"glDeleteQueries" : """
+ if(ctx->shareGroup().get()) {
+ for(int i=0; i<n ;i++) {
+ ctx->shareGroup()->deleteName(NamedObjectType::QUERY, queries[i]);
+ }
+ }
+""",
+
+"glTexImage3D" : """
+ SET_ERROR_IF(!GLESv2Validate::isCompressedFormat(internalFormat) &&
+ !GLESv2Validate::pixelSizedFrmt(ctx, internalFormat, format, type),
+ GL_INVALID_OPERATION);
+ s_glInitTexImage3D(target, level, internalFormat, width, height, depth, border);
+""",
+
+"glTexStorage3D" : """
+ for (int i = 0; i < levels; i++) {
+ s_glInitTexImage3D(target, i, internalformat, width, height, depth, 0);
+ }
+""",
+
+"glDrawArraysInstanced" : """
+ SET_ERROR_IF(count < 0,GL_INVALID_VALUE)
+ SET_ERROR_IF(!(GLESv2Validate::drawMode(mode)),GL_INVALID_ENUM);
+ s_glDrawPre(ctx, mode);
+ if (ctx->isBindedBuffer(GL_ARRAY_BUFFER)) {
+ ctx->dispatcher().glDrawArraysInstanced(mode, first, count, primcount);
+ } else {
+ GLESConversionArrays tmpArrs;
+ s_glDrawSetupArraysPre(ctx, tmpArrs, first, count, 0, NULL, true);
+ ctx->dispatcher().glDrawArrays(mode,first,count);
+ s_glDrawSetupArraysPost(ctx);
+ }
+ s_glDrawPost(ctx, mode);
+""",
+
+"glDrawElementsInstanced" : """
+ SET_ERROR_IF(count < 0,GL_INVALID_VALUE)
+ SET_ERROR_IF(!(GLESv2Validate::drawMode(mode) && GLESv2Validate::drawType(type)),GL_INVALID_ENUM);
+ s_glDrawPre(ctx, mode);
+ if (ctx->isBindedBuffer(GL_ELEMENT_ARRAY_BUFFER)) {
+ ctx->dispatcher().glDrawElementsInstanced(mode,count,type,indices, primcount);
+ } else {
+ s_glDrawEmulateClientArraysPre(ctx);
+ GLESConversionArrays tmpArrs;
+ s_glDrawSetupArraysPre(ctx,tmpArrs,0,count,type,indices,false);
+ ctx->dispatcher().glDrawElementsInstanced(mode,count,type,indices, primcount);
+ s_glDrawSetupArraysPost(ctx);
+ s_glDrawEmulateClientArraysPost(ctx);
+ }
+ s_glDrawPost(ctx, mode);
+""",
+
+"glDrawRangeElements" : """
+ SET_ERROR_IF(count < 0,GL_INVALID_VALUE)
+ SET_ERROR_IF(!(GLESv2Validate::drawMode(mode) && GLESv2Validate::drawType(type)),GL_INVALID_ENUM);
+ s_glDrawPre(ctx, mode);
+ if (ctx->isBindedBuffer(GL_ELEMENT_ARRAY_BUFFER)) {
+ ctx->dispatcher().glDrawRangeElements(mode,start,end,count,type,indices);
+ } else {
+ s_glDrawEmulateClientArraysPre(ctx);
+ GLESConversionArrays tmpArrs;
+ s_glDrawSetupArraysPre(ctx,tmpArrs,0,count,type,indices,false);
+ ctx->dispatcher().glDrawRangeElements(mode,start,end,count,type,indices);
+ s_glDrawSetupArraysPost(ctx);
+ s_glDrawEmulateClientArraysPost(ctx);
+ }
+ s_glDrawPost(ctx, mode);
+""",
+
+"glGetUniformuiv" : """
+ SET_ERROR_IF(location < 0,GL_INVALID_OPERATION);
+""",
+}
+
+custom_postprocesses = {
+"glGenVertexArrays" : """
+ ctx->addVertexArrayObjects(n, arrays);
+""",
+"glVertexAttribIPointer" : """
+ }
+""",
+"glFramebufferTextureLayer" : """
+ GLuint fbName = ctx->getFramebufferBinding(target);
+ auto fbObj = ctx->shareGroup()->getObjectData(
+ NamedObjectType::FRAMEBUFFER, fbName);
+ if (fbObj) {
+ FramebufferData *fbData = (FramebufferData *)fbObj;
+ fbData->setAttachment(attachment, textarget,
+ texture, ObjectDataPtr());
+ }
+""",
+"glGetInteger64v" : """
+ s_glStateQueryTv<GLint64>(true, pname, data, s_glGetInteger64v_wrapper);
+""",
+"glGetIntegeri_v" : """
+ s_glStateQueryTi_v<GLint>(target, index, data, s_glGetIntegeri_v_wrapper);
+""",
+"glGetInteger64i_v" : """
+ s_glStateQueryTi_v<GLint64>(target, index, data, s_glGetInteger64i_v_wrapper);
+""",
+}
+
+custom_share_processing = {
+"glBindSampler" : """
+ SET_ERROR_IF(sampler && !globalSampler, GL_INVALID_OPERATION);
+""",
+"glGetUniformuiv" : """
+ SET_ERROR_IF(globalProgramName==0, GL_INVALID_VALUE);
+ auto objData = ctx->shareGroup()->getObjectData(
+ NamedObjectType::SHADER_OR_PROGRAM, program);
+ SET_ERROR_IF(objData->getDataType()!=PROGRAM_DATA,GL_INVALID_OPERATION);
+ ProgramData* pData = (ProgramData *)objData;
+ SET_ERROR_IF(pData->getLinkStatus() != GL_TRUE,GL_INVALID_OPERATION);
+""",
+}
+
+no_passthrough = {
+ "glGenSamplers": True,
+ "glDeleteSamplers": True,
+ "glGenQueries": True,
+ "glDeleteQueries": True,
+ "glGetInteger64_v": True,
+ "glGetIntegeri_v": True,
+ "glGetInteger64i_v": True,
+} \ No newline at end of file
diff --git a/src/gfxstream/scripts/gles3translatorgen/gles31_custom.py b/src/gfxstream/scripts/gles3translatorgen/gles31_custom.py
new file mode 100644
index 00000000000..64396098d0e
--- /dev/null
+++ b/src/gfxstream/scripts/gles3translatorgen/gles31_custom.py
@@ -0,0 +1,38 @@
+custom_preprocesses = {
+"glBindVertexBuffer" : """
+ ctx->bindIndexedBuffer(0, bindingindex, buffer, offset, 0, stride);
+""",
+
+"glVertexAttribBinding" : """
+ ctx->setVertexAttribBindingIndex(attribindex, bindingindex);
+""",
+
+"glVertexAttribFormat" : """
+ ctx->setVertexAttribFormat(attribindex, size, type, normalized, relativeoffset, false);
+""",
+
+"glVertexAttribIFormat" : """
+ ctx->setVertexAttribFormat(attribindex, size, type, GL_FALSE, relativeoffset, true);
+""",
+
+"glVertexBindingDivisor" : """
+ ctx->setVertexAttribDivisor(bindingindex, divisor);
+""",
+
+"glTexStorage2DMultisample" : """
+ GLint err = GL_NO_ERROR;
+ GLenum format, type;
+ GLESv2Validate::getCompatibleFormatTypeForInternalFormat(internalformat, &format, &type);
+ sPrepareTexImage2D(target, 0, (GLint)internalformat, width, height, 0, format, type, NULL, &type, (GLint*)&internalformat, &err);
+ SET_ERROR_IF(err != GL_NO_ERROR, err);
+""",
+}
+
+custom_postprocesses = {
+}
+
+custom_share_processing = {
+}
+
+no_passthrough = {
+} \ No newline at end of file
diff --git a/src/gfxstream/scripts/glsl-shader-to-spv-c-array.py b/src/gfxstream/scripts/glsl-shader-to-spv-c-array.py
new file mode 100755
index 00000000000..a2ec5dc86e2
--- /dev/null
+++ b/src/gfxstream/scripts/glsl-shader-to-spv-c-array.py
@@ -0,0 +1,72 @@
+#!/usr/bin/python3
+
+import argparse
+import pathlib
+import os
+import subprocess
+from datetime import datetime
+import sys
+
+
+def main():
+ parser = argparse.ArgumentParser(
+ description='Compile glsl source to spv bytes and generate a C file that export the spv bytes as an array.')
+ parser.add_argument('source_file', type=pathlib.Path)
+ parser.add_argument('target_file', type=str)
+ parser.add_argument('export_symbol', type=str)
+ args = parser.parse_args()
+ vulkan_sdk_path = os.getenv('VULKAN_SDK')
+ if vulkan_sdk_path == None:
+ print("Environment variable VULKAN_SDK not set. Please install the LunarG Vulkan SDK and set VULKAN_SDK accordingly")
+ return
+ vulkan_sdk_path = pathlib.Path(vulkan_sdk_path)
+ glslc_path = vulkan_sdk_path / 'bin' / 'glslc'
+ if os.name == 'nt':
+ glslc_path = glslc_path.with_suffix('.exe')
+ if not glslc_path.exists():
+ print("Can't find " + str(glslc_path))
+ return
+ if not args.source_file.exists():
+ print("Can't find source file: " + str(args.source_file))
+ return
+
+ with subprocess.Popen([str(glslc_path), str(args.source_file), '-o', '-'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc, open(args.target_file, mode='wt') as target_file:
+ if proc.wait() != 0:
+ print(proc.stderr.read().decode('utf-8'))
+ return
+ spv_bytes = proc.stdout.read()
+ spv_bytes = [int.from_bytes(spv_bytes[i:i + 4], byteorder="little")
+ for i in range(0, len(spv_bytes), 4)]
+ chunk_size = 4
+ spv_bytes_chunks = [spv_bytes[i:i + chunk_size]
+ for i in range(0, len(spv_bytes), chunk_size)]
+ spv_bytes_in_c_array = ',\n'.join([', '.join(
+ [f'{spv_byte:#010x}' for spv_byte in spv_bytes_chunk]) for spv_bytes_chunk in spv_bytes_chunks])
+ spv_bytes_in_c_array = f'const uint32_t {args.export_symbol}[] = ' + \
+ '{\n' + spv_bytes_in_c_array + '\n};'
+ comments = f"""// Copyright (C) {datetime.today().year} The Android Open Source Project
+// Copyright (C) {datetime.today().year} 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 {args.target_file}
+// generated by {"python3 " + " ".join(sys.argv)}
+// Please do not modify directly.\n\n"""
+ prelude = "#include <stdint.h>\n\n"
+ target_file.write(comments)
+ target_file.write(prelude)
+ target_file.write(spv_bytes_in_c_array)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/src/gfxstream/scripts/print_gfx_logs/__init__.py b/src/gfxstream/scripts/print_gfx_logs/__init__.py
new file mode 100644
index 00000000000..04b96040431
--- /dev/null
+++ b/src/gfxstream/scripts/print_gfx_logs/__init__.py
@@ -0,0 +1,14 @@
+#
+# 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.
diff --git a/src/gfxstream/scripts/print_gfx_logs/command_printer.py b/src/gfxstream/scripts/print_gfx_logs/command_printer.py
new file mode 100644
index 00000000000..f7979638c66
--- /dev/null
+++ b/src/gfxstream/scripts/print_gfx_logs/command_printer.py
@@ -0,0 +1,243 @@
+#
+# 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.
+
+import io
+from datetime import datetime
+import sys
+import textwrap
+from typing import Dict, Optional
+from . import vulkan_printer
+from . import opcodes
+import struct
+
+
+class CommandPrinter:
+ """This class is responsible for printing the commands found in the minidump file to the terminal."""
+
+ def __init__(self, opcode: int, original_size: int, data: bytes, timestamp: int,
+ stream_idx: int, cmd_idx: int, out=sys.stdout):
+ self.opcode = opcode
+ self.original_size = original_size
+ self.data = io.BytesIO(data)
+ self.timestamp = timestamp
+ self.stream_idx = stream_idx
+ self.cmd_idx = cmd_idx
+ self.out = out
+
+ def print_cmd(self):
+ """
+ Tries to decode and pretty print the command to the terminal.
+ Falls back to printing hex data if the command doesn't have a printer.
+ """
+
+ # Print out the command name
+ print("\n{}.{} - {}: ({} bytes)".format(self.stream_idx, self.cmd_idx, self.cmd_name(),
+ self.original_size - 8), file=self.out)
+ self.write_timestamp(4)
+
+ if len(self.data.getbuffer()) == 0:
+ return
+
+ pretty_printer = getattr(vulkan_printer, self.cmd_name(), None)
+ if not pretty_printer:
+ self.print_raw()
+ return
+
+ try:
+ pretty_printer(self, indent=4)
+ self.check_no_more_bytes()
+ except Exception as ex:
+ print("Error while processing {}: {}".format(self.cmd_name(), repr(ex)), file=self.out)
+ print("Command raw data:", file=self.out)
+ self.print_raw()
+ raise ex
+
+ def check_no_more_bytes(self):
+ """
+ Checks that we processed all the bytes, otherwise there's probably a bug in the decoding
+ logic
+ """
+ if self.data.tell() != len(self.data.getbuffer()):
+ raise BufferError(
+ "Not all data was decoded. Decoded {} bytes but command had {}".format(
+ self.data.tell(), len(self.data.getbuffer())))
+
+ def cmd_name(self) -> str:
+ """Returns the command name (e.g.: "OP_vkBeginCommandBuffer", or the opcode as a string if unknown"""
+ return opcodes.opcodes.get(self.opcode, str(self.opcode))
+
+ def print_raw(self):
+ """Prints the command data as a hex bytes, as a fallback if we don't know how to decode it"""
+ truncated = self.original_size > len(self.data.getbuffer()) + 8
+ indent = 8
+ hex = ' '.join(["{:02x}".format(x) for x in self.data.getbuffer()])
+ if truncated:
+ hex += " [...]"
+ lines = textwrap.wrap(hex, width=16 * 3 + indent, initial_indent=' ' * indent,
+ subsequent_indent=' ' * indent)
+ for l in lines:
+ print(l, file=self.out)
+
+ def read_bytes(self, size: int):
+ buf = self.data.read(size)
+ if len(buf) != size:
+ raise EOFError("Unexpectedly reached the end of the buffer")
+ return buf
+
+ def read_int(self, size: int, signed: bool = False, big_endian: bool = False) -> int:
+ assert size in [1, 2, 4, 8], "Invalid size to read: " + str(size)
+ buf = self.read_bytes(size)
+ byte_order = 'big' if big_endian else 'little'
+ return int.from_bytes(buf, byteorder=byte_order, signed=signed)
+
+ def read_float(self) -> float:
+ buf = self.read_bytes(4)
+ return struct.unpack('f', buf)[0]
+
+ def write(self, msg: str, indent: int):
+ """Prints a string at a given indentation level"""
+ assert type(msg) == str
+ assert type(indent) == int and indent >= 0
+ print(" " * indent + msg, end='', file=self.out)
+
+ def write_int(self,
+ field_name: str,
+ size: int,
+ indent: int,
+ signed: bool = False,
+ big_endian: bool = False,
+ optional: bool = False,
+ count: Optional[int] = None) -> Optional[int]:
+ """
+ Reads and prints integers from the data stream.
+
+ When reading a single int (ie: when count=None), returns the int that was read, otherwise
+ returns None.
+
+ size: size of the integer in bytes
+ indent: indentation level that we should write at
+ signed: whether to treat it as a signed or unsigned int
+ big_endian: whether to treat it as little endian or big endian
+ optional: if True, we will first read an 8 byte boolean value. If that value is false, we
+ will return without further reading.
+ count: how many integers to read, for repeated values.
+ """
+ if optional and self.check_null(field_name, indent):
+ return
+
+ # Write the field name
+ self.write("{name}: ".format(name=field_name), indent)
+
+ if count is not None:
+ values = ["0x{:x}".format(self.read_int(size, signed, big_endian)) for i in
+ range(0, count)]
+ self.write("[{}]\n".format(", ".join(values)), indent=0)
+ else:
+ value = self.read_int(size, signed, big_endian)
+ # Print small values as decimal only, otherwise hex + decimal
+ format_str = ("{val}\n" if value < 10 else "0x{val:x} ({val})\n")
+ self.write(format_str.format(val=value), indent=0)
+ return value
+
+ def write_float(self, field_name: str, indent: int, count: Optional[int] = None):
+ if count is not None:
+ values = [str(self.read_float()) for i in range(0, count)]
+ self.write("{}: [{}]\n".format(field_name, ", ".join(values)), indent)
+ else:
+ self.write("{}: {}\n".format(field_name, self.read_float()), indent)
+
+ def write_enum(self, field_name: str, enum: Dict[int, str], indent: int) -> int:
+ """Reads the next 32-byte int from the data stream, prints it as an enum, and return it"""
+ value = self.read_int(4)
+ self.write("{}: {} ({})\n".format(field_name, enum.get(value, ""), value), indent)
+ return value
+
+ def write_flags(self, field_name: str, enum: Dict[int, str], indent: int):
+ """Reads and prints Vulkan flags (byte masks)"""
+ remaining_flags = flags = self.read_int(4)
+ flags_list = []
+ if remaining_flags == 0xffffffff:
+ # When the value is set to all flags, don't bother listing them all
+ flags_list.append("(all flags)")
+ else:
+ for (value, flag) in enum.items():
+ if value & remaining_flags:
+ remaining_flags ^= value
+ flags_list.append(flag)
+ if remaining_flags != 0:
+ flags_list.insert(0, "0x{:x}".format(remaining_flags))
+ self.write("{}: {} (0x{:x})\n".format(field_name, " | ".join(flags_list), flags), indent)
+
+ def write_stype_and_pnext(self, expected_stype: str, indent: int):
+ """Reads and prints the sType and pNext fields found in many Vulkan structs, while also sanity checking them"""
+ stype = self.write_enum("sType", vulkan_printer.VkStructureType, indent)
+ stype_str = vulkan_printer.VkStructureType.get(stype)
+ if stype_str != expected_stype:
+ raise ValueError("Wrong structure type. Expected: {}, got {} ({}) instead".format(
+ expected_stype, stype, stype_str))
+
+ pnext_size = self.write_int("pNext_size", 4, indent, big_endian=True)
+ if pnext_size != 0:
+ self.write_enum("ext type", vulkan_printer.VkStructureType, indent + 1)
+ raise NotImplementedError("Decoding structs with extensions is not supported")
+
+ def write_timestamp(self, indent):
+ if self.timestamp != 0:
+ self.write(
+ "Recorded at: {}\n".format(datetime.fromtimestamp(self.timestamp / 1000000.0)),
+ indent)
+
+ def check_null(self, field_name: str, indent) -> bool:
+ is_null = self.read_int(8, big_endian=True) == 0
+ if is_null:
+ self.write("{}: (null)\n".format(field_name), indent)
+ return is_null
+
+ def write_struct(self, field_name: str, struct_fn, optional: bool, count: Optional[int],
+ indent: int):
+ """
+ Reads and prints a struct, calling `struct_fn` to pretty-print it
+ optional: whether this is an optional structure. In this case, we will read an int64 first
+ and skip the struct if the result is null.
+ count: how many times this is repeated. Pass None for non-repeated fields.
+ """
+ if optional and self.check_null(field_name, indent):
+ return
+
+ is_repeated = count is not None
+ for i in range(0, count if is_repeated else 1):
+ suffix = " #{}".format(i) if is_repeated else ""
+ self.write("{}{}:\n".format(field_name, suffix), indent)
+ struct_fn(self, indent + 1)
+
+ def write_string(self, field_name: str, size: Optional[int], indent: int):
+ """
+ Reads a null-terminated string from the stream.
+ size: if specified, reads up to this many characters
+ """
+ buf = bytearray()
+ if size is not None:
+ buf = self.read_bytes(size)
+ buf = buf.rstrip(b'\x00')
+ else:
+ # Reads from the string one char at a time, until we find a null
+ # Not the most efficient way of doing this, but whatever
+ while True:
+ c = self.read_int(1)
+ if c == 0:
+ break
+ buf.append(c)
+
+ self.write("{}: \"{}\"\n".format(field_name, buf.decode('utf-8')), indent)
diff --git a/src/gfxstream/scripts/print_gfx_logs/command_printer_test.py b/src/gfxstream/scripts/print_gfx_logs/command_printer_test.py
new file mode 100644
index 00000000000..d7742a2b18f
--- /dev/null
+++ b/src/gfxstream/scripts/print_gfx_logs/command_printer_test.py
@@ -0,0 +1,799 @@
+#
+# 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.
+
+import io
+
+import unittest
+from typing import Dict
+
+from . import opcodes
+from . import command_printer
+
+reverse_opcodes: Dict[str, int] = {v: k for k, v in opcodes.opcodes.items()}
+
+
+class ComandPrinterOutputTestCase(unittest.TestCase):
+ """
+ Tests individual aspects of the command printer logic.
+ """
+
+ def get_printer(self, hex_data: str, timestamp_ms=0):
+ """Helper function to return the command printer"""
+ out = io.StringIO()
+ buf = bytes.fromhex(hex_data)
+ cmd_printer = command_printer.CommandPrinter(
+ 0, len(buf), buf, timestamp_ms, 0, 0, out)
+ return cmd_printer, out
+
+ def test_raises_if_not_all_bytes_decoded(self):
+ # Make a command printer with 5 bytes
+ cmd_printer, output = self.get_printer("01 02 03 04 05")
+ # Decode 4 of them
+ cmd_printer.write_int("foobar", size=4, indent=0)
+ self.assertRaises(BufferError, cmd_printer.check_no_more_bytes)
+
+ def test_decode_int(self):
+ cmd_printer, output = self.get_printer("02 00 00 00")
+ r = cmd_printer.write_int("foobar", size=4, indent=0)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(r, 2)
+ self.assertEqual(output.getvalue(), "foobar: 2\n")
+
+ def test_decode_optional_int(self):
+ cmd_printer, output = self.get_printer("00 00 00 00 00 00 00 01 08")
+ r = cmd_printer.write_int("i", size=1, indent=0, optional=True)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(r, 8)
+ self.assertEqual(output.getvalue(), "i: 8\n")
+
+ def test_decode_missing_int(self):
+ cmd_printer, output = self.get_printer("00 00 00 00 00 00 00 00")
+ r = cmd_printer.write_int("i", size=1, indent=0, optional=True)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(r, None)
+ self.assertEqual(output.getvalue(), "i: (null)\n")
+
+ def test_decode_optional_repeated_int(self):
+ cmd_printer, output = self.get_printer("00 00 00 00 00 00 00 01 02 00 03 00")
+ cmd_printer.write_int("i", size=2, indent=0, optional=True, count=2)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), "i: [0x2, 0x3]\n")
+
+ def test_decode_float(self):
+ cmd_printer, output = self.get_printer("00 00 00 3f")
+ cmd_printer.write_float("foo", indent=0)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), "foo: 0.5\n")
+
+ def test_decode_repeated_float(self):
+ cmd_printer, output = self.get_printer("00 00 00 3f 00 00 80 3f")
+ cmd_printer.write_float("foo", indent=0, count=2)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), "foo: [0.5, 1.0]\n")
+
+ def test_decode_null_terminated_string(self):
+ cmd_printer, output = self.get_printer("77 6f 72 6c 64 00")
+ cmd_printer.write_string("hello", indent=1, size=None)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), ' hello: "world"\n')
+
+ def test_decode_fixed_size_string(self):
+ cmd_printer, output = self.get_printer("77 6f 72 6c 64 00 00 00")
+ cmd_printer.write_string("hello", indent=1, size=8)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), ' hello: "world"\n')
+
+ def test_decode_enum(self):
+ enum = {1000156007: "FOOBAR"}
+ cmd_printer, output = self.get_printer("67 2B 9D 3B")
+ cmd_printer.write_enum("foo", enum, indent=0)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), 'foo: FOOBAR (1000156007)\n')
+
+ def test_decode_unknown_enum(self):
+ cmd_printer, output = self.get_printer("67 2B 9D 3B")
+ cmd_printer.write_enum("foo", {}, indent=0)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), 'foo: (1000156007)\n')
+
+ def test_decode_flags(self):
+ enum = {1: "FOO", 2: "BAR", 4: "BAZ"}
+ cmd_printer, output = self.get_printer("03 00 00 00")
+ cmd_printer.write_flags("foo", enum, indent=0)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), 'foo: FOO | BAR (0x3)\n')
+
+ def test_decode_unknown_flags(self):
+ enum = {1: "FOO", 2: "BAR", 4: "BAZ"}
+ cmd_printer, output = self.get_printer("0A 00 00 00")
+ cmd_printer.write_flags("foo", enum, indent=0)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), 'foo: 0x8 | BAR (0xa)\n')
+
+ def test_decode_all_flags(self):
+ enum = {1: "FOO", 2: "BAR", 4: "BAZ"}
+ cmd_printer, output = self.get_printer("ff ff ff ff")
+ cmd_printer.write_flags("foo", enum, indent=0)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), 'foo: (all flags) (0xffffffff)\n')
+
+ def test_decode_zero_timestamp(self):
+ cmd_printer, output = self.get_printer("", 0)
+ cmd_printer.write_timestamp(indent=0)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), "") # Print nothing
+
+ def test_decode_zero_timestamp(self):
+ cmd_printer, output = self.get_printer("", 100)
+ cmd_printer.write_timestamp(indent=0)
+ cmd_printer.check_no_more_bytes()
+ self.assertEqual(output.getvalue(), "Recorded at: 1969-12-31 16:00:00.000100\n")
+
+
+class SuccessfullyDecodesCommandTestCase(unittest.TestCase):
+ """
+ This test suite checks that we're able to successfully decode each command (but doesn't check
+ the exact output.)
+ Each command that we pretty print should have at least one test here (unless the command takes
+ no arguments).
+
+ Please keep the test methods sorted in alphabetical order.
+ """
+
+ def run_test(self, opcode_str: str, cmd_data_hex: str):
+ opcode = reverse_opcodes[opcode_str]
+ cmd_data = bytes.fromhex(cmd_data_hex)
+ cmd_printer = command_printer.CommandPrinter(opcode, len(cmd_data), cmd_data, 0, 0, 0)
+ cmd_printer.print_cmd()
+
+ def test_OP_vkAcquireImageANDROID(self):
+ self.run_test("OP_vkAcquireImageANDROID", """
+ e2 00 00 00 b8 08 00 00 02 00 03 00 e5 08 00 00
+ 02 00 06 00 ff ff ff ff f3 08 00 00 02 00 17 00
+ 00 00 00 00 00 00 00 00
+ """)
+
+ @unittest.skip("Needs support for struct extensions")
+ def test_OP_vkAllocateMemory(self):
+ self.run_test("OP_vkAllocateMemory", """
+ d7 01 00 00 02 00 00 00 02 00 03 00 05 00 00 00
+ 00 00 00 18 e8 a9 a0 3b e8 a9 a0 3b 00 00 00 00
+ 0d 00 00 00 00 90 7e 00 00 00 00 00 07 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkBeginCommandBufferAsyncGOOGLE(self):
+ self.run_test("OP_vkBeginCommandBufferAsyncGOOGLE", """
+ 2a 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkBindBufferMemory(self):
+ self.run_test("OP_vkBindBufferMemory", """
+ cc 00 00 00 b8 08 00 00 02 00 03 00 e3 08 00 00
+ 03 00 05 00 e4 08 00 00 02 00 07 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkBindImageMemory(self):
+ self.run_test("OP_vkBindImageMemory", """
+ de 00 00 00 b8 08 00 00 02 00 03 00 f1 08 00 00
+ 02 00 06 00 f2 08 00 00 02 00 07 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkCmdBeginRenderPass(self):
+ self.run_test("OP_vkCmdBeginRenderPass", """
+ 2b 00 00 00 00 00 00 00 65 0a 00 00 02 00 11 00
+ e7 09 00 00 03 00 12 00 00 00 00 00 00 00 00 00
+ c4 01 00 00 80 00 00 00 02 00 00 00 00 00 79 bd
+ 2d fe 70 70 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 80 3f 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCmdBindDescriptorSets(self):
+ self.run_test("OP_vkCmdBindDescriptorSets", """
+ 00 00 00 00 c8 09 00 00 03 00 13 00 01 00 00 00
+ 01 00 00 00 41 09 00 00 03 00 0d 00 02 00 00 00
+ 00 03 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCmdBindIndexBuffer(self):
+ self.run_test("OP_vkCmdBindIndexBuffer", """
+ a4 09 00 00 04 00 05 00 00 80 00 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkCmdBindPipeline(self):
+ self.run_test("OP_vkCmdBindPipeline", """
+ 00 00 00 00 ba 09 00 00 02 00 15 00
+ """)
+
+ def test_OP_vkCmdBindVertexBuffers(self):
+ self.run_test("OP_vkCmdBindVertexBuffers", """
+ 00 00 00 00 03 00 00 00 a4 09 00 00 04 00 05 00
+ a4 09 00 00 04 00 05 00 a4 09 00 00 04 00 05 00
+ 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00
+ 0c 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCmdClearAttachments(self):
+ self.run_test("OP_vkCmdClearAttachments", """
+ 01 00 00 00 06 00 00 00 00 00 00 00 00 00 80 3f
+ 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00
+ 00 00 00 00 00 00 00 00 80 07 00 00 38 04 00 00
+ 00 00 00 00 01 00 00 00
+ """)
+
+ def test_OP_vkCmdClearColorImage(self):
+ self.run_test("OP_vkCmdClearColorImage", """
+ e5 08 00 00 02 00 06 00 07 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00
+ 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+ 01 00 00 00
+ """)
+
+ def test_OP_vkCmdCopyBufferToImage(self):
+ self.run_test("OP_vkCmdCopyBufferToImage", """
+ 9f 09 00 00 02 00 05 00 a1 09 00 00 02 00 06 00
+ 07 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
+ 40 0b 00 00 00 0a 00 00 01 00 00 00 00 00 00 00
+ 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 40 0b 00 00 00 0a 00 00 01 00 00 00
+ """)
+
+ def test_OP_vkCmdCopyImageToBuffer(self):
+ self.run_test("OP_vkCmdCopyImageToBuffer", """
+ 99 09 00 00 09 00 06 00 06 00 00 00 98 09 00 00
+ 07 00 05 00 01 00 00 00 00 00 00 00 00 00 00 00
+ 20 00 00 00 20 00 00 00 01 00 00 00 00 00 00 00
+ 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 20 00 00 00 20 00 00 00 01 00 00 00
+ """)
+
+ def test_OP_vkCmdDraw(self):
+ self.run_test("OP_vkCmdDraw", """
+ 06 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCmdDrawIndexed(self):
+ self.run_test("OP_vkCmdDrawIndexed", """
+ 6c 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkCmdPipelineBarrier(self):
+ self.run_test("OP_vkCmdPipelineBarrier", """
+ 01 04 00 00 80 04 00 00 00 00 00 00 01 00 00 00
+ 2e 00 00 00 00 00 00 00 00 01 00 00 a0 01 00 00
+ 00 00 00 00 03 00 00 00 2d 00 00 00 00 00 00 00
+ 00 01 00 00 20 00 00 00 02 00 00 00 05 00 00 00
+ 00 00 00 00 00 00 00 00 d2 11 00 00 04 00 06 00
+ 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+ 01 00 00 00 2d 00 00 00 00 00 00 00 00 01 00 00
+ 20 00 00 00 02 00 00 00 05 00 00 00 00 00 00 00
+ 00 00 00 00 ac 15 00 00 02 00 06 00 01 00 00 00
+ 00 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00
+ 2d 00 00 00 00 00 00 00 00 01 00 00 20 00 00 00
+ 02 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00
+ 9d 16 00 00 02 00 06 00 01 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 01 00 00 00
+ """)
+
+ def test_OP_vkCmdSetScissor(self):
+ self.run_test("OP_vkCmdSetScissor", """
+ 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
+ 40 0b 00 00 00 0a 00 00
+ """)
+
+ def test_OP_vkCmdSetViewport(self):
+ self.run_test("OP_vkCmdSetViewport", """
+ 00 00 00 00 01 00 00 00 00 00 00 00 00 00 20 45
+ 00 00 34 45 00 00 20 c5 00 00 00 00 00 00 80 3f
+ """)
+
+ def test_OP_vkCollectDescriptorPoolIdsGOOGLE(self):
+ self.run_test("OP_vkCollectDescriptorPoolIdsGOOGLE", """
+ c5 00 00 00 b8 08 00 00 02 00 03 00 c1 08 00 00
+ 02 00 0c 00 10 00 00 00 00 00 79 bc 3d fd b6 40
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCreateBufferWithRequirementsGOOGLE(self):
+ self.run_test("OP_vkCreateBufferWithRequirementsGOOGLE", """
+ 2b 00 00 00 b8 08 00 00 02 00 03 00 0c 00 00 00
+ 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00
+ 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCreateDescriptorPool(self):
+ self.run_test("OP_vkCreateDescriptorPool", """
+ e1 00 00 00 b7 15 00 00 03 00 03 00 21 00 00 00
+ 00 00 00 00 00 00 00 00 10 00 00 00 02 00 00 00
+ 08 00 00 00 10 00 00 00 08 00 00 00 10 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCreateDescriptorSetLayout(self):
+ self.run_test("OP_vkCreateDescriptorSetLayout", """
+ c3 00 00 00 b8 08 00 00 02 00 03 00 20 00 00 00
+ 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+ 08 00 00 00 01 00 00 00 3f 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkCreateFence(self):
+ self.run_test("OP_vkCreateFence", """
+ e3 00 00 00 b8 08 00 00 02 00 03 00 08 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCreateFramebuffer(self):
+ self.run_test("OP_vkCreateFramebuffer", """
+ 83 02 00 00 fb 08 00 00 02 00 03 00 25 00 00 00
+ 00 00 00 00 00 00 00 00 65 0a 00 00 02 00 11 00
+ 02 00 00 00 e8 09 00 00 03 00 09 00 e9 09 00 00
+ 03 00 09 00 c4 01 00 00 80 00 00 00 01 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ @unittest.skip("Needs support for stream features hasRasterization / hasTessellation")
+ def test_OP_vkCreateGraphicsPipelines(self):
+ self.run_test("OP_vkCreateGraphicsPipelines", """
+ 3b 01 00 00 fb 08 00 00 02 00 03 00 02 09 00 00
+ 02 00 14 00 01 00 00 00 00 00 00 01 00 00 00 00
+ 1c 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00
+ 12 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00
+ b7 09 00 00 02 00 0a 00 00 00 00 04 6d 61 69 6e
+ 00 00 79 bd 2d fd a3 60 05 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 04 01 00 00 00
+ 04 00 00 00 00 00 00 00 00 00 00 04 02 00 00 00
+ 08 00 00 00 00 00 00 00 00 00 00 04 03 00 00 00
+ 0c 00 00 00 00 00 00 00 00 00 00 04 04 00 00 00
+ 10 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00
+ 00 00 00 14 00 00 00 00 00 00 00 00 00 00 80 3f
+ 00 00 80 3f 00 00 00 00 12 00 00 00 00 00 00 00
+ 00 00 00 00 10 00 00 00 b8 09 00 00 02 00 0a 00
+ 00 00 00 04 6d 61 69 6e 00 00 79 bd 2d fd a3 f0
+ 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 04 01 00 00 00 04 00 00 00 00 00 00 00
+ 00 00 00 04 02 00 00 00 08 00 00 00 00 00 00 00
+ 00 00 00 04 03 00 00 00 0c 00 00 00 00 00 00 00
+ 00 00 00 04 04 00 00 00 10 00 00 00 00 00 00 00
+ 00 00 00 04 00 00 00 00 00 00 00 14 00 00 00 00
+ 00 00 00 00 00 00 80 3f 00 00 80 3f 00 00 00 00
+ 00 00 79 bd 2d fd a4 78 13 00 00 00 00 00 00 00
+ 00 00 00 00 02 00 00 00 00 00 00 00 08 00 00 00
+ 00 00 00 00 01 00 00 00 08 00 00 00 00 00 00 00
+ 02 00 00 00 00 00 00 00 00 00 00 00 67 00 00 00
+ 00 00 00 00 01 00 00 00 01 00 00 00 67 00 00 00
+ 00 00 00 00 00 00 79 bd 2d fd a4 e0 14 00 00 00
+ 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00
+ 00 00 79 bd 2d fd a5 00 00 00 79 bd 2d fd a5 18
+ 16 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00
+ 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 79 bd 2d fd a5 48 17 00 00 00
+ 00 00 00 20 b9 bd 9e 3b b9 bd 9e 3b 00 00 00 18
+ 31 aa 9e 3b 31 aa 9e 3b 00 00 00 18 62 37 9b 3b
+ 62 37 9b 3b 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 80 3f 00 00
+ 79 bd 2d fd a5 d8 18 00 00 00 00 00 00 00 00 00
+ 00 00 01 00 00 00 00 00 00 00 00 00 80 3f 00 00
+ 79 bd 2d fd a6 08 ff ff ff ff 00 00 00 00 00 00
+ 00 00 00 00 79 bd 2d fd a6 10 19 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 07 00 00 00 ff 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 07 00 00 00 ff 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 79 bd 2d fd
+ a6 78 1a 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 07 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 79 bb ee 02
+ ea 20 1b 00 00 00 00 00 00 00 00 00 00 00 02 00
+ 00 00 00 00 00 00 01 00 00 00 6b 09 00 00 02 00
+ 13 00 b9 09 00 00 03 00 11 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCreateImageView(self):
+ self.run_test("OP_vkCreateImageView", """
+ 3c 01 00 00 fb 08 00 00 02 00 03 00 0f 00 00 00
+ 00 00 00 00 00 00 00 00 06 09 00 00 02 00 06 00
+ 01 00 00 00 25 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ @unittest.skip("Needs support for struct extensions")
+ def test_OP_vkCreateImageWithRequirementsGOOGLE(self):
+ self.run_test("OP_vkCreateImageWithRequirementsGOOGLE", """
+ d0 00 00 00 b8 08 00 00 02 00 03 00 0e 00 00 00
+ 00 00 00 38 10 f1 9a 3b 10 f1 9a 3b 00 00 00 00
+ 00 00 79 bd 2d fd df e8 0d 00 00 00 80 07 00 00
+ 01 00 00 00 33 0b 00 00 06 09 00 00 00 00 00 00
+ 66 02 00 00 00 00 00 00 00 00 00 00 01 00 00 00
+ 25 00 00 00 80 07 00 00 38 04 00 00 01 00 00 00
+ 01 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00
+ 97 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCreatePipelineCache(self):
+ self.run_test("OP_vkCreatePipelineCache", """
+ 38 01 00 00 fb 08 00 00 02 00 03 00 11 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkCreateRenderPass(self):
+ self.run_test("OP_vkCreateRenderPass", """
+ 3a 01 00 00 fb 08 00 00 02 00 03 00 26 00 00 00
+ 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+ 25 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 02 00 00 00 02 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkCreateSampler(self):
+ self.run_test("OP_vkCreateSampler", """
+ eb 00 00 00 b7 15 00 00 03 00 03 00 1f 00 00 00
+ 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00
+ 00 00 00 00 02 00 00 00 02 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 80 3f 00 00 00 00
+ 03 00 00 00 00 00 00 00 00 00 80 3e 01 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkCreateSemaphore(self):
+ self.run_test("OP_vkCreateSemaphore", """
+ d3 00 00 00 b8 08 00 00 02 00 03 00 09 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyBuffer(self):
+ self.run_test("OP_vkDestroyBuffer", """
+ 2a 00 00 00 b8 08 00 00 02 00 03 00 c0 08 00 00
+ 02 00 05 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyCommandPool(self):
+ self.run_test("OP_vkDestroyCommandPool", """
+ fb 05 00 00 b1 0a 00 00 05 00 03 00 a3 0a 00 00
+ 06 00 21 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyDescriptorPool(self):
+ self.run_test("OP_vkDestroyDescriptorPool", """
+ 8b 01 00 00 fb 08 00 00 02 00 03 00 44 09 00 00
+ 02 00 0c 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyDescriptorSetLayout(self):
+ self.run_test("OP_vkDestroyDescriptorSetLayout", """
+ a3 01 00 00 fb 08 00 00 02 00 03 00 69 09 00 00
+ 02 00 0b 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyDevice(self):
+ self.run_test("OP_vkDestroyDevice", """
+ 00 06 00 00 b1 0a 00 00 05 00 03 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyFence(self):
+ self.run_test("OP_vkDestroyFence", """
+ fc 05 00 00 b1 0a 00 00 05 00 03 00 b2 0a 00 00
+ 05 00 16 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyFramebuffer(self):
+ self.run_test("OP_vkDestroyFramebuffer", """
+ 61 01 00 00 fb 08 00 00 02 00 03 00 bc 09 00 00
+ 02 00 12 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyImage(self):
+ self.run_test("OP_vkDestroyImage", """
+ ee 00 00 00 b8 08 00 00 02 00 03 00 f1 08 00 00
+ 02 00 06 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyImageView(self):
+ self.run_test("OP_vkDestroyImageView", """
+ 60 01 00 00 fb 08 00 00 02 00 03 00 bb 09 00 00
+ 02 00 09 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyInstance(self):
+ self.run_test("OP_vkDestroyInstance", """
+ 01 06 00 00 e7 08 00 00 07 00 01 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyPipeline(self):
+ self.run_test("OP_vkDestroyPipeline", """
+ cd 05 00 00 b1 0a 00 00 05 00 03 00 8a 0a 00 00
+ 05 00 15 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyPipelineCache(self):
+ self.run_test("OP_vkDestroyPipelineCache", """
+ 39 01 00 00 fb 08 00 00 02 00 03 00 b9 09 00 00
+ 02 00 14 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyPipelineLayout(self):
+ self.run_test("OP_vkDestroyPipelineLayout", """
+ a2 01 00 00 fb 08 00 00 02 00 03 00 6b 09 00 00
+ 02 00 13 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyRenderPass(self):
+ self.run_test("OP_vkDestroyRenderPass", """
+ 9f 01 00 00 fb 08 00 00 02 00 03 00 c2 09 00 00
+ 02 00 11 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroySemaphore(self):
+ self.run_test("OP_vkDestroySemaphore", """
+ f3 00 00 00 b8 08 00 00 02 00 03 00 f3 08 00 00
+ 02 00 17 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkDestroyShaderModule(self):
+ self.run_test("OP_vkDestroyShaderModule", """
+ 7e 01 00 00 fb 08 00 00 02 00 03 00 b7 09 00 00
+ 02 00 0a 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkFreeCommandBuffers(self):
+ self.run_test("OP_vkFreeCommandBuffers", """
+ f9 05 00 00 b1 0a 00 00 05 00 03 00 a3 0a 00 00
+ 06 00 21 00 01 00 00 00 00 00 79 bb dd fe 4a b0
+ ec 08 00 00 07 00 22 00
+ """)
+
+ def test_OP_vkFreeMemory(self):
+ self.run_test("OP_vkFreeMemory", """
+ ef 00 00 00 b8 08 00 00 02 00 03 00 f2 08 00 00
+ 02 00 07 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkFreeMemorySyncGOOGLE(self):
+ self.run_test("OP_vkFreeMemorySyncGOOGLE", """
+ ff 05 00 00 b1 0a 00 00 05 00 03 00 74 0a 00 00
+ 06 00 07 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkGetFenceStatus(self):
+ self.run_test("OP_vkGetFenceStatus", """
+ e6 00 00 00 b8 08 00 00 02 00 03 00 f6 08 00 00
+ 02 00 16 00
+ """)
+
+ def test_OP_vkGetMemoryHostAddressInfoGOOGLE(self):
+ self.run_test("OP_vkGetMemoryHostAddressInfoGOOGLE", """
+ 01 01 00 00 5a 0c 00 00 05 00 03 00 5a 11 00 00
+ 02 00 07 00 00 00 00 00 bd d3 07 f0 00 00 00 00
+ 00 00 00 00 00 00 00 00 bd d3 07 f8 00 00 00 00
+ 00 00 00 00 00 00 00 00 bd d3 08 00 00 00 00 00
+ 00 00 00 00
+ """)
+
+ def test_OP_vkGetPhysicalDeviceFormatProperties(self):
+ self.run_test("OP_vkGetPhysicalDeviceFormatProperties", """
+ 2f 00 00 00 b7 08 00 00 02 00 02 00 7c 00 00 00
+ 00 00 00 00 00 00 00 00 ff ff ff ff
+ """)
+
+ def test_OP_vkGetPhysicalDeviceProperties2KHR(self):
+ self.run_test("OP_vkGetPhysicalDeviceProperties2KHR", """
+ cd 00 00 00 b7 08 00 00 02 00 02 00 79 b0 9b 3b
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkGetSwapchainGrallocUsageANDROID(self):
+ self.run_test("OP_vkGetSwapchainGrallocUsageANDROID", """
+ cf 00 00 00 b8 08 00 00 02 00 03 00 25 00 00 00
+ 97 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkQueueCommitDescriptorSetUpdatesGOOGLE(self):
+ self.run_test("OP_vkQueueCommitDescriptorSetUpdatesGOOGLE", """
+ bd 02 00 00 04 00 00 00 02 00 04 00 04 00 00 00
+ 0b 00 00 00 02 00 0c 00 79 01 00 00 02 00 0c 00
+ de 00 00 00 02 00 0c 00 8a 01 00 00 02 00 0c 00
+ 07 00 00 00 0a 00 00 00 05 00 0b 00 31 00 00 00
+ 02 00 0b 00 31 00 00 00 02 00 0b 00 44 01 00 00
+ 02 00 0b 00 44 01 00 00 02 00 0b 00 44 01 00 00
+ 02 00 0b 00 44 01 00 00 02 00 0b 00 1b 00 00 00
+ 02 00 0d 00 89 01 00 00 02 00 0d 00 ee 00 00 00
+ 02 00 0d 00 9a 01 00 00 02 00 0d 00 98 01 00 00
+ 02 00 0d 00 99 01 00 00 02 00 0d 00 97 01 00 00
+ 02 00 0d 00 00 00 00 00 01 00 00 00 02 00 00 00
+ 03 00 00 00 03 00 00 00 03 00 00 00 03 00 00 00
+ 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00
+ 01 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00
+ 01 00 00 00 03 00 00 00 05 00 00 00 06 00 00 00
+ 07 00 00 00 08 00 00 00 09 00 00 00 23 00 00 00
+ 00 00 00 00 1b 00 00 00 02 00 0d 00 00 00 00 00
+ 00 00 00 00 01 00 00 00 08 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 74 3c ce b3 aa 50 bd 16 00 00
+ 03 00 05 00 00 00 00 00 00 00 00 00 50 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 23 00 00 00
+ 00 00 00 00 89 01 00 00 02 00 0d 00 00 00 00 00
+ 00 00 00 00 01 00 00 00 08 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 74 3c ce b3 aa 68 a8 16 00 00
+ 03 00 05 00 00 00 00 00 00 00 00 00 00 01 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 23 00 00 00
+ 00 00 00 00 89 01 00 00 02 00 0d 00 01 00 00 00
+ 00 00 00 00 01 00 00 00 08 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 74 3c ce b3 aa 80 2d 00 00 00
+ 03 00 05 00 00 00 00 00 00 00 00 00 10 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 23 00 00 00
+ 00 00 00 00 ee 00 00 00 02 00 0d 00 00 00 00 00
+ 00 00 00 00 01 00 00 00 08 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 74 3c ce b3 aa 98 a8 16 00 00
+ 03 00 05 00 00 00 00 00 00 00 00 00 00 01 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 23 00 00 00
+ 00 00 00 00 ee 00 00 00 02 00 0d 00 01 00 00 00
+ 00 00 00 00 01 00 00 00 08 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 74 3c ce b3 aa b0 a8 16 00 00
+ 03 00 05 00 00 00 00 00 00 00 00 00 00 01 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 23 00 00 00
+ 00 00 00 00 9a 01 00 00 02 00 0d 00 00 00 00 00
+ 00 00 00 00 01 00 00 00 01 00 00 00 00 00 74 3c
+ ce b3 aa c8 c1 16 00 00 02 00 0e 00 be 16 00 00
+ 02 00 09 00 05 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 23 00 00 00 00 00 00 00
+ 98 01 00 00 02 00 0d 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 01 00 00 00 00 00 74 3c ce b3 aa e0
+ c1 16 00 00 02 00 0e 00 c9 16 00 00 02 00 09 00
+ 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 00 00 00 00 23 00 00 00 00 00 00 00 99 01 00 00
+ 02 00 0d 00 00 00 00 00 00 00 00 00 01 00 00 00
+ 01 00 00 00 00 00 74 3c ce b3 aa f8 c8 16 00 00
+ 02 00 0e 00 c6 16 00 00 02 00 09 00 05 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 23 00 00 00 00 00 00 00 97 01 00 00 02 00 0d 00
+ 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00
+ 00 00 74 3c ce b3 ab 10 c1 16 00 00 02 00 0e 00
+ cc 16 00 00 02 00 09 00 05 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkQueueFlushCommandsGOOGLE(self):
+ self.run_test("OP_vkQueueFlushCommandsGOOGLE", """
+ e4 00 00 00 b9 08 00 00 02 00 04 00 be 08 00 00
+ 02 00 22 00 18 01 00 00 00 00 00 00
+ """)
+
+ def test_OP_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(self):
+ self.run_test("OP_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE", """
+ e7 00 00 00 b9 08 00 00 02 00 04 00 01 00 00 00
+ 00 00 79 bd 0d fe c9 20 e8 08 00 00 02 00 17 00
+ e5 08 00 00 02 00 06 00
+ """)
+
+ def test_OP_vkQueueSubmitAsyncGOOGLE(self):
+ self.run_test("OP_vkQueueSubmitAsyncGOOGLE", """
+ c0 02 00 00 04 00 00 00 02 00 04 00 01 00 00 00
+ 04 00 00 00 00 00 00 00 03 00 00 00 c0 16 00 00
+ 02 00 17 00 cb 16 00 00 02 00 17 00 ce 16 00 00
+ 02 00 17 00 00 00 01 00 00 00 01 00 00 00 01 00
+ 01 00 00 00 08 00 00 00 02 00 22 00 00 00 00 00
+ d1 16 00 00 02 00 16 00
+ """)
+
+ def test_OP_vkQueueWaitIdle(self):
+ self.run_test("OP_vkQueueWaitIdle", """
+ f3 05 00 00 8f 09 00 00 06 00 04 00
+ """)
+
+ def test_OP_vkResetFences(self):
+ self.run_test("OP_vkResetFences", """
+ 4f 01 00 00 fb 08 00 00 02 00 03 00 01 00 00 00
+ c3 09 00 00 02 00 16 00
+ """)
+
+ def test_OP_vkWaitForFences(self):
+ self.run_test("OP_vkWaitForFences", """
+ ed 00 00 00 b8 08 00 00 02 00 03 00 01 00 00 00
+ 03 09 00 00 05 00 16 00 01 00 00 00 00 b0 8e f0
+ 1b 00 00 00
+ """)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/src/gfxstream/scripts/print_gfx_logs/opcodes.py b/src/gfxstream/scripts/print_gfx_logs/opcodes.py
new file mode 100644
index 00000000000..d44d0c85d06
--- /dev/null
+++ b/src/gfxstream/scripts/print_gfx_logs/opcodes.py
@@ -0,0 +1,1301 @@
+"""
+gfxstream opcodes
+
+This is a map of all gfxstream opcodes back to their string names.
+
+Currently, this was manually generated from the following files:
+
+GfxApiLogger: http://source/android/device/generic/vulkan-cereal/utils/include/utils/GfxApiLogger.h
+Vulkan: http://source/play-internal/battlestar/aosp/device/generic/vulkan-cereal/stream-servers/vulkan/cereal/common/goldfish_vk_marshaling.h
+RenderControl: http://source/play-internal/battlestar/aosp/device/generic/vulkan-cereal/stream-servers/renderControl_dec/renderControl_opcodes.h
+GLES1: http://source/android/device/generic/vulkan-cereal/stream-servers/gles1_dec/gles1_opcodes.h
+GLES2: http://source/android/device/generic/vulkan-cereal/stream-servers/gles2_dec/gles2_opcodes.h
+
+TODO(gregschlom): Consider auto-generating this file in the future.
+"""
+
+opcodes = {
+ ###############################################################################################
+ # GfxApiLogger opcodes for logging additional information
+ # http://source/android/device/generic/vulkan-cereal/utils/include/utils/GfxApiLogger.h
+ ###############################################################################################
+ 90000: "OP_gfxApiLoggerBeginCommandExecution",
+ ###############################################################################################
+ # Vulkan opcodes
+ # http://source/play-internal/battlestar/aosp/device/generic/vulkan-cereal/stream-servers/vulkan/cereal/common/goldfish_vk_marshaling.h
+ ###############################################################################################
+ 20000: "OP_vkCreateInstance",
+ 20001: "OP_vkDestroyInstance",
+ 20002: "OP_vkEnumeratePhysicalDevices",
+ 20003: "OP_vkGetPhysicalDeviceFeatures",
+ 20004: "OP_vkGetPhysicalDeviceFormatProperties",
+ 20005: "OP_vkGetPhysicalDeviceImageFormatProperties",
+ 20006: "OP_vkGetPhysicalDeviceProperties",
+ 20007: "OP_vkGetPhysicalDeviceQueueFamilyProperties",
+ 20008: "OP_vkGetPhysicalDeviceMemoryProperties",
+ 20009: "OP_vkGetInstanceProcAddr",
+ 20010: "OP_vkGetDeviceProcAddr",
+ 20011: "OP_vkCreateDevice",
+ 20012: "OP_vkDestroyDevice",
+ 20013: "OP_vkEnumerateInstanceExtensionProperties",
+ 20014: "OP_vkEnumerateDeviceExtensionProperties",
+ 20015: "OP_vkEnumerateInstanceLayerProperties",
+ 20016: "OP_vkEnumerateDeviceLayerProperties",
+ 20017: "OP_vkGetDeviceQueue",
+ 20018: "OP_vkQueueSubmit",
+ 20019: "OP_vkQueueWaitIdle",
+ 20020: "OP_vkDeviceWaitIdle",
+ 20021: "OP_vkAllocateMemory",
+ 20022: "OP_vkFreeMemory",
+ 20023: "OP_vkMapMemory",
+ 20024: "OP_vkUnmapMemory",
+ 20025: "OP_vkFlushMappedMemoryRanges",
+ 20026: "OP_vkInvalidateMappedMemoryRanges",
+ 20027: "OP_vkGetDeviceMemoryCommitment",
+ 20028: "OP_vkBindBufferMemory",
+ 20029: "OP_vkBindImageMemory",
+ 20030: "OP_vkGetBufferMemoryRequirements",
+ 20031: "OP_vkGetImageMemoryRequirements",
+ 20032: "OP_vkGetImageSparseMemoryRequirements",
+ 20033: "OP_vkGetPhysicalDeviceSparseImageFormatProperties",
+ 20034: "OP_vkQueueBindSparse",
+ 20035: "OP_vkCreateFence",
+ 20036: "OP_vkDestroyFence",
+ 20037: "OP_vkResetFences",
+ 20038: "OP_vkGetFenceStatus",
+ 20039: "OP_vkWaitForFences",
+ 20040: "OP_vkCreateSemaphore",
+ 20041: "OP_vkDestroySemaphore",
+ 20042: "OP_vkCreateEvent",
+ 20043: "OP_vkDestroyEvent",
+ 20044: "OP_vkGetEventStatus",
+ 20045: "OP_vkSetEvent",
+ 20046: "OP_vkResetEvent",
+ 20047: "OP_vkCreateQueryPool",
+ 20048: "OP_vkDestroyQueryPool",
+ 20049: "OP_vkGetQueryPoolResults",
+ 20050: "OP_vkCreateBuffer",
+ 20051: "OP_vkDestroyBuffer",
+ 20052: "OP_vkCreateBufferView",
+ 20053: "OP_vkDestroyBufferView",
+ 20054: "OP_vkCreateImage",
+ 20055: "OP_vkDestroyImage",
+ 20056: "OP_vkGetImageSubresourceLayout",
+ 20057: "OP_vkCreateImageView",
+ 20058: "OP_vkDestroyImageView",
+ 20059: "OP_vkCreateShaderModule",
+ 20060: "OP_vkDestroyShaderModule",
+ 20061: "OP_vkCreatePipelineCache",
+ 20062: "OP_vkDestroyPipelineCache",
+ 20063: "OP_vkGetPipelineCacheData",
+ 20064: "OP_vkMergePipelineCaches",
+ 20065: "OP_vkCreateGraphicsPipelines",
+ 20066: "OP_vkCreateComputePipelines",
+ 20067: "OP_vkDestroyPipeline",
+ 20068: "OP_vkCreatePipelineLayout",
+ 20069: "OP_vkDestroyPipelineLayout",
+ 20070: "OP_vkCreateSampler",
+ 20071: "OP_vkDestroySampler",
+ 20072: "OP_vkCreateDescriptorSetLayout",
+ 20073: "OP_vkDestroyDescriptorSetLayout",
+ 20074: "OP_vkCreateDescriptorPool",
+ 20075: "OP_vkDestroyDescriptorPool",
+ 20076: "OP_vkResetDescriptorPool",
+ 20077: "OP_vkAllocateDescriptorSets",
+ 20078: "OP_vkFreeDescriptorSets",
+ 20079: "OP_vkUpdateDescriptorSets",
+ 20080: "OP_vkCreateFramebuffer",
+ 20081: "OP_vkDestroyFramebuffer",
+ 20082: "OP_vkCreateRenderPass",
+ 20083: "OP_vkDestroyRenderPass",
+ 20084: "OP_vkGetRenderAreaGranularity",
+ 20085: "OP_vkCreateCommandPool",
+ 20086: "OP_vkDestroyCommandPool",
+ 20087: "OP_vkResetCommandPool",
+ 20088: "OP_vkAllocateCommandBuffers",
+ 20089: "OP_vkFreeCommandBuffers",
+ 20090: "OP_vkBeginCommandBuffer",
+ 20091: "OP_vkEndCommandBuffer",
+ 20092: "OP_vkResetCommandBuffer",
+ 20093: "OP_vkCmdBindPipeline",
+ 20094: "OP_vkCmdSetViewport",
+ 20095: "OP_vkCmdSetScissor",
+ 20096: "OP_vkCmdSetLineWidth",
+ 20097: "OP_vkCmdSetDepthBias",
+ 20098: "OP_vkCmdSetBlendConstants",
+ 20099: "OP_vkCmdSetDepthBounds",
+ 20100: "OP_vkCmdSetStencilCompareMask",
+ 20101: "OP_vkCmdSetStencilWriteMask",
+ 20102: "OP_vkCmdSetStencilReference",
+ 20103: "OP_vkCmdBindDescriptorSets",
+ 20104: "OP_vkCmdBindIndexBuffer",
+ 20105: "OP_vkCmdBindVertexBuffers",
+ 20106: "OP_vkCmdDraw",
+ 20107: "OP_vkCmdDrawIndexed",
+ 20108: "OP_vkCmdDrawIndirect",
+ 20109: "OP_vkCmdDrawIndexedIndirect",
+ 20110: "OP_vkCmdDispatch",
+ 20111: "OP_vkCmdDispatchIndirect",
+ 20112: "OP_vkCmdCopyBuffer",
+ 20113: "OP_vkCmdCopyImage",
+ 20114: "OP_vkCmdBlitImage",
+ 20115: "OP_vkCmdCopyBufferToImage",
+ 20116: "OP_vkCmdCopyImageToBuffer",
+ 20117: "OP_vkCmdUpdateBuffer",
+ 20118: "OP_vkCmdFillBuffer",
+ 20119: "OP_vkCmdClearColorImage",
+ 20120: "OP_vkCmdClearDepthStencilImage",
+ 20121: "OP_vkCmdClearAttachments",
+ 20122: "OP_vkCmdResolveImage",
+ 20123: "OP_vkCmdSetEvent",
+ 20124: "OP_vkCmdResetEvent",
+ 20125: "OP_vkCmdWaitEvents",
+ 20126: "OP_vkCmdPipelineBarrier",
+ 20127: "OP_vkCmdBeginQuery",
+ 20128: "OP_vkCmdEndQuery",
+ 20129: "OP_vkCmdResetQueryPool",
+ 20130: "OP_vkCmdWriteTimestamp",
+ 20131: "OP_vkCmdCopyQueryPoolResults",
+ 20132: "OP_vkCmdPushConstants",
+ 20133: "OP_vkCmdBeginRenderPass",
+ 20134: "OP_vkCmdNextSubpass",
+ 20135: "OP_vkCmdEndRenderPass",
+ 20136: "OP_vkCmdExecuteCommands",
+ 20137: "OP_vkEnumerateInstanceVersion",
+ 20138: "OP_vkBindBufferMemory2",
+ 20139: "OP_vkBindImageMemory2",
+ 20140: "OP_vkGetDeviceGroupPeerMemoryFeatures",
+ 20141: "OP_vkCmdSetDeviceMask",
+ 20142: "OP_vkCmdDispatchBase",
+ 20143: "OP_vkEnumeratePhysicalDeviceGroups",
+ 20144: "OP_vkGetImageMemoryRequirements2",
+ 20145: "OP_vkGetBufferMemoryRequirements2",
+ 20146: "OP_vkGetImageSparseMemoryRequirements2",
+ 20147: "OP_vkGetPhysicalDeviceFeatures2",
+ 20148: "OP_vkGetPhysicalDeviceProperties2",
+ 20149: "OP_vkGetPhysicalDeviceFormatProperties2",
+ 20150: "OP_vkGetPhysicalDeviceImageFormatProperties2",
+ 20151: "OP_vkGetPhysicalDeviceQueueFamilyProperties2",
+ 20152: "OP_vkGetPhysicalDeviceMemoryProperties2",
+ 20153: "OP_vkGetPhysicalDeviceSparseImageFormatProperties2",
+ 20154: "OP_vkTrimCommandPool",
+ 20155: "OP_vkGetDeviceQueue2",
+ 20156: "OP_vkCreateSamplerYcbcrConversion",
+ 20157: "OP_vkDestroySamplerYcbcrConversion",
+ 20158: "OP_vkCreateDescriptorUpdateTemplate",
+ 20159: "OP_vkDestroyDescriptorUpdateTemplate",
+ 20160: "OP_vkUpdateDescriptorSetWithTemplate",
+ 20161: "OP_vkGetPhysicalDeviceExternalBufferProperties",
+ 20162: "OP_vkGetPhysicalDeviceExternalFenceProperties",
+ 20163: "OP_vkGetPhysicalDeviceExternalSemaphoreProperties",
+ 20164: "OP_vkGetDescriptorSetLayoutSupport",
+ 282774587: "OP_vkCmdDrawIndirectCount",
+ 245204359: "OP_vkCmdDrawIndexedIndirectCount",
+ 279590827: "OP_vkCreateRenderPass2",
+ 235222847: "OP_vkCmdBeginRenderPass2",
+ 244873750: "OP_vkCmdNextSubpass2",
+ 221297834: "OP_vkCmdEndRenderPass2",
+ 252097672: "OP_vkResetQueryPool",
+ 267066974: "OP_vkGetSemaphoreCounterValue",
+ 224777382: "OP_vkWaitSemaphores",
+ 271024127: "OP_vkSignalSemaphore",
+ 222632266: "OP_vkGetBufferDeviceAddress",
+ 230188231: "OP_vkGetBufferOpaqueCaptureAddress",
+ 260620079: "OP_vkGetDeviceMemoryOpaqueCaptureAddress",
+ 20165: "OP_vkDestroySurfaceKHR",
+ 20166: "OP_vkGetPhysicalDeviceSurfaceSupportKHR",
+ 20167: "OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR",
+ 20168: "OP_vkGetPhysicalDeviceSurfaceFormatsKHR",
+ 20169: "OP_vkGetPhysicalDeviceSurfacePresentModesKHR",
+ 20170: "OP_vkCreateSwapchainKHR",
+ 20171: "OP_vkDestroySwapchainKHR",
+ 20172: "OP_vkGetSwapchainImagesKHR",
+ 20173: "OP_vkAcquireNextImageKHR",
+ 20174: "OP_vkQueuePresentKHR",
+ 20175: "OP_vkGetDeviceGroupPresentCapabilitiesKHR",
+ 20176: "OP_vkGetDeviceGroupSurfacePresentModesKHR",
+ 20177: "OP_vkGetPhysicalDevicePresentRectanglesKHR",
+ 20178: "OP_vkAcquireNextImage2KHR",
+ 20179: "OP_vkGetPhysicalDeviceDisplayPropertiesKHR",
+ 20180: "OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR",
+ 20181: "OP_vkGetDisplayPlaneSupportedDisplaysKHR",
+ 20182: "OP_vkGetDisplayModePropertiesKHR",
+ 20183: "OP_vkCreateDisplayModeKHR",
+ 20184: "OP_vkGetDisplayPlaneCapabilitiesKHR",
+ 20185: "OP_vkCreateDisplayPlaneSurfaceKHR",
+ 20186: "OP_vkCreateSharedSwapchainsKHR",
+ 20187: "OP_vkCreateXlibSurfaceKHR",
+ 20188: "OP_vkGetPhysicalDeviceXlibPresentationSupportKHR",
+ 20189: "OP_vkCreateXcbSurfaceKHR",
+ 20190: "OP_vkGetPhysicalDeviceXcbPresentationSupportKHR",
+ 20191: "OP_vkCreateWaylandSurfaceKHR",
+ 20192: "OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR",
+ 20195: "OP_vkCreateAndroidSurfaceKHR",
+ 20196: "OP_vkCreateWin32SurfaceKHR",
+ 20197: "OP_vkGetPhysicalDeviceWin32PresentationSupportKHR",
+ 20198: "OP_vkGetPhysicalDeviceFeatures2KHR",
+ 20199: "OP_vkGetPhysicalDeviceProperties2KHR",
+ 20200: "OP_vkGetPhysicalDeviceFormatProperties2KHR",
+ 20201: "OP_vkGetPhysicalDeviceImageFormatProperties2KHR",
+ 20202: "OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR",
+ 20203: "OP_vkGetPhysicalDeviceMemoryProperties2KHR",
+ 20204: "OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR",
+ 20205: "OP_vkGetDeviceGroupPeerMemoryFeaturesKHR",
+ 20206: "OP_vkCmdSetDeviceMaskKHR",
+ 20207: "OP_vkCmdDispatchBaseKHR",
+ 20208: "OP_vkTrimCommandPoolKHR",
+ 20209: "OP_vkEnumeratePhysicalDeviceGroupsKHR",
+ 20210: "OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR",
+ 20211: "OP_vkGetMemoryWin32HandleKHR",
+ 20212: "OP_vkGetMemoryWin32HandlePropertiesKHR",
+ 20213: "OP_vkGetMemoryFdKHR",
+ 20214: "OP_vkGetMemoryFdPropertiesKHR",
+ 20215: "OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR",
+ 20216: "OP_vkImportSemaphoreWin32HandleKHR",
+ 20217: "OP_vkGetSemaphoreWin32HandleKHR",
+ 20218: "OP_vkImportSemaphoreFdKHR",
+ 20219: "OP_vkGetSemaphoreFdKHR",
+ 20220: "OP_vkCmdPushDescriptorSetKHR",
+ 20221: "OP_vkCmdPushDescriptorSetWithTemplateKHR",
+ 20222: "OP_vkCreateDescriptorUpdateTemplateKHR",
+ 20223: "OP_vkDestroyDescriptorUpdateTemplateKHR",
+ 20224: "OP_vkUpdateDescriptorSetWithTemplateKHR",
+ 20225: "OP_vkCreateRenderPass2KHR",
+ 20226: "OP_vkCmdBeginRenderPass2KHR",
+ 20227: "OP_vkCmdNextSubpass2KHR",
+ 20228: "OP_vkCmdEndRenderPass2KHR",
+ 20229: "OP_vkGetSwapchainStatusKHR",
+ 20230: "OP_vkGetPhysicalDeviceExternalFencePropertiesKHR",
+ 20231: "OP_vkImportFenceWin32HandleKHR",
+ 20232: "OP_vkGetFenceWin32HandleKHR",
+ 20233: "OP_vkImportFenceFdKHR",
+ 20234: "OP_vkGetFenceFdKHR",
+ 299033148: "OP_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR",
+ 282029987: "OP_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR",
+ 238952296: "OP_vkAcquireProfilingLockKHR",
+ 223904011: "OP_vkReleaseProfilingLockKHR",
+ 20235: "OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR",
+ 20236: "OP_vkGetPhysicalDeviceSurfaceFormats2KHR",
+ 20237: "OP_vkGetPhysicalDeviceDisplayProperties2KHR",
+ 20238: "OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR",
+ 20239: "OP_vkGetDisplayModeProperties2KHR",
+ 20240: "OP_vkGetDisplayPlaneCapabilities2KHR",
+ 20241: "OP_vkGetImageMemoryRequirements2KHR",
+ 20242: "OP_vkGetBufferMemoryRequirements2KHR",
+ 20243: "OP_vkGetImageSparseMemoryRequirements2KHR",
+ 20244: "OP_vkCreateSamplerYcbcrConversionKHR",
+ 20245: "OP_vkDestroySamplerYcbcrConversionKHR",
+ 20246: "OP_vkBindBufferMemory2KHR",
+ 20247: "OP_vkBindImageMemory2KHR",
+ 20248: "OP_vkGetDescriptorSetLayoutSupportKHR",
+ 20249: "OP_vkCmdDrawIndirectCountKHR",
+ 20250: "OP_vkCmdDrawIndexedIndirectCountKHR",
+ 229059496: "OP_vkGetSemaphoreCounterValueKHR",
+ 263904357: "OP_vkWaitSemaphoresKHR",
+ 269919108: "OP_vkSignalSemaphoreKHR",
+ 272978593: "OP_vkGetPhysicalDeviceFragmentShadingRatesKHR",
+ 204060280: "OP_vkCmdSetFragmentShadingRateKHR",
+ 219261480: "OP_vkGetBufferDeviceAddressKHR",
+ 285631711: "OP_vkGetBufferOpaqueCaptureAddressKHR",
+ 294671624: "OP_vkGetDeviceMemoryOpaqueCaptureAddressKHR",
+ 274342644: "OP_vkCreateDeferredOperationKHR",
+ 215419514: "OP_vkDestroyDeferredOperationKHR",
+ 203387076: "OP_vkGetDeferredOperationMaxConcurrencyKHR",
+ 263822960: "OP_vkGetDeferredOperationResultKHR",
+ 218492930: "OP_vkDeferredOperationJoinKHR",
+ 269458798: "OP_vkGetPipelineExecutablePropertiesKHR",
+ 271191699: "OP_vkGetPipelineExecutableStatisticsKHR",
+ 274148497: "OP_vkGetPipelineExecutableInternalRepresentationsKHR",
+ 247893766: "OP_vkCmdCopyBuffer2KHR",
+ 227008250: "OP_vkCmdCopyImage2KHR",
+ 248841963: "OP_vkCmdCopyBufferToImage2KHR",
+ 252249060: "OP_vkCmdCopyImageToBuffer2KHR",
+ 259838288: "OP_vkCmdBlitImage2KHR",
+ 254857232: "OP_vkCmdResolveImage2KHR",
+ 20251: "OP_vkGetSwapchainGrallocUsageANDROID",
+ 20252: "OP_vkAcquireImageANDROID",
+ 20253: "OP_vkQueueSignalReleaseImageANDROID",
+ 20254: "OP_vkCreateDebugReportCallbackEXT",
+ 20255: "OP_vkDestroyDebugReportCallbackEXT",
+ 20256: "OP_vkDebugReportMessageEXT",
+ 20257: "OP_vkDebugMarkerSetObjectTagEXT",
+ 20258: "OP_vkDebugMarkerSetObjectNameEXT",
+ 20259: "OP_vkCmdDebugMarkerBeginEXT",
+ 20260: "OP_vkCmdDebugMarkerEndEXT",
+ 20261: "OP_vkCmdDebugMarkerInsertEXT",
+ 267779978: "OP_vkCmdBindTransformFeedbackBuffersEXT",
+ 294396901: "OP_vkCmdBeginTransformFeedbackEXT",
+ 272333731: "OP_vkCmdEndTransformFeedbackEXT",
+ 275810601: "OP_vkCmdBeginQueryIndexedEXT",
+ 279821337: "OP_vkCmdEndQueryIndexedEXT",
+ 285235943: "OP_vkCmdDrawIndirectByteCountEXT",
+ 204379647: "OP_vkGetImageViewHandleNVX",
+ 210668576: "OP_vkGetImageViewAddressNVX",
+ 20262: "OP_vkCmdDrawIndirectCountAMD",
+ 20263: "OP_vkCmdDrawIndexedIndirectCountAMD",
+ 20264: "OP_vkGetShaderInfoAMD",
+ 241902685: "OP_vkCreateStreamDescriptorSurfaceGGP",
+ 20265: "OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV",
+ 20266: "OP_vkGetMemoryWin32HandleNV",
+ 20267: "OP_vkCreateViSurfaceNN",
+ 20268: "OP_vkCmdBeginConditionalRenderingEXT",
+ 20269: "OP_vkCmdEndConditionalRenderingEXT",
+ 20279: "OP_vkCmdSetViewportWScalingNV",
+ 20280: "OP_vkReleaseDisplayEXT",
+ 20281: "OP_vkAcquireXlibDisplayEXT",
+ 20282: "OP_vkGetRandROutputDisplayEXT",
+ 20283: "OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT",
+ 20284: "OP_vkDisplayPowerControlEXT",
+ 20285: "OP_vkRegisterDeviceEventEXT",
+ 20286: "OP_vkRegisterDisplayEventEXT",
+ 20287: "OP_vkGetSwapchainCounterEXT",
+ 20288: "OP_vkGetRefreshCycleDurationGOOGLE",
+ 20289: "OP_vkGetPastPresentationTimingGOOGLE",
+ 20290: "OP_vkCmdSetDiscardRectangleEXT",
+ 20291: "OP_vkSetHdrMetadataEXT",
+ 20292: "OP_vkCreateIOSSurfaceMVK",
+ 20293: "OP_vkCreateMacOSSurfaceMVK",
+ 20334: "OP_vkGetMTLDeviceMVK",
+ 20335: "OP_vkSetMTLTextureMVK",
+ 20336: "OP_vkGetMTLTextureMVK",
+ 20337: "OP_vkGetMTLBufferMVK",
+ 20338: "OP_vkUseIOSurfaceMVK",
+ 20339: "OP_vkGetIOSurfaceMVK",
+ 20294: "OP_vkSetDebugUtilsObjectNameEXT",
+ 20295: "OP_vkSetDebugUtilsObjectTagEXT",
+ 20296: "OP_vkQueueBeginDebugUtilsLabelEXT",
+ 20297: "OP_vkQueueEndDebugUtilsLabelEXT",
+ 20298: "OP_vkQueueInsertDebugUtilsLabelEXT",
+ 20299: "OP_vkCmdBeginDebugUtilsLabelEXT",
+ 20300: "OP_vkCmdEndDebugUtilsLabelEXT",
+ 20301: "OP_vkCmdInsertDebugUtilsLabelEXT",
+ 20302: "OP_vkCreateDebugUtilsMessengerEXT",
+ 20303: "OP_vkDestroyDebugUtilsMessengerEXT",
+ 20304: "OP_vkSubmitDebugUtilsMessageEXT",
+ 20305: "OP_vkGetAndroidHardwareBufferPropertiesANDROID",
+ 20306: "OP_vkGetMemoryAndroidHardwareBufferANDROID",
+ 20307: "OP_vkCmdSetSampleLocationsEXT",
+ 20308: "OP_vkGetPhysicalDeviceMultisamplePropertiesEXT",
+ 251301237: "OP_vkGetImageDrmFormatModifierPropertiesEXT",
+ 20309: "OP_vkCreateValidationCacheEXT",
+ 20310: "OP_vkDestroyValidationCacheEXT",
+ 20311: "OP_vkMergeValidationCachesEXT",
+ 20312: "OP_vkGetValidationCacheDataEXT",
+ 238618340: "OP_vkCmdBindShadingRateImageNV",
+ 215295078: "OP_vkCmdSetViewportShadingRatePaletteNV",
+ 236858637: "OP_vkCmdSetCoarseSampleOrderNV",
+ 259713020: "OP_vkCreateAccelerationStructureNV",
+ 252775746: "OP_vkDestroyAccelerationStructureNV",
+ 220234370: "OP_vkGetAccelerationStructureMemoryRequirementsNV",
+ 202856743: "OP_vkBindAccelerationStructureMemoryNV",
+ 269050897: "OP_vkCmdBuildAccelerationStructureNV",
+ 211075498: "OP_vkCmdCopyAccelerationStructureNV",
+ 210219912: "OP_vkCmdTraceRaysNV",
+ 203653638: "OP_vkCreateRayTracingPipelinesNV",
+ 271962641: "OP_vkGetRayTracingShaderGroupHandlesKHR",
+ 230045846: "OP_vkGetRayTracingShaderGroupHandlesNV",
+ 269898134: "OP_vkGetAccelerationStructureHandleNV",
+ 207954431: "OP_vkCmdWriteAccelerationStructuresPropertiesNV",
+ 278731610: "OP_vkCompileDeferredNV",
+ 20313: "OP_vkGetMemoryHostPointerPropertiesEXT",
+ 20314: "OP_vkCmdWriteBufferMarkerAMD",
+ 295643221: "OP_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT",
+ 203583186: "OP_vkGetCalibratedTimestampsEXT",
+ 207334931: "OP_vkCmdDrawMeshTasksNV",
+ 274079208: "OP_vkCmdDrawMeshTasksIndirectNV",
+ 223801967: "OP_vkCmdDrawMeshTasksIndirectCountNV",
+ 225408194: "OP_vkCmdSetExclusiveScissorNV",
+ 20315: "OP_vkCmdSetCheckpointNV",
+ 20316: "OP_vkGetQueueCheckpointDataNV",
+ 203336121: "OP_vkInitializePerformanceApiINTEL",
+ 296137321: "OP_vkUninitializePerformanceApiINTEL",
+ 270016385: "OP_vkCmdSetPerformanceMarkerINTEL",
+ 261519634: "OP_vkCmdSetPerformanceStreamMarkerINTEL",
+ 251310287: "OP_vkCmdSetPerformanceOverrideINTEL",
+ 245737492: "OP_vkAcquirePerformanceConfigurationINTEL",
+ 252877217: "OP_vkReleasePerformanceConfigurationINTEL",
+ 294947726: "OP_vkQueueSetPerformanceConfigurationINTEL",
+ 213620482: "OP_vkGetPerformanceParameterINTEL",
+ 267533472: "OP_vkSetLocalDimmingAMD",
+ 261626137: "OP_vkCreateImagePipeSurfaceFUCHSIA",
+ 254915953: "OP_vkCreateMetalSurfaceEXT",
+ 224361693: "OP_vkGetBufferDeviceAddressEXT",
+ 282247593: "OP_vkGetPhysicalDeviceToolPropertiesEXT",
+ 287711429: "OP_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV",
+ 292032159: "OP_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV",
+ 268126279: "OP_vkGetPhysicalDeviceSurfacePresentModes2EXT",
+ 200946668: "OP_vkAcquireFullScreenExclusiveModeEXT",
+ 257629142: "OP_vkReleaseFullScreenExclusiveModeEXT",
+ 206369543: "OP_vkGetDeviceGroupSurfacePresentModes2EXT",
+ 298411290: "OP_vkCreateHeadlessSurfaceEXT",
+ 263855692: "OP_vkCmdSetLineStippleEXT",
+ 242995959: "OP_vkResetQueryPoolEXT",
+ 266285895: "OP_vkCmdSetCullModeEXT",
+ 212644406: "OP_vkCmdSetFrontFaceEXT",
+ 260783979: "OP_vkCmdSetPrimitiveTopologyEXT",
+ 257105245: "OP_vkCmdSetViewportWithCountEXT",
+ 204588120: "OP_vkCmdSetScissorWithCountEXT",
+ 243419921: "OP_vkCmdBindVertexBuffers2EXT",
+ 233771166: "OP_vkCmdSetDepthTestEnableEXT",
+ 218663304: "OP_vkCmdSetDepthWriteEnableEXT",
+ 247761589: "OP_vkCmdSetDepthCompareOpEXT",
+ 223213519: "OP_vkCmdSetDepthBoundsTestEnableEXT",
+ 286438749: "OP_vkCmdSetStencilTestEnableEXT",
+ 277159578: "OP_vkCmdSetStencilOpEXT",
+ 249047049: "OP_vkGetGeneratedCommandsMemoryRequirementsNV",
+ 297624330: "OP_vkCmdPreprocessGeneratedCommandsNV",
+ 234711184: "OP_vkCmdExecuteGeneratedCommandsNV",
+ 270362239: "OP_vkCmdBindPipelineShaderGroupNV",
+ 285310710: "OP_vkCreateIndirectCommandsLayoutNV",
+ 292584135: "OP_vkDestroyIndirectCommandsLayoutNV",
+ 236374049: "OP_vkCreatePrivateDataSlotEXT",
+ 208891309: "OP_vkDestroyPrivateDataSlotEXT",
+ 225259406: "OP_vkSetPrivateDataEXT",
+ 291399427: "OP_vkGetPrivateDataEXT",
+ 264649847: "OP_vkCmdSetFragmentShadingRateEnumNV",
+ 220792403: "OP_vkCreateDirectFBSurfaceEXT",
+ 285441990: "OP_vkGetPhysicalDeviceDirectFBPresentationSupportEXT",
+ 20318: "OP_vkRegisterImageColorBufferGOOGLE",
+ 20319: "OP_vkRegisterBufferColorBufferGOOGLE",
+ 20317: "OP_vkMapMemoryIntoAddressSpaceGOOGLE",
+ 20320: "OP_vkUpdateDescriptorSetWithTemplateSizedGOOGLE",
+ 20321: "OP_vkBeginCommandBufferAsyncGOOGLE",
+ 20322: "OP_vkEndCommandBufferAsyncGOOGLE",
+ 20323: "OP_vkResetCommandBufferAsyncGOOGLE",
+ 20324: "OP_vkCommandBufferHostSyncGOOGLE",
+ 20325: "OP_vkCreateImageWithRequirementsGOOGLE",
+ 20326: "OP_vkCreateBufferWithRequirementsGOOGLE",
+ 20327: "OP_vkGetMemoryHostAddressInfoGOOGLE",
+ 20328: "OP_vkFreeMemorySyncGOOGLE",
+ 20329: "OP_vkQueueHostSyncGOOGLE",
+ 20330: "OP_vkQueueSubmitAsyncGOOGLE",
+ 20331: "OP_vkQueueWaitIdleAsyncGOOGLE",
+ 20332: "OP_vkQueueBindSparseAsyncGOOGLE",
+ 20333: "OP_vkGetLinearImageLayoutGOOGLE",
+ 20340: "OP_vkQueueFlushCommandsGOOGLE",
+ 267932433: "OP_vkQueueCommitDescriptorSetUpdatesGOOGLE",
+ 213659202: "OP_vkCollectDescriptorPoolIdsGOOGLE",
+ 243985229: "OP_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE",
+ 259403971: "OP_vkCreateAccelerationStructureKHR",
+ 223971120: "OP_vkDestroyAccelerationStructureKHR",
+ 272943905: "OP_vkCmdBuildAccelerationStructuresKHR",
+ 258066143: "OP_vkCmdBuildAccelerationStructuresIndirectKHR",
+ 241919567: "OP_vkBuildAccelerationStructuresKHR",
+ 241495016: "OP_vkCopyAccelerationStructureKHR",
+ 256139578: "OP_vkCopyAccelerationStructureToMemoryKHR",
+ 261558680: "OP_vkCopyMemoryToAccelerationStructureKHR",
+ 289745796: "OP_vkWriteAccelerationStructuresPropertiesKHR",
+ 279460332: "OP_vkCmdCopyAccelerationStructureKHR",
+ 223539733: "OP_vkCmdCopyAccelerationStructureToMemoryKHR",
+ 203733963: "OP_vkCmdCopyMemoryToAccelerationStructureKHR",
+ 223466148: "OP_vkGetAccelerationStructureDeviceAddressKHR",
+ 271696183: "OP_vkCmdWriteAccelerationStructuresPropertiesKHR",
+ 266386590: "OP_vkGetDeviceAccelerationStructureCompatibilityKHR",
+ 219720024: "OP_vkGetAccelerationStructureBuildSizesKHR",
+ 213680716: "OP_vkCmdTraceRaysKHR",
+ 247628685: "OP_vkCreateRayTracingPipelinesKHR",
+ 221334934: "OP_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR",
+ 211788517: "OP_vkCmdTraceRaysIndirectKHR",
+ 205271933: "OP_vkGetRayTracingShaderGroupStackSizeKHR",
+ 260219604: "OP_vkCmdSetRayTracingPipelineStackSizeKHR",
+
+ ###############################################################################################
+ # Render Control opcodes
+ # http://source/play-internal/battlestar/aosp/device/generic/vulkan-cereal/stream-servers/renderControl_dec/renderControl_opcodes.h
+ ###############################################################################################
+ 10000: "OP_rcGetRendererVersion",
+ 10001: "OP_rcGetEGLVersion",
+ 10002: "OP_rcQueryEGLString",
+ 10003: "OP_rcGetGLString",
+ 10004: "OP_rcGetNumConfigs",
+ 10005: "OP_rcGetConfigs",
+ 10006: "OP_rcChooseConfig",
+ 10007: "OP_rcGetFBParam",
+ 10008: "OP_rcCreateContext",
+ 10009: "OP_rcDestroyContext",
+ 10010: "OP_rcCreateWindowSurface",
+ 10011: "OP_rcDestroyWindowSurface",
+ 10012: "OP_rcCreateColorBuffer",
+ 10013: "OP_rcOpenColorBuffer",
+ 10014: "OP_rcCloseColorBuffer",
+ 10015: "OP_rcSetWindowColorBuffer",
+ 10016: "OP_rcFlushWindowColorBuffer",
+ 10017: "OP_rcMakeCurrent",
+ 10018: "OP_rcFBPost",
+ 10019: "OP_rcFBSetSwapInterval",
+ 10020: "OP_rcBindTexture",
+ 10021: "OP_rcBindRenderbuffer",
+ 10022: "OP_rcColorBufferCacheFlush",
+ 10023: "OP_rcReadColorBuffer",
+ 10024: "OP_rcUpdateColorBuffer",
+ 10025: "OP_rcOpenColorBuffer2",
+ 10026: "OP_rcCreateClientImage",
+ 10027: "OP_rcDestroyClientImage",
+ 10028: "OP_rcSelectChecksumHelper",
+ 10029: "OP_rcCreateSyncKHR",
+ 10030: "OP_rcClientWaitSyncKHR",
+ 10031: "OP_rcFlushWindowColorBufferAsync",
+ 10032: "OP_rcDestroySyncKHR",
+ 10033: "OP_rcSetPuid",
+ 10034: "OP_rcUpdateColorBufferDMA",
+ 10035: "OP_rcCreateColorBufferDMA",
+ 10036: "OP_rcWaitSyncKHR",
+ 10037: "OP_rcCompose",
+ 10038: "OP_rcCreateDisplay",
+ 10039: "OP_rcDestroyDisplay",
+ 10040: "OP_rcSetDisplayColorBuffer",
+ 10041: "OP_rcGetDisplayColorBuffer",
+ 10042: "OP_rcGetColorBufferDisplay",
+ 10043: "OP_rcGetDisplayPose",
+ 10044: "OP_rcSetDisplayPose",
+ 10045: "OP_rcSetColorBufferVulkanMode",
+ 10046: "OP_rcReadColorBufferYUV",
+ 10047: "OP_rcIsSyncSignaled",
+ 10048: "OP_rcCreateColorBufferWithHandle",
+ 10049: "OP_rcCreateBuffer",
+ 10050: "OP_rcCloseBuffer",
+ 10051: "OP_rcSetColorBufferVulkanMode2",
+ 10052: "OP_rcMapGpaToBufferHandle",
+ 10053: "OP_rcCreateBuffer2",
+ 10054: "OP_rcMapGpaToBufferHandle2",
+ 10055: "OP_rcFlushWindowColorBufferAsyncWithFrameNumber",
+ 10056: "OP_rcSetTracingForPuid",
+ 10057: "OP_rcMakeCurrentAsync",
+ 10058: "OP_rcComposeAsync",
+ 10059: "OP_rcDestroySyncKHRAsync",
+ 10060: "OP_rcComposeWithoutPost",
+ 10061: "OP_rcComposeAsyncWithoutPost",
+ 10062: "OP_rcCreateDisplayById",
+ 10063: "OP_rcSetDisplayPoseDpi",
+ 10064: "OP_rcReadColorBufferDMA",
+
+ ###############################################################################################
+ # GLES1 opcodes
+ # http://source/android/device/generic/vulkan-cereal/stream-servers/gles1_dec/gles1_opcodes.h
+ ###############################################################################################
+ 1024: "OP_glAlphaFunc",
+ 1025: "OP_glClearColor",
+ 1026: "OP_glClearDepthf",
+ 1027: "OP_glClipPlanef",
+ 1028: "OP_glColor4f",
+ 1029: "OP_glDepthRangef",
+ 1030: "OP_glFogf",
+ 1031: "OP_glFogfv",
+ 1032: "OP_glFrustumf",
+ 1033: "OP_glGetClipPlanef",
+ 1034: "OP_glGetFloatv",
+ 1035: "OP_glGetLightfv",
+ 1036: "OP_glGetMaterialfv",
+ 1037: "OP_glGetTexEnvfv",
+ 1038: "OP_glGetTexParameterfv",
+ 1039: "OP_glLightModelf",
+ 1040: "OP_glLightModelfv",
+ 1041: "OP_glLightf",
+ 1042: "OP_glLightfv",
+ 1043: "OP_glLineWidth",
+ 1044: "OP_glLoadMatrixf",
+ 1045: "OP_glMaterialf",
+ 1046: "OP_glMaterialfv",
+ 1047: "OP_glMultMatrixf",
+ 1048: "OP_glMultiTexCoord4f",
+ 1049: "OP_glNormal3f",
+ 1050: "OP_glOrthof",
+ 1051: "OP_glPointParameterf",
+ 1052: "OP_glPointParameterfv",
+ 1053: "OP_glPointSize",
+ 1054: "OP_glPolygonOffset",
+ 1055: "OP_glRotatef",
+ 1056: "OP_glScalef",
+ 1057: "OP_glTexEnvf",
+ 1058: "OP_glTexEnvfv",
+ 1059: "OP_glTexParameterf",
+ 1060: "OP_glTexParameterfv",
+ 1061: "OP_glTranslatef",
+ 1062: "OP_glActiveTexture",
+ 1063: "OP_glAlphaFuncx",
+ 1064: "OP_glBindBuffer",
+ 1065: "OP_glBindTexture",
+ 1066: "OP_glBlendFunc",
+ 1067: "OP_glBufferData",
+ 1068: "OP_glBufferSubData",
+ 1069: "OP_glClear",
+ 1070: "OP_glClearColorx",
+ 1071: "OP_glClearDepthx",
+ 1072: "OP_glClearStencil",
+ 1073: "OP_glClientActiveTexture",
+ 1074: "OP_glColor4ub",
+ 1075: "OP_glColor4x",
+ 1076: "OP_glColorMask",
+ 1077: "OP_glColorPointer",
+ 1078: "OP_glCompressedTexImage2D",
+ 1079: "OP_glCompressedTexSubImage2D",
+ 1080: "OP_glCopyTexImage2D",
+ 1081: "OP_glCopyTexSubImage2D",
+ 1082: "OP_glCullFace",
+ 1083: "OP_glDeleteBuffers",
+ 1084: "OP_glDeleteTextures",
+ 1085: "OP_glDepthFunc",
+ 1086: "OP_glDepthMask",
+ 1087: "OP_glDepthRangex",
+ 1088: "OP_glDisable",
+ 1089: "OP_glDisableClientState",
+ 1090: "OP_glDrawArrays",
+ 1091: "OP_glDrawElements",
+ 1092: "OP_glEnable",
+ 1093: "OP_glEnableClientState",
+ 1094: "OP_glFinish",
+ 1095: "OP_glFlush",
+ 1096: "OP_glFogx",
+ 1097: "OP_glFogxv",
+ 1098: "OP_glFrontFace",
+ 1099: "OP_glFrustumx",
+ 1100: "OP_glGetBooleanv",
+ 1101: "OP_glGetBufferParameteriv",
+ 1102: "OP_glClipPlanex",
+ 1103: "OP_glGenBuffers",
+ 1104: "OP_glGenTextures",
+ 1105: "OP_glGetError",
+ 1106: "OP_glGetFixedv",
+ 1107: "OP_glGetIntegerv",
+ 1108: "OP_glGetLightxv",
+ 1109: "OP_glGetMaterialxv",
+ 1110: "OP_glGetPointerv",
+ 1111: "OP_glGetString",
+ 1112: "OP_glGetTexEnviv",
+ 1113: "OP_glGetTexEnvxv",
+ 1114: "OP_glGetTexParameteriv",
+ 1115: "OP_glGetTexParameterxv",
+ 1116: "OP_glHint",
+ 1117: "OP_glIsBuffer",
+ 1118: "OP_glIsEnabled",
+ 1119: "OP_glIsTexture",
+ 1120: "OP_glLightModelx",
+ 1121: "OP_glLightModelxv",
+ 1122: "OP_glLightx",
+ 1123: "OP_glLightxv",
+ 1124: "OP_glLineWidthx",
+ 1125: "OP_glLoadIdentity",
+ 1126: "OP_glLoadMatrixx",
+ 1127: "OP_glLogicOp",
+ 1128: "OP_glMaterialx",
+ 1129: "OP_glMaterialxv",
+ 1130: "OP_glMatrixMode",
+ 1131: "OP_glMultMatrixx",
+ 1132: "OP_glMultiTexCoord4x",
+ 1133: "OP_glNormal3x",
+ 1134: "OP_glNormalPointer",
+ 1135: "OP_glOrthox",
+ 1136: "OP_glPixelStorei",
+ 1137: "OP_glPointParameterx",
+ 1138: "OP_glPointParameterxv",
+ 1139: "OP_glPointSizex",
+ 1140: "OP_glPolygonOffsetx",
+ 1141: "OP_glPopMatrix",
+ 1142: "OP_glPushMatrix",
+ 1143: "OP_glReadPixels",
+ 1144: "OP_glRotatex",
+ 1145: "OP_glSampleCoverage",
+ 1146: "OP_glSampleCoveragex",
+ 1147: "OP_glScalex",
+ 1148: "OP_glScissor",
+ 1149: "OP_glShadeModel",
+ 1150: "OP_glStencilFunc",
+ 1151: "OP_glStencilMask",
+ 1152: "OP_glStencilOp",
+ 1153: "OP_glTexCoordPointer",
+ 1154: "OP_glTexEnvi",
+ 1155: "OP_glTexEnvx",
+ 1156: "OP_glTexEnviv",
+ 1157: "OP_glTexEnvxv",
+ 1158: "OP_glTexImage2D",
+ 1159: "OP_glTexParameteri",
+ 1160: "OP_glTexParameterx",
+ 1161: "OP_glTexParameteriv",
+ 1162: "OP_glTexParameterxv",
+ 1163: "OP_glTexSubImage2D",
+ 1164: "OP_glTranslatex",
+ 1165: "OP_glVertexPointer",
+ 1166: "OP_glViewport",
+ 1167: "OP_glPointSizePointerOES",
+ 1168: "OP_glVertexPointerOffset",
+ 1169: "OP_glColorPointerOffset",
+ 1170: "OP_glNormalPointerOffset",
+ 1171: "OP_glPointSizePointerOffset",
+ 1172: "OP_glTexCoordPointerOffset",
+ 1173: "OP_glWeightPointerOffset",
+ 1174: "OP_glMatrixIndexPointerOffset",
+ 1175: "OP_glVertexPointerData",
+ 1176: "OP_glColorPointerData",
+ 1177: "OP_glNormalPointerData",
+ 1178: "OP_glTexCoordPointerData",
+ 1179: "OP_glPointSizePointerData",
+ 1180: "OP_glWeightPointerData",
+ 1181: "OP_glMatrixIndexPointerData",
+ 1182: "OP_glDrawElementsOffset",
+ 1183: "OP_glDrawElementsData",
+ 1184: "OP_glGetCompressedTextureFormats",
+ 1185: "OP_glFinishRoundTrip",
+ 1186: "OP_glBlendEquationSeparateOES",
+ 1187: "OP_glBlendFuncSeparateOES",
+ 1188: "OP_glBlendEquationOES",
+ 1189: "OP_glDrawTexsOES",
+ 1190: "OP_glDrawTexiOES",
+ 1191: "OP_glDrawTexxOES",
+ 1192: "OP_glDrawTexsvOES",
+ 1193: "OP_glDrawTexivOES",
+ 1194: "OP_glDrawTexxvOES",
+ 1195: "OP_glDrawTexfOES",
+ 1196: "OP_glDrawTexfvOES",
+ 1197: "OP_glEGLImageTargetTexture2DOES",
+ 1198: "OP_glEGLImageTargetRenderbufferStorageOES",
+ 1199: "OP_glAlphaFuncxOES",
+ 1200: "OP_glClearColorxOES",
+ 1201: "OP_glClearDepthxOES",
+ 1202: "OP_glClipPlanexOES",
+ 1203: "OP_glClipPlanexIMG",
+ 1204: "OP_glColor4xOES",
+ 1205: "OP_glDepthRangexOES",
+ 1206: "OP_glFogxOES",
+ 1207: "OP_glFogxvOES",
+ 1208: "OP_glFrustumxOES",
+ 1209: "OP_glGetClipPlanexOES",
+ 1210: "OP_glGetClipPlanex",
+ 1211: "OP_glGetFixedvOES",
+ 1212: "OP_glGetLightxvOES",
+ 1213: "OP_glGetMaterialxvOES",
+ 1214: "OP_glGetTexEnvxvOES",
+ 1215: "OP_glGetTexParameterxvOES",
+ 1216: "OP_glLightModelxOES",
+ 1217: "OP_glLightModelxvOES",
+ 1218: "OP_glLightxOES",
+ 1219: "OP_glLightxvOES",
+ 1220: "OP_glLineWidthxOES",
+ 1221: "OP_glLoadMatrixxOES",
+ 1222: "OP_glMaterialxOES",
+ 1223: "OP_glMaterialxvOES",
+ 1224: "OP_glMultMatrixxOES",
+ 1225: "OP_glMultiTexCoord4xOES",
+ 1226: "OP_glNormal3xOES",
+ 1227: "OP_glOrthoxOES",
+ 1228: "OP_glPointParameterxOES",
+ 1229: "OP_glPointParameterxvOES",
+ 1230: "OP_glPointSizexOES",
+ 1231: "OP_glPolygonOffsetxOES",
+ 1232: "OP_glRotatexOES",
+ 1233: "OP_glSampleCoveragexOES",
+ 1234: "OP_glScalexOES",
+ 1235: "OP_glTexEnvxOES",
+ 1236: "OP_glTexEnvxvOES",
+ 1237: "OP_glTexParameterxOES",
+ 1238: "OP_glTexParameterxvOES",
+ 1239: "OP_glTranslatexOES",
+ 1240: "OP_glIsRenderbufferOES",
+ 1241: "OP_glBindRenderbufferOES",
+ 1242: "OP_glDeleteRenderbuffersOES",
+ 1243: "OP_glGenRenderbuffersOES",
+ 1244: "OP_glRenderbufferStorageOES",
+ 1245: "OP_glGetRenderbufferParameterivOES",
+ 1246: "OP_glIsFramebufferOES",
+ 1247: "OP_glBindFramebufferOES",
+ 1248: "OP_glDeleteFramebuffersOES",
+ 1249: "OP_glGenFramebuffersOES",
+ 1250: "OP_glCheckFramebufferStatusOES",
+ 1251: "OP_glFramebufferRenderbufferOES",
+ 1252: "OP_glFramebufferTexture2DOES",
+ 1253: "OP_glGetFramebufferAttachmentParameterivOES",
+ 1254: "OP_glGenerateMipmapOES",
+ 1255: "OP_glMapBufferOES",
+ 1256: "OP_glUnmapBufferOES",
+ 1257: "OP_glGetBufferPointervOES",
+ 1258: "OP_glCurrentPaletteMatrixOES",
+ 1259: "OP_glLoadPaletteFromModelViewMatrixOES",
+ 1260: "OP_glMatrixIndexPointerOES",
+ 1261: "OP_glWeightPointerOES",
+ 1262: "OP_glQueryMatrixxOES",
+ 1263: "OP_glDepthRangefOES",
+ 1264: "OP_glFrustumfOES",
+ 1265: "OP_glOrthofOES",
+ 1266: "OP_glClipPlanefOES",
+ 1267: "OP_glClipPlanefIMG",
+ 1268: "OP_glGetClipPlanefOES",
+ 1269: "OP_glClearDepthfOES",
+ 1270: "OP_glTexGenfOES",
+ 1271: "OP_glTexGenfvOES",
+ 1272: "OP_glTexGeniOES",
+ 1273: "OP_glTexGenivOES",
+ 1274: "OP_glTexGenxOES",
+ 1275: "OP_glTexGenxvOES",
+ 1276: "OP_glGetTexGenfvOES",
+ 1277: "OP_glGetTexGenivOES",
+ 1278: "OP_glGetTexGenxvOES",
+ 1279: "OP_glBindVertexArrayOES",
+ 1280: "OP_glDeleteVertexArraysOES",
+ 1281: "OP_glGenVertexArraysOES",
+ 1282: "OP_glIsVertexArrayOES",
+ 1283: "OP_glDiscardFramebufferEXT",
+ 1284: "OP_glMultiDrawArraysEXT",
+ 1285: "OP_glMultiDrawElementsEXT",
+ 1286: "OP_glMultiDrawArraysSUN",
+ 1287: "OP_glMultiDrawElementsSUN",
+ 1288: "OP_glRenderbufferStorageMultisampleIMG",
+ 1289: "OP_glFramebufferTexture2DMultisampleIMG",
+ 1290: "OP_glDeleteFencesNV",
+ 1291: "OP_glGenFencesNV",
+ 1292: "OP_glIsFenceNV",
+ 1293: "OP_glTestFenceNV",
+ 1294: "OP_glGetFenceivNV",
+ 1295: "OP_glFinishFenceNV",
+ 1296: "OP_glSetFenceNV",
+ 1297: "OP_glGetDriverControlsQCOM",
+ 1298: "OP_glGetDriverControlStringQCOM",
+ 1299: "OP_glEnableDriverControlQCOM",
+ 1300: "OP_glDisableDriverControlQCOM",
+ 1301: "OP_glExtGetTexturesQCOM",
+ 1302: "OP_glExtGetBuffersQCOM",
+ 1303: "OP_glExtGetRenderbuffersQCOM",
+ 1304: "OP_glExtGetFramebuffersQCOM",
+ 1305: "OP_glExtGetTexLevelParameterivQCOM",
+ 1306: "OP_glExtTexObjectStateOverrideiQCOM",
+ 1307: "OP_glExtGetTexSubImageQCOM",
+ 1308: "OP_glExtGetBufferPointervQCOM",
+ 1309: "OP_glExtGetShadersQCOM",
+ 1310: "OP_glExtGetProgramsQCOM",
+ 1311: "OP_glExtIsProgramBinaryQCOM",
+ 1312: "OP_glExtGetProgramBinarySourceQCOM",
+ 1313: "OP_glStartTilingQCOM",
+ 1314: "OP_glEndTilingQCOM",
+ 1315: "OP_glGetGraphicsResetStatusEXT",
+ 1316: "OP_glReadnPixelsEXT",
+
+ ###############################################################################################
+ # GLES2 opcodes
+ # http://source/android/device/generic/vulkan-cereal/stream-servers/gles2_dec/gles2_opcodes.h
+ ###############################################################################################
+ 2048: "OP_glActiveTexture",
+ 2049: "OP_glAttachShader",
+ 2050: "OP_glBindAttribLocation",
+ 2051: "OP_glBindBuffer",
+ 2052: "OP_glBindFramebuffer",
+ 2053: "OP_glBindRenderbuffer",
+ 2054: "OP_glBindTexture",
+ 2055: "OP_glBlendColor",
+ 2056: "OP_glBlendEquation",
+ 2057: "OP_glBlendEquationSeparate",
+ 2058: "OP_glBlendFunc",
+ 2059: "OP_glBlendFuncSeparate",
+ 2060: "OP_glBufferData",
+ 2061: "OP_glBufferSubData",
+ 2062: "OP_glCheckFramebufferStatus",
+ 2063: "OP_glClear",
+ 2064: "OP_glClearColor",
+ 2065: "OP_glClearDepthf",
+ 2066: "OP_glClearStencil",
+ 2067: "OP_glColorMask",
+ 2068: "OP_glCompileShader",
+ 2069: "OP_glCompressedTexImage2D",
+ 2070: "OP_glCompressedTexSubImage2D",
+ 2071: "OP_glCopyTexImage2D",
+ 2072: "OP_glCopyTexSubImage2D",
+ 2073: "OP_glCreateProgram",
+ 2074: "OP_glCreateShader",
+ 2075: "OP_glCullFace",
+ 2076: "OP_glDeleteBuffers",
+ 2077: "OP_glDeleteFramebuffers",
+ 2078: "OP_glDeleteProgram",
+ 2079: "OP_glDeleteRenderbuffers",
+ 2080: "OP_glDeleteShader",
+ 2081: "OP_glDeleteTextures",
+ 2082: "OP_glDepthFunc",
+ 2083: "OP_glDepthMask",
+ 2084: "OP_glDepthRangef",
+ 2085: "OP_glDetachShader",
+ 2086: "OP_glDisable",
+ 2087: "OP_glDisableVertexAttribArray",
+ 2088: "OP_glDrawArrays",
+ 2089: "OP_glDrawElements",
+ 2090: "OP_glEnable",
+ 2091: "OP_glEnableVertexAttribArray",
+ 2092: "OP_glFinish",
+ 2093: "OP_glFlush",
+ 2094: "OP_glFramebufferRenderbuffer",
+ 2095: "OP_glFramebufferTexture2D",
+ 2096: "OP_glFrontFace",
+ 2097: "OP_glGenBuffers",
+ 2098: "OP_glGenerateMipmap",
+ 2099: "OP_glGenFramebuffers",
+ 2100: "OP_glGenRenderbuffers",
+ 2101: "OP_glGenTextures",
+ 2102: "OP_glGetActiveAttrib",
+ 2103: "OP_glGetActiveUniform",
+ 2104: "OP_glGetAttachedShaders",
+ 2105: "OP_glGetAttribLocation",
+ 2106: "OP_glGetBooleanv",
+ 2107: "OP_glGetBufferParameteriv",
+ 2108: "OP_glGetError",
+ 2109: "OP_glGetFloatv",
+ 2110: "OP_glGetFramebufferAttachmentParameteriv",
+ 2111: "OP_glGetIntegerv",
+ 2112: "OP_glGetProgramiv",
+ 2113: "OP_glGetProgramInfoLog",
+ 2114: "OP_glGetRenderbufferParameteriv",
+ 2115: "OP_glGetShaderiv",
+ 2116: "OP_glGetShaderInfoLog",
+ 2117: "OP_glGetShaderPrecisionFormat",
+ 2118: "OP_glGetShaderSource",
+ 2119: "OP_glGetString",
+ 2120: "OP_glGetTexParameterfv",
+ 2121: "OP_glGetTexParameteriv",
+ 2122: "OP_glGetUniformfv",
+ 2123: "OP_glGetUniformiv",
+ 2124: "OP_glGetUniformLocation",
+ 2125: "OP_glGetVertexAttribfv",
+ 2126: "OP_glGetVertexAttribiv",
+ 2127: "OP_glGetVertexAttribPointerv",
+ 2128: "OP_glHint",
+ 2129: "OP_glIsBuffer",
+ 2130: "OP_glIsEnabled",
+ 2131: "OP_glIsFramebuffer",
+ 2132: "OP_glIsProgram",
+ 2133: "OP_glIsRenderbuffer",
+ 2134: "OP_glIsShader",
+ 2135: "OP_glIsTexture",
+ 2136: "OP_glLineWidth",
+ 2137: "OP_glLinkProgram",
+ 2138: "OP_glPixelStorei",
+ 2139: "OP_glPolygonOffset",
+ 2140: "OP_glReadPixels",
+ 2141: "OP_glReleaseShaderCompiler",
+ 2142: "OP_glRenderbufferStorage",
+ 2143: "OP_glSampleCoverage",
+ 2144: "OP_glScissor",
+ 2145: "OP_glShaderBinary",
+ 2146: "OP_glShaderSource",
+ 2147: "OP_glStencilFunc",
+ 2148: "OP_glStencilFuncSeparate",
+ 2149: "OP_glStencilMask",
+ 2150: "OP_glStencilMaskSeparate",
+ 2151: "OP_glStencilOp",
+ 2152: "OP_glStencilOpSeparate",
+ 2153: "OP_glTexImage2D",
+ 2154: "OP_glTexParameterf",
+ 2155: "OP_glTexParameterfv",
+ 2156: "OP_glTexParameteri",
+ 2157: "OP_glTexParameteriv",
+ 2158: "OP_glTexSubImage2D",
+ 2159: "OP_glUniform1f",
+ 2160: "OP_glUniform1fv",
+ 2161: "OP_glUniform1i",
+ 2162: "OP_glUniform1iv",
+ 2163: "OP_glUniform2f",
+ 2164: "OP_glUniform2fv",
+ 2165: "OP_glUniform2i",
+ 2166: "OP_glUniform2iv",
+ 2167: "OP_glUniform3f",
+ 2168: "OP_glUniform3fv",
+ 2169: "OP_glUniform3i",
+ 2170: "OP_glUniform3iv",
+ 2171: "OP_glUniform4f",
+ 2172: "OP_glUniform4fv",
+ 2173: "OP_glUniform4i",
+ 2174: "OP_glUniform4iv",
+ 2175: "OP_glUniformMatrix2fv",
+ 2176: "OP_glUniformMatrix3fv",
+ 2177: "OP_glUniformMatrix4fv",
+ 2178: "OP_glUseProgram",
+ 2179: "OP_glValidateProgram",
+ 2180: "OP_glVertexAttrib1f",
+ 2181: "OP_glVertexAttrib1fv",
+ 2182: "OP_glVertexAttrib2f",
+ 2183: "OP_glVertexAttrib2fv",
+ 2184: "OP_glVertexAttrib3f",
+ 2185: "OP_glVertexAttrib3fv",
+ 2186: "OP_glVertexAttrib4f",
+ 2187: "OP_glVertexAttrib4fv",
+ 2188: "OP_glVertexAttribPointer",
+ 2189: "OP_glViewport",
+ 2190: "OP_glEGLImageTargetTexture2DOES",
+ 2191: "OP_glEGLImageTargetRenderbufferStorageOES",
+ 2192: "OP_glGetProgramBinaryOES",
+ 2193: "OP_glProgramBinaryOES",
+ 2194: "OP_glMapBufferOES",
+ 2195: "OP_glUnmapBufferOES",
+ 2196: "OP_glTexImage3DOES",
+ 2197: "OP_glTexSubImage3DOES",
+ 2198: "OP_glCopyTexSubImage3DOES",
+ 2199: "OP_glCompressedTexImage3DOES",
+ 2200: "OP_glCompressedTexSubImage3DOES",
+ 2201: "OP_glFramebufferTexture3DOES",
+ 2202: "OP_glBindVertexArrayOES",
+ 2203: "OP_glDeleteVertexArraysOES",
+ 2204: "OP_glGenVertexArraysOES",
+ 2205: "OP_glIsVertexArrayOES",
+ 2206: "OP_glDiscardFramebufferEXT",
+ 2207: "OP_glMultiDrawArraysEXT",
+ 2208: "OP_glMultiDrawElementsEXT",
+ 2209: "OP_glGetPerfMonitorGroupsAMD",
+ 2210: "OP_glGetPerfMonitorCountersAMD",
+ 2211: "OP_glGetPerfMonitorGroupStringAMD",
+ 2212: "OP_glGetPerfMonitorCounterStringAMD",
+ 2213: "OP_glGetPerfMonitorCounterInfoAMD",
+ 2214: "OP_glGenPerfMonitorsAMD",
+ 2215: "OP_glDeletePerfMonitorsAMD",
+ 2216: "OP_glSelectPerfMonitorCountersAMD",
+ 2217: "OP_glBeginPerfMonitorAMD",
+ 2218: "OP_glEndPerfMonitorAMD",
+ 2219: "OP_glGetPerfMonitorCounterDataAMD",
+ 2220: "OP_glRenderbufferStorageMultisampleIMG",
+ 2221: "OP_glFramebufferTexture2DMultisampleIMG",
+ 2222: "OP_glDeleteFencesNV",
+ 2223: "OP_glGenFencesNV",
+ 2224: "OP_glIsFenceNV",
+ 2225: "OP_glTestFenceNV",
+ 2226: "OP_glGetFenceivNV",
+ 2227: "OP_glFinishFenceNV",
+ 2228: "OP_glSetFenceNV",
+ 2229: "OP_glCoverageMaskNV",
+ 2230: "OP_glCoverageOperationNV",
+ 2231: "OP_glGetDriverControlsQCOM",
+ 2232: "OP_glGetDriverControlStringQCOM",
+ 2233: "OP_glEnableDriverControlQCOM",
+ 2234: "OP_glDisableDriverControlQCOM",
+ 2235: "OP_glExtGetTexturesQCOM",
+ 2236: "OP_glExtGetBuffersQCOM",
+ 2237: "OP_glExtGetRenderbuffersQCOM",
+ 2238: "OP_glExtGetFramebuffersQCOM",
+ 2239: "OP_glExtGetTexLevelParameterivQCOM",
+ 2240: "OP_glExtTexObjectStateOverrideiQCOM",
+ 2241: "OP_glExtGetTexSubImageQCOM",
+ 2242: "OP_glExtGetBufferPointervQCOM",
+ 2243: "OP_glExtGetShadersQCOM",
+ 2244: "OP_glExtGetProgramsQCOM",
+ 2245: "OP_glExtIsProgramBinaryQCOM",
+ 2246: "OP_glExtGetProgramBinarySourceQCOM",
+ 2247: "OP_glStartTilingQCOM",
+ 2248: "OP_glEndTilingQCOM",
+ 2249: "OP_glVertexAttribPointerData",
+ 2250: "OP_glVertexAttribPointerOffset",
+ 2251: "OP_glDrawElementsOffset",
+ 2252: "OP_glDrawElementsData",
+ 2253: "OP_glGetCompressedTextureFormats",
+ 2254: "OP_glShaderString",
+ 2255: "OP_glFinishRoundTrip",
+ 2256: "OP_glGenVertexArrays",
+ 2257: "OP_glBindVertexArray",
+ 2258: "OP_glDeleteVertexArrays",
+ 2259: "OP_glIsVertexArray",
+ 2260: "OP_glMapBufferRange",
+ 2261: "OP_glUnmapBuffer",
+ 2262: "OP_glFlushMappedBufferRange",
+ 2263: "OP_glMapBufferRangeAEMU",
+ 2264: "OP_glUnmapBufferAEMU",
+ 2265: "OP_glFlushMappedBufferRangeAEMU",
+ 2266: "OP_glReadPixelsOffsetAEMU",
+ 2267: "OP_glCompressedTexImage2DOffsetAEMU",
+ 2268: "OP_glCompressedTexSubImage2DOffsetAEMU",
+ 2269: "OP_glTexImage2DOffsetAEMU",
+ 2270: "OP_glTexSubImage2DOffsetAEMU",
+ 2271: "OP_glBindBufferRange",
+ 2272: "OP_glBindBufferBase",
+ 2273: "OP_glCopyBufferSubData",
+ 2274: "OP_glClearBufferiv",
+ 2275: "OP_glClearBufferuiv",
+ 2276: "OP_glClearBufferfv",
+ 2277: "OP_glClearBufferfi",
+ 2278: "OP_glGetBufferParameteri64v",
+ 2279: "OP_glGetBufferPointerv",
+ 2280: "OP_glUniformBlockBinding",
+ 2281: "OP_glGetUniformBlockIndex",
+ 2282: "OP_glGetUniformIndices",
+ 2283: "OP_glGetUniformIndicesAEMU",
+ 2284: "OP_glGetActiveUniformBlockiv",
+ 2285: "OP_glGetActiveUniformBlockName",
+ 2286: "OP_glUniform1ui",
+ 2287: "OP_glUniform2ui",
+ 2288: "OP_glUniform3ui",
+ 2289: "OP_glUniform4ui",
+ 2290: "OP_glUniform1uiv",
+ 2291: "OP_glUniform2uiv",
+ 2292: "OP_glUniform3uiv",
+ 2293: "OP_glUniform4uiv",
+ 2294: "OP_glUniformMatrix2x3fv",
+ 2295: "OP_glUniformMatrix3x2fv",
+ 2296: "OP_glUniformMatrix2x4fv",
+ 2297: "OP_glUniformMatrix4x2fv",
+ 2298: "OP_glUniformMatrix3x4fv",
+ 2299: "OP_glUniformMatrix4x3fv",
+ 2300: "OP_glGetUniformuiv",
+ 2301: "OP_glGetActiveUniformsiv",
+ 2302: "OP_glVertexAttribI4i",
+ 2303: "OP_glVertexAttribI4ui",
+ 2304: "OP_glVertexAttribI4iv",
+ 2305: "OP_glVertexAttribI4uiv",
+ 2306: "OP_glVertexAttribIPointer",
+ 2307: "OP_glVertexAttribIPointerOffsetAEMU",
+ 2308: "OP_glVertexAttribIPointerDataAEMU",
+ 2309: "OP_glGetVertexAttribIiv",
+ 2310: "OP_glGetVertexAttribIuiv",
+ 2311: "OP_glVertexAttribDivisor",
+ 2312: "OP_glDrawArraysInstanced",
+ 2313: "OP_glDrawElementsInstanced",
+ 2314: "OP_glDrawElementsInstancedDataAEMU",
+ 2315: "OP_glDrawElementsInstancedOffsetAEMU",
+ 2316: "OP_glDrawRangeElements",
+ 2317: "OP_glDrawRangeElementsDataAEMU",
+ 2318: "OP_glDrawRangeElementsOffsetAEMU",
+ 2319: "OP_glFenceSync",
+ 2320: "OP_glClientWaitSync",
+ 2321: "OP_glWaitSync",
+ 2322: "OP_glDeleteSync",
+ 2323: "OP_glIsSync",
+ 2324: "OP_glGetSynciv",
+ 2325: "OP_glFenceSyncAEMU",
+ 2326: "OP_glClientWaitSyncAEMU",
+ 2327: "OP_glWaitSyncAEMU",
+ 2328: "OP_glDeleteSyncAEMU",
+ 2329: "OP_glIsSyncAEMU",
+ 2330: "OP_glGetSyncivAEMU",
+ 2331: "OP_glDrawBuffers",
+ 2332: "OP_glReadBuffer",
+ 2333: "OP_glBlitFramebuffer",
+ 2334: "OP_glInvalidateFramebuffer",
+ 2335: "OP_glInvalidateSubFramebuffer",
+ 2336: "OP_glFramebufferTextureLayer",
+ 2337: "OP_glRenderbufferStorageMultisample",
+ 2338: "OP_glTexStorage2D",
+ 2339: "OP_glGetInternalformativ",
+ 2340: "OP_glBeginTransformFeedback",
+ 2341: "OP_glEndTransformFeedback",
+ 2342: "OP_glGenTransformFeedbacks",
+ 2343: "OP_glDeleteTransformFeedbacks",
+ 2344: "OP_glBindTransformFeedback",
+ 2345: "OP_glPauseTransformFeedback",
+ 2346: "OP_glResumeTransformFeedback",
+ 2347: "OP_glIsTransformFeedback",
+ 2348: "OP_glTransformFeedbackVaryings",
+ 2349: "OP_glTransformFeedbackVaryingsAEMU",
+ 2350: "OP_glGetTransformFeedbackVarying",
+ 2351: "OP_glGenSamplers",
+ 2352: "OP_glDeleteSamplers",
+ 2353: "OP_glBindSampler",
+ 2354: "OP_glSamplerParameterf",
+ 2355: "OP_glSamplerParameteri",
+ 2356: "OP_glSamplerParameterfv",
+ 2357: "OP_glSamplerParameteriv",
+ 2358: "OP_glGetSamplerParameterfv",
+ 2359: "OP_glGetSamplerParameteriv",
+ 2360: "OP_glIsSampler",
+ 2361: "OP_glGenQueries",
+ 2362: "OP_glDeleteQueries",
+ 2363: "OP_glBeginQuery",
+ 2364: "OP_glEndQuery",
+ 2365: "OP_glGetQueryiv",
+ 2366: "OP_glGetQueryObjectuiv",
+ 2367: "OP_glIsQuery",
+ 2368: "OP_glProgramParameteri",
+ 2369: "OP_glProgramBinary",
+ 2370: "OP_glGetProgramBinary",
+ 2371: "OP_glGetFragDataLocation",
+ 2372: "OP_glGetInteger64v",
+ 2373: "OP_glGetIntegeri_v",
+ 2374: "OP_glGetInteger64i_v",
+ 2375: "OP_glTexImage3D",
+ 2376: "OP_glTexImage3DOffsetAEMU",
+ 2377: "OP_glTexStorage3D",
+ 2378: "OP_glTexSubImage3D",
+ 2379: "OP_glTexSubImage3DOffsetAEMU",
+ 2380: "OP_glCompressedTexImage3D",
+ 2381: "OP_glCompressedTexImage3DOffsetAEMU",
+ 2382: "OP_glCompressedTexSubImage3D",
+ 2383: "OP_glCompressedTexSubImage3DOffsetAEMU",
+ 2384: "OP_glCopyTexSubImage3D",
+ 2385: "OP_glGetStringi",
+ 2386: "OP_glGetBooleani_v",
+ 2387: "OP_glMemoryBarrier",
+ 2388: "OP_glMemoryBarrierByRegion",
+ 2389: "OP_glGenProgramPipelines",
+ 2390: "OP_glDeleteProgramPipelines",
+ 2391: "OP_glBindProgramPipeline",
+ 2392: "OP_glGetProgramPipelineiv",
+ 2393: "OP_glGetProgramPipelineInfoLog",
+ 2394: "OP_glValidateProgramPipeline",
+ 2395: "OP_glIsProgramPipeline",
+ 2396: "OP_glUseProgramStages",
+ 2397: "OP_glActiveShaderProgram",
+ 2398: "OP_glCreateShaderProgramv",
+ 2399: "OP_glCreateShaderProgramvAEMU",
+ 2400: "OP_glProgramUniform1f",
+ 2401: "OP_glProgramUniform2f",
+ 2402: "OP_glProgramUniform3f",
+ 2403: "OP_glProgramUniform4f",
+ 2404: "OP_glProgramUniform1i",
+ 2405: "OP_glProgramUniform2i",
+ 2406: "OP_glProgramUniform3i",
+ 2407: "OP_glProgramUniform4i",
+ 2408: "OP_glProgramUniform1ui",
+ 2409: "OP_glProgramUniform2ui",
+ 2410: "OP_glProgramUniform3ui",
+ 2411: "OP_glProgramUniform4ui",
+ 2412: "OP_glProgramUniform1fv",
+ 2413: "OP_glProgramUniform2fv",
+ 2414: "OP_glProgramUniform3fv",
+ 2415: "OP_glProgramUniform4fv",
+ 2416: "OP_glProgramUniform1iv",
+ 2417: "OP_glProgramUniform2iv",
+ 2418: "OP_glProgramUniform3iv",
+ 2419: "OP_glProgramUniform4iv",
+ 2420: "OP_glProgramUniform1uiv",
+ 2421: "OP_glProgramUniform2uiv",
+ 2422: "OP_glProgramUniform3uiv",
+ 2423: "OP_glProgramUniform4uiv",
+ 2424: "OP_glProgramUniformMatrix2fv",
+ 2425: "OP_glProgramUniformMatrix3fv",
+ 2426: "OP_glProgramUniformMatrix4fv",
+ 2427: "OP_glProgramUniformMatrix2x3fv",
+ 2428: "OP_glProgramUniformMatrix3x2fv",
+ 2429: "OP_glProgramUniformMatrix2x4fv",
+ 2430: "OP_glProgramUniformMatrix4x2fv",
+ 2431: "OP_glProgramUniformMatrix3x4fv",
+ 2432: "OP_glProgramUniformMatrix4x3fv",
+ 2433: "OP_glGetProgramInterfaceiv",
+ 2434: "OP_glGetProgramResourceiv",
+ 2435: "OP_glGetProgramResourceIndex",
+ 2436: "OP_glGetProgramResourceLocation",
+ 2437: "OP_glGetProgramResourceName",
+ 2438: "OP_glBindImageTexture",
+ 2439: "OP_glDispatchCompute",
+ 2440: "OP_glDispatchComputeIndirect",
+ 2441: "OP_glBindVertexBuffer",
+ 2442: "OP_glVertexAttribBinding",
+ 2443: "OP_glVertexAttribFormat",
+ 2444: "OP_glVertexAttribIFormat",
+ 2445: "OP_glVertexBindingDivisor",
+ 2446: "OP_glDrawArraysIndirect",
+ 2447: "OP_glDrawArraysIndirectDataAEMU",
+ 2448: "OP_glDrawArraysIndirectOffsetAEMU",
+ 2449: "OP_glDrawElementsIndirect",
+ 2450: "OP_glDrawElementsIndirectDataAEMU",
+ 2451: "OP_glDrawElementsIndirectOffsetAEMU",
+ 2452: "OP_glTexStorage2DMultisample",
+ 2453: "OP_glSampleMaski",
+ 2454: "OP_glGetMultisamplefv",
+ 2455: "OP_glFramebufferParameteri",
+ 2456: "OP_glGetFramebufferParameteriv",
+ 2457: "OP_glGetTexLevelParameterfv",
+ 2458: "OP_glGetTexLevelParameteriv",
+ 2459: "OP_glMapBufferRangeDMA",
+ 2460: "OP_glUnmapBufferDMA",
+ 2461: "OP_glMapBufferRangeDirect",
+ 2462: "OP_glUnmapBufferDirect",
+ 2463: "OP_glFlushMappedBufferRangeDirect",
+ 2464: "OP_glGetGraphicsResetStatusEXT",
+ 2465: "OP_glReadnPixelsEXT",
+ 2466: "OP_glGetnUniformfvEXT",
+ 2467: "OP_glGetnUniformivEXT",
+ 2468: "OP_glDrawArraysNullAEMU",
+ 2469: "OP_glDrawElementsNullAEMU",
+ 2470: "OP_glDrawElementsOffsetNullAEMU",
+ 2471: "OP_glDrawElementsDataNullAEMU",
+ 2472: "OP_glUnmapBufferAsyncAEMU",
+ 2473: "OP_glFlushMappedBufferRangeAEMU2",
+ 2474: "OP_glBufferDataSyncAEMU",
+}
diff --git a/src/gfxstream/scripts/print_gfx_logs/print_gfx_logs.py b/src/gfxstream/scripts/print_gfx_logs/print_gfx_logs.py
new file mode 100644
index 00000000000..a0490e8bd15
--- /dev/null
+++ b/src/gfxstream/scripts/print_gfx_logs/print_gfx_logs.py
@@ -0,0 +1,245 @@
+#
+# 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.
+
+"""
+Command line tool to process minidump files and print what was logged by GfxApiLogger.
+
+For more details see:
+
+design: go/bstar-gfx-logging
+g3doc: http://g3doc/play/g3doc/games/battlestar/kiwivm/graphics-tips.md#gfx-logs
+C++: http://source/play-internal/battlestar/aosp/device/generic/vulkan-cereal/utils/include/utils/GfxApiLogger.h
+
+Usage:
+
+python3 print_gfx_logs.py <path to minidump file>
+"""
+
+from __future__ import annotations
+import argparse
+import ctypes
+import sys
+from datetime import datetime
+import mmap
+import textwrap
+from . import command_printer
+from typing import NamedTuple, Optional, List
+import traceback
+
+
+class Header(ctypes.Structure):
+ """The C struct that we use to represent the data in memory
+ Keep in sync with GfxApiLogger.h
+ """
+ _fields_ = [('signature', ctypes.c_char * 10),
+ ('version', ctypes.c_uint16),
+ ('thread_id', ctypes.c_uint32),
+ ('last_written_time', ctypes.c_uint64),
+ ('write_index', ctypes.c_uint32),
+ ('committed_index', ctypes.c_uint32),
+ ('capture_id', ctypes.c_uint64),
+ ('data_size', ctypes.c_uint32)]
+
+
+class Command(NamedTuple):
+ """A single command in the stream"""
+ timestamp: int # Unix timestamp when command was recorded, in microseconds
+ opcode: int
+ original_size: int
+ data: bytes
+
+
+class Stream(NamedTuple):
+ """Stream of commands received from the guest"""
+ pos_in_file: int # Location of this stream in the minidump file, useful for debugging
+ timestamp: int # Unix timestamp of last command received, in microseconds
+ thread_id: int
+ capture_id: int
+ commands: List[Command]
+ error_message: Optional[str] # `None` if there were no errors parsing this stream
+
+ @staticmethod
+ def error(pos_in_file: int, error_message: str) -> Stream:
+ return Stream(
+ pos_in_file=pos_in_file, timestamp=0, thread_id=0, capture_id=0, commands=[],
+ error_message=error_message)
+
+def timestampToUnixUs(timestamp: int) -> int:
+ # Convert Windows' GetSystemTimeAsFileTime to Unix timestamp in microseconds
+ # https://stackoverflow.com/questions/1695288/getting-the-current-time-in-milliseconds-from-the-system-clock-in-windows
+ timestamp_us = int(timestamp / 10 - 11644473600000000)
+ if timestamp_us <= 0: timestamp_us = 0
+ return timestamp_us
+
+def read_uint32(buf: bytes, pos: int) -> int:
+ """Reads a single uint32 from buf at a given position"""
+ assert pos + 4 <= len(buf)
+ return int.from_bytes(buf[pos:pos + 4], byteorder='little', signed=False)
+
+def read_uint64(buf: bytes, pos: int) -> int:
+ """Reads a single uint32 from buf at a given position"""
+ assert pos + 8 <= len(buf)
+ return int.from_bytes(buf[pos:pos + 8], byteorder='little', signed=False)
+
+def process_command(buf: bytes, version: int) -> Command:
+ pos = 0
+ if version >= 3:
+ timestamp_us = read_uint64(buf, pos)
+ pos += 8
+ else:
+ timestamp_us = 0
+ opcode = read_uint32(buf, pos)
+ pos += 4
+ size = read_uint32(buf, pos)
+ pos += 4
+ return Command(timestamp_us, opcode, size, bytes(buf[pos:]))
+
+
+def process_stream(file_bytes: mmap, file_pos: int) -> Stream:
+ # Read the header
+ file_bytes.seek(file_pos)
+ header = Header()
+ header_bytes = file_bytes.read(ctypes.sizeof(header))
+ ctypes.memmove(ctypes.addressof(header), header_bytes, ctypes.sizeof(header))
+
+ if header.signature != b'GFXAPILOG':
+ return Stream.error(file_pos, error_message="Signature doesn't match")
+
+ if header.version < 2:
+ return Stream.error(
+ file_pos,
+ error_message=(
+ "This script can only process version 2 or later of the graphics API logs, but the "
+ + "dump file uses version {} ").format(header.version))
+
+ if header.version == 2:
+ timestamp_us = timestampToUnixUs(int(header.last_written_time))
+ else:
+ timestamp_us = int(header.last_written_time)
+
+ # Sanity check the size
+ if header.data_size > 5_000_000:
+ return Stream.error(
+ file_pos,
+ error_message="data size is larger than 5MB. This likely indicates garbage/corrupted " +
+ "data")
+
+ if header.committed_index >= header.data_size:
+ return Stream.error(
+ file_pos,
+ error_message="index is larger than buffer size. Likely indicates garbage/corrupted " +
+ "data")
+
+ file_bytes.seek(file_pos + ctypes.sizeof(header))
+ data = file_bytes.read(header.data_size)
+
+ # Reorder the buffer so that we can read it in a single pass from back to front
+ buf = data[header.committed_index:] + data[:header.committed_index]
+
+ commands = []
+ i = len(buf)
+ while i >= 4:
+ i -= 4
+ size = read_uint32(buf, i)
+ if size == 0 or size > i:
+ # We reached the end of the stream
+ break
+ cmd = process_command(buf[i - size:i], header.version)
+
+ commands.append(cmd)
+ i -= size
+
+ commands.reverse() # so that they're sorted from oldest to most recent
+ return Stream(file_pos, timestamp_us, header.thread_id, header.capture_id, commands, None)
+
+
+def process_minidump(mm: mmap) -> List[Stream]:
+ """
+ Extracts a list of commands streams from a minidump file
+ """
+ streams = []
+ pos = 0
+ while True:
+ pos = mm.find(b'GFXAPILOG', pos)
+ if pos == -1:
+ break
+ streams.append(process_stream(mm, pos))
+ pos += 1
+
+ return streams
+
+
+def main():
+ parser = argparse.ArgumentParser(description="""Command line tool to process crash reports and print out the
+ commands logged by GfxApiLogger""")
+ parser.add_argument('dump_file', help="Path to minidump file")
+
+ args = parser.parse_args()
+ streams = None
+ with open(args.dump_file, "r+b") as f:
+ with mmap.mmap(f.fileno(), 0) as mm:
+ streams = process_minidump(mm)
+
+ streams.sort(key=lambda s: s.timestamp)
+
+ total_commands = 0
+ num_errors = 0
+ for stream_idx, stream in enumerate(streams):
+ print(textwrap.dedent("""
+ =======================================================
+ GfxApiLog command stream #{} at offset {} in dump
+ - Timestamp: {}
+ - Thread id: {}
+ - Capture id: {}""".format(stream_idx, stream.pos_in_file,
+ datetime.fromtimestamp(stream.timestamp / 1000000.0),
+ stream.thread_id,
+ stream.capture_id)))
+ if stream.error_message:
+ print("Could not decode stream. Error: ", stream.error_message)
+ continue
+
+ subdecode_size = 0
+ for cmd_idx, cmd in enumerate(stream.commands):
+ total_commands += 1
+ cmd_printer = command_printer.CommandPrinter(
+ cmd.opcode, cmd.original_size, cmd.data, cmd.timestamp, stream_idx, cmd_idx)
+
+ try:
+ cmd_printer.print_cmd()
+ except:
+ num_errors += 1
+ # Print stack trace and continue
+ traceback.print_exc(file=sys.stdout)
+
+ if subdecode_size > 0:
+ subdecode_size -= cmd.original_size
+ assert subdecode_size >= 0
+ if subdecode_size == 0:
+ print("\n--- end of subdecode ---")
+
+ if cmd_printer.cmd_name() == "OP_vkQueueFlushCommandsGOOGLE":
+ assert subdecode_size == 0
+ subdecode_size = cmd.original_size - 36
+ print("\n--- start of subdecode, size = {} bytes ---".format(subdecode_size))
+ print("\nDone: {} commands, {} errors".format(total_commands, num_errors))
+ if num_errors > 0:
+ print("""
+NOTE: This script uses some simplifying assumptions to decode the commands. All
+decoding errors are almost certainly a bug with this script, NOT a sign of bad
+or corrupted data.""")
+
+
+if __name__ == '__main__':
+ main()
diff --git a/src/gfxstream/scripts/print_gfx_logs/print_gfx_logs_test.py b/src/gfxstream/scripts/print_gfx_logs/print_gfx_logs_test.py
new file mode 100644
index 00000000000..510912c781e
--- /dev/null
+++ b/src/gfxstream/scripts/print_gfx_logs/print_gfx_logs_test.py
@@ -0,0 +1,137 @@
+#
+# 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.
+
+import ctypes
+from typing import List
+from .print_gfx_logs import process_minidump, Command, Stream, Header
+import mmap
+import unittest
+import sys
+
+
+def create_vk_destroy_instance_command(vk_instance: int, p_allocator: int) -> Command:
+ OP_vkDestroyInstance = 20001
+ opcode = OP_vkDestroyInstance
+ data = bytearray()
+ # seq number
+ seqno = 20
+ data += seqno.to_bytes(4, byteorder='big')
+ # VkInstance
+ data += vk_instance.to_bytes(8, sys.byteorder)
+ # VkAllocationCallbacks
+ data += p_allocator.to_bytes(8, sys.byteorder)
+ return Command(opcode=opcode, original_size=len(data) + 8, data=bytes(data))
+
+
+def create_command_data(commands: List[Command]) -> bytearray:
+ data = bytearray()
+ for command in commands:
+ data += command.opcode.to_bytes(4, sys.byteorder)
+ data += command.original_size.to_bytes(4, sys.byteorder)
+ data += command.data
+ assert(len(command.data) + 8 == command.original_size)
+ data += command.original_size.to_bytes(4, byteorder='little')
+ return data
+
+
+def create_dump(stream: Stream) -> bytearray:
+ data = create_command_data(stream.commands)
+ header = Header()
+ header.signature = b'GFXAPILOG\0'
+ header.version = 2
+ header.thread_id = stream.thread_id
+ # Convert Windows' GetSystemTimeAsFileTime to Unix timestamp
+ # https://stackoverflow.com/questions/1695288/getting-the-current-time-in-milliseconds-from-the-system-clock-in-windows
+ header.last_written_time = (stream.timestamp + 11644473600000) * 10_000
+ header.write_index = 0
+ header.committed_index = 0
+ header.capture_id = stream.capture_id
+ header.data_size = len(data)
+ res = b'\0' * ctypes.sizeof(header)
+ ctypes.memmove(res, ctypes.addressof(header), ctypes.sizeof(header))
+ return res + data
+
+
+class ProcessMinidumpTestCase(unittest.TestCase):
+ def test_single_command(self):
+ command = create_vk_destroy_instance_command(vk_instance=0x1234, p_allocator=0x7321)
+ stream = Stream(pos_in_file=0, timestamp=123456, thread_id=4726,
+ capture_id=8261, commands=[command], error_message=None)
+ offset = 24
+ dump = b'\0' * offset + create_dump(stream)
+ streams = None
+ with mmap.mmap(-1, len(dump)) as mm:
+ mm.write(dump)
+ mm.seek(0)
+ streams = process_minidump(mm)
+ self.assertEqual(len(streams), 1)
+ self.assertEqual(streams[0].error_message, None)
+ self.assertEqual(streams[0].pos_in_file, offset)
+ self.assertEqual(streams[0].timestamp, stream.timestamp)
+ self.assertEqual(streams[0].thread_id, stream.thread_id)
+ self.assertEqual(streams[0].capture_id, stream.capture_id)
+ self.assertEqual(len(streams[0].commands), 1)
+ self.assertEqual(streams[0].commands[0].opcode, command.opcode)
+ self.assertEqual(streams[0].commands[0].original_size, command.original_size)
+ self.assertEqual(len(streams[0].commands[0].data), len(command.data))
+ self.assertEqual(streams[0].commands[0].data, command.data)
+
+ def test_multiple_commands(self):
+ commands = [create_vk_destroy_instance_command(
+ vk_instance=0x1234, p_allocator=0x7321),
+ create_vk_destroy_instance_command(
+ vk_instance=0x3621, p_allocator=0x7672)]
+ stream = Stream(pos_in_file=0, timestamp=123456, thread_id=4726,
+ capture_id=8261, commands=commands, error_message=None)
+ dump = create_dump(stream)
+ streams = None
+ with mmap.mmap(-1, len(dump)) as mm:
+ mm.write(dump)
+ mm.seek(0)
+ streams = process_minidump(mm)
+ self.assertEqual(len(streams), 1)
+ self.assertEqual(streams[0].error_message, None)
+ self.assertEqual(len(streams[0].commands), len(commands))
+ for actual_command, expected_command in zip(streams[0].commands, commands):
+ self.assertEqual(actual_command.opcode, expected_command.opcode)
+ self.assertEqual(actual_command.original_size, expected_command.original_size)
+ self.assertEqual(len(actual_command.data), len(expected_command.data))
+ self.assertEqual(actual_command.data, expected_command.data)
+
+ def test_multiple_streams(self):
+ command = create_vk_destroy_instance_command(vk_instance=0x1234, p_allocator=0x7321)
+ streams = []
+ offsets = []
+ dump = bytearray()
+ for i in range(10):
+ stream = Stream(pos_in_file=0, timestamp=i, thread_id=i,
+ capture_id=i, commands=[command], error_message=None)
+ streams.append(stream)
+ dump += b'\0' * i
+ offsets.append(len(dump))
+ dump += create_dump(stream)
+ actual_streams = None
+ with mmap.mmap(-1, len(dump)) as mm:
+ mm.write(dump)
+ mm.seek(0)
+ actual_streams = process_minidump(mm)
+ self.assertEqual(len(actual_streams), len(streams))
+ for i, (actual_stream, expected_stream) in enumerate(zip(actual_streams, streams)):
+ self.assertEqual(actual_stream.error_message, None)
+ self.assertEqual(actual_stream.pos_in_file, offsets[i])
+ self.assertEqual(actual_stream.timestamp, expected_stream.timestamp)
+ self.assertEqual(actual_stream.thread_id, expected_stream.thread_id)
+ self.assertEqual(actual_stream.capture_id, expected_stream.capture_id)
+ self.assertEqual(len(actual_stream.commands), len(expected_stream.commands))
diff --git a/src/gfxstream/scripts/print_gfx_logs/vulkan_printer.py b/src/gfxstream/scripts/print_gfx_logs/vulkan_printer.py
new file mode 100644
index 00000000000..fcc6f868d25
--- /dev/null
+++ b/src/gfxstream/scripts/print_gfx_logs/vulkan_printer.py
@@ -0,0 +1,2709 @@
+#####################################################################################################
+# Pretty-printer functions for Vulkan data structures
+# THIS FILE IS AUTO-GENERATED - DO NOT EDIT
+#
+# To re-generate this file, run generate-vulkan-sources.sh
+#####################################################################################################
+
+def OP_vkAcquireImageANDROID(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ image = printer.write_int("image", 8, indent, signed=False, big_endian=False)
+ nativeFenceFd = printer.write_int("nativeFenceFd", 4, indent, signed=True, big_endian=False)
+ semaphore = printer.write_int("semaphore", 8, indent, signed=False, big_endian=False)
+ fence = printer.write_int("fence", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkAllocateMemory(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocateInfo", struct_VkMemoryAllocateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pMemory = printer.write_int("pMemory", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkBeginCommandBufferAsyncGOOGLE(printer, indent: int):
+ printer.write_struct("pBeginInfo", struct_VkCommandBufferBeginInfo, False, None, indent)
+ return
+
+def OP_vkBindBufferMemory(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ buffer = printer.write_int("buffer", 8, indent, signed=False, big_endian=False)
+ memory = printer.write_int("memory", 8, indent, signed=False, big_endian=False)
+ memoryOffset = printer.write_int("memoryOffset", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkBindImageMemory(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ image = printer.write_int("image", 8, indent, signed=False, big_endian=False)
+ memory = printer.write_int("memory", 8, indent, signed=False, big_endian=False)
+ memoryOffset = printer.write_int("memoryOffset", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkCmdBeginRenderPass(printer, indent: int):
+ printer.write_struct("pRenderPassBegin", struct_VkRenderPassBeginInfo, False, None, indent)
+ printer.write_enum("contents", VkSubpassContents, indent)
+ return
+
+def OP_vkCmdBindDescriptorSets(printer, indent: int):
+ printer.write_enum("pipelineBindPoint", VkPipelineBindPoint, indent)
+ layout = printer.write_int("layout", 8, indent, signed=False, big_endian=False)
+ firstSet = printer.write_int("firstSet", 4, indent, signed=False, big_endian=False)
+ descriptorSetCount = printer.write_int("descriptorSetCount", 4, indent, signed=False, big_endian=False)
+ pDescriptorSets = printer.write_int("pDescriptorSets", 8, indent, optional=False, count=descriptorSetCount, big_endian=False)
+ dynamicOffsetCount = printer.write_int("dynamicOffsetCount", 4, indent, signed=False, big_endian=False)
+ pDynamicOffsets = printer.write_int("pDynamicOffsets", 4, indent, optional=False, count=dynamicOffsetCount, big_endian=False)
+ return
+
+def OP_vkCmdBindIndexBuffer(printer, indent: int):
+ buffer = printer.write_int("buffer", 8, indent, signed=False, big_endian=False)
+ offset = printer.write_int("offset", 8, indent, signed=False, big_endian=False)
+ printer.write_enum("indexType", VkIndexType, indent)
+ return
+
+def OP_vkCmdBindPipeline(printer, indent: int):
+ printer.write_enum("pipelineBindPoint", VkPipelineBindPoint, indent)
+ pipeline = printer.write_int("pipeline", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkCmdBindVertexBuffers(printer, indent: int):
+ firstBinding = printer.write_int("firstBinding", 4, indent, signed=False, big_endian=False)
+ bindingCount = printer.write_int("bindingCount", 4, indent, signed=False, big_endian=False)
+ pBuffers = printer.write_int("pBuffers", 8, indent, optional=False, count=bindingCount, big_endian=False)
+ pOffsets = printer.write_int("pOffsets", 8, indent, optional=False, count=bindingCount, big_endian=False)
+ return
+
+def OP_vkCmdClearAttachments(printer, indent: int):
+ attachmentCount = printer.write_int("attachmentCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pAttachments", struct_VkClearAttachment, False, attachmentCount, indent)
+ rectCount = printer.write_int("rectCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pRects", struct_VkClearRect, False, rectCount, indent)
+ return
+
+def OP_vkCmdClearColorImage(printer, indent: int):
+ image = printer.write_int("image", 8, indent, signed=False, big_endian=False)
+ printer.write_enum("imageLayout", VkImageLayout, indent)
+ printer.write_struct("pColor", struct_VkClearColorValue, False, None, indent)
+ rangeCount = printer.write_int("rangeCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pRanges", struct_VkImageSubresourceRange, False, rangeCount, indent)
+ return
+
+def OP_vkCmdCopyBufferToImage(printer, indent: int):
+ srcBuffer = printer.write_int("srcBuffer", 8, indent, signed=False, big_endian=False)
+ dstImage = printer.write_int("dstImage", 8, indent, signed=False, big_endian=False)
+ printer.write_enum("dstImageLayout", VkImageLayout, indent)
+ regionCount = printer.write_int("regionCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pRegions", struct_VkBufferImageCopy, False, regionCount, indent)
+ return
+
+def OP_vkCmdCopyImageToBuffer(printer, indent: int):
+ srcImage = printer.write_int("srcImage", 8, indent, signed=False, big_endian=False)
+ printer.write_enum("srcImageLayout", VkImageLayout, indent)
+ dstBuffer = printer.write_int("dstBuffer", 8, indent, signed=False, big_endian=False)
+ regionCount = printer.write_int("regionCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pRegions", struct_VkBufferImageCopy, False, regionCount, indent)
+ return
+
+def OP_vkCmdDraw(printer, indent: int):
+ vertexCount = printer.write_int("vertexCount", 4, indent, signed=False, big_endian=False)
+ instanceCount = printer.write_int("instanceCount", 4, indent, signed=False, big_endian=False)
+ firstVertex = printer.write_int("firstVertex", 4, indent, signed=False, big_endian=False)
+ firstInstance = printer.write_int("firstInstance", 4, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkCmdDrawIndexed(printer, indent: int):
+ indexCount = printer.write_int("indexCount", 4, indent, signed=False, big_endian=False)
+ instanceCount = printer.write_int("instanceCount", 4, indent, signed=False, big_endian=False)
+ firstIndex = printer.write_int("firstIndex", 4, indent, signed=False, big_endian=False)
+ vertexOffset = printer.write_int("vertexOffset", 4, indent, signed=True, big_endian=False)
+ firstInstance = printer.write_int("firstInstance", 4, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkCmdEndRenderPass(printer, indent: int):
+ return
+
+def OP_vkCmdPipelineBarrier(printer, indent: int):
+ srcStageMask = printer.write_int("srcStageMask", 4, indent, signed=False, big_endian=False)
+ dstStageMask = printer.write_int("dstStageMask", 4, indent, signed=False, big_endian=False)
+ dependencyFlags = printer.write_int("dependencyFlags", 4, indent, signed=False, big_endian=False)
+ memoryBarrierCount = printer.write_int("memoryBarrierCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pMemoryBarriers", struct_VkMemoryBarrier, False, memoryBarrierCount, indent)
+ bufferMemoryBarrierCount = printer.write_int("bufferMemoryBarrierCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pBufferMemoryBarriers", struct_VkBufferMemoryBarrier, False, bufferMemoryBarrierCount, indent)
+ imageMemoryBarrierCount = printer.write_int("imageMemoryBarrierCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pImageMemoryBarriers", struct_VkImageMemoryBarrier, False, imageMemoryBarrierCount, indent)
+ return
+
+def OP_vkCmdSetScissor(printer, indent: int):
+ firstScissor = printer.write_int("firstScissor", 4, indent, signed=False, big_endian=False)
+ scissorCount = printer.write_int("scissorCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pScissors", struct_VkRect2D, False, scissorCount, indent)
+ return
+
+def OP_vkCmdSetViewport(printer, indent: int):
+ firstViewport = printer.write_int("firstViewport", 4, indent, signed=False, big_endian=False)
+ viewportCount = printer.write_int("viewportCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pViewports", struct_VkViewport, False, viewportCount, indent)
+ return
+
+def OP_vkCollectDescriptorPoolIdsGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ descriptorPool = printer.write_int("descriptorPool", 8, indent, signed=False, big_endian=False)
+ pPoolIdCount = printer.write_int("pPoolIdCount", 4, indent, optional=False, count=None, big_endian=False)
+ pPoolIds = printer.write_int("pPoolIds", 8, indent, optional=True, count=pPoolIdCount, big_endian=False)
+ return
+
+def OP_vkCreateBufferWithRequirementsGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkBufferCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pBuffer = printer.write_int("pBuffer", 8, indent, optional=False, count=None, big_endian=False)
+ printer.write_struct("pMemoryRequirements", struct_VkMemoryRequirements, False, None, indent)
+ return
+
+def OP_vkCreateDescriptorPool(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkDescriptorPoolCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pDescriptorPool = printer.write_int("pDescriptorPool", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkCreateDescriptorSetLayout(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkDescriptorSetLayoutCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pSetLayout = printer.write_int("pSetLayout", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkCreateFence(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkFenceCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pFence = printer.write_int("pFence", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkCreateFramebuffer(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkFramebufferCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pFramebuffer = printer.write_int("pFramebuffer", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkCreateGraphicsPipelines(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ pipelineCache = printer.write_int("pipelineCache", 8, indent, signed=False, big_endian=False)
+ createInfoCount = printer.write_int("createInfoCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfos", struct_VkGraphicsPipelineCreateInfo, False, createInfoCount, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pPipelines = printer.write_int("pPipelines", 8, indent, optional=False, count=createInfoCount, big_endian=False)
+ return
+
+def OP_vkCreateImageView(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkImageViewCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pView = printer.write_int("pView", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkCreateImageWithRequirementsGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkImageCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pImage = printer.write_int("pImage", 8, indent, optional=False, count=None, big_endian=False)
+ printer.write_struct("pMemoryRequirements", struct_VkMemoryRequirements, False, None, indent)
+ return
+
+def OP_vkCreatePipelineCache(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkPipelineCacheCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pPipelineCache = printer.write_int("pPipelineCache", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkCreateRenderPass(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkRenderPassCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pRenderPass = printer.write_int("pRenderPass", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkCreateSampler(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkSamplerCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pSampler = printer.write_int("pSampler", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkCreateSemaphore(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkSemaphoreCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pSemaphore = printer.write_int("pSemaphore", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkCreateShaderModule(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pCreateInfo", struct_VkShaderModuleCreateInfo, False, None, indent)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ pShaderModule = printer.write_int("pShaderModule", 8, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkDestroyBuffer(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ buffer = printer.write_int("buffer", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyCommandPool(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ commandPool = printer.write_int("commandPool", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyDescriptorPool(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ descriptorPool = printer.write_int("descriptorPool", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyDescriptorSetLayout(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ descriptorSetLayout = printer.write_int("descriptorSetLayout", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyDevice(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyFence(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ fence = printer.write_int("fence", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyFramebuffer(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ framebuffer = printer.write_int("framebuffer", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyImage(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ image = printer.write_int("image", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyImageView(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ imageView = printer.write_int("imageView", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyInstance(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ instance = printer.write_int("instance", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyPipeline(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ pipeline = printer.write_int("pipeline", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyPipelineCache(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ pipelineCache = printer.write_int("pipelineCache", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyPipelineLayout(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ pipelineLayout = printer.write_int("pipelineLayout", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyRenderPass(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ renderPass = printer.write_int("renderPass", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroySemaphore(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ semaphore = printer.write_int("semaphore", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkDestroyShaderModule(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ shaderModule = printer.write_int("shaderModule", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkEndCommandBufferAsyncGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ return
+
+def OP_vkFreeCommandBuffers(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ commandPool = printer.write_int("commandPool", 8, indent, signed=False, big_endian=False)
+ commandBufferCount = printer.write_int("commandBufferCount", 4, indent, signed=False, big_endian=False)
+ pCommandBuffers = printer.write_int("pCommandBuffers", 8, indent, optional=True, count=commandBufferCount, big_endian=False)
+ return
+
+def OP_vkFreeMemory(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ memory = printer.write_int("memory", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkFreeMemorySyncGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ memory = printer.write_int("memory", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pAllocator", struct_VkAllocationCallbacks, True, None, indent)
+ return
+
+def OP_vkGetBlobGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ memory = printer.write_int("memory", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkGetFenceStatus(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ fence = printer.write_int("fence", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkGetMemoryHostAddressInfoGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ memory = printer.write_int("memory", 8, indent, signed=False, big_endian=False)
+ pAddress = printer.write_int("pAddress", 8, indent, optional=True, count=None, big_endian=False)
+ pSize = printer.write_int("pSize", 8, indent, optional=True, count=None, big_endian=False)
+ pHostmemId = printer.write_int("pHostmemId", 8, indent, optional=True, count=None, big_endian=False)
+ return
+
+def OP_vkGetPhysicalDeviceFormatProperties(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ physicalDevice = printer.write_int("physicalDevice", 8, indent, signed=False, big_endian=False)
+ printer.write_enum("format", VkFormat, indent)
+ printer.write_struct("pFormatProperties", struct_VkFormatProperties, False, None, indent)
+ return
+
+def OP_vkGetPhysicalDeviceProperties2KHR(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ physicalDevice = printer.write_int("physicalDevice", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("pProperties", struct_VkPhysicalDeviceProperties2, False, None, indent)
+ return
+
+def OP_vkGetPipelineCacheData(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ pipelineCache = printer.write_int("pipelineCache", 8, indent, signed=False, big_endian=False)
+ pDataSize = printer.write_int("pDataSize", 8, indent, optional=True, count=None, big_endian=True)
+ pData = printer.write_int("pData", 8, indent, optional=True, count=pDataSize, big_endian=False)
+ return
+
+def OP_vkGetSwapchainGrallocUsageANDROID(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ printer.write_enum("format", VkFormat, indent)
+ imageUsage = printer.write_int("imageUsage", 4, indent, signed=False, big_endian=False)
+ grallocUsage = printer.write_int("grallocUsage", 4, indent, optional=False, count=None, big_endian=False)
+ return
+
+def OP_vkQueueCommitDescriptorSetUpdatesGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ queue = printer.write_int("queue", 8, indent, signed=False, big_endian=False)
+ descriptorPoolCount = printer.write_int("descriptorPoolCount", 4, indent, signed=False, big_endian=False)
+ pDescriptorPools = printer.write_int("pDescriptorPools", 8, indent, optional=False, count=descriptorPoolCount, big_endian=False)
+ descriptorSetCount = printer.write_int("descriptorSetCount", 4, indent, signed=False, big_endian=False)
+ pSetLayouts = printer.write_int("pSetLayouts", 8, indent, optional=False, count=descriptorSetCount, big_endian=False)
+ pDescriptorSetPoolIds = printer.write_int("pDescriptorSetPoolIds", 8, indent, optional=False, count=descriptorSetCount, big_endian=False)
+ pDescriptorSetWhichPool = printer.write_int("pDescriptorSetWhichPool", 4, indent, optional=False, count=descriptorSetCount, big_endian=False)
+ pDescriptorSetPendingAllocation = printer.write_int("pDescriptorSetPendingAllocation", 4, indent, optional=False, count=descriptorSetCount, big_endian=False)
+ pDescriptorWriteStartingIndices = printer.write_int("pDescriptorWriteStartingIndices", 4, indent, optional=False, count=descriptorSetCount, big_endian=False)
+ pendingDescriptorWriteCount = printer.write_int("pendingDescriptorWriteCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pPendingDescriptorWrites", struct_VkWriteDescriptorSet, False, pendingDescriptorWriteCount, indent)
+ return
+
+def OP_vkQueueFlushCommandsGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ queue = printer.write_int("queue", 8, indent, signed=False, big_endian=False)
+ commandBuffer = printer.write_int("commandBuffer", 8, indent, signed=False, big_endian=False)
+ dataSize = printer.write_int("dataSize", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkQueueSignalReleaseImageANDROIDAsyncGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ queue = printer.write_int("queue", 8, indent, signed=False, big_endian=False)
+ waitSemaphoreCount = printer.write_int("waitSemaphoreCount", 4, indent, signed=False, big_endian=False)
+ pWaitSemaphores = printer.write_int("pWaitSemaphores", 8, indent, optional=True, count=waitSemaphoreCount, big_endian=False)
+ image = printer.write_int("image", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkQueueSubmitAsyncGOOGLE(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ queue = printer.write_int("queue", 8, indent, signed=False, big_endian=False)
+ submitCount = printer.write_int("submitCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pSubmits", struct_VkSubmitInfo, False, submitCount, indent)
+ fence = printer.write_int("fence", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkQueueWaitIdle(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ queue = printer.write_int("queue", 8, indent, signed=False, big_endian=False)
+ return
+
+def OP_vkResetFences(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ fenceCount = printer.write_int("fenceCount", 4, indent, signed=False, big_endian=False)
+ pFences = printer.write_int("pFences", 8, indent, optional=False, count=fenceCount, big_endian=False)
+ return
+
+def OP_vkWaitForFences(printer, indent: int):
+ printer.write_int("seqno: ", 4, indent)
+ device = printer.write_int("device", 8, indent, signed=False, big_endian=False)
+ fenceCount = printer.write_int("fenceCount", 4, indent, signed=False, big_endian=False)
+ pFences = printer.write_int("pFences", 8, indent, optional=False, count=fenceCount, big_endian=False)
+ waitAll = printer.write_int("waitAll", 4, indent, signed=False, big_endian=False)
+ timeout = printer.write_int("timeout", 8, indent, signed=False, big_endian=False)
+ return
+
+def struct_VkAllocationCallbacks(printer, indent: int):
+ pUserData = printer.write_int("pUserData", 8, indent, optional=True, count=None, big_endian=False)
+ pfnAllocation = printer.write_int("pfnAllocation", 8, indent, signed=False, big_endian=False)
+ pfnReallocation = printer.write_int("pfnReallocation", 8, indent, signed=False, big_endian=False)
+ pfnFree = printer.write_int("pfnFree", 8, indent, signed=False, big_endian=False)
+ pfnInternalAllocation = printer.write_int("pfnInternalAllocation", 8, indent, signed=False, big_endian=False)
+ pfnInternalFree = printer.write_int("pfnInternalFree", 8, indent, signed=False, big_endian=False)
+
+def struct_VkAttachmentDescription(printer, indent: int):
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("format", VkFormat, indent)
+ printer.write_enum("samples", VkSampleCountFlagBits, indent)
+ printer.write_enum("loadOp", VkAttachmentLoadOp, indent)
+ printer.write_enum("storeOp", VkAttachmentStoreOp, indent)
+ printer.write_enum("stencilLoadOp", VkAttachmentLoadOp, indent)
+ printer.write_enum("stencilStoreOp", VkAttachmentStoreOp, indent)
+ printer.write_enum("initialLayout", VkImageLayout, indent)
+ printer.write_enum("finalLayout", VkImageLayout, indent)
+
+def struct_VkAttachmentReference(printer, indent: int):
+ attachment = printer.write_int("attachment", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("layout", VkImageLayout, indent)
+
+def struct_VkBufferCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ size = printer.write_int("size", 8, indent, signed=False, big_endian=False)
+ usage = printer.write_int("usage", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("sharingMode", VkSharingMode, indent)
+ queueFamilyIndexCount = printer.write_int("queueFamilyIndexCount", 4, indent, signed=False, big_endian=False)
+ pQueueFamilyIndices = printer.write_int("pQueueFamilyIndices", 4, indent, optional=True, count=queueFamilyIndexCount, big_endian=False)
+
+def struct_VkBufferImageCopy(printer, indent: int):
+ bufferOffset = printer.write_int("bufferOffset", 8, indent, signed=False, big_endian=False)
+ bufferRowLength = printer.write_int("bufferRowLength", 4, indent, signed=False, big_endian=False)
+ bufferImageHeight = printer.write_int("bufferImageHeight", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("imageSubresource", struct_VkImageSubresourceLayers, False, None, indent)
+ printer.write_struct("imageOffset", struct_VkOffset3D, False, None, indent)
+ printer.write_struct("imageExtent", struct_VkExtent3D, False, None, indent)
+
+def struct_VkBufferMemoryBarrier(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER", indent)
+ srcAccessMask = printer.write_int("srcAccessMask", 4, indent, signed=False, big_endian=False)
+ dstAccessMask = printer.write_int("dstAccessMask", 4, indent, signed=False, big_endian=False)
+ srcQueueFamilyIndex = printer.write_int("srcQueueFamilyIndex", 4, indent, signed=False, big_endian=False)
+ dstQueueFamilyIndex = printer.write_int("dstQueueFamilyIndex", 4, indent, signed=False, big_endian=False)
+ buffer = printer.write_int("buffer", 8, indent, signed=False, big_endian=False)
+ offset = printer.write_int("offset", 8, indent, signed=False, big_endian=False)
+ size = printer.write_int("size", 8, indent, signed=False, big_endian=False)
+
+def struct_VkClearAttachment(printer, indent: int):
+ aspectMask = printer.write_int("aspectMask", 4, indent, signed=False, big_endian=False)
+ colorAttachment = printer.write_int("colorAttachment", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("clearValue", struct_VkClearValue, False, None, indent)
+
+def struct_VkClearColorValue(printer, indent: int):
+ printer.write_float("float32", indent, count=4)
+
+def struct_VkClearRect(printer, indent: int):
+ printer.write_struct("rect", struct_VkRect2D, False, None, indent)
+ baseArrayLayer = printer.write_int("baseArrayLayer", 4, indent, signed=False, big_endian=False)
+ layerCount = printer.write_int("layerCount", 4, indent, signed=False, big_endian=False)
+
+def struct_VkClearValue(printer, indent: int):
+ printer.write_struct("color", struct_VkClearColorValue, False, None, indent)
+
+def struct_VkCommandBufferBeginInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pInheritanceInfo", struct_VkCommandBufferInheritanceInfo, True, None, indent)
+
+def struct_VkCommandBufferInheritanceInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO", indent)
+ renderPass = printer.write_int("renderPass", 8, indent, signed=False, big_endian=False)
+ subpass = printer.write_int("subpass", 4, indent, signed=False, big_endian=False)
+ framebuffer = printer.write_int("framebuffer", 8, indent, signed=False, big_endian=False)
+ occlusionQueryEnable = printer.write_int("occlusionQueryEnable", 4, indent, signed=False, big_endian=False)
+ queryFlags = printer.write_int("queryFlags", 4, indent, signed=False, big_endian=False)
+ pipelineStatistics = printer.write_int("pipelineStatistics", 4, indent, signed=False, big_endian=False)
+
+def struct_VkComponentMapping(printer, indent: int):
+ printer.write_enum("r", VkComponentSwizzle, indent)
+ printer.write_enum("g", VkComponentSwizzle, indent)
+ printer.write_enum("b", VkComponentSwizzle, indent)
+ printer.write_enum("a", VkComponentSwizzle, indent)
+
+def struct_VkDescriptorBufferInfo(printer, indent: int):
+ buffer = printer.write_int("buffer", 8, indent, signed=False, big_endian=False)
+ offset = printer.write_int("offset", 8, indent, signed=False, big_endian=False)
+ range = printer.write_int("range", 8, indent, signed=False, big_endian=False)
+
+def struct_VkDescriptorImageInfo(printer, indent: int):
+ sampler = printer.write_int("sampler", 8, indent, signed=False, big_endian=False)
+ imageView = printer.write_int("imageView", 8, indent, signed=False, big_endian=False)
+ printer.write_enum("imageLayout", VkImageLayout, indent)
+
+def struct_VkDescriptorPoolCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ maxSets = printer.write_int("maxSets", 4, indent, signed=False, big_endian=False)
+ poolSizeCount = printer.write_int("poolSizeCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pPoolSizes", struct_VkDescriptorPoolSize, False, poolSizeCount, indent)
+
+def struct_VkDescriptorPoolSize(printer, indent: int):
+ printer.write_enum("type", VkDescriptorType, indent)
+ descriptorCount = printer.write_int("descriptorCount", 4, indent, signed=False, big_endian=False)
+
+def struct_VkDescriptorSetLayoutBinding(printer, indent: int):
+ binding = printer.write_int("binding", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("descriptorType", VkDescriptorType, indent)
+ descriptorCount = printer.write_int("descriptorCount", 4, indent, signed=False, big_endian=False)
+ stageFlags = printer.write_int("stageFlags", 4, indent, signed=False, big_endian=False)
+ pImmutableSamplers = printer.write_int("pImmutableSamplers", 8, indent, optional=True, count=descriptorCount, big_endian=False)
+
+def struct_VkDescriptorSetLayoutCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ bindingCount = printer.write_int("bindingCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pBindings", struct_VkDescriptorSetLayoutBinding, False, bindingCount, indent)
+
+def struct_VkExtent2D(printer, indent: int):
+ width = printer.write_int("width", 4, indent, signed=False, big_endian=False)
+ height = printer.write_int("height", 4, indent, signed=False, big_endian=False)
+
+def struct_VkExtent3D(printer, indent: int):
+ width = printer.write_int("width", 4, indent, signed=False, big_endian=False)
+ height = printer.write_int("height", 4, indent, signed=False, big_endian=False)
+ depth = printer.write_int("depth", 4, indent, signed=False, big_endian=False)
+
+def struct_VkFenceCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_FENCE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+
+def struct_VkFormatProperties(printer, indent: int):
+ linearTilingFeatures = printer.write_int("linearTilingFeatures", 4, indent, signed=False, big_endian=False)
+ optimalTilingFeatures = printer.write_int("optimalTilingFeatures", 4, indent, signed=False, big_endian=False)
+ bufferFeatures = printer.write_int("bufferFeatures", 4, indent, signed=False, big_endian=False)
+
+def struct_VkFramebufferCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ renderPass = printer.write_int("renderPass", 8, indent, signed=False, big_endian=False)
+ attachmentCount = printer.write_int("attachmentCount", 4, indent, signed=False, big_endian=False)
+ pAttachments = printer.write_int("pAttachments", 8, indent, optional=False, count=attachmentCount, big_endian=False)
+ width = printer.write_int("width", 4, indent, signed=False, big_endian=False)
+ height = printer.write_int("height", 4, indent, signed=False, big_endian=False)
+ layers = printer.write_int("layers", 4, indent, signed=False, big_endian=False)
+
+def struct_VkGraphicsPipelineCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ stageCount = printer.write_int("stageCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pStages", struct_VkPipelineShaderStageCreateInfo, False, stageCount, indent)
+ printer.write_struct("pVertexInputState", struct_VkPipelineVertexInputStateCreateInfo, True, None, indent)
+ printer.write_struct("pInputAssemblyState", struct_VkPipelineInputAssemblyStateCreateInfo, True, None, indent)
+ printer.write_struct("pTessellationState", struct_VkPipelineTessellationStateCreateInfo, True, None, indent)
+ printer.write_struct("pViewportState", struct_VkPipelineViewportStateCreateInfo, True, None, indent)
+ printer.write_struct("pRasterizationState", struct_VkPipelineRasterizationStateCreateInfo, True, None, indent)
+ printer.write_struct("pMultisampleState", struct_VkPipelineMultisampleStateCreateInfo, True, None, indent)
+ printer.write_struct("pDepthStencilState", struct_VkPipelineDepthStencilStateCreateInfo, True, None, indent)
+ printer.write_struct("pColorBlendState", struct_VkPipelineColorBlendStateCreateInfo, True, None, indent)
+ printer.write_struct("pDynamicState", struct_VkPipelineDynamicStateCreateInfo, True, None, indent)
+ layout = printer.write_int("layout", 8, indent, signed=False, big_endian=False)
+ renderPass = printer.write_int("renderPass", 8, indent, signed=False, big_endian=False)
+ subpass = printer.write_int("subpass", 4, indent, signed=False, big_endian=False)
+ basePipelineHandle = printer.write_int("basePipelineHandle", 8, indent, signed=False, big_endian=False)
+ basePipelineIndex = printer.write_int("basePipelineIndex", 4, indent, signed=True, big_endian=False)
+
+def struct_VkImageCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("imageType", VkImageType, indent)
+ printer.write_enum("format", VkFormat, indent)
+ printer.write_struct("extent", struct_VkExtent3D, False, None, indent)
+ mipLevels = printer.write_int("mipLevels", 4, indent, signed=False, big_endian=False)
+ arrayLayers = printer.write_int("arrayLayers", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("samples", VkSampleCountFlagBits, indent)
+ printer.write_enum("tiling", VkImageTiling, indent)
+ usage = printer.write_int("usage", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("sharingMode", VkSharingMode, indent)
+ queueFamilyIndexCount = printer.write_int("queueFamilyIndexCount", 4, indent, signed=False, big_endian=False)
+ pQueueFamilyIndices = printer.write_int("pQueueFamilyIndices", 4, indent, optional=True, count=queueFamilyIndexCount, big_endian=False)
+ printer.write_enum("initialLayout", VkImageLayout, indent)
+
+def struct_VkImageMemoryBarrier(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER", indent)
+ srcAccessMask = printer.write_int("srcAccessMask", 4, indent, signed=False, big_endian=False)
+ dstAccessMask = printer.write_int("dstAccessMask", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("oldLayout", VkImageLayout, indent)
+ printer.write_enum("newLayout", VkImageLayout, indent)
+ srcQueueFamilyIndex = printer.write_int("srcQueueFamilyIndex", 4, indent, signed=False, big_endian=False)
+ dstQueueFamilyIndex = printer.write_int("dstQueueFamilyIndex", 4, indent, signed=False, big_endian=False)
+ image = printer.write_int("image", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("subresourceRange", struct_VkImageSubresourceRange, False, None, indent)
+
+def struct_VkImageSubresourceLayers(printer, indent: int):
+ aspectMask = printer.write_int("aspectMask", 4, indent, signed=False, big_endian=False)
+ mipLevel = printer.write_int("mipLevel", 4, indent, signed=False, big_endian=False)
+ baseArrayLayer = printer.write_int("baseArrayLayer", 4, indent, signed=False, big_endian=False)
+ layerCount = printer.write_int("layerCount", 4, indent, signed=False, big_endian=False)
+
+def struct_VkImageSubresourceRange(printer, indent: int):
+ aspectMask = printer.write_int("aspectMask", 4, indent, signed=False, big_endian=False)
+ baseMipLevel = printer.write_int("baseMipLevel", 4, indent, signed=False, big_endian=False)
+ levelCount = printer.write_int("levelCount", 4, indent, signed=False, big_endian=False)
+ baseArrayLayer = printer.write_int("baseArrayLayer", 4, indent, signed=False, big_endian=False)
+ layerCount = printer.write_int("layerCount", 4, indent, signed=False, big_endian=False)
+
+def struct_VkImageViewCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ image = printer.write_int("image", 8, indent, signed=False, big_endian=False)
+ printer.write_enum("viewType", VkImageViewType, indent)
+ printer.write_enum("format", VkFormat, indent)
+ printer.write_struct("components", struct_VkComponentMapping, False, None, indent)
+ printer.write_struct("subresourceRange", struct_VkImageSubresourceRange, False, None, indent)
+
+def struct_VkMemoryAllocateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO", indent)
+ allocationSize = printer.write_int("allocationSize", 8, indent, signed=False, big_endian=False)
+ memoryTypeIndex = printer.write_int("memoryTypeIndex", 4, indent, signed=False, big_endian=False)
+
+def struct_VkMemoryBarrier(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_MEMORY_BARRIER", indent)
+ srcAccessMask = printer.write_int("srcAccessMask", 4, indent, signed=False, big_endian=False)
+ dstAccessMask = printer.write_int("dstAccessMask", 4, indent, signed=False, big_endian=False)
+
+def struct_VkMemoryRequirements(printer, indent: int):
+ size = printer.write_int("size", 8, indent, signed=False, big_endian=False)
+ alignment = printer.write_int("alignment", 8, indent, signed=False, big_endian=False)
+ memoryTypeBits = printer.write_int("memoryTypeBits", 4, indent, signed=False, big_endian=False)
+
+def struct_VkOffset2D(printer, indent: int):
+ x = printer.write_int("x", 4, indent, signed=True, big_endian=False)
+ y = printer.write_int("y", 4, indent, signed=True, big_endian=False)
+
+def struct_VkOffset3D(printer, indent: int):
+ x = printer.write_int("x", 4, indent, signed=True, big_endian=False)
+ y = printer.write_int("y", 4, indent, signed=True, big_endian=False)
+ z = printer.write_int("z", 4, indent, signed=True, big_endian=False)
+
+def struct_VkPhysicalDeviceLimits(printer, indent: int):
+ maxImageDimension1D = printer.write_int("maxImageDimension1D", 4, indent, signed=False, big_endian=False)
+ maxImageDimension2D = printer.write_int("maxImageDimension2D", 4, indent, signed=False, big_endian=False)
+ maxImageDimension3D = printer.write_int("maxImageDimension3D", 4, indent, signed=False, big_endian=False)
+ maxImageDimensionCube = printer.write_int("maxImageDimensionCube", 4, indent, signed=False, big_endian=False)
+ maxImageArrayLayers = printer.write_int("maxImageArrayLayers", 4, indent, signed=False, big_endian=False)
+ maxTexelBufferElements = printer.write_int("maxTexelBufferElements", 4, indent, signed=False, big_endian=False)
+ maxUniformBufferRange = printer.write_int("maxUniformBufferRange", 4, indent, signed=False, big_endian=False)
+ maxStorageBufferRange = printer.write_int("maxStorageBufferRange", 4, indent, signed=False, big_endian=False)
+ maxPushConstantsSize = printer.write_int("maxPushConstantsSize", 4, indent, signed=False, big_endian=False)
+ maxMemoryAllocationCount = printer.write_int("maxMemoryAllocationCount", 4, indent, signed=False, big_endian=False)
+ maxSamplerAllocationCount = printer.write_int("maxSamplerAllocationCount", 4, indent, signed=False, big_endian=False)
+ bufferImageGranularity = printer.write_int("bufferImageGranularity", 8, indent, signed=False, big_endian=False)
+ sparseAddressSpaceSize = printer.write_int("sparseAddressSpaceSize", 8, indent, signed=False, big_endian=False)
+ maxBoundDescriptorSets = printer.write_int("maxBoundDescriptorSets", 4, indent, signed=False, big_endian=False)
+ maxPerStageDescriptorSamplers = printer.write_int("maxPerStageDescriptorSamplers", 4, indent, signed=False, big_endian=False)
+ maxPerStageDescriptorUniformBuffers = printer.write_int("maxPerStageDescriptorUniformBuffers", 4, indent, signed=False, big_endian=False)
+ maxPerStageDescriptorStorageBuffers = printer.write_int("maxPerStageDescriptorStorageBuffers", 4, indent, signed=False, big_endian=False)
+ maxPerStageDescriptorSampledImages = printer.write_int("maxPerStageDescriptorSampledImages", 4, indent, signed=False, big_endian=False)
+ maxPerStageDescriptorStorageImages = printer.write_int("maxPerStageDescriptorStorageImages", 4, indent, signed=False, big_endian=False)
+ maxPerStageDescriptorInputAttachments = printer.write_int("maxPerStageDescriptorInputAttachments", 4, indent, signed=False, big_endian=False)
+ maxPerStageResources = printer.write_int("maxPerStageResources", 4, indent, signed=False, big_endian=False)
+ maxDescriptorSetSamplers = printer.write_int("maxDescriptorSetSamplers", 4, indent, signed=False, big_endian=False)
+ maxDescriptorSetUniformBuffers = printer.write_int("maxDescriptorSetUniformBuffers", 4, indent, signed=False, big_endian=False)
+ maxDescriptorSetUniformBuffersDynamic = printer.write_int("maxDescriptorSetUniformBuffersDynamic", 4, indent, signed=False, big_endian=False)
+ maxDescriptorSetStorageBuffers = printer.write_int("maxDescriptorSetStorageBuffers", 4, indent, signed=False, big_endian=False)
+ maxDescriptorSetStorageBuffersDynamic = printer.write_int("maxDescriptorSetStorageBuffersDynamic", 4, indent, signed=False, big_endian=False)
+ maxDescriptorSetSampledImages = printer.write_int("maxDescriptorSetSampledImages", 4, indent, signed=False, big_endian=False)
+ maxDescriptorSetStorageImages = printer.write_int("maxDescriptorSetStorageImages", 4, indent, signed=False, big_endian=False)
+ maxDescriptorSetInputAttachments = printer.write_int("maxDescriptorSetInputAttachments", 4, indent, signed=False, big_endian=False)
+ maxVertexInputAttributes = printer.write_int("maxVertexInputAttributes", 4, indent, signed=False, big_endian=False)
+ maxVertexInputBindings = printer.write_int("maxVertexInputBindings", 4, indent, signed=False, big_endian=False)
+ maxVertexInputAttributeOffset = printer.write_int("maxVertexInputAttributeOffset", 4, indent, signed=False, big_endian=False)
+ maxVertexInputBindingStride = printer.write_int("maxVertexInputBindingStride", 4, indent, signed=False, big_endian=False)
+ maxVertexOutputComponents = printer.write_int("maxVertexOutputComponents", 4, indent, signed=False, big_endian=False)
+ maxTessellationGenerationLevel = printer.write_int("maxTessellationGenerationLevel", 4, indent, signed=False, big_endian=False)
+ maxTessellationPatchSize = printer.write_int("maxTessellationPatchSize", 4, indent, signed=False, big_endian=False)
+ maxTessellationControlPerVertexInputComponents = printer.write_int("maxTessellationControlPerVertexInputComponents", 4, indent, signed=False, big_endian=False)
+ maxTessellationControlPerVertexOutputComponents = printer.write_int("maxTessellationControlPerVertexOutputComponents", 4, indent, signed=False, big_endian=False)
+ maxTessellationControlPerPatchOutputComponents = printer.write_int("maxTessellationControlPerPatchOutputComponents", 4, indent, signed=False, big_endian=False)
+ maxTessellationControlTotalOutputComponents = printer.write_int("maxTessellationControlTotalOutputComponents", 4, indent, signed=False, big_endian=False)
+ maxTessellationEvaluationInputComponents = printer.write_int("maxTessellationEvaluationInputComponents", 4, indent, signed=False, big_endian=False)
+ maxTessellationEvaluationOutputComponents = printer.write_int("maxTessellationEvaluationOutputComponents", 4, indent, signed=False, big_endian=False)
+ maxGeometryShaderInvocations = printer.write_int("maxGeometryShaderInvocations", 4, indent, signed=False, big_endian=False)
+ maxGeometryInputComponents = printer.write_int("maxGeometryInputComponents", 4, indent, signed=False, big_endian=False)
+ maxGeometryOutputComponents = printer.write_int("maxGeometryOutputComponents", 4, indent, signed=False, big_endian=False)
+ maxGeometryOutputVertices = printer.write_int("maxGeometryOutputVertices", 4, indent, signed=False, big_endian=False)
+ maxGeometryTotalOutputComponents = printer.write_int("maxGeometryTotalOutputComponents", 4, indent, signed=False, big_endian=False)
+ maxFragmentInputComponents = printer.write_int("maxFragmentInputComponents", 4, indent, signed=False, big_endian=False)
+ maxFragmentOutputAttachments = printer.write_int("maxFragmentOutputAttachments", 4, indent, signed=False, big_endian=False)
+ maxFragmentDualSrcAttachments = printer.write_int("maxFragmentDualSrcAttachments", 4, indent, signed=False, big_endian=False)
+ maxFragmentCombinedOutputResources = printer.write_int("maxFragmentCombinedOutputResources", 4, indent, signed=False, big_endian=False)
+ maxComputeSharedMemorySize = printer.write_int("maxComputeSharedMemorySize", 4, indent, signed=False, big_endian=False)
+ printer.write_int("maxComputeWorkGroupCount", 4, indent, signed=False, count=3)
+ maxComputeWorkGroupInvocations = printer.write_int("maxComputeWorkGroupInvocations", 4, indent, signed=False, big_endian=False)
+ printer.write_int("maxComputeWorkGroupSize", 4, indent, signed=False, count=3)
+ subPixelPrecisionBits = printer.write_int("subPixelPrecisionBits", 4, indent, signed=False, big_endian=False)
+ subTexelPrecisionBits = printer.write_int("subTexelPrecisionBits", 4, indent, signed=False, big_endian=False)
+ mipmapPrecisionBits = printer.write_int("mipmapPrecisionBits", 4, indent, signed=False, big_endian=False)
+ maxDrawIndexedIndexValue = printer.write_int("maxDrawIndexedIndexValue", 4, indent, signed=False, big_endian=False)
+ maxDrawIndirectCount = printer.write_int("maxDrawIndirectCount", 4, indent, signed=False, big_endian=False)
+ printer.write_float("maxSamplerLodBias", indent)
+ printer.write_float("maxSamplerAnisotropy", indent)
+ maxViewports = printer.write_int("maxViewports", 4, indent, signed=False, big_endian=False)
+ printer.write_int("maxViewportDimensions", 4, indent, signed=False, count=2)
+ printer.write_float("viewportBoundsRange", indent, count=2)
+ viewportSubPixelBits = printer.write_int("viewportSubPixelBits", 4, indent, signed=False, big_endian=False)
+ minMemoryMapAlignment = printer.write_int("minMemoryMapAlignment", 8, indent, signed=False, big_endian=True)
+ minTexelBufferOffsetAlignment = printer.write_int("minTexelBufferOffsetAlignment", 8, indent, signed=False, big_endian=False)
+ minUniformBufferOffsetAlignment = printer.write_int("minUniformBufferOffsetAlignment", 8, indent, signed=False, big_endian=False)
+ minStorageBufferOffsetAlignment = printer.write_int("minStorageBufferOffsetAlignment", 8, indent, signed=False, big_endian=False)
+ minTexelOffset = printer.write_int("minTexelOffset", 4, indent, signed=True, big_endian=False)
+ maxTexelOffset = printer.write_int("maxTexelOffset", 4, indent, signed=False, big_endian=False)
+ minTexelGatherOffset = printer.write_int("minTexelGatherOffset", 4, indent, signed=True, big_endian=False)
+ maxTexelGatherOffset = printer.write_int("maxTexelGatherOffset", 4, indent, signed=False, big_endian=False)
+ printer.write_float("minInterpolationOffset", indent)
+ printer.write_float("maxInterpolationOffset", indent)
+ subPixelInterpolationOffsetBits = printer.write_int("subPixelInterpolationOffsetBits", 4, indent, signed=False, big_endian=False)
+ maxFramebufferWidth = printer.write_int("maxFramebufferWidth", 4, indent, signed=False, big_endian=False)
+ maxFramebufferHeight = printer.write_int("maxFramebufferHeight", 4, indent, signed=False, big_endian=False)
+ maxFramebufferLayers = printer.write_int("maxFramebufferLayers", 4, indent, signed=False, big_endian=False)
+ framebufferColorSampleCounts = printer.write_int("framebufferColorSampleCounts", 4, indent, signed=False, big_endian=False)
+ framebufferDepthSampleCounts = printer.write_int("framebufferDepthSampleCounts", 4, indent, signed=False, big_endian=False)
+ framebufferStencilSampleCounts = printer.write_int("framebufferStencilSampleCounts", 4, indent, signed=False, big_endian=False)
+ framebufferNoAttachmentsSampleCounts = printer.write_int("framebufferNoAttachmentsSampleCounts", 4, indent, signed=False, big_endian=False)
+ maxColorAttachments = printer.write_int("maxColorAttachments", 4, indent, signed=False, big_endian=False)
+ sampledImageColorSampleCounts = printer.write_int("sampledImageColorSampleCounts", 4, indent, signed=False, big_endian=False)
+ sampledImageIntegerSampleCounts = printer.write_int("sampledImageIntegerSampleCounts", 4, indent, signed=False, big_endian=False)
+ sampledImageDepthSampleCounts = printer.write_int("sampledImageDepthSampleCounts", 4, indent, signed=False, big_endian=False)
+ sampledImageStencilSampleCounts = printer.write_int("sampledImageStencilSampleCounts", 4, indent, signed=False, big_endian=False)
+ storageImageSampleCounts = printer.write_int("storageImageSampleCounts", 4, indent, signed=False, big_endian=False)
+ maxSampleMaskWords = printer.write_int("maxSampleMaskWords", 4, indent, signed=False, big_endian=False)
+ timestampComputeAndGraphics = printer.write_int("timestampComputeAndGraphics", 4, indent, signed=False, big_endian=False)
+ printer.write_float("timestampPeriod", indent)
+ maxClipDistances = printer.write_int("maxClipDistances", 4, indent, signed=False, big_endian=False)
+ maxCullDistances = printer.write_int("maxCullDistances", 4, indent, signed=False, big_endian=False)
+ maxCombinedClipAndCullDistances = printer.write_int("maxCombinedClipAndCullDistances", 4, indent, signed=False, big_endian=False)
+ discreteQueuePriorities = printer.write_int("discreteQueuePriorities", 4, indent, signed=False, big_endian=False)
+ printer.write_float("pointSizeRange", indent, count=2)
+ printer.write_float("lineWidthRange", indent, count=2)
+ printer.write_float("pointSizeGranularity", indent)
+ printer.write_float("lineWidthGranularity", indent)
+ strictLines = printer.write_int("strictLines", 4, indent, signed=False, big_endian=False)
+ standardSampleLocations = printer.write_int("standardSampleLocations", 4, indent, signed=False, big_endian=False)
+ optimalBufferCopyOffsetAlignment = printer.write_int("optimalBufferCopyOffsetAlignment", 8, indent, signed=False, big_endian=False)
+ optimalBufferCopyRowPitchAlignment = printer.write_int("optimalBufferCopyRowPitchAlignment", 8, indent, signed=False, big_endian=False)
+ nonCoherentAtomSize = printer.write_int("nonCoherentAtomSize", 8, indent, signed=False, big_endian=False)
+
+def struct_VkPhysicalDeviceProperties(printer, indent: int):
+ apiVersion = printer.write_int("apiVersion", 4, indent, signed=False, big_endian=False)
+ driverVersion = printer.write_int("driverVersion", 4, indent, signed=False, big_endian=False)
+ vendorID = printer.write_int("vendorID", 4, indent, signed=False, big_endian=False)
+ deviceID = printer.write_int("deviceID", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("deviceType", VkPhysicalDeviceType, indent)
+ printer.write_string("deviceName", 256, indent)
+ printer.write_int("pipelineCacheUUID", 1, indent, signed=False, count=16)
+ printer.write_struct("limits", struct_VkPhysicalDeviceLimits, False, None, indent)
+ printer.write_struct("sparseProperties", struct_VkPhysicalDeviceSparseProperties, False, None, indent)
+
+def struct_VkPhysicalDeviceProperties2(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2", indent)
+ printer.write_struct("properties", struct_VkPhysicalDeviceProperties, False, None, indent)
+
+def struct_VkPhysicalDeviceSparseProperties(printer, indent: int):
+ residencyStandard2DBlockShape = printer.write_int("residencyStandard2DBlockShape", 4, indent, signed=False, big_endian=False)
+ residencyStandard2DMultisampleBlockShape = printer.write_int("residencyStandard2DMultisampleBlockShape", 4, indent, signed=False, big_endian=False)
+ residencyStandard3DBlockShape = printer.write_int("residencyStandard3DBlockShape", 4, indent, signed=False, big_endian=False)
+ residencyAlignedMipSize = printer.write_int("residencyAlignedMipSize", 4, indent, signed=False, big_endian=False)
+ residencyNonResidentStrict = printer.write_int("residencyNonResidentStrict", 4, indent, signed=False, big_endian=False)
+
+def struct_VkPipelineCacheCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ initialDataSize = printer.write_int("initialDataSize", 8, indent, signed=False, big_endian=True)
+ pInitialData = printer.write_int("pInitialData", 8, indent, optional=False, count=initialDataSize, big_endian=False)
+
+def struct_VkPipelineColorBlendAttachmentState(printer, indent: int):
+ blendEnable = printer.write_int("blendEnable", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("srcColorBlendFactor", VkBlendFactor, indent)
+ printer.write_enum("dstColorBlendFactor", VkBlendFactor, indent)
+ printer.write_enum("colorBlendOp", VkBlendOp, indent)
+ printer.write_enum("srcAlphaBlendFactor", VkBlendFactor, indent)
+ printer.write_enum("dstAlphaBlendFactor", VkBlendFactor, indent)
+ printer.write_enum("alphaBlendOp", VkBlendOp, indent)
+ colorWriteMask = printer.write_int("colorWriteMask", 4, indent, signed=False, big_endian=False)
+
+def struct_VkPipelineColorBlendStateCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ logicOpEnable = printer.write_int("logicOpEnable", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("logicOp", VkLogicOp, indent)
+ attachmentCount = printer.write_int("attachmentCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pAttachments", struct_VkPipelineColorBlendAttachmentState, False, attachmentCount, indent)
+ printer.write_float("blendConstants", indent, count=4)
+
+def struct_VkPipelineDepthStencilStateCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ depthTestEnable = printer.write_int("depthTestEnable", 4, indent, signed=False, big_endian=False)
+ depthWriteEnable = printer.write_int("depthWriteEnable", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("depthCompareOp", VkCompareOp, indent)
+ depthBoundsTestEnable = printer.write_int("depthBoundsTestEnable", 4, indent, signed=False, big_endian=False)
+ stencilTestEnable = printer.write_int("stencilTestEnable", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("front", struct_VkStencilOpState, False, None, indent)
+ printer.write_struct("back", struct_VkStencilOpState, False, None, indent)
+ printer.write_float("minDepthBounds", indent)
+ printer.write_float("maxDepthBounds", indent)
+
+def struct_VkPipelineDynamicStateCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ dynamicStateCount = printer.write_int("dynamicStateCount", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("pDynamicStates", VkDynamicState, indent)
+
+def struct_VkPipelineInputAssemblyStateCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("topology", VkPrimitiveTopology, indent)
+ primitiveRestartEnable = printer.write_int("primitiveRestartEnable", 4, indent, signed=False, big_endian=False)
+
+def struct_VkPipelineMultisampleStateCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("rasterizationSamples", VkSampleCountFlagBits, indent)
+ sampleShadingEnable = printer.write_int("sampleShadingEnable", 4, indent, signed=False, big_endian=False)
+ printer.write_float("minSampleShading", indent)
+ pSampleMask = printer.write_int("pSampleMask", 8, indent, optional=True, count=int(rasterizationSamples / 32), big_endian=False)
+ alphaToCoverageEnable = printer.write_int("alphaToCoverageEnable", 4, indent, signed=False, big_endian=False)
+ alphaToOneEnable = printer.write_int("alphaToOneEnable", 4, indent, signed=False, big_endian=False)
+
+def struct_VkPipelineRasterizationStateCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ depthClampEnable = printer.write_int("depthClampEnable", 4, indent, signed=False, big_endian=False)
+ rasterizerDiscardEnable = printer.write_int("rasterizerDiscardEnable", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("polygonMode", VkPolygonMode, indent)
+ cullMode = printer.write_int("cullMode", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("frontFace", VkFrontFace, indent)
+ depthBiasEnable = printer.write_int("depthBiasEnable", 4, indent, signed=False, big_endian=False)
+ printer.write_float("depthBiasConstantFactor", indent)
+ printer.write_float("depthBiasClamp", indent)
+ printer.write_float("depthBiasSlopeFactor", indent)
+ printer.write_float("lineWidth", indent)
+
+def struct_VkPipelineShaderStageCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("stage", VkShaderStageFlagBits, indent)
+ module = printer.write_int("module", 8, indent, signed=False, big_endian=False)
+ printer.write_string("pName", None, indent)
+ printer.write_struct("pSpecializationInfo", struct_VkSpecializationInfo, True, None, indent)
+
+def struct_VkPipelineTessellationStateCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ patchControlPoints = printer.write_int("patchControlPoints", 4, indent, signed=False, big_endian=False)
+
+def struct_VkPipelineVertexInputStateCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ vertexBindingDescriptionCount = printer.write_int("vertexBindingDescriptionCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pVertexBindingDescriptions", struct_VkVertexInputBindingDescription, False, vertexBindingDescriptionCount, indent)
+ vertexAttributeDescriptionCount = printer.write_int("vertexAttributeDescriptionCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pVertexAttributeDescriptions", struct_VkVertexInputAttributeDescription, False, vertexAttributeDescriptionCount, indent)
+
+def struct_VkPipelineViewportStateCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ viewportCount = printer.write_int("viewportCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pViewports", struct_VkViewport, True, viewportCount, indent)
+ scissorCount = printer.write_int("scissorCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pScissors", struct_VkRect2D, True, scissorCount, indent)
+
+def struct_VkRect2D(printer, indent: int):
+ printer.write_struct("offset", struct_VkOffset2D, False, None, indent)
+ printer.write_struct("extent", struct_VkExtent2D, False, None, indent)
+
+def struct_VkRenderPassBeginInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO", indent)
+ renderPass = printer.write_int("renderPass", 8, indent, signed=False, big_endian=False)
+ framebuffer = printer.write_int("framebuffer", 8, indent, signed=False, big_endian=False)
+ printer.write_struct("renderArea", struct_VkRect2D, False, None, indent)
+ clearValueCount = printer.write_int("clearValueCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pClearValues", struct_VkClearValue, True, clearValueCount, indent)
+
+def struct_VkRenderPassCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ attachmentCount = printer.write_int("attachmentCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pAttachments", struct_VkAttachmentDescription, False, attachmentCount, indent)
+ subpassCount = printer.write_int("subpassCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pSubpasses", struct_VkSubpassDescription, False, subpassCount, indent)
+ dependencyCount = printer.write_int("dependencyCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pDependencies", struct_VkSubpassDependency, False, dependencyCount, indent)
+
+def struct_VkSamplerCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("magFilter", VkFilter, indent)
+ printer.write_enum("minFilter", VkFilter, indent)
+ printer.write_enum("mipmapMode", VkSamplerMipmapMode, indent)
+ printer.write_enum("addressModeU", VkSamplerAddressMode, indent)
+ printer.write_enum("addressModeV", VkSamplerAddressMode, indent)
+ printer.write_enum("addressModeW", VkSamplerAddressMode, indent)
+ printer.write_float("mipLodBias", indent)
+ anisotropyEnable = printer.write_int("anisotropyEnable", 4, indent, signed=False, big_endian=False)
+ printer.write_float("maxAnisotropy", indent)
+ compareEnable = printer.write_int("compareEnable", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("compareOp", VkCompareOp, indent)
+ printer.write_float("minLod", indent)
+ printer.write_float("maxLod", indent)
+ printer.write_enum("borderColor", VkBorderColor, indent)
+ unnormalizedCoordinates = printer.write_int("unnormalizedCoordinates", 4, indent, signed=False, big_endian=False)
+
+def struct_VkSemaphoreCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+
+def struct_VkShaderModuleCreateInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO", indent)
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ codeSize = printer.write_int("codeSize", 8, indent, signed=False, big_endian=True)
+ pCode = printer.write_int("pCode", 4, indent, optional=False, count=int(codeSize / 4), big_endian=False)
+
+def struct_VkSpecializationInfo(printer, indent: int):
+ mapEntryCount = printer.write_int("mapEntryCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pMapEntries", struct_VkSpecializationMapEntry, False, mapEntryCount, indent)
+ dataSize = printer.write_int("dataSize", 8, indent, signed=False, big_endian=True)
+ pData = printer.write_int("pData", 8, indent, optional=False, count=dataSize, big_endian=False)
+
+def struct_VkSpecializationMapEntry(printer, indent: int):
+ constantID = printer.write_int("constantID", 4, indent, signed=False, big_endian=False)
+ offset = printer.write_int("offset", 4, indent, signed=False, big_endian=False)
+ size = printer.write_int("size", 8, indent, signed=False, big_endian=True)
+
+def struct_VkStencilOpState(printer, indent: int):
+ printer.write_enum("failOp", VkStencilOp, indent)
+ printer.write_enum("passOp", VkStencilOp, indent)
+ printer.write_enum("depthFailOp", VkStencilOp, indent)
+ printer.write_enum("compareOp", VkCompareOp, indent)
+ compareMask = printer.write_int("compareMask", 4, indent, signed=False, big_endian=False)
+ writeMask = printer.write_int("writeMask", 4, indent, signed=False, big_endian=False)
+ reference = printer.write_int("reference", 4, indent, signed=False, big_endian=False)
+
+def struct_VkSubmitInfo(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_SUBMIT_INFO", indent)
+ waitSemaphoreCount = printer.write_int("waitSemaphoreCount", 4, indent, signed=False, big_endian=False)
+ pWaitSemaphores = printer.write_int("pWaitSemaphores", 8, indent, optional=False, count=waitSemaphoreCount, big_endian=False)
+ pWaitDstStageMask = printer.write_int("pWaitDstStageMask", 4, indent, optional=False, count=waitSemaphoreCount, big_endian=False)
+ commandBufferCount = printer.write_int("commandBufferCount", 4, indent, signed=False, big_endian=False)
+ pCommandBuffers = printer.write_int("pCommandBuffers", 8, indent, optional=False, count=commandBufferCount, big_endian=False)
+ signalSemaphoreCount = printer.write_int("signalSemaphoreCount", 4, indent, signed=False, big_endian=False)
+ pSignalSemaphores = printer.write_int("pSignalSemaphores", 8, indent, optional=False, count=signalSemaphoreCount, big_endian=False)
+
+def struct_VkSubpassDependency(printer, indent: int):
+ srcSubpass = printer.write_int("srcSubpass", 4, indent, signed=False, big_endian=False)
+ dstSubpass = printer.write_int("dstSubpass", 4, indent, signed=False, big_endian=False)
+ srcStageMask = printer.write_int("srcStageMask", 4, indent, signed=False, big_endian=False)
+ dstStageMask = printer.write_int("dstStageMask", 4, indent, signed=False, big_endian=False)
+ srcAccessMask = printer.write_int("srcAccessMask", 4, indent, signed=False, big_endian=False)
+ dstAccessMask = printer.write_int("dstAccessMask", 4, indent, signed=False, big_endian=False)
+ dependencyFlags = printer.write_int("dependencyFlags", 4, indent, signed=False, big_endian=False)
+
+def struct_VkSubpassDescription(printer, indent: int):
+ flags = printer.write_int("flags", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("pipelineBindPoint", VkPipelineBindPoint, indent)
+ inputAttachmentCount = printer.write_int("inputAttachmentCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pInputAttachments", struct_VkAttachmentReference, False, inputAttachmentCount, indent)
+ colorAttachmentCount = printer.write_int("colorAttachmentCount", 4, indent, signed=False, big_endian=False)
+ printer.write_struct("pColorAttachments", struct_VkAttachmentReference, False, colorAttachmentCount, indent)
+ printer.write_struct("pResolveAttachments", struct_VkAttachmentReference, True, colorAttachmentCount, indent)
+ printer.write_struct("pDepthStencilAttachment", struct_VkAttachmentReference, True, None, indent)
+ preserveAttachmentCount = printer.write_int("preserveAttachmentCount", 4, indent, signed=False, big_endian=False)
+ pPreserveAttachments = printer.write_int("pPreserveAttachments", 4, indent, optional=False, count=preserveAttachmentCount, big_endian=False)
+
+def struct_VkVertexInputAttributeDescription(printer, indent: int):
+ location = printer.write_int("location", 4, indent, signed=False, big_endian=False)
+ binding = printer.write_int("binding", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("format", VkFormat, indent)
+ offset = printer.write_int("offset", 4, indent, signed=False, big_endian=False)
+
+def struct_VkVertexInputBindingDescription(printer, indent: int):
+ binding = printer.write_int("binding", 4, indent, signed=False, big_endian=False)
+ stride = printer.write_int("stride", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("inputRate", VkVertexInputRate, indent)
+
+def struct_VkViewport(printer, indent: int):
+ printer.write_float("x", indent)
+ printer.write_float("y", indent)
+ printer.write_float("width", indent)
+ printer.write_float("height", indent)
+ printer.write_float("minDepth", indent)
+ printer.write_float("maxDepth", indent)
+
+def struct_VkWriteDescriptorSet(printer, indent: int):
+ printer.write_stype_and_pnext("VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET", indent)
+ dstSet = printer.write_int("dstSet", 8, indent, signed=False, big_endian=False)
+ dstBinding = printer.write_int("dstBinding", 4, indent, signed=False, big_endian=False)
+ dstArrayElement = printer.write_int("dstArrayElement", 4, indent, signed=False, big_endian=False)
+ descriptorCount = printer.write_int("descriptorCount", 4, indent, signed=False, big_endian=False)
+ printer.write_enum("descriptorType", VkDescriptorType, indent)
+ printer.write_struct("pImageInfo", struct_VkDescriptorImageInfo, True, descriptorCount, indent)
+ printer.write_struct("pBufferInfo", struct_VkDescriptorBufferInfo, True, descriptorCount, indent)
+ pTexelBufferView = printer.write_int("pTexelBufferView", 8, indent, optional=True, count=descriptorCount, big_endian=False)
+
+VkAttachmentLoadOp = {
+ 0: "VK_ATTACHMENT_LOAD_OP_LOAD",
+ 1: "VK_ATTACHMENT_LOAD_OP_CLEAR",
+ 2: "VK_ATTACHMENT_LOAD_OP_DONT_CARE",
+ 1000400000: "VK_ATTACHMENT_LOAD_OP_NONE_EXT",
+}
+
+VkAttachmentStoreOp = {
+ 0: "VK_ATTACHMENT_STORE_OP_STORE",
+ 1: "VK_ATTACHMENT_STORE_OP_DONT_CARE",
+ 1000301000: "VK_ATTACHMENT_STORE_OP_NONE",
+}
+
+VkBlendFactor = {
+ 0: "VK_BLEND_FACTOR_ZERO",
+ 1: "VK_BLEND_FACTOR_ONE",
+ 2: "VK_BLEND_FACTOR_SRC_COLOR",
+ 3: "VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR",
+ 4: "VK_BLEND_FACTOR_DST_COLOR",
+ 5: "VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR",
+ 6: "VK_BLEND_FACTOR_SRC_ALPHA",
+ 7: "VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA",
+ 8: "VK_BLEND_FACTOR_DST_ALPHA",
+ 9: "VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA",
+ 10: "VK_BLEND_FACTOR_CONSTANT_COLOR",
+ 11: "VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR",
+ 12: "VK_BLEND_FACTOR_CONSTANT_ALPHA",
+ 13: "VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA",
+ 14: "VK_BLEND_FACTOR_SRC_ALPHA_SATURATE",
+ 15: "VK_BLEND_FACTOR_SRC1_COLOR",
+ 16: "VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR",
+ 17: "VK_BLEND_FACTOR_SRC1_ALPHA",
+ 18: "VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA",
+}
+
+VkBlendOp = {
+ 0: "VK_BLEND_OP_ADD",
+ 1: "VK_BLEND_OP_SUBTRACT",
+ 2: "VK_BLEND_OP_REVERSE_SUBTRACT",
+ 3: "VK_BLEND_OP_MIN",
+ 4: "VK_BLEND_OP_MAX",
+ 1000148000: "VK_BLEND_OP_ZERO_EXT",
+ 1000148001: "VK_BLEND_OP_SRC_EXT",
+ 1000148002: "VK_BLEND_OP_DST_EXT",
+ 1000148003: "VK_BLEND_OP_SRC_OVER_EXT",
+ 1000148004: "VK_BLEND_OP_DST_OVER_EXT",
+ 1000148005: "VK_BLEND_OP_SRC_IN_EXT",
+ 1000148006: "VK_BLEND_OP_DST_IN_EXT",
+ 1000148007: "VK_BLEND_OP_SRC_OUT_EXT",
+ 1000148008: "VK_BLEND_OP_DST_OUT_EXT",
+ 1000148009: "VK_BLEND_OP_SRC_ATOP_EXT",
+ 1000148010: "VK_BLEND_OP_DST_ATOP_EXT",
+ 1000148011: "VK_BLEND_OP_XOR_EXT",
+ 1000148012: "VK_BLEND_OP_MULTIPLY_EXT",
+ 1000148013: "VK_BLEND_OP_SCREEN_EXT",
+ 1000148014: "VK_BLEND_OP_OVERLAY_EXT",
+ 1000148015: "VK_BLEND_OP_DARKEN_EXT",
+ 1000148016: "VK_BLEND_OP_LIGHTEN_EXT",
+ 1000148017: "VK_BLEND_OP_COLORDODGE_EXT",
+ 1000148018: "VK_BLEND_OP_COLORBURN_EXT",
+ 1000148019: "VK_BLEND_OP_HARDLIGHT_EXT",
+ 1000148020: "VK_BLEND_OP_SOFTLIGHT_EXT",
+ 1000148021: "VK_BLEND_OP_DIFFERENCE_EXT",
+ 1000148022: "VK_BLEND_OP_EXCLUSION_EXT",
+ 1000148023: "VK_BLEND_OP_INVERT_EXT",
+ 1000148024: "VK_BLEND_OP_INVERT_RGB_EXT",
+ 1000148025: "VK_BLEND_OP_LINEARDODGE_EXT",
+ 1000148026: "VK_BLEND_OP_LINEARBURN_EXT",
+ 1000148027: "VK_BLEND_OP_VIVIDLIGHT_EXT",
+ 1000148028: "VK_BLEND_OP_LINEARLIGHT_EXT",
+ 1000148029: "VK_BLEND_OP_PINLIGHT_EXT",
+ 1000148030: "VK_BLEND_OP_HARDMIX_EXT",
+ 1000148031: "VK_BLEND_OP_HSL_HUE_EXT",
+ 1000148032: "VK_BLEND_OP_HSL_SATURATION_EXT",
+ 1000148033: "VK_BLEND_OP_HSL_COLOR_EXT",
+ 1000148034: "VK_BLEND_OP_HSL_LUMINOSITY_EXT",
+ 1000148035: "VK_BLEND_OP_PLUS_EXT",
+ 1000148036: "VK_BLEND_OP_PLUS_CLAMPED_EXT",
+ 1000148037: "VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT",
+ 1000148038: "VK_BLEND_OP_PLUS_DARKER_EXT",
+ 1000148039: "VK_BLEND_OP_MINUS_EXT",
+ 1000148040: "VK_BLEND_OP_MINUS_CLAMPED_EXT",
+ 1000148041: "VK_BLEND_OP_CONTRAST_EXT",
+ 1000148042: "VK_BLEND_OP_INVERT_OVG_EXT",
+ 1000148043: "VK_BLEND_OP_RED_EXT",
+ 1000148044: "VK_BLEND_OP_GREEN_EXT",
+ 1000148045: "VK_BLEND_OP_BLUE_EXT",
+}
+
+VkBorderColor = {
+ 0: "VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK",
+ 1: "VK_BORDER_COLOR_INT_TRANSPARENT_BLACK",
+ 2: "VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK",
+ 3: "VK_BORDER_COLOR_INT_OPAQUE_BLACK",
+ 4: "VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE",
+ 5: "VK_BORDER_COLOR_INT_OPAQUE_WHITE",
+ 1000287003: "VK_BORDER_COLOR_FLOAT_CUSTOM_EXT",
+ 1000287004: "VK_BORDER_COLOR_INT_CUSTOM_EXT",
+}
+
+VkCompareOp = {
+ 0: "VK_COMPARE_OP_NEVER",
+ 1: "VK_COMPARE_OP_LESS",
+ 2: "VK_COMPARE_OP_EQUAL",
+ 3: "VK_COMPARE_OP_LESS_OR_EQUAL",
+ 4: "VK_COMPARE_OP_GREATER",
+ 5: "VK_COMPARE_OP_NOT_EQUAL",
+ 6: "VK_COMPARE_OP_GREATER_OR_EQUAL",
+ 7: "VK_COMPARE_OP_ALWAYS",
+}
+
+VkComponentSwizzle = {
+ 0: "VK_COMPONENT_SWIZZLE_IDENTITY",
+ 1: "VK_COMPONENT_SWIZZLE_ZERO",
+ 2: "VK_COMPONENT_SWIZZLE_ONE",
+ 3: "VK_COMPONENT_SWIZZLE_R",
+ 4: "VK_COMPONENT_SWIZZLE_G",
+ 5: "VK_COMPONENT_SWIZZLE_B",
+ 6: "VK_COMPONENT_SWIZZLE_A",
+}
+
+VkDescriptorType = {
+ 0: "VK_DESCRIPTOR_TYPE_SAMPLER",
+ 1: "VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER",
+ 2: "VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE",
+ 3: "VK_DESCRIPTOR_TYPE_STORAGE_IMAGE",
+ 4: "VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER",
+ 5: "VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER",
+ 6: "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER",
+ 7: "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER",
+ 8: "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC",
+ 9: "VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC",
+ 10: "VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT",
+ 1000138000: "VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK",
+ 1000150000: "VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR",
+ 1000165000: "VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV",
+ 1000440000: "VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM",
+ 1000440001: "VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM",
+ 1000351000: "VK_DESCRIPTOR_TYPE_MUTABLE_EXT",
+}
+
+VkDynamicState = {
+ 0: "VK_DYNAMIC_STATE_VIEWPORT",
+ 1: "VK_DYNAMIC_STATE_SCISSOR",
+ 2: "VK_DYNAMIC_STATE_LINE_WIDTH",
+ 3: "VK_DYNAMIC_STATE_DEPTH_BIAS",
+ 4: "VK_DYNAMIC_STATE_BLEND_CONSTANTS",
+ 5: "VK_DYNAMIC_STATE_DEPTH_BOUNDS",
+ 6: "VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK",
+ 7: "VK_DYNAMIC_STATE_STENCIL_WRITE_MASK",
+ 8: "VK_DYNAMIC_STATE_STENCIL_REFERENCE",
+ 1000267000: "VK_DYNAMIC_STATE_CULL_MODE",
+ 1000267001: "VK_DYNAMIC_STATE_FRONT_FACE",
+ 1000267002: "VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY",
+ 1000267003: "VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT",
+ 1000267004: "VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT",
+ 1000267005: "VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE",
+ 1000267006: "VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE",
+ 1000267007: "VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE",
+ 1000267008: "VK_DYNAMIC_STATE_DEPTH_COMPARE_OP",
+ 1000267009: "VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE",
+ 1000267010: "VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE",
+ 1000267011: "VK_DYNAMIC_STATE_STENCIL_OP",
+ 1000377001: "VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE",
+ 1000377002: "VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE",
+ 1000377004: "VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE",
+ 1000087000: "VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV",
+ 1000099000: "VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT",
+ 1000099001: "VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT",
+ 1000099002: "VK_DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT",
+ 1000143000: "VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT",
+ 1000347000: "VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR",
+ 1000164004: "VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV",
+ 1000164006: "VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV",
+ 1000205000: "VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV",
+ 1000205001: "VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV",
+ 1000226000: "VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR",
+ 1000259000: "VK_DYNAMIC_STATE_LINE_STIPPLE_EXT",
+ 1000352000: "VK_DYNAMIC_STATE_VERTEX_INPUT_EXT",
+ 1000377000: "VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT",
+ 1000377003: "VK_DYNAMIC_STATE_LOGIC_OP_EXT",
+ 1000381000: "VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT",
+ 1000455002: "VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT",
+ 1000455003: "VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT",
+ 1000455004: "VK_DYNAMIC_STATE_POLYGON_MODE_EXT",
+ 1000455005: "VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT",
+ 1000455006: "VK_DYNAMIC_STATE_SAMPLE_MASK_EXT",
+ 1000455007: "VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT",
+ 1000455008: "VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT",
+ 1000455009: "VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT",
+ 1000455010: "VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT",
+ 1000455011: "VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT",
+ 1000455012: "VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT",
+ 1000455013: "VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT",
+ 1000455014: "VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT",
+ 1000455015: "VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT",
+ 1000455016: "VK_DYNAMIC_STATE_DEPTH_CLIP_ENABLE_EXT",
+ 1000455017: "VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT",
+ 1000455018: "VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT",
+ 1000455019: "VK_DYNAMIC_STATE_PROVOKING_VERTEX_MODE_EXT",
+ 1000455020: "VK_DYNAMIC_STATE_LINE_RASTERIZATION_MODE_EXT",
+ 1000455021: "VK_DYNAMIC_STATE_LINE_STIPPLE_ENABLE_EXT",
+ 1000455022: "VK_DYNAMIC_STATE_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE_EXT",
+ 1000455023: "VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV",
+ 1000455024: "VK_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV",
+ 1000455025: "VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV",
+ 1000455026: "VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV",
+ 1000455027: "VK_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV",
+ 1000455028: "VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_ENABLE_NV",
+ 1000455029: "VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_NV",
+ 1000455030: "VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV",
+ 1000455031: "VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV",
+ 1000455032: "VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV",
+ 1000524000: "VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT",
+}
+
+VkFilter = {
+ 0: "VK_FILTER_NEAREST",
+ 1: "VK_FILTER_LINEAR",
+ 1000015000: "VK_FILTER_CUBIC_EXT",
+}
+
+VkFormat = {
+ 0: "VK_FORMAT_UNDEFINED",
+ 1: "VK_FORMAT_R4G4_UNORM_PACK8",
+ 2: "VK_FORMAT_R4G4B4A4_UNORM_PACK16",
+ 3: "VK_FORMAT_B4G4R4A4_UNORM_PACK16",
+ 4: "VK_FORMAT_R5G6B5_UNORM_PACK16",
+ 5: "VK_FORMAT_B5G6R5_UNORM_PACK16",
+ 6: "VK_FORMAT_R5G5B5A1_UNORM_PACK16",
+ 7: "VK_FORMAT_B5G5R5A1_UNORM_PACK16",
+ 8: "VK_FORMAT_A1R5G5B5_UNORM_PACK16",
+ 9: "VK_FORMAT_R8_UNORM",
+ 10: "VK_FORMAT_R8_SNORM",
+ 11: "VK_FORMAT_R8_USCALED",
+ 12: "VK_FORMAT_R8_SSCALED",
+ 13: "VK_FORMAT_R8_UINT",
+ 14: "VK_FORMAT_R8_SINT",
+ 15: "VK_FORMAT_R8_SRGB",
+ 16: "VK_FORMAT_R8G8_UNORM",
+ 17: "VK_FORMAT_R8G8_SNORM",
+ 18: "VK_FORMAT_R8G8_USCALED",
+ 19: "VK_FORMAT_R8G8_SSCALED",
+ 20: "VK_FORMAT_R8G8_UINT",
+ 21: "VK_FORMAT_R8G8_SINT",
+ 22: "VK_FORMAT_R8G8_SRGB",
+ 23: "VK_FORMAT_R8G8B8_UNORM",
+ 24: "VK_FORMAT_R8G8B8_SNORM",
+ 25: "VK_FORMAT_R8G8B8_USCALED",
+ 26: "VK_FORMAT_R8G8B8_SSCALED",
+ 27: "VK_FORMAT_R8G8B8_UINT",
+ 28: "VK_FORMAT_R8G8B8_SINT",
+ 29: "VK_FORMAT_R8G8B8_SRGB",
+ 30: "VK_FORMAT_B8G8R8_UNORM",
+ 31: "VK_FORMAT_B8G8R8_SNORM",
+ 32: "VK_FORMAT_B8G8R8_USCALED",
+ 33: "VK_FORMAT_B8G8R8_SSCALED",
+ 34: "VK_FORMAT_B8G8R8_UINT",
+ 35: "VK_FORMAT_B8G8R8_SINT",
+ 36: "VK_FORMAT_B8G8R8_SRGB",
+ 37: "VK_FORMAT_R8G8B8A8_UNORM",
+ 38: "VK_FORMAT_R8G8B8A8_SNORM",
+ 39: "VK_FORMAT_R8G8B8A8_USCALED",
+ 40: "VK_FORMAT_R8G8B8A8_SSCALED",
+ 41: "VK_FORMAT_R8G8B8A8_UINT",
+ 42: "VK_FORMAT_R8G8B8A8_SINT",
+ 43: "VK_FORMAT_R8G8B8A8_SRGB",
+ 44: "VK_FORMAT_B8G8R8A8_UNORM",
+ 45: "VK_FORMAT_B8G8R8A8_SNORM",
+ 46: "VK_FORMAT_B8G8R8A8_USCALED",
+ 47: "VK_FORMAT_B8G8R8A8_SSCALED",
+ 48: "VK_FORMAT_B8G8R8A8_UINT",
+ 49: "VK_FORMAT_B8G8R8A8_SINT",
+ 50: "VK_FORMAT_B8G8R8A8_SRGB",
+ 51: "VK_FORMAT_A8B8G8R8_UNORM_PACK32",
+ 52: "VK_FORMAT_A8B8G8R8_SNORM_PACK32",
+ 53: "VK_FORMAT_A8B8G8R8_USCALED_PACK32",
+ 54: "VK_FORMAT_A8B8G8R8_SSCALED_PACK32",
+ 55: "VK_FORMAT_A8B8G8R8_UINT_PACK32",
+ 56: "VK_FORMAT_A8B8G8R8_SINT_PACK32",
+ 57: "VK_FORMAT_A8B8G8R8_SRGB_PACK32",
+ 58: "VK_FORMAT_A2R10G10B10_UNORM_PACK32",
+ 59: "VK_FORMAT_A2R10G10B10_SNORM_PACK32",
+ 60: "VK_FORMAT_A2R10G10B10_USCALED_PACK32",
+ 61: "VK_FORMAT_A2R10G10B10_SSCALED_PACK32",
+ 62: "VK_FORMAT_A2R10G10B10_UINT_PACK32",
+ 63: "VK_FORMAT_A2R10G10B10_SINT_PACK32",
+ 64: "VK_FORMAT_A2B10G10R10_UNORM_PACK32",
+ 65: "VK_FORMAT_A2B10G10R10_SNORM_PACK32",
+ 66: "VK_FORMAT_A2B10G10R10_USCALED_PACK32",
+ 67: "VK_FORMAT_A2B10G10R10_SSCALED_PACK32",
+ 68: "VK_FORMAT_A2B10G10R10_UINT_PACK32",
+ 69: "VK_FORMAT_A2B10G10R10_SINT_PACK32",
+ 70: "VK_FORMAT_R16_UNORM",
+ 71: "VK_FORMAT_R16_SNORM",
+ 72: "VK_FORMAT_R16_USCALED",
+ 73: "VK_FORMAT_R16_SSCALED",
+ 74: "VK_FORMAT_R16_UINT",
+ 75: "VK_FORMAT_R16_SINT",
+ 76: "VK_FORMAT_R16_SFLOAT",
+ 77: "VK_FORMAT_R16G16_UNORM",
+ 78: "VK_FORMAT_R16G16_SNORM",
+ 79: "VK_FORMAT_R16G16_USCALED",
+ 80: "VK_FORMAT_R16G16_SSCALED",
+ 81: "VK_FORMAT_R16G16_UINT",
+ 82: "VK_FORMAT_R16G16_SINT",
+ 83: "VK_FORMAT_R16G16_SFLOAT",
+ 84: "VK_FORMAT_R16G16B16_UNORM",
+ 85: "VK_FORMAT_R16G16B16_SNORM",
+ 86: "VK_FORMAT_R16G16B16_USCALED",
+ 87: "VK_FORMAT_R16G16B16_SSCALED",
+ 88: "VK_FORMAT_R16G16B16_UINT",
+ 89: "VK_FORMAT_R16G16B16_SINT",
+ 90: "VK_FORMAT_R16G16B16_SFLOAT",
+ 91: "VK_FORMAT_R16G16B16A16_UNORM",
+ 92: "VK_FORMAT_R16G16B16A16_SNORM",
+ 93: "VK_FORMAT_R16G16B16A16_USCALED",
+ 94: "VK_FORMAT_R16G16B16A16_SSCALED",
+ 95: "VK_FORMAT_R16G16B16A16_UINT",
+ 96: "VK_FORMAT_R16G16B16A16_SINT",
+ 97: "VK_FORMAT_R16G16B16A16_SFLOAT",
+ 98: "VK_FORMAT_R32_UINT",
+ 99: "VK_FORMAT_R32_SINT",
+ 100: "VK_FORMAT_R32_SFLOAT",
+ 101: "VK_FORMAT_R32G32_UINT",
+ 102: "VK_FORMAT_R32G32_SINT",
+ 103: "VK_FORMAT_R32G32_SFLOAT",
+ 104: "VK_FORMAT_R32G32B32_UINT",
+ 105: "VK_FORMAT_R32G32B32_SINT",
+ 106: "VK_FORMAT_R32G32B32_SFLOAT",
+ 107: "VK_FORMAT_R32G32B32A32_UINT",
+ 108: "VK_FORMAT_R32G32B32A32_SINT",
+ 109: "VK_FORMAT_R32G32B32A32_SFLOAT",
+ 110: "VK_FORMAT_R64_UINT",
+ 111: "VK_FORMAT_R64_SINT",
+ 112: "VK_FORMAT_R64_SFLOAT",
+ 113: "VK_FORMAT_R64G64_UINT",
+ 114: "VK_FORMAT_R64G64_SINT",
+ 115: "VK_FORMAT_R64G64_SFLOAT",
+ 116: "VK_FORMAT_R64G64B64_UINT",
+ 117: "VK_FORMAT_R64G64B64_SINT",
+ 118: "VK_FORMAT_R64G64B64_SFLOAT",
+ 119: "VK_FORMAT_R64G64B64A64_UINT",
+ 120: "VK_FORMAT_R64G64B64A64_SINT",
+ 121: "VK_FORMAT_R64G64B64A64_SFLOAT",
+ 122: "VK_FORMAT_B10G11R11_UFLOAT_PACK32",
+ 123: "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32",
+ 124: "VK_FORMAT_D16_UNORM",
+ 125: "VK_FORMAT_X8_D24_UNORM_PACK32",
+ 126: "VK_FORMAT_D32_SFLOAT",
+ 127: "VK_FORMAT_S8_UINT",
+ 128: "VK_FORMAT_D16_UNORM_S8_UINT",
+ 129: "VK_FORMAT_D24_UNORM_S8_UINT",
+ 130: "VK_FORMAT_D32_SFLOAT_S8_UINT",
+ 131: "VK_FORMAT_BC1_RGB_UNORM_BLOCK",
+ 132: "VK_FORMAT_BC1_RGB_SRGB_BLOCK",
+ 133: "VK_FORMAT_BC1_RGBA_UNORM_BLOCK",
+ 134: "VK_FORMAT_BC1_RGBA_SRGB_BLOCK",
+ 135: "VK_FORMAT_BC2_UNORM_BLOCK",
+ 136: "VK_FORMAT_BC2_SRGB_BLOCK",
+ 137: "VK_FORMAT_BC3_UNORM_BLOCK",
+ 138: "VK_FORMAT_BC3_SRGB_BLOCK",
+ 139: "VK_FORMAT_BC4_UNORM_BLOCK",
+ 140: "VK_FORMAT_BC4_SNORM_BLOCK",
+ 141: "VK_FORMAT_BC5_UNORM_BLOCK",
+ 142: "VK_FORMAT_BC5_SNORM_BLOCK",
+ 143: "VK_FORMAT_BC6H_UFLOAT_BLOCK",
+ 144: "VK_FORMAT_BC6H_SFLOAT_BLOCK",
+ 145: "VK_FORMAT_BC7_UNORM_BLOCK",
+ 146: "VK_FORMAT_BC7_SRGB_BLOCK",
+ 147: "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK",
+ 148: "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK",
+ 149: "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK",
+ 150: "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK",
+ 151: "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK",
+ 152: "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK",
+ 153: "VK_FORMAT_EAC_R11_UNORM_BLOCK",
+ 154: "VK_FORMAT_EAC_R11_SNORM_BLOCK",
+ 155: "VK_FORMAT_EAC_R11G11_UNORM_BLOCK",
+ 156: "VK_FORMAT_EAC_R11G11_SNORM_BLOCK",
+ 157: "VK_FORMAT_ASTC_4x4_UNORM_BLOCK",
+ 158: "VK_FORMAT_ASTC_4x4_SRGB_BLOCK",
+ 159: "VK_FORMAT_ASTC_5x4_UNORM_BLOCK",
+ 160: "VK_FORMAT_ASTC_5x4_SRGB_BLOCK",
+ 161: "VK_FORMAT_ASTC_5x5_UNORM_BLOCK",
+ 162: "VK_FORMAT_ASTC_5x5_SRGB_BLOCK",
+ 163: "VK_FORMAT_ASTC_6x5_UNORM_BLOCK",
+ 164: "VK_FORMAT_ASTC_6x5_SRGB_BLOCK",
+ 165: "VK_FORMAT_ASTC_6x6_UNORM_BLOCK",
+ 166: "VK_FORMAT_ASTC_6x6_SRGB_BLOCK",
+ 167: "VK_FORMAT_ASTC_8x5_UNORM_BLOCK",
+ 168: "VK_FORMAT_ASTC_8x5_SRGB_BLOCK",
+ 169: "VK_FORMAT_ASTC_8x6_UNORM_BLOCK",
+ 170: "VK_FORMAT_ASTC_8x6_SRGB_BLOCK",
+ 171: "VK_FORMAT_ASTC_8x8_UNORM_BLOCK",
+ 172: "VK_FORMAT_ASTC_8x8_SRGB_BLOCK",
+ 173: "VK_FORMAT_ASTC_10x5_UNORM_BLOCK",
+ 174: "VK_FORMAT_ASTC_10x5_SRGB_BLOCK",
+ 175: "VK_FORMAT_ASTC_10x6_UNORM_BLOCK",
+ 176: "VK_FORMAT_ASTC_10x6_SRGB_BLOCK",
+ 177: "VK_FORMAT_ASTC_10x8_UNORM_BLOCK",
+ 178: "VK_FORMAT_ASTC_10x8_SRGB_BLOCK",
+ 179: "VK_FORMAT_ASTC_10x10_UNORM_BLOCK",
+ 180: "VK_FORMAT_ASTC_10x10_SRGB_BLOCK",
+ 181: "VK_FORMAT_ASTC_12x10_UNORM_BLOCK",
+ 182: "VK_FORMAT_ASTC_12x10_SRGB_BLOCK",
+ 183: "VK_FORMAT_ASTC_12x12_UNORM_BLOCK",
+ 184: "VK_FORMAT_ASTC_12x12_SRGB_BLOCK",
+ 1000156000: "VK_FORMAT_G8B8G8R8_422_UNORM",
+ 1000156001: "VK_FORMAT_B8G8R8G8_422_UNORM",
+ 1000156002: "VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM",
+ 1000156003: "VK_FORMAT_G8_B8R8_2PLANE_420_UNORM",
+ 1000156004: "VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM",
+ 1000156005: "VK_FORMAT_G8_B8R8_2PLANE_422_UNORM",
+ 1000156006: "VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM",
+ 1000156007: "VK_FORMAT_R10X6_UNORM_PACK16",
+ 1000156008: "VK_FORMAT_R10X6G10X6_UNORM_2PACK16",
+ 1000156009: "VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16",
+ 1000156010: "VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16",
+ 1000156011: "VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16",
+ 1000156012: "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16",
+ 1000156013: "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16",
+ 1000156014: "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16",
+ 1000156015: "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16",
+ 1000156016: "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16",
+ 1000156017: "VK_FORMAT_R12X4_UNORM_PACK16",
+ 1000156018: "VK_FORMAT_R12X4G12X4_UNORM_2PACK16",
+ 1000156019: "VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16",
+ 1000156020: "VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16",
+ 1000156021: "VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16",
+ 1000156022: "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16",
+ 1000156023: "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16",
+ 1000156024: "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16",
+ 1000156025: "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16",
+ 1000156026: "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16",
+ 1000156027: "VK_FORMAT_G16B16G16R16_422_UNORM",
+ 1000156028: "VK_FORMAT_B16G16R16G16_422_UNORM",
+ 1000156029: "VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM",
+ 1000156030: "VK_FORMAT_G16_B16R16_2PLANE_420_UNORM",
+ 1000156031: "VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM",
+ 1000156032: "VK_FORMAT_G16_B16R16_2PLANE_422_UNORM",
+ 1000156033: "VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM",
+ 1000330000: "VK_FORMAT_G8_B8R8_2PLANE_444_UNORM",
+ 1000330001: "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16",
+ 1000330002: "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16",
+ 1000330003: "VK_FORMAT_G16_B16R16_2PLANE_444_UNORM",
+ 1000340000: "VK_FORMAT_A4R4G4B4_UNORM_PACK16",
+ 1000340001: "VK_FORMAT_A4B4G4R4_UNORM_PACK16",
+ 1000066000: "VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK",
+ 1000066001: "VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK",
+ 1000066002: "VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK",
+ 1000066003: "VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK",
+ 1000066004: "VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK",
+ 1000066005: "VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK",
+ 1000066006: "VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK",
+ 1000066007: "VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK",
+ 1000066008: "VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK",
+ 1000066009: "VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK",
+ 1000066010: "VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK",
+ 1000066011: "VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK",
+ 1000066012: "VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK",
+ 1000066013: "VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK",
+ 1000054000: "VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG",
+ 1000054001: "VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG",
+ 1000054002: "VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG",
+ 1000054003: "VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG",
+ 1000054004: "VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG",
+ 1000054005: "VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG",
+ 1000054006: "VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG",
+ 1000054007: "VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG",
+ 1000288000: "VK_FORMAT_ASTC_3x3x3_UNORM_BLOCK_EXT",
+ 1000288001: "VK_FORMAT_ASTC_3x3x3_SRGB_BLOCK_EXT",
+ 1000288002: "VK_FORMAT_ASTC_3x3x3_SFLOAT_BLOCK_EXT",
+ 1000288003: "VK_FORMAT_ASTC_4x3x3_UNORM_BLOCK_EXT",
+ 1000288004: "VK_FORMAT_ASTC_4x3x3_SRGB_BLOCK_EXT",
+ 1000288005: "VK_FORMAT_ASTC_4x3x3_SFLOAT_BLOCK_EXT",
+ 1000288006: "VK_FORMAT_ASTC_4x4x3_UNORM_BLOCK_EXT",
+ 1000288007: "VK_FORMAT_ASTC_4x4x3_SRGB_BLOCK_EXT",
+ 1000288008: "VK_FORMAT_ASTC_4x4x3_SFLOAT_BLOCK_EXT",
+ 1000288009: "VK_FORMAT_ASTC_4x4x4_UNORM_BLOCK_EXT",
+ 1000288010: "VK_FORMAT_ASTC_4x4x4_SRGB_BLOCK_EXT",
+ 1000288011: "VK_FORMAT_ASTC_4x4x4_SFLOAT_BLOCK_EXT",
+ 1000288012: "VK_FORMAT_ASTC_5x4x4_UNORM_BLOCK_EXT",
+ 1000288013: "VK_FORMAT_ASTC_5x4x4_SRGB_BLOCK_EXT",
+ 1000288014: "VK_FORMAT_ASTC_5x4x4_SFLOAT_BLOCK_EXT",
+ 1000288015: "VK_FORMAT_ASTC_5x5x4_UNORM_BLOCK_EXT",
+ 1000288016: "VK_FORMAT_ASTC_5x5x4_SRGB_BLOCK_EXT",
+ 1000288017: "VK_FORMAT_ASTC_5x5x4_SFLOAT_BLOCK_EXT",
+ 1000288018: "VK_FORMAT_ASTC_5x5x5_UNORM_BLOCK_EXT",
+ 1000288019: "VK_FORMAT_ASTC_5x5x5_SRGB_BLOCK_EXT",
+ 1000288020: "VK_FORMAT_ASTC_5x5x5_SFLOAT_BLOCK_EXT",
+ 1000288021: "VK_FORMAT_ASTC_6x5x5_UNORM_BLOCK_EXT",
+ 1000288022: "VK_FORMAT_ASTC_6x5x5_SRGB_BLOCK_EXT",
+ 1000288023: "VK_FORMAT_ASTC_6x5x5_SFLOAT_BLOCK_EXT",
+ 1000288024: "VK_FORMAT_ASTC_6x6x5_UNORM_BLOCK_EXT",
+ 1000288025: "VK_FORMAT_ASTC_6x6x5_SRGB_BLOCK_EXT",
+ 1000288026: "VK_FORMAT_ASTC_6x6x5_SFLOAT_BLOCK_EXT",
+ 1000288027: "VK_FORMAT_ASTC_6x6x6_UNORM_BLOCK_EXT",
+ 1000288028: "VK_FORMAT_ASTC_6x6x6_SRGB_BLOCK_EXT",
+ 1000288029: "VK_FORMAT_ASTC_6x6x6_SFLOAT_BLOCK_EXT",
+ 1000464000: "VK_FORMAT_R16G16_S10_5_NV",
+ 1000470000: "VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR",
+ 1000470001: "VK_FORMAT_A8_UNORM_KHR",
+}
+
+VkFrontFace = {
+ 0: "VK_FRONT_FACE_COUNTER_CLOCKWISE",
+ 1: "VK_FRONT_FACE_CLOCKWISE",
+}
+
+VkImageLayout = {
+ 0: "VK_IMAGE_LAYOUT_UNDEFINED",
+ 1: "VK_IMAGE_LAYOUT_GENERAL",
+ 2: "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL",
+ 3: "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL",
+ 4: "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL",
+ 5: "VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL",
+ 6: "VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL",
+ 7: "VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL",
+ 8: "VK_IMAGE_LAYOUT_PREINITIALIZED",
+ 1000117000: "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL",
+ 1000117001: "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL",
+ 1000241000: "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL",
+ 1000241001: "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL",
+ 1000241002: "VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL",
+ 1000241003: "VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL",
+ 1000314000: "VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL",
+ 1000314001: "VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL",
+ 1000001002: "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR",
+ 1000024000: "VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR",
+ 1000024001: "VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR",
+ 1000024002: "VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR",
+ 1000111000: "VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR",
+ 1000218000: "VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT",
+ 1000164003: "VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR",
+ 1000299000: "VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR",
+ 1000299001: "VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR",
+ 1000299002: "VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR",
+ 1000339000: "VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT",
+}
+
+VkImageTiling = {
+ 0: "VK_IMAGE_TILING_OPTIMAL",
+ 1: "VK_IMAGE_TILING_LINEAR",
+ 1000158000: "VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT",
+}
+
+VkImageType = {
+ 0: "VK_IMAGE_TYPE_1D",
+ 1: "VK_IMAGE_TYPE_2D",
+ 2: "VK_IMAGE_TYPE_3D",
+}
+
+VkImageViewType = {
+ 0: "VK_IMAGE_VIEW_TYPE_1D",
+ 1: "VK_IMAGE_VIEW_TYPE_2D",
+ 2: "VK_IMAGE_VIEW_TYPE_3D",
+ 3: "VK_IMAGE_VIEW_TYPE_CUBE",
+ 4: "VK_IMAGE_VIEW_TYPE_1D_ARRAY",
+ 5: "VK_IMAGE_VIEW_TYPE_2D_ARRAY",
+ 6: "VK_IMAGE_VIEW_TYPE_CUBE_ARRAY",
+}
+
+VkIndexType = {
+ 0: "VK_INDEX_TYPE_UINT16",
+ 1: "VK_INDEX_TYPE_UINT32",
+ 1000165000: "VK_INDEX_TYPE_NONE_KHR",
+ 1000265000: "VK_INDEX_TYPE_UINT8_EXT",
+}
+
+VkLogicOp = {
+ 0: "VK_LOGIC_OP_CLEAR",
+ 1: "VK_LOGIC_OP_AND",
+ 2: "VK_LOGIC_OP_AND_REVERSE",
+ 3: "VK_LOGIC_OP_COPY",
+ 4: "VK_LOGIC_OP_AND_INVERTED",
+ 5: "VK_LOGIC_OP_NO_OP",
+ 6: "VK_LOGIC_OP_XOR",
+ 7: "VK_LOGIC_OP_OR",
+ 8: "VK_LOGIC_OP_NOR",
+ 9: "VK_LOGIC_OP_EQUIVALENT",
+ 10: "VK_LOGIC_OP_INVERT",
+ 11: "VK_LOGIC_OP_OR_REVERSE",
+ 12: "VK_LOGIC_OP_COPY_INVERTED",
+ 13: "VK_LOGIC_OP_OR_INVERTED",
+ 14: "VK_LOGIC_OP_NAND",
+ 15: "VK_LOGIC_OP_SET",
+}
+
+VkPhysicalDeviceType = {
+ 0: "VK_PHYSICAL_DEVICE_TYPE_OTHER",
+ 1: "VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU",
+ 2: "VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU",
+ 3: "VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU",
+ 4: "VK_PHYSICAL_DEVICE_TYPE_CPU",
+}
+
+VkPipelineBindPoint = {
+ 0: "VK_PIPELINE_BIND_POINT_GRAPHICS",
+ 1: "VK_PIPELINE_BIND_POINT_COMPUTE",
+ 1000134000: "VK_PIPELINE_BIND_POINT_EXECUTION_GRAPH_AMDX",
+ 1000165000: "VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR",
+ 1000369003: "VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI",
+}
+
+VkPolygonMode = {
+ 0: "VK_POLYGON_MODE_FILL",
+ 1: "VK_POLYGON_MODE_LINE",
+ 2: "VK_POLYGON_MODE_POINT",
+ 1000153000: "VK_POLYGON_MODE_FILL_RECTANGLE_NV",
+}
+
+VkPrimitiveTopology = {
+ 0: "VK_PRIMITIVE_TOPOLOGY_POINT_LIST",
+ 1: "VK_PRIMITIVE_TOPOLOGY_LINE_LIST",
+ 2: "VK_PRIMITIVE_TOPOLOGY_LINE_STRIP",
+ 3: "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST",
+ 4: "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP",
+ 5: "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN",
+ 6: "VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY",
+ 7: "VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY",
+ 8: "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY",
+ 9: "VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY",
+ 10: "VK_PRIMITIVE_TOPOLOGY_PATCH_LIST",
+}
+
+VkSampleCountFlagBits = {
+ 1: "VK_SAMPLE_COUNT_1_BIT",
+ 2: "VK_SAMPLE_COUNT_2_BIT",
+ 4: "VK_SAMPLE_COUNT_4_BIT",
+ 8: "VK_SAMPLE_COUNT_8_BIT",
+ 16: "VK_SAMPLE_COUNT_16_BIT",
+ 32: "VK_SAMPLE_COUNT_32_BIT",
+ 64: "VK_SAMPLE_COUNT_64_BIT",
+}
+
+VkSamplerAddressMode = {
+ 0: "VK_SAMPLER_ADDRESS_MODE_REPEAT",
+ 1: "VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT",
+ 2: "VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE",
+ 3: "VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER",
+ 4: "VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE",
+ 4: "VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE",
+}
+
+VkSamplerMipmapMode = {
+ 0: "VK_SAMPLER_MIPMAP_MODE_NEAREST",
+ 1: "VK_SAMPLER_MIPMAP_MODE_LINEAR",
+}
+
+VkShaderStageFlagBits = {
+ 1: "VK_SHADER_STAGE_VERTEX_BIT",
+ 2: "VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT",
+ 4: "VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT",
+ 8: "VK_SHADER_STAGE_GEOMETRY_BIT",
+ 16: "VK_SHADER_STAGE_FRAGMENT_BIT",
+ 32: "VK_SHADER_STAGE_COMPUTE_BIT",
+ 31: "VK_SHADER_STAGE_ALL_GRAPHICS",
+ 2147483647: "VK_SHADER_STAGE_ALL",
+ 256: "VK_SHADER_STAGE_RAYGEN_BIT_KHR",
+ 512: "VK_SHADER_STAGE_ANY_HIT_BIT_KHR",
+ 1024: "VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR",
+ 2048: "VK_SHADER_STAGE_MISS_BIT_KHR",
+ 4096: "VK_SHADER_STAGE_INTERSECTION_BIT_KHR",
+ 8192: "VK_SHADER_STAGE_CALLABLE_BIT_KHR",
+ 64: "VK_SHADER_STAGE_TASK_BIT_EXT",
+ 128: "VK_SHADER_STAGE_MESH_BIT_EXT",
+ 16384: "VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI",
+ 524288: "VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI",
+}
+
+VkSharingMode = {
+ 0: "VK_SHARING_MODE_EXCLUSIVE",
+ 1: "VK_SHARING_MODE_CONCURRENT",
+}
+
+VkStencilOp = {
+ 0: "VK_STENCIL_OP_KEEP",
+ 1: "VK_STENCIL_OP_ZERO",
+ 2: "VK_STENCIL_OP_REPLACE",
+ 3: "VK_STENCIL_OP_INCREMENT_AND_CLAMP",
+ 4: "VK_STENCIL_OP_DECREMENT_AND_CLAMP",
+ 5: "VK_STENCIL_OP_INVERT",
+ 6: "VK_STENCIL_OP_INCREMENT_AND_WRAP",
+ 7: "VK_STENCIL_OP_DECREMENT_AND_WRAP",
+}
+
+VkStructureType = {
+ 0: "VK_STRUCTURE_TYPE_APPLICATION_INFO",
+ 1: "VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO",
+ 2: "VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO",
+ 3: "VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO",
+ 4: "VK_STRUCTURE_TYPE_SUBMIT_INFO",
+ 5: "VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO",
+ 6: "VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE",
+ 7: "VK_STRUCTURE_TYPE_BIND_SPARSE_INFO",
+ 8: "VK_STRUCTURE_TYPE_FENCE_CREATE_INFO",
+ 9: "VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO",
+ 10: "VK_STRUCTURE_TYPE_EVENT_CREATE_INFO",
+ 11: "VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO",
+ 12: "VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO",
+ 13: "VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO",
+ 14: "VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO",
+ 15: "VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO",
+ 16: "VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO",
+ 17: "VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO",
+ 18: "VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO",
+ 19: "VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO",
+ 20: "VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO",
+ 21: "VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO",
+ 22: "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO",
+ 23: "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO",
+ 24: "VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO",
+ 25: "VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO",
+ 26: "VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO",
+ 27: "VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO",
+ 28: "VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO",
+ 29: "VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO",
+ 30: "VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO",
+ 31: "VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO",
+ 32: "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO",
+ 33: "VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO",
+ 34: "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO",
+ 35: "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET",
+ 36: "VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET",
+ 37: "VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO",
+ 38: "VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO",
+ 39: "VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO",
+ 40: "VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO",
+ 41: "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO",
+ 42: "VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO",
+ 43: "VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO",
+ 44: "VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER",
+ 45: "VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER",
+ 46: "VK_STRUCTURE_TYPE_MEMORY_BARRIER",
+ 47: "VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO",
+ 48: "VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO",
+ 1000094000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES",
+ 1000157000: "VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO",
+ 1000157001: "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO",
+ 1000083000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES",
+ 1000127000: "VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS",
+ 1000127001: "VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO",
+ 1000060000: "VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO",
+ 1000060003: "VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO",
+ 1000060004: "VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO",
+ 1000060005: "VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO",
+ 1000060006: "VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO",
+ 1000060013: "VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO",
+ 1000060014: "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO",
+ 1000070000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES",
+ 1000070001: "VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO",
+ 1000146000: "VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2",
+ 1000146001: "VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2",
+ 1000146002: "VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2",
+ 1000146003: "VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2",
+ 1000146004: "VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2",
+ 1000059000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2",
+ 1000059001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2",
+ 1000059002: "VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2",
+ 1000059003: "VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2",
+ 1000059004: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2",
+ 1000059005: "VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2",
+ 1000059006: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2",
+ 1000059007: "VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2",
+ 1000059008: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2",
+ 1000117000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES",
+ 1000117001: "VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO",
+ 1000117002: "VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO",
+ 1000117003: "VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO",
+ 1000053000: "VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO",
+ 1000053001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES",
+ 1000053002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES",
+ 1000120000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES",
+ 1000145000: "VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO",
+ 1000145001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES",
+ 1000145002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES",
+ 1000145003: "VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2",
+ 1000156000: "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO",
+ 1000156001: "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO",
+ 1000156002: "VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO",
+ 1000156003: "VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO",
+ 1000156004: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES",
+ 1000156005: "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES",
+ 1000085000: "VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO",
+ 1000071000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO",
+ 1000071001: "VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES",
+ 1000071002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO",
+ 1000071003: "VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES",
+ 1000071004: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES",
+ 1000072000: "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO",
+ 1000072001: "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO",
+ 1000072002: "VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO",
+ 1000112000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO",
+ 1000112001: "VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES",
+ 1000113000: "VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO",
+ 1000077000: "VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO",
+ 1000076000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO",
+ 1000076001: "VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES",
+ 1000168000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES",
+ 1000168001: "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT",
+ 1000063000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES",
+ 49: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES",
+ 50: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES",
+ 51: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES",
+ 52: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES",
+ 1000147000: "VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO",
+ 1000109000: "VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2",
+ 1000109001: "VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2",
+ 1000109002: "VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2",
+ 1000109003: "VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2",
+ 1000109004: "VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2",
+ 1000109005: "VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO",
+ 1000109006: "VK_STRUCTURE_TYPE_SUBPASS_END_INFO",
+ 1000177000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES",
+ 1000196000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES",
+ 1000180000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES",
+ 1000082000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES",
+ 1000197000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES",
+ 1000161000: "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO",
+ 1000161001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES",
+ 1000161002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES",
+ 1000161003: "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO",
+ 1000161004: "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT",
+ 1000199000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES",
+ 1000199001: "VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE",
+ 1000221000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES",
+ 1000246000: "VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO",
+ 1000130000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES",
+ 1000130001: "VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO",
+ 1000211000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES",
+ 1000108000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES",
+ 1000108001: "VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO",
+ 1000108002: "VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO",
+ 1000108003: "VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO",
+ 1000253000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES",
+ 1000175000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES",
+ 1000241000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES",
+ 1000241001: "VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT",
+ 1000241002: "VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT",
+ 1000261000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES",
+ 1000207000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES",
+ 1000207001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES",
+ 1000207002: "VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO",
+ 1000207003: "VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO",
+ 1000207004: "VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO",
+ 1000207005: "VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO",
+ 1000257000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES",
+ 1000244001: "VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO",
+ 1000257002: "VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO",
+ 1000257003: "VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO",
+ 1000257004: "VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO",
+ 53: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES",
+ 54: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES",
+ 1000192000: "VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO",
+ 1000215000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES",
+ 1000245000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES",
+ 1000276000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES",
+ 1000295000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES",
+ 1000295001: "VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO",
+ 1000295002: "VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO",
+ 1000297000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES",
+ 1000314000: "VK_STRUCTURE_TYPE_MEMORY_BARRIER_2",
+ 1000314001: "VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2",
+ 1000314002: "VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2",
+ 1000314003: "VK_STRUCTURE_TYPE_DEPENDENCY_INFO",
+ 1000314004: "VK_STRUCTURE_TYPE_SUBMIT_INFO_2",
+ 1000314005: "VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO",
+ 1000314006: "VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO",
+ 1000314007: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES",
+ 1000325000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES",
+ 1000335000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES",
+ 1000337000: "VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2",
+ 1000337001: "VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2",
+ 1000337002: "VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2",
+ 1000337003: "VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2",
+ 1000337004: "VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2",
+ 1000337005: "VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2",
+ 1000337006: "VK_STRUCTURE_TYPE_BUFFER_COPY_2",
+ 1000337007: "VK_STRUCTURE_TYPE_IMAGE_COPY_2",
+ 1000337008: "VK_STRUCTURE_TYPE_IMAGE_BLIT_2",
+ 1000337009: "VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2",
+ 1000337010: "VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2",
+ 1000225000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES",
+ 1000225001: "VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO",
+ 1000225002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES",
+ 1000138000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES",
+ 1000138001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES",
+ 1000138002: "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK",
+ 1000138003: "VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO",
+ 1000066000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES",
+ 1000044000: "VK_STRUCTURE_TYPE_RENDERING_INFO",
+ 1000044001: "VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO",
+ 1000044002: "VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO",
+ 1000044003: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES",
+ 1000044004: "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO",
+ 1000280000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES",
+ 1000280001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES",
+ 1000281001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES",
+ 1000360000: "VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3",
+ 1000413000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES",
+ 1000413001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES",
+ 1000413002: "VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS",
+ 1000413003: "VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS",
+ 1000001000: "VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR",
+ 1000001001: "VK_STRUCTURE_TYPE_PRESENT_INFO_KHR",
+ 1000060007: "VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR",
+ 1000060008: "VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR",
+ 1000060009: "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR",
+ 1000060010: "VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR",
+ 1000060011: "VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR",
+ 1000060012: "VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR",
+ 1000002000: "VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR",
+ 1000002001: "VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR",
+ 1000003000: "VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR",
+ 1000004000: "VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR",
+ 1000005000: "VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR",
+ 1000006000: "VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR",
+ 1000008000: "VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR",
+ 1000009000: "VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR",
+ 1000010000: "VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID",
+ 1000010001: "VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID",
+ 1000010002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID",
+ 1000011000: "VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT",
+ 1000018000: "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD",
+ 1000022000: "VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT",
+ 1000022001: "VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT",
+ 1000022002: "VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT",
+ 1000023000: "VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR",
+ 1000023001: "VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR",
+ 1000023002: "VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR",
+ 1000023003: "VK_STRUCTURE_TYPE_VIDEO_SESSION_MEMORY_REQUIREMENTS_KHR",
+ 1000023004: "VK_STRUCTURE_TYPE_BIND_VIDEO_SESSION_MEMORY_INFO_KHR",
+ 1000023005: "VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR",
+ 1000023006: "VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR",
+ 1000023007: "VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR",
+ 1000023008: "VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR",
+ 1000023009: "VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR",
+ 1000023010: "VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR",
+ 1000023011: "VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR",
+ 1000023012: "VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR",
+ 1000023013: "VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR",
+ 1000023014: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR",
+ 1000023015: "VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR",
+ 1000023016: "VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR",
+ 1000024000: "VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR",
+ 1000024001: "VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR",
+ 1000024002: "VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR",
+ 1000026000: "VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV",
+ 1000026001: "VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV",
+ 1000026002: "VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV",
+ 1000028000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT",
+ 1000028001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT",
+ 1000028002: "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT",
+ 1000029000: "VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX",
+ 1000029001: "VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX",
+ 1000029002: "VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX",
+ 1000030000: "VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX",
+ 1000030001: "VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX",
+ 1000038000: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT",
+ 1000038001: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT",
+ 1000038002: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT",
+ 1000038003: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_EXT",
+ 1000038004: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT",
+ 1000038005: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_EXT",
+ 1000038006: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_GOP_REMAINING_FRAME_INFO_EXT",
+ 1000038007: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT",
+ 1000038008: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT",
+ 1000038009: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT",
+ 1000038010: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT",
+ 1000038011: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_EXT",
+ 1000038012: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_EXT",
+ 1000038013: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_EXT",
+ 1000039000: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT",
+ 1000039001: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT",
+ 1000039002: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT",
+ 1000039003: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_EXT",
+ 1000039004: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT",
+ 1000039005: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_EXT",
+ 1000039006: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_GOP_REMAINING_FRAME_INFO_EXT",
+ 1000039007: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_EXT",
+ 1000039009: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT",
+ 1000039010: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT",
+ 1000039011: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT",
+ 1000039012: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_EXT",
+ 1000039013: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_EXT",
+ 1000039014: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_EXT",
+ 1000040000: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR",
+ 1000040001: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR",
+ 1000040003: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR",
+ 1000040004: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR",
+ 1000040005: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR",
+ 1000040006: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR",
+ 1000041000: "VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD",
+ 1000044006: "VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR",
+ 1000044007: "VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT",
+ 1000044008: "VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD",
+ 1000044009: "VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX",
+ 1000049000: "VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP",
+ 1000050000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV",
+ 1000051000: "VK_STRUCTURE_TYPE_PRIVATE_VENDOR_INFO_PLACEHOLDER_OFFSET_0_NV",
+ 1000056000: "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV",
+ 1000056001: "VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV",
+ 1000057000: "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV",
+ 1000057001: "VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV",
+ 1000058000: "VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV",
+ 1000060007: "VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR",
+ 1000060008: "VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR",
+ 1000060009: "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR",
+ 1000060010: "VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR",
+ 1000060011: "VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR",
+ 1000060012: "VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR",
+ 1000061000: "VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT",
+ 1000062000: "VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN",
+ 1000067000: "VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT",
+ 1000067001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT",
+ 1000068000: "VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT",
+ 1000068001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT",
+ 1000068002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT",
+ 1000073000: "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR",
+ 1000073001: "VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR",
+ 1000073002: "VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR",
+ 1000073003: "VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR",
+ 1000074000: "VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR",
+ 1000074001: "VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR",
+ 1000074002: "VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR",
+ 1000075000: "VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR",
+ 1000078000: "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR",
+ 1000078001: "VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR",
+ 1000078002: "VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR",
+ 1000078003: "VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR",
+ 1000079000: "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR",
+ 1000079001: "VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR",
+ 1000080000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR",
+ 1000081000: "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT",
+ 1000081001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT",
+ 1000081002: "VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT",
+ 1000084000: "VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR",
+ 1000087000: "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV",
+ 1000090000: "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT",
+ 1000091000: "VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT",
+ 1000091001: "VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT",
+ 1000091002: "VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT",
+ 1000091003: "VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT",
+ 1000092000: "VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE",
+ 1000097000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX",
+ 1000098000: "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV",
+ 1000099000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT",
+ 1000099001: "VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT",
+ 1000101000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT",
+ 1000101001: "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT",
+ 1000102000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT",
+ 1000102001: "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT",
+ 1000105000: "VK_STRUCTURE_TYPE_HDR_METADATA_EXT",
+ 1000111000: "VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR",
+ 1000114000: "VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR",
+ 1000114001: "VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR",
+ 1000114002: "VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR",
+ 1000115000: "VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR",
+ 1000115001: "VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR",
+ 1000116000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR",
+ 1000116001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR",
+ 1000116002: "VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR",
+ 1000116003: "VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR",
+ 1000116004: "VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR",
+ 1000116005: "VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR",
+ 1000116006: "VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR",
+ 1000119000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR",
+ 1000119001: "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR",
+ 1000119002: "VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR",
+ 1000121000: "VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR",
+ 1000121001: "VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR",
+ 1000121002: "VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR",
+ 1000121003: "VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR",
+ 1000121004: "VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR",
+ 1000122000: "VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK",
+ 1000123000: "VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK",
+ 1000128000: "VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT",
+ 1000128001: "VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT",
+ 1000128002: "VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT",
+ 1000128003: "VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT",
+ 1000128004: "VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT",
+ 1000129000: "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID",
+ 1000129001: "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID",
+ 1000129002: "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID",
+ 1000129003: "VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID",
+ 1000129004: "VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID",
+ 1000129005: "VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID",
+ 1000129006: "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID",
+ 1000134000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_FEATURES_AMDX",
+ 1000134001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_PROPERTIES_AMDX",
+ 1000134002: "VK_STRUCTURE_TYPE_EXECUTION_GRAPH_PIPELINE_SCRATCH_SIZE_AMDX",
+ 1000134003: "VK_STRUCTURE_TYPE_EXECUTION_GRAPH_PIPELINE_CREATE_INFO_AMDX",
+ 1000134004: "VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_NODE_CREATE_INFO_AMDX",
+ 1000143000: "VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT",
+ 1000143001: "VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT",
+ 1000143002: "VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT",
+ 1000143003: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT",
+ 1000143004: "VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT",
+ 1000148000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT",
+ 1000148001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT",
+ 1000148002: "VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT",
+ 1000149000: "VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV",
+ 1000150007: "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR",
+ 1000150000: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR",
+ 1000150002: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR",
+ 1000150003: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR",
+ 1000150004: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR",
+ 1000150005: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR",
+ 1000150006: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR",
+ 1000150009: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR",
+ 1000150010: "VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR",
+ 1000150011: "VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR",
+ 1000150012: "VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR",
+ 1000150013: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR",
+ 1000150014: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR",
+ 1000150017: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR",
+ 1000150020: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR",
+ 1000347000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR",
+ 1000347001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR",
+ 1000150015: "VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR",
+ 1000150016: "VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR",
+ 1000150018: "VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR",
+ 1000348013: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR",
+ 1000152000: "VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV",
+ 1000154000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV",
+ 1000154001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV",
+ 1000158000: "VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT",
+ 1000158002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT",
+ 1000158003: "VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT",
+ 1000158004: "VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT",
+ 1000158005: "VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT",
+ 1000158006: "VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT",
+ 1000160000: "VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT",
+ 1000160001: "VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT",
+ 1000163000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR",
+ 1000163001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR",
+ 1000164000: "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV",
+ 1000164001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV",
+ 1000164002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV",
+ 1000164005: "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV",
+ 1000165000: "VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV",
+ 1000165001: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV",
+ 1000165003: "VK_STRUCTURE_TYPE_GEOMETRY_NV",
+ 1000165004: "VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV",
+ 1000165005: "VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV",
+ 1000165006: "VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV",
+ 1000165007: "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV",
+ 1000165008: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV",
+ 1000165009: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV",
+ 1000165011: "VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV",
+ 1000165012: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV",
+ 1000166000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV",
+ 1000166001: "VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV",
+ 1000170000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT",
+ 1000170001: "VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT",
+ 1000178000: "VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT",
+ 1000178001: "VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT",
+ 1000178002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT",
+ 1000181000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR",
+ 1000183000: "VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD",
+ 1000184000: "VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT",
+ 1000185000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD",
+ 1000187000: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR",
+ 1000187001: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR",
+ 1000187002: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR",
+ 1000187003: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR",
+ 1000187004: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_KHR",
+ 1000187005: "VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR",
+ 1000174000: "VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR",
+ 1000388000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR",
+ 1000388001: "VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR",
+ 1000189000: "VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD",
+ 1000190000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT",
+ 1000190001: "VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT",
+ 1000190002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT",
+ 1000191000: "VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP",
+ 1000201000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV",
+ 1000202000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV",
+ 1000202001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV",
+ 1000204000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV",
+ 1000205000: "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV",
+ 1000205002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV",
+ 1000206000: "VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV",
+ 1000206001: "VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV",
+ 1000209000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL",
+ 1000210000: "VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL",
+ 1000210001: "VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL",
+ 1000210002: "VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL",
+ 1000210003: "VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL",
+ 1000210004: "VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL",
+ 1000210005: "VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL",
+ 1000212000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT",
+ 1000213000: "VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD",
+ 1000213001: "VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD",
+ 1000214000: "VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA",
+ 1000217000: "VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT",
+ 1000218000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT",
+ 1000218001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT",
+ 1000218002: "VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT",
+ 1000226000: "VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR",
+ 1000226001: "VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR",
+ 1000226002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR",
+ 1000226003: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR",
+ 1000226004: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR",
+ 1000227000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD",
+ 1000229000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD",
+ 1000234000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT",
+ 1000237000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT",
+ 1000238000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT",
+ 1000238001: "VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT",
+ 1000239000: "VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR",
+ 1000240000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV",
+ 1000244000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT",
+ 1000244002: "VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT",
+ 1000247000: "VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT",
+ 1000248000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR",
+ 1000249000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV",
+ 1000249001: "VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV",
+ 1000249002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV",
+ 1000250000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV",
+ 1000250001: "VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV",
+ 1000250002: "VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV",
+ 1000251000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT",
+ 1000252000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT",
+ 1000254000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT",
+ 1000254001: "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT",
+ 1000254002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT",
+ 1000255000: "VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT",
+ 1000255002: "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT",
+ 1000255001: "VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT",
+ 1000256000: "VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT",
+ 1000259000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT",
+ 1000259001: "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT",
+ 1000259002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT",
+ 1000260000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT",
+ 1000265000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT",
+ 1000267000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT",
+ 1000269000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR",
+ 1000269001: "VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR",
+ 1000269002: "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR",
+ 1000269003: "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR",
+ 1000269004: "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR",
+ 1000269005: "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR",
+ 1000270000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT",
+ 1000270001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT",
+ 1000270002: "VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXT",
+ 1000270003: "VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY_EXT",
+ 1000270004: "VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO_EXT",
+ 1000270005: "VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXT",
+ 1000270006: "VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO_EXT",
+ 1000270007: "VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO_EXT",
+ 1000270008: "VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT",
+ 1000270009: "VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT",
+ 1000271000: "VK_STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR",
+ 1000271001: "VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR",
+ 1000273000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT",
+ 1000274000: "VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT",
+ 1000274001: "VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT",
+ 1000274002: "VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT",
+ 1000275000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT",
+ 1000275001: "VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT",
+ 1000275002: "VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT",
+ 1000275003: "VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT",
+ 1000275004: "VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT",
+ 1000275005: "VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT",
+ 1000277000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV",
+ 1000277001: "VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV",
+ 1000277002: "VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV",
+ 1000277003: "VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV",
+ 1000277004: "VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV",
+ 1000277005: "VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV",
+ 1000277006: "VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV",
+ 1000277007: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV",
+ 1000278000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV",
+ 1000278001: "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV",
+ 1000281000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT",
+ 1000282000: "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM",
+ 1000282001: "VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM",
+ 1000283000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT",
+ 1000283001: "VK_STRUCTURE_TYPE_DEPTH_BIAS_INFO_EXT",
+ 1000283002: "VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT",
+ 1000284000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT",
+ 1000284001: "VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT",
+ 1000284002: "VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT",
+ 1000286000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT",
+ 1000286001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT",
+ 1000287000: "VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT",
+ 1000287001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT",
+ 1000287002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT",
+ 1000290000: "VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR",
+ 1000292000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV",
+ 1000292001: "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV",
+ 1000292002: "VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV",
+ 1000294000: "VK_STRUCTURE_TYPE_PRESENT_ID_KHR",
+ 1000294001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR",
+ 1000299000: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR",
+ 1000299001: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR",
+ 1000299002: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR",
+ 1000299003: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR",
+ 1000299004: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR",
+ 1000299005: "VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR",
+ 1000299006: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR",
+ 1000299007: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_PROPERTIES_KHR",
+ 1000299008: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR",
+ 1000299009: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_GET_INFO_KHR",
+ 1000299010: "VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_FEEDBACK_INFO_KHR",
+ 1000300000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV",
+ 1000300001: "VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV",
+ 1000307000: "VK_STRUCTURE_TYPE_CUDA_MODULE_CREATE_INFO_NV",
+ 1000307001: "VK_STRUCTURE_TYPE_CUDA_FUNCTION_CREATE_INFO_NV",
+ 1000307002: "VK_STRUCTURE_TYPE_CUDA_LAUNCH_INFO_NV",
+ 1000307003: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV",
+ 1000307004: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV",
+ 1000308000: "VK_STRUCTURE_TYPE_REFRESH_OBJECT_LIST_KHR",
+ 1000310000: "VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV",
+ 1000311000: "VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT",
+ 1000311001: "VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT",
+ 1000311002: "VK_STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT",
+ 1000311003: "VK_STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT",
+ 1000311004: "VK_STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT",
+ 1000311005: "VK_STRUCTURE_TYPE_IMPORT_METAL_BUFFER_INFO_EXT",
+ 1000311006: "VK_STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT",
+ 1000311007: "VK_STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT",
+ 1000311008: "VK_STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT",
+ 1000311009: "VK_STRUCTURE_TYPE_IMPORT_METAL_IO_SURFACE_INFO_EXT",
+ 1000311010: "VK_STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT",
+ 1000311011: "VK_STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT",
+ 1000314008: "VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV",
+ 1000314009: "VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV",
+ 1000316000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT",
+ 1000316001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT",
+ 1000316002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT",
+ 1000316003: "VK_STRUCTURE_TYPE_DESCRIPTOR_ADDRESS_INFO_EXT",
+ 1000316004: "VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT",
+ 1000316005: "VK_STRUCTURE_TYPE_BUFFER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT",
+ 1000316006: "VK_STRUCTURE_TYPE_IMAGE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT",
+ 1000316007: "VK_STRUCTURE_TYPE_IMAGE_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_EXT",
+ 1000316008: "VK_STRUCTURE_TYPE_SAMPLER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT",
+ 1000316010: "VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT",
+ 1000316011: "VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_INFO_EXT",
+ 1000316012: "VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT",
+ 1000316009: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT",
+ 1000320000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT",
+ 1000320001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT",
+ 1000320002: "VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT",
+ 1000321000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD",
+ 1000203000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR",
+ 1000322000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR",
+ 1000323000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR",
+ 1000326000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV",
+ 1000326001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV",
+ 1000326002: "VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV",
+ 1000327000: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV",
+ 1000327001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV",
+ 1000327002: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV",
+ 1000328000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT",
+ 1000328001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT",
+ 1000330000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT",
+ 1000332000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT",
+ 1000332001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT",
+ 1000333000: "VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM",
+ 1000336000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR",
+ 1000338000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT",
+ 1000338001: "VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT",
+ 1000338004: "VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT",
+ 1000339000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT",
+ 1000340000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT",
+ 1000341000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT",
+ 1000341001: "VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT",
+ 1000341002: "VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT",
+ 1000344000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT",
+ 1000346000: "VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT",
+ 1000352000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT",
+ 1000352001: "VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT",
+ 1000352002: "VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT",
+ 1000353000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT",
+ 1000354000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT",
+ 1000354001: "VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT",
+ 1000355000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT",
+ 1000355001: "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT",
+ 1000356000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT",
+ 1000364000: "VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA",
+ 1000364001: "VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA",
+ 1000364002: "VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA",
+ 1000365000: "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA",
+ 1000365001: "VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA",
+ 1000366000: "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA",
+ 1000366001: "VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA",
+ 1000366002: "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA",
+ 1000366003: "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA",
+ 1000366004: "VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA",
+ 1000366005: "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA",
+ 1000366006: "VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA",
+ 1000366007: "VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA",
+ 1000366008: "VK_STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA",
+ 1000366009: "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA",
+ 1000369000: "VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI",
+ 1000369001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI",
+ 1000369002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI",
+ 1000370000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI",
+ 1000371000: "VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV",
+ 1000371001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV",
+ 1000372000: "VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT",
+ 1000372001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT",
+ 1000373000: "VK_STRUCTURE_TYPE_IMPORT_FENCE_SCI_SYNC_INFO_NV",
+ 1000373001: "VK_STRUCTURE_TYPE_EXPORT_FENCE_SCI_SYNC_INFO_NV",
+ 1000373002: "VK_STRUCTURE_TYPE_FENCE_GET_SCI_SYNC_INFO_NV",
+ 1000373003: "VK_STRUCTURE_TYPE_SCI_SYNC_ATTRIBUTES_INFO_NV",
+ 1000373004: "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_SCI_SYNC_INFO_NV",
+ 1000373005: "VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_SCI_SYNC_INFO_NV",
+ 1000373006: "VK_STRUCTURE_TYPE_SEMAPHORE_GET_SCI_SYNC_INFO_NV",
+ 1000373007: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SCI_SYNC_FEATURES_NV",
+ 1000374000: "VK_STRUCTURE_TYPE_IMPORT_MEMORY_SCI_BUF_INFO_NV",
+ 1000374001: "VK_STRUCTURE_TYPE_EXPORT_MEMORY_SCI_BUF_INFO_NV",
+ 1000374002: "VK_STRUCTURE_TYPE_MEMORY_GET_SCI_BUF_INFO_NV",
+ 1000374003: "VK_STRUCTURE_TYPE_MEMORY_SCI_BUF_PROPERTIES_NV",
+ 1000374004: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCI_BUF_FEATURES_NV",
+ 1000375000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT",
+ 1000375001: "VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT",
+ 1000376000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT",
+ 1000376001: "VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT",
+ 1000376002: "VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT",
+ 1000377000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT",
+ 1000378000: "VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX",
+ 1000381000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT",
+ 1000381001: "VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT",
+ 1000382000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT",
+ 1000386000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR",
+ 1000391000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT",
+ 1000391001: "VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT",
+ 1000392000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT",
+ 1000392001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT",
+ 1000393000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT",
+ 1000395000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT",
+ 1000395001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT",
+ 1000396000: "VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT",
+ 1000396001: "VK_STRUCTURE_TYPE_MICROMAP_VERSION_INFO_EXT",
+ 1000396002: "VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT",
+ 1000396003: "VK_STRUCTURE_TYPE_COPY_MICROMAP_TO_MEMORY_INFO_EXT",
+ 1000396004: "VK_STRUCTURE_TYPE_COPY_MEMORY_TO_MICROMAP_INFO_EXT",
+ 1000396005: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT",
+ 1000396006: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT",
+ 1000396007: "VK_STRUCTURE_TYPE_MICROMAP_CREATE_INFO_EXT",
+ 1000396008: "VK_STRUCTURE_TYPE_MICROMAP_BUILD_SIZES_INFO_EXT",
+ 1000396009: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT",
+ 1000397000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_FEATURES_NV",
+ 1000397001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_PROPERTIES_NV",
+ 1000397002: "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_DISPLACEMENT_MICROMAP_NV",
+ 1000404000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI",
+ 1000404001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI",
+ 1000411000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT",
+ 1000411001: "VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT",
+ 1000412000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT",
+ 1000415000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM",
+ 1000417000: "VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM",
+ 1000417001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM",
+ 1000417002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM",
+ 1000418000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT",
+ 1000418001: "VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT",
+ 1000420000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE",
+ 1000420001: "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE",
+ 1000420002: "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE",
+ 1000421000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT",
+ 1000422000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT",
+ 1000425000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM",
+ 1000425001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM",
+ 1000425002: "VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM",
+ 1000426000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV",
+ 1000426001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV",
+ 1000427000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV",
+ 1000427001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV",
+ 1000428000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV",
+ 1000428001: "VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_INDIRECT_BUFFER_INFO_NV",
+ 1000428002: "VK_STRUCTURE_TYPE_PIPELINE_INDIRECT_DEVICE_ADDRESS_INFO_NV",
+ 1000430000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV",
+ 1000435000: "VK_STRUCTURE_TYPE_APPLICATION_PARAMETERS_EXT",
+ 1000437000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT",
+ 1000440000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM",
+ 1000440001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM",
+ 1000440002: "VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM",
+ 1000451000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT",
+ 1000451001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT",
+ 1000453000: "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT",
+ 1000455000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT",
+ 1000455001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT",
+ 1000458000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT",
+ 1000458001: "VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT",
+ 1000458002: "VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT",
+ 1000458003: "VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT",
+ 1000459000: "VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_INFO_LUNARG",
+ 1000459001: "VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_LIST_LUNARG",
+ 1000462000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT",
+ 1000462001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT",
+ 1000462002: "VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT",
+ 1000462003: "VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT",
+ 1000342000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT",
+ 1000464000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV",
+ 1000464001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV",
+ 1000464002: "VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV",
+ 1000464003: "VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NV",
+ 1000464004: "VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV",
+ 1000464005: "VK_STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV",
+ 1000464010: "VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV",
+ 1000465000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT",
+ 1000466000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT",
+ 1000468000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID",
+ 1000468001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID",
+ 1000468002: "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID",
+ 1000470000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR",
+ 1000470001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR",
+ 1000470003: "VK_STRUCTURE_TYPE_RENDERING_AREA_INFO_KHR",
+ 1000470004: "VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO_KHR",
+ 1000338002: "VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR",
+ 1000338003: "VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR",
+ 1000470005: "VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR",
+ 1000470006: "VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR",
+ 1000481000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR",
+ 1000482000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT",
+ 1000482001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT",
+ 1000482002: "VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT",
+ 1000352001: "VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT",
+ 1000352002: "VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT",
+ 1000484000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM",
+ 1000484001: "VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM",
+ 1000485000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_AMIGO_PROFILING_FEATURES_SEC",
+ 1000485001: "VK_STRUCTURE_TYPE_AMIGO_PROFILING_SUBMIT_INFO_SEC",
+ 1000488000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM",
+ 1000489000: "VK_STRUCTURE_TYPE_SEMAPHORE_SCI_SYNC_POOL_CREATE_INFO_NV",
+ 1000489001: "VK_STRUCTURE_TYPE_SEMAPHORE_SCI_SYNC_CREATE_INFO_NV",
+ 1000489002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SCI_SYNC_2_FEATURES_NV",
+ 1000373000: "VK_STRUCTURE_TYPE_IMPORT_FENCE_SCI_SYNC_INFO_NV",
+ 1000373001: "VK_STRUCTURE_TYPE_EXPORT_FENCE_SCI_SYNC_INFO_NV",
+ 1000373002: "VK_STRUCTURE_TYPE_FENCE_GET_SCI_SYNC_INFO_NV",
+ 1000373003: "VK_STRUCTURE_TYPE_SCI_SYNC_ATTRIBUTES_INFO_NV",
+ 1000490000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV",
+ 1000490001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV",
+ 1000492000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV",
+ 1000492001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV",
+ 1000351000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT",
+ 1000351002: "VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT",
+ 1000497000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM",
+ 1000497001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM",
+ 1000498000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT",
+ 1000499000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT",
+ 1000505000: "VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV",
+ 1000505001: "VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV",
+ 1000505002: "VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV",
+ 1000505003: "VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV",
+ 1000505004: "VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV",
+ 1000505005: "VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV",
+ 1000505006: "VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV",
+ 1000505007: "VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV",
+ 1000505008: "VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV",
+ 1000506000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR",
+ 1000506001: "VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR",
+ 1000506002: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR",
+ 1000510000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM",
+ 1000510001: "VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM",
+ 1000518000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM",
+ 1000518001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM",
+ 1000518002: "VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM",
+ 1000519000: "VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM",
+ 1000519001: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM",
+ 1000519002: "VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM",
+ 1000520000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM",
+ 1000520001: "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM",
+ 1000521000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM",
+ 1000524000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT",
+ 1000529000: "VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX",
+ 1000529001: "VK_STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX",
+ 1000529002: "VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX",
+ 1000529003: "VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX",
+ 1000529004: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX",
+ 1000530000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT",
+ 1000546000: "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV",
+ 1000385000: "VK_STRUCTURE_TYPE_IMPORT_COLOR_BUFFER_GOOGLE",
+ 1000385001: "VK_STRUCTURE_TYPE_IMPORT_BUFFER_GOOGLE",
+ 1000385002: "VK_STRUCTURE_TYPE_CREATE_BLOB_GOOGLE",
+}
+
+VkSubpassContents = {
+ 0: "VK_SUBPASS_CONTENTS_INLINE",
+ 1: "VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS",
+ 1000451000: "VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT",
+}
+
+VkVertexInputRate = {
+ 0: "VK_VERTEX_INPUT_RATE_VERTEX",
+ 1: "VK_VERTEX_INPUT_RATE_INSTANCE",
+}
+
diff --git a/src/gfxstream/third-party/.clang-format b/src/gfxstream/third-party/.clang-format
new file mode 100644
index 00000000000..a43d914ec38
--- /dev/null
+++ b/src/gfxstream/third-party/.clang-format
@@ -0,0 +1,2 @@
+DisableFormat: true
+SortIncludes: false \ No newline at end of file
diff --git a/src/gfxstream/third-party/renderdoc/LICENSE b/src/gfxstream/third-party/renderdoc/LICENSE
new file mode 100644
index 00000000000..3eb6fb28fd7
--- /dev/null
+++ b/src/gfxstream/third-party/renderdoc/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2019-2021 Baldur Karlsson
+
+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 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. \ No newline at end of file
diff --git a/src/gfxstream/third-party/renderdoc/include/renderdoc_app.h b/src/gfxstream/third-party/renderdoc/include/renderdoc_app.h
new file mode 100644
index 00000000000..bbf8eb953ce
--- /dev/null
+++ b/src/gfxstream/third-party/renderdoc/include/renderdoc_app.h
@@ -0,0 +1,694 @@
+/******************************************************************************
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019-2021 Baldur Karlsson
+ *
+ * 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 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.
+ ******************************************************************************/
+
+#pragma once
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Documentation for the API is available at https://renderdoc.org/docs/in_application_api.html
+//
+
+#if !defined(RENDERDOC_NO_STDINT)
+#include <stdint.h>
+#endif
+
+#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
+#define RENDERDOC_CC __cdecl
+#elif defined(__linux__)
+#define RENDERDOC_CC
+#elif defined(__APPLE__)
+#define RENDERDOC_CC
+#elif defined(__QNX__)
+#define RENDERDOC_CC
+#else
+#error "Unknown platform"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+// Constants not used directly in below API
+
+// This is a GUID/magic value used for when applications pass a path where shader debug
+// information can be found to match up with a stripped shader.
+// the define can be used like so: const GUID RENDERDOC_ShaderDebugMagicValue =
+// RENDERDOC_ShaderDebugMagicValue_value
+#define RENDERDOC_ShaderDebugMagicValue_struct \
+ { \
+ 0xeab25520, 0x6670, 0x4865, 0x84, 0x29, 0x6c, 0x8, 0x51, 0x54, 0x00, 0xff \
+ }
+
+// as an alternative when you want a byte array (assuming x86 endianness):
+#define RENDERDOC_ShaderDebugMagicValue_bytearray \
+ { \
+ 0x20, 0x55, 0xb2, 0xea, 0x70, 0x66, 0x65, 0x48, 0x84, 0x29, 0x6c, 0x8, 0x51, 0x54, 0x00, 0xff \
+ }
+
+// truncated version when only a uint64_t is available (e.g. Vulkan tags):
+#define RENDERDOC_ShaderDebugMagicValue_truncated 0x48656670eab25520ULL
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+// RenderDoc capture options
+//
+
+typedef enum RENDERDOC_CaptureOption {
+ // Allow the application to enable vsync
+ //
+ // Default - enabled
+ //
+ // 1 - The application can enable or disable vsync at will
+ // 0 - vsync is force disabled
+ eRENDERDOC_Option_AllowVSync = 0,
+
+ // Allow the application to enable fullscreen
+ //
+ // Default - enabled
+ //
+ // 1 - The application can enable or disable fullscreen at will
+ // 0 - fullscreen is force disabled
+ eRENDERDOC_Option_AllowFullscreen = 1,
+
+ // Record API debugging events and messages
+ //
+ // Default - disabled
+ //
+ // 1 - Enable built-in API debugging features and records the results into
+ // the capture, which is matched up with events on replay
+ // 0 - no API debugging is forcibly enabled
+ eRENDERDOC_Option_APIValidation = 2,
+ eRENDERDOC_Option_DebugDeviceMode = 2, // deprecated name of this enum
+
+ // Capture CPU callstacks for API events
+ //
+ // Default - disabled
+ //
+ // 1 - Enables capturing of callstacks
+ // 0 - no callstacks are captured
+ eRENDERDOC_Option_CaptureCallstacks = 3,
+
+ // When capturing CPU callstacks, only capture them from actions.
+ // This option does nothing without the above option being enabled
+ //
+ // Default - disabled
+ //
+ // 1 - Only captures callstacks for actions.
+ // Ignored if CaptureCallstacks is disabled
+ // 0 - Callstacks, if enabled, are captured for every event.
+ eRENDERDOC_Option_CaptureCallstacksOnlyDraws = 4,
+ eRENDERDOC_Option_CaptureCallstacksOnlyActions = 4,
+
+ // Specify a delay in seconds to wait for a debugger to attach, after
+ // creating or injecting into a process, before continuing to allow it to run.
+ //
+ // 0 indicates no delay, and the process will run immediately after injection
+ //
+ // Default - 0 seconds
+ //
+ eRENDERDOC_Option_DelayForDebugger = 5,
+
+ // Verify buffer access. This includes checking the memory returned by a Map() call to
+ // detect any out-of-bounds modification, as well as initialising buffers with undefined contents
+ // to a marker value to catch use of uninitialised memory.
+ //
+ // NOTE: This option is only valid for OpenGL and D3D11. Explicit APIs such as D3D12 and Vulkan do
+ // not do the same kind of interception & checking and undefined contents are really undefined.
+ //
+ // Default - disabled
+ //
+ // 1 - Verify buffer access
+ // 0 - No verification is performed, and overwriting bounds may cause crashes or corruption in
+ // RenderDoc.
+ eRENDERDOC_Option_VerifyBufferAccess = 6,
+
+ // The old name for eRENDERDOC_Option_VerifyBufferAccess was eRENDERDOC_Option_VerifyMapWrites.
+ // This option now controls the filling of uninitialised buffers with 0xdddddddd which was
+ // previously always enabled
+ eRENDERDOC_Option_VerifyMapWrites = eRENDERDOC_Option_VerifyBufferAccess,
+
+ // Hooks any system API calls that create child processes, and injects
+ // RenderDoc into them recursively with the same options.
+ //
+ // Default - disabled
+ //
+ // 1 - Hooks into spawned child processes
+ // 0 - Child processes are not hooked by RenderDoc
+ eRENDERDOC_Option_HookIntoChildren = 7,
+
+ // By default RenderDoc only includes resources in the final capture necessary
+ // for that frame, this allows you to override that behaviour.
+ //
+ // Default - disabled
+ //
+ // 1 - all live resources at the time of capture are included in the capture
+ // and available for inspection
+ // 0 - only the resources referenced by the captured frame are included
+ eRENDERDOC_Option_RefAllResources = 8,
+
+ // **NOTE**: As of RenderDoc v1.1 this option has been deprecated. Setting or
+ // getting it will be ignored, to allow compatibility with older versions.
+ // In v1.1 the option acts as if it's always enabled.
+ //
+ // By default RenderDoc skips saving initial states for resources where the
+ // previous contents don't appear to be used, assuming that writes before
+ // reads indicate previous contents aren't used.
+ //
+ // Default - disabled
+ //
+ // 1 - initial contents at the start of each captured frame are saved, even if
+ // they are later overwritten or cleared before being used.
+ // 0 - unless a read is detected, initial contents will not be saved and will
+ // appear as black or empty data.
+ eRENDERDOC_Option_SaveAllInitials = 9,
+
+ // In APIs that allow for the recording of command lists to be replayed later,
+ // RenderDoc may choose to not capture command lists before a frame capture is
+ // triggered, to reduce overheads. This means any command lists recorded once
+ // and replayed many times will not be available and may cause a failure to
+ // capture.
+ //
+ // NOTE: This is only true for APIs where multithreading is difficult or
+ // discouraged. Newer APIs like Vulkan and D3D12 will ignore this option
+ // and always capture all command lists since the API is heavily oriented
+ // around it and the overheads have been reduced by API design.
+ //
+ // 1 - All command lists are captured from the start of the application
+ // 0 - Command lists are only captured if their recording begins during
+ // the period when a frame capture is in progress.
+ eRENDERDOC_Option_CaptureAllCmdLists = 10,
+
+ // Mute API debugging output when the API validation mode option is enabled
+ //
+ // Default - enabled
+ //
+ // 1 - Mute any API debug messages from being displayed or passed through
+ // 0 - API debugging is displayed as normal
+ eRENDERDOC_Option_DebugOutputMute = 11,
+
+ // Option to allow vendor extensions to be used even when they may be
+ // incompatible with RenderDoc and cause corrupted replays or crashes.
+ //
+ // Default - inactive
+ //
+ // No values are documented, this option should only be used when absolutely
+ // necessary as directed by a RenderDoc developer.
+ eRENDERDOC_Option_AllowUnsupportedVendorExtensions = 12,
+
+} RENDERDOC_CaptureOption;
+
+// Sets an option that controls how RenderDoc behaves on capture.
+//
+// Returns 1 if the option and value are valid
+// Returns 0 if either is invalid and the option is unchanged
+typedef int(RENDERDOC_CC *pRENDERDOC_SetCaptureOptionU32)(RENDERDOC_CaptureOption opt, uint32_t val);
+typedef int(RENDERDOC_CC *pRENDERDOC_SetCaptureOptionF32)(RENDERDOC_CaptureOption opt, float val);
+
+// Gets the current value of an option as a uint32_t
+//
+// If the option is invalid, 0xffffffff is returned
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionU32)(RENDERDOC_CaptureOption opt);
+
+// Gets the current value of an option as a float
+//
+// If the option is invalid, -FLT_MAX is returned
+typedef float(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionF32)(RENDERDOC_CaptureOption opt);
+
+typedef enum RENDERDOC_InputButton {
+ // '0' - '9' matches ASCII values
+ eRENDERDOC_Key_0 = 0x30,
+ eRENDERDOC_Key_1 = 0x31,
+ eRENDERDOC_Key_2 = 0x32,
+ eRENDERDOC_Key_3 = 0x33,
+ eRENDERDOC_Key_4 = 0x34,
+ eRENDERDOC_Key_5 = 0x35,
+ eRENDERDOC_Key_6 = 0x36,
+ eRENDERDOC_Key_7 = 0x37,
+ eRENDERDOC_Key_8 = 0x38,
+ eRENDERDOC_Key_9 = 0x39,
+
+ // 'A' - 'Z' matches ASCII values
+ eRENDERDOC_Key_A = 0x41,
+ eRENDERDOC_Key_B = 0x42,
+ eRENDERDOC_Key_C = 0x43,
+ eRENDERDOC_Key_D = 0x44,
+ eRENDERDOC_Key_E = 0x45,
+ eRENDERDOC_Key_F = 0x46,
+ eRENDERDOC_Key_G = 0x47,
+ eRENDERDOC_Key_H = 0x48,
+ eRENDERDOC_Key_I = 0x49,
+ eRENDERDOC_Key_J = 0x4A,
+ eRENDERDOC_Key_K = 0x4B,
+ eRENDERDOC_Key_L = 0x4C,
+ eRENDERDOC_Key_M = 0x4D,
+ eRENDERDOC_Key_N = 0x4E,
+ eRENDERDOC_Key_O = 0x4F,
+ eRENDERDOC_Key_P = 0x50,
+ eRENDERDOC_Key_Q = 0x51,
+ eRENDERDOC_Key_R = 0x52,
+ eRENDERDOC_Key_S = 0x53,
+ eRENDERDOC_Key_T = 0x54,
+ eRENDERDOC_Key_U = 0x55,
+ eRENDERDOC_Key_V = 0x56,
+ eRENDERDOC_Key_W = 0x57,
+ eRENDERDOC_Key_X = 0x58,
+ eRENDERDOC_Key_Y = 0x59,
+ eRENDERDOC_Key_Z = 0x5A,
+
+ // leave the rest of the ASCII range free
+ // in case we want to use it later
+ eRENDERDOC_Key_NonPrintable = 0x100,
+
+ eRENDERDOC_Key_Divide,
+ eRENDERDOC_Key_Multiply,
+ eRENDERDOC_Key_Subtract,
+ eRENDERDOC_Key_Plus,
+
+ eRENDERDOC_Key_F1,
+ eRENDERDOC_Key_F2,
+ eRENDERDOC_Key_F3,
+ eRENDERDOC_Key_F4,
+ eRENDERDOC_Key_F5,
+ eRENDERDOC_Key_F6,
+ eRENDERDOC_Key_F7,
+ eRENDERDOC_Key_F8,
+ eRENDERDOC_Key_F9,
+ eRENDERDOC_Key_F10,
+ eRENDERDOC_Key_F11,
+ eRENDERDOC_Key_F12,
+
+ eRENDERDOC_Key_Home,
+ eRENDERDOC_Key_End,
+ eRENDERDOC_Key_Insert,
+ eRENDERDOC_Key_Delete,
+ eRENDERDOC_Key_PageUp,
+ eRENDERDOC_Key_PageDn,
+
+ eRENDERDOC_Key_Backspace,
+ eRENDERDOC_Key_Tab,
+ eRENDERDOC_Key_PrtScrn,
+ eRENDERDOC_Key_Pause,
+
+ eRENDERDOC_Key_Max,
+} RENDERDOC_InputButton;
+
+// Sets which key or keys can be used to toggle focus between multiple windows
+//
+// If keys is NULL or num is 0, toggle keys will be disabled
+typedef void(RENDERDOC_CC *pRENDERDOC_SetFocusToggleKeys)(RENDERDOC_InputButton *keys, int num);
+
+// Sets which key or keys can be used to capture the next frame
+//
+// If keys is NULL or num is 0, captures keys will be disabled
+typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureKeys)(RENDERDOC_InputButton *keys, int num);
+
+typedef enum RENDERDOC_OverlayBits {
+ // This single bit controls whether the overlay is enabled or disabled globally
+ eRENDERDOC_Overlay_Enabled = 0x1,
+
+ // Show the average framerate over several seconds as well as min/max
+ eRENDERDOC_Overlay_FrameRate = 0x2,
+
+ // Show the current frame number
+ eRENDERDOC_Overlay_FrameNumber = 0x4,
+
+ // Show a list of recent captures, and how many captures have been made
+ eRENDERDOC_Overlay_CaptureList = 0x8,
+
+ // Default values for the overlay mask
+ eRENDERDOC_Overlay_Default = (eRENDERDOC_Overlay_Enabled | eRENDERDOC_Overlay_FrameRate |
+ eRENDERDOC_Overlay_FrameNumber | eRENDERDOC_Overlay_CaptureList),
+
+ // Enable all bits
+ eRENDERDOC_Overlay_All = ~0U,
+
+ // Disable all bits
+ eRENDERDOC_Overlay_None = 0,
+} RENDERDOC_OverlayBits;
+
+// returns the overlay bits that have been set
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetOverlayBits)();
+// sets the overlay bits with an and & or mask
+typedef void(RENDERDOC_CC *pRENDERDOC_MaskOverlayBits)(uint32_t And, uint32_t Or);
+
+// this function will attempt to remove RenderDoc's hooks in the application.
+//
+// Note: that this can only work correctly if done immediately after
+// the module is loaded, before any API work happens. RenderDoc will remove its
+// injected hooks and shut down. Behaviour is undefined if this is called
+// after any API functions have been called, and there is still no guarantee of
+// success.
+typedef void(RENDERDOC_CC *pRENDERDOC_RemoveHooks)();
+
+// DEPRECATED: compatibility for code compiled against pre-1.4.1 headers.
+typedef pRENDERDOC_RemoveHooks pRENDERDOC_Shutdown;
+
+// This function will unload RenderDoc's crash handler.
+//
+// If you use your own crash handler and don't want RenderDoc's handler to
+// intercede, you can call this function to unload it and any unhandled
+// exceptions will pass to the next handler.
+typedef void(RENDERDOC_CC *pRENDERDOC_UnloadCrashHandler)();
+
+// Sets the capture file path template
+//
+// pathtemplate is a UTF-8 string that gives a template for how captures will be named
+// and where they will be saved.
+//
+// Any extension is stripped off the path, and captures are saved in the directory
+// specified, and named with the filename and the frame number appended. If the
+// directory does not exist it will be created, including any parent directories.
+//
+// If pathtemplate is NULL, the template will remain unchanged
+//
+// Example:
+//
+// SetCaptureFilePathTemplate("my_captures/example");
+//
+// Capture #1 -> my_captures/example_frame123.rdc
+// Capture #2 -> my_captures/example_frame456.rdc
+typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureFilePathTemplate)(const char *pathtemplate);
+
+// returns the current capture path template, see SetCaptureFileTemplate above, as a UTF-8 string
+typedef const char *(RENDERDOC_CC *pRENDERDOC_GetCaptureFilePathTemplate)();
+
+// DEPRECATED: compatibility for code compiled against pre-1.1.2 headers.
+typedef pRENDERDOC_SetCaptureFilePathTemplate pRENDERDOC_SetLogFilePathTemplate;
+typedef pRENDERDOC_GetCaptureFilePathTemplate pRENDERDOC_GetLogFilePathTemplate;
+
+// returns the number of captures that have been made
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetNumCaptures)();
+
+// This function returns the details of a capture, by index. New captures are added
+// to the end of the list.
+//
+// filename will be filled with the absolute path to the capture file, as a UTF-8 string
+// pathlength will be written with the length in bytes of the filename string
+// timestamp will be written with the time of the capture, in seconds since the Unix epoch
+//
+// Any of the parameters can be NULL and they'll be skipped.
+//
+// The function will return 1 if the capture index is valid, or 0 if the index is invalid
+// If the index is invalid, the values will be unchanged
+//
+// Note: when captures are deleted in the UI they will remain in this list, so the
+// capture path may not exist anymore.
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCapture)(uint32_t idx, char *filename,
+ uint32_t *pathlength, uint64_t *timestamp);
+
+// Sets the comments associated with a capture file. These comments are displayed in the
+// UI program when opening.
+//
+// filePath should be a path to the capture file to add comments to. If set to NULL or ""
+// the most recent capture file created made will be used instead.
+// comments should be a NULL-terminated UTF-8 string to add as comments.
+//
+// Any existing comments will be overwritten.
+typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureFileComments)(const char *filePath,
+ const char *comments);
+
+// returns 1 if the RenderDoc UI is connected to this application, 0 otherwise
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_IsTargetControlConnected)();
+
+// DEPRECATED: compatibility for code compiled against pre-1.1.1 headers.
+// This was renamed to IsTargetControlConnected in API 1.1.1, the old typedef is kept here for
+// backwards compatibility with old code, it is castable either way since it's ABI compatible
+// as the same function pointer type.
+typedef pRENDERDOC_IsTargetControlConnected pRENDERDOC_IsRemoteAccessConnected;
+
+// This function will launch the Replay UI associated with the RenderDoc library injected
+// into the running application.
+//
+// if connectTargetControl is 1, the Replay UI will be launched with a command line parameter
+// to connect to this application
+// cmdline is the rest of the command line, as a UTF-8 string. E.g. a captures to open
+// if cmdline is NULL, the command line will be empty.
+//
+// returns the PID of the replay UI if successful, 0 if not successful.
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_LaunchReplayUI)(uint32_t connectTargetControl,
+ const char *cmdline);
+
+// RenderDoc can return a higher version than requested if it's backwards compatible,
+// this function returns the actual version returned. If a parameter is NULL, it will be
+// ignored and the others will be filled out.
+typedef void(RENDERDOC_CC *pRENDERDOC_GetAPIVersion)(int *major, int *minor, int *patch);
+
+//////////////////////////////////////////////////////////////////////////
+// Capturing functions
+//
+
+// A device pointer is a pointer to the API's root handle.
+//
+// This would be an ID3D11Device, HGLRC/GLXContext, ID3D12Device, etc
+typedef void *RENDERDOC_DevicePointer;
+
+// A window handle is the OS's native window handle
+//
+// This would be an HWND, GLXDrawable, etc
+typedef void *RENDERDOC_WindowHandle;
+
+// A helper macro for Vulkan, where the device handle cannot be used directly.
+//
+// Passing the VkInstance to this macro will return the RENDERDOC_DevicePointer to use.
+//
+// Specifically, the value needed is the dispatch table pointer, which sits as the first
+// pointer-sized object in the memory pointed to by the VkInstance. Thus we cast to a void** and
+// indirect once.
+#define RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(inst) (*((void **)(inst)))
+
+// This sets the RenderDoc in-app overlay in the API/window pair as 'active' and it will
+// respond to keypresses. Neither parameter can be NULL
+typedef void(RENDERDOC_CC *pRENDERDOC_SetActiveWindow)(RENDERDOC_DevicePointer device,
+ RENDERDOC_WindowHandle wndHandle);
+
+// capture the next frame on whichever window and API is currently considered active
+typedef void(RENDERDOC_CC *pRENDERDOC_TriggerCapture)();
+
+// capture the next N frames on whichever window and API is currently considered active
+typedef void(RENDERDOC_CC *pRENDERDOC_TriggerMultiFrameCapture)(uint32_t numFrames);
+
+// When choosing either a device pointer or a window handle to capture, you can pass NULL.
+// Passing NULL specifies a 'wildcard' match against anything. This allows you to specify
+// any API rendering to a specific window, or a specific API instance rendering to any window,
+// or in the simplest case of one window and one API, you can just pass NULL for both.
+//
+// In either case, if there are two or more possible matching (device,window) pairs it
+// is undefined which one will be captured.
+//
+// Note: for headless rendering you can pass NULL for the window handle and either specify
+// a device pointer or leave it NULL as above.
+
+// Immediately starts capturing API calls on the specified device pointer and window handle.
+//
+// If there is no matching thing to capture (e.g. no supported API has been initialised),
+// this will do nothing.
+//
+// The results are undefined (including crashes) if two captures are started overlapping,
+// even on separate devices and/oror windows.
+typedef void(RENDERDOC_CC *pRENDERDOC_StartFrameCapture)(RENDERDOC_DevicePointer device,
+ RENDERDOC_WindowHandle wndHandle);
+
+// Returns whether or not a frame capture is currently ongoing anywhere.
+//
+// This will return 1 if a capture is ongoing, and 0 if there is no capture running
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_IsFrameCapturing)();
+
+// Ends capturing immediately.
+//
+// This will return 1 if the capture succeeded, and 0 if there was an error capturing.
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(RENDERDOC_DevicePointer device,
+ RENDERDOC_WindowHandle wndHandle);
+
+// Ends capturing immediately and discard any data stored without saving to disk.
+//
+// This will return 1 if the capture was discarded, and 0 if there was an error or no capture
+// was in progress
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_DiscardFrameCapture)(RENDERDOC_DevicePointer device,
+ RENDERDOC_WindowHandle wndHandle);
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+// RenderDoc API versions
+//
+
+// RenderDoc uses semantic versioning (http://semver.org/).
+//
+// MAJOR version is incremented when incompatible API changes happen.
+// MINOR version is incremented when functionality is added in a backwards-compatible manner.
+// PATCH version is incremented when backwards-compatible bug fixes happen.
+//
+// Note that this means the API returned can be higher than the one you might have requested.
+// e.g. if you are running against a newer RenderDoc that supports 1.0.1, it will be returned
+// instead of 1.0.0. You can check this with the GetAPIVersion entry point
+typedef enum RENDERDOC_Version {
+ eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 00 00
+ eRENDERDOC_API_Version_1_0_1 = 10001, // RENDERDOC_API_1_0_1 = 1 00 01
+ eRENDERDOC_API_Version_1_0_2 = 10002, // RENDERDOC_API_1_0_2 = 1 00 02
+ eRENDERDOC_API_Version_1_1_0 = 10100, // RENDERDOC_API_1_1_0 = 1 01 00
+ eRENDERDOC_API_Version_1_1_1 = 10101, // RENDERDOC_API_1_1_1 = 1 01 01
+ eRENDERDOC_API_Version_1_1_2 = 10102, // RENDERDOC_API_1_1_2 = 1 01 02
+ eRENDERDOC_API_Version_1_2_0 = 10200, // RENDERDOC_API_1_2_0 = 1 02 00
+ eRENDERDOC_API_Version_1_3_0 = 10300, // RENDERDOC_API_1_3_0 = 1 03 00
+ eRENDERDOC_API_Version_1_4_0 = 10400, // RENDERDOC_API_1_4_0 = 1 04 00
+ eRENDERDOC_API_Version_1_4_1 = 10401, // RENDERDOC_API_1_4_1 = 1 04 01
+ eRENDERDOC_API_Version_1_4_2 = 10402, // RENDERDOC_API_1_4_2 = 1 04 02
+} RENDERDOC_Version;
+
+// API version changelog:
+//
+// 1.0.0 - initial release
+// 1.0.1 - Bugfix: IsFrameCapturing() was returning false for captures that were triggered
+// by keypress or TriggerCapture, instead of Start/EndFrameCapture.
+// 1.0.2 - Refactor: Renamed eRENDERDOC_Option_DebugDeviceMode to eRENDERDOC_Option_APIValidation
+// 1.1.0 - Add feature: TriggerMultiFrameCapture(). Backwards compatible with 1.0.x since the new
+// function pointer is added to the end of the struct, the original layout is identical
+// 1.1.1 - Refactor: Renamed remote access to target control (to better disambiguate from remote
+// replay/remote server concept in replay UI)
+// 1.1.2 - Refactor: Renamed "log file" in function names to just capture, to clarify that these
+// are captures and not debug logging files. This is the first API version in the v1.0
+// branch.
+// 1.2.0 - Added feature: SetCaptureFileComments() to add comments to a capture file that will be
+// displayed in the UI program on load.
+// 1.3.0 - Added feature: New capture option eRENDERDOC_Option_AllowUnsupportedVendorExtensions
+// which allows users to opt-in to allowing unsupported vendor extensions to function.
+// Should be used at the user's own risk.
+// Refactor: Renamed eRENDERDOC_Option_VerifyMapWrites to
+// eRENDERDOC_Option_VerifyBufferAccess, which now also controls initialisation to
+// 0xdddddddd of uninitialised buffer contents.
+// 1.4.0 - Added feature: DiscardFrameCapture() to discard a frame capture in progress and stop
+// capturing without saving anything to disk.
+// 1.4.1 - Refactor: Renamed Shutdown to RemoveHooks to better clarify what is happening
+// 1.4.2 - Refactor: Renamed 'draws' to 'actions' in callstack capture option.
+
+typedef struct RENDERDOC_API_1_4_1
+{
+ pRENDERDOC_GetAPIVersion GetAPIVersion;
+
+ pRENDERDOC_SetCaptureOptionU32 SetCaptureOptionU32;
+ pRENDERDOC_SetCaptureOptionF32 SetCaptureOptionF32;
+
+ pRENDERDOC_GetCaptureOptionU32 GetCaptureOptionU32;
+ pRENDERDOC_GetCaptureOptionF32 GetCaptureOptionF32;
+
+ pRENDERDOC_SetFocusToggleKeys SetFocusToggleKeys;
+ pRENDERDOC_SetCaptureKeys SetCaptureKeys;
+
+ pRENDERDOC_GetOverlayBits GetOverlayBits;
+ pRENDERDOC_MaskOverlayBits MaskOverlayBits;
+
+ // Shutdown was renamed to RemoveHooks in 1.4.1.
+ // These unions allow old code to continue compiling without changes
+ union
+ {
+ pRENDERDOC_Shutdown Shutdown;
+ pRENDERDOC_RemoveHooks RemoveHooks;
+ };
+ pRENDERDOC_UnloadCrashHandler UnloadCrashHandler;
+
+ // Get/SetLogFilePathTemplate was renamed to Get/SetCaptureFilePathTemplate in 1.1.2.
+ // These unions allow old code to continue compiling without changes
+ union
+ {
+ // deprecated name
+ pRENDERDOC_SetLogFilePathTemplate SetLogFilePathTemplate;
+ // current name
+ pRENDERDOC_SetCaptureFilePathTemplate SetCaptureFilePathTemplate;
+ };
+ union
+ {
+ // deprecated name
+ pRENDERDOC_GetLogFilePathTemplate GetLogFilePathTemplate;
+ // current name
+ pRENDERDOC_GetCaptureFilePathTemplate GetCaptureFilePathTemplate;
+ };
+
+ pRENDERDOC_GetNumCaptures GetNumCaptures;
+ pRENDERDOC_GetCapture GetCapture;
+
+ pRENDERDOC_TriggerCapture TriggerCapture;
+
+ // IsRemoteAccessConnected was renamed to IsTargetControlConnected in 1.1.1.
+ // This union allows old code to continue compiling without changes
+ union
+ {
+ // deprecated name
+ pRENDERDOC_IsRemoteAccessConnected IsRemoteAccessConnected;
+ // current name
+ pRENDERDOC_IsTargetControlConnected IsTargetControlConnected;
+ };
+ pRENDERDOC_LaunchReplayUI LaunchReplayUI;
+
+ pRENDERDOC_SetActiveWindow SetActiveWindow;
+
+ pRENDERDOC_StartFrameCapture StartFrameCapture;
+ pRENDERDOC_IsFrameCapturing IsFrameCapturing;
+ pRENDERDOC_EndFrameCapture EndFrameCapture;
+
+ // new function in 1.1.0
+ pRENDERDOC_TriggerMultiFrameCapture TriggerMultiFrameCapture;
+
+ // new function in 1.2.0
+ pRENDERDOC_SetCaptureFileComments SetCaptureFileComments;
+
+ // new function in 1.4.0
+ pRENDERDOC_DiscardFrameCapture DiscardFrameCapture;
+} RENDERDOC_API_1_4_2;
+
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_0_0;
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_0_1;
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_0_2;
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_1_0;
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_1_1;
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_1_2;
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_2_0;
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_3_0;
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_4_0;
+typedef RENDERDOC_API_1_4_2 RENDERDOC_API_1_4_0;
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+// RenderDoc API entry point
+//
+// This entry point can be obtained via GetProcAddress/dlsym if RenderDoc is available.
+//
+// The name is the same as the typedef - "RENDERDOC_GetAPI"
+//
+// This function is not thread safe, and should not be called on multiple threads at once.
+// Ideally, call this once as early as possible in your application's startup, before doing
+// any API work, since some configuration functionality etc has to be done also before
+// initialising any APIs.
+//
+// Parameters:
+// version is a single value from the RENDERDOC_Version above.
+//
+// outAPIPointers will be filled out with a pointer to the corresponding struct of function
+// pointers.
+//
+// Returns:
+// 1 - if the outAPIPointers has been filled with a pointer to the API struct requested
+// 0 - if the requested version is not supported or the arguments are invalid.
+//
+typedef int(RENDERDOC_CC *pRENDERDOC_GetAPI)(RENDERDOC_Version version, void **outAPIPointers);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif \ No newline at end of file
diff --git a/src/gfxstream/utils/GfxApiLogger.cpp b/src/gfxstream/utils/GfxApiLogger.cpp
new file mode 100644
index 00000000000..e08bec6c1be
--- /dev/null
+++ b/src/gfxstream/utils/GfxApiLogger.cpp
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */
+
+// This file is reserved for upstreaming the GfxApiLogger implementation.
diff --git a/src/gfxstream/utils/GfxApiLogger_unittest.cpp b/src/gfxstream/utils/GfxApiLogger_unittest.cpp
new file mode 100644
index 00000000000..cb5bc93a0af
--- /dev/null
+++ b/src/gfxstream/utils/GfxApiLogger_unittest.cpp
@@ -0,0 +1,15 @@
+// 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.
+
+// This file is reserved for upstreaming the GfxApiLogger unit tests.
diff --git a/src/gfxstream/utils/RenderDoc_unittest.cpp b/src/gfxstream/utils/RenderDoc_unittest.cpp
new file mode 100644
index 00000000000..348a99e96be
--- /dev/null
+++ b/src/gfxstream/utils/RenderDoc_unittest.cpp
@@ -0,0 +1,178 @@
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "utils/RenderDoc.h"
+
+#include <type_traits>
+
+#include "aemu/base/SharedLibrary.h"
+
+namespace emugl {
+namespace {
+
+using ::testing::_;
+using ::testing::DoAll;
+using ::testing::InSequence;
+using ::testing::MockFunction;
+using ::testing::Return;
+using ::testing::SetArgPointee;
+
+using FunctionPtr = android::base::SharedLibrary::FunctionPtr;
+using RenderDocApi = RenderDoc::RenderDocApi;
+
+class MockSharedLibrary : public android::base::SharedLibrary {
+ public:
+ MockSharedLibrary() : SharedLibrary(NULL) {}
+ MOCK_METHOD(FunctionPtr, findSymbol, (const char*), (const, override));
+};
+
+TEST(RenderDocTest, InitializeWithNullSharedLibrary) {
+ EXPECT_EQ(RenderDoc::create(nullptr), nullptr);
+}
+
+TEST(RenderDocTest, CantFindRENDERDOC_GetAPI) {
+ MockSharedLibrary sharedLibrary;
+ EXPECT_CALL(sharedLibrary, findSymbol(_)).WillRepeatedly(Return(nullptr));
+ EXPECT_EQ(RenderDoc::create(&sharedLibrary), nullptr);
+}
+
+TEST(RenderDocTest, RENDERDOC_GetAPIFails) {
+ MockSharedLibrary sharedLibrary;
+ static MockFunction<std::remove_pointer_t<pRENDERDOC_GetAPI>> mockRENDERDOC_GetAPI;
+ static pRENDERDOC_GetAPI fpMockRENDERDOC_GetAPI = [](RENDERDOC_Version version,
+ void** outAPIPointers) {
+ return mockRENDERDOC_GetAPI.Call(version, outAPIPointers);
+ };
+ RenderDocApi rdocApi;
+
+ EXPECT_CALL(sharedLibrary, findSymbol(_)).WillRepeatedly(Return(nullptr));
+ EXPECT_CALL(sharedLibrary, findSymbol("RENDERDOC_GetAPI"))
+ .WillRepeatedly(Return(reinterpret_cast<FunctionPtr>(fpMockRENDERDOC_GetAPI)));
+
+ EXPECT_CALL(mockRENDERDOC_GetAPI, Call(_, _))
+ .WillRepeatedly(DoAll(SetArgPointee<1>(&rdocApi), Return(0)));
+ EXPECT_EQ(RenderDoc::create(&sharedLibrary), nullptr);
+
+ EXPECT_CALL(mockRENDERDOC_GetAPI, Call(_, _))
+ .WillRepeatedly(DoAll(SetArgPointee<1>(nullptr), Return(1)));
+ EXPECT_EQ(RenderDoc::create(&sharedLibrary), nullptr);
+}
+
+TEST(RenderDocTest, CreateSuccessfully) {
+ MockSharedLibrary sharedLibrary;
+ static MockFunction<std::remove_pointer_t<pRENDERDOC_GetAPI>> mockRENDERDOC_GetAPI;
+ static pRENDERDOC_GetAPI fpMockRENDERDOC_GetAPI = [](RENDERDOC_Version version,
+ void** outAPIPointers) {
+ return mockRENDERDOC_GetAPI.Call(version, outAPIPointers);
+ };
+ RenderDocApi rdocApiMock;
+ static MockFunction<std::remove_pointer_t<pRENDERDOC_GetCaptureOptionU32>>
+ getCaptureOptionU32Mock;
+ rdocApiMock.GetCaptureOptionU32 = [](RENDERDOC_CaptureOption option) {
+ return getCaptureOptionU32Mock.Call(option);
+ };
+
+ EXPECT_CALL(sharedLibrary, findSymbol(_)).WillRepeatedly(Return(nullptr));
+ EXPECT_CALL(sharedLibrary, findSymbol("RENDERDOC_GetAPI"))
+ .WillRepeatedly(Return(reinterpret_cast<FunctionPtr>(fpMockRENDERDOC_GetAPI)));
+ EXPECT_CALL(mockRENDERDOC_GetAPI, Call(_, _))
+ .WillRepeatedly(DoAll(SetArgPointee<1>(&rdocApiMock), Return(1)));
+ std::unique_ptr<RenderDoc> renderDoc = RenderDoc::create(&sharedLibrary);
+ EXPECT_NE(renderDoc, nullptr);
+
+ EXPECT_CALL(getCaptureOptionU32Mock, Call(eRENDERDOC_Option_DebugOutputMute))
+ .WillRepeatedly(Return(1));
+ EXPECT_EQ(renderDoc->call(RenderDoc::kGetCaptureOptionU32, eRENDERDOC_Option_DebugOutputMute),
+ 1);
+}
+
+class RenderDocMock {
+ public:
+ // For StartFrameCapture
+ MOCK_METHOD(void, call,
+ (void (*RenderDocApi::*function)(RENDERDOC_DevicePointer, RENDERDOC_WindowHandle),
+ RENDERDOC_DevicePointer, RENDERDOC_WindowHandle),
+ (const));
+ // For EndFrameCapture
+ MOCK_METHOD(uint32_t, call,
+ (uint32_t(*RenderDocApi::*function)(RENDERDOC_DevicePointer,
+ RENDERDOC_WindowHandle),
+ RENDERDOC_DevicePointer, RENDERDOC_WindowHandle),
+ (const));
+ // For IsFrameCapturing
+ MOCK_METHOD(uint32_t, call, (uint32_t(*RenderDocApi::*function)()), (const));
+};
+
+using RenderDocWithMultipleVkInstances = RenderDocWithMultipleVkInstancesBase<RenderDocMock>;
+
+TEST(RenderDocWithMultipleVkInstancesTest,
+ ShouldNotStartFrameCaptureOnFrameDelimiterWhenNotCapturing) {
+ RenderDocMock renderDocMock;
+ intptr_t vkInstanceInternal = 0x1234;
+ VkInstance vkInstance = reinterpret_cast<VkInstance>(&vkInstanceInternal);
+ RenderDocWithMultipleVkInstances renderDocWithMultipleVkInstances(renderDocMock);
+
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kIsFrameCapturing)).WillRepeatedly(Return(0));
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kStartFrameCapture, _, _)).Times(0);
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kEndFrameCapture, _, _)).Times(0);
+
+ renderDocWithMultipleVkInstances.onFrameDelimiter(vkInstance);
+}
+
+TEST(RenderDocWithMultipleVkInstancesTest, ShouldStartAndEndFrameCaptureOnFrameDelimiter) {
+ RenderDocMock renderDocMock;
+ intptr_t vkInstanceInternal = 0x4321;
+ VkInstance vkInstance = reinterpret_cast<VkInstance>(&vkInstanceInternal);
+ RenderDocWithMultipleVkInstances renderDocWithMultipleVkInstances(renderDocMock);
+
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kIsFrameCapturing)).WillRepeatedly(Return(1));
+ {
+ InSequence s;
+
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kStartFrameCapture,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(vkInstance), NULL))
+ .Times(1);
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kEndFrameCapture,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(vkInstance), NULL))
+ .Times(1)
+ .WillRepeatedly(Return(1));
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kStartFrameCapture,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(vkInstance), NULL))
+ .Times(1);
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kEndFrameCapture,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(vkInstance), NULL))
+ .Times(1)
+ .WillRepeatedly(Return(1));
+ }
+
+ renderDocWithMultipleVkInstances.onFrameDelimiter(vkInstance);
+ renderDocWithMultipleVkInstances.onFrameDelimiter(vkInstance);
+}
+
+TEST(RenderDocWithMultipleVkInstancesTest, ShouldEndFrameCaptureOnVkInstanceRemoved) {
+ RenderDocMock renderDocMock;
+ intptr_t vkInstanceInternal = 0x4321;
+ VkInstance vkInstance = reinterpret_cast<VkInstance>(&vkInstanceInternal);
+ RenderDocWithMultipleVkInstances renderDocWithMultipleVkInstances(renderDocMock);
+
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kIsFrameCapturing)).WillRepeatedly(Return(1));
+ {
+ InSequence s;
+
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kStartFrameCapture,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(vkInstance), NULL))
+ .Times(1);
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kEndFrameCapture,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(vkInstance), NULL))
+ .Times(1)
+ .WillRepeatedly(Return(1));
+ }
+
+ renderDocWithMultipleVkInstances.onFrameDelimiter(vkInstance);
+ renderDocWithMultipleVkInstances.removeVkInstance(vkInstance);
+ EXPECT_CALL(renderDocMock, call(RenderDoc::kEndFrameCapture,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(vkInstance), NULL))
+ .Times(0);
+}
+} // namespace
+} // namespace emugl
diff --git a/src/gfxstream/utils/include/utils/GfxApiLogger.h b/src/gfxstream/utils/include/utils/GfxApiLogger.h
new file mode 100644
index 00000000000..73cfd2da7b0
--- /dev/null
+++ b/src/gfxstream/utils/include/utils/GfxApiLogger.h
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#define OP_gfxApiLoggerBeginCommandExecution 90000
+
+namespace emugl {
+// TODO(kaiyili): complete the implementation in
+// https://r.android.com/c/device/generic/vulkan-cereal/+/2165168.
+class GfxApiLogger {
+ public:
+ void record(const unsigned char* buf, size_t len) {}
+ void recordCommandExecution() {};
+};
+} // namespace emugl \ No newline at end of file
diff --git a/src/gfxstream/utils/include/utils/RenderDoc.h b/src/gfxstream/utils/include/utils/RenderDoc.h
new file mode 100644
index 00000000000..f3eacd54c4e
--- /dev/null
+++ b/src/gfxstream/utils/include/utils/RenderDoc.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2011-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 RENDER_DOC_H
+#define RENDER_DOC_H
+
+#include <renderdoc_app.h>
+
+#include <algorithm>
+#include <cstring>
+#include <memory>
+#include <mutex>
+#include <string>
+#include <type_traits>
+#include <unordered_map>
+#include <vector>
+
+#include "aemu/base/SharedLibrary.h"
+#include "host-common/logging.h"
+#include "vulkan/vulkan.h"
+
+using android::base::SharedLibrary;
+
+namespace emugl {
+class RenderDoc {
+ public:
+ using RenderDocApi = RENDERDOC_API_1_4_2;
+ static std::unique_ptr<RenderDoc> create(const SharedLibrary* renderDocLib) {
+ if (!renderDocLib) {
+ ERR("The renderdoc shared library is null.");
+ return nullptr;
+ }
+ pRENDERDOC_GetAPI RENDERDOC_GetAPI =
+ reinterpret_cast<pRENDERDOC_GetAPI>(renderDocLib->findSymbol("RENDERDOC_GetAPI"));
+ if (!RENDERDOC_GetAPI) {
+ ERR("Failed to find the RENDERDOC_GetAPI symbol.");
+ return nullptr;
+ }
+ RenderDocApi* rdocApi = nullptr;
+ int ret =
+ RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_4_2, reinterpret_cast<void**>(&rdocApi));
+ if (ret != 1 || rdocApi == nullptr) {
+ ERR("Failed to load renderdoc API. %d is returned from RENDERDOC_GetAPI.");
+ return nullptr;
+ }
+ return std::unique_ptr<RenderDoc>(new RenderDoc(rdocApi));
+ }
+
+ static constexpr auto kSetActiveWindow = &RenderDocApi::SetActiveWindow;
+ static constexpr auto kGetCaptureOptionU32 = &RenderDocApi::GetCaptureOptionU32;
+ static constexpr auto kIsFrameCapturing = &RenderDocApi::IsFrameCapturing;
+ static constexpr auto kStartFrameCapture = &RenderDocApi::StartFrameCapture;
+ static constexpr auto kEndFrameCapture = &RenderDocApi::EndFrameCapture;
+ template <class F, class... Args, typename = std::enable_if_t<std::is_invocable_v<F, Args...>>>
+ // Call a RenderDoc in-application API given the function pointer and parameters, and guard the
+ // API call with a mutex.
+ auto call(F(RenderDocApi::*function), Args... args) const {
+ std::lock_guard<std::mutex> guard(mMutex);
+ return (mRdocApi->*function)(args...);
+ }
+
+ private:
+ RenderDoc(RenderDocApi* rdocApi) : mRdocApi(rdocApi) {}
+
+ mutable std::mutex mMutex;
+ RenderDocApi* mRdocApi = nullptr;
+};
+
+template <class RenderDocT>
+class RenderDocWithMultipleVkInstancesBase {
+ public:
+ RenderDocWithMultipleVkInstancesBase(RenderDocT& renderDoc) : mRenderDoc(renderDoc) {}
+
+ void onFrameDelimiter(VkInstance vkInstance) {
+ std::lock_guard<std::mutex> guard(mMutex);
+ mCaptureContexts.erase(vkInstance);
+ if (mRenderDoc.call(RenderDoc::kIsFrameCapturing)) {
+ mCaptureContexts.emplace(vkInstance,
+ std::make_unique<CaptureContext>(mRenderDoc, vkInstance));
+ }
+ }
+
+ void removeVkInstance(VkInstance vkInstance) {
+ std::lock_guard<std::mutex> guard(mMutex);
+ mCaptureContexts.erase(vkInstance);
+ }
+
+ private:
+ class CaptureContext {
+ public:
+ CaptureContext(RenderDocT& renderDoc, VkInstance vkInstance)
+ : mRenderDoc(renderDoc), mVkInstance(vkInstance) {
+ mRenderDoc.call(RenderDoc::kStartFrameCapture,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(mVkInstance), nullptr);
+ }
+ ~CaptureContext() {
+ mRenderDoc.call(RenderDoc::kEndFrameCapture,
+ RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(mVkInstance), nullptr);
+ }
+
+ private:
+ const RenderDocT& mRenderDoc;
+ const VkInstance mVkInstance;
+ };
+ std::mutex mMutex;
+ std::unordered_map<VkInstance, std::unique_ptr<CaptureContext>> mCaptureContexts;
+ RenderDocT& mRenderDoc;
+};
+
+using RenderDocWithMultipleVkInstances = RenderDocWithMultipleVkInstancesBase<RenderDoc>;
+} // namespace emugl
+
+#endif